@moonshot-ai/kimi-code 0.26.0 → 0.28.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 (68) hide show
  1. package/dist/main.mjs +105661 -103321
  2. package/dist-web/assets/{CodeBlockNode-JigiL_d4.js → CodeBlockNode-CpzD9pIh.js} +1 -1
  3. package/dist-web/assets/{CodeBlockShell.vue_vue_type_style_index_0_lang-CZB03k-a.js → CodeBlockShell.vue_vue_type_style_index_0_lang-4BOr1NEZ.js} +1 -1
  4. package/dist-web/assets/{DesignSystemView-B-05E4V9.js → DesignSystemView-CAPhy_9h.js} +1 -1
  5. package/dist-web/assets/{Tooltip-Cw3lx-z8.js → Tooltip-Dwaxrzgs.js} +1 -1
  6. package/dist-web/assets/{arc-D2vJFF6c.js → arc-B-zaR26g.js} +1 -1
  7. package/dist-web/assets/{architectureDiagram-3BPJPVTR-Df1UeK5E.js → architectureDiagram-3BPJPVTR-CATdJKJ5.js} +1 -1
  8. package/dist-web/assets/{blockDiagram-GPEHLZMM-Dgdf-zAM.js → blockDiagram-GPEHLZMM-CsROFYwa.js} +1 -1
  9. package/dist-web/assets/{c4Diagram-AAUBKEIU-CVS7v_bq.js → c4Diagram-AAUBKEIU-DOBa3zmH.js} +1 -1
  10. package/dist-web/assets/channel-BcTpRHJD.js +1 -0
  11. package/dist-web/assets/{chunk-2J33WTMH-DhINJh7R.js → chunk-2J33WTMH-xaMYyJs9.js} +1 -1
  12. package/dist-web/assets/{chunk-4BX2VUAB-CR40QGad.js → chunk-4BX2VUAB-HPPRmEot.js} +1 -1
  13. package/dist-web/assets/{chunk-55IACEB6-DPUxa6z0.js → chunk-55IACEB6-DYn06dK7.js} +1 -1
  14. package/dist-web/assets/{chunk-727SXJPM-BWvX468K.js → chunk-727SXJPM-BexmxVz4.js} +1 -1
  15. package/dist-web/assets/{chunk-AQP2D5EJ-DyFilYHM.js → chunk-AQP2D5EJ-C_SB9NvU.js} +1 -1
  16. package/dist-web/assets/{chunk-FMBD7UC4-Bg8gv0kQ.js → chunk-FMBD7UC4-BI34yDgp.js} +1 -1
  17. package/dist-web/assets/{chunk-ND2GUHAM-CgyBSWHA.js → chunk-ND2GUHAM-DcY9pc7d.js} +1 -1
  18. package/dist-web/assets/{chunk-QZHKN3VN-DvzUq1dT.js → chunk-QZHKN3VN-C0-FiLRl.js} +1 -1
  19. package/dist-web/assets/classDiagram-4FO5ZUOK-DMLt5JYF.js +1 -0
  20. package/dist-web/assets/classDiagram-v2-Q7XG4LA2-DMLt5JYF.js +1 -0
  21. package/dist-web/assets/{cose-bilkent-S5V4N54A-LU19ShHC.js → cose-bilkent-S5V4N54A-BP0LFN-g.js} +1 -1
  22. package/dist-web/assets/{dagre-BM42HDAG-DiilOzYU.js → dagre-BM42HDAG-B7ZisKrz.js} +1 -1
  23. package/dist-web/assets/{diagram-2AECGRRQ-Dq4mZYTA.js → diagram-2AECGRRQ-CnyNSW4k.js} +1 -1
  24. package/dist-web/assets/{diagram-5GNKFQAL-BMxBErB7.js → diagram-5GNKFQAL-3zPYNOge.js} +1 -1
  25. package/dist-web/assets/{diagram-KO2AKTUF-Dl1uwLTa.js → diagram-KO2AKTUF-Brkm9gVn.js} +1 -1
  26. package/dist-web/assets/{diagram-LMA3HP47-BLV66BdW.js → diagram-LMA3HP47-DPnNBr5R.js} +1 -1
  27. package/dist-web/assets/{diagram-OG6HWLK6-BDaRMm08.js → diagram-OG6HWLK6-DQDKGkhn.js} +1 -1
  28. package/dist-web/assets/{erDiagram-TEJ5UH35-De2es75Z.js → erDiagram-TEJ5UH35-5xPgVvkn.js} +1 -1
  29. package/dist-web/assets/{flowDiagram-I6XJVG4X-DclyVvkE.js → flowDiagram-I6XJVG4X-C5tS79Vl.js} +1 -1
  30. package/dist-web/assets/{ganttDiagram-6RSMTGT7-D0Q-Ia-a.js → ganttDiagram-6RSMTGT7-B-aU3OPj.js} +1 -1
  31. package/dist-web/assets/{gitGraphDiagram-PVQCEYII-4e9vXj8W.js → gitGraphDiagram-PVQCEYII-BFOJguDm.js} +1 -1
  32. package/dist-web/assets/{index-I7R1SQsL.css → index-B1NSLoRl.css} +1 -1
  33. package/dist-web/assets/{index-CR1e9nsD.js → index-BNKnp8D0.js} +2 -2
  34. package/dist-web/assets/{index-BBWUkRCO.js → index-D7dRCfzM.js} +1 -1
  35. package/dist-web/assets/index-DLnc53b5.js +325 -0
  36. package/dist-web/assets/{index10--9NgV5KO.js → index10-BOW3dYHz.js} +1 -1
  37. package/dist-web/assets/{index11-vhJM9Zd7.js → index11-BiTpnbks.js} +1 -1
  38. package/dist-web/assets/{index5-BwxQZskx.js → index5-B0hk6c-S.js} +1 -1
  39. package/dist-web/assets/{index6-CCep5k45.js → index6-Cq--amYl.js} +1 -1
  40. package/dist-web/assets/{index7-BpvJXlrz.js → index7-CTeSdr9M.js} +1 -1
  41. package/dist-web/assets/{index8-DcnUd6X7.js → index8-B0l1OZhe.js} +2 -2
  42. package/dist-web/assets/{infoDiagram-5YYISTIA-DHRABO78.js → infoDiagram-5YYISTIA-D8bmKUXu.js} +1 -1
  43. package/dist-web/assets/{ishikawaDiagram-YF4QCWOH-CQvQ04o4.js → ishikawaDiagram-YF4QCWOH-CzPbh0w7.js} +1 -1
  44. package/dist-web/assets/{journeyDiagram-JHISSGLW-BPUe0bJA.js → journeyDiagram-JHISSGLW-D-sBFsVt.js} +1 -1
  45. package/dist-web/assets/{kanban-definition-UN3LZRKU-B4fkPD56.js → kanban-definition-UN3LZRKU-BDVftWH1.js} +1 -1
  46. package/dist-web/assets/{linear-BBpz4kpy.js → linear-CqMeQ8s8.js} +1 -1
  47. package/dist-web/assets/{mermaid.core-WG0zjqjP.js → mermaid.core-CYrANWGu.js} +4 -4
  48. package/dist-web/assets/{mindmap-definition-RKZ34NQL-6QrrPC-x.js → mindmap-definition-RKZ34NQL-CgI9y69S.js} +1 -1
  49. package/dist-web/assets/{pieDiagram-4H26LBE5-Cbk8F7HI.js → pieDiagram-4H26LBE5-3Keprluu.js} +1 -1
  50. package/dist-web/assets/{quadrantDiagram-W4KKPZXB-UCR6ity-.js → quadrantDiagram-W4KKPZXB-DqImRjxY.js} +1 -1
  51. package/dist-web/assets/{requirementDiagram-4Y6WPE33-P2r_Lr3t.js → requirementDiagram-4Y6WPE33-MvPeqGEw.js} +1 -1
  52. package/dist-web/assets/{sankeyDiagram-5OEKKPKP-BZztGDG9.js → sankeyDiagram-5OEKKPKP-C2UAN3KA.js} +1 -1
  53. package/dist-web/assets/{sequenceDiagram-3UESZ5HK-Cf4C7Z1l.js → sequenceDiagram-3UESZ5HK-hrx20C-k.js} +1 -1
  54. package/dist-web/assets/{stateDiagram-AJRCARHV-3dcgw49E.js → stateDiagram-AJRCARHV-rHdx4mRg.js} +1 -1
  55. package/dist-web/assets/stateDiagram-v2-BHNVJYJU-fL4KOlqE.js +1 -0
  56. package/dist-web/assets/{timeline-definition-PNZ67QCA-D8Wuxi_e.js → timeline-definition-PNZ67QCA-CGkFjfix.js} +1 -1
  57. package/dist-web/assets/{vennDiagram-CIIHVFJN-CJZRHa6X.js → vennDiagram-CIIHVFJN-Ddg9Ws7f.js} +1 -1
  58. package/dist-web/assets/{vue.runtime.esm-bundler-ChfQpT4C.js → vue.runtime.esm-bundler-DI8JNuz0.js} +1 -1
  59. package/dist-web/assets/{wardley-L42UT6IY-eT9HyLJX.js → wardley-L42UT6IY-xgCal_DX.js} +1 -1
  60. package/dist-web/assets/{wardleyDiagram-YWT4CUSO-DDQwL97M.js → wardleyDiagram-YWT4CUSO-DQtvwbSj.js} +1 -1
  61. package/dist-web/assets/{xychartDiagram-2RQKCTM6-BGPSWjRq.js → xychartDiagram-2RQKCTM6-Dc3YySFJ.js} +1 -1
  62. package/dist-web/index.html +2 -2
  63. package/package.json +8 -8
  64. package/dist-web/assets/channel-CkGndlmZ.js +0 -1
  65. package/dist-web/assets/classDiagram-4FO5ZUOK-DknrTxU7.js +0 -1
  66. package/dist-web/assets/classDiagram-v2-Q7XG4LA2-DknrTxU7.js +0 -1
  67. package/dist-web/assets/index-CMhewTFA.js +0 -325
  68. package/dist-web/assets/stateDiagram-v2-BHNVJYJU--68MzT1N.js +0 -1
@@ -0,0 +1,325 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DesignSystemView-CAPhy_9h.js","assets/DesignSystemView-B9X_Wri_.css","assets/mhchem-DtR62fUK.js","assets/katex-DnlPpQZa.js","assets/CodeBlockNode-CpzD9pIh.js","assets/safeRaf-DGuzXxDK.js","assets/CodeBlockShell.vue_vue_type_style_index_0_lang-4BOr1NEZ.js","assets/index8-B0l1OZhe.js","assets/index11-BiTpnbks.js"])))=>i.map(i=>d[i]);
2
+ (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))o(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const r of i.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&o(r)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function o(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();/**
3
+ * @vue/shared v3.5.35
4
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
5
+ * @license MIT
6
+ **/function Zp(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Qt={},Nc=[],ki=()=>{},f4=()=>!1,zd=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Qp=e=>e.startsWith("onUpdate:"),kn=Object.assign,ay=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},vE=Object.prototype.hasOwnProperty,ln=(e,t)=>vE.call(e,t),xt=Array.isArray,Ic=e=>ou(e)==="[object Map]",Ra=e=>ou(e)==="[object Set]",Lb=e=>ou(e)==="[object Date]",yE=e=>ou(e)==="[object RegExp]",$t=e=>typeof e=="function",Cn=e=>typeof e=="string",Js=e=>typeof e=="symbol",an=e=>e!==null&&typeof e=="object",cy=e=>(an(e)||$t(e))&&$t(e.then)&&$t(e.catch),h4=Object.prototype.toString,ou=e=>h4.call(e),kE=e=>ou(e).slice(8,-1),Xp=e=>ou(e)==="[object Object]",Jp=e=>Cn(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,wa=Zp(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),em=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},bE=/-\w/g,No=em(e=>e.replace(bE,t=>t.slice(1).toUpperCase())),xE=/\B([A-Z])/g,Is=em(e=>e.replace(xE,"-$1").toLowerCase()),tm=em(e=>e.charAt(0).toUpperCase()+e.slice(1)),mh=em(e=>e?`on${tm(e)}`:""),qo=(e,t)=>!Object.is(e,t),Lc=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},p4=(e,t,n,o=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:o,value:n})},nm=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Dh=e=>{const t=Cn(e)?Number(e):NaN;return isNaN(t)?e:t};let $b;const om=()=>$b||($b=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),wE="Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol",_E=Zp(wE);function Yt(e){if(xt(e)){const t={};for(let n=0;n<e.length;n++){const o=e[n],s=Cn(o)?ME(o):Yt(o);if(s)for(const i in s)t[i]=s[i]}return t}else if(Cn(e)||an(e))return e}const SE=/;(?![^(]*\))/g,CE=/:([^]+)/,AE=/\/\*[^]*?\*\//g;function ME(e){const t={};return e.replace(AE,"").split(SE).forEach(n=>{if(n){const o=n.split(CE);o.length>1&&(t[o[0].trim()]=o[1].trim())}}),t}function We(e){let t="";if(Cn(e))t=e;else if(xt(e))for(let n=0;n<e.length;n++){const o=We(e[n]);o&&(t+=o+" ")}else if(an(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function jxe(e){if(!e)return null;let{class:t,style:n}=e;return t&&!Cn(t)&&(e.class=We(t)),n&&(e.style=Yt(n)),e}const EE="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",TE=Zp(EE);function m4(e){return!!e||e===""}function NE(e,t){if(e.length!==t.length)return!1;let n=!0;for(let o=0;n&&o<e.length;o++)n=Br(e[o],t[o]);return n}function Br(e,t){if(e===t)return!0;let n=Lb(e),o=Lb(t);if(n||o)return n&&o?e.getTime()===t.getTime():!1;if(n=Js(e),o=Js(t),n||o)return e===t;if(n=xt(e),o=xt(t),n||o)return n&&o?NE(e,t):!1;if(n=an(e),o=an(t),n||o){if(!n||!o)return!1;const s=Object.keys(e).length,i=Object.keys(t).length;if(s!==i)return!1;for(const r in e){const l=e.hasOwnProperty(r),a=t.hasOwnProperty(r);if(l&&!a||!l&&a||!Br(e[r],t[r]))return!1}}return String(e)===String(t)}function sm(e,t){return e.findIndex(n=>Br(n,t))}const g4=e=>!!(e&&e.__v_isRef===!0),O=e=>Cn(e)?e:e==null?"":xt(e)||an(e)&&(e.toString===h4||!$t(e.toString))?g4(e)?O(e.value):JSON.stringify(e,v4,2):String(e),v4=(e,t)=>g4(t)?v4(e,t.value):Ic(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[o,s],i)=>(n[Y1(o,i)+" =>"]=s,n),{})}:Ra(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Y1(n))}:Js(t)?Y1(t):an(t)&&!xt(t)&&!Xp(t)?String(t):t,Y1=(e,t="")=>{var n;return Js(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};function IE(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 To;class y4{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&&To&&(To.active?(this.parent=To,this.index=(To.scopes||(To.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=To;try{return To=this,t()}finally{To=n}}}on(){++this._on===1&&(this.prevScope=To,To=this)}off(){if(this._on>0&&--this._on===0){if(To===this)To=this.prevScope;else{let t=To;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,o;for(n=0,o=this.effects.length;n<o;n++)this.effects[n].stop();for(this.effects.length=0,n=0,o=this.cleanups.length;n<o;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,o=this.scopes.length;n<o;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const s=this.parent.scopes.pop();s&&s!==this&&(this.parent.scopes[this.index]=s,s.index=this.index)}this.parent=void 0}}}function LE(e){return new y4(e)}function uy(){return To}function dy(e,t=!1){To&&To.cleanups.push(e)}let Dn;const Z1=new WeakSet;class Ph{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,To&&(To.active?To.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Z1.has(this)&&(Z1.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||b4(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Fb(this),x4(this);const t=Dn,n=Oi;Dn=this,Oi=!0;try{return this.fn()}finally{w4(this),Dn=t,Oi=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)py(t);this.deps=this.depsTail=void 0,Fb(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Z1.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Mg(this)&&this.run()}get dirty(){return Mg(this)}}let k4=0,Zu,Qu;function b4(e,t=!1){if(e.flags|=8,t){e.next=Qu,Qu=e;return}e.next=Zu,Zu=e}function fy(){k4++}function hy(){if(--k4>0)return;if(Qu){let t=Qu;for(Qu=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Zu;){let t=Zu;for(Zu=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(o){e||(e=o)}t=n}}if(e)throw e}function x4(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function w4(e){let t,n=e.depsTail,o=n;for(;o;){const s=o.prevDep;o.version===-1?(o===n&&(n=s),py(o),$E(o)):t=o,o.dep.activeLink=o.prevActiveLink,o.prevActiveLink=void 0,o=s}e.deps=t,e.depsTail=n}function Mg(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(_4(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function _4(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===md)||(e.globalVersion=md,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Mg(e))))return;e.flags|=2;const t=e.dep,n=Dn,o=Oi;Dn=e,Oi=!0;try{x4(e);const s=e.fn(e._value);(t.version===0||qo(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{Dn=n,Oi=o,w4(e),e.flags&=-3}}function py(e,t=!1){const{dep:n,prevSub:o,nextSub:s}=e;if(o&&(o.nextSub=s,e.prevSub=void 0),s&&(s.prevSub=o,e.nextSub=void 0),n.subs===e&&(n.subs=o,!o&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)py(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function $E(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function Vxe(e,t){e.effect instanceof Ph&&(e=e.effect.fn);const n=new Ph(e);t&&kn(n,t);try{n.run()}catch(s){throw n.stop(),s}const o=n.run.bind(n);return o.effect=n,o}function Kxe(e){e.effect.stop()}let Oi=!0;const S4=[];function Dr(){S4.push(Oi),Oi=!1}function Pr(){const e=S4.pop();Oi=e===void 0?!0:e}function Fb(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Dn;Dn=void 0;try{t()}finally{Dn=n}}}let md=0;class FE{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 im{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!Dn||!Oi||Dn===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Dn)n=this.activeLink=new FE(Dn,this),Dn.deps?(n.prevDep=Dn.depsTail,Dn.depsTail.nextDep=n,Dn.depsTail=n):Dn.deps=Dn.depsTail=n,C4(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const o=n.nextDep;o.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=o),n.prevDep=Dn.depsTail,n.nextDep=void 0,Dn.depsTail.nextDep=n,Dn.depsTail=n,Dn.deps===n&&(Dn.deps=o)}return n}trigger(t){this.version++,md++,this.notify(t)}notify(t){fy();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{hy()}}}function C4(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let o=t.deps;o;o=o.nextDep)C4(o)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Hh=new WeakMap,_a=Symbol(""),Eg=Symbol(""),gd=Symbol("");function Jo(e,t,n){if(Oi&&Dn){let o=Hh.get(e);o||Hh.set(e,o=new Map);let s=o.get(n);s||(o.set(n,s=new im),s.map=o,s.key=n),s.track()}}function Tr(e,t,n,o,s,i){const r=Hh.get(e);if(!r){md++;return}const l=a=>{a&&a.trigger()};if(fy(),t==="clear")r.forEach(l);else{const a=xt(e),c=a&&Jp(n);if(a&&n==="length"){const u=Number(o);r.forEach((d,f)=>{(f==="length"||f===gd||!Js(f)&&f>=u)&&l(d)})}else switch((n!==void 0||r.has(void 0))&&l(r.get(n)),c&&l(r.get(gd)),t){case"add":a?c&&l(r.get("length")):(l(r.get(_a)),Ic(e)&&l(r.get(Eg)));break;case"delete":a||(l(r.get(_a)),Ic(e)&&l(r.get(Eg)));break;case"set":Ic(e)&&l(r.get(_a));break}}hy()}function OE(e,t){const n=Hh.get(e);return n&&n.get(t)}function oc(e){const t=en(e);return t===e?t:(Jo(t,"iterate",gd),Ks(e)?t:t.map(Di))}function rm(e){return Jo(e=en(e),"iterate",gd),e}function er(e,t){return Hr(e)?Gc(_l(e)?Di(t):t):Di(t)}const RE={__proto__:null,[Symbol.iterator](){return Q1(this,Symbol.iterator,e=>er(this,e))},concat(...e){return oc(this).concat(...e.map(t=>xt(t)?oc(t):t))},entries(){return Q1(this,"entries",e=>(e[1]=er(this,e[1]),e))},every(e,t){return gr(this,"every",e,t,void 0,arguments)},filter(e,t){return gr(this,"filter",e,t,n=>n.map(o=>er(this,o)),arguments)},find(e,t){return gr(this,"find",e,t,n=>er(this,n),arguments)},findIndex(e,t){return gr(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return gr(this,"findLast",e,t,n=>er(this,n),arguments)},findLastIndex(e,t){return gr(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return gr(this,"forEach",e,t,void 0,arguments)},includes(...e){return X1(this,"includes",e)},indexOf(...e){return X1(this,"indexOf",e)},join(e){return oc(this).join(e)},lastIndexOf(...e){return X1(this,"lastIndexOf",e)},map(e,t){return gr(this,"map",e,t,void 0,arguments)},pop(){return Tu(this,"pop")},push(...e){return Tu(this,"push",e)},reduce(e,...t){return Ob(this,"reduce",e,t)},reduceRight(e,...t){return Ob(this,"reduceRight",e,t)},shift(){return Tu(this,"shift")},some(e,t){return gr(this,"some",e,t,void 0,arguments)},splice(...e){return Tu(this,"splice",e)},toReversed(){return oc(this).toReversed()},toSorted(e){return oc(this).toSorted(e)},toSpliced(...e){return oc(this).toSpliced(...e)},unshift(...e){return Tu(this,"unshift",e)},values(){return Q1(this,"values",e=>er(this,e))}};function Q1(e,t,n){const o=rm(e),s=o[t]();return o!==e&&!Ks(e)&&(s._next=s.next,s.next=()=>{const i=s._next();return i.done||(i.value=n(i.value)),i}),s}const BE=Array.prototype;function gr(e,t,n,o,s,i){const r=rm(e),l=r!==e&&!Ks(e),a=r[t];if(a!==BE[t]){const d=a.apply(e,i);return l?Di(d):d}let c=n;r!==e&&(l?c=function(d,f){return n.call(this,er(e,d),f,e)}:n.length>2&&(c=function(d,f){return n.call(this,d,f,e)}));const u=a.call(r,c,o);return l&&s?s(u):u}function Ob(e,t,n,o){const s=rm(e),i=s!==e&&!Ks(e);let r=n,l=!1;s!==e&&(i?(l=o.length===0,r=function(c,u,d){return l&&(l=!1,c=er(e,c)),n.call(this,c,er(e,u),d,e)}):n.length>3&&(r=function(c,u,d){return n.call(this,c,u,d,e)}));const a=s[t](r,...o);return l?er(e,a):a}function X1(e,t,n){const o=en(e);Jo(o,"iterate",gd);const s=o[t](...n);return(s===-1||s===!1)&&cm(n[0])?(n[0]=en(n[0]),o[t](...n)):s}function Tu(e,t,n=[]){Dr(),fy();const o=en(e)[t].apply(e,n);return hy(),Pr(),o}const DE=Zp("__proto__,__v_isRef,__isVue"),A4=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Js));function PE(e){Js(e)||(e=String(e));const t=en(this);return Jo(t,"has",e),t.hasOwnProperty(e)}class M4{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,o){if(n==="__v_skip")return t.__v_skip;const s=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!s;if(n==="__v_isReadonly")return s;if(n==="__v_isShallow")return i;if(n==="__v_raw")return o===(s?i?$4:L4:i?I4:N4).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(o)?t:void 0;const r=xt(t);if(!s){let a;if(r&&(a=RE[n]))return a;if(n==="hasOwnProperty")return PE}const l=Reflect.get(t,n,ho(t)?t:o);if((Js(n)?A4.has(n):DE(n))||(s||Jo(t,"get",n),i))return l;if(ho(l)){const a=r&&Jp(n)?l:l.value;return s&&an(a)?Wh(a):a}return an(l)?s?Wh(l):Bo(l):l}}class E4 extends M4{constructor(t=!1){super(!1,t)}set(t,n,o,s){let i=t[n];const r=xt(t)&&Jp(n);if(!this._isShallow){const c=Hr(i);if(!Ks(o)&&!Hr(o)&&(i=en(i),o=en(o)),!r&&ho(i)&&!ho(o))return c||(i.value=o),!0}const l=r?Number(n)<t.length:ln(t,n),a=Reflect.set(t,n,o,ho(t)?t:s);return t===en(s)&&(l?qo(o,i)&&Tr(t,"set",n,o):Tr(t,"add",n,o)),a}deleteProperty(t,n){const o=ln(t,n);t[n];const s=Reflect.deleteProperty(t,n);return s&&o&&Tr(t,"delete",n,void 0),s}has(t,n){const o=Reflect.has(t,n);return(!Js(n)||!A4.has(n))&&Jo(t,"has",n),o}ownKeys(t){return Jo(t,"iterate",xt(t)?"length":_a),Reflect.ownKeys(t)}}class T4 extends M4{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const HE=new E4,WE=new T4,zE=new E4(!0),UE=new T4(!0),Tg=e=>e,Tf=e=>Reflect.getPrototypeOf(e);function qE(e,t,n){return function(...o){const s=this.__v_raw,i=en(s),r=Ic(i),l=e==="entries"||e===Symbol.iterator&&r,a=e==="keys"&&r,c=s[e](...o),u=n?Tg:t?Gc:Di;return!t&&Jo(i,"iterate",a?Eg:_a),kn(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 Nf(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function jE(e,t){const n={get(s){const i=this.__v_raw,r=en(i),l=en(s);e||(qo(s,l)&&Jo(r,"get",s),Jo(r,"get",l));const{has:a}=Tf(r),c=t?Tg:e?Gc:Di;if(a.call(r,s))return c(i.get(s));if(a.call(r,l))return c(i.get(l));i!==r&&i.get(s)},get size(){const s=this.__v_raw;return!e&&Jo(en(s),"iterate",_a),s.size},has(s){const i=this.__v_raw,r=en(i),l=en(s);return e||(qo(s,l)&&Jo(r,"has",s),Jo(r,"has",l)),s===l?i.has(s):i.has(s)||i.has(l)},forEach(s,i){const r=this,l=r.__v_raw,a=en(l),c=t?Tg:e?Gc:Di;return!e&&Jo(a,"iterate",_a),l.forEach((u,d)=>s.call(i,c(u),c(d),r))}};return kn(n,e?{add:Nf("add"),set:Nf("set"),delete:Nf("delete"),clear:Nf("clear")}:{add(s){const i=en(this),r=Tf(i),l=en(s),a=!t&&!Ks(s)&&!Hr(s)?l:s;return r.has.call(i,a)||qo(s,a)&&r.has.call(i,s)||qo(l,a)&&r.has.call(i,l)||(i.add(a),Tr(i,"add",a,a)),this},set(s,i){!t&&!Ks(i)&&!Hr(i)&&(i=en(i));const r=en(this),{has:l,get:a}=Tf(r);let c=l.call(r,s);c||(s=en(s),c=l.call(r,s));const u=a.call(r,s);return r.set(s,i),c?qo(i,u)&&Tr(r,"set",s,i):Tr(r,"add",s,i),this},delete(s){const i=en(this),{has:r,get:l}=Tf(i);let a=r.call(i,s);a||(s=en(s),a=r.call(i,s)),l&&l.call(i,s);const c=i.delete(s);return a&&Tr(i,"delete",s,void 0),c},clear(){const s=en(this),i=s.size!==0,r=s.clear();return i&&Tr(s,"clear",void 0,void 0),r}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=qE(s,e,t)}),n}function lm(e,t){const n=jE(e,t);return(o,s,i)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?o:Reflect.get(ln(n,s)&&s in o?n:o,s,i)}const VE={get:lm(!1,!1)},KE={get:lm(!1,!0)},GE={get:lm(!0,!1)},YE={get:lm(!0,!0)},N4=new WeakMap,I4=new WeakMap,L4=new WeakMap,$4=new WeakMap;function ZE(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Bo(e){return Hr(e)?e:am(e,!1,HE,VE,N4)}function QE(e){return am(e,!1,zE,KE,I4)}function Wh(e){return am(e,!0,WE,GE,L4)}function Gxe(e){return am(e,!0,UE,YE,$4)}function am(e,t,n,o,s){if(!an(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const i=s.get(e);if(i)return i;const r=ZE(kE(e));if(r===0)return e;const l=new Proxy(e,r===2?o:n);return s.set(e,l),l}function _l(e){return Hr(e)?_l(e.__v_raw):!!(e&&e.__v_isReactive)}function Hr(e){return!!(e&&e.__v_isReadonly)}function Ks(e){return!!(e&&e.__v_isShallow)}function cm(e){return e?!!e.__v_raw:!1}function en(e){const t=e&&e.__v_raw;return t?en(t):e}function pt(e){return!ln(e,"__v_skip")&&Object.isExtensible(e)&&p4(e,"__v_skip",!0),e}const Di=e=>an(e)?Bo(e):e,Gc=e=>an(e)?Wh(e):e;function ho(e){return e?e.__v_isRef===!0:!1}function J(e){return F4(e,!1)}function Ba(e){return F4(e,!0)}function F4(e,t){return ho(e)?e:new XE(e,t)}class XE{constructor(t,n){this.dep=new im,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:en(t),this._value=n?t:Di(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,o=this.__v_isShallow||Ks(t)||Hr(t);t=o?t:en(t),qo(t,n)&&(this._rawValue=t,this._value=o?t:Di(t),this.dep.trigger())}}function Yxe(e){e.dep&&e.dep.trigger()}function C(e){return ho(e)?e.value:e}function O4(e){return $t(e)?e():C(e)}const JE={get:(e,t,n)=>t==="__v_raw"?e:C(Reflect.get(e,t,n)),set:(e,t,n,o)=>{const s=e[t];return ho(s)&&!ho(n)?(s.value=n,!0):Reflect.set(e,t,n,o)}};function R4(e){return _l(e)?e:new Proxy(e,JE)}class eT{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new im,{get:o,set:s}=t(n.track.bind(n),n.trigger.bind(n));this._get=o,this._set=s}get value(){return this._value=this._get()}set value(t){this._set(t)}}function tT(e){return new eT(e)}function Zxe(e){const t=xt(e)?new Array(e.length):{};for(const n in e)t[n]=B4(e,n);return t}class nT{constructor(t,n,o){this._object=t,this._defaultValue=o,this.__v_isRef=!0,this._value=void 0,this._key=Js(n)?n:String(n),this._raw=en(t);let s=!0,i=t;if(!xt(t)||Js(this._key)||!Jp(this._key))do s=!cm(i)||Ks(i);while(s&&(i=i.__v_raw));this._shallow=s}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&&ho(this._raw[this._key])){const n=this._object[this._key];if(ho(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return OE(this._raw,this._key)}}class oT{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 Qxe(e,t,n){return ho(e)?e:$t(e)?new oT(e):an(e)&&arguments.length>1?B4(e,t,n):J(e)}function B4(e,t,n){return new nT(e,t,n)}class sT{constructor(t,n,o){this.fn=t,this.setter=n,this._value=void 0,this.dep=new im(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=md-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=o}notify(){if(this.flags|=16,!(this.flags&8)&&Dn!==this)return b4(this,!0),!0}get value(){const t=this.dep.track();return _4(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function iT(e,t,n=!1){let o,s;return $t(e)?o=e:(o=e.get,s=e.set),new sT(o,s,n)}const Xxe={GET:"get",HAS:"has",ITERATE:"iterate"},Jxe={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},If={},zh=new WeakMap;let hl;function ewe(){return hl}function rT(e,t=!1,n=hl){if(n){let o=zh.get(n);o||zh.set(n,o=[]),o.push(e)}}function lT(e,t,n=Qt){const{immediate:o,deep:s,once:i,scheduler:r,augmentJob:l,call:a}=n,c=k=>s?k:Ks(k)||s===!1||s===0?Nr(k,1):Nr(k);let u,d,f,h,p=!1,g=!1;if(ho(e)?(d=()=>e.value,p=Ks(e)):_l(e)?(d=()=>c(e),p=!0):xt(e)?(g=!0,p=e.some(k=>_l(k)||Ks(k)),d=()=>e.map(k=>{if(ho(k))return k.value;if(_l(k))return c(k);if($t(k))return a?a(k,2):k()})):$t(e)?t?d=a?()=>a(e,2):e:d=()=>{if(f){Dr();try{f()}finally{Pr()}}const k=hl;hl=u;try{return a?a(e,3,[h]):e(h)}finally{hl=k}}:d=ki,t&&s){const k=d,A=s===!0?1/0:s;d=()=>Nr(k(),A)}const b=uy(),v=()=>{u.stop(),b&&b.active&&ay(b.effects,u)};if(i&&t){const k=t;t=(...A)=>{k(...A),v()}}let m=g?new Array(e.length).fill(If):If;const y=k=>{if(!(!(u.flags&1)||!u.dirty&&!k))if(t){const A=u.run();if(s||p||(g?A.some(($,I)=>qo($,m[I])):qo(A,m))){f&&f();const $=hl;hl=u;try{const I=[A,m===If?void 0:g&&m[0]===If?[]:m,h];m=A,a?a(t,3,I):t(...I)}finally{hl=$}}}else u.run()};return l&&l(y),u=new Ph(d),u.scheduler=r?()=>r(y,!1):y,h=k=>rT(k,!1,u),f=u.onStop=()=>{const k=zh.get(u);if(k){if(a)a(k,4);else for(const A of k)A();zh.delete(u)}},t?o?y(!0):m=u.run():r?r(y.bind(null,!0),!0):u.run(),v.pause=u.pause.bind(u),v.resume=u.resume.bind(u),v.stop=v,v}function Nr(e,t=1/0,n){if(t<=0||!an(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,ho(e))Nr(e.value,t,n);else if(xt(e))for(let o=0;o<e.length;o++)Nr(e[o],t,n);else if(Ra(e)||Ic(e))e.forEach(o=>{Nr(o,t,n)});else if(Xp(e)){for(const o in e)Nr(e[o],t,n);for(const o of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,o)&&Nr(e[o],t,n)}return e}/**
11
+ * @vue/runtime-core v3.5.35
12
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
13
+ * @license MIT
14
+ **/const D4=[];function aT(e){D4.push(e)}function cT(){D4.pop()}function twe(e,t){}const nwe={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"},uT={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 Ud(e,t,n,o){try{return o?e(...o):e()}catch(s){su(s,t,n)}}function wi(e,t,n,o){if($t(e)){const s=Ud(e,t,n,o);return s&&cy(s)&&s.catch(i=>{su(i,t,n)}),s}if(xt(e)){const s=[];for(let i=0;i<e.length;i++)s.push(wi(e[i],t,n,o));return s}}function su(e,t,n,o=!0){const s=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:r}=t&&t.appContext.config||Qt;if(t){let l=t.parent;const a=t.proxy,c=`https://vuejs.org/error-reference/#runtime-${n}`;for(;l;){const u=l.ec;if(u){for(let d=0;d<u.length;d++)if(u[d](e,a,c)===!1)return}l=l.parent}if(i){Dr(),Ud(i,null,10,[e,a,c]),Pr();return}}dT(e,n,s,o,r)}function dT(e,t,n,o=!0,s=!1){if(s)throw e;console.error(e)}const ps=[];let Qi=-1;const $c=[];let pl=null,pc=0;const P4=Promise.resolve();let Uh=null;function mt(e){const t=Uh||P4;return e?t.then(this?e.bind(this):e):t}function fT(e){let t=Qi+1,n=ps.length;for(;t<n;){const o=t+n>>>1,s=ps[o],i=vd(s);i<e||i===e&&s.flags&2?t=o+1:n=o}return t}function my(e){if(!(e.flags&1)){const t=vd(e),n=ps[ps.length-1];!n||!(e.flags&2)&&t>=vd(n)?ps.push(e):ps.splice(fT(t),0,e),e.flags|=1,H4()}}function H4(){Uh||(Uh=P4.then(W4))}function qh(e){xt(e)?$c.push(...e):pl&&e.id===-1?pl.splice(pc+1,0,e):e.flags&1||($c.push(e),e.flags|=1),H4()}function Rb(e,t,n=Qi+1){for(;n<ps.length;n++){const o=ps[n];if(o&&o.flags&2){if(e&&o.id!==e.uid)continue;ps.splice(n,1),n--,o.flags&4&&(o.flags&=-2),o(),o.flags&4||(o.flags&=-2)}}}function jh(e){if($c.length){const t=[...new Set($c)].sort((n,o)=>vd(n)-vd(o));if($c.length=0,pl){pl.push(...t);return}for(pl=t,pc=0;pc<pl.length;pc++){const n=pl[pc];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}pl=null,pc=0}}const vd=e=>e.id==null?e.flags&2?-1:1/0:e.id;function W4(e){try{for(Qi=0;Qi<ps.length;Qi++){const t=ps[Qi];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Ud(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Qi<ps.length;Qi++){const t=ps[Qi];t&&(t.flags&=-2)}Qi=-1,ps.length=0,jh(),Uh=null,(ps.length||$c.length)&&W4()}}let mc,Lf=[];function z4(e,t){var n,o;mc=e,mc?(mc.enabled=!0,Lf.forEach(({event:s,args:i})=>mc.emit(s,...i)),Lf=[]):typeof window<"u"&&window.HTMLElement&&!((o=(n=window.navigator)==null?void 0:n.userAgent)!=null&&o.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(i=>{z4(i,t)}),setTimeout(()=>{mc||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Lf=[])},3e3)):Lf=[]}let Ko=null,um=null;function yd(e){const t=Ko;return Ko=e,um=e&&e.type.__scopeId||null,t}function owe(e){um=e}function swe(){um=null}const iwe=e=>Ee;function Ee(e,t=Ko,n){if(!t||e._n)return e;const o=(...s)=>{o._d&&Zh(-1);const i=yd(t);let r;try{r=e(...s)}finally{yd(i),o._d&&Zh(1)}return r};return o._n=!0,o._c=!0,o._d=!0,o}function Fn(e,t){if(Ko===null)return e;const n=Kd(Ko),o=e.dirs||(e.dirs=[]);for(let s=0;s<t.length;s++){let[i,r,l,a=Qt]=t[s];i&&($t(i)&&(i={mounted:i,updated:i}),i.deep&&Nr(r),o.push({dir:i,instance:n,value:r,oldValue:void 0,arg:l,modifiers:a}))}return e}function Xi(e,t,n,o){const s=e.dirs,i=t&&t.dirs;for(let r=0;r<s.length;r++){const l=s[r];i&&(l.oldValue=i[r].value);let a=l.dir[o];a&&(Dr(),wi(a,n,8,[e.el,l,e,t]),Pr())}}function Ln(e,t){if(Vo){let n=Vo.provides;const o=Vo.parent&&Vo.parent.provides;o===n&&(n=Vo.provides=Object.create(o)),n[e]=t}}function Kt(e,t,n=!1){const o=Yo();if(o||Sa){let s=Sa?Sa._context.provides:o?o.parent==null||o.ce?o.vnode.appContext&&o.vnode.appContext.provides:o.parent.provides:void 0;if(s&&e in s)return s[e];if(arguments.length>1)return n&&$t(t)?t.call(o&&o.proxy):t}}function rwe(){return!!(Yo()||Sa)}const hT=Symbol.for("v-scx"),pT=()=>Kt(hT);function mT(e,t){return qd(e,null,t)}function lwe(e,t){return qd(e,null,{flush:"post"})}function gT(e,t){return qd(e,null,{flush:"sync"})}function Qe(e,t,n){return qd(e,t,n)}function qd(e,t,n=Qt){const{immediate:o,deep:s,flush:i,once:r}=n,l=kn({},n),a=t&&o||!t&&i!=="post";let c;if(Ta){if(i==="sync"){const h=pT();c=h.__watcherHandles||(h.__watcherHandles=[])}else if(!a){const h=()=>{};return h.stop=ki,h.resume=ki,h.pause=ki,h}}const u=Vo;l.call=(h,p,g)=>wi(h,u,p,g);let d=!1;i==="post"?l.scheduler=h=>{vo(h,u&&u.suspense)}:i!=="sync"&&(d=!0,l.scheduler=(h,p)=>{p?h():my(h)}),l.augmentJob=h=>{t&&(h.flags|=4),d&&(h.flags|=2,u&&(h.id=u.uid,h.i=u))};const f=lT(e,t,l);return Ta&&(c?c.push(f):a&&f()),f}function vT(e,t,n){const o=this.proxy,s=Cn(e)?e.includes(".")?U4(o,e):()=>o[e]:e.bind(o,o);let i;$t(t)?i=t:(i=t.handler,n=t);const r=iu(this),l=qd(s,i.bind(o),n);return r(),l}function U4(e,t){const n=t.split(".");return()=>{let o=e;for(let s=0;s<n.length&&o;s++)o=o[n[s]];return o}}const ul=new WeakMap,q4=Symbol("_vte"),j4=e=>e.__isTeleport,fa=e=>e&&(e.disabled||e.disabled===""),yT=e=>e&&(e.defer||e.defer===""),Bb=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Db=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Ng=(e,t)=>{const n=e&&e.to;return Cn(n)?t?t(n):null:n},kT={name:"Teleport",__isTeleport:!0,process(e,t,n,o,s,i,r,l,a,c){const{mc:u,pc:d,pbc:f,o:{insert:h,querySelector:p,createText:g,createComment:b,parentNode:v}}=c,m=fa(t.props);let{dynamicChildren:y}=t;const k=(I,x,L)=>{I.shapeFlag&16&&u(I.children,x,L,s,i,r,l,a)},A=(I=t)=>{const x=fa(I.props),L=I.target=Ng(I.props,p),E=Ig(L,I,g,h);L&&(r!=="svg"&&Bb(L)?r="svg":r!=="mathml"&&Db(L)&&(r="mathml"),s&&s.isCE&&(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add(L),x||(k(I,L,E),Hu(I,!1)))},$=I=>{const x=()=>{if(ul.get(I)===x){if(ul.delete(I),fa(I.props)){const L=v(I.el)||n;k(I,L,I.anchor),Hu(I,!0)}A(I)}};ul.set(I,x),vo(x,i)};if(e==null){const I=t.el=g(""),x=t.anchor=g("");if(h(I,n,o),h(x,n,o),yT(t.props)||i&&i.pendingBranch){$(t);return}m&&(k(t,n,x),Hu(t,!0)),A()}else{t.el=e.el;const I=t.anchor=e.anchor,x=ul.get(e);if(x){x.flags|=8,ul.delete(e),$(t);return}t.targetStart=e.targetStart;const L=t.target=e.target,E=t.targetAnchor=e.targetAnchor,F=fa(e.props),S=F?n:L,N=F?I:E;if(r==="svg"||Bb(L)?r="svg":(r==="mathml"||Db(L))&&(r="mathml"),y?(f(e.dynamicChildren,y,S,s,i,r,l),Cy(e,t,!0)):a||d(e,t,S,N,s,i,r,l,!1),m)F?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):$f(t,n,I,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const D=t.target=Ng(t.props,p);D&&$f(t,D,null,c,0)}else F&&$f(t,L,E,c,1);Hu(t,m)}},remove(e,t,n,{um:o,o:{remove:s}},i){const{shapeFlag:r,children:l,anchor:a,targetStart:c,targetAnchor:u,target:d,props:f}=e,h=i||!fa(f),p=ul.get(e);if(p&&(p.flags|=8,ul.delete(e)),d&&(s(c),s(u)),i&&s(a),!p&&r&16)for(let g=0;g<l.length;g++){const b=l[g];o(b,t,n,h,!!b.dynamicChildren)}},move:$f,hydrate:bT};function $f(e,t,n,{o:{insert:o},m:s},i=2){i===0&&o(e.targetAnchor,t,n);const{el:r,anchor:l,shapeFlag:a,children:c,props:u}=e,d=i===2;if(d&&o(r,t,n),!ul.has(e)&&(!d||fa(u))&&a&16)for(let f=0;f<c.length;f++)s(c[f],t,n,2);d&&o(l,t,n)}function bT(e,t,n,o,s,i,{o:{nextSibling:r,parentNode:l,querySelector:a,insert:c,createText:u}},d){function f(b,v){let m=v;for(;m;){if(m&&m.nodeType===8){if(m.data==="teleport start anchor")t.targetStart=m;else if(m.data==="teleport anchor"){t.targetAnchor=m,b._lpa=t.targetAnchor&&r(t.targetAnchor);break}}m=r(m)}}function h(b,v){v.anchor=d(r(b),v,l(b),n,o,s,i)}const p=t.target=Ng(t.props,a),g=fa(t.props);if(p){const b=p._lpa||p.firstChild;t.shapeFlag&16&&(g?(h(e,t),f(p,b),t.targetAnchor||Ig(p,t,u,c,l(e)===p?e:null)):(t.anchor=r(e),f(p,b),t.targetAnchor||Ig(p,t,u,c),d(b&&r(b),t,p,n,o,s,i))),Hu(t,g)}else g&&t.shapeFlag&16&&(h(e,t),t.targetStart=e,t.targetAnchor=r(e));return t.anchor&&r(t.anchor)}const dm=kT;function Hu(e,t){const n=e.ctx;if(n&&n.ut){let o,s;for(t?(o=e.el,s=e.anchor):(o=e.targetStart,s=e.targetAnchor);o&&o!==s;)o.nodeType===1&&o.setAttribute("data-v-owner",n.uid),o=o.nextSibling;n.ut()}}function Ig(e,t,n,o,s=null){const i=t.targetStart=n(""),r=t.targetAnchor=n("");return i[q4]=r,e&&(o(i,e,s),o(r,e,s)),r}const fi=Symbol("_leaveCb"),Nu=Symbol("_enterCb");function V4(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return cn(()=>{e.isMounted=!0}),po(()=>{e.isUnmounting=!0}),e}const ri=[Function,Array],K4={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:ri,onEnter:ri,onAfterEnter:ri,onEnterCancelled:ri,onBeforeLeave:ri,onLeave:ri,onAfterLeave:ri,onLeaveCancelled:ri,onBeforeAppear:ri,onAppear:ri,onAfterAppear:ri,onAppearCancelled:ri},G4=e=>{const t=e.subTree;return t.component?G4(t.component):t},xT={name:"BaseTransition",props:K4,setup(e,{slots:t}){const n=Yo(),o=V4();return()=>{const s=t.default&&gy(t.default(),!0),i=s&&s.length?Y4(s):n.subTree?ce():void 0;if(!i)return;const r=en(e),{mode:l}=r;if(o.isLeaving)return J1(i);const a=Pb(i);if(!a)return J1(i);let c=kd(a,r,o,n,d=>c=d);a.type!==bo&&Tl(a,c);let u=n.subTree&&Pb(n.subTree);if(u&&u.type!==bo&&!Ii(u,a)&&G4(n).type!==bo){let d=kd(u,r,o,n);if(Tl(u,d),l==="out-in"&&a.type!==bo)return o.isLeaving=!0,d.afterLeave=()=>{o.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},J1(i);l==="in-out"&&a.type!==bo?d.delayLeave=(f,h,p)=>{const g=Z4(o,u);g[String(u.key)]=u,f[fi]=()=>{h(),f[fi]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{p(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return i}}};function Y4(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==bo){t=n;break}}return t}const wT=xT;function Z4(e,t){const{leavingVNodes:n}=e;let o=n.get(t.type);return o||(o=Object.create(null),n.set(t.type,o)),o}function kd(e,t,n,o,s){const{appear:i,mode:r,persisted:l=!1,onBeforeEnter:a,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:f,onLeave:h,onAfterLeave:p,onLeaveCancelled:g,onBeforeAppear:b,onAppear:v,onAfterAppear:m,onAppearCancelled:y}=t,k=String(e.key),A=Z4(n,e),$=(L,E)=>{L&&wi(L,o,9,E)},I=(L,E)=>{const F=E[1];$(L,E),xt(L)?L.every(S=>S.length<=1)&&F():L.length<=1&&F()},x={mode:r,persisted:l,beforeEnter(L){let E=a;if(!n.isMounted)if(i)E=b||a;else return;L[fi]&&L[fi](!0);const F=A[k];F&&Ii(e,F)&&F.el[fi]&&F.el[fi](),$(E,[L])},enter(L){if(A[k]===e)return;let E=c,F=u,S=d;if(!n.isMounted)if(i)E=v||c,F=m||u,S=y||d;else return;let N=!1;L[Nu]=B=>{N||(N=!0,B?$(S,[L]):$(F,[L]),x.delayedLeave&&x.delayedLeave(),L[Nu]=void 0)};const D=L[Nu].bind(null,!1);E?I(E,[L,D]):D()},leave(L,E){const F=String(e.key);if(L[Nu]&&L[Nu](!0),n.isUnmounting)return E();$(f,[L]);let S=!1;L[fi]=D=>{S||(S=!0,E(),D?$(g,[L]):$(p,[L]),L[fi]=void 0,A[F]===e&&delete A[F])};const N=L[fi].bind(null,!1);A[F]=e,h?I(h,[L,N]):N()},clone(L){const E=kd(L,t,n,o,s);return s&&s(E),E}};return x}function J1(e){if(jd(e))return e=Wr(e),e.children=null,e}function Pb(e){if(!jd(e))return j4(e.type)&&e.children?Y4(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&$t(n.default))return n.default()}}function Tl(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Tl(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 gy(e,t=!1,n){let o=[],s=0;for(let i=0;i<e.length;i++){let r=e[i];const l=n==null?r.key:String(n)+String(r.key!=null?r.key:i);r.type===Pe?(r.patchFlag&128&&s++,o=o.concat(gy(r.children,t,l))):(t||r.type!==bo)&&o.push(l!=null?Wr(r,{key:l}):r)}if(s>1)for(let i=0;i<o.length;i++)o[i].patchFlag=-2;return o}function Ze(e,t){return $t(e)?kn({name:e.name},t,{setup:e}):e}function awe(){const e=Yo();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:""}function vy(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function cwe(e){const t=Yo(),n=Ba(null);if(t){const s=t.refs===Qt?t.refs={}:t.refs;Object.defineProperty(s,e,{enumerable:!0,get:()=>n.value,set:i=>n.value=i})}return n}function Hb(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Vh=new WeakMap;function Fc(e,t,n,o,s=!1){if(xt(e)){e.forEach((g,b)=>Fc(g,t&&(xt(t)?t[b]:t),n,o,s));return}if(Or(o)&&!s){o.shapeFlag&512&&o.type.__asyncResolved&&o.component.subTree.component&&Fc(e,t,n,o.component.subTree);return}const i=o.shapeFlag&4?Kd(o.component):o.el,r=s?null:i,{i:l,r:a}=e,c=t&&t.r,u=l.refs===Qt?l.refs={}:l.refs,d=l.setupState,f=en(d),h=d===Qt?f4:g=>Hb(u,g)?!1:ln(f,g),p=(g,b)=>!(b&&Hb(u,b));if(c!=null&&c!==a){if(Wb(t),Cn(c))u[c]=null,h(c)&&(d[c]=null);else if(ho(c)){const g=t;p(c,g.k)&&(c.value=null),g.k&&(u[g.k]=null)}}if($t(a))Ud(a,l,12,[r,u]);else{const g=Cn(a),b=ho(a);if(g||b){const v=()=>{if(e.f){const m=g?h(a)?d[a]:u[a]:p()||!e.k?a.value:u[e.k];if(s)xt(m)&&ay(m,i);else if(xt(m))m.includes(i)||m.push(i);else if(g)u[a]=[i],h(a)&&(d[a]=u[a]);else{const y=[i];p(a,e.k)&&(a.value=y),e.k&&(u[e.k]=y)}}else g?(u[a]=r,h(a)&&(d[a]=r)):b&&(p(a,e.k)&&(a.value=r),e.k&&(u[e.k]=r))};if(r){const m=()=>{v(),Vh.delete(e)};m.id=-1,Vh.set(e,m),vo(m,n)}else Wb(e),v()}}}function Wb(e){const t=Vh.get(e);t&&(t.flags|=8,Vh.delete(e))}let zb=!1;const sc=()=>{zb||(console.error("Hydration completed but contains mismatches."),zb=!0)},_T=e=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",ST=e=>e.namespaceURI.includes("MathML"),Ff=e=>{if(e.nodeType===1){if(_T(e))return"svg";if(ST(e))return"mathml"}},wc=e=>e.nodeType===8;function CT(e){const{mt:t,p:n,o:{patchProp:o,createText:s,nextSibling:i,parentNode:r,remove:l,insert:a,createComment:c}}=e,u=(y,k)=>{if(!k.hasChildNodes()){n(null,y,k),jh(),k._vnode=y;return}d(k.firstChild,y,null,null,null),jh(),k._vnode=y},d=(y,k,A,$,I,x=!1)=>{x=x||!!k.dynamicChildren;const L=wc(y)&&y.data==="[",E=()=>g(y,k,A,$,I,L),{type:F,ref:S,shapeFlag:N,patchFlag:D}=k;let B=y.nodeType;k.el=y,D===-2&&(x=!1,k.dynamicChildren=null);let U=null;switch(F){case Sl:B!==3?k.children===""?(a(k.el=s(""),r(y),y),U=y):U=E():(y.data!==k.children&&(sc(),y.data=k.children),U=i(y));break;case bo:m(y)?(U=i(y),v(k.el=y.content.firstChild,y,A)):B!==8||L?U=E():U=i(y);break;case Rc:if(L&&(y=i(y),B=y.nodeType),B===1||B===3){U=y;const H=!k.children.length;for(let P=0;P<k.staticCount;P++)H&&(k.children+=U.nodeType===1?U.outerHTML:U.data),P===k.staticCount-1&&(k.anchor=U),U=i(U);return L?i(U):U}else E();break;case Pe:L?U=p(y,k,A,$,I,x):U=E();break;default:if(N&1)(B!==1||k.type.toLowerCase()!==y.tagName.toLowerCase())&&!m(y)?U=E():U=f(y,k,A,$,I,x);else if(N&6){k.slotScopeIds=I;const H=r(y);if(L?U=b(y):wc(y)&&y.data==="teleport start"?U=b(y,y.data,"teleport end"):U=i(y),t(k,H,null,A,$,Ff(H),x),Or(k)&&!k.type.__asyncResolved){let P;L?(P=re(Pe),P.anchor=U?U.previousSibling:H.lastChild):P=y.nodeType===3?Je(""):re("div"),P.el=y,k.component.subTree=P}}else N&64?B!==8?U=E():U=k.type.hydrate(y,k,A,$,I,x,e,h):N&128&&(U=k.type.hydrate(y,k,A,$,Ff(r(y)),I,x,e,d))}return S!=null&&Fc(S,null,$,k),U},f=(y,k,A,$,I,x)=>{x=x||!!k.dynamicChildren;const{type:L,props:E,patchFlag:F,shapeFlag:S,dirs:N,transition:D}=k,B=L==="input"||L==="option";if(B||F!==-1){N&&Xi(k,null,A,"created");let U=!1;if(m(y)){U=g3(null,D)&&A&&A.vnode.props&&A.vnode.props.appear;const P=y.content.firstChild;if(U){const Z=P.getAttribute("class");Z&&(P.$cls=Z),D.beforeEnter(P)}v(P,y,A),k.el=y=P}if(S&16&&!(E&&(E.innerHTML||E.textContent))){let P=h(y.firstChild,k,y,A,$,I,x);for(P&&!Of(y,1)&&sc();P;){const Z=P;P=P.nextSibling,l(Z)}}else if(S&8){let P=k.children;P[0]===`
15
+ `&&(y.tagName==="PRE"||y.tagName==="TEXTAREA")&&(P=P.slice(1));const{textContent:Z}=y;Z!==P&&Z!==P.replace(/\r\n|\r/g,`
16
+ `)&&(Of(y,0)||sc(),y.textContent=k.children)}if(E){if(B||!x||F&48){const P=y.tagName.includes("-");for(const Z in E)(B&&(Z.endsWith("value")||Z==="indeterminate")||zd(Z)&&!wa(Z)||Z[0]==="."||P&&!wa(Z))&&o(y,Z,null,E[Z],void 0,A)}else if(E.onClick)o(y,"onClick",null,E.onClick,void 0,A);else if(F&4&&_l(E.style))for(const P in E.style)E.style[P]}let H;(H=E&&E.onVnodeBeforeMount)&&Es(H,A,k),N&&Xi(k,null,A,"beforeMount"),((H=E&&E.onVnodeMounted)||N||U)&&b3(()=>{H&&Es(H,A,k),U&&D.enter(y),N&&Xi(k,null,A,"mounted")},$)}return y.nextSibling},h=(y,k,A,$,I,x,L)=>{L=L||!!k.dynamicChildren;const E=k.children,F=E.length;let S=!1;for(let N=0;N<F;N++){const D=L?E[N]:E[N]=Ns(E[N]),B=D.type===Sl;y?(B&&!L&&N+1<F&&Ns(E[N+1]).type===Sl&&(a(s(y.data.slice(D.children.length)),A,i(y)),y.data=D.children),y=d(y,D,$,I,x,L)):B&&!D.children?a(D.el=s(""),A):(S||(S=!0,Of(A,1)||sc()),n(null,D,A,null,$,I,Ff(A),x))}return y},p=(y,k,A,$,I,x)=>{const{slotScopeIds:L}=k;L&&(I=I?I.concat(L):L);const E=r(y),F=h(i(y),k,E,A,$,I,x);return F&&wc(F)&&F.data==="]"?i(k.anchor=F):(sc(),a(k.anchor=c("]"),E,F),F)},g=(y,k,A,$,I,x)=>{if(Of(y.parentElement,1)||sc(),k.el=null,x){const F=b(y);for(;;){const S=i(y);if(S&&S!==F)l(S);else break}}const L=i(y),E=r(y);return l(y),n(null,k,E,L,A,$,Ff(E),I),A&&(A.vnode.el=k.el,pm(A,k.el)),L},b=(y,k="[",A="]")=>{let $=0;for(;y;)if(y=i(y),y&&wc(y)&&(y.data===k&&$++,y.data===A)){if($===0)return i(y);$--}return y},v=(y,k,A)=>{const $=k.parentNode;$&&$.replaceChild(y,k);let I=A;for(;I;)I.vnode.el===k&&(I.vnode.el=I.subTree.el=y),I=I.parent},m=y=>y.nodeType===1&&y.tagName==="TEMPLATE";return[u,d]}const Ub="data-allow-mismatch",AT={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function Of(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(Ub);)e=e.parentElement;const n=e&&e.getAttribute(Ub);if(n==null)return!1;if(n==="")return!0;{const o=n.split(",");return t===0&&o.includes("children")?!0:o.includes(AT[t])}}const MT=om().requestIdleCallback||(e=>setTimeout(e,1)),ET=om().cancelIdleCallback||(e=>clearTimeout(e)),uwe=(e=1e4)=>t=>{const n=MT(t,{timeout:e});return()=>ET(n)};function TT(e){const{top:t,left:n,bottom:o,right:s}=e.getBoundingClientRect(),{innerHeight:i,innerWidth:r}=window;return(t>0&&t<i||o>0&&o<i)&&(n>0&&n<r||s>0&&s<r)}const dwe=e=>(t,n)=>{const o=new IntersectionObserver(s=>{for(const i of s)if(i.isIntersecting){o.disconnect(),t();break}},e);return n(s=>{if(s instanceof Element){if(TT(s))return t(),o.disconnect(),!1;o.observe(s)}}),()=>o.disconnect()},fwe=e=>t=>{if(e){const n=matchMedia(e);if(n.matches)t();else return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t)}},hwe=(e=[])=>(t,n)=>{Cn(e)&&(e=[e]);let o=!1;const s=r=>{o||(o=!0,i(),t(),r.target.dispatchEvent(new r.constructor(r.type,r)))},i=()=>{n(r=>{for(const l of e)r.removeEventListener(l,s)})};return n(r=>{for(const l of e)r.addEventListener(l,s,{once:!0})}),i};function NT(e,t){if(wc(e)&&e.data==="["){let n=1,o=e.nextSibling;for(;o;){if(o.nodeType===1){if(t(o)===!1)break}else if(wc(o))if(o.data==="]"){if(--n===0)break}else o.data==="["&&n++;o=o.nextSibling}}else t(e)}const Or=e=>!!e.type.__asyncLoader;function Li(e){$t(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:o,delay:s=200,hydrate:i,timeout:r,suspensible:l=!0,onError:a}=e;let c=null,u,d=0;const f=()=>(d++,c=null,h()),h=()=>{let p;return c||(p=c=t().catch(g=>{if(g=g instanceof Error?g:new Error(String(g)),a)return new Promise((b,v)=>{a(g,()=>b(f()),()=>v(g),d+1)});throw g}).then(g=>p!==c&&c?c:(g&&(g.__esModule||g[Symbol.toStringTag]==="Module")&&(g=g.default),u=g,g)))};return Ze({name:"AsyncComponentWrapper",__asyncLoader:h,__asyncHydrate(p,g,b){let v=!1;(g.bu||(g.bu=[])).push(()=>v=!0);const m=()=>{v||b()},y=i?()=>{const k=i(m,A=>NT(p,A));k&&(g.bum||(g.bum=[])).push(k)}:m;u?y():h().then(()=>!g.isUnmounted&&y())},get __asyncResolved(){return u},setup(){const p=Vo;if(vy(p),u)return()=>Rf(u,p);const g=y=>{c=null,su(y,p,13,!o)};if(l&&p.suspense||Ta)return h().then(y=>()=>Rf(y,p)).catch(y=>(g(y),()=>o?re(o,{error:y}):null));const b=J(!1),v=J(),m=J(!!s);return s&&setTimeout(()=>{m.value=!1},s),r!=null&&setTimeout(()=>{if(!b.value&&!v.value){const y=new Error(`Async component timed out after ${r}ms.`);g(y),v.value=y}},r),h().then(()=>{b.value=!0,p.parent&&jd(p.parent.vnode)&&p.parent.update()}).catch(y=>{g(y),v.value=y}),()=>{if(b.value&&u)return Rf(u,p);if(v.value&&o)return re(o,{error:v.value});if(n&&!m.value)return Rf(n,p)}}})}function Rf(e,t){const{ref:n,props:o,children:s,ce:i}=t.vnode,r=re(e,o,s);return r.ref=n,r.ce=i,delete t.vnode.ce,r}const jd=e=>e.type.__isKeepAlive,IT={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=Yo(),o=n.ctx;if(!o.renderer)return()=>{const m=t.default&&t.default();return m&&m.length===1?m[0]:m};const s=new Map,i=new Set;let r=null;const l=n.suspense,{renderer:{p:a,m:c,um:u,o:{createElement:d}}}=o,f=d("div");o.activate=(m,y,k,A,$)=>{const I=m.component;c(m,y,k,0,l),a(I.vnode,m,y,k,I,l,A,m.slotScopeIds,$),vo(()=>{I.isDeactivated=!1,I.a&&Lc(I.a);const x=m.props&&m.props.onVnodeMounted;x&&Es(x,I.parent,m)},l)},o.deactivate=m=>{const y=m.component;Gh(y.m),Gh(y.a),c(m,f,null,1,l),vo(()=>{y.da&&Lc(y.da);const k=m.props&&m.props.onVnodeUnmounted;k&&Es(k,y.parent,m),y.isDeactivated=!0},l)};function h(m){e0(m),u(m,n,l,!0)}function p(m){s.forEach((y,k)=>{const A=Hg(Or(y)?y.type.__asyncResolved||{}:y.type);A&&!m(A)&&g(k)})}function g(m){const y=s.get(m);y&&(!r||!Ii(y,r))?h(y):r&&e0(r),s.delete(m),i.delete(m)}Qe(()=>[e.include,e.exclude],([m,y])=>{m&&p(k=>Wu(m,k)),y&&p(k=>!Wu(y,k))},{flush:"post",deep:!0});let b=null;const v=()=>{b!=null&&(Yh(n.subTree.type)?vo(()=>{s.set(b,Bf(n.subTree))},n.subTree.suspense):s.set(b,Bf(n.subTree)))};return cn(v),yy(v),po(()=>{s.forEach(m=>{const{subTree:y,suspense:k}=n,A=Bf(y);if(m.type===A.type&&m.key===A.key){e0(A);const $=A.component.da;$&&vo($,k);return}h(m)})}),()=>{if(b=null,!t.default)return r=null;const m=t.default(),y=m[0];if(m.length>1)return r=null,m;if(!Nl(y)||!(y.shapeFlag&4)&&!(y.shapeFlag&128))return r=null,y;let k=Bf(y);if(k.type===bo)return r=null,k;const A=k.type,$=Hg(Or(k)?k.type.__asyncResolved||{}:A),{include:I,exclude:x,max:L}=e;if(I&&(!$||!Wu(I,$))||x&&$&&Wu(x,$))return k.shapeFlag&=-257,r=k,y;const E=k.key==null?A:k.key,F=s.get(E);return k.el&&(k=Wr(k),y.shapeFlag&128&&(y.ssContent=k)),b=E,F?(k.el=F.el,k.component=F.component,k.transition&&Tl(k,k.transition),k.shapeFlag|=512,i.delete(E),i.add(E)):(i.add(E),L&&i.size>parseInt(L,10)&&g(i.values().next().value)),k.shapeFlag|=256,r=k,Yh(y.type)?y:k}}},pwe=IT;function Wu(e,t){return xt(e)?e.some(n=>Wu(n,t)):Cn(e)?e.split(",").includes(t):yE(e)?(e.lastIndex=0,e.test(t)):!1}function LT(e,t){Q4(e,"a",t)}function $T(e,t){Q4(e,"da",t)}function Q4(e,t,n=Vo){const o=e.__wdc||(e.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(fm(t,o,n),n){let s=n.parent;for(;s&&s.parent;)jd(s.parent.vnode)&&FT(o,t,n,s),s=s.parent}}function FT(e,t,n,o){const s=fm(t,e,o,!0);bn(()=>{ay(o[t],s)},n)}function e0(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function Bf(e){return e.shapeFlag&128?e.ssContent:e}function fm(e,t,n=Vo,o=!1){if(n){const s=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...r)=>{Dr();const l=iu(n),a=wi(t,n,e,r);return l(),Pr(),a});return o?s.unshift(i):s.push(i),i}}const Ur=e=>(t,n=Vo)=>{(!Ta||e==="sp")&&fm(e,(...o)=>t(...o),n)},OT=Ur("bm"),cn=Ur("m"),X4=Ur("bu"),yy=Ur("u"),po=Ur("bum"),bn=Ur("um"),RT=Ur("sp"),BT=Ur("rtg"),DT=Ur("rtc");function PT(e,t=Vo){fm("ec",e,t)}const ky="components",HT="directives";function WT(e,t){return by(ky,e,!0,t)||e}const J4=Symbol.for("v-ndc");function jo(e){return Cn(e)?by(ky,e,!1)||e:e||J4}function mwe(e){return by(HT,e)}function by(e,t,n=!0,o=!1){const s=Ko||Vo;if(s){const i=s.type;if(e===ky){const l=Hg(i,!1);if(l&&(l===t||l===No(t)||l===tm(No(t))))return i}const r=qb(s[e]||i[e],t)||qb(s.appContext[e],t);return!r&&o?i:r}}function qb(e,t){return e&&(e[t]||e[No(t)]||e[tm(No(t))])}function ot(e,t,n,o){let s;const i=n&&n[o],r=xt(e);if(r||Cn(e)){const l=r&&_l(e);let a=!1,c=!1;l&&(a=!Ks(e),c=Hr(e),e=rm(e)),s=new Array(e.length);for(let u=0,d=e.length;u<d;u++)s[u]=t(a?c?Gc(Di(e[u])):Di(e[u]):e[u],u,void 0,i&&i[u])}else if(typeof e=="number"){s=new Array(e);for(let l=0;l<e;l++)s[l]=t(l+1,l,void 0,i&&i[l])}else if(an(e))if(e[Symbol.iterator])s=Array.from(e,(l,a)=>t(l,a,void 0,i&&i[a]));else{const l=Object.keys(e);s=new Array(l.length);for(let a=0,c=l.length;a<c;a++){const u=l[a];s[a]=t(e[u],u,a,i&&i[a])}}else s=[];return n&&(n[o]=s),s}function e3(e,t){for(let n=0;n<t.length;n++){const o=t[n];if(xt(o))for(let s=0;s<o.length;s++)e[o[s].name]=o[s].fn;else o&&(e[o.name]=o.key?(...s)=>{const i=o.fn(...s);return i&&(i.key=o.key),i}:o.fn)}return e}function On(e,t,n={},o,s){if(Ko.ce||Ko.parent&&Or(Ko.parent)&&Ko.parent.ce){const c=Object.keys(n).length>0;return t!=="default"&&(n.name=t),w(),we(Pe,null,[re("slot",n,o&&o())],c?-2:64)}let i=e[t];i&&i._c&&(i._d=!1),w();const r=i&&xy(i(n)),l=n.key||r&&r.key,a=we(Pe,{key:(l&&!Js(l)?l:`_${t}`)+(!r&&o?"_fb":"")},r||(o?o():[]),r&&e._===1?64:-2);return!s&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),i&&i._c&&(i._d=!0),a}function xy(e){return e.some(t=>Nl(t)?!(t.type===bo||t.type===Pe&&!xy(t.children)):!0)?e:null}function gwe(e,t){const n={};for(const o in e)n[t&&/[A-Z]/.test(o)?`on:${o}`:mh(o)]=e[o];return n}const Lg=e=>e?C3(e)?Kd(e):Lg(e.parent):null,Xu=kn(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=>Lg(e.parent),$root:e=>Lg(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>wy(e),$forceUpdate:e=>e.f||(e.f=()=>{my(e.update)}),$nextTick:e=>e.n||(e.n=mt.bind(e.proxy)),$watch:e=>vT.bind(e)}),t0=(e,t)=>e!==Qt&&!e.__isScriptSetup&&ln(e,t),$g={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:o,data:s,props:i,accessCache:r,type:l,appContext:a}=e;if(t[0]!=="$"){const f=r[t];if(f!==void 0)switch(f){case 1:return o[t];case 2:return s[t];case 4:return n[t];case 3:return i[t]}else{if(t0(o,t))return r[t]=1,o[t];if(s!==Qt&&ln(s,t))return r[t]=2,s[t];if(ln(i,t))return r[t]=3,i[t];if(n!==Qt&&ln(n,t))return r[t]=4,n[t];Fg&&(r[t]=0)}}const c=Xu[t];let u,d;if(c)return t==="$attrs"&&Jo(e.attrs,"get",""),c(e);if((u=l.__cssModules)&&(u=u[t]))return u;if(n!==Qt&&ln(n,t))return r[t]=4,n[t];if(d=a.config.globalProperties,ln(d,t))return d[t]},set({_:e},t,n){const{data:o,setupState:s,ctx:i}=e;return t0(s,t)?(s[t]=n,!0):o!==Qt&&ln(o,t)?(o[t]=n,!0):ln(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:o,appContext:s,props:i,type:r}},l){let a;return!!(n[l]||e!==Qt&&l[0]!=="$"&&ln(e,l)||t0(t,l)||ln(i,l)||ln(o,l)||ln(Xu,l)||ln(s.config.globalProperties,l)||(a=r.__cssModules)&&a[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:ln(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},zT=kn({},$g,{get(e,t){if(t!==Symbol.unscopables)return $g.get(e,t,e)},has(e,t){return t[0]!=="_"&&!_E(t)}});function vwe(){return null}function ywe(){return null}function kwe(e){}function bwe(e){}function xwe(){return null}function wwe(){}function _we(e,t){return null}function Swe(){return t3().slots}function Vd(){return t3().attrs}function t3(e){const t=Yo();return t.setupContext||(t.setupContext=E3(t))}function bd(e){return xt(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function Cwe(e,t){const n=bd(e);for(const o in t){if(o.startsWith("__skip"))continue;let s=n[o];s?xt(s)||$t(s)?s=n[o]={type:s,default:t[o]}:s.default=t[o]:s===null&&(s=n[o]={default:t[o]}),s&&t[`__skip_${o}`]&&(s.skipFactory=!0)}return n}function Awe(e,t){return!e||!t?e||t:xt(e)&&xt(t)?e.concat(t):kn({},bd(e),bd(t))}function Mwe(e,t){const n={};for(const o in e)t.includes(o)||Object.defineProperty(n,o,{enumerable:!0,get:()=>e[o]});return n}function Ewe(e){const t=Yo(),n=Ta;let o=e();wd(),n&&Bc(!1);const s=()=>{iu(t),n&&Bc(!0)},i=()=>{Yo()!==t&&t.scope.off(),wd(),n&&Bc(!1)};return cy(o)&&(o=o.catch(r=>{throw s(),Promise.resolve().then(()=>Promise.resolve().then(i)),r})),[o,()=>{s(),Promise.resolve().then(i)}]}let Fg=!0;function UT(e){const t=wy(e),n=e.proxy,o=e.ctx;Fg=!1,t.beforeCreate&&jb(t.beforeCreate,e,"bc");const{data:s,computed:i,methods:r,watch:l,provide:a,inject:c,created:u,beforeMount:d,mounted:f,beforeUpdate:h,updated:p,activated:g,deactivated:b,beforeDestroy:v,beforeUnmount:m,destroyed:y,unmounted:k,render:A,renderTracked:$,renderTriggered:I,errorCaptured:x,serverPrefetch:L,expose:E,inheritAttrs:F,components:S,directives:N,filters:D}=t;if(c&&qT(c,o,null),r)for(const H in r){const P=r[H];$t(P)&&(o[H]=P.bind(n))}if(s){const H=s.call(n,n);an(H)&&(e.data=Bo(H))}if(Fg=!0,i)for(const H in i){const P=i[H],Z=$t(P)?P.bind(n,n):$t(P.get)?P.get.bind(n,n):ki,K=!$t(P)&&$t(P.set)?P.set.bind(n):ki,V=R({get:Z,set:K});Object.defineProperty(o,H,{enumerable:!0,configurable:!0,get:()=>V.value,set:X=>V.value=X})}if(l)for(const H in l)n3(l[H],o,n,H);if(a){const H=$t(a)?a.call(n):a;Reflect.ownKeys(H).forEach(P=>{Ln(P,H[P])})}u&&jb(u,e,"c");function U(H,P){xt(P)?P.forEach(Z=>H(Z.bind(n))):P&&H(P.bind(n))}if(U(OT,d),U(cn,f),U(X4,h),U(yy,p),U(LT,g),U($T,b),U(PT,x),U(DT,$),U(BT,I),U(po,m),U(bn,k),U(RT,L),xt(E))if(E.length){const H=e.exposed||(e.exposed={});E.forEach(P=>{Object.defineProperty(H,P,{get:()=>n[P],set:Z=>n[P]=Z,enumerable:!0})})}else e.exposed||(e.exposed={});A&&e.render===ki&&(e.render=A),F!=null&&(e.inheritAttrs=F),S&&(e.components=S),N&&(e.directives=N),L&&vy(e)}function qT(e,t,n=ki){xt(e)&&(e=Og(e));for(const o in e){const s=e[o];let i;an(s)?"default"in s?i=Kt(s.from||o,s.default,!0):i=Kt(s.from||o):i=Kt(s),ho(i)?Object.defineProperty(t,o,{enumerable:!0,configurable:!0,get:()=>i.value,set:r=>i.value=r}):t[o]=i}}function jb(e,t,n){wi(xt(e)?e.map(o=>o.bind(t.proxy)):e.bind(t.proxy),t,n)}function n3(e,t,n,o){let s=o.includes(".")?U4(n,o):()=>n[o];if(Cn(e)){const i=t[e];$t(i)&&Qe(s,i)}else if($t(e))Qe(s,e.bind(n));else if(an(e))if(xt(e))e.forEach(i=>n3(i,t,n,o));else{const i=$t(e.handler)?e.handler.bind(n):t[e.handler];$t(i)&&Qe(s,i,e)}}function wy(e){const t=e.type,{mixins:n,extends:o}=t,{mixins:s,optionsCache:i,config:{optionMergeStrategies:r}}=e.appContext,l=i.get(t);let a;return l?a=l:!s.length&&!n&&!o?a=t:(a={},s.length&&s.forEach(c=>Kh(a,c,r,!0)),Kh(a,t,r)),an(t)&&i.set(t,a),a}function Kh(e,t,n,o=!1){const{mixins:s,extends:i}=t;i&&Kh(e,i,n,!0),s&&s.forEach(r=>Kh(e,r,n,!0));for(const r in t)if(!(o&&r==="expose")){const l=jT[r]||n&&n[r];e[r]=l?l(e[r],t[r]):t[r]}return e}const jT={data:Vb,props:Kb,emits:Kb,methods:zu,computed:zu,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:zu,directives:zu,watch:KT,provide:Vb,inject:VT};function Vb(e,t){return t?e?function(){return kn($t(e)?e.call(this,this):e,$t(t)?t.call(this,this):t)}:t:e}function VT(e,t){return zu(Og(e),Og(t))}function Og(e){if(xt(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 zu(e,t){return e?kn(Object.create(null),e,t):t}function Kb(e,t){return e?xt(e)&&xt(t)?[...new Set([...e,...t])]:kn(Object.create(null),bd(e),bd(t??{})):t}function KT(e,t){if(!e)return t;if(!t)return e;const n=kn(Object.create(null),e);for(const o in t)n[o]=cs(e[o],t[o]);return n}function o3(){return{app:null,config:{isNativeTag:f4,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 GT=0;function YT(e,t){return function(o,s=null){$t(o)||(o=kn({},o)),s!=null&&!an(s)&&(s=null);const i=o3(),r=new WeakSet,l=[];let a=!1;const c=i.app={_uid:GT++,_component:o,_props:s,_container:null,_context:i,_instance:null,version:C9,get config(){return i.config},set config(u){},use(u,...d){return r.has(u)||(u&&$t(u.install)?(r.add(u),u.install(c,...d)):$t(u)&&(r.add(u),u(c,...d))),c},mixin(u){return i.mixins.includes(u)||i.mixins.push(u),c},component(u,d){return d?(i.components[u]=d,c):i.components[u]},directive(u,d){return d?(i.directives[u]=d,c):i.directives[u]},mount(u,d,f){if(!a){const h=c._ceVNode||re(o,s);return h.appContext=i,f===!0?f="svg":f===!1&&(f=void 0),d&&t?t(h,u):e(h,u,f),a=!0,c._container=u,u.__vue_app__=c,Kd(h.component)}},onUnmount(u){l.push(u)},unmount(){a&&(wi(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=Sa;Sa=c;try{return u()}finally{Sa=d}}};return c}}let Sa=null;function Twe(e,t,n=Qt){const o=Yo(),s=No(t),i=Is(t),r=s3(e,s),l=tT((a,c)=>{let u,d=Qt,f;return gT(()=>{const h=e[s];qo(u,h)&&(u=h,c())}),{get(){return a(),n.get?n.get(u):u},set(h){const p=n.set?n.set(h):h;if(!qo(p,u)&&!(d!==Qt&&qo(h,d)))return;const g=o.vnode.props;g&&(t in g||s in g||i in g)&&(`onUpdate:${t}`in g||`onUpdate:${s}`in g||`onUpdate:${i}`in g)||(u=h,c()),o.emit(`update:${t}`,p),qo(h,p)&&qo(h,d)&&!qo(p,f)&&c(),d=h,f=p}}});return l[Symbol.iterator]=()=>{let a=0;return{next(){return a<2?{value:a++?r||Qt:l,done:!1}:{done:!0}}}},l}const s3=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${No(t)}Modifiers`]||e[`${Is(t)}Modifiers`];function ZT(e,t,...n){if(e.isUnmounted)return;const o=e.vnode.props||Qt;let s=n;const i=t.startsWith("update:"),r=i&&s3(o,t.slice(7));r&&(r.trim&&(s=n.map(u=>Cn(u)?u.trim():u)),r.number&&(s=n.map(nm)));let l,a=o[l=mh(t)]||o[l=mh(No(t))];!a&&i&&(a=o[l=mh(Is(t))]),a&&wi(a,e,6,s);const c=o[l+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,wi(c,e,6,s)}}const QT=new WeakMap;function i3(e,t,n=!1){const o=n?QT:t.emitsCache,s=o.get(e);if(s!==void 0)return s;const i=e.emits;let r={},l=!1;if(!$t(e)){const a=c=>{const u=i3(c,t,!0);u&&(l=!0,kn(r,u))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!i&&!l?(an(e)&&o.set(e,null),null):(xt(i)?i.forEach(a=>r[a]=null):kn(r,i),an(e)&&o.set(e,r),r)}function hm(e,t){return!e||!zd(t)?!1:(t=t.slice(2).replace(/Once$/,""),ln(e,t[0].toLowerCase()+t.slice(1))||ln(e,Is(t))||ln(e,t))}function gh(e){const{type:t,vnode:n,proxy:o,withProxy:s,propsOptions:[i],slots:r,attrs:l,emit:a,render:c,renderCache:u,props:d,data:f,setupState:h,ctx:p,inheritAttrs:g}=e,b=yd(e);let v,m;try{if(n.shapeFlag&4){const k=s||o,A=k;v=Ns(c.call(A,k,u,d,h,f,p)),m=l}else{const k=t;v=Ns(k.length>1?k(d,{attrs:l,slots:r,emit:a}):k(d,null)),m=t.props?l:JT(l)}}catch(k){Ju.length=0,su(k,e,1),v=re(bo)}let y=v;if(m&&g!==!1){const k=Object.keys(m),{shapeFlag:A}=y;k.length&&A&7&&(i&&k.some(Qp)&&(m=e9(m,i)),y=Wr(y,m,!1,!0))}return n.dirs&&(y=Wr(y,null,!1,!0),y.dirs=y.dirs?y.dirs.concat(n.dirs):n.dirs),n.transition&&Tl(y,n.transition),v=y,yd(b),v}function XT(e,t=!0){let n;for(let o=0;o<e.length;o++){const s=e[o];if(Nl(s)){if(s.type!==bo||s.children==="v-if"){if(n)return;n=s}}else return}return n}const JT=e=>{let t;for(const n in e)(n==="class"||n==="style"||zd(n))&&((t||(t={}))[n]=e[n]);return t},e9=(e,t)=>{const n={};for(const o in e)(!Qp(o)||!(o.slice(9)in t))&&(n[o]=e[o]);return n};function t9(e,t,n){const{props:o,children:s,component:i}=e,{props:r,children:l,patchFlag:a}=t,c=i.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&a>=0){if(a&1024)return!0;if(a&16)return o?Gb(o,r,c):!!r;if(a&8){const u=t.dynamicProps;for(let d=0;d<u.length;d++){const f=u[d];if(r3(r,o,f)&&!hm(c,f))return!0}}}else return(s||l)&&(!l||!l.$stable)?!0:o===r?!1:o?r?Gb(o,r,c):!0:!!r;return!1}function Gb(e,t,n){const o=Object.keys(t);if(o.length!==Object.keys(e).length)return!0;for(let s=0;s<o.length;s++){const i=o[s];if(r3(t,e,i)&&!hm(n,i))return!0}return!1}function r3(e,t,n){const o=e[n],s=t[n];return n==="style"&&an(o)&&an(s)?!Br(o,s):o!==s}function pm({vnode:e,parent:t,suspense:n},o){for(;t;){const s=t.subTree;if(s.suspense&&s.suspense.activeBranch===e&&(s.suspense.vnode.el=s.el=o,e=s),s===e)(e=t.vnode).el=o,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=o)}const l3={},a3=()=>Object.create(l3),c3=e=>Object.getPrototypeOf(e)===l3;function n9(e,t,n,o=!1){const s={},i=a3();e.propsDefaults=Object.create(null),u3(e,t,s,i);for(const r in e.propsOptions[0])r in s||(s[r]=void 0);n?e.props=o?s:QE(s):e.type.props?e.props=s:e.props=i,e.attrs=i}function o9(e,t,n,o){const{props:s,attrs:i,vnode:{patchFlag:r}}=e,l=en(s),[a]=e.propsOptions;let c=!1;if((o||r>0)&&!(r&16)){if(r&8){const u=e.vnode.dynamicProps;for(let d=0;d<u.length;d++){let f=u[d];if(hm(e.emitsOptions,f))continue;const h=t[f];if(a)if(ln(i,f))h!==i[f]&&(i[f]=h,c=!0);else{const p=No(f);s[p]=Rg(a,l,p,h,e,!1)}else h!==i[f]&&(i[f]=h,c=!0)}}}else{u3(e,t,s,i)&&(c=!0);let u;for(const d in l)(!t||!ln(t,d)&&((u=Is(d))===d||!ln(t,u)))&&(a?n&&(n[d]!==void 0||n[u]!==void 0)&&(s[d]=Rg(a,l,d,void 0,e,!0)):delete s[d]);if(i!==l)for(const d in i)(!t||!ln(t,d))&&(delete i[d],c=!0)}c&&Tr(e.attrs,"set","")}function u3(e,t,n,o){const[s,i]=e.propsOptions;let r=!1,l;if(t)for(let a in t){if(wa(a))continue;const c=t[a];let u;s&&ln(s,u=No(a))?!i||!i.includes(u)?n[u]=c:(l||(l={}))[u]=c:hm(e.emitsOptions,a)||(!(a in o)||c!==o[a])&&(o[a]=c,r=!0)}if(i){const a=en(n),c=l||Qt;for(let u=0;u<i.length;u++){const d=i[u];n[d]=Rg(s,a,d,c[d],e,!ln(c,d))}}return r}function Rg(e,t,n,o,s,i){const r=e[n];if(r!=null){const l=ln(r,"default");if(l&&o===void 0){const a=r.default;if(r.type!==Function&&!r.skipFactory&&$t(a)){const{propsDefaults:c}=s;if(n in c)o=c[n];else{const u=iu(s);o=c[n]=a.call(null,t),u()}}else o=a;s.ce&&s.ce._setProp(n,o)}r[0]&&(i&&!l?o=!1:r[1]&&(o===""||o===Is(n))&&(o=!0))}return o}const s9=new WeakMap;function d3(e,t,n=!1){const o=n?s9:t.propsCache,s=o.get(e);if(s)return s;const i=e.props,r={},l=[];let a=!1;if(!$t(e)){const u=d=>{a=!0;const[f,h]=d3(d,t,!0);kn(r,f),h&&l.push(...h)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!i&&!a)return an(e)&&o.set(e,Nc),Nc;if(xt(i))for(let u=0;u<i.length;u++){const d=No(i[u]);Yb(d)&&(r[d]=Qt)}else if(i)for(const u in i){const d=No(u);if(Yb(d)){const f=i[u],h=r[d]=xt(f)||$t(f)?{type:f}:kn({},f),p=h.type;let g=!1,b=!0;if(xt(p))for(let v=0;v<p.length;++v){const m=p[v],y=$t(m)&&m.name;if(y==="Boolean"){g=!0;break}else y==="String"&&(b=!1)}else g=$t(p)&&p.name==="Boolean";h[0]=g,h[1]=b,(g||ln(h,"default"))&&l.push(d)}}const c=[r,l];return an(e)&&o.set(e,c),c}function Yb(e){return e[0]!=="$"&&!wa(e)}const _y=e=>e==="_"||e==="_ctx"||e==="$stable",Sy=e=>xt(e)?e.map(Ns):[Ns(e)],i9=(e,t,n)=>{if(t._n)return t;const o=Ee((...s)=>Sy(t(...s)),n);return o._c=!1,o},f3=(e,t,n)=>{const o=e._ctx;for(const s in e){if(_y(s))continue;const i=e[s];if($t(i))t[s]=i9(s,i,o);else if(i!=null){const r=Sy(i);t[s]=()=>r}}},h3=(e,t)=>{const n=Sy(t);e.slots.default=()=>n},p3=(e,t,n)=>{for(const o in t)(n||!_y(o))&&(e[o]=t[o])},r9=(e,t,n)=>{const o=e.slots=a3();if(e.vnode.shapeFlag&32){const s=t._;s?(p3(o,t,n),n&&p4(o,"_",s,!0)):f3(t,o)}else t&&h3(e,t)},l9=(e,t,n)=>{const{vnode:o,slots:s}=e;let i=!0,r=Qt;if(o.shapeFlag&32){const l=t._;l?n&&l===1?i=!1:p3(s,t,n):(i=!t.$stable,f3(t,s)),r=t}else t&&(h3(e,t),r={default:1});if(i)for(const l in s)!_y(l)&&r[l]==null&&delete s[l]},vo=b3;function a9(e){return m3(e)}function c9(e){return m3(e,CT)}function m3(e,t){const n=om();n.__VUE__=!0;const{insert:o,remove:s,patchProp:i,createElement:r,createText:l,createComment:a,setText:c,setElementText:u,parentNode:d,nextSibling:f,setScopeId:h=ki,insertStaticContent:p}=e,g=(q,ee,ye,fe=null,ve=null,j=null,te=void 0,me=null,Ae=!!ee.dynamicChildren)=>{if(q===ee)return;q&&!Ii(q,ee)&&(fe=Ce(q),X(q,ve,j,!0),q=null),ee.patchFlag===-2&&(Ae=!1,ee.dynamicChildren=null);const{type:$e,ref:De,shapeFlag:ge}=ee;switch($e){case Sl:b(q,ee,ye,fe);break;case bo:v(q,ee,ye,fe);break;case Rc:q==null&&m(ee,ye,fe,te);break;case Pe:S(q,ee,ye,fe,ve,j,te,me,Ae);break;default:ge&1?A(q,ee,ye,fe,ve,j,te,me,Ae):ge&6?N(q,ee,ye,fe,ve,j,te,me,Ae):(ge&64||ge&128)&&$e.process(q,ee,ye,fe,ve,j,te,me,Ae,z)}De!=null&&ve?Fc(De,q&&q.ref,j,ee||q,!ee):De==null&&q&&q.ref!=null&&Fc(q.ref,null,j,q,!0)},b=(q,ee,ye,fe)=>{if(q==null)o(ee.el=l(ee.children),ye,fe);else{const ve=ee.el=q.el;ee.children!==q.children&&c(ve,ee.children)}},v=(q,ee,ye,fe)=>{q==null?o(ee.el=a(ee.children||""),ye,fe):ee.el=q.el},m=(q,ee,ye,fe)=>{[q.el,q.anchor]=p(q.children,ee,ye,fe,q.el,q.anchor)},y=({el:q,anchor:ee},ye,fe)=>{let ve;for(;q&&q!==ee;)ve=f(q),o(q,ye,fe),q=ve;o(ee,ye,fe)},k=({el:q,anchor:ee})=>{let ye;for(;q&&q!==ee;)ye=f(q),s(q),q=ye;s(ee)},A=(q,ee,ye,fe,ve,j,te,me,Ae)=>{if(ee.type==="svg"?te="svg":ee.type==="math"&&(te="mathml"),q==null)$(ee,ye,fe,ve,j,te,me,Ae);else{const $e=q.el&&q.el._isVueCE?q.el:null;try{$e&&$e._beginPatch(),L(q,ee,ve,j,te,me,Ae)}finally{$e&&$e._endPatch()}}},$=(q,ee,ye,fe,ve,j,te,me)=>{let Ae,$e;const{props:De,shapeFlag:ge,transition:Ne,dirs:et}=q;if(Ae=q.el=r(q.type,j,De&&De.is,De),ge&8?u(Ae,q.children):ge&16&&x(q.children,Ae,null,fe,ve,n0(q,j),te,me),et&&Xi(q,null,fe,"created"),I(Ae,q,q.scopeId,te,fe),De){for(const _t in De)_t!=="value"&&!wa(_t)&&i(Ae,_t,null,De[_t],j,fe);"value"in De&&i(Ae,"value",null,De.value,j),($e=De.onVnodeBeforeMount)&&Es($e,fe,q)}et&&Xi(q,null,fe,"beforeMount");const rt=g3(ve,Ne);rt&&Ne.beforeEnter(Ae),o(Ae,ee,ye),(($e=De&&De.onVnodeMounted)||rt||et)&&vo(()=>{try{$e&&Es($e,fe,q),rt&&Ne.enter(Ae),et&&Xi(q,null,fe,"mounted")}finally{}},ve)},I=(q,ee,ye,fe,ve)=>{if(ye&&h(q,ye),fe)for(let j=0;j<fe.length;j++)h(q,fe[j]);if(ve){let j=ve.subTree;if(ee===j||Yh(j.type)&&(j.ssContent===ee||j.ssFallback===ee)){const te=ve.vnode;I(q,te,te.scopeId,te.slotScopeIds,ve.parent)}}},x=(q,ee,ye,fe,ve,j,te,me,Ae=0)=>{for(let $e=Ae;$e<q.length;$e++){const De=q[$e]=me?Mr(q[$e]):Ns(q[$e]);g(null,De,ee,ye,fe,ve,j,te,me)}},L=(q,ee,ye,fe,ve,j,te)=>{const me=ee.el=q.el;let{patchFlag:Ae,dynamicChildren:$e,dirs:De}=ee;Ae|=q.patchFlag&16;const ge=q.props||Qt,Ne=ee.props||Qt;let et;if(ye&&na(ye,!1),(et=Ne.onVnodeBeforeUpdate)&&Es(et,ye,ee,q),De&&Xi(ee,q,ye,"beforeUpdate"),ye&&na(ye,!0),(ge.innerHTML&&Ne.innerHTML==null||ge.textContent&&Ne.textContent==null)&&u(me,""),$e?E(q.dynamicChildren,$e,me,ye,fe,n0(ee,ve),j):te||P(q,ee,me,null,ye,fe,n0(ee,ve),j,!1),Ae>0){if(Ae&16)F(me,ge,Ne,ye,ve);else if(Ae&2&&ge.class!==Ne.class&&i(me,"class",null,Ne.class,ve),Ae&4&&i(me,"style",ge.style,Ne.style,ve),Ae&8){const rt=ee.dynamicProps;for(let _t=0;_t<rt.length;_t++){const gt=rt[_t],It=ge[gt],Ut=Ne[gt];(Ut!==It||gt==="value")&&i(me,gt,It,Ut,ve,ye)}}Ae&1&&q.children!==ee.children&&u(me,ee.children)}else!te&&$e==null&&F(me,ge,Ne,ye,ve);((et=Ne.onVnodeUpdated)||De)&&vo(()=>{et&&Es(et,ye,ee,q),De&&Xi(ee,q,ye,"updated")},fe)},E=(q,ee,ye,fe,ve,j,te)=>{for(let me=0;me<ee.length;me++){const Ae=q[me],$e=ee[me],De=Ae.el&&(Ae.type===Pe||!Ii(Ae,$e)||Ae.shapeFlag&198)?d(Ae.el):ye;g(Ae,$e,De,null,fe,ve,j,te,!0)}},F=(q,ee,ye,fe,ve)=>{if(ee!==ye){if(ee!==Qt)for(const j in ee)!wa(j)&&!(j in ye)&&i(q,j,ee[j],null,ve,fe);for(const j in ye){if(wa(j))continue;const te=ye[j],me=ee[j];te!==me&&j!=="value"&&i(q,j,me,te,ve,fe)}"value"in ye&&i(q,"value",ee.value,ye.value,ve)}},S=(q,ee,ye,fe,ve,j,te,me,Ae)=>{const $e=ee.el=q?q.el:l(""),De=ee.anchor=q?q.anchor:l("");let{patchFlag:ge,dynamicChildren:Ne,slotScopeIds:et}=ee;et&&(me=me?me.concat(et):et),q==null?(o($e,ye,fe),o(De,ye,fe),x(ee.children||[],ye,De,ve,j,te,me,Ae)):ge>0&&ge&64&&Ne&&q.dynamicChildren&&q.dynamicChildren.length===Ne.length?(E(q.dynamicChildren,Ne,ye,ve,j,te,me),(ee.key!=null||ve&&ee===ve.subTree)&&Cy(q,ee,!0)):P(q,ee,ye,De,ve,j,te,me,Ae)},N=(q,ee,ye,fe,ve,j,te,me,Ae)=>{ee.slotScopeIds=me,q==null?ee.shapeFlag&512?ve.ctx.activate(ee,ye,fe,te,Ae):D(ee,ye,fe,ve,j,te,Ae):B(q,ee,Ae)},D=(q,ee,ye,fe,ve,j,te)=>{const me=q.component=S3(q,fe,ve);if(jd(q)&&(me.ctx.renderer=z),A3(me,!1,te),me.asyncDep){if(ve&&ve.registerDep(me,U,te),!q.el){const Ae=me.subTree=re(bo);v(null,Ae,ee,ye),q.placeholder=Ae.el}}else U(me,q,ee,ye,ve,j,te)},B=(q,ee,ye)=>{const fe=ee.component=q.component;if(t9(q,ee,ye))if(fe.asyncDep&&!fe.asyncResolved){H(fe,ee,ye);return}else fe.next=ee,fe.update();else ee.el=q.el,fe.vnode=ee},U=(q,ee,ye,fe,ve,j,te)=>{const me=()=>{if(q.isMounted){let{next:ge,bu:Ne,u:et,parent:rt,vnode:_t}=q;{const un=v3(q);if(un){ge&&(ge.el=_t.el,H(q,ge,te)),un.asyncDep.then(()=>{vo(()=>{q.isUnmounted||$e()},ve)});return}}let gt=ge,It;na(q,!1),ge?(ge.el=_t.el,H(q,ge,te)):ge=_t,Ne&&Lc(Ne),(It=ge.props&&ge.props.onVnodeBeforeUpdate)&&Es(It,rt,ge,_t),na(q,!0);const Ut=gh(q),ht=q.subTree;q.subTree=Ut,g(ht,Ut,d(ht.el),Ce(ht),q,ve,j),ge.el=Ut.el,gt===null&&pm(q,Ut.el),et&&vo(et,ve),(It=ge.props&&ge.props.onVnodeUpdated)&&vo(()=>Es(It,rt,ge,_t),ve)}else{let ge;const{el:Ne,props:et}=ee,{bm:rt,m:_t,parent:gt,root:It,type:Ut}=q,ht=Or(ee);if(na(q,!1),rt&&Lc(rt),!ht&&(ge=et&&et.onVnodeBeforeMount)&&Es(ge,gt,ee),na(q,!0),Ne&&ie){const un=()=>{q.subTree=gh(q),ie(Ne,q.subTree,q,ve,null)};ht&&Ut.__asyncHydrate?Ut.__asyncHydrate(Ne,q,un):un()}else{It.ce&&It.ce._hasShadowRoot()&&It.ce._injectChildStyle(Ut,q.parent?q.parent.type:void 0);const un=q.subTree=gh(q);g(null,un,ye,fe,q,ve,j),ee.el=un.el}if(_t&&vo(_t,ve),!ht&&(ge=et&&et.onVnodeMounted)){const un=ee;vo(()=>Es(ge,gt,un),ve)}(ee.shapeFlag&256||gt&&Or(gt.vnode)&&gt.vnode.shapeFlag&256)&&q.a&&vo(q.a,ve),q.isMounted=!0,ee=ye=fe=null}};q.scope.on();const Ae=q.effect=new Ph(me);q.scope.off();const $e=q.update=Ae.run.bind(Ae),De=q.job=Ae.runIfDirty.bind(Ae);De.i=q,De.id=q.uid,Ae.scheduler=()=>my(De),na(q,!0),$e()},H=(q,ee,ye)=>{ee.component=q;const fe=q.vnode.props;q.vnode=ee,q.next=null,o9(q,ee.props,fe,ye),l9(q,ee.children,ye),Dr(),Rb(q),Pr()},P=(q,ee,ye,fe,ve,j,te,me,Ae=!1)=>{const $e=q&&q.children,De=q?q.shapeFlag:0,ge=ee.children,{patchFlag:Ne,shapeFlag:et}=ee;if(Ne>0){if(Ne&128){K($e,ge,ye,fe,ve,j,te,me,Ae);return}else if(Ne&256){Z($e,ge,ye,fe,ve,j,te,me,Ae);return}}et&8?(De&16&&de($e,ve,j),ge!==$e&&u(ye,ge)):De&16?et&16?K($e,ge,ye,fe,ve,j,te,me,Ae):de($e,ve,j,!0):(De&8&&u(ye,""),et&16&&x(ge,ye,fe,ve,j,te,me,Ae))},Z=(q,ee,ye,fe,ve,j,te,me,Ae)=>{q=q||Nc,ee=ee||Nc;const $e=q.length,De=ee.length,ge=Math.min($e,De);let Ne;for(Ne=0;Ne<ge;Ne++){const et=ee[Ne]=Ae?Mr(ee[Ne]):Ns(ee[Ne]);g(q[Ne],et,ye,null,ve,j,te,me,Ae)}$e>De?de(q,ve,j,!0,!1,ge):x(ee,ye,fe,ve,j,te,me,Ae,ge)},K=(q,ee,ye,fe,ve,j,te,me,Ae)=>{let $e=0;const De=ee.length;let ge=q.length-1,Ne=De-1;for(;$e<=ge&&$e<=Ne;){const et=q[$e],rt=ee[$e]=Ae?Mr(ee[$e]):Ns(ee[$e]);if(Ii(et,rt))g(et,rt,ye,null,ve,j,te,me,Ae);else break;$e++}for(;$e<=ge&&$e<=Ne;){const et=q[ge],rt=ee[Ne]=Ae?Mr(ee[Ne]):Ns(ee[Ne]);if(Ii(et,rt))g(et,rt,ye,null,ve,j,te,me,Ae);else break;ge--,Ne--}if($e>ge){if($e<=Ne){const et=Ne+1,rt=et<De?ee[et].el:fe;for(;$e<=Ne;)g(null,ee[$e]=Ae?Mr(ee[$e]):Ns(ee[$e]),ye,rt,ve,j,te,me,Ae),$e++}}else if($e>Ne)for(;$e<=ge;)X(q[$e],ve,j,!0),$e++;else{const et=$e,rt=$e,_t=new Map;for($e=rt;$e<=Ne;$e++){const Wt=ee[$e]=Ae?Mr(ee[$e]):Ns(ee[$e]);Wt.key!=null&&_t.set(Wt.key,$e)}let gt,It=0;const Ut=Ne-rt+1;let ht=!1,un=0;const dn=new Array(Ut);for($e=0;$e<Ut;$e++)dn[$e]=0;for($e=et;$e<=ge;$e++){const Wt=q[$e];if(It>=Ut){X(Wt,ve,j,!0);continue}let Hn;if(Wt.key!=null)Hn=_t.get(Wt.key);else for(gt=rt;gt<=Ne;gt++)if(dn[gt-rt]===0&&Ii(Wt,ee[gt])){Hn=gt;break}Hn===void 0?X(Wt,ve,j,!0):(dn[Hn-rt]=$e+1,Hn>=un?un=Hn:ht=!0,g(Wt,ee[Hn],ye,null,ve,j,te,me,Ae),It++)}const ns=ht?u9(dn):Nc;for(gt=ns.length-1,$e=Ut-1;$e>=0;$e--){const Wt=rt+$e,Hn=ee[Wt],lo=ee[Wt+1],it=Wt+1<De?lo.el||y3(lo):fe;dn[$e]===0?g(null,Hn,ye,it,ve,j,te,me,Ae):ht&&(gt<0||$e!==ns[gt]?V(Hn,ye,it,2):gt--)}}},V=(q,ee,ye,fe,ve=null)=>{const{el:j,type:te,transition:me,children:Ae,shapeFlag:$e}=q;if($e&6){V(q.component.subTree,ee,ye,fe);return}if($e&128){q.suspense.move(ee,ye,fe);return}if($e&64){te.move(q,ee,ye,z);return}if(te===Pe){o(j,ee,ye);for(let ge=0;ge<Ae.length;ge++)V(Ae[ge],ee,ye,fe);o(q.anchor,ee,ye);return}if(te===Rc){y(q,ee,ye);return}if(fe!==2&&$e&1&&me)if(fe===0)me.persisted&&!j[fi]?o(j,ee,ye):(me.beforeEnter(j),o(j,ee,ye),vo(()=>me.enter(j),ve));else{const{leave:ge,delayLeave:Ne,afterLeave:et}=me,rt=()=>{q.ctx.isUnmounted?s(j):o(j,ee,ye)},_t=()=>{const gt=j._isLeaving||!!j[fi];j._isLeaving&&j[fi](!0),me.persisted&&!gt?rt():ge(j,()=>{rt(),et&&et()})};Ne?Ne(j,rt,_t):_t()}else o(j,ee,ye)},X=(q,ee,ye,fe=!1,ve=!1)=>{const{type:j,props:te,ref:me,children:Ae,dynamicChildren:$e,shapeFlag:De,patchFlag:ge,dirs:Ne,cacheIndex:et,memo:rt}=q;if(ge===-2&&(ve=!1),me!=null&&(Dr(),Fc(me,null,ye,q,!0),Pr()),et!=null&&(ee.renderCache[et]=void 0),De&256){ee.ctx.deactivate(q);return}const _t=De&1&&Ne,gt=!Or(q);let It;if(gt&&(It=te&&te.onVnodeBeforeUnmount)&&Es(It,ee,q),De&6)ue(q.component,ye,fe);else{if(De&128){q.suspense.unmount(ye,fe);return}_t&&Xi(q,null,ee,"beforeUnmount"),De&64?q.type.remove(q,ee,ye,z,fe):$e&&!$e.hasOnce&&(j!==Pe||ge>0&&ge&64)?de($e,ee,ye,!1,!0):(j===Pe&&ge&384||!ve&&De&16)&&de(Ae,ee,ye),fe&&he(q)}const Ut=rt!=null&&et==null;(gt&&(It=te&&te.onVnodeUnmounted)||_t||Ut)&&vo(()=>{It&&Es(It,ee,q),_t&&Xi(q,null,ee,"unmounted"),Ut&&(q.el=null)},ye)},he=q=>{const{type:ee,el:ye,anchor:fe,transition:ve}=q;if(ee===Pe){ne(ye,fe);return}if(ee===Rc){k(q);return}const j=()=>{s(ye),ve&&!ve.persisted&&ve.afterLeave&&ve.afterLeave()};if(q.shapeFlag&1&&ve&&!ve.persisted){const{leave:te,delayLeave:me}=ve,Ae=()=>te(ye,j);me?me(q.el,j,Ae):Ae()}else j()},ne=(q,ee)=>{let ye;for(;q!==ee;)ye=f(q),s(q),q=ye;s(ee)},ue=(q,ee,ye)=>{const{bum:fe,scope:ve,job:j,subTree:te,um:me,m:Ae,a:$e}=q;Gh(Ae),Gh($e),fe&&Lc(fe),ve.stop(),j&&(j.flags|=8,X(te,q,ee,ye)),me&&vo(me,ee),vo(()=>{q.isUnmounted=!0},ee)},de=(q,ee,ye,fe=!1,ve=!1,j=0)=>{for(let te=j;te<q.length;te++)X(q[te],ee,ye,fe,ve)},Ce=q=>{if(q.shapeFlag&6)return Ce(q.component.subTree);if(q.shapeFlag&128)return q.suspense.next();const ee=f(q.anchor||q.el),ye=ee&&ee[q4];return ye?f(ye):ee};let Ie=!1;const le=(q,ee,ye)=>{let fe;q==null?ee._vnode&&(X(ee._vnode,null,null,!0),fe=ee._vnode.component):g(ee._vnode||null,q,ee,null,null,null,ye),ee._vnode=q,Ie||(Ie=!0,Rb(fe),jh(),Ie=!1)},z={p:g,um:X,m:V,r:he,mt:D,mc:x,pc:P,pbc:E,n:Ce,o:e};let ae,ie;return t&&([ae,ie]=t(z)),{render:le,hydrate:ae,createApp:YT(le,ae)}}function n0({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 na({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function g3(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Cy(e,t,n=!1){const o=e.children,s=t.children;if(xt(o)&&xt(s))for(let i=0;i<o.length;i++){const r=o[i];let l=s[i];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=s[i]=Mr(s[i]),l.el=r.el),!n&&l.patchFlag!==-2&&Cy(r,l)),l.type===Sl&&(l.patchFlag===-1&&(l=s[i]=Mr(l)),l.el=r.el),l.type===bo&&!l.el&&(l.el=r.el)}}function u9(e){const t=e.slice(),n=[0];let o,s,i,r,l;const a=e.length;for(o=0;o<a;o++){const c=e[o];if(c!==0){if(s=n[n.length-1],e[s]<c){t[o]=s,n.push(o);continue}for(i=0,r=n.length-1;i<r;)l=i+r>>1,e[n[l]]<c?i=l+1:r=l;c<e[n[i]]&&(i>0&&(t[o]=n[i-1]),n[i]=o)}}for(i=n.length,r=n[i-1];i-- >0;)n[i]=r,r=t[r];return n}function v3(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:v3(t)}function Gh(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function y3(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?y3(t.subTree):null}const Yh=e=>e.__isSuspense;let Bg=0;const d9={name:"Suspense",__isSuspense:!0,process(e,t,n,o,s,i,r,l,a,c){if(e==null)f9(t,n,o,s,i,r,l,a,c);else{if(i&&i.deps>0&&!e.suspense.isInFallback){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}h9(e,t,n,o,s,r,l,a,c)}},hydrate:p9,normalize:m9},Nwe=d9;function xd(e,t){const n=e.props&&e.props[t];$t(n)&&n()}function f9(e,t,n,o,s,i,r,l,a){const{p:c,o:{createElement:u}}=a,d=u("div"),f=e.suspense=k3(e,s,o,t,d,n,i,r,l,a);c(null,f.pendingBranch=e.ssContent,d,null,o,f,i,r),f.deps>0?(xd(e,"onPending"),xd(e,"onFallback"),c(null,e.ssFallback,t,n,o,null,i,r),Oc(f,e.ssFallback)):f.resolve(!1,!0)}function h9(e,t,n,o,s,i,r,l,{p:a,um:c,o:{createElement:u}}){const d=t.suspense=e.suspense;d.vnode=t,t.el=e.el;const f=t.ssContent,h=t.ssFallback,{activeBranch:p,pendingBranch:g,isInFallback:b,isHydrating:v}=d;if(g)d.pendingBranch=f,Ii(g,f)?(a(g,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0?d.resolve():b&&(v||(a(p,h,n,o,s,null,i,r,l),Oc(d,h)))):(d.pendingId=Bg++,v?(d.isHydrating=!1,d.activeBranch=g):c(g,s,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u("div"),b?(a(null,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0?d.resolve():(a(p,h,n,o,s,null,i,r,l),Oc(d,h))):p&&Ii(p,f)?(a(p,f,n,o,s,d,i,r,l),d.resolve(!0)):(a(null,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0&&d.resolve()));else if(p&&Ii(p,f))a(p,f,n,o,s,d,i,r,l),Oc(d,f);else if(xd(t,"onPending"),d.pendingBranch=f,f.shapeFlag&512?d.pendingId=f.component.suspenseId:d.pendingId=Bg++,a(null,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0)d.resolve();else{const{timeout:m,pendingId:y}=d;m>0?setTimeout(()=>{d.pendingId===y&&d.fallback(h)},m):m===0&&d.fallback(h)}}function k3(e,t,n,o,s,i,r,l,a,c,u=!1){const{p:d,m:f,um:h,n:p,o:{parentNode:g,remove:b}}=c;let v;const m=g9(e);m&&t&&t.pendingBranch&&(v=t.pendingId,t.deps++);const y=e.props?Dh(e.props.timeout):void 0,k=i,A={vnode:e,parent:t,parentComponent:n,namespace:r,container:o,hiddenContainer:s,deps:0,pendingId:Bg++,timeout:typeof y=="number"?y:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve($=!1,I=!1){const{vnode:x,activeBranch:L,pendingBranch:E,pendingId:F,effects:S,parentComponent:N,container:D,isInFallback:B}=A;let U=!1;if(A.isHydrating)A.isHydrating=!1;else if(!$){U=L&&E.transition&&E.transition.mode==="out-in";let Z=!1;U&&(L.transition.afterLeave=()=>{F===A.pendingId&&(f(E,D,i===k&&!Z?p(L):i,0),qh(S),B&&x.ssFallback&&(x.ssFallback.el=null))}),L&&!A.isFallbackMountPending&&(g(L.el)===D&&(i=p(L),Z=!0),h(L,N,A,!0),!U&&B&&x.ssFallback&&vo(()=>x.ssFallback.el=null,A)),U||f(E,D,i,0)}A.isFallbackMountPending=!1,Oc(A,E),A.pendingBranch=null,A.isInFallback=!1;let H=A.parent,P=!1;for(;H;){if(H.pendingBranch){H.effects.push(...S),P=!0;break}H=H.parent}!P&&!U&&qh(S),A.effects=[],m&&t&&t.pendingBranch&&v===t.pendingId&&(t.deps--,t.deps===0&&!I&&t.resolve()),xd(x,"onResolve")},fallback($){if(!A.pendingBranch)return;const{vnode:I,activeBranch:x,parentComponent:L,container:E,namespace:F}=A;xd(I,"onFallback");const S=p(x),N=()=>{A.isFallbackMountPending=!1,A.isInFallback&&(d(null,$,E,S,L,null,F,l,a),Oc(A,$))},D=$.transition&&$.transition.mode==="out-in";D&&(A.isFallbackMountPending=!0,x.transition.afterLeave=N),A.isInFallback=!0,h(x,L,null,!0),D||N()},move($,I,x){A.activeBranch&&f(A.activeBranch,$,I,x),A.container=$},next(){return A.activeBranch&&p(A.activeBranch)},registerDep($,I,x){const L=!!A.pendingBranch;L&&A.deps++;const E=$.vnode.el;$.asyncDep.catch(F=>{su(F,$,0)}).then(F=>{if($.isUnmounted||A.isUnmounted||A.pendingId!==$.suspenseId)return;wd(),$.asyncResolved=!0;const{vnode:S}=$;Dg($,F,!1),E&&(S.el=E);const N=!E&&$.subTree.el;I($,S,g(E||$.subTree.el),E?null:p($.subTree),A,r,x),N&&(S.placeholder=null,b(N)),pm($,S.el),L&&--A.deps===0&&A.resolve()})},unmount($,I){A.isUnmounted=!0,A.activeBranch&&h(A.activeBranch,n,$,I),A.pendingBranch&&h(A.pendingBranch,n,$,I)}};return A}function p9(e,t,n,o,s,i,r,l,a){const c=t.suspense=k3(t,o,n,e.parentNode,document.createElement("div"),null,s,i,r,l,!0),u=a(e,c.pendingBranch=t.ssContent,n,c,i,r);return c.deps===0&&c.resolve(!1,!0),u}function m9(e){const{shapeFlag:t,children:n}=e,o=t&32;e.ssContent=Zb(o?n.default:n),e.ssFallback=o?Zb(n.fallback):re(bo)}function Zb(e){let t;if($t(e)){const n=Ea&&e._c;n&&(e._d=!1,w()),e=e(),n&&(e._d=!0,t=es,x3())}return xt(e)&&(e=XT(e)),e=Ns(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(n=>n!==e)),e}function b3(e,t){t&&t.pendingBranch?xt(e)?t.effects.push(...e):t.effects.push(e):qh(e)}function Oc(e,t){e.activeBranch=t;const{vnode:n,parentComponent:o}=e;let s=t.el;for(;!s&&t.component;)t=t.component.subTree,s=t.el;n.el=s,o&&o.subTree===n&&(o.vnode.el=s,pm(o,s))}function g9(e){const t=e.props&&e.props.suspensible;return t!=null&&t!==!1}const Pe=Symbol.for("v-fgt"),Sl=Symbol.for("v-txt"),bo=Symbol.for("v-cmt"),Rc=Symbol.for("v-stc"),Ju=[];let es=null;function w(e=!1){Ju.push(es=e?null:[])}function x3(){Ju.pop(),es=Ju[Ju.length-1]||null}let Ea=1;function Zh(e,t=!1){Ea+=e,e<0&&es&&t&&(es.hasOnce=!0)}function w3(e){return e.dynamicChildren=Ea>0?es||Nc:null,x3(),Ea>0&&es&&es.push(e),e}function T(e,t,n,o,s,i){return w3(_(e,t,n,o,s,i,!0))}function we(e,t,n,o,s){return w3(re(e,t,n,o,s,!0))}function Nl(e){return e?e.__v_isVNode===!0:!1}function Ii(e,t){return e.type===t.type&&e.key===t.key}function Iwe(e){}const _3=({key:e})=>e??null,vh=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Cn(e)||ho(e)||$t(e)?{i:Ko,r:e,k:t,f:!!n}:e:null);function _(e,t=null,n=null,o=0,s=null,i=e===Pe?0:1,r=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&_3(t),ref:t&&vh(t),scopeId:um,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:o,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:Ko};return l?(My(a,n),i&128&&e.normalize(a)):n&&(a.shapeFlag|=Cn(n)?8:16),Ea>0&&!r&&es&&(a.patchFlag>0||i&6)&&a.patchFlag!==32&&es.push(a),a}const re=v9;function v9(e,t=null,n=null,o=0,s=null,i=!1){if((!e||e===J4)&&(e=bo),Nl(e)){const l=Wr(e,t,!0);return n&&My(l,n),Ea>0&&!i&&es&&(l.shapeFlag&6?es[es.indexOf(e)]=l:es.push(l)),l.patchFlag=-2,l}if(_9(e)&&(e=e.__vccOpts),t){t=y9(t);let{class:l,style:a}=t;l&&!Cn(l)&&(t.class=We(l)),an(a)&&(cm(a)&&!xt(a)&&(a=kn({},a)),t.style=Yt(a))}const r=Cn(e)?1:Yh(e)?128:j4(e)?64:an(e)?4:$t(e)?2:0;return _(e,t,n,o,s,r,i,!0)}function y9(e){return e?cm(e)||c3(e)?kn({},e):e:null}function Wr(e,t,n=!1,o=!1){const{props:s,ref:i,patchFlag:r,children:l,transition:a}=e,c=t?yn(s||{},t):s,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&_3(c),ref:t&&t.ref?n&&i?xt(i)?i.concat(vh(t)):[i,vh(t)]:vh(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&&Wr(e.ssContent),ssFallback:e.ssFallback&&Wr(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&o&&Tl(u,a.clone(u)),u}function Je(e=" ",t=0){return re(Sl,null,e,t)}function Ay(e,t){const n=re(Rc,null,e);return n.staticCount=t,n}function ce(e="",t=!1){return t?(w(),we(bo,null,e)):re(bo,null,e)}function Ns(e){return e==null||typeof e=="boolean"?re(bo):xt(e)?re(Pe,null,e.slice()):Nl(e)?Mr(e):re(Sl,null,String(e))}function Mr(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Wr(e)}function My(e,t){let n=0;const{shapeFlag:o}=e;if(t==null)t=null;else if(xt(t))n=16;else if(typeof t=="object")if(o&65){const s=t.default;s&&(s._c&&(s._d=!1),My(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!c3(t)?t._ctx=Ko:s===3&&Ko&&(Ko.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else $t(t)?(t={default:t,_ctx:Ko},n=32):(t=String(t),o&64?(n=16,t=[Je(t)]):n=8);e.children=t,e.shapeFlag|=n}function yn(...e){const t={};for(let n=0;n<e.length;n++){const o=e[n];for(const s in o)if(s==="class")t.class!==o.class&&(t.class=We([t.class,o.class]));else if(s==="style")t.style=Yt([t.style,o.style]);else if(zd(s)){const i=t[s],r=o[s];r&&i!==r&&!(xt(i)&&i.includes(r))?t[s]=i?[].concat(i,r):r:r==null&&i==null&&!Qp(s)&&(t[s]=r)}else s!==""&&(t[s]=o[s])}return t}function Es(e,t,n,o=null){wi(e,t,7,[n,o])}const k9=o3();let b9=0;function S3(e,t,n){const o=e.type,s=(t?t.appContext:e.appContext)||k9,i={uid:b9++,vnode:e,type:o,parent:t,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new y4(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(s.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:d3(o,s),emitsOptions:i3(o,s),emit:null,emitted:null,propsDefaults:Qt,inheritAttrs:o.inheritAttrs,ctx:Qt,data:Qt,props:Qt,attrs:Qt,slots:Qt,refs:Qt,setupState:Qt,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return i.ctx={_:i},i.root=t?t.root:i,i.emit=ZT.bind(null,i),e.ce&&e.ce(i),i}let Vo=null;const Yo=()=>Vo||Ko;let Qh,Bc;{const e=om(),t=(n,o)=>{let s;return(s=e[n])||(s=e[n]=[]),s.push(o),i=>{s.length>1?s.forEach(r=>r(i)):s[0](i)}};Qh=t("__VUE_INSTANCE_SETTERS__",n=>Vo=n),Bc=t("__VUE_SSR_SETTERS__",n=>Ta=n)}const iu=e=>{const t=Vo;return Qh(e),e.scope.on(),()=>{e.scope.off(),Qh(t)}},wd=()=>{Vo&&Vo.scope.off(),Qh(null)};function C3(e){return e.vnode.shapeFlag&4}let Ta=!1;function A3(e,t=!1,n=!1){t&&Bc(t);const{props:o,children:s}=e.vnode,i=C3(e);n9(e,o,i,t),r9(e,s,n||t);const r=i?x9(e,t):void 0;return t&&Bc(!1),r}function x9(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,$g);const{setup:o}=n;if(o){Dr();const s=e.setupContext=o.length>1?E3(e):null,i=iu(e),r=Ud(o,e,0,[e.props,s]),l=cy(r);if(Pr(),i(),(l||e.sp)&&!Or(e)&&vy(e),l){if(r.then(wd,wd),t)return r.then(a=>{Dg(e,a,t)}).catch(a=>{su(a,e,0)});e.asyncDep=r}else Dg(e,r,t)}else M3(e,t)}function Dg(e,t,n){$t(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:an(t)&&(e.setupState=R4(t)),M3(e,n)}let Xh,Pg;function Lwe(e){Xh=e,Pg=t=>{t.render._rc&&(t.withProxy=new Proxy(t.ctx,zT))}}const $we=()=>!Xh;function M3(e,t,n){const o=e.type;if(!e.render){if(!t&&Xh&&!o.render){const s=o.template||wy(e).template;if(s){const{isCustomElement:i,compilerOptions:r}=e.appContext.config,{delimiters:l,compilerOptions:a}=o,c=kn(kn({isCustomElement:i,delimiters:l},r),a);o.render=Xh(s,c)}}e.render=o.render||ki,Pg&&Pg(e)}{const s=iu(e);Dr();try{UT(e)}finally{Pr(),s()}}}const w9={get(e,t){return Jo(e,"get",""),e[t]}};function E3(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,w9),slots:e.slots,emit:e.emit,expose:t}}function Kd(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(R4(pt(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Xu)return Xu[n](e)},has(t,n){return n in t||n in Xu}})):e.proxy}function Hg(e,t=!0){return $t(e)?e.displayName||e.name:e.name||t&&e.__name}function _9(e){return $t(e)&&"__vccOpts"in e}const R=(e,t)=>iT(e,t,Ta);function mn(e,t,n){try{Zh(-1);const o=arguments.length;return o===2?an(t)&&!xt(t)?Nl(t)?re(e,null,[t]):re(e,t):re(e,null,t):(o>3?n=Array.prototype.slice.call(arguments,2):o===3&&Nl(n)&&(n=[n]),re(e,t,n))}finally{Zh(1)}}function Fwe(){}function Owe(e,t,n,o){const s=n[o];if(s&&S9(s,e))return s;const i=t();return i.memo=e.slice(),i.cacheIndex=o,n[o]=i}function S9(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let o=0;o<n.length;o++)if(qo(n[o],t[o]))return!1;return Ea>0&&es&&es.push(e),!0}const C9="3.5.35",Rwe=ki,Bwe=uT,Dwe=mc,Pwe=z4,A9={createComponentInstance:S3,setupComponent:A3,renderComponentRoot:gh,setCurrentRenderingInstance:yd,isVNode:Nl,normalizeVNode:Ns,getComponentPublicInstance:Kd,ensureValidVNode:xy,pushWarningContext:aT,popWarningContext:cT},Hwe=A9,Wwe=null,zwe=null,Uwe=null;/**
17
+ * @vue/runtime-dom v3.5.35
18
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
19
+ * @license MIT
20
+ **/let Wg;const Qb=typeof window<"u"&&window.trustedTypes;if(Qb)try{Wg=Qb.createPolicy("vue",{createHTML:e=>e})}catch{}const T3=Wg?e=>Wg.createHTML(e):e=>e,M9="http://www.w3.org/2000/svg",E9="http://www.w3.org/1998/Math/MathML",wr=typeof document<"u"?document:null,Xb=wr&&wr.createElement("template"),T9={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,o)=>{const s=t==="svg"?wr.createElementNS(M9,e):t==="mathml"?wr.createElementNS(E9,e):n?wr.createElement(e,{is:n}):wr.createElement(e);return e==="select"&&o&&o.multiple!=null&&s.setAttribute("multiple",o.multiple),s},createText:e=>wr.createTextNode(e),createComment:e=>wr.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>wr.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,o,s,i){const r=n?n.previousSibling:t.lastChild;if(s&&(s===i||s.nextSibling))for(;t.insertBefore(s.cloneNode(!0),n),!(s===i||!(s=s.nextSibling)););else{Xb.innerHTML=T3(o==="svg"?`<svg>${e}</svg>`:o==="mathml"?`<math>${e}</math>`:e);const l=Xb.content;if(o==="svg"||o==="mathml"){const a=l.firstChild;for(;a.firstChild;)l.appendChild(a.firstChild);l.removeChild(a)}t.insertBefore(l,n)}return[r?r.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},tl="transition",Iu="animation",Yc=Symbol("_vtc"),N3={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},I3=kn({},K4,N3),N9=e=>(e.displayName="Transition",e.props=I3,e),Il=N9((e,{slots:t})=>mn(wT,L3(e),t)),oa=(e,t=[])=>{xt(e)?e.forEach(n=>n(...t)):e&&e(...t)},Jb=e=>e?xt(e)?e.some(t=>t.length>1):e.length>1:!1;function L3(e){const t={};for(const S in e)S in N3||(t[S]=e[S]);if(e.css===!1)return t;const{name:n="v",type:o,duration:s,enterFromClass:i=`${n}-enter-from`,enterActiveClass:r=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:a=i,appearActiveClass:c=r,appearToClass:u=l,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:h=`${n}-leave-to`}=e,p=I9(s),g=p&&p[0],b=p&&p[1],{onBeforeEnter:v,onEnter:m,onEnterCancelled:y,onLeave:k,onLeaveCancelled:A,onBeforeAppear:$=v,onAppear:I=m,onAppearCancelled:x=y}=t,L=(S,N,D,B)=>{S._enterCancelled=B,dl(S,N?u:l),dl(S,N?c:r),D&&D()},E=(S,N)=>{S._isLeaving=!1,dl(S,d),dl(S,h),dl(S,f),N&&N()},F=S=>(N,D)=>{const B=S?I:m,U=()=>L(N,S,D);oa(B,[N,U]),ex(()=>{dl(N,S?a:i),Zi(N,S?u:l),Jb(B)||tx(N,o,g,U)})};return kn(t,{onBeforeEnter(S){oa(v,[S]),Zi(S,i),Zi(S,r)},onBeforeAppear(S){oa($,[S]),Zi(S,a),Zi(S,c)},onEnter:F(!1),onAppear:F(!0),onLeave(S,N){S._isLeaving=!0;const D=()=>E(S,N);Zi(S,d),S._enterCancelled?(Zi(S,f),zg(S)):(zg(S),Zi(S,f)),ex(()=>{S._isLeaving&&(dl(S,d),Zi(S,h),Jb(k)||tx(S,o,b,D))}),oa(k,[S,D])},onEnterCancelled(S){L(S,!1,void 0,!0),oa(y,[S])},onAppearCancelled(S){L(S,!0,void 0,!0),oa(x,[S])},onLeaveCancelled(S){E(S),oa(A,[S])}})}function I9(e){if(e==null)return null;if(an(e))return[o0(e.enter),o0(e.leave)];{const t=o0(e);return[t,t]}}function o0(e){return Dh(e)}function Zi(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Yc]||(e[Yc]=new Set)).add(t)}function dl(e,t){t.split(/\s+/).forEach(o=>o&&e.classList.remove(o));const n=e[Yc];n&&(n.delete(t),n.size||(e[Yc]=void 0))}function ex(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let L9=0;function tx(e,t,n,o){const s=e._endId=++L9,i=()=>{s===e._endId&&o()};if(n!=null)return setTimeout(i,n);const{type:r,timeout:l,propCount:a}=$3(e,t);if(!r)return o();const c=r+"end";let u=0;const d=()=>{e.removeEventListener(c,f),i()},f=h=>{h.target===e&&++u>=a&&d()};setTimeout(()=>{u<a&&d()},l+1),e.addEventListener(c,f)}function $3(e,t){const n=window.getComputedStyle(e),o=p=>(n[p]||"").split(", "),s=o(`${tl}Delay`),i=o(`${tl}Duration`),r=nx(s,i),l=o(`${Iu}Delay`),a=o(`${Iu}Duration`),c=nx(l,a);let u=null,d=0,f=0;t===tl?r>0&&(u=tl,d=r,f=i.length):t===Iu?c>0&&(u=Iu,d=c,f=a.length):(d=Math.max(r,c),u=d>0?r>c?tl:Iu:null,f=u?u===tl?i.length:a.length:0);const h=u===tl&&/\b(?:transform|all)(?:,|$)/.test(o(`${tl}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:h}}function nx(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,o)=>ox(n)+ox(e[o])))}function ox(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function zg(e){return(e?e.ownerDocument:document).body.offsetHeight}function $9(e,t,n){const o=e[Yc];o&&(t=(t?[t,...o]:[...o]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Jh=Symbol("_vod"),F3=Symbol("_vsh"),mi={name:"show",beforeMount(e,{value:t},{transition:n}){e[Jh]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):Lu(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:o}){!t!=!n&&(o?t?(o.beforeEnter(e),Lu(e,!0),o.enter(e)):o.leave(e,()=>{Lu(e,!1)}):Lu(e,t))},beforeUnmount(e,{value:t}){Lu(e,t)}};function Lu(e,t){e.style.display=t?e[Jh]:"none",e[F3]=!t}function F9(){mi.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}}}const O3=Symbol("");function qwe(e){const t=Yo();if(!t)return;const n=t.ut=(s=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(i=>ep(i,s))},o=()=>{const s=e(t.proxy);t.ce?ep(t.ce,s):Ug(t.subTree,s),n(s)};X4(()=>{qh(o)}),cn(()=>{Qe(o,ki,{flush:"post"});const s=new MutationObserver(o);s.observe(t.subTree.el.parentNode,{childList:!0}),bn(()=>s.disconnect())})}function Ug(e,t){if(e.shapeFlag&128){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{Ug(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)ep(e.el,t);else if(e.type===Pe)e.children.forEach(n=>Ug(n,t));else if(e.type===Rc){let{el:n,anchor:o}=e;for(;n&&(ep(n,t),n!==o);)n=n.nextSibling}}function ep(e,t){if(e.nodeType===1){const n=e.style;let o="";for(const s in t){const i=IE(t[s]);n.setProperty(`--${s}`,i),o+=`--${s}: ${i};`}n[O3]=o}}const O9=/(?:^|;)\s*display\s*:/;function R9(e,t,n){const o=e.style,s=Cn(n);let i=!1;if(n&&!s){if(t)if(Cn(t))for(const r of t.split(";")){const l=r.slice(0,r.indexOf(":")).trim();n[l]==null&&Uu(o,l,"")}else for(const r in t)n[r]==null&&Uu(o,r,"");for(const r in n){r==="display"&&(i=!0);const l=n[r];l!=null?D9(e,r,!Cn(t)&&t?t[r]:void 0,l)||Uu(o,r,l):Uu(o,r,"")}}else if(s){if(t!==n){const r=o[O3];r&&(n+=";"+r),o.cssText=n,i=O9.test(n)}}else t&&e.removeAttribute("style");Jh in e&&(e[Jh]=i?o.display:"",e[F3]&&(o.display="none"))}const sx=/\s*!important$/;function Uu(e,t,n){if(xt(n))n.forEach(o=>Uu(e,t,o));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const o=B9(e,t);sx.test(n)?e.setProperty(Is(o),n.replace(sx,""),"important"):e[o]=n}}const ix=["Webkit","Moz","ms"],s0={};function B9(e,t){const n=s0[t];if(n)return n;let o=No(t);if(o!=="filter"&&o in e)return s0[t]=o;o=tm(o);for(let s=0;s<ix.length;s++){const i=ix[s]+o;if(i in e)return s0[t]=i}return t}function D9(e,t,n,o){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&Cn(o)&&n===o}const rx="http://www.w3.org/1999/xlink";function lx(e,t,n,o,s,i=TE(t)){o&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(rx,t.slice(6,t.length)):e.setAttributeNS(rx,t,n):n==null||i&&!m4(n)?e.removeAttribute(t):e.setAttribute(t,i?"":Js(n)?String(n):n)}function ax(e,t,n,o,s){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?T3(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=m4(n):n==null&&l==="string"?(n="",r=!0):l==="number"&&(n=0,r=!0)}try{e[t]=n}catch{}r&&e.removeAttribute(s||t)}function Ir(e,t,n,o){e.addEventListener(t,n,o)}function P9(e,t,n,o){e.removeEventListener(t,n,o)}const cx=Symbol("_vei");function H9(e,t,n,o,s=null){const i=e[cx]||(e[cx]={}),r=i[t];if(o&&r)r.value=o;else{const[l,a]=W9(t);if(o){const c=i[t]=q9(o,s);Ir(e,l,c,a)}else r&&(P9(e,l,r,a),i[t]=void 0)}}const ux=/(?:Once|Passive|Capture)$/;function W9(e){let t;if(ux.test(e)){t={};let o;for(;o=e.match(ux);)e=e.slice(0,e.length-o[0].length),t[o[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Is(e.slice(2)),t]}let i0=0;const z9=Promise.resolve(),U9=()=>i0||(z9.then(()=>i0=0),i0=Date.now());function q9(e,t){const n=o=>{if(!o._vts)o._vts=Date.now();else if(o._vts<=n.attached)return;const s=n.value;if(xt(s)){const i=o.stopImmediatePropagation;o.stopImmediatePropagation=()=>{i.call(o),o._stopped=!0};const r=s.slice(),l=[o];for(let a=0;a<r.length&&!o._stopped;a++){const c=r[a];c&&wi(c,t,5,l)}}else wi(s,t,5,[o])};return n.value=e,n.attached=U9(),n}const dx=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,j9=(e,t,n,o,s,i)=>{const r=s==="svg";t==="class"?$9(e,o,r):t==="style"?R9(e,n,o):zd(t)?Qp(t)||H9(e,t,n,o,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):V9(e,t,o,r))?(ax(e,t,o),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&lx(e,t,o,r,i,t!=="value")):e._isVueCE&&(K9(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Cn(o)))?ax(e,No(t),o,i,t):(t==="true-value"?e._trueValue=o:t==="false-value"&&(e._falseValue=o),lx(e,t,o,r))};function V9(e,t,n,o){if(o)return!!(t==="innerHTML"||t==="textContent"||t in e&&dx(t)&&$t(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const s=e.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return dx(t)&&Cn(n)?!1:t in e}function K9(e,t){const n=e._def.props;if(!n)return!1;const o=No(t);return Array.isArray(n)?n.some(s=>No(s)===o):Object.keys(n).some(s=>No(s)===o)}const fx={};function G9(e,t,n){let o=Ze(e,t);Xp(o)&&(o=kn({},o,t));class s extends Ey{constructor(r){super(o,r,n)}}return s.def=o,s}const jwe=((e,t)=>G9(e,t,dN)),Y9=typeof HTMLElement<"u"?HTMLElement:class{};class Ey extends Y9{constructor(t,n={},o=op){super(),this._def=t,this._props=n,this._createApp=o,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._patching=!1,this._dirty=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._styleAnchors=new WeakMap,this._ob=null,this.shadowRoot&&o!==op?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow(kn({},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 Ey){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 o=0;o<this.attributes.length;o++)this._setAttr(this.attributes[o].name);this._ob=new MutationObserver(this._processMutations.bind(this)),this._ob.observe(this,{attributes:!0});const t=(o,s=!1)=>{this._resolved=!0,this._pendingResolve=void 0;const{props:i,styles:r}=o;let l;if(i&&!xt(i))for(const a in i){const c=i[a];(c===Number||c&&c.type===Number)&&(a in this._props&&(this._props[a]=Dh(this._props[a])),(l||(l=Object.create(null)))[No(a)]=!0)}this._numberProps=l,this._resolveProps(o),this.shadowRoot&&this._applyStyles(r),this._mount(o)},n=this._def.__asyncLoader;n?this._pendingResolve=n().then(o=>{o.configureApp=this._def.configureApp,t(this._def=o,!0)}):t(this._def)}_mount(t){this._app=this._createApp(t),this._inheritParentContext(),t.configureApp&&t.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const n=this._instance&&this._instance.exposed;if(n)for(const o in n)ln(this,o)||Object.defineProperty(this,o,{get:()=>C(n[o])})}_resolveProps(t){const{props:n}=t,o=xt(n)?n:Object.keys(n||{});for(const s of Object.keys(this))s[0]!=="_"&&o.includes(s)&&this._setProp(s,this[s]);for(const s of o.map(No))Object.defineProperty(this,s,{get(){return this._getProp(s)},set(i){this._setProp(s,i,!0,!this._patching)}})}_setAttr(t){if(t.startsWith("data-v-"))return;const n=this.hasAttribute(t);let o=n?this.getAttribute(t):fx;const s=No(t);n&&this._numberProps&&this._numberProps[s]&&(o=Dh(o)),this._setProp(s,o,!1,!0)}_getProp(t){return this._props[t]}_setProp(t,n,o=!0,s=!1){if(n!==this._props[t]&&(this._dirty=!0,n===fx?delete this._props[t]:(this._props[t]=n,t==="key"&&this._app&&(this._app._ceVNode.key=n)),s&&this._instance&&this._update(),o)){const i=this._ob;i&&(this._processMutations(i.takeRecords()),i.disconnect()),n===!0?this.setAttribute(Is(t),""):typeof n=="string"||typeof n=="number"?this.setAttribute(Is(t),n+""):n||this.removeAttribute(Is(t)),i&&i.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),uN(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const n=re(this._def,kn(t,this._props));return this._instance||(n.ce=o=>{this._instance=o,o.ce=this,o.isCE=!0;const s=(i,r)=>{this.dispatchEvent(new CustomEvent(i,Xp(r[0])?kn({detail:r},r[0]):{detail:r}))};o.emit=(i,...r)=>{s(i,r),Is(i)!==i&&s(Is(i),r)},this._setParent()}),n}_applyStyles(t,n,o){if(!t)return;if(n){if(n===this._def||this._styleChildren.has(n))return;this._styleChildren.add(n)}const s=this._nonce,i=this.shadowRoot,r=o?this._getStyleAnchor(o)||this._getStyleAnchor(this._def):this._getRootStyleInsertionAnchor(i);let l=null;for(let a=t.length-1;a>=0;a--){const c=document.createElement("style");s&&c.setAttribute("nonce",s),c.textContent=t[a],i.insertBefore(c,l||r),l=c,a===0&&(o||this._styleAnchors.set(this._def,c),n&&this._styleAnchors.set(n,c))}}_getStyleAnchor(t){if(!t)return null;const n=this._styleAnchors.get(t);return n&&n.parentNode===this.shadowRoot?n:(n&&this._styleAnchors.delete(t),null)}_getRootStyleInsertionAnchor(t){for(let n=0;n<t.childNodes.length;n++){const o=t.childNodes[n];if(!(o instanceof HTMLStyleElement))return o}return null}_parseSlots(){const t=this._slots={};let n;for(;n=this.firstChild;){const o=n.nodeType===1&&n.getAttribute("slot")||"default";(t[o]||(t[o]=[])).push(n),this.removeChild(n)}}_renderSlots(){const t=this._getSlots(),n=this._instance.type.__scopeId;for(let o=0;o<t.length;o++){const s=t[o],i=s.getAttribute("name")||"default",r=this._slots[i],l=s.parentNode;if(r)for(const a of r){if(n&&a.nodeType===1){const c=n+"-s",u=document.createTreeWalker(a,1);a.setAttribute(c,"");let d;for(;d=u.nextNode();)d.setAttribute(c,"")}l.insertBefore(a,s)}else for(;s.firstChild;)l.insertBefore(s.firstChild,s);l.removeChild(s)}}_getSlots(){const t=[this];this._teleportTargets&&t.push(...this._teleportTargets);const n=new Set;for(const o of t){const s=o.querySelectorAll("slot");for(let i=0;i<s.length;i++)n.add(s[i])}return Array.from(n)}_injectChildStyle(t,n){this._applyStyles(t.styles,t,n)}_beginPatch(){this._patching=!0,this._dirty=!1}_endPatch(){this._patching=!1,this._dirty&&this._instance&&this._update()}_hasShadowRoot(){return this._def.shadowRoot!==!1}_removeChildStyle(t){}}function Z9(e){const t=Yo(),n=t&&t.ce;return n||null}function Vwe(){const e=Z9();return e&&e.shadowRoot}function Kwe(e="$style"){{const t=Yo();if(!t)return Qt;const n=t.type.__cssModules;if(!n)return Qt;const o=n[e];return o||Qt}}const R3=new WeakMap,B3=new WeakMap,tp=Symbol("_moveCb"),hx=Symbol("_enterCb"),Q9=e=>(delete e.props.mode,e),X9=Q9({name:"TransitionGroup",props:kn({},I3,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=Yo(),o=V4();let s,i;return yy(()=>{if(!s.length)return;const r=e.moveClass||`${e.name||"v"}-move`;if(!oN(s[0].el,n.vnode.el,r)){s=[];return}s.forEach(eN),s.forEach(tN);const l=s.filter(nN);zg(n.vnode.el),l.forEach(a=>{const c=a.el,u=c.style;Zi(c,r),u.transform=u.webkitTransform=u.transitionDuration="";const d=c[tp]=f=>{f&&f.target!==c||(!f||f.propertyName.endsWith("transform"))&&(c.removeEventListener("transitionend",d),c[tp]=null,dl(c,r))};c.addEventListener("transitionend",d)}),s=[]}),()=>{const r=en(e),l=L3(r);let a=r.tag||Pe;if(s=[],i)for(let c=0;c<i.length;c++){const u=i[c];u.el&&u.el instanceof Element&&(s.push(u),Tl(u,kd(u,l,o,n)),R3.set(u,D3(u.el)))}i=t.default?gy(t.default()):[];for(let c=0;c<i.length;c++){const u=i[c];u.key!=null&&Tl(u,kd(u,l,o,n))}return re(a,null,i)}}}),J9=X9;function eN(e){const t=e.el;t[tp]&&t[tp](),t[hx]&&t[hx]()}function tN(e){B3.set(e,D3(e.el))}function nN(e){const t=R3.get(e),n=B3.get(e),o=t.left-n.left,s=t.top-n.top;if(o||s){const i=e.el,r=i.style,l=i.getBoundingClientRect();let a=1,c=1;return i.offsetWidth&&(a=l.width/i.offsetWidth),i.offsetHeight&&(c=l.height/i.offsetHeight),(!Number.isFinite(a)||a===0)&&(a=1),(!Number.isFinite(c)||c===0)&&(c=1),Math.abs(a-1)<.01&&(a=1),Math.abs(c-1)<.01&&(c=1),r.transform=r.webkitTransform=`translate(${o/a}px,${s/c}px)`,r.transitionDuration="0s",e}}function D3(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top}}function oN(e,t,n){const o=e.cloneNode(),s=e[Yc];s&&s.forEach(l=>{l.split(/\s+/).forEach(a=>a&&o.classList.remove(a))}),n.split(/\s+/).forEach(l=>l&&o.classList.add(l)),o.style.display="none";const i=t.nodeType===1?t:t.parentNode;i.appendChild(o);const{hasTransform:r}=$3(o);return i.removeChild(o),r}const Ll=e=>{const t=e.props["onUpdate:modelValue"]||!1;return xt(t)?n=>Lc(t,n):t};function sN(e){e.target.composing=!0}function px(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const bi=Symbol("_assign");function mx(e,t,n){return t&&(e=e.trim()),n&&(e=nm(e)),e}const _s={created(e,{modifiers:{lazy:t,trim:n,number:o}},s){e[bi]=Ll(s);const i=o||s.props&&s.props.type==="number";Ir(e,t?"change":"input",r=>{r.target.composing||e[bi](mx(e.value,n,i))}),(n||i)&&Ir(e,"change",()=>{e.value=mx(e.value,n,i)}),t||(Ir(e,"compositionstart",sN),Ir(e,"compositionend",px),Ir(e,"change",px))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:o,trim:s,number:i}},r){if(e[bi]=Ll(r),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?nm(e.value):e.value,a=t??"";if(l===a)return;const c=e.getRootNode();(c instanceof Document||c instanceof ShadowRoot)&&c.activeElement===e&&e.type!=="range"&&(o&&t===n||s&&e.value.trim()===a)||(e.value=a)}},np={deep:!0,created(e,t,n){e[bi]=Ll(n),Ir(e,"change",()=>{const o=e._modelValue,s=Zc(e),i=e.checked,r=e[bi];if(xt(o)){const l=sm(o,s),a=l!==-1;if(i&&!a)r(o.concat(s));else if(!i&&a){const c=[...o];c.splice(l,1),r(c)}}else if(Ra(o)){const l=new Set(o);i?l.add(s):l.delete(s),r(l)}else r(H3(e,i))})},mounted:gx,beforeUpdate(e,t,n){e[bi]=Ll(n),gx(e,t,n)}};function gx(e,{value:t,oldValue:n},o){e._modelValue=t;let s;if(xt(t))s=sm(t,o.props.value)>-1;else if(Ra(t))s=t.has(o.props.value);else{if(t===n)return;s=Br(t,H3(e,!0))}e.checked!==s&&(e.checked=s)}const P3={created(e,{value:t},n){e.checked=Br(t,n.props.value),e[bi]=Ll(n),Ir(e,"change",()=>{e[bi](Zc(e))})},beforeUpdate(e,{value:t,oldValue:n},o){e[bi]=Ll(o),t!==n&&(e.checked=Br(t,o.props.value))}},qg={deep:!0,created(e,{value:t,modifiers:{number:n}},o){const s=Ra(t);Ir(e,"change",()=>{const i=Array.prototype.filter.call(e.options,r=>r.selected).map(r=>n?nm(Zc(r)):Zc(r));e[bi](e.multiple?s?new Set(i):i:i[0]),e._assigning=!0,mt(()=>{e._assigning=!1})}),e[bi]=Ll(o)},mounted(e,{value:t}){vx(e,t)},beforeUpdate(e,t,n){e[bi]=Ll(n)},updated(e,{value:t}){e._assigning||vx(e,t)}};function vx(e,t){const n=e.multiple,o=xt(t);if(!(n&&!o&&!Ra(t))){for(let s=0,i=e.options.length;s<i;s++){const r=e.options[s],l=Zc(r);if(n)if(o){const a=typeof l;a==="string"||a==="number"?r.selected=t.some(c=>String(c)===String(l)):r.selected=sm(t,l)>-1}else r.selected=t.has(l);else if(Br(Zc(r),t)){e.selectedIndex!==s&&(e.selectedIndex=s);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Zc(e){return"_value"in e?e._value:e.value}function H3(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const iN={created(e,t,n){Df(e,t,n,null,"created")},mounted(e,t,n){Df(e,t,n,null,"mounted")},beforeUpdate(e,t,n,o){Df(e,t,n,o,"beforeUpdate")},updated(e,t,n,o){Df(e,t,n,o,"updated")}};function W3(e,t){switch(e){case"SELECT":return qg;case"TEXTAREA":return _s;default:switch(t){case"checkbox":return np;case"radio":return P3;default:return _s}}}function Df(e,t,n,o,s){const r=W3(e.tagName,n.props&&n.props.type)[s];r&&r(e,t,n,o)}function rN(){_s.getSSRProps=({value:e})=>({value:e}),P3.getSSRProps=({value:e},t)=>{if(t.props&&Br(t.props.value,e))return{checked:!0}},np.getSSRProps=({value:e},t)=>{if(xt(e)){if(t.props&&sm(e,t.props.value)>-1)return{checked:!0}}else if(Ra(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},iN.getSSRProps=(e,t)=>{if(typeof t.type!="string")return;const n=W3(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}const lN=["ctrl","shift","alt","meta"],aN={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)=>lN.some(n=>e[`${n}Key`]&&!t.includes(n))},bt=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),o=t.join(".");return n[o]||(n[o]=((s,...i)=>{for(let r=0;r<t.length;r++){const l=aN[t[r]];if(l&&l(s,t))return}return e(s,...i)}))},cN={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},nr=(e,t)=>{const n=e._withKeys||(e._withKeys={}),o=t.join(".");return n[o]||(n[o]=(s=>{if(!("key"in s))return;const i=Is(s.key);if(t.some(r=>r===i||cN[r]===i))return e(s)}))},z3=kn({patchProp:j9},T9);let ed,yx=!1;function U3(){return ed||(ed=a9(z3))}function q3(){return ed=yx?ed:c9(z3),yx=!0,ed}const uN=((...e)=>{U3().render(...e)}),Gwe=((...e)=>{q3().hydrate(...e)}),op=((...e)=>{const t=U3().createApp(...e),{mount:n}=t;return t.mount=o=>{const s=V3(o);if(!s)return;const i=t._component;!$t(i)&&!i.render&&!i.template&&(i.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const r=n(s,!1,j3(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),r},t}),dN=((...e)=>{const t=q3().createApp(...e),{mount:n}=t;return t.mount=o=>{const s=V3(o);if(s)return n(s,!0,j3(s))},t});function j3(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function V3(e){return Cn(e)?document.querySelector(e):e}let kx=!1;const Ywe=()=>{kx||(kx=!0,rN(),F9())};/*!
21
+ * shared v11.4.5
22
+ * (c) 2026 kazuya kawaguchi
23
+ * Released under the MIT License.
24
+ */function fN(e,t){typeof console<"u"&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const sp=typeof window<"u",Bl=(e,t=!1)=>t?Symbol.for(e):Symbol(e),hN=(e,t,n)=>pN({l:e,k:t,s:n}),pN=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),wo=e=>typeof e=="number"&&isFinite(e),K3=e=>Ny(e)==="[object Date]",Qc=e=>Ny(e)==="[object RegExp]",mm=e=>Jt(e)&&Object.keys(e).length===0,_o=Object.assign,mN=Object.create,Sn=(e=null)=>mN(e);let bx;const ya=()=>bx||(bx=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:Sn());function xx(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 gN(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 vN=/^\s*javascript\s*(?::|&#0*58;?|&#x0*3a;?|&colon;?)/i,yN=/^(?:href|src|action|formaction)$/i;function Ty(e){return vN.test(e)}function kN(e){const t=/url\s*\(/gi;let n="",o=0,s;for(;(s=t.exec(e))!==null;){const i=s.index,r=t.lastIndex-1;let l=r+1,a=1,c=null;for(;l<e.length;l++){const 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(o,i),n+=Ty(d)?"url(about:blank)":e.slice(i,l+1),o=l+1}return n+e.slice(o)}function wx(e,t){if(yN.test(e)&&Ty(t))return"about:blank";const n=e.toLowerCase()==="style"?kN(t):t;return gN(n)}function bN(e){return e=e.replace(/([\w:-]+)\s*=\s*"([^"]*)"/g,(n,o,s)=>`${o}="${wx(o,s)}"`),e=e.replace(/([\w:-]+)\s*=\s*'([^']*)'/g,(n,o,s)=>`${o}='${wx(o,s)}'`),/\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,o,s)=>Ty(s)?`${o}about:blank`:n),e}const xN=Object.prototype.hasOwnProperty;function yi(e,t){return xN.call(e,t)}const io=Array.isArray,Kn=e=>typeof e=="function",yt=e=>typeof e=="string",nn=e=>typeof e=="boolean",on=e=>e!==null&&typeof e=="object",wN=e=>on(e)&&Kn(e.then)&&Kn(e.catch),G3=Object.prototype.toString,Ny=e=>G3.call(e),Jt=e=>Ny(e)==="[object Object]",_N=e=>e==null?"":io(e)||Jt(e)&&e.toString===G3?JSON.stringify(e,null,2):String(e);function Iy(e,t=""){return e.reduce((n,o,s)=>s===0?n+o:n+t+o,"")}const Pf=e=>!on(e)||io(e);function yh(e,t){if(Pf(e)||Pf(t))throw new Error("Invalid value");const n=[{src:e,des:t}];for(;n.length;){const{src:o,des:s}=n.pop();Object.keys(o).forEach(i=>{i!=="__proto__"&&(on(o[i])&&!on(s[i])&&(s[i]=Array.isArray(o[i])?[]:Sn()),Pf(s[i])||Pf(o[i])?s[i]=o[i]:n.push({src:o[i],des:s[i]}))})}}/*!
25
+ * message-compiler v11.4.5
26
+ * (c) 2026 kazuya kawaguchi
27
+ * Released under the MIT License.
28
+ */function SN(e,t,n){return{line:e,column:t,offset:n}}function jg(e,t,n){return{start:e,end:t}}const hn={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},CN=17;function gm(e,t,n={}){const{domain:o,messages:s,args:i}=n,r=e,l=new SyntaxError(String(r));return l.code=e,t&&(l.location=t),l.domain=o,l}function AN(e){throw e}const Ki=" ",MN="\r",Qo=`
29
+ `,EN="\u2028",TN="\u2029";function NN(e){const t=e;let n=0,o=1,s=1,i=0;const r=I=>t[I]===MN&&t[I+1]===Qo,l=I=>t[I]===Qo,a=I=>t[I]===TN,c=I=>t[I]===EN,u=I=>r(I)||l(I)||a(I)||c(I),d=()=>n,f=()=>o,h=()=>s,p=()=>i,g=I=>r(I)||a(I)||c(I)?Qo:t[I],b=()=>g(n),v=()=>g(n+i);function m(){return i=0,u(n)&&(o++,s=0),r(n)&&n++,n++,s++,t[n]}function y(){return r(n+i)&&i++,i++,t[n+i]}function k(){n=0,o=1,s=1,i=0}function A(I=0){i=I}function $(){const I=n+i;for(;I!==n;)m();i=0}return{index:d,line:f,column:h,peekOffset:p,charAt:g,currentChar:b,currentPeek:v,next:m,peek:y,reset:k,resetPeek:A,skipToPeek:$}}const vr=void 0,IN=".",_x="'",LN="tokenizer";function $N(e,t={}){const n=t.location!==!1,o=NN(e),s=()=>o.index(),i=()=>SN(o.line(),o.column(),o.index()),r=i(),l=s(),a={currentType:13,offset:l,startLoc:r,endLoc:r,lastType:13,lastOffset:l,lastStartLoc:r,lastEndLoc:r,braceNest:0,inLinked:!1,text:""},c=()=>a,{onError:u}=t;function d(j,te,me,...Ae){const $e=c();if(te.column+=me,te.offset+=me,u){const De=n?jg($e.startLoc,te):null,ge=gm(j,De,{domain:LN,args:Ae});u(ge)}}function f(j,te,me){j.endLoc=i(),j.currentType=te;const Ae={type:te};return n&&(Ae.loc=jg(j.startLoc,j.endLoc)),me!=null&&(Ae.value=me),Ae}const h=j=>f(j,13);function p(j,te){return j.currentChar()===te?(j.next(),te):(d(hn.EXPECTED_TOKEN,i(),0,te),"")}function g(j){let te="";for(;j.currentPeek()===Ki||j.currentPeek()===Qo;)te+=j.currentPeek(),j.peek();return te}function b(j){const te=g(j);return j.skipToPeek(),te}function v(j){if(j===vr)return!1;const te=j.charCodeAt(0);return te>=97&&te<=122||te>=65&&te<=90||te===95}function m(j){if(j===vr)return!1;const te=j.charCodeAt(0);return te>=48&&te<=57}function y(j,te){const{currentType:me}=te;if(me!==2)return!1;g(j);const Ae=v(j.currentPeek());return j.resetPeek(),Ae}function k(j,te){const{currentType:me}=te;if(me!==2)return!1;g(j);const Ae=j.currentPeek()==="-"?j.peek():j.currentPeek(),$e=m(Ae);return j.resetPeek(),$e}function A(j,te){const{currentType:me}=te;if(me!==2)return!1;g(j);const Ae=j.currentPeek()===_x;return j.resetPeek(),Ae}function $(j,te){const{currentType:me}=te;if(me!==7)return!1;g(j);const Ae=j.currentPeek()===".";return j.resetPeek(),Ae}function I(j,te){const{currentType:me}=te;if(me!==8)return!1;g(j);const Ae=v(j.currentPeek());return j.resetPeek(),Ae}function x(j,te){const{currentType:me}=te;if(!(me===7||me===11))return!1;g(j);const Ae=j.currentPeek()===":";return j.resetPeek(),Ae}function L(j,te){const{currentType:me}=te;if(me!==9)return!1;const Ae=()=>{const De=j.currentPeek();return De==="{"?v(j.peek()):De==="@"||De==="|"||De===":"||De==="."||De===Ki||!De?!1:De===Qo?(j.peek(),Ae()):F(j,!1)},$e=Ae();return j.resetPeek(),$e}function E(j){g(j);const te=j.currentPeek()==="|";return j.resetPeek(),te}function F(j,te=!0){const me=($e=!1,De="")=>{const ge=j.currentPeek();return ge==="{"||ge==="@"||!ge?$e:ge==="|"?!(De===Ki||De===Qo):ge===Ki?(j.peek(),me(!0,Ki)):ge===Qo?(j.peek(),me(!0,Qo)):!0},Ae=me();return te&&j.resetPeek(),Ae}function S(j,te){const me=j.currentChar();return me===vr?vr:te(me)?(j.next(),me):null}function N(j){const te=j.charCodeAt(0);return te>=97&&te<=122||te>=65&&te<=90||te>=48&&te<=57||te===95||te===36}function D(j){return S(j,N)}function B(j){const te=j.charCodeAt(0);return te>=97&&te<=122||te>=65&&te<=90||te>=48&&te<=57||te===95||te===36||te===45}function U(j){return S(j,B)}function H(j){const te=j.charCodeAt(0);return te>=48&&te<=57}function P(j){return S(j,H)}function Z(j){const te=j.charCodeAt(0);return te>=48&&te<=57||te>=65&&te<=70||te>=97&&te<=102}function K(j){return S(j,Z)}function V(j){let te="",me="";for(;te=P(j);)me+=te;return me}function X(j){let te="";for(;;){const me=j.currentChar();if(me==="\\"){const Ae=j.peek();Ae==="{"||Ae==="}"||Ae==="@"||Ae==="|"||Ae==="\\"?(te+=me+Ae,j.next(),j.next()):(j.resetPeek(),te+=me,j.next())}else{if(me==="{"||me==="}"||me==="@"||me==="|"||!me)break;if(me===Ki||me===Qo)if(F(j))te+=me,j.next();else{if(E(j))break;te+=me,j.next()}else te+=me,j.next()}}return te}function he(j){b(j);let te="",me="";for(;te=U(j);)me+=te;const Ae=j.currentChar();if(Ae&&Ae!=="}"&&Ae!==vr&&Ae!==Ki&&Ae!==Qo&&Ae!==" "){const $e=z(j);return d(hn.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,me+$e),me+$e}return j.currentChar()===vr&&d(hn.UNTERMINATED_CLOSING_BRACE,i(),0),me}function ne(j){b(j);let te="";return j.currentChar()==="-"?(j.next(),te+=`-${V(j)}`):te+=V(j),j.currentChar()===vr&&d(hn.UNTERMINATED_CLOSING_BRACE,i(),0),te}function ue(j){return j!==_x&&j!==Qo}function de(j){b(j),p(j,"'");let te="",me="";for(;te=S(j,ue);)te==="\\"?me+=Ce(j):me+=te;const Ae=j.currentChar();return Ae===Qo||Ae===vr?(d(hn.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,i(),0),Ae===Qo&&(j.next(),p(j,"'")),me):(p(j,"'"),me)}function Ce(j){const te=j.currentChar();switch(te){case"\\":case"'":return j.next(),`\\${te}`;case"u":return Ie(j,te,4);case"U":return Ie(j,te,6);default:return d(hn.UNKNOWN_ESCAPE_SEQUENCE,i(),0,te),""}}function Ie(j,te,me){p(j,te);let Ae="";for(let $e=0;$e<me;$e++){const De=K(j);if(!De){d(hn.INVALID_UNICODE_ESCAPE_SEQUENCE,i(),0,`\\${te}${Ae}${j.currentChar()}`);break}Ae+=De}return`\\${te}${Ae}`}function le(j){return j!=="{"&&j!=="}"&&j!==Ki&&j!==Qo}function z(j){b(j);let te="",me="";for(;te=S(j,le);)me+=te;return me}function ae(j){let te="",me="";for(;te=D(j);)me+=te;return me}function ie(j){const te=me=>{const Ae=j.currentChar();return Ae==="{"||Ae==="@"||Ae==="|"||Ae==="("||Ae===")"||!Ae||Ae===Ki?me:(me+=Ae,j.next(),te(me))};return te("")}function q(j){b(j);const te=p(j,"|");return b(j),te}function ee(j,te){let me=null;switch(j.currentChar()){case"{":return te.braceNest>=1&&d(hn.NOT_ALLOW_NEST_PLACEHOLDER,i(),0),j.next(),me=f(te,2,"{"),b(j),te.braceNest++,me;case"}":return te.braceNest>0&&te.currentType===2&&d(hn.EMPTY_PLACEHOLDER,i(),0),j.next(),me=f(te,3,"}"),te.braceNest--,te.braceNest>0&&b(j),te.inLinked&&te.braceNest===0&&(te.inLinked=!1),me;case"@":return te.braceNest>0&&d(hn.UNTERMINATED_CLOSING_BRACE,i(),0),me=ye(j,te)||h(te),te.braceNest=0,me;default:{let $e=!0,De=!0,ge=!0;if(E(j))return te.braceNest>0&&d(hn.UNTERMINATED_CLOSING_BRACE,i(),0),me=f(te,1,q(j)),te.braceNest=0,te.inLinked=!1,me;if(te.braceNest>0&&(te.currentType===4||te.currentType===5||te.currentType===6))return d(hn.UNTERMINATED_CLOSING_BRACE,i(),0),te.braceNest=0,fe(j,te);if($e=y(j,te))return me=f(te,4,he(j)),b(j),me;if(De=k(j,te))return me=f(te,5,ne(j)),b(j),me;if(ge=A(j,te))return me=f(te,6,de(j)),b(j),me;if(!$e&&!De&&!ge)return me=f(te,12,z(j)),d(hn.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,me.value),b(j),me;break}}return me}function ye(j,te){const{currentType:me}=te;let Ae=null;const $e=j.currentChar();switch((me===7||me===8||me===11||me===9)&&($e===Qo||$e===Ki)&&d(hn.INVALID_LINKED_FORMAT,i(),0),$e){case"@":return j.next(),Ae=f(te,7,"@"),te.inLinked=!0,Ae;case".":return b(j),j.next(),f(te,8,".");case":":return b(j),j.next(),f(te,9,":");default:return E(j)?(Ae=f(te,1,q(j)),te.braceNest=0,te.inLinked=!1,Ae):$(j,te)||x(j,te)?(b(j),ye(j,te)):I(j,te)?(b(j),f(te,11,ae(j))):L(j,te)?(b(j),$e==="{"?ee(j,te)||Ae:f(te,10,ie(j))):(me===7&&d(hn.INVALID_LINKED_FORMAT,i(),0),te.braceNest=0,te.inLinked=!1,fe(j,te))}}function fe(j,te){let me={type:13};if(te.braceNest>0)return ee(j,te)||h(te);if(te.inLinked)return ye(j,te)||h(te);switch(j.currentChar()){case"{":return ee(j,te)||h(te);case"}":return d(hn.UNBALANCED_CLOSING_BRACE,i(),0),j.next(),f(te,3,"}");case"@":return ye(j,te)||h(te);default:{if(E(j))return me=f(te,1,q(j)),te.braceNest=0,te.inLinked=!1,me;if(F(j))return f(te,0,X(j));break}}return me}function ve(){const{currentType:j,offset:te,startLoc:me,endLoc:Ae}=a;return a.lastType=j,a.lastOffset=te,a.lastStartLoc=me,a.lastEndLoc=Ae,a.offset=s(),a.startLoc=i(),o.currentChar()===vr?f(a,13):fe(o,a)}return{nextToken:ve,currentOffset:s,currentPosition:i,context:c}}const FN="parser",ON=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g,RN=/\\([\\@{}|])/g;function BN(e,t){return t}function DN(e,t,n){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const o=parseInt(t||n,16);return o<=55295||o>=57344?String.fromCodePoint(o):"�"}}}function PN(e={}){const t=e.location!==!1,{onError:n}=e;function o(v,m,y,k,...A){const $=v.currentPosition();if($.offset+=k,$.column+=k,n){const I=t?jg(y,$):null,x=gm(m,I,{domain:FN,args:A});n(x)}}function s(v,m,y){const k={type:v};return t&&(k.start=m,k.end=m,k.loc={start:y,end:y}),k}function i(v,m,y,k){t&&(v.end=m,v.loc&&(v.loc.end=y))}function r(v,m){const y=v.context(),k=s(3,y.offset,y.startLoc);return k.value=m.replace(RN,BN),i(k,v.currentOffset(),v.currentPosition()),k}function l(v,m){const y=v.context(),{lastOffset:k,lastStartLoc:A}=y,$=s(5,k,A);return $.index=parseInt(m,10),v.nextToken(),i($,v.currentOffset(),v.currentPosition()),$}function a(v,m){const y=v.context(),{lastOffset:k,lastStartLoc:A}=y,$=s(4,k,A);return $.key=m,v.nextToken(),i($,v.currentOffset(),v.currentPosition()),$}function c(v,m){const y=v.context(),{lastOffset:k,lastStartLoc:A}=y,$=s(9,k,A);return $.value=m.replace(ON,DN),v.nextToken(),i($,v.currentOffset(),v.currentPosition()),$}function u(v){const m=v.nextToken(),y=v.context(),{lastOffset:k,lastStartLoc:A}=y,$=s(8,k,A);return m.type!==11?(o(v,hn.UNEXPECTED_EMPTY_LINKED_MODIFIER,y.lastStartLoc,0),$.value="",i($,k,A),{nextConsumeToken:m,node:$}):(m.value==null&&o(v,hn.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Gi(m)),$.value=m.value||"",i($,v.currentOffset(),v.currentPosition()),{node:$})}function d(v,m){const y=v.context(),k=s(7,y.offset,y.startLoc);return k.value=m,i(k,v.currentOffset(),v.currentPosition()),k}function f(v){const m=v.context(),y=s(6,m.offset,m.startLoc);let k=v.nextToken();if(k.type===8){const A=u(v);y.modifier=A.node,k=A.nextConsumeToken||v.nextToken()}switch(k.type!==9&&o(v,hn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,Gi(k)),k=v.nextToken(),k.type===2&&(k=v.nextToken()),k.type){case 10:k.value==null&&o(v,hn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,Gi(k)),y.key=d(v,k.value||"");break;case 4:k.value==null&&o(v,hn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,Gi(k)),y.key=a(v,k.value||"");break;case 5:k.value==null&&o(v,hn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,Gi(k)),y.key=l(v,k.value||"");break;case 6:k.value==null&&o(v,hn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,Gi(k)),y.key=c(v,k.value||"");break;default:{o(v,hn.UNEXPECTED_EMPTY_LINKED_KEY,m.lastStartLoc,0);const A=v.context(),$=s(7,A.offset,A.startLoc);return $.value="",i($,A.offset,A.startLoc),y.key=$,i(y,A.offset,A.startLoc),{nextConsumeToken:k,node:y}}}return i(y,v.currentOffset(),v.currentPosition()),{node:y}}function h(v){const m=v.context(),y=m.currentType===1?v.currentOffset():m.offset,k=m.currentType===1?m.endLoc:m.startLoc,A=s(2,y,k);A.items=[];let $=null;do{const L=$||v.nextToken();switch($=null,L.type){case 0:L.value==null&&o(v,hn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,Gi(L)),A.items.push(r(v,L.value||""));break;case 5:L.value==null&&o(v,hn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,Gi(L)),A.items.push(l(v,L.value||""));break;case 4:L.value==null&&o(v,hn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,Gi(L)),A.items.push(a(v,L.value||""));break;case 6:L.value==null&&o(v,hn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,Gi(L)),A.items.push(c(v,L.value||""));break;case 7:{const E=f(v);A.items.push(E.node),$=E.nextConsumeToken||null;break}}}while(m.currentType!==13&&m.currentType!==1);const I=m.currentType===1?m.lastOffset:v.currentOffset(),x=m.currentType===1?m.lastEndLoc:v.currentPosition();return i(A,I,x),A}function p(v,m,y,k){const A=v.context();let $=k.items.length===0;const I=s(1,m,y);I.cases=[],I.cases.push(k);do{const x=h(v);$||($=x.items.length===0),I.cases.push(x)}while(A.currentType!==13);return $&&o(v,hn.MUST_HAVE_MESSAGES_IN_PLURAL,y,0),i(I,v.currentOffset(),v.currentPosition()),I}function g(v){const m=v.context(),{offset:y,startLoc:k}=m,A=h(v);return m.currentType===13?A:p(v,y,k,A)}function b(v){const m=$N(v,_o({},e)),y=m.context(),k=s(0,y.offset,y.startLoc);return t&&k.loc&&(k.loc.source=v),k.body=g(m),e.onCacheKey&&(k.cacheKey=e.onCacheKey(v)),y.currentType!==13&&o(m,hn.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,v[y.offset]||""),i(k,m.currentOffset(),m.currentPosition()),k}return{parse:b}}function Gi(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 HN(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:i=>(n.helpers.add(i),i)}}function Sx(e,t){for(let n=0;n<e.length;n++)Ly(e[n],t)}function Ly(e,t){switch(e.type){case 1:Sx(e.cases,t),t.helper("plural");break;case 2:Sx(e.items,t);break;case 6:{Ly(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 WN(e,t={}){const n=HN(e);n.helper("normalize"),e.body&&Ly(e.body,n);const o=n.context();e.helpers=Array.from(o.helpers)}function zN(e){const t=e.body;return t.type===2?Cx(t):t.cases.forEach(n=>Cx(n)),e}function Cx(e){if(e.items.length===1){const t=e.items[0];(t.type===3||t.type===9)&&(e.static=t.value,delete t.value)}else{const t=[];for(let n=0;n<e.items.length;n++){const o=e.items[n];if(!(o.type===3||o.type===9)||o.value==null)break;t.push(o.value)}if(t.length===e.items.length){e.static=Iy(t);for(let n=0;n<e.items.length;n++){const o=e.items[n];(o.type===3||o.type===9)&&delete o.value}}}}function gc(e){switch(e.t=e.type,e.type){case 0:{const t=e;gc(t.body),t.b=t.body,delete t.body;break}case 1:{const t=e,n=t.cases;for(let o=0;o<n.length;o++)gc(n[o]);t.c=n,delete t.cases;break}case 2:{const t=e,n=t.items;for(let o=0;o<n.length;o++)gc(n[o]);t.i=n,delete t.items,t.static&&(t.s=t.static,delete t.static);break}case 3:case 9:case 8:case 7:{const t=e;t.value&&(t.v=t.value,delete t.value);break}case 6:{const t=e;gc(t.key),t.k=t.key,delete t.key,t.modifier&&(gc(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 UN(e,t){const{filename:n,breakLineCode:o,needIndent:s}=t,i=t.location!==!1,r={filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:o,needIndent:s,indentLevel:0};i&&e.loc&&(r.source=e.loc.source);const l=()=>r;function a(g,b){r.code+=g}function c(g,b=!0){const v=b?o:"";a(s?v+" ".repeat(g):v)}function u(g=!0){const b=++r.indentLevel;g&&c(b)}function d(g=!0){const b=--r.indentLevel;g&&c(b)}function f(){c(r.indentLevel)}return{context:l,push:a,indent:u,deindent:d,newline:f,helper:g=>`_${g}`,needIndent:()=>r.needIndent}}function qN(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),Xc(e,t.key),t.modifier?(e.push(", "),Xc(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function jN(e,t){const{helper:n,needIndent:o}=e;e.push(`${n("normalize")}([`),e.indent(o());const s=t.items.length;for(let i=0;i<s&&(Xc(e,t.items[i]),i!==s-1);i++)e.push(", ");e.deindent(o()),e.push("])")}function VN(e,t){const{helper:n,needIndent:o}=e;if(t.cases.length>1){e.push(`${n("plural")}([`),e.indent(o());const s=t.cases.length;for(let i=0;i<s&&(Xc(e,t.cases[i]),i!==s-1);i++)e.push(", ");e.deindent(o()),e.push("])")}}function KN(e,t){t.body?Xc(e,t.body):e.push("null")}function Xc(e,t){const{helper:n}=e;switch(t.type){case 0:KN(e,t);break;case 1:VN(e,t);break;case 2:jN(e,t);break;case 6:qN(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 GN=(e,t={})=>{const n=yt(t.mode)?t.mode:"normal",o=yt(t.filename)?t.filename:"message.intl";t.sourceMap;const s=t.breakLineCode!=null?t.breakLineCode:n==="arrow"?";":`
30
+ `,i=t.needIndent?t.needIndent:n!=="arrow",r=e.helpers||[],l=UN(e,{filename:o,breakLineCode:s,needIndent:i});l.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(i),r.length>0&&(l.push(`const { ${Iy(r.map(u=>`${u}: _${u}`),", ")} } = ctx`),l.newline()),l.push("return "),Xc(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 YN(e,t={}){const n=_o({},t),o=!!n.jit,s=!!n.minify,i=n.optimize==null?!0:n.optimize,l=PN(n).parse(e);return o?(i&&zN(l),s&&gc(l),{ast:l,code:""}):(WN(l,n),GN(l,n))}/*!
31
+ * core-base v11.4.5
32
+ * (c) 2026 kazuya kawaguchi
33
+ * Released under the MIT License.
34
+ */function ZN(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(ya().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(ya().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function sr(e){return on(e)&&$y(e)===0&&(yi(e,"b")||yi(e,"body"))}const Y3=["b","body"];function QN(e){return Dl(e,Y3)}const Z3=["c","cases"];function XN(e){return Dl(e,Z3,[])}const Q3=["s","static"];function JN(e){return Dl(e,Q3)}const X3=["i","items"];function e7(e){return Dl(e,X3,[])}const J3=["t","type"];function $y(e){return Dl(e,J3)}const eA=["v","value"];function Hf(e,t){const n=Dl(e,eA);if(n!=null)return n;throw _d(t)}const tA=["m","modifier"];function t7(e){return Dl(e,tA)}const nA=["k","key"];function n7(e){const t=Dl(e,nA);if(t)return t;throw _d(6)}function Dl(e,t,n){for(let o=0;o<t.length;o++){const s=t[o];if(yi(e,s)&&e[s]!=null)return e[s]}return n}const oA=[...Y3,...Z3,...Q3,...X3,...nA,...tA,...eA,...J3];function _d(e){return new Error(`unhandled node type: ${e}`)}function r0(e){return n=>o7(n,e)}function o7(e,t){const n=QN(t);if(n==null)throw _d(0);if($y(n)===1){const i=XN(n);return e.plural(i.reduce((r,l)=>[...r,Ax(e,l)],[]))}else return Ax(e,n)}function Ax(e,t){const n=JN(t);if(n!=null)return e.type==="text"?n:e.normalize([n]);{const o=e7(t).reduce((s,i)=>[...s,Vg(e,i)],[]);return e.normalize(o)}}function Vg(e,t){const n=$y(t);switch(n){case 3:return Hf(t,n);case 9:return Hf(t,n);case 4:{const o=t;if(yi(o,"k")&&o.k)return e.interpolate(e.named(o.k));if(yi(o,"key")&&o.key)return e.interpolate(e.named(o.key));throw _d(n)}case 5:{const o=t;if(yi(o,"i")&&wo(o.i))return e.interpolate(e.list(o.i));if(yi(o,"index")&&wo(o.index))return e.interpolate(e.list(o.index));throw _d(n)}case 6:{const o=t,s=t7(o),i=n7(o);return e.linked(Vg(e,i),s?Vg(e,s):void 0,e.type)}case 7:return Hf(t,n);case 8:return Hf(t,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const s7=e=>e;let Wf=Sn();function i7(e,t={}){let n=!1;const o=t.onError||AN;return t.onError=s=>{n=!0,o(s)},{...YN(e,t),detectError:n}}function r7(e,t){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&yt(e)){nn(t.warnHtmlMessage)&&t.warnHtmlMessage;const o=(t.onCacheKey||s7)(e),s=Wf[o];if(s)return s;const{ast:i,detectError:r}=i7(e,{...t,location:!1,jit:!0}),l=r0(i);return r?l:Wf[o]=l}else{const n=e.cacheKey;if(n){const o=Wf[n];return o||(Wf[n]=r0(e))}else return r0(e)}}let Sd=null;function l7(e){Sd=e}function a7(e,t,n){Sd&&Sd.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})}const c7=u7("function:translate");function u7(e){return t=>Sd&&Sd.emit(e,t)}const Lr={INVALID_ARGUMENT:CN,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},d7=24;function $r(e){return gm(e,null,void 0)}function Fy(e,t){return t.locale!=null?Mx(t.locale):Mx(e.locale)}let l0;function Mx(e){if(yt(e))return e;if(Kn(e)){if(e.resolvedOnce&&l0!=null)return l0;if(e.constructor.name==="Function"){const t=e();if(wN(t))throw $r(Lr.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return l0=t}else throw $r(Lr.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw $r(Lr.NOT_SUPPORT_LOCALE_TYPE)}function f7(e,t,n){return[...new Set([n,...io(t)?t:on(t)?Object.keys(t):yt(t)?[t]:[n]])]}function Kg(e,t,n){const o=yt(n)?n:Cd,s=e;s.__localeChainCache||(s.__localeChainCache=new Map);let i=s.__localeChainCache.get(o);if(!i){i=[];let r=[n];for(;io(r);)r=Ex(i,r,t);const l=io(t)||!Jt(t)?t:t.default?t.default:null;r=yt(l)?[l]:l,io(r)&&Ex(i,r,!1),s.__localeChainCache.set(o,i)}return i}function Ex(e,t,n){let o=!0;for(let s=0;s<t.length&&nn(o);s++){const i=t[s];yt(i)&&(o=h7(e,t[s],n))}return o}function h7(e,t,n){let o;const s=t.split("-");do{const i=s.join("-");o=p7(e,i,n),s.splice(-1,1)}while(s.length&&o===!0);return o}function p7(e,t,n){let o=!1;if(!e.includes(t)&&(o=!0,t)){o=t[t.length-1]!=="!";const s=t.replace(/!/g,"");e.push(s),(io(n)||Jt(n))&&n[s]&&(o=n[s])}return o}const Pl=[];Pl[0]={w:[0],i:[3,0],"[":[4],o:[7]};Pl[1]={w:[1],".":[2],"[":[4],o:[7]};Pl[2]={w:[2],i:[3,0],0:[3,0]};Pl[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};Pl[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};Pl[5]={"'":[4,0],o:8,l:[5,0]};Pl[6]={'"':[4,0],o:8,l:[6,0]};const m7=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function g7(e){return m7.test(e)}function v7(e){const t=e.charCodeAt(0),n=e.charCodeAt(e.length-1);return t===n&&(t===34||t===39)?e.slice(1,-1):e}function y7(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 k7(e){const t=e.trim();return e.charAt(0)==="0"&&isNaN(parseInt(e))?!1:g7(t)?v7(t):"*"+t}function b7(e){const t=[];let n=-1,o=0,s=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](),s++},f[3]=()=>{if(s>0)s--,o=4,f[0]();else{if(s=0,r===void 0||(r=k7(r),r===!1))return!1;f[1]()}};function h(){const p=e[n+1];if(o===5&&p==="'"||o===6&&p==='"')return n++,l="\\"+p,f[0](),!0}for(;o!==null;)if(n++,i=e[n],!(i==="\\"&&h())){if(a=y7(i),d=Pl[o],c=d[a]||d.l||8,c===8||(o=c[0],c[1]!==void 0&&(u=f[c[1]],u&&(l=i,u()===!1))))return;if(o===7)return t}}const Tx=new Map;function x7(e,t){return on(e)?e[t]:null}function w7(e,t){if(!on(e))return null;let n=Tx.get(t);if(n||(n=b7(t),n&&Tx.set(t,n)),!n)return null;const o=n.length;let s=e,i=0;for(;i<o;){const r=n[i];if(oA.includes(r)&&sr(s)||!on(s)||!yi(s,r))return null;const l=s[r];if(l===void 0||Kn(s))return null;s=l,i++}return s}const _7="11.4.5",vm=-1,Cd="en-US",ip="",Nx=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function S7(){return{upper:(e,t)=>t==="text"&&yt(e)?e.toUpperCase():t==="vnode"&&on(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>t==="text"&&yt(e)?e.toLowerCase():t==="vnode"&&on(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>t==="text"&&yt(e)?Nx(e):t==="vnode"&&on(e)&&"__v_isVNode"in e?Nx(e.children):e}}let sA;function C7(e){sA=e}let iA;function A7(e){iA=e}let rA;function M7(e){rA=e}let lA=null;const E7=e=>{lA=e},T7=()=>lA;let aA=null;const Ix=e=>{aA=e},N7=()=>aA;let Lx=0;function I7(e={}){const t=Kn(e.onWarn)?e.onWarn:fN,n=yt(e.version)?e.version:_7,o=yt(e.locale)||Kn(e.locale)?e.locale:Cd,s=Kn(o)?Cd:o,i=io(e.fallbackLocale)||Jt(e.fallbackLocale)||yt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:s,r=Jt(e.messages)?e.messages:a0(s),l=Jt(e.datetimeFormats)?e.datetimeFormats:a0(s),a=Jt(e.numberFormats)?e.numberFormats:a0(s),c=_o(Sn(),e.modifiers,S7()),u=e.pluralRules||Sn(),d=Kn(e.missing)?e.missing:null,f=nn(e.missingWarn)||Qc(e.missingWarn)?e.missingWarn:!0,h=nn(e.fallbackWarn)||Qc(e.fallbackWarn)?e.fallbackWarn:!0,p=!!e.fallbackFormat,g=!!e.unresolving,b=Kn(e.postTranslation)?e.postTranslation:null,v=Jt(e.processor)?e.processor:null,m=nn(e.warnHtmlMessage)?e.warnHtmlMessage:!0,y=!!e.escapeParameter,k=Kn(e.messageCompiler)?e.messageCompiler:sA,A=Kn(e.messageResolver)?e.messageResolver:iA||x7,$=Kn(e.localeFallbacker)?e.localeFallbacker:rA||f7,I=on(e.fallbackContext)?e.fallbackContext:void 0,x=e,L=on(x.__datetimeFormatters)?x.__datetimeFormatters:new Map,E=on(x.__numberFormatters)?x.__numberFormatters:new Map,F=on(x.__meta)?x.__meta:{};Lx++;const S={version:n,cid:Lx,locale:o,fallbackLocale:i,messages:r,modifiers:c,pluralRules:u,missing:d,missingWarn:f,fallbackWarn:h,fallbackFormat:p,unresolving:g,postTranslation:b,processor:v,warnHtmlMessage:m,escapeParameter:y,messageCompiler:k,messageResolver:A,localeFallbacker:$,fallbackContext:I,onWarn:t,__meta:F};return S.datetimeFormats=l,S.numberFormats=a,S.__datetimeFormatters=L,S.__numberFormatters=E,__INTLIFY_PROD_DEVTOOLS__&&a7(S,n,F),S}const a0=e=>({[e]:Sn()});function Oy(e,t,n,o,s){const{missing:i,onWarn:r}=e;if(i!==null){const l=i(e,n,t,s);return yt(l)?l:t}else return t}function $u(e,t,n){const o=e;o.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function L7(e,t){return e===t?!1:e.split("-")[0]===t.split("-")[0]}function $7(e,t){const n=t.indexOf(e);if(n===-1)return!1;for(let o=n+1;o<t.length;o++)if(L7(e,t[o]))return!0;return!1}function $x(e,...t){const{datetimeFormats:n,unresolving:o,fallbackLocale:s,onWarn:i,localeFallbacker:r}=e,{__datetimeFormatters:l}=e;if(!yt(t[0])&&!K3(t[0])&&!wo(t[0]))return ip;const[a,c,u,d]=Gg(...t),f=nn(u.missingWarn)?u.missingWarn:e.missingWarn;nn(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const h=!!u.part,p=Fy(e,u),g=r(e,s,p);if(!yt(a)||a===""){const $=new Intl.DateTimeFormat(p.replace(/!/g,""),d);return h?$.formatToParts(c):$.format(c)}let b={},v,m=null;const y="datetime format";for(let $=0;$<g.length&&(v=g[$],b=n[v]||{},m=b[a],!Jt(m));$++)Oy(e,a,v,f,y);if(!Jt(m)||!yt(v))return o?vm:a;let k=`${v}__${a}`;mm(d)||(k=`${k}__${JSON.stringify(d)}`);let A=l.get(k);return A||(A=new Intl.DateTimeFormat(v,_o({},m,d)),l.set(k,A)),h?A.formatToParts(c):A.format(c)}const cA=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function Gg(...e){const[t,n,o,s]=e,i=Sn();let r=Sn(),l;if(yt(t)){const a=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!a)throw $r(Lr.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 $r(Lr.INVALID_ISO_DATE_ARGUMENT)}}else if(K3(t)){if(isNaN(t.getTime()))throw $r(Lr.INVALID_DATE_ARGUMENT);l=t}else if(wo(t))l=t;else throw $r(Lr.INVALID_ARGUMENT);return yt(n)?i.key=n:Jt(n)&&Object.keys(n).forEach(a=>{cA.includes(a)?r[a]=n[a]:i[a]=n[a]}),yt(o)?i.locale=o:Jt(o)&&(r=o),Jt(s)&&(r=s),[i.key||"",l,i,r]}function Fx(e,t,n){const o=e;for(const s in n){const i=`${t}__${s}`;o.__datetimeFormatters.has(i)&&o.__datetimeFormatters.delete(i)}}function Ox(e,...t){const{numberFormats:n,unresolving:o,fallbackLocale:s,onWarn:i,localeFallbacker:r}=e,{__numberFormatters:l}=e;if(!wo(t[0]))return ip;const[a,c,u,d]=Yg(...t),f=nn(u.missingWarn)?u.missingWarn:e.missingWarn;nn(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const h=!!u.part,p=Fy(e,u),g=r(e,s,p);if(!yt(a)||a===""){const $=new Intl.NumberFormat(p.replace(/!/g,""),d);return h?$.formatToParts(c):$.format(c)}let b={},v,m=null;const y="number format";for(let $=0;$<g.length&&(v=g[$],b=n[v]||{},m=b[a],!Jt(m));$++)Oy(e,a,v,f,y);if(!Jt(m)||!yt(v))return o?vm:a;let k=`${v}__${a}`;mm(d)||(k=`${k}__${JSON.stringify(d)}`);let A=l.get(k);return A||(A=new Intl.NumberFormat(v,_o({},m,d)),l.set(k,A)),h?A.formatToParts(c):A.format(c)}const uA=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function Yg(...e){const[t,n,o,s]=e,i=Sn();let r=Sn();if(!wo(t))throw $r(Lr.INVALID_ARGUMENT);const l=t;return yt(n)?i.key=n:Jt(n)&&Object.keys(n).forEach(a=>{uA.includes(a)?r[a]=n[a]:i[a]=n[a]}),yt(o)?i.locale=o:Jt(o)&&(r=o),Jt(s)&&(r=s),[i.key||"",l,i,r]}function Rx(e,t,n){const o=e;for(const s in n){const i=`${t}__${s}`;o.__numberFormatters.has(i)&&o.__numberFormatters.delete(i)}}const F7=e=>e,O7=e=>"",R7="text",B7=e=>e.length===0?"":Iy(e),D7=_N;function c0(e,t){return e=Math.abs(e),t===2?e===1?0:1:Math.min(e,2)}function P7(e){const t=wo(e.pluralIndex)?e.pluralIndex:-1;return wo(e.named?.count)?e.named.count:wo(e.named?.n)?e.named.n:t}function H7(e={}){const t=e.locale,n=P7(e),o=yt(t)&&Kn(e.pluralRules?.[t])?e.pluralRules[t]:c0,s=o===c0?void 0:c0,i=v=>v[o(n,v.length,s)],r=e.list||[],l=v=>r[v],a=e.named||Sn();wo(e.pluralIndex)&&(a.count||=e.pluralIndex,a.n||=e.pluralIndex);const c=v=>a[v];function u(v,m){const y=Kn(e.messages)?e.messages(v,!!m):on(e.messages)?e.messages[v]:!1;return y||(e.parent?e.parent.message(v):O7)}const d=v=>e.modifiers?e.modifiers[v]:F7,f=Kn(e.processor?.normalize)?e.processor.normalize:B7,h=Kn(e.processor?.interpolate)?e.processor.interpolate:D7,p=yt(e.processor?.type)?e.processor.type:R7,b={list:l,named:c,plural:i,linked:(v,...m)=>{const[y,k]=m;let A="text",$="";m.length===1?on(y)?($=y.modifier||$,A=y.type||A):yt(y)&&($=y||$):m.length===2&&(yt(y)&&($=y||$),yt(k)&&(A=k||A));const I=u(v,!0)(b),x=I===""||I===void 0?v:I,L=A==="vnode"&&io(x)&&$?x[0]:x;return $?d($)(L,A):L},message:u,type:p,interpolate:h,normalize:f,values:_o(Sn(),r,a)};return b}const Bx=()=>"",hi=e=>Kn(e);function Dx(e,...t){const{fallbackFormat:n,postTranslation:o,unresolving:s,messageCompiler:i,fallbackLocale:r,messages:l}=e,[a,c]=Zg(...t),u=nn(c.missingWarn)?c.missingWarn:e.missingWarn,d=nn(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn,f=nn(c.escapeParameter)?c.escapeParameter:e.escapeParameter,h=!!c.resolvedMessage,p=yt(c.default)||nn(c.default)?nn(c.default)?i?a:()=>a:c.default:n?i?a:()=>a:null,g=n||p!=null&&(yt(p)||Kn(p)),b=Fy(e,c);f&&W7(c);let[v,m,y]=h?[a,b,l[b]||Sn()]:dA(e,a,b,r,d,u),k=v,A=a;if(!h&&!(yt(k)||sr(k)||hi(k))&&g&&(k=p,A=k),!h&&(!(yt(k)||sr(k)||hi(k))||!yt(m)))return s?vm:a;let $=!1;const I=()=>{$=!0},x=hi(k)?k:fA(e,a,m,k,A,I);if($)return k;const L=q7(e,m,y,c),E=H7(L),F=z7(e,x,E);let S=o?o(F,a):F;if(f&&yt(S)&&(S=bN(S)),__INTLIFY_PROD_DEVTOOLS__){const N={timestamp:Date.now(),key:yt(a)?a:hi(k)?k.key:"",locale:m||(hi(k)?k.locale:""),format:yt(k)?k:hi(k)?k.source:"",message:S};N.meta=_o({},e.__meta,T7()||{}),c7(N)}return S}function W7(e){io(e.list)?e.list=e.list.map(t=>yt(t)?xx(t):t):on(e.named)&&Object.keys(e.named).forEach(t=>{yt(e.named[t])&&(e.named[t]=xx(e.named[t]))})}function dA(e,t,n,o,s,i){const{messages:r,onWarn:l,messageResolver:a,localeFallbacker:c}=e,u=c(e,o,n);let d=Sn(),f,h=null;const p="translate";for(let g=0;g<u.length&&(f=u[g],d=r[f]||Sn(),(h=a(d,t))===null&&(h=d[t]),!(yt(h)||sr(h)||hi(h)));g++)if(!$7(f,u)){const b=Oy(e,t,f,i,p);b!==t&&(h=b)}return[h,f,d]}function fA(e,t,n,o,s,i){const{messageCompiler:r,warnHtmlMessage:l}=e;if(hi(o)){const c=o;return c.locale=c.locale||n,c.key=c.key||t,c}if(r==null){const c=(()=>o);return c.locale=n,c.key=t,c}const a=r(o,U7(e,n,s,o,l,i));return a.locale=n,a.key=t,a.source=o,a}function z7(e,t,n){return t(n)}function Zg(...e){const[t,n,o]=e,s=Sn();if(!yt(t)&&!wo(t)&&!hi(t)&&!sr(t))throw $r(Lr.INVALID_ARGUMENT);const i=wo(t)?String(t):(hi(t),t);return wo(n)?s.plural=n:yt(n)?s.default=n:Jt(n)&&!mm(n)?s.named=n:io(n)&&(s.list=n),wo(o)?s.plural=o:yt(o)?s.default=o:Jt(o)&&_o(s,o),[i,s]}function U7(e,t,n,o,s,i){return{locale:t,key:n,warnHtmlMessage:s,onError:r=>{throw i&&i(r),r},onCacheKey:r=>hN(t,n,r)}}function q7(e,t,n,o){const{modifiers:s,pluralRules:i,messageResolver:r,fallbackLocale:l,fallbackWarn:a,missingWarn:c,fallbackContext:u}=e,f={locale:t,modifiers:s,pluralRules:i,messages:(h,p)=>{let g=r(n,h);if(g==null&&(u||p)){const[b,,v]=dA(u||e,h,t,l,a,c);g=b??r(v,h)}if(yt(g)||sr(g)){let b=!1;const m=fA(e,h,t,g,h,()=>{b=!0});return b?Bx:m}else return hi(g)?g:Bx}};return e.processor&&(f.processor=e.processor),o.list&&(f.list=o.list),o.named&&(f.named=o.named),wo(o.plural)&&(f.pluralIndex=o.plural),f}ZN();/*!
35
+ * vue-i18n v11.4.5
36
+ * (c) 2026 kazuya kawaguchi
37
+ * Released under the MIT License.
38
+ */const j7="11.4.5";function V7(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(ya().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(ya().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(ya().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(ya().__INTLIFY_PROD_DEVTOOLS__=!1)}const vs={UNEXPECTED_RETURN_TYPE:d7,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 Ls(e,...t){return gm(e,null,void 0)}const Qg=Bl("__translateVNode"),Xg=Bl("__datetimeParts"),Jg=Bl("__numberParts"),hA=Bl("__setPluralRules"),pA=Bl("__injectWithOption"),_c=Bl("__dispose");function Ad(e){if(!on(e)||sr(e))return e;for(const t in e)if(yi(e,t))if(!t.includes("."))on(e[t])&&Ad(e[t]);else{const n=t.split("."),o=n.length-1;let s=e,i=!1;for(let r=0;r<o;r++){if(n[r]==="__proto__")throw new Error(`unsafe key: ${n[r]}`);if(n[r]in s||(s[n[r]]=Sn()),!on(s[n[r]])){i=!0;break}s=s[n[r]]}if(i||(sr(s)?oA.includes(n[o])||delete e[t]:(s[n[o]]=e[t],delete e[t])),!sr(s)){const r=s[n[o]];on(r)&&Ad(r)}}return e}function Ry(e,t){const{messages:n,__i18n:o,messageResolver:s,flatJson:i}=t,r=Jt(n)?n:io(o)?Sn():{[e]:Sn()};if(io(o)&&o.forEach(l=>{if("locale"in l&&"resource"in l){const{locale:a,resource:c}=l;a?(r[a]=r[a]||Sn(),yh(c,r[a])):yh(c,r)}else yt(l)&&yh(JSON.parse(l),r)}),s==null&&i)for(const l in r)yi(r,l)&&Ad(r[l]);return r}function mA(e){return e.type}function gA(e,t,n){let o=on(t.messages)?t.messages:Sn();"__i18nGlobal"in n&&(o=Ry(e.locale.value,{messages:o,__i18n:n.__i18nGlobal}));const s=Object.keys(o);s.length&&s.forEach(i=>{e.mergeLocaleMessage(i,o[i])});{if(on(t.datetimeFormats)){const i=Object.keys(t.datetimeFormats);i.length&&i.forEach(r=>{e.mergeDateTimeFormat(r,t.datetimeFormats[r])})}if(on(t.numberFormats)){const i=Object.keys(t.numberFormats);i.length&&i.forEach(r=>{e.mergeNumberFormat(r,t.numberFormats[r])})}}}function Px(e){return re(Sl,null,e,0)}function Md(){return Yo()}const Hx="__INTLIFY_META__",Wx=()=>[],K7=()=>!1;let zx=0;function Ux(e){return((t,n,o,s)=>e(n,o,Md()||void 0,s))}const G7=()=>{const e=Md();let t=null;return e&&(t=mA(e)[Hx])?{[Hx]:t}:null};function rp(e={}){const{__root:t,__injectWithOption:n}=e,o=t===void 0,s=e.flatJson,i=sp?J:Ba;let r=nn(e.inheritLocale)?e.inheritLocale:!0;const l=i(t&&r?t.locale.value:yt(e.locale)?e.locale:Cd),a=i(t&&r?t.fallbackLocale.value:yt(e.fallbackLocale)||io(e.fallbackLocale)||Jt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:l.value),c=i(Ry(l.value,e)),u=i(Jt(e.datetimeFormats)?e.datetimeFormats:{[l.value]:{}}),d=i(Jt(e.numberFormats)?e.numberFormats:{[l.value]:{}});let f=t?t.missingWarn:nn(e.missingWarn)||Qc(e.missingWarn)?e.missingWarn:!0,h=t?t.fallbackWarn:nn(e.fallbackWarn)||Qc(e.fallbackWarn)?e.fallbackWarn:!0,p=t?t.fallbackRoot:nn(e.fallbackRoot)?e.fallbackRoot:!0,g=!!e.fallbackFormat,b=Kn(e.missing)?e.missing:null,v=Kn(e.missing)?Ux(e.missing):null,m=Kn(e.postTranslation)?e.postTranslation:null,y=t?t.warnHtmlMessage:nn(e.warnHtmlMessage)?e.warnHtmlMessage:!0,k=!!e.escapeParameter;const A=t?t.modifiers:Jt(e.modifiers)?e.modifiers:{};let $=e.pluralRules||t&&t.pluralRules,I;I=(()=>{o&&Ix(null);const ge={version:j7,locale:l.value,fallbackLocale:a.value,messages:c.value,modifiers:A,pluralRules:$,missing:v===null?void 0:v,missingWarn:f,fallbackWarn:h,fallbackFormat:g,unresolving:!0,postTranslation:m===null?void 0:m,warnHtmlMessage:y,escapeParameter:k,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};ge.datetimeFormats=u.value,ge.numberFormats=d.value,ge.__datetimeFormatters=Jt(I)?I.__datetimeFormatters:void 0,ge.__numberFormatters=Jt(I)?I.__numberFormatters:void 0;const Ne=I7(ge);return o&&Ix(Ne),Ne})(),$u(I,l.value,a.value);function L(){return[l.value,a.value,c.value,u.value,d.value]}const E=R({get:()=>l.value,set:ge=>{I.locale=ge,l.value=ge}}),F=R({get:()=>a.value,set:ge=>{I.fallbackLocale=ge,a.value=ge,$u(I,l.value,ge)}}),S=R(()=>c.value),N=R(()=>u.value),D=R(()=>d.value);function B(){return Kn(m)?m:null}function U(ge){m=ge,I.postTranslation=ge}function H(){return b}function P(ge){ge!==null&&(v=Ux(ge)),b=ge,I.missing=v}const Z=(ge,Ne,et,rt,_t,gt)=>{L();let It;try{__INTLIFY_PROD_DEVTOOLS__,o||(I.fallbackContext=t?N7():void 0),It=ge(I)}finally{__INTLIFY_PROD_DEVTOOLS__,o||(I.fallbackContext=void 0)}if(et!=="translate exists"&&wo(It)&&It===vm||et==="translate exists"&&!It){const[Ut,ht]=Ne();return t&&p?rt(t):_t(Ut)}else{if(gt(It))return It;throw Ls(vs.UNEXPECTED_RETURN_TYPE)}};function K(...ge){return Z(Ne=>Reflect.apply(Dx,null,[Ne,...ge]),()=>Zg(...ge),"translate",Ne=>Reflect.apply(Ne.t,Ne,[...ge]),Ne=>Ne,Ne=>yt(Ne))}function V(...ge){const[Ne,et,rt]=ge;if(rt&&!on(rt))throw Ls(vs.INVALID_ARGUMENT);return K(Ne,et,_o({resolvedMessage:!0},rt||{}))}function X(...ge){return Z(Ne=>Reflect.apply($x,null,[Ne,...ge]),()=>Gg(...ge),"datetime format",Ne=>Reflect.apply(Ne.d,Ne,[...ge]),()=>ip,Ne=>yt(Ne)||io(Ne))}function he(...ge){return Z(Ne=>Reflect.apply(Ox,null,[Ne,...ge]),()=>Yg(...ge),"number format",Ne=>Reflect.apply(Ne.n,Ne,[...ge]),()=>ip,Ne=>yt(Ne)||io(Ne))}function ne(ge){return ge.map(Ne=>yt(Ne)||wo(Ne)||nn(Ne)?Px(String(Ne)):Ne)}const de={normalize:ne,interpolate:ge=>ge,type:"vnode"};function Ce(...ge){return Z(Ne=>{let et;const rt=Ne;try{rt.processor=de,et=Reflect.apply(Dx,null,[rt,...ge])}finally{rt.processor=null}return et},()=>Zg(...ge),"translate",Ne=>Ne[Qg](...ge),Ne=>[Px(Ne)],Ne=>io(Ne))}function Ie(...ge){return Z(Ne=>Reflect.apply(Ox,null,[Ne,...ge]),()=>Yg(...ge),"number format",Ne=>Ne[Jg](...ge),Wx,Ne=>yt(Ne)||io(Ne))}function le(...ge){return Z(Ne=>Reflect.apply($x,null,[Ne,...ge]),()=>Gg(...ge),"datetime format",Ne=>Ne[Xg](...ge),Wx,Ne=>yt(Ne)||io(Ne))}function z(ge){$=ge,I.pluralRules=$}function ae(ge,Ne){return Z(()=>{if(!ge)return!1;const et=yt(Ne)?Ne:l.value,rt=yt(Ne)?[et]:Kg(I,a.value,et);for(let _t=0;_t<rt.length;_t++){const gt=ee(rt[_t]);let It=I.messageResolver(gt,ge);if(It===null&&(It=gt[ge]),sr(It)||hi(It)||yt(It))return!0}return!1},()=>[ge],"translate exists",et=>Reflect.apply(et.te,et,[ge,Ne]),K7,et=>nn(et))}function ie(ge){let Ne=null;const et=Kg(I,a.value,l.value);for(let rt=0;rt<et.length;rt++){const _t=c.value[et[rt]]||{},gt=I.messageResolver(_t,ge);if(gt!=null){Ne=gt;break}}return Ne}function q(ge){const Ne=ie(ge);return Ne??(t?t.tm(ge)||{}:{})}function ee(ge){return c.value[ge]||{}}function ye(ge,Ne){if(s){const et={[ge]:Ne};for(const rt in et)yi(et,rt)&&Ad(et[rt]);Ne=et[ge]}c.value[ge]=Ne,I.messages=c.value}function fe(ge,Ne){c.value[ge]=c.value[ge]||{};const et={[ge]:Ne};if(s)for(const rt in et)yi(et,rt)&&Ad(et[rt]);Ne=et[ge],yh(Ne,c.value[ge]),I.messages=c.value}function ve(ge){return u.value[ge]||{}}function j(ge,Ne){u.value[ge]=Ne,I.datetimeFormats=u.value,Fx(I,ge,Ne)}function te(ge,Ne){u.value[ge]=_o(u.value[ge]||{},Ne),I.datetimeFormats=u.value,Fx(I,ge,Ne)}function me(ge){return d.value[ge]||{}}function Ae(ge,Ne){d.value[ge]=Ne,I.numberFormats=d.value,Rx(I,ge,Ne)}function $e(ge,Ne){d.value[ge]=_o(d.value[ge]||{},Ne),I.numberFormats=d.value,Rx(I,ge,Ne)}zx++,t&&sp&&(Qe(t.locale,ge=>{r&&(l.value=ge,I.locale=ge,$u(I,l.value,a.value))}),Qe(t.fallbackLocale,ge=>{r&&(a.value=ge,I.fallbackLocale=ge,$u(I,l.value,a.value))}));const De={id:zx,locale:E,fallbackLocale:F,get inheritLocale(){return r},set inheritLocale(ge){r=ge,ge&&t&&(l.value=t.locale.value,a.value=t.fallbackLocale.value,$u(I,l.value,a.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:S,get modifiers(){return A},get pluralRules(){return $||{}},get isGlobal(){return o},get missingWarn(){return f},set missingWarn(ge){f=ge,I.missingWarn=f},get fallbackWarn(){return h},set fallbackWarn(ge){h=ge,I.fallbackWarn=h},get fallbackRoot(){return p},set fallbackRoot(ge){p=ge},get fallbackFormat(){return g},set fallbackFormat(ge){g=ge,I.fallbackFormat=g},get warnHtmlMessage(){return y},set warnHtmlMessage(ge){y=ge,I.warnHtmlMessage=ge},get escapeParameter(){return k},set escapeParameter(ge){k=ge,I.escapeParameter=ge},t:K,getLocaleMessage:ee,setLocaleMessage:ye,mergeLocaleMessage:fe,getPostTranslationHandler:B,setPostTranslationHandler:U,getMissingHandler:H,setMissingHandler:P,[hA]:z};return De.datetimeFormats=N,De.numberFormats=D,De.rt=V,De.te=ae,De.tm=q,De.d=X,De.n=he,De.getDateTimeFormat=ve,De.setDateTimeFormat=j,De.mergeDateTimeFormat=te,De.getNumberFormat=me,De.setNumberFormat=Ae,De.mergeNumberFormat=$e,De[pA]=n,De[Qg]=Ce,De[Xg]=le,De[Jg]=Ie,De}function Y7(e){const t=yt(e.locale)?e.locale:Cd,n=yt(e.fallbackLocale)||io(e.fallbackLocale)||Jt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,o=Kn(e.missing)?e.missing:void 0,s=nn(e.silentTranslationWarn)||Qc(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,i=nn(e.silentFallbackWarn)||Qc(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,r=nn(e.fallbackRoot)?e.fallbackRoot:!0,l=!!e.formatFallbackMessages,a=Jt(e.modifiers)?e.modifiers:{},c=e.pluralizationRules,u=Kn(e.postTranslation)?e.postTranslation:void 0,d=yt(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,f=!!e.escapeParameterHtml,h=nn(e.sync)?e.sync:!0;let p=e.messages;if(Jt(e.sharedMessages)){const A=e.sharedMessages;p=Object.keys(A).reduce((I,x)=>{const L=I[x]||(I[x]={});return _o(L,A[x]),I},p||{})}const{__i18n:g,__root:b,__injectWithOption:v}=e,m=e.datetimeFormats,y=e.numberFormats,k=e.flatJson;return{locale:t,fallbackLocale:n,messages:p,flatJson:k,datetimeFormats:m,numberFormats:y,missing:o,missingWarn:s,fallbackWarn:i,fallbackRoot:r,fallbackFormat:l,modifiers:a,pluralRules:c,postTranslation:u,warnHtmlMessage:d,escapeParameter:f,messageResolver:e.messageResolver,inheritLocale:h,__i18n:g,__root:b,__injectWithOption:v}}function ev(e={}){const t=rp(Y7(e)),{__extender:n}=e,o={id:t.id,get locale(){return t.locale.value},set locale(s){t.locale.value=s},get fallbackLocale(){return t.fallbackLocale.value},set fallbackLocale(s){t.fallbackLocale.value=s},get messages(){return t.messages.value},get datetimeFormats(){return t.datetimeFormats.value},get numberFormats(){return t.numberFormats.value},get availableLocales(){return t.availableLocales},get missing(){return t.getMissingHandler()},set missing(s){t.setMissingHandler(s)},get silentTranslationWarn(){return nn(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(s){t.missingWarn=nn(s)?!s:s},get silentFallbackWarn(){return nn(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(s){t.fallbackWarn=nn(s)?!s:s},get modifiers(){return t.modifiers},get formatFallbackMessages(){return t.fallbackFormat},set formatFallbackMessages(s){t.fallbackFormat=s},get postTranslation(){return t.getPostTranslationHandler()},set postTranslation(s){t.setPostTranslationHandler(s)},get sync(){return t.inheritLocale},set sync(s){t.inheritLocale=s},get warnHtmlInMessage(){return t.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(s){t.warnHtmlMessage=s!=="off"},get escapeParameterHtml(){return t.escapeParameter},set escapeParameterHtml(s){t.escapeParameter=s},get pluralizationRules(){return t.pluralRules||{}},__composer:t,t(...s){return Reflect.apply(t.t,t,[...s])},rt(...s){return Reflect.apply(t.rt,t,[...s])},te(s,i){return t.te(s,i)},tm(s){return t.tm(s)},getLocaleMessage(s){return t.getLocaleMessage(s)},setLocaleMessage(s,i){t.setLocaleMessage(s,i)},mergeLocaleMessage(s,i){t.mergeLocaleMessage(s,i)},d(...s){return Reflect.apply(t.d,t,[...s])},getDateTimeFormat(s){return t.getDateTimeFormat(s)},setDateTimeFormat(s,i){t.setDateTimeFormat(s,i)},mergeDateTimeFormat(s,i){t.mergeDateTimeFormat(s,i)},n(...s){return Reflect.apply(t.n,t,[...s])},getNumberFormat(s){return t.getNumberFormat(s)},setNumberFormat(s,i){t.setNumberFormat(s,i)},mergeNumberFormat(s,i){t.mergeNumberFormat(s,i)}};return o.__extender=n,o}function Z7(e,t,n){return{beforeCreate(){const o=Md();if(!o)throw Ls(vs.UNEXPECTED_ERROR);const s=this.$options;if(s.i18n){const i=s.i18n;if(s.__i18n&&(i.__i18n=s.__i18n),i.__root=t,this===this.$root)this.$i18n=qx(e,i);else{i.__injectWithOption=!0,i.__extender=n.__vueI18nExtend,this.$i18n=ev(i);const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}}else if(s.__i18n)if(this===this.$root)this.$i18n=qx(e,s);else{this.$i18n=ev({__i18n:s.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:t});const i=this.$i18n;i.__extender&&(i.__disposer=i.__extender(this.$i18n))}else this.$i18n=e;s.__i18nGlobal&&gA(t,s,s),this.$t=(...i)=>this.$i18n.t(...i),this.$rt=(...i)=>this.$i18n.rt(...i),this.$te=(i,r)=>this.$i18n.te(i,r),this.$d=(...i)=>this.$i18n.d(...i),this.$n=(...i)=>this.$i18n.n(...i),this.$tm=i=>this.$i18n.tm(i),n.__setInstance(o,this.$i18n)},mounted(){},unmounted(){const o=Md();if(!o)throw Ls(vs.UNEXPECTED_ERROR);const s=this.$i18n;delete this.$t,delete this.$rt,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,s.__disposer&&(s.__disposer(),delete s.__disposer,delete s.__extender),n.__deleteInstance(o),delete this.$i18n}}}function qx(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[hA](t.pluralizationRules||e.pluralizationRules);const n=Ry(e.locale,{messages:t.messages,__i18n:t.__i18n});return Object.keys(n).forEach(o=>e.mergeLocaleMessage(o,n[o])),t.datetimeFormats&&Object.keys(t.datetimeFormats).forEach(o=>e.mergeDateTimeFormat(o,t.datetimeFormats[o])),t.numberFormats&&Object.keys(t.numberFormats).forEach(o=>e.mergeNumberFormat(o,t.numberFormats[o])),e}const By={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function Q7({slots:e},t){return t.length===1&&t[0]==="default"?(e.default?e.default():[]).reduce((o,s)=>[...o,...s.type===Pe?s.children:[s]],[]):t.reduce((n,o)=>{const s=e[o];return s&&(n[o]=s()),n},Sn())}function vA(){return Pe}const X7=Ze({name:"i18n-t",props:_o({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>wo(e)||!isNaN(e)}},By),setup(e,t){const{slots:n,attrs:o}=t,s=e.i18n||Tt({useScope:e.scope,__useComponent:!0});return()=>{const i=()=>{const a=Object.keys(n).filter(d=>d[0]!=="_"),c=Sn();e.locale&&(c.locale=e.locale),e.plural!==void 0&&(c.plural=yt(e.plural)?+e.plural:e.plural);const u=Q7(t,a);return s[Qg](e.keypath,u,c)},r=_o(Sn(),o),l=yt(e.tag)||on(e.tag)?e.tag:vA();return on(l)?mn(l,r,{default:i}):mn(l,r,i())}}}),jx=X7;function J7(e){return io(e)&&!yt(e[0])}function yA(e,t,n,o){const{slots:s,attrs:i}=t;return()=>{const r=()=>{const c={part:!0};let u=Sn();e.locale&&(c.locale=e.locale),yt(e.format)?c.key=e.format:on(e.format)&&(yt(e.format.key)&&(c.key=e.format.key),u=Object.keys(e.format).reduce((h,p)=>n.includes(p)?_o(Sn(),h,{[p]:e.format[p]}):h,Sn()));const d=o(e.value,c,u);let f=[c.key];return io(d)?f=d.map((h,p)=>{const g=s[h.type],b=g?g({[h.type]:h.value,index:p,parts:d}):[h.value];return J7(b)&&(b[0].key=`${h.type}-${p}`),b}):yt(d)&&(f=[d]),f},l=_o(Sn(),i),a=yt(e.tag)||on(e.tag)?e.tag:vA();return on(a)?mn(a,l,{default:r}):mn(a,l,r())}}const eI=Ze({name:"i18n-n",props:_o({value:{type:Number,required:!0},format:{type:[String,Object]}},By),setup(e,t){const n=e.i18n||Tt({useScope:e.scope,__useComponent:!0});return yA(e,t,uA,(...o)=>n[Jg](...o))}}),Vx=eI;function tI(e,t){const n=e;if(e.mode==="composition")return n.__getInstance(t)||e.global;{const o=n.__getInstance(t);return o!=null?o.__composer:e.global.__composer}}function nI(e){const t=r=>{const{instance:l,value:a}=r;if(!l||!l.$)throw Ls(vs.UNEXPECTED_ERROR);const c=tI(e,l.$),u=Kx(a);return[Reflect.apply(c.t,c,[...Gx(u)]),c]};return{created:(r,l)=>{const[a,c]=t(l);sp&&(r.__i18nWatcher=Qe(c.locale,()=>{l.instance&&l.instance.$forceUpdate()})),r.__composer=c,r.textContent=a},unmounted:r=>{sp&&r.__i18nWatcher&&(r.__i18nWatcher(),r.__i18nWatcher=void 0,delete r.__i18nWatcher),r.__composer&&(r.__composer=void 0,delete r.__composer)},beforeUpdate:(r,{value:l})=>{if(r.__composer){const a=r.__composer,c=Kx(l);r.textContent=Reflect.apply(a.t,a,[...Gx(c)])}},getSSRProps:r=>{const[l]=t(r);return{textContent:l}}}}function Kx(e){if(yt(e))return{path:e};if(Jt(e)){if(!("path"in e))throw Ls(vs.REQUIRED_VALUE,"path");return e}else throw Ls(vs.INVALID_VALUE)}function Gx(e){const{path:t,locale:n,args:o,choice:s,plural:i}=e,r={},l=o||{};return yt(n)&&(r.locale=n),wo(s)&&(r.plural=s),wo(i)&&(r.plural=i),[t,l,r]}function oI(e,t,...n){const o=Jt(n[0])?n[0]:{};(nn(o.globalInstall)?o.globalInstall:!0)&&([jx.name,"I18nT"].forEach(i=>e.component(i,jx)),[Vx.name,"I18nN"].forEach(i=>e.component(i,Vx)),[Qx.name,"I18nD"].forEach(i=>e.component(i,Qx))),e.directive("t",nI(t))}const sI=Bl("global-vue-i18n");function iI(e={}){const t=__VUE_I18N_LEGACY_API__&&nn(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,n=nn(e.globalInjection)?e.globalInjection:!0,o=new Map,[s,i]=rI(e,t),r=Bl("");function l(d){return o.get(d)||null}function a(d,f){o.set(d,f)}function c(d){o.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),Jt(f[0])){const g=f[0];u.__composerExtend=g.__composerExtend,u.__vueI18nExtend=g.__vueI18nExtend}let h=null;!t&&n&&(h=hI(d,u.global)),__VUE_I18N_FULL_INSTALL__&&oI(d,u,...f),__VUE_I18N_LEGACY_API__&&t&&d.mixin(Z7(i,i.__composer,u));const p=d.unmount;d.unmount=()=>{h&&h(),u.dispose(),p()}},get global(){return i},dispose(){s.stop()},__instances:o,__getInstance:l,__setInstance:a,__deleteInstance:c};return u}function Tt(e={}){const t=Md();if(t==null)throw Ls(vs.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw Ls(vs.NOT_INSTALLED);const n=lI(t),o=cI(n),s=mA(t),i=aI(e,s);if(i==="global")return gA(o,e,s),o;if(i==="parent"){let a=Yx(n,t,e.__useComponent);return a==null&&(a=o),a}if(i==="isolated"){if(n.mode!=="composition")throw Ls(vs.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const a=n,c=_o({},e),u=Yx(n,t);c.__root=u||o;const d=rp(c);return a.__composerExtend&&(d[_c]=a.__composerExtend(d)),uy()&&dy(()=>{const h=d[_c];h&&(h(),delete d[_c])}),d}const r=n;let l=r.__getInstance(t);if(l==null){const a=_o({},e);"__i18n"in s&&(a.__i18n=s.__i18n),o&&(a.__root=o),l=rp(a),r.__composerExtend&&(l[_c]=r.__composerExtend(l)),dI(r,t,l),r.__setInstance(t,l)}return l}function rI(e,t){const n=LE(),o=__VUE_I18N_LEGACY_API__&&t?n.run(()=>ev(e)):n.run(()=>rp(e));if(o==null)throw Ls(vs.UNEXPECTED_ERROR);return[n,o]}function lI(e){const t=Kt(e.isCE?sI:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw Ls(e.isCE?vs.NOT_INSTALLED_WITH_PROVIDE:vs.UNEXPECTED_ERROR);return t}function aI(e,t){return mm(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function cI(e){return e.mode==="composition"?e.global:e.global.__composer}function Yx(e,t,n=!1){let o=null;const s=t.root;let i=uI(t,n);for(;i!=null;){const r=e;if(e.mode==="composition")o=r.__getInstance(i);else if(__VUE_I18N_LEGACY_API__){const l=r.__getInstance(i);l!=null&&(o=l.__composer,n&&o&&!o[pA]&&(o=null))}if(o!=null||s===i)break;i=i.parent}return o}function uI(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function dI(e,t,n){cn(()=>{},t),bn(()=>{const o=n;e.__deleteInstance(t);const s=o[_c];s&&(s(),delete o[_c])},t)}const fI=["locale","fallbackLocale","availableLocales"],Zx=["t","rt","d","n","tm","te"];function hI(e,t){const n=Object.create(null);return fI.forEach(s=>{const i=Object.getOwnPropertyDescriptor(t,s);if(!i)throw Ls(vs.UNEXPECTED_ERROR);const r=ho(i.value)?{get(){return i.value.value},set(l){i.value.value=l}}:{get(){return i.get&&i.get()}};Object.defineProperty(n,s,r)}),e.config.globalProperties.$i18n=n,Zx.forEach(s=>{const i=Object.getOwnPropertyDescriptor(t,s);if(!i||!i.value)throw Ls(vs.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${s}`,i)}),()=>{delete e.config.globalProperties.$i18n,Zx.forEach(s=>{delete e.config.globalProperties[`$${s}`]})}}const pI=Ze({name:"i18n-d",props:_o({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},By),setup(e,t){const n=e.i18n||Tt({useScope:e.scope,__useComponent:!0});return yA(e,t,cA,(...o)=>n[Xg](...o))}}),Qx=pI;V7();C7(r7);A7(w7);M7(Kg);if(__INTLIFY_PROD_DEVTOOLS__){const e=ya();e.__INTLIFY__=!0,l7(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const mI="modulepreload",gI=function(e){return"/"+e},Xx={},ms=function(t,n,o){let s=Promise.resolve();if(n&&n.length>0){let r=function(c){return Promise.all(c.map(u=>Promise.resolve(u).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),a=l?.nonce||l?.getAttribute("nonce");s=r(n.map(c=>{if(c=gI(c),c in Xx)return;Xx[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":mI,u||(f.as="script"),f.crossOrigin="",f.href=c,a&&f.setAttribute("nonce",a),document.head.appendChild(f),u)return new Promise((h,p)=>{f.addEventListener("load",h),f.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(r){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=r,window.dispatchEvent(l),!l.defaultPrevented)throw r}return s.then(r=>{for(const l of r||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})},Ft={permission:"kimi-web.permission",activeWorkspace:"kimi-active-workspace",planMode:"kimi-web.plan-mode",swarmMode:"kimi-web.swarm-mode",goalMode:"kimi-web.goal-mode",uiFontSize:"kimi-web.ui-font-size",starredModels:"kimi-web.starred-models",unread:"kimi-web.unread",onboarded:"kimi-web.onboarded",accent:"kimi-web.accent",colorScheme:"kimi-web.color-scheme",hiddenWorkspaces:"kimi-web.hidden-workspaces",collapsedWorkspaces:"kimi-web.collapsed-workspaces",workspaceOrder:"kimi-web.workspace-order",workspaceNameOverrides:"kimi-web.workspace-name-overrides",workspaceSort:"kimi-web.workspace-sort",conversationToc:"kimi-web.beta-toc",notifyOnComplete:"kimi-web.notify-on-complete",notifyOnQuestion:"kimi-web.notify-on-question",notifyOnApproval:"kimi-web.notify-on-approval",soundOnComplete:"kimi-web.sound-on-complete",inputHistory:"kimi-web.input-history",locale:"kimi-locale",clientId:"kimi-web.client-id",debug:"kimi-web.debug",openInLastTarget:"kimi-web.open-in.last-target",sidebarCollapsed:"kimi-web.sidebar-collapsed",sidebarWidth:"kimi-web.sidebar-width",codeFont:"kimi-web.code-font",contentAlign:"kimi-web.content-align",theme:"kimi-web.theme",thinking:"kimi-web.thinking"};function Jx(e){return`kimi-web.draft.${e&&e.length>0?e:"__new__"}`}function mo(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function So(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function Na(e){try{globalThis.localStorage.removeItem(e)}catch{}}function ym(e){const t=mo(e);if(t===null)return null;try{return JSON.parse(t)}catch{return null}}function Gd(e,t){try{globalThis.localStorage.setItem(e,JSON.stringify(t))}catch{}}function Dy(){const e=mo(Ft.unread);if(!e)return{};try{const t=JSON.parse(e);if(!t||typeof t!="object")return{};const n={};for(const[o,s]of Object.entries(t))s===!0&&(n[o]=!0);return n}catch{return{}}}function Py(e){const n={...Dy()};for(const[o,s]of Object.entries(e))s?n[o]=!0:delete n[o];So(Ft.unread,JSON.stringify(n))}function vI(){const e=ym(Ft.collapsedWorkspaces);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function u0(e){Gd(Ft.collapsedWorkspaces,Array.from(e))}function yI(){const e=ym(Ft.workspaceOrder);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function kA(e){Gd(Ft.workspaceOrder,Array.from(e))}function zf(){const e=ym(Ft.workspaceNameOverrides);if(!e||typeof e!="object")return{};const t={};for(const[n,o]of Object.entries(e))typeof o=="string"&&(t[n]=o);return t}function ew(e){Gd(Ft.workspaceNameOverrides,e)}function kI(){return mo(Ft.workspaceSort)}function bA(e){So(Ft.workspaceSort,e)}const tw=Ft.clientId,bI="kimi-code-web",xI="web";function wI(){return{serverHttpUrl:SI(),clientId:EI(),clientName:bI,clientVersion:TI(),clientUiMode:xI}}function _I(){return typeof window<"u"&&window.location?.origin?window.location.origin:"http://127.0.0.1:58627"}function SI(e){const t=_I(),n=new URL(t);return n.pathname=n.pathname.replace(/\/v1\/?$/,"").replace(/\/$/,""),n.search="",n.hash="",n.toString().replace(/\/$/,"")}function CI(e){return e.replace(/^https?:\/\//,"").replace(/\/$/,"")}function AI(){const e=typeof window<"u"&&window.location?.origin?window.location.origin:"";return CI(e)}function Sc(e,t){return`${e}/api/v1${t.startsWith("/")?t:`/${t}`}`}function MI(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 EI(){const e=mo(tw);if(e)return e;const t=`web_${globalThis.crypto?.randomUUID?.()||Math.random().toString(36).slice(2)}`;return So(tw,t),t}function TI(){return"0.1.2".trim()?"0.1.2":"0.0.0-dev"}async function NI(e){try{const t=await fetch("/__kimi-dev/backend",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e})});return t.ok?await t.json():null}catch{return null}}function II(e){return e.replace(/^https?:\/\//,"").replace(/\/$/,"")}async function Go(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 LI(e)}function LI(e){if(typeof document>"u"||typeof document.execCommand!="function")return!1;const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.top="-9999px",t.style.left="-9999px",t.style.opacity="0",document.body.appendChild(t);let n=!1;try{t.focus(),t.select(),n=document.execCommand("copy")}catch{n=!1}finally{document.body.removeChild(t)}return n}function $I(e,t){if(e.length===0)return null;const n=new Set(e),o=t.filter(i=>n.has(i)),s=e.filter(i=>!t.includes(i));return s.length===0&&o.length===t.length?null:[...s,...o]}function FI(e,t){const n=new Map(t.map((o,s)=>[o,s]));return e.toSorted((o,s)=>(n.get(o.id)??-1)-(n.get(s.id)??-1))}function OI(e,t,n,o="before"){const s=e.indexOf(t),i=e.indexOf(n);if(s===-1||i===-1||s===i)return e;const r=[...e];r.splice(s,1);const l=s<i?i-1:i,a=o==="before"?l:l+1;return r.splice(a,0,t),r}function RI(e,t){return e.toSorted((n,o)=>(t.get(o.id)??Number.NEGATIVE_INFINITY)-(t.get(n.id)??Number.NEGATIVE_INFINITY))}const BI={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function nw(e){return e.replace(/[&<>"']/g,t=>BI[t]??t)}function DI(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function PI(e,t,n=40){const o=e.replace(/\s+/g," ").trim();if(o.length===0)return"";const s=t.trim();if(s.length===0)return ow(o,n*2);const i=o.toLowerCase().indexOf(s.toLowerCase());if(i<0)return ow(o,n*2);const r=Math.max(0,i-n),l=Math.min(o.length,i+s.length+n),a=r>0,c=l<o.length;return`${a?"…":""}${o.slice(r,l)}${c?"…":""}`}function ow(e,t){return e.length<=t?e:`${e.slice(0,t)}…`}function d0(e,t){const n=nw(e),o=t.trim();if(o.length===0)return n;const s=new RegExp(DI(nw(o)),"gi");return n.replace(s,i=>`<mark>${i}</mark>`)}const vc=J(0),HI=["type","disabled","aria-label"],WI=Ze({__name:"IconButton",props:{size:{default:"md"},disabled:{type:Boolean},label:{},type:{default:"button"}},setup(e,{expose:t}){const n=J();return t({el:n}),(o,s)=>(w(),T("button",{ref_key:"el",ref:n,class:We(["ui-icon-button",`ui-icon-button--${e.size}`]),type:e.type,disabled:e.disabled,"aria-label":e.label},[On(o.$slots,"default",{},void 0,!0)],10,HI))}}),ct=(e,t)=>{const n=e.__vccOpts||e;for(const[o,s]of t)n[o]=s;return n},Pn=ct(WI,[["__scopeId","data-v-c9e67023"]]),zI={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function UI(e,t){return w(),T("svg",zI,[...t[0]||(t[0]=[_("path",{d:"M11.1 12.9001V15.0909C11.1 15.593 11.5029 16 12 16C12.4971 16 12.9 15.593 12.9 15.0909V12.9001H15.0909C15.593 12.9001 16 12.4972 16 12.0001C16 11.5031 15.593 11.1001 15.0909 11.1001H12.9V8.90909C12.9 8.40701 12.4971 8 12 8C11.5029 8 11.1 8.40701 11.1 8.90909V11.1001H8.90909C8.40701 11.1001 8 11.5031 8 12.0001C8 12.4972 8.40701 12.9001 8.90909 12.9001H11.1Z",fill:"currentColor"},null,-1),_("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.9996 2.1001C6.53199 2.1001 2.09961 6.53248 2.09961 12.0001C2.09961 13.9226 2.64847 15.7192 3.59804 17.2391L2.517 19.8207C2.10313 20.8091 2.82908 21.9001 3.90059 21.9001H11.9996C17.4672 21.9001 21.8996 17.4677 21.8996 12.0001C21.8996 6.53248 17.4672 2.1001 11.9996 2.1001ZM3.89961 12.0001C3.89961 7.52659 7.5261 3.9001 11.9996 3.9001C16.4731 3.9001 20.0996 7.52659 20.0996 12.0001C20.0996 16.4736 16.4724 20.1001 11.9989 20.1001H4.35146L5.63494 17.0351L5.35165 16.6291C4.43632 15.3172 3.89961 13.7227 3.89961 12.0001Z",fill:"currentColor"},null,-1)])])}const qI=pt({name:"kimi-add-conversation",render:UI}),jI={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function VI(e,t){return w(),T("svg",jI,[...t[0]||(t[0]=[_("path",{d:"M9.2373 3.7002C10.4169 3.7002 11.5297 4.24779 12.249 5.18262L12.4424 5.43359H18C20.0987 5.43359 21.7998 7.13472 21.7998 9.2334V16.5C21.7998 18.5987 20.0987 20.2998 18 20.2998H6C3.90132 20.2998 2.2002 18.5987 2.2002 16.5V7.5C2.2002 5.40132 3.90132 3.7002 6 3.7002H9.2373ZM6 5.5C4.89543 5.5 4 6.39543 4 7.5V16.5C4 17.6046 4.89543 18.5 6 18.5H18C19.0357 18.5 19.887 17.7128 19.9893 16.7041L20 16.5V9.2334C20 8.19775 19.2128 7.34641 18.2041 7.24414L18 7.2334H12.0479L11.9326 7.22656C11.666 7.19561 11.4205 7.05812 11.2549 6.84277L10.8223 6.28027C10.4437 5.78834 9.85808 5.5 9.2373 5.5H6ZM16 9.59961C16.4971 9.59961 16.9004 10.0029 16.9004 10.5C16.9004 10.9971 16.4971 11.4004 16 11.4004H8C7.50294 11.4004 7.09961 10.9971 7.09961 10.5C7.09961 10.0029 7.50294 9.59961 8 9.59961H16Z",fill:"currentColor"},null,-1)])])}const KI=pt({name:"kimi-folder",render:VI}),GI={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},YI=["clip-path"],ZI=["id"];function QI(e,t){return w(),T("svg",GI,[_("g",{"clip-path":"url(#"+e.idMap.clip0_4626_2033+")"},[...t[0]||(t[0]=[_("path",{d:"M18.3623 9.99976L18.209 8.48999C18.2031 8.43161 18.2004 8.37289 18.2002 8.31421C18.1988 8.31196 18.1956 8.30842 18.1904 8.30347C18.1718 8.28559 18.1302 8.26245 18.0713 8.26245H11C10.261 8.26245 9.59753 7.81016 9.32617 7.1228L8.9082 6.06421C8.88101 5.9953 8.85737 5.92501 8.83887 5.85327C8.83778 5.85099 8.833 5.84268 8.81836 5.83179C8.79454 5.81475 8.7549 5.79939 8.70605 5.80054H3.92871C3.86986 5.80054 3.82825 5.82368 3.80957 5.84155C3.80816 5.8429 3.80675 5.84428 3.80566 5.84546L4.47559 14.0955L3.62109 17.5154L5.12109 11.5154C5.34367 10.6251 6.1438 9.99977 7.06152 9.99976H18.3623ZM7.06152 11.7996C6.96976 11.7996 6.88944 11.8629 6.86719 11.9519L5.36719 17.9519C5.33598 18.078 5.43158 18.1999 5.56152 18.2H19.4385C19.5302 18.1999 19.6106 18.1376 19.6328 18.0486L21.1328 12.0486C21.1644 11.9224 21.0686 11.7996 20.9385 11.7996H7.06152ZM20.9385 9.99976C22.2396 9.99977 23.1945 11.2228 22.8789 12.4851L21.3789 18.4851C21.1563 19.3754 20.3562 19.9997 19.4385 19.9998H4.92871C4.41722 19.9998 3.92613 19.8059 3.56445 19.4597C3.20281 19.1135 3.00004 18.6436 3 18.1541L2 5.84644C2.00006 5.35711 2.20311 4.88786 2.56445 4.54175C2.92613 4.19554 3.41722 4.00073 3.92871 4.00073H8.66406C9.10133 3.99051 9.5296 4.1225 9.87793 4.37573C10.2285 4.63118 10.4767 4.99457 10.582 5.40405L11 6.46167H18.0713C18.5828 6.46167 19.0739 6.65648 19.4355 7.00269C19.7971 7.34888 20 7.81883 20 8.30835L20.1719 9.99976H20.9385Z",fill:"currentColor"},null,-1)])],8,YI),_("defs",null,[_("clipPath",{id:e.idMap.clip0_4626_2033},[...t[1]||(t[1]=[_("rect",{width:"24",height:"24",fill:"white"},null,-1)])],8,ZI)])])}const XI=pt({name:"kimi-folder-open",render:QI,setup(){return{idMap:{clip0_4626_2033:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),JI={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function eL(e,t){return w(),T("svg",JI,[...t[0]||(t[0]=[_("path",{d:"M6 12C6 12.8283 5.32834 13.5 4.5 13.5C3.67166 13.5 3 12.8283 3 12C3 11.1717 3.67166 10.5 4.5 10.5C5.32834 10.5 6 11.1717 6 12Z",fill:"currentColor"},null,-1),_("path",{d:"M13.5 12C13.5 12.8283 12.8283 13.5 12 13.5C11.1717 13.5 10.5 12.8283 10.5 12C10.5 11.1717 11.1717 10.5 12 10.5C12.8283 10.5 13.5 11.1717 13.5 12Z",fill:"currentColor"},null,-1),_("path",{d:"M19.5002 13.5C20.3287 13.5 21 12.8287 21 12.0002C21 11.1718 20.3287 10.5 19.5002 10.5C18.6718 10.5 18 11.1718 18 12.0002C18 12.8287 18.6718 13.5 19.5002 13.5Z",fill:"currentColor"},null,-1)])])}const tL=pt({name:"kimi-more",render:eL}),nL={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function oL(e,t){return w(),T("svg",nL,[...t[0]||(t[0]=[_("path",{d:"M11.5 3C16.1944 3 20 6.80558 20 11.5C20 13.523 19.2933 15.381 18.1132 16.8404L21.1364 19.8636C21.4879 20.2151 21.4879 20.7849 21.1364 21.1364C20.7849 21.4879 20.2151 21.4879 19.8636 21.1364L16.8404 18.1132C15.381 19.2933 13.523 20 11.5 20C6.80558 20 3 16.1944 3 11.5C3 6.80558 6.80558 3 11.5 3ZM11.5 18.2C15.2003 18.2 18.2 15.2003 18.2 11.5C18.2 7.79969 15.2003 4.8 11.5 4.8C7.79969 4.8 4.8 7.79969 4.8 11.5C4.8 15.2003 7.79969 18.2 11.5 18.2Z",fill:"currentColor"},null,-1)])])}const sL=pt({name:"kimi-search",render:oL}),iL={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function rL(e,t){return w(),T("svg",iL,[...t[0]||(t[0]=[_("path",{d:"M16.0404 12C16.0404 9.76874 14.2313 7.9596 12.0001 7.9596C9.76883 7.9596 7.95972 9.76874 7.95972 12C7.95972 14.2313 9.76883 16.0404 12.0001 16.0404C14.2313 16.0404 16.0404 14.2313 16.0404 12ZM14.2222 12C14.2222 13.2271 13.2271 14.2222 12 14.2222C10.7729 14.2222 9.77783 13.2271 9.77783 12C9.77783 10.7729 10.7729 9.77778 12 9.77778C13.2271 9.77778 14.2222 10.7729 14.2222 12Z",fill:"currentColor"},null,-1),_("path",{d:"M9.91145 21.8009C9.29001 21.6797 8.76914 21.2612 8.50632 20.6922L8.07372 19.7556C7.88838 19.3544 7.43553 19.1048 6.95371 19.1549L5.89572 19.2647C5.2733 19.3293 4.64823 19.114 4.22298 18.6611C3.74343 18.1504 3.32454 17.6037 2.97033 17.0181C2.61571 16.4318 2.32839 15.8106 2.10407 15.1566C1.89769 14.5549 2.02148 13.8954 2.4089 13.3902L3.0376 12.5704C3.30043 12.2277 3.30042 11.7722 3.03758 11.4295L2.40413 10.6035C2.01474 10.0958 1.891 9.43198 2.10208 8.82826C2.55037 7.54612 3.27017 6.35997 4.22 5.34259C4.64518 4.8872 5.27275 4.67067 5.89701 4.73544L6.95383 4.84514C7.43561 4.89515 7.88844 4.6456 8.07377 4.24441L8.50266 3.31593C8.76494 2.74818 9.28448 2.33019 9.90423 2.20761C11.2916 1.9332 12.7148 1.93127 14.0885 2.19913C14.7099 2.32029 15.2308 2.73881 15.4937 3.3078L15.9263 4.24441C16.1116 4.6456 16.5644 4.89514 17.0462 4.84514L18.1043 4.73532C18.7267 4.67072 19.3518 4.88603 19.777 5.33886C20.2566 5.84953 20.6755 6.3963 21.0297 6.98193C21.3843 7.56823 21.6716 8.18942 21.8959 8.84339C22.1023 9.44509 21.9785 10.1046 21.5911 10.6098L20.9624 11.4295C20.6996 11.7722 20.6996 12.2278 20.9624 12.5705L21.5959 13.3964C21.9853 13.9042 22.109 14.568 21.8979 15.1717C21.4497 16.4538 20.7299 17.6399 19.7801 18.6573C19.3549 19.1128 18.7273 19.3294 18.103 19.2646L17.0462 19.1549C16.5645 19.1049 16.1116 19.3544 15.9263 19.7556L15.4974 20.6841C15.2351 21.2518 14.7156 21.6698 14.0958 21.7924C12.7083 22.0668 11.2852 22.0687 9.91145 21.8009ZM13.7432 20.0088C13.7844 20.0006 13.8259 19.9673 13.847 19.9216L14.2758 18.9931C14.7915 17.8768 15.9886 17.2171 17.2341 17.3464L18.2909 17.4561C18.3649 17.4638 18.4272 17.4423 18.4512 17.4166C19.2296 16.5828 19.8171 15.6146 20.1817 14.5716C20.1845 14.5636 20.1796 14.5373 20.1532 14.5029L19.5198 13.677C18.7564 12.6815 18.7564 11.3185 19.5198 10.323L20.1485 9.5033C20.1746 9.46927 20.1795 9.4429 20.1762 9.43327C19.9932 8.89965 19.7603 8.39623 19.4741 7.92293C19.1873 7.4489 18.846 7.00333 18.4517 6.58351C18.4272 6.55739 18.3656 6.53616 18.2921 6.54378L17.234 6.65361C15.9886 6.78287 14.7915 6.12317 14.2758 5.00689L13.8432 4.07027C13.822 4.02448 13.7811 3.9916 13.7406 3.98371C12.5983 3.76097 11.4132 3.76258 10.2571 3.99124C10.2158 3.99941 10.1744 4.03271 10.1533 4.07842L9.72441 5.00689C9.20875 6.12317 8.01164 6.7829 6.76619 6.6536L5.70942 6.54391C5.63535 6.53623 5.573 6.55774 5.54905 6.5834C4.77067 7.41713 4.18312 8.38534 3.81845 9.42835C3.81564 9.43637 3.82054 9.46265 3.84693 9.49706L4.48038 10.323C5.24381 11.3185 5.24383 12.6815 4.48041 13.6769L3.85171 14.4967C3.82561 14.5307 3.82066 14.5571 3.82396 14.5667C4.00701 15.1004 4.23986 15.6038 4.52613 16.0771C4.81284 16.5511 5.15421 16.9967 5.54845 17.4165C5.57298 17.4426 5.63461 17.4638 5.70811 17.4562L6.76608 17.3464C8.01157 17.2171 9.20871 17.8768 9.72438 18.9932L10.157 19.9297C10.1781 19.9755 10.2191 20.0084 10.2595 20.0163C11.4018 20.239 12.587 20.2374 13.7432 20.0088Z",fill:"currentColor"},null,-1)])])}const lL=pt({name:"kimi-setting",render:rL}),aL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function cL(e,t){return w(),T("svg",aL,[...t[0]||(t[0]=[_("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[_("path",{d:"M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm5-2v16"}),_("path",{d:"m15 10l-2 2l2 2"})],-1)])])}const uL=pt({name:"tabler-layout-sidebar-left-collapse",render:cL}),dL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function fL(e,t){return w(),T("svg",dL,[...t[0]||(t[0]=[_("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[_("path",{d:"M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm5-2v16"}),_("path",{d:"m14 10l2 2l-2 2"})],-1)])])}const hL=pt({name:"tabler-layout-sidebar-left-expand",render:fL}),pL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function mL(e,t){return w(),T("svg",pL,[...t[0]||(t[0]=[_("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m15 7l-6.5 6.5a1.5 1.5 0 0 0 3 3L18 10a3 3 0 0 0-6-6l-6.5 6.5a4.5 4.5 0 0 0 9 9L21 13"},null,-1)])])}const gL=pt({name:"tabler-paperclip",render:mL}),vL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function yL(e,t){return w(),T("svg",vL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"},null,-1)])])}const kL=pt({name:"ri-add-line",render:yL}),bL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function xL(e,t){return w(),T("svg",bL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m12.866 3l9.526 16.5a1 1 0 0 1-.866 1.5H2.474a1 1 0 0 1-.866-1.5L11.134 3a1 1 0 0 1 1.732 0m-8.66 16h15.588L12 5.5zM11 16h2v2h-2zm0-7h2v5h-2z"},null,-1)])])}const wL=pt({name:"ri-alert-line",render:xL}),_L={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function SL(e,t){return w(),T("svg",_L,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M3 10H2V4.003C2 3.449 2.455 3 2.992 3h18.016A.99.99 0 0 1 22 4.003V10h-1v10.002a.996.996 0 0 1-.993.998H3.993A.996.996 0 0 1 3 20.002zm16 0H5v9h14zM4 5v3h16V5zm5 7h6v2H9z"},null,-1)])])}const CL=pt({name:"ri-archive-line",render:SL}),AL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ML(e,t){return w(),T("svg",AL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m13 16.172l5.364-5.364l1.414 1.414L12 20l-7.778-7.778l1.414-1.414L11 16.172V4h2z"},null,-1)])])}const EL=pt({name:"ri-arrow-down-line",render:ML}),TL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function NL(e,t){return w(),T("svg",TL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m12 13.171l4.95-4.95l1.414 1.415L12 16L5.636 9.636L7.05 8.222z"},null,-1)])])}const IL=pt({name:"ri-arrow-down-s-line",render:NL}),LL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function $L(e,t){return w(),T("svg",LL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m5.828 7l2.536 2.535L6.95 10.95L2 6l4.95-4.95l1.414 1.415L5.828 5H13a8 8 0 1 1 0 16H4v-2h9a6 6 0 0 0 0-12z"},null,-1)])])}const FL=pt({name:"ri-arrow-go-back-line",render:$L}),OL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function RL(e,t){return w(),T("svg",OL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m16.172 11l-5.364-5.364l1.414-1.414L20 12l-7.778 7.778l-1.414-1.414L16.172 13H4v-2z"},null,-1)])])}const BL=pt({name:"ri-arrow-right-line",render:RL}),DL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function PL(e,t){return w(),T("svg",DL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m13.172 12l-4.95-4.95l1.414-1.413L16 12l-6.364 6.364l-1.414-1.415z"},null,-1)])])}const HL=pt({name:"ri-arrow-right-s-line",render:PL}),WL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function zL(e,t){return w(),T("svg",WL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M13 7.828V20h-2V7.828l-5.364 5.364l-1.414-1.414L12 4l7.778 7.778l-1.414 1.414z"},null,-1)])])}const sw=pt({name:"ri-arrow-up-line",render:zL}),UL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function qL(e,t){return w(),T("svg",UL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m12 10.828l-4.95 4.95l-1.414-1.414L12 8l6.364 6.364l-1.414 1.414z"},null,-1)])])}const jL=pt({name:"ri-arrow-up-s-line",render:qL}),VL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function KL(e,t){return w(),T("svg",VL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M4 18v-3.7a1.5 1.5 0 0 0-1.5-1.5H2v-1.6h.5A1.5 1.5 0 0 0 4 9.7V6a3 3 0 0 1 3-3h1v2H7a1 1 0 0 0-1 1v4.1A2 2 0 0 1 4.626 12A2 2 0 0 1 6 13.9V18a1 1 0 0 0 1 1h1v2H7a3 3 0 0 1-3-3m16-3.7V18a3 3 0 0 1-3 3h-1v-2h1a1 1 0 0 0 1-1v-4.1a2 2 0 0 1 1.374-1.9A2 2 0 0 1 18 10.1V6a1 1 0 0 0-1-1h-1V3h1a3 3 0 0 1 3 3v3.7a1.5 1.5 0 0 0 1.5 1.5h.5v1.6h-.5a1.5 1.5 0 0 0-1.5 1.5"},null,-1)])])}const GL=pt({name:"ri-braces-line",render:KL}),YL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ZL(e,t){return w(),T("svg",YL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M9 3V1H7v2H3a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h18a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1h-4V1h-2v2zm-5 7h16v9H4zm0-5h3v1h2V5h6v1h2V5h3v3H4zm5.879 5.964L12 13.086l2.121-2.122l1.415 1.415l-2.122 2.121l2.121 2.121l-1.414 1.414L12 15.915l-2.121 2.12l-1.415-1.414l2.122-2.12l-2.122-2.122z"},null,-1)])])}const QL=pt({name:"ri-calendar-close-line",render:ZL}),XL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function JL(e,t){return w(),T("svg",XL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M7 3V1h2v2h6V1h2v2h4a1 1 0 0 1 1 1v5h-2V5h-3v2h-2V5H9v2H7V5H4v14h6v2H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm10 9a4 4 0 1 0 0 8a4 4 0 0 0 0-8m-6 4a6 6 0 1 1 12 0a6 6 0 0 1-12 0m5-3v3.414l2.293 2.293l1.414-1.414L18 15.586V13z"},null,-1)])])}const e$=pt({name:"ri-calendar-schedule-line",render:JL}),t$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function n$(e,t){return w(),T("svg",t$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M9 1v2h6V1h2v2h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h4V1zm11 10H4v8h16zM8 14v2H6v-2zm10 0v2h-8v-2zM7 5H4v4h16V5h-3v2h-2V5H9v2H7z"},null,-1)])])}const o$=pt({name:"ri-calendar-todo-line",render:n$}),s$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function i$(e,t){return w(),T("svg",s$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m10 15.17l9.192-9.191l1.414 1.414L10 17.999l-6.364-6.364l1.414-1.414z"},null,-1)])])}const r$=pt({name:"ri-check-line",render:i$}),l$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function a$(e,t){return w(),T("svg",l$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m12 10.587l4.95-4.95l1.414 1.414l-4.95 4.95l4.95 4.95l-1.415 1.414l-4.95-4.95l-4.949 4.95l-1.414-1.415l4.95-4.95l-4.95-4.95L7.05 5.638z"},null,-1)])])}const c$=pt({name:"ri-close-line",render:a$}),u$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function d$(e,t){return w(),T("svg",u$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m23 12l-7.071 7.071l-1.414-1.414L20.172 12l-5.657-5.657l1.414-1.414zM3.828 12l5.657 5.657l-1.414 1.414L1 12l7.071-7.071l1.414 1.414z"},null,-1)])])}const f$=pt({name:"ri-code-line",render:d$}),h$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function p$(e,t){return w(),T("svg",h$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M15 4h-2v7h7V9h-3.586l4.293-4.293l-1.414-1.414L15 7.586zM4 15h3.586l-4.293 4.293l1.414 1.414L9 16.414V20h2v-7H4z"},null,-1)])])}const m$=pt({name:"ri-collapse-diagonal-line",render:p$}),g$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function v$(e,t){return w(),T("svg",g$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M3 19h18v2H3zm10-5.828L19.071 7.1l1.414 1.414L12 17L3.515 8.515L4.929 7.1L11 13.173V2h2z"},null,-1)])])}const y$=pt({name:"ri-download-line",render:v$}),k$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function b$(e,t){return w(),T("svg",k$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M8.5 7a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m0 6.5a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0M15.5 7a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0m-1.5 8a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3"},null,-1)])])}const x$=pt({name:"ri-draggable",render:b$}),w$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function _$(e,t){return w(),T("svg",w$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M6.17 18a3.001 3.001 0 0 1 5.66 0H22v2H11.83a3.001 3.001 0 0 1-5.66 0H2v-2zm6-7a3.001 3.001 0 0 1 5.66 0H22v2h-4.17a3.001 3.001 0 0 1-5.66 0H2v-2zm-6-7a3.001 3.001 0 0 1 5.66 0H22v2H11.83a3.001 3.001 0 0 1-5.66 0H2V4zM9 6a1 1 0 1 0 0-2a1 1 0 0 0 0 2m6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m-6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2"},null,-1)])])}const S$=pt({name:"ri-equalizer-line",render:_$}),C$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function A$(e,t){return w(),T("svg",C$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M17.586 5H14V3h7v7h-2V6.414l-4.293 4.293l-1.414-1.414zM3 14h2v3.586l4.293-4.293l1.414 1.414L6.414 19H10v2H3z"},null,-1)])])}const M$=pt({name:"ri-expand-diagonal-line",render:A$}),E$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function T$(e,t){return w(),T("svg",E$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M10 6v2H5v11h11v-5h2v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm11-3v8h-2V6.413l-7.793 7.794l-1.414-1.414L17.585 5H13V3z"},null,-1)])])}const N$=pt({name:"ri-external-link-line",render:T$}),I$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function L$(e,t){return w(),T("svg",I$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M15 4H5v16h14V8h-4zM3 2.992C3 2.444 3.447 2 3.999 2H16l5 5v13.993A1 1 0 0 1 20.007 22H3.993A1 1 0 0 1 3 21.008zM11 11V8h2v3h3v2h-3v3h-2v-3H8v-2z"},null,-1)])])}const $$=pt({name:"ri-file-add-line",render:L$}),F$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function O$(e,t){return w(),T("svg",F$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M7 6V3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-3v3c0 .552-.45 1-1.007 1H4.007A1 1 0 0 1 3 21l.003-14c0-.552.45-1 1.006-1zM5.002 8L5 20h10V8zM9 6h8v10h2V4H9z"},null,-1)])])}const R$=pt({name:"ri-file-copy-line",render:O$}),B$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function D$(e,t){return w(),T("svg",B$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m21 6.757l-2 2V4h-9v5H5v11h14v-2.757l2-2v5.765a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 20.993V8l6.003-6h10.995C20.55 2 21 2.455 21 2.992zm.778 2.05l1.414 1.415L15.414 18l-1.416-.002l.002-1.412z"},null,-1)])])}const P$=pt({name:"ri-file-edit-line",render:D$}),H$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function W$(e,t){return w(),T("svg",H$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M9 2.003V2h10.998C20.55 2 21 2.455 21 2.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 20.993V8zM5.83 8H9V4.83zM11 4v5a1 1 0 0 1-1 1H5v10h14V4z"},null,-1)])])}const iw=pt({name:"ri-file-line",render:W$}),z$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function U$(e,t){return w(),T("svg",z$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M21 8v12.993A1 1 0 0 1 20.007 22H3.993A.993.993 0 0 1 3 21.008V2.992C3 2.455 3.449 2 4.002 2h10.995zm-2 1h-5V4H5v16h14zM8 7h3v2H8zm0 4h8v2H8zm0 4h8v2H8z"},null,-1)])])}const q$=pt({name:"ri-file-text-line",render:U$}),j$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function V$(e,t){return w(),T("svg",j$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M13 9h8L11 24v-9H4l9-15zm-2 2V7.22L7.532 13H13v4.394L17.263 11z"},null,-1)])])}const K$=pt({name:"ri-flashlight-line",render:V$}),G$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Y$(e,t){return w(),T("svg",G$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414zM4 5v14h16V7h-8.414l-2-2zm7 7V9h2v3h3v2h-3v3h-2v-3H8v-2z"},null,-1)])])}const Z$=pt({name:"ri-folder-add-line",render:Y$}),Q$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function X$(e,t){return w(),T("svg",Q$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414z"},null,-1)])])}const J$=pt({name:"ri-folder-fill",render:X$}),eF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function tF(e,t){return w(),T("svg",eF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M6 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2M3 6a3 3 0 1 1 4 2.83V9a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2v-.17a3.001 3.001 0 1 1 2 0V9a4 4 0 0 1-4 4h-2v2.17a3.001 3.001 0 1 1-2 0V13H9a4 4 0 0 1-4-4v-.17A3 3 0 0 1 3 6m15-1a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-6 12a1 1 0 1 0 0 2a1 1 0 0 0 0-2"},null,-1)])])}const nF=pt({name:"ri-git-fork-line",render:tF}),oF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function sF(e,t){return w(),T("svg",oF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M15 5h2a2 2 0 0 1 2 2v8.17a3.001 3.001 0 1 1-2 0V7h-2v3l-4.5-4L15 2zM5 8.83a3.001 3.001 0 1 1 2 0v6.34a3.001 3.001 0 1 1-2 0zM6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m0 12a1 1 0 1 0 0-2a1 1 0 0 0 0 2m12 0a1 1 0 1 0 0-2a1 1 0 0 0 0 2"},null,-1)])])}const iF=pt({name:"ri-git-pull-request-line",render:sF}),rF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function lF(e,t){return w(),T("svg",rF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m-2.29-2.333A17.9 17.9 0 0 1 8.027 13H4.062a8.01 8.01 0 0 0 5.648 6.667M10.03 13c.151 2.439.848 4.73 1.97 6.752A15.9 15.9 0 0 0 13.97 13zm9.908 0h-3.965a17.9 17.9 0 0 1-1.683 6.667A8.01 8.01 0 0 0 19.938 13M4.062 11h3.965A17.9 17.9 0 0 1 9.71 4.333A8.01 8.01 0 0 0 4.062 11m5.969 0h3.938A15.9 15.9 0 0 0 12 4.248A15.9 15.9 0 0 0 10.03 11m4.259-6.667A17.9 17.9 0 0 1 15.973 11h3.965a8.01 8.01 0 0 0-5.648-6.667"},null,-1)])])}const aF=pt({name:"ri-global-line",render:lF}),cF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function uF(e,t){return w(),T("svg",cF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M2.992 21A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993zM20 15V5H4v14L14 9zm0 2.828l-6-6L6.828 19H20zM8 11a2 2 0 1 1 0-4a2 2 0 0 1 0 4"},null,-1)])])}const rw=pt({name:"ri-image-line",render:uF}),dF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function fF(e,t){return w(),T("svg",dF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16M11 7h2v2h-2zm0 4h2v6h-2z"},null,-1)])])}const hF=pt({name:"ri-information-line",render:fF}),pF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function mF(e,t){return w(),T("svg",pF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m13.06 8.111l1.415 1.414a7 7 0 0 1 0 9.9l-.354.353a7 7 0 1 1-9.9-9.9l1.415 1.415a5 5 0 1 0 7.071 7.071l.354-.354a5 5 0 0 0 0-7.07l-1.415-1.415zm6.718 6.01l-1.414-1.414a5 5 0 0 0-7.071-7.07l-.354.353a5 5 0 0 0 0 7.07l1.415 1.415l-1.415 1.414l-1.414-1.414a7 7 0 0 1 0-9.9l.354-.353a7 7 0 1 1 9.9 9.9"},null,-1)])])}const gF=pt({name:"ri-links-line",render:mF}),vF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function yF(e,t){return w(),T("svg",vF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M8 4h13v2H8zm-5-.5h3v3H3zm0 7h3v3H3zm0 7h3v3H3zM8 11h13v2H8zm0 7h13v2H8z"},null,-1)])])}const kF=pt({name:"ri-list-check",render:yF}),bF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function xF(e,t){return w(),T("svg",bF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M8 4h13v2H8zM4.5 6.5a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m0 7a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m0 6.9a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3M8 11h13v2H8zm0 7h13v2H8z"},null,-1)])])}const wF=pt({name:"ri-list-unordered",render:xF}),_F={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function SF(e,t){return w(),T("svg",_F,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M4 15h2v5h12V4H6v5H4V3a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm6-4V8l5 4l-5 4v-3H2v-2z"},null,-1)])])}const CF=pt({name:"ri-login-box-line",render:SF}),AF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function MF(e,t){return w(),T("svg",AF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m17 4.238l-7.928 7.1L4 7.216V19h16zM4.511 5l7.55 6.662L19.502 5z"},null,-1)])])}const EF=pt({name:"ri-mail-line",render:MF}),TF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function NF(e,t){return w(),T("svg",TF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M6.455 19L2 22.5V4a1 1 0 0 1 1-1h18a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1zm-.692-2H20V5H4v13.385zM8 10h8v2H8z"},null,-1)])])}const IF=pt({name:"ri-message-line",render:NF}),LF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function $F(e,t){return w(),T("svg",LF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M6 5h2v14H6zm10 0h2v14h-2z"},null,-1)])])}const FF=pt({name:"ri-pause-fill",render:$F}),OF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function RF(e,t){return w(),T("svg",OF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m15.728 9.576l-1.414-1.414L5 17.476v1.414h1.414zm1.414-1.414l1.414-1.414l-1.414-1.414l-1.414 1.414zm-9.9 12.728H3v-4.243L16.435 3.212a1 1 0 0 1 1.414 0l2.829 2.829a1 1 0 0 1 0 1.414z"},null,-1)])])}const BF=pt({name:"ri-pencil-line",render:RF}),DF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function PF(e,t){return w(),T("svg",DF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M19.376 12.416L8.777 19.482A.5.5 0 0 1 8 19.066V4.934a.5.5 0 0 1 .777-.416l10.599 7.066a.5.5 0 0 1 0 .832"},null,-1)])])}const HF=pt({name:"ri-play-fill",render:PF}),WF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function zF(e,t){return w(),T("svg",WF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m-1-5h2v2h-2zm2-1.645V14h-2v-1.5a1 1 0 0 1 1-1a1.5 1.5 0 1 0-1.471-1.794l-1.962-.393A3.501 3.501 0 1 1 13 13.355"},null,-1)])])}const UF=pt({name:"ri-question-line",render:zF}),qF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function jF(e,t){return w(),T("svg",qF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M20 4v12h3l-4 5l-4-5h3V4zm-8 14v2H3v-2zm2-7v2H3v-2zm0-7v2H3V4z"},null,-1)])])}const VF=pt({name:"ri-sort-desc",render:jF}),KF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function GF(e,t){return w(),T("svg",KF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M14 4.438A2.437 2.437 0 0 0 16.438 2h1.125A2.437 2.437 0 0 0 20 4.438v1.125A2.437 2.437 0 0 0 17.563 8h-1.125A2.437 2.437 0 0 0 14 5.563zM1 11a6 6 0 0 0 6-6h2a6 6 0 0 0 6 6v2a6 6 0 0 0-6 6H7a6 6 0 0 0-6-6zm3.876 1A8.04 8.04 0 0 1 8 15.124A8.04 8.04 0 0 1 11.124 12A8.04 8.04 0 0 1 8 8.876A8.04 8.04 0 0 1 4.876 12m12.374 2A3.25 3.25 0 0 1 14 17.25v1.5A3.25 3.25 0 0 1 17.25 22h1.5A3.25 3.25 0 0 1 22 18.75v-1.5A3.25 3.25 0 0 1 18.75 14z"},null,-1)])])}const YF=pt({name:"ri-sparkling-line",render:GF}),ZF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function QF(e,t){return w(),T("svg",ZF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928z"},null,-1)])])}const XF=pt({name:"ri-star-fill",render:QF}),JF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function eO(e,t){return w(),T("svg",JF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928zm0-2.292l4.247 2.377l-.948-4.773l3.573-3.305l-4.833-.573l-2.038-4.419l-2.039 4.42l-4.833.572l3.573 3.305l-.948 4.773z"},null,-1)])])}const tO=pt({name:"ri-star-line",render:eO}),nO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function oO(e,t){return w(),T("svg",nO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M6 5h12a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1"},null,-1)])])}const sO=pt({name:"ri-stop-fill",render:oO}),iO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function rO(e,t){return w(),T("svg",iO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M5 11v2h14v-2z"},null,-1)])])}const lO=pt({name:"ri-subtract-line",render:rO}),aO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function cO(e,t){return w(),T("svg",aO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M12 2a1 1 0 1 1 0 2a8 8 0 1 0 8 8a1 1 0 1 1 2 0c0 5.523-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2m0 4a1 1 0 1 1 0 2a4 4 0 1 0 4 4a1 1 0 1 1 2 0a6 6 0 1 1-6-6m5.656-3.9a1.001 1.001 0 0 1 1.415 1.415l-.708.706h.001a1 1 0 1 0 1.414 1.415l.707-.707A1 1 0 0 1 21.9 6.343l-2.12 2.122a1 1 0 0 1-.708.292h-2.414l-3.95 3.95a1 1 0 0 1-1.414-1.414l3.95-3.95V4.93a1 1 0 0 1 .292-.707z"},null,-1)])])}const uO=pt({name:"ri-target-line",render:cO}),dO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function fO(e,t){return w(),T("svg",dO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m1 2v14h16V5zm8 10h6v2h-6zm-3.333-3L5.838 9.172l1.415-1.415L11.495 12l-4.242 4.243l-1.415-1.415z"},null,-1)])])}const hO=pt({name:"ri-terminal-box-line",render:fO}),pO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function mO(e,t){return w(),T("svg",pO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m1-8h4v2h-6V7h2z"},null,-1)])])}const gO=pt({name:"ri-time-line",render:mO}),vO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function yO(e,t){return w(),T("svg",vO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M5.33 3.272a3.5 3.5 0 0 1 4.254 4.962l10.709 10.71l-1.414 1.414l-10.71-10.71a3.502 3.502 0 0 1-4.962-4.255L5.444 7.63a1.5 1.5 0 0 0 2.121-2.121zm10.367 1.883l3.182-1.768l1.414 1.415l-1.768 3.182l-1.768.353l-2.12 2.121l-1.415-1.414l2.121-2.121zm-6.718 8.132l1.415 1.414l-5.304 5.303a1 1 0 0 1-1.492-1.327l.078-.087z"},null,-1)])])}const kO=pt({name:"ri-tools-line",render:yO}),bO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function xO(e,t){return w(),T("svg",bO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M4 22a8 8 0 1 1 16 0h-2a6 6 0 0 0-12 0zm8-9c-3.315 0-6-2.685-6-6s2.685-6 6-6s6 2.685 6 6s-2.685 6-6 6m0-2c2.21 0 4-1.79 4-4s-1.79-4-4-4s-4 1.79-4 4s1.79 4 4 4"},null,-1)])])}const wO=pt({name:"ri-user-line",render:xO}),_O=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
39
+ <path d="M11.1 12.9001V15.0909C11.1 15.593 11.5029 16 12 16C12.4971 16 12.9 15.593 12.9 15.0909V12.9001H15.0909C15.593 12.9001 16 12.4972 16 12.0001C16 11.5031 15.593 11.1001 15.0909 11.1001H12.9V8.90909C12.9 8.40701 12.4971 8 12 8C11.5029 8 11.1 8.40701 11.1 8.90909V11.1001H8.90909C8.40701 11.1001 8 11.5031 8 12.0001C8 12.4972 8.40701 12.9001 8.90909 12.9001H11.1Z" fill="currentColor"/>
40
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M11.9996 2.1001C6.53199 2.1001 2.09961 6.53248 2.09961 12.0001C2.09961 13.9226 2.64847 15.7192 3.59804 17.2391L2.517 19.8207C2.10313 20.8091 2.82908 21.9001 3.90059 21.9001H11.9996C17.4672 21.9001 21.8996 17.4677 21.8996 12.0001C21.8996 6.53248 17.4672 2.1001 11.9996 2.1001ZM3.89961 12.0001C3.89961 7.52659 7.5261 3.9001 11.9996 3.9001C16.4731 3.9001 20.0996 7.52659 20.0996 12.0001C20.0996 16.4736 16.4724 20.1001 11.9989 20.1001H4.35146L5.63494 17.0351L5.35165 16.6291C4.43632 15.3172 3.89961 13.7227 3.89961 12.0001Z" fill="currentColor"/>
41
+ </svg>
42
+ `,SO=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
43
+ <path d="M9.2373 3.7002C10.4169 3.7002 11.5297 4.24779 12.249 5.18262L12.4424 5.43359H18C20.0987 5.43359 21.7998 7.13472 21.7998 9.2334V16.5C21.7998 18.5987 20.0987 20.2998 18 20.2998H6C3.90132 20.2998 2.2002 18.5987 2.2002 16.5V7.5C2.2002 5.40132 3.90132 3.7002 6 3.7002H9.2373ZM6 5.5C4.89543 5.5 4 6.39543 4 7.5V16.5C4 17.6046 4.89543 18.5 6 18.5H18C19.0357 18.5 19.887 17.7128 19.9893 16.7041L20 16.5V9.2334C20 8.19775 19.2128 7.34641 18.2041 7.24414L18 7.2334H12.0479L11.9326 7.22656C11.666 7.19561 11.4205 7.05812 11.2549 6.84277L10.8223 6.28027C10.4437 5.78834 9.85808 5.5 9.2373 5.5H6ZM16 9.59961C16.4971 9.59961 16.9004 10.0029 16.9004 10.5C16.9004 10.9971 16.4971 11.4004 16 11.4004H8C7.50294 11.4004 7.09961 10.9971 7.09961 10.5C7.09961 10.0029 7.50294 9.59961 8 9.59961H16Z" fill="currentColor"/>
44
+ </svg>
45
+ `,CO=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
46
+ <g clip-path="url(#clip0_4626_2033)">
47
+ <path d="M18.3623 9.99976L18.209 8.48999C18.2031 8.43161 18.2004 8.37289 18.2002 8.31421C18.1988 8.31196 18.1956 8.30842 18.1904 8.30347C18.1718 8.28559 18.1302 8.26245 18.0713 8.26245H11C10.261 8.26245 9.59753 7.81016 9.32617 7.1228L8.9082 6.06421C8.88101 5.9953 8.85737 5.92501 8.83887 5.85327C8.83778 5.85099 8.833 5.84268 8.81836 5.83179C8.79454 5.81475 8.7549 5.79939 8.70605 5.80054H3.92871C3.86986 5.80054 3.82825 5.82368 3.80957 5.84155C3.80816 5.8429 3.80675 5.84428 3.80566 5.84546L4.47559 14.0955L3.62109 17.5154L5.12109 11.5154C5.34367 10.6251 6.1438 9.99977 7.06152 9.99976H18.3623ZM7.06152 11.7996C6.96976 11.7996 6.88944 11.8629 6.86719 11.9519L5.36719 17.9519C5.33598 18.078 5.43158 18.1999 5.56152 18.2H19.4385C19.5302 18.1999 19.6106 18.1376 19.6328 18.0486L21.1328 12.0486C21.1644 11.9224 21.0686 11.7996 20.9385 11.7996H7.06152ZM20.9385 9.99976C22.2396 9.99977 23.1945 11.2228 22.8789 12.4851L21.3789 18.4851C21.1563 19.3754 20.3562 19.9997 19.4385 19.9998H4.92871C4.41722 19.9998 3.92613 19.8059 3.56445 19.4597C3.20281 19.1135 3.00004 18.6436 3 18.1541L2 5.84644C2.00006 5.35711 2.20311 4.88786 2.56445 4.54175C2.92613 4.19554 3.41722 4.00073 3.92871 4.00073H8.66406C9.10133 3.99051 9.5296 4.1225 9.87793 4.37573C10.2285 4.63118 10.4767 4.99457 10.582 5.40405L11 6.46167H18.0713C18.5828 6.46167 19.0739 6.65648 19.4355 7.00269C19.7971 7.34888 20 7.81883 20 8.30835L20.1719 9.99976H20.9385Z" fill="currentColor"/>
48
+ </g>
49
+ <defs>
50
+ <clipPath id="clip0_4626_2033">
51
+ <rect width="24" height="24" fill="white"/>
52
+ </clipPath>
53
+ </defs>
54
+ </svg>
55
+ `,AO=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
56
+ <path d="M6 12C6 12.8283 5.32834 13.5 4.5 13.5C3.67166 13.5 3 12.8283 3 12C3 11.1717 3.67166 10.5 4.5 10.5C5.32834 10.5 6 11.1717 6 12Z" fill="currentColor"/>
57
+ <path d="M13.5 12C13.5 12.8283 12.8283 13.5 12 13.5C11.1717 13.5 10.5 12.8283 10.5 12C10.5 11.1717 11.1717 10.5 12 10.5C12.8283 10.5 13.5 11.1717 13.5 12Z" fill="currentColor"/>
58
+ <path d="M19.5002 13.5C20.3287 13.5 21 12.8287 21 12.0002C21 11.1718 20.3287 10.5 19.5002 10.5C18.6718 10.5 18 11.1718 18 12.0002C18 12.8287 18.6718 13.5 19.5002 13.5Z" fill="currentColor"/>
59
+ </svg>
60
+ `,MO=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
61
+ <path d="M11.5 3C16.1944 3 20 6.80558 20 11.5C20 13.523 19.2933 15.381 18.1132 16.8404L21.1364 19.8636C21.4879 20.2151 21.4879 20.7849 21.1364 21.1364C20.7849 21.4879 20.2151 21.4879 19.8636 21.1364L16.8404 18.1132C15.381 19.2933 13.523 20 11.5 20C6.80558 20 3 16.1944 3 11.5C3 6.80558 6.80558 3 11.5 3ZM11.5 18.2C15.2003 18.2 18.2 15.2003 18.2 11.5C18.2 7.79969 15.2003 4.8 11.5 4.8C7.79969 4.8 4.8 7.79969 4.8 11.5C4.8 15.2003 7.79969 18.2 11.5 18.2Z" fill="currentColor"/>
62
+ </svg>
63
+ `,EO=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
64
+ <path d="M16.0404 12C16.0404 9.76874 14.2313 7.9596 12.0001 7.9596C9.76883 7.9596 7.95972 9.76874 7.95972 12C7.95972 14.2313 9.76883 16.0404 12.0001 16.0404C14.2313 16.0404 16.0404 14.2313 16.0404 12ZM14.2222 12C14.2222 13.2271 13.2271 14.2222 12 14.2222C10.7729 14.2222 9.77783 13.2271 9.77783 12C9.77783 10.7729 10.7729 9.77778 12 9.77778C13.2271 9.77778 14.2222 10.7729 14.2222 12Z" fill="currentColor"/>
65
+ <path d="M9.91145 21.8009C9.29001 21.6797 8.76914 21.2612 8.50632 20.6922L8.07372 19.7556C7.88838 19.3544 7.43553 19.1048 6.95371 19.1549L5.89572 19.2647C5.2733 19.3293 4.64823 19.114 4.22298 18.6611C3.74343 18.1504 3.32454 17.6037 2.97033 17.0181C2.61571 16.4318 2.32839 15.8106 2.10407 15.1566C1.89769 14.5549 2.02148 13.8954 2.4089 13.3902L3.0376 12.5704C3.30043 12.2277 3.30042 11.7722 3.03758 11.4295L2.40413 10.6035C2.01474 10.0958 1.891 9.43198 2.10208 8.82826C2.55037 7.54612 3.27017 6.35997 4.22 5.34259C4.64518 4.8872 5.27275 4.67067 5.89701 4.73544L6.95383 4.84514C7.43561 4.89515 7.88844 4.6456 8.07377 4.24441L8.50266 3.31593C8.76494 2.74818 9.28448 2.33019 9.90423 2.20761C11.2916 1.9332 12.7148 1.93127 14.0885 2.19913C14.7099 2.32029 15.2308 2.73881 15.4937 3.3078L15.9263 4.24441C16.1116 4.6456 16.5644 4.89514 17.0462 4.84514L18.1043 4.73532C18.7267 4.67072 19.3518 4.88603 19.777 5.33886C20.2566 5.84953 20.6755 6.3963 21.0297 6.98193C21.3843 7.56823 21.6716 8.18942 21.8959 8.84339C22.1023 9.44509 21.9785 10.1046 21.5911 10.6098L20.9624 11.4295C20.6996 11.7722 20.6996 12.2278 20.9624 12.5705L21.5959 13.3964C21.9853 13.9042 22.109 14.568 21.8979 15.1717C21.4497 16.4538 20.7299 17.6399 19.7801 18.6573C19.3549 19.1128 18.7273 19.3294 18.103 19.2646L17.0462 19.1549C16.5645 19.1049 16.1116 19.3544 15.9263 19.7556L15.4974 20.6841C15.2351 21.2518 14.7156 21.6698 14.0958 21.7924C12.7083 22.0668 11.2852 22.0687 9.91145 21.8009ZM13.7432 20.0088C13.7844 20.0006 13.8259 19.9673 13.847 19.9216L14.2758 18.9931C14.7915 17.8768 15.9886 17.2171 17.2341 17.3464L18.2909 17.4561C18.3649 17.4638 18.4272 17.4423 18.4512 17.4166C19.2296 16.5828 19.8171 15.6146 20.1817 14.5716C20.1845 14.5636 20.1796 14.5373 20.1532 14.5029L19.5198 13.677C18.7564 12.6815 18.7564 11.3185 19.5198 10.323L20.1485 9.5033C20.1746 9.46927 20.1795 9.4429 20.1762 9.43327C19.9932 8.89965 19.7603 8.39623 19.4741 7.92293C19.1873 7.4489 18.846 7.00333 18.4517 6.58351C18.4272 6.55739 18.3656 6.53616 18.2921 6.54378L17.234 6.65361C15.9886 6.78287 14.7915 6.12317 14.2758 5.00689L13.8432 4.07027C13.822 4.02448 13.7811 3.9916 13.7406 3.98371C12.5983 3.76097 11.4132 3.76258 10.2571 3.99124C10.2158 3.99941 10.1744 4.03271 10.1533 4.07842L9.72441 5.00689C9.20875 6.12317 8.01164 6.7829 6.76619 6.6536L5.70942 6.54391C5.63535 6.53623 5.573 6.55774 5.54905 6.5834C4.77067 7.41713 4.18312 8.38534 3.81845 9.42835C3.81564 9.43637 3.82054 9.46265 3.84693 9.49706L4.48038 10.323C5.24381 11.3185 5.24383 12.6815 4.48041 13.6769L3.85171 14.4967C3.82561 14.5307 3.82066 14.5571 3.82396 14.5667C4.00701 15.1004 4.23986 15.6038 4.52613 16.0771C4.81284 16.5511 5.15421 16.9967 5.54845 17.4165C5.57298 17.4426 5.63461 17.4638 5.70811 17.4562L6.76608 17.3464C8.01157 17.2171 9.20871 17.8768 9.72438 18.9932L10.157 19.9297C10.1781 19.9755 10.2191 20.0084 10.2595 20.0163C11.4018 20.239 12.587 20.2374 13.7432 20.0088Z" fill="currentColor"/>
66
+ </svg>
67
+ `,TO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm5-2v16"/><path d="m15 10l-2 2l2 2"/></g></svg>',NO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm5-2v16"/><path d="m14 10l2 2l-2 2"/></g></svg>',IO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m15 7l-6.5 6.5a1.5 1.5 0 0 0 3 3L18 10a3 3 0 0 0-6-6l-6.5 6.5a4.5 4.5 0 0 0 9 9L21 13"/></svg>',LO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"/></svg>',$O='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12.866 3l9.526 16.5a1 1 0 0 1-.866 1.5H2.474a1 1 0 0 1-.866-1.5L11.134 3a1 1 0 0 1 1.732 0m-8.66 16h15.588L12 5.5zM11 16h2v2h-2zm0-7h2v5h-2z"/></svg>',FO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M3 10H2V4.003C2 3.449 2.455 3 2.992 3h18.016A.99.99 0 0 1 22 4.003V10h-1v10.002a.996.996 0 0 1-.993.998H3.993A.996.996 0 0 1 3 20.002zm16 0H5v9h14zM4 5v3h16V5zm5 7h6v2H9z"/></svg>',OO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m13 16.172l5.364-5.364l1.414 1.414L12 20l-7.778-7.778l1.414-1.414L11 16.172V4h2z"/></svg>',RO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12 13.171l4.95-4.95l1.414 1.415L12 16L5.636 9.636L7.05 8.222z"/></svg>',BO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m5.828 7l2.536 2.535L6.95 10.95L2 6l4.95-4.95l1.414 1.415L5.828 5H13a8 8 0 1 1 0 16H4v-2h9a6 6 0 0 0 0-12z"/></svg>',DO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m16.172 11l-5.364-5.364l1.414-1.414L20 12l-7.778 7.778l-1.414-1.414L16.172 13H4v-2z"/></svg>',PO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m13.172 12l-4.95-4.95l1.414-1.413L16 12l-6.364 6.364l-1.414-1.415z"/></svg>',lw='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M13 7.828V20h-2V7.828l-5.364 5.364l-1.414-1.414L12 4l7.778 7.778l-1.414 1.414z"/></svg>',HO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12 10.828l-4.95 4.95l-1.414-1.414L12 8l6.364 6.364l-1.414 1.414z"/></svg>',WO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M4 18v-3.7a1.5 1.5 0 0 0-1.5-1.5H2v-1.6h.5A1.5 1.5 0 0 0 4 9.7V6a3 3 0 0 1 3-3h1v2H7a1 1 0 0 0-1 1v4.1A2 2 0 0 1 4.626 12A2 2 0 0 1 6 13.9V18a1 1 0 0 0 1 1h1v2H7a3 3 0 0 1-3-3m16-3.7V18a3 3 0 0 1-3 3h-1v-2h1a1 1 0 0 0 1-1v-4.1a2 2 0 0 1 1.374-1.9A2 2 0 0 1 18 10.1V6a1 1 0 0 0-1-1h-1V3h1a3 3 0 0 1 3 3v3.7a1.5 1.5 0 0 0 1.5 1.5h.5v1.6h-.5a1.5 1.5 0 0 0-1.5 1.5"/></svg>',zO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M9 3V1H7v2H3a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h18a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1h-4V1h-2v2zm-5 7h16v9H4zm0-5h3v1h2V5h6v1h2V5h3v3H4zm5.879 5.964L12 13.086l2.121-2.122l1.415 1.415l-2.122 2.121l2.121 2.121l-1.414 1.414L12 15.915l-2.121 2.12l-1.415-1.414l2.122-2.12l-2.122-2.122z"/></svg>',UO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M7 3V1h2v2h6V1h2v2h4a1 1 0 0 1 1 1v5h-2V5h-3v2h-2V5H9v2H7V5H4v14h6v2H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm10 9a4 4 0 1 0 0 8a4 4 0 0 0 0-8m-6 4a6 6 0 1 1 12 0a6 6 0 0 1-12 0m5-3v3.414l2.293 2.293l1.414-1.414L18 15.586V13z"/></svg>',qO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M9 1v2h6V1h2v2h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h4V1zm11 10H4v8h16zM8 14v2H6v-2zm10 0v2h-8v-2zM7 5H4v4h16V5h-3v2h-2V5H9v2H7z"/></svg>',jO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m10 15.17l9.192-9.191l1.414 1.414L10 17.999l-6.364-6.364l1.414-1.414z"/></svg>',VO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12 10.587l4.95-4.95l1.414 1.414l-4.95 4.95l4.95 4.95l-1.415 1.414l-4.95-4.95l-4.949 4.95l-1.414-1.415l4.95-4.95l-4.95-4.95L7.05 5.638z"/></svg>',KO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m23 12l-7.071 7.071l-1.414-1.414L20.172 12l-5.657-5.657l1.414-1.414zM3.828 12l5.657 5.657l-1.414 1.414L1 12l7.071-7.071l1.414 1.414z"/></svg>',GO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M15 4h-2v7h7V9h-3.586l4.293-4.293l-1.414-1.414L15 7.586zM4 15h3.586l-4.293 4.293l1.414 1.414L9 16.414V20h2v-7H4z"/></svg>',YO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M3 19h18v2H3zm10-5.828L19.071 7.1l1.414 1.414L12 17L3.515 8.515L4.929 7.1L11 13.173V2h2z"/></svg>',ZO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M8.5 7a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m0 6.5a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0M15.5 7a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0m-1.5 8a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3"/></svg>',QO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6.17 18a3.001 3.001 0 0 1 5.66 0H22v2H11.83a3.001 3.001 0 0 1-5.66 0H2v-2zm6-7a3.001 3.001 0 0 1 5.66 0H22v2h-4.17a3.001 3.001 0 0 1-5.66 0H2v-2zm-6-7a3.001 3.001 0 0 1 5.66 0H22v2H11.83a3.001 3.001 0 0 1-5.66 0H2V4zM9 6a1 1 0 1 0 0-2a1 1 0 0 0 0 2m6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m-6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2"/></svg>',XO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M17.586 5H14V3h7v7h-2V6.414l-4.293 4.293l-1.414-1.414zM3 14h2v3.586l4.293-4.293l1.414 1.414L6.414 19H10v2H3z"/></svg>',JO='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M10 6v2H5v11h11v-5h2v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm11-3v8h-2V6.413l-7.793 7.794l-1.414-1.414L17.585 5H13V3z"/></svg>',eR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M15 4H5v16h14V8h-4zM3 2.992C3 2.444 3.447 2 3.999 2H16l5 5v13.993A1 1 0 0 1 20.007 22H3.993A1 1 0 0 1 3 21.008zM11 11V8h2v3h3v2h-3v3h-2v-3H8v-2z"/></svg>',tR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M7 6V3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-3v3c0 .552-.45 1-1.007 1H4.007A1 1 0 0 1 3 21l.003-14c0-.552.45-1 1.006-1zM5.002 8L5 20h10V8zM9 6h8v10h2V4H9z"/></svg>',nR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m21 6.757l-2 2V4h-9v5H5v11h14v-2.757l2-2v5.765a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 20.993V8l6.003-6h10.995C20.55 2 21 2.455 21 2.992zm.778 2.05l1.414 1.415L15.414 18l-1.416-.002l.002-1.412z"/></svg>',aw='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M9 2.003V2h10.998C20.55 2 21 2.455 21 2.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 20.993V8zM5.83 8H9V4.83zM11 4v5a1 1 0 0 1-1 1H5v10h14V4z"/></svg>',oR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M21 8v12.993A1 1 0 0 1 20.007 22H3.993A.993.993 0 0 1 3 21.008V2.992C3 2.455 3.449 2 4.002 2h10.995zm-2 1h-5V4H5v16h14zM8 7h3v2H8zm0 4h8v2H8zm0 4h8v2H8z"/></svg>',sR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M13 9h8L11 24v-9H4l9-15zm-2 2V7.22L7.532 13H13v4.394L17.263 11z"/></svg>',iR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414zM4 5v14h16V7h-8.414l-2-2zm7 7V9h2v3h3v2h-3v3h-2v-3H8v-2z"/></svg>',rR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414z"/></svg>',lR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2M3 6a3 3 0 1 1 4 2.83V9a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2v-.17a3.001 3.001 0 1 1 2 0V9a4 4 0 0 1-4 4h-2v2.17a3.001 3.001 0 1 1-2 0V13H9a4 4 0 0 1-4-4v-.17A3 3 0 0 1 3 6m15-1a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-6 12a1 1 0 1 0 0 2a1 1 0 0 0 0-2"/></svg>',aR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M15 5h2a2 2 0 0 1 2 2v8.17a3.001 3.001 0 1 1-2 0V7h-2v3l-4.5-4L15 2zM5 8.83a3.001 3.001 0 1 1 2 0v6.34a3.001 3.001 0 1 1-2 0zM6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m0 12a1 1 0 1 0 0-2a1 1 0 0 0 0 2m12 0a1 1 0 1 0 0-2a1 1 0 0 0 0 2"/></svg>',cR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m-2.29-2.333A17.9 17.9 0 0 1 8.027 13H4.062a8.01 8.01 0 0 0 5.648 6.667M10.03 13c.151 2.439.848 4.73 1.97 6.752A15.9 15.9 0 0 0 13.97 13zm9.908 0h-3.965a17.9 17.9 0 0 1-1.683 6.667A8.01 8.01 0 0 0 19.938 13M4.062 11h3.965A17.9 17.9 0 0 1 9.71 4.333A8.01 8.01 0 0 0 4.062 11m5.969 0h3.938A15.9 15.9 0 0 0 12 4.248A15.9 15.9 0 0 0 10.03 11m4.259-6.667A17.9 17.9 0 0 1 15.973 11h3.965a8.01 8.01 0 0 0-5.648-6.667"/></svg>',cw='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M2.992 21A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993zM20 15V5H4v14L14 9zm0 2.828l-6-6L6.828 19H20zM8 11a2 2 0 1 1 0-4a2 2 0 0 1 0 4"/></svg>',uR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16M11 7h2v2h-2zm0 4h2v6h-2z"/></svg>',dR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m13.06 8.111l1.415 1.414a7 7 0 0 1 0 9.9l-.354.353a7 7 0 1 1-9.9-9.9l1.415 1.415a5 5 0 1 0 7.071 7.071l.354-.354a5 5 0 0 0 0-7.07l-1.415-1.415zm6.718 6.01l-1.414-1.414a5 5 0 0 0-7.071-7.07l-.354.353a5 5 0 0 0 0 7.07l1.415 1.415l-1.415 1.414l-1.414-1.414a7 7 0 0 1 0-9.9l.354-.353a7 7 0 1 1 9.9 9.9"/></svg>',fR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M8 4h13v2H8zm-5-.5h3v3H3zm0 7h3v3H3zm0 7h3v3H3zM8 11h13v2H8zm0 7h13v2H8z"/></svg>',hR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M8 4h13v2H8zM4.5 6.5a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m0 7a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m0 6.9a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3M8 11h13v2H8zm0 7h13v2H8z"/></svg>',pR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M4 15h2v5h12V4H6v5H4V3a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm6-4V8l5 4l-5 4v-3H2v-2z"/></svg>',mR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m17 4.238l-7.928 7.1L4 7.216V19h16zM4.511 5l7.55 6.662L19.502 5z"/></svg>',gR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6.455 19L2 22.5V4a1 1 0 0 1 1-1h18a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1zm-.692-2H20V5H4v13.385zM8 10h8v2H8z"/></svg>',vR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6 5h2v14H6zm10 0h2v14h-2z"/></svg>',yR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m15.728 9.576l-1.414-1.414L5 17.476v1.414h1.414zm1.414-1.414l1.414-1.414l-1.414-1.414l-1.414 1.414zm-9.9 12.728H3v-4.243L16.435 3.212a1 1 0 0 1 1.414 0l2.829 2.829a1 1 0 0 1 0 1.414z"/></svg>',kR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M19.376 12.416L8.777 19.482A.5.5 0 0 1 8 19.066V4.934a.5.5 0 0 1 .777-.416l10.599 7.066a.5.5 0 0 1 0 .832"/></svg>',bR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m-1-5h2v2h-2zm2-1.645V14h-2v-1.5a1 1 0 0 1 1-1a1.5 1.5 0 1 0-1.471-1.794l-1.962-.393A3.501 3.501 0 1 1 13 13.355"/></svg>',xR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M20 4v12h3l-4 5l-4-5h3V4zm-8 14v2H3v-2zm2-7v2H3v-2zm0-7v2H3V4z"/></svg>',wR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M14 4.438A2.437 2.437 0 0 0 16.438 2h1.125A2.437 2.437 0 0 0 20 4.438v1.125A2.437 2.437 0 0 0 17.563 8h-1.125A2.437 2.437 0 0 0 14 5.563zM1 11a6 6 0 0 0 6-6h2a6 6 0 0 0 6 6v2a6 6 0 0 0-6 6H7a6 6 0 0 0-6-6zm3.876 1A8.04 8.04 0 0 1 8 15.124A8.04 8.04 0 0 1 11.124 12A8.04 8.04 0 0 1 8 8.876A8.04 8.04 0 0 1 4.876 12m12.374 2A3.25 3.25 0 0 1 14 17.25v1.5A3.25 3.25 0 0 1 17.25 22h1.5A3.25 3.25 0 0 1 22 18.75v-1.5A3.25 3.25 0 0 1 18.75 14z"/></svg>',_R='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928z"/></svg>',SR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928zm0-2.292l4.247 2.377l-.948-4.773l3.573-3.305l-4.833-.573l-2.038-4.419l-2.039 4.42l-4.833.572l3.573 3.305l-.948 4.773z"/></svg>',CR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6 5h12a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1"/></svg>',AR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M5 11v2h14v-2z"/></svg>',MR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 2a1 1 0 1 1 0 2a8 8 0 1 0 8 8a1 1 0 1 1 2 0c0 5.523-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2m0 4a1 1 0 1 1 0 2a4 4 0 1 0 4 4a1 1 0 1 1 2 0a6 6 0 1 1-6-6m5.656-3.9a1.001 1.001 0 0 1 1.415 1.415l-.708.706h.001a1 1 0 1 0 1.414 1.415l.707-.707A1 1 0 0 1 21.9 6.343l-2.12 2.122a1 1 0 0 1-.708.292h-2.414l-3.95 3.95a1 1 0 0 1-1.414-1.414l3.95-3.95V4.93a1 1 0 0 1 .292-.707z"/></svg>',ER='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m1 2v14h16V5zm8 10h6v2h-6zm-3.333-3L5.838 9.172l1.415-1.415L11.495 12l-4.242 4.243l-1.415-1.415z"/></svg>',TR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m1-8h4v2h-6V7h2z"/></svg>',NR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M5.33 3.272a3.5 3.5 0 0 1 4.254 4.962l10.709 10.71l-1.414 1.414l-10.71-10.71a3.502 3.502 0 0 1-4.962-4.255L5.444 7.63a1.5 1.5 0 0 0 2.121-2.121zm10.367 1.883l3.182-1.768l1.414 1.415l-1.768 3.182l-1.768.353l-2.12 2.121l-1.415-1.414l2.121-2.121zm-6.718 8.132l1.415 1.414l-5.304 5.303a1 1 0 0 1-1.492-1.327l.078-.087z"/></svg>',IR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M4 22a8 8 0 1 1 16 0h-2a6 6 0 0 0-12 0zm8-9c-3.315 0-6-2.685-6-6s2.685-6 6-6s6 2.685 6 6s-2.685 6-6 6m0-2c2.21 0 4-1.79 4-4s-1.79-4-4-4s-4 1.79-4 4s1.79 4 4 4"/></svg>',xA={sm:14,md:16,lg:20};function vt(e,t){return{component:e,svg:t}}const wA={plus:vt(kL,LO),"chat-new":vt(qI,_O),"calendar-close":vt(QL,zO),"calendar-schedule":vt(e$,UO),"calendar-todo":vt(o$,qO),close:vt(c$,VO),check:vt(r$,jO),archive:vt(CL,FO),search:vt(sL,MO),copy:vt(R$,tR),link:vt(gF,dR),"external-link":vt(N$,JO),download:vt(y$,YO),undo:vt(FL,BO),send:vt(sw,lw),image:vt(rw,cw),settings:vt(lL,EO),sliders:vt(S$,QO),"log-in":vt(CF,pR),"chevron-down":vt(IL,RO),"chevron-right":vt(HL,PO),"chevron-up":vt(jL,HO),"arrow-up":vt(sw,lw),"arrow-down":vt(EL,OO),"arrow-right":vt(BL,DO),minus:vt(lO,AR),"panel-collapse":vt(uL,TO),"panel-expand":vt(hL,NO),expand:vt(M$,XO),collapse:vt(m$,GO),list:vt(wF,hR),sort:vt(VF,xR),grip:vt(x$,ZO),folder:vt(XI,CO),"folder-closed":vt(KI,SO),"folder-plus":vt(Z$,iR),"folder-solid":vt(J$,rR),file:vt(iw,aw),"file-text":vt(q$,oR),"file-edit":vt(P$,nR),"file-plus":vt($$,eR),"file-off":vt(iw,aw),attachment:vt(gL,IO),"image-off":vt(rw,cw),code:vt(f$,KO),terminal:vt(hO,ER),pencil:vt(BF,yR),tool:vt(kO,NR),glob:vt(GL,WO),globe:vt(aF,cR),"check-list":vt(kF,fR),bolt:vt(K$,sR),"git-fork":vt(nF,lR),"git-pull-request":vt(iF,aR),message:vt(IF,gR),mail:vt(EF,mR),user:vt(wO,IR),info:vt(hF,uR),"help-circle":vt(UF,bR),"alert-triangle":vt(wL,$O),clock:vt(gO,TR),sparkles:vt(YF,wR),target:vt(uO,MR),pause:vt(FF,vR),play:vt(HF,kR),stop:vt(sO,CR),star:vt(XF,_R),"star-outline":vt(tO,SR),"dots-horizontal":vt(tL,AO)};function LR(e){return wA[e]}function $R(e,t){return e.replace(/\s(?:width|height)="[^"]*"/g,"").replace(/^<svg\b/,`<svg class="kw-icon" width="${t}" height="${t}" aria-hidden="true"`)}function yc(e,t="md"){const n=wA[e];return n?$R(n.svg,xA[t]):""}const Zwe=[["Actions",["plus","attachment","chat-new","close","check","search","copy","link","external-link","download","undo","send","image","settings","sliders","log-in"]],["Navigation & layout",["chevron-down","chevron-right","chevron-up","arrow-up","arrow-down","arrow-right","minus","panel-collapse","panel-expand","expand","collapse","list","sort","grip"]],["Files & tools",["folder","folder-closed","folder-plus","folder-solid","file","file-text","file-edit","file-plus","file-off","image-off","code","terminal","pencil","tool","glob","globe","check-list","bolt","git-fork","git-pull-request","archive","target","calendar-schedule","calendar-todo","calendar-close"]],["Communication",["message","mail","user"]],["Status & media",["info","help-circle","alert-triangle","clock","sparkles","pause","play","stop","star","star-outline","dots-horizontal"]]],Ve=Ze({__name:"Icon",props:{name:{},size:{default:"md"},label:{}},setup(e){const t=e,n=R(()=>LR(t.name)),o=R(()=>xA[t.size]);return(s,i)=>n.value?(w(),we(jo(n.value.component),{key:0,class:"kw-icon",width:o.value,height:o.value,"aria-label":e.label,"aria-hidden":e.label?void 0:!0},null,8,["width","height","aria-label","aria-hidden"])):ce("",!0)}}),FR={key:0,class:"ui-dialog__head"},OR={class:"ui-dialog__titles"},RR={key:0,class:"ui-dialog__title"},BR={key:1,class:"ui-dialog__desc"},DR={class:"ui-dialog__body"},PR={key:1,class:"ui-dialog__foot"},HR='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])',WR=Ze({__name:"Dialog",props:{open:{type:Boolean},title:{},description:{},closeOnOverlay:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0},size:{default:"md"},height:{default:"auto"},padded:{type:Boolean,default:!0},initialFocus:{}},emits:["update:open","close"],setup(e,{emit:t}){const n=e,o=t,s=J(null);let i=null;function r(){o("update:open",!1),o("close")}function l(){return s.value?Array.from(s.value.querySelectorAll(HR)):[]}function a(){const{initialFocus:d}=n;return d?typeof d=="function"?d()??null:typeof d=="string"?s.value?.querySelector(d)??null:s.value?.contains(d)?d:null:null}function c(d){if(!n.open)return;if(d.key==="Escape"&&n.closeOnEsc){d.preventDefault(),r();return}if(d.key!=="Tab")return;const f=l(),h=f[0],p=f[f.length-1];if(!h||!p){d.preventDefault(),s.value?.focus();return}const g=document.activeElement;d.shiftKey&&g===h?(d.preventDefault(),p.focus()):!d.shiftKey&&g===p&&(d.preventDefault(),h.focus())}function u(d){n.closeOnOverlay&&d.target===d.currentTarget&&r()}return Qe(()=>n.open,async d=>{if(d){vc.value+=1,i=document.activeElement,await mt();const f=a(),h=l();(f??h[0]??s.value)?.focus()}else vc.value=Math.max(0,vc.value-1),i instanceof HTMLElement&&(i.focus(),i=null)},{immediate:!0}),typeof window<"u"&&window.addEventListener("keydown",c),po(()=>{typeof window<"u"&&window.removeEventListener("keydown",c),n.open&&(vc.value=Math.max(0,vc.value-1))}),(d,f)=>(w(),we(dm,{to:"body"},[e.open?(w(),T("div",{key:0,class:"ui-dialog__overlay",onMousedown:u},[_("div",{ref_key:"panel",ref:s,class:We(["ui-dialog",[`ui-dialog--${e.size}`,{"ui-dialog--flush":!e.padded,"ui-dialog--fixed-height":e.height==="fixed"}]]),role:"dialog","aria-modal":"true",tabindex:"-1"},[e.title||d.$slots.head?(w(),T("div",FR,[On(d.$slots,"head",{},()=>[_("div",OR,[e.title?(w(),T("div",RR,O(e.title),1)):ce("",!0),e.description?(w(),T("div",BR,O(e.description),1)):ce("",!0)])],!0),re(Pn,{class:"ui-dialog__close",size:"sm",label:"Close",onClick:r},{default:Ee(()=>[re(Ve,{name:"close",size:"md"})]),_:1})])):ce("",!0),_("div",DR,[On(d.$slots,"default",{},void 0,!0)]),d.$slots.foot?(w(),T("div",PR,[On(d.$slots,"foot",{},void 0,!0)])):ce("",!0)],2)],32)):ce("",!0)]))}}),qr=ct(WR,[["__scopeId","data-v-3dce23a4"]]),zR={class:"sd-head"},UR=["placeholder","aria-label"],qR=["aria-selected","onClick","onMousemove"],jR={class:"sd-meta"},VR=["innerHTML"],KR={class:"sd-time"},GR=["innerHTML"],YR=["innerHTML"],ZR={key:1,class:"sd-empty"},QR={class:"sd-hint"},XR=200,JR=Ze({__name:"SearchSessionsDialog",props:{sessions:{},activeId:{}},emits:["select","close"],setup(e,{emit:t}){const{t:n}=Tt(),o=e,s=t,i=J(!0),r=J(""),l=J(null),a=J(null),c=R(()=>{const v=r.value.trim().toLowerCase(),m=[];for(const y of o.sessions){const k=y.title??"",A=y.lastPrompt??"",$=y.workspaceName??"",I=v.length>0&&k.toLowerCase().includes(v),x=v.length>0&&A.toLowerCase().includes(v),L=v.length>0&&$.toLowerCase().includes(v);if(!(v.length>0&&!I&&!x&&!L)&&(m.push({session:y,inTitle:I,inWorkspace:L,snippetText:A?PI(A,r.value):""}),m.length>=XR))break}return m}),u=J(0);Qe(r,()=>{u.value=0});function d(v){const m=c.value.length;return m===0?0:Math.max(0,Math.min(m-1,v))}async function f(){await mt(),a.value?.querySelector('[aria-selected="true"]')?.scrollIntoView({block:"nearest"})}function h(v){u.value=d(u.value+v),f()}function p(v){s("select",v),s("close")}function g(){const v=c.value[u.value];v&&p(v.session.id)}function b(v){v.key==="ArrowDown"?(v.preventDefault(),h(1)):v.key==="ArrowUp"?(v.preventDefault(),h(-1)):v.key==="Enter"&&(v.preventDefault(),g())}return cn(()=>{l.value?.focus()}),(v,m)=>(w(),we(qr,{open:i.value,"onUpdate:open":m[1]||(m[1]=y=>i.value=y),size:"lg",height:"fixed",padded:!1,onClose:m[2]||(m[2]=y=>s("close"))},{head:Ee(()=>[_("div",zR,[re(Ve,{class:"sd-search-icon",name:"search",size:"md"}),Fn(_("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":m[0]||(m[0]=y=>r.value=y),class:"sd-input",type:"text",placeholder:C(n)("sidebar.searchPlaceholder"),"aria-label":C(n)("sidebar.searchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:b},null,40,UR),[[_s,r.value]])])]),foot:Ee(()=>[_("span",QR,O(C(n)("sidebar.searchHint")),1)]),default:Ee(()=>[_("div",{ref_key:"listRef",ref:a,class:"sd-list",role:"listbox"},[c.value.length>0?(w(!0),T(Pe,{key:0},ot(c.value,(y,k)=>(w(),T("button",{key:y.session.id,class:We(["sd-row",{on:k===u.value,active:y.session.id===e.activeId}]),role:"option","aria-selected":k===u.value,onClick:A=>p(y.session.id),onMousemove:A=>u.value=k},[_("span",jR,[re(Ve,{class:"sd-folder",name:"folder-closed",size:"sm"}),_("span",{class:"sd-ws",innerHTML:C(d0)(y.session.workspaceName??y.session.workspaceId??"",y.inWorkspace?r.value:"")},null,8,VR),_("span",KR,O(y.session.time),1)]),_("span",{class:"sd-title",innerHTML:C(d0)(y.session.title,y.inTitle?r.value:"")},null,8,GR),y.snippetText?(w(),T("span",{key:0,class:"sd-snippet",innerHTML:C(d0)(y.snippetText,r.value)},null,8,YR)):ce("",!0)],42,qR))),128)):(w(),T("div",ZR,O(C(n)("sidebar.searchNoResults")),1))],512)]),_:1},8,["open"]))}}),eB=ct(JR,[["__scopeId","data-v-a678f802"]]),tB=["aria-label"],nB=Ze({__name:"Spinner",props:{size:{default:"md"},label:{default:"Loading"}},setup(e){return(t,n)=>(w(),T("span",{class:We(["ui-spinner",`ui-spinner--${e.size}`]),role:"status","aria-label":e.label},[...n[0]||(n[0]=[_("svg",{class:"ui-spinner__svg",viewBox:"0 0 24 24","aria-hidden":"true"},[_("circle",{class:"ui-spinner__track",cx:"12",cy:"12",r:"9"}),_("circle",{class:"ui-spinner__arc",cx:"12",cy:"12",r:"9"})],-1)])],10,tB))}}),Ds=ct(nB,[["__scopeId","data-v-e5c5b17d"]]),oB={key:0,class:"ui-badge__dot","aria-hidden":"true"},sB=Ze({__name:"Badge",props:{variant:{default:"neutral"},size:{default:"md"},dot:{type:Boolean}},setup(e){return(t,n)=>(w(),T("span",{class:We(["ui-badge",[`ui-badge--${e.variant}`,`ui-badge--${e.size}`]])},[e.dot?(w(),T("span",oB)):ce("",!0),On(t.$slots,"default",{},void 0,!0)],2))}}),Ri=ct(sB,[["__scopeId","data-v-5bc5cd6d"]]),iB=Ze({__name:"Menu",setup(e,{expose:t}){const n=J();return t({el:n}),(o,s)=>(w(),T("div",{ref_key:"el",ref:n,class:"ui-menu",role:"menu"},[On(o.$slots,"default",{},void 0,!0)],512))}}),kl=ct(iB,[["__scopeId","data-v-60e6cd8d"]]),rB={key:0,class:"ui-menu-sep",role:"separator"},lB=["disabled"],aB=Ze({__name:"MenuItem",props:{active:{type:Boolean},danger:{type:Boolean},disabled:{type:Boolean},separator:{type:Boolean},size:{default:"md"}},emits:["click"],setup(e){return(t,n)=>e.separator?(w(),T("div",rB)):(w(),T("button",{key:1,class:We(["ui-menu-item",[`ui-menu-item--${e.size}`,{"is-active":e.active,"is-danger":e.danger}]]),type:"button",role:"menuitem",disabled:e.disabled,onClick:n[0]||(n[0]=o=>t.$emit("click",o))},[On(t.$slots,"default",{},void 0,!0)],10,lB))}}),pn=ct(aB,[["__scopeId","data-v-f940771a"]]),nl=6,ol=8,cB=150,uB=Ze({__name:"Tooltip",props:{text:{},placement:{default:"top"},maxWidth:{default:280},maxLines:{default:6}},setup(e){const t=e,n=J(),o=J(),s=J(!1),i=J(!1),r=J({maxWidth:`${t.maxWidth}px`});let l,a=null,c;function u(){const g=o.value;if(!a||!g)return;const b=a.getBoundingClientRect(),v=g.offsetWidth,m=g.offsetHeight,y=window.innerWidth,k=window.innerHeight;let A=t.placement;A==="top"&&b.top-nl-m<ol?A="bottom":A==="bottom"&&b.bottom+nl+m>k-ol?A="top":A==="left"&&b.left-nl-v<ol?A="right":A==="right"&&b.right+nl+v>y-ol&&(A="left");let $=0,I=0;A==="top"?($=b.top-nl-m,I=b.left+b.width/2-v/2):A==="bottom"?($=b.bottom+nl,I=b.left+b.width/2-v/2):A==="left"?($=b.top+b.height/2-m/2,I=b.left-nl-v):($=b.top+b.height/2-m/2,I=b.right+nl),I=Math.min(Math.max(I,ol),y-ol-v),$=Math.min(Math.max($,ol),k-ol-m),r.value={maxWidth:`${t.maxWidth}px`,top:`${Math.round($)}px`,left:`${Math.round(I)}px`}}function d(){t.text&&(window.clearTimeout(l),l=window.setTimeout(()=>{s.value=!0,i.value=!1,mt(()=>{u(),i.value=!0})},cB))}function f(){window.clearTimeout(l),s.value=!1,i.value=!1}function h(){s.value&&f()}function p(g){g!==a&&(a&&(a.removeEventListener("mouseenter",d),a.removeEventListener("mouseleave",f),a.removeEventListener("focusin",d),a.removeEventListener("focusout",f)),a=g,a&&(a.addEventListener("mouseenter",d),a.addEventListener("mouseleave",f),a.addEventListener("focusin",d),a.addEventListener("focusout",f)))}return cn(()=>{const g=n.value??null;p(g?.firstElementChild??g),g&&(c=new MutationObserver(()=>{const b=g.firstElementChild??null;b!==a&&(f(),p(b??g))}),c.observe(g,{childList:!0})),window.addEventListener("scroll",h,!0),window.addEventListener("resize",h)}),po(()=>{window.clearTimeout(l),c?.disconnect(),p(null),window.removeEventListener("scroll",h,!0),window.removeEventListener("resize",h)}),(g,b)=>(w(),T(Pe,null,[_("span",{ref_key:"trigger",ref:n,class:"ui-tip"},[On(g.$slots,"default",{},void 0,!0)],512),(w(),we(dm,{to:"body"},[Fn(_("div",{ref_key:"bubble",ref:o,class:We(["ui-tip__bubble",{positioned:i.value}]),style:Yt([r.value,{"--tip-lines":e.maxLines}]),role:"tooltip"},O(e.text),7),[[mi,s.value]])]))],64))}}),Xt=ct(uB,[["__scopeId","data-v-4c261eb6"]]),dB={class:"row"},fB={class:"lead","aria-hidden":"true"},hB={key:1,class:"unread-dot"},pB={class:"left"},mB=["onKeydown"],gB={class:"act"},vB={class:"ts"},yB={class:"menu-time"},kB=Ze({__name:"SessionRow",props:{session:{},active:{type:Boolean},approvalCount:{default:0},questionCount:{default:0},unread:{type:Boolean,default:!1}},emits:["select","rename","archive","fork","export"],setup(e,{expose:t,emit:n}){const{t:o}=Tt(),s=e,i=n;function r(S){const N=new Date(S);if(Number.isNaN(N.getTime()))return S;const D=B=>String(B).padStart(2,"0");return`${N.getFullYear()}-${D(N.getMonth()+1)}-${D(N.getDate())} ${D(N.getHours())}:${D(N.getMinutes())}`}const l=R(()=>s.session.updatedAt?r(s.session.updatedAt):s.session.time),a=J(!1),c=J(null),u=J(null),d=J({});function f(S){const N=S.target;u.value?.el?.contains(N)||c.value?.el?.contains(N)||g()}function h(){const S=c.value?.el;if(!S)return;const N=u.value?.el,D=S.getBoundingClientRect(),B=4,U=8,H=N?.offsetHeight??0,P=N?.offsetWidth??0;let Z=D.bottom+B;Z+H>window.innerHeight-U&&(Z=Math.max(U,D.top-H-B));let K=D.right-P;K<U&&(K=U),d.value={top:`${Math.round(Z)}px`,left:`${Math.round(K)}px`}}async function p(S){if(S.stopPropagation(),a.value){g();return}a.value=!0,setTimeout(()=>document.addEventListener("mousedown",f),0),window.addEventListener("resize",g),await mt(),h()}function g(){a.value=!1,document.removeEventListener("mousedown",f),window.removeEventListener("resize",g)}bn(()=>{document.removeEventListener("mousedown",f),window.removeEventListener("resize",g)});const b=J(!1),v=J(""),m=J(null);async function y(){g(),b.value=!0,v.value=s.session.title,await mt();try{m.value?.focus(),m.value?.select()}catch{}}function k(){const S=v.value.trim();S&&i("rename",s.session.id,S),b.value=!1}function A(){b.value=!1}const $=J(!1),I=J(!1);async function x(){const S=await Go(s.session.id);$.value=S,I.value=!S,setTimeout(()=>{$.value=!1,I.value=!1,g()},1500)}function L(){g(),i("fork",s.session.id)}function E(){g(),i("export",s.session.id)}function F(){g(),i("archive",s.session.id)}return t({closeMenu:g}),(S,N)=>(w(),T("div",{class:We(["se",{on:e.active}]),onClick:N[4]||(N[4]=D=>i("select",e.session.id))},[_("div",dB,[_("span",fB,[e.session.busy?(w(),we(Ds,{key:0,size:"sm"})):e.unread?(w(),T("span",hB)):ce("",!0)]),_("div",pB,[b.value?Fn((w(),T("input",{key:0,ref_key:"renameInputRef",ref:m,"onUpdate:modelValue":N[0]||(N[0]=D=>v.value=D),class:"rename-input",onClick:N[1]||(N[1]=bt(()=>{},["stop"])),onKeydown:[nr(bt(k,["stop"]),["enter"]),nr(bt(A,["stop"]),["esc"])],onBlur:k},null,40,mB)),[[_s,v.value]]):(w(),T("span",{key:1,class:"t",onDblclick:bt(y,["stop"])},O(e.session.title),33))]),re(Xt,{text:C(o)("workspace.awaitingAnswerTitle")},{default:Ee(()=>[!b.value&&(e.questionCount>0||e.session.pendingInteraction==="question")?(w(),we(Ri,{key:0,variant:"info",size:"sm"},{default:Ee(()=>[Je(O(C(o)("workspace.awaitingAnswer")),1)]),_:1})):ce("",!0)]),_:1},8,["text"]),re(Xt,{text:C(o)("workspace.awaitingPermissionTitle")},{default:Ee(()=>[!b.value&&(e.approvalCount>0||e.session.pendingInteraction==="approval")?(w(),we(Ri,{key:0,variant:"warning",size:"sm"},{default:Ee(()=>[Je(O(C(o)("workspace.awaitingPermission")),1)]),_:1})):ce("",!0)]),_:1},8,["text"]),re(Xt,{text:C(o)("workspace.abortedTitle")},{default:Ee(()=>[!b.value&&!e.session.busy&&e.session.pendingInteraction!=="question"&&e.session.pendingInteraction!=="approval"&&e.questionCount===0&&e.approvalCount===0&&(e.session.lastTurnReason==="cancelled"||e.session.lastTurnReason==="failed")?(w(),we(Ri,{key:0,variant:"danger",size:"sm"},{default:Ee(()=>[Je(O(C(o)("workspace.aborted")),1)]),_:1})):ce("",!0)]),_:1},8,["text"]),_("span",gB,[_("span",vB,O(e.session.time),1),b.value?ce("",!0):(w(),we(Pn,{key:0,ref_key:"kebabRef",ref:c,class:We(["kebab",{open:a.value}]),size:"sm",label:C(o)("sidebar.options"),onClick:N[2]||(N[2]=bt(D=>p(D),["stop"]))},{default:Ee(()=>[re(Ve,{name:"dots-horizontal"})]),_:1},8,["class","label"]))])]),(w(),we(dm,{to:"body"},[a.value?(w(),we(kl,{key:0,ref_key:"menuRef",ref:u,class:"menu",style:Yt(d.value),onClick:N[3]||(N[3]=bt(()=>{},["stop"]))},{default:Ee(()=>[re(pn,{danger:I.value,onClick:x},{default:Ee(()=>[re(Ve,{name:$.value?"check":"copy",size:"sm"},null,8,["name"]),Je(" "+O(I.value?C(o)("sidebar.copyFailed"):$.value?C(o)("sidebar.copied"):C(o)("sidebar.copySessionId")),1)]),_:1},8,["danger"]),re(pn,{separator:""}),re(pn,{onClick:y},{default:Ee(()=>[re(Ve,{name:"pencil",size:"sm"}),Je(" "+O(C(o)("sidebar.rename")),1)]),_:1}),re(pn,{onClick:L},{default:Ee(()=>[re(Ve,{name:"git-fork",size:"sm"}),Je(" "+O(C(o)("sidebar.fork")),1)]),_:1}),re(pn,{onClick:E},{default:Ee(()=>[re(Ve,{name:"download",size:"sm"}),Je(" "+O(C(o)("sidebar.export")),1)]),_:1}),re(pn,{danger:"",onClick:F},{default:Ee(()=>[re(Ve,{name:"archive",size:"sm"}),Je(" "+O(C(o)("sidebar.archive")),1)]),_:1}),re(pn,{separator:""}),_("div",yB,O(l.value),1)]),_:1},8,["style"])):ce("",!0)]))],2))}}),bB=ct(kB,[["__scopeId","data-v-c1a3c877"]]),xB={class:"gh-top"},wB={class:"gh-name"},_B=["inert"],SB=["disabled"],CB={class:"show-more-label"},AB={class:"show-more-label"},MB={key:2,class:"group-empty"},EB=Ze({__name:"WorkspaceGroup",props:{group:{},activeWorkspaceId:{},activeId:{},renamingId:{},renameValue:{},renameInputRef:{},pendingBySession:{},unreadBySession:{},wsMenuOpenId:{},dragging:{type:Boolean},isCollapsed:{type:Function},isExpanded:{type:Function}},emits:["groupClick","groupContextmenu","toggleWsMenu","createInWorkspace","selectSession","renameSession","archiveSession","forkSession","exportSession","loadMore","toggleExpand","confirmRename","cancelRename","updateRenameValue","wsDragstart","wsDragend"],setup(e,{emit:t}){const{t:n}=Tt(),o=e,s=t,i=R({get:()=>o.renameValue,set:f=>s("updateRenameValue",f)}),r=R(()=>{if(o.isExpanded(o.group.workspace.id))return o.group.sessions;const f=o.group.sessions.slice(0,o.group.initialCount);if(o.activeId&&!f.some(h=>h.id===o.activeId)){const h=o.group.sessions.find(p=>p.id===o.activeId);if(h)return[...f,h]}return f}),l=R(()=>o.group.sessions.length>o.group.initialCount);function a(){return Math.max(0,o.group.workspace.sessionCount-o.group.sessions.length)}function c(){return o.group.sessions.length-o.group.initialCount}function u(f){o.renameInputRef.value=f instanceof HTMLInputElement?f:null}function d(f){f.dataTransfer&&(f.dataTransfer.effectAllowed="move",f.dataTransfer.setData("text/plain",o.group.workspace.id),s("wsDragstart",o.group.workspace.id))}return(f,h)=>(w(),T("div",{class:We(["group",{dragging:e.dragging}])},[_("div",{class:We(["gh",{on:e.group.workspace.id===e.activeWorkspaceId,collapsed:e.isCollapsed(e.group.workspace.id)}]),draggable:"true",onClick:h[7]||(h[7]=bt(p=>s("groupClick",e.group.workspace.id,p),["stop"])),onContextmenu:h[8]||(h[8]=p=>s("groupContextmenu",e.group.workspace,p)),onDragstart:d,onDragend:h[9]||(h[9]=p=>s("wsDragend"))},[_("div",xB,[e.isCollapsed(e.group.workspace.id)?(w(),we(Ve,{key:0,class:"gh-folder",name:"folder-closed"})):(w(),we(Ve,{key:1,class:"gh-folder",name:"folder"})),e.renamingId!==e.group.workspace.id?(w(),we(Xt,{key:2,text:e.group.workspace.root},{default:Ee(()=>[_("span",wB,O(e.group.workspace.name),1)]),_:1},8,["text"])):Fn((w(),T("input",{key:3,ref:u,"onUpdate:modelValue":h[0]||(h[0]=p=>i.value=p),class:"gh-rename",type:"text",onKeydown:[h[1]||(h[1]=nr(p=>s("confirmRename"),["enter"])),h[2]||(h[2]=nr(p=>s("cancelRename"),["esc"]))],onBlur:h[3]||(h[3]=p=>s("cancelRename")),onClick:h[4]||(h[4]=bt(()=>{},["stop"]))},null,544)),[[_s,i.value]]),e.renamingId!==e.group.workspace.id?(w(),T("div",{key:4,class:We(["gh-actions",{open:e.wsMenuOpenId===e.group.workspace.id}])},[re(Pn,{class:We(["gh-more",{open:e.wsMenuOpenId===e.group.workspace.id}]),size:"sm",label:C(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":e.wsMenuOpenId===e.group.workspace.id,onClick:h[5]||(h[5]=bt(p=>s("toggleWsMenu",e.group.workspace,p),["stop"]))},{default:Ee(()=>[re(Ve,{name:"dots-horizontal"})]),_:1},8,["class","label","aria-expanded"]),re(Pn,{class:"gh-add",size:"sm",label:C(n)("workspace.newInGroup"),onClick:h[6]||(h[6]=bt(p=>s("createInWorkspace",e.group.workspace.id),["stop"]))},{default:Ee(()=>[re(Ve,{name:"chat-new"})]),_:1},8,["label"])],2)):ce("",!0)])],34),_("div",{class:We(["group-sessions",{collapsed:e.isCollapsed(e.group.workspace.id)}]),inert:e.isCollapsed(e.group.workspace.id)},[(w(!0),T(Pe,null,ot(r.value,p=>(w(),we(bB,{key:p.id,session:p,active:p.id===e.activeId,"approval-count":e.pendingBySession[p.id]?.approvals??0,"question-count":e.pendingBySession[p.id]?.questions??0,unread:e.unreadBySession[p.id]??!1,onSelect:h[10]||(h[10]=g=>s("selectSession",g)),onRename:h[11]||(h[11]=(g,b)=>s("renameSession",g,b)),onArchive:h[12]||(h[12]=g=>s("archiveSession",g)),onFork:h[13]||(h[13]=g=>s("forkSession",g)),onExport:h[14]||(h[14]=g=>s("exportSession",g))},null,8,["session","active","approval-count","question-count","unread"]))),128)),e.group.hasMore||e.group.loadingMore?(w(),T("button",{key:0,class:"show-more",disabled:e.group.loadingMore,onClick:h[15]||(h[15]=bt(p=>s("loadMore",e.group.workspace.id),["stop"]))},[h[17]||(h[17]=_("span",{class:"show-more-lead","aria-hidden":"true"},null,-1)),_("span",CB,O(e.group.loadingMore?C(n)("sidebar.loadingMore"):C(n)("sidebar.showMore",{count:a()})),1)],8,SB)):ce("",!0),l.value?(w(),T("button",{key:1,class:"show-more",onClick:h[16]||(h[16]=bt(p=>s("toggleExpand",e.group.workspace.id),["stop"]))},[h[18]||(h[18]=_("span",{class:"show-more-lead","aria-hidden":"true"},null,-1)),_("span",AB,O(e.isExpanded(e.group.workspace.id)?C(n)("sidebar.showLess"):C(n)("sidebar.showAll",{count:c()})),1)])):ce("",!0),e.group.sessions.length===0?(w(),T("div",MB,O(C(n)("sidebar.noSessions")),1)):ce("",!0)],10,_B)],2))}}),TB=ct(EB,[["__scopeId","data-v-cdac739a"]]),NB="kimi_desktop",IB="platform",uw="kimi-desktop",dw="kimi-desktop-platform";function LB(){let e=!1,t=null;try{const n=new URLSearchParams(window.location.search);n.has(NB)?(sessionStorage.setItem(uw,"1"),e=!0):e=e||sessionStorage.getItem(uw)==="1";const o=n.get(IB);o?(sessionStorage.setItem(dw,o),t=o):t=sessionStorage.getItem(dw)}catch{}return{isDesktop:e,platform:t}}const tv=LB(),$B=tv.isDesktop,Dc=tv.isDesktop&&tv.platform==="darwin",FB={class:"ui-kbd"},OB=Ze({__name:"Kbd",props:{keys:{}},setup(e){return(t,n)=>(w(),T("span",FB,[(w(!0),T(Pe,null,ot(e.keys,o=>(w(),T("kbd",{key:o,class:"ui-kbd__key"},O(o),1))),128))]))}}),kr=ct(OB,[["__scopeId","data-v-32292ed8"]]),RB=["disabled","aria-pressed"],BB=Ze({__name:"Pill",props:{clickable:{type:Boolean,default:!0},active:{type:Boolean},disabled:{type:Boolean},ariaPressed:{type:Boolean}},emits:["click"],setup(e){return(t,n)=>e.clickable?(w(),T("button",{key:0,class:We(["ui-pill",{"is-active":e.active}]),type:"button",disabled:e.disabled,"aria-pressed":e.ariaPressed,onClick:n[0]||(n[0]=o=>t.$emit("click",o))},[On(t.$slots,"default",{},void 0,!0)],10,RB)):(w(),T("span",{key:1,class:We(["ui-pill",{"is-active":e.active}])},[On(t.$slots,"default",{},void 0,!0)],2))}}),kh=ct(BB,[["__scopeId","data-v-317ace1a"]]),DB={class:"ch"},PB={class:"ch-brand"},HB={class:"ch-backend-ep"},WB={class:"btn-wrap"},zB={class:"search-input"},UB={key:0,class:"empty"},qB={class:"side-section-label"},jB={class:"side-section-title"},VB={class:"side-section-actions"},KB=["onDragover","onDrop"],GB={class:"side-footer"},YB={class:"section-menu-check"},ZB={class:"section-menu-check"},QB={class:"section-menu-check"},XB={class:"backend-menu-name"},JB={class:"backend-menu-url"},eD=1e3,tD=Ze({__name:"Sidebar",props:{activeWorkspace:{default:null},activeWorkspaceId:{default:null},sessions:{},groups:{},activeId:{},workspaceSortMode:{},backend:{default:"v1"},attentionBySession:{default:()=>({})},pendingBySession:{default:()=>({})},unreadBySession:{default:()=>({})},colWidth:{default:220},collapsed:{type:Boolean,default:!1},dragging:{type:Boolean,default:!1}},emits:["select","create","createInWorkspace","selectWorkspace","addWorkspace","rename","archive","fork","export","renameWorkspace","deleteWorkspace","reorderWorkspaces","setWorkspaceSortMode","loadMoreSessions","loadAllSessions","openSettings","collapse"],setup(e,{emit:t}){const{t:n}=Tt(),o=!1,s=J(null),i=R(()=>""),r=["default","multi"];function l(ze){const Xe=s.value?.presets[ze]??"";return Xe?II(Xe):""}function a(ze){const Xe=s.value;return Xe!==null&&Xe.current===Xe.presets[ze]}const c=e,u=t,d=J(!1),f=g()?["⌘","K"]:["Ctrl","K"];function h(){u("loadAllSessions"),d.value=!0}function p(ze){(ze.metaKey||ze.ctrlKey)&&ze.key.toLowerCase()==="k"&&(ze.preventDefault(),h())}cn(()=>window.addEventListener("keydown",p)),po(()=>window.removeEventListener("keydown",p));function g(){if(typeof navigator>"u")return!1;if(/Mac|iPod|iPhone|iPad/.test(navigator.platform))return!0;const ze=navigator.userAgentData;return ze?.platform==="macOS"||ze?.platform==="iOS"}const b=J(!1);function v(ze){b.value=ze.target.scrollTop>0}const m=J(new Set(vI()));function y(ze){return m.value.has(ze)}function k(ze){const Xe=new Set(m.value);Xe.has(ze)?Xe.delete(ze):Xe.add(ze),m.value=Xe,u0(Xe)}function A(){const ze=new Set(c.groups.map(Xe=>Xe.workspace.id));m.value=ze,u0(ze)}function $(){const ze=new Set;m.value=ze,u0(ze)}const I=R(()=>c.groups.length>0&&c.groups.every(ze=>m.value.has(ze.workspace.id))),x=J(new Set);function L(ze){return x.value.has(ze)}function E(ze){const Xe=new Set(x.value);Xe.has(ze)?Xe.delete(ze):Xe.add(ze),x.value=Xe}function F(ze){if(!x.value.has(ze)){const Xe=new Set(x.value);Xe.add(ze),x.value=Xe}u("loadMoreSessions",ze)}const S=J(null),N=J(null);function D(ze){S.value=ze}function B(){S.value=null,N.value=null}function U(ze){const Xe=ze.currentTarget.getBoundingClientRect();return ze.clientY<Xe.top+Xe.height/2?"before":"after"}function H(ze,Xe){S.value===null||S.value===Xe||(ze.preventDefault(),ze.dataTransfer&&(ze.dataTransfer.dropEffect="move"),N.value={id:Xe,position:U(ze)})}function P(ze){const Xe=S.value,kt=N.value?.id===ze?N.value.position:"before";if(N.value=null,S.value=null,!Xe||Xe===ze)return;const Ht=OI(c.groups.map(Rn=>Rn.workspace.id),Xe,ze,kt);u("reorderWorkspaces",Ht)}function Z(ze,Xe){Xe.target.closest(".gh-more, .gh-add")||k(ze)}function K(ze){u("select",ze)}const V=J(null),X=J(""),he=J(null);function ne(){return he}function ue(ze,Xe){V.value=ze,X.value=Xe,mt().then(()=>he.value?.focus())}function de(){const ze=V.value,Xe=X.value.trim();ze&&Xe&&u("renameWorkspace",ze,Xe),V.value=null}function Ce(){V.value=null}function Ie(ze){X.value=ze}const le=J(!1),z=J(null),ae=J({}),ie=J(null);function q(ze){ie.value?.el&&!ie.value.el.contains(ze.target)&&ye()}function ee(ze,Xe){Xe.preventDefault(),Xe.stopPropagation(),z.value=ze,ae.value={top:`${Xe.clientY}px`,left:`${Xe.clientX}px`},le.value=!0,document.addEventListener("mousedown",q,!0)}function ye(){le.value=!1,document.removeEventListener("mousedown",q,!0),z.value=null}function fe(){z.value&&Go(z.value.root),ye()}function ve(){z.value&&ue(z.value.id,z.value.name),ye()}function j(){const ze=z.value;ze&&(ye(),u("deleteWorkspace",ze.id))}const te=J(null),me=J(null),Ae=J({}),$e=J(null);function De(ze){const Xe=ze.target;Xe.closest(".gh-more")||Xe.closest(".ws-menu")||Ne()}async function ge(ze,Xe){if(te.value===ze.id){Ne();return}const kt=Xe.currentTarget;me.value=ze,te.value=ze.id,document.addEventListener("mousedown",De),window.addEventListener("resize",Ne),await mt();const Ht=$e.value?.el,Rn=kt.getBoundingClientRect(),sn=4,Gt=8,Wn=Ht?.offsetHeight??0,En=Ht?.offsetWidth??0;let St=Rn.bottom+sn;St+Wn>window.innerHeight-Gt&&(St=Math.max(Gt,Rn.top-Wn-sn));let Po=Rn.right-En;Po<Gt&&(Po=Gt),Ae.value={top:`${Math.round(St)}px`,left:`${Math.round(Po)}px`}}function Ne(){te.value=null,me.value=null,document.removeEventListener("mousedown",De),window.removeEventListener("resize",Ne)}function et(ze){Go(ze.root),Ne()}function rt(ze){ue(ze.id,ze.name),Ne()}function _t(ze){Ne(),u("deleteWorkspace",ze.id)}const gt=J(!1),It=J({}),Ut=J(null);function ht(ze){const Xe=ze.target;Xe.closest(".side-section-kebab")||Xe.closest(".section-menu")||dn()}async function un(ze){if(gt.value){dn();return}const Xe=ze.currentTarget;gt.value=!0,document.addEventListener("mousedown",ht),window.addEventListener("resize",dn),await mt();const kt=Ut.value?.el,Ht=Xe.getBoundingClientRect(),Rn=4,sn=8,Gt=kt?.offsetHeight??0,Wn=kt?.offsetWidth??0;let En=Ht.bottom+Rn;En+Gt>window.innerHeight-sn&&(En=Math.max(sn,Ht.top-Gt-Rn));let St=Ht.right-Wn;St<sn&&(St=sn),It.value={top:`${Math.round(En)}px`,left:`${Math.round(St)}px`}}function dn(){gt.value=!1,document.removeEventListener("mousedown",ht),window.removeEventListener("resize",dn)}function ns(ze){u("setWorkspaceSortMode",ze),dn()}const Wt=J(!1),Hn=J({}),lo=J(null);function it(ze){const Xe=ze.target;Xe.closest(".ch-backend")||Xe.closest(".backend-menu")||ao()}async function Gn(ze){if(s.value===null)return;if(Wt.value){ao();return}const Xe=ze.currentTarget;Wt.value=!0,document.addEventListener("mousedown",it),window.addEventListener("resize",ao),await mt();const kt=lo.value?.el,Ht=Xe.getBoundingClientRect(),Rn=4,sn=8,Gt=kt?.offsetHeight??0;let Wn=Ht.bottom+Rn;Wn+Gt>window.innerHeight-sn&&(Wn=Math.max(sn,Ht.top-Gt-Rn)),Hn.value={top:`${Math.round(Wn)}px`,left:`${Math.round(Math.max(sn,Ht.left))}px`}}function ao(){Wt.value=!1,document.removeEventListener("mousedown",it),window.removeEventListener("resize",ao)}async function Yn(ze){if(a(ze)){ao();return}if(await NI(ze)===null){console.warn("[kimi-web] dev backend switch failed:",ze),ao();return}window.location.reload()}po(()=>{document.removeEventListener("mousedown",q,!0),document.removeEventListener("mousedown",De),document.removeEventListener("mousedown",ht),document.removeEventListener("mousedown",it),window.removeEventListener("resize",Ne),window.removeEventListener("resize",dn),window.removeEventListener("resize",ao)});const go=J(null);let os;function qn(){const ze=go.value;ze&&(ze.classList.remove("blink-now"),ze.getBoundingClientRect(),ze.classList.add("blink-now"),clearTimeout(os),os=setTimeout(()=>ze.classList.remove("blink-now"),300))}const to=Li(()=>ms(()=>import("./DesignSystemView-CAPhy_9h.js"),__vite__mapDeps([0,1]))),vn=J(!1);let Zn,xn=!1;function An(ze){xn=!1,clearTimeout(Zn),ze.currentTarget.setPointerCapture?.(ze.pointerId),Zn=setTimeout(()=>{xn=!0,vn.value=!0},eD)}function Mn(ze){clearTimeout(Zn);const Xe=ze.currentTarget;Xe.hasPointerCapture?.(ze.pointerId)&&Xe.releasePointerCapture(ze.pointerId)}function Do(){if(xn){xn=!1;return}qn()}return po(()=>{clearTimeout(Zn)}),(ze,Xe)=>(w(),T("aside",{class:We(["side",{"macos-desktop":C(Dc),collapsed:e.collapsed,"no-anim":e.dragging}]),style:Yt({width:e.collapsed?"0px":e.colWidth+"px"})},[_("div",{class:"col",style:Yt({width:e.colWidth+"px"})},[_("div",DB,[_("div",PB,[C(Dc)?ce("",!0):(w(),T(Pe,{key:0},[(w(),T("svg",{ref_key:"logoRef",ref:go,class:We(["ch-logo",{"is-dev":C(o)}]),viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code",onClick:Do,onPointerdown:An,onPointerup:Mn,onPointercancel:Mn},[...Xe[22]||(Xe[22]=[Ay('<defs data-v-1b04ce05><mask id="kimiEyes" maskUnits="userSpaceOnUse" data-v-1b04ce05><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-1b04ce05></rect><g class="ch-eyes" fill="#000" data-v-1b04ce05><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-1b04ce05></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-1b04ce05></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#kimiEyes)" data-v-1b04ce05></rect>',2)])],34)),Xe[23]||(Xe[23]=_("span",{class:"ch-name"},"Kimi Code",-1)),C(o)?(w(),we(kh,{key:0,class:"ch-backend",clickable:s.value!==null,title:C(n)("sidebar.backendTitle",{backend:e.backend,endpoint:i.value}),onClick:Gn},{default:Ee(()=>[_("span",{class:We(["ch-backend-kind",`is-${e.backend}`])},O(e.backend),3),_("span",HB," · "+O(i.value),1),s.value!==null?(w(),we(Ve,{key:0,name:"chevron-down",size:"sm"})):ce("",!0)]),_:1},8,["clickable","title"])):ce("",!0)],64))]),C(Dc)?ce("",!0):(w(),we(Pn,{key:0,class:"ch-collapse",size:"sm",label:C(n)("sidebar.collapseSidebar"),onClick:Xe[0]||(Xe[0]=bt(kt=>u("collapse"),["stop"]))},{default:Ee(()=>[re(Ve,{name:"panel-collapse"})]),_:1},8,["label"]))]),_("div",WB,[_("button",{class:"btn-new-chat",type:"button",onClick:Xe[1]||(Xe[1]=bt(kt=>u("create"),["stop"]))},[re(Ve,{name:"chat-new"}),_("span",null,O(C(n)("sidebar.newChat")),1)]),ce("",!0)]),_("div",{class:We(["search-wrap",{"search-wrap--scrolled":b.value}])},[_("button",{class:"search",type:"button",onClick:h},[re(Ve,{class:"search-icon",name:"search"}),_("span",zB,O(C(n)("sidebar.search")),1),re(kr,{keys:C(f)},null,8,["keys"])])],2),_("div",{class:"sessions",onScroll:v},[e.groups.length===0?(w(),T("div",UB,O(C(n)("workspace.noWorkspace")),1)):(w(),T(Pe,{key:1},[_("div",qB,[_("span",jB,O(C(n)("sidebar.workspaces")),1),_("div",VB,[re(Pn,{class:"side-section-toggle",size:"sm",label:I.value?C(n)("sidebar.expandAll"):C(n)("sidebar.collapseAll"),onClick:Xe[3]||(Xe[3]=bt(kt=>I.value?$():A(),["stop"]))},{default:Ee(()=>[I.value?(w(),we(Ve,{key:0,name:"expand"})):(w(),we(Ve,{key:1,name:"collapse"}))]),_:1},8,["label"]),re(Pn,{class:"side-section-toggle side-section-kebab",size:"sm",label:C(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":gt.value,onClick:Xe[4]||(Xe[4]=bt(kt=>un(kt),["stop"]))},{default:Ee(()=>[re(Ve,{name:"dots-horizontal"})]),_:1},8,["label","aria-expanded"])])]),(w(!0),T(Pe,null,ot(e.groups,kt=>(w(),T("div",{key:kt.workspace.id,class:We(["ws-drop-target",{"drop-before":N.value?.id===kt.workspace.id&&N.value.position==="before","drop-after":N.value?.id===kt.workspace.id&&N.value.position==="after"}]),onDragover:Ht=>H(Ht,kt.workspace.id),onDrop:Ht=>P(kt.workspace.id)},[re(TB,{group:kt,"active-workspace-id":e.activeWorkspaceId,"active-id":e.activeId,"renaming-id":V.value,"rename-value":X.value,"rename-input-ref":ne(),"pending-by-session":e.pendingBySession,"unread-by-session":e.unreadBySession,"ws-menu-open-id":te.value,dragging:S.value===kt.workspace.id,"is-collapsed":y,"is-expanded":L,onGroupClick:Z,onGroupContextmenu:ee,onToggleWsMenu:ge,onCreateInWorkspace:Xe[5]||(Xe[5]=Ht=>u("createInWorkspace",Ht)),onSelectSession:K,onRenameSession:Xe[6]||(Xe[6]=(Ht,Rn)=>u("rename",Ht,Rn)),onArchiveSession:Xe[7]||(Xe[7]=Ht=>u("archive",Ht)),onForkSession:Xe[8]||(Xe[8]=Ht=>u("fork",Ht)),onExportSession:Xe[9]||(Xe[9]=Ht=>u("export",Ht)),onLoadMore:F,onToggleExpand:E,onConfirmRename:de,onCancelRename:Ce,onUpdateRenameValue:Ie,onWsDragstart:D,onWsDragend:B},null,8,["group","active-workspace-id","active-id","renaming-id","rename-value","rename-input-ref","pending-by-session","unread-by-session","ws-menu-open-id","dragging"])],42,KB))),128))],64))],32),_("div",GB,[_("button",{class:"btn-settings",type:"button",onClick:Xe[10]||(Xe[10]=bt(kt=>u("openSettings"),["stop"]))},[re(Ve,{name:"settings"}),_("span",null,O(C(n)("settings.title")),1)])])],4),le.value?(w(),we(kl,{key:0,ref_key:"ghMenuRef",ref:ie,class:"gh-menu",style:Yt(ae.value),onClick:Xe[11]||(Xe[11]=bt(()=>{},["stop"]))},{default:Ee(()=>[re(pn,{onClick:fe},{default:Ee(()=>[Je(O(C(n)("sidebar.copyPath")),1)]),_:1}),re(pn,{onClick:ve},{default:Ee(()=>[Je(O(C(n)("sidebar.rename")),1)]),_:1}),re(pn,{danger:"",onClick:j},{default:Ee(()=>[Je(O(C(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):ce("",!0),te.value!==null&&me.value?(w(),we(kl,{key:1,ref_key:"wsMenuRef",ref:$e,class:"ws-menu",style:Yt(Ae.value),onClick:Xe[15]||(Xe[15]=bt(()=>{},["stop"]))},{default:Ee(()=>[re(pn,{onClick:Xe[12]||(Xe[12]=kt=>et(me.value))},{default:Ee(()=>[Je(O(C(n)("sidebar.copyPath")),1)]),_:1}),re(pn,{separator:""}),re(pn,{onClick:Xe[13]||(Xe[13]=kt=>rt(me.value))},{default:Ee(()=>[Je(O(C(n)("sidebar.rename")),1)]),_:1}),re(pn,{separator:""}),re(pn,{danger:"",onClick:Xe[14]||(Xe[14]=kt=>_t(me.value))},{default:Ee(()=>[Je(O(C(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):ce("",!0),gt.value?(w(),we(kl,{key:2,ref_key:"sectionMenuRef",ref:Ut,class:"section-menu",style:Yt(It.value),onClick:Xe[18]||(Xe[18]=bt(()=>{},["stop"]))},{default:Ee(()=>[re(pn,{onClick:Xe[16]||(Xe[16]=kt=>ns("manual"))},{default:Ee(()=>[_("span",YB,[e.workspaceSortMode==="manual"?(w(),we(Ve,{key:0,name:"check",size:"sm"})):ce("",!0)]),Je(" "+O(C(n)("sidebar.sortManual")),1)]),_:1}),re(pn,{onClick:Xe[17]||(Xe[17]=kt=>ns("recent"))},{default:Ee(()=>[_("span",ZB,[e.workspaceSortMode==="recent"?(w(),we(Ve,{key:0,name:"check",size:"sm"})):ce("",!0)]),Je(" "+O(C(n)("sidebar.sortRecent")),1)]),_:1})]),_:1},8,["style"])):ce("",!0),Wt.value?(w(),we(kl,{key:3,ref_key:"backendMenuRef",ref:lo,class:"backend-menu",style:Yt(Hn.value),onClick:Xe[19]||(Xe[19]=bt(()=>{},["stop"]))},{default:Ee(()=>[(w(),T(Pe,null,ot(r,kt=>re(pn,{key:kt,onClick:Ht=>Yn(kt)},{default:Ee(()=>[_("span",QB,[a(kt)?(w(),we(Ve,{key:0,name:"check",size:"sm"})):ce("",!0)]),_("span",XB,O(kt),1),_("span",JB,O(l(kt)),1)]),_:2},1032,["onClick"])),64))]),_:1},8,["style"])):ce("",!0),d.value?(w(),we(eB,{key:4,sessions:e.sessions,"active-id":e.activeId,onSelect:K,onClose:Xe[20]||(Xe[20]=kt=>d.value=!1)},null,8,["sessions","active-id"])):ce("",!0),(w(),we(dm,{to:"body"},[vn.value?(w(),we(C(to),{key:0,onClose:Xe[21]||(Xe[21]=kt=>vn.value=!1)})):ce("",!0)]))],6))}}),nD=ct(tD,[["__scopeId","data-v-1b04ce05"]]);function oD(e){try{const t=mo(e);if(t===null)return null;const n=Number(t);return Number.isFinite(n)?n:null}catch{return null}}function sD(e,t){try{So(e,String(t))}catch{}}function iD(e){const{storageKey:t,defaultWidth:n,min:o,max:s,reverse:i=!1}=e;function r(v){return Number.isFinite(v)?Math.min(O4(s),Math.max(o,Math.round(v))):n}const l=J(r(oD(t)??n)),a=J(!1);function c(v){const m=r(v);l.value=m,sD(t,m)}let u=0,d=0,f=null,h=-1;function p(v){if(!a.value)return;const m=v.clientX-u;c(d+(i?-m:m))}function g(){if(a.value){if(a.value=!1,typeof document<"u"&&(document.body.style.userSelect="",document.body.style.cursor=""),f){try{f.releasePointerCapture(h)}catch{}f.removeEventListener("pointermove",p),f.removeEventListener("pointerup",g),f.removeEventListener("pointercancel",g)}f=null,h=-1}}function b(v){v.preventDefault(),a.value=!0,u=v.clientX,d=r(l.value),f=v.currentTarget,h=v.pointerId,typeof document<"u"&&(document.body.style.userSelect="none",document.body.style.cursor="col-resize");try{f.setPointerCapture(h)}catch{}f.addEventListener("pointermove",p),f.addEventListener("pointerup",g),f.addEventListener("pointercancel",g)}return po(g),{width:l,dragging:a,clamp:r,setWidth:c,onPointerDown:b}}const rD=["aria-label"],lD=Ze({__name:"ResizeHandle",props:{storageKey:{},defaultWidth:{},min:{},max:{},reverse:{type:Boolean},ariaLabel:{}},emits:["update:width","update:dragging"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Tt(),{width:i,dragging:r,onPointerDown:l}=iD({storageKey:n.storageKey,defaultWidth:n.defaultWidth,min:n.min,max:()=>n.max,reverse:n.reverse});return o("update:width",i.value),Qe(i,a=>o("update:width",a)),Qe(r,a=>o("update:dragging",a)),(a,c)=>(w(),T("div",{class:We(["rh",{dragging:C(r)}]),role:"separator","aria-orientation":"vertical","aria-label":e.ariaLabel??C(s)("layout.resizeHandleAria"),onPointerdown:c[0]||(c[0]=(...u)=>C(l)&&C(l)(...u))},[...c[1]||(c[1]=[_("span",{class:"rh-bar","aria-hidden":"true"},null,-1)])],42,rD))}}),fw=ct(lD,[["__scopeId","data-v-48fd0a6d"]]),aD={preview:"Preview",confirm:"Confirm",cancel:"Cancel"},cD={authBannerMessage:"Not signed in · Sign in to Kimi Code to start a conversation",authBannerLogin:"Sign in",authPageTitle:"Sign in to Kimi Code",authPageMessage:"Connect your Kimi Code account before starting or continuing conversations.",authPageLogin:"Sign in",connecting:"Connecting…",connectRetrying:"Cannot reach the server — retrying…",internalBuildBanner:"Internal testing only"},uD={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",workspaces:"Workspaces",sortWorkspaces:"Sort workspaces",sortManual:"Manual",sortRecent:"Last edited",collapseAll:"Collapse all workspaces",expandAll:"Expand all workspaces",newSession:"New Session",newChat:"New Chat",newWorkspace:"New Workspace",emptyState:"No sessions yet · click New Session to start",archiveConfirm:"Archive this session? You can restore it later from Settings.",options:"Options",rename:"Rename",copyPath:"Copy path",copySessionId:"Copy session ID",copied:"Copied ✓",copyFailed:"Copy failed",archive:"Archive",fork:"Fork session",export:"Export session",delete:"Delete",removeWorkspace:"Remove workspace",brand:"Kimi Code",signedIn:"Signed in",signOut:"Sign out",notSignedIn:"Not signed in",signIn:"Sign in",language:"Language",daemon:"Daemon",backendTitle:"Backend {backend} · {endpoint} — click to switch",noSessions:"No conversations yet",showMore:"Load {count} more conversations",showLess:"Show less",showAll:"Show {count} more conversations",loadingMore:"Loading…",collapseSidebar:"Collapse sidebar",expandSidebar:"Expand sidebar",searchPlaceholder:"Search sessions",search:"Search",searchHint:"↑↓ navigate · ↵ open · Esc close",searchNoResults:"No matching sessions"},dD={switcherTitle:"Switch workspace",switchTooltip:"Switch workspace",eyebrow:"Workspace",branchLabel:"branch: {branch}",noBranch:"no branch",sessionCount:"{count} session | {count} sessions",allWorkspaces:"All workspaces",currentWorkspace:"Current workspace only",addWorkspace:"Add workspace…",noWorkspace:"No workspace",deleteHasSessions:"This workspace still has sessions — archive them before deleting it",removeWorkspaceConfirm:'Remove workspace "{name}"?',swarmEnableConfirm:"Enable swarm mode? The agent will run multiple sub-agents in parallel.",goalStartConfirm:'Start goal: "{objective}"? The agent will run autonomously toward it.',scopeCurrent:"this workspace",scopeAll:"all workspaces",newInGroup:"New session in this workspace",addTitle:"Add workspace",recentLabel:"Recent folders",cancel:"Cancel",addFailed:"Couldn't open this folder. Check the path and try again.",openThisFolder:"Open this folder",up:"Up",browsing:"Browsing…",filterPlaceholder:"Filter subfolders…",searchPlaceholder:"Fuzzy-search subfolders, or paste an absolute path…",searching:"Searching…",noFilterMatch:"No subfolders match “{q}”",noSubfolders:"No subfolders here",browseHint:'Click a folder to enter it, then "Open this folder" to add it as a workspace.',checkingPath:"Checking path…",pathPickHint:"Path not found — did you mean:",noPathMatch:"Path not found — no matching folders under {parent}",badParent:"Parent directory does not exist: {parent}",pathFollowHint:'Folder located — press Enter or "Open this folder" to add it.',degradedPlaceholder:"Type an absolute path, press Enter to add…",degradedHint:"File browsing is unavailable — type an absolute path and press Enter to add.",attentionTitle:"{count} item needs your attention | {count} items need your attention",awaitingAnswer:"Answer",awaitingAnswerTitle:"A question is waiting for your answer",awaitingPermission:"Approve",awaitingPermissionTitle:"An action is waiting for your approval",aborted:"Stopped",abortedTitle:"This session was interrupted before finishing"},fD={jumpToLatestAria:"Jump to latest message",toc:"Conversation outline",newMessages:"Latest messages",loading:"Loading…",starting:"Starting conversation…",emptyWorkspaceHint:"Send in {name}",switchWorkspace:"Switch workspace",addWorkspace:"New workspace",moreWorkspaces:"More workspaces ({count})",compacting:"Compacting context…",compactedPlain:"Context compacted",compactedAuto:"Context auto-compacted",compactedTokens:" ({before} → {after} tokens)",viewSummary:"View summary",summaryTitle:"Compaction summary",manuallyAborted:"Manually stopped",activatedSkill:"Activated skill: {name}",undo:"Undo",undoTooltip:"Undoing the conversation will not roll back code changes",undoConfirm:"Undo last message?",yesterday:"Yesterday",loadOlder:"Load earlier messages",loadingOlder:"Loading earlier messages…",cron:{fired:"Scheduled reminder fired",missed:"Missed scheduled reminders",job:"job {id}",oneShot:"one-shot",coalesced:"{n} fires coalesced",missedCount:"{n} missed",finalDelivery:"final delivery",everyMinute:"Every minute",everyNMinutes:"Every {n} minutes",everyHour:"Every hour",everyNHours:"Every {n} hours",dailyAt:"Daily at {time}",weekdaysAt:"Weekdays at {time}",expand:"Show more",collapse:"Show less"}},hD={connectionConnected:"Connected",connectionConnecting:"Connecting…",connectionDisconnected:"Disconnected",ctxTooltip:"Used {used} / {max} tokens ({pct}%)",modelLabel:"Model",permissionManual:"Manual",permissionAuto:"Auto",permissionYolo:"YOLO",permissionManualDesc:"Ask for approval on every tool action",permissionAutoDesc:"Fully autonomous — agent decides everything without asking",permissionYoloDesc:"Auto-approve tool actions, but agent may still ask questions",planLabel:"Plan",planDesc:"Have the agent make a plan before changing files",planOn:"on",planOff:"off",planTooltip:"Toggle plan mode (research before editing)",modesLabel:"Mode",goalLabel:"Goal",goalDesc:"Track one objective until it is complete",swarmLabel:"Swarm",swarmDesc:"Run parallel agents for broader exploration",modeOff:"Off",goalPlaceholder:"What should the agent achieve?",goalStart:"Start",goalPause:"Pause",goalResume:"Resume",goalCancel:"Cancel",goalCancelConfirm:"Cancel this goal? It cannot be resumed afterwards.",goalCancelConfirmYes:"Yes",goalCancelConfirmNo:"No",goalStatusActive:"Active",goalStatusPaused:"Paused",goalStatusBlocked:"Blocked",goalStatusComplete:"Complete",modeNotSupported:"Not supported",thinkingLabel:"thinking",thinkingTooltip:"Toggle thinking mode",thinkingOn:"On",thinkingOff:"Off",cacheNote:"Note: Switching models or thinking effort invalidates the existing prompt cache. Start a new chat to avoid extra token costs.",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"},pD={placeholder:"Type a message…",send:"Send ↵",queueLabel:"Queue",placeholderRunning:"Press Enter to queue · Ctrl+S to inject into the running turn",starting:"Sending…",queueAutoDrain:"sends automatically when the current turn ends",queueNext:"Up next",queueDragTitle:"Drag to reorder",editQueued:"Edit (load back into the input)",queuedAttachments:"attachment ×{n}",queuedHasImage:"Contains {n} image(s) — remove only, not editable",attachmentImage:"Image",attachmentVideo:"Video",attachmentFile:"File",attachmentOpenUnsupported:"Can’t open {name} — this file type isn’t supported",dropToAttach:"Drop files to attach",remove:"Remove",removeNamed:"Remove {name}",uploading:"Uploading",uploadFailed:"Upload failed",attachFile:"Attach file",previewAttachment:"Preview {name}",interrupt:"Interrupt",interruptTitle:"Interrupt current operation",expandTitle:"Expand input for multi-line editing",collapseTitle:"Collapse input",emptyConversationTitle:"Kimi Code",emptyConversation:"No messages yet — type below to start the conversation",quickStartPlaceholder:"Type a message to start a new conversation…",thinkingSuffix:" · thinking",thinkingSuffixEffort:" · {level}"},mD={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",pollErrorTitle:"Lost connection to the daemon",pollErrorHint:"Authorization polling failed repeatedly. Check the kimi-code process and try again."},gD={dialogLabel:"Manage providers",title:"Provider management",close:"Close (Esc)",loading:"Loading providers…",unavailable:"The daemon does not support provider management yet",empty:"No providers yet",status:{connected:"Connected",error:"Error",unconfigured:"Not configured"},keySet:"key set",keyNotSet:"key not set",modelCount:"{count} models",confirmDelete:"Confirm delete?",refresh:"Refresh",delete:"Delete",refreshTitle:"Refresh {type}",deleteTitle:"Delete {type}",loginKimi:"Sign in to Kimi",loginAnthropic:"Sign in to Anthropic",enterApiKey:"Enter API Key",fieldType:"Type",fieldApiKey:"API Key",fieldBaseUrl:"Base URL",fieldDefaultModel:"Default model",baseUrlPlaceholder:"https://… (optional)",optional:"Optional",apiKeyRequired:"API Key cannot be empty",add:"Add",escClose:"Esc to close"},vD={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} 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"},yD={justNow:"just now"},kD={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"},bD={title:"Question",step:"Q{current}/{total}",back:"‹ Back",nextQuestion:"Next question ›",otherDefault:"Other…",submit:"Submit",dismiss:"Dismiss",minimize:"Minimize",expand:"Expand"},xD={tag:"tasks",summary:"{run} running · {done} done",stop:"stop",defaultDescription:"Background task",dockTasks:"Background tasks",dockBash:"Bash",dockSubagent:"Sub Agent",dockTodos:"Todos",running:"running",closePanel:"Close panel",timingRunning:"Running · {time}",timingDone:"Done · {sec}s",emptyTasks:"No background tasks running",emptyBash:"No bash tasks running",emptySubagent:"No sub agent tasks running",emptyTodo:"No todos yet",openTab:"Open the tasks tab",openDetail:"Open",collapse:"Collapse",expand:"Expand"},wD={panelTitle:"Thinking",close:"Close"},_D={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"},SD={},CD={empty:"Select a file on the left to preview",loading:"Loading…",lineCount:"{count} lines",copy:"Copy",copied:"Copied",copyPath:"Copy path",openInEditor:"Open",reveal:"Reveal",download:"Download",close:"Close",search:"Search",prevMatch:"Previous match",nextMatch:"Next match",htmlMode:"HTML preview mode",markdownMode:"Markdown preview mode",preview:"Preview",source:"Source",imageFit:"Image sizing",fit:"Fit",actual:"Actual",pdfNoPreview:"This PDF cannot be embedded here. Download it to view.",imageNoPreview:"Image file · {mime} · {size} · preview unavailable",binaryNoPreview:"Binary file · {mime} · {size} bytes · preview unavailable",unknownType:"unknown type",copyCode:"Copy code",enlargeImage:"Enlarge image",errors:{emptyPath:"File path is empty",unsupportedPath:"URLs and remote paths cannot be previewed",outsideWorkspace:"Only files inside the current workspace can be previewed",isDirectory:"Select a file instead of a directory",loadFailed:"Unable to read this file"}},AD={searching:"Searching…",noMatch:"No matches"},MD={dismiss:"Close",errorLabel:"Error",noteLabel:"Note",agentError:{title:"Model request failed",connection:"Cannot connect to the model service",auth:"Model authentication failed",rateLimit:"Model rate limit reached",overloaded:"Model overloaded",filtered:"Response filtered by the provider",api:"Model API error",contextOverflow:"Context size exceeded"},details:{cause:"Cause",code:"Error code",connection:"Connection",contentType:"Content type",details:"Server details",duration:"Duration",endpoint:"Endpoint",errorName:"Error type",message:"Message",operation:"Operation",phase:"Failure phase",request:"Request",requestId:"Request ID",responsePreview:"Response preview",sessionId:"Session ID",stack:"Stack",status:"HTTP status",timeout:"Timeout",timestamp:"Time"},daemonApiTitle:"Kimi daemon returned an error",daemonNetworkMessage:"Web did not receive a response from the local service. Check that Kimi daemon is still running, or refresh the page.",daemonNetworkTitle:"Cannot connect to Kimi daemon",diagnostics:"Diagnostics",hideDetails:"Hide details",operationFailedMessage:"The last operation did not finish. Try again later.",operationFailedTitle:"Operation failed",sessionSnapshotMessage:"Web could not load the current conversation. Check that Kimi daemon is still running, or refresh the page.",sessionSnapshotTitle:"Cannot load current conversation",showDetails:"Show details",copyDetails:"Copy diagnostics",copied:"Copied",wsTitle:"Realtime connection error",goal:{alreadyExists:"This session already has an active goal. Cancel it before starting a new one.",notFound:"No goal to act on — it may have already finished or been cancelled.",statusInvalid:"The current goal state does not allow this action.",notResumable:"This goal cannot be resumed (it may be cancelled or completed).",objectiveTooLong:"The objective is too long. Please shorten it and try again."}},ED={new:{desc:"Create a new session"},clear:{desc:"Clear and start a new session"},login:{desc:"Sign in to Kimi in the browser"},plan:{desc:"Toggle plan mode on/off"},swarm:{desc:"Toggle swarm mode; /swarm <task> runs a task in swarm"},goal:{desc:"Create/control a goal: /goal <objective>, /goal pause|resume|cancel"},btw:{desc:"Side chat: /btw <question> asks a forked side session"},yolo:{desc:"Auto-approve tool actions; the agent may still ask questions"},auto:{desc:"Fully autonomous — the agent never asks questions"},thinking:{desc:"Set the thinking level"},compact:{desc:"Compact the conversation history"},fork:{desc:"Fork this session into a new one"},export:{desc:"Download this session and troubleshooting logs as a ZIP",noSession:"Open a session before exporting it."},status:{desc:"View session status"},undo:{desc:"Undo the last message"}},TD={label:{read:"Read",bash:"Run",edit:"Edit",write:"Write",grep:"Search",glob:"Find",ls:"List",web_fetch:"Fetch",search:"Search",todo:"Todo",task:"Task",swarm:"Swarm",ask_user:"Question",goal_create:"Start Goal",goal_get:"Read Goal",goal_budget:"Set Goal Budget",goal_update:"Update Goal"},swarm:{progress:"{done} / {total}",runningSub:"{count} in progress",doneSub:"{completed} completed · {failed} failed",phaseQueued:"Queued",phaseWorking:"Working",phaseSuspended:"Suspended",phaseCompleted:"Completed",phaseFailed:"Failed",waiting:"Waiting for subagents…"},chip:{lines:"{count} lines",results:"{count} results",edited:"edited",created:"created",todos:"{count} items"},goal:{objectiveWithCriterion:"{objective} · {criterion}",status:"Status: {status}",budget:"{value} {unit}",turns:"{value} turns",tokens:"{value} tokens",milliseconds:"{value} ms",seconds:"{value} sec",minutes:"{value} min",hours:"{value} hr"},group:{title:"{count} tool call | {count} tool calls",running:"running",error:"failed",done:"done"},ask:{dismissed:"Dismissed",answer:"{count} answer",answers:"{count} answers",answered:"Answered",more:"(+{count} more)"}},ND={resizeHandleAria:"Resize sidebar width",resizePreviewAria:"Resize preview panel width",detailPanelAria:"Detail panel"},ID={openSwitcher:"Switch session / workspace",openSettings:"Session settings",settingsTitle:"Session settings",groupSession:"Current session",groupApp:"App preferences",sheetLabel:"Sheet",closeSheet:"Close",tapToCycle:"tap to cycle",running:"running",idle:"idle",sessionCount:"{n} sessions",newSession:"New session",permManualSub:"confirm every tool",permAutoSub:"fully autonomous, never asks",permYoloSub:"auto-approve tools, may still ask",planModeSub:"Plan mode",swarmModeSub:"Swarm mode",archivedSessions:"Archived sessions",archivedSessionsSub:"Browse and restore archived sessions",archivedBack:"Back"},LD={colorSchemeLabel:"Light/Dark",light:"Moon Bright",dark:"Moon Dark",system:"System",accentLabel:"Accent",accentBlue:"Blue",accentBlack:"Black"},$D={preview:"预览",confirm:"确认",cancel:"取消"},FD={authBannerMessage:"未登录 · 需要登录 Kimi Code 才能开始对话",authBannerLogin:"登录",authPageTitle:"登录 Kimi Code",authPageMessage:"先连接 Kimi Code 账号,然后再开始或继续对话。",authPageLogin:"登录",connecting:"连接中…",connectRetrying:"无法连接服务器,正在重试…",internalBuildBanner:"仅供内部测试"},OD={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",workspaces:"工作区",sortWorkspaces:"工作区排序",sortManual:"手动排序",sortRecent:"按最后编辑时间",collapseAll:"折叠全部工作区",expandAll:"展开全部工作区",newSession:"新建会话",newChat:"新建对话",newWorkspace:"新建工作区",emptyState:"还没有会话 · 点击 新建会话 开始",archiveConfirm:"确认归档会话?归档后可以从「设置」中恢复",options:"选项",rename:"重命名",copyPath:"复制路径",copySessionId:"复制 Session ID",copied:"已复制 ✓",copyFailed:"复制失败",archive:"归档",fork:"分叉会话",export:"导出会话",delete:"删除",removeWorkspace:"移除工作区",brand:"Kimi Code",signedIn:"已登录",signOut:"退出登录",notSignedIn:"未登录",signIn:"登录",language:"语言",daemon:"后台",backendTitle:"后端 {backend} · {endpoint} — 点击切换",noSessions:"暂无对话",showMore:"加载更多 {count} 个对话",showLess:"收起",showAll:"展开剩余 {count} 个对话",loadingMore:"加载中…",collapseSidebar:"收起侧边栏",expandSidebar:"展开侧边栏",searchPlaceholder:"搜索会话",search:"搜索",searchHint:"↑↓ 选择 · ↵ 打开 · Esc 关闭",searchNoResults:"没有匹配的会话"},RD={switcherTitle:"切换工作区",switchTooltip:"切换工作区",eyebrow:"工作区",branchLabel:"分支: {branch}",noBranch:"无分支",sessionCount:"{count} 个会话",allWorkspaces:"全部工作区",currentWorkspace:"仅当前工作区",addWorkspace:"添加工作区…",noWorkspace:"暂无工作区",deleteHasSessions:"工作区内还有会话,请先归档这些会话再删除",removeWorkspaceConfirm:"移除工作区「{name}」?",swarmEnableConfirm:"启用 swarm 模式?Agent 将并行运行多个子 agent。",goalStartConfirm:"启动 goal:「{objective}」?Agent 将自主执行。",scopeCurrent:"当前工作区",scopeAll:"全部工作区",newInGroup:"在此工作区新建会话",addTitle:"添加工作区",recentLabel:"最近的文件夹",cancel:"取消",addFailed:"无法打开此文件夹,请检查路径后重试。",openThisFolder:"打开此文件夹",up:"上一级",browsing:"加载中…",filterPlaceholder:"过滤子文件夹…",searchPlaceholder:"模糊搜索子文件夹,或粘贴绝对路径…",searching:"搜索中…",noFilterMatch:"没有匹配「{q}」的子文件夹",noSubfolders:"此处没有子文件夹",browseHint:'点击文件夹进入,再点"打开此文件夹"将其添加为工作区。',checkingPath:"检查路径…",pathPickHint:"此路径不存在,你是不是想找:",noPathMatch:"此路径不存在,「{parent}」下没有匹配的文件夹",badParent:"上级目录不存在:{parent}",pathFollowHint:'已定位到目标文件夹,按回车或点击"打开此文件夹"完成添加。',degradedPlaceholder:"输入绝对路径,回车添加…",degradedHint:"守护进程无法浏览文件系统,请直接输入绝对路径后回车添加。",attentionTitle:"{count} 项待处理",awaitingAnswer:"待回答",awaitingAnswerTitle:"有提问等待你回答",awaitingPermission:"待授权",awaitingPermissionTitle:"有操作等待你授权",aborted:"已中断",abortedTitle:"此会话在完成前被中断"},BD={jumpToLatestAria:"跳到最新消息",toc:"对话目录",newMessages:"最新消息",loading:"加载中…",starting:"正在创建对话…",emptyWorkspaceHint:"在 {name} 中发送",switchWorkspace:"切换工作区",addWorkspace:"添加工作区",moreWorkspaces:"更多工作区 ({count})",compacting:"正在压缩上下文…",compactedPlain:"上下文已压缩",compactedAuto:"已自动压缩上下文",compactedTokens:"({before} → {after} tokens)",viewSummary:"查看摘要",summaryTitle:"压缩摘要",manuallyAborted:"您已手动终止",activatedSkill:"已激活技能: {name}",undo:"撤销",undoTooltip:"撤销对话不会回滚代码",undoConfirm:"撤销上一条消息?",yesterday:"昨天",loadOlder:"加载更早的消息",loadingOlder:"正在加载更早的消息…",cron:{fired:"定时任务已触发",missed:"错过的定时提醒",job:"任务 {id}",oneShot:"单次",coalesced:"已合并 {n} 次触发",missedCount:"错过 {n} 次",finalDelivery:"最后一次投递",everyMinute:"每分钟",everyNMinutes:"每 {n} 分钟",everyHour:"每小时",everyNHours:"每 {n} 小时",dailyAt:"每天 {time}",weekdaysAt:"工作日 {time}",expand:"展开",collapse:"收起"}},DD={connectionConnected:"已连接",connectionConnecting:"连接中…",connectionDisconnected:"未连接",ctxTooltip:"使用 {used} / {max} tokens ({pct}%)",modelLabel:"模型",permissionManual:"逐条确认",permissionAuto:"完全自主",permissionYolo:"自动通过",permissionManualDesc:"每个工具操作都需要你手动确认",permissionAutoDesc:"完全自主运行,智能体自己做决定,不再询问",permissionYoloDesc:"自动批准工具操作,但遇到关键问题仍会询问",planLabel:"计划",planDesc:"先让智能体梳理计划,再修改文件",planOn:"开",planOff:"关",planTooltip:"切换计划模式(先调研再修改)",modesLabel:"模式",goalLabel:"目标",goalDesc:"持续跟踪一个目标,直到任务完成",swarmLabel:"Swarm",swarmDesc:"并行运行多个智能体,适合大范围探索",modeOff:"未启用",goalPlaceholder:"让智能体完成什么目标?",goalStart:"开始",goalPause:"暂停",goalResume:"继续",goalCancel:"取消",goalCancelConfirm:"是否需要取消当前目标?取消后将无法恢复。",goalCancelConfirmYes:"是",goalCancelConfirmNo:"否",goalStatusActive:"进行中",goalStatusPaused:"已暂停",goalStatusBlocked:"已阻塞",goalStatusComplete:"已完成",modeNotSupported:"暂不支持",thinkingLabel:"思考",thinkingTooltip:"切换思考模式",thinkingOn:"开",thinkingOff:"关",cacheNote:"提示:切换模型或思考程度会使已有的提示词缓存失效。建议新建对话,避免额外的 token 消耗。",starredModels:"收藏",moreModels:"更多模型…",statusPanelTitle:"会话状态",statusPanelClose:"关闭",statusModel:"模型",statusThinking:"思考强度",statusPermission:"权限",statusPlanMode:"计划模式",statusSwarmMode:"Swarm 模式",swarmOn:"开",swarmOff:"关",statusContext:"上下文",statusCost:"花费",statusContextValue:"{used} / {max} ({pct}%)",statusNone:"—",activityRunning:"运行中…",activityAwaitingApproval:"等待批准",activityAwaitingQuestion:"等待回答",interrupt:"中断",runningShort:"进行中"},PD={placeholder:"输入消息…",send:"发送 ↵",queueLabel:"队列",placeholderRunning:"输入会加入队列 · Ctrl+S 立即插入运行中的回合",starting:"正在发送…",queueAutoDrain:"当前回合结束后自动逐条发送",queueNext:"下一条",queueDragTitle:"拖拽排序",editQueued:"编辑(载入到输入框)",queuedAttachments:"附件 ×{n}",queuedHasImage:"包含 {n} 张图片 — 只能移除,不能编辑",attachmentImage:"图片",attachmentVideo:"视频",attachmentFile:"文件",attachmentOpenUnsupported:"无法打开 {name}:暂不支持此文件类型",dropToAttach:"松开鼠标添加附件",remove:"移除",removeNamed:"移除 {name}",uploading:"上传中",uploadFailed:"上传失败",attachFile:"添加附件",previewAttachment:"预览 {name}",interrupt:"中断",interruptTitle:"中断当前操作",expandTitle:"展开输入框进行多行编辑",collapseTitle:"收起输入框",emptyConversationTitle:"Kimi Code",emptyConversation:"还没有消息 —— 在下方输入开始对话",quickStartPlaceholder:"输入消息开始新对话…",thinkingSuffix:" · 思考",thinkingSuffixEffort:" · {level}"},HD={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 后重试",pollErrorTitle:"与 daemon 的连接已断开",pollErrorHint:"授权轮询连续失败,请检查 kimi-code 进程后重试"},WD={dialogLabel:"管理提供商",title:"提供商管理",close:"关闭 (Esc)",loading:"加载提供商中…",unavailable:"daemon 暂不支持提供商管理",empty:"暂无提供商",status:{connected:"已连接",error:"错误",unconfigured:"未配置"},keySet:"key 已设置",keyNotSet:"未设置 key",modelCount:"{count} 个模型",confirmDelete:"确认删除?",refresh:"刷新",delete:"删除",refreshTitle:"刷新 {type}",deleteTitle:"删除 {type}",loginKimi:"登录 Kimi",loginAnthropic:"登录 Anthropic",enterApiKey:"填写 API Key",fieldType:"类型",fieldApiKey:"API Key",fieldBaseUrl:"Base URL",fieldDefaultModel:"默认模型",baseUrlPlaceholder:"https://… (可选)",optional:"可选",apiKeyRequired:"API Key 不能为空",add:"添加",escClose:"Esc 关闭"},zD={dialogLabel:"切换模型",title:"切换模型",close:"关闭 (Esc)",allTab:"全部",providerTabs:"模型提供商",searchPlaceholder:"搜索模型或提供商…",loading:"加载模型中…",unavailable:"daemon 暂不支持模型列表",contextSuffix:"{size} ctx",emptyNoModels:"daemon 未提供可选模型",emptyNoMatch:"无匹配模型",starTitle:"添加到收藏",unstarTitle:"取消收藏",footerHint:"↑↓ 导航 · Enter 选择 · Esc 关闭"},UD={justNow:"刚刚"},qD={title:{shell:"运行命令?",diff:"应用修改?",file:"写入文件?",fileop:"文件操作?",url:"抓取 URL?",search:"搜索?",invocation:"调用?",todo:"更新 todo?",plan_review:"按这份 plan 开始实现?",generic:"批准操作?"},subagentBadge:"子 agent · {name}",required:"APPROVAL REQUIRED",danger:"危险: {detail}",searchQueryLabel:"查询",searchScope:"范围:{scope}",feedbackPlaceholder:"说明拒绝原因… (Enter 提交, Esc 取消)",feedbackHint:"Enter 提交 · Esc 取消",approve:"批准",approveSession:"本会话内批准",reject:"拒绝",feedback:"+反馈",approvePlan:"批准 plan",revise:"修改",rejectAndExit:"拒绝并退出"},jD={title:"提问",step:"Q{current}/{total}",back:"‹ 返回",nextQuestion:"下一题 ›",otherDefault:"其他…",submit:"提交",dismiss:"放弃",minimize:"最小化",expand:"展开"},VD={tag:"任务",summary:"{run} 运行中 · {done} 完成",stop:"stop",defaultDescription:"后台任务",dockTasks:"后台任务",dockBash:"后台 Bash",dockSubagent:"子 Agent",dockTodos:"待办",running:"运行中",closePanel:"关闭面板",timingRunning:"运行中 · {time}",timingDone:"完成 · {sec}s",emptyTasks:"暂无后台任务",emptyBash:"暂无后台 Bash 任务",emptySubagent:"暂无子 Agent 任务",emptyTodo:"暂无待办事项",openTab:"查看全部后台任务",openDetail:"查看",collapse:"折叠",expand:"展开"},KD={panelTitle:"思考过程",close:"关闭"},GD={title:"改动",branch:"分支",aheadTitle:"领先远程",behindTitle:"落后远程",changeCount:"{count} 改动",empty:"无 git 改动 / daemon 未提供",clean:"工作区干净,无改动",back:"返回",loading:"正在加载 diff…",noDiff:"该文件没有行级改动",list:"列表",tree:"树形",close:"关闭"},YD={},ZD={empty:"选择左侧文件预览",loading:"加载中…",lineCount:"{count} 行",copy:"复制",copied:"已复制",copyPath:"复制路径",openInEditor:"打开",reveal:"显示",download:"下载",close:"关闭",search:"搜索",prevMatch:"上一个匹配",nextMatch:"下一个匹配",htmlMode:"HTML 预览模式",markdownMode:"Markdown 预览模式",preview:"预览",source:"源码",imageFit:"图片缩放",fit:"适应",actual:"原始",pdfNoPreview:"无法内嵌预览此 PDF,可以下载后查看",imageNoPreview:"图片文件 · {mime} · {size} · 暂不预览",binaryNoPreview:"二进制文件 · {mime} · {size} 字节 · 暂不预览",unknownType:"未知类型",copyCode:"复制代码",enlargeImage:"放大图片",errors:{emptyPath:"文件路径为空",unsupportedPath:"不支持预览 URL 或远程路径",outsideWorkspace:"只能预览当前 workspace 内的文件",isDirectory:"请选择具体文件,而不是目录",loadFailed:"无法读取这个文件"}},QD={searching:"搜索中…",noMatch:"无匹配"},XD={dismiss:"关闭",errorLabel:"错误",noteLabel:"提示",agentError:{title:"模型请求失败",connection:"无法连接模型服务",auth:"模型认证失败",rateLimit:"模型请求被限流",overloaded:"模型服务过载",filtered:"响应被提供方过滤",api:"模型接口返回错误",contextOverflow:"上下文超出模型限制"},details:{cause:"底层原因",code:"错误码",connection:"连接状态",contentType:"响应类型",details:"服务端详情",duration:"耗时",endpoint:"请求地址",errorName:"错误类型",message:"错误信息",operation:"操作",phase:"失败阶段",request:"请求",requestId:"Request ID",responsePreview:"响应预览",sessionId:"Session ID",stack:"堆栈",status:"HTTP 状态",timeout:"超时设置",timestamp:"时间"},daemonApiTitle:"Kimi daemon 返回错误",daemonNetworkMessage:"Web 没有拿到本地服务的响应。请确认 Kimi daemon 仍在运行,或刷新页面重试。",daemonNetworkTitle:"无法连接到 Kimi daemon",diagnostics:"诊断信息",hideDetails:"收起详情",operationFailedMessage:"刚才的操作没有完成,请稍后重试。",operationFailedTitle:"操作失败",sessionSnapshotMessage:"Web 没能加载当前会话内容。请确认 Kimi daemon 仍在运行,或刷新页面重试。",sessionSnapshotTitle:"无法加载当前会话内容",showDetails:"查看详情",copyDetails:"复制诊断信息",copied:"已复制",wsTitle:"实时连接出错",goal:{alreadyExists:"当前会话已有一个进行中的目标,请先取消它再创建新目标。",notFound:"没有找到可操作的目标,可能它已经结束或被取消。",statusInvalid:"当前目标状态不支持这个操作。",notResumable:"这个目标无法恢复(可能已取消或已完成)。",objectiveTooLong:"目标描述太长了,请精简后重试。"}},JD={new:{desc:"创建新会话"},clear:{desc:"清空并新建会话"},login:{desc:"在浏览器中登录 Kimi"},plan:{desc:"切换计划模式 开/关"},swarm:{desc:"切换 swarm 模式;/swarm <任务> 直接在 swarm 下执行"},goal:{desc:"创建/控制目标:/goal <目标>、/goal pause|resume|cancel"},btw:{desc:"侧边聊天:/btw <问题> 向 fork 的侧边会话提问"},yolo:{desc:"自动批准工具操作,Agent 仍可能提问"},auto:{desc:"完全自主,Agent 不再提问"},thinking:{desc:"设置思考强度"},compact:{desc:"压缩会话历史"},fork:{desc:"把当前会话 fork 出一个新会话"},export:{desc:"将当前会话和排障日志下载为 ZIP 压缩包",noSession:"请先打开一个会话再导出。"},status:{desc:"查看会话状态"},undo:{desc:"撤销上一条消息"}},eP={label:{read:"读取",bash:"运行",edit:"编辑",write:"写入",grep:"搜索",glob:"查找",ls:"列目录",web_fetch:"抓取",search:"搜索",todo:"待办",task:"任务",swarm:"Swarm",ask_user:"提问",goal_create:"启动目标",goal_get:"读取目标",goal_budget:"设置目标预算",goal_update:"更新目标"},swarm:{progress:"{done} / {total}",runningSub:"{count} 个进行中",doneSub:"完成 {completed} · 失败 {failed}",phaseQueued:"排队",phaseWorking:"运行中",phaseSuspended:"暂停",phaseCompleted:"完成",phaseFailed:"失败",waiting:"等待子任务加入…"},chip:{lines:"{count} 行",results:"{count} 结果",edited:"已编辑",created:"已创建",todos:"{count} 项"},goal:{objectiveWithCriterion:"{objective} · {criterion}",status:"状态:{status}",budget:"{value} {unit}",turns:"{value} 轮",tokens:"{value} token",milliseconds:"{value} 毫秒",seconds:"{value} 秒",minutes:"{value} 分钟",hours:"{value} 小时"},group:{title:"{count} 个工具调用",running:"运行中",error:"有失败",done:"已完成"},ask:{dismissed:"已忽略",answer:"{count} 个回答",answers:"{count} 个回答",answered:"已回答",more:"(还有 {count} 个)"}},tP={resizeHandleAria:"调整侧栏宽度",resizePreviewAria:"调整预览面板宽度",detailPanelAria:"详情面板"},nP={openSwitcher:"切换会话 / 工作区",openSettings:"会话设置",settingsTitle:"会话设置",groupSession:"当前会话",groupApp:"应用偏好",sheetLabel:"面板",closeSheet:"关闭",tapToCycle:"点击切换",running:"运行中",idle:"空闲",sessionCount:"{n} 个会话",newSession:"新建会话",permManualSub:"每个工具都确认",permAutoSub:"完全自主,不再提问",permYoloSub:"自动批准工具,仍可能提问",planModeSub:"计划模式",swarmModeSub:"Swarm 模式",archivedSessions:"已归档会话",archivedSessionsSub:"查看并恢复已归档会话",archivedBack:"返回"},oP={colorSchemeLabel:"明暗",light:"月之亮面",dark:"月之暗面",system:"跟随系统",accentLabel:"主题色",accentBlue:"蓝色",accentBlack:"黑色"},sP={title:"Welcome to Kimi Web",subtitle:"Pick a few preferences — you can change them anytime in Settings.",languageLabel:"Language",start:"Get started",skip:"Skip",reopen:"Preferences / onboarding"},iP={title:"欢迎来使用 Kimi Web",subtitle:"来选择一些你的偏好 —— 之后也可以在设置里随时修改。",languageLabel:"语言",start:"开始使用",skip:"跳过",reopen:"偏好 / 引导"},rP={title:"Settings",close:"Close (Esc)",tabs:{general:"General",agent:"Agent",account:"Account",advanced:"Advanced",archived:"Archived"},appearance:"Appearance",notifications:"Notifications",notifyOnComplete:"Notify when a turn completes",notifyOnQuestion:"Notify when a question needs an answer",notifyOnApproval:"Notify when a tool needs approval",soundOnComplete:"Play a sound when a turn completes, needs an answer, or needs approval",notifyDenied:"Blocked in browser settings",notifyTitle:"Kimi Code · Turn finished",notifyQuestionTitle:"Kimi Code · Needs answer",notifyApprovalTitle:"Kimi Code · Approval required",notifyFallback:"View result",notifyQuestionFallback:"A question is waiting for your answer",notifyApprovalFallback:"A tool needs your approval",account:"Account",uiFontSize:"Font size",agentDefaults:"Agent defaults",providers:"Providers",providersHint:"Add, remove, or refresh providers",manageProviders:"Manage",saving:"Saving",defaultModel:"Default model",defaultModelHint:"New sessions prefer this model",noDefaultModel:"No default model",defaultPermission:"Default permission",defaultPermissionHint:"Only affects newly-created sessions",defaultThinking:"Thinking by default",defaultThinkingHint:"Whether new sessions start with thinking enabled",defaultPlanMode:"Plan mode by default",defaultPlanModeHint:"Whether new sessions start in plan mode",mergeSkills:"Merge all available skills",mergeSkillsHint:"Show project, plugin, and user skills together",telemetry:"Improve product with usage data",telemetryHint:"When on, we collect anonymous interaction data (such as clicks, interruptions, and feature usage) to improve the product experience. You can turn it off at any time.",telemetryRestartHint:"Takes effect after restarting the service.",credentialReady:"Credential configured",credentialMissing:"Missing credential",configUnavailable:"The server did not return config yet. These settings are unavailable.",advanced:"Advanced",build:"Build",serverVersion:"Server version",backend:"Backend",exportLog:"Troubleshooting log",logHint:"Enable with ?debug=1 to capture",exportLogBtn:"Export log",conversationToc:"Show conversation outline",conversationTocHint:"Show a clickable outline in the right margin to jump between messages",archivedTitle:"Archived sessions",archivedDesc:"Browse archived sessions, see their workspace path, name, and archive time, and restore them to the session list.",archivedSearch:"Search archived sessions",archivedAllWorkspaces:"All workspaces",archivedSortLabel:"Sort by",archivedSortArchived:"Archive time",archivedSortCreated:"Created time",archivedSortName:"Name",archivedRestore:"Restore",archivedEmpty:"No archived sessions yet",archivedNoMatch:"No matching archived sessions",archivedSessionsCount:"{count} sessions",archivedAt:"Archived {time}",archivedLoadMore:"Load more",archivedLoading:"Loading…",archivedLoadingAll:"Loading all archived sessions…"},lP={title:"设置",close:"关闭 (Esc)",tabs:{general:"通用",agent:"Agent",account:"账户",advanced:"高级",archived:"已归档"},appearance:"外观",notifications:"通知",notifyOnComplete:"会话完成时通知",notifyOnQuestion:"待回答时通知",notifyOnApproval:"待审批时通知",soundOnComplete:"会话完成、待回答或待审批时播放提示音",notifyDenied:"已在浏览器设置中被阻止",notifyTitle:"Kimi Code · 回合完成",notifyQuestionTitle:"Kimi Code · 待回答",notifyApprovalTitle:"Kimi Code · 等待审批",notifyFallback:"点击查看结果",notifyQuestionFallback:"有提问等待你回答",notifyApprovalFallback:"有工具等待你审批",account:"账户",uiFontSize:"字体大小",agentDefaults:"Agent 默认值",providers:"提供商",providersHint:"添加、删除或刷新提供商",manageProviders:"管理",saving:"保存中",defaultModel:"默认模型",defaultModelHint:"新会话会优先使用这个模型",noDefaultModel:"未设置默认模型",defaultPermission:"默认权限",defaultPermissionHint:"只影响之后新建的会话",defaultThinking:"默认开启思考",defaultThinkingHint:"新会话默认是否开启 thinking",defaultPlanMode:"默认计划模式",defaultPlanModeHint:"新会话默认进入 plan mode",mergeSkills:"合并所有可用 Skills",mergeSkillsHint:"让项目、插件和用户 Skills 一起出现在可用列表中",telemetry:"使用数据改进产品",telemetryHint:"开启后,我们会收集您的匿名交互数据(如点击、打断、功能使用等),用于改进产品体验。您可以随时关闭。",telemetryRestartHint:"更改后需重启服务生效。",credentialReady:"凭据已配置",credentialMissing:"缺少凭据",configUnavailable:"当前服务端没有返回 config,设置项暂不可用。",advanced:"高级",build:"构建",serverVersion:"服务端版本",backend:"后端",exportLog:"故障排查日志",logHint:"加 ?debug=1 开启采集",exportLogBtn:"导出日志",conversationToc:"显示对话目录",conversationTocHint:"在右侧显示可点击跳转的对话目录",archivedTitle:"已归档会话",archivedDesc:"查看已归档会话,确认其所属工作区路径、会话名称和归档时间,并可恢复到会话列表。",archivedSearch:"搜索已归档会话",archivedAllWorkspaces:"所有工作区",archivedSortLabel:"排序方式",archivedSortArchived:"归档时间",archivedSortCreated:"创建时间",archivedSortName:"按字母顺序",archivedRestore:"恢复",archivedEmpty:"还没有归档的会话",archivedNoMatch:"没有匹配的已归档会话",archivedSessionsCount:"{count} 个会话",archivedAt:"归档于 {time}",archivedLoadMore:"加载更多",archivedLoading:"加载中…",archivedLoadingAll:"正在加载全部归档会话…"},aP={openInEditor:"Open in editor",openInEditorShort:"Open",chooseOpenApp:"Choose application",copyAll:"Copy all as Markdown",copyFinalSummary:"Copy final summary",copied:"Copied",copyPath:"Copy path",changed:"{n} changed",gitTooltip:"Open Files > Changed",detached:"detached",openPr:"Open pull request",prStatusOpen:"open",prStatusClosed:"closed",prStatusMerged:"merged",prStatusDraft:"draft",prStatusUnknown:"unknown",options:"Options",copySessionId:"Copy Session ID",renameSession:"Rename",forkSession:"Fork session",archiveSession:"Archive",exportSession:"Export session"},cP={openInEditor:"在编辑器中打开",openInEditorShort:"打开",chooseOpenApp:"选择应用",copyAll:"复制全部对话为 Markdown",copyFinalSummary:"仅复制最终总结",copied:"已复制",copyPath:"复制路径",changed:"{n} 处改动",gitTooltip:"打开「文件 > 改动」",detached:"游离",openPr:"打开 Pull Request",prStatusOpen:"已打开",prStatusClosed:"已关闭",prStatusMerged:"已合并",prStatusDraft:"草稿",prStatusUnknown:"未知",options:"选项",copySessionId:"复制 Session ID",renameSession:"重命名",forkSession:"分叉会话",archiveSession:"归档",exportSession:"导出会话"},uP={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"},dP={title:"侧边聊天",subtitle:"从当前会话 fork",empty:"在侧边随手问一句 —— 它共享当前会话的上下文。",placeholder:"问问侧边聊天…",send:"发送"},fP={en:{common:aD,app:cD,sidebar:uD,workspace:dD,conversation:fD,status:hD,composer:pD,login:mD,providers:gD,model:vD,sessions:yD,approval:kD,question:bD,tasks:xD,thinking:wD,diff:_D,fileTree:SD,filePreview:CD,mention:AD,warnings:MD,commands:ED,tools:TD,layout:ND,mobile:ID,theme:LD,onboarding:sP,settings:rP,header:aP,sideChat:uP},zh:{common:$D,app:FD,sidebar:OD,workspace:RD,conversation:BD,status:DD,composer:PD,login:HD,providers:WD,model:zD,sessions:UD,approval:qD,question:jD,tasks:VD,thinking:KD,diff:GD,fileTree:YD,filePreview:ZD,mention:QD,warnings:XD,commands:JD,tools:eP,layout:tP,mobile:nP,theme:oP,onboarding:iP,settings:lP,header:cP,sideChat:dP}},_A=[{code:"en",label:"English"},{code:"zh",label:"中文"}];function hP(){const e=mo(Ft.locale);return e==="en"||e==="zh"?e:globalThis.navigator?.language?.toLowerCase().startsWith("zh")?"zh":"en"}const _n=iI({legacy:!1,locale:hP(),fallbackLocale:"en",messages:fP});function SA(e){_n.global.locale.value=e,So(Ft.locale,e)}const Xo=_n.global.t,pP={read:"tools.label.read",bash:"tools.label.bash",edit:"tools.label.edit",multi_edit:"tools.label.edit",write:"tools.label.write",grep:"tools.label.grep",glob:"tools.label.glob",ls:"tools.label.ls",web_fetch:"tools.label.web_fetch",search:"tools.label.search",todo:"tools.label.todo",task:"tools.label.task",agentswarm:"tools.label.swarm",askuserquestion:"tools.label.ask_user",creategoal:"tools.label.goal_create",getgoal:"tools.label.goal_get",setgoalbudget:"tools.label.goal_budget",updategoal:"tools.label.goal_update"},mP={multiedit:"multi_edit",multiedits:"multi_edit",shell:"bash",run:"bash",exec:"bash",ripgrep:"grep",rg:"grep",find:"glob",fetch:"web_fetch",webfetch:"web_fetch",url_fetch:"web_fetch",urlfetch:"web_fetch",list:"ls",listdir:"ls",list_dir:"ls",todowrite:"todo",todo_write:"todo",todoread:"todo",todolist:"todo",todo_list:"todo",agent:"task",subagent:"task",websearch:"search",web_search:"search",create_goal:"creategoal",get_goal:"getgoal",set_goal_budget:"setgoalbudget",update_goal:"updategoal"};function Da(e){const t=(e??"").trim().toLowerCase().replace(/[\s-]+/g,"_");return mP[t]??t}function Pa(e){const t=pP[Da(e)];return t?Xo(t):e}const gP={read:"file-text",bash:"terminal",edit:"pencil",multi_edit:"pencil",write:"file-plus",grep:"search",search:"search",glob:"glob",ls:"folder",web_fetch:"globe",todo:"check-list",task:"sparkles",agentswarm:"git-pull-request",askuserquestion:"help-circle",creategoal:"target",getgoal:"target",setgoalbudget:"target",updategoal:"target",croncreate:"calendar-schedule",cronlist:"calendar-todo",crondelete:"calendar-close"};function km(e){const t=Da(e);let n=gP[t];return!n&&(e??"").trim().toLowerCase().includes("skill")&&(n="bolt"),n||(n="tool"),yc(n,"sm")}const CA=80;function vP(e,t=CA){const n=e.trim();return n.length>t?n.slice(0,t-1)+"…":n}function yP(e,t){const n=e.trim();return!!(n===""||n==="{}"||n==="[]"||n==="null"||t&&Object.keys(t).length===0)}function kP(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 Zt(e){return typeof e=="string"&&e.length>0?e:void 0}function fl(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function bP(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 f0(e){return Zt(e.path)??Zt(e.file_path)??Zt(e.filePath)??Zt(e.filename)}const xP={active:"status.goalStatusActive",blocked:"status.goalStatusBlocked",complete:"status.goalStatusComplete"};function wP(e){const t=Zt(e);if(!t)return;const n=xP[t];return n?Xo(n):t}function _P(e){const t=fl(e.value),n=Zt(e.unit);if(!(t===void 0||!n))switch(n){case"turns":return Xo("tools.goal.turns",{value:t});case"tokens":return Xo("tools.goal.tokens",{value:t});case"milliseconds":return Xo("tools.goal.milliseconds",{value:t});case"seconds":return Xo("tools.goal.seconds",{value:t});case"minutes":return Xo("tools.goal.minutes",{value:t});case"hours":return Xo("tools.goal.hours",{value:t});default:return Xo("tools.goal.budget",{value:t,unit:n})}}const SP=64;function Ed(e,t,n=!1){const o=(s,i=CA)=>n?s.trim():vP(s,i);try{const s=kP(t);if(!n&&yP(t,s))return"";const i=()=>o(t.replace(/^·\s*/,""));if(!s)return i();switch(Da(e)){case"read":{const r=f0(s);if(!r)return i();const l=fl(s.offset)??fl(s.line_start)??fl(s.start_line),a=fl(s.limit)??fl(s.length),c=fl(s.line_end)??fl(s.end_line)??(l!==void 0&&a!==void 0?l+a:void 0);return o(l!==void 0&&c!==void 0?`${r}:${l}-${c}`:l!==void 0?`${r}:${l}`:r)}case"write":{const r=f0(s);return r?o(`${r} ${Xo("tools.chip.created")}`):i()}case"edit":case"multi_edit":{const r=f0(s);return r?o(r):i()}case"bash":{const r=Zt(s.command)??Zt(s.cmd)??Zt(s.script);return r?o(r,SP):i()}case"grep":case"search":{const r=Zt(s.pattern)??Zt(s.query)??Zt(s.regex),l=Zt(s.path)??Zt(s.glob)??Zt(s.include);return r&&l?o(`${r} in ${l}`):r?o(r):i()}case"glob":{const r=Zt(s.pattern)??Zt(s.glob)??Zt(s.query),l=Zt(s.path)??Zt(s.cwd);return r&&l?o(`${r} in ${l}`):r?o(r):Zt(s.path)?o(Zt(s.path)):i()}case"ls":{const r=Zt(s.path)??Zt(s.dir)??Zt(s.directory)??Zt(s.cwd);return r?o(r):i()}case"web_fetch":{const r=Zt(s.url)??Zt(s.uri);return r?o(bP(r)):i()}case"todo":case"task":{const r=Zt(s.description)??Zt(s.title)??Zt(s.prompt)??Zt(s.name)??Zt(s.subagent_type);if(r)return o(r);const l=Array.isArray(s.todos)?s.todos:Array.isArray(s.items)?s.items:void 0;return l?o(Xo("tools.chip.todos",{count:l.length})):i()}case"creategoal":{if(n)return i();const r=Zt(s.objective),l=Zt(s.completionCriterion);return r&&l?o(Xo("tools.goal.objectiveWithCriterion",{objective:r,criterion:l})):r?o(r):i()}case"getgoal":return n?i():"";case"setgoalbudget":{if(n)return i();const r=_P(s);return r?o(r):i()}case"updategoal":{if(n)return i();const r=wP(s.status);return r?o(Xo("tools.goal.status",{status:r})):i()}default:return i()}}catch{return t}}function CP(e){try{switch(Da(e.name)){case"bash":return e.timing?e.timing:"";case"read":{if(e.output&&e.output.length>0){const t=e.output.length;return Xo("tools.chip.lines",{count:t})}return""}case"edit":case"multi_edit":case"write":{if(e.output){for(const n of e.output){const o=n.match(/\+(\d+).*[-−](\d+)/);if(o)return`+${o[1]} −${o[2]}`}const t=e.output.find(n=>/\d+/.test(n));if(t){const n=t.match(/\+(\d+)/),o=t.match(/[-−](\d+)/);if(n||o)return`${n?`+${n[1]}`:""} ${o?`−${o[1]}`:""}`.trim()}if(e.status!=="error")return Xo("tools.chip.edited")}return""}case"grep":case"search":return e.output&&e.output.length>0?Xo("tools.chip.results",{count:e.output.length}):"";default:return""}}catch{return""}}const AP=Ze({__name:"StatusDot",props:{status:{}},setup(e){const t=e;function n(s){switch(s){case"ok":case"done":case"completed":case"success":return"ok";case"error":case"failed":case"danger":return"error";case"running":case"working":case"in_progress":case"active":return"running";case"suspended":return"suspended";default:return"idle"}}const o=R(()=>n(t.status));return(s,i)=>(w(),T("span",{class:We(["kw-dot",`kw-dot--${o.value}`]),"aria-hidden":"true"},null,2))}}),Td=ct(AP,[["__scopeId","data-v-e36198e5"]]),MP=["innerHTML"],EP={class:"bh-text"},TP={class:"a"},NP={key:0,class:"p"},IP={class:"rt"},LP=["aria-label"],$P={key:0,class:"tm"},FP=["inert"],OP={class:"bb-pad"},RP=Ze({__name:"ToolRow",props:{status:{},icon:{default:""},name:{},arg:{default:""},time:{default:""},open:{type:Boolean,default:!1},expandable:{type:Boolean,default:!1},stacked:{type:Boolean,default:!1},stackPosition:{default:"single"}},emits:["toggle"],setup(e,{emit:t}){const n=t,o=Kt("pinScroll",()=>{}),s=J(null);function i(){n("toggle");const r=s.value;r&&mt(()=>o(r))}return(r,l)=>(w(),T("div",{class:We(["box",{open:e.open,stacked:e.stacked,err:e.status==="error","stack-first":e.stackPosition==="first","stack-middle":e.stackPosition==="middle","stack-last":e.stackPosition==="last"}])},[_("div",{class:"bh",ref_key:"bhEl",ref:s,onClick:i},[e.icon?(w(),T("span",{key:0,class:"gl",innerHTML:e.icon,"aria-hidden":"true"},null,8,MP)):ce("",!0),_("span",EP,[_("span",TP,O(e.name),1),re(Xt,{text:e.arg},{default:Ee(()=>[e.arg?(w(),T("span",NP,O(e.arg),1)):ce("",!0)]),_:1},8,["text"])]),_("span",IP,[_("span",{class:We(["status",e.status]),role:"status","aria-label":e.status},[e.status==="ok"?(w(),we(Ve,{key:0,name:"check",size:"sm"})):e.status==="error"?(w(),we(Ve,{key:1,name:"close",size:"sm"})):e.status==="suspended"?(w(),we(Td,{key:2,status:"suspended"})):(w(),we(Td,{key:3,status:"running"}))],10,LP),On(r.$slots,"trailing"),e.time?(w(),T("span",$P,O(e.time),1)):ce("",!0)]),e.expandable?(w(),we(Ve,{key:1,class:"car",name:e.open?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])):ce("",!0)],512),_("div",{class:We(["bb",{open:e.open}]),inert:!e.open},[_("div",OP,[On(r.$slots,"default")])],10,FP)],2))}}),bm=ct(RP,[["__scopeId","data-v-fef8aad2"]]),BP={key:0,class:"at-type"},DP={key:1,class:"at-task"},PP={key:2,class:"bb-code"},HP=Ze({__name:"AgentTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e,{emit:t}){const{t:n}=Tt(),o=e,s=t;function i(v){if(!v)return{};try{const m=JSON.parse(v);return{description:typeof m.description=="string"?m.description:void 0,subagentType:typeof m.subagent_type=="string"?m.subagent_type:void 0,prompt:typeof m.prompt=="string"?m.prompt:void 0}}catch{return{}}}const r=R(()=>i(o.tool.arg)),l=R(()=>!!o.tool.output&&o.tool.output.length>0),a=R(()=>!!r.value.prompt||!!r.value.subagentType||l.value),c=J(o.tool.defaultExpanded===!0&&a.value),u=R(()=>o.tool.status),d=R(()=>Pa(o.tool.name)),f=R(()=>km(o.tool.name)),h=R(()=>r.value.description||r.value.subagentType||""),p=Kt("resolveAgentTaskId"),g=R(()=>p?p(o.tool.id)!==void 0:!0);function b(){a.value&&(c.value=!c.value)}return Qe(()=>[o.tool.defaultExpanded,o.tool.output?.length,o.tool.status],()=>{o.tool.defaultExpanded===!0&&a.value&&(c.value=!0)}),(v,m)=>(w(),we(bm,{status:u.value,icon:f.value,name:d.value,arg:c.value?"":h.value,time:e.tool.timing,open:c.value,expandable:a.value,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:b},{trailing:Ee(()=>[g.value?(w(),T("button",{key:0,type:"button",class:"at-open",onClick:m[0]||(m[0]=bt(y=>s("openAgent",e.tool.id),["stop"]))},O(C(n)("tasks.openDetail")),1)):ce("",!0)]),default:Ee(()=>[r.value.subagentType?(w(),T("div",BP,O(r.value.subagentType),1)):ce("",!0),r.value.prompt?(w(),T("div",DP,O(r.value.prompt),1)):ce("",!0),l.value?(w(),T("div",PP,[(w(!0),T(Pe,null,ot(e.tool.output??[],(y,k)=>(w(),T("div",{key:k},O(y),1))),128))])):ce("",!0)]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),WP=ct(HP,[["__scopeId","data-v-14ef8750"]]);function zP(e){if(!e)return[];try{const n=JSON.parse(e).questions;if(!Array.isArray(n))return[];const o=[];for(const s of n){if(!s||typeof s!="object")continue;const i=s,r=Array.isArray(i.options)?i.options.map(l=>{const a=l&&typeof l=="object"?l:{};return{label:typeof a.label=="string"?a.label:"",description:typeof a.description=="string"?a.description:""}}):[];o.push({question:typeof i.question=="string"?i.question:"",header:typeof i.header=="string"?i.header:"",options:r,multiSelect:i.multi_select===!0})}return o}catch{return[]}}const Uf={recognized:!1,answers:{},note:""};function UP(e){const t=e?.[0];if(!t)return Uf;let n;try{n=JSON.parse(t)}catch{return Uf}if(!n||typeof n!="object"||Array.isArray(n))return Uf;const o=n.answers;if(!o||typeof o!="object"||Array.isArray(o))return Uf;const s={};for(const[i,r]of Object.entries(o))typeof r=="string"?s[i]=r:r===!0&&(s[i]=!0);return{recognized:!0,answers:s,note:typeof n.note=="string"?n.note:""}}function qP(e,t,n){return e[t]??e[`q_${n}`]}const jP=/^opt_\d+_(\d+)$/;function VP(e,t=[]){if(e===void 0)return{selected:new Set,otherText:"",indeterminate:!1};if(e===!0)return{selected:new Set,otherText:"",indeterminate:!0};const n=new Map;t.forEach((r,l)=>{r.label.length>0&&!n.has(r.label)&&n.set(r.label,l)});const o=n.get(e);if(o!==void 0)return{selected:new Set([o]),otherText:"",indeterminate:!1};const s=new Set,i=[];for(const r of e.split(",")){const l=r.trim(),a=n.get(l);if(a!==void 0){s.add(a);continue}const c=jP.exec(l);c?s.add(Number(c[1])):l.length>0&&i.push(l)}return{selected:s,otherText:i.join(", "),indeterminate:!1}}const KP={key:0,class:"chip"},GP={key:0,class:"au-dismissed"},YP={key:1,class:"au-list"},ZP={class:"au-q"},QP={key:0,class:"au-hdr"},XP={class:"au-qtext"},JP={class:"au-opts"},eH={class:"au-glyph"},tH={class:"au-label"},nH={key:0,class:"au-desc"},oH={key:0,class:"au-opt sel"},sH={class:"au-glyph"},iH={class:"au-label"},rH={key:1,class:"au-opt sel"},lH={class:"au-label"},aH={key:2,class:"au-raw"},cH=80,uH=Ze({__name:"AskUserTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff"],setup(e){const t=e,{t:n}=Tt();function o(I,x=cH){const L=I.trim();return L.length>x?L.slice(0,x-1)+"…":L}const s=R(()=>zP(t.tool.arg)),i=R(()=>UP(t.tool.output)),r=R(()=>i.value.recognized),l=R(()=>r.value&&Object.keys(i.value.answers).length===0&&i.value.note.length>0),a=R(()=>s.value.map((I,x)=>VP(qP(i.value.answers,I.question,x),I.options))),c=R(()=>Object.keys(i.value.answers).length);function u(I,x){return a.value[I]?.selected.has(x)??!1}function d(I){return a.value[I]?.otherText??""}function f(I){return a.value[I]?.indeterminate??!1}function h(I,x){return I?x?"■":"□":x?"●":"○"}const p=R(()=>{if(!r.value)return o(t.tool.output?.[0]??"");if(l.value)return n("tools.ask.dismissed");const I=s.value[0]?.question??"",x=o(I);return s.value.length<=1?x:`${x} ${n("tools.ask.more",{count:s.value.length-1})}`}),g=R(()=>r.value?l.value?n("tools.ask.dismissed"):c.value===0?"":c.value===1?n("tools.ask.answer",{count:1}):n("tools.ask.answers",{count:c.value}):""),b=R(()=>!!t.tool.output&&t.tool.output.length>0),v=R(()=>r.value&&(s.value.length>0||l.value)||b.value),m=J(t.tool.defaultExpanded===!0&&v.value),y=R(()=>t.tool.status),k=R(()=>Pa(t.tool.name)),A=R(()=>km(t.tool.name));function $(){v.value&&(m.value=!m.value)}return Qe(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status],()=>{t.tool.defaultExpanded===!0&&v.value&&(m.value=!0)}),(I,x)=>(w(),we(bm,{status:y.value,icon:A.value,name:k.value,arg:m.value?"":p.value,time:e.tool.timing,open:m.value,expandable:v.value,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:$},{trailing:Ee(()=>[g.value?(w(),T("span",KP,O(g.value),1)):ce("",!0)]),default:Ee(()=>[l.value?(w(),T("div",GP,O(i.value.note),1)):r.value?(w(),T("div",YP,[(w(!0),T(Pe,null,ot(s.value,(L,E)=>(w(),T("div",{key:E,class:"au-block"},[_("div",ZP,[L.header?(w(),T("span",QP,O(L.header),1)):ce("",!0),_("span",XP,O(L.question),1)]),_("div",JP,[(w(!0),T(Pe,null,ot(L.options,(F,S)=>(w(),T("div",{key:S,class:We(["au-opt",{sel:u(E,S)}])},[_("span",eH,O(h(L.multiSelect,u(E,S))),1),_("span",tH,O(F.label),1),F.description?(w(),T("span",nH,O(F.description),1)):ce("",!0)],2))),128)),d(E)?(w(),T("div",oH,[_("span",sH,O(h(L.multiSelect,!0)),1),_("span",iH,O(d(E)),1)])):ce("",!0),f(E)?(w(),T("div",rH,[x[0]||(x[0]=_("span",{class:"au-glyph"},"●",-1)),_("span",lH,O(C(n)("tools.ask.answered")),1)])):ce("",!0)])]))),128))])):(w(),T("div",aH,[(w(!0),T(Pe,null,ot(e.tool.output??[],(L,E)=>(w(),T("div",{key:E},O(L),1))),128))]))]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),dH=ct(uH,[["__scopeId","data-v-a9a0f259"]]),fH=1e6,hw=5e3;function pw(e){if(e==="")return[];const t=e.split(`
68
+ `);return t.at(-1)===""&&t.pop(),t}function hH(e,t){const n=pw(e),o=pw(t),s=n.length,i=o.length;if(s===0&&i===0)return[];if(s>hw||i>hw||(s+1)*(i+1)>fH)return null;const r=Array.from({length:s+1},()=>Array.from({length:i+1},()=>0));for(let h=1;h<=s;h++)for(let p=1;p<=i;p++)r[h][p]=n[h-1]===o[p-1]?r[h-1][p-1]+1:Math.max(r[h-1][p],r[h][p-1]);const l=[];let a=s,c=i;for(;a>0||c>0;)a>0&&c>0&&n[a-1]===o[c-1]?(l.push({type:"context",text:n[a-1]}),a--,c--):c>0&&(a===0||r[a][c-1]>=r[a-1][c])?(l.push({type:"add",text:o[c-1]}),c--):(l.push({type:"del",text:n[a-1]}),a--);l.reverse();const u=[];let d=1,f=1;for(const h of l)h.type==="context"?(u.push({type:"context",text:h.text,oldNo:d,newNo:f}),d++,f++):h.type==="add"?(u.push({type:"add",text:h.text,newNo:f}),f++):(u.push({type:"del",text:h.text,oldNo:d}),d++);return u}function pH(e){let t=0,n=0;for(const o of e)o.type==="add"?t++:o.type==="del"&&n++;return{added:t,removed:n}}function AA(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 MA(e){const t=Da(e.name);if(t!=="edit"&&t!=="write")return null;const n=AA(e.arg);if(!n)return null;if(t==="edit"){if(n.replace_all===!0)return null;const o=typeof n.old_string=="string"?n.old_string:void 0,s=typeof n.new_string=="string"?n.new_string:void 0;return o===void 0||s===void 0?null:hH(o,s)}return null}function mH(e){const t=AA(e);return t&&typeof t.path=="string"?t.path:void 0}function gH(e,t){for(const n of e){const o=n.tools?.find(s=>s.id===t);if(o)return o}}const vH={key:0,class:"bb-empty"},mw=50,yH=Ze({__name:"ToolOutputBlock",props:{lines:{},emptyText:{}},setup(e){const t=e,n=R(()=>t.lines??[]),o=R(()=>n.value.length>mw),s={"--tool-output-visible-lines":String(mw)};return(i,r)=>(w(),T("div",{class:We(["bb-code tool-output-block",{scroll:o.value}]),style:s},[n.value.length===0&&e.emptyText?(w(),T("div",vH,O(e.emptyText),1)):ce("",!0),(w(!0),T(Pe,null,ot(n.value,(l,a)=>(w(),T("div",{key:a},O(l),1))),128))],2))}}),EA=ct(yH,[["__scopeId","data-v-262bbea0"]]),kH={key:0,class:"chip"},bH={key:0,class:"bb-summary"},xH=Ze({__name:"EditTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff"],setup(e,{emit:t}){const n=e,o=t,s=R(()=>n.tool.status),i=R(()=>Pa(n.tool.name)),r=R(()=>km(n.tool.name)),l=R(()=>Ed(n.tool.name,n.tool.arg)),a=R(()=>Ed(n.tool.name,n.tool.arg,!0)),c=R(()=>MA(n.tool)),u=R(()=>{const g=c.value;if(g&&n.tool.status!=="error"){const{added:b,removed:v}=pH(g);if(b||v)return`+${b} −${v}`}return""}),d=R(()=>!!n.tool.output&&n.tool.output.length>0),f=J(!1),h=R(()=>d.value&&!n.toolDiffPanel);function p(){if(n.toolDiffPanel){o("openToolDiff",n.tool.id);return}d.value&&(f.value=!f.value)}return(g,b)=>(w(),we(bm,{status:s.value,icon:r.value,name:i.value,arg:f.value?"":l.value,time:e.tool.timing,open:f.value,expandable:h.value||e.toolDiffPanel,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:p},{trailing:Ee(()=>[u.value?(w(),T("span",kH,O(u.value),1)):ce("",!0)]),default:Ee(()=>[a.value?(w(),T("div",bH,O(a.value),1)):ce("",!0),re(EA,{lines:e.tool.output,"empty-text":"Waiting for output…"},null,8,["lines"])]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),wH=ct(xH,[["__scopeId","data-v-74e1da99"]]),_H={key:0,class:"chip"},SH={key:0,class:"bb-summary"},CH=Ze({__name:"GenericTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff"],setup(e){const t=e,n=R(()=>t.tool.status==="running"&&/^bash$/i.test(t.tool.name)),o=R(()=>!!t.tool.output&&t.tool.output.length>0),s=R(()=>o.value||n.value),i=J(t.tool.defaultExpanded===!0&&s.value),r=R(()=>t.tool.status),l=R(()=>Pa(t.tool.name)),a=R(()=>km(t.tool.name)),c=R(()=>Ed(t.tool.name,t.tool.arg)),u=R(()=>Ed(t.tool.name,t.tool.arg,!0)),d=R(()=>CP({name:t.tool.name,arg:t.tool.arg,output:t.tool.output,timing:t.tool.timing,status:t.tool.status}));function f(){s.value&&(i.value=!i.value)}return Qe(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status,t.tool.name],()=>{t.tool.defaultExpanded===!0&&s.value&&(i.value=!0)}),(h,p)=>(w(),we(bm,{status:r.value,icon:a.value,name:l.value,arg:i.value?"":c.value,time:e.tool.name!=="bash"?e.tool.timing:"",open:i.value,expandable:s.value,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:f},{trailing:Ee(()=>[d.value?(w(),T("span",_H,O(d.value),1)):ce("",!0)]),default:Ee(()=>[u.value?(w(),T("div",SH,O(u.value),1)):ce("",!0),re(EA,{lines:e.tool.output,"empty-text":"Waiting for output…"},null,8,["lines"])]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),AH=ct(CH,[["__scopeId","data-v-aa4edcb0"]]),MH={class:"media-title"},EH=["src","alt"],TH=["src"],NH=["src"],IH=Ze({__name:"MediaTool",props:{tool:{},mobile:{type:Boolean,default:!1}},emits:["openMedia"],setup(e,{emit:t}){const n=e,o=t,s=R(()=>n.tool.status==="ok"?n.tool.media:void 0);function i(c){return c.split(/[\\/]+/).pop()||c}function r(c){return c<1024?`${c} B`:c<1024*1024?`${(c/1024).toFixed(1)} KB`:`${(c/1024/1024).toFixed(1)} MB`}const l=R(()=>{const c=s.value;if(!c)return"";const u=[c.path?i(c.path):n.tool.name];return c.mimeType&&u.push(c.mimeType),c.bytes!==void 0&&u.push(r(c.bytes)),c.dimensions&&u.push(c.dimensions),u.join(" · ")});function a(){const c=s.value;c?.kind==="image"&&o("openMedia",c)}return(c,u)=>s.value?(w(),T("div",{key:0,class:We(["media-tool",{mob:e.mobile}])},[re(Xt,{text:s.value.path||l.value},{default:Ee(()=>[_("div",MH,O(l.value),1)]),_:1},8,["text"]),s.value.kind==="image"?(w(),we(Xt,{key:0,text:s.value.path||l.value},{default:Ee(()=>[_("button",{type:"button",class:"media-image-button",onClick:a},[_("img",{class:"media-image",src:s.value.url,alt:s.value.path?i(s.value.path):l.value,loading:"lazy"},null,8,EH)])]),_:1},8,["text"])):s.value.kind==="video"?(w(),T("video",{key:1,class:"media-video",src:s.value.url,controls:"",preload:"metadata"},null,8,TH)):(w(),T("audio",{key:2,class:"media-audio",src:s.value.url,controls:""},null,8,NH))],2)):ce("",!0)}}),LH=ct(IH,[["__scopeId","data-v-bec13b73"]]),$H=/<summary>([\s\S]*?)<\/summary>/,FH=/<resume_hint>([\s\S]*?)<\/resume_hint>/,h0=/<subagent\b([^>]*)>|<\/subagent>/g,OH="</subagent>",gw=/(completed|failed|aborted):\s*(\d+)/g,vw=/([a-z_]+)="([^"]*)"/g;function RH(e){return e.replaceAll("&quot;",'"').replaceAll("&lt;","<").replaceAll("&gt;",">").replaceAll("&amp;","&")}function BH(e){const t={};vw.lastIndex=0;let n;for(;(n=vw.exec(e))!==null;)t[n[1]]=RH(n[2]);return t}function DH(e){const t={completed:0,failed:0,aborted:0};gw.lastIndex=0;let n;for(;(n=gw.exec(e))!==null;){const o=n[1];t[o]=Number(n[2])}return t}function PH(e,t){const n=BH(e);return{outcome:n.outcome??"completed",item:n.item,agentId:n.agent_id,mode:n.mode,state:n.state,body:t.trim()}}function HH(e){const t=[],n=[];h0.lastIndex=0;let o;for(;(o=h0.exec(e))!==null;)if(o[0]===OH){if(n.length===0)continue;const s=n.pop();s&&n.length===0&&t.push(PH(s.attrs,e.slice(s.bodyStart,o.index)))}else n.length===0?n.push({attrs:o[1]??"",bodyStart:h0.lastIndex}):n.push(null);return t}function WH(e){if(e==null)return null;const t=Array.isArray(e)?e.join(`
69
+ `):e;if(!t.includes("<agent_swarm_result>"))return null;const n=$H.exec(t)?.[1]?.trim()??"",{completed:o,failed:s,aborted:i}=DH(n),r=FH.exec(t)?.[1]?.trim(),l=HH(t),a=o+s+i;return{summary:n,completed:o,failed:s,aborted:i,total:a>0?a:l.length,subagents:l,resumeHint:r}}function yw(e){return e?e.split(`
70
+ `).map(t=>t.trimEnd()).filter(Boolean).at(-1)??"":""}function zH(e){return e.suspendedReason||yw(e.text)||yw(e.outputLines?.join(`
71
+ `))||e.summary||""}function UH(e){return e.suspendedReason?e.suspendedReason:e.text?e.text:e.outputLines&&e.outputLines.length>0?e.outputLines.join(`
72
+ `):e.summary??""}function qH(e){return e==="completed"?"completed":e==="failed"||e==="aborted"?"failed":"working"}function kw(e,t){return{id:e.agentId??e.item??`result-${t}`,name:e.item??`subagent ${t+1}`,activity:e.body.split(`
73
+ `)[0]??"",phase:qH(e.outcome),body:e.body}}function jH(e,t){return!!(t.agentId&&e.id===t.agentId||t.item&&e.name.includes(t.item))}function VH(e,t){const n=e.map(s=>({id:s.id,name:s.name,activity:zH(s),phase:s.phase,body:UH(s)}));if(!t)return n;const o=t.subagents.filter(s=>(s.outcome==="aborted"||s.state==="not_started")&&!e.some(i=>jH(i,s))).map((s,i)=>kw(s,i));return n.length>0?[...n,...o]:t.subagents.map((s,i)=>kw(s,i))}const KH=["aria-expanded"],GH={class:"title"},YH={key:0,class:"meta"},ZH={key:1,class:"sum-txt"},QH={class:"rt"},XH={class:"status"},JH={key:0,class:"chip"},eW={key:1,class:"tm"},tW={class:"body"},nW={class:"overview"},oW={class:"overview-line"},sW={class:"big"},iW={key:0,class:"lbl"},rW={key:1,class:"lbl"},lW={key:2,class:"lbl"},aW={key:0,class:"seg","aria-hidden":"true"},cW={key:1,class:"legend"},uW=["aria-expanded","onClick"],dW={class:"mname"},fW={class:"mact"},hW={class:"mphase"},pW={key:1,class:"fallback-output"},mW={key:2,class:"waiting"},gW=Ze({__name:"SwarmTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e){const{t}=Tt(),n=e;function o(E){if(!E)return{};try{const F=JSON.parse(E),S=Array.isArray(F.items)?F.items:void 0;return{description:typeof F.description=="string"?F.description:void 0,itemCount:S?.length}}catch{return{}}}const s=Kt("resolveSwarmMembers"),i=R(()=>o(n.tool.arg)),r=R(()=>Pa(n.tool.name)),l=R(()=>i.value.description??""),a=R(()=>s?.(n.tool.id)??[]),c=R(()=>WH(n.tool.output)),u=R(()=>n.tool.status),d=R(()=>u.value==="running"?"running":u.value==="error"||(c.value?.failed??0)>0||(c.value?.aborted??0)>0?"error":"ok"),f=R(()=>VH(a.value,c.value)),h=R(()=>{const E={completed:0,working:0,suspended:0,queued:0,failed:0};for(const F of f.value)E[F.phase]++;return E}),p=R(()=>f.value.length||i.value.itemCount||0),g=R(()=>h.value.completed+h.value.failed),b=R(()=>h.value.working+h.value.suspended+h.value.queued),v=[{phase:"completed",cls:"s-ok"},{phase:"working",cls:"s-run"},{phase:"suspended",cls:"s-warn"},{phase:"failed",cls:"s-fail"},{phase:"queued",cls:"s-queue"}],m=R(()=>v.map(({phase:E,cls:F})=>({phase:E,count:h.value[E],cls:F})).filter(E=>E.count>0)),y=J(u.value==="running"||b.value>0);function k(){y.value=!y.value}const A=R(()=>f.value.length>0||c.value||u.value==="running"?"":(n.tool.output??[]).join(`
74
+ `).trim()),$=J(new Set);function I(E){const F=new Set($.value);F.has(E)?F.delete(E):F.add(E),$.value=F}function x(E){return $.value.has(E)}function L(E){return t(`tools.swarm.phase${E[0].toUpperCase()}${E.slice(1)}`)}return(E,F)=>(w(),T("div",{class:We(["swarm-card",{open:y.value,err:d.value==="error",stacked:e.stackPosition!=="single"}])},[_("button",{class:"head",type:"button","aria-expanded":y.value,onClick:k},[re(Ve,{class:"ic",name:"git-pull-request",size:"sm"}),_("span",GH,O(r.value),1),l.value?(w(),T("span",YH,"·")):ce("",!0),l.value?(w(),T("span",ZH,O(l.value),1)):ce("",!0),_("span",QH,[_("span",XH,[d.value==="ok"?(w(),we(Ve,{key:0,name:"check",size:"sm"})):d.value==="error"?(w(),we(Ve,{key:1,name:"close",size:"sm"})):(w(),we(Td,{key:2,status:"running"}))]),g.value>0||p.value>0?(w(),T("span",JH,O(g.value)+" / "+O(p.value),1)):ce("",!0),e.tool.timing?(w(),T("span",eW,O(e.tool.timing),1)):ce("",!0)]),re(Ve,{class:"car",name:y.value?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])],8,KH),Fn(_("div",tW,[_("div",nW,[_("div",oW,[_("span",sW,O(C(t)("tools.swarm.progress",{done:g.value,total:p.value})),1),d.value==="running"&&p.value>0?(w(),T("span",iW,O(C(t)("tools.swarm.runningSub",{count:b.value})),1)):c.value?(w(),T("span",rW,O(C(t)("tools.swarm.doneSub",{completed:c.value.completed,failed:c.value.failed+c.value.aborted})),1)):(w(),T("span",lW,O(C(t)("tools.swarm.waiting")),1))]),p.value>0&&m.value.length>0?(w(),T("div",aW,[(w(!0),T(Pe,null,ot(m.value,S=>(w(),T("span",{key:S.phase,class:We(S.cls),style:Yt({flex:S.count})},null,6))),128))])):ce("",!0),m.value.length>1?(w(),T("div",cW,[(w(!0),T(Pe,null,ot(m.value,S=>(w(),T("span",{key:S.phase},[_("i",{class:We(["lg-dot",S.cls])},null,2),Je(O(L(S.phase))+" "+O(S.count),1)]))),128))])):ce("",!0)]),f.value.length>0?(w(!0),T(Pe,{key:0},ot(f.value,S=>(w(),T("div",{key:S.id,class:We(["member",[`phase-${S.phase}`,{open:x(S.id)}]])},[_("button",{class:"member-head",type:"button","aria-expanded":x(S.id),onClick:N=>I(S.id)},[re(Td,{class:"row-dot",status:S.phase},null,8,["status"]),re(Xt,{text:S.name},{default:Ee(()=>[_("span",dW,O(S.name),1)]),_:2},1032,["text"]),S.activity?(w(),we(Xt,{key:0,text:S.activity},{default:Ee(()=>[_("span",fW,O(S.activity),1)]),_:2},1032,["text"])):ce("",!0),_("span",hW,O(L(S.phase)),1),re(Ve,{class:"mcar",name:x(S.id)?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])],8,uW),Fn(_("div",{class:"member-body"},O(S.body),513),[[mi,x(S.id)]])],2))),128)):A.value?(w(),T("div",pW,O(A.value),1)):(w(),T("div",mW,O(C(t)("tools.swarm.waiting")),1))],512),[[mi,y.value]])],2))}}),vW=ct(gW,[["__scopeId","data-v-4b58e128"]]);function yW(e){if(e.media&&e.status==="ok")return LH;const t=Da(e.name);return t==="edit"||t==="write"||t==="multi_edit"?wH:t==="task"?WP:t==="agentswarm"?vW:t==="askuserquestion"?dH:AH}const TA=Ze({__name:"ToolCall",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e,{emit:t}){const n=e,o=t,s=R(()=>yW(n.tool));return(i,r)=>(w(),we(jo(s.value),{tool:e.tool,mobile:e.mobile,"stack-position":e.stackPosition,"tool-diff-panel":e.toolDiffPanel,"data-scroll-anchor-id":e.tool.id,onOpenMedia:r[0]||(r[0]=l=>o("openMedia",l)),onOpenFile:r[1]||(r[1]=l=>o("openFile",l)),onOpenToolDiff:r[2]||(r[2]=l=>o("openToolDiff",l)),onOpenAgent:r[3]||(r[3]=l=>o("openAgent",l))},null,40,["tool","mobile","stack-position","tool-diff-panel","data-scroll-anchor-id"]))}});function ir(e){if(e>=1024*1024)return`${bw(e/(1024*1024))}M`;if(e>=1024){const t=e/1024;return`${t>=100?Math.round(t):bw(t)}k`}return String(e)}function bw(e){const t=e.toFixed(1);return t.endsWith(".0")?t.slice(0,-2):t}function kW(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 xm(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 bW(e){return!(e.tool.status==="ok"&&e.tool.media)}function xW(e,t){return t<=1?"single":e===0?"first":e===t-1?"last":"middle"}function wW(e){const t=xm(e),n=[];let o=[];const s=()=>{if(o.length===1){const[i]=o;i&&n.push({kind:"tool",tool:i.tool,sourceIndex:i.sourceIndex})}else o.length>1&&n.push({kind:"tool-stack",tools:o});o=[]};return t.forEach((i,r)=>{if(i.kind==="tool"){if(bW(i)){o.push({tool:i.tool,sourceIndex:r});return}s(),n.push({kind:"tool",tool:i.tool,sourceIndex:r});return}s(),i.kind==="thinking"?n.push({kind:"thinking",thinking:i.thinking,sourceIndex:r}):i.kind==="text"&&n.push({kind:"text",text:i.text,sourceIndex:r})}),s(),n}function _W(e){return xm(e).flatMap(t=>t.kind==="text"&&t.text?[t.text]:[]).join(`
75
+
76
+ `)}function SW(e){const t=[];for(const n of xm(e))if(n.kind==="thinking"&&n.thinking)t.push(`> **Thinking**
77
+ > ${n.thinking.split(`
78
+ `).join(`
79
+ > `)}`);else if(n.kind==="text"&&n.text)t.push(n.text);else if(n.kind==="tool"&&n.tool.output&&n.tool.output.length>0){const o=n.tool.output.join(`
80
+ `);t.push(`\`\`\`
81
+ [${n.tool.name}]
82
+ ${o}
83
+ \`\`\``)}return t.join(`
84
+
85
+ `)}function NA(e){return e.tool.id||`tool-${e.sourceIndex}`}function CW(e,t){return e.kind==="tool-stack"?`tool-stack-${e.tools[0]?.sourceIndex??t}`:e.kind==="tool"?NA({tool:e.tool,sourceIndex:e.sourceIndex}):`${e.kind}-${e.sourceIndex}`}const AW=["aria-expanded"],MW={class:"tg-title"},EW={class:"tg-meta"},TW=["inert"],NW={class:"tool-group-body-inner"},IW=Ze({__name:"ToolGroup",props:{tools:{},mobile:{type:Boolean,default:!1},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e,{emit:t}){const n=e,o=t,s=J(!0),i=R(()=>n.tools.length),r=R(()=>n.tools.some(h=>h.tool.status==="running")?"running":n.tools.some(h=>h.tool.status==="error")?"error":"done"),{t:l}=Tt(),a=R(()=>{switch(r.value){case"running":return l("tools.group.running");case"error":return l("tools.group.error");default:return l("tools.group.done")}});function c(){s.value=!s.value}const u=Kt("pinScroll",()=>{}),d=J(null);function f(){c();const h=d.value;h&&mt(()=>u(h))}return(h,p)=>(w(),T("div",{class:We(["tool-group",{open:s.value}])},[_("button",{class:"tool-group-head",ref_key:"headEl",ref:d,type:"button","aria-expanded":s.value,onClick:f},[re(Td,{status:r.value},null,8,["status"]),re(Ve,{class:"tg-ic",name:"list",size:"sm"}),_("span",MW,O(C(l)("tools.group.title",i.value)),1),_("span",EW,"· "+O(a.value),1),re(Ve,{class:"tg-car",name:"chevron-right",size:"sm"})],8,AW),_("div",{class:We(["tool-group-body",{open:s.value}]),inert:!s.value},[_("div",NW,[(w(!0),T(Pe,null,ot(e.tools,(g,b)=>(w(),we(TA,{key:C(NA)(g),tool:g.tool,mobile:e.mobile,"stack-position":C(xW)(b,e.tools.length),"tool-diff-panel":e.toolDiffPanel,onOpenMedia:p[0]||(p[0]=v=>o("openMedia",v)),onOpenFile:p[1]||(p[1]=v=>o("openFile",v)),onOpenToolDiff:p[2]||(p[2]=v=>o("openToolDiff",v)),onOpenAgent:p[3]||(p[3]=v=>o("openAgent",v))},null,8,["tool","mobile","stack-position","tool-diff-panel"]))),128))])],10,TW)],2))}}),LW=ct(IW,[["__scopeId","data-v-37eb334f"]]);var $W=Object.create,Hy=Object.defineProperty,FW=Object.getOwnPropertyDescriptor,IA=Object.getOwnPropertyNames,OW=Object.getPrototypeOf,RW=Object.prototype.hasOwnProperty,LA=(e,t)=>function(){return t||(0,e[IA(e)[0]])((t={exports:{}}).exports,t),t.exports},$A=e=>{let t={};for(var n in e)Hy(t,n,{get:e[n],enumerable:!0});return t},BW=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(var s=IA(t),i=0,r=s.length,l;i<r;i++)l=s[i],!RW.call(e,l)&&l!==n&&Hy(e,l,{get:(a=>t[a]).bind(null,l),enumerable:!(o=FW(t,l))||o.enumerable});return e},FA=(e,t,n)=>(n=e!=null?$W(OW(e)):{},BW(Hy(n,"default",{value:e,enumerable:!0}),e));function DW(e,t,n,o){const s=Number(e[t].meta.id+1).toString();let i="";return typeof o.docId=="string"&&(i=`-${o.docId}-`),i+s}function PW(e,t){let n=Number(e[t].meta.id+1).toString();return e[t].meta.subId>0&&(n+=`:${e[t].meta.subId}`),`[${n}]`}function HW(e,t,n,o,s){const i=s.rules.footnote_anchor_name(e,t,n,o,s),r=s.rules.footnote_caption(e,t,n,o,s);let l=i;return e[t].meta.subId>0&&(l+=`:${e[t].meta.subId}`),`<sup class="footnote-ref"><a href="#fn${i}" id="fnref${l}">${r}</a></sup>`}function WW(e,t,n){return(n.xhtmlOut?`<hr class="footnotes-sep" />
86
+ `:`<hr class="footnotes-sep">
87
+ `)+`<section class="footnotes">
88
+ <ol class="footnotes-list">
89
+ `}function zW(){return`</ol>
90
+ </section>
91
+ `}function UW(e,t,n,o,s){let i=s.rules.footnote_anchor_name(e,t,n,o,s);return e[t].meta.subId>0&&(i+=`:${e[t].meta.subId}`),`<li id="fn${i}" class="footnote-item">`}function qW(){return`</li>
92
+ `}function jW(e,t,n,o,s){let i=s.rules.footnote_anchor_name(e,t,n,o,s);return e[t].meta.subId>0&&(i+=`:${e[t].meta.subId}`),` <a href="#fnref${i}" class="footnote-backref">↩︎</a>`}function VW(e){const t=e.helpers.parseLinkLabel,n=e.utils.isSpace;e.renderer.rules.footnote_ref=HW,e.renderer.rules.footnote_block_open=WW,e.renderer.rules.footnote_block_close=zW,e.renderer.rules.footnote_open=UW,e.renderer.rules.footnote_close=qW,e.renderer.rules.footnote_anchor=jW,e.renderer.rules.footnote_caption=PW,e.renderer.rules.footnote_anchor_name=DW;function o(l,a,c,u){const d=l.bMarks[a]+l.tShift[a],f=l.eMarks[a];if(d+4>f||l.src.charCodeAt(d)!==91||l.src.charCodeAt(d+1)!==94)return!1;let h;for(h=d+2;h<f;h++){if(l.src.charCodeAt(h)===32)return!1;if(l.src.charCodeAt(h)===93)break}if(h===d+2||h+1>=f||l.src.charCodeAt(++h)!==58)return!1;if(u)return!0;h++,l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.refs||(l.env.footnotes.refs={});const p=l.src.slice(d+2,h-2);l.env.footnotes.refs[`:${p}`]=-1;const g=new l.Token("footnote_reference_open","",1);g.meta={label:p},g.level=l.level++,l.tokens.push(g);const b=l.bMarks[a],v=l.tShift[a],m=l.sCount[a],y=l.parentType,k=h,A=l.sCount[a]+h-(l.bMarks[a]+l.tShift[a]);let $=A;for(;h<f;){const x=l.src.charCodeAt(h);if(n(x))x===9?$+=4-$%4:$++;else break;h++}l.tShift[a]=h-k,l.sCount[a]=$-A,l.bMarks[a]=k,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=y,l.blkIndent-=4,l.tShift[a]=v,l.sCount[a]=m,l.bMarks[a]=b;const I=new l.Token("footnote_reference_close","",-1);return I.level=--l.level,l.tokens.push(I),!0}function s(l,a){const c=l.posMax,u=l.pos;if(u+2>=c||l.src.charCodeAt(u)!==94||l.src.charCodeAt(u+1)!==91)return!1;const d=u+2,f=t(l,u+1);if(f<0)return!1;if(!a){l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.list||(l.env.footnotes.list=[]);const h=l.env.footnotes.list.length,p=[];l.md.inline.parse(l.src.slice(d,f),l.md,l.env,p);const g=l.push("footnote_ref","",0);g.meta={id:h},l.env.footnotes.list[h]={content:l.src.slice(d,f),tokens:p}}return l.pos=f+1,l.posMax=c,!0}function i(l,a){const c=l.posMax,u=l.pos;if(u+3>c||!l.env.footnotes||!l.env.footnotes.refs||l.src.charCodeAt(u)!==91||l.src.charCodeAt(u+1)!==94)return!1;let d;for(d=u+2;d<c;d++){if(l.src.charCodeAt(d)===32||l.src.charCodeAt(d)===10)return!1;if(l.src.charCodeAt(d)===93)break}if(d===u+2||d>=c)return!1;d++;const f=l.src.slice(u+2,d-1);if(typeof l.env.footnotes.refs[`:${f}`]>"u")return!1;if(!a){l.env.footnotes.list||(l.env.footnotes.list=[]);let h;l.env.footnotes.refs[`:${f}`]<0?(h=l.env.footnotes.list.length,l.env.footnotes.list[h]={label:f,count:0},l.env.footnotes.refs[`:${f}`]=h):h=l.env.footnotes.refs[`:${f}`];const p=l.env.footnotes.list[h].count;l.env.footnotes.list[h].count++;const g=l.push("footnote_ref","",0);g.meta={id:h,subId:p,label:f}}return l.pos=d,l.posMax=c,!0}function r(l){let a,c,u,d=!1;const f={};if(!l.env.footnotes||(l.tokens=l.tokens.filter(function(p){return p.type==="footnote_reference_open"?(d=!0,c=[],u=p.meta.label,!1):p.type==="footnote_reference_close"?(d=!1,f[":"+u]=c,!1):(d&&c.push(p),!d)}),!l.env.footnotes.list))return;const h=l.env.footnotes.list;l.tokens.push(new l.Token("footnote_block_open","",1));for(let p=0,g=h.length;p<g;p++){const b=new l.Token("footnote_open","",1);if(b.meta={id:p,label:h[p].label},l.tokens.push(b),h[p].tokens){a=[];const y=new l.Token("paragraph_open","p",1);y.block=!0,a.push(y);const k=new l.Token("inline","",0);k.children=h[p].tokens,k.content=h[p].content,a.push(k);const A=new l.Token("paragraph_close","p",-1);A.block=!0,a.push(A)}else h[p].label&&(a=f[`:${h[p].label}`]);a&&(l.tokens=l.tokens.concat(a));let v;l.tokens[l.tokens.length-1].type==="paragraph_close"?v=l.tokens.pop():v=null;const m=h[p].count>0?h[p].count:1;for(let y=0;y<m;y++){const k=new l.Token("footnote_anchor","",0);k.meta={id:p,subId:y,label:h[p].label},l.tokens.push(k)}v&&l.tokens.push(v),l.tokens.push(new l.Token("footnote_close","",-1))}l.tokens.push(new l.Token("footnote_block_close","",-1))}e.block.ruler.before("reference","footnote_def",o,{alt:["paragraph","reference"]}),e.inline.ruler.after("image","footnote_inline",s),e.inline.ruler.after("footnote_inline","footnote_ref",i),e.core.ruler.after("inline","footnote_tail",r)}function KW(e){function t(o,s){const i=o.pos,r=o.src.charCodeAt(i);if(s||r!==43)return!1;const l=o.scanDelims(o.pos,!0);let a=l.length;const c=String.fromCharCode(r);if(a<2)return!1;if(a%2){const u=o.push("text","",0);u.content=c,a--}for(let u=0;u<a;u+=2){const d=o.push("text","",0);d.content=c+c,!(!l.can_open&&!l.can_close)&&o.delimiters.push({marker:r,length:0,jump:u/2,token:o.tokens.length-1,end:-1,open:l.can_open,close:l.can_close})}return o.pos+=l.length,!0}function n(o,s){let i;const r=[],l=s.length;for(let a=0;a<l;a++){const c=s[a];if(c.marker!==43||c.end===-1)continue;const u=s[c.end];i=o.tokens[c.token],i.type="ins_open",i.tag="ins",i.nesting=1,i.markup="++",i.content="",i=o.tokens[u.token],i.type="ins_close",i.tag="ins",i.nesting=-1,i.markup="++",i.content="",o.tokens[u.token-1].type==="text"&&o.tokens[u.token-1].content==="+"&&r.push(u.token-1)}for(;r.length;){const a=r.pop();let c=a+1;for(;c<o.tokens.length&&o.tokens[c].type==="ins_close";)c++;c--,a!==c&&(i=o.tokens[c],o.tokens[c]=o.tokens[a],o.tokens[a]=i)}}e.inline.ruler.before("emphasis","ins",t),e.inline.ruler2.before("emphasis","ins",function(o){const s=o.tokens_meta,i=(o.tokens_meta||[]).length;n(o,o.delimiters);for(let r=0;r<i;r++)s[r]&&s[r].delimiters&&n(o,s[r].delimiters)})}function GW(e){function t(o,s){const i=o.pos,r=o.src.charCodeAt(i);if(s||r!==61)return!1;const l=o.scanDelims(o.pos,!0);let a=l.length;const c=String.fromCharCode(r);if(a<2)return!1;if(a%2){const u=o.push("text","",0);u.content=c,a--}for(let u=0;u<a;u+=2){const d=o.push("text","",0);d.content=c+c,!(!l.can_open&&!l.can_close)&&o.delimiters.push({marker:r,length:0,jump:u/2,token:o.tokens.length-1,end:-1,open:l.can_open,close:l.can_close})}return o.pos+=l.length,!0}function n(o,s){const i=[],r=s.length;for(let l=0;l<r;l++){const a=s[l];if(a.marker!==61||a.end===-1)continue;const c=s[a.end],u=o.tokens[a.token];u.type="mark_open",u.tag="mark",u.nesting=1,u.markup="==",u.content="";const d=o.tokens[c.token];d.type="mark_close",d.tag="mark",d.nesting=-1,d.markup="==",d.content="",o.tokens[c.token-1].type==="text"&&o.tokens[c.token-1].content==="="&&i.push(c.token-1)}for(;i.length;){const l=i.pop();let a=l+1;for(;a<o.tokens.length&&o.tokens[a].type==="mark_close";)a++;if(a--,l!==a){const c=o.tokens[a];o.tokens[a]=o.tokens[l],o.tokens[l]=c}}}e.inline.ruler.before("emphasis","mark",t),e.inline.ruler2.before("emphasis","mark",function(o){let s;const i=o.tokens_meta,r=(o.tokens_meta||[]).length;for(n(o,o.delimiters),s=0;s<r;s++)i[s]&&i[s].delimiters&&n(o,i[s].delimiters)})}const YW=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function ZW(e,t){const n=e.posMax,o=e.pos;if(e.src.charCodeAt(o)!==126||t||o+2>=n)return!1;e.pos=o+1;let s=!1;for(;e.pos<n;){if(e.src.charCodeAt(e.pos)===126){s=!0;break}e.md.inline.skipToken(e)}if(!s||o+1===e.pos)return e.pos=o,!1;const i=e.src.slice(o+1,e.pos);if(i.match(/(^|[^\\])(\\\\)*\s/))return e.pos=o,!1;e.posMax=e.pos,e.pos=o+1;const r=e.push("sub_open","sub",1);r.markup="~";const l=e.push("text","",0);l.content=i.replace(YW,"$1");const a=e.push("sub_close","sub",-1);return a.markup="~",e.pos=e.posMax+1,e.posMax=n,!0}function QW(e){e.inline.ruler.after("emphasis","sub",ZW)}const XW=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function JW(e,t){const n=e.posMax,o=e.pos;if(e.src.charCodeAt(o)!==94||t||o+2>=n)return!1;e.pos=o+1;let s=!1;for(;e.pos<n;){if(e.src.charCodeAt(e.pos)===94){s=!0;break}e.md.inline.skipToken(e)}if(!s||o+1===e.pos)return e.pos=o,!1;const i=e.src.slice(o+1,e.pos);if(i.match(/(^|[^\\])(\\\\)*\s/))return e.pos=o,!1;e.posMax=e.pos,e.pos=o+1;const r=e.push("sup_open","sup",1);r.markup="^";const l=e.push("text","",0);l.content=i.replace(XW,"$1");const a=e.push("sup_close","sup",-1);return a.markup="^",e.pos=e.posMax+1,e.posMax=n,!0}function ez(e){e.inline.ruler.after("emphasis","sup",JW)}var tz=LA({"../../node_modules/.pnpm/markdown-it-task-checkbox@1.0.6/node_modules/markdown-it-task-checkbox/index.js":((e,t)=>{t.exports=function(g,b){b=Object.assign({},{disabled:!0,divWrap:!1,divClass:"checkbox",idPrefix:"cbx_",ulClass:"task-list",liClass:"task-list-item"},b),g.core.ruler.after("inline","github-task-lists",function(v){for(var m=v.tokens,y=0,k=2;k<m.length;k++)s(m,k)&&(i(m[k],y,b,v.Token),y+=1,n(m[k-2],"class",b.liClass),n(m[o(m,k-2)],"class",b.ulClass))})};function n(g,b,v){var m=g.attrIndex(b),y=[b,v];m<0?g.attrPush(y):g.attrs[m]=y}function o(g,b){for(var v=g[b].level-1,m=b-1;m>=0;m--)if(g[m].level===v)return m;return-1}function s(g,b){return d(g[b])&&f(g[b-1])&&h(g[b-2])&&p(g[b])}function i(g,b,v,m){var y=v.idPrefix+b;g.children[0].content=g.children[0].content.slice(3),g.children.unshift(l(y,m)),g.children.push(a(m)),g.children.unshift(r(g,y,v,m)),v.divWrap&&(g.children.unshift(c(v,m)),g.children.push(u(m)))}function r(g,b,v,m){var y=new m("checkbox_input","input",0);return y.attrs=[["type","checkbox"],["id",b]],/^\[[xX]\][ \u00A0]/.test(g.content)===!0&&y.attrs.push(["checked","true"]),v.disabled===!0&&y.attrs.push(["disabled","true"]),y}function l(g,b){var v=new b("label_open","label",1);return v.attrs=[["for",g]],v}function a(g){return new g("label_close","label",-1)}function c(g,b){var v=new b("checkbox_open","div",0);return v.attrs=[["class",g.divClass]],v}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 h(g){return g.type==="list_item_open"}function p(g){return/^\[[xX \u00A0]\][ \u00A0]/.test(g.content)}})}),nz=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))),oz=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0))),p0;const sz=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]]),iz=(p0=String.fromCodePoint)!==null&&p0!==void 0?p0: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 rz(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=sz.get(e))!==null&&t!==void 0?t:e}var Ro;(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"})(Ro||(Ro={}));const lz=32;var bl;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(bl||(bl={}));function nv(e){return e>=Ro.ZERO&&e<=Ro.NINE}function az(e){return e>=Ro.UPPER_A&&e<=Ro.UPPER_F||e>=Ro.LOWER_A&&e<=Ro.LOWER_F}function cz(e){return e>=Ro.UPPER_A&&e<=Ro.UPPER_Z||e>=Ro.LOWER_A&&e<=Ro.LOWER_Z||nv(e)}function uz(e){return e===Ro.EQUALS||cz(e)}var Oo;(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"})(Oo||(Oo={}));var vl;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(vl||(vl={}));var dz=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=Oo.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=vl.Strict}startEntity(e){this.decodeMode=e,this.state=Oo.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case Oo.EntityStart:return e.charCodeAt(t)===Ro.NUM?(this.state=Oo.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=Oo.NamedEntity,this.stateNamedEntity(e,t));case Oo.NumericStart:return this.stateNumericStart(e,t);case Oo.NumericDecimal:return this.stateNumericDecimal(e,t);case Oo.NumericHex:return this.stateNumericHex(e,t);case Oo.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|lz)===Ro.LOWER_X?(this.state=Oo.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=Oo.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,o){if(t!==n){const s=n-t;this.result=this.result*Math.pow(o,s)+parseInt(e.substr(t,s),o),this.consumed+=s}}stateNumericHex(e,t){const n=t;for(;t<e.length;){const o=e.charCodeAt(t);if(nv(o)||az(o))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(o,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){const n=t;for(;t<e.length;){const o=e.charCodeAt(t);if(nv(o))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(o,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)===null||n===void 0||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===Ro.SEMI)this.consumed+=1;else if(this.decodeMode===vl.Strict)return 0;return this.emitCodePoint(rz(this.result),this.consumed),this.errors&&(e!==Ro.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){const{decodeTree:n}=this;let o=n[this.treeIndex],s=(o&bl.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){const i=e.charCodeAt(t);if(this.treeIndex=fz(n,o,this.treeIndex+Math.max(1,s),i),this.treeIndex<0)return this.result===0||this.decodeMode===vl.Attribute&&(s===0||uz(i))?0:this.emitNotTerminatedNamedEntity();if(o=n[this.treeIndex],s=(o&bl.VALUE_LENGTH)>>14,s!==0){if(i===Ro.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==vl.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:t,decodeTree:n}=this,o=(n[t]&bl.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,o,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){const{decodeTree:o}=this;return this.emitCodePoint(t===1?o[e]&~bl.VALUE_LENGTH:o[e+1],n),t===3&&this.emitCodePoint(o[e+2],n),n}end(){var e;switch(this.state){case Oo.NamedEntity:return this.result!==0&&(this.decodeMode!==vl.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Oo.NumericDecimal:return this.emitNumericEntity(0,2);case Oo.NumericHex:return this.emitNumericEntity(0,3);case Oo.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Oo.EntityStart:return 0}}};function OA(e){let t="";const n=new dz(e,o=>t+=iz(o));return function(s,i){let r=0,l=0;for(;(l=s.indexOf("&",l))>=0;){t+=s.slice(r,l),n.startEntity(i);const c=n.write(s,l+1);if(c<0){r=l+n.end();break}r=l+c,l=c===0?r+1:r}const a=t+s.slice(r);return t="",a}}function fz(e,t,n,o){const s=(t&bl.BRANCH_LENGTH)>>7,i=t&bl.JUMP_TABLE;if(s===0)return i!==0&&o===i?n:-1;if(i){const a=o-i;return a<0||a>=s?-1:e[n+a]-1}let r=n,l=r+s-1;for(;r<=l;){const a=r+l>>>1,c=e[a];if(c<o)r=a+1;else if(c>o)l=a-1;else return e[a+s]}return-1}const hz=OA(nz);OA(oz);function Wy(e,t=vl.Legacy){return hz(e,t)}var pz=FA(tz());const xw={};function mz(e){let t=xw[e];if(t)return t;t=xw[e]=[];for(let n=0;n<128;n++){const o=String.fromCharCode(n);t.push(o)}for(let n=0;n<e.length;n++){const o=e.charCodeAt(n);t[o]="%"+("0"+o.toString(16).toUpperCase()).slice(-2)}return t}function wm(e,t){typeof t!="string"&&(t=wm.defaultChars);const n=mz(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(o){let s="";for(let i=0,r=o.length;i<r;i+=3){const l=parseInt(o.slice(i+1,i+3),16);if(l<128){s+=n[l];continue}if((l&224)===192&&i+3<r){const a=parseInt(o.slice(i+4,i+6),16);if((a&192)===128){const c=l<<6&1984|a&63;c<128?s+="��":s+=String.fromCharCode(c),i+=3;continue}}if((l&240)===224&&i+6<r){const a=parseInt(o.slice(i+4,i+6),16),c=parseInt(o.slice(i+7,i+9),16);if((a&192)===128&&(c&192)===128){const u=l<<12&61440|a<<6&4032|c&63;u<2048||u>=55296&&u<=57343?s+="���":s+=String.fromCharCode(u),i+=6;continue}}if((l&248)===240&&i+9<r){const a=parseInt(o.slice(i+4,i+6),16),c=parseInt(o.slice(i+7,i+9),16),u=parseInt(o.slice(i+10,i+12),16);if((a&192)===128&&(c&192)===128&&(u&192)===128){let d=l<<18&1835008|a<<12&258048|c<<6&4032|u&63;d<65536||d>1114111?s+="����":(d-=65536,s+=String.fromCharCode(55296+(d>>10),56320+(d&1023))),i+=9;continue}}s+="�"}return s})}wm.defaultChars=";/?:@&=+$,#";wm.componentChars="";var ov=wm;const ww={};function gz(e){let t=ww[e];if(t)return t;t=ww[e]=[];for(let n=0;n<128;n++){const o=String.fromCharCode(n);/^[0-9a-z]$/i.test(o)?t.push(o):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function _m(e,t,n){typeof t!="string"&&(n=t,t=_m.defaultChars),typeof n>"u"&&(n=!0);const o=gz(t);let s="";for(let i=0,r=e.length;i<r;i++){const l=e.charCodeAt(i);if(n&&l===37&&i+2<r&&/^[0-9a-f]{2}$/i.test(e.slice(i+1,i+3))){s+=e.slice(i,i+3),i+=2;continue}if(l<128){s+=o[l];continue}if(l>=55296&&l<=57343){if(l>=55296&&l<=56319&&i+1<r){const a=e.charCodeAt(i+1);if(a>=56320&&a<=57343){s+=encodeURIComponent(e[i]+e[i+1]),i++;continue}}s+="%EF%BF%BD";continue}s+=encodeURIComponent(e[i])}return s}_m.defaultChars=";/?:@&=+$,-_.!~*'()#";_m.componentChars="-_.!~*'()";var RA=_m;function zy(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function lp(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const vz=/^([a-z0-9.+-]+:)/i,yz=/:[0-9]*$/,kz=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,bz=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
93
+ `," "]),xz=["'"].concat(bz),_w=["%","/","?",";","#"].concat(xz),Sw=["/","?","#"],wz=255,Cw=/^[+a-z0-9A-Z_-]{0,63}$/,_z=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Aw={javascript:!0,"javascript:":!0},Mw={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Sz(e,t){if(e&&e instanceof lp)return e;const n=new lp;return n.parse(e,t),n}lp.prototype.parse=function(e,t){let n,o,s,i=e;if(i=i.trim(),!t&&e.split("#").length===1){const c=kz.exec(i);if(c)return this.pathname=c[1],c[2]&&(this.search=c[2]),this}let r=vz.exec(i);if(r&&(r=r[0],n=r.toLowerCase(),this.protocol=r,i=i.substr(r.length)),(t||r||i.match(/^\/\/[^@\/]+@[^@\/]+/))&&(s=i.substr(0,2)==="//",s&&!(r&&Aw[r])&&(i=i.substr(2),this.slashes=!0)),!Aw[r]&&(s||r&&!Mw[r])){let c=-1;for(let p=0;p<Sw.length;p++)o=i.indexOf(Sw[p]),o!==-1&&(c===-1||o<c)&&(c=o);let u,d;c===-1?d=i.lastIndexOf("@"):d=i.lastIndexOf("@",c),d!==-1&&(u=i.slice(0,d),i=i.slice(d+1),this.auth=u),c=-1;for(let p=0;p<_w.length;p++)o=i.indexOf(_w[p]),o!==-1&&(c===-1||o<c)&&(c=o);c===-1&&(c=i.length),i[c-1]===":"&&c--;const f=i.slice(0,c);i=i.slice(c),this.parseHost(f),this.hostname=this.hostname||"";const h=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!h){const p=this.hostname.split(/\./);for(let g=0,b=p.length;g<b;g++){const v=p[g];if(v&&!v.match(Cw)){let m="";for(let y=0,k=v.length;y<k;y++)v.charCodeAt(y)>127?m+="x":m+=v[y];if(!m.match(Cw)){const y=p.slice(0,g),k=p.slice(g+1),A=v.match(_z);A&&(y.push(A[1]),k.unshift(A[2])),k.length&&(i=k.join(".")+i),this.hostname=y.join(".");break}}}}this.hostname.length>wz&&(this.hostname=""),h&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const l=i.indexOf("#");l!==-1&&(this.hash=i.substr(l),i=i.slice(0,l));const a=i.indexOf("?");return a!==-1&&(this.search=i.substr(a),i=i.slice(0,a)),i&&(this.pathname=i),Mw[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};lp.prototype.parseHost=function(e){let t=yz.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 Uy=Sz,BA=$A({decode:()=>ov,encode:()=>RA,format:()=>zy,parse:()=>Uy}),DA=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,PA=/[\0-\x1F\x7F-\x9F]/,Cz=/[\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]/,HA=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,Az=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,WA=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,Mz=$A({Any:()=>DA,Cc:()=>PA,Cf:()=>Cz,P:()=>HA,S:()=>Az,Z:()=>WA}),Ez=Object.defineProperty,zA=e=>{let t={};for(var n in e)Ez(t,n,{get:e[n],enumerable:!0});return t},xo=class{type;tag;attrs;map;nesting;level;children;content;markup;info;meta;block;hidden;constructor(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}attrIndex(e){if(!this.attrs)return-1;const t=this.attrs;for(let n=0,o=t.length;n<o;n++)if(t[n][0]===e)return n;return-1}attrPush(e){this.attrs?this.attrs.push(e):this.attrs=[e]}attrSet(e,t){const n=this.attrIndex(e),o=[e,t];n<0?this.attrPush(o):this.attrs[n]=o}attrGet(e){const t=this.attrIndex(e);let n=null;return t>=0&&(n=this.attrs[t][1]),n}attrJoin(e,t){const n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=`${this.attrs[n][1]} ${t}`}},Tz=zA({arrayReplaceAt:()=>Rz,assign:()=>Fz,countLines:()=>so,escapeHtml:()=>jz,escapeRE:()=>Kz,fromCodePoint:()=>Id,has:()=>$z,isMdAsciiPunct:()=>up,isPunctChar:()=>cp,isPunctCode:()=>sv,isSpace:()=>Oz,isString:()=>Iz,isValidEntityCode:()=>Cm,isWhiteSpace:()=>Nd,lib:()=>Gz,mdurl:()=>BA,normalizeReference:()=>Sm,ucmicro:()=>ap,unescapeAll:()=>Ld,unescapeMd:()=>Hz});const ap=Mz;function Nz(e){return Object.prototype.toString.call(e)}function Iz(e){return Nz(e)==="[object String]"}const Lz=Object.prototype.hasOwnProperty;function $z(e,t){return Lz.call(e,t)}function Fz(e,...t){return t.forEach(n=>{if(n){if(typeof n!="object")throw new TypeError(`${String(n)}must be object`);Object.keys(n).forEach(o=>{e[o]=n[o]})}}),e}function Oz(e){return e===9||e===32}function Nd(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function cp(e){return ap.P.test(e)||ap.S.test(e)}const Ew=new Map;function sv(e){if(up(e))return!0;const t=Ew.get(e);if(t!==void 0)return t;const n=cp(String.fromCharCode(e));return Ew.set(e,n),n}function up(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function Sm(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function Rz(e,t,n){return[...e.slice(0,t),...n,...e.slice(t+1)]}function Cm(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 Id(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 UA=/\\([!"#$%&'()*+,\-\./:;<=>?@[\\\]^_`{|}~])/g,Bz=new RegExp(`${UA.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),Dz=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Pz(e,t){if(t.charCodeAt(0)===35&&Dz.test(t)){const o=t[1].toLowerCase()==="x"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return Cm(o)?Id(o):e}const n=Wy(e);return n!==e?n:e}function Hz(e){return e.includes("\\")?e.replace(UA,"$1"):e}function Ld(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(Bz,(t,n,o)=>n||Pz(t,o))}const Wz=/[&<>"]/,zz=/[&<>"]/g,Uz={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function qz(e){return Uz[e]}function jz(e){return Wz.test(e)?e.replace(zz,qz):e}const Vz=/[.?*+^$[\]\\(){}|-]/g;function Kz(e){return e.replace(Vz,"\\$&")}const Gz={mdurl:BA,ucmicro:ap};function so(e){if(e.length===0)return 0;let t=0,n=-1;for(;(n=e.indexOf(`
94
+ `,n+1))!==-1;)t++;return t}const Yz=/(?:^|\n)[ \t]{0,3}\[\^[^\]\n]+\]:/m,Zz=/(?:^|\n)[ \t]{0,3}\*\[[^\]\n]+\]:/m,Qz=/(?:^|\n)[ \t]{0,3}\[(?!\^)(?:\\[\s\S]|[^\]\\[])+\][ \t]*:/m,qy=["references","footnotes","abbreviations","abbr","abbrs"],jy=Symbol.for("markdown-it-ts.global-state"),Vy=Object.prototype.hasOwnProperty;function Tw(e){return e==="reference-definition"||e==="footnote-definition"||e==="abbreviation-definition"}function $i(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Cl(e){if(Array.isArray(e))return e.map(t=>Cl(t));if($i(e)){const t={};for(const n of Object.keys(e))t[n]=Cl(e[n]);return t}return e}function dp(e){return Array.isArray(e)?e.map((t,n)=>String(n)):$i(e)?Object.keys(e):[]}function iv(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(!iv(e[n],t[n]))return!1;return!0}if($i(e)||$i(t)){if(!$i(e)||!$i(t))return!1;const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(const s of n)if(!Vy.call(t,s)||!iv(e[s],t[s]))return!1;return!0}return Object.is(e,t)}function qA(e,t){if(Array.isArray(e))return e[Number(t)];if($i(e))return e[t]}function Xz(e,t){if(Array.isArray(e)&&Array.isArray(t)){e.length=t.length;for(let n=0;n<t.length;n++)e[n]=Cl(t[n]);return e}if($i(e)&&$i(t)){for(const n of Object.keys(e))Vy.call(t,n)||delete e[n];for(const n of Object.keys(t))e[n]=Cl(t[n]);return e}return Cl(t)}function Jz(e,t,n){const o=n.ownedKeys??[],s=e[t];if($i(s)||Array.isArray(s)){const i=new Set(dp(n.value));for(const r of o)n.existed&&i.has(r)?s[r]=Cl(qA(n.value,r)):delete s[r];!n.existed&&dp(s).length===0&&delete e[t];return}n.existed?e[t]=Cl(n.value):delete e[t]}function Ky(e){const t=e[jy];return Tw(t)?{reason:t,snapshot:{}}:t&&typeof t=="object"&&Tw(t.reason)&&t.snapshot&&typeof t.snapshot=="object"?t:null}function eU(e,t){Object.defineProperty(e,jy,{value:t,enumerable:!1,configurable:!0,writable:!0})}function Ts(e){return!e||!e.includes("]:")&&!e.includes("*[")?null:Yz.test(e)?"footnote-definition":Zz.test(e)?"abbreviation-definition":Qz.test(e)?"reference-definition":null}function Yd(e){return Ky(e)?.reason??null}function Pc(e,t,n){if(Yd(e)&&zr(e),!t)return n();Gy(e,t);try{const o=n();return Yy(e),o}catch(o){throw zr(e),o}}function Gy(e,t){try{zr(e);const n={};for(const o of qy)n[o]=Vy.call(e,o)?{existed:!0,value:Cl(e[o])}:{existed:!1};eU(e,{reason:t,snapshot:n})}catch{}}function Yy(e){const t=Ky(e);if(t)for(const n of qy){const o=t.snapshot[n];if(!o)continue;o.ownedKeys=[];const s=e[n];if(!$i(s)&&!Array.isArray(s))continue;const i=new Set(dp(o.existed?o.value:void 0));o.ownedKeys=dp(s).filter(r=>i.has(r)?!iv(s[r],qA(o.value,r)):!0)}}function zr(e){const t=Ky(e);if(t){for(const n of qy){const o=t.snapshot[n];if(!o){delete e[n];continue}if(o.ownedKeys){Jz(e,n,o);continue}o.existed?e[n]=Xz(e[n],o.value):delete e[n]}delete e[jy]}}const rv=Symbol.for("markdown-it-ts.diagnostics");function Am(e,t){if(e)try{const n=e[rv];if(n&&typeof n=="object")return n;if(!t)return;const o={};return e[rv]=o,o}catch{return}}function _r(e){return Am(e,!1)}function tU(e){if(e)try{const t=e[rv];t&&typeof t=="object"&&(delete t.strategy,delete t.chunk,delete t.unbounded,delete t.editable)}catch{}}function us(e){tU(e)}function yo(e,t){const n=Am(e,!0);n&&(n.strategy=t)}function m0(e,t){const n=Am(e,!0);n&&(n.chunk=t)}function jA(e,t){const n=Am(e,!0);n&&(n.unbounded=t)}function nU(e){const t={};e=e||{},t.src_Any=DA.source,t.src_Cc=PA.source,t.src_Z=WA.source,t.src_P=HA.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 lv(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function Mm(e){return Object.prototype.toString.call(e)}function oU(e){return Mm(e)==="[object String]"}function sU(e){return Mm(e)==="[object Object]"}function iU(e){return Mm(e)==="[object RegExp]"}function Nw(e){return Mm(e)==="[object Function]"}function rU(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const VA={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function lU(e){return Object.keys(e||{}).reduce(function(t,n){return t||VA.hasOwnProperty(n)},!1)}const aU={"http:":{validate:function(e,t,n){const o=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(o)?o.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){const o=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(o)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:o.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){const o=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(o)?o.match(n.re.mailto)[0].length:0}}},cU="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]",uU="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function dU(e){return function(t,n){const o=t.slice(n);return e.test(o)?o.match(e)[0].length:0}}function Iw(){return function(e,t){t.normalize(e)}}function fp(e){const t=e.re=nU(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(cU),n.push(t.src_xn),t.src_tlds=n.join("|");function o(l){return l.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(o(t.tpl_email_fuzzy),"i"),t.email_fuzzy_global=RegExp(o(t.tpl_email_fuzzy),"ig"),t.link_fuzzy=RegExp(o(t.tpl_link_fuzzy),"i"),t.link_fuzzy_global=RegExp(o(t.tpl_link_fuzzy),"ig"),t.link_no_ip_fuzzy=RegExp(o(t.tpl_link_no_ip_fuzzy),"i"),t.link_no_ip_fuzzy_global=RegExp(o(t.tpl_link_no_ip_fuzzy),"ig"),t.host_fuzzy_test=RegExp(o(t.tpl_host_fuzzy_test),"i");const s=[];e.__compiled__={};function i(l,a){throw new Error('(LinkifyIt) Invalid schema "'+l+'": '+a)}Object.keys(e.__schemas__).forEach(function(l){const a=e.__schemas__[l];if(a===null)return;const c={validate:null,link:null};if(e.__compiled__[l]=c,sU(a)){iU(a.validate)?c.validate=dU(a.validate):Nw(a.validate)?c.validate=a.validate:i(l,a),Nw(a.normalize)?c.normalize=a.normalize:a.normalize?i(l,a):c.normalize=Iw();return}if(oU(a)){s.push(l);return}i(l,a)}),s.forEach(function(l){e.__compiled__[e.__schemas__[l]]&&(e.__compiled__[l].validate=e.__compiled__[e.__schemas__[l]].validate,e.__compiled__[l].normalize=e.__compiled__[e.__schemas__[l]].normalize)}),e.__compiled__[""]={validate:null,normalize:Iw()};const r=Object.keys(e.__compiled__).filter(function(l){return l.length>0&&e.__compiled__[l]}).map(rU).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+r+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+r+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i")}function KA(e,t,n,o){const s=e.slice(n,o);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=o,this.raw=s,this.text=s,this.url=s}function ei(e,t){if(!(this instanceof ei))return new ei(e,t);t||lU(e)&&(t=e,e={}),this.__opts__=lv({},VA,t),this.__schemas__=lv({},aU,e),this.__compiled__={},this.__tlds__=uU,this.__tlds_replaced__=!1,this.re={},fp(this)}ei.prototype.add=function(t,n){return this.__schemas__[t]=n,fp(this),this};ei.prototype.set=function(t){return this.__opts__=lv(this.__opts__,t),this};ei.prototype.test=function(t){if(!t.length)return!1;let n,o;if(this.re.schema_test.test(t)){for(o=this.re.schema_search,o.lastIndex=0;(n=o.exec(t))!==null;)if(this.testSchemaAt(t,n[2],o.lastIndex))return!0}return!!(this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&t.search(this.re.host_fuzzy_test)>=0&&t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy)!==null||this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&t.indexOf("@")>=0&&t.match(this.re.email_fuzzy)!==null)};ei.prototype.pretest=function(t){return this.re.pretest.test(t)};ei.prototype.testSchemaAt=function(t,n,o){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,o,this):0};ei.prototype.match=function(t){const n=[],o=[],s=[],i=[];let r,l,a;function c(f,h){return f?h?f.index!==h.index?f.index<h.index?f:h:f.lastIndex>=h.lastIndex?f:h:f:h}if(!t.length)return null;if(this.re.schema_test.test(t))for(a=this.re.schema_search,a.lastIndex=0;(r=a.exec(t))!==null;)l=this.testSchemaAt(t,r[2],a.lastIndex),l&&o.push({schema:r[2],index:r.index+r[1].length,lastIndex:r.index+r[0].length+l});if(this.__opts__.fuzzyLink&&this.__compiled__["http:"])for(a=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,a.lastIndex=0;(r=a.exec(t))!==null;)s.push({schema:"",index:r.index+r[1].length,lastIndex:r.index+r[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"])for(a=this.re.email_fuzzy_global,a.lastIndex=0;(r=a.exec(t))!==null;)i.push({schema:"mailto:",index:r.index+r[1].length,lastIndex:r.index+r[0].length});const u=[0,0,0];let d=0;for(;;){const f=[o[u[0]],i[u[1]],s[u[2]]],h=c(c(f[0],f[1]),f[2]);if(!h)break;if(h===f[0]?u[0]++:h===f[1]?u[1]++:u[2]++,h.index<d)continue;const p=new KA(t,h.schema,h.index,h.lastIndex);this.__compiled__[p.schema].normalize(p,this),n.push(p),d=h.lastIndex}return n.length?n:null};ei.prototype.matchAtStart=function(t){if(!t.length)return null;const n=this.re.schema_at_start.exec(t);if(!n)return null;const o=this.testSchemaAt(t,n[2],n[0].length);if(!o)return null;const s=new KA(t,n[2],n.index+n[1].length,n.index+n[0].length+o);return this.__compiled__[s.schema].normalize(s,this),s};ei.prototype.tlds=function(t,n){return t=Array.isArray(t)?t:[t],n?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(o,s,i){return o!==i[s-1]}).reverse(),fp(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,fp(this),this)};ei.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};ei.prototype.onCompile=function(){};var GA=ei,fU=LA({"../../node_modules/.pnpm/punycode.js@2.3.1/node_modules/punycode.js/punycode.js":((e,t)=>{const d=/^xn--/,f=/[^\0-\x7F]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},g=35,b=Math.floor,v=String.fromCharCode;function m(B){throw new RangeError(p[B])}function y(B,U){const H=[];let P=B.length;for(;P--;)H[P]=U(B[P]);return H}function k(B,U){const H=B.split("@");let P="";H.length>1&&(P=H[0]+"@",B=H[1]),B=B.replace(h,".");const Z=y(B.split("."),U).join(".");return P+Z}function A(B){const U=[];let H=0;const P=B.length;for(;H<P;){const Z=B.charCodeAt(H++);if(Z>=55296&&Z<=56319&&H<P){const K=B.charCodeAt(H++);(K&64512)==56320?U.push(((Z&1023)<<10)+(K&1023)+65536):(U.push(Z),H--)}else U.push(Z)}return U}const $=B=>String.fromCodePoint(...B),I=function(B){return B>=48&&B<58?26+(B-48):B>=65&&B<91?B-65:B>=97&&B<123?B-97:36},x=function(B,U){return B+22+75*(B<26)-((U!=0)<<5)},L=function(B,U,H){let P=0;for(B=H?b(B/700):B>>1,B+=b(B/U);B>g*26>>1;P+=36)B=b(B/g);return b(P+(g+1)*B/(B+38))},E=function(B){const U=[],H=B.length;let P=0,Z=128,K=72,V=B.lastIndexOf("-");V<0&&(V=0);for(let X=0;X<V;++X)B.charCodeAt(X)>=128&&m("not-basic"),U.push(B.charCodeAt(X));for(let X=V>0?V+1:0;X<H;){const he=P;for(let ue=1,de=36;;de+=36){X>=H&&m("invalid-input");const Ce=I(B.charCodeAt(X++));Ce>=36&&m("invalid-input"),Ce>b((2147483647-P)/ue)&&m("overflow"),P+=Ce*ue;const Ie=de<=K?1:de>=K+26?26:de-K;if(Ce<Ie)break;const le=36-Ie;ue>b(2147483647/le)&&m("overflow"),ue*=le}const ne=U.length+1;K=L(P-he,ne,he==0),b(P/ne)>2147483647-Z&&m("overflow"),Z+=b(P/ne),P%=ne,U.splice(P++,0,Z)}return String.fromCodePoint(...U)},F=function(B){const U=[];B=A(B);const H=B.length;let P=128,Z=0,K=72;for(const he of B)he<128&&U.push(v(he));const V=U.length;let X=V;for(V&&U.push("-");X<H;){let he=2147483647;for(const ue of B)ue>=P&&ue<he&&(he=ue);const ne=X+1;he-P>b((2147483647-Z)/ne)&&m("overflow"),Z+=(he-P)*ne,P=he;for(const ue of B)if(ue<P&&++Z>2147483647&&m("overflow"),ue===P){let de=Z;for(let Ce=36;;Ce+=36){const Ie=Ce<=K?1:Ce>=K+26?26:Ce-K;if(de<Ie)break;const le=de-Ie,z=36-Ie;U.push(v(x(Ie+le%z,0))),de=b(le/z)}U.push(v(x(de,0))),K=L(Z,ne,X===V),Z=0,++X}++Z,++P}return U.join("")},D={version:"2.3.1",ucs2:{decode:A,encode:$},decode:E,encode:F,toASCII:function(B){return k(B,function(U){return f.test(U)?"xn--"+F(U):U})},toUnicode:function(B){return k(B,function(U){return d.test(U)?E(U.slice(4).toLowerCase()):U})}};t.exports=D})}),YA=FA(fU());function Zy(e,t,n){let o,s=t;const i={ok:!1,pos:0,str:""};if(e.charCodeAt(s)===60){for(s++;s<n;){if(o=e.charCodeAt(s),o===10||o===60)return i;if(o===62)return i.pos=s+1,i.str=Ld(e.slice(t+1,s)),i.ok=!0,i;if(o===92&&s+1<n){s+=2;continue}s++}return i}let r=0;for(;s<n&&(o=e.charCodeAt(s),!(o===32||o<32||o===127));){if(o===92&&s+1<n){if(e.charCodeAt(s+1)===32)break;s+=2;continue}if(o===40&&(r++,r>32))return i;if(o===41){if(r===0)break;r--}s++}return t===s||r!==0||(i.str=Ld(e.slice(t,s)),i.pos=s,i.ok=!0),i}var ZA=Zy;const bh=-2;function hU(e,t,n,o){let s=1,i=t+1;for(;i<n;){const r=e.charCodeAt(i);if(r===93){if(s--,s===0)return i;if(o){const l=i+1<n?e.charCodeAt(i+1):0;if(l===40||l===91)return bh}i++;continue}if(r===92){i+=2;continue}if(r===96||r===60||r===33&&i+1<n&&e.charCodeAt(i+1)===91)return bh;if(r===91){s++,i++;continue}i++}return-1}function Qy(e,t,n){let o=1,s=!1,i,r;const l=e.src,a=e.posMax,c=e.pos,u=e.linkLabelNoCloseFrom;if(u>=0&&t+1>=u)return-1;const d=l.indexOf("]",t+1);if(d<0||d>=a)return e.linkLabelNoCloseFrom=t+1,-1;const f=hU(l,t,a,n);if(f!==bh)return f;for(e.pos=t+1;e.pos<a;){if(i=l.charCodeAt(e.pos),i===93&&(o--,o===0)){s=!0;break}if(r=e.pos,e.md.inline.skipToken(e),i===91){if(r===e.pos-1)o++;else if(n)return e.pos=c,-1}}let h=-1;return s&&(h=e.pos),e.pos=c,h}var hp=Qy;function Xy(e,t,n,o){let s,i=t;const r={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(o)r.str=o.str,r.marker=o.marker;else{if(i>=n)return r;let l=e.charCodeAt(i);if(l!==34&&l!==39&&l!==40)return r;t++,i++,l===40&&(l=41),r.marker=l}for(;i<n;){if(s=e.charCodeAt(i),s===r.marker)return r.pos=i+1,r.str+=Ld(e.slice(t,i)),r.ok=!0,r;if(s===40&&r.marker===41)return r;s===92&&i+1<n&&i++,i++}return r.can_continue=!0,r.str+=Ld(e.slice(t,i)),r}var QA=Xy;function Em(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 Jy(e,t){e.attrs||(e.attrs=[]),e.attrs.push(t)}function pU(e,t,n){const o=Em(e,t),s=[t,n];o<0?Jy(e,s):e.attrs[o]=s}function mU(e,t){const n=Em(e,t);return n>=0?e.attrs[n][1]:null}function gU(e,t,n){const o=Em(e,t);o<0?Jy(e,[t,n]):e.attrs[o][1]=`${e.attrs[o][1]} ${n}`}var vU=zA({attrGet:()=>mU,attrIndex:()=>Em,attrJoin:()=>gU,attrPush:()=>Jy,attrSet:()=>pU,parseLinkDestination:()=>Zy,parseLinkLabel:()=>Qy,parseLinkTitle:()=>Xy});function yU(e){return e.includes("\r")||e.includes("\0")}function XA(e){return typeof e=="string"?e:e.toString()}function kU(e){if(e.inlineMode){const t=new xo("inline","",0);t.content=XA(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 bU=/^([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])?)*)$/,xU=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function wU(e,t){let n=e.pos;const o=e.src;if(o.charCodeAt(n)!==60)return!1;const s=n,i=e.posMax;for(;;){if(++n>=i)return!1;const l=o.charCodeAt(n);if(l===60)return!1;if(l===62)break}const r=o.slice(s+1,n);if(xU.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(bU.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 _U=wU;function SU(e,t){const n=e.src;let o=e.pos;if(n.charCodeAt(o)!==96)return!1;const s=o;o++;const i=e.posMax;for(;o<i&&n.charCodeAt(o)===96;)o++;const r=n.slice(s,o),l=r.length;if(e.backticksScanned&&(e.backticks[l]||0)<=s)return t||(e.pending+=r),e.pos+=l,!0;let a=o,c;for(;(c=n.indexOf("`",a))!==-1;){for(a=c+1;a<i&&n.charCodeAt(a)===96;)a++;const u=a-c;if(u===l){if(!t){const d=e.push("code_inline","code",0);d.markup=r;let f=n.slice(o,c);f.includes(`
95
+ `)&&(f=f.replace(/\n/g," ")),f.length>2&&f.charCodeAt(0)===32&&f.charCodeAt(f.length-1)===32&&(f=f.slice(1,-1)),d.content=f}return e.pos=a,!0}e.backticks[u]=c}return e.backticksScanned=!0,t||(e.pending+=r),e.pos+=l,!0}var CU=SU;function Lw(e){const t={},n=e.length;if(!n)return;let o=0,s=-2;const i=[];for(let r=0;r<n;r++){const l=e[r];if(i.push(0),(e[o].marker!==l.marker||s!==l.token-1)&&(o=r),s=l.token,l.length=l.length||0,!l.close)continue;Object.prototype.hasOwnProperty.call(t,l.marker)||(t[l.marker]=[-1,-1,-1,-1,-1,-1]);const a=t[l.marker][(l.open?3:0)+l.length%3];let c=o-i[o]-1,u=c;for(;c>a;c-=i[c]+1){const d=e[c];if(d.marker===l.marker&&d.open&&d.end<0){let f=!1;if((d.close||l.open)&&(d.length+l.length)%3===0&&(d.length%3!==0||l.length%3!==0)&&(f=!0),!f){const h=c>0&&!e[c-1].open?i[c-1]+1:0;i[r]=r-c+h,i[c]=h,l.open=!1,d.end=r,d.close=!1,u=-1,s=-2;break}}}u!==-1&&(t[l.marker][(l.open?3:0)+(l.length||0)%3]=u)}}function AU(e){const t=e.tokens_meta,n=e.tokens_meta.length;Lw(e.delimiters);for(let o=0;o<n;o++)t[o]&&t[o].delimiters&&Lw(t[o].delimiters)}var MU=AU;function EU(e,t){const n=e.pos,o=e.src.charCodeAt(n);if(t||o!==95&&o!==42)return!1;const s=e.scanDelims(e.pos,o===42);if(!s||s.length===0)return!1;for(let i=0;i<s.length;i++){const r=e.push("text","",0);r.content=String.fromCharCode(o),e.delimiters.push({marker:o,length:s.length,token:e.tokens.length-1,end:-1,open:s.can_open,close:s.can_close})}return e.pos+=s.length,!0}function $w(e,t){const n=t.length;for(let o=n-1;o>=0;o--){const s=t[o];if(s.marker!==95&&s.marker!==42||s.end===-1)continue;const i=t[s.end],r=o>0&&t[o-1].end===s.end+1&&t[o-1].marker===s.marker&&t[o-1].token===s.token-1&&t[s.end+1].token===i.token+1,l=String.fromCharCode(s.marker),a=e.tokens[s.token];a.type=r?"strong_open":"em_open",a.tag=r?"strong":"em",a.nesting=1,a.markup=r?l+l:l,a.content="";const c=e.tokens[i.token];c.type=r?"strong_close":"em_close",c.tag=r?"strong":"em",c.nesting=-1,c.markup=r?l+l:l,c.content="",r&&(e.tokens[t[o-1].token].content="",e.tokens[t[s.end+1].token].content="",o--)}}function TU(e){const t=e.tokens_meta,n=e.tokens_meta.length;$w(e,e.delimiters);for(let o=0;o<n;o++)t[o]&&t[o].delimiters&&$w(e,t[o].delimiters)}const Fw={tokenize:EU,postProcess:TU};function JA(e){return Wy(e)}function ek(e){return e>=48&&e<=57}function NU(e){const t=e|32;return ek(e)||t>=97&&t<=102}function e6(e){const t=e|32;return t>=97&&t<=122}function IU(e){return e6(e)||ek(e)}function LU(e,t,n){let o=t+2;if(o>=n)return null;let s=!1,i=7,r=o;for((e.charCodeAt(o)|32)===120&&(s=!0,i=6,o++,r=o);o<n&&o-r<i;){const l=e.charCodeAt(o);if(!(s?NU(l):ek(l)))break;o++}return o===r||o>=n||e.charCodeAt(o)!==59?null:e.slice(t,o+1)}function $U(e,t,n){let o=t+1;if(o>=n||!e6(e.charCodeAt(o)))return null;for(o++;o<n&&o-t-1<32&&IU(e.charCodeAt(o));)o++;if(o-t-1<2||o>=n||e.charCodeAt(o)!==59)return null;const s=e.slice(t,o+1);return JA(s)!==s?s:null}function FU(e,t){const n=e.pos,o=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=o)return!1;if(e.src.charCodeAt(n+1)===35){const s=LU(e.src,n,o);if(s){if(!t){const i=(s.charCodeAt(2)|32)===120?Number.parseInt(s.slice(3,-1),16):Number.parseInt(s.slice(2,-1),10),r=e.push("text_special","",0);r.content=Cm(i)?Id(i):Id(65533),r.markup=s,r.info="entity"}return e.pos+=s.length,!0}}else{const s=$U(e.src,n,o);if(s){const i=JA(s);if(!t){const r=e.push("text_special","",0);r.content=i,r.markup=s,r.info="entity"}return e.pos+=s.length,!0}}return!1}var OU=FU;const t6=(()=>{const e=new Array(256).fill(0),t="\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-";for(let n=0;n<32;n++)e[t.charCodeAt(n)]=1;return e})(),av=new Array(128),n6=new Array(128);for(let e=0;e<128;e++){const t=String.fromCharCode(e);av[e]=`\\${t}`,n6[e]=t6[e]?t:av[e]}function Ow(e,t,n){e.pending&&e.pushPending();const o=new xo("text_special","",0);o.level=e.level,o.content=t,o.markup=n,o.info="escape",e.pendingLevel=e.level,e.tokens.push(o),e.tokens_meta.push(null)}function RU(e,t){let n=e.pos;const o=e.posMax,s=e.src;if(s.charCodeAt(n)!==92||(n++,n>=o))return!1;let i=s.charCodeAt(n);if(i===10){for(t||e.push("hardbreak","br",0),n++;n<o&&(i=s.charCodeAt(n),!(i!==9&&i!==32));)n++;return e.pos=n,!0}if(i<128)return t?(e.pos=n+1,!0):(Ow(e,n6[i],av[i]),e.pos=n+1,!0);if(t){if(i>=55296&&i<=56319&&n+1<o){const a=s.charCodeAt(n+1);a>=56320&&a<=57343&&n++}return e.pos=n+1,!0}let r=s.charAt(n);if(i>=55296&&i<=56319&&n+1<o){const a=s.charCodeAt(n+1);a>=56320&&a<=57343&&(r+=s.charAt(n+1),n++)}const l=`\\${r}`;return Ow(e,i<256&&t6[i]?r:l,l),e.pos=n+1,!0}var BU=RU;function DU(e){let t,n,o=0;const s=e.tokens,i=e.tokens.length;for(t=n=0;t<i;t++){const r=s[t];r&&(r.nesting&&r.nesting<0&&o--,r.level=o,r.nesting&&r.nesting>0&&o++,r.type==="text"&&t+1<i&&s[t+1]?.type==="text"?s[t+1].content=r.content+s[t+1].content:(t!==n&&(s[n]=r),n++))}t!==n&&(s.length=n)}var PU=DU;const o6=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,s6="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",HU=new RegExp(`^(?:${o6}|${s6}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<\\?[\\s\\S]*?\\?>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),WU=new RegExp(`^(?:${o6}|${s6})`);function i6(e){return e===32||e===9||e===10||e===12||e===13}function zU(e){if(e.length<3||e.charCodeAt(0)!==60||(e.charCodeAt(1)|32)!==97)return!1;const t=e.charCodeAt(2);return t===62||i6(t)}function UU(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(!i6(n))return!1}return!1}function qU(e){const t=e|32;return t>=97&&t<=122}function jU(e,t){if(!e.md.options.html)return!1;const n=e.posMax,o=e.pos,s=e.src;if(s.charCodeAt(o)!==60||o+2>=n)return!1;const i=s.charCodeAt(o+1);if(i!==33&&i!==63&&i!==47&&!qU(i))return!1;const r=s.slice(o).match(HU);if(!r)return!1;const l=r[0];if(!t){const a=e.pushSimple("html_inline","");a.content=l,zU(l)&&e.linkLevel++,UU(l)&&e.linkLevel--}return e.pos+=l.length,!0}var VU=jU;function KU(e,t){let n,o,s,i,r,l,a,c,u="";const d=e.pos,f=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const h=e.pos+2,p=hp(e,e.pos+1,!1);if(p<0)return!1;if(i=p+1,i<f&&e.src.charCodeAt(i)===40){for(i++;i<f&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);if(i>=f)return!1;if(l=ZA(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=QA(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=hp(e,i),i>=0?s=e.src.slice(c,i++):i=p+1):i=p+1,s||(s=e.src.slice(h,p)),r=e.env.references[Sm(s)],!r)return e.pos=d,!1;u=r.href,a=r.title}if(!t){o=e.src.slice(h,p);const g=[];e.md.inline.parse(o,e.md,e.env,g);const b=e.push("image","img",0);b.attrs=[["src",u],["alt",""]],b.children=g,b.content=o,a&&b.attrs.push(["title",a])}return e.pos=i,e.posMax=f,!0}var GU=KU;function YU(e,t){let n,o,s,i,r="",l="",a=e.pos,c=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const u=e.pos,d=e.posMax,f=e.pos+1,h=hp(e,e.pos,!0);if(h<0)return!1;let p=h+1;if(p<d&&e.src.charCodeAt(p)===40){for(c=!1,p++;p<d&&(n=e.src.charCodeAt(p),!(n!==32&&n!==10));p++);if(p>=d)return!1;if(s=ZA(e.src,p,e.posMax),s.ok){for(r=e.md.normalizeLink(s.str),e.md.validateLink(r)?p=s.pos:r="",a=p;p<d&&(n=e.src.charCodeAt(p),!(n!==32&&n!==10));p++);if(s=QA(e.src,p,e.posMax),p<d&&a!==p&&s.ok)for(l=s.str,p=s.pos;p<d&&(n=e.src.charCodeAt(p),!(n!==32&&n!==10));p++);}(p>=d||e.src.charCodeAt(p)!==41)&&(c=!0),p++}if(c){if(typeof e.env.references>"u")return!1;if(p<d&&e.src.charCodeAt(p)===91?(a=p+1,p=hp(e,p),p>=0?o=e.src.slice(a,p++):p=h+1):p=h+1,o||(o=e.src.slice(f,h)),i=e.env.references[Sm(o)],!i)return e.pos=u,!1;r=i.href,l=i.title}if(!t){e.pos=f,e.posMax=h;const g=e.push("link_open","a",1),b=[["href",r]];g.attrs=b,l&&b.push(["title",l]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=p,e.posMax=d,!0}var ZU=YU;function r6(e){const t=e|32;return t>=97&&t<=122}function QU(e){return e>=48&&e<=57}function XU(e){return r6(e)||QU(e)||e===43||e===45||e===46}function JU(e){if(e.length===0)return null;let t=e.length-1;for(;t>=0&&XU(e.charCodeAt(t));)t--;return t++,t>=e.length||!r6(e.charCodeAt(t))?null:e.slice(t)}function eq(e,t,n){let o=t;for(;o<n;){const s=e.charCodeAt(o);if(s<=32||s===127||s===60)break;o++}return e.slice(t,o)}function tq(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const n=e.pos,o=e.posMax;if(n+3>o||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const s=JU(e.pending);if(!s)return!1;const i=eq(e.src,n-s.length,o),r=e.md.linkify.matchAtStart(i);if(!r)return!1;let l=r.url;if(l.length<=s.length)return!1;let a=l.length;for(;a>0&&l.charCodeAt(a-1)===42;)a--;a!==l.length&&(l=l.slice(0,a));const c=e.md.normalizeLink(l);if(!e.md.validateLink(c))return!1;if(!t){e.pending=e.pending.slice(0,-s.length);const u=e.push("link_open","a",1);u.attrs=[["href",c]],u.markup="linkify",u.info="auto";const d=e.push("text","",0);d.content=e.md.normalizeLinkText(l);const f=e.push("link_close","a",-1);f.markup="linkify",f.info="auto"}return e.pos+=l.length-s.length,!0}function nq(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const o=e.pending.length-1,s=e.posMax;if(!t)if(o>=0&&e.pending.charCodeAt(o)===32)if(o>=1&&e.pending.charCodeAt(o-1)===32){let i=o-1;for(;i>=1&&e.pending.charCodeAt(i-1)===32;)i--;e.pending=e.pending.slice(0,i),e.pushSimple("hardbreak","br")}else e.pending=e.pending.slice(0,-1),e.pushSimple("softbreak","br");else e.pushSimple("softbreak","br");for(n++;n<s;){const i=e.src.charCodeAt(n);if(i!==9&&i!==32)break;n++}return e.pos=n,!0}var oq=nq;function sq(e,t){const n=e.pos,o=e.src.charCodeAt(n);if(t||o!==126)return!1;const s=e.scanDelims(e.pos,!0);if(!s)return!1;let i=s.length;const r=String.fromCharCode(o);if(i<2)return!1;let l;i%2&&(l=e.push("text","",0),l.content=r,i--);for(let a=0;a<i;a+=2)l=e.push("text","",0),l.content=r+r,e.delimiters.push({marker:o,length:0,token:e.tokens.length-1,end:-1,open:s.can_open,close:s.can_close});return e.pos+=s.length,!0}function Rw(e,t){let n;const o=[],s=t.length;for(let i=0;i<s;i++){const r=t[i];if(r.marker!==126||r.end===-1)continue;const l=t[r.end];n=e.tokens[r.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=e.tokens[l.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",e.tokens[l.token-1].type==="text"&&e.tokens[l.token-1].content==="~"&&o.push(l.token-1)}for(;o.length;){const i=o.pop();let r=i+1;for(;r<e.tokens.length&&e.tokens[r].type==="s_close";)r++;r--,i!==r&&(n=e.tokens[r],e.tokens[r]=e.tokens[i],e.tokens[i]=n)}}function iq(e){const t=e.delimiters;Rw(e,t);const n=e.tokens_meta;if(n)for(let o=0;o<n.length;o++)n[o]&&n[o].delimiters&&Rw(e,n[o].delimiters)}const Bw={tokenize:sq,postProcess:iq};function Dw(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 rq(e,t){const n=e.src,o=e.pos,s=e.posMax;if(o>=s||Dw(n.charCodeAt(o)))return!1;let i=o+1;for(;i<s&&!Dw(n.charCodeAt(i));)i++;return t||(e.pending+=i===o+1?n.charAt(o):n.slice(o,i)),e.pos=i,!0}var lq=rq;function tk(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function aq(e){if(e.length===0)return 0;const t=e.slice().sort((o,s)=>o-s),n=Math.floor(t.length/2);return t.length%2===0?(t[n-1]+t[n])/2:t[n]}function cq(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 l6(e){const t=e;if(!t)return null;if(t.__mdtsRuleProfile)return t.__mdtsRuleProfile;if(!t.__mdtsProfileRules)return null;const n=t.__mdtsProfileRules===!0?{}:t.__mdtsProfileRules,o={enabled:!0,fixture:n.fixture,mode:n.mode,startedAt:tk(),records:Object.create(null)};return t.__mdtsRuleProfile=o,o}function Hc(e,t,n,o,s,i){const r=l6(e);if(!r)return;const l=`${t}:${n}`,a=r.records[l]??(r.records[l]=cq(t,n));a.calls++,a.inclusiveMs+=o,o>a.maxMs&&(a.maxMs=o),a.samples.push(o),i?(a.silentCalls++,s&&a.silentHits++):(a.normalCalls++,s&&a.normalHits++),s&&a.hits++,r.completedAt=tk()}function uq(e){const t=l6(e);if(!t)return null;const n=Object.keys(t.records);for(let o=0;o<n.length;o++){const s=t.records[n[o]];s.medianMs=aq(s.samples)}return t.completedAt=tk(),t}var Pw=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t,n){const o=this.rules.findIndex(s=>s.name===e);o>=0&&this.rules.splice(o,1),this.rules.push({name:e,fn:t,alt:n?.alt||[],enabled:!0}),this.invalidateCache()}at(e,t,n){const o=this.rules.findIndex(s=>s.name===e);if(t===void 0){if(o<0)return;const s=this.rules[o];return Object.freeze({name:s.name,fn:s.fn,alt:s.alt?Object.freeze(s.alt.slice()):void 0,enabled:s.enabled})}if(o<0)throw new Error(`Parser rule not found: ${e}`);this.rules[o].fn=t,n?.alt!==void 0&&(this.rules[o].alt=n.alt),this.invalidateCache()}before(e,t,n,o){const s=this.rules.findIndex(r=>r.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const i=this.rules.findIndex(r=>r.name===t);i>=0&&this.rules.splice(i,1),this.rules.splice(s,0,{name:t,fn:n,alt:o?.alt||[],enabled:!0}),this.invalidateCache()}after(e,t,n,o){const s=this.rules.findIndex(r=>r.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const i=this.rules.findIndex(r=>r.name===t);i>=0&&this.rules.splice(i,1),this.rules.splice(s+1,0,{name:t,fn:n,alt:o?.alt||[],enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}o.push(i),this.rules[r].enabled||(this.rules[r].enabled=!0,s=!0)}return s&&this.invalidateCache(),o}disable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}o.push(i),this.rules[r].enabled&&(this.rules[r].enabled=!1,s=!0)}return s&&this.invalidateCache(),o}enableOnly(e){const t=new Set(e);let n=!1;for(const o of this.rules){const s=t.has(o.name);o.enabled!==s&&(o.enabled=s,n=!0)}n&&this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache.get(t)??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache.get(t)??[]}compileCache(){const e=new Set([""]);for(const o of this.rules)if(o.enabled&&o.alt)for(const s of o.alt)e.add(s);const t=new Map,n=new Map;for(const o of e){const s=[],i=[];for(const r of this.rules)r.enabled&&(o!==""&&!r.alt?.includes(o)||(s.push(r.fn),i.push({name:r.name,fn:r.fn})));t.set(o,s),n.set(o,i)}this.cache=t,this.namedCache=n}},a6=class{src;md;env;tokens;tokens_meta;pos;posMax;level;pending;pendingLevel;cache;delimiters;_prev_delimiters;backticks;backticksScanned;linkLevel;linkLabelNoCloseFrom;maxNesting;constructor(e,t,n,o){this.src=e,this.md=t,this.env=n,this.tokens=o,this.tokens_meta=new Array(o.length),this.pos=0,this.posMax=e.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache=[],this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0,this.linkLabelNoCloseFrom=-1,this.maxNesting=t.options.maxNesting}pushPending(){const e=new xo("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 xo(e,t,0);return n.level=this.level,this.pendingLevel=this.level,this.tokens.push(n),this.tokens_meta.push(null),n}push(e,t,n){if(this.pending&&this.pushPending(),n===0)return this.pushSimple(e,t);const o=new xo(e,t,n);let s=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),o.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],s={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(o),this.tokens_meta.push(s),o}scanDelims(e,t){const{src:n,posMax:o}=this,s=n.charCodeAt(e);let i=e;for(;i<o&&n.charCodeAt(i)===s;)i++;const r=i-e,l=e>0?n.charCodeAt(e-1):32,a=i<o?n.charCodeAt(i):32,c=Nd(l),u=Nd(a),d=sv(l),f=sv(a),h=!u&&(!f||c||d),p=!c&&(!d||u||f);return{can_open:h&&(t||!p||d),can_close:p&&(t||!h||f),length:r}}};a6.prototype.Token=xo;const dq=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function c6(e){return!dq.test(e)}var fq=class{ruler;ruler2;cachedRulesVersion=-1;cachedRules=[];cachedRules2Version=-1;cachedRules2=[];defaultRulerVersion;defaultRuler2Version;constructor(){this.ruler=new Pw,this.ruler2=new Pw,this.ruler.push("text",lq),this.ruler.push("linkify",tq),this.ruler.push("newline",oq),this.ruler.push("escape",BU),this.ruler.push("backticks",CU),this.ruler.push("strikethrough",Bw.tokenize),this.ruler.push("emphasis",Fw.tokenize),this.ruler.push("link",ZU),this.ruler.push("image",GU),this.ruler.push("autolink",_U),this.ruler.push("html_inline",VU),this.ruler.push("entity",OU),this.ruler2.push("balance_pairs",MU),this.ruler2.push("strikethrough",Bw.postProcess),this.ruler2.push("emphasis",Fw.postProcess),this.ruler2.push("fragments_join",PU),this.defaultRulerVersion=this.ruler.version,this.defaultRuler2Version=this.ruler2.version}skipToken(e){const t=e.pos,n=this.getRules(),o=n.length,s=e.cache,i=s[t],r=!!e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules"));if(i!==void 0){e.pos=i;return}let l=!1;if(e.level<e.maxNesting){if(r){const a=this.ruler.getNamedRules("");for(let c=0;c<o;c++){e.level++;const u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();l=a[c].fn(e,!0);const d=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(Hc(e.env,"inline",a[c].name,d-u,!!l,!0),e.level--,l){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}}else for(let a=0;a<o;a++)if(e.level++,l=n[a](e,!0),e.level--,l){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;l||e.pos++,s[t]=e.pos}tokenize(e){const t=this.getRules(),n=t.length,o=e.posMax;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){for(;e.pos<o;){const i=e.pos;let r=!1;if(e.level<e.maxNesting){for(let l=0;l<n;l++)if(r=t[l](e,!1),r){if(i>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(r){if(e.pos>=o)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending();return}const s=this.ruler.getNamedRules("");for(;e.pos<o;){const i=e.pos;let r=!1;if(e.level<e.maxNesting)for(let l=0;l<n;l++){const a=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();r=s[l].fn(e,!1);const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(Hc(e.env,"inline",s[l].name,c-a,!!r,!1),r){if(i>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(r){if(e.pos>=o)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending()}isDefaultRuleset(){return this.ruler.version===this.defaultRulerVersion&&this.ruler2.version===this.defaultRuler2Version}parseSource(e,t,n,o){if(typeof e=="string"&&e.length>0&&this.isDefaultRuleset()&&c6(e)){const a=new xo("text","",0);a.content=e,o.push(a);return}const s=new a6(e,t,n,o);this.tokenize(s);const i=this.getRules2(),r=i.length;if(!(s.env&&(Object.prototype.hasOwnProperty.call(s.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(s.env,"__mdtsProfileRules")))){for(let a=0;a<r;a++)i[a](s,!1);return}const l=this.ruler2.getNamedRules("");for(let a=0;a<r;a++){const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();l[a].fn(s,!1);const u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();Hc(s.env,"inline2",l[a].name,u-c,!0,!1)}}parse(e,t,n,o){this.parseSource(e,t,n,o)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(""),this.cachedRulesVersion=this.ruler.version),this.cachedRules}getRules2(){return this.cachedRules2Version!==this.ruler2.version&&(this.cachedRules2=this.ruler2.getRules(""),this.cachedRules2Version=this.ruler2.version),this.cachedRules2}};function hq(e){const t=e.tokens,n=!!e.md?.inline?.isDefaultRuleset?.();for(let o=0,s=t.length;o<s;o++){const i=t[o];if(i.type==="inline"&&e.md){if(i.children||(i.children=[]),n&&i.content.length>0&&c6(i.content)){const r=new xo("text","",0);r.content=i.content,i.children.push(r);continue}e.md.inline.parse(i.content,e.md,e.env,i.children)}}}const pq=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,mq=/[0-9a-z]/i;function gq(e){return/^<a[>\s]/i.test(e)}function vq(e){return/^<\/a\s*>/i.test(e)}function yq(e,t){if(t.schema||t.index!==0||!t.raw)return t;for(let n=1;n<t.raw.length;n++){const o=t.raw[n-1],s=t.raw[n];if(!pq.test(o)||!mq.test(s))continue;const i=t.raw.slice(n),r=e.match(i)?.[0];if(!(!r||r.index!==0||r.lastIndex!==i.length))return{...r,index:t.index+n,lastIndex:t.index+n+r.lastIndex}}return t}function kq(e){const t=e.tokens;if(e.md?.options?.linkify)for(let n=0;n<t.length;n++){const o=t[n];if(o.type!=="inline"||!e.md.linkify.pretest(o.content))continue;let s=o.children;s||(s=[],o.children=s);let i=0;for(let r=s.length-1;r>=0;r--){const l=s[r];if(l.type==="link_close"){for(r--;r>=0&&s[r].level!==l.level&&s[r].type!=="link_open";)r--;continue}if(l.type==="html_inline"&&(gq(l.content)&&i>0&&i--,vq(l.content)&&i++),i>0||l.type!=="text"||!e.md.linkify.test(l.content))continue;const a=l.content;let c=(e.md.linkify.match(a)||[]).map(h=>yq(e.md.linkify,h));if(c.length===0)continue;const u=[];let d=l.level,f=0;c.length>0&&c[0].index===0&&r>0&&s[r-1].type==="text_special"&&(c=c.slice(1));for(let h=0;h<c.length;h++){const p=c[h],g=e.md.normalizeLink(p.url);if(!e.md.validateLink(g))continue;let b=p.text;p.schema?p.schema==="mailto:"&&!/^mailto:/i.test(b)?b=e.md.normalizeLinkText(`mailto:${b}`).replace(/^mailto:/,""):b=e.md.normalizeLinkText(b):b=e.md.normalizeLinkText(`http://${b}`).replace(/^http:\/\//,"");const v=p.index;if(v>f){const A=new xo("text","",0);A.content=a.slice(f,v),A.level=d,u.push(A)}const m=new xo("link_open","a",1);m.attrs=[["href",g]],m.level=d++,m.markup="linkify",m.info="auto",u.push(m);const y=new xo("text","",0);y.content=b,y.level=d,u.push(y);const k=new xo("link_close","a",-1);k.level=--d,k.markup="linkify",k.info="auto",u.push(k),f=p.lastIndex}if(f!==0){if(f<a.length){const h=new xo("text","",0);h.content=a.slice(f),h.level=d,u.push(h)}s.splice(r,1,...u)}}}}const bq=/\r\n?|\n/g,xq=/\0/g;function wq(e){if(!e||typeof e.src!="string")return;const t=e.src,n=t.includes("\r"),o=t.includes("\0");if(!n&&!o)return;let s=t;n&&(s=s.replace(bq,`
96
+ `)),o&&(s=s.replace(xq,"�")),e.src=s}const u6=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,_q=/\((?:c|tm|r)\)/i,Sq=/\((c|tm|r)\)/gi,Cq={c:"©",r:"®",tm:"™"};function Aq(e,t){return Cq[t.toLowerCase()]}function Mq(e){let t=0;for(let n=e.length-1;n>=0;n--){const o=e[n];o.type==="text"&&!t&&(o.content=o.content.replace(Sq,Aq)),o.type==="link_open"&&o.info==="auto"&&t--,o.type==="link_close"&&o.info==="auto"&&t++}}function Eq(e){let t=0;for(let n=e.length-1;n>=0;n--){const o=e[n];o.type==="text"&&!t&&u6.test(o.content)&&(o.content=o.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),o.type==="link_open"&&o.info==="auto"&&t--,o.type==="link_close"&&o.info==="auto"&&t++}}function Tq(e){if(e.md?.options?.typographer)for(let t=e.tokens.length-1;t>=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const o=n.content||(Array.isArray(n.children)?n.children.map(s=>s.type==="text"?s.content:"").join(""):"");_q.test(o)&&Mq(n.children||[]),u6.test(o)&&Eq(n.children||[])}}var Nq=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t){const n=this.rules.findIndex(o=>o.name===e);n>=0&&this.rules.splice(n,1),this.rules.push({name:e,fn:t,enabled:!0}),this.invalidateCache()}at(e,t){const n=this.rules.findIndex(o=>o.name===e);if(n<0)throw new Error(`Parser rule not found: ${e}`);this.rules[n].fn=t,this.invalidateCache()}before(e,t,n){const o=this.rules.findIndex(i=>i.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this.rules.findIndex(i=>i.name===t);s>=0&&this.rules.splice(s,1),this.rules.splice(o,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}after(e,t,n){const o=this.rules.findIndex(i=>i.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this.rules.findIndex(i=>i.name===t);s>=0&&this.rules.splice(s,1),this.rules.splice(o+1,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}o.push(i),this.rules[r].enabled||(this.rules[r].enabled=!0,s=!0)}return s&&this.invalidateCache(),o}disable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}o.push(i),this.rules[r].enabled&&(this.rules[r].enabled=!1,s=!0)}return s&&this.invalidateCache(),o}enableOnly(e){const t=new Set(e);let n=!1;for(const o of this.rules){const s=t.has(o.name);o.enabled!==s&&(o.enabled=s,n=!0)}n&&this.invalidateCache()}compileCache(){this.cache=this.rules.filter(e=>e.enabled).map(e=>e.fn),this.namedCache=this.rules.filter(e=>e.enabled).map(e=>({name:e.name,fn:e.fn}))}getRules(e=""){return this.cache||this.compileCache(),this.cache}getNamedRules(e=""){return this.namedCache||this.compileCache(),this.namedCache}};const Iq=/['"]/,Hw=/['"]/g,Ww="’";function qf(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function Lq(e,t){let n;const o=[],s=t.md&&t.md.options&&t.md.options.quotes||"“”‘’";for(let i=0;i<e.length;i++){const r=e[i],l=e[i].level;for(n=o.length-1;n>=0&&!(o[n].level<=l);n--);if(o.length=n+1,r.type!=="text")continue;let a=r.content,c=0,u=a.length;e:for(;c<u;){Hw.lastIndex=c;const d=Hw.exec(a);if(!d)break;let f=!0,h=!0;c=d.index+1;const p=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 b=32;if(c<u)b=a.charCodeAt(c);else for(n=i+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){b=e[n].content.charCodeAt(0);break}const v=up(g)||cp(String.fromCharCode(g)),m=up(b)||cp(String.fromCharCode(b)),y=Nd(g),k=Nd(b);if(k?f=!1:m&&(y||v||(f=!1)),y?h=!1:v&&(k||m||(h=!1)),b===34&&d[0]==='"'&&g>=48&&g<=57&&(h=f=!1),f&&h&&(f=v,h=m),!f&&!h){p&&(r.content=qf(r.content,d.index,Ww));continue}if(h)for(n=o.length-1;n>=0;n--){let A=o[n];if(o[n].level<l)break;if(A.single===p&&o[n].level===l){A=o[n];let $,I;p?($=s[2]||"‘",I=s[3]||"’"):($=s[0]||"“",I=s[1]||"”"),r.content=qf(r.content,d.index,I),e[A.token].content=qf(e[A.token].content,A.pos,$),c+=I.length-1,A.token===i&&(c+=$.length-1),a=r.content,u=a.length,o.length=n;continue e}}f?o.push({token:i,pos:d.index,single:p,level:l}):h&&p&&(r.content=qf(r.content,d.index,Ww))}}}function $q(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const o=typeof n.content=="string"?n.content:(n.children||[]).map(s=>s.content||"").join("");!Iq.test(o)||!n.children||Lq(n.children,e)}}function Fq(e){const t=e.tokens||[],n=t.length;for(let o=0;o<n;o++){const s=t[o];if(s.type!=="inline"||!Array.isArray(s.children))continue;const i=s.children,r=i.length;for(let c=0;c<r;c++)i[c].type==="text_special"&&(i[c].type="text");let l=0,a=0;for(;a<r;a++)i[a].type==="text"&&a+1<r&&i[a+1].type==="text"?i[a+1].content=i[a].content+i[a+1].content:(a!==l&&(i[l]=i[a]),l++);a!==l&&(i.length=l)}}const Oq=/^(?:vbscript|javascript|file|data):/,Rq=/^data:image\/(?:gif|png|jpeg|webp);/,d6=["http:","https:","mailto:"];function f6(e){const t=e.trim().toLowerCase();return Oq.test(t)?Rq.test(t):!0}function h6(e){const t=Uy(e,!0);if(t.hostname&&(!t.protocol||d6.includes(t.protocol)))try{t.hostname=YA.default.toASCII(t.hostname)}catch{}return RA(zy(t))}function p6(e){const t=Uy(e,!0);if(t.hostname&&(!t.protocol||d6.includes(t.protocol)))try{t.hostname=YA.default.toUnicode(t.hostname)}catch{}return ov(zy(t),`${ov.defaultChars}%`)}function Bq(e){switch(e){case 9:case 32:return!0}return!1}function Dq(e,t,n,o){const s=e.src,i=e.bMarks,r=e.eMarks,l=e.tShift,a=e.sCount,c=e.bsCount;let u=i[t]+l[t],d=r[t];const f=e.lineMax;if(a[t]-e.blkIndent>=4||s.charCodeAt(u)!==62)return!1;if(o)return!0;const h=[],p=[],g=[],b=[],v=e.md.block.ruler.getRulesForState(e,"blockquote"),m=e.parentType;e.parentType="blockquote";let y=!1,k;for(k=t;k<n;k++){const L=a[k]<e.blkIndent;if(u=i[k]+l[k],d=r[k],u>=d)break;if(s.charCodeAt(u++)===62&&!L){let F=a[k]+1,S,N;s.charCodeAt(u)===32?(u++,F++,N=!1,S=!0):s.charCodeAt(u)===9?(S=!0,(c[k]+F)%4===3?(u++,F++,N=!1):N=!0):S=!1;let D=F;for(h.push(i[k]),i[k]=u;u<d;){const B=s.charCodeAt(u);if(Bq(B))B===9?D+=4-(D+c[k]+(N?1:0))%4:D++;else break;u++}y=u>=d,p.push(c[k]),c[k]=a[k]+1+(S?1:0),g.push(a[k]),a[k]=D-F,b.push(l[k]),l[k]=u-i[k];continue}if(y)break;let E=!1;for(let F=0,S=v.length;F<S;F++)if(v[F](e,k,n,!0)){E=!0;break}if(E){e.lineMax=k,e.blkIndent!==0&&(h.push(i[k]),p.push(c[k]),b.push(l[k]),g.push(a[k]),a[k]-=e.blkIndent);break}h.push(i[k]),p.push(c[k]),b.push(l[k]),g.push(a[k]),a[k]=-1}const A=e.blkIndent;e.blkIndent=0;const $=e.push("blockquote_open","blockquote",1);$.markup=">";const I=[t,0];$.map=I,e.md.block.tokenize(e,t,k);const x=e.push("blockquote_close","blockquote",-1);x.markup=">",e.lineMax=f,e.parentType=m,I[1]=e.line;for(let L=0;L<b.length;L++)i[L+t]=h[L],l[L+t]=b[L],a[L+t]=g[L],c[L+t]=p[L];return e.blkIndent=A,!0}function Pq(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let o=t+1,s=o;for(;o<n;){if(e.isEmpty(o)){o++;continue}if(e.sCount[o]-e.blkIndent>=4){o++,s=o;continue}break}e.line=s;const i=e.push("code_block","code",0);return i.content=`${e.getLines(t,s,4+e.blkIndent,!1)}
97
+ `,i.map=[t,e.line],!0}function Hq(e,t,n,o){let s=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||s+3>i)return!1;const r=e.src.charCodeAt(s);if(r!==126&&r!==96)return!1;let l=s;s=e.skipChars(s,r);let a=s-l;if(a<3)return!1;const c=e.src.slice(l,s),u=e.src.slice(s,i);if(r===96&&u.includes(String.fromCharCode(r)))return!1;if(o)return!0;let d=t,f=!1;for(;d++,!(d>=n||(s=l=e.bMarks[d]+e.tShift[d],i=e.eMarks[d],s<i&&e.sCount[d]<e.blkIndent));)if(e.src.charCodeAt(s)===r&&!(e.sCount[d]-e.blkIndent>=4)&&(s=e.skipChars(s,r),!(s-l<a)&&(s=e.skipSpaces(s),!(s<i)))){f=!0;break}a=e.sCount[t],e.line=d+(f?1:0);const h=e.push("fence","code",0);return h.info=u,h.content=e.getLines(t+1,d,a,!0),h.markup=c,h.map=[t,e.line],!0}const zw=["","h1","h2","h3","h4","h5","h6"],Uw=["","#","##","###","####","#####","######"];function qw(e){switch(e){case 9:case 32:return!0}return!1}function Wq(e,t,n,o){const s=e.src,i=e.bMarks,r=e.tShift,l=e.eMarks;let a=i[t]+r[t],c=l[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let u=s.charCodeAt(a);if(u!==35||a>=c)return!1;let d=1;for(u=s.charCodeAt(++a);u===35&&a<c&&d<=6;)d++,u=s.charCodeAt(++a);if(d>6||a<c&&!qw(u))return!1;if(o)return!0;c=e.skipSpacesBack(c,a);const f=e.skipCharsBack(c,35,a);f>a&&qw(s.charCodeAt(f-1))&&(c=f),e.line=t+1;const h=e.push("heading_open",zw[d],1);h.markup=Uw[d],h.map=[t,e.line];const p=e.push("inline","",0);p.content=s.slice(a,c).trim(),p.map=[t,e.line],p.children=[];const g=e.push("heading_close",zw[d],-1);return g.markup=Uw[d],!0}function zq(e){switch(e){case 9:case 32:return!0}return!1}function Uq(e,t,n,o){const s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let i=e.bMarks[t]+e.tShift[t];const r=e.src.charCodeAt(i++);if(r!==42&&r!==45&&r!==95)return!1;let l=1;for(;i<s;){const c=e.src.charCodeAt(i++);if(c!==r&&!zq(c))return!1;c===r&&l++}if(l<3)return!1;if(o)return!0;e.line=t+1;const a=e.push("hr","hr",0);return a.map=[t,e.line],a.markup=new Array(l+1).join(String.fromCharCode(r)),!0}const ic=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp(`^</?(${["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"].join("|")})(?=(\\s|/?>|$))`,"i"),/^$/,!0],[new RegExp(`${WU.source}\\s*$`),/^$/,!1]];function qq(e,t,n,o){let s=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(s)!==60)return!1;let r=e.src.slice(s,i),l=0;for(;l<ic.length&&!ic[l][0].test(r);l++);if(l===ic.length)return!1;if(o)return ic[l][2];let a=t+1;if(!ic[l][1].test(r)){for(;a<n&&!(e.sCount[a]<e.blkIndent);a++)if(s=e.bMarks[a]+e.tShift[a],i=e.eMarks[a],r=e.src.slice(s,i),ic[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 jw(e){switch(e){case 9:case 32:return!0}return!1}const td={Pipe:1,ParagraphTerminator:2};function jq(e){switch(e){case 35:case 42:case 43:case 45:case 60:case 62:case 95:case 96:case 124:case 126:return!0}return e>=48&&e<=57}var m6=class{src;md;env;tokens;bMarks=[];eMarks=[];tShift=[];sCount=[];bsCount=[];lineFlags=[];blkIndent=0;line=0;lineMax=0;tight=!1;ddIndent=-1;listIndent=-1;parentType="root";level=0;constructor(e,t,n,o){this.src=e,this.md=t,this.env=n,this.tokens=o;const s=this.src;let i=0,r=0,l=0,a=!1,c=0;for(let u=0,d=s.length;u<d;u++){const f=s.charCodeAt(u);if(f===124&&(c|=td.Pipe|td.ParagraphTerminator),!a)if(jw(f)){i++,f===9?r+=4-r%4:r++;continue}else a=!0,jq(f)&&(c|=td.ParagraphTerminator);(f===10||u===d-1)&&(f!==10&&u++,this.bMarks.push(l),this.eMarks.push(u),this.tShift.push(i),this.sCount.push(r),this.bsCount.push(0),this.lineFlags.push(c),a=!1,i=0,r=0,c=0,l=u+1)}this.bMarks.push(s.length),this.eMarks.push(s.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineFlags.push(0),this.lineMax=this.bMarks.length-1}push(e,t,n){if(n===0){const s=new xo(e,t,0);return s.block=!0,s.level=this.level,this.tokens.push(s),s}const o=new xo(e,t,n);return o.block=!0,n<0&&this.level--,o.level=this.level,n>0&&this.level++,this.tokens.push(o),o}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){const t=this.bMarks,n=this.tShift,o=this.eMarks;for(let s=this.lineMax;e<s&&!(t[e]+n[e]<o[e]);e++);return e}skipSpaces(e){const t=this.src;for(let n=t.length;e<n;e++){const o=t.charCodeAt(e);if(o!==9&&o!==32)break}return e}skipSpacesBack(e,t){if(e<=t)return e;const n=this.src;for(;e>t;){const o=n.charCodeAt(--e);if(o!==9&&o!==32)return e+1}return e}skipChars(e,t){const n=this.src;for(let o=n.length;e<o&&n.charCodeAt(e)===t;e++);return e}skipCharsBack(e,t,n){if(e<=n)return e;const o=this.src;for(;e>n;)if(t!==o.charCodeAt(--e))return e+1;return e}getLines(e,t,n,o){if(e>=t)return"";if(e+1===t){const u=e,d=this.bMarks[u];let f=d;const h=o?this.eMarks[u]+1:this.eMarks[u];let p=0;const g=this.src,b=this.bsCount,v=this.tShift;for(;f<h&&p<n;){const m=g.charCodeAt(f);if(m===9||m===32)m===9?p+=4-(p+b[u])%4:p++;else if(f-d<v[u])p++;else break;f++}return p>n?new Array(p-n+1).join(" ")+g.slice(f,h):g.slice(f,h)}const s=new Array(t-e),i=this.src,r=this.bMarks,l=this.eMarks,a=this.bsCount,c=this.tShift;for(let u=0,d=e;d<t;d++,u++){let f=0;const h=r[d];let p=h,g;for(d+1<t||o?g=l[d]+1:g=l[d];p<g&&f<n;){const b=i.charCodeAt(p);if(jw(b))b===9?f+=4-(f+a[d])%4:f++;else if(p-h<c[d])f++;else break;p++}f>n?s[u]=new Array(f-n+1).join(" ")+i.slice(p,g):s[u]=i.slice(p,g)}return s.join("")}};m6.prototype.Token=xo;function Vq(e,t,n){for(let o=t;o<n;o++)if(e.charCodeAt(o)===124)return!0;return!1}function g6(e){const t=e?.md?.block?.ruler;return t?t.version===t.__mdtsDefaultVersion:!1}function v6(e,t,n,o,s){if(e.lineFlags&&(e.lineFlags[t]&td.ParagraphTerminator)===0||o>=s)return!1;const i=n.charCodeAt(o);switch(i){case 35:case 42:case 43:case 45:case 60:case 62:case 95:case 96:case 126:return!0}return i>=48&&i<=57?!0:Vq(n,o,s)}const Vw=["","h1","h2"];function Kq(e,t,n){const o=e.md.block.ruler.getRulesForState(e,"paragraph"),s=e.src,i=e.bMarks,r=e.tShift,l=e.eMarks,a=e.sCount,c=e.blkIndent,u=g6(e);if(a[t]-c>=4)return!1;const d=e.parentType;e.parentType="paragraph";let f=0,h,p=t+1;for(;p<n;p++){const k=i[p]+r[p],A=l[p];if(k>=A)break;if(a[p]-c>3)continue;if(a[p]>=c&&(h=s.charCodeAt(k),h===45||h===61)){let I=k+1,x=I;for(;I<A&&s.charCodeAt(I)===h;)I++;for(x=I;I<A;){const L=s.charCodeAt(I);if(L!==9&&L!==32)break;I++}if(I>=A){f=h===61?1:2;break}if(x-k>1)continue}if(a[p]<0||u&&!v6(e,p,s,k,A))continue;let $=!1;for(let I=0,x=o.length;I<x;I++)if(o[I](e,p,n,!0)){$=!0;break}if($)break}if(!f)return!1;let g;if(p===t+1){const k=i[t]+r[t];let A=l[t];for(;A>k;){const $=s.charCodeAt(A-1);if($!==9&&$!==32)break;A--}g=s.slice(k,A)}else g=e.getLines(t,p,c,!1).trim();e.line=p+1;const b=h===61?"=":"-",v=e.push("heading_open",Vw[f],1);v.markup=b,v.map=[t,e.line];const m=e.push("inline","",0);m.content=g,m.map=[t,e.line-1],m.children=[];const y=e.push("heading_close",Vw[f],-1);return y.markup=b,e.parentType=d,!0}function y6(e){switch(e){case 9:case 32:return!0}return!1}function Kw(e,t){const n=e.eMarks,o=e.bMarks,s=e.tShift,i=e.src,r=n[t];let l=o[t]+s[t];const a=i.charCodeAt(l++);return a!==42&&a!==45&&a!==43||l<r&&!y6(i.charCodeAt(l))?-1:l}function Gw(e,t){const n=e.bMarks,o=e.tShift,s=e.eMarks,i=e.src,r=n[t]+o[t],l=s[t];let a=r;if(a+1>=l)return-1;let c=i.charCodeAt(a++);if(c<48||c>57)return-1;for(;;){if(a>=l)return-1;if(c=i.charCodeAt(a++),c>=48&&c<=57){if(a-r>=10)return-1;continue}if(c===41||c===46)break;return-1}return a<l&&(c=i.charCodeAt(a),!y6(c))?-1:a}function Gq(e,t,n){const o=e.bMarks,s=e.tShift,i=e.src,r=o[t]+s[t];let l=0;for(let a=r;a<n-1;a++)l=l*10+i.charCodeAt(a)-48;return l}const Yq=["0","1","2","3","4","5","6","7","8","9"];function Zq(e,t){const n=e.level+2,o=e.tokens;for(let s=t+2,i=o.length-2;s<i;s++){const r=o[s];if(r.level===n){if(r.type==="paragraph_open"){r.hidden=!0,o[s+2].hidden=!0,s+=2;continue}if(r.nesting===1){let l=1;for(;l>0&&++s<i;)l+=o[s].nesting}}}}function Qq(e,t,n,o){let s,i,r=0,l=t,a=!0;if(e.sCount[l]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[l]-e.listIndent>=4&&e.sCount[l]<e.blkIndent)return!1;let c=!1;o&&e.parentType==="paragraph"&&e.sCount[l]>=e.blkIndent&&(c=!0);let u,d,f;const h=e.src,p=e.bMarks,g=e.tShift,b=e.eMarks,v=e.sCount,m=e.bsCount,y=p[l]+g[l];if(y>=b[l])return!1;const k=h.charCodeAt(y);if(k>=48&&k<=57){if(f=Gw(e,l),f<0||(u=!0,r=y,d=Gq(e,l,f),c&&d!==1))return!1}else if(k===42||k===45||k===43){if(f=Kw(e,l),f<0)return!1;u=!1}else return!1;if(c&&e.skipSpaces(f)>=b[l])return!1;if(o)return!0;const A=h.charCodeAt(f-1),$=String.fromCharCode(A);if(u){const S=e.push("ordered_list_open","ol",1);d!==void 0&&d!==1&&(S.attrs=[["start",String(d)]])}else e.push("bullet_list_open","ul",1);const I=[l,0];e.tokens[e.tokens.length-1].map=I,e.tokens[e.tokens.length-1].markup=$;let x=!1;const L=e.tokens.length-1,E=e.md.block.ruler.getRulesForState(e,"list"),F=e.parentType;for(e.parentType="list";l<n;){i=f,s=b[l];const S=v[l]+f-(p[l]+g[l]);let N=S;for(;i<s;){const ne=h.charCodeAt(i);if(ne===9)N+=4-(N+m[l])%4;else if(ne===32)N++;else break;i++}const D=i;let B;D>=s?B=1:B=N-S,B>4&&(B=1);const U=S+B,H=e.push("list_item_open","li",1);H.markup=$;const P=[l,0];H.map=P,u&&(H.info=f-r-1===1?Yq[h.charCodeAt(r)-48]:h.slice(r,f-1));const Z=e.tight,K=e.tShift[l],V=e.sCount[l],X=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=U,e.tight=!0,e.tShift[l]=D-p[l],e.sCount[l]=N,D>=s&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n,!0),(!e.tight||x)&&(a=!1),x=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=X,e.tShift[l]=K,e.sCount[l]=V,e.tight=Z,e.push("list_item_close","li",-1).markup=$,l=e.line,P[1]=l,l>=n||e.sCount[l]<e.blkIndent||e.sCount[l]-e.blkIndent>=4)break;let he=!1;for(let ne=0,ue=E.length;ne<ue;ne++)if(E[ne](e,l,n,!0)){he=!0;break}if(he)break;if(u){if(f=Gw(e,l),f<0)break;r=p[l]+g[l]}else if(f=Kw(e,l),f<0)break;if(A!==h.charCodeAt(f-1))break}return u?e.push("ordered_list_close","ol",-1).markup=$:e.push("bullet_list_close","ul",-1).markup=$,I[1]=l,e.line=l,e.parentType=F,a&&Zq(e,L),!0}function Yw(e){return e===9||e===32}function Xq(e,t,n){const o=e.md.block.ruler.getRulesForState(e,"paragraph"),s=e.parentType,i=e.src,r=e.bMarks,l=e.tShift,a=e.eMarks,c=e.sCount,u=e.blkIndent,d=g6(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(s==="list"&&c[f]>=u){const y=r[f]+l[f],k=a[f];if(y<k){const A=i.charCodeAt(y);if(A===42||A===45||A===43){if(y+1>=k||Yw(i.charCodeAt(y+1)))break}else if(A>=48&&A<=57&&y+1<k){let $=y+1;for(;;){if($>=k){$=-1;break}const I=i.charCodeAt($++);if(I>=48&&I<=57){if($-y>=10){$=-1;break}continue}if((I===41||I===46)&&($>=k||Yw(i.charCodeAt($))))break;$=-1;break}if($>=0)break}}}const b=r[f]+l[f],v=a[f];if(d&&!v6(e,f,i,b,v))continue;let m=!1;for(let y=0,k=o.length;y<k;y++)if(o[y](e,f,n,!0)){m=!0;break}if(m)break}const h=e.getLines(t,f,u,!1).trim();e.line=f;const p=e.push("paragraph_open","p",1);p.map=[t,e.line];const g=e.push("inline","",0);return g.content=h,g.map=[t,e.line],g.children=[],e.push("paragraph_close","p",-1),e.parentType=s,!0}function jf(e){switch(e){case 9:case 32:return!0}return!1}function Jq(e,t,n,o){let s=e.bMarks[t]+e.tShift[t],i=e.eMarks[t],r=t+1;const l=e.md.block.ruler.getRulesForState(e,"reference");if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(s)!==91)return!1;function a(y){const k=e.lineMax;if(y>=k||e.isEmpty(y))return null;let A=!1;if(e.sCount[y]-e.blkIndent>3&&(A=!0),e.sCount[y]<0&&(A=!0),!A){const x=e.parentType;e.parentType="reference";let L=!1;for(let E=0,F=l.length;E<F;E++)if(l[E](e,y,k,!0)){L=!0;break}if(e.parentType=x,L)return null}const $=e.bMarks[y]+e.tShift[y],I=e.eMarks[y];return e.src.slice($,I+1)}let c=e.src.slice(s,i+1);i=c.length;let u=-1;for(s=1;s<i;s++){const y=c.charCodeAt(s);if(y===91)return!1;if(y===93){u=s;break}else if(y===10){const k=a(r);k!==null&&(c+=k,i=c.length,r++)}else if(y===92&&(s++,s<i&&c.charCodeAt(s)===10)){const k=a(r);k!==null&&(c+=k,i=c.length,r++)}}if(u<0||c.charCodeAt(u+1)!==58)return!1;for(s=u+2;s<i;s++){const y=c.charCodeAt(s);if(y===10){const k=a(r);k!==null&&(c+=k,i=c.length,r++)}else if(!jf(y))break}const d=e.md.helpers.parseLinkDestination(c,s,i);if(!d.ok)return!1;const f=e.md.normalizeLink(d.str);if(!e.md.validateLink(f))return!1;s=d.pos;const h=s,p=r,g=s;for(;s<i;s++){const y=c.charCodeAt(s);if(y===10){const k=a(r);k!==null&&(c+=k,i=c.length,r++)}else if(!jf(y))break}let b=e.md.helpers.parseLinkTitle(c,s,i);for(;b.can_continue;){const y=a(r);if(y===null)break;c+=y,s=i,i=c.length,r++,b=e.md.helpers.parseLinkTitle(c,s,i,b)}let v;for(s<i&&g!==s&&b.ok?(v=b.str,s=b.pos):(v="",s=h,r=p);s<i&&jf(c.charCodeAt(s));)s++;if(s<i&&c.charCodeAt(s)!==10&&v)for(v="",s=h,r=p;s<i&&jf(c.charCodeAt(s));)s++;if(s<i&&c.charCodeAt(s)!==10)return!1;const m=Sm(c.slice(1,u));return m?(o||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[m]>"u"&&(e.env.references[m]={title:v,href:f}),e.line=r),!0):!1}function g0(e){switch(e){case 9:case 32:return!0}return!1}const ej=65536;function v0(e,t){const n=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];return e.src.slice(n,o)}function tj(e,t){if(e.lineFlags)return(e.lineFlags[t]&td.Pipe)!==0;for(let n=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];n<o;n++)if(e.src.charCodeAt(n)===124)return!0;return!1}function Zw(e){const t=[],n=e.length;let o=0,s=e.charCodeAt(o),i=!1,r=0,l="";for(;o<n;)s===124&&(i?(l+=e.substring(r,o-1),r=o):(t.push(l+e.substring(r,o)),l="",r=o+1)),i=s===92,o++,s=e.charCodeAt(o);return t.push(l+e.substring(r)),t}function nj(e,t,n,o){if(t+2>n)return!1;let s=t+1;if(e.sCount[s]<e.blkIndent||e.sCount[s]-e.blkIndent>=4)return!1;let i=e.bMarks[s]+e.tShift[s];if(i>=e.eMarks[s])return!1;const r=e.src.charCodeAt(i++);if(r!==124&&r!==45&&r!==58||i>=e.eMarks[s])return!1;const l=e.src.charCodeAt(i++);if(l!==124&&l!==45&&l!==58&&!g0(l)||r===45&&g0(l)||!tj(e,t))return!1;for(;i<e.eMarks[s];){const k=e.src.charCodeAt(i);if(k!==124&&k!==45&&k!==58&&!g0(k))return!1;i++}let a=v0(e,t+1),c=a.split("|");const u=[];for(let k=0;k<c.length;k++){const A=c[k].trim();if(!A){if(k===0||k===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(A))return!1;A.charCodeAt(A.length-1)===58?u.push(A.charCodeAt(0)===58?"center":"right"):A.charCodeAt(0)===58?u.push("left"):u.push("")}if(a=v0(e,t).trim(),e.sCount[t]-e.blkIndent>=4)return!1;c=Zw(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop();const d=c.length;if(d===0||d!==u.length)return!1;if(o)return!0;const f=e.parentType;e.parentType="table";const h=e.md.block.ruler.getRulesForState(e,"blockquote"),p=e.push("table_open","table",1),g=[t,0];p.map=g;const b=e.push("thead_open","thead",1);b.map=[t,t+1];const v=e.push("tr_open","tr",1);v.map=[t,t+1];for(let k=0;k<c.length;k++){const A=e.push("th_open","th",1);u[k]&&(A.attrs=[["style",`text-align:${u[k]}`]]);const $=e.push("inline","",0);$.content=c[k].trim(),$.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let m,y=0;for(s=t+2;s<n&&!(e.sCount[s]<e.blkIndent);s++){let k=!1;for(let $=0,I=h.length;$<I;$++)if(h[$](e,s,n,!0)){k=!0;break}if(k||(a=v0(e,s).trim(),!a)||e.sCount[s]-e.blkIndent>=4||(c=Zw(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop(),y+=d-c.length,y>ej))break;if(s===t+2){const $=e.push("tbody_open","tbody",1);$.map=m=[t+2,0]}const A=e.push("tr_open","tr",1);A.map=[s,s+1];for(let $=0;$<d;$++){const I=e.push("td_open","td",1);u[$]&&(I.attrs=[["style",`text-align:${u[$]}`]]);const x=e.push("inline","",0);x.content=c[$]?c[$].trim():"",x.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return m&&(e.push("tbody_close","tbody",-1),m[1]=s),e.push("table_close","table",-1),g[1]=s,e.parentType=f,e.line=s,!0}var oj=class{_rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t,n){this._rules.push({name:e,enabled:!0,fn:t,alt:n?.alt||[]}),this.invalidateCache()}before(e,t,n,o){const s=this._rules.findIndex(r=>r.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const i=this._rules.findIndex(r=>r.name===t);i>=0&&this._rules.splice(i,1),this._rules.splice(s,0,{name:t,enabled:!0,fn:n,alt:o?.alt||[]}),this.invalidateCache()}after(e,t,n,o){const s=this._rules.findIndex(r=>r.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const i=this._rules.findIndex(r=>r.name===t);i>=0&&this._rules.splice(i,1),this._rules.splice(s+1,0,{name:t,enabled:!0,fn:n,alt:o?.alt||[]}),this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache[t]??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache[t]??[]}getRulesForState(e,t){const n=e?.env;return n&&(Object.prototype.hasOwnProperty.call(n,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(n,"__mdtsProfileRules"))?this.getNamedRules(t).map(({name:o,fn:s})=>(i,r,l,a)=>{const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now(),u=s(i,r,l,a),d=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();return Hc(i?.env,"block",o,d-c,u,!!a),u}):this.getRules(t)}at(e,t,n){const o=this._rules.findIndex(s=>s.name===e);if(o===-1)throw new Error(`Parser rule not found: ${e}`);this._rules[o].fn=t,n?.alt&&(this._rules[o].alt=n.alt),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!1;return n.forEach(i=>{const r=this._rules.findIndex(l=>l.name===i);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${i}`)}o.push(i),this._rules[r].enabled||(this._rules[r].enabled=!0,s=!0)}),s&&this.invalidateCache(),o}disable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!1;return n.forEach(i=>{const r=this._rules.findIndex(l=>l.name===i);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${i}`)}o.push(i),this._rules[r].enabled&&(this._rules[r].enabled=!1,s=!0)}),s&&this.invalidateCache(),o}enableOnly(e){const t=new Set(e);let n=!1;for(const o of this._rules){const s=t.has(o.name);o.enabled!==s&&(o.enabled=s,n=!0)}n&&this.invalidateCache()}compileCache(){const e=new Set([""]);for(const o of this._rules)if(o.enabled)for(const s of o.alt)e.add(s);const t=Object.create(null),n=Object.create(null);for(const o of e){const s=[],i=[];for(const r of this._rules)r.enabled&&(o!==""&&!r.alt.includes(o)||(s.push(r.fn),i.push({name:r.name,fn:r.fn})));t[o]=s,n[o]=i}this.cache=t,this.namedCache=n}};const Vf=[["table",nj,["paragraph","reference"]],["code",Pq],["fence",Hq,["paragraph","reference","blockquote","list"]],["blockquote",Dq,["paragraph","reference","blockquote","list"]],["hr",Uq,["paragraph","reference","blockquote","list"]],["list",Qq,["paragraph","reference","blockquote"]],["reference",Jq],["html_block",qq,["paragraph","reference","blockquote"]],["heading",Wq,["paragraph","reference","blockquote"]],["lheading",Kq],["paragraph",Xq]];var sj=class{ruler;cachedRulesVersion=-1;cachedRules=[];constructor(){this.ruler=new oj;for(let e=0;e<Vf.length;e++)this.ruler.push(Vf[e][0],Vf[e][1],{alt:(Vf[e][2]||[]).slice()});this.ruler.__mdtsDefaultVersion=this.ruler.version}tokenize(e,t,n){const o=this.getRules(),s=o.length,i=e.md.options.maxNesting,r=e.bMarks,l=e.tShift,a=e.eMarks,c=e.sCount;let u=t,d=!1;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){for(;u<n;){for(;u<n&&r[u]+l[u]>=a[u];)u++;if(e.line=u,u>=n||c[u]<e.blkIndent)break;if(e.level>=i){e.line=n;break}const h=e.line;let p=!1;for(let g=0;g<s;g++)if(p=o[g](e,u,n,!1),p){if(h>=e.line)throw new Error("block rule didn't increment state.line");break}if(!p)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),u=e.line,u<n&&r[u]+l[u]>=a[u]&&(d=!0,u++,e.line=u)}return}const f=this.ruler.getNamedRules("");for(;u<n;){for(;u<n&&r[u]+l[u]>=a[u];)u++;if(e.line=u,u>=n||c[u]<e.blkIndent)break;if(e.level>=i){e.line=n;break}const h=e.line;let p=!1;for(let g=0;g<s;g++){const b=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();p=f[g].fn(e,u,n,!1);const v=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(Hc(e.env,"block",f[g].name,v-b,p,!1),p){if(h>=e.line)throw new Error("block rule didn't increment state.line");break}}if(!p)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),u=e.line,u<n&&r[u]+l[u]>=a[u]&&(d=!0,u++,e.line=u)}}parse(e,t,n,o){if(!e||e.length===0)return;const s=new m6(e,t,n,o);this.tokenize(s,s.line,s.lineMax)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(""),this.cachedRulesVersion=this.ruler.version),this.cachedRules}},k6=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}};k6.prototype.Token=xo;const Qw=[["normalize",wq],["block",kU],["inline",hq],["linkify",kq],["replacements",Tq],["smartquotes",$q],["text_join",Fq]],ij={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:100},rj={parseLinkLabel:Qy,parseLinkDestination:Zy,parseLinkTitle:Xy};function lj(){return{...ij}}function aj(){return{...rj}}var cj=class{fallbackParser;lastState=null;block;inline;ruler;linkifyInstance=null;cachedCoreRulesVersion=-1;cachedCoreRules=[];cachedCoreNamedRulesVersion=-1;cachedCoreNamedRules=[];constructor(){this.block=new sj,this.inline=new fq,this.ruler=new Nq;for(let e=0;e<Qw.length;e++){const[t,n]=Qw[e];this.ruler.push(t,n)}this.fallbackParser={block:this.block,inline:this.inline,core:this,options:lj(),helpers:aj(),normalizeLink:h6,normalizeLinkText:p6,validateLink:f6,linkify:null}}resolveParser(e){return e||(this.linkifyInstance||(this.linkifyInstance=new GA),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 k6(e,this.resolveParser(n),t)}getCoreRules(){return this.cachedCoreRulesVersion!==this.ruler.version&&(this.cachedCoreRules=this.ruler.getRules(""),this.cachedCoreRulesVersion=this.ruler.version),this.cachedCoreRules}getCoreNamedRules(){return this.cachedCoreNamedRulesVersion!==this.ruler.version&&(this.cachedCoreNamedRules=this.ruler.getNamedRules(""),this.cachedCoreNamedRulesVersion=this.ruler.version),this.cachedCoreNamedRules}process(e){if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){const n=this.getCoreRules();for(let o=0;o<n.length;o++)n[o](e);return}const t=this.getCoreNamedRules();for(let n=0;n<t.length;n++){const o=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();t[n].fn(e);const s=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();Hc(e.env,"core",t[n].name,s-o,!0,!1)}uq(e.env)}parseSource(e,t={},n){if(typeof e!="string"&&yU(e))return this.parse(XA(e),t,n);const o=this.createState(e,t,n);return this.process(o),this.lastState=o,o}parse(e,t={},n){if(typeof e!="string")throw new TypeError("Input data should be a String");return this.parseSource(e,t,n)}getTokens(){return this.lastState?this.lastState.tokens:[]}};const uj=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function pp(e){return!uj.test(e)}function qu(e,t){const n=e.indexOf(`
98
+ `,t);return n===-1?e.length:n}function xh(e,t,n){for(let o=t;o<n;o++){const s=e.charCodeAt(o);if(s!==32&&s!==9)return!1}return!0}function Xw(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function y0(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function dj(e){if(e.length>3)return pp(e);for(let t=0;t<e.length;t++)switch(e.charCodeAt(t)){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!1}return!0}const fj=["","h1","h2","h3","h4","h5","h6"],hj=["","#","##","###","####","#####","######"],Jw=0,k0=1,b0=2;function Vs(e,t,n,o){const s=new xo(e,t,n);return s.level=o,s.block=!0,s}function b6(e,t,n){const o=Vs("inline","",0,n);o.map=[t,t+1],o.content=e;const s=new xo("text","",0);return s.content=e,o.children=[s],o}function pj(e,t,n,o,s){let i=0,r=n;for(;r<o&&t.charCodeAt(r)===35&&i<6;)r++,i++;if(i===0||r>=o||t.charCodeAt(r)!==32)return!1;let l=r+1;for(;l<o&&t.charCodeAt(l)===32;)l++;let a=o;for(;a>l&&t.charCodeAt(a-1)===32;)a--;let c=a;for(;c>l&&t.charCodeAt(c-1)===35;)c--;if(c>l&&t.charCodeAt(c-1)===32)for(a=c-1;a>l&&t.charCodeAt(a-1)===32;)a--;const u=t.slice(l,a);if(!pp(u))return!1;const d=fj[i],f=hj[i],h=Vs("heading_open",d,1,0);h.map=[s,s+1],h.markup=f,e.push(h),e.push(b6(u,s,1));const p=Vs("heading_close",d,-1,0);return p.markup=f,e.push(p),!0}function mj(e,t,n){const o=Vs("paragraph_open","p",1,0);o.map=[n,n+1],e.push(o),e.push(b6(t,n,1)),e.push(Vs("paragraph_close","p",-1,0))}function gj(e,t,n){const o=e.charCodeAt(n-1);return o===32||o===9?e.slice(t,n).trim():e.slice(t,n)}function x0(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function vj(e,t){const n=Vs("bullet_list_open","ul",1,0);return n.map=[t,t],n.markup="-",e.push(n),n}function yj(e,t,n){const o=Vs("list_item_open","li",1,1);o.map=[n,n+1],o.markup="-",e.push(o);const s=Vs("paragraph_open","p",1,2);s.map=[n,n+1],s.hidden=!0,e.push(s);const i=Vs("inline","",0,3);i.map=[n,n+1],i.content=t;const r=new xo("text","",0);r.content=t,i.children=[r],e.push(i);const l=Vs("paragraph_close","p",-1,2);l.hidden=!0,e.push(l);const a=Vs("list_item_close","li",-1,1);return a.markup="-",e.push(a),o}function kj(e){const t=Vs("bullet_list_close","ul",-1,0);t.markup="-",e.push(t)}function bj(e,t,n,o){if(!Xw(e,t,n))return null;const s=e.slice(t+3,n);if(s.includes("`"))return null;const i=n<e.length?n+1:n;let r=i,l=i,a=o+1;for(;l<e.length;){const c=qu(e,l);if(Xw(e,l,c)&&xh(e,l+3,c)){const u=Vs("fence","code",0,0);return u.map=[o,a+1],u.markup="```",u.info=s,u.content=e.slice(i,r),{token:u,nextPos:c<e.length?c+1:c,nextLine:a+1}}l=c<e.length?c+1:c,r=l,a++}return null}function xj(e){if(e.length===0)return[];if(e.includes("\r")||e.includes("\0"))return null;const t=[];let n=e.length>=1e5?Jw:b0,o="",s=!1,i=!1,r=0,l=0;for(;r<e.length;){const a=qu(e,r);if(r===a){r=a<e.length?a+1:a,l++;continue}const c=e.charCodeAt(r);if(c===32||c===9){if(!xh(e,r,a))return null;r=a<e.length?a+1:a,l++;continue}if(c===35){if(!pj(t,e,r,a,l))return null;const h=a<e.length?a+1:a;r=x0(e,h),l+=1+r-h;continue}if(c===45){if(!y0(e,r,a))return null;const h=l;let p=r,g=l,b=null,v=null;for(;p<e.length;){const k=qu(e,p);if(!y0(e,p,k))break;const A=p+2,$=k===A+1?e[A]:e.slice(A,k);if(!dj($))return null;b===null&&(b=vj(t,h)),v=yj(t,$,g),p=k<e.length?k+1:k,g++}if(b===null||v===null)return null;let m=p,y=g;for(;m<e.length;){if(e.charCodeAt(m)===10){m++,y++;continue}const k=qu(e,m);if(!xh(e,m,k)){if(y0(e,m,k))return null;break}m=k<e.length?k+1:k,y++}b.map[1]=y,v.map[1]=y,kj(t),r=m,l=y;continue}if(c===96){const h=bj(e,r,a,l);if(!h)return null;t.push(h.token),r=x0(e,h.nextPos),l=h.nextLine+r-h.nextPos;continue}const u=gj(e,r,a);let d;if(n===b0?d=pp(u):n===k0&&u===o?d=s:(d=pp(u),n===Jw?(i&&(n=u===o?k0:b0),o=u,s=d,i=!0):n===k0&&(o=u,s=d)),!d)return null;const f=a<e.length?a+1:a;if(f<e.length&&e.charCodeAt(f)!==10&&!xh(e,f,qu(e,f)))return null;mj(t,u,l),r=x0(e,f),l+=1+r-f}return t}const wj=/[&<>"]/,e_=/[&<>"]/g,_j=/&/g,Sj=/[<>"]/g,Cj={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function w0(e){return Cj[e]||e}function $n(e){if(e.length===0)return"";if(e.length<32)return wj.test(e)?e.replace(e_,w0):e;const t=e.includes("&"),n=e.includes("<"),o=e.includes(">"),s=e.includes('"');return!t&&!n&&!o&&!s?e:t&&!n&&!o&&!s?e.replace(_j,"&amp;"):t?e.replace(e_,w0):e.replace(Sj,w0)}const Aj=new RegExp(`${/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),Mj=/^#(?:x[a-f0-9]{1,8}|\d{1,8})$/i;function x6(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(Aj,(t,n,o)=>{if(n)return n;if(Mj.test(o)){const i=o[1].toLowerCase()==="x"?Number.parseInt(o.slice(2),16):Number.parseInt(o.slice(1),10);return Cm(i)?Id(i):"�"}const s=Wy(t);return s!==t?s:t})}const Ej=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/,Tj=/[\n!"#$%&*+\-:<=>@[\]\\^_`{}~]/,Nj=/"/g;function Cc(e,t){const n=e.indexOf(`
99
+ `,t);return n===-1?e.length:n}function mp(e,t,n){for(let o=t;o<n;o++){const s=e.charCodeAt(o);if(s!==32&&s!==9)return!1}return!0}function Kf(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function Ij(e,t){return t>=e.length||e.charCodeAt(t)===10?!1:!mp(e,t,Cc(e,t))}function t_(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function Lj(e,t,n){const o=e.charCodeAt(n-1);return o===32||o===9?e.slice(t,n).trim():e.slice(t,n)}function nk(e){return Tj.test(e)?Ej.test(e)?null:e.replace(Nj,"&quot;"):e}function $j(e,t,n){let o=0,s=t;for(;s<n&&e.charCodeAt(s)===35&&o<6;)s++,o++;if(o===0||s>=n||e.charCodeAt(s)!==32)return null;let i=s+1;for(;i<n&&e.charCodeAt(i)===32;)i++;let r=n;for(;r>i&&e.charCodeAt(r-1)===32;)r--;let l=r;for(;l>i&&e.charCodeAt(l-1)===35;)l--;if(l>i&&e.charCodeAt(l-1)===32)for(r=l-1;r>i&&e.charCodeAt(r-1)===32;)r--;const a=nk(e.slice(i,r));return a===null?null:`<h${o}>${a}</h${o}>
100
+ `}function n_(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function Fj(e,t){switch(e.charCodeAt(t)){case 34:return`<li>&quot;</li>
101
+ `;case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return null}return`<li>${e[t]}</li>
102
+ `}function Oj(e,t,n){const o=t+2;if(n===o+1)return Fj(e,o);const s=nk(e.slice(t+2,n));return s===null?null:`<li>${s}</li>
103
+ `}function Rj(e,t,n){for(;t<n;){const s=e.charCodeAt(t);if(s!==32&&s!==9)break;t++}for(;n>t;){const s=e.charCodeAt(n-1);if(s!==32&&s!==9)break;n--}let o=n;for(let s=t;s<n;s++){const i=e.charCodeAt(s);if(i===96)return null;if(i===32||i===9){o=s;break}}return e.slice(t,o)}function Bj(e,t,n,o){if(!t_(e,t,n))return null;const s=Rj(e,t+3,n);if(s===null)return null;const i=n<e.length?n+1:n;let r=i,l=i;for(;l<e.length;){const a=Cc(e,l);if(t_(e,l,a)&&mp(e,l+3,a)){const c=e.slice(i,r);let u;return s===o.lang?u=o.open:(u=s?`<pre><code class="language-${$n(s)}">`:"<pre><code>",o.lang=s,o.open=u),{html:`${u}${$n(c)}</code></pre>
104
+ `,nextPos:a<e.length?a+1:a}}l=a<e.length?a+1:a,r=l}return null}function o_(e){if(e.length===0)return"";if(e.includes("\r")||e.includes("\0"))return null;let t=0,n="";const o=e.length>=25e4,s=[],i={lang:"",open:"<pre><code>"};let r="",l="",a="",c="";for(;t<e.length;){const u=Cc(e,t);if(t===u){t=u<e.length?u+1:u;continue}const d=e.charCodeAt(t);if(d===32||d===9){if(!mp(e,t,u))return null;t=u<e.length?u+1:u;continue}if(d===35){const g=$j(e,t,u);if(g===null)return null;o?s.push(g):n+=g,t=Kf(e,u<e.length?u+1:u);continue}if(d===45){let g=t;for(;g<e.length;){const y=Cc(e,g);if(!n_(e,g,y))break;g=y<e.length?y+1:y}if(g===t)return null;const b=e.slice(t,g);let v;if(b===r)v=l;else{let y=t;for(v=`<ul>
105
+ `;y<g;){const k=Cc(e,y),A=Oj(e,y,k);if(A===null)return null;v+=A,y=k<e.length?k+1:k}v+=`</ul>
106
+ `,r=b,l=v}let m=Kf(e,g);for(;m<e.length;){if(e.charCodeAt(m)===10){m++;continue}const y=Cc(e,m);if(!mp(e,m,y)){if(n_(e,m,y))return null;break}m=y<e.length?y+1:y}o?s.push(v):n+=v,t=m;continue}if(d===96){const g=Bj(e,t,u,i);if(!g)return null;o?s.push(g.html):n+=g.html,t=Kf(e,g.nextPos);continue}const f=Lj(e,t,u);let h;if(f===a)h=c;else{const g=nk(f);if(g===null)return null;h=`<p>${g}</p>
107
+ `,a=f,c=h}const p=u<e.length?u+1:u;if(p<e.length&&e.charCodeAt(p)!==10&&Ij(e,p))return null;o?s.push(h):n+=h,t=Kf(e,p)}return o?s.join(""):n}const Dj={maxChunkChars:1e4,maxChunkLines:200,fenceAware:!0,maxChunks:void 0,fallbackOnGlobalState:!0};function gp(e,t,n={},o){us(n);const s={...Dj,...o||{}},i=Ts(t);if(s.fallbackOnGlobalState!==!1&&i)return m0(n,{count:1,fallback:!0,fallbackReason:i,globalStateDetected:i,maxChunkChars:s.maxChunkChars,maxChunkLines:s.maxChunkLines}),Pc(n,i,()=>e.core.parse(t,n,e).tokens);let r=wh(t,s);if(s.maxChunks&&r.length>s.maxChunks&&(r=zj(r,s.maxChunks)),_h(t,r))return m0(n,{count:1,fallback:!0,fallbackReason:"unsafe-chunk-boundary",maxChunkChars:s.maxChunkChars,maxChunkLines:s.maxChunkLines}),Pc(n,i,()=>e.core.parse(t,n,e).tokens);let l=0;const a=[];return m0(n,{count:r.length,maxChunkChars:s.maxChunkChars,maxChunkLines:s.maxChunkLines,globalStateDetected:i||void 0,globalStateFallbackDisabled:s.fallbackOnGlobalState===!1&&!!i}),Pc(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&&Hj(f,l),Wj(a,f),l+=u.lineCount}return a})}function wh(e,t,n=!0){const o=[];let s=0,i=0,r=0,l=0,a=0,c=0,u=null;function d(f){f<=r||(o.push({start:r,end:f,lineCount:l}),r=f,s=0,i=0,l=0)}for(let f=0;f<e.length;){let h=e.indexOf(`
108
+ `,f),p=h;h===-1?(h=e.length,p=e.length):p=h+1;const g=Uj(e,f,h);if(t.fenceAware){let m=f;for(;m<h;){const k=e.charCodeAt(m);if(k===32||k===9)m++;else break}const y=e[m];if(y==="`"||y==="~"){let k=m;for(;k<h&&e[k]===y;)k++;const A=k-m;A>=3&&(u?u.marker===y&&A>=u.length&&(u=null):u={marker:y,length:A})}}const b=p-f;s+=b,i+=1,l+=1,g?(a=0,c=0):(a+=1,c+=b);const v=g;if((s>=t.maxChunkChars||i>=t.maxChunkLines)&&!u)if(v)d(p);else{const m=Math.max(10,Math.floor(t.maxChunkLines*.5)),y=Math.max(t.maxChunkChars,8e3);(a>=m||c>=y)&&d(p)}f=p}return n&&d(e.length),o}function _h(e,t,n={rangesCoverWholeSource:!0}){const o=n.rangesCoverWholeSource?t.length-1:t.length;for(let s=0;s<o;s++)if(!Pj(e,t[s].end))return!0;return!1}function Pj(e,t){if(t<=0||t>e.length||e.charCodeAt(t-1)!==10)return!1;let n=t-2;for(;n>=0&&e.charCodeAt(n)!==10;)n--;for(let o=n+1;o<t-1;o++){const s=e.charCodeAt(o);if(s!==32&&s!==9&&s!==13)return!1}return!0}function Hj(e,t){if(t===0)return;const n=[];for(let o=e.length-1;o>=0;o--)n.push(e[o]);for(;n.length;){const o=n.pop();if(o.map&&(o.map[0]+=t,o.map[1]+=t),o.children)for(let s=o.children.length-1;s>=0;s--)n.push(o.children[s])}}function Wj(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function zj(e,t){if(e.length<=t)return e;const n=[];let o=0;for(let s=0;s<t;s++){const i=t-s,r=e.length-o,l=Math.ceil(r/i),a=e.slice(o,o+l);let c=0;for(let u=0;u<a.length;u++)c+=a[u].lineCount;n.push({start:a[0].start,end:a[a.length-1].end,lineCount:c}),o+=l}return n}function Uj(e,t,n){for(let o=t;o<n;o++){const s=e.charCodeAt(o);if(s!==32&&s!==9&&s!==13)return!1}return!0}const w6=4e6,_6=8e4,qj=1e4,jj=200,Vj=1e4,Kj=200;function S6(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function Gj(e,t){if(t===0)return;const n=[];for(let o=e.length-1;o>=0;o--)n.push(e[o]);for(;n.length;){const o=n.pop();if(o.map&&(o.map[0]+=t,o.map[1]+=t),o.children)for(let s=o.children.length-1;s>=0;s--)n.push(o.children[s])}}function sl(e){return e.length===0?0:so(e)+(e.charCodeAt(e.length-1)===10?0:1)}function Yj(e,t,n){for(let o=t;o<n;o++){const s=e.charCodeAt(o);if(s!==32&&s!==9&&s!==13)return!1}return!0}function Zj(e,t){if(!t||e.length===0)return!1;let n=null;for(let o=0;o<e.length;){let s=e.indexOf(`
109
+ `,o);s===-1&&(s=e.length);let i=o;for(;i<s;){const l=e.charCodeAt(i);if(l===32||l===9)i++;else break}const r=e[i];if(r==="`"||r==="~"){let l=i;for(;l<s&&e[l]===r;)l++;const a=l-i;a>=3&&(n?n.marker===r&&a>=n.length&&(n=null):n={marker:r,length:a})}o=s===e.length?e.length:s+1}return n!==null}function Qj(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 Yj(e,n+1,e.length-1)?!Zj(e,t):!1}function Xj(e,t,n,o={}){const s=o.mode??"full",i=o.fenceAware??(s==="stream"?e.options.streamChunkFenceAware??!0:e.options.fullChunkFenceAware??!0);if(o.maxChunkChars!==void 0||o.maxChunkLines!==void 0||o.autoTune===!1){const r=o.maxChunkChars??(s==="stream"?e.options.streamChunkSizeChars??Vj:e.options.fullChunkSizeChars??qj),l=o.maxChunkLines??(s==="stream"?e.options.streamChunkSizeLines??Kj:e.options.fullChunkSizeLines??jj);return{maxChunkChars:r,maxChunkLines:l,holdBelowChars:r,holdBelowLines:l,fenceAware:i}}return s==="stream"?t<=5e3?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:i}:t<=2e4?{maxChunkChars:16e3,maxChunkLines:200,holdBelowChars:16e3,holdBelowLines:200,fenceAware:i}:t<=5e4?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:i}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:i}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:i}:t<=1e5&&n<=2500?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:1e5,holdBelowLines:2500,fenceAware:i}:t<=2e5?{maxChunkChars:2e4,maxChunkLines:150,holdBelowChars:2e4,holdBelowLines:150,fenceAware:i}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:i}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:i}}var Zd=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=sl(this.pending);if(this.pending.length<t.holdBelowChars&&n<t.holdBelowLines)return this.updateEnvDiagnostics(e,t,n),null;const o=wh(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!1);if(!o.length)return this.updateEnvDiagnostics(e,t,n),null;if(_h(this.pending,o,{rangesCoverWholeSource:!1}))return this.updateEnvDiagnostics(e,t,n),null;const s=this.commitRanges(o,e);return this.pending=this.pending.slice(s),this.updateEnvDiagnostics(e,t,sl(this.pending)),this.tokens}flushIfBoundary(e={}){if(!this.pending)return null;const t=this.resolveWindow();if(!Qj(this.pending,t.fenceAware))return this.updateEnvDiagnostics(e,t,sl(this.pending)),null;const n=wh(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(!n.length)return this.updateEnvDiagnostics(e,t,sl(this.pending)),null;const o=_h(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:sl(this.pending)}]:n;return this.commitRanges(o,e),this.pending="",this.updateEnvDiagnostics(e,t,0),this.tokens}flushForce(e={}){if(!this.pending){this.prepareGlobalStateEnv(e,"");const o=this.resolveWindow();return this.updateEnvDiagnostics(e,o,0),this.tokens}const t=this.resolveWindow(),n=wh(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(n.length){const o=_h(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:sl(this.pending)}]:n;this.commitRanges(o,e),this.pending=""}return this.updateEnvDiagnostics(e,t,0),this.tokens}reset(){this.pending="",this.tokens=[],this.committedChars=0,this.committedLines=0,this.fedChunks=0,this.parsedChunks=0,this.globalStateEnv=null,this.markedGlobalStateReason=null}peek(){return this.tokens}pendingText(){return this.pending}stats(){return{mode:this.options.mode??"full",fedChunks:this.fedChunks,parsedChunks:this.parsedChunks,committedChars:this.committedChars,committedLines:this.committedLines,pendingChars:this.pending.length,pendingLines:sl(this.pending),retainedTokens:this.options.retainTokens!==!1}}resolveWindow(){const e=this.committedChars+this.pending.length,t=this.committedLines+sl(this.pending);return Xj(this.md,e,t,this.options)}prepareGlobalStateEnv(e,t){if(this.globalStateEnv!==e&&(Yd(e)&&zr(e),this.globalStateEnv=e,this.markedGlobalStateReason=null),this.markedGlobalStateReason)return;const n=Ts(t);n&&(Gy(e,n),this.markedGlobalStateReason=n)}commitRanges(e,t){if(!e.length)return 0;this.prepareGlobalStateEnv(t,this.pending);let n=0;try{for(let o=0;o<e.length;o++){const s=e[o],i=this.pending.slice(s.start,s.end),r=this.md.core.parse(i,t,this.md).tokens,l=this.committedChars,a=this.committedLines;a!==0&&r.length&&Gj(r,a),this.options.retainTokens!==!1&&S6(this.tokens,r),this.committedChars+=i.length,this.committedLines+=s.lineCount,this.parsedChunks+=1,this.options.onChunkTokens&&this.options.onChunkTokens(r,{chunkIndex:this.parsedChunks,chunkChars:i.length,chunkLines:s.lineCount,tokenCount:r.length,startOffset:l,endOffset:this.committedChars,startLine:a,endLine:this.committedLines}),n=s.end}return this.markedGlobalStateReason&&Yy(t),n}catch(o){throw this.markedGlobalStateReason&&(zr(t),this.globalStateEnv=null,this.markedGlobalStateReason=null),o}}updateEnvDiagnostics(e,t,n){jA(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 Jj(e,t,n={},o={}){us(n);const s=new Zd(e,{mode:"full",...o});for(const i of t)s.feed(i),s.flushAvailable(n);return s.flushForce(n)}async function eV(e,t,n={},o={}){us(n);const s=new Zd(e,{mode:"full",...o});for await(const i of t)s.feed(i),s.flushAvailable(n);return s.flushForce(n)}function tV(e,t,n,o={},s={}){us(o);const i=new Zd(e,{mode:"full",...s,retainTokens:!1,onChunkTokens:n});for(const r of t)i.feed(r),i.flushAvailable(o);return i.flushForce(o),i.stats()}async function nV(e,t,n,o={},s={}){us(o);const i=new Zd(e,{mode:"full",...s,retainTokens:!1,onChunkTokens:n});for await(const r of t)i.feed(r),i.flushAvailable(o);return i.flushForce(o),i.stats()}function C6(e,t,n){if(e.options.autoUnbounded===!1)return!1;const o=e.options.autoUnboundedThresholdChars??w6,s=e.options.autoUnboundedThresholdLines??_6;return t>=o||n>=s}function A6(e,t,n){if(e.options.autoUnbounded===!1)return"no";if(t>=(e.options.autoUnboundedThresholdChars??w6))return"yes";const o=e.options.autoUnboundedThresholdLines??_6;return n!==void 0?n>=o?"yes":"no":t+1<o?"no":"need-lines"}function nd(e,t,n={},o={}){us(n);const s=Ts(t);if(Yd(n)&&zr(n),o.fallbackOnGlobalState!==!1&&s)return jA(n,{mode:"full",fallback:!0,fallbackReason:s,committedChars:t.length,committedLines:so(t),pendingChars:0,pendingLines:0,fedChunks:1,parsedChunks:1,globalStateDetected:s}),Pc(n,s,()=>e.core.parse(t,n,e).tokens);const i=[],r=new Zd(e,{mode:"full",...o,retainTokens:!1,onChunkTokens(l){S6(i,l)}});if(s&&Gy(n,s),r.feed(t),r.flushForce(n),s&&(Yy(n),o.fallbackOnGlobalState===!1)){const l=_r(n)?.unbounded;l&&(l.globalStateDetected=s,l.globalStateFallbackDisabled=!0)}return i}const Wc=(e,t,n)=>e<t?t:e>n?n:e;function M6(e){return e.experimental?{...e,...e.experimental}:e}const s_=[{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"}],i_=[{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 E6(e,t){return{strategy:t.strategy,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,maxChunks:t.maxChunks,fenceAware:e,notes:t.notes}}function oV(e,t=Math.max(0,e/40|0),n={}){const o=M6(n),s=o.fullChunkFenceAware??!0,i=o.fullChunkTargetChunks??8,r=o.fullChunkAdaptive!==!1;for(let l=0;l<s_.length;l++){const a=s_[l];if(e<=a.max){if(a.strategy!=="adaptive")return E6(s,a);break}}return e>5e6?{strategy:"plain",fenceAware:s,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:Wc(Math.ceil(e/i),8e3,64e3),maxChunkLines:Wc(Math.ceil(t/i),150,700),maxChunks:Wc(Math.ceil(e/64e3),i,16),fenceAware:s,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:o.fullChunkSizeChars??1e4,maxChunkLines:o.fullChunkSizeLines??200,fenceAware:s,maxChunks:o.fullChunkMaxChunks}}function r_(e,t=Math.max(0,e/40|0),n={}){const o=M6(n),s=o.streamChunkFenceAware??!0,i=o.streamChunkTargetChunks??8,r=o.streamChunkAdaptive!==!1;for(let l=0;l<i_.length;l++){const a=i_[l];if(e<=a.max){if(a.strategy!=="adaptive")return E6(s,a);break}}return e>5e6?{strategy:"plain",fenceAware:s,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:Wc(Math.ceil(e/i),8e3,64e3),maxChunkLines:Wc(Math.ceil(t/i),150,700),maxChunks:Wc(Math.ceil(e/64e3),i,32),fenceAware:s,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:o.streamChunkSizeChars??1e4,maxChunkLines:o.streamChunkSizeLines??200,maxChunks:o.streamChunkMaxChunks,fenceAware:s}}var sV={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"]}}},iV={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},rV={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"]},inline2:{rules:["balance_pairs","fragments_join"]}}};function Tm(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function Sh(e,t){if(Tm(e))throw new TypeError(`Renderer rule "${t}" returned a Promise. Use renderAsync() instead.`);return e}const l_=e=>Tm(e)?e:Promise.resolve(e);function od(e){switch(e){case"alt":case"class":case"href":case"id":case"lang":case"rel":case"src":case"start":case"style":case"target":case"title":return e;default:return $n(e)}}function $l(e){if(!e||e.length===0)return"";const t=e[0];let n=` ${od(t[0])}="${$n(t[1])}"`;for(let o=1;o<e.length;o++){const s=e[o];n+=` ${od(s[0])}="${$n(s[1])}"`}return n}function T6(e){if(!e)return{langName:"",langAttrs:""};let t=0;for(;t<e.length;){const o=e.charCodeAt(t);if(o===32||o===9||o===10)break;t++}if(t>=e.length)return{langName:e,langAttrs:""};let n=t;for(;n<e.length;){const o=e.charCodeAt(n);if(o!==32&&o!==9&&o!==10)break;n++}return{langName:e.slice(0,t),langAttrs:n<e.length?e.slice(n):""}}function sd(e,t,n,o,s){if(t.indexOf("<pre")===0)return`${t}
110
+ `;if(n){if(!e.attrs||e.attrs.length===0)return`<pre><code class="${$n(`${s.langPrefix??"language-"}${o}`)}">${t}</code></pre>
111
+ `;const i=e.attrIndex("class"),r=e.attrs?e.attrs.slice():[],l=`${s.langPrefix??"language-"}${o}`;return i<0?r.push(["class",l]):(r[i]=r[i].slice(),r[i][1]+=` ${l}`),`<pre><code${$l(r)}>${t}</code></pre>
112
+ `}return`<pre><code${$l(e.attrs)}>${t}</code></pre>
113
+ `}function vp(e){return!e.attrs||e.attrs.length===0?`<code>${$n(e.content)}</code>`:`<code${$l(e.attrs)}>${$n(e.content)}</code>`}function cv(e){const t=$n(e.content);return e.attrs?`<pre${$l(e.attrs)}><code>${t}</code></pre>
114
+ `:`<pre><code>${t}</code></pre>
115
+ `}function lV(e,t){const n=e.attrs;if(!n||n.length===0)switch(e.type){case"paragraph_open":return`${t}<p>`;case"heading_open":return`<${e.tag}>`;case"td_open":return`${t}<td>`;case"th_open":return`${t}<th>`;default:return null}if(n.length===1&&n[0][0]==="style"){if(e.type==="td_open")return`${t}<td style="${$n(n[0][1])}">`;if(e.type==="th_open")return`${t}<th style="${$n(n[0][1])}">`}return null}function a_(e){const t=e.attrs;return!t||t.length===0?"<a>":t.length===1?`<a ${od(t[0][0])}="${$n(t[0][1])}">`:t.length===2?`<a ${od(t[0][0])}="${$n(t[0][1])}" ${od(t[1][0])}="${$n(t[1][1])}">`:`<a${$l(t)}>`}function aV(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 c_(e){switch(e.type){case"text":case"text_special":case"softbreak":case"hardbreak":case"html_inline":case"code_inline":return!0;default:return!1}}function yp(e,t){if(e.hidden)return"";const n=e.attrs,o=e.nesting,s=e.tag;if(!n||n.length===0)return o===0?t?`<${s} />`:`<${s}>`:o===-1?`</${s}>`:`<${s}>`;let i=(o===-1?"</":"<")+s+$l(n);return o===0&&t&&(i+=" /"),`${i}>`}const cV={langPrefix:"language-",xhtmlOut:!1,breaks:!1},Gf=Object.prototype.hasOwnProperty,Nn={code_inline(e,t){return vp(e[t])},code_block(e,t){return cv(e[t])},fence(e,t,n,o,s){const i=e[t],r=i.info?x6(i.info).trim():"",{langName:l,langAttrs:a}=T6(r),c=n.highlight,u=$n(i.content);if(!c)return sd(i,u,r,l,n);const d=c(i.content,l,a);return Tm(d)?d.then(f=>sd(i,f||u,r,l,n)):sd(i,d||u,r,l,n)},image(e,t,n,o,s){const i=e[t],r=s.renderInlineAsText(i.children||[],n,o),l=i.attrIndex("alt");return l>=0&&i.attrs?i.attrs[l][1]=r:i.attrs?i.attrs.push(["alt",r]):i.attrs=[["alt",r]],yp(i,n.xhtmlOut===!0)},hardbreak(e,t,n){return n.xhtmlOut?`<br />
116
+ `:`<br>
117
+ `},softbreak(e,t,n){return n.breaks?n.xhtmlOut?`<br />
118
+ `:`<br>
119
+ `:`
120
+ `},text(e,t){return $n(e[t].content)},text_special(e,t){return $n(e[t].content)},html_block(e,t){return e[t].content},html_inline(e,t){return e[t].content}};function u_(e,t,n){const o=e.info?x6(e.info).trim():"",{langName:s,langAttrs:i}=T6(o),r=t.highlight,l=$n(e.content);if(!r)return sd(e,l,o,s,t);const a=r(e.content,s,i);if(Tm(a))throw new TypeError('Renderer rule "fence" returned a Promise. Use renderAsync() instead.');return sd(e,a||l,o,s,t)}function Yf(e,t,n,o,s,i,r){const l=e[0];switch(l.type){case"text":if(s.text===Nn.text)return l.content.length===0?"":$n(l.content);break;case"text_special":if(s.text_special===Nn.text_special)return l.content.length===0?"":$n(l.content);break;case"softbreak":if(s.softbreak===Nn.softbreak)return r;break;case"hardbreak":if(s.hardbreak===Nn.hardbreak)return i;break;case"html_inline":if(s.html_inline===Nn.html_inline)return l.content;break;case"code_inline":if(s.code_inline===Nn.code_inline)return vp(l);break}const a=s[l.type];if(!a)return yp(l,t.xhtmlOut===!0);const c=a(e,0,t,n,o);return typeof c=="string"?c:Sh(c,l.type)}var uV=class{rules;baseOptions;normalizedBase;constructor(e={}){this.baseOptions={...e},this.normalizedBase=this.buildNormalizedBase(),this.rules={...Nn}}set(e){return this.baseOptions={...this.baseOptions,...e},this.normalizedBase=this.buildNormalizedBase(),this}render(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");if(e.length===1)return this.renderSingleToken(e,e[0],t,n);const o=this.mergeOptions(t),s=n??{},i=this.rules,r=o.xhtmlOut===!0;let l,a,c,u,d,f,h="",p="",g=!1,b="";for(let v=0;v<e.length;v++){const m=e[v],y=m.type,k=v>0&&e[v-1].hidden?`
121
+ `:"";if(y==="list_item_open"&&(!m.attrs||m.attrs.length===0)&&v+3<e.length){const I=e[v+1],x=e[v+2],L=e[v+3];if(I.type==="paragraph_open"&&I.hidden&&x.type==="inline"&&L.type==="paragraph_close"&&L.hidden){b+=`${k}<li>${this.renderInlineTokens(x.children||[],o,s)}`,v+=3;continue}}if(v+2<e.length){const I=e[v+1],x=e[v+2];if(I.type==="inline"&&x.nesting===-1&&x.tag===m.tag&&!x.hidden){const L=lV(m,k);if(L!==null){b+=`${L+this.renderInlineTokens(I.children||[],o,s)}</${m.tag}>
122
+ `,v+=2;continue}}}if(y==="inline"){const I=m.children||[];if(I.length===1){g||(l=i.text,a=i.text_special,c=i.softbreak,u=i.hardbreak,d=i.html_inline,f=i.code_inline,h=o.xhtmlOut?`<br />
123
+ `:`<br>
124
+ `,p=o.breaks?h:`
125
+ `,g=!0);const x=I[0];switch(x.type){case"text":if(l===Nn.text){b+=$n(x.content);continue}break;case"text_special":if(a===Nn.text_special){b+=$n(x.content);continue}break;case"softbreak":if(c===Nn.softbreak){b+=p;continue}break;case"hardbreak":if(u===Nn.hardbreak){b+=h;continue}break;case"html_inline":if(d===Nn.html_inline){b+=x.content;continue}break;case"code_inline":if(f===Nn.code_inline){b+=vp(x);continue}break}}b+=this.renderInlineTokens(I,o,s);continue}const A=i[y];if(!A){const I=m.attrs;if(!m.hidden){if(!I||I.length===0)switch(y){case"hr":b+=r?`<hr />
126
+ `:`<hr>
127
+ `;continue;case"heading_open":b+=`<${m.tag}>`;continue;case"heading_close":b+=`</${m.tag}>
128
+ `;continue;case"paragraph_open":b+=`${k}<p>`;continue;case"paragraph_close":b+=`</p>
129
+ `;continue;case"list_item_open":{const x=e[v+1];b+=k+(x&&(x.type==="inline"||x.hidden||x.nesting===-1&&x.tag==="li")?"<li>":`<li>
130
+ `);continue}case"list_item_close":b+=`</li>
131
+ `;continue;case"bullet_list_open":b+=`${k}<ul>
132
+ `;continue;case"bullet_list_close":b+=`</ul>
133
+ `;continue;case"blockquote_open":b+=k+(e[v+1]&&e[v+1].nesting===-1&&e[v+1].tag==="blockquote"?"<blockquote>":`<blockquote>
134
+ `);continue;case"blockquote_close":b+=`</blockquote>
135
+ `;continue;case"ordered_list_open":b+=`${k}<ol>
136
+ `;continue;case"ordered_list_close":b+=`</ol>
137
+ `;continue;case"table_open":b+=`${k}<table>
138
+ `;continue;case"table_close":b+=`</table>
139
+ `;continue;case"thead_open":b+=`${k}<thead>
140
+ `;continue;case"thead_close":b+=`</thead>
141
+ `;continue;case"tbody_open":b+=`${k}<tbody>
142
+ `;continue;case"tbody_close":b+=`</tbody>
143
+ `;continue;case"tr_open":b+=`${k}<tr>
144
+ `;continue;case"tr_close":b+=`</tr>
145
+ `;continue;case"td_open":b+=`${k}<td>`;continue;case"td_close":b+=`</td>
146
+ `;continue;case"th_open":b+=`${k}<th>`;continue;case"th_close":b+=`</th>
147
+ `;continue}else if(I.length===1){const x=I[0];if(y==="ordered_list_open"&&x[0]==="start"){b+=`${k}<ol start="${$n(x[1])}">
148
+ `;continue}if(y==="td_open"&&x[0]==="style"){b+=`${k}<td style="${$n(x[1])}">`;continue}if(y==="th_open"&&x[0]==="style"){b+=`${k}<th style="${$n(x[1])}">`;continue}}}b+=this.renderToken(e,v,o);continue}if(y==="code_block"&&A===Nn.code_block){b+=cv(m);continue}if(y==="fence"&&A===Nn.fence){b+=u_(m,o);continue}if(y==="html_block"&&A===Nn.html_block){b+=m.content;continue}const $=A(e,v,o,s,this);typeof $=="string"?b+=$:b+=Sh($,m.type)}return b}async renderAsync(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");const o=this.mergeOptions(t),s=n??{},i=this.rules;let r="";for(let l=0;l<e.length;l++){const a=e[l];if(a.type==="inline"){r+=await this.renderInlineTokensAsync(a.children||[],o,s);continue}const c=i[a.type];c?r+=await l_(c(e,l,o,s,this)):r+=this.renderToken(e,l,o)}return r}renderInline(e,t,n){const o=this.mergeOptions(t),s=n??{};return this.renderInlineTokens(e,o,s)}async renderInlineAsync(e,t,n){const o=this.mergeOptions(t),s=n??{};return this.renderInlineTokensAsync(e,o,s)}renderInlineAsText(e,t,n){const o=this.mergeOptions(t),s=n??{};return this.renderInlineAsTextInternal(e,o,s)}renderAttrs(e){return $l(e.attrs)}renderToken(e,t,n){const o=e[t];if(o.hidden)return"";const s=o.block,i=o.nesting,r=o.tag,l=o.attrs;let a=!1;if(s&&(a=!0,i===1&&t+1<e.length)){const f=e[t+1];(f.type==="inline"||f.hidden||f.nesting===-1&&f.tag===r)&&(a=!1)}const c=s&&i!==-1&&t>0&&e[t-1].hidden?`
149
+ `:"",u=a?`>
150
+ `:">";if(!l||l.length===0)return i===0?n.xhtmlOut?`${c}<${r} /${u}`:`${c}<${r}${u}`:i===-1?`${c}</${r}${u}`:`${c}<${r}${u}`;let d=c+(i===-1?"</":"<")+r+$l(l);return i===0&&n.xhtmlOut&&(d+=" /"),d+u}mergeOptions(e){const t=this.normalizedBase;if(!e||e.highlight===t.highlight&&e.langPrefix===t.langPrefix&&e.xhtmlOut===t.xhtmlOut&&e.breaks===t.breaks)return t;let n=null;const o=()=>(n||(n={...t}),n);if(Gf.call(e,"highlight")&&e.highlight!==t.highlight&&(o().highlight=e.highlight),Gf.call(e,"langPrefix")){const s=e.langPrefix;s!==t.langPrefix&&(o().langPrefix=s)}if(Gf.call(e,"xhtmlOut")){const s=e.xhtmlOut;s!==t.xhtmlOut&&(o().xhtmlOut=s)}if(Gf.call(e,"breaks")){const s=e.breaks;s!==t.breaks&&(o().breaks=s)}return n||t}buildNormalizedBase(){return Object.freeze({...cV,...this.baseOptions})}renderSingleToken(e,t,n,o){const s=this.rules,i=t.type;if(i==="code_block"&&s.code_block===Nn.code_block)return cv(t);if(i==="html_block"&&s.html_block===Nn.html_block)return t.content;const r=this.mergeOptions(n),l=o??{};if(i==="inline")return this.renderInlineTokens(t.children||[],r,l);const a=s[i];if(!a)return t.block?this.renderToken(e,0,r):yp(t,r.xhtmlOut===!0);if(i==="fence"&&a===Nn.fence)return u_(t,r);const c=a(e,0,r,l,this);return typeof c=="string"?c:Sh(c,i)}renderInlineTokens(e,t,n){if(!e||e.length===0)return"";const o=this.rules,s=o.text,i=o.text_special,r=o.softbreak,l=o.hardbreak,a=o.html_inline,c=o.code_inline,u=o.link_open,d=o.link_close,f=o.em_open,h=o.em_close,p=o.strong_open,g=o.strong_close,b=t.xhtmlOut===!0,v=b?`<br />
151
+ `:`<br>
152
+ `,m=t.breaks?v:`
153
+ `;if(e.length===1)return Yf(e,t,n,this,o,v,m);let y="";for(let k=0;k<e.length;k++){const A=e[k];if(A.type==="link_open"&&!u&&!d&&k+2<e.length){const x=e[k+1];if(e[k+2].type==="link_close"&&aV(x)){const L=`${a_(A)+Yf([x],t,n,this,o,v,m)}</a>`;if(r===Nn.softbreak&&k+3<e.length&&e[k+3].type==="softbreak"){y+=L+m,k+=3;continue}y+=L,k+=2;continue}}if(A.type==="link_open"&&!u&&!d&&k+1<e.length&&e[k+1].type==="link_close"){y+=`${a_(A)}</a>`,k+=1;continue}if(A.type==="em_open"&&!f&&!h&&k+2<e.length){const x=e[k+1];if(e[k+2].type==="em_close"&&c_(x)){y+=`<em>${Yf([x],t,n,this,o,v,m)}</em>`,k+=2;continue}}if(A.type==="strong_open"&&!p&&!g&&k+2<e.length){const x=e[k+1];if(e[k+2].type==="strong_close"&&c_(x)){y+=`<strong>${Yf([x],t,n,this,o,v,m)}</strong>`,k+=2;continue}}switch(A.type){case"text":if(s===Nn.text){const x=A.content.length===0?"":$n(A.content);if(a===Nn.html_inline&&k+1<e.length&&e[k+1].type==="html_inline"){for(y+=x+e[++k].content;k+1<e.length&&e[k+1].type==="html_inline";)y+=e[++k].content;continue}y+=x;continue}break;case"text_special":if(i===Nn.text_special){A.content.length!==0&&(y+=$n(A.content));continue}break;case"softbreak":if(r===Nn.softbreak){y+=m;continue}break;case"hardbreak":if(l===Nn.hardbreak){y+=v;continue}break;case"html_inline":if(a===Nn.html_inline){for(y+=A.content;k+1<e.length&&e[k+1].type==="html_inline";)y+=e[++k].content;continue}break;case"code_inline":if(c===Nn.code_inline){y+=vp(A);continue}break}const $=o[A.type];if(!$){y+=A.block?this.renderToken(e,k,t):yp(A,b);continue}const I=$(e,k,t,n,this);typeof I=="string"?y+=I:y+=Sh(I,A.type)}return y}async renderInlineTokensAsync(e,t,n){if(!e||e.length===0)return"";const o=this.rules;let s="";for(let i=0;i<e.length;i++){const r=o[e[i].type];r?s+=await l_(r(e,i,t,n,this)):s+=this.renderToken(e,i,t)}return s}renderInlineAsTextInternal(e,t,n){if(!e||e.length===0)return"";let o="";for(let s=0;s<e.length;s++){const i=e[s];switch(i.type){case"text":case"text_special":o+=i.content;break;case"image":o+=this.renderInlineAsTextInternal(i.children||[],t,n);break;case"html_inline":case"html_block":o+=i.content;break;case"softbreak":case"hardbreak":o+=`
154
+ `;break}}return o}},dV=uV;const fV=[],_0=4096;function hV(e){const t=e.length;let n=0;for(;n<=t;){let o=e.indexOf(`
155
+ `,n);o===-1&&(o=t);const s=o<t;let i=n,r=0;for(;i<o;){const l=e.charCodeAt(i);if(l===32){if(r++,i++,r>=4)return!0;continue}if(l===9){if(r+=4-r%4,i++,r>=4)return!0;continue}break}if(i<o){const l=e.charCodeAt(i);switch(l){case 35:{let a=i;for(;a<o&&e.charCodeAt(a)===35;)a++;const c=a-i;if(c>0&&c<=6){if(a<o){const u=e.charCodeAt(a);if(u===32||u===9||u===13)return!0}else if(a===o&&s)return!0}break}case 62:{const a=i+1;if(a<o){const c=e.charCodeAt(a);if(c===32||c===9||c===13)return!0}else if(a===o&&s)return!0;break}case 45:case 42:case 43:{const a=i+1;if(a<o){const c=e.charCodeAt(a);if(c===32||c===9||c===13)return!0}else if(a===o&&s)return!0;break}case 96:case 126:{let a=i;for(;a<o&&e.charCodeAt(a)===l;)a++;if(a-i>=3)return!0;break}default:if(l>=48&&l<=57){let a=i+1;for(;a<o;){const c=e.charCodeAt(a);if(c<48||c>57)break;a++}if(a<o&&e.charCodeAt(a)===46){const c=a+1;if(c<o){const u=e.charCodeAt(c);if(u===32||u===9||u===13)return!0}else if(c===o&&s)return!0}}break}}if(o===t)break;n=o+1}return!1}function pV(e,t){if(!e&&!t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n][0]!==t[n][0]||e[n][1]!==t[n][1])return!1;return!0}function mV(e,t){if(!e&&!t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!N6(e[n],t[n]))return!1;return!0}function N6(e,t){if(!e||!t||e.type!==t.type)return!1;const n=e.map,o=t.map;return!!n!=!!o||n&&o&&(n[0]!==o[0]||n[1]!==o[1])||e.tag!==t.tag||e.nesting!==t.nesting||e.markup!==t.markup||e.info!==t.info||e.block!==t.block||e.hidden!==t.hidden||!pV(e.attrs,t.attrs)||!mV(e.children,t.children)?!1:(e.content||"")===(t.content||"")}function d_(){return{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}}var gV=class{core;cache=null;stats=d_();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=d_(),this.stats.resets=e}parse(e,t,n){const o=t,s=this.cache;if(us(o??s?.env),!s||o&&o!==s.env){const N=o??{},D=!!n.__explicitStreamChunkFallbackSetting,B=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,U=!!n.options?.streamChunkedFallback,H=!D&&B,P=U||H,Z=n.options?.streamChunkAdaptive!==!1,K=n.options?.streamChunkTargetChunks??8,V=n.options?.streamChunkSizeChars,X=n.options?.streamChunkSizeLines,he=n.options?.streamChunkMaxChunks,ne=!!n.__explicitStreamChunkConfig,ue=n.options?.autoTuneChunks!==!1,de=n.options?.streamChunkFenceAware??!0,Ce=n.options?.streamLargeCachePolicy??"retain",Ie=n.options?.streamSkipCacheAboveChars??this.DEFAULT_SKIP_CACHE_CHARS,le=n.options?.streamSkipCacheAboveLines??this.DEFAULT_SKIP_CACHE_LINES;let z,ae=!1;if(Ce==="skip"&&(ae=e.length>=Ie,!ae&&le!==void 0&&(z=so(e),ae=z>=le)),ae){const q=this.parseFullDocument(e,N,n,z,!1);return this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",yo(N,{area:"stream",path:"stream-full",reason:"skip-cache-large-one-shot",unbounded:!!_r(N)?.unbounded}),q.tokens}else if(P){const q=(me,Ae,$e)=>me<Ae?Ae:me>$e?$e:me;z===void 0&&(z=so(e));const ee=ue&&!ne?r_(e.length,z,n.options):null,ye=ee?.maxChunkChars??(Z?q(Math.ceil(e.length/K),8e3,64e3):V??1e4),fe=ee?.maxChunkLines??(Z?q(Math.ceil(z/K),150,700):X??200),ve=ee?.maxChunks??(Z?q(Math.ceil(e.length/64e3),K,32):he),j=e.length>0&&e.charCodeAt(e.length-1)===10,te=H&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&ee?.strategy!=="plain";if((U||te)&&(e.length>=ye*2||z>=fe*2)&&j){const me=gp(n,e,N,{maxChunkChars:ye,maxChunkLines:fe,fenceAware:ee?.fenceAware??de,maxChunks:ve});return this.cache={src:e,tokens:me,env:N,lineCount:z,lastSegment:void 0,globalStateReason:Ts(e)},this.updateCacheLineCount(this.cache,z),this.recordChunkedParseResult(N,U?"explicit-initial-large-doc":"default-initial-large-doc"),me}}const ie=this.parseFullDocument(e,N,n,z);return z=ie.lineCount,this.cache={src:e,tokens:ie.tokens,env:N,lineCount:z,lastSegment:void 0,globalStateReason:Ts(e)},this.updateCacheLineCount(this.cache,z),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",yo(N,{area:"stream",path:"stream-full",reason:"initial-parse",unbounded:!!_r(N)?.unbounded}),ie.tokens}if(e===s.src)return this.stats.total+=1,this.stats.cacheHits+=1,this.stats.lastMode="cache",yo(s.env,{area:"stream",path:"stream-cache",reason:"same-source"}),s.tokens;const i=e.startsWith(s.src)?e.slice(s.src.length):null;let r=s.globalStateReason;r===void 0&&(r=Ts(s.src),s.globalStateReason=r);const l=r?null:i!==null?this.detectGlobalStateForAppend(s,i):Ts(e),a=r||l;if(a){const N=o??s.env;zr(N);const D=Ts(e),B=this.parseFullDocument(e,N,n),U=B.tokens,H=B.lineCount;return this.cache={src:e,tokens:U,env:N,lineCount:H,lastSegment:void 0,globalStateReason:D},this.updateCacheLineCount(this.cache,H),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",yo(N,{area:"stream",path:"stream-full",reason:`global-state:${a}`,unbounded:!!_r(N)?.unbounded}),U}const c=n.options?.streamOptimizationMinSize??this.MIN_SIZE_FOR_OPTIMIZATION;if(s.src.length<c&&e.length<c*1.5&&!e.startsWith(s.src)){const N=o??s.env,D=this.parseFullDocument(e,N,n),B=D.tokens,U=D.lineCount;return this.cache={src:e,tokens:B,env:N,lineCount:U,lastSegment:void 0,globalStateReason:Ts(e)},this.updateCacheLineCount(this.cache,U),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",yo(N,{area:"stream",path:"stream-full",reason:"small-non-append",unbounded:!!_r(N)?.unbounded}),B}const u=this.getAppendedSegment(s.src,e,i);if(u&&!this.shouldPreferTailReparseForAppend(s)){const N=s.lineCount??so(s.src);let D=3;u.length>5e3?D=8:u.length>1e3?D=6:u.length>200&&(D=4),D=Math.min(D,N);let B=null;const U=n.options?.streamContextParseStrategy??"chars",H=n.options?.streamContextParseMinChars??200,P=n.options?.streamContextParseMinLines??2;let Z;const K=()=>(Z===void 0&&(Z=so(u)),Z),V=this.canDirectlyParseAppend(s),X=V&&this.shouldUseUnboundedAppend(e,s,u);let he=!1;if(!V)switch(U){case"lines":he=K()>=P;break;case"constructs":if(u.length>=H){he=!0;break}if(hV(u)){he=!0;break}he=K()>=P;break;case"chars":default:he=u.length>=H}if(D>0&&he){const de=this.getTailLines(s.src,D)+u;try{const Ce=this.core.parse(de,s.env,n).tokens,Ie=Ce.findIndex(le=>le.map&&typeof le.map[1]=="number"&&le.map[1]>D);if(Ie!==-1){const le=Ce.slice(Ie),z=N-D;z!==0&&this.shiftTokenLines(le,z),B={tokens:le}}}catch{B=null}}else B=null;if(!B){const de=N;if(X)B={tokens:nd(n,u,s.env,{mode:"stream"})},de>0&&this.shiftTokenLines(B.tokens,de);else{const Ce=this.core.parse(u,s.env,n);de>0&&this.shiftTokenLines(Ce.tokens,de),B=Ce}}let ne=0;if(s.tokens.length>0&&B.tokens.length>0){const de=s.tokens[s.tokens.length-1],Ce=B.tokens[0];try{de.type==="inline"&&Ce.type==="inline"&&(Ce.children&&Ce.children.length>0&&(de.children||(de.children=[]),this.appendTokens(de.children,Ce.children)),de.content=(de.content||"")+(Ce.content||""),ne=1)}catch{ne=0}}const ue=s.tokens.length;if(B.tokens.length>ne){const de=s.tokens,Ce=B.tokens,Ie=Math.min(de.length,Ce.length-ne);let le=0;for(let z=Ie;z>0;z--){let ae=!0;for(let ie=0;ie<z;ie++){const q=de[de.length-z+ie],ee=Ce[ne+ie];if(!N6(q,ee)){ae=!1;break}}if(ae){le=z;break}}le>0&&(ne+=le),Ce.length>ne&&this.appendTokens(s.tokens,Ce,ne)}if(s.src=e,s.globalStateReason=null,s.lineCount=N+(Z??K()),s.tokens.length>ue){const de=this.getLastSegment(s.tokens,e,ue,s.tokens.length,e.length-u.length,N);de?s.lastSegment=de:s.lastSegment=void 0}else s.lastSegment=void 0;return this.stats.total+=1,this.stats.appendHits+=1,X&&(this.stats.unboundedAppendHits=(this.stats.unboundedAppendHits||0)+1),this.stats.lastMode="append",yo(s.env,{area:"stream",path:X?"stream-unbounded-append":"stream-append",reason:X?"large-delta":"safe-append",unbounded:X}),s.tokens}const d=o??s.env,f=this.tryTailSegmentReparse(e,s,d,n);if(f)return this.stats.total+=1,this.stats.tailHits+=1,this.stats.lastMode="tail",yo(d,{area:"stream",path:"stream-tail",reason:"tail-reparse"}),f;const h=!!n.__explicitStreamChunkFallbackSetting,p=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,g=!!n.options?.streamChunkedFallback,b=!h&&!u&&p,v=g||b,m=n.options?.streamChunkAdaptive!==!1,y=n.options?.streamChunkTargetChunks??8,k=n.options?.streamChunkSizeChars,A=n.options?.streamChunkSizeLines,$=n.options?.streamChunkMaxChunks,I=!!n.__explicitStreamChunkConfig,x=n.options?.autoTuneChunks!==!1,L=n.options?.streamChunkFenceAware??!0;let E=u&&s.lineCount!==void 0?s.lineCount+so(u):void 0;if(v){E===void 0&&(E=so(e));const N=(K,V,X)=>K<V?V:K>X?X:K,D=x&&!I?r_(e.length,E,n.options):null,B=D?.maxChunkChars??(m?N(Math.ceil(e.length/y),8e3,64e3):k??1e4),U=D?.maxChunkLines??(m?N(Math.ceil(E/y),150,700):A??200),H=D?.maxChunks??(m?N(Math.ceil(e.length/64e3),y,32):$),P=e.length>0&&e.charCodeAt(e.length-1)===10,Z=b&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&D?.strategy!=="plain";if((g||Z)&&(e.length>=B*2||E>=U*2)&&P){const K=gp(n,e,d,{maxChunkChars:B,maxChunkLines:U,fenceAware:D?.fenceAware??L,maxChunks:H});return this.cache={src:e,tokens:K,env:d,lineCount:E,lastSegment:void 0,globalStateReason:Ts(e)},this.updateCacheLineCount(this.cache,E),this.recordChunkedParseResult(d,g?"explicit-fallback-large-doc":"default-fallback-large-doc"),K}}const F=this.parseFullDocument(e,d,n,E),S=F.tokens;return E=F.lineCount,this.cache={src:e,tokens:S,env:d,lineCount:E,lastSegment:void 0,globalStateReason:Ts(e)},this.updateCacheLineCount(this.cache,E),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",yo(d,{area:"stream",path:"stream-full",reason:"fallback-full",unbounded:!!_r(d)?.unbounded}),S}recordChunkedParseResult(e,t){const n=_r(e)?.chunk,o=n?.fallback?String(n.fallbackReason||"global-state"):null;if(this.stats.total+=1,o){this.stats.fullParses+=1,this.stats.lastMode="full",yo(e,{area:"stream",path:"stream-full",reason:`global-state:${o}`,unbounded:!!_r(e)?.unbounded});return}this.stats.chunkedParses=(this.stats.chunkedParses||0)+1,this.stats.lastMode="chunked",yo(e,{area:"stream",path:"stream-chunked",chunked:!0,reason:t})}parseFullDocument(e,t,n,o,s=!0){const i=Ts(e);Yd(t)&&zr(t);const r=typeof n.__canUseImplicitLargeInputStrategy!="function"||n.__canUseImplicitLargeInputStrategy()?A6(n,e.length,o):"no";if(r==="yes"){const a=nd(n,e,t);return yo(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-char-threshold",unbounded:!0}),{tokens:a,lineCount:o??(s?so(e):0)}}let l=o;if(r==="need-lines"&&(l=so(e),C6(n,e.length,l))){const a=nd(n,e,t);return yo(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-line-threshold",unbounded:!0}),{tokens:a,lineCount:l}}return l===void 0&&(l=s?so(e):0),{tokens:Pc(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:so(n)>=this.MIN_UNBOUNDED_APPEND_LINES}getAppendedSegment(e,t,n){if(n===null||n===void 0&&!t.startsWith(e)||!e.endsWith(`
156
+ `))return null;const o=n??t.slice(e.length);if(!o)return null;const s=o.length;if(o.charCodeAt(s-1)!==10)return null;let i=0,r=-1;for(let a=0;a<s&&!(o.charCodeAt(a)===10&&(r===-1&&(r=a),i++,i>=2));a++);if(i<2)return null;const l=(r===-1?o:o.slice(0,r)).trim();if(l.length===0)return null;if(/^[-=]+$/.test(l)){const a=e.slice(0,-1),c=a.lastIndexOf(`
157
+ `);if(a.slice(c+1).trim().length>0)return null}return this.endsInsideOpenFence(e)||this.mayContainReferenceDefinition(o)?null:o}tryTailSegmentReparse(e,t,n,o){const s=this.ensureLastSegment(t);if(!s||s.srcOffset<=0&&s.tokenStart<=0)return null;const i=t.src.slice(0,s.srcOffset);if(!e.startsWith(i))return null;const r=t.src.slice(s.srcOffset),l=e.slice(s.srcOffset);if(l===r)return null;const a=e.startsWith(t.src)?e.slice(t.src.length):null;if(a){const c=this.tryContainerTailAppendMerge(e,t,n,o,s,a);if(c)return c}if(this.mayContainReferenceDefinition(r)||this.mayContainReferenceDefinition(l))return null;try{const c=this.core.parse(l,n,o),u=this.getLastSegment(c.tokens,l);return s.lineStart>0&&this.shiftTokenLines(c.tokens,s.lineStart),t.src=e,t.env=n,t.globalStateReason=null,t.globalStateCarry=void 0,t.tokens.length=s.tokenStart,this.appendTokens(t.tokens,c.tokens),t.lineCount=s.lineStart+so(l),u?t.lastSegment={tokenStart:s.tokenStart+u.tokenStart,tokenEnd:s.tokenStart+u.tokenEnd,lineStart:s.lineStart+u.lineStart,lineEnd:s.lineStart+u.lineEnd,srcOffset:s.srcOffset+u.srcOffset}:t.lastSegment=null,t.tokens}catch{return null}}getTailLines(e,t){if(t<=0)return"";let n=t;for(let o=e.length-1;o>=0;o--)if(e.charCodeAt(o)===10&&(n--,n===0))return e.slice(o+1);return e}endsInsideOpenFence(e){const n=e.length>4e3?e.length-4e3:0,o=e.slice(n),s=o.length;let i=null,r=0;for(;r<=s;){let l=o.indexOf(`
158
+ `,r);l===-1&&(l=s);let a=r;for(;a<l;){const c=o.charCodeAt(a);if(c===32||c===9)a++;else break}if(a<l){const c=o.charCodeAt(a);if(c===96||c===126){let u=a;for(;u<l&&o.charCodeAt(u)===c;)u++;const d=u-a;d>=3&&(i?i.marker===c&&d>=i.length&&(i=null):i={marker:c,length:d})}}if(l===s)break;r=l+1}return i!==null}peek(){return this.cache?.tokens??fV}getStats(){return{...this.stats}}appendTokens(e,t,n=0,o=t.length){for(let s=n;s<o;s++)e.push(t[s])}updateCacheLineCount(e,t){e.lineCount=t??so(e.src),e.lastSegment=void 0,e.globalStateCarry=void 0}detectGlobalStateForAppend(e,t){if(e.globalStateReason)return e.globalStateReason;const n=(e.globalStateCarry??e.src.slice(-_0))+t,o=Ts(n);return e.globalStateCarry=n.length>_0?n.slice(n.length-_0):n,o&&(e.globalStateReason=o),o}ensureLastSegment(e){return e.lastSegment!==void 0||(e.lastSegment=this.getLastSegment(e.tokens,e.src)),e.lastSegment}getLastSegment(e,t,n=0,o=e.length,s,i){if(o<=n)return null;let r=Number.POSITIVE_INFINITY,l=-1,a=0;for(let c=o-1;c>=n;c--){const u=e[c];if(u.map&&(u.map[0]<r&&(r=u.map[0]),u.map[1]>l&&(l=u.map[1])),u.nesting<0){a+=-u.nesting;continue}if(u.nesting>0){if(a-=u.nesting,u.level===0&&a<=0){const d=Number.isFinite(r)?r:u.map?.[0]??0,f=l>=d?l:u.map?.[1]??d;return{tokenStart:c,tokenEnd:o,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,s,i)}}continue}if(u.level===0&&a===0){const d=Number.isFinite(r)?r:u.map?.[0]??0,f=l>=d?l:u.map?.[1]??d;return{tokenStart:c,tokenEnd:o,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,s,i)}}}return null}getLineStartOffset(e,t,n,o){if(n!==void 0&&o!==void 0&&t>=o)return this.getLineStartOffsetFrom(e,n,t-o);if(t<=0)return 0;let s=t,i=-1;for(;s>0;){if(i=e.indexOf(`
159
+ `,i+1),i===-1)return e.length;s--}return i+1}getLineStartOffsetFrom(e,t,n){if(n<=0)return t;let o=n,s=t-1;for(;o>0;){if(s=e.indexOf(`
160
+ `,s+1),s===-1)return e.length;o--}return s+1}mayContainReferenceDefinition(e){return e.includes("]:")?/(?:^|\n)[ \t]{0,3}\[[^\]\n]+\]:/.test(e):!1}canDirectlyParseAppend(e){if(!this.endsWithBlankLine(e.src))return!1;const t=this.ensureLastSegment(e);if(!t)return!1;switch(e.tokens[t.tokenStart]?.type){case"paragraph_open":case"heading_open":case"fence":case"code_block":case"html_block":case"hr":case"table_open":return!0;default:return!1}}tryContainerTailAppendMerge(e,t,n,o,s,i){if(!i||this.mayContainReferenceDefinition(i))return null;const r=t.tokens[s.tokenStart];switch(r?.type){case"bullet_list_open":case"ordered_list_open":return this.tryListTailAppendMerge(e,t,n,o,s,i,r);case"table_open":return this.tryTableTailAppendMerge(e,t,n,o,s,i,r);default:return null}}tryListTailAppendMerge(e,t,n,o,s,i,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10)return null;const l=s.lineEnd-s.lineStart,a=t.src.length-s.srcOffset;if(l<this.MIN_LIST_LINES_FOR_MERGE&&a<this.MIN_LIST_CHARS_FOR_MERGE)return null;const c=r.type==="bullet_list_open"?"bullet_list_close":"ordered_list_close";let u;try{u=this.core.parse(i,n,o).tokens}catch{return null}if(!this.isSingleTopLevelContainer(u,r.type,c,r.markup))return null;const d=u.slice(1,-1);if(d.length===0)return null;const f=t.lineCount??so(t.src);f>0&&this.shiftTokenLines(d,f);const h=this.getListParagraphMode(t.tokens,s.tokenStart,t.tokens.length,r.level),p=this.getListParagraphMode(u,0,u.length,0);(h==="loose"||p==="loose"||this.endsWithBlankLine(t.src)||(u[0]?.map?.[0]??0)>0)&&(this.setListParagraphVisibility(t.tokens,s.tokenStart,t.tokens.length,r.level,!1),this.setListParagraphVisibility(d,0,d.length,r.level,!1)),t.tokens.splice(t.tokens.length-1,0,...d),t.src=e,t.env=n,t.globalStateReason=null;const g=f+so(i);t.lineCount=g;const b=this.getDocLineCount(e,g);return r.map&&(r.map[1]=b),t.lastSegment={tokenStart:s.tokenStart,tokenEnd:t.tokens.length,lineStart:s.lineStart,lineEnd:b,srcOffset:s.srcOffset},t.tokens}tryTableTailAppendMerge(e,t,n,o,s,i,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10||/(?:^|\n)[ \t]*\n/.test(i))return null;const l=s.lineEnd-s.lineStart,a=t.src.length-s.srcOffset;if(l<this.MIN_TABLE_LINES_FOR_MERGE&&a<this.MIN_TABLE_CHARS_FOR_MERGE)return null;const c=this.getTableHeaderContext(t.src.slice(s.srcOffset));if(!c)return null;const u=`${c}${i}`;let d;try{d=this.core.parse(u,n,o).tokens}catch{return null}if(!this.isSingleTopLevelContainer(d,"table_open","table_close")||(d[0]?.map?.[1]??-1)!==this.getDocLineCount(u))return null;const f=this.getTableBodySection(d,0,d.length,0),h=this.getTableBodySection(t.tokens,s.tokenStart,t.tokens.length,r.level);if(!f||!h||f.tbodyOpenIndex<0||f.tbodyCloseIndex<0)return null;const p=h.tbodyOpenIndex>=0?d.slice(f.tbodyOpenIndex+1,f.tbodyCloseIndex):d.slice(f.tbodyOpenIndex,f.tbodyCloseIndex+1);if(p.length===0)return null;const g=s.lineEnd-2;g!==0&&this.shiftTokenLines(p,g);const b=h.tbodyCloseIndex>=0?h.tbodyCloseIndex:h.tableCloseIndex,v=t.lineCount??so(t.src);t.tokens.splice(b,0,...p),t.src=e,t.env=n,t.globalStateReason=null;const m=v+so(i);t.lineCount=m;const y=this.getDocLineCount(e,m);if(r.map&&(r.map[1]=y),h.tbodyOpenIndex>=0){const k=t.tokens[h.tbodyOpenIndex];k?.map&&(k.map[1]=y)}return t.lastSegment={tokenStart:s.tokenStart,tokenEnd:t.tokens.length,lineStart:s.lineStart,lineEnd:y,srcOffset:s.srcOffset},t.tokens}getTableHeaderContext(e){const t=e.indexOf(`
161
+ `);if(t<0)return null;const n=e.indexOf(`
162
+ `,t+1);return n<0?null:e.slice(0,n+1)}getTableBodySection(e,t,n,o){if(t<0||t>=n||e[t]?.type!=="table_open")return null;let s=-1;for(let l=n-1;l>t;l--){const a=e[l];if(a.type==="table_close"&&a.level===o){s=l;break}}if(s<0)return null;let i=-1,r=-1;for(let l=t+1;l<s;l++){const a=e[l];if(a.type==="tbody_open"&&a.level===o+1){i=l;break}}if(i>=0){for(let l=s-1;l>i;l--){const a=e[l];if(a.type==="tbody_close"&&a.level===o+1){r=l;break}}if(r<0)return null}return{tableCloseIndex:s,tbodyOpenIndex:i,tbodyCloseIndex:r}}isSingleTopLevelContainer(e,t,n,o){if(e.length<2)return!1;const s=e[0],i=e[e.length-1];if(s.type!==t||i.type!==n||s.level!==0||i.level!==0||o!==void 0&&s.markup!==o)return!1;let r=0;for(let l=0;l<e.length;l++){const a=e[l];if(a.level===0&&l>0&&l<e.length-1&&r===0)return!1;(a.nesting>0||a.nesting<0)&&(r+=a.nesting)}return r===0}getListParagraphMode(e,t,n,o){let s=!1,i=!1;const r=o+2;for(let l=t;l<n;l++){const a=e[l];if(!(a.type!=="paragraph_open"||a.level!==r)&&(a.hidden?s=!0:i=!0,s&&i))return"loose"}return i?"loose":s?"tight":"none"}setListParagraphVisibility(e,t,n,o,s){const i=o+2;for(let r=t;r<n;r++){const l=e[r];(l.type==="paragraph_open"||l.type==="paragraph_close")&&l.level===i&&(l.hidden=s)}}shouldPreferTailReparseForAppend(e){const t=this.ensureLastSegment(e);if(!t)return!1;switch(e.tokens[t.tokenStart]?.type){case"bullet_list_open":case"ordered_list_open":case"blockquote_open":case"table_open":return!0;case"paragraph_open":case"code_block":case"html_block":return!this.endsWithBlankLine(e.src);default:return!1}}endsWithBlankLine(e){const t=e.length;if(t<2||e.charCodeAt(t-1)!==10)return!1;let n=t-2;for(;n>=0;){const o=e.charCodeAt(n);if(o===32||o===9){n--;continue}return o===10}return!0}getDocLineCount(e,t=so(e)){return e.length===0?0:e.charCodeAt(e.length-1)===10?t:t+1}shiftTokenLines(e,t){if(t===0)return;let n=null;for(let o=0;o<e.length;o++){const s=e[o];if(s.map&&(s.map[0]+=t,s.map[1]+=t),s.children){n??=[];for(let i=s.children.length-1;i>=0;i--)n.push(s.children[i]);for(;n.length>0;){const i=n.pop();if(i.map&&(i.map[0]+=t,i.map[1]+=t),i.children)for(let r=i.children.length-1;r>=0;r--)n.push(i.children[r])}}}}};const f_={default:iV,zero:rV,commonmark:sV};function vV(e){return{core:e.core.ruler.version,block:e.block.ruler.version,inline:e.inline.ruler.version,inline2:e.inline.ruler2.version}}function yV(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 h_(e){return e.experimental?{...e,...e.experimental}:e}function ui(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 p_(e,t,n){for(let o=0;o<n.length;o++){const s=n[o];if(ui(t,s)||ui(e,s))return!0}return!1}function m_(e,t,n){return ui(t,n)||ui(e,n)}function g_(e,t){const n=_r(e)?.chunk;if(n?.fallback){yo(e,{area:"parse",path:"plain",reason:`global-state:${n.fallbackReason||"unknown"}`});return}yo(e,{area:"parse",path:"full-chunk",chunked:!0,reason:t})}function kV(e,t){let n={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100,stream:!1,streamOptimizationMinSize:1e3,streamChunkedFallback:!1,streamChunkSizeChars:1e4,streamChunkSizeLines:200,streamChunkFenceAware:!0,streamChunkAdaptive:!0,streamChunkTargetChunks:8,streamChunkMaxChunks:void 0,streamLargeCachePolicy:"retain",streamSkipCacheAboveChars:1e6,streamSkipCacheAboveLines:1e5,fullChunkedFallback:!1,fullChunkThresholdChars:2e4,fullChunkThresholdLines:400,fullChunkSizeChars:1e4,fullChunkSizeLines:200,fullChunkFenceAware:!0,fullChunkAdaptive:!0,fullChunkTargetChunks:8,fullChunkMaxChunks:void 0,autoTuneChunks:!0,autoUnbounded:!0,autoUnboundedThresholdChars:4e6,autoUnboundedThresholdLines:8e4},o="default",s;!t&&typeof e!="string"?(s=e,o="default"):typeof e=="string"&&(o=e,s=t);const i=f_[o];if(!i)throw new Error(`Wrong \`markdown-it\` preset "${o}", check name`);if(i?.options&&(n={...n,...i.options}),s&&(n={...n,...s}),n=h_(n),typeof n.quotes=="string"){const x=n.quotes;x.length>=4?n.quotes=[x[0],x[1],x[2],x[3]]:n.quotes=["“","”","‘","’"]}let r=p_(i?.options,s,["fullChunkSizeChars","fullChunkSizeLines","fullChunkMaxChunks"]),l=p_(i?.options,s,["streamChunkSizeChars","streamChunkSizeLines","streamChunkMaxChunks"]),a=m_(i?.options,s,"fullChunkedFallback"),c=m_(i?.options,s,"streamChunkedFallback"),u=!1,d=null,f=null;const h=new cj;let p=null;const g=()=>(p||(p=new dV(n)),p);let b=null;const v=()=>(b||(b=new gV(h)),b);let m=null;const y=()=>(m||(m=new GA),m),k=x=>!u&&!!d&&!yV(x,d),A=(x,L)=>o==="default"&&!u&&p===null&&f!==null&&x.parse===f&&k(x)&&!x.stream.enabled&&L<(x.options.autoUnboundedThresholdChars??4e6)&&x.options.html===!1&&x.options.xhtmlOut===!1&&x.options.breaks===!1&&x.options.langPrefix==="language-"&&x.options.linkify===!1&&x.options.typographer===!1&&x.options.highlight===null,$=(x,L)=>o==="default"&&!u&&k(x)&&!x.stream.enabled&&!x.options.fullChunkedFallback&&L<(x.options.autoUnboundedThresholdChars??4e6)&&x.options.html===!1&&x.options.linkify===!1&&x.options.typographer===!1,I={core:h,block:h.block,inline:h.inline,get linkify(){const x=y();return Object.defineProperty(this,"linkify",{value:x,writable:!0,configurable:!0}),x},get renderer(){const x=g();return Object.defineProperty(this,"renderer",{value:x,writable:!0,configurable:!0}),x},options:n,__explicitFullChunkConfig:r,__explicitStreamChunkConfig:l,__explicitFullChunkFallbackSetting:a,__explicitStreamChunkFallbackSetting:c,__canUseImplicitLargeInputStrategy(){return k(this)},set(x){const L=h_(x);return this.options={...this.options,...L},(ui(x,"fullChunkSizeChars")||ui(x,"fullChunkSizeLines")||ui(x,"fullChunkMaxChunks"))&&(r=!0,this.__explicitFullChunkConfig=!0),(ui(x,"streamChunkSizeChars")||ui(x,"streamChunkSizeLines")||ui(x,"streamChunkMaxChunks"))&&(l=!0,this.__explicitStreamChunkConfig=!0),ui(x,"fullChunkedFallback")&&(a=!0,this.__explicitFullChunkFallbackSetting=!0),ui(x,"streamChunkedFallback")&&(c=!0,this.__explicitStreamChunkFallbackSetting=!0),p&&p.set(L),typeof L.stream=="boolean"&&(this.stream.enabled=L.stream,b&&(b.reset(),b.resetStats())),this},configure(x){const L=typeof x=="string"?f_[x]:x;if(!L)throw new Error("Wrong `markdown-it` preset, can't be empty");if(L.options&&this.set(L.options),L.components){const E=L.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(x,L){const E=Array.isArray(x)?x:[x],F=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],S=new Set;for(const N of F){if(!N)continue;const D=N.enable(E,!0);for(let B=0;B<D.length;B++)S.add(D[B])}if(!L){const N=E.filter(D=>!S.has(D));if(N.length)throw new Error(`Rules manager: invalid rule name ${N.join(", ")}`)}return this},disable(x,L){const E=Array.isArray(x)?x:[x],F=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],S=new Set;for(const N of F){if(!N)continue;const D=N.disable(E,!0);for(let B=0;B<D.length;B++)S.add(D[B])}if(!L){const N=E.filter(D=>!S.has(D));if(N.length)throw new Error(`Rules manager: invalid rule name ${N.join(", ")}`)}return this},use(x,...L){const E=typeof x=="function"?x:x&&typeof x.default=="function"?x.default:void 0;if(!E)throw new TypeError("MarkdownIt.use: plugin must be a function");const F=[this,...L],S=x;return u=!0,E.apply(S,F),this},render(x,L){if(A(this,x.length)){L!==void 0&&us(L);const S=o_(x);if(S!==null)return L!==void 0&&yo(L,{area:"render",path:"stock-fast",reason:"stock-subset"}),S}const E=L??{},F=this.parse(x,E);return g().render(F,this.options,E)},async renderAsync(x,L){if(A(this,x.length)){L!==void 0&&us(L);const S=o_(x);if(S!==null)return L!==void 0&&yo(L,{area:"render",path:"stock-fast",reason:"stock-subset"}),S}const E=L??{},F=this.parse(x,E);return g().renderAsync(F,this.options,E)},renderIterable(x,L={}){const E=this.parseIterable(x,L);return g().render(E,this.options,L)},async renderAsyncIterable(x,L={}){const E=await this.parseAsyncIterable(x,L);return g().renderAsync(E,this.options,L)},renderInline(x,L={}){const E=this.parseInline(x,L);return g().render(E,this.options,L)},validateLink:f6,normalizeLink:h6,normalizeLinkText:p6,utils:Tz,helpers:{...vU},parse(x,L){if(typeof x!="string")throw new TypeError("Input data should be a String");if(L!==void 0&&us(L),$(this,x.length)){const N=xj(x);if(N!==null)return L!==void 0&&yo(L,{area:"parse",path:"stock-fast",reason:"stock-subset"}),N}const E=L??{};let F;if(!this.stream.enabled&&!this.options.fullChunkedFallback&&k(this)){const N=A6(this,x.length);if(N==="yes"){const D=nd(this,x,E);return yo(L,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"char-threshold"}),D}N==="need-lines"&&(F=so(x))}if(!this.stream.enabled){const N=x.length,D=this.options.autoTuneChunks!==!1,B=r,U=!a&&k(this),H=!!this.options.fullChunkedFallback,P=U&&N>=2e5;let Z;(H||P||F!==void 0)&&(Z=F??so(x));const K=(H||P)&&D&&!B?oV(N,Z,this.options):null;if(H||P){const V=Z??0;if(H?N>=(this.options.fullChunkThresholdChars??2e4)||V>=(this.options.fullChunkThresholdLines??400):P){if(K&&K.strategy!=="plain"){const X=gp(this,x,E,{maxChunkChars:K.maxChunkChars,maxChunkLines:K.maxChunkLines,fenceAware:K.fenceAware,maxChunks:K.maxChunks});return L&&g_(L,H?"explicit-full-chunk":"default-large-string"),X}if(H){const X=(ae,ie,q)=>ae<ie?ie:ae>q?q:ae,he=this.options.fullChunkAdaptive!==!1,ne=this.options.fullChunkTargetChunks??8,ue=X(Math.ceil(N/ne),8e3,64e3),de=X(Math.ceil(V/ne),150,700),Ce=he?ue:this.options.fullChunkSizeChars??1e4,Ie=he?de:this.options.fullChunkSizeLines??200,le=he?X(Math.ceil(N/64e3),ne,32):this.options.fullChunkMaxChunks,z=gp(this,x,E,{maxChunkChars:Ce,maxChunkLines:Ie,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:le});return L&&g_(L,"explicit-full-chunk"),z}}}if(F!==void 0&&k(this)&&C6(this,N,Z??F)){const V=nd(this,x,E);return yo(L,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"line-threshold"}),V}}const S=Ts(x);return yo(L,{area:"parse",path:"plain",reason:"default-plain"}),Pc(E,S,()=>h.parse(x,E,this).tokens)},parseIterable(x,L={}){return us(L),Jj(this,x,L)},parseAsyncIterable(x,L={}){return us(L),eV(this,x,L)},parseIterableToSink(x,L,E={}){return us(E),tV(this,x,L,E)},parseAsyncIterableToSink(x,L,E={}){return us(E),nV(this,x,L,E)},parseInline(x,L={}){if(typeof x!="string")throw new TypeError("Input data should be a String");us(L),Yd(L)&&zr(L);const E=h.createState(x,L,this);return E.inlineMode=!0,h.process(E),E.tokens}};if(I.stream={enabled:!!n.stream,parse(x,L){return I.stream.enabled?v().parse(x,L,I):I.parse(x,L??{})},reset(){v().reset()},peek(){return b?b.peek():[]},stats(){return b?b.getStats():{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}},resetStats(){b&&b.resetStats()}},i?.components){const x=i.components;x.core?.rules&&I.core.ruler.enableOnly(x.core.rules),x.block?.rules&&I.block.ruler.enableOnly(x.block.rules),x.inline?.rules&&I.inline.ruler.enableOnly(x.inline.rules),x.inline2?.rules&&I.inline.ruler2.enableOnly(x.inline2.rules)}return d=vV(I),f=I.parse,I}var bV=kV;const I6=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],xV=["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"],L6=["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"],wV=["svg","g","path"],_V=["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"],SV=["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"],CV=["action","data","href","src","srcset","poster","xlink:href","formaction"],AV=["script"],MV=["pre","iframe","script","style","table","tbody","td","tfoot","th","thead","textarea","tr","title","video"],Ha=new Set(I6),EV=new Set(L6),$d=new Set([...I6,...xV,...L6,...wV]),$6=new Set([...$d,..._V]),TV=new Set(SV),NV=new Set(CV),Qd=new Set(AV),F6=new Set(MV);function O6(e){let t="";for(const n of e){const o=n.charCodeAt(0);o<=31||o>=127&&o<=159||/\s/u.test(n)||(t+=n)}return t}const IV={amp:"&",bsol:"\\",colon:":",newline:`
163
+ `,sol:"/",tab:" "};function R6(e){return e.replace(/&(?:#(\d+)|#x([0-9a-f]+)|([a-z][a-z0-9]+));?/gi,(t,n,o,s)=>{const i=n??o;if(i){const r=Number.parseInt(i,n?10:16);try{return Number.isFinite(r)?String.fromCodePoint(r):""}catch{return""}}return IV[String(s??"").toLowerCase()]??t})}const Zf=new Set(["http","https","mailto","tel"]),LV=new Set(["javascript","vbscript","data","file","ftp","blob","filesystem","intent","chrome","chrome-extension","moz-extension","ms-browser-extension","view-source"]),sa=new Set(["http","https"]);function B6(e){return e.match(/^([a-z][a-z0-9+.-]*):/i)?.[1]?.toLowerCase()??""}function $V(e,t,n){if(!id(t,n)||!e.startsWith("file:///"))return!1;const o=e.charAt(8);return o!=="/"&&o!=="\\"}function id(e,t){return e?(e==="a"||e==="area")&&(!t||t==="href"||t==="xlink:href"):!t||t==="href"}function FV(e,t){return t==="href"||t==="xlink:href"?id(e,t)?Zf:sa:t==="src"||t==="srcset"||t==="poster"||t==="action"||t==="formaction"||t==="data"?sa:(id(e,t),Zf)}function Ca(e,t={}){const n=O6(R6(e)).toLowerCase(),o=String(t.tagName??"").toLowerCase(),s=String(t.attrName??"").toLowerCase();if(!n)return!1;if(n.startsWith("data:")){const r=/^data:image\/(?:png|gif|jpe?g|webp|avif|bmp);/i.test(n);return o==="img"&&s==="src"?!r:!0}if(/^[\\/]{2}/.test(n))return!0;if(n.startsWith("/")||n.startsWith("./")||n.startsWith("../")||n.startsWith("#")||n.startsWith("?"))return!1;const i=B6(n);return i?i==="file"?!$V(n,o,s):id(o,s)?LV.has(i):!FV(o,s).has(i):!1}function OV(e){const t=R6(String(e??"")).trim();if(!t||t.startsWith("#")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("?"))return!1;const n=B6(O6(t).toLowerCase());return n==="http"||n==="https"}function RV(e,t={}){const n=String(e??"").trim();return n?Ca(n,t)?"":n:""}function v_(e){return RV(e,{tagName:"img",attrName:"src"})}function BV(e,t,n){function o(f){return f.trim().split(" ",2)[0]===t}function s(f,h,p,g,b){return f[h].nesting===1&&f[h].attrJoin("class",t),b.renderToken(f,h,p,g,b)}n=n||{};const i=3,r=n.marker||":",l=r.charCodeAt(0),a=r.length,c=n.validate||o,u=n.render||s;function d(f,h,p,g){let b,v=!1,m=f.bMarks[h]+f.tShift[h],y=f.eMarks[h];if(l!==f.src.charCodeAt(m))return!1;for(b=m+1;b<=y&&r[(b-m)%a]===f.src[b];b++);const k=Math.floor((b-m)/a);if(k<i)return!1;b-=(b-m)%a;const A=f.src.slice(m,b),$=f.src.slice(b,y);if(!c($,A))return!1;if(g)return!0;let I=h;for(;I++,!(I>=p||(m=f.bMarks[I]+f.tShift[I],y=f.eMarks[I],m<y&&f.sCount[I]<f.blkIndent));)if(l===f.src.charCodeAt(m)&&!(f.sCount[I]-f.blkIndent>=4)){for(b=m+1;b<=y&&r[(b-m)%a]===f.src[b];b++);if(!(Math.floor((b-m)/a)<k)&&(b-=(b-m)%a,b=f.skipSpaces(b),!(b<y))){v=!0;break}}const x=f.parentType,L=f.lineMax;f.parentType="container",f.lineMax=I;const E=f.push("container_"+t+"_open","div",1);E.markup=A,E.block=!0,E.info=$,E.map=[h,I],f.md.block.tokenize(f,h+1,I);const F=f.push("container_"+t+"_close","div",-1);return F.markup=f.src.slice(m,b),F.block=!0,f.parentType=x,f.lineMax=L,f.line=I+(v?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 DV(e){const t=String(e??"").trim();if(!t.startsWith("{")||!t.endsWith("}"))return null;const n=t.slice(1,-1).trim();if(!n)return{};if(n.includes("{")||n.includes("[")||n.includes("]"))return null;const o=[];let s="",i=!1,r=!1;for(let a=0;a<n.length;a++){const c=n[a];if(c==="\\"){s+=c,a+1<n.length&&(s+=n[a+1],a++);continue}if(!r&&c==="'"){i=!i,s+=c;continue}if(!i&&c==='"'){r=!r,s+=c;continue}if(!i&&!r&&c===","){o.push(s.trim()),s="";continue}s+=c}s.trim()&&o.push(s.trim());const l={};for(const a of o){if(!a)continue;let c=!1,u=!1,d=-1;for(let b=0;b<a.length;b++){const v=a[b];if(v==="\\"){b++;continue}if(!u&&v==="'"){c=!c;continue}if(!c&&v==='"'){u=!u;continue}if(!c&&!u&&v===":"){d=b;break}}if(d===-1)return null;const f=a.slice(0,d).trim(),h=a.slice(d+1).trim();if(!f)return null;let p=f;if(p.startsWith('"')&&p.endsWith('"')||p.startsWith("'")&&p.endsWith("'"))try{p=JSON.parse(p.replace(/^'/,'"').replace(/'$/,'"'))}catch{return null}if(!/^[_$A-Z][\w$-]*$/i.test(p))return null;let g;if(!h)g="";else if(h.startsWith('"')&&h.endsWith('"')||h.startsWith("'")&&h.endsWith("'"))try{g=JSON.parse(h.replace(/^'/,'"').replace(/'$/,'"'))}catch{g=h}else/^-?\d+(?:\.\d+)?$/.test(h)?g=Number(h):h==="true"||h==="false"?g=h==="true":h==="null"?g=null:g=h;l[p]=g}return l}function PV(e){["admonition","info","warning","error","tip","danger","note","caution"].forEach(t=>{e.use(BV,t,{render(n,o){return n[o].nesting===1?`<div class="vmr-container vmr-container-${t}">`:`</div>
164
+ `}})}),e.block.ruler.before("fence","vmr_container_fallback",(t,n,o,s)=>{const i=t,r=i.bMarks[n]+i.tShift[n],l=i.eMarks[n],a=i.src.slice(r,l),c=a.match(/^:::\s*([^\s{]+)/);if(!c)return!1;const u=c[1];if(!u.trim())return!1;const d=a.slice(c[0].length).trim();let f,h;const p=d.indexOf("{"),g=p>=0?d.slice(p).trimStart():void 0;if(p===-1)f=d||void 0;else{if(f=d.slice(0,p).trim()||void 0,g?.startsWith("{")){let A=0,$=-1;for(let I=0;I<g.length;I++)if(g[I]==="{"?A++:g[I]==="}"&&A--,A===0){$=I+1;break}$>0&&(h=g.slice(0,$))}h||(f=d||void 0)}if(s)return!0;const b=!!i.env.__markstreamFinal;let v=n+1,m=!1;for(;v<=o;){const A=i.bMarks[v]+i.tShift[v],$=i.eMarks[v];if(i.src.slice(A,$).trim()===":::"){m=!0;break}v++}m||(v=o);const y=i.push("vmr_container_open","div",1);if(y.attrSet("class",`vmr-container vmr-container-${u}`),y.meta={...y.meta??{},unclosed:!m&&!b},f&&y.attrSet("data-args",f),h)try{const A=JSON.parse(h);for(const[$,I]of Object.entries(A)){const x=I!=null&&typeof I=="object";y.attrSet(`data-${$}`,x?JSON.stringify(I):String(I))}}catch{const A=DV(h);if(A)for(const[$,I]of Object.entries(A)){const x=I!=null&&typeof I=="object";y.attrSet(`data-${$}`,x?JSON.stringify(I):String(I))}else y.attrSet("data-attrs",h)}const k=[];for(let A=n+1;A<v;A++){const $=i.bMarks[A]+i.tShift[A],I=i.eMarks[A];k.push(i.src.slice($,I))}if(k.some(A=>A.trim().length>0)){let A=k.join(`
165
+ `);A.endsWith(`
166
+ `)||(A+=`
167
+ `),A.endsWith(`
168
+
169
+ `)||(A+=`
170
+ `);const $=i.tokens[i.tokens.length-1];$&&($.raw=A);const I=[];i.md.block.parse(A,i.md,i.env,I),i.tokens.push(...I)}return m&&i.push("vmr_container_close","div",-1),i.line=m?v+1:v,!0},{alt:["paragraph","reference","blockquote","list"]})}function Gs(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Jn(e){let t=!1,n=!1;for(let o=0;o<e.length;o++){const s=e[o];if(s==="\\"){o++;continue}if(!n&&s==="'"){t=!t;continue}if(!t&&s==='"'){n=!n;continue}if(!t&&!n&&s===">")return o}return-1}function Nm(e){const t=[],n=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let o;for(;(o=n.exec(e))!==null;){const s=o[1];if(!s)continue;const i=o[2]||o[3]||o[4]||"";t.push([s,i])}return t}const HV=/^[a-z][a-z0-9_-]*$/;function y_(e){return HV.test(String(e??"").trim().toLowerCase())}function _i(e){const t=String(e??"").trim();if(!t)return"";if(!t.startsWith("<"))return y_(t)?t.toLowerCase():"";let n=1;for(;n<t.length&&/\s/.test(t[n]);)n++;if(t[n]==="/")for(n++;n<t.length&&/\s/.test(t[n]);)n++;const o=n;for(;n<t.length&&/[\w-]/.test(t[n]);)n++;const s=t.slice(o,n).toLowerCase(),i=t[n]??"";return i&&!/[\s/>]/.test(i)?"":y_(s)?s:""}function ru(e){if(!e||e.length===0)return[];const t=new Set,n=[];for(const o of e){const s=_i(o);!s||t.has(s)||(t.add(s),n.push(s))}return n}function WV(...e){const t=new Set,n=[];for(const o of e)for(const s of ru(o))t.has(s)||(t.add(s),n.push(s));return n}function zV(e){const t=ru(e);return{key:t.join(","),tags:t}}function D6(e){return _i(e)}function UV(e,t){const n=String(e??""),o=_i(t);if(!o)return!1;const s=Gs(o),i=n.match(new RegExp(String.raw`^\s*<\s*${s}(?:\s[^>]*)?(\s*\/)?>`,"i"));return i?i[1]?!0:new RegExp(String.raw`<\s*\/\s*${s}\s*>`,"i").test(n):!1}function P6(e,t){const n=_i(t);return!!n&&!$d.has(n)&&!UV(e,n)}function qV(e,t){const n=String(e??""),o=_i(t);if(!o)return n;const s=Gs(o),i=new RegExp(String.raw`^\s*<\s*${s}(?:\s[^>]*)?>\s*`,"i"),r=new RegExp(String.raw`\s*<\s*\/\s*${s}\s*>\s*$`,"i");return n.replace(i,"").replace(r,"")}const H6=Ha,jV=$d,W6=new Set(EV);W6.delete("details");const VV=/<([A-Z][\w-]*)(?=[\s/>]|$)/gi,KV=/<\/\s*([A-Z][\w-]*)(?=[\s/>]|$)/gi,uv=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,GV=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function kp(e){return(e.match(uv)?.[1]??"").toLowerCase()}function ok(e){return/^\s*<\s*\//.test(e)}function sk(e,t){return H6.has(t)||/\/\s*>\s*$/.test(e)}function YV(e,t){let n=0;for(let o=0;o<e.length;o++){const s=e[o];if(!s||s.type!=="html_inline")continue;const i=String(s.content??""),r=kp(i);if(r===t){if(ok(i)){if(n===0)return o;n--;continue}sk(i,r)||n++}}return-1}function ZV(e,t){let n=0;for(const o of e){if(!o||o.type!=="html_inline")continue;const s=String(o.content??""),i=kp(s);if(i===t){if(ok(s)){n>0&&n--;continue}sk(s,i)||n++}}return n}function k_(e,t,n=0){const o=new RegExp(String.raw`<\s*(\/?)\s*${Gs(t)}(?=[\s>/])[^>]*>`,"gi");o.lastIndex=Math.max(0,n);let s=0,i;for(;(i=o.exec(e))!==null;){const r=i[0]??"",l=!!i[1],a=!l&&/\/\s*>$/.test(r);if(l){if(s===0)return{start:i.index,end:i.index+r.length};s--;continue}a||s++}return null}function QV(e,t){const n=new RegExp(String.raw`<\s*(\/?)\s*${Gs(t)}(?=[\s>/])[^>]*>`,"gi");let o=0,s;for(;(s=n.exec(e))!==null;){const i=s[0]??"",r=!!s[1],l=!r&&/\/\s*>$/.test(i);if(r){o>0&&o--;continue}l||o++}return o}function bp(e){const t=e;return String(t.raw??t.content??t.markup??"")}function XV(e){const t=e;return t.meta||(t.meta={}),t.meta}function S0(e,t,n){const o=XV(e);o.markstreamCustomHtmlRaw=t,o.markstreamCustomHtmlInner=n}function JV(e,t){if(!t.size)return;const n=Array.from(t,h=>new RegExp(String.raw`<\s*${Gs(h)}(?=[\s>/])`,"i")),o=[];let s=!1;const i=h=>h?n.some(p=>p.test(h)):!1,r=h=>{if(!(!h||!o.length))for(const p of o)p.raw+=h,p.inner+=h},l=()=>{!o.length||!s||(r(`
171
+ `),s=!1)},a=h=>{r(h)},c=h=>{for(let g=0;g<o.length;g++)o[g].raw+=h,g<o.length-1&&(o[g].inner+=h);const p=o.pop();S0(p.token,p.raw,p.inner)},u=h=>{const p=o[o.length-1]?.tag;if(!p)return null;const g=new RegExp(String.raw`^\s*<\s*\/\s*${Gs(p)}\s*>`,"i");return h.match(g)?.[0]??null},d=h=>!!u(h),f=(h,p,g)=>{const b=g??(h.type==="html_inline"?kp(p):"");if(!(b&&t.has(b))){r(p);return}const v=ok(p),m=!v&&sk(p,b);if(v){if(!o.length||o[o.length-1].tag!==b){r(p);return}c(p);return}if(r(p),m){S0(h,p,"");return}o.push({tag:b,token:h,raw:p,inner:""})};for(const h of e){if(h.type==="inline"&&Array.isArray(h.children)){const p=String(h.content??"");if(d(p)?s=!1:l(),!o.length&&!i(p)){s=!1;continue}let g=0,b=!0;for(const v of h.children){const m=bp(v),y=v.type==="html_inline"?kp(m):"",k=y&&t.has(y);let A=m;if(b&&p&&m&&(o.length||k)){const $=p.indexOf(m,g);if($!==-1)a(p.slice(g,$)),A=p.slice($,$+m.length),g=$+m.length;else{if(o.length&&!k)continue;b=!1}}f(v,A,y)}b&&p&&g<p.length&&o.length&&a(p.slice(g)),s=o.length>0;continue}if(o.length&&typeof h.content=="string"){const p=bp(h),g=h.type==="html_block"?u(p):null;if(g){c(`${s?`
172
+ `:""}${g}`),s=o.length>0;continue}if(!h.content)continue;l(),r(h.content),s=!0}}for(const h of o)S0(h.token,h.raw,h.inner)}function eK(e){return/^\s*<\s*[!?]/.test(e)}function tK(e){const t=new Set(jV);if(e&&Array.isArray(e))for(const n of e){const o=String(n??"").trim();if(!o)continue;const s=o.match(/^[<\s/]*([A-Z][\w-]*)/i);s&&t.add(s[1].toLowerCase())}return t}function b_(e,t){if(t.has(e))return!0;for(const n of t)if(n.startsWith(e))return!0;return!1}function nK(e,t){let n=null;for(const i of e.matchAll(VV)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();b_(l,t)&&Jn(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!1})}for(const i of e.matchAll(KV)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();b_(l,t)&&Jn(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!0})}const o=/<\/\s*$/.exec(e);if(o&&typeof o.index=="number"){const i=o.index;!e.slice(i).includes(">")&&(!n||i<n.index)&&(n={index:i,tag:"",closing:!0})}const s=/<\s*$/.exec(e);if(s&&typeof s.index=="number"){const i=s.index,r=e.slice(i);!r.startsWith("</")&&!r.includes(">")&&(!n||i<n.index)&&(n={index:i,tag:"",closing:!1})}return n}function oK(e,t){const n=e;return Object.assign(Object.create(Object.getPrototypeOf(n)),n,{type:"text",content:t,raw:t})}function sK(e,t){if(!e.length)return{children:e};const n=[];let o=null,s=null;function i(a,c){a&&(c?n.push(oK(c,a)):n.push({type:"text",content:a,raw:a}))}function r(a,c){let u=0;for(;u<a.length;){const d=a.indexOf("<",u);if(d===-1){i(a.slice(u),c);break}i(a.slice(u,d),c);const f=a.slice(d),h=f.match(uv);if(!h){i("<",c),u=d+1;continue}const p=Jn(f);if(p===-1){i("<",c),u=d+1;continue}const g=f.slice(0,p+1),b=(h[1]??"").toLowerCase();t.has(b)?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=nK(a,t);if(!u){r(a,c);return}const d=a.slice(0,u.index);d&&r(d,c),o={tag:u.tag,buffer:a.slice(u.index),closing:u.closing},s=o.buffer}for(const a of e){if(o){o.buffer+=bp(a),s=o.buffer;const c=Jn(o.buffer);if(c===-1)continue;const u=o.buffer.slice(0,c+1),d=o.buffer.slice(c+1);n.push({type:"html_inline",tag:"",content:u,raw:u}),o=null,s=null,d&&l(d);continue}if(a.type==="html_inline"){const c=bp(a),u=(c.match(uv)?.[1]??"").toLowerCase();if(u&&t.has(u)&&Jn(c)===-1){o={tag:u,buffer:c,closing:/^<\s*\//.test(c)},s=o.buffer;continue}}if(a.type==="text"){const c=String(a.content??"");if(!c.includes("<")){n.push(a);continue}l(c,a);continue}n.push(a)}return{children:n,pendingBuffer:s??void 0}}const iK=["a","span","strong","em","b","i","u"];function rK(e,t={}){const n=new Set;if(t.customHtmlTags?.length)for(const f of t.customHtmlTags){const h=_i(f);h&&n.add(h)}const o=f=>{const h=f,p=new Set(n),g=Array.isArray(h.env?.__markstreamCustomHtmlTags)?h.env.__markstreamCustomHtmlTags:[];for(const y of g){const k=_i(String(y??""));k&&p.add(k)}const b=tK(Array.from(p)),v=new Set(iK);for(const y of p)v.add(y);return{autoCloseInlineTagSet:v,commonHtmlTags:b,customTagSet:p,shouldMergeHtmlBlockTag:y=>p.has(y)||!b.has(y)||W6.has(y)}},s=f=>{if(f.type==="html_block")return String(f.content??"");if(f.type!=="inline"||!Array.isArray(f.children)||f.children.length!==1)return"";const h=f.children[0];return h?.type!=="html_block"?"":String(f.content??h.content??"")},i=(f,h)=>{f.type="html_block",f.content=h,f.raw=h,f.children=[]},r=f=>f.replace(/^(?:\r?\n)+/,""),l=f=>/^(?: {4}|\t)/.test(f),a=f=>f.replace(/^(?: {4}|\t)/gm,""),c=(f,h)=>{const p=r(f);if(!/\S/.test(p))return[];if(l(p))return[{type:"code_block",content:a(p),raw:p}];const g=p.replace(/^[\t ]+/,"");if(!g)return[];if(g.startsWith("<"))return[{type:"html_block",content:g}];const b={type:"inline",tag:"",nesting:0,content:g,children:[{type:"text",content:g,raw:g}]};return h==="paragraph"?[{type:"paragraph_open",tag:"p",nesting:1},b,{type:"paragraph_close",tag:"p",nesting:-1}]:h==="text"?[{type:"text",content:g,raw:g}]:[b]},u=(f,h,p)=>f[h-1]?.type==="paragraph_open"&&f[h+1]?.type==="paragraph_close"?"inline":p,d=(f,h)=>{const p=r(h);return!/\S/.test(p)||f.type!=="inline"||!Array.isArray(f.children)?!1:(f.content=`${String(f.content??"")}${p}`,f.children.push({type:"text",content:p,raw:p}),!0)};e.core.ruler.after("inline","fix_html_inline_streaming",f=>{const h=f.tokens??[],{commonHtmlTags:p,customTagSet:g}=o(f);for(const b of h){const v=b;if(v.type!=="inline"||!Array.isArray(v.children))continue;const m=String(v.content??""),y=v.children.length?v.children:m.includes("<")?[{type:"text",content:m,raw:m}]:null;if(y)try{const k=sK(y,p);if(v.children=k.children,k.pendingBuffer){const A=m.lastIndexOf(k.pendingBuffer);if(A!==-1){const $=m.slice(0,A);v.content=$,typeof v.raw=="string"&&(v.raw=$)}}}catch(k){console.error("[applyFixHtmlInlineTokens] failed to fix streaming html inline",k)}}JV(h,g)}),e.core.ruler.push("fix_html_inline_tokens",f=>{const h=f.tokens??[],{autoCloseInlineTagSet:p,customTagSet:g,shouldMergeHtmlBlockTag:b}=o(f),v=[];for(let m=0;m<h.length;m++){const y=h[m];if(v.length>0){const[A,$]=v[v.length-1];if(m!==$){if(y.type==="paragraph_open"||y.type==="paragraph_close"){h.splice(m,1),m--;continue}const I=String(y.content??y.raw??"");if(I){const x=h[$],L=`${String(x.content||"")}
173
+ ${I}`,E=Jn(L),F=E===-1?null:k_(L,A,E+1);if(F){const S=L.slice(0,F.end),N=L.slice(F.end);x.content=S,x.loading=!1,h.splice(m,1),v.pop();const D=d(x,N)?[]:c(N,u(h,m,"paragraph"));D.length&&h.splice(m,0,...D),m--;continue}x.content=L,x.loading!==!1&&(x.loading=!0)}h.splice(m,1),m--;continue}}const k=s(y);if(k){if(eK(k))continue;const A=(k.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1]??"").toLowerCase(),$=/^\s*<\s*\//.test(k);if(!A||!b(A))continue;if(i(y,k),!$)A&&!new RegExp(`^\\s*<\\s*${A}\\b[^>]*\\/\\s*>`,"i").test(k)&&QV(k,A)>0&&v.push([A,m]);else if(v.length>0&&A&&v[v.length-1][0]===A){const[,I]=v[v.length-1],x=h[I];x.content=`${String(x.content||"")}
174
+ ${k}`,x.loading=!1,v.pop(),h.splice(m,1),m--}continue}else if(v.length>0){if(y.type==="paragraph_open"||y.type==="paragraph_close"){h.splice(m,1),m--;continue}const A=y.content||"",$=new RegExp(`<\\s*\\/\\s*${v[v.length-1][0]}\\s*>`,"i").test(A);if(A){const[,I]=v[v.length-1],x=h[I];x.content=`${x.content||""}
175
+ ${A}`,x.loading!==!1&&(x.loading=!$)}$&&v.pop(),h.splice(m,1),m--}else continue}if(g.size>0){const m=new Map,y=new Map,k=I=>{let x=m.get(I);return x||(x=new RegExp(`<\\s*${I}\\b`,"i"),m.set(I,x)),x},A=I=>{let x=y.get(I);return x||(x=new RegExp(`<\\s*\\/\\s*${I}\\s*>`,"i"),y.set(I,x)),x},$=[];for(let I=0;I<h.length;I++){const x=h[I],L=String(x.content??"");if($.length>0){const F=$[$.length-1],S=h[F.index],N=x.type==="html_block"?A(F.tag).exec(L):null;if(N){const U=N.index+N[0].length,H=L.slice(0,U),P=L.slice(U);S.content=`${String(S.content??"")}
176
+ ${H}`,Array.isArray(S.children)&&S.children.push({type:"html_inline",content:`</${F.tag}>`,raw:`</${F.tag}>`}),$.pop();const Z=d(S,P)?[]:c(P,u(h,I,"paragraph"));Z.length?h.splice(I,1,...Z):(h.splice(I,1),I--);continue}if(x.type!=="inline")continue;const D=Array.isArray(x.children)?x.children:[],B=YV(D,F.tag);if(B!==-1){const U=D.slice(0,B+1),H=D.slice(B+1),P=U.map(Z=>String(Z?.content??Z?.raw??"")).join("");if(S.content=`${String(S.content??"")}
177
+ ${P}`,Array.isArray(S.children)&&S.children.push(...U),H.length){const Z=H.map(K=>String(K.content??K.raw??"")).join("");if(Z.trim()){const K=Z.replace(/^\s+/,"");if(d(S,Z))h.splice(I,1),I--;else if(K.startsWith("<"))h.splice(I,1,{type:"html_block",content:K});else{const V=c(Z,u(h,I,"paragraph"));h.splice(I,1,...V)}}else h.splice(I,1),I--}else h.splice(I,1),I--;$.pop();continue}S.content=`${String(S.content??"")}
178
+ ${L}`,Array.isArray(S.children)&&S.children.push(...D),h.splice(I,1),I--;continue}if(x.type!=="inline")continue;const E=Array.isArray(x.children)?x.children:[];for(const F of g)if((E.length?ZV(E,F):k(F).test(L)&&!A(F).test(L)?1:0)>0){$.push({tag:F,index:I});break}}}{let m=0;for(let y=0;y<h.length;y++){const k=h[y];if(k.type==="paragraph_open"){m++;continue}k.type==="paragraph_close"&&(m>0?m--:(h.splice(y,1),y--))}}for(let m=0;m<h.length;m++){const y=h[m];if(y.type==="html_block"){const x=(y.content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(x.startsWith("!")||x.startsWith("?")){y.loading=!1;continue}if(g.has(x)){const B=String(y.content??""),U=Jn(B),H=U===-1?null:k_(B,x,U+1);y.loading=H?!1:y.loading!==void 0?y.loading:!0;const P=H?.start??-1,Z=H?H.end-H.start:0;if(P!==-1){const K=B.slice(0,P+Z);let V="";U!==-1&&U<P&&(V=B.slice(U+1,P)),y.children=[{type:x,content:V,raw:K,attrs:[],tag:x,loading:!1}],y.content=K,y.raw=K;const X=c(B.slice(P+Z)||"","text");X.length&&h.splice(m+1,0,...X)}else y.children=[{type:x,content:"",raw:B,attrs:[],tag:x,loading:!0}];continue}if(["br","hr","img","input","link","meta","div","p","ul","li"].includes(x))continue;y.type="inline";const L=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let E;for(;(E=L.exec(y.content||""))!==null;)E[1],E[2]||E[3]||E[4];const F=String(y.content??""),S=new RegExp(`<\\/\\s*${x}\\s*>`,"i").exec(F),N=S?S.index:-1,D=S?S[0].length:0;if(N!==-1){const B=F.slice(0,N+D),U=(F.slice(N+D)||"").replace(/^\s+/,"");y.children=[{type:"html_block",content:B,tag:x,loading:!1}],y.content=B,y.raw=B,U&&h.splice(m+1,0,U.startsWith("<")?{type:"html_block",content:U}:{type:"text",content:U,raw:U})}else y.children=[{type:"html_block",content:y.content,tag:x,loading:!0}];continue}if(!y||y.type!=="inline")continue;if(y.children.length===2&&y.children[0].type==="html_inline"){const x=(y.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase(),L=y.children[1],E=String(L?.content??"").match(/^<\s*\/\s*([^\s>]+)/)?.[1]?.toLowerCase()??"";if(L?.type==="html_inline"&&E===x)continue;p.has(x)?(y.children[0].loading=!0,y.children[0].tag=x,y.children.push({type:"html_inline",tag:x,loading:!0,content:`</${x}>`})):y.children=[{type:"html_block",loading:!0,tag:x,content:String(y.children[0]?.content??"")+String(y.children[1]?.content??"")}];continue}else if(y.children.length===3&&y.children[0].type==="html_inline"&&y.children[2].type==="html_inline"){const x=(y.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(p.has(x))continue;y.children=[{type:"html_block",loading:!1,tag:x,content:y.children.map(L=>L.content).join("")}];continue}if(!y.content?.startsWith("<")||y.children?.length!==1)continue;const k=String(y.content),A=y,$=A.children[0];if($?.type!=="html_inline"){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(k)&&(A.children.length=0);continue}const I=String($.content??k).match(GV)?.[1]?.toLowerCase()??"";if(I){if(/\/\s*>\s*$/.test(k)||H6.has(I)){A.children=[{type:"html_inline",content:k}];continue}A.children.length=0}}})}function lK(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 aK(e,t={}){t.enabled!==!1&&e.core.ruler.after("inline","fix_indented_code_block",n=>{const o=n.tokens??[];for(let s=0;s<o.length;s++){const i=o[s];if(i.type!=="code_block")continue;const r=String(i.content??"").trim();if(!r)continue;const l=r.split(/\r?\n/).filter(a=>a.trim().length>0);if(l.length===1&&!lK(l[0]??"")){const a=l[0]??"",c=i.level??0;o.splice(s,1,{type:"paragraph_open",tag:"p",nesting:1,level:c},{type:"inline",tag:"",nesting:0,level:c,content:a,children:[{type:"text",content:a,level:c+1,raw:a}],block:!0},{type:"paragraph_close",tag:"p",nesting:-1,level:c}),s+=2}}})}const z6=/\.([a-z0-9]{1,15})$/i,cK=/[_()[\]{}<>]/u,uK=/^(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/i,dK=/[?#@]/u,fK=/[\\/]/u,hK=/^[\p{L}\p{N}./\\-]+$/u,pK=/^[A-Za-z0-9-]{1,63}$/u,mK=/^xn--[a-z0-9-]{2,59}$/i,gK=/^(?:[A-Z]{1,6}|\d{1,8})$/u,vK=/^(?=.{1,12}$)[A-Z0-9]+(?:[-.][A-Z0-9]+)*$/iu,yK=/文件名\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,kK=/文件名\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,bK=/股票代码|股票代碼|证券代码|證券代碼|(?:代码|代碼|交易所|后缀|後綴|市场|市場)(?=$|[\s::/|,,、()()])|\btickers?\b|\bsymbols?\b|\bexchanges?\b/iu,xK=new Set(["ai","md","py","rs","sh","zip"]),U6=new Set(["as","bj","de","hk","l","ln","ny","pa","sh","ss","sz","t","us"]),wK=new Set([...U6,"at","ax","cn","co","it","jp","ks","mc","mx","nz","pl","sa","si","to","tw"]),_K=new Set(["com","dev","io","page","site"]),SK=new Set(["app","apk","dmg","exe","ipa","lock","log","markdown","webmanifest"]),CK=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 Fd(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function C0(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return Fd(n)?n:void 0}function x_(e,t){if(!Fd(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 w_(e){const t=Xd(e);return Fd(t)?t:void 0}function AK(e){return e.replace(/^[\s>*_`[\]((【《"'“‘]+/u,"").replace(/[\s<*_`\]))】》"'.。;;,,、::!?!?]+$/u,"")}function __(e,t){if(!Fd(t))return;const n=String(e??"").trim().split(/\s+/u).map(AK).filter(Boolean);if(n.length===0)return;const o={};return t?.filename&&n.every(s=>xp(s,{filename:!0,explicitFilename:t.explicitFilename}))&&(o.filename=!0),t?.explicitFilename&&o.filename&&(o.explicitFilename=!0),t?.marketTicker&&n.every(s=>xp(s,{marketTicker:!0}))&&(o.marketTicker=!0),Fd(o)?o:void 0}function Hl(e,t=!1){let n;return{options(o){return t||o==null?x_(e,n):x_(e,C0(w_(o),__(o,n)))},remember(o){const s=w_(o);n=t?C0(n,s):C0(s,__(o,n))},reset(){n=void 0}}}function S_(e){return pK.test(e)&&!e.startsWith("-")&&!e.endsWith("-")}function MK(e){const t=e.split(".");if(t.length<2)return!1;const n=t[t.length-1]?.toLowerCase()??"";return S_(n)||mK.test(n)?t.every(S_):!1}function q6(e){return Array.from(e).some(t=>t.charCodeAt(0)>127)}function EK(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0]??""}function TK(e){return e.split(".").some(t=>t.toLowerCase().startsWith("xn--"))}function j6(e,t,n){const o=EK(t);return q6(e)&&TK(o)&&String(n??"").toLowerCase().includes(o.toLowerCase())}function Xd(e){const t=String(e??"");return{explicitFilename:yK.test(t),filename:kK.test(t),marketTicker:bK.test(t)}}function NK(e){return MK(e.split(/[\\/]/)[0]??"")}function IK(e){const t=e.replace(/[^a-z]/gi,"");return t.length>=2&&t===t.toUpperCase()}function LK(e){if(cK.test(e)||!hK.test(e))return!0;if(fK.test(e))return!NK(e);const t=e.replace(z6,"");return q6(t)?!0:t.split(".").filter(Boolean).some(IK)}function $K(e,t,n){if(!(n?wK:U6).has(t))return!1;const o=e.slice(0,-(t.length+1));return o===""?e.startsWith("."):(n?vK:gK).test(o)}function xp(e,t={}){if(!e||uK.test(e)||dK.test(e))return!1;const n=e.match(z6);if(!n)return!1;const o=String(n[1]??"").toLowerCase();return $K(e,o,t.marketTicker===!0)?!0:CK.has(o)?!xK.has(o)||t.filename?!0:LK(e):!!(t.explicitFilename&&_K.has(o)||t.filename&&SK.has(o))}const C_=["!"];function Ms(e){return{type:"text",content:e,raw:e}}function ia(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 ra(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 il(e,t,n){let o="";if(t.includes('"')){const s=t.split('"');t=s[0].trim(),o=s[1].trim()}return{type:"link",loading:n,href:t,title:o,text:e,children:[{type:"text",content:e,raw:e}],raw:`[${e}](${t})`}}function FK(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(Ms(t))}}function A_(e,t){let n=-1;for(const o of t){const s=e.indexOf(o);s!==-1&&(n===-1||s<n)&&(n=s)}return n}function OK(e){const t=e.attrs?.find(n=>n?.[0]==="href")?.[1];return typeof t=="string"?t:""}function RK(e,t){if(!e)return;e.attrs=Array.isArray(e.attrs)?e.attrs:[];const n=e.attrs.findIndex(o=>o?.[0]==="href");n>=0?e.attrs[n][1]=t:e.attrs.push(["href",t])}function BK(e,t,n){let o="";for(let s=t+1;s<n;s++){const i=e[s];if(i?.type!=="text"||typeof i.content!="string")return null;o+=i.content}return o||null}function DK(e){e.core.ruler.after("inline","fix_link_tokens",t=>{const n=t.tokens??[];for(let o=0;o<n.length;o++){const s=n[o];if(s&&s.type==="inline"&&Array.isArray(s.children))try{s.children=PK(s.children,typeof s.content=="string"?s.content:void 0)}catch(i){console.error("[applyFixLinkTokens] failed to fix inline children",i)}}})}function PK(e,t){if(e.length<3||e.some(o=>o.type==="code_inline"))return e;const n=Xd(t);for(let o=0;o<=e.length-1;o++){o<0&&(o=0);const s=e[o];if(!s)break;if(s.type==="link_open"&&(s.markup==="linkify"||s.markup==="autolink")){let i=-1;for(let r=o+1;r<e.length;r++)if(e[r]?.type==="link_close"){i=r;break}if(i!==-1){const r=BK(e,o,i),l=OK(s);if(s.markup==="linkify"&&r&&!j6(r,l,t)&&xp(r,n)){e.splice(o,i-o+1,Ms(r));continue}const a=A_(l,C_);for(let c=o+1;c<i;c++){const u=e[c];if(u?.type!=="text"||typeof u.content!="string")continue;const d=A_(u.content,C_);if(d===-1)continue;const f=u.content[d],h=u.content.slice(0,d);let p=u.content.slice(d);for(let v=c+1;v<i;v++){const m=e[v];m?.type==="text"&&typeof m.content=="string"&&(p+=m.content)}u.content=h,u.raw=h;const g=i-(c+1);g>0&&(e.splice(c+1,g),i=c+1);let b=l;if(a!==-1)b=l.slice(0,a);else if(p){const v=encodeURI(p);if(v&&l.endsWith(v))b=l.slice(0,l.length-v.length);else{const m=f?encodeURI(f):"",y=m?l.indexOf(m):-1;y!==-1&&(b=l.slice(0,y))}}b!==l&&RK(s,b),p&&e.splice(i+1,0,Ms(p));break}}}if(s?.type==="em_open"&&e[o-1]?.type==="text"&&e[o-1].content?.endsWith("*")){const i=e[o-1].content?.replace(/(\*+)$/,"")||"";e[o-1].content=i,s.type="strong_open",s.tag="strong",s.markup="**";for(let r=o+1;r<e.length;r++)if(e[r]?.type==="em_close"){e[r].type="strong_close",e[r].tag="strong",e[r].markup="**";break}}else if(s?.type==="text"&&s.content?.endsWith("(")&&e[o+1]?.type==="link_open"){const i=s.content.match(/\[([^\]]+)\]/);if(i){let r=s.content.slice(0,i.index);const l=r.match(/(\*+)$/),a=[];if(l){r=r.slice(0,l.index),r&&a.push(Ms(r));const c=i[1],u=l[1].length;ia(a,u);let d=e[o+2]?.content||"";if(e[o+4]?.type==="text"&&!e[o+4].content?.startsWith(")")&&(d+=e[o+4]?.content||"",e[o+4].content=""),a.push(il(c,d,!e[o+4]?.content?.startsWith(")"))),ra(a,u),e[o+4]?.type==="text"){const f=e[o+4].content?.replace(/^\)\**/,"");f&&a.push(Ms(f)),e.splice(o,5,...a)}else e.splice(o,4,...a)}else{r&&a.push(Ms(r));let c=i[1];const u=c.match(/^\*+/);if(u){const f=u[0].length;c=c.replace(/^\*+/,"").replace(/\*+$/,"");let h=e[o+2]?.content||"";if(e[o+4]?.type==="text"&&!e[o+4].content?.startsWith(")")&&(h+=e[o+4]?.content||"",e[o+4].content=""),ia(a,f),a.push(il(c,h,!e[o+4]?.content?.startsWith(")"))),ra(a,f),e[o+4]?.type==="text"){const p=e[o+4].content?.replace(/^\)/,"");p&&a.push(Ms(p)),e.splice(o,5,...a)}else e.splice(o,4,...a);o===0?o=a.length-1:o-=a.length+1;continue}let d=e[o+2]?.content||"";if(e[o+4]?.type==="text"&&!e[o+4].content?.startsWith(")")&&(d+=e[o+4]?.content||"",e[o+4].content=""),a.push(il(c,d,!e[o+4]?.content?.startsWith(")"))),e[o+4]?.type==="text"){const f=e[o+4].content?.replace(/^\)/,"");f&&a.push(Ms(f)),e.splice(o,5,...a)}else e.splice(o,4,...a)}o-=a.length+1;continue}}else if(s.type==="link_open"&&s.markup==="linkify"&&e[o-1]?.type==="text"&&e[o-1].content?.endsWith("(")){if(e[o-2]?.type==="link_close"){const i=[],r=e[o-3].content||"";let l=s.attrs?.find(a=>a[0]==="href")?.[1]||"";if(e[o+3]?.type==="text"){const a=(e[o+3]?.content??"").indexOf(")"),c=a===-1;a===-1&&(l+=e[o+3]?.content?.slice(0,a)||"",e[o+3].content=""),i.push(il(r,l,c));const u=e[o+3].content?.replace(/^\)\**/,"");u&&i.push(Ms(u)),e.splice(o-4,8,...i)}else i.push({type:"link",loading:!0,href:l,title:"",text:r,children:[{type:"text",content:l,raw:l}],raw:`[${r}](${l})`}),e.splice(o-4,7,...i);continue}else if(e[o-1].content==="]("&&e[o-3]?.type==="text"&&e[o-3].content?.endsWith(")"))if(e[o-2]?.type==="strong_open"){const[i,r]=e[o-3].content?.split("[**")||[];e[o+1].content=r||"",e[o-3].content=i||"",e[o-1].content=""}else if(e[o-2]?.type==="em_open"){const[i,r]=e[o-3].content?.split("[*")||[];e[o+1].content=r||"",e[o-3].content=i||"",e[o-1].content=""}else{const[i,r]=e[o-3].content?.split("[")||[];e[o+1].content=r||"",e[o-3].content=i||"",e[o-1].content=""}}if(s.type==="link_close"&&s.nesting===-1&&e[o-2]?.type==="link_open"&&e[o+1]?.type==="text"&&e[o-1]?.type==="text"){const i=e[o-1].content||"",r=e[o-2].attrs||[],l=r.find(p=>p[0]==="href")?.[1]||"",a=r.find(p=>p[0]==="title")?.[1]||"";let c=3,u=2;const d=(e[o-3]?.content||"").match(/^(\*+)$/),f=[];if(d){u+=1;const p=d[1].length;ia(f,p)}if(s.markup!=="linkify"&&e[o+1].type==="text"&&e[o+1]?.content?.startsWith("](")){c+=1;for(let p=o+1;p<e.length;p++){const g=d?d[1].length:e[o-3].markup.length,b=e[p];if(g===1&&b.type==="em_close")break;if(g===2&&b.type==="strong_close")break;if(g===3&&(b.type==="em_close"||b.type==="strong_close"))break;c+=1}}const h={type:"link",loading:!1,href:l,title:a,text:i,children:[{type:"text",content:i,raw:i}],raw:`[${i}](${l})`};if(f.push(h),d){const p=d[1].length;ra(f,p)}e.splice(o-u,c,...f),o-=f.length+1;continue}else if(s.content?.startsWith("](")&&e[o-1].markup?.includes("*")&&e[o-4]?.type==="text"&&e[o-4].content?.endsWith("[")){const i=e[o-1].markup.length,r=[],l=e[o-4].content.slice(0,e[o-4].content.length-i);l&&r.push(Ms(l)),ia(r,i);const a=e[o-2].content||"";let c=s.content.slice(2),u=!0;if(e[o+1]?.type==="text"){const d=(e[o+1]?.content??"").indexOf(")");u=d===-1,d===-1&&(c+=e[o+1]?.content?.slice(0,d)||"",e[o+1].content="")}if(r.push(il(a,c,u)),ra(r,i),e[o+1]?.type==="text"){const d=e[o+1].content?.replace(/^\)\**/,"");d&&r.push(Ms(d)),e.splice(o-4,8,...r)}else e[o+1]?.type==="link_open"?e.splice(o-4,10,...r):e.splice(o-4,7,...r);o-=r.length+1;continue}else if(s.content?.startsWith("](")&&e[o-1].type==="strong_close"&&e[o-4]?.type==="text"&&e[o-4]?.content?.includes("**[")){const i=[],r=e[o-4].content.split("**[")[0];r&&i.push(Ms(r)),ia(i,2);const l=e[o-2].content||"";let a=s.content.slice(2),c=!0;if(e[o+1]?.type==="text"){const u=(e[o+1]?.content??"").indexOf(")");c=u===-1,u===-1&&(a+=e[o+1]?.content?.slice(0,u)||"",e[o+1].content="")}if(i.push(il(l,a,c)),ra(i,2),e[o+1]?.type==="text"){const u=e[o+1].content?.replace(/^\)\**/,"");u&&i.push(Ms(u)),e.splice(o-4,8,...i)}else e[o+1]?.type==="link_open"?e.splice(o-4,10,...i):e.splice(o-4,7,...i);o-=i.length+1;continue}else if(s.type==="strong_close"&&e[o+1]?.type==="text"&&e[o+1].content?.includes("](")&&e[o-1].type==="text"&&/\[.*$/.test(e[o-1].content||"")){const i=[],[r,l]=e[o-1].content?.split("[")||["",""];r&&i.push(Ms(r)),ia(i,2);let[a,c]=e[o+1].content.split("](");a=l+a;let u=4;if(e[o+2]?.type==="link_open"){const f=e[o+2].attrs?.find(h=>h[0]==="href")?.[1];e[o+5]?.type==="text"&&e[o+5].content==="."?(c=(f||c)+e[o+5].content,e[o+5].content=""):c=f||c,u+=3}let d=!0;if(s.nesting===-1&&(a=a.replace(/\*+$/,"")),e[o+2]?.type==="text"){const f=(e[o+2]?.content??"").indexOf(")");d=f===-1,f===-1&&(c+=e[o+2]?.content?.slice(0,f)||"",e[o+2].content="")}i.push(il(a,c,d)),ra(i,2),e.splice(o-2,u,...i)}if(s.type==="text"&&/\*+\[[^\]]*$/.test(s.content||"")&&e[o+1]?.type==="strong_open"&&e[o+2]?.type==="text"&&e[o+2].content==="]("&&e[o+3]?.type==="link_open"&&e[o+5]?.type==="link_close"&&e[o+6]?.type==="text"&&e[o+6].content===")"&&e[o+7]?.type==="strong_close"){const i=(s.content||"").match(/^(\*+)\[(.*)$/);if(i){const r=(i[2]||"")+i[1];let l=e[o+3]?.attrs?.find(c=>c[0]==="href")?.[1]||"";!l&&e[o+4]?.type==="text"&&(l=e[o+4].content||"");const a=[];ia(a,2),a.push(il(r,l,!1)),ra(a,2),e.splice(o,9,...a),o-=a.length-1;continue}}}for(let o=0;o<e.length-1;o++){const s=e[o],i=e[o+1];if(s?.type!=="link"||i?.type!=="text"||typeof i.content!="string"||!i.content.startsWith("!"))continue;const r=String(s.href??"");if(String(s.text??"")!==r||!r.endsWith("=")&&!r.endsWith("#"))continue;FK(s,"!");const l=i.content.slice(1);l?(i.content=l,i.raw=l):e.splice(o+1,1)}return e}function HK(e){e.core.ruler.after("inline","fix_list_item_tokens",t=>{const n=t.tokens??[];for(let o=0;o<n.length;o++){const s=n[o];if(s&&s.type==="inline"&&Array.isArray(s.children))try{s.children=WK(s.children)}catch(i){console.error("[applyFixListItem] failed to fix inline children",i)}}})}function WK(e){const t=e[e.length-1],n=String(t?.content??"");return t?.type==="text"&&/^\s*\d+\.\s*$/.test(n)&&e[e.length-2]?.tag==="br"&&e.splice(e.length-1,1),e}function zK(e){e.core.ruler.after("inline","fix_strong_tokens",t=>{const n=t.tokens??[];for(let o=0;o<n.length;o++){const s=n[o];if(s&&s.type==="inline"&&Array.isArray(s.children))try{s.children=UK(s.children)}catch(i){console.error("[applyFixStrongTokens] failed to fix inline children",i)}}})}function UK(e){let t=0;const n=new Set,o=new Set;let s=0;for(let u=0;u<e.length;u++){const d=e[u],f=d.type;if(f==="strong_open"){t++;const h=String(d.markup??"");let p=u-1;for(;p>=0&&e[p].type==="text"&&e[p].content==="";)p--;const g=e[p];let b=u+1;for(;b<e.length&&e[b].type==="text"&&e[b].content==="";)b++;const v=e[b];h==="__"&&(g?.content?.endsWith("_")||v?.content?.startsWith("_")||v?.markup?.includes("_"))&&(d.type="text",d.tag="",d.content=h,d.raw=h,d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null,n.add(t))}else if(f==="strong_close")n.has(t)&&d.markup==="__"&&(d.type="text",d.content=d.markup,d.raw=String(d.markup??""),d.tag="",d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null),t--,t<0&&(t=0);else if(f==="em_open"){s++;const h=String(d.markup??"");let p=u-1;for(;p>=0&&e[p].type==="text"&&e[p].content==="";)p--;const g=e[p];let b=u+1;for(;b<e.length&&e[b].type==="text"&&e[b].content==="";)b++;const v=e[b];h==="_"&&(g?.content?.endsWith("_")||v?.content?.startsWith("_")||v?.markup?.includes("_"))&&(d.type="text",d.tag="",d.content=h,d.raw=h,d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null,o.add(s))}else f==="em_close"&&(o.has(s)&&d.markup==="_"&&(d.type="text",d.content=d.markup,d.raw=String(d.markup??""),d.tag="",d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null),s--,s<0&&(s=0))}if(e.length<5)return e;const i=e.length-4,r=e[i];let l=[...e];const a=e[i+1],c=String(r.content??"");if(r.type==="link_open"&&e[i-1]?.type==="em_open"&&e[i-2]?.type==="text"&&e[i-2].content?.endsWith("*")){const u=String(e[i-2].content??"").slice(0,-1),d=[{type:"strong_open",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""},e[i],e[i+1],e[i+2],{type:"strong_close",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""}];u&&d.unshift({type:"text",content:u,raw:u}),l.splice(i-2,6,...d)}else if(r.type==="text"&&c.endsWith("*")&&a.type==="em_open"){const u=e[i+2],d=u?.type==="text"?4:3,f=[{type:"strong_open",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""},{type:"text",content:u?.type==="text"?String(u.content??""):"",raw:u?.type==="text"?String(u.content??""):""},{type:"strong_close",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""}],h=c.slice(0,-1);h&&f.unshift({type:"text",content:h,raw:h}),l.splice(i,d,...f)}return l=qK(l),l}function qK(e){if(e.length<7)return e;const t=[];for(let n=0;n<e.length;n++){const o=e[n],s=e[n+1],i=e[n+2],r=e[n+3],l=e[n+4],a=e[n+5],c=e[n+6];if(o?.type==="strong_open"&&s?.type==="text"&&i?.type==="strong_close"&&r?.type==="strong_open"&&l?.type==="math_inline"&&a?.type==="strong_close"&&c?.type==="text"){const u=String(c.content??""),d=u.indexOf("**");if(d!==-1){const f=u.slice(0,d),h=u.slice(d+2);t.push(o),t.push(s),t.push(l),f&&t.push({...c,type:"text",content:f,raw:f}),t.push(a),h&&t.push({...c,type:"text",content:h,raw:h}),n+=6;continue}}if(o?.type==="strong_open"&&s?.type==="text"&&i?.type==="strong_close"&&r?.type==="strong_open"&&l?.type==="math_inline"&&a?.type==="strong_close"){const u=jK(e,n+6);if(u){t.push(o),t.push(s),t.push(l);for(let d=n+6;d<u.index;d++)t.push(e[d]);u.beforeClose&&t.push({...e[u.index],type:"text",content:u.beforeClose,raw:u.beforeClose}),t.push(a),u.afterClose&&t.push({...e[u.index],type:"text",content:u.afterClose,raw:u.afterClose}),n=u.index;continue}}t.push(o)}return t}function jK(e,t){for(let n=t;n<e.length;n++){const o=e[n];if(o?.type==="strong_open")return null;if(o?.type!=="text")continue;const s=String(o.content??""),i=s.indexOf("**");if(i!==-1)return{index:n,beforeClose:s.slice(0,i),afterClose:s.slice(i+2)}}return null}function VK(e){e.core.ruler.after("block","fix_table_tokens",t=>{const n=t;try{const o=XK(n.tokens??[],!!n.env?.__markstreamFinal,n.src??"");Array.isArray(o)&&(n.tokens=o)}catch(o){console.error("[applyFixTableTokens] failed to fix table tokens",o)}})}function M_(){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 E_(){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 T_(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 V6(e,t){if(!e.startsWith("|")||e.includes(`
179
+ `)||!e.endsWith("|"))return null;const n=e.slice(1).split("|");return n.at(-1)===""&&n.pop(),n.length>0&&n.every(o=>o.trim().length>0)?n:null}function A0(e){return V6(e)!==null}function K6(e){return/^:?-+:?$/.test(e.trim())}function KK(e){if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|");return t.at(-1)===""&&t.pop(),t.length>0&&t.every(K6)}function GK(e){return/^(?:[::]-*|:?-+:?)?$/.test(e.trim())}function YK(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(K6)&&GK(n)}function ZK(e){return e==="|"||e==="|:"}function QK(e){const t=V6(e);return t!==null&&t.every(n=>!n.includes(":"))}function XK(e,t=!1,n=""){const o=[...e];if(e.length<3)return o;const s=e.length-2,i=e[s];if(i.type==="inline"){const r=String(i.content??""),l=r.split(`
180
+ `)[0]??"",[a="",c="",...u]=r.split(`
181
+ `),d=!t&&!r.includes(`
182
+ `)&&/\r?\n$/.test(n)&&A0(r);if(!t&&(r.includes(`
183
+ `)&&u.length===0&&A0(a)&&YK(c)||d)){const f=l.slice(1,-1).split("|").map(p=>p.trim()).flatMap(p=>T_(p)),h=[...M_(),...f,...E_()];o.splice(s-1,3,...h)}else if(r.includes(`
184
+ `)&&u.length===0&&A0(a)&&KK(c)){const f=l.slice(1,-1).split("|").map(p=>p.trim()).flatMap(p=>T_(p)),h=[...M_(),...f,...E_()];o.splice(s-1,3,...h)}else r.includes(`
185
+ `)&&u.length===0&&QK(a)&&ZK(c)&&(i.content=r.slice(0,-2),i.children.splice(2,1))}return o}function JK(e,t,n,o){const s=e.length;if(n==="$$"&&o==="$$"){let c=t;for(;c<s-1;){if(e[c]==="$"&&e[c+1]==="$"){let u=c-1,d=0;for(;u>=0&&e[u]==="\\";)d++,u--;if(d%2===0)return c}c++}return-1}const i=n[n.length-1],r=o;let l=0,a=t;for(;a<s;){if(e.slice(a,a+r.length)===r){let u=a-1,d=0;for(;u>=0&&e[u]==="\\";)d++,u--;if(d%2===0){if(l===0)return a;l--,a+=r.length;continue}}const c=e[a];if(c==="\\"){a+=2;continue}c===i?l++:c===r[r.length-1]&&l>0&&l--,a++}return-1}var eG=JK;const tG=["boldsymbol","mathbb","mathcal","mathfrak","mathrm","mathit","mathsf","vec","hat","bar","tilde","overline","underline","mathscr","mathnormal","operatorname","mathbf*"],wp=tG.map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,"\\$&")).join("|"),nG=/\\[a-z]+/i,G6="(?:\\\\|\\u0008)",oG=new RegExp(String.raw`${G6}(?:${wp})\s*\{[^}]+\}`,"i"),sG=new RegExp(String.raw`(?:${G6})?(?:${wp})\s*\{`,"i"),iG=/\\(?:text|frac|left|right|times)/,rG=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,lG=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,aG=/[A-Z]+\s*\([^)]+\)/i,cG=/^\(\s*[a-z](?:\s*,\s*[a-z])+\s*\)$/i,uG=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,dG=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,fG={"\b":"\\b","\v":"\\v","\f":"\\f"};function hG(e){let t="";for(const n of e)t+=fG[n]??n;return t}function Ac(e){if(!e)return!1;const t=hG(e),n=t.trim();if(dG.test(n)||n.includes("**"))return!1;if(n.length>2e3)return!0;const o=nG.test(t),s=oG.test(t),i=sG.test(t),r=iG.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=rG.test(t)&&!lG.test(t),c=aG.test(t),u=cG.test(n),d=uG.test(t),f=/^\([a-z]\)$/i.test(n)||/^(?:[a-z]|pi)$/i.test(n),h=/^(?:[A-Z][a-z]?(?:_\{?\d+\}?|\^\{?\d+\}?)?)+$/.test(n);return o||s||i||r||l||a||c||u||d||f||h}const Y6="__markstreamMathPluginApplied",dv=80,Z6=2e4,N_=Z6+4096;function Q6(e){return!!e[Y6]}function pG(e){e[Y6]=!0}const X6=["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"],mG=["cdot","mathbf{","partial","mu_{"],J6=X6.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),eM="[ \r\b\f\v]",gG=new RegExp(`([^\\\\])(${mG.map(e=>e).join("|")})+`,"g"),vG=/span\{([^}]+)\}/,yG=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,kG=/(^|[^\\])\\\r?\n/g,bG=/(^|[^\\])\\$/g,xG=new RegExp(`(${eM})|(${J6})\\b`,"g"),I_=new Map,L_=new Map;function wG(e){if(!e)return xG;const t=[...e];t.sort((r,l)=>l.length-r.length);const n=t.join(""),o=I_.get(n);if(o)return o;const s=`(?:${t.map(r=>r.replace(/[.*+?^${}()|[\\]\\"\]/g,"\\$&")).join("|")})`,i=new RegExp(`(${eM})|(${s})\\b`,"g");return I_.set(n,i),i}function _G(e,t){const n=e?[]:[...t??[]];e||n.sort((l,a)=>a.length-l.length);const o=e?"__default__":n.join(""),s=L_.get(o);if(s)return s;const i=e?[wp,J6].filter(Boolean).join("|"):[n.map(l=>l.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),wp].filter(Boolean).join("|"),r=new RegExp(`(^|[^\\\\\\w])(${i})\\s*\\{`,"g");return L_.set(o,r),r}const $_={" ":"t","\r":"r","\b":"b","\f":"f","\v":"v"};function F_(e){const t=/(^|[^\\])(__|\*\*)/g;let n=0;for(;t.exec(e)!==null;)n++;return n}function O_(e){const t=/(^|[^\\])(__|\*\*)/g;let n,o=null;for(;(n=t.exec(e))!==null;)o={marker:n[2],index:n.index+(n[1]?.length??0)};return o}function rl(e,t){const n=t?.commands??X6,o=t?.escapeExclamation??!0,s=t?.commands==null,i=wG(s?void 0:n);let r=e.replace(i,(c,u,d,f,h)=>{if(u!==void 0&&$_[u]!==void 0)return`\\${$_[u]}`;if(d&&n.includes(d)){const p=h&&typeof f=="number"?h[f-1]:void 0;return p==="\\"||p&&/\w/.test(p)?c:`\\${d}`}return c});o&&(r=r.replace(/(^|[^\\])!/g,"$1\\!"));let l=r;const a=_G(s,s?void 0:n);return l=l.replace(a,(c,u,d)=>`${u}\\${d}{`),l=l.replace(vG,"span\\{$1\\}").replace(yG,"\\operatorname{span}\\{$1\\}"),l=l.replace(kG,`$1\\\\
186
+ `),l=l.replace(bG,"$1\\\\"),l=l.replace(gG,"$1\\$2"),l}function R_(e){const t=e.trim();return!(!Ac(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 tM(e){const t=[];let n=0;for(;n<e.length;){if(e[n]!=="`"){n++;continue}const o=n;let s=1;for(;o+s<e.length&&e[o+s]==="`";)s++;let i=o+s,r=-1;for(;i<e.length;){if(e[i]!=="`"){i++;continue}let l=1;for(;i+l<e.length&&e[i+l]==="`";)l++;if(l===s){r=i;break}i+=l}if(r!==-1){t.push([o,r+s]),n=r+s;continue}n=o+s}return t}function _p(e,t){for(const n of e)if(t>=n[0]&&t<n[1])return n;return null}function SG(e,t=!1){const n=[];let o=0;for(;o<e.length-1;){if(e[o]==="!"&&e[o+1]==="["){const s=o;let i=o+2,r=1;for(;i<e.length&&r>0;){if(e[i]==="\\"&&i+1<e.length){i+=2;continue}e[i]==="["?r++:e[i]==="]"&&r--,i++}if(r===0&&i<e.length&&e[i]==="("){let l=i+1,a=1;for(;l<e.length&&a>0;){if(e[l]==="\\"&&l+1<e.length){l+=2;continue}e[l]==="("?a++:e[l]===")"&&a--,l++}if(a===0){n.push([s,l]),o=l;continue}if(t){n.push([s,e.length]),o=e.length;continue}}}o++}return n}function Jd(e,t){let n=t-1,o=0;for(;n>=0&&e[n]==="\\";)o++,n--;return o%2===1}function fv(e,t){let n=t;for(;n<e.length;){const o=e.indexOf("$",n);if(o===-1)return-1;if(Jd(e,o)){n=o+1;continue}return o}return-1}function M0(e,t){let n=t;for(;n<e.length;){const o=fv(e,n);if(o===-1)return-1;if(o>0&&e[o-1]==="$"||o+1<e.length&&e[o+1]==="$"){n=o+1;continue}return o}return-1}function ju(e,t,n=0){let o=Math.max(0,n);for(;o<e.length;){const s=e.indexOf(t,o);if(s===-1)return-1;if(!Jd(e,s))return s;o=s+Math.max(1,t.length)}return-1}function B_(e,t,n=0,o=e.length,s=[]){let i=0,r=Math.max(0,n);const l=Math.min(e.length,Math.max(0,o));for(;r<l;){const a=e.indexOf(t,r);if(a===-1||a>=l)break;const c=_p(s,a);if(c){r=Math.max(a+Math.max(1,t.length),c[1]);continue}Jd(e,a)||i++,r=a+Math.max(1,t.length)}return i}function ik(e,t,n){const o=Rd(String(e??""));if(!o.endsWith(t))return-1;const s=o.length-t.length;if(s<=0||!Rd(o.slice(0,s)).trim()||Jd(o,s))return-1;const i=tM(o);if(_p(i,s))return-1;const r=B_(o,t,0,s,i);if(t==="$$"){if(r%2===1)return-1}else if(r>B_(o,n,0,s,i))return-1;return s}function Od(e){return e===" "||e===" "}function Rd(e){let t=e.length;for(;t>0&&Od(e[t-1]);)t--;return e.slice(0,t)}function D_(e){let t=0;for(let n=0;n<e.length;n++)e[n]===`
187
+ `&&t++;return t}function P_(e){if(!e)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}function CG(e){if(e.length<3)return!1;const t=e[0];if(t!=="-"&&t!=="*"&&t!=="_"&&t!=="=")return!1;let n=0;for(let o=0;o<e.length;o++){const s=e[o];if(s===t){n++;continue}if(!Od(s))return!1}return n>=3}function AG(e){const t=e.trim();if(!t)return!1;let n=0;t[n]===":"&&n++;let o=0;for(;t[n]==="-";)o++,n++;return o<3?!1:(t[n]===":"&&n++,n===t.length)}function MG(e){if(!e.includes("|"))return!1;const t=e[0]==="|"?e.slice(1):e;return(t.endsWith("|")?t.slice(0,-1):t).split("|").every(AG)}function EG(e){let t=0;if(!P_(e[t]))return!1;for(;P_(e[t]);)t++;return e[t]!=="."&&e[t]!==")"?!1:Od(e[t+1])}function nM(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&&Od(t[n]))return!0}return!!((t[0]==="-"||t[0]==="+"||t[0]==="*")&&Od(t[1])||EG(t)||CG(t)||MG(t))}function H_(e,t){return e?t?`${e}
188
+ ${t}`:e:t}function hv(e){const t=String(e??"").trim();return t?Ac(t):!1}function W_(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return t.toString(36)}function oM(e){if(e.length<=N_)return{source:e,lineOffset:0};let t=e.length-N_;const n=e.indexOf(`
189
+ `,t);return n===-1?{source:"",lineOffset:D_(e)}:(t=n+1,{source:e.slice(t),lineOffset:D_(e.slice(0,t))})}function sM(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return!1;const{source:n}=oM(t);if(!n)return!1;const o=n.split(/\r?\n/),s=Math.max(0,o.length-dv-2),i=[["$$","$$"],["\\[","\\]"]];for(let r=s;r<o.length;r++){const l=Rd(o[r]);if(l&&!nM(l)){for(const[a,c]of i)if(ik(l,a,c)!==-1)return!0}}return!1}function TG(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return null;const{source:n,lineOffset:o}=oM(t);if(!n)return null;const s=n.split(/\r?\n/),i=Math.max(0,s.length-dv-2),r=[["$$","$$"],["\\[","\\]"]];for(let l=i;l<s.length-1;l++){const a=Rd(s[l]);for(const[c,u]of r){const d=ik(a,c,u);if(d===-1)continue;let f="",h=!1;for(let p=l+1;p<s.length;p++){if(p-l>dv){h=!0;break}const g=s[p],b=ju(g,u);if(b!==-1){const v=H_(f,g.slice(0,b));if(!hv(v)){h=!0;break}const m=g.slice(b+u.length),y=m.trim()?`suffix:${W_(m)}`:"nosuffix";return["closed",c,o+l,d,o+p,b,W_(v),y].join(":")}if(nM(g)){h=!0;break}if(f=H_(f,g),f.length>Z6){h=!0;break}}if(!h&&hv(f))return["pending",c,o+l,d].join(":")}}return null}function E0(e,t){const n=String(e??"").trim();return!n||!/^\d[\d,.]*\s*[~~-]\s*$/.test(n)?!1:/\d/.test(String(t??""))}function NG(e){const t=String(e??"").trimStart(),n=t.match(/^\d+(?:,\d{3})*(?:\.\d+)?/);if(!n)return!1;const o=t.slice(n[0].length);return/^\s*(?:[+\-*/^_=<>]|\\[a-z]+)/i.test(o)?!1:o===""||/^[)\s,.!?;:]/.test(o)}function T0(e){const t=String(e??"").trim();return t?/^(?:\.{3,}|…+)$/.test(t):!1}function IG(e,t){pG(e);const n=(r,l,a)=>{const c=String(l??"").replace(/^[\t ]+/,"").replace(/[\t ]+$/,"");if(!c)return;const u=r.push("paragraph_open","p",1);u.map=[a,a+1];const d=r.push("inline","",0);d.content=c,d.map=[a,a+1],d.children=[],r.push("paragraph_close","p",-1)},o=(r,l)=>{const a=r,c=!!t?.strictDelimiters,u=!a?.env?.__markstreamFinal,d=(m,y)=>{let k=y;for(;k<m.length&&(m[k]===" "||m[k]===" ");)k++;if(k===y||!(m[k]===`
190
+ `||m[k]==="\r"&&m[k+1]===`
191
+ `))return y;const A=m.slice(y,k),$=a.push("text","",0);return $.content=A,k};if(/^\*[^*]+/.test(a.src))return!1;if(a.src[a.pos]==="$"){let m=a.pos+1;for(;a.src[m]==="$";)m++;const y=m-a.pos,k=a.src[m];if(y>=3&&(!k||/\s/.test(k))){const A=a.push("text","",0);return A.content=a.src.slice(a.pos,m),a.pos=m,!0}}const f=[["$$","$$"],["$","$"],["\\(","\\)"]],h=String(a.pending??""),p=Math.max(0,a.pos-h.length);let g=p,b=p;const v=p;for(const[m,y]of f){const k=a.src,A=tM(k),$=SG(k,u);let I=!1;m==="$$"&&g!==v&&(g=v);let x=-1,L=-1,E=0;const F=S=>{if((S==="undefined"||S==null)&&(S=""),S==="\\"){a.pos=a.pos+S.length,g=a.pos;return}if(S==="\\)"||S==="\\("){const B=a.push("text_special","",0);B.content=S==="\\)"?")":"(",B.markup=S,a.pos=a.pos+S.length,g=a.pos;return}if(!S)return;if(m==="$$"&&S.includes("$")){let B=0;for(;B<S.length;){const U=fv(S,B);if(U===-1){const de=S.slice(B);if(de){const Ce=a.push("text","",0);Ce.content=de,a.pos=a.pos+de.length,g=a.pos}break}if(U>0&&S[U-1]==="$"||U+1<S.length&&S[U+1]==="$"){const de=S.slice(B,U+1);if(de){const Ce=a.push("text","",0);Ce.content=de,a.pos=a.pos+de.length,g=a.pos}B=U+1;continue}const H=S.slice(B,U);if(H){const de=a.push("text","",0);de.content=H,a.pos=a.pos+H.length,g=a.pos}const P=M0(S,U+1);if(P===-1){const de=S.slice(U),Ce=a.push("text","",0);Ce.content=de,a.pos=a.pos+de.length,g=a.pos;break}const Z=S.slice(U+1,P),K=Z.includes("`"),V=!Z||!Z.trim(),X=S[P+1],he=E0(Z,X),ne=T0(Z);if(!K&&!V&&!he&&!ne){const de=a.push("math_inline","math",0);de.content=rl(Z,t),de.markup="$",de.raw=`$${Z}$`,de.loading=!1,a.pos=a.pos+(P-U+1),g=a.pos,B=P+1;continue}const ue=a.push("text","",0);ue.content="$",a.pos=a.pos+1,g=a.pos,B=U+1}return}const N=S.indexOf("![");if(N!==-1){if(N>0){const H=S.slice(0,N),P=a.push("text","",0);P.content=H,a.pos=a.pos+H.length,g=a.pos}const B=S.slice(N).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(B){const[,H,P]=B,Z=P.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),K=Z?Z[1]:P,V=Z&&Z[2]?Z[2]:null,X=a.push("image","img",0);X.attrs=[["src",K],["alt",H]],V&&X.attrs.push(["title",V]),X.content=H,X.children=[{type:"text",content:H,tag:""}],a.pos=a.pos+B[0].length,g=a.pos;const he=S.slice(N+B[0].length);he&&F(he);return}const U=a.push("text","",0);U.content=S,a.pos=a.pos+S.length,g=a.pos;return}const D=a.push("text","",0);D.content=S,a.pos=a.pos+S.length,g=a.pos};for(;!(g>=k.length);){const S=k.indexOf(m,g);if(S===-1)break;if(Jd(k,S)){g=S+Math.max(1,m.length);continue}const N=_p(A,S);if(N){g=N[1];continue}const D=_p($,S);if(D){g=D[1];continue}if(S===x&&g===L){if(E++,E>2){g=S+Math.max(1,m.length);continue}}else E=0,x=S,L=g;if(m==="("&&S>0){let he=S-1;for(;he>=0&&k[he]===" ";)he--;if(he>=0&&k[he]==="]"){g=S+m.length;continue}}if(m==="$"&&S>0&&k[S-1]==="$"){g=S+1;continue}if(m==="$"&&S<k.length-1&&k[S+1]==="$"){g=S+2;continue}const B=m==="$"?M0(k,S+m.length):eG(k,S+m.length,m,y);if(B===-1){const he=k.slice(S+m.length);if(he.includes(m)){g=k.indexOf(m,S+m.length);continue}if(B===-1){const ne=m==="$"&&NG(he);if(u&&!c&&!ne&&Ac(he)&&!he.includes("`")){if(g=S+m.length,I=!0,!l){a.pending="";const ue=b?k.slice(b,g):k.slice(0,g),de=F_(ue)%2===1;if(b)F(k.slice(b,g));else{let Ce=k.slice(0,g);Ce.endsWith(m)&&(Ce=Ce.slice(0,Ce.length-m.length)),F(Ce)}if(de){const Ce=O_(ue)?.marker??"**",Ie=a.push("strong_open","",0);Ie.markup=Ce;const le=a.push("math_inline","math",0);le.content=rl(he,t),le.markup=m==="$$"?"$$":m==="\\("?"\\(\\)":m==="$"?"$":"()",le.raw=`${m}${he}${y}`,le.loading=!0,Ie.content=he,a.push("strong_close","",0)}else{const Ce=a.push("math_inline","math",0);Ce.content=rl(he,t),Ce.markup=m==="$$"?"$$":m==="\\("?"\\(\\)":m==="$"?"$":"()",Ce.raw=`${m}${he}${y}`,Ce.loading=!0}a.pos=k.length}g=k.length,b=g}break}}const U=k.slice(S+m.length,B),H=U.includes("`"),P=!U||!U.trim(),Z=m==="$",K=k[B+y.length],V=Z&&E0(U,K),X=Z&&T0(U);if(c?H||P||V||X:H||P||V||X||!Z&&!Ac(U)){g=B+y.length;const he=k.slice(a.pos,g);a.pending||(F(he),b=g);continue}if(I=!0,!l){const he=k.slice(a.pos-(a.pending??"").length,S);let ne=k.slice(0,g)?k.slice(b,S):he;const ue=F_(ne)%2===1;S!==a.pos&&ue&&(ne=a.pending+k.slice(a.pos,S));const de=ue?O_(ne):null,Ce=de?.marker??"**";if(a.pending!==ne)if(a.pending="",ue)if(de){const Ie=ne.slice(de.index+Ce.length);F(ne.slice(0,de.index));const le=a.push("strong_open","",0);le.markup=Ce;const z=a.push("text","",0);z.content=Ie,a.push("strong_close","",0)}else F(ne);else F(ne);if(ue){const Ie=a.push("strong_open","",0);Ie.markup=Ce;const le=a.push("math_inline","math",0);le.content=rl(U,t),le.markup=m==="$$"?"$$":m==="\\("?"\\(\\)":m==="$"?"$":"()",le.raw=`${m}${U}${y}`,le.loading=!1;const z=k.slice(B+y.length).startsWith(Ce);return z&&a.push("strong_close","",0),a.pos=d(k,B+y.length),g=a.pos,b=g,z||a.push("strong_close","",0),!0}else{const Ie=a.push("math_inline","math",0);Ie.content=rl(U,t),Ie.markup=m==="$$"?"$$":m==="\\("?"\\(\\)":m==="$"?"$":"()",Ie.raw=`${m}${U}${y}`,Ie.loading=!1}}return g=d(k,B+y.length),b=g,a.pos=g,!0}if(I){if(l)a.pos=g;else{if(m==="$$"&&g<k.length&&k.slice(g).includes("$")){let S=g;for(;!(S>=k.length);){const N=fv(k,S);if(N===-1)break;if(N+1<k.length&&k[N+1]==="$"){S=N+2;continue}if(N>0&&k[N-1]==="$"){S=N+1;continue}const D=M0(k,N+1);if(D===-1)break;const B=k.slice(N+1,D),U=B.includes("`"),H=!B||!B.trim(),P=k[D+1],Z=E0(B,P),K=T0(B);if(!U&&!H&&!Z&&!K){const V=k.slice(g,N);V&&F(V);const X=a.push("math_inline","math",0);X.content=rl(B,t),X.markup="$",X.raw=`$${B}$`,X.loading=!1,g=D+1,S=D+1}else F("$"),S=N+1}S<k.length&&F(k.slice(S))}else g<k.length&&F(k.slice(g));a.pos=k.length}return!0}}return!1},s=(r,l,a,c)=>{const u=r,d=!u?.env?.__markstreamFinal,f=t?.strictDelimiters,h=f?[["\\[","\\]"],["$$","$$"]]:[["\\[","\\]"],["[","]"],["$$","$$"]],p=u.bMarks[l]+u.tShift[l];let g=u.src.slice(p,u.eMarks[l]).trim(),b=!1,v="",m="",y=!1,k="",A=!1;for(const[V,X]of h)if(g.startsWith(V))if(V.includes("["))if(t?.strictDelimiters){if(g.replace("\\","")==="["){if(l+1<a){b=!0,v=V,m=X;break}continue}}else if(g.replace("\\","")==="["){if(l+1<a){b=!0,v=V,m=X;break}continue}else{const he=u.tokens[u.tokens.length-1];if(he&&he.type==="list_item_open"&&he.mark==="-"&&g.slice(V.length,g.indexOf("]")).trim()==="x")continue;if(g.replace("\\","").startsWith("[")&&!g.includes("](")){const ne=g.indexOf("]");if(g.slice(ne).trim()!=="]")continue;const ue=g.slice(V.length,ne);if(V==="["?R_(ue):Ac(ue)){b=!0,v=V,m=X;break}continue}}else{b=!0,v=V,m=X;break}else if((V==="$$"||V==="\\[")&&g.endsWith(V)&&l+1<a){const he=ik(g,V,X);if(he===-1)continue;k=Rd(g.slice(0,he)),A=!0;const ne=u.bMarks[l+1]+u.tShift[l+1];g=u.src.slice(ne,u.eMarks[l+1]).trim(),y=!0,b=!0,v=V,m=X;break}if(!b)return!1;if(c&&!A)return!0;const $=g.indexOf(v),I=$+v.length,x=!f&&v==="["?g.indexOf("\\]",I):-1,L=x>=0?"\\]":m,E=x>=0?x:ju(g,m,I);if(!y&&E>v.length){const V=g.slice($+v.length,E),X=u.push("math_block","math",0);X.content=rl(V),X.markup=v==="$$"?"$$":v==="["?"[]":"\\[\\]",X.map=[l,l+1],X.raw=`${v}${V}${L}`,X.block=!0,X.loading=!1,u.line=l+1;const he=g.slice(E+L.length);return he.trim()&&n(u,he,l),!0}let F=l,S="",N=!1,D="",B=l;const U=y?g:g===v?"":g.slice(v.length),H=!f&&v==="\\["?"]":"",P=ju(U,m);if(P!==-1){const V=P;S=U.slice(0,V),D=U.slice(V+m.length),B=y?l+1:l,N=!0,F=B}else for(U&&!y&&(S=U),F=l+1;F<a;F++){const V=u.bMarks[F]+u.tShift[F],X=u.eMarks[F],he=u.src.slice(V,X),ne=he.trim();if(!f&&v==="["&&ne==="\\]"){m="\\]",N=!0;break}if(H&&he.trim()===H){m=H,N=!0;break}if(ne===m){N=!0;break}else if(!f&&v==="["&&he.includes("\\]")){N=!0;const ue=he.indexOf("\\]");m="\\]";const de=he.slice(0,ue);de&&(S+=(S?`
192
+ `:"")+de),D=he.slice(ue+m.length),B=F;break}else if(ju(he,m)!==-1){N=!0;const ue=ju(he,m),de=he.slice(0,ue);de&&(S+=(S?`
193
+ `:"")+de),D=he.slice(ue+m.length),B=F;break}S+=(S?`
194
+ `:"")+he}if((!d||f)&&!N)return!1;const Z=/^\s*!\[/.test(S);if(!(A?!Z&&hv(S):v==="$$"?!Z:v==="["?R_(S):Ac(S)))return!1;if(c)return!0;k&&n(u,k,l);const K=u.push("math_block","math",0);return K.content=rl(S),K.markup=v==="$$"?"$$":v==="["?"[]":"\\[\\]",K.raw=`${v}${S}${S.startsWith(`
195
+ `)?`
196
+ `:""}${m}`,K.map=[l,F+1],K.block=!0,K.loading=!N,u.line=F+1,D.trim()&&n(u,D,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:s(r,l,a,c)};e.inline.ruler.before("escape","math",o),e.block.ruler.before("lheading","explicit_math_block",i,{alt:["paragraph","reference","blockquote","list"]}),e.block.ruler.before("paragraph","math_block",s,{alt:["paragraph","reference","blockquote","list"]})}function LG(e){const t=e.renderer.rules.image||function(n,o,s,i,r){const l=n,a=r;return a.renderToken?a.renderToken(l,o,s):""};e.renderer.rules.image=(n,o,s,i,r)=>{const l=n;return l[o].attrSet?.("loading","lazy"),t(l,o,s,i,r)},e.renderer.rules.fence=e.renderer.rules.fence||((n,o)=>{const s=n[o],i=String(s.info??"").trim();return`<pre class="${i?`language-${e.utils.escapeHtml(i.split(/\s+/g)[0])}`:""}"><code>${e.utils.escapeHtml(String(s.content??""))}</code></pre>`})}function $G(e={}){const t=e.markdownItOptions??{},n=typeof t.experimental=="object"&&t.experimental!==null?t.experimental:{},o=Object.prototype.hasOwnProperty.call(t,"stream")?!!t.stream:!0,s=Object.prototype.hasOwnProperty.call(t,"validateLink"),i=new bV({html:!0,linkify:!0,typographer:!0,...t,experimental:{stream:o,...n}});return s||i.set({validateLink:r=>!Ca(r,{tagName:"a",attrName:"href"})}),(e.enableMath??!0)&&IG(i,{...e.mathOptions??{}}),(e.enableContainers??!0)&&PV(i),e.enableFixIndentedCodeBlock!==!1&&aK(i),DK(i),zK(i),HK(i),VK(i),LG(i),rK(i,{customHtmlTags:e.customHtmlTags}),i}function Aa(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=>Aa(n))),t}function FG(e){const t=e.meta??{};return{type:"checkbox",checked:t.checked===!0,raw:t.checked?"[x]":"[ ]"}}function OG(e){const t=e,n=t.attrGet?t.attrGet("checked"):void 0,o=n===""||n==="true";return{type:"checkbox_input",checked:o,raw:o?"[x]":"[ ]"}}function RG(e){const t=String(e.content??"");return{type:"emoji",name:t,markup:String(e.markup??""),raw:`:${t}:`}}function Qf(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="em_close";){const l=e[i];s+=String(e[i].content??l.text??""),r.push(e[i]),i++}return o.push(...eo(r,void 0,void 0,n)),{node:{type:"emphasis",children:o,raw:`*${s}*`},nextIndex:i<e.length?i+1:e.length}}const z_=/\r?\n[ \t]*`+\s*$/,iM=["diff ","index ","--- ","+++ ","@@ "],BG=/\r?\n/;function DG(e){const t=String(e??"");return t?iM.some(n=>n.startsWith(t)||t.startsWith(n)):!1}function U_(e,t,n,o){n.length>0&&e.push(...n),o.length>0&&t.push(...o),n.length=0,o.length=0}function PG(e,t){const n=[],o=[],s=[],i=[],r=e.split(BG),l=/\r?\n$/.test(e),a=r.some(h=>h.startsWith("diff ")||h.startsWith("--- ")||h.startsWith("+++ ")||h.startsWith("@@ ")),c=h=>{const p=h;if(!iM.some(g=>p.startsWith(g)))if(p.startsWith("-")){const g=p.slice(1);s.push(!a&&g.startsWith(" ")?` ${g}`:g)}else if(p.startsWith("+")){const g=p.slice(1);i.push(!a&&g.startsWith(" ")?` ${g}`:g)}else{U_(n,o,s,i);const g=a&&p.startsWith(" ")?p.slice(1):p;n.push(g),o.push(g)}},u=l?Math.max(0,r.length-1):r.length;for(let h=0;h<u;h++){const p=r[h]??"";!t&&!l&&h===u-1&&DG(p)||c(p)}(t||s.length>0||i.length>0)&&U_(n,o,s,i);const d=n.join(`
197
+ `),f=o.join(`
198
+ `);return{original:t&&l&&d?`${d}
199
+ `:d,updated:t&&l&&f?`${f}
200
+ `:f}}function rk(e){const t=Array.isArray(e.map)&&e.map.length===2,n=e.meta??{},o=typeof n.closed=="boolean"?n.closed:void 0,s=o===!0||o!==!1&&t,i=String(e.info??""),r=i.startsWith("diff"),l=r?(()=>{const c=i,u=c.indexOf(" ");return u===-1?"":String(c.slice(u+1)??"")})():i;let a=String(e.content??"");if(z_.test(a)&&(a=a.replace(z_,"")),r){const{original:c,updated:u}=PG(a,s===!0);return{type:"code_block",language:l,code:String(u??""),raw:String(a??""),diff:r,loading:o===!0?!1:o===!1?!0:!t,originalCode:c,updatedCode:u}}return{type:"code_block",language:l,code:String(a??""),raw:String(a??""),diff:r,loading:o===!0?!1:o===!1?!0:!t}}function HG(e){const t=e.meta??{};return{type:"footnote_reference",id:String(t.label??""),raw:`[^${String(t.label??"")}]`}}function WG(){return{type:"hardbreak",raw:`\\
201
+ `}}function zG(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="mark_close";)s+=String(e[i].content??""),r.push(e[i]),i++;return o.push(...eo(r,void 0,void 0,n)),{node:{type:"highlight",children:o,raw:`==${s}==`},nextIndex:i<e.length?i+1:e.length}}let N0=null;const I0=new WeakMap;function q_(){return N0||(N0={customTagSet:null,allowedTagSet:$m()}),N0}function rM(e){const t=e.match(/^<\s*(?:\/\s*)?([\w-]+)/);return t?t[1].toLowerCase():""}function lM(e){return/^<\s*\//.test(e)}function aM(e,t){return/\/\s*>\s*$/.test(t)||Ha.has(e)}function UG(e){if(!e||e.length===0)return q_();const t=I0.get(e);if(t)return t;const n=e.map(_i).filter(Boolean);if(!n.length){const s=q_();return I0.set(e,s),s}const o={customTagSet:new Set(n),allowedTagSet:$m({customHtmlTags:e})};return I0.set(e,o),o}function cM(e){const t=e,n=t.raw??t.content??t.markup??"";return String(n??"")}function qG(e){const t=e.meta,n=t?.markstreamCustomHtmlRaw,o=t?.markstreamCustomHtmlInner;return typeof n=="string"&&typeof o=="string"?{raw:n,inner:o}:null}function Sp(e,t){const n=t.toLowerCase();for(let o=e.length-1;o>=0;o--){const[s,i]=e[o];if(String(s).toLowerCase()===n)return i}}function jG(e,t,n){const o=e.slice();return Sp(o,"href")||o.push(["href",t]),n!=null&&!Sp(o,"title")&&o.push(["title",n]),o}function pv(e){return e.map(cM).join("")}function Ch(e){const t=[],n=o=>{const s=String(o??"");if(!s)return;const i=t[t.length-1];if(i?.type==="text"){i.content=`${i.content}${s}`,i.raw=`${i.raw}${s}`;return}t.push({type:"text",content:s,raw:s})};for(const o of e)if(o){if(o.type==="reference"||o.type==="footnote_reference"){n(String(o.raw??""));continue}if("children"in o&&Array.isArray(o.children)){t.push({...o,children:Ch(o.children)});continue}t.push(o)}return t}function VG(e,t,n){let o=0;for(let s=t;s<e.length;s++){const i=e[s];if(i.type!=="html_inline")continue;const r=String(i.content??""),l=rM(r),a=lM(r),c=aM(l,r);if(!a&&!c&&l===n){o++;continue}if(a&&l===n){if(o===0)return s;o--}}return-1}function L0(e,t,n){const o=[e[t]];let s=[],i=t+1,r=!1;const l=n?VG(e,t+1,n):-1;return l!==-1?(s=e.slice(t+1,l),o.push(...s,e[l]),i=l+1,r=!0):(s=e.slice(t+1),s.length&&o.push(...s),i=e.length),{closed:r,html:pv(o),innerTokens:s,nextIndex:i}}function KG(e,t,n,o,s,i,r){const l=String(e.content??""),a=rM(l),{customTagSet:c,allowedTagSet:u}=UG(r?.customHtmlTags);if(!a)return[{type:"inline_code",code:l,raw:l},n+1];if(!u.has(a)&&!L0(t,n,a).closed){const A=cM(e);return[{type:"text",content:A,raw:A},n+1]}if(a==="br")return[{type:"hardbreak",raw:l},n+1];const d=lM(l),f=aM(a,l);if(d)return[{type:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];if(a==="a"){const A=L0(t,n,a),$=Nm(l),I=A.innerTokens,x=String(Sp($,"href")??""),L=Sp($,"title"),E=L==null?null:String(L),F=jG($,x,E),S=Ch(I.length?o(I,s,i,r):[]),N=I.length?pv(I):x||"";return!S.length&&N&&S.push({type:"text",content:N,raw:N}),[{type:"link",href:x,title:E,text:N,attrs:F,children:S,loading:!A.closed,raw:A.html||l},A.nextIndex]}if(f)return[{type:c?.has(a)?a:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];const h=L0(t,n,a);if(a==="p"||a==="div")return[{type:"paragraph",children:Ch(h.innerTokens.length?o(h.innerTokens,s,i,r):[]),raw:h.html},h.nextIndex];const p=Ch(h.innerTokens.length?o(h.innerTokens,s,i,r):[]);let g=h.html||l,b=!h.closed,v=!1;if(!h.closed){const A=`</${a}>`;g.toLowerCase().includes(A.toLowerCase())||(g+=A),v=!0,b=!0}const m=[],y=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let k;for(;(k=y.exec(l))!==null;){const A=k[1],$=k[2]||k[3]||k[4]||"";m.push([A,$])}if(c?.has(a)){const A=qG(e);return[{type:a,tag:a,attrs:m,content:A?A.inner:h.innerTokens.length?pv(h.innerTokens):"",children:h.innerTokens.length?o(h.innerTokens,s,i,r):[],raw:A?.raw??g,loading:e.loading||b,autoClosed:v},h.nextIndex]}return[{type:"html_inline",tag:a,attrs:m,content:g,children:p,raw:g,loading:b,autoClosed:v},h.nextIndex]}function uM(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=>uM(t)).join(""):String(e.content??"")}function GG(e){return!e||!Array.isArray(e.children)||e.children.length===0?"":e.children.map(t=>uM(t)).join("")}function j_(e,t=!1){let n=e.attrs??[],o=null;if((!n||n.length===0)&&Array.isArray(e.children))for(const d of e.children){const f=d.attrs;if(Array.isArray(f)&&f.length>0){n=f,o=d;break}}const s=String(n.find(d=>d[0]==="src")?.[1]??""),i=n.find(d=>d[0]==="alt")?.[1],r=GG(o??e);let l="";r?l=r:i!=null&&String(i).length>0?l=String(i):o?.content!=null&&String(o.content).length>0?l=String(o.content):Array.isArray(o?.children)&&o.children[0]?.content?l=String(o.children[0].content):Array.isArray(e.children)&&e.children[0]?.content?l=String(e.children[0].content):e.content!=null&&String(e.content).length>0&&(l=String(e.content));const a=n.find(d=>d[0]==="title")?.[1]??null,c=a===null?null:String(a),u=String(e.content??"");return{type:"image",src:s,alt:l,title:c,raw:u,loading:t}}function YG(e){const t=String(e.content??"");return{type:"inline_code",code:t,raw:t}}function ZG(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="ins_close";)s+=String(e[i].content??""),r.push(e[i]),i++;return o.push(...eo(r,void 0,void 0,n)),{node:{type:"insert",children:o,raw:`++${String(s)}++`},nextIndex:i<e.length?i+1:e.length}}function QG(e){const t=[];if(!Array.isArray(e))return t;for(const n of e){const o=n?.[0];o&&t.push([String(o),String(n?.[1]??"")])}return t}function Cp(e,t){const n=t.toLowerCase();for(let o=e.length-1;o>=0;o--){const[s,i]=e[o];if(String(s).toLowerCase()===n)return i}}function XG(e,t,n){const o=e.slice();return Cp(o,"href")||o.push(["href",t]),n!=null&&!Cp(o,"title")&&o.push(["title",n]),o}function Xf(e,t,n){const o=e[t],s=QG(o.attrs),i=String(Cp(s,"href")??""),r=Cp(s,"title"),l=r==null?null:String(r),a=XG(s,i,l);let c=t+1;const u=[];let d=!0;for(;c<e.length&&e[c].type!=="link_close";)u.push(e[c]),c++;e[c]?.type==="link_close"&&(d=!1);let f=u;const h=u[u.length-1];if(n?.__insideStrong&&h?.type==="text"&&String(h.content??"").endsWith("**")&&!u.some(b=>b.type==="strong_open")){const b=String(h.content??""),v=String(h.raw??b),m=Aa(h);m.content=b.slice(0,-2),m.raw=v.replace(/\*\*$/,""),f=u.slice(),f[f.length-1]=m}const p=eo(f,void 0,void 0,n),g=p.map(b=>{const v=b;return"content"in b?String(v.content??""):String(v.raw??"")}).join("");return{node:{type:"link",href:i,title:l,text:g,children:p,raw:`[${g}](${i}${l?` "${l}"`:""})`,loading:d,attrs:a},nextIndex:c<e.length?c+1:e.length}}function V_(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 JG(e){return{type:"reference",id:String(e.content??""),raw:String(e.markup??`[${e.content??""}]`)}}function K_(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="s_close";)s+=String(e[i].content??""),r.push(e[i]),i++;return o.push(...eo(r,void 0,void 0,n)),{node:{type:"strikethrough",children:o,raw:`~~${s}~~`},nextIndex:i<e.length?i+1:e.length}}const eY=/\\([\\()[\]`$|*_\-!])/g;function tY(e,t){if(!e)return;const n=String(e);if(n&&(n===t||n.replace(eY,"$1")===t))return n}function Fu(e,t,n,o){const s=[];let i="",r=t+1;const l=[];let a=1;for(;r<e.length;){if(e[r].type==="strong_close"){if(a===1)break;a--}e[r].type==="strong_open"&&a++,i+=String(e[r].content??""),l.push(e[r]),r++}const c={...o,__insideStrong:!0};return s.push(...eo(l,tY(n,i),void 0,c)),{node:{type:"strong",children:s,raw:`**${String(i)}**`},nextIndex:r<e.length?r+1:e.length}}function nY(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="sub_close";)s+=String(e[i].content??""),r.push(e[i]),i++;o.push(...eo(r,void 0,void 0,n));const l=String(e[t].content??""),a=s||l;return{node:{type:"subscript",children:o.length>0?o:[{type:"text",content:a,raw:a}],raw:`~${a}~`},nextIndex:i<e.length?i+1:e.length}}function oY(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="sup_close";)s+=String(e[i].content??""),r.push(e[i]),i++;return o.push(...eo(r,void 0,void 0,n)),{node:{type:"superscript",children:o.length>0?o:[{type:"text",content:s||String(e[t].content??""),raw:s||String(e[t].content??"")}],raw:`^${s||String(e[t].content??"")}^`},nextIndex:i<e.length?i+1:e.length}}function sY(e){const t=String(e.content??"");return{type:"text",content:t,raw:t}}const iY=/[^~]*~{2,}[^~]+/,rY=/\*\*/,lY=/[[_*^~]/,aY=/\\([\\()[\]`$|*_\-!])/g,lk=new Set(["\\","(",")","[","]","`","$","|","*","_","-","!"]),cY=/\s/u,uY=/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/,dY=/\p{P}/u,fY=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,hY=/:\/\//;function pY(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 dM(e,t=0){if(!e)return-1;let n=0;for(let o=0;o<e.length;o++){const s=e[o],i=e[o+1];if(s==="\\"&&i&&lk.has(i)){if(i==="*"&&n>=t){n++,o++;continue}n++,o++;continue}if(s==="*"&&n>=t)return n;n++}return-1}function Fl(e){return!!e&&cY.test(e)}function Ol(e){return!!e&&(uY.test(e)||dY.test(e))}function mY(e,t){const n=t>0?e[t-1]:void 0,o=e[t+1];return!o||Fl(o)?!1:!(Ol(o)&&n&&!Fl(n)&&!Ol(n))}function gY(e,t){const n=t>0?e[t-1]:void 0,o=e[t+1];return!n||Fl(n)?!1:!(Ol(n)&&o&&!Fl(o)&&!Ol(o))}function vY(e,t,n=0){let o=n,s=!1;for(;o<t.length;){const i=e?dM(e,o):t.indexOf("*",o);if(i===-1)break;if(gY(t,i))return{index:i,sawInvalidClose:s};s=!0,o=i+1}return{index:-1,sawInvalidClose:s}}function yY(e,t){const n=t>0?e[t-1]:void 0,o=e[t+2];return!o||Fl(o)?!1:!(Ol(o)&&n&&!Fl(n)&&!Ol(n))}function kY(e,t){const n=t>0?e[t-1]:void 0,o=e[t+2];return!n||Fl(n)?!1:!(Ol(n)&&o&&!Fl(o)&&!Ol(o))}function bY(e,t=0){let n=t,o=!1;for(;n<e.length;){const s=e.indexOf("**",n);if(s===-1)break;if(kY(e,s))return{index:s,sawInvalidClose:o};o=!0,n=s+2}return{index:-1,sawInvalidClose:o}}function xY(e){let t="",n=0;for(;n<e.length;){if(e[n]!=="\\"){t+=e[n],n++;continue}let o=0;for(;n+o<e.length&&e[n+o]==="\\";)o++;const s=e[n+o];if(t+="\\".repeat(Math.floor(o/2)),o%2===1){if(s&&lk.has(s)){t+=s,n+=o+1;continue}t+="\\"}n+=o}return t}function wY(e,t){let n=0;for(let o=0;o<e.length;o++){const s=e[o],i=e[o+1];if(s==="\\"&&i&&lk.has(i)){if(n===t)return o+1;n++,o++;continue}if(n===t)return o;n++}return-1}function _Y(e,t,n){const o=wY(e,t);if(o===-1||e[o]!==n)return!1;let s=0;for(let i=o-1;i>=0&&e[i]==="\\";i--)s++;return s%2===1}const SY=/[\p{L}\p{N}]/u,CY=/^[\p{L}\p{N}]+$/u;function mv(e){return e?SY.test(e):!1}function fM(e){return e?CY.test(e):!1}function rd(e,t){let n=t;for(;n<e.length&&e[n]==="*";)n++;const o=t>0?e[t-1]:void 0,s=n<e.length?e[n]:void 0;return{len:n-t,prev:o,next:s,intraword:mv(o)&&mv(s)}}function AY(e){const t=[];for(let n=0;n<e.length;){if(e[n]!=="*"){n++;continue}const o=rd(e,n),s=n+o.len;o.len>=2&&o.intraword&&t.push({start:n,end:s}),n=s}for(let n=0;n<t.length-1;n++){const o=t[n],s=t[n+1];if(!fM(e.slice(o.end,s.start)))return s.end}return-1}function MY(e){return!!e&&e.trim()===e&&/^[\p{L}\p{N}\s]+$/u.test(e)}function EY(e,t){let n=t;for(;n<e.length;){const o=e.indexOf("***",n);if(o===-1)return-1;const s=rd(e,o);if(s.len>=3)return o;n=o+s.len}return-1}function TY(e){return e?fY.test(e)||hY.test(e):!1}function NY(e,t){if(!e||!t)return null;const n=e.match(/\[([^\]\n]+)\]\(([^)]*)$/);return n&&n[2]===t?n[1]:null}function eo(e,t,n,o){if(!e||e.length===0)return[];const s=o?.__linkifyDemotionContext,i=Xd(t),r={filename:s?.filename||i.filename,explicitFilename:s?.explicitFilename||i.explicitFilename,marketTicker:s?.marketTicker||i.marketTicker};(r.filename||r.explicitFilename||r.marketTicker)&&(o={...o,__linkifyDemotionContext:r});const l=o,a=[];let c=null,u=0;const d=o?.requireClosingStrong,f=e;function h(){return e===f&&(e=e.slice()),e}function p(){c=null}function g(z,ae){const ie=e.length===1?t:String(ae.content??""),q=[],ee=AY(z);if(ee!==-1){A(z.slice(0,ee),z.slice(0,ee));const fe=z.slice(ee);return fe&&(E({type:"text",content:fe,raw:fe}),u--),u++,!0}if(iY.test(z)){const fe=z.indexOf("~~");fe!==-1&&q.push({type:"strikethrough",index:fe})}if(rY.test(z)){const fe=z.indexOf("**");fe!==-1&&q.push({type:"strong",index:fe})}if(/[^*]*\*[^*]+/.test(z)){const fe=ie?dM(ie,0):z.indexOf("*");if(ie&&fe===-1)return!1;fe!==-1&&q.push({type:"emphasis",index:fe})}q.sort((fe,ve)=>fe.index!==ve.index?fe.index-ve.index:fe.type===ve.type?0:fe.type==="strong"?-1:ve.type==="strong"?1:0);const ye=q[0];if(!ye)return!1;if(ye.type==="strikethrough"){const fe=ye.index,ve=fe>-1?z.slice(0,fe):"";if(ve&&A(ve,ve),fe===-1)return u++,!0;const j=z.indexOf("~~",fe+2),te=j===-1?z.slice(fe+2):z.slice(fe+2,j),me=j===-1?"":z.slice(j+2),{node:Ae}=K_([{type:"s_open",tag:"s",content:"",markup:"~~",info:"",meta:null},{type:"text",tag:"",content:te,markup:"",info:"",meta:null},{type:"s_close",tag:"s",content:"",markup:"~~",info:"",meta:null}],0,o);return p(),k(Ae),me&&(E({type:"text",content:me,raw:me}),u--),u++,!0}if(ye.type==="strong"){const fe=ye.index,ve=fe>-1?z.slice(0,fe):"";if(ve&&A(ve,ve),fe===-1)return u++,!0;if(t&&fe===0){let De=!1,ge=0;for(;ge<z.length&&z[ge]==="*";)ge++;if(t.startsWith("\\*")&&(De=!0),De){let Ne=0,et=0;for(;et<t.length&&Ne<ge;)if(t[et]==="\\"&&et+1<t.length&&t[et+1]==="*")Ne+=1,et+=2;else{if(t[et]==="*")break;et++}if(Ne>=2)return A(z,z),u++,!0}}if(t&&(z.match(/\*/g)||[]).length>pY(t))return A(z.slice(ve.length),z.slice(ve.length)),u++,!0;const j=rd(z,fe);if(j.len>=3){const De=EY(z,fe+j.len);if(De!==-1){const ge=z.slice(fe+j.len,De);if(MY(ge)){const{node:Ne}=Fu([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:ge,markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,o);p(),k(Ne);const et=z.slice(De+3);return et&&(E({type:"text",content:et,raw:et}),u--),u++,!0}}}if(!yY(z,fe)){const De=z.slice(fe,fe+j.len);A(De,De);const ge=z.slice(fe+j.len);return ge&&(E({type:"text",content:ge,raw:ge}),u--),u++,!0}const te=bY(z,fe+2);let me="",Ae="";if(te.index!==-1){me=z.slice(fe+2,te.index),Ae=z.slice(te.index+2);const De=te.index,ge=rd(z,De);if(j.intraword&&ge.intraword&&!fM(me)||!me&&j.len>=4&&j.intraword)return A(z.slice(ve.length),z.slice(ve.length)),u++,!0}else{if(d||te.sawInvalidClose||j.intraword)return A(z.slice(ve.length),z.slice(ve.length)),u++,!0;me=z.slice(fe+2),Ae=""}if(!me&&/^\*+$/.test(Ae))return A(z,z),u++,!0;const{node:$e}=Fu([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"text",tag:"",content:me,markup:"",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,o);return p(),k($e),Ae&&(E({type:"text",content:Ae,raw:Ae}),u--),u++,!0}if(ye.type==="emphasis"){let fe=ye.index;fe===-1&&(fe=0);const ve=z.slice(0,fe);if(ve&&A(ve,ve),!mY(z,fe)){A(z[fe],z[fe]);const De=z.slice(fe+1);return De&&(E({type:"text",content:De,raw:De}),u--),u++,!0}const j=rd(z,fe),te=vY(ie,z,fe+1),me=te.index,Ae=e[u+1];if(o?.final&&Ae?.type==="em_open"&&me!==-1&&z.slice(fe+1,me).trim()!==z.slice(fe+1,me)||me===-1&&(te.sawInvalidClose||o?.final||j.intraword||!mv(z[fe+1])))return A(z.slice(fe),z.slice(fe)),u++,!0;const{node:$e}=Qf([{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:me>-1?z.slice(fe+1,me):z.slice(fe+1),markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null}],0,o);if(p(),k($e),me!==-1&&me<z.length-1){const De=z.slice(me+1);De&&(E({type:"text",content:De,raw:De}),u--)}return u++,!0}return!1}function b(z,ae){if(!z.includes("`"))return!1;const q=(Ae=>{for(let $e=0;$e<Ae.length;$e++){if(Ae[$e]!=="`")continue;let De=0;for(let ge=$e-1;ge>=0&&Ae[ge]==="\\";ge--)De++;if(De%2===0)return $e}return-1})(z);if(q===-1)return!1;let ee=1;for(let Ae=q+1;Ae<z.length&&z[Ae]==="`";Ae++)ee++;const ye="`".repeat(ee),fe=q+ee,ve=z.indexOf(ye,fe);if(ve===-1){if(ee===1){const $e=z.slice(0,q),De=z.slice(q+1);return $e&&(g($e,ae)?u--:A($e,$e)),m({type:"inline_code",code:De,raw:String(De)}),u++,!0}let Ae=z;for(let $e=u+1;$e<e.length;$e++)Ae+=String((e[$e].content??"")+(e[$e].markup??""));return u=e.length-1,A(Ae,Ae),u++,!0}p();const j=z.slice(0,q),te=z.slice(q+ee,ve),me=z.slice(ve+ee);return j&&(g(j,ae)?u--:A(j,j)),m({type:"inline_code",code:te,raw:String(te??"")}),me&&(E({type:"text",content:me,raw:me}),u--),u++,!0}function v(z){const ae=l?.__markdownIt;if(!ae||e.length<=1||!e.some(ye=>ye?.type==="math_inline")||!lY.test(z))return null;const ie=ae.parseInline(z,{__markstreamFinal:!!o?.final});if(!Array.isArray(ie)||ie.length===0)return null;const q=(ie.find(ye=>ye?.type==="inline")?.children??[]).filter(ye=>!(ye?.type==="text"&&String(ye.content??"")===""));if(!q.length||!q.some(ye=>ye?.type!=="text")||q.length===1&&q[0]?.type==="text"&&String(q[0].content??"")===z)return null;const ee=eo(q,z,n,o);return ee.length?ee:null}function m(z){p(),a.push(z)}function y(z){p();const ae=Aa(z);a.push(ae)}function k(z){m(z)}function A(z,ae){c?(c.content+=z,c.raw+=ae??z):(c={type:"text",content:String(z??""),raw:String(ae??z??"")},a.push(c))}function $(z,ae){if(!z)return;const ie=eo([{...ae,type:"text",content:z,raw:z}],z,n,o);if(ie.length===1&&ie[0]?.type==="text"){const q=ie[0];A(String(q.content??""),String(q.raw??q.content??""));return}for(const q of ie)k(q)}function I(z,ae){return String(z.markup??"").startsWith(ae)}function x(z){return z.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 L(z,ae){let ie=z;const q=String(ae.content??"");return ie.endsWith("\\")&&!I(ae,"\\\\")&&!q.endsWith("\\\\")&&(ie=ie.slice(0,-1)),ie.endsWith("(")&&!I(ae,"\\(")&&!q.endsWith("\\(")&&(ie=ie.slice(0,-1)),/\*+$/.test(ie)&&!I(ae,"\\*")&&!q.endsWith("\\*")&&(ie=ie.replace(/\*+$/,"")),ie}for(;u<e.length;){const z=e[u];E(z)}function E(z){switch(z.type){case"text":S(z);break;case"softbreak":c?(c.content+=`
202
+ `,c.raw+=`
203
+ `):(c={type:"text",content:`
204
+ `,raw:`
205
+ `},a.push(c)),u++;break;case"code_inline":k(YG(z)),u++;break;case"html_inline":{const[ae,ie]=KG(z,e,u,eo,t,n,o);k(ae),u=ie;break}case"link_open":N(z);break;case"image":he(z)||(p(),k(j_(z)),u++);break;case"strong_open":{p();const{node:ae,nextIndex:ie}=Fu(e,u,z.content,o);k(ae),u=ie;break}case"em_open":{p();const{node:ae,nextIndex:ie}=Qf(e,u,o);k(ae),u=ie;break}case"s_open":{p();const{node:ae,nextIndex:ie}=K_(e,u,o);k(ae),u=ie;break}case"mark_open":{p();const{node:ae,nextIndex:ie}=zG(e,u,o);k(ae),u=ie;break}case"ins_open":{p();const{node:ae,nextIndex:ie}=ZG(e,u,o);k(ae),u=ie;break}case"sub_open":{p();const{node:ae,nextIndex:ie}=nY(e,u,o);k(ae),u=ie;break}case"sup_open":{p();const{node:ae,nextIndex:ie}=oY(e,u,o);k(ae),u=ie;break}case"sub":p(),k({type:"subscript",children:[{type:"text",content:String(z.content??""),raw:String(z.content??"")}],raw:`~${String(z.content??"")}~`}),u++;break;case"sup":p(),k({type:"superscript",children:[{type:"text",content:String(z.content??""),raw:String(z.content??"")}],raw:`^${String(z.content??"")}^`}),u++;break;case"emoji":{p();const ae=e[u-1];ae?.type==="text"&&/\|:-+/.test(String(ae.content??""))?A("",""):k(RG(z)),u++;break}case"checkbox":p(),k(FG(z)),u++;break;case"checkbox_input":p(),k(OG(z)),u++;break;case"footnote_ref":p(),k(HG(z)),u++;break;case"footnote_anchor":{p();const ae=z.meta??{};m({type:"footnote_anchor",id:String(ae.label??z.content??""),raw:String(z.content??"")}),u++;break}case"hardbreak":p(),k(WG()),u++;break;case"fence":p(),k(rk(e[u])),u++;break;case"math_inline":p(),!z.content&&z.markup==="$"&&e[u+1]?.type==="text"&&e[u+2]?.type==="math_inline"?(k(V_({...z,content:e[u+1].content})),u+=2):k(V_(z)),u++;break;case"reference":B(z);break;case"text_special":A(String(z.content??""),String(z.content??"")),u++;break;default:{const ae=z;if(z.type==="link"&&ae.href!=null&&o?.validateLink&&!o.validateLink(String(ae.href))){p();const ie=String(ae.text??"");A(ie,ie),u++}else ne(z)||H(z)||Z(z)||U(z)||y(z),u++;break}}}function F(z,ae,ie,q){const ee=sY({...ae,content:z});if(c){c.content+=L(ee.content,ae),c.raw+=ee.raw;return}const ye=ie?.tag==="br"&&e[u-2]?.content==="[";q||(ee.content=L(ee.content,ae)),c=ee,c.center=ye,a.push(c)}function S(z){const ae=String(z.content??""),ie=e.length===1&&ae.includes("\\")&&typeof t=="string"?String(t):"";let q=ie?xY(ie):ae.replace(aY,"$1");if(z.content==="<"||q==="1"&&e[u-1]?.tag==="br"){u++;return}const ee=q.indexOf("$");ee!==-1&&ee===q.lastIndexOf("$")&&q.endsWith("$")&&(q=q.slice(0,-1)),q.endsWith("undefined")&&!t?.endsWith("undefined")&&(q=q.slice(0,-9));let ye=a.length,fe="";for(let me=a.length-1;me>=0;me--){const Ae=a[me];if(Ae.type!=="text")break;ye=me,fe=String(Ae.content??"")+fe}ye<a.length&&(q.startsWith(fe)?(c=null,a.length=ye):c=a[a.length-1]);const ve=e[u+1];if((q==="`"||q==="|"||q==="$")&&!I(z,`\\${q}`)||/^\*+$/.test(q)&&!I(z,"\\*")){u++;return}if(!ve&&/[^\]]\s*\(\s*$/.test(q)&&(q=q.replace(/\(\s*$/,"")),!q){u++;return}if(X(q)||ue(q))return;if(!(q.includes("*")||q.includes("_")||q.includes("~")||q.includes("`")||q.includes("[")||q.includes("!")||q.includes("$")||q.includes("|")||q.includes("("))){F(q,z,e[u-1],ve),u++;return}if(le(q))return;const j=e[u-1];if(q==="["&&!ve?.markup?.includes("*")&&!I(z,"\\[")||q==="]"&&!j?.markup?.includes("*")&&!I(z,"\\]")){u++;return}if(b(ae,z)||Ie(q)||(e[u+1]?.type!=="link_open"||x(q))&&Ce(q,z))return;const te=v(ae);if(te){p();for(const me of te)k(me);u++;return}g(q,z)||(F(q,z,j,ve),u++)}function N(z){if(D(z))return;if(de()){const{node:ve,nextIndex:j}=Xf(e,u,o),te=String(ve.text||ve.href||"");A(te,te),u=j;return}p();const{node:ae,nextIndex:ie}=Xf(e,u,o);u=ie;const q=ae.text||ae.href||"";if(z.markup==="linkify"&&!j6(q,ae.href,t)&&xp(q,l?.__linkifyDemotionContext)){A(q,q);return}const ee=ae.children.length===1&&ae.children[0]?.type==="text";if(ae.loading&&t&&ae.text===ae.href&&ee){const ve=NY(t,ae.href);ve&&(ae.text=ve,ae.children=[{type:"text",content:ve,raw:ve}],ae.raw=`[${ve}](${ae.href}${ae.title?` "${ae.title}"`:""})`)}if(o?.validateLink&&!o.validateLink(ae.href)){A(ae.text,ae.text);return}const ye=z.attrs?.find(([ve])=>ve==="href")?.[1],fe=String(ye??"");if(t&&fe){const ve=t.indexOf("](");if(ve!==-1){const j=t.indexOf(")",ve+2);j===-1?ae.loading=!0:ae.loading&&t.slice(ve+2,j).includes(fe)&&(ae.loading=!1)}}U(ae)||m(ae)}function D(z){if(z.markup!=="linkify")return!1;const{node:ae,nextIndex:ie}=Xf(e,u,o);return P(ae,ie)?(u=ie,!0):!1}function B(z){p(),k(JG(z)),u++}function U(z){if(z.type!=="link")return!1;const ae=a[a.length-1];if(!ae||ae.type!=="text")return!1;const ie=String(ae.content??"").match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!ie)return!1;const q=z,ee=String(q.href??""),ye=String(q.text??""),fe=String(ie[2]??""),ve=ee.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,"");if(!ee||!(ye===ee||ye===ve||TY(ye)))return!1;const j=String(ie[1]??"");return j?(ae.content=j,ae.raw=j):a.pop(),m({...z,text:fe,children:[{type:"text",content:fe,raw:fe}],raw:`[${fe}](${ee}${q.title?` "${q.title}"`:""})`}),!0}function H(z){if(z.type!=="link")return!1;const ae=z,ie=String(ae.href??"");return ie?P({href:ie,title:ae.title==null||ae.title===""?null:String(ae.title),loading:!!ae.loading},u+1):!1}function P(z,ae){const ie=a[a.length-1];if(ie?.type!=="image"||ie.src||!ie.loading||!String(ie.raw??"").endsWith("]("))return!1;const q=e[ae],ee=String(q?.content??"");if(q?.type!=="text"||!ee.startsWith(")"))return!1;a.pop(),c=null;const ye=String(ie.alt??"");m({type:"image",src:z.href,alt:ye,title:z.title,raw:`![${ye}](${z.href}${z.title?` "${z.title}"`:""})`,loading:!!z.loading});const fe=ee.slice(1),ve=Aa(q);return ve.content=fe,ve.raw=fe,h()[ae]=ve,!0}function Z(z){if(z.type!=="link")return!1;const ae=a[a.length-1],ie=e[u-1];if(!ae||ae.type!=="text"||ie?.type!=="text")return!1;const q=String(ae.content??""),ee=String(ie.content??"");if(!q.endsWith("!")||!ee.endsWith("!")||I(ie,"\\!"))return!1;const ye=q.slice(0,-1);ye?(ae.content=ye,ae.raw=ye,c=ae):(a.pop(),c=null);const fe=z,ve=String(fe.text??fe.children?.map(me=>String(me?.content??me?.raw??"")).join("")??""),j=String(fe.href??""),te=fe.title==null||fe.title===""?null:String(fe.title);return m({type:"image",src:j,alt:ve,title:te,raw:`![${ve}](${j}${te?` "${te}"`:""})`,loading:!!fe.loading}),!0}function K(z,ae="",ie=null){const q=String(z.alt??z.raw??"");return{type:"link",href:ae,title:ie,text:q,children:[z],raw:`[${q}](${ae}${ie?` "${ie}"`:""})`,loading:!0}}function V(z){const ae=z.startsWith("![")?z:`![${z}`,ie=ae.slice(2),q=ie.indexOf("](");return{type:"image",src:"",alt:q===-1?ie.replace(/\]$/,""):ie.slice(0,q),title:null,raw:ae,loading:!0}}function X(z){const ae=z.indexOf("[![");if(ae===-1||typeof t=="string"&&e.length===1&&_Y(t,ae,"["))return!1;const ie=z.slice(0,ae);return ie&&A(ie,ie),m(K(V(z.slice(ae+1)))),u++,!0}function he(z){if(o?.final)return!1;const ae=e[u-1];if(ae?.type!=="text"||!String(ae.content??"").endsWith("[")||I(ae,"\\["))return!1;const ie=a[a.length-1];if(ie?.type==="text"&&ie.content.endsWith("[")){const q=ie.content.slice(0,-1);q?(ie.content=q,ie.raw=q,c=ie):(a.pop(),c=null)}return m(K(j_(z))),u++,!0}function ne(z){if(z.type!=="link")return!1;const ae=z,ie=String(ae.raw??""),q=String(ae.text??"");if(!ie.startsWith("[![")&&!q.startsWith("!["))return!1;const ee=ae.title==null||ae.title===""?null:String(ae.title);return m(K({type:"image",src:String(ae.href??""),alt:q.replace(/^!\[/,"").replace(/\]$/,""),title:ee,raw:ie.startsWith("[![")?ie.slice(1):ie,loading:!0})),!0}function ue(z){if(!z.startsWith("]("))return!1;const ae=e[u-2];if(ae?.type==="text"&&String(ae.content??"").endsWith("[")&&I(ae,"\\["))return!1;const ie=a[a.length-1];if(ie?.type!=="image"&&ie?.type!=="link")return!1;const q=ie,ee=ie?.type==="link"&&Array.isArray(q.children)&&q.children.length===1&&q.children[0]?.type==="image"?a.pop():null,ye=ee?ee.children[0]:a.pop();if(!ye||ye.type!=="image")return!1;const fe=e[u+1];let ve=String(ee?.href??""),j=ee?.title==null?null:String(ee.title),te=!0;if(fe?.type==="link_open"){const{node:Ae,nextIndex:$e}=Xf(e,u+1,o);ve=Ae.href,j=Ae.title,te=!0,u=$e}else{if(ve=z.slice(2),ve.includes('"')){const Ae=ve.split('"');ve=String(Ae[0]??"").trim(),j=Ae[1]==null?null:String(Ae[1]).trim()}u++}const me=K(ye,ve,j);return me.loading=te,m(me),!0}function de(){const z=e[u-3];return e[u-2]?.type==="image"&&e[u-1]?.type==="text"&&String(e[u-1].content??"")==="]("&&z?.type==="text"&&String(z.content??"").endsWith("[")&&I(z,"\\[")}function Ce(z,ae){const ie=z.indexOf("[");if(ie===-1)return!1;let q=z.slice(0,ie);const ee=z.indexOf("](",ie);if(ee!==-1){const ye=e[u+2];let fe=z.slice(ie+1,ee);if(fe.includes("[")){const De=fe.indexOf("[");q+=z.slice(0,ie+De+1);const ge=ie+De+1;fe=z.slice(ge+1,ee)}const ve=e[u+1];if(z.endsWith("](")&&ve?.type==="link_open"&&ye){const De=e[u+4];let ge=4,Ne=!0;if(De?.type==="text"){const rt=String(De.content??"");if(rt.startsWith(")")){Ne=!1;const _t=rt.slice(1);if(_t){const gt=Aa(De);gt.content=_t,gt.raw=_t,h()[u+4]=gt}else ge++}else rt==="."&&ge++}$(q,ae);const et=String(ye.content??"");return o?.validateLink&&!o.validateLink(et)?A(fe,fe):m({type:"link",href:et,title:null,text:fe,children:[{type:"text",content:fe,raw:fe}],loading:Ne}),u+=ge,!0}const j=z.indexOf(")",ee),te=j!==-1?z.slice(ee+2,j):"",me=j===-1;let Ae=q.match(/\*+$/);if(Ae&&(q=q.replace(/\*+$/,"")),$(q,ae),Ae||(Ae=fe.match(/^\*+/)),!d&&Ae){const De=Ae[0].length;fe=fe.replace(/^\*+/,"").replace(/\*+$/,"");const ge=[];if(De===1?ge.push({type:"em_open",tag:"em",nesting:1}):De===2?ge.push({type:"strong_open",tag:"strong",nesting:1}):De===3&&(ge.push({type:"strong_open",tag:"strong",nesting:1}),ge.push({type:"em_open",tag:"em",nesting:1})),ge.push({type:"link",href:te,title:null,text:fe,children:[{type:"text",content:fe,raw:fe}],loading:me}),De===1){ge.push({type:"em_close",tag:"em",nesting:-1});const{node:Ne}=Qf(ge,0,o);k(Ne)}else if(De===2){ge.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Ne}=Fu(ge,0,void 0,o);k(Ne)}else if(De===3){ge.push({type:"em_close",tag:"em",nesting:-1}),ge.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Ne}=Fu(ge,0,void 0,o);k(Ne)}else{const{node:Ne}=Qf(ge,0,o);k(Ne)}}else o?.validateLink&&!o.validateLink(te)?A(fe,fe):m({type:"link",href:te,title:null,text:fe,children:[{type:"text",content:fe,raw:fe}],loading:me});const $e=j!==-1?z.slice(j+1):"";return $e&&(E({type:"text",content:$e,raw:$e}),u--),u++,!0}return!1}function Ie(z){const ae=z.indexOf("![");if(ae===-1)return!1;const ie=z.slice(0,ae);return ie&&!c?c={type:"text",content:ie,raw:ie}:ie&&c&&(c.content+=ie),c&&(a.push(c),c=null),m(V(z.slice(ae))),u++,!0}function le(z){if(!(z?.startsWith("[")&&n?.type==="list_item_open"))return!1;const ae=z.slice(1).match(/[^\s\]]/);if(ae===null)return u++,!0;if(ae&&/x/i.test(ae[0])){const ie=ae[0]==="x"||ae[0]==="X";return m({type:"checkbox_input",checked:ie,raw:ie?"[x]":"[ ]"}),u++,!0}return!1}return a}function IY(e){const t=String(e.content??""),n=t.replace(/[ \t\r\n]+$/g,"");if(n===t)return;e.content=n;const o=e.children;if(!(!Array.isArray(o)||o.length===0))for(;o.length;){const s=o[o.length-1];if(!s){o.pop();continue}if(s.type==="softbreak"||s.type==="hardbreak"){o.pop();continue}if(s.type==="text"){const i=String(s.content??""),r=i.replace(/[ \t\r\n]+$/g,"");if(r===i)break;if(r){s.content=r;break}o.pop();continue}break}}function LY(e){const t=String(e.content??""),n=t.match(/\r?\n\s*\d+[.)]?\s*$/);if(!n||typeof n.index!="number")return;e.content=t.slice(0,n.index);const o=e.children;if(!(!Array.isArray(o)||o.length===0))for(;o.length;){const s=o[o.length-1];if(!s){o.pop();continue}if(s.type==="softbreak"||s.type==="hardbreak"){o.pop();continue}if(s.type==="text"){const i=String(s.content??"");if(/^[ \t\r\n\d.)]*$/.test(i)){o.pop();continue}const r=i.replace(/[ \t\r\n\d.)]+$/g,"");r!==i&&(r?s.content=r:o.pop())}break}}function $Y(e){const t=String(e.content??"");return/[ \t\r\n]+$/.test(t)||/\r?\n\s*\d+[.)]?\s*$/.test(t)}function lu(e,t,n){const o=e[t],s=[],i=Hl(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=$Y(c)?Aa(c):c,d=e[a-1];u!==c&&(LY(u),IY(u));const f=String(u.content??"");l.push({type:"paragraph",children:eo(u.children||[],f,d,i.options()),raw:f}),i.remember(f),a+=3}else if(e[a].type==="blockquote_open"){const[c,u]=au(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]=lu(e,a,i.options());l.push(c),i.remember(c.raw),a=u}else{const c=ck(e,a,i.options(),ak);c?(l.push(c[0]),i.remember(c[0].raw),a=c[1]):a+=1}s.push({type:"list_item",children:l,raw:l.map(c=>c.raw).join("")}),r=a+1}else r+=1;return[{type:"list",ordered:o.type==="ordered_list_open",start:(()=>{if(o.attrs&&o.attrs.length){const l=o.attrs.find(a=>a[0]==="start");if(l){const a=Number(l[1]);return Number.isFinite(a)&&a!==0?a:1}}})(),items:s,raw:s.map(l=>l.raw).join(`
206
+ `)},r+1]}function FY(e,t,n,o){const s=String(n[1]??"note"),i=String(n[2]??s.charAt(0).toUpperCase()+s.slice(1)),r=[],l=Hl(o,!0);let a=t+1;for(;a<e.length&&e[a].type!=="container_close";)if(e[a].type==="paragraph_open"){const c=e[a+1];if(c){const u={type:"paragraph",children:eo(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]=lu(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else if(e[a].type==="blockquote_open"){const[c,u]=au(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else{const c=Im(e,a,l.options());c?(r.push(c[0]),l.remember(c[0].raw),a=c[1]):a++}return[{type:"admonition",kind:s,title:i,children:r,raw:`:::${s} ${i}
207
+ ${r.map(c=>c.raw).join(`
208
+ `)}
209
+ :::`},a+1]}const OY=new Set(["warning","info","note","tip","danger","caution"]);function RY(e){let t=0;for(;t<e.length&&t<3&&e[t]===":";)t++;if(t===0||e[t]===":")return null;const n=e.slice(t).trimStart();if(!n)return null;const o=n.search(/\s/),s=(o===-1?n:n.slice(0,o)).toLowerCase();return OY.has(s)?{kind:s,title:o===-1?"":n.slice(o).trim()}:null}function BY(e,t,n){const o=e[t];let s="note",i="";const r=o.type.match(/^container_(\w+)_open$/);if(r){s=r[1];const d=String(o.info??"").trim();if(d&&!d.startsWith(":::")&&d.toLowerCase().startsWith(s)){const f=d.slice(s.length).trim();f&&(i=f)}}else{const d=RY(String(o.info??"").trim());d&&(s=d.kind,i=d.title)}i||(i=s.charAt(0).toUpperCase()+s.slice(1));const l=[],a=Hl(n,!0);let c=t+1;const u=new RegExp(`^container_${s}_close$`);for(;c<e.length&&e[c].type!=="container_close"&&!u.test(e[c].type);)if(e[c].type==="paragraph_open"){const d=e[c+1];if(d){const f=d.children||[];let h=-1;for(let g=f.length-1;g>=0;g--){const b=f[g];if(b.type==="text"&&/:+/.test(b.content)){h=g;break}}const p={type:"paragraph",children:eo((h!==-1?f.slice(0,h):f)||[],void 0,void 0,a.options()),raw:String(d.content??"").replace(/\n:+$/,"").replace(/\n\s*:::\s*$/,"")};l.push(p),a.remember(p.raw)}c+=3}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[d,f]=lu(e,c,a.options());l.push(d),a.remember(d.raw),c=f}else if(e[c].type==="blockquote_open"){const[d,f]=au(e,c,a.options());l.push(d),a.remember(d.raw),c=f}else{const d=Im(e,c,a.options());d?(l.push(d[0]),a.remember(d[0].raw),c=d[1]):c++}return[{type:"admonition",kind:s,title:i,children:l,raw:`:::${s} ${i}
210
+ ${l.map(d=>d.raw).join(`
211
+ `)}
212
+ :::`},c+1]}const DY=/^::: ?(warning|info|note|tip|danger|caution|error) ?(.*)$/;function PY(e,t,n){const o=e[t];if(o.type!=="container_open")return null;const s=DY.exec(String(o.info??""));return s?FY(e,t,s,n):null}const ak={parseContainer:(e,t,n)=>BY(e,t,n),matchAdmonition:PY};function au(e,t,n){const o=[],s=Hl(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:eo(r.children||[],String(r.content??""),void 0,s.options()),raw:String(r.content??"")};o.push(l),s.remember(l.raw),i+=3;break}case"bullet_list_open":case"ordered_list_open":{const[r,l]=lu(e,i,s.options());o.push(r),s.remember(r.raw),i=l;break}case"blockquote_open":{const[r,l]=au(e,i,s.options());o.push(r),s.remember(r.raw),i=l;break}default:{const r=ck(e,i,s.options(),ak);r?(o.push(r[0]),s.remember(r[0].raw),i=r[1]):i++;break}}return[{type:"blockquote",children:o,raw:o.map(r=>r.raw).join(`
213
+ `)},i+1]}function HY(e){if(e.info?.startsWith("diff"))return rk(e);const t=String(e.content??""),n=t.match(/ type="application\/vnd\.ant\.([^"]+)"/);let o=t;n?.[1]&&(o=t.replace(/<antArtifact[^>]*>/g,"").replace(/<\/antArtifact>/g,""));const s=Array.isArray(e.map)&&e.map.length===2;return{type:"code_block",language:n?n[1]:String(e.info??""),code:o,raw:o,loading:!s}}function WY(e,t,n){const o=[];let s=t+1,i=[],r=[];const l=Hl(n,!0);for(;s<e.length&&e[s].type!=="dl_close";)if(e[s].type==="dt_open"){const a=e[s+1];i=eo(a.children||[],void 0,void 0,l.options()),l.remember(i.map(c=>c.raw).join("")),s+=3}else if(e[s].type==="dd_open"){let a=s+1;for(r=[];a<e.length&&e[a].type!=="dd_close";)if(e[a].type==="paragraph_open"){const c=e[a+1];r.push({type:"paragraph",children:eo(c.children||[],String(c.content??""),void 0,l.options()),raw:String(c.content??"")}),l.remember(String(c.content??"")),a+=3}else a++;i.length>0&&(o.push({type:"definition_item",term:i,definition:r,raw:`${i.map(c=>c.raw).join("")}: ${r.map(c=>c.raw).join(`
214
+ `)}`}),i=[]),s=a+1}else s++;return[{type:"definition_list",items:o,raw:o.map(a=>a.raw).join(`
215
+ `)},s+1]}function zY(e,t,n){const o=e[t].meta??{},s=String(o?.label??"0"),i=[],r=Hl(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:eo(c,String(a.content??""),void 0,r.options()),raw:String(a.content??"")};i.push(u),r.remember(u.raw),l+=3}else l++;return[{type:"footnote",id:s,children:i,raw:`[^${s}]: ${i.map(a=>a.raw).join(`
216
+ `)}`},l+1]}function UY(e,t,n){const o=e[t],s=o.attrs,i=Array.isArray(s)&&s.length?Object.fromEntries(s.filter(u=>Array.isArray(u)&&u.length>=1&&u[0]).map(([u,d])=>[String(u),d==null||d===""?!0:String(d)])):void 0,r=String(o.tag?.substring(1)??"1"),l=Number.parseInt(r,10),a=e[t+1],c=String(a.content??"");return{type:"heading",level:l,text:c,...i?{attrs:i}:{},children:eo(a.children||[],c,void 0,n),raw:c}}function qY(e,t,n){const o=t.toLowerCase(),s=new RegExp(String.raw`^<\s*${o}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${o}(?=\s|>)`,"i");let r=0,l=Math.max(0,n);for(;l<e.length;){const a=e.indexOf("<",l);if(a===-1)return-1;const c=e.slice(a);if(i.test(c)){const u=Jn(c);if(u===-1)return-1;if(r===0)return a+u+1;r--,l=a+u+1;continue}if(s.test(c)){const u=Jn(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 hM(e){const t=String(e.content??"");if(/^\s*<!--/.test(t)||/^\s*<!/.test(t)||/^\s*<\?/.test(t))return{type:"html_block",content:t,raw:t,tag:"",loading:!1};const n=(t.match(/^\s*<([A-Z][\w:-]*)/i)?.[1]||"").toLowerCase();if(!n)return{type:"html_block",content:t,raw:t,tag:"",loading:!1};const o=Jn(t),s=o===-1?t:t.slice(0,o+1),i=o!==-1&&/\/\s*>$/.test(s),r=Ha.has(n),l=Nm(s),a=(o===-1?-1:qY(t,n,o+1))!==-1,c=!(r||i||a);return{type:"html_block",content:c?`${t.replace(/<[^>]*$/,"")}
217
+ </${n}>`:t,raw:t,tag:n,attrs:l.length?l:void 0,loading:c}}function jY(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 VY(e){if(!e)return"left";for(const t of e){if(!t)continue;const[n,o]=t;if(!o)continue;const s=String(o).trim().toLowerCase();if(n==="style"){const i=/text-align\s*:\s*(left|right|center)/i.exec(s);if(i)return i[1].toLowerCase()}}return"left"}function pM(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function mM(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return pM(n)?n:void 0}function KY(e,t,n){const o=mM(Xd(t),n);if(!pM(o))return e;const s=e?.__linkifyDemotionContext;return{...e,__linkifyDemotionContext:{filename:s?.filename||o?.filename,explicitFilename:s?.explicitFilename||o?.explicitFilename,marketTicker:s?.marketTicker||o?.marketTicker}}}function GY(e,t,n){let o=t+1,s=null;const i=[];let r=!1;for(;o<e.length&&e[o].type!=="table_close";)if(e[o].type==="thead_open")r=!0,o++;else if(e[o].type==="thead_close")r=!1,o++;else if(e[o].type==="tbody_open"||e[o].type==="tbody_close")o++;else if(e[o].type==="tr_open"){const a=[];let c=o+1,u;for(;c<e.length&&e[c].type!=="tr_close";)if(e[c].type==="th_open"||e[c].type==="td_open"){const f=e[c].type==="th_open",h=e[c+1],p=String(h.content??""),g=VY(e[c].attrs),b=a.length,v=!f&&!r,m=v?s?.cells[b]?.raw:void 0;a.push({type:"table_cell",header:f||r,children:eo(h.children||[],p,void 0,KY(n,m,v?u:void 0)),raw:p,align:g}),v&&(u=mM(u,Xd(p))),c+=3}else c++;const d={type:"table_row",cells:a,raw:a.map(f=>f.raw).join("|")};r?s=d:i.push(d),o=c+1}else o++;s||(s={type:"table_row",cells:[],raw:""});const l=e[t].loading===!0;return[{type:"table",header:s,rows:i,loading:l&&!n?.final&&i.length===0,raw:[s,...i].map(a=>a.raw).join(`
218
+ `)},o+1]}function YY(){return{type:"thematic_break",raw:"---"}}let $0=null;const F0=new WeakMap;function G_(){return $0||($0={allowedTagSet:$m(),customTagSet:null}),$0}function ZY(e){if(!e||e.length===0)return G_();const t=F0.get(e);if(t)return t;const n=e.map(_i).filter(Boolean);if(!n.length){const s=G_();return F0.set(e,s),s}const o={allowedTagSet:$m({customHtmlTags:e}),customTagSet:new Set(n)};return F0.set(e,o),o}function QY(e,t,n){const o=e[t],s=o.attrs;let i="";const r={};if(s){for(const[h,p]of s)if(h==="class"){const g=p.match(/(?:\s|^)vmr-container-(\S+)/);g&&(i=g[1])}else if(h.startsWith("data-")){const g=h.slice(5);try{r[g]=JSON.parse(p)}catch{r[g]=p}}}const l=[],a=Hl(n,!0);let c=t+1;for(;c<e.length&&e[c].type!=="vmr_container_close";)if(e[c].type==="paragraph_open"){const h=e[c+1];if(h){const p={type:"paragraph",children:eo(h.children||[],void 0,void 0,a.options()),raw:String(h.content??"")};l.push(p),a.remember(p.raw)}c+=3}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[h,p]=lu(e,c,a.options());l.push(h),a.remember(h.raw),c=p}else if(e[c].type==="blockquote_open"){const[h,p]=au(e,c,a.options());l.push(h),a.remember(h.raw),c=p}else{const h=Im(e,c,a.options());h?(l.push(h[0]),a.remember(h[0].raw),c=h[1]):c++}const u=c<e.length&&e[c].type==="vmr_container_close",d=u||!!n?.final;let f=`::: ${i}`;return Object.keys(r).length>0&&(f+=` ${JSON.stringify(r)}`),f+=`
219
+ `,l.length>0&&(f+=o.raw??l.map(h=>h.raw).join(`
220
+ `),f+=`
221
+ `),f+=":::",[{type:"vmr_container",name:i,loading:!d,attrs:Object.keys(r).length>0?r:void 0,children:l,raw:f},u?c+1:c]}function XY(e){return e.replace(/^\r?\n/,"").replace(/\r?\n$/,"")}function JY(e,t){if(!e||!t)return e;const n=new RegExp(String.raw`[\t ]*<\s*\/\s*${t}[^>]*$`,"i");return e.replace(n,"")}function eZ(e,t,n){if(!e||!t)return null;const o=t.toLowerCase(),s=new RegExp(String.raw`^<\s*${Gs(o)}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${Gs(o)}(?=\s|>)`,"i");let r=0,l=Math.max(0,n);for(;l<e.length;){const a=e.indexOf("<",l);if(a===-1)break;const c=e.slice(a);if(i.test(c)){const u=Jn(c);if(u===-1)return null;if(r===0)return{start:a,end:a+u+1};r--,l=a+u+1;continue}if(s.test(c)){const u=Jn(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 tZ(e,t,n){if(!e||!t)return null;const o=t.toLowerCase(),s=new RegExp(String.raw`<\s*${o}(?=\s|>|/)`,"gi");s.lastIndex=Math.max(0,n||0);const i=s.exec(e);if(!i||i.index==null)return null;const r=i.index,l=e.slice(r),a=Jn(l);if(a===-1)return null;const c=r+a;if(/\/\s*>\s*$/.test(l.slice(0,a+1))){const p=c+1;return{raw:e.slice(r,p),end:p}}let u=1,d=c+1;const f=p=>{const g=e.slice(p);return new RegExp(String.raw`^<\s*${o}(?=\s|>|/)`,"i").test(g)},h=p=>{const g=e.slice(p);return new RegExp(String.raw`^<\s*\/\s*${o}(?=\s|>)`,"i").test(g)};for(;d<e.length;){const p=e.indexOf("<",d);if(p===-1)return{raw:e.slice(r),end:e.length};if(h(p)){const g=e.indexOf(">",p);if(g===-1)return null;if(u--,u===0){const b=g+1;return{raw:e.slice(r,b),end:b}}d=g+1;continue}if(f(p)){const g=Jn(e.slice(p));if(g===-1)return null;u++,d=p+g+1;continue}d=p+1}return{raw:e.slice(r),end:e.length}}function gv(e){return Number.isFinite(e)&&e>0?e:0}function nZ(e,t){const n=gv(t);if(!e||n<=0)return 0;let o=0;for(let s=0;s<e.length;s++)if(e[s]===`
222
+ `&&(o++,o===n))return s+1;return e.length}function Im(e,t,n){const o=e[t];switch(o.type){case"heading_open":return[UY(e,t,n),t+3];case"code_block":return[HY(o),t+1];case"fence":return[rk(o),t+1];case"math_block":return[jY(o),t+1];case"html_block":{const s=hM(o),i=s.tag?ZY(n?.customHtmlTags):null;if(s.tag&&s.loading&&i&&!i.allowedTagSet.has(s.tag)){const r=String(o.content??"").replace(/\n+$/,"");return[{type:"paragraph",children:r?[{type:"text",content:r,raw:r}]:[],raw:r},t+1]}if(s.tag&&i?.customTagSet?.has(s.tag)){const r=s.tag,l=String(n?.__sourceMarkdown??""),a=Number(n?.__customHtmlBlockCursor??0),c=Array.isArray(o.map)?nZ(l,Number(o.map?.[0]??0)):0,u=tZ(l,r,Math.max(gv(a),gv(c)));u&&n&&(n.__customHtmlBlockCursor=u.end);const d=String(u?.raw??s.raw??""),f=Jn(d),h=f!==-1?d.slice(0,f+1):d,p=f!==-1&&/\/\s*>\s*$/.test(h),g=f===-1?null:eZ(d,r,f+1),b=g?.start??-1;let v="";f!==-1&&(b!==-1&&f<b?v=d.slice(f+1,b):v=d.slice(f+1)),b===-1&&(v=JY(v,r));const m=[],y=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let k;for(;(k=y.exec(h))!==null;){const $=k[1];if(!$||$.toLowerCase()===r)continue;const I=k[2]||k[3]||k[4]||"";m.push([$,I])}const A=!n?.final&&!p&&g==null;return[{type:r,tag:r,content:XY(v),raw:String(u?.raw??s.raw??d),loading:A,attrs:m.length?m:void 0},t+1]}return[s,t+1]}case"table_open":{const[s,i]=GY(e,t,n);return[s,i]}case"dl_open":{const[s,i]=WY(e,t,n);return[s,i]}case"footnote_open":{const[s,i]=zY(e,t,n);return[s,i]}case"hr":return[YY(),t+1]}return null}function ck(e,t,n,o){const s=Im(e,t,n);if(s)return s;switch(e[t].type){case"container_warning_open":case"container_info_open":case"container_note_open":case"container_tip_open":case"container_danger_open":case"container_caution_open":case"container_error_open":if(o?.parseContainer)return o.parseContainer(e,t,n);break;case"container_open":if(o?.matchAdmonition){const i=o.matchAdmonition(e,t,n);if(i)return i}break;case"vmr_container_open":return QY(e,t,n)}return null}function oZ(){return{type:"hardbreak",raw:`\\
223
+ `}}function sZ(e,t,n){const o=e[t+1],s=String(o.content??"");return{type:"paragraph",children:eo(o.children||[],s,void 0,n),raw:s}}const Y_=new WeakMap,Lm=new WeakMap,iZ=["$$","\\["];function Jc(){return typeof performance<"u"?performance.now():Date.now()}function uk(e,t,n){e&&(e[t]=(e[t]??0)+n)}function gM(e){return e.__timing}function O0(e,t,n){return t&&uk(t,"parseMarkdownToStructureTotalMs",Jc()-n),e}function Z_(e,t,n){if(!n)return sS(e,t);const o=Jc(),s=sS(e,t);return uk(n,"processTokensMs",Jc()-o),s}function rZ(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return null;const n=ru(t);return n.length?new Set(n):null}function lZ(e,t){const n=e;let o=Y_.get(n);o||(o=new Map,Y_.set(n,o));const s=t.__markstreamFinal===!0?"final":"streaming";let i=o.get(s);i||(i={},o.set(s,i));for(const r of Object.keys(i))Object.prototype.hasOwnProperty.call(t,r)||delete i[r];return Object.assign(i,t),i}function aZ(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Jf(e,t,n){for(const o of Reflect.ownKeys(e)){const s=Object.getOwnPropertyDescriptor(e,o);if(!s||!("value"in s))continue;const i=Object.getOwnPropertyDescriptor(t,o);i&&(!("value"in i)||i.writable===!1)||(t[o]=ha(s.value,n))}}function ha(e,t=new WeakMap){if(!e||typeof e!="object")return e;const n=e,o=t.get(n);if(o)return o;if(Array.isArray(e)){const r=[];t.set(n,r);for(const l of e)r.push(ha(l,t));return r}if(e instanceof Map){const r=new Map;t.set(n,r);for(const[l,a]of e)r.set(ha(l,t),ha(a,t));return r}if(e instanceof Set){const r=new Set;t.set(n,r);for(const l of e)r.add(ha(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),Jf(n,r,t),r}if(typeof URLSearchParams<"u"&&e instanceof URLSearchParams){const r=new URLSearchParams(e.toString());return t.set(n,r),Jf(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),Jf(n,r,t),r}if(typeof Promise<"u"&&e instanceof Promise||typeof Node<"u"&&e instanceof Node)return t.set(n,e),e;if(!aZ(e)){const r=Object.create(Object.getPrototypeOf(e));return t.set(n,r),Jf(n,r,t),r}const s={};t.set(n,s);const i=e;for(const r of Object.keys(i))s[r]=ha(i[r],t);return s}function vM(e,t=!0){if(!t)return Aa(e);const n=Object.create(Object.getPrototypeOf(e)),o=new WeakMap;for(const s of Reflect.ownKeys(e)){const i=Object.getOwnPropertyDescriptor(e,s);if(!i)continue;if(!("value"in i)){Object.defineProperty(n,s,i);continue}const r=i.value;let l=r;s==="attrs"&&Array.isArray(r)?l=r.map(a=>[...a]):s==="map"&&Array.isArray(r)?l=[...r]:s==="children"&&Array.isArray(r)?l=r.map(a=>vM(a,t)):t&&r&&typeof r=="object"&&(l=ha(r,o)),Object.defineProperty(n,s,{...i,value:l})}return n}function Q_(e,t=!0){return e.map(n=>vM(n,t))}function yM(e,t){const n=t,o=e.stream,s=t.streamParse??"auto";return n.__disableStreamParse!==!0&&(s===!0||s==="auto"&&t.final!==!0)&&o?.enabled===!0&&typeof o.parse=="function"}function cZ(e,t){const n=t,o=t.streamParse??"auto",s=e.stream;return t.final===!0&&o==="auto"&&n.__disableStreamParse!==!0&&s?.enabled===!0&&typeof s.reset=="function"}function uZ(e){Lm.delete(e)}function dZ(e,t,n){Lm.set(e,{source:t,key:n,pendingCandidate:n===null&&sM(t)})}function fZ(e){return e.endsWith("$")||e.endsWith("\\")}function hZ(e){const t=Math.max(e.lastIndexOf(`
224
+ `)+1,0),n=e.slice(t).replace(/[\t ]+$/,"");return iZ.some(o=>n.endsWith(o))}function pZ(e,t){return t?!!(t.includes("$$")||t.includes("\\[")||t.includes("\\]")||e.endsWith("$")&&t[0]==="$"||e.endsWith("\\")&&(t[0]==="["||t[0]==="]")||hZ(e)&&/[\r\n]/.test(t)):!1}function mZ(e,t){if(!Q6(e))return;const n=e.stream;if(typeof n?.reset!="function")return;const o=e,s=Lm.get(o);if(s?.source===t)return;if(s&&t.startsWith(s.source)){const l=t.slice(s.source.length);if(s.key===null&&s.pendingCandidate===!1&&!pZ(s.source,l)&&!fZ(t)){s.source=t;return}}const i=TG(t),r=s?!t.startsWith(s.source):!1;(s&&(r||s.key!==i)||!s&&i)&&n.reset(),dZ(e,t,i)}function gZ(e){return typeof e.preTransformTokens=="function"||typeof e.postTransformTokens=="function"}function vZ(e,t){const n=e?.map,o=t?.map;return n===o?!0:!Array.isArray(n)||!Array.isArray(o)?!1:n.length===o.length&&n.every((s,i)=>s===o[i])}function R0(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&&vZ(e,t)}function X_(e,t){return e[t]?.type==="paragraph_open"&&e[t+1]?.type==="inline"&&e[t+2]?.type==="paragraph_close"}function yZ(e){for(let t=0;t+5<e.length;t++)if(X_(e,t)&&X_(e,t+3)&&R0(e[t],e[t+3])&&R0(e[t+1],e[t+4])&&R0(e[t+2],e[t+5]))return!0;return!1}function kZ(e,t,n){return Q6(e)&&sM(t)&&yZ(n)}function bZ(e){const t=Lm.get(e);return typeof t?.key=="string"&&t.key.startsWith("pending:")}function J_(e,t,n,o){if(o.customHtmlTags?.length&&(n.__markstreamCustomHtmlTags=o.customHtmlTags),!yM(e,o)||(mZ(e,t),bZ(e)))return e.parse(t,n);const s=e.stream.parse(t,lZ(e,n));if(kZ(e,t,s))return e.stream?.reset?.(),e.parse(t,n);if(!gZ(o))return s;const i=gM(o);if(!i)return Q_(s,!0);const r=Jc(),l=Q_(s,!0);return uk(i,"tokenCloneMs",Jc()-r),l}function $m(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return $d;const n=new Set($d);for(const o of ru(t))o&&n.add(o);return n}function xZ(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 eS(e){return{type:"paragraph",children:e,raw:e.map(xZ).join("")}}function tS(e,t){if(e.type!=="paragraph")return null;const n=e.children,o=Array.isArray(n)?n:[];if(o.length===0)return null;const s=rZ(t);if(!s?.size)return null;let i=-1;for(let u=0;u<o.length;u++){const d=o[u];if(!s.has(String(d?.type??"").toLowerCase()))continue;const f=o.slice(0,u);if(String(d.content??"").trim()&&f.some(h=>h?.type==="hardbreak")){i=u;break}}if(i===-1)return null;const r=o.slice(0,i),l=o[i];if(!l)return null;const a=[];r.length&&a.push(eS(r)),a.push(l);const c=o.slice(i+1);return c.length&&a.push(eS(c)),a}function wZ(e){const t=e.trim();if(!t)return null;const n=/^(?:<!doctype\s+html[^>]*>\s*)?<html(?:\s[^>]*)?>/i.test(t),o=/<\/html>\s*$/i.test(t);return!n||!o?null:[{type:"html_block",tag:"html",raw:e,content:e,loading:!1}]}function ld(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:""}function _Z(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*${Gs(t)}\s*>\s*$`,"i").test(n)}function dk(e,t,n){if(!e||!t)return null;const o=t.toLowerCase(),s=new RegExp(String.raw`<\s*${Gs(o)}(?=\s|>|/)`,"gi");s.lastIndex=Math.max(0,n);const i=s.exec(e);if(!i||i.index==null)return null;const r=i.index,l=Jn(e.slice(r));if(l===-1)return null;const a=r+l,c=e.slice(r,a+1);if(Ha.has(o)||/\/\s*>$/.test(c))return{raw:c,start:r,end:a+1,closed:!0};let u=1,d=a+1;const f=p=>{const g=e.slice(p);return new RegExp(String.raw`^<\s*${Gs(o)}(?=\s|>|/)`,"i").test(g)},h=p=>{const g=e.slice(p);return new RegExp(String.raw`^<\s*\/\s*${Gs(o)}(?=\s|>)`,"i").test(g)};for(;d<e.length;){const p=e.indexOf("<",d);if(p===-1)return{raw:e.slice(r),start:r,end:e.length,closed:!1};if(h(p)){const g=Jn(e.slice(p));if(g===-1)return null;u--;const b=p+g+1;if(u===0)return{raw:e.slice(r,b),start:r,end:b,closed:!0};d=b;continue}if(f(p)){const g=Jn(e.slice(p));if(g===-1)return null;const b=e.slice(p,p+g+1);/\/\s*>$/.test(b)||u++,d=p+g+1;continue}d=p+1}return{raw:e.slice(r),start:r,end:e.length,closed:!1}}function SZ(e,t){if(!t)return 0;let n=0,o=0;for(;n<e.length&&o<t.length;){if(e[n]===t[o]){n++,o++;continue}if(e[n]==="\r"||e[n]===`
225
+ `){n++;continue}return-1}return o===t.length?n:-1}function CZ(e,t,n){return n?e:`${e.replace(/<[^>]*$/,"")}
226
+ </${t}>`}function nS(e){return e.replace(/\r\n/g,`
227
+ `).replace(/(^|\n)[ \t]{1,4}/g,"$1")}function AZ(e,t,n){return n?e.includes(n,t)?!0:nS(e.slice(Math.max(0,t))).includes(nS(n)):!1}function MZ(e,t){let n=Math.max(0,t);for(;n<e.length&&(e[n]===" "||e[n]===" ");)n++;return e[n]==="\r"?(n++,e[n]===`
228
+ `&&n++,n):e[n]===`
229
+ `?n+1:t}function oS(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 EZ(e){if(e.type!=="html_block")return!1;const t=String(e.raw??e.content??"");return/^\s*<\/details\b/i.test(t)}function fk(e,t){const n=new RegExp(String.raw`<\s*\/\s*${Gs(t)}(?=\s|>)`,"gi");let o=-1,s;for(;(s=n.exec(e))!==null;)o=s.index;return o}function kM(e,t){return{final:t,__disableStreamParse:!0,requireClosingStrong:e.requireClosingStrong,customHtmlTags:e.customHtmlTags,validateLink:e.validateLink}}const TZ=new Set(["admonition","blockquote","code_block","definition_list","footnote","heading","list","math_block","table","thematic_break"]),NZ=/(?:^|\n)\s{0,3}(?:#{1,6}\s+\S|[-+*]\s+\S|\d+[.)]\s+\S|>\s*\S|`{3,}|~{3,}|(?:\*{3,}|-{3,}|_{3,})(?:\s|$)|\|.*\|)/m;function IZ(e){return/\n\s*\n/.test(e)||NZ.test(e)}function LZ(e,t){if(!e.trim()||t.length===0)return!1;if(t.some(o=>TZ.has(String(o?.type??"").toLowerCase()))||t.some(o=>{if(o?.type!=="html_block")return!1;const s=o;return Array.isArray(s.children)&&s.children.length>0}))return!0;if(!IZ(e))return!1;if(t.length>1)return!0;const[n]=t;return!!(n&&n.type==="paragraph")}function $Z(e,t,n,o){return e.map(s=>{if(s?.type!=="html_block")return s;const i=s,r=String(i.tag??"").toLowerCase();if(!r||r==="details"||F6.has(r)||Array.isArray(i.children))return s;const l=String(s.raw??i.content??"");if(!l)return s;const a=Jn(l);if(a===-1)return s;const c=fk(l,r),u=c!==-1&&c>=a+1?l.slice(a+1,c):l.slice(a+1);if(!u.trim())return s;const d=ad(u,t,kM(n,o));return LZ(u,d)?{...s,children:d}:s})}function ad(e,t,n){return e.trim()?xM(e,t,{...n,__disableStreamParse:!0}):[]}function FZ(e,t,n){const o=ad(e,t,n),s=o[0];return o.length===1&&s?.type==="paragraph"&&Array.isArray(s.children)?s.children:o}function OZ(e,t,n){const o=hM({content:e}),s=Jn(e),i=fk(e,"summary");if(s!==-1&&i!==-1&&i>=s+1){const r=FZ(e.slice(s+1,i),t,n);r.length>0&&(o.children=r)}return o.raw=e,o}function RZ(e,t,n){const o=Jn(e);if(o===-1)return[];const s=e.slice(o+1);if(!s.trim())return[];const i=dk(s,"summary",0);if(!i)return ad(s,t,n);const r=s.slice(0,i.start),l=s.slice(i.end);return[...ad(r,t,n),OZ(i.raw,t,n),...ad(l,t,n)]}function bM(e,t,n,o,s,i=0){const r=[];let l=i;for(let a=0;a<e.length;a++){const c=e[a],u=ld(c);let d=-1;if(u&&(d=t.indexOf(u,l),d!==-1&&(l=d+u.length)),!oS(c)){r.push(c);continue}const f=String(c.raw??ld(c)??""),h=d!==-1?d:t.indexOf(f,Math.max(0,l-f.length));if(h===-1){r.push(c);continue}let p=1,g=-1;for(let Z=a+1;Z<e.length;Z++){const K=e[Z];if(oS(K)){p++;continue}if(EZ(K)&&(p--,p===0)){g=Z;break}}const b=dk(t,"details",h),v=g===-1&&b?.closed===!0,m=v?(()=>{const Z=fk(f,"details");return Z!==-1?f.slice(0,Z):f})():f,[y]=bM(v?[]:g===-1?e.slice(a+1):e.slice(a+1,g),t,n,o,s,h+f.length),k=RZ(m,n,kM(o,s)),A=g===-1?"</details>":String(e[g].raw??ld(e[g])??"</details>"),$=v||g!==-1&&b?.closed===!0,I=A.replace(/[\t\r\n ]+$/,""),x=$?(()=>{const Z=(b?.raw??"").lastIndexOf(I);return Z===-1?t.length:h+Z})():t.length,L=Jn(f),E=v&&L!==-1?h+L+1:h+f.length,F=t.slice(E,x===-1?t.length:x),S=n.parse(F,{__markstreamFinal:s}),N=n.renderer.render(S,n.options,{__markstreamFinal:s}),D=x+I.length,B=$?Math.max(x+A.length,MZ(t,D)):t.length,U=$?t.slice(x,B):A,H=$?t.slice(h,B):t.slice(h),P=v&&L!==-1?f.slice(0,L+1):f;if(r.push({...c,tag:"details",attrs:Nm(f.slice(0,L+1)),raw:H,content:`${P}${N}${U}`,children:[...k,...y],loading:!s&&!$}),l=$?B:t.length,g===-1&&!v)break;g!==-1&&(a=g)}return[r,l]}function BZ(e,t,n){if(!n)return e;const o=e.slice();let s=0;for(let i=0;i<o.length;i++){const r=o[i],l=ld(r),a=l?n.indexOf(l,s):-1;if(r?.type!=="html_block"){a!==-1&&(s=a+l.length);continue}const c=String(r.tag??"").toLowerCase();if(!c)continue;if(c==="details"){a!==-1&&(s=a+l.length);continue}const u=dk(n,c,a!==-1?a:s);if(!u)continue;s=u.end;const d=String(r.content??l),f=String(r.raw??d),h=CZ(u.raw,c,u.closed),p=!t&&!u.closed,g=d!==h||f!==u.raw||!!r.loading!==p,b=Jn(u.raw),v=b===-1?"":u.raw.slice(0,b+1),m=v?Nm(v):[];if(r.content=h,r.raw=u.raw,r.loading=p,r.attrs=m.length?m:void 0,!g)continue;let y=SZ(u.raw,f);y===-1&&(y=0);const k=i+1;for(;k<o.length;){if(u.closed&&_Z(o[k],c)){o.splice(k,1);continue}const A=ld(o[k]);if(!A)break;const $=u.raw.indexOf(A,y);if($===-1){if(AZ(n,u.end,A))break;o.splice(k,1);continue}y=$+A.length,o.splice(k,1)}}return o}function DZ(e){const t=l=>l===" "||l===" "||l===`
230
+ `||l==="\r",n=l=>{if(!l||l[0]!=="<"||l.includes(">"))return!1;let a=1;if(a<l.length&&t(l[a])||l[a]==="/"&&(a++,a<l.length&&t(l[a])))return!1;const c=g=>{const b=g.charCodeAt(0);return b>=65&&b<=90||b>=97&&b<=122},u=g=>{const b=g.charCodeAt(0);return b>=48&&b<=57},d=g=>g==="!"||c(g),f=g=>c(g)||u(g)||g===":"||g==="-",h=g=>c(g)||u(g)||g==="_"||g==="."||g===":"||g==="-",p=h;if(a>=l.length||!d(l[a]))return!1;for(a++;a<l.length&&f(l[a]);)a++;for(;a<l.length;){for(;a<l.length&&t(l[a]);)a++;if(a>=l.length)return!0;if(l[a]==="/"){for(a++;a<l.length&&t(l[a]);)a++;return a>=l.length}if(!h(l[a]))return!1;for(a++;a<l.length&&p(l[a]);)a++;for(;a<l.length&&t(l[a]);)a++;if(a<l.length&&l[a]==="="){for(a++;a<l.length&&t(l[a]);)a++;if(a>=l.length)return!0;const 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 b=l[a];if(t(b)||b==="<"||b===">"||b==='"'||b==="'"||b==="`")break;a++}if(a>=l.length)return!0}}}return!0},o=(l,a)=>{let c=!1,u="",d=0;const f=m=>m===" "||m===" ",h=m=>{let y=0;for(;y<m.length&&f(m[y]);)y++;const k=m[y];if(k!=="`"&&k!=="~")return null;let A=y;for(;A<m.length&&m[A]===k;)A++;const $=A-y;return $<3?null:{markerChar:k,markerLen:$,rest:m.slice(A)}},p=m=>{let y=0;for(;y<m.length&&f(m[y]);)y++;let k=!1;for(;y<m.length&&m[y]===">";)for(k=!0,y++;y<m.length&&f(m[y]);)y++;return k?m.slice(y):null},g=m=>{const y=h(m);if(y)return y;const k=p(m);return k==null?null:h(k)};let b=0;const v=l.split(/\r?\n/);for(const m of v){const y=b,k=b+m.length;if(a<y)break;const A=g(m);if(A){const $=A.markerChar,I=A.markerLen;c?$===u&&I>=d&&/^\s*$/.test(A.rest)&&(c=!1,u="",d=0):(c=!0,u=$,d=I)}if(a<=k)break;b=k+1}return c},s=String(e??""),i=s.lastIndexOf("<");if(i===-1||o(s,i))return s;if(i>0){const l=s[i-1],a=l===" "||l===" "||l===`
231
+ `||l==="\r",c=s[i-2];if(!a&&!((l==="n"||l==="r")&&c==="\\"))return s}const r=s.slice(i);return r.includes(">")||r.length>1&&(r[1]===" "||r[1]===" "||r[1]===`
232
+ `||r[1]==="\r")||!n(r)?s:s.slice(0,i)}function PZ(e,t){if(!e||!t.length)return e;const n=new Set(t.map(p=>String(p??"").toLowerCase()).filter(Boolean));if(!n.size)return e;const o=p=>p===" "||p===" ",s=p=>{const g=p.charCodeAt(0);return g>=65&&g<=90||g>=97&&g<=122||g>=48&&g<=57||p==="_"||p==="-"||p===":"},i=p=>{if(!p)return!1;if(p[0]===" ")return!0;let g=0;for(let b=0;b<p.length;b++){const v=p[b];if(v===" "){if(g++,g>=4)return!0;continue}if(v===" ")return!0;break}return!1},r=p=>{let g=!1,b=!1;for(let v=0;v<p.length;v++){const m=p[v];if(m==="\\"){v++;continue}if(!b&&m==="'"){g=!g;continue}if(!g&&m==='"'){b=!b;continue}if(!g&&!b&&m===">")return v}return-1},l=p=>{let g=0;for(;g<p.length&&o(p[g]);)g++;const b=p[g];if(b!=="`"&&b!=="~")return null;let v=g;for(;v<p.length&&p[v]===b;)v++;const m=v-g;return m<3?null:{markerChar:b,markerLen:m,rest:p.slice(v)}},a=(p,g)=>{if(i(p))return-1;const b=p.replace(/^[ \t]+/,"");if(!b||b.startsWith(">")||b.startsWith("|")||/^(?:[*+-]|\d+[.)])[\t ]+/.test(b))return-1;let v=!1,m=0;for(;m<p.length;){const y=p[m];if(y!=="<"){o(y)||(v=!0),m++;continue}const k=r(p.slice(m));if(k===-1){v=!0,m++;continue}const A=p.slice(m,m+k+1);let $=1;for(;$<A.length&&o(A[$]);)$++;if($>=A.length){v=!0,m++;continue}const I=A[$];if(I==="!"||I==="?"){v=!0,m+=k+1;continue}if(I==="/"){v=!0,m+=k+1;continue}const x=$;for(;$<A.length&&s(A[$]);)$++;if($===x){v=!0,m++;continue}const L=A.slice(x,$).toLowerCase(),E=A[$];if(E&&E!==" "&&E!==" "&&E!==">"&&E!=="/"){v=!0,m++;continue}const F=new RegExp(String.raw`<\s*\/\s*${L}\s*>`,"i"),S=/\/\s*>$/.test(A),N=F.test(p.slice(m+k+1)),D=F.test(e.slice(g+m+k+1)),B=/[\r\n]/.test(e.slice(g+m+k+1));if(v&&n.has(L)&&!S&&!N&&(D||B))return m;v=!0,m+=k+1}return-1};let c=!1,u="",d=0,f="",h=0;for(;h<e.length;){const p=e.indexOf(`
233
+ `,h),g=p!==-1,b=g&&p>h&&e[p-1]==="\r",v=g?b?p-1:p:e.length,m=e.slice(h,v),y=g?b?`\r
234
+ `:`
235
+ `:"",k=l(m);let A=m;if(!c&&!k){const $=a(m,h);if($!==-1){const I=y||`
236
+ `;A=`${m.slice(0,$).replace(/[ \t]+$/,"")}${I}${I}${m.slice($).replace(/^[ \t]+/,"")}`}}f+=A,f+=y,k&&(c?k.markerChar===u&&k.markerLen>=d&&/^\s*$/.test(k.rest)&&(c=!1,u="",d=0):(c=!0,u=k.markerChar,d=k.markerLen)),h=g?p+1:e.length}return f}function HZ(e,t){if(!e||!t.length)return e;const n=new Set(t.map(d=>String(d??"").toLowerCase()));if(!n.size)return e;const o=d=>d===" "||d===" ",s=d=>{const 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&&o(d[f]);)f++;return d.slice(f)},r=d=>{let f=!1,h=!1;for(let p=0;p<d.length;p++){const g=d[p];if(g==="\\"){p++;continue}if(!h&&g==="'"){f=!f;continue}if(!f&&g==='"'){h=!h;continue}if(!f&&!h&&g===">")return p}return-1},l=(d,f,h)=>{const p=h.toLowerCase();let g=d.indexOf("<",f);for(;g!==-1;){let b=g+1;for(;b<d.length&&o(d[b]);)b++;if(b>=d.length||d[b]!=="/"){g=d.indexOf("<",g+1);continue}for(b++;b<d.length&&o(d[b]);)b++;if(b+p.length>d.length){g=d.indexOf("<",g+1);continue}let v=!0;for(let y=0;y<p.length;y++){const k=d[b+y];if((k>="A"&&k<="Z"?String.fromCharCode(k.charCodeAt(0)+32):k)!==p[y]){v=!1;break}}if(!v){g=d.indexOf("<",g+1);continue}let m=b+p.length;if(m<d.length&&s(d[m])){g=d.indexOf("<",g+1);continue}for(;m<d.length&&o(d[m]);)m++;if(m<d.length&&d[m]===">")return!0;g=d.indexOf("<",g+1)}return!1},a=d=>{let f=0;for(;f<d.length&&o(d[f]);)f++;if(f>=d.length||d[f]!=="<")return d;for(f++;f<d.length&&o(d[f]);)f++;if(f>=d.length||d[f]==="/")return d;const h=f;for(;f<d.length&&s(d[f]);)f++;if(f===h)return d;const p=d.slice(h,f).toLowerCase();if(!n.has(p))return d;const g=r(d.slice(f));if(g===-1)return d;const b=f+g;if(l(d,b+1,p))return d;const v=i(d.slice(b+1));return v?`${d.slice(0,b+1)}
237
+ ${v}`:d};let c="",u=0;for(;u<e.length;){const d=e.indexOf(`
238
+ `,u);if(d===-1){c+=a(e.slice(u));break}const f=d>u&&e[d-1]==="\r",h=f?d-1:d,p=e.slice(u,h);c+=a(p),c+=f?`\r
239
+ `:`
240
+ `,u=d+1}return c}function WZ(e,t){if(!e||!t.length)return e;const n=new Set(t.map(f=>String(f??"").toLowerCase()));if(!n.size)return e;const o=f=>f===" "||f===" ",s=f=>{let h=0,p=!1,g=0;for(;h<f.length;){for(;h<f.length&&o(f[h]);)h++;if(h>=f.length||f[h]!==">")break;for(p=!0,h++;h<f.length&&o(f[h]);)h++;g=h}return p?{prefix:f.slice(0,g),content:f.slice(g)}:null},i=f=>{let h=0;for(;h<f.length&&o(f[h]);)h++;const p=f[h];if(p!=="`"&&p!=="~")return null;let g=h;for(;g<f.length&&f[g]===p;)g++;const b=g-h;return b<3?null:{markerChar:p,markerLen:b,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(`
241
+ `,d),h=f!==-1,p=h&&f>d&&e[f-1]==="\r",g=h?p?f-1:f:e.length,b=e.slice(d,g),v=h?p?`\r
242
+ `:`
243
+ `:"",m=s(b),y=m?.prefix??"",k=m?.content??b,A=i(k);A&&(l?A.markerChar===a&&A.markerLen>=c&&/^\s*$/.test(A.rest)&&(l=!1,a="",c=0):(l=!0,a=A.markerChar,c=A.markerLen));let $=k;if(!l&&$.includes("</"))for(const I of r)$=$.replace(I,(x,L,E,F)=>{if(F.replace(/^[\t ]+/,"").startsWith("|"))return x;const S=F.slice(0,E).replace(/^[\t ]+/,"");if(S.length>0){const N=L.match(/^<\s*\/\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"",D=S.match(/^<\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"";if(!N||!D||N!==D)return x}return`${L}
244
+
245
+ `});if(y){const I=y+$.split(`
246
+ `).join(`
247
+ ${y}`);u+=I}else u+=$;u+=v,d=h?f+1:e.length}return u}function zZ(e,t){if(!e||!t.length)return e;const n=new Set(t.map(S=>String(S??"").toLowerCase()));if(!n.size)return e;const o=S=>S===" "||S===" ",s=S=>{if(!S)return!1;if(S[0]===" ")return!0;let N=0;for(let D=0;D<S.length;D++){const B=S[D];if(B===" "){if(N++,N>=4)return!0;continue}if(B===" ")return!0;break}return!1},i=S=>{const N=S.charCodeAt(0);return N>=65&&N<=90||N>=97&&N<=122||N>=48&&N<=57||S==="_"||S==="-"||S===":"},r=S=>{let N=0;for(;N<S.length&&o(S[N]);)N++;return S.slice(N)},l=S=>{let N=0,D=!1,B=0;for(;N<S.length;){for(;N<S.length&&o(S[N]);)N++;if(N>=S.length||S[N]!==">")break;for(D=!0,N++;N<S.length&&o(S[N]);)N++;B=N}if(!D)return null;const U=S.slice(0,B);return{prefix:U,key:U.replace(/[ \t]+$/,""),content:S.slice(B)}},a=S=>r(S).startsWith("<"),c=S=>{for(let N=0;N<S.length;N++){const D=S[N];if(D!==" "&&D!==" ")return!1}return!0},u=S=>{if(s(S))return"";const N=r(S);if(!N.startsWith("<"))return"";let D=1;for(;D<N.length&&o(N[D]);)D++;if(D>=N.length||N[D]==="/"||N[D]==="!"||N[D]==="?")return"";const B=D;for(;D<N.length&&i(N[D]);)D++;if(D===B)return"";const U=N.slice(B,D).toLowerCase();if(!n.has(U))return"";const H=N[D];return H&&H!==" "&&H!==" "&&H!==">"&&H!=="/"?"":U},d=S=>{if(s(S))return null;const N=r(S);if(!N.startsWith("<"))return null;let D=1;for(;D<N.length&&o(N[D]);)D++;if(D>=N.length)return null;const B=N[D]==="/";if(B)for(D++;D<N.length&&o(N[D]);)D++;const U=N[D];if(!U||U==="!"||U==="?")return null;const H=D;for(;D<N.length&&i(N[D]);)D++;if(D===H)return null;const P=N.slice(H,D).toLowerCase();if(!n.has(P))return null;const Z=N[D];if(Z&&Z!==" "&&Z!==" "&&Z!==">"&&Z!=="/")return null;if(B)return{type:"close",name:P};if(/\/\s*>\s*$/.test(N))return{type:"open",name:P,complete:!0};const K=N.indexOf(">",D);if(K!==-1){const V=N.slice(K+1);if(new RegExp(`<\\s*\\/\\s*${P}\\s*>`,"i").test(V))return{type:"open",name:P,complete:!0}}return{type:"open",name:P,complete:!1}},f=S=>{if(s(S))return null;const N=r(S).replace(/[ \t]+$/,"");if(!N.startsWith("<")||/^<\s*(?:!--|!doctype\b|\?)/i.test(N))return null;const D=N.match(/^<\s*([A-Z][\w:-]*)\b[^>]*\/\s*>\s*$/i);if(D?.[1])return D[1].toLowerCase();const B=N.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 h=!1,p="",g=0;const b=S=>{let N=0;for(;N<S.length&&o(S[N]);)N++;const D=S[N];if(D!=="`"&&D!=="~")return null;let B=N;for(;B<S.length&&S[B]===D;)B++;const U=B-N;return U<3?null:{markerChar:D,markerLen:U,rest:S.slice(B)}},v=S=>b(S),m=S=>{const N=r(S);return N?s(S)?!0:/^(?:#{1,6}[ \t]+|>|[*+-][ \t]+|\d+[.)][ \t]+|`{3,}|~{3,}|\||\$\$|:{3,}|\[\^[^\]]+\]:|-{3,}|\*{3,}|_{3,})/.test(N):!1},y=(S,N,D)=>{let B=S,U=0;for(;B<e.length;){const H=e.indexOf(`
248
+ `,B),P=H!==-1,Z=P&&H>B&&e[H-1]==="\r",K=P?Z?H-1:H:e.length,V=e.slice(B,K),X=l(V),he=X?.key??"";if(U>0&&N&&he!==N)break;const ne=X?.content??V,ue=d(ne);if(ue?.name===D){if(ue.type==="open")ue.complete||U++;else if(U>0&&(U--,U===0))return!1}else if(U>0&&(c(ne)||m(ne)))return!0;if(P)B=H+1;else break}return!1};let k="",A=0,$=!0,I=!1,x=!1,L=`
249
+ `;const E=[];let F="";for(;A<e.length;){const S=e.indexOf(`
250
+ `,A),N=S!==-1,D=N&&S>A&&e[S-1]==="\r",B=N?D?S-1:S:e.length,U=e.slice(A,B),H=N?D?`\r
251
+ `:`
252
+ `:"",P=l(U),Z=P?.key??"",K=P?.content??U,V=v(K);V&&(h?V.markerChar===p&&V.markerLen>=g&&/^\s*$/.test(V.rest)&&(h=!1,p="",g=0):(h=!0,p=V.markerChar,g=V.markerLen));const X=E.length>0;if(!h&&!X){const ne=u(K),ue=!!ne&&!$&&I&&x&&y(A,Z,ne);ne&&!$&&(!I||ue)&&(Z&&F&&Z===F?k+=`${Z}${L}`:Z||(k+=L))}if(k+=U,k+=H,H&&(L=H),!h){const ne=d(K);if(ne){if(ne.type==="open")ne.complete||E.push(ne.name);else for(let ue=E.length-1;ue>=0;ue--)if(E[ue]===ne.name){E.length=ue;break}}}const he=c(K);$=he,I=!he&&a(K),x=!he&&!!f(K),F=Z,A=N?S+1:e.length}return k}function xM(e,t,n={}){const o=gM(n),s=o?Jc():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(cZ(t,n)&&(t.stream.reset(),uZ(t)),i||(r.endsWith("- *")&&(r=r.replace(/- \*$/,"- \\*")),/(?:^|\n)\s*-\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*-\s*$/,b=>b.startsWith(`
253
+ `)?`
254
+ `:""):/(?:^|\n)\s*--\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*--\s*$/,b=>b.startsWith(`
255
+ `)?`
256
+ `:""):/(?:^|\n)\s*>\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*>\s*$/,b=>b.startsWith(`
257
+ `)?`
258
+ `:""):/\n\s*[*+]\s*$/.test(r)?r=r.replace(/\n\s*[*+]\s*$/,`
259
+ `):/(?:^|\n)\s*\d+\s*$/.test(r)?/^\d+$/.test(r.trim())||(r=r.replace(/(?:^|\n)\s*\d+\s*$/,b=>b.startsWith(`
260
+ `)?`
261
+ `:"")):/(?:^|\n)\s*\d+[.)]\s+\*{1,3}\s*$/.test(r)?r=r.replace(/((?:^|\n)\s*\d+[.)]\s+)(\*{1,3})\s*$/,(b,v,m)=>`${v}${m.split("").map(()=>"\\*").join("")}`):/(?:^|\n)\s*\d+[.)]\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*\d+[.)]\s*$/,b=>b.startsWith(`
262
+ `)?`
263
+ `:""):/\n[[(]\n*$/.test(r)&&(r=r.replace(/(\n\[|\n\()+\n*$/g,`
264
+ `))),n.customHtmlTags?.length&&r.includes("<")){const b=ru(n.customHtmlTags);if(b.length&&(r=PZ(r,b),r=HZ(r,b),r=zZ(r,b),r=WZ(r,b),r.includes("</")))for(const v of b){const m=new RegExp(String.raw`(^[\t ]*<\s*\/\s*${v}\s*>[\t ]*)(\r?\n)(?![\t ]*\r?\n|$)`,"gim");r=r.replace(m,"$1$2$2")}}i||(r=DZ(r));const l=wZ(r);if(l){const b=n.preTransformTokens,v=n.postTransformTokens;if(yM(t,n)||typeof b=="function"||typeof v=="function"){const m=J_(t,r,{__markstreamFinal:i},n),y=typeof b=="function"&&b(m)||m;typeof v=="function"&&v(y)}return O0(l,o,s)}const a=J_(t,r,{__markstreamFinal:i},n);if(!a||!Array.isArray(a))return O0([],o,s);const c=n.preTransformTokens,u=n.postTransformTokens;let d=a;c&&typeof c=="function"&&(d=c(d)||d);const f=t,h=n.validateLink??f.options?.validateLink??(typeof f.validateLink=="function"?f.validateLink:void 0),p={...n,validateLink:h,__markdownIt:t,__sourceMarkdown:r,__customHtmlBlockCursor:0};let g=Z_(d,p,o);if(u&&typeof u=="function"){const b=u(d);if(Array.isArray(b)){const v=b[0],m=v?.type;v&&typeof m=="string"?g=Z_(b,void 0,o):g=b}}if(g=BZ(g,i,r),g=bM(g,r,t,n,i)[0],g=$Z(g,t,n,i),i){const b=new WeakSet,v=m=>{if(!m||typeof m!="object"||b.has(m))return;if(b.add(m),Array.isArray(m)){for(const k of m)v(k);return}const y=m;y.type==="html_block"&&y.loading===!0&&(y.loading=!1);for(const k of Object.values(y))v(k)};v(g)}return n.debug&&console.log("Parsed Markdown Tree Structure:",g),O0(g,o,s)}function sS(e,t){if(!e||!Array.isArray(e))return[];const n=[],o=Hl(t);let s=0;for(;s<e.length;){const i=ck(e,s,o.options(),ak);if(i){n.push(i[0]),o.remember(i[0].raw),s=i[1];continue}const r=e[s];switch(r.type){case"paragraph_open":{const l=String(e[s+1]?.content??""),a=sZ(e,s,o.options(l)),c=tS(a,t);c?n.push(...c):n.push(a),o.remember(a.raw),s+=3;break}case"bullet_list_open":case"ordered_list_open":{const[l,a]=lu(e,s,o.options());n.push(l),o.remember(l.raw),s=a;break}case"blockquote_open":{const[l,a]=au(e,s,o.options());n.push(l),o.remember(l.raw),s=a;break}case"footnote_anchor":{const l=r.meta??{},a=String(l.label??r.content??"");n.push({type:"footnote_anchor",id:a,raw:String(r.content??"")}),o.remember(String(r.content??"")),s++;break}case"hardbreak":n.push(oZ()),o.reset(),s++;break;case"text":{const l=String(r.content??"");n.push({type:"paragraph",raw:l,children:l?[{type:"text",content:l,raw:l}]:[]}),o.remember(l),s++;break}case"inline":{const l=String(r.content??""),a=eo(r.children||[],l,void 0,o.options(l));if(a.length!==0)if(a.every(c=>c.type==="html_block"))n.push(...a);else{const c={type:"paragraph",raw:l,children:a},u=tS(c,t);u?n.push(...u):n.push(c)}o.remember(l)}s+=1;break;default:s+=1;break}}return n}const UZ=new Set([...Qd,"base","button","datalist","dialog","embed","fieldset","form","iframe","input","legend","link","meta","object","optgroup","option","output","param","select","style","template","textarea","title"]),qZ=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"]),iS=/<([a-z][a-z0-9-]*)\b[^>]*>/gi;function rS(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function jZ(e){return typeof e=="string"?e:e==null?"":String(e)}function wM(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function yl(e){return jZ(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function _M(e){return yl(e).replace(/`/g,"&#96;")}function Fm(e){return String(e??"").trim().toLowerCase()}function hk(e,t="safe"){const n=Fm(e);return n?t==="escape"?!0:t==="trusted"?Qd.has(n):!qZ.has(n):!1}function SM(e,t="safe"){const n=Fm(e);return n?t==="escape"?!0:t==="trusted"?Qd.has(n):UZ.has(n):!1}function lS(e){const t=Object.entries(e);return t.length===0?"":t.map(([n,o])=>o===""?` ${n}`:` ${n}="${_M(o)}"`).join("")}function VZ(e,t){const n=e.split(",").map(o=>o.trim()).filter(Boolean);return n.length===0?!1:n.some(o=>{const s=o.split(/\s+/,1)[0]??"";return!s||Ca(s,{tagName:t,attrName:"srcset"})})}function CM(e,t,n,o){return TV.has(e)||n==="safe"&&e==="style"?!0:e==="srcset"?VZ(t,o):!!(NV.has(e)&&t&&Ca(t,{tagName:o,attrName:e}))}function pa(e,t){const n=t.toLowerCase();return Object.keys(e).find(o=>o.toLowerCase()===n)}function AM(e,t,n,o=!1){if(t!=="safe"||Fm(n)!=="a")return e;const s=pa(e,"href");if(o&&(!s||!e[s])){const a=pa(e,"target"),c=pa(e,"rel");return a&&delete e[a],c&&delete e[c],e}const i=pa(e,"target");if((i?String(e[i]).trim():"").toLowerCase()!=="_blank")return e;const r=pa(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 aS(e,t="safe",n){const o={};for(const[s,i]of Object.entries(e)){const r=s.trim(),l=r.toLowerCase();!r||!wM(r)||CM(l,i,t,n)||(o[r]=i)}return AM(o,t,n,!!pa(e,"href"))}function MM(e,t){const n=e.toLowerCase();return $6.has(n)?!1:rS(t,n)||rS(t,e)}function pk(e,t="safe",n){const o={};for(const[s,i]of Object.entries(e)){const r=s.trim(),l=r.toLowerCase();!r||!wM(r)||CM(l,i,t,n)||(o[r]=i)}return AM(o,t,n,!!pa(e,"href"))}function Ap(e){const t={};if(!Array.isArray(e)||e.length===0)return t;for(const[n,o]of e)n&&(t[String(n)]=o==null?"":String(o));return t}function vv(e,t="safe",n){const o=pk(Ap(e),t,n),s=Object.entries(o).map(([i,r])=>[i,r]);return s.length>0?s:void 0}function KZ(e,t){const n=t.toLowerCase();if(["checked","disabled","readonly","required","autofocus","multiple","hidden"].includes(n))return e==="true"||e===""||e===t;if(["value","min","max","step","width","height","size","maxlength"].includes(n)){const o=Number(e);if(e!==""&&!Number.isNaN(o))return o}return e}function GZ(e){const t={};for(const[n,o]of Object.entries(e))t[n]=KZ(o,n);return t}function cS(e){return e.trim().length>0}function YZ(e){const t=[];let n=0;for(;n<e.length;){if(e.startsWith("<!--",n)){const a=e.indexOf("-->",n);if(a!==-1){n=a+3;continue}break}const o=e.indexOf("<",n);if(o===-1){if(n<e.length){const a=e.slice(n);cS(a)&&t.push({type:"text",content:a})}break}if(o>n){const a=e.slice(n,o);cS(a)&&t.push({type:"text",content:a})}if(e.startsWith("![CDATA[",o+1)){const a=e.indexOf("]]>",o);if(a!==-1){t.push({type:"text",content:e.slice(o,a+3)}),n=a+3;continue}break}if(e.startsWith("!",o+1)){const a=e.indexOf(">",o);if(a!==-1){n=a+1;continue}break}const s=e.indexOf(">",o);if(s===-1)break;const i=e.slice(o+1,s).trim(),r=i.startsWith("/"),l=i.endsWith("/");if(r){const a=i.slice(1).trim();t.push({type:"tag_close",tagName:a})}else{const a=i.indexOf(" ");let c,u="";a===-1?c=l?i.slice(0,-1).trim():i.trim():(c=i.slice(0,a).trim(),u=i.slice(a+1));const d={};if(u){const f=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let h;for(;(h=f.exec(u))!==null;){const p=h[1],g=h[2]??h[3]??h[4]??"";p&&!p.endsWith("/")&&(d[p]=g)}}t.push({type:l||Ha.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d})}n=s+1}return t}function ZZ(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 o=e.indexOf("<",n);if(o===-1){n<e.length&&t.push({type:"text",content:e.slice(n)});break}if(o>n&&t.push({type:"text",content:e.slice(n,o)}),e.startsWith("![CDATA[",o+1)){const f=e.indexOf("]]>",o);if(f!==-1){t.push({type:"text",content:e.slice(o,f+3)}),n=f+3;continue}break}if(e.startsWith("!",o+1)){const f=e.indexOf(">",o);if(f!==-1){n=f+1;continue}break}const s=e.indexOf(">",o);if(s===-1)break;const i=e.slice(o+1,s).trim();if(!i){n=s+1;continue}const r=i.startsWith("/"),l=i.endsWith("/");if(r){const f=i.slice(1).trim();t.push({type:"tag_close",tagName:f}),n=s+1;continue}const a=i.indexOf(" ");let c="",u="";a===-1?c=l?i.slice(0,-1).trim():i.trim():(c=i.slice(0,a).trim(),u=i.slice(a+1));const d={};if(u){const f=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let h;for(;(h=f.exec(u))!==null;){const p=h[1],g=h[2]??h[3]??h[4]??"";p&&!p.endsWith("/")&&(d[p]=g)}}t.push({type:l||Ha.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d}),n=s+1}return t}function QZ(e){const t=String(e.tagName??"").trim();if(!t)return"";if(e.type==="tag_close")return`&lt;/${yl(t)}&gt;`;const n=Object.entries(e.attrs??{}).map(([o,s])=>s===""?` ${yl(o)}`:` ${yl(o)}="${_M(s)}"`).join("");return e.type==="self_closing"?`&lt;${yl(t)}${n} /&gt;`:`&lt;${yl(t)}${n}&gt;`}function XZ(e,t){if(!e||!e.includes("<")||!t||Object.keys(t).length===0)return!1;iS.lastIndex=0;let n;for(;(n=iS.exec(e))!==null;)if(MM(n[1],t))return!0;return!1}function zc(e,t="safe"){if(!e)return"";if(t==="escape")return yl(e);const n=ZZ(e),o=[],s=[],i=[];for(const r of n){if(r.type==="text"){i.length===0&&s.push(yl(r.content??""));continue}const l=Fm(r.tagName);if(!l)continue;if(SM(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"&&hk(l,t)){s.push(QZ(r));continue}if(r.type==="self_closing"){s.push(`<${l}${lS(aS(r.attrs??{},t,l))}>`);continue}if(r.type==="tag_open"){s.push(`<${l}${lS(aS(r.attrs??{},t,l))}>`),Ha.has(l)||o.push(l);continue}const a=o.lastIndexOf(l);if(a===-1)continue;for(;o.length>a+1;){const u=o.pop();u&&s.push(`</${u}>`)}const c=o.pop();c&&s.push(`</${c}>`)}for(;o.length>0;){const r=o.pop();r&&s.push(`</${r}>`)}return s.join("")}const JZ=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],uS="http://www.w3.org/2000/svg",eQ=new Set(["script","style","iframe","object","embed","link","meta"]),tQ=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"]),nQ=new Set(["href","xlink:href","src","srcdoc","action","data","formaction","poster"]),oQ=new Set(["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),sQ=new Set(["circle","ellipse","image","line","path","polygon","polyline","rect","text","tspan","use"]);function iQ(e){return(e.getAttribute("href")||e.getAttribute("xlink:href"))?.startsWith("#")===!0}function rQ(e){return!!(e.getAttribute("href")||e.getAttribute("xlink:href")||e.getAttribute("src"))}function lQ(e){const t=e.nodeName.toLowerCase();return t==="use"?iQ(e):t==="image"?rQ(e):t==="text"||t==="tspan"?!!e.textContent?.trim():sQ.has(t)}function aQ(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 cQ(e,t,n){const o=e.toLowerCase(),s=t.toLowerCase(),i=String(n??"").trim();return i?(o==="use"||o==="marker"||o==="clippath"||o==="mask")&&(s==="href"||s==="xlink:href")?i.startsWith("#")?i:"":o==="a"&&(s==="href"||s==="xlink:href")?Ca(i,{tagName:"a",attrName:"href"})?"":i:o==="image"&&(s==="href"||s==="xlink:href"||s==="src")?Ca(i,{tagName:"img",attrName:"src"})?"":i:s==="href"||s==="xlink:href"?i.startsWith("#")?i:"":Ca(i,{tagName:o,attrName:s})?"":i:""}function uQ(e,t){let n=t+4;for(;n<e.length&&/\s/.test(e[n]??"");)n++;const o=e[n];if(o==='"'||o==="'"){const i=n+1,r=e.indexOf(o,i);if(r===-1)return{next:e.length,url:""};for(n=r+1;n<e.length&&/\s/.test(e[n]??"");)n++;return{next:n<e.length&&e[n]===")"?n+1:n,url:e.slice(i,r)}}const s=n;for(;n<e.length&&e[n]!==")";)n++;return{next:n<e.length?n+1:n,url:e.slice(s,n)}}function EM(e){return e.replace(/\\([0-9a-f]{1,6}\s?|.)/gi,(t,n)=>{const o=n.trim();if(/^[0-9a-f]+$/i.test(o)){const s=Number.parseInt(o,16);try{return Number.isFinite(s)?String.fromCodePoint(s):""}catch{return""}}return String(n).trim()})}function TM(e){const t=EM(e),n=t.toLowerCase();let o=0;for(;o<n.length;){const s=n.indexOf("url(",o);if(s===-1)return!1;const i=uQ(t,s);if(o=Math.max(i.next,s+4),!i.url.trim().startsWith("#"))return!0}return!1}function dS(e){const t=EM(e);return JZ.some(n=>n.test(t))||TM(t)}function dQ(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 eh(e){const t=Number.parseFloat(String(e??""));return Number.isFinite(t)?t:0}function NM(e,t){if(e.nodeType===Node.TEXT_NODE){const s=e.textContent??"";s&&t.push(s);return}if(e.nodeType!==Node.ELEMENT_NODE)return;const n=e,o=n.tagName.toLowerCase();if(!eQ.has(o)){if(o==="br"){t.push(`
265
+ `);return}for(const s of Array.from(n.childNodes))NM(s,t)}}function fQ(e){for(const t of Array.from(e.querySelectorAll("foreignObject"))){const n=[];NM(t,n);const o=n.join("").split(/\r?\n/).map(u=>u.trim()).filter(Boolean);if(!o.length){t.remove();continue}const s=eh(t.getAttribute("width")),i=eh(t.getAttribute("height")),r=eh(t.getAttribute("x")),l=eh(t.getAttribute("y")),a=e.ownerDocument.createElementNS(uS,"text");a.setAttribute("x",String(r+s/2)),a.setAttribute("y",String(l+i/2)),a.setAttribute("text-anchor","middle"),a.setAttribute("dominant-baseline","central");const c=t.querySelector(".nodeLabel");if(c?.getAttribute("class")&&a.setAttribute("class",c.getAttribute("class")),o.length===1)a.textContent=o[0];else{const u=-.6*(o.length-1);for(const[d,f]of o.entries()){const h=e.ownerDocument.createElementNS(uS,"tspan");h.setAttribute("x",String(r+s/2)),h.setAttribute("dy",d===0?`${u}em`:"1.2em"),h.textContent=f,a.appendChild(h)}}t.parentNode?.replaceChild(a,t)}}function hQ(e){fQ(e);const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){const o=n.tagName.toLowerCase();if(!tQ.has(o)){n.remove();continue}if(o==="style"&&dS(n.textContent??"")){n.remove();continue}const s=Array.from(n.attributes);for(const i of s){const r=i.name.toLowerCase();if(/^on/i.test(r)){n.removeAttribute(i.name);continue}if(r==="style"&&i.value&&dS(i.value)){n.removeAttribute(i.name);continue}if(r==="srcdoc"){n.removeAttribute(i.name);continue}if(nQ.has(r)&&i.value){const l=cQ(o,r,i.value);if(!l){n.removeAttribute(i.name);continue}l!==i.value&&n.setAttribute(i.name,l);continue}if(oQ.has(r)&&i.value&&TM(i.value)){n.removeAttribute(i.name);continue}if(i.value){const l=aQ(i.value);l!==i.value&&n.setAttribute(i.name,l)}}dQ(n)}}function Qwe(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 hQ(n),pQ(n)?null:n}catch{return null}}function pQ(e){const t=e.getAttribute("viewBox");if(t){const s=t.trim().split(/[\s,]+/);if(s.length===4){const i=Number.parseFloat(s[2]||""),r=Number.parseFloat(s[3]||"");if(!Number.isFinite(i)||!Number.isFinite(r)||i<=0||r<=0)return!0}}const n=[e,...Array.from(e.querySelectorAll("*"))];let o=!1;for(const s of n){lQ(s)&&(o=!0);for(const i of Array.from(s.attributes))if(/\bNaN\b/i.test(i.value)||i.name==="style"&&/max-width:\s*0(?:px)?/i.test(i.value))return!0}return!o}const fS=[];function B0(e){return String(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function mQ(e){return(String(e||"text").trim().split(/\s+/)[0]||"text").replace(/[^\w+.#:-]/g,"-").replace(/-+/g,"-")||"text"}function gQ(e){return e.replace(/[^\w:.+-]/g,"-").replace(/-+/g,"-")}function hS(e=`editor-${Date.now()}`,t={}){const n=$G(t),o={"common.copy":"Copy"};let s;if(typeof t.i18n=="function")s=t.i18n;else if(t.i18n&&typeof t.i18n=="object"){const f=t.i18n;s=h=>f[h]??o[h]??h}else s=f=>o[f]??f;if(Array.isArray(t.plugin))for(const f of t.plugin){const h=f;if(Array.isArray(h)){const[p,...g]=h;typeof p=="function"&&n.use(p,...g)}else typeof h=="function"&&n.use(h)}if(Array.isArray(t.apply))for(const f of t.apply)try{f(n)}catch(h){console.error("[getMarkdown] apply function threw an error",h)}if(fS.length)for(const f of fS)if(Array.isArray(f)){const[h,...p]=f;typeof h=="function"&&n.use(h,...p)}else typeof f=="function"&&n.use(f);n.use(QW),n.use(ez),n.use(GW);const i=pz,r=i.default??i;n.use(r),n.use(KW),n.use(VW),n.core.ruler.after("block","mark_fence_closed",f=>{const h=f,p=h.src,g=!!h.env?.__markstreamFinal,b=p.split(/\r?\n/);for(const v of h.tokens){if(v.type!=="fence"||!v.map||!v.markup)continue;const m=v.map[0],y=v.map[1],k=v.markup,A=k[0],$=k.length,I=b[Math.max(0,y-1)]??"";let x=0;for(;x<I.length&&(I[x]===" "||I[x]===" ");)x++;let L=0;for(;x+L<I.length&&I[x+L]===A;)L++;let E=x+L;for(;E<I.length&&(I[E]===" "||I[E]===" ");)E++;const F=g?!0:y>m+1&&L>=$&&E===I.length,S=v;S.meta=S.meta??{},S.meta.unclosed=!F,S.meta.closed=!!F}});const l=(f,h)=>{const p=f,g=p.pos;if(p.src[g]!=="~")return!1;const b=p.src[g-1],v=p.src[g+1];if(/\d/.test(b)&&/\d/.test(v)){if(!h){const m=p.push("text","",0);m.content="~"}return p.pos+=1,!0}return!1};n.inline.ruler.before("sub","wave",l),n.renderer.rules.fence=(f,h)=>{const p=f[h],g=String(p.info??"").trim(),b=String(p.content??""),v=btoa(unescape(encodeURIComponent(b))),m=mQ(g),y=B0(m),k=gQ(`editor-${e}-${h}-${m}`),A=B0(s("common.copy"));return`<div class="code-block" data-code="${v}" data-lang="${y}" id="${k}">
266
+ <div class="code-header">
267
+ <span class="code-lang">${B0(m.toUpperCase())}</span>
268
+ <button class="copy-button" data-code="${v}">${A}</button>
269
+ </div>
270
+ <div class="code-editor"></div>
271
+ </div>`};const a=/^\[(\d+)\]/,c=/^\[([^\]\n]+)\]/,u=f=>{if(!f.startsWith("["))return!1;const h=c.exec(f);if(!h)return f!=="["&&!/^\[\d+$/.test(f);const p=String(h[1]??"");return f.slice(h[0].length).startsWith("(")?!1:!/^\d+$/.test(p)},d=(f,h)=>{const p=f;if(p.src[p.pos]!=="[")return!1;const g=a.exec(p.src.slice(p.pos));if(!g)return!1;const b=p.src.slice(Math.max(0,p.pos-120),p.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(b))return!1;const v=p.src.slice(p.pos+g[0].length);if(v.startsWith("](")||v.startsWith("(")||u(v))return!1;if(!h){const m=g[1],y=p.push("reference","span",0);y.content=m,y.markup=g[0],y.raw=g[0]}return p.pos+=g[0].length,!0};return n.inline.ruler.before("escape","reference",d),n.renderer.rules.reference=(f,h)=>{const g=String(f[h].content??"");return`<span class="reference-link" data-reference-id="${g}" role="button" tabindex="0" title="Click to view reference">${g}</span>`},n}function vQ({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 IM({nextContent:e,persistedContent:t,currentState:n,typewriterEnabled:o,streamRenderVersionChanged:s=!1}){const i=`${n.settledContent}${n.streamedDelta}`;return o?n.streamedDelta&&i===e?s?{settledContent:i,streamedDelta:"",appended:!1}:{settledContent:n.settledContent,streamedDelta:n.streamedDelta,appended:!1}:vQ({nextContent:e,previousContent:t??i,typewriterEnabled:o}):{settledContent:e,streamedDelta:"",appended:!1}}const pS=new WeakMap;function yQ(e){let t=pS.get(e);return t||(t={inFlight:new Map,completed:new Set,registeredAllLangs:!1,registeredThemes:[],registeredLangs:[],tail:Promise.resolve()},pS.set(e,t)),t}function mS(e,t){if(!t?.length)return[...e];const n=[...e],o=new Set(n);for(const s of t)o.has(s)||(o.add(s),n.push(s));return n}function mk(e){return!!(e.themes?.length||e.langs?.length)}function LM(e,t){if(!t?.length)return!0;const n=new Set(e);return t.every(o=>n.has(o))}function kQ(e,t){return!t?.length||e.registeredAllLangs?!0:LM(e.registeredLangs,t)}function D0(e,t){return mk(t)&&LM(e.registeredThemes,t.themes)&&kQ(e,t.langs)}function bQ(e,t){if(!mk(t))return t;const n=mS(e.registeredThemes,t.themes),o=e.registeredAllLangs?[]:mS(e.registeredLangs,t.langs);return{...n.length?{themes:n}:{},...o.length?{langs:o}:{}}}const xQ={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 wQ(e){const t=String(e??"").trim();if(!t)return"";const[n=""]=t.split(/\s+/);return n.split(":")[0]?.trim().toLowerCase()??""}function $M(e){const t=wQ(e);return xQ[t]??t}function FM(e){if(!Array.isArray(e))return;const t=e.filter(o=>typeof o=="string").map(o=>$M(o)).filter(Boolean),n=Array.from(new Set(t)).sort();return n.length>0?n:void 0}function OM(e){if(!Array.isArray(e))return;const t=[],n=new Set;for(const o of e){if(typeof o!="string")continue;const s=o.trim();!s||n.has(s)||(n.add(s),t.push(s))}return t.length>0?t:void 0}function _Q(e){return OM(e)?.join("\0")??""}function RM(e,t){const n=OM(e),o=FM(t);return{...n?.length?{themes:n}:{},...o?.length?{langs:o}:{}}}function Mp(e,t){return`${_Q(e)}\0\0${FM(t)?.join("\0")??""}`}function Xwe(e,t,n={hasRegisterHighlight:!0,hasCreateRenderer:!0}){const o=RM(e,t),s={...o},i=!!(s.langs?.length&&n.hasCreateRenderer&&!n.hasRegisterHighlight);return i&&(delete o.langs,delete s.langs),{key:Mp(s.themes,s.langs),registerOptions:o,rendererOptions:s,ignoredLangs:i}}async function Jwe(e,t={},n){if(!e)return"ready";const o=RM(t.themes,t.langs),s=Mp(o.themes,o.langs),i=n&&n===s?n:s,r=yQ(e);if(r.completed.has(i))return"ready";if(D0(r,o))return r.completed.add(i),"ready";const l=r.inFlight.get(i);if(l)return l;const a=r.tail.catch(()=>{}).then(()=>{if(r.completed.has(i)||D0(r,o))return r.completed.add(i),"ready";const c=bQ(r,o),u=Mp(c.themes,c.langs);return r.completed.has(u)||D0(r,c)?(r.completed.add(i),r.completed.add(u),"ready"):Promise.resolve(e(c)).then(()=>(mk(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 rc(e,t,n=1){const o=Number(e);return Number.isFinite(o)?Math.max(n,o):t}function gS(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var SQ=class{constructor(e={},t){this.source="",this.visible="",this.done=!1,this.paused=!1,this.listeners=new Set,this.rafId=0,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.hasStarted=!1,this.destroyed=!1,this.getSnapshot=()=>({source:this.source,visible:this.visible,done:this.done,paused:this.paused,pendingChars:this.pendingChars,caughtUp:this.caughtUp,final:this.final}),this.subscribe=d=>this.destroyed?()=>{}:(this.listeners.add(d),()=>{this.listeners.delete(d)}),this.enqueue=d=>{if(this.destroyed||!d)return;this.done&&(this.done=!1);const f=this.source.length>0,h=this.pendingChars<=0;if(this.source+=d,h){const p=vS();this.startedAt=f&&this.hasStarted?p-this.normalizedStartDelayMs:p,this.lastTick=p,this.charBudget=0}this.hasStarted=!0,this.emit(),this.ensureLoop()},this.finish=(d={})=>{if(!this.destroyed){if(this.done=!0,d.flush??this.flushOnFinish){this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit();return}this.emit(),this.ensureLoop()}},this.flush=()=>{this.destroyed||(this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit())},this.reset=(d="")=>{this.destroyed||(this.cancelLoop(),this.source=d,this.visible=d,this.done=!1,this.paused=!1,this.hasStarted=!1,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.emit())},this.pause=()=>{this.destroyed||this.paused||(this.paused=!0,this.cancelLoop(),this.emit())},this.resume=()=>{if(this.destroyed||!this.paused)return;this.paused=!1;const d=vS();this.lastTick=d,this.startedAt||=d,this.emit(),this.ensureLoop()},this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.cancelLoop(),this.listeners.clear())},this.dispose=()=>{this.destroy()},this.tick=d=>{if(this.rafId=0,this.destroyed||this.paused)return;if(this.pendingChars<=0){this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond;return}if(d-this.startedAt<this.normalizedStartDelayMs){this.rafId=requestAnimationFrame(this.tick);return}const f=1e3/Math.max(1,this.maxCommitFps),h=Math.min(100,Math.max(0,d-this.lastTick));if(h<f){this.rafId=requestAnimationFrame(this.tick);return}this.lastTick=d;const p=this.pendingChars,g=p>this.normalizedCatchUpThreshold?this.normalizedCatchUpLatencyMs:this.normalizedTargetLatencyMs,b=EQ(p/Math.max(.001,g/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(b-this.currentCps)*.2,this.charBudget+=this.currentCps*(h/1e3),this.charBudget<1){this.ensureLoop();return}const v=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),m=MQ(this.source.slice(this.visible.length),v,this.segmenter);m.text&&(this.visible+=m.text,this.charBudget=Math.max(0,this.charBudget-m.graphemeCount),this.emit()),this.ensureLoop()};const{minCharsPerSecond:n=40,maxCharsPerSecond:o=1e3,targetLatencyMs:s=900,catchUpLatencyMs:i=350,catchUpThreshold:r=600,maxCommitFps:l=30,startDelayMs:a=80,maxCharsPerCommit:c=80,flushOnFinish:u=!1}=e;this.minCharsPerSecond=rc(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,rc(o,1e3,1)),this.normalizedTargetLatencyMs=rc(s,900,1),this.normalizedCatchUpLatencyMs=rc(i,350,1),this.normalizedCatchUpThreshold=gS(r,600),this.normalizedStartDelayMs=gS(a,80),this.maxCommitFps=Math.trunc(rc(l,30,1)),this.maxCharsPerCommit=Math.trunc(rc(c,80,1)),this.flushOnFinish=u,this.segmenter=AQ(),t&&this.listeners.add(t),this.currentCps=this.minCharsPerSecond}get pendingChars(){return Math.max(0,this.source.length-this.visible.length)}get caughtUp(){return this.pendingChars===0}get final(){return this.done&&this.caughtUp}ensureLoop(){if(!(this.destroyed||this.rafId||this.paused||this.pendingChars<=0)){if(typeof requestAnimationFrame!="function"){this.flush();return}this.rafId=requestAnimationFrame(this.tick)}}cancelLoop(){this.rafId&&(typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(this.rafId),this.rafId=0)}emit(){if(!this.destroyed)for(const e of this.listeners)e()}};function CQ(e={},t){const n=new SQ(e,t);return{getSnapshot:n.getSnapshot,subscribe:n.subscribe,enqueue:n.enqueue,finish:n.finish,flush:n.flush,reset:n.reset,pause:n.pause,resume:n.resume,destroy:n.destroy,dispose:n.dispose}}function AQ(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function MQ(e,t,n){if(!e||t<=0)return{text:"",graphemeCount:0};if(!n){const i=Array.from(e).slice(0,t);return{text:i.join(""),graphemeCount:i.length}}let o="",s=0;for(const i of n.segment(e)){if(s>=t)break;o+=i.segment,s++}return{text:o,graphemeCount:s}}function vS(){return typeof performance<"u"?performance.now():Date.now()}function EQ(e,t,n){return Math.min(n,Math.max(t,e))}var TQ=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(c){s(c)}},r=a=>{try{l(n.throw(a))}catch(c){s(c)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const yv=Symbol.for("markstream-vue:node-lifecycle"),yS='<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>',kS='<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>',NQ={id:"material",core:{"":kS,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:kS,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:yS,csharp:yS,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:()=>ms(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},kv=new Map;let bS="material";const Mc=new Map,xS=new Map;let bv=null;function IQ(e){kv.set(e.id,e)}function LQ(e){return TQ(this,null,function*(){var t,n,o;if(Mc.has(e.id))return(t=Mc.get(e.id))!=null?t:null;let s=xS.get(e.id);return s||(s=((o=(n=e.loadExtended)==null?void 0:n.call(e))!=null?o:Promise.resolve(null)).then(i=>(Mc.set(e.id,i),bv?.(),i)).catch(()=>(Mc.set(e.id,null),null)),xS.set(e.id,s)),s})}const $Q=Ba(0);bv=()=>{$Q.value++},IQ(NQ);const FQ={"":"",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 gk(e){var t;const n=(function(o){if(!o)return"";const s=o.trim();if(!s)return"";const[i]=s.split(/\s+/),[r]=i.split(":");return r.toLowerCase()})(e);return(t=FQ[n])!=null?t:n}function e_e(e){const t=gk(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return t}}function t_e(e){return(function(o){const s=kv.get(bS);if(!s)return;const i=s.core[o];if(i)return i;const r=Mc.get(s.id);if(r){const l=r[o];if(l)return l}s.loadExtended&&!Mc.has(s.id)&&LQ(s)})(gk(e))||((n=(t=kv.get(bS))==null?void 0:t.fallback)!=null?n:"");var t,n}const n_e={js:"JavaScript",javascript:"JavaScript",ts:"TypeScript",jsx:"JSX",tsx:"TSX",html:"HTML",css:"CSS",scss:"SCSS",json:"JSON",py:"Python",python:"Python",rb:"Ruby",go:"Go",java:"Java",c:"C",cpp:"C++",cs:"C#",csharp:"C#",php:"PHP",sh:"Shell",bash:"Bash",sql:"SQL",yaml:"YAML",md:"Markdown",d2:"D2",d2lang:"D2","":"Plain Text",plain:"Plain Text"};let BM=!1;function o_e(){return BM}function s_e(){BM=!0}var Om=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(c){s(c)}},r=a=>{try{l(n.throw(a))}catch(c){s(c)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});let js=null,Ah=!1,Rm=yk;function Bm(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function vk(){try{const e=globalThis;return Bm(e?.katex)}catch{return null}}function yk(){return Om(null,null,function*(){const e=vk();if(e)return e;const t=yield ms(()=>import("./katex-DnlPpQZa.js"),[]);try{yield ms(()=>import("./mhchem-DtR62fUK.js"),__vite__mapDeps([2,3]))}catch{}return Bm(t)})}function OQ(e){Rm=e,js=null,Ah=!1}function RQ(e){OQ(yk)}function DM(){return typeof Rm=="function"}function i_e(){var e;const t=Rm;if(!t||t===yk)return null;if(js)return js;const n=vk();if(n)return js=n,js;try{const o=t();return o&&typeof o?.then!="function"?(js=(e=Bm(o))!=null?e:o,js):null}catch{return null}}function kk(){return Om(this,null,function*(){var e;const t=vk();if(t)return js=t,js;if(js)return js;if(Ah)return null;const n=Rm;if(!n)return Ah=!0,null;try{const o=yield n();if(o)return js=(e=Bm(o))!=null?e:o,js}catch{}return Ah=!0,null})}function PM(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let xl=null,ml=null;const pi=new Map,Fr=new Map;let Ep=5;const ka=new Set;function Bd(){if(pi.size<Ep&&ka.size){const e=Array.from(ka);ka.clear();for(const t of e)try{t()}catch{}}}function BQ(e){xl=e,ml=null,xl.onmessage=t=>{const{id:n,html:o,error:s}=t.data,i=pi.get(n);if(i)if(pi.delete(n),clearTimeout(i.timeoutId),Bd(),s)i.reject(new Error(s));else{const{content:r,displayMode:l}=t.data;if(r){const a=`${l?"d":"i"}:${r}`;if(Fr.set(a,o),Fr.size>200){const c=Fr.keys().next().value;Fr.delete(c)}}i.resolve(o)}},xl.onerror=t=>{console.error("[katexWorkerClient] Worker error:",t);for(const[n,o]of pi.entries())clearTimeout(o.timeoutId),o.reject(new Error(`Worker error: ${t.message}`));pi.clear(),Bd()}}function DQ(){var e;xl&&((e=xl.terminate)==null||e.call(xl)),xl=null,ml=null}function PQ(e,t=!0,n=2e3,o){return Om(this,null,function*(){performance.now();const s=PM(e);if(!DM()){const a=new Error("KaTeX rendering disabled");return a.name="KaTeXDisabled",a.code="KATEX_DISABLED",Promise.reject(a)}if(ml)return Promise.reject(ml);const i=`${t?"d":"i"}:${s}`,r=Fr.get(i);if(r)return Promise.resolve(r);const l=xl||(ml=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),ml.name="WorkerInitError",ml.code="WORKER_INIT_ERROR",null);if(!l)return Promise.reject(ml);if(pi.size>=Ep){const a=new Error("Worker busy");return a.name="WorkerBusy",a.code="WORKER_BUSY",a.busy=!0,a.inFlight=pi.size,a.max=Ep,Promise.reject(a)}return new Promise((a,c)=>{if(o?.aborted){const p=new Error("Aborted");return p.name="AbortError",void c(p)}const u=Math.random().toString(36).slice(2),d=globalThis.setTimeout(()=>{pi.delete(u);const p=new Error("Worker render timed out");p.name="WorkerTimeout",p.code="WORKER_TIMEOUT",c(p),Bd()},n);o&&o.addEventListener("abort",()=>{globalThis.clearTimeout(d),pi.has(u)&&pi.delete(u);const p=new Error("Aborted");p.name="AbortError",c(p),Bd()},{once:!0});const f=a,h=c;pi.set(u,{resolve:p=>{f(p)},reject:p=>{h(p)},timeoutId:d}),l.postMessage({id:u,content:s,displayMode:t})})})}function r_e(e,t=!0,n){const o=`${t?"d":"i"}:${PM(e)}`;if(Fr.set(o,n),Fr.size>200){const s=Fr.keys().next().value;Fr.delete(s)}}const HQ="WORKER_BUSY";function WQ(e=2e3,t){return pi.size<Ep?Promise.resolve():new Promise((n,o)=>{let s,i=!1;const r=()=>{i||(i=!0,s&&globalThis.clearTimeout(s),ka.delete(r),n())};if(ka.add(r),s=globalThis.setTimeout(()=>{if(i)return;i=!0,ka.delete(r);const l=new Error("Wait for worker slot timed out");l.name="WorkerBusyTimeout",l.code="WORKER_BUSY_TIMEOUT",o(l)},e),queueMicrotask(()=>Bd()),t){const l=()=>{if(i)return;i=!0,s&&globalThis.clearTimeout(s),ka.delete(r);const a=new Error("Aborted");a.name="AbortError",o(a)};t.aborted?l():t.addEventListener("abort",l,{once:!0})}})}const Ou={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function l_e(e){return Om(this,arguments,function*(t,n=!0,o={}){var s,i,r,l;if(!DM()){const g=new Error("KaTeX rendering disabled");throw g.name="KaTeXDisabled",g.code="KATEX_DISABLED",g}const a=(s=o.timeout)!=null?s:Ou.timeout,c=(i=o.waitTimeout)!=null?i:Ou.waitTimeout,u=(r=o.backoffMs)!=null?r:Ou.backoffMs,d=(l=o.maxRetries)!=null?l:Ou.maxRetries,f=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):Ou.maxRetries,h=o.signal;let p=0;for(;;){if(h?.aborted){const g=new Error("Aborted");throw g.name="AbortError",g}try{return yield PQ(t,n,a,h)}catch(g){if(g?.code!==HQ||p>=f)throw g;if(p++,yield WQ(c,h).catch(()=>{}),h?.aborted){const b=new Error("Aborted");throw b.name="AbortError",b}u>0&&(yield new Promise(b=>globalThis.setTimeout(b,u*p)))}}})}function Ec(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function zQ(e){var t;for(const n of e.split(/\r?\n/)){const o=n.trim();if(!o||o.startsWith("%%"))continue;const s=o.match(/^([A-Z][\w-]*)\b/i);return((t=s?.[1])==null?void 0:t.toLowerCase())||""}return""}function xv(e){const t=e.split(/\r?\n/).map(s=>s.trim()).filter(s=>s&&!s.startsWith("%%")),n=Math.max(1,t.length),o=zQ(e);return o==="gantt"?220+28*n:o==="sequencediagram"?180+26*n:o==="classdiagram"||o==="statediagram"||o==="erdiagram"?180+24*n:o==="flowchart"||o==="graph"?170+28*n:200+22*n}function wv(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 HM(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function _v(e,t=360,n=500){return HM(e,t,n)}function Sv(e,t=360,n=500){return HM(e,t,n)}var UQ=Object.defineProperty,qQ=Object.defineProperties,jQ=Object.getOwnPropertyDescriptors,wS=Object.getOwnPropertySymbols,VQ=Object.prototype.hasOwnProperty,KQ=Object.prototype.propertyIsEnumerable,_S=(e,t,n)=>t in e?UQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,WM=(e,t)=>{for(var n in t||(t={}))VQ.call(t,n)&&_S(e,n,t[n]);if(wS)for(var n of wS(t))KQ.call(t,n)&&_S(e,n,t[n]);return e},bk=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(c){s(c)}},r=a=>{try{l(n.throw(a))}catch(c){s(c)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const xk=()=>ms(()=>import("./mermaid.core-CYrANWGu.js").then(e=>e.bn),[]);let br=null,wk=xk;function GQ(e){wk=e,br=null}function YQ(e){GQ(xk)}function ZQ(){return typeof wk=="function"}function SS(e){if(!e)return e;const t=e&&e.default?e.default:e;if(t&&(typeof t.render=="function"||typeof t.parse=="function"||typeof t.initialize=="function"))return t;if(t&&t.mermaidAPI&&(typeof t.mermaidAPI.render=="function"||typeof t.mermaidAPI.parse=="function")){const s=t.mermaidAPI;return n=WM({},t),o={render:s.render.bind(s),parse:s.parse?s.parse.bind(s):void 0,initialize:i=>typeof t.initialize=="function"?t.initialize(i):s.initialize?s.initialize(i):void 0},qQ(n,jQ(o))}var n,o;return e.mermaid&&typeof e.mermaid.render=="function"?e.mermaid:t}function CS(e){if(e)try{const t=e?.initialize;e.initialize=n=>{const o=WM({suppressErrorRendering:!0},n||{});return typeof t=="function"?t.call(e,o):e?.mermaidAPI&&typeof e.mermaidAPI.initialize=="function"?e.mermaidAPI.initialize(o):void 0}}catch{}}function a_e(){return bk(this,null,function*(){if(br)return br;const e=(function(){try{const o=globalThis;return SS(o?.mermaid)}catch{return null}})();if(e)return br=e,CS(br),br;const t=wk;if(!t)return null;let n;try{n=yield t()}catch(o){throw t===xk?new Error('Optional dependency "mermaid" is not installed. Please install it to enable mermaid diagrams.'):o}return n?(br=SS(n),CS(br),br):null})}let hs=null,gl=null;const Uo=new Map;let AS=5,MS=!1;const QQ="WORKER_BUSY",XQ="MERMAID_DISABLED";function JQ(e){hs=e,gl=null;const t=e;hs.onmessage=n=>{if(hs!==t)return;const{id:o,ok:s,result:i,error:r}=n.data,l=Uo.get(o);l&&(s===!1||r?l.reject(new Error(r||"Unknown error")):l.resolve(i))},hs.onerror=n=>{var o,s;if(hs===t)if(Uo.size!==0){try{MS?console.error("[mermaidWorkerClient] Worker error:",n?.message||n):(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker error:",n?.message||n)}catch{}for(const[i,r]of Uo.entries())r.reject(new Error(`Worker error: ${n.message}`));Uo.clear()}else(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker error (no pending):",n?.message||n)},hs.onmessageerror=n=>{var o,s;if(hs===t)if(Uo.size!==0){try{MS?console.error("[mermaidWorkerClient] Worker messageerror:",n):(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker messageerror:",n)}catch{}for(const[i,r]of Uo.entries())r.reject(new Error("Worker messageerror"));Uo.clear()}else(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",n)}}function eX(){var e;if(hs)try{for(const[t,n]of Uo.entries())n.reject(new Error("Worker cleared"));Uo.clear(),(e=hs.terminate)==null||e.call(hs)}catch{}hs=null,gl=null}function zM(e,t,n=1400){if(!ZQ()){const s=new Error("Mermaid rendering disabled");return s.name="MermaidDisabled",s.code=XQ,Promise.reject(s)}if(gl)return Promise.reject(gl);const o=hs||(gl=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),gl.name="WorkerInitError",gl.code="WORKER_INIT_ERROR",null);if(!o)return Promise.reject(gl);if(Uo.size>=AS){const s=new Error("Worker busy");return s.name="WorkerBusy",s.code=QQ,s.inFlight=Uo.size,s.max=AS,Promise.reject(s)}return new Promise((s,i)=>{const r=Math.random().toString(36).slice(2);let l,a=!1;const c=()=>{a||(a=!0,l!=null&&globalThis.clearTimeout(l),Uo.delete(r))},u={resolve:d=>{c(),s(d)},reject:d=>{c(),i(d)}};Uo.set(r,u);try{o.postMessage({id:r,action:e,payload:t})}catch(d){return Uo.delete(r),void i(d)}l=globalThis.setTimeout(()=>{const d=new Error("Worker call timed out");d.name="WorkerTimeout",d.code="WORKER_TIMEOUT";const f=Uo.get(r);f&&f.reject(d)},n)})}function c_e(e,t,n=1400){return bk(this,null,function*(){try{return yield zM("canParse",{code:e,theme:t},n)}catch(o){return Promise.reject(o)}})}function u_e(e,t,n=1400){return bk(this,null,function*(){try{return yield zM("findPrefix",{code:e,theme:t},n)}catch(o){return Promise.reject(o)}})}function d_e(){if(hs)try{for(const[e,t]of Uo.entries())t.reject(new Error("Worker terminated"));Uo.clear(),hs.terminate()}finally{hs=null}}var tX=Object.defineProperty,nX=Object.defineProperties,oX=Object.getOwnPropertyDescriptors,ES=Object.getOwnPropertySymbols,sX=Object.prototype.hasOwnProperty,iX=Object.prototype.propertyIsEnumerable,TS=(e,t,n)=>t in e?tX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,lt=(e,t)=>{for(var n in t||(t={}))sX.call(t,n)&&TS(e,n,t[n]);if(ES)for(var n of ES(t))iX.call(t,n)&&TS(e,n,t[n]);return e},Pt=(e,t)=>nX(e,oX(t)),Xn=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(c){s(c)}},r=a=>{try{l(n.throw(a))}catch(c){s(c)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const rX="__global__",P0="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",Cv=(()=>{const e=globalThis;if(e[P0])return e[P0];const t={scopedCustomComponents:{},revision:Ba(0)};return e[P0]=t,t})(),NS=Cv.revision,lX=Symbol("markstreamCustomComponents"),aX=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 ef(e){return aX.has(String(e).trim().toLowerCase())}function cX(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function H0(e={}){const t={};for(const[n,o]of Object.entries(e))if(o!=null){t[n]=o;for(const s of new Set([_i(n),_i(cX(n))]))!s||ef(s)||Object.prototype.hasOwnProperty.call(t,s)||(t[s]=o)}return t}function Co(e){const t=Kt(lX,null);return R(()=>{var n;return NS.value,(function(o,s={}){return NS.value,lt(lt(lt({},H0(Cv.scopedCustomComponents[rX]||{})),H0(s)),H0((function(i){return i&&Cv.scopedCustomComponents[i]||{}})(o)))})(e?.(),(n=t?.value)!=null?n:{})})}const uX=["aria-label"],dX={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"},fX={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"},gn=(e,t)=>{const n=e.__vccOpts||e;for(const[o,s]of t)n[o]=s;return n},Ys=gn(Ze({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(w(),T("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(w(),T("svg",fX,[...n[1]||(n[1]=[_("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",fill:"currentColor"},null,-1),_("path",{d:"M9 12l2 2 4-4",stroke:"hsl(var(--ms-background))","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(w(),T("svg",dX,[...n[0]||(n[0]=[_("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,uX))}),[["__scopeId","data-v-be21ab83"]]);Ys.install=e=>{e.component(Ys.__name,Ys)};const hX={class:"emoji-node"},$s=gn(Ze({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(w(),T("span",hX,O(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);$s.install=e=>{e.component($s.__name,$s)};const pX=["id"],mX=["title"],Zs=gn(Ze({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const t=`#fnref--${e.node.id}`;function n(){if(typeof document>"u")return;const o=document.querySelector(t);o?o.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${t} not found`)}return(o,s)=>(w(),T("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[_("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+O(e.node.id)+"]",9,mX)],8,pX))}}),[["__scopeId","data-v-c1463a29"]]);Zs.install=e=>{e.component(Zs.__name,Zs)};const UM=(()=>{try{return!1}catch{}return!1})();function W0(e){UM&&console.warn(e)}function IS(e,t="safe",n){return pk(e,t,n)}function qM(e){return GZ(e)}function z0(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function _k(e,t="safe"){const n=String(e.tag||e.type||"").trim(),o=vv((s=e.attrs)?Array.isArray(s)?s.every(Array.isArray)?s.map(([r,l])=>[String(r),z0(l)]):s.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),z0(r.value)]):Object.entries(s).map(([r,l])=>[r,z0(l)]):null,t,n);var s;if(!o)return;const i=qM(Ap(o));return Object.keys(i).length>0?i:void 0}function LS(e,t,n=!1){const o=Object.entries(t??{}),s=o.length>0?o.map(([i,r])=>r===""?` ${i}`:` ${i}="${r}"`).join(""):"";return n?`<${e}${s} />`:`<${e}${s}>`}function Ru(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function U0(e,t,n,o,s,i,r=!1){const l=(function(d,f){return MM(d,f)})(e,o);if(Qd.has(e.toLowerCase())||!l&&SM(e,i))return null;if(!l&&hk(e,i))return r?[LS(e,t,!0)]:[LS(e,t),...n,`</${e}>`];const a=pk(t,i,e),c=a.key,u=c!=null&&c!==""?c:s;if(l){const d=o[e]||o[e.toLowerCase()],f=qM(a);return mn(d,Pt(lt({},f),{key:u}),n.length>0?n:void 0)}return mn(e,Pt(lt({},a),{innerHTML:void 0,key:u}),n.length>0?n:void 0)}function jM(e,t){return XZ(e,t)}function Tp(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=U0(d.tagName,d.attrs||{},[],r,"ms-html-"+a++,l,!0);Ru(c.length>0?c[c.length-1].children:u,f)}else if(d.type==="tag_open")c.push({tagName:d.tagName,children:[],attrs:d.attrs,autoKey:"ms-html-"+a++});else if(d.type==="tag_close"){const f=d.tagName.toLowerCase();let h=-1;for(let p=c.length-1;p>=0;p--)if(c[p].tagName.toLowerCase()===f){h=p;break}if(h!==-1)for(;c.length>h;){const p=c.pop(),g=U0(p.tagName,p.attrs||{},p.children,r,p.autoKey,l);c.length>0?Ru(c[c.length-1].children,g):Ru(u,g),p.tagName.toLowerCase()!==f&&c.length>h&&W0(`Auto-closing unclosed tag: <${p.tagName}>`)}else W0(`Ignoring closing tag with no matching opening tag: </${d.tagName}>`)}for(;c.length>0;){const d=c.pop(),f=U0(d.tagName,d.attrs||{},d.children,r,d.autoKey,l);c.length>0?Ru(c[c.length-1].children,f):Ru(u,f),W0(`Auto-closing unclosed tag: <${d.tagName}>`)}return u})(YZ(e),t,n)}catch(s){return o=s,UM&&console.error("Failed to parse HTML to VNodes:",o),null}var o}const gX=["innerHTML"],Qs=gn(Ze({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Kt("markstreamHtmlPolicy",void 0),o=R(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),s=Co(()=>t.customId),i=Ze({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=R(()=>{const l=t.node.content;if(!l)return{mode:"html",content:""};if(o.value==="escape")return{mode:"html",content:zc(l,o.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const c=Tp(l,s.value,o.value);if(c!==null)return{mode:"dynamic",nodes:c}}if(!jM(l,s.value))return{mode:"html",content:zc(l,o.value)};const a=Tp(l,s.value,o.value);return a===null?{mode:"html",content:zc(l,o.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>r.value.mode==="dynamic"?(w(),T("span",{key:0,class:We(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[re(C(i),{nodes:r.value.nodes},null,8,["nodes"])],2)):r.value.mode==="text"?(w(),T("span",{key:1,class:We(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},O(r.value.content),3)):(w(),T("span",{key:2,class:We(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,gX))}}),[["__scopeId","data-v-d17f12b0"]]);Qs.install=e=>{e.component(Qs.__name,Qs)};const vX={class:"inline-code"},yX={key:0},ts=gn(Ze({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=Vd(),o=Kt("markstreamFade",void 0),s=Kt("markstreamTextStreamState",void 0),i=Kt("markstreamStreamVersion",void 0),r=R(()=>{const m=n.fade;return m===""||m===!0||m==="true"||m!==!1&&m!=="false"&&void 0}),l=R(()=>typeof r.value=="boolean"?r.value:typeof o?.value!="boolean"||o.value),a=R(()=>{var m;return String((m=t.node.code)!=null?m:"")}),c=R(()=>!l.value),u=R(()=>{var m;const y=(m=n["index-key"])!=null?m:n.indexKey;return y==null||y===""?"":String(y)}),d=J(t.node.code),f=J("");let h=i?.value;const p=J(0);function g(){return d.value+f.value}function b(){f.value&&(d.value=g(),f.value="")}Qe([()=>t.node.code,u,l,()=>i?.value],([m,y,k,A])=>{const $=String(m??""),I=u.value,x=A!==h;h=A;const L=IM({nextContent:$,persistedContent:I?s?.get(I):void 0,currentState:{settledContent:d.value,streamedDelta:f.value},typewriterEnabled:l.value,streamRenderVersionChanged:x});d.value=L.settledContent,f.value=L.streamedDelta,L.appended&&(p.value+=1),I&&s?.set(I,$)},{immediate:!0}),Qe(l,m=>{var y;m||(y=g(),d.value=y,f.value="")});const v=R(()=>p.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(m,y)=>(w(),T("code",vX,[c.value?(w(),T(Pe,{key:0},[Je(O(a.value),1)],64)):(w(),T(Pe,{key:1},[d.value?(w(),T("span",yX,O(d.value),1)):ce("",!0),f.value?(w(),T("span",{key:1,class:We(["inline-code-stream-delta",[v.value]]),onAnimationend:b},O(f.value),35)):ce("",!0)],64))]))}}),[["__scopeId","data-v-1b73ee4e"]]);ts.install=e=>{e.component(ts.__name,ts)};const Av=J(!1),$S=J(""),FS=J("top"),cd=J(null),ud=J(null),Mv=J(null),Ev=J(null),OS=J(null);let Mh=null,Eh=null,Tv=0;function VM(){Mh&&(clearTimeout(Mh),Mh=null),Eh&&(clearTimeout(Eh),Eh=null)}let th=!1,nh=null,RS=!1;function kX(e,t,n="top",o=!1,s,i){if(!e)return;const r=++Tv;VM();const l=()=>Xn(null,null,function*(){var a,c;if(yield(function(){return Xn(this,null,function*(){if(!th&&!RS&&typeof document<"u"){nh!=null||(nh=Xn(null,null,function*(){const[{createApp:u,h:d},{default:f}]=yield Promise.all([ms(()=>import("./vue.runtime.esm-bundler-DI8JNuz0.js"),[]),ms(()=>import("./Tooltip-Dwaxrzgs.js"),[])]),h=document.createElement("div");h.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(h),u({setup:()=>()=>{var p;return d(f,{visible:Av.value,"anchor-el":cd.value,content:$S.value,placement:FS.value,id:ud.value,originX:Mv.value,originY:Ev.value,isDark:(p=OS.value)!=null?p:void 0})}}).mount(h),th=!0}));try{yield nh}catch(u){th=!1,nh=null,RS=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",u)}}})})(),th&&r===Tv){ud.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,cd.value=e,$S.value=t,FS.value=n,Mv.value=(a=s?.x)!=null?a:null,Ev.value=(c=s?.y)!=null?c:null,OS.value=typeof i=="boolean"?i:null,Av.value=!0;try{e.setAttribute("aria-describedby",ud.value)}catch{}}});o?l():Mh=setTimeout(l,80)}function bX(e=!1){Tv+=1,VM();const t=()=>{if(cd.value&&ud.value)try{cd.value.removeAttribute("aria-describedby")}catch{}Av.value=!1,cd.value=null,ud.value=null,Mv.value=null,Ev.value=null};e?t():Eh=setTimeout(t,120)}const Nv={"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..."},Iv=e=>{var t;return(t=Nv[e])!=null?t:(function(n){return(n.split(".").pop()||n).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,o=>o.toUpperCase()).trim()})(e)};function BS(e){return{t(t){if(e.te&&Nv[t]&&!e.te(t))return Iv(t);const n=e.t(t);return n===t&&Nv[t]?Iv(t):n}}}function xX(){const e=(function(){var t,n;try{const o=Yo(),s=o?.proxy,i=s?.$t;if(typeof i=="function"){const a=s?.$te;return{t:i.bind(s),te:typeof a=="function"?a.bind(s):void 0}}const r=(n=(t=o?.appContext)==null?void 0:t.config)==null?void 0:n.globalProperties,l=r?.$t;if(typeof l=="function"){const a=r?.$te;return{t:l.bind(r),te:typeof a=="function"?a.bind(r):void 0}}}catch{}return null})();if(e)return BS(e);try{const t=globalThis.$vueI18nUse||null;if(t&&typeof t=="function")try{const n=t();if(n&&typeof n.t=="function")return BS({t:n.t.bind(n),te:typeof n.te=="function"?n.te.bind(n):void 0})}catch{}}catch{}return{t:Iv}}function wX(e,t){var n,o;const s=(o=(n=e.indexKey)!=null?n:t["index-key"])!=null?o:t.indexKey;return s==null||s===""?"":String(s)}const _X=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],SX={key:1,class:"image-placeholder"},CX={key:1,class:"image-node__raw-text"},AX={key:0,class:"image-shimmer-overlay"},MX={key:1,class:"image-node__raw-text"},EX={key:2,class:"image-error"},Al=gn(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,o=t,s=J(!1),i=J(!1),r=J(""),l=J("primary"),a=J(null),c=Vd(),u=Kt(yv,null);let d="",f=null;const h=R(()=>v_(n.node.src)),p=R(()=>v_(n.fallbackSrc)),g=R(()=>r.value),b=R(()=>!n.lazy),v=R(()=>!n.node.loading&&l.value!=="failed"&&r.value.length>0),m=R(()=>l.value==="failed"),y=R(()=>!b.value&&!s.value&&!i.value&&l.value!=="failed"&&r.value.length>0),k=R(()=>wX(n,c));function A(D=k.value){D&&a.value&&u?.reportHeight(D,a.value.offsetHeight)}function $(D=k.value){D&&mt(()=>{A(D)})}function I(){f&&(clearTimeout(f),f=null)}function x(){const D=k.value;D&&d!==D&&(d&&u?.markSettled(d),I(),d=D,u?.markPending(D),typeof window<"u"&&(f=window.setTimeout(()=>{d===D&&($(D),L())},8e3)))}function L(){return Xn(this,null,function*(){const D=d;D&&(I(),d="",yield mt(),A(D),u?.markSettled(D))})}function E(){if(l.value==="primary"&&p.value&&p.value!==r.value)return l.value="fallback",r.value=p.value,s.value=!1,i.value=!1,void $();l.value="failed",i.value=!0,o("error",r.value),$()}function F(){s.value=!0,i.value=!1,o("load",g.value),$()}function S(D){D.preventDefault(),s.value&&!i.value&&o("click",[D,g.value])}const{t:N}=xX();return Qe([h,p,()=>n.node.loading],()=>(s.value=!1,i.value=!1,n.node.loading||h.value?(r.value=h.value,void(l.value="primary")):p.value?(r.value=p.value,void(l.value="fallback")):(r.value="",l.value="failed",void(i.value=!0))),{immediate:!0}),Qe([v,s,i,g,()=>n.lazy],([D,B,U,H,P])=>D&&H&&!U?B?(L(),void $()):P?(x(),void $()):void(B||U||x()):(L(),void $()),{flush:"post",immediate:!0}),po(()=>{(function(){const D=d;D&&(I(),d="",u?.markSettled(D))})()}),(D,B)=>{var U,H,P,Z,K;return w(),T("span",{ref_key:"rootRef",ref:a,class:"image-node-container"},[v.value?(w(),T("img",{key:0,src:g.value,alt:String((H=(U=n.node.alt)!=null?U:n.node.title)!=null?H:""),title:String((Z=(P=n.node.title)!=null?P:n.node.alt)!=null?Z:""),class:We(["image-node__img",{"is-loading":!b.value&&!s.value,"is-loaded":b.value||s.value,"has-natural-size":s.value,"cursor-pointer":s.value}]),loading:n.lazy?"lazy":void 0,fetchpriority:b.value?"high":void 0,decoding:b.value?"sync":"async",tabindex:s.value?0:-1,"aria-label":(K=n.node.alt)!=null?K:C(N)("image.preview"),onError:E,onLoad:F,onClick:S},null,42,_X)):ce("",!0),e.node.loading&&!i.value?(w(),T("span",SX,[n.usePlaceholder?On(D.$slots,"placeholder",{key:0,node:n.node,displaySrc:g.value,imageLoaded:s.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[B[0]||(B[0]=_("span",{class:"image-shimmer"},null,-1))],!0):(w(),T("span",CX,O(e.node.raw),1))])):ce("",!0),re(Il,{name:"shimmer-fade"},{default:Ee(()=>[y.value&&!e.node.loading?(w(),T("span",AX,[n.usePlaceholder?On(D.$slots,"placeholder",{key:0,node:n.node,displaySrc:g.value,imageLoaded:s.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[B[1]||(B[1]=_("span",{class:"image-shimmer"},null,-1))],!0):(w(),T("span",MX,O(e.node.raw),1))])):ce("",!0)]),_:3}),m.value?(w(),T("span",EX,[On(D.$slots,"error",{node:n.node,displaySrc:g.value,imageLoaded:s.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[B[2]||(B[2]=_("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[_("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)),_("span",null,O(C(N)("image.loadError")),1)],!0)])):ce("",!0)],512)}}}),[["__scopeId","data-v-cbb5c63e"]]);Al.install=e=>{e.component(Al.__name,Al)};const TX={key:2},lr=Ze({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=Co(()=>t.customId),o=Kt("markstreamHtmlPolicy",void 0),s=Kt("markstreamNestedRendererProps",void 0),i=R(()=>{var p;return(p=o?.value)!=null?p:"safe"}),r=R(()=>{var p,g;const b=(p=s?.value)!=null?p:{};return Pt(lt({},b),{customId:(g=t.customId)!=null?g:b.customId,htmlPolicy:i.value})}),l=Li({loader:()=>Promise.resolve().then(()=>Nk),suspensible:!1}),a=R(()=>t.components[String(t.node.type)]),c=R(()=>!!(a.value&&n.value[t.node.type]&&!ef(String(t.node.type)))),u=R(()=>c.value?_k(t.node,i.value):void 0),d=R(()=>Array.isArray(t.node.children)&&t.node.children.length>0),f=R(()=>{var p;return String((p=t.node.content)!=null?p:"")}),h=R(()=>{var p,g;return String((g=(p=t.node.content)!=null?p:t.node.raw)!=null?g:"")});return(p,g)=>a.value&&c.value?(w(),we(jo(a.value),yn({key:0},u.value,{node:e.node,loading:e.node.loading,"index-key":e.indexKey,"custom-id":e.customId,"is-dark":r.value.isDark}),{default:Ee(()=>[d.value?(w(),we(C(l),yn({key:0},r.value,{nodes:e.node.children,"index-key":e.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):f.value?(w(),we(C(l),yn({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"])):ce("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):a.value?(w(),we(jo(a.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey},null,8,["node","custom-id","index-key"])):e.fallbackToText?(w(),T("span",TX,O(h.value),1)):ce("",!0)}}),NX=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],IX={key:0,translate:"no",class:"markstream-pre__diff-code"},LX={class:"markstream-pre__diff-number","aria-hidden":"true"},$X={class:"markstream-pre__diff-content"},FX={class:"markstream-pre__diff-content-inner"},OX={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},RX=["textContent"],qs=Ze({__name:"PreCodeNode",props:{node:{},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},reservedHeightPx:{}},setup(e){const t=e,n=R(()=>{var S,N,D;const B=String((N=(S=t.node)==null?void 0:S.language)!=null?N:"");return String((D=String(B).split(/\s+/g)[0])!=null?D:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),o=R(()=>`language-${n.value}`),s=R(()=>{var S,N,D,B,U;return((S=t.node)==null?void 0:S.diff)===!0?String((D=(N=t.node)==null?void 0:N.code)!=null?D:""):(function(H,P){const Z=String(H??"");return P?Z:Z.replace(/\r\n$|\n$|\r$/,"")})((B=t.node)==null?void 0:B.code,((U=t.node)==null?void 0:U.loading)===!0)}),i=R(()=>s.value.split(/\r\n|\n|\r/)),r=R(()=>Array.from({length:Math.max(1,i.value.length)},(S,N)=>N+1)),l=R(()=>{var S;return t.showLineNumbers===!0&&((S=t.node)==null?void 0:S.diff)===!0}),a=R(()=>l.value&&t.diffInline===!0),c=R(()=>{const S=Number(t.reservedHeightPx);if(!Number.isFinite(S)||S<=0)return;const N=`${Math.ceil(S)}px`;return{height:N,minHeight:N,maxHeight:N,overflow:"auto"}});function u(S){return String(S??"").trim().length===0}function d(S,N="context",D={}){const B=u(S);return{code:S,kind:B&&N!=="hunk"&&!D.preserveBlankKind?"context":N,empty:B}}function f(S){const N=String(S??"");return N?N.split(/\r\n|\n|\r/):[]}function h(S,N){return!u(S[N])||N<S.length-1}function p(S){return S.startsWith("-")&&!S.startsWith("---")}function g(S){return S.startsWith("+")&&!S.startsWith("+++")}function b(S,N){const D=f(S),B=f(N),U=(function(X,he){const ne=X.length,ue=he.length;if((ne+1)*(ue+1)>15e5)return null;const de=ue+1,Ce=new Uint32Array((ne+1)*(ue+1));for(let ae=1;ae<=ne;ae++)for(let ie=1;ie<=ue;ie++){const q=ae*de+ie;if(X[ae-1]===he[ie-1])Ce[q]=Ce[(ae-1)*de+(ie-1)]+1;else{const ee=Ce[(ae-1)*de+ie],ye=Ce[ae*de+(ie-1)];Ce[q]=ee>=ye?ee:ye}}const Ie=[];let le=ne,z=ue;for(;le>0&&z>0;)X[le-1]===he[z-1]?(Ie.push({originalIndex:le-1,modifiedIndex:z-1}),le--,z--):Ce[(le-1)*de+z]>=Ce[le*de+(z-1)]?le--:z--;return Ie.reverse(),Ie})(D,B);if(U){const X=[];let he=0,ne=0;for(const ue of U){for(;he<ue.originalIndex;)X.push(Pt(lt({},d(D[he],"removed",{preserveBlankKind:h(D,he)})),{key:`inline-removed-source-${he}`,number:""})),he++;for(;ne<ue.modifiedIndex;)X.push(Pt(lt({},d(B[ne],"added",{preserveBlankKind:h(B,ne)})),{key:`inline-added-source-${ne}`,number:ne+1})),ne++;X.push(Pt(lt({},d(B[ue.modifiedIndex])),{key:`inline-context-source-${ue.originalIndex}-${ue.modifiedIndex}`,number:ue.modifiedIndex+1})),he=ue.originalIndex+1,ne=ue.modifiedIndex+1}for(;he<D.length;)X.push(Pt(lt({},d(D[he],"removed",{preserveBlankKind:h(D,he)})),{key:`inline-removed-source-${he}`,number:""})),he++;for(;ne<B.length;)X.push(Pt(lt({},d(B[ne],"added",{preserveBlankKind:h(B,ne)})),{key:`inline-added-source-${ne}`,number:ne+1})),ne++;return X}const H=[];let P=0,Z=D.length-1,K=B.length-1;for(;P<=Z&&P<=K&&D[P]===B[P];)H.push(Pt(lt({},d(B[P])),{key:`inline-prefix-${P}`,number:P+1})),P++;const V=[];for(;Z>=P&&K>=P&&D[Z]===B[K];)V.unshift(Pt(lt({},d(B[K])),{key:`inline-suffix-${K}`,number:K+1})),Z--,K--;for(let X=P;X<=Z;X++)H.push(Pt(lt({},d(D[X],"removed",{preserveBlankKind:h(D,X)})),{key:`inline-removed-source-${X}`,number:""}));for(let X=P;X<=K;X++)H.push(Pt(lt({},d(B[X],"added",{preserveBlankKind:h(B,X)})),{key:`inline-added-source-${X}`,number:X+1}));return H.concat(V)}const v=R(()=>{var S,N,D,B;const U=(function(K){const V=K.some(he=>p(he)),X=K.some(he=>g(he));return V&&X||(function(){var he,ne,ue,de;if(n.value==="diff")return!0;const Ce=(de=(ue=String((ne=(he=t.node)==null?void 0:he.raw)!=null?ne:"").split(/\r?\n/,1)[0])==null?void 0:ue.trim())!=null?de:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(Ce)})()&&(V||X)})(i.value),H=(function(){var K,V;return((K=t.node)==null?void 0:K.originalCode)!=null||((V=t.node)==null?void 0:V.updatedCode)!=null})();if(a.value)return[{key:"inline",className:"markstream-pre__diff-pane--inline",lines:U?(function(K){const V=[];let X=1;for(const[he,ne]of K.entries())if(ne.startsWith("@@"))V.push(Pt(lt({},d(ne,"hunk")),{key:`inline-hunk-${he}`,number:""}));else if(p(ne))V.push(Pt(lt({},d(ne.slice(1),"removed",{preserveBlankKind:!0})),{key:`inline-removed-${he}`,number:""}));else if(g(ne))V.push(Pt(lt({},d(ne.slice(1),"added",{preserveBlankKind:!0})),{key:`inline-added-${he}`,number:X++}));else{const ue=ne.startsWith(" ")?ne.slice(1):ne;V.push(Pt(lt({},d(ue)),{key:`inline-context-${he}`,number:X})),X++}return V})(i.value):b((S=t.node)==null?void 0:S.originalCode,(N=t.node)==null?void 0:N.updatedCode)}];if(!U&&H){const K=f((D=t.node)==null?void 0:D.originalCode),V=f((B=t.node)==null?void 0:B.updatedCode);return[{key:"original",className:"markstream-pre__diff-pane--original",lines:K.map((X,he)=>{const ne=V[he]===X?"context":"removed";return Pt(lt({},d(X,ne,{preserveBlankKind:h(K,he)})),{key:`original-${he}`,number:he+1})})},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:V.map((X,he)=>{const ne=K[he]===X?"context":"added";return Pt(lt({},d(X,ne,{preserveBlankKind:h(V,he)})),{key:`modified-${he}`,number:he+1})})}]}const P=[],Z=[];for(const K of i.value)if(K.startsWith("@@"))P.push(d(K,"hunk")),Z.push(d(K,"hunk"));else if(K.startsWith("-")&&!K.startsWith("---"))P.push(d(K.slice(1),"removed",{preserveBlankKind:!0}));else if(K.startsWith("+")&&!K.startsWith("+++"))Z.push(d(K.slice(1),"added",{preserveBlankKind:!0}));else{const V=K.startsWith(" ")?K.slice(1):K;P.push(d(V)),Z.push(d(V))}return[{key:"original",className:"markstream-pre__diff-pane--original",lines:P.map((K,V)=>Pt(lt({},K),{key:`original-${V}`,number:V+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:Z.map((K,V)=>Pt(lt({},K),{key:`modified-${V}`,number:V+1}))}]}),m=R(()=>{const S=n.value;return S?`Code block: ${S}`:"Code block"}),y=J(null),k=J([]);let A=null,$=null;function I(S){const N=Number.parseFloat(String(S??""));return Number.isFinite(N)&&N>0?N:0}function x(S,N){var D;if(!S)return N;const B=S.querySelector(".markstream-pre__diff-content"),U=B?.getBoundingClientRect(),H=(D=U?.height)!=null?D:0;return Math.max(N,Math.ceil(H))}function L(){typeof window<"u"&&(A!=null&&window.cancelAnimationFrame(A),A=window.requestAnimationFrame(()=>{(function(){var S,N;A=null;const D=y.value;if(!D||!l.value)return void(k.value.length&&(k.value=[]));const B=(function(X){const he=window.getComputedStyle(X),ne=I(he.getPropertyValue("--markstream-pre-diff-line-height"));if(ne>0)return ne;const ue=I(he.lineHeight);return ue>0?ue:18})(D),U=Array.from(D.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),H=Array.from(D.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),P=Math.max(U.length,H.length),Z=[];for(let X=0;X<P;X++){const he=x((S=U[X])!=null?S:null,B),ne=x((N=H[X])!=null?N:null,B),ue=Math.max(B,he,ne);Z.push({rowHeight:ue,originalHeight:he,modifiedHeight:ne})}var K,V;K=k.value,V=Z,K.length===V.length&&K.every((X,he)=>{const ne=V[he];return ne&&Math.abs(X.rowHeight-ne.rowHeight)<=.5&&Math.abs(X.originalHeight-ne.originalHeight)<=.5&&Math.abs(X.modifiedHeight-ne.modifiedHeight)<=.5})||(k.value=Z)})()}))}function E(S){$?.disconnect(),$=null,S&&l.value&&typeof ResizeObserver<"u"&&($=new ResizeObserver(()=>{L()}),$.observe(S))}function F(S,N){const D=k.value[S];if(!D)return;const B=N==="original"?D.originalHeight:D.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(D.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(B)}px`}}return Qe(y,S=>{E(S),mt(()=>L())},{flush:"post"}),Qe([l,v],()=>{E(y.value),mt(()=>L())},{flush:"post",immediate:!0}),po(()=>{A!=null&&(window.cancelAnimationFrame(A),A=null),$?.disconnect(),$=null}),(S,N)=>(w(),T("pre",{ref_key:"preRef",ref:y,style:Yt(c.value),class:We([o.value,{"markstream-pre--line-numbers":t.showLineNumbers,"markstream-pre--diff-preview":l.value,"markstream-pre--diff-inline":a.value}]),"aria-busy":e.node.loading===!0,"aria-label":m.value,"data-language":n.value,"data-markstream-line-numbers":t.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"},[l.value?(w(),T("code",IX,[(w(!0),T(Pe,null,ot(v.value,D=>(w(),T("span",{key:D.key,class:We(["markstream-pre__diff-pane",D.className])},[(w(!0),T(Pe,null,ot(D.lines,(B,U)=>(w(),T("span",{key:B.key,class:We(["markstream-pre__diff-line",[`markstream-pre__diff-line--${B.kind}`,{"markstream-pre__diff-line--empty":B.empty}]]),style:Yt(F(U,D.key))},[N[0]||(N[0]=_("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),_("span",LX,O(B.number),1),_("span",$X,[_("span",FX,O(B.code),1)])],6))),128))],2))),128))])):(w(),T(Pe,{key:1},[t.showLineNumbers?(w(),T("span",OX,[(w(!0),T(Pe,null,ot(r.value,D=>(w(),T("span",{key:D,class:"markstream-pre__line-number"},O(D),1))),128))])):ce("",!0),_("code",{translate:"no",class:"markstream-pre__code",textContent:O(s.value)},null,8,RX)],64))],14,NX))}});qs.install=e=>{e.component(qs.__name,qs)};const q0=Ba(!1);let DS=null;const BX={key:0},ro=gn(Ze({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=(DS||(DS=kk().then(v=>{q0.value=!!v}).catch(()=>{q0.value=!1})),Wh(q0)),o=Vd(),s=Kt("markstreamFade",void 0),i=Kt("markstreamTextStreamState",void 0),r=Kt("markstreamStreamVersion",void 0),l=R(()=>{const v=o.fade;return v===""||v===!0||v==="true"||v!==!1&&v!=="false"&&void 0}),a=R(()=>typeof l.value=="boolean"?l.value:typeof s?.value!="boolean"||s.value),c=R(()=>{var v;const m=(v=o["index-key"])!=null?v:o.indexKey;return m==null||m===""?"":String(m)}),u=J(t.node.content),d=J("");let f=r?.value;const h=J(0);function p(){return u.value+d.value}function g(){d.value&&(u.value=p(),d.value="")}Qe([()=>t.node.content,c,a,()=>r?.value],([v,m,y,k])=>{const A=String(v??""),$=c.value,I=k!==f;f=k;const x=IM({nextContent:A,persistedContent:$?i?.get($):void 0,currentState:{settledContent:u.value,streamedDelta:d.value},typewriterEnabled:a.value,streamRenderVersionChanged:I});u.value=x.settledContent,d.value=x.streamedDelta,x.appended&&(h.value+=1),$&&i?.set($,A)},{immediate:!0}),Qe(a,v=>{var m;v||(m=p(),u.value=m,d.value="")});const b=R(()=>h.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(v,m)=>(w(),T("span",{class:We([[C(n)&&e.node.center?"text-node-center":""],"text-node"])},[u.value?(w(),T("span",BX,O(u.value),1)):ce("",!0),d.value?(w(),T("span",{key:1,class:We(["text-node-stream-delta",[b.value]]),onAnimationend:g},O(d.value),35)):ce("",!0)],2))}}),[["__scopeId","data-v-aae85f13"]]);ro.install=e=>{e.component(ro.__name,ro)};const KM=Ze({name:"CodeBlockNodeLoading",inheritAttrs:!1,setup(e,{attrs:t}){const n=t;return()=>{var o;return mn(qs,Pt(lt({},t),{node:n.node,showLineNumbers:!0,reservedHeightPx:(o=n.estimatedHeightPx)!=null?o:n.estimatedContentHeightPx,class:["code-pre-fallback",t.class],"data-markstream-code-loading":"1"}))}}}),j0=Li({loader:()=>Xn(null,null,function*(){try{return(yield ms(()=>import("./CodeBlockNode-CpzD9pIh.js"),__vite__mapDeps([4,5,6]))).default}catch(e){return console.warn('[markstream-vue] Optional peer dependencies for CodeBlockNode are missing. Falling back to preformatted code rendering (no Monaco). To enable full code block features, please install "stream-monaco".',e),qs}}),loadingComponent:KM,delay:0,suspensible:!1}),Pi=Li(()=>Xn(null,null,function*(){var e;if(((e=(function(){const t=Reflect.get(globalThis,"process");return t?.env})())==null?void 0:e.NODE_ENV)==="test"&&typeof window<"u")return t=>{var n,o,s,i;return mn(ro,Pt(lt({},t),{node:{type:"text",content:(o=t.node.raw)!=null?o:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(s=t.node.content)!=null?s:""}$`}}))};try{if(yield kk())return(yield ms(()=>import("./index6-Cq--amYl.js"),[])).default}catch(t){console.warn('[markstream-vue] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',t)}return t=>{var n,o,s,i;return mn(ro,Pt(lt({},t),{node:{type:"text",content:(o=t.node.raw)!=null?o:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(s=t.node.content)!=null?s:""}$`}}))}})),GM=Li(()=>Xn(null,null,function*(){try{if(yield kk())return(yield ms(()=>import("./index5-B0hk6c-S.js"),[])).default}catch(e){console.warn('[markstream-vue] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',e)}return e=>{var t,n,o,s;return mn(ro,Pt(lt({},e),{node:{type:"text",content:(n=e.node.raw)!=null?n:`$$${(t=e.node.content)!=null?t:""}$$`,raw:(s=e.node.raw)!=null?s:`$$${(o=e.node.content)!=null?o:""}$$`}}))}})),ys=gn(Ze({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(w(),T("span",{class:"reference-node cursor-pointer text-xs rounded-md px-1.5 mx-0.5",role:"button",tabindex:"0",onClick:n[0]||(n[0]=o=>t.$emit("click",o,e.node.id,e.messageId,e.threadId)),onMouseenter:n[1]||(n[1]=o=>t.$emit("mouseEnter",o,e.node.id,e.messageId,e.threadId)),onMouseleave:n[2]||(n[2]=o=>t.$emit("mouseLeave",o,e.node.id,e.messageId,e.threadId))},O(e.node.id),33))}),[["__scopeId","data-v-775c65e4"]]);ys.install=e=>{e.component(ys.__name,ys)};const DX={class:"superscript-node"},Fs=gn(Ze({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Co(()=>t.customId),o=R(()=>lt({text:ro,inline_code:ts,link:xs,html_inline:Qs,strong:ks,emphasis:ws,footnote_reference:Zs,strikethrough:bs,highlight:Xs,insert:Rs,subscript:Os,emoji:$s,math_inline:Pi,reference:ys},n.value));return(s,i)=>(w(),T("sup",DX,[(w(!0),T(Pe,null,ot(e.node.children,(r,l)=>(w(),we(C(lr),{key:`${e.indexKey||"superscript"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"superscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-24160b22"]]);Fs.install=e=>{e.component(Fs.__name,Fs)};const PX={class:"subscript-node"},Os=gn(Ze({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Co(()=>t.customId),o=R(()=>lt({text:ro,inline_code:ts,link:xs,html_inline:Qs,strong:ks,emphasis:ws,footnote_reference:Zs,strikethrough:bs,highlight:Xs,insert:Rs,superscript:Fs,emoji:$s,math_inline:Pi,reference:ys},n.value));return(s,i)=>(w(),T("sub",PX,[(w(!0),T(Pe,null,ot(e.node.children,(r,l)=>(w(),we(C(lr),{key:`${e.indexKey||"subscript"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"subscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-197fa13b"]]);Os.install=e=>{e.component(Os.__name,Os)};const HX={class:"strong-node"},ks=gn(Ze({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Co(()=>t.customId),o=R(()=>lt({text:ro,inline_code:ts,link:xs,html_inline:Qs,emphasis:ws,strikethrough:bs,highlight:Xs,insert:Rs,subscript:Os,superscript:Fs,emoji:$s,footnote_reference:Zs,math_inline:Pi,reference:ys},n.value));return(s,i)=>(w(),T("strong",HX,[(w(!0),T(Pe,null,ot(e.node.children,(r,l)=>(w(),we(C(lr),{key:`${e.indexKey||"strong"}-${l}`,components:o.value,node:r,"index-key":`${e.indexKey||"strong"}-${l}`,"custom-id":t.customId},null,8,["components","node","index-key","custom-id"]))),128))]))}}),[["__scopeId","data-v-a8647104"]]);ks.install=e=>{e.component(ks.__name,ks)};const WX={class:"strikethrough-node"},bs=gn(Ze({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Co(()=>t.customId),o=R(()=>lt({text:ro,inline_code:ts,link:xs,html_inline:Qs,strong:ks,emphasis:ws,highlight:Xs,insert:Rs,subscript:Os,superscript:Fs,emoji:$s,footnote_reference:Zs,math_inline:Pi,reference:ys},n.value));return(s,i)=>(w(),T("del",WX,[(w(!0),T(Pe,null,ot(e.node.children,(r,l)=>(w(),we(C(lr),{key:`${e.indexKey||"strikethrough"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"strikethrough"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-b7a531fa"]]);bs.install=e=>{e.component(bs.__name,bs)};const zX=["href","title","aria-label","aria-hidden","target","rel"],UX=["aria-hidden"],qX={class:"link-text-wrapper relative inline-flex"},jX={class:"leading-[normal] link-text"},xs=gn(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=Kt("markstreamShowTooltips",void 0),o=R(()=>{const v=n?.value;return typeof v=="boolean"?v:t.showTooltip}),s=R(()=>{var v,m,y,k,A;const $=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",I=(v=t.animationOpacity)!=null?v:.35,x=Math.max(.12,Math.min(.5*I,I)),L={"--underline-height":`${(m=t.underlineHeight)!=null?m:2}px`,"--underline-bottom":$,"--underline-opacity":String(I),"--underline-rest-opacity":String(x),"--underline-duration":`${(y=t.animationDuration)!=null?y:1.6}s`,"--underline-timing":(k=t.animationTiming)!=null?k:"ease-in-out","--underline-iteration":typeof t.animationIteration=="number"?String(t.animationIteration):(A=t.animationIteration)!=null?A:"infinite"};return t.color&&(L["--link-color"]=t.color),L}),i=Co(()=>t.customId),r=R(()=>lt({text:ro,strong:ks,strikethrough:bs,emphasis:ws,image:Al,html_inline:Qs,inline_code:ts},i.value)),l=Vd(),a=R(()=>{var v,m;const y=(v=t.node)==null?void 0:v.attrs;if(!y||typeof y!="object")return{};const k={};if(Array.isArray(y))for(const A of y)Array.isArray(A)&&A[0]&&(k[String(A[0])]=String((m=A[1])!=null?m:""));else for(const[A,$]of Object.entries(y))A&&$!=null&&$!==!1&&(k[A]=$===!0?"":String($));return IS(k,"safe","a")}),c=R(()=>lt(lt({},l),a.value)),u=R(()=>{var v,m;return IS({href:String((m=(v=t.node)==null?void 0:v.href)!=null?m:"")},"safe","a").href}),d=R(()=>{if(!u.value)return;const v=c.value.target;return(typeof v=="string"?v.trim():String(v??"").trim())||(OV(u.value)?"_blank":void 0)}),f=R(()=>{var v;return String((v=d.value)!=null?v:"").trim().toLowerCase()==="_blank"}),h=R(()=>{if(!u.value)return;const v=c.value.rel,m=new Set((typeof v=="string"?v:String(v??"")).split(/\s+/).filter(Boolean)),y=new Set(Array.from(m).filter(k=>k.toLowerCase()!=="opener"));return f.value&&(y.add("noopener"),y.add("noreferrer")),y.size>0?Array.from(y).join(" "):void 0}),p=R(()=>{const v=lt({},c.value);return delete v.title,delete v.href,delete v.target,delete v.rel,v});function g(){o.value&&bX()}const b=R(()=>{var v,m;const y=(v=t.node)==null?void 0:v.title;return typeof y=="string"&&y.trim().length>0?y:String((m=u.value)!=null?m:"")});return(v,m)=>{var y,k;return e.node.loading?(w(),T("span",yn({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},C(l),{style:s.value}),[_("span",qX,[_("span",jX,[re(C(ro),{class:"leading-[normal] link-text",node:{type:"text",content:String((y=e.node.text)!=null?y:""),raw:String((k=e.node.text)!=null?k:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),m[1]||(m[1]=_("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,UX)):(w(),T("a",yn({key:0,class:"link-node",href:u.value,title:o.value?"":b.value,"aria-label":`Link: ${b.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:h.value},p.value,{style:s.value,onMouseenter:m[0]||(m[0]=A=>(function($){var I,x,L,E;if(!o.value)return;const F=$,S=F?.clientX!=null&&F?.clientY!=null?{x:F.clientX,y:F.clientY}:void 0,N=((I=t.node)==null?void 0:I.title)||((x=u.value)!=null&&x.includes("xn--")&&((E=(L=t.node)==null?void 0:L.text)!=null&&E.includes("://"))?t.node.text:u.value)||"";kX($.currentTarget,N,"top",!1,S)})(A)),onMouseleave:g}),[(w(!0),T(Pe,null,ot(e.node.children,(A,$)=>(w(),we(C(lr),{key:`${e.indexKey||"emphasis"}-${$}`,components:r.value,node:A,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${$}`},null,8,["components","node","custom-id","index-key"]))),128))],16,zX))}}}),[["__scopeId","data-v-367e6ca4"]]);xs.install=e=>{e.component(xs.__name,xs)};const VX={class:"insert-node"},Rs=gn(Ze({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Co(()=>t.customId),o=R(()=>lt({text:ro,inline_code:ts,link:xs,html_inline:Qs,strong:ks,emphasis:ws,strikethrough:bs,highlight:Xs,subscript:Os,superscript:Fs,emoji:$s,footnote_reference:Zs,math_inline:Pi,reference:ys},n.value));return(s,i)=>(w(),T("ins",VX,[(w(!0),T(Pe,null,ot(e.node.children,(r,l)=>(w(),we(C(lr),{key:`${e.indexKey||"insert"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"insert"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-1e2c29d4"]]);Rs.install=e=>{e.component(Rs.__name,Rs)};const KX={class:"highlight-node"},Xs=gn(Ze({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Co(()=>t.customId),o=R(()=>lt({text:ro,inline_code:ts,link:xs,html_inline:Qs,strong:ks,emphasis:ws,strikethrough:bs,insert:Rs,subscript:Os,superscript:Fs,emoji:$s,footnote_reference:Zs,math_inline:Pi,reference:ys},n.value));return(s,i)=>(w(),T("mark",KX,[(w(!0),T(Pe,null,ot(e.node.children,(r,l)=>(w(),we(C(lr),{key:`${e.indexKey||"highlight"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"highlight"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-7a62982a"]]);Xs.install=e=>{e.component(Xs.__name,Xs)};const GX={class:"emphasis-node"},ws=gn(Ze({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Co(()=>t.customId),o=R(()=>lt({text:ro,inline_code:ts,link:xs,html_inline:Qs,strong:ks,strikethrough:bs,highlight:Xs,insert:Rs,subscript:Os,superscript:Fs,emoji:$s,footnote_reference:Zs,math_inline:Pi,reference:ys},n.value));return(s,i)=>(w(),T("em",GX,[(w(!0),T(Pe,null,ot(e.node.children,(r,l)=>(w(),we(C(lr),{key:`${e.indexKey||"emphasis"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"emphasis"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-2a5aafbf"]]);ws.install=e=>{e.component(ws.__name,ws)};const YX={class:"hard-break"},Ml=gn(Ze({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(w(),T("br",YX))}),[["__scopeId","data-v-50c58f70"]]);Ml.install=e=>{e.component(Ml.__name,Ml)};const Dd=Ze({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=pt({checkbox:Ys,checkbox_input:Ys,emoji:$s,emphasis:ws,hardbreak:Ml,highlight:Xs,inline_code:ts,insert:Rs,link:xs,reference:ys,strikethrough:bs,strong:ks,subscript:Os,superscript:Fs,text:ro}),o=Co(()=>t.customId),s=R(()=>{const i=o.value;return Object.keys(i).length>0?lt(lt({},n),i):n});return(i,r)=>(w(!0),T(Pe,null,ot(e.nodes,(l,a)=>(w(),we(C(lr),{key:a,components:s.value,node:l,"custom-id":t.customId,"index-key":`${e.indexKey||"inline"}-${a}`},null,8,["components","node","custom-id","index-key"]))),128))}});function Lv(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(Lv)}function Np(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(Lv))return e;if(!t||e.length!==1)return null;const o=e[0];if(o?.type!=="paragraph"||!Array.isArray(o.children))return null;const s=o.children;return(n||s.length>0)&&s.every(Lv)?s:null}function eu(e){var t,n;if(!e?.length)return null;let o="";for(const s of e){if(s?.type!=="text"||s.center===!0)return null;o+=String((n=(t=s.content)!=null?t:s.raw)!=null?n:"")}return o}const ZX=["cite"],QX={key:0,dir:"auto",class:"paragraph-node"},XX=["custom-id"],Th=gn(Ze({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=Co(()=>t.customId),o=R(()=>!!n.value.paragraph),s=R(()=>!!n.value.text),i=R(()=>Np(t.node.children,!o.value)),r=R(()=>t.fade!==!1||s.value?null:eu(i.value));return Ln("markstreamShowTooltips",R(()=>t.showTooltips)),Ln("markstreamFade",R(()=>t.fade)),(l,a)=>(w(),T("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[i.value?(w(),T("p",QX,[r.value!==null?(w(),T("span",{key:0,class:"text-node","custom-id":t.customId},O(r.value),9,XX)):(w(),we(C(Dd),{key:1,nodes:i.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(w(),we(C(Bs),{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,ZX))}}),[["__scopeId","data-v-abfecebc"]]);Th.install=e=>{e.component(Th.__name,Th)};const JX={class:"definition-list"},eJ={class:"definition-term"},tJ={class:"definition-desc"},Nh=gn(Ze({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,o)=>(w(),T("dl",JX,[(w(!0),T(Pe,null,ot(t.node.items,(s,i)=>(w(),T(Pe,{key:i},[_("dt",eJ,[re(C(Bs),{"index-key":`definition-term-${t.indexKey}-${i}`,nodes:s.term,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:o[0]||(o[0]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])]),_("dd",tJ,[re(C(Bs),{"index-key":`definition-desc-${t.indexKey}-${i}`,nodes:s.definition,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:o[1]||(o[1]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],64))),128))]))}}),[["__scopeId","data-v-4e103b30"]]);Nh.install=e=>{e.component(Nh.__name,Nh)};const nJ=["href","title"],dd=gn(Ze({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const t=e;function n(o){var s;if(o.preventDefault(),typeof document>"u")return;const i=`fnref-${String((s=t.node.id)!=null?s:"")}`,r=document.getElementById(i);r&&r.scrollIntoView({behavior:"smooth",block:"center"})}return(o,s)=>(w(),T("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,nJ))}}),[["__scopeId","data-v-e1eb37b6"]]);dd.install=e=>{e.component(dd.__name,dd)};const oJ=["id"],sJ={class:"flex-1"},Ih=Ze({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,o)=>(w(),T("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[_("div",sJ,[re(C(Bs),{"index-key":`footnote-${t.indexKey}`,nodes:t.node.children,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:o[0]||(o[0]=s=>n.$emit("copy",s))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],8,oJ))}});Ih.install=e=>{e.component(Ih.__name,Ih)};const iJ=["custom-id"],$v=gn(Ze({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Co(()=>t.customId),o=Kt("markstreamFade",void 0),s=R(()=>o?.value!==!1||n.value.text?null:eu(t.node.children)),i=R(()=>lt({text:ro,inline_code:ts,link:xs,image:Al,strong:ks,emphasis:ws,strikethrough:bs,highlight:Xs,insert:Rs,subscript:Os,superscript:Fs,emoji:$s,checkbox:Ys,checkbox_input:Ys,footnote_reference:Zs,hardbreak:Ml,math_inline:Pi,reference:ys},n.value));return(r,l)=>(w(),we(jo(`h${e.node.level}`),yn({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:Ee(()=>[s.value!==null?(w(),T("span",{key:0,class:"text-node","custom-id":t.customId},O(s.value),9,iJ)):(w(!0),T(Pe,{key:1},ot(e.node.children,(a,c)=>(w(),we(C(lr),{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"]]),Ip=$v;Ip.install=e=>{e.component($v.__name,$v)};const rJ={key:0,dir:"auto",class:"paragraph-node"},lJ=["custom-id"],aJ={dir:"auto",class:"paragraph-node"},cJ=["custom-id"],Uc=gn(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=R(()=>{var h;return(h=t.node)!=null?h:t.item}),o=Co(()=>t.customId),s=R(()=>!!o.value.paragraph),i=R(()=>!!o.value.text),r=R(()=>{var h;return Np((h=n.value)==null?void 0:h.children,!s.value)}),l=R(()=>{var h;if(s.value)return null;const p=(h=n.value)==null?void 0:h.children;if(!Array.isArray(p)||p.length<2)return null;const g=p[0];if(g?.type!=="paragraph"||!Array.isArray(g.children))return null;const b=p.slice(1);if(!b.every(m=>m?.type==="list"))return null;const v=Np([g]);return v?{paragraphChildren:v,nestedLists:b}:null});function a(){return t.fade===!1&&!i.value}const c=R(()=>a()?eu(r.value):null),u=R(()=>{var h;return a()?eu((h=l.value)==null?void 0:h.paragraphChildren):null}),d=Object.freeze({}),f=R(()=>{const{value:h}=t;return typeof h=="number"&&Number.isFinite(h)?{value:h}:d});return Ln("markstreamShowTooltips",R(()=>t.showTooltips)),Ln("markstreamFade",R(()=>t.fade)),(h,p)=>{var g,b;return w(),T("li",yn({class:"list-item",dir:"auto"},f.value),[r.value?(w(),T("p",rJ,[c.value!==null?(w(),T("span",{key:0,class:"text-node","custom-id":t.customId},O(c.value),9,lJ)):(w(),we(C(Dd),{key:1,nodes:r.value,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):l.value?(w(),T(Pe,{key:1},[_("p",aJ,[u.value!==null?(w(),T("span",{key:0,class:"text-node","custom-id":t.customId},O(u.value),9,cJ)):(w(),we(C(Dd),{key:1,nodes:l.value.paragraphChildren,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))]),(w(!0),T(Pe,null,ot(l.value.nestedLists,(v,m)=>(w(),we(C(Bs),{key:m,nodes:[v],"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-nested-${m}`,"show-tooltips":t.showTooltips,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0,onCopy:p[0]||(p[0]=y=>h.$emit("copy",y))},null,8,["nodes","custom-id","index-key","show-tooltips","typewriter","fade","is-dark"]))),128))],64)):(w(),we(C(Bs),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(b=(g=n.value)==null?void 0:g.children)!=null?b:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,onCopy:p[1]||(p[1]=v=>h.$emit("copy",v))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade","is-dark"]))],16)}}}),[["__scopeId","data-v-617214f9"]]);Uc.install=e=>{e.component(Uc.__name,Uc)};const qc=gn(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=Co(()=>e.customId),n=R(()=>t.value.list_item||Uc);return(o,s)=>(w(),we(jo(e.node.ordered?"ol":"ul"),{class:We(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:Ee(()=>[(w(!0),T(Pe,null,ot(e.node.items,(i,r)=>{var l;return w(),we(jo(n.value),yn({key:`${e.indexKey||"list"}-${r}`},{ref_for:!0},{showTooltips:e.showTooltips},{node:i,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${r}`,typewriter:e.typewriter,fade:e.fade,"is-dark":e.isDark,value:e.node.ordered?((l=e.node.start)!=null?l:1)+r:void 0,onCopy:s[0]||(s[0]=a=>o.$emit("copy",a))}),null,16,["node","custom-id","index-key","typewriter","fade","is-dark","value"])}),128))]),_:1},8,["class"]))}}),[["__scopeId","data-v-99cb95e0"]]);qc.install=e=>{e.component(qc.__name,qc)};const YM=Symbol("ViewportPriority");function uJ(e,t){var n,o;const s=typeof window<"u"&&typeof document<"u",i=typeof t=="boolean"?J(t):t,r=s?(n=window.requestIdleCallback)!=null?n:m=>window.setTimeout(()=>m({didTimeout:!0,timeRemaining:()=>0}),16):null,l=s?(o=window.cancelIdleCallback)!=null?o:m=>window.clearTimeout(m):null;let a=null,c=null;const u=new Map,d=new Set;let f=null;function h(){if(f!=null){try{l?.(f)}catch{}f=null}}function p(){if(!u.size){try{a?.disconnect()}catch{}a=null,c=null,d.size||h()}}function g(m){const y=u.get(m);if(y){if(!y.visible.value){y.visible.value=!0;try{y.resolve()}catch{}}try{a?.unobserve(m)}catch{}u.delete(m),d.delete(m),p()}}function b(){window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&r&&f==null&&d.size&&(f=r(()=>{f=null;const m=d.values().next().value;m&&(d.delete(m),g(m),d.size&&b())},{timeout:1200}))}Qe(i,m=>{if(!m){for(const y of Array.from(u.keys()))g(y);h()}},{flush:"sync"});const v=(m,y)=>{const k=J(!1);let A,$=!1;const I=new Promise(E=>{A=()=>{$||($=!0,E())}}),x=()=>{try{a?.unobserve(m)}catch{}u.delete(m),d.delete(m),p()};if(!s||!i.value)return k.value=!0,A(),{isVisible:k,whenVisible:I,destroy:x};const L=(function(E,F){if(!s)return a;if(typeof IntersectionObserver>"u")return null;const S=(function(B,U){var H,P,Z;return{root:(H=e?.(B??null))!=null?H:null,rootMargin:(P=U?.rootMargin)!=null?P:"300px",threshold:(Z=U?.threshold)!=null?Z:0}})(E,F);if(a&&(D=S,(N=c)&&N.root===D.root&&N.rootMargin===D.rootMargin&&N.threshold===D.threshold))return a;var N,D;if(a)try{a.disconnect()}catch{}a=new IntersectionObserver(B=>{for(const U of B)(U.isIntersecting||U.intersectionRatio>0)&&g(U.target)},{root:S.root,rootMargin:S.rootMargin,threshold:S.threshold}),c=S;for(const B of u.keys())a.observe(B);return a})(m,y);return L?(u.set(m,{resolve:A,visible:k}),L.observe(m),d.add(m),b(),{isVisible:k,whenVisible:I,destroy:x}):(k.value=!0,A(),{isVisible:k,whenVisible:I,destroy:x})};return Ln(YM,v),v}function dJ(){var e,t;const n=Kt(YM,void 0);if(n)return n;const o=new WeakMap;let s=null;const i=new Set;let r=null;const l=typeof window<"u"?(e=window.requestIdleCallback)!=null?e:f=>window.setTimeout(()=>f({didTimeout:!0,timeRemaining:()=>0}),16):null,a=typeof window<"u"?(t=window.cancelIdleCallback)!=null?t:f=>window.clearTimeout(f):null,c=()=>{if(r!=null){try{a?.(r)}catch{}r=null}},u=f=>{const h=o.get(f);if(h){if(!h.visible.value){h.visible.value=!0;try{h.resolve()}catch{}}try{s?.unobserve(f)}catch{}o.delete(f),i.delete(f),i.size||c()}},d=()=>{window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&l&&r==null&&i.size&&(r=l(()=>{r=null;const f=i.values().next().value;f&&(i.delete(f),u(f),i.size&&d())},{timeout:1200}))};return f=>{const h=J(!1);let p,g=!1;const b=new Promise(y=>{p=()=>{g||(g=!0,y())}}),v=()=>{try{s?.unobserve(f)}catch{}o.delete(f),i.delete(f),i.size||c()},m=s||(typeof window>"u"||typeof IntersectionObserver>"u"?null:(s=new IntersectionObserver(y=>{for(const k of y)(k.isIntersecting||k.intersectionRatio>0)&&u(k.target)},{root:null,rootMargin:"300px",threshold:0}),s));return m?(o.set(f,{resolve:p,visible:h}),m.observe(f),i.add(f),d(),{isVisible:h,whenVisible:b,destroy:v}):(h.value=!0,p(),{isVisible:h,whenVisible:b,destroy:v})}}const fJ={key:2,class:"html-block-node__raw"},hJ=["innerHTML"],pJ={key:1,class:"html-block-node__placeholder"},fd=gn(Ze({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Kt("markstreamHtmlPolicy",void 0),o=Kt("markstreamNestedRendererProps",void 0),s=R(()=>{var $,I;return(I=($=t.htmlPolicy)!=null?$:n?.value)!=null?I:"safe"}),i=R(()=>{var $,I;const x=($=o?.value)!=null?$:{};return Pt(lt({},x),{customId:(I=t.customId)!=null?I:x.customId,htmlPolicy:s.value})}),r=Li({loader:()=>Promise.resolve().then(()=>Nk),suspensible:!1}),l=R(()=>{const $=vv(t.node.attrs,s.value);if(!$)return;const I=Ap($);return Object.keys(I).length>0?I:void 0}),a=R(()=>{const $=String(t.node.tag||"").trim(),I=vv(t.node.attrs,s.value,$);if(!I)return;const x=Ap(I);return Object.keys(x).length>0?x:void 0}),c=Co(()=>t.customId),u=Ze({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=J(null),f=J(typeof window>"u"),h=J(t.node.content),p=R(()=>Array.isArray(t.node.children)?t.node.children:[]),g=R(()=>String(t.node.tag||"div")),b=R(()=>{const $=g.value.trim().toLowerCase();return F6.has($)||hk($,s.value)}),v=R(()=>p.value.length>0&&!!t.node.tag&&!b.value),m=R(()=>{var $,I,x;if(v.value)return{mode:"structured"};if(!f.value)return{mode:"html",content:($=h.value)!=null?$:""};const L=(I=h.value)!=null?I:t.node.content;if(!L)return{mode:"html",content:""};if(s.value==="escape")return{mode:"html",content:zc(L,s.value)};if(t.node.loading){const F=Tp(L,c.value,s.value);return F===null?{mode:"text",content:(x=t.node.raw)!=null?x:L}:{mode:"dynamic",nodes:F}}if(!jM(L,c.value))return{mode:"html",content:zc(L,s.value)};const E=Tp(L,c.value,s.value);return E===null?{mode:"html",content:zc(L,s.value)}:{mode:"dynamic",nodes:E}}),y=dJ(),k=J(null),A=!!t.node.loading;return typeof window<"u"?(Qe(d,$=>{var I,x;if((x=(I=k.value)==null?void 0:I.destroy)==null||x.call(I),k.value=null,!A)return f.value=!0,void(h.value=t.node.content);if(!$)return void(f.value=!1);const L=y($,{rootMargin:"400px"});k.value=L,f.value=L.isVisible.value,L.whenVisible.then(()=>{f.value=!0})},{immediate:!0}),Qe(()=>t.node.content,$=>{A&&!f.value||(h.value=$)})):f.value=!0,po(()=>{var $,I;(I=($=k.value)==null?void 0:$.destroy)==null||I.call($),k.value=null}),($,I)=>(w(),we(jo(v.value?g.value:"div"),yn({ref_key:"htmlRef",ref:d,class:"html-block-node"},v.value?a.value:void 0),{default:Ee(()=>[f.value?(w(),T(Pe,{key:0},[m.value.mode==="structured"?(w(),we(C(r),yn({key:0},i.value,{nodes:p.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):m.value.mode==="dynamic"?(w(),we(C(u),{key:1,nodes:m.value.nodes},null,8,["nodes"])):m.value.mode==="text"?(w(),T("pre",fJ,O(m.value.content),1)):(w(),T("div",yn({key:3},l.value,{innerHTML:m.value.content}),null,16,hJ))],64)):(w(),T("div",pJ,[On($.$slots,"placeholder",{node:e.node},()=>[I[0]||(I[0]=_("span",{class:"html-block-node__placeholder-bar"},null,-1)),I[1]||(I[1]=_("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),I[2]||(I[2]=_("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16))}}),[["__scopeId","data-v-f1744dfb"]]);fd.install=e=>{e.component(fd.__name,fd)};const mJ={dir:"auto",class:"paragraph-node"},gJ=["custom-id"],Ma=gn(Ze({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=Co(()=>t.customId),o=Kt("markstreamHtmlPolicy",void 0),s=Kt("markstreamFade",void 0),i=Kt("markstreamParseOptions",void 0),r=Kt("markstreamCustomMarkdownIt",void 0),l=Kt("markstreamNestedRendererProps",void 0),a=R(()=>{var x;return(x=o?.value)!=null?x:"safe"}),c=R(()=>{var x;return(x=t.parseOptions)!=null?x:i?.value}),u=R(()=>{var x;return(x=t.customMarkdownIt)!=null?x:r?.value}),d=R(()=>{var x,L;return(L=t.customHtmlTags)!=null?L:(x=l?.value)==null?void 0:x.customHtmlTags}),f=R(()=>{var x,L;const E=(x=l?.value)!=null?x:{};return Pt(lt({},E),{customId:(L=t.customId)!=null?L:E.customId,customHtmlTags:d.value,parseOptions:c.value,customMarkdownIt:u.value,htmlPolicy:a.value})}),h=Li({loader:()=>Promise.resolve().then(()=>Nk),suspensible:!1});function p(x){var L;return x.type==="text"&&String((L=x.content)!=null?L:"").trim()===""}const g=R(()=>t.node.children.filter(x=>!p(x))),b=R(()=>g.value.length>0&&g.value.every(x=>x.type==="image"||(function(L){var E;const F=(function(S){return S.type==="link"&&Array.isArray(S.children)?S.children.filter(N=>!p(N)):[]})(L);return F.length===1&&((E=F[0])==null?void 0:E.type)==="image"})(x))),v=R(()=>new Set(ru(d.value))),m=R(()=>{if(!b.value||g.value.length<=1)return t.node.children;const x=[];for(let L=0;L<t.node.children.length;L++){const E=t.node.children[L];if(!p(E)){x.push(E);continue}const F=x.length>0,S=t.node.children.slice(L+1).some(N=>!p(N));F&&S&&x.push(Pt(lt({},E),{content:" ",raw:" "}))}return x}),y=R(()=>s?.value===!1&&!n.value.text),k=R(()=>y.value?eu(m.value):null);function A(x,L){return{node:x,"index-key":`${t.indexKey}-${L}`,"custom-id":t.customId,"custom-html-tags":d.value}}const $=R(()=>lt({inline_code:ts,image:Al,link:xs,hardbreak:Ml,emphasis:ws,strong:ks,strikethrough:bs,highlight:Xs,insert:Rs,subscript:Os,superscript:Fs,html_inline:Qs,html_block:fd,emoji:$s,checkbox:Ys,math_inline:Pi,checkbox_input:Ys,reference:ys,footnote_anchor:dd,footnote_reference:Zs,text:ro},n.value)),I=R(()=>m.value.map((x,L)=>{var E;const F=(function(S){var N,D,B,U;if(S.type==="html_block"||S.type==="html_inline"){const H=String((N=S.tag)!=null?N:"").trim().toLowerCase()||D6(S.content);if(H&&!v.value.has(H)&&P6((D=S.content)!=null?D:S.raw,H)){const P=String((U=(B=S.content)!=null?B:S.raw)!=null?U:"");return{child:{type:"text",content:P,raw:P},component:ro,isCustomComponent:!1}}}return{child:S,component:$.value[S.type],isCustomComponent:!!(n.value[S.type]&&!ef(String(S.type)))}})(x);return Pt(lt({},F),{index:L,key:`${t.indexKey||"paragraph"}-${L}`,customAttrs:F.isCustomComponent?_k(F.child,a.value):void 0,hasSlotChildren:Array.isArray(F.child.children)&&F.child.children.length>0,slotContent:String((E=F.child.content)!=null?E:""),originalChild:x})}));return(x,L)=>(w(),T("p",mJ,[k.value!==null?(w(),T("span",{key:0,class:"text-node","custom-id":t.customId},O(k.value),9,gJ)):(w(!0),T(Pe,{key:1},ot(I.value,E=>{return w(),T(Pe,{key:E.key},[b.value&&p(E.originalChild)?(w(),T(Pe,{key:0},[Je(O((F=E.originalChild,String((S=F.content)!=null?S:""))),1)],64)):E.isCustomComponent?(w(),we(jo(E.component),yn({key:1,ref_for:!0},E.customAttrs,{node:E.child,loading:E.child.loading,"index-key":E.key,"custom-id":t.customId,"custom-html-tags":d.value,"is-dark":f.value.isDark}),{default:Ee(()=>[E.hasSlotChildren?(w(),we(C(h),yn({key:0,ref_for:!0},f.value,{nodes:E.child.children,"index-key":E.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):E.slotContent?(w(),we(C(h),yn({key:1,ref_for:!0},f.value,{content:E.slotContent,final:!E.child.loading,"index-key":`${E.key}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ce("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(w(),we(jo(E.component),yn({key:2,ref_for:!0},A(E.child,E.index)),null,16))],64);var F,S}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);Ma.install=e=>{e.component(Ma.__name,Ma)};const vJ={class:"table-node-wrapper"},yJ=["aria-busy"],kJ={key:0},bJ=["custom-id"],xJ=["aria-label","onPointerdown"],wJ=["custom-id"],_J={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},hd=gn(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=R(()=>{var v;return(v=t.node.loading)!=null&&v}),o=R(()=>{var v;return(v=t.node.rows)!=null?v:[]}),s=J(null),i=J([]);let r=null;const l=R(()=>t.node.header.cells.length),a=R(()=>i.value.some(v=>Number.isFinite(v)&&v>0)),c=R(()=>a.value?i.value.map(v=>v>0?{width:`${v}px`}:void 0):[]);Ln("markstreamShowTooltips",R(()=>t.showTooltips)),Ln("markstreamFade",R(()=>t.fade));const u=Co(()=>t.customId),d=R(()=>!!u.value.text),f=R(()=>!!u.value.paragraph),h=new WeakMap;function p(v){const m=t.fade===!1&&!d.value,y=!f.value,k=h.get(v);if(k?.children===v.children&&k.textFastPath===m&&k.paragraphFastPath===y)return k.info;const A=Np(v.children,y,!0),$={simpleChildren:A,plainText:A&&m?eu(A):null};return h.set(v,{children:v.children,textFastPath:m,paragraphFastPath:y,info:$}),$}function g(v){if(!r)return;v.preventDefault();const m=r.startWidth+r.nextStartWidth,y=Math.min(48,Math.floor(m/2)),k=Math.max(y,Math.min(m-y,Math.round(r.startWidth+v.clientX-r.startX))),A=[...r.widths];A[r.index]=k,A[r.index+1]=m-k,i.value=A}function b(){r&&(window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",b),window.removeEventListener("pointercancel",b),r=null)}return Qe(l,()=>{b(),i.value=[]}),po(b),(v,m)=>(w(),T("div",vJ,[_("table",{ref_key:"tableRef",ref:s,class:We(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(w(),T("colgroup",kJ,[(w(!0),T(Pe,null,ot(e.node.header.cells,(y,k)=>(w(),T("col",{key:k,style:Yt(c.value[k])},null,4))),128))])):ce("",!0),_("thead",null,[_("tr",null,[(w(!0),T(Pe,null,ot(e.node.header.cells,(y,k)=>(w(),T("th",{key:k,dir:"auto",class:We([y.align==="right"?"text-right":y.align==="center"?"text-center":"text-left"])},[p(y).plainText!==null?(w(),T("span",{key:0,class:"text-node","custom-id":t.customId},O(p(y).plainText),9,bJ)):p(y).simpleChildren?(w(),we(C(Dd),{key:1,nodes:p(y).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${k}`},null,8,["nodes","custom-id","index-key"])):(w(),we(C(Bs),{key:2,nodes:y.children,"index-key":`table-th-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:m[0]||(m[0]=A=>v.$emit("copy",A))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),k<e.node.header.cells.length-1?(w(),T("button",{key:3,type:"button",class:"table-node__resize-handle","aria-label":`Resize columns ${k+1} and ${k+2}`,onPointerdown:A=>(function($,I){if(I.button!==0)return;const x=(function(){var F;const S=(F=s.value)==null?void 0:F.querySelectorAll("thead th");return Array.from(S??[],N=>Math.round(N.getBoundingClientRect().width))})(),L=x[$],E=x[$+1];L&&E&&(I.preventDefault(),r={index:$,startX:I.clientX,startWidth:L,nextStartWidth:E,widths:x},i.value=x,window.addEventListener("pointermove",g),window.addEventListener("pointerup",b),window.addEventListener("pointercancel",b))})(k,A)},null,40,xJ)):ce("",!0)],2))),128))])]),_("tbody",null,[(w(!0),T(Pe,null,ot(o.value,(y,k)=>(w(),T("tr",{key:k},[(w(!0),T(Pe,null,ot(y.cells,(A,$)=>(w(),T("td",{key:$,class:We([A.align==="right"?"text-right":A.align==="center"?"text-center":"text-left"]),dir:"auto"},[p(A).plainText!==null?(w(),T("span",{key:0,class:"text-node","custom-id":t.customId},O(p(A).plainText),9,wJ)):p(A).simpleChildren?(w(),we(C(Dd),{key:1,nodes:p(A).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${k}-${$}`},null,8,["nodes","custom-id","index-key"])):(w(),we(C(Bs),{key:2,nodes:A.children,"index-key":`table-td-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:m[1]||(m[1]=I=>v.$emit("copy",I))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,yJ),re(Il,{name:"table-node-fade"},{default:Ee(()=>[n.value?(w(),T("div",_J,[On(v.$slots,"loading",{isLoading:n.value},()=>[m[2]||(m[2]=_("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),m[3]||(m[3]=_("span",{class:"sr-only"},"Loading",-1))],!0)])):ce("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);hd.install=e=>{e.component(hd.__name,hd)};const SJ={class:"hr-node"},Lh=gn({},[["render",function(e,t){return w(),T("hr",SJ)}],["__scopeId","data-v-39b2349c"]]);Lh.install=e=>{e.component(Lh.__name,Lh)};const CJ={class:"unknown-node"},Fv=Ze({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(w(),T("div",CJ,O(e.node.raw),1))}),$h=gn(Ze({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){const t=e,n=R(()=>`vmr-container vmr-container-${t.node.name}`),o=Co(()=>t.customId),s=R(()=>lt({text:ro,paragraph:Ma,heading:Ip,inline_code:ts,link:xs,image:Al,strong:ks,emphasis:ws,strikethrough:bs,insert:Rs,subscript:Os,superscript:Fs,checkbox:Ys,checkbox_input:Ys,hardbreak:Ml,math_inline:Pi,reference:ys,list:qc,math_block:GM,table:hd},o.value));return(i,r)=>(w(),T("div",yn({class:n.value},e.node.attrs),[(w(!0),T(Pe,null,ot(e.node.children,(l,a)=>{return w(),we(jo((c=l.type,s.value[c]||Fv)),{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"]]);$h.install=e=>{e.component($h.__name,$h)};const AJ=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","BN","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],PS=[[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 MJ(e){if(e<=255)return AJ[e];let t=0,n=PS.length-1;for(;t<=n;){const o=t+n>>1,s=PS[o];if(e<s[0])n=o-1;else{if(!(e>s[1]))return s[2];t=o+1}}return"L"}const EJ=/[ \t\n\r\f]+/g,TJ=/[\t\n\r\f]| {2,}|^ | $/;let V0=null;const NJ=new RegExp("\\p{Script=Arabic}","u"),Dm=new RegExp("\\p{M}","u"),ZM=new RegExp("\\p{Nd}","u");function HS(e){return NJ.test(e)}function WS(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=183984&&e<=191471||e>=191472&&e<=192093||e>=194560&&e<=195103||e>=196608&&e<=201551||e>=201552&&e<=205743||e>=205744&&e<=210041||e>=63744&&e<=64255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=44032&&e<=55215||e>=65280&&e<=65519}function Rr(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(!(n<12288)){if(n>=55296&&n<=56319&&t+1<e.length){const o=e.charCodeAt(t+1);if(o>=56320&&o<=57343){if(WS(o-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(WS(n))return!0}}return!1}const IJ=new Set([" "," ","⁠","\uFEFF"]);function LJ(e){return Rr(e)}function Ov(e){return!(function(t){const n=Lp(t);return n!==null&&(Sk.has(n)||Ia.has(n))})(e)&&!(function(t){const n=Lp(t);return n!==null&&IJ.has(n)})(e)}const Sk=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),Pm=new Set(['"',"(","[","{","“","‘","«","‹","(","〔","〈","《","「","『","【","〖","〘","〚"]),Ck=new Set(["'","’"]),Ia=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),$J=new Set([":",".","،","؛"]),FJ=new Set(["၏"]),OJ=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function RJ(e){if(Ak(e))return!0;let t=!1;for(const n of e)if(Ia.has(n))t=!0;else if(!t||!Dm.test(n))return!1;return t}function BJ(e){for(const t of e)if(!Sk.has(t)&&!Ia.has(t))return!1;return e.length>0}function DJ(e){if(Ak(e))return!0;for(const t of e)if(!Pm.has(t)&&!Ck.has(t)&&!Dm.test(t))return!1;return e.length>0}function Ak(e){let t=!1;for(const n of e)if(n!=="\\"&&!Dm.test(n)){if(!(Pm.has(n)||Ia.has(n)||Ck.has(n)))return!1;t=!0}return t}function QM(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const o=e.charCodeAt(n);if(o<56320||o>57343)return n;const s=n-1;if(s<0)return n;const i=e.charCodeAt(s);return i>=55296&&i<=56319?s:n}function Lp(e){if(e.length===0)return null;const t=QM(e,e.length);return e.slice(t)}function PJ(e){const t=Array.from(e);let n=t.length;for(;n>0;){const o=t[n-1];if(Dm.test(o))n--;else{if(!Pm.has(o)&&!Ck.has(o))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function HJ(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function zS(e,t,n,o){const s=t[o],i=e[o];if(s==null)return i;const r=n[o];if(i.length===r)return i;const l=s.repeat(r);return e[o]=l,l}function US(e,t){return e&&t!==null&&$J.has(t)}function WJ(e){const t=Lp(e);return t!==null&&FJ.has(t)}function zJ(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 Rv(e){let t=e.length;for(;t>0;){const n=QM(e,t),o=e.slice(n,t);if(OJ.has(o))return!0;if(!Ia.has(o))return!1;t=n}return!1}function UJ(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
272
+ `)return"hard-break"}return e===" "?"space":e===" "||e===" "||e==="⁠"||e==="\uFEFF"?"glue":e==="​"?"zero-width-break":e==="­"?"soft-hyphen":"text"}const qJ=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function di(e){return e.length===1?e[0]:e.join("")}function jJ(e,t){const n=[];for(let o=e.length-1;o>=0;o--)n.push(e[o]);return n.push(t),di(n)}function VJ(e,t,n,o){if(!qJ.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const s=[];let i=null,r=[],l=n,a=!1,c=0;for(const u of e){const d=UJ(u,o),f=d==="text"&&t;i===null||d!==i||f!==a?(i!==null&&s.push({text:di(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&&s.push({text:di(r),isWordLike:a,kind:i,start:l}),s}function K0(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const KJ=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function GJ(e,t){const n=e.texts[t];return!!n.startsWith("www.")||KJ.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function YJ(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}const ZJ=new Set([":","-","/","×",",",".","+","–","—"]),qS=/^[A-Za-z0-9_]+[,:;]*$/,jS=/[,:;]+$/;function VS(e){for(const t of e)if(ZM.test(t))return!0;return!1}function Fh(e){if(e.length===0)return!1;for(const t of e)if(!ZM.test(t)&&!ZJ.has(t))return!1;return!0}function KS(e,t,n){var o,s,i;const r=(V0===null&&(V0=new Intl.Segmenter(void 0,{granularity:"word"})),V0);let l=0;const a=[],c=[],u=[],d=[],f=[],h=[],p=[],g=[],b=[],v=[],m=[],y=[];for(const x of r.segment(e))for(const L of VJ(x.segment,(o=x.isWordLike)!=null&&o,x.index,n)){let E=function(){h[P]!==null&&(c[P]=[zS(a,h,p,P)],h[P]=null),c[P].push(L.text),u[P]=u[P]||L.isWordLike,g[P]=g[P]||N,b[P]=b[P]||D,v[P]=U,m[P]=H,y[P]=US(b[P],B)};const F=L.kind==="text",S=HJ(L.text,L.isWordLike,L.kind),N=Rr(L.text),D=HS(L.text),B=Lp(L.text),U=Rv(L.text),H=WJ(L.text),P=l-1;t.carryCJKAfterClosingQuote&&F&&l>0&&d[P]==="text"&&N&&g[P]&&v[P]||F&&l>0&&d[P]==="text"&&BJ(L.text)&&g[P]||F&&l>0&&d[P]==="text"&&m[P]?E():F&&l>0&&d[P]==="text"&&L.isWordLike&&D&&y[P]?(E(),u[P]=!0):S!==null&&l>0&&d[P]==="text"&&h[P]===S?p[P]=((s=p[P])!=null?s:1)+1:F&&!L.isWordLike&&l>0&&d[P]==="text"&&(RJ(L.text)||L.text==="-"&&u[P])?E():(a[l]=L.text,c[l]=[L.text],u[l]=L.isWordLike,d[l]=L.kind,f[l]=L.start,h[l]=S,p[l]=S===null?0:1,g[l]=N,b[l]=D,v[l]=U,m[l]=H,y[l]=US(D,B),l++)}for(let x=0;x<l;x++)h[x]===null?a[x]=di(c[x]):a[x]=zS(a,h,p,x);for(let x=1;x<l;x++)d[x]==="text"&&!u[x]&&Ak(a[x])&&d[x-1]==="text"&&(a[x-1]+=a[x],u[x-1]=u[x-1]||u[x],a[x]="");const k=Array.from({length:l},()=>null);let A=-1;for(let x=l-1;x>=0;x--){const L=a[x];if(L.length!==0){if(d[x]==="text"&&!u[x]&&DJ(L)&&A>=0&&d[A]==="text"){const E=(i=k[A])!=null?i:[];E.push(L),k[A]=E,f[A]=f[x],a[x]="";continue}A=x}}for(let x=0;x<l;x++){const L=k[x];L!=null&&(a[x]=jJ(L,a[x]))}let $=0;for(let x=0;x<l;x++){const L=a[x];L.length!==0&&($!==x&&(a[$]=L,u[$]=u[x],d[$]=d[x],f[$]=f[x]),$++)}a.length=$,u.length=$,d.length=$,f.length=$;const I=(function(x){const L=x.texts.slice(),E=x.isWordLike.slice(),F=x.kinds.slice(),S=x.starts.slice();for(let N=0;N<L.length-1;N++){if(F[N]!=="text"||F[N+1]!=="text"||!Rr(L[N])||!Rr(L[N+1]))continue;const D=PJ(L[N]);D!==null&&(L[N]=D.head,L[N+1]=D.tail+L[N+1],S[N+1]=S[N]+D.head.length)}return{len:L.length,texts:L,isWordLike:E,kinds:F,starts:S}})((function(x){const L=[],E=[],F=[],S=[];for(let N=0;N<x.len;N++){const D=x.texts[N],B=x.kinds[N],U=x.isWordLike[N];if(B==="text"&&U&&qS.test(D)){const H=[D];let P=jS.test(D),Z=N+1;for(;P&&Z<x.len&&x.kinds[Z]==="text"&&x.isWordLike[Z]&&qS.test(x.texts[Z]);){const K=x.texts[Z];H.push(K),P=jS.test(K),Z++}L.push(di(H)),E.push(!0),F.push("text"),S.push(x.starts[N]),N=Z-1;continue}L.push(D),E.push(U),F.push(B),S.push(x.starts[N])}return{len:L.length,texts:L,isWordLike:E,kinds:F,starts:S}})((function(x){const L=[],E=[],F=[],S=[];for(let N=0;N<x.len;N++){const D=x.texts[N];if(x.kinds[N]==="text"&&D.includes("-")){const B=D.split("-");let U=B.length>1;for(let H=0;H<B.length;H++){const P=B[H];if(!U)break;P.length!==0&&VS(P)&&Fh(P)||(U=!1)}if(U){let H=0;for(let P=0;P<B.length;P++){const Z=B[P],K=P<B.length-1?`${Z}-`:Z;L.push(K),E.push(!0),F.push("text"),S.push(x.starts[N]+H),H+=K.length}continue}}L.push(D),E.push(x.isWordLike[N]),F.push(x.kinds[N]),S.push(x.starts[N])}return{len:L.length,texts:L,isWordLike:E,kinds:F,starts:S}})((function(x){const L=[],E=[],F=[],S=[];for(let N=0;N<x.len;N++){const D=x.texts[N],B=x.kinds[N];if(B==="text"&&Fh(D)&&VS(D)){const U=[D];let H=N+1;for(;H<x.len&&x.kinds[H]==="text"&&Fh(x.texts[H]);)U.push(x.texts[H]),H++;L.push(di(U)),E.push(!0),F.push("text"),S.push(x.starts[N]),N=H-1;continue}L.push(D),E.push(x.isWordLike[N]),F.push(B),S.push(x.starts[N])}return{len:L.length,texts:L,isWordLike:E,kinds:F,starts:S}})((function(x){const L=[],E=[],F=[],S=[];for(let N=0;N<x.len;N++){const D=x.texts[N];if(L.push(D),E.push(x.isWordLike[N]),F.push(x.kinds[N]),S.push(x.starts[N]),!YJ(D))continue;const B=N+1;if(B>=x.len||K0(x.kinds[B]))continue;const U=[],H=x.starts[B];let P=B;for(;P<x.len&&!K0(x.kinds[P]);)U.push(x.texts[P]),P++;U.length>0&&(L.push(di(U)),E.push(!0),F.push("text"),S.push(H),N=P-1)}return{len:L.length,texts:L,isWordLike:E,kinds:F,starts:S}})((function(x){const L=x.texts.slice(),E=x.isWordLike.slice(),F=x.kinds.slice(),S=x.starts.slice();for(let D=0;D<x.len;D++){if(F[D]!=="text"||!GJ(x,D))continue;const B=[L[D]];let U=D+1;for(;U<x.len&&!K0(F[U]);){B.push(L[U]),E[D]=!0;const H=L[U].includes("?");if(F[U]="text",L[U]="",U++,H)break}L[D]=di(B)}let N=0;for(let D=0;D<L.length;D++){const B=L[D];B.length!==0&&(N!==D&&(L[N]=B,E[N]=E[D],F[N]=F[D],S[N]=S[D]),N++)}return L.length=N,E.length=N,F.length=N,S.length=N,{len:N,texts:L,isWordLike:E,kinds:F,starts:S}})((function(x){const L=[],E=[],F=[],S=[];let N=0;for(;N<x.len;){const D=[x.texts[N]];let B=x.isWordLike[N],U=x.kinds[N],H=x.starts[N];if(U==="glue"){const P=[D[0]],Z=H;for(N++;N<x.len&&x.kinds[N]==="glue";)P.push(x.texts[N]),N++;const K=di(P);if(!(N<x.len&&x.kinds[N]==="text")){L.push(K),E.push(!1),F.push("glue"),S.push(Z);continue}D[0]=K,D.push(x.texts[N]),B=x.isWordLike[N],U="text",H=Z,N++}else N++;if(U==="text")for(;N<x.len&&x.kinds[N]==="glue";){const P=[];for(;N<x.len&&x.kinds[N]==="glue";)P.push(x.texts[N]),N++;const Z=di(P);N<x.len&&x.kinds[N]==="text"?(D.push(Z,x.texts[N]),B=B||x.isWordLike[N],N++):D.push(Z)}L.push(di(D)),E.push(B),F.push(U),S.push(H)}return{len:L.length,texts:L,isWordLike:E,kinds:F,starts:S}})({len:$,texts:a,isWordLike:u,kinds:d,starts:f})))))));for(let x=0;x<I.len-1;x++){const L=zJ(I.texts[x]);L!==null&&(I.kinds[x]!=="space"&&I.kinds[x]!=="preserved-space"||I.kinds[x+1]!=="text"||!HS(I.texts[x+1])||(I.texts[x]=L.space,I.isWordLike[x]=!1,I.kinds[x]=I.kinds[x]==="preserved-space"?"preserved-space":"space",I.texts[x+1]=L.marks+I.texts[x+1],I.starts[x+1]=I.starts[x]+L.space.length))}return I}function QJ(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const n=[];let o=0;for(let s=0;s<e.len;s++)e.kinds[s]==="hard-break"&&(n.push({startSegmentIndex:o,endSegmentIndex:s,consumedEndSegmentIndex:s+1}),o=s+1);return o<e.len&&n.push({startSegmentIndex:o,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}let lc=null;const GS=new Map;let ac=null;const XJ=new RegExp("\\p{Emoji_Presentation}","u"),JJ=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let G0=null;const YS=new Map;function Bv(){if(lc!==null)return lc;if(typeof OffscreenCanvas<"u")return lc=new OffscreenCanvas(1,1).getContext("2d"),lc;if(typeof document<"u")return lc=document.createElement("canvas").getContext("2d"),lc;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function ll(e,t){let n=t.get(e);return n===void 0&&(n={width:Bv().measureText(e).width,containsCJK:Rr(e)},t.set(e,n)),n}function Hm(){if(ac!==null)return ac;if(typeof navigator>"u")return ac={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},ac;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 ac={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},ac}function XM(){return G0===null&&(G0=new Intl.Segmenter(void 0,{granularity:"grapheme"})),G0}function eee(e){return XJ.test(e)||e.includes("️")}function la(e,t,n){return n===0?t.width:t.width-(function(o,s){return s.emojiCount===void 0&&(s.emojiCount=(function(i){let r=0;const l=XM();for(const a of l.segment(i))eee(a.segment)&&r++;return r})(o)),s.emojiCount})(e,t)*n}function tee(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 nee(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function ZS(e,t,n){const{widths:o,kinds:s,breakableFitAdvances:i}=e;if(o.length===0)return 0;const r=t+Hm().lineFitEpsilon;let l=0,a=0,c=!1,u=0,d=0,f=-1,h=0;function p(k=u,A=d,$=a){l++,a=0,c=!1,f=-1,h=0}function g(k,A){c=!0,u=k+1,d=0,a=A}function b(k,A,$){c=!0,u=k,d=A+1,a=$}function v(k,A){c?(a+=A,u=k+1,d=0):g(k,A)}function m(k,A){const $=i[k];for(let I=A;I<$.length;I++){const x=$[I];c?a+x>r?(p(),b(k,I,x)):(a+=x,u=k,d=I+1):b(k,I,x)}c&&u===k&&d===$.length&&(u=k+1,d=0)}let y=0;for(;y<o.length&&(c||(y=tee(e,y),!(y>=o.length)));){const k=o[y],A=s[y],$=A==="space"||A==="preserved-space"||A==="tab"||A==="zero-width-break"||A==="soft-hyphen";if(c)if(a+k>r){if($){v(y,k),p(y+1,0,a-k),y++;continue}if(f>=0){if(u>f||u===f&&d>0){p();continue}p(f,0,h);continue}if(k>t&&i[y]!==null){p(),m(y,0),y++;continue}p()}else v(y,k),$&&(f=y+1,h=a-k),y++;else k>t&&i[y]!==null?m(y,0):g(y,k),$&&(f=y+1,h=a-k),y++}return c&&p(),l}let Y0=null;function oee(e,t){const n=[];let o=[],s=0,i=!1,r=!1,l=!1;function a(){o.length!==0&&(n.push({text:o.length===1?o[0]:o.join(""),start:s}),o=[],i=!1,r=!1,l=!1)}function c(d,f,h){o=[d],s=f,i=h,r=Rv(d),l=Pm.has(d)}function u(d,f){o.push(d),i=i||f;const h=Rv(d);r=d.length===1&&Ia.has(d)&&r||h,l=!1}for(const d of(Y0===null&&(Y0=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Y0).segment(e)){const f=d.segment,h=Rr(f);o.length!==0?l||Sk.has(f)||Ia.has(f)||t.carryCJKAfterClosingQuote&&h&&r?u(f,h):i||h?(a(),c(f,d.index,h)):u(f,h):c(f,d.index,h)}return a(),n}function see(e){if(e.length<=1)return e;const t=[];let n=[e[0].text],o=e[0].start,s=Rr(e[0].text),i=Ov(e[0].text);function r(){t.push({text:n.length===1?n[0]:n.join(""),start:o})}for(let l=1;l<e.length;l++){const a=e[l],c=Rr(a.text),u=Ov(a.text);s&&i?(n.push(a.text),s=s||c,i=u):(r(),n=[a.text],o=a.start,s=c,i=u)}return r(),t}function iee(e,t,n,o){const s=Hm(),{cache:i,emojiCorrection:r}=(function(I,x){Bv().font=I;const L=(function(S){let N=GS.get(S);return N||(N=new Map,GS.set(S,N)),N})(I),E=(function(S){const N=S.match(/(\d+(?:\.\d+)?)\s*px/);return N?parseFloat(N[1]):16})(I),F=x?(function(S,N){let D=YS.get(S);if(D!==void 0)return D;const B=Bv();B.font=S;const U=B.measureText("😀").width;if(D=0,U>N+.5&&typeof document<"u"&&document.body!==null){const H=document.createElement("span");H.style.font=S,H.style.display="inline-block",H.style.visibility="hidden",H.style.position="absolute",H.textContent="😀",document.body.appendChild(H);const P=H.getBoundingClientRect().width;document.body.removeChild(H),U-P>.5&&(D=U-P)}return YS.set(S,D),D})(I,E):0;return{cache:L,fontSize:E,emojiCorrection:F}})(t,(l=e.normalized,JJ.test(l)));var l;const a=la("-",ll("-",i),r),c=8*la(" ",ll(" ",i),r);if(e.len===0)return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]};const u=[],d=[],f=[],h=[];let p=e.chunks.length<=1;const g=null,b=[],v=n?[]:null,m=Array.from({length:e.len});function y(I,x,L,E,F,S,N){F!=="text"&&F!=="space"&&F!=="zero-width-break"&&(p=!1),u.push(x),d.push(L),f.push(E),h.push(F),b.push(N),v!==null&&v.push(I)}function k(I,x,L,E,F){const S=ll(I,i),N=la(I,S,r),D=x==="space"||x==="preserved-space"||x==="zero-width-break"?0:N,B=x==="space"||x==="zero-width-break"?0:N;if(F&&E&&I.length>1){let U="sum-graphemes";Fh(I)?U="pair-context":s.preferPrefixWidthsForBreakableRuns&&(U="segment-prefixes");const H=(function(P,Z,K,V,X){if(Z.breakableFitAdvances!==void 0)return Z.breakableFitAdvances;const he=XM(),ne=[];for(const Ie of he.segment(P))ne.push(Ie.segment);if(ne.length<=1)return Z.breakableFitAdvances=null,Z.breakableFitAdvances;if(X==="sum-graphemes"){const Ie=[];for(const le of ne){const z=ll(le,K);Ie.push(la(le,z,V))}return Z.breakableFitAdvances=Ie,Z.breakableFitAdvances}if(X==="pair-context"||ne.length>96){const Ie=[];let le=null,z=0;for(const ae of ne){const ie=la(ae,ll(ae,K),V);if(le===null)Ie.push(ie);else{const q=le+ae,ee=ll(q,K);Ie.push(la(q,ee,V)-z)}le=ae,z=ie}return Z.breakableFitAdvances=Ie,Z.breakableFitAdvances}const ue=[];let de="",Ce=0;for(const Ie of ne){de+=Ie;const le=la(de,ll(de,K),V);ue.push(le-Ce),Ce=le}return Z.breakableFitAdvances=ue,Z.breakableFitAdvances})(I,S,i,r,U);return void y(I,N,D,B,x,L,H)}y(I,N,D,B,x,L,null)}for(let I=0;I<e.len;I++){m[I]=u.length;const x=e.texts[I],L=e.isWordLike[I],E=e.kinds[I],F=e.starts[I];if(E==="soft-hyphen"){y(x,0,a,a,E,F,null);continue}if(E==="hard-break"){y(x,0,0,0,E,F,null);continue}if(E==="tab"){y(x,0,0,0,E,F,null);continue}const S=ll(x,i);if(E==="text"&&S.containsCJK){const N=oee(x,s),D=o==="keep-all"?see(N):N;for(let B=0;B<D.length;B++){const U=D[B];k(U.text,"text",F+U.start,L,o==="keep-all"||!Rr(U.text))}continue}k(x,E,F,L,!0)}const A=(function(I,x,L){const E=[];for(let F=0;F<I.length;F++){const S=I[F],N=S.startSegmentIndex<x.length?x[S.startSegmentIndex]:L,D=S.endSegmentIndex<x.length?x[S.endSegmentIndex]:L,B=S.consumedEndSegmentIndex<x.length?x[S.consumedEndSegmentIndex]:L;E.push({startSegmentIndex:N,endSegmentIndex:D,consumedEndSegmentIndex:B})}return E})(e.chunks,m,u.length),$=g===null?null:(function(I,x){const L=(function(F){const S=F.length;if(S===0)return null;const N=new Array(S);let D=!1;for(let K=0;K<S;){const V=F.charCodeAt(K);let X=V,he=1;if(V>=55296&&V<=56319&&K+1<S){const ue=F.charCodeAt(K+1);ue>=56320&&ue<=57343&&(X=ue-56320+(V-55296<<10)+65536,he=2)}const ne=MJ(X);ne!=="R"&&ne!=="AL"&&ne!=="AN"||(D=!0);for(let ue=0;ue<he;ue++)N[K+ue]=ne;K+=he}if(!D)return null;let B=0;for(let K=0;K<S;K++){const V=N[K];if(V==="L"){B=0;break}if(V==="R"||V==="AL"){B=1;break}}const U=new Int8Array(S);for(let K=0;K<S;K++)U[K]=B;const H=1&B?"R":"L",P=H;let Z=P;for(let K=0;K<S;K++)N[K]==="NSM"?N[K]=Z:Z=N[K];Z=P;for(let K=0;K<S;K++){const V=N[K];V==="EN"?N[K]=Z==="AL"?"AN":"EN":V!=="R"&&V!=="L"&&V!=="AL"||(Z=V)}for(let K=0;K<S;K++)N[K]==="AL"&&(N[K]="R");for(let K=1;K<S-1;K++)N[K]==="ES"&&N[K-1]==="EN"&&N[K+1]==="EN"&&(N[K]="EN"),N[K]!=="CS"||N[K-1]!=="EN"&&N[K-1]!=="AN"||N[K+1]!==N[K-1]||(N[K]=N[K-1]);for(let K=0;K<S;K++){if(N[K]!=="EN")continue;let V;for(V=K-1;V>=0&&N[V]==="ET";V--)N[V]="EN";for(V=K+1;V<S&&N[V]==="ET";V++)N[V]="EN"}for(let K=0;K<S;K++){const V=N[K];V!=="WS"&&V!=="ES"&&V!=="ET"&&V!=="CS"||(N[K]="ON")}Z=P;for(let K=0;K<S;K++){const V=N[K];V==="EN"?N[K]=Z==="L"?"L":"EN":V!=="R"&&V!=="L"||(Z=V)}for(let K=0;K<S;K++){if(N[K]!=="ON")continue;let V=K+1;for(;V<S&&N[V]==="ON";)V++;const X=(K>0?N[K-1]:P)!=="L"?"R":"L";if(X===((V<S?N[V]:P)!=="L"?"R":"L"))for(let he=K;he<V;he++)N[he]=X;K=V-1}for(let K=0;K<S;K++)N[K]==="ON"&&(N[K]=H);for(let K=0;K<S;K++){const V=N[K];1&U[K]?V!=="L"&&V!=="AN"&&V!=="EN"||U[K]++:V==="R"?U[K]++:V!=="AN"&&V!=="EN"||(U[K]+=2)}return U})(I);if(L===null)return null;const E=new Int8Array(x.length);for(let F=0;F<x.length;F++)E[F]=L[x[F]];return E})(e.normalized,g);return v!==null?{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:f,kinds:h,simpleLineWalkFastPath:p,segLevels:$,breakableFitAdvances:b,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:A,segments:v}:{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:f,kinds:h,simpleLineWalkFastPath:p,segLevels:$,breakableFitAdvances:b,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:A}}function ree(e,t,n){return(function(o,s,i,r){var l;const a=(l=r?.wordBreak)!=null?l:"normal";return iee((function(c,u,d="normal",f="normal"){const h=(function(b){const v=b??"normal";return v==="pre-wrap"?{mode:v,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:v,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}})(d),p=h.mode==="pre-wrap"?(function(b){return/[\r\f]/.test(b)?b.replace(/\r\n/g,`
273
+ `).replace(/[\r\f]/g,`
274
+ `):b.replace(/\r\n/g,`
275
+ `)})(c):(function(b){if(!TJ.test(b))return b;let v=b.replace(EJ," ");return v.charCodeAt(0)===32&&(v=v.slice(1)),v.length>0&&v.charCodeAt(v.length-1)===32&&(v=v.slice(0,-1)),v})(c);if(p.length===0)return{normalized:p,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const g=f==="keep-all"?(function(b){if(b.len<=1)return b;const v=[],m=[],y=[],k=[];let A=null,$=!1,I=0,x=!1,L=!1;function E(){A!==null&&(v.push(di(A)),m.push($),y.push("text"),k.push(I),A=null)}for(let F=0;F<b.len;F++){const S=b.texts[F],N=b.kinds[F],D=b.isWordLike[F],B=b.starts[F];if(N==="text"){const U=LJ(S),H=Ov(S);if(A!==null&&x&&L){A.push(S),$=$||D,x=x||U,L=H;continue}E(),A=[S],$=D,I=B,x=U,L=H;continue}E(),v.push(S),m.push(D),y.push(N),k.push(B)}return E(),{len:v.length,texts:v,isWordLike:m,kinds:y,starts:k}})(KS(p,u,h)):KS(p,u,h);return lt({normalized:p,chunks:QJ(g,h)},g)})(o,Hm(),r?.whiteSpace,a),s,!1,a)})(e,t,0,n)}const Z0="__MARKSTREAM_VUE_HEIGHT_ESTIMATION_EXPERIMENT__",Eo=(()=>{const e=globalThis;if(e[Z0])return e[Z0];const t={configs:{},controllers:{},revision:Ba(0),preparedCache:new Map,blockEstimateCache:new Map};return e[Z0]=t,t})();let Bu=null;const QS=Eo.revision;function XS(e){var t;return e&&(t=Eo.configs[e])!=null?t:null}function JS(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function lee(e){return e?.type==="text"||e?.type==="emoji"||e?.type==="hardbreak"}function Q0(e){var t,n,o;if(!Array.isArray(e)||e.length===0)return null;let s="";for(const i of e){if(!lee(i))return null;i.type==="text"?s+=String((t=i.content)!=null?t:""):i.type==="emoji"?s+=String((o=(n=i.name)!=null?n:i.raw)!=null?o:""):i.type==="hardbreak"&&(s+=`
276
+ `)}return s.length>0?s:null}function X0(e,t,n){var o,s;if(!e||!Number.isFinite(t)||t<=0||!(function(){var i;if(Bu!=null)return Bu;if(typeof document>"u")return!1;try{const r=document.createElement("canvas");return Bu=!!((i=r.getContext)!=null&&i.call(r,"2d")),Bu}catch{return Bu=!1,!1}})())return null;try{const i=Math.round(100*t)/100,r=[(o=n.whiteSpace)!=null?o:"pre-wrap",n.font,n.lineHeight,n.wrapperOverhead,n.widthAdjustment,i,e].join("\0"),l=Eo.blockEstimateCache.get(r);if(l)return Eo.blockEstimateCache.delete(r),Eo.blockEstimateCache.set(r,l),{kind:"simple-text",height:l.height,contentHeight:l.contentHeight};const a=(s=n.whiteSpace)!=null?s:"pre-wrap",c=(function(h,p,g){const b=`${g}\0${p}\0${h}`,v=Eo.preparedCache.get(b);if(v)return Eo.preparedCache.delete(b),Eo.preparedCache.set(b,v),v.prepared;const m=ree(h,p,{whiteSpace:g});for(Eo.preparedCache.set(b,{prepared:m});Eo.preparedCache.size>240;){const y=Eo.preparedCache.keys().next().value;if(!y)break;Eo.preparedCache.delete(y)}return m})(e,n.font,a),u=(function(h,p,g){const b=(function(v,m){return v.simpleLineWalkFastPath?ZS(v,m):(function(y,k){if(y.simpleLineWalkFastPath)return ZS(y,k);const{widths:A,lineEndFitAdvances:$,lineEndPaintAdvances:I,kinds:x,breakableFitAdvances:L,discretionaryHyphenWidth:E,tabStopAdvance:F,chunks:S}=y;if(A.length===0||S.length===0)return 0;const N=Hm(),D=N.lineFitEpsilon,B=k+D;let U=0,H=0,P=!1,Z=0,K=0,V=-1,X=0,he=0,ne=null;function ue(){V=-1,X=0,he=0,ne=null}function de(ee=Z,ye=K,fe=H){U++,H=0,P=!1,ue()}function Ce(ee,ye){P=!0,Z=ee+1,K=0,H=ye}function Ie(ee,ye,fe){P=!0,Z=ee,K=ye+1,H=fe}function le(ee,ye){P?(H+=ye,Z=ee+1,K=0):Ce(ee,ye)}function z(ee,ye,fe,ve){if(!ye)return;const j=ee==="tab"?0:$[fe],te=ee==="tab"?ve:I[fe];V=fe+1,X=H-ve+j,he=H-ve+te,ne=ee}function ae(ee,ye){const fe=L[ee];for(let ve=ye;ve<fe.length;ve++){const j=fe[ve];P?H+j>B?(de(),Ie(ee,ve,j)):(H+=j,Z=ee,K=ve+1):Ie(ee,ve,j)}P&&Z===ee&&K===fe.length&&(Z=ee+1,K=0)}function ie(ee){if(ne!=="soft-hyphen")return!1;const ye=L[ee];if(ye==null)return!1;const{fitCount:fe,fittedWidth:ve}=(function(j,te,me,Ae,$e){let De=0,ge=te;for(;De<j.length;){const Ne=ge+j[De];if((De+1<j.length?Ne+$e:Ne)>me+Ae)break;ge=Ne,De++}return{fitCount:De,fittedWidth:ge}})(ye,H,k,D,E);return fe!==0&&(H=ve,Z=ee,K=fe,ue(),fe===ye.length?(Z=ee+1,K=0,!0):(de(ee,fe,ve+E),ae(ee,fe),!0))}function q(ee){U++,ue()}for(let ee=0;ee<S.length;ee++){const ye=S[ee];if(ye.startSegmentIndex===ye.endSegmentIndex){q();continue}P=!1,H=0,ye.startSegmentIndex,Z=ye.startSegmentIndex,K=0,ue();let fe=ye.startSegmentIndex;for(;fe<ye.endSegmentIndex;){const ve=x[fe],j=ve==="space"||ve==="preserved-space"||ve==="tab"||ve==="zero-width-break"||ve==="soft-hyphen",te=ve==="tab"?nee(H,F):A[fe];if(ve!=="soft-hyphen")if(P){if(H+te>B){const me=H+(ve==="tab"?0:$[fe]),Ae=H+(ve==="tab"?te:I[fe]);if(ne==="soft-hyphen"&&N.preferEarlySoftHyphenBreak&&X<=B){de(V,0,he);continue}if(ne==="soft-hyphen"&&ie(fe)){fe++;continue}if(j&&me<=B){le(fe,te),de(fe+1,0,Ae),fe++;continue}if(V>=0&&X<=B){if(Z>V||Z===V&&K>0){de();continue}const $e=V;de($e,0,he),fe=$e;continue}if(te>k&&L[fe]!==null){de(),ae(fe,0),fe++;continue}de();continue}le(fe,te),z(ve,j,fe,te),fe++}else te>k&&L[fe]!==null?ae(fe,0):Ce(fe,te),z(ve,j,fe,te),fe++;else P&&(Z=fe+1,K=0,V=fe+1,X=H+E,he=H+E,ne=ve),fe++}if(P){const ve=V===ye.consumedEndSegmentIndex?he:H;de(ye.consumedEndSegmentIndex,0,ve)}}return U})(v,m)})(h,p);return{lineCount:b,height:b*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(Eo.blockEstimateCache.set(r,{height:f,contentHeight:Math.round(d)});Eo.blockEstimateCache.size>4e3;){const h=Eo.blockEstimateCache.keys().next().value;if(!h)break;Eo.blockEstimateCache.delete(h)}return{kind:"simple-text",height:f,contentHeight:Math.round(d)}}catch{return null}}function JM(e,t,n){var o,s;if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type==="paragraph"){const i=Q0(e.children);return i&&n.paragraph?X0(i,t,n.paragraph):null}if(e.type==="heading"){const i=Number(e.level||0),r=Q0(e.children),l=n.headings[i];return r&&l?X0(r,t,l):null}if(e.type==="list_item"){const i=Array.isArray(e.children)?e.children:[];if(i.length!==1||((o=i[0])==null?void 0:o.type)!=="paragraph"||!n.listItem)return null;const r=Q0((s=i[0])==null?void 0:s.children);return r?X0(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=JM(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 oh(e){if(!e)return 1;const t=String(e).split(/\r?\n/);return Math.max(1,t.length)}function aee(e,t){var n;if(!e||e.type!=="code_block")return null;const o=t.rendererKind,s=t.showHeader!==!1,i=(function(u){var d,f,h;return u.diff?Math.max(oh(String((d=u.originalCode)!=null?d:"")),oh(String((f=u.updatedCode)!=null?f:"")),oh(String((h=u.code)!=null?h:""))):oh((function(p,g){const b=String(p??"");return g?b:b.replace(/\r\n$|\n$|\r$/,"")})(u.code,u.loading===!0))})(e),r=!!e.diff;let l=0,a=500;if(o==="monaco"){const u=(n=t.monacoOptions)!=null?n:{},d=(function(h,p){const g=typeof h?.fontSize=="number"&&h.fontSize>0?h.fontSize:p?13:12;return typeof h?.lineHeight=="number"&&h.lineHeight>0?h.lineHeight:p?30:Math.round(1.5*g)})(u,r),f=(function(h,p){var g,b;if(!p)return 0;const v=typeof((g=h?.padding)==null?void 0:g.top)=="number"?h.padding.top:10,m=typeof((b=h?.padding)==null?void 0:b.bottom)=="number"?h.padding.bottom:22;return Math.max(0,v)+Math.max(0,m)})(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 o==="markdown"?l=Math.round(21*i+32):(l=Math.round(21*i+32),a=Number.POSITIVE_INFINITY);const c=Math.max(1,Math.min(l,a));return{kind:"code-block",height:Math.round(c+(s?40:0)),contentHeight:c,rendererKind:o}}function cee(e){return e?`${e.fontStyle||"normal"} ${e.fontWeight||"400"} ${e.fontSize||"16px"} ${e.fontFamily||"sans-serif"}`:""}function J0(e,t,n="pre-wrap"){if(!e||!t||typeof window>"u")return null;const o=window.getComputedStyle(t),s=e.offsetHeight,i=JS(o.lineHeight,1.5*JS(o.fontSize,16)),r=e.getBoundingClientRect().width,l=t.getBoundingClientRect().width;return{font:cee(o),lineHeight:i,wrapperOverhead:Math.max(0,s-i),widthAdjustment:Math.max(0,r-l),whiteSpace:n}}const uee=new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function eC(e,t={}){var n;const o={},s=new Set((n=t.omit)!=null?n:[]);if(!e||typeof e!="object")return o;const i=Object.getOwnPropertyDescriptors(e);for(const[r,l]of Object.entries(i))uee.has(r)||s.has(r)||l.enumerable&&"value"in l&&(o[r]=l.value);return o}const dee=!1;function f_e(){return dee}function tC(e,t,n,o){var s;const i=(function(f){return Math.max(0,Math.ceil(f.scrollHeight||0)-Math.ceil(f.clientHeight||0))})(e),r=(function(f,h){return Number.isFinite(f)?Math.min(Math.max(0,f),h):0})(n,i);if(!o.isReverseFlexScrollRoot(e))return void(e.scrollTop=r);const l=Math.max(0,i-r),a=[-l,l];let c=a[0],u=Number.POSITIVE_INFINITY;for(const f of a){e.scrollTop=f;const h=o.getNormalizedScrollTop(e,t,!1),p=Math.abs(h-r);p<u&&(u=p,c=f)}e.scrollTop=c;const d=(s=o.epsilonPx)!=null?s:2;Math.abs(o.getNormalizedScrollTop(e,t,!1)-r)>d&&(e.scrollTop=c)}const e5=Symbol("MarkstreamMathBlockMinHeightCache");function h_e(){return Kt(e5,null)}const fee=["total","cacheHits","appendHits","tailHits","fullParses","chunkedParses"],hee=["tokenCloneMs","processTokensMs","parseMarkdownToStructureTotalMs"],pee=new Set(["attrs","data","items","header","payload","props","rows","cells","term","definition"]),t5=["raw","content","code","originalCode","updatedCode"],nC=new WeakMap,oC=new WeakMap;let mee=1;function Ti(){return typeof performance<"u"?performance.now():Date.now()}function sC(e){const t=e.stream;return t&&typeof t.stats=="function"?t.stats():null}function gi(e){if(typeof e!="object"&&typeof e!="function"||e===null)return"";const t=e;let n=nC.get(t);return n||(n=mee++,nC.set(t,n)),String(n)}function iC(e,t,n,o={}){var s,i;const r=o.includeFinal!==!1,l={md:gi(t),customMarkdownIt:gi(n),requireClosingStrong:e.requireClosingStrong===!0,customHtmlTags:(s=e.customHtmlTags)!=null?s:[],streamParse:(i=e.streamParse)!=null?i:"auto",validateLink:gi(e.validateLink),preTransformTokens:gi(e.preTransformTokens),postTransformTokens:gi(e.postTransformTokens)};return r&&(l.final=e.final===!0),JSON.stringify(l)}function rC(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===10;)t-=1;const n=e.lastIndexOf(`
277
+ `,t-1)+1;return e.slice(n,t).trim()}function lC(e){const t=n5(e);return t.length>=2&&t.every(n=>{const o=n.trim();return o.length>=1&&o.replace(/^:/,"").replace(/:$/,"").split("").every(s=>s==="-")})}function n5(e){return e.includes("|")?e.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]}function o5(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 Mk(e){const t=String(e??"");return`${t.length}:${o5(t)}`}function Dv(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?Mk(r):`${r.length}:${o5(r.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${gi(e)}`;if(typeof e!="object")return typeof e;const o=e,s=t.get(o);if(s)return`cycle:${s}`;if(n>=6)return`object:${gi(o)}`;const i=gi(o);if(t.set(o,i),Array.isArray(e)){const r=e.slice(0,200);return`a:${e.length}:${r.map(l=>Dv(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}:${Dv(r[c],t,n+1)}`).join(";")}`}return typeof e}function $p(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function s5(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(o=>$p(o)?Rl(o,t,n+1):s5(o,t,n+1)).join(",")}`:$p(e)?Rl(e,t,n):Dv(e,t,n)}function gee(e,t,n){return Object.keys(e).sort().filter(o=>o!=="children"&&!t5.includes(o)).map(o=>{const s=e[o];return typeof s=="string"?`${o}=s:${Mk(s)}`:typeof s=="number"||typeof s=="boolean"||s==null?`${o}=${String(s)}`:typeof s=="function"?`${o}=fn:${gi(s)}`:pee.has(o)&&(Array.isArray(s)||typeof s=="object")?`${o}=${s5(s,t,n+1)}`:s&&typeof s=="object"?`${o}=object:${gi(s)}`:""}).filter(Boolean).join(";")}function vee(e){return t5.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${Mk(n)}`:""}).filter(Boolean).join(";")}function Rl(e,t=new WeakMap,n=0){const o=oC.get(e);if(o)return o;const s=e,i=t.get(s);if(i)return`node-cycle:${i}`;if(n>=6)return`node:${e.type}:${gi(s)}`;const r=gi(s);t.set(s,r);const l=(function(a,c,u){const d=a,f=Array.isArray(d.children)?d.children:[],h=f.length?f.slice(0,200).map(p=>Rl(p,c,u+1)).join("|"):"";return[a.type,vee(d),gee(d,c,u),f.length,h].join(":")})(e,t,n);return oC.set(s,l),l}function i5(e,t){return Rl(e)===Rl(t)}function Ek(e,t,n){const o=Ti(),s=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=Ti()-o,e[s]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function aC(e,t,n){return Ek(t,n,()=>Rl(e))}function r5(e,t,n){return aC(e,n,"stabilizeSignatureMs")===aC(t,n,"stabilizeSignatureMs")}function eg(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function cC(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function yee(e,t){return e.length===t.length&&e===t}function Tk(e,t,n=0){if(n>=4)return null;if(e.type!==t.type)return!1;const o=e,s=t,i=Object.keys(o).filter(u=>u!=="type"&&u!=="children").sort(),r=Object.keys(s).filter(u=>u!=="type"&&u!=="children").sort();if(i.length!==r.length)return!1;for(let u=0;u<i.length;u++){const d=i[u];if(d!==r[u])return!1;const f=o[d],h=s[d];if(typeof f!=typeof h)return!1;if(typeof f!="string"){if(typeof f!="number"&&typeof f!="boolean"&&f!=null)return null;if(!Object.is(f,h))return!1}else if(typeof h!="string"||!yee(f,h))return!1}const l=Object.prototype.hasOwnProperty.call(o,"children");if(l!==Object.prototype.hasOwnProperty.call(s,"children"))return!1;if(!l)return!0;const a=o.children,c=s.children;if(!Array.isArray(a)||!Array.isArray(c))return null;if(a.length!==c.length)return!1;for(let u=0;u<a.length;u++){const d=a[u],f=c[u];if(!$p(d)||!$p(f))return null;const h=Tk(d,f,n+1);if(h==null)return null;if(!h)return!1}return!0}function kee(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;const n=Tk(e,t);return n??i5(e,t)}function bee(e,t,n){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;let o=null;return Ek(n,"stabilizeSignatureMs",()=>{o=Tk(e,t)}),o??r5(e,t,n)}function xee(e,t){const n={};for(const o of fee){const s=e[o],i=t?.[o];typeof s=="number"&&(n[o]=s-(typeof i=="number"?i:0))}return n}function wee(e,t){var n;const o=hS(t.instanceMsgId),s=new Map,i=(n=t.smoothStreamingEnabled)!=null?n:R(()=>!1),r=J(t.renderContent.value);let l,a=[],c="",u="",d="",f=0,h=0,p=Ti();function g(){l&&(clearTimeout(l),l=void 0)}function b(){g();const L=t.renderContent.value;r.value!==L&&(r.value=L),p=Ti()}Qe([t.renderContent,t.effectiveFinal,i],([L,E,F])=>{r.value!==L&&(!F||E||(function(S,N){if(!S&&N||N.length<=80||N.length<S.length||!N.startsWith(S))return!0;const D=N.slice(S.length);return!!D&&(!!lC(rC(N))||!(!D.includes(`
278
+
279
+ `)&&!/(?:^|\n)(?:#{1,6}\s|[-+*]\s+|\d+[.)]\s+|>\s*|`{3,}|~{3,})/.test(D))||D.endsWith(`
280
+ `)&&!(function(B){const U=rC(B);if(lC(U))return!1;const H=n5(U);return H.length>=2&&H.some(P=>P.trim())})(N))})(r.value,L)?b():(function(){if(h+=1,l)return;const S=Math.max(0,(function(N){const D=N.parseCoalesceMs;return typeof D=="number"&&Number.isFinite(D)&&D>=0?D:80})(e)-(Ti()-p));S<=0?b():l=setTimeout(b,S)})())},{flush:"sync",immediate:!0}),dy(g);const v=R(()=>{var L,E,F,S;return WV(e.customHtmlTags,(L=e.parseOptions)==null?void 0:L.customHtmlTags,(S=(F=(E=t.customComponentsMap)==null?void 0:E.value)!=null?F:{},Object.entries(S).map(([N,D])=>{const B=_i(N);return D==null||!B||ef(B)||$6.has(B)||Qd.has(B)?"":B}).filter(Boolean)))}),m=R(()=>{const{key:L,tags:E}=zV(v.value);if(!L)return o;const F=s.get(L);if(F)return F;const S=hS(t.instanceMsgId,{customHtmlTags:E});return s.set(L,S),S}),y=R(()=>{const L=m.value;return e.customMarkdownIt?e.customMarkdownIt(L):L}),k=R(()=>{var L,E;const F=(L=e.parseOptions)!=null?L:{},S=t.effectiveFinal.value,N=v.value,D=S!=null,B=N.length>0;return D||B||F.streamParse==null?lt(lt(Pt(lt({},F),{streamParse:(E=F.streamParse)==null||E}),D?{final:S}:{}),B?{customHtmlTags:N}:{}):F}),A=R(()=>{var L;return new Set(((L=k.value.customHtmlTags)!=null?L:[]).map(E=>String(E).trim().toLowerCase()).filter(Boolean))}),$=R(()=>iC(k.value,y.value,e.customMarkdownIt,{includeFinal:!0})),I=R(()=>iC(k.value,y.value,e.customMarkdownIt,{includeFinal:!1}));Qe([$,I],([L,E],[F,S])=>{F&&(L===F&&E===S||(b(),E!==S&&(a=[],d="")))},{flush:"sync"});const x=R(()=>{var L,E,F,S,N,D,B,U;if((L=e.nodes)!=null&&L.length)return a=[],d="",pt(e.nodes.slice());const H=r.value;if(!H)return a=[],d="",[];const P=t.debugPerformanceEnabled.value,Z=P?Ti():0,K=y.value,V=$.value,X=I.value;c&&V!==c&&(function(ye){var fe,ve;(ve=(fe=ye.stream)==null?void 0:fe.reset)==null||ve.call(fe)})(K),u&&X!==u&&(a=[],d="");const he=a.length>0&&H.startsWith(d)&&X===u,ne=P?sC(K):null,ue=P?{}:void 0,de=ue?Pt(lt({},k.value),{__timing:ue}):k.value,Ce=xM(H,K,de),Ie=P?Ti():0,le=P?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let z,ae=P?eg(Ce.length):void 0,ie=0,q=0;if(he){const ye=P?Ti():0;if(le){const fe=(function(ve,j,te){if(!j.length)return{nodes:ve,metrics:eg(ve.length)};const me=(function(De,ge,Ne){const et=Math.min(De.length,ge.length);for(let rt=0;rt<et;rt++)if(!bee(ge[rt],De[rt],Ne))return rt;return De.length===ge.length?-1:et})(ve,j,te);if(me<0)return{nodes:j,metrics:{reusedNodeCount:ve.length,dirtyStartIndex:me,stablePrefixNodeCount:ve.length,dirtyTailNodeCount:0}};const Ae=ve.slice();let $e=me;for(let De=0;De<me;De++)Ae[De]=j[De];for(let De=me;De<ve.length;De++){const ge=j[De],Ne=ve[De];ge&&r5(ge,Ne,te)&&(Ae[De]=ge,$e+=1)}return{nodes:Ae,metrics:{reusedNodeCount:$e,dirtyStartIndex:me,stablePrefixNodeCount:me,dirtyTailNodeCount:cC(me,ve,j)}}})(Ce,a,le);z=fe.nodes,ae=fe.metrics}else{const fe=(function(ve,j){if(!j.length)return{nodes:ve,metrics:eg(ve.length)};const te=(function($e,De){const ge=Math.min($e.length,De.length);for(let Ne=0;Ne<ge;Ne++)if(!kee(De[Ne],$e[Ne]))return Ne;return $e.length===De.length?-1:ge})(ve,j);if(te<0)return{nodes:j,metrics:{reusedNodeCount:ve.length,dirtyStartIndex:te,stablePrefixNodeCount:ve.length,dirtyTailNodeCount:0}};const me=ve.slice();let Ae=te;for(let $e=0;$e<te;$e++)me[$e]=j[$e];for(let $e=te;$e<ve.length;$e++){const De=j[$e],ge=ve[$e];De&&i5(De,ge)&&(me[$e]=De,Ae+=1)}return{nodes:me,metrics:{reusedNodeCount:Ae,dirtyStartIndex:te,stablePrefixNodeCount:te,dirtyTailNodeCount:cC(te,ve,j)}}})(Ce,a);z=fe.nodes,ae=fe.metrics}ie=P?Ti()-ye:0,q=ae?.dirtyStartIndex==null||ae.dirtyStartIndex<0?z.length:ae.dirtyStartIndex}else z=Ce;le?(function(ye,fe,ve=0){for(let j=Math.max(0,ve);j<ye.length;j++)Ek(fe,"primeSignatureMs",()=>Rl(ye[j]))})(z,le,q):(function(ye,fe=0){for(let ve=Math.max(0,fe);ve<ye.length;ve++)Rl(ye[ve])})(z,q);const ee=P?Ti()-Ie:0;if(f+=1,d=H,c=V,u=X,a=z,P){const ye=sC(K),fe=typeof ye?.total=="number"&&ye.total>((E=ne?.total)!=null?E:0);t.logPerf(fe?"parse(stream)":"parse(sync)",lt(lt(lt({rendererId:t.instanceMsgId,ms:Math.round(Ti()-Z),nodes:z.length,contentLength:H.length,parseCommitCount:f,parseCoalescedCount:h,nodeReuseMs:ee,signatureMs:(F=le?.signatureMs)!=null?F:0,stabilizeSignatureMs:(S=le?.stabilizeSignatureMs)!=null?S:0,primeSignatureMs:(N=le?.primeSignatureMs)!=null?N:0,signatureCallCount:(D=le?.signatureCallCount)!=null?D:0,stabilizeSignatureCallCount:(B=le?.stabilizeSignatureCallCount)!=null?B:0,primeSignatureCallCount:(U=le?.primeSignatureCallCount)!=null?U:0,stabilizeMs:ie},ae??{}),ue?Object.fromEntries(hee.map(ve=>{var j;return[ve,(j=ue[ve])!=null?j:0]})):{}),ye?{streamMode:ye.lastMode,streamDelta:xee(ye,ne),streamStats:ye}:{}))}return pt(z)});return{effectiveCustomHtmlTags:v,effectiveCustomHtmlTagsSet:A,mdBase:m,mdInstance:y,mergedParseOptions:k,parsedNodes:x}}function _ee(e){const{isClient:t}=e,n=J(new Set),o=new Map,s=new Map,i=new Map;function r(c){if(!t)return;const u=i.get(c);u!=null&&(window.clearTimeout(u),i.delete(c))}function l(){if(t)for(const c of i.values())window.clearTimeout(c);i.clear()}function a(){n.value=new Set}return{visibleNodeIndices:n,nodeVisibilityHandles:o,nodeVisibilityWatchStops:s,nodeVisibilityFallbackTimers:i,clearVisibilityFallback:r,clearAllVisibilityFallbacks:l,markNodeVisible:function(c,u=!0){var d;u&&r(c),(function(f,h){if((g=(p=e.shouldTrackVisibleNodeIndices)==null?void 0:p.call(e))!=null&&!g)return;var p,g;const b=n.value,v=b.has(f);if(h){if(v)return;const y=new Set(b);return y.add(f),void(n.value=y)}if(!v)return;const m=new Set(b);m.delete(f),n.value=m})(c,u),u&&((d=e.onNodeMarkedVisible)==null||d.call(e,c))},resetNodeVisibleState:a,cleanupNodeVisibility:function(c){var u;if(e.shouldCleanupNodeVisibility&&!e.shouldCleanupNodeVisibility())return;for(const[f,h]of s.entries())f<c||(h(),s.delete(f));for(const[f,h]of o.entries())f<c||(h.destroy(),o.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 s.values())c();s.clear();for(const c of o.values())c.destroy();o.clear(),l()}}}function See(e={}){const t=J(""),n=J(""),o=J(!1),s=CQ(e),i=()=>{const u=s.getSnapshot();t.value=u.source,n.value=u.visible,o.value=u.done},r=s.subscribe(i);i();const l=R(()=>Math.max(0,t.value.length-n.value.length)),a=R(()=>l.value===0),c=R(()=>o.value&&a.value);return uy()&&dy(()=>{r(),s.destroy()}),{source:t,visible:n,done:o,final:c,caughtUp:a,pendingChars:l,enqueue:u=>s.enqueue(u),finish:u=>s.finish(u),flush:()=>s.flush(),reset:u=>s.reset(u),pause:()=>s.pause(),resume:()=>s.resume()}}const uC=/auto|scroll|overlay/i;function Cee(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return uC.test(t)||uC.test(n)}function Aee(e){const t=Math.ceil(e.scrollHeight)>Math.ceil(e.clientHeight)+1,n=Math.ceil(e.scrollWidth)>Math.ceil(e.clientWidth)+1;return t||n}const Mee=Ze({name:"InfographicBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=R(()=>{var n,o;return Sv((o=Ec(e.estimatedPreviewHeightPx))!=null?o:wv(String((n=e.node.code)!=null?n:"")))});return()=>mn("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?mn("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)"}},[mn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[mn("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),mn("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),mn("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},()=>mn("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,mn("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[mn("div",{class:"absolute inset-0"},[mn("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}),Eee=Ze({name:"MermaidBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=R(()=>{var n,o;return _v((o=Ec(e.estimatedPreviewHeightPx))!=null?o:xv(String((n=e.node.code)!=null?n:"")))});return()=>mn("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?mn("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)"}},[mn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[mn("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),mn("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},()=>mn("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[mn("span",{class:"action-icon block"})])))]):null,mn("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)"}},[mn("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"}})])])}}),Tee=["data-custom-id"],Nee={class:"m-0 p-0"},Iee=["data-probe"],Lee=["data-node-index","data-node-type"],l5=gn(Ze(Pt(lt({},{name:"NodeRenderer"}),{__name:"NodeRenderer",props:{content:{},nodes:{},final:{type:Boolean},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},mode:{},htmlPolicy:{},viewportPriority:{type:Boolean},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:{},codeBlockLightTheme:{},codeBlockMonacoOptions:{},codeRenderer:{},renderCodeBlocksAsPre:{type:Boolean,default:void 0},codeBlockMinWidth:{},codeBlockMaxWidth:{},codeBlockProps:{},mermaidProps:{},d2Props:{},infographicProps:{},showTooltips:{type:Boolean,default:void 0},themes:{},langs:{},isDark:{type:Boolean},customId:{},indexKey:{},typewriter:{type:Boolean,default:!1},smoothStreaming:{type:[Boolean,String],default:"auto"},smoothStreamingOptions:{},parseCoalesceMs:{},fade:{type:Boolean,default:void 0},batchRendering:{type:Boolean,default:void 0},initialRenderBatchSize:{},renderBatchSize:{},renderBatchDelay:{},renderBatchBudgetMs:{},renderBatchIdleTimeoutMs:{},deferNodesUntilVisible:{type:Boolean,default:void 0},maxLiveNodes:{},liveNodeBuffer:{},nodeVirtual:{type:[Boolean,String],default:void 0},virtualScroll:{},renderAsFragment:{type:Boolean}},emits:["copy","handleArtifactClick","click","mouseover","mouseout","virtual-state-change","height-change","render-settled","render-final","anchor-change"],setup(e,{expose:t,emit:n}){const o=e,s=n,i=Yo(),r=Kt("markstreamNestedRendererProps",void 0);function l(M){var W,G;const Y=o[M];return(function(se){const Se=i?.vnode.props;return!!Se&&(Object.prototype.hasOwnProperty.call(Se,se)||Object.prototype.hasOwnProperty.call(Se,String(se).replace(/[A-Z]/g,Me=>`-${Me.toLowerCase()}`)))})(M)?Y:(G=(W=r?.value)==null?void 0:W[M])!=null?G:Y}const a={docs:{showTooltips:!0,fade:!0,batchRendering:!0,initialRenderBatchSize:40,renderBatchSize:80,renderBatchDelay:16,renderBatchBudgetMs:6,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:220,liveNodeBuffer:60,nodeVirtual:"auto"},chat:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:16,renderBatchSize:16,renderBatchDelay:8,renderBatchBudgetMs:4,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"},minimal:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:16,renderBatchSize:16,renderBatchDelay:8,renderBatchBudgetMs:4,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"}},c=R(()=>{return(M=l("mode"))==="chat"||M==="minimal"||M==="docs"?M:"docs";var M}),u=R(()=>{const M=l("renderCodeBlocksAsPre"),W=l("codeRenderer");return M===!0?"pre":W==="pre"||W==="shiki"||W==="monaco"?W:M===!1||c.value==="docs"?"monaco":"pre"}),d=R(()=>a[c.value]),f=R(()=>{var M;return(M=l("showTooltips"))!=null?M:d.value.showTooltips}),h=R(()=>{var M;return(M=l("fade"))!=null?M:d.value.fade}),p=R(()=>{var M;return(M=l("batchRendering"))!=null?M:d.value.batchRendering}),g=R(()=>{var M;return(M=l("initialRenderBatchSize"))!=null?M:d.value.initialRenderBatchSize}),b=R(()=>{var M;return(M=l("renderBatchSize"))!=null?M:d.value.renderBatchSize}),v=R(()=>{var M;return(M=l("renderBatchDelay"))!=null?M:d.value.renderBatchDelay}),m=R(()=>{var M;return(M=l("renderBatchBudgetMs"))!=null?M:d.value.renderBatchBudgetMs}),y=R(()=>{var M;return(M=l("renderBatchIdleTimeoutMs"))!=null?M:d.value.renderBatchIdleTimeoutMs}),k=R(()=>{var M;return(M=l("deferNodesUntilVisible"))!=null?M:d.value.deferNodesUntilVisible}),A=R(()=>{var M;return(M=l("maxLiveNodes"))!=null?M:d.value.maxLiveNodes}),$=R(()=>{var M;return(M=l("liveNodeBuffer"))!=null?M:d.value.liveNodeBuffer}),I=R(()=>{var M;return(M=l("nodeVirtual"))!=null?M:d.value.nodeVirtual}),x={get content(){return o.content},get nodes(){return o.nodes},get final(){return o.final},get parseOptions(){return l("parseOptions")},get customMarkdownIt(){return l("customMarkdownIt")},get debugPerformance(){return o.debugPerformance},get customHtmlTags(){return l("customHtmlTags")},get mode(){return l("mode")},get htmlPolicy(){return l("htmlPolicy")},get viewportPriority(){return l("viewportPriority")},get codeBlockStream(){return l("codeBlockStream")},get codeBlockDarkTheme(){return l("codeBlockDarkTheme")},get codeBlockLightTheme(){return l("codeBlockLightTheme")},get codeBlockMonacoOptions(){return l("codeBlockMonacoOptions")},get codeRenderer(){return l("codeRenderer")},get renderCodeBlocksAsPre(){return l("renderCodeBlocksAsPre")},get codeBlockMinWidth(){return l("codeBlockMinWidth")},get codeBlockMaxWidth(){return l("codeBlockMaxWidth")},get codeBlockProps(){return l("codeBlockProps")},get mermaidProps(){return l("mermaidProps")},get d2Props(){return l("d2Props")},get infographicProps(){return l("infographicProps")},get showTooltips(){return 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 o.indexKey},get typewriter(){return l("typewriter")},get smoothStreaming(){return o.smoothStreaming},get smoothStreamingOptions(){return l("smoothStreamingOptions")},get parseCoalesceMs(){return l("parseCoalesceMs")},get fade(){return h.value},get batchRendering(){return p.value},get initialRenderBatchSize(){return g.value},get renderBatchSize(){return b.value},get renderBatchDelay(){return v.value},get renderBatchBudgetMs(){return m.value},get renderBatchIdleTimeoutMs(){return y.value},get deferNodesUntilVisible(){return k.value},get maxLiveNodes(){return A.value},get liveNodeBuffer(){return $.value},get nodeVirtual(){return I.value},get virtualScroll(){return o.virtualScroll},get renderAsFragment(){return o.renderAsFragment}};function L(M){s("height-change",M)}function E(M){s("virtual-state-change",M)}function F(M){s("anchor-change",M)}const S=J(),N=J(null),D=J(null),B=J(null),U=Bo({1:null,2:null,3:null,4:null,5:null,6:null}),H=J(!1),P=new Map,Z=J(0),K=J(0),V=J({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function X(){var M,W;if(((M=o.virtualScroll)==null?void 0:M.enabled)!==!0)return null;const G=(W=o.virtualScroll)==null?void 0:W.scrollRoot;return he(typeof G=="function"?G():G)}function he(M){return M?typeof HTMLElement<"u"&&M instanceof HTMLElement?M:typeof M=="object"&&"value"in M?he(M.value):typeof M=="object"&&"$el"in M?he(M.$el):null:null}const{isClient:ne,renderAsFragment:ue,debugPerformanceEnabled:de,resolvedShowTooltips:Ce,resolvedHtmlPolicy:Ie,inheritedSmoothStreaming:le,ownsTypewriterCursor:z}=(function(M){const W=typeof window<"u",G=Vd(),Y=Kt("markstreamHtmlPolicy",void 0),se=Kt("markstreamTypewriterCursor",void 0),Se=Kt("markstreamSmoothStreaming",void 0),Me=R(()=>M.renderAsFragment===!0),Le=R(()=>!!(M.debugPerformance&&W&&typeof console<"u")),qe=R(()=>{var je;if(typeof M.showTooltips=="boolean")return M.showTooltips;const Be=(je=G.showTooltips)!=null?je:G["show-tooltips"];return Be===""||Be===!0||Be==="true"||Be!==!1&&Be!=="false"&&void 0}),Re=R(()=>{var je,Be;return(Be=(je=M.htmlPolicy)!=null?je:Y?.value)!=null?Be:"safe"}),Ge=R(()=>se?.value!==!0);return{isClient:W,renderAsFragment:Me,debugPerformanceEnabled:Le,resolvedShowTooltips:qe,resolvedHtmlPolicy:Re,inheritedSmoothStreaming:Se,inheritedTypewriterCursor:se,ownsTypewriterCursor:Ge}})(x),{resolveViewportRoot:ae,resolveScrollContainer:ie,isReverseFlexScrollRoot:q,getNormalizedScrollTop:ee,getOffsetTopWithinRoot:ye}=(function(M,W){function G(){var Le,qe;return(qe=(Le=W.scrollRoot)==null?void 0:Le.call(W))!=null?qe:null}function Y(Le){if(typeof window>"u")return null;const qe=G();if(qe)return qe;const Re=Le??M.value;if(!Re)return null;const Ge=Re.ownerDocument||document,je=Ge.scrollingElement||Ge.documentElement;let Be=Re;for(;Be&&Be!==Ge.body&&Be!==je;){if(Cee(window.getComputedStyle(Be))&&Aee(Be))return Be;Be=Be.parentElement}return null}function se(Le){if(!W.isClient)return!1;try{const qe=window.getComputedStyle(Le);return!!(qe.display||"").toLowerCase().includes("flex")&&(qe.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function Se(Le,qe,Re){var Ge,je;if(Re)return Me(qe);const Be=Le.scrollTop;if(!se(Le))return Be;const Ke=Be<0?-Be:Be;return Math.max(0,((Ge=Le.scrollHeight)!=null?Ge:0)-((je=Le.clientHeight)!=null?je:0))-Ke}function Me(Le){var qe,Re,Ge,je,Be;const Ke=Number((qe=Le.scrollingElement)==null?void 0:qe.scrollTop),tt=Number((Ge=(Re=Le.documentElement)==null?void 0:Re.scrollTop)!=null?Ge:0),nt=Number((Be=(je=Le.body)==null?void 0:je.scrollTop)!=null?Be:0);return Math.max(0,Number.isFinite(Ke)?Ke:0,Number.isFinite(tt)?tt:0,Number.isFinite(nt)?nt:0)}return{resolveViewportRoot:Y,resolveScrollContainer:function(Le){var qe,Re,Ge,je;const Be=G();if(Be)return Be;const Ke=Y((qe=Le??M.value)!=null?qe:null);if(Ke)return Ke;const tt=(je=(Ge=Le?.ownerDocument)!=null?Ge:(Re=M.value)==null?void 0:Re.ownerDocument)!=null?je:typeof document<"u"?document:null;return tt?.scrollingElement||tt?.documentElement||null},isReverseFlexScrollRoot:se,getNormalizedScrollTop:Se,getOffsetTopWithinRoot:function(Le,qe){const Re=qe.ownerDocument||Le.ownerDocument||document;if((function(Ke,tt){return Ke===tt.documentElement||Ke===tt.body||Ke===tt.scrollingElement})(qe,Re))return Le.getBoundingClientRect().top+Me(Re);const Ge=qe.getBoundingClientRect(),je=Le.getBoundingClientRect(),Be=Se(qe,Re,!1);return je.top-Ge.top+Be}}})(S,{isClient:ne,scrollRoot:X});Ln("markstreamShowTooltips",Ce),Ln("markstreamHtmlPolicy",Ie),Ln("markstreamTypewriter",R(()=>x.typewriter!==!1)),Ln("markstreamFade",R(()=>x.fade!==!1)),Ln("markstreamTypewriterCursor",R(()=>!0)),Ln("markstreamTextStreamState",P),Ln("markstreamStreamVersion",Z),Ln("markstreamParseOptions",R(()=>x.parseOptions)),Ln("markstreamCustomMarkdownIt",R(()=>x.customMarkdownIt));const{smoothStreamingEnabled:fe,renderContent:ve,effectiveFinal:j}=(function(M,W){const G=See(M.smoothStreamingOptions),Y=R(()=>{var Re,Ge,je;return M.smoothStreaming!==!1&&!((Re=M.nodes)!=null&&Re.length)&&(M.smoothStreaming===!0||!((Ge=W.inheritedSmoothStreaming)!=null&&Ge.value))&&(M.smoothStreaming===!0||M.typewriter===!0||((je=M.maxLiveNodes)!=null?je:0)<=0)}),se=J(!W.isClient||M.smoothStreaming===!0);cn(()=>{se.value=!0});const Se=R(()=>se.value&&Y.value),Me=R(()=>{var Re;return Se.value?G.visible.value:(Re=M.content)!=null?Re:""}),Le=R(()=>{var Re,Ge;const je=(Re=M.parseOptions)!=null?Re:{};return(Ge=M.final)!=null?Ge:je.final}),qe=R(()=>{const Re=Le.value;return Se.value&&Re!=null?!!Re&&G.caughtUp.value:Re});return Qe([()=>M.content,()=>M.nodes,Se,Le],([Re,Ge,je,Be])=>{if(Ge?.length)return void G.reset("");const Ke=Re??"";if(!je)return G.reset(Ke),void(Be&&G.finish({flush:!0}));const tt=G.source.value;Ke?Ke===tt||(Ke.startsWith(tt)?G.enqueue(Ke.slice(tt.length)):G.reset(Ke)):G.reset(""),Be&&G.finish()},{immediate:!0}),{smoothStream:G,smoothStreamingEligible:Y,smoothStreamingEnabled:Se,renderContent:Me,requestedFinal:Le,effectiveFinal:qe}})(x,{isClient:ne,inheritedSmoothStreaming:le});Ln("markstreamSmoothStreaming",fe);const te=J(!1);let me="",Ae=!1,$e=null;function De(){ne&&$e!=null&&(window.clearTimeout($e),$e=null)}function ge(){te.value=!1,De()}function Ne(M,W){if(!de.value)return;const G=(function(){if(!de.value)return null;const Y=It(et),se=It(rt),Se=Math.max(gt,se);if(Y<=0&&Se<=0)return null;const Me={total:Y,maxPerFrame:Se,byLabel:(Le=et,Object.fromEntries(Array.from(Le.entries()).sort((qe,Re)=>Re[1]-qe[1]||qe[0].localeCompare(Re[0]))))};var Le;return et.clear(),rt.clear(),gt=0,Me})();console.info(`[markstream-vue][perf] ${M}`,G?Pt(lt({},W),{layoutReads:G}):W)}Qe([ve,()=>o.nodes,j],([M,W,G])=>{const Y=M??"";return W?.length||G===!0?(ge(),me=Y,void(Ae=!0)):Ae?(me&&Y.length>me.length&&Y.startsWith(me)?(te.value=!0,ne&&(De(),$e=window.setTimeout(()=>{var se;$e=null,j.value===!0||(se=o.nodes)!=null&&se.length||(Qa(),te.value=!1,dr())},1200))):(Y.length<me.length||!Y.startsWith(me))&&ge(),void(me=Y)):(me=Y,void(Ae=!0))},{flush:"sync",immediate:!0});const et=new Map,rt=new Map;let _t=!1,gt=0;function It(M){let W=0;for(const G of M.values())W+=G;return W}function Ut(){gt=Math.max(gt,It(rt)),rt.clear(),_t=!1}function ht(M,W){return(function(G){var Y,se;de.value&&(et.set(G,((Y=et.get(G))!=null?Y:0)+1),rt.set(G,((se=rt.get(G))!=null?se:0)+1),_t||(_t=!0,ne&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(Ut):typeof queueMicrotask!="function"?setTimeout(Ut,0):queueMicrotask(Ut)))})(M),W()}const un=x.customId?`renderer-${x.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,dn=(function(M){const W=new Map;return{scope:M,cache:W,clear:()=>W.clear()}})(un),ns=R(()=>`${un}:${Z.value}`);Ln(e5,dn);const Wt=Co(()=>x.customId),{effectiveCustomHtmlTagsSet:Hn,mergedParseOptions:lo,parsedNodes:it}=wee(x,{instanceMsgId:un,renderContent:ve,effectiveFinal:j,smoothStreamingEnabled:fe,debugPerformanceEnabled:de,customComponentsMap:Wt,logPerf:Ne});Qe(it,()=>{dn.clear(),Z.value+=1},{immediate:!0});const Gn=R(()=>({customId:x.customId,customHtmlTags:lo.value.customHtmlTags,parseOptions:x.parseOptions,customMarkdownIt:x.customMarkdownIt,htmlPolicy:Ie.value,viewportPriority:x.viewportPriority,mode:c.value,codeRenderer:u.value,codeBlockStream:x.codeBlockStream,codeBlockDarkTheme:x.codeBlockDarkTheme,codeBlockLightTheme:x.codeBlockLightTheme,codeBlockMonacoOptions:x.codeBlockMonacoOptions,renderCodeBlocksAsPre:x.renderCodeBlocksAsPre,codeBlockMinWidth:x.codeBlockMinWidth,codeBlockMaxWidth:x.codeBlockMaxWidth,codeBlockProps:x.codeBlockProps,mermaidProps:x.mermaidProps,d2Props:x.d2Props,infographicProps:x.infographicProps,showTooltips:Ce.value,themes:x.themes,langs:x.langs,isDark:x.isDark,typewriter:x.typewriter,smoothStreamingOptions:x.smoothStreamingOptions,parseCoalesceMs:x.parseCoalesceMs,fade:x.fade}));Ln("markstreamNestedRendererProps",Gn);const ao=R(()=>it.value),Yn=R(()=>it.value.length),go=J(null),os=J(null),qn=J(null),to=J(null),vn=o.indexKey!=null&&String(o.indexKey).startsWith("list-item-"),Zn=!vn&&x.customId?XS(x.customId):null,xn=R(()=>Zn?(QS.value,XS(x.customId)):null),An=R(()=>{var M;return!!(ne&&!ue.value&&x.customId&&!vn&&((M=xn.value)!=null&&M.enabled))}),Mn=R(()=>{var M;return!!(!ue.value&&((M=o.virtualScroll)!=null&&M.enabled))}),Do=J(!1);cn(()=>{Do.value=!0});const ze=R(()=>!!(ne&&Mn.value));Ln("markstreamHostScrollManaged",ze);const Xe=R(()=>!!(Do.value&&ze.value)),kt=R(()=>An.value||ze.value),Ht=R(()=>An.value||Xe.value),Rn=R(()=>{var M;return kt.value&&((M=xn.value)==null?void 0:M.textEstimation)!==!1}),sn=R(()=>{var M;return kt.value&&((M=xn.value)==null?void 0:M.codeBlockEstimation)!==!1});function Gt(){const M=K.value||ht("getMeasuredContainerWidth.clientWidth",()=>{var W;return((W=S.value)==null?void 0:W.clientWidth)||0});return Number.isFinite(M)&&M>0?M:0}const Wn=R(()=>{const M=Gt();return M>0?Math.max(1,Math.round(M)):640}),En=R(()=>{var M;return Math.max(1,(M=x.maxLiveNodes)!=null?M:320)}),St=R(()=>{var M;return!ue.value&&x.nodeVirtual!==!1&&!(((M=x.maxLiveNodes)!=null?M:0)<=0)&&(x.nodeVirtual===!0?it.value.length>0:it.value.length>En.value)}),Po=R(()=>St.value||An.value||ze.value),Ao=R(()=>x.viewportPriority!==!1&&!H.value),ss=uJ(M=>{var W;return ae((W=M??S.value)!=null?W:null)},Ao),{requestFrame:Tn,cancelFrame:jn,hasIdleCallback:Ps,isTestEnv:ti}=(function(M){const W=M.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,G=M.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,Y=M.isClient&&typeof window.requestIdleCallback=="function",se=(function(){var Se;if(typeof globalThis>"u"||!("process"in globalThis))return;const Me=(Se=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:Se.value;return Me?.env})();return{requestFrame:W,cancelFrame:G,hasIdleCallback:Y,isTestEnv:se?.NODE_ENV==="test"}})({isClient:ne}),{resolvedBatchSize:Io,resolvedInitialBatch:Ss,batchingEnabled:Wi,incrementalRenderingActive:Si,renderedCount:co,previousRenderContext:ni,adaptiveBatchSize:Ci,previousBatchConfig:ar}=(function(M,W){var G;const Y=R(()=>{var je;const Be=Math.trunc((je=M.renderBatchSize)!=null?je:80);return Number.isFinite(Be)?Math.max(0,Be):0}),se=R(()=>{var je;const Be=Math.trunc((je=M.initialRenderBatchSize)!=null?je:Y.value);return Number.isFinite(Be)?Math.max(0,Be):Y.value}),Se=R(()=>!W.renderAsFragment.value&&M.batchRendering!==!1&&Y.value>0&&W.isClient&&!W.isTestEnv),Me=J(0),Le=J({key:M.indexKey,total:0}),qe=J(Math.max(1,Y.value||1)),Re=R(()=>{var je;return Se.value&&((je=M.maxLiveNodes)!=null?je:0)<=0}),Ge=J({batchSize:Y.value,initial:se.value,delay:(G=M.renderBatchDelay)!=null?G:16,enabled:Re.value});return{resolvedBatchSize:Y,resolvedInitialBatch:se,batchingEnabled:Se,incrementalRenderingActive:Re,renderedCount:Me,previousRenderContext:Le,adaptiveBatchSize:qe,previousBatchConfig:Ge}})(x,{isClient:ne,isTestEnv:ti,renderAsFragment:ue}),no=new Map,is=new Map,rs=new WeakMap;let Lo=null;const Ai=new WeakMap,zn=new Map,$o=J(0),oi=R(()=>($o.value,Array.from(no.entries()).sort((M,W)=>M[0]-W[0]))),Ue=J(null),Fe=J(null);let oe=null,Te=0,pe=null;const{activeRestoreAnchor:_e,getRelativeScrollTopWithinContainer:He,setRelativeScrollTopWithinContainer:Rt,resolveAnchorOffset:Dt,clearRestoreReconcile:rn,scheduleRestoreReconcile:Un,captureRestoreAnchor:Cs,restoreAnchor:Q,getAnchorDrift:xe}=(function(M){const{isClient:W,containerRef:G,parsedNodeCount:Y,requestFrame:se,cancelFrame:Se,resolveScrollContainer:Me,getNormalizedScrollTop:Le,getOffsetTopWithinRoot:qe,isReverseFlexScrollRoot:Re,estimateIndexForOffset:Ge,estimateHeightRange:je,getFallbackNodeHeight:Be,clamp:Ke}=M,tt=J(null);let nt=null,wt=[];function at(){const Lt=Me(),qt=G.value;if(!Lt||!qt)return null;const zt=Lt.ownerDocument||qt.ownerDocument||document;if(Lt===zt.documentElement||Lt===zt.body||Lt===zt.scrollingElement){const fn=qt.getBoundingClientRect();return Math.max(0,-fn.top)}return Math.max(0,Le(Lt,zt,!1)-qe(qt,Lt))}function ft(Lt){var qt;const zt=Me(),fn=G.value;if(!zt||!fn)return;const Us=Math.max(0,Lt),as=zt.ownerDocument||fn.ownerDocument||document,Mi=as.defaultView||(typeof window<"u"?window:null);if(zt===as.documentElement||zt===as.body||zt===as.scrollingElement){const Qr=Le(zt,as,!0)+fn.getBoundingClientRect().top;return void((qt=Mi?.scrollTo)==null||qt.call(Mi,0,Math.max(0,Qr+Us)))}tC(zt,as,qe(fn,zt)+Us,{isReverseFlexScrollRoot:Qr=>{var Xr;return(Xr=Re?.(Qr))!=null&&Xr},getNormalizedScrollTop:Le})}function Et(Lt){const qt=Y.value,zt=Ke(Lt.nodeIndex,0,Math.max(0,qt-1));return je(0,zt)+Math.max(0,Lt.offsetWithinNodePx)}function At(){if(nt!=null&&(Se?.(nt),nt=null),W)for(const Lt of wt)window.clearTimeout(Lt);wt=[]}function tn(Lt){const qt=Et(Lt),zt=at();zt!=null&&Math.abs(zt-qt)<=.5||ft(qt)}return{activeRestoreAnchor:tt,getRelativeScrollTopWithinContainer:at,setRelativeScrollTopWithinContainer:ft,resolveAnchorOffset:Et,clearRestoreReconcile:At,applyRestoreAnchor:tn,scheduleRestoreReconcile:function(){tt.value&&W&&nt==null&&(nt=se?se(()=>{nt=null,tt.value&&tn(tt.value)}):null,nt==null&&tt.value&&tn(tt.value))},captureRestoreAnchor:function(){const Lt=at(),qt=Y.value;if(Lt==null||qt<=0)return null;const zt=Ke(Ge(Lt+1),0,qt-1),fn=je(0,zt),Us=Be(zt);return{nodeIndex:zt,offsetWithinNodePx:Ke(Lt-fn,0,Math.max(0,Us-1))}},restoreAnchor:function(Lt){const qt=Y.value;if(tt.value={nodeIndex:Ke(Lt.nodeIndex,0,Math.max(0,qt-1)),offsetWithinNodePx:Math.max(0,Lt.offsetWithinNodePx)},At(),tn(tt.value),W)for(const zt of[0,120,280,480])wt.push(window.setTimeout(()=>{tt.value&&tn(tt.value)},zt))},getAnchorDrift:function(Lt){const qt=at();return qt==null?null:qt-Et(Lt)}}})({isClient:ne,containerRef:S,parsedNodeCount:Yn,requestFrame:Tn,cancelFrame:jn,resolveScrollContainer:()=>Ue.value||ie(),getNormalizedScrollTop:ee,getOffsetTopWithinRoot:ye,isReverseFlexScrollRoot:q,estimateIndexForOffset:R1,estimateHeightRange:Zr,getFallbackNodeHeight:pf,clamp:Wo}),{nodeHeights:be,heightStats:Oe,heightTreeSize:Ye,heightSumTree:st,heightKnownTree:Ct,averageNodeHeight:Ot,resetHeightMeasurements:uo,pruneHeightMeasurements:jt,rebuildHeightTrees:wn,recordNodeHeight:ls,removeNodeHeights:Mt,exportHeightCache:Nt,importHeightCache:Vt,fenwickRangeSum:fo}=(function(M={}){const W=Bo({}),G=Bo({total:0,count:0}),Y=J(0),se=J([]),Se=J([]);function Me(){for(const Be of Object.keys(W))delete W[Number(Be)];G.total=0,G.count=0,Y.value=0,se.value=[],Se.value=[]}function Le(Be,Ke,tt){for(let nt=Ke+1;nt<Be.length;nt+=nt&-nt)Be[nt]+=tt}function qe(Be,Ke){let tt=0;for(let nt=Ke+1;nt>0;nt-=nt&-nt)tt+=Be[nt];return tt}function Re(Be){Y.value=Be;const Ke=new Array(Be+1).fill(0),tt=new Array(Be+1).fill(0);for(const[nt,wt]of Object.entries(W)){const at=Number(nt),ft=Number(wt);!Number.isFinite(at)||at<0||at>=Be||!Number.isFinite(ft)||ft<=0||(Le(Ke,at,ft),Le(tt,at,1))}se.value=Ke,Se.value=tt}function Ge(Be){if(!Number.isInteger(Be)||Be<0)return!1;const Ke=W[Be];if(!Number.isFinite(Ke)||Ke<=0)return!1;if(delete W[Be],G.total=Math.max(0,G.total-Ke),G.count=Math.max(0,G.count-1),Y.value>Be){const tt=se.value,nt=Se.value;tt.length&&nt.length&&(Le(tt,Be,-Ke),Le(nt,Be,-1))}return!0}const je=R(()=>G.count>0?Math.max(12,G.total/G.count):32);return{nodeHeights:W,heightStats:G,heightTreeSize:Y,heightSumTree:se,heightKnownTree:Se,averageNodeHeight:je,resetHeightMeasurements:Me,pruneHeightMeasurements:function(Be){if(Be<=0)return void Me();let Ke=0,tt=0;for(const[nt,wt]of Object.entries(W)){const at=Number(nt),ft=Number(wt);!Number.isFinite(at)||at<0||at>=Be||!Number.isFinite(ft)||ft<=0?delete W[at]:(Ke+=ft,tt++)}G.total=Ke,G.count=tt},rebuildHeightTrees:Re,recordNodeHeight:function(Be,Ke,tt={}){(function(nt,wt,at={}){var ft;if(!Number.isFinite(wt)||wt<=0)return!1;const Et=W[nt];if(Et&&(at.allowShrink===!1&&wt<Et||Math.abs(wt-Et)<=1))return!1;if(W[nt]=wt,Et?G.total+=wt-Et:(G.total+=wt,G.count++),Y.value>nt){const At=se.value,tn=Se.value;if(At.length&&tn.length)if(Et){const Lt=wt-Et;Lt!==0&&Le(At,nt,Lt)}else Le(At,nt,wt),Le(tn,nt,1)}at.notify!==!1&&((ft=M.onHeightRecorded)==null||ft.call(M))})(Be,Ke,Pt(lt({},tt),{notify:!0}))},removeNodeHeight:function(Be,Ke={}){var tt;const nt=Ge(Be);return nt&&Ke.notify!==!1&&((tt=M.onHeightRecorded)==null||tt.call(M)),nt},removeNodeHeights:function(Be,Ke={}){var tt;let nt=0;for(const wt of Be)Ge(Number(wt))&&nt++;return nt>0&&Ke.notify!==!1&&((tt=M.onHeightRecorded)==null||tt.call(M)),nt},exportHeightCache:function(){return Object.entries(W).map(([Be,Ke])=>({index:Number(Be),height:Number(Ke)})).filter(Be=>Number.isFinite(Be.index)&&Be.index>=0&&Number.isFinite(Be.height)&&Be.height>0).sort((Be,Ke)=>Be.index-Ke.index)},importHeightCache:function(Be,Ke={}){var tt;if(!Array.isArray(Be))return;const nt=Y.value;let wt=!1;if(Ke.mode!=="merge"){const at=Object.keys(W);if(at.length>0){for(const ft of at)delete W[Number(ft)];wt=!0}}for(const at of Be){const ft=Number(at.index),Et=Number(at.height);if(!Number.isInteger(ft)||ft<0||nt>0&&ft>=nt||!Number.isFinite(Et)||Et<=0)continue;const At=W[ft];At&&Math.abs(At-Et)<=1||(W[ft]=Et,wt=!0)}wt&&((function(){let at=0,ft=0;const Et=Y.value;for(const[At,tn]of Object.entries(W)){const Lt=Number(At),qt=Number(tn);!Number.isFinite(Lt)||Lt<0||Et>0&&Lt>=Et||!Number.isFinite(qt)||qt<=0?delete W[Lt]:(at+=qt,ft++)}G.total=at,G.count=ft})(),nt>0&&Re(nt),(tt=M.onHeightRecorded)==null||tt.call(M))},fenwickRangeSum:function(Be,Ke,tt){if(tt<=Ke)return 0;const nt=qe(Be,tt-1);return Ke<=0?nt:nt-qe(Be,Ke-1)}}})({onHeightRecorded:()=>{ii(),ze.value&&Cu(),_e.value&&Un(),Fe.value&&Ga(),Bn("node-resize")}});function oo(){uo(),zn.clear()}function zi(M){!Number.isInteger(M)||M<0||M>=it.value.length||zn.set(M,pu(M))}function Ul(M,W,G={}){const Y=be[M];ls(M,W,G);const se=be[M];se&&se>0?zi(M):Y&&zn.delete(M)}function ql(M,W){const G=ht("getNodeLayoutHeight.slot.offsetHeight",()=>{var Y,se;return(se=(Y=no.get(M))==null?void 0:Y.offsetHeight)!=null?se:0});return G>0?G:ht("getNodeLayoutHeight.content.offsetHeight",()=>W.offsetHeight)}function lf(M,W={}){Vt(M,W),M1()}const Vr=R(()=>{var M;return!ue.value&&x.deferNodesUntilVisible!==!1&&!(((M=x.maxLiveNodes)!=null?M:0)<=0)&&!St.value&&!(it.value.length>900)&&Ao.value}),g2=R(()=>!!ss&&(Vr.value||St.value)),v2=R(()=>St.value||ze.value),{liveNodeBufferResolved:uu,focusIndex:si,liveRange:Ho,updateLiveRange:jl}=(function(M,W){const{parsedNodeCount:G,virtualizationEnabled:Y,maxLiveNodesResolved:se,clamp:Se}=W,Me=R(()=>{var Re;return Math.max(0,(Re=M.liveNodeBuffer)!=null?Re:60)}),Le=J(0),qe=Bo({start:0,end:0});return{liveNodeBufferResolved:Me,focusIndex:Le,liveRange:qe,updateLiveRange:function(){const Re=G.value;if(!Y.value||Re===0)return qe.start=0,void(qe.end=Re);const Ge=Math.min(se.value,Re),je=Me.value,Be=Se(Le.value-je,0,Math.max(0,Re-Ge));qe.start=Be,qe.end=Math.min(Re,Be+Ge)}}})(x,{parsedNodeCount:Yn,virtualizationEnabled:St,maxLiveNodesResolved:En,clamp:Wo}),Ui=new Map,Vl=new Map,Kr=new Map,af=[],cr=new Map,Gr=new Set,y2=J(0);let e1=!1;const k2=R(()=>(y2.value,Gr.size)),Hs=new Map,qi=new Map,b2=J(0),t1=R(()=>{b2.value;let M=0;for(const W of Hs.values())M+=Math.max(0,W);return M});let Ws=null,n1=!0,x2=[0],w2="";function ii(){n1=!0}const cf=R(()=>{if(!St.value)return it.value.length;const M=uu.value,W=Math.max(Ho.end+M,Ss.value),G=Math.min(it.value.length,W);return Math.max(co.value,G)});function uf(){e1||(e1=!0,queueMicrotask(()=>{e1=!1,y2.value+=1}))}function _2(M,W,G="node-resize"){if(!ne||typeof window>"u")return null;const Y=window.setTimeout(()=>{Gr.delete(Y)&&uf();try{W()}finally{Bn(G)}},Math.max(0,M));return Gr.add(Y),uf(),Y}function df(M){ne&&M!=null&&(Gr.delete(M)&&uf(),window.clearTimeout(M))}function S2(){if(ne&&typeof window<"u")for(const M of Gr)window.clearTimeout(M);Gr.size&&(Gr.clear(),uf()),af.length=0,Kr.clear()}function F8(M){var W,G;return(G=(W=to.value)==null?void 0:W[M])!=null?G:null}const{cancelScheduledFocusSync:o1,scheduleFocusSync:ji}=(function(M){const{isClient:W,containerRef:G,virtualizationEnabled:Y,requestFrame:se,cancelFrame:Se,syncFocusToScroll:Me}=M;let Le=null;function qe(){var Ge,je,Be;return(Be=(je=(Ge=G.value)==null?void 0:Ge.ownerDocument)==null?void 0:je.defaultView)!=null?Be:typeof window<"u"?window:null}function Re(){if(!Le)return;const Ge=qe();Le.viaTimeout?Ge?Ge.clearTimeout(Le.id):clearTimeout(Le.id):Se?.(Le.id),Le=null}return{cancelScheduledFocusSync:Re,scheduleFocusSync:function(Ge={}){if(!Y.value)return;if(!W)return void Me(!0);if(Ge.immediate)return Re(),void Me(!0);if(Le)return;const je=()=>{Le=null,Me()};if(se)return void(Le={id:se(je),viaTimeout:!1});const Be=qe();Le={id:Be?Be.setTimeout(je,16):setTimeout(je,16),viaTimeout:!0}}}})({isClient:ne,containerRef:S,virtualizationEnabled:St,requestFrame:Tn,cancelFrame:jn,syncFocusToScroll:function(M=!1){var W;if(!St.value)return;const G=Ue.value||ie();if(!G)return;const Y=G.ownerDocument||((W=S.value)==null?void 0:W.ownerDocument)||document,se=Y?.defaultView||(typeof window<"u"?window:null),Se=G===Y?.documentElement||G===Y?.body,Me=it.value.length;if(!Se&&Me>0&&q(G)){const tt=ht("syncFocusToScroll.clientHeight",()=>G.clientHeight||0),nt=ht("syncFocusToScroll.scrollTop",()=>G.scrollTop),wt=nt<0?-nt:nt,at=(function(Et){var At,tn;const Lt=it.value;if(!Lt.length)return 0;if(Et<=0)return Math.max(0,Lt.length-1);if(kt.value){const zt=(At=a1()[Lt.length])!=null?At:0;return L2(Math.max(0,zt-Et))}if(Ye.value===Lt.length){const zt=Zr(0,Lt.length);return R1(Math.max(0,zt-Et))}let qt=Et;for(let zt=Lt.length-1;zt>=0;zt--){const fn=(tn=be[zt])!=null?tn:Ot.value;if(qt<=fn)return zt;qt-=fn}return 0})(Math.max(0,wt)+.5*Math.max(0,tt)),ft=Wo(at,0,Math.max(0,Me-1));return void((M||Math.abs(ft-si.value)>1)&&(si.value=ft,jl()))}const Le=Se?null:ht("syncFocusToScroll.root.getBoundingClientRect",()=>G.getBoundingClientRect()),qe=Se?0:Le.top,Re=Se?ht("syncFocusToScroll.viewport.clientHeight",()=>{var tt,nt;return(nt=(tt=se?.innerHeight)!=null?tt:G.clientHeight)!=null?nt:0}):Le.bottom,Ge=oi.value;let je=null,Be=null;for(const[tt,nt]of Ge){if(!nt)continue;const wt=ht("syncFocusToScroll.slot.getBoundingClientRect",()=>nt.getBoundingClientRect());wt.bottom<=qe||wt.top>=Re||(je==null&&(je=tt),Be=tt)}if(je==null||Be==null){const tt=S.value;if(!tt)return;const nt=Se?{top:0}:ht("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>G.getBoundingClientRect()),wt=ht("syncFocusToScroll.fallback.scrollTop",()=>ee(G,Y,Se)),at=Se?(()=>{const At=ht("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>tt.getBoundingClientRect()),tn=(Se?0:nt.top)-At.top;return Math.max(0,tn)})():(()=>{const At=ye(tt,G);return Math.max(0,wt-At)})(),ft=Se?ht("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var At,tn,Lt,qt;return(qt=(Lt=(tn=se?.innerHeight)!=null?tn:(At=Y?.documentElement)==null?void 0:At.clientHeight)!=null?Lt:G.clientHeight)!=null?qt:0}):ht("syncFocusToScroll.fallback.root.clientHeight",()=>G.clientHeight),Et=R1(at+.5*Math.max(0,ft));return si.value=Wo(Et,0,Math.max(0,it.value.length-1)),void jl()}const Ke=Math.round((je+Be)/2);!M&&Math.abs(Ke-si.value)<=1||(si.value=Wo(Ke,0,Math.max(0,it.value.length-1)),jl())}}),{visibleNodeIndices:s1,nodeVisibilityHandles:Wa,nodeVisibilityWatchStops:ff,nodeVisibilityFallbackTimers:C2,clearVisibilityFallback:hf,markNodeVisible:Yr,cleanupNodeVisibility:O8,destroyNodeVisibilityState:i1}=_ee({isClient:ne,shouldTrackVisibleNodeIndices:()=>Vr.value,shouldCleanupNodeVisibility:()=>St.value,onNodeMarkedVisible:M=>{St.value?ji():si.value=Wo(M,0,Math.max(0,it.value.length-1))},onNodeVisibilityCleaned:M=>{no.delete(M)&&eb()}}),{cleanupScrollListener:A2,setupScrollListener:R8}=(function(M){const{isClient:W,virtualizationEnabled:G,listenerEnabled:Y,scrollRootElement:se,resolveScrollContainer:Se,scheduleFocusSync:Me,onScroll:Le}=M;let qe=null,Re=null;function Ge(){qe&&(qe(),qe=null),Re=null,se.value=null}function je(Be){const Ke=M.getScrollTop?M.getScrollTop(Be):Be.scrollTop;return Math.max(0,Number.isFinite(Ke)?Math.abs(Ke):0)}return{cleanupScrollListener:Ge,setupScrollListener:function(){if(!W)return;if(!((Be=Y?.value)!=null?Be:G.value))return void Ge();var Be;const Ke=Se();if(!Ke)return void Ge();if(se.value===Ke&&qe)return;Ge(),Re=je(Ke);const tt=()=>{if(Le?.(),G.value){const nt=(function(wt){const at=je(wt),ft=Re;Re=at;const Et=Math.max(480,.75*(wt.clientHeight||0));return ft==null?at>Et?{immediate:!0}:void 0:Math.abs(at-ft)>Et?{immediate:!0}:void 0})(Ke);nt?Me(nt):Me()}};Ke.addEventListener("scroll",tt,{passive:!0}),se.value=Ke,qe=()=>{Ke.removeEventListener("scroll",tt)}}}})({isClient:ne,virtualizationEnabled:St,listenerEnabled:v2,scrollRootElement:Ue,resolveScrollContainer:ie,scheduleFocusSync:ji,onScroll:function(){const M=Fe.value;if(!M)return;const W=hu();if(!W||(function(Y){if(ku()>=Te)return pe=null,!1;const se=pe;if(se==null)return!0;const Se=Math.abs(Y.scrollTop-se)<=2;return Se||(pe=null),Se})(W))return;const G=W2(W);G!=null?(G<-32||Math.abs(Math.max(0,G)-Math.max(0,M.distanceFromBottomPx))>32)&&Ka("restore"):Ka("restore")},getScrollTop:M=>{var W;const G=M.ownerDocument||((W=S.value)==null?void 0:W.ownerDocument)||document,Y=M===G.documentElement||M===G.body||M===G.scrollingElement;return ht("scrollListener.getScrollTop",()=>ee(M,G,Y))}});function Wo(M,W,G){return Math.min(Math.max(M,W),G)}function r1(M){return M?.firstElementChild}function M2(M,W){var G;return M?(G=M.matches)!=null&&G.call(M,W)?M:M.querySelector(W):null}function E2(){if(!kt.value)return void(K.value=0);const M=ht("updateExperimentContainerWidth.clientWidth",()=>{var W,G;return(G=(W=S.value)==null?void 0:W.clientWidth)!=null?G:0});K.value=M>0?M:0}let du=null;function l1(){du?.disconnect(),du=null}const T2=Li({loader:()=>Xn(null,null,function*(){return(yield ms(()=>import("./index8-B0l1OZhe.js"),__vite__mapDeps([7,6]))).default}),loadingComponent:KM,delay:0,suspensible:!1});function N2(M){return M===T2}const I2=R(()=>u.value==="pre"?qs:u.value==="shiki"?T2:j0),Kl=R(()=>{const M=it.value;if(!M.length||!kt.value)return M.map(()=>null);const W=K.value||ht("estimatedNodeHeights.clientWidth",()=>{var G;return((G=S.value)==null?void 0:G.clientWidth)||0});return!Number.isFinite(W)||W<=0?M.map(()=>null):M.map((G,Y)=>{const se=be[Y],Se=typeof se=="number"&&se>0;if(Rn.value&&!Se){const Le=JM(G,W,V.value);if(Le)return Le}if(sn.value&&G.type==="code_block"){const Le=(function(qe){if(qe.type!=="code_block")return null;const Re=hb(qe,xf(qe));return N2(Re)?"markdown":Re===qs?"pre":Re===I2.value||Re===j0?"monaco":null})(G);if(Le==="monaco"||Le==="markdown"||Le==="pre")return aee(G,{rendererKind:Le,monacoOptions:x.codeBlockMonacoOptions,showHeader:((Me=x.codeBlockProps)==null?void 0:Me.showHeader)!==!1})}var Me;return null})});function pf(M){var W;const G=be[M];if(Number.isFinite(G)&&G>0)return G;const Y=(W=Kl.value[M])==null?void 0:W.height;return Number.isFinite(Y)&&Y>0?Y:Math.max(Ot.value,(function(se){var Se,Me,Le,qe,Re,Ge,je,Be,Ke,tt,nt,wt,at;const ft=it.value[se];if(!ft||typeof ft!="object")return 32;const Et=String((Se=ft.type)!=null?Se:""),At=Gt()||640;switch(Et){case"heading":return 44;case"paragraph":return za(String((Le=(Me=ft.raw)!=null?Me:ft.content)!=null?Le:""),At,34);case"list":{const tn=Array.isArray(ft.items)?ft.items.length:1;return Math.max(48,30*tn+12)}case"list_item":return za(String((Re=(qe=ft.raw)!=null?qe:ft.content)!=null?Re:""),At,34);case"blockquote":return za(String((je=(Ge=ft.raw)!=null?Ge:ft.content)!=null?je:""),At,56);case"table":{const tn=Array.isArray(ft.rows)?ft.rows.length:Array.isArray(ft.children)?ft.children.length:3;return Math.max(120,38*tn+48)}case"code_block":return za(String((Ke=(Be=ft.code)!=null?Be:ft.raw)!=null?Ke:""),At,96,20);case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return za(String((nt=(tt=ft.raw)!=null?tt:ft.content)!=null?nt:""),At,96);case"thematic_break":return 24;default:return za(String((at=(wt=ft.raw)!=null?wt:ft.content)!=null?at:""),At,40)}})(M))}function za(M,W,G,Y=22){const se=String(M??"");if(!se)return G;const Se=Math.max(18,Math.floor(Math.max(320,W)/8)),Me=se.split(/\r?\n/).length,Le=Math.ceil(se.length/Se),qe=Math.max(1,Me,Le);return Math.max(G,Math.ceil(qe*Y+12))}function fu(M){const W=Number(M);return!Number.isFinite(W)||W<=0?-1:Math.round(W/32)}function a1(){var M,W;const G=it.value.length,Y=fu(K.value||ht("getFallbackHeightPrefix.clientWidth",()=>{var Le;return((Le=S.value)==null?void 0:Le.clientWidth)||0})),se=((M=o.virtualScroll)==null?void 0:M.measurementKey)==null?"":String(o.virtualScroll.measurementKey),Se=[G,Oe.count,Math.round(Oe.total),Math.round(100*Ot.value),se,Y,kt.value?1:0,QS.value,Z.value].join(":");if(!n1&&w2===Se)return x2;const Me=new Array(G+1);Me[0]=0;for(let Le=0;Le<G;Le++)Me[Le+1]=Me[Le]+(kt.value?pf(Le):(W=be[Le])!=null?W:Ot.value);return x2=Me,w2=Se,n1=!1,Me}function L2(M){var W,G;const Y=it.value.length;if(Y<=0||M<=0)return 0;const se=a1();if(M>=((W=se[Y])!=null?W:0))return Y-1;let Se=0,Me=Y-1,Le=Y-1;for(;Se<=Me;){const qe=Se+Me>>1;((G=se[qe+1])!=null?G:0)>=M?(Le=qe,Me=qe-1):Se=qe+1}return Le}function Zr(M,W){var G,Y;if(M>=W)return 0;if(kt.value)return(function(Me,Le){var qe,Re;const Ge=it.value.length,je=Wo(Math.trunc(Me),0,Ge),Be=Wo(Math.trunc(Le),je,Ge);if(je>=Be)return 0;const Ke=a1();return((qe=Ke[Be])!=null?qe:0)-((Re=Ke[je])!=null?Re:0)})(M,W);if(Ye.value!==it.value.length){let Me=0;for(let Le=M;Le<W;Le++)Me+=(G=be[Le])!=null?G:Ot.value;return Me}const se=st.value,Se=Ct.value;if(!se.length||!Se.length){let Me=0;for(let Le=M;Le<W;Le++)Me+=(Y=be[Le])!=null?Y:Ot.value;return Me}return fo(se,M,W)+(W-M-fo(Se,M,W))*Ot.value}Qe(()=>it.value.length,M=>{ii(),M<=0?oo():(M<Ye.value&&jt(M),M!==Ye.value&&wn(M))},{immediate:!0});const B8=R(()=>{if(!St.value)return it.value.map((Y,se)=>({node:Y,index:se}));const M=it.value.length,W=Wo(Ho.start,0,M),G=Wo(Ho.end,W,M);return it.value.slice(W,G).map((Y,se)=>({node:Y,index:W+se}))}),c1=R(()=>St.value?Zr(0,Math.min(Ho.start,it.value.length)):0),u1=R(()=>{if(!St.value)return 0;const M=it.value.length;return Zr(Math.min(Ho.end,M),M)});function $2(){if(!kt.value)return 0;let M=0;const W=Kl.value;for(let G=0;G<W.length;G++){if(!W[G])continue;const Y=be[G];Number.isFinite(Y)&&Y>0||M++}return M}function F2(){const M=it.value.length;return{totalNodes:M,measuredCount:Oe.count,estimatedCount:$2(),averageNodeHeight:Ot.value,topSpacerHeight:c1.value,bottomSpacerHeight:u1.value,estimatedTotalHeight:Zr(0,M),width:Gl()}}function D8(){const M=it.value,W=F2();return Pt(lt({},W),{probe:{paragraphReady:!!V.value.paragraph,listItemReady:!!V.value.listItem,listWrapperOverhead:V.value.listWrapperOverhead,headingReadyLevels:Object.entries(V.value.headings).filter(([,G])=>!!G).map(([G])=>Number(G))},nodes:M.map((G,Y)=>{var se,Se,Me,Le,qe,Re,Ge,je,Be;return{index:Y,type:G.type,estimateKind:(Se=(se=Kl.value[Y])==null?void 0:se.kind)!=null?Se:null,rendererKind:(Le=(Me=Kl.value[Y])==null?void 0:Me.rendererKind)!=null?Le:null,estimatedHeight:(Re=(qe=Kl.value[Y])==null?void 0:qe.height)!=null?Re:null,estimatedContentHeight:(je=(Ge=Kl.value[Y])==null?void 0:Ge.contentHeight)!=null?je:null,measuredHeight:(Be=be[Y])!=null?Be:null}})})}function d1(){return o.indexKey!=null?String(o.indexKey):Mn.value?`virtual-${Vn()}`:"markdown-renderer"}function O2(M){const W=String(M),G=`${d1()}-`;if(!W.startsWith(G))return null;const Y=W.slice(G.length).match(/^(\d+)(?:$|-)/);if(!Y)return null;const se=Number(Y[1]);return!Number.isInteger(se)||se<0||se>=it.value.length?null:se}function Vn(){var M,W,G;const Y=(M=o.virtualScroll)==null?void 0:M.sessionKey;return String(Y!=null&&Y!==""?Y:(G=(W=o.indexKey)!=null?W:x.customId)!=null?G:un)}function Mo(){var M;const W=(M=o.virtualScroll)==null?void 0:M.threadKey;return W==null||W===""?void 0:String(W)}function f1(M){var W;return(M??"")===((W=Mo())!=null?W:"")}function P8(){var M;const W=(M=o.virtualScroll)==null?void 0:M.measurementKey;return W==null?"":String(W)}function H8(){var M,W;const G=u.value,Y=G==="monaco"?x.codeBlockMonacoOptions:void 0,se=x.codeBlockProps,Se=G==="shiki";return[x.isDark?"dark":"light",G==="monaco"?"code-rich":G==="pre"?"code-pre":"code-shiki",x.codeBlockStream===!1?"code-static":"code-stream",Fo(x.codeBlockMinWidth),Fo(x.codeBlockMaxWidth),...Se?[Mp((M=se?.themes)!=null?M:x.themes,(W=se?.langs)!=null?W:x.langs)]:[],Fo(Y?.fontSize),Fo(Y?.lineHeight),Fo(Y?.fontFamily),Fo(Y?.tabSize),Fo(Y?.MAX_HEIGHT),Fo(Y?.wordWrap),Fo(Y?.wrappingIndent),Fo(Y?.padding),Fo(se?.showHeader),Fo(se?.showCopyButton),Fo(se?.showExpandButton),Fo(se?.showPreviewButton),Fo(se?.showCollapseButton),Fo(se?.showFontSizeButtons)].join("\0")}function ur(){return[P8(),H8()].join("\0")}function Gl(){return Gt()}const mf=R(()=>fu(Gl())),zs=R(()=>[ur(),mf.value].join("\0")),W8=R(()=>{var M;return Mn.value?["virtual",(M=Mo())!=null?M:"",Vn(),zs.value].join("\0"):o.indexKey});function Ua(){b2.value+=1}function h1(M){return!(!M||!Number.isInteger(M.index)||M.index<0||M.index>=it.value.length||M.sessionKey!==Vn()||M.threadKey!==Mo()||M.layoutEpochKey!==zs.value)}function R2(M){const W=String(M),G=qi.get(W);return G?h1(G)?G.index:null:O2(W)}function B2(M="async-node"){(Hs.size||qi.size)&&(Hs.clear(),qi.clear(),Ua(),Bn(M))}const qa=Kt(yv,null),p1={reportHeight(M,W){if(!ze.value)return;const G=R2(M);if(G==null)return;const Y=Ui.get(G);if(!Y)return;const se=Number(W),Se=ql(G,Y);Ul(G,Number.isFinite(se)&&se>0?Math.max(se,Se||0):Se)},markPending(M){if(!ze.value)return;const W=O2(M);W!=null&&(function(G,Y){var se;const Se=qi.get(G);if(Se&&h1(Se))return Hs.set(G,Math.max(0,(se=Hs.get(G))!=null?se:0)+1),Ua(),void Bn("async-node");Hs.set(G,1),qi.set(G,(function(Me){return{index:Me,sessionKey:Vn(),threadKey:Mo(),layoutEpochKey:zs.value}})(Y)),Ua(),Bn("async-node")})(String(M),W)},markSettled(M){if(!ze.value)return;const W=String(M),G=R2(M);(G!=null||(function(Y){return Hs.has(String(Y))})(W))&&(function(Y){var se;const Se=(se=Hs.get(Y))!=null?se:0;return!(Se<=0||(Se<=1?(Hs.delete(Y),qi.delete(Y)):Hs.set(Y,Se-1),Ua(),Se===1&&Bn("async-node"),0))})(W)&&G!=null&&dr()}};function z8(){let M=0;for(const W of Ui.values())M+=ht("getVisibleDomHeight.offsetHeight",()=>{var G;return(G=W?.offsetHeight)!=null?G:0});return Math.ceil(Math.max(0,M))}Ln(yv,{reportHeight(M,W){p1.reportHeight(M,W),qa?.reportHeight(M,W)},markPending(M){p1.markPending(M),qa?.markPending(M)},markSettled(M){p1.markSettled(M),qa?.markSettled(M)}});let m1,g1=null,ja=null;function gf(M){return M!==!1&&M!=null&&M!==""}function D2(){return St.value?(function(){if(!St.value)return!0;const M=it.value.length,W=Wo(Ho.start,0,M),G=Wo(Ho.end,W,M);if(W>=G)return!0;for(let Y=W;Y<G;Y++)if(!no.has(Y)||B1(Y)&&!Ui.has(Y))return!1;return!0})():co.value>=cf.value}function v1(){return j.value===!0&&!te.value&&t1.value===0&&Gr.size===0&&cr.size===0&&Ws==null&&D2()}function P2(){var M,W;if(((M=o.virtualScroll)==null?void 0:M.settleMode)!=="manual"||g1===Vn()&&m1===Mo())return!0;const G=(W=o.virtualScroll)==null?void 0:W.settledToken;return!!gf(G)&&ja===Au(G)}function y1(){return v1()&&P2()}function U8(M,W){return W.totalNodes<=0?M==="final"?"final":"estimate":W.measuredCount>=W.totalNodes?M==="final"?"final":"measured":W.measuredCount>0||W.estimatedCount>0?"mixed":"estimate"}function Yl(M="manual",W){const G=F2(),Y=(function(se){return se||(j.value!==!0?it.value.length>0?"streaming":"estimating":!D2()||cr.size>0||Ws!=null?"measuring":y1()?"settled":"settling")})(W);return{sessionKey:Vn(),threadKey:Mo(),phase:Y,nodeCount:G.totalNodes,liveRange:{start:Ho.start,end:Ho.end},renderedCount:co.value,measuredCount:G.measuredCount,estimatedCount:G.estimatedCount,averageNodeHeight:G.averageNodeHeight,topSpacerHeight:G.topSpacerHeight,bottomSpacerHeight:G.bottomSpacerHeight,visibleDomHeight:z8(),totalHeight:H2(),width:G.width,final:j.value===!0,stable:y1(),confidence:U8(Y,G),reason:M}}function hu(){const M=Ue.value||ie(),W=S.value;if(!M||!W)return null;const G=M.ownerDocument||W.ownerDocument||document,Y=M===G.documentElement||M===G.body||M===G.scrollingElement,se=ht("getScrollBox.scrollTop",()=>ee(M,G,Y)),Se=ht("getScrollBox.scrollHeight",()=>{var Le,qe,Re,Ge,je;return Y?Math.max((qe=(Le=G.documentElement)==null?void 0:Le.scrollHeight)!=null?qe:0,(Ge=(Re=G.body)==null?void 0:Re.scrollHeight)!=null?Ge:0,(je=M.scrollHeight)!=null?je:0):M.scrollHeight}),Me=ht("getScrollBox.clientHeight",()=>{var Le;return Y?((Le=G.documentElement)==null?void 0:Le.clientHeight)||M.clientHeight||0:M.clientHeight});return{root:M,doc:G,isViewportRoot:Y,scrollTop:se,scrollHeight:Se,clientHeight:Me}}function H2(){const M=it.value.length,W=Math.max(0,Zr(0,M)),G=ht("getRendererLogicalHeight.offsetHeight",()=>{var se,Se;return(Se=(se=S.value)==null?void 0:se.offsetHeight)!=null?Se:0}),Y=Math.max(0,G>0?G:ht("getRendererLogicalHeight.scrollHeight",()=>{var se,Se;return(Se=(se=S.value)==null?void 0:se.scrollHeight)!=null?Se:0}));return M<=0?Math.ceil(G):St.value?W>0?Math.max(1,Math.ceil(W),(function(){let se=c1.value+u1.value;for(const Se of no.values())Se&&(se+=Math.max(0,ht("getVirtualizedDomLogicalHeight.offsetHeight",()=>Se.offsetHeight||0)));return Math.ceil(Math.max(0,se))})(),(function(se,Se){return se<=0||Se<=0?0:Se<=se+Math.max(512,.05*se)?Math.ceil(Se):0})(W,Y)):Math.max(1,Math.ceil(Y)):ze.value?W>0||Oe.count>0||$2()>0?(Si.value&&co.value,Math.max(1,Math.ceil(Y),Math.ceil(W))):Math.ceil(Y):Math.max(1,Math.ceil(Y),Math.ceil(W))}function W2(M){const W=S.value;if(!W)return null;const G=ht("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>W.getBoundingClientRect());return(function(se){return se.isViewportRoot?se.clientHeight:ht("getViewportBottomInRoot.getBoundingClientRect",()=>se.root.getBoundingClientRect().bottom)})(M)-G.bottom}function q8(M={}){const W=M.requireViewport!==!1,G=(function(Se=64){const Me=hu(),Le=S.value;if(!Me||!Le)return!1;const qe=(function(Ge){if(Ge.isViewportRoot)return{top:0,bottom:Ge.clientHeight};const je=ht("getVirtualViewportRect.getBoundingClientRect",()=>Ge.root.getBoundingClientRect());return{top:je.top,bottom:je.bottom}})(Me),Re=ht("isRendererNearVirtualViewport.getBoundingClientRect",()=>Le.getBoundingClientRect());return Re.bottom>=qe.top-Se&&Re.top<=qe.bottom+Se})();if(W&&!G)return null;const Y=(function(){const Se=hu(),Me=S.value;if(!Se||!Me||Math.max(0,Se.scrollHeight-Se.scrollTop-Se.clientHeight)>64)return null;const Le=W2(Se);return Le==null?null:Le>=-8&&Le<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,Le)}:null})();if(Y)return{anchor:Y,captured:!0};const se=Cs();if(se)return{anchor:{type:"node",nodeIndex:se.nodeIndex,offsetWithinNodePx:se.offsetWithinNodePx},captured:G};if(M.allowFallback===!0){const Se=(function(){const Me=it.value.length;return Me<=0?null:{type:"node",nodeIndex:Wo(si.value,0,Math.max(0,Me-1)),offsetWithinNodePx:0}})();return Se?{anchor:Se,captured:!1}:null}return null}function k1(M){let W=2166136261;for(let G=0;G<M.length;G++)W^=M.charCodeAt(G),W=Math.imul(W,16777619);return(W>>>0).toString(36)}function j8(M,W){let G=M;for(let Y=0;Y<W.length;Y++)G^=W.charCodeAt(Y),G=Math.imul(G,16777619);return G^=31,G=Math.imul(G,16777619),G}const V8=new Set(["children","items","header","rows","cells","attrs","data","term","definition"]);function vf(M,W=new WeakSet,G=0){if(M==null||typeof M=="number"||typeof M=="boolean")return String(M);if(typeof M=="string")return`s:${(function(Y){const se=Y.length>8192?`${Y.slice(0,8192)}...${Y.length}`:Y;return`${Y.length}:${k1(se)}`})(M)}`;if(typeof M=="function")return"fn";if(typeof M!="object")return typeof M;if(W.has(M))return"cycle";if(G>=6)return"max-depth";W.add(M);try{if(Array.isArray(M)){if(M.length<=160){const Re=[];for(let Ge=0;Ge<M.length;Ge++)Re.push(vf(M[Ge],W,G+1));return`a:${M.length}:${Re.join(",")}`}const Se=[],Me=[],Le=Math.max(0,M.length-32);let qe=2166136261;for(let Re=0;Re<M.length;Re++){const Ge=vf(M[Re],W,G+1);qe=j8(qe,Ge),Re<32&&Se.push(Ge),Re>=Le&&Me.push(Ge)}return[`a:${M.length}`,`h=${Se.join(",")}`,`t=${Me.join(",")}`,`all=${(qe>>>0).toString(36)}`].join(":")}const Y=M,se=Object.keys(Y).filter(Se=>{const Me=Y[Se];return Se!=="parent"&&Se!=="el"&&Se!=="component"&&(Me==null||typeof Me=="string"||typeof Me=="number"||typeof Me=="boolean"||V8.has(Se))}).sort();return`o:${se.length}:${se.map(Se=>`${Se}=${vf(Y[Se],W,G+1)}`).join(";")}`}finally{W.delete(M)}}let z2=-1,b1="";function pu(M){const W=it.value[M];return W?k1(vf(W)):""}function x1(){const M=Z.value;if(z2===M)return b1;let W=2166136261;for(let G=0;G<it.value.length;G++){const Y=pu(G);for(let se=0;se<Y.length;se++)W^=Y.charCodeAt(se),W=Math.imul(W,16777619)}return b1=(W>>>0).toString(36),z2=M,b1}function Va(M,W={}){var G;const Y=W.includeHeightCache===!0,se=(G=W.includeContentHash)!=null?G:Y,Se=Y?(function(Le){const qe=(function(){var nt,wt;const at=Number((wt=(nt=o.virtualScroll)==null?void 0:nt.heightCacheLimit)!=null?wt:5e3);return!Number.isFinite(at)||at<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(at))})();if(!Number.isFinite(qe)||Le.length<=qe)return Le;const Re=new Map,Ge=nt=>{!nt||Re.size>=qe||Re.set(nt.index,nt)},je=it.value.length,Be=Wo(Ho.start-2*uu.value,0,je),Ke=Wo(Ho.end+2*uu.value,Be,je);for(const nt of Le)nt.index>=Be&&nt.index<Ke&&Ge(nt);const tt=Math.max(1,Math.ceil(Le.length/qe));for(let nt=0;nt<Le.length&&Re.size<qe;nt+=tt)Ge(Le[nt]);for(let nt=Le.length-1;nt>=0&&Re.size<qe;nt-=tt)Ge(Le[nt]);return Array.from(Re.values()).sort((nt,wt)=>nt.index-wt.index).slice(0,qe)})(Nt().map(Le=>{var qe;const Re=it.value[Le.index];return Re?Pt(lt({},Le),{nodeType:String((qe=Re.type)!=null?qe:""),signature:pu(Le.index)}):null}).filter(Le=>!!Le)):[],Me=q8({allowFallback:W.allowAnchorFallback===!0,requireViewport:W.requireViewport});return Me||Se.length||W.includeEmptyState===!0?Pt(lt({sessionKey:M.sessionKey,threadKey:M.threadKey},Me?{anchor:Me.anchor,anchorCaptured:Me.captured}:{anchorCaptured:!1}),{metrics:M,width:M.width,contentHash:se?x1():void 0,measurementKey:ur()||void 0,heightCache:Se.length?Se:void 0}):null}function w1(M){var W,G;const Y=hu();if(!Y)return;const se=(function(Le){const qe=S.value;if(!qe)return null;const Re=ye(qe,Le.root),Ge=it.value.length,je=ht("getRendererBottomOffsetWithinRoot.offsetHeight",()=>qe.offsetHeight||0),Be=Math.max(0,je>0?je:Ge>0?ht("getRendererBottomOffsetWithinRoot.scrollHeight",()=>qe.scrollHeight||0):0),Ke=H2();return Re+Math.max(Be,Ke)})(Y);if(se==null)return;const Se=Math.max(0,M.distanceFromBottomPx),Me=Math.max(0,se-Y.clientHeight-Se);(function(Le){Te=ku()+120,pe=Le})(Me),Y.isViewportRoot?(G=(W=Y.doc.defaultView)==null?void 0:W.scrollTo)==null||G.call(W,0,Me):tC(Y.root,Y.doc,Me,{isReverseFlexScrollRoot:q,getNormalizedScrollTop:ee})}const _1=[];function U2(){if(ne)for(oe!=null&&(jn?.(oe),oe=null);_1.length;){const M=_1.pop();M!=null&&window.clearTimeout(M)}}function Ka(M){const W=!!Fe.value;Fe.value=null,Te=0,pe=null,U2(),W&&M&&Bn(M)}function Ga(){if(!Fe.value||!ne||oe!=null)return;const M=()=>{oe=null;const W=Fe.value;W&&w1(W)};oe=Tn?Tn(M):null,oe==null&&M()}function q2(M,W={}){const G=it.value.length;return G<=0?[]:M.filter(Y=>!(!Number.isInteger(Y.index)||Y.index<0||Y.index>=G)&&!(!Number.isFinite(Y.height)||Y.height<=0)&&!(W.requireSignature&&!Y.signature)&&!(W.requireCompatibilityMetadata&&!Y.nodeType&&!Y.signature)&&(function(se){var Se;const Me=it.value[se.index];return!(!Me||se.nodeType&&se.nodeType!==String((Se=Me.type)!=null?Se:"")||se.signature&&se.signature!==pu(se.index))})(Y))}function j2(M){const W=fu(Gl()),G=fu(M);return W!==-1&&G!==-1&&W===G}function S1(M){var W;const G=Number(M?.width);if(Number.isFinite(G)&&G>0)return G;const Y=Number((W=M?.metrics)==null?void 0:W.width);return Number.isFinite(Y)&&Y>0?Y:null}function V2(M){var W;return M.sessionKey===Vn()&&!!f1(M.threadKey)&&((W=M.measurementKey)!=null?W:"")===ur()&&!!j2(S1(M))&&!!(function(G){const Y=G.heightCache;return!!Y?.length&&(K2(G)?Y.some(se=>!!(se.nodeType||se.signature)):Y.some(se=>!!se.signature))})(M)}function K2(M){return!!(M.contentHash&&M.contentHash===x1())}function K8(M){return!K2(M)}let Zl=null,Ql=null,yf=null,mu=null,gu=null;function C1(M){var W;const G=M.map(se=>{var Se,Me;return[se.index,Math.round(10*se.height),(Se=se.nodeType)!=null?Se:"",(Me=se.signature)!=null?Me:""].join("")}).join(""),Y=fu(Gl());return[(W=Mo())!=null?W:"",Vn(),ur(),it.value.length,Y,M.length,k1(G)].join(":")}function G2(M=(W=>(W=o.virtualScroll)==null?void 0:W.heightCache)()){if(!ze.value||!M?.length||it.value.length<=0||!j2((W=o.virtualScroll)==null?void 0:W.heightCacheWidth))return!1;var W;const G=q2(M,{requireSignature:!0});if(!G.length)return!1;const Y=C1(G);return Y===Zl?(Ql="standalone",!0):(lf(G,{mode:"merge"}),ii(),Zl=Y,Ql="standalone",xu(),Bn("restore"),!0)}function A1(M,W={}){var G,Y,se;if(!ze.value||!M||M.sessionKey!==Vn()||!f1(M.threadKey)||it.value.length<=0)return!1;const Se=!!((G=M.heightCache)!=null&&G.length)&&!kf(),Me=!M.anchor||M.anchorCaptured===!1&&W.allowUncapturedAnchor!==!0?null:M.anchor,Le=W.restoreAnchor===!0&&!!Me&&!kf()&&Number(S1(M))>0;let qe=!1;if((Y=M.heightCache)!=null&&Y.length&&V2(M)){const Ge=q2(M.heightCache,{requireCompatibilityMetadata:!M.contentHash,requireSignature:K8(M)});Ge.length&&(lf(Ge,{mode:"merge"}),ii(),Zl=C1(Ge),Ql="restore",xu(),qe=!0)}if(Se||Le)return!1;if(!W.restoreAnchor||!Me)return qe&&Bn("restore"),!0;const Re=(function(Ge,je){var Be;const Ke=Ge.anchor,tt=Ke?Ke.type==="bottom"?`bottom:${Math.round(Ke.distanceFromBottomPx)}`:`node:${Ke.nodeIndex}:${Math.round(Ke.offsetWithinNodePx)}`:"none";return[(Be=Mo())!=null?Be:"",Vn(),ur(),mf.value,je,tt].join(":")})(M,(se=W.restoreToken)!=null?se:"imperative");return yf===Re?(qe&&Bn("restore"),!0):(yf=Re,(function(Ge){const je=()=>{if(Ge.type==="node")return Ka(),void Q({nodeIndex:Ge.nodeIndex,offsetWithinNodePx:Ge.offsetWithinNodePx});if(rn(),_e.value=null,Fe.value=Ge,U2(),w1(Ge),ne)for(const Be of[0,120,280,480])_1.push(window.setTimeout(()=>{const Ke=Fe.value;Ke&&w1(Ke)},Be))};(function(Be){if(!St.value)return!1;const Ke=it.value.length;return!(Ke<=0||(si.value=Be.type==="node"?Wo(Be.nodeIndex,0,Ke-1):Ke-1,jl(),0))})(Ge)?mt(je):je()})(Me),Bn("restore"),!0)}function kf(){const M=Gl();return Number.isFinite(M)&&M>0}function Y2(M){var W;return M.sessionKey===Vn()&&!!f1(M.threadKey)&&(it.value.length<=0||!(!((W=M.heightCache)!=null&&W.length)||kf())||!(!(M.anchor&&Number(S1(M))>0)||kf()))}function M1(){zn.clear();for(const M of Object.keys(be)){const W=Number(M);Number.isInteger(W)&&W>=0&&W<it.value.length&&zi(W)}}function vu(){Ws!=null&&(jn?.(Ws),Ws=null),D1()}function Z2(){return!ne||ti?Promise.resolve():new Promise(M=>{let W=!1,G=null;const Y=()=>{W||(W=!0,G!=null&&window.clearTimeout(G),M())};if(Tn)return Tn(Y),void(G=window.setTimeout(Y,50));G=window.setTimeout(Y,0)})}function E1(M,W=Mo(),G=zs.value){return Vn()===M&&Mo()===W&&zs.value===G}function T1(){return Xn(this,arguments,function*(M={}){var W,G,Y,se,Se;const Me=Vn(),Le=Mo(),qe=zs.value,Re=(W=M.frames)!=null?W:2,Ge=(G=M.timeoutMs)!=null?G:120,je=(Y=M.reason)!=null?Y:"manual",Be=M.expectedSettledTokenKey,Ke=M.flushPendingTimers===!0,tt=Yl(je),nt=()=>Pt(lt({},tt),{phase:tt.final?"settling":tt.phase,stable:!1,confidence:tt.confidence==="final"?"mixed":tt.confidence,reason:je}),wt=()=>E1(Me,Le,qe)&&(Be==null||bu()===Be);for(let At=0;At<Re;At++){if(yield mt(),!wt()||(yield Z2(),!wt()))return nt();dr(),vu()}if(yield(function(At){return!ne||At<=0?Promise.resolve():new Promise(tn=>window.setTimeout(tn,At))})(Ge),!wt()||(Ke&&S2(),dr(),vu(),!wt()))return nt();const at=v1();at&&(g1=Me,m1=Le,((se=o.virtualScroll)==null?void 0:se.settleMode)==="manual"&&Be!=null&&gf((Se=o.virtualScroll)==null?void 0:Se.settledToken)&&bu()===Be&&(ja=Au(o.virtualScroll.settledToken)));const ft=wt()&&at&&P2(),Et=Yl(je,ft?"final":void 0);return F1(Et,!0),Et})}let N1="content",Xl=null,Jl=null,I1=0,yu=null,Ya=null,L1=null,$1=null;function ku(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function Q2(M){var W,G;const Y=yu;if(!Y)return!0;const se=(G=(W=o.virtualScroll)==null?void 0:W.heightDiffThresholdPx)!=null?G:1;return Math.abs(M.totalHeight-Y.totalHeight)>se||M.sessionKey!==Y.sessionKey||M.phase!==Y.phase||M.stable!==Y.stable||M.final!==Y.final||M.threadKey!==Y.threadKey||M.nodeCount!==Y.nodeCount||M.measuredCount!==Y.measuredCount||M.width!==Y.width}function Fo(M){if(M==null)return"";if(typeof M=="string"||typeof M=="number"||typeof M=="boolean")return String(M);try{return JSON.stringify(M)}catch{return String(M)}}function bu(M=(W=>(W=o.virtualScroll)==null?void 0:W.settledToken)()){return Fo(M)}function X2(M,W){var G,Y;return[M,W.sessionKey,(G=W.threadKey)!=null?G:"",ur(),x1(),Fo((Y=o.virtualScroll)==null?void 0:Y.settledToken),Math.round(W.totalHeight),Math.round(W.width)].join("\0")}function xu(){L1=null,$1=null,Ya=null}function G8(M){const W=M.heightCache;return W?.length?C1(W):""}function wu(M){var W,G,Y;const se=M.metrics,Se=M.anchor?(Me=M.anchor).type==="bottom"?`bottom:${Math.round(Me.distanceFromBottomPx)}`:`node:${Me.nodeIndex}:${Math.round(Me.offsetWithinNodePx)}`:"none";var Me;return[M.sessionKey,(W=M.threadKey)!=null?W:"",(G=M.measurementKey)!=null?G:ur(),(Y=M.contentHash)!=null?Y:"",G8(M),Se,M.anchorCaptured?1:0,se.liveRange.start,se.liveRange.end,se.renderedCount,se.nodeCount,Math.round(se.totalHeight),Math.round(se.width),se.phase,se.stable?1:0].join("\0")}function F1(M,W=!1){if(!ze.value||(function(Me=!1){return!Me&&Mn.value&&!Xe.value})(W))return;const G=W||Q2(M),Y=(function(Me,Le=!1){return Le||Me.stable||Me.phase==="final"?{state:Va(Me,{includeHeightCache:!0})}:{state:Va(Me)}})(M,W),se=Y.state,Se=!!(se&&(G||(function(Me,Le=!1){return!!Le||wu(Me)!==Ya})(se,W)));if(G&&(L(M),yu=M,I1=ku()),se&&Se&&(E(se),se.anchor&&F(se.anchor),Ya=wu(se)),M.stable){const Me=X2("settled",M);if(Me!==L1){L1=Me;const Le=Va(M,{includeHeightCache:!0});Le&&(E(Le),Ya=wu(Le)),(function(qe){s("render-settled",qe)})(M)}}if(M.phase==="final"){const Me=X2("final",M);if(Me!==$1){$1=Me;const Le=Va(M,{includeHeightCache:!0});Le&&(E(Le),Ya=wu(Le)),(function(qe){s("render-final",qe)})(M)}}}function O1(){Xl!=null&&(jn?.(Xl),Xl=null),Jl!=null&&ne&&(window.clearTimeout(Jl),Jl=null)}function J2(){Xl=null,Jl=null,(function(M){if(cr.size>0||Ws!=null)return!0;switch(M){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(N1)&&(dr(),vu()),F1(Yl(N1))}function Bn(M){var W,G;if(!ze.value||(N1=M,Xl!=null||Jl!=null))return;const Y=Math.max(0,(G=(W=o.virtualScroll)==null?void 0:W.emitIntervalMs)!=null?G:32),se=Math.max(0,Y-(ku()-I1)),Se=()=>{Jl=null,Xl=Tn?Tn(J2):null,Xl==null&&J2()};ne&&se>0?Jl=window.setTimeout(Se,se):Se()}function R1(M){var W;if(M<=0)return 0;const G=it.value;if(kt.value)return L2(M);if(Ye.value===G.length&&st.value.length&&Ct.value.length){const se=Ot.value,Se=st.value,Me=Ct.value,Le=je=>je<=0?0:fo(Se,0,je)+(je-fo(Me,0,je))*se;let qe=0,Re=G.length-1,Ge=G.length-1;for(;qe<=Re;){const je=qe+Re>>1;Le(je+1)>=M?(Ge=je,Re=je-1):qe=je+1}return Ge}let Y=M;for(let se=0;se<G.length;se++){const Se=(W=be[se])!=null?W:Ot.value;if(Y<=Se)return se;Y-=Se}return Math.max(0,G.length-1)}function eb(){$o.value+=1}function B1(M){return!(Si.value&&M>=co.value)&&(!Vr.value||M<Ss.value||s1.value.has(M))}function Za(M){const W=ff.get(M);W&&(W(),ff.delete(M));const G=Wa.get(M);G&&(G.destroy(),Wa.delete(M)),hf(M)}function tb(M,W){let G=!1;if(W){const Se=no.get(M);no.set(M,W),Se!==W&&(G=!0)}else no.delete(M)&&(G=!0);if(G&&eb(),W||hf(M),!g2.value||!ss||!St.value&&Vr.value&&!H.value&&Wa.size>=640&&(H.value||(H.value=!0,i1()),!g2.value||!ss))return Za(M),void(W&&Yr(M,!0));if(M<Ss.value&&!St.value||s1.value.has(M))return Za(M),void Yr(M,!0);if(!W)return void Za(M);Za(M);const Y=ss(W,{rootMargin:"400px"});if(!Y)return;Wa.set(M,Y),Yr(M,Y.isVisible.value),Vr.value&&(function(Se){if(!ne||!Vr.value)return;hf(Se);const Me=Se%17*23,Le=window.setTimeout(()=>{if(C2.delete(Se),!Vr.value||s1.value.has(Se))return;const qe=no.get(Se);if(!qe)return;const Re=ie(qe),Ge=qe.ownerDocument||document,je=Ge.defaultView||window,Be=!Re||Re===Ge.documentElement||Re===Ge.body,Ke=!Be&&Re?ht("nodeVisibilityFallback.root.getBoundingClientRect",()=>Re.getBoundingClientRect()):null,tt=Be?0:Ke.top,nt=Be?ht("nodeVisibilityFallback.clientHeight",()=>{var at,ft;return(ft=(at=je.innerHeight)!=null?at:Re?.clientHeight)!=null?ft:0}):Ke.bottom,wt=ht("nodeVisibilityFallback.node.getBoundingClientRect",()=>qe.getBoundingClientRect());wt.bottom>=tt-500&&wt.top<=nt+500&&Yr(Se,!0)},1800+Me);C2.set(Se,Le)})(M);let se=null;se=Qe(()=>Y.isVisible.value,Se=>{if(Se){hf(M),Yr(M,!0),se?.(),ff.delete(M),Wa.get(M)===Y&&Wa.delete(M);try{Y.destroy()}catch{}}},{immediate:!0}),ff.set(M,se),St.value&&ji()}function D1(){Ws=null;for(const[M,W]of cr)cr.delete(M),Ui.get(M)===W.el&&Vl.get(M)===W.version&&Ul(M,W.height,{allowShrink:W.allowShrink})}function Qa(){Ws!=null&&(jn?.(Ws),Ws=null),cr.clear()}function bf(M,W){(function(G,Y,se){var Se;if(!Number.isFinite(se)||se<=0||Ui.get(G)!==Y)return;const Me=Vl.get(G);if(Me==null)return;const Le=it.value[G],qe=te.value&&j.value!==!0&&!((Se=o.nodes)!=null&&Se.length)&&G>=it.value.length-2,Re=!(Le?.loading===!0||qe),Ge=cr.get(G),je=Ge?Ge.allowShrink&&Re:Re,Be=Ge&&!je?Math.max(Ge.height,se):se;cr.set(G,{height:Be,allowShrink:je,version:Me,el:Y}),Ws==null&&(Ws=Tn?Tn(D1):null,Ws==null&&D1())})(M,W,ql(M,W))}function dr(){for(const[M,W]of Ui)W&&bf(M,W)}function nb(){Lo?.disconnect(),Lo=null,is.clear()}function P1(){for(;af.length;)df(af.pop())}Qe(Xe,M=>{M&&Bn("content")},{flush:"post"}),t({getVirtualMetrics:Yl,captureVirtualState:function(M={}){var W;return Va(Yl("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:M.allowFallbackAnchor===!0,requireViewport:M.requireViewport===!0,includeEmptyState:(W=M.includeEmptyState)==null||W})},restoreVirtualState:function(M,W={}){const G=W.restoreAnchor===!0,Y=W.restoreToken==null?"imperative":String(W.restoreToken);mu=M,gu={restoreAnchor:G,restoreToken:Y,allowUncapturedAnchor:W.allowUncapturedAnchor===!0},!A1(M,{restoreAnchor:G,restoreToken:Y,allowUncapturedAnchor:W.allowUncapturedAnchor===!0})&&Y2(M)||(mu=null,gu=null)},forceMeasure:function(M="manual"){return Xn(this,null,function*(){yield mt(),yield Z2(),dr(),vu(),yield mt();const W=Yl(M);return F1(W,!0),W})},settle:T1,scrollToNode:function(M,W="start"){Ka(),rn();const G=it.value.length;if(G<=0)return;const Y=Wo(M,0,G-1),se=()=>{var Se;const Me=Dt({nodeIndex:Y,offsetWithinNodePx:0}),Le=pf(Y),qe=hu(),Re=(Se=qe?.clientHeight)!=null?Se:0,Ge=He();let je=Me;if(W==="center")je=Me-Re/2+Le/2;else if(W==="end")je=Me-Re+Le;else if(W==="nearest"&&Ge!=null){if(Me>=Ge&&Me+Le<=Ge+Re)return;je=Me<Ge?Me:Me-Re+Le}Rt(Math.max(0,je)),ji({immediate:!0}),St.value&&(si.value=Y,jl())};if(St.value)return si.value=Y,jl(),void mt(se);se()}}),Qe(()=>Po.value,M=>{if(!M){nb();for(const W of Kr.values())for(const G of W)df(G);Kr.clear(),Vl.clear(),P1(),Qa()}},{immediate:!0}),Qe(j,M=>{M&&(function(){if(ne&&j.value&&Ui.size){P1();for(const W of[80,240,640]){const G=_2(W,()=>{for(const[Y,se]of Ui)se&&bf(Y,se)},"final");G!=null&&af.push(G)}}})(),Bn(M?"final":"content")}),Qe([()=>it.value.length,()=>co.value],()=>{Fe.value&&Ga(),Bn("content")},{flush:"post",immediate:!0}),Qe([()=>Ho.start,()=>Ho.end],()=>{Bn("batch")},{flush:"post"});const{cleanupBatchScheduler:Y8}=(function(M){const{props:W,isClient:G,isTestEnv:Y,parsedNodesIdentity:se,parsedNodeCount:Se,desiredRenderedCount:Me,datasetKey:Le,batchingEnabled:qe,incrementalRenderingActive:Re,resolvedBatchSize:Ge,resolvedInitialBatch:je,renderedCount:Be,adaptiveBatchSize:Ke,previousRenderContext:tt,previousBatchConfig:nt,requestFrame:wt,cancelFrame:at,hasIdleCallback:ft,cleanupNodeVisibility:Et,onDatasetKeyChanged:At,onDatasetChanged:tn}=M;let Lt=null,qt=null,zt=!1,fn=null,Us=null,as=0,Mi=!1,Qr=!1;const Xr=new Set,ta=new Set;function bb(){if(G){Lt!=null&&(at?.(Lt),Lt=null),qt!=null&&(window.clearTimeout(qt),qt=null),Us!=null&&typeof window.cancelIdleCallback=="function"&&(window.cancelIdleCallback(Us),Us=null),as+=1;for(const Zo of Xr)at?.(Zo);Xr.clear();for(const Zo of ta)window.clearTimeout(Zo);ta.clear(),zt=!1,fn=null,Mi=!1,Qr=!1}}function Mf(){return typeof performance<"u"?performance.now():Date.now()}function xb(Zo){(function(fr){var Jr;if(!Re.value)return;const hr=Math.max(2,(Jr=W.renderBatchBudgetMs)!=null?Jr:6),pr=Math.max(1,Ge.value||1),Ei=Math.max(1,Math.floor(pr/4));fr>1.2*hr?Ke.value=Math.max(Ei,Math.floor(.7*Ke.value)):fr<.5*hr&&Ke.value<pr&&(Ke.value=Math.min(pr,Math.ceil(1.2*Ke.value)))})(Zo),Mi=!1;const As=Qr||Be.value<Me.value;Qr=!1,As&&Sb()}function wb(Zo,As={}){var fr,Jr;if(!Re.value)return;const hr=Me.value;if(Be.value>=hr)return;const pr=Math.max(1,Zo),Ei=()=>{const ec=Mf();let tc=0;Lt=null,qt=null,Us=null,zt=!1;const nc=fn??pr;fn=null;const K1=Mf();Be.value=Math.min(hr,Be.value+nc),Et(Be.value),tc=Mf()-K1,(function(G1,Cb){if(!G)return void xb(Cb);Mi=!0;const Ab=++as;mt().then(()=>{var Mb;if(Ab!==as)return;const mE=Mf(),gE=Math.max(Cb,mE-G1),Eb=()=>{Ab===as&&xb(gE)};if(wt){let Nb=!1,mr=null;const Ib=()=>{Nb||(Nb=!0,Eb())},Ef=wt(()=>{Xr.delete(Ef),mr!=null&&(window.clearTimeout(mr),ta.delete(mr),mr=null),Ib()});return Xr.add(Ef),mr=window.setTimeout(()=>{mr!=null&&ta.delete(mr),mr=null,at?.(Ef),Xr.delete(Ef),Ib()},Math.max(32,(Mb=W.renderBatchIdleTimeoutMs)!=null?Mb:120)),void ta.add(mr)}const Tb=window.setTimeout(()=>{ta.delete(Tb),Eb()},0);ta.add(Tb)})})(ec,tc)};if(!G||As.immediate)return void Ei();const el=Math.max(0,(fr=W.renderBatchDelay)!=null?fr:16);if(fn=fn!=null?Math.max(fn,pr):pr,!zt){if(zt=!0,!Y&&ft&&window.requestIdleCallback){const ec=Math.max(0,(Jr=W.renderBatchIdleTimeoutMs)!=null?Jr:120);return void(Us=window.requestIdleCallback(()=>Ei(),{timeout:ec}))}wt&&!Y?Lt=wt(()=>{el!==0?qt=window.setTimeout(()=>Ei(),el):Ei()}):qt=window.setTimeout(()=>Ei(),el)}}function _b(Zo,As={}){Mi?Qr=!0:Zo==null?Sb():wb(Zo,As)}function Sb(){Re.value&&wb(qe.value?Math.max(1,Math.round(Ke.value)):Math.max(1,Ge.value))}return Qe([se,Se,Le,Re,Ge,je,()=>W.renderBatchDelay],()=>{var Zo;const As=Se.value,fr=tt.value,Jr=Le.value,hr=!Object.is(Jr,fr.key),pr=As!==fr.total,Ei=hr||pr;tt.value={key:Jr,total:As};const el=nt.value,ec=(Zo=W.renderBatchDelay)!=null?Zo:16,tc=el.batchSize!==Ge.value||el.initial!==je.value||el.delay!==ec||el.enabled!==Re.value;nt.value={batchSize:Ge.value,initial:je.value,delay:ec,enabled:Re.value},hr&&At(As),(Ei||tc||!Re.value)&&bb(),(Ei||tc)&&(Ke.value=Math.max(1,Ge.value||1)),Ei&&tn();const nc=Me.value;if(!As)return Be.value=0,void Et(0);if(!Re.value)return Be.value=nc,void Et(Be.value);const K1=hr||fr.total===0;Be.value=K1||tc?Math.min(nc,je.value):Math.min(Be.value,nc);const G1=Math.max(1,je.value||Ge.value||As);Be.value<nc?_b(G1,{immediate:!G}):Et(Be.value)},{immediate:!0}),Qe(Me,(Zo,As)=>{Re.value&&(typeof As=="number"&&Zo<=As||Zo>Be.value&&_b())}),{cleanupBatchScheduler:bb}})({props:x,isClient:ne,isTestEnv:ti,parsedNodesIdentity:ao,parsedNodeCount:Yn,desiredRenderedCount:cf,datasetKey:W8,batchingEnabled:Wi,incrementalRenderingActive:Si,resolvedBatchSize:Io,resolvedInitialBatch:Ss,renderedCount:co,adaptiveBatchSize:Ci,previousRenderContext:ni,previousBatchConfig:ar,requestFrame:Tn,cancelFrame:jn,hasIdleCallback:Ps,cleanupNodeVisibility:O8,onDatasetKeyChanged:M=>{Qa(),oo(),ii(),xu(),M>0&&wn(M)},onDatasetChanged:()=>{St.value&&ji({immediate:!0})}});Qe([v2,St,()=>S.value,()=>X()],([M,W])=>{if(!M)return A2(),void o1();R8(),W?ji({immediate:!0}):o1()},{flush:"post",immediate:!0}),Qe([()=>it.value.length,()=>St.value],M=>Xn(null,[M],function*([W,G]){G&&W&&ne&&(yield mt(),ji({immediate:!0}))}),{flush:"post"}),Qe(kt,M=>{M&&(function(){var W;if(go.value&&os.value&&qn.value&&((W=to.value)!=null&&W[1]))return;const G=pt({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),Y=pt({type:"list_item",children:[G],raw:"- Probe paragraph text"}),se=pt({type:"list",ordered:!1,items:[Y],raw:"- Probe paragraph text"});go.value=G,os.value=Y,qn.value=se;const Se={1:null,2:null,3:null,4:null,5:null,6:null};for(let Me=1;Me<=6;Me++)Se[Me]=pt({type:"heading",level:Me,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(Me)} Probe heading`});to.value=Se})()},{immediate:!0}),Qe([()=>S.value,kt],()=>{if(!kt.value)return l1(),void(K.value=0);E2(),l1(),kt.value&&S.value&&typeof ResizeObserver<"u"&&(du=new ResizeObserver(()=>{E2(),_e.value&&Un(),Fe.value&&Ga(),Bn("resize")}),du.observe(S.value))},{immediate:!0}),Qe([kt,Wn,zs],()=>Xn(null,null,function*(){if(!kt.value)return V.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void ii();yield mt(),(function(){if(!kt.value||typeof window>"u")return V.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void ii();const M={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},W=M2(r1(N.value),".paragraph-node");M.paragraph=J0(N.value,W,"pre-wrap");const G=r1(D.value),Y=G?.querySelector(".paragraph-node");M.listItem=J0(D.value,Y,"pre-wrap");const se=ht("readSimpleTextProbeProfile.list.offsetHeight",()=>{var Me,Le;return(Le=(Me=B.value)==null?void 0:Me.offsetHeight)!=null?Le:0}),Se=ht("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var Me,Le;return(Le=(Me=D.value)==null?void 0:Me.offsetHeight)!=null?Le:0});M.listWrapperOverhead=Math.max(0,se-Se);for(let Me=1;Me<=6;Me++){const Le=M2(r1(U[Me]),`h${Me}`);M.headings[Me]=J0(U[Me],Le,"pre-wrap")}V.value=M,ii()})()}),{flush:"post",immediate:!0}),Qe(()=>it.value.length,()=>{St.value&&ji({immediate:!0})}),Qe([kt,K],()=>{ii(),St.value&&ji({immediate:!0}),_e.value&&Un(),Fe.value&&Ga(),Bn("resize")},{immediate:!1}),Qe(()=>Vr.value,M=>{if(M)for(const[W,G]of no)tb(W,G);else{i1();for(const[W,G]of no)G&&Yr(W,!0)}},{immediate:!1}),Qe([()=>x.viewportPriority,()=>it.value.length],([M,W])=>{M!==!1?H.value&&W<=200&&(H.value=!1):H.value=!1}),Qe(()=>co.value,()=>{St.value&&ji({immediate:!0})}),Qe([si,En,uu,()=>it.value.length,St],()=>{jl()},{immediate:!0});let _u=null,Su=!1,Xa=null;function Cu(){_u=null,g1=null,m1=void 0,ja=null,xu()}function H1(){Qa(),oo(),ii(),zn.clear();const M=it.value.length;M>0&&wn(M),M1()}function W1(){O1(),S2(),yu=null,Zl=null,Ql=null,yf=null,mu=null,gu=null,Su=!1,Cu(),B2("restore"),rn(),Ka()}function Au(M){var W;return[(W=Mo())!=null?W:"",Vn(),ur(),mf.value,bu(M),it.value.length,Math.round(Zr(0,it.value.length)),Math.round(Gl()),Oe.count,Math.round(Oe.total)].join(":")}function ob(){return Xn(this,null,function*(){var M,W,G,Y;const se=(M=o.virtualScroll)==null?void 0:M.settledToken,Se=bu(se),Me=Vn(),Le=Mo(),qe=zs.value;if(ze.value&&((W=o.virtualScroll)==null?void 0:W.settleMode)==="manual"&&gf(se))if(v1()){if(Au(se)!==ja&&!Su){Su=!0;try{const Re=yield T1({reason:"manual",expectedSettledTokenKey:Se}),Ge=bu()===Se;E1(Me,Le,qe)&&Re.sessionKey===Me&&Re.threadKey===Le&&Ge&&Re.stable&&Re.phase==="final"&&(ja=Au((G=o.virtualScroll)==null?void 0:G.settledToken))}finally{Su=!1,yield mt();const Re=(Y=o.virtualScroll)==null?void 0:Y.settledToken,Ge=gf(Re)?Au(Re):"";E1(Me,Le,qe)&&Ge&&ja!==Ge&&ob()}}}else Bn("manual")})}Qe(ze,(M,W)=>{if(M!==W){if(!M)return W1(),void O1();W1(),H1(),Xa=zs.value,Bn("content")}},{flush:"post"}),Qe([ze,zs],([M,W])=>{M?Xa!=null?Xa!==W&&(Xa=W,(function(G="resize"){Qa(),oo(),ii(),zn.clear();const Y=it.value.length;Y>0&&wn(Y),M1(),Zl=null,Ql=null,yf=null,yu=null,Su=!1,Cu(),G2(),mt(()=>{dr(),_e.value&&Un(),Fe.value&&Ga(),Bn(G)})})("resize")):Xa=W:Xa=null},{flush:"post",immediate:!0}),Qe([ze,()=>Vn(),()=>Mo()],([M])=>{M&&(W1(),H1(),B2("content"),Bn("content"))}),Qe([ze,()=>Vn(),()=>Mo(),zs,()=>it.value.length],([M])=>{M&&(function(W="async-node"){let G=!1;for(const[Y,se]of Array.from(qi.entries()))h1(se)||(qi.delete(Y),Hs.delete(Y),G=!0);G&&(Ua(),Bn(W))})("async-node")},{flush:"post"}),Qe([ze,()=>{var M;return(M=o.virtualScroll)==null?void 0:M.sessionKey},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.measurementKey},()=>o.indexKey,()=>Z.value],([M])=>{M&&(xu(),(function(W="content"){if(!ze.value)return;const G=[],Y=it.value.length;for(const se of Array.from(zn.keys())){if(se>=Y){G.push(se);continue}const Se=pu(se),Me=zn.get(se);Me!=null&&Me!==Se&&G.push(se),zn.set(se,Se)}for(const se of Array.from(zn.keys()))se>=Y&&zn.delete(se);G.length&&((function(se,Se={}){const Me=Array.from(se,Number);Mt(Me,Se)>0&&(function(qe){for(const Re of qe)zn.delete(Re)})(Me)})(G,{notify:!1}),ii(),Cu(),_e.value&&Un(),Fe.value&&Ga(),Bn(W))})("content"))},{flush:"post",immediate:!0}),Qe([ze,()=>it.value.length,()=>Vn(),()=>Mo()],([M,W,G,Y],[se,Se,Me,Le])=>{M&&se&&G===Me&&Y===Le&&W!==Se&&Cu()},{flush:"post"}),Qe([ze,()=>{var M;return(M=o.virtualScroll)==null?void 0:M.heightCache},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.heightCacheWidth},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.restoreState},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.measurementKey},()=>it.value.length,()=>Vn(),K],()=>{G2()},{flush:"post",immediate:!0}),Qe([ze,()=>{var M;return(M=o.virtualScroll)==null?void 0:M.restoreState},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.restoreAnchor},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.measurementKey},()=>it.value.length,()=>Vn(),K],M=>Xn(null,[M],function*([W,G]){if(!W||!G)return;yield mt();const Y=(function(){var se;const Se=(se=o.virtualScroll)==null?void 0:se.restoreAnchor;return Se==null||Se===!1?null:Se===!0?"true":String(Se)})();A1(G,{restoreAnchor:Y!=null,restoreToken:Y??void 0})}),{flush:"post",immediate:!0}),Qe([ze,K,()=>{var M;return(M=o.virtualScroll)==null?void 0:M.restoreState},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.measurementKey}],([M])=>{var W;if(!M)return;const G=(W=o.virtualScroll)==null?void 0:W.restoreState;G&&Zl&&Ql==="restore"&&(V2(G)||(H1(),Zl=null,Ql=null,Bn("resize")))},{flush:"post"}),Qe([ze,()=>it.value.length,()=>Vn(),K],M=>Xn(null,[M],function*([W]){var G;const Y=mu,se=gu;W&&Y&&(yield mt(),!A1(Y,{restoreAnchor:se?.restoreAnchor===!0,restoreToken:(G=se?.restoreToken)!=null?G:"imperative",allowUncapturedAnchor:se?.allowUncapturedAnchor===!0})&&Y2(Y)||(mu=null,gu=null))}),{flush:"post",immediate:!0}),Qe([ze,j,()=>{var M;return(M=o.virtualScroll)==null?void 0:M.settleMode},()=>Vn(),()=>Mo(),zs,t1,k2,()=>co.value,cf,()=>Oe.count,()=>Oe.total],([M,W,G])=>{if(!M||W!==!0||G==="manual"||!y1())return;const Y=(function(){var se;const Se=it.value.length;return[(se=Mo())!=null?se:"",Vn(),ur(),mf.value,Se,Math.round(Zr(0,Se)),Math.round(Gl()),Oe.count,Math.round(Oe.total)].join(":")})();_u!==Y&&(_u=Y,T1({reason:"final"}).then(se=>{se.stable||_u!==Y||(_u=null)}))},{flush:"post",immediate:!0}),Qe([ze,j,()=>{var M;return(M=o.virtualScroll)==null?void 0:M.settleMode},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.settledToken},()=>Vn(),()=>Mo(),zs,t1,k2,()=>co.value,cf,()=>it.value.length,()=>Oe.count,()=>Oe.total],()=>{ob()},{flush:"post",immediate:!0}),Qe([()=>it.value.length,St,En,uu,()=>Ho.start,()=>Ho.end],([M,W,G,Y,se,Se])=>{de.value&&Ne("virtualization",{nodes:M,virtualization:W,maxLiveNodes:G,buffer:Y,focusIndex:si.value,scroll:W?(()=>{const Me=Ue.value||ie();return Me?{reverse:q(Me),scrollTop:Math.round(Me.scrollTop),scrollTopAbs:Math.round(Math.abs(Me.scrollTop)),scrollHeight:Math.round(Me.scrollHeight),clientHeight:Math.round(Me.clientHeight)}:null})():null,liveRange:{start:se,end:Se},rendered:co.value})}),Qe([()=>x.customId],([M],W,G)=>{if(!M||vn)return;const Y=(function(se,Se){return se?(Eo.controllers[se]=Se,()=>{Eo.controllers[se]===Se&&delete Eo.controllers[se]}):()=>{}})(M,{captureRestoreAnchor:Cs,restoreAnchor:Q,getAnchorDrift:xe,getReport:D8});G(()=>{Y()})},{immediate:!0}),po(()=>{(function(){if(ze.value)try{dr(),vu();const M=Yl("manual");Q2(M)&&(L(M),yu=M,I1=ku());const W=Va(M,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});W&&(E(W),W.anchor&&F(W.anchor),Ya=wu(W))}catch{}})(),Y8(),i1(),De(),nb();for(const M of Kr.values())for(const W of M)df(W);Kr.clear(),Vl.clear(),zn.clear(),P1(),Qa(),l1(),rn(),Ka(),O1(),A2(),o1()});const Z8=Li({loader:()=>Xn(null,null,function*(){try{return(yield ms(()=>import("./index11-BiTpnbks.js"),__vite__mapDeps([8,5]))).default}catch(M){return console.warn('[markstream-vue] Optional peer dependencies for MermaidBlockNode are missing. Falling back to preformatted code rendering. To enable Mermaid rendering, please install "mermaid".',M),qs}}),loadingComponent:Eee,delay:0}),Q8=Li({loader:()=>Xn(null,null,function*(){try{return(yield ms(()=>import("./index10-BOW3dYHz.js"),[])).default}catch(M){return console.warn('[markstream-vue] Failed to load InfographicBlockNode. Falling back to preformatted code rendering. To enable Infographic rendering, install "@antv/infographic" and configure setInfographicLoader with a dynamic loader.',M),qs}}),loadingComponent:Mee,delay:0}),X8=Li(()=>Xn(null,null,function*(){try{return(yield ms(()=>import("./index7-CTeSdr9M.js"),[])).default}catch(M){return console.warn('[markstream-vue] Optional peer dependencies for D2BlockNode are missing. Falling back to preformatted code rendering. To enable D2 rendering, please install "@terrastruct/d2".',M),qs}})),sb={text:ro,paragraph:Ma,heading:Ip,code_block:j0,list:qc,list_item:Uc,blockquote:Th,table:hd,definition_list:Nh,footnote:Ih,footnote_reference:Zs,footnote_anchor:dd,admonition:Oh,vmr_container:$h,hardbreak:Ml,link:xs,image:Al,thematic_break:Lh,math_inline:Pi,math_block:GM,strong:ks,emphasis:ws,strikethrough:bs,highlight:Xs,insert:Rs,subscript:Os,superscript:Fs,emoji:$s,checkbox:Ys,checkbox_input:Ys,inline_code:ts,html_inline:Qs,reference:ys,html_block:fd},J8=R(()=>d1()),ib=R(()=>eC(x.codeBlockProps)),eE=R(()=>eC(x.codeBlockProps,{omit:["langs"]})),rb=R(()=>lt(lt({stream:x.codeBlockStream,darkTheme:x.codeBlockDarkTheme,lightTheme:x.codeBlockLightTheme,monacoOptions:x.codeBlockMonacoOptions,themes:x.themes,langs:u.value==="shiki"?x.langs:void 0,minWidth:x.codeBlockMinWidth,maxWidth:x.codeBlockMaxWidth},typeof Ce.value=="boolean"?{showTooltips:Ce.value}:{}),eE.value)),lb=R(()=>lt(Pt(lt({},rb.value),{langs:x.langs}),ib.value));function ab(M){return typeof M=="boolean"?M:void 0}const tE=R(()=>{const M=x.codeBlockProps||{},W={},G=ab(M.showLineNumbers);G!==void 0&&(W.showLineNumbers=G);const Y=ab(M.diffInline);Y!==void 0&&(W.diffInline=Y);const se=(function(Se){const Me=Number(Se);return Number.isFinite(Me)&&Me>0?Me:void 0})(M.reservedHeightPx);return se!==void 0&&(W.reservedHeightPx=se),W}),nE=R(()=>lt(lt({stream:x.codeBlockStream,darkTheme:x.codeBlockDarkTheme,lightTheme:x.codeBlockLightTheme,themes:x.themes,langs:x.langs,minWidth:x.codeBlockMinWidth,maxWidth:x.codeBlockMaxWidth},typeof Ce.value=="boolean"?{showTooltips:Ce.value}:{}),ib.value)),oE=R(()=>lt({},x.mermaidProps||{})),cb=R(()=>lt({},x.d2Props||{})),sE=R(()=>lt({},x.infographicProps||{})),Mu=R(()=>({typewriter:x.typewriter,fade:x.fade,customHtmlTags:lo.value.customHtmlTags})),iE=R(()=>lt(lt({},Mu.value),typeof Ce.value=="boolean"?{showTooltip:Ce.value}:{})),rE=R(()=>lt(lt({},Mu.value),typeof Ce.value=="boolean"?{showTooltips:Ce.value}:{})),lE=R(()=>lt(lt({},Mu.value),typeof Ce.value=="boolean"?{showTooltips:Ce.value}:{})),aE=R(()=>lt(lt({},Mu.value),typeof Ce.value=="boolean"?{showTooltips:Ce.value}:{}));function cE(M){return Array.isArray(M.children)&&M.children.length>0}const z1=R(()=>B8.value.map(M=>{var W,G,Y,se,Se,Me,Le,qe;let Re=(function(at){var ft,Et,At,tn,Lt,qt,zt;if(at.type!=="code_block")return at;const fn=at,Us=[String((ft=fn.language)!=null?ft:""),String((Et=fn.loading)!=null?Et:""),String((At=fn.diff)!=null?At:""),String((tn=fn.code)!=null?tn:""),String((Lt=fn.originalCode)!=null?Lt:""),String((qt=fn.updatedCode)!=null?qt:""),String((zt=fn.raw)!=null?zt:"")].join("\0"),as=Ai.get(fn);if(as&&as.signature===Us)return as.node;const Mi=lt({},fn);return Ai.set(fn,{signature:Us,node:Mi}),Mi})(M.node);const Ge=xf(Re);let je=hb(Re,Ge);if((Re.type==="html_block"||Re.type==="html_inline")&&je===sb[Re.type]){const at=Re,ft=String((W=at.tag)!=null?W:"").trim().toLowerCase()||D6(at.content);if(ft){const Et=Wt.value[ft];if(Hn.value.has(ft)&&Et)je=Et,Re=Pt(lt({},at),{type:ft,tag:ft,content:qV(at.content,ft)});else if(P6((G=at.content)!=null?G:at.raw,ft)){const At=String((se=(Y=at.content)!=null?Y:at.raw)!=null?se:"");Re.type==="html_inline"?(je=ro,Re={type:"text",content:At,raw:At}):(je=Ma,Re={type:"paragraph",children:[{type:"text",content:At,raw:At}],raw:At})}}}const Be=Re.type==="code_block"&&u.value==="pre"&&je===qs&&!U1(Wt.value,Ge);let Ke=lt({},(function(at,ft,Et){const At=ft??xf(at);if(at.type==="code_block"){const tn=At?U1(Wt.value,At):void 0;if(Et&&u.value==="pre"&&!tn&&Et===qs)return tE.value;if(Et&&At&&Et===tn)return At==="mermaid"?db(at):At==="infographic"?fb(at):At==="d2"||At==="d2lang"?cb.value:lb.value;if(Et&&Et===Wt.value.code_block)return lb.value;if(N2(Et))return nE.value}return At==="mermaid"?db(at):At==="infographic"?fb(at):At==="d2"||At==="d2lang"?cb.value:at.type==="link"?iE.value:at.type==="list"?rE.value:at.type==="blockquote"?lE.value:at.type==="table"?aE.value:at.type==="code_block"?rb.value:Mu.value})(Re,Ge,je));const tt=Kl.value[M.index];Re.type==="code_block"&&tt?.kind==="code-block"&&(Ke=Pt(lt({},Ke),Be?{reservedHeightPx:(Se=tt.height)!=null?Se:tt.contentHeight}:{estimatedHeightPx:tt.height,estimatedContentHeightPx:tt.contentHeight})),Be||Re.type!=="code_block"||Ge!=="mermaid"||Ec(Ke.estimatedPreviewHeightPx)!=null||(Ke=Pt(lt({},Ke),{estimatedPreviewHeightPx:_v(xv(String((Me=Re.code)!=null?Me:"")))})),Be||Re.type!=="code_block"||Ge!=="infographic"||Ec(Ke.estimatedPreviewHeightPx)!=null||(Ke=Pt(lt({},Ke),{estimatedPreviewHeightPx:Sv(wv(String((Le=Re.code)!=null?Le:"")))})),Re.type==="math_block"&&(Ke=Pt(lt({},Ke),{cacheScope:ns.value}));const nt=(function(at,ft){const Et=String(at.type);return!ef(Et)&&Wt.value[Et]===ft})(Re,je),wt=nt?_k(Re,Ie.value):void 0;return Pt(lt({},M),{node:Re,component:je,bindings:Ke,customBindings:lt(lt({},wt??{}),Ke),rendersCustomNode:nt,hasSlotChildren:cE(Re),slotContent:String((qe=Re.content)!=null?qe:""),isCodeBlock:Re.type==="code_block",indexKey:`${J8.value}-${M.index}`})}));function xf(M){var W;return M?.type==="code_block"?String((W=M.language)!=null?W:"").trim().toLowerCase():""}function U1(M,W){const G=W.trim().toLowerCase();if(G)for(const Y of[G,gk(G),$M(G)]){const se=Y&&M[Y];if(se)return se}}function ub(M,W,G,Y){var se,Se;const Me=lt({},M.value);return Ec(Me.estimatedPreviewHeightPx)==null&&(Me.estimatedPreviewHeightPx=Y(G(String((se=W?.code)!=null?se:"")),void 0,Me.maxHeight==="none"?null:(Se=Ec(Me.maxHeight))!=null?Se:void 0)),Me}function db(M){return ub(oE,M,xv,_v)}function fb(M){return ub(sE,M,wv,Sv)}function hb(M,W){if(!M)return Fv;const G=Wt.value,Y=G[String(M.type)];if(M.type==="code_block"){const se=W??xf(M),Se=se?U1(G,se):void 0;return Se||(u.value==="pre"?G.code_block||qs:se==="mermaid"?G.mermaid||Z8:se==="infographic"?G.infographic||Q8:se==="d2"||se==="d2lang"?G.d2||X8:Y||G.code_block||I2.value)}return Y||sb[String(M.type)]||Fv}function q1(M){s("click",M)}function uE(M){var W;(W=M.target)!=null&&W.closest("[data-node-index]")&&s("mouseover",M)}function dE(M){var W;(W=M.target)!=null&&W.closest("[data-node-index]")&&s("mouseout",M)}function pb(M){s("mouseover",M)}function mb(M){s("mouseout",M)}const ea=J(null),Vi=J(!1);let Eu,Ja=null,j1=0,wf=0,_f=0;const gb=["code_block","admonition","table","math_block","html_block","image","thematic_break"],fE=new Set(gb),vb=[".typewriter-cursor",".height-estimation-probes",...gb.map(M=>`[data-node-type="${M}"]`),"script","style"].join(",");function yb(M){if(!M||typeof M!="object")return!1;const W=M.type;return typeof W=="string"&&fE.has(W)}function Sf(M){var W,G;if(!M||typeof M!="object")return 0;const Y=M,se=(G=(W=Y.raw)!=null?W:Y.content)!=null?G:Y.code;if(typeof se=="string")return se.length;const Se=Y.children;if(Array.isArray(Se))return Se.reduce((Le,qe)=>Le+Sf(qe),0);const Me=Y.items;return Array.isArray(Me)?Me.reduce((Le,qe)=>Le+Sf(qe),0):0}function Cf(){Eu&&(clearTimeout(Eu),Eu=void 0)}function kb(){j1+=1,Ja!=null&&(jn?.(Ja),Ja=null)}function Af(){kb(),ea.value&&(ea.value.style.visibility="hidden")}function hE(M){var W;if(M.nodeType!==Node.TEXT_NODE||!((W=M.textContent)!=null?W:"").trim())return!1;const G=M.parentElement;return!!G&&!G.closest(vb)}function pE(M){let W=M.lastChild;for(;W;){if(hE(W))return W;if(W.nodeType===Node.ELEMENT_NODE){const G=W;if(!G.matches(vb)&&G.lastChild){W=G.lastChild;continue}}for(;W&&W!==M&&!W.previousSibling;)W=W.parentNode;if(!W||W===M)break;W=W.previousSibling}return null}function V1(){if(!ne||!Vi.value||Ja!=null)return;const M=j1,W=()=>{Ja=null,M===j1&&(function(){var G,Y;if(!(ne&&Vi.value&&S.value&&ea.value))return;const se=S.value,Se=ea.value;Se.style.visibility="hidden";const Me=(function(){const je=z1.value;for(let Be=je.length-1;Be>=0;Be--){const Ke=je[Be];if(!Ke||yb(Ke.node)||!B1(Ke.index))continue;const tt=no.get(Ke.index);if(!tt)continue;const nt=pE(tt);if(nt)return nt}return null})();if(!Me)return;let Le=0,qe=0,Re=20,Ge=!1;if(Me?.textContent){const je=Me.textContent.length,Be=document.createRange();Be.setStart(Me,Math.max(0,je-1)),Be.setEnd(Me,je);const Ke=typeof Be.getClientRects=="function"?Be.getClientRects():void 0,tt=(Y=Ke?.[Ke.length-1])!=null?Y:(G=Me.parentElement)==null?void 0:G.getBoundingClientRect();if(tt){const nt=ht("typewriterCursor.root.getBoundingClientRect",()=>se.getBoundingClientRect());Le=tt.right-nt.left+se.scrollLeft,qe=tt.top-nt.top+se.scrollTop,Re=tt.height||Re,Ge=!0}Be.detach()}Ge&&(Se.style.transform=`translate(${Math.max(0,Le)}px, ${Math.max(0,qe)}px)`,Se.style.height=`${Re}px`,Se.style.visibility="visible")})()};Tn?Ja=Tn(W):W()}return Qe([ve,()=>o.content,()=>o.nodes,()=>x.typewriter,j],()=>Xn(null,null,function*(){var M,W;if(!ne||ue.value||!z.value)return;if(j.value)return Vi.value=!1,Cf(),void Af();if((M=o.nodes)!=null&&M.length)return Vi.value=!1,Cf(),Af(),wf=((W=o.content)!=null?W:"").length,void(_f=ve.value.length);const G=(function(){var Le,qe;return(Le=o.nodes)!=null&&Le.length?o.nodes.reduce((Re,Ge)=>Re+Sf(Ge),0):((qe=o.content)!=null?qe:"").length})(),Y=(function(){var Le;return(Le=o.nodes)!=null&&Le.length?o.nodes.reduce((qe,Re)=>qe+Sf(Re),0):ve.value.length})(),se=!yb(it.value[it.value.length-1]),Se=G>wf,Me=Y>_f;if(x.typewriter===!1||!se||!Se&&!Me)return x.typewriter!==!1&&se||(Vi.value=!1,Af()),wf=G,void(_f=Y);wf=G,_f=Y,Vi.value=!0,ea.value&&(ea.value.style.visibility="hidden"),Cf(),yield mt(),V1(),Eu=setTimeout(()=>{Eu=void 0,Vi.value=!1},3e3)}),{flush:"post",immediate:!0}),Qe(Vi,M=>Xn(null,null,function*(){M?(yield mt(),V1()):Af()}),{flush:"post"}),Qe([()=>co.value,()=>Ho.start,()=>Ho.end],()=>Xn(null,null,function*(){ne&&!ue.value&&z.value&&Vi.value&&(yield mt(),V1())}),{flush:"post"}),po(()=>{Cf(),kb(),dn.clear()}),(M,W)=>{const G=WT("NodeRenderer",!0);return C(ue)?(w(!0),T(Pe,{key:0},ot(z1.value,Y=>(w(),T(Pe,{key:Y.index},[Y.rendersCustomNode?(w(),we(jo(Y.component),yn({key:0,ref_for:!0},Y.customBindings,{node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey,"custom-id":x.customId,"is-dark":x.isDark,onClick:q1,onMouseover:pb,onMouseout:mb,onCopy:W[0]||(W[0]=se=>s("copy",se)),onHandleArtifactClick:W[1]||(W[1]=se=>s("handleArtifactClick",se))}),{default:Ee(()=>[Y.hasSlotChildren?(w(),we(G,yn({key:0,ref_for:!0},Gn.value,{nodes:Y.node.children,"index-key":Y.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):Y.slotContent?(w(),we(G,yn({key:1,ref_for:!0},Gn.value,{content:Y.slotContent,final:!Y.node.loading,"index-key":`${Y.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ce("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(w(),we(jo(Y.component),yn({key:1,node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey},{ref_for:!0},Y.bindings,{"custom-id":x.customId,"is-dark":x.isDark,onClick:q1,onMouseover:pb,onMouseout:mb,onCopy:W[2]||(W[2]=se=>s("copy",se)),onHandleArtifactClick:W[3]||(W[3]=se=>s("handleArtifactClick",se))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(w(),T("div",{key:1,ref_key:"containerRef",ref:S,class:We(["markstream-vue markdown-renderer",[{dark:x.isDark},{virtualized:St.value},{"virtual-scroll-coordinated":Xe.value}]]),"data-custom-id":x.customId,onClick:q1,onMouseover:uE,onMouseout:dE},[Ht.value||St.value?(w(),T(Pe,{key:0},[Ht.value?(w(),T("div",{key:0,class:"height-estimation-probes",style:Yt({width:`${Wn.value}px`}),"aria-hidden":"true"},[_("div",{ref_key:"paragraphProbeWrapperRef",ref:N,class:"node-content","data-probe":"paragraph"},[re(C(Ma),{node:go.value,"index-key":"probe-paragraph"},null,8,["node"])],512),_("div",{ref_key:"listItemProbeWrapperRef",ref:D,class:"node-content","data-probe":"list-item"},[_("ul",Nee,[re(C(Uc),{node:os.value,"index-key":"probe-list-item"},null,8,["node"])])],512),_("div",{ref_key:"listProbeWrapperRef",ref:B,class:"node-content","data-probe":"list"},[re(C(qc),{node:qn.value,"index-key":"probe-list"},null,8,["node"])],512),(w(),T(Pe,null,ot(6,Y=>_("div",{key:`probe-heading-${Y}`,ref_for:!0,ref:se=>(function(Se,Me){Se<1||Se>6||(U[Se]=Me)})(Y,se),class:"node-content","data-probe":`heading-${Y}`},[re(C(Ip),{node:F8(Y),"index-key":`probe-heading-${Y}`},null,8,["node","index-key"])],8,Iee)),64))],4)):ce("",!0),St.value?(w(),T("div",{key:1,class:"node-spacer",style:Yt({height:`${c1.value}px`}),"aria-hidden":"true"},null,4)):ce("",!0)],64)):ce("",!0),(w(!0),T(Pe,null,ot(z1.value,Y=>(w(),T("div",{key:Y.index,ref_for:!0,ref:se=>tb(Y.index,se),class:"node-slot","data-node-index":Y.index,"data-node-type":Y.node.type},[B1(Y.index)?(w(),T("div",{key:0,ref_for:!0,ref:se=>(function(Se,Me){var Le;Me||(function(je){const Be=`${d1()}-${je}`;let Ke=!1;for(const tt of Array.from(Hs.keys())){const nt=qi.get(tt);(nt?.index===je||tt===Be||tt.startsWith(`${Be}-`))&&(Hs.delete(tt),qi.delete(tt),Ke=!0)}Ke&&(Ua(),Bn("async-node"))})(Se),cr.delete(Se),(function(je){var Be;const Ke=((Be=Vl.get(je))!=null?Be:0)+1;Vl.set(je,Ke)})(Se);const qe=Kr.get(Se);if(qe){for(const je of qe)df(je);Kr.delete(Se)}if((function(je){const Be=is.get(je);Be&&(Lo?.unobserve(Be),rs.delete(Be),is.delete(je))})(Se),!Me||!Po.value)return Ui.delete(Se),void Vl.delete(Se);Ui.set(Se,Me);const Re=()=>{bf(Se,Me)};queueMicrotask(Re);const Ge=(Lo||typeof ResizeObserver>"u"||(Lo=new ResizeObserver(je=>{if(je.length)for(const Be of je){const Ke=rs.get(Be.target),tt=is.get(Ke??-1);Ke!=null&&tt&&bf(Ke,tt)}else dr()})),Lo);if(Ge&&(is.set(Se,Me),rs.set(Me,Se),Ge.observe(Me)),typeof window<"u"){const je=((Le=it.value[Se])==null?void 0:Le.type)==="code_block"?[16,80,240,800]:j.value?[80]:[];if(je.length){const Be=je.map(Ke=>_2(Ke,Re,"node-resize")).filter(Ke=>Ke!=null);Be.length&&Kr.set(Se,Be)}}})(Y.index,se),class:"node-content"},[Y.isCodeBlock?Y.rendersCustomNode?(w(),we(jo(Y.component),yn({key:1,ref_for:!0},Y.customBindings,{node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey,"custom-id":x.customId,"is-dark":x.isDark,onCopy:W[8]||(W[8]=se=>s("copy",se)),onHandleArtifactClick:W[9]||(W[9]=se=>s("handleArtifactClick",se))}),{default:Ee(()=>[Y.hasSlotChildren?(w(),we(G,yn({key:0,ref_for:!0},Gn.value,{nodes:Y.node.children,"index-key":Y.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):Y.slotContent?(w(),we(G,yn({key:1,ref_for:!0},Gn.value,{content:Y.slotContent,final:!Y.node.loading,"index-key":`${Y.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ce("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(w(),we(jo(Y.component),yn({key:2,node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey},{ref_for:!0},Y.bindings,{"custom-id":x.customId,"is-dark":x.isDark,onCopy:W[10]||(W[10]=se=>s("copy",se)),onHandleArtifactClick:W[11]||(W[11]=se=>s("handleArtifactClick",se))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(w(),we(Il,{key:0,name:"fade",css:x.fade!==!1,appear:x.fade!==!1},{default:Ee(()=>[Y.rendersCustomNode?(w(),we(jo(Y.component),yn({key:0,ref_for:!0},Y.customBindings,{node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey,"custom-id":x.customId,"is-dark":x.isDark,onCopy:W[4]||(W[4]=se=>s("copy",se)),onHandleArtifactClick:W[5]||(W[5]=se=>s("handleArtifactClick",se))}),{default:Ee(()=>[Y.hasSlotChildren?(w(),we(G,yn({key:0,ref_for:!0},Gn.value,{nodes:Y.node.children,"index-key":Y.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):Y.slotContent?(w(),we(G,yn({key:1,ref_for:!0},Gn.value,{content:Y.slotContent,final:!Y.node.loading,"index-key":`${Y.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ce("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(w(),we(jo(Y.component),yn({key:1,node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey},{ref_for:!0},Y.bindings,{"custom-id":x.customId,"is-dark":x.isDark,onCopy:W[6]||(W[6]=se=>s("copy",se)),onHandleArtifactClick:W[7]||(W[7]=se=>s("handleArtifactClick",se))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(w(),T("div",{key:1,class:"node-placeholder",style:Yt({height:`${pf(Y.index)}px`})},null,4))],8,Lee))),128)),Vi.value?(w(),T("span",{key:1,ref_key:"typewriterCursorRef",ref:ea,class:"typewriter-cursor","aria-hidden":"true"},null,512)):ce("",!0),St.value?(w(),T("div",{key:2,class:"node-spacer",style:Yt({height:`${u1.value}px`}),"aria-hidden":"true"},null,4)):ce("",!0)],42,Tee))}}})),[["__scopeId","data-v-2e8e6e17"]]),Bs=l5;Bs.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",Bs.__name,Bs.name].filter(n=>!!n));for(const n of t)e.component(n,l5)};const Nk=Object.freeze(Object.defineProperty({__proto__:null,default:Bs},Symbol.toStringTag,{value:"Module"})),$ee={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"},Fee={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"},Oee={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"},Ree={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"},Bee={class:"admonition-title"},Dee=["aria-expanded","aria-controls"],Pee=["id"],Oh=gn(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 o=e,s=t,i=R(()=>{if(o.node.title&&o.node.title.trim().length)return o.node.title;const c=o.node.kind||"note";return c.charAt(0).toUpperCase()+c.slice(1)}),r=J(!!o.node.collapsible&&!((n=o.node.open)==null||n));function l(){o.node.collapsible&&(r.value=!r.value)}const a=`admonition-${Math.random().toString(36).slice(2,9)}`;return(c,u)=>(w(),T("div",{class:We(["admonition",[`admonition-${o.node.kind}`]])},[_("div",{id:a,class:"admonition-legend"},[o.node.kind==="note"||o.node.kind==="info"?(w(),T("svg",$ee,[...u[1]||(u[1]=[_("circle",{cx:"12",cy:"12",r:"10"},null,-1),_("path",{d:"M12 16v-4"},null,-1),_("path",{d:"M12 8h.01"},null,-1)])])):o.node.kind==="tip"?(w(),T("svg",Fee,[...u[2]||(u[2]=[_("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),_("path",{d:"M9 18h6"},null,-1),_("path",{d:"M10 22h4"},null,-1)])])):o.node.kind==="warning"||o.node.kind==="caution"?(w(),T("svg",Oee,[...u[3]||(u[3]=[_("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),_("path",{d:"M12 9v4"},null,-1),_("path",{d:"M12 17h.01"},null,-1)])])):o.node.kind==="danger"||o.node.kind==="error"?(w(),T("svg",Ree,[...u[4]||(u[4]=[_("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),_("path",{d:"M12 8v4"},null,-1),_("path",{d:"M12 16h.01"},null,-1)])])):ce("",!0),_("span",Bee,O(i.value),1),o.node.collapsible?(w(),T("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${a}-content`,onClick:l},[(w(),T("svg",{style:Yt({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]=[_("path",{d:"m9 18 6-6-6-6"},null,-1)])],4))],8,Dee)):ce("",!0)]),Fn(_("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[re(C(Bs),{"index-key":`admonition-${e.indexKey}`,nodes:o.node.children,"custom-id":o.customId,typewriter:o.typewriter,fade:o.fade,onCopy:u[0]||(u[0]=d=>s("copy",d))},null,8,["index-key","nodes","custom-id","typewriter","fade"])],8,Pee),[[mi,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);Oh.install=e=>{e.component(Oh.__name,Oh)};const a5=()=>ms(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let sh=null,Hee=a5;function p_e(){return Xn(this,null,function*(){if(sh)return sh;const e=Hee;if(!e)return null;let t;try{t=yield e()}catch(n){throw e===a5?new Error('Optional dependency "@terrastruct/d2" is not installed. Please install it to enable D2 diagrams.'):n}return t?(sh=(function(n){var o;if(!n)return n;if(n.D2&&typeof n.D2=="function")return n.D2;if(n.default&&n.default.D2&&typeof n.default.D2=="function")return n.default.D2;const s=(o=n.default)!=null?o:n;return typeof s=="function"?s:s?.D2&&typeof s.D2=="function"?s.D2:s})(t),sh):null})}function m_e(){return!1}function g_e(){return Xn(this,null,function*(){return null})}const ih=J(!1);let dC=!1;function tg(){const e=document.documentElement.dataset.colorScheme;return e==="dark"?!0:e==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function Wee(){return!dC&&typeof window<"u"&&typeof document<"u"&&(dC=!0,ih.value=tg(),new MutationObserver(()=>{ih.value=tg()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{ih.value=tg()})),ih}const c5=["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"],zee=new Set(["AGENTS.md","CHANGELOG.md","Dockerfile","LICENSE","Makefile","README.md","package.json","pnpm-lock.yaml","pnpm-workspace.yaml","tsconfig.json","vite.config.ts"]),Pv=[...c5].sort((e,t)=>t.length-e.length).join("|"),ng=new RegExp([String.raw`(?:^|[\s([{"'`+"`"+String.raw`])`,String.raw`(`,String.raw`(?:~|\.{1,2}|/)?(?:[A-Za-z0-9_.@+()[\]-]+/)+[A-Za-z0-9_.@+()[\]-]+(?:\.(?:${Pv}))?`,String.raw`|`,String.raw`[A-Za-z0-9_.@+()[\]-]+\.(?:${Pv})`,String.raw`)`,String.raw`(?:#L?(\d+)|:(\d+))?`,String.raw`(?=$|[\s)"'\]}>.,;!?,。;!?)])`].join(""),"gi"),u5=/[),.;!?,。;!?)]+$/;function Uee(e){const t=e.toLowerCase();return c5.some(n=>t.endsWith(`.${n}`))}function qee(e){const t=new Map,n=new RegExp(String.raw`\b(?:path|src)=["'](\/[^"']+\.(?:${Pv}))["']`,"gi");let o;for(;(o=n.exec(e))!==null;){const s=o[1];if(!s)continue;const i=s.split("/").pop();i&&t.set(i,s)}return t}function jee(e,t={}){const n=e.trim();if(!n||/^[a-z][a-z0-9+.-]*:\/\//i.test(n))return null;const o=n.match(/^(.*?)(?:#L?(\d+)|:(\d+))?$/i);if(!o)return null;let s=(o[1]??"").replace(u5,"");if(!s)return null;const i=s.split("/").pop()??s,r=s.includes("/"),l=zee.has(i),a=Uee(i);if(r&&!l&&!a)return null;if(!r&&!l){const d=t.aliases?.get(i);if(!d)return null;s=d}const c=o[2]??o[3],u=c?Number(c):void 0;return{path:s,line:u!==void 0&&Number.isFinite(u)&&u>0?u:void 0}}function Vee(e,t={}){const n=[];ng.lastIndex=0;let o;for(;(o=ng.exec(e))!==null;){const s=o[0]??"",i=o[1]??"",r=s.indexOf(i);if(r<0)continue;const l=o[2]??o[3];let a=i+(l?s.slice(r+i.length):"");const c=a.replace(u5,""),u=a.length-c.length;a=c;const d=jee(a,t);if(!d)continue;const f=o.index+r,h=f+a.length;n.push({...d,start:f,end:h,text:a}),u>0&&(ng.lastIndex-=u)}return n}const Kee=12e4,Gee=6e4,Yee=32,Zee=3e4,fC=/(^|\n)(`{3,}|~{3,})[^\n]*\n([\s\S]*?)(?:\n)?\2(?=\n|$)/g;function Qee(e){let t=0,n=0,o=0;fC.lastIndex=0;let s;for(;(s=fC.exec(e))!==null;){const r=s[3]??"";t+=1,n+=r.length,o=Math.max(o,r.length)}return{codeRenderer:e.length>=Kee||n>=Gee||t>=Yee||o>=Zee?"pre":"shiki",codeFenceCount:t,codeChars:n}}function Xee(e){return new Worker("/assets/katexRenderer.worker-CO_gEm4q.js",{type:"module",name:e?.name})}function Jee(e){return new Worker("/assets/mermaidParser.worker-Dx4jPi9z.js",{type:"module",name:e?.name})}const ete={key:1,class:"diff-wrap"},tte={class:"diff-bar"},nte=["aria-label","onClick"],ote={class:"diff-pre"},ste={key:0,class:"diff-sign"},ite={class:"diff-text"},rte="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",hC="github-light",pC="github-dark",lte=Ze({__name:"Markdown",props:{text:{},openFile:{},streaming:{type:Boolean,default:!1}},setup(e){RQ(),YQ(),DQ(),eX(),BQ(new Xee),JQ(new Jee);function t(B){return B.inline.ruler.disable("math"),B}const{t:n}=Tt(),o=Kt("resolveImage"),s=J(null),i=e,r=R(()=>!i.streaming),l=R(()=>qee(i.text??"")),a=R(()=>i.streaming?{codeRenderer:"shiki",codeFenceCount:0,codeChars:0}:Qee(i.text??"")),c=Wee(),u=R(()=>!i.streaming),d=Bo(new Map),f=new Set,h=/(!\[[^\]]*\]\()\s*([^)\s]+)([^)]*\))/g,p=/(<img\b[^>]*?\bsrc=")([^"]+)(")/gi;function g(B){return!/^(https?:|data:|blob:)/i.test(B)}function b(B){if(!o)return;const U=[];for(const H of[h,p]){H.lastIndex=0;let P;for(;(P=H.exec(B))!==null;)U.push(P[2]??"")}for(const H of U)!H||!g(H)||d.has(H)||f.has(H)||(f.add(H),o(H).then(P=>{d.set(H,P!==H?P:"")}).catch(()=>{d.set(H,"")}).finally(()=>{f.delete(H)}))}function v(B){if(!o)return B;const U=H=>{if(!g(H))return null;const P=d.get(H);return P===void 0?rte:P===""?null:P};return B.replace(h,(H,P,Z,K)=>{const V=U(Z);return V===null?H:`${P}${V}${K}`}).replace(p,(H,P,Z,K)=>{const V=U(Z);return V===null?H:`${P}${V}${K}`})}Qe(()=>i.text,B=>b(B??""),{immediate:!0});function m(){if(!s.value||!i.openFile||i.streaming)return;const B=document.createTreeWalker(s.value,NodeFilter.SHOW_TEXT),U=[];let H=B.nextNode();for(;H;){const P=H,Z=P.parentElement;Z&&!Z.closest("a, pre, .md-file-link, svg")&&P.data.trim().length>0&&U.push(P),H=B.nextNode()}for(const P of U){const Z=Vee(P.data,{aliases:l.value});if(Z.length===0||!P.parentNode)continue;const K=document.createDocumentFragment();let V=0;for(const X of Z){X.start>V&&K.append(document.createTextNode(P.data.slice(V,X.start)));const he=document.createElement("button");he.type="button",he.className="md-file-link",he.textContent=X.text,he.title=X.line?`${X.path}:${X.line}`:X.path,he.addEventListener("click",ne=>{ne.preventDefault(),ne.stopPropagation(),i.openFile?.({path:X.path,line:X.line})}),K.append(he),V=X.end}V<P.data.length&&K.append(document.createTextNode(P.data.slice(V))),P.parentNode.replaceChild(K,P)}}function y(B){return!(!B||/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(B))}function k(B){let U=B.length;for(const H of["#","?"]){const P=B.indexOf(H);P!==-1&&P<U&&(U=P)}return B.slice(0,U)}function A(){if(!s.value||!i.openFile||i.streaming)return;const B=s.value.querySelectorAll("a[href]");for(const U of B){if(U.dataset.mdLinkHandled==="true"||U.closest("svg"))continue;const H=U.getAttribute("href")??"";y(H)&&(U.dataset.mdLinkHandled="true",U.addEventListener("click",P=>{P.preventDefault(),P.stopPropagation(),i.openFile?.({path:k(H)})}))}}function $(){mt().then(()=>{m(),A()})}Qe(()=>i.text,$),Qe(()=>i.streaming,$);let I=null;cn(()=>{$(),s.value&&(I=new MutationObserver($),I.observe(s.value,{childList:!0,subtree:!0}))}),bn(()=>{I?.disconnect()});const x={showHeader:!0,showCopyButton:!0,showExpandButton:!1,showPreviewButton:!1,showCollapseButton:!1,showFontSizeButtons:!1,loading:!1};function L(B){const U=typeof navigator<"u"?navigator.clipboard:void 0;U&&typeof U.writeText=="function"||Go(B)}const E=/(^|\n)(?:```|~~~)diff\b[^\n]*\n([\s\S]*?)(?:\n)?(?:```|~~~)(?=\n|$)/g,F=R(()=>{const B=v(i.text??""),U=[];let H=0;E.lastIndex=0;let P;for(;(P=E.exec(B))!==null;){const K=P[1]??"",V=B.slice(H,P.index)+(K||"");V.trim()&&U.push({kind:"md",text:V}),U.push({kind:"diff",code:P[2]??""}),H=E.lastIndex}const Z=B.slice(H);return(Z.trim()||U.length===0)&&U.push({kind:"md",text:Z}),U});function S(B){return B.split(`
281
+ `).map(U=>U.startsWith("@@")?{type:"hunk",sign:"",text:U}:/^\+(?!\+\+)/.test(U)?{type:"add",sign:"+",text:U.slice(1)}:/^-(?!--)/.test(U)?{type:"del",sign:"-",text:U.slice(1)}:U.startsWith(" ")?{type:"ctx",sign:"",text:U.slice(1)}:{type:"ctx",sign:"",text:U})}const N=J(null);function D(B,U){Go(B).then(H=>{H&&(N.value=U,setTimeout(()=>{N.value=null},1400))})}return(B,U)=>(w(),T("div",{ref_key:"mdRef",ref:s,class:"md"},[(w(!0),T(Pe,null,ot(F.value,(H,P)=>(w(),T(Pe,{key:P},[H.kind==="md"?(w(),we(C(Bs),{key:0,content:H.text,"custom-markdown-it":t,mode:"chat","code-renderer":a.value.codeRenderer,"is-dark":C(c),"code-block-light-theme":hC,"code-block-dark-theme":pC,themes:[hC,pC],"code-block-props":x,final:r.value,"smooth-streaming":e.streaming,"batch-rendering":u.value,"defer-nodes-until-visible":!1,onCopy:L},null,8,["content","code-renderer","is-dark","themes","final","smooth-streaming","batch-rendering"])):(w(),T("div",ete,[_("div",tte,[U[0]||(U[0]=_("span",{class:"diff-lang"},"diff",-1)),re(Xt,{text:C(n)("filePreview.copyCode")},{default:Ee(()=>[_("button",{class:"diff-copy","aria-label":C(n)("filePreview.copyCode"),onClick:Z=>D(H.code,P)},[re(Ve,{name:N.value===P?"check":"copy",size:"sm"},null,8,["name"])],8,nte)]),_:2},1032,["text"])]),_("pre",ote,[_("code",null,[(w(!0),T(Pe,null,ot(S(H.code),(Z,K)=>(w(),T("span",{key:K,class:We(["diff-line",`diff-${Z.type}`])},[Z.type!=="hunk"?(w(),T("span",ste,O(Z.sign),1)):ce("",!0),_("span",ite,O(Z.text),1)],2))),128))])])]))],64))),128))],512))}}),Wm=ct(lte,[["__scopeId","data-v-fbd17874"]]),ate={class:"tc-anim"},cte={class:"prev-anim"},ute={class:"prev"},dte=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,o=t,s=R(()=>n.text.split(/\n{2,}/).filter(c=>c.trim().length>0)),i=R(()=>n.foldable&&s.value.length>1),r=R(()=>n.streaming||!i.value),l=R(()=>s.value.at(-1)??""),a=J(null);return cn(()=>{if(!n.streaming)return;const c=a.value;c&&(c.scrollTop=c.scrollHeight)}),Qe(()=>n.text,()=>{const c=a.value;!c||!(c.scrollHeight-c.scrollTop-c.clientHeight<24)||mt(()=>{a.value&&(a.value.scrollTop=a.value.scrollHeight)})},{immediate:!0}),(c,u)=>(w(),T("div",{class:We(["think",{mob:e.mobile}])},[i.value?(w(),T("div",{key:0,class:We(["tc-wrap",{"is-collapsed":!r.value}]),onClick:u[0]||(u[0]=d=>o("open"))},[_("div",ate,[_("pre",{ref_key:"bodyEl",ref:a,class:"tc"},O(e.text),513)]),_("div",cte,[_("span",ute,O(l.value),1)])],2)):(w(),T("pre",{key:1,ref_key:"bodyEl",ref:a,class:"tc"},O(e.text),513))],2))}}),fte=ct(dte,[["__scopeId","data-v-fdc551ea"]]),hte={class:"activity-notice",role:"status"},pte={"aria-hidden":"true"},mte={class:"an-label"},gte=Ze({__name:"ActivityNotice",props:{label:{}},setup(e){return(t,n)=>(w(),T("div",hte,[_("span",pte,[re(Ds,{size:"sm"})]),_("span",mte,O(e.label),1)]))}}),vte=ct(gte,[["__scopeId","data-v-0d497074"]]);function yte(e,t="昨天"){try{const n=new Date(e);if(Number.isNaN(n.getTime()))return e;const o=new Date,s=u=>String(u).padStart(2,"0"),i=`${s(n.getHours())}:${s(n.getMinutes())}`,r=n.getFullYear()===o.getFullYear(),l=n.getMonth()===o.getMonth(),a=n.getDate()===o.getDate();if(r&&l&&a)return i;const c=new Date(o);return c.setDate(o.getDate()-1),n.getFullYear()===c.getFullYear()&&n.getMonth()===c.getMonth()&&n.getDate()===c.getDate()?`${t} ${i}`:r?`${s(n.getMonth()+1)}-${s(n.getDate())} ${i}`:`${n.getFullYear()}-${s(n.getMonth()+1)}-${s(n.getDate())} ${i}`}catch{return e}}const kte=Ze({__name:"MessageTime",props:{time:{}},setup(e){const t=e,{t:n}=Tt(),o=J(!1),s=R(()=>{const l=new Date(t.time);if(Number.isNaN(l.getTime()))return t.time;const a=c=>String(c).padStart(2,"0");return`${l.getFullYear()}-${a(l.getMonth()+1)}-${a(l.getDate())} ${a(l.getHours())}:${a(l.getMinutes())}`}),i=R(()=>o.value?s.value:yte(t.time,n("conversation.yesterday")));function r(){o.value=!o.value}return(l,a)=>(w(),T("button",{type:"button",class:"msg-time",onClick:bt(r,["stop"])},O(i.value),1))}}),d5=ct(kte,[["__scopeId","data-v-9672fbd5"]]);function bte(e){return e.length===1?`0${e}`:e}function xte(e,t){return`${String(Number(e))}:${bte(t)}`}const mC=e=>/^\d+$/.test(e);function wte(e,t){const n=e.trim().split(/\s+/);if(n.length!==5)return e;const[o,s,i,r,l]=n,a=i==="*"&&r==="*"&&l==="*",c=i==="*"&&r==="*";if(o==="*"&&s==="*"&&a)return t("conversation.cron.everyMinute");const u=/^\*\/(\d+)$/.exec(o);if(u&&s==="*"&&a)return u[1]==="1"?t("conversation.cron.everyMinute"):t("conversation.cron.everyNMinutes",{n:u[1]});if(o==="0"&&s==="*"&&a)return t("conversation.cron.everyHour");const d=/^\*\/(\d+)$/.exec(s);if(o==="0"&&d&&a)return t("conversation.cron.everyNHours",{n:d[1]});if(mC(o)&&mC(s)&&c){const f=xte(s,o);if(l==="1-5")return t("conversation.cron.weekdaysAt",{time:f});if(l==="*")return t("conversation.cron.dailyAt",{time:f})}return e}const _te=["data-turn-id"],Ste={class:"cn-bubble"},Cte={class:"cn-title"},Ate={key:0,class:"cn-prompt"},Mte={class:"cn-meta"},Ete={key:0,class:"cn-meta-item"},Tte={key:1,class:"cn-meta-item"},Nte=["aria-label"],Ite=["title"],Lte=Ze({__name:"CronNotice",props:{text:{},cron:{},turnId:{},createdAt:{}},setup(e){const t=e,{t:n}=Tt(),o=R(()=>t.cron),s=R(()=>o.value?.missedCount!==void 0),i=R(()=>s.value?n("conversation.cron.missed"):n("conversation.cron.fired")),r=R(()=>{const u=o.value?.cron;return u?wte(u,n):""}),l=R(()=>s.value?"error":"ok"),a=R(()=>{const u=o.value;if(!u)return"";const d=[];return u.recurring===!1&&d.push(n("conversation.cron.oneShot")),typeof u.coalescedCount=="number"&&u.coalescedCount>1&&d.push(n("conversation.cron.coalesced",{n:u.coalescedCount})),u.missedCount!==void 0&&d.push(n("conversation.cron.missedCount",{n:u.missedCount})),u.stale===!0&&d.push(n("conversation.cron.finalDelivery")),d.join(" · ")}),c=R(()=>t.text??"");return(u,d)=>(w(),T("div",{class:We(["cn cron-notice",{"turn-anchor":!!e.turnId}]),"data-turn-id":e.turnId,role:"status"},[_("div",Ste,[_("span",Cte,O(i.value),1),c.value?(w(),T("span",Ate,O(c.value),1)):ce("",!0)]),_("div",Mte,[re(Ve,{name:"clock",size:"sm",class:"cn-meta-ico","aria-hidden":"true"}),r.value?(w(),T("span",Ete,O(r.value),1)):ce("",!0),a.value?(w(),T("span",Tte,O(a.value),1)):ce("",!0),_("span",{class:We(["cn-status",l.value]),"aria-label":l.value},[l.value==="ok"?(w(),we(Ve,{key:0,name:"check",size:"sm"})):(w(),we(Ve,{key:1,name:"close",size:"sm"}))],10,Nte),o.value?.jobId?(w(),T("span",{key:2,class:"cn-meta-item cn-id",title:C(n)("conversation.cron.job",{id:o.value.jobId})},O(o.value.jobId),9,Ite)):ce("",!0),e.createdAt?(w(),we(d5,{key:3,time:e.createdAt},null,8,["time"])):ce("",!0)])],10,_te))}}),$te=ct(Lte,[["__scopeId","data-v-a62a6587"]]),Fte=["app:load:start","app:load:complete","export:start","export:accepted","export:failed","prompt:start","prompt:accepted","prompt:failed","session:snapshot:start","session:snapshot:accepted","session:snapshot:failed","operation:failed","window:error","window:unhandled-rejection","ws:connection","ws:error","ws:resync","ws:stale-reconnect"],f5=500,Fp=256*1024,gC=200,og=16384,sg=500,ig=50,rg=50,Ote=6,Rte=/api[_-]?key|authorization|token|secret|password|cookie|credential/i,Bte=/^[A-Za-z0-9+/=_-]{200,}$/;let lg=null;function Hi(){if(lg!==null)return lg;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=mo(Ft.debug)==="1"),lg=e,e}const El=[],Tc=[];let Vu=0;const ma=[];let Ku=0,Dte=1;const Op=new TextEncoder,Pte=new Set(Fte),Ik=J(0),Gu=Ba(!1);function Hte(){return El}function Wte(){El.length=0,Tc.length=0,Vu=0,ma.length=0,Ku=0,Ik.value++}function jr(e){if(!Gu.value){try{const t={id:Dte++,ts:Date.now(),source:e.source,kind:String(jc(e.kind)),label:String(jc(e.label)),sessionId:e.sessionId===void 0?void 0:String(jc(e.sessionId)),method:e.method,path:e.path,eventType:e.eventType,seq:e.seq,offset:e.offset,status:e.status,code:e.code,requestId:e.requestId,durationMs:e.durationMs,detail:Wl(e.detail)},n=JSON.stringify(t),o=Op.encode(n).byteLength;if(o>Fp)return;for(El.push(t),Tc.push(n),Vu+=o+(Tc.length>1?1:0);El.length>f5||Vu>Fp;){const s=Tc.shift();El.shift(),s!==void 0&&(Vu-=Op.encode(s).byteLength,Tc.length>0&&(Vu-=1))}}catch{return}Ik.value++}}function aa(e){if(typeof e=="string")return e.length<=gC?e:e.slice(0,gC)}function li(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function zte(e,t){if(Pte.has(e))try{const n={ts:Date.now(),event:e,sessionId:aa(t?.sessionId),status:aa(t?.status),operation:aa(t?.operation),seq:li(t?.seq),durationMs:li(t?.durationMs),messageCount:li(t?.messageCount),contentCount:li(t?.contentCount),mediaCount:li(t?.mediaCount),sessionCount:li(t?.sessionCount),workspaceCount:li(t?.workspaceCount),promptId:aa(t?.promptId),zipBytes:li(t?.zipBytes),errorName:aa(t?.errorName),errorCode:li(t?.errorCode),requestId:aa(t?.requestId),phase:aa(t?.phase),httpStatus:li(t?.httpStatus),fatal:typeof t?.fatal=="boolean"?t.fatal:void 0,line:li(t?.line),col:li(t?.col)},o=JSON.stringify(n),s=Op.encode(o).byteLength;if(s>Fp)return;for(ma.push(o),Ku+=s+(ma.length>1?1:0);ma.length>f5||Ku>Fp;){const i=ma.shift();i!==void 0&&(Ku-=Op.encode(i).byteLength,ma.length>0&&(Ku-=1))}}catch{return}}function jc(e,t=0){if(e==null)return e;const n=typeof e;if(n==="number"||n==="boolean")return e;if(n==="string"){const i=e;return Bte.test(i)?`[base64-like, ${i.length} chars omitted]`:i.length>sg?`${i.slice(0,sg)}… [+${i.length-sg} chars]`:i}if(n!=="object")return String(e);if(t>=Ote)return"[max depth]";if(Array.isArray(e)){const i=e.slice(0,ig).map(r=>jc(r,t+1));return e.length>ig&&i.push(`[+${e.length-ig} more items]`),i}const o={},s=Object.entries(e);for(const[i,r]of s.slice(0,rg))o[i]=Rte.test(i)?"[redacted]":jc(r,t+1);return s.length>rg&&(o._truncatedKeys=s.length-rg),o}function Wl(e){if(e===void 0)return;const t=jc(e);try{const n=JSON.stringify(t);if(n!==void 0&&n.length>og)return{_truncated:`detail JSON was ${n.length} chars; first ${og} kept`,preview:n.slice(0,og)}}catch{return"[unserializable detail]"}return t}function rh(e){Hi()&&jr({source:"rest",kind:"rest:request",label:`→ ${e.method} ${e.path}`,method:e.method,path:e.path,requestId:e.requestId,detail:{url:e.url,body:Wl(e.body)}})}function cc(e){if(!Hi())return;const t=e.code!==0;jr({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:Wl(e.data)}})}function al(e){Hi()&&jr({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 uc(e,t){Hi()&&jr({source:"ws",kind:"ws:lifecycle",eventType:e,label:`ws ${e}`,detail:Wl(t)})}function Ute(e){if(!Hi())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",o=t.payload,s=typeof o?.session_id=="string"?o.session_id:void 0;jr({source:"ws",kind:"ws:out",eventType:n,sessionId:s,label:`→ ${n}`,detail:Wl(e)})}function qte(e){if(!Hi())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",o=typeof t.session_id=="string"?t.session_id:typeof t.payload?.session_id=="string"?t.payload.session_id:void 0,s=typeof t.seq=="number"?t.seq:void 0,i=typeof t.offset=="number"?t.offset:void 0,r=[o,s!==void 0?`seq=${s}`:void 0,i!==void 0?`offset=${i}`:void 0,t.volatile===!0?"volatile":void 0].filter(Boolean);jr({source:"ws",kind:"ws:in",eventType:n,sessionId:o,seq:s,offset:i,label:`← ${n}${r.length>0?` (${r.join(" ")})`:""}`,detail:Wl(t.payload)})}const jte={error:"✕",warn:"⚠",info:"ℹ",debug:"·",log:"·"};function Vte(e,t,n){Hi()&&jr({source:"client",kind:`client:${e}`,label:`${jte[e]} ${t}`,detail:Wl(n)})}function Er(e,t){Hi()&&jr({source:"client",kind:"client:event",label:`· ${e}`,detail:Wl(t)})}function ko(e,t){zte(e,t),jr({source:"client",kind:"client:key",label:e,sessionId:typeof t?.sessionId=="string"?t.sessionId:void 0,seq:typeof t?.seq=="number"?t.seq:void 0,durationMs:typeof t?.durationMs=="number"?t.durationMs:void 0,detail:t})}let ag=!1,lh=null;function Kte(){if(ag)return()=>lh?.();ag=!0;const e=[];try{if(typeof window<"u"){const n=s=>{ko("window:error",{status:"failed",errorName:s.error instanceof Error?s.error.name:"Error",line:s.lineno,col:s.colno})},o=s=>{const i=s.reason;ko("window:unhandled-rejection",{status:"failed",errorName:i instanceof Error?i.name:typeof i})};window.addEventListener("error",n),window.addEventListener("unhandledrejection",o),e.push(()=>{window.removeEventListener("error",n)}),e.push(()=>{window.removeEventListener("unhandledrejection",o)})}}catch{}if(Hi())for(const n of["error","warn","log","info","debug"]){const o=console[n];if(typeof o!="function")continue;const s=(...i)=>{try{Vte(n,i.map(Gte).join(" "),i.length>1?i:i[0])}catch{}o.apply(console,i)};console[n]=s,e.push(()=>{console[n]===s&&(console[n]=o)})}const t=()=>{if(lh===t){for(const n of e.toReversed())n();lh=null,ag=!1}};return lh=t,t}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 h5(e=El){if(typeof document>"u")return;const t=new Blob([Yte(e)],{type:"application/x-ndjson"}),n=URL.createObjectURL(t);let o;try{o=document.createElement("a"),o.href=n,o.download=`kimi-web-log-${new Date().toISOString().replaceAll(/[:.]/g,"-")}.jsonl`,document.body.append(o),o.click()}finally{o?.remove(),setTimeout(()=>{try{URL.revokeObjectURL(n)}catch{}},0)}}function Yte(e=El){return e===El?Tc.join(`
282
+ `):e.map(t=>JSON.stringify(t)).join(`
283
+ `)}function Zte(){return ma.join(`
284
+ `)}function p5(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 Hv(e){return e.contextTokens===0&&e.contextLimit===0&&e.inputTokens===0&&e.outputTokens===0&&e.turnCount===0}function Ni(e){return{id:e.id,title:e.title,createdAt:e.created_at,updatedAt:e.updated_at,busy:e.busy,mainTurnActive:e.main_turn_active,pendingInteraction:e.pending_interaction,lastTurnReason:e.last_turn_reason,archived:e.archived??!1,currentPromptId:e.current_prompt_id,lastPrompt:e.last_prompt,cwd:e.metadata.cwd,model:e.agent_config.model,usage:p5(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 pd(e){return{id:e.id,root:e.root,name:e.name,lastOpenedAt:e.last_opened_at,sessionCount:e.session_count}}function vC(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 Lk(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:vC(e.source)};case"video":return{type:"video",source:vC(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 Wv(e){return{id:e.id,sessionId:e.session_id,role:e.role,content:e.content.map(Lk),createdAt:e.created_at,promptId:e.prompt_id,parentMessageId:e.parent_message_id,metadata:e.metadata}}function Qte(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 Xte(e){return{content:e.content.map(Qte),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 Jte(e){return{decision:e.decision,scope:e.scope,feedback:e.feedback,selected_label:e.selectedLabel}}function m5(e){return{approvalId:e.approval_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,toolName:e.tool_name,action:e.action,display:e.tool_input_display??e.display,expiresAt:e.expires_at,createdAt:e.created_at}}function ene(e){return{id:e.id,label:e.label,description:e.description,recommended:e.recommended===!0||e.is_recommended===!0}}function tne(e){return{id:e.id,question:e.question,header:e.header,body:e.body,options:e.options.map(ene),multiSelect:e.multi_select,allowOther:e.allow_other,otherLabel:e.other_label,otherDescription:e.other_description}}function g5(e){return{questionId:e.question_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,questions:e.questions.map(tne),createdAt:e.created_at}}function nne(e){switch(e.kind){case"single":return{kind:"single",option_id:e.optionId};case"multi":return{kind:"multi",option_ids:e.optionIds};case"other":return{kind:"other",text:e.text};case"multiWithOther":return{kind:"multi_with_other",option_ids:e.optionIds,other_text:e.otherText};case"skipped":return{kind:"skipped"}}}function one(e){const t={};for(const[n,o]of Object.entries(e.answers))t[n]=nne(o);return{answers:t,method:e.method,note:e.note}}function Rh(e){return{id:e.id,sessionId:e.session_id,kind:e.kind,description:e.description,status:e.status,command:e.command,createdAt:e.created_at,startedAt:e.started_at,completedAt:e.completed_at,outputPreview:e.output_preview,outputBytes:e.output_bytes,subagentPhase:e.subagent_phase,subagentType:e.subagent_type,parentToolCallId:e.parent_tool_call_id,suspendedReason:e.suspended_reason,swarmIndex:e.swarm_index,runInBackground:e.run_in_background??(e.kind==="subagent"?!0:void 0)}}function yC(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 cl(e,t){const n=e[t];return typeof n=="string"?n:void 0}function dc(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function ai(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function v5(e){if(!e||typeof e!="object")return null;const t=e,n=cl(t,"status");if(n!=="active"&&n!=="paused"&&n!=="blocked"&&n!=="complete")return null;const o=t.budget,s=o&&typeof o=="object"?o:{};return{goalId:cl(t,"goalId")??cl(t,"goal_id")??"goal",objective:cl(t,"objective")??"",completionCriterion:cl(t,"completionCriterion")??cl(t,"completion_criterion"),status:n,turnsUsed:dc(t,"turnsUsed")??dc(t,"turns_used")??0,tokensUsed:dc(t,"tokensUsed")??dc(t,"tokens_used")??0,wallClockMs:dc(t,"wallClockMs")??dc(t,"wall_clock_ms")??0,terminalReason:cl(t,"terminalReason")??cl(t,"terminal_reason"),budget:{tokenBudget:ai(s,"tokenBudget")??ai(s,"token_budget"),remainingTokens:ai(s,"remainingTokens")??ai(s,"remaining_tokens"),turnBudget:ai(s,"turnBudget")??ai(s,"turn_budget"),remainingTurns:ai(s,"remainingTurns")??ai(s,"remaining_turns"),wallClockBudgetMs:ai(s,"wallClockBudgetMs")??ai(s,"wall_clock_budget_ms"),remainingWallClockMs:ai(s,"remainingWallClockMs")??ai(s,"remaining_wall_clock_ms"),overBudget:s.overBudget===!0||s.over_budget===!0}}}function sne(e){const t=e;switch(e.type){case"event.session.created":return{type:"sessionCreated",session:Ni(t.payload.session)};case"event.session.updated":return{type:"sessionUpdated",session:Ni(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:pd(t.payload.workspace)};case"event.workspace.updated":return{type:"workspaceUpdated",workspace:pd(t.payload.workspace)};case"event.workspace.deleted":return{type:"workspaceDeleted",workspaceId:t.payload.workspace_id,root:t.payload.root};case"event.session.work_changed":return{type:"sessionWorkChanged",sessionId:t.session_id,busy:t.payload.busy,mainTurnActive:t.payload.main_turn_active,pendingInteraction:t.payload.pending_interaction,lastTurnReason:t.payload.last_turn_reason};case"event.session.status_changed":return{type:"sessionWorkChanged",sessionId:t.session_id,busy:t.payload.status!=="idle"&&t.payload.status!=="aborted",mainTurnActive:t.payload.status!=="idle"&&t.payload.status!=="aborted",pendingInteraction:t.payload.status==="awaiting_approval"?"approval":t.payload.status==="awaiting_question"?"question":"none",lastTurnReason:t.payload.status==="aborted"?"cancelled":void 0};case"event.session.usage_updated":return{type:"sessionUsageUpdated",sessionId:t.session_id,usage:p5(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=v5(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:Wv(t.payload.message)};case"event.message.updated":return{type:"messageUpdated",sessionId:t.session_id,messageId:t.payload.message_id,content:t.payload.content.map(Lk),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:m5(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:g5(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:Rh(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:zv(t.payload.config)};case"event.model_catalog.changed":return{type:"modelCatalogChanged",changed:t.payload.changed.map(n=>({providerId:n.provider_id,providerName:n.provider_name,added:n.added,removed:n.removed})),unchanged:t.payload.unchanged,failed:t.payload.failed};default:return{type:"unknown",raw:e}}}function ine(e){return{id:e.model,provider:e.provider,model:e.model,displayName:e.display_name,maxContextSize:e.max_context_size,capabilities:e.capabilities,supportEfforts:e.support_efforts,defaultEffort:e.default_effort}}function kC(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 zv(e){const t={};for(const[n,o]of Object.entries(e.providers))t[n]={type:o.type,baseUrl:o.base_url,defaultModel:o.default_model,hasApiKey:o.has_api_key};return{providers:t,defaultProvider:e.default_provider,defaultModel:e.default_model,models:e.models,thinking:e.thinking,planMode:e.plan_mode,yolo:e.yolo,defaultPermissionMode:e.default_permission_mode,defaultPlanMode:e.default_plan_mode,permission:e.permission,hooks:e.hooks,services:e.services,mergeAllAvailableSkills:e.merge_all_available_skills,extraSkillDirs:e.extra_skill_dirs,loopControl:e.loop_control,background:e.background,experimental:e.experimental,telemetry:e.telemetry,raw:e.raw}}function rne(e){return e.session_id}function lne(e){return e.seq}const ane="main",cne=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","prompt.aborted","error"]);function Sr(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 une(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 bC(){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,retryReuseMsgId:void 0}}function ds(e,t){const n=e[t];return typeof n=="string"?n:void 0}function ua(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function ci(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function dne(e){if(!e||typeof e!="object")return null;const t=e,n=t.budget,o=n&&typeof n=="object"?n:{},s=ds(t,"status");if(s!=="active"&&s!=="paused"&&s!=="blocked"&&s!=="complete")return null;const i=ds(t,"goalId")??ds(t,"goal_id")??"goal",r=ds(t,"objective")??"";return{goalId:i,objective:r,completionCriterion:ds(t,"completionCriterion")??ds(t,"completion_criterion"),status:s,turnsUsed:ua(t,"turnsUsed")??ua(t,"turns_used")??0,tokensUsed:ua(t,"tokensUsed")??ua(t,"tokens_used")??0,wallClockMs:ua(t,"wallClockMs")??ua(t,"wall_clock_ms")??0,terminalReason:ds(t,"terminalReason")??ds(t,"terminal_reason"),budget:{tokenBudget:ci(o,"tokenBudget")??ci(o,"token_budget"),remainingTokens:ci(o,"remainingTokens")??ci(o,"remaining_tokens"),turnBudget:ci(o,"turnBudget")??ci(o,"turn_budget"),remainingTurns:ci(o,"remainingTurns")??ci(o,"remaining_turns"),wallClockBudgetMs:ci(o,"wallClockBudgetMs")??ci(o,"wall_clock_budget_ms"),remainingWallClockMs:ci(o,"remainingWallClockMs")??ci(o,"remaining_wall_clock_ms"),overBudget:o.overBudget===!0||o.over_budget===!0}}}function ga(e,t,n,o){if(typeof n!="string"||n.length===0)return null;const i={...e.subagentMeta.get(n)??{id:n,sessionId:t,kind:"subagent",description:"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued"},...o,id:n,sessionId:t,kind:"subagent"};return e.subagentMeta.set(n,i),i}function fne(e,t){if(e==="turn.step.started")return null;if(e==="tool.use"||e==="tool.call.started"){const n=ds(t,"name")??ds(t,"toolName")??"tool",o=Pa(hne(n)),s=pne(n,t.args??t.input);return s?`Calling ${o}: ${s}`:`Calling ${o}`}if(e==="tool.progress"){const n=t.update;if(n&&typeof n=="object"){const s=ds(n,"text");if(s)return cg(s);const i=ds(n,"message");if(i)return cg(i)}const o=ds(t,"message");if(o)return cg(o)}return null}function hne(e){return e.replace(/_\d+$/,"")}const xC=2e3;function cg(e){return e.length>xC?`${e.slice(0,xC)}…`:e}function pne(e,t){if(t==null)return"";const n=typeof t=="string"?t:JSON.stringify(t);return Ed(e,n)}function mne(e,t,n,o,s,i){if(i.has(n)&&o==="turn.step.started")return[];if(o==="assistant.delta"){const u=ds(s,"delta");if(!u)return[];const d=e.subagentMeta.get(n),f=ga(e,t,n,{status:"running",subagentPhase:"working",startedAt:d?.startedAt??new Date().toISOString()}),h=[];return f&&h.push({type:"taskCreated",sessionId:t,task:f}),h.push({type:"taskProgress",sessionId:t,taskId:n,outputChunk:u,stream:"stdout",kind:"text"}),h}const r=fne(o,s);if(r===null||r.length===0)return[];const l=e.subagentMeta.get(n),a=ga(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 Du(e){return{...e,content:e.content.map(t=>({...t}))}}function wC(e,t,n){const o={id:Sr("msg_"),sessionId:t,role:"assistant",content:[],createdAt:new Date().toISOString(),promptId:n};return e.messages.push(o),o}function gne(e,t,n,o,s,i){const r={id:o,sessionId:t,role:"user",content:s,createdAt:i,promptId:n};return e.messages.push(r),r}function vne(e){return Array.isArray(e)?e.map(t=>Lk(t)):[]}function _C(e,t,n,o){const s=e.messages.find(r=>r.id===t);if(!s)return-1;const i=s.content.at(-1);return i&&i.type===n?(n==="text"?i.text+=o:i.thinking+=o,s.content.length-1):(s.content.push(n==="text"?{type:"text",text:o}:{type:"thinking",thinking:o}),s.content.length-1)}function yne(e,t,n,o,s,i){const r=e.messages.find(l=>l.id===t);r&&r.content.push({type:"toolUse",toolCallId:n,toolName:o,input:s,outputLines:i})}function kne(e){const t=e.update,n=t&&typeof t=="object"?t:null,s=(n?.stream??n?.kind??e.stream)==="stderr"?"stderr":"stdout",i=typeof n?.text=="string"&&n.text||typeof n?.message=="string"&&n.message||typeof e.chunk=="string"&&e.chunk||typeof e.output=="string"&&e.output||typeof e.message=="string"&&e.message||"";return i.length>0?{outputChunk:i,stream:s}:null}function SC(e,t){e.messages.find(n=>n.id===t)}function bne(e,t,n,o,s,i){const r={id:Sr("msg_"),sessionId:t,role:"tool",content:[{type:"toolResult",toolCallId:n,output:o,isError:s}],createdAt:new Date().toISOString(),promptId:i};return e.messages.push(r),r}function Pu(e,t){return e.messages.find(n=>n.id===t)}function CC(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 xne(){const e=new Map,t=new Set;function n(u){let d=e.get(u);return d||(d=bC(),e.set(u,d)),d}function o(u){e.set(u,bC())}function s(u){t.add(u)}function i(u,d){const f=n(u);f.currentPromptId=d}function r(u,d){o(u);const f=n(u),h=d.promptId??Sr("pr_");f.currentPromptId=h,f.turnPromptId.set(d.turnId,h);const p=wC(f,u,h);d.thinkingText.length>0&&p.content.push({type:"thinking",thinking:d.thinkingText}),d.assistantText.length>0&&p.content.push({type:"text",text:d.assistantText});for(const g of d.runningTools){const b=typeof g.lastProgress?.text=="string"&&g.lastProgress.text.length>0?[g.lastProgress.text]:void 0;p.content.push({type:"toolUse",toolCallId:g.toolCallId,toolName:g.name,input:g.args??{},outputLines:b}),f.toolStartTimes.set(g.toolCallId,Date.now())}return f.currentAssistantMsgId=p.id,f.turnTextLen=d.assistantText.length,f.turnThinkLen=d.thinkingText.length,[{type:"messageCreated",message:Du(p)}]}function l(u,d,f,h){try{return c(u,d,f,h)}catch(p){return console.error("[agentProjector] Error projecting event:",u,p instanceof Error?p.message:p),[]}}function a(u,d){return d===void 0?"append":d<u?"skip":d>u?"gap":"append"}function c(u,d,f,h){const p=n(f),g=d,b=[],v=g?.agentId;if(typeof v=="string"&&v!==ane){const m=t.has(v);if(m&&(u==="thinking.delta"||u==="assistant.delta")){const y=g?.delta??"";return y?[{type:"agentDelta",sessionId:f,agentId:v,delta:{[u==="thinking.delta"?"thinking":"text"]:y}}]:[]}if(m&&u==="turn.ended")return[{type:"agentTurnEnded",sessionId:f,agentId:v,reason:g?.reason}];if(cne.has(u))return mne(p,f,v,u,g??{},t)}switch(u){case"session.meta.updated":{const m=g?.patch?.title??g?.title,y=g?.patch?.lastPrompt,k={};typeof m=="string"&&m.length>0&&(k.title=m),typeof y=="string"&&(k.lastPrompt=y),(k.title!==void 0||k.lastPrompt!==void 0)&&b.push({type:"sessionMetaUpdated",sessionId:f,...k});break}case"prompt.submitted":{const m=g?.promptId,y=g?.userMessageId;if(!m||!y)break;const k=vne(g?.content);if(k.length===0)break;p.currentPromptId=m;const A=gne(p,f,m,y,k,typeof g?.createdAt=="string"?g.createdAt:new Date().toISOString());b.push({type:"messageCreated",message:Du(A)});break}case"turn.started":{const m=g?.turnId,y=p.currentPromptId??Sr("pr_");p.currentPromptId=y,m!==void 0&&p.turnPromptId.set(m,y),p.turnTextLen=0,p.turnThinkLen=0,b.push({type:"turnActiveChanged",sessionId:f,active:!0});break}case"turn.step.started":{const m=g?.turnId;let y=p.turnPromptId.get(m)??p.currentPromptId;if(y||(y=Sr("pr_"),p.currentPromptId=y,m!==void 0&&p.turnPromptId.set(m,y)),p.turnTextLen=0,p.turnThinkLen=0,p.retryReuseMsgId!==void 0){const A=p.retryReuseMsgId;if(p.retryReuseMsgId=void 0,Pu(p,A)!==void 0){p.currentAssistantMsgId=A;break}}const k=wC(p,f,y);p.currentAssistantMsgId=k.id,b.push({type:"messageCreated",message:Du(k)});break}case"thinking.delta":{const m=p.currentAssistantMsgId;if(!m)break;const y=g?.delta??"";if(!y)break;h?.offset===0&&p.turnThinkLen>0&&(p.turnThinkLen=0);const k=a(p.turnThinkLen,h?.offset);if(k==="skip")break;if(k==="gap"){b.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const A=_C(p,m,"thinking",y);if(A<0)break;p.turnThinkLen+=y.length,b.push({type:"assistantDelta",sessionId:f,messageId:m,contentIndex:A,delta:{thinking:y}});break}case"assistant.delta":{const m=p.currentAssistantMsgId;if(!m)break;const y=g?.delta??"";if(!y)break;h?.offset===0&&p.turnTextLen>0&&(p.turnTextLen=0);const k=a(p.turnTextLen,h?.offset);if(k==="skip")break;if(k==="gap"){b.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const A=_C(p,m,"text",y);if(A<0)break;p.turnTextLen+=y.length,b.push({type:"assistantDelta",sessionId:f,messageId:m,contentIndex:A,delta:{text:y}});break}case"tool.use":case"tool.call.started":{const m=p.currentAssistantMsgId,y=g?.turnId,k=p.turnPromptId.get(y)??p.currentPromptId;if(!m||!k)break;const A=g?.toolCallId,$=g?.name??g?.toolName??"",I=g?.args??g?.input??{};yne(p,m,A,$,I);const x=Pu(p,m);x&&x.content.length-1,p.toolStartTimes.set(A,Date.now()),x&&b.push({type:"messageUpdated",sessionId:f,messageId:m,content:x.content.map(L=>({...L})),status:"pending"});break}case"tool.call.delta":break;case"tool.progress":{const m=g?.toolCallId,y=kne(g??{});m&&y&&b.push({type:"toolOutput",sessionId:f,toolCallId:m,outputChunk:y.outputChunk,stream:y.stream});break}case"tool.result":{const m=g?.turnId;let y=p.turnPromptId.get(m)??p.currentPromptId;y||(y=Sr("pr_"),p.currentPromptId=y,m!==void 0&&p.turnPromptId.set(m,y));const k=g?.toolCallId,A=g?.output,$=g?.isError??!1;p.toolStartTimes.get(k)??Date.now(),p.toolStartTimes.delete(k);const I=bne(p,f,k,A,$,y);b.push({type:"messageCreated",message:Du(I)}),p.currentAssistantMsgId=void 0;break}case"turn.step.completed":{const m=p.currentAssistantMsgId,y=une(g?.usage);if(p.totalInput+=y.input,p.totalOutput+=y.output,p.totalCacheRead+=y.cacheRead,p.totalCacheCreate+=y.cacheCreate,m){SC(p,m);const k=Pu(p,m);k&&b.push({type:"messageUpdated",sessionId:f,messageId:m,content:k.content.map(A=>({...A})),status:"completed"})}break}case"agent.status.updated":{g?.model&&(p.model=g.model),g?.contextTokens!==void 0&&(p.contextTokens=g.contextTokens),g?.maxContextTokens!==void 0&&(p.contextLimit=g.maxContextTokens),b.push({type:"sessionUsageUpdated",sessionId:f,usage:CC(p),model:p.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,thinking:typeof g?.thinkingEffort=="string"&&g.thinkingEffort.length>0?g.thinkingEffort:void 0});break}case"turn.ended":{const m=p.currentAssistantMsgId,y=g?.reason??"completed",k=ua(g??{},"durationMs");if(b.push({type:"turnActiveChanged",sessionId:f,active:!1,reason:g?.reason}),m){SC(p,m);const $=Pu(p,m);$&&b.push({type:"messageUpdated",sessionId:f,messageId:m,content:$.content.map(I=>({...I})),status:y==="failed"||y==="blocked"?"error":"completed",durationMs:k})}p.turnCount++;const A=CC(p);b.push({type:"sessionUsageUpdated",sessionId:f,usage:A}),p.currentAssistantMsgId=void 0,p.currentPromptId=void 0,p.turnTextLen=0,p.turnThinkLen=0,p.retryReuseMsgId=void 0;break}case"prompt.completed":{const m=g?.promptId;typeof m=="string"&&m.length>0&&b.push({type:"promptCompleted",sessionId:f,promptId:m,reason:g?.reason??"completed"});break}case"prompt.aborted":{const m=g?.promptId;typeof m=="string"&&m.length>0&&b.push({type:"promptAborted",sessionId:f,promptId:m});break}case"turn.step.retrying":{const m=p.currentAssistantMsgId;if(m!==void 0){const y=Pu(p,m);y!==void 0&&(y.content=y.content.filter(k=>k.type!=="text"&&k.type!=="thinking"&&k.type!=="toolUse"),b.push({type:"messageUpdated",sessionId:f,messageId:m,content:y.content.map(k=>({...k})),status:"pending"}),p.retryReuseMsgId=m)}p.turnTextLen=0,p.turnThinkLen=0,p.toolStartTimes.clear();break}case"turn.step.interrupted":{p.currentAssistantMsgId=void 0,p.retryReuseMsgId=void 0;break}case"subagent.spawned":{const y={id:typeof g?.subagentId=="string"&&g.subagentId.length>0?g.subagentId:Sr("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,runInBackground:g?.runInBackground===!0};p.subagentMeta.set(y.id,y),b.push({type:"taskCreated",sessionId:f,task:y});break}case"subagent.started":{const m=ga(p,f,g?.subagentId,{subagentPhase:"working",status:"running",startedAt:new Date().toISOString()});m&&b.push({type:"taskCreated",sessionId:f,task:m});break}case"subagent.suspended":{const m=ga(p,f,g?.subagentId,{subagentPhase:"suspended",status:"running",suspendedReason:typeof g?.reason=="string"?g.reason:void 0});m&&b.push({type:"taskCreated",sessionId:f,task:m});break}case"subagent.completed":{const m=typeof g?.resultSummary=="string"?g.resultSummary:void 0,y=ga(p,f,g?.subagentId,{subagentPhase:"completed",status:"completed",completedAt:new Date().toISOString(),outputPreview:m});y&&b.push({type:"taskCreated",sessionId:f,task:y}),b.push({type:"taskCompleted",sessionId:f,taskId:g?.subagentId??"",status:"completed",outputPreview:m});break}case"subagent.failed":{const m=typeof g?.error=="string"?g.error:void 0,y=ga(p,f,g?.subagentId,{subagentPhase:"failed",status:"failed",completedAt:new Date().toISOString(),outputPreview:m});y&&b.push({type:"taskCreated",sessionId:f,task:y}),b.push({type:"taskCompleted",sessionId:f,taskId:g?.subagentId??"",status:"failed",outputPreview:m});break}case"error":{b.push({type:"unknown",raw:{_agentError:!0,code:g?.code,message:g?.message,name:g?.name,details:g?.details,retryable:g?.retryable}});break}case"warning":{b.push({type:"unknown",raw:{_agentWarning:!0,message:g?.message}});break}case"task.started":{const m=g?.info??{},y=typeof m.startedAt=="number"?new Date(m.startedAt).toISOString():void 0,k=typeof m.taskId=="string"?m.taskId:typeof m.taskId=="number"?String(m.taskId):Sr("task_"),A=typeof m.description=="string"?m.description:typeof m.command=="string"?m.command:_n.global.t("tasks.defaultDescription");if(m.kind==="agent"){const I=typeof m.agentId=="string"&&m.agentId.length>0?m.agentId:void 0;if(I!==void 0){const x=ga(p,f,I,{description:A,backgroundTaskId:k,runInBackground:!0});x&&b.push({type:"taskCreated",sessionId:f,task:x})}else b.push({type:"taskCreated",sessionId:f,task:{id:k,sessionId:f,kind:"subagent",description:A,status:"running",createdAt:y??new Date().toISOString(),startedAt:y,subagentPhase:"queued",runInBackground:!0}});break}const $=typeof m.command=="string"?m.command:void 0;b.push({type:"taskCreated",sessionId:f,task:{id:k,sessionId:f,kind:"bash",description:A,command:$,status:"running",createdAt:y??new Date().toISOString(),startedAt:y,outputPreview:$!==void 0?`$ ${$}`:void 0}});break}case"task.terminated":{const m=g?.info??{},y=m.status==="failed"||typeof m.exitCode=="number"&&m.exitCode!==0;b.push({type:"taskCompleted",sessionId:f,taskId:typeof m.taskId=="string"?m.taskId:typeof m.taskId=="number"?String(m.taskId):"",status:y?"failed":"completed"});break}case"compaction.completed":{const m=g?.result??{};b.push({type:"compactionCompleted",sessionId:f,tokensBefore:typeof m.tokensBefore=="number"?m.tokensBefore:void 0,tokensAfter:typeof m.tokensAfter=="number"?m.tokensAfter:void 0,summary:typeof m.summary=="string"?m.summary:void 0}),b.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"auto_compact"});break}case"compaction.started":{b.push({type:"compactionStarted",sessionId:f,trigger:g?.trigger==="manual"?"manual":"auto",instruction:typeof g?.instruction=="string"?g.instruction:void 0});break}case"compaction.cancelled":{b.push({type:"compactionCancelled",sessionId:f});break}case"goal.updated":{const m=dne(g?.snapshot??null);b.push({type:"goalUpdated",sessionId:f,goal:m?.status==="complete"?null:m});break}case"cron.fired":{const m=g?.origin,y=ds(g??{},"prompt");if(m&&typeof m=="object"&&m.kind==="cron_job"&&y){const k={id:Sr("cron_"),sessionId:f,role:"user",content:[{type:"text",text:y}],createdAt:new Date().toISOString(),metadata:{origin:m}};p.messages.push(k),b.push({type:"messageCreated",message:Du(k)})}break}}return b}return{project:l,bindNextPromptId:i,seedInFlight:r,reset:o,markSideChannelAgent:s}}const wne=new Set(["server_hello","ack","ping","resync_required","error","pong"]),AC=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","prompt.aborted","session.meta.updated","compaction.started","compaction.completed","compaction.cancelled","goal.updated","error","warning","subagent.spawned","subagent.started","subagent.suspended","subagent.completed","subagent.failed","task.started","task.terminated","background.task.started","background.task.terminated","cron.fired"]),_ne=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"]),Sne=new Set(["assistant.delta","thinking.delta"]);function Cne(e,t){if(wne.has(e))return{route:"ignore"};const n=e.startsWith("event."),o=n?e.slice(6):e;return Sne.has(o)?Ane(t)?{route:"agent",agentType:o}:{route:"protocol"}:n?_ne.has(o)?{route:"protocol"}:AC.has(o)?{route:"agent",agentType:o}:{route:"protocol"}:AC.has(o)?{route:"agent",agentType:o}:{route:"agent",agentType:o}}function Ane(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 Yu extends Error{code;requestId;details;timestamp;durationMs;constructor(t){super(t.msg),this.name="DaemonApiError",this.code=t.code,this.requestId=t.requestId,this.details=t.details,this.timestamp=t.timestamp,this.durationMs=t.durationMs}}class xr extends Error{cause;method;path;url;requestId;phase;timeoutMs;status;statusText;contentType;bodyPreview;timestamp;durationMs;constructor(t){super(t.message),this.name="DaemonNetworkError",this.cause=t.cause,this.method=t.method,this.path=t.path,this.url=t.url,this.requestId=t.requestId,this.phase=t.phase,this.timeoutMs=t.timeoutMs,this.status=t.status,this.statusText=t.statusText,this.contentType=t.contentType,this.bodyPreview=t.bodyPreview,this.timestamp=t.timestamp,this.durationMs=t.durationMs}}function vi(e){return e instanceof Yu||typeof e=="object"&&e!==null&&e.name==="DaemonApiError"&&typeof e.code=="number"}function $k(e){return e instanceof xr||typeof e=="object"&&e!==null&&e.name==="DaemonNetworkError"&&typeof e.method=="string"&&typeof e.path=="string"}const zo="kimi-web.server-credential",Mne="token",Ene=10080*60*1e3;let or;const Uv=new Set;function Tne(){if(typeof window>"u")return;const e=window.location.hash??"";if(!e.startsWith("#"))return;const n=new URLSearchParams(e.slice(1)).get(Mne);if(!n)return;const o=new URL(window.location.href);return o.hash="",window.history.replaceState(window.history.state,"",`${o.pathname}${o.search}`),n}function qv(e){return{version:1,credential:e,expiresAt:Date.now()+Ene}}function Nne(e){return JSON.stringify(e)}function Fk(e){try{const t=JSON.parse(e);if(typeof t!="object"||t===null)return;const n=t;return n.version!==1||typeof n.credential!="string"||n.credential.length===0||typeof n.expiresAt!="number"||!Number.isFinite(n.expiresAt)?void 0:{version:1,credential:n.credential,expiresAt:n.expiresAt}}catch{return}}function jv(e){globalThis.localStorage?.setItem(zo,Nne(e))}function Ine(){try{const e=globalThis.localStorage?.getItem(zo);if(e){const n=Fk(e);if(n===void 0){const o=qv(e);let s=!1;try{jv(o),s=!0}catch{}if(!s)try{globalThis.localStorage?.getItem(zo)===e&&globalThis.localStorage?.removeItem(zo),s=!0}catch{}try{globalThis.sessionStorage?.removeItem(zo)}catch{}return s?o:void 0}if(n.expiresAt>Date.now())return n;globalThis.sessionStorage?.removeItem(zo),globalThis.localStorage?.getItem(zo)===e&&globalThis.localStorage?.removeItem(zo);return}const t=globalThis.sessionStorage?.getItem(zo);if(t){const n=qv(t);let o=!1;try{jv(n),o=!0}catch{}try{globalThis.sessionStorage?.removeItem(zo),o=!0}catch{}return o?n:void 0}return}catch{return}}function Lne(){const e=Tne();return e?(k5(e),!0):(or=Ine(),or!==void 0)}function y5(){if(or!==void 0){if(or.expiresAt<=Date.now()){$ne(or);return}return or.credential}}function $ne(e){or=void 0;try{globalThis.sessionStorage?.removeItem(zo);const t=globalThis.localStorage?.getItem(zo),n=t==null?void 0:Fk(t);(n===void 0?t===e.credential:n.credential===e.credential&&n.expiresAt===e.expiresAt)&&globalThis.localStorage?.removeItem(zo)}catch{}}function k5(e){const t=qv(e);or=t;try{jv(t)}catch{}try{globalThis.sessionStorage?.removeItem(zo)}catch{}}function Fne(){const e=or;or=void 0;try{const t=globalThis.localStorage?.getItem(zo),o=(t==null?void 0:Fk(t))?.credential??t;e!==void 0&&o===e.credential&&globalThis.localStorage?.removeItem(zo),globalThis.sessionStorage?.removeItem(zo)}catch{}}function One(e){return Uv.add(e),()=>{Uv.delete(e)}}function Rne(){Fne();for(const e of Uv)try{e()}catch{}}const kc=3e4,ah=5*6e4,b5="0123456789ABCDEFGHJKMNPQRSTVWXYZ",MC=500,x5=40101;function ch(e=kc){try{return AbortSignal.timeout(e)}catch{return}}function Bne(e,t){let n="",o=e;for(let s=0;s<t;s++)n=b5[o%32]+n,o=Math.floor(o/32);return n}function Dne(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=>b5[n%32]).join("")}function uh(){return`${Bne(Date.now(),10)}${Dne(16)}`}function Pne(e){try{const t=[];return e.forEach((n,o)=>{typeof n=="string"?t.push({field:o,value:n}):t.push({field:o,file:n.name,size:n.size,type:n.type})}),{formData:t}}catch{return"[FormData]"}}async function ug(e){try{const t=await e.text();return t?t.length>MC?`${t.slice(0,MC)}...`:t:void 0}catch{return}}class Hne{constructor(t,n){this.origin=t,this.identity=n}async get(t,n){return this.request("GET",t,void 0,n)}async getBlob(t){const n=Sc(this.origin,t),o=uh(),s={"X-Request-Id":o};this.addClientHeaders(s);const i=Date.now();rh({method:"GET",path:t,url:n,requestId:o});let r;try{r=await fetch(n,{method:"GET",headers:s,signal:ch()})}catch(a){throw al({method:"GET",path:t,requestId:o,phase:"fetch",durationMs:Date.now()-i,error:a}),new xr({message:`Network error calling GET ${t}`,cause:a,method:"GET",path:t,url:n,requestId:o,phase:"fetch",timeoutMs:kc,timestamp:Date.now(),durationMs:Date.now()-i})}if(r.ok)return cc({method:"GET",path:t,requestId:o,status:r.status,durationMs:Date.now()-i,code:0,msg:""}),r.blob();let l;try{l=await r.clone().json()}catch{}throw this.checkAuthRequired(r,l?.code??0),cc({method:"GET",path:t,requestId:o,status:r.status,durationMs:Date.now()-i,code:l?.code??r.status,msg:l?.msg??r.statusText,envelopeRequestId:l?.request_id}),new Yu({code:l?.code??r.status,msg:l?.msg??r.statusText,requestId:l?.request_id??o,details:l?.details,timestamp:Date.now(),durationMs:Date.now()-i})}async post(t,n,o){return this.request("POST",t,n,void 0,o?.allowCodes)}async postZip(t,n,o){const s="POST",i=Sc(this.origin,t),r=uh(),l={"X-Request-Id":r,"Content-Type":"application/json; charset=utf-8"};this.addClientHeaders(l);const a=Date.now();rh({method:s,path:t,url:i,requestId:r,body:o});let c;try{c=await fetch(i,{method:s,headers:l,body:JSON.stringify(n),signal:ch(ah)})}catch(h){throw al({method:s,path:t,requestId:r,phase:"fetch",durationMs:Date.now()-a,error:h}),new xr({message:`Network error calling ${s} ${t}`,cause:h,method:s,path:t,url:i,requestId:r,phase:"fetch",timeoutMs:ah,timestamp:Date.now(),durationMs:Date.now()-a})}const u=c.headers.get("content-type")??void 0,d=u?.split(";",1)[0]?.trim().toLowerCase();if(!c.ok||d!=="application/zip"){let h;try{h=await c.clone().json()}catch{}if(this.checkAuthRequired(c,h?.code??0),!c.ok||h!==void 0&&h.code!==0){const b=h?.code??c.status,v=h?.msg??c.statusText;throw cc({method:s,path:t,requestId:r,status:c.status,durationMs:Date.now()-a,code:b,msg:v,envelopeRequestId:h?.request_id}),new Yu({code:b,msg:v,requestId:h?.request_id??r,details:h?.details,timestamp:Date.now(),durationMs:Date.now()-a})}const p=c.clone(),g=new TypeError(`Expected application/zip, received ${u??"no content type"}`);throw al({method:s,path:t,requestId:r,phase:"parse",durationMs:Date.now()-a,status:c.status,error:g}),new xr({message:`Invalid ZIP response from ${s} ${t}`,cause:g,method:s,path:t,url:i,requestId:r,phase:"parse",timeoutMs:ah,status:c.status,statusText:c.statusText,contentType:u,bodyPreview:await ug(p),timestamp:Date.now(),durationMs:Date.now()-a})}let f;try{f=await c.blob()}catch(h){throw al({method:s,path:t,requestId:r,phase:"parse",durationMs:Date.now()-a,status:c.status,error:h}),new xr({message:`Failed to read ZIP response from ${s} ${t}`,cause:h,method:s,path:t,url:i,requestId:r,phase:"parse",timeoutMs:ah,status:c.status,statusText:c.statusText,contentType:u,timestamp:Date.now(),durationMs:Date.now()-a})}return cc({method:s,path:t,requestId:r,status:c.status,durationMs:Date.now()-a,code:0,msg:""}),{blob:f,contentDisposition:c.headers.get("content-disposition")??void 0}}async postForm(t,n){const o=Sc(this.origin,t),s=uh(),i={"X-Request-Id":s};this.addClientHeaders(i);const r=Date.now();rh({method:"POST",path:t,url:o,requestId:s,body:Pne(n)});let l;try{l=await fetch(o,{method:"POST",headers:i,body:n,signal:ch()})}catch(u){throw al({method:"POST",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-r,error:u}),new xr({message:`Network error calling POST ${t}`,cause:u,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:kc,timestamp:Date.now(),durationMs:Date.now()-r})}let a;const c=l.clone();try{a=await l.json()}catch(u){throw al({method:"POST",path:t,requestId:s,phase:"parse",durationMs:Date.now()-r,status:l.status,error:u}),new xr({message:`Failed to parse JSON response from POST ${t}`,cause:u,method:"POST",path:t,url:o,requestId:s,phase:"parse",timeoutMs:kc,status:l.status,statusText:l.statusText,contentType:l.headers.get("content-type")??void 0,bodyPreview:await ug(c),timestamp:Date.now(),durationMs:Date.now()-r})}if(cc({method:"POST",path:t,requestId:s,status:l.status,durationMs:Date.now()-r,code:a.code,msg:a.msg,envelopeRequestId:a.request_id,data:a.data}),this.checkAuthRequired(l,a.code),a.code!==0)throw new Yu({code:a.code,msg:a.msg,requestId:a.request_id,details:a.details,timestamp:Date.now(),durationMs:Date.now()-r});return a.data}async patch(t,n){return this.request("PATCH",t,n)}async delete(t){return this.request("DELETE",t)}async request(t,n,o,s,i=[]){let r=Sc(this.origin,n);if(s){const h=new URLSearchParams;for(const[g,b]of Object.entries(s))b!==void 0&&h.set(g,String(b));const p=h.toString();p&&(r=`${r}?${p}`)}const l=uh(),a={"X-Request-Id":l};this.addClientHeaders(a),o!==void 0&&(a["Content-Type"]="application/json; charset=utf-8");const c=Date.now();rh({method:t,path:n,url:r,requestId:l,body:o});let u;try{u=await fetch(r,{method:t,headers:a,body:o!==void 0?JSON.stringify(o):void 0,signal:ch()})}catch(h){throw al({method:t,path:n,requestId:l,phase:"fetch",durationMs:Date.now()-c,error:h}),new xr({message:`Network error calling ${t} ${n}`,cause:h,method:t,path:n,url:r,requestId:l,phase:"fetch",timeoutMs:kc,timestamp:Date.now(),durationMs:Date.now()-c})}let d;const f=u.clone();try{d=await u.json()}catch(h){throw al({method:t,path:n,requestId:l,phase:"parse",durationMs:Date.now()-c,status:u.status,error:h}),new xr({message:`Failed to parse JSON response from ${t} ${n}`,cause:h,method:t,path:n,url:r,requestId:l,phase:"parse",timeoutMs:kc,status:u.status,statusText:u.statusText,contentType:u.headers.get("content-type")??void 0,bodyPreview:await ug(f),timestamp:Date.now(),durationMs:Date.now()-c})}if(cc({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 Yu({code:d.code,msg:d.msg,requestId:d.request_id,details:d.details,timestamp:Date.now(),durationMs:Date.now()-c});return d.data}addClientHeaders(t){const n=y5();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===x5)&&Rne()}}const Wne="kimi-code.bearer.",zne=3e4;class Une{constructor(t,n,o){this.wsUrl=t,this.clientId=n,this.handlers=o}ws=null;connected=!1;closed=!1;subscriptions=new Map;pendingSubscriptions=[];terminalAttachments=new Map;msgSeq=0;reconnectAttempts=0;reconnectTimer=null;heartbeatMs=3e4;lastActivityAt=0;connect(){if(this.ws!==null||this.closed)return;this.lastActivityAt=Date.now(),uc("connect",{url:this.wsUrl,attempt:this.reconnectAttempts});const t=y5(),n=t!==void 0?[`${Wne}${t}`]:void 0,o=new WebSocket(this.wsUrl,n);this.ws=o,o.onopen=()=>{uc("open")},o.onmessage=s=>{this.lastActivityAt=Date.now();try{const i=JSON.parse(String(s.data));qte(i),this.handleFrame(i)}catch(i){uc("parse-error",{error:String(i)}),this.handlers.onError(0,`Failed to parse WS frame: ${String(i)}`,!1)}},o.onerror=()=>{uc("error"),this.handlers.onError(0,"WebSocket error",!1)},o.onclose=s=>{uc("close",s?{code:s.code,reason:s.reason,wasClean:s.wasClean}:void 0),this.connected=!1,this.ws=null,this.handlers.onConnectionState(!1),this.scheduleReconnect()}}scheduleReconnect(){if(this.closed||this.reconnectTimer!==null)return;const n=Math.min(3e4,1e3*2**this.reconnectAttempts)+Math.floor(Math.random()*250);this.reconnectAttempts+=1,uc("reconnect-scheduled",{delayMs:n,attempt:this.reconnectAttempts}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},n)}subscribe(t,n={seq:0}){if(this.subscriptions.set(t,{...n}),this.connected)this.sendSubscribe([t],{[t]:n});else{const o=this.pendingSubscriptions.findIndex(s=>s.sessionId===t);o!==-1&&this.pendingSubscriptions.splice(o,1),this.pendingSubscriptions.push({sessionId:t,cursor:{...n}})}}unsubscribe(t){this.subscriptions.delete(t);const n=this.pendingSubscriptions.findIndex(o=>o.sessionId===t);n!==-1&&this.pendingSubscriptions.splice(n,1),this.connected&&this.ws&&this.send({type:"unsubscribe",id:this.nextId(),payload:{session_ids:[t]}})}abort(t,n){!this.connected||!this.ws||this.send({type:"abort",id:this.nextId(),payload:{session_id:t,prompt_id:n}})}terminalAttach(t,n,o){const s=dh(t,n),i=this.terminalAttachments.get(s),r=o??i?.lastSeq??0;this.terminalAttachments.set(s,{sessionId:t,terminalId:n,lastSeq:r}),!(!this.connected||!this.ws)&&this.sendTerminalAttach(t,n,r)}terminalInput(t,n,o){!this.connected||!this.ws||this.send({type:"terminal_input",id:this.nextId(),payload:{session_id:t,terminal_id:n,data:o}})}terminalResize(t,n,o,s){!this.connected||!this.ws||this.send({type:"terminal_resize",id:this.nextId(),payload:{session_id:t,terminal_id:n,cols:o,rows:s}})}terminalDetach(t,n){this.terminalAttachments.delete(dh(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(dh(t,n)),!(!this.connected||!this.ws)&&this.send({type:"terminal_close",id:this.nextId(),payload:{session_id:t,terminal_id:n}})}close(){this.closed=!0,this.connected=!1,this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.ws&&(this.ws.close(1e3),this.ws=null)}health(){const t=this.ws!==null&&this.ws.readyState===WebSocket.OPEN,n=Math.max(this.heartbeatMs*2,zne),o=this.lastActivityAt>0&&Date.now()-this.lastActivityAt>n;return{connected:this.connected,open:t,stale:o}}reconnect(){if(this.closed)return;this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null);const t=this.ws;if(t!==null){t.onopen=null,t.onmessage=null,t.onerror=null,t.onclose=null;try{t.close(1e3,"reconnect")}catch{}}const n=this.connected;this.ws=null,this.connected=!1,n&&this.handlers.onConnectionState(!1),this.connect()}handleFrame(t){const n=t;switch(t.type){case"server_hello":{const o=n.payload?.heartbeat_ms;typeof o=="number"&&o>0&&(this.heartbeatMs=o),this.onServerHello();break}case"ping":this.send({type:"pong",payload:{nonce:n.payload.nonce}});break;case"resync_required":{const o=n.payload.session_id,s=n.payload.epoch;this.subscriptions.set(o,{seq:n.payload.current_seq,epoch:s}),this.handlers.onResync(o,n.payload.current_seq,s);break}case"error":{const o=n.session_id;typeof o=="string"&&this.handlers.onRawAgentEvent?this.handlers.onRawAgentEvent({type:"error",seq:n.seq,session_id:o,timestamp:n.timestamp,payload:n.payload}):this.handlers.onError(n.payload.code,n.payload.msg,n.payload.fatal);break}case"ack":break;case"terminal_output":{const o=n.session_id,s=n.terminal_id,i=n.seq,r=dh(o,s),l=this.terminalAttachments.get(r);l&&this.terminalAttachments.set(r,{...l,lastSeq:Math.max(l.lastSeq,i)});const a=typeof n.payload?.data=="string"?n.payload.data:"";this.handlers.onTerminalOutput?.(o,s,a,i);break}case"terminal_exit":{const o=n.session_id,s=n.terminal_id,i=n.payload?.exit_code,r=typeof i=="number"?i:null;this.handlers.onTerminalExit?.(o,s,r);break}default:{this.trackCursor(n);const o=n.type,s=Cne(o,n.payload);if(s.route==="protocol"){this.handlers.onWireEvent(n);break}if(s.route==="agent"){if(this.handlers.onRawAgentEvent&&typeof n.session_id=="string"){const i=n,r=n;this.handlers.onRawAgentEvent({type:s.agentType,seq:i.seq,session_id:i.session_id,timestamp:i.timestamp,payload:i.payload,...r.volatile!==void 0?{volatile:r.volatile}:{},...r.offset!==void 0?{offset:r.offset}:{}})}break}break}}}onServerHello(){this.connected=!0,this.reconnectAttempts=0,this.handlers.onConnectionState(!0);const t=Array.from(this.subscriptions.keys());for(const o of this.pendingSubscriptions)this.subscriptions.set(o.sessionId,o.cursor),t.includes(o.sessionId)||t.push(o.sessionId);this.pendingSubscriptions.length=0;const n={};for(const[o,s]of this.subscriptions.entries())n[o]=s;this.send({type:"client_hello",id:this.nextId(),payload:{client_id:this.clientId,subscriptions:t,cursors:n}});for(const o of this.terminalAttachments.values())this.sendTerminalAttach(o.sessionId,o.terminalId,o.lastSeq)}sendSubscribe(t,n){this.send({type:"subscribe",id:this.nextId(),payload:{session_ids:t,cursors:n}})}sendTerminalAttach(t,n,o){this.send({type:"terminal_attach",id:this.nextId(),payload:{session_id:t,terminal_id:n,since_seq:o>0?o:void 0}})}trackCursor(t){if(t.volatile===!0)return;const n=t.session_id,o=t.seq;if(typeof n!="string"||typeof o!="number")return;const s=this.subscriptions.get(n);if(!s||o<=s.seq&&s.epoch!==void 0)return;const i=typeof t.epoch=="string"?t.epoch:s.epoch;this.subscriptions.set(n,{seq:Math.max(o,s.seq),epoch:i})}send(t){if(!(!this.ws||this.ws.readyState!==WebSocket.OPEN))try{this.ws.send(JSON.stringify(t)),Ute(t)}catch{}}nextId(){return`c_${++this.msgSeq}`}}function dh(e,t){return`${e}\0${t}`}function qne(e,t){if(e===void 0)return t;let n;const o=/filename\*\s*=\s*UTF-8''([^;]+)/i.exec(e)?.[1]?.trim();if(o!==void 0)try{n=decodeURIComponent(o.replaceAll(/^"|"$/g,""))}catch{return t}else n=/filename\s*=\s*"([^"]*)"/i.exec(e)?.[1]??/filename\s*=\s*([^;]+)/i.exec(e)?.[1]?.trim();return n===void 0||n.length===0||n.length>200||n==="."||n===".."||/[\u0000-\u001F\u007F/\\]/.test(n)||!n.toLowerCase().endsWith(".zip")?t:n}function EC(e){if(typeof e!="object"||e===null)return{errorName:typeof e};const t=e;return{errorName:typeof t.name=="string"?t.name:"Error",errorCode:typeof t.code=="number"?t.code:void 0,requestId:typeof t.requestId=="string"?t.requestId:void 0,phase:typeof t.phase=="string"?t.phase:void 0,httpStatus:typeof t.status=="number"?t.status:void 0}}function dg(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 TC(e){return e==="auto_compact"||e==="manual_compact"}class jne{http;config;constructor(t){this.config=t,this.http=new Hne(t.serverHttpUrl,{clientId:t.clientId,clientName:t.clientName,clientVersion:t.clientVersion,clientUiMode:t.clientUiMode})}async getHealth(){return{status:"ok",uptimeSec:(await this.http.get("/healthz")).uptime_sec??0}}async getMeta(){const t=await this.http.get("/meta");return{serverVersion:t.server_version,serverId:t.server_id,startedAt:t.started_at,capabilities:t.capabilities,openInApps:Array.isArray(t.open_in_apps)?t.open_in_apps:[],dangerousBypassAuth:t.dangerous_bypass_auth===!0,backend:t.backend==="v2"?"v2":"v1"}}async listSessions(t){const n={before_id:t?.beforeId,after_id:t?.afterId,page_size:t?.pageSize,busy:t?.busy,include_archive:t?.includeArchive,archived_only:t?.archivedOnly,exclude_empty:t?.excludeEmpty,workspace_id:t?.workspaceId},o=await this.http.get("/sessions",n);return{items:o.items.map(Ni),hasMore:o.has_more}}async createSession(t){const n={metadata:t.cwd!==void 0?{cwd:t.cwd}:{}};t.workspaceId!==void 0&&(n.workspace_id=t.workspaceId),t.title!==void 0&&(n.title=t.title),t.model!==void 0&&(n.agent_config={model:t.model});const o=await this.http.post("/sessions",n);return Ni(o)}async getSession(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}`);return Ni(n)}async updateSession(t,n){const o={};n.title!==void 0&&(o.title=n.title),n.cwd!==void 0&&(o.metadata={cwd:n.cwd});const s={};n.model!==void 0&&(s.model=n.model),n.permissionMode!==void 0&&(s.permission_mode=n.permissionMode),n.planMode!==void 0&&(s.plan_mode=n.planMode),n.swarmMode!==void 0&&(s.swarm_mode=n.swarmMode),n.goalObjective!==void 0&&(s.goal_objective=n.goalObjective),n.goalControl!==void 0&&(s.goal_control=n.goalControl),n.thinking!==void 0&&(s.thinking=n.thinking),Object.keys(s).length>0&&(o.agent_config=s);const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/profile`,o);return Ni(i)}async getSessionStatus(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/status`);return{model:n.model&&n.model.length>0?n.model:null,thinkingEffort:n.thinking_level,permission:n.permission,planMode:n.plan_mode===!0,swarmMode:n.swarm_mode===!0,contextTokens:n.context_tokens??0,maxContextTokens:n.max_context_tokens??0,contextUsage:n.context_usage??0}}async getSessionGoal(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/goal`);return v5(n)}async getSessionWarnings(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/warnings`)).warnings??[]}async archiveSession(t){return await this.http.post(`/sessions/${encodeURIComponent(t)}:archive`,{})}async restoreSession(t){const n=await this.http.post(`/sessions/${encodeURIComponent(t)}:restore`,{});return Ni(n)}async listMessages(t,n){const o={before_id:n?.beforeId,after_id:n?.afterId,page_size:n?.pageSize,role:n?.role},s=await this.http.get(`/sessions/${encodeURIComponent(t)}/messages`,o);return{items:s.items.map(Wv),hasMore:s.has_more}}async getSessionSnapshot(t){const n=Date.now();ko("session:snapshot:start",{sessionId:t});try{const o=await this.http.get(`/sessions/${encodeURIComponent(t)}/snapshot`),s={asOfSeq:o.as_of_seq,epoch:o.epoch,session:Ni(o.session),messages:o.messages.items.map(Wv),hasMoreMessages:o.messages.has_more,inFlightTurn:o.in_flight_turn===null?null:{turnId:o.in_flight_turn.turn_id,assistantText:o.in_flight_turn.assistant_text,thinkingText:o.in_flight_turn.thinking_text,runningTools:o.in_flight_turn.running_tools.map(i=>({toolCallId:i.tool_call_id,name:i.name,args:i.args,description:i.description,lastProgress:i.last_progress})),promptId:o.in_flight_turn.current_prompt_id},pendingApprovals:o.pending_approvals.map(m5),pendingQuestions:o.pending_questions.map(g5),subagents:(o.subagents??[]).map(Rh)};return ko("session:snapshot:accepted",{sessionId:t,busy:s.session.busy,seq:s.asOfSeq,messageCount:s.messages.length,durationMs:Date.now()-n}),s}catch(o){throw ko("session:snapshot:failed",{sessionId:t,status:"failed",durationMs:Date.now()-n,...EC(o)}),o}}async exportSession(t,n){const o=n===void 0?0:new TextEncoder().encode(n).byteLength,s=n===void 0||n.length===0?0:n.split(`
285
+ `).length,i=await this.http.postZip(`/sessions/${encodeURIComponent(t)}/export`,{web_log:n},{web_log_bytes:o,web_log_entries:s}),r=`${t}.zip`;return{blob:i.blob,fileName:qne(i.contentDisposition,r)}}async submitPrompt(t,n){const o=Date.now();ko("prompt:start",{sessionId:t,contentCount:n.content.length,mediaCount:n.content.filter(s=>s.type==="image"||s.type==="video"||s.type==="file").length});try{const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts`,Xte(n));return ko("prompt:accepted",{sessionId:t,promptId:s.prompt_id,status:s.status,durationMs:Date.now()-o}),{promptId:s.prompt_id,userMessageId:s.user_message_id,status:s.status}}catch(s){throw ko("prompt:failed",{sessionId:t,status:"failed",durationMs:Date.now()-o,...EC(s)}),s}}async steerPrompts(t,n){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts:steer`,{prompt_ids:n});return{steered:o.steered,promptIds:o.prompt_ids}}async abortPrompt(t,n){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts/${encodeURIComponent(n)}:abort`,void 0,{allowCodes:[40903]});return{aborted:o.aborted,atSeq:o.at_seq}}async abortSession(t){return{aborted:(await this.http.post(`/sessions/${encodeURIComponent(t)}:abort`,{})).aborted}}async compactSession(t,n){await this.http.post(`/sessions/${encodeURIComponent(t)}:compact`,n?{instruction:n}:{})}async undoSession(t,n=1){await this.http.post(`/sessions/${encodeURIComponent(t)}:undo`,{count:n})}async forkSession(t,n){const o={};n?.title!==void 0&&(o.title=n.title);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}:fork`,o);return Ni(s)}async createChildSession(t,n){const o={};n?.title!==void 0&&(o.title=n.title);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/children`,o);return Ni(s)}async listChildSessions(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/children`)).items.map(Ni)}async startBtw(t){return{agentId:(await this.http.post(`/sessions/${encodeURIComponent(t)}:btw`,{})).agent_id}}async respondApproval(t,n,o){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/approvals/${encodeURIComponent(n)}`,Jte(o));return{resolved:s.resolved,resolvedAt:s.resolved_at}}async respondQuestion(t,n,o){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}`,one(o));return{resolved:s.resolved,resolvedAt:s.resolved_at}}async dismissQuestion(t,n){return{dismissed:!0,dismissedAt:(await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}:dismiss`,void 0,{allowCodes:[40909]})).dismissed_at}}async listTasks(t,n){const o={status:n};return(await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks`,o)).items.map(Rh)}async getTask(t,n,o){const s={with_output:o?.withOutput,output_bytes:o?.outputBytes},i=await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}`,s);return Rh(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(dg)}async createTerminal(t,n={}){const o={cwd:n.cwd,shell:n.shell,cols:n.cols,rows:n.rows},s=await this.http.post(`/sessions/${encodeURIComponent(t)}/terminals`,o);return dg(s)}async getTerminal(t,n){const o=await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}`);return dg(o)}async closeTerminal(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}:close`)}async listSkills(t){return((await this.http.get(`/sessions/${encodeURIComponent(t)}/skills`)).skills??[]).map(o=>({name:o.name,description:o.description,source:o.source}))}async listSkillsForWorkspace(t){return((await this.http.get(`/workspaces/${encodeURIComponent(t)}/skills`)).skills??[]).map(o=>({name:o.name,description:o.description,source:o.source}))}async activateSkill(t,n,o){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/skills/${encodeURIComponent(n)}:activate`,o!==void 0&&o.length>0?{args:o}:{});return{activated:s.activated,skillName:s.skill_name}}async listDirectory(t,n){const o={};n.path!==void 0&&(o.path=n.path),n.depth!==void 0&&(o.depth=n.depth),n.includeGitStatus!==void 0&&(o.include_git_status=n.includeGitStatus);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:list`,o),i=s.children_by_path?Object.fromEntries(Object.entries(s.children_by_path).map(([r,l])=>[r,l.map(yC)])):void 0;return{items:s.items.map(yC),childrenByPath:i,truncated:s.truncated}}async readFile(t,n){const o={path:n.path};n.offset!==void 0&&(o.offset=n.offset),n.length!==void 0&&(o.length=n.length);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:read`,o);return{path:s.path,content:s.content,encoding:s.encoding,size:s.size,truncated:s.truncated,etag:s.etag,mime:s.mime,languageId:s.language_id,lineCount:s.line_count,isBinary:s.is_binary}}async searchFiles(t,n){const o={query:n.query};n.limit!==void 0&&(o.limit=n.limit);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:search`,o);return{items:s.items.map(i=>({path:i.path,name:i.name,kind:i.kind,score:i.score,matchPositions:i.match_positions})),truncated:s.truncated}}async grepFiles(t,n){const o={pattern:n.pattern};n.regex!==void 0&&(o.regex=n.regex),n.caseSensitive!==void 0&&(o.case_sensitive=n.caseSensitive);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:grep`,o);return{files:s.files,filesScanned:s.files_scanned,truncated:s.truncated,elapsedMs:s.elapsed_ms}}async getGitStatus(t,n){const o={};n!==void 0&&(o.paths=n);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:git_status`,o);return{branch:s.branch,ahead:s.ahead,behind:s.behind,entries:s.entries,additions:s.additions,deletions:s.deletions,pullRequest:s.pullRequest??null}}async getFileDiff(t,n){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:diff`,{path:n});return{path:o.path,diff:o.diff}}getFileDownloadUrl(t,n){const o=n.split("/").map(s=>encodeURIComponent(s)).join("/");return Sc(this.config.serverHttpUrl,`/sessions/${encodeURIComponent(t)}/fs/${o}:download`)}async openFile(t,n){const o={path:n.path};return n.line!==void 0&&(o.line=n.line),this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open`,o)}async revealFile(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/fs:reveal`,{path:n.path})}async openInApp(t,n,o,s){const i={app_id:n,path:o};s!==void 0&&(i.line=s),await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open-in`,i)}async listWorkspaces(){try{return((await this.http.get("/workspaces")).items??[]).map(pd)}catch{return[]}}async addWorkspace(t){const n={root:t.root};t.name!==void 0&&(n.name=t.name);const o=await this.http.post("/workspaces",n);return pd(o)}async deleteWorkspace(t){await this.http.delete(`/workspaces/${encodeURIComponent(t)}`)}async updateWorkspace(t,n){const o=await this.http.patch(`/workspaces/${encodeURIComponent(t)}`,{name:n.name});return pd(o)}async browseFs(t){try{const n=await this.http.get("/fs:browse",{path:t});return{path:n.path,parent:n.parent,entries:(n.entries??[]).map(o=>({name:o.name,path:o.path,isDir:o.is_dir}))}}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(ine)}async listProviders(){return(await this.http.get("/providers")).items.map(kC)}async addProvider(t){const n={type:t.type};t.apiKey!==void 0&&(n.api_key=t.apiKey),t.baseUrl!==void 0&&(n.base_url=t.baseUrl),t.defaultModel!==void 0&&(n.default_model=t.defaultModel);const o=await this.http.post("/providers",n);return kC(o)}async deleteProvider(t){return this.http.delete(`/providers/${encodeURIComponent(t)}`)}async refreshProvider(t){const n=await this.http.post(`/providers/${encodeURIComponent(t)}:refresh`);return fg(n)}async refreshAllProviders(){const t=await this.http.post("/providers:refresh");return fg(t)}async refreshOAuthProviderModels(){const t=await this.http.post("/providers:refresh_oauth");return fg(t)}async getConfig(){const t=await this.http.get("/config");return zv(t)}async setConfig(t){const n={},o={providers:"providers",defaultProvider:"default_provider",defaultModel:"default_model",models:"models",thinking:"thinking",planMode:"plan_mode",yolo:"yolo",defaultPermissionMode:"default_permission_mode",defaultPlanMode:"default_plan_mode",permission:"permission",hooks:"hooks",services:"services",mergeAllAvailableSkills:"merge_all_available_skills",extraSkillDirs:"extra_skill_dirs",loopControl:"loop_control",background:"background",experimental:"experimental",telemetry:"telemetry",raw:"raw"};for(const[i,r]of Object.entries(t)){const l=o[i];l!==void 0&&(n[l]=r)}const s=await this.http.post("/config",n);return zv(s)}async getAuth(){const t=await this.http.get("/auth");return{ready:t.ready,providersCount:t.providers_count,defaultModel:t.default_model,managedProvider:t.managed_provider?{status:t.managed_provider.status}:null}}async startOAuthLogin(){const t=await this.http.post("/oauth/login",{});return t.status==="authenticated"?{flowId:t.flow_id,provider:t.provider,status:"authenticated"}:{flowId:t.flow_id,provider:t.provider,status:"pending",verificationUri:t.verification_uri,verificationUriComplete:t.verification_uri_complete,userCode:t.user_code,expiresIn:t.expires_in,interval:t.interval,expiresAt:t.expires_at}}async pollOAuthLogin(){const t=await this.http.get("/oauth/login");return t?{flowId:t.flow_id,status:t.status,resolvedAt:t.resolved_at}:null}async cancelOAuthLogin(){const t=await this.http.delete("/oauth/login");return{cancelled:t.cancelled,status:t.status}}async logout(){return{loggedOut:(await this.http.post("/oauth/logout",{})).logged_out}}async uploadFile(t){const n=new FormData;n.append("file",t.file,t.name??(t.file instanceof File?t.file.name:"upload")),t.name!==void 0&&n.append("name",t.name);const o=await this.http.postForm("/files",n);return{id:o.id,name:o.name,mediaType:o.media_type,size:o.size}}getFileUrl(t){return Sc(this.config.serverHttpUrl,`/files/${encodeURIComponent(t)}`)}async getFileBlob(t){return this.http.getBlob(`/files/${encodeURIComponent(t)}`)}connectEvents(t){const n=MI(this.config.serverHttpUrl,this.config.clientId),o=xne(),s=new Une(n,this.config.clientId,{onWireEvent:i=>{const r=rne(i),l=lne(i),a=sne(i);a.type==="historyCompacted"&&!TC(a.reason)&&t.onResync(a.sessionId,a.beforeSeq),t.onEvent(a,{sessionId:r,seq:l})},onRawAgentEvent:i=>{const{type:r,seq:l,session_id:a,payload:c,offset:u}=i,d=o.project(r,c,a,{offset:u});for(const f of d){const h=c?.turnId,p=f.type==="assistantDelta"&&typeof h=="number"&&typeof u=="number"&&(r==="assistant.delta"||r==="thinking.delta")?{turnId:h,offset:u,kind:r==="assistant.delta"?"text":"thinking"}:void 0;f.type==="historyCompacted"&&!TC(f.reason)&&t.onResync(a,l),t.onEvent(f,{sessionId:a,seq:l,stream:p})}},onResync:(i,r,l)=>{o.reset(i),t.onResync(i,r,l)},onConnectionState:i=>{t.onConnectionChange(i)},onError:(i,r,l)=>{t.onError(i,r,l)},onTerminalOutput:(i,r,l,a)=>{t.onTerminalOutput?.(i,r,l,a)},onTerminalExit:(i,r,l)=>{t.onTerminalExit?.(i,r,l)}});return s.connect(),{subscribe(i,r){s.subscribe(i,r??{seq:0})},unsubscribe(i){s.unsubscribe(i)},seedSnapshot(i,r){if(r.inFlightTurn===null){o.reset(i);return}const l=o.seedInFlight(i,r.inFlightTurn);for(const a of l)t.onEvent(a,{sessionId:i,seq:r.asOfSeq})},bindNextPromptId(i,r){o.bindNextPromptId(i,r)},abort(i,r){s.abort(i,r)},terminalAttach(i,r,l){s.terminalAttach(i,r,l)},terminalInput(i,r,l){s.terminalInput(i,r,l)},terminalResize(i,r,l,a){s.terminalResize(i,r,l,a)},terminalDetach(i,r){s.terminalDetach(i,r)},terminalClose(i,r){s.terminalClose(i,r)},markSideChannelAgent(i){o.markSideChannelAgent(i)},health(){return s.health()},reconnect(){s.reconnect()},close(){s.close()}}}}function fg(e){return{changed:e.changed.map(t=>({providerId:t.provider_id,providerName:t.provider_name,added:t.added,removed:t.removed})),unchanged:e.unchanged,failed:e.failed}}let NC;function dt(){return NC??=new jne(wI()),NC}const Vne=["src","controls","muted"],Kne=["src","alt"],w5=Ze({__name:"AuthMedia",props:{url:{},kind:{},alt:{},fileId:{},mediaClass:{default:"u-img"},controls:{type:Boolean,default:!0},muted:{type:Boolean,default:!1}},setup(e){const t=e,n=J(t.fileId?"":t.url),o=J(null),s=J(!t.fileId);let i=null,r=0,l=!1,a=null;function c(){i!==null&&(URL.revokeObjectURL(i),i=null)}async function u(){const d=++r;if(c(),!t.fileId){n.value=t.url;return}if(s.value)try{const f=await dt().getFileBlob(t.fileId),h=URL.createObjectURL(f);if(l||d!==r){URL.revokeObjectURL(h);return}i=h,n.value=i}catch{if(l||d!==r)return;n.value=t.url}}return Qe(()=>[t.fileId,t.url,s.value],u,{immediate:!0}),cn(()=>{typeof IntersectionObserver=="function"&&o.value?(a=new IntersectionObserver(d=>{d[0]?.isIntersecting&&(s.value=!0,a?.disconnect(),a=null)},{rootMargin:"200px"}),a.observe(o.value)):s.value=!0}),po(()=>{l=!0,a?.disconnect(),a=null,c()}),(d,f)=>e.kind==="video"?(w(),T("video",{key:0,ref_key:"mediaEl",ref:o,class:We(e.mediaClass),src:n.value||void 0,controls:e.controls,muted:e.muted,playsinline:"",preload:"metadata"},null,10,Vne)):(w(),T("img",{key:1,ref_key:"mediaEl",ref:o,class:We(e.mediaClass),src:n.value||void 0,alt:e.alt||"",loading:"lazy"},null,10,Kne))}}),Gne=["title","data-kind"],Yne=["aria-label"],Zne={class:"att-tile"},Qne={class:"att-name"},Xne={key:1,class:"att-err"},Jne=["aria-label"],eoe=Ze({__name:"AttachmentChip",props:{kind:{},name:{},url:{},fileId:{},mediaType:{},size:{},uploading:{type:Boolean,default:!1},error:{type:Boolean,default:!1},removable:{type:Boolean,default:!1},removeLabel:{}},emits:["activate","remove"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Tt(),i=R(()=>{const d=n.name?.match(/\.([A-Za-z0-9]{1,8})$/)?.[1]??n.mediaType?.split("/")[1]?.split("+")[0];return d?d.toUpperCase():void 0}),r=R(()=>{const u=i.value??"";return/^(txt|md|doc|docx|rtf|log)$/i.test(u)?"file-text":"file"}),l=R(()=>n.name?n.name:n.kind==="image"?s("composer.attachmentImage"):n.kind==="video"?s("composer.attachmentVideo"):s("composer.attachmentFile"));function a(u){return u<1024?`${u} B`:u<1024*1024?`${Math.round(u/1024)} KB`:`${(u/(1024*1024)).toFixed(1)} MB`}const c=R(()=>{const u=[l.value];return n.size!==void 0&&u.push(a(n.size)),u.join(" · ")});return(u,d)=>(w(),T("span",{class:We(["att-chip",{"is-error":e.error,uploading:e.uploading}]),title:c.value,"data-kind":e.kind},[_("button",{type:"button",class:"att-activate","aria-label":c.value,onClick:d[0]||(d[0]=f=>o("activate"))},[_("span",Zne,[e.kind==="image"&&e.url?(w(),we(w5,{key:0,url:e.url,kind:"image",alt:e.name,"file-id":e.fileId,"media-class":"att-thumb"},null,8,["url","alt","file-id"])):e.kind==="video"?(w(),we(Ve,{key:1,name:"play",size:"sm"})):e.kind==="image"?(w(),we(Ve,{key:2,name:"image",size:"sm"})):(w(),we(Ve,{key:3,name:r.value,size:"sm"},null,8,["name"]))]),_("span",Qne,O(l.value),1),e.uploading?(w(),we(Ds,{key:0,size:"sm",label:C(s)("composer.uploading")},null,8,["label"])):e.error?(w(),T("span",Xne,[re(Ve,{name:"info",size:"sm"})])):ce("",!0)],8,Yne),e.removable?(w(),we(Xt,{key:0,text:e.removeLabel??C(s)("composer.remove")},{default:Ee(()=>[_("button",{type:"button",class:"att-rm","aria-label":e.removeLabel??C(s)("composer.remove"),onClick:d[1]||(d[1]=f=>o("remove"))},[re(Ve,{name:"close",size:"sm"})],8,Jne)]),_:1},8,["text"])):ce("",!0)],10,Gne))}}),_5=ct(eoe,[["__scopeId","data-v-12ec975b"]]),toe=["aria-label"],noe=120,ooe=60,soe=Ze({__name:"MoonSpinner",props:{size:{default:"md"},fast:{type:Boolean},label:{default:"Waiting for response…"}},setup(e){const t=["🌑","🌒","🌓","🌔","🌕","🌖","🌗","🌘"];function n(o){return{"--moon-frame-delay":`${o*noe}ms`,"--moon-frame-fast-delay":`${o*ooe}ms`}}return(o,s)=>(w(),T("span",{class:We(["ui-moon",[`ui-moon--${e.size}`,{"ui-moon--fast":e.fast}]]),"aria-label":e.label,role:"img"},[(w(),T(Pe,null,ot(t,(i,r)=>_("span",{key:i,class:"ui-moon__frame",style:Yt(n(r)),"aria-hidden":"true"},O(i),5)),64))],10,toe))}}),S5=ct(soe,[["__scopeId","data-v-a6b7ec07"]]),tr=J(null),Vc=J(!1);function Ok(e){const t=tr.value;!t||Vc.value||(tr.value=null,t.resolve(e))}async function ioe(){const e=tr.value;if(!(!e||Vc.value)){if(!e.action){Ok(!0);return}Vc.value=!0;try{await e.action(),tr.value===e&&(tr.value=null),e.resolve(!0)}catch(t){tr.value===e&&(tr.value=null),e.reject(t)}finally{Vc.value=!1}}}function roe(e){return Vc.value?Promise.resolve(!1):(tr.value&&Ok(!1),new Promise((t,n)=>{tr.value={...e,resolve:t,reject:n}}))}function tf(){return{current:tr,busy:Vc,confirm:roe,settle:Ok,runAction:ioe}}const loe=/^(application\/pdf|image\/(png|jpe?g|gif|webp|avif|bmp|x-icon|vnd\.microsoft\.icon)|video\/[\w.+-]+|audio\/[\w.+-]+)$/i,aoe=/^(txt|md|markdown|log|json|ya?ml|csv|tsv|ts|mts|tsx|jsx|css|py|go|rs|java|c|h|cc|cpp|hpp|sh|zsh|sql|toml|ini|cfg|conf|vue)$/i,coe=/^(png|jpe?g|gif|webp|avif|bmp|ico)$/i,IC="text/plain;charset=utf-8";function uoe(e,t){const n=(t??"").toLowerCase();if(loe.test(n))return n;if(n.startsWith("text/"))return n==="text/html"?null:IC;const o=e?.match(/\.([A-Za-z0-9]{1,8})$/)?.[1]?.toLowerCase();return o===void 0?null:aoe.test(o)?IC:coe.test(o)?`image/${o==="jpg"?"jpeg":o==="ico"?"x-icon":o}`:o==="pdf"?"application/pdf":null}async function C5(e,t,n){const o=uoe(t,n);if(o===null)return"unsupported";const s=window.open("","_blank");s!==null&&(s.opener=null);const i=await dt().getFileBlob(e).catch(()=>null);if(i===null)return s?.close(),"failed";const r=URL.createObjectURL(new Blob([i],{type:o}));if(s!==null)s.location.href=r;else{const l=document.createElement("a");l.href=r,l.download=t??e,l.click()}return setTimeout(()=>{URL.revokeObjectURL(r)},6e4),"previewed"}const doe={class:"chat"},foe={key:0,class:"chat-loading"},hoe={class:"chat-loading-text"},poe={key:1,class:"chat-empty"},moe={key:1,class:"top-sentinel-text"},goe={key:0,class:"u-turn"},voe=["data-turn-id"],yoe={key:0,class:"u-atts"},koe={key:1,class:"skill-act"},boe={class:"skill-act-head"},xoe={key:0,class:"skill-act-args"},woe={key:2,class:"skill-act"},_oe={class:"skill-act-head"},Soe={key:0,class:"skill-act-args"},Coe={key:3,class:"u-text"},Aoe={key:0,class:"u-meta"},Moe=["aria-label","onClick"],Eoe=["aria-label","onClick"],Toe=["data-turn-id"],Noe=["onClick"],Ioe={class:"cd-view"},Loe={key:1,class:"cd-label"},$oe=["data-turn-id"],Foe={key:1,class:"msg"},Ooe={key:0,class:"a-msg-ft"},Roe={key:0,class:"a-duration"},Boe=["aria-label","onClick"],Doe={key:4,class:"sending-placeholder"},Poe={key:5,class:"q-stack"},Hoe={class:"q-head"},Woe={class:"q-title"},zoe={class:"q-hint"},Uoe=["onDragover","onDrop"],qoe={class:"u-bub q-bub"},joe=["title","onDragstart"],Voe=["title","onClick"],Koe={key:0,class:"u-text q-text"},Goe={key:1,class:"q-text q-text-placeholder"},Yoe={key:0,class:"q-imgs"},Zoe={key:0,class:"q-file"},Qoe={key:1,class:"q-tag q-tag-next"},Xoe={key:2,class:"q-tag q-tag-idx"},Joe=["aria-label","onClick"],ese={key:0,class:"open-unsupported",role:"status"},tse=2500,nse=Ze({__name:"ChatPane",props:{turns:{},approvals:{default:()=>[]},turnActive:{type:Boolean,default:!1},working:{type:Boolean,default:!1},fastMoon:{type:Boolean,default:!1},sessionLoading:{type:Boolean},compaction:{default:null},hasMoreMessages:{type:Boolean,default:!1},loadingMore:{type:Boolean,default:!1},loadingMoreError:{type:Boolean,default:!1},isFollowing:{type:Boolean,default:!1},toolDiffPanel:{type:Boolean,default:!1},queued:{default:()=>[]}},emits:["openFile","openMedia","copyConversationCopied","openThinking","openCompaction","openAgent","openToolDiff","editMessage","loadOlderMessages","unqueue","editQueued","reorderQueue"],setup(e,{expose:t,emit:n}){const{t:o}=Tt(),{confirm:s}=tf();bn(()=>{K!==null&&(clearTimeout(K),K=null),N!==null&&(clearTimeout(N),N=null),L!==null&&(clearTimeout(L),L=null),ue!==null&&(clearTimeout(ue),ue=null)});const i=e,r=J(null);let l=null;function a(){!r.value||typeof IntersectionObserver>"u"||(l?.disconnect(),l=new IntersectionObserver(Ie=>{Ie[0]?.isIntersecting&&i.hasMoreMessages&&!i.loadingMore&&!i.loadingMoreError&&!i.sessionLoading&&!i.isFollowing&&d("loadOlderMessages")},{root:null,rootMargin:"200px 0px 0px 0px",threshold:0}),l.observe(r.value))}cn(a),bn(()=>{l?.disconnect(),l=null}),Qe(()=>[i.hasMoreMessages,i.loadingMore,i.loadingMoreError],()=>{mt().then(a)});const c=R(()=>{if(!i.turnActive||i.turns.length===0)return null;const Ie=i.turns.at(-1);return Ie.role==="assistant"?Ie.id:null}),u=R(()=>i.working),d=n,f=J(null),h=J(null);function p(Ie){return(Ie.attachments?.length??0)>0}function g(Ie){d("editQueued",Ie)}function b(Ie,le){if(f.value=Ie,!le.dataTransfer)return;le.dataTransfer.effectAllowed="move",le.dataTransfer.setData("text/plain",String(Ie));const z=le.currentTarget?.closest(".q-turn");z&&le.dataTransfer.setDragImage(z,24,24)}function v(Ie,le){if(f.value===null)return;le.preventDefault(),le.dataTransfer&&(le.dataTransfer.dropEffect="move");const z=le.currentTarget.getBoundingClientRect(),ae=le.clientY<z.top+z.height/2?"before":"after";h.value={index:Ie,position:ae}}function m(Ie,le){le.preventDefault();const z=f.value,ae=h.value?.position??"before";if(f.value=null,h.value=null,z===null)return;let ie=ae==="before"?Ie:Ie+1;z<ie&&(ie-=1),z!==ie&&d("reorderQueue",{from:z,to:ie})}function y(){f.value=null,h.value=null}const k=R(()=>{for(let Ie=i.turns.length-1;Ie>=0;Ie--)if(i.turns[Ie].role==="user")return i.turns[Ie].id;return null});function A(Ie){return Ie.role==="user"&&Ie.id===k.value&&!i.working&&!Ie.skillActivation&&!Ie.pluginCommand}function $(Ie){const le=Ie.compaction,z=le?.trigger==="auto"?o("conversation.compactedAuto"):o("conversation.compactedPlain");return typeof le?.tokensBefore=="number"&&typeof le?.tokensAfter=="number"?z+o("conversation.compactedTokens",{before:ir(le.tokensBefore),after:ir(le.tokensAfter)}):z}const I=J(null),x=J(null);let L=null;async function E(Ie){await s({title:o("conversation.undo"),message:o("conversation.undoConfirm"),variant:"primary"})&&F(Ie)}function F(Ie){x.value===null&&(x.value=Ie.id,d("editMessage",{text:Ie.text,attachments:Ie.attachments}),L=setTimeout(()=>{L=null,x.value=null},tse))}Qe(()=>i.turns,Ie=>{x.value!==null&&(Ie.some(le=>le.id===x.value)||(x.value=null,L!==null&&(clearTimeout(L),L=null)))},{flush:"post"});const S=J(!1);let N=null;function D(){if(i.turns.length===0)return;const Ie=[];for(const z of i.turns){if(z.role==="compaction"||z.role==="cron")continue;const ae=z.role==="user"?"User":"Assistant",ie=SW(z);ie.trim()&&Ie.push(`**${ae}**
286
+
287
+ ${ie}`)}const le=Ie.join(`
288
+
289
+ ---
290
+
291
+ `);Go(le).then(z=>{z&&(S.value=!0,d("copyConversationCopied"),N!==null&&clearTimeout(N),N=setTimeout(()=>{N=null,S.value=!1},2e3))}).catch(()=>{})}function B(Ie){const le=[];for(let z=Ie;z>=0;z--){const ae=i.turns[z];if(!ae||ae.role!=="assistant")break;le.unshift(ae)}return le}function U(Ie){return B(Ie).map(le=>_W(le)).filter(Boolean).join(`
292
+
293
+ `)}function H(){for(let Ie=i.turns.length-1;Ie>=0;Ie-=1)if(i.turns[Ie]?.role==="assistant")return U(Ie);return""}function P(){const Ie=H();Ie.trim()&&Go(Ie).then(le=>{le&&(S.value=!0,d("copyConversationCopied"),N!==null&&clearTimeout(N),N=setTimeout(()=>{N=null,S.value=!1},2e3))}).catch(()=>{})}t({copyConversation:D,copyFinalSummary:P});function Z(Ie){const le=i.turns[Ie];if(!le||le.role!=="assistant")return!1;const z=i.turns[Ie+1];return!z||z.role!=="assistant"}let K=null;function V(Ie){const le=i.turns[Ie];if(!le)return;const z=U(Ie);z.trim()&&Go(z).then(ae=>{ae&&(I.value=le.id,K!==null&&clearTimeout(K),K=setTimeout(()=>{K=null,I.value=null},1400))}).catch(()=>{})}function X(Ie){const le=Ie.text;le.trim()&&Go(le).then(z=>{z&&(I.value=Ie.id,K!==null&&clearTimeout(K),K=setTimeout(()=>{K=null,I.value=null},1400))}).catch(()=>{})}function he(Ie){return{kind:Ie.kind==="video"?"video":"image",url:Ie.url,path:Ie.name,fileId:Ie.fileId}}const ne=J(null);let ue=null;function de(Ie){if(Ie.kind==="image"||Ie.kind==="video"){d("openMedia",he(Ie));return}Ie.fileId!==void 0&&C5(Ie.fileId,Ie.name,Ie.mediaType).then(le=>{le==="unsupported"&&(ne.value=Ie.name??Ie.fileId??"",ue!==null&&clearTimeout(ue),ue=setTimeout(()=>{ue=null,ne.value=null},2400))})}function Ce(Ie,le){return Ie.id!==c.value?!1:le.sourceIndex===xm(Ie).length-1}return(Ie,le)=>(w(),T(Pe,null,[_("div",doe,[e.sessionLoading?(w(),T("div",foe,[re(Ds,{size:"sm"}),_("span",hoe,O(C(o)("conversation.loading")),1)])):e.turns.length===0&&(!e.approvals||e.approvals.length===0)?(w(),T("div",poe)):ce("",!0),e.hasMoreMessages||e.loadingMore?(w(),T("div",{key:2,ref_key:"topSentinelRef",ref:r,class:We(["top-sentinel",{"top-sentinel-loading":e.loadingMore}])},[e.loadingMore?(w(),T("span",moe,[re(Ds,{size:"sm"}),Je(" "+O(C(o)("conversation.loadingOlder")),1)])):(w(),T("button",{key:0,type:"button",class:"top-sentinel-btn",onClick:le[0]||(le[0]=z=>d("loadOlderMessages"))},O(C(o)("conversation.loadOlder")),1))],2)):ce("",!0),(w(!0),T(Pe,null,ot(e.turns,(z,ae)=>(w(),T(Pe,{key:z.id},[z.role==="user"?(w(),T("div",goe,[_("div",{class:We(["u-bub turn-anchor",{undoing:x.value===z.id}]),"data-turn-id":z.id},[z.attachments&&z.attachments.length>0?(w(),T("div",yoe,[(w(!0),T(Pe,null,ot(z.attachments,(ie,q)=>(w(),we(_5,{key:q,kind:ie.kind,name:ie.name,url:ie.url,"file-id":ie.fileId,"media-type":ie.mediaType,size:ie.size,onActivate:ee=>de(ie)},null,8,["kind","name","url","file-id","media-type","size","onActivate"]))),128))])):ce("",!0),z.skillActivation?(w(),T("div",koe,[_("div",boe,[le[9]||(le[9]=_("span",{class:"skill-act-arrow"},"▶",-1)),_("span",null,O(C(o)("conversation.activatedSkill",{name:z.skillActivation.name})),1)]),z.skillActivation.args?(w(),T("div",xoe,O(z.skillActivation.args),1)):ce("",!0)])):z.pluginCommand?(w(),T("div",woe,[_("div",_oe,[le[10]||(le[10]=_("span",{class:"skill-act-arrow"},"▶",-1)),_("span",null,"/"+O(z.pluginCommand.pluginId)+":"+O(z.pluginCommand.commandName),1)]),z.pluginCommand.args?(w(),T("div",Soe,O(z.pluginCommand.args),1)):ce("",!0)])):(w(),T("div",Coe,O(z.text),1))],10,voe),z.createdAt||A(z)?(w(),T("div",Aoe,[A(z)?(w(),T("div",{key:0,class:We(["u-edit-wrap",{undoing:x.value===z.id}])},[_("button",{type:"button",class:"u-edit","aria-label":C(o)("conversation.undoTooltip"),onClick:ie=>E(z)},[re(Ve,{name:"undo",size:"sm"})],8,Moe)],2)):ce("",!0),z.text.trim().length>0?(w(),T("button",{key:1,type:"button",class:"u-copy","aria-label":C(o)("filePreview.copy"),onClick:bt(ie=>X(z),["stop"])},[I.value!==z.id?(w(),we(Ve,{key:0,name:"copy",size:"sm"})):(w(),we(Ve,{key:1,name:"check",size:"sm"}))],8,Eoe)):ce("",!0),z.createdAt?(w(),we(d5,{key:2,time:z.createdAt},null,8,["time"])):ce("",!0)])):ce("",!0)])):z.role==="compaction"?(w(),T("div",{key:1,class:"compact-divider turn-anchor","data-turn-id":z.id,role:"separator"},[le[11]||(le[11]=_("span",{class:"cd-line","aria-hidden":"true"},null,-1)),z.text?(w(),T("button",{key:0,type:"button",class:"cd-label cd-btn",onClick:ie=>d("openCompaction",{turnId:z.id})},[_("span",null,O($(z)),1),_("span",Ioe,O(C(o)("conversation.viewSummary")),1)],8,Noe)):(w(),T("span",Loe,O($(z)),1)),le[12]||(le[12]=_("span",{class:"cd-line","aria-hidden":"true"},null,-1))],8,Toe)):z.role==="cron"?(w(),we($te,{key:2,text:z.text,cron:z.cron,"turn-id":z.id,"created-at":z.createdAt},null,8,["text","cron","turn-id","created-at"])):(w(),T("div",{key:3,class:"a-msg turn-anchor","data-turn-id":z.id},[(w(!0),T(Pe,null,ot(C(wW)(z),(ie,q)=>(w(),T(Pe,{key:C(CW)(ie,q)},[ie.kind==="thinking"?(w(),we(fte,{key:0,text:ie.thinking,mobile:"",streaming:Ce(z,ie),onOpen:ee=>d("openThinking",{turnId:z.id,blockIndex:ie.sourceIndex})},null,8,["text","streaming","onOpen"])):ie.kind==="text"&&ie.text?(w(),T("div",Foe,[re(Wm,{text:ie.text,streaming:Ce(z,ie),"open-file":ee=>d("openFile",ee)},null,8,["text","streaming","open-file"])])):ie.kind==="tool-stack"?(w(),we(LW,{key:2,tools:ie.tools,mobile:"","tool-diff-panel":e.toolDiffPanel,onOpenMedia:le[1]||(le[1]=ee=>d("openMedia",ee)),onOpenFile:le[2]||(le[2]=ee=>d("openFile",ee)),onOpenToolDiff:le[3]||(le[3]=ee=>d("openToolDiff",ee)),onOpenAgent:le[4]||(le[4]=ee=>d("openAgent",ee))},null,8,["tools","tool-diff-panel"])):ie.kind==="tool"?(w(),we(TA,{key:3,tool:ie.tool,mobile:"","tool-diff-panel":e.toolDiffPanel,onOpenMedia:le[5]||(le[5]=ee=>d("openMedia",ee)),onOpenFile:le[6]||(le[6]=ee=>d("openFile",ee)),onOpenToolDiff:le[7]||(le[7]=ee=>d("openToolDiff",ee)),onOpenAgent:le[8]||(le[8]=ee=>d("openAgent",ee))},null,8,["tool","tool-diff-panel"])):ce("",!0)],64))),128)),z.id!==c.value&&Z(ae)&&(U(ae).trim().length>0||z.durationMs!==void 0)?(w(),T("div",Ooe,[re(Xt,{text:`${z.durationMs} ms`},{default:Ee(()=>[z.durationMs!==void 0?(w(),T("span",Roe,O(C(kW)(z.durationMs)),1)):ce("",!0)]),_:2},1032,["text"]),U(ae).trim().length>0?(w(),T("button",{key:0,class:"a-cpbtn","aria-label":C(o)("filePreview.copy"),onClick:ie=>V(ae)},[I.value!==z.id?(w(),we(Ve,{key:0,name:"copy",size:"sm"})):(w(),we(Ve,{key:1,name:"check",size:"sm"}))],8,Boe)):ce("",!0)])):ce("",!0)],8,$oe))],64))),128)),e.compaction?(w(),we(vte,{key:3,label:C(o)("conversation.compacting")},null,8,["label"])):ce("",!0),u.value?(w(),T("div",Doe,[re(S5,{fast:e.fastMoon},null,8,["fast"])])):ce("",!0),e.queued.length>0?(w(),T("div",Poe,[_("div",Hoe,[_("span",Woe,[re(Ve,{name:"mail",size:"sm"}),Je(" "+O(C(o)("composer.queueLabel"))+" · ",1),_("b",null,O(e.queued.length),1)]),_("span",zoe,O(C(o)("composer.queueAutoDrain")),1)]),(w(!0),T(Pe,null,ot(e.queued,(z,ae)=>(w(),T("div",{key:ae,class:We(["u-turn q-turn",{"q-dragging":f.value===ae,"drop-before":h.value?.index===ae&&h.value.position==="before","drop-after":h.value?.index===ae&&h.value.position==="after"}]),onDragover:ie=>v(ae,ie),onDrop:ie=>m(ae,ie)},[_("div",qoe,[_("span",{class:"q-grip",title:C(o)("composer.queueDragTitle"),draggable:"true",onDragstart:ie=>b(ae,ie),onDragend:y},[re(Ve,{name:"grip",size:"sm"})],40,joe),_("button",{type:"button",class:"q-body",title:C(o)("composer.editQueued"),onClick:ie=>g(ae)},[z.text?(w(),T("span",Koe,O(z.text),1)):(w(),T("span",Goe,[re(Ve,{name:"file",size:"sm"}),Je(" "+O(C(o)("composer.queuedAttachments",{n:z.attachments?.length??0})),1)]))],8,Voe),p(z)?(w(),T("div",Yoe,[(w(!0),T(Pe,null,ot(z.attachments,(ie,q)=>(w(),T(Pe,{key:q},[ie.kind==="file"?(w(),T("span",Zoe,[re(Ve,{name:"file",size:"sm"}),Je(" "+O(ie.name??ie.fileId),1)])):(w(),we(w5,{key:1,url:ie.url,kind:ie.kind,"file-id":ie.fileId,"media-class":"q-img",controls:!1,muted:""},null,8,["url","kind","file-id"]))],64))),128))])):ce("",!0),ae===0?(w(),T("span",Qoe,O(C(o)("composer.queueNext")),1)):(w(),T("span",Xoe,"#"+O(ae+1),1)),_("button",{type:"button",class:"q-rm","aria-label":C(o)("composer.remove"),onClick:bt(ie=>d("unqueue",ae),["stop"])},[re(Ve,{name:"close",size:"sm"})],8,Joe)])],42,Uoe))),128))])):ce("",!0)]),ne.value!==null?(w(),T("div",ese,O(C(o)("composer.attachmentOpenUnsupported",{name:ne.value})),1)):ce("",!0)],64))}}),A5=ct(nse,[["__scopeId","data-v-7c31d582"]]),ose={class:"ch-id"},sse={key:0,class:"ch-ws"},ise={key:1,class:"ch-sep"},rse=["onKeydown"],lse={class:"ch-ses"},ase={key:0,class:"ch-pill ch-sync-pill"},cse={key:0,class:"ch-ahead"},use={key:1,class:"ch-behind"},dse={key:1,class:"ch-pill ch-diff-pill"},fse={key:0,class:"ch-add"},hse={key:1,class:"ch-del"},pse=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","exportSession"],setup(e,{emit:t}){const{t:n}=Tt(),o=e,s=t,i=R(()=>o.ahead??0),r=R(()=>o.behind??0),l=R(()=>o.gitDiffStats?.totalAdditions??0),a=R(()=>o.gitDiffStats?.totalDeletions??0),c=R(()=>l.value>0||a.value>0),u={open:"header.prStatusOpen",closed:"header.prStatusClosed",merged:"header.prStatusMerged",draft:"header.prStatusDraft"};function d(Z){return Z.trim().toLowerCase().replaceAll("_","-")}function f(Z){const K=d(Z);return u[K]?`pr-${K}`:"pr-unknown"}function h(Z){return n(u[d(Z)]??"header.prStatusUnknown")}const p=J(!1),g=J(null),b=J(null),v=J({});function m(Z){const K=Z.target;b.value?.el?.contains(K)||g.value?.el?.contains(K)||A()}function y(){A()}async function k(Z){if(Z.stopPropagation(),p.value){A();return}p.value=!0,document.addEventListener("mousedown",m),window.addEventListener("resize",y),await mt();const K=g.value?.el,V=b.value?.el;if(!K||!V)return;const X=K.getBoundingClientRect(),he=4,ne=8,ue=V.offsetWidth,de=V.offsetHeight;let Ce=X.bottom+he;Ce+de>window.innerHeight-ne&&(Ce=Math.max(ne,X.top-de-he));let Ie=X.left;Ie+ue>window.innerWidth-ne&&(Ie=Math.max(ne,X.right-ue)),v.value={top:`${Math.round(Ce)}px`,left:`${Math.round(Ie)}px`}}function A(){p.value=!1,document.removeEventListener("mousedown",m),window.removeEventListener("resize",y)}bn(()=>{document.removeEventListener("mousedown",m),window.removeEventListener("resize",y)});function $(){s("copyAll"),A()}function I(){s("copyFinalSummary"),A()}const x=J(!1);function L(){o.sessionId&&Go(o.sessionId).then(Z=>{Z&&(x.value=!0,setTimeout(()=>{x.value=!1},1200))})}const E=J(!1),F=J(""),S=J(null);async function N(){if(A(),!!o.sessionId){E.value=!0,F.value=o.sessionTitle??"",await mt();try{S.value?.focus(),S.value?.select()}catch{}}}function D(){const Z=F.value.trim();Z&&o.sessionId&&Z!==(o.sessionTitle??"").trim()&&s("renameSession",o.sessionId,Z),E.value=!1}function B(){E.value=!1}function U(){o.sessionId&&(A(),s("forkSession",o.sessionId))}function H(){o.sessionId&&(A(),s("exportSession",o.sessionId))}function P(){o.sessionId&&(A(),s("archiveSession",o.sessionId))}return(Z,K)=>(w(),T("header",{class:We(["chat-header",{"macos-desktop":C(Dc)}])},[_("div",ose,[e.workspaceName?(w(),T("span",sse,O(e.workspaceName),1)):ce("",!0),e.workspaceName&&e.sessionTitle?(w(),T("span",ise,"/")):ce("",!0),E.value?Fn((w(),T("input",{key:2,ref_key:"renameInputRef",ref:S,"onUpdate:modelValue":K[0]||(K[0]=V=>F.value=V),class:"ch-rename",type:"text",onKeydown:[nr(bt(D,["stop"]),["enter"]),nr(bt(B,["stop"]),["esc"])],onBlur:D,onClick:K[1]||(K[1]=bt(()=>{},["stop"]))},null,40,rse)),[[_s,F.value]]):e.sessionTitle?(w(),we(Xt,{key:3,text:e.sessionTitle},{default:Ee(()=>[_("span",lse,O(e.sessionTitle),1)]),_:1},8,["text"])):ce("",!0)]),re(Pn,{ref_key:"kebabRef",ref:g,class:We(["ch-act-more",{open:p.value}]),label:C(n)("header.options"),"aria-expanded":p.value,"aria-haspopup":"menu",onClick:K[2]||(K[2]=bt(V=>k(V),["stop"]))},{default:Ee(()=>[re(Ve,{name:"dots-horizontal",size:"md"})]),_:1},8,["class","label","aria-expanded"]),p.value?(w(),we(kl,{key:0,ref_key:"menuRef",ref:b,class:"ch-menu",style:Yt(v.value),onClick:K[3]||(K[3]=bt(()=>{},["stop"]))},{default:Ee(()=>[re(pn,{onClick:$},{default:Ee(()=>[re(Ve,{name:e.copied?"check":"copy",size:"sm"},null,8,["name"]),Je(" "+O(e.copied?C(n)("header.copied"):C(n)("header.copyAll")),1)]),_:1}),re(pn,{onClick:I},{default:Ee(()=>[re(Ve,{name:"file-text",size:"sm"}),Je(" "+O(C(n)("header.copyFinalSummary")),1)]),_:1}),e.sessionId?(w(),T(Pe,{key:0},[re(pn,{separator:""}),re(pn,{onClick:L},{default:Ee(()=>[re(Ve,{name:x.value?"check":"copy",size:"sm"},null,8,["name"]),Je(" "+O(x.value?C(n)("header.copied"):C(n)("header.copySessionId")),1)]),_:1}),re(pn,{onClick:N},{default:Ee(()=>[re(Ve,{name:"pencil",size:"sm"}),Je(" "+O(C(n)("header.renameSession")),1)]),_:1}),re(pn,{onClick:U},{default:Ee(()=>[re(Ve,{name:"git-fork",size:"sm"}),Je(" "+O(C(n)("header.forkSession")),1)]),_:1}),re(pn,{onClick:H},{default:Ee(()=>[re(Ve,{name:"download",size:"sm"}),Je(" "+O(C(n)("header.exportSession")),1)]),_:1}),re(pn,{danger:"",onClick:P},{default:Ee(()=>[re(Ve,{name:"archive",size:"sm"}),Je(" "+O(C(n)("header.archiveSession")),1)]),_:1})],64)):ce("",!0)]),_:1},8,["style"])):ce("",!0),K[6]||(K[6]=_("div",{class:"ch-spacer"},null,-1)),e.isGitRepo?(w(),T("button",{key:1,type:"button",class:"ch-git",onClick:K[4]||(K[4]=V=>s("openChanges"))},[_("span",{class:We(["ch-branch",{"ch-detached":!e.branch}])},O(e.branch||C(n)("header.detached")),3),i.value>0||r.value>0?(w(),T("span",ase,[i.value>0?(w(),T("span",cse,"↑"+O(i.value),1)):ce("",!0),r.value>0?(w(),T("span",use,"↓"+O(r.value),1)):ce("",!0)])):ce("",!0),c.value?(w(),T("span",dse,[l.value>0?(w(),T("span",fse,"+"+O(l.value),1)):ce("",!0),a.value>0?(w(),T("span",hse,"-"+O(a.value),1)):ce("",!0)])):ce("",!0)])):ce("",!0),e.pr?(w(),T("button",{key:2,type:"button",class:We(["ch-pill ch-pr",f(e.pr.state)]),onClick:K[5]||(K[5]=V=>e.pr&&s("openPr",e.pr.url))},[re(Ve,{name:"git-pull-request",size:"sm"}),_("span",null,"PR #"+O(e.pr.number)+" · "+O(h(e.pr.state)),1)],2)):ce("",!0)],2))}}),mse=ct(pse,[["__scopeId","data-v-fa4451d4"]]),gse=["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"],LC=[[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 vse(e){if(e<=255)return gse[e];let t=0,n=LC.length-1;for(;t<=n;){const o=t+n>>1,s=LC[o];if(e<s[0]){n=o-1;continue}if(e>s[1]){t=o+1;continue}return s[2]}return"L"}function yse(e){const t=e.length;if(t===0)return null;const n=new Array(t);let o=!1;for(let c=0;c<t;){const u=e.charCodeAt(c);let d=u,f=1;if(u>=55296&&u<=56319&&c+1<t){const p=e.charCodeAt(c+1);p>=56320&&p<=57343&&(d=(u-55296<<10)+(p-56320)+65536,f=2)}const h=vse(d);(h==="R"||h==="AL"||h==="AN")&&(o=!0);for(let p=0;p<f;p++)n[c+p]=h;c+=f}if(!o)return null;let s=0;for(let c=0;c<t;c++){const u=n[c];if(u==="L"){s=0;break}if(u==="R"||u==="AL"){s=1;break}}const i=new Int8Array(t);for(let c=0;c<t;c++)i[c]=s;const r=s&1?"R":"L",l=r;let a=l;for(let c=0;c<t;c++)n[c]==="NSM"?n[c]=a:a=n[c];a=l;for(let c=0;c<t;c++){const u=n[c];u==="EN"?n[c]=a==="AL"?"AN":"EN":(u==="R"||u==="L"||u==="AL")&&(a=u)}for(let c=0;c<t;c++)n[c]==="AL"&&(n[c]="R");for(let c=1;c<t-1;c++)n[c]==="ES"&&n[c-1]==="EN"&&n[c+1]==="EN"&&(n[c]="EN"),n[c]==="CS"&&(n[c-1]==="EN"||n[c-1]==="AN")&&n[c+1]===n[c-1]&&(n[c]=n[c-1]);for(let c=0;c<t;c++){if(n[c]!=="EN")continue;let u;for(u=c-1;u>=0&&n[u]==="ET";u--)n[u]="EN";for(u=c+1;u<t&&n[u]==="ET";u++)n[u]="EN"}for(let c=0;c<t;c++){const u=n[c];(u==="WS"||u==="ES"||u==="ET"||u==="CS")&&(n[c]="ON")}a=l;for(let c=0;c<t;c++){const u=n[c];u==="EN"?n[c]=a==="L"?"L":"EN":(u==="R"||u==="L")&&(a=u)}for(let c=0;c<t;c++){if(n[c]!=="ON")continue;let u=c+1;for(;u<t&&n[u]==="ON";)u++;const d=c>0?n[c-1]:l,f=u<t?n[u]:l,h=d!=="L"?"R":"L";if(h===(f!=="L"?"R":"L"))for(let g=c;g<u;g++)n[g]=h;c=u-1}for(let c=0;c<t;c++)n[c]==="ON"&&(n[c]=r);for(let c=0;c<t;c++){const u=n[c];(i[c]&1)===0?u==="R"?i[c]++:(u==="AN"||u==="EN")&&(i[c]+=2):(u==="L"||u==="AN"||u==="EN")&&i[c]++}return i}function kse(e,t){const n=yse(e);if(n===null)return null;const o=new Int8Array(t.length);for(let s=0;s<t.length;s++)o[s]=n[t[s]];return o}const bse=/[ \t\n\r\f]+/g,xse=/[\t\n\r\f]| {2,}|^ | $/;function wse(e){const t=e??"normal";return t==="pre-wrap"?{mode:t,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:t,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function _se(e){if(!xse.test(e))return e;let t=e.replace(bse," ");return t.charCodeAt(0)===32&&(t=t.slice(1)),t.length>0&&t.charCodeAt(t.length-1)===32&&(t=t.slice(0,-1)),t}function Sse(e){return/[\r\f]/.test(e)?e.replace(/\r\n/g,`
294
+ `).replace(/[\r\f]/g,`
295
+ `):e}let hg=null,Cse;function Ase(){return hg===null&&(hg=new Intl.Segmenter(Cse,{granularity:"word"})),hg}const Mse=/\p{Script=Arabic}/u,zl=/\p{M}/u,Rk=/\p{Nd}/u;function $C(e){return Mse.test(e)}function FC(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=183984&&e<=191471||e>=191472&&e<=192093||e>=194560&&e<=195103||e>=196608&&e<=201551||e>=201552&&e<=205743||e>=205744&&e<=210041||e>=63744&&e<=64255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=12592&&e<=12687||e>=44032&&e<=55215||e>=65280&&e<=65519}function rr(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(!(n<12288)){if(n>=55296&&n<=56319&&t+1<e.length){const o=e.charCodeAt(t+1);if(o>=56320&&o<=57343){const s=(n-55296<<10)+(o-56320)+65536;if(FC(s))return!0;t++;continue}}if(FC(n))return!0}}return!1}function Ese(e){const t=nf(e);return t!==null&&(Bk.has(t)||La.has(t))}const Tse=new Set([" "," ","⁠","\uFEFF"]),Nse=new Set(["-","‐","–","—"]);function Ise(e){const t=nf(e);return t!==null&&Tse.has(t)}function Lse(e){const t=nf(e);return t!==null&&Nse.has(t)}function M5(e,t){return Ise(e)?!1:t?!(Ese(e)||Lse(e)):!0}const Bk=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),zm=new Set(['"',"(","[","{","¡","¿","“","‘","‚","„","«","‹","⸘","(","〔","〈","《","「","『","【","〖","〘","〚"]),Dk=new Set(["'","’"]),La=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),$se=new Set([":",".","،","؛"]),Fse=new Set(["၏"]),Ose=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function Rse(e){if(Pk(e))return!0;let t=!1;for(const n of e){if(La.has(n)||qm(n)){t=!0;continue}if(!(t&&zl.test(n)))return!1}return t}function Bse(e){for(const t of e)if(!Bk.has(t)&&!La.has(t))return!1;return e.length>0}function Dse(e){if(Pk(e))return!0;for(const t of e)if(!zm.has(t)&&!Dk.has(t)&&!zl.test(t)&&!qm(t))return!1;return e.length>0}function Pk(e){let t=!1;for(const n of e)if(!(n==="\\"||zl.test(n))){if(zm.has(n)||La.has(n)||Dk.has(n)){t=!0;continue}return!1}return t}function Um(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const o=e.charCodeAt(n);if(o<56320||o>57343)return n;const s=n-1;if(s<0)return n;const i=e.charCodeAt(s);return i>=55296&&i<=56319?s:n}function nf(e){if(e.length===0)return null;const t=Um(e,e.length);return e.slice(t)}function Pse(e){for(const t of e)if(!zl.test(t))return t;return null}function Hse(e){for(let t=e.length;t>0;){const n=Um(e,t),o=e.slice(n,t);if(!zl.test(o))return o;t=n}return null}const Wse=[36,37,43,43,92,92,162,165,176,177,1423,1423,1545,1547,1642,1642,2046,2047,2546,2547,2553,2555,2801,2801,3065,3065,3449,3449,3647,3647,6107,6107,8240,8247,8279,8279,8352,8399,8451,8451,8457,8457,8470,8470,8722,8723,43064,43064,65020,65020,65129,65130,65284,65285,65504,65505,65509,65510,73693,73696,123647,123647,126124,126124,126128,126128];function zse(e,t){for(let n=0;n<t.length;n+=2)if(e>=t[n]&&e<=t[n+1])return!0;return!1}function qm(e){const t=e.codePointAt(0);return t!==void 0&&zse(t,Wse)}function Use(e){const t=Hse(e);return t!==null&&qm(t)}function qse(e){const t=Pse(e);return t!==null&&Rk.test(t)}function jse(e){const t=Array.from(e);let n=t.length;for(;n>0;){const o=t[n-1];if(zl.test(o)){n--;continue}if(zm.has(o)||Dk.has(o)){n--;continue}break}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function Vse(e,t,n){return n==="text"&&!t&&e.length===1&&e!=="-"&&e!=="—"?e:null}function OC(e,t,n,o){const s=t[o],i=e[o];if(s==null)return i;const r=n[o];if(i.length===r)return i;const l=s.repeat(r);return e[o]=l,l}function RC(e,t){return e&&t!==null&&$se.has(t)}function Kse(e){const t=nf(e);return t!==null&&Fse.has(t)}function Gse(e){if(e.length<2||e[0]!==" ")return null;const t=e.slice(1);return/^\p{M}+$/u.test(t)?{space:" ",marks:t}:null}function Vv(e){let t=e.length;for(;t>0;){const n=Um(e,t),o=e.slice(n,t);if(Ose.has(o))return!0;if(!La.has(o))return!1;t=n}return!1}function Yse(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
296
+ `)return"hard-break"}return e===" "?"space":e===" "||e===" "||e==="⁠"||e==="\uFEFF"?"glue":e==="​"?"zero-width-break":e==="­"?"soft-hyphen":"text"}const Zse=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Bi(e){return e.length===1?e[0]:e.join("")}function Qse(e,t){const n=[];for(let o=e.length-1;o>=0;o--)n.push(e[o]);return n.push(t),Bi(n)}function Xse(e,t,n,o){if(!Zse.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const s=[];let i=null,r=[],l=n,a=!1,c=0;for(const u of e){const d=Yse(u,o),f=d==="text"&&t;if(i!==null&&d===i&&f===a){r.push(u),c+=u.length;continue}i!==null&&s.push({text:Bi(r),isWordLike:a,kind:i,start:l}),i=d,r=[u],l=n+c,a=f,c+=u.length}return i!==null&&s.push({text:Bi(r),isWordLike:a,kind:i,start:l}),s}function Kv(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const Jse=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function eie(e,t){const n=e.texts[t];return n.startsWith("www.")?!0:Jse.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function tie(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}function nie(e){const t=e.texts.slice(),n=e.isWordLike.slice(),o=e.kinds.slice(),s=e.starts.slice();for(let r=0;r<e.len;r++){if(o[r]!=="text"||!eie(e,r))continue;const l=[t[r]];let a=r+1;for(;a<e.len&&!Kv(o[a]);){l.push(t[a]),n[r]=!0;const c=t[a].includes("?");if(o[a]="text",t[a]="",a++,c)break}t[r]=Bi(l)}let i=0;for(let r=0;r<t.length;r++){const l=t[r];l.length!==0&&(i!==r&&(t[i]=l,n[i]=n[r],o[i]=o[r],s[i]=s[r]),i++)}return t.length=i,n.length=i,o.length=i,s.length=i,{len:i,texts:t,isWordLike:n,kinds:o,starts:s}}function oie(e){const t=[],n=[],o=[],s=[];for(let i=0;i<e.len;i++){const r=e.texts[i];if(t.push(r),n.push(e.isWordLike[i]),o.push(e.kinds[i]),s.push(e.starts[i]),!tie(r))continue;const l=i+1;if(l>=e.len||Kv(e.kinds[l]))continue;const a=[],c=e.starts[l];let u=l;for(;u<e.len&&!Kv(e.kinds[u]);)a.push(e.texts[u]),u++;a.length>0&&(t.push(Bi(a)),n.push(!0),o.push("text"),s.push(c),i=u-1)}return{len:t.length,texts:t,isWordLike:n,kinds:o,starts:s}}const sie=new Set([":","-","/","×",",",".","+","–","—"]),iie=/[\p{P}\p{S}\p{Co}]/u,rie=/\p{Emoji_Presentation}/u,lie=new Set(["?","֊","-","‐","‒","–","—","…","‼","‽","⁉"]);function aie(e){return e>=33&&e<=47&&e!==45||e>=58&&e<=64&&e!==63||e>=91&&e<=96||e>=123&&e<=126}function E5(e){const t=e.charCodeAt(0);return t<128?aie(t):!lie.has(e)&&!rie.test(e)&&iie.test(e)}function BC(e){let t=!1;for(const n of e)if(!zl.test(n)){if(!E5(n))return!1;t=!0}return t}function cie(e){for(let t=e.length;t>0;){const n=Um(e,t),o=e.slice(n,t);if(zl.test(o)){t=n;continue}return E5(o)||qm(o)}return!1}function uie(e,t,n,o){const s=!t&&BC(e),i=!o&&BC(n),r=Use(e),l=(t||r)&&cie(e);return!s&&!i&&!l||rr(e)||rr(n)?!1:(t||s||r)&&(o||i)}function T5(e){for(const t of e)if(Rk.test(t))return!0;return!1}function Rp(e){if(e.length===0)return!1;for(const t of e)if(!(Rk.test(t)||sie.has(t)))return!1;return!0}function die(e){const t=[],n=[],o=[],s=[];for(let i=0;i<e.len;i++){const r=e.texts[i],l=e.kinds[i];if(l==="text"&&Rp(r)&&T5(r)){const a=[r];let c=i+1;for(;c<e.len&&e.kinds[c]==="text"&&Rp(e.texts[c]);)a.push(e.texts[c]),c++;t.push(Bi(a)),n.push(!0),o.push("text"),s.push(e.starts[i]),i=c-1;continue}t.push(r),n.push(e.isWordLike[i]),o.push(l),s.push(e.starts[i])}return{len:t.length,texts:t,isWordLike:n,kinds:o,starts:s}}function fie(e){const t=[],n=[],o=[],s=[];let i=0;for(;i<e.len;){const r=e.texts[i],l=e.kinds[i],a=e.isWordLike[i];if(l==="text"){const c=[r];let u=i+1,d=a;for(;u<e.len&&e.kinds[u]==="text"&&uie(e.texts[u-1],e.isWordLike[u-1],e.texts[u],e.isWordLike[u]);){const f=e.texts[u];c.push(f),d=d||e.isWordLike[u],u++}if(u>i+1){t.push(Bi(c)),n.push(d),o.push("text"),s.push(e.starts[i]),i=u;continue}}t.push(r),n.push(a),o.push(l),s.push(e.starts[i]),i++}return{len:t.length,texts:t,isWordLike:n,kinds:o,starts:s}}function hie(e){const t=[],n=[],o=[],s=[];for(let i=0;i<e.len;i++){const r=e.texts[i];if(e.kinds[i]==="text"&&r.includes("-")){const l=r.split("-");let a=l.length>1;for(let c=0;c<l.length;c++){const u=l[c];if(!a)break;(u.length===0||!T5(u)||!Rp(u))&&(a=!1)}if(a){let c=0;for(let u=0;u<l.length;u++){const d=l[u],f=u<l.length-1?`${d}-`:d;t.push(f),n.push(!0),o.push("text"),s.push(e.starts[i]+c),c+=f.length}continue}}t.push(r),n.push(e.isWordLike[i]),o.push(e.kinds[i]),s.push(e.starts[i])}return{len:t.length,texts:t,isWordLike:n,kinds:o,starts:s}}function pie(e){const t=[],n=[],o=[],s=[];let i=0;for(;i<e.len;){const r=[e.texts[i]];let l=e.isWordLike[i],a=e.kinds[i],c=e.starts[i];if(a==="glue"){const u=[r[0]],d=c;for(i++;i<e.len&&e.kinds[i]==="glue";)u.push(e.texts[i]),i++;const f=Bi(u);if(i<e.len&&e.kinds[i]==="text")r[0]=f,r.push(e.texts[i]),l=e.isWordLike[i],a="text",c=d,i++;else{t.push(f),n.push(!1),o.push("glue"),s.push(d);continue}}else i++;if(a==="text")for(;i<e.len&&e.kinds[i]==="glue";){const u=[];for(;i<e.len&&e.kinds[i]==="glue";)u.push(e.texts[i]),i++;const d=Bi(u);if(i<e.len&&e.kinds[i]==="text"){r.push(d,e.texts[i]),l=l||e.isWordLike[i],i++;continue}r.push(d)}t.push(Bi(r)),n.push(l),o.push(a),s.push(c)}return{len:t.length,texts:t,isWordLike:n,kinds:o,starts:s}}function mie(e){const t=e.texts.slice(),n=e.isWordLike.slice(),o=e.kinds.slice(),s=e.starts.slice();for(let i=0;i<t.length-1;i++){if(o[i]!=="text"||o[i+1]!=="text"||!rr(t[i])||!rr(t[i+1]))continue;const r=jse(t[i]);r!==null&&(t[i]=r.head,t[i+1]=r.tail+t[i+1],s[i+1]=s[i]+r.head.length)}return{len:t.length,texts:t,isWordLike:n,kinds:o,starts:s}}function gie(e,t,n){const o=Ase();let s=0;const i=[],r=[],l=[],a=[],c=[],u=[],d=[],f=[],h=[],p=[],g=[],b=[];for(const $ of o.segment(e))for(const I of Xse($.segment,$.isWordLike??!1,$.index,n)){let U=function(){u[B]!==null&&(r[B]=[OC(i,u,d,B)],u[B]=null),r[B].push(I.text),l[B]=l[B]||I.isWordLike,f[B]=f[B]||E,h[B]=h[B]||F,p[B]=N,g[B]=D,b[B]=RC(h[B],S)};const x=I.kind==="text",L=Vse(I.text,I.isWordLike,I.kind),E=rr(I.text),F=$C(I.text),S=nf(I.text),N=Vv(I.text),D=Kse(I.text),B=s-1;t.carryCJKAfterClosingQuote&&x&&s>0&&a[B]==="text"&&E&&f[B]&&p[B]||x&&s>0&&a[B]==="text"&&Bse(I.text)&&f[B]||x&&s>0&&a[B]==="text"&&g[B]?U():x&&s>0&&a[B]==="text"&&I.isWordLike&&F&&b[B]?(U(),l[B]=!0):L!==null&&s>0&&a[B]==="text"&&u[B]===L?d[B]=(d[B]??1)+1:x&&!I.isWordLike&&s>0&&a[B]==="text"&&!f[B]&&(Rse(I.text)||I.text==="-"&&l[B])?U():(i[s]=I.text,r[s]=[I.text],l[s]=I.isWordLike,a[s]=I.kind,c[s]=I.start,u[s]=L,d[s]=L===null?0:1,f[s]=E,h[s]=F,p[s]=N,g[s]=D,b[s]=RC(F,S),s++)}for(let $=0;$<s;$++){if(u[$]!==null){i[$]=OC(i,u,d,$);continue}i[$]=Bi(r[$])}for(let $=1;$<s;$++)a[$]==="text"&&!l[$]&&Pk(i[$])&&a[$-1]==="text"&&!f[$-1]&&(i[$-1]+=i[$],l[$-1]=l[$-1]||l[$],i[$]="");const v=Array.from({length:s},()=>null);let m=-1;for(let $=s-1;$>=0;$--){const I=i[$];if(I.length!==0){if(a[$]==="text"&&!l[$]&&m>=0&&a[m]==="text"&&(Dse(I)||I==="-"&&qse(i[m]))){const x=v[m]??[];x.push(I),v[m]=x,c[m]=c[$],i[$]="";continue}m=$}}for(let $=0;$<s;$++){const I=v[$];I!=null&&(i[$]=Qse(I,i[$]))}let y=0;for(let $=0;$<s;$++){const I=i[$];I.length!==0&&(y!==$&&(i[y]=I,l[y]=l[$],a[y]=a[$],c[y]=c[$]),y++)}i.length=y,l.length=y,a.length=y,c.length=y;const k=pie({len:y,texts:i,isWordLike:l,kinds:a,starts:c}),A=mie(fie(hie(die(oie(nie(k))))));for(let $=0;$<A.len-1;$++){const I=Gse(A.texts[$]);I!==null&&(A.kinds[$]!=="space"&&A.kinds[$]!=="preserved-space"||A.kinds[$+1]!=="text"||!$C(A.texts[$+1])||(A.texts[$]=I.space,A.isWordLike[$]=!1,A.kinds[$]=A.kinds[$]==="preserved-space"?"preserved-space":"space",A.texts[$+1]=I.marks+A.texts[$+1],A.starts[$+1]=A.starts[$]+I.space.length))}return A}function vie(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const n=[];let o=0;for(let s=0;s<e.len;s++)e.kinds[s]==="hard-break"&&(n.push({startSegmentIndex:o,endSegmentIndex:s,consumedEndSegmentIndex:s+1}),o=s+1);return o<e.len&&n.push({startSegmentIndex:o,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}function yie(e,t,n){if(t.len<=1)return t;const o=[],s=[],i=[],r=[];let l=-1,a=!1;function c(f){o.push(t.texts[f]),s.push(t.isWordLike[f]),i.push("text"),r.push(t.starts[f])}function u(f,h){let p=!1;for(let v=f;v<h;v++)p=p||t.isWordLike[v];const g=t.starts[f],b=h<t.len?t.starts[h]:e.length;o.push(e.slice(g,b)),s.push(p),i.push("text"),r.push(g)}function d(f){if(!(l<0)){if(a)l+1===f?c(l):u(l,f);else for(let h=l;h<f;h++)c(h);l=-1,a=!1}}for(let f=0;f<t.len;f++){const h=t.texts[f],p=t.kinds[f];if(p==="text"){l>=0&&!M5(t.texts[f-1],n)&&d(f),l<0&&(l=f),a=a||rr(h);continue}d(f),o.push(h),s.push(t.isWordLike[f]),i.push(p),r.push(t.starts[f])}return d(t.len),{len:o.length,texts:o,isWordLike:s,kinds:i,starts:r}}function kie(e,t,n="normal",o="normal"){const s=wse(n),i=s.mode==="pre-wrap"?Sse(e):_se(e);if(i.length===0)return{normalized:i,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const r=gie(i,t,s),l=o==="keep-all"?yie(i,r,t.breakKeepAllAfterPunctuation):r;return{normalized:i,chunks:vie(l,s),...l}}let fc=null;const DC=new Map;let hc=null;const bie=96,xie=/\p{Emoji_Presentation}/u,wie=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let pg=null;const PC=new Map;function Hk(){if(fc!==null)return fc;if(typeof OffscreenCanvas<"u")return fc=new OffscreenCanvas(1,1).getContext("2d"),fc;if(typeof document<"u")return fc=document.createElement("canvas").getContext("2d"),fc;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function _ie(e){let t=DC.get(e);return t||(t=new Map,DC.set(e,t)),t}function wl(e,t){let n=t.get(e);return n===void 0&&(n={width:Hk().measureText(e).width,containsCJK:rr(e)},t.set(e,n)),n}function jm(){if(hc!==null)return hc;if(typeof navigator>"u")return hc={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,breakKeepAllAfterPunctuation:!0,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},hc;const e=navigator.userAgent,n=navigator.vendor==="Apple Computer, Inc."&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),o=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return hc={lineFitEpsilon:n?1/64:.005,carryCJKAfterClosingQuote:o,breakKeepAllAfterPunctuation:!n,preferPrefixWidthsForBreakableRuns:n,preferEarlySoftHyphenBreak:n},hc}function Sie(e){const t=e.match(/(\d+(?:\.\d+)?)\s*px/);return t?parseFloat(t[1]):16}function N5(){return pg===null&&(pg=new Intl.Segmenter(void 0,{granularity:"grapheme"})),pg}function Cie(e){return xie.test(e)||e.includes("️")}function Aie(e){return wie.test(e)}function Mie(e,t){let n=PC.get(e);if(n!==void 0)return n;const o=Hk();o.font=e;const s=o.measureText("😀").width;if(n=0,s>t+.5&&typeof document<"u"&&document.body!==null){const i=document.createElement("span");i.style.font=e,i.style.display="inline-block",i.style.visibility="hidden",i.style.position="absolute",i.textContent="😀",document.body.appendChild(i);const r=i.getBoundingClientRect().width;document.body.removeChild(i),s-r>.5&&(n=s-r)}return PC.set(e,n),n}function Eie(e){let t=0;const n=N5();for(const o of n.segment(e))Cie(o.segment)&&t++;return t}function Tie(e,t){return t.emojiCount===void 0&&(t.emojiCount=Eie(e)),t.emojiCount}function ba(e,t,n){return n===0?t.width:t.width-Tie(e,t)*n}function Nie(e,t,n,o,s){if(t.breakableFitAdvances!==void 0&&t.breakableFitMode===s)return t.breakableFitAdvances;t.breakableFitMode=s;const i=N5(),r=[];for(const u of i.segment(e))r.push(u.segment);if(r.length<=1)return t.breakableFitAdvances=null,t.breakableFitAdvances;if(s==="sum-graphemes"){const u=[];for(const d of r){const f=wl(d,n);u.push(ba(d,f,o))}return t.breakableFitAdvances=u,t.breakableFitAdvances}if(s==="pair-context"||r.length>bie){const u=[];let d=null,f=0;for(const h of r){const p=wl(h,n),g=ba(h,p,o);if(d===null)u.push(g);else{const b=d+h,v=wl(b,n);u.push(ba(b,v,o)-f)}d=h,f=g}return t.breakableFitAdvances=u,t.breakableFitAdvances}const l=[];let a="",c=0;for(const u of r){a+=u;const d=wl(a,n),f=ba(a,d,o);l.push(f-c),c=f}return t.breakableFitAdvances=l,t.breakableFitAdvances}function Iie(e,t){const n=Hk();n.font=e;const o=_ie(e),s=Sie(e),i=t?Mie(e,s):0;return{cache:o,fontSize:s,emojiCorrection:i}}function Lie(e){return e==="space"||e==="zero-width-break"||e==="soft-hyphen"}function I5(e){return e==="space"||e==="preserved-space"||e==="tab"||e==="zero-width-break"||e==="soft-hyphen"}function L5(e,t,n=e.widths.length){for(;t<n;){const o=e.kinds[t];if(!Lie(o))break;t++}return t}function $ie(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function Fie(e,t,n){return e.letterSpacing!==0&&t&&e.spacingGraphemeCounts[n]>0?e.letterSpacing:0}function Wk(e,t){return t===0?0:e+t}function Oie(e,t){return e.letterSpacing!==0&&e.spacingGraphemeCounts[t]>0?e.letterSpacing:0}function Rie(e,t,n,o,s){const i=t==="tab"?s+Oie(e,n):e.lineEndFitAdvances[n];return Wk(o,i)}function HC(e,t,n,o){const s=t==="tab"?0:e.lineEndFitAdvances[n];return Wk(o,s)}function WC(e,t,n,o,s){const i=t==="tab"?s:e.lineEndPaintAdvances[n];return Wk(o,i)}function Bie(e,t,n){return e.letterSpacing!==0&&t?n+e.letterSpacing:n}function Die(e,t){return e.letterSpacing===0?t:t+e.letterSpacing}function Bp(e,t,n){let o=t;for(;o<e.length&&e[o]<n;)o++;return o}function Pie(e,t,n,o,s){if(e.letterSpacing===0)return 0;if(s>0)return e.spacingGraphemeCounts[o]>0?e.letterSpacing:0;for(let i=o-1;i>=t;i--){const r=e.kinds[i];if(!(r==="space"||r==="zero-width-break"||r==="hard-break")){if(r==="soft-hyphen"){if(i===o-1)return 0;continue}return i===t&&n>0||e.spacingGraphemeCounts[i]>0?e.letterSpacing:0}}return 0}function Hie(e,t,n,o,s,i){return t+Pie(e,n,o,s,i)}function Wie(e,t,n){const{widths:o,kinds:s,breakableFitAdvances:i,breakablePreferredBreaks:r}=e;if(o.length===0)return 0;const a=jm().lineFitEpsilon,c=t+a;let u=0,d=0,f=!1,h=0,p=0,g=0,b=0,v=-1,m=0;function y(){v=-1,m=0}function k(E=g,F=b,S=d){u++,n?.(S,h,p,E,F),d=0,f=!1,y()}function A(E,F){f=!0,h=E,p=0,g=E+1,b=0,d=F}function $(E,F,S){f=!0,h=E,p=F,g=E,b=F+1,d=S}function I(E,F){if(!f){A(E,F);return}d+=F,g=E+1,b=0}function x(E,F){const S=i[E],N=r[E]??null;let D=N===null?-1:Bp(N,0,F+1),B=-1,U=0,H=F;for(;H<S.length;){const P=S[H];if(!f)$(E,H,P);else if(d+P>c){if(N!==null&&B>F){k(E,B,U),H=B,D=Bp(N,D,H+1),B=-1,U=0;continue}k(),$(E,H,P)}else d+=P,g=E,b=H+1;const Z=H+1;N!==null&&N[D]===Z&&(B=Z,U=d,D++),H++}f&&g===E&&b===S.length&&(g=E+1,b=0)}let L=0;for(;L<o.length&&!(!f&&(L=L5(e,L),L>=o.length));){const E=o[L],F=s[L],S=I5(F);if(!f){E>c&&i[L]!==null?x(L,0):A(L,E),S&&(v=L+1,m=d-E),L++;continue}if(d+E>c){if(S){I(L,E),k(L+1,0,d-E),L++;continue}if(v>=0){if(g>v||g===v&&b>0){k();continue}k(v,0,m);continue}if(E>c&&i[L]!==null){k(),x(L,0),L++;continue}k();continue}I(L,E),S&&(v=L+1,m=d-E),L++}return f&&k(),u}function zie(e,t,n){if(e.simpleLineWalkFastPath)return Wie(e,t,n);const{widths:o,kinds:s,breakableFitAdvances:i,breakablePreferredBreaks:r,discretionaryHyphenWidth:l,chunks:a}=e;if(o.length===0||a.length===0)return 0;const c=jm(),u=c.lineFitEpsilon,d=t+u;let f=0,h=0,p=!1,g=0,b=0,v=0,m=0,y=-1,k=0,A=0,$=null;function I(){y=-1,k=0,A=0,$=null}function x(){return $==="soft-hyphen"&&y===v&&m===0?A:h}function L(U=v,H=m,P){f++,n!==void 0&&n(Hie(e,P??x(),g,b,U,H),g,b,U,H),h=0,p=!1,I()}function E(U,H){p=!0,g=U,b=0,v=U+1,m=0,h=H}function F(U,H,P){p=!0,g=U,b=H,v=U,m=H+1,h=P}function S(U,H){if(!p){E(U,H);return}h+=H,v=U+1,m=0}function N(U,H,P,Z,K,V){if(!H)return;const X=HC(e,U,P,K),he=WC(e,U,P,K,Z);y=P+1,k=h-V+X,A=h-V+he,$=U}function D(U,H){const P=i[U],Z=r[U]??null;let K=Z===null?-1:Bp(Z,0,H+1),V=-1,X=0,he=H;for(;he<P.length;){const ne=P[he];if(!p)F(U,he,ne);else{const de=Bie(e,!0,ne),Ce=h+de;if(Die(e,Ce)>d){if(Z!==null&&V>H){L(U,V,X),he=V,K=Bp(Z,K,he+1),V=-1,X=0;continue}L(),F(U,he,ne)}else h=Ce,v=U,m=he+1}const ue=he+1;Z!==null&&Z[K]===ue&&(V=ue,X=h,K++),he++}p&&v===U&&m===P.length&&(v=U+1,m=0)}function B(U){f++,n?.(0,U.startSegmentIndex,0,U.consumedEndSegmentIndex,0),I()}for(let U=0;U<a.length;U++){const H=a[U];if(H.startSegmentIndex===H.endSegmentIndex){B(H);continue}p=!1,h=0,g=H.startSegmentIndex,b=0,v=H.startSegmentIndex,m=0,I();let P=H.startSegmentIndex;for(;P<H.endSegmentIndex&&!(!p&&(P=L5(e,P,H.endSegmentIndex),P>=H.endSegmentIndex));){const Z=s[P],K=I5(Z),V=Fie(e,p,P),X=Z==="tab"?$ie(h+V,e.tabStopAdvance):o[P],he=V+X,ne=Rie(e,Z,P,V,X);if(Z==="soft-hyphen"){p&&(v=P+1,m=0,y=P+1,k=h+l,A=h+l,$=Z),P++;continue}if(!p){ne>d&&i[P]!==null?D(P,0):E(P,X),N(Z,K,P,X,V,he),P++;continue}if(h+ne>d){const de=h+HC(e,Z,P,V),Ce=h+WC(e,Z,P,V,X);if($==="soft-hyphen"&&c.preferEarlySoftHyphenBreak&&k<=d){L(y,0,A);continue}if(K&&de<=d){S(P,he),L(P+1,0,Ce),P++;continue}if(y>=0&&k<=d){if(v>y||v===y&&m>0){L();continue}const Ie=y;L(Ie,0,A),P=Ie;continue}if(ne>d&&i[P]!==null){L(),D(P,0),P++;continue}L();continue}S(P,he),N(Z,K,P,X,V,he),P++}if(p){const Z=y===H.consumedEndSegmentIndex?A:h;L(H.consumedEndSegmentIndex,0,Z)}}return f}let mg=null;function zk(){return mg===null&&(mg=new Intl.Segmenter(void 0,{granularity:"grapheme"})),mg}function Uie(e){return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],breakablePreferredBreaks:[],letterSpacing:0,spacingGraphemeCounts:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[],segments:[]}}function qie(e,t){const n=[];let o=[],s=0,i=!1,r=!1,l=!1;function a(){o.length!==0&&(n.push({text:o.length===1?o[0]:o.join(""),start:s}),o=[],i=!1,r=!1,l=!1)}function c(d,f,h){o=[d],s=f,i=h,r=Vv(d),l=zm.has(d)}function u(d,f){o.push(d),i=i||f;const h=Vv(d);d.length===1&&La.has(d)?r=r||h:r=h,l=!1}for(const d of zk().segment(e)){const f=d.segment,h=rr(f);if(o.length===0){c(f,d.index,h);continue}if(l||Bk.has(f)||La.has(f)||t.carryCJKAfterClosingQuote&&h&&r){u(f,h);continue}if(!i&&!h){u(f,h);continue}a(),c(f,d.index,h)}return a(),n}function jie(e,t,n){if(t.length<=1)return t;const o=[];let s=-1,i=!1;function r(a,c){const u=t[a].start,d=c<t.length?t[c].start:e.length;o.push({text:e.slice(u,d),start:u})}function l(a){if(!(s<0)){if(i)s+1===a?o.push(t[s]):r(s,a);else for(let c=s;c<a;c++)o.push(t[c]);s=-1,i=!1}}for(let a=0;a<t.length;a++){const c=t[a];s>=0&&!M5(t[a-1].text,n)&&l(a),s<0&&(s=a),i=i||rr(c.text)}return l(t.length),o}function zC(e,t){if(t==="zero-width-break"||t==="soft-hyphen"||t==="hard-break")return 0;if(t==="tab")return 1;let n=0;const o=zk();for(const s of o.segment(e))n++;return n}function Vie(e){return e==="-"||e==="֊"||e==="‐"||e==="‒"||e==="–"||e==="—"}function Kie(e){if(!/[-\u058A\u2010\u2012\u2013\u2014]/u.test(e))return null;const t=[];let n=0;for(const o of zk().segment(e))n++,Vie(o.segment)&&t.push(n);return t.length===0?null:t}function Gie(e,t,n){return t>1?e+(t-1)*n:e}function Yie(e,t,n,o,s){const i=jm(),{cache:r,emojiCorrection:l}=Iie(t,Aie(e.normalized)),a=ba("-",wl("-",r),l)+(s===0?0:s*2),u=ba(" ",wl(" ",r),l)*8,d=s!==0;if(e.len===0)return Uie();const f=[],h=[],p=[],g=[];let b=e.chunks.length<=1&&!d;const v=n?[]:null,m=[],y=[],k=[],A=n?[]:null,$=Array.from({length:e.len});function I(F,S,N,D,B,U,H,P,Z){B!=="text"&&B!=="space"&&B!=="zero-width-break"&&(b=!1),f.push(S),h.push(N),p.push(D),g.push(B),v?.push(U),m.push(H),y.push(P),d&&k.push(Z),A!==null&&A.push(F)}function x(F,S,N,D,B){const U=wl(F,r),H=d?zC(F,S):0,P=Gie(ba(F,U,l),H,s),Z=S==="space"||S==="preserved-space"||S==="zero-width-break"?0:P,K=Z===0?0:Z+(H>0?s:0),V=S==="space"||S==="zero-width-break"?0:P;if(B&&D&&F.length>1){let X="sum-graphemes";s!==0?X="segment-prefixes":Rp(F)?X="pair-context":i.preferPrefixWidthsForBreakableRuns&&(X="segment-prefixes");const he=Nie(F,U,r,l,X),ne=he===null||o==="keep-all"?null:Kie(F);I(F,P,K,V,S,N,he,ne,H);return}I(F,P,K,V,S,N,null,null,H)}for(let F=0;F<e.len;F++){$[F]=f.length;const S=e.texts[F],N=e.isWordLike[F],D=e.kinds[F],B=e.starts[F];if(D==="soft-hyphen"){I(S,0,a,a,D,B,null,null,0);continue}if(D==="hard-break"){I(S,0,0,0,D,B,null,null,0);continue}if(D==="tab"){I(S,0,0,0,D,B,null,null,d?zC(S,D):0);continue}const U=wl(S,r);if(D==="text"&&U.containsCJK){const H=qie(S,i),P=o==="keep-all"?jie(S,H,i.breakKeepAllAfterPunctuation):H;for(let Z=0;Z<P.length;Z++){const K=P[Z];x(K.text,"text",B+K.start,N,o==="keep-all"||!rr(K.text))}continue}x(S,D,B,N,!0)}const L=Zie(e.chunks,$,f.length),E=v===null?null:kse(e.normalized,v);return A!==null?{widths:f,lineEndFitAdvances:h,lineEndPaintAdvances:p,kinds:g,simpleLineWalkFastPath:b,segLevels:E,breakableFitAdvances:m,breakablePreferredBreaks:y,letterSpacing:s,spacingGraphemeCounts:k,discretionaryHyphenWidth:a,tabStopAdvance:u,chunks:L,segments:A}:{widths:f,lineEndFitAdvances:h,lineEndPaintAdvances:p,kinds:g,simpleLineWalkFastPath:b,segLevels:E,breakableFitAdvances:m,breakablePreferredBreaks:y,letterSpacing:s,spacingGraphemeCounts:k,discretionaryHyphenWidth:a,tabStopAdvance:u,chunks:L}}function Zie(e,t,n){const o=[];for(let s=0;s<e.length;s++){const i=e[s],r=i.startSegmentIndex<t.length?t[i.startSegmentIndex]:n,l=i.endSegmentIndex<t.length?t[i.endSegmentIndex]:n,a=i.consumedEndSegmentIndex<t.length?t[i.consumedEndSegmentIndex]:n;o.push({startSegmentIndex:r,endSegmentIndex:l,consumedEndSegmentIndex:a})}return o}function Qie(e,t,n,o){const s=o?.wordBreak??"normal",i=o?.letterSpacing??0,r=kie(e,jm(),o?.whiteSpace,s);return Yie(r,t,n,s,i)}function Xie(e,t,n){return Qie(e,t,!0,n)}function Jie(e){let t=0;return zie(e,Number.POSITIVE_INFINITY,n=>{n>t&&(t=n)}),t}const ere={key:0,class:"slash-menu",role:"listbox"},tre=["aria-selected","onMouseenter","onMousedown"],nre={class:"slash-name"},ore={class:"slash-desc"},sre=Ze({__name:"SlashMenu",props:{items:{},activeIndex:{}},emits:["select","hover"],setup(e,{emit:t}){const{t:n}=Tt(),o=e,s=t,i=J([]);return Qe(()=>o.activeIndex,r=>{i.value[r]?.scrollIntoView({block:"nearest"})}),(r,l)=>e.items.length>0?(w(),T("div",ere,[(w(!0),T(Pe,null,ot(e.items,(a,c)=>(w(),T("div",{ref_for:!0,ref:u=>{u&&(i.value[c]=u)},key:`${a.name}-${c}`,class:We(["slash-item",{active:c===o.activeIndex}]),role:"option","aria-selected":c===o.activeIndex,onMouseenter:u=>s("hover",c),onMousedown:bt(u=>s("select",a),["prevent"])},[_("span",nre,O(a.name),1),_("span",ore,O(a.isSkill?a.desc:C(n)(a.desc)),1)],42,tre))),128))])):ce("",!0)}}),ire=ct(sre,[["__scopeId","data-v-f60b70d9"]]),rre={class:"mention-menu",role:"listbox"},lre={key:0,class:"mention-state dim"},are={key:1,class:"mention-state dim"},cre=["aria-selected","onMouseenter","onMousedown"],ure=["innerHTML"],dre={class:"mention-name"},fre={class:"mention-path"},hre=Ze({__name:"MentionMenu",props:{items:{},activeIndex:{},loading:{type:Boolean}},emits:["select","hover"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Tt(),i=yc("folder","sm"),r=yc("code","sm"),l=yc("file-text","sm"),a=yc("image","sm"),c=yc("file","sm"),u=new Set(["ts","tsx","js","jsx","mjs","cjs","vue","json","py","go","rs","java","kt","c","h","cpp","cc","hpp","cs","rb","php","swift","sh","bash","zsh","css","scss","less","html","htm","xml","sql","yaml","yml","toml","lua","dart","scala","clj","ex","exs"]),d=new Set(["md","markdown","mdx","txt","rst","adoc","pdf","doc","docx"]),f=new Set(["png","jpg","jpeg","gif","svg","webp","bmp","ico","avif"]);function h(p){const g=p.path;if(g.endsWith("/"))return i;const b=p.name||g.split("/").pop()||g,v=b.lastIndexOf("."),m=v>0?b.slice(v+1).toLowerCase():"";return m?u.has(m)?r:d.has(m)?l:f.has(m)?a:c:c}return(p,g)=>(w(),T("div",rre,[n.loading?(w(),T("div",lre,O(C(s)("mention.searching")),1)):n.items.length===0?(w(),T("div",are,O(C(s)("mention.noMatch")),1)):(w(!0),T(Pe,{key:2},ot(n.items,(b,v)=>(w(),T("div",{key:b.path,class:We(["mention-item",{active:v===n.activeIndex}]),role:"option","aria-selected":v===n.activeIndex,onMouseenter:m=>o("hover",v),onMousedown:bt(m=>o("select",b),["prevent"])},[_("span",{class:"mention-icon",innerHTML:h(b),"aria-hidden":"true"},null,8,ure),_("span",dre,O(b.name),1),_("span",fre,O(b.path),1)],42,cre))),128))]))}}),pre=ct(hre,[["__scopeId","data-v-f4d6b958"]]),$5=[{name:"/new",desc:"commands.new.desc"},{name:"/clear",desc:"commands.clear.desc"},{name:"/login",desc:"commands.login.desc"},{name:"/plan",desc:"commands.plan.desc"},{name:"/swarm",desc:"commands.swarm.desc",acceptsInput:!0},{name:"/goal",desc:"commands.goal.desc",acceptsInput:!0},{name:"/btw",desc:"commands.btw.desc",acceptsInput:!0},{name:"/auto",desc:"commands.auto.desc"},{name:"/yolo",desc:"commands.yolo.desc"},{name:"/thinking",desc:"commands.thinking.desc"},{name:"/compact",desc:"commands.compact.desc",acceptsInput:!0},{name:"/undo",desc:"commands.undo.desc"},{name:"/fork",desc:"commands.fork.desc"},{name:"/export",desc:"commands.export.desc"},{name:"/status",desc:"commands.status.desc"}];function mre(e){if(!e.startsWith("/"))return null;const t=e.indexOf(" ");return t===-1?{cmd:e,arg:""}:{cmd:e.slice(0,t),arg:e.slice(t+1)}}const Dp="skill:";function gre(e){return e.startsWith(Dp)?e.slice(Dp.length):e}function F5(e=[]){const t=e.map(n=>({name:n.source==="builtin"?`/${n.name}`:`/${Dp}${n.name}`,desc:n.description,isSkill:!0,acceptsInput:!0}));return[...$5,...t]}function vre(e,t=$5){const n=e.toLowerCase().trim().replace(/^\//,"");return n===""?t:t.map((o,s)=>{const i=o.name.toLowerCase().replace(/^\//,"");let r=0;return i===n?r=3:i.startsWith(n)?r=2:i.includes(n)&&(r=1),{item:o,index:s,score:r}}).filter(({score:o})=>o>0).sort((o,s)=>o.score!==s.score?s.score-o.score:o.index-s.index).map(({item:o})=>o)}function Vm(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 O5(e){return e?.supportEfforts??[]}function yre(e){return e[Math.floor(e.length/2)]}function Pd(e){if(Vm(e)==="unsupported")return"off";const t=O5(e);return t.length>0?e?.defaultEffort??yre(t):"on"}function Km(e){const t=O5(e),n=Vm(e);return t.length>0?n==="always-on"?[...t]:["off",...t]:n==="always-on"?["on"]:n==="unsupported"?["off"]:["on","off"]}function Gv(e){return e.length===0?e:e.charAt(0).toUpperCase()+e.slice(1)}function kre(e){return e!=="off"}function bre(e,t){return Km(e).includes(t)}function Uk(e,t){return t==="off"?"off":t==="on"?Pd(e):t}function Pp(e,t){return t??Pd(e)}function xre(e,t){if(e==="off")return{enabled:!1};if(e==="on")return{enabled:!0};const n=t?.at(-1);return n!==void 0&&e===n?{enabled:!0}:{enabled:!0,effort:e}}function wre(e,t,n){return!n||e===void 0?t:Pd(e)}const Hp=100;function _re(e){const t=ym(Ft.inputHistory);if(Array.isArray(t)){const n=t.filter(i=>typeof i=="string"&&i.length>0);if(!e||n.length===0)return{};const o=n.length>Hp?n.slice(-Hp):n,s={[e]:o};return Gd(Ft.inputHistory,s),s}return t&&typeof t=="object"?t:{}}function Sre(e){const{text:t,textareaRef:n,autosize:o,sessionId:s}=e,i=J(_re(s())),r=R(()=>i.value[s()??""]??[]);let l=-1,a="";function c(v){const m=s();if(l=-1,!m)return;const y=v.trim();if(!y)return;const k=i.value[m]??[];if(k.at(-1)===y)return;const A=[...k,y],$=A.length>Hp?A.slice(-Hp):A;i.value={...i.value,[m]:$},Gd(Ft.inputHistory,i.value)}function u(){const v=n.value;return v?(v.selectionStart??0)===0:!1}function d(v){t.value=v,mt(()=>{const m=n.value;if(!m)return;o();const y=v.length;m.setSelectionRange(y,y)})}function f(){const v=r.value;if(v.length!==0){if(l===-1)a=t.value,l=v.length-1;else if(l>0)l-=1;else return;d(v[l])}}function h(){if(l===-1)return;const v=r.value;l<v.length-1?(l+=1,d(v[l])):(l=-1,d(a))}function p(){l=-1}function g(){return l!==-1}function b(){return r.value.length>0}return Qe(s,()=>{l=-1}),{push:c,caretAtTextStart:u,recallOlder:f,recallNewer:h,resetBrowsing:p,isBrowsing:g,hasHistory:b}}function Cre(e){const{text:t,textareaRef:n,autosize:o,skills:s,emitCommand:i,historyPush:r,clearDraft:l}=e,a=J(!1),c=J([]),u=J(0);function d(){const h=t.value;h.startsWith("/")&&!h.includes(" ")?(c.value=vre(h,F5(s())),u.value=0,a.value=c.value.length>0):a.value=!1}function f(h){if(a.value=!1,h.acceptsInput){t.value=`${h.name} `,mt(()=>{const p=n.value;if(!p)return;const g=t.value.length;p.setSelectionRange(g,g),p.focus(),o()});return}t.value="",l?.(),r(h.name),i(h.name)}return{open:a,items:c,active:u,update:d,select:f}}function Are(e){const{text:t,textareaRef:n,autosize:o,searchFiles:s}=e,i=J(!1),r=J([]),l=J(0),a=J(!1);let c=null;function u(){const h=t.value,p=n.value?.selectionStart??h.length;let g=p-1;for(;g>=0&&!/\s/.test(h[g]);)g--;g++;const b=h.slice(g,p);return b.startsWith("@")?{token:b.slice(1),start:g,end:p}:null}function d(){const h=u(),p=s();if(!h||!p){i.value=!1;return}const g=h.token;c!==null&&clearTimeout(c),c=setTimeout(async()=>{a.value=!0,i.value=!0,l.value=0;try{r.value=await p(g)}catch{r.value=[]}finally{a.value=!1}},200)}function f(h){const p=u();if(!p)return;const g=t.value;t.value=g.slice(0,p.start)+h.path+g.slice(p.end),i.value=!1,mt(()=>{const b=n.value;if(!b)return;const v=p.start+h.path.length;b.setSelectionRange(v,v),b.focus(),o()})}return{open:i,items:r,active:l,loading:a,update:d,select:f}}function Mre(e){const{sessionId:t}=e;function n(c){return mo(Jx(c))??""}function o(c,u){const d=Jx(c);u?So(d,u):Na(d)}const s=J(n(t())),i=J(null);function r(){const c=i.value;c&&(c.style.height="auto",c.style.height=`${c.scrollHeight}px`)}Qe(s,c=>{mt(r),o(t(),c)}),Qe(t,(c,u)=>{c!==u&&(o(u,s.value),s.value=n(c),mt(r))});function l(c){s.value=c,mt(()=>{const u=i.value;if(!u)return;u.focus();const d=c.length;u.setSelectionRange(d,d),r()})}function a(){o(t(),"")}return{text:s,textareaRef:i,autosize:r,loadForEdit:l,clearDraft:a}}function Ere(e){const{uploadImage:t,sessionId:n}=e,o=J({}),s=R(()=>o.value[n()??""]??[]),i=J(null),r=J(null),l=J(!1);let a=0;function c(){return`att_${++a}`}function u(H,P){o.value={...o.value,[H]:P}}function d(H){if(H.previewUrl!==void 0)try{URL.revokeObjectURL(H.previewUrl)}catch{}}function f(H){return H.startsWith("image/")?"image":H.startsWith("video/")?"video":"file"}async function h(H){const P=t();if(!P)return;const Z=n()??"";if(H.length!==0)for(const K of H){const V=f(K.type),X=c(),he=V==="file"?void 0:URL.createObjectURL(K),ne={localId:X,name:K.name,kind:V,previewUrl:he,mediaType:K.type||"application/octet-stream",size:K.size,uploading:!0};u(Z,[...o.value[Z]??[],ne]),P(K,K.name).then(ue=>{const de=o.value[Z]??[];u(Z,de.map(Ce=>Ce.localId===X?{...Ce,uploading:!1,fileId:ue?.fileId,mediaType:ue?.mediaType??Ce.mediaType,error:ue===null}:Ce))}).catch(()=>{const ue=o.value[Z]??[];u(Z,ue.map(de=>de.localId===X?{...de,uploading:!1,error:!0}:de))})}}function p(H){const P=n()??"",Z=o.value[P]??[],K=Z.find(V=>V.localId===H);i.value?.localId===H&&(i.value=null),K&&d(K),u(P,Z.filter(V=>V.localId!==H))}function g(H){i.value=H}function b(){i.value=null}function v(){r.value?.click()}function m(H){const P=H.target,Z=Array.from(P.files??[]);h(Z),P.value=""}function y(H){if(!t())return;const P=H.clipboardData;if(!P)return;const Z=[],K=new Set,V=(X,he)=>{const ne=`${X.size}:${X.type}:${he}`;if(K.has(ne))return;K.add(ne);const ue=X.type.split("/")[1]??"png",de=he.includes(".")?he:`paste-${Date.now()}.${ue}`;Z.push(X instanceof File?X:new File([X],de,{type:X.type}))};for(const X of Array.from(P.items))if(X.kind==="file"){const he=X.getAsFile();he&&V(he,he.name||`paste-${Date.now()}.${X.type.split("/")[1]??"png"}`)}for(const X of Array.from(P.files))V(X,X.name);Z.length!==0&&(H.preventDefault(),h(Z))}let k=0;function A(H){!t()||!Array.from(H.dataTransfer?.items??[]).some(Z=>Z.kind==="file")||(H.preventDefault(),H.stopPropagation(),l.value=!0)}function $(){l.value=!1}function I(H){if(k=0,l.value=!1,!t())return;H.preventDefault(),H.stopPropagation();const P=Array.from(H.dataTransfer?.files??[]);h(P)}function x(H){return Array.from(H.dataTransfer?.items??[]).some(P=>P.kind==="file")}function L(H){!t()||!x(H)||(H.preventDefault(),k+=1,l.value=!0)}function E(H){!t()||!x(H)||H.preventDefault()}function F(H){!t()||!x(H)||(k=Math.max(0,k-1),k===0&&(l.value=!1))}function S(H){if(k=0,l.value=!1,!t())return;H.preventDefault();const P=Array.from(H.dataTransfer?.files??[]);h(P)}function N(){const H=n()??"";for(const P of o.value[H]??[])d(P);u(H,[])}function D(H,P,Z){const K=o.value[H]??[];K.some(V=>V.localId===P)&&u(H,K.map(V=>V.localId===P?{...V,...Z}:V))}function B(H){return fetch(H).then(P=>{if(!P.ok)throw new Error(`fetch failed: ${P.status}`);return P.blob()})}function U(H){const P=n()??"";for(const Z of o.value[P]??[])d(Z);u(P,[]);for(const Z of H){const K=c(),V=/^data:/i.test(Z.url),X=/^blob:/i.test(Z.url),he=Z.name??Z.kind;if(Z.fileId){const ne={localId:K,name:he,kind:Z.kind,previewUrl:Z.kind==="file"?void 0:Z.url,uploading:!1,fileId:Z.fileId};u(P,[...o.value[P]??[],ne]),Z.kind!=="file"&&!V&&!X&&dt().getFileBlob(Z.fileId).then(ue=>{const de=URL.createObjectURL(ue);if(!(o.value[P]??[]).some(Ie=>Ie.localId===K)){URL.revokeObjectURL(de);return}D(P,K,{previewUrl:de})}).catch(()=>{})}else{if(!Z.url)continue;const ne=t();if(!ne)continue;const ue={localId:K,name:he,kind:Z.kind,previewUrl:Z.url,uploading:!0};u(P,[...o.value[P]??[],ue]),B(Z.url).then(de=>{const Ce=he.includes(".")?he:`${he}.${de.type.split("/")[1]??"bin"}`;return ne(de,Ce)}).then(de=>{if(de===null){const Ce=o.value[P]??[];u(P,Ce.filter(Ie=>Ie.localId!==K));return}D(P,K,{uploading:!1,fileId:de.fileId})}).catch(()=>{const de=o.value[P]??[];u(P,de.filter(Ce=>Ce.localId!==K))})}}}return Qe(n,()=>{i.value=null}),cn(()=>{document.addEventListener("paste",y),document.addEventListener("dragenter",L),document.addEventListener("dragover",E),document.addEventListener("dragleave",F),document.addEventListener("drop",S)}),bn(()=>{document.removeEventListener("paste",y),document.removeEventListener("dragenter",L),document.removeEventListener("dragover",E),document.removeEventListener("dragleave",F),document.removeEventListener("drop",S);for(const H of Object.values(o.value))for(const P of H)d(P);i.value=null}),{attachments:s,previewAttachment:i,fileInputRef:r,isDragOver:l,removeAttachment:p,openAttachmentPreview:g,closeAttachmentPreview:b,openFilePicker:v,handleFileInputChange:m,handleDragOver:A,handleDragLeave:$,handleDrop:I,clearAfterSubmit:N,loadAttachments:U}}const Tre=["type","disabled"],Nre={class:"ui-button__content"},Ire=Ze({__name:"Button",props:{variant:{default:"primary"},size:{default:"md"},disabled:{type:Boolean},loading:{type:Boolean},type:{default:"button"}},setup(e){return(t,n)=>(w(),T("button",{class:We(["ui-button",[`ui-button--${e.variant}`,`ui-button--${e.size}`,{"is-loading":e.loading}]]),type:e.type,disabled:e.disabled||e.loading},[e.loading?(w(),we(Ds,{key:0,size:"sm",class:"ui-button__spinner"})):ce("",!0),_("span",Nre,[On(t.$slots,"default",{},void 0,!0)])],10,Tre))}}),Bt=ct(Ire,[["__scopeId","data-v-e58393a8"]]),Lre={class:"ctx-ring",viewBox:"0 0 20 20","aria-hidden":"true"},$re=["stroke-dasharray","stroke-dashoffset"],gg=7,Fre=Ze({__name:"ContextRing",props:{pct:{}},setup(e){const t=e,n=2*Math.PI*gg;return(o,s)=>(w(),T("svg",Lre,[_("circle",{class:"ctx-ring-track",cx:"10",cy:"10",r:gg,fill:"none","stroke-width":"2.5"}),_("circle",{class:"ctx-ring-fill",cx:"10",cy:"10",r:gg,fill:"none","stroke-width":"2.5","stroke-linecap":"round","stroke-dasharray":`${n}`,"stroke-dashoffset":`${n*(1-t.pct/100)}`},null,8,$re)]))}}),Ore=ct(Fre,[["__scopeId","data-v-a364f1f1"]]),Rre={key:0,class:"att-strip"},Bre={class:"att-lightbox-card"},Dre=["src"],Pre=["src","alt"],Hre={class:"att-lightbox-name"},Wre={class:"composer-card"},zre={class:"cin-wrap"},Ure={class:"input-row"},qre=["placeholder","disabled"],jre=["aria-label"],Vre={class:"toolbar-left"},Kre=["onKeydown"],Gre=["onClick"],Yre={class:"pd-check"},Zre={class:"pd-info"},Qre={class:"pd-desc"},Xre={class:"mode-label"},Jre={key:0,class:"mode-tag"},ele={key:1,class:"mode-tag"},tle={key:2,class:"mode-tag"},nle={class:"mode-row-icon"},ole={class:"mode-row-info"},sle={class:"mode-row-name"},ile={class:"mode-row-desc"},rle={class:"mode-row-icon"},lle={class:"mode-row-info"},ale={class:"mode-row-name"},cle={class:"mode-row-desc"},ule={class:"mode-row-icon"},dle={class:"mode-row-info"},fle={class:"mode-row-name"},hle={class:"mode-row-desc"},ple={key:0,class:"mode-row-actions"},mle={class:"toolbar-right"},gle=["aria-label"],vle=["onKeydown"],yle={key:0,class:"think-suffix"},kle=["aria-label"],ble=["aria-label","disabled"],xle={key:0,class:"md-section"},wle=["onClick"],_le={class:"md-check"},Sle={class:"md-name"},Cle={class:"md-provider"},Ale={key:1,class:"md-divider"},Mle={key:2,class:"md-section"},Ele=["onClick"],Tle={class:"md-check"},Nle={class:"md-name"},Ile={key:3,class:"md-divider"},Lle={class:"md-name"},$le={key:0,class:"md-note"},Fle=["aria-label"],Ole=["disabled","onClick"],Rle={class:"md-cache-note"},Ble={class:"md-name"},Dle={class:"drop-card"},UC=36,Ple=Ze({__name:"Composer",props:{running:{type:Boolean,default:!1},starting:{type:Boolean,default:!1},sessionId:{},queued:{default:()=>[]},searchFiles:{type:Function,default:void 0},uploadImage:{type:Function,default:void 0},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},goal:{},activationBadges:{},models:{default:()=>[]},starredIds:{default:()=>[]},skills:{default:()=>[]},hideContext:{type:Boolean}},emits:["submit","steer","command","interrupt","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","openBtw","createGoal","controlGoal","focusGoal","focusSwarm","compact","pickModel","selectModel"],setup(e,{expose:t,emit:n}){const o=e,s=R(()=>o.starting?r("composer.starting"):o.running?r("composer.placeholderRunning"):o.goalMode?r("status.goalPlaceholder"):r("composer.placeholder")),i=n,{t:r,locale:l}=Tt(),{text:a,textareaRef:c,autosize:u,loadForEdit:d,clearDraft:f}=Mre({sessionId:()=>o.sessionId}),h=J(!1);function p(){h.value=!h.value,mt(()=>{u(),m(),c.value?.focus()})}function g(){h.value&&(h.value=!1,mt(u))}function b(Ue){if(typeof getComputedStyle>"u")return UC;const Fe=Number.parseFloat(getComputedStyle(Ue).minHeight);return Number.isFinite(Fe)&&Fe>0?Fe:UC}const v=J(!1);function m(){const Ue=c.value;v.value=!!Ue&&Ue.scrollHeight>b(Ue)}Qe(a,()=>{mt(m)}),Qe(()=>o.sessionId,()=>{h.value=!1});const y=Sre({text:a,textareaRef:c,autosize:u,sessionId:()=>o.sessionId}),{open:k,items:A,active:$,update:I,select:x}=Cre({text:a,textareaRef:c,autosize:u,skills:()=>o.skills,emitCommand:Ue=>i("command",Ue),historyPush:Ue=>y.push(Ue),clearDraft:f}),{open:L,items:E,active:F,loading:S,update:N,select:D}=Are({text:a,textareaRef:c,autosize:u,searchFiles:()=>o.searchFiles});function B(){y.resetBrowsing(),I(),N()}const{attachments:U,previewAttachment:H,fileInputRef:P,isDragOver:Z,removeAttachment:K,openAttachmentPreview:V,closeAttachmentPreview:X,openFilePicker:he,handleFileInputChange:ne,handleDragOver:ue,handleDragLeave:de,handleDrop:Ce,clearAfterSubmit:Ie,loadAttachments:le}=Ere({uploadImage:()=>o.uploadImage,sessionId:()=>o.sessionId});cn(()=>{a.value&&mt(()=>{u(),m()})}),bn(()=>{document.removeEventListener("mousedown",Gt),j()});function z(){c.value?.focus({preventScroll:!0})}function ae(Ue){le(Ue)}t({loadForEdit:d,loadAttachmentsForEdit:ae,focus:z});function ie(Ue){return{fileId:Ue.fileId,kind:Ue.kind,name:Ue.name,mediaType:Ue.mediaType,size:Ue.size}}function q(Ue){if(Ue.kind==="file"){Ue.fileId!==void 0&&C5(Ue.fileId,Ue.name,Ue.mediaType);return}V(Ue)}function ee(){const Ue=a.value.trim();if(U.value.some(Te=>Te.uploading))return;const Fe=U.value.filter(Te=>!Te.uploading&&!Te.error&&Te.fileId);if(!Ue&&Fe.length===0)return;if(y.push(Ue),Ue){const Te=mre(Ue),pe=Te?F5(o.skills).some(_e=>_e.name===Te.cmd||_e.name===`/${Dp}${Te.cmd.slice(1)}`):!1;if(Te&&pe){a.value="",f(),k.value=!1,g(),i("command",Te.arg?`${Te.cmd} ${Te.arg}`:Te.cmd);return}}const oe={text:Ue,attachments:Fe.map(Te=>ie(Te))};H.value=null,Ie(),a.value="",f(),k.value=!1,L.value=!1,g(),i("submit",oe)}function ye(){if(!o.running||U.value.some(Te=>Te.uploading))return;const Ue=a.value.trim(),Fe=U.value.filter(Te=>!Te.uploading&&!Te.error&&Te.fileId);if(!Ue&&Fe.length===0&&o.queued.length===0)return;const oe={text:Ue,attachments:Fe.map(Te=>ie(Te))};Ie(),y.push(Ue),a.value="",f(),k.value=!1,L.value=!1,g(),i("steer",oe)}let fe=!1,ve=null;function j(){ve!==null&&(clearTimeout(ve),ve=null)}function te(){j(),fe=!0}function me(){j(),ve=setTimeout(()=>{ve=null,fe=!1},0)}function Ae(Ue){return fe||Ue.isComposing||Ue.keyCode===229}function $e(Ue){if(!Ae(Ue)){if(Ue.key==="Escape"){if(Ne.value){Ue.preventDefault(),gt();return}if(et.value){Ue.preventDefault(),Ut();return}}if(k.value){if(Ue.key==="ArrowDown"){Ue.preventDefault(),$.value=($.value+1)%A.value.length;return}if(Ue.key==="ArrowUp"){Ue.preventDefault(),$.value=($.value-1+A.value.length)%A.value.length;return}if(Ue.key==="Enter"||Ue.key==="Tab"){Ue.preventDefault();const Fe=A.value[$.value];Fe&&x(Fe);return}if(Ue.key==="Escape"){Ue.preventDefault(),k.value=!1;return}}if(L.value&&!S.value){if(Ue.key==="ArrowDown"){Ue.preventDefault(),F.value=(F.value+1)%Math.max(1,E.value.length);return}if(Ue.key==="ArrowUp"){Ue.preventDefault(),F.value=(F.value-1+Math.max(1,E.value.length))%Math.max(1,E.value.length);return}if(Ue.key==="Enter"||Ue.key==="Tab"){Ue.preventDefault();const Fe=E.value[F.value];Fe&&D(Fe);return}if(Ue.key==="Escape"){Ue.preventDefault(),L.value=!1;return}}if(Ue.key==="s"&&(Ue.ctrlKey||Ue.metaKey)&&!Ue.shiftKey&&!Ue.altKey){o.running&&(Ue.preventDefault(),ye());return}if(!h.value&&!k.value&&!L.value&&!Ue.shiftKey&&!Ue.altKey&&!Ue.metaKey&&!Ue.ctrlKey){const Fe=y.isBrowsing();if(Ue.key==="ArrowUp"&&y.hasHistory()&&(Fe||y.caretAtTextStart())){Ue.preventDefault(),y.recallOlder();return}if(Ue.key==="ArrowDown"&&Fe){Ue.preventDefault(),y.recallNewer();return}}if(Ue.key==="Enter"&&!Ue.shiftKey){if(h.value&&!(Ue.metaKey||Ue.ctrlKey))return;Ue.preventDefault(),ee()}}}const De=R(()=>r("composer.send")),ge=R(()=>!!o.uploadImage),Ne=J(!1),et=J(!1),rt=J(null);function _t(){Ne.value=!Ne.value,Ne.value?(et.value=!1,sn(),document.addEventListener("click",ht,!0)):document.removeEventListener("click",ht,!0)}function gt(){Ne.value=!1,et.value||document.removeEventListener("click",ht,!0)}function It(){et.value=!et.value,et.value?(Ne.value=!1,sn(),document.addEventListener("click",ht,!0)):document.removeEventListener("click",ht,!0)}function Ut(){et.value=!1,Ne.value||document.removeEventListener("click",ht,!0)}function ht(Ue){rt.value&&!rt.value.contains(Ue.target)&&(gt(),Ut())}bn(()=>{document.removeEventListener("click",ht,!0)});const un=R(()=>{const Ue=o.status?.ctxMax??0;return Ue<=0?0:Math.min(100,Math.max(0,Math.ceil((o.status?.ctxUsed??0)/Ue*100)))}),dn=R(()=>{const Ue=ir(o.status?.ctxUsed??0),Fe=ir(o.status?.ctxMax??0);return r("status.ctxTooltip",{used:Ue,max:Fe,pct:un.value})}),ns=R(()=>un.value>=80),Wt=R(()=>o.models?.find(Ue=>Ue.id===o.status?.modelId)),Hn=R(()=>Vm(Wt.value)),lo=R(()=>Km(Wt.value)),it=R(()=>Pp(Wt.value,o.thinking)),Gn=R(()=>lo.value.includes(it.value)?it.value:""),ao=R(()=>kre(it.value)),Yn=R(()=>Hn.value==="unsupported"||lo.value.length<=1),go=R(()=>{if(!ao.value)return"";const Ue=(Wt.value?.supportEfforts?.length??0)>0,Fe=it.value;return Ue&&Fe!=="on"?r("composer.thinkingSuffixEffort",{level:Fe}):r("composer.thinkingSuffix")});function os(Ue){Yn.value||i("setThinking",Uk(Wt.value,Ue))}function qn(Ue){return Ue==="on"?r("status.thinkingOn"):Ue==="off"?r("status.thinkingOff"):Gv(Ue)}const to=R(()=>o.planMode===!0),vn=R(()=>o.swarmMode===!0),Zn=R(()=>o.goal?.status??o.activationBadges?.goal?.status??null),xn=R(()=>Zn.value!==null&&Zn.value!=="complete"),An=R(()=>xn.value||o.goalMode===!0),Mn=R(()=>Zn.value==="active"),Do=R(()=>Zn.value==="paused"||Zn.value==="blocked"),ze=J(!1),Xe=J(null),kt=J(null),Ht=J({}),Rn=R(()=>to.value||vn.value||An.value);function sn(){ze.value=!1,document.removeEventListener("mousedown",Gt)}function Gt(Ue){const Fe=Ue.target;Xe.value?.contains(Fe)||kt.value?.contains(Fe)||sn()}function Wn(){if(ze.value){sn();return}gt(),Ut();const Ue=Xe.value?.getBoundingClientRect();Ue&&(Ht.value={left:`${Math.round(Ue.left)}px`,bottom:`${Math.round(window.innerHeight-Ue.top+8)}px`}),ze.value=!0,setTimeout(()=>document.addEventListener("mousedown",Gt),0)}const En=[{mode:"manual",color:"var(--dim)",labelKey:"status.permissionManual",descKey:"status.permissionManualDesc"},{mode:"yolo",color:"var(--color-warning)",labelKey:"status.permissionYolo",descKey:"status.permissionYoloDesc"},{mode:"auto",color:"var(--color-danger)",labelKey:"status.permissionAuto",descKey:"status.permissionAutoDesc"}],St=["status.planDesc","status.swarmDesc","status.goalDesc"],Po=J(null),Ao=J(""),ss=J("");function Tn(Ue){const Fe={};return Ue&&(Fe["--composer-menu-desc-width"]=Ue),Fe}const jn=R(()=>Tn(Ao.value)),Ps=R(()=>Tn(ss.value)),ti=R(()=>({...Ht.value,...Ps.value}));let Io=null;function Ss(Ue){const Fe=Number.parseFloat(Ue);return Number.isFinite(Fe)?Fe:0}function Wi(Ue){return`${Ue.fontStyle||"normal"} ${Ue.fontWeight||"400"} ${Ue.fontSize} ${Ue.fontFamily}`}function Si(Ue){return Ue.letterSpacing==="normal"?0:Ss(Ue.letterSpacing)}function co(Ue,Fe){if(!Ue)return 0;const oe=Xie(Ue,Wi(Fe),{letterSpacing:Si(Fe)});return Jie(oe)}function ni(){const Ue=Po.value?.querySelector(".pd-desc");if(!Ue)return;const Fe=getComputedStyle(Ue),oe=Math.max(0,...En.map(pe=>co(r(pe.descKey),Fe))),Te=Math.max(0,...St.map(pe=>co(r(pe),Fe)));Ao.value=oe>0?`${Math.ceil(oe)}px`:"",ss.value=Te>0?`${Math.ceil(Te)}px`:""}function Ci(){typeof window>"u"||(Io!==null&&window.cancelAnimationFrame(Io),mt(()=>{Io=window.requestAnimationFrame(()=>{Io=null,ni()})}))}Qe(l,Ci,{immediate:!0}),cn(()=>{Ci(),document.fonts?.ready.then(Ci)}),bn(()=>{Io!==null&&(window.cancelAnimationFrame(Io),Io=null)});function ar(Ue){i("setPermission",Ue),Ut()}const no=R(()=>En.find(Ue=>Ue.mode===o.status?.permission)),is=R(()=>no.value?r(no.value.labelKey):""),rs=R(()=>Wt.value?.provider??""),Lo=R(()=>!rs.value||!o.models?.length?[]:o.models.filter(Ue=>Ue.provider===rs.value)),Ai=R(()=>new Set(o.starredIds??[]));function zn(Ue){return Ai.value.has(Ue)}const $o=R(()=>o.models?.length?o.models.filter(Ue=>zn(Ue.id)&&Ue.provider!==rs.value):[]);function oi(Ue){i("selectModel",Ue),gt()}return(Ue,Fe)=>(w(),T("div",{class:We(["composer",{"drag-over":C(Z),expanded:h.value}]),onDragover:Fe[18]||(Fe[18]=(...oe)=>C(ue)&&C(ue)(...oe)),onDragleave:Fe[19]||(Fe[19]=(...oe)=>C(de)&&C(de)(...oe)),onDrop:Fe[20]||(Fe[20]=(...oe)=>C(Ce)&&C(Ce)(...oe))},[C(U).length>0?(w(),T("div",Rre,[(w(!0),T(Pe,null,ot(C(U),oe=>(w(),we(_5,{key:oe.localId,kind:oe.kind,name:oe.name,url:oe.previewUrl,"file-id":oe.fileId,"media-type":oe.mediaType,size:oe.size,uploading:oe.uploading,error:oe.error,removable:"","remove-label":C(r)("composer.removeNamed",{name:oe.name}),onActivate:Te=>q(oe),onRemove:Te=>C(K)(oe.localId)},null,8,["kind","name","url","file-id","media-type","size","uploading","error","remove-label","onActivate","onRemove"]))),128))])):ce("",!0),C(H)?(w(),T("div",{key:1,class:"att-lightbox",onClick:Fe[1]||(Fe[1]=bt((...oe)=>C(X)&&C(X)(...oe),["self"]))},[_("div",Bre,[re(Xt,{text:C(r)("model.close")},{default:Ee(()=>[_("button",{type:"button",class:"att-lightbox-close",onClick:Fe[0]||(Fe[0]=(...oe)=>C(X)&&C(X)(...oe))},"✕")]),_:1},8,["text"]),C(H).kind==="video"?(w(),T("video",{key:0,class:"att-lightbox-media",src:C(H).previewUrl,controls:"",playsinline:""},null,8,Dre)):(w(),T("img",{key:1,class:"att-lightbox-media",src:C(H).previewUrl,alt:C(H).name},null,8,Pre)),_("div",Hre,O(C(H).name),1)])])):ce("",!0),_("div",Wre,[_("div",zre,[C(k)?(w(),we(ire,{key:0,items:C(A),"active-index":C($),onSelect:C(x),onHover:Fe[2]||(Fe[2]=oe=>$.value=oe)},null,8,["items","active-index","onSelect"])):ce("",!0),C(L)?(w(),we(pre,{key:1,items:C(E),"active-index":C(F),loading:C(S),onSelect:C(D),onHover:Fe[3]||(Fe[3]=oe=>F.value=oe)},null,8,["items","active-index","loading","onSelect"])):ce("",!0),_("div",Ure,[Fn(_("textarea",{ref_key:"textareaRef",ref:c,"onUpdate:modelValue":Fe[4]||(Fe[4]=oe=>ho(a)?a.value=oe:null),class:"ph",placeholder:s.value,disabled:e.starting,rows:"1",onKeydown:$e,onCompositionstart:te,onCompositionend:me,onInput:B},null,40,qre),[[_s,C(a)]]),h.value||v.value?(w(),T("button",{key:0,class:"expand-btn",type:"button","aria-label":h.value?C(r)("composer.collapseTitle"):C(r)("composer.expandTitle"),onClick:p},[h.value?(w(),we(Ve,{key:0,name:"collapse",size:"sm"})):(w(),we(Ve,{key:1,name:"expand",size:"sm"}))],8,jre)):ce("",!0)])]),ge.value?(w(),T("input",{key:0,ref_key:"fileInputRef",ref:P,type:"file",multiple:"",class:"file-input-hidden",onChange:Fe[5]||(Fe[5]=(...oe)=>C(ne)&&C(ne)(...oe))},null,544)):ce("",!0),_("div",{ref_key:"toolbarRef",ref:rt,class:"toolbar"},[_("div",{ref_key:"menuMeasureRef",ref:Po,class:"menu-measure","aria-hidden":"true"},[...Fe[21]||(Fe[21]=[_("span",{class:"pd-desc"},null,-1)])],512),_("div",Vre,[ge.value?(w(),we(Pn,{key:0,size:"md",label:C(r)("composer.attachFile"),onClick:C(he)},{default:Ee(()=>[re(Ve,{name:"attachment"})]),_:1},8,["label","onClick"])):ce("",!0),e.status?(w(),T("span",{key:1,class:We(["perm-pill",["perm-"+e.status.permission,{open:et.value}]]),role:"button",tabindex:"0",onClick:bt(It,["stop"]),onKeydown:[nr(It,["enter"]),nr(bt(It,["prevent"]),["space"])]},O(is.value),43,Kre)):ce("",!0),et.value&&e.status?(w(),T("div",{key:2,class:"perm-dropdown",style:Yt(jn.value),role:"menu",onClick:Fe[6]||(Fe[6]=bt(()=>{},["stop"]))},[(w(),T(Pe,null,ot(En,oe=>_("button",{key:oe.mode,class:We(["pd-row",{"is-current":oe.mode===e.status.permission}]),role:"menuitem",onClick:Te=>ar(oe.mode)},[_("span",Yre,[oe.mode===e.status.permission?(w(),we(Ve,{key:0,name:"check",size:"sm"})):ce("",!0)]),_("span",Zre,[_("span",{class:"pd-name",style:Yt({color:oe.color})},O(C(r)(oe.labelKey)),5),_("span",Qre,O(C(r)(oe.descKey)),1)])],10,Gre)),64))],4)):ce("",!0),e.status?(w(),T("div",{key:3,ref_key:"modesRef",ref:Xe,class:"modes"},[_("button",{type:"button",class:We(["mode-pill",{on:Rn.value,open:ze.value}]),onClick:bt(Wn,["stop"])},[_("span",Xre,O(C(r)("status.modesLabel")),1),to.value?(w(),T("span",Jre,O(C(r)("status.planLabel")),1)):ce("",!0),vn.value?(w(),T("span",ele,O(C(r)("status.swarmLabel")),1)):ce("",!0),An.value?(w(),T("span",tle,O(C(r)("status.goalLabel")),1)):ce("",!0)],2),ze.value?(w(),T("div",{key:0,ref_key:"modesMenuRef",ref:kt,class:"modes-menu",style:Yt(ti.value),role:"menu"},[_("button",{type:"button",class:We(["mode-row",{on:to.value}]),role:"menuitem",onClick:Fe[7]||(Fe[7]=oe=>i("togglePlan"))},[_("span",nle,[re(Ve,{name:"file-edit",size:"sm"})]),_("span",ole,[_("span",sle,O(C(r)("status.planLabel")),1),_("span",ile,O(C(r)("status.planDesc")),1)]),_("span",{class:We(["mode-switch",{on:to.value}])},[...Fe[22]||(Fe[22]=[_("span",{class:"mode-knob"},null,-1)])],2)],2),_("button",{type:"button",class:We(["mode-row",{on:vn.value}]),role:"menuitem",onClick:Fe[8]||(Fe[8]=oe=>i("toggleSwarm"))},[_("span",rle,[re(Ve,{name:"sparkles",size:"sm"})]),_("span",lle,[_("span",ale,O(C(r)("status.swarmLabel")),1),_("span",cle,O(C(r)("status.swarmDesc")),1)]),_("span",{class:We(["mode-switch",{on:vn.value}])},[...Fe[23]||(Fe[23]=[_("span",{class:"mode-knob"},null,-1)])],2)],2),_("div",{class:We(["mode-row mode-row-goal",{on:xn.value||o.goalMode}])},[_("button",{type:"button",class:"mode-row-main",role:"menuitem",onClick:Fe[9]||(Fe[9]=oe=>xn.value?i("focusGoal"):i("toggleGoal"))},[_("span",ule,[re(Ve,{name:"target",size:"sm"})]),_("span",dle,[_("span",fle,O(C(r)("status.goalLabel")),1),_("span",hle,O(C(r)("status.goalDesc")),1)]),xn.value?ce("",!0):(w(),T("span",{key:0,class:We(["mode-switch",{on:o.goalMode}])},[...Fe[24]||(Fe[24]=[_("span",{class:"mode-knob"},null,-1)])],2))]),xn.value?(w(),T("div",ple,[Mn.value?(w(),we(Bt,{key:0,size:"sm",variant:"secondary",class:"mode-row-action",onClick:Fe[10]||(Fe[10]=oe=>i("controlGoal","pause"))},{default:Ee(()=>[re(Ve,{name:"pause",size:"sm"}),_("span",null,O(C(r)("status.goalPause")),1)]),_:1})):ce("",!0),Do.value?(w(),we(Bt,{key:1,size:"sm",variant:"primary",class:"mode-row-action",onClick:Fe[11]||(Fe[11]=oe=>i("controlGoal","resume"))},{default:Ee(()=>[re(Ve,{name:"play",size:"sm"}),_("span",null,O(C(r)("status.goalResume")),1)]),_:1})):ce("",!0),re(Bt,{size:"sm",variant:"danger-soft",class:"mode-row-action",onClick:Fe[12]||(Fe[12]=oe=>i("controlGoal","cancel"))},{default:Ee(()=>[re(Ve,{name:"close",size:"sm"}),_("span",null,O(C(r)("status.goalCancel")),1)]),_:1})])):ce("",!0)],2)],4)):ce("",!0)],512)):ce("",!0)]),_("div",mle,[ns.value?(w(),T("button",{key:0,class:"compact-chip",onClick:Fe[13]||(Fe[13]=bt(oe=>i("compact"),["stop"]))},"/compact")):ce("",!0),re(Xt,{text:dn.value},{default:Ee(()=>[e.status&&!e.hideContext?(w(),T("span",{key:0,class:"ctx-group",role:"img",tabindex:"0","aria-label":dn.value},[re(Ore,{pct:un.value},null,8,["pct"])],8,gle)):ce("",!0)]),_:1},8,["text"]),e.status?(w(),T("span",{key:1,class:We(["model-pill",{open:Ne.value}]),role:"button",tabindex:"0",onClick:bt(_t,["stop"]),onKeydown:[nr(_t,["enter"]),nr(bt(_t,["prevent"]),["space"])]},[_("b",null,O(e.status.model),1),go.value?(w(),T("span",yle,O(go.value),1)):ce("",!0),re(Ve,{class:"cv",name:"chevron-down",size:"sm"})],42,vle)):ce("",!0),e.running?(w(),we(Xt,{key:2,text:C(r)("composer.interruptTitle")},{default:Ee(()=>[_("button",{class:"stop","aria-label":C(r)("composer.interrupt"),onClick:Fe[14]||(Fe[14]=oe=>i("interrupt"))},[re(Ve,{name:"stop",size:"sm"})],8,kle)]),_:1},8,["text"])):ce("",!0),_("button",{class:We(["send",{"is-starting":e.starting}]),"aria-label":De.value,disabled:e.starting,onClick:Fe[15]||(Fe[15]=oe=>ee())},[e.starting?(w(),we(Ds,{key:0,size:"sm"})):(w(),we(Ve,{key:1,name:"send",size:"sm"}))],10,ble)]),Ne.value&&e.status?(w(),T("div",{key:0,class:"model-dropdown",role:"menu",onClick:Fe[17]||(Fe[17]=bt(()=>{},["stop"]))},[$o.value.length>0?(w(),T("div",xle,O(C(r)("status.starredModels")),1)):ce("",!0),(w(!0),T(Pe,null,ot($o.value,oe=>(w(),T("button",{key:oe.id,class:We(["md-row",{"is-current":oe.id===e.status.modelId}]),role:"menuitem",onClick:Te=>oi(oe.id)},[_("span",_le,[oe.id===e.status.modelId?(w(),we(Ve,{key:0,name:"check",size:"sm"})):ce("",!0)]),_("span",Sle,O(oe.displayName??oe.model),1),_("span",Cle,O(oe.provider),1),re(Ve,{class:"md-star",name:"star",size:"sm"})],10,wle))),128)),$o.value.length>0?(w(),T("div",Ale)):ce("",!0),Lo.value.length>0?(w(),T("div",Mle,O(rs.value),1)):ce("",!0),(w(!0),T(Pe,null,ot(Lo.value,oe=>(w(),T("button",{key:oe.id,class:We(["md-row",{"is-current":oe.id===e.status.modelId}]),role:"menuitem",onClick:Te=>oi(oe.id)},[_("span",Tle,[oe.id===e.status.modelId?(w(),we(Ve,{key:0,name:"check",size:"sm"})):ce("",!0)]),_("span",Nle,O(oe.displayName??oe.model),1),zn(oe.id)?(w(),we(Ve,{key:0,class:"md-star",name:"star",size:"sm"})):ce("",!0)],10,Ele))),128)),Lo.value.length>0?(w(),T("div",Ile)):ce("",!0),_("div",{class:We(["md-thinking",{"is-readonly":Yn.value}])},[_("span",Lle,O(C(r)("status.thinkingLabel")),1),Hn.value==="unsupported"?(w(),T("span",$le,O(C(r)("status.modeNotSupported")),1)):(w(),T("div",{key:1,class:"effort-segments",role:"group","aria-label":C(r)("status.thinkingLabel")},[(w(!0),T(Pe,null,ot(lo.value,oe=>(w(),T("button",{key:oe,type:"button",class:We(["effort-seg",{"is-active":oe===Gn.value}]),disabled:Yn.value,onClick:Te=>os(oe)},O(qn(oe)),11,Ole))),128))],8,Fle))],2),Fe[25]||(Fe[25]=_("div",{class:"md-divider"},null,-1)),_("div",Rle,O(C(r)("status.cacheNote")),1),Fe[26]||(Fe[26]=_("div",{class:"md-divider"},null,-1)),_("button",{class:"md-row md-row-more",role:"menuitem",onClick:Fe[16]||(Fe[16]=oe=>{gt(),i("pickModel")})},[_("span",Ble,O(C(r)("status.moreModels")),1)])])):ce("",!0)],512)]),_("div",{class:We(["drop-overlay",{show:C(Z)}]),"aria-hidden":"true"},[_("div",Dle,[re(Ve,{name:"file-plus",size:"lg"}),_("span",null,O(C(r)("composer.dropToAttach")),1)])],2)],34))}}),R5=ct(Ple,[["__scopeId","data-v-a89f6a49"]]),Hle={key:0,class:"ui-card__head"},Wle={class:"ui-card__body"},zle={key:1,class:"ui-card__foot"},Ule=Ze({__name:"Card",props:{elevated:{type:Boolean,default:!1}},setup(e){return(t,n)=>(w(),T("div",{class:We(["ui-card",{"is-elevated":e.elevated}])},[t.$slots.head?(w(),T("div",Hle,[On(t.$slots,"head",{},void 0,!0)])):ce("",!0),_("div",Wle,[On(t.$slots,"default",{},void 0,!0)]),t.$slots.foot?(w(),T("div",zle,[On(t.$slots,"foot",{},void 0,!0)])):ce("",!0)],2))}}),qk=ct(Ule,[["__scopeId","data-v-9c9f9a9a"]]),qle={class:"goal-kicker"},jle={key:0,class:"goal-progress","aria-hidden":"true"},Vle={class:"goal-full"},Kle={key:0,class:"goal-criterion"},Gle=["inert","aria-hidden"],Yle={class:"goal-meta"},Zle={key:0},Qle={class:"goal-actions"},Xle=Ze({__name:"GoalStrip",props:{goal:{},forceExpanded:{}},emits:["controlGoal"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Tt(),{confirm:i}=tf(),r=J(!1);Qe(()=>n.forceExpanded,()=>{n.forceExpanded!==void 0&&(r.value=!0)});const l=R(()=>{const d=n.goal.budget.tokenBudget;return!d||d<=0?0:Math.max(0,Math.min(100,Math.round(n.goal.tokensUsed/d*100)))});function a(d){switch(d){case"active":return s("status.goalStatusActive");case"paused":return s("status.goalStatusPaused");case"blocked":return s("status.goalStatusBlocked");case"complete":return s("status.goalStatusComplete")}}function c(d){const f=Math.max(0,Math.round(d/1e3)),h=Math.floor(f/60),p=f%60;return h<=0?`${p}s`:h<60?`${h}m ${p}s`:`${Math.floor(h/60)}h ${h%60}m`}async function u(){await i({title:s("status.goalCancel"),message:s("status.goalCancelConfirm"),confirmLabel:s("status.goalCancelConfirmYes"),cancelLabel:s("status.goalCancelConfirmNo"),variant:"danger"})&&o("controlGoal","cancel")}return(d,f)=>(w(),we(qk,{class:We(["goal-strip",{expanded:r.value}])},{head:Ee(()=>[_("button",{class:"goal-row",type:"button",onClick:f[0]||(f[0]=h=>r.value=!r.value)},[re(Ve,{class:"goal-icon",name:"target",size:"md"}),_("span",qle,O(C(s)("status.goalLabel")),1),_("span",{class:We(["goal-objective",{"expanded-hidden":r.value}])},O(e.goal.objective),3),re(Ri,{variant:e.goal.status==="active"?"success":e.goal.status==="blocked"?"danger":e.goal.status==="paused"?"warning":"neutral",size:"sm",class:"goal-status"},{default:Ee(()=>[Je(O(a(e.goal.status)),1)]),_:1},8,["variant"]),e.goal.budget.tokenBudget!==null?(w(),T("span",jle,[_("span",{class:"goal-progress-fill",style:Yt({width:`${l.value}%`})},null,4)])):ce("",!0),re(Ve,{class:We(["goal-chevron",{open:r.value}]),name:"chevron-right",size:"md"},null,8,["class"])])]),default:Ee(()=>[_("div",Vle,O(e.goal.objective),1),e.goal.completionCriterion?(w(),T("div",Kle,[f[3]||(f[3]=_("span",null,"Done when",-1)),_("p",null,O(e.goal.completionCriterion),1)])):ce("",!0)]),foot:Ee(()=>[_("div",{class:"goal-footer",inert:!r.value,"aria-hidden":!r.value},[_("div",Yle,[_("span",null,O(e.goal.turnsUsed)+" turns",1),_("span",null,O(C(ir)(e.goal.tokensUsed))+" tokens",1),_("span",null,O(c(e.goal.wallClockMs)),1),e.goal.budget.tokenBudget!==null?(w(),T("span",Zle,O(l.value)+"% token budget",1)):ce("",!0)]),_("div",Qle,[e.goal.status==="active"?(w(),we(Bt,{key:0,size:"sm",variant:"secondary",class:"goal-action",onClick:f[1]||(f[1]=bt(h=>o("controlGoal","pause"),["stop"]))},{default:Ee(()=>[re(Ve,{name:"pause",size:"md"}),_("span",null,O(C(s)("status.goalPause")),1)]),_:1})):ce("",!0),e.goal.status==="paused"||e.goal.status==="blocked"?(w(),we(Bt,{key:1,size:"sm",variant:"primary",class:"goal-action",onClick:f[2]||(f[2]=bt(h=>o("controlGoal","resume"),["stop"]))},{default:Ee(()=>[re(Ve,{name:"play",size:"md"}),_("span",null,O(C(s)("status.goalResume")),1)]),_:1})):ce("",!0),re(Bt,{size:"sm",variant:"danger-soft",class:"goal-action",onClick:bt(u,["stop"])},{default:Ee(()=>[re(Ve,{name:"close",size:"md"}),_("span",null,O(C(s)("status.goalCancel")),1)]),_:1})])],8,Gle)]),_:1},8,["class"]))}}),Jle=ct(Xle,[["__scopeId","data-v-44bef30f"]]),eae={class:"qh"},tae={class:"qtitle"},nae={key:0,class:"qstep"},oae={key:1,class:"qmin-peek"},sae={class:"qbody"},iae=["aria-label"],rae=["aria-selected","aria-label","onClick"],lae={class:"qstep-num"},aae={key:1,class:"qheader-chip"},cae={class:"qtext"},uae={class:"qopts"},dae=["onClick"],fae={class:"qopt-key"},hae={class:"qopt-glyph"},pae={key:0,class:"chk"},mae={key:1,class:"rad"},gae={class:"qopt-text"},vae={class:"qopt-label"},yae={key:0,class:"qopt-desc"},kae={class:"qopt-glyph"},bae={key:0,class:"chk"},xae={key:1,class:"rad"},wae={class:"qopt-label"},_ae=["placeholder"],Sae={class:"qfoot"},Cae=Ze({__name:"QuestionCard",props:{question:{},busyKind:{}},emits:["answer","dismiss"],setup(e,{emit:t}){const n=e,{t:o}=Tt(),s=t,i=J(0),r=J(!1),l=R(()=>n.question.questions[i.value]),a=R(()=>n.question.questions.length);function c(){i.value>0&&i.value--}function u(){i.value<a.value-1&&i.value++}function d(U){U>=0&&U<a.value&&(i.value=U)}function f(U){const H=p.value[U];return H?H.kind==="multi"?H.optionIds.length>0:H.kind==="multiWithOther"?H.optionIds.length>0||H.otherText.trim().length>0:H.kind==="other"?H.text.trim().length>0:!0:!1}function h(){return f(l.value.id)}const p=J({});function g(U){return U.recommended===!0?!0:/\b(?:recommended|recommend)\b|推荐/.test(`${U.label} ${U.description??""}`.toLowerCase())}function b(){const U={...p.value};let H=!1;for(const P of n.question.questions){if(U[P.id])continue;const Z=P.options.filter(g);Z.length!==0&&(U[P.id]=P.multiSelect?{kind:"multi",optionIds:Z.map(K=>K.id)}:{kind:"single",optionId:Z[0].id},H=!0)}H&&(p.value=U)}Qe(()=>n.question.questionId,()=>{i.value=0,r.value=!1,p.value={},y.value={}}),Qe(()=>n.question,()=>{i.value>=n.question.questions.length&&(i.value=0),b()},{immediate:!0,deep:!0});function v(U,H){const P=p.value[U];if(P&&P.kind==="single"&&P.optionId===H){const Z={...p.value};delete Z[U],p.value=Z}else p.value={...p.value,[U]:{kind:"single",optionId:H}}}function m(U,H){const P=p.value[U],Z=P&&(P.kind==="multi"||P.kind==="multiWithOther")?P.kind==="multi"?[...P.optionIds]:[...P.optionIds]:[],K=Z.indexOf(H);K>=0?Z.splice(K,1):Z.push(H);const V=p.value[U],X=V&&V.kind==="multiWithOther"?V.otherText:"";X?p.value={...p.value,[U]:{kind:"multiWithOther",optionIds:Z,otherText:X}}:p.value={...p.value,[U]:{kind:"multi",optionIds:Z}}}const y=J({}),k=J(null);function A(U){const H=n.question.questions.find(Z=>Z.id===U),P=y.value[U]??"";if(H.multiSelect){const Z=p.value[U],K=Z&&(Z.kind==="multi"||Z.kind==="multiWithOther")?Z.kind==="multi"?[...Z.optionIds]:[...Z.optionIds]:[];p.value={...p.value,[U]:{kind:"multiWithOther",optionIds:K,otherText:P}}}else p.value={...p.value,[U]:{kind:"other",text:P}}}function $(U){A(U),mt(()=>k.value?.focus())}function I(U,H){const P=p.value[U];return P?P.kind==="single"?P.optionId===H:P.kind==="multi"||P.kind==="multiWithOther"?P.optionIds.includes(H):!1:!1}function x(U){const H=p.value[U];return!!(H&&(H.kind==="other"||H.kind==="multiWithOther"))}function L(){return n.question.questions.every(U=>f(U.id))}const E=R(()=>n.busyKind==="answer"),F=R(()=>n.busyKind==="dismiss"),S=R(()=>!!n.busyKind);function N(){if(S.value||!L())return;const U={answers:p.value,method:"click"};s("answer",n.question.questionId,U)}function D(){S.value||s("dismiss",n.question.questionId)}function B(U){const H=(document.activeElement?.tagName??"").toLowerCase(),P=H==="input"||H==="textarea";if(S.value)return;if(U.key==="Enter"){if(U.preventDefault(),r.value)return;i.value<a.value-1&&h()?u():L()&&N();return}if(P)return;if(U.key==="Escape"){U.preventDefault(),D();return}if(r.value)return;const Z=parseInt(U.key,10);if(!isNaN(Z)&&Z>=1&&Z<=9){U.preventDefault();const K=l.value,V=Z-1,X=K.options[V];X&&(K.multiSelect?m(K.id,X.id):v(K.id,X.id))}}return cn(()=>document.addEventListener("keydown",B)),bn(()=>document.removeEventListener("keydown",B)),(U,H)=>(w(),we(qk,{class:We(["qcard",{minimized:r.value}])},e3({head:Ee(()=>[_("div",eae,[H[5]||(H[5]=_("span",{class:"qh-ic"},"?",-1)),_("span",tae,O(C(o)("question.title")),1),a.value>1&&!r.value?(w(),T("span",nae,O(C(o)("question.step",{current:i.value+1,total:a.value})),1)):ce("",!0),r.value?(w(),T("span",oae,O(l.value.question),1)):ce("",!0),re(Pn,{class:"qmin",size:"sm",label:r.value?C(o)("question.expand"):C(o)("question.minimize"),onClick:H[0]||(H[0]=P=>r.value=!r.value)},{default:Ee(()=>[r.value?(w(),we(Ve,{key:0,name:"chevron-up",size:"md"})):(w(),we(Ve,{key:1,name:"minus",size:"md"}))]),_:1},8,["label"])])]),_:2},[r.value?void 0:{name:"default",fn:Ee(()=>[_("div",sae,[a.value>1?(w(),T("div",{key:0,class:"qsteps",role:"tablist","aria-label":C(o)("question.step",{current:i.value+1,total:a.value})},[(w(!0),T(Pe,null,ot(n.question.questions,(P,Z)=>(w(),T("button",{key:P.id,type:"button",class:We(["qstep-dot",{active:Z===i.value,answered:f(P.id)}]),"aria-selected":Z===i.value,"aria-label":C(o)("question.step",{current:Z+1,total:a.value}),onClick:K=>d(Z)},[_("span",lae,O(Z+1),1)],10,rae))),128))],8,iae)):ce("",!0),l.value.header?(w(),T("div",aae,[re(Ri,{variant:"neutral",size:"sm"},{default:Ee(()=>[Je(O(l.value.header),1)]),_:1})])):ce("",!0),_("div",cae,O(l.value.question),1),l.value.body?(w(),we(Wm,{key:2,text:l.value.body,class:"qmdbody"},null,8,["text"])):ce("",!0),_("div",uae,[(w(!0),T(Pe,null,ot(l.value.options,(P,Z)=>(w(),T("label",{key:P.id,class:We(["qopt",{selected:I(l.value.id,P.id)}]),onClick:bt(K=>l.value.multiSelect?m(l.value.id,P.id):v(l.value.id,P.id),["prevent"])},[_("span",fae,O(Z+1),1),_("span",hae,[l.value.multiSelect?(w(),T("span",pae,O(I(l.value.id,P.id)?"■":"□"),1)):(w(),T("span",mae,O(I(l.value.id,P.id)?"●":"○"),1))]),_("span",gae,[_("span",vae,O(P.label),1),P.description?(w(),T("span",yae,O(P.description),1)):ce("",!0)])],10,dae))),128)),l.value.allowOther?(w(),T("label",{key:0,class:We(["qopt",{selected:x(l.value.id)}]),onClick:H[4]||(H[4]=bt(P=>$(l.value.id),["prevent"]))},[H[6]||(H[6]=_("span",{class:"qopt-key"},null,-1)),_("span",kae,[l.value.multiSelect?(w(),T("span",bae,O(x(l.value.id)?"■":"□"),1)):(w(),T("span",xae,O(x(l.value.id)?"●":"○"),1))]),_("span",wae,O(l.value.otherLabel??C(o)("question.otherDefault")),1),Fn(_("input",{ref_key:"otherInputEl",ref:k,"onUpdate:modelValue":H[1]||(H[1]=P=>y.value[l.value.id]=P),class:"other-input",type:"text",placeholder:l.value.otherLabel??C(o)("question.otherDefault"),onInput:H[2]||(H[2]=P=>A(l.value.id)),onFocus:H[3]||(H[3]=P=>A(l.value.id))},null,40,_ae),[[_s,y.value[l.value.id]]])],2)):ce("",!0)])])]),key:"0"},r.value?void 0:{name:"foot",fn:Ee(()=>[_("div",Sae,[i.value<a.value-1?(w(),we(Bt,{key:0,class:"qfoot-btn qfoot-main",size:"sm",variant:"primary",disabled:!h(),onClick:u},{default:Ee(()=>[Je(O(C(o)("question.nextQuestion")),1)]),_:1},8,["disabled"])):(w(),we(Bt,{key:1,class:"qfoot-btn qfoot-main",size:"sm",variant:"primary",disabled:!L(),loading:E.value,onClick:N},{default:Ee(()=>[Je(O(C(o)("question.submit")),1)]),_:1},8,["disabled","loading"])),a.value>1?(w(),we(Bt,{key:2,class:"qfoot-btn",size:"sm",variant:"secondary",disabled:i.value===0||S.value,onClick:c},{default:Ee(()=>[Je(O(C(o)("question.back")),1)]),_:1},8,["disabled"])):ce("",!0),re(Bt,{class:"qfoot-btn",size:"sm",variant:"ghost",loading:F.value,disabled:S.value,onClick:D},{default:Ee(()=>[Je(O(C(o)("question.dismiss")),1)]),_:1},8,["loading","disabled"])])]),key:"1"}]),1032,["class"]))}}),Aae=ct(Cae,[["__scopeId","data-v-14c58ac1"]]),Mae={class:"ah"},Eae={class:"akind"},Tae={class:"apath"},Nae={class:"ah-path"},Iae={key:1,class:"diff"},Lae={class:"dg"},$ae={class:"dc"},Fae={key:2,class:"body-shell"},Oae={class:"shell-cmd"},Rae={key:0,class:"shell-cwd"},Bae={key:1,class:"shell-danger"},Dae={key:3,class:"body-file"},Pae={class:"file-bar"},Hae={class:"file-lang"},Wae={class:"file-content"},zae={class:"file-ln"},Uae={class:"file-text"},qae={key:4,class:"body-chip"},jae={class:"chip-label"},Vae={class:"chip-value"},Kae={key:0,class:"chip-detail"},Gae={key:5,class:"body-chip"},Yae={key:0,class:"chip-label"},Zae={class:"chip-value"},Qae={key:6,class:"body-chip"},Xae={class:"chip-label"},Jae={class:"chip-value"},ece={key:0,class:"chip-detail"},tce={key:7,class:"body-chip"},nce={class:"chip-label"},oce={class:"chip-value"},sce={key:0,class:"chip-detail"},ice={key:8,class:"body-todo"},rce={class:"todo-glyph"},lce={key:9,class:"body-plan"},ace={key:10,class:"body-generic"},cce={class:"gen-text"},uce={key:11,class:"feedback-wrap"},dce=["placeholder"],fce={class:"feedback-hint"},hce={key:0,class:"plan-actions"},pce={key:1,class:"abtn"},mce=Ze({__name:"ApprovalCard",props:{block:{},agentName:{},busy:{type:Boolean}},emits:["decide"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Tt(),i=R(()=>{const E=n.block;return E.kind!=="plan_review"?null:{plan:E.plan,path:E.path,options:E.options??[]}}),r=J(!1),l=["shell","diff","file","fileop","url","search","invocation","todo","plan_review","generic"];function a(){const E=l.includes(n.block.kind)?n.block.kind:"generic";return s(`approval.title.${E}`)}const c=J(!1),u=J(""),d=J(null);function f(){n.busy||(c.value=!0,u.value="",setTimeout(()=>d.value?.focus(),0))}function h(){if(n.busy)return;const E=u.value.trim();i.value?v("feedback",{decision:"rejected",selectedLabel:"Revise",feedback:E||void 0}):v("feedback",{decision:"rejected",feedback:E||void 0}),c.value=!1,u.value=""}function p(){c.value=!1,u.value=""}function g(E){E.key==="Enter"&&!E.shiftKey?(E.preventDefault(),h()):E.key==="Escape"&&(E.preventDefault(),p())}const b=J(null);Qe(()=>n.busy,E=>{E||(b.value=null)});function v(E,F){n.busy||(b.value=E,o("decide",F))}function m(){v("approve",{decision:"approved"})}function y(){v("approveSession",{decision:"approved",scope:"session"})}function k(){v("reject",{decision:"rejected"})}function A(){v("approvePlan",{decision:"approved"})}function $(E){v(`option:${E}`,{decision:"approved",selectedLabel:E})}function I(){n.busy||f()}function x(){v("rejectAndExit",{decision:"rejected",selectedLabel:"Reject and Exit"})}function L(E){const F=(document.activeElement?.tagName??"").toLowerCase();if(F==="input"||F==="textarea"||n.busy||r.value)return;const S=i.value;if(S){if(S.options.length===0){E.key==="1"?(E.preventDefault(),A()):E.key==="2"?(E.preventDefault(),I()):E.key==="3"&&(E.preventDefault(),x());return}E.key==="1"&&S.options[0]?(E.preventDefault(),$(S.options[0].label)):E.key==="2"&&S.options[1]?(E.preventDefault(),$(S.options[1].label)):E.key==="3"&&S.options[2]&&(E.preventDefault(),$(S.options[2].label));return}E.key==="1"?(E.preventDefault(),m()):E.key==="2"?(E.preventDefault(),y()):E.key==="3"?(E.preventDefault(),k()):E.key==="4"&&(E.preventDefault(),f())}return cn(()=>document.addEventListener("keydown",L)),bn(()=>document.removeEventListener("keydown",L)),(E,F)=>(w(),we(qk,{class:We(["appr",{minimized:r.value}])},e3({head:Ee(()=>[_("div",Mae,[F[2]||(F[2]=_("span",{class:"ah-ic"},"!",-1)),_("span",Eae,O(a()),1),_("span",Tae,[e.block.kind==="diff"||e.block.kind==="file"||e.block.kind==="fileop"?(w(),T(Pe,{key:0},[Je(O(e.block.path),1)],64)):e.block.kind==="shell"?(w(),T(Pe,{key:1},[Je(O(e.block.command),1)],64)):e.block.kind==="url"?(w(),T(Pe,{key:2},[Je(O(e.block.url),1)],64)):e.block.kind==="search"?(w(),T(Pe,{key:3},[Je(O(e.block.query),1)],64)):e.block.kind==="invocation"?(w(),T(Pe,{key:4},[Je(O(e.block.name),1)],64)):e.block.kind==="generic"?(w(),T(Pe,{key:5},[Je(O(e.block.summary),1)],64)):ce("",!0)]),e.agentName&&!r.value?(w(),we(Ri,{key:0,variant:"neutral",size:"sm"},{default:Ee(()=>[Je(O(C(s)("approval.subagentBadge",{name:e.agentName})),1)]),_:1})):ce("",!0),r.value?ce("",!0):(w(),we(Ri,{key:1,variant:"warning",size:"sm",class:"aw"},{default:Ee(()=>[Je(O(C(s)("approval.required")),1)]),_:1})),re(Pn,{class:"amin",size:"sm",label:r.value?C(s)("question.expand"):C(s)("question.minimize"),onClick:F[0]||(F[0]=S=>r.value=!r.value)},{default:Ee(()=>[r.value?(w(),we(Ve,{key:0,name:"chevron-up",size:"md"})):(w(),we(Ve,{key:1,name:"minus",size:"md"}))]),_:1},8,["label"])])]),_:2},[r.value?void 0:{name:"default",fn:Ee(()=>[e.block.kind==="plan_review"&&e.block.path?(w(),we(Xt,{key:0,text:e.block.path},{default:Ee(()=>[_("div",Nae,O(e.block.path),1)]),_:1},8,["text"])):ce("",!0),e.block.kind==="diff"?(w(),T("div",Iae,[(w(!0),T(Pe,null,ot(e.block.diff,(S,N)=>(w(),T("div",{key:N,class:We(["dl",S.kind==="add"?"add":S.kind==="rem"?"del":""])},[_("span",Lae,O(S.gutter),1),_("span",$ae,O(S.text),1)],2))),128))])):e.block.kind==="shell"?(w(),T("div",Fae,[_("div",Oae,[F[3]||(F[3]=_("span",{class:"shell-dollar"},"$",-1)),Je(" "+O(e.block.command),1)]),e.block.cwd?(w(),T("div",Rae,"cwd: "+O(e.block.cwd),1)):ce("",!0),e.block.danger?(w(),T("div",Bae,O(C(s)("approval.danger",{detail:e.block.danger})),1)):ce("",!0)])):e.block.kind==="file"?(w(),T("div",Dae,[_("div",Pae,[_("span",Hae,O(e.block.language??""),1)]),_("div",Wae,[(w(!0),T(Pe,null,ot(e.block.content.split(`
297
+ `),(S,N)=>(w(),T("div",{key:N,class:"file-line"},[_("span",zae,O(N+1),1),_("span",Uae,O(S),1)]))),128))])])):e.block.kind==="fileop"?(w(),T("div",qae,[_("span",jae,O(e.block.op),1),_("span",Vae,O(e.block.path),1),e.block.detail?(w(),T("span",Kae,O(e.block.detail),1)):ce("",!0)])):e.block.kind==="url"?(w(),T("div",Gae,[e.block.method?(w(),T("span",Yae,O(e.block.method),1)):ce("",!0),_("span",Zae,O(e.block.url),1)])):e.block.kind==="search"?(w(),T("div",Qae,[_("span",Xae,O(C(s)("approval.searchQueryLabel")),1),_("span",Jae,O(e.block.query),1),e.block.scope?(w(),T("span",ece,O(C(s)("approval.searchScope",{scope:e.block.scope})),1)):ce("",!0)])):e.block.kind==="invocation"?(w(),T("div",tce,[_("span",nce,O(e.block.kind2),1),_("span",oce,O(e.block.name),1),e.block.description?(w(),T("span",sce,O(e.block.description),1)):ce("",!0)])):e.block.kind==="todo"?(w(),T("div",ice,[(w(!0),T(Pe,null,ot(e.block.items,(S,N)=>(w(),T("div",{key:N,class:"todo-item"},[_("span",rce,O(S.status==="done"||S.status==="completed"?"✓":"○"),1),_("span",{class:We(["todo-title",{"todo-done":S.status==="done"||S.status==="completed"}])},O(S.title),3)]))),128))])):e.block.kind==="plan_review"?(w(),T("div",lce,[re(Wm,{text:e.block.plan},null,8,["text"])])):(w(),T("div",ace,[_("span",cce,O(e.block.summary),1)])),c.value?(w(),T("div",uce,[Fn(_("textarea",{ref_key:"feedbackRef",ref:d,"onUpdate:modelValue":F[1]||(F[1]=S=>u.value=S),class:"feedback-ta",placeholder:C(s)("approval.feedbackPlaceholder"),rows:"2",onKeydown:g},null,40,dce),[[_s,u.value]]),_("div",fce,O(C(s)("approval.feedbackHint")),1)])):ce("",!0)]),key:"0"},r.value?void 0:{name:"foot",fn:Ee(()=>[i.value?(w(),T("div",hce,[i.value.options.length>0?(w(!0),T(Pe,{key:0},ot(i.value.options,(S,N)=>(w(),we(Xt,{key:N,text:S.description},{default:Ee(()=>[re(Bt,{class:"kbtn",size:"sm",variant:"primary",loading:b.value===`option:${S.label}`,disabled:e.busy,onClick:D=>$(S.label)},{default:Ee(()=>[Je(O(S.label),1),re(kr,{class:"k",keys:[String(N+1)]},null,8,["keys"])]),_:2},1032,["loading","disabled","onClick"])]),_:2},1032,["text"]))),128)):(w(),we(Bt,{key:1,class:"kbtn",size:"sm",variant:"primary",loading:b.value==="approvePlan",disabled:e.busy,onClick:A},{default:Ee(()=>[Je(O(C(s)("approval.approvePlan")),1),re(kr,{class:"k",keys:["1"]})]),_:1},8,["loading","disabled"])),re(Bt,{class:"kbtn",size:"sm",variant:"secondary",disabled:e.busy,onClick:I},{default:Ee(()=>[Je(O(C(s)("approval.revise")),1),i.value.options.length===0?(w(),we(kr,{key:0,class:"k",keys:["2"]})):ce("",!0)]),_:1},8,["disabled"]),re(Bt,{class:"kbtn",size:"sm",variant:"danger-soft",loading:b.value==="rejectAndExit",disabled:e.busy,onClick:x},{default:Ee(()=>[Je(O(C(s)("approval.rejectAndExit")),1),i.value.options.length===0?(w(),we(kr,{key:0,class:"k",keys:["3"]})):ce("",!0)]),_:1},8,["loading","disabled"])])):(w(),T("div",pce,[re(Bt,{class:"kbtn",size:"sm",variant:"primary",loading:b.value==="approve",disabled:e.busy,onClick:m},{default:Ee(()=>[Je(O(C(s)("approval.approve")),1),re(kr,{class:"k",keys:["1"]})]),_:1},8,["loading","disabled"]),re(Bt,{class:"kbtn",size:"sm",variant:"secondary",loading:b.value==="approveSession",disabled:e.busy,onClick:y},{default:Ee(()=>[Je(O(C(s)("approval.approveSession")),1),re(kr,{class:"k",keys:["2"]})]),_:1},8,["loading","disabled"]),re(Bt,{class:"kbtn",size:"sm",variant:"secondary",loading:b.value==="reject",disabled:e.busy,onClick:k},{default:Ee(()=>[Je(O(C(s)("approval.reject")),1),re(kr,{class:"k",keys:["3"]})]),_:1},8,["loading","disabled"]),re(Bt,{class:"kbtn",size:"sm",variant:"secondary",disabled:e.busy,onClick:f},{default:Ee(()=>[Je(O(C(s)("approval.feedback")),1),re(kr,{class:"k",keys:["4"]})]),_:1},8,["disabled"])]))]),key:"1"}]),1032,["class"]))}}),gce=ct(mce,[["__scopeId","data-v-458a9d7d"]]),vce=Ze({__name:"StatusGlyph",props:{status:{}},setup(e){const t=e,n={pending:"○",run:"●",done:"✓",fail:"✗"};return(o,s)=>(w(),T("span",{class:We(["status-glyph",`s-${t.status}`]),"aria-hidden":"true"},O(n[t.status]),3))}}),B5=ct(vce,[["__scopeId","data-v-f595d935"]]),yce={class:"taskspane"},kce={class:"tp-head"},bce={class:"tp-title"},xce={class:"tp-count"},wce={class:"tp-list"},_ce={key:0,class:"tp-empty"},Sce=["role","onClick"],Cce={class:"tp-name"},Ace={class:"tp-time"},Mce=["onClick"],Ece={key:0,class:"tp-detail"},Tce={key:0,class:"tp-codebox"},Nce=["onClick"],Ice={class:"tp-pre"},Lce={class:"tp-cmd"},$ce={key:1,class:"tp-codebox"},Fce=["onClick"],Oce={class:"tp-pre"},Rce=Ze({__name:"TasksPane",props:{tasks:{}},emits:["cancel","open"],setup(e,{emit:t}){const n=t,{t:o}=Tt(),s=Bo(new Set),i=Bo(new Set),r=Bo(new Set);function l(p){return!!(p.output&&p.output.length>0||p.meta)}function a(p){if(p.kind==="subagent"){n("open",p.id);return}l(p)&&(s.has(p.id)?s.delete(p.id):s.add(p.id))}function c(p){return p.kind==="subagent"||l(p)}function u(p){return p==="run"||p==="done"||p==="fail"?p:"pending"}async function d(p,g,b){await Go(p)&&(b.add(g),setTimeout(()=>b.delete(g),1500))}async function f(p){p.meta&&await d(p.meta,p.id,i)}async function h(p){const g=p.output?.join(`
298
+ `)??"";g&&await d(g,p.id,r)}return(p,g)=>(w(),T("div",yce,[_("div",kce,[_("span",bce,O(C(o)("tasks.tag")),1),_("span",xce,O(e.tasks.length),1)]),_("div",wce,[e.tasks.length===0?(w(),T("div",_ce,O(C(o)("tasks.emptyTasks")),1)):(w(!0),T(Pe,{key:1},ot(e.tasks,b=>(w(),T("div",{key:b.id,class:We(["tp-row",{done:b.state==="done",fail:b.state==="fail",expandable:c(b)}])},[_("div",{class:"tp-main",role:c(b)?"button":void 0,onClick:v=>a(b)},[re(B5,{status:u(b.state)},null,8,["status"]),_("span",Cce,O(b.name),1),re(Ri,{variant:"neutral",size:"sm"},{default:Ee(()=>[Je(O(b.kind),1)]),_:2},1024),_("span",Ace,O(b.timing),1),b.state==="run"?(w(),T("button",{key:0,class:"tp-stop",onClick:bt(v=>n("cancel",b.id),["stop"])},O(C(o)("tasks.stop")),9,Mce)):ce("",!0),b.kind==="subagent"?(w(),we(Ve,{key:1,class:"tp-chevron",name:"chevron-right",size:"sm"})):l(b)?(w(),we(Ve,{key:2,class:We(["tp-chevron",{open:s.has(b.id)}]),name:"chevron-right",size:"sm"},null,8,["class"])):ce("",!0)],8,Sce),s.has(b.id)&&l(b)?(w(),T("div",Ece,[b.meta?(w(),T("div",Tce,[_("button",{class:We(["tp-copy",{copied:i.has(b.id)}]),onClick:bt(v=>f(b),["stop"])},O(i.has(b.id)?"已复制":"复制"),11,Nce),_("pre",Ice,[_("code",null,[_("span",Lce,O(b.meta),1)])])])):ce("",!0),b.output&&b.output.length>0?(w(),T("div",$ce,[_("button",{class:We(["tp-copy",{copied:r.has(b.id)}]),onClick:bt(v=>h(b),["stop"])},O(r.has(b.id)?"已复制":"复制"),11,Fce),_("pre",Oce,[_("code",null,[g[0]||(g[0]=Je(`
299
+ `,-1)),(w(!0),T(Pe,null,ot(b.output,(v,m)=>(w(),T("span",{key:m,class:"tp-line"},O(v),1))),128)),g[1]||(g[1]=Je(`
300
+ `,-1))])])])):ce("",!0)])):ce("",!0)],2))),128))])]))}}),qC=ct(Rce,[["__scopeId","data-v-28fd5fc0"]]),Bce={class:"todo-card"},Dce={key:0,class:"tc-empty"},Pce={class:"tc-name"},Hce=Ze({__name:"TodoCard",props:{todos:{}},setup(e){const t=e,{t:n}=Tt();function o(s){return s==="in_progress"?"run":s}return(s,i)=>(w(),T("div",Bce,[t.todos.length===0?(w(),T("div",Dce,[i[0]||(i[0]=_("svg",{class:"tc-empty-ico",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[_("path",{d:"M9 11l2 2 4-4"}),_("rect",{x:"4",y:"4",width:"16",height:"16",rx:"3"})],-1)),_("span",null,O(C(n)("tasks.emptyTodo")),1)])):ce("",!0),(w(!0),T(Pe,null,ot(t.todos,(r,l)=>(w(),T("div",{key:l,class:We(["tc-row",`s-${r.status}`])},[re(B5,{status:o(r.status)},null,8,["status"]),_("span",Pce,O(r.title),1)],2))),128))]))}}),Wce=ct(Hce,[["__scopeId","data-v-01c65735"]]),zce={class:"dock-work-head"},Uce={key:0,class:"dock-work-tab static"},qce={key:1,class:"dock-work-tab static"},jce={key:2,class:"dock-work-tab static"},Vce={class:"dock-work-body"},Kce={class:"dw-count"},Gce={class:"dw-count"},Yce={class:"dw-count"},Zce=Ze({__name:"ChatDock",props:{sessionId:{},running:{type:Boolean},starting:{type:Boolean},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},activationBadges:{},models:{},starredIds:{},skills:{},goal:{},goalExpandSignal:{},dockPanel:{},bashTasks:{},subagentTasks:{},bashRunning:{},subagentRunning:{},todoDoneCount:{},hasDockWork:{type:Boolean},todos:{},pendingQuestion:{},questionBusyKind:{},pendingApproval:{},approvalBusy:{type:Boolean},mobile:{type:Boolean}},emits:["submit","steer","command","interrupt","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","openBtw","createGoal","controlGoal","focusGoal","focusSwarm","compact","pickModel","selectModel","answer","dismiss","approval","cancelTask","toggle-dock-panel","close-dock-panel","openAgent"],setup(e,{expose:t,emit:n}){const o=e,s=n,{t:i}=Tt(),r=J(null),l=J(null),a=J(null),c=J(null);function u(b){return r.value?(r.value.loadForEdit(b),!0):!1}function d(b){r.value?.loadAttachmentsForEdit(b)}function f(){r.value?.focus()}function h(b){if(!o.dockPanel)return;const v=b.target;v&&(l.value?.contains(v)||a.value?.contains(v)||s("close-dock-panel"))}Qe(()=>o.dockPanel,b=>{typeof document>"u"||(document.removeEventListener("mousedown",h,!0),b&&document.addEventListener("mousedown",h,!0))},{immediate:!0});let p=null;function g(){const b=c.value?.offsetHeight??0;document.documentElement.style.setProperty("--dock-h",`${b}px`)}return cn(()=>{typeof ResizeObserver!="function"||!c.value||(p=new ResizeObserver(g),p.observe(c.value),g())}),bn(()=>{typeof document<"u"&&document.removeEventListener("mousedown",h,!0),p?.disconnect(),p=null}),t({loadForEdit:u,loadAttachmentsForEdit:d,focus:f}),(b,v)=>(w(),T("div",{ref_key:"dockRef",ref:c,class:We(["chat-dock",[e.mobile?"align-mobile":"align-center"]]),onClick:v[28]||(v[28]=bt(()=>{},["stop"]))},[re(Il,{name:"dock-panel"},{default:Ee(()=>[e.dockPanel?(w(),T("div",{key:0,ref_key:"workPanelRef",ref:l,class:"dock-work-panel",onClick:v[3]||(v[3]=bt(()=>{},["stop"]))},[_("div",zce,[e.dockPanel==="bash"?(w(),T("span",Uce,O(C(i)("tasks.dockBash"))+" · "+O(e.bashRunning)+" "+O(C(i)("tasks.running")),1)):e.dockPanel==="subagent"?(w(),T("span",qce,O(C(i)("tasks.dockSubagent"))+" · "+O(e.subagentRunning)+" "+O(C(i)("tasks.running")),1)):e.dockPanel==="todos"?(w(),T("span",jce,O(C(i)("tasks.dockTodos"))+" · "+O(e.todoDoneCount)+"/"+O(e.todos?.length??0),1)):ce("",!0)]),_("div",Vce,[e.dockPanel==="bash"?(w(),we(qC,{key:0,tasks:e.bashTasks,onCancel:v[0]||(v[0]=m=>s("cancelTask",m))},null,8,["tasks"])):e.dockPanel==="subagent"?(w(),we(qC,{key:1,tasks:e.subagentTasks,onCancel:v[1]||(v[1]=m=>s("cancelTask",m)),onOpen:v[2]||(v[2]=m=>s("openAgent",m))},null,8,["tasks"])):e.dockPanel==="todos"?(w(),we(Wce,{key:2,todos:e.todos??[]},null,8,["todos"])):ce("",!0)])],512)):ce("",!0)]),_:1}),e.goal?(w(),we(Jle,{key:0,goal:e.goal,"force-expanded":e.goalExpandSignal,onControlGoal:v[4]||(v[4]=m=>s("controlGoal",m))},null,8,["goal","force-expanded"])):ce("",!0),e.hasDockWork?(w(),T("div",{key:1,ref_key:"workbarRef",ref:a,class:"dock-workbar"},[e.bashTasks.length>0?(w(),we(kh,{key:0,active:e.dockPanel==="bash","aria-pressed":e.dockPanel==="bash",onClick:v[5]||(v[5]=m=>s("toggle-dock-panel","bash"))},{default:Ee(()=>[re(Ve,{name:"clock",size:"md"}),_("span",null,O(C(i)("tasks.dockBash")),1),_("span",Kce,[v[29]||(v[29]=Je("(",-1)),_("b",null,O(e.bashTasks.length),1),v[30]||(v[30]=Je(")",-1))])]),_:1},8,["active","aria-pressed"])):ce("",!0),e.subagentTasks.length>0?(w(),we(kh,{key:1,active:e.dockPanel==="subagent","aria-pressed":e.dockPanel==="subagent",onClick:v[6]||(v[6]=m=>s("toggle-dock-panel","subagent"))},{default:Ee(()=>[re(Ve,{name:"sparkles",size:"md"}),_("span",null,O(C(i)("tasks.dockSubagent")),1),_("span",Gce,[v[31]||(v[31]=Je("(",-1)),_("b",null,O(e.subagentTasks.length),1),v[32]||(v[32]=Je(")",-1))])]),_:1},8,["active","aria-pressed"])):ce("",!0),(e.todos?.length??0)>0?(w(),we(kh,{key:2,active:e.dockPanel==="todos","aria-pressed":e.dockPanel==="todos",onClick:v[7]||(v[7]=m=>s("toggle-dock-panel","todos"))},{default:Ee(()=>[re(Ve,{name:"check-list",size:"md"}),_("span",null,O(C(i)("tasks.dockTodos")),1),_("span",Yce,[v[33]||(v[33]=Je("(",-1)),_("b",null,O(e.todoDoneCount)+"/"+O(e.todos?.length??0),1),v[34]||(v[34]=Je(")",-1))])]),_:1},8,["active","aria-pressed"])):ce("",!0)],512)):ce("",!0),e.pendingQuestion?(w(),we(Aae,{key:e.pendingQuestion.questionId,question:e.pendingQuestion,"busy-kind":e.questionBusyKind,onAnswer:v[8]||(v[8]=(m,y)=>s("answer",m,y)),onDismiss:v[9]||(v[9]=m=>s("dismiss",m))},null,8,["question","busy-kind"])):e.pendingApproval?(w(),we(gce,{key:e.pendingApproval.approvalId,class:"dock-approval",block:e.pendingApproval.block,"agent-name":e.pendingApproval.agentName,busy:e.approvalBusy,onDecide:v[10]||(v[10]=m=>s("approval",e.pendingApproval.approvalId,m))},null,8,["block","agent-name","busy"])):(w(),we(R5,{key:4,ref_key:"composerRef",ref:r,"session-id":e.sessionId,running:e.running,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,goal:e.goal,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,starting:e.starting,onSubmit:v[11]||(v[11]=m=>s("submit",m)),onSteer:v[12]||(v[12]=m=>s("steer",m)),onCommand:v[13]||(v[13]=m=>s("command",m)),onInterrupt:v[14]||(v[14]=m=>s("interrupt")),onSetPermission:v[15]||(v[15]=m=>s("setPermission",m)),onSetThinking:v[16]||(v[16]=m=>s("setThinking",m)),onTogglePlan:v[17]||(v[17]=m=>s("togglePlan")),onToggleSwarm:v[18]||(v[18]=m=>s("toggleSwarm")),onToggleGoal:v[19]||(v[19]=m=>s("toggleGoal")),onOpenBtw:v[20]||(v[20]=m=>s("openBtw")),onCreateGoal:v[21]||(v[21]=m=>s("createGoal",m)),onControlGoal:v[22]||(v[22]=m=>s("controlGoal",m)),onFocusGoal:v[23]||(v[23]=m=>s("focusGoal")),onFocusSwarm:v[24]||(v[24]=m=>s("focusSwarm")),onCompact:v[25]||(v[25]=m=>s("compact")),onPickModel:v[26]||(v[26]=m=>s("pickModel")),onSelectModel:v[27]||(v[27]=m=>s("selectModel",m))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","goal","activation-badges","models","starred-ids","skills","starting"]))],2))}}),Qce=ct(Zce,[["__scopeId","data-v-9e5ec0f2"]]),Xce=["aria-label","aria-hidden"],Jce={class:"toc-scroll"},eue=["onClick"],tue={class:"toc-label"},nue=240,oue=Ze({__name:"ConversationToc",props:{items:{},activeTurnId:{},mobile:{type:Boolean},sessionLoading:{type:Boolean},occluded:{type:Boolean}},emits:["select"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Tt(),i=J(null),r=J(!0);let l=null;function a(){const u=i.value,d=u?.offsetParent;if(!u||!d)return;const f=u.getBoundingClientRect().left,h=d.getBoundingClientRect().right;r.value=h-f>=nue}const c=R(()=>!n.mobile&&!n.sessionLoading&&n.items.length>1);return Qe(c,u=>{l?.disconnect(),l=null,u&&mt(()=>{const d=i.value,f=d?.offsetParent;!d||!f||(typeof ResizeObserver<"u"&&(l=new ResizeObserver(a),l.observe(f)),a())})},{immediate:!0}),po(()=>{l?.disconnect(),l=null}),(u,d)=>c.value?(w(),T("nav",{key:0,ref_key:"navRef",ref:i,class:We(["conversation-toc",{"toc-clipped":!r.value||e.occluded}]),"aria-label":C(s)("conversation.toc"),"aria-hidden":r.value&&!e.occluded?void 0:!0},[_("div",Jce,[(w(!0),T(Pe,null,ot(e.items,f=>(w(),T("button",{key:f.id,type:"button",class:We(["toc-row",{active:e.activeTurnId===f.id}]),onClick:h=>o("select",f.id)},[d[0]||(d[0]=_("span",{class:"toc-bar"},null,-1)),_("span",tue,O(f.title),1)],10,eue))),128))])],10,Xce)):ce("",!0)}}),sue=ct(oue,[["__scopeId","data-v-3f1c1f66"]]),iue=5;function rue(e,t,n,o=iue){if(n||e.length<=o)return e;const s=e.slice(0,o);if(t&&!s.some(i=>i.id===t)){const i=e.find(r=>r.id===t);i&&(s[o-1]=i)}return s}const lue={class:"chat-layout"},aue={class:"empty-hint"},cue={key:0,class:"empty-hint-text"},uue={key:1,class:"ws-pick"},due={class:"ws-pick-name"},fue={key:1,class:"ws-pick-menu"},hue=["onClick"],pue={class:"ws-pick-item-name"},mue={class:"ws-pick-item-path"},gue=["aria-label"],vue={key:0,class:"abort-toast",role:"status","aria-live":"polite"},yue={class:"abort-toast-text"},vg=80,jC=1e3,kue=420,bue=3e3,xue=Ze({__name:"ConversationPane",props:{turns:{},sessionId:{},approvals:{},gitInfo:{},tasks:{},todos:{},goal:{},activationBadges:{},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},questions:{},pendingQuestionActions:{},pendingApprovalActions:{},running:{type:Boolean},turnActive:{type:Boolean},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},changes:{},fileReloadKey:{},working:{type:Boolean},starting:{type:Boolean},fastMoon:{type:Boolean},mobile:{type:Boolean},sessionLoading:{type:Boolean},compaction:{},hasMoreMessages:{type:Boolean},loadingMore:{type:Boolean},loadingMoreError:{type:Boolean},loadOlderMessages:{type:Function},models:{},starredIds:{},skills:{},workspaceName:{},workspaceRoot:{},gitDiffStats:{},workspaces:{},activeWorkspaceId:{},sessionTitle:{},pr:{},conversationToc:{type:Boolean}},emits:["submit","steer","approval","cancelTask","answer","dismiss","command","interrupt","unqueue","editQueued","reorderQueue","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","createGoal","controlGoal","compact","pickModel","selectModel","openFile","openMedia","openThinking","openCompaction","openAgent","openToolDiff","openChanges","refreshGitStatus","editMessage","selectWorkspace","addWorkspace","openPr","renameSession","forkSession","archiveSession","exportSession"],setup(e,{expose:t,emit:n}){const{t:o}=Tt(),s=e,i=n,r=J(!1),l=J(!1),a=R(()=>s.workspaces?.find(_e=>_e.id===s.activeWorkspaceId)?.name??s.workspaceName??""),c=R(()=>(s.workspaces?.length??0)>0),u=R(()=>rue(s.workspaces??[],s.activeWorkspaceId,l.value)),d=R(()=>(s.workspaces?.length??0)-u.value.length);Qe(r,pe=>{pe||(l.value=!1)});function f(pe){r.value=!1,pe!==s.activeWorkspaceId&&i("selectWorkspace",pe)}Na(Ft.contentAlign);const h=J(null),p=J(null),g=J(null),b=J(!1),v=J(0);let m=null;function y(pe,_e){const He=g.value??p.value;return!He||He.loadForEdit(pe)===!1?!1:(He.loadAttachmentsForEdit(_e??[]),!0)}function k(){b.value=!0,m!==null&&clearTimeout(m),m=setTimeout(()=>{m=null,b.value=!1},2e3)}function A(){v.value++}const $=R(()=>s.tasks.filter(pe=>pe.kind!=="subagent")),I=R(()=>s.tasks.filter(pe=>pe.kind==="subagent"&&pe.runInBackground)),x=R(()=>$.value.filter(pe=>pe.state==="run").length),L=R(()=>I.value.filter(pe=>pe.state==="run").length);function E(pe){const _e=s.tasks,He=_e.find(Dt=>Dt.id===pe)??_e.find(Dt=>Dt.parentToolCallId===pe);if(He)return He.id;const Rt=_e.filter(Dt=>Dt.kind==="subagent"&&!Dt.parentToolCallId);if(Rt.length===1)return Rt[0].id}Ln("resolveAgentTaskId",E),Ln("pinScroll",to);const F=R(()=>(s.todos??[]).filter(pe=>pe.status==="done").length),S=R(()=>$.value.length>0||I.value.length>0||(s.todos?.length??0)>0||(s.queued?.length??0)>0),N=J(null),D=R(()=>s.gitInfo?s.changes?.length??0:0);function B(pe){N.value=N.value===pe?null:pe}function U(){N.value=null}Qe(S,pe=>{pe||U()});function H(pe){if(pe.role==="compaction")return o("conversation.compactedPlain");if(pe.role==="user"){if(pe.skillActivation)return`/${pe.skillActivation.name}`;if(pe.pluginCommand)return`/${pe.pluginCommand.pluginId}:${pe.pluginCommand.commandName}`;const He=pe.text.trim().replaceAll(/\s+/g," ");return He.length>0?He:"user"}const _e=(pe.text||pe.thinking||"").trim().replaceAll(/\s+/g," ");return _e.length>0?_e:(pe.tools?.length??0)>0?`${pe.tools.length} tools`:"kimi"}const P=R(()=>s.turns.filter(pe=>pe.role==="user").map((pe,_e)=>({id:pe.id,role:pe.role,no:_e+1,title:H(pe)}))),Z=J(null);function K(){const pe=le.value;if(!pe)return;const _e=pe.querySelectorAll(".turn-anchor[data-turn-id]");if(_e.length===0)return;const He=P.value;if(He.length===0)return;const Rt=new Set(He.map(Cs=>Cs.id));if(me()<=vg){Z.value=He[He.length-1].id;return}const Dt=pe.getBoundingClientRect(),rn=Dt.height/2;let Un=null;_e.forEach(Cs=>{const Q=Cs.dataset.turnId;if(!Q||!Rt.has(Q))return;Cs.getBoundingClientRect().top-Dt.top<=rn&&(Un=Q)}),Z.value=Un??He[0].id}const V=J(!1);let X=0;function he(){X||(X=it(()=>{X=0,ne()}))}function ne(){const pe=le.value,_e=!s.mobile&&s.conversationToc&&pe?pe.closest(".con")?.querySelector(".conversation-toc"):null,He=_e?.querySelector(".toc-bar");let Rt=!1;if(pe&&_e&&He){const Dt=He.getBoundingClientRect(),rn=_e.getBoundingClientRect(),Un=Dt.left+Dt.width/2;Rt=Array.from(pe.querySelectorAll(".table-node-wrapper")).some(Cs=>{const Q=Cs.getBoundingClientRect();return Q.left<=Un&&Un<=Q.right&&Q.top<rn.bottom&&Q.bottom>rn.top})}V.value!==Rt&&(V.value=Rt)}const ue=R(()=>s.questions&&s.questions.length>0?s.questions[0]:void 0),de=R(()=>{const pe=ue.value;if(pe)return s.pendingQuestionActions?.[pe.questionId]}),Ce=R(()=>s.approvals&&s.approvals.length>0?s.approvals[0]:void 0),Ie=R(()=>{const pe=Ce.value;return pe?!!s.pendingApprovalActions?.[pe.approvalId]:!1}),le=J(null),z=J(null),ae=J(0),ie=J(0),q=R(()=>({"--panes-scrollbar-width":`${ae.value}px`}));function ee(pe){return pe instanceof HTMLElement?pe:pe&&"$el"in pe&&pe.$el instanceof HTMLElement?pe.$el:null}function ye(){const pe=le.value;ae.value=pe?Math.max(0,pe.offsetWidth-pe.clientWidth):0,ie.value=z.value?.offsetHeight??0}function fe(pe){const _e=ee(pe);le.value=_e,_e&&rs()}function ve(pe){const _e=ee(pe);z.value=_e??null,pe&&"loadForEdit"in pe&&typeof pe.loadForEdit=="function"&&"focus"in pe&&typeof pe.focus=="function"?g.value={loadForEdit:pe.loadForEdit.bind(pe),loadAttachmentsForEdit:"loadAttachmentsForEdit"in pe&&typeof pe.loadAttachmentsForEdit=="function"?pe.loadAttachmentsForEdit.bind(pe):()=>{},focus:pe.focus.bind(pe)}:g.value=null,is()}const j=J(!0),te=J(!1);function me(){const pe=le.value;return pe?pe.scrollHeight-pe.scrollTop-pe.clientHeight:0}let Ae=0,$e=0,De=0,ge=0,Ne=0,et=0;function rt(){return Date.now()<$e}function _t(){he();const pe=le.value;if(!pe)return;const _e=pe.scrollTop;if(qn()){Ae=_e;return}if(performance.now()-De<100){Ae=_e;return}const He=me();if(rt()){j.value=!0,te.value=!1,Ae=_e;return}_e<Ae-1&&He>1?(j.value=!1,te.value=!0):He<=vg&&_e>Ae+1&&(j.value=!0,te.value=!1),Ae=_e,K()}function gt(pe=!1){const _e=le.value;j.value=!0,te.value=!1,_e&&(!pe&&performance.now()<ge||(pe&&typeof _e.scrollTo=="function"?(De=performance.now(),ge=performance.now()+kue,_e.scrollTo({top:_e.scrollHeight,behavior:"smooth"})):_e.scrollTop=_e.scrollHeight,Ae=_e.scrollTop))}function It(pe,_e){return(_e.closest("[inert]")?.closest(".tool-group")??_e).getBoundingClientRect().top-pe.getBoundingClientRect().top+pe.scrollTop}function Ut(pe,_e){const He=Array.from(pe.querySelectorAll(".turn-anchor[data-turn-id], [data-scroll-anchor-id]")).map(rn=>({node:rn,top:It(pe,rn)})),Rt=He.findIndex(rn=>rn.top>=_e),Dt=Rt<0?Math.max(0,He.length-1):Rt;return He.slice(Dt,Dt+2).flatMap(rn=>{const Un=rn.node.dataset.scrollAnchorId,Cs=Un??rn.node.dataset.turnId;return Cs?[{kind:Un?"tool":"turn",id:Cs,top:rn.top}]:[]})}const ht=new Map;function un(pe,_e){for(const He of _e.anchors){const Rt=He.kind==="tool"?"data-scroll-anchor-id":"data-turn-id",Dt=pe.querySelector(`[${Rt}="${Wt(He.id)}"]`);if(Dt)return It(pe,Dt)-He.top}return pe.scrollHeight-_e.oldHeight}function dn(pe,_e,He=pe.scrollTop){return pe.scrollTop=He+un(pe,_e),Ae=pe.scrollTop,pe.scrollTop}async function ns(){if(!s.sessionId||!s.loadOlderMessages||s.loadingMore||Tn.value||!s.hasMoreMessages)return;const pe=s.sessionId,_e=le.value,He=_e?.scrollTop??0,Rt={anchors:_e?Ut(_e,He):[],oldHeight:_e?.scrollHeight??0};jn(pe,!0),ti();try{if(await mt(),await s.loadOlderMessages(pe),await mt(),s.sessionId!==pe){ht.set(pe,Rt);return}const Dt=le.value;if(!Dt)return;dn(Dt,Rt),ht.delete(pe)}finally{jn(pe,!1)}}function Wt(pe){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(pe):pe.replaceAll(/["\\]/g,"\\$&")}function Hn(pe){const _e=le.value;if(!_e)return;const He=_e.querySelector(`.turn-anchor[data-turn-id="${Wt(pe)}"]`);He&&(Io(),j.value=!1,te.value=me()>vg,He.scrollIntoView({behavior:"smooth",block:"center"}))}function lo(){const pe=le.value;if(!pe)return"none";const _e=pe.firstElementChild,He=_e instanceof HTMLElement?_e.offsetHeight:0,Rt=z.value?.offsetHeight??0;return`${pe.scrollHeight}:${pe.clientHeight}:${He}:${Rt}`}function it(pe){return typeof requestAnimationFrame=="function"?requestAnimationFrame(pe):setTimeout(pe,16)}function Gn(pe){typeof cancelAnimationFrame=="function"?cancelAnimationFrame(pe):clearTimeout(pe)}let ao=0,Yn=0,go=null,os=0;function qn(){return performance.now()<ao}function to(pe,_e=260){const He=le.value;if(!He||(go=pe,os=pe.getBoundingClientRect().top,ao=performance.now()+_e,Yn))return;const Rt=()=>{if(Yn=0,performance.now()>=ao||!go){go=null;return}const Dt=go.getBoundingClientRect().top-os;Dt&&(He.scrollTop+=Dt),Yn=it(Rt)};Yn=it(Rt)}function vn(pe=36){if(!j.value&&!rt())return;const _e=++et;let He="",Rt=0,Dt=0;Ne&&(Gn(Ne),Ne=0);const rn=()=>{if(Ne=0,_e!==et||!j.value&&!rt())return;gt(!1);const Un=lo();Rt=Un===He?Rt+1:0,He=Un,Dt++,Rt<3&&Dt<pe&&(Ne=it(rn))};Ne=it(rn)}function Zn(pe,_e){return pe!==void 0&&pe.length>0&&_e.length>=pe.length&&pe.firstId!==_e.firstId&&pe.lastId===_e.lastId&&pe.lastTextLen===_e.lastTextLen&&pe.lastThinkingLen===_e.lastThinkingLen&&pe.lastToolsLen===_e.lastToolsLen&&pe.approvalIds===_e.approvalIds}const xn=R(()=>{const pe=(s.approvals??[]).map(rn=>rn.approvalId).join(","),_e=s.turns,He=_e.at(-1),Rt=He?.thinking?.length??0,Dt=He?.tools?.reduce((rn,Un)=>rn+Un.name.length+(Un.arg?.length??0)+(Un.output?.join("").length??0),0)??0;return{length:_e.length,firstId:_e[0]?.id??"",lastId:He?.id??"",lastTextLen:He?.text.length??0,lastThinkingLen:Rt,lastToolsLen:Dt,approvalIds:pe}});Qe(xn,async(pe,_e)=>{if(Tn.value&&Zn(_e,pe)){K();return}await mt(),j.value||rt()?gt(pe.length<_e.length):te.value=!0,K()}),Qe(z,()=>{is()}),Qe(()=>s.mobile,async()=>{await mt(),ye()});const An=new Map;Qe(()=>s.fileReloadKey,async(pe,_e)=>{const He=le.value;_e&&He&&An.set(String(_e),{top:He.scrollTop,following:j.value}),Io(),await mt();const Rt=le.value,Dt=pe?An.get(String(pe)):void 0;if(Dt&&Rt){const rn=ht.get(String(pe)),Un=rn?dn(Rt,rn,Dt.top):Dt.top;rn&&ht.delete(String(pe)),j.value=Dt.following,Rt.scrollTop=Un,Ae=Rt.scrollTop,te.value=!Dt.following&&me()>1,Dt.following&&vn()}else j.value=!0,Ae=0,gt(!1),vn();K()}),Qe(()=>s.sessionLoading,async(pe,_e)=>{pe||!_e||(j.value=!0,await mt(),vn(),K())}),Qe(()=>s.turnActive,async(pe,_e)=>{pe||!_e||!j.value&&!rt()||(await mt(),vn(48),K())});function Mn(){j.value=!0,te.value=!1,$e=Date.now()+jC,mt(()=>{gt(!0),vn(16)})}function Do(pe){Mn(),i("submit",pe)}function ze(pe){j.value=!0,te.value=!1,$e=Date.now()+jC,i("editMessage",pe)}function Xe(pe){const _e=s.queued?.[pe],He=_e?.text??"";y(He,_e?.attachments)&&i("editQueued",pe)}function kt(pe){i("reorderQueue",pe)}function Ht(pe,_e){Mn(),i("answer",pe,_e)}function Rn(pe,_e){!pe||!_e||i("approval",pe,_e)}let sn=null,Gt=null,Wn=null,En=null,St=0,Po=0,Ao=0;const ss=J(new Set),Tn=R(()=>!!s.sessionId&&ss.value.has(s.sessionId));function jn(pe,_e){const He=new Set(ss.value);_e?He.add(pe):He.delete(pe),ss.value=He}function Ps(){Tn.value||Ao||(Ao=it(()=>{Ao=0,!Tn.value&&(qn()||(j.value||rt())&&gt(!1))}))}function ti(){et++,Ne&&(Gn(Ne),Ne=0),Ao&&(Gn(Ao),Ao=0)}function Io(){const pe=le.value;if($e=0,ti(),ao=0,go=null,pe){const _e=pe.scrollTop;typeof pe.scrollTo=="function"?pe.scrollTo({top:_e,behavior:"auto"}):pe.scrollTop=_e}ge=0,De=Number.NEGATIVE_INFINITY,pe&&(Ae=pe.scrollTop)}function Ss(){const pe=le.value;!pe||pe.scrollHeight-pe.clientHeight<=1&&!s.hasMoreMessages||(j.value=!1,Io(),pe.scrollHeight-pe.clientHeight>1&&(te.value=!0))}function Wi(pe){const _e=le.value;if(!_e)return!1;for(const He of pe.composedPath()){if(He===_e)return!1;if(He instanceof HTMLElement&&He.scrollHeight>He.clientHeight+1&&He.scrollTop>1)return!0}return!1}function Si(pe){pe.defaultPrevented||pe.ctrlKey||pe.shiftKey||pe.deltaY>=0||Wi(pe)||Ss()}function co(pe){const _e=le.value;if(!_e||pe.defaultPrevented||pe.button!==0||pe.pointerType==="touch")return;const He=_e.getBoundingClientRect(),Rt=_e.offsetWidth-_e.clientWidth,Dt=Rt>0?Rt:12;pe.target===_e&&pe.clientX>=He.right-Dt&&Ss()}let ni=null;function Ci(pe){ni=pe.touches.length===1?pe.touches[0].clientY:null}function ar(pe){const _e=pe.touches.length===1?pe.touches[0].clientY:null;_e!==null&&ni!==null&&_e>ni+2&&!Wi(pe)&&Ss(),ni=_e}function no(){if(!Gt)return;const pe=le.value?.firstElementChild??null;pe!==Wn&&(Wn&&Gt.unobserve(Wn),Wn=pe,pe&&Gt.observe(pe))}function is(){if(!Gt)return;const pe=z.value;pe!==En&&(En&&Gt.unobserve(En),En=pe,pe&&Gt.observe(pe))}function rs(){const pe=le.value;ye(),sn&&(sn.disconnect(),pe&&sn.observe(pe,{childList:!0,subtree:!0,characterData:!0})),Gt&&(Gt.disconnect(),Wn=null,En=null,pe&&Gt.observe(pe),no(),is()),St=pe?.scrollHeight??0,Po=pe?.clientHeight??0,he()}function Lo(){no(),Ps(),he()}function Ai(){typeof document>"u"||document.visibilityState==="visible"&&j.value&&vn()}const zn=J(!1);let $o=null;function oi(){zn.value=!0,$o!==null&&clearTimeout($o),$o=setTimeout(()=>{zn.value=!1},bue)}function Ue(){oi(),i("interrupt")}function Fe(pe){pe.key==="Escape"&&(s.running||s.working)&&(pe.preventDefault(),Ue())}function oe(){j.value&&Ps()}cn(()=>{mt(()=>{typeof MutationObserver=="function"&&(sn=new MutationObserver(Lo)),typeof ResizeObserver=="function"&&(Gt=new ResizeObserver(()=>{he(),ye();const pe=le.value;if(!pe)return;const{scrollHeight:_e,clientHeight:He}=pe,Rt=_e>St+1,Dt=He<Po-1;St=_e,Po=He,!qn()&&(Rt||Dt)&&Ps()})),rs(),vn(48),K(),typeof document<"u"&&(document.addEventListener("visibilitychange",Ai),document.addEventListener("keydown",Fe)),window.visualViewport?.addEventListener("resize",oe)})}),bn(()=>{sn&&sn.disconnect(),Gt&&Gt.disconnect(),Ao&&Gn(Ao),Ne&&Gn(Ne),Yn&&Gn(Yn),X&&Gn(X),$o!==null&&clearTimeout($o),m!==null&&(clearTimeout(m),m=null),typeof document<"u"&&(document.removeEventListener("visibilitychange",Ai),document.removeEventListener("keydown",Fe)),window.visualViewport?.removeEventListener("resize",oe)});function Te(){(g.value??p.value)?.focus()}return t({loadComposerForEdit:y,focusComposer:Te}),(pe,_e)=>(w(),T("section",{class:We(["con",{mobile:e.mobile}])},[!e.mobile&&!(e.turns.length===0&&!e.sessionLoading)?(w(),we(mse,{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":D.value,"git-diff-stats":e.gitDiffStats,"is-git-repo":!!e.gitInfo,pr:e.pr,copied:b.value,onOpenChanges:_e[0]||(_e[0]=He=>i("openChanges")),onCopyAll:_e[1]||(_e[1]=He=>h.value?.copyConversation()),onCopyFinalSummary:_e[2]||(_e[2]=He=>h.value?.copyFinalSummary()),onOpenPr:_e[3]||(_e[3]=He=>e.pr&&i("openPr",e.pr.url)),onRenameSession:_e[4]||(_e[4]=(He,Rt)=>i("renameSession",He,Rt)),onForkSession:_e[5]||(_e[5]=He=>i("forkSession",He)),onArchiveSession:_e[6]||(_e[6]=He=>i("archiveSession",He)),onExportSession:_e[7]||(_e[7]=He=>i("exportSession",He))},null,8,["session-id","workspace-name","workspace-root","session-title","branch","ahead","behind","changes-count","git-diff-stats","is-git-repo","pr","copied"])):ce("",!0),e.conversationToc?(w(),we(sue,{key:1,items:P.value,"active-turn-id":Z.value,mobile:e.mobile,"session-loading":e.sessionLoading,occluded:V.value,onSelect:Hn},null,8,["items","active-turn-id","mobile","session-loading","occluded"])):ce("",!0),_("div",lue,[_("div",{ref:fe,class:We(["panes chat-scroll",{"is-following":j.value,"history-prepending":Tn.value}]),onScrollPassive:_t,onWheelPassive:Si,onPointerdownPassive:co,onTouchstartPassive:Ci,onTouchmovePassive:ar},[_("div",{class:We(["content-wrap",[e.mobile?"align-mobile":"align-center"]])},[e.turns.length===0&&!e.sessionLoading?(w(),T(Pe,{key:0},[_e[55]||(_e[55]=_("div",{class:"empty-spacer"},null,-1)),_("div",aue,[_("span",{class:We(["empty-hint-title",{"is-starting":e.starting}])},[e.starting?(w(),we(Ds,{key:0,size:"sm"})):ce("",!0),_("span",null,O(e.starting?C(o)("conversation.starting"):C(o)("composer.emptyConversationTitle")),1)],2),e.starting?ce("",!0):(w(),T("span",cue,O(C(o)("composer.emptyConversation")),1)),c.value&&!e.starting?(w(),T("div",uue,[re(Xt,{text:C(o)("conversation.switchWorkspace")},{default:Ee(()=>[_("button",{type:"button",class:"ws-pick-btn",onClick:_e[8]||(_e[8]=bt(He=>r.value=!r.value,["stop"]))},[re(Ve,{name:"folder",size:"sm"}),_("span",due,O(a.value),1),re(Ve,{class:We(["ws-pick-chev",{open:r.value}]),name:"chevron-down",size:"sm"},null,8,["class"])])]),_:1},8,["text"]),r.value?(w(),T("div",{key:0,class:"ws-pick-backdrop",onClick:_e[9]||(_e[9]=He=>r.value=!1)})):ce("",!0),r.value?(w(),T("div",fue,[(w(!0),T(Pe,null,ot(u.value,He=>(w(),T("button",{key:He.id,type:"button",class:We(["ws-pick-item",{on:He.id===e.activeWorkspaceId}]),onClick:bt(Rt=>f(He.id),["stop"])},[_("span",pue,O(He.name),1),_("span",mue,O(He.shortPath),1)],10,hue))),128)),d.value>0?(w(),T("button",{key:0,type:"button",class:"ws-pick-item ws-pick-more",onClick:_e[10]||(_e[10]=bt(He=>l.value=!l.value,["stop"]))},[_("span",null,O(C(o)("conversation.moreWorkspaces",{count:d.value})),1)])):ce("",!0),_e[54]||(_e[54]=_("div",{class:"ws-pick-divider"},null,-1)),_("button",{type:"button",class:"ws-pick-action",onClick:_e[11]||(_e[11]=bt(He=>{r.value=!1,i("addWorkspace")},["stop"]))},[re(Ve,{name:"plus",size:"sm"}),_("span",null,O(C(o)("conversation.addWorkspace")),1)])])):ce("",!0)])):e.starting?ce("",!0):(w(),T("button",{key:2,type:"button",class:"empty-add-workspace",onClick:_e[12]||(_e[12]=He=>i("addWorkspace"))},[re(Ve,{name:"folder-plus",size:"sm"}),_("span",null,O(C(o)("conversation.addWorkspace")),1)]))]),re(R5,{ref_key:"emptyComposerRef",ref:p,class:"empty-composer","session-id":e.sessionId,running:e.running,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,goal:e.goal,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,starting:e.starting,"hide-context":"",onSubmit:Do,onSteer:_e[13]||(_e[13]=He=>i("steer",He)),onCommand:_e[14]||(_e[14]=He=>i("command",He)),onInterrupt:Ue,onUnqueue:_e[15]||(_e[15]=He=>i("unqueue",He)),onEditQueued:_e[16]||(_e[16]=He=>i("editQueued",He)),onSetPermission:_e[17]||(_e[17]=He=>i("setPermission",He)),onSetThinking:_e[18]||(_e[18]=He=>i("setThinking",He)),onTogglePlan:_e[19]||(_e[19]=He=>i("togglePlan")),onToggleSwarm:_e[20]||(_e[20]=He=>i("toggleSwarm")),onToggleGoal:_e[21]||(_e[21]=He=>i("toggleGoal")),onOpenBtw:_e[22]||(_e[22]=He=>i("command","/btw")),onCreateGoal:_e[23]||(_e[23]=He=>i("createGoal",He)),onControlGoal:_e[24]||(_e[24]=He=>i("controlGoal",He)),onFocusGoal:A,onCompact:_e[25]||(_e[25]=He=>i("compact")),onPickModel:_e[26]||(_e[26]=He=>i("pickModel")),onSelectModel:_e[27]||(_e[27]=He=>i("selectModel",He))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","goal","activation-badges","models","starred-ids","skills","starting"]),_e[56]||(_e[56]=_("div",{class:"empty-spacer"},null,-1))],64)):(w(),we(A5,{ref_key:"chatPaneRef",ref:h,key:e.fileReloadKey??"no-session",turns:e.turns,approvals:e.approvals,"turn-active":e.turnActive,working:e.working,"fast-moon":e.fastMoon,"session-loading":e.sessionLoading,compaction:e.compaction,"has-more-messages":e.hasMoreMessages,"loading-more":e.loadingMore,"loading-more-error":e.loadingMoreError,"is-following":j.value,"tool-diff-panel":!0,queued:e.queued,onOpenFile:_e[28]||(_e[28]=He=>i("openFile",He)),onOpenMedia:_e[29]||(_e[29]=He=>i("openMedia",He)),onCopyConversationCopied:k,onOpenThinking:_e[30]||(_e[30]=He=>i("openThinking",He)),onOpenCompaction:_e[31]||(_e[31]=He=>i("openCompaction",He)),onOpenAgent:_e[32]||(_e[32]=He=>i("openAgent",He)),onOpenToolDiff:_e[33]||(_e[33]=He=>i("openToolDiff",He)),onEditMessage:ze,onLoadOlderMessages:ns,onUnqueue:_e[34]||(_e[34]=He=>i("unqueue",He)),onEditQueued:Xe,onReorderQueue:kt},null,8,["turns","approvals","turn-active","working","fast-moon","session-loading","compaction","has-more-messages","loading-more","loading-more-error","is-following","queued"]))],2)],34),e.turns.length===0&&!e.sessionLoading?ce("",!0):(w(),we(Qce,{key:0,ref:ve,style:Yt(q.value),"session-id":e.sessionId,running:e.running,starting:e.starting,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,goal:e.goal,"goal-expand-signal":v.value,"dock-panel":N.value,"bash-tasks":$.value,"subagent-tasks":I.value,"bash-running":x.value,"subagent-running":L.value,"todo-done-count":F.value,"has-dock-work":S.value,todos:e.todos,"pending-question":ue.value,"question-busy-kind":de.value,"pending-approval":Ce.value,"approval-busy":Ie.value,mobile:e.mobile,onToggleDockPanel:_e[35]||(_e[35]=He=>B(He)),onCloseDockPanel:_e[36]||(_e[36]=He=>U()),onOpenAgent:_e[37]||(_e[37]=He=>i("openAgent",He)),onAnswer:Ht,onDismiss:_e[38]||(_e[38]=He=>i("dismiss",He)),onApproval:Rn,onCancelTask:_e[39]||(_e[39]=He=>i("cancelTask",He)),onControlGoal:_e[40]||(_e[40]=He=>i("controlGoal",He)),onSubmit:Do,onSteer:_e[41]||(_e[41]=He=>i("steer",He)),onCommand:_e[42]||(_e[42]=He=>i("command",He)),onInterrupt:Ue,onSetPermission:_e[43]||(_e[43]=He=>i("setPermission",He)),onSetThinking:_e[44]||(_e[44]=He=>i("setThinking",He)),onTogglePlan:_e[45]||(_e[45]=He=>i("togglePlan")),onToggleSwarm:_e[46]||(_e[46]=He=>i("toggleSwarm")),onToggleGoal:_e[47]||(_e[47]=He=>i("toggleGoal")),onOpenBtw:_e[48]||(_e[48]=He=>i("command","/btw")),onCreateGoal:_e[49]||(_e[49]=He=>i("createGoal",He)),onFocusGoal:A,onCompact:_e[50]||(_e[50]=He=>i("compact")),onPickModel:_e[51]||(_e[51]=He=>i("pickModel")),onSelectModel:_e[52]||(_e[52]=He=>i("selectModel",He))},null,8,["style","session-id","running","starting","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","activation-badges","models","starred-ids","skills","goal","goal-expand-signal","dock-panel","bash-tasks","subagent-tasks","bash-running","subagent-running","todo-done-count","has-dock-work","todos","pending-question","question-busy-kind","pending-approval","approval-busy","mobile"]))]),re(Il,{name:"pill"},{default:Ee(()=>[te.value?(w(),T("button",{key:0,class:"newmsg-pill",style:Yt({bottom:`${ie.value+12}px`}),"aria-label":C(o)("conversation.jumpToLatestAria"),onClick:_e[53]||(_e[53]=He=>gt(!0))},[re(Ve,{class:"pill-chevron",name:"chevron-down",size:"md"}),Je(" "+O(C(o)("conversation.newMessages")),1)],12,gue)):ce("",!0)]),_:1}),re(Il,{name:"abort-toast"},{default:Ee(()=>[zn.value?(w(),T("div",vue,[_("span",yue,O(C(o)("conversation.manuallyAborted")),1)])):ce("",!0)]),_:1})],2))}}),wue=ct(xue,[["__scopeId","data-v-0bbe2565"]]),_ue=["aria-selected","onClick"],Sue=Ze({__name:"SegmentedControl",props:{modelValue:{},options:{},size:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(o,s)=>(w(),T("div",{class:We(["ui-seg",`ui-seg--${e.size??"md"}`]),role:"tablist"},[(w(!0),T(Pe,null,ot(e.options,i=>(w(),T("button",{key:i.value,class:We(["ui-seg__item",{"is-on":i.value===e.modelValue}]),type:"button",role:"tab","aria-selected":i.value===e.modelValue,onClick:r=>n("update:modelValue",i.value)},O(i.label),11,_ue))),128))],2))}}),gs=ct(Sue,[["__scopeId","data-v-d1aaccd7"]]),Cue={class:"ui-panel-header__title"},Aue={key:0,class:"ui-panel-header__sub"},Mue=Ze({__name:"PanelHeader",props:{title:{},subtitle:{},closable:{type:Boolean,default:!0},closeLabel:{default:"Close"},wrap:{type:Boolean}},emits:["close"],setup(e){return(t,n)=>(w(),T("div",{class:We(["ui-panel-header",{wrap:e.wrap}])},[_("span",Cue,O(e.title),1),re(Xt,{text:e.subtitle},{default:Ee(()=>[e.subtitle?(w(),T("span",Aue,O(e.subtitle),1)):ce("",!0)]),_:1},8,["text"]),On(t.$slots,"default",{},void 0,!0),e.closable?(w(),we(Pn,{key:0,class:"ui-panel-header__close",size:"sm",label:e.closeLabel,onClick:n[0]||(n[0]=o=>t.$emit("close"))},{default:Ee(()=>[re(Ve,{name:"close",size:"sm"})]),_:1},8,["label"])):ce("",!0)],2))}}),$a=ct(Mue,[["__scopeId","data-v-c47879ad"]]),Eue={key:0,class:"fp-empty fp-error"},Tue={key:1,class:"fp-empty"},Nue={key:2,class:"fp-loading"},Iue={class:"fp-path"},Lue={class:"fp-meta"},$ue={key:0,class:"fp-lines"},Fue={class:"fp-size"},Oue={key:3,class:"fp-search"},Rue=["placeholder"],Bue={key:0,class:"fp-search-count"},Due=["href","aria-label"],Pue={key:1,class:"fp-code"},Hue={class:"fp-line-table"},Wue=["data-line"],zue={class:"fp-gutter"},Uue=["innerHTML"],que={key:1,class:"fp-body fp-code"},jue={class:"fp-line-table"},Vue=["data-line"],Kue={class:"fp-gutter"},Gue=["innerHTML"],Yue={key:2,class:"fp-body"},Zue=["srcdoc","title"],Que={key:1,class:"fp-code"},Xue={class:"fp-line-table"},Jue=["data-line"],ede={class:"fp-gutter"},tde=["innerHTML"],nde={key:3,class:"fp-body fp-pdf-wrap"},ode=["src","title"],sde={key:1,class:"fp-binary-card"},ide={class:"fp-binary-label"},rde={key:4,class:"fp-body fp-table-wrap"},lde={class:"fp-table"},ade=["data-line"],cde={key:5,class:"fp-body fp-image-wrap"},ude=["src","alt"],dde={key:1,class:"fp-binary-card"},fde={class:"fp-binary-icon"},hde={class:"fp-binary-label"},pde={key:6,class:"fp-body fp-code"},mde={class:"fp-line-table"},gde=["data-line"],vde={class:"fp-gutter"},yde=["innerHTML"],kde={key:7,class:"fp-body fp-binary-wrap"},bde={class:"fp-binary-card"},xde={class:"fp-binary-icon"},wde={class:"fp-binary-label"},_de=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}=Tt();function o(le,z){const ae=z?z.split("/").filter(Boolean):[];for(const ie of le.split("/"))ie===""||ie==="."||(ie===".."?ae.pop():ae.push(ie));return ae.join("/")}const s=Kt("resolveImage",async le=>le),i=R(()=>{const le=c.file?.path??"",z=le.lastIndexOf("/");return z>0?le.slice(0,z):""});function r(le){if(/^(https?:|data:|blob:)/i.test(le)||le.startsWith("/"))return le;const z=i.value;return z?o(le,z):le}async function l(le){const z=r(le);return s?s(z):z}Ln("resolveImage",l);function a(le){let z=le.path;if(/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(z)||z.startsWith("/"))return le;for(const ie of["#","?"]){const q=z.indexOf(ie);q!==-1&&(z=z.slice(0,q))}const ae=i.value;return{...le,path:o(z,ae)}}const c=e,u=t;function d(le){c.openFile?.(a(le))}const f=J(null),h=R(()=>{const le=c.file;if(!le)return"binary";const z=le.mime??"",ae=le.languageId??"",ie=le.path.toLowerCase();return z==="text/markdown"||ae==="markdown"||ae==="md"||ie.endsWith(".mdx")?"markdown":z==="application/json"||ae==="json"?"json":z==="text/html"||ae==="html"||ie.endsWith(".html")||ie.endsWith(".htm")?"html":z==="application/pdf"||ie.endsWith(".pdf")?"pdf":z==="text/csv"||ae==="csv"||ie.endsWith(".csv")?"csv":z.startsWith("image/")?"image":le.isBinary?"binary":z.startsWith("text/")||ae!==""?"text":"binary"});function p(le){const z=atob(le),ae=Uint8Array.from(z,ie=>ie.charCodeAt(0));return new TextDecoder().decode(ae)}const g=R(()=>{const le=c.file;if(!le)return"";if(le.encoding==="base64")try{return p(le.content)}catch{return le.content}return le.content}),b=R(()=>{if(h.value!=="json"||!c.file)return"";try{return JSON.stringify(JSON.parse(g.value),null,2)}catch{return g.value}}),v=R(()=>c.file?(h.value==="json"?b.value:g.value).split(`
301
+ `):[]),m=R(()=>c.file?h.value==="json"?b.value:g.value:""),y=J(""),k=J(0),A=R(()=>{const le=y.value.trim().toLowerCase();if(!le)return[];const z=[];return v.value.forEach((ae,ie)=>{ae.toLowerCase().includes(le)&&z.push(ie+1)}),z});Qe(y,()=>{k.value=0});function $(le,z=!1){le&&mt(()=>{const ae=f.value?.querySelector(".fp-body"),ie=ae?.querySelector(`[data-line="${le}"]`);if(!ae||!ie)return;z&&(ae.scrollTop=0);const q=ae.getBoundingClientRect(),ee=ie.getBoundingClientRect(),ye=ee.top-q.top+ae.scrollTop;ae.scrollTop=ye-ae.clientHeight/2+ee.height/2})}Qe(()=>[c.file?.path,c.line],()=>$(c.line,!0),{immediate:!0});function I(le){const z=A.value;z.length!==0&&(k.value=(k.value+le+z.length)%z.length,$(z[k.value]))}function x(le){const z=A.value;return{target:c.line===le,hit:z.includes(le),active:z[k.value]===le}}function L(le){return le<1024?`${le} B`:le<1024*1024?`${(le/1024).toFixed(1)} KB`:`${(le/(1024*1024)).toFixed(1)} MB`}const E=J(!1),F=J(!1);function S(){c.file&&Go(m.value).then(le=>{le&&(E.value=!0,setTimeout(()=>{E.value=!1},1400))})}function N(){c.file&&Go(c.file.path).then(le=>{le&&(F.value=!0,setTimeout(()=>{F.value=!1},1400))})}const D=J("preview"),B=J("preview"),U=J("fit");function H(le){D.value=le}function P(le){B.value=le}function Z(le){U.value=le}Qe(h,le=>{D.value=le==="html"?"preview":"source",B.value="preview",U.value="fit"});const K=R(()=>{const le=c.file;return!le||h.value!=="image"?null:le.sourceUrl?le.sourceUrl:le.encoding==="base64"?`data:${le.mime};base64,${le.content}`:le.mime==="image/svg+xml"?`data:${le.mime};charset=utf-8,${encodeURIComponent(le.content)}`:null}),V=R(()=>{const le=c.file;return!le||h.value!=="pdf"?null:c.downloadUrl?c.downloadUrl:le.encoding==="base64"?`data:${le.mime};base64,${le.content}`:null}),X=R(()=>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 he(le){const z=[];let ae="",ie=!1;for(let q=0;q<le.length;q++){const ee=le[q];ee==='"'&&le[q+1]==='"'?(ae+='"',q++):ee==='"'?ie=!ie:ee===","&&!ie?(z.push(ae),ae=""):ae+=ee}return z.push(ae),z}const ne=R(()=>v.value.slice(0,200).map(he));function ue(le){return le.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;")}function de(){const le=c.file;if(!le)return"";const z=le.languageId?.toLowerCase();return z||(le.path.split(".").pop()?.toLowerCase()??"")}function Ce(le){const z=de();let ae=ue(le);return h.value==="json"||z==="json"||z==="jsonc"?(ae=ae.replace(/(&quot;[^&]*?&quot;)(\s*:)/g,'<span class="tok-key">$1</span>$2'),ae=ae.replace(/(:\s*)(&quot;[^&]*?&quot;)/g,'$1<span class="tok-string">$2</span>'),ae=ae.replace(/\b(true|false|null)\b/g,'<span class="tok-literal">$1</span>'),ae=ae.replace(/(:\s*)(-?\d+(?:\.\d+)?)/g,'$1<span class="tok-number">$2</span>'),ae):h.value==="html"||z==="html"||z==="xml"||z==="svg"?(ae=ae.replace(/\s([A-Za-z_:][-A-Za-z0-9_:.]*)(=)/g,' <span class="tok-attr">$1</span>$2'),ae=ae.replace(/(&quot;.*?&quot;)/g,'<span class="tok-string">$1</span>'),ae=ae.replace(/(&lt;\/?)([A-Za-z][\w:-]*)/g,'$1<span class="tok-tag">$2</span>'),ae):(ae=ae.replace(/\b(async|await|break|case|catch|class|const|continue|else|export|extends|finally|for|from|function|if|import|interface|let|new|return|switch|throw|try|type|while)\b/g,'<span class="tok-keyword">$1</span>'),ae=ae.replace(/(&quot;.*?&quot;|'.*?')/g,'<span class="tok-string">$1</span>'),ae=ae.replace(/(\/\/.*)$/g,'<span class="tok-comment">$1</span>'),ae)}function Ie(le,z=55){return!le||le.length<=z?le:"…"+le.slice(le.length-z+1)}return(le,z)=>(w(),T("div",{ref_key:"rootRef",ref:f,class:"file-preview"},[e.error&&!e.loading?(w(),T("div",Eue,[_("span",null,O(e.error),1),e.closable?(w(),we(Bt,{key:0,variant:"secondary",size:"sm",onClick:z[0]||(z[0]=ae=>u("close"))},{default:Ee(()=>[Je(O(C(n)("filePreview.close")),1)]),_:1})):ce("",!0)])):!e.file&&!e.loading?(w(),T("div",Tue,O(C(n)("filePreview.empty")),1)):e.loading?(w(),T("div",Nue,[z[7]||(z[7]=_("span",{class:"spinner"},null,-1)),_("span",null,O(C(n)("filePreview.loading")),1)])):e.file?(w(),T(Pe,{key:3},[re($a,{wrap:"",title:C(n)("common.preview"),closable:e.closable,"close-label":C(n)("filePreview.close"),onClose:z[6]||(z[6]=ae=>u("close"))},{default:Ee(()=>[re(Xt,{text:e.file.path},{default:Ee(()=>[_("span",Iue,O(Ie(e.file.path)),1)]),_:1},8,["text"]),_("span",Lue,[e.file.lineCount?(w(),T("span",$ue,O(C(n)("filePreview.lineCount",{count:e.file.lineCount})),1)):ce("",!0),_("span",Fue,O(L(e.file.size)),1)]),h.value==="html"?(w(),we(gs,{key:0,"model-value":D.value,size:"sm",options:[{value:"preview",label:C(n)("filePreview.preview")},{value:"source",label:C(n)("filePreview.source")}],"onUpdate:modelValue":H},null,8,["model-value","options"])):ce("",!0),h.value==="markdown"?(w(),we(gs,{key:1,"model-value":B.value,size:"sm",options:[{value:"preview",label:C(n)("filePreview.preview")},{value:"source",label:C(n)("filePreview.source")}],"onUpdate:modelValue":P},null,8,["model-value","options"])):ce("",!0),h.value==="image"?(w(),we(gs,{key:2,"model-value":U.value,size:"sm",options:[{value:"fit",label:C(n)("filePreview.fit")},{value:"actual",label:C(n)("filePreview.actual")}],"onUpdate:modelValue":Z},null,8,["model-value","options"])):ce("",!0),h.value==="text"||h.value==="json"||h.value==="html"||h.value==="csv"?(w(),T("div",Oue,[Fn(_("input",{"onUpdate:modelValue":z[1]||(z[1]=ae=>y.value=ae),class:"fp-search-input",type:"search",placeholder:C(n)("filePreview.search")},null,8,Rue),[[_s,y.value]]),y.value.trim()?(w(),T("span",Bue,O(A.value.length),1)):ce("",!0),re(Pn,{size:"sm",disabled:A.value.length===0,label:C(n)("filePreview.prevMatch"),onClick:z[2]||(z[2]=ae=>I(-1))},{default:Ee(()=>[re(Ve,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),re(Pn,{size:"sm",disabled:A.value.length===0,label:C(n)("filePreview.nextMatch"),onClick:z[3]||(z[3]=ae=>I(1))},{default:Ee(()=>[re(Ve,{name:"arrow-down",size:"md"})]),_:1},8,["disabled","label"])])):ce("",!0),re(Pn,{size:"sm",class:We({copied:F.value}),label:F.value?C(n)("filePreview.copied"):C(n)("filePreview.copyPath"),onClick:N},{default:Ee(()=>[F.value?(w(),we(Ve,{key:1,class:"fp-check",name:"check",size:"md"})):(w(),we(Ve,{key:0,name:"link",size:"md"}))]),_:1},8,["class","label"]),e.externalActions?(w(),we(Pn,{key:4,size:"sm",label:C(n)("filePreview.openInEditor"),onClick:z[4]||(z[4]=ae=>u("openExternal"))},{default:Ee(()=>[re(Ve,{name:"external-link",size:"md"})]),_:1},8,["label"])):ce("",!0),e.externalActions?(w(),we(Pn,{key:5,size:"sm",label:C(n)("filePreview.reveal"),onClick:z[5]||(z[5]=ae=>u("reveal"))},{default:Ee(()=>[re(Ve,{name:"folder",size:"md"})]),_:1},8,["label"])):ce("",!0),e.downloadUrl?(w(),T("a",{key:6,class:"fp-download",href:e.downloadUrl,target:"_blank",rel:"noreferrer",download:"","aria-label":C(n)("filePreview.download")},[re(Ve,{name:"download",size:"md"})],8,Due)):ce("",!0),!e.file.isBinary&&h.value!=="image"?(w(),we(Pn,{key:7,size:"sm",class:We({copied:E.value}),label:E.value?C(n)("filePreview.copied"):C(n)("filePreview.copy"),onClick:S},{default:Ee(()=>[E.value?(w(),we(Ve,{key:1,class:"fp-check",name:"check",size:"md"})):(w(),we(Ve,{key:0,name:"copy",size:"md"}))]),_:1},8,["class","label"])):ce("",!0)]),_:1},8,["title","closable","close-label"]),h.value==="markdown"?(w(),T("div",{key:0,class:We(["fp-body",{"fp-markdown":B.value==="preview"}])},[B.value==="preview"?(w(),we(Wm,{key:0,text:g.value,"open-file":c.openFile?d:void 0},null,8,["text","open-file"])):(w(),T("div",Pue,[_("div",Hue,[(w(!0),T(Pe,null,ot(v.value,(ae,ie)=>(w(),T("div",{key:ie,class:We(["fp-line-row",x(ie+1)]),"data-line":ie+1},[_("span",zue,O(ie+1),1),_("span",{class:"fp-line-text",innerHTML:Ce(ae)},null,8,Uue)],10,Wue))),128))])]))],2)):h.value==="json"?(w(),T("div",que,[_("div",jue,[(w(!0),T(Pe,null,ot(v.value,(ae,ie)=>(w(),T("div",{key:ie,class:We(["fp-line-row",x(ie+1)]),"data-line":ie+1},[_("span",Kue,O(ie+1),1),_("span",{class:"fp-line-text",innerHTML:Ce(ae)},null,8,Gue)],10,Vue))),128))])])):h.value==="html"?(w(),T("div",Yue,[D.value==="preview"?(w(),T("iframe",{key:0,class:"fp-html-frame",sandbox:"",srcdoc:X.value,title:e.file.path},null,8,Zue)):(w(),T("div",Que,[_("div",Xue,[(w(!0),T(Pe,null,ot(v.value,(ae,ie)=>(w(),T("div",{key:ie,class:We(["fp-line-row",x(ie+1)]),"data-line":ie+1},[_("span",ede,O(ie+1),1),_("span",{class:"fp-line-text",innerHTML:Ce(ae)},null,8,tde)],10,Jue))),128))])]))])):h.value==="pdf"?(w(),T("div",nde,[V.value?(w(),T("iframe",{key:0,class:"fp-pdf-frame",src:V.value,title:e.file.path},null,8,ode)):(w(),T("div",sde,[_("span",ide,O(C(n)("filePreview.pdfNoPreview")),1)]))])):h.value==="csv"?(w(),T("div",rde,[_("table",lde,[_("tbody",null,[(w(!0),T(Pe,null,ot(ne.value,(ae,ie)=>(w(),T("tr",{key:ie,class:We(x(ie+1)),"data-line":ie+1},[_("th",null,O(ie+1),1),(w(!0),T(Pe,null,ot(ae,(q,ee)=>(w(),T("td",{key:ee},O(q),1))),128))],10,ade))),128))])])])):h.value==="image"?(w(),T("div",cde,[K.value?(w(),T("img",{key:0,src:K.value,alt:e.file.path,class:We(["fp-image",{actual:U.value==="actual"}])},null,10,ude)):(w(),T("div",dde,[_("span",fde,[re(Ve,{name:"image-off",size:"lg"})]),_("span",hde,O(C(n)("filePreview.imageNoPreview",{mime:e.file.mime,size:L(e.file.size)})),1)]))])):h.value==="text"?(w(),T("div",pde,[_("div",mde,[(w(!0),T(Pe,null,ot(v.value,(ae,ie)=>(w(),T("div",{key:ie,class:We(["fp-line-row",x(ie+1)]),"data-line":ie+1},[_("span",vde,O(ie+1),1),_("span",{class:"fp-line-text",innerHTML:Ce(ae)},null,8,yde)],10,gde))),128))])])):(w(),T("div",kde,[_("div",bde,[_("span",xde,[re(Ve,{name:"file-off",size:"lg"})]),_("span",wde,O(C(n)("filePreview.binaryNoPreview",{mime:e.file.mime||C(n)("filePreview.unknownType"),size:L(e.file.size)})),1)])]))],64)):ce("",!0)],512))}}),Sde=ct(_de,[["__scopeId","data-v-62bfaf2d"]]),Cde={class:"tp"},Ade=Ze({__name:"ThinkingPanel",props:{text:{},subtitle:{}},emits:["close"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Tt(),i=J(null);return Qe(()=>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)=>(w(),T("div",Cde,[re($a,{title:C(s)("common.preview"),subtitle:e.subtitle??C(s)("thinking.panelTitle"),"close-label":C(s)("thinking.close"),onClose:l[0]||(l[0]=a=>o("close"))},null,8,["title","subtitle","close-label"]),_("pre",{ref_key:"bodyEl",ref:i,class:"tp-body"},O(e.text),513)]))}}),VC=ct(Ade,[["__scopeId","data-v-cf9c560b"]]),Mde={class:"ap"},Ede={key:0,class:"ap-type"},Tde={key:1,class:"ap-reason"},Nde={key:2,class:"ap-field"},Ide={class:"ap-field-body"},Lde={key:3,class:"ap-field"},$de={class:"ap-field-body ap-live"},Fde={key:4,class:"ap-field"},Ode={class:"ap-field-body ap-progress"},Rde={key:0,class:"ap-call"},Bde={key:1,class:"ap-output"},Dde=["onClick"],Pde={key:5,class:"ap-field"},Hde={class:"ap-field-body"},Wde=8,KC=5,GC=2,zde=Ze({__name:"AgentDetailPanel",props:{member:{}},emits:["close"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Tt(),i=R(()=>(n.member.outputLines??[]).map(g=>g.trimEnd()).filter(g=>g.length>0)),r=R(()=>(n.member.text??"").trimEnd());function l(g){const b=[];let v=null,m=0;for(const y of g)y.startsWith("Calling ")?(v={key:`g${m++}`,call:y,output:[]},b.push(v)):v?v.output.push(y):(v={key:`g${m++}`,call:"",output:[y]},b.push(v));return b}const a=R(()=>l(i.value)),c=J(new Set);function u(g){return c.value.has(g)}function d(g){const b=new Set(c.value);b.has(g)?b.delete(g):b.add(g),c.value=b}function f(g){return g.output.length-KC-GC}function h(g){switch(g){case"queued":return"Queued";case"working":return"Working";case"suspended":return"Suspended";case"completed":return"Completed";case"failed":return"Failed"}}const p=J(null);return Qe(()=>i.value.length+r.value.length,()=>{const g=p.value;!g||!(g.scrollHeight-g.scrollTop-g.clientHeight<24)||mt(()=>{p.value&&(p.value.scrollTop=p.value.scrollHeight)})},{immediate:!0}),(g,b)=>(w(),T("div",Mde,[re($a,{title:C(s)("common.preview"),subtitle:e.member.name,"close-label":C(s)("thinking.close"),onClose:b[0]||(b[0]=v=>o("close"))},{default:Ee(()=>[re(Ri,{variant:"neutral",size:"sm",class:"ap-phase"},{default:Ee(()=>[Je(O(h(e.member.phase)),1)]),_:1})]),_:1},8,["title","subtitle","close-label"]),_("div",{ref_key:"bodyEl",ref:p,class:"ap-body"},[e.member.subagentType?(w(),T("div",Ede,O(e.member.subagentType),1)):ce("",!0),e.member.suspendedReason?(w(),T("div",Tde,O(e.member.suspendedReason),1)):ce("",!0),e.member.prompt?(w(),T("div",Nde,[b[1]||(b[1]=_("span",{class:"ap-field-label"},"Task",-1)),_("div",Ide,O(e.member.prompt),1)])):ce("",!0),r.value?(w(),T("div",Lde,[b[2]||(b[2]=_("span",{class:"ap-field-label"},"Output",-1)),_("div",$de,O(r.value),1)])):ce("",!0),a.value.length>0?(w(),T("div",Fde,[b[4]||(b[4]=_("span",{class:"ap-field-label"},"Progress",-1)),_("div",Ode,[(w(!0),T(Pe,null,ot(a.value,v=>(w(),T("div",{key:v.key,class:"ap-group"},[v.call?(w(),T("div",Rde,[b[3]||(b[3]=_("span",{class:"ap-glyph","aria-hidden":"true"},"▶",-1)),Je(" "+O(v.call),1)])):ce("",!0),v.output.length>0?(w(),T("div",Bde,[v.output.length<=Wde||u(v.key)?(w(!0),T(Pe,{key:0},ot(v.output,(m,y)=>(w(),T("div",{key:y,class:"ap-out-line"},O(m),1))),128)):(w(),T(Pe,{key:1},[(w(!0),T(Pe,null,ot(v.output.slice(0,KC),(m,y)=>(w(),T("div",{key:y,class:"ap-out-line"},O(m),1))),128)),_("button",{type:"button",class:"ap-fold",onClick:m=>d(v.key)}," … ("+O(f(v))+" more) ",9,Dde),(w(!0),T(Pe,null,ot(v.output.slice(-GC),(m,y)=>(w(),T("div",{key:"t"+y,class:"ap-out-line"},O(m),1))),128))],64))])):ce("",!0)]))),128))])])):ce("",!0),e.member.summary?(w(),T("div",Pde,[b[5]||(b[5]=_("span",{class:"ap-field-label"},"Result",-1)),_("div",Hde,O(e.member.summary),1)])):ce("",!0)],512)]))}}),Ude=ct(zde,[["__scopeId","data-v-715bd93e"]]),qde={class:"diff-lines"},jde={key:0,class:"hunk-text"},Vde={class:"dl-gutter old"},Kde={class:"dl-gutter new"},Gde={class:"dl-sign"},Yde={class:"dl-text"},Zde=Ze({__name:"DiffLines",props:{lines:{}},setup(e){function t(s){return s.oldNo!==void 0?String(s.oldNo):""}function n(s){return s.newNo!==void 0?String(s.newNo):""}function o(s){return`dl-${s.type}`}return(s,i)=>(w(),T("div",qde,[(w(!0),T(Pe,null,ot(e.lines,(r,l)=>(w(),T("div",{key:l,class:We(["dl",o(r)])},[r.type==="hunk"?(w(),T("span",jde,O(r.text),1)):(w(),T(Pe,{key:1},[_("span",Vde,O(t(r)),1),_("span",Kde,O(n(r)),1),_("span",Gde,O(r.type==="add"?"+":r.type==="del"?"-":" "),1),_("span",Yde,O(r.text),1)],64))],2))),128))]))}}),D5=ct(Zde,[["__scopeId","data-v-2f6bc1cc"]]),Qde={class:"tdp"},Xde={class:"tdp-body"},Jde={key:1,class:"tdp-output"},efe={key:2,class:"tdp-empty"},tfe=Ze({__name:"ToolDiffPanel",props:{target:{}},emits:["close"],setup(e,{emit:t}){const n=t,{t:o}=Tt();return(s,i)=>(w(),T("div",Qde,[re($a,{title:e.target.title,subtitle:e.target.path,"close-label":C(o)("thinking.close"),onClose:i[0]||(i[0]=r=>n("close"))},null,8,["title","subtitle","close-label"]),_("div",Xde,[e.target.lines&&e.target.lines.length>0?(w(),we(D5,{key:0,lines:e.target.lines},null,8,["lines"])):e.target.output&&e.target.output.length>0?(w(),T("div",Jde,[(w(!0),T(Pe,null,ot(e.target.output,(r,l)=>(w(),T("div",{key:l},O(r),1))),128))])):(w(),T("div",efe,O(C(o)("diff.noDiff")),1))])]))}}),nfe=ct(tfe,[["__scopeId","data-v-76f2fbca"]]),ofe={class:"sc"},sfe={key:0,class:"sc-empty"},ife={key:2,class:"sc-loading","aria-hidden":"true"},rfe={class:"sc-composer"},lfe=["placeholder"],afe=["disabled"],cfe=Ze({__name:"SideChatPanel",props:{turns:{},running:{type:Boolean},sending:{type:Boolean},title:{},subtitle:{}},emits:["send","close"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Tt(),i=R(()=>n.turns.find(m=>m.role==="user")?.text?.trim()??""),r=R(()=>n.title?.trim()||s("sideChat.title")),l=R(()=>n.subtitle?.trim()?n.subtitle.trim():i.value||s("sideChat.subtitle")),a=J(""),c=J(null),u=J(null);function d(){const v=a.value.trim();v&&(o("send",v),a.value="",mt(()=>{c.value&&(c.value.style.height="auto"),f()}))}function f(){const v=u.value;v&&(v.scrollTop=v.scrollHeight)}const h=R(()=>{const v=n.turns;if(v.length===0)return"0";const m=v.at(-1),y=m.thinking?.length??0,k=m.tools?.reduce((A,$)=>A+$.name.length+($.arg?.length??0)+($.output?.join("").length??0),0)??0;return`${v.length}:${m.text.length}:${y}:${k}`});Qe(h,async()=>{!n.running&&!n.sending||(await mt(),f())});const p=R(()=>n.sending?n.turns.at(-1)?.role==="user":!1);function g(v){v.key==="Enter"&&!v.shiftKey&&!v.isComposing&&(v.preventDefault(),d())}function b(){const v=c.value;v&&(v.style.height="auto",v.style.height=`${Math.min(v.scrollHeight,160)}px`)}return(v,m)=>(w(),T("div",ofe,[re($a,{title:r.value,subtitle:l.value,"close-label":C(s)("thinking.close"),onClose:m[0]||(m[0]=y=>o("close"))},null,8,["title","subtitle","close-label"]),_("div",{ref_key:"bodyRef",ref:u,class:"sc-body"},[e.turns.length===0?(w(),T("div",sfe,O(C(s)("sideChat.empty")),1)):(w(),we(A5,{key:1,turns:e.turns,approvals:[],"turn-active":e.running,working:e.sending||e.running},null,8,["turns","turn-active","working"])),p.value?(w(),T("div",ife,[re(S5)])):ce("",!0)],512),_("div",rfe,[Fn(_("textarea",{ref_key:"inputRef",ref:c,"onUpdate:modelValue":m[1]||(m[1]=y=>a.value=y),class:"sc-input",rows:"1",placeholder:C(s)("sideChat.placeholder"),onInput:b,onKeydown:g},null,40,lfe),[[_s,a.value]]),re(Xt,{text:C(s)("sideChat.send")},{default:Ee(()=>[_("button",{type:"button",class:"sc-send",disabled:!a.value.trim(),onClick:d},[re(Ve,{name:"arrow-right",size:"sm"})],8,afe)]),_:1},8,["text"])])]))}}),ufe=ct(cfe,[["__scopeId","data-v-f973798f"]]),dfe={class:"changes-pane"},ffe={class:"dv-path"},hfe={class:"diff-head"},pfe={class:"back-label"},mfe={key:0,class:"empty-state"},gfe={key:1,class:"dv-lines-wrap"},vfe={key:2,class:"empty-state"},yfe={class:"dv-change-count"},kfe={class:"ch-head"},bfe={class:"br-label"},xfe={class:"br-name"},wfe={key:0,class:"sync-info"},_fe={key:0,class:"ahead"},Sfe={key:0,class:"behind"},Cfe={key:1,class:"empty-head"},Afe={key:0,class:"ch-list"},Mfe=["onClick"],Efe={class:"fpath"},Tfe={key:1,class:"ch-list ch-tree"},Nfe={class:"tree-list"},Ife=["onClick"],Lfe={class:"tree-name"},$fe=["onClick"],Ffe={class:"tree-name"},Ofe={key:2,class:"empty-state"},Rfe={key:3,class:"empty-state"},Bfe=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}=Tt(),o=e,s=t;function i(F){const S=F.toLowerCase();return S==="modified"?"modified":S==="added"?"added":S==="deleted"?"deleted":S==="renamed"?"renamed":S==="untracked"?"untracked":S==="conflicted"?"conflicted":S==="ignored"?"ignored":S==="clean"?"clean":"unknown"}const r={modified:"M",added:"A",deleted:"D",renamed:"R",untracked:"U",conflicted:"C",ignored:"I",clean:"·",unknown:"?"};function l(F){return r[i(F)]??"?"}function a(F,S=60){return F.length<=S?F:"…"+F.slice(F.length-S+1)}const c=R(()=>o.gitInfo!==null),u=R(()=>o.changes.length>0),d=R(()=>(o.selectedDiffPath??null)!==null),f=R(()=>o.mode==="detail"||o.mode==="full"&&d.value),h=R(()=>o.fileDiff??[]),p=R(()=>o.fileDiffLoading===!0);function g(F){s("open",F)}function b(){s("back")}function v(){s("close")}const m=J("list");function y(F){m.value=F}function k(F){const S={children:[]},N=[...F].sort((D,B)=>D.path.localeCompare(B.path));for(const D of N){const B=D.path.split("/");let U=S;for(let H=0;H<B.length;H++){const P=B[H],Z=H===B.length-1,K=B.slice(0,H+1).join("/");let V=U.children.find(X=>X.name===P&&X.kind===(Z?"file":"folder"));V||(V={name:P,path:K,kind:Z?"file":"folder",status:Z?D.status:void 0,children:[]},U.children.push(V)),U=V}}return S.children}const A=R(()=>k(o.changes)),$=J(new Set);function I(F){return!$.value.has(F)}const x=R(()=>{const F=[];function S(N,D){for(const B of N)F.push({node:B,depth:D}),B.kind==="folder"&&I(B.path)&&S(B.children,D+1)}return S(A.value,0),F});function L(F){const S=new Set($.value);S.has(F.path)?S.delete(F.path):S.add(F.path),$.value=S}function E(F){return`${16+F*16}px`}return(F,S)=>(w(),T("div",dfe,[f.value?(w(),T(Pe,{key:0},[re($a,{title:C(n)("diff.title"),closable:e.closable,"close-label":C(n)("diff.close"),onClose:v},{default:Ee(()=>[re(Xt,{text:e.selectedDiffPath??""},{default:Ee(()=>[_("span",ffe,O(a(e.selectedDiffPath??"",50)),1)]),_:1},8,["text"])]),_:1},8,["title","closable","close-label"]),_("div",hfe,[e.hideBack?ce("",!0):(w(),we(Bt,{key:0,variant:"ghost",size:"sm",onClick:b},{default:Ee(()=>[S[0]||(S[0]=_("span",{"aria-hidden":"true"},"←",-1)),_("span",pfe,O(C(n)("diff.back")),1)]),_:1}))]),p.value?(w(),T("div",mfe,O(C(n)("diff.loading")),1)):h.value.length>0?(w(),T("div",gfe,[re(D5,{lines:h.value},null,8,["lines"])])):(w(),T("div",vfe,O(C(n)("diff.noDiff")),1))],64)):(w(),T(Pe,{key:1},[re($a,{title:C(n)("diff.title"),closable:e.closable,"close-label":C(n)("diff.close"),onClose:v},{default:Ee(()=>[_("span",yfe,O(C(n)("diff.changeCount",{count:e.changes.length})),1),re(gs,{"model-value":m.value,size:"sm",options:[{value:"list",label:C(n)("diff.list")},{value:"tree",label:C(n)("diff.tree")}],"onUpdate:modelValue":y},null,8,["model-value","options"])]),_:1},8,["title","closable","close-label"]),_("div",kfe,[c.value?(w(),T(Pe,{key:0},[_("span",bfe,O(C(n)("diff.branch")),1),_("span",xfe,O(e.gitInfo.branch),1),e.gitInfo.ahead>0||e.gitInfo.behind>0?(w(),T("span",wfe,[re(Xt,{text:C(n)("diff.aheadTitle")},{default:Ee(()=>[e.gitInfo.ahead>0?(w(),T("span",_fe,"↑"+O(e.gitInfo.ahead),1)):ce("",!0)]),_:1},8,["text"]),re(Xt,{text:C(n)("diff.behindTitle")},{default:Ee(()=>[e.gitInfo.behind>0?(w(),T("span",Sfe,"↓"+O(e.gitInfo.behind),1)):ce("",!0)]),_:1},8,["text"])])):ce("",!0)],64)):(w(),T("span",Cfe,O(C(n)("diff.empty")),1))]),u.value&&m.value==="list"?(w(),T("div",Afe,[(w(!0),T(Pe,null,ot(e.changes,N=>(w(),we(Xt,{key:N.path,text:N.path},{default:Ee(()=>[_("button",{type:"button",class:"ch-row",onClick:D=>g(N.path)},[_("span",{class:We(["badge",i(N.status)])},O(l(N.status)),3),_("span",Efe,O(a(N.path)),1)],8,Mfe)]),_:2},1032,["text"]))),128))])):u.value&&m.value==="tree"?(w(),T("div",Tfe,[_("ul",Nfe,[(w(!0),T(Pe,null,ot(x.value,({node:N,depth:D})=>(w(),T("li",{key:N.path,class:"tree-node"},[N.kind==="folder"?(w(),T("button",{key:0,type:"button",class:"tree-row tree-folder",style:Yt({paddingLeft:E(D)}),onClick:B=>L(N)},[re(Ve,{class:"tree-icon",name:"folder-solid",size:"sm"}),_("span",Lfe,O(N.name),1)],12,Ife)):(w(),we(Xt,{key:1,text:N.path},{default:Ee(()=>[_("button",{type:"button",class:"tree-row tree-file",style:Yt({paddingLeft:E(D)}),onClick:B=>g(N.path)},[_("span",{class:We(["badge",i(N.status)])},O(l(N.status)),3),_("span",Ffe,O(N.name),1)],12,$fe)]),_:2},1032,["text"]))]))),128))])])):c.value?(w(),T("div",Ofe,O(C(n)("diff.clean")),1)):(w(),T("div",Rfe,O(C(n)("diff.empty")),1))],64))]))}}),Dfe=ct(Bfe,[["__scopeId","data-v-7778610a"]]);function jk(e,t){let n=null;cn(()=>{n=typeof document<"u"&&document.activeElement instanceof HTMLElement?document.activeElement:null,mt(()=>{const o=t?.value??e.value;try{o?.focus()}catch{}})}),po(()=>{const o=n;if(n=null,!(!o||typeof document>"u"||!document.contains(o)))try{o.focus()}catch{}})}const Pfe=["type","value","placeholder","disabled","readonly"],Hfe=Ze({__name:"Input",props:{modelValue:{},size:{default:"md"},type:{default:"text"},placeholder:{},disabled:{type:Boolean},readonly:{type:Boolean},error:{type:Boolean}},emits:["update:modelValue","focus","blur"],setup(e,{expose:t,emit:n}){const o=n,s=J();function i(a){o("update:modelValue",a.target.value)}function r(){s.value?.focus()}function l(){s.value?.select()}return t({focus:r,select:l,el:s}),(a,c)=>(w(),T("input",{ref_key:"el",ref:s,class:We(["ui-input",[`ui-input--${e.size}`,{"has-error":e.error}]]),type:e.type,value:e.modelValue,placeholder:e.placeholder,disabled:e.disabled,readonly:e.readonly,onInput:i,onFocus:c[0]||(c[0]=u=>a.$emit("focus",u)),onBlur:c[1]||(c[1]=u=>a.$emit("blur",u))},null,42,Pfe))}}),Kc=ct(Hfe,[["__scopeId","data-v-340f0da2"]]),Wfe={class:"search-wrap"},zfe={key:0,class:"tab-strip"},Ufe={key:1,class:"state-row"},qfe={key:2,class:"state-row unavail"},jfe={key:3,class:"model-list"},Vfe=["aria-selected","onClick","onMouseenter"],Kfe={class:"check"},Gfe={class:"model-main"},Yfe={class:"model-name"},Zfe={class:"model-id"},Qfe={key:0,class:"caps"},Xfe={class:"model-provider"},Jfe={class:"model-ctx"},ehe={key:0,class:"empty"},the={class:"footer-hint"},nhe=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}=Tt(),o=e,s=t,i=R(()=>new Set(o.starredIds??[]));function r(y){return i.value.has(y)}const l=J(""),a=J(null),c=J(null),u=J("all");jk(c,a);const d=R(()=>{const y=new Set,k=[{id:"all",label:n("model.allTab")}];for(const A of o.models)y.has(A.provider)||(y.add(A.provider),k.push({id:A.provider,label:A.provider}));return k}),f=R(()=>{const y=l.value.toLowerCase().trim(),k=o.models.filter(A=>{if(u.value!=="all"&&A.provider!==u.value)return!1;const $=(A.displayName??A.model).toLowerCase().includes(y),I=A.provider.toLowerCase().includes(y),x=A.id.toLowerCase().includes(y);return!y||$||I||x});return u.value!=="all"?k:k.sort((A,$)=>{const I=r(A.id)?1:0;return(r($.id)?1:0)-I})}),h=R(()=>f.value),p=J(0);Qe([l,u],()=>{p.value=0}),Qe(d,y=>{y.some(k=>k.id===u.value)||(u.value="all")}),Qe(h,y=>{p.value=Math.min(p.value,Math.max(y.length-1,0))});function g(y){if(y.key==="Escape"){s("close");return}if(y.key==="ArrowDown")y.preventDefault(),p.value=Math.min(p.value+1,h.value.length-1);else if(y.key==="ArrowUp")y.preventDefault(),p.value=Math.max(p.value-1,0);else if(y.key==="Enter"){const k=h.value[p.value];k&&s("select",k.id)}}cn(()=>{document.addEventListener("keydown",g)}),bn(()=>{document.removeEventListener("keydown",g)});function b(y){s("select",y)}function v(y){return h.value.indexOf(y)}function m(y){u.value=y}return(y,k)=>(w(),we(qr,{open:!0,"close-on-esc":!1,title:C(n)("model.title"),size:"xl",height:"fixed",onClose:k[1]||(k[1]=A=>s("close"))},{default:Ee(()=>[_("div",{ref_key:"dialogRef",ref:c,class:"mp"},[_("div",Wfe,[re(Kc,{ref_key:"searchRef",ref:a,modelValue:l.value,"onUpdate:modelValue":k[0]||(k[0]=A=>l.value=A),placeholder:C(n)("model.searchPlaceholder"),autocomplete:"off",spellcheck:"false",autofocus:""},null,8,["modelValue","placeholder"])]),d.value.length>1?(w(),T("div",zfe,[(w(!0),T(Pe,null,ot(d.value,A=>(w(),we(Bt,{key:A.id,variant:A.id===u.value?"secondary":"ghost",size:"sm",onClick:$=>m(A.id)},{default:Ee(()=>[Je(O(A.label),1)]),_:2},1032,["variant","onClick"]))),128))])):ce("",!0),e.loading?(w(),T("div",Ufe,[re(Ds,{size:"sm"}),_("span",null,O(C(n)("model.loading")),1)])):e.unavailable?(w(),T("div",qfe,[re(Ve,{name:"alert-triangle",size:"lg"}),_("span",null,O(C(n)("model.unavailable")),1)])):(w(),T("div",jfe,[(w(!0),T(Pe,null,ot(h.value,A=>(w(),T("div",{key:A.id,class:We(["model-row",{"is-current":A.id===e.current,"is-selected":v(A)===p.value}]),role:"option","aria-selected":A.id===e.current,onClick:$=>b(A.id),onMouseenter:$=>p.value=v(A)},[_("span",Kfe,[A.id===e.current?(w(),we(Ve,{key:0,name:"check",size:"sm"})):ce("",!0)]),_("span",Gfe,[_("span",Yfe,O(A.displayName??A.model),1),_("span",Zfe,O(A.id),1),A.capabilities&&A.capabilities.length>0?(w(),T("span",Qfe,[(w(!0),T(Pe,null,ot(A.capabilities,$=>(w(),we(Ri,{key:$,variant:"info",size:"sm"},{default:Ee(()=>[Je(O($),1)]),_:2},1024))),128))])):ce("",!0)]),_("span",Xfe,O(A.provider),1),_("span",Jfe,O(C(n)("model.contextSuffix",{size:C(ir)(A.maxContextSize)})),1),re(Pn,{size:"sm",label:r(A.id)?C(n)("model.unstarTitle"):C(n)("model.starTitle"),onClick:bt($=>s("toggle-star",A.id),["stop"])},{default:Ee(()=>[r(A.id)?(w(),we(Ve,{key:0,name:"star",size:"md"})):(w(),we(Ve,{key:1,name:"star-outline",size:"md"}))]),_:2},1032,["label","onClick"])],42,Vfe))),128)),h.value.length===0&&!e.loading&&!e.unavailable?(w(),T("div",ehe,O(o.models.length===0?C(n)("model.emptyNoModels"):C(n)("model.emptyNoMatch")),1)):ce("",!0)])),_("div",the,O(C(n)("model.footerHint")),1)],512)]),_:1},8,["title"]))}}),ohe=ct(nhe,[["__scopeId","data-v-56cefe51"]]),she={key:0,class:"ui-field__label"},ihe={key:1,class:"ui-field__error"},rhe={key:2,class:"ui-field__hint"},lhe=Ze({__name:"Field",props:{label:{},hint:{},error:{}},setup(e){return(t,n)=>(w(),T("div",{class:We(["ui-field",{"has-error":!!e.error}])},[e.label?(w(),T("label",she,O(e.label),1)):ce("",!0),On(t.$slots,"default",{},void 0,!0),e.error?(w(),T("span",ihe,O(e.error),1)):e.hint?(w(),T("span",rhe,O(e.hint),1)):ce("",!0)],2))}}),fh=ct(lhe,[["__scopeId","data-v-49bce958"]]),ahe=["value","disabled"],che=Ze({__name:"Select",props:{modelValue:{},size:{default:"md"},disabled:{type:Boolean},error:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;function o(s){n("update:modelValue",s.target.value)}return(s,i)=>(w(),T("select",{class:We(["ui-select",[`ui-select--${e.size}`,{"has-error":e.error}]]),value:e.modelValue,disabled:e.disabled,onChange:o},[On(s.$slots,"default",{},void 0,!0)],42,ahe))}}),Yv=ct(che,[["__scopeId","data-v-92a040fd"]]),uhe={class:"prov-list"},dhe={key:0,class:"state-row"},fhe={key:1,class:"state-row unavail"},hhe={key:2,class:"empty"},phe={class:"prov-info"},mhe={class:"prov-type"},ghe={key:0,class:"prov-url"},vhe={class:"prov-meta"},yhe={key:0},khe={class:"prov-actions"},bhe={key:0,class:"add-section"},xhe={key:0,class:"add-btns"},whe={key:1,class:"add-form"},_he=["value"],She={key:0,class:"add-error"},Che={class:"form-btns"},Ahe={class:"footer-hint"},Mhe=Ze({__name:"ProviderManager",props:{providers:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["add","refresh","delete","openLogin","close"],setup(e,{emit:t}){const{t:n}=Tt(),o=J(null);jk(o);const s=t;function i(b){s("delete",b)}const r=J(!1),l=Bo({type:"moonshot",apiKey:"",baseUrl:"",defaultModel:""}),a=J(""),c=["moonshot","anthropic","openai","custom"];function u(){l.type="moonshot",l.apiKey="",l.baseUrl="",l.defaultModel="",a.value="",r.value=!0}function d(){r.value=!1}function f(){if(!l.apiKey.trim()){a.value=n("providers.apiKeyRequired");return}a.value="",s("add",{type:l.type,apiKey:l.apiKey.trim()||void 0,baseUrl:l.baseUrl.trim()||void 0,defaultModel:l.defaultModel.trim()||void 0}),r.value=!1}function h(b){if(b.key==="Escape"){if(r.value){d();return}s("close")}}cn(()=>document.addEventListener("keydown",h)),bn(()=>document.removeEventListener("keydown",h));function p(b){return b==="connected"?"var(--color-success)":b==="error"?"var(--color-danger)":"var(--color-text-faint)"}function g(b){return n(b==="connected"?"providers.status.connected":b==="error"?"providers.status.error":"providers.status.unconfigured")}return(b,v)=>(w(),we(qr,{open:!0,"close-on-esc":!1,title:C(n)("providers.title"),size:"xl",height:"fixed",onClose:v[6]||(v[6]=m=>s("close"))},{default:Ee(()=>[_("div",{ref_key:"dialogRef",ref:o,class:"pm"},[_("div",uhe,[e.loading?(w(),T("div",dhe,[re(Ds,{size:"sm"}),_("span",null,O(C(n)("providers.loading")),1)])):e.unavailable?(w(),T("div",fhe,[re(Ve,{name:"alert-triangle",size:"md"}),_("span",null,O(C(n)("providers.unavailable")),1)])):e.providers.length===0?(w(),T("div",hhe,O(C(n)("providers.empty")),1)):(w(!0),T(Pe,{key:3},ot(e.providers,m=>(w(),T("div",{key:m.id,class:"prov-row"},[re(Xt,{text:g(m.status)},{default:Ee(()=>[_("span",{class:We(["status-dot",{"status-dot--empty":m.status!=="connected"&&m.status!=="error"}]),style:Yt(m.status==="connected"||m.status==="error"?{background:p(m.status)}:void 0)},null,6)]),_:2},1032,["text"]),_("div",phe,[_("span",mhe,O(m.type),1),m.baseUrl?(w(),T("span",ghe,O(m.baseUrl),1)):ce("",!0),_("span",vhe,[re(Ri,{variant:m.hasApiKey?"success":"neutral",size:"sm"},{default:Ee(()=>[Je(O(m.hasApiKey?C(n)("providers.keySet"):C(n)("providers.keyNotSet")),1)]),_:2},1032,["variant"]),m.models&&m.models.length>0?(w(),T("span",yhe," · "+O(C(n)("providers.modelCount",{count:m.models.length})),1)):ce("",!0)])]),_("div",khe,[re(Xt,{text:C(n)("providers.refreshTitle",{type:m.type})},{default:Ee(()=>[re(Bt,{variant:"secondary",size:"sm",onClick:y=>s("refresh",m.id)},{default:Ee(()=>[Je(O(C(n)("providers.refresh")),1)]),_:1},8,["onClick"])]),_:2},1032,["text"]),re(Xt,{text:C(n)("providers.deleteTitle",{type:m.type})},{default:Ee(()=>[re(Bt,{variant:"danger-soft",size:"sm",onClick:y=>i(m.id)},{default:Ee(()=>[Je(O(C(n)("providers.delete")),1)]),_:1},8,["onClick"])]),_:2},1032,["text"])])]))),128))]),e.unavailable?ce("",!0):(w(),T("div",bhe,[r.value?(w(),T("div",whe,[re(fh,{label:C(n)("providers.fieldType")},{default:Ee(()=>[re(Yv,{modelValue:l.type,"onUpdate:modelValue":v[2]||(v[2]=m=>l.type=m)},{default:Ee(()=>[(w(),T(Pe,null,ot(c,m=>_("option",{key:m,value:m},O(m),9,_he)),64))]),_:1},8,["modelValue"])]),_:1},8,["label"]),re(fh,{label:C(n)("providers.fieldApiKey")},{default:Ee(()=>[re(Kc,{modelValue:l.apiKey,"onUpdate:modelValue":v[3]||(v[3]=m=>l.apiKey=m),type:"password",placeholder:"sk-…",autocomplete:"off",spellcheck:"false"},null,8,["modelValue"])]),_:1},8,["label"]),re(fh,{label:C(n)("providers.fieldBaseUrl")},{default:Ee(()=>[re(Kc,{modelValue:l.baseUrl,"onUpdate:modelValue":v[4]||(v[4]=m=>l.baseUrl=m),placeholder:C(n)("providers.baseUrlPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),re(fh,{label:C(n)("providers.fieldDefaultModel")},{default:Ee(()=>[re(Kc,{modelValue:l.defaultModel,"onUpdate:modelValue":v[5]||(v[5]=m=>l.defaultModel=m),placeholder:C(n)("providers.optional"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),a.value?(w(),T("div",She,O(a.value),1)):ce("",!0),_("div",Che,[re(Bt,{variant:"primary",size:"sm",onClick:f},{default:Ee(()=>[Je(O(C(n)("providers.add")),1)]),_:1}),re(Bt,{variant:"secondary",size:"sm",onClick:d},{default:Ee(()=>[Je(O(C(n)("common.cancel")),1)]),_:1})])])):(w(),T("div",xhe,[re(Bt,{variant:"secondary",size:"sm",onClick:v[0]||(v[0]=m=>s("openLogin","moonshot"))},{default:Ee(()=>[re(Ve,{name:"user",size:"sm"}),Je(" "+O(C(n)("providers.loginKimi")),1)]),_:1}),re(Bt,{variant:"secondary",size:"sm",onClick:v[1]||(v[1]=m=>s("openLogin","anthropic"))},{default:Ee(()=>[re(Ve,{name:"user",size:"sm"}),Je(" "+O(C(n)("providers.loginAnthropic")),1)]),_:1}),re(Bt,{variant:"primary",size:"sm",onClick:u},{default:Ee(()=>[re(Ve,{name:"plus",size:"sm"}),Je(" "+O(C(n)("providers.enterApiKey")),1)]),_:1})]))])),_("div",Ahe,O(C(n)("providers.escClose")),1)],512)]),_:1},8,["title"]))}}),Ehe=ct(Mhe,[["__scopeId","data-v-cf73278e"]]),The={key:0,width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",stroke:"var(--color-success)","stroke-width":"2","aria-hidden":"true"},Nhe={key:1,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-danger)","stroke-width":"1.5","aria-hidden":"true"},Ihe={key:2,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-warning)","stroke-width":"1.5","aria-hidden":"true"},yg=Ze({__name:"AuthStateIcon",props:{kind:{}},setup(e){return(t,n)=>e.kind==="success"?(w(),T("svg",The,[...n[0]||(n[0]=[_("circle",{cx:"18",cy:"18",r:"15"},null,-1),_("polyline",{points:"10,18 15,24 26,12"},null,-1)])])):e.kind==="expired"?(w(),T("svg",Nhe,[...n[1]||(n[1]=[_("circle",{cx:"14",cy:"14",r:"12"},null,-1),_("line",{x1:"14",y1:"8",x2:"14",y2:"15"},null,-1),_("circle",{cx:"14",cy:"19",r:"1.2",fill:"var(--color-danger)"},null,-1)])])):(w(),T("svg",Ihe,[...n[2]||(n[2]=[_("path",{d:"M14 3 L26 24 H2 Z"},null,-1),_("line",{x1:"14",y1:"12",x2:"14",y2:"18"},null,-1),_("circle",{cx:"14",cy:"21.5",r:"1",fill:"var(--color-warning)"},null,-1)])]))}}),Lhe={key:0,class:"center-body"},$he={class:"center-text"},Fhe={key:1,class:"nb"},Ohe={class:"nb-lead"},Rhe=["href"],Bhe={class:"nb-or"},Dhe={class:"nb-fallback"},Phe={class:"nb-fb-text"},Hhe=["href"],Whe={class:"nb-code-row"},zhe={class:"nb-code"},Uhe={class:"nb-status"},qhe={class:"nb-status-text"},jhe={class:"nb-countdown"},Vhe={key:2,class:"center-body"},Khe={class:"center-text success-text"},Ghe={class:"center-hint"},Yhe={class:"center-body"},Zhe={class:"center-text err-text"},Qhe={class:"center-hint"},Xhe={class:"actions"},Jhe={class:"center-body"},epe={class:"center-text warn-text"},tpe={class:"center-hint"},npe={class:"actions"},ope=3,spe=Ze({__name:"LoginDialog",props:{onStartOAuthLogin:{type:Function},onPollOAuthLogin:{type:Function},onCancelOAuthLogin:{type:Function}},emits:["success","close"],setup(e,{emit:t}){const{t:n}=Tt(),o=J(!0),s=t,i=e,r=J("starting"),l=J(!1),a=J(null),c=J(0),u=J(!1);let d=null,f=null,h=0;cn(async()=>{await p()}),bn(()=>{v()});async function p(){v(),a.value=null,l.value=!1,h=0,r.value="starting";const $=await i.onStartOAuthLogin();if(!$){r.value="error";return}if($.status==="authenticated"){v(),r.value="success",setTimeout(()=>{s("success"),s("close")},800);return}a.value={flowId:$.flowId,verificationUri:$.verificationUri,verificationUriComplete:$.verificationUriComplete,userCode:$.userCode,expiresIn:$.expiresIn,interval:$.interval},c.value=$.expiresIn,r.value="device-code",g(),b($.interval)}function g(){f&&clearInterval(f),f=setInterval(()=>{c.value>0?c.value--:(f&&clearInterval(f),f=null)},1e3)}function b($){d&&clearTimeout(d),d=setTimeout(async()=>{const I=await i.onPollOAuthLogin();if(I===null){if(h+=1,h>=ope){v(),l.value=!0,r.value="error";return}b($);return}h=0,I.status==="authenticated"?(v(),r.value="success",setTimeout(()=>{s("success"),s("close")},1200)):I.status==="expired"||I.status==="cancelled"?(v(),r.value="expired"):b($)},$*1e3)}function v(){d&&(clearTimeout(d),d=null),f&&(clearInterval(f),f=null)}async function m(){await p()}async function y(){!a.value||!await Go(a.value.userCode)||(u.value=!0,setTimeout(()=>{u.value=!1},2e3))}async function k(){v(),r.value==="device-code"&&i.onCancelOAuthLogin(),s("close")}function A($){const I=Math.floor($/60),x=$%60;return`${I}:${String(x).padStart(2,"0")}`}return($,I)=>(w(),we(qr,{open:o.value,"onUpdate:open":I[0]||(I[0]=x=>o.value=x),title:C(n)("login.title"),"close-on-overlay":!1,onClose:k},{default:Ee(()=>[r.value==="starting"?(w(),T("div",Lhe,[re(Ds,{size:"md"}),_("span",$he,O(C(n)("login.starting")),1)])):r.value==="device-code"&&a.value?(w(),T("div",Fhe,[_("div",Ohe,O(C(n)("login.lead")),1),_("a",{class:"nb-primary",href:a.value.verificationUriComplete,target:"_blank",rel:"noopener noreferrer"},[Je(O(C(n)("login.authorizeInBrowser"))+" ",1),re(Ve,{name:"external-link",size:"sm"})],8,Rhe),_("div",Bhe,O(C(n)("login.orDivider")),1),_("div",Dhe,[_("div",Phe,[Je(O(C(n)("login.fallbackPrefix")),1),_("a",{class:"nb-fb-link",href:a.value.verificationUri,target:"_blank",rel:"noopener noreferrer"},O(a.value.verificationUri),9,Hhe),Je(O(C(n)("login.fallbackSuffix")),1)]),_("div",Whe,[_("span",zhe,O(a.value.userCode),1),re(Bt,{class:We(["nb-copy",{"is-copied":u.value}]),variant:"secondary",size:"sm",onClick:y},{default:Ee(()=>[u.value?(w(),T(Pe,{key:0},[re(Ve,{name:"check",size:"sm"}),Je(" "+O(C(n)("login.copied")),1)],64)):(w(),T(Pe,{key:1},[re(Ve,{name:"copy",size:"sm"}),Je(" "+O(C(n)("login.copy")),1)],64))]),_:1},8,["class"])])]),_("div",Uhe,[re(Ds,{size:"sm",label:C(n)("login.waitingAuth")},null,8,["label"]),_("span",qhe,O(C(n)("login.waitingAutoClose")),1),_("span",jhe,O(A(c.value)),1)])])):r.value==="success"?(w(),T("div",Vhe,[re(yg,{kind:"success"}),_("span",Khe,O(C(n)("login.success")),1),_("span",Ghe,O(C(n)("login.successHint")),1)])):r.value==="expired"?(w(),T(Pe,{key:3},[_("div",Yhe,[re(yg,{kind:"expired"}),_("span",Zhe,O(C(n)("login.expiredTitle")),1),_("span",Qhe,O(C(n)("login.expiredHint")),1)]),_("div",Xhe,[re(Bt,{variant:"primary",onClick:m},{default:Ee(()=>[Je(O(C(n)("login.retry")),1)]),_:1}),re(Bt,{variant:"secondary",onClick:k},{default:Ee(()=>[Je(O(C(n)("login.closeBtn")),1)]),_:1})])],64)):r.value==="error"?(w(),T(Pe,{key:4},[_("div",Jhe,[re(yg,{kind:"error"}),_("span",epe,O(l.value?C(n)("login.pollErrorTitle"):C(n)("login.errorTitle")),1),_("span",tpe,O(l.value?C(n)("login.pollErrorHint"):C(n)("login.errorHint")),1)]),_("div",npe,[re(Bt,{variant:"primary",onClick:m},{default:Ee(()=>[Je(O(C(n)("login.retry")),1)]),_:1}),re(Bt,{variant:"secondary",onClick:k},{default:Ee(()=>[Je(O(C(n)("login.closeBtn")),1)]),_:1})])],64)):ce("",!0)]),_:1},8,["open","title"]))}}),ipe=ct(spe,[["__scopeId","data-v-8308a28f"]]);function rpe(e){const t=e.split("/").filter(Boolean);return t.length>0?t[t.length-1]:e}const lpe=/^(?:[A-Za-z]:[\\/]|\\\\|\/\/)/;function Fi(e){const t=e.replaceAll("\\","/"),n=lpe.test(t),o=t.replace(/\/+$/,"");return n?o.toLowerCase():o}function ape(e,t){const n=Fi(t.cwd);return e.find(o=>Fi(o.root)===n)?.id??t.workspaceId??t.cwd}function cpe(e){const{workspaces:t,sessions:n,hiddenWorkspaceRoots:o,sessionsHasMoreByWorkspace:s}=e,i=new Set(o.map(Fi)),r=new Map;for(const d of t){const f=Fi(d.root);i.has(f)||r.has(f)||r.set(f,{...d})}for(const d of n){const f=d.cwd;if(!f)continue;const h=Fi(f);i.has(h)||r.has(h)||r.set(h,{id:d.workspaceId??f,root:f,name:rpe(f),sessionCount:0})}const l=new Map;for(const d of n){const f=ape(t,d);l.set(f,(l.get(f)??0)+1)}const a=[];for(const d of t){const f=Fi(d.root);!i.has(f)&&!a.includes(f)&&a.push(f)}const c=[...r.keys()].filter(d=>!a.includes(d));c.sort((d,f)=>r.get(d).root.localeCompare(r.get(f).root));const u=[];for(const d of[...a,...c]){const f=r.get(d),h=l.get(f.id)??l.get(f.root)??0,p=s[f.id]===!1?h:Math.max(f.sessionCount,h);u.push({...f,sessionCount:p})}return u}function upe(e,t){if(t.length===0||e.length===0)return t;const n=Date.parse(t[0].createdAt);if(Number.isNaN(n))return t;const o=new Set(t.map(r=>r.id)),s=new Set(t.filter(r=>r.role==="user").map(r=>r.id)),i=e.filter(r=>{const l=Date.parse(r.createdAt);return!(Number.isNaN(l)||l>=n||o.has(r.id)||r.role==="user"&&r.promptId!==void 0&&s.has(r.promptId))});return i.length>0?[...i,...t]:t}function YC(e,t){const n=new Set(e.map(a=>a.id)),o=t.filter(a=>a.kind==="subagent"&&!n.has(a.id));if(o.length===0)return e;const s=new Map(e.map(a=>[a.id,a])),i=new Set,r=o.map(a=>{const c=a.backgroundTaskId!==void 0?s.get(a.backgroundTaskId):void 0;if(c===void 0)return a;i.add(c.id);const u=a.status==="running"&&c.status!=="running";return{...a,status:a.status==="running"?c.status:a.status,subagentPhase:u?c.status==="completed"?"completed":"failed":a.subagentPhase,completedAt:a.completedAt??c.completedAt,outputPreview:c.outputPreview??a.outputPreview,outputBytes:c.outputBytes??a.outputBytes}});return[...e.filter(a=>!i.has(a.id)),...r]}function dpe(e,t){if(e.length===0)return t;const n=new Map(t.map(r=>[r.id,r])),o=new Set(e.map(r=>r.id)),s=e.map(r=>{const l=n.get(r.id);return l?{...r,outputLines:l.outputLines,text:l.text}:r}),i=t.filter(r=>!o.has(r.id));return i.length===0?s:[...s,...i]}function fpe(e){const t=new Map,n=new Set;function o(i){const r=t.get(i);if(r!==void 0)return r;const l=(async()=>e(i))().finally(()=>{t.delete(i),n.delete(i)&&o(i)});return t.set(i,l),l}function s(i){if(t.has(i)){n.add(i);return}o(i)}return{run:o,request:s}}const hpe=new Set(["assistantDelta","agentDelta","toolOutput","taskProgress"]);function ppe(e){return hpe.has(e.type)}const mpe=50,gpe=100,Zv=32*1024,vpe={requestFrame(e){return typeof requestAnimationFrame=="function"?requestAnimationFrame(e):null},cancelFrame(e){typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(e)},requestTask(e){return setTimeout(e,mpe)},cancelTask(e){clearTimeout(e)}};function ype(e,t,n={}){const o=n.scheduler??vpe,s=Math.max(1,Math.floor(n.maxItemsPerSlice??gpe)),i=[];let r=0,l=null,a=null,c=0,u=!1;const d=()=>i.length-r,f=()=>{c+=1,l!==null&&(o.cancelFrame(l),l=null),a!==null&&(o.cancelTask(a),a=null)},h=()=>{r===i.length?(i.length=0,r=0):r>=1024&&(i.splice(0,r),r=0)};let p;const g=()=>{if(u||l!==null||a!==null||d()===0)return;const v=++c,m=()=>{v===c&&p()};l=o.requestFrame(m),a=o.requestTask(m)};p=()=>{f();let v=0;for(;!u&&v<s&&r<i.length;){const m=i[r++];e(m),v+=1}h(),g()};const b=(v=>{if(!u){if(t(v)){const m=i.length>r?i.at(-1):void 0,y=m===void 0?void 0:n.coalesce?.(m,v);y===void 0?i.push(v):i[i.length-1]=y,g();return}if(d()===0){e(v);return}i.push(v),p()}});return b.flush=()=>{if(!u){for(f();!u&&r<i.length;)e(i[r++]);h()}},b.discard=v=>{if(u||d()===0)return;let m=r;for(let y=r;y<i.length;y+=1){const k=i[y];v(k)||(i[m++]=k)}i.length=m,h(),d()===0?f():g()},b.dispose=()=>{u||(u=!0,f(),i.length=0,r=0)},b}function Qv(e){if(e.type==="assistantDelta"){if(e.delta.text!==void 0&&e.delta.thinking===void 0)return{kind:"text",value:e.delta.text};if(e.delta.thinking!==void 0&&e.delta.text===void 0)return{kind:"thinking",value:e.delta.thinking}}}function kpe(e){if(e.appEvent.type!=="assistantDelta")return[e];const t=e.appEvent,n=e.meta.stream,o=Qv(t);if(n===void 0||o===void 0||n.kind!==o.kind||o.value.length<=Zv)return[e];const s=[];let i=0;for(;i<o.value.length;){let r=Math.min(i+Zv,o.value.length);r<o.value.length&&r>i&&/[\uD800-\uDBFF]/u.test(o.value[r-1])&&/[\uDC00-\uDFFF]/u.test(o.value[r])&&(r-=1);const l=o.value.slice(i,r);s.push({appEvent:{...t,delta:o.kind==="text"?{text:l}:{thinking:l}},meta:{...e.meta,stream:{...n,offset:n.offset+i}}}),i=r}return s}function bpe(e,t){if(e.appEvent.type!=="assistantDelta"||t.appEvent.type!=="assistantDelta")return;const n=e.meta.stream,o=t.meta.stream,s=Qv(e.appEvent),i=Qv(t.appEvent);if(n===void 0||o===void 0||s===void 0||i===void 0||e.meta.sessionId!==t.meta.sessionId||e.appEvent.sessionId!==t.appEvent.sessionId||e.appEvent.messageId!==t.appEvent.messageId||e.appEvent.contentIndex!==t.appEvent.contentIndex||n.turnId!==o.turnId||n.kind!==o.kind||s.kind!==i.kind||n.kind!==s.kind||o.kind!==i.kind||o.offset!==n.offset+s.value.length||s.value.length+i.value.length>Zv)return;const r=s.value+i.value;return{appEvent:{...e.appEvent,delta:s.kind==="text"?{text:r}:{thinking:r}},meta:{...t.meta,stream:{...n}}}}const P5=["blue","mono"],H5=["light","dark","system"],W5=14,xpe=12,wpe=20;function _pe(){const e=mo(Ft.accent);return e&&P5.includes(e)?e:"blue"}function Spe(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.accent=e)}function Cpe(){const e=mo(Ft.colorScheme);return e&&H5.includes(e)?e:"system"}function Ape(e){if(typeof document>"u"||!document.documentElement)return;document.documentElement.dataset.colorScheme=e;const t=document.querySelectorAll('meta[name="theme-color"]');if(t.length===0)return;const n=e==="dark"?"#0d1117":e==="light"?"#ffffff":null;t.forEach(o=>{const i=(o.getAttribute("media")??"").includes("dark")?"#0d1117":"#ffffff";o.setAttribute("content",n??i)})}function Vk(e){return Number.isFinite(e)?Math.min(wpe,Math.max(xpe,Math.round(e))):W5}function Mpe(){const e=mo(Ft.uiFontSize);return e===null?W5:Vk(Number(e))}function Epe(e){typeof document>"u"||!document.documentElement||document.documentElement.style.setProperty("--base-ui-font-size",`${Vk(e)}px`)}const Kk=J(Cpe()),Gk=J(_pe()),Yk=J(Mpe());Qe(Kk,Ape,{immediate:!0});Qe(Gk,Spe,{immediate:!0});Qe(Yk,Epe,{immediate:!0});function Tpe(e){H5.includes(e)&&(Kk.value=e,So(Ft.colorScheme,e))}function Npe(e){P5.includes(e)&&(Gk.value=e,So(Ft.accent,e))}function Ipe(e){const t=Vk(e);Yk.value=t,So(Ft.uiFontSize,String(t))}const Lpe=600,$pe=250,Gm=250,Fpe=1e3,Ope=160,Wp=J(!1);let va=[],xa=null,zp=-Gm;function Rpe(){va=[],zp=-Gm,Wp.value=!1,xa!==null&&(clearTimeout(xa),xa=null)}function Bpe(){Wp.value=!0,xa!==null&&clearTimeout(xa),xa=setTimeout(()=>{xa=null,va=[],zp=-Gm,Wp.value=!1},Fpe)}function Dpe(e){if(e<=0)return;const t=Date.now();va.push({time:t,chars:e});const n=t-Lpe;if(va=va.filter(l=>l.time>=n),t-zp<Gm)return;zp=t;const o=va[0]?.time??t,s=Math.max(t-o,$pe);va.reduce((l,a)=>l+a.chars,0)/s*1e3>=Ope&&Bpe()}function z5(){return{colorScheme:Kk,accent:Gk,uiFontSize:Yk,fastMoon:Wp,setColorScheme:Tpe,setAccent:Npe,setUiFontSize:Ipe,resetFastMoon:Rpe,recordMoonDelta:Dpe}}function Ppe(e,t,n){return e==="idle"&&!t&&!n}function Zk(e,t){const n=mo(e);return n===null?t:n==="1"}const Qk=J(Zk(Ft.notifyOnComplete,!0)),Xk=J(Zk(Ft.notifyOnQuestion,!1)),Jk=J(Zk(Ft.notifyOnApproval,!1)),e2=J(typeof Notification<"u"?Notification.permission:"denied"),Hpe="/favicon.ico";async function t2(e,t,n){if(!n){e.value=!1,So(t,"0");return}if(typeof Notification>"u")return;let o=Notification.permission;if(o==="default")try{o=await Notification.requestPermission()}catch{}e2.value=o,o==="granted"&&(e.value=!0,So(t,"1"))}function Wpe(e){return t2(Qk,Ft.notifyOnComplete,e)}function zpe(e){return t2(Xk,Ft.notifyOnQuestion,e)}function Upe(e){return t2(Jk,Ft.notifyOnApproval,e)}function n2(...e){for(const t of e){const n=t?.trim();if(n)return n}return""}function qpe(e){return{title:_n.global.t("settings.notifyTitle"),body:n2(e,_n.global.t("settings.notifyFallback"))}}function jpe(e,t){return{title:_n.global.t("settings.notifyQuestionTitle"),body:n2(t,e,_n.global.t("settings.notifyQuestionFallback"))}}function Vpe(e,t){return{title:_n.global.t("settings.notifyApprovalTitle"),body:n2(t,e,_n.global.t("settings.notifyApprovalFallback"))}}function o2(e,t,n,o){if(!e||typeof Notification>"u")return;const s=Notification.permission;if(s!=="denied"){if(s==="default"){Notification.requestPermission().then(i=>{e2.value=i,i==="granted"&&ZC(t,n,o)});return}ZC(t,n,o)}}function ZC(e,t,n){if(!e.isUserWatching)try{const o=new Notification(t.title,{body:t.body,tag:n,icon:Hpe});o.onclick=()=>{try{window.focus()}catch{}e.onClick(),o.close()}}catch{}}function Kpe(e,t){o2(Qk.value,t,qpe(t.sessionTitle),`kimi-complete-${e}-${t.promptId??Date.now()}`)}function Gpe(e){o2(Xk.value,e,jpe(e.sessionTitle,e.questionPreview),`kimi-question-${e.questionId}`)}function Ype(e){o2(Jk.value,e,Vpe(e.sessionTitle,e.toolName),`kimi-approval-${e.approvalId}`)}function Zpe(){return{notifyOnComplete:Qk,notifyOnQuestion:Xk,notifyOnApproval:Jk,notifyPermission:e2,setNotifyOnComplete:Wpe,setNotifyOnQuestion:zpe,setNotifyOnApproval:Upe,maybeNotifyCompletion:Kpe,maybeNotifyQuestion:Gpe,maybeNotifyApproval:Ype}}function Qpe(){return mo(Ft.soundOnComplete)==="1"}const cu=J(Qpe());function Xpe(){if(typeof window>"u")return;const e=window;return window.AudioContext??e.webkitAudioContext}let kg=null;function U5(){const e=Xpe();if(!e)return null;if(kg===null)try{kg=new e}catch{return null}return kg}function q5(){if(!cu.value)return;const e=U5();e!==null&&e.state==="suspended"&&e.resume().then(()=>{Er("sound: audio context resumed",{state:e.state})},t=>{Er("sound: audio context resume rejected",{error:String(t)})})}let QC=!1;function Jpe(){if(QC||typeof window>"u")return;QC=!0;const e=()=>{q5()};window.addEventListener("pointerdown",e,{capture:!0}),window.addEventListener("keydown",e,{capture:!0})}Jpe();function eme(e){cu.value=e,So(Ft.soundOnComplete,e?"1":"0"),e&&q5()}function XC(e,t,n,o,s){const i=e.createOscillator(),r=e.createGain();i.type="sine",i.frequency.value=t,i.connect(r),r.connect(e.destination);const l=e.currentTime+n;r.gain.setValueAtTime(1e-4,l),r.gain.exponentialRampToValueAtTime(s,l+.01),r.gain.exponentialRampToValueAtTime(1e-4,l+o),i.start(l),i.stop(l+o+.02)}function s2(){const e=U5();if(e===null){Er("sound: skipped, AudioContext unavailable");return}if(e.state!=="running"){Er("sound: skipped, context not running",{state:e.state}),e.state==="suspended"&&e.resume().then(()=>{Er("sound: context resumed for next time",{state:e.state})},t=>{Er("sound: resume rejected",{error:String(t)})});return}try{XC(e,880,0,.16,.18),XC(e,1320,.1,.22,.16),Er("sound: chime scheduled",{state:e.state})}catch(t){Er("sound: failed to play",{error:String(t)})}}function tme(){cu.value&&s2()}function nme(){cu.value&&s2()}function ome(){cu.value&&s2()}function sme(){return{soundOnComplete:cu,setSoundOnComplete:eme,maybePlayCompletionSound:tme,maybePlayQuestionSound:nme,maybePlayApprovalSound:ome}}const ime=1e3,rme=4096,JC=32*1024;function lme(e,t){let n=null,o;const s=new Set;async function i(f){try{const p=await dt().listTasks(f);e.tasksBySession={...e.tasksBySession,[f]:YC(p,e.tasksBySession[f]??[])},await r(f,p)}catch{}}async function r(f,h){if(e.activeSessionId!==f)return;const p=h??e.tasksBySession[f]??[],g=dt(),b=new Map;if(await Promise.all(p.map(async m=>{if((m.status==="completed"||m.status==="failed"||m.status==="cancelled")&&!s.has(m.id)&&!((m.outputLines?.length??0)>0))try{const k=await g.getTask(f,m.id,{withOutput:!0,outputBytes:JC});k.outputPreview!==void 0&&b.set(m.id,{preview:k.outputPreview,bytes:k.outputBytes}),s.add(m.id)}catch{}})),b.size===0)return;const v=e.tasksBySession[f]??[];e.tasksBySession={...e.tasksBySession,[f]:v.map(m=>{const y=b.get(m.id)??(m.backgroundTaskId!==void 0?b.get(m.backgroundTaskId):void 0);return y?{...m,outputPreview:y.preview,outputBytes:y.bytes}:m})}}async function l(f){if(e.activeSessionId!==f)return;const h=dt();let p;try{p=await h.listTasks(f)}catch{return}const g=new Map;await Promise.all(p.map(async y=>{const k=y.status==="running",A=y.status==="completed"||y.status==="failed"||y.status==="cancelled";if(!(!k&&!A)&&!(A&&(s.has(y.id)||(y.outputLines?.length??0)>0)))try{const $=await h.getTask(f,y.id,{withOutput:!0,outputBytes:k?rme:JC});$.outputPreview!==void 0&&g.set(y.id,{preview:$.outputPreview,bytes:$.outputBytes}),A&&s.add(y.id)}catch{}}));const b=e.tasksBySession[f]??[],v=new Map(b.map(y=>[y.id,y])),m=p.map(y=>{const k=v.get(y.id),A=g.get(y.id);return{...y,outputLines:k?.outputLines,text:k?.text,outputPreview:A?.preview??k?.outputPreview,outputBytes:A?.bytes??k?.outputBytes}});e.tasksBySession={...e.tasksBySession,[f]:YC(m,b)}}function a(f){n!==null&&o===f||(c(),o=f,l(f),n=setInterval(()=>{typeof document<"u"&&document.visibilityState==="hidden"||(e.activeSessionId===f?l(f):c())},ime))}function c(){n!==null&&(clearInterval(n),n=null),o=void 0,s.clear()}const u=J(0);let d=null;return Qe(()=>t.value.some(f=>f.status==="running"),f=>{f&&d===null?d=setInterval(()=>{u.value=(u.value+1)%Number.MAX_SAFE_INTEGER},1e3):!f&&d!==null&&(clearInterval(d),d=null)},{immediate:!0}),Qe(()=>{const f=e.activeSessionId;if(!f)return{sid:void 0,hasRunning:!1};const h=e.tasksBySession[f]??[];return{sid:f,hasRunning:h.some(p=>p.status==="running")}},({sid:f,hasRunning:h},p,g)=>{let b;h&&f!==void 0?a(f):f!==void 0?b=setTimeout(()=>{(e.tasksBySession[f]??[]).some(m=>m.status==="running")||c()},1500):c(),g(()=>{b!==void 0&&clearTimeout(b)})},{deep:!0,immediate:!0}),{taskClock:R(()=>u.value),loadTasksForSession:i}}function ame(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 cme(e){const t=[];if(!e)return t;let n=0,o=0,s=!1;for(const i of e.split(`
302
+ `)){if(i.startsWith("diff --git")){s=!1;continue}if(!s&&ame(i))continue;if(i.startsWith("@@")){const a=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(i);a&&(n=Number.parseInt(a[1],10),o=Number.parseInt(a[2],10)),s=!0,t.push({type:"hunk",text:i});continue}if(!s||i.startsWith("\\"))continue;const r=i.charAt(0),l=i.slice(1);r==="+"?(t.push({type:"add",text:l,newNo:o}),o+=1):r==="-"?(t.push({type:"del",text:l,oldNo:n}),n+=1):r===" "&&(t.push({type:"context",text:l,oldNo:n,newNo:o}),n+=1,o+=1)}return t}const Xv="/sessions/";function e4(e){const{pathname:t}=e;if(!t.startsWith(Xv))return;const n=t.slice(Xv.length);if(!(!n||n.includes("/")))try{const o=decodeURIComponent(n);return o.length>0?o:void 0}catch{return}}function ume(e){return e===void 0||e.length===0?"/":`${Xv}${encodeURIComponent(e)}`}const dme=50,Jv=5,fme=40402,hme=40410,pme=40902,mme=2e3;function bg(e){return vi(e)&&e.code===pme}const gme=40904;function vme(e){return vi(e)&&e.code===gme}const ca=Bo({}),hh=Bo({}),xg=Bo({}),Yi=Bo(new Set),Ym=new Map,Fa=new Map,Up=new Map;let yme=0;const da=new Map,kme=3;let t4=0;function bme(){return t4+=1,`${Date.now().toString(36)}-${t4}`}function xme(e){return{generation:Ym.get(e)??0,pending:(Fa.get(e)?.size??0)>0}}function ey(e){const t=++yme;Ym.set(e,t);const n=Fa.get(e)??new Set;return n.add(t),Fa.set(e,n),t}function ty(e,t){const n=Fa.get(e);if(n===void 0||(n.delete(t),n.size>0))return;Fa.delete(e);const o=Up.get(e);Up.delete(e),o?.()}function wme(e){Ym.delete(e),Fa.delete(e),Up.delete(e),da.delete(e)}function _me(e,t){return!t.pending&&t.generation===(Ym.get(e)??0)}function Sme(e,t){if((Fa.get(e)?.size??0)===0){t();return}Up.set(e,t)}function Cme(e,t){const{t:n}=_n.global,{confirm:o}=tf(),{taskPoller:s,sideChat:i,modelProvider:r,pushOperationFailure:l,activity:a,sessionsKnownEmpty:c,setSessions:u,updateSession:d,upsertSessionFront:f,appendSession:h,forgetSession:p,setActiveSessionId:g,updateSessionMessages:b,nextOptimisticMsgId:v,getEventConn:m,syncSessionFromSnapshot:y,reopenSession:k,hasLoadedMessages:A,refreshSessionStatus:$,refreshSessionGoal:I,persistSessionProfile:x,mergedWorkspaces:L,workspacesView:E,status:F,workspaceIdForSession:S,savePermissionToStorage:N,savePlanModeToStorage:D,saveSwarmModeToStorage:B,saveGoalModeToStorage:U,draftModes:H,saveUnread:P,saveActiveWorkspaceToStorage:Z,saveHiddenWorkspacesToStorage:K,goalErrorMessage:V,resetFastMoon:X,initialized:he,connectIssue:ne,selectedDiffPath:ue,fileDiffLines:de,fileDiffLoading:Ce}=t;let Ie=!1;async function le(Q){if(e.messagesLoadingMoreBySession[Q])return;const xe=e.messagesBySession[Q];if(!xe||xe.length===0)return;const be=xe[0].id;e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[Q]:!0},e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[Q]:!1};try{const Oe=await dt().listMessages(Q,{beforeId:be,pageSize:dme}),Ye=[...Oe.items].reverse();b(Q,st=>[...Ye,...st]),e.messagesHasMoreBySession={...e.messagesHasMoreBySession,[Q]:Oe.hasMore}}catch(Oe){e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[Q]:!0},l("loadOlderMessages",Oe,{sessionId:Q})}finally{e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[Q]:!1}}}function z(Q){s.loadTasksForSession(Q),q(Q),$(Q),I(Q),Object.prototype.hasOwnProperty.call(r.skillsBySession.value,Q)||r.loadSkillsForSession(Q)}async function ae(Q){const xe=e.activeSessionId;if(xe){ue.value=Q,de.value=[],Ce.value=!0;try{const Oe=await dt().getFileDiff(xe,Q);if(ue.value!==Q)return;de.value=cme(Oe.diff)}catch(be){ue.value===Q&&(de.value=[]),console.warn("[loadFileDiff] diff unavailable for",Q,be)}finally{ue.value===Q&&(Ce.value=!1)}}}function ie(){ue.value=null,de.value=[],Ce.value=!1}async function q(Q){try{const be=await dt().getGitStatus(Q);e.gitStatusBySession={...e.gitStatusBySession,[Q]:be}}catch{}}async function ee(){try{const xe=await dt().getAuth();return e.authReady=xe.ready,e.defaultModel=xe.defaultModel,e.managedProviderStatus=xe.managedProvider?.status??null,ne.value=null,"proceed"}catch(Q){return vi(Q)&&(Q.code===401||Q.code===x5)?(ne.value=null,"server-auth-required"):(ne.value=(Q instanceof Error?Q.message:String(Q)).slice(0,140),"retry")}}async function ye(){let Q=!0;for(;;){const xe=await ee();if(xe!=="retry")return xe;Q&&(ne.value=null,Q=!1),await new Promise(be=>{setTimeout(be,mme)})}}async function fe(){try{const Q=dt();e.config=await Q.getConfig()}catch{}}async function ve(Q){try{const be=await dt().setConfig(Q);return e.config=be,e.defaultModel=be.defaultModel??null,!0}catch(xe){return l("setConfig",xe),!1}}const j=100,te=30,me=720*60*1e3;async function Ae(){const Q=dt(),xe=[];let be,Oe;for(;;){let Ye;try{Ye=await Q.listSessions({pageSize:j,beforeId:be,excludeEmpty:!0})}catch(st){if(xe.length===0)throw st;Oe=st;break}if(xe.push(...Ye.items),!Ye.hasMore||Ye.items.length===0)break;be=Ye.items[Ye.items.length-1].id}return{sessions:xe,error:Oe}}function $e(Q){const xe=new Map(e.sessions.map(be=>[be.id,be.usage]));u(Q.map(be=>{const Oe=xe.get(be.id);return Oe!==void 0&&Hv(be.usage)&&!Hv(Oe)?{...be,usage:Oe}:be}))}function De(Q){const xe=[...Q],be=new Set(xe.map(Oe=>Oe.id));for(const Oe of e.sessions)be.has(Oe.id)||(xe.push(Oe),be.add(Oe.id));return xe.sort((Oe,Ye)=>new Date(Ye.updatedAt).getTime()-new Date(Oe.updatedAt).getTime()),xe}async function ge(Q){const xe=dt(),be=[],Oe=Date.now(),Ye=jt=>Oe-new Date(jt.updatedAt).getTime();let st,Ct=!1,Ot=!0,uo;for(;;){let jt;try{jt=await xe.listSessions({workspaceId:Q,pageSize:Jv,beforeId:st,excludeEmpty:!0})}catch(Mt){if(Ot)throw Mt;uo=Mt,Ct=!0;break}if(Ct=jt.hasMore,jt.items.length===0)break;const wn=jt.items[jt.items.length-1],ls=Ye(wn)>=me;if(!Ot&&ls){const Mt=jt.items.findIndex(Vt=>Ye(Vt)>=me),Nt=Mt>=0?Mt+1:jt.items.length;be.push(...jt.items.slice(0,Nt)),Ct=jt.hasMore||Nt<jt.items.length;break}if(be.push(...jt.items),Ot=!1,!jt.hasMore||ls)break;st=wn.id}return{workspaceId:Q,page:{items:be,hasMore:Ct},error:uo}}async function Ne(){const Q=e.workspaces;if(Q.length===0){const Mt=await Ae(),Nt=Mt.error===void 0?Mt.sessions:De(Mt.sessions);return e.sessionsHasMoreByWorkspace={},e.sessionsCursorByWorkspace={},e.sessionsInitialCountByWorkspace={},e.sessionsFullyLoaded=Mt.error===void 0,Mt.error!==void 0&&l("load",Mt.error),Nt}const xe=await Promise.allSettled(Q.map(Mt=>ge(Mt.id))),be=[],Oe=new Set,Ye=new Map,st=new Set;let Ct;for(let Mt=0;Mt<xe.length;Mt++){const Nt=xe[Mt];if(Nt.status==="fulfilled"){Ye.set(Nt.value.workspaceId,Nt.value.page),Nt.value.error!==void 0&&(st.size===0&&(Ct=Nt.value.error),st.add(Nt.value.workspaceId));for(const Vt of Nt.value.page.items)Oe.has(Vt.id)||(be.push(Vt),Oe.add(Vt.id));continue}st.size===0&&(Ct=Nt.reason),st.add(Q[Mt].id)}if(Ye.size===0){l("load",Ct);return}const Ot=new Set(Q.filter(Mt=>st.has(Mt.id)).map(Mt=>Mt.root)),uo=new Set(Q.map(Mt=>Mt.id));for(const Mt of e.sessions)!(Mt.workspaceId!==void 0&&uo.has(Mt.workspaceId)?st.has(Mt.workspaceId):Ot.has(Mt.cwd)||st.has(S(Mt)))||Oe.has(Mt.id)||(be.push(Mt),Oe.add(Mt.id));const jt={},wn={},ls={};for(const{id:Mt}of Q){const Nt=Ye.get(Mt);if(Nt===void 0){const Vt=e.sessionsHasMoreByWorkspace[Mt],fo=e.sessionsCursorByWorkspace[Mt],oo=e.sessionsInitialCountByWorkspace[Mt];Vt!==void 0&&(jt[Mt]=Vt),fo!==void 0&&(wn[Mt]=fo),oo!==void 0&&(ls[Mt]=oo);continue}jt[Mt]=Nt.hasMore,wn[Mt]=Nt.items.length>0?Nt.items[Nt.items.length-1].id:void 0,ls[Mt]=Math.max(Nt.items.length,Jv)}return e.sessionsHasMoreByWorkspace=jt,e.sessionsCursorByWorkspace=wn,e.sessionsInitialCountByWorkspace=ls,e.sessionsFullyLoaded=!1,be.sort((Mt,Nt)=>new Date(Nt.updatedAt).getTime()-new Date(Mt.updatedAt).getTime()),st.size>0&&l("load",Ct),be}async function et(Q){if(e.sessionsLoadingMoreByWorkspace[Q]||e.sessionsHasMoreByWorkspace[Q]===!1)return;const xe=e.sessionsCursorByWorkspace[Q];if(xe!==void 0){e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[Q]:!0};try{const be=await dt().listSessions({workspaceId:Q,pageSize:te,beforeId:xe,excludeEmpty:!0}),Oe=new Set(e.sessions.map(st=>st.id)),Ye=be.items.filter(st=>!Oe.has(st.id));Ye.length>0&&u([...e.sessions,...Ye]),e.sessionsCursorByWorkspace={...e.sessionsCursorByWorkspace,[Q]:be.items.length>0?be.items[be.items.length-1].id:xe},e.sessionsHasMoreByWorkspace={...e.sessionsHasMoreByWorkspace,[Q]:be.hasMore}}catch(be){l("loadMoreSessions",be)}finally{e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[Q]:!1}}}}async function rt(){if(e.sessionsFullyLoaded)return;const Q=await Ae().catch(Oe=>(console.warn("[kimi-web] loadAllSessions failed; search covers only loaded sessions",Oe),null));if(Q===null)return;const xe=Q.error===void 0?Q.sessions:De(Q.sessions);if($e(xe),e.sessionsFullyLoaded=Q.error===void 0,Q.error!==void 0)return;const be={};for(const Oe of e.workspaces)be[Oe.id]=!1;e.sessionsHasMoreByWorkspace=be}async function _t(){const Q=await dt().getMeta().catch(()=>null);Q!==null&&(e.serverVersion=Q.serverVersion,e.availableOpenInApps=Q.openInApps,e.dangerousBypassAuth=Q.dangerousBypassAuth,e.backend=Q.backend)}async function gt(){const Q=Date.now();let xe="accepted";ko("app:load:start"),e.loading=!0;const be=!he.value;let Oe=!0;try{if(be&&await ye()==="server-auth-required"){Oe=!1,xe="auth-required";return}const Ye=dt();await Promise.all([Ye.getHealth().catch(()=>null),_t(),r.loadModels()]),be||await ee(),await fe(),await It();const st=await Ne(),Ct=st??e.sessions;st!==void 0&&$e(st);const Ot=Ct[0],uo=e.activeWorkspaceId;!(uo!==null&&L.value.some(ls=>ls.id===uo))&&Ot&&ht(S(Ot)),xn();const wn=typeof window<"u"?e4(window.location):void 0;!e.activeSessionId&&wn!==void 0&&(e.sessions.some(Mt=>Mt.id===wn)||await to(wn))&&await An(wn,{urlMode:"replace"}),!e.activeSessionId&&Ct.length>0&&await An(Ct[0].id,{urlMode:"replace"})}catch(Ye){xe="failed",l("load",Ye)}finally{e.loading=!1,Oe&&(he.value=!0),ko("app:load:complete",{status:xe,sessionId:e.activeSessionId,sessionCount:e.sessions.length,workspaceCount:e.workspaces.length,durationMs:Date.now()-Q})}}async function It(){try{const Q=dt(),[xe,be]=await Promise.all([Q.listWorkspaces().catch(()=>[]),Q.getFsHome().catch(()=>({home:"",recentRoots:[]}))]);e.workspaces=Ut(xe),e.fsHome=be.home||null,e.recentRoots=be.recentRoots}catch{}}function Ut(Q){const xe=zf();return Object.keys(xe).length===0?Q:Q.map(be=>{const Oe=xe[be.root];return Oe!==void 0?{...be,name:Oe}:be})}function ht(Q){e.activeWorkspaceId=Q,Z(Q)}function un(Q){ht(Q);const xe=e.sessions.filter(be=>S(be)===Q);if(xe.length>0){const be=xe[0];be&&be.id!==e.activeSessionId&&An(be.id)}else g(void 0),qn(void 0,"push")}function dn(Q){const xe=zf()[Q.root],be=xe!==void 0?{...Q,name:xe}:Q,Oe=Fi(be.root);e.hiddenWorkspaceRoots.some(Ct=>Fi(Ct)===Oe)&&(e.hiddenWorkspaceRoots=e.hiddenWorkspaceRoots.filter(Ct=>Fi(Ct)!==Oe),K(e.hiddenWorkspaceRoots));const Ye=e.workspaces.findIndex(Ct=>Ct.id===be.id||Ct.root===be.root);if(Ye===-1){e.workspaces=[be,...e.workspaces];return}const st=[...e.workspaces];st[Ye]=be,e.workspaces=st}function ns(Q){if(Q.type==="workspaceCreated"||Q.type==="workspaceUpdated"){dn(Q.workspace);return}const xe=e.workspaces.find(Oe=>Oe.id===Q.workspaceId)?.root??Q.root;if(xe&&!e.hiddenWorkspaceRoots.includes(xe)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,xe],K(e.hiddenWorkspaceRoots)),e.workspaces=e.workspaces.filter(Oe=>Oe.id!==Q.workspaceId&&Oe.root!==xe),e.activeWorkspaceId===Q.workspaceId||e.activeWorkspaceId===xe){const Oe=E.value[0]?.id??null;if(e.activeWorkspaceId=Oe,Oe)Z(Oe);else try{Na(Ft.activeWorkspace)}catch{}g(void 0),e.sessionLoading=!1,ie(),qn(void 0,"replace")}}function Wt(){g(void 0),qn(void 0,"push")}function Hn(Q){ht(Q),Wt(),ie()}async function lo(Q){const xe=L.value.find(wn=>wn.id===Q);if(!xe)return null;const be=e.thinking,Oe=dt();let Ye,st=xe.root;try{const wn=await Oe.addWorkspace({root:xe.root});Ye=wn.id,st=wn.root,dn(wn)}catch{}const Ct=r.draftModel.value??void 0,Ot=await Oe.createSession({workspaceId:Ye,cwd:st,model:Ct});r.draftModel.value=null;const uo=Ct!==void 0&&(!Ot.model||Ot.model.length===0)?{...Ot,model:Ct}:Ot;f(uo),ht(Ot.workspaceId??Ye??Q),await An(Ot.id);const jt=Ot.id;return be!==void 0&&(e.thinkingBySession={...e.thinkingBySession,[jt]:be}),H.planMode&&(e.planModeBySession={...e.planModeBySession,[jt]:!0},D()),H.swarmMode&&(e.swarmModeBySession={...e.swarmModeBySession,[jt]:!0},B()),H.goalMode&&(e.goalModeBySession={...e.goalModeBySession,[jt]:!0},U()),H.planMode=!1,H.swarmMode=!1,H.goalMode=!1,jt}async function it(Q,xe,be){if(!Yi.has(Q)){Yi.add(Q);try{const Oe=await lo(Q);if(!Oe)return;await Mn(Oe,xe,be)}catch(Oe){l("startSessionAndSendPrompt",Oe)}finally{Yi.delete(Q)}}}async function Gn(Q,xe,be){if(!Yi.has(Q)){Yi.add(Q);try{const Oe=await lo(Q);if(!Oe)return;const Ye=e.planModeBySession[Oe]??!1,st=e.swarmModeBySession[Oe]??!1,Ct=e.sessions.find(jt=>jt.id===Oe),Ot=(Ct?.model&&Ct.model.length>0?Ct.model:e.defaultModel)??void 0;if(!await x({model:Ot,planMode:Ye,swarmMode:st,permissionMode:e.permission},Oe))return;await r.activateSkill(xe,be,Oe)}catch(Oe){l("startSessionAndActivateSkill",Oe)}finally{Yi.delete(Q)}}}async function ao(Q,xe){if(!Yi.has(Q)){Yi.add(Q);try{const be=await lo(Q);if(!be)return;await i.openSideChatOn(be,xe)}catch(be){l("startSessionAndOpenSideChat",be)}finally{Yi.delete(Q)}}}async function Yn(Q){const xe=Q.trim();if(!xe)return!1;const be=dt();try{const Oe=await be.addWorkspace({root:xe});return dn(Oe),Hn(Oe.id),!0}catch(Oe){return console.warn("[kimi-web] addWorkspaceByPath failed for",xe,Oe),!1}}async function go(Q){try{return await dt().browseFs(Q)}catch{return{path:"",parent:null,entries:[]}}}async function os(){try{return await dt().getFsHome()}catch{return{home:"",recentRoots:[]}}}function qn(Q,xe){if(xe==="none"||typeof window>"u"||!window.history)return;const be=ume(Q);if(window.location.pathname!==be)try{xe==="push"?window.history.pushState(null,"",be):window.history.replaceState(null,"",be)}catch{}}async function to(Q){try{const xe=await dt().getSession(Q);return e.sessions.some(be=>be.id===xe.id)||h(xe),!0}catch{return!1}}function vn(){const Q=e4(window.location);if(Q===void 0){g(void 0);return}if(Q!==e.activeSessionId){if(e.sessions.some(xe=>xe.id===Q)){An(Q,{urlMode:"none"});return}(async()=>{if(await to(Q)){await An(Q,{urlMode:"none"});return}const xe=e.sessions[0];xe?await An(xe.id,{urlMode:"replace"}):(g(void 0),qn(void 0,"replace"))})()}}let Zn=!1;function xn(){Zn||typeof window>"u"||(Zn=!0,window.addEventListener("popstate",vn))}async function An(Q,xe){const be=A(Q),Oe=!be&&c.has(Q);c.delete(Q);try{qn(Q,xe?.urlMode??"push"),e.sessionLoading=!be&&!Oe,g(Q),X(),e.unreadBySession[Q]&&(e.unreadBySession={...e.unreadBySession,[Q]:!1},P({[Q]:!1})),ie();const Ye=e.sessions.find(st=>st.id===Q);if(Ye){const st=S(Ye);e.activeWorkspaceId!==st&&ht(st)}if(be){if(await k(Q)==="not-found")return}else if(await y(Q)==="not-found")return;z(Q)}catch(Ye){l("selectSession",Ye,{sessionId:Q})}finally{e.activeSessionId===Q&&(e.sessionLoading=!1)}}async function Mn(Q,xe,be){const Oe=ey(Q);e.inFlightBySession={...e.inFlightBySession,[Q]:!0};const Ye=v();try{const st=dt(),Ct=[];xe&&Ct.push({type:"text",text:xe});for(const Vt of be??[])Vt.kind==="video"?Ct.push({type:"video",source:{kind:"file",fileId:Vt.fileId}}):Vt.kind==="file"?Ct.push({type:"file",fileId:Vt.fileId,name:Vt.name??"",mediaType:Vt.mediaType||"application/octet-stream",size:Vt.size??0}):Ct.push({type:"image",source:{kind:"file",fileId:Vt.fileId}});if(Ct.length===0)return e.inFlightBySession={...e.inFlightBySession,[Q]:!1},"rejected";const Ot={id:Ye,sessionId:Q,role:"user",content:Ct,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};b(Q,Vt=>[...Vt,Ot]);const uo=e.sessions.find(Vt=>Vt.id===Q),jt=(uo?.model&&uo.model.length>0?uo.model:e.defaultModel)??void 0,wn=e.planModeBySession[Q]??!1,ls=e.swarmModeBySession[Q]??!1,Mt=e.goalModeBySession[Q]??!1;if(Mt&&xe)try{await st.updateSession(Q,{goalObjective:xe.trim()})}catch(Vt){return l("createGoal",Vt,{sessionId:Q}),e.inFlightBySession={...e.inFlightBySession,[Q]:!1},b(Q,fo=>fo.some(oo=>oo.id===Ye)?fo.filter(oo=>oo.id!==Ye):fo),"rejected"}const Nt=await st.submitPrompt(Q,{content:Ct,model:jt,thinking:await r.resolveThinkingForPrompt(Q,jt)??e.thinking,permissionMode:e.permission,planMode:wn,swarmMode:ls});return Mt&&(e.goalModeBySession={...e.goalModeBySession,[Q]:!1},U()),e.promptIdBySession={...e.promptIdBySession,[Q]:Nt.promptId},b(Q,Vt=>{const fo=Vt.findIndex(zi=>zi.id===Ye);if(fo===-1)return Vt;const oo=[...Vt];return oo[fo]={...oo[fo],promptId:oo[fo].promptId??Nt.promptId},oo}),m()?.bindNextPromptId(Q,Nt.promptId),"ok"}catch(st){return e.inFlightBySession={...e.inFlightBySession,[Q]:!1},b(Q,Ct=>Ct.some(Ot=>Ot.id===Ye)?Ct.filter(Ot=>Ot.id!==Ye):Ct),l("sendPrompt",st,{sessionId:Q}),vi(st)?"rejected":"uncertain"}finally{ty(Q,Oe)}}async function Do(Q,xe){const be=e.activeSessionId;if(be){if(a.value!=="idle"||e.inFlightBySession[be]){kt(Q,xe);return}if((e.queuedBySession[be]?.length??0)>0){kt(Q,xe),Ht(be);return}await Mn(be,Q,xe)}}async function ze(Q,xe){const be=e.activeSessionId;if(!be)return;const Oe=e.queuedBySession[be]??[],Ye=[],st=[];for(const Nt of Oe){const Vt=Nt.text.trim();Vt&&Ye.push(Vt),Nt.attachments?.length&&st.push(...Nt.attachments)}const Ct=Q.trim();if(Ct&&Ye.push(Ct),xe?.length&&st.push(...xe),Ye.length===0&&st.length===0)return;Oe.length>0&&(e.queuedBySession={...e.queuedBySession,[be]:[]});const Ot=Ye.join(`
303
+
304
+ `),uo=()=>{if(Oe.length===0)return;const Nt=e.queuedBySession[be]??[];e.queuedBySession={...e.queuedBySession,[be]:[...Oe,...Nt]}};if(a.value==="idle"&&!e.inFlightBySession[be]){await Mn(be,Ot,st)==="rejected"&&uo();return}const jt=[];Ot&&jt.push({type:"text",text:Ot});for(const Nt of st)Nt.kind==="video"?jt.push({type:"video",source:{kind:"file",fileId:Nt.fileId}}):Nt.kind==="file"?jt.push({type:"file",fileId:Nt.fileId,name:Nt.name??"",mediaType:Nt.mediaType||"application/octet-stream",size:Nt.size??0}):jt.push({type:"image",source:{kind:"file",fileId:Nt.fileId}});const wn=v(),ls={id:wn,sessionId:be,role:"user",content:jt,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};b(be,Nt=>[...Nt,ls]);const Mt=ey(be);try{const Nt=dt(),Vt=e.sessions.find(zi=>zi.id===be),fo=(Vt?.model&&Vt.model.length>0?Vt.model:e.defaultModel)??void 0,oo=await Nt.submitPrompt(be,{content:jt,model:fo,thinking:await r.resolveThinkingForPrompt(be,fo)??e.thinking,permissionMode:e.permission,planMode:e.planModeBySession[be]??!1,swarmMode:e.swarmModeBySession[be]??!1});if(b(be,zi=>{const Ul=zi.findIndex(lf=>lf.id===wn);if(Ul===-1)return zi;const ql=[...zi];return ql[Ul]={...ql[Ul],promptId:ql[Ul].promptId??oo.promptId},ql}),oo.status!=="queued"){e.promptIdBySession={...e.promptIdBySession,[be]:oo.promptId},m()?.bindNextPromptId(be,oo.promptId);return}try{await Nt.steerPrompts(be,[oo.promptId])}catch{}}catch(Nt){b(be,Vt=>Vt.filter(fo=>fo.id!==wn)),vi(Nt)&&uo(),l("steer",Nt,{sessionId:be})}finally{ty(be,Mt)}}async function Xe(Q,xe){try{const Oe=await dt().uploadFile({file:Q,name:xe});return{fileId:Oe.id,name:Oe.name,mediaType:Oe.mediaType}}catch(be){return l("uploadImage",be),null}}function kt(Q,xe){const be=e.activeSessionId;if(!be)return;const Oe=e.queuedBySession[be]??[],Ye={text:Q,attachments:xe,id:bme()};e.queuedBySession={...e.queuedBySession,[be]:[...Oe,Ye]}}function Ht(Q){const[xe,...be]=e.queuedBySession[Q]??[];xe!==void 0&&(e.queuedBySession={...e.queuedBySession,[Q]:be},Mn(Q,xe.text,xe.attachments).then(Oe=>{if(Oe==="ok"){da.delete(Q);return}if(Oe==="uncertain"){da.delete(Q);return}if(!e.sessions.some(uo=>uo.id===Q)){da.delete(Q);return}const Ye=xe.id??xe.text,st=da.get(Q),Ct=st!==void 0&&st.key===Ye?st.count+1:1;if(Ct>=kme){da.delete(Q),(e.queuedBySession[Q]?.length??0)>0&&Ht(Q);return}da.set(Q,{key:Ye,count:Ct});const Ot=e.queuedBySession[Q]??[];e.queuedBySession={...e.queuedBySession,[Q]:[xe,...Ot]}}))}function Rn(Q,xe){const be=e.inFlightBySession[Q]===!0;if(e.inFlightBySession={...e.inFlightBySession,[Q]:!1},e.promptIdBySession[Q]!==void 0){const Ye={...e.promptIdBySession};delete Ye[Q],e.promptIdBySession=Ye}return Q===e.activeSessionId&&X(),(be||xe?.turnWasActive===!0||(e.turnActiveBySession[Q]??!1))&&Ht(Q),be}function sn(Q,xe){xe.inFlightTurn!==null&&xe.busy||Rn(Q)}async function Gt(){const Q=e.activeSessionId;if(!Q)return;const xe=e.sessions.find(Ye=>Ye.id===Q);let be=e.promptIdBySession[Q];if(be===void 0){const Ye=xe?.currentPromptId;Ye!==void 0&&Ye.length>0&&!Ye.startsWith("pr_")&&(be=Ye)}const Oe=dt();if(be!==void 0)try{if((await Oe.abortPrompt(Q,be)).aborted)return;const st={...e.promptIdBySession};delete st[Q],e.promptIdBySession=st}catch(Ye){if(vi(Ye)&&Ye.code===fme){const st={...e.promptIdBySession};delete st[Q],e.promptIdBySession=st}else{l("abortCurrentPrompt",Ye,{sessionId:Q});return}}try{await Oe.abortSession(Q)}catch(Ye){l("abortCurrentPrompt",Ye,{sessionId:Q})}}function Wn(Q,xe){const be=e.approvalsBySession[Q]??[];e.approvalsBySession={...e.approvalsBySession,[Q]:be.filter(Oe=>Oe.approvalId!==xe)}}function En(Q,xe){const be=e.questionsBySession[Q]??[];e.questionsBySession={...e.questionsBySession,[Q]:be.filter(Oe=>Oe.questionId!==xe)}}async function St(Q,xe){const be=e.activeSessionId;if(be&&!hh[Q]){hh[Q]=!0;try{const Oe=dt(),Ye={decision:xe.decision,scope:xe.scope,feedback:xe.feedback,selectedLabel:xe.selectedLabel};await Oe.respondApproval(be,Q,Ye),Wn(be,Q)}catch(Oe){bg(Oe)?Wn(be,Q):l("respondApproval",Oe,{sessionId:be})}finally{delete hh[Q]}}}async function Po(Q,xe){const be=e.activeSessionId;if(be&&!ca[Q]){ca[Q]="answer";try{await dt().respondQuestion(be,Q,xe),En(be,Q)}catch(Oe){bg(Oe)?En(be,Q):l("respondQuestion",Oe,{sessionId:be})}finally{delete ca[Q]}}}async function Ao(Q){const xe=e.activeSessionId;if(xe&&!ca[Q]){ca[Q]="dismiss";try{await dt().dismissQuestion(xe,Q),En(xe,Q)}catch(be){bg(be)?En(xe,Q):l("dismissQuestion",be,{sessionId:xe})}finally{delete ca[Q]}}}async function ss(Q){const xe=e.activeSessionId;if(xe&&!xg[Q]){xg[Q]=!0;try{const be=dt(),Oe=(e.tasksBySession[xe]??[]).find(st=>st.id===Q)?.backgroundTaskId;await be.cancelTask(xe,Oe??Q);const Ye=e.tasksBySession[xe]??[];e.tasksBySession={...e.tasksBySession,[xe]:Ye.map(st=>st.id===Q?{...st,status:"cancelled"}:st)}}catch(be){vme(be)||l("cancelTask",be,{sessionId:xe})}finally{delete xg[Q]}}}function Tn(Q){const xe=e.activeSessionId;xe?(e.planModeBySession={...e.planModeBySession,[xe]:Q},D(),x({planMode:Q})):H.planMode=Q}function jn(){const Q=e.activeSessionId,xe=Q?e.planModeBySession[Q]??!1:H.planMode;Tn(!xe)}function Ps(Q){const xe=e.activeSessionId;xe?(e.swarmModeBySession={...e.swarmModeBySession,[xe]:Q},B(),x({swarmMode:Q})):H.swarmMode=Q}async function ti(){const Q=e.activeSessionId,be=!(Q?e.swarmModeBySession[Q]??!1:H.swarmMode);be&&e.permission==="manual"&&!await o({title:n("workspace.swarmEnableConfirm"),variant:"primary"})||Ps(be)}function Io(Q){const xe=e.activeSessionId;xe?(e.goalModeBySession={...e.goalModeBySession,[xe]:Q},U()):H.goalMode=Q}function Ss(){const Q=e.activeSessionId,xe=Q?e.goalModeBySession[Q]??!1:H.goalMode;Io(!xe)}async function Wi(Q){const xe=Q.trim();if(!xe||e.permission==="manual"&&!await o({title:n("workspace.goalStartConfirm",{objective:xe}),variant:"primary"}))return;let be=e.activeSessionId;if(!be){const Oe=e.activeWorkspaceId,Ye=Oe&&E.value.some(st=>st.id===Oe)?Oe:E.value[0]?.id??null;if(!Ye)return;try{be=await lo(Ye)??void 0}catch(st){l("createGoal",st);return}if(!be)return}try{await dt().updateSession(be,{goalObjective:xe})}catch(Oe){l("createGoal",Oe,{sessionId:be,message:V(Oe)});return}e.goalModeBySession[be]&&(e.goalModeBySession={...e.goalModeBySession,[be]:!1},U()),e.activeSessionId===be?await Do(xe):await Mn(be,xe)}function Si(Q){const xe=e.activeSessionId;xe&&Promise.resolve(dt().updateSession(xe,{goalControl:Q})).catch(be=>{l("controlGoal",be,{sessionId:xe,message:V(be)})})}function co(Q){e.permission=Q,N(Q),x({permissionMode:Q})}function ni(Q){const xe=[...e.warnings];xe.splice(Q,1),e.warnings=xe}async function Ci(Q,xe){try{await dt().updateSession(Q,{title:xe}),d(Q,Oe=>({...Oe,title:xe}))}catch(be){l("renameSession",be,{sessionId:Q})}}async function ar(Q,xe){const be=e.workspaces.find(Ye=>Ye.id===Q)?.root,Oe=()=>{e.workspaces=e.workspaces.map(Ye=>Ye.id===Q?{...Ye,name:xe}:Ye)};try{if(await dt().updateWorkspace(Q,{name:xe}),be!==void 0){const Ye=zf();be in Ye&&(delete Ye[be],ew(Ye))}Oe()}catch(Ye){if(be!==void 0&&vi(Ye)&&Ye.code===hme){ew({...zf(),[be]:xe}),Oe();return}l("renameWorkspace",Ye)}}async function no(Q){const xe=e.workspaces.find(st=>st.id===Q)?.root??L.value.find(st=>st.id===Q)?.root??Q,be=e.activeSessionId?e.sessions.find(st=>st.id===e.activeSessionId):void 0,Oe=e.activeWorkspaceId===Q||e.activeWorkspaceId===xe,Ye=!!(be&&(be.cwd===xe||be.workspaceId===Q||S(be)===Q));xe&&!e.hiddenWorkspaceRoots.includes(xe)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,xe],K(e.hiddenWorkspaceRoots));try{await dt().deleteWorkspace(Q)}catch(st){console.warn("[kimi-web] deleteWorkspace registry cleanup failed for",Q,st)}if(e.workspaces=e.workspaces.filter(st=>st.id!==Q&&st.root!==xe),Oe||Ye){const st=E.value[0]?.id??null;if(e.activeWorkspaceId=st,st)Z(st);else try{Na(Ft.activeWorkspace)}catch{}}(Oe||Ye)&&(g(void 0),e.sessionLoading=!1,ie(),qn(void 0,"replace"))}async function is(Q){try{await dt().archiveSession(Q),p(Q),i.clearSideChatForSession(Q);const{[Q]:be,...Oe}=e.sideChatUserMessageIdsBySession;if(e.sideChatUserMessageIdsBySession=Oe,e.activeSessionId===Q){const Ye=e.sessions[0];Ye?await An(Ye.id,{urlMode:"replace"}):(g(void 0),qn(void 0,"replace"))}}catch(xe){l("archiveSession",xe,{sessionId:Q})}}async function rs(Q){if(Ie)return;const xe=Q??e.activeSessionId;if(!xe){const Oe=n("commands.export.noSession");ko("export:failed",{status:"no-session"}),l("exportSession",new Error(Oe),{message:Oe});return}Ie=!0;const be=Date.now();ko("export:start",{sessionId:xe});try{const Oe=Zte(),{blob:Ye,fileName:st}=await dt().exportSession(xe,Oe);if(typeof document>"u")throw new Error("Document is unavailable");const Ct=URL.createObjectURL(Ye);let Ot;try{Ot=document.createElement("a"),Ot.href=Ct,Ot.download=st,document.body.append(Ot),Ot.click()}finally{Ot?.remove(),setTimeout(()=>{try{URL.revokeObjectURL(Ct)}catch{}},0)}ko("export:accepted",{sessionId:xe,status:"accepted",zipBytes:Ye.size,durationMs:Date.now()-be})}catch(Oe){const Ye=typeof Oe=="object"&&Oe!==null?Oe:void 0;ko("export:failed",{sessionId:xe,status:"failed",durationMs:Date.now()-be,errorName:typeof Ye?.name=="string"?Ye.name:typeof Oe,errorCode:typeof Ye?.code=="number"?Ye.code:void 0,requestId:typeof Ye?.requestId=="string"?Ye.requestId:void 0,phase:typeof Ye?.phase=="string"?Ye.phase:void 0,httpStatus:typeof Ye?.status=="number"?Ye.status:void 0}),l("exportSession",Oe,{sessionId:xe})}finally{Ie=!1}}async function Lo(Q){try{const xe=await dt().restoreSession(Q);return f(xe),!0}catch(xe){return l("restoreSession",xe,{sessionId:Q}),!1}}function Ai(Q){return dt().listSessions({archivedOnly:!0,beforeId:Q?.beforeId,pageSize:Q?.pageSize??50})}async function zn(){try{await dt().logout(),await ee(),await gt()}catch(Q){l("logout",Q)}}function $o(Q){const xe=e.activeSessionId;xe&&dt().compactSession(xe,Q).catch(be=>{l("compact",be,{sessionId:xe})})}async function oi(Q){const xe=Q??e.activeSessionId;if(xe)try{const be=await dt().forkSession(xe);f(be),await An(be.id)}catch(be){l("fork",be,{sessionId:xe})}}async function Ue(Q=1){const xe=e.activeSessionId;if(!xe)return null;const be=(()=>{const Oe=e.messagesBySession[xe]??[];for(let Ye=Oe.length-1;Ye>=0;Ye--){const st=Oe[Ye];if(st.role==="user"&&!(st.metadata?.origin&&st.metadata.origin.kind!=="user"))return st.content.filter(Ct=>Ct.type==="text").map(Ct=>Ct.text).join(`
305
+ `)}return null})();try{return await dt().undoSession(xe,Q),await y(xe),be}catch(Oe){return l("undo",Oe,{sessionId:xe}),null}}function Fe(Q){const xe=e.activeSessionId;if(!xe)return;const be=e.queuedBySession[xe]??[];if(Q<0||Q>=be.length)return;const Oe=[...be];Oe.splice(Q,1),e.queuedBySession={...e.queuedBySession,[xe]:Oe}}function oe(Q,xe){const be=e.activeSessionId;if(!be)return;const Oe=e.queuedBySession[be]??[];if(Q===xe||Q<0||Q>=Oe.length||xe<0||xe>=Oe.length)return;const Ye=[...Oe],[st]=Ye.splice(Q,1);st!==void 0&&(Ye.splice(xe,0,st),e.queuedBySession={...e.queuedBySession,[be]:Ye})}async function Te(Q){const xe=e.activeSessionId;if(!xe)return[];try{return(await dt().listDirectory(xe,{path:Q,includeGitStatus:!0})).items}catch{return[]}}async function pe(Q){const xe=e.activeSessionId;if(!xe)return null;try{const Oe=await dt().readFile(xe,{path:Q});return{path:Oe.path,content:Oe.content,encoding:Oe.encoding,mime:Oe.mime,languageId:Oe.languageId,isBinary:Oe.isBinary,size:Oe.size,lineCount:Oe.lineCount}}catch(be){return console.warn("[kimi-web] readFileContent failed for",Q,be),null}}const _e=10485760;function He(Q){const xe=e.activeSessionId;return xe?dt().getFileDownloadUrl(xe,Q):null}async function Rt(Q,xe){const be=e.activeSessionId;if(!be)return!1;try{return await dt().openFile(be,{path:Q,line:xe}),!0}catch(Oe){return l("openFile",Oe,{sessionId:be}),!1}}async function Dt(Q){const xe=e.activeSessionId;if(!xe)return;const be=F.value.cwd||".";try{await dt().openInApp(xe,Q,be)}catch(Oe){l("openInApp",Oe,{sessionId:xe})}}async function rn(Q){const xe=e.activeSessionId;if(!xe)return!1;try{return await dt().revealFile(xe,{path:Q}),!0}catch(be){return l("revealFile",be,{sessionId:xe}),!1}}async function Un(Q){if(/^(https?:|data:|blob:)/i.test(Q))return Q;const xe=e.activeSessionId;if(!xe)return Q;let be=Q;if(be.startsWith("/")){const Oe=e.sessions.find(Ye=>Ye.id===xe)?.cwd;if(Oe&&(be===Oe||be.startsWith(Oe.endsWith("/")?Oe:`${Oe}/`))){if(be=be.slice(Oe.length).replace(/^\//,""),!be)return Q}else return Q}try{const Ye=await dt().readFile(xe,{path:be,length:_e});return!Ye.isBinary||Ye.encoding!=="base64"||Ye.truncated?Q:`data:${Ye.mime};base64,${Ye.content}`}catch{return Q}}async function Cs(Q){const xe=e.activeSessionId;if(!xe)return[];try{return(await dt().searchFiles(xe,{query:Q,limit:20})).items.map(Ye=>({path:Ye.path,name:Ye.name}))}catch{return[]}}return{loadFileDiff:ae,clearFileDiff:ie,loadGitStatus:q,checkAuth:ee,loadConfig:fe,updateConfig:ve,listAllSessionsGlobal:Ae,load:gt,refreshServerMeta:_t,loadWorkspaces:It,loadMoreSessions:et,loadAllSessions:rt,selectWorkspace:ht,openWorkspace:un,upsertWorkspacePreserveOrder:dn,applyWorkspaceEvent:ns,clearActiveSession:Wt,openWorkspaceDraft:Hn,startSessionAndSendPrompt:it,startSessionAndActivateSkill:Gn,startSessionAndOpenSideChat:ao,addWorkspaceByPath:Yn,browseFs:go,getFsHome:os,writeSessionUrl:qn,fetchSessionIntoList:to,onSessionRoutePopState:vn,bindSessionRoute:xn,selectSession:An,submitPromptInternal:Mn,finishPromptLocal:Rn,localTurnStartState:xme,isLocalTurnSnapshotCurrent:_me,afterLocalTurnStartsSettle:Sme,handleSessionSnapshot:sn,sendPrompt:Do,steerPrompt:ze,uploadImage:Xe,enqueue:kt,unqueue:Fe,reorderQueue:oe,abortCurrentPrompt:Gt,respondApproval:St,respondQuestion:Po,dismissQuestion:Ao,pendingQuestionActions:ca,pendingApprovalActions:hh,cancelTask:ss,setPlanMode:Tn,togglePlanMode:jn,setSwarmMode:Ps,toggleSwarmMode:ti,setGoalMode:Io,toggleGoalMode:Ss,createGoal:Wi,controlGoal:Si,setPermission:co,dismissWarning:ni,renameSession:Ci,renameWorkspace:ar,deleteWorkspace:no,archiveSession:is,exportSession:rs,restoreSession:Lo,loadArchivedSessions:Ai,logout:zn,compact:$o,forkSession:oi,undo:Ue,listDir:Te,readFileContent:pe,getFileDownloadUrl:He,openWorkspaceFile:Rt,openInApp:Dt,revealWorkspaceFile:rn,resolveImageUrl:Un,searchFiles:Cs,loadOlderMessages:le,refreshSessionSidecars:z,isStartingFirstPrompt:()=>Yi.size>0}}const j5=Ft.starredModels,n4=new Error("profile persist failed");function Ame(){try{const e=mo(j5);if(!e)return[];const t=JSON.parse(e);if(Array.isArray(t)&&t.every(n=>typeof n=="string"))return t}catch{}return[]}function Mme(e){try{So(j5,JSON.stringify(e))}catch{}}function Eme(e,t){const{pushOperationFailure:n,refreshSessionStatus:o,persistSessionProfile:s,activity:i,updateSession:r,updateSessionMessages:l}=t,a=J([]),c=J(Ame()),u=J({}),d=J({}),f=J([]),h=J(null);function p(V){if(!(V==null||V.length===0))return a.value.find(X=>X.id===V)??a.value.find(X=>X.model===V)}function g(){const V=e.activeSessionId?e.sessions.find(he=>he.id===e.activeSessionId):void 0,X=V===void 0?h.value??e.defaultModel:V.model||e.defaultModel;return p(X)?.id??X??void 0}function b(V){if(V===void 0)return;const X=p(V);return X===void 0?void 0:Pd(X)}function v(V,X){const he=V==null?void 0:e.thinkingBySession[V];return he!==void 0&&bre(X,he)?he:Pd(X)}function m(V,X){if(X===void 0)return;const he=p(X);return he===void 0?void 0:v(V,he)}async function y(V,X){return V!=null&&e.thinkingBySession[V]===void 0&&await o(V),m(V,X)}function k(V){e.thinking=V;const X=e.activeSessionId;return V!==void 0&&X!==null&&X!==void 0&&(e.thinkingBySession={...e.thinkingBySession,[X]:V}),V}Qe([()=>e.activeSessionId,()=>g(),()=>{const V=e.activeSessionId;return V==null?void 0:e.thinkingBySession[V]}],()=>{const V=p(g());V!==void 0&&(e.thinking=v(e.activeSessionId,V))});function A(V){dt().setConfig({thinking:xre(V,p(g())?.supportEfforts)}).catch(X=>n("setConfig",X))}async function $(V){try{const he=await dt().listSkills(V);u.value={...u.value,[V]:he}}catch{}}async function I(V){try{const he=await dt().listSkillsForWorkspace(V);d.value={...d.value,[V]:he}}catch{}}async function x(){try{const V=dt();a.value=await V.listModels();const X=p(g());X!==void 0&&(e.thinking=v(e.activeSessionId,X))}catch(V){n("loadModels",V)}}async function L(){try{const V=dt();f.value=await V.listProviders()}catch(V){n("loadProviders",V)}}async function E(V){const X=e.activeSessionId,he=p(V),ne=e.thinking,ue=X?e.sessions.find(Ie=>Ie.id===X)?.model:void 0,de=g()!==(he?.id??V),Ce=wre(he,ne,de);if(!X)return h.value=V,e.thinking=Ce,Ce!==ne&&Ce!==void 0&&A(Ce),!0;r(X,Ie=>({...Ie,model:V})),Ce!==ne&&(e.thinking=Ce,Ce!==void 0&&(e.thinkingBySession={...e.thinkingBySession,[X]:Ce}));try{await dt().updateSession(X,{model:V,thinking:Ce!==ne?Ce:void 0})}catch(Ie){return r(X,le=>({...le,model:ue??le.model})),Ce!==ne&&(e.thinking=ne,ne!==void 0&&(e.thinkingBySession={...e.thinkingBySession,[X]:ne})),n("setModel",Ie,{sessionId:X}),!1}return Ce!==ne&&Ce!==void 0&&A(Ce),await o(X),!0}function F(V){const X=new Set(c.value);X.has(V)?X.delete(V):X.add(V),c.value=Array.from(X),Mme(c.value)}async function S(V,X,he){const ne=he??e.activeSessionId;if(!ne)return;const ue=i.value==="idle"&&!e.inFlightBySession[ne],de=`msg_skill_opt_${Date.now().toString(36)}`,Ce=ue?ey(ne):void 0;if(ue){e.inFlightBySession={...e.inFlightBySession,[ne]:!0};const Ie={id:de,sessionId:ne,role:"user",content:[{type:"text",text:`/${V}${X?` ${X}`:""}`}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0,origin:{kind:"skill_activation",trigger:"user-slash",skillName:V,skillArgs:X}}};l(ne,le=>[...le,Ie])}try{const Ie=e.sessions.find(ae=>ae.id===ne)?.model,le=(Ie&&Ie.length>0?Ie:e.defaultModel)??void 0;if(!await s({thinking:await y(ne,le)??e.thinking},ne))throw n4;await dt().activateSkill(ne,V,X)}catch(Ie){ue&&(e.inFlightBySession={...e.inFlightBySession,[ne]:!1},l(ne,le=>le.filter(z=>z.id!==de))),Ie!==n4&&n("activateSkill",Ie,{sessionId:ne})}finally{Ce!==void 0&&ty(ne,Ce)}}async function N(V){try{await dt().addProvider(V),await Promise.all([L(),x()])}catch(X){n("addProvider",X)}}async function D(V){try{await dt().deleteProvider(V),await Promise.all([L(),x()])}catch(X){n("deleteProvider",X)}}async function B(V){try{const X=await dt().refreshProvider(V);for(const he of X.failed)n("refreshProvider",new Error(he.reason),{message:he.provider});await Promise.all([L(),x()])}catch(X){n("refreshProvider",X)}}async function U(){try{const V=await dt().refreshAllProviders();for(const X of V.failed)n("refreshAllProviders",new Error(X.reason),{message:X.provider});await Promise.all([L(),x()])}catch(V){n("refreshAllProviders",V)}}async function H(){try{return await dt().startOAuthLogin()}catch{return null}}async function P(){try{return await dt().pollOAuthLogin()}catch(V){return console.warn("[kimi-web] pollOAuthLogin failed",V),null}}async function Z(){try{await dt().cancelOAuthLogin()}catch{}}function K(V){const X=k(V);s({thinking:X}),X!==void 0&&A(X)}return{models:a,starredModelIds:c,providers:f,draftModel:h,skillsBySession:u,skillsByWorkspace:d,loadSkillsForSession:$,loadSkillsForWorkspace:I,loadModels:x,loadProviders:L,setModel:E,thinkingLevelForModelId:b,thinkingLevelForSessionId:m,resolveThinkingForPrompt:y,toggleStarModel:F,activateSkill:S,addProvider:N,deleteProvider:D,refreshProvider:B,refreshAllProviders:U,startOAuthLogin:H,pollOAuthLogin:P,cancelOAuthLogin:Z,setThinking:K}}const V5="kimiWeb.compaction",Tme=/^read[_-]?media(?:file)?$/i,Nme=/^data:([^;]+);base64,(.*)$/s,Ime=/^<(image|video|audio)\s+path="([^"]+)">$/,Lme=/^<(image|video|audio)\s+path="([^"]+)">(?:<\/\1>)?$/,$me=/Mime type:\s*([^.\s]+)/i,Fme=/Size:\s*(\d+)\s*bytes/i,Ome=/Original dimensions:\s*(\d+)x(\d+)\s*pixels/i,Rme="<system>Image compressed to fit model limits:",Bme=/<system>Image compressed to fit model limits:[\s\S]*?<\/system>/g;function Dme(e){return e.includes(Rme)?e.replace(Bme,""):e}function Pme(e){return e.replaceAll("&quot;",'"').replaceAll("&lt;","<").replaceAll("&gt;",">").replaceAll("&amp;","&")}function Hme(e){const t=Lme.exec(e.trim());return t?{kind:t[1],path:Pme(t[2])}:null}const K5=/^f_(?:[0-9A-Za-z]{26}|[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})$/,Wme=/^f_(?:[0-9A-Za-z]{26}|[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})(?=-)/;function zme(e){const t=e.split(/[\\/]/).at(-1)??"",n=t.lastIndexOf("."),o=n>0?t.slice(0,n):t;return K5.test(o)?o:void 0}const Ume=/^Attached file "(.+)" \(([^,]+), (\d+) bytes\): (.+) — open it with the Read tool$/;function qme(e){const t=Ume.exec(e.trim());if(!t)return null;const n=(t[4]??"").split(/[\\/]/).at(-1)??"",o=Wme.exec(n)?.[0];return{name:t[1],mediaType:t[2],size:Number(t[3]),fileId:o!==void 0&&K5.test(o)?o:void 0}}function jme(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 Vme(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 Kme(e){const t=e.type,n=t==="image_url"?"image":t==="video_url"?"video":t==="audio_url"?"audio":null;if(n===null)return null;const s=e[n==="image"?"imageUrl":n==="video"?"videoUrl":"audioUrl"];if(typeof s!="object"||s===null)return null;const i=s.url;return typeof i=="string"?{kind:n,url:i}:null}function Gme(e,t){if(!Tme.test(e))return;const n=Vme(t);if(n===null)return;let o,s,i,r,l,a=null;for(const u of n){if(typeof u!="object"||u===null)continue;const d=u;if(d.type==="text"&&typeof d.text=="string"){const h=d.text,p=Ime.exec(h);p&&(s=p[1],o=p[2]);const g=$me.exec(h);g?.[1]&&(i=g[1]);const b=Fme.exec(h);b?.[1]&&(r=Number(b[1]));const v=Ome.exec(h);v?.[1]&&v[2]&&(l=`${v[1]}x${v[2]}`);continue}const f=Kme(d);f&&(a=f)}if(a===null)return;const c=Nme.exec(a.url);return c?.[1]&&(i=c[1]),c?.[2]&&(r=jme(c[2])),{kind:a.kind??s??"image",url:a.url,path:o,mimeType:i,bytes:Number.isFinite(r)?r:void 0,dimensions:l}}function Yme(e){if(e!=null){if(typeof e=="string")return e.split(`
306
+ `);if(Array.isArray(e)){const t=[];for(const n of e)if(typeof n=="string")t.push(...n.split(`
307
+ `));else if(n&&typeof n=="object"){const o=n;o.type==="text"&&typeof o.text=="string"?t.push(...o.text.split(`
308
+ `)):o.type==="think"&&typeof o.think=="string"?t.push(...o.think.split(`
309
+ `)):o.type==="image_url"||o.type==="image"?t.push("[image]"):typeof o.type=="string"?t.push(`[${o.type}]`):t.push(JSON.stringify(n))}return t.length>0?t:void 0}return[JSON.stringify(e)]}}function Zme(e){return{id:e.id,toolCallId:e.parentToolCallId,name:e.description,subagentType:e.subagentType,phase:e.subagentPhase??(e.status==="completed"?"completed":e.status==="failed"?"failed":"working"),status:e.status,summary:e.outputPreview,outputLines:e.outputLines,text:e.text,suspendedReason:e.suspendedReason,swarmIndex:e.swarmIndex}}function Qme(e,t){const n=e.split(`
310
+ `),o=t.split(`
311
+ `),s=[];return n.forEach((i,r)=>{s.push({kind:"rem",gutter:String(r+1),text:`- ${i}`})}),o.forEach((i,r)=>{s.push({kind:"add",gutter:String(r+1),text:`+ ${i}`})}),s}function Xme(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const o=typeof t.path=="string"?t.path:"";return Array.isArray(t.diff)?{kind:"diff",path:o,diff:t.diff}:typeof t.old_text=="string"&&typeof t.new_text=="string"?{kind:"diff",path:o,diff:Qme(t.old_text,t.new_text)}:{kind:"diff",path:o,diff:[]}}if(n==="shell"||n==="command")return{kind:"shell",command:typeof t.command=="string"?t.command:e.action,cwd:typeof t.cwd=="string"?t.cwd:void 0,danger:typeof t.danger=="string"?t.danger:void 0};if(n==="file_content"||n==="file")return{kind:"file",path:typeof t.path=="string"?t.path:"",content:typeof t.content=="string"?t.content:"",language:typeof t.language=="string"?t.language:void 0};if(n==="file_op"||n==="fileop")return{kind:"fileop",op:typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,path:typeof t.path=="string"?t.path:"",detail:typeof t.detail=="string"?t.detail:void 0};if(n==="url_fetch"||n==="url")return{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:typeof t.url=="string"?t.url:e.action};if(n==="search")return{kind:"search",query:typeof t.query=="string"?t.query:e.action,scope:typeof t.scope=="string"?t.scope:void 0};if(n==="invocation"||n==="agent_call"||n==="skill_call")return{kind:"invocation",kind2:typeof t.kind=="string"?t.kind:n,name:typeof t.name=="string"?t.name:e.toolName,description:typeof t.description=="string"?t.description:void 0};if(n==="todo"||n==="todo_list")return{kind:"todo",items:(Array.isArray(t.items)?t.items:[]).map(i=>{const r=i??{};return{title:typeof r.title=="string"?r.title:"",status:typeof r.status=="string"?r.status:"pending"}})};if(n==="plan_review"){const o=typeof t.plan=="string"?t.plan:"",s=typeof t.path=="string"?t.path:void 0,r=(Array.isArray(t.options)?t.options:[]).map(l=>{const a=l??{},c=typeof a.label=="string"?a.label:"";if(!c)return null;const u=typeof a.description=="string"?a.description:void 0;return{label:c,description:u}}).filter(l=>l!==null);return{kind:"plan_review",plan:o,path:s,options:r.length>0?r:void 0}}return{kind:"generic",summary:e.action}}function Jme(e){const t=`<prompt>
312
+ `,n=`
313
+ </prompt>`,o=e.indexOf(t),s=e.lastIndexOf(n);return o>=0&&s>=o+t.length?e.slice(o+t.length,s):e1e(e)}function e1e(e){const t=e.split(`
314
+ `);return t.length>=2&&t[0]?.startsWith("<cron-fire ")&&t.at(-1)==="</cron-fire>"?t.slice(1,-1).join(`
315
+ `):e}function t1e(e){const t=e.metadata?.origin;if(t?.kind==="cron_job"||t?.kind==="cron_missed")return t.kind}function n1e(e){const t=e.content.filter(n=>n.type==="text").map(n=>n.text).join(`
316
+ `);return Jme(t)}function o1e(e,t){const n=e.metadata?.origin??{},o=n1e(e);return t==="cron_missed"?{text:o,cron:{missedCount:typeof n.count=="number"?n.count:void 0}}:{text:o,cron:{jobId:typeof n.jobId=="string"?n.jobId:void 0,cron:typeof n.cron=="string"?n.cron:void 0,recurring:typeof n.recurring=="boolean"?n.recurring:void 0,coalescedCount:typeof n.coalescedCount=="number"?n.coalescedCount:void 0,stale:typeof n.stale=="boolean"?n.stale:void 0}}}function s1e(e,t,n){const{text:o,cron:s}=o1e(e,n);return{id:e.id,role:"cron",no:t,text:o,createdAt:e.createdAt,cron:s}}function i1e(e){const t=e.metadata?.origin,n=t?.kind;return n===void 0||n==="user"?!0:n==="skill_activation"||n==="plugin_command"?t?.trigger==="user-slash":!1}function r1e(e){return e.metadata?.origin?.kind==="compaction_summary"}function l1e(e,t){return e===null?!1:e.promptId===void 0||t===void 0||e.promptId===t}function a1e(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 c1e(e){let t="",n="";const o=[],s=[];for(const i of e)i.type==="text"?t+=i.text:i.type==="thinking"?n+=i.thinking:i.type==="toolUse"?o.push(i.toolCallId):s.push(JSON.stringify(i));return o.sort(),s.sort(),{text:t,thinking:n,toolIds:o,rest:s}}function u1e(e,t){return t.text!==""&&t.text!==e.text||t.thinking!==""&&t.thinking!==e.thinking?!1:t.toolIds.every(n=>e.toolIds.includes(n))&&t.rest.every(n=>e.rest.includes(n))}function G5(e,t,n,o=!0,s={}){const i=[];let r=1;const l=new Map;for(const h of t)l.set(h.toolCallId,h);let a=null;function c(h=!1){if(!a)return;const p=a;if(a=null,!h||!o)for(let g=0;g<p.tools.length;g++){const b=p.tools[g];if(b.status!=="running")continue;const v={...b,status:"ok"};p.tools[g]=v;const m=p.blocks.find(y=>y.kind==="tool"&&y.tool.id===v.id);m&&m.kind==="tool"&&(m.tool=v)}i.push({id:p.id,role:"assistant",no:r++,text:p.textParts.join(`
317
+ `),thinking:p.thinkingParts.length>0?p.thinkingParts.join(`
318
+ `):void 0,tools:p.tools.length>0?p.tools:void 0,blocks:p.blocks.length>0?p.blocks:void 0,approval:p.approval,approvalId:p.approvalId,durationMs:p.durationMs})}function u(h,p){for(const g of p)if(g.type==="text"){if(g.text){h.textParts.push(g.text);const b=h.blocks.at(-1);b&&b.kind==="text"?b.text+=`
319
+ `+g.text:h.blocks.push({kind:"text",text:g.text})}}else if(g.type==="thinking"){if(g.thinking){h.thinkingParts.push(g.thinking);const b=h.blocks.at(-1);b&&b.kind==="thinking"?b.thinking+=`
320
+ `+g.thinking:h.blocks.push({kind:"thinking",thinking:g.thinking})}}else if(g.type==="toolUse"){const b=l.get(g.toolCallId),v={id:g.toolCallId,name:g.toolName,arg:typeof g.input=="string"?g.input:JSON.stringify(g.input),status:"running",output:g.outputLines,planPath:g.toolName==="ExitPlanMode"?s[g.toolCallId]?.path:void 0};h.tools.push(v),h.blocks.push({kind:"tool",tool:v}),b&&(h.approval=Xme(b),h.approvalId=b.approvalId)}else if(g.type==="toolResult"){const b=h.tools.findIndex(v=>v.id===g.toolCallId);if(b!==-1){const v=h.tools[b],m={...v,status:g.isError?"error":"ok",output:Yme(g.output),media:g.isError?void 0:Gme(v.name,g.output)};m.name==="ExitPlanMode"&&!m.planPath&&(m.planPath=a1e(m.output)),h.tools[b]=m;const y=h.blocks.find(k=>k.kind==="tool"&&k.tool.id===g.toolCallId);y&&y.kind==="tool"&&(y.tool=m)}}}function d(h,p){for(const g of p){if(g.type!=="toolUse"||!g.outputLines?.length)continue;const b=h.tools.findIndex(k=>k.id===g.toolCallId);if(b===-1)continue;const v=h.tools[b];if(v.output!==void 0)continue;const m={...v,output:g.outputLines};h.tools[b]=m;const y=h.blocks.find(k=>k.kind==="tool"&&k.tool.id===g.toolCallId);y&&y.kind==="tool"&&(y.tool=m)}}function f(h){if(h.type==="image"||h.type==="video"){const p=h.type,g=h.source;if(g.kind==="url")return{url:g.url,kind:p};if(g.kind==="base64")return{url:`data:${g.mediaType};base64,${g.data}`,kind:p};if(g.kind==="file"&&n)return{url:n(g.fileId),kind:p,fileId:g.fileId}}if(h.type==="file"&&n){if(h.mediaType.startsWith("image/"))return{url:n(h.fileId),kind:"image",fileId:h.fileId};if(h.mediaType.startsWith("video/"))return{url:n(h.fileId),kind:"video",fileId:h.fileId}}}for(const h of e){if(h.role==="system")continue;if(r1e(h)){c();const m=h.metadata?.[V5];i.push({id:h.id,role:"compaction",no:r,text:h.content.filter(y=>y.type==="text").map(y=>y.text).join(`
321
+ `),compaction:{trigger:m?.trigger,tokensBefore:m?.tokensBefore,tokensAfter:m?.tokensAfter}});continue}if(h.role==="user"){const m=t1e(h);if(c(),m!==void 0){i.push(s1e(h,r++,m));continue}if(!i1e(h))continue;const y=h.metadata?.origin,k=y?.kind==="skill_activation"&&y?.trigger==="user-slash",A=y?.kind==="plugin_command"&&y?.trigger==="user-slash",$=[],I=[];for(const x of h.content){if(x.type==="text")if(k)$.push(y.skillArgs??"");else if(A)$.push(y.commandArgs??"");else{const E=Hme(x.text);if(E&&(E.kind==="video"||E.kind==="image")&&n){const N=zme(E.path);if(N){I.push({url:n(N),kind:E.kind,fileId:N});continue}}const F=qme(x.text);if(F){I.push({kind:"file",url:F.fileId&&n?n(F.fileId):"",fileId:F.fileId,name:F.name,mediaType:F.mediaType,size:F.size});continue}const S=Dme(x.text);if(S!==x.text&&S.trim().length===0)continue;$.push(S)}const L=f(x);if(L){I.push({url:L.url,kind:L.kind,name:x.type==="file"?x.name:void 0,fileId:L.fileId});continue}x.type==="file"&&n&&I.push({kind:"file",url:n(x.fileId),fileId:x.fileId,name:x.name,mediaType:x.mediaType||void 0,size:x.size})}i.push({id:h.id,role:"user",no:r++,text:$.join(`
322
+ `),attachments:I.length>0?I:void 0,skillActivation:k?{name:y.skillName,args:y.skillArgs}:void 0,pluginCommand:A?{pluginId:y.pluginId,commandName:y.commandName,args:y.commandArgs}:void 0,createdAt:h.createdAt});continue}if(h.role==="tool"){a&&u(a,h.content);continue}const p=h.promptId;l1e(a,p)?a!==null&&a.promptId===void 0&&p!==void 0&&(a.promptId=p):(c(),a={id:h.id,promptId:p,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,foldedSigs:[],durationMs:h.durationMs});const b=a;if(b===null)continue;const v=c1e(h.content);if(b.promptId!==void 0&&b.foldedSigs.some(m=>u1e(m,v))){d(b,h.content);continue}b.foldedSigs.push(v),u(b,h.content)}return c(!0),i}function d1e(e,t){const{pushOperationFailure:n,nextOptimisticMsgId:o,connectEventsIfNeeded:s,getEventConn:i,resolveThinkingForPrompt:r}=t,l=J({}),a=R(()=>{const E=e.activeSessionId;if(!E)return null;const F=l.value[E];return F?{parentId:E,agentId:F.agentId}:null}),c=R(()=>a.value?.parentId??null),u=R(()=>a.value!==null),d=R(()=>{const E=a.value;return E?!!e.sideChatSendingByAgent[E.agentId]:!1}),f=R(()=>{const E=a.value;return E?e.sideChatSendingByAgent[E.agentId]?!0:(e.tasksBySession[E.parentId]??[]).some(F=>F.id===E.agentId&&F.status==="running"):!1}),h=R(()=>{const E=a.value;if(!E)return[];const F=e.sideChatMessagesByAgent[E.agentId]??[];return G5(F,[],S=>dt().getFileUrl(S),f.value)});function p(E,F){e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[E]:F(e.sideChatMessagesByAgent[E]??[])}}function g(E,F){p(E,S=>[...S,F])}function b(E){p(E,F=>{const S=[...F].reverse().findIndex(D=>D.role==="user");if(S===-1)return F;const N=F.length-1-S;return F.filter((D,B)=>B!==N)})}function v(E,F){p(E,S=>{const N=[...S];for(let D=N.length-1;D>=0;D-=1){const B=N[D];if(B.role==="user")return N[D]={...B,promptId:B.promptId??F},N}return S})}function m(E,F,S){S&&p(E,N=>{const D=N.at(-1);if(D?.role==="assistant"){const B=D.content[0],U=B?.type==="text"?B.text:"";return[...N.slice(0,-1),{...D,content:[{type:"text",text:`${U}${S}`}]}]}return[...N,{id:o(),sessionId:F,role:"assistant",content:[{type:"text",text:S}],createdAt:new Date().toISOString()}]})}function y(E,F,S){if(e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[E]:!1},!S)return;const D=(e.sideChatMessagesByAgent[E]??[]).at(-1);(D?.role==="assistant"&&D.content[0]?.type==="text"?D.content[0].text:"").trim().length>0||m(E,F,S)}async function k(E){const F=e.activeSessionId;F&&await A(F,E)}async function A(E,F){if(!l.value[E]){let S;try{({agentId:S}=await dt().startBtw(E))}catch(N){n("openSideChat",N,{sessionId:E});return}e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[S]:e.sideChatMessagesByAgent[S]??[]},l.value={...l.value,[E]:{agentId:S}},s(),i()?.markSideChannelAgent(S)}F&&F.trim()&&await $(E,F.trim())}async function $(E,F){const S=l.value[E],N=F.trim();if(!S||!N)return;const D=E,B=S.agentId;e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[B]:!0};const U={id:o(),sessionId:D,role:"user",content:[{type:"text",text:N}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};g(B,U);try{const H=e.sessions.find(K=>K.id===D),P=(H?.model&&H.model.length>0?H.model:e.defaultModel)??void 0,Z=await dt().submitPrompt(D,{content:[{type:"text",text:N}],agentId:B,model:P,thinking:await r(D,P)??e.thinking,permissionMode:e.permission,planMode:e.planModeBySession[D]??!1,swarmMode:e.swarmModeBySession[D]??!1});v(B,Z.promptId),e.sideChatUserMessageIdsBySession={...e.sideChatUserMessageIdsBySession,[D]:[...e.sideChatUserMessageIdsBySession[D]??[],Z.userMessageId]}}catch(H){n("sendSideChatPrompt",H,{sessionId:D}),b(B),e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[B]:!1}}}function I(){const E=e.activeSessionId;if(!E)return;const{[E]:F,...S}=l.value;l.value=S}async function x(E){const F=a.value;F&&await $(F.parentId,E)}function L(E){if(!l.value[E])return;const{[E]:F,...S}=l.value;l.value=S}return{sideChatTargetBySession:l,sideChatSessionId:c,sideChatVisible:u,sideChatSending:d,sideChatRunning:f,sideChatTurns:h,appendSideChatAssistantText:m,finishSideChatAgent:y,openSideChat:k,openSideChatOn:A,closeSideChat:I,sendSideChatPrompt:x,clearSideChatForSession:L}}const f1e="kimiWeb.optimisticUserMessage",o4="Sub Agent";function h1e(){return{sessions:[],activeSessionId:void 0,messagesBySession:{},approvalsBySession:{},planReviewByToolCallId:{},questionsBySession:{},tasksBySession:{},goalBySession:{},goalVersionBySession:{},lastSeqBySession:{},turnActiveBySession:{},compactionBySession:{},warnings:[]}}function p1e(e){return{...e,sessions:e.sessions,messagesBySession:{...e.messagesBySession},approvalsBySession:{...e.approvalsBySession},planReviewByToolCallId:{...e.planReviewByToolCallId},questionsBySession:{...e.questionsBySession},tasksBySession:{...e.tasksBySession},goalBySession:{...e.goalBySession},goalVersionBySession:{...e.goalVersionBySession},lastSeqBySession:{...e.lastSeqBySession},turnActiveBySession:{...e.turnActiveBySession},compactionBySession:{...e.compactionBySession},warnings:[...e.warnings]}}function m1e(e,t,n){if(t!==void 0&&n!==void 0&&n>0){const o=e.lastSeqBySession[t]??0;n>o&&(e.lastSeqBySession[t]=n)}}function wg(e){return e.role==="user"&&e.metadata?.[f1e]===!0}function g1e(e){const t=e.metadata?.origin;return t?.kind==="cron_job"||t?.kind==="cron_missed"}function v1e(e,t){return JSON.stringify(e.content)===JSON.stringify(t.content)}const y1e=/^<(image|video|audio)\s+path="[^"]+"><\/\1>$/;function s4(e){let t="",n=0;for(const o of e.content)o.type==="text"?y1e.test(o.text.trim())?n+=1:t+=o.text:(o.type==="image"||o.type==="video"||o.type==="file")&&(n+=1);return{text:t,media:n}}function k1e(e,t){const n=s4(e),o=s4(t);return n.text===o.text&&n.media===o.media}function b1e(e,t){const n=t.promptId;if(n!==void 0)for(let o=e.length-1;o>=0;o--){const s=e[o];if(wg(s)&&s.promptId===n)return o}for(let o=e.length-1;o>=0;o--){const s=e[o];if(wg(s)&&v1e(s,t))return o}for(let o=e.length-1;o>=0;o--){const s=e[o];if(wg(s)&&k1e(s,t))return o}return-1}function x1e(e,t,n){let o=!1;const s=e.map(i=>{let r=!1;const l=i.content.map(a=>a.type!=="toolUse"||a.toolCallId!==t?a:(r=!0,{...a,outputLines:[...a.outputLines??[],n]}));return r?(o=!0,{...i,content:l}):i});return o?s:e}const w1e={"provider.connection_error":"connection","provider.auth_error":"auth","provider.rate_limit":"rateLimit","provider.overloaded":"overloaded","provider.filtered":"filtered","provider.api_error":"api","context.overflow":"contextOverflow"};function _1e(e){const t=_n.global.t,n=[],o=(r,l)=>{typeof l=="number"||typeof l=="boolean"?n.push({label:r,value:String(l)}):typeof l=="string"&&l.length>0&&n.push({label:r,value:l})};o(t("warnings.details.code"),e.code);const s=e.details??{};o(t("warnings.details.status"),s.statusCode),o(t("warnings.details.requestId"),s.requestId),o(t("warnings.details.errorName"),e.name);for(const[r,l]of Object.entries(s))r==="statusCode"||r==="requestId"||o(r,l);const i=(e.code!==void 0?w1e[e.code]:void 0)??"title";return{severity:"error",title:t(`warnings.agentError.${i}`),message:e.message,details:n.length>0?n:void 0}}function S1e(e,t,n){const o=p1e(e);switch(m1e(o,n.sessionId,n.seq),t.type){case"sessionCreated":{o.sessions.some(i=>i.id===t.session.id)||(o.sessions=[t.session,...o.sessions]);break}case"sessionUpdated":{o.sessions=o.sessions.map(s=>s.id===t.session.id?t.session:s);break}case"sessionDeleted":{const s=t.sessionId;o.sessions=o.sessions.filter(i=>i.id!==s),delete o.messagesBySession[s],delete o.tasksBySession[s],delete o.goalBySession[s],delete o.approvalsBySession[s],delete o.questionsBySession[s],delete o.lastSeqBySession[s],delete o.turnActiveBySession[s],o.activeSessionId===s&&(o.activeSessionId=void 0);break}case"sessionWorkChanged":{o.sessions=o.sessions.map(s=>s.id!==t.sessionId?s:{...s,busy:t.busy,mainTurnActive:t.mainTurnActive??(t.busy?s.mainTurnActive:!1),pendingInteraction:t.pendingInteraction??s.pendingInteraction,lastTurnReason:t.lastTurnReason}),t.mainTurnActive===!0?o.turnActiveBySession[t.sessionId]=!0:(t.mainTurnActive===!1||!t.busy)&&delete o.turnActiveBySession[t.sessionId];break}case"sessionMetaUpdated":{o.sessions=o.sessions.map(s=>s.id===t.sessionId?{...s,title:t.title??s.title,lastPrompt:t.lastPrompt??s.lastPrompt}:s);break}case"sessionUsageUpdated":{o.sessions=o.sessions.map(s=>{if(s.id!==t.sessionId)return s;const i=t.model&&t.model.length>0?t.model:s.model;return{...s,usage:t.usage,model:i}});break}case"historyCompacted":break;case"compactionStarted":{o.compactionBySession={...o.compactionBySession,[t.sessionId]:{status:"running",trigger:t.trigger}};break}case"compactionCompleted":{const s=t.sessionId,i=o.compactionBySession[s],{[s]:r,...l}=o.compactionBySession;if(o.compactionBySession=l,Object.prototype.hasOwnProperty.call(o.messagesBySession,s)){const a=o.messagesBySession[s]??[],c=`compaction_${s}_${n.seq}`;if(!a.some(u=>u.id===c)){const u={trigger:i?.trigger??"auto",tokensBefore:t.tokensBefore,tokensAfter:t.tokensAfter};o.messagesBySession[s]=[...a,{id:c,sessionId:s,role:"assistant",content:t.summary?[{type:"text",text:t.summary}]:[],createdAt:new Date().toISOString(),metadata:{origin:{kind:"compaction_summary"},[V5]:u}}]}}break}case"compactionCancelled":{const{[t.sessionId]:s,...i}=o.compactionBySession;o.compactionBySession=i;break}case"messageCreated":{const s=t.message.sessionId,i=t.message.createdAt;o.sessions=o.sessions.map(a=>a.id===s&&i>a.updatedAt?{...a,updatedAt:i}:a);const r=o.messagesBySession[s]??[];if(!r.some(a=>a.id===t.message.id)){if(t.message.role==="user"&&!g1e(t.message)){const a=b1e(r,t.message);if(a!==-1){const c=[...r],u=c[a];c[a]={...t.message,id:u.id,promptId:t.message.promptId??u.promptId,metadata:{...t.message.metadata,...u.metadata}},o.messagesBySession[s]=c;break}}o.messagesBySession[s]=[...r,t.message]}break}case"messageUpdated":{const s=t.sessionId,i=o.messagesBySession[s]??[];o.messagesBySession[s]=i.map(r=>r.id!==t.messageId?r:{...r,content:t.content,durationMs:t.durationMs??r.durationMs});break}case"assistantDelta":{const s=t.sessionId,i=o.messagesBySession[s]??[];o.messagesBySession[s]=i.map(r=>{if(r.id!==t.messageId)return r;const l=[...r.content],a=t.contentIndex;for(;l.length<=a;)l.push({type:"text",text:""});const c=l[a];let u;return t.delta.text!==void 0?c.type==="text"?u={type:"text",text:c.text+t.delta.text}:u={type:"text",text:t.delta.text}:t.delta.thinking!==void 0?c.type==="thinking"?u={type:"thinking",thinking:c.thinking+t.delta.thinking,signature:c.signature}:u={type:"thinking",thinking:t.delta.thinking}:u=c,l[a]=u,{...r,content:l}});break}case"toolOutput":{const s=t.sessionId,i=o.messagesBySession[s]??[];o.messagesBySession[s]=x1e(i,t.toolCallId,t.outputChunk);break}case"approvalRequested":{const s=t.sessionId,i=o.approvalsBySession[s]??[];i.some(a=>a.approvalId===t.approval.approvalId)||(o.approvalsBySession[s]=[...i,t.approval]);const l=t.approval.display;l?.kind==="plan_review"&&typeof l.plan=="string"&&l.plan.length>0&&(o.planReviewByToolCallId={...o.planReviewByToolCallId,[t.approval.toolCallId]:{plan:l.plan,path:typeof l.path=="string"?l.path:void 0}});break}case"approvalResolved":case"approvalExpired":{const s=t.sessionId,i=t.approvalId,r=o.approvalsBySession[s]??[];o.approvalsBySession[s]=r.filter(l=>l.approvalId!==i);break}case"questionRequested":{const s=t.sessionId,i=o.questionsBySession[s]??[];i.some(l=>l.questionId===t.question.questionId)||(o.questionsBySession[s]=[...i,t.question]);break}case"questionAnswered":case"questionDismissed":{const s=t.sessionId,i=t.questionId,r=o.questionsBySession[s]??[];o.questionsBySession[s]=r.filter(l=>l.questionId!==i);break}case"taskCreated":{const s=t.sessionId,i=o.tasksBySession[s]??[],r=i.findIndex(l=>l.id===t.task.id);if(r===-1)o.tasksBySession[s]=[...i,t.task];else{const l=[...i],a=i[r];l[r]={...t.task,outputLines:a.outputLines,text:a.text,description:t.task.description===o4&&a.description!==o4?a.description:t.task.description,swarmIndex:t.task.swarmIndex??a.swarmIndex,parentToolCallId:t.task.parentToolCallId??a.parentToolCallId,subagentType:t.task.subagentType??a.subagentType,runInBackground:t.task.runInBackground??a.runInBackground,backgroundTaskId:t.task.backgroundTaskId??a.backgroundTaskId},o.tasksBySession[s]=l}break}case"taskProgress":{const s=t.sessionId,i=o.tasksBySession[s]??[];o.tasksBySession[s]=i.map(r=>{if(r.id!==t.taskId)return r;if(r.kind==="subagent"&&t.kind==="text")return{...r,text:(r.text??"")+t.outputChunk};const l=r.outputLines??[];if(l.at(-1)===t.outputChunk)return r;const a=[...l,t.outputChunk];return{...r,outputLines:r.kind==="subagent"?a:a.slice(-40)}});break}case"taskCompleted":{const s=t.sessionId,i=o.tasksBySession[s]??[];o.tasksBySession[s]=i.map(r=>r.id!==t.taskId?r:{...r,status:t.status,outputPreview:t.outputPreview,outputBytes:t.outputBytes});break}case"goalUpdated":{const s=t.sessionId;o.goalVersionBySession[s]=(o.goalVersionBySession[s]??0)+1,t.goal===null||t.goal.status==="complete"?delete o.goalBySession[s]:o.goalBySession[s]=t.goal;break}case"configChanged":{o.config=t.config;break}case"modelCatalogChanged":break;case"agentDelta":case"agentTurnEnded":break;case"promptCompleted":case"promptAborted":break;case"turnActiveChanged":{o.sessions=o.sessions.map(s=>s.id===t.sessionId?{...s,mainTurnActive:t.active}:s),t.active?o.turnActiveBySession[t.sessionId]=!0:delete o.turnActiveBySession[t.sessionId];break}case"unknown":{const s=t.raw;if(!(s&&s._noop===!0))if(s&&s._agentError)o.warnings=[...o.warnings,_1e(s)];else if(s&&s._agentWarning){const i=s.message??s.code??"agent warning";o.warnings=[...o.warnings,`${_n.global.t("warnings.noteLabel")}: ${i}`]}else{const i=s?.type??"(unknown)";o.warnings=[...o.warnings,`Unhandled event: ${i}`]}break}}return o}function C1e(e){return e==="in_progress"?"in_progress":e==="done"||e==="completed"?"done":"pending"}function A1e(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.role==="assistant")for(let o=n.content.length-1;o>=0;o--){const s=n.content[o];if(s.type!=="toolUse"||Da(s.toolName)!=="todo")continue;let i=s.input;if(typeof i=="string")try{i=JSON.parse(i)}catch{continue}const r=i?.todos;if(Array.isArray(r))return r.flatMap(l=>{const a=l??{},c=typeof a.title=="string"?a.title:typeof a.content=="string"?a.content:"";return c?[{title:c,status:C1e(a.status)}]:[]})}}return[]}const M1e=["queued","working","suspended","completed","failed"];function Y5(e){return e.status==="completed"?"completed":e.status==="failed"||e.status==="cancelled"?"failed":e.subagentPhase?e.subagentPhase:"working"}function E1e(){return{queued:0,working:0,suspended:0,completed:0,failed:0}}function T1e(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||n.swarmIndex===void 0)continue;const o=n.parentToolCallId??"swarm",s=t.get(o)??[];s.push({id:n.id,name:n.description,subagentType:n.subagentType,phase:Y5(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex}),t.set(o,s)}return[...t.entries()].map(([n,o])=>{const s=o.toSorted((r,l)=>r.swarmIndex-l.swarmIndex||r.id.localeCompare(l.id)),i=E1e();for(const r of s)i[r.phase]++;return{id:n,members:s,counts:i}}).filter(n=>n.members.length>1).toSorted((n,o)=>{const s=n.members.at(0)?.swarmIndex??0,i=o.members.at(0)?.swarmIndex??0;return s!==i?s-i:n.id.localeCompare(o.id)})}function N1e(e){let t=0,n=0;for(const o of e){n+=o.members.length;for(const s of M1e)(s==="completed"||s==="failed")&&(t+=o.counts[s])}return{done:t,total:n}}function I1e(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||!n.parentToolCallId)continue;const o=t.get(n.parentToolCallId)??[];o.push({id:n.id,name:n.description,subagentType:n.subagentType,phase:Y5(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex??Number.MAX_SAFE_INTEGER}),t.set(n.parentToolCallId,o)}for(const[n,o]of t)t.set(n,o.toSorted((s,i)=>s.swarmIndex-i.swarmIndex||s.id.localeCompare(i.id)));return t}const Cr=z5(),Ji=Zpe(),Hd=sme(),Z5=Ft.permission,Q5=Ft.activeWorkspace,X5=Ft.planMode,J5=Ft.swarmMode,e8=Ft.goalMode,i4=40401,t8=Ft.onboarded;Na(Ft.codeFont);Na(Ft.theme);Na(Ft.thinking);function L1e(){try{const e=mo(Z5);if(e==="auto"||e==="yolo"||e==="manual")return e}catch{}return"manual"}function $1e(e){try{So(Z5,e)}catch{}}function _g(e){const t=mo(e);if(!t)return{};try{const n=JSON.parse(t);if(!n||typeof n!="object"||Array.isArray(n))return{};const o={};for(const[s,i]of Object.entries(n))i===!0&&(o[s]=!0);return o}catch{return{}}}function i2(e,t){try{const n={};for(const[o,s]of Object.entries(t))s&&(n[o]=!0);So(e,JSON.stringify(n))}catch{}}function n8(){i2(X5,ke.planModeBySession)}function o8(){i2(J5,ke.swarmModeBySession)}function s8(){i2(e8,ke.goalModeBySession)}function F1e(){try{return mo(Q5)}catch{return null}}const i8=Ft.hiddenWorkspaces;function O1e(){try{const e=mo(i8);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function R1e(e){try{So(i8,JSON.stringify(e))}catch{}}function B1e(e){try{So(Q5,e)}catch{}}function D1e(e,t){if(t&&e.startsWith(t)){const o=e.slice(t.length);return o?`~${o}`:"~"}const n=e.match(/^\/(?:Users|home)\/[^/]+(\/.*)?$/);return n?`~${n[1]??""}`:e}const ke=Bo({...h1e(),connected:!1,serverVersion:"",dangerousBypassAuth:!1,backend:"v1",workspaceName:"kimi-web",connection:"disconnected",permission:L1e(),thinking:void 0,thinkingBySession:{},planModeBySession:_g(X5),swarmModeBySession:_g(J5),goalModeBySession:_g(e8),loading:!1,sessionLoading:!1,queuedBySession:{},gitStatusBySession:{},promptIdBySession:{},inFlightBySession:{},unreadBySession:Dy(),authReady:!1,defaultModel:null,managedProviderStatus:null,workspaces:[],activeWorkspaceId:F1e(),fsHome:null,recentRoots:[],hiddenWorkspaceRoots:O1e(),availableOpenInApps:[],config:null,sideChatMessagesByAgent:{},sideChatSendingByAgent:{},sideChatUserMessageIdsBySession:{},messagesLoadingMoreBySession:{},messagesHasMoreBySession:{},messagesLoadMoreErrorBySession:{},sessionsHasMoreByWorkspace:{},sessionsLoadingMoreByWorkspace:{},sessionsCursorByWorkspace:{},sessionsInitialCountByWorkspace:{},sessionsFullyLoaded:!1}),Zm=Bo({planMode:!1,swarmMode:!1,goalMode:!1});function r8(e){ke.sessions=e}function Qm(e,t){ke.sessions=ke.sessions.map(n=>n.id===e?t(n):n)}function P1e(e){ke.sessions=[e,...ke.sessions.filter(t=>t.id!==e.id)]}function H1e(e){ke.sessions=[...ke.sessions,e]}function W1e(e){ke.sessions=ke.sessions.filter(t=>t.id!==e)}function l8(){const e=ke.activeSessionId;e&&ke.unreadBySession[e]&&typeof document<"u"&&document.visibilityState==="visible"&&(ke.unreadBySession={...ke.unreadBySession,[e]:!1},Py({[e]:!1}))}typeof window<"u"&&window.addEventListener("storage",e=>{e.key===Ft.unread&&(ke.unreadBySession=Dy(),l8())});function ny(){if(xi===null||!xi.health().stale)return;ko("ws:stale-reconnect",{sessionId:ke.activeSessionId,status:"stale"}),Er("ws: stale socket on focus, reconnecting",{activeSessionId:ke.activeSessionId}),xi.reconnect();const e=ke.activeSessionId;e&&Vp.request(e)}typeof document<"u"&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&(l8(),ny())});typeof window<"u"&&(window.addEventListener("focus",ny),window.addEventListener("online",ny));function r2(e){ke.activeSessionId=e}function z1e(e){ke.messagesBySession=e}function U1e(e,t){ke.messagesBySession={...ke.messagesBySession,[e]:t}}function a8(e,t){ke.messagesBySession={...ke.messagesBySession,[e]:t(ke.messagesBySession[e]??[])}}function q1e(e){const{[e]:t,...n}=ke.messagesBySession;ke.messagesBySession=n}function c8(e){xi?.unsubscribe(e),p0e(e),qp.discard(({meta:t})=>t.sessionId===e),W1e(e),q1e(e),delete ke.approvalsBySession[e],delete ke.questionsBySession[e],delete ke.tasksBySession[e],delete ke.goalBySession[e],delete ke.gitStatusBySession[e],delete ke.lastSeqBySession[e],delete ke.compactionBySession[e],delete ke.messagesLoadingMoreBySession[e],delete ke.messagesHasMoreBySession[e],delete ke.messagesLoadMoreErrorBySession[e],delete oy[e],jp.delete(e),Bh.delete(e),x8.delete(e),wme(e),delete ke.queuedBySession[e],delete ke.promptIdBySession[e],delete ke.inFlightBySession[e],delete ke.turnActiveBySession[e],delete ke.planModeBySession[e],delete ke.swarmModeBySession[e],delete ke.goalModeBySession[e],delete ke.thinkingBySession[e],n8(),o8(),s8()}const u8=J(null),d8=J([]),f8=J(!1),h8=J(!1),p8=J(null);async function of(e){let t;try{t=await dt().getSessionStatus(e)}catch{return}Qm(e,n=>({...n,model:t.model||n.model,usage:{...n.usage,contextTokens:t.contextTokens,contextLimit:t.maxContextTokens}})),ke.swarmModeBySession={...ke.swarmModeBySession,[e]:t.swarmMode},ke.planModeBySession={...ke.planModeBySession,[e]:t.planMode},t.thinkingEffort.length>0&&(ke.thinkingBySession={...ke.thinkingBySession,[e]:t.thinkingEffort})}async function j1e(e){const t=ke.goalVersionBySession[e]??0;let n;try{n=await dt().getSessionGoal(e)}catch{return}if((ke.goalVersionBySession[e]??0)!==t)return;const o={...ke.goalBySession};n===null||n.status==="complete"?delete o[e]:o[e]=n,ke.goalBySession=o}function m8(e,t){const n=t??ke.activeSessionId;return n?Promise.resolve(dt().updateSession(n,e)).then(()=>of(n)).then(()=>!0).catch(o=>(sf("persistSessionProfile",o,{sessionId:n}),!1)):Promise.resolve(!1)}const g8=Ft.conversationToc;function V1e(){try{const e=mo(g8);return e===null?!0:e==="true"}catch{return!0}}function K1e(e){try{So(g8,e?"true":"false")}catch{}}const v8=J(V1e());function G1e(e){v8.value=e,K1e(e)}function Y1e(e){try{return mo(e)??""}catch{return""}}const y8=J(Y1e(t8)==="1");function Z1e(e){y8.value=e;try{So(t8,e?"1":"0")}catch{}}let xi=null,r4=0;function k8(){return r4+=1,`msg_opt_${Date.now().toString(36)}_${r4}`}function Q1e(e,t,n){const o={sessions:ke.sessions,activeSessionId:ke.activeSessionId,messagesBySession:ke.messagesBySession,approvalsBySession:ke.approvalsBySession,planReviewByToolCallId:ke.planReviewByToolCallId,questionsBySession:ke.questionsBySession,tasksBySession:ke.tasksBySession,goalBySession:ke.goalBySession,goalVersionBySession:ke.goalVersionBySession,lastSeqBySession:ke.lastSeqBySession,turnActiveBySession:ke.turnActiveBySession,compactionBySession:ke.compactionBySession,config:ke.config,warnings:ke.warnings},s=S1e(o,e,{sessionId:t,seq:n});r8(s.sessions),r2(s.activeSessionId),z1e(s.messagesBySession),ke.approvalsBySession=s.approvalsBySession,ke.planReviewByToolCallId=s.planReviewByToolCallId,ke.questionsBySession=s.questionsBySession,ke.tasksBySession=s.tasksBySession,ke.goalBySession=s.goalBySession,ke.goalVersionBySession=s.goalVersionBySession,ke.lastSeqBySession=s.lastSeqBySession,ke.turnActiveBySession=s.turnActiveBySession,ke.compactionBySession=s.compactionBySession,ke.config=s.config??null,ke.warnings=s.warnings,e.type==="configChanged"&&(ke.defaultModel=e.config.defaultModel??null),e.type==="modelCatalogChanged"&&(In.loadModels(),In.loadProviders()),e.type==="sessionUsageUpdated"&&(e.swarmMode!==void 0&&(ke.swarmModeBySession={...ke.swarmModeBySession,[e.sessionId]:e.swarmMode}),e.planMode!==void 0&&(ke.planModeBySession={...ke.planModeBySession,[e.sessionId]:e.planMode}),e.thinking!==void 0&&(ke.thinkingBySession={...ke.thinkingBySession,[e.sessionId]:e.thinking}))}function X1e(e,t){const n=ke.lastSeqBySession[t.sessionId]??0,o=ke.turnActiveBySession[t.sessionId]??!1;Q1e(e,t.sessionId,t.seq);const s=fs.sideChatTargetBySession.value[t.sessionId];if(s){const{agentId:i}=s,r=t.sessionId;e.type==="agentDelta"&&e.agentId===i?e.delta.text&&fs.appendSideChatAssistantText(i,r,e.delta.text):e.type==="agentTurnEnded"&&e.agentId===i?fs.finishSideChatAgent(i,r):e.type==="taskProgress"&&e.taskId===i?fs.appendSideChatAssistantText(i,r,e.outputChunk):e.type==="taskCompleted"&&e.taskId===i&&fs.finishSideChatAgent(i,r,e.outputPreview)}if(e.type==="messageCreated"&&e.message.role==="user"&&e.message.promptId!==void 0){const i=e.message.sessionId;ke.promptIdBySession[i]!==e.message.promptId&&(ke.promptIdBySession={...ke.promptIdBySession,[i]:e.message.promptId})}if(e.type==="assistantDelta"&&t.sessionId===ke.activeSessionId&&Cr.recordMoonDelta((e.delta.text?.length??0)+(e.delta.thinking?.length??0)),e.type==="turnActiveChanged"&&!e.active&&t.seq>n){const i=e.reason;bge(e.sessionId,i==="cancelled"||i==="failed"||i==="blocked"?"aborted":"idle",o)}e.type==="sessionWorkChanged"&&(e.mainTurnActive===!1&&o||e.mainTurnActive===void 0&&!e.busy)&&t.seq>n&&kge(e.sessionId),(e.type==="promptAborted"||e.type==="promptCompleted"&&e.reason==="blocked")&&t.seq>n&&ke.promptIdBySession[e.sessionId]===e.promptId&&ut.finishPromptLocal(e.sessionId),e.type==="questionRequested"&&xge(e.sessionId,e.question),e.type==="approvalRequested"&&wge(e.sessionId,e.approval)}const qp=ype(({appEvent:e,meta:t})=>X1e(e,t),({appEvent:e})=>ppe(e),{coalesce:bpe});function b8(){if(xi!==null||typeof WebSocket>"u")return;ko("ws:connection",{status:"connecting"}),ke.connection="connecting",xi=dt().connectEvents({onEvent(t,n){if(t.type==="workspaceCreated"||t.type==="workspaceUpdated"||t.type==="workspaceDeleted"){ut.applyWorkspaceEvent(t);return}for(const o of kpe({appEvent:t,meta:n}))qp(o)},onResync(t,n,o){ko("ws:resync",{sessionId:t,status:"required",seq:n}),qp.flush(),jp.add(t),Vp.request(t)},onError(t,n,o){ko("ws:error",{status:"failed",errorCode:t,fatal:o}),l2({severity:"error",title:_n.global.t("warnings.wsTitle"),message:n,details:[Qn("message",n)].filter(s=>s!==void 0)})},onConnectionChange(t){ko("ws:connection",{status:t?"connected":"disconnected"}),ke.connected=t,ke.connection=t?"connected":"disconnected",t&&(r0e(),ut.refreshServerMeta())}})}const oy={},jp=new Set,Bh=new Set,x8=new Set;function J1e(e){return vi(e)&&e.code===i4?!0:typeof e=="object"&&e!==null&&e.code===i4}function Qn(e,t){if(!(t==null||t===""))return{label:_n.global.t(`warnings.details.${e}`),value:w8(t)}}function w8(e){if(e instanceof Error)return typeof e.stack=="string"&&e.stack?e.stack:e.message?`${e.name}: ${e.message}`:e.name;if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean"||typeof e=="bigint")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function e0e(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.name=="string"?e.name:void 0}function t0e(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.message=="string"?e.message:void 0}function n0e(e){return e instanceof Error&&typeof e.stack=="string"&&e.stack?e.stack:void 0}function o0e(e){if(!(typeof e!="number"||!Number.isFinite(e)))return new Date(e).toISOString()}function l4(e){if(!(typeof e!="number"||!Number.isFinite(e)))return`${Math.round(e)}ms`}function s0e(e,t,n){const o=$k(t),s=vi(t),i=o||s?t.timestamp:void 0,r=o||s?t.durationMs:void 0,l=[Qn("operation",e),Qn("sessionId",n??ke.activeSessionId),Qn("connection",ke.connection),Qn("timestamp",o0e(i??Date.now()))];return o?l.push(Qn("duration",l4(r)),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)):s?l.push(Qn("duration",l4(r)),Qn("code",t.code),Qn("requestId",t.requestId),Qn("message",t.message),Qn("details",t.details)):l.push(Qn("errorName",e0e(t)),Qn("message",t0e(t)??w8(t)),Qn("stack",n0e(t))),l.filter(a=>a!==void 0)}function i0e(e,t,n={}){const o=$k(t),s=vi(t),i=n.title??(o?_n.global.t("warnings.daemonNetworkTitle"):s?_n.global.t("warnings.daemonApiTitle"):_n.global.t("warnings.operationFailedTitle")),r=n.message??(o?_n.global.t("warnings.daemonNetworkMessage"):s?t.message:_n.global.t("warnings.operationFailedMessage"));return{severity:"error",title:i,message:r,details:s0e(e,t,n.sessionId)}}function l2(e){ke.warnings=[...ke.warnings,e]}function r0e(){const e=_n.global.t("warnings.wsTitle"),t=ke.warnings.filter(n=>!(typeof n=="object"&&n!==null&&n.severity==="error"&&n.title===e));t.length!==ke.warnings.length&&(ke.warnings=t)}function sf(e,t,n){console.error(`[kimi-web] operation failed: ${e}`,t);const o=vi(t),s=$k(t);ko("operation:failed",{sessionId:n?.sessionId,status:"failed",operation:e,errorName:t instanceof Error?t.name:typeof t,errorCode:o?t.code:void 0,requestId:o||s?t.requestId:void 0,phase:s?t.phase:void 0,httpStatus:s?t.status:void 0}),l2(i0e(e,t,n))}const l0e={40913:"warnings.goal.alreadyExists",40914:"warnings.goal.notFound",40915:"warnings.goal.statusInvalid",40916:"warnings.goal.notResumable",40918:"warnings.goal.objectiveTooLong"};function a0e(e){if(!vi(e))return;const t=l0e[e.code];return t?_n.global.t(t):void 0}async function c0e(e){if(c8(e),ke.activeSessionId!==e)return;const t=ke.sessions[0];t?await ut.selectSession(t.id,{urlMode:"replace"}):(r2(void 0),ke.sessionLoading=!1,ut.writeSessionUrl(void 0,"replace"))}const a4=new Set;async function u0e(e){if(!a4.has(e)){a4.add(e);try{const t=await dt().getSessionWarnings(e),n=_n.global.t("warnings.noteLabel");for(const o of t)l2(`${n}: ${o.message}`)}catch{}}}async function a2(e){const t=ut.localTurnStartState(e);try{const o=await dt().getSessionSnapshot(e);if(!ke.sessions.some(a=>a.id===e))return"ok";qp.flush();const s=ke.lastSeqBySession[e]??0,i=oy[e];if(!(jp.has(e)||Kp.has(e))&&i!==void 0&&i===o.epoch&&s>o.asOfSeq)return Bh.delete(e)||(Bh.add(e),Vp.request(e)),"ok";if(!ut.isLocalTurnSnapshotCurrent(e,t))return ut.afterLocalTurnStartsSettle(e,()=>{Vp.request(e)}),"ok";const l=Hv(o.session.usage);Qm(e,a=>({...o.session,model:o.session.model&&o.session.model.length>0?o.session.model:a.model,usage:l?a.usage:o.session.usage})),U1e(e,upe(ke.messagesBySession[e]??[],o.messages)),ke.tasksBySession={...ke.tasksBySession,[e]:dpe(o.subagents,ke.tasksBySession[e]??[])},ke.messagesHasMoreBySession={...ke.messagesHasMoreBySession,[e]:o.hasMoreMessages},ke.approvalsBySession={...ke.approvalsBySession,[e]:o.pendingApprovals};for(const a of o.pendingApprovals){const c=a.display;c?.kind==="plan_review"&&typeof c.plan=="string"&&c.plan.length>0&&(ke.planReviewByToolCallId={...ke.planReviewByToolCallId,[a.toolCallId]:{plan:c.plan,path:typeof c.path=="string"?c.path:void 0}})}ke.questionsBySession={...ke.questionsBySession,[e]:o.pendingQuestions},ke.lastSeqBySession={...ke.lastSeqBySession,[e]:o.asOfSeq},oy[e]=o.epoch,jp.delete(e),Bh.delete(e),ut.handleSessionSnapshot(e,{inFlightTurn:o.inFlightTurn,busy:o.session.busy});{const a={...ke.turnActiveBySession};o.session.mainTurnActive??(o.inFlightTurn!==null&&o.session.busy)?a[e]=!0:delete a[e],ke.turnActiveBySession=a}return b8(),xi&&(xi.seedSnapshot(e,o),xi.subscribe(e,{seq:o.asOfSeq,epoch:o.epoch}),h0e(e)),Kp.delete(e),l&&of(e),u0e(e),"ok"}catch(n){return J1e(n)?(await c0e(e),"not-found"):(sf("getSessionSnapshot",n,{title:_n.global.t("warnings.sessionSnapshotTitle"),message:_n.global.t("warnings.sessionSnapshotMessage"),sessionId:e}),"failed")}}const Vp=fpe(a2);function d0e(e){return Object.prototype.hasOwnProperty.call(ke.messagesBySession,e)}const f0e=4,Ar=[],Kp=new Set;function h0e(e){const t=Ar.indexOf(e);for(t!==-1&&Ar.splice(t,1),Ar.unshift(e);Ar.length>f0e;){let n=-1;for(let s=Ar.length-1;s>=0;s--)if(Ar[s]!==ke.activeSessionId){n=s;break}if(n===-1)break;const[o]=Ar.splice(n,1);if(o===void 0)break;xi?.unsubscribe(o),Kp.add(o)}}function p0e(e){const t=Ar.indexOf(e);t!==-1&&Ar.splice(t,1),Kp.delete(e)}async function m0e(e){return a2(e)}function c2(e,t){return(ke.inFlightBySession[e]??!1)||(ke.turnActiveBySession[e]??!1)||(t??ke.sessions.find(n=>n.id===e)?.mainTurnActive??!1)}function u2(e){try{const t=new Date(e),o=Date.now()-t.getTime(),s=o/36e5;if(o<6e4)return _n.global.t("sessions.justNow");if(s<1)return`${Math.round(o/6e4)}m`;if(s<24)return`${Math.round(s)}h`;const i=o/864e5;return i<7?`${Math.round(i)}d`:i<30?`${Math.round(i/7)}w`:i<365?`${Math.round(i/30)}mo`:`${Math.round(i/365)}y`}catch{return e}}const g0e=3e4,Wd=J(0);let Sg=null;function v0e(){Sg===null&&(Sg=setInterval(()=>{Wd.value=(Wd.value+1)%Number.MAX_SAFE_INTEGER},g0e),Sg.unref?.())}function y0e(e,t){const n=e.split(`
323
+ `),o=t.split(`
324
+ `),s=[];return n.forEach((i,r)=>{s.push({kind:"rem",gutter:String(r+1),text:`- ${i}`})}),o.forEach((i,r)=>{s.push({kind:"add",gutter:String(r+1),text:`+ ${i}`})}),s}function k0e(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const o=typeof t.path=="string"?t.path:"";return Array.isArray(t.diff)?{kind:"diff",path:o,diff:t.diff}:typeof t.old_text=="string"&&typeof t.new_text=="string"?{kind:"diff",path:o,diff:y0e(t.old_text,t.new_text)}:{kind:"diff",path:o,diff:[]}}if(n==="shell"||n==="command"){const o=typeof t.command=="string"?t.command:e.action,s=typeof t.cwd=="string"?t.cwd:void 0,i=typeof t.danger=="string"?t.danger:void 0;return{kind:"shell",command:o,cwd:s,danger:i}}if(n==="file_content"||n==="file"){const o=typeof t.path=="string"?t.path:"",s=typeof t.content=="string"?t.content:"",i=typeof t.language=="string"?t.language:void 0;return{kind:"file",path:o,content:s,language:i}}if(n==="file_op"||n==="fileop"){const o=typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,s=typeof t.path=="string"?t.path:"",i=typeof t.detail=="string"?t.detail:void 0;return{kind:"fileop",op:o,path:s,detail:i}}if(n==="url_fetch"||n==="url"){const o=typeof t.url=="string"?t.url:e.action;return{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:o}}if(n==="search"){const o=typeof t.query=="string"?t.query:e.action,s=typeof t.scope=="string"?t.scope:void 0;return{kind:"search",query:o,scope:s}}if(n==="invocation"||n==="agent_call"||n==="skill_call"){const o=typeof t.kind=="string"?t.kind:n,s=typeof t.name=="string"?t.name:e.toolName,i=typeof t.description=="string"?t.description:void 0;return{kind:"invocation",kind2:o,name:s,description:i}}if(n==="todo"||n==="todo_list")return{kind:"todo",items:(Array.isArray(t.items)?t.items:[]).map(i=>{const r=i??{};return{title:typeof r.title=="string"?r.title:"",status:typeof r.status=="string"?r.status:"pending"}})};if(n==="plan_review"){const o=typeof t.plan=="string"?t.plan:"",s=typeof t.path=="string"?t.path:void 0,r=(Array.isArray(t.options)?t.options:[]).map(l=>{const a=l??{},c=typeof a.label=="string"?a.label:"";if(!c)return null;const u=typeof a.description=="string"?a.description:void 0;return{label:c,description:u}}).filter(l=>l!==null);return{kind:"plan_review",plan:o,path:s,options:r.length>0?r:void 0}}return{kind:"generic",summary:e.action}}function b0e(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 x0e(e){const t=ke.messagesBySession[e.sessionId];if(!t||t.length===0)return;const n=new Map;for(const s of t)if(s.role==="assistant")for(const i of s.content){if(i.type!=="toolUse"||i.toolName!=="Bash"&&i.toolName!=="bash")continue;const r=i.input,l=r&&typeof r.command=="string"?r.command:void 0;l&&n.set(i.toolCallId,l)}if(n.size===0)return;const o=`task_id: ${e.id}`;for(const s of t)if(s.role==="tool")for(const i of s.content){if(i.type!=="toolResult")continue;if((typeof i.output=="string"?i.output:i.output!==void 0?JSON.stringify(i.output):"").includes(o)){const l=n.get(i.toolCallId);if(l)return l}}}function w0e(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 o=e.outputLines&&e.outputLines.length>0?e.outputLines:e.outputPreview?e.outputPreview.split(/\r?\n/):void 0,s=e.command??x0e(e),i=e.kind==="bash"&&s?`$ ${s}`:void 0;return{id:e.id,name:e.description,kind:e.kind,state:t,timing:n,meta:i,output:o,runInBackground:e.runInBackground,parentToolCallId:e.parentToolCallId}}const _0e=R(()=>{const e=ke.sessions.find(n=>n.id===ke.activeSessionId),t=e?e.cwd.split("/").pop()??e.cwd:"main";return{name:ke.workspaceName,branch:t}}),S0e=R(()=>(Wd.value,ke.sessions.toSorted((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()).map(e=>({id:e.id,title:e.title,time:u2(e.updatedAt),busy:c2(e.id,e.mainTurnActive),pendingInteraction:e.pendingInteraction,lastTurnReason:e.lastTurnReason})))),C0e=R(()=>ke.activeSessionId??""),A0e=R(()=>{const e=ke.activeSessionId;if(e)return In.skillsBySession.value[e]??[];const t=Jm.value;return t?In.skillsByWorkspace.value[t]??[]:[]}),d2=R(()=>{const e=ke.activeSessionId;return e?ke.inFlightBySession[e]??!1:!1}),M0e=R(()=>ut.isStartingFirstPrompt()),fs=d1e(ke,{pushOperationFailure:sf,nextOptimisticMsgId:k8,connectEventsIfNeeded:b8,getEventConn:()=>xi,resolveThinkingForPrompt:(e,t)=>In.resolveThinkingForPrompt(e,t)}),rf=R(()=>{const e=ke.activeSessionId;if(!e)return[];const t=fs.sideChatTargetBySession.value[e]?.agentId;return(ke.tasksBySession[e]??[]).filter(n=>n.id!==t)}),_8=lme(ke,rf),E0e=R(()=>{const e=ke.activeSessionId;if(!e)return[];const t=new Set(ke.sideChatUserMessageIdsBySession[e]??[]),n=(ke.messagesBySession[e]??[]).filter(s=>!t.has(s.id)),o=ke.approvalsBySession[e]??[];return G5(n,o,s=>dt().getFileUrl(s),Xm.value,ke.planReviewByToolCallId)}),Xm=R(()=>{const e=ke.activeSessionId;return e?(ke.turnActiveBySession[e]??!1)||(ke.sessions.find(t=>t.id===e)?.mainTurnActive??!1):!1}),T0e=R(()=>d2.value||Xm.value),N0e=R(()=>(_8.taskClock.value,rf.value.map(w0e))),S8=R(()=>T1e(rf.value)),I0e=R(()=>I1e(rf.value)),bc=R(()=>{const e=ke.activeSessionId;return e?ke.goalBySession[e]??null:null}),L0e=R(()=>{const e=ke.activeSessionId;return e?A1e(ke.messagesBySession[e]??[]):[]}),$0e=R(()=>{const e=ke.activeSessionId;return e?ke.compactionBySession[e]??null:null}),F0e=R(()=>ke.connection),O0e=R(()=>ke.loading),R0e=R(()=>ke.sessionLoading),B0e=R(()=>{const e=ke.activeSessionId;return e?ke.messagesLoadingMoreBySession[e]??!1:!1}),D0e=R(()=>{const e=ke.activeSessionId;return e?ke.messagesHasMoreBySession[e]??!1:!1}),P0e=R(()=>{const e=ke.activeSessionId;return e?ke.messagesLoadMoreErrorBySession[e]??!1:!1}),H0e=R(()=>ke.serverVersion),W0e=R(()=>ke.backend),z0e=R(()=>ke.dangerousBypassAuth);function U0e(){ke.dangerousBypassAuth=!1}const q0e=R(()=>ke.permission),j0e=R(()=>ke.thinking),C8=R(()=>{const e=ke.activeSessionId;return e?ke.planModeBySession[e]??!1:Zm.planMode}),V0e=R(()=>{const e=ke.activeSessionId;return e?ke.swarmModeBySession[e]??!1:Zm.swarmMode}),K0e=R(()=>{const e=ke.activeSessionId;return e?ke.goalModeBySession[e]??!1:Zm.goalMode}),G0e=R(()=>{const e=N1e(S8.value);return{plan:C8.value,goal:bc.value&&bc.value.status!=="complete"?{status:bc.value.status,turnsUsed:bc.value.turnsUsed,elapsedMs:bc.value.wallClockMs}:null,swarm:e.total>0?e:null}}),Y0e=R(()=>{const e=ke.activeSessionId;if(!e)return[];const t=dt();return(ke.queuedBySession[e]??[]).map(n=>({text:n.text,attachmentCount:n.attachments?.length??0,attachments:n.attachments?.map(o=>({fileId:o.fileId,kind:o.kind,url:t.getFileUrl(o.fileId),name:o.name}))}))}),Z0e=R(()=>ke.warnings),Q0e=R(()=>{const e=ke.activeSessionId;return e?(ke.questionsBySession[e]??[]).map(b0e):[]}),X0e=R(()=>{const e=ke.activeSessionId;return e?(ke.approvalsBySession[e]??[]).map(t=>({approvalId:t.approvalId,block:k0e(t),agentName:t.agentName})):[]}),f2=R(()=>{const e=ke.activeSessionId;return e?(ke.approvalsBySession[e]??[]).length>0?"awaiting-approval":(ke.questionsBySession[e]??[]).length>0?"awaiting-question":d2.value||Xm.value?"running":"idle":"idle"}),In=Eme(ke,{pushOperationFailure:sf,refreshSessionStatus:of,persistSessionProfile:m8,activity:f2,updateSession:Qm,updateSessionMessages:a8}),sy=R(()=>{const e=ke.activeSessionId;if(!e)return null;const t=ke.gitStatusBySession[e];return t?{branch:t.branch,ahead:t.ahead,behind:t.behind}:null}),J0e=R(()=>{const e=ke.activeSessionId;return e?ke.gitStatusBySession[e]?.pullRequest??null:null}),ege=R(()=>{const e=ke.activeSessionId;if(!e)return[];const t=ke.gitStatusBySession[e];return t?Object.entries(t.entries).map(([n,o])=>({path:n,status:o})).sort((n,o)=>n.path.localeCompare(o.path)):[]}),tge=R(()=>{const e=ke.activeSessionId;if(!e)return null;const t=ke.gitStatusBySession[e];return t?{totalAdditions:t.additions,totalDeletions:t.deletions}:null}),A8=R(()=>{const e=ke.sessions.find(r=>r.id===ke.activeSessionId),t=sy.value?.branch??(e?e.cwd.split("/").pop()??e.cwd:"main"),n=e===void 0?In.draftModel.value:null,o=(e?.model&&e.model.length>0?e.model:n??ke.defaultModel)??"—",s=In.models.value.find(r=>r.id===o)??In.models.value.find(r=>r.model===o);return{model:s?.displayName||s?.model||(o.includes("/")?o.split("/").pop():o),modelId:s?.id??o,ctxUsed:e?.usage.contextTokens??0,ctxMax:e?.usage.contextLimit??0,permission:ke.permission,branch:t,cwd:e?.cwd??"",isGitRepo:sy.value!==null}}),nge=R(()=>d8.value),oge=R(()=>ke.sessions.find(t=>t.id===ke.activeSessionId)?.usage.totalCostUsd??0),sge=R(()=>ke.authReady),ige=R(()=>ke.defaultModel),rge=R(()=>ke.managedProviderStatus),lge=R(()=>ke.config),age=R(()=>{const e=ke.activeSessionId;if(!e)return{};const t=ke.gitStatusBySession[e];return t?{...t.entries}:{}});function tu(e){const t=Fi(e.cwd);return ke.workspaces.find(n=>Fi(n.root)===t)?.id??e.workspaceId??e.cwd}const h2=R(()=>cpe({workspaces:ke.workspaces,sessions:ke.sessions,hiddenWorkspaceRoots:ke.hiddenWorkspaceRoots,sessionsHasMoreByWorkspace:ke.sessionsHasMoreByWorkspace})),Gp=J(yI()),nu=J(kI()==="manual"?"manual":"recent");Qe(()=>[h2.value.map(e=>e.id).join("\0"),ke.loading],([e,t])=>{if(t)return;const n=e?e.split("\0"):[],o=$I(n,Gp.value);o!==null&&(Gp.value=o,kA(o))});const Oa=R(()=>{const e=h2.value.map(t=>({id:t.id,name:t.name,root:t.root,shortPath:D1e(t.root,ke.fsHome),sessionCount:t.sessionCount}));if(nu.value==="recent"){const t=new Map;for(const n of ke.sessions){if(n.parentSessionId)continue;const o=tu(n),s=new Date(n.updatedAt).getTime();s>(t.get(o)??Number.NEGATIVE_INFINITY)&&t.set(o,s)}return RI(e,t)}return FI(e,Gp.value)}),Jm=R(()=>{const e=ke.activeWorkspaceId,t=Oa.value;return e&&t.some(n=>n.id===e)?e:t[0]?.id??null});Qe(Jm,e=>{e&&(Object.prototype.hasOwnProperty.call(In.skillsByWorkspace.value,e)||In.loadSkillsForWorkspace(e))},{immediate:!0});const cge=R(()=>{const e=Jm.value;return e?Oa.value.find(t=>t.id===e)??null:null}),uge=R(()=>{Wd.value;const e=new Set(Oa.value.map(n=>n.id)),t=new Map(Oa.value.map(n=>[n.id,n.name]));return ke.sessions.filter(n=>!n.parentSessionId&&e.has(tu(n))).map(n=>{const o=tu(n);return{id:n.id,title:n.title,time:u2(n.updatedAt),busy:c2(n.id,n.mainTurnActive),pendingInteraction:n.pendingInteraction,lastTurnReason:n.lastTurnReason,lastPrompt:n.lastPrompt,workspaceId:o,workspaceName:t.get(o)}})}),dge=R(()=>{Wd.value;const e=new Map;for(const t of ke.sessions.toSorted((n,o)=>new Date(o.updatedAt).getTime()-new Date(n.updatedAt).getTime())){if(t.parentSessionId)continue;const n=tu(t),o={id:t.id,title:t.title,time:u2(t.updatedAt),busy:c2(t.id,t.mainTurnActive),pendingInteraction:t.pendingInteraction,lastTurnReason:t.lastTurnReason,updatedAt:t.updatedAt},s=e.get(n)??[];s.push(o),e.set(n,s)}return Oa.value.map(t=>({workspace:t,sessions:e.get(t.id)??[],hasMore:ke.sessionsHasMoreByWorkspace[t.id]??!1,loadingMore:ke.sessionsLoadingMoreByWorkspace[t.id]??!1,initialCount:ke.sessionsInitialCountByWorkspace[t.id]??Jv}))});function fge(e){Gp.value=e,kA(e),nu.value!=="manual"&&(nu.value="manual",bA("manual"))}function hge(e){nu.value!==e&&(nu.value=e,bA(e))}const M8=R(()=>{const e={};for(const[t,n]of Object.entries(ke.approvalsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);for(const[t,n]of Object.entries(ke.questionsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);return e}),pge=R(()=>{const e={};for(const[t,n]of Object.entries(ke.approvalsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).approvals=n.length);for(const[t,n]of Object.entries(ke.questionsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).questions=n.length);return e}),mge=R(()=>{const e={};for(const[t,n]of Object.entries(ke.unreadBySession))n&&(e[t]=!0);return e}),gge=R(()=>{const e={},t=M8.value;for(const n of ke.sessions){const o=t[n.id]??0;if(o<=0)continue;const s=tu(n);e[s]=(e[s]??0)+o}return e}),vge=R(()=>ke.recentRoots),yge=R(()=>ke.availableOpenInApps),ut=Cme(ke,{taskPoller:_8,sideChat:fs,modelProvider:In,pushOperationFailure:sf,activity:f2,sessionsKnownEmpty:x8,setSessions:r8,updateSession:Qm,upsertSessionFront:P1e,appendSession:H1e,forgetSession:c8,setActiveSessionId:r2,updateSessionMessages:a8,nextOptimisticMsgId:k8,getEventConn:()=>xi,syncSessionFromSnapshot:a2,reopenSession:m0e,hasLoadedMessages:d0e,refreshSessionStatus:of,refreshSessionGoal:j1e,persistSessionProfile:m8,mergedWorkspaces:h2,workspacesView:Oa,status:A8,workspaceIdForSession:tu,savePermissionToStorage:$1e,savePlanModeToStorage:n8,saveSwarmModeToStorage:o8,saveGoalModeToStorage:s8,draftModes:Zm,saveUnread:Py,saveActiveWorkspaceToStorage:B1e,saveHiddenWorkspacesToStorage:R1e,goalErrorMessage:a0e,resetFastMoon:Cr.resetFastMoon,initialized:h8,connectIssue:p8,selectedDiffPath:u8,fileDiffLines:d8,fileDiffLoading:f8});function p2(e){return e===ke.activeSessionId&&typeof document<"u"&&document.visibilityState==="visible"&&document.hasFocus()}function kge(e){if(ke.turnActiveBySession[e]){const t={...ke.turnActiveBySession};delete t[e],ke.turnActiveBySession=t}ke.inFlightBySession[e]&&(ke.inFlightBySession={...ke.inFlightBySession,[e]:!1})}function bge(e,t,n){const o=ke.promptIdBySession[e];ut.finishPromptLocal(e,{turnWasActive:n}),e===ke.activeSessionId?(ut.loadGitStatus(e),of(e)):t==="idle"&&(ke.unreadBySession={...ke.unreadBySession,[e]:!0},Py({[e]:!0}));const s=(ke.approvalsBySession[e]??[]).length>0,i=(ke.questionsBySession[e]??[]).length>0;Ppe(t,s,i)&&Ji.maybeNotifyCompletion(e,{isUserWatching:p2(e),sessionTitle:ke.sessions.find(r=>r.id===e)?.title??"",promptId:o,onClick:()=>{ut.selectSession(e)}}),t==="idle"&&Hd.maybePlayCompletionSound()}function xge(e,t){const n=t.questions[0],o=n?.header?.trim()??"",s=n?.question?.trim()??"",i=o&&s?`${o}: ${s}`:s||o;Ji.maybeNotifyQuestion({isUserWatching:p2(e),sessionTitle:ke.sessions.find(r=>r.id===e)?.title??"",questionPreview:i,questionId:t.questionId,onClick:()=>{ut.selectSession(e)}}),Hd.maybePlayQuestionSound()}function wge(e,t){Ji.maybeNotifyApproval({isUserWatching:p2(e),sessionTitle:ke.sessions.find(n=>n.id===e)?.title??"",toolName:t.toolName,approvalId:t.approvalId,onClick:()=>{ut.selectSession(e)}}),Hd.maybePlayApprovalSound()}function m2(){return v0e(),{workspace:_0e,sessions:S0e,activeSessionId:C0e,workspacesView:Oa,workspaceSortMode:nu,visibleWorkspace:cge,activeWorkspaceId:Jm,sessionsForView:uge,workspaceGroups:dge,attentionBySession:M8,pendingBySession:pge,attentionByWorkspace:gge,unreadBySession:mge,recentRoots:vge,turns:E0e,tasks:N0e,activeAppTasks:rf,todos:L0e,goal:bc,swarms:S8,swarmMembersByToolCallId:I0e,activationBadges:G0e,compaction:$0e,status:A8,sessionCost:oge,fileDiff:nge,selectedDiffPath:u8,fileDiffLoading:f8,changes:ege,gitInfo:sy,gitDiffStats:tge,activePullRequest:J0e,changesByPath:age,pendingApprovals:X0e,availableOpenInApps:yge,connection:F0e,loading:O0e,sessionLoading:R0e,loadingMoreMessages:B0e,hasMoreMessages:D0e,loadMoreMessagesError:P0e,serverVersion:H0e,backend:W0e,dangerousBypassAuth:z0e,clearDangerousBypassAuth:U0e,initialized:h8,connectIssue:p8,permission:q0e,thinking:j0e,planMode:C8,swarmMode:V0e,goalMode:K0e,queued:Y0e,warnings:Z0e,questions:Q0e,activity:f2,turnActive:Xm,inFlight:d2,working:T0e,isStartingFirstPrompt:M0e,fastMoon:Cr.fastMoon,models:In.models,starredModelIds:In.starredModelIds,providers:In.providers,uiFontSize:Cr.uiFontSize,setUiFontSize:Cr.setUiFontSize,conversationToc:v8,setConversationToc:G1e,colorScheme:Cr.colorScheme,setColorScheme:Cr.setColorScheme,accent:Cr.accent,setAccent:Cr.setAccent,notifyOnComplete:Ji.notifyOnComplete,notifyOnQuestion:Ji.notifyOnQuestion,notifyOnApproval:Ji.notifyOnApproval,notifyPermission:Ji.notifyPermission,setNotifyOnComplete:Ji.setNotifyOnComplete,setNotifyOnQuestion:Ji.setNotifyOnQuestion,setNotifyOnApproval:Ji.setNotifyOnApproval,soundOnComplete:Hd.soundOnComplete,setSoundOnComplete:Hd.setSoundOnComplete,onboarded:y8,setOnboarded:Z1e,load:ut.load,selectSession:ut.selectSession,clearActiveSession:ut.clearActiveSession,loadOlderMessages:ut.loadOlderMessages,loadWorkspaces:ut.loadWorkspaces,loadMoreSessions:ut.loadMoreSessions,loadAllSessions:ut.loadAllSessions,selectWorkspace:ut.selectWorkspace,openWorkspace:ut.openWorkspace,openWorkspaceDraft:ut.openWorkspaceDraft,startSessionAndSendPrompt:ut.startSessionAndSendPrompt,startSessionAndActivateSkill:ut.startSessionAndActivateSkill,startSessionAndOpenSideChat:ut.startSessionAndOpenSideChat,addWorkspaceByPath:ut.addWorkspaceByPath,browseFs:ut.browseFs,getFsHome:ut.getFsHome,sendPrompt:ut.sendPrompt,steerPrompt:ut.steerPrompt,sideChatVisible:fs.sideChatVisible,sideChatSessionId:fs.sideChatSessionId,sideChatTurns:fs.sideChatTurns,sideChatRunning:fs.sideChatRunning,sideChatSending:fs.sideChatSending,openSideChat:fs.openSideChat,closeSideChat:fs.closeSideChat,sendSideChatPrompt:fs.sendSideChatPrompt,uploadImage:ut.uploadImage,abortCurrentPrompt:ut.abortCurrentPrompt,respondApproval:ut.respondApproval,respondQuestion:ut.respondQuestion,dismissQuestion:ut.dismissQuestion,pendingQuestionActions:ut.pendingQuestionActions,pendingApprovalActions:ut.pendingApprovalActions,cancelTask:ut.cancelTask,setPermission:ut.setPermission,setThinking:In.setThinking,setPlanMode:ut.setPlanMode,togglePlanMode:ut.togglePlanMode,setSwarmMode:ut.setSwarmMode,toggleSwarmMode:ut.toggleSwarmMode,setGoalMode:ut.setGoalMode,toggleGoalMode:ut.toggleGoalMode,createGoal:ut.createGoal,controlGoal:ut.controlGoal,enqueue:ut.enqueue,dismissWarning:ut.dismissWarning,renameSession:ut.renameSession,renameWorkspace:ut.renameWorkspace,deleteWorkspace:ut.deleteWorkspace,reorderWorkspaces:fge,setWorkspaceSortMode:hge,archiveSession:ut.archiveSession,exportSession:ut.exportSession,restoreSession:ut.restoreSession,loadArchivedSessions:ut.loadArchivedSessions,compact:ut.compact,forkSession:ut.forkSession,undo:ut.undo,unqueue:ut.unqueue,reorderQueue:ut.reorderQueue,searchFiles:ut.searchFiles,loadGitStatus:ut.loadGitStatus,loadFileDiff:ut.loadFileDiff,clearFileDiff:ut.clearFileDiff,listDir:ut.listDir,readFileContent:ut.readFileContent,getFileDownloadUrl:ut.getFileDownloadUrl,openWorkspaceFile:ut.openWorkspaceFile,openInApp:ut.openInApp,revealWorkspaceFile:ut.revealWorkspaceFile,resolveImageUrl:ut.resolveImageUrl,loadModels:In.loadModels,loadProviders:In.loadProviders,skills:A0e,activateSkill:In.activateSkill,setModel:In.setModel,toggleStarModel:In.toggleStarModel,addProvider:In.addProvider,deleteProvider:In.deleteProvider,refreshProvider:In.refreshProvider,refreshAllProviders:In.refreshAllProviders,authReady:sge,defaultModel:ige,managedProviderStatus:rge,config:lge,updateConfig:ut.updateConfig,checkAuth:ut.checkAuth,startOAuthLogin:In.startOAuthLogin,pollOAuthLogin:In.pollOAuthLogin,cancelOAuthLogin:In.cancelOAuthLogin,logout:ut.logout}}const E8=Ze({__name:"LanguageSwitcher",setup(e){const{locale:t}=Tt(),n=_A.map(s=>({value:s.code,label:s.label}));function o(s){t.value!==s&&SA(s)}return(s,i)=>(w(),we(gs,{"model-value":C(t),options:C(n),"onUpdate:modelValue":o},null,8,["model-value","options"]))}}),_ge=["aria-checked","aria-label","disabled"],Sge=Ze({__name:"Switch",props:{modelValue:{type:Boolean},disabled:{type:Boolean},label:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(o,s)=>(w(),T("button",{class:We(["ui-switch",{"is-on":e.modelValue}]),type:"button",role:"switch","aria-checked":e.modelValue,"aria-label":e.label,disabled:e.disabled,onClick:s[0]||(s[0]=i=>n("update:modelValue",!e.modelValue))},[...s[1]||(s[1]=[_("span",{class:"ui-switch__thumb"},null,-1)])],10,_ge))}}),yr=ct(Sge,[["__scopeId","data-v-dbe22dc4"]]),Cge=["aria-label"],Age=["aria-selected","onClick"],Mge={class:"body"},Ege={class:"panel"},Tge={class:"sec"},Nge={class:"sec-title"},Ige={class:"row"},Lge={class:"rlabel"},$ge={class:"row"},Fge={class:"rlabel"},Oge={class:"row"},Rge={class:"rlabel"},Bge={class:"num-field"},Dge=["value","aria-label"],Pge={class:"row"},Hge={class:"rlabel"},Wge={class:"row"},zge={class:"rlabel"},Uge={class:"hint"},qge={class:"sec"},jge={class:"sec-title"},Vge={class:"row"},Kge={class:"rlabel"},Gge={key:0,class:"hint"},Yge={class:"row"},Zge={class:"rlabel"},Qge={key:0,class:"hint"},Xge={class:"row"},Jge={class:"rlabel"},eve={key:0,class:"hint"},tve={class:"row"},nve={class:"rlabel"},ove={class:"panel"},sve={class:"sec"},ive={class:"sec-title"},rve={class:"row"},lve={class:"rlabel"},ave={key:0,class:"rvalue"},cve={class:"actions"},uve={class:"panel"},dve={class:"sec"},fve={class:"sec-head"},hve={class:"sec-title"},pve={key:0,class:"saving"},mve={class:"row"},gve={class:"rlabel"},vve={class:"hint"},yve={key:0,class:"select-wrap"},kve={key:0,value:"",disabled:""},bve=["label"],xve=["value"],wve={key:1,class:"rvalue mono"},_ve={class:"row"},Sve={class:"rlabel"},Cve={class:"hint"},Ave={class:"row"},Mve={class:"rlabel"},Eve={class:"hint"},Tve={class:"row"},Nve={class:"rlabel"},Ive={class:"hint"},Lve={class:"row"},$ve={class:"rlabel"},Fve={class:"hint"},Ove={key:1,class:"empty-config"},Rve={class:"panel"},Bve={class:"sec"},Dve={class:"sec-title"},Pve={class:"row"},Hve={class:"rlabel"},Wve={class:"rvalue mono"},zve={class:"row"},Uve={class:"rlabel"},qve={class:"rvalue mono"},jve={class:"row"},Vve={class:"rlabel"},Kve={class:"rvalue mono"},Gve={key:0,class:"row"},Yve={class:"rlabel"},Zve={class:"hint"},Qve={class:"hint"},Xve={class:"row"},Jve={class:"rlabel"},eye={key:0,class:"hint"},tye={class:"panel"},nye={class:"panel-head"},oye={class:"panel-title"},sye={class:"panel-desc"},iye={class:"archive-toolbar"},rye={class:"archive-search"},lye=["placeholder"],aye={value:"all"},cye=["value"],uye={key:0,class:"archive-empty"},dye={key:0,class:"archive-list"},fye={class:"archive-workspace"},hye={class:"path"},pye={class:"count"},mye={class:"setting-card"},gye={class:"archive-meta"},vye={class:"archive-name"},yye={class:"archive-time"},kye={key:1,class:"archive-empty"},bye=100,xye=Ze({__name:"SettingsDialog",props:{colorScheme:{},accent:{},uiFontSize:{},authReady:{type:Boolean},accountModel:{},notify:{type:Boolean},notifyQuestion:{type:Boolean},notifyApproval:{type:Boolean},notifyPermission:{},sound:{type:Boolean},conversationToc:{type:Boolean},config:{},models:{},configSaving:{type:Boolean},serverVersion:{},backend:{}},emits:["setColorScheme","setAccent","setUiFontSize","setNotify","setNotifyQuestion","setNotifyApproval","setSound","setConversationToc","login","logout","openOnboarding","openProviders","updateConfig","close"],setup(e,{emit:t}){const{t:n}=Tt(),o=e,s=t,i=J("general"),r=[{id:"general",labelKey:"settings.tabs.general"},{id:"agent",labelKey:"settings.tabs.agent"},{id:"account",labelKey:"settings.tabs.account"},{id:"advanced",labelKey:"settings.tabs.advanced"},{id:"archived",labelKey:"settings.tabs.archived"}],l=AI(),a=R(()=>o.backend==="v2"?"v2 (kap-server)":"v1 (server)"),c=["manual","auto","yolo"],u={manual:"status.permissionManual",auto:"status.permissionAuto",yolo:"status.permissionYolo"},d=J(null);jk(d);function f(ne){ne.key==="Escape"&&s("close")}cn(()=>document.addEventListener("keydown",f)),bn(()=>document.removeEventListener("keydown",f));function h(){h5()}const p=R(()=>{const ne=new Map;for(const ue of o.models??[])ne.set(ue.id,{id:ue.id,label:ue.displayName??ue.model??ue.id,provider:ue.provider});for(const[ue,de]of Object.entries(o.config?.models??{})){if(ne.has(ue))continue;const Ce=v(de);ne.set(ue,{id:ue,label:m(ue,de,Ce),provider:Ce??ue})}return Array.from(ne.values())}),g=R(()=>{const ne=new Map;for(const ue of p.value){const de=ne.get(ue.provider)??[];de.push(ue),ne.set(ue.provider,de)}for(const ue of ne.values())ue.sort((de,Ce)=>de.label.localeCompare(Ce.label));return Array.from(ne.entries()).toSorted(([ue],[de])=>ue.localeCompare(de)).map(([ue,de])=>({provider:ue,options:de}))}),b=R(()=>{const ne=o.config?.defaultPermissionMode;return ne==="auto"||ne==="yolo"||ne==="manual"?ne:"manual"});function v(ne){if(!ne||typeof ne!="object")return;const ue=ne;return typeof ue.provider=="string"?ue.provider:void 0}function m(ne,ue,de){if(!ue||typeof ue!="object")return ne;const Ce=ue,Ie=typeof Ce.model=="string"?Ce.model:void 0,le=de??v(ue);return Ie&&le?`${ne} (${le}/${Ie})`:Ie?`${ne} (${Ie})`:ne}function y(ne){return ne===!0}function k(ne){!ne||ne===o.config?.defaultModel||s("updateConfig",{defaultModel:ne})}function A(ne){ne!==b.value&&s("updateConfig",{defaultPermissionMode:ne})}function $(ne){const ue=o.config?.[ne];s("updateConfig",{[ne]:!y(ue)})}function I(){const ne=o.config?.thinking;return!ne||typeof ne!="object"?!0:ne.enabled!==!1}function x(){s("updateConfig",{thinking:{enabled:!I()}})}function L(){const ne=o.config?.telemetry!==!1;s("updateConfig",{telemetry:!ne})}function E(ne){i.value=ne}const F=m2(),S=J([]),N=J(!1),D=J(!1),B=J(""),U=J("all"),H=J("archived-desc");async function P(){if(!(N.value||D.value)){N.value=!0;try{const ne=[];let ue;for(;;){const de=await F.loadArchivedSessions({beforeId:ue,pageSize:bye});if(ne.push(...de.items),!de.hasMore||de.items.length===0)break;const Ce=de.items.at(-1)?.id;if(Ce===void 0)break;ue=Ce}S.value=ne,D.value=!0}catch(ne){console.warn("loadAllArchived failed",ne)}finally{N.value=!1}}}Qe(i,ne=>{ne==="archived"&&!D.value&&P()});const Z=R(()=>{const ne=new Set;for(const ue of S.value)ne.add(ue.cwd);return Array.from(ne).sort((ue,de)=>ue.localeCompare(de))}),K=R(()=>{const ne=B.value.trim().toLowerCase();let ue=S.value.filter(de=>de.archived===!0);return U.value!=="all"&&(ue=ue.filter(de=>de.cwd===U.value)),ne&&(ue=ue.filter(de=>de.title.toLowerCase().includes(ne))),ue=ue.slice(),H.value==="archived-desc"?ue.sort((de,Ce)=>Ce.updatedAt.localeCompare(de.updatedAt)):H.value==="created-desc"?ue.sort((de,Ce)=>Ce.createdAt.localeCompare(de.createdAt)):ue.sort((de,Ce)=>de.title.localeCompare(Ce.title,"zh")),ue}),V=R(()=>{const ne=new Map;for(const ue of K.value){const de=ne.get(ue.cwd)??[];de.push(ue),ne.set(ue.cwd,de)}return Array.from(ne.entries()).map(([ue,de])=>({cwd:ue,items:de}))});async function X(ne){await F.restoreSession(ne)&&(S.value=S.value.filter(de=>de.id!==ne))}function he(ne){const ue=new Date(ne);if(Number.isNaN(ue.getTime()))return ne;const de=Ce=>String(Ce).padStart(2,"0");return`${ue.getFullYear()}-${de(ue.getMonth()+1)}-${de(ue.getDate())} ${de(ue.getHours())}:${de(ue.getMinutes())}`}return(ne,ue)=>(w(),we(qr,{open:!0,"close-on-esc":!1,title:C(n)("settings.title"),size:"xl",height:"fixed",padded:!1,onClose:ue[19]||(ue[19]=de=>s("close"))},{default:Ee(()=>[_("div",{ref_key:"dialogRef",ref:d,class:"sd"},[_("nav",{class:"settings-tabs",role:"tablist","aria-label":C(n)("settings.title")},[(w(),T(Pe,null,ot(r,de=>_("button",{key:de.id,type:"button",class:We(["tab",{on:i.value===de.id}]),role:"tab","aria-selected":i.value===de.id,onClick:Ce=>E(de.id)},O(C(n)(de.labelKey)),11,Age)),64))],8,Cge),_("div",Mge,[Fn(_("section",Ege,[_("section",Tge,[_("h3",Nge,O(C(n)("settings.appearance")),1),_("div",Ige,[_("span",Lge,O(C(n)("theme.colorSchemeLabel")),1),re(gs,{"model-value":e.colorScheme,options:[{value:"light",label:C(n)("theme.light")},{value:"dark",label:C(n)("theme.dark")},{value:"system",label:C(n)("theme.system")}],"onUpdate:modelValue":ue[0]||(ue[0]=de=>s("setColorScheme",de))},null,8,["model-value","options"])]),_("div",$ge,[_("span",Fge,O(C(n)("theme.accentLabel")),1),re(gs,{"model-value":e.accent,options:[{value:"blue",label:C(n)("theme.accentBlue")},{value:"mono",label:C(n)("theme.accentBlack")}],"onUpdate:modelValue":ue[1]||(ue[1]=de=>s("setAccent",de))},null,8,["model-value","options"])]),_("div",Oge,[_("span",Rge,O(C(n)("settings.uiFontSize")),1),_("label",Bge,[_("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":C(n)("settings.uiFontSize"),onInput:ue[2]||(ue[2]=de=>s("setUiFontSize",Number(de.target.value)))},null,40,Dge),ue[20]||(ue[20]=_("span",{class:"num-unit"},"px",-1))])]),_("div",Pge,[_("span",Hge,O(C(n)("sidebar.language")),1),re(E8)]),_("div",Wge,[_("span",zge,[Je(O(C(n)("settings.conversationToc"))+" ",1),_("span",Uge,O(C(n)("settings.conversationTocHint")),1)]),re(yr,{"model-value":e.conversationToc??!0,label:C(n)("settings.conversationToc"),"onUpdate:modelValue":ue[3]||(ue[3]=de=>s("setConversationToc",de))},null,8,["model-value","label"])])]),_("section",qge,[_("h3",jge,O(C(n)("settings.notifications")),1),_("div",Vge,[_("span",Kge,[Je(O(C(n)("settings.notifyOnComplete"))+" ",1),e.notifyPermission==="denied"?(w(),T("span",Gge,O(C(n)("settings.notifyDenied")),1)):ce("",!0)]),re(yr,{"model-value":e.notify,disabled:e.notifyPermission==="denied",label:C(n)("settings.notifyOnComplete"),"onUpdate:modelValue":ue[4]||(ue[4]=de=>s("setNotify",de))},null,8,["model-value","disabled","label"])]),_("div",Yge,[_("span",Zge,[Je(O(C(n)("settings.notifyOnQuestion"))+" ",1),e.notifyPermission==="denied"?(w(),T("span",Qge,O(C(n)("settings.notifyDenied")),1)):ce("",!0)]),re(yr,{"model-value":e.notifyQuestion,disabled:e.notifyPermission==="denied",label:C(n)("settings.notifyOnQuestion"),"onUpdate:modelValue":ue[5]||(ue[5]=de=>s("setNotifyQuestion",de))},null,8,["model-value","disabled","label"])]),_("div",Xge,[_("span",Jge,[Je(O(C(n)("settings.notifyOnApproval"))+" ",1),e.notifyPermission==="denied"?(w(),T("span",eve,O(C(n)("settings.notifyDenied")),1)):ce("",!0)]),re(yr,{"model-value":e.notifyApproval,disabled:e.notifyPermission==="denied",label:C(n)("settings.notifyOnApproval"),"onUpdate:modelValue":ue[6]||(ue[6]=de=>s("setNotifyApproval",de))},null,8,["model-value","disabled","label"])]),_("div",tve,[_("span",nve,O(C(n)("settings.soundOnComplete")),1),re(yr,{"model-value":e.sound,label:C(n)("settings.soundOnComplete"),"onUpdate:modelValue":ue[7]||(ue[7]=de=>s("setSound",de))},null,8,["model-value","label"])])])],512),[[mi,i.value==="general"]]),Fn(_("section",ove,[_("section",sve,[_("h3",ive,O(C(n)("settings.account")),1),_("div",rve,[_("span",lve,O(e.authReady?"managed:kimi-code":C(n)("sidebar.notSignedIn")),1),re(Xt,{text:e.accountModel},{default:Ee(()=>[e.authReady&&e.accountModel?(w(),T("span",ave,O(e.accountModel),1)):ce("",!0)]),_:1},8,["text"])]),_("div",cve,[re(Bt,{variant:"secondary",size:"sm",onClick:ue[8]||(ue[8]=de=>{s("openOnboarding"),s("close")})},{default:Ee(()=>[Je(O(C(n)("onboarding.reopen")),1)]),_:1}),e.authReady?(w(),we(Bt,{key:0,variant:"danger-soft",size:"sm",onClick:ue[9]||(ue[9]=de=>s("logout"))},{default:Ee(()=>[Je(O(C(n)("sidebar.signOut")),1)]),_:1})):(w(),we(Bt,{key:1,variant:"primary",size:"sm",onClick:ue[10]||(ue[10]=de=>s("login"))},{default:Ee(()=>[Je(O(C(n)("sidebar.signIn")),1)]),_:1}))])])],512),[[mi,i.value==="account"]]),Fn(_("section",uve,[_("section",dve,[_("div",fve,[_("h3",hve,O(C(n)("settings.agentDefaults")),1),e.configSaving?(w(),T("span",pve,O(C(n)("settings.saving")),1)):ce("",!0)]),e.config?(w(),T(Pe,{key:0},[_("div",mve,[_("span",gve,[Je(O(C(n)("settings.defaultModel"))+" ",1),_("span",vve,O(C(n)("settings.defaultModelHint")),1)]),g.value.length>0?(w(),T("div",yve,[re(Yv,{"model-value":e.config.defaultModel??"",disabled:e.configSaving,"aria-label":C(n)("settings.defaultModel"),"onUpdate:modelValue":k},{default:Ee(()=>[e.config.defaultModel?ce("",!0):(w(),T("option",kve,O(C(n)("settings.noDefaultModel")),1)),(w(!0),T(Pe,null,ot(g.value,de=>(w(),T("optgroup",{key:de.provider,label:de.provider},[(w(!0),T(Pe,null,ot(de.options,Ce=>(w(),T("option",{key:Ce.id,value:Ce.id},O(Ce.label),9,xve))),128))],8,bve))),128))]),_:1},8,["model-value","disabled","aria-label"])])):(w(),T("span",wve,O(e.config.defaultModel??C(n)("settings.noDefaultModel")),1))]),_("div",_ve,[_("span",Sve,[Je(O(C(n)("settings.defaultPermission"))+" ",1),_("span",Cve,O(C(n)("settings.defaultPermissionHint")),1)]),re(gs,{"model-value":b.value,options:c.map(de=>({value:de,label:C(n)(u[de])})),"onUpdate:modelValue":ue[11]||(ue[11]=de=>A(de))},null,8,["model-value","options"])]),_("div",Ave,[_("span",Mve,[Je(O(C(n)("settings.defaultThinking"))+" ",1),_("span",Eve,O(C(n)("settings.defaultThinkingHint")),1)]),re(yr,{"model-value":I(),disabled:e.configSaving,label:C(n)("settings.defaultThinking"),"onUpdate:modelValue":ue[12]||(ue[12]=de=>x())},null,8,["model-value","disabled","label"])]),_("div",Tve,[_("span",Nve,[Je(O(C(n)("settings.defaultPlanMode"))+" ",1),_("span",Ive,O(C(n)("settings.defaultPlanModeHint")),1)]),re(yr,{"model-value":y(e.config.defaultPlanMode),disabled:e.configSaving,label:C(n)("settings.defaultPlanMode"),"onUpdate:modelValue":ue[13]||(ue[13]=de=>$("defaultPlanMode"))},null,8,["model-value","disabled","label"])]),_("div",Lve,[_("span",$ve,[Je(O(C(n)("settings.mergeSkills"))+" ",1),_("span",Fve,O(C(n)("settings.mergeSkillsHint")),1)]),re(yr,{"model-value":y(e.config.mergeAllAvailableSkills),disabled:e.configSaving,label:C(n)("settings.mergeSkills"),"onUpdate:modelValue":ue[14]||(ue[14]=de=>$("mergeAllAvailableSkills"))},null,8,["model-value","disabled","label"])])],64)):(w(),T("div",Ove,O(C(n)("settings.configUnavailable")),1))])],512),[[mi,i.value==="agent"]]),Fn(_("section",Rve,[_("section",Bve,[_("h3",Dve,O(C(n)("settings.advanced")),1),_("div",Pve,[_("span",Hve,O(C(n)("sidebar.daemon")),1),_("span",Wve,O(C(l)),1)]),_("div",zve,[_("span",Uve,O(C(n)("settings.backend")),1),_("span",qve,O(a.value),1)]),_("div",jve,[_("span",Vve,O(C(n)("settings.serverVersion")),1),_("span",Kve,O(e.serverVersion||"-"),1)]),e.config?(w(),T("div",Gve,[_("span",Yve,[Je(O(C(n)("settings.telemetry"))+" ",1),_("span",Zve,O(C(n)("settings.telemetryHint")),1),_("span",Qve,O(C(n)("settings.telemetryRestartHint")),1)]),re(yr,{"model-value":e.config.telemetry!==!1,disabled:e.configSaving,label:C(n)("settings.telemetry"),"onUpdate:modelValue":ue[15]||(ue[15]=de=>L())},null,8,["model-value","disabled","label"])])):ce("",!0),_("div",Xve,[_("span",Jve,[Je(O(C(n)("settings.exportLog"))+" ",1),C(Hi)()?ce("",!0):(w(),T("span",eye,O(C(n)("settings.logHint")),1))]),re(Bt,{variant:"secondary",size:"sm",onClick:h},{default:Ee(()=>[Je(O(C(n)("settings.exportLogBtn")),1)]),_:1})])])],512),[[mi,i.value==="advanced"]]),Fn(_("section",tye,[_("div",nye,[ue[21]||(ue[21]=_("div",{class:"panel-kicker"},"Archived sessions",-1)),_("h4",oye,O(C(n)("settings.archivedTitle")),1),_("p",sye,O(C(n)("settings.archivedDesc")),1)]),_("div",iye,[_("label",rye,[ue[22]||(ue[22]=_("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[_("circle",{cx:"11",cy:"11",r:"7"}),_("path",{d:"m21 21-4.3-4.3"})],-1)),Fn(_("input",{"onUpdate:modelValue":ue[16]||(ue[16]=de=>B.value=de),placeholder:C(n)("settings.archivedSearch")},null,8,lye),[[_s,B.value]])]),re(Yv,{"model-value":U.value,size:"sm","aria-label":C(n)("settings.archivedAllWorkspaces"),"onUpdate:modelValue":ue[17]||(ue[17]=de=>U.value=de)},{default:Ee(()=>[_("option",aye,O(C(n)("settings.archivedAllWorkspaces")),1),(w(!0),T(Pe,null,ot(Z.value,de=>(w(),T("option",{key:de,value:de},O(de),9,cye))),128))]),_:1},8,["model-value","aria-label"]),re(gs,{size:"sm","model-value":H.value,options:[{value:"archived-desc",label:C(n)("settings.archivedSortArchived")},{value:"created-desc",label:C(n)("settings.archivedSortCreated")},{value:"name-asc",label:C(n)("settings.archivedSortName")}],"onUpdate:modelValue":ue[18]||(ue[18]=de=>H.value=de)},null,8,["model-value","options"])]),N.value?(w(),T("div",uye,O(C(n)("settings.archivedLoadingAll")),1)):(w(),T(Pe,{key:1},[V.value.length>0?(w(),T("div",dye,[(w(!0),T(Pe,null,ot(V.value,de=>(w(),T("section",{key:de.cwd,class:"archive-card"},[_("div",fye,[ue[23]||(ue[23]=_("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[_("path",{d:"M3 7h6l2 2h10v9H3z"}),_("path",{d:"M3 7V5h6l2 2"})],-1)),_("span",hye,O(de.cwd),1),_("span",pye,O(C(n)("settings.archivedSessionsCount",{count:de.items.length})),1)]),_("div",mye,[(w(!0),T(Pe,null,ot(de.items,Ce=>(w(),T("div",{key:Ce.id,class:"archive-row"},[_("div",gye,[_("div",vye,O(Ce.title),1),_("div",yye,O(C(n)("settings.archivedAt",{time:he(Ce.updatedAt)})),1)]),re(Bt,{variant:"secondary",size:"sm",onClick:Ie=>X(Ce.id)},{default:Ee(()=>[Je(O(C(n)("settings.archivedRestore")),1)]),_:1},8,["onClick"])]))),128))])]))),128))])):(w(),T("div",kye,O(S.value.length===0?C(n)("settings.archivedEmpty"):C(n)("settings.archivedNoMatch")),1))],64))],512),[[mi,i.value==="archived"]])])],512)]),_:1},8,["title"]))}}),wye=ct(xye,[["__scopeId","data-v-2377814f"]]),_ye=/^(?:\/|~(?:\/|$)|[A-Za-z]:[\\/]|\\\\)/,T8=/^[A-Za-z]:[\\/]/,Sye=/^\/\/(?!\/)/;function Cg(e){return _ye.test(e.trim())}function Cye(e,t){return e==="~"?t||e:e.startsWith("~/")?(t||"~")+e.slice(1):e}function Aye(e){return Sye.test(e)?`//${e.slice(2).replaceAll(/\/{2,}/g,"/")}`:e.replaceAll(/\/{2,}/g,"/")}function Mye(e){return T8.test(e)||e.startsWith("\\\\")||e.startsWith("//")}function Eye(e){return T8.test(e)?3:e.startsWith("\\\\")||e.startsWith("//")?2:e.startsWith("/")?1:0}function iy(e,t){let n=Aye(Cye(e.trim(),t));const o=Mye(n),s=n==="/"||n==="//"||n==="\\\\"||/^[A-Za-z]:[\\/]$/.test(n),i=o?/[\\/]$/.test(n):n.endsWith("/");!s&&i&&(n=n.slice(0,-1));const r=n.lastIndexOf("/"),l=o?n.lastIndexOf("\\"):-1,a=Math.max(r,l),c=l>r?"\\":"/",u=Eye(n),d=a<u?n.slice(0,u)||"/":n.slice(0,a)||"/";return{target:n,parent:d,base:n.slice(a+1),separator:c}}function Tye(e,t,n){return`${e}${e.endsWith(n)?"":n}${t}`}function Nye(e,t,n){if(n===null)return null;const{target:o}=iy(e,t);return o===n?n:null}const Iye={class:"aw"},Lye={key:0,class:"crumbbar"},$ye={class:"crumbs"},Fye={key:0,class:"crumb-sep"},Oye=["onClick"],Rye=["placeholder"],Bye={key:2,class:"folder-list"},Dye={key:0,class:"fl-loading"},Pye={key:0,class:"fl-loading"},Hye={key:0,class:"fl-note"},Wye=["onClick"],zye={class:"folder-name"},Uye={key:1,class:"fl-empty fl-error"},qye={key:2,class:"fl-empty fl-error"},jye=["onClick"],Vye={class:"folder-name search-rel"},Kye={key:0,class:"fl-empty"},Gye={key:1,class:"fl-loading"},Yye=["onClick"],Zye={class:"folder-name"},Qye={key:0,class:"fl-empty"},Xye={key:3,class:"degraded-hint"},Jye={key:4,class:"add-error",role:"alert"},eke={class:"actions"},tke={class:"footer-hint"},nke=600,oke=6,c4=150,ske=Ze({__name:"AddWorkspaceDialog",props:{browseFs:{type:Function},getFsHome:{type:Function},defaultPath:{},error:{}},emits:["add","close"],setup(e,{emit:t}){const{t:n}=Tt(),o=e,s=t,i=J(!0),r=J(!1),l=J(!1),a=J(""),c=J(null),u=J([]),d=J(""),f=J(!1),h=J([]),p=R(()=>d.value.trim().length>0);let g=0,b=null;const v=R(()=>Cg(d.value)),m=J("idle"),y=J(""),k=J("/"),A=J([]),$=J(""),I=J(null),x=J(null),L=R(()=>m.value!=="valid"?null:Nye(d.value,$.value,x.value));let E=0,F=null;function S(ue,de){const Ce=ue.toLowerCase(),Ie=de.toLowerCase();let le=0;for(let z=0;z<Ie.length&&le<Ce.length;z++)Ie[z]===Ce[le]&&le++;return le===Ce.length}async function N(ue){const de=a.value,Ce=ue.trim();if(!de||Ce===""){h.value=[],f.value=!1;return}const Ie=++g;f.value=!0;const le=[],z=[{path:de,depth:0}];let ae=0;for(;z.length>0&&ae<nke&&le.length<c4;){if(Ie!==g)return;const ie=z.shift();ae++;let q;try{q=await o.browseFs(ie.path)}catch{continue}if(Ie!==g)return;for(const ee of q.entries){if(!ee.isDir)continue;const ye=ee.path.startsWith(de)?ee.path.slice(de.length).replace(/^\/+/,""):ee.path;if(S(Ce,ye||ee.name)&&(le.push({path:ee.path,name:ee.name,rel:ye||ee.name}),le.length>=c4))break;ie.depth+1<oke&&z.push({path:ee.path,depth:ie.depth+1})}Ie===g&&(h.value=[...le])}Ie===g&&(f.value=!1)}Qe(d,ue=>{b&&clearTimeout(b),F&&clearTimeout(F),E++,m.value="idle",A.value=[],x.value=null;const de=ue.trim();if(de===""){g++,h.value=[],f.value=!1;return}if(Cg(de)){if(g++,h.value=[],f.value=!1,l.value)return;m.value="checking",F=setTimeout(()=>void D(de),150);return}b=setTimeout(()=>void N(ue),220)});async function D(ue){const de=++E;m.value="checking",x.value=null;const Ce=iy(ue,$.value),{target:Ie}=Ce;try{const z=await o.browseFs(Ie);if(de!==E)return;if(z.path){m.value="valid",A.value=[],x.value=Ie,a.value=z.path,c.value=z.parent,u.value=z.entries,l.value=!1;return}}catch{}if(de!==E)return;const le=Ce.base.toLowerCase();y.value=Ce.parent,k.value=Ce.separator;try{const z=await o.browseFs(Ce.parent);if(de!==E)return;if(z.path){A.value=z.entries.filter(ae=>ae.isDir&&ae.name.toLowerCase().startsWith(le)),m.value="not-found";return}}catch{}de===E&&(A.value=[],m.value="bad-parent")}function B(ue){d.value=Tye(y.value,ue,k.value),I.value?.focus()}const U=R(()=>l.value?n("workspace.degradedPlaceholder"):n("workspace.searchPlaceholder")),H=R(()=>l.value?n("workspace.degradedHint"):v.value&&m.value==="valid"?n("workspace.pathFollowHint"):n("workspace.browseHint"));function P(ue){if(ue.key==="Escape"){d.value?d.value="":s("close");return}if(ue.key!=="Enter")return;const de=d.value.trim();if(Cg(de)){if(ue.preventDefault(),l.value){const{target:Ce}=iy(de,$.value);Ce&&s("add",Ce);return}m.value==="valid"?ne():m.value==="not-found"&&A.value[0]&&B(A.value[0].name)}}const Z=R(()=>{const ue=a.value;if(!ue)return[];const de=ue.split("/").filter(Boolean),Ce=[{label:"/",path:"/"}];let Ie="";for(const le of de)Ie+=`/${le}`,Ce.push({label:le,path:Ie});return Ce}),K=R(()=>!(a.value.length===0||v.value&&L.value===null));async function V(ue){r.value=!0;try{const de=await o.browseFs(ue);if(!de.path){l.value=!0;return}a.value=de.path,c.value=de.parent,u.value=de.entries,d.value="",l.value=!1}catch{l.value=!0}finally{r.value=!1}}function X(ue){ue.isDir&&V(ue.path)}function he(){c.value&&V(c.value)}function ne(){K.value&&s("add",L.value??a.value)}return cn(async()=>{r.value=!0;try{const ue=await o.getFsHome().catch(()=>({home:"",recentRoots:[]}));if(ue.home&&($.value=ue.home),o.defaultPath&&(await V(o.defaultPath),!l.value))return;$.value?await V($.value):l.value=!0}catch{l.value=!0}finally{r.value=!1}}),bn(()=>{b&&clearTimeout(b),F&&clearTimeout(F)}),(ue,de)=>(w(),we(qr,{open:i.value,"onUpdate:open":de[2]||(de[2]=Ce=>i.value=Ce),title:C(n)("workspace.addTitle"),size:"lg",height:"fixed",onClose:de[3]||(de[3]=Ce=>s("close"))},{default:Ee(()=>[_("div",Iye,[l.value?ce("",!0):(w(),T("div",Lye,[re(Pn,{size:"sm",disabled:!c.value,label:C(n)("workspace.up"),onClick:he},{default:Ee(()=>[re(Ve,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),_("div",$ye,[(w(!0),T(Pe,null,ot(Z.value,(Ce,Ie)=>(w(),T(Pe,{key:Ce.path},[Ie>1?(w(),T("span",Fye,"/")):ce("",!0),_("button",{class:We(["crumb",{last:Ie===Z.value.length-1}]),onClick:le=>V(Ce.path)},O(Ce.label),11,Oye)],64))),128))])])),!r.value||l.value?(w(),T("div",{key:1,class:We(["filterbar",{"has-error":m.value==="not-found"||m.value==="bad-parent"}])},[re(Ve,{class:"filter-icon",name:"search",size:"md"}),Fn(_("input",{ref_key:"filterEl",ref:I,"onUpdate:modelValue":de[0]||(de[0]=Ce=>d.value=Ce),class:"filter-input",type:"text",placeholder:U.value,autocomplete:"off",spellcheck:"false",onKeydown:bt(P,["stop"])},null,40,Rye),[[_s,d.value]]),f.value||m.value==="checking"?(w(),we(Ds,{key:0,size:"sm"})):ce("",!0)],2)):ce("",!0),l.value?(w(),T("div",Xye,O(C(n)("workspace.degradedHint")),1)):(w(),T("div",Bye,[r.value?(w(),T("div",Dye,O(C(n)("workspace.browsing")),1)):v.value&&m.value!=="valid"?(w(),T(Pe,{key:1},[m.value==="checking"?(w(),T("div",Pye,O(C(n)("workspace.checkingPath")),1)):m.value==="not-found"?(w(),T(Pe,{key:1},[A.value.length>0?(w(),T("div",Hye,O(C(n)("workspace.pathPickHint")),1)):ce("",!0),(w(!0),T(Pe,null,ot(A.value,Ce=>(w(),T("button",{key:Ce.path,class:"folder-row",onClick:Ie=>B(Ce.name)},[re(Ve,{class:"dir-icon",name:"folder-closed",size:"sm"}),_("span",zye,O(Ce.name),1)],8,Wye))),128)),A.value.length===0?(w(),T("div",Uye,O(C(n)("workspace.noPathMatch",{parent:y.value})),1)):ce("",!0)],64)):m.value==="bad-parent"?(w(),T("div",qye,O(C(n)("workspace.badParent",{parent:y.value})),1)):ce("",!0)],64)):p.value&&!v.value?(w(),T(Pe,{key:2},[(w(!0),T(Pe,null,ot(h.value,Ce=>(w(),T("button",{key:Ce.path,class:"folder-row",onClick:Ie=>V(Ce.path)},[re(Ve,{class:"dir-icon",name:"folder-closed",size:"sm"}),_("span",Vye,O(Ce.rel),1)],8,jye))),128)),!f.value&&h.value.length===0?(w(),T("div",Kye,O(C(n)("workspace.noFilterMatch",{q:d.value.trim()})),1)):f.value&&h.value.length===0?(w(),T("div",Gye,O(C(n)("workspace.searching")),1)):ce("",!0)],64)):(w(),T(Pe,{key:3},[(w(!0),T(Pe,null,ot(u.value,Ce=>(w(),T("button",{key:Ce.path,class:"folder-row",onClick:Ie=>X(Ce)},[re(Ve,{class:"dir-icon",name:"folder-closed",size:"sm"}),_("span",Zye,O(Ce.name),1)],8,Yye))),128)),u.value.length===0?(w(),T("div",Qye,O(C(n)("workspace.noSubfolders")),1)):ce("",!0)],64))])),e.error?(w(),T("div",Jye,O(e.error),1)):ce("",!0),_("div",eke,[re(Xt,{text:a.value},{default:Ee(()=>[l.value?ce("",!0):(w(),we(Bt,{key:0,variant:"primary",disabled:!K.value,onClick:ne},{default:Ee(()=>[Je(O(C(n)("workspace.openThisFolder")),1)]),_:1},8,["disabled"]))]),_:1},8,["text"]),re(Bt,{variant:"secondary",onClick:de[1]||(de[1]=Ce=>s("close"))},{default:Ee(()=>[Je(O(C(n)("workspace.cancel")),1)]),_:1})]),_("div",tke,O(H.value),1)])]),_:1},8,["open","title"]))}}),ike=ct(ske,[["__scopeId","data-v-07cbb13d"]]),rke={key:0,class:"confirm-dialog__message"},lke=Ze({__name:"ConfirmDialog",props:{open:{type:Boolean},title:{},message:{},confirmLabel:{},cancelLabel:{},variant:{default:"danger"},loading:{type:Boolean}},emits:["update:open","confirm","cancel"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Tt();function i(){n.loading||(o("update:open",!1),o("cancel"))}function r(l){if(l.key!=="Enter"||!n.open||n.loading)return;const a=l.target;a instanceof HTMLButtonElement||a instanceof HTMLAnchorElement||a instanceof HTMLTextAreaElement||a instanceof HTMLSelectElement||a instanceof HTMLInputElement||(l.preventDefault(),o("confirm"))}return typeof window<"u"&&window.addEventListener("keydown",r),po(()=>{typeof window<"u"&&window.removeEventListener("keydown",r)}),(l,a)=>(w(),we(qr,{open:e.open,title:e.title,height:"auto","initial-focus":".confirm-dialog__confirm","close-on-esc":!e.loading,"close-on-overlay":!e.loading,"onUpdate:open":a[1]||(a[1]=c=>o("update:open",c)),onClose:i},{foot:Ee(()=>[re(Bt,{variant:"secondary",disabled:e.loading,onClick:i},{default:Ee(()=>[Je(O(e.cancelLabel??C(s)("common.cancel")),1)]),_:1},8,["disabled"]),re(Bt,{class:"confirm-dialog__confirm",variant:e.variant,loading:e.loading,onClick:a[0]||(a[0]=c=>o("confirm"))},{default:Ee(()=>[Je(O(e.confirmLabel??C(s)("common.confirm")),1)]),_:1},8,["variant","loading"])]),default:Ee(()=>[e.message?(w(),T("p",rke,O(e.message),1)):ce("",!0)]),_:1},8,["open","title","close-on-esc","close-on-overlay"]))}}),ake=ct(lke,[["__scopeId","data-v-2e719024"]]),cke=Ze({__name:"ConfirmDialogHost",setup(e){const{current:t,busy:n,settle:o,runAction:s}=tf();function i(){s()}return(r,l)=>(w(),we(ake,{open:C(t)!==null,title:C(t)?.title??"",message:C(t)?.message,"confirm-label":C(t)?.confirmLabel,"cancel-label":C(t)?.cancelLabel,variant:C(t)?.variant,loading:C(n),onConfirm:i,onCancel:l[0]||(l[0]=a=>C(o)(!1))},null,8,["open","title","message","confirm-label","cancel-label","variant","loading"]))}}),uke={class:"rows"},dke={class:"row"},fke={class:"row"},hke={class:"row"},pke={class:"row"},mke={class:"row"},gke={class:"row"},vke={class:"ctx-text"},yke={key:0,class:"bar"},kke={class:"row"},bke=Ze({__name:"StatusPanel",props:{status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},costUsd:{}},emits:["close"],setup(e,{emit:t}){const{t:n}=Tt(),o=e,s=t,i=J(!0),r=R(()=>o.status.ctxMax<=0?0:Math.min(100,Math.max(0,Math.ceil(o.status.ctxUsed/o.status.ctxMax*100)))),l=R(()=>o.status.ctxMax>0?n("status.statusContextValue",{used:ir(o.status.ctxUsed),max:ir(o.status.ctxMax),pct:r.value}):n("status.statusNone"));function a(p){return n(p==="yolo"?"status.permissionYolo":p==="auto"?"status.permissionAuto":"status.permissionManual")}const c=R(()=>{const p=o.status.permission;return p==="yolo"?"var(--color-danger)":p==="auto"?"var(--color-warning)":"var(--color-text)"}),u=R(()=>o.planMode?n("status.planOn"):n("status.planOff")),d=R(()=>o.swarmMode?n("status.swarmOn"):n("status.swarmOff")),f=R(()=>typeof o.costUsd=="number"&&o.costUsd>0),h=R(()=>f.value?`$${o.costUsd.toFixed(4)}`:n("status.statusNone"));return(p,g)=>(w(),we(qr,{open:i.value,"onUpdate:open":g[0]||(g[0]=b=>i.value=b),title:C(n)("status.statusPanelTitle"),onClose:g[1]||(g[1]=b=>s("close"))},{default:Ee(()=>[_("dl",uke,[_("div",dke,[_("dt",null,O(C(n)("status.statusModel")),1),_("dd",null,O(e.status.model),1)]),_("div",fke,[_("dt",null,O(C(n)("status.statusThinking")),1),_("dd",null,O(e.thinking),1)]),_("div",hke,[_("dt",null,O(C(n)("status.statusPermission")),1),_("dd",{style:Yt({color:c.value})},O(a(e.status.permission)),5)]),_("div",pke,[_("dt",null,O(C(n)("status.statusPlanMode")),1),_("dd",{class:We({"plan-on":e.planMode})},O(u.value),3)]),_("div",mke,[_("dt",null,O(C(n)("status.statusSwarmMode")),1),_("dd",{class:We({"swarm-on":e.swarmMode})},O(d.value),3)]),_("div",gke,[_("dt",null,O(C(n)("status.statusContext")),1),_("dd",null,[_("span",vke,O(l.value),1),e.status.ctxMax>0?(w(),T("span",yke,[_("i",{style:Yt({width:r.value+"%"})},null,4)])):ce("",!0)])]),_("div",kke,[_("dt",null,O(C(n)("status.statusCost")),1),_("dd",null,O(h.value),1)])])]),_:1},8,["open","title"]))}}),xke=ct(bke,[["__scopeId","data-v-39844d89"]]),wke={class:"ui-toast__icon","aria-hidden":"true"},_ke={class:"ui-toast__body"},Ske={class:"ui-toast__title"},Cke={key:0,class:"ui-toast__msg"},Ake=Ze({__name:"Toast",props:{variant:{default:"info"},title:{},message:{},dismissLabel:{default:"Dismiss"}},emits:["dismiss"],setup(e){return(t,n)=>(w(),T("div",{class:We(["ui-toast",`ui-toast--${e.variant}`])},[_("span",wke,[On(t.$slots,"icon",{},()=>[e.variant==="success"?(w(),we(Ve,{key:0,name:"check"})):e.variant==="danger"?(w(),we(Ve,{key:1,name:"close"})):e.variant==="warning"?(w(),we(Ve,{key:2,name:"alert-triangle"})):(w(),we(Ve,{key:3,name:"info"}))],!0)]),_("div",_ke,[_("div",Ske,O(e.title),1),e.message?(w(),T("div",Cke,O(e.message),1)):ce("",!0),On(t.$slots,"default",{},void 0,!0)]),re(Pn,{class:"ui-toast__close",size:"sm",label:e.dismissLabel,onClick:n[0]||(n[0]=o=>t.$emit("dismiss"))},{default:Ee(()=>[re(Ve,{name:"close",size:"sm"})]),_:1},8,["label"])],2))}}),Mke=ct(Ake,[["__scopeId","data-v-adc6f346"]]),Eke={key:0,class:"actions"},Tke=["onClick"],Nke=["onClick"],Ike={key:1,class:"details"},Lke=Ze({__name:"WarningToasts",props:{warnings:{}},emits:["dismiss"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Tt();function i(x){return typeof x=="object"&&x!==null}function r(x){return i(x)?x.title:x}function l(x){return i(x)?x.message??"":""}function a(x){return i(x)?x.details:void 0}function c(x){return i(x)?x.severity==="error":x.startsWith(`${s("warnings.errorLabel")}:`)||/\b4\d\d\b|error|失败|failed/i.test(x)}function u(x){return i(x)?`notice:${x.severity}:${x.title}:${x.message??""}:${JSON.stringify(x.details??[])}`:`text:${x}`}function d(x){if(!i(x))return x;const L=[x.title];x.message&&L.push(x.message);const E=x.details??[];if(E.length>0){L.push("",`${s("warnings.diagnostics")}:`);for(const F of E)L.push(`${F.label}: ${F.value}`)}return L.join(`
325
+ `)}let f=1;const h=J([]),p=new Map,g=new Map;function b(x){const L=c(x)?12e3:6e3;return typeof window<"u"&&window.matchMedia?.("(hover: none)").matches===!0?L+5e3:L}function v(x,L){const E=p.get(x)??{handle:null,deadline:0,remaining:0};E.handle=setTimeout(()=>I(x),L),E.deadline=Date.now()+L,p.set(x,E)}function m(x){const L=p.get(x);L&&L.handle!==null&&clearTimeout(L.handle),p.delete(x)}function y(x){const L=p.get(x);!L||L.handle===null||(clearTimeout(L.handle),L.handle=null,L.remaining=Math.max(0,L.deadline-Date.now()))}function k(x){if(h.value.find(F=>F.id===x)?.detailsOpen)return;const E=p.get(x);!E||E.handle!==null||v(x,E.remaining)}function A(x){x.detailsOpen=!x.detailsOpen,x.detailsOpen?y(x.id):k(x.id)}async function $(x){if(!await Go(d(x.warning)))return;x.copied=!0;const E=g.get(x.id);E&&clearTimeout(E),g.set(x.id,setTimeout(()=>{x.copied=!1,g.delete(x.id)},1400))}function I(x){m(x);const L=g.get(x);L&&clearTimeout(L),g.delete(x);const E=h.value.findIndex(F=>F.id===x);E!==-1&&(h.value=h.value.filter(F=>F.id!==x),o("dismiss",E))}return Qe(()=>n.warnings,x=>{const L=[...h.value];h.value=x.map(E=>{const F=u(E),S=L.findIndex(B=>B.key===F),N=S===-1?void 0:L.splice(S,1)[0];if(N)return N.warning=E,N;const D={id:f++,key:F,warning:E,detailsOpen:!1,copied:!1};return v(D.id,b(E)),D});for(const E of L){m(E.id);const F=g.get(E.id);F&&clearTimeout(F),g.delete(E.id)}},{immediate:!0,flush:"post"}),bn(()=>{p.forEach(x=>{x.handle!==null&&clearTimeout(x.handle)}),p.clear(),g.forEach(x=>clearTimeout(x)),g.clear()}),(x,L)=>(w(),we(J9,{name:"toast",tag:"div",class:"toasts",role:"status","aria-live":"polite"},{default:Ee(()=>[(w(!0),T(Pe,null,ot(h.value,E=>(w(),we(Mke,{key:E.id,variant:c(E.warning)?"danger":"warning",title:r(E.warning),message:l(E.warning),"dismiss-label":C(s)("warnings.dismiss"),onDismiss:F=>I(E.id),onPointerenter:F=>y(E.id),onPointerleave:F=>k(E.id)},{default:Ee(()=>[a(E.warning)?.length?(w(),T("div",Eke,[_("button",{class:"link",type:"button",onClick:F=>A(E)},O(E.detailsOpen?C(s)("warnings.hideDetails"):C(s)("warnings.showDetails")),9,Tke),_("button",{class:"link",type:"button",onClick:F=>$(E)},O(E.copied?C(s)("warnings.copied"):C(s)("warnings.copyDetails")),9,Nke)])):ce("",!0),E.detailsOpen&&a(E.warning)?.length?(w(),T("dl",Ike,[(w(!0),T(Pe,null,ot(a(E.warning),F=>(w(),T("div",{key:`${F.label}:${F.value}`,class:"detail-row"},[_("dt",null,O(F.label),1),_("dd",null,O(F.value),1)]))),128))])):ce("",!0)]),_:2},1032,["variant","title","message","dismiss-label","onDismiss","onPointerenter","onPointerleave"]))),128))]),_:1}))}}),$ke=ct(Lke,[["__scopeId","data-v-6cc72bd4"]]),Fke={class:"topbar"},Oke={class:"wsq"},Rke=["aria-label"],Bke={class:"tb-path"},Dke={class:"ws"},Pke={class:"se"},Hke={class:"tb-sub"},Wke=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}=Tt(),o=e,s=t,i=R(()=>{const a=o.workspace,u=(a?.name||a?.root||"").trim().charAt(0);return u?u.toUpperCase():"K"}),r=R(()=>o.workspace?.name??n("workspace.noWorkspace")),l=R(()=>o.running?n("mobile.running"):n("mobile.idle"));return(a,c)=>(w(),T("div",Fke,[_("span",Oke,O(i.value),1),_("button",{type:"button",class:"tb-mid","aria-label":C(n)("mobile.openSwitcher"),onClick:c[0]||(c[0]=u=>s("openSwitcher"))},[_("span",Bke,[_("span",Dke,O(r.value),1),e.sessionTitle?(w(),T(Pe,{key:0},[c[2]||(c[2]=_("span",{class:"sl"},"/",-1)),_("span",Pke,O(e.sessionTitle),1)],64)):ce("",!0),c[3]||(c[3]=_("span",{class:"cv"},"⌄",-1))]),_("span",Hke,[_("span",{class:We(["rd",{on:e.running}])},null,2),_("span",null,O(l.value),1),e.branch?(w(),T(Pe,{key:0},[Je(" · "+O(e.branch),1)],64)):ce("",!0),e.sessionCount>0?(w(),T(Pe,{key:1},[Je(" · "+O(C(n)("mobile.sessionCount",{n:e.sessionCount})),1)],64)):ce("",!0)])],8,Rke),re(Pn,{size:"lg",label:C(n)("mobile.openSettings"),onClick:c[1]||(c[1]=u=>s("openSettings"))},{default:Ee(()=>[re(Ve,{name:"sliders",size:"lg"})]),_:1},8,["label"])]))}}),zke=ct(Wke,[["__scopeId","data-v-6b4b901f"]]),Uke={key:0,class:"sheet-root"},qke=["aria-label"],jke=["aria-label"],Vke={key:0,class:"sheet-head"},Kke={class:"sheet-title"},Gke={class:"sheet-body"},Yke=Ze({__name:"BottomSheet",props:{modelValue:{type:Boolean},title:{default:""}},emits:["update:modelValue","close"],setup(e,{emit:t}){const{t:n}=Tt(),o=e,s=t;function i(){s("update:modelValue",!1),s("close")}function r(l){l.key==="Escape"&&i()}return Qe(()=>o.modelValue,l=>{typeof document>"u"||(l?document.addEventListener("keydown",r):document.removeEventListener("keydown",r))},{immediate:!0}),bn(()=>{typeof document<"u"&&document.removeEventListener("keydown",r)}),(l,a)=>(w(),we(Il,{name:"sheet"},{default:Ee(()=>[e.modelValue?(w(),T("div",Uke,[_("div",{class:"sheet-scrim",onClick:i}),_("div",{class:"sheet-panel",role:"dialog","aria-label":e.title||C(n)("mobile.sheetLabel")},[_("button",{type:"button",class:"sheet-grab","aria-label":C(n)("mobile.closeSheet"),onClick:i},null,8,jke),e.title?(w(),T("div",Vke,[_("span",Kke,O(e.title),1)])):ce("",!0),_("div",Gke,[On(l.$slots,"default",{},void 0,!0)])],8,qke)])):ce("",!0)]),_:3}))}}),N8=ct(Yke,[["__scopeId","data-v-745ee5a2"]]),Zke={class:"mlist"},Qke={key:0,class:"mempty"},Xke=["onClick"],Jke={class:"mgh-main"},e2e={class:"mgh-name"},t2e={class:"mgh-path"},n2e={key:2,class:"att"},o2e={key:0,class:"mempty small"},s2e=["onClick"],i2e={class:"m"},r2e={class:"s"},l2e={key:0,class:"att"},a2e=["disabled","onClick"],c2e=["onClick"],u2e=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}=Tt(),o=e,s=t;function i(){s("update:modelValue",!1)}function r(F){s("select",F),i()}function l(F){s("createInWorkspace",F),i()}function a(){s("create"),i()}function c(){s("addWorkspace"),i()}const u=J(new Set);function d(F){return u.value.has(F)}function f(F){const S=new Set(u.value);S.has(F)?S.delete(F):S.add(F),u.value=S,y.value=null,I.value=null}const h=J(new Set);function p(F){return h.value.has(F)}function g(F){const S=new Set(h.value);S.has(F)?S.delete(F):S.add(F),h.value=S}function b(F){if(p(F.workspace.id))return F.sessions;const S=F.sessions.slice(0,F.initialCount);if(o.activeId&&!S.some(N=>N.id===o.activeId)){const N=F.sessions.find(D=>D.id===o.activeId);if(N)return[...S,N]}return S}function v(F){if(!h.value.has(F)){const S=new Set(h.value);S.add(F),h.value=S}s("loadMore",F)}function m(F){return o.attentionByWorkspace[F]??0}const y=J(null);function k(F){y.value=y.value===F?null:F,I.value=null}function A(F){y.value=null;const N=(typeof window<"u"?window.prompt(n("sidebar.rename"),F.title):null)?.trim();N&&s("rename",F.id,N)}function $(F){y.value=null,s("archive",F)}const I=J(null);function x(F){I.value=I.value===F?null:F,y.value=null}function L(F){Go(F.root),I.value=null}function E(F){I.value=null,s("deleteWorkspace",F.id)}return(F,S)=>(w(),we(N8,{"model-value":e.modelValue,"onUpdate:modelValue":S[2]||(S[2]=N=>s("update:modelValue",N))},{default:Ee(()=>[_("button",{type:"button",class:"newrow",onClick:a},[re(Ve,{name:"message",size:"sm"}),Je(" "+O(C(n)("sidebar.newChat")),1)]),_("button",{type:"button",class:"newrow secondary",onClick:c},[re(Ve,{name:"folder",size:"sm"}),Je(" "+O(C(n)("sidebar.newWorkspace")),1)]),_("div",Zke,[e.groups.length===0?(w(),T("div",Qke,O(C(n)("workspace.noWorkspace")),1)):ce("",!0),(w(!0),T(Pe,null,ot(e.groups,N=>(w(),T("div",{key:N.workspace.id,class:"mgroup"},[_("div",{class:We(["mgh",{on:N.workspace.id===e.activeWorkspaceId}]),onClick:D=>f(N.workspace.id)},[d(N.workspace.id)?(w(),we(Ve,{key:0,class:"mgh-folder",name:"folder-closed",size:"sm"})):(w(),we(Ve,{key:1,class:"mgh-folder",name:"folder",size:"sm"})),_("div",Jke,[_("span",e2e,O(N.workspace.name),1),re(Xt,{text:N.workspace.root},{default:Ee(()=>[_("span",t2e,O(N.workspace.shortPath),1)]),_:2},1032,["text"])]),d(N.workspace.id)&&m(N.workspace.id)>0?(w(),T("span",n2e,O(m(N.workspace.id)),1)):ce("",!0),re(Pn,{size:"lg",class:"mgh-more",label:C(n)("sidebar.options"),onClick:bt(D=>x(N.workspace.id),["stop"])},{default:Ee(()=>[re(Ve,{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),re(Pn,{size:"lg",class:"mgh-add",label:C(n)("workspace.newInGroup"),onClick:bt(D=>l(N.workspace.id),["stop"])},{default:Ee(()=>[re(Ve,{name:"plus",size:"md"})]),_:1},8,["label","onClick"]),I.value===N.workspace.id?(w(),we(kl,{key:3,class:"kmenu wsmenu",onClick:S[0]||(S[0]=bt(()=>{},["stop"]))},{default:Ee(()=>[re(pn,{size:"lg",onClick:D=>L(N.workspace)},{default:Ee(()=>[Je(O(C(n)("sidebar.copyPath")),1)]),_:1},8,["onClick"]),re(pn,{size:"lg",danger:"",onClick:D=>E(N.workspace)},{default:Ee(()=>[Je(O(C(n)("sidebar.delete")),1)]),_:1},8,["onClick"])]),_:2},1024)):ce("",!0)],10,Xke),Fn(_("div",null,[N.sessions.length===0?(w(),T("div",o2e,O(C(n)("sidebar.noSessions")),1)):ce("",!0),(w(!0),T(Pe,null,ot(b(N),D=>(w(),T("div",{key:D.id,class:We(["srow",{cur:D.id===e.activeId}]),onClick:B=>r(D.id)},[_("div",i2e,[_("div",{class:We(["t",{run:D.busy,aborted:!D.busy&&(e.attentionBySession[D.id]??0)===0&&(D.lastTurnReason==="cancelled"||D.lastTurnReason==="failed")}])},O(D.title),3),_("div",r2e,O(D.time),1)]),(e.attentionBySession[D.id]??0)>0?(w(),T("span",l2e,O(e.attentionBySession[D.id]),1)):ce("",!0),re(Pn,{size:"lg",class:"kb",label:C(n)("sidebar.options"),onClick:bt(B=>k(D.id),["stop"])},{default:Ee(()=>[re(Ve,{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),y.value===D.id?(w(),we(kl,{key:1,class:"kmenu",onClick:S[1]||(S[1]=bt(()=>{},["stop"]))},{default:Ee(()=>[re(pn,{size:"lg",onClick:B=>A(D)},{default:Ee(()=>[Je(O(C(n)("sidebar.rename")),1)]),_:1},8,["onClick"]),re(pn,{size:"lg",danger:"",onClick:B=>$(D.id)},{default:Ee(()=>[Je(O(C(n)("sidebar.archive")),1)]),_:1},8,["onClick"])]),_:2},1024)):ce("",!0)],10,s2e))),128)),N.hasMore||N.loadingMore?(w(),T("button",{key:1,type:"button",class:"mshow-more",disabled:N.loadingMore,onClick:bt(D=>v(N.workspace.id),["stop"])},O(N.loadingMore?C(n)("sidebar.loadingMore"):C(n)("sidebar.showMore",{count:Math.max(0,N.workspace.sessionCount-N.sessions.length)})),9,a2e)):ce("",!0),N.sessions.length>N.initialCount?(w(),T("button",{key:2,type:"button",class:"mshow-more",onClick:bt(D=>g(N.workspace.id),["stop"])},O(p(N.workspace.id)?C(n)("sidebar.showLess"):C(n)("sidebar.showAll",{count:N.sessions.length-N.initialCount})),9,c2e)):ce("",!0)],512),[[mi,!d(N.workspace.id)]])]))),128))])]),_:1},8,["model-value"]))}}),d2e=ct(u2e,[["__scopeId","data-v-df277098"]]),f2e={class:"group-title"},h2e={class:"srow-main"},p2e={class:"srow-label"},m2e={class:"srow-sub"},g2e={class:"srow read-only"},v2e={class:"srow-main"},y2e={class:"srow-label"},k2e={key:0,class:"srow-sub"},b2e={class:"cache-note"},x2e={class:"srow-main"},w2e={class:"srow-label"},_2e={class:"srow-sub"},S2e=["aria-checked"],C2e={class:"srow-main"},A2e={class:"srow-label"},M2e={class:"srow-sub"},E2e=["aria-checked"],T2e={class:"srow-main"},N2e={class:"srow-label"},I2e={class:"srow read-only"},L2e={class:"srow-main"},$2e={class:"srow-label"},F2e={class:"srow-sub"},O2e=["aria-label"],R2e={class:"group-title"},B2e={class:"srow-main"},D2e={class:"srow-label"},P2e={class:"srow-sub"},H2e={class:"srow read-only pref"},W2e={class:"srow-main"},z2e={class:"srow-label"},U2e={class:"srow read-only pref"},q2e={class:"srow-main"},j2e={class:"srow-label"},V2e={class:"srow read-only pref"},K2e={class:"srow-main"},G2e={class:"srow-label"},Y2e={class:"num-field"},Z2e=["value","aria-label"],Q2e={class:"srow-main"},X2e={class:"srow-label"},J2e={class:"srow-sub"},ebe=["aria-checked"],tbe={class:"srow-main"},nbe={class:"srow-label"},obe={class:"srow-main"},sbe={class:"srow-label"},ibe={key:2,class:"srow read-only"},rbe={class:"srow-main"},lbe={class:"srow-label"},abe={class:"srow-val dim"},cbe={class:"arch-subhead"},ube={class:"arch-count"},dbe={class:"arch-tools"},fbe={key:0,class:"arch-empty"},hbe={class:"arch-meta"},pbe={class:"arch-name"},mbe={class:"arch-time"},gbe={key:2,class:"arch-empty"},vbe=100,ybe=Ze({__name:"MobileSettingsSheet",props:{modelValue:{type:Boolean},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},colorScheme:{default:"system"},uiFontSize:{default:14},authReady:{type:Boolean,default:!1},conversationToc:{type:Boolean},serverVersion:{default:""},models:{default:()=>[]}},emits:["update:modelValue","pickModel","setThinking","togglePlan","toggleSwarm","setPermission","setColorScheme","setUiFontSize","setConversationToc","login","logout"],setup(e,{emit:t}){const{t:n}=Tt(),o=e,s=t;function i(V){s("setColorScheme",V)}const r=["manual","auto","yolo"],l=R(()=>o.models?.find(V=>V.id===o.status?.modelId)),a=R(()=>Vm(l.value)),c=R(()=>Km(l.value)),u=R(()=>Pp(l.value,o.thinking)),d=R(()=>c.value.includes(u.value)?u.value:""),f=R(()=>c.value.map(V=>({value:V,label:Gv(V)}))),h=R(()=>o.planMode===!0),p=R(()=>o.swarmMode===!0),g=R(()=>{const V=o.status.permission;return V==="yolo"?"var(--color-danger)":V==="auto"?"var(--color-warning)":"var(--color-text-muted)"}),b=R(()=>{const V=o.status.permission,X=n(V==="yolo"?"mobile.permYoloSub":V==="auto"?"mobile.permAutoSub":"mobile.permManualSub");return`${V} · ${X}`}),v=R(()=>o.status.ctxMax>0?Math.min(100,Math.max(0,Math.ceil(o.status.ctxUsed/o.status.ctxMax*100))):0),m=R(()=>o.status.ctxMax>0?`${ir(o.status.ctxUsed)}/${ir(o.status.ctxMax)}`:n("status.statusNone"));function y(V){s("setThinking",Uk(l.value,V))}function k(){const V=r.indexOf(o.status.permission),X=r[(V+1)%r.length];s("setPermission",X)}function A(){s("pickModel"),s("update:modelValue",!1)}function $(){s("login"),s("update:modelValue",!1)}function I(){s("logout"),s("update:modelValue",!1)}const x=m2(),L=J("main"),E=J([]),F=J(!1),S=J(!1),N=J(""),D=J("archived-desc");async function B(){if(!F.value){F.value=!0,S.value=!1;try{const V=[];let X;for(;;){const he=await x.loadArchivedSessions({beforeId:X,pageSize:vbe});if(V.push(...he.items),!he.hasMore||he.items.length===0)break;const ne=he.items.at(-1)?.id;if(ne===void 0)break;X=ne}E.value=V,S.value=!0}catch(V){console.warn("loadAllArchived failed",V)}finally{F.value=!1}}}function U(){L.value="archived",N.value="",B()}function H(){L.value="main"}const P=R(()=>{const V=N.value.trim().toLowerCase();let X=E.value.filter(he=>he.archived===!0);return V&&(X=X.filter(he=>he.title.toLowerCase().includes(V))),X=X.slice(),D.value==="archived-desc"?X.sort((he,ne)=>ne.updatedAt.localeCompare(he.updatedAt)):D.value==="created-desc"?X.sort((he,ne)=>ne.createdAt.localeCompare(he.createdAt)):X.sort((he,ne)=>he.title.localeCompare(ne.title,"zh")),X});async function Z(V){await x.restoreSession(V)&&(E.value=E.value.filter(he=>he.id!==V))}function K(V){const X=new Date(V);if(Number.isNaN(X.getTime()))return V;const he=ne=>String(ne).padStart(2,"0");return`${X.getFullYear()}-${he(X.getMonth()+1)}-${he(X.getDate())} ${he(X.getHours())}:${he(X.getMinutes())}`}return Qe(()=>o.modelValue,V=>{V||(L.value="main")}),(V,X)=>(w(),we(N8,{"model-value":e.modelValue,title:C(n)("mobile.settingsTitle"),"onUpdate:modelValue":X[6]||(X[6]=he=>s("update:modelValue",he))},{default:Ee(()=>[L.value==="main"?(w(),T(Pe,{key:0},[_("div",f2e,O(C(n)("mobile.groupSession")),1),_("button",{type:"button",class:"srow",onClick:A},[_("span",h2e,[_("span",p2e,O(C(n)("status.statusModel")),1),_("span",m2e,O(e.status.model),1)]),X[7]||(X[7]=_("span",{class:"chev"},"›",-1))]),_("div",g2e,[_("span",v2e,[_("span",y2e,O(C(n)("status.statusThinking")),1),a.value==="unsupported"?(w(),T("span",k2e,O(C(n)("status.modeNotSupported")),1)):ce("",!0)]),c.value.length>1?(w(),we(gs,{key:0,"model-value":d.value,options:f.value,size:"sm","onUpdate:modelValue":y},null,8,["model-value","options"])):(w(),T("span",{key:1,class:We(["srow-val",{dim:u.value==="off"}])},O(u.value==="off"?C(n)("status.planOff"):C(Gv)(u.value)),3))]),_("div",b2e,O(C(n)("status.cacheNote")),1),_("button",{type:"button",class:"srow",onClick:X[0]||(X[0]=he=>s("togglePlan"))},[_("span",x2e,[_("span",w2e,O(C(n)("status.statusPlanMode")),1),_("span",_2e,O(C(n)("mobile.planModeSub")),1)]),_("span",{class:We(["toggle",{on:h.value}]),role:"switch","aria-checked":h.value},null,10,S2e)]),_("button",{type:"button",class:"srow",onClick:X[1]||(X[1]=he=>s("toggleSwarm"))},[_("span",C2e,[_("span",A2e,O(C(n)("status.statusSwarmMode")),1),_("span",M2e,O(C(n)("mobile.swarmModeSub")),1)]),_("span",{class:We(["toggle",{on:p.value}]),role:"switch","aria-checked":p.value},null,10,E2e)]),_("button",{type:"button",class:"srow",onClick:k},[_("span",T2e,[_("span",N2e,O(C(n)("status.statusPermission")),1),_("span",{class:"srow-sub",style:Yt({color:g.value})},O(b.value),5)]),X[8]||(X[8]=_("span",{class:"chev"},"›",-1))]),_("div",I2e,[_("span",L2e,[_("span",$2e,O(C(n)("status.statusContext")),1),_("span",F2e,O(m.value),1)]),_("span",{class:"ctx-meter","aria-label":m.value},[_("i",{style:Yt({width:v.value+"%"})},null,4)],8,O2e)]),_("div",R2e,O(C(n)("mobile.groupApp")),1),_("button",{type:"button",class:"srow",onClick:U},[_("span",B2e,[_("span",D2e,O(C(n)("mobile.archivedSessions")),1),_("span",P2e,O(C(n)("mobile.archivedSessionsSub")),1)]),X[9]||(X[9]=_("span",{class:"chev"},"›",-1))]),_("div",H2e,[_("span",W2e,[_("span",z2e,O(C(n)("theme.colorSchemeLabel")),1)]),re(gs,{"model-value":e.colorScheme??"system",options:[{value:"light",label:C(n)("theme.light")},{value:"dark",label:C(n)("theme.dark")},{value:"system",label:C(n)("theme.system")}],"onUpdate:modelValue":i},null,8,["model-value","options"])]),_("div",U2e,[_("span",q2e,[_("span",j2e,O(C(n)("sidebar.language")),1)]),re(E8)]),_("div",V2e,[_("span",K2e,[_("span",G2e,O(C(n)("settings.uiFontSize")),1)]),_("label",Y2e,[_("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":C(n)("settings.uiFontSize"),onInput:X[2]||(X[2]=he=>s("setUiFontSize",Number(he.target.value)))},null,40,Z2e),X[10]||(X[10]=_("span",{class:"num-unit"},"px",-1))])]),_("button",{type:"button",class:"srow",onClick:X[3]||(X[3]=he=>s("setConversationToc",!e.conversationToc))},[_("span",Q2e,[_("span",X2e,O(C(n)("settings.conversationToc")),1),_("span",J2e,O(C(n)("settings.conversationTocHint")),1)]),_("span",{class:We(["toggle",{on:e.conversationToc}]),role:"switch","aria-checked":e.conversationToc},null,10,ebe)]),e.authReady?(w(),T("button",{key:0,type:"button",class:"srow acct out",onClick:I},[_("span",tbe,[_("span",nbe,O(C(n)("sidebar.signOut")),1)])])):(w(),T("button",{key:1,type:"button",class:"srow acct in",onClick:$},[_("span",obe,[_("span",sbe,O(C(n)("sidebar.signIn")),1)])])),e.serverVersion?(w(),T("div",ibe,[_("span",rbe,[_("span",lbe,O(C(n)("settings.serverVersion")),1)]),_("span",abe,O(e.serverVersion),1)])):ce("",!0)],64)):(w(),T(Pe,{key:1},[_("div",cbe,[_("button",{type:"button",class:"arch-back",onClick:H},[X[11]||(X[11]=_("span",{class:"chev back"},"‹",-1)),Je(" "+O(C(n)("mobile.archivedBack")),1)]),_("span",ube,O(C(n)("mobile.sessionCount",{n:P.value.length})),1)]),_("div",dbe,[re(Kc,{class:"arch-search-input","model-value":N.value,size:"sm",placeholder:C(n)("settings.archivedSearch"),"onUpdate:modelValue":X[4]||(X[4]=he=>N.value=he)},null,8,["model-value","placeholder"]),re(gs,{size:"sm","model-value":D.value,options:[{value:"archived-desc",label:C(n)("settings.archivedSortArchived")},{value:"created-desc",label:C(n)("settings.archivedSortCreated")},{value:"name-asc",label:C(n)("settings.archivedSortName")}],"onUpdate:modelValue":X[5]||(X[5]=he=>D.value=he)},null,8,["model-value","options"])]),F.value?(w(),T("div",fbe,O(C(n)("settings.archivedLoadingAll")),1)):P.value.length>0?(w(!0),T(Pe,{key:1},ot(P.value,he=>(w(),T("div",{key:he.id,class:"arch-row"},[_("div",hbe,[_("div",pbe,O(he.title),1),_("div",mbe,O(C(n)("settings.archivedAt",{time:K(he.updatedAt)})),1)]),re(Bt,{variant:"secondary",size:"sm",onClick:ne=>Z(he.id)},{default:Ee(()=>[Je(O(C(n)("settings.archivedRestore")),1)]),_:1},8,["onClick"])]))),128)):(w(),T("div",gbe,O(E.value.length===0?C(n)("settings.archivedEmpty"):C(n)("settings.archivedNoMatch")),1))],64))]),_:1},8,["model-value","title"]))}}),kbe=ct(ybe,[["__scopeId","data-v-c244b2fe"]]),bbe={class:"ob-brand"},xbe={class:"ob-brand-text"},wbe={class:"ob-title"},_be={class:"ob-sub"},Sbe={class:"ob-sec"},Cbe={class:"ob-label"},Abe={class:"ob-sec"},Mbe={class:"ob-label"},Ebe={class:"ob-sec"},Tbe={class:"ob-label"},Nbe=Ze({__name:"Onboarding",emits:["complete","skip"],setup(e,{emit:t}){const n=t,{t:o,locale:s}=Tt(),{colorScheme:i,accent:r,setColorScheme:l,setAccent:a}=z5();function c(d){s.value!==d&&SA(d)}function u(){n("complete")}return(d,f)=>(w(),we(qr,{open:!0,size:"md","close-on-overlay":!1,"close-on-esc":!1,onClose:f[3]||(f[3]=h=>n("skip"))},{head:Ee(()=>[_("div",bbe,[f[4]||(f[4]=_("svg",{class:"ob-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code"},[_("defs",null,[_("mask",{id:"obKimiEyes",maskUnits:"userSpaceOnUse"},[_("rect",{x:"0",y:"0",width:"32",height:"22",fill:"#fff"}),_("g",{class:"ob-eyes",fill:"#000"},[_("rect",{class:"ob-eye",x:"11.8",y:"7",width:"2.8",height:"8",rx:"1.4"}),_("rect",{class:"ob-eye",x:"17.4",y:"7",width:"2.8",height:"8",rx:"1.4"})])])]),_("rect",{x:"1",y:"1",width:"30",height:"20",rx:"6",fill:"var(--color-accent)",mask:"url(#obKimiEyes)"})],-1)),_("div",xbe,[_("div",wbe,O(C(o)("onboarding.title")),1),_("div",_be,O(C(o)("onboarding.subtitle")),1)])])]),default:Ee(()=>[_("section",Sbe,[_("div",Cbe,O(C(o)("onboarding.languageLabel")),1),re(gs,{"model-value":C(s),options:C(_A).map(h=>({value:h.code,label:h.label})),"onUpdate:modelValue":f[0]||(f[0]=h=>c(h))},null,8,["model-value","options"])]),_("section",Abe,[_("div",Mbe,O(C(o)("theme.colorSchemeLabel")),1),re(gs,{"model-value":C(i),options:[{value:"light",label:C(o)("theme.light")},{value:"dark",label:C(o)("theme.dark")},{value:"system",label:C(o)("theme.system")}],"onUpdate:modelValue":f[1]||(f[1]=h=>C(l)(h))},null,8,["model-value","options"])]),_("section",Ebe,[_("div",Tbe,O(C(o)("theme.accentLabel")),1),re(gs,{"model-value":C(r),options:[{value:"blue",label:C(o)("theme.accentBlue")},{value:"mono",label:C(o)("theme.accentBlack")}],"onUpdate:modelValue":f[2]||(f[2]=h=>C(a)(h))},null,8,["model-value","options"])]),re(Bt,{variant:"primary",size:"lg",class:"ob-start",onClick:u},{default:Ee(()=>[Je(O(C(o)("onboarding.start")),1)]),_:1})]),_:1}))}}),Ibe=ct(Nbe,[["__scopeId","data-v-fbdd3eab"]]),Lbe=["aria-label"],$be={class:"gload-box"},Fbe={class:"gload-text"},Obe={key:0,class:"gload-issue"},Rbe={class:"gload-issue-detail"},Bbe=Ze({__name:"GlobalLoading",props:{issue:{}},setup(e){const{t}=Tt();return(n,o)=>(w(),T("div",{class:"gload",role:"status","aria-label":C(t)("app.connecting")},[_("div",$be,[o[0]||(o[0]=Ay('<svg class="gload-logo" viewBox="0 0 96 32" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" data-v-0b6dec6a><path fill="currentColor" d="M35.767 31.329c0 .37.3.671.67.671h4.305c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.672-.671h-4.304c-.37 0-.671.3-.671.671z" data-v-0b6dec6a></path><path fill="currentColor" d="M90.353 31.329c0 .37.3.671.67.671h4.305c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.672-.671h-4.304a.67.67 0 0 0-.671.671z" data-v-0b6dec6a></path><path fill="currentColor" d="M73.256 0a.67.67 0 0 0-.652.512l-6.366 26.1c-.106.428-.607.428-.71 0L59.159.512A.67.67 0 0 0 58.511 0H47.725c-.37 0-.668.3-.668.671V31.33c0 .37.3.671.67.671h4.781c.37 0 .671-.292.671-.662V5.554c0-.515.604-.622.726-.127l6.358 26.06a.67.67 0 0 0 .653.513h9.931c.31 0 .58-.212.653-.512L77.855 5.43c.122-.495.726-.388.726.127v25.772c0 .37.3.671.671.671h4.78c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.671-.671z" data-v-0b6dec6a></path><path fill="currentColor" d="M15.279 14.837 28.264 1.133A.671.671 0 0 0 27.777 0h-6.043a.67.67 0 0 0-.477.199L6.374 15.223c-.231.234-.573.025-.573-.35V.672c0-.37-.3-.671-.671-.671H.67a.67.67 0 0 0-.67.67V31.33c0 .37.3.671.671.671H5.13c.37 0 .671-.3.671-.671v-6.114a.5.5 0 0 1 .13-.35l4.594-4.69a.293.293 0 0 1 .386-.045l12.286 9.305c1.796 1.245 4.083 2.06 6.178 2.401a.645.645 0 0 0 .743-.648v-5.537a.7.7 0 0 0-.562-.677c-1.215-.262-2.565-.758-3.59-1.468L15.332 15.58c-.22-.152-.248-.544-.052-.744" data-v-0b6dec6a></path></svg>',1)),re(Ds,{size:"md",label:C(t)("app.connecting")},null,8,["label"]),_("div",Fbe,O(C(t)("app.connecting")),1),e.issue?(w(),T("div",Obe,[_("div",null,O(C(t)("app.connectRetrying")),1),_("div",Rbe,O(e.issue),1)])):ce("",!0)])],8,Lbe))}}),Dbe=ct(Bbe,[["__scopeId","data-v-0b6dec6a"]]),Pbe={class:"kap-root"},Hbe={class:"kap-head"},Wbe={class:"kap-count"},zbe={class:"kap-head-actions"},Ube={class:"kap-filters"},qbe=["value"],jbe={class:"kap-check"},Vbe={class:"kap-check"},Kbe={class:"kap-view-toggle",role:"group"},Gbe={key:0,class:"kap-empty"},Ybe=["onClick"],Zbe={class:"kap-ts"},Qbe={class:"kap-label"},Xbe={key:0,class:"kap-detail"},Jbe={class:"kap-detail-actions"},exe=["onClick"],txe={key:1,class:"kap-agg"},nxe={class:"mono"},oxe={class:"mono"},sxe={class:"num"},ixe={class:"num"},rxe={key:0},lxe={class:"mono"},axe={class:"num"},cxe={class:"num"},uxe={key:0},dxe=Ze({__name:"KapDebugView",emits:["close"],setup(e,{emit:t}){const n=t,o=J("all"),s=J(""),i=J(""),r=J(!1),l=J("timeline"),a=R(()=>(Ik.value,[...Hte()])),c=R(()=>{const L=new Set;for(const E of a.value)E.sessionId&&L.add(E.sessionId);return[...L].sort()});function u(L){return L.kind==="rest:error"||L.code!==void 0&&L.code!==0||L.eventType==="error"||L.eventType==="parse-error"}const d=R(()=>{const L=s.value.trim().toLowerCase();return a.value.filter(E=>!(o.value!=="all"&&E.source!==o.value||i.value&&E.sessionId!==i.value||r.value&&!u(E)||L&&!`${E.label} ${E.kind} ${E.eventType??""} ${E.sessionId??""} ${E.requestId??""}`.toLowerCase().includes(L)))}),f=R(()=>{const L=new Map;for(const E of d.value){if(E.kind!=="ws:in"&&E.kind!=="ws:out")continue;const F=E.kind==="ws:in"?"←":"→",S=`${F} ${E.eventType??"?"} @ ${E.sessionId??"-"}`,N=L.get(S)??{key:S,sessionId:E.sessionId??"-",eventType:E.eventType??"?",dir:F,count:0};N.count++,E.seq!==void 0&&(N.lastSeq=E.seq),L.set(S,N)}return[...L.values()].sort((E,F)=>F.count-E.count)}),h=R(()=>{const L=new Map;for(const E of d.value){if(E.source!=="rest"||E.kind==="rest:request")continue;const F=`${E.method??"?"} ${E.path??"?"}`,S=L.get(F)??{count:0,errors:0,totalMs:0,timed:0};S.count++,u(E)&&S.errors++,E.durationMs!==void 0&&(S.totalMs+=E.durationMs,S.timed++),L.set(F,S)}return[...L.entries()].map(([E,F])=>({key:E,count:F.count,errors:F.errors,avgMs:F.timed>0?Math.round(F.totalMs/F.timed):0})).sort((E,F)=>F.count-E.count)}),p=J(null),g=J(!0),b=J(null),v=J(null);Qe(()=>d.value.length,async()=>{if(!g.value||l.value!=="timeline")return;await mt();const L=b.value;L&&(L.scrollTop=L.scrollHeight)});function m(L){p.value=p.value===L?null:L}function y(L){const E=new Date(L),F=(S,N=2)=>String(S).padStart(N,"0");return`${F(E.getHours())}:${F(E.getMinutes())}:${F(E.getSeconds())}.${F(E.getMilliseconds(),3)}`}function k(L){return JSON.stringify(L,null,2)}async function A(L){await Go(k(L))&&(v.value=L.id,setTimeout(()=>{v.value===L.id&&(v.value=null)},1500))}function $(){h5(d.value)}function I(L){return u(L)||L.source==="client"?"b-err":L.source==="rest"?"b-rest":L.kind==="ws:lifecycle"?"b-life":L.kind==="ws:out"?"b-out":"b-in"}function x(L){return L.source==="rest"?"REST":L.source==="client"?"APP":"WS"}return(L,E)=>(w(),T("section",Pbe,[_("header",Hbe,[E[11]||(E[11]=_("strong",null,"KAP debug",-1)),_("span",Wbe,O(d.value.length)+"/"+O(a.value.length),1),_("div",zbe,[_("button",{type:"button",class:We({on:C(Gu)}),onClick:E[0]||(E[0]=F=>Gu.value=!C(Gu))},O(C(Gu)?"resume":"pause"),3),_("button",{type:"button",onClick:E[1]||(E[1]=F=>C(Wte)())},"clear"),_("button",{type:"button",onClick:E[2]||(E[2]=F=>$())},"export jsonl"),re(Xt,{text:"Close window"},{default:Ee(()=>[_("button",{type:"button",onClick:E[3]||(E[3]=F=>n("close"))},"✕")]),_:1})])]),_("div",Ube,[Fn(_("select",{"onUpdate:modelValue":E[4]||(E[4]=F=>o.value=F),"aria-label":"Source filter"},[...E[12]||(E[12]=[_("option",{value:"all"},"rest + ws + app",-1),_("option",{value:"rest"},"rest",-1),_("option",{value:"ws"},"ws",-1),_("option",{value:"client"},"app errors",-1)])],512),[[qg,o.value]]),Fn(_("select",{"onUpdate:modelValue":E[5]||(E[5]=F=>i.value=F),"aria-label":"Session filter"},[E[13]||(E[13]=_("option",{value:""},"all sessions",-1)),(w(!0),T(Pe,null,ot(c.value,F=>(w(),T("option",{key:F,value:F},O(F),9,qbe))),128))],512),[[qg,i.value]]),Fn(_("input",{"onUpdate:modelValue":E[6]||(E[6]=F=>s.value=F),type:"text",placeholder:"filter (type / path / id)","aria-label":"Text filter"},null,512),[[_s,s.value]]),_("label",jbe,[Fn(_("input",{"onUpdate:modelValue":E[7]||(E[7]=F=>r.value=F),type:"checkbox"},null,512),[[np,r.value]]),E[14]||(E[14]=Je(" errors",-1))]),_("label",Vbe,[Fn(_("input",{"onUpdate:modelValue":E[8]||(E[8]=F=>g.value=F),type:"checkbox"},null,512),[[np,g.value]]),E[15]||(E[15]=Je(" follow",-1))]),_("div",Kbe,[_("button",{type:"button",class:We({on:l.value==="timeline"}),onClick:E[9]||(E[9]=F=>l.value="timeline")},"timeline",2),_("button",{type:"button",class:We({on:l.value==="aggregate"}),onClick:E[10]||(E[10]=F=>l.value="aggregate")},"aggregate",2)])]),l.value==="timeline"?(w(),T("div",{key:0,ref_key:"listRef",ref:b,class:"kap-list"},[d.value.length===0?(w(),T("div",Gbe," No trace entries yet. REST calls and WS frames will appear here. ")):ce("",!0),(w(!0),T(Pe,null,ot(d.value,F=>(w(),T("div",{key:F.id,class:"kap-row-wrap"},[_("button",{type:"button",class:We(["kap-row",{expanded:p.value===F.id}]),onClick:S=>m(F.id)},[_("span",Zbe,O(y(F.ts)),1),_("span",{class:We(["kap-badge",I(F)])},O(x(F)),3),_("span",Qbe,O(F.label),1)],10,Ybe),p.value===F.id?(w(),T("div",Xbe,[_("div",Jbe,[_("button",{type:"button",onClick:S=>A(F)},O(v.value===F.id?"copied ✓":"copy json"),9,exe)]),_("pre",null,O(k(F)),1)])):ce("",!0)]))),128))],512)):(w(),T("div",txe,[E[20]||(E[20]=_("h4",null,"WS frames by session / type",-1)),_("table",null,[E[17]||(E[17]=_("thead",null,[_("tr",null,[_("th",null,"dir"),_("th",null,"type"),_("th",null,"session"),_("th",null,"count"),_("th",null,"last seq")])],-1)),_("tbody",null,[(w(!0),T(Pe,null,ot(f.value,F=>(w(),T("tr",{key:F.key},[_("td",null,O(F.dir),1),_("td",nxe,O(F.eventType),1),_("td",oxe,O(F.sessionId),1),_("td",sxe,O(F.count),1),_("td",ixe,O(F.lastSeq??"—"),1)]))),128)),f.value.length===0?(w(),T("tr",rxe,[...E[16]||(E[16]=[_("td",{colspan:"5",class:"kap-empty"},"no ws frames",-1)])])):ce("",!0)])]),E[21]||(E[21]=_("h4",null,"REST by endpoint",-1)),_("table",null,[E[19]||(E[19]=_("thead",null,[_("tr",null,[_("th",null,"endpoint"),_("th",null,"count"),_("th",null,"errors"),_("th",null,"avg ms")])],-1)),_("tbody",null,[(w(!0),T(Pe,null,ot(h.value,F=>(w(),T("tr",{key:F.key},[_("td",lxe,O(F.key),1),_("td",axe,O(F.count),1),_("td",{class:We(["num",{err:F.errors>0}])},O(F.errors),3),_("td",cxe,O(F.avgMs),1)]))),128)),h.value.length===0?(w(),T("tr",uxe,[...E[18]||(E[18]=[_("td",{colspan:"4",class:"kap-empty"},"no rest calls",-1)])])):ce("",!0)])])]))]))}}),fxe=ct(dxe,[["__scopeId","data-v-3cda6fe3"]]),hxe=Ze({__name:"DebugPanel",setup(e){const t=J(!1);let n=null,o=null,s=null;const i=["data-color-scheme","data-accent"];function r(u){const d=document.documentElement,f=u.documentElement;for(const h of i){const p=d.getAttribute(h);p!==null?f.setAttribute(h,p):f.removeAttribute(h)}}function l(u){const d=u.document;d.title="KAP debug";const f=d.createElement("base");f.href=location.href,d.head.appendChild(f);for(const p of Array.from(document.querySelectorAll('style, link[rel="stylesheet"]')))d.head.appendChild(p.cloneNode(!0));r(d),d.body.style.margin="0";const h=d.createElement("div");return h.style.height="100vh",d.body.appendChild(h),h}function a(){s?.disconnect(),s=null;try{o?.unmount()}catch{}o=null,n=null,t.value=!1}function c(){if(n&&!n.closed){n.focus();return}const u=window.open("","kap-debug","popup=yes,width=1040,height=760");if(!u)return;n=u;const d=l(u),f=op(fxe,{onClose:()=>u.close()});f.mount(d),o=f,t.value=!0,s=new MutationObserver(()=>{n&&!n.closed&&r(n.document)}),s.observe(document.documentElement,{attributes:!0,attributeFilter:[...i]}),u.addEventListener("pagehide",a),u.addEventListener("beforeunload",a)}return cn(()=>{c()}),po(()=>{n&&!n.closed&&n.close(),a()}),(u,d)=>(w(),we(Xt,{text:t.value?"Focus KAP debug window":"Open KAP debug window"},{default:Ee(()=>[_("button",{class:"kap-fab",type:"button",onClick:c}," KAP ")]),_:1},8,["text"]))}}),pxe=ct(hxe,[["__scopeId","data-v-21346738"]]);function mxe({client:e,authLogoRef:t}){const n=R(()=>e.authReady.value),o=R(()=>e.initialized.value&&!n.value),s="/login",i=J(null);let r=null;function l(){return typeof window>"u"?"/":`${window.location.pathname}${window.location.search}${window.location.hash}`}function a(u){typeof window>"u"||window.history.replaceState(window.history.state,"",u)}Qe(o,u=>{if(!(typeof window>"u")){if(u){window.location.pathname!==s&&(i.value=l(),a(s));return}window.location.pathname===s&&(a(i.value??"/"),i.value=null)}},{immediate:!0});function c(){const u=t.value;u&&(u.classList.remove("blink-now"),u.getBoundingClientRect(),u.classList.add("blink-now"),r!==null&&clearTimeout(r),r=setTimeout(()=>{r=null,u.classList.remove("blink-now")},300))}return bn(()=>{r!==null&&clearTimeout(r)}),{showAuthGate:o,blinkAuthLogo:c}}function gxe({running:e,showAuthGate:t}){const{t:n}=Tt(),o=["◐","◓","◑","◒"],s=J(0);let i=null;function r(){i===null&&(s.value=0,i=setInterval(()=>{s.value=(s.value+1)%o.length},250))}function l(){i!==null&&(clearInterval(i),i=null),s.value=0}Qe(e,c=>{c?r():l()},{immediate:!0});const a=R(()=>{const c=e.value?`${o[s.value]} `:"";return t.value?`${c}${n("app.authPageTitle")} - Kimi Code Web`:`${c}Kimi Code Web`});mT(()=>{typeof document<"u"&&(document.title=a.value)}),bn(()=>{l()})}const I8=J(typeof window>"u"?0:window.innerWidth);let ph=0,Yp=!1;function ry(){I8.value=window.innerWidth}function vxe(){Yp||typeof window>"u"||(window.addEventListener("resize",ry),Yp=!0,ry())}function yxe(){!Yp||typeof window>"u"||(window.removeEventListener("resize",ry),Yp=!1)}function L8(e,t,n){return Math.max(t,e-n)}function ly(e,t,n){return Math.min(n,Math.max(t,e))}function $8(){return cn(()=>{ph+=1,vxe()}),po(()=>{ph=Math.max(0,ph-1),ph===0&&yxe()}),{viewportWidth:I8}}const kxe="kimi-web.file-preview-width",xc=320;function bxe({client:e,sideWidth:t,detailTarget:n,closeFilePreview:o}){const{viewportWidth:s}=$8(),i=R(()=>Math.max(0,s.value-t.value)),r=R(()=>L8(i.value,xc,xc));function l(ie){return ly(Math.round(ie),xc,r.value)}function a(){return l(i.value/2)}const c=R(()=>a()),u=J(c.value),d=R(()=>ly(u.value,xc,r.value)),f=J(null),h=R(()=>{const ie=f.value;if(!ie)return null;const ee=e.turns.value.find(ye=>ye.id===ie.turnId)?.blocks?.[ie.blockIndex];return ee?.kind==="thinking"?ee.thinking:null}),p=R(()=>h.value!==null);function g(ie){const q=f.value;if(q&&q.turnId===ie.turnId&&q.blockIndex===ie.blockIndex){f.value=null,n.value==="thinking"&&(n.value=null);return}n.value="thinking",f.value=ie}function b(){f.value=null,n.value==="thinking"&&(n.value=null)}const v=J(null),m=R(()=>{const ie=v.value;if(!ie)return null;const q=e.turns.value.find(ee=>ee.id===ie.turnId);return q?.role==="compaction"&&q.text?q.text:null}),y=R(()=>m.value!==null);function k(ie){if(v.value?.turnId===ie.turnId){v.value=null,n.value==="compaction"&&(n.value=null);return}n.value="compaction",v.value=ie}function A(){v.value=null,n.value==="compaction"&&(n.value=null)}const $=J(null);function I(ie){const q=e.activeAppTasks.value,ee=q.find(fe=>fe.id===ie)??q.find(fe=>fe.parentToolCallId===ie);if(ee)return ee.id;const ye=q.filter(fe=>fe.kind==="subagent"&&!fe.parentToolCallId);if(ye.length===1)return ye[0].id}const x=R(()=>{const ie=$.value;if(!ie)return null;const q=e.activeAppTasks.value.find(ee=>ee.id===ie.subagentId);return q?Zme(q):null}),L=R(()=>x.value!==null);function E(ie){const q=I(ie);if(q){if($.value?.subagentId===q){$.value=null,n.value==="agent"&&(n.value=null);return}$.value={subagentId:q},n.value="agent"}}function F(){$.value=null,n.value==="agent"&&(n.value=null)}const S=J(null),N=R(()=>{const ie=S.value;if(!ie)return null;const q=gH(e.turns.value,ie);return q?{id:ie,title:Pa(q.name),path:mH(q.arg),lines:q.status==="error"?null:MA(q),output:q.output}:null}),D=R(()=>N.value!==null);function B(ie){if(n.value==="toolDiff"&&S.value===ie){U();return}n.value="toolDiff",S.value=ie}function U(){S.value=null,n.value==="toolDiff"&&(n.value=null)}const H=J("list"),P=J(null);function Z(){if(n.value==="diff"){K();return}n.value="diff",H.value="list",P.value=null,e.loadGitStatus(e.activeSessionId.value)}function K(){n.value==="diff"&&(n.value=null),H.value="list",P.value=null,e.clearFileDiff()}async function V(ie){H.value="detail",P.value=ie,await e.loadFileDiff(ie)}async function X(ie){!e.activeSessionId.value&&e.activeWorkspaceId.value?await e.startSessionAndOpenSideChat(e.activeWorkspaceId.value,ie):await e.openSideChat(ie),n.value="btw"}function he(){e.closeSideChat(),n.value==="btw"&&(n.value=null)}function ne(){n.value==="btw"&&(n.value=null)}const ue=R(()=>e.sideChatVisible.value),de=R(()=>n.value!==null&&(n.value!=="thinking"||p.value)&&(n.value!=="compaction"||y.value)&&(n.value!=="agent"||L.value)&&(n.value!=="toolDiff"||D.value)&&(n.value!=="btw"||ue.value)),Ce=J(!1),Ie=J({});function le(){switch(n.value){case"thinking":return f.value?{kind:"thinking",...f.value}:null;case"compaction":return v.value?{kind:"compaction",...v.value}:null;case"agent":return $.value?{kind:"agent",...$.value}:null;case"toolDiff":return S.value?{kind:"toolDiff",toolId:S.value}:null;case"btw":return{kind:"btw"};default:return null}}function z(ie){if(ie)switch(ie.kind){case"thinking":f.value={turnId:ie.turnId,blockIndex:ie.blockIndex},n.value="thinking";break;case"compaction":v.value={turnId:ie.turnId},n.value="compaction";break;case"agent":$.value={subagentId:ie.subagentId},n.value="agent";break;case"toolDiff":S.value=ie.toolId,n.value="toolDiff";break;case"btw":e.sideChatVisible.value&&(n.value="btw");break}}function ae(){return n.value==="thinking"&&p.value?(b(),!0):n.value==="compaction"&&y.value?(A(),!0):n.value==="agent"&&L.value?(F(),!0):n.value==="toolDiff"&&D.value?(U(),!0):n.value==="file"?(o(),!0):n.value==="diff"?(K(),!0):n.value==="btw"?(he(),!0):!1}return Qe(e.activeSessionId,(ie,q)=>{if(q){const ee=le();ee?Ie.value[q]=ee:delete Ie.value[q]}o(),b(),A(),F(),U(),K(),ne(),ie&&z(Ie.value[ie])}),{PREVIEW_WIDTH_KEY:kxe,PREVIEW_MIN:xc,previewDefaultWidth:c,previewMax:r,previewWidth:u,previewPanelWidth:d,thinkingPanelText:h,thinkingVisible:p,openThinkingPanel:g,closeThinkingPanel:b,compactionPanelText:m,compactionPanelVisible:y,openCompactionPanel:k,closeCompactionPanel:A,agentPanelMember:x,agentPanelVisible:L,openAgentPanel:E,closeAgentPanel:F,toolDiffTarget:N,toolDiffVisible:D,openToolDiff:B,closeToolDiff:U,detailDiffMode:H,detailDiffPath:P,openDiffDetail:Z,closeDiffDetail:K,selectDiffFile:V,btwVisible:ue,openSideChatTab:X,closeSideChat:he,hideSideChatPanel:ne,sidePanelVisible:de,panelDragging:Ce,closeOpenSidePanel:ae}}const xxe=Ft.sidebarWidth,u4=Ft.sidebarCollapsed,d4=270,Ag=170,wxe=480,_xe=320;function Sxe(e={}){const{viewportWidth:t}=$8(),n=J(d4),o=J(!1),s=J(!1),i=R(()=>{const u=_xe+(O4(e.previewOpen)?xc:0);return Math.min(wxe,L8(t.value,Ag,u))}),r=R(()=>ly(n.value,Ag,i.value));function l(){try{o.value=mo(u4)==="true"}catch{o.value=!1}}function a(){try{So(u4,String(o.value))}catch{}}function c(){o.value=!o.value,a()}return{SIDEBAR_WIDTH_KEY:xxe,SIDEBAR_DEFAULT:d4,SIDEBAR_MIN:Ag,sidebarMax:i,sessionColWidth:n,sidebarCollapsed:o,sidebarDragging:s,sideWidth:r,loadSidebarCollapsed:l,toggleSidebarCollapse:c}}function Cxe({client:e,detailTarget:t}){const{t:n}=Tt(),o=J(null),s=J(null),i=J(!1),r=J(null),l=J(null);let a=0,c=null;function u(){c!==null&&(URL.revokeObjectURL(c),c=null)}const d=R(()=>{const I=l.value;return I?e.getFileDownloadUrl(I):null}),f=R(()=>o.value!==null);function h(I){return I.length>1?I.replace(/\/+$/,""):I}function p(I){const x=[];for(const L of I.split(/[\\/]+/))if(!(!L||L===".")){if(L===".."){x.pop();continue}x.push(L)}return x.join("/")}function g(I){const x=I.trim();if(!x)return{error:n("filePreview.errors.emptyPath")};if(/^[a-z][a-z0-9+.-]*:\/\//i.test(x))return{error:n("filePreview.errors.unsupportedPath")};if(x.startsWith("~"))return{error:n("filePreview.errors.outsideWorkspace")};const L=h(e.status.value.cwd);if(x.startsWith("/")){if(!L||x!==L&&!x.startsWith(`${L}/`))return{error:n("filePreview.errors.outsideWorkspace")};const F=x===L?"":x.slice(L.length+1);if(F.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const S=p(F);return S?{path:S}:{error:n("filePreview.errors.isDirectory")}}if(x.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const E=p(x);return E?{path:E}:{error:n("filePreview.errors.emptyPath")}}async function b(I){const x=o.value;if(t.value==="file"&&x&&x.path===I.path&&x.line===I.line){k();return}const L=++a;u(),t.value="file",s.value=null,r.value=null,i.value=!0,o.value=I,l.value=null;const E=g(I.path);if("error"in E){i.value=!1,r.value=E.error;return}l.value=E.path;try{const F=await e.readFileContent(E.path);if(L!==a)return;F?s.value={...F,path:F.path||E.path}:r.value=n("filePreview.errors.loadFailed")}catch(F){if(L!==a)return;r.value=F instanceof Error?F.message:n("filePreview.errors.loadFailed")}finally{L===a&&(i.value=!1)}}function v(I){return/^data:([^;,]+)/i.exec(I)?.[1]}function m(I){if(I.kind!=="image")return;const x=++a;u(),t.value="file",o.value=null,l.value=null,r.value=null;const L={path:I.path??"ReadMediaFile image",content:"",encoding:"utf-8",mime:I.mimeType??v(I.url)??"image/*",isBinary:!0,size:I.bytes??0};I.fileId?(i.value=!0,s.value=L,dt().getFileBlob(I.fileId).then(E=>{if(x===a){if(t.value!=="file"||!s.value){i.value=!1;return}c=URL.createObjectURL(E),s.value={...s.value,sourceUrl:c},i.value=!1}}).catch(()=>{x===a&&(s.value&&(s.value={...s.value,sourceUrl:I.url}),i.value=!1)})):(i.value=!1,s.value={...L,sourceUrl:I.url})}function y(){a+=1,o.value=null,l.value=null,s.value=null,r.value=null,i.value=!1,u()}function k(){y(),t.value==="file"&&(t.value=null)}Qe(t,(I,x)=>{x==="file"&&I!=="file"&&y()});function A(){const I=s.value?.path??o.value?.path;I&&e.openWorkspaceFile(I,o.value?.line)}function $(){const I=s.value?.path??o.value?.path;I&&e.revealWorkspaceFile(I)}return{previewTarget:o,previewFile:s,previewLoading:i,previewError:r,previewDownloadUrl:d,previewExternalActions:f,openFilePreview:b,openMediaPreview:m,closeFilePreview:k,openPreviewInEditor:A,revealPreviewFile:$}}const Axe=640,Mxe=`(max-width: ${Axe}px)`;function Exe(){const e=J(!1);if(typeof window>"u"||typeof window.matchMedia!="function")return e;const t=window.matchMedia(Mxe);e.value=t.matches;const n=o=>{e.value=o.matches};return typeof t.addEventListener=="function"?(t.addEventListener("change",n),bn(()=>t.removeEventListener("change",n))):typeof t.addListener=="function"&&(t.addListener(n),bn(()=>t.removeListener(n))),e}const Txe={class:"server-auth-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"server-auth-title"},Nxe={class:"server-auth-card"},Ixe={class:"server-auth-body"},Lxe={class:"server-auth-foot"},$xe=Ze({__name:"ServerAuthDialog",setup(e){const t=J(""),n=J(null),o=J(!1);cn(()=>{mt(()=>n.value?.focus())});function s(){const r=t.value;!r||o.value||(o.value=!0,k5(r),window.location.reload())}function i(r){r.key==="Enter"&&(r.preventDefault(),s())}return(r,l)=>(w(),T("div",Txe,[_("div",Nxe,[l[1]||(l[1]=_("div",{class:"server-auth-head"},[_("h1",{id:"server-auth-title",class:"server-auth-title"},"Server token required"),_("p",{class:"server-auth-hint"},[Je(" This server is protected. Enter the bearer token printed when the server started (or the password set via "),_("code",null,"KIMI_CODE_PASSWORD"),Je("). ")])],-1)),_("div",Ixe,[re(Kc,{ref_key:"inputRef",ref:n,modelValue:t.value,"onUpdate:modelValue":l[0]||(l[0]=a=>t.value=a),type:"password",autocomplete:"current-password",placeholder:"Token",disabled:o.value,onKeydown:i},null,8,["modelValue","disabled"])]),_("div",Lxe,[re(Bt,{variant:"primary",disabled:!t.value||o.value,loading:o.value,onClick:s},{default:Ee(()=>[Je(O(o.value?"Connecting…":"Connect"),1)]),_:1},8,["disabled","loading"])])])]))}}),Fxe=ct($xe,[["__scopeId","data-v-6f624612"]]),Oxe=["aria-label"],Rxe=Ze({__name:"InternalBuildBanner",setup(e){const{t}=Tt(),n=$B;return(o,s)=>C(n)?(w(),T("span",{key:0,class:"internal-build-tag",role:"note","aria-label":C(t)("app.internalBuildBanner")},[s[0]||(s[0]=_("svg",{viewBox:"0 0 16 16",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[_("path",{d:"M8 2 14 13H2L8 2Z"}),_("path",{d:"M8 6v3.5"}),_("path",{d:"M8 11.5h.01"})],-1)),_("span",null,O(C(t)("app.internalBuildBanner")),1)],8,Oxe)):ce("",!0)}}),Bxe=ct(Rxe,[["__scopeId","data-v-166b3735"]]),Dxe={class:"app-shell"},Pxe={key:1,class:"auth-page"},Hxe={class:"auth-page-inner"},Wxe={class:"auth-page-copy"},zxe=["aria-label","aria-hidden"],Uxe=Ze({__name:"App",setup(e){Lne();const t=J(!1);let n=null;const o=m2(),s=R(()=>!o.dangerousBypassAuth.value&&t.value);Ln("resolveImage",o.resolveImageUrl),Ln("resolveSwarmMembers",Fe=>o.swarmMembersByToolCallId.value.get(Fe)??[]);const{t:i}=Tt(),{confirm:r}=tf(),l=Hi(),a=Exe(),c=J(!1),u=J(!1),d=R(()=>{const Fe=o.activeSessionId.value;return o.sessions.value.find(oe=>oe.id===Fe)?.title??""}),f=R(()=>o.visibleWorkspace.value?.sessionCount??0),h=R(()=>o.activity.value!=="idle"),p=J(null),{showAuthGate:g,blinkAuthLogo:b}=mxe({client:o,authLogoRef:p});gxe({running:h,showAuthGate:g});function v(Fe){const oe=o.models.value.find(He=>He.id===o.status.value.modelId),Te=Km(oe),pe=Te.indexOf(Pp(oe,Fe)),_e=Te[(pe+1)%Te.length]??Te[0]??"off";return Uk(oe,_e)}const m=R(()=>{const Fe=o.models.value.find(oe=>oe.id===o.status.value.modelId);return Pp(Fe,o.thinking.value)}),y=J(!o.onboarded.value);function k(){o.setOnboarded(!0),y.value=!1}function A(){y.value=!0}let $=0;function I(){const Fe=window.visualViewport,oe=document.documentElement.style;oe.setProperty("--app-height",`${Fe?.height??window.innerHeight}px`),oe.setProperty("--app-top",`${Fe?.offsetTop??0}px`)}function x(){$||($=requestAnimationFrame(()=>{$=0,I()}))}cn(()=>{n=One(()=>{t.value=!0,o.clearDangerousBypassAuth()}),o.load(),ie(),I(),window.visualViewport?.addEventListener("resize",x),window.visualViewport?.addEventListener("scroll",x),window.addEventListener("resize",x),document.addEventListener("keydown",L,!0)}),bn(()=>{document.removeEventListener("keydown",L,!0),window.visualViewport?.removeEventListener("resize",x),window.visualViewport?.removeEventListener("scroll",x),window.removeEventListener("resize",x),$&&(cancelAnimationFrame($),$=0),document.documentElement.style.removeProperty("--app-height"),document.documentElement.style.removeProperty("--app-top"),n!==null&&(n(),n=null)});function L(Fe){Fe.key==="Escape"&&(Xe.value||os()&&(Fe.stopPropagation(),Fe.preventDefault()))}const E=J(null),F=J(!1);Qe(o.activeSessionId,()=>{F.value=!0,mt(()=>{F.value=!1})});const{previewTarget:S,previewFile:N,previewLoading:D,previewError:B,previewDownloadUrl:U,previewExternalActions:H,openFilePreview:P,openMediaPreview:Z,closeFilePreview:K,openPreviewInEditor:V,revealPreviewFile:X}=Cxe({client:o,detailTarget:E}),he=R(()=>E.value!==null),{SIDEBAR_WIDTH_KEY:ne,SIDEBAR_DEFAULT:ue,SIDEBAR_MIN:de,sidebarMax:Ce,sessionColWidth:Ie,sidebarCollapsed:le,sidebarDragging:z,sideWidth:ae,loadSidebarCollapsed:ie,toggleSidebarCollapse:q}=Sxe({previewOpen:he}),{PREVIEW_WIDTH_KEY:ee,PREVIEW_MIN:ye,previewDefaultWidth:fe,previewMax:ve,previewWidth:j,previewPanelWidth:te,thinkingPanelText:me,thinkingVisible:Ae,openThinkingPanel:$e,closeThinkingPanel:De,compactionPanelText:ge,compactionPanelVisible:Ne,openCompactionPanel:et,closeCompactionPanel:rt,agentPanelMember:_t,openAgentPanel:gt,closeAgentPanel:It,toolDiffTarget:Ut,openToolDiff:ht,closeToolDiff:un,detailDiffMode:dn,detailDiffPath:ns,openDiffDetail:Wt,closeDiffDetail:Hn,selectDiffFile:lo,btwVisible:it,openSideChatTab:Gn,closeSideChat:ao,sidePanelVisible:Yn,panelDragging:go,closeOpenSidePanel:os}=bxe({client:o,sideWidth:ae,detailTarget:E,closeFilePreview:K}),qn=J(null),to=J(!1),vn=J(!1),Zn=J(!1),xn=J(!1),An=J(!1),Mn=J(!1),Do=J(null),ze=J(null),Xe=R(()=>vc.value>0||to.value||vn.value||Zn.value||xn.value||An.value||Mn.value||y.value||c.value||u.value),kt=J(!1),Ht=J(!1),Rn=J(!1),sn=J(!1),Gt=J(!1);async function Wn(){kt.value=!0,Ht.value=!1,to.value=!0;try{await o.refreshAllProviders()}catch{Ht.value=!0}finally{kt.value=!1}}async function En(){Rn.value=!0,sn.value=!1,vn.value=!0;try{await o.loadProviders()}catch{sn.value=!0}finally{Rn.value=!1}}function St(){Zn.value=!0}async function Po(Fe){to.value=!1,await Ao(Fe)}async function Ao(Fe){await o.setModel(Fe)&&Fe!==o.defaultModel.value&&o.updateConfig({defaultModel:Fe})}async function ss(Fe){await o.addProvider(Fe)}async function Tn(Fe){await o.refreshProvider(Fe)}async function jn(Fe){await r({title:i("sidebar.archive"),message:i("sidebar.archiveConfirm"),variant:"danger",action:()=>o.archiveSession(Fe)})}async function Ps(Fe){const oe=o.workspacesView.value.find(Te=>Te.id===Fe)?.name??Fe;await r({title:i("sidebar.removeWorkspace"),message:i("workspace.removeWorkspaceConfirm",{name:oe}),variant:"danger",action:()=>o.deleteWorkspace(Fe)})}async function ti(Fe){await r({title:i("providers.delete"),message:i("providers.confirmDelete"),variant:"danger",action:()=>o.deleteProvider(Fe)})}async function Io(Fe){Gt.value=!0;try{await o.updateConfig(Fe)&&await o.checkAuth()}finally{Gt.value=!1}}async function Ss(){return o.startOAuthLogin()}async function Wi(){return o.pollOAuthLogin()}async function Si(){return o.cancelOAuthLogin()}async function co(){Zn.value=!1,await o.checkAuth(),await o.load()}async function ni(Fe){await o.undo(1),await mt(),qn.value?.loadComposerForEdit(Fe.text,Fe.attachments)}function Ci(Fe){if(Fe==="/compact"||Fe.startsWith("/compact ")){o.compact(Fe.slice(8).trim()||void 0);return}if(Fe==="/swarm"||Fe.startsWith("/swarm ")){const oe=Fe.slice(6).trim();oe==="on"?o.setSwarmMode(!0):oe==="off"?o.setSwarmMode(!1):oe?(o.setSwarmMode(!0),o.sendPrompt(oe)):o.toggleSwarmMode();return}if(Fe==="/goal"||Fe.startsWith("/goal ")){const oe=Fe.slice(5).trim();oe==="pause"||oe==="resume"||oe==="cancel"?o.controlGoal(oe):oe?o.createGoal(oe):o.toggleGoalMode();return}if(Fe==="/btw"||Fe.startsWith("/btw ")){const oe=Fe.slice(4).trim();!oe&&o.sideChatVisible.value?ao():Gn(oe||void 0);return}switch(Fe){case"/new":case"/clear":$o();break;case"/fork":o.forkSession();break;case"/export":o.exportSession();break;case"/undo":o.undo();break;case"/plan":o.togglePlanMode();break;case"/auto":o.setPermission("auto");break;case"/yolo":o.setPermission("yolo");break;case"/thinking":o.setThinking(v(o.thinking.value));break;case"/status":An.value=!0;break;case"/login":St();break;default:{const oe=Fe.indexOf(" "),Te=gre((oe===-1?Fe:Fe.slice(0,oe)).slice(1)),pe=oe===-1?void 0:Fe.slice(oe+1).trim()||void 0;if(!Te)break;!o.activeSessionId.value&&o.activeWorkspaceId.value?o.startSessionAndActivateSkill(o.activeWorkspaceId.value,Te,pe):o.activateSkill(Te,pe);break}}}function ar(Fe){o.unqueue(Fe)}function no(Fe){o.unqueue(Fe)}function is(Fe){o.reorderQueue(Fe.from,Fe.to)}async function rs(Fe){const oe=o.activeWorkspaceId.value;if(!o.activeSessionId.value&&oe){await o.startSessionAndSendPrompt(oe,Fe.text,Fe.attachments);return}if(!o.activeSessionId.value&&!oe){Do.value=Fe,xn.value=!0;return}o.sendPrompt(Fe.text,Fe.attachments)}async function Lo(Fe){if(ze.value=null,!await o.addWorkspaceByPath(Fe)){ze.value=i("workspace.addFailed");return}xn.value=!1;const Te=Do.value;Do.value=null;const pe=o.activeWorkspaceId.value;Te&&pe&&await o.startSessionAndSendPrompt(pe,Te.text,Te.attachments)}function Ai(){Do.value=null,ze.value=null,xn.value=!1}function zn(){mt(()=>{qn.value?.focusComposer()})}function $o(){const Fe=o.activeWorkspaceId.value;Fe?o.openWorkspaceDraft(Fe):o.clearActiveSession(),zn()}function oi(Fe){o.openWorkspaceDraft(Fe),zn()}function Ue(Fe){Fe&&window.open(Fe,"_blank","noopener")}return(Fe,oe)=>(w(),T("div",Dxe,[s.value?(w(),we(Fxe,{key:0})):ce("",!0),C(g)?(w(),T("section",Pxe,[_("div",Hxe,[(w(),T("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:oe[0]||(oe[0]=bt(()=>{},["prevent"])),onClick:oe[1]||(oe[1]=(...Te)=>C(b)&&C(b)(...Te))},[...oe[98]||(oe[98]=[Ay('<defs data-v-8cd3196b><mask id="authKimiEyes" maskUnits="userSpaceOnUse" data-v-8cd3196b><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-8cd3196b></rect><g class="ch-eyes" fill="#000" data-v-8cd3196b><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-8cd3196b></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-8cd3196b></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#authKimiEyes)" data-v-8cd3196b></rect>',2)])],544)),_("div",Wxe,[_("h1",null,O(C(i)("app.authPageTitle")),1),_("p",null,O(C(i)("app.authPageMessage")),1)]),re(Bt,{class:"auth-page-btn",variant:"primary",onClick:St},{default:Ee(()=>[re(Ve,{name:"log-in",size:"md"}),_("span",null,O(C(i)("app.authPageLogin")),1)]),_:1})])])):(w(),T("div",{key:2,class:We(["app",{mobile:C(a),"sidebar-collapsed":C(le)&&!C(a),"macos-desktop":C(Dc)}]),style:Yt({"--preview-w":C(te)+"px"})},[C(a)?(w(),we(zke,{key:1,workspace:C(o).visibleWorkspace.value,"session-title":d.value,running:h.value,branch:C(o).status.value.branch,"session-count":f.value,onOpenSwitcher:oe[19]||(oe[19]=Te=>c.value=!0),onOpenSettings:oe[20]||(oe[20]=Te=>u.value=!0)},null,8,["workspace","session-title","running","branch","session-count"])):(w(),T(Pe,{key:0},[re(nD,{collapsed:C(le),dragging:C(z),"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,"workspace-sort-mode":C(o).workspaceSortMode.value,backend:C(o).backend.value,onSelect:oe[2]||(oe[2]=Te=>C(o).selectSession(Te)),onCreate:$o,onCreateInWorkspace:oe[3]||(oe[3]=Te=>oi(Te)),onSelectWorkspace:oe[4]||(oe[4]=Te=>C(o).openWorkspace(Te)),onAddWorkspace:oe[5]||(oe[5]=Te=>xn.value=!0),onRename:oe[6]||(oe[6]=(Te,pe)=>C(o).renameSession(Te,pe)),onArchive:oe[7]||(oe[7]=Te=>jn(Te)),onFork:oe[8]||(oe[8]=Te=>C(o).forkSession(Te)),onExport:oe[9]||(oe[9]=Te=>C(o).exportSession(Te)),onRenameWorkspace:oe[10]||(oe[10]=(Te,pe)=>C(o).renameWorkspace(Te,pe)),onDeleteWorkspace:oe[11]||(oe[11]=Te=>Ps(Te)),onReorderWorkspaces:oe[12]||(oe[12]=Te=>C(o).reorderWorkspaces(Te)),onSetWorkspaceSortMode:oe[13]||(oe[13]=Te=>C(o).setWorkspaceSortMode(Te)),onLoadMoreSessions:oe[14]||(oe[14]=Te=>void C(o).loadMoreSessions(Te)),onLoadAllSessions:oe[15]||(oe[15]=Te=>void C(o).loadAllSessions()),onOpenSettings:oe[16]||(oe[16]=Te=>Mn.value=!0),onCollapse:C(q)},null,8,["collapsed","dragging","col-width","active-workspace","active-workspace-id","sessions","groups","active-id","attention-by-session","pending-by-session","unread-by-session","workspace-sort-mode","backend","onCollapse"]),Fn(re(fw,{class:"side-handle","storage-key":C(ne),"default-width":C(ue),min:C(de),max:C(Ce),"onUpdate:width":oe[17]||(oe[17]=Te=>Ie.value=Te),"onUpdate:dragging":oe[18]||(oe[18]=Te=>z.value=Te)},null,8,["storage-key","default-width","min","max"]),[[mi,!C(le)]])],64)),re(wue,{ref_key:"conversationPaneRef",ref:qn,mobile:C(a),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,"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,"pending-question-actions":C(o).pendingQuestionActions,"pending-approval-actions":C(o).pendingApprovalActions,running:h.value,"turn-active":C(o).turnActive.value,queued:C(o).queued.value,"search-files":C(o).searchFiles,"upload-image":C(o).uploadImage,working:C(o).working.value,starting:C(o).isStartingFirstPrompt.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":d.value,pr:C(o).activePullRequest.value,"conversation-toc":C(o).conversationToc.value,onOpenChanges:oe[21]||(oe[21]=Te=>C(Wt)()),onSelectWorkspace:oe[22]||(oe[22]=Te=>oi(Te)),onAddWorkspace:oe[23]||(oe[23]=Te=>xn.value=!0),onOpenPr:Ue,onSubmit:oe[24]||(oe[24]=Te=>rs(Te)),onSteer:oe[25]||(oe[25]=Te=>C(o).steerPrompt(Te.text,Te.attachments)),onApproval:oe[26]||(oe[26]=(Te,pe)=>C(o).respondApproval(Te,pe)),onCancelTask:oe[27]||(oe[27]=Te=>C(o).cancelTask(Te)),onAnswer:oe[28]||(oe[28]=(Te,pe)=>C(o).respondQuestion(Te,pe)),onDismiss:oe[29]||(oe[29]=Te=>C(o).dismissQuestion(Te)),onCommand:Ci,onInterrupt:oe[30]||(oe[30]=Te=>C(o).abortCurrentPrompt()),onUnqueue:ar,onEditQueued:no,onReorderQueue:is,onSetPermission:oe[31]||(oe[31]=Te=>C(o).setPermission(Te)),onSetThinking:oe[32]||(oe[32]=Te=>C(o).setThinking(Te)),onTogglePlan:oe[33]||(oe[33]=Te=>C(o).togglePlanMode()),onToggleSwarm:oe[34]||(oe[34]=Te=>C(o).toggleSwarmMode()),onToggleGoal:oe[35]||(oe[35]=Te=>C(o).toggleGoalMode()),onCreateGoal:oe[36]||(oe[36]=Te=>C(o).createGoal(Te)),onControlGoal:oe[37]||(oe[37]=Te=>C(o).controlGoal(Te)),onRefreshGitStatus:oe[38]||(oe[38]=Te=>C(o).activeSessionId.value&&C(o).loadGitStatus(C(o).activeSessionId.value)),onRenameSession:oe[39]||(oe[39]=(Te,pe)=>C(o).renameSession(Te,pe)),onForkSession:oe[40]||(oe[40]=Te=>C(o).forkSession(Te)),onArchiveSession:oe[41]||(oe[41]=Te=>jn(Te)),onExportSession:oe[42]||(oe[42]=Te=>C(o).exportSession(Te)),onCompact:oe[43]||(oe[43]=Te=>C(o).compact()),onPickModel:oe[44]||(oe[44]=Te=>Wn()),onSelectModel:oe[45]||(oe[45]=Te=>Ao(Te)),onOpenFile:oe[46]||(oe[46]=Te=>C(P)(Te)),onOpenMedia:oe[47]||(oe[47]=Te=>C(Z)(Te)),onOpenThinking:oe[48]||(oe[48]=Te=>C($e)(Te)),onOpenCompaction:oe[49]||(oe[49]=Te=>C(et)(Te)),onOpenAgent:oe[50]||(oe[50]=Te=>C(gt)(Te)),onOpenToolDiff:oe[51]||(oe[51]=Te=>C(ht)(Te)),onEditMessage:ni},null,8,["mobile","turns","session-id","approvals","changes","git-info","tasks","todos","goal","activation-badges","status","thinking","plan-mode","swarm-mode","goal-mode","models","starred-ids","skills","questions","pending-question-actions","pending-approval-actions","running","turn-active","queued","search-files","upload-image","working","starting","fast-moon","file-reload-key","session-loading","compaction","has-more-messages","loading-more","loading-more-error","load-older-messages","workspace-name","workspace-root","git-diff-stats","workspaces","active-workspace-id","session-title","pr","conversation-toc"]),!C(a)&&(C(Dc)||C(le))?(w(),we(Pn,{key:2,class:"sidebar-toggle-btn",size:"sm",label:C(le)?C(i)("sidebar.expandSidebar"):C(i)("sidebar.collapseSidebar"),onClick:C(q)},{default:Ee(()=>[re(Ve,{name:C(le)?"panel-expand":"panel-collapse"},null,8,["name"])]),_:1},8,["label","onClick"])):ce("",!0),C(Yn)&&!C(a)?(w(),we(fw,{key:3,class:"preview-handle","storage-key":C(ee),"default-width":C(fe),min:C(ye),max:C(ve),reverse:"","aria-label":C(i)("layout.resizePreviewAria"),"onUpdate:width":oe[52]||(oe[52]=Te=>j.value=Te),"onUpdate:dragging":oe[53]||(oe[53]=Te=>go.value=Te)},null,8,["storage-key","default-width","min","max","aria-label"])):ce("",!0),!C(a)||C(Yn)?(w(),T("aside",{key:4,class:We(["global-preview",{open:C(Yn),mobile:C(a),"no-anim":C(go)||F.value}]),role:"complementary","aria-label":C(i)("layout.detailPanelAria"),"aria-hidden":!C(Yn)},[E.value==="thinking"&&C(Ae)?(w(),we(VC,{key:0,text:C(me)??"",onClose:C(De)},null,8,["text","onClose"])):E.value==="compaction"&&C(Ne)?(w(),we(VC,{key:1,text:C(ge)??"",subtitle:C(i)("conversation.summaryTitle"),onClose:C(rt)},null,8,["text","subtitle","onClose"])):E.value==="agent"&&C(_t)?(w(),we(Ude,{key:2,member:C(_t),onClose:C(It)},null,8,["member","onClose"])):E.value==="btw"&&C(it)?(w(),we(ufe,{key:3,turns:C(o).sideChatTurns.value,running:C(o).sideChatRunning.value,sending:C(o).sideChatSending.value,onSend:oe[54]||(oe[54]=Te=>C(o).sendSideChatPrompt(Te)),onClose:C(ao)},null,8,["turns","running","sending","onClose"])):E.value==="diff"?(w(),we(Dfe,{key:4,mode:C(dn),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(lo),onBack:oe[55]||(oe[55]=Te=>{dn.value="list",ns.value=null,C(o).clearFileDiff()}),onClose:C(Hn)},null,8,["mode","changes","git-info","file-diff","selected-diff-path","file-diff-loading","onOpen","onClose"])):E.value==="toolDiff"&&C(Ut)?(w(),we(nfe,{key:5,target:C(Ut),onClose:C(un)},null,8,["target","onClose"])):E.value==="file"?(w(),we(Sde,{key:6,file:C(N),loading:C(D),error:C(B),line:C(S)?.line,"download-url":C(U),closable:"","external-actions":C(H),"open-file":C(P),onClose:C(K),onOpenExternal:C(V),onReveal:C(X)},null,8,["file","loading","error","line","download-url","external-actions","open-file","onClose","onOpenExternal","onReveal"])):ce("",!0)],10,zxe)):ce("",!0),re(Bxe,{class:"internal-build-fab"}),to.value?(w(),we(ohe,{key:5,models:C(o).models.value,current:C(o).status.value.modelId,"starred-ids":C(o).starredModelIds.value,loading:kt.value,unavailable:Ht.value,onSelect:oe[56]||(oe[56]=Te=>Po(Te)),onToggleStar:oe[57]||(oe[57]=Te=>C(o).toggleStarModel(Te)),onClose:oe[58]||(oe[58]=Te=>to.value=!1)},null,8,["models","current","starred-ids","loading","unavailable"])):ce("",!0),Mn.value?(w(),we(wye,{key:6,"color-scheme":C(o).colorScheme.value,accent:C(o).accent.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-question":C(o).notifyOnQuestion.value,"notify-approval":C(o).notifyOnApproval.value,"notify-permission":C(o).notifyPermission.value,sound:C(o).soundOnComplete.value,"conversation-toc":C(o).conversationToc.value,config:C(o).config.value,models:C(o).models.value,"config-saving":Gt.value,"server-version":C(o).serverVersion.value,backend:C(o).backend.value,onSetColorScheme:oe[59]||(oe[59]=Te=>C(o).setColorScheme(Te)),onSetAccent:oe[60]||(oe[60]=Te=>C(o).setAccent(Te)),onSetUiFontSize:oe[61]||(oe[61]=Te=>C(o).setUiFontSize(Te)),onSetNotify:oe[62]||(oe[62]=Te=>C(o).setNotifyOnComplete(Te)),onSetNotifyQuestion:oe[63]||(oe[63]=Te=>C(o).setNotifyOnQuestion(Te)),onSetNotifyApproval:oe[64]||(oe[64]=Te=>C(o).setNotifyOnApproval(Te)),onSetSound:oe[65]||(oe[65]=Te=>C(o).setSoundOnComplete(Te)),onSetConversationToc:oe[66]||(oe[66]=Te=>C(o).setConversationToc(Te)),onUpdateConfig:oe[67]||(oe[67]=Te=>Io(Te)),onLogin:oe[68]||(oe[68]=()=>{Mn.value=!1,St()}),onLogout:C(o).logout,onOpenOnboarding:oe[69]||(oe[69]=()=>{Mn.value=!1,A()}),onOpenProviders:oe[70]||(oe[70]=()=>{Mn.value=!1,En()}),onClose:oe[71]||(oe[71]=Te=>Mn.value=!1)},null,8,["color-scheme","accent","ui-font-size","auth-ready","account-model","notify","notify-question","notify-approval","notify-permission","sound","conversation-toc","config","models","config-saving","server-version","backend","onLogout"])):ce("",!0),vn.value?(w(),we(Ehe,{key:7,providers:C(o).providers.value,loading:Rn.value,unavailable:sn.value,onAdd:oe[72]||(oe[72]=Te=>ss(Te)),onRefresh:oe[73]||(oe[73]=Te=>Tn(Te)),onDelete:oe[74]||(oe[74]=Te=>ti(Te)),onOpenLogin:oe[75]||(oe[75]=()=>{vn.value=!1,St()}),onClose:oe[76]||(oe[76]=Te=>vn.value=!1)},null,8,["providers","loading","unavailable"])):ce("",!0),An.value?(w(),we(xke,{key:8,status:C(o).status.value,thinking:m.value,"plan-mode":C(o).planMode.value,"swarm-mode":C(o).swarmMode.value,"cost-usd":C(o).sessionCost.value,onClose:oe[77]||(oe[77]=Te=>An.value=!1)},null,8,["status","thinking","plan-mode","swarm-mode","cost-usd"])):ce("",!0),xn.value?(w(),we(ike,{key:9,"browse-fs":C(o).browseFs,"get-fs-home":C(o).getFsHome,"default-path":C(o).visibleWorkspace.value?.root??C(o).status.value.cwd,error:ze.value,onAdd:oe[78]||(oe[78]=Te=>Lo(Te)),onClose:Ai},null,8,["browse-fs","get-fs-home","default-path","error"])):ce("",!0),re(Il,{name:"gload-fade"},{default:Ee(()=>[C(o).initialized.value?ce("",!0):(w(),we(Dbe,{key:0,issue:C(o).connectIssue.value},null,8,["issue"]))]),_:1}),C(o).initialized.value&&y.value&&!C(g)?(w(),we(Ibe,{key:10,onComplete:k,onSkip:k})):ce("",!0),re($ke,{warnings:C(o).warnings.value,onDismiss:C(o).dismissWarning},null,8,["warnings","onDismiss"]),C(l)?(w(),we(pxe,{key:11})):ce("",!0),re(cke),C(a)?(w(),we(d2e,{key:12,modelValue:c.value,"onUpdate:modelValue":oe[79]||(oe[79]=Te=>c.value=Te),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:oe[80]||(oe[80]=Te=>C(o).selectSession(Te)),onCreate:$o,onCreateInWorkspace:oe[81]||(oe[81]=Te=>oi(Te)),onAddWorkspace:oe[82]||(oe[82]=Te=>xn.value=!0),onRename:oe[83]||(oe[83]=(Te,pe)=>C(o).renameSession(Te,pe)),onArchive:oe[84]||(oe[84]=Te=>jn(Te)),onDeleteWorkspace:oe[85]||(oe[85]=Te=>Ps(Te)),onLoadMore:oe[86]||(oe[86]=Te=>void C(o).loadMoreSessions(Te))},null,8,["modelValue","groups","active-workspace-id","active-id","attention-by-session","attention-by-workspace"])):ce("",!0),C(a)?(w(),we(kbe,{key:13,modelValue:u.value,"onUpdate:modelValue":oe[87]||(oe[87]=Te=>u.value=Te),status:C(o).status.value,thinking:C(o).thinking.value,models:C(o).models.value,"plan-mode":C(o).planMode.value,"swarm-mode":C(o).swarmMode.value,"color-scheme":C(o).colorScheme.value,"ui-font-size":C(o).uiFontSize.value,"auth-ready":C(o).authReady.value,"conversation-toc":C(o).conversationToc.value,"server-version":C(o).serverVersion.value,onPickModel:oe[88]||(oe[88]=Te=>Wn()),onSetThinking:oe[89]||(oe[89]=Te=>C(o).setThinking(Te)),onTogglePlan:oe[90]||(oe[90]=Te=>C(o).togglePlanMode()),onToggleSwarm:oe[91]||(oe[91]=Te=>C(o).toggleSwarmMode()),onSetPermission:oe[92]||(oe[92]=Te=>C(o).setPermission(Te)),onSetColorScheme:oe[93]||(oe[93]=Te=>C(o).setColorScheme(Te)),onSetUiFontSize:oe[94]||(oe[94]=Te=>C(o).setUiFontSize(Te)),onSetConversationToc:oe[95]||(oe[95]=Te=>C(o).setConversationToc(Te)),onLogin:oe[96]||(oe[96]=()=>{u.value=!1,St()}),onLogout:C(o).logout},null,8,["modelValue","status","thinking","models","plan-mode","swarm-mode","color-scheme","ui-font-size","auth-ready","conversation-toc","server-version","onLogout"])):ce("",!0)],6)),Zn.value?(w(),we(ipe,{key:3,"on-start-o-auth-login":Ss,"on-poll-o-auth-login":Wi,"on-cancel-o-auth-login":Si,onSuccess:co,onClose:oe[97]||(oe[97]=Te=>Zn.value=!1)})):ce("",!0)]))}}),qxe=ct(Uxe,[["__scopeId","data-v-8cd3196b"]]);Kte();op(qxe).use(_n).mount("#app");export{LE as $,e3 as A,wT as B,bo as C,Uwe as D,y4 as E,Pe as F,Ay as G,Je as H,re as I,tT as J,pwe as K,Li as L,Ze as M,G9 as N,ywe as O,kwe as P,wwe as Q,Ph as R,Rc as S,dm as T,bwe as U,Ey as V,vwe as W,jwe as X,xwe as Y,Dwe as Z,Vxe as _,K4 as a,jo as a$,Yo as a0,uy as a1,ewe as a2,gy as a3,y9 as a4,mn as a5,su as a6,rwe as a7,Gwe as a8,uwe as a9,X4 as aA,$T as aB,PT as aC,cn as aD,DT as aE,BT as aF,dy as aG,RT as aH,bn as aI,yy as aJ,rT as aK,w as aL,j9 as aM,swe as aN,Ln as aO,R4 as aP,owe as aQ,qh as aR,Bo as aS,Wh as aT,J as aU,Lwe as aV,uN as aW,ot as aX,On as aY,WT as aZ,mwe as a_,hwe as aa,fwe as ab,dwe as ac,Fwe as ad,Ywe as ae,Kt as af,S9 as ag,cm as ah,_l as ai,Hr as aj,ho as ak,$we as al,Ks as am,Nl as an,pt as ao,Cwe as ap,Awe as aq,yn as ar,mt as as,T9 as at,We as au,jxe as av,Yt as aw,LT as ax,OT as ay,po as az,nwe as b,wX as b$,Wwe as b0,kd as b1,Zh as b2,Pwe as b3,Tl as b4,QE as b5,Gxe as b6,Ba as b7,hT as b8,Hwe as b9,_s as bA,mi as bB,C9 as bC,Rwe as bD,Qe as bE,mT as bF,lwe as bG,gT as bH,Ewe as bI,Ee as bJ,_we as bK,Fn as bL,nr as bM,Owe as bN,bt as bO,iwe as bP,gn as bQ,ms as bR,i_e as bS,dJ as bT,PM as bU,l_e as bV,HQ as bW,kk as bX,r_e as bY,yv as bZ,h_e as b_,Kxe as ba,O as bb,mh as bc,gwe as bd,en as be,Qxe as bf,Zxe as bg,O4 as bh,Iwe as bi,Yxe as bj,C as bk,Vd as bl,Kwe as bm,qwe as bn,Z9 as bo,awe as bp,Twe as bq,pT as br,Vwe as bs,Swe as bt,cwe as bu,V4 as bv,np as bw,iN as bx,P3 as by,qg as bz,Bwe as c,xX as c0,gk as c1,bX as c2,n_e as c3,$Q as c4,t_e as c5,Mp as c6,Xwe as c7,kX as c8,$M as c9,f_e as ca,Jwe as cb,m_e as cc,Sv as cd,Ec as ce,wv as cf,g_e as cg,p_e as ch,s_e as ci,qs as cj,e_e as ck,o_e as cl,zQ as cm,d_e as cn,_v as co,xv as cp,u_e as cq,Qwe as cr,c_e as cs,a_e as ct,Ve as cu,Zwe as cv,ct as cw,Nwe as d,Sl as e,Xxe as f,Il as g,J9 as h,Jxe as i,twe as j,wi as k,Ud as l,No as m,tm as n,Wr as o,zwe as p,R as q,op as r,we as s,ce as t,T as u,_ as v,c9 as w,Mwe as x,a9 as y,dN as z};