blun-king-cli 9.0.1 → 9.1.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.
- package/LIESMICH.txt +31 -6
- package/README.md +35 -4
- package/bin/launcher-mode.js +13 -2
- package/bin/launcher-runtime.js +103 -31
- package/bin/plugin-bootstrap.js +11 -4
- package/bin/private-paths.js +1577 -10
- package/bin/update-notice.js +197 -46
- package/blun.mjs +7422 -3448
- package/dist-web/assets/{CodeBlockNode-Bsvp6ZEy.js → CodeBlockNode-CXnTLMNr.js} +1 -1
- package/dist-web/assets/{CodeBlockShell.vue_vue_type_style_index_0_lang-ta7hLjia.js → CodeBlockShell.vue_vue_type_style_index_0_lang-CCF8Ntnq.js} +1 -1
- package/dist-web/assets/{DesignSystemView-BmDDe28A.js → DesignSystemView-BbMOu-XO.js} +1 -1
- package/dist-web/assets/{Tooltip-nEEfaYVY.js → Tooltip-CFQEzqC-.js} +1 -1
- package/dist-web/assets/abnfDiagram-N423BO3Z-CsByy-GW.js +1 -0
- package/dist-web/assets/abnfDiagram-N423BO3Z-Z1APZG5m.js +1 -0
- package/dist-web/assets/arc-C-LXCaja.js +1 -0
- package/dist-web/assets/arc-C4VyWloT.js +1 -0
- package/dist-web/assets/architectureDiagram-T3A2C74G-DZq4L18e.js +36 -0
- package/dist-web/assets/architectureDiagram-T3A2C74G-DpddbUcM.js +36 -0
- package/dist-web/assets/blockDiagram-VBNYF7ZC-BV4sIf98.js +132 -0
- package/dist-web/assets/blockDiagram-VBNYF7ZC-BqccOSMr.js +132 -0
- package/dist-web/assets/{c4Diagram-AAUBKEIU-DtzacMnD.js → c4Diagram-5PPSVZJV-0MRkZlgP.js} +1 -1
- package/dist-web/assets/{c4Diagram-AAUBKEIU-D1VdMx8d.js → c4Diagram-5PPSVZJV-OHAcJrTy.js} +1 -1
- package/dist-web/assets/channel-B2VOQOI-.js +1 -0
- package/dist-web/assets/channel-DKjwM05G.js +1 -0
- package/dist-web/assets/{chunk-ND2GUHAM-DJoY9wNJ.js → chunk-2GRJ4B5K-DqJHs8Fw.js} +1 -1
- package/dist-web/assets/{chunk-ND2GUHAM-C4-rwdcv.js → chunk-2GRJ4B5K-oO6nqeLA.js} +1 -1
- package/dist-web/assets/{chunk-QZHKN3VN-C7YGaShq.js → chunk-2Q5K7J3B-B1nCd91o.js} +1 -1
- package/dist-web/assets/{chunk-QZHKN3VN-_Rz9_NuS.js → chunk-2Q5K7J3B-BC0Hsfqy.js} +1 -1
- package/dist-web/assets/chunk-5RXB4S5H-BfZa4yDH.js +231 -0
- package/dist-web/assets/chunk-5RXB4S5H-neG70kZx.js +231 -0
- package/dist-web/assets/{chunk-FMBD7UC4-DlLNDUx6.js → chunk-5VM5RSS4-l7biGqeH.js} +1 -1
- package/dist-web/assets/{chunk-FMBD7UC4-B2zs_Y-d.js → chunk-5VM5RSS4-u00AcpiJ.js} +1 -1
- package/dist-web/assets/chunk-6Q2QTUOP-BO-F11Gs.js +88 -0
- package/dist-web/assets/chunk-6Q2QTUOP-RUVRPBzG.js +88 -0
- package/dist-web/assets/{chunk-727SXJPM-Dn5wkDO_.js → chunk-GF5L2VYU-Ba-86KTd.js} +5 -5
- package/dist-web/assets/{chunk-727SXJPM-Dk2Xa3bA.js → chunk-GF5L2VYU-BtC69fw0.js} +5 -5
- package/dist-web/assets/{chunk-4BX2VUAB-DxZViaHS.js → chunk-JWPE2WC7-DIOubEqr.js} +1 -1
- package/dist-web/assets/{chunk-4BX2VUAB-WqrE2gaw.js → chunk-JWPE2WC7-u8Pcfhwh.js} +1 -1
- package/dist-web/assets/{chunk-2J33WTMH-Dm_s0_4f.js → chunk-KBJHAD2P-DDUeH_Ba.js} +1 -1
- package/dist-web/assets/{chunk-2J33WTMH-w4sdiKFO.js → chunk-KBJHAD2P-DS3BL64y.js} +1 -1
- package/dist-web/assets/chunk-RYQCIY6F-B9gFMVbS.js +1 -0
- package/dist-web/assets/chunk-RYQCIY6F-xg3EO0le.js +1 -0
- package/dist-web/assets/{chunk-55IACEB6-B5dE1-Um.js → chunk-XXDRQBXY-B60H0rRC.js} +1 -1
- package/dist-web/assets/{chunk-55IACEB6-B12zGIFz.js → chunk-XXDRQBXY-Bn1Xz6TQ.js} +1 -1
- package/dist-web/assets/classDiagram-JCYQIIEL-BA1TjAxj.js +1 -0
- package/dist-web/assets/classDiagram-JCYQIIEL-BNU7Qn4k.js +1 -0
- package/dist-web/assets/classDiagram-v2-OCEON4UE-BA1TjAxj.js +1 -0
- package/dist-web/assets/classDiagram-v2-OCEON4UE-BNU7Qn4k.js +1 -0
- package/dist-web/assets/{cose-bilkent-S5V4N54A-Bi19n8m-.js → cose-bilkent-JH36ORCC-4Ybddg08.js} +1 -1
- package/dist-web/assets/{cose-bilkent-S5V4N54A-c8o8NFp5.js → cose-bilkent-JH36ORCC-DqigO3T4.js} +1 -1
- package/dist-web/assets/cynefin-VYW2F7L2-C-EfYT07.js +178 -0
- package/dist-web/assets/cynefin-VYW2F7L2-rpD93tQ-.js +178 -0
- package/dist-web/assets/cynefinDiagram-MW4NZA55-DWZPLJcD.js +62 -0
- package/dist-web/assets/cynefinDiagram-MW4NZA55-DbTqnkVJ.js +62 -0
- package/dist-web/assets/dagre-VZM6K2ZE-DcM8aEVY.js +4 -0
- package/dist-web/assets/dagre-VZM6K2ZE-M_HVNtqP.js +4 -0
- package/dist-web/assets/diagram-7IWD3JNH-DoNximNF.js +30 -0
- package/dist-web/assets/diagram-7IWD3JNH-UymgsBNa.js +30 -0
- package/dist-web/assets/{diagram-KO2AKTUF-CFQs13i5.js → diagram-B4RE2ZJO-BVA2EhnC.js} +3 -3
- package/dist-web/assets/{diagram-KO2AKTUF-agFIuPJW.js → diagram-B4RE2ZJO-BiYu5WPF.js} +3 -3
- package/dist-web/assets/{diagram-LMA3HP47-TMIXizxR.js → diagram-LBJQPF4R-BD3kkgOO.js} +2 -2
- package/dist-web/assets/{diagram-LMA3HP47-He5zlyMt.js → diagram-LBJQPF4R-m3a1Euj3.js} +2 -2
- package/dist-web/assets/diagram-Q27KOJAE-D1mYQ_cI.js +24 -0
- package/dist-web/assets/diagram-Q27KOJAE-hy_T73PK.js +24 -0
- package/dist-web/assets/diagram-UB23O5K3-BWkoQZ4A.js +41 -0
- package/dist-web/assets/diagram-UB23O5K3-BtX8u6HG.js +41 -0
- package/dist-web/assets/ebnfDiagram-BXEA7PRR-BKs9JUHW.js +1 -0
- package/dist-web/assets/ebnfDiagram-BXEA7PRR-CBAnFkRF.js +1 -0
- package/dist-web/assets/erDiagram-JOGREHBK-3vKcWsxm.js +85 -0
- package/dist-web/assets/erDiagram-JOGREHBK-BIpd6dTf.js +85 -0
- package/dist-web/assets/flowDiagram-UKHOOZJN-D9wBbHm2.js +156 -0
- package/dist-web/assets/flowDiagram-UKHOOZJN-Z83i2UWI.js +156 -0
- package/dist-web/assets/ganttDiagram-PKOTCBZU-Cd_dViF-.js +292 -0
- package/dist-web/assets/ganttDiagram-PKOTCBZU-DFrb_S1d.js +292 -0
- package/dist-web/assets/{gitGraphDiagram-PVQCEYII-BSDFfwdY.js → gitGraphDiagram-DS77QQ5N-BiEEtTo7.js} +3 -3
- package/dist-web/assets/{gitGraphDiagram-PVQCEYII-DMbTATyw.js → gitGraphDiagram-DS77QQ5N-Dp3Ar-hi.js} +3 -3
- package/dist-web/assets/{graph-BwjfAU3j.js → graph-CAUpWmoK.js} +1 -1
- package/dist-web/assets/{graph--OzhPTMs.js → graph-DOmOIIwC.js} +1 -1
- package/dist-web/assets/{index-W6VnSrkB.js → index-Ba1OvLjf.js} +2 -2
- package/dist-web/assets/{index-CkVgGDpx.js → index-CiPA8Kex.js} +4 -4
- package/dist-web/assets/{index-BzK4vJBu.js → index-DdEakFJM.js} +1 -1
- package/dist-web/assets/{index10-Czg_oF-W.js → index10-CNr4U-Nw.js} +1 -1
- package/dist-web/assets/{index11-BjzCZuCr.js → index11-Dto_yZNz.js} +1 -1
- package/dist-web/assets/{index5-DlVoNkCD.js → index5-B2PldaO2.js} +1 -1
- package/dist-web/assets/{index6-BxiXA2yo.js → index6-CBdZmmyx.js} +1 -1
- package/dist-web/assets/{index7-BPdza6d1.js → index7-Dz9oCsUF.js} +1 -1
- package/dist-web/assets/{index8-Q_XzGC1Z.js → index8-B6k25jtU.js} +2 -2
- package/dist-web/assets/{infoDiagram-5YYISTIA-2JF3XEdD.js → infoDiagram-6WML65LV-BSa2g04G.js} +1 -1
- package/dist-web/assets/{infoDiagram-5YYISTIA-UrQusrJq.js → infoDiagram-6WML65LV-D4ph2sIH.js} +1 -1
- package/dist-web/assets/{ishikawaDiagram-YF4QCWOH-7RVUL-vB.js → ishikawaDiagram-WSZJBQD7-DjKjbMm9.js} +5 -5
- package/dist-web/assets/{ishikawaDiagram-YF4QCWOH-C5OstRVV.js → ishikawaDiagram-WSZJBQD7-Hm36UOQe.js} +5 -5
- package/dist-web/assets/{journeyDiagram-JHISSGLW-B34fCMu9.js → journeyDiagram-NVQOT4AX-DttHDfPQ.js} +1 -1
- package/dist-web/assets/{journeyDiagram-JHISSGLW-yctdo4bX.js → journeyDiagram-NVQOT4AX-MvWWPNDV.js} +1 -1
- package/dist-web/assets/{kanban-definition-UN3LZRKU-BS4FBZsQ.js → kanban-definition-27J2QSJJ-C5gB-W0d.js} +7 -7
- package/dist-web/assets/{kanban-definition-UN3LZRKU-CxBCv27E.js → kanban-definition-27J2QSJJ-Cu-E_cXA.js} +5 -5
- package/dist-web/assets/layout-CvP6o9AK.js +1 -0
- package/dist-web/assets/layout-D-LzfAck.js +1 -0
- package/dist-web/assets/{linear-3mB6q2-g.js → linear-B3HWgQI2.js} +1 -1
- package/dist-web/assets/{linear-BKCnUo31.js → linear-BRGe4-d6.js} +1 -1
- package/dist-web/assets/map-CWKZqZjr.js +1 -0
- package/dist-web/assets/map-DxJ2ADlA.js +1 -0
- package/dist-web/assets/mermaid.core-D-9Sx1No.js +314 -0
- package/dist-web/assets/mermaidParser.worker-PTFfzpoB.js +318 -0
- package/dist-web/assets/{mindmap-definition-RKZ34NQL-BmJZpjh6.js → mindmap-definition-FAOFIHXS-C4vnms3i.js} +2 -2
- package/dist-web/assets/{mindmap-definition-RKZ34NQL-1mjWUcf6.js → mindmap-definition-FAOFIHXS-Cg_hoVIq.js} +1 -1
- package/dist-web/assets/pegDiagram-VL7TDLO6-B2fFEFUH.js +1 -0
- package/dist-web/assets/pegDiagram-VL7TDLO6-CSX9hitD.js +1 -0
- package/dist-web/assets/pieDiagram-7S7Q4E2Y-0L0mxahZ.js +39 -0
- package/dist-web/assets/pieDiagram-7S7Q4E2Y-C7T0Cmw1.js +39 -0
- package/dist-web/assets/{quadrantDiagram-W4KKPZXB-BmT_qM09.js → quadrantDiagram-CIZ2JOQS-BBy7w4kD.js} +3 -3
- package/dist-web/assets/{quadrantDiagram-W4KKPZXB-C0kPuyNP.js → quadrantDiagram-CIZ2JOQS-U483z0er.js} +3 -3
- package/dist-web/assets/railroadDiagram-AXF67PYL-D80a2_DJ.js +1 -0
- package/dist-web/assets/railroadDiagram-AXF67PYL-DX8y0MzW.js +1 -0
- package/dist-web/assets/{requirementDiagram-4Y6WPE33-C0YP_Amt.js → requirementDiagram-LRYGKXZP-CeyHfq8t.js} +3 -3
- package/dist-web/assets/{requirementDiagram-4Y6WPE33-CZrxH1Y2.js → requirementDiagram-LRYGKXZP-DGD5J_4k.js} +3 -3
- package/dist-web/assets/sankeyDiagram-W5VNT64P-CCISkkrR.js +40 -0
- package/dist-web/assets/sankeyDiagram-W5VNT64P-CT5PdZz2.js +40 -0
- package/dist-web/assets/sequenceDiagram-SI44F4Z6-BeMzHWXI.js +162 -0
- package/dist-web/assets/sequenceDiagram-SI44F4Z6-jQfm2XS7.js +162 -0
- package/dist-web/assets/sizeCapture-X5ZJPWSS-BQsTdtrv.js +1 -0
- package/dist-web/assets/sizeCapture-X5ZJPWSS-lRZsmCoS.js +1 -0
- package/dist-web/assets/stateDiagram-OKZ733FA-ClCgTdUm.js +1 -0
- package/dist-web/assets/stateDiagram-OKZ733FA-Cv59z5YT.js +1 -0
- package/dist-web/assets/stateDiagram-v2-UEYNNEHI-R8jTc--F.js +1 -0
- package/dist-web/assets/stateDiagram-v2-UEYNNEHI-fi_lrTAx.js +1 -0
- package/dist-web/assets/swimlanes-SLNWSIFB-BCdOUN05.js +2 -0
- package/dist-web/assets/swimlanes-SLNWSIFB-Cu5l7SuR.js +1 -0
- package/dist-web/assets/swimlanesDiagram-ULZ7WXOC-BUd_uYK3.js +8 -0
- package/dist-web/assets/swimlanesDiagram-ULZ7WXOC-CalrsgPK.js +8 -0
- package/dist-web/assets/{timeline-definition-PNZ67QCA-DsVZdrZa.js → timeline-definition-Z64GVDOM-CMjnh4bu.js} +4 -4
- package/dist-web/assets/{timeline-definition-PNZ67QCA-DnB6Usl0.js → timeline-definition-Z64GVDOM-DpWutSKa.js} +4 -4
- package/dist-web/assets/vennDiagram-T6HMQDX7-DKJW_8oU.js +34 -0
- package/dist-web/assets/vennDiagram-T6HMQDX7-DVC5JVsc.js +34 -0
- package/dist-web/assets/{vue.runtime.esm-bundler-pgHGheCW.js → vue.runtime.esm-bundler-BwwRtQwQ.js} +1 -1
- package/dist-web/assets/{wardleyDiagram-YWT4CUSO-oBauTCEw.js → wardleyDiagram-T6FBY63Y-BK2mrq7L.js} +3 -3
- package/dist-web/assets/{wardleyDiagram-YWT4CUSO-DCiyDQNB.js → wardleyDiagram-T6FBY63Y-oUvgepFn.js} +3 -3
- package/dist-web/assets/xychartDiagram-ELKLHX3M-DI6n79q0.js +7 -0
- package/dist-web/assets/xychartDiagram-ELKLHX3M-DUJu9F7-.js +7 -0
- package/dist-web/index.html +1 -1
- package/dist-web/vis/index.html.gz +0 -0
- package/native/win32/prebuilds/win32-arm64/win32-console-mode.node +0 -0
- package/native/win32/prebuilds/win32-x64/win32-console-mode.node +0 -0
- package/package.json +7 -2
- package/telegram-plugin/dist/bridge.mjs +6 -4
- package/telegram-plugin/dist/mcp-server.mjs +236 -71
- package/dist-web/assets/arc-4xPfymbf.js +0 -1
- package/dist-web/assets/arc-Doj0wRZ0.js +0 -1
- package/dist-web/assets/architectureDiagram-3BPJPVTR-BGih283a.js +0 -36
- package/dist-web/assets/architectureDiagram-3BPJPVTR-CQ09RrbH.js +0 -36
- package/dist-web/assets/blockDiagram-GPEHLZMM-3ShMf1gu.js +0 -132
- package/dist-web/assets/blockDiagram-GPEHLZMM-CAtDjkJt.js +0 -132
- package/dist-web/assets/channel-DNkUo9e6.js +0 -1
- package/dist-web/assets/channel-DcnUTIGB.js +0 -1
- package/dist-web/assets/chunk-AQP2D5EJ-FS8-f8lF.js +0 -231
- package/dist-web/assets/chunk-AQP2D5EJ-UKhb4V4r.js +0 -231
- package/dist-web/assets/classDiagram-4FO5ZUOK-B1ZO8EbE.js +0 -1
- package/dist-web/assets/classDiagram-4FO5ZUOK-xk6cM9Kq.js +0 -1
- package/dist-web/assets/classDiagram-v2-Q7XG4LA2-B1ZO8EbE.js +0 -1
- package/dist-web/assets/classDiagram-v2-Q7XG4LA2-xk6cM9Kq.js +0 -1
- package/dist-web/assets/dagre-BM42HDAG-CmUO9qKN.js +0 -4
- package/dist-web/assets/dagre-BM42HDAG-DLMfLCoV.js +0 -4
- package/dist-web/assets/diagram-2AECGRRQ-DQTst0OH.js +0 -43
- package/dist-web/assets/diagram-2AECGRRQ-L74iLMqd.js +0 -43
- package/dist-web/assets/diagram-5GNKFQAL-BiBm7CJR.js +0 -10
- package/dist-web/assets/diagram-5GNKFQAL-DoE6q7H1.js +0 -10
- package/dist-web/assets/diagram-OG6HWLK6-BHCt1E0n.js +0 -24
- package/dist-web/assets/diagram-OG6HWLK6-DRyxjFMa.js +0 -24
- package/dist-web/assets/erDiagram-TEJ5UH35-BoDczjGG.js +0 -85
- package/dist-web/assets/erDiagram-TEJ5UH35-yd6SOv_7.js +0 -85
- package/dist-web/assets/flowDiagram-I6XJVG4X-DHoceI7r.js +0 -162
- package/dist-web/assets/flowDiagram-I6XJVG4X-DkYNQv0R.js +0 -162
- package/dist-web/assets/ganttDiagram-6RSMTGT7-Cg1TQBc0.js +0 -292
- package/dist-web/assets/ganttDiagram-6RSMTGT7-Z6klo7KK.js +0 -292
- package/dist-web/assets/layout-C1ojF0zw.js +0 -1
- package/dist-web/assets/layout-SsrduOYp.js +0 -1
- package/dist-web/assets/mermaid.core-D_lKT0dR.js +0 -309
- package/dist-web/assets/mermaidParser.worker-Dx4jPi9z.js +0 -313
- package/dist-web/assets/pieDiagram-4H26LBE5-BU41t2A_.js +0 -30
- package/dist-web/assets/pieDiagram-4H26LBE5-BkwDAvbt.js +0 -30
- package/dist-web/assets/sankeyDiagram-5OEKKPKP-De_o7hDr.js +0 -40
- package/dist-web/assets/sankeyDiagram-5OEKKPKP-Dvuj6bMA.js +0 -40
- package/dist-web/assets/sequenceDiagram-3UESZ5HK-DuCrgPyA.js +0 -162
- package/dist-web/assets/sequenceDiagram-3UESZ5HK-VAxffBe7.js +0 -162
- package/dist-web/assets/stateDiagram-AJRCARHV-CYLupxM7.js +0 -1
- package/dist-web/assets/stateDiagram-AJRCARHV-nDExQydZ.js +0 -1
- package/dist-web/assets/stateDiagram-v2-BHNVJYJU-BhEc7Thx.js +0 -1
- package/dist-web/assets/stateDiagram-v2-BHNVJYJU-BzwD_BIl.js +0 -1
- package/dist-web/assets/vennDiagram-CIIHVFJN-BBHQmCFf.js +0 -34
- package/dist-web/assets/vennDiagram-CIIHVFJN-Cfj-K9NW.js +0 -34
- package/dist-web/assets/wardley-L42UT6IY-BJFn8eDD.js +0 -173
- package/dist-web/assets/wardley-L42UT6IY-BSu8-4hg.js +0 -173
- package/dist-web/assets/xychartDiagram-2RQKCTM6-C2iZpl9I.js +0 -7
- package/dist-web/assets/xychartDiagram-2RQKCTM6-Db_VoDBV.js +0 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DesignSystemView-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DesignSystemView-BbMOu-XO.js","assets/DesignSystemView-6HgAUEmC.css","assets/mhchem-DtR62fUK.js","assets/katex-DnlPpQZa.js","assets/CodeBlockNode-CXnTLMNr.js","assets/safeRaf-DGuzXxDK.js","assets/CodeBlockShell.vue_vue_type_style_index_0_lang-CCF8Ntnq.js","assets/index8-B6k25jtU.js","assets/index11-Dto_yZNz.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const r of i.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&s(r)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();/**
|
|
3
3
|
* @vue/shared v3.5.35
|
|
4
4
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
@@ -35,7 +35,7 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DesignSystemVie
|
|
|
35
35
|
* vue-i18n v11.4.5
|
|
36
36
|
* (c) 2026 kazuya kawaguchi
|
|
37
37
|
* Released under the MIT License.
|
|
38
|
-
*/const qN="11.4.5";function jN(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(Pl().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(Pl().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Pl().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Pl().__INTLIFY_PROD_DEVTOOLS__=!1)}const Qs={UNEXPECTED_RETURN_TYPE:uN,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 po(e,...t){return fh(e,null,void 0)}const Uv=tl("__translateVNode"),qv=tl("__datetimeParts"),jv=tl("__numberParts"),pA=tl("__setPluralRules"),hA=tl("__injectWithOption"),Ra=tl("__dispose");function Pu(e){if(!en(e)||$i(e))return e;for(const t in e)if(Zo(e,t))if(!t.includes("."))en(e[t])&&Pu(e[t]);else{const n=t.split("."),s=n.length-1;let o=e,i=!1;for(let r=0;r<s;r++){if(n[r]==="__proto__")throw new Error(`unsafe key: ${n[r]}`);if(n[r]in o||(o[n[r]]=vn()),!en(o[n[r]])){i=!0;break}o=o[n[r]]}if(i||($i(o)?sA.includes(n[s])||delete e[t]:(o[n[s]]=e[t],delete e[t])),!$i(o)){const r=o[n[s]];en(r)&&Pu(r)}}return e}function k0(e,t){const{messages:n,__i18n:s,messageResolver:o,flatJson:i}=t,r=jt(n)?n:Yn(s)?vn():{[e]:vn()};if(Yn(s)&&s.forEach(l=>{if("locale"in l&&"resource"in l){const{locale:a,resource:c}=l;a?(r[a]=r[a]||vn(),Cf(c,r[a])):Cf(c,r)}else pt(l)&&Cf(JSON.parse(l),r)}),o==null&&i)for(const l in r)Zo(r,l)&&Pu(r[l]);return r}function mA(e){return e.type}function gA(e,t,n){let s=en(t.messages)?t.messages:vn();"__i18nGlobal"in n&&(s=k0(e.locale.value,{messages:s,__i18n:n.__i18nGlobal}));const o=Object.keys(s);o.length&&o.forEach(i=>{e.mergeLocaleMessage(i,s[i])});{if(en(t.datetimeFormats)){const i=Object.keys(t.datetimeFormats);i.length&&i.forEach(r=>{e.mergeDateTimeFormat(r,t.datetimeFormats[r])})}if(en(t.numberFormats)){const i=Object.keys(t.numberFormats);i.length&&i.forEach(r=>{e.mergeNumberFormat(r,t.numberFormats[r])})}}}function d_(e){return oe(zr,null,e,0)}function Ru(){return Ls()}const f_="__INTLIFY_META__",p_=()=>[],VN=()=>!1;let h_=0;function m_(e){return((t,n,s,o)=>e(n,s,Ru()||void 0,o))}const KN=()=>{const e=Ru();let t=null;return e&&(t=mA(e)[f_])?{[f_]:t}:null};function dp(e={}){const{__root:t,__injectWithOption:n}=e,s=t===void 0,o=e.flatJson,i=cp?Z:Ql;let r=Jt(e.inheritLocale)?e.inheritLocale:!0;const l=i(t&&r?t.locale.value:pt(e.locale)?e.locale:Ou),a=i(t&&r?t.fallbackLocale.value:pt(e.fallbackLocale)||Yn(e.fallbackLocale)||jt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:l.value),c=i(k0(l.value,e)),u=i(jt(e.datetimeFormats)?e.datetimeFormats:{[l.value]:{}}),d=i(jt(e.numberFormats)?e.numberFormats:{[l.value]:{}});let p=t?t.missingWarn:Jt(e.missingWarn)||lc(e.missingWarn)?e.missingWarn:!0,h=t?t.fallbackWarn:Jt(e.fallbackWarn)||lc(e.fallbackWarn)?e.fallbackWarn:!0,f=t?t.fallbackRoot:Jt(e.fallbackRoot)?e.fallbackRoot:!0,m=!!e.fallbackFormat,b=Pn(e.missing)?e.missing:null,_=Pn(e.missing)?m_(e.missing):null,g=Pn(e.postTranslation)?e.postTranslation:null,v=t?t.warnHtmlMessage:Jt(e.warnHtmlMessage)?e.warnHtmlMessage:!0,y=!!e.escapeParameter;const A=t?t.modifiers:jt(e.modifiers)?e.modifiers:{};let O=e.pluralRules||t&&t.pluralRules,$;$=(()=>{s&&s_(null);const ae={version:qN,locale:l.value,fallbackLocale:a.value,messages:c.value,modifiers:A,pluralRules:O,missing:_===null?void 0:_,missingWarn:p,fallbackWarn:h,fallbackFormat:m,unresolving:!0,postTranslation:g===null?void 0:g,warnHtmlMessage:v,escapeParameter:y,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};ae.datetimeFormats=u.value,ae.numberFormats=d.value,ae.__datetimeFormatters=jt($)?$.__datetimeFormatters:void 0,ae.__numberFormatters=jt($)?$.__numberFormatters:void 0;const Te=IN(ae);return s&&s_(Te),Te})(),jc($,l.value,a.value);function E(){return[l.value,a.value,c.value,u.value,d.value]}const M=F({get:()=>l.value,set:ae=>{$.locale=ae,l.value=ae}}),L=F({get:()=>a.value,set:ae=>{$.fallbackLocale=ae,a.value=ae,jc($,l.value,ae)}}),S=F(()=>c.value),I=F(()=>u.value),P=F(()=>d.value);function D(){return Pn(g)?g:null}function W(ae){g=ae,$.postTranslation=ae}function z(){return b}function q(ae){ae!==null&&(_=m_(ae)),b=ae,$.missing=_}const Q=(ae,Te,Ve,tt,bt,kt)=>{E();let Tt;try{__INTLIFY_PROD_DEVTOOLS__,s||($.fallbackContext=t?EN():void 0),Tt=ae($)}finally{__INTLIFY_PROD_DEVTOOLS__,s||($.fallbackContext=void 0)}if(Ve!=="translate exists"&&rs(Tt)&&Tt===ph||Ve==="translate exists"&&!Tt){const[Pt,mt]=Te();return t&&f?tt(t):bt(Pt)}else{if(kt(Tt))return Tt;throw po(Qs.UNEXPECTED_RETURN_TYPE)}};function X(...ae){return Q(Te=>Reflect.apply(u_,null,[Te,...ae]),()=>zv(...ae),"translate",Te=>Reflect.apply(Te.t,Te,[...ae]),Te=>Te,Te=>pt(Te))}function fe(...ae){const[Te,Ve,tt]=ae;if(tt&&!en(tt))throw po(Qs.INVALID_ARGUMENT);return X(Te,Ve,as({resolvedMessage:!0},tt||{}))}function ye(...ae){return Q(Te=>Reflect.apply(i_,null,[Te,...ae]),()=>Hv(...ae),"datetime format",Te=>Reflect.apply(Te.d,Te,[...ae]),()=>up,Te=>pt(Te)||Yn(Te))}function Me(...ae){return Q(Te=>Reflect.apply(l_,null,[Te,...ae]),()=>Wv(...ae),"number format",Te=>Reflect.apply(Te.n,Te,[...ae]),()=>up,Te=>pt(Te)||Yn(Te))}function we(ae){return ae.map(Te=>pt(Te)||rs(Te)||Jt(Te)?d_(String(Te)):Te)}const Ue={normalize:we,interpolate:ae=>ae,type:"vnode"};function Fe(...ae){return Q(Te=>{let Ve;const tt=Te;try{tt.processor=Ue,Ve=Reflect.apply(u_,null,[tt,...ae])}finally{tt.processor=null}return Ve},()=>zv(...ae),"translate",Te=>Te[Uv](...ae),Te=>[d_(Te)],Te=>Yn(Te))}function rt(...ae){return Q(Te=>Reflect.apply(l_,null,[Te,...ae]),()=>Wv(...ae),"number format",Te=>Te[jv](...ae),p_,Te=>pt(Te)||Yn(Te))}function le(...ae){return Q(Te=>Reflect.apply(i_,null,[Te,...ae]),()=>Hv(...ae),"datetime format",Te=>Te[qv](...ae),p_,Te=>pt(Te)||Yn(Te))}function U(ae){O=ae,$.pluralRules=O}function G(ae,Te){return Q(()=>{if(!ae)return!1;const Ve=pt(Te)?Te:l.value,tt=pt(Te)?[Ve]:Fv($,a.value,Ve);for(let bt=0;bt<tt.length;bt++){const kt=J(tt[bt]);let Tt=$.messageResolver(kt,ae);if(Tt===null&&(Tt=kt[ae]),$i(Tt)||Go(Tt)||pt(Tt))return!0}return!1},()=>[ae],"translate exists",Ve=>Reflect.apply(Ve.te,Ve,[ae,Te]),VN,Ve=>Jt(Ve))}function ne(ae){let Te=null;const Ve=Fv($,a.value,l.value);for(let tt=0;tt<Ve.length;tt++){const bt=c.value[Ve[tt]]||{},kt=$.messageResolver(bt,ae);if(kt!=null){Te=kt;break}}return Te}function H(ae){const Te=ne(ae);return Te??(t?t.tm(ae)||{}:{})}function J(ae){return c.value[ae]||{}}function ce(ae,Te){if(o){const Ve={[ae]:Te};for(const tt in Ve)Zo(Ve,tt)&&Pu(Ve[tt]);Te=Ve[ae]}c.value[ae]=Te,$.messages=c.value}function te(ae,Te){c.value[ae]=c.value[ae]||{};const Ve={[ae]:Te};if(o)for(const tt in Ve)Zo(Ve,tt)&&Pu(Ve[tt]);Te=Ve[ae],Cf(Te,c.value[ae]),$.messages=c.value}function ue(ae){return u.value[ae]||{}}function j(ae,Te){u.value[ae]=Te,$.datetimeFormats=u.value,r_($,ae,Te)}function Y(ae,Te){u.value[ae]=as(u.value[ae]||{},Te),$.datetimeFormats=u.value,r_($,ae,Te)}function re(ae){return d.value[ae]||{}}function ge(ae,Te){d.value[ae]=Te,$.numberFormats=d.value,a_($,ae,Te)}function Ae(ae,Te){d.value[ae]=as(d.value[ae]||{},Te),$.numberFormats=d.value,a_($,ae,Te)}h_++,t&&cp&&(Ke(t.locale,ae=>{r&&(l.value=ae,$.locale=ae,jc($,l.value,a.value))}),Ke(t.fallbackLocale,ae=>{r&&(a.value=ae,$.fallbackLocale=ae,jc($,l.value,a.value))}));const Ie={id:h_,locale:M,fallbackLocale:L,get inheritLocale(){return r},set inheritLocale(ae){r=ae,ae&&t&&(l.value=t.locale.value,a.value=t.fallbackLocale.value,jc($,l.value,a.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:S,get modifiers(){return A},get pluralRules(){return O||{}},get isGlobal(){return s},get missingWarn(){return p},set missingWarn(ae){p=ae,$.missingWarn=p},get fallbackWarn(){return h},set fallbackWarn(ae){h=ae,$.fallbackWarn=h},get fallbackRoot(){return f},set fallbackRoot(ae){f=ae},get fallbackFormat(){return m},set fallbackFormat(ae){m=ae,$.fallbackFormat=m},get warnHtmlMessage(){return v},set warnHtmlMessage(ae){v=ae,$.warnHtmlMessage=ae},get escapeParameter(){return y},set escapeParameter(ae){y=ae,$.escapeParameter=ae},t:X,getLocaleMessage:J,setLocaleMessage:ce,mergeLocaleMessage:te,getPostTranslationHandler:D,setPostTranslationHandler:W,getMissingHandler:z,setMissingHandler:q,[pA]:U};return Ie.datetimeFormats=I,Ie.numberFormats=P,Ie.rt=fe,Ie.te=G,Ie.tm=H,Ie.d=ye,Ie.n=Me,Ie.getDateTimeFormat=ue,Ie.setDateTimeFormat=j,Ie.mergeDateTimeFormat=Y,Ie.getNumberFormat=re,Ie.setNumberFormat=ge,Ie.mergeNumberFormat=Ae,Ie[hA]=n,Ie[Uv]=Fe,Ie[qv]=le,Ie[jv]=rt,Ie}function GN(e){const t=pt(e.locale)?e.locale:Ou,n=pt(e.fallbackLocale)||Yn(e.fallbackLocale)||jt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,s=Pn(e.missing)?e.missing:void 0,o=Jt(e.silentTranslationWarn)||lc(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,i=Jt(e.silentFallbackWarn)||lc(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,r=Jt(e.fallbackRoot)?e.fallbackRoot:!0,l=!!e.formatFallbackMessages,a=jt(e.modifiers)?e.modifiers:{},c=e.pluralizationRules,u=Pn(e.postTranslation)?e.postTranslation:void 0,d=pt(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,p=!!e.escapeParameterHtml,h=Jt(e.sync)?e.sync:!0;let f=e.messages;if(jt(e.sharedMessages)){const A=e.sharedMessages;f=Object.keys(A).reduce(($,k)=>{const E=$[k]||($[k]={});return as(E,A[k]),$},f||{})}const{__i18n:m,__root:b,__injectWithOption:_}=e,g=e.datetimeFormats,v=e.numberFormats,y=e.flatJson;return{locale:t,fallbackLocale:n,messages:f,flatJson:y,datetimeFormats:g,numberFormats:v,missing:s,missingWarn:o,fallbackWarn:i,fallbackRoot:r,fallbackFormat:l,modifiers:a,pluralRules:c,postTranslation:u,warnHtmlMessage:d,escapeParameter:p,messageResolver:e.messageResolver,inheritLocale:h,__i18n:m,__root:b,__injectWithOption:_}}function Vv(e={}){const t=dp(GN(e)),{__extender:n}=e,s={id:t.id,get locale(){return t.locale.value},set locale(o){t.locale.value=o},get fallbackLocale(){return t.fallbackLocale.value},set fallbackLocale(o){t.fallbackLocale.value=o},get messages(){return t.messages.value},get datetimeFormats(){return t.datetimeFormats.value},get numberFormats(){return t.numberFormats.value},get availableLocales(){return t.availableLocales},get missing(){return t.getMissingHandler()},set missing(o){t.setMissingHandler(o)},get silentTranslationWarn(){return Jt(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(o){t.missingWarn=Jt(o)?!o:o},get silentFallbackWarn(){return Jt(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(o){t.fallbackWarn=Jt(o)?!o:o},get modifiers(){return t.modifiers},get formatFallbackMessages(){return t.fallbackFormat},set formatFallbackMessages(o){t.fallbackFormat=o},get postTranslation(){return t.getPostTranslationHandler()},set postTranslation(o){t.setPostTranslationHandler(o)},get sync(){return t.inheritLocale},set sync(o){t.inheritLocale=o},get warnHtmlInMessage(){return t.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(o){t.warnHtmlMessage=o!=="off"},get escapeParameterHtml(){return t.escapeParameter},set escapeParameterHtml(o){t.escapeParameter=o},get pluralizationRules(){return t.pluralRules||{}},__composer:t,t(...o){return Reflect.apply(t.t,t,[...o])},rt(...o){return Reflect.apply(t.rt,t,[...o])},te(o,i){return t.te(o,i)},tm(o){return t.tm(o)},getLocaleMessage(o){return t.getLocaleMessage(o)},setLocaleMessage(o,i){t.setLocaleMessage(o,i)},mergeLocaleMessage(o,i){t.mergeLocaleMessage(o,i)},d(...o){return Reflect.apply(t.d,t,[...o])},getDateTimeFormat(o){return t.getDateTimeFormat(o)},setDateTimeFormat(o,i){t.setDateTimeFormat(o,i)},mergeDateTimeFormat(o,i){t.mergeDateTimeFormat(o,i)},n(...o){return Reflect.apply(t.n,t,[...o])},getNumberFormat(o){return t.getNumberFormat(o)},setNumberFormat(o,i){t.setNumberFormat(o,i)},mergeNumberFormat(o,i){t.mergeNumberFormat(o,i)}};return s.__extender=n,s}function YN(e,t,n){return{beforeCreate(){const s=Ru();if(!s)throw po(Qs.UNEXPECTED_ERROR);const o=this.$options;if(o.i18n){const i=o.i18n;if(o.__i18n&&(i.__i18n=o.__i18n),i.__root=t,this===this.$root)this.$i18n=g_(e,i);else{i.__injectWithOption=!0,i.__extender=n.__vueI18nExtend,this.$i18n=Vv(i);const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}}else if(o.__i18n)if(this===this.$root)this.$i18n=g_(e,o);else{this.$i18n=Vv({__i18n:o.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:t});const i=this.$i18n;i.__extender&&(i.__disposer=i.__extender(this.$i18n))}else this.$i18n=e;o.__i18nGlobal&&gA(t,o,o),this.$t=(...i)=>this.$i18n.t(...i),this.$rt=(...i)=>this.$i18n.rt(...i),this.$te=(i,r)=>this.$i18n.te(i,r),this.$d=(...i)=>this.$i18n.d(...i),this.$n=(...i)=>this.$i18n.n(...i),this.$tm=i=>this.$i18n.tm(i),n.__setInstance(s,this.$i18n)},mounted(){},unmounted(){const s=Ru();if(!s)throw po(Qs.UNEXPECTED_ERROR);const o=this.$i18n;delete this.$t,delete this.$rt,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,o.__disposer&&(o.__disposer(),delete o.__disposer,delete o.__extender),n.__deleteInstance(s),delete this.$i18n}}}function g_(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[pA](t.pluralizationRules||e.pluralizationRules);const n=k0(e.locale,{messages:t.messages,__i18n:t.__i18n});return Object.keys(n).forEach(s=>e.mergeLocaleMessage(s,n[s])),t.datetimeFormats&&Object.keys(t.datetimeFormats).forEach(s=>e.mergeDateTimeFormat(s,t.datetimeFormats[s])),t.numberFormats&&Object.keys(t.numberFormats).forEach(s=>e.mergeNumberFormat(s,t.numberFormats[s])),e}const b0={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function XN({slots:e},t){return t.length===1&&t[0]==="default"?(e.default?e.default():[]).reduce((s,o)=>[...s,...o.type===Le?o.children:[o]],[]):t.reduce((n,s)=>{const o=e[s];return o&&(n[s]=o()),n},vn())}function vA(){return Le}const QN=je({name:"i18n-t",props:as({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>rs(e)||!isNaN(e)}},b0),setup(e,t){const{slots:n,attrs:s}=t,o=e.i18n||It({useScope:e.scope,__useComponent:!0});return()=>{const i=()=>{const a=Object.keys(n).filter(d=>d[0]!=="_"),c=vn();e.locale&&(c.locale=e.locale),e.plural!==void 0&&(c.plural=pt(e.plural)?+e.plural:e.plural);const u=XN(t,a);return o[Uv](e.keypath,u,c)},r=as(vn(),s),l=pt(e.tag)||en(e.tag)?e.tag:vA();return en(l)?cn(l,r,{default:i}):cn(l,r,i())}}}),v_=QN;function ZN(e){return Yn(e)&&!pt(e[0])}function yA(e,t,n,s){const{slots:o,attrs:i}=t;return()=>{const r=()=>{const c={part:!0};let u=vn();e.locale&&(c.locale=e.locale),pt(e.format)?c.key=e.format:en(e.format)&&(pt(e.format.key)&&(c.key=e.format.key),u=Object.keys(e.format).reduce((h,f)=>n.includes(f)?as(vn(),h,{[f]:e.format[f]}):h,vn()));const d=s(e.value,c,u);let p=[c.key];return Yn(d)?p=d.map((h,f)=>{const m=o[h.type],b=m?m({[h.type]:h.value,index:f,parts:d}):[h.value];return ZN(b)&&(b[0].key=`${h.type}-${f}`),b}):pt(d)&&(p=[d]),p},l=as(vn(),i),a=pt(e.tag)||en(e.tag)?e.tag:vA();return en(a)?cn(a,l,{default:r}):cn(a,l,r())}}const JN=je({name:"i18n-n",props:as({value:{type:Number,required:!0},format:{type:[String,Object]}},b0),setup(e,t){const n=e.i18n||It({useScope:e.scope,__useComponent:!0});return yA(e,t,uA,(...s)=>n[jv](...s))}}),y_=JN;function e5(e,t){const n=e;if(e.mode==="composition")return n.__getInstance(t)||e.global;{const s=n.__getInstance(t);return s!=null?s.__composer:e.global.__composer}}function t5(e){const t=r=>{const{instance:l,value:a}=r;if(!l||!l.$)throw po(Qs.UNEXPECTED_ERROR);const c=e5(e,l.$),u=k_(a);return[Reflect.apply(c.t,c,[...b_(u)]),c]};return{created:(r,l)=>{const[a,c]=t(l);cp&&(r.__i18nWatcher=Ke(c.locale,()=>{l.instance&&l.instance.$forceUpdate()})),r.__composer=c,r.textContent=a},unmounted:r=>{cp&&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=k_(l);r.textContent=Reflect.apply(a.t,a,[...b_(c)])}},getSSRProps:r=>{const[l]=t(r);return{textContent:l}}}}function k_(e){if(pt(e))return{path:e};if(jt(e)){if(!("path"in e))throw po(Qs.REQUIRED_VALUE,"path");return e}else throw po(Qs.INVALID_VALUE)}function b_(e){const{path:t,locale:n,args:s,choice:o,plural:i}=e,r={},l=s||{};return pt(n)&&(r.locale=n),rs(o)&&(r.plural=o),rs(i)&&(r.plural=i),[t,l,r]}function n5(e,t,...n){const s=jt(n[0])?n[0]:{};(Jt(s.globalInstall)?s.globalInstall:!0)&&([v_.name,"I18nT"].forEach(i=>e.component(i,v_)),[y_.name,"I18nN"].forEach(i=>e.component(i,y_)),[S_.name,"I18nD"].forEach(i=>e.component(i,S_))),e.directive("t",t5(t))}const s5=tl("global-vue-i18n");function o5(e={}){const t=__VUE_I18N_LEGACY_API__&&Jt(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,n=Jt(e.globalInjection)?e.globalInjection:!0,s=new Map,[o,i]=i5(e,t),r=tl("");function l(d){return s.get(d)||null}function a(d,p){s.set(d,p)}function c(d){s.delete(d)}const u={get mode(){return __VUE_I18N_LEGACY_API__&&t?"legacy":"composition"},async install(d,...p){if(d.__VUE_I18N_SYMBOL__=r,d.provide(d.__VUE_I18N_SYMBOL__,u),jt(p[0])){const m=p[0];u.__composerExtend=m.__composerExtend,u.__vueI18nExtend=m.__vueI18nExtend}let h=null;!t&&n&&(h=f5(d,u.global)),__VUE_I18N_FULL_INSTALL__&&n5(d,u,...p),__VUE_I18N_LEGACY_API__&&t&&d.mixin(YN(i,i.__composer,u));const f=d.unmount;d.unmount=()=>{h&&h(),u.dispose(),f()}},get global(){return i},dispose(){o.stop()},__instances:s,__getInstance:l,__setInstance:a,__deleteInstance:c};return u}function It(e={}){const t=Ru();if(t==null)throw po(Qs.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw po(Qs.NOT_INSTALLED);const n=r5(t),s=a5(n),o=mA(t),i=l5(e,o);if(i==="global")return gA(s,e,o),s;if(i==="parent"){let a=__(n,t,e.__useComponent);return a==null&&(a=s),a}if(i==="isolated"){if(n.mode!=="composition")throw po(Qs.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const a=n,c=as({},e),u=__(n,t);c.__root=u||s;const d=dp(c);return a.__composerExtend&&(d[Ra]=a.__composerExtend(d)),V1()&&K1(()=>{const h=d[Ra];h&&(h(),delete d[Ra])}),d}const r=n;let l=r.__getInstance(t);if(l==null){const a=as({},e);"__i18n"in o&&(a.__i18n=o.__i18n),s&&(a.__root=s),l=dp(a),r.__composerExtend&&(l[Ra]=r.__composerExtend(l)),u5(r,t,l),r.__setInstance(t,l)}return l}function i5(e,t){const n=$E(),s=__VUE_I18N_LEGACY_API__&&t?n.run(()=>Vv(e)):n.run(()=>dp(e));if(s==null)throw po(Qs.UNEXPECTED_ERROR);return[n,s]}function r5(e){const t=Ut(e.isCE?s5:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw po(e.isCE?Qs.NOT_INSTALLED_WITH_PROVIDE:Qs.UNEXPECTED_ERROR);return t}function l5(e,t){return dh(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function a5(e){return e.mode==="composition"?e.global:e.global.__composer}function __(e,t,n=!1){let s=null;const o=t.root;let i=c5(t,n);for(;i!=null;){const r=e;if(e.mode==="composition")s=r.__getInstance(i);else if(__VUE_I18N_LEGACY_API__){const l=r.__getInstance(i);l!=null&&(s=l.__composer,n&&s&&!s[hA]&&(s=null))}if(s!=null||o===i)break;i=i.parent}return s}function c5(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function u5(e,t,n){hn(()=>{},t),kn(()=>{const s=n;e.__deleteInstance(t);const o=s[Ra];o&&(o(),delete s[Ra])},t)}const d5=["locale","fallbackLocale","availableLocales"],w_=["t","rt","d","n","tm","te"];function f5(e,t){const n=Object.create(null);return d5.forEach(o=>{const i=Object.getOwnPropertyDescriptor(t,o);if(!i)throw po(Qs.UNEXPECTED_ERROR);const r=es(i.value)?{get(){return i.value.value},set(l){i.value.value=l}}:{get(){return i.get&&i.get()}};Object.defineProperty(n,o,r)}),e.config.globalProperties.$i18n=n,w_.forEach(o=>{const i=Object.getOwnPropertyDescriptor(t,o);if(!i||!i.value)throw po(Qs.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${o}`,i)}),()=>{delete e.config.globalProperties.$i18n,w_.forEach(o=>{delete e.config.globalProperties[`$${o}`]})}}const p5=je({name:"i18n-d",props:as({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},b0),setup(e,t){const n=e.i18n||It({useScope:e.scope,__useComponent:!0});return yA(e,t,cA,(...s)=>n[qv](...s))}}),S_=p5;jN();CN(iN);xN(_N);AN(Fv);if(__INTLIFY_PROD_DEVTOOLS__){const e=Pl();e.__INTLIFY__=!0,rN(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const h5="modulepreload",m5=function(e){return"/"+e},C_={},Xs=function(t,n,s){let o=Promise.resolve();if(n&&n.length>0){let r=function(c){return Promise.all(c.map(u=>Promise.resolve(u).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),a=l?.nonce||l?.getAttribute("nonce");o=r(n.map(c=>{if(c=m5(c),c in C_)return;C_[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const p=document.createElement("link");if(p.rel=u?"stylesheet":h5,u||(p.as="script"),p.crossOrigin="",p.href=c,a&&p.setAttribute("nonce",a),document.head.appendChild(p),u)return new Promise((h,f)=>{p.addEventListener("load",h),p.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(r){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=r,window.dispatchEvent(l),!l.defaultPrevented)throw r}return o.then(r=>{for(const l of r||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})},Et={permission:"king-web.permission",activeWorkspace:"blun-active-workspace",thinking:"king-web.thinking",planMode:"king-web.plan-mode",swarmMode:"king-web.swarm-mode",goalMode:"king-web.goal-mode",uiFontSize:"king-web.ui-font-size",starredModels:"king-web.starred-models",unread:"king-web.unread",onboarded:"king-web.onboarded",accent:"king-web.accent",colorScheme:"king-web.color-scheme",hiddenWorkspaces:"king-web.hidden-workspaces",collapsedWorkspaces:"king-web.collapsed-workspaces",showWorkspacePaths:"king-web.show-workspace-paths",workspaceOrder:"king-web.workspace-order",workspaceNameOverrides:"king-web.workspace-name-overrides",workspaceSort:"king-web.workspace-sort",conversationToc:"king-web.beta-toc",notifyOnComplete:"king-web.notify-on-complete",notifyOnQuestion:"king-web.notify-on-question",soundOnComplete:"king-web.sound-on-complete",inputHistory:"king-web.input-history",locale:"blun-locale",clientId:"king-web.client-id",debug:"king-web.debug",openInLastTarget:"king-web.open-in.last-target",sidebarCollapsed:"king-web.sidebar-collapsed",sidebarWidth:"king-web.sidebar-width",codeFont:"king-web.code-font",contentAlign:"king-web.content-align",theme:"king-web.theme"};function x_(e){return`king-web.draft.${e&&e.length>0?e:"__new__"}`}function Qn(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function ts(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function cc(e){try{globalThis.localStorage.removeItem(e)}catch{}}function od(e){const t=Qn(e);if(t===null)return null;try{return JSON.parse(t)}catch{return null}}function yc(e,t){try{globalThis.localStorage.setItem(e,JSON.stringify(t))}catch{}}function _0(){const e=Qn(Et.unread);if(!e)return{};try{const t=JSON.parse(e);if(!t||typeof t!="object")return{};const n={};for(const[s,o]of Object.entries(t))o===!0&&(n[s]=!0);return n}catch{return{}}}function w0(e){const n={..._0()};for(const[s,o]of Object.entries(e))o?n[s]=!0:delete n[s];ts(Et.unread,JSON.stringify(n))}function g5(){const e=od(Et.collapsedWorkspaces);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function sg(e){yc(Et.collapsedWorkspaces,Array.from(e))}function v5(){return od(Et.showWorkspacePaths)===!0}function y5(e){yc(Et.showWorkspacePaths,e)}function k5(){const e=od(Et.workspaceOrder);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function kA(e){yc(Et.workspaceOrder,Array.from(e))}function Zd(){const e=od(Et.workspaceNameOverrides);if(!e||typeof e!="object")return{};const t={};for(const[n,s]of Object.entries(e))typeof s=="string"&&(t[n]=s);return t}function A_(e){yc(Et.workspaceNameOverrides,e)}function b5(){return Qn(Et.workspaceSort)}function bA(e){ts(Et.workspaceSort,e)}const T_=Et.clientId,_5="blun-web",w5="web";function S5(){return{serverHttpUrl:x5(),clientId:E5(),clientName:_5,clientVersion:I5(),clientUiMode:w5}}function C5(){return typeof window<"u"&&window.location?.origin?window.location.origin:"http://127.0.0.1:58627"}function x5(e){const t=C5(),n=new URL(t);return n.pathname=n.pathname.replace(/\/v1\/?$/,"").replace(/\/$/,""),n.search="",n.hash="",n.toString().replace(/\/$/,"")}function A5(e){return e.replace(/^https?:\/\//,"").replace(/\/$/,"")}function T5(){const e=typeof window<"u"&&window.location?.origin?window.location.origin:"";return A5(e)}function cu(e,t){return`${e}/api/v1${t.startsWith("/")?t:`/${t}`}`}function M5(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 E5(){const e=Qn(T_);if(e)return e;const t=`web_${globalThis.crypto?.randomUUID?.()||Math.random().toString(36).slice(2)}`;return ts(T_,t),t}function I5(){return"0.1.2".trim()?"0.1.2":"0.0.0-dev"}async function zs(e){const t=typeof navigator<"u"?navigator.clipboard:void 0;if(t&&typeof t.writeText=="function")try{return await t.writeText(e),!0}catch{}return $5(e)}function $5(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 N5(e,t){if(e.length===0)return null;const n=new Set(e),s=t.filter(i=>n.has(i)),o=e.filter(i=>!t.includes(i));return o.length===0&&s.length===t.length?null:[...o,...s]}function L5(e,t){const n=new Map(t.map((s,o)=>[s,o]));return e.toSorted((s,o)=>(n.get(s.id)??-1)-(n.get(o.id)??-1))}function O5(e,t,n,s="before"){const o=e.indexOf(t),i=e.indexOf(n);if(o===-1||i===-1||o===i)return e;const r=[...e];r.splice(o,1);const l=o<i?i-1:i,a=s==="before"?l:l+1;return r.splice(a,0,t),r}function P5(e,t){return e.toSorted((n,s)=>(t.get(s.id)??Number.NEGATIVE_INFINITY)-(t.get(n.id)??Number.NEGATIVE_INFINITY))}const R5={"&":"&","<":"<",">":">",'"':""","'":"'"};function M_(e){return e.replace(/[&<>"']/g,t=>R5[t]??t)}function D5(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function B5(e,t,n=40){const s=e.replace(/\s+/g," ").trim();if(s.length===0)return"";const o=t.trim();if(o.length===0)return E_(s,n*2);const i=s.toLowerCase().indexOf(o.toLowerCase());if(i<0)return E_(s,n*2);const r=Math.max(0,i-n),l=Math.min(s.length,i+o.length+n),a=r>0,c=l<s.length;return`${a?"…":""}${s.slice(r,l)}${c?"…":""}`}function E_(e,t){return e.length<=t?e:`${e.slice(0,t)}…`}function og(e,t){const n=M_(e),s=t.trim();if(s.length===0)return n;const o=new RegExp(D5(M_(s)),"gi");return n.replace(o,i=>`<mark>${i}</mark>`)}const Ea=Z(0),F5=["type","disabled","aria-label"],H5=je({__name:"IconButton",props:{size:{default:"md"},disabled:{type:Boolean},label:{},type:{default:"button"}},setup(e,{expose:t}){const n=Z();return t({el:n}),(s,o)=>(w(),N("button",{ref_key:"el",ref:n,class:Re(["ui-icon-button",`ui-icon-button--${e.size}`]),type:e.type,disabled:e.disabled,"aria-label":e.label},[Cn(s.$slots,"default",{},void 0,!0)],10,F5))}}),ut=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},gn=ut(H5,[["__scopeId","data-v-7f663277"]]),W5=Object.freeze({left:0,top:0,width:16,height:16}),_A=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),wA=Object.freeze({...W5,..._A}),she=Object.freeze({...wA,body:"",hidden:!1}),z5=Object.freeze({width:null,height:null}),U5=Object.freeze({...z5,..._A}),q5=/(-?[0-9.]*[0-9]+[0-9.]*)/g,j5=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function I_(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const s=e.split(q5);if(s===null||!s.length)return e;const o=[];let i=s.shift(),r=j5.test(i);for(;;){if(r){const l=parseFloat(i);isNaN(l)?o.push(i):o.push(Math.ceil(l*t*n)/n)}else o.push(i);if(i=s.shift(),i===void 0)return o.join("");r=!r}}function V5(e,t="defs"){let n="";const s=e.indexOf("<"+t);for(;s>=0;){const o=e.indexOf(">",s),i=e.indexOf("</"+t);if(o===-1||i===-1)break;const r=e.indexOf(">",i);if(r===-1)break;n+=e.slice(o+1,i).trim(),e=e.slice(0,s).trim()+e.slice(r+1)}return{defs:n,content:e}}function K5(e,t){return e?"<defs>"+e+"</defs>"+t:t}function G5(e,t,n){const s=V5(e);return K5(s.defs,t+s.content+n)}const Y5=e=>e==="unset"||e==="undefined"||e==="none";function X5(e,t){const n={...wA,...e},s={...U5,...t},o={left:n.left,top:n.top,width:n.width,height:n.height};let i=n.body;[n,s].forEach(m=>{const b=[],_=m.hFlip,g=m.vFlip;let v=m.rotate;_?g?v+=2:(b.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),b.push("scale(-1 1)"),o.top=o.left=0):g&&(b.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),b.push("scale(1 -1)"),o.top=o.left=0);let y;switch(v<0&&(v-=Math.floor(v/4)*4),v=v%4,v){case 1:y=o.height/2+o.top,b.unshift("rotate(90 "+y.toString()+" "+y.toString()+")");break;case 2:b.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:y=o.width/2+o.left,b.unshift("rotate(-90 "+y.toString()+" "+y.toString()+")");break}v%2===1&&(o.left!==o.top&&(y=o.left,o.left=o.top,o.top=y),o.width!==o.height&&(y=o.width,o.width=o.height,o.height=y)),b.length&&(i=G5(i,'<g transform="'+b.join(" ")+'">',"</g>"))});const r=s.width,l=s.height,a=o.width,c=o.height;let u,d;r===null?(d=l===null?"1em":l==="auto"?c:l,u=I_(d,a/c)):(u=r==="auto"?a:r,d=l===null?I_(u,c/a):l==="auto"?c:l);const p={},h=(m,b)=>{Y5(b)||(p[m]=b.toString())};h("width",u),h("height",d);const f=[o.left,o.top,a,c];return p.viewBox=f.join(" "),{attributes:p,viewBox:f,body:i}}const SA={plus:{body:'<path fill="currentColor" d="M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"/>',width:24,height:24},"chat-new":{body:'<path fill="currentColor" d="M14 3v2H4v13.385L5.763 17H20v-7h2v8a1 1 0 0 1-1 1H6.455L2 22.5V4a1 1 0 0 1 1-1zm5 0V0h2v3h3v2h-3v3h-2V5h-3V3z"/>',width:24,height:24},close:{body:'<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"/>',width:24,height:24},check:{body:'<path fill="currentColor" d="m10 15.17l9.192-9.191l1.414 1.414L10 17.999l-6.364-6.364l1.414-1.414z"/>',width:24,height:24},search:{body:'<path fill="currentColor" d="m18.031 16.617l4.283 4.282l-1.415 1.415l-4.282-4.283A8.96 8.96 0 0 1 11 20c-4.968 0-9-4.032-9-9s4.032-9 9-9s9 4.032 9 9a8.96 8.96 0 0 1-1.969 5.617m-2.006-.742A6.98 6.98 0 0 0 18 11c0-3.867-3.133-7-7-7s-7 3.133-7 7s3.133 7 7 7a6.98 6.98 0 0 0 4.875-1.975z"/>',width:24,height:24},copy:{body:'<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"/>',width:24,height:24},link:{body:'<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"/>',width:24,height:24},"external-link":{body:'<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"/>',width:24,height:24},download:{body:'<path fill="currentColor" d="M3 19h18v2H3zm10-5.828L19.071 7.1l1.414 1.414L12 17L3.515 8.515L4.929 7.1L11 13.173V2h2z"/>',width:24,height:24},undo:{body:'<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"/>',width:24,height:24},send:{body:'<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"/>',width:24,height:24},image:{body:'<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"/>',width:24,height:24},settings:{body:'<path fill="currentColor" d="M3.34 17a10 10 0 0 1-.979-2.326a3 3 0 0 0 .003-5.347a10 10 0 0 1 2.5-4.337a3 3 0 0 0 4.632-2.674a10 10 0 0 1 5.007.003a3 3 0 0 0 4.632 2.671a10.06 10.06 0 0 1 2.503 4.336a3 3 0 0 0-.002 5.347a10 10 0 0 1-2.501 4.337a3 3 0 0 0-4.632 2.674a10 10 0 0 1-5.007-.002a3 3 0 0 0-4.631-2.672A10 10 0 0 1 3.339 17m5.66.196a5 5 0 0 1 2.25 2.77q.75.07 1.499.002a5 5 0 0 1 2.25-2.772a5 5 0 0 1 3.526-.564q.435-.614.748-1.298A5 5 0 0 1 18 12c0-1.26.47-2.437 1.273-3.334a8 8 0 0 0-.75-1.298A5 5 0 0 1 15 6.804a5 5 0 0 1-2.25-2.77q-.75-.071-1.5-.001A5 5 0 0 1 9 6.804a5 5 0 0 1-3.526.564q-.436.614-.747 1.298A5 5 0 0 1 6 12c0 1.26-.471 2.437-1.273 3.334a8 8 0 0 0 .75 1.298A5 5 0 0 1 9 17.196M12 15a3 3 0 1 1 0-6a3 3 0 0 1 0 6m0-2a1 1 0 1 0 0-2a1 1 0 0 0 0 2"/>',width:24,height:24},sliders:{body:'<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"/>',width:24,height:24},"log-in":{body:'<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"/>',width:24,height:24},"chevron-down":{body:'<path fill="currentColor" d="m12 13.171l4.95-4.95l1.414 1.415L12 16L5.636 9.636L7.05 8.222z"/>',width:24,height:24},"chevron-right":{body:'<path fill="currentColor" d="m13.172 12l-4.95-4.95l1.414-1.413L16 12l-6.364 6.364l-1.414-1.415z"/>',width:24,height:24},"arrow-up":{body:'<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"/>',width:24,height:24},"arrow-down":{body:'<path fill="currentColor" d="m13 16.172l5.364-5.364l1.414 1.414L12 20l-7.778-7.778l1.414-1.414L11 16.172V4h2z"/>',width:24,height:24},"arrow-right":{body:'<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"/>',width:24,height:24},minus:{body:'<path fill="currentColor" d="M5 11v2h14v-2z"/>',width:24,height:24},"panel-collapse":{body:'<path fill="currentColor" d="m15.071 4.929l1.414 1.414L11.83 11H21v2h-9.17l4.656 4.657l-1.414 1.414L8.001 12zm-11.07 14.07V5h2v14z"/>',width:24,height:24},"panel-expand":{body:'<path fill="currentColor" d="m17.172 11l-4.657-4.657l1.414-1.414L21 12l-7.071 7.071l-1.414-1.414L17.172 13H8v-2zM4 19V5h2v14z"/>',width:24,height:24},expand:{body:'<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"/>',width:24,height:24},collapse:{body:'<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"/>',width:24,height:24},list:{body:'<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"/>',width:24,height:24},sort:{body:'<path fill="currentColor" d="M20 4v12h3l-4 5l-4-5h3V4zm-8 14v2H3v-2zm2-7v2H3v-2zm0-7v2H3V4z"/>',width:24,height:24},grip:{body:'<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"/>',width:24,height:24},folder:{body:'<path fill="currentColor" d="M3 21a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414l2 2H20a1 1 0 0 1 1 1v3h-2V7h-7.414l-2-2H4v11.998L5.5 11h17l-2.31 9.243a1 1 0 0 1-.97.757zm16.938-8H7.062l-1.5 6h12.876z"/>',width:24,height:24},"folder-closed":{body:'<path fill="currentColor" d="M4 5v14h16V7h-8.414l-2-2zm8.414 0H21a1 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"/>',width:24,height:24},"folder-plus":{body:'<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"/>',width:24,height:24},"folder-solid":{body:'<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"/>',width:24,height:24},file:{body:'<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"/>',width:24,height:24},"file-text":{body:'<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"/>',width:24,height:24},"file-plus":{body:'<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"/>',width:24,height:24},"file-off":{body:'<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"/>',width:24,height:24},"image-off":{body:'<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"/>',width:24,height:24},code:{body:'<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"/>',width:24,height:24},terminal:{body:'<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"/>',width:24,height:24},pencil:{body:'<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"/>',width:24,height:24},glob:{body:'<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"/>',width:24,height:24},globe:{body:'<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"/>',width:24,height:24},"check-list":{body:'<path fill="currentColor" d="M8 4h13v2H8zm-5-.5h3v3H3zm0 7h3v3H3zm0 7h3v3H3zM8 11h13v2H8zm0 7h13v2H8z"/>',width:24,height:24},bolt:{body:'<path fill="currentColor" d="M13 9h8L11 24v-9H4l9-15zm-2 2V7.22L7.532 13H13v4.394L17.263 11z"/>',width:24,height:24},"git-pull-request":{body:'<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"/>',width:24,height:24},message:{body:'<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"/>',width:24,height:24},mail:{body:'<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"/>',width:24,height:24},user:{body:'<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"/>',width:24,height:24},info:{body:'<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"/>',width:24,height:24},"help-circle":{body:'<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"/>',width:24,height:24},"alert-triangle":{body:'<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"/>',width:24,height:24},clock:{body:'<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"/>',width:24,height:24},sparkles:{body:'<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"/>',width:24,height:24},play:{body:'<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"/>',width:24,height:24},stop:{body:'<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"/>',width:24,height:24},star:{body:'<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"/>',width:24,height:24},"star-outline":{body:'<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"/>',width:24,height:24},"dots-horizontal":{body:'<path fill="currentColor" d="M4.5 10.5c-.825 0-1.5.675-1.5 1.5s.675 1.5 1.5 1.5S6 12.825 6 12s-.675-1.5-1.5-1.5m15 0c-.825 0-1.5.675-1.5 1.5s.675 1.5 1.5 1.5S21 12.825 21 12s-.675-1.5-1.5-1.5m-7.5 0c-.825 0-1.5.675-1.5 1.5s.675 1.5 1.5 1.5s1.5-.675 1.5-1.5s-.675-1.5-1.5-1.5"/>',width:24,height:24}},CA={sm:14,md:16,lg:20};function Q5(e){return`0 0 ${e.width??24} ${e.height??24}`}const Z5=Object.fromEntries(Object.entries(SA).map(([e,t])=>[e,{body:t.body,viewBox:Q5(t),fill:!0}]));function J5(e){return Z5[e]}function Ia(e,t="md"){const n=CA[t],s=X5(SA[e],{width:n,height:n}),o=s.attributes.viewBox;return`<svg class="kw-icon" width="${n}" height="${n}" viewBox="${o}" fill="currentColor" aria-hidden="true" xmlns="http://www.w3.org/2000/svg">${s.body}</svg>`}const eL=["width","height","viewBox","aria-label","aria-hidden","innerHTML"],tL=["width","height","viewBox","aria-label","aria-hidden","innerHTML"],Je=je({__name:"Icon",props:{name:{},size:{default:"md"},label:{}},setup(e){const t=e,n=F(()=>J5(t.name)),s=F(()=>CA[t.size]),o=F(()=>n.value.viewBox??"0 0 16 16");return(i,r)=>n.value.fill?(w(),N("svg",{key:0,class:"kw-icon",width:s.value,height:s.value,viewBox:o.value,fill:"currentColor","aria-label":e.label,"aria-hidden":e.label?void 0:!0,xmlns:"http://www.w3.org/2000/svg",innerHTML:n.value.body},null,8,eL)):(w(),N("svg",{key:1,class:"kw-icon",width:s.value,height:s.value,viewBox:o.value,fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-label":e.label,"aria-hidden":e.label?void 0:!0,xmlns:"http://www.w3.org/2000/svg",innerHTML:n.value.body},null,8,tL))}}),nL={key:0,class:"ui-dialog__head"},sL={class:"ui-dialog__titles"},oL={key:0,class:"ui-dialog__title"},iL={key:1,class:"ui-dialog__desc"},rL={class:"ui-dialog__body"},lL={key:1,class:"ui-dialog__foot"},aL='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])',cL=je({__name:"Dialog",props:{open:{type:Boolean},title:{},description:{},closeOnOverlay:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0},size:{default:"md"},height:{default:"auto"},padded:{type:Boolean,default:!0}},emits:["update:open","close"],setup(e,{emit:t}){const n=e,s=t,o=Z(null);let i=null;function r(){s("update:open",!1),s("close")}function l(){return o.value?Array.from(o.value.querySelectorAll(aL)):[]}function a(u){if(!n.open)return;if(u.key==="Escape"&&n.closeOnEsc){u.preventDefault(),r();return}if(u.key!=="Tab")return;const d=l(),p=d[0],h=d[d.length-1];if(!p||!h){u.preventDefault(),o.value?.focus();return}const f=document.activeElement;u.shiftKey&&f===p?(u.preventDefault(),h.focus()):!u.shiftKey&&f===h&&(u.preventDefault(),p.focus())}function c(u){n.closeOnOverlay&&u.target===u.currentTarget&&r()}return Ke(()=>n.open,async u=>{u?(Ea.value+=1,i=document.activeElement,await ht(),(l()[0]??o.value)?.focus()):(Ea.value=Math.max(0,Ea.value-1),i instanceof HTMLElement&&(i.focus(),i=null))},{immediate:!0}),typeof window<"u"&&window.addEventListener("keydown",a),ls(()=>{typeof window<"u"&&window.removeEventListener("keydown",a),n.open&&(Ea.value=Math.max(0,Ea.value-1))}),(u,d)=>(w(),ve(lh,{to:"body"},[e.open?(w(),N("div",{key:0,class:"ui-dialog__overlay",onMousedown:c},[T("div",{ref_key:"panel",ref:o,class:Re(["ui-dialog",[`ui-dialog--${e.size}`,{"ui-dialog--flush":!e.padded,"ui-dialog--fixed-height":e.height==="fixed"}]]),role:"dialog","aria-modal":"true",tabindex:"-1"},[e.title||u.$slots.head?(w(),N("div",nL,[Cn(u.$slots,"head",{},()=>[T("div",sL,[e.title?(w(),N("div",oL,R(e.title),1)):ie("",!0),e.description?(w(),N("div",iL,R(e.description),1)):ie("",!0)])],!0),oe(gn,{class:"ui-dialog__close",size:"sm",label:"Close",onClick:r},{default:_e(()=>[oe(Je,{name:"close",size:"md"})]),_:1})])):ie("",!0),T("div",rL,[Cn(u.$slots,"default",{},void 0,!0)]),u.$slots.foot?(w(),N("div",lL,[Cn(u.$slots,"foot",{},void 0,!0)])):ie("",!0)],2)],32)):ie("",!0)]))}}),ar=ut(cL,[["__scopeId","data-v-ff901247"]]),uL={class:"sd-head"},dL=["placeholder","aria-label"],fL=["aria-selected","onClick","onMousemove"],pL={class:"sd-meta"},hL=["innerHTML"],mL={class:"sd-time"},gL=["innerHTML"],vL=["innerHTML"],yL={key:1,class:"sd-empty"},kL={class:"sd-hint"},bL=200,_L=je({__name:"SearchSessionsDialog",props:{sessions:{},activeId:{}},emits:["select","close"],setup(e,{emit:t}){const{t:n}=It(),s=e,o=t,i=Z(!0),r=Z(""),l=Z(null),a=Z(null),c=F(()=>{const _=r.value.trim().toLowerCase(),g=[];for(const v of s.sessions){const y=v.title??"",A=v.lastPrompt??"",O=v.workspaceName??"",$=_.length>0&&y.toLowerCase().includes(_),k=_.length>0&&A.toLowerCase().includes(_),E=_.length>0&&O.toLowerCase().includes(_);if(!(_.length>0&&!$&&!k&&!E)&&(g.push({session:v,inTitle:$,inWorkspace:E,snippetText:A?B5(A,r.value):""}),g.length>=bL))break}return g}),u=Z(0);Ke(r,()=>{u.value=0});function d(_){const g=c.value.length;return g===0?0:Math.max(0,Math.min(g-1,_))}async function p(){await ht(),a.value?.querySelector('[aria-selected="true"]')?.scrollIntoView({block:"nearest"})}function h(_){u.value=d(u.value+_),p()}function f(_){o("select",_),o("close")}function m(){const _=c.value[u.value];_&&f(_.session.id)}function b(_){_.key==="ArrowDown"?(_.preventDefault(),h(1)):_.key==="ArrowUp"?(_.preventDefault(),h(-1)):_.key==="Enter"&&(_.preventDefault(),m())}return hn(()=>{l.value?.focus()}),(_,g)=>(w(),ve(ar,{open:i.value,"onUpdate:open":g[1]||(g[1]=v=>i.value=v),size:"lg",height:"fixed",padded:!1,onClose:g[2]||(g[2]=v=>o("close"))},{head:_e(()=>[T("div",uL,[oe(Je,{class:"sd-search-icon",name:"search",size:"md"}),Mn(T("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":g[0]||(g[0]=v=>r.value=v),class:"sd-input",type:"text",placeholder:x(n)("sidebar.searchPlaceholder"),"aria-label":x(n)("sidebar.searchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:b},null,40,dL),[[ko,r.value]])])]),foot:_e(()=>[T("span",kL,R(x(n)("sidebar.searchHint")),1)]),default:_e(()=>[T("div",{ref_key:"listRef",ref:a,class:"sd-list",role:"listbox"},[c.value.length>0?(w(!0),N(Le,{key:0},nt(c.value,(v,y)=>(w(),N("button",{key:v.session.id,class:Re(["sd-row",{on:y===u.value,active:v.session.id===e.activeId}]),role:"option","aria-selected":y===u.value,onClick:A=>f(v.session.id),onMousemove:A=>u.value=y},[T("span",pL,[oe(Je,{class:"sd-folder",name:"folder-closed",size:"sm"}),T("span",{class:"sd-ws",innerHTML:x(og)(v.session.workspaceName??v.session.workspaceId??"",v.inWorkspace?r.value:"")},null,8,hL),T("span",mL,R(v.session.time),1)]),T("span",{class:"sd-title",innerHTML:x(og)(v.session.title,v.inTitle?r.value:"")},null,8,gL),v.snippetText?(w(),N("span",{key:0,class:"sd-snippet",innerHTML:x(og)(v.snippetText,r.value)},null,8,vL)):ie("",!0)],42,fL))),128)):(w(),N("div",yL,R(x(n)("sidebar.searchNoResults")),1))],512)]),_:1},8,["open"]))}}),wL=ut(_L,[["__scopeId","data-v-3d40bf5d"]]),SL=["aria-label"],CL=je({__name:"Spinner",props:{size:{default:"md"},label:{default:"Loading"}},setup(e){return(t,n)=>(w(),N("span",{class:Re(["ui-spinner",`ui-spinner--${e.size}`]),role:"status","aria-label":e.label},[...n[0]||(n[0]=[T("svg",{class:"ui-spinner__svg",viewBox:"0 0 24 24","aria-hidden":"true"},[T("circle",{class:"ui-spinner__track",cx:"12",cy:"12",r:"9"}),T("circle",{class:"ui-spinner__arc",cx:"12",cy:"12",r:"9"})],-1)])],10,SL))}}),ni=ut(CL,[["__scopeId","data-v-5ec07fd2"]]),xL={key:0,class:"ui-badge__dot","aria-hidden":"true"},AL=je({__name:"Badge",props:{variant:{default:"neutral"},size:{default:"md"},dot:{type:Boolean}},setup(e){return(t,n)=>(w(),N("span",{class:Re(["ui-badge",[`ui-badge--${e.variant}`,`ui-badge--${e.size}`]])},[e.dot?(w(),N("span",xL)):ie("",!0),Cn(t.$slots,"default",{},void 0,!0)],2))}}),Is=ut(AL,[["__scopeId","data-v-13972d72"]]),Du=Z(null);function xA(e){const t=Du.value;t&&(Du.value=null,t.resolve(e))}function TL(e){return Du.value&&xA(!1),new Promise(t=>{Du.value={...e,resolve:t}})}function ol(){return{current:Du,confirm:TL,settle:xA}}const ML=je({__name:"Menu",setup(e,{expose:t}){const n=Z();return t({el:n}),(s,o)=>(w(),N("div",{ref_key:"el",ref:n,class:"ui-menu",role:"menu"},[Cn(s.$slots,"default",{},void 0,!0)],512))}}),Wl=ut(ML,[["__scopeId","data-v-3197b239"]]),EL={key:0,class:"ui-menu-sep",role:"separator"},IL=["disabled"],$L=je({__name:"MenuItem",props:{active:{type:Boolean},danger:{type:Boolean},disabled:{type:Boolean},separator:{type:Boolean},size:{default:"md"}},emits:["click"],setup(e){return(t,n)=>e.separator?(w(),N("div",EL)):(w(),N("button",{key:1,class:Re(["ui-menu-item",[`ui-menu-item--${e.size}`,{"is-active":e.active,"is-danger":e.danger}]]),type:"button",role:"menuitem",disabled:e.disabled,onClick:n[0]||(n[0]=s=>t.$emit("click",s))},[Cn(t.$slots,"default",{},void 0,!0)],10,IL))}}),fn=ut($L,[["__scopeId","data-v-55ca4d76"]]),kr=6,br=8,NL=150,LL=je({__name:"Tooltip",props:{text:{},placement:{default:"top"},maxWidth:{default:280},maxLines:{default:6}},setup(e){const t=e,n=Z(),s=Z(),o=Z(!1),i=Z(!1),r=Z({maxWidth:`${t.maxWidth}px`});let l,a=null,c;function u(){const m=s.value;if(!a||!m)return;const b=a.getBoundingClientRect(),_=m.offsetWidth,g=m.offsetHeight,v=window.innerWidth,y=window.innerHeight;let A=t.placement;A==="top"&&b.top-kr-g<br?A="bottom":A==="bottom"&&b.bottom+kr+g>y-br?A="top":A==="left"&&b.left-kr-_<br?A="right":A==="right"&&b.right+kr+_>v-br&&(A="left");let O=0,$=0;A==="top"?(O=b.top-kr-g,$=b.left+b.width/2-_/2):A==="bottom"?(O=b.bottom+kr,$=b.left+b.width/2-_/2):A==="left"?(O=b.top+b.height/2-g/2,$=b.left-kr-_):(O=b.top+b.height/2-g/2,$=b.right+kr),$=Math.min(Math.max($,br),v-br-_),O=Math.min(Math.max(O,br),y-br-g),r.value={maxWidth:`${t.maxWidth}px`,top:`${Math.round(O)}px`,left:`${Math.round($)}px`}}function d(){t.text&&(window.clearTimeout(l),l=window.setTimeout(()=>{o.value=!0,i.value=!1,ht(()=>{u(),i.value=!0})},NL))}function p(){window.clearTimeout(l),o.value=!1,i.value=!1}function h(){o.value&&p()}function f(m){m!==a&&(a&&(a.removeEventListener("mouseenter",d),a.removeEventListener("mouseleave",p),a.removeEventListener("focusin",d),a.removeEventListener("focusout",p)),a=m,a&&(a.addEventListener("mouseenter",d),a.addEventListener("mouseleave",p),a.addEventListener("focusin",d),a.addEventListener("focusout",p)))}return hn(()=>{const m=n.value??null;f(m?.firstElementChild??m),m&&(c=new MutationObserver(()=>{const b=m.firstElementChild??null;b!==a&&(p(),f(b??m))}),c.observe(m,{childList:!0})),window.addEventListener("scroll",h,!0),window.addEventListener("resize",h)}),ls(()=>{window.clearTimeout(l),c?.disconnect(),f(null),window.removeEventListener("scroll",h,!0),window.removeEventListener("resize",h)}),(m,b)=>(w(),N(Le,null,[T("span",{ref_key:"trigger",ref:n,class:"ui-tip"},[Cn(m.$slots,"default",{},void 0,!0)],512),(w(),ve(lh,{to:"body"},[Mn(T("div",{ref_key:"bubble",ref:s,class:Re(["ui-tip__bubble",{positioned:i.value}]),style:Gt([r.value,{"--tip-lines":e.maxLines}]),role:"tooltip"},R(e.text),7),[[Qo,o.value]])]))],64))}}),Ht=ut(LL,[["__scopeId","data-v-f28510a8"]]),OL={class:"row"},PL={class:"lead","aria-hidden":"true"},RL={key:1,class:"unread-dot"},DL={class:"left"},BL=["onKeydown"],FL={class:"act"},HL={class:"ts"},WL={class:"menu-time"},zL=je({__name:"SessionRow",props:{session:{},active:{type:Boolean},approvalCount:{default:0},questionCount:{default:0},unread:{type:Boolean,default:!1}},emits:["select","rename","archive","fork"],setup(e,{expose:t,emit:n}){const{t:s}=It(),{confirm:o}=ol(),i=e,r=n;function l(S){const I=new Date(S);if(Number.isNaN(I.getTime()))return S;const P=D=>String(D).padStart(2,"0");return`${I.getFullYear()}-${P(I.getMonth()+1)}-${P(I.getDate())} ${P(I.getHours())}:${P(I.getMinutes())}`}const a=F(()=>i.session.updatedAt?l(i.session.updatedAt):i.session.time),c=Z(!1),u=Z(null),d=Z(null),p=Z({});function h(S){const I=S.target;d.value?.el?.contains(I)||u.value?.el?.contains(I)||b()}function f(){const S=u.value?.el;if(!S)return;const I=d.value?.el,P=S.getBoundingClientRect(),D=4,W=8,z=I?.offsetHeight??0,q=I?.offsetWidth??0;let Q=P.bottom+D;Q+z>window.innerHeight-W&&(Q=Math.max(W,P.top-z-D));let X=P.right-q;X<W&&(X=W),p.value={top:`${Math.round(Q)}px`,left:`${Math.round(X)}px`}}async function m(S){if(S.stopPropagation(),c.value){b();return}c.value=!0,setTimeout(()=>document.addEventListener("mousedown",h),0),window.addEventListener("resize",b),await ht(),f()}function b(){c.value=!1,document.removeEventListener("mousedown",h),window.removeEventListener("resize",b)}kn(()=>{document.removeEventListener("mousedown",h),window.removeEventListener("resize",b)});const _=Z(!1),g=Z(""),v=Z(null);async function y(){b(),_.value=!0,g.value=i.session.title,await ht();try{v.value?.focus(),v.value?.select()}catch{}}function A(){const S=g.value.trim();S&&r("rename",i.session.id,S),_.value=!1}function O(){_.value=!1}const $=Z(!1),k=Z(!1);async function E(){const S=await zs(i.session.id);$.value=S,k.value=!S,setTimeout(()=>{$.value=!1,k.value=!1,b()},1500)}function M(){b(),r("fork",i.session.id)}async function L(){b(),await o({title:s("sidebar.archive"),message:s("sidebar.archiveConfirm"),variant:"danger"})&&r("archive",i.session.id)}return t({closeMenu:b}),(S,I)=>(w(),N("div",{class:Re(["se",{on:e.active}]),onClick:I[4]||(I[4]=P=>r("select",e.session.id))},[T("div",OL,[T("span",PL,[e.session.busy?(w(),ve(ni,{key:0,size:"sm"})):e.unread?(w(),N("span",RL)):ie("",!0)]),T("div",DL,[_.value?Mn((w(),N("input",{key:0,ref_key:"renameInputRef",ref:v,"onUpdate:modelValue":I[0]||(I[0]=P=>g.value=P),class:"rename-input",onClick:I[1]||(I[1]=vt(()=>{},["stop"])),onKeydown:[di(vt(A,["stop"]),["enter"]),di(vt(O,["stop"]),["esc"])],onBlur:A},null,40,BL)),[[ko,g.value]]):(w(),N("span",{key:1,class:"t",onDblclick:vt(y,["stop"])},R(e.session.title),33))]),oe(Ht,{text:x(s)("workspace.awaitingAnswerTitle")},{default:_e(()=>[!_.value&&(e.questionCount>0||e.session.status==="awaitingQuestion")?(w(),ve(Is,{key:0,variant:"info",size:"sm"},{default:_e(()=>[qe(R(x(s)("workspace.awaitingAnswer")),1)]),_:1})):ie("",!0)]),_:1},8,["text"]),oe(Ht,{text:x(s)("workspace.awaitingPermissionTitle")},{default:_e(()=>[!_.value&&(e.approvalCount>0||e.session.status==="awaitingApproval")?(w(),ve(Is,{key:0,variant:"warning",size:"sm"},{default:_e(()=>[qe(R(x(s)("workspace.awaitingPermission")),1)]),_:1})):ie("",!0)]),_:1},8,["text"]),oe(Ht,{text:x(s)("workspace.abortedTitle")},{default:_e(()=>[!_.value&&e.session.status==="aborted"?(w(),ve(Is,{key:0,variant:"danger",size:"sm"},{default:_e(()=>[qe(R(x(s)("workspace.aborted")),1)]),_:1})):ie("",!0)]),_:1},8,["text"]),T("span",FL,[T("span",HL,R(e.session.time),1),_.value?ie("",!0):(w(),ve(gn,{key:0,ref_key:"kebabRef",ref:u,class:Re(["kebab",{open:c.value}]),size:"sm",label:x(s)("sidebar.options"),onClick:I[2]||(I[2]=vt(P=>m(P),["stop"]))},{default:_e(()=>[oe(Je,{name:"dots-horizontal",size:"sm"})]),_:1},8,["class","label"]))])]),(w(),ve(lh,{to:"body"},[c.value?(w(),ve(Wl,{key:0,ref_key:"menuRef",ref:d,class:"menu",style:Gt(p.value),onClick:I[3]||(I[3]=vt(()=>{},["stop"]))},{default:_e(()=>[oe(fn,{danger:k.value,onClick:E},{default:_e(()=>[qe(R(k.value?x(s)("sidebar.copyFailed"):$.value?x(s)("sidebar.copied"):x(s)("sidebar.copySessionId")),1)]),_:1},8,["danger"]),oe(fn,{separator:""}),oe(fn,{onClick:y},{default:_e(()=>[qe(R(x(s)("sidebar.rename")),1)]),_:1}),oe(fn,{onClick:M},{default:_e(()=>[qe(R(x(s)("sidebar.fork")),1)]),_:1}),oe(fn,{danger:"",onClick:L},{default:_e(()=>[qe(R(x(s)("sidebar.archive")),1)]),_:1}),oe(fn,{separator:""}),T("div",WL,R(a.value),1)]),_:1},8,["style"])):ie("",!0)]))],2))}}),UL=ut(zL,[["__scopeId","data-v-c08c0c63"]]),qL={class:"gh-top"},jL={key:2,class:"gh-name"},VL={class:"gh-path"},KL=["inert"],GL=["disabled"],YL={class:"show-more-label"},XL={class:"show-more-label"},QL={key:2,class:"group-empty"},ZL=je({__name:"WorkspaceGroup",props:{group:{},activeWorkspaceId:{},activeId:{},renamingId:{},renameValue:{},renameInputRef:{},pendingBySession:{},unreadBySession:{},wsMenuOpenId:{},dragging:{type:Boolean},showPath:{type:Boolean},isCollapsed:{type:Function},isExpanded:{type:Function}},emits:["groupClick","groupContextmenu","toggleWsMenu","createInWorkspace","selectSession","renameSession","archiveSession","forkSession","loadMore","toggleExpand","confirmRename","cancelRename","updateRenameValue","wsDragstart","wsDragend"],setup(e,{emit:t}){const{t:n}=It(),s=e,o=t,i=F({get:()=>s.renameValue,set:p=>o("updateRenameValue",p)}),r=F(()=>{if(s.isExpanded(s.group.workspace.id))return s.group.sessions;const p=s.group.sessions.slice(0,s.group.initialCount);if(s.activeId&&!p.some(h=>h.id===s.activeId)){const h=s.group.sessions.find(f=>f.id===s.activeId);if(h)return[...p,h]}return p}),l=F(()=>s.group.sessions.length>s.group.initialCount);function a(){return Math.max(0,s.group.workspace.sessionCount-s.group.sessions.length)}function c(){return s.group.sessions.length-s.group.initialCount}function u(p){s.renameInputRef.value=p instanceof HTMLInputElement?p:null}function d(p){p.dataTransfer&&(p.dataTransfer.effectAllowed="move",p.dataTransfer.setData("text/plain",s.group.workspace.id),o("wsDragstart",s.group.workspace.id))}return(p,h)=>(w(),N("div",{class:Re(["group",{dragging:e.dragging}])},[T("div",{class:Re(["gh",{on:e.group.workspace.id===e.activeWorkspaceId,collapsed:e.isCollapsed(e.group.workspace.id),"show-path":e.showPath}]),draggable:"true",onClick:h[7]||(h[7]=vt(f=>o("groupClick",e.group.workspace.id,f),["stop"])),onContextmenu:h[8]||(h[8]=f=>o("groupContextmenu",e.group.workspace,f)),onDragstart:d,onDragend:h[9]||(h[9]=f=>o("wsDragend"))},[T("div",qL,[e.isCollapsed(e.group.workspace.id)?(w(),ve(Je,{key:0,class:"gh-folder",name:"folder-closed",size:"sm"})):(w(),ve(Je,{key:1,class:"gh-folder",name:"folder",size:"sm"})),e.renamingId!==e.group.workspace.id?(w(),N("span",jL,R(e.group.workspace.name),1)):Mn((w(),N("input",{key:3,ref:u,"onUpdate:modelValue":h[0]||(h[0]=f=>i.value=f),class:"gh-rename",type:"text",onKeydown:[h[1]||(h[1]=di(f=>o("confirmRename"),["enter"])),h[2]||(h[2]=di(f=>o("cancelRename"),["esc"]))],onBlur:h[3]||(h[3]=f=>o("cancelRename")),onClick:h[4]||(h[4]=vt(()=>{},["stop"]))},null,544)),[[ko,i.value]]),oe(gn,{class:Re(["gh-more",{open:e.wsMenuOpenId===e.group.workspace.id}]),size:"sm",label:x(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":e.wsMenuOpenId===e.group.workspace.id,onClick:h[5]||(h[5]=vt(f=>o("toggleWsMenu",e.group.workspace,f),["stop"]))},{default:_e(()=>[oe(Je,{name:"dots-horizontal",size:"sm"})]),_:1},8,["class","label","aria-expanded"]),oe(gn,{class:"gh-add",size:"sm",label:x(n)("workspace.newInGroup"),onClick:h[6]||(h[6]=vt(f=>o("createInWorkspace",e.group.workspace.id),["stop"]))},{default:_e(()=>[oe(Je,{name:"chat-new"})]),_:1},8,["label"])]),oe(Ht,{text:e.group.workspace.root},{default:_e(()=>[T("div",VL,R(e.group.workspace.shortPath||e.group.workspace.root),1)]),_:1},8,["text"])],34),T("div",{class:Re(["group-sessions",{collapsed:e.isCollapsed(e.group.workspace.id)}]),inert:e.isCollapsed(e.group.workspace.id)},[(w(!0),N(Le,null,nt(r.value,f=>(w(),ve(UL,{key:f.id,session:f,active:f.id===e.activeId,"approval-count":e.pendingBySession[f.id]?.approvals??0,"question-count":e.pendingBySession[f.id]?.questions??0,unread:e.unreadBySession[f.id]??!1,onSelect:h[10]||(h[10]=m=>o("selectSession",m)),onRename:h[11]||(h[11]=(m,b)=>o("renameSession",m,b)),onArchive:h[12]||(h[12]=m=>o("archiveSession",m)),onFork:h[13]||(h[13]=m=>o("forkSession",m))},null,8,["session","active","approval-count","question-count","unread"]))),128)),e.group.hasMore||e.group.loadingMore?(w(),N("button",{key:0,class:"show-more",disabled:e.group.loadingMore,onClick:h[14]||(h[14]=vt(f=>o("loadMore",e.group.workspace.id),["stop"]))},[h[16]||(h[16]=T("span",{class:"show-more-lead","aria-hidden":"true"},null,-1)),T("span",YL,R(e.group.loadingMore?x(n)("sidebar.loadingMore"):x(n)("sidebar.showMore",{count:a()})),1)],8,GL)):ie("",!0),l.value?(w(),N("button",{key:1,class:"show-more",onClick:h[15]||(h[15]=vt(f=>o("toggleExpand",e.group.workspace.id),["stop"]))},[h[17]||(h[17]=T("span",{class:"show-more-lead","aria-hidden":"true"},null,-1)),T("span",XL,R(e.isExpanded(e.group.workspace.id)?x(n)("sidebar.showLess"):x(n)("sidebar.showAll",{count:c()})),1)])):ie("",!0),e.group.sessions.length===0?(w(),N("div",QL,R(x(n)("sidebar.noSessions")),1)):ie("",!0)],10,KL)],2))}}),JL=ut(ZL,[["__scopeId","data-v-cc26d012"]]),e8="blun_desktop",t8="platform",$_="king-desktop",N_="king-desktop-platform";function n8(){let e=!1,t=null;try{const n=new URLSearchParams(window.location.search);n.has(e8)?(sessionStorage.setItem($_,"1"),e=!0):e=e||sessionStorage.getItem($_)==="1";const s=n.get(t8);s?(sessionStorage.setItem(N_,s),t=s):t=sessionStorage.getItem(N_)}catch{}return{isDesktop:e,platform:t}}const Kv=n8(),s8=Kv.isDesktop,AA=Kv.isDesktop&&Kv.platform==="darwin",o8=["aria-label"],i8=je({__name:"InternalBuildBanner",setup(e){const{t}=It(),n=s8;return(s,o)=>x(n)?(w(),N("span",{key:0,class:"internal-build-tag",role:"note","aria-label":x(t)("app.internalBuildBanner")},[o[0]||(o[0]=T("svg",{viewBox:"0 0 16 16",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[T("path",{d:"M8 2 14 13H2L8 2Z"}),T("path",{d:"M8 6v3.5"}),T("path",{d:"M8 11.5h.01"})],-1)),T("span",null,R(x(t)("app.internalBuildBanner")),1)],8,o8)):ie("",!0)}}),r8=ut(i8,[["__scopeId","data-v-7ae42bde"]]),l8={class:"ch"},a8={class:"ch-brand"},c8={class:"ch-name"},u8={key:0,class:"ch-endpoint"},d8={class:"search-input"},f8={key:0,class:"empty"},p8={class:"side-section-label"},h8={class:"side-section-title"},m8={class:"side-section-actions"},g8=["onDragover","onDrop"],v8={class:"section-menu-check"},y8={class:"section-menu-check"},k8={class:"section-menu-check"},b8=1e3,_8=je({__name:"Sidebar",props:{activeWorkspace:{default:null},activeWorkspaceId:{default:null},sessions:{},groups:{},activeId:{},workspaceSortMode:{},attentionBySession:{default:()=>({})},pendingBySession:{default:()=>({})},unreadBySession:{default:()=>({})},colWidth:{default:220}},emits:["select","create","createInWorkspace","selectWorkspace","addWorkspace","rename","archive","fork","renameWorkspace","deleteWorkspace","reorderWorkspaces","setWorkspaceSortMode","loadMoreSessions","loadAllSessions","openSettings","collapse"],setup(e,{emit:t}){const{t:n}=It(),{confirm:s}=ol(),o=!1,i="",r=e,l=t,a=Z(!1);function c(){l("loadAllSessions"),a.value=!0}function u(Ge){(Ge.metaKey||Ge.ctrlKey)&&Ge.key.toLowerCase()==="k"&&(Ge.preventDefault(),c())}hn(()=>window.addEventListener("keydown",u)),ls(()=>window.removeEventListener("keydown",u));const d=Z(!1);function p(Ge){d.value=Ge.target.scrollTop>0}const h=Z(new Set(g5()));function f(Ge){return h.value.has(Ge)}function m(Ge){const Ye=new Set(h.value);Ye.has(Ge)?Ye.delete(Ge):Ye.add(Ge),h.value=Ye,sg(Ye)}function b(){const Ge=new Set(r.groups.map(Ye=>Ye.workspace.id));h.value=Ge,sg(Ge)}function _(){const Ge=new Set;h.value=Ge,sg(Ge)}const g=F(()=>r.groups.length>0&&r.groups.every(Ge=>h.value.has(Ge.workspace.id))),v=Z(new Set);function y(Ge){return v.value.has(Ge)}function A(Ge){const Ye=new Set(v.value);Ye.has(Ge)?Ye.delete(Ge):Ye.add(Ge),v.value=Ye}function O(Ge){if(!v.value.has(Ge)){const Ye=new Set(v.value);Ye.add(Ge),v.value=Ye}l("loadMoreSessions",Ge)}const $=Z(v5());function k(){$.value=!$.value,y5($.value)}const E=Z(null),M=Z(null);function L(Ge){E.value=Ge}function S(){E.value=null,M.value=null}function I(Ge){const Ye=Ge.currentTarget.getBoundingClientRect();return Ge.clientY<Ye.top+Ye.height/2?"before":"after"}function P(Ge,Ye){E.value===null||E.value===Ye||(Ge.preventDefault(),Ge.dataTransfer&&(Ge.dataTransfer.dropEffect="move"),M.value={id:Ye,position:I(Ge)})}function D(Ge){const Ye=E.value,Ct=M.value?.id===Ge?M.value.position:"before";if(M.value=null,E.value=null,!Ye||Ye===Ge)return;const $t=O5(r.groups.map(mn=>mn.workspace.id),Ye,Ge,Ct);l("reorderWorkspaces",$t)}function W(Ge,Ye){Ye.target.closest(".gh-more, .gh-add")||m(Ge)}function z(Ge){l("select",Ge)}const q=Z(null),Q=Z(""),X=Z(null);function fe(){return X}function ye(Ge,Ye){q.value=Ge,Q.value=Ye,ht().then(()=>X.value?.focus())}function Me(){const Ge=q.value,Ye=Q.value.trim();Ge&&Ye&&l("renameWorkspace",Ge,Ye),q.value=null}function we(){q.value=null}function ze(Ge){Q.value=Ge}const Ue=Z(!1),Fe=Z(null),rt=Z({}),le=Z(null);function U(Ge){le.value?.el&&!le.value.el.contains(Ge.target)&&ne()}function G(Ge,Ye){Ye.preventDefault(),Ye.stopPropagation(),Fe.value=Ge,rt.value={top:`${Ye.clientY}px`,left:`${Ye.clientX}px`},Ue.value=!0,document.addEventListener("mousedown",U,!0)}function ne(){Ue.value=!1,document.removeEventListener("mousedown",U,!0),Fe.value=null}function H(){Fe.value&&zs(Fe.value.root),ne()}function J(){Fe.value&&ye(Fe.value.id,Fe.value.name),ne()}async function ce(){const Ge=Fe.value;Ge&&(ne(),await s({title:n("sidebar.removeWorkspace"),message:n("workspace.removeWorkspaceConfirm",{name:Ge.name}),variant:"danger"})&&l("deleteWorkspace",Ge.id))}const te=Z(null),ue=Z(null),j=Z({}),Y=Z(null);function re(Ge){const Ye=Ge.target;Ye.closest(".gh-more")||Ye.closest(".ws-menu")||Ae()}async function ge(Ge,Ye){if(te.value===Ge.id){Ae();return}const Ct=Ye.currentTarget;ue.value=Ge,te.value=Ge.id,document.addEventListener("mousedown",re),window.addEventListener("resize",Ae),await ht();const $t=Y.value?.el,mn=Ct.getBoundingClientRect(),Nn=4,tn=8,Ln=$t?.offsetHeight??0,Zn=$t?.offsetWidth??0;let Mt=mn.bottom+Nn;Mt+Ln>window.innerHeight-tn&&(Mt=Math.max(tn,mn.top-Ln-Nn));let us=mn.right-Zn;us<tn&&(us=tn),j.value={top:`${Math.round(Mt)}px`,left:`${Math.round(us)}px`}}function Ae(){te.value=null,ue.value=null,document.removeEventListener("mousedown",re),window.removeEventListener("resize",Ae)}function Ie(Ge){zs(Ge.root),Ae()}function ae(Ge){ye(Ge.id,Ge.name),Ae()}async function Te(Ge){Ae(),await s({title:n("sidebar.removeWorkspace"),message:n("workspace.removeWorkspaceConfirm",{name:Ge.name}),variant:"danger"})&&l("deleteWorkspace",Ge.id)}const Ve=Z(!1),tt=Z({}),bt=Z(null);function kt(Ge){const Ye=Ge.target;Ye.closest(".side-section-kebab")||Ye.closest(".section-menu")||Pt()}async function Tt(Ge){if(Ve.value){Pt();return}const Ye=Ge.currentTarget;Ve.value=!0,document.addEventListener("mousedown",kt),window.addEventListener("resize",Pt),await ht();const Ct=bt.value?.el,$t=Ye.getBoundingClientRect(),mn=4,Nn=8,tn=Ct?.offsetHeight??0,Ln=Ct?.offsetWidth??0;let Zn=$t.bottom+mn;Zn+tn>window.innerHeight-Nn&&(Zn=Math.max(Nn,$t.top-tn-mn));let Mt=$t.right-Ln;Mt<Nn&&(Mt=Nn),tt.value={top:`${Math.round(Zn)}px`,left:`${Math.round(Mt)}px`}}function Pt(){Ve.value=!1,document.removeEventListener("mousedown",kt),window.removeEventListener("resize",Pt)}function mt(Ge){l("setWorkspaceSortMode",Ge),Pt()}function Yt(){k(),Pt()}ls(()=>{document.removeEventListener("mousedown",U,!0),document.removeEventListener("mousedown",re),document.removeEventListener("mousedown",kt),window.removeEventListener("resize",Ae),window.removeEventListener("resize",Pt)});const Rn=Z(null);let Dn;function Ft(){const Ge=Rn.value;Ge&&(Ge.classList.remove("blink-now"),Ge.getBoundingClientRect(),Ge.classList.add("blink-now"),clearTimeout(Dn),Dn=setTimeout(()=>Ge.classList.remove("blink-now"),300))}const bn=ui(()=>Xs(()=>import("./DesignSystemView-BmDDe28A.js"),__vite__mapDeps([0,1]))),Vn=Z(!1);let st,In=!1;function _n(Ge){In=!1,clearTimeout(st),Ge.currentTarget.setPointerCapture?.(Ge.pointerId),st=setTimeout(()=>{In=!0,Vn.value=!0},b8)}function Kn(Ge){clearTimeout(st);const Ye=Ge.currentTarget;Ye.hasPointerCapture?.(Ge.pointerId)&&Ye.releasePointerCapture(Ge.pointerId)}function $n(){if(In){In=!1;return}Ft()}return ls(()=>{clearTimeout(st)}),(Ge,Ye)=>(w(),N(Le,null,[T("aside",{class:Re(["side",{"macos-desktop":x(AA)}])},[T("div",{class:"col",style:Gt({width:e.colWidth+"px"})},[T("div",l8,[T("div",a8,[(w(),N("svg",{ref_key:"logoRef",ref:Rn,class:Re(["ch-logo",{"is-dev":x(o)}]),viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"BLUN King",onClick:$n,onPointerdown:_n,onPointerup:Kn,onPointercancel:Kn},[...Ye[21]||(Ye[21]=[c0('<defs data-v-f80f56a6><mask id="blunEyes" maskUnits="userSpaceOnUse" data-v-f80f56a6><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-f80f56a6></rect><g class="ch-eyes" fill="#000" data-v-f80f56a6><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-f80f56a6></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-f80f56a6></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#blunEyes)" data-v-f80f56a6></rect>',2)])],34)),T("span",c8,[Ye[22]||(Ye[22]=qe("BLUN King",-1)),x(o)?(w(),N("span",u8," · "+R(x(i)),1)):ie("",!0)]),oe(r8)]),oe(gn,{size:"sm",label:x(n)("sidebar.collapseSidebar"),onClick:Ye[0]||(Ye[0]=vt(Ct=>l("collapse"),["stop"]))},{default:_e(()=>[oe(Je,{name:"panel-collapse"})]),_:1},8,["label"]),oe(gn,{size:"sm",label:x(n)("settings.title"),onClick:Ye[1]||(Ye[1]=vt(Ct=>l("openSettings"),["stop"]))},{default:_e(()=>[oe(Je,{name:"settings"})]),_:1},8,["label"])]),T("button",{class:"search",type:"button",onClick:c},[oe(Je,{class:"search-icon",name:"search"}),T("span",d8,R(x(n)("sidebar.searchShortcut")),1)]),T("div",{class:Re(["btn-wrap",{"btn-wrap--scrolled":d.value}])},[T("button",{class:"btn-new-chat",type:"button",onClick:Ye[2]||(Ye[2]=vt(Ct=>l("create"),["stop"]))},[oe(Je,{name:"chat-new"}),T("span",null,R(x(n)("sidebar.newChat")),1)]),ie("",!0)],2),T("div",{class:"sessions",onScroll:p},[e.groups.length===0?(w(),N("div",f8,R(x(n)("workspace.noWorkspace")),1)):(w(),N(Le,{key:1},[T("div",p8,[T("span",h8,R(x(n)("sidebar.workspaces")),1),T("div",m8,[oe(gn,{class:"side-section-toggle",size:"sm",label:g.value?x(n)("sidebar.expandAll"):x(n)("sidebar.collapseAll"),onClick:Ye[4]||(Ye[4]=vt(Ct=>g.value?_():b(),["stop"]))},{default:_e(()=>[g.value?(w(),ve(Je,{key:0,name:"expand"})):(w(),ve(Je,{key:1,name:"collapse"}))]),_:1},8,["label"]),oe(gn,{class:"side-section-toggle side-section-kebab",size:"sm",label:x(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":Ve.value,onClick:Ye[5]||(Ye[5]=vt(Ct=>Tt(Ct),["stop"]))},{default:_e(()=>[oe(Je,{name:"dots-horizontal"})]),_:1},8,["label","aria-expanded"])])]),(w(!0),N(Le,null,nt(e.groups,Ct=>(w(),N("div",{key:Ct.workspace.id,class:Re(["ws-drop-target",{"drop-before":M.value?.id===Ct.workspace.id&&M.value.position==="before","drop-after":M.value?.id===Ct.workspace.id&&M.value.position==="after"}]),onDragover:$t=>P($t,Ct.workspace.id),onDrop:$t=>D(Ct.workspace.id)},[oe(JL,{group:Ct,"active-workspace-id":e.activeWorkspaceId,"active-id":e.activeId,"renaming-id":q.value,"rename-value":Q.value,"rename-input-ref":fe(),"pending-by-session":e.pendingBySession,"unread-by-session":e.unreadBySession,"ws-menu-open-id":te.value,dragging:E.value===Ct.workspace.id,"is-collapsed":f,"is-expanded":y,"show-path":$.value,onGroupClick:W,onGroupContextmenu:G,onToggleWsMenu:ge,onCreateInWorkspace:Ye[6]||(Ye[6]=$t=>l("createInWorkspace",$t)),onSelectSession:z,onRenameSession:Ye[7]||(Ye[7]=($t,mn)=>l("rename",$t,mn)),onArchiveSession:Ye[8]||(Ye[8]=$t=>l("archive",$t)),onForkSession:Ye[9]||(Ye[9]=$t=>l("fork",$t)),onLoadMore:O,onToggleExpand:A,onConfirmRename:Me,onCancelRename:we,onUpdateRenameValue:ze,onWsDragstart:L,onWsDragend:S},null,8,["group","active-workspace-id","active-id","renaming-id","rename-value","rename-input-ref","pending-by-session","unread-by-session","ws-menu-open-id","dragging","show-path"])],42,g8))),128))],64))],32)],4),Ue.value?(w(),ve(Wl,{key:0,ref_key:"ghMenuRef",ref:le,class:"gh-menu",style:Gt(rt.value),onClick:Ye[10]||(Ye[10]=vt(()=>{},["stop"]))},{default:_e(()=>[oe(fn,{onClick:H},{default:_e(()=>[qe(R(x(n)("sidebar.copyPath")),1)]),_:1}),oe(fn,{onClick:J},{default:_e(()=>[qe(R(x(n)("sidebar.rename")),1)]),_:1}),oe(fn,{danger:"",onClick:ce},{default:_e(()=>[qe(R(x(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):ie("",!0),te.value!==null&&ue.value?(w(),ve(Wl,{key:1,ref_key:"wsMenuRef",ref:Y,class:"ws-menu",style:Gt(j.value),onClick:Ye[14]||(Ye[14]=vt(()=>{},["stop"]))},{default:_e(()=>[oe(fn,{onClick:Ye[11]||(Ye[11]=Ct=>Ie(ue.value))},{default:_e(()=>[qe(R(x(n)("sidebar.copyPath")),1)]),_:1}),oe(fn,{separator:""}),oe(fn,{onClick:Ye[12]||(Ye[12]=Ct=>ae(ue.value))},{default:_e(()=>[qe(R(x(n)("sidebar.rename")),1)]),_:1}),oe(fn,{separator:""}),oe(fn,{danger:"",onClick:Ye[13]||(Ye[13]=Ct=>Te(ue.value))},{default:_e(()=>[qe(R(x(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):ie("",!0),Ve.value?(w(),ve(Wl,{key:2,ref_key:"sectionMenuRef",ref:bt,class:"section-menu",style:Gt(tt.value),onClick:Ye[18]||(Ye[18]=vt(()=>{},["stop"]))},{default:_e(()=>[oe(fn,{onClick:Ye[15]||(Ye[15]=Ct=>mt("manual"))},{default:_e(()=>[T("span",v8,[e.workspaceSortMode==="manual"?(w(),ve(Je,{key:0,name:"check",size:"sm"})):ie("",!0)]),qe(" "+R(x(n)("sidebar.sortManual")),1)]),_:1}),oe(fn,{onClick:Ye[16]||(Ye[16]=Ct=>mt("recent"))},{default:_e(()=>[T("span",y8,[e.workspaceSortMode==="recent"?(w(),ve(Je,{key:0,name:"check",size:"sm"})):ie("",!0)]),qe(" "+R(x(n)("sidebar.sortRecent")),1)]),_:1}),oe(fn,{separator:""}),oe(fn,{onClick:Ye[17]||(Ye[17]=Ct=>Yt())},{default:_e(()=>[T("span",k8,[$.value?(w(),ve(Je,{key:0,name:"check",size:"sm"})):ie("",!0)]),qe(" "+R(x(n)("sidebar.showWorkspacePaths")),1)]),_:1})]),_:1},8,["style"])):ie("",!0),a.value?(w(),ve(wL,{key:3,sessions:e.sessions,"active-id":e.activeId,onSelect:z,onClose:Ye[19]||(Ye[19]=Ct=>a.value=!1)},null,8,["sessions","active-id"])):ie("",!0)],2),(w(),ve(lh,{to:"body"},[Vn.value?(w(),ve(x(bn),{key:0,onClose:Ye[20]||(Ye[20]=Ct=>Vn.value=!1)})):ie("",!0)]))],64))}}),w8=ut(_8,[["__scopeId","data-v-f80f56a6"]]);function S8(e){try{const t=Qn(e);if(t===null)return null;const n=Number(t);return Number.isFinite(n)?n:null}catch{return null}}function C8(e,t){try{ts(e,String(t))}catch{}}function x8(e){const{storageKey:t,defaultWidth:n,min:s,max:o,reverse:i=!1}=e;function r(_){return Number.isFinite(_)?Math.min(RC(o),Math.max(s,Math.round(_))):n}const l=Z(r(S8(t)??n)),a=Z(!1);function c(_){const g=r(_);l.value=g,C8(t,g)}let u=0,d=0,p=null,h=-1;function f(_){if(!a.value)return;const g=_.clientX-u;c(d+(i?-g:g))}function m(){if(a.value){if(a.value=!1,typeof document<"u"&&(document.body.style.userSelect="",document.body.style.cursor=""),p){try{p.releasePointerCapture(h)}catch{}p.removeEventListener("pointermove",f),p.removeEventListener("pointerup",m),p.removeEventListener("pointercancel",m)}p=null,h=-1}}function b(_){_.preventDefault(),a.value=!0,u=_.clientX,d=r(l.value),p=_.currentTarget,h=_.pointerId,typeof document<"u"&&(document.body.style.userSelect="none",document.body.style.cursor="col-resize");try{p.setPointerCapture(h)}catch{}p.addEventListener("pointermove",f),p.addEventListener("pointerup",m),p.addEventListener("pointercancel",m)}return ls(m),{width:l,dragging:a,clamp:r,setWidth:c,onPointerDown:b}}const A8=["aria-label"],T8=je({__name:"ResizeHandle",props:{storageKey:{},defaultWidth:{},min:{},max:{},reverse:{type:Boolean},ariaLabel:{}},emits:["update:width","update:dragging"],setup(e,{emit:t}){const n=e,s=t,{t:o}=It(),{width:i,dragging:r,onPointerDown:l}=x8({storageKey:n.storageKey,defaultWidth:n.defaultWidth,min:n.min,max:()=>n.max,reverse:n.reverse});return s("update:width",i.value),Ke(i,a=>s("update:width",a)),Ke(r,a=>s("update:dragging",a)),(a,c)=>(w(),N("div",{class:Re(["rh",{dragging:x(r)}]),role:"separator","aria-orientation":"vertical","aria-label":e.ariaLabel??x(o)("layout.resizeHandleAria"),onPointerdown:c[0]||(c[0]=(...u)=>x(l)&&x(l)(...u))},[...c[1]||(c[1]=[T("span",{class:"rh-bar","aria-hidden":"true"},null,-1)])],42,A8))}}),L_=ut(T8,[["__scopeId","data-v-7cdd3468"]]),M8={preview:"Preview",confirm:"Confirm",cancel:"Cancel"},E8={authBannerMessage:"Not signed in · Sign in to BLUN King to start a conversation",authBannerLogin:"Sign in",authPageTitle:"Sign in to BLUN King",authPageMessage:"Connect your BLUN King account before starting or continuing conversations.",authPageLogin:"Sign in",connecting:"Connecting…",internalBuildBanner:"Internal testing only"},I8={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",workspaces:"Workspaces",sortWorkspaces:"Sort workspaces",sortManual:"Manual",sortRecent:"Last edited",collapseAll:"Collapse all workspaces",expandAll:"Expand all workspaces",showWorkspacePaths:"Show workspace paths",newSession:"New Session",newChat:"New Chat",newWorkspace:"New Workspace",emptyState:"No sessions yet · click New Session to start",archiveConfirm:"Archive session?",options:"Options",rename:"Rename",copyPath:"Copy path",copySessionId:"Copy session ID",copied:"Copied ✓",copyFailed:"Copy failed",archive:"Archive",fork:"Fork session",delete:"Delete",removeWorkspace:"Remove workspace",brand:"BLUN King",signedIn:"Signed in",signOut:"Sign out",notSignedIn:"Not signed in",signIn:"Sign in",language:"Language",daemon:"Daemon",noSessions:"No conversations yet",showMore:"Load more ({count})",showLess:"Show less",showAll:"Show all ({count})",loadingMore:"Loading…",collapseSidebar:"Collapse sidebar",expandSidebar:"Expand sidebar",searchPlaceholder:"Search sessions",searchShortcut:"Search sessions (⌘K)",searchHint:"↑↓ navigate · ↵ open · Esc close",searchNoResults:"No matching sessions"},$8={switcherTitle:"Switch workspace",switchTooltip:"Switch workspace",eyebrow:"Workspace",branchLabel:"branch: {branch}",noBranch:"no branch",sessionCount:"{count} session | {count} sessions",allWorkspaces:"All workspaces",currentWorkspace:"Current workspace only",addWorkspace:"Add workspace…",noWorkspace:"No workspace",deleteHasSessions:"This workspace still has sessions — archive them before deleting it",removeWorkspaceConfirm:'Remove workspace "{name}"?',swarmEnableConfirm:"Enable swarm mode? The agent will run multiple sub-agents in parallel.",goalStartConfirm:'Start goal: "{objective}"? The agent will run autonomously toward it.',scopeCurrent:"this workspace",scopeAll:"all workspaces",newInGroup:"New session in this workspace",addTitle:"Add workspace",pathLabel:"Path",pathPlaceholder:"/absolute/path/to/project",recentLabel:"Recent folders",add:"Add",cancel:"Cancel",addHint:"Paste an absolute folder path, or pick a recent one.",addFailed:"Couldn't open this folder. Check the path and try again.",openThisFolder:"Open this folder",up:"Up",browsing:"Browsing…",filterPlaceholder:"Filter subfolders…",searchPlaceholder:"Fuzzy-search under this folder…",searching:"Searching…",pasteToggle:"Enter an absolute path",noFilterMatch:"No subfolders match “{q}”",noSubfolders:"No subfolders here",gitTag:"git",browseHint:'Click a folder to enter it, then "Open this folder" to add it as a workspace.',attentionTitle:"{count} item needs your attention | {count} items need your attention",awaitingAnswer:"Answer",awaitingAnswerTitle:"A question is waiting for your answer",awaitingPermission:"Approve",awaitingPermissionTitle:"An action is waiting for your approval",aborted:"Stopped",abortedTitle:"This session was interrupted before finishing"},N8={jumpToLatestAria:"Jump to latest message",toc:"Conversation outline",newMessages:"Latest messages",loading:"Loading…",emptyWorkspaceHint:"Send in {name}",switchWorkspace:"Switch workspace",addWorkspace:"New workspace",moreWorkspaces:"More workspaces ({count})",compacting:"Compacting context…",compactedPlain:"Context compacted",compactedAuto:"Context auto-compacted",compactedTokens:" ({before} → {after} tokens)",viewSummary:"View summary",summaryTitle:"Compaction summary",manuallyAborted:"Manually stopped",activatedSkill:"Activated skill: {name}",undo:"Undo",undoTooltip:"Undoing the conversation will not roll back code changes",undoConfirm:"Undo last message?",yesterday:"Yesterday",loadOlder:"Load earlier messages",loadingOlder:"Loading earlier messages…"},L8={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",planOn:"on",planOff:"off",planTooltip:"Toggle plan mode (research before editing)",modesLabel:"Mode",goalLabel:"Goal",swarmLabel:"Swarm",modeOff:"Off",goalPlaceholder:"What should the agent achieve?",goalStart:"Start",goalPause:"Pause",goalResume:"Resume",goalCancel:"Cancel",modeNotSupported:"Not supported",thinkingLabel:"thinking",thinkingTooltip:"Toggle thinking mode",starredModels:"Starred",moreModels:"More models…",statusPanelTitle:"Session status",statusPanelClose:"Close",statusModel:"Model",statusThinking:"Thinking",statusPermission:"Permission",statusPlanMode:"Plan mode",statusSwarmMode:"Swarm mode",swarmOn:"on",swarmOff:"off",statusContext:"Context",statusCost:"Cost",statusContextValue:"{used} / {max} ({pct}%)",statusNone:"—",activityRunning:"Running…",activityAwaitingApproval:"Awaiting approval",activityAwaitingQuestion:"Awaiting answer",interrupt:"Interrupt",runningShort:"in progress"},O8={placeholder:"Type a message…",send:"Send ↵",queueLabel:"Queue",placeholderRunning:"Press Enter to queue · Ctrl+S to inject into the running turn",queueAutoDrain:"sends automatically when the current turn ends",queueNext:"Up next",queueDragTitle:"Drag to reorder",editQueued:"Edit (load back into the input)",queuedImageOnly:"image ×{n}",queuedHasImage:"Contains {n} image(s) — remove only, not editable",remove:"Remove",removeNamed:"Remove {name}",uploading:"Uploading",uploadFailed:"Upload failed",attachImage:"Attach image",previewAttachment:"Preview {name}",interrupt:"Interrupt",interruptTitle:"Interrupt current operation",expandTitle:"Expand input for multi-line editing",collapseTitle:"Collapse input",emptyConversationTitle:"BLUN King",emptyConversation:"No messages yet — type below to start the conversation",quickStartPlaceholder:"Type a message to start a new conversation…",thinkingSuffix:" · thinking",thinkingSuffixEffort:" · thinking: {level}"},P8={title:"Sign in to BLUN King",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 blun and try again"},R8={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}",loginBlun:"Sign in to Blun",enterApiKey:"Enter API Key",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"},D8={dialogLabel:"Switch model",title:"Switch model",close:"Close (Esc)",allTab:"All",providerTabs:"Model providers",searchPlaceholder:"Search models or providers…",loading:"Loading models…",unavailable:"The daemon does not support model listing yet",contextSuffix:"{size}k ctx",emptyNoModels:"The daemon offers no selectable models",emptyNoMatch:"No matching models",starTitle:"Add to favorites",unstarTitle:"Remove from favorites",footerHint:"↑↓ Navigate · Enter Select · Esc Close"},B8={justNow:"just now"},F8={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"},H8={title:"Question",step:"Q{current}/{total}",back:"‹ Back",nextQuestion:"Next question ›",otherDefault:"Other…",submit:"Submit",dismiss:"Dismiss",minimize:"Minimize",expand:"Expand"},W8={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"},z8={panelTitle:"Thinking",close:"Close"},U8={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"},q8={},j8={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"}},V8={searching:"Searching…",noMatch:"No matches"},K8={dismiss:"Close",errorLabel:"Error",noteLabel:"Note",details:{cause:"Cause",code:"Error code",connection:"Connection",contentType:"Content type",details:"Server details",duration:"Duration",endpoint:"Endpoint",errorName:"Error type",message:"Message",operation:"Operation",phase:"Failure phase",request:"Request",requestId:"Request ID",responsePreview:"Response preview",sessionId:"Session ID",stack:"Stack",status:"HTTP status",timeout:"Timeout",timestamp:"Time"},daemonApiTitle:"Blun daemon returned an error",daemonNetworkMessage:"Web did not receive a response from the local service. Check that Blun daemon is still running, or refresh the page.",daemonNetworkTitle:"Cannot connect to Blun 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 Blun 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."}},G8={help:{desc:"Show the list of available commands"},new:{desc:"Create a new session"},clear:{desc:"Clear and start a new session"},model:{desc:"Switch model"},provider:{desc:"Manage providers (add / remove / refresh)"},login:{desc:"Sign in to Blun in the browser"},permission:{desc:"Switch approval mode (manual / auto / yolo)"},plan:{desc:"Toggle plan mode on/off"},swarm:{desc:"Toggle swarm mode; /swarm <task> runs a task in swarm"},goal:{desc:"Create/control a goal: /goal <objective>, /goal pause|resume|cancel"},btw:{desc:"Side chat: /btw <question> asks a forked side session"},yolo:{desc:"Auto-approve everything (yolo mode)"},auto:{desc:"Auto-approve safe edits/reads"},thinking:{desc:"Set the thinking level"},compact:{desc:"Compact the conversation history"},fork:{desc:"Fork this session into a new one"},undoNotImplemented:"/undo isn't supported by the daemon yet",status:{desc:"View session status"},undo:{desc:"Undo the last message"}},Y8={label:{read:"Read",bash:"Run",edit:"Edit",write:"Write",grep:"Search",glob:"Find",ls:"List",web_fetch:"Fetch",search:"Search",todo:"Todo",task:"Task"},chip:{lines:"{count} lines",results:"{count} results",edited:"edited",created:"created",todos:"{count} items"},group:{title:"{count} tool call | {count} tool calls",running:"running",error:"failed",done:"done"}},X8={resizeHandleAria:"Resize sidebar width",resizePreviewAria:"Resize preview panel width",detailPanelAria:"Detail panel"},Q8={openSwitcher:"Switch session / workspace",openSettings:"Session settings",settingsTitle:"Session settings",groupSession:"Current session",groupApp:"App preferences",sheetLabel:"Sheet",closeSheet:"Close",tapToCycle:"tap to cycle",running:"running",idle:"idle",sessionCount:"{n} sessions",newSession:"New session",permManualSub:"confirm every tool",permAutoSub:"auto-approve edits",permYoloSub:"auto-approve all",planModeSub:"Plan mode",swarmModeSub:"Swarm mode"},Z8={colorSchemeLabel:"Light/Dark",light:"Moon Bright",dark:"Moon Dark",system:"System",accentLabel:"Accent",accentBlue:"Blue",accentBlack:"Black"},J8={preview:"预览",confirm:"确认",cancel:"取消"},eO={authBannerMessage:"未登录 · 需要登录 BLUN King 才能开始对话",authBannerLogin:"登录",authPageTitle:"登录 BLUN King",authPageMessage:"先连接 BLUN King 账号,然后再开始或继续对话。",authPageLogin:"登录",connecting:"连接中…",internalBuildBanner:"仅供内部测试"},tO={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",workspaces:"工作区",sortWorkspaces:"工作区排序",sortManual:"手动排序",sortRecent:"按最后编辑时间",collapseAll:"折叠全部工作区",expandAll:"展开全部工作区",showWorkspacePaths:"显示工作区路径",newSession:"新建会话",newChat:"新建对话",newWorkspace:"新建工作区",emptyState:"还没有会话 · 点击 新建会话 开始",archiveConfirm:"归档会话?",options:"选项",rename:"重命名",copyPath:"复制路径",copySessionId:"复制 Session ID",copied:"已复制 ✓",copyFailed:"复制失败",archive:"归档",fork:"分叉会话",delete:"删除",removeWorkspace:"移除工作区",brand:"BLUN King",signedIn:"已登录",signOut:"退出登录",notSignedIn:"未登录",signIn:"登录",language:"语言",daemon:"后台",noSessions:"暂无对话",showMore:"加载更多 ({count})",showLess:"收起",showAll:"展开 ({count})",loadingMore:"加载中…",collapseSidebar:"收起侧边栏",expandSidebar:"展开侧边栏",searchPlaceholder:"搜索会话",searchShortcut:"搜索会话 (⌘K)",searchHint:"↑↓ 选择 · ↵ 打开 · Esc 关闭",searchNoResults:"没有匹配的会话"},nO={switcherTitle:"切换工作区",switchTooltip:"切换工作区",eyebrow:"工作区",branchLabel:"分支: {branch}",noBranch:"无分支",sessionCount:"{count} 个会话",allWorkspaces:"全部工作区",currentWorkspace:"仅当前工作区",addWorkspace:"添加工作区…",noWorkspace:"暂无工作区",deleteHasSessions:"工作区内还有会话,请先归档这些会话再删除",removeWorkspaceConfirm:"移除工作区「{name}」?",swarmEnableConfirm:"启用 swarm 模式?Agent 将并行运行多个子 agent。",goalStartConfirm:"启动 goal:「{objective}」?Agent 将自主执行。",scopeCurrent:"当前工作区",scopeAll:"全部工作区",newInGroup:"在此工作区新建会话",addTitle:"添加工作区",pathLabel:"路径",pathPlaceholder:"/项目的绝对路径",recentLabel:"最近的文件夹",add:"添加",cancel:"取消",addHint:"粘贴一个绝对路径,或从最近用过的文件夹中选择。",addFailed:"无法打开此文件夹,请检查路径后重试。",openThisFolder:"打开此文件夹",up:"上一级",browsing:"加载中…",filterPlaceholder:"过滤子文件夹…",searchPlaceholder:"在此目录下模糊搜索…",searching:"搜索中…",pasteToggle:"直接输入绝对路径",noFilterMatch:"没有匹配「{q}」的子文件夹",noSubfolders:"此处没有子文件夹",gitTag:"git",browseHint:'点击文件夹进入,再点"打开此文件夹"将其添加为工作区。',attentionTitle:"{count} 项待处理",awaitingAnswer:"待回答",awaitingAnswerTitle:"有提问等待你回答",awaitingPermission:"待授权",awaitingPermissionTitle:"有操作等待你授权",aborted:"已中断",abortedTitle:"此会话在完成前被中断"},sO={jumpToLatestAria:"跳到最新消息",toc:"对话目录",newMessages:"最新消息",loading:"加载中…",emptyWorkspaceHint:"在 {name} 中发送",switchWorkspace:"切换工作区",addWorkspace:"添加工作区",moreWorkspaces:"更多工作区 ({count})",compacting:"正在压缩上下文…",compactedPlain:"上下文已压缩",compactedAuto:"已自动压缩上下文",compactedTokens:"({before} → {after} tokens)",viewSummary:"查看摘要",summaryTitle:"压缩摘要",manuallyAborted:"您已手动终止",activatedSkill:"已激活技能: {name}",undo:"撤销",undoTooltip:"撤销对话不会回滚代码",undoConfirm:"撤销上一条消息?",yesterday:"昨天",loadOlder:"加载更早的消息",loadingOlder:"正在加载更早的消息…"},oO={connectionConnected:"已连接",connectionConnecting:"连接中…",connectionDisconnected:"未连接",ctxTooltip:"使用 {used} / {max} tokens ({pct}%)",modelLabel:"模型",permissionManual:"逐条确认",permissionAuto:"完全自主",permissionYolo:"自动通过",permissionManualDesc:"每个工具操作都需要你手动确认",permissionAutoDesc:"完全自主运行,agent 自己做决定,不再询问",permissionYoloDesc:"自动批准工具操作,但遇到关键问题仍会询问",planLabel:"计划",planOn:"开",planOff:"关",planTooltip:"切换计划模式(先调研再修改)",modesLabel:"模式",goalLabel:"目标",swarmLabel:"Swarm",modeOff:"未启用",goalPlaceholder:"让 Agent 完成什么目标?",goalStart:"开始",goalPause:"暂停",goalResume:"继续",goalCancel:"取消",modeNotSupported:"暂不支持",thinkingLabel:"思考",thinkingTooltip:"切换思考模式",starredModels:"收藏",moreModels:"更多模型…",statusPanelTitle:"会话状态",statusPanelClose:"关闭",statusModel:"模型",statusThinking:"思考强度",statusPermission:"权限",statusPlanMode:"计划模式",statusSwarmMode:"Swarm 模式",swarmOn:"开",swarmOff:"关",statusContext:"上下文",statusCost:"花费",statusContextValue:"{used} / {max} ({pct}%)",statusNone:"—",activityRunning:"运行中…",activityAwaitingApproval:"等待批准",activityAwaitingQuestion:"等待回答",interrupt:"中断",runningShort:"进行中"},iO={placeholder:"输入消息…",send:"发送 ↵",queueLabel:"队列",placeholderRunning:"输入会加入队列 · Ctrl+S 立即插入运行中的回合",queueAutoDrain:"当前回合结束后自动逐条发送",queueNext:"下一条",queueDragTitle:"拖拽排序",editQueued:"编辑(载入到输入框)",queuedImageOnly:"图片 ×{n}",queuedHasImage:"包含 {n} 张图片 — 只能移除,不能编辑",remove:"移除",removeNamed:"移除 {name}",uploading:"上传中",uploadFailed:"上传失败",attachImage:"附加图片",previewAttachment:"预览 {name}",interrupt:"中断",interruptTitle:"中断当前操作",expandTitle:"展开输入框进行多行编辑",collapseTitle:"收起输入框",emptyConversationTitle:"BLUN King",emptyConversation:"还没有消息 —— 在下方输入开始对话",quickStartPlaceholder:"输入消息开始新对话…",thinkingSuffix:" · thinking",thinkingSuffixEffort:" · thinking: {level}"},rO={title:"登录 BLUN King",close:"关闭 (Esc)",starting:"正在启动授权流程…",lead:"点击下方按钮,在新标签页中完成授权。",authorizeInBrowser:"在浏览器中授权",orDivider:"或者",fallbackPrefix:"换个设备?在浏览器打开 ",fallbackSuffix:" 输入设备码:",copy:"复制",copied:"已复制",waitingAuth:"等待授权",waitingAutoClose:"等待授权,完成后自动登录…",success:"已授权",successHint:"正在加载,稍后自动关闭…",expiredTitle:"授权码已过期",expiredHint:"请重新开始授权流程",retry:"重试",closeBtn:"关闭",errorTitle:"当前 daemon 暂不支持登录",errorHint:"请升级 blun 后重试"},lO={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}",loginBlun:"登录 Blun",enterApiKey:"填写 API Key",fieldApiKey:"API Key",fieldBaseUrl:"Base URL",fieldDefaultModel:"默认模型",baseUrlPlaceholder:"https://… (可选)",optional:"可选",apiKeyRequired:"API Key 不能为空",add:"添加",escClose:"Esc 关闭"},aO={dialogLabel:"切换模型",title:"切换模型",close:"关闭 (Esc)",allTab:"全部",providerTabs:"模型提供商",searchPlaceholder:"搜索模型或提供商…",loading:"加载模型中…",unavailable:"daemon 暂不支持模型列表",contextSuffix:"{size}k ctx",emptyNoModels:"daemon 未提供可选模型",emptyNoMatch:"无匹配模型",starTitle:"添加到收藏",unstarTitle:"取消收藏",footerHint:"↑↓ 导航 · Enter 选择 · Esc 关闭"},cO={justNow:"刚刚"},uO={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:"拒绝并退出"},dO={title:"提问",step:"Q{current}/{total}",back:"‹ 返回",nextQuestion:"下一题 ›",otherDefault:"其他…",submit:"提交",dismiss:"放弃",minimize:"最小化",expand:"展开"},fO={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:"展开"},pO={panelTitle:"思考过程",close:"关闭"},hO={title:"改动",branch:"分支",aheadTitle:"领先远程",behindTitle:"落后远程",changeCount:"{count} 改动",empty:"无 git 改动 / daemon 未提供",clean:"工作区干净,无改动",back:"返回",loading:"正在加载 diff…",noDiff:"该文件没有行级改动",list:"列表",tree:"树形",close:"关闭"},mO={},gO={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:"无法读取这个文件"}},vO={searching:"搜索中…",noMatch:"无匹配"},yO={dismiss:"关闭",errorLabel:"错误",noteLabel:"提示",details:{cause:"底层原因",code:"错误码",connection:"连接状态",contentType:"响应类型",details:"服务端详情",duration:"耗时",endpoint:"请求地址",errorName:"错误类型",message:"错误信息",operation:"操作",phase:"失败阶段",request:"请求",requestId:"Request ID",responsePreview:"响应预览",sessionId:"Session ID",stack:"堆栈",status:"HTTP 状态",timeout:"超时设置",timestamp:"时间"},daemonApiTitle:"Blun daemon 返回错误",daemonNetworkMessage:"Web 没有拿到本地服务的响应。请确认 Blun daemon 仍在运行,或刷新页面重试。",daemonNetworkTitle:"无法连接到 Blun daemon",diagnostics:"诊断信息",hideDetails:"收起详情",operationFailedMessage:"刚才的操作没有完成,请稍后重试。",operationFailedTitle:"操作失败",sessionSnapshotMessage:"Web 没能加载当前会话内容。请确认 Blun daemon 仍在运行,或刷新页面重试。",sessionSnapshotTitle:"无法加载当前会话内容",showDetails:"查看详情",copyDetails:"复制诊断信息",copied:"已复制",wsTitle:"实时连接出错",goal:{alreadyExists:"当前会话已有一个进行中的目标,请先取消它再创建新目标。",notFound:"没有找到可操作的目标,可能它已经结束或被取消。",statusInvalid:"当前目标状态不支持这个操作。",notResumable:"这个目标无法恢复(可能已取消或已完成)。",objectiveTooLong:"目标描述太长了,请精简后重试。"}},kO={help:{desc:"显示可用命令列表"},new:{desc:"创建新会话"},clear:{desc:"清空并新建会话"},model:{desc:"切换模型"},provider:{desc:"管理提供商 (添加/删除/刷新)"},login:{desc:"在浏览器中登录 Blun"},permission:{desc:"切换审批模式 (manual/auto/yolo)"},plan:{desc:"切换计划模式 开/关"},swarm:{desc:"切换 swarm 模式;/swarm <任务> 直接在 swarm 下执行"},goal:{desc:"创建/控制目标:/goal <目标>、/goal pause|resume|cancel"},btw:{desc:"侧边聊天:/btw <问题> 向 fork 的侧边会话提问"},yolo:{desc:"自动批准一切 (yolo 模式)"},auto:{desc:"自动批准安全的读写"},thinking:{desc:"设置思考强度"},compact:{desc:"压缩会话历史"},fork:{desc:"把当前会话 fork 出一个新会话"},undoNotImplemented:"daemon 尚未支持 /undo",status:{desc:"查看会话状态"},undo:{desc:"撤销上一条消息"}},bO={label:{read:"读取",bash:"运行",edit:"编辑",write:"写入",grep:"搜索",glob:"查找",ls:"列目录",web_fetch:"抓取",search:"搜索",todo:"待办",task:"任务"},chip:{lines:"{count} 行",results:"{count} 结果",edited:"已编辑",created:"已创建",todos:"{count} 项"},group:{title:"{count} 个工具调用",running:"运行中",error:"有失败",done:"已完成"}},_O={resizeHandleAria:"调整侧栏宽度",resizePreviewAria:"调整预览面板宽度",detailPanelAria:"详情面板"},wO={openSwitcher:"切换会话 / 工作区",openSettings:"会话设置",settingsTitle:"会话设置",groupSession:"当前会话",groupApp:"应用偏好",sheetLabel:"面板",closeSheet:"关闭",tapToCycle:"点击切换",running:"运行中",idle:"空闲",sessionCount:"{n} 个会话",newSession:"新建会话",permManualSub:"每个工具都确认",permAutoSub:"自动批准编辑",permYoloSub:"全部自动批准",planModeSub:"计划模式",swarmModeSub:"Swarm 模式"},SO={colorSchemeLabel:"明暗",light:"月之亮面",dark:"月之暗面",system:"跟随系统",accentLabel:"主题色",accentBlue:"蓝色",accentBlack:"黑色"},CO={title:"Welcome to Blun Web",subtitle:"Pick a few preferences — you can change them anytime in Settings.",languageLabel:"Language",start:"Get started",skip:"Skip",reopen:"Preferences / onboarding"},xO={title:"欢迎来使用 Blun Web",subtitle:"来选择一些你的偏好 —— 之后也可以在设置里随时修改。",languageLabel:"语言",start:"开始使用",skip:"跳过",reopen:"偏好 / 引导"},AO={title:"Settings",close:"Close (Esc)",tabs:{general:"General",agent:"Agent",account:"Account",advanced:"Advanced"},appearance:"Appearance",notifications:"Notifications",notifyOnComplete:"Notify when a turn completes",notifyOnQuestion:"Notify when a question needs an answer",soundOnComplete:"Play a sound when a turn completes or needs an answer",notifyDenied:"Blocked in browser settings",notifyBody:"Finished a turn",notifyQuestionBody:"A question is waiting for your answer",account:"Account",uiFontSize:"Font size",agentDefaults:"Agent defaults",providers:"Providers",providersHint:"Add, remove, or refresh providers",manageProviders:"Manage",saving:"Saving",defaultModel:"Default model",defaultModelHint:"New sessions prefer this model",noDefaultModel:"No default model",defaultPermission:"Default permission",defaultPermissionHint:"Only affects newly-created sessions",defaultThinking:"Thinking by default",defaultThinkingHint:"Whether new sessions start with thinking enabled",defaultPlanMode:"Plan mode by default",defaultPlanModeHint:"Whether new sessions start in plan mode",mergeSkills:"Merge all available skills",mergeSkillsHint:"Show project, plugin, and user skills together",telemetry:"Improve product with usage data",telemetryHint:"When on, we collect anonymous interaction data (such as clicks, interruptions, and feature usage) to improve the product experience. You can turn it off at any time.",telemetryRestartHint:"Takes effect after restarting the service.",credentialReady:"Credential configured",credentialMissing:"Missing credential",configUnavailable:"The server did not return config yet. These settings are unavailable.",advanced:"Advanced",build:"Build",serverVersion:"Server version",exportLog:"Troubleshooting log",logHint:"Enable with ?debug=1 to capture",exportLogBtn:"Export log",conversationToc:"Show conversation outline",conversationTocHint:"Show a clickable outline in the right margin to jump between messages"},TO={title:"设置",close:"关闭 (Esc)",tabs:{general:"通用",agent:"Agent",account:"账户",advanced:"高级"},appearance:"外观",notifications:"通知",notifyOnComplete:"会话完成时通知",notifyOnQuestion:"待回答时通知",soundOnComplete:"会话完成或待回答时播放提示音",notifyDenied:"已在浏览器设置中被阻止",notifyBody:"已完成一轮",notifyQuestionBody:"有提问等待你回答",account:"账户",uiFontSize:"字体大小",agentDefaults:"Agent 默认值",providers:"提供商",providersHint:"添加、删除或刷新提供商",manageProviders:"管理",saving:"保存中",defaultModel:"默认模型",defaultModelHint:"新会话会优先使用这个模型",noDefaultModel:"未设置默认模型",defaultPermission:"默认权限",defaultPermissionHint:"只影响之后新建的会话",defaultThinking:"默认开启思考",defaultThinkingHint:"新会话默认是否开启 thinking",defaultPlanMode:"默认计划模式",defaultPlanModeHint:"新会话默认进入 plan mode",mergeSkills:"合并所有可用 Skills",mergeSkillsHint:"让项目、插件和用户 Skills 一起出现在可用列表中",telemetry:"使用数据改进产品",telemetryHint:"开启后,我们会收集您的匿名交互数据(如点击、打断、功能使用等),用于改进产品体验。您可以随时关闭。",telemetryRestartHint:"更改后需重启服务生效。",credentialReady:"凭据已配置",credentialMissing:"缺少凭据",configUnavailable:"当前服务端没有返回 config,设置项暂不可用。",advanced:"高级",build:"构建",serverVersion:"服务端版本",exportLog:"故障排查日志",logHint:"加 ?debug=1 开启采集",exportLogBtn:"导出日志",conversationToc:"显示对话目录",conversationTocHint:"在右侧显示可点击跳转的对话目录"},MO={openInEditor:"Open in editor",openInEditorShort:"Open",chooseOpenApp:"Choose application",copyAll:"Copy all as Markdown",copyFinalSummary:"Copy final summary",copied:"Copied",copyPath:"Copy path",changed:"{n} changed",gitTooltip:"Open Files > Changed",detached:"detached",openPr:"Open pull request",options:"Options",copySessionId:"Copy Session ID",renameSession:"Rename",forkSession:"Fork session",archiveSession:"Archive"},EO={openInEditor:"在编辑器中打开",openInEditorShort:"打开",chooseOpenApp:"选择应用",copyAll:"复制全部对话为 Markdown",copyFinalSummary:"仅复制最终总结",copied:"已复制",copyPath:"复制路径",changed:"{n} 处改动",gitTooltip:"打开「文件 > 改动」",detached:"游离",openPr:"打开 Pull Request",options:"选项",copySessionId:"复制 Session ID",renameSession:"重命名",forkSession:"分叉会话",archiveSession:"归档"},IO={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"},$O={title:"侧边聊天",subtitle:"从当前会话 fork",empty:"在侧边随手问一句 —— 它共享当前会话的上下文。",placeholder:"问问侧边聊天…",send:"发送"},NO={en:{common:M8,app:E8,sidebar:I8,workspace:$8,conversation:N8,status:L8,composer:O8,login:P8,providers:R8,model:D8,sessions:B8,approval:F8,question:H8,tasks:W8,thinking:z8,diff:U8,fileTree:q8,filePreview:j8,mention:V8,warnings:K8,commands:G8,tools:Y8,layout:X8,mobile:Q8,theme:Z8,onboarding:CO,settings:AO,header:MO,sideChat:IO},zh:{common:J8,app:eO,sidebar:tO,workspace:nO,conversation:sO,status:oO,composer:iO,login:rO,providers:lO,model:aO,sessions:cO,approval:uO,question:dO,tasks:fO,thinking:pO,diff:hO,fileTree:mO,filePreview:gO,mention:vO,warnings:yO,commands:kO,tools:bO,layout:_O,mobile:wO,theme:SO,onboarding:xO,settings:TO,header:EO,sideChat:$O}},TA=[{code:"en",label:"English"},{code:"zh",label:"中文"}];function LO(){const e=Qn(Et.locale);return e==="en"||e==="zh"?e:globalThis.navigator?.language?.toLowerCase().startsWith("zh")?"zh":"en"}const Un=o5({legacy:!1,locale:LO(),fallbackLocale:"en",messages:NO});function MA(e){Un.global.locale.value=e,ts(Et.locale,e)}const Xa=Un.global.t,OO={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"},PO={multiedit:"multi_edit",multiedits:"multi_edit",shell:"bash",run:"bash",exec:"bash",ripgrep:"grep",rg:"grep",find:"glob",fetch:"web_fetch",webfetch:"web_fetch",url_fetch:"web_fetch",urlfetch:"web_fetch",list:"ls",listdir:"ls",list_dir:"ls",todowrite:"todo",todo_write:"todo",todoread:"todo",todolist:"todo",todo_list:"todo",agent:"task",subagent:"task",websearch:"search",web_search:"search"};function Zl(e){const t=(e??"").trim().toLowerCase().replace(/[\s-]+/g,"_");return PO[t]??t}function id(e){const t=OO[Zl(e)];return t?Xa(t):e}const RO={read:"file-text",bash:"terminal",edit:"pencil",multi_edit:"pencil",write:"file-plus",grep:"search",search:"search",glob:"glob",ls:"folder",web_fetch:"globe",todo:"check-list",task:"sparkles"};function S0(e){const t=Zl(e);let n=RO[t];return!n&&(e??"").trim().toLowerCase().includes("skill")&&(n="bolt"),n?Ia(n,"sm"):""}const EA=80;function DO(e,t=EA){const n=e.trim();return n.length>t?n.slice(0,t-1)+"…":n}function BO(e,t){const n=e.trim();return!!(n===""||n==="{}"||n==="[]"||n==="null"||t&&Object.keys(t).length===0)}function FO(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 sn(e){return typeof e=="string"&&e.length>0?e:void 0}function Sl(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function HO(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 ig(e){return sn(e.path)??sn(e.file_path)??sn(e.filePath)??sn(e.filename)}const WO=64;function Bu(e,t,n=!1){const s=(o,i=EA)=>n?o.trim():DO(o,i);try{const o=FO(t);if(!n&&BO(t,o))return"";const i=()=>s(t.replace(/^·\s*/,""));if(!o)return i();switch(Zl(e)){case"read":{const r=ig(o);if(!r)return i();const l=Sl(o.offset)??Sl(o.line_start)??Sl(o.start_line),a=Sl(o.limit)??Sl(o.length),c=Sl(o.line_end)??Sl(o.end_line)??(l!==void 0&&a!==void 0?l+a:void 0);return s(l!==void 0&&c!==void 0?`${r}:${l}-${c}`:l!==void 0?`${r}:${l}`:r)}case"write":{const r=ig(o);return r?s(`${r} ${Xa("tools.chip.created")}`):i()}case"edit":case"multi_edit":{const r=ig(o);return r?s(r):i()}case"bash":{const r=sn(o.command)??sn(o.cmd)??sn(o.script);return r?s(r,WO):i()}case"grep":case"search":{const r=sn(o.pattern)??sn(o.query)??sn(o.regex),l=sn(o.path)??sn(o.glob)??sn(o.include);return r&&l?s(`${r} in ${l}`):r?s(r):i()}case"glob":{const r=sn(o.pattern)??sn(o.glob)??sn(o.query),l=sn(o.path)??sn(o.cwd);return r&&l?s(`${r} in ${l}`):r?s(r):sn(o.path)?s(sn(o.path)):i()}case"ls":{const r=sn(o.path)??sn(o.dir)??sn(o.directory)??sn(o.cwd);return r?s(r):i()}case"web_fetch":{const r=sn(o.url)??sn(o.uri);return r?s(HO(r)):i()}case"todo":case"task":{const r=sn(o.description)??sn(o.title)??sn(o.prompt)??sn(o.name)??sn(o.subagent_type);if(r)return s(r);const l=Array.isArray(o.todos)?o.todos:Array.isArray(o.items)?o.items:void 0;return l?s(Xa("tools.chip.todos",{count:l.length})):i()}default:return i()}}catch{return t}}function zO(e){try{switch(Zl(e.name)){case"bash":return e.timing?e.timing:"";case"read":{if(e.output&&e.output.length>0){const t=e.output.length;return Xa("tools.chip.lines",{count:t})}return""}case"edit":case"multi_edit":case"write":{if(e.output){for(const n of e.output){const s=n.match(/\+(\d+).*[-−](\d+)/);if(s)return`+${s[1]} −${s[2]}`}const t=e.output.find(n=>/\d+/.test(n));if(t){const n=t.match(/\+(\d+)/),s=t.match(/[-−](\d+)/);if(n||s)return`${n?`+${n[1]}`:""} ${s?`−${s[1]}`:""}`.trim()}if(e.status!=="error")return Xa("tools.chip.edited")}return""}case"grep":case"search":return e.output&&e.output.length>0?Xa("tools.chip.results",{count:e.output.length}):"";default:return""}}catch{return""}}const UO=je({__name:"StatusDot",props:{status:{}},setup(e){const t=e;function n(o){switch(o){case"ok":case"done":case"completed":case"success":return"ok";case"error":case"failed":case"danger":return"error";case"running":case"working":case"in_progress":case"active":return"running";case"suspended":return"suspended";default:return"idle"}}const s=F(()=>n(t.status));return(o,i)=>(w(),N("span",{class:Re(["kw-dot",`kw-dot--${s.value}`]),"aria-hidden":"true"},null,2))}}),Fu=ut(UO,[["__scopeId","data-v-ed5cc9c3"]]),qO=["innerHTML"],jO={class:"a"},VO={key:0,class:"p"},KO={class:"rt"},GO=["aria-label"],YO={key:0,class:"tm"},XO=["inert"],QO={class:"bb-pad"},ZO=je({__name:"ToolRow",props:{status:{},icon:{default:""},name:{},arg:{default:""},time:{default:""},open:{type:Boolean,default:!1},expandable:{type:Boolean,default:!1},stacked:{type:Boolean,default:!1},stackPosition:{default:"single"}},emits:["toggle"],setup(e){return(t,n)=>(w(),N("div",{class:Re(["box",{open:e.open,stacked:e.stacked,err:e.status==="error","stack-first":e.stackPosition==="first","stack-middle":e.stackPosition==="middle","stack-last":e.stackPosition==="last"}])},[T("div",{class:"bh",onClick:n[0]||(n[0]=s=>t.$emit("toggle"))},[e.icon?(w(),N("span",{key:0,class:"gl",innerHTML:e.icon,"aria-hidden":"true"},null,8,qO)):ie("",!0),T("span",jO,R(e.name),1),oe(Ht,{text:e.arg},{default:_e(()=>[e.arg?(w(),N("span",VO,R(e.arg),1)):ie("",!0)]),_:1},8,["text"]),T("span",KO,[T("span",{class:Re(["status",e.status]),role:"status","aria-label":e.status},[e.status==="ok"?(w(),ve(Je,{key:0,name:"check",size:"sm"})):e.status==="error"?(w(),ve(Je,{key:1,name:"close",size:"sm"})):e.status==="suspended"?(w(),ve(Fu,{key:2,status:"suspended"})):(w(),ve(Fu,{key:3,status:"running"}))],10,GO),Cn(t.$slots,"trailing"),e.time?(w(),N("span",YO,R(e.time),1)):ie("",!0)]),e.expandable?(w(),ve(Je,{key:1,class:"car",name:e.open?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])):ie("",!0)]),T("div",{class:Re(["bb",{open:e.open}]),inert:!e.open},[T("div",QO,[Cn(t.$slots,"default")])],10,XO)],2))}}),C0=ut(ZO,[["__scopeId","data-v-9eb13415"]]),JO={key:0,class:"at-type"},eP={key:1,class:"at-task"},tP={key:2,class:"bb-code"},nP=je({__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}=It(),s=e,o=t;function i(_){if(!_)return{};try{const g=JSON.parse(_);return{description:typeof g.description=="string"?g.description:void 0,subagentType:typeof g.subagent_type=="string"?g.subagent_type:void 0,prompt:typeof g.prompt=="string"?g.prompt:void 0}}catch{return{}}}const r=F(()=>i(s.tool.arg)),l=F(()=>!!s.tool.output&&s.tool.output.length>0),a=F(()=>!!r.value.prompt||!!r.value.subagentType||l.value),c=Z(s.tool.defaultExpanded===!0&&a.value),u=F(()=>s.tool.status),d=F(()=>id(s.tool.name)),p=F(()=>S0(s.tool.name)),h=F(()=>r.value.description||r.value.subagentType||""),f=Ut("resolveAgentTaskId"),m=F(()=>f?f(s.tool.id)!==void 0:!0);function b(){a.value&&(c.value=!c.value)}return Ke(()=>[s.tool.defaultExpanded,s.tool.output?.length,s.tool.status],()=>{s.tool.defaultExpanded===!0&&a.value&&(c.value=!0)}),(_,g)=>(w(),ve(C0,{status:u.value,icon:p.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:_e(()=>[m.value?(w(),N("button",{key:0,type:"button",class:"at-open",onClick:g[0]||(g[0]=vt(v=>o("openAgent",e.tool.id),["stop"]))},R(x(n)("tasks.openDetail")),1)):ie("",!0)]),default:_e(()=>[r.value.subagentType?(w(),N("div",JO,R(r.value.subagentType),1)):ie("",!0),r.value.prompt?(w(),N("div",eP,R(r.value.prompt),1)):ie("",!0),l.value?(w(),N("div",tP,[(w(!0),N(Le,null,nt(e.tool.output??[],(v,y)=>(w(),N("div",{key:y},R(v),1))),128))])):ie("",!0)]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),sP=ut(nP,[["__scopeId","data-v-a9aa31ca"]]),oP=1e6,O_=5e3;function P_(e){if(e==="")return[];const t=e.split(`
|
|
38
|
+
*/const qN="11.4.5";function jN(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(Pl().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(Pl().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Pl().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Pl().__INTLIFY_PROD_DEVTOOLS__=!1)}const Qs={UNEXPECTED_RETURN_TYPE:uN,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 po(e,...t){return fh(e,null,void 0)}const Uv=tl("__translateVNode"),qv=tl("__datetimeParts"),jv=tl("__numberParts"),pA=tl("__setPluralRules"),hA=tl("__injectWithOption"),Ra=tl("__dispose");function Pu(e){if(!en(e)||$i(e))return e;for(const t in e)if(Zo(e,t))if(!t.includes("."))en(e[t])&&Pu(e[t]);else{const n=t.split("."),s=n.length-1;let o=e,i=!1;for(let r=0;r<s;r++){if(n[r]==="__proto__")throw new Error(`unsafe key: ${n[r]}`);if(n[r]in o||(o[n[r]]=vn()),!en(o[n[r]])){i=!0;break}o=o[n[r]]}if(i||($i(o)?sA.includes(n[s])||delete e[t]:(o[n[s]]=e[t],delete e[t])),!$i(o)){const r=o[n[s]];en(r)&&Pu(r)}}return e}function k0(e,t){const{messages:n,__i18n:s,messageResolver:o,flatJson:i}=t,r=jt(n)?n:Yn(s)?vn():{[e]:vn()};if(Yn(s)&&s.forEach(l=>{if("locale"in l&&"resource"in l){const{locale:a,resource:c}=l;a?(r[a]=r[a]||vn(),Cf(c,r[a])):Cf(c,r)}else pt(l)&&Cf(JSON.parse(l),r)}),o==null&&i)for(const l in r)Zo(r,l)&&Pu(r[l]);return r}function mA(e){return e.type}function gA(e,t,n){let s=en(t.messages)?t.messages:vn();"__i18nGlobal"in n&&(s=k0(e.locale.value,{messages:s,__i18n:n.__i18nGlobal}));const o=Object.keys(s);o.length&&o.forEach(i=>{e.mergeLocaleMessage(i,s[i])});{if(en(t.datetimeFormats)){const i=Object.keys(t.datetimeFormats);i.length&&i.forEach(r=>{e.mergeDateTimeFormat(r,t.datetimeFormats[r])})}if(en(t.numberFormats)){const i=Object.keys(t.numberFormats);i.length&&i.forEach(r=>{e.mergeNumberFormat(r,t.numberFormats[r])})}}}function d_(e){return oe(zr,null,e,0)}function Ru(){return Ls()}const f_="__INTLIFY_META__",p_=()=>[],VN=()=>!1;let h_=0;function m_(e){return((t,n,s,o)=>e(n,s,Ru()||void 0,o))}const KN=()=>{const e=Ru();let t=null;return e&&(t=mA(e)[f_])?{[f_]:t}:null};function dp(e={}){const{__root:t,__injectWithOption:n}=e,s=t===void 0,o=e.flatJson,i=cp?Z:Ql;let r=Jt(e.inheritLocale)?e.inheritLocale:!0;const l=i(t&&r?t.locale.value:pt(e.locale)?e.locale:Ou),a=i(t&&r?t.fallbackLocale.value:pt(e.fallbackLocale)||Yn(e.fallbackLocale)||jt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:l.value),c=i(k0(l.value,e)),u=i(jt(e.datetimeFormats)?e.datetimeFormats:{[l.value]:{}}),d=i(jt(e.numberFormats)?e.numberFormats:{[l.value]:{}});let p=t?t.missingWarn:Jt(e.missingWarn)||lc(e.missingWarn)?e.missingWarn:!0,h=t?t.fallbackWarn:Jt(e.fallbackWarn)||lc(e.fallbackWarn)?e.fallbackWarn:!0,f=t?t.fallbackRoot:Jt(e.fallbackRoot)?e.fallbackRoot:!0,m=!!e.fallbackFormat,b=Pn(e.missing)?e.missing:null,_=Pn(e.missing)?m_(e.missing):null,g=Pn(e.postTranslation)?e.postTranslation:null,v=t?t.warnHtmlMessage:Jt(e.warnHtmlMessage)?e.warnHtmlMessage:!0,y=!!e.escapeParameter;const A=t?t.modifiers:jt(e.modifiers)?e.modifiers:{};let O=e.pluralRules||t&&t.pluralRules,$;$=(()=>{s&&s_(null);const ae={version:qN,locale:l.value,fallbackLocale:a.value,messages:c.value,modifiers:A,pluralRules:O,missing:_===null?void 0:_,missingWarn:p,fallbackWarn:h,fallbackFormat:m,unresolving:!0,postTranslation:g===null?void 0:g,warnHtmlMessage:v,escapeParameter:y,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};ae.datetimeFormats=u.value,ae.numberFormats=d.value,ae.__datetimeFormatters=jt($)?$.__datetimeFormatters:void 0,ae.__numberFormatters=jt($)?$.__numberFormatters:void 0;const Te=IN(ae);return s&&s_(Te),Te})(),jc($,l.value,a.value);function E(){return[l.value,a.value,c.value,u.value,d.value]}const M=F({get:()=>l.value,set:ae=>{$.locale=ae,l.value=ae}}),L=F({get:()=>a.value,set:ae=>{$.fallbackLocale=ae,a.value=ae,jc($,l.value,ae)}}),S=F(()=>c.value),I=F(()=>u.value),P=F(()=>d.value);function D(){return Pn(g)?g:null}function W(ae){g=ae,$.postTranslation=ae}function z(){return b}function q(ae){ae!==null&&(_=m_(ae)),b=ae,$.missing=_}const Q=(ae,Te,Ve,tt,bt,kt)=>{E();let Tt;try{__INTLIFY_PROD_DEVTOOLS__,s||($.fallbackContext=t?EN():void 0),Tt=ae($)}finally{__INTLIFY_PROD_DEVTOOLS__,s||($.fallbackContext=void 0)}if(Ve!=="translate exists"&&rs(Tt)&&Tt===ph||Ve==="translate exists"&&!Tt){const[Pt,mt]=Te();return t&&f?tt(t):bt(Pt)}else{if(kt(Tt))return Tt;throw po(Qs.UNEXPECTED_RETURN_TYPE)}};function X(...ae){return Q(Te=>Reflect.apply(u_,null,[Te,...ae]),()=>zv(...ae),"translate",Te=>Reflect.apply(Te.t,Te,[...ae]),Te=>Te,Te=>pt(Te))}function fe(...ae){const[Te,Ve,tt]=ae;if(tt&&!en(tt))throw po(Qs.INVALID_ARGUMENT);return X(Te,Ve,as({resolvedMessage:!0},tt||{}))}function ye(...ae){return Q(Te=>Reflect.apply(i_,null,[Te,...ae]),()=>Hv(...ae),"datetime format",Te=>Reflect.apply(Te.d,Te,[...ae]),()=>up,Te=>pt(Te)||Yn(Te))}function Me(...ae){return Q(Te=>Reflect.apply(l_,null,[Te,...ae]),()=>Wv(...ae),"number format",Te=>Reflect.apply(Te.n,Te,[...ae]),()=>up,Te=>pt(Te)||Yn(Te))}function we(ae){return ae.map(Te=>pt(Te)||rs(Te)||Jt(Te)?d_(String(Te)):Te)}const Ue={normalize:we,interpolate:ae=>ae,type:"vnode"};function Fe(...ae){return Q(Te=>{let Ve;const tt=Te;try{tt.processor=Ue,Ve=Reflect.apply(u_,null,[tt,...ae])}finally{tt.processor=null}return Ve},()=>zv(...ae),"translate",Te=>Te[Uv](...ae),Te=>[d_(Te)],Te=>Yn(Te))}function rt(...ae){return Q(Te=>Reflect.apply(l_,null,[Te,...ae]),()=>Wv(...ae),"number format",Te=>Te[jv](...ae),p_,Te=>pt(Te)||Yn(Te))}function le(...ae){return Q(Te=>Reflect.apply(i_,null,[Te,...ae]),()=>Hv(...ae),"datetime format",Te=>Te[qv](...ae),p_,Te=>pt(Te)||Yn(Te))}function U(ae){O=ae,$.pluralRules=O}function G(ae,Te){return Q(()=>{if(!ae)return!1;const Ve=pt(Te)?Te:l.value,tt=pt(Te)?[Ve]:Fv($,a.value,Ve);for(let bt=0;bt<tt.length;bt++){const kt=J(tt[bt]);let Tt=$.messageResolver(kt,ae);if(Tt===null&&(Tt=kt[ae]),$i(Tt)||Go(Tt)||pt(Tt))return!0}return!1},()=>[ae],"translate exists",Ve=>Reflect.apply(Ve.te,Ve,[ae,Te]),VN,Ve=>Jt(Ve))}function ne(ae){let Te=null;const Ve=Fv($,a.value,l.value);for(let tt=0;tt<Ve.length;tt++){const bt=c.value[Ve[tt]]||{},kt=$.messageResolver(bt,ae);if(kt!=null){Te=kt;break}}return Te}function H(ae){const Te=ne(ae);return Te??(t?t.tm(ae)||{}:{})}function J(ae){return c.value[ae]||{}}function ce(ae,Te){if(o){const Ve={[ae]:Te};for(const tt in Ve)Zo(Ve,tt)&&Pu(Ve[tt]);Te=Ve[ae]}c.value[ae]=Te,$.messages=c.value}function te(ae,Te){c.value[ae]=c.value[ae]||{};const Ve={[ae]:Te};if(o)for(const tt in Ve)Zo(Ve,tt)&&Pu(Ve[tt]);Te=Ve[ae],Cf(Te,c.value[ae]),$.messages=c.value}function ue(ae){return u.value[ae]||{}}function j(ae,Te){u.value[ae]=Te,$.datetimeFormats=u.value,r_($,ae,Te)}function Y(ae,Te){u.value[ae]=as(u.value[ae]||{},Te),$.datetimeFormats=u.value,r_($,ae,Te)}function re(ae){return d.value[ae]||{}}function ge(ae,Te){d.value[ae]=Te,$.numberFormats=d.value,a_($,ae,Te)}function Ae(ae,Te){d.value[ae]=as(d.value[ae]||{},Te),$.numberFormats=d.value,a_($,ae,Te)}h_++,t&&cp&&(Ke(t.locale,ae=>{r&&(l.value=ae,$.locale=ae,jc($,l.value,a.value))}),Ke(t.fallbackLocale,ae=>{r&&(a.value=ae,$.fallbackLocale=ae,jc($,l.value,a.value))}));const Ie={id:h_,locale:M,fallbackLocale:L,get inheritLocale(){return r},set inheritLocale(ae){r=ae,ae&&t&&(l.value=t.locale.value,a.value=t.fallbackLocale.value,jc($,l.value,a.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:S,get modifiers(){return A},get pluralRules(){return O||{}},get isGlobal(){return s},get missingWarn(){return p},set missingWarn(ae){p=ae,$.missingWarn=p},get fallbackWarn(){return h},set fallbackWarn(ae){h=ae,$.fallbackWarn=h},get fallbackRoot(){return f},set fallbackRoot(ae){f=ae},get fallbackFormat(){return m},set fallbackFormat(ae){m=ae,$.fallbackFormat=m},get warnHtmlMessage(){return v},set warnHtmlMessage(ae){v=ae,$.warnHtmlMessage=ae},get escapeParameter(){return y},set escapeParameter(ae){y=ae,$.escapeParameter=ae},t:X,getLocaleMessage:J,setLocaleMessage:ce,mergeLocaleMessage:te,getPostTranslationHandler:D,setPostTranslationHandler:W,getMissingHandler:z,setMissingHandler:q,[pA]:U};return Ie.datetimeFormats=I,Ie.numberFormats=P,Ie.rt=fe,Ie.te=G,Ie.tm=H,Ie.d=ye,Ie.n=Me,Ie.getDateTimeFormat=ue,Ie.setDateTimeFormat=j,Ie.mergeDateTimeFormat=Y,Ie.getNumberFormat=re,Ie.setNumberFormat=ge,Ie.mergeNumberFormat=Ae,Ie[hA]=n,Ie[Uv]=Fe,Ie[qv]=le,Ie[jv]=rt,Ie}function GN(e){const t=pt(e.locale)?e.locale:Ou,n=pt(e.fallbackLocale)||Yn(e.fallbackLocale)||jt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,s=Pn(e.missing)?e.missing:void 0,o=Jt(e.silentTranslationWarn)||lc(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,i=Jt(e.silentFallbackWarn)||lc(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,r=Jt(e.fallbackRoot)?e.fallbackRoot:!0,l=!!e.formatFallbackMessages,a=jt(e.modifiers)?e.modifiers:{},c=e.pluralizationRules,u=Pn(e.postTranslation)?e.postTranslation:void 0,d=pt(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,p=!!e.escapeParameterHtml,h=Jt(e.sync)?e.sync:!0;let f=e.messages;if(jt(e.sharedMessages)){const A=e.sharedMessages;f=Object.keys(A).reduce(($,k)=>{const E=$[k]||($[k]={});return as(E,A[k]),$},f||{})}const{__i18n:m,__root:b,__injectWithOption:_}=e,g=e.datetimeFormats,v=e.numberFormats,y=e.flatJson;return{locale:t,fallbackLocale:n,messages:f,flatJson:y,datetimeFormats:g,numberFormats:v,missing:s,missingWarn:o,fallbackWarn:i,fallbackRoot:r,fallbackFormat:l,modifiers:a,pluralRules:c,postTranslation:u,warnHtmlMessage:d,escapeParameter:p,messageResolver:e.messageResolver,inheritLocale:h,__i18n:m,__root:b,__injectWithOption:_}}function Vv(e={}){const t=dp(GN(e)),{__extender:n}=e,s={id:t.id,get locale(){return t.locale.value},set locale(o){t.locale.value=o},get fallbackLocale(){return t.fallbackLocale.value},set fallbackLocale(o){t.fallbackLocale.value=o},get messages(){return t.messages.value},get datetimeFormats(){return t.datetimeFormats.value},get numberFormats(){return t.numberFormats.value},get availableLocales(){return t.availableLocales},get missing(){return t.getMissingHandler()},set missing(o){t.setMissingHandler(o)},get silentTranslationWarn(){return Jt(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(o){t.missingWarn=Jt(o)?!o:o},get silentFallbackWarn(){return Jt(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(o){t.fallbackWarn=Jt(o)?!o:o},get modifiers(){return t.modifiers},get formatFallbackMessages(){return t.fallbackFormat},set formatFallbackMessages(o){t.fallbackFormat=o},get postTranslation(){return t.getPostTranslationHandler()},set postTranslation(o){t.setPostTranslationHandler(o)},get sync(){return t.inheritLocale},set sync(o){t.inheritLocale=o},get warnHtmlInMessage(){return t.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(o){t.warnHtmlMessage=o!=="off"},get escapeParameterHtml(){return t.escapeParameter},set escapeParameterHtml(o){t.escapeParameter=o},get pluralizationRules(){return t.pluralRules||{}},__composer:t,t(...o){return Reflect.apply(t.t,t,[...o])},rt(...o){return Reflect.apply(t.rt,t,[...o])},te(o,i){return t.te(o,i)},tm(o){return t.tm(o)},getLocaleMessage(o){return t.getLocaleMessage(o)},setLocaleMessage(o,i){t.setLocaleMessage(o,i)},mergeLocaleMessage(o,i){t.mergeLocaleMessage(o,i)},d(...o){return Reflect.apply(t.d,t,[...o])},getDateTimeFormat(o){return t.getDateTimeFormat(o)},setDateTimeFormat(o,i){t.setDateTimeFormat(o,i)},mergeDateTimeFormat(o,i){t.mergeDateTimeFormat(o,i)},n(...o){return Reflect.apply(t.n,t,[...o])},getNumberFormat(o){return t.getNumberFormat(o)},setNumberFormat(o,i){t.setNumberFormat(o,i)},mergeNumberFormat(o,i){t.mergeNumberFormat(o,i)}};return s.__extender=n,s}function YN(e,t,n){return{beforeCreate(){const s=Ru();if(!s)throw po(Qs.UNEXPECTED_ERROR);const o=this.$options;if(o.i18n){const i=o.i18n;if(o.__i18n&&(i.__i18n=o.__i18n),i.__root=t,this===this.$root)this.$i18n=g_(e,i);else{i.__injectWithOption=!0,i.__extender=n.__vueI18nExtend,this.$i18n=Vv(i);const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}}else if(o.__i18n)if(this===this.$root)this.$i18n=g_(e,o);else{this.$i18n=Vv({__i18n:o.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:t});const i=this.$i18n;i.__extender&&(i.__disposer=i.__extender(this.$i18n))}else this.$i18n=e;o.__i18nGlobal&&gA(t,o,o),this.$t=(...i)=>this.$i18n.t(...i),this.$rt=(...i)=>this.$i18n.rt(...i),this.$te=(i,r)=>this.$i18n.te(i,r),this.$d=(...i)=>this.$i18n.d(...i),this.$n=(...i)=>this.$i18n.n(...i),this.$tm=i=>this.$i18n.tm(i),n.__setInstance(s,this.$i18n)},mounted(){},unmounted(){const s=Ru();if(!s)throw po(Qs.UNEXPECTED_ERROR);const o=this.$i18n;delete this.$t,delete this.$rt,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,o.__disposer&&(o.__disposer(),delete o.__disposer,delete o.__extender),n.__deleteInstance(s),delete this.$i18n}}}function g_(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[pA](t.pluralizationRules||e.pluralizationRules);const n=k0(e.locale,{messages:t.messages,__i18n:t.__i18n});return Object.keys(n).forEach(s=>e.mergeLocaleMessage(s,n[s])),t.datetimeFormats&&Object.keys(t.datetimeFormats).forEach(s=>e.mergeDateTimeFormat(s,t.datetimeFormats[s])),t.numberFormats&&Object.keys(t.numberFormats).forEach(s=>e.mergeNumberFormat(s,t.numberFormats[s])),e}const b0={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function XN({slots:e},t){return t.length===1&&t[0]==="default"?(e.default?e.default():[]).reduce((s,o)=>[...s,...o.type===Le?o.children:[o]],[]):t.reduce((n,s)=>{const o=e[s];return o&&(n[s]=o()),n},vn())}function vA(){return Le}const QN=je({name:"i18n-t",props:as({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>rs(e)||!isNaN(e)}},b0),setup(e,t){const{slots:n,attrs:s}=t,o=e.i18n||It({useScope:e.scope,__useComponent:!0});return()=>{const i=()=>{const a=Object.keys(n).filter(d=>d[0]!=="_"),c=vn();e.locale&&(c.locale=e.locale),e.plural!==void 0&&(c.plural=pt(e.plural)?+e.plural:e.plural);const u=XN(t,a);return o[Uv](e.keypath,u,c)},r=as(vn(),s),l=pt(e.tag)||en(e.tag)?e.tag:vA();return en(l)?cn(l,r,{default:i}):cn(l,r,i())}}}),v_=QN;function ZN(e){return Yn(e)&&!pt(e[0])}function yA(e,t,n,s){const{slots:o,attrs:i}=t;return()=>{const r=()=>{const c={part:!0};let u=vn();e.locale&&(c.locale=e.locale),pt(e.format)?c.key=e.format:en(e.format)&&(pt(e.format.key)&&(c.key=e.format.key),u=Object.keys(e.format).reduce((h,f)=>n.includes(f)?as(vn(),h,{[f]:e.format[f]}):h,vn()));const d=s(e.value,c,u);let p=[c.key];return Yn(d)?p=d.map((h,f)=>{const m=o[h.type],b=m?m({[h.type]:h.value,index:f,parts:d}):[h.value];return ZN(b)&&(b[0].key=`${h.type}-${f}`),b}):pt(d)&&(p=[d]),p},l=as(vn(),i),a=pt(e.tag)||en(e.tag)?e.tag:vA();return en(a)?cn(a,l,{default:r}):cn(a,l,r())}}const JN=je({name:"i18n-n",props:as({value:{type:Number,required:!0},format:{type:[String,Object]}},b0),setup(e,t){const n=e.i18n||It({useScope:e.scope,__useComponent:!0});return yA(e,t,uA,(...s)=>n[jv](...s))}}),y_=JN;function e5(e,t){const n=e;if(e.mode==="composition")return n.__getInstance(t)||e.global;{const s=n.__getInstance(t);return s!=null?s.__composer:e.global.__composer}}function t5(e){const t=r=>{const{instance:l,value:a}=r;if(!l||!l.$)throw po(Qs.UNEXPECTED_ERROR);const c=e5(e,l.$),u=k_(a);return[Reflect.apply(c.t,c,[...b_(u)]),c]};return{created:(r,l)=>{const[a,c]=t(l);cp&&(r.__i18nWatcher=Ke(c.locale,()=>{l.instance&&l.instance.$forceUpdate()})),r.__composer=c,r.textContent=a},unmounted:r=>{cp&&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=k_(l);r.textContent=Reflect.apply(a.t,a,[...b_(c)])}},getSSRProps:r=>{const[l]=t(r);return{textContent:l}}}}function k_(e){if(pt(e))return{path:e};if(jt(e)){if(!("path"in e))throw po(Qs.REQUIRED_VALUE,"path");return e}else throw po(Qs.INVALID_VALUE)}function b_(e){const{path:t,locale:n,args:s,choice:o,plural:i}=e,r={},l=s||{};return pt(n)&&(r.locale=n),rs(o)&&(r.plural=o),rs(i)&&(r.plural=i),[t,l,r]}function n5(e,t,...n){const s=jt(n[0])?n[0]:{};(Jt(s.globalInstall)?s.globalInstall:!0)&&([v_.name,"I18nT"].forEach(i=>e.component(i,v_)),[y_.name,"I18nN"].forEach(i=>e.component(i,y_)),[S_.name,"I18nD"].forEach(i=>e.component(i,S_))),e.directive("t",t5(t))}const s5=tl("global-vue-i18n");function o5(e={}){const t=__VUE_I18N_LEGACY_API__&&Jt(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,n=Jt(e.globalInjection)?e.globalInjection:!0,s=new Map,[o,i]=i5(e,t),r=tl("");function l(d){return s.get(d)||null}function a(d,p){s.set(d,p)}function c(d){s.delete(d)}const u={get mode(){return __VUE_I18N_LEGACY_API__&&t?"legacy":"composition"},async install(d,...p){if(d.__VUE_I18N_SYMBOL__=r,d.provide(d.__VUE_I18N_SYMBOL__,u),jt(p[0])){const m=p[0];u.__composerExtend=m.__composerExtend,u.__vueI18nExtend=m.__vueI18nExtend}let h=null;!t&&n&&(h=f5(d,u.global)),__VUE_I18N_FULL_INSTALL__&&n5(d,u,...p),__VUE_I18N_LEGACY_API__&&t&&d.mixin(YN(i,i.__composer,u));const f=d.unmount;d.unmount=()=>{h&&h(),u.dispose(),f()}},get global(){return i},dispose(){o.stop()},__instances:s,__getInstance:l,__setInstance:a,__deleteInstance:c};return u}function It(e={}){const t=Ru();if(t==null)throw po(Qs.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw po(Qs.NOT_INSTALLED);const n=r5(t),s=a5(n),o=mA(t),i=l5(e,o);if(i==="global")return gA(s,e,o),s;if(i==="parent"){let a=__(n,t,e.__useComponent);return a==null&&(a=s),a}if(i==="isolated"){if(n.mode!=="composition")throw po(Qs.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const a=n,c=as({},e),u=__(n,t);c.__root=u||s;const d=dp(c);return a.__composerExtend&&(d[Ra]=a.__composerExtend(d)),V1()&&K1(()=>{const h=d[Ra];h&&(h(),delete d[Ra])}),d}const r=n;let l=r.__getInstance(t);if(l==null){const a=as({},e);"__i18n"in o&&(a.__i18n=o.__i18n),s&&(a.__root=s),l=dp(a),r.__composerExtend&&(l[Ra]=r.__composerExtend(l)),u5(r,t,l),r.__setInstance(t,l)}return l}function i5(e,t){const n=$E(),s=__VUE_I18N_LEGACY_API__&&t?n.run(()=>Vv(e)):n.run(()=>dp(e));if(s==null)throw po(Qs.UNEXPECTED_ERROR);return[n,s]}function r5(e){const t=Ut(e.isCE?s5:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw po(e.isCE?Qs.NOT_INSTALLED_WITH_PROVIDE:Qs.UNEXPECTED_ERROR);return t}function l5(e,t){return dh(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function a5(e){return e.mode==="composition"?e.global:e.global.__composer}function __(e,t,n=!1){let s=null;const o=t.root;let i=c5(t,n);for(;i!=null;){const r=e;if(e.mode==="composition")s=r.__getInstance(i);else if(__VUE_I18N_LEGACY_API__){const l=r.__getInstance(i);l!=null&&(s=l.__composer,n&&s&&!s[hA]&&(s=null))}if(s!=null||o===i)break;i=i.parent}return s}function c5(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function u5(e,t,n){hn(()=>{},t),kn(()=>{const s=n;e.__deleteInstance(t);const o=s[Ra];o&&(o(),delete s[Ra])},t)}const d5=["locale","fallbackLocale","availableLocales"],w_=["t","rt","d","n","tm","te"];function f5(e,t){const n=Object.create(null);return d5.forEach(o=>{const i=Object.getOwnPropertyDescriptor(t,o);if(!i)throw po(Qs.UNEXPECTED_ERROR);const r=es(i.value)?{get(){return i.value.value},set(l){i.value.value=l}}:{get(){return i.get&&i.get()}};Object.defineProperty(n,o,r)}),e.config.globalProperties.$i18n=n,w_.forEach(o=>{const i=Object.getOwnPropertyDescriptor(t,o);if(!i||!i.value)throw po(Qs.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${o}`,i)}),()=>{delete e.config.globalProperties.$i18n,w_.forEach(o=>{delete e.config.globalProperties[`$${o}`]})}}const p5=je({name:"i18n-d",props:as({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},b0),setup(e,t){const n=e.i18n||It({useScope:e.scope,__useComponent:!0});return yA(e,t,cA,(...s)=>n[qv](...s))}}),S_=p5;jN();CN(iN);xN(_N);AN(Fv);if(__INTLIFY_PROD_DEVTOOLS__){const e=Pl();e.__INTLIFY__=!0,rN(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const h5="modulepreload",m5=function(e){return"/"+e},C_={},Xs=function(t,n,s){let o=Promise.resolve();if(n&&n.length>0){let r=function(c){return Promise.all(c.map(u=>Promise.resolve(u).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),a=l?.nonce||l?.getAttribute("nonce");o=r(n.map(c=>{if(c=m5(c),c in C_)return;C_[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const p=document.createElement("link");if(p.rel=u?"stylesheet":h5,u||(p.as="script"),p.crossOrigin="",p.href=c,a&&p.setAttribute("nonce",a),document.head.appendChild(p),u)return new Promise((h,f)=>{p.addEventListener("load",h),p.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(r){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=r,window.dispatchEvent(l),!l.defaultPrevented)throw r}return o.then(r=>{for(const l of r||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})},Et={permission:"king-web.permission",activeWorkspace:"blun-active-workspace",thinking:"king-web.thinking",planMode:"king-web.plan-mode",swarmMode:"king-web.swarm-mode",goalMode:"king-web.goal-mode",uiFontSize:"king-web.ui-font-size",starredModels:"king-web.starred-models",unread:"king-web.unread",onboarded:"king-web.onboarded",accent:"king-web.accent",colorScheme:"king-web.color-scheme",hiddenWorkspaces:"king-web.hidden-workspaces",collapsedWorkspaces:"king-web.collapsed-workspaces",showWorkspacePaths:"king-web.show-workspace-paths",workspaceOrder:"king-web.workspace-order",workspaceNameOverrides:"king-web.workspace-name-overrides",workspaceSort:"king-web.workspace-sort",conversationToc:"king-web.beta-toc",notifyOnComplete:"king-web.notify-on-complete",notifyOnQuestion:"king-web.notify-on-question",soundOnComplete:"king-web.sound-on-complete",inputHistory:"king-web.input-history",locale:"blun-locale",clientId:"king-web.client-id",debug:"king-web.debug",openInLastTarget:"king-web.open-in.last-target",sidebarCollapsed:"king-web.sidebar-collapsed",sidebarWidth:"king-web.sidebar-width",codeFont:"king-web.code-font",contentAlign:"king-web.content-align",theme:"king-web.theme"};function x_(e){return`king-web.draft.${e&&e.length>0?e:"__new__"}`}function Qn(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function ts(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function cc(e){try{globalThis.localStorage.removeItem(e)}catch{}}function od(e){const t=Qn(e);if(t===null)return null;try{return JSON.parse(t)}catch{return null}}function yc(e,t){try{globalThis.localStorage.setItem(e,JSON.stringify(t))}catch{}}function _0(){const e=Qn(Et.unread);if(!e)return{};try{const t=JSON.parse(e);if(!t||typeof t!="object")return{};const n={};for(const[s,o]of Object.entries(t))o===!0&&(n[s]=!0);return n}catch{return{}}}function w0(e){const n={..._0()};for(const[s,o]of Object.entries(e))o?n[s]=!0:delete n[s];ts(Et.unread,JSON.stringify(n))}function g5(){const e=od(Et.collapsedWorkspaces);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function sg(e){yc(Et.collapsedWorkspaces,Array.from(e))}function v5(){return od(Et.showWorkspacePaths)===!0}function y5(e){yc(Et.showWorkspacePaths,e)}function k5(){const e=od(Et.workspaceOrder);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function kA(e){yc(Et.workspaceOrder,Array.from(e))}function Zd(){const e=od(Et.workspaceNameOverrides);if(!e||typeof e!="object")return{};const t={};for(const[n,s]of Object.entries(e))typeof s=="string"&&(t[n]=s);return t}function A_(e){yc(Et.workspaceNameOverrides,e)}function b5(){return Qn(Et.workspaceSort)}function bA(e){ts(Et.workspaceSort,e)}const T_=Et.clientId,_5="blun-web",w5="web";function S5(){return{serverHttpUrl:x5(),clientId:E5(),clientName:_5,clientVersion:I5(),clientUiMode:w5}}function C5(){return typeof window<"u"&&window.location?.origin?window.location.origin:"http://127.0.0.1:58627"}function x5(e){const t=C5(),n=new URL(t);return n.pathname=n.pathname.replace(/\/v1\/?$/,"").replace(/\/$/,""),n.search="",n.hash="",n.toString().replace(/\/$/,"")}function A5(e){return e.replace(/^https?:\/\//,"").replace(/\/$/,"")}function T5(){const e=typeof window<"u"&&window.location?.origin?window.location.origin:"";return A5(e)}function cu(e,t){return`${e}/api/v1${t.startsWith("/")?t:`/${t}`}`}function M5(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 E5(){const e=Qn(T_);if(e)return e;const t=`web_${globalThis.crypto?.randomUUID?.()||Math.random().toString(36).slice(2)}`;return ts(T_,t),t}function I5(){return"0.1.2".trim()?"0.1.2":"0.0.0-dev"}async function zs(e){const t=typeof navigator<"u"?navigator.clipboard:void 0;if(t&&typeof t.writeText=="function")try{return await t.writeText(e),!0}catch{}return $5(e)}function $5(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 N5(e,t){if(e.length===0)return null;const n=new Set(e),s=t.filter(i=>n.has(i)),o=e.filter(i=>!t.includes(i));return o.length===0&&s.length===t.length?null:[...o,...s]}function L5(e,t){const n=new Map(t.map((s,o)=>[s,o]));return e.toSorted((s,o)=>(n.get(s.id)??-1)-(n.get(o.id)??-1))}function O5(e,t,n,s="before"){const o=e.indexOf(t),i=e.indexOf(n);if(o===-1||i===-1||o===i)return e;const r=[...e];r.splice(o,1);const l=o<i?i-1:i,a=s==="before"?l:l+1;return r.splice(a,0,t),r}function P5(e,t){return e.toSorted((n,s)=>(t.get(s.id)??Number.NEGATIVE_INFINITY)-(t.get(n.id)??Number.NEGATIVE_INFINITY))}const R5={"&":"&","<":"<",">":">",'"':""","'":"'"};function M_(e){return e.replace(/[&<>"']/g,t=>R5[t]??t)}function D5(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function B5(e,t,n=40){const s=e.replace(/\s+/g," ").trim();if(s.length===0)return"";const o=t.trim();if(o.length===0)return E_(s,n*2);const i=s.toLowerCase().indexOf(o.toLowerCase());if(i<0)return E_(s,n*2);const r=Math.max(0,i-n),l=Math.min(s.length,i+o.length+n),a=r>0,c=l<s.length;return`${a?"…":""}${s.slice(r,l)}${c?"…":""}`}function E_(e,t){return e.length<=t?e:`${e.slice(0,t)}…`}function og(e,t){const n=M_(e),s=t.trim();if(s.length===0)return n;const o=new RegExp(D5(M_(s)),"gi");return n.replace(o,i=>`<mark>${i}</mark>`)}const Ea=Z(0),F5=["type","disabled","aria-label"],H5=je({__name:"IconButton",props:{size:{default:"md"},disabled:{type:Boolean},label:{},type:{default:"button"}},setup(e,{expose:t}){const n=Z();return t({el:n}),(s,o)=>(w(),N("button",{ref_key:"el",ref:n,class:Re(["ui-icon-button",`ui-icon-button--${e.size}`]),type:e.type,disabled:e.disabled,"aria-label":e.label},[Cn(s.$slots,"default",{},void 0,!0)],10,F5))}}),ut=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},gn=ut(H5,[["__scopeId","data-v-7f663277"]]),W5=Object.freeze({left:0,top:0,width:16,height:16}),_A=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),wA=Object.freeze({...W5,..._A}),she=Object.freeze({...wA,body:"",hidden:!1}),z5=Object.freeze({width:null,height:null}),U5=Object.freeze({...z5,..._A}),q5=/(-?[0-9.]*[0-9]+[0-9.]*)/g,j5=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function I_(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const s=e.split(q5);if(s===null||!s.length)return e;const o=[];let i=s.shift(),r=j5.test(i);for(;;){if(r){const l=parseFloat(i);isNaN(l)?o.push(i):o.push(Math.ceil(l*t*n)/n)}else o.push(i);if(i=s.shift(),i===void 0)return o.join("");r=!r}}function V5(e,t="defs"){let n="";const s=e.indexOf("<"+t);for(;s>=0;){const o=e.indexOf(">",s),i=e.indexOf("</"+t);if(o===-1||i===-1)break;const r=e.indexOf(">",i);if(r===-1)break;n+=e.slice(o+1,i).trim(),e=e.slice(0,s).trim()+e.slice(r+1)}return{defs:n,content:e}}function K5(e,t){return e?"<defs>"+e+"</defs>"+t:t}function G5(e,t,n){const s=V5(e);return K5(s.defs,t+s.content+n)}const Y5=e=>e==="unset"||e==="undefined"||e==="none";function X5(e,t){const n={...wA,...e},s={...U5,...t},o={left:n.left,top:n.top,width:n.width,height:n.height};let i=n.body;[n,s].forEach(m=>{const b=[],_=m.hFlip,g=m.vFlip;let v=m.rotate;_?g?v+=2:(b.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),b.push("scale(-1 1)"),o.top=o.left=0):g&&(b.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),b.push("scale(1 -1)"),o.top=o.left=0);let y;switch(v<0&&(v-=Math.floor(v/4)*4),v=v%4,v){case 1:y=o.height/2+o.top,b.unshift("rotate(90 "+y.toString()+" "+y.toString()+")");break;case 2:b.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:y=o.width/2+o.left,b.unshift("rotate(-90 "+y.toString()+" "+y.toString()+")");break}v%2===1&&(o.left!==o.top&&(y=o.left,o.left=o.top,o.top=y),o.width!==o.height&&(y=o.width,o.width=o.height,o.height=y)),b.length&&(i=G5(i,'<g transform="'+b.join(" ")+'">',"</g>"))});const r=s.width,l=s.height,a=o.width,c=o.height;let u,d;r===null?(d=l===null?"1em":l==="auto"?c:l,u=I_(d,a/c)):(u=r==="auto"?a:r,d=l===null?I_(u,c/a):l==="auto"?c:l);const p={},h=(m,b)=>{Y5(b)||(p[m]=b.toString())};h("width",u),h("height",d);const f=[o.left,o.top,a,c];return p.viewBox=f.join(" "),{attributes:p,viewBox:f,body:i}}const SA={plus:{body:'<path fill="currentColor" d="M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"/>',width:24,height:24},"chat-new":{body:'<path fill="currentColor" d="M14 3v2H4v13.385L5.763 17H20v-7h2v8a1 1 0 0 1-1 1H6.455L2 22.5V4a1 1 0 0 1 1-1zm5 0V0h2v3h3v2h-3v3h-2V5h-3V3z"/>',width:24,height:24},close:{body:'<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"/>',width:24,height:24},check:{body:'<path fill="currentColor" d="m10 15.17l9.192-9.191l1.414 1.414L10 17.999l-6.364-6.364l1.414-1.414z"/>',width:24,height:24},search:{body:'<path fill="currentColor" d="m18.031 16.617l4.283 4.282l-1.415 1.415l-4.282-4.283A8.96 8.96 0 0 1 11 20c-4.968 0-9-4.032-9-9s4.032-9 9-9s9 4.032 9 9a8.96 8.96 0 0 1-1.969 5.617m-2.006-.742A6.98 6.98 0 0 0 18 11c0-3.867-3.133-7-7-7s-7 3.133-7 7s3.133 7 7 7a6.98 6.98 0 0 0 4.875-1.975z"/>',width:24,height:24},copy:{body:'<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"/>',width:24,height:24},link:{body:'<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"/>',width:24,height:24},"external-link":{body:'<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"/>',width:24,height:24},download:{body:'<path fill="currentColor" d="M3 19h18v2H3zm10-5.828L19.071 7.1l1.414 1.414L12 17L3.515 8.515L4.929 7.1L11 13.173V2h2z"/>',width:24,height:24},undo:{body:'<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"/>',width:24,height:24},send:{body:'<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"/>',width:24,height:24},image:{body:'<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"/>',width:24,height:24},settings:{body:'<path fill="currentColor" d="M3.34 17a10 10 0 0 1-.979-2.326a3 3 0 0 0 .003-5.347a10 10 0 0 1 2.5-4.337a3 3 0 0 0 4.632-2.674a10 10 0 0 1 5.007.003a3 3 0 0 0 4.632 2.671a10.06 10.06 0 0 1 2.503 4.336a3 3 0 0 0-.002 5.347a10 10 0 0 1-2.501 4.337a3 3 0 0 0-4.632 2.674a10 10 0 0 1-5.007-.002a3 3 0 0 0-4.631-2.672A10 10 0 0 1 3.339 17m5.66.196a5 5 0 0 1 2.25 2.77q.75.07 1.499.002a5 5 0 0 1 2.25-2.772a5 5 0 0 1 3.526-.564q.435-.614.748-1.298A5 5 0 0 1 18 12c0-1.26.47-2.437 1.273-3.334a8 8 0 0 0-.75-1.298A5 5 0 0 1 15 6.804a5 5 0 0 1-2.25-2.77q-.75-.071-1.5-.001A5 5 0 0 1 9 6.804a5 5 0 0 1-3.526.564q-.436.614-.747 1.298A5 5 0 0 1 6 12c0 1.26-.471 2.437-1.273 3.334a8 8 0 0 0 .75 1.298A5 5 0 0 1 9 17.196M12 15a3 3 0 1 1 0-6a3 3 0 0 1 0 6m0-2a1 1 0 1 0 0-2a1 1 0 0 0 0 2"/>',width:24,height:24},sliders:{body:'<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"/>',width:24,height:24},"log-in":{body:'<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"/>',width:24,height:24},"chevron-down":{body:'<path fill="currentColor" d="m12 13.171l4.95-4.95l1.414 1.415L12 16L5.636 9.636L7.05 8.222z"/>',width:24,height:24},"chevron-right":{body:'<path fill="currentColor" d="m13.172 12l-4.95-4.95l1.414-1.413L16 12l-6.364 6.364l-1.414-1.415z"/>',width:24,height:24},"arrow-up":{body:'<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"/>',width:24,height:24},"arrow-down":{body:'<path fill="currentColor" d="m13 16.172l5.364-5.364l1.414 1.414L12 20l-7.778-7.778l1.414-1.414L11 16.172V4h2z"/>',width:24,height:24},"arrow-right":{body:'<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"/>',width:24,height:24},minus:{body:'<path fill="currentColor" d="M5 11v2h14v-2z"/>',width:24,height:24},"panel-collapse":{body:'<path fill="currentColor" d="m15.071 4.929l1.414 1.414L11.83 11H21v2h-9.17l4.656 4.657l-1.414 1.414L8.001 12zm-11.07 14.07V5h2v14z"/>',width:24,height:24},"panel-expand":{body:'<path fill="currentColor" d="m17.172 11l-4.657-4.657l1.414-1.414L21 12l-7.071 7.071l-1.414-1.414L17.172 13H8v-2zM4 19V5h2v14z"/>',width:24,height:24},expand:{body:'<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"/>',width:24,height:24},collapse:{body:'<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"/>',width:24,height:24},list:{body:'<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"/>',width:24,height:24},sort:{body:'<path fill="currentColor" d="M20 4v12h3l-4 5l-4-5h3V4zm-8 14v2H3v-2zm2-7v2H3v-2zm0-7v2H3V4z"/>',width:24,height:24},grip:{body:'<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"/>',width:24,height:24},folder:{body:'<path fill="currentColor" d="M3 21a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414l2 2H20a1 1 0 0 1 1 1v3h-2V7h-7.414l-2-2H4v11.998L5.5 11h17l-2.31 9.243a1 1 0 0 1-.97.757zm16.938-8H7.062l-1.5 6h12.876z"/>',width:24,height:24},"folder-closed":{body:'<path fill="currentColor" d="M4 5v14h16V7h-8.414l-2-2zm8.414 0H21a1 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"/>',width:24,height:24},"folder-plus":{body:'<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"/>',width:24,height:24},"folder-solid":{body:'<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"/>',width:24,height:24},file:{body:'<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"/>',width:24,height:24},"file-text":{body:'<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"/>',width:24,height:24},"file-plus":{body:'<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"/>',width:24,height:24},"file-off":{body:'<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"/>',width:24,height:24},"image-off":{body:'<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"/>',width:24,height:24},code:{body:'<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"/>',width:24,height:24},terminal:{body:'<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"/>',width:24,height:24},pencil:{body:'<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"/>',width:24,height:24},glob:{body:'<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"/>',width:24,height:24},globe:{body:'<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"/>',width:24,height:24},"check-list":{body:'<path fill="currentColor" d="M8 4h13v2H8zm-5-.5h3v3H3zm0 7h3v3H3zm0 7h3v3H3zM8 11h13v2H8zm0 7h13v2H8z"/>',width:24,height:24},bolt:{body:'<path fill="currentColor" d="M13 9h8L11 24v-9H4l9-15zm-2 2V7.22L7.532 13H13v4.394L17.263 11z"/>',width:24,height:24},"git-pull-request":{body:'<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"/>',width:24,height:24},message:{body:'<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"/>',width:24,height:24},mail:{body:'<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"/>',width:24,height:24},user:{body:'<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"/>',width:24,height:24},info:{body:'<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"/>',width:24,height:24},"help-circle":{body:'<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"/>',width:24,height:24},"alert-triangle":{body:'<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"/>',width:24,height:24},clock:{body:'<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"/>',width:24,height:24},sparkles:{body:'<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"/>',width:24,height:24},play:{body:'<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"/>',width:24,height:24},stop:{body:'<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"/>',width:24,height:24},star:{body:'<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"/>',width:24,height:24},"star-outline":{body:'<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"/>',width:24,height:24},"dots-horizontal":{body:'<path fill="currentColor" d="M4.5 10.5c-.825 0-1.5.675-1.5 1.5s.675 1.5 1.5 1.5S6 12.825 6 12s-.675-1.5-1.5-1.5m15 0c-.825 0-1.5.675-1.5 1.5s.675 1.5 1.5 1.5S21 12.825 21 12s-.675-1.5-1.5-1.5m-7.5 0c-.825 0-1.5.675-1.5 1.5s.675 1.5 1.5 1.5s1.5-.675 1.5-1.5s-.675-1.5-1.5-1.5"/>',width:24,height:24}},CA={sm:14,md:16,lg:20};function Q5(e){return`0 0 ${e.width??24} ${e.height??24}`}const Z5=Object.fromEntries(Object.entries(SA).map(([e,t])=>[e,{body:t.body,viewBox:Q5(t),fill:!0}]));function J5(e){return Z5[e]}function Ia(e,t="md"){const n=CA[t],s=X5(SA[e],{width:n,height:n}),o=s.attributes.viewBox;return`<svg class="kw-icon" width="${n}" height="${n}" viewBox="${o}" fill="currentColor" aria-hidden="true" xmlns="http://www.w3.org/2000/svg">${s.body}</svg>`}const eL=["width","height","viewBox","aria-label","aria-hidden","innerHTML"],tL=["width","height","viewBox","aria-label","aria-hidden","innerHTML"],Je=je({__name:"Icon",props:{name:{},size:{default:"md"},label:{}},setup(e){const t=e,n=F(()=>J5(t.name)),s=F(()=>CA[t.size]),o=F(()=>n.value.viewBox??"0 0 16 16");return(i,r)=>n.value.fill?(w(),N("svg",{key:0,class:"kw-icon",width:s.value,height:s.value,viewBox:o.value,fill:"currentColor","aria-label":e.label,"aria-hidden":e.label?void 0:!0,xmlns:"http://www.w3.org/2000/svg",innerHTML:n.value.body},null,8,eL)):(w(),N("svg",{key:1,class:"kw-icon",width:s.value,height:s.value,viewBox:o.value,fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-label":e.label,"aria-hidden":e.label?void 0:!0,xmlns:"http://www.w3.org/2000/svg",innerHTML:n.value.body},null,8,tL))}}),nL={key:0,class:"ui-dialog__head"},sL={class:"ui-dialog__titles"},oL={key:0,class:"ui-dialog__title"},iL={key:1,class:"ui-dialog__desc"},rL={class:"ui-dialog__body"},lL={key:1,class:"ui-dialog__foot"},aL='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])',cL=je({__name:"Dialog",props:{open:{type:Boolean},title:{},description:{},closeOnOverlay:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0},size:{default:"md"},height:{default:"auto"},padded:{type:Boolean,default:!0}},emits:["update:open","close"],setup(e,{emit:t}){const n=e,s=t,o=Z(null);let i=null;function r(){s("update:open",!1),s("close")}function l(){return o.value?Array.from(o.value.querySelectorAll(aL)):[]}function a(u){if(!n.open)return;if(u.key==="Escape"&&n.closeOnEsc){u.preventDefault(),r();return}if(u.key!=="Tab")return;const d=l(),p=d[0],h=d[d.length-1];if(!p||!h){u.preventDefault(),o.value?.focus();return}const f=document.activeElement;u.shiftKey&&f===p?(u.preventDefault(),h.focus()):!u.shiftKey&&f===h&&(u.preventDefault(),p.focus())}function c(u){n.closeOnOverlay&&u.target===u.currentTarget&&r()}return Ke(()=>n.open,async u=>{u?(Ea.value+=1,i=document.activeElement,await ht(),(l()[0]??o.value)?.focus()):(Ea.value=Math.max(0,Ea.value-1),i instanceof HTMLElement&&(i.focus(),i=null))},{immediate:!0}),typeof window<"u"&&window.addEventListener("keydown",a),ls(()=>{typeof window<"u"&&window.removeEventListener("keydown",a),n.open&&(Ea.value=Math.max(0,Ea.value-1))}),(u,d)=>(w(),ve(lh,{to:"body"},[e.open?(w(),N("div",{key:0,class:"ui-dialog__overlay",onMousedown:c},[T("div",{ref_key:"panel",ref:o,class:Re(["ui-dialog",[`ui-dialog--${e.size}`,{"ui-dialog--flush":!e.padded,"ui-dialog--fixed-height":e.height==="fixed"}]]),role:"dialog","aria-modal":"true",tabindex:"-1"},[e.title||u.$slots.head?(w(),N("div",nL,[Cn(u.$slots,"head",{},()=>[T("div",sL,[e.title?(w(),N("div",oL,R(e.title),1)):ie("",!0),e.description?(w(),N("div",iL,R(e.description),1)):ie("",!0)])],!0),oe(gn,{class:"ui-dialog__close",size:"sm",label:"Close",onClick:r},{default:_e(()=>[oe(Je,{name:"close",size:"md"})]),_:1})])):ie("",!0),T("div",rL,[Cn(u.$slots,"default",{},void 0,!0)]),u.$slots.foot?(w(),N("div",lL,[Cn(u.$slots,"foot",{},void 0,!0)])):ie("",!0)],2)],32)):ie("",!0)]))}}),ar=ut(cL,[["__scopeId","data-v-ff901247"]]),uL={class:"sd-head"},dL=["placeholder","aria-label"],fL=["aria-selected","onClick","onMousemove"],pL={class:"sd-meta"},hL=["innerHTML"],mL={class:"sd-time"},gL=["innerHTML"],vL=["innerHTML"],yL={key:1,class:"sd-empty"},kL={class:"sd-hint"},bL=200,_L=je({__name:"SearchSessionsDialog",props:{sessions:{},activeId:{}},emits:["select","close"],setup(e,{emit:t}){const{t:n}=It(),s=e,o=t,i=Z(!0),r=Z(""),l=Z(null),a=Z(null),c=F(()=>{const _=r.value.trim().toLowerCase(),g=[];for(const v of s.sessions){const y=v.title??"",A=v.lastPrompt??"",O=v.workspaceName??"",$=_.length>0&&y.toLowerCase().includes(_),k=_.length>0&&A.toLowerCase().includes(_),E=_.length>0&&O.toLowerCase().includes(_);if(!(_.length>0&&!$&&!k&&!E)&&(g.push({session:v,inTitle:$,inWorkspace:E,snippetText:A?B5(A,r.value):""}),g.length>=bL))break}return g}),u=Z(0);Ke(r,()=>{u.value=0});function d(_){const g=c.value.length;return g===0?0:Math.max(0,Math.min(g-1,_))}async function p(){await ht(),a.value?.querySelector('[aria-selected="true"]')?.scrollIntoView({block:"nearest"})}function h(_){u.value=d(u.value+_),p()}function f(_){o("select",_),o("close")}function m(){const _=c.value[u.value];_&&f(_.session.id)}function b(_){_.key==="ArrowDown"?(_.preventDefault(),h(1)):_.key==="ArrowUp"?(_.preventDefault(),h(-1)):_.key==="Enter"&&(_.preventDefault(),m())}return hn(()=>{l.value?.focus()}),(_,g)=>(w(),ve(ar,{open:i.value,"onUpdate:open":g[1]||(g[1]=v=>i.value=v),size:"lg",height:"fixed",padded:!1,onClose:g[2]||(g[2]=v=>o("close"))},{head:_e(()=>[T("div",uL,[oe(Je,{class:"sd-search-icon",name:"search",size:"md"}),Mn(T("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":g[0]||(g[0]=v=>r.value=v),class:"sd-input",type:"text",placeholder:x(n)("sidebar.searchPlaceholder"),"aria-label":x(n)("sidebar.searchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:b},null,40,dL),[[ko,r.value]])])]),foot:_e(()=>[T("span",kL,R(x(n)("sidebar.searchHint")),1)]),default:_e(()=>[T("div",{ref_key:"listRef",ref:a,class:"sd-list",role:"listbox"},[c.value.length>0?(w(!0),N(Le,{key:0},nt(c.value,(v,y)=>(w(),N("button",{key:v.session.id,class:Re(["sd-row",{on:y===u.value,active:v.session.id===e.activeId}]),role:"option","aria-selected":y===u.value,onClick:A=>f(v.session.id),onMousemove:A=>u.value=y},[T("span",pL,[oe(Je,{class:"sd-folder",name:"folder-closed",size:"sm"}),T("span",{class:"sd-ws",innerHTML:x(og)(v.session.workspaceName??v.session.workspaceId??"",v.inWorkspace?r.value:"")},null,8,hL),T("span",mL,R(v.session.time),1)]),T("span",{class:"sd-title",innerHTML:x(og)(v.session.title,v.inTitle?r.value:"")},null,8,gL),v.snippetText?(w(),N("span",{key:0,class:"sd-snippet",innerHTML:x(og)(v.snippetText,r.value)},null,8,vL)):ie("",!0)],42,fL))),128)):(w(),N("div",yL,R(x(n)("sidebar.searchNoResults")),1))],512)]),_:1},8,["open"]))}}),wL=ut(_L,[["__scopeId","data-v-3d40bf5d"]]),SL=["aria-label"],CL=je({__name:"Spinner",props:{size:{default:"md"},label:{default:"Loading"}},setup(e){return(t,n)=>(w(),N("span",{class:Re(["ui-spinner",`ui-spinner--${e.size}`]),role:"status","aria-label":e.label},[...n[0]||(n[0]=[T("svg",{class:"ui-spinner__svg",viewBox:"0 0 24 24","aria-hidden":"true"},[T("circle",{class:"ui-spinner__track",cx:"12",cy:"12",r:"9"}),T("circle",{class:"ui-spinner__arc",cx:"12",cy:"12",r:"9"})],-1)])],10,SL))}}),ni=ut(CL,[["__scopeId","data-v-5ec07fd2"]]),xL={key:0,class:"ui-badge__dot","aria-hidden":"true"},AL=je({__name:"Badge",props:{variant:{default:"neutral"},size:{default:"md"},dot:{type:Boolean}},setup(e){return(t,n)=>(w(),N("span",{class:Re(["ui-badge",[`ui-badge--${e.variant}`,`ui-badge--${e.size}`]])},[e.dot?(w(),N("span",xL)):ie("",!0),Cn(t.$slots,"default",{},void 0,!0)],2))}}),Is=ut(AL,[["__scopeId","data-v-13972d72"]]),Du=Z(null);function xA(e){const t=Du.value;t&&(Du.value=null,t.resolve(e))}function TL(e){return Du.value&&xA(!1),new Promise(t=>{Du.value={...e,resolve:t}})}function ol(){return{current:Du,confirm:TL,settle:xA}}const ML=je({__name:"Menu",setup(e,{expose:t}){const n=Z();return t({el:n}),(s,o)=>(w(),N("div",{ref_key:"el",ref:n,class:"ui-menu",role:"menu"},[Cn(s.$slots,"default",{},void 0,!0)],512))}}),Wl=ut(ML,[["__scopeId","data-v-3197b239"]]),EL={key:0,class:"ui-menu-sep",role:"separator"},IL=["disabled"],$L=je({__name:"MenuItem",props:{active:{type:Boolean},danger:{type:Boolean},disabled:{type:Boolean},separator:{type:Boolean},size:{default:"md"}},emits:["click"],setup(e){return(t,n)=>e.separator?(w(),N("div",EL)):(w(),N("button",{key:1,class:Re(["ui-menu-item",[`ui-menu-item--${e.size}`,{"is-active":e.active,"is-danger":e.danger}]]),type:"button",role:"menuitem",disabled:e.disabled,onClick:n[0]||(n[0]=s=>t.$emit("click",s))},[Cn(t.$slots,"default",{},void 0,!0)],10,IL))}}),fn=ut($L,[["__scopeId","data-v-55ca4d76"]]),kr=6,br=8,NL=150,LL=je({__name:"Tooltip",props:{text:{},placement:{default:"top"},maxWidth:{default:280},maxLines:{default:6}},setup(e){const t=e,n=Z(),s=Z(),o=Z(!1),i=Z(!1),r=Z({maxWidth:`${t.maxWidth}px`});let l,a=null,c;function u(){const m=s.value;if(!a||!m)return;const b=a.getBoundingClientRect(),_=m.offsetWidth,g=m.offsetHeight,v=window.innerWidth,y=window.innerHeight;let A=t.placement;A==="top"&&b.top-kr-g<br?A="bottom":A==="bottom"&&b.bottom+kr+g>y-br?A="top":A==="left"&&b.left-kr-_<br?A="right":A==="right"&&b.right+kr+_>v-br&&(A="left");let O=0,$=0;A==="top"?(O=b.top-kr-g,$=b.left+b.width/2-_/2):A==="bottom"?(O=b.bottom+kr,$=b.left+b.width/2-_/2):A==="left"?(O=b.top+b.height/2-g/2,$=b.left-kr-_):(O=b.top+b.height/2-g/2,$=b.right+kr),$=Math.min(Math.max($,br),v-br-_),O=Math.min(Math.max(O,br),y-br-g),r.value={maxWidth:`${t.maxWidth}px`,top:`${Math.round(O)}px`,left:`${Math.round($)}px`}}function d(){t.text&&(window.clearTimeout(l),l=window.setTimeout(()=>{o.value=!0,i.value=!1,ht(()=>{u(),i.value=!0})},NL))}function p(){window.clearTimeout(l),o.value=!1,i.value=!1}function h(){o.value&&p()}function f(m){m!==a&&(a&&(a.removeEventListener("mouseenter",d),a.removeEventListener("mouseleave",p),a.removeEventListener("focusin",d),a.removeEventListener("focusout",p)),a=m,a&&(a.addEventListener("mouseenter",d),a.addEventListener("mouseleave",p),a.addEventListener("focusin",d),a.addEventListener("focusout",p)))}return hn(()=>{const m=n.value??null;f(m?.firstElementChild??m),m&&(c=new MutationObserver(()=>{const b=m.firstElementChild??null;b!==a&&(p(),f(b??m))}),c.observe(m,{childList:!0})),window.addEventListener("scroll",h,!0),window.addEventListener("resize",h)}),ls(()=>{window.clearTimeout(l),c?.disconnect(),f(null),window.removeEventListener("scroll",h,!0),window.removeEventListener("resize",h)}),(m,b)=>(w(),N(Le,null,[T("span",{ref_key:"trigger",ref:n,class:"ui-tip"},[Cn(m.$slots,"default",{},void 0,!0)],512),(w(),ve(lh,{to:"body"},[Mn(T("div",{ref_key:"bubble",ref:s,class:Re(["ui-tip__bubble",{positioned:i.value}]),style:Gt([r.value,{"--tip-lines":e.maxLines}]),role:"tooltip"},R(e.text),7),[[Qo,o.value]])]))],64))}}),Ht=ut(LL,[["__scopeId","data-v-f28510a8"]]),OL={class:"row"},PL={class:"lead","aria-hidden":"true"},RL={key:1,class:"unread-dot"},DL={class:"left"},BL=["onKeydown"],FL={class:"act"},HL={class:"ts"},WL={class:"menu-time"},zL=je({__name:"SessionRow",props:{session:{},active:{type:Boolean},approvalCount:{default:0},questionCount:{default:0},unread:{type:Boolean,default:!1}},emits:["select","rename","archive","fork"],setup(e,{expose:t,emit:n}){const{t:s}=It(),{confirm:o}=ol(),i=e,r=n;function l(S){const I=new Date(S);if(Number.isNaN(I.getTime()))return S;const P=D=>String(D).padStart(2,"0");return`${I.getFullYear()}-${P(I.getMonth()+1)}-${P(I.getDate())} ${P(I.getHours())}:${P(I.getMinutes())}`}const a=F(()=>i.session.updatedAt?l(i.session.updatedAt):i.session.time),c=Z(!1),u=Z(null),d=Z(null),p=Z({});function h(S){const I=S.target;d.value?.el?.contains(I)||u.value?.el?.contains(I)||b()}function f(){const S=u.value?.el;if(!S)return;const I=d.value?.el,P=S.getBoundingClientRect(),D=4,W=8,z=I?.offsetHeight??0,q=I?.offsetWidth??0;let Q=P.bottom+D;Q+z>window.innerHeight-W&&(Q=Math.max(W,P.top-z-D));let X=P.right-q;X<W&&(X=W),p.value={top:`${Math.round(Q)}px`,left:`${Math.round(X)}px`}}async function m(S){if(S.stopPropagation(),c.value){b();return}c.value=!0,setTimeout(()=>document.addEventListener("mousedown",h),0),window.addEventListener("resize",b),await ht(),f()}function b(){c.value=!1,document.removeEventListener("mousedown",h),window.removeEventListener("resize",b)}kn(()=>{document.removeEventListener("mousedown",h),window.removeEventListener("resize",b)});const _=Z(!1),g=Z(""),v=Z(null);async function y(){b(),_.value=!0,g.value=i.session.title,await ht();try{v.value?.focus(),v.value?.select()}catch{}}function A(){const S=g.value.trim();S&&r("rename",i.session.id,S),_.value=!1}function O(){_.value=!1}const $=Z(!1),k=Z(!1);async function E(){const S=await zs(i.session.id);$.value=S,k.value=!S,setTimeout(()=>{$.value=!1,k.value=!1,b()},1500)}function M(){b(),r("fork",i.session.id)}async function L(){b(),await o({title:s("sidebar.archive"),message:s("sidebar.archiveConfirm"),variant:"danger"})&&r("archive",i.session.id)}return t({closeMenu:b}),(S,I)=>(w(),N("div",{class:Re(["se",{on:e.active}]),onClick:I[4]||(I[4]=P=>r("select",e.session.id))},[T("div",OL,[T("span",PL,[e.session.busy?(w(),ve(ni,{key:0,size:"sm"})):e.unread?(w(),N("span",RL)):ie("",!0)]),T("div",DL,[_.value?Mn((w(),N("input",{key:0,ref_key:"renameInputRef",ref:v,"onUpdate:modelValue":I[0]||(I[0]=P=>g.value=P),class:"rename-input",onClick:I[1]||(I[1]=vt(()=>{},["stop"])),onKeydown:[di(vt(A,["stop"]),["enter"]),di(vt(O,["stop"]),["esc"])],onBlur:A},null,40,BL)),[[ko,g.value]]):(w(),N("span",{key:1,class:"t",onDblclick:vt(y,["stop"])},R(e.session.title),33))]),oe(Ht,{text:x(s)("workspace.awaitingAnswerTitle")},{default:_e(()=>[!_.value&&(e.questionCount>0||e.session.status==="awaitingQuestion")?(w(),ve(Is,{key:0,variant:"info",size:"sm"},{default:_e(()=>[qe(R(x(s)("workspace.awaitingAnswer")),1)]),_:1})):ie("",!0)]),_:1},8,["text"]),oe(Ht,{text:x(s)("workspace.awaitingPermissionTitle")},{default:_e(()=>[!_.value&&(e.approvalCount>0||e.session.status==="awaitingApproval")?(w(),ve(Is,{key:0,variant:"warning",size:"sm"},{default:_e(()=>[qe(R(x(s)("workspace.awaitingPermission")),1)]),_:1})):ie("",!0)]),_:1},8,["text"]),oe(Ht,{text:x(s)("workspace.abortedTitle")},{default:_e(()=>[!_.value&&e.session.status==="aborted"?(w(),ve(Is,{key:0,variant:"danger",size:"sm"},{default:_e(()=>[qe(R(x(s)("workspace.aborted")),1)]),_:1})):ie("",!0)]),_:1},8,["text"]),T("span",FL,[T("span",HL,R(e.session.time),1),_.value?ie("",!0):(w(),ve(gn,{key:0,ref_key:"kebabRef",ref:u,class:Re(["kebab",{open:c.value}]),size:"sm",label:x(s)("sidebar.options"),onClick:I[2]||(I[2]=vt(P=>m(P),["stop"]))},{default:_e(()=>[oe(Je,{name:"dots-horizontal",size:"sm"})]),_:1},8,["class","label"]))])]),(w(),ve(lh,{to:"body"},[c.value?(w(),ve(Wl,{key:0,ref_key:"menuRef",ref:d,class:"menu",style:Gt(p.value),onClick:I[3]||(I[3]=vt(()=>{},["stop"]))},{default:_e(()=>[oe(fn,{danger:k.value,onClick:E},{default:_e(()=>[qe(R(k.value?x(s)("sidebar.copyFailed"):$.value?x(s)("sidebar.copied"):x(s)("sidebar.copySessionId")),1)]),_:1},8,["danger"]),oe(fn,{separator:""}),oe(fn,{onClick:y},{default:_e(()=>[qe(R(x(s)("sidebar.rename")),1)]),_:1}),oe(fn,{onClick:M},{default:_e(()=>[qe(R(x(s)("sidebar.fork")),1)]),_:1}),oe(fn,{danger:"",onClick:L},{default:_e(()=>[qe(R(x(s)("sidebar.archive")),1)]),_:1}),oe(fn,{separator:""}),T("div",WL,R(a.value),1)]),_:1},8,["style"])):ie("",!0)]))],2))}}),UL=ut(zL,[["__scopeId","data-v-c08c0c63"]]),qL={class:"gh-top"},jL={key:2,class:"gh-name"},VL={class:"gh-path"},KL=["inert"],GL=["disabled"],YL={class:"show-more-label"},XL={class:"show-more-label"},QL={key:2,class:"group-empty"},ZL=je({__name:"WorkspaceGroup",props:{group:{},activeWorkspaceId:{},activeId:{},renamingId:{},renameValue:{},renameInputRef:{},pendingBySession:{},unreadBySession:{},wsMenuOpenId:{},dragging:{type:Boolean},showPath:{type:Boolean},isCollapsed:{type:Function},isExpanded:{type:Function}},emits:["groupClick","groupContextmenu","toggleWsMenu","createInWorkspace","selectSession","renameSession","archiveSession","forkSession","loadMore","toggleExpand","confirmRename","cancelRename","updateRenameValue","wsDragstart","wsDragend"],setup(e,{emit:t}){const{t:n}=It(),s=e,o=t,i=F({get:()=>s.renameValue,set:p=>o("updateRenameValue",p)}),r=F(()=>{if(s.isExpanded(s.group.workspace.id))return s.group.sessions;const p=s.group.sessions.slice(0,s.group.initialCount);if(s.activeId&&!p.some(h=>h.id===s.activeId)){const h=s.group.sessions.find(f=>f.id===s.activeId);if(h)return[...p,h]}return p}),l=F(()=>s.group.sessions.length>s.group.initialCount);function a(){return Math.max(0,s.group.workspace.sessionCount-s.group.sessions.length)}function c(){return s.group.sessions.length-s.group.initialCount}function u(p){s.renameInputRef.value=p instanceof HTMLInputElement?p:null}function d(p){p.dataTransfer&&(p.dataTransfer.effectAllowed="move",p.dataTransfer.setData("text/plain",s.group.workspace.id),o("wsDragstart",s.group.workspace.id))}return(p,h)=>(w(),N("div",{class:Re(["group",{dragging:e.dragging}])},[T("div",{class:Re(["gh",{on:e.group.workspace.id===e.activeWorkspaceId,collapsed:e.isCollapsed(e.group.workspace.id),"show-path":e.showPath}]),draggable:"true",onClick:h[7]||(h[7]=vt(f=>o("groupClick",e.group.workspace.id,f),["stop"])),onContextmenu:h[8]||(h[8]=f=>o("groupContextmenu",e.group.workspace,f)),onDragstart:d,onDragend:h[9]||(h[9]=f=>o("wsDragend"))},[T("div",qL,[e.isCollapsed(e.group.workspace.id)?(w(),ve(Je,{key:0,class:"gh-folder",name:"folder-closed",size:"sm"})):(w(),ve(Je,{key:1,class:"gh-folder",name:"folder",size:"sm"})),e.renamingId!==e.group.workspace.id?(w(),N("span",jL,R(e.group.workspace.name),1)):Mn((w(),N("input",{key:3,ref:u,"onUpdate:modelValue":h[0]||(h[0]=f=>i.value=f),class:"gh-rename",type:"text",onKeydown:[h[1]||(h[1]=di(f=>o("confirmRename"),["enter"])),h[2]||(h[2]=di(f=>o("cancelRename"),["esc"]))],onBlur:h[3]||(h[3]=f=>o("cancelRename")),onClick:h[4]||(h[4]=vt(()=>{},["stop"]))},null,544)),[[ko,i.value]]),oe(gn,{class:Re(["gh-more",{open:e.wsMenuOpenId===e.group.workspace.id}]),size:"sm",label:x(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":e.wsMenuOpenId===e.group.workspace.id,onClick:h[5]||(h[5]=vt(f=>o("toggleWsMenu",e.group.workspace,f),["stop"]))},{default:_e(()=>[oe(Je,{name:"dots-horizontal",size:"sm"})]),_:1},8,["class","label","aria-expanded"]),oe(gn,{class:"gh-add",size:"sm",label:x(n)("workspace.newInGroup"),onClick:h[6]||(h[6]=vt(f=>o("createInWorkspace",e.group.workspace.id),["stop"]))},{default:_e(()=>[oe(Je,{name:"chat-new"})]),_:1},8,["label"])]),oe(Ht,{text:e.group.workspace.root},{default:_e(()=>[T("div",VL,R(e.group.workspace.shortPath||e.group.workspace.root),1)]),_:1},8,["text"])],34),T("div",{class:Re(["group-sessions",{collapsed:e.isCollapsed(e.group.workspace.id)}]),inert:e.isCollapsed(e.group.workspace.id)},[(w(!0),N(Le,null,nt(r.value,f=>(w(),ve(UL,{key:f.id,session:f,active:f.id===e.activeId,"approval-count":e.pendingBySession[f.id]?.approvals??0,"question-count":e.pendingBySession[f.id]?.questions??0,unread:e.unreadBySession[f.id]??!1,onSelect:h[10]||(h[10]=m=>o("selectSession",m)),onRename:h[11]||(h[11]=(m,b)=>o("renameSession",m,b)),onArchive:h[12]||(h[12]=m=>o("archiveSession",m)),onFork:h[13]||(h[13]=m=>o("forkSession",m))},null,8,["session","active","approval-count","question-count","unread"]))),128)),e.group.hasMore||e.group.loadingMore?(w(),N("button",{key:0,class:"show-more",disabled:e.group.loadingMore,onClick:h[14]||(h[14]=vt(f=>o("loadMore",e.group.workspace.id),["stop"]))},[h[16]||(h[16]=T("span",{class:"show-more-lead","aria-hidden":"true"},null,-1)),T("span",YL,R(e.group.loadingMore?x(n)("sidebar.loadingMore"):x(n)("sidebar.showMore",{count:a()})),1)],8,GL)):ie("",!0),l.value?(w(),N("button",{key:1,class:"show-more",onClick:h[15]||(h[15]=vt(f=>o("toggleExpand",e.group.workspace.id),["stop"]))},[h[17]||(h[17]=T("span",{class:"show-more-lead","aria-hidden":"true"},null,-1)),T("span",XL,R(e.isExpanded(e.group.workspace.id)?x(n)("sidebar.showLess"):x(n)("sidebar.showAll",{count:c()})),1)])):ie("",!0),e.group.sessions.length===0?(w(),N("div",QL,R(x(n)("sidebar.noSessions")),1)):ie("",!0)],10,KL)],2))}}),JL=ut(ZL,[["__scopeId","data-v-cc26d012"]]),e8="blun_desktop",t8="platform",$_="king-desktop",N_="king-desktop-platform";function n8(){let e=!1,t=null;try{const n=new URLSearchParams(window.location.search);n.has(e8)?(sessionStorage.setItem($_,"1"),e=!0):e=e||sessionStorage.getItem($_)==="1";const s=n.get(t8);s?(sessionStorage.setItem(N_,s),t=s):t=sessionStorage.getItem(N_)}catch{}return{isDesktop:e,platform:t}}const Kv=n8(),s8=Kv.isDesktop,AA=Kv.isDesktop&&Kv.platform==="darwin",o8=["aria-label"],i8=je({__name:"InternalBuildBanner",setup(e){const{t}=It(),n=s8;return(s,o)=>x(n)?(w(),N("span",{key:0,class:"internal-build-tag",role:"note","aria-label":x(t)("app.internalBuildBanner")},[o[0]||(o[0]=T("svg",{viewBox:"0 0 16 16",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[T("path",{d:"M8 2 14 13H2L8 2Z"}),T("path",{d:"M8 6v3.5"}),T("path",{d:"M8 11.5h.01"})],-1)),T("span",null,R(x(t)("app.internalBuildBanner")),1)],8,o8)):ie("",!0)}}),r8=ut(i8,[["__scopeId","data-v-7ae42bde"]]),l8={class:"ch"},a8={class:"ch-brand"},c8={class:"ch-name"},u8={key:0,class:"ch-endpoint"},d8={class:"search-input"},f8={key:0,class:"empty"},p8={class:"side-section-label"},h8={class:"side-section-title"},m8={class:"side-section-actions"},g8=["onDragover","onDrop"],v8={class:"section-menu-check"},y8={class:"section-menu-check"},k8={class:"section-menu-check"},b8=1e3,_8=je({__name:"Sidebar",props:{activeWorkspace:{default:null},activeWorkspaceId:{default:null},sessions:{},groups:{},activeId:{},workspaceSortMode:{},attentionBySession:{default:()=>({})},pendingBySession:{default:()=>({})},unreadBySession:{default:()=>({})},colWidth:{default:220}},emits:["select","create","createInWorkspace","selectWorkspace","addWorkspace","rename","archive","fork","renameWorkspace","deleteWorkspace","reorderWorkspaces","setWorkspaceSortMode","loadMoreSessions","loadAllSessions","openSettings","collapse"],setup(e,{emit:t}){const{t:n}=It(),{confirm:s}=ol(),o=!1,i="",r=e,l=t,a=Z(!1);function c(){l("loadAllSessions"),a.value=!0}function u(Ge){(Ge.metaKey||Ge.ctrlKey)&&Ge.key.toLowerCase()==="k"&&(Ge.preventDefault(),c())}hn(()=>window.addEventListener("keydown",u)),ls(()=>window.removeEventListener("keydown",u));const d=Z(!1);function p(Ge){d.value=Ge.target.scrollTop>0}const h=Z(new Set(g5()));function f(Ge){return h.value.has(Ge)}function m(Ge){const Ye=new Set(h.value);Ye.has(Ge)?Ye.delete(Ge):Ye.add(Ge),h.value=Ye,sg(Ye)}function b(){const Ge=new Set(r.groups.map(Ye=>Ye.workspace.id));h.value=Ge,sg(Ge)}function _(){const Ge=new Set;h.value=Ge,sg(Ge)}const g=F(()=>r.groups.length>0&&r.groups.every(Ge=>h.value.has(Ge.workspace.id))),v=Z(new Set);function y(Ge){return v.value.has(Ge)}function A(Ge){const Ye=new Set(v.value);Ye.has(Ge)?Ye.delete(Ge):Ye.add(Ge),v.value=Ye}function O(Ge){if(!v.value.has(Ge)){const Ye=new Set(v.value);Ye.add(Ge),v.value=Ye}l("loadMoreSessions",Ge)}const $=Z(v5());function k(){$.value=!$.value,y5($.value)}const E=Z(null),M=Z(null);function L(Ge){E.value=Ge}function S(){E.value=null,M.value=null}function I(Ge){const Ye=Ge.currentTarget.getBoundingClientRect();return Ge.clientY<Ye.top+Ye.height/2?"before":"after"}function P(Ge,Ye){E.value===null||E.value===Ye||(Ge.preventDefault(),Ge.dataTransfer&&(Ge.dataTransfer.dropEffect="move"),M.value={id:Ye,position:I(Ge)})}function D(Ge){const Ye=E.value,Ct=M.value?.id===Ge?M.value.position:"before";if(M.value=null,E.value=null,!Ye||Ye===Ge)return;const $t=O5(r.groups.map(mn=>mn.workspace.id),Ye,Ge,Ct);l("reorderWorkspaces",$t)}function W(Ge,Ye){Ye.target.closest(".gh-more, .gh-add")||m(Ge)}function z(Ge){l("select",Ge)}const q=Z(null),Q=Z(""),X=Z(null);function fe(){return X}function ye(Ge,Ye){q.value=Ge,Q.value=Ye,ht().then(()=>X.value?.focus())}function Me(){const Ge=q.value,Ye=Q.value.trim();Ge&&Ye&&l("renameWorkspace",Ge,Ye),q.value=null}function we(){q.value=null}function ze(Ge){Q.value=Ge}const Ue=Z(!1),Fe=Z(null),rt=Z({}),le=Z(null);function U(Ge){le.value?.el&&!le.value.el.contains(Ge.target)&&ne()}function G(Ge,Ye){Ye.preventDefault(),Ye.stopPropagation(),Fe.value=Ge,rt.value={top:`${Ye.clientY}px`,left:`${Ye.clientX}px`},Ue.value=!0,document.addEventListener("mousedown",U,!0)}function ne(){Ue.value=!1,document.removeEventListener("mousedown",U,!0),Fe.value=null}function H(){Fe.value&&zs(Fe.value.root),ne()}function J(){Fe.value&&ye(Fe.value.id,Fe.value.name),ne()}async function ce(){const Ge=Fe.value;Ge&&(ne(),await s({title:n("sidebar.removeWorkspace"),message:n("workspace.removeWorkspaceConfirm",{name:Ge.name}),variant:"danger"})&&l("deleteWorkspace",Ge.id))}const te=Z(null),ue=Z(null),j=Z({}),Y=Z(null);function re(Ge){const Ye=Ge.target;Ye.closest(".gh-more")||Ye.closest(".ws-menu")||Ae()}async function ge(Ge,Ye){if(te.value===Ge.id){Ae();return}const Ct=Ye.currentTarget;ue.value=Ge,te.value=Ge.id,document.addEventListener("mousedown",re),window.addEventListener("resize",Ae),await ht();const $t=Y.value?.el,mn=Ct.getBoundingClientRect(),Nn=4,tn=8,Ln=$t?.offsetHeight??0,Zn=$t?.offsetWidth??0;let Mt=mn.bottom+Nn;Mt+Ln>window.innerHeight-tn&&(Mt=Math.max(tn,mn.top-Ln-Nn));let us=mn.right-Zn;us<tn&&(us=tn),j.value={top:`${Math.round(Mt)}px`,left:`${Math.round(us)}px`}}function Ae(){te.value=null,ue.value=null,document.removeEventListener("mousedown",re),window.removeEventListener("resize",Ae)}function Ie(Ge){zs(Ge.root),Ae()}function ae(Ge){ye(Ge.id,Ge.name),Ae()}async function Te(Ge){Ae(),await s({title:n("sidebar.removeWorkspace"),message:n("workspace.removeWorkspaceConfirm",{name:Ge.name}),variant:"danger"})&&l("deleteWorkspace",Ge.id)}const Ve=Z(!1),tt=Z({}),bt=Z(null);function kt(Ge){const Ye=Ge.target;Ye.closest(".side-section-kebab")||Ye.closest(".section-menu")||Pt()}async function Tt(Ge){if(Ve.value){Pt();return}const Ye=Ge.currentTarget;Ve.value=!0,document.addEventListener("mousedown",kt),window.addEventListener("resize",Pt),await ht();const Ct=bt.value?.el,$t=Ye.getBoundingClientRect(),mn=4,Nn=8,tn=Ct?.offsetHeight??0,Ln=Ct?.offsetWidth??0;let Zn=$t.bottom+mn;Zn+tn>window.innerHeight-Nn&&(Zn=Math.max(Nn,$t.top-tn-mn));let Mt=$t.right-Ln;Mt<Nn&&(Mt=Nn),tt.value={top:`${Math.round(Zn)}px`,left:`${Math.round(Mt)}px`}}function Pt(){Ve.value=!1,document.removeEventListener("mousedown",kt),window.removeEventListener("resize",Pt)}function mt(Ge){l("setWorkspaceSortMode",Ge),Pt()}function Yt(){k(),Pt()}ls(()=>{document.removeEventListener("mousedown",U,!0),document.removeEventListener("mousedown",re),document.removeEventListener("mousedown",kt),window.removeEventListener("resize",Ae),window.removeEventListener("resize",Pt)});const Rn=Z(null);let Dn;function Ft(){const Ge=Rn.value;Ge&&(Ge.classList.remove("blink-now"),Ge.getBoundingClientRect(),Ge.classList.add("blink-now"),clearTimeout(Dn),Dn=setTimeout(()=>Ge.classList.remove("blink-now"),300))}const bn=ui(()=>Xs(()=>import("./DesignSystemView-BbMOu-XO.js"),__vite__mapDeps([0,1]))),Vn=Z(!1);let st,In=!1;function _n(Ge){In=!1,clearTimeout(st),Ge.currentTarget.setPointerCapture?.(Ge.pointerId),st=setTimeout(()=>{In=!0,Vn.value=!0},b8)}function Kn(Ge){clearTimeout(st);const Ye=Ge.currentTarget;Ye.hasPointerCapture?.(Ge.pointerId)&&Ye.releasePointerCapture(Ge.pointerId)}function $n(){if(In){In=!1;return}Ft()}return ls(()=>{clearTimeout(st)}),(Ge,Ye)=>(w(),N(Le,null,[T("aside",{class:Re(["side",{"macos-desktop":x(AA)}])},[T("div",{class:"col",style:Gt({width:e.colWidth+"px"})},[T("div",l8,[T("div",a8,[(w(),N("svg",{ref_key:"logoRef",ref:Rn,class:Re(["ch-logo",{"is-dev":x(o)}]),viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"BLUN King",onClick:$n,onPointerdown:_n,onPointerup:Kn,onPointercancel:Kn},[...Ye[21]||(Ye[21]=[c0('<defs data-v-f80f56a6><mask id="blunEyes" maskUnits="userSpaceOnUse" data-v-f80f56a6><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-f80f56a6></rect><g class="ch-eyes" fill="#000" data-v-f80f56a6><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-f80f56a6></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-f80f56a6></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#blunEyes)" data-v-f80f56a6></rect>',2)])],34)),T("span",c8,[Ye[22]||(Ye[22]=qe("BLUN King",-1)),x(o)?(w(),N("span",u8," · "+R(x(i)),1)):ie("",!0)]),oe(r8)]),oe(gn,{size:"sm",label:x(n)("sidebar.collapseSidebar"),onClick:Ye[0]||(Ye[0]=vt(Ct=>l("collapse"),["stop"]))},{default:_e(()=>[oe(Je,{name:"panel-collapse"})]),_:1},8,["label"]),oe(gn,{size:"sm",label:x(n)("settings.title"),onClick:Ye[1]||(Ye[1]=vt(Ct=>l("openSettings"),["stop"]))},{default:_e(()=>[oe(Je,{name:"settings"})]),_:1},8,["label"])]),T("button",{class:"search",type:"button",onClick:c},[oe(Je,{class:"search-icon",name:"search"}),T("span",d8,R(x(n)("sidebar.searchShortcut")),1)]),T("div",{class:Re(["btn-wrap",{"btn-wrap--scrolled":d.value}])},[T("button",{class:"btn-new-chat",type:"button",onClick:Ye[2]||(Ye[2]=vt(Ct=>l("create"),["stop"]))},[oe(Je,{name:"chat-new"}),T("span",null,R(x(n)("sidebar.newChat")),1)]),ie("",!0)],2),T("div",{class:"sessions",onScroll:p},[e.groups.length===0?(w(),N("div",f8,R(x(n)("workspace.noWorkspace")),1)):(w(),N(Le,{key:1},[T("div",p8,[T("span",h8,R(x(n)("sidebar.workspaces")),1),T("div",m8,[oe(gn,{class:"side-section-toggle",size:"sm",label:g.value?x(n)("sidebar.expandAll"):x(n)("sidebar.collapseAll"),onClick:Ye[4]||(Ye[4]=vt(Ct=>g.value?_():b(),["stop"]))},{default:_e(()=>[g.value?(w(),ve(Je,{key:0,name:"expand"})):(w(),ve(Je,{key:1,name:"collapse"}))]),_:1},8,["label"]),oe(gn,{class:"side-section-toggle side-section-kebab",size:"sm",label:x(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":Ve.value,onClick:Ye[5]||(Ye[5]=vt(Ct=>Tt(Ct),["stop"]))},{default:_e(()=>[oe(Je,{name:"dots-horizontal"})]),_:1},8,["label","aria-expanded"])])]),(w(!0),N(Le,null,nt(e.groups,Ct=>(w(),N("div",{key:Ct.workspace.id,class:Re(["ws-drop-target",{"drop-before":M.value?.id===Ct.workspace.id&&M.value.position==="before","drop-after":M.value?.id===Ct.workspace.id&&M.value.position==="after"}]),onDragover:$t=>P($t,Ct.workspace.id),onDrop:$t=>D(Ct.workspace.id)},[oe(JL,{group:Ct,"active-workspace-id":e.activeWorkspaceId,"active-id":e.activeId,"renaming-id":q.value,"rename-value":Q.value,"rename-input-ref":fe(),"pending-by-session":e.pendingBySession,"unread-by-session":e.unreadBySession,"ws-menu-open-id":te.value,dragging:E.value===Ct.workspace.id,"is-collapsed":f,"is-expanded":y,"show-path":$.value,onGroupClick:W,onGroupContextmenu:G,onToggleWsMenu:ge,onCreateInWorkspace:Ye[6]||(Ye[6]=$t=>l("createInWorkspace",$t)),onSelectSession:z,onRenameSession:Ye[7]||(Ye[7]=($t,mn)=>l("rename",$t,mn)),onArchiveSession:Ye[8]||(Ye[8]=$t=>l("archive",$t)),onForkSession:Ye[9]||(Ye[9]=$t=>l("fork",$t)),onLoadMore:O,onToggleExpand:A,onConfirmRename:Me,onCancelRename:we,onUpdateRenameValue:ze,onWsDragstart:L,onWsDragend:S},null,8,["group","active-workspace-id","active-id","renaming-id","rename-value","rename-input-ref","pending-by-session","unread-by-session","ws-menu-open-id","dragging","show-path"])],42,g8))),128))],64))],32)],4),Ue.value?(w(),ve(Wl,{key:0,ref_key:"ghMenuRef",ref:le,class:"gh-menu",style:Gt(rt.value),onClick:Ye[10]||(Ye[10]=vt(()=>{},["stop"]))},{default:_e(()=>[oe(fn,{onClick:H},{default:_e(()=>[qe(R(x(n)("sidebar.copyPath")),1)]),_:1}),oe(fn,{onClick:J},{default:_e(()=>[qe(R(x(n)("sidebar.rename")),1)]),_:1}),oe(fn,{danger:"",onClick:ce},{default:_e(()=>[qe(R(x(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):ie("",!0),te.value!==null&&ue.value?(w(),ve(Wl,{key:1,ref_key:"wsMenuRef",ref:Y,class:"ws-menu",style:Gt(j.value),onClick:Ye[14]||(Ye[14]=vt(()=>{},["stop"]))},{default:_e(()=>[oe(fn,{onClick:Ye[11]||(Ye[11]=Ct=>Ie(ue.value))},{default:_e(()=>[qe(R(x(n)("sidebar.copyPath")),1)]),_:1}),oe(fn,{separator:""}),oe(fn,{onClick:Ye[12]||(Ye[12]=Ct=>ae(ue.value))},{default:_e(()=>[qe(R(x(n)("sidebar.rename")),1)]),_:1}),oe(fn,{separator:""}),oe(fn,{danger:"",onClick:Ye[13]||(Ye[13]=Ct=>Te(ue.value))},{default:_e(()=>[qe(R(x(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):ie("",!0),Ve.value?(w(),ve(Wl,{key:2,ref_key:"sectionMenuRef",ref:bt,class:"section-menu",style:Gt(tt.value),onClick:Ye[18]||(Ye[18]=vt(()=>{},["stop"]))},{default:_e(()=>[oe(fn,{onClick:Ye[15]||(Ye[15]=Ct=>mt("manual"))},{default:_e(()=>[T("span",v8,[e.workspaceSortMode==="manual"?(w(),ve(Je,{key:0,name:"check",size:"sm"})):ie("",!0)]),qe(" "+R(x(n)("sidebar.sortManual")),1)]),_:1}),oe(fn,{onClick:Ye[16]||(Ye[16]=Ct=>mt("recent"))},{default:_e(()=>[T("span",y8,[e.workspaceSortMode==="recent"?(w(),ve(Je,{key:0,name:"check",size:"sm"})):ie("",!0)]),qe(" "+R(x(n)("sidebar.sortRecent")),1)]),_:1}),oe(fn,{separator:""}),oe(fn,{onClick:Ye[17]||(Ye[17]=Ct=>Yt())},{default:_e(()=>[T("span",k8,[$.value?(w(),ve(Je,{key:0,name:"check",size:"sm"})):ie("",!0)]),qe(" "+R(x(n)("sidebar.showWorkspacePaths")),1)]),_:1})]),_:1},8,["style"])):ie("",!0),a.value?(w(),ve(wL,{key:3,sessions:e.sessions,"active-id":e.activeId,onSelect:z,onClose:Ye[19]||(Ye[19]=Ct=>a.value=!1)},null,8,["sessions","active-id"])):ie("",!0)],2),(w(),ve(lh,{to:"body"},[Vn.value?(w(),ve(x(bn),{key:0,onClose:Ye[20]||(Ye[20]=Ct=>Vn.value=!1)})):ie("",!0)]))],64))}}),w8=ut(_8,[["__scopeId","data-v-f80f56a6"]]);function S8(e){try{const t=Qn(e);if(t===null)return null;const n=Number(t);return Number.isFinite(n)?n:null}catch{return null}}function C8(e,t){try{ts(e,String(t))}catch{}}function x8(e){const{storageKey:t,defaultWidth:n,min:s,max:o,reverse:i=!1}=e;function r(_){return Number.isFinite(_)?Math.min(RC(o),Math.max(s,Math.round(_))):n}const l=Z(r(S8(t)??n)),a=Z(!1);function c(_){const g=r(_);l.value=g,C8(t,g)}let u=0,d=0,p=null,h=-1;function f(_){if(!a.value)return;const g=_.clientX-u;c(d+(i?-g:g))}function m(){if(a.value){if(a.value=!1,typeof document<"u"&&(document.body.style.userSelect="",document.body.style.cursor=""),p){try{p.releasePointerCapture(h)}catch{}p.removeEventListener("pointermove",f),p.removeEventListener("pointerup",m),p.removeEventListener("pointercancel",m)}p=null,h=-1}}function b(_){_.preventDefault(),a.value=!0,u=_.clientX,d=r(l.value),p=_.currentTarget,h=_.pointerId,typeof document<"u"&&(document.body.style.userSelect="none",document.body.style.cursor="col-resize");try{p.setPointerCapture(h)}catch{}p.addEventListener("pointermove",f),p.addEventListener("pointerup",m),p.addEventListener("pointercancel",m)}return ls(m),{width:l,dragging:a,clamp:r,setWidth:c,onPointerDown:b}}const A8=["aria-label"],T8=je({__name:"ResizeHandle",props:{storageKey:{},defaultWidth:{},min:{},max:{},reverse:{type:Boolean},ariaLabel:{}},emits:["update:width","update:dragging"],setup(e,{emit:t}){const n=e,s=t,{t:o}=It(),{width:i,dragging:r,onPointerDown:l}=x8({storageKey:n.storageKey,defaultWidth:n.defaultWidth,min:n.min,max:()=>n.max,reverse:n.reverse});return s("update:width",i.value),Ke(i,a=>s("update:width",a)),Ke(r,a=>s("update:dragging",a)),(a,c)=>(w(),N("div",{class:Re(["rh",{dragging:x(r)}]),role:"separator","aria-orientation":"vertical","aria-label":e.ariaLabel??x(o)("layout.resizeHandleAria"),onPointerdown:c[0]||(c[0]=(...u)=>x(l)&&x(l)(...u))},[...c[1]||(c[1]=[T("span",{class:"rh-bar","aria-hidden":"true"},null,-1)])],42,A8))}}),L_=ut(T8,[["__scopeId","data-v-7cdd3468"]]),M8={preview:"Preview",confirm:"Confirm",cancel:"Cancel"},E8={authBannerMessage:"Not signed in · Sign in to BLUN King to start a conversation",authBannerLogin:"Sign in",authPageTitle:"Sign in to BLUN King",authPageMessage:"Connect your BLUN King account before starting or continuing conversations.",authPageLogin:"Sign in",connecting:"Connecting…",internalBuildBanner:"Internal testing only"},I8={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",workspaces:"Workspaces",sortWorkspaces:"Sort workspaces",sortManual:"Manual",sortRecent:"Last edited",collapseAll:"Collapse all workspaces",expandAll:"Expand all workspaces",showWorkspacePaths:"Show workspace paths",newSession:"New Session",newChat:"New Chat",newWorkspace:"New Workspace",emptyState:"No sessions yet · click New Session to start",archiveConfirm:"Archive session?",options:"Options",rename:"Rename",copyPath:"Copy path",copySessionId:"Copy session ID",copied:"Copied ✓",copyFailed:"Copy failed",archive:"Archive",fork:"Fork session",delete:"Delete",removeWorkspace:"Remove workspace",brand:"BLUN King",signedIn:"Signed in",signOut:"Sign out",notSignedIn:"Not signed in",signIn:"Sign in",language:"Language",daemon:"Daemon",noSessions:"No conversations yet",showMore:"Load more ({count})",showLess:"Show less",showAll:"Show all ({count})",loadingMore:"Loading…",collapseSidebar:"Collapse sidebar",expandSidebar:"Expand sidebar",searchPlaceholder:"Search sessions",searchShortcut:"Search sessions (⌘K)",searchHint:"↑↓ navigate · ↵ open · Esc close",searchNoResults:"No matching sessions"},$8={switcherTitle:"Switch workspace",switchTooltip:"Switch workspace",eyebrow:"Workspace",branchLabel:"branch: {branch}",noBranch:"no branch",sessionCount:"{count} session | {count} sessions",allWorkspaces:"All workspaces",currentWorkspace:"Current workspace only",addWorkspace:"Add workspace…",noWorkspace:"No workspace",deleteHasSessions:"This workspace still has sessions — archive them before deleting it",removeWorkspaceConfirm:'Remove workspace "{name}"?',swarmEnableConfirm:"Enable swarm mode? The agent will run multiple sub-agents in parallel.",goalStartConfirm:'Start goal: "{objective}"? The agent will run autonomously toward it.',scopeCurrent:"this workspace",scopeAll:"all workspaces",newInGroup:"New session in this workspace",addTitle:"Add workspace",pathLabel:"Path",pathPlaceholder:"/absolute/path/to/project",recentLabel:"Recent folders",add:"Add",cancel:"Cancel",addHint:"Paste an absolute folder path, or pick a recent one.",addFailed:"Couldn't open this folder. Check the path and try again.",openThisFolder:"Open this folder",up:"Up",browsing:"Browsing…",filterPlaceholder:"Filter subfolders…",searchPlaceholder:"Fuzzy-search under this folder…",searching:"Searching…",pasteToggle:"Enter an absolute path",noFilterMatch:"No subfolders match “{q}”",noSubfolders:"No subfolders here",gitTag:"git",browseHint:'Click a folder to enter it, then "Open this folder" to add it as a workspace.',attentionTitle:"{count} item needs your attention | {count} items need your attention",awaitingAnswer:"Answer",awaitingAnswerTitle:"A question is waiting for your answer",awaitingPermission:"Approve",awaitingPermissionTitle:"An action is waiting for your approval",aborted:"Stopped",abortedTitle:"This session was interrupted before finishing"},N8={jumpToLatestAria:"Jump to latest message",toc:"Conversation outline",newMessages:"Latest messages",loading:"Loading…",emptyWorkspaceHint:"Send in {name}",switchWorkspace:"Switch workspace",addWorkspace:"New workspace",moreWorkspaces:"More workspaces ({count})",compacting:"Compacting context…",compactedPlain:"Context compacted",compactedAuto:"Context auto-compacted",compactedTokens:" ({before} → {after} tokens)",viewSummary:"View summary",summaryTitle:"Compaction summary",manuallyAborted:"Manually stopped",activatedSkill:"Activated skill: {name}",undo:"Undo",undoTooltip:"Undoing the conversation will not roll back code changes",undoConfirm:"Undo last message?",yesterday:"Yesterday",loadOlder:"Load earlier messages",loadingOlder:"Loading earlier messages…"},L8={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",planOn:"on",planOff:"off",planTooltip:"Toggle plan mode (research before editing)",modesLabel:"Mode",goalLabel:"Goal",swarmLabel:"Swarm",modeOff:"Off",goalPlaceholder:"What should the agent achieve?",goalStart:"Start",goalPause:"Pause",goalResume:"Resume",goalCancel:"Cancel",modeNotSupported:"Not supported",thinkingLabel:"thinking",thinkingTooltip:"Toggle thinking mode",starredModels:"Starred",moreModels:"More models…",statusPanelTitle:"Session status",statusPanelClose:"Close",statusModel:"Model",statusThinking:"Thinking",statusPermission:"Permission",statusPlanMode:"Plan mode",statusSwarmMode:"Swarm mode",swarmOn:"on",swarmOff:"off",statusContext:"Context",statusCost:"Cost",statusContextValue:"{used} / {max} ({pct}%)",statusNone:"—",activityRunning:"Running…",activityAwaitingApproval:"Awaiting approval",activityAwaitingQuestion:"Awaiting answer",interrupt:"Interrupt",runningShort:"in progress"},O8={placeholder:"Type a message…",send:"Send ↵",queueLabel:"Queue",placeholderRunning:"Press Enter to queue · Ctrl+S to inject into the running turn",queueAutoDrain:"sends automatically when the current turn ends",queueNext:"Up next",queueDragTitle:"Drag to reorder",editQueued:"Edit (load back into the input)",queuedImageOnly:"image ×{n}",queuedHasImage:"Contains {n} image(s) — remove only, not editable",remove:"Remove",removeNamed:"Remove {name}",uploading:"Uploading",uploadFailed:"Upload failed",attachImage:"Attach image",previewAttachment:"Preview {name}",interrupt:"Interrupt",interruptTitle:"Interrupt current operation",expandTitle:"Expand input for multi-line editing",collapseTitle:"Collapse input",emptyConversationTitle:"BLUN King",emptyConversation:"No messages yet — type below to start the conversation",quickStartPlaceholder:"Type a message to start a new conversation…",thinkingSuffix:" · thinking",thinkingSuffixEffort:" · thinking: {level}"},P8={title:"Sign in to BLUN King",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 blun and try again"},R8={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}",loginBlun:"Sign in to Blun",enterApiKey:"Enter API Key",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"},D8={dialogLabel:"Switch model",title:"Switch model",close:"Close (Esc)",allTab:"All",providerTabs:"Model providers",searchPlaceholder:"Search models or providers…",loading:"Loading models…",unavailable:"The daemon does not support model listing yet",contextSuffix:"{size}k ctx",emptyNoModels:"The daemon offers no selectable models",emptyNoMatch:"No matching models",starTitle:"Add to favorites",unstarTitle:"Remove from favorites",footerHint:"↑↓ Navigate · Enter Select · Esc Close"},B8={justNow:"just now"},F8={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"},H8={title:"Question",step:"Q{current}/{total}",back:"‹ Back",nextQuestion:"Next question ›",otherDefault:"Other…",submit:"Submit",dismiss:"Dismiss",minimize:"Minimize",expand:"Expand"},W8={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"},z8={panelTitle:"Thinking",close:"Close"},U8={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"},q8={},j8={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"}},V8={searching:"Searching…",noMatch:"No matches"},K8={dismiss:"Close",errorLabel:"Error",noteLabel:"Note",details:{cause:"Cause",code:"Error code",connection:"Connection",contentType:"Content type",details:"Server details",duration:"Duration",endpoint:"Endpoint",errorName:"Error type",message:"Message",operation:"Operation",phase:"Failure phase",request:"Request",requestId:"Request ID",responsePreview:"Response preview",sessionId:"Session ID",stack:"Stack",status:"HTTP status",timeout:"Timeout",timestamp:"Time"},daemonApiTitle:"Blun daemon returned an error",daemonNetworkMessage:"Web did not receive a response from the local service. Check that Blun daemon is still running, or refresh the page.",daemonNetworkTitle:"Cannot connect to Blun 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 Blun 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."}},G8={help:{desc:"Show the list of available commands"},new:{desc:"Create a new session"},clear:{desc:"Clear and start a new session"},model:{desc:"Switch model"},provider:{desc:"Manage providers (add / remove / refresh)"},login:{desc:"Sign in to Blun in the browser"},permission:{desc:"Switch approval mode (manual / auto / yolo)"},plan:{desc:"Toggle plan mode on/off"},swarm:{desc:"Toggle swarm mode; /swarm <task> runs a task in swarm"},goal:{desc:"Create/control a goal: /goal <objective>, /goal pause|resume|cancel"},btw:{desc:"Side chat: /btw <question> asks a forked side session"},yolo:{desc:"Auto-approve everything (yolo mode)"},auto:{desc:"Auto-approve safe edits/reads"},thinking:{desc:"Set the thinking level"},compact:{desc:"Compact the conversation history"},fork:{desc:"Fork this session into a new one"},undoNotImplemented:"/undo isn't supported by the daemon yet",status:{desc:"View session status"},undo:{desc:"Undo the last message"}},Y8={label:{read:"Read",bash:"Run",edit:"Edit",write:"Write",grep:"Search",glob:"Find",ls:"List",web_fetch:"Fetch",search:"Search",todo:"Todo",task:"Task"},chip:{lines:"{count} lines",results:"{count} results",edited:"edited",created:"created",todos:"{count} items"},group:{title:"{count} tool call | {count} tool calls",running:"running",error:"failed",done:"done"}},X8={resizeHandleAria:"Resize sidebar width",resizePreviewAria:"Resize preview panel width",detailPanelAria:"Detail panel"},Q8={openSwitcher:"Switch session / workspace",openSettings:"Session settings",settingsTitle:"Session settings",groupSession:"Current session",groupApp:"App preferences",sheetLabel:"Sheet",closeSheet:"Close",tapToCycle:"tap to cycle",running:"running",idle:"idle",sessionCount:"{n} sessions",newSession:"New session",permManualSub:"confirm every tool",permAutoSub:"auto-approve edits",permYoloSub:"auto-approve all",planModeSub:"Plan mode",swarmModeSub:"Swarm mode"},Z8={colorSchemeLabel:"Light/Dark",light:"Moon Bright",dark:"Moon Dark",system:"System",accentLabel:"Accent",accentBlue:"Blue",accentBlack:"Black"},J8={preview:"预览",confirm:"确认",cancel:"取消"},eO={authBannerMessage:"未登录 · 需要登录 BLUN King 才能开始对话",authBannerLogin:"登录",authPageTitle:"登录 BLUN King",authPageMessage:"先连接 BLUN King 账号,然后再开始或继续对话。",authPageLogin:"登录",connecting:"连接中…",internalBuildBanner:"仅供内部测试"},tO={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",workspaces:"工作区",sortWorkspaces:"工作区排序",sortManual:"手动排序",sortRecent:"按最后编辑时间",collapseAll:"折叠全部工作区",expandAll:"展开全部工作区",showWorkspacePaths:"显示工作区路径",newSession:"新建会话",newChat:"新建对话",newWorkspace:"新建工作区",emptyState:"还没有会话 · 点击 新建会话 开始",archiveConfirm:"归档会话?",options:"选项",rename:"重命名",copyPath:"复制路径",copySessionId:"复制 Session ID",copied:"已复制 ✓",copyFailed:"复制失败",archive:"归档",fork:"分叉会话",delete:"删除",removeWorkspace:"移除工作区",brand:"BLUN King",signedIn:"已登录",signOut:"退出登录",notSignedIn:"未登录",signIn:"登录",language:"语言",daemon:"后台",noSessions:"暂无对话",showMore:"加载更多 ({count})",showLess:"收起",showAll:"展开 ({count})",loadingMore:"加载中…",collapseSidebar:"收起侧边栏",expandSidebar:"展开侧边栏",searchPlaceholder:"搜索会话",searchShortcut:"搜索会话 (⌘K)",searchHint:"↑↓ 选择 · ↵ 打开 · Esc 关闭",searchNoResults:"没有匹配的会话"},nO={switcherTitle:"切换工作区",switchTooltip:"切换工作区",eyebrow:"工作区",branchLabel:"分支: {branch}",noBranch:"无分支",sessionCount:"{count} 个会话",allWorkspaces:"全部工作区",currentWorkspace:"仅当前工作区",addWorkspace:"添加工作区…",noWorkspace:"暂无工作区",deleteHasSessions:"工作区内还有会话,请先归档这些会话再删除",removeWorkspaceConfirm:"移除工作区「{name}」?",swarmEnableConfirm:"启用 swarm 模式?Agent 将并行运行多个子 agent。",goalStartConfirm:"启动 goal:「{objective}」?Agent 将自主执行。",scopeCurrent:"当前工作区",scopeAll:"全部工作区",newInGroup:"在此工作区新建会话",addTitle:"添加工作区",pathLabel:"路径",pathPlaceholder:"/项目的绝对路径",recentLabel:"最近的文件夹",add:"添加",cancel:"取消",addHint:"粘贴一个绝对路径,或从最近用过的文件夹中选择。",addFailed:"无法打开此文件夹,请检查路径后重试。",openThisFolder:"打开此文件夹",up:"上一级",browsing:"加载中…",filterPlaceholder:"过滤子文件夹…",searchPlaceholder:"在此目录下模糊搜索…",searching:"搜索中…",pasteToggle:"直接输入绝对路径",noFilterMatch:"没有匹配「{q}」的子文件夹",noSubfolders:"此处没有子文件夹",gitTag:"git",browseHint:'点击文件夹进入,再点"打开此文件夹"将其添加为工作区。',attentionTitle:"{count} 项待处理",awaitingAnswer:"待回答",awaitingAnswerTitle:"有提问等待你回答",awaitingPermission:"待授权",awaitingPermissionTitle:"有操作等待你授权",aborted:"已中断",abortedTitle:"此会话在完成前被中断"},sO={jumpToLatestAria:"跳到最新消息",toc:"对话目录",newMessages:"最新消息",loading:"加载中…",emptyWorkspaceHint:"在 {name} 中发送",switchWorkspace:"切换工作区",addWorkspace:"添加工作区",moreWorkspaces:"更多工作区 ({count})",compacting:"正在压缩上下文…",compactedPlain:"上下文已压缩",compactedAuto:"已自动压缩上下文",compactedTokens:"({before} → {after} tokens)",viewSummary:"查看摘要",summaryTitle:"压缩摘要",manuallyAborted:"您已手动终止",activatedSkill:"已激活技能: {name}",undo:"撤销",undoTooltip:"撤销对话不会回滚代码",undoConfirm:"撤销上一条消息?",yesterday:"昨天",loadOlder:"加载更早的消息",loadingOlder:"正在加载更早的消息…"},oO={connectionConnected:"已连接",connectionConnecting:"连接中…",connectionDisconnected:"未连接",ctxTooltip:"使用 {used} / {max} tokens ({pct}%)",modelLabel:"模型",permissionManual:"逐条确认",permissionAuto:"完全自主",permissionYolo:"自动通过",permissionManualDesc:"每个工具操作都需要你手动确认",permissionAutoDesc:"完全自主运行,agent 自己做决定,不再询问",permissionYoloDesc:"自动批准工具操作,但遇到关键问题仍会询问",planLabel:"计划",planOn:"开",planOff:"关",planTooltip:"切换计划模式(先调研再修改)",modesLabel:"模式",goalLabel:"目标",swarmLabel:"Swarm",modeOff:"未启用",goalPlaceholder:"让 Agent 完成什么目标?",goalStart:"开始",goalPause:"暂停",goalResume:"继续",goalCancel:"取消",modeNotSupported:"暂不支持",thinkingLabel:"思考",thinkingTooltip:"切换思考模式",starredModels:"收藏",moreModels:"更多模型…",statusPanelTitle:"会话状态",statusPanelClose:"关闭",statusModel:"模型",statusThinking:"思考强度",statusPermission:"权限",statusPlanMode:"计划模式",statusSwarmMode:"Swarm 模式",swarmOn:"开",swarmOff:"关",statusContext:"上下文",statusCost:"花费",statusContextValue:"{used} / {max} ({pct}%)",statusNone:"—",activityRunning:"运行中…",activityAwaitingApproval:"等待批准",activityAwaitingQuestion:"等待回答",interrupt:"中断",runningShort:"进行中"},iO={placeholder:"输入消息…",send:"发送 ↵",queueLabel:"队列",placeholderRunning:"输入会加入队列 · Ctrl+S 立即插入运行中的回合",queueAutoDrain:"当前回合结束后自动逐条发送",queueNext:"下一条",queueDragTitle:"拖拽排序",editQueued:"编辑(载入到输入框)",queuedImageOnly:"图片 ×{n}",queuedHasImage:"包含 {n} 张图片 — 只能移除,不能编辑",remove:"移除",removeNamed:"移除 {name}",uploading:"上传中",uploadFailed:"上传失败",attachImage:"附加图片",previewAttachment:"预览 {name}",interrupt:"中断",interruptTitle:"中断当前操作",expandTitle:"展开输入框进行多行编辑",collapseTitle:"收起输入框",emptyConversationTitle:"BLUN King",emptyConversation:"还没有消息 —— 在下方输入开始对话",quickStartPlaceholder:"输入消息开始新对话…",thinkingSuffix:" · thinking",thinkingSuffixEffort:" · thinking: {level}"},rO={title:"登录 BLUN King",close:"关闭 (Esc)",starting:"正在启动授权流程…",lead:"点击下方按钮,在新标签页中完成授权。",authorizeInBrowser:"在浏览器中授权",orDivider:"或者",fallbackPrefix:"换个设备?在浏览器打开 ",fallbackSuffix:" 输入设备码:",copy:"复制",copied:"已复制",waitingAuth:"等待授权",waitingAutoClose:"等待授权,完成后自动登录…",success:"已授权",successHint:"正在加载,稍后自动关闭…",expiredTitle:"授权码已过期",expiredHint:"请重新开始授权流程",retry:"重试",closeBtn:"关闭",errorTitle:"当前 daemon 暂不支持登录",errorHint:"请升级 blun 后重试"},lO={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}",loginBlun:"登录 Blun",enterApiKey:"填写 API Key",fieldApiKey:"API Key",fieldBaseUrl:"Base URL",fieldDefaultModel:"默认模型",baseUrlPlaceholder:"https://… (可选)",optional:"可选",apiKeyRequired:"API Key 不能为空",add:"添加",escClose:"Esc 关闭"},aO={dialogLabel:"切换模型",title:"切换模型",close:"关闭 (Esc)",allTab:"全部",providerTabs:"模型提供商",searchPlaceholder:"搜索模型或提供商…",loading:"加载模型中…",unavailable:"daemon 暂不支持模型列表",contextSuffix:"{size}k ctx",emptyNoModels:"daemon 未提供可选模型",emptyNoMatch:"无匹配模型",starTitle:"添加到收藏",unstarTitle:"取消收藏",footerHint:"↑↓ 导航 · Enter 选择 · Esc 关闭"},cO={justNow:"刚刚"},uO={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:"拒绝并退出"},dO={title:"提问",step:"Q{current}/{total}",back:"‹ 返回",nextQuestion:"下一题 ›",otherDefault:"其他…",submit:"提交",dismiss:"放弃",minimize:"最小化",expand:"展开"},fO={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:"展开"},pO={panelTitle:"思考过程",close:"关闭"},hO={title:"改动",branch:"分支",aheadTitle:"领先远程",behindTitle:"落后远程",changeCount:"{count} 改动",empty:"无 git 改动 / daemon 未提供",clean:"工作区干净,无改动",back:"返回",loading:"正在加载 diff…",noDiff:"该文件没有行级改动",list:"列表",tree:"树形",close:"关闭"},mO={},gO={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:"无法读取这个文件"}},vO={searching:"搜索中…",noMatch:"无匹配"},yO={dismiss:"关闭",errorLabel:"错误",noteLabel:"提示",details:{cause:"底层原因",code:"错误码",connection:"连接状态",contentType:"响应类型",details:"服务端详情",duration:"耗时",endpoint:"请求地址",errorName:"错误类型",message:"错误信息",operation:"操作",phase:"失败阶段",request:"请求",requestId:"Request ID",responsePreview:"响应预览",sessionId:"Session ID",stack:"堆栈",status:"HTTP 状态",timeout:"超时设置",timestamp:"时间"},daemonApiTitle:"Blun daemon 返回错误",daemonNetworkMessage:"Web 没有拿到本地服务的响应。请确认 Blun daemon 仍在运行,或刷新页面重试。",daemonNetworkTitle:"无法连接到 Blun daemon",diagnostics:"诊断信息",hideDetails:"收起详情",operationFailedMessage:"刚才的操作没有完成,请稍后重试。",operationFailedTitle:"操作失败",sessionSnapshotMessage:"Web 没能加载当前会话内容。请确认 Blun daemon 仍在运行,或刷新页面重试。",sessionSnapshotTitle:"无法加载当前会话内容",showDetails:"查看详情",copyDetails:"复制诊断信息",copied:"已复制",wsTitle:"实时连接出错",goal:{alreadyExists:"当前会话已有一个进行中的目标,请先取消它再创建新目标。",notFound:"没有找到可操作的目标,可能它已经结束或被取消。",statusInvalid:"当前目标状态不支持这个操作。",notResumable:"这个目标无法恢复(可能已取消或已完成)。",objectiveTooLong:"目标描述太长了,请精简后重试。"}},kO={help:{desc:"显示可用命令列表"},new:{desc:"创建新会话"},clear:{desc:"清空并新建会话"},model:{desc:"切换模型"},provider:{desc:"管理提供商 (添加/删除/刷新)"},login:{desc:"在浏览器中登录 Blun"},permission:{desc:"切换审批模式 (manual/auto/yolo)"},plan:{desc:"切换计划模式 开/关"},swarm:{desc:"切换 swarm 模式;/swarm <任务> 直接在 swarm 下执行"},goal:{desc:"创建/控制目标:/goal <目标>、/goal pause|resume|cancel"},btw:{desc:"侧边聊天:/btw <问题> 向 fork 的侧边会话提问"},yolo:{desc:"自动批准一切 (yolo 模式)"},auto:{desc:"自动批准安全的读写"},thinking:{desc:"设置思考强度"},compact:{desc:"压缩会话历史"},fork:{desc:"把当前会话 fork 出一个新会话"},undoNotImplemented:"daemon 尚未支持 /undo",status:{desc:"查看会话状态"},undo:{desc:"撤销上一条消息"}},bO={label:{read:"读取",bash:"运行",edit:"编辑",write:"写入",grep:"搜索",glob:"查找",ls:"列目录",web_fetch:"抓取",search:"搜索",todo:"待办",task:"任务"},chip:{lines:"{count} 行",results:"{count} 结果",edited:"已编辑",created:"已创建",todos:"{count} 项"},group:{title:"{count} 个工具调用",running:"运行中",error:"有失败",done:"已完成"}},_O={resizeHandleAria:"调整侧栏宽度",resizePreviewAria:"调整预览面板宽度",detailPanelAria:"详情面板"},wO={openSwitcher:"切换会话 / 工作区",openSettings:"会话设置",settingsTitle:"会话设置",groupSession:"当前会话",groupApp:"应用偏好",sheetLabel:"面板",closeSheet:"关闭",tapToCycle:"点击切换",running:"运行中",idle:"空闲",sessionCount:"{n} 个会话",newSession:"新建会话",permManualSub:"每个工具都确认",permAutoSub:"自动批准编辑",permYoloSub:"全部自动批准",planModeSub:"计划模式",swarmModeSub:"Swarm 模式"},SO={colorSchemeLabel:"明暗",light:"月之亮面",dark:"月之暗面",system:"跟随系统",accentLabel:"主题色",accentBlue:"蓝色",accentBlack:"黑色"},CO={title:"Welcome to Blun Web",subtitle:"Pick a few preferences — you can change them anytime in Settings.",languageLabel:"Language",start:"Get started",skip:"Skip",reopen:"Preferences / onboarding"},xO={title:"欢迎来使用 Blun Web",subtitle:"来选择一些你的偏好 —— 之后也可以在设置里随时修改。",languageLabel:"语言",start:"开始使用",skip:"跳过",reopen:"偏好 / 引导"},AO={title:"Settings",close:"Close (Esc)",tabs:{general:"General",agent:"Agent",account:"Account",advanced:"Advanced"},appearance:"Appearance",notifications:"Notifications",notifyOnComplete:"Notify when a turn completes",notifyOnQuestion:"Notify when a question needs an answer",soundOnComplete:"Play a sound when a turn completes or needs an answer",notifyDenied:"Blocked in browser settings",notifyBody:"Finished a turn",notifyQuestionBody:"A question is waiting for your answer",account:"Account",uiFontSize:"Font size",agentDefaults:"Agent defaults",providers:"Providers",providersHint:"Add, remove, or refresh providers",manageProviders:"Manage",saving:"Saving",defaultModel:"Default model",defaultModelHint:"New sessions prefer this model",noDefaultModel:"No default model",defaultPermission:"Default permission",defaultPermissionHint:"Only affects newly-created sessions",defaultThinking:"Thinking by default",defaultThinkingHint:"Whether new sessions start with thinking enabled",defaultPlanMode:"Plan mode by default",defaultPlanModeHint:"Whether new sessions start in plan mode",mergeSkills:"Merge all available skills",mergeSkillsHint:"Show project, plugin, and user skills together",telemetry:"Improve product with usage data",telemetryHint:"When on, we collect anonymous interaction data (such as clicks, interruptions, and feature usage) to improve the product experience. You can turn it off at any time.",telemetryRestartHint:"Takes effect after restarting the service.",credentialReady:"Credential configured",credentialMissing:"Missing credential",configUnavailable:"The server did not return config yet. These settings are unavailable.",advanced:"Advanced",build:"Build",serverVersion:"Server version",exportLog:"Troubleshooting log",logHint:"Enable with ?debug=1 to capture",exportLogBtn:"Export log",conversationToc:"Show conversation outline",conversationTocHint:"Show a clickable outline in the right margin to jump between messages"},TO={title:"设置",close:"关闭 (Esc)",tabs:{general:"通用",agent:"Agent",account:"账户",advanced:"高级"},appearance:"外观",notifications:"通知",notifyOnComplete:"会话完成时通知",notifyOnQuestion:"待回答时通知",soundOnComplete:"会话完成或待回答时播放提示音",notifyDenied:"已在浏览器设置中被阻止",notifyBody:"已完成一轮",notifyQuestionBody:"有提问等待你回答",account:"账户",uiFontSize:"字体大小",agentDefaults:"Agent 默认值",providers:"提供商",providersHint:"添加、删除或刷新提供商",manageProviders:"管理",saving:"保存中",defaultModel:"默认模型",defaultModelHint:"新会话会优先使用这个模型",noDefaultModel:"未设置默认模型",defaultPermission:"默认权限",defaultPermissionHint:"只影响之后新建的会话",defaultThinking:"默认开启思考",defaultThinkingHint:"新会话默认是否开启 thinking",defaultPlanMode:"默认计划模式",defaultPlanModeHint:"新会话默认进入 plan mode",mergeSkills:"合并所有可用 Skills",mergeSkillsHint:"让项目、插件和用户 Skills 一起出现在可用列表中",telemetry:"使用数据改进产品",telemetryHint:"开启后,我们会收集您的匿名交互数据(如点击、打断、功能使用等),用于改进产品体验。您可以随时关闭。",telemetryRestartHint:"更改后需重启服务生效。",credentialReady:"凭据已配置",credentialMissing:"缺少凭据",configUnavailable:"当前服务端没有返回 config,设置项暂不可用。",advanced:"高级",build:"构建",serverVersion:"服务端版本",exportLog:"故障排查日志",logHint:"加 ?debug=1 开启采集",exportLogBtn:"导出日志",conversationToc:"显示对话目录",conversationTocHint:"在右侧显示可点击跳转的对话目录"},MO={openInEditor:"Open in editor",openInEditorShort:"Open",chooseOpenApp:"Choose application",copyAll:"Copy all as Markdown",copyFinalSummary:"Copy final summary",copied:"Copied",copyPath:"Copy path",changed:"{n} changed",gitTooltip:"Open Files > Changed",detached:"detached",openPr:"Open pull request",options:"Options",copySessionId:"Copy Session ID",renameSession:"Rename",forkSession:"Fork session",archiveSession:"Archive"},EO={openInEditor:"在编辑器中打开",openInEditorShort:"打开",chooseOpenApp:"选择应用",copyAll:"复制全部对话为 Markdown",copyFinalSummary:"仅复制最终总结",copied:"已复制",copyPath:"复制路径",changed:"{n} 处改动",gitTooltip:"打开「文件 > 改动」",detached:"游离",openPr:"打开 Pull Request",options:"选项",copySessionId:"复制 Session ID",renameSession:"重命名",forkSession:"分叉会话",archiveSession:"归档"},IO={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"},$O={title:"侧边聊天",subtitle:"从当前会话 fork",empty:"在侧边随手问一句 —— 它共享当前会话的上下文。",placeholder:"问问侧边聊天…",send:"发送"},NO={en:{common:M8,app:E8,sidebar:I8,workspace:$8,conversation:N8,status:L8,composer:O8,login:P8,providers:R8,model:D8,sessions:B8,approval:F8,question:H8,tasks:W8,thinking:z8,diff:U8,fileTree:q8,filePreview:j8,mention:V8,warnings:K8,commands:G8,tools:Y8,layout:X8,mobile:Q8,theme:Z8,onboarding:CO,settings:AO,header:MO,sideChat:IO},zh:{common:J8,app:eO,sidebar:tO,workspace:nO,conversation:sO,status:oO,composer:iO,login:rO,providers:lO,model:aO,sessions:cO,approval:uO,question:dO,tasks:fO,thinking:pO,diff:hO,fileTree:mO,filePreview:gO,mention:vO,warnings:yO,commands:kO,tools:bO,layout:_O,mobile:wO,theme:SO,onboarding:xO,settings:TO,header:EO,sideChat:$O}},TA=[{code:"en",label:"English"},{code:"zh",label:"中文"}];function LO(){const e=Qn(Et.locale);return e==="en"||e==="zh"?e:globalThis.navigator?.language?.toLowerCase().startsWith("zh")?"zh":"en"}const Un=o5({legacy:!1,locale:LO(),fallbackLocale:"en",messages:NO});function MA(e){Un.global.locale.value=e,ts(Et.locale,e)}const Xa=Un.global.t,OO={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"},PO={multiedit:"multi_edit",multiedits:"multi_edit",shell:"bash",run:"bash",exec:"bash",ripgrep:"grep",rg:"grep",find:"glob",fetch:"web_fetch",webfetch:"web_fetch",url_fetch:"web_fetch",urlfetch:"web_fetch",list:"ls",listdir:"ls",list_dir:"ls",todowrite:"todo",todo_write:"todo",todoread:"todo",todolist:"todo",todo_list:"todo",agent:"task",subagent:"task",websearch:"search",web_search:"search"};function Zl(e){const t=(e??"").trim().toLowerCase().replace(/[\s-]+/g,"_");return PO[t]??t}function id(e){const t=OO[Zl(e)];return t?Xa(t):e}const RO={read:"file-text",bash:"terminal",edit:"pencil",multi_edit:"pencil",write:"file-plus",grep:"search",search:"search",glob:"glob",ls:"folder",web_fetch:"globe",todo:"check-list",task:"sparkles"};function S0(e){const t=Zl(e);let n=RO[t];return!n&&(e??"").trim().toLowerCase().includes("skill")&&(n="bolt"),n?Ia(n,"sm"):""}const EA=80;function DO(e,t=EA){const n=e.trim();return n.length>t?n.slice(0,t-1)+"…":n}function BO(e,t){const n=e.trim();return!!(n===""||n==="{}"||n==="[]"||n==="null"||t&&Object.keys(t).length===0)}function FO(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 sn(e){return typeof e=="string"&&e.length>0?e:void 0}function Sl(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function HO(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 ig(e){return sn(e.path)??sn(e.file_path)??sn(e.filePath)??sn(e.filename)}const WO=64;function Bu(e,t,n=!1){const s=(o,i=EA)=>n?o.trim():DO(o,i);try{const o=FO(t);if(!n&&BO(t,o))return"";const i=()=>s(t.replace(/^·\s*/,""));if(!o)return i();switch(Zl(e)){case"read":{const r=ig(o);if(!r)return i();const l=Sl(o.offset)??Sl(o.line_start)??Sl(o.start_line),a=Sl(o.limit)??Sl(o.length),c=Sl(o.line_end)??Sl(o.end_line)??(l!==void 0&&a!==void 0?l+a:void 0);return s(l!==void 0&&c!==void 0?`${r}:${l}-${c}`:l!==void 0?`${r}:${l}`:r)}case"write":{const r=ig(o);return r?s(`${r} ${Xa("tools.chip.created")}`):i()}case"edit":case"multi_edit":{const r=ig(o);return r?s(r):i()}case"bash":{const r=sn(o.command)??sn(o.cmd)??sn(o.script);return r?s(r,WO):i()}case"grep":case"search":{const r=sn(o.pattern)??sn(o.query)??sn(o.regex),l=sn(o.path)??sn(o.glob)??sn(o.include);return r&&l?s(`${r} in ${l}`):r?s(r):i()}case"glob":{const r=sn(o.pattern)??sn(o.glob)??sn(o.query),l=sn(o.path)??sn(o.cwd);return r&&l?s(`${r} in ${l}`):r?s(r):sn(o.path)?s(sn(o.path)):i()}case"ls":{const r=sn(o.path)??sn(o.dir)??sn(o.directory)??sn(o.cwd);return r?s(r):i()}case"web_fetch":{const r=sn(o.url)??sn(o.uri);return r?s(HO(r)):i()}case"todo":case"task":{const r=sn(o.description)??sn(o.title)??sn(o.prompt)??sn(o.name)??sn(o.subagent_type);if(r)return s(r);const l=Array.isArray(o.todos)?o.todos:Array.isArray(o.items)?o.items:void 0;return l?s(Xa("tools.chip.todos",{count:l.length})):i()}default:return i()}}catch{return t}}function zO(e){try{switch(Zl(e.name)){case"bash":return e.timing?e.timing:"";case"read":{if(e.output&&e.output.length>0){const t=e.output.length;return Xa("tools.chip.lines",{count:t})}return""}case"edit":case"multi_edit":case"write":{if(e.output){for(const n of e.output){const s=n.match(/\+(\d+).*[-−](\d+)/);if(s)return`+${s[1]} −${s[2]}`}const t=e.output.find(n=>/\d+/.test(n));if(t){const n=t.match(/\+(\d+)/),s=t.match(/[-−](\d+)/);if(n||s)return`${n?`+${n[1]}`:""} ${s?`−${s[1]}`:""}`.trim()}if(e.status!=="error")return Xa("tools.chip.edited")}return""}case"grep":case"search":return e.output&&e.output.length>0?Xa("tools.chip.results",{count:e.output.length}):"";default:return""}}catch{return""}}const UO=je({__name:"StatusDot",props:{status:{}},setup(e){const t=e;function n(o){switch(o){case"ok":case"done":case"completed":case"success":return"ok";case"error":case"failed":case"danger":return"error";case"running":case"working":case"in_progress":case"active":return"running";case"suspended":return"suspended";default:return"idle"}}const s=F(()=>n(t.status));return(o,i)=>(w(),N("span",{class:Re(["kw-dot",`kw-dot--${s.value}`]),"aria-hidden":"true"},null,2))}}),Fu=ut(UO,[["__scopeId","data-v-ed5cc9c3"]]),qO=["innerHTML"],jO={class:"a"},VO={key:0,class:"p"},KO={class:"rt"},GO=["aria-label"],YO={key:0,class:"tm"},XO=["inert"],QO={class:"bb-pad"},ZO=je({__name:"ToolRow",props:{status:{},icon:{default:""},name:{},arg:{default:""},time:{default:""},open:{type:Boolean,default:!1},expandable:{type:Boolean,default:!1},stacked:{type:Boolean,default:!1},stackPosition:{default:"single"}},emits:["toggle"],setup(e){return(t,n)=>(w(),N("div",{class:Re(["box",{open:e.open,stacked:e.stacked,err:e.status==="error","stack-first":e.stackPosition==="first","stack-middle":e.stackPosition==="middle","stack-last":e.stackPosition==="last"}])},[T("div",{class:"bh",onClick:n[0]||(n[0]=s=>t.$emit("toggle"))},[e.icon?(w(),N("span",{key:0,class:"gl",innerHTML:e.icon,"aria-hidden":"true"},null,8,qO)):ie("",!0),T("span",jO,R(e.name),1),oe(Ht,{text:e.arg},{default:_e(()=>[e.arg?(w(),N("span",VO,R(e.arg),1)):ie("",!0)]),_:1},8,["text"]),T("span",KO,[T("span",{class:Re(["status",e.status]),role:"status","aria-label":e.status},[e.status==="ok"?(w(),ve(Je,{key:0,name:"check",size:"sm"})):e.status==="error"?(w(),ve(Je,{key:1,name:"close",size:"sm"})):e.status==="suspended"?(w(),ve(Fu,{key:2,status:"suspended"})):(w(),ve(Fu,{key:3,status:"running"}))],10,GO),Cn(t.$slots,"trailing"),e.time?(w(),N("span",YO,R(e.time),1)):ie("",!0)]),e.expandable?(w(),ve(Je,{key:1,class:"car",name:e.open?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])):ie("",!0)]),T("div",{class:Re(["bb",{open:e.open}]),inert:!e.open},[T("div",QO,[Cn(t.$slots,"default")])],10,XO)],2))}}),C0=ut(ZO,[["__scopeId","data-v-9eb13415"]]),JO={key:0,class:"at-type"},eP={key:1,class:"at-task"},tP={key:2,class:"bb-code"},nP=je({__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}=It(),s=e,o=t;function i(_){if(!_)return{};try{const g=JSON.parse(_);return{description:typeof g.description=="string"?g.description:void 0,subagentType:typeof g.subagent_type=="string"?g.subagent_type:void 0,prompt:typeof g.prompt=="string"?g.prompt:void 0}}catch{return{}}}const r=F(()=>i(s.tool.arg)),l=F(()=>!!s.tool.output&&s.tool.output.length>0),a=F(()=>!!r.value.prompt||!!r.value.subagentType||l.value),c=Z(s.tool.defaultExpanded===!0&&a.value),u=F(()=>s.tool.status),d=F(()=>id(s.tool.name)),p=F(()=>S0(s.tool.name)),h=F(()=>r.value.description||r.value.subagentType||""),f=Ut("resolveAgentTaskId"),m=F(()=>f?f(s.tool.id)!==void 0:!0);function b(){a.value&&(c.value=!c.value)}return Ke(()=>[s.tool.defaultExpanded,s.tool.output?.length,s.tool.status],()=>{s.tool.defaultExpanded===!0&&a.value&&(c.value=!0)}),(_,g)=>(w(),ve(C0,{status:u.value,icon:p.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:_e(()=>[m.value?(w(),N("button",{key:0,type:"button",class:"at-open",onClick:g[0]||(g[0]=vt(v=>o("openAgent",e.tool.id),["stop"]))},R(x(n)("tasks.openDetail")),1)):ie("",!0)]),default:_e(()=>[r.value.subagentType?(w(),N("div",JO,R(r.value.subagentType),1)):ie("",!0),r.value.prompt?(w(),N("div",eP,R(r.value.prompt),1)):ie("",!0),l.value?(w(),N("div",tP,[(w(!0),N(Le,null,nt(e.tool.output??[],(v,y)=>(w(),N("div",{key:y},R(v),1))),128))])):ie("",!0)]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),sP=ut(nP,[["__scopeId","data-v-a9aa31ca"]]),oP=1e6,O_=5e3;function P_(e){if(e==="")return[];const t=e.split(`
|
|
39
39
|
`);return t.at(-1)===""&&t.pop(),t}function iP(e,t){const n=P_(e),s=P_(t),o=n.length,i=s.length;if(o===0&&i===0)return[];if(o>O_||i>O_||(o+1)*(i+1)>oP)return null;const r=Array.from({length:o+1},()=>Array.from({length:i+1},()=>0));for(let h=1;h<=o;h++)for(let f=1;f<=i;f++)r[h][f]=n[h-1]===s[f-1]?r[h-1][f-1]+1:Math.max(r[h-1][f],r[h][f-1]);const l=[];let a=o,c=i;for(;a>0||c>0;)a>0&&c>0&&n[a-1]===s[c-1]?(l.push({type:"context",text:n[a-1]}),a--,c--):c>0&&(a===0||r[a][c-1]>=r[a-1][c])?(l.push({type:"add",text:s[c-1]}),c--):(l.push({type:"del",text:n[a-1]}),a--);l.reverse();const u=[];let d=1,p=1;for(const h of l)h.type==="context"?(u.push({type:"context",text:h.text,oldNo:d,newNo:p}),d++,p++):h.type==="add"?(u.push({type:"add",text:h.text,newNo:p}),p++):(u.push({type:"del",text:h.text,oldNo:d}),d++);return u}function rP(e){let t=0,n=0;for(const s of e)s.type==="add"?t++:s.type==="del"&&n++;return{added:t,removed:n}}function IA(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 $A(e){const t=Zl(e.name);if(t!=="edit"&&t!=="write")return null;const n=IA(e.arg);if(!n)return null;if(t==="edit"){if(n.replace_all===!0)return null;const s=typeof n.old_string=="string"?n.old_string:void 0,o=typeof n.new_string=="string"?n.new_string:void 0;return s===void 0||o===void 0?null:iP(s,o)}return null}function lP(e){const t=IA(e);return t&&typeof t.path=="string"?t.path:void 0}function aP(e,t){for(const n of e){const s=n.tools?.find(o=>o.id===t);if(s)return s}}const cP={key:0,class:"chip"},uP={key:0,class:"bb-summary"},dP={class:"bb-code"},fP={key:0,class:"bb-empty"},pP=je({__name:"EditTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff"],setup(e,{emit:t}){const n=e,s=t,o=F(()=>n.tool.status),i=F(()=>id(n.tool.name)),r=F(()=>S0(n.tool.name)),l=F(()=>Bu(n.tool.name,n.tool.arg)),a=F(()=>Bu(n.tool.name,n.tool.arg,!0)),c=F(()=>$A(n.tool)),u=F(()=>{const m=c.value;if(m&&n.tool.status!=="error"){const{added:b,removed:_}=rP(m);if(b||_)return`+${b} −${_}`}return""}),d=F(()=>!!n.tool.output&&n.tool.output.length>0),p=Z(!1),h=F(()=>d.value&&!n.toolDiffPanel);function f(){if(n.toolDiffPanel){s("openToolDiff",n.tool.id);return}d.value&&(p.value=!p.value)}return(m,b)=>(w(),ve(C0,{status:o.value,icon:r.value,name:i.value,arg:p.value?"":l.value,time:e.tool.timing,open:p.value,expandable:h.value||e.toolDiffPanel,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:f},{trailing:_e(()=>[u.value?(w(),N("span",cP,R(u.value),1)):ie("",!0)]),default:_e(()=>[a.value?(w(),N("div",uP,R(a.value),1)):ie("",!0),T("div",dP,[d.value?ie("",!0):(w(),N("div",fP,"Waiting for output…")),(w(!0),N(Le,null,nt(e.tool.output??[],(_,g)=>(w(),N("div",{key:g},R(_),1))),128))])]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),hP=ut(pP,[["__scopeId","data-v-b5815da4"]]),mP={key:0,class:"chip"},gP={key:0,class:"bb-summary"},vP={class:"bb-code"},yP={key:0,class:"bb-empty"},kP=je({__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=F(()=>t.tool.status==="running"&&/^bash$/i.test(t.tool.name)),s=F(()=>!!t.tool.output&&t.tool.output.length>0),o=F(()=>s.value||n.value),i=Z(t.tool.defaultExpanded===!0&&o.value),r=F(()=>t.tool.status),l=F(()=>id(t.tool.name)),a=F(()=>S0(t.tool.name)),c=F(()=>Bu(t.tool.name,t.tool.arg)),u=F(()=>Bu(t.tool.name,t.tool.arg,!0)),d=F(()=>zO({name:t.tool.name,arg:t.tool.arg,output:t.tool.output,timing:t.tool.timing,status:t.tool.status}));function p(){o.value&&(i.value=!i.value)}return Ke(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status,t.tool.name],()=>{t.tool.defaultExpanded===!0&&o.value&&(i.value=!0)}),(h,f)=>(w(),ve(C0,{status:r.value,icon:a.value,name:l.value,arg:i.value?"":c.value,time:e.tool.name!=="bash"?e.tool.timing:"",open:i.value,expandable:o.value,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:p},{trailing:_e(()=>[d.value?(w(),N("span",mP,R(d.value),1)):ie("",!0)]),default:_e(()=>[u.value?(w(),N("div",gP,R(u.value),1)):ie("",!0),T("div",vP,[s.value?ie("",!0):(w(),N("div",yP,"Waiting for output…")),(w(!0),N(Le,null,nt(e.tool.output??[],(m,b)=>(w(),N("div",{key:b},R(m),1))),128))])]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),bP=ut(kP,[["__scopeId","data-v-6f329afa"]]),_P={class:"media-title"},wP=["src","alt"],SP=["src"],CP=["src"],xP=je({__name:"MediaTool",props:{tool:{},mobile:{type:Boolean,default:!1}},emits:["openMedia"],setup(e,{emit:t}){const n=e,s=t,o=F(()=>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=F(()=>{const c=o.value;if(!c)return"";const u=[c.path?i(c.path):n.tool.name];return c.mimeType&&u.push(c.mimeType),c.bytes!==void 0&&u.push(r(c.bytes)),c.dimensions&&u.push(c.dimensions),u.join(" · ")});function a(){const c=o.value;c?.kind==="image"&&s("openMedia",c)}return(c,u)=>o.value?(w(),N("div",{key:0,class:Re(["media-tool",{mob:e.mobile}])},[oe(Ht,{text:o.value.path||l.value},{default:_e(()=>[T("div",_P,R(l.value),1)]),_:1},8,["text"]),o.value.kind==="image"?(w(),ve(Ht,{key:0,text:o.value.path||l.value},{default:_e(()=>[T("button",{type:"button",class:"media-image-button",onClick:a},[T("img",{class:"media-image",src:o.value.url,alt:o.value.path?i(o.value.path):l.value,loading:"lazy"},null,8,wP)])]),_:1},8,["text"])):o.value.kind==="video"?(w(),N("video",{key:1,class:"media-video",src:o.value.url,controls:"",preload:"metadata"},null,8,SP)):(w(),N("audio",{key:2,class:"media-audio",src:o.value.url,controls:""},null,8,CP))],2)):ie("",!0)}}),AP=ut(xP,[["__scopeId","data-v-9a192496"]]);function TP(e){if(e.media&&e.status==="ok")return AP;const t=Zl(e.name);return t==="edit"||t==="write"||t==="multi_edit"?hP:t==="task"?sP:bP}const NA=je({__name:"ToolCall",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e,{emit:t}){const n=e,s=t,o=F(()=>TP(n.tool));return(i,r)=>(w(),ve(Hs(o.value),{tool:e.tool,mobile:e.mobile,"stack-position":e.stackPosition,"tool-diff-panel":e.toolDiffPanel,onOpenMedia:r[0]||(r[0]=l=>s("openMedia",l)),onOpenFile:r[1]||(r[1]=l=>s("openFile",l)),onOpenToolDiff:r[2]||(r[2]=l=>s("openToolDiff",l)),onOpenAgent:r[3]||(r[3]=l=>s("openAgent",l))},null,40,["tool","mobile","stack-position","tool-diff-panel"]))}});function R_(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function MP(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 hh(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 EP(e){return!(e.tool.status==="ok"&&e.tool.media)}function IP(e,t){return t<=1?"single":e===0?"first":e===t-1?"last":"middle"}function $P(e){const t=hh(e),n=[];let s=[];const o=()=>{if(s.length===1){const[i]=s;i&&n.push({kind:"tool",tool:i.tool,sourceIndex:i.sourceIndex})}else s.length>1&&n.push({kind:"tool-stack",tools:s});s=[]};return t.forEach((i,r)=>{if(i.kind==="tool"){if(EP(i)){s.push({tool:i.tool,sourceIndex:r});return}o(),n.push({kind:"tool",tool:i.tool,sourceIndex:r});return}o(),i.kind==="thinking"?n.push({kind:"thinking",thinking:i.thinking,sourceIndex:r}):i.kind==="text"&&n.push({kind:"text",text:i.text,sourceIndex:r})}),o(),n}function NP(e){return hh(e).flatMap(t=>t.kind==="text"&&t.text?[t.text]:[]).join(`
|
|
40
40
|
|
|
41
41
|
`)}function LP(e){const t=[];for(const n of hh(e))if(n.kind==="thinking"&&n.thinking)t.push(`> **Thinking**
|
|
@@ -233,7 +233,7 @@ ${v}`);u+=$}else u+=O;u+=_,d=h?p+1:e.length}return u}function Xz(e,t){if(!e||!t.
|
|
|
233
233
|
<button class="copy-button" data-code="${_}">${A}</button>
|
|
234
234
|
</div>
|
|
235
235
|
<div class="code-editor"></div>
|
|
236
|
-
</div>`};const a=/^\[(\d+)\]/,c=/^\[([^\]\n]+)\]/,u=p=>{if(!p.startsWith("["))return!1;const h=c.exec(p);if(!h)return p!=="["&&!/^\[\d+$/.test(p);const f=String(h[1]??"");return p.slice(h[0].length).startsWith("(")?!1:!/^\d+$/.test(f)},d=(p,h)=>{const f=p;if(f.src[f.pos]!=="[")return!1;const m=a.exec(f.src.slice(f.pos));if(!m)return!1;const b=f.src.slice(Math.max(0,f.pos-120),f.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(b))return!1;const _=f.src.slice(f.pos+m[0].length);if(_.startsWith("](")||_.startsWith("(")||u(_))return!1;if(!h){const g=m[1],v=f.push("reference","span",0);v.content=g,v.markup=m[0],v.raw=m[0]}return f.pos+=m[0].length,!0};return n.inline.ruler.before("escape","reference",d),n.renderer.rules.reference=(p,h)=>{const m=String(p[h].content??"");return`<span class="reference-link" data-reference-id="${m}" role="button" tabindex="0" title="Click to view reference">${m}</span>`},n}function xU({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 OM({nextContent:e,persistedContent:t,currentState:n,typewriterEnabled:s,streamRenderVersionChanged:o=!1}){const i=`${n.settledContent}${n.streamedDelta}`;return s?n.streamedDelta&&i===e?o?{settledContent:i,streamedDelta:"",appended:!1}:{settledContent:n.settledContent,streamedDelta:n.streamedDelta,appended:!1}:xU({nextContent:e,previousContent:t??i,typewriterEnabled:s}):{settledContent:e,streamedDelta:"",appended:!1}}const I2=new WeakMap;function AU(e){let t=I2.get(e);return t||(t={inFlight:new Map,completed:new Set,registeredAllLangs:!1,registeredThemes:[],registeredLangs:[],tail:Promise.resolve()},I2.set(e,t)),t}function $2(e,t){if(!t?.length)return[...e];const n=[...e],s=new Set(n);for(const o of t)s.has(o)||(s.add(o),n.push(o));return n}function ey(e){return!!(e.themes?.length||e.langs?.length)}function PM(e,t){if(!t?.length)return!0;const n=new Set(e);return t.every(s=>n.has(s))}function TU(e,t){return!t?.length||e.registeredAllLangs?!0:PM(e.registeredLangs,t)}function Ig(e,t){return ey(t)&&PM(e.registeredThemes,t.themes)&&TU(e,t.langs)}function MU(e,t){if(!ey(t))return t;const n=$2(e.registeredThemes,t.themes),s=e.registeredAllLangs?[]:$2(e.registeredLangs,t.langs);return{...n.length?{themes:n}:{},...s.length?{langs:s}:{}}}const EU={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 IU(e){const t=String(e??"").trim();if(!t)return"";const[n=""]=t.split(/\s+/);return n.split(":")[0]?.trim().toLowerCase()??""}function RM(e){const t=IU(e);return EU[t]??t}function DM(e){if(!Array.isArray(e))return;const t=e.filter(s=>typeof s=="string").map(s=>RM(s)).filter(Boolean),n=Array.from(new Set(t)).sort();return n.length>0?n:void 0}function BM(e){if(!Array.isArray(e))return;const t=[],n=new Set;for(const s of e){if(typeof s!="string")continue;const o=s.trim();!o||n.has(o)||(n.add(o),t.push(o))}return t.length>0?t:void 0}function $U(e){return BM(e)?.join("\0")??""}function FM(e,t){const n=BM(e),s=DM(t);return{...n?.length?{themes:n}:{},...s?.length?{langs:s}:{}}}function Np(e,t){return`${$U(e)}\0\0${DM(t)?.join("\0")??""}`}function ihe(e,t,n={hasRegisterHighlight:!0,hasCreateRenderer:!0}){const s=FM(e,t),o={...s},i=!!(o.langs?.length&&n.hasCreateRenderer&&!n.hasRegisterHighlight);return i&&(delete s.langs,delete o.langs),{key:Np(o.themes,o.langs),registerOptions:s,rendererOptions:o,ignoredLangs:i}}async function rhe(e,t={},n){if(!e)return"ready";const s=FM(t.themes,t.langs),o=Np(s.themes,s.langs),i=n&&n===o?n:o,r=AU(e);if(r.completed.has(i))return"ready";if(Ig(r,s))return r.completed.add(i),"ready";const l=r.inFlight.get(i);if(l)return l;const a=r.tail.catch(()=>{}).then(()=>{if(r.completed.has(i)||Ig(r,s))return r.completed.add(i),"ready";const c=MU(r,s),u=Np(c.themes,c.langs);return r.completed.has(u)||Ig(r,c)?(r.completed.add(i),r.completed.add(u),"ready"):Promise.resolve(e(c)).then(()=>(ey(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 _a(e,t,n=1){const s=Number(e);return Number.isFinite(s)?Math.max(n,s):t}function N2(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var NU=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 p=this.source.length>0,h=this.pendingChars<=0;if(this.source+=d,h){const f=L2();this.startedAt=p&&this.hasStarted?f-this.normalizedStartDelayMs:f,this.lastTick=f,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=L2();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 p=1e3/Math.max(1,this.maxCommitFps),h=Math.min(100,Math.max(0,d-this.lastTick));if(h<p){this.rafId=requestAnimationFrame(this.tick);return}this.lastTick=d;const f=this.pendingChars,m=f>this.normalizedCatchUpThreshold?this.normalizedCatchUpLatencyMs:this.normalizedTargetLatencyMs,b=RU(f/Math.max(.001,m/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 _=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),g=PU(this.source.slice(this.visible.length),_,this.segmenter);g.text&&(this.visible+=g.text,this.charBudget=Math.max(0,this.charBudget-g.graphemeCount),this.emit()),this.ensureLoop()};const{minCharsPerSecond:n=40,maxCharsPerSecond:s=1e3,targetLatencyMs:o=900,catchUpLatencyMs:i=350,catchUpThreshold:r=600,maxCommitFps:l=30,startDelayMs:a=80,maxCharsPerCommit:c=80,flushOnFinish:u=!1}=e;this.minCharsPerSecond=_a(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,_a(s,1e3,1)),this.normalizedTargetLatencyMs=_a(o,900,1),this.normalizedCatchUpLatencyMs=_a(i,350,1),this.normalizedCatchUpThreshold=N2(r,600),this.normalizedStartDelayMs=N2(a,80),this.maxCommitFps=Math.trunc(_a(l,30,1)),this.maxCharsPerCommit=Math.trunc(_a(c,80,1)),this.flushOnFinish=u,this.segmenter=OU(),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 LU(e={},t){const n=new NU(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 OU(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function PU(e,t,n){if(!e||t<=0)return{text:"",graphemeCount:0};if(!n){const i=Array.from(e).slice(0,t);return{text:i.join(""),graphemeCount:i.length}}let s="",o=0;for(const i of n.segment(e)){if(o>=t)break;s+=i.segment,o++}return{text:s,graphemeCount:o}}function L2(){return typeof performance<"u"?performance.now():Date.now()}function RU(e,t,n){return Math.min(n,Math.max(t,e))}var DU=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const u1=Symbol.for("markstream-vue:node-lifecycle"),O2='<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>',P2='<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>',BU={id:"material",core:{"":P2,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:P2,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:O2,csharp:O2,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:()=>Xs(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},d1=new Map;let R2="material";const Fa=new Map,D2=new Map;let f1=null;function FU(e){d1.set(e.id,e)}function HU(e){return DU(this,null,function*(){var t,n,s;if(Fa.has(e.id))return(t=Fa.get(e.id))!=null?t:null;let o=D2.get(e.id);return o||(o=((s=(n=e.loadExtended)==null?void 0:n.call(e))!=null?s:Promise.resolve(null)).then(i=>(Fa.set(e.id,i),f1?.(),i)).catch(()=>(Fa.set(e.id,null),null)),D2.set(e.id,o)),o})}const WU=Ql(0);f1=()=>{WU.value++},FU(BU);const zU={"":"",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 ty(e){var t;const n=(function(s){if(!s)return"";const o=s.trim();if(!o)return"";const[i]=o.split(/\s+/),[r]=i.split(":");return r.toLowerCase()})(e);return(t=zU[n])!=null?t:n}function lhe(e){const t=ty(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return t}}function ahe(e){return(function(s){const o=d1.get(R2);if(!o)return;const i=o.core[s];if(i)return i;const r=Fa.get(o.id);if(r){const l=r[s];if(l)return l}o.loadExtended&&!Fa.has(o.id)&&HU(o)})(ty(e))||((n=(t=d1.get(R2))==null?void 0:t.fallback)!=null?n:"");var t,n}const che={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 HM=!1;function uhe(){return HM}function dhe(){HM=!0}var Mh=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});let Ao=null,$f=!1,Eh=sy;function Ih(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function ny(){try{const e=globalThis;return Ih(e?.katex)}catch{return null}}function sy(){return Mh(null,null,function*(){const e=ny();if(e)return e;const t=yield Xs(()=>import("./katex-DnlPpQZa.js"),[]);try{yield Xs(()=>import("./mhchem-DtR62fUK.js"),__vite__mapDeps([2,3]))}catch{}return Ih(t)})}function UU(e){Eh=e,Ao=null,$f=!1}function qU(e){UU(sy)}function WM(){return typeof Eh=="function"}function fhe(){var e;const t=Eh;if(!t||t===sy)return null;if(Ao)return Ao;const n=ny();if(n)return Ao=n,Ao;try{const s=t();return s&&typeof s?.then!="function"?(Ao=(e=Ih(s))!=null?e:s,Ao):null}catch{return null}}function oy(){return Mh(this,null,function*(){var e;const t=ny();if(t)return Ao=t,Ao;if(Ao)return Ao;if($f)return null;const n=Eh;if(!n)return $f=!0,null;try{const s=yield n();if(s)return Ao=(e=Ih(s))!=null?e:s,Ao}catch{}return $f=!0,null})}function zM(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let Fr=null,$r=null;const Yo=new Map,Zi=new Map;let Lp=5;const Rl=new Set;function Ku(){if(Yo.size<Lp&&Rl.size){const e=Array.from(Rl);Rl.clear();for(const t of e)try{t()}catch{}}}function jU(e){Fr=e,$r=null,Fr.onmessage=t=>{const{id:n,html:s,error:o}=t.data,i=Yo.get(n);if(i)if(Yo.delete(n),clearTimeout(i.timeoutId),Ku(),o)i.reject(new Error(o));else{const{content:r,displayMode:l}=t.data;if(r){const a=`${l?"d":"i"}:${r}`;if(Zi.set(a,s),Zi.size>200){const c=Zi.keys().next().value;Zi.delete(c)}}i.resolve(s)}},Fr.onerror=t=>{console.error("[katexWorkerClient] Worker error:",t);for(const[n,s]of Yo.entries())clearTimeout(s.timeoutId),s.reject(new Error(`Worker error: ${t.message}`));Yo.clear(),Ku()}}function VU(){var e;Fr&&((e=Fr.terminate)==null||e.call(Fr)),Fr=null,$r=null}function KU(e,t=!0,n=2e3,s){return Mh(this,null,function*(){performance.now();const o=zM(e);if(!WM()){const a=new Error("KaTeX rendering disabled");return a.name="KaTeXDisabled",a.code="KATEX_DISABLED",Promise.reject(a)}if($r)return Promise.reject($r);const i=`${t?"d":"i"}:${o}`,r=Zi.get(i);if(r)return Promise.resolve(r);const l=Fr||($r=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),$r.name="WorkerInitError",$r.code="WORKER_INIT_ERROR",null);if(!l)return Promise.reject($r);if(Yo.size>=Lp){const a=new Error("Worker busy");return a.name="WorkerBusy",a.code="WORKER_BUSY",a.busy=!0,a.inFlight=Yo.size,a.max=Lp,Promise.reject(a)}return new Promise((a,c)=>{if(s?.aborted){const f=new Error("Aborted");return f.name="AbortError",void c(f)}const u=Math.random().toString(36).slice(2),d=globalThis.setTimeout(()=>{Yo.delete(u);const f=new Error("Worker render timed out");f.name="WorkerTimeout",f.code="WORKER_TIMEOUT",c(f),Ku()},n);s&&s.addEventListener("abort",()=>{globalThis.clearTimeout(d),Yo.has(u)&&Yo.delete(u);const f=new Error("Aborted");f.name="AbortError",c(f),Ku()},{once:!0});const p=a,h=c;Yo.set(u,{resolve:f=>{p(f)},reject:f=>{h(f)},timeoutId:d}),l.postMessage({id:u,content:o,displayMode:t})})})}function phe(e,t=!0,n){const s=`${t?"d":"i"}:${zM(e)}`;if(Zi.set(s,n),Zi.size>200){const o=Zi.keys().next().value;Zi.delete(o)}}const GU="WORKER_BUSY";function YU(e=2e3,t){return Yo.size<Lp?Promise.resolve():new Promise((n,s)=>{let o,i=!1;const r=()=>{i||(i=!0,o&&globalThis.clearTimeout(o),Rl.delete(r),n())};if(Rl.add(r),o=globalThis.setTimeout(()=>{if(i)return;i=!0,Rl.delete(r);const l=new Error("Wait for worker slot timed out");l.name="WorkerBusyTimeout",l.code="WORKER_BUSY_TIMEOUT",s(l)},e),queueMicrotask(()=>Ku()),t){const l=()=>{if(i)return;i=!0,o&&globalThis.clearTimeout(o),Rl.delete(r);const a=new Error("Aborted");a.name="AbortError",s(a)};t.aborted?l():t.addEventListener("abort",l,{once:!0})}})}const Kc={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function hhe(e){return Mh(this,arguments,function*(t,n=!0,s={}){var o,i,r,l;if(!WM()){const m=new Error("KaTeX rendering disabled");throw m.name="KaTeXDisabled",m.code="KATEX_DISABLED",m}const a=(o=s.timeout)!=null?o:Kc.timeout,c=(i=s.waitTimeout)!=null?i:Kc.waitTimeout,u=(r=s.backoffMs)!=null?r:Kc.backoffMs,d=(l=s.maxRetries)!=null?l:Kc.maxRetries,p=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):Kc.maxRetries,h=s.signal;let f=0;for(;;){if(h?.aborted){const m=new Error("Aborted");throw m.name="AbortError",m}try{return yield KU(t,n,a,h)}catch(m){if(m?.code!==GU||f>=p)throw m;if(f++,yield YU(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*f)))}}})}function Ha(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function XU(e){var t;for(const n of e.split(/\r?\n/)){const s=n.trim();if(!s||s.startsWith("%%"))continue;const o=s.match(/^([A-Z][\w-]*)\b/i);return((t=o?.[1])==null?void 0:t.toLowerCase())||""}return""}function p1(e){const t=e.split(/\r?\n/).map(o=>o.trim()).filter(o=>o&&!o.startsWith("%%")),n=Math.max(1,t.length),s=XU(e);return s==="gantt"?220+28*n:s==="sequencediagram"?180+26*n:s==="classdiagram"||s==="statediagram"||s==="erdiagram"?180+24*n:s==="flowchart"||s==="graph"?170+28*n:200+22*n}function h1(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 UM(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function m1(e,t=360,n=500){return UM(e,t,n)}function g1(e,t=360,n=500){return UM(e,t,n)}var QU=Object.defineProperty,ZU=Object.defineProperties,JU=Object.getOwnPropertyDescriptors,B2=Object.getOwnPropertySymbols,eq=Object.prototype.hasOwnProperty,tq=Object.prototype.propertyIsEnumerable,F2=(e,t,n)=>t in e?QU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qM=(e,t)=>{for(var n in t||(t={}))eq.call(t,n)&&F2(e,n,t[n]);if(B2)for(var n of B2(t))tq.call(t,n)&&F2(e,n,t[n]);return e},iy=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const ry=()=>Xs(()=>import("./mermaid.core-D_lKT0dR.js").then(e=>e.bn),[]);let zi=null,ly=ry;function nq(e){ly=e,zi=null}function sq(e){nq(ry)}function oq(){return typeof ly=="function"}function H2(e){if(!e)return e;const t=e&&e.default?e.default:e;if(t&&(typeof t.render=="function"||typeof t.parse=="function"||typeof t.initialize=="function"))return t;if(t&&t.mermaidAPI&&(typeof t.mermaidAPI.render=="function"||typeof t.mermaidAPI.parse=="function")){const o=t.mermaidAPI;return n=qM({},t),s={render:o.render.bind(o),parse:o.parse?o.parse.bind(o):void 0,initialize:i=>typeof t.initialize=="function"?t.initialize(i):o.initialize?o.initialize(i):void 0},ZU(n,JU(s))}var n,s;return e.mermaid&&typeof e.mermaid.render=="function"?e.mermaid:t}function W2(e){if(e)try{const t=e?.initialize;e.initialize=n=>{const s=qM({suppressErrorRendering:!0},n||{});return typeof t=="function"?t.call(e,s):e?.mermaidAPI&&typeof e.mermaidAPI.initialize=="function"?e.mermaidAPI.initialize(s):void 0}}catch{}}function mhe(){return iy(this,null,function*(){if(zi)return zi;const e=(function(){try{const s=globalThis;return H2(s?.mermaid)}catch{return null}})();if(e)return zi=e,W2(zi),zi;const t=ly;if(!t)return null;let n;try{n=yield t()}catch(s){throw t===ry?new Error('Optional dependency "mermaid" is not installed. Please install it to enable mermaid diagrams.'):s}return n?(zi=H2(n),W2(zi),zi):null})}let Gs=null,Nr=null;const Ts=new Map;let z2=5,U2=!1;const iq="WORKER_BUSY",rq="MERMAID_DISABLED";function lq(e){Gs=e,Nr=null;const t=e;Gs.onmessage=n=>{if(Gs!==t)return;const{id:s,ok:o,result:i,error:r}=n.data,l=Ts.get(s);l&&(o===!1||r?l.reject(new Error(r||"Unknown error")):l.resolve(i))},Gs.onerror=n=>{var s,o;if(Gs===t)if(Ts.size!==0){try{U2?console.error("[mermaidWorkerClient] Worker error:",n?.message||n):(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker error:",n?.message||n)}catch{}for(const[i,r]of Ts.entries())r.reject(new Error(`Worker error: ${n.message}`));Ts.clear()}else(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker error (no pending):",n?.message||n)},Gs.onmessageerror=n=>{var s,o;if(Gs===t)if(Ts.size!==0){try{U2?console.error("[mermaidWorkerClient] Worker messageerror:",n):(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker messageerror:",n)}catch{}for(const[i,r]of Ts.entries())r.reject(new Error("Worker messageerror"));Ts.clear()}else(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",n)}}function aq(){var e;if(Gs)try{for(const[t,n]of Ts.entries())n.reject(new Error("Worker cleared"));Ts.clear(),(e=Gs.terminate)==null||e.call(Gs)}catch{}Gs=null,Nr=null}function jM(e,t,n=1400){if(!oq()){const o=new Error("Mermaid rendering disabled");return o.name="MermaidDisabled",o.code=rq,Promise.reject(o)}if(Nr)return Promise.reject(Nr);const s=Gs||(Nr=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),Nr.name="WorkerInitError",Nr.code="WORKER_INIT_ERROR",null);if(!s)return Promise.reject(Nr);if(Ts.size>=z2){const o=new Error("Worker busy");return o.name="WorkerBusy",o.code=iq,o.inFlight=Ts.size,o.max=z2,Promise.reject(o)}return new Promise((o,i)=>{const r=Math.random().toString(36).slice(2);let l,a=!1;const c=()=>{a||(a=!0,l!=null&&globalThis.clearTimeout(l),Ts.delete(r))},u={resolve:d=>{c(),o(d)},reject:d=>{c(),i(d)}};Ts.set(r,u);try{s.postMessage({id:r,action:e,payload:t})}catch(d){return Ts.delete(r),void i(d)}l=globalThis.setTimeout(()=>{const d=new Error("Worker call timed out");d.name="WorkerTimeout",d.code="WORKER_TIMEOUT";const p=Ts.get(r);p&&p.reject(d)},n)})}function ghe(e,t,n=1400){return iy(this,null,function*(){try{return yield jM("canParse",{code:e,theme:t},n)}catch(s){return Promise.reject(s)}})}function vhe(e,t,n=1400){return iy(this,null,function*(){try{return yield jM("findPrefix",{code:e,theme:t},n)}catch(s){return Promise.reject(s)}})}function yhe(){if(Gs)try{for(const[e,t]of Ts.entries())t.reject(new Error("Worker terminated"));Ts.clear(),Gs.terminate()}finally{Gs=null}}var cq=Object.defineProperty,uq=Object.defineProperties,dq=Object.getOwnPropertyDescriptors,q2=Object.getOwnPropertySymbols,fq=Object.prototype.hasOwnProperty,pq=Object.prototype.propertyIsEnumerable,j2=(e,t,n)=>t in e?cq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,it=(e,t)=>{for(var n in t||(t={}))fq.call(t,n)&&j2(e,n,t[n]);if(q2)for(var n of q2(t))pq.call(t,n)&&j2(e,n,t[n]);return e},Lt=(e,t)=>uq(e,dq(t)),zn=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const hq="__global__",$g="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",v1=(()=>{const e=globalThis;if(e[$g])return e[$g];const t={scopedCustomComponents:{},revision:Ql(0)};return e[$g]=t,t})(),V2=v1.revision,mq=Symbol("markstreamCustomComponents"),gq=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 dd(e){return gq.has(String(e).trim().toLowerCase())}function vq(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function Ng(e={}){const t={};for(const[n,s]of Object.entries(e))if(s!=null){t[n]=s;for(const o of new Set([si(n),si(vq(n))]))!o||dd(o)||Object.prototype.hasOwnProperty.call(t,o)||(t[o]=s)}return t}function cs(e){const t=Ut(mq,null);return F(()=>{var n;return V2.value,(function(s,o={}){return V2.value,it(it(it({},Ng(v1.scopedCustomComponents[hq]||{})),Ng(o)),Ng((function(i){return i&&v1.scopedCustomComponents[i]||{}})(s)))})(e?.(),(n=t?.value)!=null?n:{})})}const yq=["aria-label"],kq={key:0,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"checkbox-icon checkbox-unchecked"},bq={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"},un=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},Io=un(je({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(w(),N("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(w(),N("svg",bq,[...n[1]||(n[1]=[T("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",fill:"currentColor"},null,-1),T("path",{d:"M9 12l2 2 4-4",stroke:"hsl(var(--ms-background))","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(w(),N("svg",kq,[...n[0]||(n[0]=[T("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,yq))}),[["__scopeId","data-v-be21ab83"]]);Io.install=e=>{e.component(Io.__name,Io)};const _q={class:"emoji-node"},ho=un(je({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(w(),N("span",_q,R(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);ho.install=e=>{e.component(ho.__name,ho)};const wq=["id"],Sq=["title"],$o=un(je({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const t=`#fnref--${e.node.id}`;function n(){if(typeof document>"u")return;const s=document.querySelector(t);s?s.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${t} not found`)}return(s,o)=>(w(),N("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[T("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+R(e.node.id)+"]",9,Sq)],8,wq))}}),[["__scopeId","data-v-c1463a29"]]);$o.install=e=>{e.component($o.__name,$o)};const VM=(()=>{try{return!1}catch{}return!1})();function Lg(e){VM&&console.warn(e)}function K2(e,t="safe",n){return J0(e,t,n)}function KM(e){return nU(e)}function Og(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function ay(e,t="safe"){const n=String(e.tag||e.type||"").trim(),s=c1((o=e.attrs)?Array.isArray(o)?o.every(Array.isArray)?o.map(([r,l])=>[String(r),Og(l)]):o.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),Og(r.value)]):Object.entries(o).map(([r,l])=>[r,Og(l)]):null,t,n);var o;if(!s)return;const i=KM($p(s));return Object.keys(i).length>0?i:void 0}function G2(e,t,n=!1){const s=Object.entries(t??{}),o=s.length>0?s.map(([i,r])=>r===""?` ${i}`:` ${i}="${r}"`).join(""):"";return n?`<${e}${o} />`:`<${e}${o}>`}function Gc(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function Pg(e,t,n,s,o,i,r=!1){const l=(function(d,p){return IM(d,p)})(e,s);if(ad.has(e.toLowerCase())||!l&&TM(e,i))return null;if(!l&&Z0(e,i))return r?[G2(e,t,!0)]:[G2(e,t),...n,`</${e}>`];const a=J0(t,i,e),c=a.key,u=c!=null&&c!==""?c:o;if(l){const d=s[e]||s[e.toLowerCase()],p=KM(a);return cn(d,Lt(it({},p),{key:u}),n.length>0?n:void 0)}return cn(e,Lt(it({},a),{innerHTML:void 0,key:u}),n.length>0?n:void 0)}function GM(e,t){return rU(e,t)}function Op(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 p=Pg(d.tagName,d.attrs||{},[],r,"ms-html-"+a++,l,!0);Gc(c.length>0?c[c.length-1].children:u,p)}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 p=d.tagName.toLowerCase();let h=-1;for(let f=c.length-1;f>=0;f--)if(c[f].tagName.toLowerCase()===p){h=f;break}if(h!==-1)for(;c.length>h;){const f=c.pop(),m=Pg(f.tagName,f.attrs||{},f.children,r,f.autoKey,l);c.length>0?Gc(c[c.length-1].children,m):Gc(u,m),f.tagName.toLowerCase()!==p&&c.length>h&&Lg(`Auto-closing unclosed tag: <${f.tagName}>`)}else Lg(`Ignoring closing tag with no matching opening tag: </${d.tagName}>`)}for(;c.length>0;){const d=c.pop(),p=Pg(d.tagName,d.attrs||{},d.children,r,d.autoKey,l);c.length>0?Gc(c[c.length-1].children,p):Gc(u,p),Lg(`Auto-closing unclosed tag: <${d.tagName}>`)}return u})(sU(e),t,n)}catch(o){return s=o,VM&&console.error("Failed to parse HTML to VNodes:",s),null}var s}const Cq=["innerHTML"],No=un(je({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Ut("markstreamHtmlPolicy",void 0),s=F(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),o=cs(()=>t.customId),i=je({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=F(()=>{const l=t.node.content;if(!l)return{mode:"html",content:""};if(s.value==="escape")return{mode:"html",content:ec(l,s.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const c=Op(l,o.value,s.value);if(c!==null)return{mode:"dynamic",nodes:c}}if(!GM(l,o.value))return{mode:"html",content:ec(l,s.value)};const a=Op(l,o.value,s.value);return a===null?{mode:"html",content:ec(l,s.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>r.value.mode==="dynamic"?(w(),N("span",{key:0,class:Re(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[oe(x(i),{nodes:r.value.nodes},null,8,["nodes"])],2)):r.value.mode==="text"?(w(),N("span",{key:1,class:Re(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},R(r.value.content),3)):(w(),N("span",{key:2,class:Re(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,Cq))}}),[["__scopeId","data-v-d17f12b0"]]);No.install=e=>{e.component(No.__name,No)};const xq={class:"inline-code"},Aq={key:0},Us=un(je({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=nd(),s=Ut("markstreamFade",void 0),o=Ut("markstreamTextStreamState",void 0),i=Ut("markstreamStreamVersion",void 0),r=F(()=>{const g=n.fade;return g===""||g===!0||g==="true"||g!==!1&&g!=="false"&&void 0}),l=F(()=>typeof r.value=="boolean"?r.value:typeof s?.value!="boolean"||s.value),a=F(()=>{var g;return String((g=t.node.code)!=null?g:"")}),c=F(()=>!l.value),u=F(()=>{var g;const v=(g=n["index-key"])!=null?g:n.indexKey;return v==null||v===""?"":String(v)}),d=Z(t.node.code),p=Z("");let h=i?.value;const f=Z(0);function m(){return d.value+p.value}function b(){p.value&&(d.value=m(),p.value="")}Ke([()=>t.node.code,u,l,()=>i?.value],([g,v,y,A])=>{const O=String(g??""),$=u.value,k=A!==h;h=A;const E=OM({nextContent:O,persistedContent:$?o?.get($):void 0,currentState:{settledContent:d.value,streamedDelta:p.value},typewriterEnabled:l.value,streamRenderVersionChanged:k});d.value=E.settledContent,p.value=E.streamedDelta,E.appended&&(f.value+=1),$&&o?.set($,O)},{immediate:!0}),Ke(l,g=>{var v;g||(v=m(),d.value=v,p.value="")});const _=F(()=>f.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(g,v)=>(w(),N("code",xq,[c.value?(w(),N(Le,{key:0},[qe(R(a.value),1)],64)):(w(),N(Le,{key:1},[d.value?(w(),N("span",Aq,R(d.value),1)):ie("",!0),p.value?(w(),N("span",{key:1,class:Re(["inline-code-stream-delta",[_.value]]),onAnimationend:b},R(p.value),35)):ie("",!0)],64))]))}}),[["__scopeId","data-v-1b73ee4e"]]);Us.install=e=>{e.component(Us.__name,Us)};const y1=Z(!1),Y2=Z(""),X2=Z("top"),yu=Z(null),ku=Z(null),k1=Z(null),b1=Z(null),Q2=Z(null);let Nf=null,Lf=null,_1=0;function YM(){Nf&&(clearTimeout(Nf),Nf=null),Lf&&(clearTimeout(Lf),Lf=null)}let df=!1,ff=null,Z2=!1;function Tq(e,t,n="top",s=!1,o,i){if(!e)return;const r=++_1;YM();const l=()=>zn(null,null,function*(){var a,c;if(yield(function(){return zn(this,null,function*(){if(!df&&!Z2&&typeof document<"u"){ff!=null||(ff=zn(null,null,function*(){const[{createApp:u,h:d},{default:p}]=yield Promise.all([Xs(()=>import("./vue.runtime.esm-bundler-pgHGheCW.js"),[]),Xs(()=>import("./Tooltip-nEEfaYVY.js"),[])]),h=document.createElement("div");h.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(h),u({setup:()=>()=>{var f;return d(p,{visible:y1.value,"anchor-el":yu.value,content:Y2.value,placement:X2.value,id:ku.value,originX:k1.value,originY:b1.value,isDark:(f=Q2.value)!=null?f:void 0})}}).mount(h),df=!0}));try{yield ff}catch(u){df=!1,ff=null,Z2=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",u)}}})})(),df&&r===_1){ku.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,yu.value=e,Y2.value=t,X2.value=n,k1.value=(a=o?.x)!=null?a:null,b1.value=(c=o?.y)!=null?c:null,Q2.value=typeof i=="boolean"?i:null,y1.value=!0;try{e.setAttribute("aria-describedby",ku.value)}catch{}}});s?l():Nf=setTimeout(l,80)}function Mq(e=!1){_1+=1,YM();const t=()=>{if(yu.value&&ku.value)try{yu.value.removeAttribute("aria-describedby")}catch{}y1.value=!1,yu.value=null,ku.value=null,k1.value=null,b1.value=null};e?t():Lf=setTimeout(t,120)}const w1={"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..."},S1=e=>{var t;return(t=w1[e])!=null?t:(function(n){return(n.split(".").pop()||n).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,s=>s.toUpperCase()).trim()})(e)};function J2(e){return{t(t){if(e.te&&w1[t]&&!e.te(t))return S1(t);const n=e.t(t);return n===t&&w1[t]?S1(t):n}}}function Eq(){const e=(function(){var t,n;try{const s=Ls(),o=s?.proxy,i=o?.$t;if(typeof i=="function"){const a=o?.$te;return{t:i.bind(o),te:typeof a=="function"?a.bind(o):void 0}}const r=(n=(t=s?.appContext)==null?void 0:t.config)==null?void 0:n.globalProperties,l=r?.$t;if(typeof l=="function"){const a=r?.$te;return{t:l.bind(r),te:typeof a=="function"?a.bind(r):void 0}}}catch{}return null})();if(e)return J2(e);try{const t=globalThis.$vueI18nUse||null;if(t&&typeof t=="function")try{const n=t();if(n&&typeof n.t=="function")return J2({t:n.t.bind(n),te:typeof n.te=="function"?n.te.bind(n):void 0})}catch{}}catch{}return{t:S1}}function Iq(e,t){var n,s;const o=(s=(n=e.indexKey)!=null?n:t["index-key"])!=null?s:t.indexKey;return o==null||o===""?"":String(o)}const $q=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],Nq={key:1,class:"image-placeholder"},Lq={key:1,class:"image-node__raw-text"},Oq={key:0,class:"image-shimmer-overlay"},Pq={key:1,class:"image-node__raw-text"},Rq={key:2,class:"image-error"},qr=un(je({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},lazy:{type:Boolean,default:!1},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:t}){const n=e,s=t,o=Z(!1),i=Z(!1),r=Z(""),l=Z("primary"),a=Z(null),c=nd(),u=Ut(u1,null);let d="",p=null;const h=F(()=>Lw(n.node.src)),f=F(()=>Lw(n.fallbackSrc)),m=F(()=>r.value),b=F(()=>!n.lazy),_=F(()=>!n.node.loading&&l.value!=="failed"&&r.value.length>0),g=F(()=>l.value==="failed"),v=F(()=>!b.value&&!o.value&&!i.value&&l.value!=="failed"&&r.value.length>0),y=F(()=>Iq(n,c));function A(P=y.value){P&&a.value&&u?.reportHeight(P,a.value.offsetHeight)}function O(P=y.value){P&&ht(()=>{A(P)})}function $(){p&&(clearTimeout(p),p=null)}function k(){const P=y.value;P&&d!==P&&(d&&u?.markSettled(d),$(),d=P,u?.markPending(P),typeof window<"u"&&(p=window.setTimeout(()=>{d===P&&(O(P),E())},8e3)))}function E(){return zn(this,null,function*(){const P=d;P&&($(),d="",yield ht(),A(P),u?.markSettled(P))})}function M(){if(l.value==="primary"&&f.value&&f.value!==r.value)return l.value="fallback",r.value=f.value,o.value=!1,i.value=!1,void O();l.value="failed",i.value=!0,s("error",r.value),O()}function L(){o.value=!0,i.value=!1,s("load",m.value),O()}function S(P){P.preventDefault(),o.value&&!i.value&&s("click",[P,m.value])}const{t:I}=Eq();return Ke([h,f,()=>n.node.loading],()=>(o.value=!1,i.value=!1,n.node.loading||h.value?(r.value=h.value,void(l.value="primary")):f.value?(r.value=f.value,void(l.value="fallback")):(r.value="",l.value="failed",void(i.value=!0))),{immediate:!0}),Ke([_,o,i,m,()=>n.lazy],([P,D,W,z,q])=>P&&z&&!W?D?(E(),void O()):q?(k(),void O()):void(D||W||k()):(E(),void O()),{flush:"post",immediate:!0}),ls(()=>{(function(){const P=d;P&&($(),d="",u?.markSettled(P))})()}),(P,D)=>{var W,z,q,Q,X;return w(),N("span",{ref_key:"rootRef",ref:a,class:"image-node-container"},[_.value?(w(),N("img",{key:0,src:m.value,alt:String((z=(W=n.node.alt)!=null?W:n.node.title)!=null?z:""),title:String((Q=(q=n.node.title)!=null?q:n.node.alt)!=null?Q:""),class:Re(["image-node__img",{"is-loading":!b.value&&!o.value,"is-loaded":b.value||o.value,"has-natural-size":o.value,"cursor-pointer":o.value}]),loading:n.lazy?"lazy":void 0,fetchpriority:b.value?"high":void 0,decoding:b.value?"sync":"async",tabindex:o.value?0:-1,"aria-label":(X=n.node.alt)!=null?X:x(I)("image.preview"),onError:M,onLoad:L,onClick:S},null,42,$q)):ie("",!0),e.node.loading&&!i.value?(w(),N("span",Nq,[n.usePlaceholder?Cn(P.$slots,"placeholder",{key:0,node:n.node,displaySrc:m.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[D[0]||(D[0]=T("span",{class:"image-shimmer"},null,-1))],!0):(w(),N("span",Lq,R(e.node.raw),1))])):ie("",!0),oe(Gr,{name:"shimmer-fade"},{default:_e(()=>[v.value&&!e.node.loading?(w(),N("span",Oq,[n.usePlaceholder?Cn(P.$slots,"placeholder",{key:0,node:n.node,displaySrc:m.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[D[1]||(D[1]=T("span",{class:"image-shimmer"},null,-1))],!0):(w(),N("span",Pq,R(e.node.raw),1))])):ie("",!0)]),_:3}),g.value?(w(),N("span",Rq,[Cn(P.$slots,"error",{node:n.node,displaySrc:m.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[D[2]||(D[2]=T("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[T("path",{fill:"currentColor",d:"M2 2h20v10h-2V4H4v9.586l5-5L14.414 14L13 15.414l-4-4l-5 5V20h8v2H2zm13.547 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-3 1a3 3 0 1 1 6 0a3 3 0 0 1-6 0m3.625 6.757L19 17.586l2.828-2.829l1.415 1.415L20.414 19l2.829 2.828l-1.415 1.415L19 20.414l-2.828 2.829l-1.415-1.415L17.586 19l-2.829-2.828z"})],-1)),T("span",null,R(x(I)("image.loadError")),1)],!0)])):ie("",!0)],512)}}}),[["__scopeId","data-v-cbb5c63e"]]);qr.install=e=>{e.component(qr.__name,qr)};const Dq={key:2},Ni=je({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=cs(()=>t.customId),s=Ut("markstreamHtmlPolicy",void 0),o=Ut("markstreamNestedRendererProps",void 0),i=F(()=>{var f;return(f=s?.value)!=null?f:"safe"}),r=F(()=>{var f,m;const b=(f=o?.value)!=null?f:{};return Lt(it({},b),{customId:(m=t.customId)!=null?m:b.customId,htmlPolicy:i.value})}),l=ui({loader:()=>Promise.resolve().then(()=>my),suspensible:!1}),a=F(()=>t.components[String(t.node.type)]),c=F(()=>!!(a.value&&n.value[t.node.type]&&!dd(String(t.node.type)))),u=F(()=>c.value?ay(t.node,i.value):void 0),d=F(()=>Array.isArray(t.node.children)&&t.node.children.length>0),p=F(()=>{var f;return String((f=t.node.content)!=null?f:"")}),h=F(()=>{var f,m;return String((m=(f=t.node.content)!=null?f:t.node.raw)!=null?m:"")});return(f,m)=>a.value&&c.value?(w(),ve(Hs(a.value),dn({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:_e(()=>[d.value?(w(),ve(x(l),dn({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"])):p.value?(w(),ve(x(l),dn({key:1},r.value,{content:p.value,final:!e.node.loading,"index-key":`${e.indexKey||"child"}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ie("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):a.value?(w(),ve(Hs(a.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey},null,8,["node","custom-id","index-key"])):e.fallbackToText?(w(),N("span",Dq,R(h.value),1)):ie("",!0)}}),Bq=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],Fq={key:0,translate:"no",class:"markstream-pre__diff-code"},Hq={class:"markstream-pre__diff-number","aria-hidden":"true"},Wq={class:"markstream-pre__diff-content"},zq={class:"markstream-pre__diff-content-inner"},Uq={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},qq=["textContent"],xo=je({__name:"PreCodeNode",props:{node:{},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},reservedHeightPx:{}},setup(e){const t=e,n=F(()=>{var S,I,P;const D=String((I=(S=t.node)==null?void 0:S.language)!=null?I:"");return String((P=String(D).split(/\s+/g)[0])!=null?P:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),s=F(()=>`language-${n.value}`),o=F(()=>{var S,I,P,D,W;return((S=t.node)==null?void 0:S.diff)===!0?String((P=(I=t.node)==null?void 0:I.code)!=null?P:""):(function(z,q){const Q=String(z??"");return q?Q:Q.replace(/\r\n$|\n$|\r$/,"")})((D=t.node)==null?void 0:D.code,((W=t.node)==null?void 0:W.loading)===!0)}),i=F(()=>o.value.split(/\r\n|\n|\r/)),r=F(()=>Array.from({length:Math.max(1,i.value.length)},(S,I)=>I+1)),l=F(()=>{var S;return t.showLineNumbers===!0&&((S=t.node)==null?void 0:S.diff)===!0}),a=F(()=>l.value&&t.diffInline===!0),c=F(()=>{const S=Number(t.reservedHeightPx);if(!Number.isFinite(S)||S<=0)return;const I=`${Math.ceil(S)}px`;return{height:I,minHeight:I,maxHeight:I,overflow:"auto"}});function u(S){return String(S??"").trim().length===0}function d(S,I="context",P={}){const D=u(S);return{code:S,kind:D&&I!=="hunk"&&!P.preserveBlankKind?"context":I,empty:D}}function p(S){const I=String(S??"");return I?I.split(/\r\n|\n|\r/):[]}function h(S,I){return!u(S[I])||I<S.length-1}function f(S){return S.startsWith("-")&&!S.startsWith("---")}function m(S){return S.startsWith("+")&&!S.startsWith("+++")}function b(S,I){const P=p(S),D=p(I),W=(function(ye,Me){const we=ye.length,ze=Me.length;if((we+1)*(ze+1)>15e5)return null;const Ue=ze+1,Fe=new Uint32Array((we+1)*(ze+1));for(let G=1;G<=we;G++)for(let ne=1;ne<=ze;ne++){const H=G*Ue+ne;if(ye[G-1]===Me[ne-1])Fe[H]=Fe[(G-1)*Ue+(ne-1)]+1;else{const J=Fe[(G-1)*Ue+ne],ce=Fe[G*Ue+(ne-1)];Fe[H]=J>=ce?J:ce}}const rt=[];let le=we,U=ze;for(;le>0&&U>0;)ye[le-1]===Me[U-1]?(rt.push({originalIndex:le-1,modifiedIndex:U-1}),le--,U--):Fe[(le-1)*Ue+U]>=Fe[le*Ue+(U-1)]?le--:U--;return rt.reverse(),rt})(P,D);if(W){const ye=[];let Me=0,we=0;for(const ze of W){for(;Me<ze.originalIndex;)ye.push(Lt(it({},d(P[Me],"removed",{preserveBlankKind:h(P,Me)})),{key:`inline-removed-source-${Me}`,number:""})),Me++;for(;we<ze.modifiedIndex;)ye.push(Lt(it({},d(D[we],"added",{preserveBlankKind:h(D,we)})),{key:`inline-added-source-${we}`,number:we+1})),we++;ye.push(Lt(it({},d(D[ze.modifiedIndex])),{key:`inline-context-source-${ze.originalIndex}-${ze.modifiedIndex}`,number:ze.modifiedIndex+1})),Me=ze.originalIndex+1,we=ze.modifiedIndex+1}for(;Me<P.length;)ye.push(Lt(it({},d(P[Me],"removed",{preserveBlankKind:h(P,Me)})),{key:`inline-removed-source-${Me}`,number:""})),Me++;for(;we<D.length;)ye.push(Lt(it({},d(D[we],"added",{preserveBlankKind:h(D,we)})),{key:`inline-added-source-${we}`,number:we+1})),we++;return ye}const z=[];let q=0,Q=P.length-1,X=D.length-1;for(;q<=Q&&q<=X&&P[q]===D[q];)z.push(Lt(it({},d(D[q])),{key:`inline-prefix-${q}`,number:q+1})),q++;const fe=[];for(;Q>=q&&X>=q&&P[Q]===D[X];)fe.unshift(Lt(it({},d(D[X])),{key:`inline-suffix-${X}`,number:X+1})),Q--,X--;for(let ye=q;ye<=Q;ye++)z.push(Lt(it({},d(P[ye],"removed",{preserveBlankKind:h(P,ye)})),{key:`inline-removed-source-${ye}`,number:""}));for(let ye=q;ye<=X;ye++)z.push(Lt(it({},d(D[ye],"added",{preserveBlankKind:h(D,ye)})),{key:`inline-added-source-${ye}`,number:ye+1}));return z.concat(fe)}const _=F(()=>{var S,I,P,D;const W=(function(X){const fe=X.some(Me=>f(Me)),ye=X.some(Me=>m(Me));return fe&&ye||(function(){var Me,we,ze,Ue;if(n.value==="diff")return!0;const Fe=(Ue=(ze=String((we=(Me=t.node)==null?void 0:Me.raw)!=null?we:"").split(/\r?\n/,1)[0])==null?void 0:ze.trim())!=null?Ue:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(Fe)})()&&(fe||ye)})(i.value),z=(function(){var X,fe;return((X=t.node)==null?void 0:X.originalCode)!=null||((fe=t.node)==null?void 0:fe.updatedCode)!=null})();if(a.value)return[{key:"inline",className:"markstream-pre__diff-pane--inline",lines:W?(function(X){const fe=[];let ye=1;for(const[Me,we]of X.entries())if(we.startsWith("@@"))fe.push(Lt(it({},d(we,"hunk")),{key:`inline-hunk-${Me}`,number:""}));else if(f(we))fe.push(Lt(it({},d(we.slice(1),"removed",{preserveBlankKind:!0})),{key:`inline-removed-${Me}`,number:""}));else if(m(we))fe.push(Lt(it({},d(we.slice(1),"added",{preserveBlankKind:!0})),{key:`inline-added-${Me}`,number:ye++}));else{const ze=we.startsWith(" ")?we.slice(1):we;fe.push(Lt(it({},d(ze)),{key:`inline-context-${Me}`,number:ye})),ye++}return fe})(i.value):b((S=t.node)==null?void 0:S.originalCode,(I=t.node)==null?void 0:I.updatedCode)}];if(!W&&z){const X=p((P=t.node)==null?void 0:P.originalCode),fe=p((D=t.node)==null?void 0:D.updatedCode);return[{key:"original",className:"markstream-pre__diff-pane--original",lines:X.map((ye,Me)=>{const we=fe[Me]===ye?"context":"removed";return Lt(it({},d(ye,we,{preserveBlankKind:h(X,Me)})),{key:`original-${Me}`,number:Me+1})})},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:fe.map((ye,Me)=>{const we=X[Me]===ye?"context":"added";return Lt(it({},d(ye,we,{preserveBlankKind:h(fe,Me)})),{key:`modified-${Me}`,number:Me+1})})}]}const q=[],Q=[];for(const X of i.value)if(X.startsWith("@@"))q.push(d(X,"hunk")),Q.push(d(X,"hunk"));else if(X.startsWith("-")&&!X.startsWith("---"))q.push(d(X.slice(1),"removed",{preserveBlankKind:!0}));else if(X.startsWith("+")&&!X.startsWith("+++"))Q.push(d(X.slice(1),"added",{preserveBlankKind:!0}));else{const fe=X.startsWith(" ")?X.slice(1):X;q.push(d(fe)),Q.push(d(fe))}return[{key:"original",className:"markstream-pre__diff-pane--original",lines:q.map((X,fe)=>Lt(it({},X),{key:`original-${fe}`,number:fe+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:Q.map((X,fe)=>Lt(it({},X),{key:`modified-${fe}`,number:fe+1}))}]}),g=F(()=>{const S=n.value;return S?`Code block: ${S}`:"Code block"}),v=Z(null),y=Z([]);let A=null,O=null;function $(S){const I=Number.parseFloat(String(S??""));return Number.isFinite(I)&&I>0?I:0}function k(S,I){var P;if(!S)return I;const D=S.querySelector(".markstream-pre__diff-content"),W=D?.getBoundingClientRect(),z=(P=W?.height)!=null?P:0;return Math.max(I,Math.ceil(z))}function E(){typeof window<"u"&&(A!=null&&window.cancelAnimationFrame(A),A=window.requestAnimationFrame(()=>{(function(){var S,I;A=null;const P=v.value;if(!P||!l.value)return void(y.value.length&&(y.value=[]));const D=(function(ye){const Me=window.getComputedStyle(ye),we=$(Me.getPropertyValue("--markstream-pre-diff-line-height"));if(we>0)return we;const ze=$(Me.lineHeight);return ze>0?ze:18})(P),W=Array.from(P.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),z=Array.from(P.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),q=Math.max(W.length,z.length),Q=[];for(let ye=0;ye<q;ye++){const Me=k((S=W[ye])!=null?S:null,D),we=k((I=z[ye])!=null?I:null,D),ze=Math.max(D,Me,we);Q.push({rowHeight:ze,originalHeight:Me,modifiedHeight:we})}var X,fe;X=y.value,fe=Q,X.length===fe.length&&X.every((ye,Me)=>{const we=fe[Me];return we&&Math.abs(ye.rowHeight-we.rowHeight)<=.5&&Math.abs(ye.originalHeight-we.originalHeight)<=.5&&Math.abs(ye.modifiedHeight-we.modifiedHeight)<=.5})||(y.value=Q)})()}))}function M(S){O?.disconnect(),O=null,S&&l.value&&typeof ResizeObserver<"u"&&(O=new ResizeObserver(()=>{E()}),O.observe(S))}function L(S,I){const P=y.value[S];if(!P)return;const D=I==="original"?P.originalHeight:P.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(P.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(D)}px`}}return Ke(v,S=>{M(S),ht(()=>E())},{flush:"post"}),Ke([l,_],()=>{M(v.value),ht(()=>E())},{flush:"post",immediate:!0}),ls(()=>{A!=null&&(window.cancelAnimationFrame(A),A=null),O?.disconnect(),O=null}),(S,I)=>(w(),N("pre",{ref_key:"preRef",ref:v,style:Gt(c.value),class:Re([s.value,{"markstream-pre--line-numbers":t.showLineNumbers,"markstream-pre--diff-preview":l.value,"markstream-pre--diff-inline":a.value}]),"aria-busy":e.node.loading===!0,"aria-label":g.value,"data-language":n.value,"data-markstream-line-numbers":t.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"},[l.value?(w(),N("code",Fq,[(w(!0),N(Le,null,nt(_.value,P=>(w(),N("span",{key:P.key,class:Re(["markstream-pre__diff-pane",P.className])},[(w(!0),N(Le,null,nt(P.lines,(D,W)=>(w(),N("span",{key:D.key,class:Re(["markstream-pre__diff-line",[`markstream-pre__diff-line--${D.kind}`,{"markstream-pre__diff-line--empty":D.empty}]]),style:Gt(L(W,P.key))},[I[0]||(I[0]=T("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),T("span",Hq,R(D.number),1),T("span",Wq,[T("span",zq,R(D.code),1)])],6))),128))],2))),128))])):(w(),N(Le,{key:1},[t.showLineNumbers?(w(),N("span",Uq,[(w(!0),N(Le,null,nt(r.value,P=>(w(),N("span",{key:P,class:"markstream-pre__line-number"},R(P),1))),128))])):ie("",!0),T("code",{translate:"no",class:"markstream-pre__code",textContent:R(o.value)},null,8,qq)],64))],14,Bq))}});xo.install=e=>{e.component(xo.__name,xo)};const Rg=Ql(!1);let eS=null;const jq={key:0},Xn=un(je({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=(eS||(eS=oy().then(_=>{Rg.value=!!_}).catch(()=>{Rg.value=!1})),Vf(Rg)),s=nd(),o=Ut("markstreamFade",void 0),i=Ut("markstreamTextStreamState",void 0),r=Ut("markstreamStreamVersion",void 0),l=F(()=>{const _=s.fade;return _===""||_===!0||_==="true"||_!==!1&&_!=="false"&&void 0}),a=F(()=>typeof l.value=="boolean"?l.value:typeof o?.value!="boolean"||o.value),c=F(()=>{var _;const g=(_=s["index-key"])!=null?_:s.indexKey;return g==null||g===""?"":String(g)}),u=Z(t.node.content),d=Z("");let p=r?.value;const h=Z(0);function f(){return u.value+d.value}function m(){d.value&&(u.value=f(),d.value="")}Ke([()=>t.node.content,c,a,()=>r?.value],([_,g,v,y])=>{const A=String(_??""),O=c.value,$=y!==p;p=y;const k=OM({nextContent:A,persistedContent:O?i?.get(O):void 0,currentState:{settledContent:u.value,streamedDelta:d.value},typewriterEnabled:a.value,streamRenderVersionChanged:$});u.value=k.settledContent,d.value=k.streamedDelta,k.appended&&(h.value+=1),O&&i?.set(O,A)},{immediate:!0}),Ke(a,_=>{var g;_||(g=f(),u.value=g,d.value="")});const b=F(()=>h.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(_,g)=>(w(),N("span",{class:Re([[x(n)&&e.node.center?"text-node-center":""],"text-node"])},[u.value?(w(),N("span",jq,R(u.value),1)):ie("",!0),d.value?(w(),N("span",{key:1,class:Re(["text-node-stream-delta",[b.value]]),onAnimationend:m},R(d.value),35)):ie("",!0)],2))}}),[["__scopeId","data-v-aae85f13"]]);Xn.install=e=>{e.component(Xn.__name,Xn)};const XM=je({name:"CodeBlockNodeLoading",inheritAttrs:!1,setup(e,{attrs:t}){const n=t;return()=>{var s;return cn(xo,Lt(it({},t),{node:n.node,showLineNumbers:!0,reservedHeightPx:(s=n.estimatedHeightPx)!=null?s:n.estimatedContentHeightPx,class:["code-pre-fallback",t.class],"data-markstream-code-loading":"1"}))}}}),Dg=ui({loader:()=>zn(null,null,function*(){try{return(yield Xs(()=>import("./CodeBlockNode-Bsvp6ZEy.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),xo}}),loadingComponent:XM,delay:0,suspensible:!1}),gi=ui(()=>zn(null,null,function*(){var e;if(((e=(function(){const t=Reflect.get(globalThis,"process");return t?.env})())==null?void 0:e.NODE_ENV)==="test"&&typeof window<"u")return t=>{var n,s,o,i;return cn(Xn,Lt(it({},t),{node:{type:"text",content:(s=t.node.raw)!=null?s:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(o=t.node.content)!=null?o:""}$`}}))};try{if(yield oy())return(yield Xs(()=>import("./index6-BxiXA2yo.js"),[])).default}catch(t){console.warn('[markstream-vue] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',t)}return t=>{var n,s,o,i;return cn(Xn,Lt(it({},t),{node:{type:"text",content:(s=t.node.raw)!=null?s:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(o=t.node.content)!=null?o:""}$`}}))}})),QM=ui(()=>zn(null,null,function*(){try{if(yield oy())return(yield Xs(()=>import("./index5-DlVoNkCD.js"),[])).default}catch(e){console.warn('[markstream-vue] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',e)}return e=>{var t,n,s,o;return cn(Xn,Lt(it({},e),{node:{type:"text",content:(n=e.node.raw)!=null?n:`$$${(t=e.node.content)!=null?t:""}$$`,raw:(o=e.node.raw)!=null?o:`$$${(s=e.node.content)!=null?s:""}$$`}}))}})),Zs=un(je({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(w(),N("span",{class:"reference-node cursor-pointer text-xs rounded-md px-1.5 mx-0.5",role:"button",tabindex:"0",onClick:n[0]||(n[0]=s=>t.$emit("click",s,e.node.id,e.messageId,e.threadId)),onMouseenter:n[1]||(n[1]=s=>t.$emit("mouseEnter",s,e.node.id,e.messageId,e.threadId)),onMouseleave:n[2]||(n[2]=s=>t.$emit("mouseLeave",s,e.node.id,e.messageId,e.threadId))},R(e.node.id),33))}),[["__scopeId","data-v-775c65e4"]]);Zs.install=e=>{e.component(Zs.__name,Zs)};const Vq={class:"superscript-node"},mo=un(je({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=cs(()=>t.customId),s=F(()=>it({text:Xn,inline_code:Us,link:to,html_inline:No,strong:Js,emphasis:no,footnote_reference:$o,strikethrough:eo,highlight:Lo,insert:vo,subscript:go,emoji:ho,math_inline:gi,reference:Zs},n.value));return(o,i)=>(w(),N("sup",Vq,[(w(!0),N(Le,null,nt(e.node.children,(r,l)=>(w(),ve(x(Ni),{key:`${e.indexKey||"superscript"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"superscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-24160b22"]]);mo.install=e=>{e.component(mo.__name,mo)};const Kq={class:"subscript-node"},go=un(je({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=cs(()=>t.customId),s=F(()=>it({text:Xn,inline_code:Us,link:to,html_inline:No,strong:Js,emphasis:no,footnote_reference:$o,strikethrough:eo,highlight:Lo,insert:vo,superscript:mo,emoji:ho,math_inline:gi,reference:Zs},n.value));return(o,i)=>(w(),N("sub",Kq,[(w(!0),N(Le,null,nt(e.node.children,(r,l)=>(w(),ve(x(Ni),{key:`${e.indexKey||"subscript"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"subscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-197fa13b"]]);go.install=e=>{e.component(go.__name,go)};const Gq={class:"strong-node"},Js=un(je({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=cs(()=>t.customId),s=F(()=>it({text:Xn,inline_code:Us,link:to,html_inline:No,emphasis:no,strikethrough:eo,highlight:Lo,insert:vo,subscript:go,superscript:mo,emoji:ho,footnote_reference:$o,math_inline:gi,reference:Zs},n.value));return(o,i)=>(w(),N("strong",Gq,[(w(!0),N(Le,null,nt(e.node.children,(r,l)=>(w(),ve(x(Ni),{key:`${e.indexKey||"strong"}-${l}`,components:s.value,node:r,"index-key":`${e.indexKey||"strong"}-${l}`,"custom-id":t.customId},null,8,["components","node","index-key","custom-id"]))),128))]))}}),[["__scopeId","data-v-a8647104"]]);Js.install=e=>{e.component(Js.__name,Js)};const Yq={class:"strikethrough-node"},eo=un(je({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=cs(()=>t.customId),s=F(()=>it({text:Xn,inline_code:Us,link:to,html_inline:No,strong:Js,emphasis:no,highlight:Lo,insert:vo,subscript:go,superscript:mo,emoji:ho,footnote_reference:$o,math_inline:gi,reference:Zs},n.value));return(o,i)=>(w(),N("del",Yq,[(w(!0),N(Le,null,nt(e.node.children,(r,l)=>(w(),ve(x(Ni),{key:`${e.indexKey||"strikethrough"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"strikethrough"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-b7a531fa"]]);eo.install=e=>{e.component(eo.__name,eo)};const Xq=["href","title","aria-label","aria-hidden","target","rel"],Qq=["aria-hidden"],Zq={class:"link-text-wrapper relative inline-flex"},Jq={class:"leading-[normal] link-text"},to=un(je({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=Ut("markstreamShowTooltips",void 0),s=F(()=>{const _=n?.value;return typeof _=="boolean"?_:t.showTooltip}),o=F(()=>{var _,g,v,y,A;const O=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",$=(_=t.animationOpacity)!=null?_:.35,k=Math.max(.12,Math.min(.5*$,$)),E={"--underline-height":`${(g=t.underlineHeight)!=null?g:2}px`,"--underline-bottom":O,"--underline-opacity":String($),"--underline-rest-opacity":String(k),"--underline-duration":`${(v=t.animationDuration)!=null?v:1.6}s`,"--underline-timing":(y=t.animationTiming)!=null?y:"ease-in-out","--underline-iteration":typeof t.animationIteration=="number"?String(t.animationIteration):(A=t.animationIteration)!=null?A:"infinite"};return t.color&&(E["--link-color"]=t.color),E}),i=cs(()=>t.customId),r=F(()=>it({text:Xn,strong:Js,strikethrough:eo,emphasis:no,image:qr,html_inline:No,inline_code:Us},i.value)),l=nd(),a=F(()=>{var _,g;const v=(_=t.node)==null?void 0:_.attrs;if(!v||typeof v!="object")return{};const y={};if(Array.isArray(v))for(const A of v)Array.isArray(A)&&A[0]&&(y[String(A[0])]=String((g=A[1])!=null?g:""));else for(const[A,O]of Object.entries(v))A&&O!=null&&O!==!1&&(y[A]=O===!0?"":String(O));return K2(y,"safe","a")}),c=F(()=>it(it({},l),a.value)),u=F(()=>{var _,g;return K2({href:String((g=(_=t.node)==null?void 0:_.href)!=null?g:"")},"safe","a").href}),d=F(()=>{if(!u.value)return;const _=c.value.target;return(typeof _=="string"?_.trim():String(_??"").trim())||(U9(u.value)?"_blank":void 0)}),p=F(()=>{var _;return String((_=d.value)!=null?_:"").trim().toLowerCase()==="_blank"}),h=F(()=>{if(!u.value)return;const _=c.value.rel,g=new Set((typeof _=="string"?_:String(_??"")).split(/\s+/).filter(Boolean)),v=new Set(Array.from(g).filter(y=>y.toLowerCase()!=="opener"));return p.value&&(v.add("noopener"),v.add("noreferrer")),v.size>0?Array.from(v).join(" "):void 0}),f=F(()=>{const _=it({},c.value);return delete _.title,delete _.href,delete _.target,delete _.rel,_});function m(){s.value&&Mq()}const b=F(()=>{var _,g;const v=(_=t.node)==null?void 0:_.title;return typeof v=="string"&&v.trim().length>0?v:String((g=u.value)!=null?g:"")});return(_,g)=>{var v,y;return e.node.loading?(w(),N("span",dn({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},x(l),{style:o.value}),[T("span",Zq,[T("span",Jq,[oe(x(Xn),{class:"leading-[normal] link-text",node:{type:"text",content:String((v=e.node.text)!=null?v:""),raw:String((y=e.node.text)!=null?y:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),g[1]||(g[1]=T("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,Qq)):(w(),N("a",dn({key:0,class:"link-node",href:u.value,title:s.value?"":b.value,"aria-label":`Link: ${b.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:h.value},f.value,{style:o.value,onMouseenter:g[0]||(g[0]=A=>(function(O){var $,k,E,M;if(!s.value)return;const L=O,S=L?.clientX!=null&&L?.clientY!=null?{x:L.clientX,y:L.clientY}:void 0,I=(($=t.node)==null?void 0:$.title)||((k=u.value)!=null&&k.includes("xn--")&&((M=(E=t.node)==null?void 0:E.text)!=null&&M.includes("://"))?t.node.text:u.value)||"";Tq(O.currentTarget,I,"top",!1,S)})(A)),onMouseleave:m}),[(w(!0),N(Le,null,nt(e.node.children,(A,O)=>(w(),ve(x(Ni),{key:`${e.indexKey||"emphasis"}-${O}`,components:r.value,node:A,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${O}`},null,8,["components","node","custom-id","index-key"]))),128))],16,Xq))}}}),[["__scopeId","data-v-367e6ca4"]]);to.install=e=>{e.component(to.__name,to)};const ej={class:"insert-node"},vo=un(je({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=cs(()=>t.customId),s=F(()=>it({text:Xn,inline_code:Us,link:to,html_inline:No,strong:Js,emphasis:no,strikethrough:eo,highlight:Lo,subscript:go,superscript:mo,emoji:ho,footnote_reference:$o,math_inline:gi,reference:Zs},n.value));return(o,i)=>(w(),N("ins",ej,[(w(!0),N(Le,null,nt(e.node.children,(r,l)=>(w(),ve(x(Ni),{key:`${e.indexKey||"insert"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"insert"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-1e2c29d4"]]);vo.install=e=>{e.component(vo.__name,vo)};const tj={class:"highlight-node"},Lo=un(je({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=cs(()=>t.customId),s=F(()=>it({text:Xn,inline_code:Us,link:to,html_inline:No,strong:Js,emphasis:no,strikethrough:eo,insert:vo,subscript:go,superscript:mo,emoji:ho,footnote_reference:$o,math_inline:gi,reference:Zs},n.value));return(o,i)=>(w(),N("mark",tj,[(w(!0),N(Le,null,nt(e.node.children,(r,l)=>(w(),ve(x(Ni),{key:`${e.indexKey||"highlight"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"highlight"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-7a62982a"]]);Lo.install=e=>{e.component(Lo.__name,Lo)};const nj={class:"emphasis-node"},no=un(je({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=cs(()=>t.customId),s=F(()=>it({text:Xn,inline_code:Us,link:to,html_inline:No,strong:Js,strikethrough:eo,highlight:Lo,insert:vo,subscript:go,superscript:mo,emoji:ho,footnote_reference:$o,math_inline:gi,reference:Zs},n.value));return(o,i)=>(w(),N("em",nj,[(w(!0),N(Le,null,nt(e.node.children,(r,l)=>(w(),ve(x(Ni),{key:`${e.indexKey||"emphasis"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"emphasis"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-2a5aafbf"]]);no.install=e=>{e.component(no.__name,no)};const sj={class:"hard-break"},jr=un(je({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(w(),N("br",sj))}),[["__scopeId","data-v-50c58f70"]]);jr.install=e=>{e.component(jr.__name,jr)};const Gu=je({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=Dr({checkbox:Io,checkbox_input:Io,emoji:ho,emphasis:no,hardbreak:jr,highlight:Lo,inline_code:Us,insert:vo,link:to,reference:Zs,strikethrough:eo,strong:Js,subscript:go,superscript:mo,text:Xn}),s=cs(()=>t.customId),o=F(()=>{const i=s.value;return Object.keys(i).length>0?it(it({},n),i):n});return(i,r)=>(w(!0),N(Le,null,nt(e.nodes,(l,a)=>(w(),ve(x(Ni),{key:a,components:o.value,node:l,"custom-id":t.customId,"index-key":`${e.indexKey||"inline"}-${a}`},null,8,["components","node","custom-id","index-key"]))),128))}});function C1(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(C1)}function Pp(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(C1))return e;if(!t||e.length!==1)return null;const s=e[0];if(s?.type!=="paragraph"||!Array.isArray(s.children))return null;const o=s.children;return(n||o.length>0)&&o.every(C1)?o:null}function dc(e){var t,n;if(!e?.length)return null;let s="";for(const o of e){if(o?.type!=="text"||o.center===!0)return null;s+=String((n=(t=o.content)!=null?t:o.raw)!=null?n:"")}return s}const oj=["cite"],ij={key:0,dir:"auto",class:"paragraph-node"},rj=["custom-id"],Of=un(je({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=cs(()=>t.customId),s=F(()=>!!n.value.paragraph),o=F(()=>!!n.value.text),i=F(()=>Pp(t.node.children,!s.value)),r=F(()=>t.fade!==!1||o.value?null:dc(i.value));return En("markstreamShowTooltips",F(()=>t.showTooltips)),En("markstreamFade",F(()=>t.fade)),(l,a)=>(w(),N("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[i.value?(w(),N("p",ij,[r.value!==null?(w(),N("span",{key:0,class:"text-node","custom-id":t.customId},R(r.value),9,rj)):(w(),ve(x(Gu),{key:1,nodes:i.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(w(),ve(x(yo),{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,oj))}}),[["__scopeId","data-v-abfecebc"]]);Of.install=e=>{e.component(Of.__name,Of)};const lj={class:"definition-list"},aj={class:"definition-term"},cj={class:"definition-desc"},Pf=un(je({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,s)=>(w(),N("dl",lj,[(w(!0),N(Le,null,nt(t.node.items,(o,i)=>(w(),N(Le,{key:i},[T("dt",aj,[oe(x(yo),{"index-key":`definition-term-${t.indexKey}-${i}`,nodes:o.term,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:s[0]||(s[0]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])]),T("dd",cj,[oe(x(yo),{"index-key":`definition-desc-${t.indexKey}-${i}`,nodes:o.definition,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:s[1]||(s[1]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],64))),128))]))}}),[["__scopeId","data-v-4e103b30"]]);Pf.install=e=>{e.component(Pf.__name,Pf)};const uj=["href","title"],bu=un(je({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const t=e;function n(s){var o;if(s.preventDefault(),typeof document>"u")return;const i=`fnref-${String((o=t.node.id)!=null?o:"")}`,r=document.getElementById(i);r&&r.scrollIntoView({behavior:"smooth",block:"center"})}return(s,o)=>(w(),N("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,uj))}}),[["__scopeId","data-v-e1eb37b6"]]);bu.install=e=>{e.component(bu.__name,bu)};const dj=["id"],fj={class:"flex-1"},Rf=je({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,s)=>(w(),N("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[T("div",fj,[oe(x(yo),{"index-key":`footnote-${t.indexKey}`,nodes:t.node.children,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:s[0]||(s[0]=o=>n.$emit("copy",o))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],8,dj))}});Rf.install=e=>{e.component(Rf.__name,Rf)};const pj=["custom-id"],x1=un(je({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=cs(()=>t.customId),s=Ut("markstreamFade",void 0),o=F(()=>s?.value!==!1||n.value.text?null:dc(t.node.children)),i=F(()=>it({text:Xn,inline_code:Us,link:to,image:qr,strong:Js,emphasis:no,strikethrough:eo,highlight:Lo,insert:vo,subscript:go,superscript:mo,emoji:ho,checkbox:Io,checkbox_input:Io,footnote_reference:$o,hardbreak:jr,math_inline:gi,reference:Zs},n.value));return(r,l)=>(w(),ve(Hs(`h${e.node.level}`),dn({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:_e(()=>[o.value!==null?(w(),N("span",{key:0,class:"text-node","custom-id":t.customId},R(o.value),9,pj)):(w(!0),N(Le,{key:1},nt(e.node.children,(a,c)=>(w(),ve(x(Ni),{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"]]),Rp=x1;Rp.install=e=>{e.component(x1.__name,x1)};const hj={key:0,dir:"auto",class:"paragraph-node"},mj=["custom-id"],gj={dir:"auto",class:"paragraph-node"},vj=["custom-id"],tc=un(je({__name:"ListItemNode",props:{node:{},item:{},indexKey:{},customId:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},value:{},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=F(()=>{var h;return(h=t.node)!=null?h:t.item}),s=cs(()=>t.customId),o=F(()=>!!s.value.paragraph),i=F(()=>!!s.value.text),r=F(()=>{var h;return Pp((h=n.value)==null?void 0:h.children,!o.value)}),l=F(()=>{var h;if(o.value)return null;const f=(h=n.value)==null?void 0:h.children;if(!Array.isArray(f)||f.length<2)return null;const m=f[0];if(m?.type!=="paragraph"||!Array.isArray(m.children))return null;const b=f.slice(1);if(!b.every(g=>g?.type==="list"))return null;const _=Pp([m]);return _?{paragraphChildren:_,nestedLists:b}:null});function a(){return t.fade===!1&&!i.value}const c=F(()=>a()?dc(r.value):null),u=F(()=>{var h;return a()?dc((h=l.value)==null?void 0:h.paragraphChildren):null}),d=Object.freeze({}),p=F(()=>{const{value:h}=t;return typeof h=="number"&&Number.isFinite(h)?{value:h}:d});return En("markstreamShowTooltips",F(()=>t.showTooltips)),En("markstreamFade",F(()=>t.fade)),(h,f)=>{var m,b;return w(),N("li",dn({class:"list-item",dir:"auto"},p.value),[r.value?(w(),N("p",hj,[c.value!==null?(w(),N("span",{key:0,class:"text-node","custom-id":t.customId},R(c.value),9,mj)):(w(),ve(x(Gu),{key:1,nodes:r.value,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):l.value?(w(),N(Le,{key:1},[T("p",gj,[u.value!==null?(w(),N("span",{key:0,class:"text-node","custom-id":t.customId},R(u.value),9,vj)):(w(),ve(x(Gu),{key:1,nodes:l.value.paragraphChildren,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))]),(w(!0),N(Le,null,nt(l.value.nestedLists,(_,g)=>(w(),ve(x(yo),{key:g,nodes:[_],"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-nested-${g}`,"show-tooltips":t.showTooltips,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0,onCopy:f[0]||(f[0]=v=>h.$emit("copy",v))},null,8,["nodes","custom-id","index-key","show-tooltips","typewriter","fade","is-dark"]))),128))],64)):(w(),ve(x(yo),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(b=(m=n.value)==null?void 0:m.children)!=null?b:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,onCopy:f[1]||(f[1]=_=>h.$emit("copy",_))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade","is-dark"]))],16)}}}),[["__scopeId","data-v-617214f9"]]);tc.install=e=>{e.component(tc.__name,tc)};const nc=un(je({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=cs(()=>e.customId),n=F(()=>t.value.list_item||tc);return(s,o)=>(w(),ve(Hs(e.node.ordered?"ol":"ul"),{class:Re(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:_e(()=>[(w(!0),N(Le,null,nt(e.node.items,(i,r)=>{var l;return w(),ve(Hs(n.value),dn({key:`${e.indexKey||"list"}-${r}`},{ref_for:!0},{showTooltips:e.showTooltips},{node:i,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${r}`,typewriter:e.typewriter,fade:e.fade,"is-dark":e.isDark,value:e.node.ordered?((l=e.node.start)!=null?l:1)+r:void 0,onCopy:o[0]||(o[0]=a=>s.$emit("copy",a))}),null,16,["node","custom-id","index-key","typewriter","fade","is-dark","value"])}),128))]),_:1},8,["class"]))}}),[["__scopeId","data-v-99cb95e0"]]);nc.install=e=>{e.component(nc.__name,nc)};const ZM=Symbol("ViewportPriority");function yj(e,t){var n,s;const o=typeof window<"u"&&typeof document<"u",i=typeof t=="boolean"?Z(t):t,r=o?(n=window.requestIdleCallback)!=null?n:g=>window.setTimeout(()=>g({didTimeout:!0,timeRemaining:()=>0}),16):null,l=o?(s=window.cancelIdleCallback)!=null?s:g=>window.clearTimeout(g):null;let a=null,c=null;const u=new Map,d=new Set;let p=null;function h(){if(p!=null){try{l?.(p)}catch{}p=null}}function f(){if(!u.size){try{a?.disconnect()}catch{}a=null,c=null,d.size||h()}}function m(g){const v=u.get(g);if(v){if(!v.visible.value){v.visible.value=!0;try{v.resolve()}catch{}}try{a?.unobserve(g)}catch{}u.delete(g),d.delete(g),f()}}function b(){window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&r&&p==null&&d.size&&(p=r(()=>{p=null;const g=d.values().next().value;g&&(d.delete(g),m(g),d.size&&b())},{timeout:1200}))}Ke(i,g=>{if(!g){for(const v of Array.from(u.keys()))m(v);h()}},{flush:"sync"});const _=(g,v)=>{const y=Z(!1);let A,O=!1;const $=new Promise(M=>{A=()=>{O||(O=!0,M())}}),k=()=>{try{a?.unobserve(g)}catch{}u.delete(g),d.delete(g),f()};if(!o||!i.value)return y.value=!0,A(),{isVisible:y,whenVisible:$,destroy:k};const E=(function(M,L){if(!o)return a;if(typeof IntersectionObserver>"u")return null;const S=(function(D,W){var z,q,Q;return{root:(z=e?.(D??null))!=null?z:null,rootMargin:(q=W?.rootMargin)!=null?q:"300px",threshold:(Q=W?.threshold)!=null?Q:0}})(M,L);if(a&&(P=S,(I=c)&&I.root===P.root&&I.rootMargin===P.rootMargin&&I.threshold===P.threshold))return a;var I,P;if(a)try{a.disconnect()}catch{}a=new IntersectionObserver(D=>{for(const W of D)(W.isIntersecting||W.intersectionRatio>0)&&m(W.target)},{root:S.root,rootMargin:S.rootMargin,threshold:S.threshold}),c=S;for(const D of u.keys())a.observe(D);return a})(g,v);return E?(u.set(g,{resolve:A,visible:y}),E.observe(g),d.add(g),b(),{isVisible:y,whenVisible:$,destroy:k}):(y.value=!0,A(),{isVisible:y,whenVisible:$,destroy:k})};return En(ZM,_),_}function kj(){var e,t;const n=Ut(ZM,void 0);if(n)return n;const s=new WeakMap;let o=null;const i=new Set;let r=null;const l=typeof window<"u"?(e=window.requestIdleCallback)!=null?e:p=>window.setTimeout(()=>p({didTimeout:!0,timeRemaining:()=>0}),16):null,a=typeof window<"u"?(t=window.cancelIdleCallback)!=null?t:p=>window.clearTimeout(p):null,c=()=>{if(r!=null){try{a?.(r)}catch{}r=null}},u=p=>{const h=s.get(p);if(h){if(!h.visible.value){h.visible.value=!0;try{h.resolve()}catch{}}try{o?.unobserve(p)}catch{}s.delete(p),i.delete(p),i.size||c()}},d=()=>{window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&l&&r==null&&i.size&&(r=l(()=>{r=null;const p=i.values().next().value;p&&(i.delete(p),u(p),i.size&&d())},{timeout:1200}))};return p=>{const h=Z(!1);let f,m=!1;const b=new Promise(v=>{f=()=>{m||(m=!0,v())}}),_=()=>{try{o?.unobserve(p)}catch{}s.delete(p),i.delete(p),i.size||c()},g=o||(typeof window>"u"||typeof IntersectionObserver>"u"?null:(o=new IntersectionObserver(v=>{for(const y of v)(y.isIntersecting||y.intersectionRatio>0)&&u(y.target)},{root:null,rootMargin:"300px",threshold:0}),o));return g?(s.set(p,{resolve:f,visible:h}),g.observe(p),i.add(p),d(),{isVisible:h,whenVisible:b,destroy:_}):(h.value=!0,f(),{isVisible:h,whenVisible:b,destroy:_})}}const bj={key:2,class:"html-block-node__raw"},_j=["innerHTML"],wj={key:1,class:"html-block-node__placeholder"},_u=un(je({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Ut("markstreamHtmlPolicy",void 0),s=Ut("markstreamNestedRendererProps",void 0),o=F(()=>{var O,$;return($=(O=t.htmlPolicy)!=null?O:n?.value)!=null?$:"safe"}),i=F(()=>{var O,$;const k=(O=s?.value)!=null?O:{};return Lt(it({},k),{customId:($=t.customId)!=null?$:k.customId,htmlPolicy:o.value})}),r=ui({loader:()=>Promise.resolve().then(()=>my),suspensible:!1}),l=F(()=>{const O=c1(t.node.attrs,o.value);if(!O)return;const $=$p(O);return Object.keys($).length>0?$:void 0}),a=F(()=>{const O=String(t.node.tag||"").trim(),$=c1(t.node.attrs,o.value,O);if(!$)return;const k=$p($);return Object.keys(k).length>0?k:void 0}),c=cs(()=>t.customId),u=je({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=Z(null),p=Z(typeof window>"u"),h=Z(t.node.content),f=F(()=>Array.isArray(t.node.children)?t.node.children:[]),m=F(()=>String(t.node.tag||"div")),b=F(()=>{const O=m.value.trim().toLowerCase();return DT.has(O)||Z0(O,o.value)}),_=F(()=>f.value.length>0&&!!t.node.tag&&!b.value),g=F(()=>{var O,$,k;if(_.value)return{mode:"structured"};if(!p.value)return{mode:"html",content:(O=h.value)!=null?O:""};const E=($=h.value)!=null?$:t.node.content;if(!E)return{mode:"html",content:""};if(o.value==="escape")return{mode:"html",content:ec(E,o.value)};if(t.node.loading){const L=Op(E,c.value,o.value);return L===null?{mode:"text",content:(k=t.node.raw)!=null?k:E}:{mode:"dynamic",nodes:L}}if(!GM(E,c.value))return{mode:"html",content:ec(E,o.value)};const M=Op(E,c.value,o.value);return M===null?{mode:"html",content:ec(E,o.value)}:{mode:"dynamic",nodes:M}}),v=kj(),y=Z(null),A=!!t.node.loading;return typeof window<"u"?(Ke(d,O=>{var $,k;if((k=($=y.value)==null?void 0:$.destroy)==null||k.call($),y.value=null,!A)return p.value=!0,void(h.value=t.node.content);if(!O)return void(p.value=!1);const E=v(O,{rootMargin:"400px"});y.value=E,p.value=E.isVisible.value,E.whenVisible.then(()=>{p.value=!0})},{immediate:!0}),Ke(()=>t.node.content,O=>{A&&!p.value||(h.value=O)})):p.value=!0,ls(()=>{var O,$;($=(O=y.value)==null?void 0:O.destroy)==null||$.call(O),y.value=null}),(O,$)=>(w(),ve(Hs(_.value?m.value:"div"),dn({ref_key:"htmlRef",ref:d,class:"html-block-node"},_.value?a.value:void 0),{default:_e(()=>[p.value?(w(),N(Le,{key:0},[g.value.mode==="structured"?(w(),ve(x(r),dn({key:0},i.value,{nodes:f.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):g.value.mode==="dynamic"?(w(),ve(x(u),{key:1,nodes:g.value.nodes},null,8,["nodes"])):g.value.mode==="text"?(w(),N("pre",bj,R(g.value.content),1)):(w(),N("div",dn({key:3},l.value,{innerHTML:g.value.content}),null,16,_j))],64)):(w(),N("div",wj,[Cn(O.$slots,"placeholder",{node:e.node},()=>[$[0]||($[0]=T("span",{class:"html-block-node__placeholder-bar"},null,-1)),$[1]||($[1]=T("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),$[2]||($[2]=T("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16))}}),[["__scopeId","data-v-f1744dfb"]]);_u.install=e=>{e.component(_u.__name,_u)};const Sj={dir:"auto",class:"paragraph-node"},Cj=["custom-id"],ql=un(je({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=cs(()=>t.customId),s=Ut("markstreamHtmlPolicy",void 0),o=Ut("markstreamFade",void 0),i=Ut("markstreamParseOptions",void 0),r=Ut("markstreamCustomMarkdownIt",void 0),l=Ut("markstreamNestedRendererProps",void 0),a=F(()=>{var k;return(k=s?.value)!=null?k:"safe"}),c=F(()=>{var k;return(k=t.parseOptions)!=null?k:i?.value}),u=F(()=>{var k;return(k=t.customMarkdownIt)!=null?k:r?.value}),d=F(()=>{var k,E;return(E=t.customHtmlTags)!=null?E:(k=l?.value)==null?void 0:k.customHtmlTags}),p=F(()=>{var k,E;const M=(k=l?.value)!=null?k:{};return Lt(it({},M),{customId:(E=t.customId)!=null?E:M.customId,customHtmlTags:d.value,parseOptions:c.value,customMarkdownIt:u.value,htmlPolicy:a.value})}),h=ui({loader:()=>Promise.resolve().then(()=>my),suspensible:!1});function f(k){var E;return k.type==="text"&&String((E=k.content)!=null?E:"").trim()===""}const m=F(()=>t.node.children.filter(k=>!f(k))),b=F(()=>m.value.length>0&&m.value.every(k=>k.type==="image"||(function(E){var M;const L=(function(S){return S.type==="link"&&Array.isArray(S.children)?S.children.filter(I=>!f(I)):[]})(E);return L.length===1&&((M=L[0])==null?void 0:M.type)==="image"})(k))),_=F(()=>new Set(kc(d.value))),g=F(()=>{if(!b.value||m.value.length<=1)return t.node.children;const k=[];for(let E=0;E<t.node.children.length;E++){const M=t.node.children[E];if(!f(M)){k.push(M);continue}const L=k.length>0,S=t.node.children.slice(E+1).some(I=>!f(I));L&&S&&k.push(Lt(it({},M),{content:" ",raw:" "}))}return k}),v=F(()=>o?.value===!1&&!n.value.text),y=F(()=>v.value?dc(g.value):null);function A(k,E){return{node:k,"index-key":`${t.indexKey}-${E}`,"custom-id":t.customId,"custom-html-tags":d.value}}const O=F(()=>it({inline_code:Us,image:qr,link:to,hardbreak:jr,emphasis:no,strong:Js,strikethrough:eo,highlight:Lo,insert:vo,subscript:go,superscript:mo,html_inline:No,html_block:_u,emoji:ho,checkbox:Io,math_inline:gi,checkbox_input:Io,reference:Zs,footnote_anchor:bu,footnote_reference:$o,text:Xn},n.value)),$=F(()=>g.value.map((k,E)=>{var M;const L=(function(S){var I,P,D,W;if(S.type==="html_block"||S.type==="html_inline"){const z=String((I=S.tag)!=null?I:"").trim().toLowerCase()||WT(S.content);if(z&&!_.value.has(z)&&zT((P=S.content)!=null?P:S.raw,z)){const q=String((W=(D=S.content)!=null?D:S.raw)!=null?W:"");return{child:{type:"text",content:q,raw:q},component:Xn,isCustomComponent:!1}}}return{child:S,component:O.value[S.type],isCustomComponent:!!(n.value[S.type]&&!dd(String(S.type)))}})(k);return Lt(it({},L),{index:E,key:`${t.indexKey||"paragraph"}-${E}`,customAttrs:L.isCustomComponent?ay(L.child,a.value):void 0,hasSlotChildren:Array.isArray(L.child.children)&&L.child.children.length>0,slotContent:String((M=L.child.content)!=null?M:""),originalChild:k})}));return(k,E)=>(w(),N("p",Sj,[y.value!==null?(w(),N("span",{key:0,class:"text-node","custom-id":t.customId},R(y.value),9,Cj)):(w(!0),N(Le,{key:1},nt($.value,M=>{return w(),N(Le,{key:M.key},[b.value&&f(M.originalChild)?(w(),N(Le,{key:0},[qe(R((L=M.originalChild,String((S=L.content)!=null?S:""))),1)],64)):M.isCustomComponent?(w(),ve(Hs(M.component),dn({key:1,ref_for:!0},M.customAttrs,{node:M.child,loading:M.child.loading,"index-key":M.key,"custom-id":t.customId,"custom-html-tags":d.value,"is-dark":p.value.isDark}),{default:_e(()=>[M.hasSlotChildren?(w(),ve(x(h),dn({key:0,ref_for:!0},p.value,{nodes:M.child.children,"index-key":M.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):M.slotContent?(w(),ve(x(h),dn({key:1,ref_for:!0},p.value,{content:M.slotContent,final:!M.child.loading,"index-key":`${M.key}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ie("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(w(),ve(Hs(M.component),dn({key:2,ref_for:!0},A(M.child,M.index)),null,16))],64);var L,S}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);ql.install=e=>{e.component(ql.__name,ql)};const xj={class:"table-node-wrapper"},Aj=["aria-busy"],Tj={key:0},Mj=["custom-id"],Ej=["aria-label","onPointerdown"],Ij=["custom-id"],$j={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},wu=un(je({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=F(()=>{var _;return(_=t.node.loading)!=null&&_}),s=F(()=>{var _;return(_=t.node.rows)!=null?_:[]}),o=Z(null),i=Z([]);let r=null;const l=F(()=>t.node.header.cells.length),a=F(()=>i.value.some(_=>Number.isFinite(_)&&_>0)),c=F(()=>a.value?i.value.map(_=>_>0?{width:`${_}px`}:void 0):[]);En("markstreamShowTooltips",F(()=>t.showTooltips)),En("markstreamFade",F(()=>t.fade));const u=cs(()=>t.customId),d=F(()=>!!u.value.text),p=F(()=>!!u.value.paragraph),h=new WeakMap;function f(_){const g=t.fade===!1&&!d.value,v=!p.value,y=h.get(_);if(y?.children===_.children&&y.textFastPath===g&&y.paragraphFastPath===v)return y.info;const A=Pp(_.children,v,!0),O={simpleChildren:A,plainText:A&&g?dc(A):null};return h.set(_,{children:_.children,textFastPath:g,paragraphFastPath:v,info:O}),O}function m(_){if(!r)return;_.preventDefault();const g=r.startWidth+r.nextStartWidth,v=Math.min(48,Math.floor(g/2)),y=Math.max(v,Math.min(g-v,Math.round(r.startWidth+_.clientX-r.startX))),A=[...r.widths];A[r.index]=y,A[r.index+1]=g-y,i.value=A}function b(){r&&(window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",b),window.removeEventListener("pointercancel",b),r=null)}return Ke(l,()=>{b(),i.value=[]}),ls(b),(_,g)=>(w(),N("div",xj,[T("table",{ref_key:"tableRef",ref:o,class:Re(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(w(),N("colgroup",Tj,[(w(!0),N(Le,null,nt(e.node.header.cells,(v,y)=>(w(),N("col",{key:y,style:Gt(c.value[y])},null,4))),128))])):ie("",!0),T("thead",null,[T("tr",null,[(w(!0),N(Le,null,nt(e.node.header.cells,(v,y)=>(w(),N("th",{key:y,dir:"auto",class:Re([v.align==="right"?"text-right":v.align==="center"?"text-center":"text-left"])},[f(v).plainText!==null?(w(),N("span",{key:0,class:"text-node","custom-id":t.customId},R(f(v).plainText),9,Mj)):f(v).simpleChildren?(w(),ve(x(Gu),{key:1,nodes:f(v).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${y}`},null,8,["nodes","custom-id","index-key"])):(w(),ve(x(yo),{key:2,nodes:v.children,"index-key":`table-th-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:g[0]||(g[0]=A=>_.$emit("copy",A))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),y<e.node.header.cells.length-1?(w(),N("button",{key:3,type:"button",class:"table-node__resize-handle","aria-label":`Resize columns ${y+1} and ${y+2}`,onPointerdown:A=>(function(O,$){if($.button!==0)return;const k=(function(){var L;const S=(L=o.value)==null?void 0:L.querySelectorAll("thead th");return Array.from(S??[],I=>Math.round(I.getBoundingClientRect().width))})(),E=k[O],M=k[O+1];E&&M&&($.preventDefault(),r={index:O,startX:$.clientX,startWidth:E,nextStartWidth:M,widths:k},i.value=k,window.addEventListener("pointermove",m),window.addEventListener("pointerup",b),window.addEventListener("pointercancel",b))})(y,A)},null,40,Ej)):ie("",!0)],2))),128))])]),T("tbody",null,[(w(!0),N(Le,null,nt(s.value,(v,y)=>(w(),N("tr",{key:y},[(w(!0),N(Le,null,nt(v.cells,(A,O)=>(w(),N("td",{key:O,class:Re([A.align==="right"?"text-right":A.align==="center"?"text-center":"text-left"]),dir:"auto"},[f(A).plainText!==null?(w(),N("span",{key:0,class:"text-node","custom-id":t.customId},R(f(A).plainText),9,Ij)):f(A).simpleChildren?(w(),ve(x(Gu),{key:1,nodes:f(A).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${y}-${O}`},null,8,["nodes","custom-id","index-key"])):(w(),ve(x(yo),{key:2,nodes:A.children,"index-key":`table-td-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:g[1]||(g[1]=$=>_.$emit("copy",$))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,Aj),oe(Gr,{name:"table-node-fade"},{default:_e(()=>[n.value?(w(),N("div",$j,[Cn(_.$slots,"loading",{isLoading:n.value},()=>[g[2]||(g[2]=T("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),g[3]||(g[3]=T("span",{class:"sr-only"},"Loading",-1))],!0)])):ie("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);wu.install=e=>{e.component(wu.__name,wu)};const Nj={class:"hr-node"},Df=un({},[["render",function(e,t){return w(),N("hr",Nj)}],["__scopeId","data-v-39b2349c"]]);Df.install=e=>{e.component(Df.__name,Df)};const Lj={class:"unknown-node"},A1=je({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(w(),N("div",Lj,R(e.node.raw),1))}),Bf=un(je({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){const t=e,n=F(()=>`vmr-container vmr-container-${t.node.name}`),s=cs(()=>t.customId),o=F(()=>it({text:Xn,paragraph:ql,heading:Rp,inline_code:Us,link:to,image:qr,strong:Js,emphasis:no,strikethrough:eo,insert:vo,subscript:go,superscript:mo,checkbox:Io,checkbox_input:Io,hardbreak:jr,math_inline:gi,reference:Zs,list:nc,math_block:QM,table:wu},s.value));return(i,r)=>(w(),N("div",dn({class:n.value},e.node.attrs),[(w(!0),N(Le,null,nt(e.node.children,(l,a)=>{return w(),ve(Hs((c=l.type,o.value[c]||A1)),{key:`${e.indexKey||"vmr-container"}-${a}`,"custom-id":t.customId,node:l,"index-key":`${e.indexKey||"vmr-container"}-${a}`,typewriter:t.typewriter,fade:t.fade},null,8,["custom-id","node","index-key","typewriter","fade"]);var c}),128))],16))}}),[["__scopeId","data-v-911e41c4"]]);Bf.install=e=>{e.component(Bf.__name,Bf)};const Oj=["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"],tS=[[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 Pj(e){if(e<=255)return Oj[e];let t=0,n=tS.length-1;for(;t<=n;){const s=t+n>>1,o=tS[s];if(e<o[0])n=s-1;else{if(!(e>o[1]))return o[2];t=s+1}}return"L"}const Rj=/[ \t\n\r\f]+/g,Dj=/[\t\n\r\f]| {2,}|^ | $/;let Bg=null;const Bj=new RegExp("\\p{Script=Arabic}","u"),$h=new RegExp("\\p{M}","u"),JM=new RegExp("\\p{Nd}","u");function nS(e){return Bj.test(e)}function sS(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 er(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(!(n<12288)){if(n>=55296&&n<=56319&&t+1<e.length){const s=e.charCodeAt(t+1);if(s>=56320&&s<=57343){if(sS(s-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(sS(n))return!0}}return!1}const Fj=new Set([" "," ","","\uFEFF"]);function Hj(e){return er(e)}function T1(e){return!(function(t){const n=Dp(t);return n!==null&&(cy.has(n)||Kl.has(n))})(e)&&!(function(t){const n=Dp(t);return n!==null&&Fj.has(n)})(e)}const cy=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),Nh=new Set(['"',"(","[","{","“","‘","«","‹","(","〔","〈","《","「","『","【","〖","〘","〚"]),uy=new Set(["'","’"]),Kl=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),Wj=new Set([":",".","،","؛"]),zj=new Set(["၏"]),Uj=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function qj(e){if(dy(e))return!0;let t=!1;for(const n of e)if(Kl.has(n))t=!0;else if(!t||!$h.test(n))return!1;return t}function jj(e){for(const t of e)if(!cy.has(t)&&!Kl.has(t))return!1;return e.length>0}function Vj(e){if(dy(e))return!0;for(const t of e)if(!Nh.has(t)&&!uy.has(t)&&!$h.test(t))return!1;return e.length>0}function dy(e){let t=!1;for(const n of e)if(n!=="\\"&&!$h.test(n)){if(!(Nh.has(n)||Kl.has(n)||uy.has(n)))return!1;t=!0}return t}function e3(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const s=e.charCodeAt(n);if(s<56320||s>57343)return n;const o=n-1;if(o<0)return n;const i=e.charCodeAt(o);return i>=55296&&i<=56319?o:n}function Dp(e){if(e.length===0)return null;const t=e3(e,e.length);return e.slice(t)}function Kj(e){const t=Array.from(e);let n=t.length;for(;n>0;){const s=t[n-1];if($h.test(s))n--;else{if(!Nh.has(s)&&!uy.has(s))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function Gj(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function oS(e,t,n,s){const o=t[s],i=e[s];if(o==null)return i;const r=n[s];if(i.length===r)return i;const l=o.repeat(r);return e[s]=l,l}function iS(e,t){return e&&t!==null&&Wj.has(t)}function Yj(e){const t=Dp(e);return t!==null&&zj.has(t)}function Xj(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 M1(e){let t=e.length;for(;t>0;){const n=e3(e,t),s=e.slice(n,t);if(Uj.has(s))return!0;if(!Kl.has(s))return!1;t=n}return!1}function Qj(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
|
|
236
|
+
</div>`};const a=/^\[(\d+)\]/,c=/^\[([^\]\n]+)\]/,u=p=>{if(!p.startsWith("["))return!1;const h=c.exec(p);if(!h)return p!=="["&&!/^\[\d+$/.test(p);const f=String(h[1]??"");return p.slice(h[0].length).startsWith("(")?!1:!/^\d+$/.test(f)},d=(p,h)=>{const f=p;if(f.src[f.pos]!=="[")return!1;const m=a.exec(f.src.slice(f.pos));if(!m)return!1;const b=f.src.slice(Math.max(0,f.pos-120),f.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(b))return!1;const _=f.src.slice(f.pos+m[0].length);if(_.startsWith("](")||_.startsWith("(")||u(_))return!1;if(!h){const g=m[1],v=f.push("reference","span",0);v.content=g,v.markup=m[0],v.raw=m[0]}return f.pos+=m[0].length,!0};return n.inline.ruler.before("escape","reference",d),n.renderer.rules.reference=(p,h)=>{const m=String(p[h].content??"");return`<span class="reference-link" data-reference-id="${m}" role="button" tabindex="0" title="Click to view reference">${m}</span>`},n}function xU({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 OM({nextContent:e,persistedContent:t,currentState:n,typewriterEnabled:s,streamRenderVersionChanged:o=!1}){const i=`${n.settledContent}${n.streamedDelta}`;return s?n.streamedDelta&&i===e?o?{settledContent:i,streamedDelta:"",appended:!1}:{settledContent:n.settledContent,streamedDelta:n.streamedDelta,appended:!1}:xU({nextContent:e,previousContent:t??i,typewriterEnabled:s}):{settledContent:e,streamedDelta:"",appended:!1}}const I2=new WeakMap;function AU(e){let t=I2.get(e);return t||(t={inFlight:new Map,completed:new Set,registeredAllLangs:!1,registeredThemes:[],registeredLangs:[],tail:Promise.resolve()},I2.set(e,t)),t}function $2(e,t){if(!t?.length)return[...e];const n=[...e],s=new Set(n);for(const o of t)s.has(o)||(s.add(o),n.push(o));return n}function ey(e){return!!(e.themes?.length||e.langs?.length)}function PM(e,t){if(!t?.length)return!0;const n=new Set(e);return t.every(s=>n.has(s))}function TU(e,t){return!t?.length||e.registeredAllLangs?!0:PM(e.registeredLangs,t)}function Ig(e,t){return ey(t)&&PM(e.registeredThemes,t.themes)&&TU(e,t.langs)}function MU(e,t){if(!ey(t))return t;const n=$2(e.registeredThemes,t.themes),s=e.registeredAllLangs?[]:$2(e.registeredLangs,t.langs);return{...n.length?{themes:n}:{},...s.length?{langs:s}:{}}}const EU={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 IU(e){const t=String(e??"").trim();if(!t)return"";const[n=""]=t.split(/\s+/);return n.split(":")[0]?.trim().toLowerCase()??""}function RM(e){const t=IU(e);return EU[t]??t}function DM(e){if(!Array.isArray(e))return;const t=e.filter(s=>typeof s=="string").map(s=>RM(s)).filter(Boolean),n=Array.from(new Set(t)).sort();return n.length>0?n:void 0}function BM(e){if(!Array.isArray(e))return;const t=[],n=new Set;for(const s of e){if(typeof s!="string")continue;const o=s.trim();!o||n.has(o)||(n.add(o),t.push(o))}return t.length>0?t:void 0}function $U(e){return BM(e)?.join("\0")??""}function FM(e,t){const n=BM(e),s=DM(t);return{...n?.length?{themes:n}:{},...s?.length?{langs:s}:{}}}function Np(e,t){return`${$U(e)}\0\0${DM(t)?.join("\0")??""}`}function ihe(e,t,n={hasRegisterHighlight:!0,hasCreateRenderer:!0}){const s=FM(e,t),o={...s},i=!!(o.langs?.length&&n.hasCreateRenderer&&!n.hasRegisterHighlight);return i&&(delete s.langs,delete o.langs),{key:Np(o.themes,o.langs),registerOptions:s,rendererOptions:o,ignoredLangs:i}}async function rhe(e,t={},n){if(!e)return"ready";const s=FM(t.themes,t.langs),o=Np(s.themes,s.langs),i=n&&n===o?n:o,r=AU(e);if(r.completed.has(i))return"ready";if(Ig(r,s))return r.completed.add(i),"ready";const l=r.inFlight.get(i);if(l)return l;const a=r.tail.catch(()=>{}).then(()=>{if(r.completed.has(i)||Ig(r,s))return r.completed.add(i),"ready";const c=MU(r,s),u=Np(c.themes,c.langs);return r.completed.has(u)||Ig(r,c)?(r.completed.add(i),r.completed.add(u),"ready"):Promise.resolve(e(c)).then(()=>(ey(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 _a(e,t,n=1){const s=Number(e);return Number.isFinite(s)?Math.max(n,s):t}function N2(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var NU=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 p=this.source.length>0,h=this.pendingChars<=0;if(this.source+=d,h){const f=L2();this.startedAt=p&&this.hasStarted?f-this.normalizedStartDelayMs:f,this.lastTick=f,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=L2();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 p=1e3/Math.max(1,this.maxCommitFps),h=Math.min(100,Math.max(0,d-this.lastTick));if(h<p){this.rafId=requestAnimationFrame(this.tick);return}this.lastTick=d;const f=this.pendingChars,m=f>this.normalizedCatchUpThreshold?this.normalizedCatchUpLatencyMs:this.normalizedTargetLatencyMs,b=RU(f/Math.max(.001,m/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 _=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),g=PU(this.source.slice(this.visible.length),_,this.segmenter);g.text&&(this.visible+=g.text,this.charBudget=Math.max(0,this.charBudget-g.graphemeCount),this.emit()),this.ensureLoop()};const{minCharsPerSecond:n=40,maxCharsPerSecond:s=1e3,targetLatencyMs:o=900,catchUpLatencyMs:i=350,catchUpThreshold:r=600,maxCommitFps:l=30,startDelayMs:a=80,maxCharsPerCommit:c=80,flushOnFinish:u=!1}=e;this.minCharsPerSecond=_a(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,_a(s,1e3,1)),this.normalizedTargetLatencyMs=_a(o,900,1),this.normalizedCatchUpLatencyMs=_a(i,350,1),this.normalizedCatchUpThreshold=N2(r,600),this.normalizedStartDelayMs=N2(a,80),this.maxCommitFps=Math.trunc(_a(l,30,1)),this.maxCharsPerCommit=Math.trunc(_a(c,80,1)),this.flushOnFinish=u,this.segmenter=OU(),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 LU(e={},t){const n=new NU(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 OU(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function PU(e,t,n){if(!e||t<=0)return{text:"",graphemeCount:0};if(!n){const i=Array.from(e).slice(0,t);return{text:i.join(""),graphemeCount:i.length}}let s="",o=0;for(const i of n.segment(e)){if(o>=t)break;s+=i.segment,o++}return{text:s,graphemeCount:o}}function L2(){return typeof performance<"u"?performance.now():Date.now()}function RU(e,t,n){return Math.min(n,Math.max(t,e))}var DU=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const u1=Symbol.for("markstream-vue:node-lifecycle"),O2='<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>',P2='<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>',BU={id:"material",core:{"":P2,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:P2,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:O2,csharp:O2,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:()=>Xs(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},d1=new Map;let R2="material";const Fa=new Map,D2=new Map;let f1=null;function FU(e){d1.set(e.id,e)}function HU(e){return DU(this,null,function*(){var t,n,s;if(Fa.has(e.id))return(t=Fa.get(e.id))!=null?t:null;let o=D2.get(e.id);return o||(o=((s=(n=e.loadExtended)==null?void 0:n.call(e))!=null?s:Promise.resolve(null)).then(i=>(Fa.set(e.id,i),f1?.(),i)).catch(()=>(Fa.set(e.id,null),null)),D2.set(e.id,o)),o})}const WU=Ql(0);f1=()=>{WU.value++},FU(BU);const zU={"":"",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 ty(e){var t;const n=(function(s){if(!s)return"";const o=s.trim();if(!o)return"";const[i]=o.split(/\s+/),[r]=i.split(":");return r.toLowerCase()})(e);return(t=zU[n])!=null?t:n}function lhe(e){const t=ty(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return t}}function ahe(e){return(function(s){const o=d1.get(R2);if(!o)return;const i=o.core[s];if(i)return i;const r=Fa.get(o.id);if(r){const l=r[s];if(l)return l}o.loadExtended&&!Fa.has(o.id)&&HU(o)})(ty(e))||((n=(t=d1.get(R2))==null?void 0:t.fallback)!=null?n:"");var t,n}const che={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 HM=!1;function uhe(){return HM}function dhe(){HM=!0}var Mh=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});let Ao=null,$f=!1,Eh=sy;function Ih(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function ny(){try{const e=globalThis;return Ih(e?.katex)}catch{return null}}function sy(){return Mh(null,null,function*(){const e=ny();if(e)return e;const t=yield Xs(()=>import("./katex-DnlPpQZa.js"),[]);try{yield Xs(()=>import("./mhchem-DtR62fUK.js"),__vite__mapDeps([2,3]))}catch{}return Ih(t)})}function UU(e){Eh=e,Ao=null,$f=!1}function qU(e){UU(sy)}function WM(){return typeof Eh=="function"}function fhe(){var e;const t=Eh;if(!t||t===sy)return null;if(Ao)return Ao;const n=ny();if(n)return Ao=n,Ao;try{const s=t();return s&&typeof s?.then!="function"?(Ao=(e=Ih(s))!=null?e:s,Ao):null}catch{return null}}function oy(){return Mh(this,null,function*(){var e;const t=ny();if(t)return Ao=t,Ao;if(Ao)return Ao;if($f)return null;const n=Eh;if(!n)return $f=!0,null;try{const s=yield n();if(s)return Ao=(e=Ih(s))!=null?e:s,Ao}catch{}return $f=!0,null})}function zM(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let Fr=null,$r=null;const Yo=new Map,Zi=new Map;let Lp=5;const Rl=new Set;function Ku(){if(Yo.size<Lp&&Rl.size){const e=Array.from(Rl);Rl.clear();for(const t of e)try{t()}catch{}}}function jU(e){Fr=e,$r=null,Fr.onmessage=t=>{const{id:n,html:s,error:o}=t.data,i=Yo.get(n);if(i)if(Yo.delete(n),clearTimeout(i.timeoutId),Ku(),o)i.reject(new Error(o));else{const{content:r,displayMode:l}=t.data;if(r){const a=`${l?"d":"i"}:${r}`;if(Zi.set(a,s),Zi.size>200){const c=Zi.keys().next().value;Zi.delete(c)}}i.resolve(s)}},Fr.onerror=t=>{console.error("[katexWorkerClient] Worker error:",t);for(const[n,s]of Yo.entries())clearTimeout(s.timeoutId),s.reject(new Error(`Worker error: ${t.message}`));Yo.clear(),Ku()}}function VU(){var e;Fr&&((e=Fr.terminate)==null||e.call(Fr)),Fr=null,$r=null}function KU(e,t=!0,n=2e3,s){return Mh(this,null,function*(){performance.now();const o=zM(e);if(!WM()){const a=new Error("KaTeX rendering disabled");return a.name="KaTeXDisabled",a.code="KATEX_DISABLED",Promise.reject(a)}if($r)return Promise.reject($r);const i=`${t?"d":"i"}:${o}`,r=Zi.get(i);if(r)return Promise.resolve(r);const l=Fr||($r=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),$r.name="WorkerInitError",$r.code="WORKER_INIT_ERROR",null);if(!l)return Promise.reject($r);if(Yo.size>=Lp){const a=new Error("Worker busy");return a.name="WorkerBusy",a.code="WORKER_BUSY",a.busy=!0,a.inFlight=Yo.size,a.max=Lp,Promise.reject(a)}return new Promise((a,c)=>{if(s?.aborted){const f=new Error("Aborted");return f.name="AbortError",void c(f)}const u=Math.random().toString(36).slice(2),d=globalThis.setTimeout(()=>{Yo.delete(u);const f=new Error("Worker render timed out");f.name="WorkerTimeout",f.code="WORKER_TIMEOUT",c(f),Ku()},n);s&&s.addEventListener("abort",()=>{globalThis.clearTimeout(d),Yo.has(u)&&Yo.delete(u);const f=new Error("Aborted");f.name="AbortError",c(f),Ku()},{once:!0});const p=a,h=c;Yo.set(u,{resolve:f=>{p(f)},reject:f=>{h(f)},timeoutId:d}),l.postMessage({id:u,content:o,displayMode:t})})})}function phe(e,t=!0,n){const s=`${t?"d":"i"}:${zM(e)}`;if(Zi.set(s,n),Zi.size>200){const o=Zi.keys().next().value;Zi.delete(o)}}const GU="WORKER_BUSY";function YU(e=2e3,t){return Yo.size<Lp?Promise.resolve():new Promise((n,s)=>{let o,i=!1;const r=()=>{i||(i=!0,o&&globalThis.clearTimeout(o),Rl.delete(r),n())};if(Rl.add(r),o=globalThis.setTimeout(()=>{if(i)return;i=!0,Rl.delete(r);const l=new Error("Wait for worker slot timed out");l.name="WorkerBusyTimeout",l.code="WORKER_BUSY_TIMEOUT",s(l)},e),queueMicrotask(()=>Ku()),t){const l=()=>{if(i)return;i=!0,o&&globalThis.clearTimeout(o),Rl.delete(r);const a=new Error("Aborted");a.name="AbortError",s(a)};t.aborted?l():t.addEventListener("abort",l,{once:!0})}})}const Kc={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function hhe(e){return Mh(this,arguments,function*(t,n=!0,s={}){var o,i,r,l;if(!WM()){const m=new Error("KaTeX rendering disabled");throw m.name="KaTeXDisabled",m.code="KATEX_DISABLED",m}const a=(o=s.timeout)!=null?o:Kc.timeout,c=(i=s.waitTimeout)!=null?i:Kc.waitTimeout,u=(r=s.backoffMs)!=null?r:Kc.backoffMs,d=(l=s.maxRetries)!=null?l:Kc.maxRetries,p=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):Kc.maxRetries,h=s.signal;let f=0;for(;;){if(h?.aborted){const m=new Error("Aborted");throw m.name="AbortError",m}try{return yield KU(t,n,a,h)}catch(m){if(m?.code!==GU||f>=p)throw m;if(f++,yield YU(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*f)))}}})}function Ha(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function XU(e){var t;for(const n of e.split(/\r?\n/)){const s=n.trim();if(!s||s.startsWith("%%"))continue;const o=s.match(/^([A-Z][\w-]*)\b/i);return((t=o?.[1])==null?void 0:t.toLowerCase())||""}return""}function p1(e){const t=e.split(/\r?\n/).map(o=>o.trim()).filter(o=>o&&!o.startsWith("%%")),n=Math.max(1,t.length),s=XU(e);return s==="gantt"?220+28*n:s==="sequencediagram"?180+26*n:s==="classdiagram"||s==="statediagram"||s==="erdiagram"?180+24*n:s==="flowchart"||s==="graph"?170+28*n:200+22*n}function h1(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 UM(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function m1(e,t=360,n=500){return UM(e,t,n)}function g1(e,t=360,n=500){return UM(e,t,n)}var QU=Object.defineProperty,ZU=Object.defineProperties,JU=Object.getOwnPropertyDescriptors,B2=Object.getOwnPropertySymbols,eq=Object.prototype.hasOwnProperty,tq=Object.prototype.propertyIsEnumerable,F2=(e,t,n)=>t in e?QU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qM=(e,t)=>{for(var n in t||(t={}))eq.call(t,n)&&F2(e,n,t[n]);if(B2)for(var n of B2(t))tq.call(t,n)&&F2(e,n,t[n]);return e},iy=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const ry=()=>Xs(()=>import("./mermaid.core-D-9Sx1No.js").then(e=>e.bq),[]);let zi=null,ly=ry;function nq(e){ly=e,zi=null}function sq(e){nq(ry)}function oq(){return typeof ly=="function"}function H2(e){if(!e)return e;const t=e&&e.default?e.default:e;if(t&&(typeof t.render=="function"||typeof t.parse=="function"||typeof t.initialize=="function"))return t;if(t&&t.mermaidAPI&&(typeof t.mermaidAPI.render=="function"||typeof t.mermaidAPI.parse=="function")){const o=t.mermaidAPI;return n=qM({},t),s={render:o.render.bind(o),parse:o.parse?o.parse.bind(o):void 0,initialize:i=>typeof t.initialize=="function"?t.initialize(i):o.initialize?o.initialize(i):void 0},ZU(n,JU(s))}var n,s;return e.mermaid&&typeof e.mermaid.render=="function"?e.mermaid:t}function W2(e){if(e)try{const t=e?.initialize;e.initialize=n=>{const s=qM({suppressErrorRendering:!0},n||{});return typeof t=="function"?t.call(e,s):e?.mermaidAPI&&typeof e.mermaidAPI.initialize=="function"?e.mermaidAPI.initialize(s):void 0}}catch{}}function mhe(){return iy(this,null,function*(){if(zi)return zi;const e=(function(){try{const s=globalThis;return H2(s?.mermaid)}catch{return null}})();if(e)return zi=e,W2(zi),zi;const t=ly;if(!t)return null;let n;try{n=yield t()}catch(s){throw t===ry?new Error('Optional dependency "mermaid" is not installed. Please install it to enable mermaid diagrams.'):s}return n?(zi=H2(n),W2(zi),zi):null})}let Gs=null,Nr=null;const Ts=new Map;let z2=5,U2=!1;const iq="WORKER_BUSY",rq="MERMAID_DISABLED";function lq(e){Gs=e,Nr=null;const t=e;Gs.onmessage=n=>{if(Gs!==t)return;const{id:s,ok:o,result:i,error:r}=n.data,l=Ts.get(s);l&&(o===!1||r?l.reject(new Error(r||"Unknown error")):l.resolve(i))},Gs.onerror=n=>{var s,o;if(Gs===t)if(Ts.size!==0){try{U2?console.error("[mermaidWorkerClient] Worker error:",n?.message||n):(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker error:",n?.message||n)}catch{}for(const[i,r]of Ts.entries())r.reject(new Error(`Worker error: ${n.message}`));Ts.clear()}else(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker error (no pending):",n?.message||n)},Gs.onmessageerror=n=>{var s,o;if(Gs===t)if(Ts.size!==0){try{U2?console.error("[mermaidWorkerClient] Worker messageerror:",n):(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker messageerror:",n)}catch{}for(const[i,r]of Ts.entries())r.reject(new Error("Worker messageerror"));Ts.clear()}else(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",n)}}function aq(){var e;if(Gs)try{for(const[t,n]of Ts.entries())n.reject(new Error("Worker cleared"));Ts.clear(),(e=Gs.terminate)==null||e.call(Gs)}catch{}Gs=null,Nr=null}function jM(e,t,n=1400){if(!oq()){const o=new Error("Mermaid rendering disabled");return o.name="MermaidDisabled",o.code=rq,Promise.reject(o)}if(Nr)return Promise.reject(Nr);const s=Gs||(Nr=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),Nr.name="WorkerInitError",Nr.code="WORKER_INIT_ERROR",null);if(!s)return Promise.reject(Nr);if(Ts.size>=z2){const o=new Error("Worker busy");return o.name="WorkerBusy",o.code=iq,o.inFlight=Ts.size,o.max=z2,Promise.reject(o)}return new Promise((o,i)=>{const r=Math.random().toString(36).slice(2);let l,a=!1;const c=()=>{a||(a=!0,l!=null&&globalThis.clearTimeout(l),Ts.delete(r))},u={resolve:d=>{c(),o(d)},reject:d=>{c(),i(d)}};Ts.set(r,u);try{s.postMessage({id:r,action:e,payload:t})}catch(d){return Ts.delete(r),void i(d)}l=globalThis.setTimeout(()=>{const d=new Error("Worker call timed out");d.name="WorkerTimeout",d.code="WORKER_TIMEOUT";const p=Ts.get(r);p&&p.reject(d)},n)})}function ghe(e,t,n=1400){return iy(this,null,function*(){try{return yield jM("canParse",{code:e,theme:t},n)}catch(s){return Promise.reject(s)}})}function vhe(e,t,n=1400){return iy(this,null,function*(){try{return yield jM("findPrefix",{code:e,theme:t},n)}catch(s){return Promise.reject(s)}})}function yhe(){if(Gs)try{for(const[e,t]of Ts.entries())t.reject(new Error("Worker terminated"));Ts.clear(),Gs.terminate()}finally{Gs=null}}var cq=Object.defineProperty,uq=Object.defineProperties,dq=Object.getOwnPropertyDescriptors,q2=Object.getOwnPropertySymbols,fq=Object.prototype.hasOwnProperty,pq=Object.prototype.propertyIsEnumerable,j2=(e,t,n)=>t in e?cq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,it=(e,t)=>{for(var n in t||(t={}))fq.call(t,n)&&j2(e,n,t[n]);if(q2)for(var n of q2(t))pq.call(t,n)&&j2(e,n,t[n]);return e},Lt=(e,t)=>uq(e,dq(t)),zn=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const hq="__global__",$g="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",v1=(()=>{const e=globalThis;if(e[$g])return e[$g];const t={scopedCustomComponents:{},revision:Ql(0)};return e[$g]=t,t})(),V2=v1.revision,mq=Symbol("markstreamCustomComponents"),gq=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 dd(e){return gq.has(String(e).trim().toLowerCase())}function vq(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function Ng(e={}){const t={};for(const[n,s]of Object.entries(e))if(s!=null){t[n]=s;for(const o of new Set([si(n),si(vq(n))]))!o||dd(o)||Object.prototype.hasOwnProperty.call(t,o)||(t[o]=s)}return t}function cs(e){const t=Ut(mq,null);return F(()=>{var n;return V2.value,(function(s,o={}){return V2.value,it(it(it({},Ng(v1.scopedCustomComponents[hq]||{})),Ng(o)),Ng((function(i){return i&&v1.scopedCustomComponents[i]||{}})(s)))})(e?.(),(n=t?.value)!=null?n:{})})}const yq=["aria-label"],kq={key:0,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"checkbox-icon checkbox-unchecked"},bq={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"},un=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},Io=un(je({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(w(),N("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(w(),N("svg",bq,[...n[1]||(n[1]=[T("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",fill:"currentColor"},null,-1),T("path",{d:"M9 12l2 2 4-4",stroke:"hsl(var(--ms-background))","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(w(),N("svg",kq,[...n[0]||(n[0]=[T("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,yq))}),[["__scopeId","data-v-be21ab83"]]);Io.install=e=>{e.component(Io.__name,Io)};const _q={class:"emoji-node"},ho=un(je({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(w(),N("span",_q,R(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);ho.install=e=>{e.component(ho.__name,ho)};const wq=["id"],Sq=["title"],$o=un(je({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const t=`#fnref--${e.node.id}`;function n(){if(typeof document>"u")return;const s=document.querySelector(t);s?s.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${t} not found`)}return(s,o)=>(w(),N("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[T("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+R(e.node.id)+"]",9,Sq)],8,wq))}}),[["__scopeId","data-v-c1463a29"]]);$o.install=e=>{e.component($o.__name,$o)};const VM=(()=>{try{return!1}catch{}return!1})();function Lg(e){VM&&console.warn(e)}function K2(e,t="safe",n){return J0(e,t,n)}function KM(e){return nU(e)}function Og(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function ay(e,t="safe"){const n=String(e.tag||e.type||"").trim(),s=c1((o=e.attrs)?Array.isArray(o)?o.every(Array.isArray)?o.map(([r,l])=>[String(r),Og(l)]):o.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),Og(r.value)]):Object.entries(o).map(([r,l])=>[r,Og(l)]):null,t,n);var o;if(!s)return;const i=KM($p(s));return Object.keys(i).length>0?i:void 0}function G2(e,t,n=!1){const s=Object.entries(t??{}),o=s.length>0?s.map(([i,r])=>r===""?` ${i}`:` ${i}="${r}"`).join(""):"";return n?`<${e}${o} />`:`<${e}${o}>`}function Gc(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function Pg(e,t,n,s,o,i,r=!1){const l=(function(d,p){return IM(d,p)})(e,s);if(ad.has(e.toLowerCase())||!l&&TM(e,i))return null;if(!l&&Z0(e,i))return r?[G2(e,t,!0)]:[G2(e,t),...n,`</${e}>`];const a=J0(t,i,e),c=a.key,u=c!=null&&c!==""?c:o;if(l){const d=s[e]||s[e.toLowerCase()],p=KM(a);return cn(d,Lt(it({},p),{key:u}),n.length>0?n:void 0)}return cn(e,Lt(it({},a),{innerHTML:void 0,key:u}),n.length>0?n:void 0)}function GM(e,t){return rU(e,t)}function Op(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 p=Pg(d.tagName,d.attrs||{},[],r,"ms-html-"+a++,l,!0);Gc(c.length>0?c[c.length-1].children:u,p)}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 p=d.tagName.toLowerCase();let h=-1;for(let f=c.length-1;f>=0;f--)if(c[f].tagName.toLowerCase()===p){h=f;break}if(h!==-1)for(;c.length>h;){const f=c.pop(),m=Pg(f.tagName,f.attrs||{},f.children,r,f.autoKey,l);c.length>0?Gc(c[c.length-1].children,m):Gc(u,m),f.tagName.toLowerCase()!==p&&c.length>h&&Lg(`Auto-closing unclosed tag: <${f.tagName}>`)}else Lg(`Ignoring closing tag with no matching opening tag: </${d.tagName}>`)}for(;c.length>0;){const d=c.pop(),p=Pg(d.tagName,d.attrs||{},d.children,r,d.autoKey,l);c.length>0?Gc(c[c.length-1].children,p):Gc(u,p),Lg(`Auto-closing unclosed tag: <${d.tagName}>`)}return u})(sU(e),t,n)}catch(o){return s=o,VM&&console.error("Failed to parse HTML to VNodes:",s),null}var s}const Cq=["innerHTML"],No=un(je({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Ut("markstreamHtmlPolicy",void 0),s=F(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),o=cs(()=>t.customId),i=je({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=F(()=>{const l=t.node.content;if(!l)return{mode:"html",content:""};if(s.value==="escape")return{mode:"html",content:ec(l,s.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const c=Op(l,o.value,s.value);if(c!==null)return{mode:"dynamic",nodes:c}}if(!GM(l,o.value))return{mode:"html",content:ec(l,s.value)};const a=Op(l,o.value,s.value);return a===null?{mode:"html",content:ec(l,s.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>r.value.mode==="dynamic"?(w(),N("span",{key:0,class:Re(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[oe(x(i),{nodes:r.value.nodes},null,8,["nodes"])],2)):r.value.mode==="text"?(w(),N("span",{key:1,class:Re(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},R(r.value.content),3)):(w(),N("span",{key:2,class:Re(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,Cq))}}),[["__scopeId","data-v-d17f12b0"]]);No.install=e=>{e.component(No.__name,No)};const xq={class:"inline-code"},Aq={key:0},Us=un(je({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=nd(),s=Ut("markstreamFade",void 0),o=Ut("markstreamTextStreamState",void 0),i=Ut("markstreamStreamVersion",void 0),r=F(()=>{const g=n.fade;return g===""||g===!0||g==="true"||g!==!1&&g!=="false"&&void 0}),l=F(()=>typeof r.value=="boolean"?r.value:typeof s?.value!="boolean"||s.value),a=F(()=>{var g;return String((g=t.node.code)!=null?g:"")}),c=F(()=>!l.value),u=F(()=>{var g;const v=(g=n["index-key"])!=null?g:n.indexKey;return v==null||v===""?"":String(v)}),d=Z(t.node.code),p=Z("");let h=i?.value;const f=Z(0);function m(){return d.value+p.value}function b(){p.value&&(d.value=m(),p.value="")}Ke([()=>t.node.code,u,l,()=>i?.value],([g,v,y,A])=>{const O=String(g??""),$=u.value,k=A!==h;h=A;const E=OM({nextContent:O,persistedContent:$?o?.get($):void 0,currentState:{settledContent:d.value,streamedDelta:p.value},typewriterEnabled:l.value,streamRenderVersionChanged:k});d.value=E.settledContent,p.value=E.streamedDelta,E.appended&&(f.value+=1),$&&o?.set($,O)},{immediate:!0}),Ke(l,g=>{var v;g||(v=m(),d.value=v,p.value="")});const _=F(()=>f.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(g,v)=>(w(),N("code",xq,[c.value?(w(),N(Le,{key:0},[qe(R(a.value),1)],64)):(w(),N(Le,{key:1},[d.value?(w(),N("span",Aq,R(d.value),1)):ie("",!0),p.value?(w(),N("span",{key:1,class:Re(["inline-code-stream-delta",[_.value]]),onAnimationend:b},R(p.value),35)):ie("",!0)],64))]))}}),[["__scopeId","data-v-1b73ee4e"]]);Us.install=e=>{e.component(Us.__name,Us)};const y1=Z(!1),Y2=Z(""),X2=Z("top"),yu=Z(null),ku=Z(null),k1=Z(null),b1=Z(null),Q2=Z(null);let Nf=null,Lf=null,_1=0;function YM(){Nf&&(clearTimeout(Nf),Nf=null),Lf&&(clearTimeout(Lf),Lf=null)}let df=!1,ff=null,Z2=!1;function Tq(e,t,n="top",s=!1,o,i){if(!e)return;const r=++_1;YM();const l=()=>zn(null,null,function*(){var a,c;if(yield(function(){return zn(this,null,function*(){if(!df&&!Z2&&typeof document<"u"){ff!=null||(ff=zn(null,null,function*(){const[{createApp:u,h:d},{default:p}]=yield Promise.all([Xs(()=>import("./vue.runtime.esm-bundler-BwwRtQwQ.js"),[]),Xs(()=>import("./Tooltip-CFQEzqC-.js"),[])]),h=document.createElement("div");h.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(h),u({setup:()=>()=>{var f;return d(p,{visible:y1.value,"anchor-el":yu.value,content:Y2.value,placement:X2.value,id:ku.value,originX:k1.value,originY:b1.value,isDark:(f=Q2.value)!=null?f:void 0})}}).mount(h),df=!0}));try{yield ff}catch(u){df=!1,ff=null,Z2=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",u)}}})})(),df&&r===_1){ku.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,yu.value=e,Y2.value=t,X2.value=n,k1.value=(a=o?.x)!=null?a:null,b1.value=(c=o?.y)!=null?c:null,Q2.value=typeof i=="boolean"?i:null,y1.value=!0;try{e.setAttribute("aria-describedby",ku.value)}catch{}}});s?l():Nf=setTimeout(l,80)}function Mq(e=!1){_1+=1,YM();const t=()=>{if(yu.value&&ku.value)try{yu.value.removeAttribute("aria-describedby")}catch{}y1.value=!1,yu.value=null,ku.value=null,k1.value=null,b1.value=null};e?t():Lf=setTimeout(t,120)}const w1={"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..."},S1=e=>{var t;return(t=w1[e])!=null?t:(function(n){return(n.split(".").pop()||n).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,s=>s.toUpperCase()).trim()})(e)};function J2(e){return{t(t){if(e.te&&w1[t]&&!e.te(t))return S1(t);const n=e.t(t);return n===t&&w1[t]?S1(t):n}}}function Eq(){const e=(function(){var t,n;try{const s=Ls(),o=s?.proxy,i=o?.$t;if(typeof i=="function"){const a=o?.$te;return{t:i.bind(o),te:typeof a=="function"?a.bind(o):void 0}}const r=(n=(t=s?.appContext)==null?void 0:t.config)==null?void 0:n.globalProperties,l=r?.$t;if(typeof l=="function"){const a=r?.$te;return{t:l.bind(r),te:typeof a=="function"?a.bind(r):void 0}}}catch{}return null})();if(e)return J2(e);try{const t=globalThis.$vueI18nUse||null;if(t&&typeof t=="function")try{const n=t();if(n&&typeof n.t=="function")return J2({t:n.t.bind(n),te:typeof n.te=="function"?n.te.bind(n):void 0})}catch{}}catch{}return{t:S1}}function Iq(e,t){var n,s;const o=(s=(n=e.indexKey)!=null?n:t["index-key"])!=null?s:t.indexKey;return o==null||o===""?"":String(o)}const $q=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],Nq={key:1,class:"image-placeholder"},Lq={key:1,class:"image-node__raw-text"},Oq={key:0,class:"image-shimmer-overlay"},Pq={key:1,class:"image-node__raw-text"},Rq={key:2,class:"image-error"},qr=un(je({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},lazy:{type:Boolean,default:!1},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:t}){const n=e,s=t,o=Z(!1),i=Z(!1),r=Z(""),l=Z("primary"),a=Z(null),c=nd(),u=Ut(u1,null);let d="",p=null;const h=F(()=>Lw(n.node.src)),f=F(()=>Lw(n.fallbackSrc)),m=F(()=>r.value),b=F(()=>!n.lazy),_=F(()=>!n.node.loading&&l.value!=="failed"&&r.value.length>0),g=F(()=>l.value==="failed"),v=F(()=>!b.value&&!o.value&&!i.value&&l.value!=="failed"&&r.value.length>0),y=F(()=>Iq(n,c));function A(P=y.value){P&&a.value&&u?.reportHeight(P,a.value.offsetHeight)}function O(P=y.value){P&&ht(()=>{A(P)})}function $(){p&&(clearTimeout(p),p=null)}function k(){const P=y.value;P&&d!==P&&(d&&u?.markSettled(d),$(),d=P,u?.markPending(P),typeof window<"u"&&(p=window.setTimeout(()=>{d===P&&(O(P),E())},8e3)))}function E(){return zn(this,null,function*(){const P=d;P&&($(),d="",yield ht(),A(P),u?.markSettled(P))})}function M(){if(l.value==="primary"&&f.value&&f.value!==r.value)return l.value="fallback",r.value=f.value,o.value=!1,i.value=!1,void O();l.value="failed",i.value=!0,s("error",r.value),O()}function L(){o.value=!0,i.value=!1,s("load",m.value),O()}function S(P){P.preventDefault(),o.value&&!i.value&&s("click",[P,m.value])}const{t:I}=Eq();return Ke([h,f,()=>n.node.loading],()=>(o.value=!1,i.value=!1,n.node.loading||h.value?(r.value=h.value,void(l.value="primary")):f.value?(r.value=f.value,void(l.value="fallback")):(r.value="",l.value="failed",void(i.value=!0))),{immediate:!0}),Ke([_,o,i,m,()=>n.lazy],([P,D,W,z,q])=>P&&z&&!W?D?(E(),void O()):q?(k(),void O()):void(D||W||k()):(E(),void O()),{flush:"post",immediate:!0}),ls(()=>{(function(){const P=d;P&&($(),d="",u?.markSettled(P))})()}),(P,D)=>{var W,z,q,Q,X;return w(),N("span",{ref_key:"rootRef",ref:a,class:"image-node-container"},[_.value?(w(),N("img",{key:0,src:m.value,alt:String((z=(W=n.node.alt)!=null?W:n.node.title)!=null?z:""),title:String((Q=(q=n.node.title)!=null?q:n.node.alt)!=null?Q:""),class:Re(["image-node__img",{"is-loading":!b.value&&!o.value,"is-loaded":b.value||o.value,"has-natural-size":o.value,"cursor-pointer":o.value}]),loading:n.lazy?"lazy":void 0,fetchpriority:b.value?"high":void 0,decoding:b.value?"sync":"async",tabindex:o.value?0:-1,"aria-label":(X=n.node.alt)!=null?X:x(I)("image.preview"),onError:M,onLoad:L,onClick:S},null,42,$q)):ie("",!0),e.node.loading&&!i.value?(w(),N("span",Nq,[n.usePlaceholder?Cn(P.$slots,"placeholder",{key:0,node:n.node,displaySrc:m.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[D[0]||(D[0]=T("span",{class:"image-shimmer"},null,-1))],!0):(w(),N("span",Lq,R(e.node.raw),1))])):ie("",!0),oe(Gr,{name:"shimmer-fade"},{default:_e(()=>[v.value&&!e.node.loading?(w(),N("span",Oq,[n.usePlaceholder?Cn(P.$slots,"placeholder",{key:0,node:n.node,displaySrc:m.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[D[1]||(D[1]=T("span",{class:"image-shimmer"},null,-1))],!0):(w(),N("span",Pq,R(e.node.raw),1))])):ie("",!0)]),_:3}),g.value?(w(),N("span",Rq,[Cn(P.$slots,"error",{node:n.node,displaySrc:m.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[D[2]||(D[2]=T("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[T("path",{fill:"currentColor",d:"M2 2h20v10h-2V4H4v9.586l5-5L14.414 14L13 15.414l-4-4l-5 5V20h8v2H2zm13.547 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-3 1a3 3 0 1 1 6 0a3 3 0 0 1-6 0m3.625 6.757L19 17.586l2.828-2.829l1.415 1.415L20.414 19l2.829 2.828l-1.415 1.415L19 20.414l-2.828 2.829l-1.415-1.415L17.586 19l-2.829-2.828z"})],-1)),T("span",null,R(x(I)("image.loadError")),1)],!0)])):ie("",!0)],512)}}}),[["__scopeId","data-v-cbb5c63e"]]);qr.install=e=>{e.component(qr.__name,qr)};const Dq={key:2},Ni=je({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=cs(()=>t.customId),s=Ut("markstreamHtmlPolicy",void 0),o=Ut("markstreamNestedRendererProps",void 0),i=F(()=>{var f;return(f=s?.value)!=null?f:"safe"}),r=F(()=>{var f,m;const b=(f=o?.value)!=null?f:{};return Lt(it({},b),{customId:(m=t.customId)!=null?m:b.customId,htmlPolicy:i.value})}),l=ui({loader:()=>Promise.resolve().then(()=>my),suspensible:!1}),a=F(()=>t.components[String(t.node.type)]),c=F(()=>!!(a.value&&n.value[t.node.type]&&!dd(String(t.node.type)))),u=F(()=>c.value?ay(t.node,i.value):void 0),d=F(()=>Array.isArray(t.node.children)&&t.node.children.length>0),p=F(()=>{var f;return String((f=t.node.content)!=null?f:"")}),h=F(()=>{var f,m;return String((m=(f=t.node.content)!=null?f:t.node.raw)!=null?m:"")});return(f,m)=>a.value&&c.value?(w(),ve(Hs(a.value),dn({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:_e(()=>[d.value?(w(),ve(x(l),dn({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"])):p.value?(w(),ve(x(l),dn({key:1},r.value,{content:p.value,final:!e.node.loading,"index-key":`${e.indexKey||"child"}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ie("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):a.value?(w(),ve(Hs(a.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey},null,8,["node","custom-id","index-key"])):e.fallbackToText?(w(),N("span",Dq,R(h.value),1)):ie("",!0)}}),Bq=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],Fq={key:0,translate:"no",class:"markstream-pre__diff-code"},Hq={class:"markstream-pre__diff-number","aria-hidden":"true"},Wq={class:"markstream-pre__diff-content"},zq={class:"markstream-pre__diff-content-inner"},Uq={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},qq=["textContent"],xo=je({__name:"PreCodeNode",props:{node:{},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},reservedHeightPx:{}},setup(e){const t=e,n=F(()=>{var S,I,P;const D=String((I=(S=t.node)==null?void 0:S.language)!=null?I:"");return String((P=String(D).split(/\s+/g)[0])!=null?P:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),s=F(()=>`language-${n.value}`),o=F(()=>{var S,I,P,D,W;return((S=t.node)==null?void 0:S.diff)===!0?String((P=(I=t.node)==null?void 0:I.code)!=null?P:""):(function(z,q){const Q=String(z??"");return q?Q:Q.replace(/\r\n$|\n$|\r$/,"")})((D=t.node)==null?void 0:D.code,((W=t.node)==null?void 0:W.loading)===!0)}),i=F(()=>o.value.split(/\r\n|\n|\r/)),r=F(()=>Array.from({length:Math.max(1,i.value.length)},(S,I)=>I+1)),l=F(()=>{var S;return t.showLineNumbers===!0&&((S=t.node)==null?void 0:S.diff)===!0}),a=F(()=>l.value&&t.diffInline===!0),c=F(()=>{const S=Number(t.reservedHeightPx);if(!Number.isFinite(S)||S<=0)return;const I=`${Math.ceil(S)}px`;return{height:I,minHeight:I,maxHeight:I,overflow:"auto"}});function u(S){return String(S??"").trim().length===0}function d(S,I="context",P={}){const D=u(S);return{code:S,kind:D&&I!=="hunk"&&!P.preserveBlankKind?"context":I,empty:D}}function p(S){const I=String(S??"");return I?I.split(/\r\n|\n|\r/):[]}function h(S,I){return!u(S[I])||I<S.length-1}function f(S){return S.startsWith("-")&&!S.startsWith("---")}function m(S){return S.startsWith("+")&&!S.startsWith("+++")}function b(S,I){const P=p(S),D=p(I),W=(function(ye,Me){const we=ye.length,ze=Me.length;if((we+1)*(ze+1)>15e5)return null;const Ue=ze+1,Fe=new Uint32Array((we+1)*(ze+1));for(let G=1;G<=we;G++)for(let ne=1;ne<=ze;ne++){const H=G*Ue+ne;if(ye[G-1]===Me[ne-1])Fe[H]=Fe[(G-1)*Ue+(ne-1)]+1;else{const J=Fe[(G-1)*Ue+ne],ce=Fe[G*Ue+(ne-1)];Fe[H]=J>=ce?J:ce}}const rt=[];let le=we,U=ze;for(;le>0&&U>0;)ye[le-1]===Me[U-1]?(rt.push({originalIndex:le-1,modifiedIndex:U-1}),le--,U--):Fe[(le-1)*Ue+U]>=Fe[le*Ue+(U-1)]?le--:U--;return rt.reverse(),rt})(P,D);if(W){const ye=[];let Me=0,we=0;for(const ze of W){for(;Me<ze.originalIndex;)ye.push(Lt(it({},d(P[Me],"removed",{preserveBlankKind:h(P,Me)})),{key:`inline-removed-source-${Me}`,number:""})),Me++;for(;we<ze.modifiedIndex;)ye.push(Lt(it({},d(D[we],"added",{preserveBlankKind:h(D,we)})),{key:`inline-added-source-${we}`,number:we+1})),we++;ye.push(Lt(it({},d(D[ze.modifiedIndex])),{key:`inline-context-source-${ze.originalIndex}-${ze.modifiedIndex}`,number:ze.modifiedIndex+1})),Me=ze.originalIndex+1,we=ze.modifiedIndex+1}for(;Me<P.length;)ye.push(Lt(it({},d(P[Me],"removed",{preserveBlankKind:h(P,Me)})),{key:`inline-removed-source-${Me}`,number:""})),Me++;for(;we<D.length;)ye.push(Lt(it({},d(D[we],"added",{preserveBlankKind:h(D,we)})),{key:`inline-added-source-${we}`,number:we+1})),we++;return ye}const z=[];let q=0,Q=P.length-1,X=D.length-1;for(;q<=Q&&q<=X&&P[q]===D[q];)z.push(Lt(it({},d(D[q])),{key:`inline-prefix-${q}`,number:q+1})),q++;const fe=[];for(;Q>=q&&X>=q&&P[Q]===D[X];)fe.unshift(Lt(it({},d(D[X])),{key:`inline-suffix-${X}`,number:X+1})),Q--,X--;for(let ye=q;ye<=Q;ye++)z.push(Lt(it({},d(P[ye],"removed",{preserveBlankKind:h(P,ye)})),{key:`inline-removed-source-${ye}`,number:""}));for(let ye=q;ye<=X;ye++)z.push(Lt(it({},d(D[ye],"added",{preserveBlankKind:h(D,ye)})),{key:`inline-added-source-${ye}`,number:ye+1}));return z.concat(fe)}const _=F(()=>{var S,I,P,D;const W=(function(X){const fe=X.some(Me=>f(Me)),ye=X.some(Me=>m(Me));return fe&&ye||(function(){var Me,we,ze,Ue;if(n.value==="diff")return!0;const Fe=(Ue=(ze=String((we=(Me=t.node)==null?void 0:Me.raw)!=null?we:"").split(/\r?\n/,1)[0])==null?void 0:ze.trim())!=null?Ue:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(Fe)})()&&(fe||ye)})(i.value),z=(function(){var X,fe;return((X=t.node)==null?void 0:X.originalCode)!=null||((fe=t.node)==null?void 0:fe.updatedCode)!=null})();if(a.value)return[{key:"inline",className:"markstream-pre__diff-pane--inline",lines:W?(function(X){const fe=[];let ye=1;for(const[Me,we]of X.entries())if(we.startsWith("@@"))fe.push(Lt(it({},d(we,"hunk")),{key:`inline-hunk-${Me}`,number:""}));else if(f(we))fe.push(Lt(it({},d(we.slice(1),"removed",{preserveBlankKind:!0})),{key:`inline-removed-${Me}`,number:""}));else if(m(we))fe.push(Lt(it({},d(we.slice(1),"added",{preserveBlankKind:!0})),{key:`inline-added-${Me}`,number:ye++}));else{const ze=we.startsWith(" ")?we.slice(1):we;fe.push(Lt(it({},d(ze)),{key:`inline-context-${Me}`,number:ye})),ye++}return fe})(i.value):b((S=t.node)==null?void 0:S.originalCode,(I=t.node)==null?void 0:I.updatedCode)}];if(!W&&z){const X=p((P=t.node)==null?void 0:P.originalCode),fe=p((D=t.node)==null?void 0:D.updatedCode);return[{key:"original",className:"markstream-pre__diff-pane--original",lines:X.map((ye,Me)=>{const we=fe[Me]===ye?"context":"removed";return Lt(it({},d(ye,we,{preserveBlankKind:h(X,Me)})),{key:`original-${Me}`,number:Me+1})})},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:fe.map((ye,Me)=>{const we=X[Me]===ye?"context":"added";return Lt(it({},d(ye,we,{preserveBlankKind:h(fe,Me)})),{key:`modified-${Me}`,number:Me+1})})}]}const q=[],Q=[];for(const X of i.value)if(X.startsWith("@@"))q.push(d(X,"hunk")),Q.push(d(X,"hunk"));else if(X.startsWith("-")&&!X.startsWith("---"))q.push(d(X.slice(1),"removed",{preserveBlankKind:!0}));else if(X.startsWith("+")&&!X.startsWith("+++"))Q.push(d(X.slice(1),"added",{preserveBlankKind:!0}));else{const fe=X.startsWith(" ")?X.slice(1):X;q.push(d(fe)),Q.push(d(fe))}return[{key:"original",className:"markstream-pre__diff-pane--original",lines:q.map((X,fe)=>Lt(it({},X),{key:`original-${fe}`,number:fe+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:Q.map((X,fe)=>Lt(it({},X),{key:`modified-${fe}`,number:fe+1}))}]}),g=F(()=>{const S=n.value;return S?`Code block: ${S}`:"Code block"}),v=Z(null),y=Z([]);let A=null,O=null;function $(S){const I=Number.parseFloat(String(S??""));return Number.isFinite(I)&&I>0?I:0}function k(S,I){var P;if(!S)return I;const D=S.querySelector(".markstream-pre__diff-content"),W=D?.getBoundingClientRect(),z=(P=W?.height)!=null?P:0;return Math.max(I,Math.ceil(z))}function E(){typeof window<"u"&&(A!=null&&window.cancelAnimationFrame(A),A=window.requestAnimationFrame(()=>{(function(){var S,I;A=null;const P=v.value;if(!P||!l.value)return void(y.value.length&&(y.value=[]));const D=(function(ye){const Me=window.getComputedStyle(ye),we=$(Me.getPropertyValue("--markstream-pre-diff-line-height"));if(we>0)return we;const ze=$(Me.lineHeight);return ze>0?ze:18})(P),W=Array.from(P.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),z=Array.from(P.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),q=Math.max(W.length,z.length),Q=[];for(let ye=0;ye<q;ye++){const Me=k((S=W[ye])!=null?S:null,D),we=k((I=z[ye])!=null?I:null,D),ze=Math.max(D,Me,we);Q.push({rowHeight:ze,originalHeight:Me,modifiedHeight:we})}var X,fe;X=y.value,fe=Q,X.length===fe.length&&X.every((ye,Me)=>{const we=fe[Me];return we&&Math.abs(ye.rowHeight-we.rowHeight)<=.5&&Math.abs(ye.originalHeight-we.originalHeight)<=.5&&Math.abs(ye.modifiedHeight-we.modifiedHeight)<=.5})||(y.value=Q)})()}))}function M(S){O?.disconnect(),O=null,S&&l.value&&typeof ResizeObserver<"u"&&(O=new ResizeObserver(()=>{E()}),O.observe(S))}function L(S,I){const P=y.value[S];if(!P)return;const D=I==="original"?P.originalHeight:P.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(P.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(D)}px`}}return Ke(v,S=>{M(S),ht(()=>E())},{flush:"post"}),Ke([l,_],()=>{M(v.value),ht(()=>E())},{flush:"post",immediate:!0}),ls(()=>{A!=null&&(window.cancelAnimationFrame(A),A=null),O?.disconnect(),O=null}),(S,I)=>(w(),N("pre",{ref_key:"preRef",ref:v,style:Gt(c.value),class:Re([s.value,{"markstream-pre--line-numbers":t.showLineNumbers,"markstream-pre--diff-preview":l.value,"markstream-pre--diff-inline":a.value}]),"aria-busy":e.node.loading===!0,"aria-label":g.value,"data-language":n.value,"data-markstream-line-numbers":t.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"},[l.value?(w(),N("code",Fq,[(w(!0),N(Le,null,nt(_.value,P=>(w(),N("span",{key:P.key,class:Re(["markstream-pre__diff-pane",P.className])},[(w(!0),N(Le,null,nt(P.lines,(D,W)=>(w(),N("span",{key:D.key,class:Re(["markstream-pre__diff-line",[`markstream-pre__diff-line--${D.kind}`,{"markstream-pre__diff-line--empty":D.empty}]]),style:Gt(L(W,P.key))},[I[0]||(I[0]=T("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),T("span",Hq,R(D.number),1),T("span",Wq,[T("span",zq,R(D.code),1)])],6))),128))],2))),128))])):(w(),N(Le,{key:1},[t.showLineNumbers?(w(),N("span",Uq,[(w(!0),N(Le,null,nt(r.value,P=>(w(),N("span",{key:P,class:"markstream-pre__line-number"},R(P),1))),128))])):ie("",!0),T("code",{translate:"no",class:"markstream-pre__code",textContent:R(o.value)},null,8,qq)],64))],14,Bq))}});xo.install=e=>{e.component(xo.__name,xo)};const Rg=Ql(!1);let eS=null;const jq={key:0},Xn=un(je({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=(eS||(eS=oy().then(_=>{Rg.value=!!_}).catch(()=>{Rg.value=!1})),Vf(Rg)),s=nd(),o=Ut("markstreamFade",void 0),i=Ut("markstreamTextStreamState",void 0),r=Ut("markstreamStreamVersion",void 0),l=F(()=>{const _=s.fade;return _===""||_===!0||_==="true"||_!==!1&&_!=="false"&&void 0}),a=F(()=>typeof l.value=="boolean"?l.value:typeof o?.value!="boolean"||o.value),c=F(()=>{var _;const g=(_=s["index-key"])!=null?_:s.indexKey;return g==null||g===""?"":String(g)}),u=Z(t.node.content),d=Z("");let p=r?.value;const h=Z(0);function f(){return u.value+d.value}function m(){d.value&&(u.value=f(),d.value="")}Ke([()=>t.node.content,c,a,()=>r?.value],([_,g,v,y])=>{const A=String(_??""),O=c.value,$=y!==p;p=y;const k=OM({nextContent:A,persistedContent:O?i?.get(O):void 0,currentState:{settledContent:u.value,streamedDelta:d.value},typewriterEnabled:a.value,streamRenderVersionChanged:$});u.value=k.settledContent,d.value=k.streamedDelta,k.appended&&(h.value+=1),O&&i?.set(O,A)},{immediate:!0}),Ke(a,_=>{var g;_||(g=f(),u.value=g,d.value="")});const b=F(()=>h.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(_,g)=>(w(),N("span",{class:Re([[x(n)&&e.node.center?"text-node-center":""],"text-node"])},[u.value?(w(),N("span",jq,R(u.value),1)):ie("",!0),d.value?(w(),N("span",{key:1,class:Re(["text-node-stream-delta",[b.value]]),onAnimationend:m},R(d.value),35)):ie("",!0)],2))}}),[["__scopeId","data-v-aae85f13"]]);Xn.install=e=>{e.component(Xn.__name,Xn)};const XM=je({name:"CodeBlockNodeLoading",inheritAttrs:!1,setup(e,{attrs:t}){const n=t;return()=>{var s;return cn(xo,Lt(it({},t),{node:n.node,showLineNumbers:!0,reservedHeightPx:(s=n.estimatedHeightPx)!=null?s:n.estimatedContentHeightPx,class:["code-pre-fallback",t.class],"data-markstream-code-loading":"1"}))}}}),Dg=ui({loader:()=>zn(null,null,function*(){try{return(yield Xs(()=>import("./CodeBlockNode-CXnTLMNr.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),xo}}),loadingComponent:XM,delay:0,suspensible:!1}),gi=ui(()=>zn(null,null,function*(){var e;if(((e=(function(){const t=Reflect.get(globalThis,"process");return t?.env})())==null?void 0:e.NODE_ENV)==="test"&&typeof window<"u")return t=>{var n,s,o,i;return cn(Xn,Lt(it({},t),{node:{type:"text",content:(s=t.node.raw)!=null?s:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(o=t.node.content)!=null?o:""}$`}}))};try{if(yield oy())return(yield Xs(()=>import("./index6-CBdZmmyx.js"),[])).default}catch(t){console.warn('[markstream-vue] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',t)}return t=>{var n,s,o,i;return cn(Xn,Lt(it({},t),{node:{type:"text",content:(s=t.node.raw)!=null?s:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(o=t.node.content)!=null?o:""}$`}}))}})),QM=ui(()=>zn(null,null,function*(){try{if(yield oy())return(yield Xs(()=>import("./index5-B2PldaO2.js"),[])).default}catch(e){console.warn('[markstream-vue] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',e)}return e=>{var t,n,s,o;return cn(Xn,Lt(it({},e),{node:{type:"text",content:(n=e.node.raw)!=null?n:`$$${(t=e.node.content)!=null?t:""}$$`,raw:(o=e.node.raw)!=null?o:`$$${(s=e.node.content)!=null?s:""}$$`}}))}})),Zs=un(je({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(w(),N("span",{class:"reference-node cursor-pointer text-xs rounded-md px-1.5 mx-0.5",role:"button",tabindex:"0",onClick:n[0]||(n[0]=s=>t.$emit("click",s,e.node.id,e.messageId,e.threadId)),onMouseenter:n[1]||(n[1]=s=>t.$emit("mouseEnter",s,e.node.id,e.messageId,e.threadId)),onMouseleave:n[2]||(n[2]=s=>t.$emit("mouseLeave",s,e.node.id,e.messageId,e.threadId))},R(e.node.id),33))}),[["__scopeId","data-v-775c65e4"]]);Zs.install=e=>{e.component(Zs.__name,Zs)};const Vq={class:"superscript-node"},mo=un(je({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=cs(()=>t.customId),s=F(()=>it({text:Xn,inline_code:Us,link:to,html_inline:No,strong:Js,emphasis:no,footnote_reference:$o,strikethrough:eo,highlight:Lo,insert:vo,subscript:go,emoji:ho,math_inline:gi,reference:Zs},n.value));return(o,i)=>(w(),N("sup",Vq,[(w(!0),N(Le,null,nt(e.node.children,(r,l)=>(w(),ve(x(Ni),{key:`${e.indexKey||"superscript"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"superscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-24160b22"]]);mo.install=e=>{e.component(mo.__name,mo)};const Kq={class:"subscript-node"},go=un(je({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=cs(()=>t.customId),s=F(()=>it({text:Xn,inline_code:Us,link:to,html_inline:No,strong:Js,emphasis:no,footnote_reference:$o,strikethrough:eo,highlight:Lo,insert:vo,superscript:mo,emoji:ho,math_inline:gi,reference:Zs},n.value));return(o,i)=>(w(),N("sub",Kq,[(w(!0),N(Le,null,nt(e.node.children,(r,l)=>(w(),ve(x(Ni),{key:`${e.indexKey||"subscript"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"subscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-197fa13b"]]);go.install=e=>{e.component(go.__name,go)};const Gq={class:"strong-node"},Js=un(je({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=cs(()=>t.customId),s=F(()=>it({text:Xn,inline_code:Us,link:to,html_inline:No,emphasis:no,strikethrough:eo,highlight:Lo,insert:vo,subscript:go,superscript:mo,emoji:ho,footnote_reference:$o,math_inline:gi,reference:Zs},n.value));return(o,i)=>(w(),N("strong",Gq,[(w(!0),N(Le,null,nt(e.node.children,(r,l)=>(w(),ve(x(Ni),{key:`${e.indexKey||"strong"}-${l}`,components:s.value,node:r,"index-key":`${e.indexKey||"strong"}-${l}`,"custom-id":t.customId},null,8,["components","node","index-key","custom-id"]))),128))]))}}),[["__scopeId","data-v-a8647104"]]);Js.install=e=>{e.component(Js.__name,Js)};const Yq={class:"strikethrough-node"},eo=un(je({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=cs(()=>t.customId),s=F(()=>it({text:Xn,inline_code:Us,link:to,html_inline:No,strong:Js,emphasis:no,highlight:Lo,insert:vo,subscript:go,superscript:mo,emoji:ho,footnote_reference:$o,math_inline:gi,reference:Zs},n.value));return(o,i)=>(w(),N("del",Yq,[(w(!0),N(Le,null,nt(e.node.children,(r,l)=>(w(),ve(x(Ni),{key:`${e.indexKey||"strikethrough"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"strikethrough"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-b7a531fa"]]);eo.install=e=>{e.component(eo.__name,eo)};const Xq=["href","title","aria-label","aria-hidden","target","rel"],Qq=["aria-hidden"],Zq={class:"link-text-wrapper relative inline-flex"},Jq={class:"leading-[normal] link-text"},to=un(je({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=Ut("markstreamShowTooltips",void 0),s=F(()=>{const _=n?.value;return typeof _=="boolean"?_:t.showTooltip}),o=F(()=>{var _,g,v,y,A;const O=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",$=(_=t.animationOpacity)!=null?_:.35,k=Math.max(.12,Math.min(.5*$,$)),E={"--underline-height":`${(g=t.underlineHeight)!=null?g:2}px`,"--underline-bottom":O,"--underline-opacity":String($),"--underline-rest-opacity":String(k),"--underline-duration":`${(v=t.animationDuration)!=null?v:1.6}s`,"--underline-timing":(y=t.animationTiming)!=null?y:"ease-in-out","--underline-iteration":typeof t.animationIteration=="number"?String(t.animationIteration):(A=t.animationIteration)!=null?A:"infinite"};return t.color&&(E["--link-color"]=t.color),E}),i=cs(()=>t.customId),r=F(()=>it({text:Xn,strong:Js,strikethrough:eo,emphasis:no,image:qr,html_inline:No,inline_code:Us},i.value)),l=nd(),a=F(()=>{var _,g;const v=(_=t.node)==null?void 0:_.attrs;if(!v||typeof v!="object")return{};const y={};if(Array.isArray(v))for(const A of v)Array.isArray(A)&&A[0]&&(y[String(A[0])]=String((g=A[1])!=null?g:""));else for(const[A,O]of Object.entries(v))A&&O!=null&&O!==!1&&(y[A]=O===!0?"":String(O));return K2(y,"safe","a")}),c=F(()=>it(it({},l),a.value)),u=F(()=>{var _,g;return K2({href:String((g=(_=t.node)==null?void 0:_.href)!=null?g:"")},"safe","a").href}),d=F(()=>{if(!u.value)return;const _=c.value.target;return(typeof _=="string"?_.trim():String(_??"").trim())||(U9(u.value)?"_blank":void 0)}),p=F(()=>{var _;return String((_=d.value)!=null?_:"").trim().toLowerCase()==="_blank"}),h=F(()=>{if(!u.value)return;const _=c.value.rel,g=new Set((typeof _=="string"?_:String(_??"")).split(/\s+/).filter(Boolean)),v=new Set(Array.from(g).filter(y=>y.toLowerCase()!=="opener"));return p.value&&(v.add("noopener"),v.add("noreferrer")),v.size>0?Array.from(v).join(" "):void 0}),f=F(()=>{const _=it({},c.value);return delete _.title,delete _.href,delete _.target,delete _.rel,_});function m(){s.value&&Mq()}const b=F(()=>{var _,g;const v=(_=t.node)==null?void 0:_.title;return typeof v=="string"&&v.trim().length>0?v:String((g=u.value)!=null?g:"")});return(_,g)=>{var v,y;return e.node.loading?(w(),N("span",dn({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},x(l),{style:o.value}),[T("span",Zq,[T("span",Jq,[oe(x(Xn),{class:"leading-[normal] link-text",node:{type:"text",content:String((v=e.node.text)!=null?v:""),raw:String((y=e.node.text)!=null?y:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),g[1]||(g[1]=T("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,Qq)):(w(),N("a",dn({key:0,class:"link-node",href:u.value,title:s.value?"":b.value,"aria-label":`Link: ${b.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:h.value},f.value,{style:o.value,onMouseenter:g[0]||(g[0]=A=>(function(O){var $,k,E,M;if(!s.value)return;const L=O,S=L?.clientX!=null&&L?.clientY!=null?{x:L.clientX,y:L.clientY}:void 0,I=(($=t.node)==null?void 0:$.title)||((k=u.value)!=null&&k.includes("xn--")&&((M=(E=t.node)==null?void 0:E.text)!=null&&M.includes("://"))?t.node.text:u.value)||"";Tq(O.currentTarget,I,"top",!1,S)})(A)),onMouseleave:m}),[(w(!0),N(Le,null,nt(e.node.children,(A,O)=>(w(),ve(x(Ni),{key:`${e.indexKey||"emphasis"}-${O}`,components:r.value,node:A,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${O}`},null,8,["components","node","custom-id","index-key"]))),128))],16,Xq))}}}),[["__scopeId","data-v-367e6ca4"]]);to.install=e=>{e.component(to.__name,to)};const ej={class:"insert-node"},vo=un(je({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=cs(()=>t.customId),s=F(()=>it({text:Xn,inline_code:Us,link:to,html_inline:No,strong:Js,emphasis:no,strikethrough:eo,highlight:Lo,subscript:go,superscript:mo,emoji:ho,footnote_reference:$o,math_inline:gi,reference:Zs},n.value));return(o,i)=>(w(),N("ins",ej,[(w(!0),N(Le,null,nt(e.node.children,(r,l)=>(w(),ve(x(Ni),{key:`${e.indexKey||"insert"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"insert"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-1e2c29d4"]]);vo.install=e=>{e.component(vo.__name,vo)};const tj={class:"highlight-node"},Lo=un(je({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=cs(()=>t.customId),s=F(()=>it({text:Xn,inline_code:Us,link:to,html_inline:No,strong:Js,emphasis:no,strikethrough:eo,insert:vo,subscript:go,superscript:mo,emoji:ho,footnote_reference:$o,math_inline:gi,reference:Zs},n.value));return(o,i)=>(w(),N("mark",tj,[(w(!0),N(Le,null,nt(e.node.children,(r,l)=>(w(),ve(x(Ni),{key:`${e.indexKey||"highlight"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"highlight"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-7a62982a"]]);Lo.install=e=>{e.component(Lo.__name,Lo)};const nj={class:"emphasis-node"},no=un(je({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=cs(()=>t.customId),s=F(()=>it({text:Xn,inline_code:Us,link:to,html_inline:No,strong:Js,strikethrough:eo,highlight:Lo,insert:vo,subscript:go,superscript:mo,emoji:ho,footnote_reference:$o,math_inline:gi,reference:Zs},n.value));return(o,i)=>(w(),N("em",nj,[(w(!0),N(Le,null,nt(e.node.children,(r,l)=>(w(),ve(x(Ni),{key:`${e.indexKey||"emphasis"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"emphasis"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-2a5aafbf"]]);no.install=e=>{e.component(no.__name,no)};const sj={class:"hard-break"},jr=un(je({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(w(),N("br",sj))}),[["__scopeId","data-v-50c58f70"]]);jr.install=e=>{e.component(jr.__name,jr)};const Gu=je({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=Dr({checkbox:Io,checkbox_input:Io,emoji:ho,emphasis:no,hardbreak:jr,highlight:Lo,inline_code:Us,insert:vo,link:to,reference:Zs,strikethrough:eo,strong:Js,subscript:go,superscript:mo,text:Xn}),s=cs(()=>t.customId),o=F(()=>{const i=s.value;return Object.keys(i).length>0?it(it({},n),i):n});return(i,r)=>(w(!0),N(Le,null,nt(e.nodes,(l,a)=>(w(),ve(x(Ni),{key:a,components:o.value,node:l,"custom-id":t.customId,"index-key":`${e.indexKey||"inline"}-${a}`},null,8,["components","node","custom-id","index-key"]))),128))}});function C1(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(C1)}function Pp(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(C1))return e;if(!t||e.length!==1)return null;const s=e[0];if(s?.type!=="paragraph"||!Array.isArray(s.children))return null;const o=s.children;return(n||o.length>0)&&o.every(C1)?o:null}function dc(e){var t,n;if(!e?.length)return null;let s="";for(const o of e){if(o?.type!=="text"||o.center===!0)return null;s+=String((n=(t=o.content)!=null?t:o.raw)!=null?n:"")}return s}const oj=["cite"],ij={key:0,dir:"auto",class:"paragraph-node"},rj=["custom-id"],Of=un(je({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=cs(()=>t.customId),s=F(()=>!!n.value.paragraph),o=F(()=>!!n.value.text),i=F(()=>Pp(t.node.children,!s.value)),r=F(()=>t.fade!==!1||o.value?null:dc(i.value));return En("markstreamShowTooltips",F(()=>t.showTooltips)),En("markstreamFade",F(()=>t.fade)),(l,a)=>(w(),N("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[i.value?(w(),N("p",ij,[r.value!==null?(w(),N("span",{key:0,class:"text-node","custom-id":t.customId},R(r.value),9,rj)):(w(),ve(x(Gu),{key:1,nodes:i.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(w(),ve(x(yo),{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,oj))}}),[["__scopeId","data-v-abfecebc"]]);Of.install=e=>{e.component(Of.__name,Of)};const lj={class:"definition-list"},aj={class:"definition-term"},cj={class:"definition-desc"},Pf=un(je({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,s)=>(w(),N("dl",lj,[(w(!0),N(Le,null,nt(t.node.items,(o,i)=>(w(),N(Le,{key:i},[T("dt",aj,[oe(x(yo),{"index-key":`definition-term-${t.indexKey}-${i}`,nodes:o.term,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:s[0]||(s[0]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])]),T("dd",cj,[oe(x(yo),{"index-key":`definition-desc-${t.indexKey}-${i}`,nodes:o.definition,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:s[1]||(s[1]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],64))),128))]))}}),[["__scopeId","data-v-4e103b30"]]);Pf.install=e=>{e.component(Pf.__name,Pf)};const uj=["href","title"],bu=un(je({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const t=e;function n(s){var o;if(s.preventDefault(),typeof document>"u")return;const i=`fnref-${String((o=t.node.id)!=null?o:"")}`,r=document.getElementById(i);r&&r.scrollIntoView({behavior:"smooth",block:"center"})}return(s,o)=>(w(),N("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,uj))}}),[["__scopeId","data-v-e1eb37b6"]]);bu.install=e=>{e.component(bu.__name,bu)};const dj=["id"],fj={class:"flex-1"},Rf=je({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,s)=>(w(),N("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[T("div",fj,[oe(x(yo),{"index-key":`footnote-${t.indexKey}`,nodes:t.node.children,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:s[0]||(s[0]=o=>n.$emit("copy",o))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],8,dj))}});Rf.install=e=>{e.component(Rf.__name,Rf)};const pj=["custom-id"],x1=un(je({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=cs(()=>t.customId),s=Ut("markstreamFade",void 0),o=F(()=>s?.value!==!1||n.value.text?null:dc(t.node.children)),i=F(()=>it({text:Xn,inline_code:Us,link:to,image:qr,strong:Js,emphasis:no,strikethrough:eo,highlight:Lo,insert:vo,subscript:go,superscript:mo,emoji:ho,checkbox:Io,checkbox_input:Io,footnote_reference:$o,hardbreak:jr,math_inline:gi,reference:Zs},n.value));return(r,l)=>(w(),ve(Hs(`h${e.node.level}`),dn({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:_e(()=>[o.value!==null?(w(),N("span",{key:0,class:"text-node","custom-id":t.customId},R(o.value),9,pj)):(w(!0),N(Le,{key:1},nt(e.node.children,(a,c)=>(w(),ve(x(Ni),{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"]]),Rp=x1;Rp.install=e=>{e.component(x1.__name,x1)};const hj={key:0,dir:"auto",class:"paragraph-node"},mj=["custom-id"],gj={dir:"auto",class:"paragraph-node"},vj=["custom-id"],tc=un(je({__name:"ListItemNode",props:{node:{},item:{},indexKey:{},customId:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},value:{},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=F(()=>{var h;return(h=t.node)!=null?h:t.item}),s=cs(()=>t.customId),o=F(()=>!!s.value.paragraph),i=F(()=>!!s.value.text),r=F(()=>{var h;return Pp((h=n.value)==null?void 0:h.children,!o.value)}),l=F(()=>{var h;if(o.value)return null;const f=(h=n.value)==null?void 0:h.children;if(!Array.isArray(f)||f.length<2)return null;const m=f[0];if(m?.type!=="paragraph"||!Array.isArray(m.children))return null;const b=f.slice(1);if(!b.every(g=>g?.type==="list"))return null;const _=Pp([m]);return _?{paragraphChildren:_,nestedLists:b}:null});function a(){return t.fade===!1&&!i.value}const c=F(()=>a()?dc(r.value):null),u=F(()=>{var h;return a()?dc((h=l.value)==null?void 0:h.paragraphChildren):null}),d=Object.freeze({}),p=F(()=>{const{value:h}=t;return typeof h=="number"&&Number.isFinite(h)?{value:h}:d});return En("markstreamShowTooltips",F(()=>t.showTooltips)),En("markstreamFade",F(()=>t.fade)),(h,f)=>{var m,b;return w(),N("li",dn({class:"list-item",dir:"auto"},p.value),[r.value?(w(),N("p",hj,[c.value!==null?(w(),N("span",{key:0,class:"text-node","custom-id":t.customId},R(c.value),9,mj)):(w(),ve(x(Gu),{key:1,nodes:r.value,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):l.value?(w(),N(Le,{key:1},[T("p",gj,[u.value!==null?(w(),N("span",{key:0,class:"text-node","custom-id":t.customId},R(u.value),9,vj)):(w(),ve(x(Gu),{key:1,nodes:l.value.paragraphChildren,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))]),(w(!0),N(Le,null,nt(l.value.nestedLists,(_,g)=>(w(),ve(x(yo),{key:g,nodes:[_],"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-nested-${g}`,"show-tooltips":t.showTooltips,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0,onCopy:f[0]||(f[0]=v=>h.$emit("copy",v))},null,8,["nodes","custom-id","index-key","show-tooltips","typewriter","fade","is-dark"]))),128))],64)):(w(),ve(x(yo),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(b=(m=n.value)==null?void 0:m.children)!=null?b:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,onCopy:f[1]||(f[1]=_=>h.$emit("copy",_))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade","is-dark"]))],16)}}}),[["__scopeId","data-v-617214f9"]]);tc.install=e=>{e.component(tc.__name,tc)};const nc=un(je({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=cs(()=>e.customId),n=F(()=>t.value.list_item||tc);return(s,o)=>(w(),ve(Hs(e.node.ordered?"ol":"ul"),{class:Re(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:_e(()=>[(w(!0),N(Le,null,nt(e.node.items,(i,r)=>{var l;return w(),ve(Hs(n.value),dn({key:`${e.indexKey||"list"}-${r}`},{ref_for:!0},{showTooltips:e.showTooltips},{node:i,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${r}`,typewriter:e.typewriter,fade:e.fade,"is-dark":e.isDark,value:e.node.ordered?((l=e.node.start)!=null?l:1)+r:void 0,onCopy:o[0]||(o[0]=a=>s.$emit("copy",a))}),null,16,["node","custom-id","index-key","typewriter","fade","is-dark","value"])}),128))]),_:1},8,["class"]))}}),[["__scopeId","data-v-99cb95e0"]]);nc.install=e=>{e.component(nc.__name,nc)};const ZM=Symbol("ViewportPriority");function yj(e,t){var n,s;const o=typeof window<"u"&&typeof document<"u",i=typeof t=="boolean"?Z(t):t,r=o?(n=window.requestIdleCallback)!=null?n:g=>window.setTimeout(()=>g({didTimeout:!0,timeRemaining:()=>0}),16):null,l=o?(s=window.cancelIdleCallback)!=null?s:g=>window.clearTimeout(g):null;let a=null,c=null;const u=new Map,d=new Set;let p=null;function h(){if(p!=null){try{l?.(p)}catch{}p=null}}function f(){if(!u.size){try{a?.disconnect()}catch{}a=null,c=null,d.size||h()}}function m(g){const v=u.get(g);if(v){if(!v.visible.value){v.visible.value=!0;try{v.resolve()}catch{}}try{a?.unobserve(g)}catch{}u.delete(g),d.delete(g),f()}}function b(){window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&r&&p==null&&d.size&&(p=r(()=>{p=null;const g=d.values().next().value;g&&(d.delete(g),m(g),d.size&&b())},{timeout:1200}))}Ke(i,g=>{if(!g){for(const v of Array.from(u.keys()))m(v);h()}},{flush:"sync"});const _=(g,v)=>{const y=Z(!1);let A,O=!1;const $=new Promise(M=>{A=()=>{O||(O=!0,M())}}),k=()=>{try{a?.unobserve(g)}catch{}u.delete(g),d.delete(g),f()};if(!o||!i.value)return y.value=!0,A(),{isVisible:y,whenVisible:$,destroy:k};const E=(function(M,L){if(!o)return a;if(typeof IntersectionObserver>"u")return null;const S=(function(D,W){var z,q,Q;return{root:(z=e?.(D??null))!=null?z:null,rootMargin:(q=W?.rootMargin)!=null?q:"300px",threshold:(Q=W?.threshold)!=null?Q:0}})(M,L);if(a&&(P=S,(I=c)&&I.root===P.root&&I.rootMargin===P.rootMargin&&I.threshold===P.threshold))return a;var I,P;if(a)try{a.disconnect()}catch{}a=new IntersectionObserver(D=>{for(const W of D)(W.isIntersecting||W.intersectionRatio>0)&&m(W.target)},{root:S.root,rootMargin:S.rootMargin,threshold:S.threshold}),c=S;for(const D of u.keys())a.observe(D);return a})(g,v);return E?(u.set(g,{resolve:A,visible:y}),E.observe(g),d.add(g),b(),{isVisible:y,whenVisible:$,destroy:k}):(y.value=!0,A(),{isVisible:y,whenVisible:$,destroy:k})};return En(ZM,_),_}function kj(){var e,t;const n=Ut(ZM,void 0);if(n)return n;const s=new WeakMap;let o=null;const i=new Set;let r=null;const l=typeof window<"u"?(e=window.requestIdleCallback)!=null?e:p=>window.setTimeout(()=>p({didTimeout:!0,timeRemaining:()=>0}),16):null,a=typeof window<"u"?(t=window.cancelIdleCallback)!=null?t:p=>window.clearTimeout(p):null,c=()=>{if(r!=null){try{a?.(r)}catch{}r=null}},u=p=>{const h=s.get(p);if(h){if(!h.visible.value){h.visible.value=!0;try{h.resolve()}catch{}}try{o?.unobserve(p)}catch{}s.delete(p),i.delete(p),i.size||c()}},d=()=>{window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&l&&r==null&&i.size&&(r=l(()=>{r=null;const p=i.values().next().value;p&&(i.delete(p),u(p),i.size&&d())},{timeout:1200}))};return p=>{const h=Z(!1);let f,m=!1;const b=new Promise(v=>{f=()=>{m||(m=!0,v())}}),_=()=>{try{o?.unobserve(p)}catch{}s.delete(p),i.delete(p),i.size||c()},g=o||(typeof window>"u"||typeof IntersectionObserver>"u"?null:(o=new IntersectionObserver(v=>{for(const y of v)(y.isIntersecting||y.intersectionRatio>0)&&u(y.target)},{root:null,rootMargin:"300px",threshold:0}),o));return g?(s.set(p,{resolve:f,visible:h}),g.observe(p),i.add(p),d(),{isVisible:h,whenVisible:b,destroy:_}):(h.value=!0,f(),{isVisible:h,whenVisible:b,destroy:_})}}const bj={key:2,class:"html-block-node__raw"},_j=["innerHTML"],wj={key:1,class:"html-block-node__placeholder"},_u=un(je({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Ut("markstreamHtmlPolicy",void 0),s=Ut("markstreamNestedRendererProps",void 0),o=F(()=>{var O,$;return($=(O=t.htmlPolicy)!=null?O:n?.value)!=null?$:"safe"}),i=F(()=>{var O,$;const k=(O=s?.value)!=null?O:{};return Lt(it({},k),{customId:($=t.customId)!=null?$:k.customId,htmlPolicy:o.value})}),r=ui({loader:()=>Promise.resolve().then(()=>my),suspensible:!1}),l=F(()=>{const O=c1(t.node.attrs,o.value);if(!O)return;const $=$p(O);return Object.keys($).length>0?$:void 0}),a=F(()=>{const O=String(t.node.tag||"").trim(),$=c1(t.node.attrs,o.value,O);if(!$)return;const k=$p($);return Object.keys(k).length>0?k:void 0}),c=cs(()=>t.customId),u=je({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=Z(null),p=Z(typeof window>"u"),h=Z(t.node.content),f=F(()=>Array.isArray(t.node.children)?t.node.children:[]),m=F(()=>String(t.node.tag||"div")),b=F(()=>{const O=m.value.trim().toLowerCase();return DT.has(O)||Z0(O,o.value)}),_=F(()=>f.value.length>0&&!!t.node.tag&&!b.value),g=F(()=>{var O,$,k;if(_.value)return{mode:"structured"};if(!p.value)return{mode:"html",content:(O=h.value)!=null?O:""};const E=($=h.value)!=null?$:t.node.content;if(!E)return{mode:"html",content:""};if(o.value==="escape")return{mode:"html",content:ec(E,o.value)};if(t.node.loading){const L=Op(E,c.value,o.value);return L===null?{mode:"text",content:(k=t.node.raw)!=null?k:E}:{mode:"dynamic",nodes:L}}if(!GM(E,c.value))return{mode:"html",content:ec(E,o.value)};const M=Op(E,c.value,o.value);return M===null?{mode:"html",content:ec(E,o.value)}:{mode:"dynamic",nodes:M}}),v=kj(),y=Z(null),A=!!t.node.loading;return typeof window<"u"?(Ke(d,O=>{var $,k;if((k=($=y.value)==null?void 0:$.destroy)==null||k.call($),y.value=null,!A)return p.value=!0,void(h.value=t.node.content);if(!O)return void(p.value=!1);const E=v(O,{rootMargin:"400px"});y.value=E,p.value=E.isVisible.value,E.whenVisible.then(()=>{p.value=!0})},{immediate:!0}),Ke(()=>t.node.content,O=>{A&&!p.value||(h.value=O)})):p.value=!0,ls(()=>{var O,$;($=(O=y.value)==null?void 0:O.destroy)==null||$.call(O),y.value=null}),(O,$)=>(w(),ve(Hs(_.value?m.value:"div"),dn({ref_key:"htmlRef",ref:d,class:"html-block-node"},_.value?a.value:void 0),{default:_e(()=>[p.value?(w(),N(Le,{key:0},[g.value.mode==="structured"?(w(),ve(x(r),dn({key:0},i.value,{nodes:f.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):g.value.mode==="dynamic"?(w(),ve(x(u),{key:1,nodes:g.value.nodes},null,8,["nodes"])):g.value.mode==="text"?(w(),N("pre",bj,R(g.value.content),1)):(w(),N("div",dn({key:3},l.value,{innerHTML:g.value.content}),null,16,_j))],64)):(w(),N("div",wj,[Cn(O.$slots,"placeholder",{node:e.node},()=>[$[0]||($[0]=T("span",{class:"html-block-node__placeholder-bar"},null,-1)),$[1]||($[1]=T("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),$[2]||($[2]=T("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16))}}),[["__scopeId","data-v-f1744dfb"]]);_u.install=e=>{e.component(_u.__name,_u)};const Sj={dir:"auto",class:"paragraph-node"},Cj=["custom-id"],ql=un(je({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=cs(()=>t.customId),s=Ut("markstreamHtmlPolicy",void 0),o=Ut("markstreamFade",void 0),i=Ut("markstreamParseOptions",void 0),r=Ut("markstreamCustomMarkdownIt",void 0),l=Ut("markstreamNestedRendererProps",void 0),a=F(()=>{var k;return(k=s?.value)!=null?k:"safe"}),c=F(()=>{var k;return(k=t.parseOptions)!=null?k:i?.value}),u=F(()=>{var k;return(k=t.customMarkdownIt)!=null?k:r?.value}),d=F(()=>{var k,E;return(E=t.customHtmlTags)!=null?E:(k=l?.value)==null?void 0:k.customHtmlTags}),p=F(()=>{var k,E;const M=(k=l?.value)!=null?k:{};return Lt(it({},M),{customId:(E=t.customId)!=null?E:M.customId,customHtmlTags:d.value,parseOptions:c.value,customMarkdownIt:u.value,htmlPolicy:a.value})}),h=ui({loader:()=>Promise.resolve().then(()=>my),suspensible:!1});function f(k){var E;return k.type==="text"&&String((E=k.content)!=null?E:"").trim()===""}const m=F(()=>t.node.children.filter(k=>!f(k))),b=F(()=>m.value.length>0&&m.value.every(k=>k.type==="image"||(function(E){var M;const L=(function(S){return S.type==="link"&&Array.isArray(S.children)?S.children.filter(I=>!f(I)):[]})(E);return L.length===1&&((M=L[0])==null?void 0:M.type)==="image"})(k))),_=F(()=>new Set(kc(d.value))),g=F(()=>{if(!b.value||m.value.length<=1)return t.node.children;const k=[];for(let E=0;E<t.node.children.length;E++){const M=t.node.children[E];if(!f(M)){k.push(M);continue}const L=k.length>0,S=t.node.children.slice(E+1).some(I=>!f(I));L&&S&&k.push(Lt(it({},M),{content:" ",raw:" "}))}return k}),v=F(()=>o?.value===!1&&!n.value.text),y=F(()=>v.value?dc(g.value):null);function A(k,E){return{node:k,"index-key":`${t.indexKey}-${E}`,"custom-id":t.customId,"custom-html-tags":d.value}}const O=F(()=>it({inline_code:Us,image:qr,link:to,hardbreak:jr,emphasis:no,strong:Js,strikethrough:eo,highlight:Lo,insert:vo,subscript:go,superscript:mo,html_inline:No,html_block:_u,emoji:ho,checkbox:Io,math_inline:gi,checkbox_input:Io,reference:Zs,footnote_anchor:bu,footnote_reference:$o,text:Xn},n.value)),$=F(()=>g.value.map((k,E)=>{var M;const L=(function(S){var I,P,D,W;if(S.type==="html_block"||S.type==="html_inline"){const z=String((I=S.tag)!=null?I:"").trim().toLowerCase()||WT(S.content);if(z&&!_.value.has(z)&&zT((P=S.content)!=null?P:S.raw,z)){const q=String((W=(D=S.content)!=null?D:S.raw)!=null?W:"");return{child:{type:"text",content:q,raw:q},component:Xn,isCustomComponent:!1}}}return{child:S,component:O.value[S.type],isCustomComponent:!!(n.value[S.type]&&!dd(String(S.type)))}})(k);return Lt(it({},L),{index:E,key:`${t.indexKey||"paragraph"}-${E}`,customAttrs:L.isCustomComponent?ay(L.child,a.value):void 0,hasSlotChildren:Array.isArray(L.child.children)&&L.child.children.length>0,slotContent:String((M=L.child.content)!=null?M:""),originalChild:k})}));return(k,E)=>(w(),N("p",Sj,[y.value!==null?(w(),N("span",{key:0,class:"text-node","custom-id":t.customId},R(y.value),9,Cj)):(w(!0),N(Le,{key:1},nt($.value,M=>{return w(),N(Le,{key:M.key},[b.value&&f(M.originalChild)?(w(),N(Le,{key:0},[qe(R((L=M.originalChild,String((S=L.content)!=null?S:""))),1)],64)):M.isCustomComponent?(w(),ve(Hs(M.component),dn({key:1,ref_for:!0},M.customAttrs,{node:M.child,loading:M.child.loading,"index-key":M.key,"custom-id":t.customId,"custom-html-tags":d.value,"is-dark":p.value.isDark}),{default:_e(()=>[M.hasSlotChildren?(w(),ve(x(h),dn({key:0,ref_for:!0},p.value,{nodes:M.child.children,"index-key":M.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):M.slotContent?(w(),ve(x(h),dn({key:1,ref_for:!0},p.value,{content:M.slotContent,final:!M.child.loading,"index-key":`${M.key}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ie("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(w(),ve(Hs(M.component),dn({key:2,ref_for:!0},A(M.child,M.index)),null,16))],64);var L,S}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);ql.install=e=>{e.component(ql.__name,ql)};const xj={class:"table-node-wrapper"},Aj=["aria-busy"],Tj={key:0},Mj=["custom-id"],Ej=["aria-label","onPointerdown"],Ij=["custom-id"],$j={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},wu=un(je({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=F(()=>{var _;return(_=t.node.loading)!=null&&_}),s=F(()=>{var _;return(_=t.node.rows)!=null?_:[]}),o=Z(null),i=Z([]);let r=null;const l=F(()=>t.node.header.cells.length),a=F(()=>i.value.some(_=>Number.isFinite(_)&&_>0)),c=F(()=>a.value?i.value.map(_=>_>0?{width:`${_}px`}:void 0):[]);En("markstreamShowTooltips",F(()=>t.showTooltips)),En("markstreamFade",F(()=>t.fade));const u=cs(()=>t.customId),d=F(()=>!!u.value.text),p=F(()=>!!u.value.paragraph),h=new WeakMap;function f(_){const g=t.fade===!1&&!d.value,v=!p.value,y=h.get(_);if(y?.children===_.children&&y.textFastPath===g&&y.paragraphFastPath===v)return y.info;const A=Pp(_.children,v,!0),O={simpleChildren:A,plainText:A&&g?dc(A):null};return h.set(_,{children:_.children,textFastPath:g,paragraphFastPath:v,info:O}),O}function m(_){if(!r)return;_.preventDefault();const g=r.startWidth+r.nextStartWidth,v=Math.min(48,Math.floor(g/2)),y=Math.max(v,Math.min(g-v,Math.round(r.startWidth+_.clientX-r.startX))),A=[...r.widths];A[r.index]=y,A[r.index+1]=g-y,i.value=A}function b(){r&&(window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",b),window.removeEventListener("pointercancel",b),r=null)}return Ke(l,()=>{b(),i.value=[]}),ls(b),(_,g)=>(w(),N("div",xj,[T("table",{ref_key:"tableRef",ref:o,class:Re(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(w(),N("colgroup",Tj,[(w(!0),N(Le,null,nt(e.node.header.cells,(v,y)=>(w(),N("col",{key:y,style:Gt(c.value[y])},null,4))),128))])):ie("",!0),T("thead",null,[T("tr",null,[(w(!0),N(Le,null,nt(e.node.header.cells,(v,y)=>(w(),N("th",{key:y,dir:"auto",class:Re([v.align==="right"?"text-right":v.align==="center"?"text-center":"text-left"])},[f(v).plainText!==null?(w(),N("span",{key:0,class:"text-node","custom-id":t.customId},R(f(v).plainText),9,Mj)):f(v).simpleChildren?(w(),ve(x(Gu),{key:1,nodes:f(v).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${y}`},null,8,["nodes","custom-id","index-key"])):(w(),ve(x(yo),{key:2,nodes:v.children,"index-key":`table-th-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:g[0]||(g[0]=A=>_.$emit("copy",A))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),y<e.node.header.cells.length-1?(w(),N("button",{key:3,type:"button",class:"table-node__resize-handle","aria-label":`Resize columns ${y+1} and ${y+2}`,onPointerdown:A=>(function(O,$){if($.button!==0)return;const k=(function(){var L;const S=(L=o.value)==null?void 0:L.querySelectorAll("thead th");return Array.from(S??[],I=>Math.round(I.getBoundingClientRect().width))})(),E=k[O],M=k[O+1];E&&M&&($.preventDefault(),r={index:O,startX:$.clientX,startWidth:E,nextStartWidth:M,widths:k},i.value=k,window.addEventListener("pointermove",m),window.addEventListener("pointerup",b),window.addEventListener("pointercancel",b))})(y,A)},null,40,Ej)):ie("",!0)],2))),128))])]),T("tbody",null,[(w(!0),N(Le,null,nt(s.value,(v,y)=>(w(),N("tr",{key:y},[(w(!0),N(Le,null,nt(v.cells,(A,O)=>(w(),N("td",{key:O,class:Re([A.align==="right"?"text-right":A.align==="center"?"text-center":"text-left"]),dir:"auto"},[f(A).plainText!==null?(w(),N("span",{key:0,class:"text-node","custom-id":t.customId},R(f(A).plainText),9,Ij)):f(A).simpleChildren?(w(),ve(x(Gu),{key:1,nodes:f(A).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${y}-${O}`},null,8,["nodes","custom-id","index-key"])):(w(),ve(x(yo),{key:2,nodes:A.children,"index-key":`table-td-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:g[1]||(g[1]=$=>_.$emit("copy",$))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,Aj),oe(Gr,{name:"table-node-fade"},{default:_e(()=>[n.value?(w(),N("div",$j,[Cn(_.$slots,"loading",{isLoading:n.value},()=>[g[2]||(g[2]=T("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),g[3]||(g[3]=T("span",{class:"sr-only"},"Loading",-1))],!0)])):ie("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);wu.install=e=>{e.component(wu.__name,wu)};const Nj={class:"hr-node"},Df=un({},[["render",function(e,t){return w(),N("hr",Nj)}],["__scopeId","data-v-39b2349c"]]);Df.install=e=>{e.component(Df.__name,Df)};const Lj={class:"unknown-node"},A1=je({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(w(),N("div",Lj,R(e.node.raw),1))}),Bf=un(je({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){const t=e,n=F(()=>`vmr-container vmr-container-${t.node.name}`),s=cs(()=>t.customId),o=F(()=>it({text:Xn,paragraph:ql,heading:Rp,inline_code:Us,link:to,image:qr,strong:Js,emphasis:no,strikethrough:eo,insert:vo,subscript:go,superscript:mo,checkbox:Io,checkbox_input:Io,hardbreak:jr,math_inline:gi,reference:Zs,list:nc,math_block:QM,table:wu},s.value));return(i,r)=>(w(),N("div",dn({class:n.value},e.node.attrs),[(w(!0),N(Le,null,nt(e.node.children,(l,a)=>{return w(),ve(Hs((c=l.type,o.value[c]||A1)),{key:`${e.indexKey||"vmr-container"}-${a}`,"custom-id":t.customId,node:l,"index-key":`${e.indexKey||"vmr-container"}-${a}`,typewriter:t.typewriter,fade:t.fade},null,8,["custom-id","node","index-key","typewriter","fade"]);var c}),128))],16))}}),[["__scopeId","data-v-911e41c4"]]);Bf.install=e=>{e.component(Bf.__name,Bf)};const Oj=["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"],tS=[[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 Pj(e){if(e<=255)return Oj[e];let t=0,n=tS.length-1;for(;t<=n;){const s=t+n>>1,o=tS[s];if(e<o[0])n=s-1;else{if(!(e>o[1]))return o[2];t=s+1}}return"L"}const Rj=/[ \t\n\r\f]+/g,Dj=/[\t\n\r\f]| {2,}|^ | $/;let Bg=null;const Bj=new RegExp("\\p{Script=Arabic}","u"),$h=new RegExp("\\p{M}","u"),JM=new RegExp("\\p{Nd}","u");function nS(e){return Bj.test(e)}function sS(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 er(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(!(n<12288)){if(n>=55296&&n<=56319&&t+1<e.length){const s=e.charCodeAt(t+1);if(s>=56320&&s<=57343){if(sS(s-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(sS(n))return!0}}return!1}const Fj=new Set([" "," ","","\uFEFF"]);function Hj(e){return er(e)}function T1(e){return!(function(t){const n=Dp(t);return n!==null&&(cy.has(n)||Kl.has(n))})(e)&&!(function(t){const n=Dp(t);return n!==null&&Fj.has(n)})(e)}const cy=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),Nh=new Set(['"',"(","[","{","“","‘","«","‹","(","〔","〈","《","「","『","【","〖","〘","〚"]),uy=new Set(["'","’"]),Kl=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),Wj=new Set([":",".","،","؛"]),zj=new Set(["၏"]),Uj=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function qj(e){if(dy(e))return!0;let t=!1;for(const n of e)if(Kl.has(n))t=!0;else if(!t||!$h.test(n))return!1;return t}function jj(e){for(const t of e)if(!cy.has(t)&&!Kl.has(t))return!1;return e.length>0}function Vj(e){if(dy(e))return!0;for(const t of e)if(!Nh.has(t)&&!uy.has(t)&&!$h.test(t))return!1;return e.length>0}function dy(e){let t=!1;for(const n of e)if(n!=="\\"&&!$h.test(n)){if(!(Nh.has(n)||Kl.has(n)||uy.has(n)))return!1;t=!0}return t}function e3(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const s=e.charCodeAt(n);if(s<56320||s>57343)return n;const o=n-1;if(o<0)return n;const i=e.charCodeAt(o);return i>=55296&&i<=56319?o:n}function Dp(e){if(e.length===0)return null;const t=e3(e,e.length);return e.slice(t)}function Kj(e){const t=Array.from(e);let n=t.length;for(;n>0;){const s=t[n-1];if($h.test(s))n--;else{if(!Nh.has(s)&&!uy.has(s))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function Gj(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function oS(e,t,n,s){const o=t[s],i=e[s];if(o==null)return i;const r=n[s];if(i.length===r)return i;const l=o.repeat(r);return e[s]=l,l}function iS(e,t){return e&&t!==null&&Wj.has(t)}function Yj(e){const t=Dp(e);return t!==null&&zj.has(t)}function Xj(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 M1(e){let t=e.length;for(;t>0;){const n=e3(e,t),s=e.slice(n,t);if(Uj.has(s))return!0;if(!Kl.has(s))return!1;t=n}return!1}function Qj(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
|
|
237
237
|
`)return"hard-break"}return e===" "?"space":e===" "||e===" "||e===""||e==="\uFEFF"?"glue":e===""?"zero-width-break":e===""?"soft-hyphen":"text"}const Zj=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Vo(e){return e.length===1?e[0]:e.join("")}function Jj(e,t){const n=[];for(let s=e.length-1;s>=0;s--)n.push(e[s]);return n.push(t),Vo(n)}function eV(e,t,n,s){if(!Zj.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const o=[];let i=null,r=[],l=n,a=!1,c=0;for(const u of e){const d=Qj(u,s),p=d==="text"&&t;i===null||d!==i||p!==a?(i!==null&&o.push({text:Vo(r),isWordLike:a,kind:i,start:l}),i=d,r=[u],l=n+c,a=p,c+=u.length):(r.push(u),c+=u.length)}return i!==null&&o.push({text:Vo(r),isWordLike:a,kind:i,start:l}),o}function Fg(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const tV=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function nV(e,t){const n=e.texts[t];return!!n.startsWith("www.")||tV.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function sV(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}const oV=new Set([":","-","/","×",",",".","+","–","—"]),rS=/^[A-Za-z0-9_]+[,:;]*$/,lS=/[,:;]+$/;function aS(e){for(const t of e)if(JM.test(t))return!0;return!1}function Ff(e){if(e.length===0)return!1;for(const t of e)if(!JM.test(t)&&!oV.has(t))return!1;return!0}function cS(e,t,n){var s,o,i;const r=(Bg===null&&(Bg=new Intl.Segmenter(void 0,{granularity:"word"})),Bg);let l=0;const a=[],c=[],u=[],d=[],p=[],h=[],f=[],m=[],b=[],_=[],g=[],v=[];for(const k of r.segment(e))for(const E of eV(k.segment,(s=k.isWordLike)!=null&&s,k.index,n)){let M=function(){h[q]!==null&&(c[q]=[oS(a,h,f,q)],h[q]=null),c[q].push(E.text),u[q]=u[q]||E.isWordLike,m[q]=m[q]||I,b[q]=b[q]||P,_[q]=W,g[q]=z,v[q]=iS(b[q],D)};const L=E.kind==="text",S=Gj(E.text,E.isWordLike,E.kind),I=er(E.text),P=nS(E.text),D=Dp(E.text),W=M1(E.text),z=Yj(E.text),q=l-1;t.carryCJKAfterClosingQuote&&L&&l>0&&d[q]==="text"&&I&&m[q]&&_[q]||L&&l>0&&d[q]==="text"&&jj(E.text)&&m[q]||L&&l>0&&d[q]==="text"&&g[q]?M():L&&l>0&&d[q]==="text"&&E.isWordLike&&P&&v[q]?(M(),u[q]=!0):S!==null&&l>0&&d[q]==="text"&&h[q]===S?f[q]=((o=f[q])!=null?o:1)+1:L&&!E.isWordLike&&l>0&&d[q]==="text"&&(qj(E.text)||E.text==="-"&&u[q])?M():(a[l]=E.text,c[l]=[E.text],u[l]=E.isWordLike,d[l]=E.kind,p[l]=E.start,h[l]=S,f[l]=S===null?0:1,m[l]=I,b[l]=P,_[l]=W,g[l]=z,v[l]=iS(P,D),l++)}for(let k=0;k<l;k++)h[k]===null?a[k]=Vo(c[k]):a[k]=oS(a,h,f,k);for(let k=1;k<l;k++)d[k]==="text"&&!u[k]&&dy(a[k])&&d[k-1]==="text"&&(a[k-1]+=a[k],u[k-1]=u[k-1]||u[k],a[k]="");const y=Array.from({length:l},()=>null);let A=-1;for(let k=l-1;k>=0;k--){const E=a[k];if(E.length!==0){if(d[k]==="text"&&!u[k]&&Vj(E)&&A>=0&&d[A]==="text"){const M=(i=y[A])!=null?i:[];M.push(E),y[A]=M,p[A]=p[k],a[k]="";continue}A=k}}for(let k=0;k<l;k++){const E=y[k];E!=null&&(a[k]=Jj(E,a[k]))}let O=0;for(let k=0;k<l;k++){const E=a[k];E.length!==0&&(O!==k&&(a[O]=E,u[O]=u[k],d[O]=d[k],p[O]=p[k]),O++)}a.length=O,u.length=O,d.length=O,p.length=O;const $=(function(k){const E=k.texts.slice(),M=k.isWordLike.slice(),L=k.kinds.slice(),S=k.starts.slice();for(let I=0;I<E.length-1;I++){if(L[I]!=="text"||L[I+1]!=="text"||!er(E[I])||!er(E[I+1]))continue;const P=Kj(E[I]);P!==null&&(E[I]=P.head,E[I+1]=P.tail+E[I+1],S[I+1]=S[I]+P.head.length)}return{len:E.length,texts:E,isWordLike:M,kinds:L,starts:S}})((function(k){const E=[],M=[],L=[],S=[];for(let I=0;I<k.len;I++){const P=k.texts[I],D=k.kinds[I],W=k.isWordLike[I];if(D==="text"&&W&&rS.test(P)){const z=[P];let q=lS.test(P),Q=I+1;for(;q&&Q<k.len&&k.kinds[Q]==="text"&&k.isWordLike[Q]&&rS.test(k.texts[Q]);){const X=k.texts[Q];z.push(X),q=lS.test(X),Q++}E.push(Vo(z)),M.push(!0),L.push("text"),S.push(k.starts[I]),I=Q-1;continue}E.push(P),M.push(W),L.push(D),S.push(k.starts[I])}return{len:E.length,texts:E,isWordLike:M,kinds:L,starts:S}})((function(k){const E=[],M=[],L=[],S=[];for(let I=0;I<k.len;I++){const P=k.texts[I];if(k.kinds[I]==="text"&&P.includes("-")){const D=P.split("-");let W=D.length>1;for(let z=0;z<D.length;z++){const q=D[z];if(!W)break;q.length!==0&&aS(q)&&Ff(q)||(W=!1)}if(W){let z=0;for(let q=0;q<D.length;q++){const Q=D[q],X=q<D.length-1?`${Q}-`:Q;E.push(X),M.push(!0),L.push("text"),S.push(k.starts[I]+z),z+=X.length}continue}}E.push(P),M.push(k.isWordLike[I]),L.push(k.kinds[I]),S.push(k.starts[I])}return{len:E.length,texts:E,isWordLike:M,kinds:L,starts:S}})((function(k){const E=[],M=[],L=[],S=[];for(let I=0;I<k.len;I++){const P=k.texts[I],D=k.kinds[I];if(D==="text"&&Ff(P)&&aS(P)){const W=[P];let z=I+1;for(;z<k.len&&k.kinds[z]==="text"&&Ff(k.texts[z]);)W.push(k.texts[z]),z++;E.push(Vo(W)),M.push(!0),L.push("text"),S.push(k.starts[I]),I=z-1;continue}E.push(P),M.push(k.isWordLike[I]),L.push(D),S.push(k.starts[I])}return{len:E.length,texts:E,isWordLike:M,kinds:L,starts:S}})((function(k){const E=[],M=[],L=[],S=[];for(let I=0;I<k.len;I++){const P=k.texts[I];if(E.push(P),M.push(k.isWordLike[I]),L.push(k.kinds[I]),S.push(k.starts[I]),!sV(P))continue;const D=I+1;if(D>=k.len||Fg(k.kinds[D]))continue;const W=[],z=k.starts[D];let q=D;for(;q<k.len&&!Fg(k.kinds[q]);)W.push(k.texts[q]),q++;W.length>0&&(E.push(Vo(W)),M.push(!0),L.push("text"),S.push(z),I=q-1)}return{len:E.length,texts:E,isWordLike:M,kinds:L,starts:S}})((function(k){const E=k.texts.slice(),M=k.isWordLike.slice(),L=k.kinds.slice(),S=k.starts.slice();for(let P=0;P<k.len;P++){if(L[P]!=="text"||!nV(k,P))continue;const D=[E[P]];let W=P+1;for(;W<k.len&&!Fg(L[W]);){D.push(E[W]),M[P]=!0;const z=E[W].includes("?");if(L[W]="text",E[W]="",W++,z)break}E[P]=Vo(D)}let I=0;for(let P=0;P<E.length;P++){const D=E[P];D.length!==0&&(I!==P&&(E[I]=D,M[I]=M[P],L[I]=L[P],S[I]=S[P]),I++)}return E.length=I,M.length=I,L.length=I,S.length=I,{len:I,texts:E,isWordLike:M,kinds:L,starts:S}})((function(k){const E=[],M=[],L=[],S=[];let I=0;for(;I<k.len;){const P=[k.texts[I]];let D=k.isWordLike[I],W=k.kinds[I],z=k.starts[I];if(W==="glue"){const q=[P[0]],Q=z;for(I++;I<k.len&&k.kinds[I]==="glue";)q.push(k.texts[I]),I++;const X=Vo(q);if(!(I<k.len&&k.kinds[I]==="text")){E.push(X),M.push(!1),L.push("glue"),S.push(Q);continue}P[0]=X,P.push(k.texts[I]),D=k.isWordLike[I],W="text",z=Q,I++}else I++;if(W==="text")for(;I<k.len&&k.kinds[I]==="glue";){const q=[];for(;I<k.len&&k.kinds[I]==="glue";)q.push(k.texts[I]),I++;const Q=Vo(q);I<k.len&&k.kinds[I]==="text"?(P.push(Q,k.texts[I]),D=D||k.isWordLike[I],I++):P.push(Q)}E.push(Vo(P)),M.push(D),L.push(W),S.push(z)}return{len:E.length,texts:E,isWordLike:M,kinds:L,starts:S}})({len:O,texts:a,isWordLike:u,kinds:d,starts:p})))))));for(let k=0;k<$.len-1;k++){const E=Xj($.texts[k]);E!==null&&($.kinds[k]!=="space"&&$.kinds[k]!=="preserved-space"||$.kinds[k+1]!=="text"||!nS($.texts[k+1])||($.texts[k]=E.space,$.isWordLike[k]=!1,$.kinds[k]=$.kinds[k]==="preserved-space"?"preserved-space":"space",$.texts[k+1]=E.marks+$.texts[k+1],$.starts[k+1]=$.starts[k]+E.space.length))}return $}function iV(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const n=[];let s=0;for(let o=0;o<e.len;o++)e.kinds[o]==="hard-break"&&(n.push({startSegmentIndex:s,endSegmentIndex:o,consumedEndSegmentIndex:o+1}),s=o+1);return s<e.len&&n.push({startSegmentIndex:s,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}let wa=null;const uS=new Map;let Sa=null;const rV=new RegExp("\\p{Emoji_Presentation}","u"),lV=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let Hg=null;const dS=new Map;function E1(){if(wa!==null)return wa;if(typeof OffscreenCanvas<"u")return wa=new OffscreenCanvas(1,1).getContext("2d"),wa;if(typeof document<"u")return wa=document.createElement("canvas").getContext("2d"),wa;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function Cr(e,t){let n=t.get(e);return n===void 0&&(n={width:E1().measureText(e).width,containsCJK:er(e)},t.set(e,n)),n}function Lh(){if(Sa!==null)return Sa;if(typeof navigator>"u")return Sa={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},Sa;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 Sa={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},Sa}function t3(){return Hg===null&&(Hg=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Hg}function aV(e){return rV.test(e)||e.includes("️")}function Tl(e,t,n){return n===0?t.width:t.width-(function(s,o){return o.emojiCount===void 0&&(o.emojiCount=(function(i){let r=0;const l=t3();for(const a of l.segment(i))aV(a.segment)&&r++;return r})(s)),o.emojiCount})(e,t)*n}function cV(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 uV(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function fS(e,t,n){const{widths:s,kinds:o,breakableFitAdvances:i}=e;if(s.length===0)return 0;const r=t+Lh().lineFitEpsilon;let l=0,a=0,c=!1,u=0,d=0,p=-1,h=0;function f(y=u,A=d,O=a){l++,a=0,c=!1,p=-1,h=0}function m(y,A){c=!0,u=y+1,d=0,a=A}function b(y,A,O){c=!0,u=y,d=A+1,a=O}function _(y,A){c?(a+=A,u=y+1,d=0):m(y,A)}function g(y,A){const O=i[y];for(let $=A;$<O.length;$++){const k=O[$];c?a+k>r?(f(),b(y,$,k)):(a+=k,u=y,d=$+1):b(y,$,k)}c&&u===y&&d===O.length&&(u=y+1,d=0)}let v=0;for(;v<s.length&&(c||(v=cV(e,v),!(v>=s.length)));){const y=s[v],A=o[v],O=A==="space"||A==="preserved-space"||A==="tab"||A==="zero-width-break"||A==="soft-hyphen";if(c)if(a+y>r){if(O){_(v,y),f(v+1,0,a-y),v++;continue}if(p>=0){if(u>p||u===p&&d>0){f();continue}f(p,0,h);continue}if(y>t&&i[v]!==null){f(),g(v,0),v++;continue}f()}else _(v,y),O&&(p=v+1,h=a-y),v++;else y>t&&i[v]!==null?g(v,0):m(v,y),O&&(p=v+1,h=a-y),v++}return c&&f(),l}let Wg=null;function dV(e,t){const n=[];let s=[],o=0,i=!1,r=!1,l=!1;function a(){s.length!==0&&(n.push({text:s.length===1?s[0]:s.join(""),start:o}),s=[],i=!1,r=!1,l=!1)}function c(d,p,h){s=[d],o=p,i=h,r=M1(d),l=Nh.has(d)}function u(d,p){s.push(d),i=i||p;const h=M1(d);r=d.length===1&&Kl.has(d)&&r||h,l=!1}for(const d of(Wg===null&&(Wg=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Wg).segment(e)){const p=d.segment,h=er(p);s.length!==0?l||cy.has(p)||Kl.has(p)||t.carryCJKAfterClosingQuote&&h&&r?u(p,h):i||h?(a(),c(p,d.index,h)):u(p,h):c(p,d.index,h)}return a(),n}function fV(e){if(e.length<=1)return e;const t=[];let n=[e[0].text],s=e[0].start,o=er(e[0].text),i=T1(e[0].text);function r(){t.push({text:n.length===1?n[0]:n.join(""),start:s})}for(let l=1;l<e.length;l++){const a=e[l],c=er(a.text),u=T1(a.text);o&&i?(n.push(a.text),o=o||c,i=u):(r(),n=[a.text],s=a.start,o=c,i=u)}return r(),t}function pV(e,t,n,s){const o=Lh(),{cache:i,emojiCorrection:r}=(function($,k){E1().font=$;const E=(function(S){let I=uS.get(S);return I||(I=new Map,uS.set(S,I)),I})($),M=(function(S){const I=S.match(/(\d+(?:\.\d+)?)\s*px/);return I?parseFloat(I[1]):16})($),L=k?(function(S,I){let P=dS.get(S);if(P!==void 0)return P;const D=E1();D.font=S;const W=D.measureText("😀").width;if(P=0,W>I+.5&&typeof document<"u"&&document.body!==null){const z=document.createElement("span");z.style.font=S,z.style.display="inline-block",z.style.visibility="hidden",z.style.position="absolute",z.textContent="😀",document.body.appendChild(z);const q=z.getBoundingClientRect().width;document.body.removeChild(z),W-q>.5&&(P=W-q)}return dS.set(S,P),P})($,M):0;return{cache:E,fontSize:M,emojiCorrection:L}})(t,(l=e.normalized,lV.test(l)));var l;const a=Tl("-",Cr("-",i),r),c=8*Tl(" ",Cr(" ",i),r);if(e.len===0)return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]};const u=[],d=[],p=[],h=[];let f=e.chunks.length<=1;const m=null,b=[],_=n?[]:null,g=Array.from({length:e.len});function v($,k,E,M,L,S,I){L!=="text"&&L!=="space"&&L!=="zero-width-break"&&(f=!1),u.push(k),d.push(E),p.push(M),h.push(L),b.push(I),_!==null&&_.push($)}function y($,k,E,M,L){const S=Cr($,i),I=Tl($,S,r),P=k==="space"||k==="preserved-space"||k==="zero-width-break"?0:I,D=k==="space"||k==="zero-width-break"?0:I;if(L&&M&&$.length>1){let W="sum-graphemes";Ff($)?W="pair-context":o.preferPrefixWidthsForBreakableRuns&&(W="segment-prefixes");const z=(function(q,Q,X,fe,ye){if(Q.breakableFitAdvances!==void 0)return Q.breakableFitAdvances;const Me=t3(),we=[];for(const rt of Me.segment(q))we.push(rt.segment);if(we.length<=1)return Q.breakableFitAdvances=null,Q.breakableFitAdvances;if(ye==="sum-graphemes"){const rt=[];for(const le of we){const U=Cr(le,X);rt.push(Tl(le,U,fe))}return Q.breakableFitAdvances=rt,Q.breakableFitAdvances}if(ye==="pair-context"||we.length>96){const rt=[];let le=null,U=0;for(const G of we){const ne=Tl(G,Cr(G,X),fe);if(le===null)rt.push(ne);else{const H=le+G,J=Cr(H,X);rt.push(Tl(H,J,fe)-U)}le=G,U=ne}return Q.breakableFitAdvances=rt,Q.breakableFitAdvances}const ze=[];let Ue="",Fe=0;for(const rt of we){Ue+=rt;const le=Tl(Ue,Cr(Ue,X),fe);ze.push(le-Fe),Fe=le}return Q.breakableFitAdvances=ze,Q.breakableFitAdvances})($,S,i,r,W);return void v($,I,P,D,k,E,z)}v($,I,P,D,k,E,null)}for(let $=0;$<e.len;$++){g[$]=u.length;const k=e.texts[$],E=e.isWordLike[$],M=e.kinds[$],L=e.starts[$];if(M==="soft-hyphen"){v(k,0,a,a,M,L,null);continue}if(M==="hard-break"){v(k,0,0,0,M,L,null);continue}if(M==="tab"){v(k,0,0,0,M,L,null);continue}const S=Cr(k,i);if(M==="text"&&S.containsCJK){const I=dV(k,o),P=s==="keep-all"?fV(I):I;for(let D=0;D<P.length;D++){const W=P[D];y(W.text,"text",L+W.start,E,s==="keep-all"||!er(W.text))}continue}y(k,M,L,E,!0)}const A=(function($,k,E){const M=[];for(let L=0;L<$.length;L++){const S=$[L],I=S.startSegmentIndex<k.length?k[S.startSegmentIndex]:E,P=S.endSegmentIndex<k.length?k[S.endSegmentIndex]:E,D=S.consumedEndSegmentIndex<k.length?k[S.consumedEndSegmentIndex]:E;M.push({startSegmentIndex:I,endSegmentIndex:P,consumedEndSegmentIndex:D})}return M})(e.chunks,g,u.length),O=m===null?null:(function($,k){const E=(function(L){const S=L.length;if(S===0)return null;const I=new Array(S);let P=!1;for(let X=0;X<S;){const fe=L.charCodeAt(X);let ye=fe,Me=1;if(fe>=55296&&fe<=56319&&X+1<S){const ze=L.charCodeAt(X+1);ze>=56320&&ze<=57343&&(ye=ze-56320+(fe-55296<<10)+65536,Me=2)}const we=Pj(ye);we!=="R"&&we!=="AL"&&we!=="AN"||(P=!0);for(let ze=0;ze<Me;ze++)I[X+ze]=we;X+=Me}if(!P)return null;let D=0;for(let X=0;X<S;X++){const fe=I[X];if(fe==="L"){D=0;break}if(fe==="R"||fe==="AL"){D=1;break}}const W=new Int8Array(S);for(let X=0;X<S;X++)W[X]=D;const z=1&D?"R":"L",q=z;let Q=q;for(let X=0;X<S;X++)I[X]==="NSM"?I[X]=Q:Q=I[X];Q=q;for(let X=0;X<S;X++){const fe=I[X];fe==="EN"?I[X]=Q==="AL"?"AN":"EN":fe!=="R"&&fe!=="L"&&fe!=="AL"||(Q=fe)}for(let X=0;X<S;X++)I[X]==="AL"&&(I[X]="R");for(let X=1;X<S-1;X++)I[X]==="ES"&&I[X-1]==="EN"&&I[X+1]==="EN"&&(I[X]="EN"),I[X]!=="CS"||I[X-1]!=="EN"&&I[X-1]!=="AN"||I[X+1]!==I[X-1]||(I[X]=I[X-1]);for(let X=0;X<S;X++){if(I[X]!=="EN")continue;let fe;for(fe=X-1;fe>=0&&I[fe]==="ET";fe--)I[fe]="EN";for(fe=X+1;fe<S&&I[fe]==="ET";fe++)I[fe]="EN"}for(let X=0;X<S;X++){const fe=I[X];fe!=="WS"&&fe!=="ES"&&fe!=="ET"&&fe!=="CS"||(I[X]="ON")}Q=q;for(let X=0;X<S;X++){const fe=I[X];fe==="EN"?I[X]=Q==="L"?"L":"EN":fe!=="R"&&fe!=="L"||(Q=fe)}for(let X=0;X<S;X++){if(I[X]!=="ON")continue;let fe=X+1;for(;fe<S&&I[fe]==="ON";)fe++;const ye=(X>0?I[X-1]:q)!=="L"?"R":"L";if(ye===((fe<S?I[fe]:q)!=="L"?"R":"L"))for(let Me=X;Me<fe;Me++)I[Me]=ye;X=fe-1}for(let X=0;X<S;X++)I[X]==="ON"&&(I[X]=z);for(let X=0;X<S;X++){const fe=I[X];1&W[X]?fe!=="L"&&fe!=="AN"&&fe!=="EN"||W[X]++:fe==="R"?W[X]++:fe!=="AN"&&fe!=="EN"||(W[X]+=2)}return W})($);if(E===null)return null;const M=new Int8Array(k.length);for(let L=0;L<k.length;L++)M[L]=E[k[L]];return M})(e.normalized,m);return _!==null?{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:p,kinds:h,simpleLineWalkFastPath:f,segLevels:O,breakableFitAdvances:b,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:A,segments:_}:{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:p,kinds:h,simpleLineWalkFastPath:f,segLevels:O,breakableFitAdvances:b,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:A}}function hV(e,t,n){return(function(s,o,i,r){var l;const a=(l=r?.wordBreak)!=null?l:"normal";return pV((function(c,u,d="normal",p="normal"){const h=(function(b){const _=b??"normal";return _==="pre-wrap"?{mode:_,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:_,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}})(d),f=h.mode==="pre-wrap"?(function(b){return/[\r\f]/.test(b)?b.replace(/\r\n/g,`
|
|
238
238
|
`).replace(/[\r\f]/g,`
|
|
239
239
|
`):b.replace(/\r\n/g,`
|
|
@@ -242,7 +242,7 @@ ${v}`);u+=$}else u+=O;u+=_,d=h?p+1:e.length}return u}function Xz(e,t){if(!e||!t.
|
|
|
242
242
|
`,t-1)+1;return e.slice(n,t).trim()}function SS(e){const t=i3(e);return t.length>=2&&t.every(n=>{const s=n.trim();return s.length>=1&&s.replace(/^:/,"").replace(/:$/,"").split("").every(o=>o==="-")})}function i3(e){return e.includes("|")?e.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]}function r3(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 fy(e){const t=String(e??"");return`${t.length}:${r3(t)}`}function I1(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?fy(r):`${r.length}:${r3(r.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${Xo(e)}`;if(typeof e!="object")return typeof e;const s=e,o=t.get(s);if(o)return`cycle:${o}`;if(n>=6)return`object:${Xo(s)}`;const i=Xo(s);if(t.set(s,i),Array.isArray(e)){const r=e.slice(0,200);return`a:${e.length}:${r.map(l=>I1(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}:${I1(r[c],t,n+1)}`).join(";")}`}return typeof e}function Bp(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function l3(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(s=>Bp(s)?Jr(s,t,n+1):l3(s,t,n+1)).join(",")}`:Bp(e)?Jr(e,t,n):I1(e,t,n)}function CV(e,t,n){return Object.keys(e).sort().filter(s=>s!=="children"&&!o3.includes(s)).map(s=>{const o=e[s];return typeof o=="string"?`${s}=s:${fy(o)}`:typeof o=="number"||typeof o=="boolean"||o==null?`${s}=${String(o)}`:typeof o=="function"?`${s}=fn:${Xo(o)}`:wV.has(s)&&(Array.isArray(o)||typeof o=="object")?`${s}=${l3(o,t,n+1)}`:o&&typeof o=="object"?`${s}=object:${Xo(o)}`:""}).filter(Boolean).join(";")}function xV(e){return o3.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${fy(n)}`:""}).filter(Boolean).join(";")}function Jr(e,t=new WeakMap,n=0){const s=kS.get(e);if(s)return s;const o=e,i=t.get(o);if(i)return`node-cycle:${i}`;if(n>=6)return`node:${e.type}:${Xo(o)}`;const r=Xo(o);t.set(o,r);const l=(function(a,c,u){const d=a,p=Array.isArray(d.children)?d.children:[],h=p.length?p.slice(0,200).map(f=>Jr(f,c,u+1)).join("|"):"";return[a.type,xV(d),CV(d,c,u),p.length,h].join(":")})(e,t,n);return kS.set(o,l),l}function a3(e,t){return Jr(e)===Jr(t)}function py(e,t,n){const s=ai(),o=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=ai()-s,e[o]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function CS(e,t,n){return py(t,n,()=>Jr(e))}function c3(e,t,n){return CS(e,n,"stabilizeSignatureMs")===CS(t,n,"stabilizeSignatureMs")}function Vg(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function xS(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function AV(e,t){return e.length===t.length&&e===t}function hy(e,t,n=0){if(n>=4)return null;if(e.type!==t.type)return!1;const s=e,o=t,i=Object.keys(s).filter(u=>u!=="type"&&u!=="children").sort(),r=Object.keys(o).filter(u=>u!=="type"&&u!=="children").sort();if(i.length!==r.length)return!1;for(let u=0;u<i.length;u++){const d=i[u];if(d!==r[u])return!1;const p=s[d],h=o[d];if(typeof p!=typeof h)return!1;if(typeof p!="string"){if(typeof p!="number"&&typeof p!="boolean"&&p!=null)return null;if(!Object.is(p,h))return!1}else if(typeof h!="string"||!AV(p,h))return!1}const l=Object.prototype.hasOwnProperty.call(s,"children");if(l!==Object.prototype.hasOwnProperty.call(o,"children"))return!1;if(!l)return!0;const a=s.children,c=o.children;if(!Array.isArray(a)||!Array.isArray(c))return null;if(a.length!==c.length)return!1;for(let u=0;u<a.length;u++){const d=a[u],p=c[u];if(!Bp(d)||!Bp(p))return null;const h=hy(d,p,n+1);if(h==null)return null;if(!h)return!1}return!0}function TV(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;const n=hy(e,t);return n??a3(e,t)}function MV(e,t,n){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;let s=null;return py(n,"stabilizeSignatureMs",()=>{s=hy(e,t)}),s??c3(e,t,n)}function EV(e,t){const n={};for(const s of bV){const o=e[s],i=t?.[s];typeof o=="number"&&(n[s]=o-(typeof i=="number"?i:0))}return n}function IV(e,t){var n;const s=E2(t.instanceMsgId),o=new Map,i=(n=t.smoothStreamingEnabled)!=null?n:F(()=>!1),r=Z(t.renderContent.value);let l,a=[],c="",u="",d="",p=0,h=0,f=ai();function m(){l&&(clearTimeout(l),l=void 0)}function b(){m();const E=t.renderContent.value;r.value!==E&&(r.value=E),f=ai()}Ke([t.renderContent,t.effectiveFinal,i],([E,M,L])=>{r.value!==E&&(!L||M||(function(S,I){if(!S&&I||I.length<=80||I.length<S.length||!I.startsWith(S))return!0;const P=I.slice(S.length);return!!P&&(!!SS(wS(I))||!(!P.includes(`
|
|
243
243
|
|
|
244
244
|
`)&&!/(?:^|\n)(?:#{1,6}\s|[-+*]\s+|\d+[.)]\s+|>\s*|`{3,}|~{3,})/.test(P))||P.endsWith(`
|
|
245
|
-
`)&&!(function(D){const W=wS(D);if(SS(W))return!1;const z=i3(W);return z.length>=2&&z.some(q=>q.trim())})(I))})(r.value,E)?b():(function(){if(h+=1,l)return;const S=Math.max(0,(function(I){const P=I.parseCoalesceMs;return typeof P=="number"&&Number.isFinite(P)&&P>=0?P:80})(e)-(ai()-f));S<=0?b():l=setTimeout(b,S)})())},{flush:"sync",immediate:!0}),K1(m);const _=F(()=>{var E,M,L,S;return Y9(e.customHtmlTags,(E=e.parseOptions)==null?void 0:E.customHtmlTags,(S=(L=(M=t.customComponentsMap)==null?void 0:M.value)!=null?L:{},Object.entries(S).map(([I,P])=>{const D=si(I);return P==null||!D||dd(D)||RT.has(D)||ad.has(D)?"":D}).filter(Boolean)))}),g=F(()=>{const{key:E,tags:M}=X9(_.value);if(!E)return s;const L=o.get(E);if(L)return L;const S=E2(t.instanceMsgId,{customHtmlTags:M});return o.set(E,S),S}),v=F(()=>{const E=g.value;return e.customMarkdownIt?e.customMarkdownIt(E):E}),y=F(()=>{var E,M;const L=(E=e.parseOptions)!=null?E:{},S=t.effectiveFinal.value,I=_.value,P=S!=null,D=I.length>0;return P||D||L.streamParse==null?it(it(Lt(it({},L),{streamParse:(M=L.streamParse)==null||M}),P?{final:S}:{}),D?{customHtmlTags:I}:{}):L}),A=F(()=>{var E;return new Set(((E=y.value.customHtmlTags)!=null?E:[]).map(M=>String(M).trim().toLowerCase()).filter(Boolean))}),O=F(()=>_S(y.value,v.value,e.customMarkdownIt,{includeFinal:!0})),$=F(()=>_S(y.value,v.value,e.customMarkdownIt,{includeFinal:!1}));Ke([O,$],([E,M],[L,S])=>{L&&(E===L&&M===S||(b(),M!==S&&(a=[],d="")))},{flush:"sync"});const k=F(()=>{var E,M,L,S,I,P,D,W;if((E=e.nodes)!=null&&E.length)return a=[],d="",Dr(e.nodes.slice());const z=r.value;if(!z)return a=[],d="",[];const q=t.debugPerformanceEnabled.value,Q=q?ai():0,X=v.value,fe=O.value,ye=$.value;c&&fe!==c&&(function(ce){var te,ue;(ue=(te=ce.stream)==null?void 0:te.reset)==null||ue.call(te)})(X),u&&ye!==u&&(a=[],d="");const Me=a.length>0&&z.startsWith(d)&&ye===u,we=q?bS(X):null,ze=q?{}:void 0,Ue=ze?Lt(it({},y.value),{__timing:ze}):y.value,Fe=CM(z,X,Ue),rt=q?ai():0,le=q?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let U,G=q?Vg(Fe.length):void 0,ne=0,H=0;if(Me){const ce=q?ai():0;if(le){const te=(function(ue,j,Y){if(!j.length)return{nodes:ue,metrics:Vg(ue.length)};const re=(function(Ie,ae,Te){const Ve=Math.min(Ie.length,ae.length);for(let tt=0;tt<Ve;tt++)if(!MV(ae[tt],Ie[tt],Te))return tt;return Ie.length===ae.length?-1:Ve})(ue,j,Y);if(re<0)return{nodes:j,metrics:{reusedNodeCount:ue.length,dirtyStartIndex:re,stablePrefixNodeCount:ue.length,dirtyTailNodeCount:0}};const ge=ue.slice();let Ae=re;for(let Ie=0;Ie<re;Ie++)ge[Ie]=j[Ie];for(let Ie=re;Ie<ue.length;Ie++){const ae=j[Ie],Te=ue[Ie];ae&&c3(ae,Te,Y)&&(ge[Ie]=ae,Ae+=1)}return{nodes:ge,metrics:{reusedNodeCount:Ae,dirtyStartIndex:re,stablePrefixNodeCount:re,dirtyTailNodeCount:xS(re,ue,j)}}})(Fe,a,le);U=te.nodes,G=te.metrics}else{const te=(function(ue,j){if(!j.length)return{nodes:ue,metrics:Vg(ue.length)};const Y=(function(Ae,Ie){const ae=Math.min(Ae.length,Ie.length);for(let Te=0;Te<ae;Te++)if(!TV(Ie[Te],Ae[Te]))return Te;return Ae.length===Ie.length?-1:ae})(ue,j);if(Y<0)return{nodes:j,metrics:{reusedNodeCount:ue.length,dirtyStartIndex:Y,stablePrefixNodeCount:ue.length,dirtyTailNodeCount:0}};const re=ue.slice();let ge=Y;for(let Ae=0;Ae<Y;Ae++)re[Ae]=j[Ae];for(let Ae=Y;Ae<ue.length;Ae++){const Ie=j[Ae],ae=ue[Ae];Ie&&a3(Ie,ae)&&(re[Ae]=Ie,ge+=1)}return{nodes:re,metrics:{reusedNodeCount:ge,dirtyStartIndex:Y,stablePrefixNodeCount:Y,dirtyTailNodeCount:xS(Y,ue,j)}}})(Fe,a);U=te.nodes,G=te.metrics}ne=q?ai()-ce:0,H=G?.dirtyStartIndex==null||G.dirtyStartIndex<0?U.length:G.dirtyStartIndex}else U=Fe;le?(function(ce,te,ue=0){for(let j=Math.max(0,ue);j<ce.length;j++)py(te,"primeSignatureMs",()=>Jr(ce[j]))})(U,le,H):(function(ce,te=0){for(let ue=Math.max(0,te);ue<ce.length;ue++)Jr(ce[ue])})(U,H);const J=q?ai()-rt:0;if(p+=1,d=z,c=fe,u=ye,a=U,q){const ce=bS(X),te=typeof ce?.total=="number"&&ce.total>((M=we?.total)!=null?M:0);t.logPerf(te?"parse(stream)":"parse(sync)",it(it(it({rendererId:t.instanceMsgId,ms:Math.round(ai()-Q),nodes:U.length,contentLength:z.length,parseCommitCount:p,parseCoalescedCount:h,nodeReuseMs:J,signatureMs:(L=le?.signatureMs)!=null?L:0,stabilizeSignatureMs:(S=le?.stabilizeSignatureMs)!=null?S:0,primeSignatureMs:(I=le?.primeSignatureMs)!=null?I:0,signatureCallCount:(P=le?.signatureCallCount)!=null?P:0,stabilizeSignatureCallCount:(D=le?.stabilizeSignatureCallCount)!=null?D:0,primeSignatureCallCount:(W=le?.primeSignatureCallCount)!=null?W:0,stabilizeMs:ne},G??{}),ze?Object.fromEntries(_V.map(ue=>{var j;return[ue,(j=ze[ue])!=null?j:0]})):{}),ce?{streamMode:ce.lastMode,streamDelta:EV(ce,we),streamStats:ce}:{}))}return Dr(U)});return{effectiveCustomHtmlTags:_,effectiveCustomHtmlTagsSet:A,mdBase:g,mdInstance:v,mergedParseOptions:y,parsedNodes:k}}function $V(e){const{isClient:t}=e,n=Z(new Set),s=new Map,o=new Map,i=new Map;function r(c){if(!t)return;const u=i.get(c);u!=null&&(window.clearTimeout(u),i.delete(c))}function l(){if(t)for(const c of i.values())window.clearTimeout(c);i.clear()}function a(){n.value=new Set}return{visibleNodeIndices:n,nodeVisibilityHandles:s,nodeVisibilityWatchStops:o,nodeVisibilityFallbackTimers:i,clearVisibilityFallback:r,clearAllVisibilityFallbacks:l,markNodeVisible:function(c,u=!0){var d;u&&r(c),(function(p,h){if((m=(f=e.shouldTrackVisibleNodeIndices)==null?void 0:f.call(e))!=null&&!m)return;var f,m;const b=n.value,_=b.has(p);if(h){if(_)return;const v=new Set(b);return v.add(p),void(n.value=v)}if(!_)return;const g=new Set(b);g.delete(p),n.value=g})(c,u),u&&((d=e.onNodeMarkedVisible)==null||d.call(e,c))},resetNodeVisibleState:a,cleanupNodeVisibility:function(c){var u;if(e.shouldCleanupNodeVisibility&&!e.shouldCleanupNodeVisibility())return;for(const[p,h]of o.entries())p<c||(h(),o.delete(p));for(const[p,h]of s.entries())p<c||(h.destroy(),s.delete(p),r(p),(u=e.onNodeVisibilityCleaned)==null||u.call(e,p));for(const p of Array.from(i.keys()))p<c||r(p);if(!n.value.size)return;const d=new Set;for(const p of n.value)p<c&&d.add(p);n.value=d},destroyNodeVisibilityState:function(){a();for(const c of o.values())c();o.clear();for(const c of s.values())c.destroy();s.clear(),l()}}}function NV(e={}){const t=Z(""),n=Z(""),s=Z(!1),o=LU(e),i=()=>{const u=o.getSnapshot();t.value=u.source,n.value=u.visible,s.value=u.done},r=o.subscribe(i);i();const l=F(()=>Math.max(0,t.value.length-n.value.length)),a=F(()=>l.value===0),c=F(()=>s.value&&a.value);return V1()&&K1(()=>{r(),o.destroy()}),{source:t,visible:n,done:s,final:c,caughtUp:a,pendingChars:l,enqueue:u=>o.enqueue(u),finish:u=>o.finish(u),flush:()=>o.flush(),reset:u=>o.reset(u),pause:()=>o.pause(),resume:()=>o.resume()}}const AS=/auto|scroll|overlay/i;function LV(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return AS.test(t)||AS.test(n)}function OV(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 PV=je({name:"InfographicBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=F(()=>{var n,s;return g1((s=Ha(e.estimatedPreviewHeightPx))!=null?s:h1(String((n=e.node.code)!=null?n:"")))});return()=>cn("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?cn("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)"}},[cn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[cn("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),cn("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),cn("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},()=>cn("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,cn("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[cn("div",{class:"absolute inset-0"},[cn("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}),RV=je({name:"MermaidBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=F(()=>{var n,s;return m1((s=Ha(e.estimatedPreviewHeightPx))!=null?s:p1(String((n=e.node.code)!=null?n:"")))});return()=>cn("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?cn("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)"}},[cn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[cn("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),cn("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},()=>cn("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[cn("span",{class:"action-icon block"})])))]):null,cn("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)"}},[cn("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"}})])])}}),DV=["data-custom-id"],BV={class:"m-0 p-0"},FV=["data-probe"],HV=["data-node-index","data-node-type"],u3=un(je(Lt(it({},{name:"NodeRenderer"}),{__name:"NodeRenderer",props:{content:{},nodes:{},final:{type:Boolean},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},mode:{},htmlPolicy:{},viewportPriority:{type:Boolean},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:{},codeBlockLightTheme:{},codeBlockMonacoOptions:{},codeRenderer:{},renderCodeBlocksAsPre:{type:Boolean,default:void 0},codeBlockMinWidth:{},codeBlockMaxWidth:{},codeBlockProps:{},mermaidProps:{},d2Props:{},infographicProps:{},showTooltips:{type:Boolean,default:void 0},themes:{},langs:{},isDark:{type:Boolean},customId:{},indexKey:{},typewriter:{type:Boolean,default:!1},smoothStreaming:{type:[Boolean,String],default:"auto"},smoothStreamingOptions:{},parseCoalesceMs:{},fade:{type:Boolean,default:void 0},batchRendering:{type:Boolean,default:void 0},initialRenderBatchSize:{},renderBatchSize:{},renderBatchDelay:{},renderBatchBudgetMs:{},renderBatchIdleTimeoutMs:{},deferNodesUntilVisible:{type:Boolean,default:void 0},maxLiveNodes:{},liveNodeBuffer:{},nodeVirtual:{type:[Boolean,String],default:void 0},virtualScroll:{},renderAsFragment:{type:Boolean}},emits:["copy","handleArtifactClick","click","mouseover","mouseout","virtual-state-change","height-change","render-settled","render-final","anchor-change"],setup(e,{expose:t,emit:n}){const s=e,o=n,i=Ls(),r=Ut("markstreamNestedRendererProps",void 0);function l(C){var B,V;const K=s[C];return(function(ee){const he=i?.vnode.props;return!!he&&(Object.prototype.hasOwnProperty.call(he,ee)||Object.prototype.hasOwnProperty.call(he,String(ee).replace(/[A-Z]/g,ke=>`-${ke.toLowerCase()}`)))})(C)?K:(V=(B=r?.value)==null?void 0:B[C])!=null?V:K}const a={docs:{showTooltips:!0,fade:!0,batchRendering:!0,initialRenderBatchSize:40,renderBatchSize:80,renderBatchDelay:16,renderBatchBudgetMs:6,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:220,liveNodeBuffer:60,nodeVirtual:"auto"},chat:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:16,renderBatchSize:16,renderBatchDelay:8,renderBatchBudgetMs:4,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"},minimal:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:16,renderBatchSize:16,renderBatchDelay:8,renderBatchBudgetMs:4,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"}},c=F(()=>{return(C=l("mode"))==="chat"||C==="minimal"||C==="docs"?C:"docs";var C}),u=F(()=>{const C=l("renderCodeBlocksAsPre"),B=l("codeRenderer");return C===!0?"pre":B==="pre"||B==="shiki"||B==="monaco"?B:C===!1||c.value==="docs"?"monaco":"pre"}),d=F(()=>a[c.value]),p=F(()=>{var C;return(C=l("showTooltips"))!=null?C:d.value.showTooltips}),h=F(()=>{var C;return(C=l("fade"))!=null?C:d.value.fade}),f=F(()=>{var C;return(C=l("batchRendering"))!=null?C:d.value.batchRendering}),m=F(()=>{var C;return(C=l("initialRenderBatchSize"))!=null?C:d.value.initialRenderBatchSize}),b=F(()=>{var C;return(C=l("renderBatchSize"))!=null?C:d.value.renderBatchSize}),_=F(()=>{var C;return(C=l("renderBatchDelay"))!=null?C:d.value.renderBatchDelay}),g=F(()=>{var C;return(C=l("renderBatchBudgetMs"))!=null?C:d.value.renderBatchBudgetMs}),v=F(()=>{var C;return(C=l("renderBatchIdleTimeoutMs"))!=null?C:d.value.renderBatchIdleTimeoutMs}),y=F(()=>{var C;return(C=l("deferNodesUntilVisible"))!=null?C:d.value.deferNodesUntilVisible}),A=F(()=>{var C;return(C=l("maxLiveNodes"))!=null?C:d.value.maxLiveNodes}),O=F(()=>{var C;return(C=l("liveNodeBuffer"))!=null?C:d.value.liveNodeBuffer}),$=F(()=>{var C;return(C=l("nodeVirtual"))!=null?C:d.value.nodeVirtual}),k={get content(){return s.content},get nodes(){return s.nodes},get final(){return s.final},get parseOptions(){return l("parseOptions")},get customMarkdownIt(){return l("customMarkdownIt")},get debugPerformance(){return s.debugPerformance},get customHtmlTags(){return l("customHtmlTags")},get mode(){return l("mode")},get htmlPolicy(){return l("htmlPolicy")},get viewportPriority(){return l("viewportPriority")},get codeBlockStream(){return l("codeBlockStream")},get codeBlockDarkTheme(){return l("codeBlockDarkTheme")},get codeBlockLightTheme(){return l("codeBlockLightTheme")},get codeBlockMonacoOptions(){return l("codeBlockMonacoOptions")},get codeRenderer(){return l("codeRenderer")},get renderCodeBlocksAsPre(){return l("renderCodeBlocksAsPre")},get codeBlockMinWidth(){return l("codeBlockMinWidth")},get codeBlockMaxWidth(){return l("codeBlockMaxWidth")},get codeBlockProps(){return l("codeBlockProps")},get mermaidProps(){return l("mermaidProps")},get d2Props(){return l("d2Props")},get infographicProps(){return l("infographicProps")},get showTooltips(){return p.value},get themes(){return l("themes")},get langs(){return l("langs")},get isDark(){return l("isDark")},get customId(){return l("customId")},get indexKey(){return s.indexKey},get typewriter(){return l("typewriter")},get smoothStreaming(){return s.smoothStreaming},get smoothStreamingOptions(){return l("smoothStreamingOptions")},get parseCoalesceMs(){return l("parseCoalesceMs")},get fade(){return h.value},get batchRendering(){return f.value},get initialRenderBatchSize(){return m.value},get renderBatchSize(){return b.value},get renderBatchDelay(){return _.value},get renderBatchBudgetMs(){return g.value},get renderBatchIdleTimeoutMs(){return v.value},get deferNodesUntilVisible(){return y.value},get maxLiveNodes(){return A.value},get liveNodeBuffer(){return O.value},get nodeVirtual(){return $.value},get virtualScroll(){return s.virtualScroll},get renderAsFragment(){return s.renderAsFragment}};function E(C){o("height-change",C)}function M(C){o("virtual-state-change",C)}function L(C){o("anchor-change",C)}const S=Z(),I=Z(null),P=Z(null),D=Z(null),W=$s({1:null,2:null,3:null,4:null,5:null,6:null}),z=Z(!1),q=new Map,Q=Z(0),X=Z(0),fe=Z({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function ye(){var C,B;if(((C=s.virtualScroll)==null?void 0:C.enabled)!==!0)return null;const V=(B=s.virtualScroll)==null?void 0:B.scrollRoot;return Me(typeof V=="function"?V():V)}function Me(C){return C?typeof HTMLElement<"u"&&C instanceof HTMLElement?C:typeof C=="object"&&"value"in C?Me(C.value):typeof C=="object"&&"$el"in C?Me(C.$el):null:null}const{isClient:we,renderAsFragment:ze,debugPerformanceEnabled:Ue,resolvedShowTooltips:Fe,resolvedHtmlPolicy:rt,inheritedSmoothStreaming:le,ownsTypewriterCursor:U}=(function(C){const B=typeof window<"u",V=nd(),K=Ut("markstreamHtmlPolicy",void 0),ee=Ut("markstreamTypewriterCursor",void 0),he=Ut("markstreamSmoothStreaming",void 0),ke=F(()=>C.renderAsFragment===!0),Se=F(()=>!!(C.debugPerformance&&B&&typeof console<"u")),Pe=F(()=>{var De;if(typeof C.showTooltips=="boolean")return C.showTooltips;const $e=(De=V.showTooltips)!=null?De:V["show-tooltips"];return $e===""||$e===!0||$e==="true"||$e!==!1&&$e!=="false"&&void 0}),Ee=F(()=>{var De,$e;return($e=(De=C.htmlPolicy)!=null?De:K?.value)!=null?$e:"safe"}),We=F(()=>ee?.value!==!0);return{isClient:B,renderAsFragment:ke,debugPerformanceEnabled:Se,resolvedShowTooltips:Pe,resolvedHtmlPolicy:Ee,inheritedSmoothStreaming:he,inheritedTypewriterCursor:ee,ownsTypewriterCursor:We}})(k),{resolveViewportRoot:G,resolveScrollContainer:ne,isReverseFlexScrollRoot:H,getNormalizedScrollTop:J,getOffsetTopWithinRoot:ce}=(function(C,B){function V(){var Se,Pe;return(Pe=(Se=B.scrollRoot)==null?void 0:Se.call(B))!=null?Pe:null}function K(Se){if(typeof window>"u")return null;const Pe=V();if(Pe)return Pe;const Ee=Se??C.value;if(!Ee)return null;const We=Ee.ownerDocument||document,De=We.scrollingElement||We.documentElement;let $e=Ee;for(;$e&&$e!==We.body&&$e!==De;){if(LV(window.getComputedStyle($e))&&OV($e))return $e;$e=$e.parentElement}return null}function ee(Se){if(!B.isClient)return!1;try{const Pe=window.getComputedStyle(Se);return!!(Pe.display||"").toLowerCase().includes("flex")&&(Pe.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function he(Se,Pe,Ee){var We,De;if(Ee)return ke(Pe);const $e=Se.scrollTop;if(!ee(Se))return $e;const He=$e<0?-$e:$e;return Math.max(0,((We=Se.scrollHeight)!=null?We:0)-((De=Se.clientHeight)!=null?De:0))-He}function ke(Se){var Pe,Ee,We,De,$e;const He=Number((Pe=Se.scrollingElement)==null?void 0:Pe.scrollTop),Qe=Number((We=(Ee=Se.documentElement)==null?void 0:Ee.scrollTop)!=null?We:0),Ze=Number(($e=(De=Se.body)==null?void 0:De.scrollTop)!=null?$e:0);return Math.max(0,Number.isFinite(He)?He:0,Number.isFinite(Qe)?Qe:0,Number.isFinite(Ze)?Ze:0)}return{resolveViewportRoot:K,resolveScrollContainer:function(Se){var Pe,Ee,We,De;const $e=V();if($e)return $e;const He=K((Pe=Se??C.value)!=null?Pe:null);if(He)return He;const Qe=(De=(We=Se?.ownerDocument)!=null?We:(Ee=C.value)==null?void 0:Ee.ownerDocument)!=null?De:typeof document<"u"?document:null;return Qe?.scrollingElement||Qe?.documentElement||null},isReverseFlexScrollRoot:ee,getNormalizedScrollTop:he,getOffsetTopWithinRoot:function(Se,Pe){const Ee=Pe.ownerDocument||Se.ownerDocument||document;if((function(He,Qe){return He===Qe.documentElement||He===Qe.body||He===Qe.scrollingElement})(Pe,Ee))return Se.getBoundingClientRect().top+ke(Ee);const We=Pe.getBoundingClientRect(),De=Se.getBoundingClientRect(),$e=he(Pe,Ee,!1);return De.top-We.top+$e}}})(S,{isClient:we,scrollRoot:ye});En("markstreamShowTooltips",Fe),En("markstreamHtmlPolicy",rt),En("markstreamTypewriter",F(()=>k.typewriter!==!1)),En("markstreamFade",F(()=>k.fade!==!1)),En("markstreamTypewriterCursor",F(()=>!0)),En("markstreamTextStreamState",q),En("markstreamStreamVersion",Q),En("markstreamParseOptions",F(()=>k.parseOptions)),En("markstreamCustomMarkdownIt",F(()=>k.customMarkdownIt));const{smoothStreamingEnabled:te,renderContent:ue,effectiveFinal:j}=(function(C,B){const V=NV(C.smoothStreamingOptions),K=F(()=>{var Ee,We,De;return C.smoothStreaming!==!1&&!((Ee=C.nodes)!=null&&Ee.length)&&(C.smoothStreaming===!0||!((We=B.inheritedSmoothStreaming)!=null&&We.value))&&(C.smoothStreaming===!0||C.typewriter===!0||((De=C.maxLiveNodes)!=null?De:0)<=0)}),ee=Z(!B.isClient||C.smoothStreaming===!0);hn(()=>{ee.value=!0});const he=F(()=>ee.value&&K.value),ke=F(()=>{var Ee;return he.value?V.visible.value:(Ee=C.content)!=null?Ee:""}),Se=F(()=>{var Ee,We;const De=(Ee=C.parseOptions)!=null?Ee:{};return(We=C.final)!=null?We:De.final}),Pe=F(()=>{const Ee=Se.value;return he.value&&Ee!=null?!!Ee&&V.caughtUp.value:Ee});return Ke([()=>C.content,()=>C.nodes,he,Se],([Ee,We,De,$e])=>{if(We?.length)return void V.reset("");const He=Ee??"";if(!De)return V.reset(He),void($e&&V.finish({flush:!0}));const Qe=V.source.value;He?He===Qe||(He.startsWith(Qe)?V.enqueue(He.slice(Qe.length)):V.reset(He)):V.reset(""),$e&&V.finish()},{immediate:!0}),{smoothStream:V,smoothStreamingEligible:K,smoothStreamingEnabled:he,renderContent:ke,requestedFinal:Se,effectiveFinal:Pe}})(k,{isClient:we,inheritedSmoothStreaming:le});En("markstreamSmoothStreaming",te);const Y=Z(!1);let re="",ge=!1,Ae=null;function Ie(){we&&Ae!=null&&(window.clearTimeout(Ae),Ae=null)}function ae(){Y.value=!1,Ie()}function Te(C,B){if(!Ue.value)return;const V=(function(){if(!Ue.value)return null;const K=Tt(Ve),ee=Tt(tt),he=Math.max(kt,ee);if(K<=0&&he<=0)return null;const ke={total:K,maxPerFrame:he,byLabel:(Se=Ve,Object.fromEntries(Array.from(Se.entries()).sort((Pe,Ee)=>Ee[1]-Pe[1]||Pe[0].localeCompare(Ee[0]))))};var Se;return Ve.clear(),tt.clear(),kt=0,ke})();console.info(`[markstream-vue][perf] ${C}`,V?Lt(it({},B),{layoutReads:V}):B)}Ke([ue,()=>s.nodes,j],([C,B,V])=>{const K=C??"";return B?.length||V===!0?(ae(),re=K,void(ge=!0)):ge?(re&&K.length>re.length&&K.startsWith(re)?(Y.value=!0,we&&(Ie(),Ae=window.setTimeout(()=>{var ee;Ae=null,j.value===!0||(ee=s.nodes)!=null&&ee.length||(fa(),Y.value=!1,Pi())},1200))):(K.length<re.length||!K.startsWith(re))&&ae(),void(re=K)):(re=K,void(ge=!0))},{flush:"sync",immediate:!0});const Ve=new Map,tt=new Map;let bt=!1,kt=0;function Tt(C){let B=0;for(const V of C.values())B+=V;return B}function Pt(){kt=Math.max(kt,Tt(tt)),tt.clear(),bt=!1}function mt(C,B){return(function(V){var K,ee;Ue.value&&(Ve.set(V,((K=Ve.get(V))!=null?K:0)+1),tt.set(V,((ee=tt.get(V))!=null?ee:0)+1),bt||(bt=!0,we&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(Pt):typeof queueMicrotask!="function"?setTimeout(Pt,0):queueMicrotask(Pt)))})(C),B()}const Yt=k.customId?`renderer-${k.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,Rn=(function(C){const B=new Map;return{scope:C,cache:B,clear:()=>B.clear()}})(Yt),Dn=F(()=>`${Yt}:${Q.value}`);En(s3,Rn);const Ft=cs(()=>k.customId),{effectiveCustomHtmlTagsSet:bn,mergedParseOptions:Vn,parsedNodes:st}=IV(k,{instanceMsgId:Yt,renderContent:ue,effectiveFinal:j,smoothStreamingEnabled:te,debugPerformanceEnabled:Ue,customComponentsMap:Ft,logPerf:Te});Ke(st,()=>{Rn.clear(),Q.value+=1},{immediate:!0});const In=F(()=>({customId:k.customId,customHtmlTags:Vn.value.customHtmlTags,parseOptions:k.parseOptions,customMarkdownIt:k.customMarkdownIt,htmlPolicy:rt.value,viewportPriority:k.viewportPriority,mode:c.value,codeRenderer:u.value,codeBlockStream:k.codeBlockStream,codeBlockDarkTheme:k.codeBlockDarkTheme,codeBlockLightTheme:k.codeBlockLightTheme,codeBlockMonacoOptions:k.codeBlockMonacoOptions,renderCodeBlocksAsPre:k.renderCodeBlocksAsPre,codeBlockMinWidth:k.codeBlockMinWidth,codeBlockMaxWidth:k.codeBlockMaxWidth,codeBlockProps:k.codeBlockProps,mermaidProps:k.mermaidProps,d2Props:k.d2Props,infographicProps:k.infographicProps,showTooltips:Fe.value,themes:k.themes,langs:k.langs,isDark:k.isDark,typewriter:k.typewriter,smoothStreamingOptions:k.smoothStreamingOptions,parseCoalesceMs:k.parseCoalesceMs,fade:k.fade}));En("markstreamNestedRendererProps",In);const _n=F(()=>st.value),Kn=F(()=>st.value.length),$n=Z(null),Ge=Z(null),Ye=Z(null),Ct=Z(null),$t=s.indexKey!=null&&String(s.indexKey).startsWith("list-item-"),mn=!$t&&k.customId?hS(k.customId):null,Nn=F(()=>mn?(pS.value,hS(k.customId)):null),tn=F(()=>{var C;return!!(we&&!ze.value&&k.customId&&!$t&&((C=Nn.value)!=null&&C.enabled))}),Ln=F(()=>{var C;return!!(!ze.value&&((C=s.virtualScroll)!=null&&C.enabled))}),Zn=Z(!1);hn(()=>{Zn.value=!0});const Mt=F(()=>!!(we&&Ln.value));En("markstreamHostScrollManaged",Mt);const us=F(()=>!!(Zn.value&&Mt.value)),Xt=F(()=>tn.value||Mt.value),oi=F(()=>tn.value||us.value),bs=F(()=>{var C;return Xt.value&&((C=Nn.value)==null?void 0:C.textEstimation)!==!1}),Do=F(()=>{var C;return Xt.value&&((C=Nn.value)==null?void 0:C.codeBlockEstimation)!==!1});function so(){const C=X.value||mt("getMeasuredContainerWidth.clientWidth",()=>{var B;return((B=S.value)==null?void 0:B.clientWidth)||0});return Number.isFinite(C)&&C>0?C:0}const qs=F(()=>{const C=so();return C>0?Math.max(1,Math.round(C)):640}),oo=F(()=>{var C;return Math.max(1,(C=k.maxLiveNodes)!=null?C:320)}),Nt=F(()=>{var C;return!ze.value&&k.nodeVirtual!==!1&&!(((C=k.maxLiveNodes)!=null?C:0)<=0)&&(k.nodeVirtual===!0?st.value.length>0:st.value.length>oo.value)}),Xe=F(()=>Nt.value||tn.value||Mt.value),ot=F(()=>k.viewportPriority!==!1&&!z.value),de=yj(C=>{var B;return G((B=C??S.value)!=null?B:null)},ot),{requestFrame:pe,cancelFrame:Oe,hasIdleCallback:Qt,isTestEnv:Wt}=(function(C){const B=C.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,V=C.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,K=C.isClient&&typeof window.requestIdleCallback=="function",ee=(function(){var he;if(typeof globalThis>"u"||!("process"in globalThis))return;const ke=(he=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:he.value;return ke?.env})();return{requestFrame:B,cancelFrame:V,hasIdleCallback:K,isTestEnv:ee?.NODE_ENV==="test"}})({isClient:we}),{resolvedBatchSize:ds,resolvedInitialBatch:Bn,batchingEnabled:bo,incrementalRenderingActive:ii,renderedCount:_s,previousRenderContext:ta,adaptiveBatchSize:ll,previousBatchConfig:al}=(function(C,B){var V;const K=F(()=>{var De;const $e=Math.trunc((De=C.renderBatchSize)!=null?De:80);return Number.isFinite($e)?Math.max(0,$e):0}),ee=F(()=>{var De;const $e=Math.trunc((De=C.initialRenderBatchSize)!=null?De:K.value);return Number.isFinite($e)?Math.max(0,$e):K.value}),he=F(()=>!B.renderAsFragment.value&&C.batchRendering!==!1&&K.value>0&&B.isClient&&!B.isTestEnv),ke=Z(0),Se=Z({key:C.indexKey,total:0}),Pe=Z(Math.max(1,K.value||1)),Ee=F(()=>{var De;return he.value&&((De=C.maxLiveNodes)!=null?De:0)<=0}),We=Z({batchSize:K.value,initial:ee.value,delay:(V=C.renderBatchDelay)!=null?V:16,enabled:Ee.value});return{resolvedBatchSize:K,resolvedInitialBatch:ee,batchingEnabled:he,incrementalRenderingActive:Ee,renderedCount:ke,previousRenderContext:Se,adaptiveBatchSize:Pe,previousBatchConfig:We}})(k,{isClient:we,isTestEnv:Wt,renderAsFragment:ze}),Os=new Map,ft=new Map,me=new WeakMap;let Ne=null;const xn=new WeakMap,ws=new Map,se=Z(0),Ce=F(()=>(se.value,Array.from(Os.entries()).sort((C,B)=>C[0]-B[0]))),xe=Z(null),Be=Z(null);let et=null,at=0,Ot=null;const{activeRestoreAnchor:Vt,getRelativeScrollTopWithinContainer:qt,setRelativeScrollTopWithinContainer:Bo,resolveAnchorOffset:Fo,clearRestoreReconcile:nn,scheduleRestoreReconcile:Jn,captureRestoreAnchor:Fn,restoreAnchor:Ss,getAnchorDrift:Ps}=(function(C){const{isClient:B,containerRef:V,parsedNodeCount:K,requestFrame:ee,cancelFrame:he,resolveScrollContainer:ke,getNormalizedScrollTop:Se,getOffsetTopWithinRoot:Pe,isReverseFlexScrollRoot:Ee,estimateIndexForOffset:We,estimateHeightRange:De,getFallbackNodeHeight:$e,clamp:He}=C,Qe=Z(null);let Ze=null,_t=[];function lt(){const xt=ke(),Bt=V.value;if(!xt||!Bt)return null;const Rt=xt.ownerDocument||Bt.ownerDocument||document;if(xt===Rt.documentElement||xt===Rt.body||xt===Rt.scrollingElement){const ln=Bt.getBoundingClientRect();return Math.max(0,-ln.top)}return Math.max(0,Se(xt,Rt,!1)-Pe(Bt,xt))}function ct(xt){var Bt;const Rt=ke(),ln=V.value;if(!Rt||!ln)return;const Co=Math.max(0,xt),js=Rt.ownerDocument||ln.ownerDocument||document,ri=js.defaultView||(typeof window<"u"?window:null);if(Rt===js.documentElement||Rt===js.body||Rt===js.scrollingElement){const hr=Se(Rt,js,!0)+ln.getBoundingClientRect().top;return void((Bt=ri?.scrollTo)==null||Bt.call(ri,0,Math.max(0,hr+Co)))}vS(Rt,js,Pe(ln,Rt)+Co,{isReverseFlexScrollRoot:hr=>{var mr;return(mr=Ee?.(hr))!=null&&mr},getNormalizedScrollTop:Se})}function St(xt){const Bt=K.value,Rt=He(xt.nodeIndex,0,Math.max(0,Bt-1));return De(0,Rt)+Math.max(0,xt.offsetWithinNodePx)}function wt(){if(Ze!=null&&(he?.(Ze),Ze=null),B)for(const xt of _t)window.clearTimeout(xt);_t=[]}function Zt(xt){const Bt=St(xt),Rt=lt();Rt!=null&&Math.abs(Rt-Bt)<=.5||ct(Bt)}return{activeRestoreAnchor:Qe,getRelativeScrollTopWithinContainer:lt,setRelativeScrollTopWithinContainer:ct,resolveAnchorOffset:St,clearRestoreReconcile:wt,applyRestoreAnchor:Zt,scheduleRestoreReconcile:function(){Qe.value&&B&&Ze==null&&(Ze=ee?ee(()=>{Ze=null,Qe.value&&Zt(Qe.value)}):null,Ze==null&&Qe.value&&Zt(Qe.value))},captureRestoreAnchor:function(){const xt=lt(),Bt=K.value;if(xt==null||Bt<=0)return null;const Rt=He(We(xt+1),0,Bt-1),ln=De(0,Rt),Co=$e(Rt);return{nodeIndex:Rt,offsetWithinNodePx:He(xt-ln,0,Math.max(0,Co-1))}},restoreAnchor:function(xt){const Bt=K.value;if(Qe.value={nodeIndex:He(xt.nodeIndex,0,Math.max(0,Bt-1)),offsetWithinNodePx:Math.max(0,xt.offsetWithinNodePx)},wt(),Zt(Qe.value),B)for(const Rt of[0,120,280,480])_t.push(window.setTimeout(()=>{Qe.value&&Zt(Qe.value)},Rt))},getAnchorDrift:function(xt){const Bt=lt();return Bt==null?null:Bt-St(xt)}}})({isClient:we,containerRef:S,parsedNodeCount:Kn,requestFrame:pe,cancelFrame:Oe,resolveScrollContainer:()=>xe.value||ne(),getNormalizedScrollTop:J,getOffsetTopWithinRoot:ce,isReverseFlexScrollRoot:H,estimateIndexForOffset:Em,estimateHeightRange:pr,getFallbackNodeHeight:Cd,clamp:As}),{nodeHeights:fs,heightStats:Cs,heightTreeSize:cl,heightSumTree:jh,heightKnownTree:Vh,averageNodeHeight:yi,resetHeightMeasurements:T4,pruneHeightMeasurements:M4,rebuildHeightTrees:md,recordNodeHeight:E4,removeNodeHeights:I4,exportHeightCache:$4,importHeightCache:N4,fenwickRangeSum:gd}=(function(C={}){const B=$s({}),V=$s({total:0,count:0}),K=Z(0),ee=Z([]),he=Z([]);function ke(){for(const $e of Object.keys(B))delete B[Number($e)];V.total=0,V.count=0,K.value=0,ee.value=[],he.value=[]}function Se($e,He,Qe){for(let Ze=He+1;Ze<$e.length;Ze+=Ze&-Ze)$e[Ze]+=Qe}function Pe($e,He){let Qe=0;for(let Ze=He+1;Ze>0;Ze-=Ze&-Ze)Qe+=$e[Ze];return Qe}function Ee($e){K.value=$e;const He=new Array($e+1).fill(0),Qe=new Array($e+1).fill(0);for(const[Ze,_t]of Object.entries(B)){const lt=Number(Ze),ct=Number(_t);!Number.isFinite(lt)||lt<0||lt>=$e||!Number.isFinite(ct)||ct<=0||(Se(He,lt,ct),Se(Qe,lt,1))}ee.value=He,he.value=Qe}function We($e){if(!Number.isInteger($e)||$e<0)return!1;const He=B[$e];if(!Number.isFinite(He)||He<=0)return!1;if(delete B[$e],V.total=Math.max(0,V.total-He),V.count=Math.max(0,V.count-1),K.value>$e){const Qe=ee.value,Ze=he.value;Qe.length&&Ze.length&&(Se(Qe,$e,-He),Se(Ze,$e,-1))}return!0}const De=F(()=>V.count>0?Math.max(12,V.total/V.count):32);return{nodeHeights:B,heightStats:V,heightTreeSize:K,heightSumTree:ee,heightKnownTree:he,averageNodeHeight:De,resetHeightMeasurements:ke,pruneHeightMeasurements:function($e){if($e<=0)return void ke();let He=0,Qe=0;for(const[Ze,_t]of Object.entries(B)){const lt=Number(Ze),ct=Number(_t);!Number.isFinite(lt)||lt<0||lt>=$e||!Number.isFinite(ct)||ct<=0?delete B[lt]:(He+=ct,Qe++)}V.total=He,V.count=Qe},rebuildHeightTrees:Ee,recordNodeHeight:function($e,He,Qe={}){(function(Ze,_t,lt={}){var ct;if(!Number.isFinite(_t)||_t<=0)return!1;const St=B[Ze];if(St&&(lt.allowShrink===!1&&_t<St||Math.abs(_t-St)<=1))return!1;if(B[Ze]=_t,St?V.total+=_t-St:(V.total+=_t,V.count++),K.value>Ze){const wt=ee.value,Zt=he.value;if(wt.length&&Zt.length)if(St){const xt=_t-St;xt!==0&&Se(wt,Ze,xt)}else Se(wt,Ze,_t),Se(Zt,Ze,1)}lt.notify!==!1&&((ct=C.onHeightRecorded)==null||ct.call(C))})($e,He,Lt(it({},Qe),{notify:!0}))},removeNodeHeight:function($e,He={}){var Qe;const Ze=We($e);return Ze&&He.notify!==!1&&((Qe=C.onHeightRecorded)==null||Qe.call(C)),Ze},removeNodeHeights:function($e,He={}){var Qe;let Ze=0;for(const _t of $e)We(Number(_t))&&Ze++;return Ze>0&&He.notify!==!1&&((Qe=C.onHeightRecorded)==null||Qe.call(C)),Ze},exportHeightCache:function(){return Object.entries(B).map(([$e,He])=>({index:Number($e),height:Number(He)})).filter($e=>Number.isFinite($e.index)&&$e.index>=0&&Number.isFinite($e.height)&&$e.height>0).sort(($e,He)=>$e.index-He.index)},importHeightCache:function($e,He={}){var Qe;if(!Array.isArray($e))return;const Ze=K.value;let _t=!1;if(He.mode!=="merge"){const lt=Object.keys(B);if(lt.length>0){for(const ct of lt)delete B[Number(ct)];_t=!0}}for(const lt of $e){const ct=Number(lt.index),St=Number(lt.height);if(!Number.isInteger(ct)||ct<0||Ze>0&&ct>=Ze||!Number.isFinite(St)||St<=0)continue;const wt=B[ct];wt&&Math.abs(wt-St)<=1||(B[ct]=St,_t=!0)}_t&&((function(){let lt=0,ct=0;const St=K.value;for(const[wt,Zt]of Object.entries(B)){const xt=Number(wt),Bt=Number(Zt);!Number.isFinite(xt)||xt<0||St>0&&xt>=St||!Number.isFinite(Bt)||Bt<=0?delete B[xt]:(lt+=Bt,ct++)}V.total=lt,V.count=ct})(),Ze>0&&Ee(Ze),(Qe=C.onHeightRecorded)==null||Qe.call(C))},fenwickRangeSum:function($e,He,Qe){if(Qe<=He)return 0;const Ze=Pe($e,Qe-1);return He<=0?Ze:Ze-Pe($e,He-1)}}})({onHeightRecorded:()=>{Wo(),Mt.value&&Dc(),Vt.value&&Jn(),Be.value&&ca(),An("node-resize")}});function vd(){T4(),ws.clear()}function By(C){!Number.isInteger(C)||C<0||C>=st.value.length||ws.set(C,Ac(C))}function Fy(C,B,V={}){const K=fs[C];E4(C,B,V);const ee=fs[C];ee&&ee>0?By(C):K&&ws.delete(C)}function Hy(C,B){const V=mt("getNodeLayoutHeight.slot.offsetHeight",()=>{var K,ee;return(ee=(K=Os.get(C))==null?void 0:K.offsetHeight)!=null?ee:0});return V>0?V:mt("getNodeLayoutHeight.content.offsetHeight",()=>B.offsetHeight)}function Wy(C,B={}){N4(C,B),bm()}const cr=F(()=>{var C;return!ze.value&&k.deferNodesUntilVisible!==!1&&!(((C=k.maxLiveNodes)!=null?C:0)<=0)&&!Nt.value&&!(st.value.length>900)&&ot.value}),zy=F(()=>!!de&&(cr.value||Nt.value)),Uy=F(()=>Nt.value||Mt.value),{liveNodeBufferResolved:wc,focusIndex:Ho,liveRange:xs,updateLiveRange:ul}=(function(C,B){const{parsedNodeCount:V,virtualizationEnabled:K,maxLiveNodesResolved:ee,clamp:he}=B,ke=F(()=>{var Ee;return Math.max(0,(Ee=C.liveNodeBuffer)!=null?Ee:60)}),Se=Z(0),Pe=$s({start:0,end:0});return{liveNodeBufferResolved:ke,focusIndex:Se,liveRange:Pe,updateLiveRange:function(){const Ee=V.value;if(!K.value||Ee===0)return Pe.start=0,void(Pe.end=Ee);const We=Math.min(ee.value,Ee),De=ke.value,$e=he(Se.value-De,0,Math.max(0,Ee-We));Pe.start=$e,Pe.end=Math.min(Ee,$e+We)}}})(k,{parsedNodeCount:Kn,virtualizationEnabled:Nt,maxLiveNodesResolved:oo,clamp:As}),ki=new Map,dl=new Map,ur=new Map,yd=[],Li=new Map,dr=new Set,qy=Z(0);let Kh=!1;const jy=F(()=>(qy.value,dr.size)),_o=new Map,bi=new Map,Vy=Z(0),Gh=F(()=>{Vy.value;let C=0;for(const B of _o.values())C+=Math.max(0,B);return C});let wo=null,Yh=!0,Ky=[0],Gy="";function Wo(){Yh=!0}const kd=F(()=>{if(!Nt.value)return st.value.length;const C=wc.value,B=Math.max(xs.end+C,Bn.value),V=Math.min(st.value.length,B);return Math.max(_s.value,V)});function bd(){Kh||(Kh=!0,queueMicrotask(()=>{Kh=!1,qy.value+=1}))}function Yy(C,B,V="node-resize"){if(!we||typeof window>"u")return null;const K=window.setTimeout(()=>{dr.delete(K)&&bd();try{B()}finally{An(V)}},Math.max(0,C));return dr.add(K),bd(),K}function _d(C){we&&C!=null&&(dr.delete(C)&&bd(),window.clearTimeout(C))}function Xy(){if(we&&typeof window<"u")for(const C of dr)window.clearTimeout(C);dr.size&&(dr.clear(),bd()),yd.length=0,ur.clear()}function L4(C){var B,V;return(V=(B=Ct.value)==null?void 0:B[C])!=null?V:null}const{cancelScheduledFocusSync:Xh,scheduleFocusSync:_i}=(function(C){const{isClient:B,containerRef:V,virtualizationEnabled:K,requestFrame:ee,cancelFrame:he,syncFocusToScroll:ke}=C;let Se=null;function Pe(){var We,De,$e;return($e=(De=(We=V.value)==null?void 0:We.ownerDocument)==null?void 0:De.defaultView)!=null?$e:typeof window<"u"?window:null}function Ee(){if(!Se)return;const We=Pe();Se.viaTimeout?We?We.clearTimeout(Se.id):clearTimeout(Se.id):he?.(Se.id),Se=null}return{cancelScheduledFocusSync:Ee,scheduleFocusSync:function(We={}){if(!K.value)return;if(!B)return void ke(!0);if(We.immediate)return Ee(),void ke(!0);if(Se)return;const De=()=>{Se=null,ke()};if(ee)return void(Se={id:ee(De),viaTimeout:!1});const $e=Pe();Se={id:$e?$e.setTimeout(De,16):setTimeout(De,16),viaTimeout:!0}}}})({isClient:we,containerRef:S,virtualizationEnabled:Nt,requestFrame:pe,cancelFrame:Oe,syncFocusToScroll:function(C=!1){var B;if(!Nt.value)return;const V=xe.value||ne();if(!V)return;const K=V.ownerDocument||((B=S.value)==null?void 0:B.ownerDocument)||document,ee=K?.defaultView||(typeof window<"u"?window:null),he=V===K?.documentElement||V===K?.body,ke=st.value.length;if(!he&&ke>0&&H(V)){const Qe=mt("syncFocusToScroll.clientHeight",()=>V.clientHeight||0),Ze=mt("syncFocusToScroll.scrollTop",()=>V.scrollTop),_t=Ze<0?-Ze:Ze,lt=(function(St){var wt,Zt;const xt=st.value;if(!xt.length)return 0;if(St<=0)return Math.max(0,xt.length-1);if(Xt.value){const Rt=(wt=tm()[xt.length])!=null?wt:0;return ok(Math.max(0,Rt-St))}if(cl.value===xt.length){const Rt=pr(0,xt.length);return Em(Math.max(0,Rt-St))}let Bt=St;for(let Rt=xt.length-1;Rt>=0;Rt--){const ln=(Zt=fs[Rt])!=null?Zt:yi.value;if(Bt<=ln)return Rt;Bt-=ln}return 0})(Math.max(0,_t)+.5*Math.max(0,Qe)),ct=As(lt,0,Math.max(0,ke-1));return void((C||Math.abs(ct-Ho.value)>1)&&(Ho.value=ct,ul()))}const Se=he?null:mt("syncFocusToScroll.root.getBoundingClientRect",()=>V.getBoundingClientRect()),Pe=he?0:Se.top,Ee=he?mt("syncFocusToScroll.viewport.clientHeight",()=>{var Qe,Ze;return(Ze=(Qe=ee?.innerHeight)!=null?Qe:V.clientHeight)!=null?Ze:0}):Se.bottom,We=Ce.value;let De=null,$e=null;for(const[Qe,Ze]of We){if(!Ze)continue;const _t=mt("syncFocusToScroll.slot.getBoundingClientRect",()=>Ze.getBoundingClientRect());_t.bottom<=Pe||_t.top>=Ee||(De==null&&(De=Qe),$e=Qe)}if(De==null||$e==null){const Qe=S.value;if(!Qe)return;const Ze=he?{top:0}:mt("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>V.getBoundingClientRect()),_t=mt("syncFocusToScroll.fallback.scrollTop",()=>J(V,K,he)),lt=he?(()=>{const wt=mt("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>Qe.getBoundingClientRect()),Zt=(he?0:Ze.top)-wt.top;return Math.max(0,Zt)})():(()=>{const wt=ce(Qe,V);return Math.max(0,_t-wt)})(),ct=he?mt("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var wt,Zt,xt,Bt;return(Bt=(xt=(Zt=ee?.innerHeight)!=null?Zt:(wt=K?.documentElement)==null?void 0:wt.clientHeight)!=null?xt:V.clientHeight)!=null?Bt:0}):mt("syncFocusToScroll.fallback.root.clientHeight",()=>V.clientHeight),St=Em(lt+.5*Math.max(0,ct));return Ho.value=As(St,0,Math.max(0,st.value.length-1)),void ul()}const He=Math.round((De+$e)/2);!C&&Math.abs(He-Ho.value)<=1||(Ho.value=As(He,0,Math.max(0,st.value.length-1)),ul())}}),{visibleNodeIndices:Qh,nodeVisibilityHandles:na,nodeVisibilityWatchStops:wd,nodeVisibilityFallbackTimers:Qy,clearVisibilityFallback:Sd,markNodeVisible:fr,cleanupNodeVisibility:O4,destroyNodeVisibilityState:Zh}=$V({isClient:we,shouldTrackVisibleNodeIndices:()=>cr.value,shouldCleanupNodeVisibility:()=>Nt.value,onNodeMarkedVisible:C=>{Nt.value?_i():Ho.value=As(C,0,Math.max(0,st.value.length-1))},onNodeVisibilityCleaned:C=>{Os.delete(C)&&Ak()}}),{cleanupScrollListener:Zy,setupScrollListener:P4}=(function(C){const{isClient:B,virtualizationEnabled:V,listenerEnabled:K,scrollRootElement:ee,resolveScrollContainer:he,scheduleFocusSync:ke,onScroll:Se}=C;let Pe=null,Ee=null;function We(){Pe&&(Pe(),Pe=null),Ee=null,ee.value=null}function De($e){const He=C.getScrollTop?C.getScrollTop($e):$e.scrollTop;return Math.max(0,Number.isFinite(He)?Math.abs(He):0)}return{cleanupScrollListener:We,setupScrollListener:function(){if(!B)return;if(!(($e=K?.value)!=null?$e:V.value))return void We();var $e;const He=he();if(!He)return void We();if(ee.value===He&&Pe)return;We(),Ee=De(He);const Qe=()=>{if(Se?.(),V.value){const Ze=(function(_t){const lt=De(_t),ct=Ee;Ee=lt;const St=Math.max(480,.75*(_t.clientHeight||0));return ct==null?lt>St?{immediate:!0}:void 0:Math.abs(lt-ct)>St?{immediate:!0}:void 0})(He);Ze?ke(Ze):ke()}};He.addEventListener("scroll",Qe,{passive:!0}),ee.value=He,Pe=()=>{He.removeEventListener("scroll",Qe)}}}})({isClient:we,virtualizationEnabled:Nt,listenerEnabled:Uy,scrollRootElement:xe,resolveScrollContainer:ne,scheduleFocusSync:_i,onScroll:function(){const C=Be.value;if(!C)return;const B=xc();if(!B||(function(K){if($c()>=at)return Ot=null,!1;const ee=Ot;if(ee==null)return!0;const he=Math.abs(K.scrollTop-ee)<=2;return he||(Ot=null),he})(B))return;const V=pk(B);V!=null?(V<-32||Math.abs(Math.max(0,V)-Math.max(0,C.distanceFromBottomPx))>32)&&aa("restore"):aa("restore")},getScrollTop:C=>{var B;const V=C.ownerDocument||((B=S.value)==null?void 0:B.ownerDocument)||document,K=C===V.documentElement||C===V.body||C===V.scrollingElement;return mt("scrollListener.getScrollTop",()=>J(C,V,K))}});function As(C,B,V){return Math.min(Math.max(C,B),V)}function Jh(C){return C?.firstElementChild}function Jy(C,B){var V;return C?(V=C.matches)!=null&&V.call(C,B)?C:C.querySelector(B):null}function ek(){if(!Xt.value)return void(X.value=0);const C=mt("updateExperimentContainerWidth.clientWidth",()=>{var B,V;return(V=(B=S.value)==null?void 0:B.clientWidth)!=null?V:0});X.value=C>0?C:0}let Sc=null;function em(){Sc?.disconnect(),Sc=null}const tk=ui({loader:()=>zn(null,null,function*(){return(yield Xs(()=>import("./index8-Q_XzGC1Z.js"),__vite__mapDeps([7,6]))).default}),loadingComponent:XM,delay:0,suspensible:!1});function nk(C){return C===tk}const sk=F(()=>u.value==="pre"?xo:u.value==="shiki"?tk:Dg),fl=F(()=>{const C=st.value;if(!C.length||!Xt.value)return C.map(()=>null);const B=X.value||mt("estimatedNodeHeights.clientWidth",()=>{var V;return((V=S.value)==null?void 0:V.clientWidth)||0});return!Number.isFinite(B)||B<=0?C.map(()=>null):C.map((V,K)=>{const ee=fs[K],he=typeof ee=="number"&&ee>0;if(bs.value&&!he){const Se=n3(V,B,fe.value);if(Se)return Se}if(Do.value&&V.type==="code_block"){const Se=(function(Pe){if(Pe.type!=="code_block")return null;const Ee=Fk(Pe,$d(Pe));return nk(Ee)?"markdown":Ee===xo?"pre":Ee===sk.value||Ee===Dg?"monaco":null})(V);if(Se==="monaco"||Se==="markdown"||Se==="pre")return gV(V,{rendererKind:Se,monacoOptions:k.codeBlockMonacoOptions,showHeader:((ke=k.codeBlockProps)==null?void 0:ke.showHeader)!==!1})}var ke;return null})});function Cd(C){var B;const V=fs[C];if(Number.isFinite(V)&&V>0)return V;const K=(B=fl.value[C])==null?void 0:B.height;return Number.isFinite(K)&&K>0?K:Math.max(yi.value,(function(ee){var he,ke,Se,Pe,Ee,We,De,$e,He,Qe,Ze,_t,lt;const ct=st.value[ee];if(!ct||typeof ct!="object")return 32;const St=String((he=ct.type)!=null?he:""),wt=so()||640;switch(St){case"heading":return 44;case"paragraph":return sa(String((Se=(ke=ct.raw)!=null?ke:ct.content)!=null?Se:""),wt,34);case"list":{const Zt=Array.isArray(ct.items)?ct.items.length:1;return Math.max(48,30*Zt+12)}case"list_item":return sa(String((Ee=(Pe=ct.raw)!=null?Pe:ct.content)!=null?Ee:""),wt,34);case"blockquote":return sa(String((De=(We=ct.raw)!=null?We:ct.content)!=null?De:""),wt,56);case"table":{const Zt=Array.isArray(ct.rows)?ct.rows.length:Array.isArray(ct.children)?ct.children.length:3;return Math.max(120,38*Zt+48)}case"code_block":return sa(String((He=($e=ct.code)!=null?$e:ct.raw)!=null?He:""),wt,96,20);case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return sa(String((Ze=(Qe=ct.raw)!=null?Qe:ct.content)!=null?Ze:""),wt,96);case"thematic_break":return 24;default:return sa(String((lt=(_t=ct.raw)!=null?_t:ct.content)!=null?lt:""),wt,40)}})(C))}function sa(C,B,V,K=22){const ee=String(C??"");if(!ee)return V;const he=Math.max(18,Math.floor(Math.max(320,B)/8)),ke=ee.split(/\r?\n/).length,Se=Math.ceil(ee.length/he),Pe=Math.max(1,ke,Se);return Math.max(V,Math.ceil(Pe*K+12))}function Cc(C){const B=Number(C);return!Number.isFinite(B)||B<=0?-1:Math.round(B/32)}function tm(){var C,B;const V=st.value.length,K=Cc(X.value||mt("getFallbackHeightPrefix.clientWidth",()=>{var Se;return((Se=S.value)==null?void 0:Se.clientWidth)||0})),ee=((C=s.virtualScroll)==null?void 0:C.measurementKey)==null?"":String(s.virtualScroll.measurementKey),he=[V,Cs.count,Math.round(Cs.total),Math.round(100*yi.value),ee,K,Xt.value?1:0,pS.value,Q.value].join(":");if(!Yh&&Gy===he)return Ky;const ke=new Array(V+1);ke[0]=0;for(let Se=0;Se<V;Se++)ke[Se+1]=ke[Se]+(Xt.value?Cd(Se):(B=fs[Se])!=null?B:yi.value);return Ky=ke,Gy=he,Yh=!1,ke}function ok(C){var B,V;const K=st.value.length;if(K<=0||C<=0)return 0;const ee=tm();if(C>=((B=ee[K])!=null?B:0))return K-1;let he=0,ke=K-1,Se=K-1;for(;he<=ke;){const Pe=he+ke>>1;((V=ee[Pe+1])!=null?V:0)>=C?(Se=Pe,ke=Pe-1):he=Pe+1}return Se}function pr(C,B){var V,K;if(C>=B)return 0;if(Xt.value)return(function(ke,Se){var Pe,Ee;const We=st.value.length,De=As(Math.trunc(ke),0,We),$e=As(Math.trunc(Se),De,We);if(De>=$e)return 0;const He=tm();return((Pe=He[$e])!=null?Pe:0)-((Ee=He[De])!=null?Ee:0)})(C,B);if(cl.value!==st.value.length){let ke=0;for(let Se=C;Se<B;Se++)ke+=(V=fs[Se])!=null?V:yi.value;return ke}const ee=jh.value,he=Vh.value;if(!ee.length||!he.length){let ke=0;for(let Se=C;Se<B;Se++)ke+=(K=fs[Se])!=null?K:yi.value;return ke}return gd(ee,C,B)+(B-C-gd(he,C,B))*yi.value}Ke(()=>st.value.length,C=>{Wo(),C<=0?vd():(C<cl.value&&M4(C),C!==cl.value&&md(C))},{immediate:!0});const R4=F(()=>{if(!Nt.value)return st.value.map((K,ee)=>({node:K,index:ee}));const C=st.value.length,B=As(xs.start,0,C),V=As(xs.end,B,C);return st.value.slice(B,V).map((K,ee)=>({node:K,index:B+ee}))}),nm=F(()=>Nt.value?pr(0,Math.min(xs.start,st.value.length)):0),sm=F(()=>{if(!Nt.value)return 0;const C=st.value.length;return pr(Math.min(xs.end,C),C)});function ik(){if(!Xt.value)return 0;let C=0;const B=fl.value;for(let V=0;V<B.length;V++){if(!B[V])continue;const K=fs[V];Number.isFinite(K)&&K>0||C++}return C}function rk(){const C=st.value.length;return{totalNodes:C,measuredCount:Cs.count,estimatedCount:ik(),averageNodeHeight:yi.value,topSpacerHeight:nm.value,bottomSpacerHeight:sm.value,estimatedTotalHeight:pr(0,C),width:pl()}}function D4(){const C=st.value,B=rk();return Lt(it({},B),{probe:{paragraphReady:!!fe.value.paragraph,listItemReady:!!fe.value.listItem,listWrapperOverhead:fe.value.listWrapperOverhead,headingReadyLevels:Object.entries(fe.value.headings).filter(([,V])=>!!V).map(([V])=>Number(V))},nodes:C.map((V,K)=>{var ee,he,ke,Se,Pe,Ee,We,De,$e;return{index:K,type:V.type,estimateKind:(he=(ee=fl.value[K])==null?void 0:ee.kind)!=null?he:null,rendererKind:(Se=(ke=fl.value[K])==null?void 0:ke.rendererKind)!=null?Se:null,estimatedHeight:(Ee=(Pe=fl.value[K])==null?void 0:Pe.height)!=null?Ee:null,estimatedContentHeight:(De=(We=fl.value[K])==null?void 0:We.contentHeight)!=null?De:null,measuredHeight:($e=fs[K])!=null?$e:null}})})}function om(){return s.indexKey!=null?String(s.indexKey):Ln.value?`virtual-${On()}`:"markdown-renderer"}function lk(C){const B=String(C),V=`${om()}-`;if(!B.startsWith(V))return null;const K=B.slice(V.length).match(/^(\d+)(?:$|-)/);if(!K)return null;const ee=Number(K[1]);return!Number.isInteger(ee)||ee<0||ee>=st.value.length?null:ee}function On(){var C,B,V;const K=(C=s.virtualScroll)==null?void 0:C.sessionKey;return String(K!=null&&K!==""?K:(V=(B=s.indexKey)!=null?B:k.customId)!=null?V:Yt)}function ps(){var C;const B=(C=s.virtualScroll)==null?void 0:C.threadKey;return B==null||B===""?void 0:String(B)}function im(C){var B;return(C??"")===((B=ps())!=null?B:"")}function B4(){var C;const B=(C=s.virtualScroll)==null?void 0:C.measurementKey;return B==null?"":String(B)}function F4(){var C,B;const V=u.value,K=V==="monaco"?k.codeBlockMonacoOptions:void 0,ee=k.codeBlockProps,he=V==="shiki";return[k.isDark?"dark":"light",V==="monaco"?"code-rich":V==="pre"?"code-pre":"code-shiki",k.codeBlockStream===!1?"code-static":"code-stream",vs(k.codeBlockMinWidth),vs(k.codeBlockMaxWidth),...he?[Np((C=ee?.themes)!=null?C:k.themes,(B=ee?.langs)!=null?B:k.langs)]:[],vs(K?.fontSize),vs(K?.lineHeight),vs(K?.fontFamily),vs(K?.tabSize),vs(K?.MAX_HEIGHT),vs(K?.wordWrap),vs(K?.wrappingIndent),vs(K?.padding),vs(ee?.showHeader),vs(ee?.showCopyButton),vs(ee?.showExpandButton),vs(ee?.showPreviewButton),vs(ee?.showCollapseButton),vs(ee?.showFontSizeButtons)].join("\0")}function Oi(){return[B4(),F4()].join("\0")}function pl(){return so()}const xd=F(()=>Cc(pl())),So=F(()=>[Oi(),xd.value].join("\0")),H4=F(()=>{var C;return Ln.value?["virtual",(C=ps())!=null?C:"",On(),So.value].join("\0"):s.indexKey});function oa(){Vy.value+=1}function rm(C){return!(!C||!Number.isInteger(C.index)||C.index<0||C.index>=st.value.length||C.sessionKey!==On()||C.threadKey!==ps()||C.layoutEpochKey!==So.value)}function ak(C){const B=String(C),V=bi.get(B);return V?rm(V)?V.index:null:lk(B)}function ck(C="async-node"){(_o.size||bi.size)&&(_o.clear(),bi.clear(),oa(),An(C))}const ia=Ut(u1,null),lm={reportHeight(C,B){if(!Mt.value)return;const V=ak(C);if(V==null)return;const K=ki.get(V);if(!K)return;const ee=Number(B),he=Hy(V,K);Fy(V,Number.isFinite(ee)&&ee>0?Math.max(ee,he||0):he)},markPending(C){if(!Mt.value)return;const B=lk(C);B!=null&&(function(V,K){var ee;const he=bi.get(V);if(he&&rm(he))return _o.set(V,Math.max(0,(ee=_o.get(V))!=null?ee:0)+1),oa(),void An("async-node");_o.set(V,1),bi.set(V,(function(ke){return{index:ke,sessionKey:On(),threadKey:ps(),layoutEpochKey:So.value}})(K)),oa(),An("async-node")})(String(C),B)},markSettled(C){if(!Mt.value)return;const B=String(C),V=ak(C);(V!=null||(function(K){return _o.has(String(K))})(B))&&(function(K){var ee;const he=(ee=_o.get(K))!=null?ee:0;return!(he<=0||(he<=1?(_o.delete(K),bi.delete(K)):_o.set(K,he-1),oa(),he===1&&An("async-node"),0))})(B)&&V!=null&&Pi()}};function W4(){let C=0;for(const B of ki.values())C+=mt("getVisibleDomHeight.offsetHeight",()=>{var V;return(V=B?.offsetHeight)!=null?V:0});return Math.ceil(Math.max(0,C))}En(u1,{reportHeight(C,B){lm.reportHeight(C,B),ia?.reportHeight(C,B)},markPending(C){lm.markPending(C),ia?.markPending(C)},markSettled(C){lm.markSettled(C),ia?.markSettled(C)}});let am,cm=null,ra=null;function Ad(C){return C!==!1&&C!=null&&C!==""}function uk(){return Nt.value?(function(){if(!Nt.value)return!0;const C=st.value.length,B=As(xs.start,0,C),V=As(xs.end,B,C);if(B>=V)return!0;for(let K=B;K<V;K++)if(!Os.has(K)||Im(K)&&!ki.has(K))return!1;return!0})():_s.value>=kd.value}function um(){return j.value===!0&&!Y.value&&Gh.value===0&&dr.size===0&&Li.size===0&&wo==null&&uk()}function dk(){var C,B;if(((C=s.virtualScroll)==null?void 0:C.settleMode)!=="manual"||cm===On()&&am===ps())return!0;const V=(B=s.virtualScroll)==null?void 0:B.settledToken;return!!Ad(V)&&ra===Bc(V)}function dm(){return um()&&dk()}function z4(C,B){return B.totalNodes<=0?C==="final"?"final":"estimate":B.measuredCount>=B.totalNodes?C==="final"?"final":"measured":B.measuredCount>0||B.estimatedCount>0?"mixed":"estimate"}function hl(C="manual",B){const V=rk(),K=(function(ee){return ee||(j.value!==!0?st.value.length>0?"streaming":"estimating":!uk()||Li.size>0||wo!=null?"measuring":dm()?"settled":"settling")})(B);return{sessionKey:On(),threadKey:ps(),phase:K,nodeCount:V.totalNodes,liveRange:{start:xs.start,end:xs.end},renderedCount:_s.value,measuredCount:V.measuredCount,estimatedCount:V.estimatedCount,averageNodeHeight:V.averageNodeHeight,topSpacerHeight:V.topSpacerHeight,bottomSpacerHeight:V.bottomSpacerHeight,visibleDomHeight:W4(),totalHeight:fk(),width:V.width,final:j.value===!0,stable:dm(),confidence:z4(K,V),reason:C}}function xc(){const C=xe.value||ne(),B=S.value;if(!C||!B)return null;const V=C.ownerDocument||B.ownerDocument||document,K=C===V.documentElement||C===V.body||C===V.scrollingElement,ee=mt("getScrollBox.scrollTop",()=>J(C,V,K)),he=mt("getScrollBox.scrollHeight",()=>{var Se,Pe,Ee,We,De;return K?Math.max((Pe=(Se=V.documentElement)==null?void 0:Se.scrollHeight)!=null?Pe:0,(We=(Ee=V.body)==null?void 0:Ee.scrollHeight)!=null?We:0,(De=C.scrollHeight)!=null?De:0):C.scrollHeight}),ke=mt("getScrollBox.clientHeight",()=>{var Se;return K?((Se=V.documentElement)==null?void 0:Se.clientHeight)||C.clientHeight||0:C.clientHeight});return{root:C,doc:V,isViewportRoot:K,scrollTop:ee,scrollHeight:he,clientHeight:ke}}function fk(){const C=st.value.length,B=Math.max(0,pr(0,C)),V=mt("getRendererLogicalHeight.offsetHeight",()=>{var ee,he;return(he=(ee=S.value)==null?void 0:ee.offsetHeight)!=null?he:0}),K=Math.max(0,V>0?V:mt("getRendererLogicalHeight.scrollHeight",()=>{var ee,he;return(he=(ee=S.value)==null?void 0:ee.scrollHeight)!=null?he:0}));return C<=0?Math.ceil(V):Nt.value?B>0?Math.max(1,Math.ceil(B),(function(){let ee=nm.value+sm.value;for(const he of Os.values())he&&(ee+=Math.max(0,mt("getVirtualizedDomLogicalHeight.offsetHeight",()=>he.offsetHeight||0)));return Math.ceil(Math.max(0,ee))})(),(function(ee,he){return ee<=0||he<=0?0:he<=ee+Math.max(512,.05*ee)?Math.ceil(he):0})(B,K)):Math.max(1,Math.ceil(K)):Mt.value?B>0||Cs.count>0||ik()>0?(ii.value&&_s.value,Math.max(1,Math.ceil(K),Math.ceil(B))):Math.ceil(K):Math.max(1,Math.ceil(K),Math.ceil(B))}function pk(C){const B=S.value;if(!B)return null;const V=mt("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>B.getBoundingClientRect());return(function(ee){return ee.isViewportRoot?ee.clientHeight:mt("getViewportBottomInRoot.getBoundingClientRect",()=>ee.root.getBoundingClientRect().bottom)})(C)-V.bottom}function U4(C={}){const B=C.requireViewport!==!1,V=(function(he=64){const ke=xc(),Se=S.value;if(!ke||!Se)return!1;const Pe=(function(We){if(We.isViewportRoot)return{top:0,bottom:We.clientHeight};const De=mt("getVirtualViewportRect.getBoundingClientRect",()=>We.root.getBoundingClientRect());return{top:De.top,bottom:De.bottom}})(ke),Ee=mt("isRendererNearVirtualViewport.getBoundingClientRect",()=>Se.getBoundingClientRect());return Ee.bottom>=Pe.top-he&&Ee.top<=Pe.bottom+he})();if(B&&!V)return null;const K=(function(){const he=xc(),ke=S.value;if(!he||!ke||Math.max(0,he.scrollHeight-he.scrollTop-he.clientHeight)>64)return null;const Se=pk(he);return Se==null?null:Se>=-8&&Se<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,Se)}:null})();if(K)return{anchor:K,captured:!0};const ee=Fn();if(ee)return{anchor:{type:"node",nodeIndex:ee.nodeIndex,offsetWithinNodePx:ee.offsetWithinNodePx},captured:V};if(C.allowFallback===!0){const he=(function(){const ke=st.value.length;return ke<=0?null:{type:"node",nodeIndex:As(Ho.value,0,Math.max(0,ke-1)),offsetWithinNodePx:0}})();return he?{anchor:he,captured:!1}:null}return null}function fm(C){let B=2166136261;for(let V=0;V<C.length;V++)B^=C.charCodeAt(V),B=Math.imul(B,16777619);return(B>>>0).toString(36)}function q4(C,B){let V=C;for(let K=0;K<B.length;K++)V^=B.charCodeAt(K),V=Math.imul(V,16777619);return V^=31,V=Math.imul(V,16777619),V}const j4=new Set(["children","items","header","rows","cells","attrs","data","term","definition"]);function Td(C,B=new WeakSet,V=0){if(C==null||typeof C=="number"||typeof C=="boolean")return String(C);if(typeof C=="string")return`s:${(function(K){const ee=K.length>8192?`${K.slice(0,8192)}...${K.length}`:K;return`${K.length}:${fm(ee)}`})(C)}`;if(typeof C=="function")return"fn";if(typeof C!="object")return typeof C;if(B.has(C))return"cycle";if(V>=6)return"max-depth";B.add(C);try{if(Array.isArray(C)){if(C.length<=160){const Ee=[];for(let We=0;We<C.length;We++)Ee.push(Td(C[We],B,V+1));return`a:${C.length}:${Ee.join(",")}`}const he=[],ke=[],Se=Math.max(0,C.length-32);let Pe=2166136261;for(let Ee=0;Ee<C.length;Ee++){const We=Td(C[Ee],B,V+1);Pe=q4(Pe,We),Ee<32&&he.push(We),Ee>=Se&&ke.push(We)}return[`a:${C.length}`,`h=${he.join(",")}`,`t=${ke.join(",")}`,`all=${(Pe>>>0).toString(36)}`].join(":")}const K=C,ee=Object.keys(K).filter(he=>{const ke=K[he];return he!=="parent"&&he!=="el"&&he!=="component"&&(ke==null||typeof ke=="string"||typeof ke=="number"||typeof ke=="boolean"||j4.has(he))}).sort();return`o:${ee.length}:${ee.map(he=>`${he}=${Td(K[he],B,V+1)}`).join(";")}`}finally{B.delete(C)}}let hk=-1,pm="";function Ac(C){const B=st.value[C];return B?fm(Td(B)):""}function hm(){const C=Q.value;if(hk===C)return pm;let B=2166136261;for(let V=0;V<st.value.length;V++){const K=Ac(V);for(let ee=0;ee<K.length;ee++)B^=K.charCodeAt(ee),B=Math.imul(B,16777619)}return pm=(B>>>0).toString(36),hk=C,pm}function la(C,B={}){var V;const K=B.includeHeightCache===!0,ee=(V=B.includeContentHash)!=null?V:K,he=K?(function(Se){const Pe=(function(){var Ze,_t;const lt=Number((_t=(Ze=s.virtualScroll)==null?void 0:Ze.heightCacheLimit)!=null?_t:5e3);return!Number.isFinite(lt)||lt<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(lt))})();if(!Number.isFinite(Pe)||Se.length<=Pe)return Se;const Ee=new Map,We=Ze=>{!Ze||Ee.size>=Pe||Ee.set(Ze.index,Ze)},De=st.value.length,$e=As(xs.start-2*wc.value,0,De),He=As(xs.end+2*wc.value,$e,De);for(const Ze of Se)Ze.index>=$e&&Ze.index<He&&We(Ze);const Qe=Math.max(1,Math.ceil(Se.length/Pe));for(let Ze=0;Ze<Se.length&&Ee.size<Pe;Ze+=Qe)We(Se[Ze]);for(let Ze=Se.length-1;Ze>=0&&Ee.size<Pe;Ze-=Qe)We(Se[Ze]);return Array.from(Ee.values()).sort((Ze,_t)=>Ze.index-_t.index).slice(0,Pe)})($4().map(Se=>{var Pe;const Ee=st.value[Se.index];return Ee?Lt(it({},Se),{nodeType:String((Pe=Ee.type)!=null?Pe:""),signature:Ac(Se.index)}):null}).filter(Se=>!!Se)):[],ke=U4({allowFallback:B.allowAnchorFallback===!0,requireViewport:B.requireViewport});return ke||he.length||B.includeEmptyState===!0?Lt(it({sessionKey:C.sessionKey,threadKey:C.threadKey},ke?{anchor:ke.anchor,anchorCaptured:ke.captured}:{anchorCaptured:!1}),{metrics:C,width:C.width,contentHash:ee?hm():void 0,measurementKey:Oi()||void 0,heightCache:he.length?he:void 0}):null}function mm(C){var B,V;const K=xc();if(!K)return;const ee=(function(Se){const Pe=S.value;if(!Pe)return null;const Ee=ce(Pe,Se.root),We=st.value.length,De=mt("getRendererBottomOffsetWithinRoot.offsetHeight",()=>Pe.offsetHeight||0),$e=Math.max(0,De>0?De:We>0?mt("getRendererBottomOffsetWithinRoot.scrollHeight",()=>Pe.scrollHeight||0):0),He=fk();return Ee+Math.max($e,He)})(K);if(ee==null)return;const he=Math.max(0,C.distanceFromBottomPx),ke=Math.max(0,ee-K.clientHeight-he);(function(Se){at=$c()+120,Ot=Se})(ke),K.isViewportRoot?(V=(B=K.doc.defaultView)==null?void 0:B.scrollTo)==null||V.call(B,0,ke):vS(K.root,K.doc,ke,{isReverseFlexScrollRoot:H,getNormalizedScrollTop:J})}const gm=[];function mk(){if(we)for(et!=null&&(Oe?.(et),et=null);gm.length;){const C=gm.pop();C!=null&&window.clearTimeout(C)}}function aa(C){const B=!!Be.value;Be.value=null,at=0,Ot=null,mk(),B&&C&&An(C)}function ca(){if(!Be.value||!we||et!=null)return;const C=()=>{et=null;const B=Be.value;B&&mm(B)};et=pe?pe(C):null,et==null&&C()}function gk(C,B={}){const V=st.value.length;return V<=0?[]:C.filter(K=>!(!Number.isInteger(K.index)||K.index<0||K.index>=V)&&!(!Number.isFinite(K.height)||K.height<=0)&&!(B.requireSignature&&!K.signature)&&!(B.requireCompatibilityMetadata&&!K.nodeType&&!K.signature)&&(function(ee){var he;const ke=st.value[ee.index];return!(!ke||ee.nodeType&&ee.nodeType!==String((he=ke.type)!=null?he:"")||ee.signature&&ee.signature!==Ac(ee.index))})(K))}function vk(C){const B=Cc(pl()),V=Cc(C);return B!==-1&&V!==-1&&B===V}function vm(C){var B;const V=Number(C?.width);if(Number.isFinite(V)&&V>0)return V;const K=Number((B=C?.metrics)==null?void 0:B.width);return Number.isFinite(K)&&K>0?K:null}function yk(C){var B;return C.sessionKey===On()&&!!im(C.threadKey)&&((B=C.measurementKey)!=null?B:"")===Oi()&&!!vk(vm(C))&&!!(function(V){const K=V.heightCache;return!!K?.length&&(kk(V)?K.some(ee=>!!(ee.nodeType||ee.signature)):K.some(ee=>!!ee.signature))})(C)}function kk(C){return!!(C.contentHash&&C.contentHash===hm())}function V4(C){return!kk(C)}let ml=null,gl=null,Md=null,Tc=null,Mc=null;function ym(C){var B;const V=C.map(ee=>{var he,ke;return[ee.index,Math.round(10*ee.height),(he=ee.nodeType)!=null?he:"",(ke=ee.signature)!=null?ke:""].join("")}).join(""),K=Cc(pl());return[(B=ps())!=null?B:"",On(),Oi(),st.value.length,K,C.length,fm(V)].join(":")}function bk(C=(B=>(B=s.virtualScroll)==null?void 0:B.heightCache)()){if(!Mt.value||!C?.length||st.value.length<=0||!vk((B=s.virtualScroll)==null?void 0:B.heightCacheWidth))return!1;var B;const V=gk(C,{requireSignature:!0});if(!V.length)return!1;const K=ym(V);return K===ml?(gl="standalone",!0):(Wy(V,{mode:"merge"}),Wo(),ml=K,gl="standalone",Lc(),An("restore"),!0)}function km(C,B={}){var V,K,ee;if(!Mt.value||!C||C.sessionKey!==On()||!im(C.threadKey)||st.value.length<=0)return!1;const he=!!((V=C.heightCache)!=null&&V.length)&&!Ed(),ke=!C.anchor||C.anchorCaptured===!1&&B.allowUncapturedAnchor!==!0?null:C.anchor,Se=B.restoreAnchor===!0&&!!ke&&!Ed()&&Number(vm(C))>0;let Pe=!1;if((K=C.heightCache)!=null&&K.length&&yk(C)){const We=gk(C.heightCache,{requireCompatibilityMetadata:!C.contentHash,requireSignature:V4(C)});We.length&&(Wy(We,{mode:"merge"}),Wo(),ml=ym(We),gl="restore",Lc(),Pe=!0)}if(he||Se)return!1;if(!B.restoreAnchor||!ke)return Pe&&An("restore"),!0;const Ee=(function(We,De){var $e;const He=We.anchor,Qe=He?He.type==="bottom"?`bottom:${Math.round(He.distanceFromBottomPx)}`:`node:${He.nodeIndex}:${Math.round(He.offsetWithinNodePx)}`:"none";return[($e=ps())!=null?$e:"",On(),Oi(),xd.value,De,Qe].join(":")})(C,(ee=B.restoreToken)!=null?ee:"imperative");return Md===Ee?(Pe&&An("restore"),!0):(Md=Ee,(function(We){const De=()=>{if(We.type==="node")return aa(),void Ss({nodeIndex:We.nodeIndex,offsetWithinNodePx:We.offsetWithinNodePx});if(nn(),Vt.value=null,Be.value=We,mk(),mm(We),we)for(const $e of[0,120,280,480])gm.push(window.setTimeout(()=>{const He=Be.value;He&&mm(He)},$e))};(function($e){if(!Nt.value)return!1;const He=st.value.length;return!(He<=0||(Ho.value=$e.type==="node"?As($e.nodeIndex,0,He-1):He-1,ul(),0))})(We)?ht(De):De()})(ke),An("restore"),!0)}function Ed(){const C=pl();return Number.isFinite(C)&&C>0}function _k(C){var B;return C.sessionKey===On()&&!!im(C.threadKey)&&(st.value.length<=0||!(!((B=C.heightCache)!=null&&B.length)||Ed())||!(!(C.anchor&&Number(vm(C))>0)||Ed()))}function bm(){ws.clear();for(const C of Object.keys(fs)){const B=Number(C);Number.isInteger(B)&&B>=0&&B<st.value.length&&By(B)}}function Ec(){wo!=null&&(Oe?.(wo),wo=null),$m()}function wk(){return!we||Wt?Promise.resolve():new Promise(C=>{let B=!1,V=null;const K=()=>{B||(B=!0,V!=null&&window.clearTimeout(V),C())};if(pe)return pe(K),void(V=window.setTimeout(K,50));V=window.setTimeout(K,0)})}function _m(C,B=ps(),V=So.value){return On()===C&&ps()===B&&So.value===V}function wm(){return zn(this,arguments,function*(C={}){var B,V,K,ee,he;const ke=On(),Se=ps(),Pe=So.value,Ee=(B=C.frames)!=null?B:2,We=(V=C.timeoutMs)!=null?V:120,De=(K=C.reason)!=null?K:"manual",$e=C.expectedSettledTokenKey,He=C.flushPendingTimers===!0,Qe=hl(De),Ze=()=>Lt(it({},Qe),{phase:Qe.final?"settling":Qe.phase,stable:!1,confidence:Qe.confidence==="final"?"mixed":Qe.confidence,reason:De}),_t=()=>_m(ke,Se,Pe)&&($e==null||Nc()===$e);for(let wt=0;wt<Ee;wt++){if(yield ht(),!_t()||(yield wk(),!_t()))return Ze();Pi(),Ec()}if(yield(function(wt){return!we||wt<=0?Promise.resolve():new Promise(Zt=>window.setTimeout(Zt,wt))})(We),!_t()||(He&&Xy(),Pi(),Ec(),!_t()))return Ze();const lt=um();lt&&(cm=ke,am=Se,((ee=s.virtualScroll)==null?void 0:ee.settleMode)==="manual"&&$e!=null&&Ad((he=s.virtualScroll)==null?void 0:he.settledToken)&&Nc()===$e&&(ra=Bc(s.virtualScroll.settledToken)));const ct=_t()&<&&dk(),St=hl(De,ct?"final":void 0);return Tm(St,!0),St})}let Sm="content",vl=null,yl=null,Cm=0,Ic=null,ua=null,xm=null,Am=null;function $c(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function Sk(C){var B,V;const K=Ic;if(!K)return!0;const ee=(V=(B=s.virtualScroll)==null?void 0:B.heightDiffThresholdPx)!=null?V:1;return Math.abs(C.totalHeight-K.totalHeight)>ee||C.sessionKey!==K.sessionKey||C.phase!==K.phase||C.stable!==K.stable||C.final!==K.final||C.threadKey!==K.threadKey||C.nodeCount!==K.nodeCount||C.measuredCount!==K.measuredCount||C.width!==K.width}function vs(C){if(C==null)return"";if(typeof C=="string"||typeof C=="number"||typeof C=="boolean")return String(C);try{return JSON.stringify(C)}catch{return String(C)}}function Nc(C=(B=>(B=s.virtualScroll)==null?void 0:B.settledToken)()){return vs(C)}function Ck(C,B){var V,K;return[C,B.sessionKey,(V=B.threadKey)!=null?V:"",Oi(),hm(),vs((K=s.virtualScroll)==null?void 0:K.settledToken),Math.round(B.totalHeight),Math.round(B.width)].join("\0")}function Lc(){xm=null,Am=null,ua=null}function K4(C){const B=C.heightCache;return B?.length?ym(B):""}function Oc(C){var B,V,K;const ee=C.metrics,he=C.anchor?(ke=C.anchor).type==="bottom"?`bottom:${Math.round(ke.distanceFromBottomPx)}`:`node:${ke.nodeIndex}:${Math.round(ke.offsetWithinNodePx)}`:"none";var ke;return[C.sessionKey,(B=C.threadKey)!=null?B:"",(V=C.measurementKey)!=null?V:Oi(),(K=C.contentHash)!=null?K:"",K4(C),he,C.anchorCaptured?1:0,ee.liveRange.start,ee.liveRange.end,ee.renderedCount,ee.nodeCount,Math.round(ee.totalHeight),Math.round(ee.width),ee.phase,ee.stable?1:0].join("\0")}function Tm(C,B=!1){if(!Mt.value||(function(ke=!1){return!ke&&Ln.value&&!us.value})(B))return;const V=B||Sk(C),K=(function(ke,Se=!1){return Se||ke.stable||ke.phase==="final"?{state:la(ke,{includeHeightCache:!0})}:{state:la(ke)}})(C,B),ee=K.state,he=!!(ee&&(V||(function(ke,Se=!1){return!!Se||Oc(ke)!==ua})(ee,B)));if(V&&(E(C),Ic=C,Cm=$c()),ee&&he&&(M(ee),ee.anchor&&L(ee.anchor),ua=Oc(ee)),C.stable){const ke=Ck("settled",C);if(ke!==xm){xm=ke;const Se=la(C,{includeHeightCache:!0});Se&&(M(Se),ua=Oc(Se)),(function(Pe){o("render-settled",Pe)})(C)}}if(C.phase==="final"){const ke=Ck("final",C);if(ke!==Am){Am=ke;const Se=la(C,{includeHeightCache:!0});Se&&(M(Se),ua=Oc(Se)),(function(Pe){o("render-final",Pe)})(C)}}}function Mm(){vl!=null&&(Oe?.(vl),vl=null),yl!=null&&we&&(window.clearTimeout(yl),yl=null)}function xk(){vl=null,yl=null,(function(C){if(Li.size>0||wo!=null)return!0;switch(C){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(Sm)&&(Pi(),Ec()),Tm(hl(Sm))}function An(C){var B,V;if(!Mt.value||(Sm=C,vl!=null||yl!=null))return;const K=Math.max(0,(V=(B=s.virtualScroll)==null?void 0:B.emitIntervalMs)!=null?V:32),ee=Math.max(0,K-($c()-Cm)),he=()=>{yl=null,vl=pe?pe(xk):null,vl==null&&xk()};we&&ee>0?yl=window.setTimeout(he,ee):he()}function Em(C){var B;if(C<=0)return 0;const V=st.value;if(Xt.value)return ok(C);if(cl.value===V.length&&jh.value.length&&Vh.value.length){const ee=yi.value,he=jh.value,ke=Vh.value,Se=De=>De<=0?0:gd(he,0,De)+(De-gd(ke,0,De))*ee;let Pe=0,Ee=V.length-1,We=V.length-1;for(;Pe<=Ee;){const De=Pe+Ee>>1;Se(De+1)>=C?(We=De,Ee=De-1):Pe=De+1}return We}let K=C;for(let ee=0;ee<V.length;ee++){const he=(B=fs[ee])!=null?B:yi.value;if(K<=he)return ee;K-=he}return Math.max(0,V.length-1)}function Ak(){se.value+=1}function Im(C){return!(ii.value&&C>=_s.value)&&(!cr.value||C<Bn.value||Qh.value.has(C))}function da(C){const B=wd.get(C);B&&(B(),wd.delete(C));const V=na.get(C);V&&(V.destroy(),na.delete(C)),Sd(C)}function Tk(C,B){let V=!1;if(B){const he=Os.get(C);Os.set(C,B),he!==B&&(V=!0)}else Os.delete(C)&&(V=!0);if(V&&Ak(),B||Sd(C),!zy.value||!de||!Nt.value&&cr.value&&!z.value&&na.size>=640&&(z.value||(z.value=!0,Zh()),!zy.value||!de))return da(C),void(B&&fr(C,!0));if(C<Bn.value&&!Nt.value||Qh.value.has(C))return da(C),void fr(C,!0);if(!B)return void da(C);da(C);const K=de(B,{rootMargin:"400px"});if(!K)return;na.set(C,K),fr(C,K.isVisible.value),cr.value&&(function(he){if(!we||!cr.value)return;Sd(he);const ke=he%17*23,Se=window.setTimeout(()=>{if(Qy.delete(he),!cr.value||Qh.value.has(he))return;const Pe=Os.get(he);if(!Pe)return;const Ee=ne(Pe),We=Pe.ownerDocument||document,De=We.defaultView||window,$e=!Ee||Ee===We.documentElement||Ee===We.body,He=!$e&&Ee?mt("nodeVisibilityFallback.root.getBoundingClientRect",()=>Ee.getBoundingClientRect()):null,Qe=$e?0:He.top,Ze=$e?mt("nodeVisibilityFallback.clientHeight",()=>{var lt,ct;return(ct=(lt=De.innerHeight)!=null?lt:Ee?.clientHeight)!=null?ct:0}):He.bottom,_t=mt("nodeVisibilityFallback.node.getBoundingClientRect",()=>Pe.getBoundingClientRect());_t.bottom>=Qe-500&&_t.top<=Ze+500&&fr(he,!0)},1800+ke);Qy.set(he,Se)})(C);let ee=null;ee=Ke(()=>K.isVisible.value,he=>{if(he){Sd(C),fr(C,!0),ee?.(),wd.delete(C),na.get(C)===K&&na.delete(C);try{K.destroy()}catch{}}},{immediate:!0}),wd.set(C,ee),Nt.value&&_i()}function $m(){wo=null;for(const[C,B]of Li)Li.delete(C),ki.get(C)===B.el&&dl.get(C)===B.version&&Fy(C,B.height,{allowShrink:B.allowShrink})}function fa(){wo!=null&&(Oe?.(wo),wo=null),Li.clear()}function Id(C,B){(function(V,K,ee){var he;if(!Number.isFinite(ee)||ee<=0||ki.get(V)!==K)return;const ke=dl.get(V);if(ke==null)return;const Se=st.value[V],Pe=Y.value&&j.value!==!0&&!((he=s.nodes)!=null&&he.length)&&V>=st.value.length-2,Ee=!(Se?.loading===!0||Pe),We=Li.get(V),De=We?We.allowShrink&&Ee:Ee,$e=We&&!De?Math.max(We.height,ee):ee;Li.set(V,{height:$e,allowShrink:De,version:ke,el:K}),wo==null&&(wo=pe?pe($m):null,wo==null&&$m())})(C,B,Hy(C,B))}function Pi(){for(const[C,B]of ki)B&&Id(C,B)}function Mk(){Ne?.disconnect(),Ne=null,ft.clear()}function Nm(){for(;yd.length;)_d(yd.pop())}Ke(us,C=>{C&&An("content")},{flush:"post"}),t({getVirtualMetrics:hl,captureVirtualState:function(C={}){var B;return la(hl("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:C.allowFallbackAnchor===!0,requireViewport:C.requireViewport===!0,includeEmptyState:(B=C.includeEmptyState)==null||B})},restoreVirtualState:function(C,B={}){const V=B.restoreAnchor===!0,K=B.restoreToken==null?"imperative":String(B.restoreToken);Tc=C,Mc={restoreAnchor:V,restoreToken:K,allowUncapturedAnchor:B.allowUncapturedAnchor===!0},!km(C,{restoreAnchor:V,restoreToken:K,allowUncapturedAnchor:B.allowUncapturedAnchor===!0})&&_k(C)||(Tc=null,Mc=null)},forceMeasure:function(C="manual"){return zn(this,null,function*(){yield ht(),yield wk(),Pi(),Ec(),yield ht();const B=hl(C);return Tm(B,!0),B})},settle:wm,scrollToNode:function(C,B="start"){aa(),nn();const V=st.value.length;if(V<=0)return;const K=As(C,0,V-1),ee=()=>{var he;const ke=Fo({nodeIndex:K,offsetWithinNodePx:0}),Se=Cd(K),Pe=xc(),Ee=(he=Pe?.clientHeight)!=null?he:0,We=qt();let De=ke;if(B==="center")De=ke-Ee/2+Se/2;else if(B==="end")De=ke-Ee+Se;else if(B==="nearest"&&We!=null){if(ke>=We&&ke+Se<=We+Ee)return;De=ke<We?ke:ke-Ee+Se}Bo(Math.max(0,De)),_i({immediate:!0}),Nt.value&&(Ho.value=K,ul())};if(Nt.value)return Ho.value=K,ul(),void ht(ee);ee()}}),Ke(()=>Xe.value,C=>{if(!C){Mk();for(const B of ur.values())for(const V of B)_d(V);ur.clear(),dl.clear(),Nm(),fa()}},{immediate:!0}),Ke(j,C=>{C&&(function(){if(we&&j.value&&ki.size){Nm();for(const B of[80,240,640]){const V=Yy(B,()=>{for(const[K,ee]of ki)ee&&Id(K,ee)},"final");V!=null&&yd.push(V)}}})(),An(C?"final":"content")}),Ke([()=>st.value.length,()=>_s.value],()=>{Be.value&&ca(),An("content")},{flush:"post",immediate:!0}),Ke([()=>xs.start,()=>xs.end],()=>{An("batch")},{flush:"post"});const{cleanupBatchScheduler:G4}=(function(C){const{props:B,isClient:V,isTestEnv:K,parsedNodesIdentity:ee,parsedNodeCount:he,desiredRenderedCount:ke,datasetKey:Se,batchingEnabled:Pe,incrementalRenderingActive:Ee,resolvedBatchSize:We,resolvedInitialBatch:De,renderedCount:$e,adaptiveBatchSize:He,previousRenderContext:Qe,previousBatchConfig:Ze,requestFrame:_t,cancelFrame:lt,hasIdleCallback:ct,cleanupNodeVisibility:St,onDatasetKeyChanged:wt,onDatasetChanged:Zt}=C;let xt=null,Bt=null,Rt=!1,ln=null,Co=null,js=0,ri=!1,hr=!1;const mr=new Set,bl=new Set;function Vk(){if(V){xt!=null&&(lt?.(xt),xt=null),Bt!=null&&(window.clearTimeout(Bt),Bt=null),Co!=null&&typeof window.cancelIdleCallback=="function"&&(window.cancelIdleCallback(Co),Co=null),js+=1;for(const Rs of mr)lt?.(Rs);mr.clear();for(const Rs of bl)window.clearTimeout(Rs);bl.clear(),Rt=!1,ln=null,ri=!1,hr=!1}}function Dd(){return typeof performance<"u"?performance.now():Date.now()}function Kk(Rs){(function(Ri){var gr;if(!Ee.value)return;const Di=Math.max(2,(gr=B.renderBatchBudgetMs)!=null?gr:6),Bi=Math.max(1,We.value||1),li=Math.max(1,Math.floor(Bi/4));Ri>1.2*Di?He.value=Math.max(li,Math.floor(.7*He.value)):Ri<.5*Di&&He.value<Bi&&(He.value=Math.min(Bi,Math.ceil(1.2*He.value)))})(Rs),ri=!1;const io=hr||$e.value<ke.value;hr=!1,io&&Xk()}function Gk(Rs,io={}){var Ri,gr;if(!Ee.value)return;const Di=ke.value;if($e.value>=Di)return;const Bi=Math.max(1,Rs),li=()=>{const ma=Dd();let ga=0;xt=null,Bt=null,Co=null,Rt=!1;const va=ln??Bi;ln=null;const Hm=Dd();$e.value=Math.min(Di,$e.value+va),St($e.value),ga=Dd()-Hm,(function(Wm,Qk){if(!V)return void Kk(Qk);ri=!0;const Zk=++js;ht().then(()=>{var Jk;if(Zk!==js)return;const hE=Dd(),mE=Math.max(Qk,hE-Wm),eb=()=>{Zk===js&&Kk(mE)};if(_t){let nb=!1,Fi=null;const sb=()=>{nb||(nb=!0,eb())},Bd=_t(()=>{mr.delete(Bd),Fi!=null&&(window.clearTimeout(Fi),bl.delete(Fi),Fi=null),sb()});return mr.add(Bd),Fi=window.setTimeout(()=>{Fi!=null&&bl.delete(Fi),Fi=null,lt?.(Bd),mr.delete(Bd),sb()},Math.max(32,(Jk=B.renderBatchIdleTimeoutMs)!=null?Jk:120)),void bl.add(Fi)}const tb=window.setTimeout(()=>{bl.delete(tb),eb()},0);bl.add(tb)})})(ma,ga)};if(!V||io.immediate)return void li();const vr=Math.max(0,(Ri=B.renderBatchDelay)!=null?Ri:16);if(ln=ln!=null?Math.max(ln,Bi):Bi,!Rt){if(Rt=!0,!K&&ct&&window.requestIdleCallback){const ma=Math.max(0,(gr=B.renderBatchIdleTimeoutMs)!=null?gr:120);return void(Co=window.requestIdleCallback(()=>li(),{timeout:ma}))}_t&&!K?xt=_t(()=>{vr!==0?Bt=window.setTimeout(()=>li(),vr):li()}):Bt=window.setTimeout(()=>li(),vr)}}function Yk(Rs,io={}){ri?hr=!0:Rs==null?Xk():Gk(Rs,io)}function Xk(){Ee.value&&Gk(Pe.value?Math.max(1,Math.round(He.value)):Math.max(1,We.value))}return Ke([ee,he,Se,Ee,We,De,()=>B.renderBatchDelay],()=>{var Rs;const io=he.value,Ri=Qe.value,gr=Se.value,Di=!Object.is(gr,Ri.key),Bi=io!==Ri.total,li=Di||Bi;Qe.value={key:gr,total:io};const vr=Ze.value,ma=(Rs=B.renderBatchDelay)!=null?Rs:16,ga=vr.batchSize!==We.value||vr.initial!==De.value||vr.delay!==ma||vr.enabled!==Ee.value;Ze.value={batchSize:We.value,initial:De.value,delay:ma,enabled:Ee.value},Di&&wt(io),(li||ga||!Ee.value)&&Vk(),(li||ga)&&(He.value=Math.max(1,We.value||1)),li&&Zt();const va=ke.value;if(!io)return $e.value=0,void St(0);if(!Ee.value)return $e.value=va,void St($e.value);const Hm=Di||Ri.total===0;$e.value=Hm||ga?Math.min(va,De.value):Math.min($e.value,va);const Wm=Math.max(1,De.value||We.value||io);$e.value<va?Yk(Wm,{immediate:!V}):St($e.value)},{immediate:!0}),Ke(ke,(Rs,io)=>{Ee.value&&(typeof io=="number"&&Rs<=io||Rs>$e.value&&Yk())}),{cleanupBatchScheduler:Vk}})({props:k,isClient:we,isTestEnv:Wt,parsedNodesIdentity:_n,parsedNodeCount:Kn,desiredRenderedCount:kd,datasetKey:H4,batchingEnabled:bo,incrementalRenderingActive:ii,resolvedBatchSize:ds,resolvedInitialBatch:Bn,renderedCount:_s,adaptiveBatchSize:ll,previousRenderContext:ta,previousBatchConfig:al,requestFrame:pe,cancelFrame:Oe,hasIdleCallback:Qt,cleanupNodeVisibility:O4,onDatasetKeyChanged:C=>{fa(),vd(),Wo(),Lc(),C>0&&md(C)},onDatasetChanged:()=>{Nt.value&&_i({immediate:!0})}});Ke([Uy,Nt,()=>S.value,()=>ye()],([C,B])=>{if(!C)return Zy(),void Xh();P4(),B?_i({immediate:!0}):Xh()},{flush:"post",immediate:!0}),Ke([()=>st.value.length,()=>Nt.value],C=>zn(null,[C],function*([B,V]){V&&B&&we&&(yield ht(),_i({immediate:!0}))}),{flush:"post"}),Ke(Xt,C=>{C&&(function(){var B;if($n.value&&Ge.value&&Ye.value&&((B=Ct.value)!=null&&B[1]))return;const V=Dr({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),K=Dr({type:"list_item",children:[V],raw:"- Probe paragraph text"}),ee=Dr({type:"list",ordered:!1,items:[K],raw:"- Probe paragraph text"});$n.value=V,Ge.value=K,Ye.value=ee;const he={1:null,2:null,3:null,4:null,5:null,6:null};for(let ke=1;ke<=6;ke++)he[ke]=Dr({type:"heading",level:ke,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(ke)} Probe heading`});Ct.value=he})()},{immediate:!0}),Ke([()=>S.value,Xt],()=>{if(!Xt.value)return em(),void(X.value=0);ek(),em(),Xt.value&&S.value&&typeof ResizeObserver<"u"&&(Sc=new ResizeObserver(()=>{ek(),Vt.value&&Jn(),Be.value&&ca(),An("resize")}),Sc.observe(S.value))},{immediate:!0}),Ke([Xt,qs,So],()=>zn(null,null,function*(){if(!Xt.value)return fe.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void Wo();yield ht(),(function(){if(!Xt.value||typeof window>"u")return fe.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void Wo();const C={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},B=Jy(Jh(I.value),".paragraph-node");C.paragraph=jg(I.value,B,"pre-wrap");const V=Jh(P.value),K=V?.querySelector(".paragraph-node");C.listItem=jg(P.value,K,"pre-wrap");const ee=mt("readSimpleTextProbeProfile.list.offsetHeight",()=>{var ke,Se;return(Se=(ke=D.value)==null?void 0:ke.offsetHeight)!=null?Se:0}),he=mt("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var ke,Se;return(Se=(ke=P.value)==null?void 0:ke.offsetHeight)!=null?Se:0});C.listWrapperOverhead=Math.max(0,ee-he);for(let ke=1;ke<=6;ke++){const Se=Jy(Jh(W[ke]),`h${ke}`);C.headings[ke]=jg(W[ke],Se,"pre-wrap")}fe.value=C,Wo()})()}),{flush:"post",immediate:!0}),Ke(()=>st.value.length,()=>{Nt.value&&_i({immediate:!0})}),Ke([Xt,X],()=>{Wo(),Nt.value&&_i({immediate:!0}),Vt.value&&Jn(),Be.value&&ca(),An("resize")},{immediate:!1}),Ke(()=>cr.value,C=>{if(C)for(const[B,V]of Os)Tk(B,V);else{Zh();for(const[B,V]of Os)V&&fr(B,!0)}},{immediate:!1}),Ke([()=>k.viewportPriority,()=>st.value.length],([C,B])=>{C!==!1?z.value&&B<=200&&(z.value=!1):z.value=!1}),Ke(()=>_s.value,()=>{Nt.value&&_i({immediate:!0})}),Ke([Ho,oo,wc,()=>st.value.length,Nt],()=>{ul()},{immediate:!0});let Pc=null,Rc=!1,pa=null;function Dc(){Pc=null,cm=null,am=void 0,ra=null,Lc()}function Lm(){fa(),vd(),Wo(),ws.clear();const C=st.value.length;C>0&&md(C),bm()}function Om(){Mm(),Xy(),Ic=null,ml=null,gl=null,Md=null,Tc=null,Mc=null,Rc=!1,Dc(),ck("restore"),nn(),aa()}function Bc(C){var B;return[(B=ps())!=null?B:"",On(),Oi(),xd.value,Nc(C),st.value.length,Math.round(pr(0,st.value.length)),Math.round(pl()),Cs.count,Math.round(Cs.total)].join(":")}function Ek(){return zn(this,null,function*(){var C,B,V,K;const ee=(C=s.virtualScroll)==null?void 0:C.settledToken,he=Nc(ee),ke=On(),Se=ps(),Pe=So.value;if(Mt.value&&((B=s.virtualScroll)==null?void 0:B.settleMode)==="manual"&&Ad(ee))if(um()){if(Bc(ee)!==ra&&!Rc){Rc=!0;try{const Ee=yield wm({reason:"manual",expectedSettledTokenKey:he}),We=Nc()===he;_m(ke,Se,Pe)&&Ee.sessionKey===ke&&Ee.threadKey===Se&&We&&Ee.stable&&Ee.phase==="final"&&(ra=Bc((V=s.virtualScroll)==null?void 0:V.settledToken))}finally{Rc=!1,yield ht();const Ee=(K=s.virtualScroll)==null?void 0:K.settledToken,We=Ad(Ee)?Bc(Ee):"";_m(ke,Se,Pe)&&We&&ra!==We&&Ek()}}}else An("manual")})}Ke(Mt,(C,B)=>{if(C!==B){if(!C)return Om(),void Mm();Om(),Lm(),pa=So.value,An("content")}},{flush:"post"}),Ke([Mt,So],([C,B])=>{C?pa!=null?pa!==B&&(pa=B,(function(V="resize"){fa(),vd(),Wo(),ws.clear();const K=st.value.length;K>0&&md(K),bm(),ml=null,gl=null,Md=null,Ic=null,Rc=!1,Dc(),bk(),ht(()=>{Pi(),Vt.value&&Jn(),Be.value&&ca(),An(V)})})("resize")):pa=B:pa=null},{flush:"post",immediate:!0}),Ke([Mt,()=>On(),()=>ps()],([C])=>{C&&(Om(),Lm(),ck("content"),An("content"))}),Ke([Mt,()=>On(),()=>ps(),So,()=>st.value.length],([C])=>{C&&(function(B="async-node"){let V=!1;for(const[K,ee]of Array.from(bi.entries()))rm(ee)||(bi.delete(K),_o.delete(K),V=!0);V&&(oa(),An(B))})("async-node")},{flush:"post"}),Ke([Mt,()=>{var C;return(C=s.virtualScroll)==null?void 0:C.sessionKey},()=>{var C;return(C=s.virtualScroll)==null?void 0:C.measurementKey},()=>s.indexKey,()=>Q.value],([C])=>{C&&(Lc(),(function(B="content"){if(!Mt.value)return;const V=[],K=st.value.length;for(const ee of Array.from(ws.keys())){if(ee>=K){V.push(ee);continue}const he=Ac(ee),ke=ws.get(ee);ke!=null&&ke!==he&&V.push(ee),ws.set(ee,he)}for(const ee of Array.from(ws.keys()))ee>=K&&ws.delete(ee);V.length&&((function(ee,he={}){const ke=Array.from(ee,Number);I4(ke,he)>0&&(function(Pe){for(const Ee of Pe)ws.delete(Ee)})(ke)})(V,{notify:!1}),Wo(),Dc(),Vt.value&&Jn(),Be.value&&ca(),An(B))})("content"))},{flush:"post",immediate:!0}),Ke([Mt,()=>st.value.length,()=>On(),()=>ps()],([C,B,V,K],[ee,he,ke,Se])=>{C&&ee&&V===ke&&K===Se&&B!==he&&Dc()},{flush:"post"}),Ke([Mt,()=>{var C;return(C=s.virtualScroll)==null?void 0:C.heightCache},()=>{var C;return(C=s.virtualScroll)==null?void 0:C.heightCacheWidth},()=>{var C;return(C=s.virtualScroll)==null?void 0:C.restoreState},()=>{var C;return(C=s.virtualScroll)==null?void 0:C.measurementKey},()=>st.value.length,()=>On(),X],()=>{bk()},{flush:"post",immediate:!0}),Ke([Mt,()=>{var C;return(C=s.virtualScroll)==null?void 0:C.restoreState},()=>{var C;return(C=s.virtualScroll)==null?void 0:C.restoreAnchor},()=>{var C;return(C=s.virtualScroll)==null?void 0:C.measurementKey},()=>st.value.length,()=>On(),X],C=>zn(null,[C],function*([B,V]){if(!B||!V)return;yield ht();const K=(function(){var ee;const he=(ee=s.virtualScroll)==null?void 0:ee.restoreAnchor;return he==null||he===!1?null:he===!0?"true":String(he)})();km(V,{restoreAnchor:K!=null,restoreToken:K??void 0})}),{flush:"post",immediate:!0}),Ke([Mt,X,()=>{var C;return(C=s.virtualScroll)==null?void 0:C.restoreState},()=>{var C;return(C=s.virtualScroll)==null?void 0:C.measurementKey}],([C])=>{var B;if(!C)return;const V=(B=s.virtualScroll)==null?void 0:B.restoreState;V&&ml&&gl==="restore"&&(yk(V)||(Lm(),ml=null,gl=null,An("resize")))},{flush:"post"}),Ke([Mt,()=>st.value.length,()=>On(),X],C=>zn(null,[C],function*([B]){var V;const K=Tc,ee=Mc;B&&K&&(yield ht(),!km(K,{restoreAnchor:ee?.restoreAnchor===!0,restoreToken:(V=ee?.restoreToken)!=null?V:"imperative",allowUncapturedAnchor:ee?.allowUncapturedAnchor===!0})&&_k(K)||(Tc=null,Mc=null))}),{flush:"post",immediate:!0}),Ke([Mt,j,()=>{var C;return(C=s.virtualScroll)==null?void 0:C.settleMode},()=>On(),()=>ps(),So,Gh,jy,()=>_s.value,kd,()=>Cs.count,()=>Cs.total],([C,B,V])=>{if(!C||B!==!0||V==="manual"||!dm())return;const K=(function(){var ee;const he=st.value.length;return[(ee=ps())!=null?ee:"",On(),Oi(),xd.value,he,Math.round(pr(0,he)),Math.round(pl()),Cs.count,Math.round(Cs.total)].join(":")})();Pc!==K&&(Pc=K,wm({reason:"final"}).then(ee=>{ee.stable||Pc!==K||(Pc=null)}))},{flush:"post",immediate:!0}),Ke([Mt,j,()=>{var C;return(C=s.virtualScroll)==null?void 0:C.settleMode},()=>{var C;return(C=s.virtualScroll)==null?void 0:C.settledToken},()=>On(),()=>ps(),So,Gh,jy,()=>_s.value,kd,()=>st.value.length,()=>Cs.count,()=>Cs.total],()=>{Ek()},{flush:"post",immediate:!0}),Ke([()=>st.value.length,Nt,oo,wc,()=>xs.start,()=>xs.end],([C,B,V,K,ee,he])=>{Ue.value&&Te("virtualization",{nodes:C,virtualization:B,maxLiveNodes:V,buffer:K,focusIndex:Ho.value,scroll:B?(()=>{const ke=xe.value||ne();return ke?{reverse:H(ke),scrollTop:Math.round(ke.scrollTop),scrollTopAbs:Math.round(Math.abs(ke.scrollTop)),scrollHeight:Math.round(ke.scrollHeight),clientHeight:Math.round(ke.clientHeight)}:null})():null,liveRange:{start:ee,end:he},rendered:_s.value})}),Ke([()=>k.customId],([C],B,V)=>{if(!C||$t)return;const K=(function(ee,he){return ee?(hs.controllers[ee]=he,()=>{hs.controllers[ee]===he&&delete hs.controllers[ee]}):()=>{}})(C,{captureRestoreAnchor:Fn,restoreAnchor:Ss,getAnchorDrift:Ps,getReport:D4});V(()=>{K()})},{immediate:!0}),ls(()=>{(function(){if(Mt.value)try{Pi(),Ec();const C=hl("manual");Sk(C)&&(E(C),Ic=C,Cm=$c());const B=la(C,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});B&&(M(B),B.anchor&&L(B.anchor),ua=Oc(B))}catch{}})(),G4(),Zh(),Ie(),Mk();for(const C of ur.values())for(const B of C)_d(B);ur.clear(),dl.clear(),ws.clear(),Nm(),fa(),em(),nn(),aa(),Mm(),Zy(),Xh()});const Y4=ui({loader:()=>zn(null,null,function*(){try{return(yield Xs(()=>import("./index11-BjzCZuCr.js"),__vite__mapDeps([8,5]))).default}catch(C){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".',C),xo}}),loadingComponent:RV,delay:0}),X4=ui({loader:()=>zn(null,null,function*(){try{return(yield Xs(()=>import("./index10-Czg_oF-W.js"),[])).default}catch(C){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.',C),xo}}),loadingComponent:PV,delay:0}),Q4=ui(()=>zn(null,null,function*(){try{return(yield Xs(()=>import("./index7-BPdza6d1.js"),[])).default}catch(C){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".',C),xo}})),Ik={text:Xn,paragraph:ql,heading:Rp,code_block:Dg,list:nc,list_item:tc,blockquote:Of,table:wu,definition_list:Pf,footnote:Rf,footnote_reference:$o,footnote_anchor:bu,admonition:Hf,vmr_container:Bf,hardbreak:jr,link:to,image:qr,thematic_break:Df,math_inline:gi,math_block:QM,strong:Js,emphasis:no,strikethrough:eo,highlight:Lo,insert:vo,subscript:go,superscript:mo,emoji:ho,checkbox:Io,checkbox_input:Io,inline_code:Us,html_inline:No,reference:Zs,html_block:_u},Z4=F(()=>om()),$k=F(()=>gS(k.codeBlockProps)),J4=F(()=>gS(k.codeBlockProps,{omit:["langs"]})),Nk=F(()=>it(it({stream:k.codeBlockStream,darkTheme:k.codeBlockDarkTheme,lightTheme:k.codeBlockLightTheme,monacoOptions:k.codeBlockMonacoOptions,themes:k.themes,langs:u.value==="shiki"?k.langs:void 0,minWidth:k.codeBlockMinWidth,maxWidth:k.codeBlockMaxWidth},typeof Fe.value=="boolean"?{showTooltips:Fe.value}:{}),J4.value)),Lk=F(()=>it(Lt(it({},Nk.value),{langs:k.langs}),$k.value));function Ok(C){return typeof C=="boolean"?C:void 0}const eE=F(()=>{const C=k.codeBlockProps||{},B={},V=Ok(C.showLineNumbers);V!==void 0&&(B.showLineNumbers=V);const K=Ok(C.diffInline);K!==void 0&&(B.diffInline=K);const ee=(function(he){const ke=Number(he);return Number.isFinite(ke)&&ke>0?ke:void 0})(C.reservedHeightPx);return ee!==void 0&&(B.reservedHeightPx=ee),B}),tE=F(()=>it(it({stream:k.codeBlockStream,darkTheme:k.codeBlockDarkTheme,lightTheme:k.codeBlockLightTheme,themes:k.themes,langs:k.langs,minWidth:k.codeBlockMinWidth,maxWidth:k.codeBlockMaxWidth},typeof Fe.value=="boolean"?{showTooltips:Fe.value}:{}),$k.value)),nE=F(()=>it({},k.mermaidProps||{})),Pk=F(()=>it({},k.d2Props||{})),sE=F(()=>it({},k.infographicProps||{})),Fc=F(()=>({typewriter:k.typewriter,fade:k.fade,customHtmlTags:Vn.value.customHtmlTags})),oE=F(()=>it(it({},Fc.value),typeof Fe.value=="boolean"?{showTooltip:Fe.value}:{})),iE=F(()=>it(it({},Fc.value),typeof Fe.value=="boolean"?{showTooltips:Fe.value}:{})),rE=F(()=>it(it({},Fc.value),typeof Fe.value=="boolean"?{showTooltips:Fe.value}:{})),lE=F(()=>it(it({},Fc.value),typeof Fe.value=="boolean"?{showTooltips:Fe.value}:{}));function aE(C){return Array.isArray(C.children)&&C.children.length>0}const Pm=F(()=>R4.value.map(C=>{var B,V,K,ee,he,ke,Se,Pe;let Ee=(function(lt){var ct,St,wt,Zt,xt,Bt,Rt;if(lt.type!=="code_block")return lt;const ln=lt,Co=[String((ct=ln.language)!=null?ct:""),String((St=ln.loading)!=null?St:""),String((wt=ln.diff)!=null?wt:""),String((Zt=ln.code)!=null?Zt:""),String((xt=ln.originalCode)!=null?xt:""),String((Bt=ln.updatedCode)!=null?Bt:""),String((Rt=ln.raw)!=null?Rt:"")].join("\0"),js=xn.get(ln);if(js&&js.signature===Co)return js.node;const ri=it({},ln);return xn.set(ln,{signature:Co,node:ri}),ri})(C.node);const We=$d(Ee);let De=Fk(Ee,We);if((Ee.type==="html_block"||Ee.type==="html_inline")&&De===Ik[Ee.type]){const lt=Ee,ct=String((B=lt.tag)!=null?B:"").trim().toLowerCase()||WT(lt.content);if(ct){const St=Ft.value[ct];if(bn.value.has(ct)&&St)De=St,Ee=Lt(it({},lt),{type:ct,tag:ct,content:Z9(lt.content,ct)});else if(zT((V=lt.content)!=null?V:lt.raw,ct)){const wt=String((ee=(K=lt.content)!=null?K:lt.raw)!=null?ee:"");Ee.type==="html_inline"?(De=Xn,Ee={type:"text",content:wt,raw:wt}):(De=ql,Ee={type:"paragraph",children:[{type:"text",content:wt,raw:wt}],raw:wt})}}}const $e=Ee.type==="code_block"&&u.value==="pre"&&De===xo&&!Rm(Ft.value,We);let He=it({},(function(lt,ct,St){const wt=ct??$d(lt);if(lt.type==="code_block"){const Zt=wt?Rm(Ft.value,wt):void 0;if(St&&u.value==="pre"&&!Zt&&St===xo)return eE.value;if(St&&wt&&St===Zt)return wt==="mermaid"?Dk(lt):wt==="infographic"?Bk(lt):wt==="d2"||wt==="d2lang"?Pk.value:Lk.value;if(St&&St===Ft.value.code_block)return Lk.value;if(nk(St))return tE.value}return wt==="mermaid"?Dk(lt):wt==="infographic"?Bk(lt):wt==="d2"||wt==="d2lang"?Pk.value:lt.type==="link"?oE.value:lt.type==="list"?iE.value:lt.type==="blockquote"?rE.value:lt.type==="table"?lE.value:lt.type==="code_block"?Nk.value:Fc.value})(Ee,We,De));const Qe=fl.value[C.index];Ee.type==="code_block"&&Qe?.kind==="code-block"&&(He=Lt(it({},He),$e?{reservedHeightPx:(he=Qe.height)!=null?he:Qe.contentHeight}:{estimatedHeightPx:Qe.height,estimatedContentHeightPx:Qe.contentHeight})),$e||Ee.type!=="code_block"||We!=="mermaid"||Ha(He.estimatedPreviewHeightPx)!=null||(He=Lt(it({},He),{estimatedPreviewHeightPx:m1(p1(String((ke=Ee.code)!=null?ke:"")))})),$e||Ee.type!=="code_block"||We!=="infographic"||Ha(He.estimatedPreviewHeightPx)!=null||(He=Lt(it({},He),{estimatedPreviewHeightPx:g1(h1(String((Se=Ee.code)!=null?Se:"")))})),Ee.type==="math_block"&&(He=Lt(it({},He),{cacheScope:Dn.value}));const Ze=(function(lt,ct){const St=String(lt.type);return!dd(St)&&Ft.value[St]===ct})(Ee,De),_t=Ze?ay(Ee,rt.value):void 0;return Lt(it({},C),{node:Ee,component:De,bindings:He,customBindings:it(it({},_t??{}),He),rendersCustomNode:Ze,hasSlotChildren:aE(Ee),slotContent:String((Pe=Ee.content)!=null?Pe:""),isCodeBlock:Ee.type==="code_block",indexKey:`${Z4.value}-${C.index}`})}));function $d(C){var B;return C?.type==="code_block"?String((B=C.language)!=null?B:"").trim().toLowerCase():""}function Rm(C,B){const V=B.trim().toLowerCase();if(V)for(const K of[V,ty(V),RM(V)]){const ee=K&&C[K];if(ee)return ee}}function Rk(C,B,V,K){var ee,he;const ke=it({},C.value);return Ha(ke.estimatedPreviewHeightPx)==null&&(ke.estimatedPreviewHeightPx=K(V(String((ee=B?.code)!=null?ee:"")),void 0,ke.maxHeight==="none"?null:(he=Ha(ke.maxHeight))!=null?he:void 0)),ke}function Dk(C){return Rk(nE,C,p1,m1)}function Bk(C){return Rk(sE,C,h1,g1)}function Fk(C,B){if(!C)return A1;const V=Ft.value,K=V[String(C.type)];if(C.type==="code_block"){const ee=B??$d(C),he=ee?Rm(V,ee):void 0;return he||(u.value==="pre"?V.code_block||xo:ee==="mermaid"?V.mermaid||Y4:ee==="infographic"?V.infographic||X4:ee==="d2"||ee==="d2lang"?V.d2||Q4:K||V.code_block||sk.value)}return K||Ik[String(C.type)]||A1}function Dm(C){o("click",C)}function cE(C){var B;(B=C.target)!=null&&B.closest("[data-node-index]")&&o("mouseover",C)}function uE(C){var B;(B=C.target)!=null&&B.closest("[data-node-index]")&&o("mouseout",C)}function Hk(C){o("mouseover",C)}function Wk(C){o("mouseout",C)}const kl=Z(null),wi=Z(!1);let Hc,ha=null,Bm=0,Nd=0,Ld=0;const zk=["code_block","admonition","table","math_block","html_block","image","thematic_break"],dE=new Set(zk),Uk=[".typewriter-cursor",".height-estimation-probes",...zk.map(C=>`[data-node-type="${C}"]`),"script","style"].join(",");function qk(C){if(!C||typeof C!="object")return!1;const B=C.type;return typeof B=="string"&&dE.has(B)}function Od(C){var B,V;if(!C||typeof C!="object")return 0;const K=C,ee=(V=(B=K.raw)!=null?B:K.content)!=null?V:K.code;if(typeof ee=="string")return ee.length;const he=K.children;if(Array.isArray(he))return he.reduce((Se,Pe)=>Se+Od(Pe),0);const ke=K.items;return Array.isArray(ke)?ke.reduce((Se,Pe)=>Se+Od(Pe),0):0}function Pd(){Hc&&(clearTimeout(Hc),Hc=void 0)}function jk(){Bm+=1,ha!=null&&(Oe?.(ha),ha=null)}function Rd(){jk(),kl.value&&(kl.value.style.visibility="hidden")}function fE(C){var B;if(C.nodeType!==Node.TEXT_NODE||!((B=C.textContent)!=null?B:"").trim())return!1;const V=C.parentElement;return!!V&&!V.closest(Uk)}function pE(C){let B=C.lastChild;for(;B;){if(fE(B))return B;if(B.nodeType===Node.ELEMENT_NODE){const V=B;if(!V.matches(Uk)&&V.lastChild){B=V.lastChild;continue}}for(;B&&B!==C&&!B.previousSibling;)B=B.parentNode;if(!B||B===C)break;B=B.previousSibling}return null}function Fm(){if(!we||!wi.value||ha!=null)return;const C=Bm,B=()=>{ha=null,C===Bm&&(function(){var V,K;if(!(we&&wi.value&&S.value&&kl.value))return;const ee=S.value,he=kl.value;he.style.visibility="hidden";const ke=(function(){const De=Pm.value;for(let $e=De.length-1;$e>=0;$e--){const He=De[$e];if(!He||qk(He.node)||!Im(He.index))continue;const Qe=Os.get(He.index);if(!Qe)continue;const Ze=pE(Qe);if(Ze)return Ze}return null})();if(!ke)return;let Se=0,Pe=0,Ee=20,We=!1;if(ke?.textContent){const De=ke.textContent.length,$e=document.createRange();$e.setStart(ke,Math.max(0,De-1)),$e.setEnd(ke,De);const He=typeof $e.getClientRects=="function"?$e.getClientRects():void 0,Qe=(K=He?.[He.length-1])!=null?K:(V=ke.parentElement)==null?void 0:V.getBoundingClientRect();if(Qe){const Ze=mt("typewriterCursor.root.getBoundingClientRect",()=>ee.getBoundingClientRect());Se=Qe.right-Ze.left+ee.scrollLeft,Pe=Qe.top-Ze.top+ee.scrollTop,Ee=Qe.height||Ee,We=!0}$e.detach()}We&&(he.style.transform=`translate(${Math.max(0,Se)}px, ${Math.max(0,Pe)}px)`,he.style.height=`${Ee}px`,he.style.visibility="visible")})()};pe?ha=pe(B):B()}return Ke([ue,()=>s.content,()=>s.nodes,()=>k.typewriter,j],()=>zn(null,null,function*(){var C,B;if(!we||ze.value||!U.value)return;if(j.value)return wi.value=!1,Pd(),void Rd();if((C=s.nodes)!=null&&C.length)return wi.value=!1,Pd(),Rd(),Nd=((B=s.content)!=null?B:"").length,void(Ld=ue.value.length);const V=(function(){var Se,Pe;return(Se=s.nodes)!=null&&Se.length?s.nodes.reduce((Ee,We)=>Ee+Od(We),0):((Pe=s.content)!=null?Pe:"").length})(),K=(function(){var Se;return(Se=s.nodes)!=null&&Se.length?s.nodes.reduce((Pe,Ee)=>Pe+Od(Ee),0):ue.value.length})(),ee=!qk(st.value[st.value.length-1]),he=V>Nd,ke=K>Ld;if(k.typewriter===!1||!ee||!he&&!ke)return k.typewriter!==!1&&ee||(wi.value=!1,Rd()),Nd=V,void(Ld=K);Nd=V,Ld=K,wi.value=!0,kl.value&&(kl.value.style.visibility="hidden"),Pd(),yield ht(),Fm(),Hc=setTimeout(()=>{Hc=void 0,wi.value=!1},3e3)}),{flush:"post",immediate:!0}),Ke(wi,C=>zn(null,null,function*(){C?(yield ht(),Fm()):Rd()}),{flush:"post"}),Ke([()=>_s.value,()=>xs.start,()=>xs.end],()=>zn(null,null,function*(){we&&!ze.value&&U.value&&wi.value&&(yield ht(),Fm())}),{flush:"post"}),ls(()=>{Pd(),jk(),Rn.clear()}),(C,B)=>{const V=HI("NodeRenderer",!0);return x(ze)?(w(!0),N(Le,{key:0},nt(Pm.value,K=>(w(),N(Le,{key:K.index},[K.rendersCustomNode?(w(),ve(Hs(K.component),dn({key:0,ref_for:!0},K.customBindings,{node:K.node,loading:K.node.loading,"index-key":K.indexKey,"custom-id":k.customId,"is-dark":k.isDark,onClick:Dm,onMouseover:Hk,onMouseout:Wk,onCopy:B[0]||(B[0]=ee=>o("copy",ee)),onHandleArtifactClick:B[1]||(B[1]=ee=>o("handleArtifactClick",ee))}),{default:_e(()=>[K.hasSlotChildren?(w(),ve(V,dn({key:0,ref_for:!0},In.value,{nodes:K.node.children,"index-key":K.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):K.slotContent?(w(),ve(V,dn({key:1,ref_for:!0},In.value,{content:K.slotContent,final:!K.node.loading,"index-key":`${K.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ie("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(w(),ve(Hs(K.component),dn({key:1,node:K.node,loading:K.node.loading,"index-key":K.indexKey},{ref_for:!0},K.bindings,{"custom-id":k.customId,"is-dark":k.isDark,onClick:Dm,onMouseover:Hk,onMouseout:Wk,onCopy:B[2]||(B[2]=ee=>o("copy",ee)),onHandleArtifactClick:B[3]||(B[3]=ee=>o("handleArtifactClick",ee))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(w(),N("div",{key:1,ref_key:"containerRef",ref:S,class:Re(["markstream-vue markdown-renderer",[{dark:k.isDark},{virtualized:Nt.value},{"virtual-scroll-coordinated":us.value}]]),"data-custom-id":k.customId,onClick:Dm,onMouseover:cE,onMouseout:uE},[oi.value||Nt.value?(w(),N(Le,{key:0},[oi.value?(w(),N("div",{key:0,class:"height-estimation-probes",style:Gt({width:`${qs.value}px`}),"aria-hidden":"true"},[T("div",{ref_key:"paragraphProbeWrapperRef",ref:I,class:"node-content","data-probe":"paragraph"},[oe(x(ql),{node:$n.value,"index-key":"probe-paragraph"},null,8,["node"])],512),T("div",{ref_key:"listItemProbeWrapperRef",ref:P,class:"node-content","data-probe":"list-item"},[T("ul",BV,[oe(x(tc),{node:Ge.value,"index-key":"probe-list-item"},null,8,["node"])])],512),T("div",{ref_key:"listProbeWrapperRef",ref:D,class:"node-content","data-probe":"list"},[oe(x(nc),{node:Ye.value,"index-key":"probe-list"},null,8,["node"])],512),(w(),N(Le,null,nt(6,K=>T("div",{key:`probe-heading-${K}`,ref_for:!0,ref:ee=>(function(he,ke){he<1||he>6||(W[he]=ke)})(K,ee),class:"node-content","data-probe":`heading-${K}`},[oe(x(Rp),{node:L4(K),"index-key":`probe-heading-${K}`},null,8,["node","index-key"])],8,FV)),64))],4)):ie("",!0),Nt.value?(w(),N("div",{key:1,class:"node-spacer",style:Gt({height:`${nm.value}px`}),"aria-hidden":"true"},null,4)):ie("",!0)],64)):ie("",!0),(w(!0),N(Le,null,nt(Pm.value,K=>(w(),N("div",{key:K.index,ref_for:!0,ref:ee=>Tk(K.index,ee),class:"node-slot","data-node-index":K.index,"data-node-type":K.node.type},[Im(K.index)?(w(),N("div",{key:0,ref_for:!0,ref:ee=>(function(he,ke){var Se;ke||(function(De){const $e=`${om()}-${De}`;let He=!1;for(const Qe of Array.from(_o.keys())){const Ze=bi.get(Qe);(Ze?.index===De||Qe===$e||Qe.startsWith(`${$e}-`))&&(_o.delete(Qe),bi.delete(Qe),He=!0)}He&&(oa(),An("async-node"))})(he),Li.delete(he),(function(De){var $e;const He=(($e=dl.get(De))!=null?$e:0)+1;dl.set(De,He)})(he);const Pe=ur.get(he);if(Pe){for(const De of Pe)_d(De);ur.delete(he)}if((function(De){const $e=ft.get(De);$e&&(Ne?.unobserve($e),me.delete($e),ft.delete(De))})(he),!ke||!Xe.value)return ki.delete(he),void dl.delete(he);ki.set(he,ke);const Ee=()=>{Id(he,ke)};queueMicrotask(Ee);const We=(Ne||typeof ResizeObserver>"u"||(Ne=new ResizeObserver(De=>{if(De.length)for(const $e of De){const He=me.get($e.target),Qe=ft.get(He??-1);He!=null&&Qe&&Id(He,Qe)}else Pi()})),Ne);if(We&&(ft.set(he,ke),me.set(ke,he),We.observe(ke)),typeof window<"u"){const De=((Se=st.value[he])==null?void 0:Se.type)==="code_block"?[16,80,240,800]:j.value?[80]:[];if(De.length){const $e=De.map(He=>Yy(He,Ee,"node-resize")).filter(He=>He!=null);$e.length&&ur.set(he,$e)}}})(K.index,ee),class:"node-content"},[K.isCodeBlock?K.rendersCustomNode?(w(),ve(Hs(K.component),dn({key:1,ref_for:!0},K.customBindings,{node:K.node,loading:K.node.loading,"index-key":K.indexKey,"custom-id":k.customId,"is-dark":k.isDark,onCopy:B[8]||(B[8]=ee=>o("copy",ee)),onHandleArtifactClick:B[9]||(B[9]=ee=>o("handleArtifactClick",ee))}),{default:_e(()=>[K.hasSlotChildren?(w(),ve(V,dn({key:0,ref_for:!0},In.value,{nodes:K.node.children,"index-key":K.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):K.slotContent?(w(),ve(V,dn({key:1,ref_for:!0},In.value,{content:K.slotContent,final:!K.node.loading,"index-key":`${K.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ie("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(w(),ve(Hs(K.component),dn({key:2,node:K.node,loading:K.node.loading,"index-key":K.indexKey},{ref_for:!0},K.bindings,{"custom-id":k.customId,"is-dark":k.isDark,onCopy:B[10]||(B[10]=ee=>o("copy",ee)),onHandleArtifactClick:B[11]||(B[11]=ee=>o("handleArtifactClick",ee))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(w(),ve(Gr,{key:0,name:"fade",css:k.fade!==!1,appear:k.fade!==!1},{default:_e(()=>[K.rendersCustomNode?(w(),ve(Hs(K.component),dn({key:0,ref_for:!0},K.customBindings,{node:K.node,loading:K.node.loading,"index-key":K.indexKey,"custom-id":k.customId,"is-dark":k.isDark,onCopy:B[4]||(B[4]=ee=>o("copy",ee)),onHandleArtifactClick:B[5]||(B[5]=ee=>o("handleArtifactClick",ee))}),{default:_e(()=>[K.hasSlotChildren?(w(),ve(V,dn({key:0,ref_for:!0},In.value,{nodes:K.node.children,"index-key":K.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):K.slotContent?(w(),ve(V,dn({key:1,ref_for:!0},In.value,{content:K.slotContent,final:!K.node.loading,"index-key":`${K.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ie("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(w(),ve(Hs(K.component),dn({key:1,node:K.node,loading:K.node.loading,"index-key":K.indexKey},{ref_for:!0},K.bindings,{"custom-id":k.customId,"is-dark":k.isDark,onCopy:B[6]||(B[6]=ee=>o("copy",ee)),onHandleArtifactClick:B[7]||(B[7]=ee=>o("handleArtifactClick",ee))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(w(),N("div",{key:1,class:"node-placeholder",style:Gt({height:`${Cd(K.index)}px`})},null,4))],8,HV))),128)),wi.value?(w(),N("span",{key:1,ref_key:"typewriterCursorRef",ref:kl,class:"typewriter-cursor","aria-hidden":"true"},null,512)):ie("",!0),Nt.value?(w(),N("div",{key:2,class:"node-spacer",style:Gt({height:`${sm.value}px`}),"aria-hidden":"true"},null,4)):ie("",!0)],42,DV))}}})),[["__scopeId","data-v-2e8e6e17"]]),yo=u3;yo.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",yo.__name,yo.name].filter(n=>!!n));for(const n of t)e.component(n,u3)};const my=Object.freeze(Object.defineProperty({__proto__:null,default:yo},Symbol.toStringTag,{value:"Module"})),WV={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"},zV={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"},UV={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"},qV={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"},jV={class:"admonition-title"},VV=["aria-expanded","aria-controls"],KV=["id"],Hf=un(je({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:t}){var n;const s=e,o=t,i=F(()=>{if(s.node.title&&s.node.title.trim().length)return s.node.title;const c=s.node.kind||"note";return c.charAt(0).toUpperCase()+c.slice(1)}),r=Z(!!s.node.collapsible&&!((n=s.node.open)==null||n));function l(){s.node.collapsible&&(r.value=!r.value)}const a=`admonition-${Math.random().toString(36).slice(2,9)}`;return(c,u)=>(w(),N("div",{class:Re(["admonition",[`admonition-${s.node.kind}`]])},[T("div",{id:a,class:"admonition-legend"},[s.node.kind==="note"||s.node.kind==="info"?(w(),N("svg",WV,[...u[1]||(u[1]=[T("circle",{cx:"12",cy:"12",r:"10"},null,-1),T("path",{d:"M12 16v-4"},null,-1),T("path",{d:"M12 8h.01"},null,-1)])])):s.node.kind==="tip"?(w(),N("svg",zV,[...u[2]||(u[2]=[T("path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5"},null,-1),T("path",{d:"M9 18h6"},null,-1),T("path",{d:"M10 22h4"},null,-1)])])):s.node.kind==="warning"||s.node.kind==="caution"?(w(),N("svg",UV,[...u[3]||(u[3]=[T("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"},null,-1),T("path",{d:"M12 9v4"},null,-1),T("path",{d:"M12 17h.01"},null,-1)])])):s.node.kind==="danger"||s.node.kind==="error"?(w(),N("svg",qV,[...u[4]||(u[4]=[T("polygon",{points:"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"},null,-1),T("path",{d:"M12 8v4"},null,-1),T("path",{d:"M12 16h.01"},null,-1)])])):ie("",!0),T("span",jV,R(i.value),1),s.node.collapsible?(w(),N("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${a}-content`,onClick:l},[(w(),N("svg",{style:Gt({rotate:r.value?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[...u[5]||(u[5]=[T("path",{d:"m9 18 6-6-6-6"},null,-1)])],4))],8,VV)):ie("",!0)]),Mn(T("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[oe(x(yo),{"index-key":`admonition-${e.indexKey}`,nodes:s.node.children,"custom-id":s.customId,typewriter:s.typewriter,fade:s.fade,onCopy:u[0]||(u[0]=d=>o("copy",d))},null,8,["index-key","nodes","custom-id","typewriter","fade"])],8,KV),[[Qo,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);Hf.install=e=>{e.component(Hf.__name,Hf)};const d3=()=>Xs(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let hf=null,GV=d3;function _he(){return zn(this,null,function*(){if(hf)return hf;const e=GV;if(!e)return null;let t;try{t=yield e()}catch(n){throw e===d3?new Error('Optional dependency "@terrastruct/d2" is not installed. Please install it to enable D2 diagrams.'):n}return t?(hf=(function(n){var s;if(!n)return n;if(n.D2&&typeof n.D2=="function")return n.D2;if(n.default&&n.default.D2&&typeof n.default.D2=="function")return n.default.D2;const o=(s=n.default)!=null?s:n;return typeof o=="function"?o:o?.D2&&typeof o.D2=="function"?o.D2:o})(t),hf):null})}function whe(){return!1}function She(){return zn(this,null,function*(){return null})}const mf=Z(!1);let TS=!1;function Kg(){const e=document.documentElement.dataset.colorScheme;return e==="dark"?!0:e==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function YV(){return!TS&&typeof window<"u"&&typeof document<"u"&&(TS=!0,mf.value=Kg(),new MutationObserver(()=>{mf.value=Kg()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{mf.value=Kg()})),mf}const f3=["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"],XV=new Set(["AGENTS.md","CHANGELOG.md","Dockerfile","LICENSE","Makefile","README.md","package.json","pnpm-lock.yaml","pnpm-workspace.yaml","tsconfig.json","vite.config.ts"]),$1=[...f3].sort((e,t)=>t.length-e.length).join("|"),Gg=new RegExp([String.raw`(?:^|[\s([{"'`+"`"+String.raw`])`,String.raw`(`,String.raw`(?:~|\.{1,2}|/)?(?:[A-Za-z0-9_.@+()[\]-]+/)+[A-Za-z0-9_.@+()[\]-]+(?:\.(?:${$1}))?`,String.raw`|`,String.raw`[A-Za-z0-9_.@+()[\]-]+\.(?:${$1})`,String.raw`)`,String.raw`(?:#L?(\d+)|:(\d+))?`,String.raw`(?=$|[\s)"'\]}>.,;!?,。;!?)])`].join(""),"gi"),p3=/[),.;!?,。;!?)]+$/;function QV(e){const t=e.toLowerCase();return f3.some(n=>t.endsWith(`.${n}`))}function ZV(e){const t=new Map,n=new RegExp(String.raw`\b(?:path|src)=["'](\/[^"']+\.(?:${$1}))["']`,"gi");let s;for(;(s=n.exec(e))!==null;){const o=s[1];if(!o)continue;const i=o.split("/").pop();i&&t.set(i,o)}return t}function JV(e,t={}){const n=e.trim();if(!n||/^[a-z][a-z0-9+.-]*:\/\//i.test(n))return null;const s=n.match(/^(.*?)(?:#L?(\d+)|:(\d+))?$/i);if(!s)return null;let o=(s[1]??"").replace(p3,"");if(!o)return null;const i=o.split("/").pop()??o,r=o.includes("/"),l=XV.has(i),a=QV(i);if(r&&!l&&!a)return null;if(!r&&!l){const d=t.aliases?.get(i);if(!d)return null;o=d}const c=s[2]??s[3],u=c?Number(c):void 0;return{path:o,line:u!==void 0&&Number.isFinite(u)&&u>0?u:void 0}}function eK(e,t={}){const n=[];Gg.lastIndex=0;let s;for(;(s=Gg.exec(e))!==null;){const o=s[0]??"",i=s[1]??"",r=o.indexOf(i);if(r<0)continue;const l=s[2]??s[3];let a=i+(l?o.slice(r+i.length):"");const c=a.replace(p3,""),u=a.length-c.length;a=c;const d=JV(a,t);if(!d)continue;const p=s.index+r,h=p+a.length;n.push({...d,start:p,end:h,text:a}),u>0&&(Gg.lastIndex-=u)}return n}const tK=12e4,nK=6e4,sK=32,oK=3e4,MS=/(^|\n)(`{3,}|~{3,})[^\n]*\n([\s\S]*?)(?:\n)?\2(?=\n|$)/g;function iK(e){let t=0,n=0,s=0;MS.lastIndex=0;let o;for(;(o=MS.exec(e))!==null;){const r=o[3]??"";t+=1,n+=r.length,s=Math.max(s,r.length)}return{codeRenderer:e.length>=tK||n>=nK||t>=sK||s>=oK?"pre":"shiki",codeFenceCount:t,codeChars:n}}function rK(e){return new Worker("/assets/katexRenderer.worker-CO_gEm4q.js",{type:"module",name:e?.name})}function lK(e){return new Worker("/assets/mermaidParser.worker-Dx4jPi9z.js",{type:"module",name:e?.name})}const aK={key:1,class:"diff-wrap"},cK={class:"diff-bar"},uK=["onClick"],dK={class:"diff-pre"},fK="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",ES="github-light",IS="github-dark",pK=je({__name:"Markdown",props:{text:{},openFile:{},streaming:{type:Boolean,default:!1}},setup(e){qU(),sq(),VU(),aq(),jU(new rK),lq(new lK);function t(P){return P.inline.ruler.disable("math"),P}const{t:n}=It(),s=Ut("resolveImage"),o=Z(null),i=e,r=F(()=>!i.streaming),l=F(()=>ZV(i.text??"")),a=F(()=>i.streaming?{codeRenderer:"shiki",codeFenceCount:0,codeChars:0}:iK(i.text??"")),c=YV(),u=F(()=>!i.streaming),d=$s(new Map),p=new Set,h=/(!\[[^\]]*\]\()\s*([^)\s]+)([^)]*\))/g,f=/(<img\b[^>]*?\bsrc=")([^"]+)(")/gi;function m(P){return!/^(https?:|data:|blob:)/i.test(P)}function b(P){if(!s)return;const D=[];for(const W of[h,f]){W.lastIndex=0;let z;for(;(z=W.exec(P))!==null;)D.push(z[2]??"")}for(const W of D)!W||!m(W)||d.has(W)||p.has(W)||(p.add(W),s(W).then(z=>{d.set(W,z!==W?z:"")}).catch(()=>{d.set(W,"")}).finally(()=>{p.delete(W)}))}function _(P){if(!s)return P;const D=W=>{if(!m(W))return null;const z=d.get(W);return z===void 0?fK:z===""?null:z};return P.replace(h,(W,z,q,Q)=>{const X=D(q);return X===null?W:`${z}${X}${Q}`}).replace(f,(W,z,q,Q)=>{const X=D(q);return X===null?W:`${z}${X}${Q}`})}Ke(()=>i.text,P=>b(P??""),{immediate:!0});function g(){if(!o.value||!i.openFile||i.streaming)return;const P=document.createTreeWalker(o.value,NodeFilter.SHOW_TEXT),D=[];let W=P.nextNode();for(;W;){const z=W,q=z.parentElement;q&&!q.closest("a, pre, .md-file-link, svg")&&z.data.trim().length>0&&D.push(z),W=P.nextNode()}for(const z of D){const q=eK(z.data,{aliases:l.value});if(q.length===0||!z.parentNode)continue;const Q=document.createDocumentFragment();let X=0;for(const fe of q){fe.start>X&&Q.append(document.createTextNode(z.data.slice(X,fe.start)));const ye=document.createElement("button");ye.type="button",ye.className="md-file-link",ye.textContent=fe.text,ye.title=fe.line?`${fe.path}:${fe.line}`:fe.path,ye.addEventListener("click",Me=>{Me.preventDefault(),Me.stopPropagation(),i.openFile?.({path:fe.path,line:fe.line})}),Q.append(ye),X=fe.end}X<z.data.length&&Q.append(document.createTextNode(z.data.slice(X))),z.parentNode.replaceChild(Q,z)}}function v(P){return!(!P||/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(P))}function y(P){let D=P.length;for(const W of["#","?"]){const z=P.indexOf(W);z!==-1&&z<D&&(D=z)}return P.slice(0,D)}function A(){if(!o.value||!i.openFile||i.streaming)return;const P=o.value.querySelectorAll("a[href]");for(const D of P){if(D.dataset.mdLinkHandled==="true"||D.closest("svg"))continue;const W=D.getAttribute("href")??"";v(W)&&(D.dataset.mdLinkHandled="true",D.addEventListener("click",z=>{z.preventDefault(),z.stopPropagation(),i.openFile?.({path:y(W)})}))}}function O(){ht().then(()=>{g(),A()})}Ke(()=>i.text,O),Ke(()=>i.streaming,O);let $=null;hn(()=>{O(),o.value&&($=new MutationObserver(O),$.observe(o.value,{childList:!0,subtree:!0}))}),kn(()=>{$?.disconnect()});const k={showHeader:!0,showCopyButton:!0,showExpandButton:!1,showPreviewButton:!1,showCollapseButton:!1,showFontSizeButtons:!1,loading:!1},E=/(^|\n)(?:```|~~~)diff\b[^\n]*\n([\s\S]*?)(?:\n)?(?:```|~~~)(?=\n|$)/g,M=F(()=>{const P=_(i.text??""),D=[];let W=0;E.lastIndex=0;let z;for(;(z=E.exec(P))!==null;){const Q=z[1]??"",X=P.slice(W,z.index)+(Q||"");X.trim()&&D.push({kind:"md",text:X}),D.push({kind:"diff",code:z[2]??""}),W=E.lastIndex}const q=P.slice(W);return(q.trim()||D.length===0)&&D.push({kind:"md",text:q}),D});function L(P){return P.split(`
|
|
245
|
+
`)&&!(function(D){const W=wS(D);if(SS(W))return!1;const z=i3(W);return z.length>=2&&z.some(q=>q.trim())})(I))})(r.value,E)?b():(function(){if(h+=1,l)return;const S=Math.max(0,(function(I){const P=I.parseCoalesceMs;return typeof P=="number"&&Number.isFinite(P)&&P>=0?P:80})(e)-(ai()-f));S<=0?b():l=setTimeout(b,S)})())},{flush:"sync",immediate:!0}),K1(m);const _=F(()=>{var E,M,L,S;return Y9(e.customHtmlTags,(E=e.parseOptions)==null?void 0:E.customHtmlTags,(S=(L=(M=t.customComponentsMap)==null?void 0:M.value)!=null?L:{},Object.entries(S).map(([I,P])=>{const D=si(I);return P==null||!D||dd(D)||RT.has(D)||ad.has(D)?"":D}).filter(Boolean)))}),g=F(()=>{const{key:E,tags:M}=X9(_.value);if(!E)return s;const L=o.get(E);if(L)return L;const S=E2(t.instanceMsgId,{customHtmlTags:M});return o.set(E,S),S}),v=F(()=>{const E=g.value;return e.customMarkdownIt?e.customMarkdownIt(E):E}),y=F(()=>{var E,M;const L=(E=e.parseOptions)!=null?E:{},S=t.effectiveFinal.value,I=_.value,P=S!=null,D=I.length>0;return P||D||L.streamParse==null?it(it(Lt(it({},L),{streamParse:(M=L.streamParse)==null||M}),P?{final:S}:{}),D?{customHtmlTags:I}:{}):L}),A=F(()=>{var E;return new Set(((E=y.value.customHtmlTags)!=null?E:[]).map(M=>String(M).trim().toLowerCase()).filter(Boolean))}),O=F(()=>_S(y.value,v.value,e.customMarkdownIt,{includeFinal:!0})),$=F(()=>_S(y.value,v.value,e.customMarkdownIt,{includeFinal:!1}));Ke([O,$],([E,M],[L,S])=>{L&&(E===L&&M===S||(b(),M!==S&&(a=[],d="")))},{flush:"sync"});const k=F(()=>{var E,M,L,S,I,P,D,W;if((E=e.nodes)!=null&&E.length)return a=[],d="",Dr(e.nodes.slice());const z=r.value;if(!z)return a=[],d="",[];const q=t.debugPerformanceEnabled.value,Q=q?ai():0,X=v.value,fe=O.value,ye=$.value;c&&fe!==c&&(function(ce){var te,ue;(ue=(te=ce.stream)==null?void 0:te.reset)==null||ue.call(te)})(X),u&&ye!==u&&(a=[],d="");const Me=a.length>0&&z.startsWith(d)&&ye===u,we=q?bS(X):null,ze=q?{}:void 0,Ue=ze?Lt(it({},y.value),{__timing:ze}):y.value,Fe=CM(z,X,Ue),rt=q?ai():0,le=q?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let U,G=q?Vg(Fe.length):void 0,ne=0,H=0;if(Me){const ce=q?ai():0;if(le){const te=(function(ue,j,Y){if(!j.length)return{nodes:ue,metrics:Vg(ue.length)};const re=(function(Ie,ae,Te){const Ve=Math.min(Ie.length,ae.length);for(let tt=0;tt<Ve;tt++)if(!MV(ae[tt],Ie[tt],Te))return tt;return Ie.length===ae.length?-1:Ve})(ue,j,Y);if(re<0)return{nodes:j,metrics:{reusedNodeCount:ue.length,dirtyStartIndex:re,stablePrefixNodeCount:ue.length,dirtyTailNodeCount:0}};const ge=ue.slice();let Ae=re;for(let Ie=0;Ie<re;Ie++)ge[Ie]=j[Ie];for(let Ie=re;Ie<ue.length;Ie++){const ae=j[Ie],Te=ue[Ie];ae&&c3(ae,Te,Y)&&(ge[Ie]=ae,Ae+=1)}return{nodes:ge,metrics:{reusedNodeCount:Ae,dirtyStartIndex:re,stablePrefixNodeCount:re,dirtyTailNodeCount:xS(re,ue,j)}}})(Fe,a,le);U=te.nodes,G=te.metrics}else{const te=(function(ue,j){if(!j.length)return{nodes:ue,metrics:Vg(ue.length)};const Y=(function(Ae,Ie){const ae=Math.min(Ae.length,Ie.length);for(let Te=0;Te<ae;Te++)if(!TV(Ie[Te],Ae[Te]))return Te;return Ae.length===Ie.length?-1:ae})(ue,j);if(Y<0)return{nodes:j,metrics:{reusedNodeCount:ue.length,dirtyStartIndex:Y,stablePrefixNodeCount:ue.length,dirtyTailNodeCount:0}};const re=ue.slice();let ge=Y;for(let Ae=0;Ae<Y;Ae++)re[Ae]=j[Ae];for(let Ae=Y;Ae<ue.length;Ae++){const Ie=j[Ae],ae=ue[Ae];Ie&&a3(Ie,ae)&&(re[Ae]=Ie,ge+=1)}return{nodes:re,metrics:{reusedNodeCount:ge,dirtyStartIndex:Y,stablePrefixNodeCount:Y,dirtyTailNodeCount:xS(Y,ue,j)}}})(Fe,a);U=te.nodes,G=te.metrics}ne=q?ai()-ce:0,H=G?.dirtyStartIndex==null||G.dirtyStartIndex<0?U.length:G.dirtyStartIndex}else U=Fe;le?(function(ce,te,ue=0){for(let j=Math.max(0,ue);j<ce.length;j++)py(te,"primeSignatureMs",()=>Jr(ce[j]))})(U,le,H):(function(ce,te=0){for(let ue=Math.max(0,te);ue<ce.length;ue++)Jr(ce[ue])})(U,H);const J=q?ai()-rt:0;if(p+=1,d=z,c=fe,u=ye,a=U,q){const ce=bS(X),te=typeof ce?.total=="number"&&ce.total>((M=we?.total)!=null?M:0);t.logPerf(te?"parse(stream)":"parse(sync)",it(it(it({rendererId:t.instanceMsgId,ms:Math.round(ai()-Q),nodes:U.length,contentLength:z.length,parseCommitCount:p,parseCoalescedCount:h,nodeReuseMs:J,signatureMs:(L=le?.signatureMs)!=null?L:0,stabilizeSignatureMs:(S=le?.stabilizeSignatureMs)!=null?S:0,primeSignatureMs:(I=le?.primeSignatureMs)!=null?I:0,signatureCallCount:(P=le?.signatureCallCount)!=null?P:0,stabilizeSignatureCallCount:(D=le?.stabilizeSignatureCallCount)!=null?D:0,primeSignatureCallCount:(W=le?.primeSignatureCallCount)!=null?W:0,stabilizeMs:ne},G??{}),ze?Object.fromEntries(_V.map(ue=>{var j;return[ue,(j=ze[ue])!=null?j:0]})):{}),ce?{streamMode:ce.lastMode,streamDelta:EV(ce,we),streamStats:ce}:{}))}return Dr(U)});return{effectiveCustomHtmlTags:_,effectiveCustomHtmlTagsSet:A,mdBase:g,mdInstance:v,mergedParseOptions:y,parsedNodes:k}}function $V(e){const{isClient:t}=e,n=Z(new Set),s=new Map,o=new Map,i=new Map;function r(c){if(!t)return;const u=i.get(c);u!=null&&(window.clearTimeout(u),i.delete(c))}function l(){if(t)for(const c of i.values())window.clearTimeout(c);i.clear()}function a(){n.value=new Set}return{visibleNodeIndices:n,nodeVisibilityHandles:s,nodeVisibilityWatchStops:o,nodeVisibilityFallbackTimers:i,clearVisibilityFallback:r,clearAllVisibilityFallbacks:l,markNodeVisible:function(c,u=!0){var d;u&&r(c),(function(p,h){if((m=(f=e.shouldTrackVisibleNodeIndices)==null?void 0:f.call(e))!=null&&!m)return;var f,m;const b=n.value,_=b.has(p);if(h){if(_)return;const v=new Set(b);return v.add(p),void(n.value=v)}if(!_)return;const g=new Set(b);g.delete(p),n.value=g})(c,u),u&&((d=e.onNodeMarkedVisible)==null||d.call(e,c))},resetNodeVisibleState:a,cleanupNodeVisibility:function(c){var u;if(e.shouldCleanupNodeVisibility&&!e.shouldCleanupNodeVisibility())return;for(const[p,h]of o.entries())p<c||(h(),o.delete(p));for(const[p,h]of s.entries())p<c||(h.destroy(),s.delete(p),r(p),(u=e.onNodeVisibilityCleaned)==null||u.call(e,p));for(const p of Array.from(i.keys()))p<c||r(p);if(!n.value.size)return;const d=new Set;for(const p of n.value)p<c&&d.add(p);n.value=d},destroyNodeVisibilityState:function(){a();for(const c of o.values())c();o.clear();for(const c of s.values())c.destroy();s.clear(),l()}}}function NV(e={}){const t=Z(""),n=Z(""),s=Z(!1),o=LU(e),i=()=>{const u=o.getSnapshot();t.value=u.source,n.value=u.visible,s.value=u.done},r=o.subscribe(i);i();const l=F(()=>Math.max(0,t.value.length-n.value.length)),a=F(()=>l.value===0),c=F(()=>s.value&&a.value);return V1()&&K1(()=>{r(),o.destroy()}),{source:t,visible:n,done:s,final:c,caughtUp:a,pendingChars:l,enqueue:u=>o.enqueue(u),finish:u=>o.finish(u),flush:()=>o.flush(),reset:u=>o.reset(u),pause:()=>o.pause(),resume:()=>o.resume()}}const AS=/auto|scroll|overlay/i;function LV(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return AS.test(t)||AS.test(n)}function OV(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 PV=je({name:"InfographicBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=F(()=>{var n,s;return g1((s=Ha(e.estimatedPreviewHeightPx))!=null?s:h1(String((n=e.node.code)!=null?n:"")))});return()=>cn("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?cn("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)"}},[cn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[cn("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),cn("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),cn("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},()=>cn("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,cn("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[cn("div",{class:"absolute inset-0"},[cn("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}),RV=je({name:"MermaidBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=F(()=>{var n,s;return m1((s=Ha(e.estimatedPreviewHeightPx))!=null?s:p1(String((n=e.node.code)!=null?n:"")))});return()=>cn("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?cn("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)"}},[cn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[cn("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),cn("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},()=>cn("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[cn("span",{class:"action-icon block"})])))]):null,cn("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)"}},[cn("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"}})])])}}),DV=["data-custom-id"],BV={class:"m-0 p-0"},FV=["data-probe"],HV=["data-node-index","data-node-type"],u3=un(je(Lt(it({},{name:"NodeRenderer"}),{__name:"NodeRenderer",props:{content:{},nodes:{},final:{type:Boolean},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},mode:{},htmlPolicy:{},viewportPriority:{type:Boolean},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:{},codeBlockLightTheme:{},codeBlockMonacoOptions:{},codeRenderer:{},renderCodeBlocksAsPre:{type:Boolean,default:void 0},codeBlockMinWidth:{},codeBlockMaxWidth:{},codeBlockProps:{},mermaidProps:{},d2Props:{},infographicProps:{},showTooltips:{type:Boolean,default:void 0},themes:{},langs:{},isDark:{type:Boolean},customId:{},indexKey:{},typewriter:{type:Boolean,default:!1},smoothStreaming:{type:[Boolean,String],default:"auto"},smoothStreamingOptions:{},parseCoalesceMs:{},fade:{type:Boolean,default:void 0},batchRendering:{type:Boolean,default:void 0},initialRenderBatchSize:{},renderBatchSize:{},renderBatchDelay:{},renderBatchBudgetMs:{},renderBatchIdleTimeoutMs:{},deferNodesUntilVisible:{type:Boolean,default:void 0},maxLiveNodes:{},liveNodeBuffer:{},nodeVirtual:{type:[Boolean,String],default:void 0},virtualScroll:{},renderAsFragment:{type:Boolean}},emits:["copy","handleArtifactClick","click","mouseover","mouseout","virtual-state-change","height-change","render-settled","render-final","anchor-change"],setup(e,{expose:t,emit:n}){const s=e,o=n,i=Ls(),r=Ut("markstreamNestedRendererProps",void 0);function l(C){var B,V;const K=s[C];return(function(ee){const he=i?.vnode.props;return!!he&&(Object.prototype.hasOwnProperty.call(he,ee)||Object.prototype.hasOwnProperty.call(he,String(ee).replace(/[A-Z]/g,ke=>`-${ke.toLowerCase()}`)))})(C)?K:(V=(B=r?.value)==null?void 0:B[C])!=null?V:K}const a={docs:{showTooltips:!0,fade:!0,batchRendering:!0,initialRenderBatchSize:40,renderBatchSize:80,renderBatchDelay:16,renderBatchBudgetMs:6,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:220,liveNodeBuffer:60,nodeVirtual:"auto"},chat:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:16,renderBatchSize:16,renderBatchDelay:8,renderBatchBudgetMs:4,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"},minimal:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:16,renderBatchSize:16,renderBatchDelay:8,renderBatchBudgetMs:4,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"}},c=F(()=>{return(C=l("mode"))==="chat"||C==="minimal"||C==="docs"?C:"docs";var C}),u=F(()=>{const C=l("renderCodeBlocksAsPre"),B=l("codeRenderer");return C===!0?"pre":B==="pre"||B==="shiki"||B==="monaco"?B:C===!1||c.value==="docs"?"monaco":"pre"}),d=F(()=>a[c.value]),p=F(()=>{var C;return(C=l("showTooltips"))!=null?C:d.value.showTooltips}),h=F(()=>{var C;return(C=l("fade"))!=null?C:d.value.fade}),f=F(()=>{var C;return(C=l("batchRendering"))!=null?C:d.value.batchRendering}),m=F(()=>{var C;return(C=l("initialRenderBatchSize"))!=null?C:d.value.initialRenderBatchSize}),b=F(()=>{var C;return(C=l("renderBatchSize"))!=null?C:d.value.renderBatchSize}),_=F(()=>{var C;return(C=l("renderBatchDelay"))!=null?C:d.value.renderBatchDelay}),g=F(()=>{var C;return(C=l("renderBatchBudgetMs"))!=null?C:d.value.renderBatchBudgetMs}),v=F(()=>{var C;return(C=l("renderBatchIdleTimeoutMs"))!=null?C:d.value.renderBatchIdleTimeoutMs}),y=F(()=>{var C;return(C=l("deferNodesUntilVisible"))!=null?C:d.value.deferNodesUntilVisible}),A=F(()=>{var C;return(C=l("maxLiveNodes"))!=null?C:d.value.maxLiveNodes}),O=F(()=>{var C;return(C=l("liveNodeBuffer"))!=null?C:d.value.liveNodeBuffer}),$=F(()=>{var C;return(C=l("nodeVirtual"))!=null?C:d.value.nodeVirtual}),k={get content(){return s.content},get nodes(){return s.nodes},get final(){return s.final},get parseOptions(){return l("parseOptions")},get customMarkdownIt(){return l("customMarkdownIt")},get debugPerformance(){return s.debugPerformance},get customHtmlTags(){return l("customHtmlTags")},get mode(){return l("mode")},get htmlPolicy(){return l("htmlPolicy")},get viewportPriority(){return l("viewportPriority")},get codeBlockStream(){return l("codeBlockStream")},get codeBlockDarkTheme(){return l("codeBlockDarkTheme")},get codeBlockLightTheme(){return l("codeBlockLightTheme")},get codeBlockMonacoOptions(){return l("codeBlockMonacoOptions")},get codeRenderer(){return l("codeRenderer")},get renderCodeBlocksAsPre(){return l("renderCodeBlocksAsPre")},get codeBlockMinWidth(){return l("codeBlockMinWidth")},get codeBlockMaxWidth(){return l("codeBlockMaxWidth")},get codeBlockProps(){return l("codeBlockProps")},get mermaidProps(){return l("mermaidProps")},get d2Props(){return l("d2Props")},get infographicProps(){return l("infographicProps")},get showTooltips(){return p.value},get themes(){return l("themes")},get langs(){return l("langs")},get isDark(){return l("isDark")},get customId(){return l("customId")},get indexKey(){return s.indexKey},get typewriter(){return l("typewriter")},get smoothStreaming(){return s.smoothStreaming},get smoothStreamingOptions(){return l("smoothStreamingOptions")},get parseCoalesceMs(){return l("parseCoalesceMs")},get fade(){return h.value},get batchRendering(){return f.value},get initialRenderBatchSize(){return m.value},get renderBatchSize(){return b.value},get renderBatchDelay(){return _.value},get renderBatchBudgetMs(){return g.value},get renderBatchIdleTimeoutMs(){return v.value},get deferNodesUntilVisible(){return y.value},get maxLiveNodes(){return A.value},get liveNodeBuffer(){return O.value},get nodeVirtual(){return $.value},get virtualScroll(){return s.virtualScroll},get renderAsFragment(){return s.renderAsFragment}};function E(C){o("height-change",C)}function M(C){o("virtual-state-change",C)}function L(C){o("anchor-change",C)}const S=Z(),I=Z(null),P=Z(null),D=Z(null),W=$s({1:null,2:null,3:null,4:null,5:null,6:null}),z=Z(!1),q=new Map,Q=Z(0),X=Z(0),fe=Z({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function ye(){var C,B;if(((C=s.virtualScroll)==null?void 0:C.enabled)!==!0)return null;const V=(B=s.virtualScroll)==null?void 0:B.scrollRoot;return Me(typeof V=="function"?V():V)}function Me(C){return C?typeof HTMLElement<"u"&&C instanceof HTMLElement?C:typeof C=="object"&&"value"in C?Me(C.value):typeof C=="object"&&"$el"in C?Me(C.$el):null:null}const{isClient:we,renderAsFragment:ze,debugPerformanceEnabled:Ue,resolvedShowTooltips:Fe,resolvedHtmlPolicy:rt,inheritedSmoothStreaming:le,ownsTypewriterCursor:U}=(function(C){const B=typeof window<"u",V=nd(),K=Ut("markstreamHtmlPolicy",void 0),ee=Ut("markstreamTypewriterCursor",void 0),he=Ut("markstreamSmoothStreaming",void 0),ke=F(()=>C.renderAsFragment===!0),Se=F(()=>!!(C.debugPerformance&&B&&typeof console<"u")),Pe=F(()=>{var De;if(typeof C.showTooltips=="boolean")return C.showTooltips;const $e=(De=V.showTooltips)!=null?De:V["show-tooltips"];return $e===""||$e===!0||$e==="true"||$e!==!1&&$e!=="false"&&void 0}),Ee=F(()=>{var De,$e;return($e=(De=C.htmlPolicy)!=null?De:K?.value)!=null?$e:"safe"}),We=F(()=>ee?.value!==!0);return{isClient:B,renderAsFragment:ke,debugPerformanceEnabled:Se,resolvedShowTooltips:Pe,resolvedHtmlPolicy:Ee,inheritedSmoothStreaming:he,inheritedTypewriterCursor:ee,ownsTypewriterCursor:We}})(k),{resolveViewportRoot:G,resolveScrollContainer:ne,isReverseFlexScrollRoot:H,getNormalizedScrollTop:J,getOffsetTopWithinRoot:ce}=(function(C,B){function V(){var Se,Pe;return(Pe=(Se=B.scrollRoot)==null?void 0:Se.call(B))!=null?Pe:null}function K(Se){if(typeof window>"u")return null;const Pe=V();if(Pe)return Pe;const Ee=Se??C.value;if(!Ee)return null;const We=Ee.ownerDocument||document,De=We.scrollingElement||We.documentElement;let $e=Ee;for(;$e&&$e!==We.body&&$e!==De;){if(LV(window.getComputedStyle($e))&&OV($e))return $e;$e=$e.parentElement}return null}function ee(Se){if(!B.isClient)return!1;try{const Pe=window.getComputedStyle(Se);return!!(Pe.display||"").toLowerCase().includes("flex")&&(Pe.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function he(Se,Pe,Ee){var We,De;if(Ee)return ke(Pe);const $e=Se.scrollTop;if(!ee(Se))return $e;const He=$e<0?-$e:$e;return Math.max(0,((We=Se.scrollHeight)!=null?We:0)-((De=Se.clientHeight)!=null?De:0))-He}function ke(Se){var Pe,Ee,We,De,$e;const He=Number((Pe=Se.scrollingElement)==null?void 0:Pe.scrollTop),Qe=Number((We=(Ee=Se.documentElement)==null?void 0:Ee.scrollTop)!=null?We:0),Ze=Number(($e=(De=Se.body)==null?void 0:De.scrollTop)!=null?$e:0);return Math.max(0,Number.isFinite(He)?He:0,Number.isFinite(Qe)?Qe:0,Number.isFinite(Ze)?Ze:0)}return{resolveViewportRoot:K,resolveScrollContainer:function(Se){var Pe,Ee,We,De;const $e=V();if($e)return $e;const He=K((Pe=Se??C.value)!=null?Pe:null);if(He)return He;const Qe=(De=(We=Se?.ownerDocument)!=null?We:(Ee=C.value)==null?void 0:Ee.ownerDocument)!=null?De:typeof document<"u"?document:null;return Qe?.scrollingElement||Qe?.documentElement||null},isReverseFlexScrollRoot:ee,getNormalizedScrollTop:he,getOffsetTopWithinRoot:function(Se,Pe){const Ee=Pe.ownerDocument||Se.ownerDocument||document;if((function(He,Qe){return He===Qe.documentElement||He===Qe.body||He===Qe.scrollingElement})(Pe,Ee))return Se.getBoundingClientRect().top+ke(Ee);const We=Pe.getBoundingClientRect(),De=Se.getBoundingClientRect(),$e=he(Pe,Ee,!1);return De.top-We.top+$e}}})(S,{isClient:we,scrollRoot:ye});En("markstreamShowTooltips",Fe),En("markstreamHtmlPolicy",rt),En("markstreamTypewriter",F(()=>k.typewriter!==!1)),En("markstreamFade",F(()=>k.fade!==!1)),En("markstreamTypewriterCursor",F(()=>!0)),En("markstreamTextStreamState",q),En("markstreamStreamVersion",Q),En("markstreamParseOptions",F(()=>k.parseOptions)),En("markstreamCustomMarkdownIt",F(()=>k.customMarkdownIt));const{smoothStreamingEnabled:te,renderContent:ue,effectiveFinal:j}=(function(C,B){const V=NV(C.smoothStreamingOptions),K=F(()=>{var Ee,We,De;return C.smoothStreaming!==!1&&!((Ee=C.nodes)!=null&&Ee.length)&&(C.smoothStreaming===!0||!((We=B.inheritedSmoothStreaming)!=null&&We.value))&&(C.smoothStreaming===!0||C.typewriter===!0||((De=C.maxLiveNodes)!=null?De:0)<=0)}),ee=Z(!B.isClient||C.smoothStreaming===!0);hn(()=>{ee.value=!0});const he=F(()=>ee.value&&K.value),ke=F(()=>{var Ee;return he.value?V.visible.value:(Ee=C.content)!=null?Ee:""}),Se=F(()=>{var Ee,We;const De=(Ee=C.parseOptions)!=null?Ee:{};return(We=C.final)!=null?We:De.final}),Pe=F(()=>{const Ee=Se.value;return he.value&&Ee!=null?!!Ee&&V.caughtUp.value:Ee});return Ke([()=>C.content,()=>C.nodes,he,Se],([Ee,We,De,$e])=>{if(We?.length)return void V.reset("");const He=Ee??"";if(!De)return V.reset(He),void($e&&V.finish({flush:!0}));const Qe=V.source.value;He?He===Qe||(He.startsWith(Qe)?V.enqueue(He.slice(Qe.length)):V.reset(He)):V.reset(""),$e&&V.finish()},{immediate:!0}),{smoothStream:V,smoothStreamingEligible:K,smoothStreamingEnabled:he,renderContent:ke,requestedFinal:Se,effectiveFinal:Pe}})(k,{isClient:we,inheritedSmoothStreaming:le});En("markstreamSmoothStreaming",te);const Y=Z(!1);let re="",ge=!1,Ae=null;function Ie(){we&&Ae!=null&&(window.clearTimeout(Ae),Ae=null)}function ae(){Y.value=!1,Ie()}function Te(C,B){if(!Ue.value)return;const V=(function(){if(!Ue.value)return null;const K=Tt(Ve),ee=Tt(tt),he=Math.max(kt,ee);if(K<=0&&he<=0)return null;const ke={total:K,maxPerFrame:he,byLabel:(Se=Ve,Object.fromEntries(Array.from(Se.entries()).sort((Pe,Ee)=>Ee[1]-Pe[1]||Pe[0].localeCompare(Ee[0]))))};var Se;return Ve.clear(),tt.clear(),kt=0,ke})();console.info(`[markstream-vue][perf] ${C}`,V?Lt(it({},B),{layoutReads:V}):B)}Ke([ue,()=>s.nodes,j],([C,B,V])=>{const K=C??"";return B?.length||V===!0?(ae(),re=K,void(ge=!0)):ge?(re&&K.length>re.length&&K.startsWith(re)?(Y.value=!0,we&&(Ie(),Ae=window.setTimeout(()=>{var ee;Ae=null,j.value===!0||(ee=s.nodes)!=null&&ee.length||(fa(),Y.value=!1,Pi())},1200))):(K.length<re.length||!K.startsWith(re))&&ae(),void(re=K)):(re=K,void(ge=!0))},{flush:"sync",immediate:!0});const Ve=new Map,tt=new Map;let bt=!1,kt=0;function Tt(C){let B=0;for(const V of C.values())B+=V;return B}function Pt(){kt=Math.max(kt,Tt(tt)),tt.clear(),bt=!1}function mt(C,B){return(function(V){var K,ee;Ue.value&&(Ve.set(V,((K=Ve.get(V))!=null?K:0)+1),tt.set(V,((ee=tt.get(V))!=null?ee:0)+1),bt||(bt=!0,we&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(Pt):typeof queueMicrotask!="function"?setTimeout(Pt,0):queueMicrotask(Pt)))})(C),B()}const Yt=k.customId?`renderer-${k.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,Rn=(function(C){const B=new Map;return{scope:C,cache:B,clear:()=>B.clear()}})(Yt),Dn=F(()=>`${Yt}:${Q.value}`);En(s3,Rn);const Ft=cs(()=>k.customId),{effectiveCustomHtmlTagsSet:bn,mergedParseOptions:Vn,parsedNodes:st}=IV(k,{instanceMsgId:Yt,renderContent:ue,effectiveFinal:j,smoothStreamingEnabled:te,debugPerformanceEnabled:Ue,customComponentsMap:Ft,logPerf:Te});Ke(st,()=>{Rn.clear(),Q.value+=1},{immediate:!0});const In=F(()=>({customId:k.customId,customHtmlTags:Vn.value.customHtmlTags,parseOptions:k.parseOptions,customMarkdownIt:k.customMarkdownIt,htmlPolicy:rt.value,viewportPriority:k.viewportPriority,mode:c.value,codeRenderer:u.value,codeBlockStream:k.codeBlockStream,codeBlockDarkTheme:k.codeBlockDarkTheme,codeBlockLightTheme:k.codeBlockLightTheme,codeBlockMonacoOptions:k.codeBlockMonacoOptions,renderCodeBlocksAsPre:k.renderCodeBlocksAsPre,codeBlockMinWidth:k.codeBlockMinWidth,codeBlockMaxWidth:k.codeBlockMaxWidth,codeBlockProps:k.codeBlockProps,mermaidProps:k.mermaidProps,d2Props:k.d2Props,infographicProps:k.infographicProps,showTooltips:Fe.value,themes:k.themes,langs:k.langs,isDark:k.isDark,typewriter:k.typewriter,smoothStreamingOptions:k.smoothStreamingOptions,parseCoalesceMs:k.parseCoalesceMs,fade:k.fade}));En("markstreamNestedRendererProps",In);const _n=F(()=>st.value),Kn=F(()=>st.value.length),$n=Z(null),Ge=Z(null),Ye=Z(null),Ct=Z(null),$t=s.indexKey!=null&&String(s.indexKey).startsWith("list-item-"),mn=!$t&&k.customId?hS(k.customId):null,Nn=F(()=>mn?(pS.value,hS(k.customId)):null),tn=F(()=>{var C;return!!(we&&!ze.value&&k.customId&&!$t&&((C=Nn.value)!=null&&C.enabled))}),Ln=F(()=>{var C;return!!(!ze.value&&((C=s.virtualScroll)!=null&&C.enabled))}),Zn=Z(!1);hn(()=>{Zn.value=!0});const Mt=F(()=>!!(we&&Ln.value));En("markstreamHostScrollManaged",Mt);const us=F(()=>!!(Zn.value&&Mt.value)),Xt=F(()=>tn.value||Mt.value),oi=F(()=>tn.value||us.value),bs=F(()=>{var C;return Xt.value&&((C=Nn.value)==null?void 0:C.textEstimation)!==!1}),Do=F(()=>{var C;return Xt.value&&((C=Nn.value)==null?void 0:C.codeBlockEstimation)!==!1});function so(){const C=X.value||mt("getMeasuredContainerWidth.clientWidth",()=>{var B;return((B=S.value)==null?void 0:B.clientWidth)||0});return Number.isFinite(C)&&C>0?C:0}const qs=F(()=>{const C=so();return C>0?Math.max(1,Math.round(C)):640}),oo=F(()=>{var C;return Math.max(1,(C=k.maxLiveNodes)!=null?C:320)}),Nt=F(()=>{var C;return!ze.value&&k.nodeVirtual!==!1&&!(((C=k.maxLiveNodes)!=null?C:0)<=0)&&(k.nodeVirtual===!0?st.value.length>0:st.value.length>oo.value)}),Xe=F(()=>Nt.value||tn.value||Mt.value),ot=F(()=>k.viewportPriority!==!1&&!z.value),de=yj(C=>{var B;return G((B=C??S.value)!=null?B:null)},ot),{requestFrame:pe,cancelFrame:Oe,hasIdleCallback:Qt,isTestEnv:Wt}=(function(C){const B=C.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,V=C.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,K=C.isClient&&typeof window.requestIdleCallback=="function",ee=(function(){var he;if(typeof globalThis>"u"||!("process"in globalThis))return;const ke=(he=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:he.value;return ke?.env})();return{requestFrame:B,cancelFrame:V,hasIdleCallback:K,isTestEnv:ee?.NODE_ENV==="test"}})({isClient:we}),{resolvedBatchSize:ds,resolvedInitialBatch:Bn,batchingEnabled:bo,incrementalRenderingActive:ii,renderedCount:_s,previousRenderContext:ta,adaptiveBatchSize:ll,previousBatchConfig:al}=(function(C,B){var V;const K=F(()=>{var De;const $e=Math.trunc((De=C.renderBatchSize)!=null?De:80);return Number.isFinite($e)?Math.max(0,$e):0}),ee=F(()=>{var De;const $e=Math.trunc((De=C.initialRenderBatchSize)!=null?De:K.value);return Number.isFinite($e)?Math.max(0,$e):K.value}),he=F(()=>!B.renderAsFragment.value&&C.batchRendering!==!1&&K.value>0&&B.isClient&&!B.isTestEnv),ke=Z(0),Se=Z({key:C.indexKey,total:0}),Pe=Z(Math.max(1,K.value||1)),Ee=F(()=>{var De;return he.value&&((De=C.maxLiveNodes)!=null?De:0)<=0}),We=Z({batchSize:K.value,initial:ee.value,delay:(V=C.renderBatchDelay)!=null?V:16,enabled:Ee.value});return{resolvedBatchSize:K,resolvedInitialBatch:ee,batchingEnabled:he,incrementalRenderingActive:Ee,renderedCount:ke,previousRenderContext:Se,adaptiveBatchSize:Pe,previousBatchConfig:We}})(k,{isClient:we,isTestEnv:Wt,renderAsFragment:ze}),Os=new Map,ft=new Map,me=new WeakMap;let Ne=null;const xn=new WeakMap,ws=new Map,se=Z(0),Ce=F(()=>(se.value,Array.from(Os.entries()).sort((C,B)=>C[0]-B[0]))),xe=Z(null),Be=Z(null);let et=null,at=0,Ot=null;const{activeRestoreAnchor:Vt,getRelativeScrollTopWithinContainer:qt,setRelativeScrollTopWithinContainer:Bo,resolveAnchorOffset:Fo,clearRestoreReconcile:nn,scheduleRestoreReconcile:Jn,captureRestoreAnchor:Fn,restoreAnchor:Ss,getAnchorDrift:Ps}=(function(C){const{isClient:B,containerRef:V,parsedNodeCount:K,requestFrame:ee,cancelFrame:he,resolveScrollContainer:ke,getNormalizedScrollTop:Se,getOffsetTopWithinRoot:Pe,isReverseFlexScrollRoot:Ee,estimateIndexForOffset:We,estimateHeightRange:De,getFallbackNodeHeight:$e,clamp:He}=C,Qe=Z(null);let Ze=null,_t=[];function lt(){const xt=ke(),Bt=V.value;if(!xt||!Bt)return null;const Rt=xt.ownerDocument||Bt.ownerDocument||document;if(xt===Rt.documentElement||xt===Rt.body||xt===Rt.scrollingElement){const ln=Bt.getBoundingClientRect();return Math.max(0,-ln.top)}return Math.max(0,Se(xt,Rt,!1)-Pe(Bt,xt))}function ct(xt){var Bt;const Rt=ke(),ln=V.value;if(!Rt||!ln)return;const Co=Math.max(0,xt),js=Rt.ownerDocument||ln.ownerDocument||document,ri=js.defaultView||(typeof window<"u"?window:null);if(Rt===js.documentElement||Rt===js.body||Rt===js.scrollingElement){const hr=Se(Rt,js,!0)+ln.getBoundingClientRect().top;return void((Bt=ri?.scrollTo)==null||Bt.call(ri,0,Math.max(0,hr+Co)))}vS(Rt,js,Pe(ln,Rt)+Co,{isReverseFlexScrollRoot:hr=>{var mr;return(mr=Ee?.(hr))!=null&&mr},getNormalizedScrollTop:Se})}function St(xt){const Bt=K.value,Rt=He(xt.nodeIndex,0,Math.max(0,Bt-1));return De(0,Rt)+Math.max(0,xt.offsetWithinNodePx)}function wt(){if(Ze!=null&&(he?.(Ze),Ze=null),B)for(const xt of _t)window.clearTimeout(xt);_t=[]}function Zt(xt){const Bt=St(xt),Rt=lt();Rt!=null&&Math.abs(Rt-Bt)<=.5||ct(Bt)}return{activeRestoreAnchor:Qe,getRelativeScrollTopWithinContainer:lt,setRelativeScrollTopWithinContainer:ct,resolveAnchorOffset:St,clearRestoreReconcile:wt,applyRestoreAnchor:Zt,scheduleRestoreReconcile:function(){Qe.value&&B&&Ze==null&&(Ze=ee?ee(()=>{Ze=null,Qe.value&&Zt(Qe.value)}):null,Ze==null&&Qe.value&&Zt(Qe.value))},captureRestoreAnchor:function(){const xt=lt(),Bt=K.value;if(xt==null||Bt<=0)return null;const Rt=He(We(xt+1),0,Bt-1),ln=De(0,Rt),Co=$e(Rt);return{nodeIndex:Rt,offsetWithinNodePx:He(xt-ln,0,Math.max(0,Co-1))}},restoreAnchor:function(xt){const Bt=K.value;if(Qe.value={nodeIndex:He(xt.nodeIndex,0,Math.max(0,Bt-1)),offsetWithinNodePx:Math.max(0,xt.offsetWithinNodePx)},wt(),Zt(Qe.value),B)for(const Rt of[0,120,280,480])_t.push(window.setTimeout(()=>{Qe.value&&Zt(Qe.value)},Rt))},getAnchorDrift:function(xt){const Bt=lt();return Bt==null?null:Bt-St(xt)}}})({isClient:we,containerRef:S,parsedNodeCount:Kn,requestFrame:pe,cancelFrame:Oe,resolveScrollContainer:()=>xe.value||ne(),getNormalizedScrollTop:J,getOffsetTopWithinRoot:ce,isReverseFlexScrollRoot:H,estimateIndexForOffset:Em,estimateHeightRange:pr,getFallbackNodeHeight:Cd,clamp:As}),{nodeHeights:fs,heightStats:Cs,heightTreeSize:cl,heightSumTree:jh,heightKnownTree:Vh,averageNodeHeight:yi,resetHeightMeasurements:T4,pruneHeightMeasurements:M4,rebuildHeightTrees:md,recordNodeHeight:E4,removeNodeHeights:I4,exportHeightCache:$4,importHeightCache:N4,fenwickRangeSum:gd}=(function(C={}){const B=$s({}),V=$s({total:0,count:0}),K=Z(0),ee=Z([]),he=Z([]);function ke(){for(const $e of Object.keys(B))delete B[Number($e)];V.total=0,V.count=0,K.value=0,ee.value=[],he.value=[]}function Se($e,He,Qe){for(let Ze=He+1;Ze<$e.length;Ze+=Ze&-Ze)$e[Ze]+=Qe}function Pe($e,He){let Qe=0;for(let Ze=He+1;Ze>0;Ze-=Ze&-Ze)Qe+=$e[Ze];return Qe}function Ee($e){K.value=$e;const He=new Array($e+1).fill(0),Qe=new Array($e+1).fill(0);for(const[Ze,_t]of Object.entries(B)){const lt=Number(Ze),ct=Number(_t);!Number.isFinite(lt)||lt<0||lt>=$e||!Number.isFinite(ct)||ct<=0||(Se(He,lt,ct),Se(Qe,lt,1))}ee.value=He,he.value=Qe}function We($e){if(!Number.isInteger($e)||$e<0)return!1;const He=B[$e];if(!Number.isFinite(He)||He<=0)return!1;if(delete B[$e],V.total=Math.max(0,V.total-He),V.count=Math.max(0,V.count-1),K.value>$e){const Qe=ee.value,Ze=he.value;Qe.length&&Ze.length&&(Se(Qe,$e,-He),Se(Ze,$e,-1))}return!0}const De=F(()=>V.count>0?Math.max(12,V.total/V.count):32);return{nodeHeights:B,heightStats:V,heightTreeSize:K,heightSumTree:ee,heightKnownTree:he,averageNodeHeight:De,resetHeightMeasurements:ke,pruneHeightMeasurements:function($e){if($e<=0)return void ke();let He=0,Qe=0;for(const[Ze,_t]of Object.entries(B)){const lt=Number(Ze),ct=Number(_t);!Number.isFinite(lt)||lt<0||lt>=$e||!Number.isFinite(ct)||ct<=0?delete B[lt]:(He+=ct,Qe++)}V.total=He,V.count=Qe},rebuildHeightTrees:Ee,recordNodeHeight:function($e,He,Qe={}){(function(Ze,_t,lt={}){var ct;if(!Number.isFinite(_t)||_t<=0)return!1;const St=B[Ze];if(St&&(lt.allowShrink===!1&&_t<St||Math.abs(_t-St)<=1))return!1;if(B[Ze]=_t,St?V.total+=_t-St:(V.total+=_t,V.count++),K.value>Ze){const wt=ee.value,Zt=he.value;if(wt.length&&Zt.length)if(St){const xt=_t-St;xt!==0&&Se(wt,Ze,xt)}else Se(wt,Ze,_t),Se(Zt,Ze,1)}lt.notify!==!1&&((ct=C.onHeightRecorded)==null||ct.call(C))})($e,He,Lt(it({},Qe),{notify:!0}))},removeNodeHeight:function($e,He={}){var Qe;const Ze=We($e);return Ze&&He.notify!==!1&&((Qe=C.onHeightRecorded)==null||Qe.call(C)),Ze},removeNodeHeights:function($e,He={}){var Qe;let Ze=0;for(const _t of $e)We(Number(_t))&&Ze++;return Ze>0&&He.notify!==!1&&((Qe=C.onHeightRecorded)==null||Qe.call(C)),Ze},exportHeightCache:function(){return Object.entries(B).map(([$e,He])=>({index:Number($e),height:Number(He)})).filter($e=>Number.isFinite($e.index)&&$e.index>=0&&Number.isFinite($e.height)&&$e.height>0).sort(($e,He)=>$e.index-He.index)},importHeightCache:function($e,He={}){var Qe;if(!Array.isArray($e))return;const Ze=K.value;let _t=!1;if(He.mode!=="merge"){const lt=Object.keys(B);if(lt.length>0){for(const ct of lt)delete B[Number(ct)];_t=!0}}for(const lt of $e){const ct=Number(lt.index),St=Number(lt.height);if(!Number.isInteger(ct)||ct<0||Ze>0&&ct>=Ze||!Number.isFinite(St)||St<=0)continue;const wt=B[ct];wt&&Math.abs(wt-St)<=1||(B[ct]=St,_t=!0)}_t&&((function(){let lt=0,ct=0;const St=K.value;for(const[wt,Zt]of Object.entries(B)){const xt=Number(wt),Bt=Number(Zt);!Number.isFinite(xt)||xt<0||St>0&&xt>=St||!Number.isFinite(Bt)||Bt<=0?delete B[xt]:(lt+=Bt,ct++)}V.total=lt,V.count=ct})(),Ze>0&&Ee(Ze),(Qe=C.onHeightRecorded)==null||Qe.call(C))},fenwickRangeSum:function($e,He,Qe){if(Qe<=He)return 0;const Ze=Pe($e,Qe-1);return He<=0?Ze:Ze-Pe($e,He-1)}}})({onHeightRecorded:()=>{Wo(),Mt.value&&Dc(),Vt.value&&Jn(),Be.value&&ca(),An("node-resize")}});function vd(){T4(),ws.clear()}function By(C){!Number.isInteger(C)||C<0||C>=st.value.length||ws.set(C,Ac(C))}function Fy(C,B,V={}){const K=fs[C];E4(C,B,V);const ee=fs[C];ee&&ee>0?By(C):K&&ws.delete(C)}function Hy(C,B){const V=mt("getNodeLayoutHeight.slot.offsetHeight",()=>{var K,ee;return(ee=(K=Os.get(C))==null?void 0:K.offsetHeight)!=null?ee:0});return V>0?V:mt("getNodeLayoutHeight.content.offsetHeight",()=>B.offsetHeight)}function Wy(C,B={}){N4(C,B),bm()}const cr=F(()=>{var C;return!ze.value&&k.deferNodesUntilVisible!==!1&&!(((C=k.maxLiveNodes)!=null?C:0)<=0)&&!Nt.value&&!(st.value.length>900)&&ot.value}),zy=F(()=>!!de&&(cr.value||Nt.value)),Uy=F(()=>Nt.value||Mt.value),{liveNodeBufferResolved:wc,focusIndex:Ho,liveRange:xs,updateLiveRange:ul}=(function(C,B){const{parsedNodeCount:V,virtualizationEnabled:K,maxLiveNodesResolved:ee,clamp:he}=B,ke=F(()=>{var Ee;return Math.max(0,(Ee=C.liveNodeBuffer)!=null?Ee:60)}),Se=Z(0),Pe=$s({start:0,end:0});return{liveNodeBufferResolved:ke,focusIndex:Se,liveRange:Pe,updateLiveRange:function(){const Ee=V.value;if(!K.value||Ee===0)return Pe.start=0,void(Pe.end=Ee);const We=Math.min(ee.value,Ee),De=ke.value,$e=he(Se.value-De,0,Math.max(0,Ee-We));Pe.start=$e,Pe.end=Math.min(Ee,$e+We)}}})(k,{parsedNodeCount:Kn,virtualizationEnabled:Nt,maxLiveNodesResolved:oo,clamp:As}),ki=new Map,dl=new Map,ur=new Map,yd=[],Li=new Map,dr=new Set,qy=Z(0);let Kh=!1;const jy=F(()=>(qy.value,dr.size)),_o=new Map,bi=new Map,Vy=Z(0),Gh=F(()=>{Vy.value;let C=0;for(const B of _o.values())C+=Math.max(0,B);return C});let wo=null,Yh=!0,Ky=[0],Gy="";function Wo(){Yh=!0}const kd=F(()=>{if(!Nt.value)return st.value.length;const C=wc.value,B=Math.max(xs.end+C,Bn.value),V=Math.min(st.value.length,B);return Math.max(_s.value,V)});function bd(){Kh||(Kh=!0,queueMicrotask(()=>{Kh=!1,qy.value+=1}))}function Yy(C,B,V="node-resize"){if(!we||typeof window>"u")return null;const K=window.setTimeout(()=>{dr.delete(K)&&bd();try{B()}finally{An(V)}},Math.max(0,C));return dr.add(K),bd(),K}function _d(C){we&&C!=null&&(dr.delete(C)&&bd(),window.clearTimeout(C))}function Xy(){if(we&&typeof window<"u")for(const C of dr)window.clearTimeout(C);dr.size&&(dr.clear(),bd()),yd.length=0,ur.clear()}function L4(C){var B,V;return(V=(B=Ct.value)==null?void 0:B[C])!=null?V:null}const{cancelScheduledFocusSync:Xh,scheduleFocusSync:_i}=(function(C){const{isClient:B,containerRef:V,virtualizationEnabled:K,requestFrame:ee,cancelFrame:he,syncFocusToScroll:ke}=C;let Se=null;function Pe(){var We,De,$e;return($e=(De=(We=V.value)==null?void 0:We.ownerDocument)==null?void 0:De.defaultView)!=null?$e:typeof window<"u"?window:null}function Ee(){if(!Se)return;const We=Pe();Se.viaTimeout?We?We.clearTimeout(Se.id):clearTimeout(Se.id):he?.(Se.id),Se=null}return{cancelScheduledFocusSync:Ee,scheduleFocusSync:function(We={}){if(!K.value)return;if(!B)return void ke(!0);if(We.immediate)return Ee(),void ke(!0);if(Se)return;const De=()=>{Se=null,ke()};if(ee)return void(Se={id:ee(De),viaTimeout:!1});const $e=Pe();Se={id:$e?$e.setTimeout(De,16):setTimeout(De,16),viaTimeout:!0}}}})({isClient:we,containerRef:S,virtualizationEnabled:Nt,requestFrame:pe,cancelFrame:Oe,syncFocusToScroll:function(C=!1){var B;if(!Nt.value)return;const V=xe.value||ne();if(!V)return;const K=V.ownerDocument||((B=S.value)==null?void 0:B.ownerDocument)||document,ee=K?.defaultView||(typeof window<"u"?window:null),he=V===K?.documentElement||V===K?.body,ke=st.value.length;if(!he&&ke>0&&H(V)){const Qe=mt("syncFocusToScroll.clientHeight",()=>V.clientHeight||0),Ze=mt("syncFocusToScroll.scrollTop",()=>V.scrollTop),_t=Ze<0?-Ze:Ze,lt=(function(St){var wt,Zt;const xt=st.value;if(!xt.length)return 0;if(St<=0)return Math.max(0,xt.length-1);if(Xt.value){const Rt=(wt=tm()[xt.length])!=null?wt:0;return ok(Math.max(0,Rt-St))}if(cl.value===xt.length){const Rt=pr(0,xt.length);return Em(Math.max(0,Rt-St))}let Bt=St;for(let Rt=xt.length-1;Rt>=0;Rt--){const ln=(Zt=fs[Rt])!=null?Zt:yi.value;if(Bt<=ln)return Rt;Bt-=ln}return 0})(Math.max(0,_t)+.5*Math.max(0,Qe)),ct=As(lt,0,Math.max(0,ke-1));return void((C||Math.abs(ct-Ho.value)>1)&&(Ho.value=ct,ul()))}const Se=he?null:mt("syncFocusToScroll.root.getBoundingClientRect",()=>V.getBoundingClientRect()),Pe=he?0:Se.top,Ee=he?mt("syncFocusToScroll.viewport.clientHeight",()=>{var Qe,Ze;return(Ze=(Qe=ee?.innerHeight)!=null?Qe:V.clientHeight)!=null?Ze:0}):Se.bottom,We=Ce.value;let De=null,$e=null;for(const[Qe,Ze]of We){if(!Ze)continue;const _t=mt("syncFocusToScroll.slot.getBoundingClientRect",()=>Ze.getBoundingClientRect());_t.bottom<=Pe||_t.top>=Ee||(De==null&&(De=Qe),$e=Qe)}if(De==null||$e==null){const Qe=S.value;if(!Qe)return;const Ze=he?{top:0}:mt("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>V.getBoundingClientRect()),_t=mt("syncFocusToScroll.fallback.scrollTop",()=>J(V,K,he)),lt=he?(()=>{const wt=mt("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>Qe.getBoundingClientRect()),Zt=(he?0:Ze.top)-wt.top;return Math.max(0,Zt)})():(()=>{const wt=ce(Qe,V);return Math.max(0,_t-wt)})(),ct=he?mt("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var wt,Zt,xt,Bt;return(Bt=(xt=(Zt=ee?.innerHeight)!=null?Zt:(wt=K?.documentElement)==null?void 0:wt.clientHeight)!=null?xt:V.clientHeight)!=null?Bt:0}):mt("syncFocusToScroll.fallback.root.clientHeight",()=>V.clientHeight),St=Em(lt+.5*Math.max(0,ct));return Ho.value=As(St,0,Math.max(0,st.value.length-1)),void ul()}const He=Math.round((De+$e)/2);!C&&Math.abs(He-Ho.value)<=1||(Ho.value=As(He,0,Math.max(0,st.value.length-1)),ul())}}),{visibleNodeIndices:Qh,nodeVisibilityHandles:na,nodeVisibilityWatchStops:wd,nodeVisibilityFallbackTimers:Qy,clearVisibilityFallback:Sd,markNodeVisible:fr,cleanupNodeVisibility:O4,destroyNodeVisibilityState:Zh}=$V({isClient:we,shouldTrackVisibleNodeIndices:()=>cr.value,shouldCleanupNodeVisibility:()=>Nt.value,onNodeMarkedVisible:C=>{Nt.value?_i():Ho.value=As(C,0,Math.max(0,st.value.length-1))},onNodeVisibilityCleaned:C=>{Os.delete(C)&&Ak()}}),{cleanupScrollListener:Zy,setupScrollListener:P4}=(function(C){const{isClient:B,virtualizationEnabled:V,listenerEnabled:K,scrollRootElement:ee,resolveScrollContainer:he,scheduleFocusSync:ke,onScroll:Se}=C;let Pe=null,Ee=null;function We(){Pe&&(Pe(),Pe=null),Ee=null,ee.value=null}function De($e){const He=C.getScrollTop?C.getScrollTop($e):$e.scrollTop;return Math.max(0,Number.isFinite(He)?Math.abs(He):0)}return{cleanupScrollListener:We,setupScrollListener:function(){if(!B)return;if(!(($e=K?.value)!=null?$e:V.value))return void We();var $e;const He=he();if(!He)return void We();if(ee.value===He&&Pe)return;We(),Ee=De(He);const Qe=()=>{if(Se?.(),V.value){const Ze=(function(_t){const lt=De(_t),ct=Ee;Ee=lt;const St=Math.max(480,.75*(_t.clientHeight||0));return ct==null?lt>St?{immediate:!0}:void 0:Math.abs(lt-ct)>St?{immediate:!0}:void 0})(He);Ze?ke(Ze):ke()}};He.addEventListener("scroll",Qe,{passive:!0}),ee.value=He,Pe=()=>{He.removeEventListener("scroll",Qe)}}}})({isClient:we,virtualizationEnabled:Nt,listenerEnabled:Uy,scrollRootElement:xe,resolveScrollContainer:ne,scheduleFocusSync:_i,onScroll:function(){const C=Be.value;if(!C)return;const B=xc();if(!B||(function(K){if($c()>=at)return Ot=null,!1;const ee=Ot;if(ee==null)return!0;const he=Math.abs(K.scrollTop-ee)<=2;return he||(Ot=null),he})(B))return;const V=pk(B);V!=null?(V<-32||Math.abs(Math.max(0,V)-Math.max(0,C.distanceFromBottomPx))>32)&&aa("restore"):aa("restore")},getScrollTop:C=>{var B;const V=C.ownerDocument||((B=S.value)==null?void 0:B.ownerDocument)||document,K=C===V.documentElement||C===V.body||C===V.scrollingElement;return mt("scrollListener.getScrollTop",()=>J(C,V,K))}});function As(C,B,V){return Math.min(Math.max(C,B),V)}function Jh(C){return C?.firstElementChild}function Jy(C,B){var V;return C?(V=C.matches)!=null&&V.call(C,B)?C:C.querySelector(B):null}function ek(){if(!Xt.value)return void(X.value=0);const C=mt("updateExperimentContainerWidth.clientWidth",()=>{var B,V;return(V=(B=S.value)==null?void 0:B.clientWidth)!=null?V:0});X.value=C>0?C:0}let Sc=null;function em(){Sc?.disconnect(),Sc=null}const tk=ui({loader:()=>zn(null,null,function*(){return(yield Xs(()=>import("./index8-B6k25jtU.js"),__vite__mapDeps([7,6]))).default}),loadingComponent:XM,delay:0,suspensible:!1});function nk(C){return C===tk}const sk=F(()=>u.value==="pre"?xo:u.value==="shiki"?tk:Dg),fl=F(()=>{const C=st.value;if(!C.length||!Xt.value)return C.map(()=>null);const B=X.value||mt("estimatedNodeHeights.clientWidth",()=>{var V;return((V=S.value)==null?void 0:V.clientWidth)||0});return!Number.isFinite(B)||B<=0?C.map(()=>null):C.map((V,K)=>{const ee=fs[K],he=typeof ee=="number"&&ee>0;if(bs.value&&!he){const Se=n3(V,B,fe.value);if(Se)return Se}if(Do.value&&V.type==="code_block"){const Se=(function(Pe){if(Pe.type!=="code_block")return null;const Ee=Fk(Pe,$d(Pe));return nk(Ee)?"markdown":Ee===xo?"pre":Ee===sk.value||Ee===Dg?"monaco":null})(V);if(Se==="monaco"||Se==="markdown"||Se==="pre")return gV(V,{rendererKind:Se,monacoOptions:k.codeBlockMonacoOptions,showHeader:((ke=k.codeBlockProps)==null?void 0:ke.showHeader)!==!1})}var ke;return null})});function Cd(C){var B;const V=fs[C];if(Number.isFinite(V)&&V>0)return V;const K=(B=fl.value[C])==null?void 0:B.height;return Number.isFinite(K)&&K>0?K:Math.max(yi.value,(function(ee){var he,ke,Se,Pe,Ee,We,De,$e,He,Qe,Ze,_t,lt;const ct=st.value[ee];if(!ct||typeof ct!="object")return 32;const St=String((he=ct.type)!=null?he:""),wt=so()||640;switch(St){case"heading":return 44;case"paragraph":return sa(String((Se=(ke=ct.raw)!=null?ke:ct.content)!=null?Se:""),wt,34);case"list":{const Zt=Array.isArray(ct.items)?ct.items.length:1;return Math.max(48,30*Zt+12)}case"list_item":return sa(String((Ee=(Pe=ct.raw)!=null?Pe:ct.content)!=null?Ee:""),wt,34);case"blockquote":return sa(String((De=(We=ct.raw)!=null?We:ct.content)!=null?De:""),wt,56);case"table":{const Zt=Array.isArray(ct.rows)?ct.rows.length:Array.isArray(ct.children)?ct.children.length:3;return Math.max(120,38*Zt+48)}case"code_block":return sa(String((He=($e=ct.code)!=null?$e:ct.raw)!=null?He:""),wt,96,20);case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return sa(String((Ze=(Qe=ct.raw)!=null?Qe:ct.content)!=null?Ze:""),wt,96);case"thematic_break":return 24;default:return sa(String((lt=(_t=ct.raw)!=null?_t:ct.content)!=null?lt:""),wt,40)}})(C))}function sa(C,B,V,K=22){const ee=String(C??"");if(!ee)return V;const he=Math.max(18,Math.floor(Math.max(320,B)/8)),ke=ee.split(/\r?\n/).length,Se=Math.ceil(ee.length/he),Pe=Math.max(1,ke,Se);return Math.max(V,Math.ceil(Pe*K+12))}function Cc(C){const B=Number(C);return!Number.isFinite(B)||B<=0?-1:Math.round(B/32)}function tm(){var C,B;const V=st.value.length,K=Cc(X.value||mt("getFallbackHeightPrefix.clientWidth",()=>{var Se;return((Se=S.value)==null?void 0:Se.clientWidth)||0})),ee=((C=s.virtualScroll)==null?void 0:C.measurementKey)==null?"":String(s.virtualScroll.measurementKey),he=[V,Cs.count,Math.round(Cs.total),Math.round(100*yi.value),ee,K,Xt.value?1:0,pS.value,Q.value].join(":");if(!Yh&&Gy===he)return Ky;const ke=new Array(V+1);ke[0]=0;for(let Se=0;Se<V;Se++)ke[Se+1]=ke[Se]+(Xt.value?Cd(Se):(B=fs[Se])!=null?B:yi.value);return Ky=ke,Gy=he,Yh=!1,ke}function ok(C){var B,V;const K=st.value.length;if(K<=0||C<=0)return 0;const ee=tm();if(C>=((B=ee[K])!=null?B:0))return K-1;let he=0,ke=K-1,Se=K-1;for(;he<=ke;){const Pe=he+ke>>1;((V=ee[Pe+1])!=null?V:0)>=C?(Se=Pe,ke=Pe-1):he=Pe+1}return Se}function pr(C,B){var V,K;if(C>=B)return 0;if(Xt.value)return(function(ke,Se){var Pe,Ee;const We=st.value.length,De=As(Math.trunc(ke),0,We),$e=As(Math.trunc(Se),De,We);if(De>=$e)return 0;const He=tm();return((Pe=He[$e])!=null?Pe:0)-((Ee=He[De])!=null?Ee:0)})(C,B);if(cl.value!==st.value.length){let ke=0;for(let Se=C;Se<B;Se++)ke+=(V=fs[Se])!=null?V:yi.value;return ke}const ee=jh.value,he=Vh.value;if(!ee.length||!he.length){let ke=0;for(let Se=C;Se<B;Se++)ke+=(K=fs[Se])!=null?K:yi.value;return ke}return gd(ee,C,B)+(B-C-gd(he,C,B))*yi.value}Ke(()=>st.value.length,C=>{Wo(),C<=0?vd():(C<cl.value&&M4(C),C!==cl.value&&md(C))},{immediate:!0});const R4=F(()=>{if(!Nt.value)return st.value.map((K,ee)=>({node:K,index:ee}));const C=st.value.length,B=As(xs.start,0,C),V=As(xs.end,B,C);return st.value.slice(B,V).map((K,ee)=>({node:K,index:B+ee}))}),nm=F(()=>Nt.value?pr(0,Math.min(xs.start,st.value.length)):0),sm=F(()=>{if(!Nt.value)return 0;const C=st.value.length;return pr(Math.min(xs.end,C),C)});function ik(){if(!Xt.value)return 0;let C=0;const B=fl.value;for(let V=0;V<B.length;V++){if(!B[V])continue;const K=fs[V];Number.isFinite(K)&&K>0||C++}return C}function rk(){const C=st.value.length;return{totalNodes:C,measuredCount:Cs.count,estimatedCount:ik(),averageNodeHeight:yi.value,topSpacerHeight:nm.value,bottomSpacerHeight:sm.value,estimatedTotalHeight:pr(0,C),width:pl()}}function D4(){const C=st.value,B=rk();return Lt(it({},B),{probe:{paragraphReady:!!fe.value.paragraph,listItemReady:!!fe.value.listItem,listWrapperOverhead:fe.value.listWrapperOverhead,headingReadyLevels:Object.entries(fe.value.headings).filter(([,V])=>!!V).map(([V])=>Number(V))},nodes:C.map((V,K)=>{var ee,he,ke,Se,Pe,Ee,We,De,$e;return{index:K,type:V.type,estimateKind:(he=(ee=fl.value[K])==null?void 0:ee.kind)!=null?he:null,rendererKind:(Se=(ke=fl.value[K])==null?void 0:ke.rendererKind)!=null?Se:null,estimatedHeight:(Ee=(Pe=fl.value[K])==null?void 0:Pe.height)!=null?Ee:null,estimatedContentHeight:(De=(We=fl.value[K])==null?void 0:We.contentHeight)!=null?De:null,measuredHeight:($e=fs[K])!=null?$e:null}})})}function om(){return s.indexKey!=null?String(s.indexKey):Ln.value?`virtual-${On()}`:"markdown-renderer"}function lk(C){const B=String(C),V=`${om()}-`;if(!B.startsWith(V))return null;const K=B.slice(V.length).match(/^(\d+)(?:$|-)/);if(!K)return null;const ee=Number(K[1]);return!Number.isInteger(ee)||ee<0||ee>=st.value.length?null:ee}function On(){var C,B,V;const K=(C=s.virtualScroll)==null?void 0:C.sessionKey;return String(K!=null&&K!==""?K:(V=(B=s.indexKey)!=null?B:k.customId)!=null?V:Yt)}function ps(){var C;const B=(C=s.virtualScroll)==null?void 0:C.threadKey;return B==null||B===""?void 0:String(B)}function im(C){var B;return(C??"")===((B=ps())!=null?B:"")}function B4(){var C;const B=(C=s.virtualScroll)==null?void 0:C.measurementKey;return B==null?"":String(B)}function F4(){var C,B;const V=u.value,K=V==="monaco"?k.codeBlockMonacoOptions:void 0,ee=k.codeBlockProps,he=V==="shiki";return[k.isDark?"dark":"light",V==="monaco"?"code-rich":V==="pre"?"code-pre":"code-shiki",k.codeBlockStream===!1?"code-static":"code-stream",vs(k.codeBlockMinWidth),vs(k.codeBlockMaxWidth),...he?[Np((C=ee?.themes)!=null?C:k.themes,(B=ee?.langs)!=null?B:k.langs)]:[],vs(K?.fontSize),vs(K?.lineHeight),vs(K?.fontFamily),vs(K?.tabSize),vs(K?.MAX_HEIGHT),vs(K?.wordWrap),vs(K?.wrappingIndent),vs(K?.padding),vs(ee?.showHeader),vs(ee?.showCopyButton),vs(ee?.showExpandButton),vs(ee?.showPreviewButton),vs(ee?.showCollapseButton),vs(ee?.showFontSizeButtons)].join("\0")}function Oi(){return[B4(),F4()].join("\0")}function pl(){return so()}const xd=F(()=>Cc(pl())),So=F(()=>[Oi(),xd.value].join("\0")),H4=F(()=>{var C;return Ln.value?["virtual",(C=ps())!=null?C:"",On(),So.value].join("\0"):s.indexKey});function oa(){Vy.value+=1}function rm(C){return!(!C||!Number.isInteger(C.index)||C.index<0||C.index>=st.value.length||C.sessionKey!==On()||C.threadKey!==ps()||C.layoutEpochKey!==So.value)}function ak(C){const B=String(C),V=bi.get(B);return V?rm(V)?V.index:null:lk(B)}function ck(C="async-node"){(_o.size||bi.size)&&(_o.clear(),bi.clear(),oa(),An(C))}const ia=Ut(u1,null),lm={reportHeight(C,B){if(!Mt.value)return;const V=ak(C);if(V==null)return;const K=ki.get(V);if(!K)return;const ee=Number(B),he=Hy(V,K);Fy(V,Number.isFinite(ee)&&ee>0?Math.max(ee,he||0):he)},markPending(C){if(!Mt.value)return;const B=lk(C);B!=null&&(function(V,K){var ee;const he=bi.get(V);if(he&&rm(he))return _o.set(V,Math.max(0,(ee=_o.get(V))!=null?ee:0)+1),oa(),void An("async-node");_o.set(V,1),bi.set(V,(function(ke){return{index:ke,sessionKey:On(),threadKey:ps(),layoutEpochKey:So.value}})(K)),oa(),An("async-node")})(String(C),B)},markSettled(C){if(!Mt.value)return;const B=String(C),V=ak(C);(V!=null||(function(K){return _o.has(String(K))})(B))&&(function(K){var ee;const he=(ee=_o.get(K))!=null?ee:0;return!(he<=0||(he<=1?(_o.delete(K),bi.delete(K)):_o.set(K,he-1),oa(),he===1&&An("async-node"),0))})(B)&&V!=null&&Pi()}};function W4(){let C=0;for(const B of ki.values())C+=mt("getVisibleDomHeight.offsetHeight",()=>{var V;return(V=B?.offsetHeight)!=null?V:0});return Math.ceil(Math.max(0,C))}En(u1,{reportHeight(C,B){lm.reportHeight(C,B),ia?.reportHeight(C,B)},markPending(C){lm.markPending(C),ia?.markPending(C)},markSettled(C){lm.markSettled(C),ia?.markSettled(C)}});let am,cm=null,ra=null;function Ad(C){return C!==!1&&C!=null&&C!==""}function uk(){return Nt.value?(function(){if(!Nt.value)return!0;const C=st.value.length,B=As(xs.start,0,C),V=As(xs.end,B,C);if(B>=V)return!0;for(let K=B;K<V;K++)if(!Os.has(K)||Im(K)&&!ki.has(K))return!1;return!0})():_s.value>=kd.value}function um(){return j.value===!0&&!Y.value&&Gh.value===0&&dr.size===0&&Li.size===0&&wo==null&&uk()}function dk(){var C,B;if(((C=s.virtualScroll)==null?void 0:C.settleMode)!=="manual"||cm===On()&&am===ps())return!0;const V=(B=s.virtualScroll)==null?void 0:B.settledToken;return!!Ad(V)&&ra===Bc(V)}function dm(){return um()&&dk()}function z4(C,B){return B.totalNodes<=0?C==="final"?"final":"estimate":B.measuredCount>=B.totalNodes?C==="final"?"final":"measured":B.measuredCount>0||B.estimatedCount>0?"mixed":"estimate"}function hl(C="manual",B){const V=rk(),K=(function(ee){return ee||(j.value!==!0?st.value.length>0?"streaming":"estimating":!uk()||Li.size>0||wo!=null?"measuring":dm()?"settled":"settling")})(B);return{sessionKey:On(),threadKey:ps(),phase:K,nodeCount:V.totalNodes,liveRange:{start:xs.start,end:xs.end},renderedCount:_s.value,measuredCount:V.measuredCount,estimatedCount:V.estimatedCount,averageNodeHeight:V.averageNodeHeight,topSpacerHeight:V.topSpacerHeight,bottomSpacerHeight:V.bottomSpacerHeight,visibleDomHeight:W4(),totalHeight:fk(),width:V.width,final:j.value===!0,stable:dm(),confidence:z4(K,V),reason:C}}function xc(){const C=xe.value||ne(),B=S.value;if(!C||!B)return null;const V=C.ownerDocument||B.ownerDocument||document,K=C===V.documentElement||C===V.body||C===V.scrollingElement,ee=mt("getScrollBox.scrollTop",()=>J(C,V,K)),he=mt("getScrollBox.scrollHeight",()=>{var Se,Pe,Ee,We,De;return K?Math.max((Pe=(Se=V.documentElement)==null?void 0:Se.scrollHeight)!=null?Pe:0,(We=(Ee=V.body)==null?void 0:Ee.scrollHeight)!=null?We:0,(De=C.scrollHeight)!=null?De:0):C.scrollHeight}),ke=mt("getScrollBox.clientHeight",()=>{var Se;return K?((Se=V.documentElement)==null?void 0:Se.clientHeight)||C.clientHeight||0:C.clientHeight});return{root:C,doc:V,isViewportRoot:K,scrollTop:ee,scrollHeight:he,clientHeight:ke}}function fk(){const C=st.value.length,B=Math.max(0,pr(0,C)),V=mt("getRendererLogicalHeight.offsetHeight",()=>{var ee,he;return(he=(ee=S.value)==null?void 0:ee.offsetHeight)!=null?he:0}),K=Math.max(0,V>0?V:mt("getRendererLogicalHeight.scrollHeight",()=>{var ee,he;return(he=(ee=S.value)==null?void 0:ee.scrollHeight)!=null?he:0}));return C<=0?Math.ceil(V):Nt.value?B>0?Math.max(1,Math.ceil(B),(function(){let ee=nm.value+sm.value;for(const he of Os.values())he&&(ee+=Math.max(0,mt("getVirtualizedDomLogicalHeight.offsetHeight",()=>he.offsetHeight||0)));return Math.ceil(Math.max(0,ee))})(),(function(ee,he){return ee<=0||he<=0?0:he<=ee+Math.max(512,.05*ee)?Math.ceil(he):0})(B,K)):Math.max(1,Math.ceil(K)):Mt.value?B>0||Cs.count>0||ik()>0?(ii.value&&_s.value,Math.max(1,Math.ceil(K),Math.ceil(B))):Math.ceil(K):Math.max(1,Math.ceil(K),Math.ceil(B))}function pk(C){const B=S.value;if(!B)return null;const V=mt("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>B.getBoundingClientRect());return(function(ee){return ee.isViewportRoot?ee.clientHeight:mt("getViewportBottomInRoot.getBoundingClientRect",()=>ee.root.getBoundingClientRect().bottom)})(C)-V.bottom}function U4(C={}){const B=C.requireViewport!==!1,V=(function(he=64){const ke=xc(),Se=S.value;if(!ke||!Se)return!1;const Pe=(function(We){if(We.isViewportRoot)return{top:0,bottom:We.clientHeight};const De=mt("getVirtualViewportRect.getBoundingClientRect",()=>We.root.getBoundingClientRect());return{top:De.top,bottom:De.bottom}})(ke),Ee=mt("isRendererNearVirtualViewport.getBoundingClientRect",()=>Se.getBoundingClientRect());return Ee.bottom>=Pe.top-he&&Ee.top<=Pe.bottom+he})();if(B&&!V)return null;const K=(function(){const he=xc(),ke=S.value;if(!he||!ke||Math.max(0,he.scrollHeight-he.scrollTop-he.clientHeight)>64)return null;const Se=pk(he);return Se==null?null:Se>=-8&&Se<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,Se)}:null})();if(K)return{anchor:K,captured:!0};const ee=Fn();if(ee)return{anchor:{type:"node",nodeIndex:ee.nodeIndex,offsetWithinNodePx:ee.offsetWithinNodePx},captured:V};if(C.allowFallback===!0){const he=(function(){const ke=st.value.length;return ke<=0?null:{type:"node",nodeIndex:As(Ho.value,0,Math.max(0,ke-1)),offsetWithinNodePx:0}})();return he?{anchor:he,captured:!1}:null}return null}function fm(C){let B=2166136261;for(let V=0;V<C.length;V++)B^=C.charCodeAt(V),B=Math.imul(B,16777619);return(B>>>0).toString(36)}function q4(C,B){let V=C;for(let K=0;K<B.length;K++)V^=B.charCodeAt(K),V=Math.imul(V,16777619);return V^=31,V=Math.imul(V,16777619),V}const j4=new Set(["children","items","header","rows","cells","attrs","data","term","definition"]);function Td(C,B=new WeakSet,V=0){if(C==null||typeof C=="number"||typeof C=="boolean")return String(C);if(typeof C=="string")return`s:${(function(K){const ee=K.length>8192?`${K.slice(0,8192)}...${K.length}`:K;return`${K.length}:${fm(ee)}`})(C)}`;if(typeof C=="function")return"fn";if(typeof C!="object")return typeof C;if(B.has(C))return"cycle";if(V>=6)return"max-depth";B.add(C);try{if(Array.isArray(C)){if(C.length<=160){const Ee=[];for(let We=0;We<C.length;We++)Ee.push(Td(C[We],B,V+1));return`a:${C.length}:${Ee.join(",")}`}const he=[],ke=[],Se=Math.max(0,C.length-32);let Pe=2166136261;for(let Ee=0;Ee<C.length;Ee++){const We=Td(C[Ee],B,V+1);Pe=q4(Pe,We),Ee<32&&he.push(We),Ee>=Se&&ke.push(We)}return[`a:${C.length}`,`h=${he.join(",")}`,`t=${ke.join(",")}`,`all=${(Pe>>>0).toString(36)}`].join(":")}const K=C,ee=Object.keys(K).filter(he=>{const ke=K[he];return he!=="parent"&&he!=="el"&&he!=="component"&&(ke==null||typeof ke=="string"||typeof ke=="number"||typeof ke=="boolean"||j4.has(he))}).sort();return`o:${ee.length}:${ee.map(he=>`${he}=${Td(K[he],B,V+1)}`).join(";")}`}finally{B.delete(C)}}let hk=-1,pm="";function Ac(C){const B=st.value[C];return B?fm(Td(B)):""}function hm(){const C=Q.value;if(hk===C)return pm;let B=2166136261;for(let V=0;V<st.value.length;V++){const K=Ac(V);for(let ee=0;ee<K.length;ee++)B^=K.charCodeAt(ee),B=Math.imul(B,16777619)}return pm=(B>>>0).toString(36),hk=C,pm}function la(C,B={}){var V;const K=B.includeHeightCache===!0,ee=(V=B.includeContentHash)!=null?V:K,he=K?(function(Se){const Pe=(function(){var Ze,_t;const lt=Number((_t=(Ze=s.virtualScroll)==null?void 0:Ze.heightCacheLimit)!=null?_t:5e3);return!Number.isFinite(lt)||lt<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(lt))})();if(!Number.isFinite(Pe)||Se.length<=Pe)return Se;const Ee=new Map,We=Ze=>{!Ze||Ee.size>=Pe||Ee.set(Ze.index,Ze)},De=st.value.length,$e=As(xs.start-2*wc.value,0,De),He=As(xs.end+2*wc.value,$e,De);for(const Ze of Se)Ze.index>=$e&&Ze.index<He&&We(Ze);const Qe=Math.max(1,Math.ceil(Se.length/Pe));for(let Ze=0;Ze<Se.length&&Ee.size<Pe;Ze+=Qe)We(Se[Ze]);for(let Ze=Se.length-1;Ze>=0&&Ee.size<Pe;Ze-=Qe)We(Se[Ze]);return Array.from(Ee.values()).sort((Ze,_t)=>Ze.index-_t.index).slice(0,Pe)})($4().map(Se=>{var Pe;const Ee=st.value[Se.index];return Ee?Lt(it({},Se),{nodeType:String((Pe=Ee.type)!=null?Pe:""),signature:Ac(Se.index)}):null}).filter(Se=>!!Se)):[],ke=U4({allowFallback:B.allowAnchorFallback===!0,requireViewport:B.requireViewport});return ke||he.length||B.includeEmptyState===!0?Lt(it({sessionKey:C.sessionKey,threadKey:C.threadKey},ke?{anchor:ke.anchor,anchorCaptured:ke.captured}:{anchorCaptured:!1}),{metrics:C,width:C.width,contentHash:ee?hm():void 0,measurementKey:Oi()||void 0,heightCache:he.length?he:void 0}):null}function mm(C){var B,V;const K=xc();if(!K)return;const ee=(function(Se){const Pe=S.value;if(!Pe)return null;const Ee=ce(Pe,Se.root),We=st.value.length,De=mt("getRendererBottomOffsetWithinRoot.offsetHeight",()=>Pe.offsetHeight||0),$e=Math.max(0,De>0?De:We>0?mt("getRendererBottomOffsetWithinRoot.scrollHeight",()=>Pe.scrollHeight||0):0),He=fk();return Ee+Math.max($e,He)})(K);if(ee==null)return;const he=Math.max(0,C.distanceFromBottomPx),ke=Math.max(0,ee-K.clientHeight-he);(function(Se){at=$c()+120,Ot=Se})(ke),K.isViewportRoot?(V=(B=K.doc.defaultView)==null?void 0:B.scrollTo)==null||V.call(B,0,ke):vS(K.root,K.doc,ke,{isReverseFlexScrollRoot:H,getNormalizedScrollTop:J})}const gm=[];function mk(){if(we)for(et!=null&&(Oe?.(et),et=null);gm.length;){const C=gm.pop();C!=null&&window.clearTimeout(C)}}function aa(C){const B=!!Be.value;Be.value=null,at=0,Ot=null,mk(),B&&C&&An(C)}function ca(){if(!Be.value||!we||et!=null)return;const C=()=>{et=null;const B=Be.value;B&&mm(B)};et=pe?pe(C):null,et==null&&C()}function gk(C,B={}){const V=st.value.length;return V<=0?[]:C.filter(K=>!(!Number.isInteger(K.index)||K.index<0||K.index>=V)&&!(!Number.isFinite(K.height)||K.height<=0)&&!(B.requireSignature&&!K.signature)&&!(B.requireCompatibilityMetadata&&!K.nodeType&&!K.signature)&&(function(ee){var he;const ke=st.value[ee.index];return!(!ke||ee.nodeType&&ee.nodeType!==String((he=ke.type)!=null?he:"")||ee.signature&&ee.signature!==Ac(ee.index))})(K))}function vk(C){const B=Cc(pl()),V=Cc(C);return B!==-1&&V!==-1&&B===V}function vm(C){var B;const V=Number(C?.width);if(Number.isFinite(V)&&V>0)return V;const K=Number((B=C?.metrics)==null?void 0:B.width);return Number.isFinite(K)&&K>0?K:null}function yk(C){var B;return C.sessionKey===On()&&!!im(C.threadKey)&&((B=C.measurementKey)!=null?B:"")===Oi()&&!!vk(vm(C))&&!!(function(V){const K=V.heightCache;return!!K?.length&&(kk(V)?K.some(ee=>!!(ee.nodeType||ee.signature)):K.some(ee=>!!ee.signature))})(C)}function kk(C){return!!(C.contentHash&&C.contentHash===hm())}function V4(C){return!kk(C)}let ml=null,gl=null,Md=null,Tc=null,Mc=null;function ym(C){var B;const V=C.map(ee=>{var he,ke;return[ee.index,Math.round(10*ee.height),(he=ee.nodeType)!=null?he:"",(ke=ee.signature)!=null?ke:""].join("")}).join(""),K=Cc(pl());return[(B=ps())!=null?B:"",On(),Oi(),st.value.length,K,C.length,fm(V)].join(":")}function bk(C=(B=>(B=s.virtualScroll)==null?void 0:B.heightCache)()){if(!Mt.value||!C?.length||st.value.length<=0||!vk((B=s.virtualScroll)==null?void 0:B.heightCacheWidth))return!1;var B;const V=gk(C,{requireSignature:!0});if(!V.length)return!1;const K=ym(V);return K===ml?(gl="standalone",!0):(Wy(V,{mode:"merge"}),Wo(),ml=K,gl="standalone",Lc(),An("restore"),!0)}function km(C,B={}){var V,K,ee;if(!Mt.value||!C||C.sessionKey!==On()||!im(C.threadKey)||st.value.length<=0)return!1;const he=!!((V=C.heightCache)!=null&&V.length)&&!Ed(),ke=!C.anchor||C.anchorCaptured===!1&&B.allowUncapturedAnchor!==!0?null:C.anchor,Se=B.restoreAnchor===!0&&!!ke&&!Ed()&&Number(vm(C))>0;let Pe=!1;if((K=C.heightCache)!=null&&K.length&&yk(C)){const We=gk(C.heightCache,{requireCompatibilityMetadata:!C.contentHash,requireSignature:V4(C)});We.length&&(Wy(We,{mode:"merge"}),Wo(),ml=ym(We),gl="restore",Lc(),Pe=!0)}if(he||Se)return!1;if(!B.restoreAnchor||!ke)return Pe&&An("restore"),!0;const Ee=(function(We,De){var $e;const He=We.anchor,Qe=He?He.type==="bottom"?`bottom:${Math.round(He.distanceFromBottomPx)}`:`node:${He.nodeIndex}:${Math.round(He.offsetWithinNodePx)}`:"none";return[($e=ps())!=null?$e:"",On(),Oi(),xd.value,De,Qe].join(":")})(C,(ee=B.restoreToken)!=null?ee:"imperative");return Md===Ee?(Pe&&An("restore"),!0):(Md=Ee,(function(We){const De=()=>{if(We.type==="node")return aa(),void Ss({nodeIndex:We.nodeIndex,offsetWithinNodePx:We.offsetWithinNodePx});if(nn(),Vt.value=null,Be.value=We,mk(),mm(We),we)for(const $e of[0,120,280,480])gm.push(window.setTimeout(()=>{const He=Be.value;He&&mm(He)},$e))};(function($e){if(!Nt.value)return!1;const He=st.value.length;return!(He<=0||(Ho.value=$e.type==="node"?As($e.nodeIndex,0,He-1):He-1,ul(),0))})(We)?ht(De):De()})(ke),An("restore"),!0)}function Ed(){const C=pl();return Number.isFinite(C)&&C>0}function _k(C){var B;return C.sessionKey===On()&&!!im(C.threadKey)&&(st.value.length<=0||!(!((B=C.heightCache)!=null&&B.length)||Ed())||!(!(C.anchor&&Number(vm(C))>0)||Ed()))}function bm(){ws.clear();for(const C of Object.keys(fs)){const B=Number(C);Number.isInteger(B)&&B>=0&&B<st.value.length&&By(B)}}function Ec(){wo!=null&&(Oe?.(wo),wo=null),$m()}function wk(){return!we||Wt?Promise.resolve():new Promise(C=>{let B=!1,V=null;const K=()=>{B||(B=!0,V!=null&&window.clearTimeout(V),C())};if(pe)return pe(K),void(V=window.setTimeout(K,50));V=window.setTimeout(K,0)})}function _m(C,B=ps(),V=So.value){return On()===C&&ps()===B&&So.value===V}function wm(){return zn(this,arguments,function*(C={}){var B,V,K,ee,he;const ke=On(),Se=ps(),Pe=So.value,Ee=(B=C.frames)!=null?B:2,We=(V=C.timeoutMs)!=null?V:120,De=(K=C.reason)!=null?K:"manual",$e=C.expectedSettledTokenKey,He=C.flushPendingTimers===!0,Qe=hl(De),Ze=()=>Lt(it({},Qe),{phase:Qe.final?"settling":Qe.phase,stable:!1,confidence:Qe.confidence==="final"?"mixed":Qe.confidence,reason:De}),_t=()=>_m(ke,Se,Pe)&&($e==null||Nc()===$e);for(let wt=0;wt<Ee;wt++){if(yield ht(),!_t()||(yield wk(),!_t()))return Ze();Pi(),Ec()}if(yield(function(wt){return!we||wt<=0?Promise.resolve():new Promise(Zt=>window.setTimeout(Zt,wt))})(We),!_t()||(He&&Xy(),Pi(),Ec(),!_t()))return Ze();const lt=um();lt&&(cm=ke,am=Se,((ee=s.virtualScroll)==null?void 0:ee.settleMode)==="manual"&&$e!=null&&Ad((he=s.virtualScroll)==null?void 0:he.settledToken)&&Nc()===$e&&(ra=Bc(s.virtualScroll.settledToken)));const ct=_t()&<&&dk(),St=hl(De,ct?"final":void 0);return Tm(St,!0),St})}let Sm="content",vl=null,yl=null,Cm=0,Ic=null,ua=null,xm=null,Am=null;function $c(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function Sk(C){var B,V;const K=Ic;if(!K)return!0;const ee=(V=(B=s.virtualScroll)==null?void 0:B.heightDiffThresholdPx)!=null?V:1;return Math.abs(C.totalHeight-K.totalHeight)>ee||C.sessionKey!==K.sessionKey||C.phase!==K.phase||C.stable!==K.stable||C.final!==K.final||C.threadKey!==K.threadKey||C.nodeCount!==K.nodeCount||C.measuredCount!==K.measuredCount||C.width!==K.width}function vs(C){if(C==null)return"";if(typeof C=="string"||typeof C=="number"||typeof C=="boolean")return String(C);try{return JSON.stringify(C)}catch{return String(C)}}function Nc(C=(B=>(B=s.virtualScroll)==null?void 0:B.settledToken)()){return vs(C)}function Ck(C,B){var V,K;return[C,B.sessionKey,(V=B.threadKey)!=null?V:"",Oi(),hm(),vs((K=s.virtualScroll)==null?void 0:K.settledToken),Math.round(B.totalHeight),Math.round(B.width)].join("\0")}function Lc(){xm=null,Am=null,ua=null}function K4(C){const B=C.heightCache;return B?.length?ym(B):""}function Oc(C){var B,V,K;const ee=C.metrics,he=C.anchor?(ke=C.anchor).type==="bottom"?`bottom:${Math.round(ke.distanceFromBottomPx)}`:`node:${ke.nodeIndex}:${Math.round(ke.offsetWithinNodePx)}`:"none";var ke;return[C.sessionKey,(B=C.threadKey)!=null?B:"",(V=C.measurementKey)!=null?V:Oi(),(K=C.contentHash)!=null?K:"",K4(C),he,C.anchorCaptured?1:0,ee.liveRange.start,ee.liveRange.end,ee.renderedCount,ee.nodeCount,Math.round(ee.totalHeight),Math.round(ee.width),ee.phase,ee.stable?1:0].join("\0")}function Tm(C,B=!1){if(!Mt.value||(function(ke=!1){return!ke&&Ln.value&&!us.value})(B))return;const V=B||Sk(C),K=(function(ke,Se=!1){return Se||ke.stable||ke.phase==="final"?{state:la(ke,{includeHeightCache:!0})}:{state:la(ke)}})(C,B),ee=K.state,he=!!(ee&&(V||(function(ke,Se=!1){return!!Se||Oc(ke)!==ua})(ee,B)));if(V&&(E(C),Ic=C,Cm=$c()),ee&&he&&(M(ee),ee.anchor&&L(ee.anchor),ua=Oc(ee)),C.stable){const ke=Ck("settled",C);if(ke!==xm){xm=ke;const Se=la(C,{includeHeightCache:!0});Se&&(M(Se),ua=Oc(Se)),(function(Pe){o("render-settled",Pe)})(C)}}if(C.phase==="final"){const ke=Ck("final",C);if(ke!==Am){Am=ke;const Se=la(C,{includeHeightCache:!0});Se&&(M(Se),ua=Oc(Se)),(function(Pe){o("render-final",Pe)})(C)}}}function Mm(){vl!=null&&(Oe?.(vl),vl=null),yl!=null&&we&&(window.clearTimeout(yl),yl=null)}function xk(){vl=null,yl=null,(function(C){if(Li.size>0||wo!=null)return!0;switch(C){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(Sm)&&(Pi(),Ec()),Tm(hl(Sm))}function An(C){var B,V;if(!Mt.value||(Sm=C,vl!=null||yl!=null))return;const K=Math.max(0,(V=(B=s.virtualScroll)==null?void 0:B.emitIntervalMs)!=null?V:32),ee=Math.max(0,K-($c()-Cm)),he=()=>{yl=null,vl=pe?pe(xk):null,vl==null&&xk()};we&&ee>0?yl=window.setTimeout(he,ee):he()}function Em(C){var B;if(C<=0)return 0;const V=st.value;if(Xt.value)return ok(C);if(cl.value===V.length&&jh.value.length&&Vh.value.length){const ee=yi.value,he=jh.value,ke=Vh.value,Se=De=>De<=0?0:gd(he,0,De)+(De-gd(ke,0,De))*ee;let Pe=0,Ee=V.length-1,We=V.length-1;for(;Pe<=Ee;){const De=Pe+Ee>>1;Se(De+1)>=C?(We=De,Ee=De-1):Pe=De+1}return We}let K=C;for(let ee=0;ee<V.length;ee++){const he=(B=fs[ee])!=null?B:yi.value;if(K<=he)return ee;K-=he}return Math.max(0,V.length-1)}function Ak(){se.value+=1}function Im(C){return!(ii.value&&C>=_s.value)&&(!cr.value||C<Bn.value||Qh.value.has(C))}function da(C){const B=wd.get(C);B&&(B(),wd.delete(C));const V=na.get(C);V&&(V.destroy(),na.delete(C)),Sd(C)}function Tk(C,B){let V=!1;if(B){const he=Os.get(C);Os.set(C,B),he!==B&&(V=!0)}else Os.delete(C)&&(V=!0);if(V&&Ak(),B||Sd(C),!zy.value||!de||!Nt.value&&cr.value&&!z.value&&na.size>=640&&(z.value||(z.value=!0,Zh()),!zy.value||!de))return da(C),void(B&&fr(C,!0));if(C<Bn.value&&!Nt.value||Qh.value.has(C))return da(C),void fr(C,!0);if(!B)return void da(C);da(C);const K=de(B,{rootMargin:"400px"});if(!K)return;na.set(C,K),fr(C,K.isVisible.value),cr.value&&(function(he){if(!we||!cr.value)return;Sd(he);const ke=he%17*23,Se=window.setTimeout(()=>{if(Qy.delete(he),!cr.value||Qh.value.has(he))return;const Pe=Os.get(he);if(!Pe)return;const Ee=ne(Pe),We=Pe.ownerDocument||document,De=We.defaultView||window,$e=!Ee||Ee===We.documentElement||Ee===We.body,He=!$e&&Ee?mt("nodeVisibilityFallback.root.getBoundingClientRect",()=>Ee.getBoundingClientRect()):null,Qe=$e?0:He.top,Ze=$e?mt("nodeVisibilityFallback.clientHeight",()=>{var lt,ct;return(ct=(lt=De.innerHeight)!=null?lt:Ee?.clientHeight)!=null?ct:0}):He.bottom,_t=mt("nodeVisibilityFallback.node.getBoundingClientRect",()=>Pe.getBoundingClientRect());_t.bottom>=Qe-500&&_t.top<=Ze+500&&fr(he,!0)},1800+ke);Qy.set(he,Se)})(C);let ee=null;ee=Ke(()=>K.isVisible.value,he=>{if(he){Sd(C),fr(C,!0),ee?.(),wd.delete(C),na.get(C)===K&&na.delete(C);try{K.destroy()}catch{}}},{immediate:!0}),wd.set(C,ee),Nt.value&&_i()}function $m(){wo=null;for(const[C,B]of Li)Li.delete(C),ki.get(C)===B.el&&dl.get(C)===B.version&&Fy(C,B.height,{allowShrink:B.allowShrink})}function fa(){wo!=null&&(Oe?.(wo),wo=null),Li.clear()}function Id(C,B){(function(V,K,ee){var he;if(!Number.isFinite(ee)||ee<=0||ki.get(V)!==K)return;const ke=dl.get(V);if(ke==null)return;const Se=st.value[V],Pe=Y.value&&j.value!==!0&&!((he=s.nodes)!=null&&he.length)&&V>=st.value.length-2,Ee=!(Se?.loading===!0||Pe),We=Li.get(V),De=We?We.allowShrink&&Ee:Ee,$e=We&&!De?Math.max(We.height,ee):ee;Li.set(V,{height:$e,allowShrink:De,version:ke,el:K}),wo==null&&(wo=pe?pe($m):null,wo==null&&$m())})(C,B,Hy(C,B))}function Pi(){for(const[C,B]of ki)B&&Id(C,B)}function Mk(){Ne?.disconnect(),Ne=null,ft.clear()}function Nm(){for(;yd.length;)_d(yd.pop())}Ke(us,C=>{C&&An("content")},{flush:"post"}),t({getVirtualMetrics:hl,captureVirtualState:function(C={}){var B;return la(hl("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:C.allowFallbackAnchor===!0,requireViewport:C.requireViewport===!0,includeEmptyState:(B=C.includeEmptyState)==null||B})},restoreVirtualState:function(C,B={}){const V=B.restoreAnchor===!0,K=B.restoreToken==null?"imperative":String(B.restoreToken);Tc=C,Mc={restoreAnchor:V,restoreToken:K,allowUncapturedAnchor:B.allowUncapturedAnchor===!0},!km(C,{restoreAnchor:V,restoreToken:K,allowUncapturedAnchor:B.allowUncapturedAnchor===!0})&&_k(C)||(Tc=null,Mc=null)},forceMeasure:function(C="manual"){return zn(this,null,function*(){yield ht(),yield wk(),Pi(),Ec(),yield ht();const B=hl(C);return Tm(B,!0),B})},settle:wm,scrollToNode:function(C,B="start"){aa(),nn();const V=st.value.length;if(V<=0)return;const K=As(C,0,V-1),ee=()=>{var he;const ke=Fo({nodeIndex:K,offsetWithinNodePx:0}),Se=Cd(K),Pe=xc(),Ee=(he=Pe?.clientHeight)!=null?he:0,We=qt();let De=ke;if(B==="center")De=ke-Ee/2+Se/2;else if(B==="end")De=ke-Ee+Se;else if(B==="nearest"&&We!=null){if(ke>=We&&ke+Se<=We+Ee)return;De=ke<We?ke:ke-Ee+Se}Bo(Math.max(0,De)),_i({immediate:!0}),Nt.value&&(Ho.value=K,ul())};if(Nt.value)return Ho.value=K,ul(),void ht(ee);ee()}}),Ke(()=>Xe.value,C=>{if(!C){Mk();for(const B of ur.values())for(const V of B)_d(V);ur.clear(),dl.clear(),Nm(),fa()}},{immediate:!0}),Ke(j,C=>{C&&(function(){if(we&&j.value&&ki.size){Nm();for(const B of[80,240,640]){const V=Yy(B,()=>{for(const[K,ee]of ki)ee&&Id(K,ee)},"final");V!=null&&yd.push(V)}}})(),An(C?"final":"content")}),Ke([()=>st.value.length,()=>_s.value],()=>{Be.value&&ca(),An("content")},{flush:"post",immediate:!0}),Ke([()=>xs.start,()=>xs.end],()=>{An("batch")},{flush:"post"});const{cleanupBatchScheduler:G4}=(function(C){const{props:B,isClient:V,isTestEnv:K,parsedNodesIdentity:ee,parsedNodeCount:he,desiredRenderedCount:ke,datasetKey:Se,batchingEnabled:Pe,incrementalRenderingActive:Ee,resolvedBatchSize:We,resolvedInitialBatch:De,renderedCount:$e,adaptiveBatchSize:He,previousRenderContext:Qe,previousBatchConfig:Ze,requestFrame:_t,cancelFrame:lt,hasIdleCallback:ct,cleanupNodeVisibility:St,onDatasetKeyChanged:wt,onDatasetChanged:Zt}=C;let xt=null,Bt=null,Rt=!1,ln=null,Co=null,js=0,ri=!1,hr=!1;const mr=new Set,bl=new Set;function Vk(){if(V){xt!=null&&(lt?.(xt),xt=null),Bt!=null&&(window.clearTimeout(Bt),Bt=null),Co!=null&&typeof window.cancelIdleCallback=="function"&&(window.cancelIdleCallback(Co),Co=null),js+=1;for(const Rs of mr)lt?.(Rs);mr.clear();for(const Rs of bl)window.clearTimeout(Rs);bl.clear(),Rt=!1,ln=null,ri=!1,hr=!1}}function Dd(){return typeof performance<"u"?performance.now():Date.now()}function Kk(Rs){(function(Ri){var gr;if(!Ee.value)return;const Di=Math.max(2,(gr=B.renderBatchBudgetMs)!=null?gr:6),Bi=Math.max(1,We.value||1),li=Math.max(1,Math.floor(Bi/4));Ri>1.2*Di?He.value=Math.max(li,Math.floor(.7*He.value)):Ri<.5*Di&&He.value<Bi&&(He.value=Math.min(Bi,Math.ceil(1.2*He.value)))})(Rs),ri=!1;const io=hr||$e.value<ke.value;hr=!1,io&&Xk()}function Gk(Rs,io={}){var Ri,gr;if(!Ee.value)return;const Di=ke.value;if($e.value>=Di)return;const Bi=Math.max(1,Rs),li=()=>{const ma=Dd();let ga=0;xt=null,Bt=null,Co=null,Rt=!1;const va=ln??Bi;ln=null;const Hm=Dd();$e.value=Math.min(Di,$e.value+va),St($e.value),ga=Dd()-Hm,(function(Wm,Qk){if(!V)return void Kk(Qk);ri=!0;const Zk=++js;ht().then(()=>{var Jk;if(Zk!==js)return;const hE=Dd(),mE=Math.max(Qk,hE-Wm),eb=()=>{Zk===js&&Kk(mE)};if(_t){let nb=!1,Fi=null;const sb=()=>{nb||(nb=!0,eb())},Bd=_t(()=>{mr.delete(Bd),Fi!=null&&(window.clearTimeout(Fi),bl.delete(Fi),Fi=null),sb()});return mr.add(Bd),Fi=window.setTimeout(()=>{Fi!=null&&bl.delete(Fi),Fi=null,lt?.(Bd),mr.delete(Bd),sb()},Math.max(32,(Jk=B.renderBatchIdleTimeoutMs)!=null?Jk:120)),void bl.add(Fi)}const tb=window.setTimeout(()=>{bl.delete(tb),eb()},0);bl.add(tb)})})(ma,ga)};if(!V||io.immediate)return void li();const vr=Math.max(0,(Ri=B.renderBatchDelay)!=null?Ri:16);if(ln=ln!=null?Math.max(ln,Bi):Bi,!Rt){if(Rt=!0,!K&&ct&&window.requestIdleCallback){const ma=Math.max(0,(gr=B.renderBatchIdleTimeoutMs)!=null?gr:120);return void(Co=window.requestIdleCallback(()=>li(),{timeout:ma}))}_t&&!K?xt=_t(()=>{vr!==0?Bt=window.setTimeout(()=>li(),vr):li()}):Bt=window.setTimeout(()=>li(),vr)}}function Yk(Rs,io={}){ri?hr=!0:Rs==null?Xk():Gk(Rs,io)}function Xk(){Ee.value&&Gk(Pe.value?Math.max(1,Math.round(He.value)):Math.max(1,We.value))}return Ke([ee,he,Se,Ee,We,De,()=>B.renderBatchDelay],()=>{var Rs;const io=he.value,Ri=Qe.value,gr=Se.value,Di=!Object.is(gr,Ri.key),Bi=io!==Ri.total,li=Di||Bi;Qe.value={key:gr,total:io};const vr=Ze.value,ma=(Rs=B.renderBatchDelay)!=null?Rs:16,ga=vr.batchSize!==We.value||vr.initial!==De.value||vr.delay!==ma||vr.enabled!==Ee.value;Ze.value={batchSize:We.value,initial:De.value,delay:ma,enabled:Ee.value},Di&&wt(io),(li||ga||!Ee.value)&&Vk(),(li||ga)&&(He.value=Math.max(1,We.value||1)),li&&Zt();const va=ke.value;if(!io)return $e.value=0,void St(0);if(!Ee.value)return $e.value=va,void St($e.value);const Hm=Di||Ri.total===0;$e.value=Hm||ga?Math.min(va,De.value):Math.min($e.value,va);const Wm=Math.max(1,De.value||We.value||io);$e.value<va?Yk(Wm,{immediate:!V}):St($e.value)},{immediate:!0}),Ke(ke,(Rs,io)=>{Ee.value&&(typeof io=="number"&&Rs<=io||Rs>$e.value&&Yk())}),{cleanupBatchScheduler:Vk}})({props:k,isClient:we,isTestEnv:Wt,parsedNodesIdentity:_n,parsedNodeCount:Kn,desiredRenderedCount:kd,datasetKey:H4,batchingEnabled:bo,incrementalRenderingActive:ii,resolvedBatchSize:ds,resolvedInitialBatch:Bn,renderedCount:_s,adaptiveBatchSize:ll,previousRenderContext:ta,previousBatchConfig:al,requestFrame:pe,cancelFrame:Oe,hasIdleCallback:Qt,cleanupNodeVisibility:O4,onDatasetKeyChanged:C=>{fa(),vd(),Wo(),Lc(),C>0&&md(C)},onDatasetChanged:()=>{Nt.value&&_i({immediate:!0})}});Ke([Uy,Nt,()=>S.value,()=>ye()],([C,B])=>{if(!C)return Zy(),void Xh();P4(),B?_i({immediate:!0}):Xh()},{flush:"post",immediate:!0}),Ke([()=>st.value.length,()=>Nt.value],C=>zn(null,[C],function*([B,V]){V&&B&&we&&(yield ht(),_i({immediate:!0}))}),{flush:"post"}),Ke(Xt,C=>{C&&(function(){var B;if($n.value&&Ge.value&&Ye.value&&((B=Ct.value)!=null&&B[1]))return;const V=Dr({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),K=Dr({type:"list_item",children:[V],raw:"- Probe paragraph text"}),ee=Dr({type:"list",ordered:!1,items:[K],raw:"- Probe paragraph text"});$n.value=V,Ge.value=K,Ye.value=ee;const he={1:null,2:null,3:null,4:null,5:null,6:null};for(let ke=1;ke<=6;ke++)he[ke]=Dr({type:"heading",level:ke,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(ke)} Probe heading`});Ct.value=he})()},{immediate:!0}),Ke([()=>S.value,Xt],()=>{if(!Xt.value)return em(),void(X.value=0);ek(),em(),Xt.value&&S.value&&typeof ResizeObserver<"u"&&(Sc=new ResizeObserver(()=>{ek(),Vt.value&&Jn(),Be.value&&ca(),An("resize")}),Sc.observe(S.value))},{immediate:!0}),Ke([Xt,qs,So],()=>zn(null,null,function*(){if(!Xt.value)return fe.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void Wo();yield ht(),(function(){if(!Xt.value||typeof window>"u")return fe.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void Wo();const C={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},B=Jy(Jh(I.value),".paragraph-node");C.paragraph=jg(I.value,B,"pre-wrap");const V=Jh(P.value),K=V?.querySelector(".paragraph-node");C.listItem=jg(P.value,K,"pre-wrap");const ee=mt("readSimpleTextProbeProfile.list.offsetHeight",()=>{var ke,Se;return(Se=(ke=D.value)==null?void 0:ke.offsetHeight)!=null?Se:0}),he=mt("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var ke,Se;return(Se=(ke=P.value)==null?void 0:ke.offsetHeight)!=null?Se:0});C.listWrapperOverhead=Math.max(0,ee-he);for(let ke=1;ke<=6;ke++){const Se=Jy(Jh(W[ke]),`h${ke}`);C.headings[ke]=jg(W[ke],Se,"pre-wrap")}fe.value=C,Wo()})()}),{flush:"post",immediate:!0}),Ke(()=>st.value.length,()=>{Nt.value&&_i({immediate:!0})}),Ke([Xt,X],()=>{Wo(),Nt.value&&_i({immediate:!0}),Vt.value&&Jn(),Be.value&&ca(),An("resize")},{immediate:!1}),Ke(()=>cr.value,C=>{if(C)for(const[B,V]of Os)Tk(B,V);else{Zh();for(const[B,V]of Os)V&&fr(B,!0)}},{immediate:!1}),Ke([()=>k.viewportPriority,()=>st.value.length],([C,B])=>{C!==!1?z.value&&B<=200&&(z.value=!1):z.value=!1}),Ke(()=>_s.value,()=>{Nt.value&&_i({immediate:!0})}),Ke([Ho,oo,wc,()=>st.value.length,Nt],()=>{ul()},{immediate:!0});let Pc=null,Rc=!1,pa=null;function Dc(){Pc=null,cm=null,am=void 0,ra=null,Lc()}function Lm(){fa(),vd(),Wo(),ws.clear();const C=st.value.length;C>0&&md(C),bm()}function Om(){Mm(),Xy(),Ic=null,ml=null,gl=null,Md=null,Tc=null,Mc=null,Rc=!1,Dc(),ck("restore"),nn(),aa()}function Bc(C){var B;return[(B=ps())!=null?B:"",On(),Oi(),xd.value,Nc(C),st.value.length,Math.round(pr(0,st.value.length)),Math.round(pl()),Cs.count,Math.round(Cs.total)].join(":")}function Ek(){return zn(this,null,function*(){var C,B,V,K;const ee=(C=s.virtualScroll)==null?void 0:C.settledToken,he=Nc(ee),ke=On(),Se=ps(),Pe=So.value;if(Mt.value&&((B=s.virtualScroll)==null?void 0:B.settleMode)==="manual"&&Ad(ee))if(um()){if(Bc(ee)!==ra&&!Rc){Rc=!0;try{const Ee=yield wm({reason:"manual",expectedSettledTokenKey:he}),We=Nc()===he;_m(ke,Se,Pe)&&Ee.sessionKey===ke&&Ee.threadKey===Se&&We&&Ee.stable&&Ee.phase==="final"&&(ra=Bc((V=s.virtualScroll)==null?void 0:V.settledToken))}finally{Rc=!1,yield ht();const Ee=(K=s.virtualScroll)==null?void 0:K.settledToken,We=Ad(Ee)?Bc(Ee):"";_m(ke,Se,Pe)&&We&&ra!==We&&Ek()}}}else An("manual")})}Ke(Mt,(C,B)=>{if(C!==B){if(!C)return Om(),void Mm();Om(),Lm(),pa=So.value,An("content")}},{flush:"post"}),Ke([Mt,So],([C,B])=>{C?pa!=null?pa!==B&&(pa=B,(function(V="resize"){fa(),vd(),Wo(),ws.clear();const K=st.value.length;K>0&&md(K),bm(),ml=null,gl=null,Md=null,Ic=null,Rc=!1,Dc(),bk(),ht(()=>{Pi(),Vt.value&&Jn(),Be.value&&ca(),An(V)})})("resize")):pa=B:pa=null},{flush:"post",immediate:!0}),Ke([Mt,()=>On(),()=>ps()],([C])=>{C&&(Om(),Lm(),ck("content"),An("content"))}),Ke([Mt,()=>On(),()=>ps(),So,()=>st.value.length],([C])=>{C&&(function(B="async-node"){let V=!1;for(const[K,ee]of Array.from(bi.entries()))rm(ee)||(bi.delete(K),_o.delete(K),V=!0);V&&(oa(),An(B))})("async-node")},{flush:"post"}),Ke([Mt,()=>{var C;return(C=s.virtualScroll)==null?void 0:C.sessionKey},()=>{var C;return(C=s.virtualScroll)==null?void 0:C.measurementKey},()=>s.indexKey,()=>Q.value],([C])=>{C&&(Lc(),(function(B="content"){if(!Mt.value)return;const V=[],K=st.value.length;for(const ee of Array.from(ws.keys())){if(ee>=K){V.push(ee);continue}const he=Ac(ee),ke=ws.get(ee);ke!=null&&ke!==he&&V.push(ee),ws.set(ee,he)}for(const ee of Array.from(ws.keys()))ee>=K&&ws.delete(ee);V.length&&((function(ee,he={}){const ke=Array.from(ee,Number);I4(ke,he)>0&&(function(Pe){for(const Ee of Pe)ws.delete(Ee)})(ke)})(V,{notify:!1}),Wo(),Dc(),Vt.value&&Jn(),Be.value&&ca(),An(B))})("content"))},{flush:"post",immediate:!0}),Ke([Mt,()=>st.value.length,()=>On(),()=>ps()],([C,B,V,K],[ee,he,ke,Se])=>{C&&ee&&V===ke&&K===Se&&B!==he&&Dc()},{flush:"post"}),Ke([Mt,()=>{var C;return(C=s.virtualScroll)==null?void 0:C.heightCache},()=>{var C;return(C=s.virtualScroll)==null?void 0:C.heightCacheWidth},()=>{var C;return(C=s.virtualScroll)==null?void 0:C.restoreState},()=>{var C;return(C=s.virtualScroll)==null?void 0:C.measurementKey},()=>st.value.length,()=>On(),X],()=>{bk()},{flush:"post",immediate:!0}),Ke([Mt,()=>{var C;return(C=s.virtualScroll)==null?void 0:C.restoreState},()=>{var C;return(C=s.virtualScroll)==null?void 0:C.restoreAnchor},()=>{var C;return(C=s.virtualScroll)==null?void 0:C.measurementKey},()=>st.value.length,()=>On(),X],C=>zn(null,[C],function*([B,V]){if(!B||!V)return;yield ht();const K=(function(){var ee;const he=(ee=s.virtualScroll)==null?void 0:ee.restoreAnchor;return he==null||he===!1?null:he===!0?"true":String(he)})();km(V,{restoreAnchor:K!=null,restoreToken:K??void 0})}),{flush:"post",immediate:!0}),Ke([Mt,X,()=>{var C;return(C=s.virtualScroll)==null?void 0:C.restoreState},()=>{var C;return(C=s.virtualScroll)==null?void 0:C.measurementKey}],([C])=>{var B;if(!C)return;const V=(B=s.virtualScroll)==null?void 0:B.restoreState;V&&ml&&gl==="restore"&&(yk(V)||(Lm(),ml=null,gl=null,An("resize")))},{flush:"post"}),Ke([Mt,()=>st.value.length,()=>On(),X],C=>zn(null,[C],function*([B]){var V;const K=Tc,ee=Mc;B&&K&&(yield ht(),!km(K,{restoreAnchor:ee?.restoreAnchor===!0,restoreToken:(V=ee?.restoreToken)!=null?V:"imperative",allowUncapturedAnchor:ee?.allowUncapturedAnchor===!0})&&_k(K)||(Tc=null,Mc=null))}),{flush:"post",immediate:!0}),Ke([Mt,j,()=>{var C;return(C=s.virtualScroll)==null?void 0:C.settleMode},()=>On(),()=>ps(),So,Gh,jy,()=>_s.value,kd,()=>Cs.count,()=>Cs.total],([C,B,V])=>{if(!C||B!==!0||V==="manual"||!dm())return;const K=(function(){var ee;const he=st.value.length;return[(ee=ps())!=null?ee:"",On(),Oi(),xd.value,he,Math.round(pr(0,he)),Math.round(pl()),Cs.count,Math.round(Cs.total)].join(":")})();Pc!==K&&(Pc=K,wm({reason:"final"}).then(ee=>{ee.stable||Pc!==K||(Pc=null)}))},{flush:"post",immediate:!0}),Ke([Mt,j,()=>{var C;return(C=s.virtualScroll)==null?void 0:C.settleMode},()=>{var C;return(C=s.virtualScroll)==null?void 0:C.settledToken},()=>On(),()=>ps(),So,Gh,jy,()=>_s.value,kd,()=>st.value.length,()=>Cs.count,()=>Cs.total],()=>{Ek()},{flush:"post",immediate:!0}),Ke([()=>st.value.length,Nt,oo,wc,()=>xs.start,()=>xs.end],([C,B,V,K,ee,he])=>{Ue.value&&Te("virtualization",{nodes:C,virtualization:B,maxLiveNodes:V,buffer:K,focusIndex:Ho.value,scroll:B?(()=>{const ke=xe.value||ne();return ke?{reverse:H(ke),scrollTop:Math.round(ke.scrollTop),scrollTopAbs:Math.round(Math.abs(ke.scrollTop)),scrollHeight:Math.round(ke.scrollHeight),clientHeight:Math.round(ke.clientHeight)}:null})():null,liveRange:{start:ee,end:he},rendered:_s.value})}),Ke([()=>k.customId],([C],B,V)=>{if(!C||$t)return;const K=(function(ee,he){return ee?(hs.controllers[ee]=he,()=>{hs.controllers[ee]===he&&delete hs.controllers[ee]}):()=>{}})(C,{captureRestoreAnchor:Fn,restoreAnchor:Ss,getAnchorDrift:Ps,getReport:D4});V(()=>{K()})},{immediate:!0}),ls(()=>{(function(){if(Mt.value)try{Pi(),Ec();const C=hl("manual");Sk(C)&&(E(C),Ic=C,Cm=$c());const B=la(C,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});B&&(M(B),B.anchor&&L(B.anchor),ua=Oc(B))}catch{}})(),G4(),Zh(),Ie(),Mk();for(const C of ur.values())for(const B of C)_d(B);ur.clear(),dl.clear(),ws.clear(),Nm(),fa(),em(),nn(),aa(),Mm(),Zy(),Xh()});const Y4=ui({loader:()=>zn(null,null,function*(){try{return(yield Xs(()=>import("./index11-Dto_yZNz.js"),__vite__mapDeps([8,5]))).default}catch(C){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".',C),xo}}),loadingComponent:RV,delay:0}),X4=ui({loader:()=>zn(null,null,function*(){try{return(yield Xs(()=>import("./index10-CNr4U-Nw.js"),[])).default}catch(C){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.',C),xo}}),loadingComponent:PV,delay:0}),Q4=ui(()=>zn(null,null,function*(){try{return(yield Xs(()=>import("./index7-Dz9oCsUF.js"),[])).default}catch(C){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".',C),xo}})),Ik={text:Xn,paragraph:ql,heading:Rp,code_block:Dg,list:nc,list_item:tc,blockquote:Of,table:wu,definition_list:Pf,footnote:Rf,footnote_reference:$o,footnote_anchor:bu,admonition:Hf,vmr_container:Bf,hardbreak:jr,link:to,image:qr,thematic_break:Df,math_inline:gi,math_block:QM,strong:Js,emphasis:no,strikethrough:eo,highlight:Lo,insert:vo,subscript:go,superscript:mo,emoji:ho,checkbox:Io,checkbox_input:Io,inline_code:Us,html_inline:No,reference:Zs,html_block:_u},Z4=F(()=>om()),$k=F(()=>gS(k.codeBlockProps)),J4=F(()=>gS(k.codeBlockProps,{omit:["langs"]})),Nk=F(()=>it(it({stream:k.codeBlockStream,darkTheme:k.codeBlockDarkTheme,lightTheme:k.codeBlockLightTheme,monacoOptions:k.codeBlockMonacoOptions,themes:k.themes,langs:u.value==="shiki"?k.langs:void 0,minWidth:k.codeBlockMinWidth,maxWidth:k.codeBlockMaxWidth},typeof Fe.value=="boolean"?{showTooltips:Fe.value}:{}),J4.value)),Lk=F(()=>it(Lt(it({},Nk.value),{langs:k.langs}),$k.value));function Ok(C){return typeof C=="boolean"?C:void 0}const eE=F(()=>{const C=k.codeBlockProps||{},B={},V=Ok(C.showLineNumbers);V!==void 0&&(B.showLineNumbers=V);const K=Ok(C.diffInline);K!==void 0&&(B.diffInline=K);const ee=(function(he){const ke=Number(he);return Number.isFinite(ke)&&ke>0?ke:void 0})(C.reservedHeightPx);return ee!==void 0&&(B.reservedHeightPx=ee),B}),tE=F(()=>it(it({stream:k.codeBlockStream,darkTheme:k.codeBlockDarkTheme,lightTheme:k.codeBlockLightTheme,themes:k.themes,langs:k.langs,minWidth:k.codeBlockMinWidth,maxWidth:k.codeBlockMaxWidth},typeof Fe.value=="boolean"?{showTooltips:Fe.value}:{}),$k.value)),nE=F(()=>it({},k.mermaidProps||{})),Pk=F(()=>it({},k.d2Props||{})),sE=F(()=>it({},k.infographicProps||{})),Fc=F(()=>({typewriter:k.typewriter,fade:k.fade,customHtmlTags:Vn.value.customHtmlTags})),oE=F(()=>it(it({},Fc.value),typeof Fe.value=="boolean"?{showTooltip:Fe.value}:{})),iE=F(()=>it(it({},Fc.value),typeof Fe.value=="boolean"?{showTooltips:Fe.value}:{})),rE=F(()=>it(it({},Fc.value),typeof Fe.value=="boolean"?{showTooltips:Fe.value}:{})),lE=F(()=>it(it({},Fc.value),typeof Fe.value=="boolean"?{showTooltips:Fe.value}:{}));function aE(C){return Array.isArray(C.children)&&C.children.length>0}const Pm=F(()=>R4.value.map(C=>{var B,V,K,ee,he,ke,Se,Pe;let Ee=(function(lt){var ct,St,wt,Zt,xt,Bt,Rt;if(lt.type!=="code_block")return lt;const ln=lt,Co=[String((ct=ln.language)!=null?ct:""),String((St=ln.loading)!=null?St:""),String((wt=ln.diff)!=null?wt:""),String((Zt=ln.code)!=null?Zt:""),String((xt=ln.originalCode)!=null?xt:""),String((Bt=ln.updatedCode)!=null?Bt:""),String((Rt=ln.raw)!=null?Rt:"")].join("\0"),js=xn.get(ln);if(js&&js.signature===Co)return js.node;const ri=it({},ln);return xn.set(ln,{signature:Co,node:ri}),ri})(C.node);const We=$d(Ee);let De=Fk(Ee,We);if((Ee.type==="html_block"||Ee.type==="html_inline")&&De===Ik[Ee.type]){const lt=Ee,ct=String((B=lt.tag)!=null?B:"").trim().toLowerCase()||WT(lt.content);if(ct){const St=Ft.value[ct];if(bn.value.has(ct)&&St)De=St,Ee=Lt(it({},lt),{type:ct,tag:ct,content:Z9(lt.content,ct)});else if(zT((V=lt.content)!=null?V:lt.raw,ct)){const wt=String((ee=(K=lt.content)!=null?K:lt.raw)!=null?ee:"");Ee.type==="html_inline"?(De=Xn,Ee={type:"text",content:wt,raw:wt}):(De=ql,Ee={type:"paragraph",children:[{type:"text",content:wt,raw:wt}],raw:wt})}}}const $e=Ee.type==="code_block"&&u.value==="pre"&&De===xo&&!Rm(Ft.value,We);let He=it({},(function(lt,ct,St){const wt=ct??$d(lt);if(lt.type==="code_block"){const Zt=wt?Rm(Ft.value,wt):void 0;if(St&&u.value==="pre"&&!Zt&&St===xo)return eE.value;if(St&&wt&&St===Zt)return wt==="mermaid"?Dk(lt):wt==="infographic"?Bk(lt):wt==="d2"||wt==="d2lang"?Pk.value:Lk.value;if(St&&St===Ft.value.code_block)return Lk.value;if(nk(St))return tE.value}return wt==="mermaid"?Dk(lt):wt==="infographic"?Bk(lt):wt==="d2"||wt==="d2lang"?Pk.value:lt.type==="link"?oE.value:lt.type==="list"?iE.value:lt.type==="blockquote"?rE.value:lt.type==="table"?lE.value:lt.type==="code_block"?Nk.value:Fc.value})(Ee,We,De));const Qe=fl.value[C.index];Ee.type==="code_block"&&Qe?.kind==="code-block"&&(He=Lt(it({},He),$e?{reservedHeightPx:(he=Qe.height)!=null?he:Qe.contentHeight}:{estimatedHeightPx:Qe.height,estimatedContentHeightPx:Qe.contentHeight})),$e||Ee.type!=="code_block"||We!=="mermaid"||Ha(He.estimatedPreviewHeightPx)!=null||(He=Lt(it({},He),{estimatedPreviewHeightPx:m1(p1(String((ke=Ee.code)!=null?ke:"")))})),$e||Ee.type!=="code_block"||We!=="infographic"||Ha(He.estimatedPreviewHeightPx)!=null||(He=Lt(it({},He),{estimatedPreviewHeightPx:g1(h1(String((Se=Ee.code)!=null?Se:"")))})),Ee.type==="math_block"&&(He=Lt(it({},He),{cacheScope:Dn.value}));const Ze=(function(lt,ct){const St=String(lt.type);return!dd(St)&&Ft.value[St]===ct})(Ee,De),_t=Ze?ay(Ee,rt.value):void 0;return Lt(it({},C),{node:Ee,component:De,bindings:He,customBindings:it(it({},_t??{}),He),rendersCustomNode:Ze,hasSlotChildren:aE(Ee),slotContent:String((Pe=Ee.content)!=null?Pe:""),isCodeBlock:Ee.type==="code_block",indexKey:`${Z4.value}-${C.index}`})}));function $d(C){var B;return C?.type==="code_block"?String((B=C.language)!=null?B:"").trim().toLowerCase():""}function Rm(C,B){const V=B.trim().toLowerCase();if(V)for(const K of[V,ty(V),RM(V)]){const ee=K&&C[K];if(ee)return ee}}function Rk(C,B,V,K){var ee,he;const ke=it({},C.value);return Ha(ke.estimatedPreviewHeightPx)==null&&(ke.estimatedPreviewHeightPx=K(V(String((ee=B?.code)!=null?ee:"")),void 0,ke.maxHeight==="none"?null:(he=Ha(ke.maxHeight))!=null?he:void 0)),ke}function Dk(C){return Rk(nE,C,p1,m1)}function Bk(C){return Rk(sE,C,h1,g1)}function Fk(C,B){if(!C)return A1;const V=Ft.value,K=V[String(C.type)];if(C.type==="code_block"){const ee=B??$d(C),he=ee?Rm(V,ee):void 0;return he||(u.value==="pre"?V.code_block||xo:ee==="mermaid"?V.mermaid||Y4:ee==="infographic"?V.infographic||X4:ee==="d2"||ee==="d2lang"?V.d2||Q4:K||V.code_block||sk.value)}return K||Ik[String(C.type)]||A1}function Dm(C){o("click",C)}function cE(C){var B;(B=C.target)!=null&&B.closest("[data-node-index]")&&o("mouseover",C)}function uE(C){var B;(B=C.target)!=null&&B.closest("[data-node-index]")&&o("mouseout",C)}function Hk(C){o("mouseover",C)}function Wk(C){o("mouseout",C)}const kl=Z(null),wi=Z(!1);let Hc,ha=null,Bm=0,Nd=0,Ld=0;const zk=["code_block","admonition","table","math_block","html_block","image","thematic_break"],dE=new Set(zk),Uk=[".typewriter-cursor",".height-estimation-probes",...zk.map(C=>`[data-node-type="${C}"]`),"script","style"].join(",");function qk(C){if(!C||typeof C!="object")return!1;const B=C.type;return typeof B=="string"&&dE.has(B)}function Od(C){var B,V;if(!C||typeof C!="object")return 0;const K=C,ee=(V=(B=K.raw)!=null?B:K.content)!=null?V:K.code;if(typeof ee=="string")return ee.length;const he=K.children;if(Array.isArray(he))return he.reduce((Se,Pe)=>Se+Od(Pe),0);const ke=K.items;return Array.isArray(ke)?ke.reduce((Se,Pe)=>Se+Od(Pe),0):0}function Pd(){Hc&&(clearTimeout(Hc),Hc=void 0)}function jk(){Bm+=1,ha!=null&&(Oe?.(ha),ha=null)}function Rd(){jk(),kl.value&&(kl.value.style.visibility="hidden")}function fE(C){var B;if(C.nodeType!==Node.TEXT_NODE||!((B=C.textContent)!=null?B:"").trim())return!1;const V=C.parentElement;return!!V&&!V.closest(Uk)}function pE(C){let B=C.lastChild;for(;B;){if(fE(B))return B;if(B.nodeType===Node.ELEMENT_NODE){const V=B;if(!V.matches(Uk)&&V.lastChild){B=V.lastChild;continue}}for(;B&&B!==C&&!B.previousSibling;)B=B.parentNode;if(!B||B===C)break;B=B.previousSibling}return null}function Fm(){if(!we||!wi.value||ha!=null)return;const C=Bm,B=()=>{ha=null,C===Bm&&(function(){var V,K;if(!(we&&wi.value&&S.value&&kl.value))return;const ee=S.value,he=kl.value;he.style.visibility="hidden";const ke=(function(){const De=Pm.value;for(let $e=De.length-1;$e>=0;$e--){const He=De[$e];if(!He||qk(He.node)||!Im(He.index))continue;const Qe=Os.get(He.index);if(!Qe)continue;const Ze=pE(Qe);if(Ze)return Ze}return null})();if(!ke)return;let Se=0,Pe=0,Ee=20,We=!1;if(ke?.textContent){const De=ke.textContent.length,$e=document.createRange();$e.setStart(ke,Math.max(0,De-1)),$e.setEnd(ke,De);const He=typeof $e.getClientRects=="function"?$e.getClientRects():void 0,Qe=(K=He?.[He.length-1])!=null?K:(V=ke.parentElement)==null?void 0:V.getBoundingClientRect();if(Qe){const Ze=mt("typewriterCursor.root.getBoundingClientRect",()=>ee.getBoundingClientRect());Se=Qe.right-Ze.left+ee.scrollLeft,Pe=Qe.top-Ze.top+ee.scrollTop,Ee=Qe.height||Ee,We=!0}$e.detach()}We&&(he.style.transform=`translate(${Math.max(0,Se)}px, ${Math.max(0,Pe)}px)`,he.style.height=`${Ee}px`,he.style.visibility="visible")})()};pe?ha=pe(B):B()}return Ke([ue,()=>s.content,()=>s.nodes,()=>k.typewriter,j],()=>zn(null,null,function*(){var C,B;if(!we||ze.value||!U.value)return;if(j.value)return wi.value=!1,Pd(),void Rd();if((C=s.nodes)!=null&&C.length)return wi.value=!1,Pd(),Rd(),Nd=((B=s.content)!=null?B:"").length,void(Ld=ue.value.length);const V=(function(){var Se,Pe;return(Se=s.nodes)!=null&&Se.length?s.nodes.reduce((Ee,We)=>Ee+Od(We),0):((Pe=s.content)!=null?Pe:"").length})(),K=(function(){var Se;return(Se=s.nodes)!=null&&Se.length?s.nodes.reduce((Pe,Ee)=>Pe+Od(Ee),0):ue.value.length})(),ee=!qk(st.value[st.value.length-1]),he=V>Nd,ke=K>Ld;if(k.typewriter===!1||!ee||!he&&!ke)return k.typewriter!==!1&&ee||(wi.value=!1,Rd()),Nd=V,void(Ld=K);Nd=V,Ld=K,wi.value=!0,kl.value&&(kl.value.style.visibility="hidden"),Pd(),yield ht(),Fm(),Hc=setTimeout(()=>{Hc=void 0,wi.value=!1},3e3)}),{flush:"post",immediate:!0}),Ke(wi,C=>zn(null,null,function*(){C?(yield ht(),Fm()):Rd()}),{flush:"post"}),Ke([()=>_s.value,()=>xs.start,()=>xs.end],()=>zn(null,null,function*(){we&&!ze.value&&U.value&&wi.value&&(yield ht(),Fm())}),{flush:"post"}),ls(()=>{Pd(),jk(),Rn.clear()}),(C,B)=>{const V=HI("NodeRenderer",!0);return x(ze)?(w(!0),N(Le,{key:0},nt(Pm.value,K=>(w(),N(Le,{key:K.index},[K.rendersCustomNode?(w(),ve(Hs(K.component),dn({key:0,ref_for:!0},K.customBindings,{node:K.node,loading:K.node.loading,"index-key":K.indexKey,"custom-id":k.customId,"is-dark":k.isDark,onClick:Dm,onMouseover:Hk,onMouseout:Wk,onCopy:B[0]||(B[0]=ee=>o("copy",ee)),onHandleArtifactClick:B[1]||(B[1]=ee=>o("handleArtifactClick",ee))}),{default:_e(()=>[K.hasSlotChildren?(w(),ve(V,dn({key:0,ref_for:!0},In.value,{nodes:K.node.children,"index-key":K.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):K.slotContent?(w(),ve(V,dn({key:1,ref_for:!0},In.value,{content:K.slotContent,final:!K.node.loading,"index-key":`${K.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ie("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(w(),ve(Hs(K.component),dn({key:1,node:K.node,loading:K.node.loading,"index-key":K.indexKey},{ref_for:!0},K.bindings,{"custom-id":k.customId,"is-dark":k.isDark,onClick:Dm,onMouseover:Hk,onMouseout:Wk,onCopy:B[2]||(B[2]=ee=>o("copy",ee)),onHandleArtifactClick:B[3]||(B[3]=ee=>o("handleArtifactClick",ee))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(w(),N("div",{key:1,ref_key:"containerRef",ref:S,class:Re(["markstream-vue markdown-renderer",[{dark:k.isDark},{virtualized:Nt.value},{"virtual-scroll-coordinated":us.value}]]),"data-custom-id":k.customId,onClick:Dm,onMouseover:cE,onMouseout:uE},[oi.value||Nt.value?(w(),N(Le,{key:0},[oi.value?(w(),N("div",{key:0,class:"height-estimation-probes",style:Gt({width:`${qs.value}px`}),"aria-hidden":"true"},[T("div",{ref_key:"paragraphProbeWrapperRef",ref:I,class:"node-content","data-probe":"paragraph"},[oe(x(ql),{node:$n.value,"index-key":"probe-paragraph"},null,8,["node"])],512),T("div",{ref_key:"listItemProbeWrapperRef",ref:P,class:"node-content","data-probe":"list-item"},[T("ul",BV,[oe(x(tc),{node:Ge.value,"index-key":"probe-list-item"},null,8,["node"])])],512),T("div",{ref_key:"listProbeWrapperRef",ref:D,class:"node-content","data-probe":"list"},[oe(x(nc),{node:Ye.value,"index-key":"probe-list"},null,8,["node"])],512),(w(),N(Le,null,nt(6,K=>T("div",{key:`probe-heading-${K}`,ref_for:!0,ref:ee=>(function(he,ke){he<1||he>6||(W[he]=ke)})(K,ee),class:"node-content","data-probe":`heading-${K}`},[oe(x(Rp),{node:L4(K),"index-key":`probe-heading-${K}`},null,8,["node","index-key"])],8,FV)),64))],4)):ie("",!0),Nt.value?(w(),N("div",{key:1,class:"node-spacer",style:Gt({height:`${nm.value}px`}),"aria-hidden":"true"},null,4)):ie("",!0)],64)):ie("",!0),(w(!0),N(Le,null,nt(Pm.value,K=>(w(),N("div",{key:K.index,ref_for:!0,ref:ee=>Tk(K.index,ee),class:"node-slot","data-node-index":K.index,"data-node-type":K.node.type},[Im(K.index)?(w(),N("div",{key:0,ref_for:!0,ref:ee=>(function(he,ke){var Se;ke||(function(De){const $e=`${om()}-${De}`;let He=!1;for(const Qe of Array.from(_o.keys())){const Ze=bi.get(Qe);(Ze?.index===De||Qe===$e||Qe.startsWith(`${$e}-`))&&(_o.delete(Qe),bi.delete(Qe),He=!0)}He&&(oa(),An("async-node"))})(he),Li.delete(he),(function(De){var $e;const He=(($e=dl.get(De))!=null?$e:0)+1;dl.set(De,He)})(he);const Pe=ur.get(he);if(Pe){for(const De of Pe)_d(De);ur.delete(he)}if((function(De){const $e=ft.get(De);$e&&(Ne?.unobserve($e),me.delete($e),ft.delete(De))})(he),!ke||!Xe.value)return ki.delete(he),void dl.delete(he);ki.set(he,ke);const Ee=()=>{Id(he,ke)};queueMicrotask(Ee);const We=(Ne||typeof ResizeObserver>"u"||(Ne=new ResizeObserver(De=>{if(De.length)for(const $e of De){const He=me.get($e.target),Qe=ft.get(He??-1);He!=null&&Qe&&Id(He,Qe)}else Pi()})),Ne);if(We&&(ft.set(he,ke),me.set(ke,he),We.observe(ke)),typeof window<"u"){const De=((Se=st.value[he])==null?void 0:Se.type)==="code_block"?[16,80,240,800]:j.value?[80]:[];if(De.length){const $e=De.map(He=>Yy(He,Ee,"node-resize")).filter(He=>He!=null);$e.length&&ur.set(he,$e)}}})(K.index,ee),class:"node-content"},[K.isCodeBlock?K.rendersCustomNode?(w(),ve(Hs(K.component),dn({key:1,ref_for:!0},K.customBindings,{node:K.node,loading:K.node.loading,"index-key":K.indexKey,"custom-id":k.customId,"is-dark":k.isDark,onCopy:B[8]||(B[8]=ee=>o("copy",ee)),onHandleArtifactClick:B[9]||(B[9]=ee=>o("handleArtifactClick",ee))}),{default:_e(()=>[K.hasSlotChildren?(w(),ve(V,dn({key:0,ref_for:!0},In.value,{nodes:K.node.children,"index-key":K.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):K.slotContent?(w(),ve(V,dn({key:1,ref_for:!0},In.value,{content:K.slotContent,final:!K.node.loading,"index-key":`${K.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ie("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(w(),ve(Hs(K.component),dn({key:2,node:K.node,loading:K.node.loading,"index-key":K.indexKey},{ref_for:!0},K.bindings,{"custom-id":k.customId,"is-dark":k.isDark,onCopy:B[10]||(B[10]=ee=>o("copy",ee)),onHandleArtifactClick:B[11]||(B[11]=ee=>o("handleArtifactClick",ee))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(w(),ve(Gr,{key:0,name:"fade",css:k.fade!==!1,appear:k.fade!==!1},{default:_e(()=>[K.rendersCustomNode?(w(),ve(Hs(K.component),dn({key:0,ref_for:!0},K.customBindings,{node:K.node,loading:K.node.loading,"index-key":K.indexKey,"custom-id":k.customId,"is-dark":k.isDark,onCopy:B[4]||(B[4]=ee=>o("copy",ee)),onHandleArtifactClick:B[5]||(B[5]=ee=>o("handleArtifactClick",ee))}),{default:_e(()=>[K.hasSlotChildren?(w(),ve(V,dn({key:0,ref_for:!0},In.value,{nodes:K.node.children,"index-key":K.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):K.slotContent?(w(),ve(V,dn({key:1,ref_for:!0},In.value,{content:K.slotContent,final:!K.node.loading,"index-key":`${K.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ie("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(w(),ve(Hs(K.component),dn({key:1,node:K.node,loading:K.node.loading,"index-key":K.indexKey},{ref_for:!0},K.bindings,{"custom-id":k.customId,"is-dark":k.isDark,onCopy:B[6]||(B[6]=ee=>o("copy",ee)),onHandleArtifactClick:B[7]||(B[7]=ee=>o("handleArtifactClick",ee))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(w(),N("div",{key:1,class:"node-placeholder",style:Gt({height:`${Cd(K.index)}px`})},null,4))],8,HV))),128)),wi.value?(w(),N("span",{key:1,ref_key:"typewriterCursorRef",ref:kl,class:"typewriter-cursor","aria-hidden":"true"},null,512)):ie("",!0),Nt.value?(w(),N("div",{key:2,class:"node-spacer",style:Gt({height:`${sm.value}px`}),"aria-hidden":"true"},null,4)):ie("",!0)],42,DV))}}})),[["__scopeId","data-v-2e8e6e17"]]),yo=u3;yo.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",yo.__name,yo.name].filter(n=>!!n));for(const n of t)e.component(n,u3)};const my=Object.freeze(Object.defineProperty({__proto__:null,default:yo},Symbol.toStringTag,{value:"Module"})),WV={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"},zV={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"},UV={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"},qV={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"},jV={class:"admonition-title"},VV=["aria-expanded","aria-controls"],KV=["id"],Hf=un(je({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:t}){var n;const s=e,o=t,i=F(()=>{if(s.node.title&&s.node.title.trim().length)return s.node.title;const c=s.node.kind||"note";return c.charAt(0).toUpperCase()+c.slice(1)}),r=Z(!!s.node.collapsible&&!((n=s.node.open)==null||n));function l(){s.node.collapsible&&(r.value=!r.value)}const a=`admonition-${Math.random().toString(36).slice(2,9)}`;return(c,u)=>(w(),N("div",{class:Re(["admonition",[`admonition-${s.node.kind}`]])},[T("div",{id:a,class:"admonition-legend"},[s.node.kind==="note"||s.node.kind==="info"?(w(),N("svg",WV,[...u[1]||(u[1]=[T("circle",{cx:"12",cy:"12",r:"10"},null,-1),T("path",{d:"M12 16v-4"},null,-1),T("path",{d:"M12 8h.01"},null,-1)])])):s.node.kind==="tip"?(w(),N("svg",zV,[...u[2]||(u[2]=[T("path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5"},null,-1),T("path",{d:"M9 18h6"},null,-1),T("path",{d:"M10 22h4"},null,-1)])])):s.node.kind==="warning"||s.node.kind==="caution"?(w(),N("svg",UV,[...u[3]||(u[3]=[T("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"},null,-1),T("path",{d:"M12 9v4"},null,-1),T("path",{d:"M12 17h.01"},null,-1)])])):s.node.kind==="danger"||s.node.kind==="error"?(w(),N("svg",qV,[...u[4]||(u[4]=[T("polygon",{points:"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"},null,-1),T("path",{d:"M12 8v4"},null,-1),T("path",{d:"M12 16h.01"},null,-1)])])):ie("",!0),T("span",jV,R(i.value),1),s.node.collapsible?(w(),N("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${a}-content`,onClick:l},[(w(),N("svg",{style:Gt({rotate:r.value?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[...u[5]||(u[5]=[T("path",{d:"m9 18 6-6-6-6"},null,-1)])],4))],8,VV)):ie("",!0)]),Mn(T("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[oe(x(yo),{"index-key":`admonition-${e.indexKey}`,nodes:s.node.children,"custom-id":s.customId,typewriter:s.typewriter,fade:s.fade,onCopy:u[0]||(u[0]=d=>o("copy",d))},null,8,["index-key","nodes","custom-id","typewriter","fade"])],8,KV),[[Qo,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);Hf.install=e=>{e.component(Hf.__name,Hf)};const d3=()=>Xs(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let hf=null,GV=d3;function _he(){return zn(this,null,function*(){if(hf)return hf;const e=GV;if(!e)return null;let t;try{t=yield e()}catch(n){throw e===d3?new Error('Optional dependency "@terrastruct/d2" is not installed. Please install it to enable D2 diagrams.'):n}return t?(hf=(function(n){var s;if(!n)return n;if(n.D2&&typeof n.D2=="function")return n.D2;if(n.default&&n.default.D2&&typeof n.default.D2=="function")return n.default.D2;const o=(s=n.default)!=null?s:n;return typeof o=="function"?o:o?.D2&&typeof o.D2=="function"?o.D2:o})(t),hf):null})}function whe(){return!1}function She(){return zn(this,null,function*(){return null})}const mf=Z(!1);let TS=!1;function Kg(){const e=document.documentElement.dataset.colorScheme;return e==="dark"?!0:e==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function YV(){return!TS&&typeof window<"u"&&typeof document<"u"&&(TS=!0,mf.value=Kg(),new MutationObserver(()=>{mf.value=Kg()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{mf.value=Kg()})),mf}const f3=["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"],XV=new Set(["AGENTS.md","CHANGELOG.md","Dockerfile","LICENSE","Makefile","README.md","package.json","pnpm-lock.yaml","pnpm-workspace.yaml","tsconfig.json","vite.config.ts"]),$1=[...f3].sort((e,t)=>t.length-e.length).join("|"),Gg=new RegExp([String.raw`(?:^|[\s([{"'`+"`"+String.raw`])`,String.raw`(`,String.raw`(?:~|\.{1,2}|/)?(?:[A-Za-z0-9_.@+()[\]-]+/)+[A-Za-z0-9_.@+()[\]-]+(?:\.(?:${$1}))?`,String.raw`|`,String.raw`[A-Za-z0-9_.@+()[\]-]+\.(?:${$1})`,String.raw`)`,String.raw`(?:#L?(\d+)|:(\d+))?`,String.raw`(?=$|[\s)"'\]}>.,;!?,。;!?)])`].join(""),"gi"),p3=/[),.;!?,。;!?)]+$/;function QV(e){const t=e.toLowerCase();return f3.some(n=>t.endsWith(`.${n}`))}function ZV(e){const t=new Map,n=new RegExp(String.raw`\b(?:path|src)=["'](\/[^"']+\.(?:${$1}))["']`,"gi");let s;for(;(s=n.exec(e))!==null;){const o=s[1];if(!o)continue;const i=o.split("/").pop();i&&t.set(i,o)}return t}function JV(e,t={}){const n=e.trim();if(!n||/^[a-z][a-z0-9+.-]*:\/\//i.test(n))return null;const s=n.match(/^(.*?)(?:#L?(\d+)|:(\d+))?$/i);if(!s)return null;let o=(s[1]??"").replace(p3,"");if(!o)return null;const i=o.split("/").pop()??o,r=o.includes("/"),l=XV.has(i),a=QV(i);if(r&&!l&&!a)return null;if(!r&&!l){const d=t.aliases?.get(i);if(!d)return null;o=d}const c=s[2]??s[3],u=c?Number(c):void 0;return{path:o,line:u!==void 0&&Number.isFinite(u)&&u>0?u:void 0}}function eK(e,t={}){const n=[];Gg.lastIndex=0;let s;for(;(s=Gg.exec(e))!==null;){const o=s[0]??"",i=s[1]??"",r=o.indexOf(i);if(r<0)continue;const l=s[2]??s[3];let a=i+(l?o.slice(r+i.length):"");const c=a.replace(p3,""),u=a.length-c.length;a=c;const d=JV(a,t);if(!d)continue;const p=s.index+r,h=p+a.length;n.push({...d,start:p,end:h,text:a}),u>0&&(Gg.lastIndex-=u)}return n}const tK=12e4,nK=6e4,sK=32,oK=3e4,MS=/(^|\n)(`{3,}|~{3,})[^\n]*\n([\s\S]*?)(?:\n)?\2(?=\n|$)/g;function iK(e){let t=0,n=0,s=0;MS.lastIndex=0;let o;for(;(o=MS.exec(e))!==null;){const r=o[3]??"";t+=1,n+=r.length,s=Math.max(s,r.length)}return{codeRenderer:e.length>=tK||n>=nK||t>=sK||s>=oK?"pre":"shiki",codeFenceCount:t,codeChars:n}}function rK(e){return new Worker("/assets/katexRenderer.worker-CO_gEm4q.js",{type:"module",name:e?.name})}function lK(e){return new Worker("/assets/mermaidParser.worker-PTFfzpoB.js",{type:"module",name:e?.name})}const aK={key:1,class:"diff-wrap"},cK={class:"diff-bar"},uK=["onClick"],dK={class:"diff-pre"},fK="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",ES="github-light",IS="github-dark",pK=je({__name:"Markdown",props:{text:{},openFile:{},streaming:{type:Boolean,default:!1}},setup(e){qU(),sq(),VU(),aq(),jU(new rK),lq(new lK);function t(P){return P.inline.ruler.disable("math"),P}const{t:n}=It(),s=Ut("resolveImage"),o=Z(null),i=e,r=F(()=>!i.streaming),l=F(()=>ZV(i.text??"")),a=F(()=>i.streaming?{codeRenderer:"shiki",codeFenceCount:0,codeChars:0}:iK(i.text??"")),c=YV(),u=F(()=>!i.streaming),d=$s(new Map),p=new Set,h=/(!\[[^\]]*\]\()\s*([^)\s]+)([^)]*\))/g,f=/(<img\b[^>]*?\bsrc=")([^"]+)(")/gi;function m(P){return!/^(https?:|data:|blob:)/i.test(P)}function b(P){if(!s)return;const D=[];for(const W of[h,f]){W.lastIndex=0;let z;for(;(z=W.exec(P))!==null;)D.push(z[2]??"")}for(const W of D)!W||!m(W)||d.has(W)||p.has(W)||(p.add(W),s(W).then(z=>{d.set(W,z!==W?z:"")}).catch(()=>{d.set(W,"")}).finally(()=>{p.delete(W)}))}function _(P){if(!s)return P;const D=W=>{if(!m(W))return null;const z=d.get(W);return z===void 0?fK:z===""?null:z};return P.replace(h,(W,z,q,Q)=>{const X=D(q);return X===null?W:`${z}${X}${Q}`}).replace(f,(W,z,q,Q)=>{const X=D(q);return X===null?W:`${z}${X}${Q}`})}Ke(()=>i.text,P=>b(P??""),{immediate:!0});function g(){if(!o.value||!i.openFile||i.streaming)return;const P=document.createTreeWalker(o.value,NodeFilter.SHOW_TEXT),D=[];let W=P.nextNode();for(;W;){const z=W,q=z.parentElement;q&&!q.closest("a, pre, .md-file-link, svg")&&z.data.trim().length>0&&D.push(z),W=P.nextNode()}for(const z of D){const q=eK(z.data,{aliases:l.value});if(q.length===0||!z.parentNode)continue;const Q=document.createDocumentFragment();let X=0;for(const fe of q){fe.start>X&&Q.append(document.createTextNode(z.data.slice(X,fe.start)));const ye=document.createElement("button");ye.type="button",ye.className="md-file-link",ye.textContent=fe.text,ye.title=fe.line?`${fe.path}:${fe.line}`:fe.path,ye.addEventListener("click",Me=>{Me.preventDefault(),Me.stopPropagation(),i.openFile?.({path:fe.path,line:fe.line})}),Q.append(ye),X=fe.end}X<z.data.length&&Q.append(document.createTextNode(z.data.slice(X))),z.parentNode.replaceChild(Q,z)}}function v(P){return!(!P||/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(P))}function y(P){let D=P.length;for(const W of["#","?"]){const z=P.indexOf(W);z!==-1&&z<D&&(D=z)}return P.slice(0,D)}function A(){if(!o.value||!i.openFile||i.streaming)return;const P=o.value.querySelectorAll("a[href]");for(const D of P){if(D.dataset.mdLinkHandled==="true"||D.closest("svg"))continue;const W=D.getAttribute("href")??"";v(W)&&(D.dataset.mdLinkHandled="true",D.addEventListener("click",z=>{z.preventDefault(),z.stopPropagation(),i.openFile?.({path:y(W)})}))}}function O(){ht().then(()=>{g(),A()})}Ke(()=>i.text,O),Ke(()=>i.streaming,O);let $=null;hn(()=>{O(),o.value&&($=new MutationObserver(O),$.observe(o.value,{childList:!0,subtree:!0}))}),kn(()=>{$?.disconnect()});const k={showHeader:!0,showCopyButton:!0,showExpandButton:!1,showPreviewButton:!1,showCollapseButton:!1,showFontSizeButtons:!1,loading:!1},E=/(^|\n)(?:```|~~~)diff\b[^\n]*\n([\s\S]*?)(?:\n)?(?:```|~~~)(?=\n|$)/g,M=F(()=>{const P=_(i.text??""),D=[];let W=0;E.lastIndex=0;let z;for(;(z=E.exec(P))!==null;){const Q=z[1]??"",X=P.slice(W,z.index)+(Q||"");X.trim()&&D.push({kind:"md",text:X}),D.push({kind:"diff",code:z[2]??""}),W=E.lastIndex}const q=P.slice(W);return(q.trim()||D.length===0)&&D.push({kind:"md",text:q}),D});function L(P){return P.split(`
|
|
246
246
|
`).map(D=>/^\+(?!\+\+)/.test(D)?{cls:"diff-add",text:D}:/^-(?!--)/.test(D)?{cls:"diff-del",text:D}:D.startsWith("@@")?{cls:"diff-hunk",text:D}:{cls:"diff-ctx",text:D})}const S=Z(null);function I(P,D){zs(P).then(W=>{W&&(S.value=D,setTimeout(()=>{S.value=null},1400))})}return(P,D)=>(w(),N("div",{ref_key:"mdRef",ref:o,class:"md"},[(w(!0),N(Le,null,nt(M.value,(W,z)=>(w(),N(Le,{key:z},[W.kind==="md"?(w(),ve(x(yo),{key:0,content:W.text,"custom-markdown-it":t,mode:"chat","code-renderer":a.value.codeRenderer,"is-dark":x(c),"code-block-light-theme":ES,"code-block-dark-theme":IS,themes:[ES,IS],"code-block-props":k,final:r.value,"smooth-streaming":e.streaming,"batch-rendering":u.value,"defer-nodes-until-visible":!1},null,8,["content","code-renderer","is-dark","themes","final","smooth-streaming","batch-rendering"])):(w(),N("div",aK,[T("div",cK,[D[0]||(D[0]=T("span",{class:"diff-lang"},"diff",-1)),oe(Ht,{text:x(n)("filePreview.copyCode")},{default:_e(()=>[T("button",{class:"diff-copy",onClick:q=>I(W.code,z)},R(S.value===z?"✓":"⧉"),9,uK)]),_:2},1032,["text"])]),T("pre",dK,[T("code",null,[(w(!0),N(Le,null,nt(L(W.code),(q,Q)=>(w(),N("span",{key:Q,class:Re(q.cls)},R(q.text),3))),128))])])]))],64))),128))],512))}}),Oh=ut(pK,[["__scopeId","data-v-96a9bd63"]]),hK={class:"tc-anim"},mK={class:"prev-anim"},gK={class:"prev"},vK=je({__name:"ThinkingBlock",props:{text:{},mobile:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1},foldable:{type:Boolean,default:!0}},emits:["open"],setup(e,{emit:t}){const n=e,s=t,o=F(()=>n.text.split(/\n{2,}/).filter(c=>c.trim().length>0)),i=F(()=>n.foldable&&o.value.length>1),r=F(()=>n.streaming||!i.value),l=F(()=>o.value.pop()??""),a=Z(null);return hn(()=>{if(!n.streaming)return;const c=a.value;c&&(c.scrollTop=c.scrollHeight)}),Ke(()=>n.text,()=>{const c=a.value;!c||!(c.scrollHeight-c.scrollTop-c.clientHeight<24)||ht(()=>{a.value&&(a.value.scrollTop=a.value.scrollHeight)})},{immediate:!0}),(c,u)=>(w(),N("div",{class:Re(["think",{mob:e.mobile}])},[i.value?(w(),N("div",{key:0,class:Re(["tc-wrap",{"is-collapsed":!r.value}]),onClick:u[0]||(u[0]=d=>s("open"))},[T("div",hK,[T("pre",{ref_key:"bodyEl",ref:a,class:"tc"},R(e.text),513)]),T("div",mK,[T("span",gK,R(l.value),1)])],2)):(w(),N("pre",{key:1,ref_key:"bodyEl",ref:a,class:"tc"},R(e.text),513))],2))}}),yK=ut(vK,[["__scopeId","data-v-7bcec011"]]),kK={class:"activity-notice",role:"status"},bK={"aria-hidden":"true"},_K={class:"an-label"},wK=je({__name:"ActivityNotice",props:{label:{}},setup(e){return(t,n)=>(w(),N("div",kK,[T("span",bK,[oe(ni,{size:"sm"})]),T("span",_K,R(e.label),1)]))}}),SK=ut(wK,[["__scopeId","data-v-59b71004"]]);function h3(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 N1(e){switch(e){case"idle":return"idle";case"running":return"running";case"awaiting_approval":return"awaitingApproval";case"awaiting_question":return"awaitingQuestion";case"aborted":return"aborted"}}function CK(e){switch(e){case"idle":return"idle";case"running":return"running";case"awaitingApproval":return"awaiting_approval";case"awaitingQuestion":return"awaiting_question";case"aborted":return"aborted"}}function Ti(e){return{id:e.id,title:e.title,createdAt:e.created_at,updatedAt:e.updated_at,status:N1(e.status),archived:e.archived??!1,currentPromptId:e.current_prompt_id,lastPrompt:e.last_prompt,cwd:e.metadata.cwd,model:e.agent_config.model,usage:h3(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 Su(e){return{id:e.id,root:e.root,name:e.name,isGitRepo:e.is_git_repo,branch:e.branch??void 0,lastOpenedAt:e.last_opened_at,sessionCount:e.session_count}}function $S(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 gy(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:$S(e.source)};case"video":return{type:"video",source:$S(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 L1(e){return{id:e.id,sessionId:e.session_id,role:e.role,content:e.content.map(gy),createdAt:e.created_at,promptId:e.prompt_id,parentMessageId:e.parent_message_id,metadata:e.metadata}}function xK(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 AK(e){return{content:e.content.map(xK),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 TK(e){return{decision:e.decision,scope:e.scope,feedback:e.feedback,selected_label:e.selectedLabel}}function m3(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 MK(e){return{id:e.id,label:e.label,description:e.description,recommended:e.recommended===!0||e.is_recommended===!0}}function EK(e){return{id:e.id,question:e.question,header:e.header,body:e.body,options:e.options.map(MK),multiSelect:e.multi_select,allowOther:e.allow_other,otherLabel:e.other_label,otherDescription:e.other_description}}function g3(e){return{questionId:e.question_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,questions:e.questions.map(EK),createdAt:e.created_at}}function IK(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 $K(e){const t={};for(const[n,s]of Object.entries(e.answers))t[n]=IK(s);return{answers:t,method:e.method,note:e.note}}function O1(e){return{id:e.id,sessionId:e.session_id,kind:e.kind,description:e.description,status:e.status,command:e.command,createdAt:e.created_at,startedAt:e.started_at,completedAt:e.completed_at,outputPreview:e.output_preview,outputBytes:e.output_bytes,subagentPhase:e.subagent_phase,subagentType:e.subagent_type,parentToolCallId:e.parent_tool_call_id,suspendedReason:e.suspended_reason,swarmIndex:e.swarm_index,runInBackground:e.kind==="subagent"?!0:void 0}}function NS(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 xr(e,t){const n=e[t];return typeof n=="string"?n:void 0}function Ca(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function Uo(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function NK(e){if(!e||typeof e!="object")return null;const t=e,n=xr(t,"status");if(n!=="active"&&n!=="paused"&&n!=="blocked"&&n!=="complete")return null;const s=t.budget,o=s&&typeof s=="object"?s:{};return{goalId:xr(t,"goalId")??xr(t,"goal_id")??"goal",objective:xr(t,"objective")??"",completionCriterion:xr(t,"completionCriterion")??xr(t,"completion_criterion"),status:n,turnsUsed:Ca(t,"turnsUsed")??Ca(t,"turns_used")??0,tokensUsed:Ca(t,"tokensUsed")??Ca(t,"tokens_used")??0,wallClockMs:Ca(t,"wallClockMs")??Ca(t,"wall_clock_ms")??0,terminalReason:xr(t,"terminalReason")??xr(t,"terminal_reason"),budget:{tokenBudget:Uo(o,"tokenBudget")??Uo(o,"token_budget"),remainingTokens:Uo(o,"remainingTokens")??Uo(o,"remaining_tokens"),turnBudget:Uo(o,"turnBudget")??Uo(o,"turn_budget"),remainingTurns:Uo(o,"remainingTurns")??Uo(o,"remaining_turns"),wallClockBudgetMs:Uo(o,"wallClockBudgetMs")??Uo(o,"wall_clock_budget_ms"),remainingWallClockMs:Uo(o,"remainingWallClockMs")??Uo(o,"remaining_wall_clock_ms"),overBudget:o.overBudget===!0||o.over_budget===!0}}}function LK(e){const t=e;switch(e.type){case"event.session.created":return{type:"sessionCreated",session:Ti(t.payload.session)};case"event.session.updated":return{type:"sessionUpdated",session:Ti(t.payload.session),changedFields:t.payload.changed_fields};case"event.session.deleted":return{type:"sessionDeleted",sessionId:t.session_id};case"event.workspace.created":return{type:"workspaceCreated",workspace:Su(t.payload.workspace)};case"event.workspace.updated":return{type:"workspaceUpdated",workspace:Su(t.payload.workspace)};case"event.workspace.deleted":return{type:"workspaceDeleted",workspaceId:t.payload.workspace_id,root:t.payload.root};case"event.session.status_changed":return{type:"sessionStatusChanged",sessionId:t.session_id,status:N1(t.payload.status),previousStatus:N1(t.payload.previous_status),currentPromptId:t.payload.current_prompt_id};case"event.session.usage_updated":return{type:"sessionUsageUpdated",sessionId:t.session_id,usage:h3(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=NK(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:L1(t.payload.message)};case"event.message.updated":return{type:"messageUpdated",sessionId:t.session_id,messageId:t.payload.message_id,content:t.payload.content.map(gy),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:m3(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:g3(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:O1(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:P1(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 OK(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 LS(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 P1(e){const t={};for(const[n,s]of Object.entries(e.providers))t[n]={type:s.type,baseUrl:s.base_url,defaultModel:s.default_model,hasApiKey:s.has_api_key};return{providers:t,defaultProvider:e.default_provider,defaultModel:e.default_model,models:e.models,thinking:e.thinking,planMode:e.plan_mode,yolo:e.yolo,defaultPermissionMode:e.default_permission_mode,defaultPlanMode:e.default_plan_mode,permission:e.permission,hooks:e.hooks,services:e.services,mergeAllAvailableSkills:e.merge_all_available_skills,extraSkillDirs:e.extra_skill_dirs,loopControl:e.loop_control,background:e.background,experimental:e.experimental,telemetry:e.telemetry,raw:e.raw}}function PK(e){return e.session_id}function RK(e){return e.seq}const DK="main",BK=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.use","tool.call.started","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.completed"]);function Lr(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 FK(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 OS(){return{turnPromptId:new Map,currentPromptId:void 0,currentAssistantMsgId:void 0,turnTextLen:0,turnThinkLen:0,toolStartTimes:new Map,totalInput:0,totalOutput:0,totalCacheRead:0,totalCacheCreate:0,contextTokens:0,contextLimit:0,turnCount:0,model:"",messages:[],subagentMeta:new Map}}function co(e,t){const n=e[t];return typeof n=="string"?n:void 0}function El(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function qo(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function HK(e){if(!e||typeof e!="object")return null;const t=e,n=t.budget,s=n&&typeof n=="object"?n:{},o=co(t,"status");if(o!=="active"&&o!=="paused"&&o!=="blocked"&&o!=="complete")return null;const i=co(t,"goalId")??co(t,"goal_id")??"goal",r=co(t,"objective")??"";return{goalId:i,objective:r,completionCriterion:co(t,"completionCriterion")??co(t,"completion_criterion"),status:o,turnsUsed:El(t,"turnsUsed")??El(t,"turns_used")??0,tokensUsed:El(t,"tokensUsed")??El(t,"tokens_used")??0,wallClockMs:El(t,"wallClockMs")??El(t,"wall_clock_ms")??0,terminalReason:co(t,"terminalReason")??co(t,"terminal_reason"),budget:{tokenBudget:qo(s,"tokenBudget")??qo(s,"token_budget"),remainingTokens:qo(s,"remainingTokens")??qo(s,"remaining_tokens"),turnBudget:qo(s,"turnBudget")??qo(s,"turn_budget"),remainingTurns:qo(s,"remainingTurns")??qo(s,"remaining_turns"),wallClockBudgetMs:qo(s,"wallClockBudgetMs")??qo(s,"wall_clock_budget_ms"),remainingWallClockMs:qo(s,"remainingWallClockMs")??qo(s,"remaining_wall_clock_ms"),overBudget:s.overBudget===!0||s.over_budget===!0}}}function Wa(e,t,n,s){if(typeof n!="string"||n.length===0)return null;const i={...e.subagentMeta.get(n)??{id:n,sessionId:t,kind:"subagent",description:"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued"},...s,id:n,sessionId:t,kind:"subagent"};return e.subagentMeta.set(n,i),i}function WK(e,t){if(e==="turn.step.started")return null;if(e==="tool.use"||e==="tool.call.started"){const n=co(t,"name")??co(t,"toolName")??"tool",s=id(zK(n)),o=UK(n,t.args??t.input);return o?`Calling ${s}: ${o}`:`Calling ${s}`}if(e==="tool.progress"){const n=t.update;if(n&&typeof n=="object"){const o=co(n,"text");if(o)return Yg(o);const i=co(n,"message");if(i)return Yg(i)}const s=co(t,"message");if(s)return Yg(s)}return null}function zK(e){return e.replace(/_\d+$/,"")}const PS=2e3;function Yg(e){return e.length>PS?`${e.slice(0,PS)}…`:e}function UK(e,t){if(t==null)return"";const n=typeof t=="string"?t:JSON.stringify(t);return Bu(e,n)}function qK(e,t,n,s,o,i){if(i.has(n)&&s==="turn.step.started")return[];if(s==="assistant.delta"){const u=co(o,"delta");if(!u)return[];const d=e.subagentMeta.get(n),p=Wa(e,t,n,{status:"running",subagentPhase:"working",startedAt:d?.startedAt??new Date().toISOString()}),h=[];return p&&h.push({type:"taskCreated",sessionId:t,task:p}),h.push({type:"taskProgress",sessionId:t,taskId:n,outputChunk:u,stream:"stdout",kind:"text"}),h}const r=WK(s,o);if(r===null||r.length===0)return[];const l=e.subagentMeta.get(n),a=Wa(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 gf(e){return{...e,content:e.content.map(t=>({...t}))}}function RS(e,t,n){const s={id:Lr("msg_"),sessionId:t,role:"assistant",content:[],createdAt:new Date().toISOString(),promptId:n};return e.messages.push(s),s}function jK(e,t,n,s,o,i){const r={id:s,sessionId:t,role:"user",content:o,createdAt:i,promptId:n};return e.messages.push(r),r}function VK(e){return Array.isArray(e)?e.map(t=>gy(t)):[]}function DS(e,t,n,s){const o=e.messages.find(r=>r.id===t);if(!o)return-1;const i=o.content.at(-1);return i&&i.type===n?(n==="text"?i.text+=s:i.thinking+=s,o.content.length-1):(o.content.push(n==="text"?{type:"text",text:s}:{type:"thinking",thinking:s}),o.content.length-1)}function KK(e,t,n,s,o,i){const r=e.messages.find(l=>l.id===t);r&&r.content.push({type:"toolUse",toolCallId:n,toolName:s,input:o,outputLines:i})}function GK(e){const t=e.update,n=t&&typeof t=="object"?t:null,o=(n?.stream??n?.kind??e.stream)==="stderr"?"stderr":"stdout",i=typeof n?.text=="string"&&n.text||typeof n?.message=="string"&&n.message||typeof e.chunk=="string"&&e.chunk||typeof e.output=="string"&&e.output||typeof e.message=="string"&&e.message||"";return i.length>0?{outputChunk:i,stream:o}:null}function BS(e,t){e.messages.find(n=>n.id===t)}function YK(e,t,n,s,o,i){const r={id:Lr("msg_"),sessionId:t,role:"tool",content:[{type:"toolResult",toolCallId:n,output:s,isError:o}],createdAt:new Date().toISOString(),promptId:i};return e.messages.push(r),r}function Xg(e,t){return e.messages.find(n=>n.id===t)}function FS(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 XK(){const e=new Map,t=new Set;function n(u){let d=e.get(u);return d||(d=OS(),e.set(u,d)),d}function s(u){e.set(u,OS())}function o(u){t.add(u)}function i(u,d){const p=n(u);p.currentPromptId=d}function r(u,d){s(u);const p=n(u),h=d.promptId??Lr("pr_");p.currentPromptId=h,p.turnPromptId.set(d.turnId,h);const f=RS(p,u,h);d.thinkingText.length>0&&f.content.push({type:"thinking",thinking:d.thinkingText}),d.assistantText.length>0&&f.content.push({type:"text",text:d.assistantText});for(const m of d.runningTools){const b=typeof m.lastProgress?.text=="string"&&m.lastProgress.text.length>0?[m.lastProgress.text]:void 0;f.content.push({type:"toolUse",toolCallId:m.toolCallId,toolName:m.name,input:m.args??{},outputLines:b}),p.toolStartTimes.set(m.toolCallId,Date.now())}return p.currentAssistantMsgId=f.id,p.turnTextLen=d.assistantText.length,p.turnThinkLen=d.thinkingText.length,[{type:"sessionStatusChanged",sessionId:u,status:"running",previousStatus:"idle",currentPromptId:h},{type:"messageCreated",message:gf(f)}]}function l(u,d,p,h){try{return c(u,d,p,h)}catch(f){return console.error("[agentProjector] Error projecting event:",u,f instanceof Error?f.message:f),[]}}function a(u,d){return d===void 0?"append":d<u?"skip":d>u?"gap":"append"}function c(u,d,p,h){const f=n(p),m=d,b=[],_=m?.agentId;if(typeof _=="string"&&_!==DK){const g=t.has(_);if(g&&(u==="thinking.delta"||u==="assistant.delta")){const v=m?.delta??"";return v?[{type:"agentDelta",sessionId:p,agentId:_,delta:{[u==="thinking.delta"?"thinking":"text"]:v}}]:[]}if(g&&u==="turn.ended")return[{type:"agentTurnEnded",sessionId:p,agentId:_,reason:m?.reason}];if(BK.has(u))return qK(f,p,_,u,m??{},t)}switch(u){case"session.meta.updated":{const g=m?.patch?.title??m?.title,v=m?.patch?.lastPrompt,y={};typeof g=="string"&&g.length>0&&(y.title=g),typeof v=="string"&&(y.lastPrompt=v),(y.title!==void 0||y.lastPrompt!==void 0)&&b.push({type:"sessionMetaUpdated",sessionId:p,...y});break}case"prompt.submitted":{const g=m?.promptId,v=m?.userMessageId;if(!g||!v)break;const y=VK(m?.content);if(y.length===0)break;f.currentPromptId=g;const A=jK(f,p,g,v,y,typeof m?.createdAt=="string"?m.createdAt:new Date().toISOString());b.push({type:"messageCreated",message:gf(A)});break}case"turn.started":{const g=m?.turnId,v=f.currentPromptId??Lr("pr_");f.currentPromptId=v,g!==void 0&&f.turnPromptId.set(g,v),f.turnTextLen=0,f.turnThinkLen=0,b.push({type:"sessionStatusChanged",sessionId:p,status:"running",previousStatus:"idle",currentPromptId:v});break}case"turn.step.started":{const g=m?.turnId;let v=f.turnPromptId.get(g)??f.currentPromptId;v||(v=Lr("pr_"),f.currentPromptId=v,g!==void 0&&f.turnPromptId.set(g,v));const y=RS(f,p,v);f.currentAssistantMsgId=y.id,b.push({type:"messageCreated",message:gf(y)});break}case"thinking.delta":{const g=f.currentAssistantMsgId;if(!g)break;const v=m?.delta??"";if(!v)break;h?.offset===0&&f.turnThinkLen>0&&(f.turnThinkLen=0);const y=a(f.turnThinkLen,h?.offset);if(y==="skip")break;if(y==="gap"){b.push({type:"historyCompacted",sessionId:p,beforeSeq:0,reason:"delta_gap"});break}const A=DS(f,g,"thinking",v);if(A<0)break;f.turnThinkLen+=v.length,b.push({type:"assistantDelta",sessionId:p,messageId:g,contentIndex:A,delta:{thinking:v}});break}case"assistant.delta":{const g=f.currentAssistantMsgId;if(!g)break;const v=m?.delta??"";if(!v)break;h?.offset===0&&f.turnTextLen>0&&(f.turnTextLen=0);const y=a(f.turnTextLen,h?.offset);if(y==="skip")break;if(y==="gap"){b.push({type:"historyCompacted",sessionId:p,beforeSeq:0,reason:"delta_gap"});break}const A=DS(f,g,"text",v);if(A<0)break;f.turnTextLen+=v.length,b.push({type:"assistantDelta",sessionId:p,messageId:g,contentIndex:A,delta:{text:v}});break}case"tool.use":case"tool.call.started":{const g=f.currentAssistantMsgId,v=m?.turnId,y=f.turnPromptId.get(v)??f.currentPromptId;if(!g||!y)break;const A=m?.toolCallId,O=m?.name??m?.toolName??"",$=m?.args??m?.input??{};KK(f,g,A,O,$);const k=Xg(f,g);k&&k.content.length-1,f.toolStartTimes.set(A,Date.now()),k&&b.push({type:"messageUpdated",sessionId:p,messageId:g,content:k.content.map(E=>({...E})),status:"pending"});break}case"tool.call.delta":break;case"tool.progress":{const g=m?.toolCallId,v=GK(m??{});g&&v&&b.push({type:"toolOutput",sessionId:p,toolCallId:g,outputChunk:v.outputChunk,stream:v.stream});break}case"tool.result":{const g=m?.turnId;let v=f.turnPromptId.get(g)??f.currentPromptId;v||(v=Lr("pr_"),f.currentPromptId=v,g!==void 0&&f.turnPromptId.set(g,v));const y=m?.toolCallId,A=m?.output,O=m?.isError??!1;f.toolStartTimes.get(y)??Date.now(),f.toolStartTimes.delete(y);const $=YK(f,p,y,A,O,v);b.push({type:"messageCreated",message:gf($)}),f.currentAssistantMsgId=void 0;break}case"turn.step.completed":{const g=f.currentAssistantMsgId,v=FK(m?.usage);if(f.totalInput+=v.input,f.totalOutput+=v.output,f.totalCacheRead+=v.cacheRead,f.totalCacheCreate+=v.cacheCreate,g){BS(f,g);const y=Xg(f,g);y&&b.push({type:"messageUpdated",sessionId:p,messageId:g,content:y.content.map(A=>({...A})),status:"completed"})}break}case"agent.status.updated":{m?.model&&(f.model=m.model),m?.contextTokens!==void 0&&(f.contextTokens=m.contextTokens),m?.maxContextTokens!==void 0&&(f.contextLimit=m.maxContextTokens),b.push({type:"sessionUsageUpdated",sessionId:p,usage:FS(f),model:f.model||void 0,swarmMode:m?.swarmMode===!0?!0:m?.swarmMode===!1?!1:void 0,planMode:m?.planMode===!0?!0:m?.planMode===!1?!1:void 0});break}case"turn.ended":{const g=f.currentAssistantMsgId,v=m?.reason??"completed",y=El(m??{},"durationMs");if(g){BS(f,g);const $=Xg(f,g);$&&b.push({type:"messageUpdated",sessionId:p,messageId:g,content:$.content.map(k=>({...k})),status:v==="failed"||v==="filtered"?"error":"completed",durationMs:y})}f.turnCount++;const A=FS(f);b.push({type:"sessionUsageUpdated",sessionId:p,usage:A});const O=v==="cancelled"||v==="failed"||v==="filtered"?"aborted":"idle";b.push({type:"sessionStatusChanged",sessionId:p,status:O,previousStatus:"running"}),f.currentAssistantMsgId=void 0,f.currentPromptId=void 0,f.turnTextLen=0,f.turnThinkLen=0;break}case"prompt.completed":break;case"turn.step.retrying":case"turn.step.interrupted":{f.currentAssistantMsgId=void 0;break}case"subagent.spawned":{const v={id:typeof m?.subagentId=="string"&&m.subagentId.length>0?m.subagentId:Lr("task_"),sessionId:p,kind:"subagent",description:typeof m?.description=="string"?m.description:m?.subagentName??"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued",subagentType:typeof m?.subagentName=="string"?m.subagentName:void 0,parentToolCallId:typeof m?.parentToolCallId=="string"?m.parentToolCallId:void 0,swarmIndex:typeof m?.swarmIndex=="number"?m.swarmIndex:void 0,runInBackground:m?.runInBackground===!0};f.subagentMeta.set(v.id,v),b.push({type:"taskCreated",sessionId:p,task:v});break}case"subagent.started":{const g=Wa(f,p,m?.subagentId,{subagentPhase:"working",status:"running",startedAt:new Date().toISOString()});g&&b.push({type:"taskCreated",sessionId:p,task:g});break}case"subagent.suspended":{const g=Wa(f,p,m?.subagentId,{subagentPhase:"suspended",status:"running",suspendedReason:typeof m?.reason=="string"?m.reason:void 0});g&&b.push({type:"taskCreated",sessionId:p,task:g});break}case"subagent.completed":{const g=typeof m?.resultSummary=="string"?m.resultSummary:void 0,v=Wa(f,p,m?.subagentId,{subagentPhase:"completed",status:"completed",completedAt:new Date().toISOString(),outputPreview:g});v&&b.push({type:"taskCreated",sessionId:p,task:v}),b.push({type:"taskCompleted",sessionId:p,taskId:m?.subagentId??"",status:"completed",outputPreview:g});break}case"subagent.failed":{const g=typeof m?.error=="string"?m.error:void 0,v=Wa(f,p,m?.subagentId,{subagentPhase:"failed",status:"failed",completedAt:new Date().toISOString(),outputPreview:g});v&&b.push({type:"taskCreated",sessionId:p,task:v}),b.push({type:"taskCompleted",sessionId:p,taskId:m?.subagentId??"",status:"failed",outputPreview:g});break}case"error":{b.push({type:"unknown",raw:{_agentError:!0,code:m?.code,message:m?.message}});break}case"warning":{b.push({type:"unknown",raw:{_agentWarning:!0,message:m?.message}});break}case"background.task.started":{const g=m?.info??{},v=typeof g.startedAt=="number"?new Date(g.startedAt).toISOString():void 0,y=typeof g.taskId=="string"?g.taskId:typeof g.taskId=="number"?String(g.taskId):Lr("task_"),A=typeof g.description=="string"?g.description:typeof g.command=="string"?g.command:Un.global.t("tasks.defaultDescription"),O=typeof g.command=="string"?g.command:void 0;b.push({type:"taskCreated",sessionId:p,task:{id:y,sessionId:p,kind:"bash",description:A,command:O,status:"running",createdAt:v??new Date().toISOString(),startedAt:v,outputPreview:O!==void 0?`$ ${O}`:void 0}});break}case"background.task.terminated":{const g=m?.info??{},v=g.status==="failed"||typeof g.exitCode=="number"&&g.exitCode!==0;b.push({type:"taskCompleted",sessionId:p,taskId:typeof g.taskId=="string"?g.taskId:typeof g.taskId=="number"?String(g.taskId):"",status:v?"failed":"completed"});break}case"compaction.completed":{const g=m?.result??{};b.push({type:"compactionCompleted",sessionId:p,tokensBefore:typeof g.tokensBefore=="number"?g.tokensBefore:void 0,tokensAfter:typeof g.tokensAfter=="number"?g.tokensAfter:void 0,summary:typeof g.summary=="string"?g.summary:void 0}),b.push({type:"historyCompacted",sessionId:p,beforeSeq:0,reason:"auto_compact"});break}case"compaction.started":{b.push({type:"compactionStarted",sessionId:p,trigger:m?.trigger==="manual"?"manual":"auto",instruction:typeof m?.instruction=="string"?m.instruction:void 0});break}case"compaction.cancelled":{b.push({type:"compactionCancelled",sessionId:p});break}case"goal.updated":{const g=HK(m?.snapshot??null);b.push({type:"goalUpdated",sessionId:p,goal:g?.status==="complete"?null:g});break}}return b}return{project:l,bindNextPromptId:i,seedInFlight:r,reset:s,markSideChannelAgent:o}}const QK=new Set(["server_hello","ack","ping","resync_required","error","pong"]),HS=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.call.started","tool.use","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.submitted","prompt.completed","session.meta.updated","compaction.started","compaction.progress","compaction.completed","compaction.cancelled","goal.updated","error","warning","subagent.spawned","subagent.started","subagent.suspended","subagent.completed","subagent.failed","background.task.started","background.task.terminated"]),ZK=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"]),JK=new Set(["assistant.delta","thinking.delta"]);function eG(e,t){if(QK.has(e))return{route:"ignore"};const n=e.startsWith("event."),s=n?e.slice(6):e;return JK.has(s)?tG(t)?{route:"agent",agentType:s}:{route:"protocol"}:n?ZK.has(s)?{route:"protocol"}:HS.has(s)?{route:"agent",agentType:s}:{route:"protocol"}:HS.has(s)?{route:"agent",agentType:s}:{route:"agent",agentType:s}}function tG(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 Wf 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 $a 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 el(e){return e instanceof Wf||typeof e=="object"&&e!==null&&e.name==="DaemonApiError"&&typeof e.code=="number"}function v3(e){return e instanceof $a||typeof e=="object"&&e!==null&&e.name==="DaemonNetworkError"&&typeof e.method=="string"&&typeof e.path=="string"}const WS=1e3,Qg=16384,Zg=500,Jg=50,nG=6,sG=/api[_-]?key|authorization|token|secret|password|cookie|credential/i,oG=/^[A-Za-z0-9+/=_-]{200,}$/;let ev=null;function vi(){if(ev!==null)return ev;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=Qn(Et.debug)==="1"),ev=e,e}const Hr=[];let iG=1;const vy=Z(0),su=Ql(!1);function rG(){return Hr}function lG(){Hr.length=0,vy.value++}function rl(e){su.value||(Hr.push({id:iG++,ts:Date.now(),...e}),Hr.length>WS&&Hr.splice(0,Hr.length-WS),vy.value++)}function R1(e,t=0){if(e==null)return e;const n=typeof e;if(n==="number"||n==="boolean")return e;if(n==="string"){const o=e;return oG.test(o)?`[base64-like, ${o.length} chars omitted]`:o.length>Zg?`${o.slice(0,Zg)}… [+${o.length-Zg} chars]`:o}if(n!=="object")return String(e);if(t>=nG)return"[max depth]";if(Array.isArray(e)){const o=e.slice(0,Jg).map(i=>R1(i,t+1));return e.length>Jg&&o.push(`[+${e.length-Jg} more items]`),o}const s={};for(const[o,i]of Object.entries(e))s[o]=sG.test(o)?"[redacted]":R1(i,t+1);return s}function ea(e){if(e===void 0)return;const t=R1(e);try{const n=JSON.stringify(t);if(n!==void 0&&n.length>Qg)return{_truncated:`detail JSON was ${n.length} chars; first ${Qg} kept`,preview:n.slice(0,Qg)}}catch{return"[unserializable detail]"}return t}function tv(e){vi()&&rl({source:"rest",kind:"rest:request",label:`→ ${e.method} ${e.path}`,method:e.method,path:e.path,requestId:e.requestId,detail:{url:e.url,body:ea(e.body)}})}function vf(e){if(!vi())return;const t=e.code!==0;rl({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:ea(e.data)}})}function Xc(e){vi()&&rl({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 xa(e,t){vi()&&rl({source:"ws",kind:"ws:lifecycle",eventType:e,label:`ws ${e}`,detail:ea(t)})}function aG(e){if(!vi())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",s=t.payload,o=typeof s?.session_id=="string"?s.session_id:void 0;rl({source:"ws",kind:"ws:out",eventType:n,sessionId:o,label:`→ ${n}`,detail:ea(e)})}function cG(e){if(!vi())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",s=typeof t.session_id=="string"?t.session_id:typeof t.payload?.session_id=="string"?t.payload.session_id:void 0,o=typeof t.seq=="number"?t.seq:void 0,i=typeof t.offset=="number"?t.offset:void 0,r=[s,o!==void 0?`seq=${o}`:void 0,i!==void 0?`offset=${i}`:void 0,t.volatile===!0?"volatile":void 0].filter(Boolean);rl({source:"ws",kind:"ws:in",eventType:n,sessionId:s,seq:o,offset:i,label:`← ${n}${r.length>0?` (${r.join(" ")})`:""}`,detail:ea(t.payload)})}const uG={error:"✕",warn:"⚠",info:"ℹ",debug:"·",log:"·"};function nv(e,t,n){vi()&&rl({source:"client",kind:`client:${e}`,label:`${uG[e]} ${t}`,detail:ea(n)})}function Or(e,t){vi()&&rl({source:"client",kind:"client:event",label:`· ${e}`,detail:ea(t)})}let zS=!1;function dG(){if(!(zS||!vi())){zS=!0;try{typeof window<"u"&&(window.addEventListener("error",e=>{nv("error",e.message||"window error",{source:e.filename,line:e.lineno,col:e.colno,stack:e.error instanceof Error?e.error.stack:void 0})}),window.addEventListener("unhandledrejection",e=>{const t=e.reason;nv("error","unhandled promise rejection",{reason:t instanceof Error?`${t.name}: ${t.message}`:t,stack:t instanceof Error?t.stack:void 0})}))}catch{}for(const e of["error","warn","log","info","debug"]){const t=console[e];typeof t=="function"&&(console[e]=(...n)=>{try{nv(e,n.map(fG).join(" "),n.length>1?n:n[0])}catch{}t.apply(console,n)})}}}function fG(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 y3(e=Hr){if(typeof document>"u")return;const t=new Blob([pG(e)],{type:"application/x-ndjson"}),n=URL.createObjectURL(t),s=document.createElement("a");s.href=n,s.download=`king-web-log-${new Date().toISOString().replace(/[:.]/g,"-")}.jsonl`,document.body.appendChild(s),s.click(),s.remove(),URL.revokeObjectURL(n)}function pG(e=Hr){return e.map(t=>JSON.stringify(t)).join(`
|
|
247
247
|
`)}const yy="king-web.server-credential",hG="token";let Yu;const D1=new Set;function mG(){if(typeof window>"u")return;const e=window.location.hash??"";if(!e.startsWith("#"))return;const n=new URLSearchParams(e.slice(1)).get(hG);if(!n)return;const s=new URL(window.location.href);return s.hash="",window.history.replaceState(window.history.state,"",`${s.pathname}${s.search}`),n}function gG(){try{return globalThis.sessionStorage?.getItem(yy)??void 0}catch{return}}function vG(){const e=mG();return e?(b3(e),!0):(Yu=gG(),Yu!==void 0)}function k3(){return Yu}function b3(e){Yu=e;try{globalThis.sessionStorage?.setItem(yy,e)}catch{}}function yG(){Yu=void 0;try{globalThis.sessionStorage?.removeItem(yy)}catch{}}function kG(e){return D1.add(e),()=>{D1.delete(e)}}function bG(){yG();for(const e of D1)try{e()}catch{}}const Na=3e4,_3="0123456789ABCDEFGHJKMNPQRSTVWXYZ",US=500,_G=40101;function sv(){try{return AbortSignal.timeout(Na)}catch{return}}function wG(e,t){let n="",s=e;for(let o=0;o<t;o++)n=_3[s%32]+n,s=Math.floor(s/32);return n}function SG(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=>_3[n%32]).join("")}function ov(){return`${wG(Date.now(),10)}${SG(16)}`}function CG(e){try{const t=[];return e.forEach((n,s)=>{typeof n=="string"?t.push({field:s,value:n}):t.push({field:s,file:n.name,size:n.size,type:n.type})}),{formData:t}}catch{return"[FormData]"}}async function qS(e){try{const t=await e.text();return t?t.length>US?`${t.slice(0,US)}...`:t:void 0}catch{return}}class xG{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=cu(this.origin,t),s=ov(),o={"X-Request-Id":s};this.addClientHeaders(o);const i=Date.now();tv({method:"GET",path:t,url:n,requestId:s});let r;try{r=await fetch(n,{method:"GET",headers:o,signal:sv()})}catch(a){throw Xc({method:"GET",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-i,error:a}),new $a({message:`Network error calling GET ${t}`,cause:a,method:"GET",path:t,url:n,requestId:s,phase:"fetch",timeoutMs:Na,timestamp:Date.now(),durationMs:Date.now()-i})}if(r.ok)return vf({method:"GET",path:t,requestId:s,status:r.status,durationMs:Date.now()-i,code:0,msg:""}),r.blob();let l;try{l=await r.clone().json()}catch{}throw this.checkAuthRequired(r,l?.code??0),vf({method:"GET",path:t,requestId:s,status:r.status,durationMs:Date.now()-i,code:l?.code??r.status,msg:l?.msg??r.statusText,envelopeRequestId:l?.request_id}),new Wf({code:l?.code??r.status,msg:l?.msg??r.statusText,requestId:l?.request_id??s,details:l?.details,timestamp:Date.now(),durationMs:Date.now()-i})}async post(t,n,s){return this.request("POST",t,n,void 0,s?.allowCodes)}async postForm(t,n){const s=cu(this.origin,t),o=ov(),i={"X-Request-Id":o};this.addClientHeaders(i);const r=Date.now();tv({method:"POST",path:t,url:s,requestId:o,body:CG(n)});let l;try{l=await fetch(s,{method:"POST",headers:i,body:n,signal:sv()})}catch(u){throw Xc({method:"POST",path:t,requestId:o,phase:"fetch",durationMs:Date.now()-r,error:u}),new $a({message:`Network error calling POST ${t}`,cause:u,method:"POST",path:t,url:s,requestId:o,phase:"fetch",timeoutMs:Na,timestamp:Date.now(),durationMs:Date.now()-r})}let a;const c=l.clone();try{a=await l.json()}catch(u){throw Xc({method:"POST",path:t,requestId:o,phase:"parse",durationMs:Date.now()-r,status:l.status,error:u}),new $a({message:`Failed to parse JSON response from POST ${t}`,cause:u,method:"POST",path:t,url:s,requestId:o,phase:"parse",timeoutMs:Na,status:l.status,statusText:l.statusText,contentType:l.headers.get("content-type")??void 0,bodyPreview:await qS(c),timestamp:Date.now(),durationMs:Date.now()-r})}if(vf({method:"POST",path:t,requestId:o,status:l.status,durationMs:Date.now()-r,code:a.code,msg:a.msg,envelopeRequestId:a.request_id,data:a.data}),this.checkAuthRequired(l,a.code),a.code!==0)throw new Wf({code:a.code,msg:a.msg,requestId:a.request_id,details:a.details,timestamp:Date.now(),durationMs:Date.now()-r});return a.data}async patch(t,n){return this.request("PATCH",t,n)}async delete(t){return this.request("DELETE",t)}async request(t,n,s,o,i=[]){let r=cu(this.origin,n);if(o){const h=new URLSearchParams;for(const[m,b]of Object.entries(o))b!==void 0&&h.set(m,String(b));const f=h.toString();f&&(r=`${r}?${f}`)}const l=ov(),a={"X-Request-Id":l};this.addClientHeaders(a),s!==void 0&&(a["Content-Type"]="application/json; charset=utf-8");const c=Date.now();tv({method:t,path:n,url:r,requestId:l,body:s});let u;try{u=await fetch(r,{method:t,headers:a,body:s!==void 0?JSON.stringify(s):void 0,signal:sv()})}catch(h){throw Xc({method:t,path:n,requestId:l,phase:"fetch",durationMs:Date.now()-c,error:h}),new $a({message:`Network error calling ${t} ${n}`,cause:h,method:t,path:n,url:r,requestId:l,phase:"fetch",timeoutMs:Na,timestamp:Date.now(),durationMs:Date.now()-c})}let d;const p=u.clone();try{d=await u.json()}catch(h){throw Xc({method:t,path:n,requestId:l,phase:"parse",durationMs:Date.now()-c,status:u.status,error:h}),new $a({message:`Failed to parse JSON response from ${t} ${n}`,cause:h,method:t,path:n,url:r,requestId:l,phase:"parse",timeoutMs:Na,status:u.status,statusText:u.statusText,contentType:u.headers.get("content-type")??void 0,bodyPreview:await qS(p),timestamp:Date.now(),durationMs:Date.now()-c})}if(vf({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 Wf({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=k3();n!==void 0&&(t.Authorization=`Bearer ${n}`),this.identity!==void 0&&(t["X-Blun-Client-Id"]=this.identity.clientId,t["X-Blun-Client-Name"]=this.identity.clientName,t["X-Blun-Client-Version"]=this.identity.clientVersion,t["X-Blun-Client-Ui-Mode"]=this.identity.clientUiMode)}checkAuthRequired(t,n){(t.status===401||n===_G)&&bG()}}const AG="blun.bearer.";class TG{constructor(t,n,s){this.wsUrl=t,this.clientId=n,this.handlers=s}ws=null;connected=!1;closed=!1;subscriptions=new Map;pendingSubscriptions=[];terminalAttachments=new Map;msgSeq=0;reconnectAttempts=0;reconnectTimer=null;connect(){if(this.ws!==null||this.closed)return;xa("connect",{url:this.wsUrl,attempt:this.reconnectAttempts});const t=k3(),n=t!==void 0?[`${AG}${t}`]:void 0,s=new WebSocket(this.wsUrl,n);this.ws=s,s.onopen=()=>{xa("open")},s.onmessage=o=>{try{const i=JSON.parse(String(o.data));cG(i),this.handleFrame(i)}catch(i){xa("parse-error",{error:String(i)}),this.handlers.onError(0,`Failed to parse WS frame: ${String(i)}`,!1)}},s.onerror=()=>{xa("error"),this.handlers.onError(0,"WebSocket error",!1)},s.onclose=o=>{xa("close",o?{code:o.code,reason:o.reason,wasClean:o.wasClean}:void 0),this.connected=!1,this.ws=null,this.handlers.onConnectionState(!1),this.scheduleReconnect()}}scheduleReconnect(){if(this.closed||this.reconnectTimer!==null)return;const n=Math.min(3e4,1e3*2**this.reconnectAttempts)+Math.floor(Math.random()*250);this.reconnectAttempts+=1,xa("reconnect-scheduled",{delayMs:n,attempt:this.reconnectAttempts}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},n)}subscribe(t,n={seq:0}){if(this.subscriptions.set(t,{...n}),this.connected)this.sendSubscribe([t],{[t]:n});else{const s=this.pendingSubscriptions.findIndex(o=>o.sessionId===t);s!==-1&&this.pendingSubscriptions.splice(s,1),this.pendingSubscriptions.push({sessionId:t,cursor:{...n}})}}unsubscribe(t){this.subscriptions.delete(t);const n=this.pendingSubscriptions.findIndex(s=>s.sessionId===t);n!==-1&&this.pendingSubscriptions.splice(n,1),this.connected&&this.ws&&this.send({type:"unsubscribe",id:this.nextId(),payload:{session_ids:[t]}})}abort(t,n){!this.connected||!this.ws||this.send({type:"abort",id:this.nextId(),payload:{session_id:t,prompt_id:n}})}terminalAttach(t,n,s){const o=yf(t,n),i=this.terminalAttachments.get(o),r=s??i?.lastSeq??0;this.terminalAttachments.set(o,{sessionId:t,terminalId:n,lastSeq:r}),!(!this.connected||!this.ws)&&this.sendTerminalAttach(t,n,r)}terminalInput(t,n,s){!this.connected||!this.ws||this.send({type:"terminal_input",id:this.nextId(),payload:{session_id:t,terminal_id:n,data:s}})}terminalResize(t,n,s,o){!this.connected||!this.ws||this.send({type:"terminal_resize",id:this.nextId(),payload:{session_id:t,terminal_id:n,cols:s,rows:o}})}terminalDetach(t,n){this.terminalAttachments.delete(yf(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(yf(t,n)),!(!this.connected||!this.ws)&&this.send({type:"terminal_close",id:this.nextId(),payload:{session_id:t,terminal_id:n}})}close(){this.closed=!0,this.connected=!1,this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.ws&&(this.ws.close(1e3),this.ws=null)}handleFrame(t){const n=t;switch(t.type){case"server_hello":this.onServerHello();break;case"ping":this.send({type:"pong",payload:{nonce:n.payload.nonce}});break;case"resync_required":{const s=n.payload.session_id,o=n.payload.epoch;this.subscriptions.set(s,{seq:n.payload.current_seq,epoch:o}),this.handlers.onResync(s,n.payload.current_seq,o);break}case"error":{const s=n.session_id;typeof s=="string"&&this.handlers.onRawAgentEvent?this.handlers.onRawAgentEvent({type:"error",seq:n.seq,session_id:s,timestamp:n.timestamp,payload:n.payload}):this.handlers.onError(n.payload.code,n.payload.msg,n.payload.fatal);break}case"ack":break;case"terminal_output":{const s=n.session_id,o=n.terminal_id,i=n.seq,r=yf(s,o),l=this.terminalAttachments.get(r);l&&this.terminalAttachments.set(r,{...l,lastSeq:Math.max(l.lastSeq,i)});const a=typeof n.payload?.data=="string"?n.payload.data:"";this.handlers.onTerminalOutput?.(s,o,a,i);break}case"terminal_exit":{const s=n.session_id,o=n.terminal_id,i=n.payload?.exit_code,r=typeof i=="number"?i:null;this.handlers.onTerminalExit?.(s,o,r);break}default:{this.trackCursor(n);const s=n.type,o=eG(s,n.payload);if(o.route==="protocol"){this.handlers.onWireEvent(n);break}if(o.route==="agent"){if(this.handlers.onRawAgentEvent&&typeof n.session_id=="string"){const i=n,r=n;this.handlers.onRawAgentEvent({type:o.agentType,seq:i.seq,session_id:i.session_id,timestamp:i.timestamp,payload:i.payload,...r.volatile!==void 0?{volatile:r.volatile}:{},...r.offset!==void 0?{offset:r.offset}:{}})}break}break}}}onServerHello(){this.connected=!0,this.reconnectAttempts=0,this.handlers.onConnectionState(!0);const t=Array.from(this.subscriptions.keys());for(const s of this.pendingSubscriptions)this.subscriptions.set(s.sessionId,s.cursor),t.includes(s.sessionId)||t.push(s.sessionId);this.pendingSubscriptions.length=0;const n={};for(const[s,o]of this.subscriptions.entries())n[s]=o;this.send({type:"client_hello",id:this.nextId(),payload:{client_id:this.clientId,subscriptions:t,cursors:n}});for(const s of this.terminalAttachments.values())this.sendTerminalAttach(s.sessionId,s.terminalId,s.lastSeq)}sendSubscribe(t,n){this.send({type:"subscribe",id:this.nextId(),payload:{session_ids:t,cursors:n}})}sendTerminalAttach(t,n,s){this.send({type:"terminal_attach",id:this.nextId(),payload:{session_id:t,terminal_id:n,since_seq:s>0?s:void 0}})}trackCursor(t){if(t.volatile===!0)return;const n=t.session_id,s=t.seq;if(typeof n!="string"||typeof s!="number")return;const o=this.subscriptions.get(n);if(!o||s<=o.seq&&o.epoch!==void 0)return;const i=typeof t.epoch=="string"?t.epoch:o.epoch;this.subscriptions.set(n,{seq:Math.max(s,o.seq),epoch:i})}send(t){if(!(!this.ws||this.ws.readyState!==WebSocket.OPEN))try{this.ws.send(JSON.stringify(t)),aG(t)}catch{}}nextId(){return`c_${++this.msgSeq}`}}function yf(e,t){return`${e}\0${t}`}function iv(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 jS(e){return e==="auto_compact"||e==="manual_compact"}class MG{http;config;constructor(t){this.config=t,this.http=new xG(t.serverHttpUrl,{clientId:t.clientId,clientName:t.clientName,clientVersion:t.clientVersion,clientUiMode:t.clientUiMode})}async getHealth(){return{status:"ok",uptimeSec:(await this.http.get("/healthz")).uptime_sec??0}}async getMeta(){const t=await this.http.get("/meta");return{serverVersion:t.server_version,serverId:t.server_id,startedAt:t.started_at,capabilities:t.capabilities,openInApps:Array.isArray(t.open_in_apps)?t.open_in_apps:[],dangerousBypassAuth:t.dangerous_bypass_auth===!0}}async listSessions(t){const n={before_id:t?.beforeId,after_id:t?.afterId,page_size:t?.pageSize,status:t?.status?CK(t.status):void 0,include_archive:t?.includeArchive,exclude_empty:t?.excludeEmpty,workspace_id:t?.workspaceId},s=await this.http.get("/sessions",n);return{items:s.items.map(Ti),hasMore:s.has_more}}async createSession(t){const n={metadata:t.cwd!==void 0?{cwd:t.cwd}:{}};t.workspaceId!==void 0&&(n.workspace_id=t.workspaceId),t.title!==void 0&&(n.title=t.title),t.model!==void 0&&(n.agent_config={model:t.model});const s=await this.http.post("/sessions",n);return Ti(s)}async getSession(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}`);return Ti(n)}async updateSession(t,n){const s={};n.title!==void 0&&(s.title=n.title),n.cwd!==void 0&&(s.metadata={cwd:n.cwd});const o={};n.model!==void 0&&(o.model=n.model),n.permissionMode!==void 0&&(o.permission_mode=n.permissionMode),n.planMode!==void 0&&(o.plan_mode=n.planMode),n.swarmMode!==void 0&&(o.swarm_mode=n.swarmMode),n.goalObjective!==void 0&&(o.goal_objective=n.goalObjective),n.goalControl!==void 0&&(o.goal_control=n.goalControl),n.thinking!==void 0&&(o.thinking=n.thinking),Object.keys(o).length>0&&(s.agent_config=o);const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/profile`,s);return Ti(i)}async getSessionStatus(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/status`);return{model:n.model&&n.model.length>0?n.model:null,thinkingEffort:n.thinking_level,permission:n.permission,planMode:n.plan_mode===!0,swarmMode:n.swarm_mode===!0,contextTokens:n.context_tokens??0,maxContextTokens:n.max_context_tokens??0,contextUsage:n.context_usage??0}}async getSessionWarnings(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/warnings`)).warnings??[]}async archiveSession(t){return await this.http.post(`/sessions/${encodeURIComponent(t)}:archive`,{})}async listMessages(t,n){const s={before_id:n?.beforeId,after_id:n?.afterId,page_size:n?.pageSize,role:n?.role},o=await this.http.get(`/sessions/${encodeURIComponent(t)}/messages`,s);return{items:o.items.map(L1),hasMore:o.has_more}}async getSessionSnapshot(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/snapshot`);return{asOfSeq:n.as_of_seq,epoch:n.epoch,session:Ti(n.session),messages:n.messages.items.map(L1),hasMoreMessages:n.messages.has_more,inFlightTurn:n.in_flight_turn===null?null:{turnId:n.in_flight_turn.turn_id,assistantText:n.in_flight_turn.assistant_text,thinkingText:n.in_flight_turn.thinking_text,runningTools:n.in_flight_turn.running_tools.map(s=>({toolCallId:s.tool_call_id,name:s.name,args:s.args,description:s.description,lastProgress:s.last_progress})),promptId:n.in_flight_turn.current_prompt_id},pendingApprovals:n.pending_approvals.map(m3),pendingQuestions:n.pending_questions.map(g3)}}async submitPrompt(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts`,AK(n));return{promptId:s.prompt_id,userMessageId:s.user_message_id,status:s.status}}async steerPrompts(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts:steer`,{prompt_ids:n});return{steered:s.steered,promptIds:s.prompt_ids}}async abortPrompt(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts/${encodeURIComponent(n)}:abort`,void 0,{allowCodes:[40903]});return{aborted:s.aborted,atSeq:s.at_seq}}async abortSession(t){return{aborted:(await this.http.post(`/sessions/${encodeURIComponent(t)}:abort`,{})).aborted}}async compactSession(t,n){await this.http.post(`/sessions/${encodeURIComponent(t)}:compact`,n?{instruction:n}:{})}async undoSession(t,n=1){await this.http.post(`/sessions/${encodeURIComponent(t)}:undo`,{count:n})}async forkSession(t,n){const s={};n?.title!==void 0&&(s.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}:fork`,s);return Ti(o)}async createChildSession(t,n){const s={};n?.title!==void 0&&(s.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/children`,s);return Ti(o)}async listChildSessions(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/children`)).items.map(Ti)}async startBtw(t){return{agentId:(await this.http.post(`/sessions/${encodeURIComponent(t)}:btw`,{})).agent_id}}async respondApproval(t,n,s){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/approvals/${encodeURIComponent(n)}`,TK(s));return{resolved:o.resolved,resolvedAt:o.resolved_at}}async respondQuestion(t,n,s){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}`,$K(s));return{resolved:o.resolved,resolvedAt:o.resolved_at}}async dismissQuestion(t,n){return{dismissed:!0,dismissedAt:(await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}:dismiss`,void 0,{allowCodes:[40909]})).dismissed_at}}async listTasks(t,n){const s={status:n};return(await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks`,s)).items.map(O1)}async getTask(t,n,s){const o={with_output:s?.withOutput,output_bytes:s?.outputBytes},i=await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}`,o);return O1(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(iv)}async createTerminal(t,n={}){const s={cwd:n.cwd,shell:n.shell,cols:n.cols,rows:n.rows},o=await this.http.post(`/sessions/${encodeURIComponent(t)}/terminals`,s);return iv(o)}async getTerminal(t,n){const s=await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}`);return iv(s)}async closeTerminal(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}:close`)}async listSkills(t){return((await this.http.get(`/sessions/${encodeURIComponent(t)}/skills`)).skills??[]).map(s=>({name:s.name,description:s.description,source:s.source}))}async activateSkill(t,n,s){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/skills/${encodeURIComponent(n)}:activate`,s!==void 0&&s.length>0?{args:s}:{});return{activated:o.activated,skillName:o.skill_name}}async listDirectory(t,n){const s={};n.path!==void 0&&(s.path=n.path),n.depth!==void 0&&(s.depth=n.depth),n.includeGitStatus!==void 0&&(s.include_git_status=n.includeGitStatus);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:list`,s),i=o.children_by_path?Object.fromEntries(Object.entries(o.children_by_path).map(([r,l])=>[r,l.map(NS)])):void 0;return{items:o.items.map(NS),childrenByPath:i,truncated:o.truncated}}async readFile(t,n){const s={path:n.path};n.offset!==void 0&&(s.offset=n.offset),n.length!==void 0&&(s.length=n.length);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:read`,s);return{path:o.path,content:o.content,encoding:o.encoding,size:o.size,truncated:o.truncated,etag:o.etag,mime:o.mime,languageId:o.language_id,lineCount:o.line_count,isBinary:o.is_binary}}async searchFiles(t,n){const s={query:n.query};n.limit!==void 0&&(s.limit=n.limit);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:search`,s);return{items:o.items.map(i=>({path:i.path,name:i.name,kind:i.kind,score:i.score,matchPositions:i.match_positions})),truncated:o.truncated}}async grepFiles(t,n){const s={pattern:n.pattern};n.regex!==void 0&&(s.regex=n.regex),n.caseSensitive!==void 0&&(s.case_sensitive=n.caseSensitive);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:grep`,s);return{files:o.files,filesScanned:o.files_scanned,truncated:o.truncated,elapsedMs:o.elapsed_ms}}async getGitStatus(t,n){const s={};n!==void 0&&(s.paths=n);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:git_status`,s);return{branch:o.branch,ahead:o.ahead,behind:o.behind,entries:o.entries,additions:o.additions,deletions:o.deletions,pullRequest:o.pullRequest??null}}async getFileDiff(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:diff`,{path:n});return{path:s.path,diff:s.diff}}getFileDownloadUrl(t,n){const s=n.split("/").map(o=>encodeURIComponent(o)).join("/");return cu(this.config.serverHttpUrl,`/sessions/${encodeURIComponent(t)}/fs/${s}:download`)}async openFile(t,n){const s={path:n.path};return n.line!==void 0&&(s.line=n.line),this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open`,s)}async revealFile(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/fs:reveal`,{path:n.path})}async openInApp(t,n,s,o){const i={app_id:n,path:s};o!==void 0&&(i.line=o),await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open-in`,i)}async listWorkspaces(){try{return((await this.http.get("/workspaces")).items??[]).map(Su)}catch{return[]}}async addWorkspace(t){const n={root:t.root};t.name!==void 0&&(n.name=t.name);const s=await this.http.post("/workspaces",n);return Su(s)}async deleteWorkspace(t){await this.http.delete(`/workspaces/${encodeURIComponent(t)}`)}async updateWorkspace(t,n){const s=await this.http.patch(`/workspaces/${encodeURIComponent(t)}`,{name:n.name});return Su(s)}async browseFs(t){try{const n=await this.http.get("/fs:browse",{path:t});return{path:n.path,parent:n.parent,entries:(n.entries??[]).map(s=>({name:s.name,path:s.path,isDir:s.is_dir,isGitRepo:s.is_git_repo,branch:s.branch}))}}catch{return{path:"",parent:null,entries:[]}}}async getFsHome(){try{const t=await this.http.get("/fs:home");return{home:t.home,recentRoots:t.recent_roots??[]}}catch{return{home:"",recentRoots:[]}}}async listModels(){return(await this.http.get("/models")).items.map(OK)}async listProviders(){return(await this.http.get("/providers")).items.map(LS)}async addProvider(t){const n={type:t.type};t.apiKey!==void 0&&(n.api_key=t.apiKey),t.baseUrl!==void 0&&(n.base_url=t.baseUrl),t.defaultModel!==void 0&&(n.default_model=t.defaultModel);const s=await this.http.post("/providers",n);return LS(s)}async deleteProvider(t){return this.http.delete(`/providers/${encodeURIComponent(t)}`)}async refreshProvider(t){const n=await this.http.post(`/providers/${encodeURIComponent(t)}:refresh`);return rv(n)}async refreshAllProviders(){const t=await this.http.post("/providers:refresh");return rv(t)}async refreshOAuthProviderModels(){const t=await this.http.post("/providers:refresh_oauth");return rv(t)}async getConfig(){const t=await this.http.get("/config");return P1(t)}async setConfig(t){const n={},s={providers:"providers",defaultProvider:"default_provider",defaultModel:"default_model",models:"models",thinking:"thinking",planMode:"plan_mode",yolo:"yolo",defaultPermissionMode:"default_permission_mode",defaultPlanMode:"default_plan_mode",permission:"permission",hooks:"hooks",services:"services",mergeAllAvailableSkills:"merge_all_available_skills",extraSkillDirs:"extra_skill_dirs",loopControl:"loop_control",background:"background",experimental:"experimental",telemetry:"telemetry",raw:"raw"};for(const[i,r]of Object.entries(t)){const l=s[i];l!==void 0&&(n[l]=r)}const o=await this.http.post("/config",n);return P1(o)}async getAuth(){const t=await this.http.get("/auth");return{ready:t.ready,providersCount:t.providers_count,defaultModel:t.default_model,managedProvider:t.managed_provider?{status:t.managed_provider.status}:null}}async startOAuthLogin(){const t=await this.http.post("/oauth/login",{});return{flowId:t.flow_id,provider:t.provider,verificationUri:t.verification_uri,verificationUriComplete:t.verification_uri_complete,userCode:t.user_code,expiresIn:t.expires_in,interval:t.interval,status:t.status,expiresAt:t.expires_at}}async pollOAuthLogin(){const t=await this.http.get("/oauth/login");return t?{flowId:t.flow_id,status:t.status,resolvedAt:t.resolved_at}:null}async cancelOAuthLogin(){const t=await this.http.delete("/oauth/login");return{cancelled:t.cancelled,status:t.status}}async logout(){return{loggedOut:(await this.http.post("/oauth/logout",{})).logged_out}}async uploadFile(t){const n=new FormData;n.append("file",t.file,t.name??(t.file instanceof File?t.file.name:"upload")),t.name!==void 0&&n.append("name",t.name);const s=await this.http.postForm("/files",n);return{id:s.id,name:s.name,mediaType:s.media_type,size:s.size}}getFileUrl(t){return cu(this.config.serverHttpUrl,`/files/${encodeURIComponent(t)}`)}async getFileBlob(t){return this.http.getBlob(`/files/${encodeURIComponent(t)}`)}connectEvents(t){const n=M5(this.config.serverHttpUrl,this.config.clientId),s=XK(),o=new TG(n,this.config.clientId,{onWireEvent:i=>{const r=PK(i),l=RK(i),a=LK(i);a.type==="historyCompacted"&&!jS(a.reason)&&t.onResync(a.sessionId,a.beforeSeq),t.onEvent(a,{sessionId:r,seq:l})},onRawAgentEvent:i=>{const{type:r,seq:l,session_id:a,payload:c,offset:u}=i,d=s.project(r,c,a,{offset:u});for(const p of d)p.type==="historyCompacted"&&!jS(p.reason)&&t.onResync(a,l),t.onEvent(p,{sessionId:a,seq:l})},onResync:(i,r,l)=>{s.reset(i),t.onResync(i,r,l)},onConnectionState:i=>{t.onConnectionChange(i)},onError:(i,r,l)=>{t.onError(i,r,l)},onTerminalOutput:(i,r,l,a)=>{t.onTerminalOutput?.(i,r,l,a)},onTerminalExit:(i,r,l)=>{t.onTerminalExit?.(i,r,l)}});return o.connect(),{subscribe(i,r){o.subscribe(i,r??{seq:0})},unsubscribe(i){o.unsubscribe(i)},seedSnapshot(i,r){if(r.inFlightTurn===null){s.reset(i);return}const l=s.seedInFlight(i,r.inFlightTurn);for(const a of l)t.onEvent(a,{sessionId:i,seq:r.asOfSeq})},bindNextPromptId(i,r){s.bindNextPromptId(i,r)},abort(i,r){o.abort(i,r)},terminalAttach(i,r,l){o.terminalAttach(i,r,l)},terminalInput(i,r,l){o.terminalInput(i,r,l)},terminalResize(i,r,l,a){o.terminalResize(i,r,l,a)},terminalDetach(i,r){o.terminalDetach(i,r)},terminalClose(i,r){o.terminalClose(i,r)},markSideChannelAgent(i){s.markSideChannelAgent(i)},close(){o.close()}}}}function rv(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 VS;function dt(){return VS??=new MG(S5()),VS}const EG=["src","controls","muted"],IG=["src","alt"],lv=je({__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=Z(t.fileId?"":t.url),s=Z(null),o=Z(!t.fileId);let i=null,r=0,l=!1,a=null;function c(){i!==null&&(URL.revokeObjectURL(i),i=null)}async function u(){const d=++r;if(c(),!t.fileId){n.value=t.url;return}if(o.value)try{const p=await dt().getFileBlob(t.fileId),h=URL.createObjectURL(p);if(l||d!==r){URL.revokeObjectURL(h);return}i=h,n.value=i}catch{if(l||d!==r)return;n.value=t.url}}return Ke(()=>[t.fileId,t.url,o.value],u,{immediate:!0}),hn(()=>{typeof IntersectionObserver=="function"&&s.value?(a=new IntersectionObserver(d=>{d[0]?.isIntersecting&&(o.value=!0,a?.disconnect(),a=null)},{rootMargin:"200px"}),a.observe(s.value)):o.value=!0}),ls(()=>{l=!0,a?.disconnect(),a=null,c()}),(d,p)=>e.kind==="video"?(w(),N("video",{key:0,ref_key:"mediaEl",ref:s,class:Re(e.mediaClass),src:n.value||void 0,controls:e.controls,muted:e.muted,playsinline:"",preload:"metadata"},null,10,EG)):(w(),N("img",{key:1,ref_key:"mediaEl",ref:s,class:Re(e.mediaClass),src:n.value||void 0,alt:e.alt||"",loading:"lazy"},null,10,IG))}}),$G=["aria-label"],NG=120,LG=60,OG=je({__name:"MoonSpinner",props:{size:{default:"md"},fast:{type:Boolean},label:{default:"Waiting for response…"}},setup(e){const t=["🌑","🌒","🌓","🌔","🌕","🌖","🌗","🌘"];function n(s){return{"--moon-frame-delay":`${s*NG}ms`,"--moon-frame-fast-delay":`${s*LG}ms`}}return(s,o)=>(w(),N("span",{class:Re(["ui-moon",[`ui-moon--${e.size}`,{"ui-moon--fast":e.fast}]]),"aria-label":e.label,role:"img"},[(w(),N(Le,null,nt(t,(i,r)=>T("span",{key:i,class:"ui-moon__frame",style:Gt(n(r)),"aria-hidden":"true"},R(i),5)),64))],10,$G))}}),w3=ut(OG,[["__scopeId","data-v-ca9cc3be"]]);function PG(e,t="昨天"){try{const n=new Date(e);if(Number.isNaN(n.getTime()))return e;const s=new Date,o=u=>String(u).padStart(2,"0"),i=`${o(n.getHours())}:${o(n.getMinutes())}`,r=n.getFullYear()===s.getFullYear(),l=n.getMonth()===s.getMonth(),a=n.getDate()===s.getDate();if(r&&l&&a)return i;const c=new Date(s);return c.setDate(s.getDate()-1),n.getFullYear()===c.getFullYear()&&n.getMonth()===c.getMonth()&&n.getDate()===c.getDate()?`${t} ${i}`:r?`${o(n.getMonth()+1)}-${o(n.getDate())} ${i}`:`${n.getFullYear()}-${o(n.getMonth()+1)}-${o(n.getDate())} ${i}`}catch{return e}}const RG={class:"chat"},DG={key:0,class:"chat-loading"},BG={class:"chat-loading-text"},FG={key:1,class:"chat-empty"},HG={key:1,class:"top-sentinel-text"},WG=["data-turn-id"],zG={key:0,class:"u-imgs"},UG=["aria-label","onClick"],qG={key:1,class:"skill-act"},jG={class:"skill-act-head"},VG={key:0,class:"skill-act-args"},KG={key:2,class:"skill-act"},GG={class:"skill-act-head"},YG={key:0,class:"skill-act-args"},XG={key:3,class:"u-text"},QG={key:0,class:"u-meta"},ZG=["aria-label","onClick"],JG=["aria-label","onClick"],eY=["onClick"],tY=["data-turn-id"],nY=["onClick"],sY={class:"cd-view"},oY={key:1,class:"cd-label"},iY=["data-turn-id"],rY={key:1,class:"msg"},lY={key:0,class:"a-msg-ft"},aY={key:0,class:"a-duration"},cY=["aria-label","onClick"],uY={key:4,class:"sending-placeholder"},dY={key:5,class:"q-stack"},fY={class:"q-head"},pY={class:"q-title"},hY={class:"q-hint"},mY=["onDragover","onDrop"],gY={class:"u-bub q-bub"},vY=["title","onDragstart"],yY=["title","disabled","onClick"],kY={key:0,class:"u-text q-text"},bY={key:1,class:"q-text q-text-placeholder"},_Y={key:0,class:"q-imgs"},wY={key:1,class:"q-tag q-tag-next"},SY={key:2,class:"q-tag q-tag-idx"},CY=["aria-label","onClick"],xY=2500,AY=je({__name:"ChatPane",props:{turns:{},approvals:{default:()=>[]},running:{type:Boolean,default:!1},sending:{type:Boolean,default:!1},fastMoon:{type:Boolean,default:!1},sessionLoading:{type:Boolean},compaction:{default:null},hasMoreMessages:{type:Boolean,default:!1},loadingMore:{type:Boolean,default:!1},loadingMoreError:{type:Boolean,default:!1},isFollowing:{type:Boolean,default:!1},toolDiffPanel:{type:Boolean,default:!1},queued:{default:()=>[]}},emits:["openFile","openMedia","copyConversationCopied","openThinking","openCompaction","openAgent","openToolDiff","editMessage","loadOlderMessages","unqueue","editQueued","reorderQueue"],setup(e,{expose:t,emit:n}){const{t:s}=It(),{confirm:o}=ol();kn(()=>{we!==null&&(clearTimeout(we),we=null),z!==null&&(clearTimeout(z),z=null),E!==null&&(clearTimeout(E),E=null)});const i=e,r=Z(null);let l=null;function a(){!r.value||typeof IntersectionObserver>"u"||(l?.disconnect(),l=new IntersectionObserver(le=>{le[0]?.isIntersecting&&i.hasMoreMessages&&!i.loadingMore&&!i.loadingMoreError&&!i.sessionLoading&&!i.isFollowing&&d("loadOlderMessages")},{root:null,rootMargin:"200px 0px 0px 0px",threshold:0}),l.observe(r.value))}hn(a),kn(()=>{l?.disconnect(),l=null}),Ke(()=>[i.hasMoreMessages,i.loadingMore,i.loadingMoreError],()=>{ht().then(a)});const c=F(()=>{if(!i.running||i.turns.length===0)return null;const le=i.turns.at(-1);return le.role==="assistant"?le.id:null}),u=F(()=>i.sending||i.running),d=n,p=Z(null),h=Z(null);function f(le){return(le.attachments?.length??0)>0}function m(le,U){f(U)||d("editQueued",le)}function b(le,U){if(p.value=le,!U.dataTransfer)return;U.dataTransfer.effectAllowed="move",U.dataTransfer.setData("text/plain",String(le));const G=U.currentTarget?.closest(".q-turn");G&&U.dataTransfer.setDragImage(G,24,24)}function _(le,U){if(p.value===null)return;U.preventDefault(),U.dataTransfer&&(U.dataTransfer.dropEffect="move");const G=U.currentTarget.getBoundingClientRect(),ne=U.clientY<G.top+G.height/2?"before":"after";h.value={index:le,position:ne}}function g(le,U){U.preventDefault();const G=p.value,ne=h.value?.position??"before";if(p.value=null,h.value=null,G===null)return;let H=ne==="before"?le:le+1;G<H&&(H-=1),G!==H&&d("reorderQueue",{from:G,to:H})}function v(){p.value=null,h.value=null}const y=F(()=>{for(let le=i.turns.length-1;le>=0;le--)if(i.turns[le].role==="user")return i.turns[le].id;return null});function A(le){return le.role==="user"&&le.id===y.value&&!i.running&&!i.sending&&!le.skillActivation&&!le.pluginCommand}function O(le){const U=le.compaction,G=U?.trigger==="auto"?s("conversation.compactedAuto"):s("conversation.compactedPlain");return typeof U?.tokensBefore=="number"&&typeof U?.tokensAfter=="number"?G+s("conversation.compactedTokens",{before:R_(U.tokensBefore),after:R_(U.tokensAfter)}):G}const $=Z(null),k=Z(null);let E=null;const M=Z(new Set);function L(le){return M.value.has(le)}function S(le){const U=new Set(M.value);U.has(le)?U.delete(le):U.add(le),M.value=U}function I(le,U){if(L(U)){const G=new Date(le);if(Number.isNaN(G.getTime()))return le;const ne=H=>String(H).padStart(2,"0");return`${G.getFullYear()}-${ne(G.getMonth()+1)}-${ne(G.getDate())} ${ne(G.getHours())}:${ne(G.getMinutes())}`}return PG(le,s("conversation.yesterday"))}async function P(le){await o({title:s("conversation.undo"),message:s("conversation.undoConfirm"),variant:"primary"})&&D(le)}function D(le){k.value===null&&(k.value=le.id,d("editMessage",le.text),E=setTimeout(()=>{E=null,k.value=null},xY))}Ke(()=>i.turns,le=>{k.value!==null&&(le.some(U=>U.id===k.value)||(k.value=null,E!==null&&(clearTimeout(E),E=null)))},{flush:"post"});const W=Z(!1);let z=null;function q(){if(i.turns.length===0)return;const le=[];for(const G of i.turns){if(G.role==="compaction")continue;const ne=G.role==="user"?"User":"Assistant",H=LP(G);H.trim()&&le.push(`**${ne}**
|
|
248
248
|
|