From a5311f47e9afd92f1877cb3a8b50927dcc7d953b Mon Sep 17 00:00:00 2001 From: kimi-agent-bot Date: Fri, 4 Sep 2026 18:10:17 +0800 Subject: [PATCH] chore: sync web dist from code-app code-app: 054a6e98b9c992ee4fe5f83c0091b7e931561aba --- .changeset/agent-card-background-indicator.md | 5 + .changeset/bash-task-panel-terminal.md | 5 + .changeset/diff-panel-selection-quote.md | 5 + .changeset/edit-turn-diff-overlap.md | 5 + .changeset/esc-no-close-panel.md | 5 + .changeset/fix-default-thinking-top-effort.md | 5 + .changeset/permission-mode-copy.md | 5 + .changeset/quote-pill-neutral-restyle.md | 5 + .changeset/quote-pill-shorter-excerpt.md | 5 + .changeset/restore-selection-quote.md | 5 + .changeset/selection-bubble-grow-upward.md | 5 + .../selection-bubble-header-drag-fix.md | 5 + .changeset/selection-bubble-mid-drag-fix.md | 5 + .../selection-comment-actions-rework.md | 5 + .../selection-comment-composer-revamp.md | 5 + .changeset/terminal-selection-quote.md | 5 + .changeset/tooltip-show-delay-longer.md | 5 + .changeset/tower-mode.md | 5 + .changeset/turn-file-history-stats.md | 5 + .changeset/turn-files-authoritative-only.md | 5 + ...-BNOCy4ai.js => CodeBlockNode-Dh6YGbd1.js} | 4 +- ...ooltip-DebxPz-0.js => Tooltip-Da35cfam.js} | 2 +- ...XA.js => abnfDiagram-VRR7QNED-C6R_sAbc.js} | 2 +- .../{arc-CxCMb0Ef.js => arc-CPC2gY0w.js} | 2 +- ... architectureDiagram-ZJ3FMSHR-DGsFEfiM.js} | 2 +- ...k.js => blockDiagram-677ZJIJ3-fPyJR28f.js} | 2 +- ...Lt-v.js => c4Diagram-LMCZKHZV-BAAq1RMs.js} | 2 +- .../dist-web/assets/channel-8Bt6a0tz.js | 1 + .../dist-web/assets/channel-B8eMh4sk.js | 1 - ...CdhiweKX.js => chunk-2Q5K7J3B-NzojNxDT.js} | 2 +- ...mfMW4-bV.js => chunk-32BRIVSS-CRTrWqUr.js} | 2 +- ...BRWxG5tM.js => chunk-5VM5RSS4-BJR-VYAu.js} | 2 +- ...DoQjV3QX.js => chunk-EX3LRPZG-B-vU1qLF.js} | 2 +- ...C7S97jLg.js => chunk-JWPE2WC7-BJMJfnyy.js} | 2 +- ...DcgqWRh_.js => chunk-MOJQB5TN-DmVMZHwQ.js} | 2 +- ...DRHEFBXE.js => chunk-RYQCIY6F-LhAgalr3.js} | 2 +- ...Ci6LL3n4.js => chunk-V7JOEXUC-BBRs-W-z.js} | 2 +- ...DW1NNlBr.js => chunk-VR4S4FIN-C_RujyXt.js} | 2 +- ...4LplLZkT.js => chunk-XXDRQBXY-D_bv9kM4.js} | 2 +- .../assets/classDiagram-OUVF2IWQ-DDHH-ciJ.js | 1 - .../assets/classDiagram-OUVF2IWQ-DLwxkoRX.js | 1 + .../classDiagram-v2-EOCWNBFH-DDHH-ciJ.js | 1 - .../classDiagram-v2-EOCWNBFH-DLwxkoRX.js | 1 + ...l.js => cose-bilkent-JH36ORCC-DzQyBzbl.js} | 2 +- ...nbetzx.js => cynefin-VYW2F7L2-DI-9Z5R0.js} | 2 +- ...js => cynefinDiagram-TSTJHNR4-DLqJ7d9z.js} | 2 +- ...BDxu-EPk.js => dagre-VKFMJZFB-G1--45o_.js} | 2 +- ...Cw9BLp.js => diagram-FQU43EPY-DlPR1W9u.js} | 2 +- ...stEr0d.js => diagram-G47NLZAW-Bj3iAwJq.js} | 2 +- ..._tIsIn.js => diagram-NH7WQ7WH-D0p601mB.js} | 2 +- ...Xs8uY6.js => diagram-OA4YK3LP-BLpvk7p_.js} | 2 +- ...HIyeb8.js => diagram-WEI45ONY-DKRP3hVn.js} | 2 +- ...7D.js => ebnfDiagram-CCIWWBDH-CdaRbvzq.js} | 2 +- ...aYfw.js => erDiagram-Q63AITRT-DPLVpHbv.js} | 2 +- ...60.js => flowDiagram-23GEKE2U-eOlMNTnl.js} | 2 +- ...l.js => ganttDiagram-NO4QXBWP-D1u5oYVA.js} | 2 +- ...s => gitGraphDiagram-IHSO6WYX-B9_pldp9.js} | 2 +- .../dist-web/assets/index--0t1wzw_.js | 812 ----------------- .../{index-BAprvwXC.js => index-CBhxV_B2.js} | 2 +- .../dist-web/assets/index-CiHMlsuo.js | 824 ++++++++++++++++++ .../dist-web/assets/index-CqjkU7Bl.css | 32 + .../dist-web/assets/index-DDrI0Pxr.css | 32 - .../{index--RgMhz1s.js => index-DGMnuyIs.js} | 2 +- .../{index-D6YNmmDH.js => index-W-09C5Mb.js} | 4 +- ...ndex10-BOfr-M0b.js => index10-DPt9V4bc.js} | 2 +- ...ndex11-BuI7qYB6.js => index11-oTpPg1Iy.js} | 2 +- ...{index5-DEKGWcGw.js => index5-CI5HVqyi.js} | 2 +- ...{index6-BW9QZVgb.js => index6-BTRYPHWD.js} | 2 +- ...{index7-N0eJaunx.js => index7-CreDRl0J.js} | 2 +- ...{index8-DQP5_GpC.js => index8-MiLy1Wbt.js} | 2 +- ...Qy.js => infoDiagram-FWYZ7A6U-CWqulOA1.js} | 2 +- ...s => ishikawaDiagram-FXEZZL3T-BGN-K46K.js} | 2 +- ...js => journeyDiagram-5HDEW3XC-ddCIBdL-.js} | 2 +- ...=> kanban-definition-HUTT4EX6-Bwd-QNyL.js} | 2 +- ...{linear-DLj646oc.js => linear-UIDPGx_K.js} | 2 +- ...e-CqiFQExc.js => mermaid.core-WW7RuneT.js} | 8 +- ...> mindmap-definition-LN4V7U3C-D4XmHVCu.js} | 2 +- ...DmB.js => pegDiagram-2B236MQR-B81as5U1.js} | 2 +- ...W1d.js => pieDiagram-ENE6RG2P-DLM5siGM.js} | 2 +- ...s => quadrantDiagram-ABIIQ3AL-BccwcHoh.js} | 2 +- ...s => railroadDiagram-RFXS5EU6-DNsbCVtY.js} | 2 +- ...> requirementDiagram-TGXJPOKE-C-K62wRK.js} | 2 +- ....js => sankeyDiagram-HTMAVEWB-DvJqr3-o.js} | 2 +- ...s => sequenceDiagram-DBY2YBRQ-CY9lM-aK.js} | 2 +- ...Wz.js => sizeCapture-X5ZJPWSS-D_wNrXBO.js} | 2 +- ...O.js => stateDiagram-2N3HPSRC-DOjvRzn-.js} | 2 +- .../stateDiagram-v2-6OUMAXLB-BtkBtrYE.js | 1 - .../stateDiagram-v2-6OUMAXLB-CZ3zMFoy.js | 1 + ...o-8f.js => swimlanes-5IMT3BWC-DiBNZxJI.js} | 4 +- .../swimlanesDiagram-G3AALYLV-DhDMBrjk.js | 8 - .../swimlanesDiagram-G3AALYLV-KUKTzqZ9.js | 8 + ... timeline-definition-FHXFAJF6-CkZhvGjX.js} | 2 +- ...7o.js => vennDiagram-L72KCM5P-BSODO45Y.js} | 2 +- ...js => vue.runtime.esm-bundler-Dz1HMlA6.js} | 2 +- ...js => wardleyDiagram-EHGQE667-DZMFMBx5.js} | 2 +- ...js => xychartDiagram-FW5EYKEG-BfzaJ_HB.js} | 2 +- apps/kimi-code/dist-web/index.html | 4 +- 97 files changed, 1038 insertions(+), 926 deletions(-) create mode 100644 .changeset/agent-card-background-indicator.md create mode 100644 .changeset/bash-task-panel-terminal.md create mode 100644 .changeset/diff-panel-selection-quote.md create mode 100644 .changeset/edit-turn-diff-overlap.md create mode 100644 .changeset/esc-no-close-panel.md create mode 100644 .changeset/fix-default-thinking-top-effort.md create mode 100644 .changeset/permission-mode-copy.md create mode 100644 .changeset/quote-pill-neutral-restyle.md create mode 100644 .changeset/quote-pill-shorter-excerpt.md create mode 100644 .changeset/restore-selection-quote.md create mode 100644 .changeset/selection-bubble-grow-upward.md create mode 100644 .changeset/selection-bubble-header-drag-fix.md create mode 100644 .changeset/selection-bubble-mid-drag-fix.md create mode 100644 .changeset/selection-comment-actions-rework.md create mode 100644 .changeset/selection-comment-composer-revamp.md create mode 100644 .changeset/terminal-selection-quote.md create mode 100644 .changeset/tooltip-show-delay-longer.md create mode 100644 .changeset/tower-mode.md create mode 100644 .changeset/turn-file-history-stats.md create mode 100644 .changeset/turn-files-authoritative-only.md rename apps/kimi-code/dist-web/assets/{CodeBlockNode-BNOCy4ai.js => CodeBlockNode-Dh6YGbd1.js} (99%) rename apps/kimi-code/dist-web/assets/{Tooltip-DebxPz-0.js => Tooltip-Da35cfam.js} (98%) rename apps/kimi-code/dist-web/assets/{abnfDiagram-VRR7QNED-Bo8g46XA.js => abnfDiagram-VRR7QNED-C6R_sAbc.js} (86%) rename apps/kimi-code/dist-web/assets/{arc-CxCMb0Ef.js => arc-CPC2gY0w.js} (98%) rename apps/kimi-code/dist-web/assets/{architectureDiagram-ZJ3FMSHR-ZNnAzHHt.js => architectureDiagram-ZJ3FMSHR-DGsFEfiM.js} (99%) rename apps/kimi-code/dist-web/assets/{blockDiagram-677ZJIJ3-DeafJYAk.js => blockDiagram-677ZJIJ3-fPyJR28f.js} (99%) rename apps/kimi-code/dist-web/assets/{c4Diagram-LMCZKHZV-oGCYLt-v.js => c4Diagram-LMCZKHZV-BAAq1RMs.js} (99%) create mode 100644 apps/kimi-code/dist-web/assets/channel-8Bt6a0tz.js delete mode 100644 apps/kimi-code/dist-web/assets/channel-B8eMh4sk.js rename apps/kimi-code/dist-web/assets/{chunk-2Q5K7J3B-CdhiweKX.js => chunk-2Q5K7J3B-NzojNxDT.js} (67%) rename apps/kimi-code/dist-web/assets/{chunk-32BRIVSS-mfMW4-bV.js => chunk-32BRIVSS-CRTrWqUr.js} (96%) rename apps/kimi-code/dist-web/assets/{chunk-5VM5RSS4-BRWxG5tM.js => chunk-5VM5RSS4-BJR-VYAu.js} (83%) rename apps/kimi-code/dist-web/assets/{chunk-EX3LRPZG-DoQjV3QX.js => chunk-EX3LRPZG-B-vU1qLF.js} (99%) rename apps/kimi-code/dist-web/assets/{chunk-JWPE2WC7-C7S97jLg.js => chunk-JWPE2WC7-BJMJfnyy.js} (71%) rename apps/kimi-code/dist-web/assets/{chunk-MOJQB5TN-DcgqWRh_.js => chunk-MOJQB5TN-DmVMZHwQ.js} (99%) rename apps/kimi-code/dist-web/assets/{chunk-RYQCIY6F-DRHEFBXE.js => chunk-RYQCIY6F-LhAgalr3.js} (99%) rename apps/kimi-code/dist-web/assets/{chunk-V7JOEXUC-Ci6LL3n4.js => chunk-V7JOEXUC-BBRs-W-z.js} (99%) rename apps/kimi-code/dist-web/assets/{chunk-VR4S4FIN-DW1NNlBr.js => chunk-VR4S4FIN-C_RujyXt.js} (87%) rename apps/kimi-code/dist-web/assets/{chunk-XXDRQBXY-4LplLZkT.js => chunk-XXDRQBXY-D_bv9kM4.js} (72%) delete mode 100644 apps/kimi-code/dist-web/assets/classDiagram-OUVF2IWQ-DDHH-ciJ.js create mode 100644 apps/kimi-code/dist-web/assets/classDiagram-OUVF2IWQ-DLwxkoRX.js delete mode 100644 apps/kimi-code/dist-web/assets/classDiagram-v2-EOCWNBFH-DDHH-ciJ.js create mode 100644 apps/kimi-code/dist-web/assets/classDiagram-v2-EOCWNBFH-DLwxkoRX.js rename apps/kimi-code/dist-web/assets/{cose-bilkent-JH36ORCC-B9Aj57Fl.js => cose-bilkent-JH36ORCC-DzQyBzbl.js} (99%) rename apps/kimi-code/dist-web/assets/{cynefin-VYW2F7L2-DEnbetzx.js => cynefin-VYW2F7L2-DI-9Z5R0.js} (99%) rename apps/kimi-code/dist-web/assets/{cynefinDiagram-TSTJHNR4-BrabEtIe.js => cynefinDiagram-TSTJHNR4-DLqJ7d9z.js} (98%) rename apps/kimi-code/dist-web/assets/{dagre-VKFMJZFB-BDxu-EPk.js => dagre-VKFMJZFB-G1--45o_.js} (97%) rename apps/kimi-code/dist-web/assets/{diagram-FQU43EPY-D5Cw9BLp.js => diagram-FQU43EPY-DlPR1W9u.js} (98%) rename apps/kimi-code/dist-web/assets/{diagram-G47NLZAW-CgstEr0d.js => diagram-G47NLZAW-Bj3iAwJq.js} (97%) rename apps/kimi-code/dist-web/assets/{diagram-NH7WQ7WH-BO_tIsIn.js => diagram-NH7WQ7WH-D0p601mB.js} (93%) rename apps/kimi-code/dist-web/assets/{diagram-OA4YK3LP-BiXs8uY6.js => diagram-OA4YK3LP-BLpvk7p_.js} (96%) rename apps/kimi-code/dist-web/assets/{diagram-WEI45ONY-DzHIyeb8.js => diagram-WEI45ONY-DKRP3hVn.js} (95%) rename apps/kimi-code/dist-web/assets/{ebnfDiagram-CCIWWBDH-KkwEvI7D.js => ebnfDiagram-CCIWWBDH-CdaRbvzq.js} (87%) rename apps/kimi-code/dist-web/assets/{erDiagram-Q63AITRT-Ca__aYfw.js => erDiagram-Q63AITRT-DPLVpHbv.js} (99%) rename apps/kimi-code/dist-web/assets/{flowDiagram-23GEKE2U-CW0gFw60.js => flowDiagram-23GEKE2U-eOlMNTnl.js} (99%) rename apps/kimi-code/dist-web/assets/{ganttDiagram-NO4QXBWP-BA6Xg4gl.js => ganttDiagram-NO4QXBWP-D1u5oYVA.js} (99%) rename apps/kimi-code/dist-web/assets/{gitGraphDiagram-IHSO6WYX-CuVLyl1X.js => gitGraphDiagram-IHSO6WYX-B9_pldp9.js} (99%) delete mode 100644 apps/kimi-code/dist-web/assets/index--0t1wzw_.js rename apps/kimi-code/dist-web/assets/{index-BAprvwXC.js => index-CBhxV_B2.js} (99%) create mode 100644 apps/kimi-code/dist-web/assets/index-CiHMlsuo.js create mode 100644 apps/kimi-code/dist-web/assets/index-CqjkU7Bl.css delete mode 100644 apps/kimi-code/dist-web/assets/index-DDrI0Pxr.css rename apps/kimi-code/dist-web/assets/{index--RgMhz1s.js => index-DGMnuyIs.js} (99%) rename apps/kimi-code/dist-web/assets/{index-D6YNmmDH.js => index-W-09C5Mb.js} (99%) rename apps/kimi-code/dist-web/assets/{index10-BOfr-M0b.js => index10-DPt9V4bc.js} (99%) rename apps/kimi-code/dist-web/assets/{index11-BuI7qYB6.js => index11-oTpPg1Iy.js} (99%) rename apps/kimi-code/dist-web/assets/{index5-DEKGWcGw.js => index5-CI5HVqyi.js} (95%) rename apps/kimi-code/dist-web/assets/{index6-BW9QZVgb.js => index6-BTRYPHWD.js} (98%) rename apps/kimi-code/dist-web/assets/{index7-N0eJaunx.js => index7-CreDRl0J.js} (98%) rename apps/kimi-code/dist-web/assets/{index8-DQP5_GpC.js => index8-MiLy1Wbt.js} (99%) rename apps/kimi-code/dist-web/assets/{infoDiagram-FWYZ7A6U-CX4ZaiQy.js => infoDiagram-FWYZ7A6U-CWqulOA1.js} (69%) rename apps/kimi-code/dist-web/assets/{ishikawaDiagram-FXEZZL3T-BRv7GetB.js => ishikawaDiagram-FXEZZL3T-BGN-K46K.js} (99%) rename apps/kimi-code/dist-web/assets/{journeyDiagram-5HDEW3XC-DnAUfwJf.js => journeyDiagram-5HDEW3XC-ddCIBdL-.js} (98%) rename apps/kimi-code/dist-web/assets/{kanban-definition-HUTT4EX6-DgSN0HrV.js => kanban-definition-HUTT4EX6-Bwd-QNyL.js} (99%) rename apps/kimi-code/dist-web/assets/{linear-DLj646oc.js => linear-UIDPGx_K.js} (98%) rename apps/kimi-code/dist-web/assets/{mermaid.core-CqiFQExc.js => mermaid.core-WW7RuneT.js} (99%) rename apps/kimi-code/dist-web/assets/{mindmap-definition-LN4V7U3C-Cny-i6X0.js => mindmap-definition-LN4V7U3C-D4XmHVCu.js} (98%) rename apps/kimi-code/dist-web/assets/{pegDiagram-2B236MQR-CBag-DmB.js => pegDiagram-2B236MQR-B81as5U1.js} (87%) rename apps/kimi-code/dist-web/assets/{pieDiagram-ENE6RG2P-CTlOLW1d.js => pieDiagram-ENE6RG2P-DLM5siGM.js} (95%) rename apps/kimi-code/dist-web/assets/{quadrantDiagram-ABIIQ3AL-BjfJ-MB6.js => quadrantDiagram-ABIIQ3AL-BccwcHoh.js} (99%) rename apps/kimi-code/dist-web/assets/{railroadDiagram-RFXS5EU6-B94MRAkj.js => railroadDiagram-RFXS5EU6-DNsbCVtY.js} (84%) rename apps/kimi-code/dist-web/assets/{requirementDiagram-TGXJPOKE-Blc39rih.js => requirementDiagram-TGXJPOKE-C-K62wRK.js} (99%) rename apps/kimi-code/dist-web/assets/{sankeyDiagram-HTMAVEWB-RXRXikwd.js => sankeyDiagram-HTMAVEWB-DvJqr3-o.js} (99%) rename apps/kimi-code/dist-web/assets/{sequenceDiagram-DBY2YBRQ-BQbflmP-.js => sequenceDiagram-DBY2YBRQ-CY9lM-aK.js} (99%) rename apps/kimi-code/dist-web/assets/{sizeCapture-X5ZJPWSS-BVkVkPWz.js => sizeCapture-X5ZJPWSS-D_wNrXBO.js} (86%) rename apps/kimi-code/dist-web/assets/{stateDiagram-2N3HPSRC-DazF4orO.js => stateDiagram-2N3HPSRC-DOjvRzn-.js} (96%) delete mode 100644 apps/kimi-code/dist-web/assets/stateDiagram-v2-6OUMAXLB-BtkBtrYE.js create mode 100644 apps/kimi-code/dist-web/assets/stateDiagram-v2-6OUMAXLB-CZ3zMFoy.js rename apps/kimi-code/dist-web/assets/{swimlanes-5IMT3BWC-C91Fo-8f.js => swimlanes-5IMT3BWC-DiBNZxJI.js} (99%) delete mode 100644 apps/kimi-code/dist-web/assets/swimlanesDiagram-G3AALYLV-DhDMBrjk.js create mode 100644 apps/kimi-code/dist-web/assets/swimlanesDiagram-G3AALYLV-KUKTzqZ9.js rename apps/kimi-code/dist-web/assets/{timeline-definition-FHXFAJF6-BIlewsXZ.js => timeline-definition-FHXFAJF6-CkZhvGjX.js} (99%) rename apps/kimi-code/dist-web/assets/{vennDiagram-L72KCM5P-mckuIa7o.js => vennDiagram-L72KCM5P-BSODO45Y.js} (99%) rename apps/kimi-code/dist-web/assets/{vue.runtime.esm-bundler-D7X8t2I9.js => vue.runtime.esm-bundler-Dz1HMlA6.js} (98%) rename apps/kimi-code/dist-web/assets/{wardleyDiagram-EHGQE667-L9Dc-js-.js => wardleyDiagram-EHGQE667-DZMFMBx5.js} (99%) rename apps/kimi-code/dist-web/assets/{xychartDiagram-FW5EYKEG-C2C9LElX.js => xychartDiagram-FW5EYKEG-BfzaJ_HB.js} (99%) diff --git a/.changeset/agent-card-background-indicator.md b/.changeset/agent-card-background-indicator.md new file mode 100644 index 0000000000..e9c27db4b8 --- /dev/null +++ b/.changeset/agent-card-background-indicator.md @@ -0,0 +1,5 @@ +--- +"@moonshot-ai/kimi-code": patch +--- + +web: fix background agent message cards incorrectly showing a running indicator. diff --git a/.changeset/bash-task-panel-terminal.md b/.changeset/bash-task-panel-terminal.md new file mode 100644 index 0000000000..a6ba78e965 --- /dev/null +++ b/.changeset/bash-task-panel-terminal.md @@ -0,0 +1,5 @@ +--- +"@moonshot-ai/kimi-code": patch +--- + +web: polish the style and interaction of Bash commands in the right-side panel. diff --git a/.changeset/diff-panel-selection-quote.md b/.changeset/diff-panel-selection-quote.md new file mode 100644 index 0000000000..7b641fdbf6 --- /dev/null +++ b/.changeset/diff-panel-selection-quote.md @@ -0,0 +1,5 @@ +--- +"@moonshot-ai/kimi-code": patch +--- + +web: support selection comments and quote-to-chat in the diff and per-turn changes panels. diff --git a/.changeset/edit-turn-diff-overlap.md b/.changeset/edit-turn-diff-overlap.md new file mode 100644 index 0000000000..66986d1367 --- /dev/null +++ b/.changeset/edit-turn-diff-overlap.md @@ -0,0 +1,5 @@ +--- +"@moonshot-ai/kimi-code": patch +--- + +web: fix file change previews showing added/removed lines that never existed when the same file is edited multiple times in one turn. diff --git a/.changeset/esc-no-close-panel.md b/.changeset/esc-no-close-panel.md new file mode 100644 index 0000000000..799ecaf4a8 --- /dev/null +++ b/.changeset/esc-no-close-panel.md @@ -0,0 +1,5 @@ +--- +"@moonshot-ai/kimi-code": patch +--- + +web: pressing Esc no longer closes the right detail panel. diff --git a/.changeset/fix-default-thinking-top-effort.md b/.changeset/fix-default-thinking-top-effort.md new file mode 100644 index 0000000000..fbf142751b --- /dev/null +++ b/.changeset/fix-default-thinking-top-effort.md @@ -0,0 +1,5 @@ +--- +"@moonshot-ai/kimi-code": patch +--- + +web: fix the default thinking effort in settings not being settable to the highest level (Max). diff --git a/.changeset/permission-mode-copy.md b/.changeset/permission-mode-copy.md new file mode 100644 index 0000000000..031ef2e0e9 --- /dev/null +++ b/.changeset/permission-mode-copy.md @@ -0,0 +1,5 @@ +--- +"@moonshot-ai/kimi-code": patch +--- + +web: rename the three permission modes to Always Ask / Ask When Needed / Never Ask and update their Chinese and English descriptions. diff --git a/.changeset/quote-pill-neutral-restyle.md b/.changeset/quote-pill-neutral-restyle.md new file mode 100644 index 0000000000..5eb37cb6cc --- /dev/null +++ b/.changeset/quote-pill-neutral-restyle.md @@ -0,0 +1,5 @@ +--- +"@moonshot-ai/kimi-code": patch +--- + +web: restyle selection quote pills from blue to the same neutral ink as other mentions, with a vertical bar separating the quote and comment. diff --git a/.changeset/quote-pill-shorter-excerpt.md b/.changeset/quote-pill-shorter-excerpt.md new file mode 100644 index 0000000000..27bb6dbd3d --- /dev/null +++ b/.changeset/quote-pill-shorter-excerpt.md @@ -0,0 +1,5 @@ +--- +"@moonshot-ai/kimi-code": patch +--- + +web: shorten selection quote pill excerpts to at most 12 characters. diff --git a/.changeset/restore-selection-quote.md b/.changeset/restore-selection-quote.md new file mode 100644 index 0000000000..c260b2669e --- /dev/null +++ b/.changeset/restore-selection-quote.md @@ -0,0 +1,5 @@ +--- +"@moonshot-ai/kimi-code": patch +--- + +web: restore selection quoting — after selecting text in a message or file preview, you can add a comment or quote it into the chat. diff --git a/.changeset/selection-bubble-grow-upward.md b/.changeset/selection-bubble-grow-upward.md new file mode 100644 index 0000000000..863d9c8c22 --- /dev/null +++ b/.changeset/selection-bubble-grow-upward.md @@ -0,0 +1,5 @@ +--- +"@moonshot-ai/kimi-code": patch +--- + +web: selection comment bubbles near the bottom of the page now pop above the selection and grow upward, eliminating double scrollbars. diff --git a/.changeset/selection-bubble-header-drag-fix.md b/.changeset/selection-bubble-header-drag-fix.md new file mode 100644 index 0000000000..1c02aa61fc --- /dev/null +++ b/.changeset/selection-bubble-header-drag-fix.md @@ -0,0 +1,5 @@ +--- +"@moonshot-ai/kimi-code": patch +--- + +web: fix selection bubbles displayed over the panel header being unclickable and lacking a hover state. diff --git a/.changeset/selection-bubble-mid-drag-fix.md b/.changeset/selection-bubble-mid-drag-fix.md new file mode 100644 index 0000000000..0045a79aaa --- /dev/null +++ b/.changeset/selection-bubble-mid-drag-fix.md @@ -0,0 +1,5 @@ +--- +"@moonshot-ai/kimi-code": patch +--- + +web: fix the comment bubble popping up before mouse release when selecting text with a slow drag. diff --git a/.changeset/selection-comment-actions-rework.md b/.changeset/selection-comment-actions-rework.md new file mode 100644 index 0000000000..298ca4b938 --- /dev/null +++ b/.changeset/selection-comment-actions-rework.md @@ -0,0 +1,5 @@ +--- +"@moonshot-ai/kimi-code": patch +--- + +web: rework selection comment bubble actions into right-aligned Cancel / Add to chat below the input, with an Enter hint on the confirm button. diff --git a/.changeset/selection-comment-composer-revamp.md b/.changeset/selection-comment-composer-revamp.md new file mode 100644 index 0000000000..6bb057455d --- /dev/null +++ b/.changeset/selection-comment-composer-revamp.md @@ -0,0 +1,5 @@ +--- +"@moonshot-ai/kimi-code": patch +--- + +web: revamp the selection comment bubble — the comment box supports multi-line input and auto-grows, and the confirm button now matches the chat composer send button. diff --git a/.changeset/terminal-selection-quote.md b/.changeset/terminal-selection-quote.md new file mode 100644 index 0000000000..342e2d1f98 --- /dev/null +++ b/.changeset/terminal-selection-quote.md @@ -0,0 +1,5 @@ +--- +"@moonshot-ai/kimi-code": patch +--- + +web: support selection quoting in the terminal — select text to add a comment or quote it into the chat. diff --git a/.changeset/tooltip-show-delay-longer.md b/.changeset/tooltip-show-delay-longer.md new file mode 100644 index 0000000000..605afd62f5 --- /dev/null +++ b/.changeset/tooltip-show-delay-longer.md @@ -0,0 +1,5 @@ +--- +"@moonshot-ai/kimi-code": patch +--- + +web: lengthen the hover delay of quote and mention preview cards so merely passing the mouse over them no longer triggers them. diff --git a/.changeset/tower-mode.md b/.changeset/tower-mode.md new file mode 100644 index 0000000000..1e565a9da3 --- /dev/null +++ b/.changeset/tower-mode.md @@ -0,0 +1,5 @@ +--- +"@moonshot-ai/kimi-code": minor +--- + +web: add tower multi-agent collaboration mode (experimental), enabled via the /tower command or the composer plus menu; /tower supports specifying a base branch (e.g. /tower add-new-feature). diff --git a/.changeset/turn-file-history-stats.md b/.changeset/turn-file-history-stats.md new file mode 100644 index 0000000000..fde45d5aa2 --- /dev/null +++ b/.changeset/turn-file-history-stats.md @@ -0,0 +1,5 @@ +--- +"@moonshot-ai/kimi-code": patch +--- + +web: fix inaccurate added/removed line counts in per-turn file change summaries after the same file is edited or overwritten multiple times. diff --git a/.changeset/turn-files-authoritative-only.md b/.changeset/turn-files-authoritative-only.md new file mode 100644 index 0000000000..ef1bca76b9 --- /dev/null +++ b/.changeset/turn-files-authoritative-only.md @@ -0,0 +1,5 @@ +--- +"@moonshot-ai/kimi-code": patch +--- + +web: per-turn file change cards now show only exact line statistics, and the card no longer appears when statistics are unavailable. diff --git a/apps/kimi-code/dist-web/assets/CodeBlockNode-BNOCy4ai.js b/apps/kimi-code/dist-web/assets/CodeBlockNode-Dh6YGbd1.js similarity index 99% rename from apps/kimi-code/dist-web/assets/CodeBlockNode-BNOCy4ai.js rename to apps/kimi-code/dist-web/assets/CodeBlockNode-Dh6YGbd1.js index d0c40c91d4..862017924e 100644 --- a/apps/kimi-code/dist-web/assets/CodeBlockNode-BNOCy4ai.js +++ b/apps/kimi-code/dist-web/assets/CodeBlockNode-Dh6YGbd1.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-D6YNmmDH.js","assets/index--0t1wzw_.js","assets/index-DDrI0Pxr.css"])))=>i.map(i=>d[i]); -import{bR as xi,cb as Si,bQ as Ho,M as pl,bl as Ci,af as fl,bY as Mi,cc as Bi,b$ as hl,aU as $,c0 as Ei,c1 as Fi,c2 as Pi,a0 as Mo,aD as No,bE as ue,az as Li,cd as wn,c8 as mt,aI as To,aL as Y,s as Sn,aw as Vt,au as pt,bk as J,ce as Bo,u as ie,I as Ro,A as Oi,bJ as Gt,aY as ht,bL as vl,v as w,t as we,bB as ml,bb as Be,q as b,b7 as $i,cf as zi,cg as bn,ch as Hi,ci as Ni,cj as Ti,ck as Ri,as as A,cl as Eo,cm as Di,cn as Ai,co as Wt,cp as Fo,bO as Do,T as ji,G as qi,F as Po,g as Wi,c7 as _i,b_ as Ii}from"./index--0t1wzw_.js";import{i as fe,t as kn}from"./safeRaf-DGuzXxDK.js";var xn=(k,M,y)=>new Promise((te,ne)=>{var be=P=>{try{r(y.next(P))}catch(H){ne(H)}},ke=P=>{try{r(y.throw(P))}catch(H){ne(H)}},r=P=>P.done?te(P.value):Promise.resolve(P.value).then(be,ke);r((y=y.apply(k,M)).next())});let Lo=!1,_t=null,It=null,Ut=null;function Ui(){return xn(this,null,function*(){if(Ut)return Ut;Ut=xn(null,null,function*(){if(!It)try{if(It=(function(k){const M=k;if(typeof M?.useMonaco=="function")return M;const y=k?.default;return typeof y?.useMonaco=="function"?y:null})(yield xi(()=>import("./index-D6YNmmDH.js"),__vite__mapDeps([0,1,2]))),!It)return null}catch{return null}try{return yield(function(k){return xn(this,null,function*(){return Lo?void 0:_t||(_t=xn(null,null,function*(){const y=globalThis?.MonacoEnvironment;y&&(typeof y.getWorker=="function"||typeof y.getWorkerUrl=="function")||typeof k?.preloadMonacoWorkers!="function"||(yield k.preloadMonacoWorkers()),Lo=!0}).finally(()=>{_t=null}),_t)})})(It),Si(),It}catch{return null}});try{return yield Ut}finally{Ut=null}})}var Vi=Object.defineProperty,Gi=Object.defineProperties,Ji=Object.getOwnPropertyDescriptors,Oo=Object.getOwnPropertySymbols,Yi=Object.prototype.hasOwnProperty,Qi=Object.prototype.propertyIsEnumerable,$o=(k,M,y)=>M in k?Vi(k,M,{enumerable:!0,configurable:!0,writable:!0,value:y}):k[M]=y,U=(k,M)=>{for(var y in M||(M={}))Yi.call(M,y)&&$o(k,y,M[y]);if(Oo)for(var y of Oo(M))Qi.call(M,y)&&$o(k,y,M[y]);return k},Me=(k,M)=>Gi(k,Ji(M)),j=(k,M,y)=>new Promise((te,ne)=>{var be=P=>{try{r(y.next(P))}catch(H){ne(H)}},ke=P=>{try{r(y.throw(P))}catch(H){ne(H)}},r=P=>P.done?te(P.value):Promise.resolve(P.value).then(be,ke);r((y=y.apply(k,M)).next())});const Xi={key:0,class:"code-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)] border-[var(--code-border)] bg-[var(--code-header-bg)] text-[var(--code-fg)]"},Ki={class:"flex items-center gap-0.5"},Zi=["aria-label"],er={class:"code-diff-stat removed"},tr={class:"code-diff-stat added"},nr=["aria-label"],lr={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},or={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},ir=["aria-pressed"],rr={key:3,class:"relative"},ar=["aria-expanded"],ur=["disabled"],sr=["disabled"],dr=["disabled"],cr={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},fr={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},vr={class:"code-loading-placeholder"},mr={class:"sr-only","aria-live":"polite",role:"status"},pr=pl({__name:"CodeBlockShell",props:{showHeader:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0},enableFontSizeControl:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},showTooltips:{type:Boolean,default:!0},isDark:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},stream:{type:Boolean,default:!1},isCollapsed:{type:Boolean,default:!1},isExpanded:{type:Boolean,default:!1},copyText:{type:Boolean,default:!1},isPreviewable:{type:Boolean,default:!1},codeFontSize:{},codeFontMin:{},codeFontMax:{},defaultCodeFontSize:{},fontBaselineReady:{type:Boolean,default:!1},diffStats:{},diffStatsAriaLabel:{}},emits:["toggleCollapse","decreaseFont","resetFont","increaseFont","copy","toggleExpand","preview"],setup(k,{emit:M}){const y=k,te=M,ne=$(!1),be=$(null),ke=$(null);function r(){mt(!0),ne.value=!ne.value,ne.value&&document.addEventListener("click",H,{once:!0,capture:!0})}function P(){mt(!0),ne.value=!1}function H(Q){var v,z;const wt=Q.target;(v=be.value)!=null&&v.contains(wt)||(z=ke.value)!=null&&z.contains(wt)?document.addEventListener("click",H,{once:!0,capture:!0}):P()}const re=b(()=>y.showFontSizeButtons&&y.enableFontSizeControl||y.showExpandButton||y.isPreviewable&&y.showPreviewButton),{t:T}=hl(),gt=b(()=>y.showTooltips!==!1);function Ge(Q,v){gt.value&&_i(Q.currentTarget,v,"top",!1,void 0,y.isDark)}function Ee(){gt.value&&mt()}function yt(Q){Ge(Q,y.copyText?T("common.copied")||"Copied":T("common.copy")||"Copy")}const gl=b(()=>{var Q,v;return!!Number.isFinite(y.codeFontSize)&&((Q=y.codeFontSize)!=null?Q:0)<=((v=y.codeFontMin)!=null?v:0)}),Jt=b(()=>!y.fontBaselineReady||y.codeFontSize===y.defaultCodeFontSize),Yt=b(()=>{var Q,v;return!!Number.isFinite(y.codeFontSize)&&((Q=y.codeFontSize)!=null?Q:0)>=((v=y.codeFontMax)!=null?v:100)});return(Q,v)=>(Y(),ie(Po,null,[y.showHeader?(Y(),ie("div",Xi,[ht(Q.$slots,"header-left"),ht(Q.$slots,"header-right",{},()=>[w("div",Ki,[k.diffStats?(Y(),ie("div",{key:0,class:"code-diff-stats","aria-label":k.diffStatsAriaLabel},[w("span",er,"-"+Be(k.diffStats.removed),1),w("span",tr,"+"+Be(k.diffStats.added),1)],8,Zi)):we("",!0),y.showCopyButton?(Y(),ie("button",{key:1,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-label":k.copyText?J(T)("common.copied")||"Copied":J(T)("common.copy")||"Copy",onClick:v[0]||(v[0]=z=>te("copy")),onMouseenter:v[1]||(v[1]=z=>yt(z)),onFocus:v[2]||(v[2]=z=>yt(z)),onMouseleave:Ee,onBlur:Ee},[k.copyText?(Y(),ie("svg",or,[...v[14]||(v[14]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(Y(),ie("svg",lr,[...v[13]||(v[13]=[w("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[w("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),w("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})],-1)])]))],40,nr)):we("",!0),y.showCollapseButton?(Y(),ie("button",{key:2,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-pressed":k.isCollapsed,onClick:v[3]||(v[3]=z=>te("toggleCollapse")),onMouseenter:v[4]||(v[4]=z=>Ge(z,k.isCollapsed?J(T)("common.expand")||"Expand":J(T)("common.collapse")||"Collapse")),onFocus:v[5]||(v[5]=z=>Ge(z,k.isCollapsed?J(T)("common.expand")||"Expand":J(T)("common.collapse")||"Collapse")),onMouseleave:Ee,onBlur:Ee},[(Y(),ie("svg",{style:Vt({rotate:k.isCollapsed?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[...v[15]||(v[15]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],40,ir)):we("",!0),re.value?(Y(),ie("div",rr,[w("button",{ref_key:"moreBtnRef",ref:ke,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] transition-colors","aria-expanded":ne.value,"aria-haspopup":"true",onClick:Do(r,["stop"]),onMouseenter:v[6]||(v[6]=z=>Ge(z,J(T)("common.more")||"More")),onFocus:v[7]||(v[7]=z=>Ge(z,J(T)("common.more")||"More")),onMouseleave:Ee,onBlur:Ee},[...v[16]||(v[16]=[qi('',1)])],40,ar),Ro(Wi,{name:"code-menu"},{default:Gt(()=>[ne.value?(Y(),ie("div",{key:0,ref_key:"moreMenuRef",ref:be,class:"code-more-menu min-w-[10rem] p-1 bg-[hsl(var(--ms-popover))] text-[hsl(var(--ms-popover-foreground))] border border-[var(--code-border)] shadow-[var(--ms-shadow-popover)]",role:"menu"},[y.showFontSizeButtons&&y.enableFontSizeControl?(Y(),ie(Po,{key:0},[w("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:gl.value,onClick:v[8]||(v[8]=z=>{J(mt)(!0),te("decreaseFont")})},[v[17]||(v[17]=w("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"})],-1)),w("span",null,Be(J(T)("common.fontSmaller")||"Font size −"),1)],8,ur),w("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:Jt.value,onClick:v[9]||(v[9]=z=>{J(mt)(!0),te("resetFont")})},[v[18]||(v[18]=w("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[w("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[w("path",{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}),w("path",{d:"M3 3v5h5"})])],-1)),w("span",null,Be(J(T)("common.fontReset")||"Font size reset"),1)],8,sr),w("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:Yt.value,onClick:v[10]||(v[10]=z=>{J(mt)(!0),te("increaseFont")})},[v[19]||(v[19]=w("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1)),w("span",null,Be(J(T)("common.fontLarger")||"Font size +"),1)],8,dr)],64)):we("",!0),y.showExpandButton?(Y(),ie("button",{key:1,type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] transition-colors",onClick:v[11]||(v[11]=z=>{P(),te("toggleExpand")})},[k.isExpanded?(Y(),ie("svg",cr,[...v[20]||(v[20]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"},null,-1)])])):(Y(),ie("svg",fr,[...v[21]||(v[21]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"},null,-1)])])),w("span",null,Be(k.isExpanded?J(T)("common.collapse")||"Collapse":J(T)("common.expand")||"Expand"),1)])):we("",!0),k.isPreviewable&&y.showPreviewButton?(Y(),ie("button",{key:2,type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] transition-colors",onClick:v[12]||(v[12]=z=>{P(),te("preview")})},[v[22]||(v[22]=w("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[w("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[w("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0"}),w("circle",{cx:"12",cy:"12",r:"3"})])],-1)),w("span",null,Be(J(T)("common.preview")||"Preview"),1)])):we("",!0)],512)):we("",!0)]),_:1})])):we("",!0)])])])):we("",!0),vl(w("div",{class:pt(["code-block-shell-content",{"code-block-shell-content--collapsed":k.isCollapsed}])},[ht(Q.$slots,"default")],2),[[ml,!!k.stream||!k.loading]]),vl(w("div",vr,[ht(Q.$slots,"loading",{},()=>[v[23]||(v[23]=w("div",{class:"loading-skeleton"},[w("div",{class:"skeleton-line"}),w("div",{class:"skeleton-line"}),w("div",{class:"skeleton-line short"})],-1))])],512),[[ml,!k.stream&&k.loading]]),w("span",mr,Be(k.copyText?J(T)("common.copied")||"Copied":""),1)],64))}}),hr={class:"html-preview-frame__header"},gr={class:"html-preview-frame__title"},yr={class:"html-preview-frame__label"},wr=["sandbox","srcdoc"],br=Ho(pl({__name:"HtmlPreviewFrame",props:{code:{},isDark:{type:Boolean},htmlPreviewAllowScripts:{type:Boolean},htmlPreviewSandbox:{},onClose:{type:Function},title:{}},setup(k){const M=k,y=import.meta!==void 0&&!1;let te=null;const{t:ne}=hl(),be=b(()=>{const P=M.code||"",H=P.trim().toLowerCase();return H.startsWith(" +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-W-09C5Mb.js","assets/index-CiHMlsuo.js","assets/index-CqjkU7Bl.css"])))=>i.map(i=>d[i]); +import{bR as xi,cb as Si,bQ as Ho,M as pl,bl as Ci,af as fl,bY as Mi,cc as Bi,b$ as hl,aU as $,c0 as Ei,c1 as Fi,c2 as Pi,a0 as Mo,aD as No,bE as ue,az as Li,cd as wn,c8 as mt,aI as To,aL as Y,s as Sn,aw as Vt,au as pt,bk as J,ce as Bo,u as ie,I as Ro,A as Oi,bJ as Gt,aY as ht,bL as vl,v as w,t as we,bB as ml,bb as Be,q as b,b7 as $i,cf as zi,cg as bn,ch as Hi,ci as Ni,cj as Ti,ck as Ri,as as A,cl as Eo,cm as Di,cn as Ai,co as Wt,cp as Fo,bO as Do,T as ji,G as qi,F as Po,g as Wi,c7 as _i,b_ as Ii}from"./index-CiHMlsuo.js";import{i as fe,t as kn}from"./safeRaf-DGuzXxDK.js";var xn=(k,M,y)=>new Promise((te,ne)=>{var be=P=>{try{r(y.next(P))}catch(H){ne(H)}},ke=P=>{try{r(y.throw(P))}catch(H){ne(H)}},r=P=>P.done?te(P.value):Promise.resolve(P.value).then(be,ke);r((y=y.apply(k,M)).next())});let Lo=!1,_t=null,It=null,Ut=null;function Ui(){return xn(this,null,function*(){if(Ut)return Ut;Ut=xn(null,null,function*(){if(!It)try{if(It=(function(k){const M=k;if(typeof M?.useMonaco=="function")return M;const y=k?.default;return typeof y?.useMonaco=="function"?y:null})(yield xi(()=>import("./index-W-09C5Mb.js"),__vite__mapDeps([0,1,2]))),!It)return null}catch{return null}try{return yield(function(k){return xn(this,null,function*(){return Lo?void 0:_t||(_t=xn(null,null,function*(){const y=globalThis?.MonacoEnvironment;y&&(typeof y.getWorker=="function"||typeof y.getWorkerUrl=="function")||typeof k?.preloadMonacoWorkers!="function"||(yield k.preloadMonacoWorkers()),Lo=!0}).finally(()=>{_t=null}),_t)})})(It),Si(),It}catch{return null}});try{return yield Ut}finally{Ut=null}})}var Vi=Object.defineProperty,Gi=Object.defineProperties,Ji=Object.getOwnPropertyDescriptors,Oo=Object.getOwnPropertySymbols,Yi=Object.prototype.hasOwnProperty,Qi=Object.prototype.propertyIsEnumerable,$o=(k,M,y)=>M in k?Vi(k,M,{enumerable:!0,configurable:!0,writable:!0,value:y}):k[M]=y,U=(k,M)=>{for(var y in M||(M={}))Yi.call(M,y)&&$o(k,y,M[y]);if(Oo)for(var y of Oo(M))Qi.call(M,y)&&$o(k,y,M[y]);return k},Me=(k,M)=>Gi(k,Ji(M)),j=(k,M,y)=>new Promise((te,ne)=>{var be=P=>{try{r(y.next(P))}catch(H){ne(H)}},ke=P=>{try{r(y.throw(P))}catch(H){ne(H)}},r=P=>P.done?te(P.value):Promise.resolve(P.value).then(be,ke);r((y=y.apply(k,M)).next())});const Xi={key:0,class:"code-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)] border-[var(--code-border)] bg-[var(--code-header-bg)] text-[var(--code-fg)]"},Ki={class:"flex items-center gap-0.5"},Zi=["aria-label"],er={class:"code-diff-stat removed"},tr={class:"code-diff-stat added"},nr=["aria-label"],lr={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},or={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},ir=["aria-pressed"],rr={key:3,class:"relative"},ar=["aria-expanded"],ur=["disabled"],sr=["disabled"],dr=["disabled"],cr={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},fr={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},vr={class:"code-loading-placeholder"},mr={class:"sr-only","aria-live":"polite",role:"status"},pr=pl({__name:"CodeBlockShell",props:{showHeader:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0},enableFontSizeControl:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},showTooltips:{type:Boolean,default:!0},isDark:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},stream:{type:Boolean,default:!1},isCollapsed:{type:Boolean,default:!1},isExpanded:{type:Boolean,default:!1},copyText:{type:Boolean,default:!1},isPreviewable:{type:Boolean,default:!1},codeFontSize:{},codeFontMin:{},codeFontMax:{},defaultCodeFontSize:{},fontBaselineReady:{type:Boolean,default:!1},diffStats:{},diffStatsAriaLabel:{}},emits:["toggleCollapse","decreaseFont","resetFont","increaseFont","copy","toggleExpand","preview"],setup(k,{emit:M}){const y=k,te=M,ne=$(!1),be=$(null),ke=$(null);function r(){mt(!0),ne.value=!ne.value,ne.value&&document.addEventListener("click",H,{once:!0,capture:!0})}function P(){mt(!0),ne.value=!1}function H(Q){var v,z;const wt=Q.target;(v=be.value)!=null&&v.contains(wt)||(z=ke.value)!=null&&z.contains(wt)?document.addEventListener("click",H,{once:!0,capture:!0}):P()}const re=b(()=>y.showFontSizeButtons&&y.enableFontSizeControl||y.showExpandButton||y.isPreviewable&&y.showPreviewButton),{t:T}=hl(),gt=b(()=>y.showTooltips!==!1);function Ge(Q,v){gt.value&&_i(Q.currentTarget,v,"top",!1,void 0,y.isDark)}function Ee(){gt.value&&mt()}function yt(Q){Ge(Q,y.copyText?T("common.copied")||"Copied":T("common.copy")||"Copy")}const gl=b(()=>{var Q,v;return!!Number.isFinite(y.codeFontSize)&&((Q=y.codeFontSize)!=null?Q:0)<=((v=y.codeFontMin)!=null?v:0)}),Jt=b(()=>!y.fontBaselineReady||y.codeFontSize===y.defaultCodeFontSize),Yt=b(()=>{var Q,v;return!!Number.isFinite(y.codeFontSize)&&((Q=y.codeFontSize)!=null?Q:0)>=((v=y.codeFontMax)!=null?v:100)});return(Q,v)=>(Y(),ie(Po,null,[y.showHeader?(Y(),ie("div",Xi,[ht(Q.$slots,"header-left"),ht(Q.$slots,"header-right",{},()=>[w("div",Ki,[k.diffStats?(Y(),ie("div",{key:0,class:"code-diff-stats","aria-label":k.diffStatsAriaLabel},[w("span",er,"-"+Be(k.diffStats.removed),1),w("span",tr,"+"+Be(k.diffStats.added),1)],8,Zi)):we("",!0),y.showCopyButton?(Y(),ie("button",{key:1,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-label":k.copyText?J(T)("common.copied")||"Copied":J(T)("common.copy")||"Copy",onClick:v[0]||(v[0]=z=>te("copy")),onMouseenter:v[1]||(v[1]=z=>yt(z)),onFocus:v[2]||(v[2]=z=>yt(z)),onMouseleave:Ee,onBlur:Ee},[k.copyText?(Y(),ie("svg",or,[...v[14]||(v[14]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(Y(),ie("svg",lr,[...v[13]||(v[13]=[w("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[w("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),w("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})],-1)])]))],40,nr)):we("",!0),y.showCollapseButton?(Y(),ie("button",{key:2,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-pressed":k.isCollapsed,onClick:v[3]||(v[3]=z=>te("toggleCollapse")),onMouseenter:v[4]||(v[4]=z=>Ge(z,k.isCollapsed?J(T)("common.expand")||"Expand":J(T)("common.collapse")||"Collapse")),onFocus:v[5]||(v[5]=z=>Ge(z,k.isCollapsed?J(T)("common.expand")||"Expand":J(T)("common.collapse")||"Collapse")),onMouseleave:Ee,onBlur:Ee},[(Y(),ie("svg",{style:Vt({rotate:k.isCollapsed?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[...v[15]||(v[15]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],40,ir)):we("",!0),re.value?(Y(),ie("div",rr,[w("button",{ref_key:"moreBtnRef",ref:ke,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] transition-colors","aria-expanded":ne.value,"aria-haspopup":"true",onClick:Do(r,["stop"]),onMouseenter:v[6]||(v[6]=z=>Ge(z,J(T)("common.more")||"More")),onFocus:v[7]||(v[7]=z=>Ge(z,J(T)("common.more")||"More")),onMouseleave:Ee,onBlur:Ee},[...v[16]||(v[16]=[qi('',1)])],40,ar),Ro(Wi,{name:"code-menu"},{default:Gt(()=>[ne.value?(Y(),ie("div",{key:0,ref_key:"moreMenuRef",ref:be,class:"code-more-menu min-w-[10rem] p-1 bg-[hsl(var(--ms-popover))] text-[hsl(var(--ms-popover-foreground))] border border-[var(--code-border)] shadow-[var(--ms-shadow-popover)]",role:"menu"},[y.showFontSizeButtons&&y.enableFontSizeControl?(Y(),ie(Po,{key:0},[w("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:gl.value,onClick:v[8]||(v[8]=z=>{J(mt)(!0),te("decreaseFont")})},[v[17]||(v[17]=w("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"})],-1)),w("span",null,Be(J(T)("common.fontSmaller")||"Font size −"),1)],8,ur),w("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:Jt.value,onClick:v[9]||(v[9]=z=>{J(mt)(!0),te("resetFont")})},[v[18]||(v[18]=w("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[w("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[w("path",{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}),w("path",{d:"M3 3v5h5"})])],-1)),w("span",null,Be(J(T)("common.fontReset")||"Font size reset"),1)],8,sr),w("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:Yt.value,onClick:v[10]||(v[10]=z=>{J(mt)(!0),te("increaseFont")})},[v[19]||(v[19]=w("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1)),w("span",null,Be(J(T)("common.fontLarger")||"Font size +"),1)],8,dr)],64)):we("",!0),y.showExpandButton?(Y(),ie("button",{key:1,type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] transition-colors",onClick:v[11]||(v[11]=z=>{P(),te("toggleExpand")})},[k.isExpanded?(Y(),ie("svg",cr,[...v[20]||(v[20]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"},null,-1)])])):(Y(),ie("svg",fr,[...v[21]||(v[21]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"},null,-1)])])),w("span",null,Be(k.isExpanded?J(T)("common.collapse")||"Collapse":J(T)("common.expand")||"Expand"),1)])):we("",!0),k.isPreviewable&&y.showPreviewButton?(Y(),ie("button",{key:2,type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] transition-colors",onClick:v[12]||(v[12]=z=>{P(),te("preview")})},[v[22]||(v[22]=w("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[w("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[w("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0"}),w("circle",{cx:"12",cy:"12",r:"3"})])],-1)),w("span",null,Be(J(T)("common.preview")||"Preview"),1)])):we("",!0)],512)):we("",!0)]),_:1})])):we("",!0)])])])):we("",!0),vl(w("div",{class:pt(["code-block-shell-content",{"code-block-shell-content--collapsed":k.isCollapsed}])},[ht(Q.$slots,"default")],2),[[ml,!!k.stream||!k.loading]]),vl(w("div",vr,[ht(Q.$slots,"loading",{},()=>[v[23]||(v[23]=w("div",{class:"loading-skeleton"},[w("div",{class:"skeleton-line"}),w("div",{class:"skeleton-line"}),w("div",{class:"skeleton-line short"})],-1))])],512),[[ml,!k.stream&&k.loading]]),w("span",mr,Be(k.copyText?J(T)("common.copied")||"Copied":""),1)],64))}}),hr={class:"html-preview-frame__header"},gr={class:"html-preview-frame__title"},yr={class:"html-preview-frame__label"},wr=["sandbox","srcdoc"],br=Ho(pl({__name:"HtmlPreviewFrame",props:{code:{},isDark:{type:Boolean},htmlPreviewAllowScripts:{type:Boolean},htmlPreviewSandbox:{},onClose:{type:Function},title:{}},setup(k){const M=k,y=import.meta!==void 0&&!1;let te=null;const{t:ne}=hl(),be=b(()=>{const P=M.code||"",H=P.trim().toLowerCase();return H.startsWith(" diff --git a/apps/kimi-code/dist-web/assets/Tooltip-DebxPz-0.js b/apps/kimi-code/dist-web/assets/Tooltip-Da35cfam.js similarity index 98% rename from apps/kimi-code/dist-web/assets/Tooltip-DebxPz-0.js rename to apps/kimi-code/dist-web/assets/Tooltip-Da35cfam.js index a3e39da306..9723d6798c 100644 --- a/apps/kimi-code/dist-web/assets/Tooltip-DebxPz-0.js +++ b/apps/kimi-code/dist-web/assets/Tooltip-Da35cfam.js @@ -1 +1 @@ -import{bQ as A,M as H,aU as b,bE as V,az as J,aL as O,s as Q,v as R,I as F,bJ as G,bL as K,aw as L,H as W,bb as Z,bB as ee,g as te,au as le,T as ae,as as B,bR as ne}from"./index--0t1wzw_.js";var k=(h,E,e)=>new Promise((o,p)=>{var i=a=>{try{d(e.next(a))}catch(c){p(c)}},y=a=>{try{d(e.throw(a))}catch(c){p(c)}},d=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,y);d((e=e.apply(h,E)).next())});const oe=["id"],ie=["data-placement"],ue=A(H({__name:"Tooltip",props:{visible:{type:Boolean},anchorEl:{},content:{},placement:{},offset:{},originX:{},originY:{},id:{},isDark:{type:[Boolean,null]}},setup(h){var E;const e=h,o=b(null),p=b(null),i=b({transform:"translate3d(0px, 0px, 0px)",left:"0px",top:"0px"}),y=b({}),d=b((E=e.placement)!=null?E:"top"),a=b(!1);let c=null,$=null,T=null,C=null,w=null,s=0;function X(){return C?Promise.resolve(C):(w||(w=ne(()=>import("./floating-ui.dom-xGUaHE3m.js"),[]).then(l=>(C=l,l)).catch(l=>{throw w=null,l})),w)}function D(){c&&(c(),c=null),$=null,T=null}function P(l){return k(this,null,function*(){const t=e.anchorEl,n=o.value;if(!e.visible||!t||!n||$===t&&T===n)return;const{autoUpdate:r}=yield X();l()&&e.visible&&e.anchorEl===t&&o.value===n&&(D(),$=t,T=n,c=r(t,n,()=>{N().catch(()=>{_()})}))})}function N(){return k(this,null,function*(){var l,t;const n=e.anchorEl,r=o.value;if(!e.visible||!n||!r)return!1;const{arrow:u,computePosition:m,flip:v,offset:f,shift:x}=yield X();if(!e.visible||e.anchorEl!==n||o.value!==r)return!1;const g=[f((l=e.offset)!=null?l:6),v(),x({padding:6}),...p.value?[u({element:p.value,padding:4})]:[]],{x:S,y:j,placement:Y,middlewareData:z}=yield m(n,r,{placement:(t=e.placement)!=null?t:"top",middleware:g,strategy:"fixed"});if(!e.visible||e.anchorEl!==n||o.value!==r)return!1;if(i.value.transform=`translate3d(${Math.round(S)}px, ${Math.round(j)}px, 0)`,i.value.left="0px",i.value.top="0px",d.value=Y,z.arrow&&p.value){const{x:I,y:U}=z.arrow,q={top:"bottom",bottom:"top",left:"right",right:"left"}[Y.split("-")[0]];y.value={left:I!=null?`${I}px`:"",top:U!=null?`${U}px`:"",[q]:"-3px"}}return!0})}function _(){var l,t;const n=e.anchorEl,r=o.value;if(!n||!r)return!1;const u=n.getBoundingClientRect(),m=r.getBoundingClientRect(),v=(l=e.offset)!=null?l:6,f=(t=e.placement)!=null?t:"top";let x=u.left,g=u.top;return f==="bottom"?g=u.bottom+v:f==="left"?x=u.left-m.width-v:f==="right"?x=u.right+v:g=u.top-m.height-v,i.value.transform=`translate3d(${Math.round(Math.max(0,x))}px, ${Math.round(Math.max(0,g))}px, 0)`,i.value.left="0px",i.value.top="0px",d.value=f,y.value={},!0}V(()=>e.visible,l=>k(null,null,function*(){const t=++s;if(l){if(a.value=!1,yield B(),t!==s||!e.visible)return;if(e.anchorEl&&o.value)try{const n=e.anchorEl,r=o.value,u=n.getBoundingClientRect();if(!(yield N())||t!==s||!e.visible||e.anchorEl!==n||o.value!==r)return;const m=i.value.transform;if(e.originX!=null&&e.originY!=null){const v=Math.abs(Number(e.originX)-u.left),f=Math.abs(Number(e.originY)-u.top);if(Math.hypot(v,f)>120){if(i.value.transform=`translate3d(${Math.round(e.originX)}px, ${Math.round(e.originY)}px, 0)`,yield B(),t!==s||!e.visible||(a.value=!0,yield B(),t!==s||!e.visible))return;i.value.transform=m}else a.value=!0}else a.value=!0;yield P(()=>t===s)}catch{if(t!==s||!e.visible)return;if(a.value=_(),e.anchorEl&&o.value)try{yield P(()=>t===s)}catch{}}else a.value=!0}else a.value=!1,D()}));let M=0;return V([()=>e.anchorEl,()=>e.placement,()=>e.content],()=>k(null,null,function*(){const l=++M;if(e.visible&&e.anchorEl&&o.value){if(yield B(),l!==M||!e.visible||!e.anchorEl||!o.value)return;try{const t=yield N();if(l!==M||!e.visible||!e.anchorEl||!o.value)return;t||_()}catch{_()}yield P(()=>l===M)}})),J(()=>{s+=1,D()}),(l,t)=>(O(),Q(ae,{to:"body"},[R("div",{class:le(["markstream-vue",{dark:h.isDark}])},[F(te,{name:"tooltip",appear:""},{default:G(()=>[K(R("div",{id:e.id,ref_key:"tooltip",ref:o,style:L({position:"fixed",left:i.value.left,top:i.value.top,transform:i.value.transform,visibility:a.value?"visible":"hidden",pointerEvents:a.value?void 0:"none"}),class:"tooltip-element",role:"tooltip"},[W(Z(h.content)+" ",1),R("div",{ref_key:"arrowEl",ref:p,class:"tooltip-arrow","data-placement":d.value,style:L(y.value)},null,12,ie)],12,oe),[[ee,h.visible]])]),_:1})],2)]))}}),[["__scopeId","data-v-c606ee4c"]]);export{ue as default}; +import{bQ as A,M as H,aU as b,bE as V,az as J,aL as O,s as Q,v as R,I as F,bJ as G,bL as K,aw as L,H as W,bb as Z,bB as ee,g as te,au as le,T as ae,as as B,bR as ne}from"./index-CiHMlsuo.js";var k=(h,E,e)=>new Promise((o,p)=>{var i=a=>{try{d(e.next(a))}catch(c){p(c)}},y=a=>{try{d(e.throw(a))}catch(c){p(c)}},d=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,y);d((e=e.apply(h,E)).next())});const oe=["id"],ie=["data-placement"],ue=A(H({__name:"Tooltip",props:{visible:{type:Boolean},anchorEl:{},content:{},placement:{},offset:{},originX:{},originY:{},id:{},isDark:{type:[Boolean,null]}},setup(h){var E;const e=h,o=b(null),p=b(null),i=b({transform:"translate3d(0px, 0px, 0px)",left:"0px",top:"0px"}),y=b({}),d=b((E=e.placement)!=null?E:"top"),a=b(!1);let c=null,$=null,T=null,C=null,w=null,s=0;function X(){return C?Promise.resolve(C):(w||(w=ne(()=>import("./floating-ui.dom-xGUaHE3m.js"),[]).then(l=>(C=l,l)).catch(l=>{throw w=null,l})),w)}function D(){c&&(c(),c=null),$=null,T=null}function P(l){return k(this,null,function*(){const t=e.anchorEl,n=o.value;if(!e.visible||!t||!n||$===t&&T===n)return;const{autoUpdate:r}=yield X();l()&&e.visible&&e.anchorEl===t&&o.value===n&&(D(),$=t,T=n,c=r(t,n,()=>{N().catch(()=>{_()})}))})}function N(){return k(this,null,function*(){var l,t;const n=e.anchorEl,r=o.value;if(!e.visible||!n||!r)return!1;const{arrow:u,computePosition:m,flip:v,offset:f,shift:x}=yield X();if(!e.visible||e.anchorEl!==n||o.value!==r)return!1;const g=[f((l=e.offset)!=null?l:6),v(),x({padding:6}),...p.value?[u({element:p.value,padding:4})]:[]],{x:S,y:j,placement:Y,middlewareData:z}=yield m(n,r,{placement:(t=e.placement)!=null?t:"top",middleware:g,strategy:"fixed"});if(!e.visible||e.anchorEl!==n||o.value!==r)return!1;if(i.value.transform=`translate3d(${Math.round(S)}px, ${Math.round(j)}px, 0)`,i.value.left="0px",i.value.top="0px",d.value=Y,z.arrow&&p.value){const{x:I,y:U}=z.arrow,q={top:"bottom",bottom:"top",left:"right",right:"left"}[Y.split("-")[0]];y.value={left:I!=null?`${I}px`:"",top:U!=null?`${U}px`:"",[q]:"-3px"}}return!0})}function _(){var l,t;const n=e.anchorEl,r=o.value;if(!n||!r)return!1;const u=n.getBoundingClientRect(),m=r.getBoundingClientRect(),v=(l=e.offset)!=null?l:6,f=(t=e.placement)!=null?t:"top";let x=u.left,g=u.top;return f==="bottom"?g=u.bottom+v:f==="left"?x=u.left-m.width-v:f==="right"?x=u.right+v:g=u.top-m.height-v,i.value.transform=`translate3d(${Math.round(Math.max(0,x))}px, ${Math.round(Math.max(0,g))}px, 0)`,i.value.left="0px",i.value.top="0px",d.value=f,y.value={},!0}V(()=>e.visible,l=>k(null,null,function*(){const t=++s;if(l){if(a.value=!1,yield B(),t!==s||!e.visible)return;if(e.anchorEl&&o.value)try{const n=e.anchorEl,r=o.value,u=n.getBoundingClientRect();if(!(yield N())||t!==s||!e.visible||e.anchorEl!==n||o.value!==r)return;const m=i.value.transform;if(e.originX!=null&&e.originY!=null){const v=Math.abs(Number(e.originX)-u.left),f=Math.abs(Number(e.originY)-u.top);if(Math.hypot(v,f)>120){if(i.value.transform=`translate3d(${Math.round(e.originX)}px, ${Math.round(e.originY)}px, 0)`,yield B(),t!==s||!e.visible||(a.value=!0,yield B(),t!==s||!e.visible))return;i.value.transform=m}else a.value=!0}else a.value=!0;yield P(()=>t===s)}catch{if(t!==s||!e.visible)return;if(a.value=_(),e.anchorEl&&o.value)try{yield P(()=>t===s)}catch{}}else a.value=!0}else a.value=!1,D()}));let M=0;return V([()=>e.anchorEl,()=>e.placement,()=>e.content],()=>k(null,null,function*(){const l=++M;if(e.visible&&e.anchorEl&&o.value){if(yield B(),l!==M||!e.visible||!e.anchorEl||!o.value)return;try{const t=yield N();if(l!==M||!e.visible||!e.anchorEl||!o.value)return;t||_()}catch{_()}yield P(()=>l===M)}})),J(()=>{s+=1,D()}),(l,t)=>(O(),Q(ae,{to:"body"},[R("div",{class:le(["markstream-vue",{dark:h.isDark}])},[F(te,{name:"tooltip",appear:""},{default:G(()=>[K(R("div",{id:e.id,ref_key:"tooltip",ref:o,style:L({position:"fixed",left:i.value.left,top:i.value.top,transform:i.value.transform,visibility:a.value?"visible":"hidden",pointerEvents:a.value?void 0:"none"}),class:"tooltip-element",role:"tooltip"},[W(Z(h.content)+" ",1),R("div",{ref_key:"arrowEl",ref:p,class:"tooltip-arrow","data-placement":d.value,style:L(y.value)},null,12,ie)],12,oe),[[ee,h.visible]])]),_:1})],2)]))}}),[["__scopeId","data-v-c606ee4c"]]);export{ue as default}; diff --git a/apps/kimi-code/dist-web/assets/abnfDiagram-VRR7QNED-Bo8g46XA.js b/apps/kimi-code/dist-web/assets/abnfDiagram-VRR7QNED-C6R_sAbc.js similarity index 86% rename from apps/kimi-code/dist-web/assets/abnfDiagram-VRR7QNED-Bo8g46XA.js rename to apps/kimi-code/dist-web/assets/abnfDiagram-VRR7QNED-C6R_sAbc.js index 71d6697a63..5d9414f74a 100644 --- a/apps/kimi-code/dist-web/assets/abnfDiagram-VRR7QNED-Bo8g46XA.js +++ b/apps/kimi-code/dist-web/assets/abnfDiagram-VRR7QNED-C6R_sAbc.js @@ -1 +1 @@ -import{g as p,r as u,d as a}from"./chunk-MOJQB5TN-DcgqWRh_.js";import{p as f}from"./chunk-JWPE2WC7-C7S97jLg.js";import{_ as n,l as o}from"./mermaid.core-CqiFQExc.js";import{M as c,b as d}from"./cynefin-VYW2F7L2-DEnbetzx.js";import"./index--0t1wzw_.js";import"./_commonjsHelpers-CqkleIqs.js";var v=d().RailroadAbnf.parser.LangiumParser,i=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},F={parser:R,db:a,renderer:u,styles:p};export{F as diagram}; +import{g as p,r as u,d as a}from"./chunk-MOJQB5TN-DmVMZHwQ.js";import{p as f}from"./chunk-JWPE2WC7-BJMJfnyy.js";import{_ as n,l as o}from"./mermaid.core-WW7RuneT.js";import{M as c,b as d}from"./cynefin-VYW2F7L2-DI-9Z5R0.js";import"./index-CiHMlsuo.js";import"./_commonjsHelpers-CqkleIqs.js";var v=d().RailroadAbnf.parser.LangiumParser,i=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},F={parser:R,db:a,renderer:u,styles:p};export{F as diagram}; diff --git a/apps/kimi-code/dist-web/assets/arc-CxCMb0Ef.js b/apps/kimi-code/dist-web/assets/arc-CPC2gY0w.js similarity index 98% rename from apps/kimi-code/dist-web/assets/arc-CxCMb0Ef.js rename to apps/kimi-code/dist-web/assets/arc-CPC2gY0w.js index c2362be546..ecd4bdd507 100644 --- a/apps/kimi-code/dist-web/assets/arc-CxCMb0Ef.js +++ b/apps/kimi-code/dist-web/assets/arc-CPC2gY0w.js @@ -1 +1 @@ -import{P as ln,Q as an,R as j,S,T as W,V as un,W as y,X as tn,Y as C,$ as _,a0 as rn,a1 as o,a2 as on,a3 as sn,a4 as fn}from"./mermaid.core-CqiFQExc.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,E,q,v,R,X,a){var I=E-l,i=q-h,n=X-v,d=a-R,u=d*I-n*i;if(!(u*ur*r+$*$&&(Q=w,V=p),{cx:Q,cy:V,x01:-n,y01:-d,x11:Q*(v/T-1),y11:V*(v/T-1)}}function hn(){var l=cn,h=yn,E=W(0),q=null,v=gn,R=dn,X=mn,a=null,I=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=R.apply(this,arguments)-un,Y=rn(c-f),t=c>f;if(a||(a=n=I()),sy))a.moveTo(0,0);else if(Y>tn-y)a.moveTo(s*j(f),s*S(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*j(c),u*S(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,A=f,T=c,P=Y,O=Y,Q=X.apply(this,arguments)/2,V=Q>y&&(q?+q.apply(this,arguments):C(u*u+s*s)),w=_(rn(s-u)/2,+E.apply(this,arguments)),p=w,x=w,e,r;if(V>y){var $=sn(V/u*S(Q)),F=sn(V/s*S(Q));(P-=$*2)>y?($*=t?1:-1,A+=$,T-=$):(P=0,A=T=(f+c)/2),(O-=F*2)>y?(F*=t?1:-1,m+=F,g-=F):(O=0,m=g=(f+c)/2)}var z=s*j(m),B=s*S(m),G=u*j(T),H=u*S(T);if(w>y){var J=s*j(g),K=s*S(g),M=u*j(A),N=u*S(A),D;if(Yy?x>y?(e=L(M,N,z,B,s,x,t),r=L(J,K,G,H,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),xy)||!(P>y)?a.lineTo(G,H):p>y?(e=L(G,H,J,K,u,-p,t),r=L(z,B,M,N,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),pr*r+$*$&&(Q=w,V=p),{cx:Q,cy:V,x01:-n,y01:-d,x11:Q*(v/T-1),y11:V*(v/T-1)}}function hn(){var l=cn,h=yn,E=W(0),q=null,v=gn,R=dn,X=mn,a=null,I=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=R.apply(this,arguments)-un,Y=rn(c-f),t=c>f;if(a||(a=n=I()),sy))a.moveTo(0,0);else if(Y>tn-y)a.moveTo(s*j(f),s*S(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*j(c),u*S(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,A=f,T=c,P=Y,O=Y,Q=X.apply(this,arguments)/2,V=Q>y&&(q?+q.apply(this,arguments):C(u*u+s*s)),w=_(rn(s-u)/2,+E.apply(this,arguments)),p=w,x=w,e,r;if(V>y){var $=sn(V/u*S(Q)),F=sn(V/s*S(Q));(P-=$*2)>y?($*=t?1:-1,A+=$,T-=$):(P=0,A=T=(f+c)/2),(O-=F*2)>y?(F*=t?1:-1,m+=F,g-=F):(O=0,m=g=(f+c)/2)}var z=s*j(m),B=s*S(m),G=u*j(T),H=u*S(T);if(w>y){var J=s*j(g),K=s*S(g),M=u*j(A),N=u*S(A),D;if(Yy?x>y?(e=L(M,N,z,B,s,x,t),r=L(J,K,G,H,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),xy)||!(P>y)?a.lineTo(G,H):p>y?(e=L(G,H,J,K,u,-p,t),r=L(z,B,M,N,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),ps?(this.rect.x-=(this.labelWidth-s)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(s+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(o+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>o?(this.rect.y-=(this.labelHeight-o)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(o+this.labelHeight))}}},e.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==h.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},e.prototype.transform=function(t){var s=this.rect.x;s>r.WORLD_BOUNDARY?s=r.WORLD_BOUNDARY:s<-r.WORLD_BOUNDARY&&(s=-r.WORLD_BOUNDARY);var o=this.rect.y;o>r.WORLD_BOUNDARY?o=r.WORLD_BOUNDARY:o<-r.WORLD_BOUNDARY&&(o=-r.WORLD_BOUNDARY);var c=new f(s,o),l=t.inverseTransformPoint(c);this.setLocation(l.x,l.y)},e.prototype.getLeft=function(){return this.rect.x},e.prototype.getRight=function(){return this.rect.x+this.rect.width},e.prototype.getTop=function(){return this.rect.y},e.prototype.getBottom=function(){return this.rect.y+this.rect.height},e.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},A.exports=e}),(function(A,G,N){var v=N(0);function h(){}for(var i in v)h[i]=v[i];h.MAX_ITERATIONS=2500,h.DEFAULT_EDGE_LENGTH=50,h.DEFAULT_SPRING_STRENGTH=.45,h.DEFAULT_REPULSION_STRENGTH=4500,h.DEFAULT_GRAVITY_STRENGTH=.4,h.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,h.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,h.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,h.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,h.COOLING_ADAPTATION_FACTOR=.33,h.ADAPTATION_LOWER_NODE_LIMIT=1e3,h.ADAPTATION_UPPER_NODE_LIMIT=5e3,h.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,h.MAX_NODE_DISPLACEMENT=h.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,h.MIN_REPULSION_DIST=h.DEFAULT_EDGE_LENGTH/10,h.CONVERGENCE_CHECK_PERIOD=100,h.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,h.MIN_EDGE_LENGTH=1,h.GRID_CALCULATION_CHECK_PERIOD=10,A.exports=h}),(function(A,G,N){function v(h,i){h==null&&i==null?(this.x=0,this.y=0):(this.x=h,this.y=i)}v.prototype.getX=function(){return this.x},v.prototype.getY=function(){return this.y},v.prototype.setX=function(h){this.x=h},v.prototype.setY=function(h){this.y=h},v.prototype.getDifference=function(h){return new DimensionD(this.x-h.x,this.y-h.y)},v.prototype.getCopy=function(){return new v(this.x,this.y)},v.prototype.translate=function(h){return this.x+=h.width,this.y+=h.height,this},A.exports=v}),(function(A,G,N){var v=N(2),h=N(10),i=N(0),r=N(7),a=N(3),f=N(1),e=N(13),u=N(12),t=N(11);function s(c,l,T){v.call(this,T),this.estimatedSize=h.MIN_VALUE,this.margin=i.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=c,l!=null&&l instanceof r?this.graphManager=l:l!=null&&l instanceof Layout&&(this.graphManager=l.graphManager)}s.prototype=Object.create(v.prototype);for(var o in v)s[o]=v[o];s.prototype.getNodes=function(){return this.nodes},s.prototype.getEdges=function(){return this.edges},s.prototype.getGraphManager=function(){return this.graphManager},s.prototype.getParent=function(){return this.parent},s.prototype.getLeft=function(){return this.left},s.prototype.getRight=function(){return this.right},s.prototype.getTop=function(){return this.top},s.prototype.getBottom=function(){return this.bottom},s.prototype.isConnected=function(){return this.isConnected},s.prototype.add=function(c,l,T){if(l==null&&T==null){var g=c;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(g)>-1)throw"Node already in graph!";return g.owner=this,this.getNodes().push(g),g}else{var d=c;if(!(this.getNodes().indexOf(l)>-1&&this.getNodes().indexOf(T)>-1))throw"Source or target not in graph!";if(!(l.owner==T.owner&&l.owner==this))throw"Both owners must be this graph!";return l.owner!=T.owner?null:(d.source=l,d.target=T,d.isInterGraph=!1,this.getEdges().push(d),l.edges.push(d),T!=l&&T.edges.push(d),d)}},s.prototype.remove=function(c){var l=c;if(c instanceof a){if(l==null)throw"Node is null!";if(!(l.owner!=null&&l.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var T=l.edges.slice(),g,d=T.length,C=0;C-1&&P>-1))throw"Source and/or target doesn't know this edge!";g.source.edges.splice(w,1),g.target!=g.source&&g.target.edges.splice(P,1);var S=g.source.owner.getEdges().indexOf(g);if(S==-1)throw"Not in owner's edge list!";g.source.owner.getEdges().splice(S,1)}},s.prototype.updateLeftTop=function(){for(var c=h.MAX_VALUE,l=h.MAX_VALUE,T,g,d,C=this.getNodes(),S=C.length,w=0;wT&&(c=T),l>g&&(l=g)}return c==h.MAX_VALUE?null:(C[0].getParent().paddingLeft!=null?d=C[0].getParent().paddingLeft:d=this.margin,this.left=l-d,this.top=c-d,new u(this.left,this.top))},s.prototype.updateBounds=function(c){for(var l=h.MAX_VALUE,T=-h.MAX_VALUE,g=h.MAX_VALUE,d=-h.MAX_VALUE,C,S,w,P,B,U=this.nodes,V=U.length,M=0;MC&&(l=C),Tw&&(g=w),dC&&(l=C),Tw&&(g=w),d=this.nodes.length){var V=0;T.forEach(function(M){M.owner==c&&V++}),V==this.nodes.length&&(this.isConnected=!0)}},A.exports=s}),(function(A,G,N){var v,h=N(1);function i(r){v=N(6),this.layout=r,this.graphs=[],this.edges=[]}i.prototype.addRoot=function(){var r=this.layout.newGraph(),a=this.layout.newNode(null),f=this.add(r,a);return this.setRootGraph(f),this.rootGraph},i.prototype.add=function(r,a,f,e,u){if(f==null&&e==null&&u==null){if(r==null)throw"Graph is null!";if(a==null)throw"Parent node is null!";if(this.graphs.indexOf(r)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(r),r.parent!=null)throw"Already has a parent!";if(a.child!=null)throw"Already has a child!";return r.parent=a,a.child=r,r}else{u=f,e=a,f=r;var t=e.getOwner(),s=u.getOwner();if(!(t!=null&&t.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(s!=null&&s.getGraphManager()==this))throw"Target not in this graph mgr!";if(t==s)return f.isInterGraph=!1,t.add(f,e,u);if(f.isInterGraph=!0,f.source=e,f.target=u,this.edges.indexOf(f)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(f),!(f.source!=null&&f.target!=null))throw"Edge source and/or target is null!";if(!(f.source.edges.indexOf(f)==-1&&f.target.edges.indexOf(f)==-1))throw"Edge already in source and/or target incidency list!";return f.source.edges.push(f),f.target.edges.push(f),f}},i.prototype.remove=function(r){if(r instanceof v){var a=r;if(a.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(a==this.rootGraph||a.parent!=null&&a.parent.graphManager==this))throw"Invalid parent node!";var f=[];f=f.concat(a.getEdges());for(var e,u=f.length,t=0;t=r.getRight()?a[0]+=Math.min(r.getX()-i.getX(),i.getRight()-r.getRight()):r.getX()<=i.getX()&&r.getRight()>=i.getRight()&&(a[0]+=Math.min(i.getX()-r.getX(),r.getRight()-i.getRight())),i.getY()<=r.getY()&&i.getBottom()>=r.getBottom()?a[1]+=Math.min(r.getY()-i.getY(),i.getBottom()-r.getBottom()):r.getY()<=i.getY()&&r.getBottom()>=i.getBottom()&&(a[1]+=Math.min(i.getY()-r.getY(),r.getBottom()-i.getBottom()));var u=Math.abs((r.getCenterY()-i.getCenterY())/(r.getCenterX()-i.getCenterX()));r.getCenterY()===i.getCenterY()&&r.getCenterX()===i.getCenterX()&&(u=1);var t=u*a[0],s=a[1]/u;a[0]t)return a[0]=f,a[1]=o,a[2]=u,a[3]=U,!1;if(eu)return a[0]=s,a[1]=e,a[2]=P,a[3]=t,!1;if(fu?(a[0]=l,a[1]=T,n=!0):(a[0]=c,a[1]=o,n=!0):p===y&&(f>u?(a[0]=s,a[1]=o,n=!0):(a[0]=g,a[1]=T,n=!0)),-m===y?u>f?(a[2]=B,a[3]=U,E=!0):(a[2]=P,a[3]=w,E=!0):m===y&&(u>f?(a[2]=S,a[3]=w,E=!0):(a[2]=V,a[3]=U,E=!0)),n&&E)return!1;if(f>u?e>t?(I=this.getCardinalDirection(p,y,4),O=this.getCardinalDirection(m,y,2)):(I=this.getCardinalDirection(-p,y,3),O=this.getCardinalDirection(-m,y,1)):e>t?(I=this.getCardinalDirection(-p,y,1),O=this.getCardinalDirection(-m,y,3)):(I=this.getCardinalDirection(p,y,2),O=this.getCardinalDirection(m,y,4)),!n)switch(I){case 1:W=o,R=f+-C/y,a[0]=R,a[1]=W;break;case 2:R=g,W=e+d*y,a[0]=R,a[1]=W;break;case 3:W=T,R=f+C/y,a[0]=R,a[1]=W;break;case 4:R=l,W=e+-d*y,a[0]=R,a[1]=W;break}if(!E)switch(O){case 1:Q=w,x=u+-_/y,a[2]=x,a[3]=Q;break;case 2:x=V,Q=t+M*y,a[2]=x,a[3]=Q;break;case 3:Q=U,x=u+_/y,a[2]=x,a[3]=Q;break;case 4:x=B,Q=t+-M*y,a[2]=x,a[3]=Q;break}}return!1},h.getCardinalDirection=function(i,r,a){return i>r?a:1+a%4},h.getIntersection=function(i,r,a,f){if(f==null)return this.getIntersection2(i,r,a);var e=i.x,u=i.y,t=r.x,s=r.y,o=a.x,c=a.y,l=f.x,T=f.y,g=void 0,d=void 0,C=void 0,S=void 0,w=void 0,P=void 0,B=void 0,U=void 0,V=void 0;return C=s-u,w=e-t,B=t*u-e*s,S=T-c,P=o-l,U=l*c-o*T,V=C*P-S*w,V===0?null:(g=(w*U-P*B)/V,d=(S*B-C*U)/V,new v(g,d))},h.angleOfVector=function(i,r,a,f){var e=void 0;return i!==a?(e=Math.atan((f-r)/(a-i)),a=0){var T=(-o+Math.sqrt(o*o-4*s*c))/(2*s),g=(-o-Math.sqrt(o*o-4*s*c))/(2*s),d=null;return T>=0&&T<=1?[T]:g>=0&&g<=1?[g]:d}else return null},h.HALF_PI=.5*Math.PI,h.ONE_AND_HALF_PI=1.5*Math.PI,h.TWO_PI=2*Math.PI,h.THREE_PI=3*Math.PI,A.exports=h}),(function(A,G,N){function v(){}v.sign=function(h){return h>0?1:h<0?-1:0},v.floor=function(h){return h<0?Math.ceil(h):Math.floor(h)},v.ceil=function(h){return h<0?Math.floor(h):Math.ceil(h)},A.exports=v}),(function(A,G,N){function v(){}v.MAX_VALUE=2147483647,v.MIN_VALUE=-2147483648,A.exports=v}),(function(A,G,N){var v=(function(){function e(u,t){for(var s=0;s"u"?"undefined":v(i);return i==null||r!="object"&&r!="function"},A.exports=h}),(function(A,G,N){function v(o){if(Array.isArray(o)){for(var c=0,l=Array(o.length);c0&&c;){for(C.push(w[0]);C.length>0&&c;){var P=C[0];C.splice(0,1),d.add(P);for(var B=P.getEdges(),g=0;g-1&&w.splice(_,1)}d=new Set,S=new Map}}return o},s.prototype.createDummyNodesForBendpoints=function(o){for(var c=[],l=o.source,T=this.graphManager.calcLowestCommonAncestor(o.source,o.target),g=0;g0){for(var T=this.edgeToDummyNodes.get(l),g=0;g=0&&c.splice(U,1);var V=S.getNeighborsList();V.forEach(function(n){if(l.indexOf(n)<0){var E=T.get(n),p=E-1;p==1&&P.push(n),T.set(n,p)}})}l=l.concat(P),(c.length==1||c.length==2)&&(g=!0,d=c[0])}return d},s.prototype.setGraphManager=function(o){this.graphManager=o},A.exports=s}),(function(A,G,N){function v(){}v.seed=1,v.x=0,v.nextDouble=function(){return v.x=Math.sin(v.seed++)*1e4,v.x-Math.floor(v.x)},A.exports=v}),(function(A,G,N){var v=N(5);function h(i,r){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}h.prototype.getWorldOrgX=function(){return this.lworldOrgX},h.prototype.setWorldOrgX=function(i){this.lworldOrgX=i},h.prototype.getWorldOrgY=function(){return this.lworldOrgY},h.prototype.setWorldOrgY=function(i){this.lworldOrgY=i},h.prototype.getWorldExtX=function(){return this.lworldExtX},h.prototype.setWorldExtX=function(i){this.lworldExtX=i},h.prototype.getWorldExtY=function(){return this.lworldExtY},h.prototype.setWorldExtY=function(i){this.lworldExtY=i},h.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},h.prototype.setDeviceOrgX=function(i){this.ldeviceOrgX=i},h.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},h.prototype.setDeviceOrgY=function(i){this.ldeviceOrgY=i},h.prototype.getDeviceExtX=function(){return this.ldeviceExtX},h.prototype.setDeviceExtX=function(i){this.ldeviceExtX=i},h.prototype.getDeviceExtY=function(){return this.ldeviceExtY},h.prototype.setDeviceExtY=function(i){this.ldeviceExtY=i},h.prototype.transformX=function(i){var r=0,a=this.lworldExtX;return a!=0&&(r=this.ldeviceOrgX+(i-this.lworldOrgX)*this.ldeviceExtX/a),r},h.prototype.transformY=function(i){var r=0,a=this.lworldExtY;return a!=0&&(r=this.ldeviceOrgY+(i-this.lworldOrgY)*this.ldeviceExtY/a),r},h.prototype.inverseTransformX=function(i){var r=0,a=this.ldeviceExtX;return a!=0&&(r=this.lworldOrgX+(i-this.ldeviceOrgX)*this.lworldExtX/a),r},h.prototype.inverseTransformY=function(i){var r=0,a=this.ldeviceExtY;return a!=0&&(r=this.lworldOrgY+(i-this.ldeviceOrgY)*this.lworldExtY/a),r},h.prototype.inverseTransformPoint=function(i){var r=new v(this.inverseTransformX(i.x),this.inverseTransformY(i.y));return r},A.exports=h}),(function(A,G,N){function v(t){if(Array.isArray(t)){for(var s=0,o=Array(t.length);si.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*i.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-i.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>i.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(i.COOLING_ADAPTATION_FACTOR,1-(t-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*(1-i.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},e.prototype.calcSpringForces=function(){for(var t=this.getAllEdges(),s,o=0;o0&&arguments[0]!==void 0?arguments[0]:!0,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,o,c,l,T,g=this.getAllNodes(),d;if(this.useFRGridVariant)for(this.totalIterations%i.GRID_CALCULATION_CHECK_PERIOD==1&&t&&this.updateGrid(),d=new Set,o=0;oC||d>C)&&(t.gravitationForceX=-this.gravityConstant*l,t.gravitationForceY=-this.gravityConstant*T)):(C=s.getEstimatedSize()*this.compoundGravityRangeFactor,(g>C||d>C)&&(t.gravitationForceX=-this.gravityConstant*l*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*T*this.compoundGravityConstant))},e.prototype.isConverged=function(){var t,s=!1;return this.totalIterations>this.maxIterations/3&&(s=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement=g.length||C>=g[0].length)){for(var S=0;Se}}]),a})();A.exports=r}),(function(A,G,N){function v(){}v.svd=function(h){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=h.length,this.n=h[0].length;var i=Math.min(this.m,this.n);this.s=(function(Tt){for(var Ct=[];Tt-- >0;)Ct.push(0);return Ct})(Math.min(this.m+1,this.n)),this.U=(function(Tt){var Ct=function Bt(bt){if(bt.length==0)return 0;for(var zt=[],St=0;St0;)Ct.push(0);return Ct})(this.n),a=(function(Tt){for(var Ct=[];Tt-- >0;)Ct.push(0);return Ct})(this.m),f=!0,e=Math.min(this.m-1,this.n),u=Math.max(0,Math.min(this.n-2,this.m)),t=0;t=0;m--)if(this.s[m]!==0){for(var y=m+1;y=0;z--){if((function(Tt,Ct){return Tt&&Ct})(z0;){var J=void 0,It=void 0;for(J=n-2;J>=-1&&J!==-1;J--)if(Math.abs(r[J])<=ht+tt*(Math.abs(this.s[J])+Math.abs(this.s[J+1]))){r[J]=0;break}if(J===n-2)It=4;else{var Nt=void 0;for(Nt=n-1;Nt>=J&&Nt!==J;Nt--){var vt=(Nt!==n?Math.abs(r[Nt]):0)+(Nt!==J+1?Math.abs(r[Nt-1]):0);if(Math.abs(this.s[Nt])<=ht+tt*vt){this.s[Nt]=0;break}}Nt===J?It=3:Nt===n-1?It=1:(It=2,J=Nt)}switch(J++,It){case 1:{var it=r[n-2];r[n-2]=0;for(var ut=n-2;ut>=J;ut--){var Et=v.hypot(this.s[ut],it),wt=this.s[ut]/Et,Ot=it/Et;this.s[ut]=Et,ut!==J&&(it=-Ot*r[ut-1],r[ut-1]=wt*r[ut-1]);for(var mt=0;mt=this.s[J+1]);){var Lt=this.s[J];if(this.s[J]=this.s[J+1],this.s[J+1]=Lt,JMath.abs(i)?(r=i/h,r=Math.abs(h)*Math.sqrt(1+r*r)):i!=0?(r=h/i,r=Math.abs(i)*Math.sqrt(1+r*r)):r=0,r},A.exports=v}),(function(A,G,N){var v=(function(){function r(a,f){for(var e=0;e2&&arguments[2]!==void 0?arguments[2]:1,u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,t=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;h(this,r),this.sequence1=a,this.sequence2=f,this.match_score=e,this.mismatch_penalty=u,this.gap_penalty=t,this.iMax=a.length+1,this.jMax=f.length+1,this.grid=new Array(this.iMax);for(var s=0;s=0;a--){var f=this.listeners[a];f.event===i&&f.callback===r&&this.listeners.splice(a,1)}},h.emit=function(i,r){for(var a=0;a{var G={45:((i,r,a)=>{var f={};f.layoutBase=a(551),f.CoSEConstants=a(806),f.CoSEEdge=a(767),f.CoSEGraph=a(880),f.CoSEGraphManager=a(578),f.CoSELayout=a(765),f.CoSENode=a(991),f.ConstraintHandler=a(902),i.exports=f}),806:((i,r,a)=>{var f=a(551).FDLayoutConstants;function e(){}for(var u in f)e[u]=f[u];e.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,e.DEFAULT_RADIAL_SEPARATION=f.DEFAULT_EDGE_LENGTH,e.DEFAULT_COMPONENT_SEPERATION=60,e.TILE=!0,e.TILING_PADDING_VERTICAL=10,e.TILING_PADDING_HORIZONTAL=10,e.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,e.ENFORCE_CONSTRAINTS=!0,e.APPLY_LAYOUT=!0,e.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,e.TREE_REDUCTION_ON_INCREMENTAL=!0,e.PURE_INCREMENTAL=e.DEFAULT_INCREMENTAL,i.exports=e}),767:((i,r,a)=>{var f=a(551).FDLayoutEdge;function e(t,s,o){f.call(this,t,s,o)}e.prototype=Object.create(f.prototype);for(var u in f)e[u]=f[u];i.exports=e}),880:((i,r,a)=>{var f=a(551).LGraph;function e(t,s,o){f.call(this,t,s,o)}e.prototype=Object.create(f.prototype);for(var u in f)e[u]=f[u];i.exports=e}),578:((i,r,a)=>{var f=a(551).LGraphManager;function e(t){f.call(this,t)}e.prototype=Object.create(f.prototype);for(var u in f)e[u]=f[u];i.exports=e}),765:((i,r,a)=>{var f=a(551).FDLayout,e=a(578),u=a(880),t=a(991),s=a(767),o=a(806),c=a(902),l=a(551).FDLayoutConstants,T=a(551).LayoutConstants,g=a(551).Point,d=a(551).PointD,C=a(551).DimensionD,S=a(551).Layout,w=a(551).Integer,P=a(551).IGeometry,B=a(551).LGraph,U=a(551).Transform,V=a(551).LinkedList;function M(){f.call(this),this.toBeTiled={},this.constraints={}}M.prototype=Object.create(f.prototype);for(var _ in f)M[_]=f[_];M.prototype.newGraphManager=function(){var n=new e(this);return this.graphManager=n,n},M.prototype.newGraph=function(n){return new u(null,this.graphManager,n)},M.prototype.newNode=function(n){return new t(this.graphManager,n)},M.prototype.newEdge=function(n){return new s(null,null,n)},M.prototype.initParameters=function(){f.prototype.initParameters.call(this,arguments),this.isSubLayout||(o.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=o.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=l.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=l.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=l.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},M.prototype.initSpringEmbedder=function(){f.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/l.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},M.prototype.layout=function(){var n=T.DEFAULT_CREATE_BENDS_AS_NEEDED;return n&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},M.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(o.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(I){return E.has(I)});this.graphManager.setAllNodesToApplyGravitation(p)}}else{var n=this.getFlatForest();if(n.length>0)this.positionNodesRadially(n);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(m){return E.has(m)});this.graphManager.setAllNodesToApplyGravitation(p),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(c.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),o.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},M.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%l.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var n=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(y){return n.has(y)});this.graphManager.setAllNodesToApplyGravitation(E),this.graphManager.updateBounds(),this.updateGrid(),o.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),o.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var p=!this.isTreeGrowing&&!this.isGrowthFinished,m=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(p,m),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},M.prototype.getPositionsData=function(){for(var n=this.graphManager.getAllNodes(),E={},p=0;p0&&this.updateDisplacements();for(var p=0;p0&&(m.fixedNodeWeight=I)}}if(this.constraints.relativePlacementConstraint){var O=new Map,R=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(D){n.fixedNodesOnHorizontal.add(D),n.fixedNodesOnVertical.add(D)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var W=this.constraints.alignmentConstraint.vertical,p=0;p=2*D.length/3;tt--)H=Math.floor(Math.random()*(tt+1)),k=D[tt],D[tt]=D[H],D[H]=k;return D},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(D){if(D.left){var H=O.has(D.left)?O.get(D.left):D.left,k=O.has(D.right)?O.get(D.right):D.right;n.nodesInRelativeHorizontal.includes(H)||(n.nodesInRelativeHorizontal.push(H),n.nodeToRelativeConstraintMapHorizontal.set(H,[]),n.dummyToNodeForVerticalAlignment.has(H)?n.nodeToTempPositionMapHorizontal.set(H,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(H)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(H,n.idToNodeMap.get(H).getCenterX())),n.nodesInRelativeHorizontal.includes(k)||(n.nodesInRelativeHorizontal.push(k),n.nodeToRelativeConstraintMapHorizontal.set(k,[]),n.dummyToNodeForVerticalAlignment.has(k)?n.nodeToTempPositionMapHorizontal.set(k,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(k)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(k,n.idToNodeMap.get(k).getCenterX())),n.nodeToRelativeConstraintMapHorizontal.get(H).push({right:k,gap:D.gap}),n.nodeToRelativeConstraintMapHorizontal.get(k).push({left:H,gap:D.gap})}else{var tt=R.has(D.top)?R.get(D.top):D.top,ht=R.has(D.bottom)?R.get(D.bottom):D.bottom;n.nodesInRelativeVertical.includes(tt)||(n.nodesInRelativeVertical.push(tt),n.nodeToRelativeConstraintMapVertical.set(tt,[]),n.dummyToNodeForHorizontalAlignment.has(tt)?n.nodeToTempPositionMapVertical.set(tt,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(tt)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(tt,n.idToNodeMap.get(tt).getCenterY())),n.nodesInRelativeVertical.includes(ht)||(n.nodesInRelativeVertical.push(ht),n.nodeToRelativeConstraintMapVertical.set(ht,[]),n.dummyToNodeForHorizontalAlignment.has(ht)?n.nodeToTempPositionMapVertical.set(ht,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(ht)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(ht,n.idToNodeMap.get(ht).getCenterY())),n.nodeToRelativeConstraintMapVertical.get(tt).push({bottom:ht,gap:D.gap}),n.nodeToRelativeConstraintMapVertical.get(ht).push({top:tt,gap:D.gap})}});else{var Q=new Map,z=new Map;this.constraints.relativePlacementConstraint.forEach(function(D){if(D.left){var H=O.has(D.left)?O.get(D.left):D.left,k=O.has(D.right)?O.get(D.right):D.right;Q.has(H)?Q.get(H).push(k):Q.set(H,[k]),Q.has(k)?Q.get(k).push(H):Q.set(k,[H])}else{var tt=R.has(D.top)?R.get(D.top):D.top,ht=R.has(D.bottom)?R.get(D.bottom):D.bottom;z.has(tt)?z.get(tt).push(ht):z.set(tt,[ht]),z.has(ht)?z.get(ht).push(tt):z.set(ht,[tt])}});var X=function(H,k){var tt=[],ht=[],J=new V,It=new Set,Nt=0;return H.forEach(function(vt,it){if(!It.has(it)){tt[Nt]=[],ht[Nt]=!1;var ut=it;for(J.push(ut),It.add(ut),tt[Nt].push(ut);J.length!=0;){ut=J.shift(),k.has(ut)&&(ht[Nt]=!0);var Et=H.get(ut);Et.forEach(function(wt){It.has(wt)||(J.push(wt),It.add(wt),tt[Nt].push(wt))})}Nt++}}),{components:tt,isFixed:ht}},rt=X(Q,n.fixedNodesOnHorizontal);this.componentsOnHorizontal=rt.components,this.fixedComponentsOnHorizontal=rt.isFixed;var $=X(z,n.fixedNodesOnVertical);this.componentsOnVertical=$.components,this.fixedComponentsOnVertical=$.isFixed}}},M.prototype.updateDisplacements=function(){var n=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function($){var D=n.idToNodeMap.get($.nodeId);D.displacementX=0,D.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var E=this.constraints.alignmentConstraint.vertical,p=0;p1){var R;for(R=0;Rm&&(m=Math.floor(O.y)),I=Math.floor(O.x+o.DEFAULT_COMPONENT_SEPERATION)}this.transform(new d(T.WORLD_CENTER_X-O.x/2,T.WORLD_CENTER_Y-O.y/2))},M.radialLayout=function(n,E,p){var m=Math.max(this.maxDiagonalInTree(n),o.DEFAULT_RADIAL_SEPARATION);M.branchRadialLayout(E,null,0,359,0,m);var y=B.calculateBounds(n),I=new U;I.setDeviceOrgX(y.getMinX()),I.setDeviceOrgY(y.getMinY()),I.setWorldOrgX(p.x),I.setWorldOrgY(p.y);for(var O=0;O1;){var k=H[0];H.splice(0,1);var tt=z.indexOf(k);tt>=0&&z.splice(tt,1),$--,X--}E!=null?D=(z.indexOf(H[0])+1)%$:D=0;for(var ht=Math.abs(m-p)/X,J=D;rt!=X;J=++J%$){var It=z[J].getOtherEnd(n);if(It!=E){var Nt=(p+rt*ht)%360,vt=(Nt+ht)%360;M.branchRadialLayout(It,n,Nt,vt,y+I,I),rt++}}},M.maxDiagonalInTree=function(n){for(var E=w.MIN_VALUE,p=0;pE&&(E=y)}return E},M.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},M.prototype.groupZeroDegreeMembers=function(){var n=this,E={};this.memberGroups={},this.idToDummyNode={};for(var p=[],m=this.graphManager.getAllNodes(),y=0;y"u"&&(E[R]=[]),E[R]=E[R].concat(I)}Object.keys(E).forEach(function(W){if(E[W].length>1){var x="DummyCompound_"+W;n.memberGroups[x]=E[W];var Q=E[W][0].getParent(),z=new t(n.graphManager);z.id=x,z.paddingLeft=Q.paddingLeft||0,z.paddingRight=Q.paddingRight||0,z.paddingBottom=Q.paddingBottom||0,z.paddingTop=Q.paddingTop||0,n.idToDummyNode[x]=z;var X=n.getGraphManager().add(n.newGraph(),z),rt=Q.getChild();rt.add(z);for(var $=0;$y?(m.rect.x-=(m.labelWidth-y)/2,m.setWidth(m.labelWidth),m.labelMarginLeft=(m.labelWidth-y)/2):m.labelPosHorizontal=="right"&&m.setWidth(y+m.labelWidth)),m.labelHeight&&(m.labelPosVertical=="top"?(m.rect.y-=m.labelHeight,m.setHeight(I+m.labelHeight),m.labelMarginTop=m.labelHeight):m.labelPosVertical=="center"&&m.labelHeight>I?(m.rect.y-=(m.labelHeight-I)/2,m.setHeight(m.labelHeight),m.labelMarginTop=(m.labelHeight-I)/2):m.labelPosVertical=="bottom"&&m.setHeight(I+m.labelHeight))}})},M.prototype.repopulateCompounds=function(){for(var n=this.compoundOrder.length-1;n>=0;n--){var E=this.compoundOrder[n],p=E.id,m=E.paddingLeft,y=E.paddingTop,I=E.labelMarginLeft,O=E.labelMarginTop;this.adjustLocations(this.tiledMemberPack[p],E.rect.x,E.rect.y,m,y,I,O)}},M.prototype.repopulateZeroDegreeMembers=function(){var n=this,E=this.tiledZeroDegreePack;Object.keys(E).forEach(function(p){var m=n.idToDummyNode[p],y=m.paddingLeft,I=m.paddingTop,O=m.labelMarginLeft,R=m.labelMarginTop;n.adjustLocations(E[p],m.rect.x,m.rect.y,y,I,O,R)})},M.prototype.getToBeTiled=function(n){var E=n.id;if(this.toBeTiled[E]!=null)return this.toBeTiled[E];var p=n.getChild();if(p==null)return this.toBeTiled[E]=!1,!1;for(var m=p.getNodes(),y=0;y0)return this.toBeTiled[E]=!1,!1;if(I.getChild()==null){this.toBeTiled[I.id]=!1;continue}if(!this.getToBeTiled(I))return this.toBeTiled[E]=!1,!1}return this.toBeTiled[E]=!0,!0},M.prototype.getNodeDegree=function(n){n.id;for(var E=n.getEdges(),p=0,m=0;mQ&&(Q=X.rect.height)}p+=Q+n.verticalPadding}},M.prototype.tileCompoundMembers=function(n,E){var p=this;this.tiledMemberPack=[],Object.keys(n).forEach(function(m){var y=E[m];if(p.tiledMemberPack[m]=p.tileNodes(n[m],y.paddingLeft+y.paddingRight),y.rect.width=p.tiledMemberPack[m].width,y.rect.height=p.tiledMemberPack[m].height,y.setCenter(p.tiledMemberPack[m].centerX,p.tiledMemberPack[m].centerY),y.labelMarginLeft=0,y.labelMarginTop=0,o.NODE_DIMENSIONS_INCLUDE_LABELS){var I=y.rect.width,O=y.rect.height;y.labelWidth&&(y.labelPosHorizontal=="left"?(y.rect.x-=y.labelWidth,y.setWidth(I+y.labelWidth),y.labelMarginLeft=y.labelWidth):y.labelPosHorizontal=="center"&&y.labelWidth>I?(y.rect.x-=(y.labelWidth-I)/2,y.setWidth(y.labelWidth),y.labelMarginLeft=(y.labelWidth-I)/2):y.labelPosHorizontal=="right"&&y.setWidth(I+y.labelWidth)),y.labelHeight&&(y.labelPosVertical=="top"?(y.rect.y-=y.labelHeight,y.setHeight(O+y.labelHeight),y.labelMarginTop=y.labelHeight):y.labelPosVertical=="center"&&y.labelHeight>O?(y.rect.y-=(y.labelHeight-O)/2,y.setHeight(y.labelHeight),y.labelMarginTop=(y.labelHeight-O)/2):y.labelPosVertical=="bottom"&&y.setHeight(O+y.labelHeight))}})},M.prototype.tileNodes=function(n,E){var p=this.tileNodesByFavoringDim(n,E,!0),m=this.tileNodesByFavoringDim(n,E,!1),y=this.getOrgRatio(p),I=this.getOrgRatio(m),O;return IR&&(R=$.getWidth())});var W=I/y,x=O/y,Q=Math.pow(p-m,2)+4*(W+m)*(x+p)*y,z=(m-p+Math.sqrt(Q))/(2*(W+m)),X;E?(X=Math.ceil(z),X==z&&X++):X=Math.floor(z);var rt=X*(W+m)-m;return R>rt&&(rt=R),rt+=m*2,rt},M.prototype.tileNodesByFavoringDim=function(n,E,p){var m=o.TILING_PADDING_VERTICAL,y=o.TILING_PADDING_HORIZONTAL,I=o.TILING_COMPARE_BY,O={rows:[],rowWidth:[],rowHeight:[],width:0,height:E,verticalPadding:m,horizontalPadding:y,centerX:0,centerY:0};I&&(O.idealRowWidth=this.calcIdealRowWidth(n,p));var R=function(D){return D.rect.width*D.rect.height},W=function(D,H){return R(H)-R(D)};n.sort(function($,D){var H=W;return O.idealRowWidth?(H=I,H($.id,D.id)):H($,D)});for(var x=0,Q=0,z=0;z0&&(O+=n.horizontalPadding),n.rowWidth[p]=O,n.width0&&(R+=n.verticalPadding);var W=0;R>n.rowHeight[p]&&(W=n.rowHeight[p],n.rowHeight[p]=R,W=n.rowHeight[p]-W),n.height+=W,n.rows[p].push(E)},M.prototype.getShortestRowIndex=function(n){for(var E=-1,p=Number.MAX_VALUE,m=0;mp&&(E=m,p=n.rowWidth[m]);return E},M.prototype.canAddHorizontal=function(n,E,p){if(n.idealRowWidth){var m=n.rows.length-1,y=n.rowWidth[m];return y+E+n.horizontalPadding<=n.idealRowWidth}var I=this.getShortestRowIndex(n);if(I<0)return!0;var O=n.rowWidth[I];if(O+n.horizontalPadding+E<=n.width)return!0;var R=0;n.rowHeight[I]0&&(R=p+n.verticalPadding-n.rowHeight[I]);var W;n.width-O>=E+n.horizontalPadding?W=(n.height+R)/(O+E+n.horizontalPadding):W=(n.height+R)/n.width,R=p+n.verticalPadding;var x;return n.widthI&&E!=p){m.splice(-1,1),n.rows[p].push(y),n.rowWidth[E]=n.rowWidth[E]-I,n.rowWidth[p]=n.rowWidth[p]+I,n.width=n.rowWidth[instance.getLongestRowIndex(n)];for(var O=Number.MIN_VALUE,R=0;RO&&(O=m[R].height);E>0&&(O+=n.verticalPadding);var W=n.rowHeight[E]+n.rowHeight[p];n.rowHeight[E]=O,n.rowHeight[p]0)for(var rt=y;rt<=I;rt++)X[0]+=this.grid[rt][O-1].length+this.grid[rt][O].length-1;if(I0)for(var rt=O;rt<=R;rt++)X[3]+=this.grid[y-1][rt].length+this.grid[y][rt].length-1;for(var $=w.MAX_VALUE,D,H,k=0;k{var f=a(551).FDLayoutNode,e=a(551).IMath;function u(s,o,c,l){f.call(this,s,o,c,l)}u.prototype=Object.create(f.prototype);for(var t in f)u[t]=f[t];u.prototype.calculateDisplacement=function(){var s=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementX=s.coolingFactor*s.maxNodeDisplacement*e.sign(this.displacementX)),Math.abs(this.displacementY)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementY=s.coolingFactor*s.maxNodeDisplacement*e.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},u.prototype.propogateDisplacementToChildren=function(s,o){for(var c=this.getChild().getNodes(),l,T=0;T{function f(c){if(Array.isArray(c)){for(var l=0,T=Array(c.length);l0){var Lt=0;ot.forEach(function(st){Z=="horizontal"?(et.set(st,g.has(st)?d[g.get(st)]:q.get(st)),Lt+=et.get(st)):(et.set(st,g.has(st)?C[g.get(st)]:q.get(st)),Lt+=et.get(st))}),Lt=Lt/ot.length,lt.forEach(function(st){K.has(st)||et.set(st,Lt)})}else{var ft=0;lt.forEach(function(st){Z=="horizontal"?ft+=g.has(st)?d[g.get(st)]:q.get(st):ft+=g.has(st)?C[g.get(st)]:q.get(st)}),ft=ft/lt.length,lt.forEach(function(st){et.set(st,ft)})}});for(var At=function(){var ot=dt.shift(),Lt=Y.get(ot);Lt.forEach(function(ft){if(et.get(ft.id)st&&(st=kt),KtXt&&(Xt=Kt)}}catch(ee){Ct=!0,Bt=ee}finally{try{!Tt&&bt.return&&bt.return()}finally{if(Ct)throw Bt}}var fe=(Lt+st)/2-(ft+Xt)/2,Qt=!0,jt=!1,_t=void 0;try{for(var Jt=lt[Symbol.iterator](),ne;!(Qt=(ne=Jt.next()).done);Qt=!0){var te=ne.value;et.set(te,et.get(te)+fe)}}catch(ee){jt=!0,_t=ee}finally{try{!Qt&&Jt.return&&Jt.return()}finally{if(jt)throw _t}}})}return et},_=function(Y){var Z=0,K=0,q=0,at=0;if(Y.forEach(function(j){j.left?d[g.get(j.left)]-d[g.get(j.right)]>=0?Z++:K++:C[g.get(j.top)]-C[g.get(j.bottom)]>=0?q++:at++}),Z>K&&q>at)for(var ct=0;ctK)for(var nt=0;ntat)for(var et=0;et1)l.fixedNodeConstraint.forEach(function(F,Y){m[Y]=[F.position.x,F.position.y],y[Y]=[d[g.get(F.nodeId)],C[g.get(F.nodeId)]]}),I=!0;else if(l.alignmentConstraint)(function(){var F=0;if(l.alignmentConstraint.vertical){for(var Y=l.alignmentConstraint.vertical,Z=function(et){var j=new Set;Y[et].forEach(function(pt){j.add(pt)});var dt=new Set([].concat(f(j)).filter(function(pt){return R.has(pt)})),At=void 0;dt.size>0?At=d[g.get(dt.values().next().value)]:At=V(j).x,Y[et].forEach(function(pt){m[F]=[At,C[g.get(pt)]],y[F]=[d[g.get(pt)],C[g.get(pt)]],F++})},K=0;K0?At=d[g.get(dt.values().next().value)]:At=V(j).y,q[et].forEach(function(pt){m[F]=[d[g.get(pt)],At],y[F]=[d[g.get(pt)],C[g.get(pt)]],F++})},ct=0;ctz&&(z=Q[rt].length,X=rt);if(z0){var mt={x:0,y:0};l.fixedNodeConstraint.forEach(function(F,Y){var Z={x:d[g.get(F.nodeId)],y:C[g.get(F.nodeId)]},K=F.position,q=U(K,Z);mt.x+=q.x,mt.y+=q.y}),mt.x/=l.fixedNodeConstraint.length,mt.y/=l.fixedNodeConstraint.length,d.forEach(function(F,Y){d[Y]+=mt.x}),C.forEach(function(F,Y){C[Y]+=mt.y}),l.fixedNodeConstraint.forEach(function(F){d[g.get(F.nodeId)]=F.position.x,C[g.get(F.nodeId)]=F.position.y})}if(l.alignmentConstraint){if(l.alignmentConstraint.vertical)for(var Dt=l.alignmentConstraint.vertical,Rt=function(Y){var Z=new Set;Dt[Y].forEach(function(at){Z.add(at)});var K=new Set([].concat(f(Z)).filter(function(at){return R.has(at)})),q=void 0;K.size>0?q=d[g.get(K.values().next().value)]:q=V(Z).x,Z.forEach(function(at){R.has(at)||(d[g.get(at)]=q)})},Ht=0;Ht0?q=C[g.get(K.values().next().value)]:q=V(Z).y,Z.forEach(function(at){R.has(at)||(C[g.get(at)]=q)})},Ft=0;Ft{i.exports=A})},N={};function v(i){var r=N[i];if(r!==void 0)return r.exports;var a=N[i]={exports:{}};return G[i](a,a.exports,v),a.exports}var h=v(45);return h})()})})(he)),he.exports}var pr=se.exports,De;function yr(){return De||(De=1,(function(L,b){(function(G,N){L.exports=N(vr())})(pr,function(A){return(()=>{var G={658:(i=>{i.exports=Object.assign!=null?Object.assign.bind(Object):function(r){for(var a=arguments.length,f=Array(a>1?a-1:0),e=1;e{var f=(function(){function t(s,o){var c=[],l=!0,T=!1,g=void 0;try{for(var d=s[Symbol.iterator](),C;!(l=(C=d.next()).done)&&(c.push(C.value),!(o&&c.length===o));l=!0);}catch(S){T=!0,g=S}finally{try{!l&&d.return&&d.return()}finally{if(T)throw g}}return c}return function(s,o){if(Array.isArray(s))return s;if(Symbol.iterator in Object(s))return t(s,o);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),e=a(140).layoutBase.LinkedList,u={};u.getTopMostNodes=function(t){for(var s={},o=0;o0&&I.merge(x)});for(var O=0;O1){C=g[0],S=C.connectedEdges().length,g.forEach(function(y){y.connectedEdges().length0&&c.set("dummy"+(c.size+1),B),U},u.relocateComponent=function(t,s,o){if(!o.fixedNodeConstraint){var c=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY;if(o.quality=="draft"){var d=!0,C=!1,S=void 0;try{for(var w=s.nodeIndexes[Symbol.iterator](),P;!(d=(P=w.next()).done);d=!0){var B=P.value,U=f(B,2),V=U[0],M=U[1],_=o.cy.getElementById(V);if(_){var n=_.boundingBox(),E=s.xCoords[M]-n.w/2,p=s.xCoords[M]+n.w/2,m=s.yCoords[M]-n.h/2,y=s.yCoords[M]+n.h/2;El&&(l=p),mg&&(g=y)}}}catch(x){C=!0,S=x}finally{try{!d&&w.return&&w.return()}finally{if(C)throw S}}var I=t.x-(l+c)/2,O=t.y-(g+T)/2;s.xCoords=s.xCoords.map(function(x){return x+I}),s.yCoords=s.yCoords.map(function(x){return x+O})}else{Object.keys(s).forEach(function(x){var Q=s[x],z=Q.getRect().x,X=Q.getRect().x+Q.getRect().width,rt=Q.getRect().y,$=Q.getRect().y+Q.getRect().height;zl&&(l=X),rtg&&(g=$)});var R=t.x-(l+c)/2,W=t.y-(g+T)/2;Object.keys(s).forEach(function(x){var Q=s[x];Q.setCenter(Q.getCenterX()+R,Q.getCenterY()+W)})}}},u.calcBoundingBox=function(t,s,o,c){for(var l=Number.MAX_SAFE_INTEGER,T=Number.MIN_SAFE_INTEGER,g=Number.MAX_SAFE_INTEGER,d=Number.MIN_SAFE_INTEGER,C=void 0,S=void 0,w=void 0,P=void 0,B=t.descendants().not(":parent"),U=B.length,V=0;VC&&(l=C),Tw&&(g=w),d{var f=a(548),e=a(140).CoSELayout,u=a(140).CoSENode,t=a(140).layoutBase.PointD,s=a(140).layoutBase.DimensionD,o=a(140).layoutBase.LayoutConstants,c=a(140).layoutBase.FDLayoutConstants,l=a(140).CoSEConstants,T=function(d,C){var S=d.cy,w=d.eles,P=w.nodes(),B=w.edges(),U=void 0,V=void 0,M=void 0,_={};d.randomize&&(U=C.nodeIndexes,V=C.xCoords,M=C.yCoords);var n=function(x){return typeof x=="function"},E=function(x,Q){return n(x)?x(Q):x},p=f.calcParentsWithoutChildren(S,w),m=function W(x,Q,z,X){for(var rt=Q.length,$=0;$0){var J=void 0;J=z.getGraphManager().add(z.newGraph(),k),W(J,H,z,X)}}},y=function(x,Q,z){for(var X=0,rt=0,$=0;$0?l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=X/rt:n(d.idealEdgeLength)?l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=50:l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=d.idealEdgeLength,l.MIN_REPULSION_DIST=c.MIN_REPULSION_DIST=c.DEFAULT_EDGE_LENGTH/10,l.DEFAULT_RADIAL_SEPARATION=c.DEFAULT_EDGE_LENGTH)},I=function(x,Q){Q.fixedNodeConstraint&&(x.constraints.fixedNodeConstraint=Q.fixedNodeConstraint),Q.alignmentConstraint&&(x.constraints.alignmentConstraint=Q.alignmentConstraint),Q.relativePlacementConstraint&&(x.constraints.relativePlacementConstraint=Q.relativePlacementConstraint)};d.nestingFactor!=null&&(l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=d.nestingFactor),d.gravity!=null&&(l.DEFAULT_GRAVITY_STRENGTH=c.DEFAULT_GRAVITY_STRENGTH=d.gravity),d.numIter!=null&&(l.MAX_ITERATIONS=c.MAX_ITERATIONS=d.numIter),d.gravityRange!=null&&(l.DEFAULT_GRAVITY_RANGE_FACTOR=c.DEFAULT_GRAVITY_RANGE_FACTOR=d.gravityRange),d.gravityCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=d.gravityCompound),d.gravityRangeCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=d.gravityRangeCompound),d.initialEnergyOnIncremental!=null&&(l.DEFAULT_COOLING_FACTOR_INCREMENTAL=c.DEFAULT_COOLING_FACTOR_INCREMENTAL=d.initialEnergyOnIncremental),d.tilingCompareBy!=null&&(l.TILING_COMPARE_BY=d.tilingCompareBy),d.quality=="proof"?o.QUALITY=2:o.QUALITY=0,l.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=o.NODE_DIMENSIONS_INCLUDE_LABELS=d.nodeDimensionsIncludeLabels,l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!d.randomize,l.ANIMATE=c.ANIMATE=o.ANIMATE=d.animate,l.TILE=d.tile,l.TILING_PADDING_VERTICAL=typeof d.tilingPaddingVertical=="function"?d.tilingPaddingVertical.call():d.tilingPaddingVertical,l.TILING_PADDING_HORIZONTAL=typeof d.tilingPaddingHorizontal=="function"?d.tilingPaddingHorizontal.call():d.tilingPaddingHorizontal,l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!0,l.PURE_INCREMENTAL=!d.randomize,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=d.uniformNodeDimensions,d.step=="transformed"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!1),d.step=="enforced"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!1),d.step=="cose"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!0),d.step=="all"&&(d.randomize?l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!0),d.fixedNodeConstraint||d.alignmentConstraint||d.relativePlacementConstraint?l.TREE_REDUCTION_ON_INCREMENTAL=!1:l.TREE_REDUCTION_ON_INCREMENTAL=!0;var O=new e,R=O.newGraphManager();return m(R.addRoot(),f.getTopMostNodes(P),O,d),y(O,R,B),I(O,d),O.runLayout(),_};i.exports={coseLayout:T}}),212:((i,r,a)=>{var f=(function(){function d(C,S){for(var w=0;w0)if(p){var I=t.getTopMostNodes(w.eles.nodes());if(M=t.connectComponents(P,w.eles,I),M.forEach(function(vt){var it=vt.boundingBox();_.push({x:it.x1+it.w/2,y:it.y1+it.h/2})}),w.randomize&&M.forEach(function(vt){w.eles=vt,U.push(o(w))}),w.quality=="default"||w.quality=="proof"){var O=P.collection();if(w.tile){var R=new Map,W=[],x=[],Q=0,z={nodeIndexes:R,xCoords:W,yCoords:x},X=[];if(M.forEach(function(vt,it){vt.edges().length==0&&(vt.nodes().forEach(function(ut,Et){O.merge(vt.nodes()[Et]),ut.isParent()||(z.nodeIndexes.set(vt.nodes()[Et].id(),Q++),z.xCoords.push(vt.nodes()[0].position().x),z.yCoords.push(vt.nodes()[0].position().y))}),X.push(it))}),O.length>1){var rt=O.boundingBox();_.push({x:rt.x1+rt.w/2,y:rt.y1+rt.h/2}),M.push(O),U.push(z);for(var $=X.length-1;$>=0;$--)M.splice(X[$],1),U.splice(X[$],1),_.splice(X[$],1)}}M.forEach(function(vt,it){w.eles=vt,V.push(l(w,U[it])),t.relocateComponent(_[it],V[it],w)})}else M.forEach(function(vt,it){t.relocateComponent(_[it],U[it],w)});var D=new Set;if(M.length>1){var H=[],k=B.filter(function(vt){return vt.css("display")=="none"});M.forEach(function(vt,it){var ut=void 0;if(w.quality=="draft"&&(ut=U[it].nodeIndexes),vt.nodes().not(k).length>0){var Et={};Et.edges=[],Et.nodes=[];var wt=void 0;vt.nodes().not(k).forEach(function(Ot){if(w.quality=="draft")if(!Ot.isParent())wt=ut.get(Ot.id()),Et.nodes.push({x:U[it].xCoords[wt]-Ot.boundingbox().w/2,y:U[it].yCoords[wt]-Ot.boundingbox().h/2,width:Ot.boundingbox().w,height:Ot.boundingbox().h});else{var mt=t.calcBoundingBox(Ot,U[it].xCoords,U[it].yCoords,ut);Et.nodes.push({x:mt.topLeftX,y:mt.topLeftY,width:mt.width,height:mt.height})}else V[it][Ot.id()]&&Et.nodes.push({x:V[it][Ot.id()].getLeft(),y:V[it][Ot.id()].getTop(),width:V[it][Ot.id()].getWidth(),height:V[it][Ot.id()].getHeight()})}),vt.edges().forEach(function(Ot){var mt=Ot.source(),Dt=Ot.target();if(mt.css("display")!="none"&&Dt.css("display")!="none")if(w.quality=="draft"){var Rt=ut.get(mt.id()),Ht=ut.get(Dt.id()),Ut=[],Pt=[];if(mt.isParent()){var Ft=t.calcBoundingBox(mt,U[it].xCoords,U[it].yCoords,ut);Ut.push(Ft.topLeftX+Ft.width/2),Ut.push(Ft.topLeftY+Ft.height/2)}else Ut.push(U[it].xCoords[Rt]),Ut.push(U[it].yCoords[Rt]);if(Dt.isParent()){var Yt=t.calcBoundingBox(Dt,U[it].xCoords,U[it].yCoords,ut);Pt.push(Yt.topLeftX+Yt.width/2),Pt.push(Yt.topLeftY+Yt.height/2)}else Pt.push(U[it].xCoords[Ht]),Pt.push(U[it].yCoords[Ht]);Et.edges.push({startX:Ut[0],startY:Ut[1],endX:Pt[0],endY:Pt[1]})}else V[it][mt.id()]&&V[it][Dt.id()]&&Et.edges.push({startX:V[it][mt.id()].getCenterX(),startY:V[it][mt.id()].getCenterY(),endX:V[it][Dt.id()].getCenterX(),endY:V[it][Dt.id()].getCenterY()})}),Et.nodes.length>0&&(H.push(Et),D.add(it))}});var tt=E.packComponents(H,w.randomize).shifts;if(w.quality=="draft")U.forEach(function(vt,it){var ut=vt.xCoords.map(function(wt){return wt+tt[it].dx}),Et=vt.yCoords.map(function(wt){return wt+tt[it].dy});vt.xCoords=ut,vt.yCoords=Et});else{var ht=0;D.forEach(function(vt){Object.keys(V[vt]).forEach(function(it){var ut=V[vt][it];ut.setCenter(ut.getCenterX()+tt[ht].dx,ut.getCenterY()+tt[ht].dy)}),ht++})}}}else{var m=w.eles.boundingBox();if(_.push({x:m.x1+m.w/2,y:m.y1+m.h/2}),w.randomize){var y=o(w);U.push(y)}w.quality=="default"||w.quality=="proof"?(V.push(l(w,U[0])),t.relocateComponent(_[0],V[0],w)):t.relocateComponent(_[0],U[0],w)}var J=function(it,ut){if(w.quality=="default"||w.quality=="proof"){typeof it=="number"&&(it=ut);var Et=void 0,wt=void 0,Ot=it.data("id");return V.forEach(function(Dt){Ot in Dt&&(Et={x:Dt[Ot].getRect().getCenterX(),y:Dt[Ot].getRect().getCenterY()},wt=Dt[Ot])}),w.nodeDimensionsIncludeLabels&&(wt.labelWidth&&(wt.labelPosHorizontal=="left"?Et.x+=wt.labelWidth/2:wt.labelPosHorizontal=="right"&&(Et.x-=wt.labelWidth/2)),wt.labelHeight&&(wt.labelPosVertical=="top"?Et.y+=wt.labelHeight/2:wt.labelPosVertical=="bottom"&&(Et.y-=wt.labelHeight/2))),Et==null&&(Et={x:it.position("x"),y:it.position("y")}),{x:Et.x,y:Et.y}}else{var mt=void 0;return U.forEach(function(Dt){var Rt=Dt.nodeIndexes.get(it.id());Rt!=null&&(mt={x:Dt.xCoords[Rt],y:Dt.yCoords[Rt]})}),mt==null&&(mt={x:it.position("x"),y:it.position("y")}),{x:mt.x,y:mt.y}}};if(w.quality=="default"||w.quality=="proof"||w.randomize){var It=t.calcParentsWithoutChildren(P,B),Nt=B.filter(function(vt){return vt.css("display")=="none"});w.eles=B.not(Nt),B.nodes().not(":parent").not(Nt).layoutPositions(S,w,J),It.length>0&&It.forEach(function(vt){vt.position(J(vt))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),d})();i.exports=g}),657:((i,r,a)=>{var f=a(548),e=a(140).layoutBase.Matrix,u=a(140).layoutBase.SVD,t=function(o){var c=o.cy,l=o.eles,T=l.nodes(),g=l.nodes(":parent"),d=new Map,C=new Map,S=new Map,w=[],P=[],B=[],U=[],V=[],M=[],_=[],n=[],E=void 0,p=1e8,m=1e-9,y=o.piTol,I=o.samplingType,O=o.nodeSeparation,R=void 0,W=function(){for(var Y=0,Z=0,K=!1;Z=at;){nt=q[at++];for(var xt=w[nt],lt=0;ltdt&&(dt=V[Lt],At=Lt)}return At},Q=function(Y){var Z=void 0;if(Y){Z=Math.floor(Math.random()*E);for(var q=0;q=1)break;j=et}for(var pt=0;pt=1)break;j=et}for(var lt=0;lt0&&(Z.isParent()?w[Y].push(S.get(Z.id())):w[Y].push(Z.id()))})});var Nt=function(Y){var Z=C.get(Y),K=void 0;d.get(Y).forEach(function(q){c.getElementById(q).isParent()?K=S.get(q):K=q,w[Z].push(K),w[C.get(K)].push(Y)})},vt=!0,it=!1,ut=void 0;try{for(var Et=d.keys()[Symbol.iterator](),wt;!(vt=(wt=Et.next()).done);vt=!0){var Ot=wt.value;Nt(Ot)}}catch(F){it=!0,ut=F}finally{try{!vt&&Et.return&&Et.return()}finally{if(it)throw ut}}E=C.size;var mt=void 0;if(E>2){R=E{var f=a(212),e=function(t){t&&t("layout","fcose",f)};typeof cytoscape<"u"&&e(cytoscape),i.exports=e}),140:(i=>{i.exports=A})},N={};function v(i){var r=N[i];if(r!==void 0)return r.exports;var a=N[i]={exports:{}};return G[i](a,a.exports,v),a.exports}var h=v(579);return h})()})})(se)),se.exports}var mr=yr();const Er=cr(mr);var xe={L:"left",R:"right",T:"top",B:"bottom"},Ie={L:gt(L=>`${L},${L/2} 0,${L} 0,0`,"L"),R:gt(L=>`0,${L/2} ${L},0 ${L},${L}`,"R"),T:gt(L=>`0,0 ${L},0 ${L/2},${L}`,"T"),B:gt(L=>`${L/2},0 ${L},${L} 0,${L}`,"B")},oe={L:gt((L,b)=>L-b+2,"L"),R:gt((L,b)=>L-2,"R"),T:gt((L,b)=>L-b+2,"T"),B:gt((L,b)=>L-2,"B")},Tr=gt(function(L){return Wt(L)?L==="L"?"R":"L":L==="T"?"B":"T"},"getOppositeArchitectureDirection"),Re=gt(function(L){const b=L;return b==="L"||b==="R"||b==="T"||b==="B"},"isArchitectureDirection"),Wt=gt(function(L){const b=L;return b==="L"||b==="R"},"isArchitectureDirectionX"),qt=gt(function(L){const b=L;return b==="T"||b==="B"},"isArchitectureDirectionY"),Te=gt(function(L,b){const A=Wt(L)&&qt(b),G=qt(L)&&Wt(b);return A||G},"isArchitectureDirectionXY"),Nr=gt(function(L){const b=L[0],A=L[1],G=Wt(b)&&qt(A),N=qt(b)&&Wt(A);return G||N},"isArchitecturePairXY"),Lr=gt(function(L){return L!=="LL"&&L!=="RR"&&L!=="TT"&&L!=="BB"},"isValidArchitectureDirectionPair"),pe=gt(function(L,b){const A=`${L}${b}`;return Lr(A)?A:void 0},"getArchitectureDirectionPair"),Cr=gt(function([L,b],A){const G=A[0],N=A[1];return Wt(G)?qt(N)?[L+(G==="L"?-1:1),b+(N==="T"?1:-1)]:[L+(G==="L"?-1:1),b]:Wt(N)?[L+(N==="L"?1:-1),b+(G==="T"?1:-1)]:[L,b+(G==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),wr=gt(function(L){return L==="LT"||L==="TL"?[1,1]:L==="BL"||L==="LB"?[1,-1]:L==="BR"||L==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),Ar=gt(function(L,b){return Te(L,b)?"bend":Wt(L)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Mr=gt(function(L){return L.type==="service"},"isArchitectureService"),Or=gt(function(L){return L.type==="junction"},"isArchitectureJunction"),be=gt(L=>L.data(),"edgeData"),ie=gt(L=>L.data(),"nodeData"),Dr=ar.architecture,Pe=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.layoutHints=[],this.registeredIds={},this.elements={},this.diagramId="",this.setAccTitle=Qe,this.getAccTitle=Je,this.setDiagramTitle=Ke,this.getDiagramTitle=je,this.getAccDescription=_e,this.setAccDescription=tr,this.clear()}static{gt(this,"ArchitectureDB")}setDiagramId(L){this.diagramId=L}getDiagramId(){return this.diagramId}clear(){this.nodes={},this.groups={},this.edges=[],this.layoutHints=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},this.diagramId="",er()}addService({id:L,icon:b,in:A,title:G,iconText:N}){if(this.registeredIds[L]!==void 0)throw new Error(`The service id [${L}] is already in use by another ${this.registeredIds[L]}`);if(A!==void 0){if(L===A)throw new Error(`The service [${L}] cannot be placed within itself`);if(this.registeredIds[A]===void 0)throw new Error(`The service [${L}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[A]==="node")throw new Error(`The service [${L}]'s parent is not a group`)}this.registeredIds[L]="node",this.nodes[L]={id:L,type:"service",icon:b,iconText:N,title:G,edges:[],in:A}}getServices(){return Object.values(this.nodes).filter(Mr)}addJunction({id:L,in:b}){if(this.registeredIds[L]!==void 0)throw new Error(`The junction id [${L}] is already in use by another ${this.registeredIds[L]}`);if(b!==void 0){if(L===b)throw new Error(`The junction [${L}] cannot be placed within itself`);if(this.registeredIds[b]===void 0)throw new Error(`The junction [${L}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds[b]==="node")throw new Error(`The junction [${L}]'s parent is not a group`)}this.registeredIds[L]="node",this.nodes[L]={id:L,type:"junction",edges:[],in:b}}getJunctions(){return Object.values(this.nodes).filter(Or)}getNodes(){return Object.values(this.nodes)}getNode(L){return this.nodes[L]??null}addGroup({id:L,icon:b,in:A,title:G}){if(this.registeredIds?.[L]!==void 0)throw new Error(`The group id [${L}] is already in use by another ${this.registeredIds[L]}`);if(A!==void 0){if(L===A)throw new Error(`The group [${L}] cannot be placed within itself`);if(this.registeredIds?.[A]===void 0)throw new Error(`The group [${L}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds?.[A]==="node")throw new Error(`The group [${L}]'s parent is not a group`)}this.registeredIds[L]="group",this.groups[L]={id:L,icon:b,title:G,in:A}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:L,rhsId:b,lhsDir:A,rhsDir:G,lhsInto:N,rhsInto:v,lhsGroup:h,rhsGroup:i,title:r}){if(!Re(A))throw new Error(`Invalid direction given for left hand side of edge ${L}--${b}. Expected (L,R,T,B) got ${String(A)}`);if(!Re(G))throw new Error(`Invalid direction given for right hand side of edge ${L}--${b}. Expected (L,R,T,B) got ${String(G)}`);if(this.nodes[L]===void 0&&this.groups[L]===void 0)throw new Error(`The left-hand id [${L}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[b]===void 0&&this.groups[b]===void 0)throw new Error(`The right-hand id [${b}] does not yet exist. Please create the service/group before declaring an edge to it.`);const a=this.nodes[L].in,f=this.nodes[b].in;if(h&&a&&f&&a==f)throw new Error(`The left-hand id [${L}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(i&&a&&f&&a==f)throw new Error(`The right-hand id [${b}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const e={lhsId:L,lhsDir:A,lhsInto:N,lhsGroup:h,rhsId:b,rhsDir:G,rhsInto:v,rhsGroup:i,title:r};this.edges.push(e),this.nodes[L]&&this.nodes[b]&&(this.nodes[L].edges.push(this.edges[this.edges.length-1]),this.nodes[b].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}addLayoutHint(L){if(L.members.length<2)throw new Error(`An align directive requires at least two members; got ${L.members.length}`);const b=new Set;L.members.forEach(A=>{if(this.registeredIds[A]!=="node")throw new Error(`align ${L.direction} references [${A}], which is not a service or junction`);if(b.has(A))throw new Error(`align ${L.direction} lists [${A}] more than once`);b.add(A)}),this.layoutHints.push(L)}getLayoutHints(){return this.layoutHints}getDataStructures(){if(this.dataStructures===void 0){const L={},b=Object.entries(this.nodes).reduce((i,[r,a])=>(i[r]=a.edges.reduce((f,e)=>{const u=this.getNode(e.lhsId)?.in,t=this.getNode(e.rhsId)?.in;if(u&&t&&u!==t){const s=Ar(e.lhsDir,e.rhsDir);s!=="bend"&&(L[u]??={},L[u][t]=s,L[t]??={},L[t][u]=s)}if(e.lhsId===r){const s=pe(e.lhsDir,e.rhsDir);s&&(f[s]=e.rhsId)}else{const s=pe(e.rhsDir,e.lhsDir);s&&(f[s]=e.lhsId)}return f},{}),i),{}),A=Object.keys(b)[0],G={[A]:1},N=Object.keys(b).reduce((i,r)=>r===A?i:{...i,[r]:1},{}),v=gt(i=>{const r={[i]:[0,0]},a=[i];for(;a.length>0;){const f=a.shift();if(f){G[f]=1,delete N[f];const e=b[f],[u,t]=r[f];Object.entries(e).forEach(([s,o])=>{G[o]||(r[o]=Cr([u,t],s),a.push(o))})}}return r},"BFS"),h=[v(A)];for(;Object.keys(N).length>0;)h.push(v(Object.keys(N)[0]));this.dataStructures={adjList:b,spatialMaps:h,groupAlignments:L}}return this.dataStructures}setElementForId(L,b){this.elements[L]=b}getElementById(L){return this.elements[L]}getConfig(){return rr({...Dr,...ir().architecture})}getConfigField(L){return this.getConfig()[L]}},xr=gt((L,b)=>{ke(L,b),L.groups.map(A=>b.addGroup(A)),L.services.map(A=>b.addService({...A,type:"service"})),L.junctions.map(A=>b.addJunction({...A,type:"junction"})),L.edges.map(A=>b.addEdge(A)),L.alignments?.map(A=>b.addLayoutHint({direction:A.direction,members:[...A.members]}))},"populateDb"),Ge={parser:{yy:void 0},parse:gt(async L=>{const b=await fr("architecture",L);Se.debug(b);const A=Ge.parser?.yy;if(!(A instanceof Pe))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");xr(b,A)},"parse")},Ir=gt(L=>` +import{p as ke}from"./chunk-JWPE2WC7-BJMJfnyy.js";import{_ as gt,D as Ze,ad as qe,l as Se,b as Qe,a as Je,n as Ke,o as je,g as _e,s as tr,p as er,A as rr,y as ir,B as ar,c as me,a$ as Ee,ai as ve,i as nr,d as or,q as sr,aj as hr,b7 as lr}from"./mermaid.core-WW7RuneT.js";import{p as fr}from"./cynefin-VYW2F7L2-DI-9Z5R0.js";import{c as Fe}from"./cytoscape.esm-OyMbaexL.js";import{g as cr}from"./_commonjsHelpers-CqkleIqs.js";import"./index-CiHMlsuo.js";var se={exports:{}},he={exports:{}},le={exports:{}},gr=le.exports,Me;function ur(){return Me||(Me=1,(function(L,b){(function(G,N){L.exports=N()})(gr,function(){return(function(A){var G={};function N(v){if(G[v])return G[v].exports;var h=G[v]={i:v,l:!1,exports:{}};return A[v].call(h.exports,h,h.exports,N),h.l=!0,h.exports}return N.m=A,N.c=G,N.i=function(v){return v},N.d=function(v,h,i){N.o(v,h)||Object.defineProperty(v,h,{configurable:!1,enumerable:!0,get:i})},N.n=function(v){var h=v&&v.__esModule?function(){return v.default}:function(){return v};return N.d(h,"a",h),h},N.o=function(v,h){return Object.prototype.hasOwnProperty.call(v,h)},N.p="",N(N.s=28)})([(function(A,G,N){function v(){}v.QUALITY=1,v.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,v.DEFAULT_INCREMENTAL=!1,v.DEFAULT_ANIMATION_ON_LAYOUT=!0,v.DEFAULT_ANIMATION_DURING_LAYOUT=!1,v.DEFAULT_ANIMATION_PERIOD=50,v.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,v.DEFAULT_GRAPH_MARGIN=15,v.NODE_DIMENSIONS_INCLUDE_LABELS=!1,v.SIMPLE_NODE_SIZE=40,v.SIMPLE_NODE_HALF_SIZE=v.SIMPLE_NODE_SIZE/2,v.EMPTY_COMPOUND_NODE_SIZE=40,v.MIN_EDGE_LENGTH=1,v.WORLD_BOUNDARY=1e6,v.INITIAL_WORLD_BOUNDARY=v.WORLD_BOUNDARY/1e3,v.WORLD_CENTER_X=1200,v.WORLD_CENTER_Y=900,A.exports=v}),(function(A,G,N){var v=N(2),h=N(8),i=N(9);function r(f,e,u){v.call(this,u),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=u,this.bendpoints=[],this.source=f,this.target=e}r.prototype=Object.create(v.prototype);for(var a in v)r[a]=v[a];r.prototype.getSource=function(){return this.source},r.prototype.getTarget=function(){return this.target},r.prototype.isInterGraph=function(){return this.isInterGraph},r.prototype.getLength=function(){return this.length},r.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},r.prototype.getBendpoints=function(){return this.bendpoints},r.prototype.getLca=function(){return this.lca},r.prototype.getSourceInLca=function(){return this.sourceInLca},r.prototype.getTargetInLca=function(){return this.targetInLca},r.prototype.getOtherEnd=function(f){if(this.source===f)return this.target;if(this.target===f)return this.source;throw"Node is not incident with this edge"},r.prototype.getOtherEndInGraph=function(f,e){for(var u=this.getOtherEnd(f),t=e.getGraphManager().getRoot();;){if(u.getOwner()==e)return u;if(u.getOwner()==t)break;u=u.getOwner().getParent()}return null},r.prototype.updateLength=function(){var f=new Array(4);this.isOverlapingSourceAndTarget=h.getIntersection(this.target.getRect(),this.source.getRect(),f),this.isOverlapingSourceAndTarget||(this.lengthX=f[0]-f[2],this.lengthY=f[1]-f[3],Math.abs(this.lengthX)<1&&(this.lengthX=i.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=i.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},r.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=i.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=i.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},A.exports=r}),(function(A,G,N){function v(h){this.vGraphObject=h}A.exports=v}),(function(A,G,N){var v=N(2),h=N(10),i=N(13),r=N(0),a=N(16),f=N(5);function e(t,s,o,c){o==null&&c==null&&(c=s),v.call(this,c),t.graphManager!=null&&(t=t.graphManager),this.estimatedSize=h.MIN_VALUE,this.inclusionTreeDepth=h.MAX_VALUE,this.vGraphObject=c,this.edges=[],this.graphManager=t,o!=null&&s!=null?this.rect=new i(s.x,s.y,o.width,o.height):this.rect=new i}e.prototype=Object.create(v.prototype);for(var u in v)e[u]=v[u];e.prototype.getEdges=function(){return this.edges},e.prototype.getChild=function(){return this.child},e.prototype.getOwner=function(){return this.owner},e.prototype.getWidth=function(){return this.rect.width},e.prototype.setWidth=function(t){this.rect.width=t},e.prototype.getHeight=function(){return this.rect.height},e.prototype.setHeight=function(t){this.rect.height=t},e.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},e.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},e.prototype.getCenter=function(){return new f(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},e.prototype.getLocation=function(){return new f(this.rect.x,this.rect.y)},e.prototype.getRect=function(){return this.rect},e.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},e.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},e.prototype.setRect=function(t,s){this.rect.x=t.x,this.rect.y=t.y,this.rect.width=s.width,this.rect.height=s.height},e.prototype.setCenter=function(t,s){this.rect.x=t-this.rect.width/2,this.rect.y=s-this.rect.height/2},e.prototype.setLocation=function(t,s){this.rect.x=t,this.rect.y=s},e.prototype.moveBy=function(t,s){this.rect.x+=t,this.rect.y+=s},e.prototype.getEdgeListToNode=function(t){var s=[],o=this;return o.edges.forEach(function(c){if(c.target==t){if(c.source!=o)throw"Incorrect edge source!";s.push(c)}}),s},e.prototype.getEdgesBetween=function(t){var s=[],o=this;return o.edges.forEach(function(c){if(!(c.source==o||c.target==o))throw"Incorrect edge source and/or target";(c.target==t||c.source==t)&&s.push(c)}),s},e.prototype.getNeighborsList=function(){var t=new Set,s=this;return s.edges.forEach(function(o){if(o.source==s)t.add(o.target);else{if(o.target!=s)throw"Incorrect incidency!";t.add(o.source)}}),t},e.prototype.withChildren=function(){var t=new Set,s,o;if(t.add(this),this.child!=null)for(var c=this.child.getNodes(),l=0;ls?(this.rect.x-=(this.labelWidth-s)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(s+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(o+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>o?(this.rect.y-=(this.labelHeight-o)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(o+this.labelHeight))}}},e.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==h.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},e.prototype.transform=function(t){var s=this.rect.x;s>r.WORLD_BOUNDARY?s=r.WORLD_BOUNDARY:s<-r.WORLD_BOUNDARY&&(s=-r.WORLD_BOUNDARY);var o=this.rect.y;o>r.WORLD_BOUNDARY?o=r.WORLD_BOUNDARY:o<-r.WORLD_BOUNDARY&&(o=-r.WORLD_BOUNDARY);var c=new f(s,o),l=t.inverseTransformPoint(c);this.setLocation(l.x,l.y)},e.prototype.getLeft=function(){return this.rect.x},e.prototype.getRight=function(){return this.rect.x+this.rect.width},e.prototype.getTop=function(){return this.rect.y},e.prototype.getBottom=function(){return this.rect.y+this.rect.height},e.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},A.exports=e}),(function(A,G,N){var v=N(0);function h(){}for(var i in v)h[i]=v[i];h.MAX_ITERATIONS=2500,h.DEFAULT_EDGE_LENGTH=50,h.DEFAULT_SPRING_STRENGTH=.45,h.DEFAULT_REPULSION_STRENGTH=4500,h.DEFAULT_GRAVITY_STRENGTH=.4,h.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,h.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,h.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,h.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,h.COOLING_ADAPTATION_FACTOR=.33,h.ADAPTATION_LOWER_NODE_LIMIT=1e3,h.ADAPTATION_UPPER_NODE_LIMIT=5e3,h.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,h.MAX_NODE_DISPLACEMENT=h.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,h.MIN_REPULSION_DIST=h.DEFAULT_EDGE_LENGTH/10,h.CONVERGENCE_CHECK_PERIOD=100,h.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,h.MIN_EDGE_LENGTH=1,h.GRID_CALCULATION_CHECK_PERIOD=10,A.exports=h}),(function(A,G,N){function v(h,i){h==null&&i==null?(this.x=0,this.y=0):(this.x=h,this.y=i)}v.prototype.getX=function(){return this.x},v.prototype.getY=function(){return this.y},v.prototype.setX=function(h){this.x=h},v.prototype.setY=function(h){this.y=h},v.prototype.getDifference=function(h){return new DimensionD(this.x-h.x,this.y-h.y)},v.prototype.getCopy=function(){return new v(this.x,this.y)},v.prototype.translate=function(h){return this.x+=h.width,this.y+=h.height,this},A.exports=v}),(function(A,G,N){var v=N(2),h=N(10),i=N(0),r=N(7),a=N(3),f=N(1),e=N(13),u=N(12),t=N(11);function s(c,l,T){v.call(this,T),this.estimatedSize=h.MIN_VALUE,this.margin=i.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=c,l!=null&&l instanceof r?this.graphManager=l:l!=null&&l instanceof Layout&&(this.graphManager=l.graphManager)}s.prototype=Object.create(v.prototype);for(var o in v)s[o]=v[o];s.prototype.getNodes=function(){return this.nodes},s.prototype.getEdges=function(){return this.edges},s.prototype.getGraphManager=function(){return this.graphManager},s.prototype.getParent=function(){return this.parent},s.prototype.getLeft=function(){return this.left},s.prototype.getRight=function(){return this.right},s.prototype.getTop=function(){return this.top},s.prototype.getBottom=function(){return this.bottom},s.prototype.isConnected=function(){return this.isConnected},s.prototype.add=function(c,l,T){if(l==null&&T==null){var g=c;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(g)>-1)throw"Node already in graph!";return g.owner=this,this.getNodes().push(g),g}else{var d=c;if(!(this.getNodes().indexOf(l)>-1&&this.getNodes().indexOf(T)>-1))throw"Source or target not in graph!";if(!(l.owner==T.owner&&l.owner==this))throw"Both owners must be this graph!";return l.owner!=T.owner?null:(d.source=l,d.target=T,d.isInterGraph=!1,this.getEdges().push(d),l.edges.push(d),T!=l&&T.edges.push(d),d)}},s.prototype.remove=function(c){var l=c;if(c instanceof a){if(l==null)throw"Node is null!";if(!(l.owner!=null&&l.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var T=l.edges.slice(),g,d=T.length,C=0;C-1&&P>-1))throw"Source and/or target doesn't know this edge!";g.source.edges.splice(w,1),g.target!=g.source&&g.target.edges.splice(P,1);var S=g.source.owner.getEdges().indexOf(g);if(S==-1)throw"Not in owner's edge list!";g.source.owner.getEdges().splice(S,1)}},s.prototype.updateLeftTop=function(){for(var c=h.MAX_VALUE,l=h.MAX_VALUE,T,g,d,C=this.getNodes(),S=C.length,w=0;wT&&(c=T),l>g&&(l=g)}return c==h.MAX_VALUE?null:(C[0].getParent().paddingLeft!=null?d=C[0].getParent().paddingLeft:d=this.margin,this.left=l-d,this.top=c-d,new u(this.left,this.top))},s.prototype.updateBounds=function(c){for(var l=h.MAX_VALUE,T=-h.MAX_VALUE,g=h.MAX_VALUE,d=-h.MAX_VALUE,C,S,w,P,B,U=this.nodes,V=U.length,M=0;MC&&(l=C),Tw&&(g=w),dC&&(l=C),Tw&&(g=w),d=this.nodes.length){var V=0;T.forEach(function(M){M.owner==c&&V++}),V==this.nodes.length&&(this.isConnected=!0)}},A.exports=s}),(function(A,G,N){var v,h=N(1);function i(r){v=N(6),this.layout=r,this.graphs=[],this.edges=[]}i.prototype.addRoot=function(){var r=this.layout.newGraph(),a=this.layout.newNode(null),f=this.add(r,a);return this.setRootGraph(f),this.rootGraph},i.prototype.add=function(r,a,f,e,u){if(f==null&&e==null&&u==null){if(r==null)throw"Graph is null!";if(a==null)throw"Parent node is null!";if(this.graphs.indexOf(r)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(r),r.parent!=null)throw"Already has a parent!";if(a.child!=null)throw"Already has a child!";return r.parent=a,a.child=r,r}else{u=f,e=a,f=r;var t=e.getOwner(),s=u.getOwner();if(!(t!=null&&t.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(s!=null&&s.getGraphManager()==this))throw"Target not in this graph mgr!";if(t==s)return f.isInterGraph=!1,t.add(f,e,u);if(f.isInterGraph=!0,f.source=e,f.target=u,this.edges.indexOf(f)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(f),!(f.source!=null&&f.target!=null))throw"Edge source and/or target is null!";if(!(f.source.edges.indexOf(f)==-1&&f.target.edges.indexOf(f)==-1))throw"Edge already in source and/or target incidency list!";return f.source.edges.push(f),f.target.edges.push(f),f}},i.prototype.remove=function(r){if(r instanceof v){var a=r;if(a.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(a==this.rootGraph||a.parent!=null&&a.parent.graphManager==this))throw"Invalid parent node!";var f=[];f=f.concat(a.getEdges());for(var e,u=f.length,t=0;t=r.getRight()?a[0]+=Math.min(r.getX()-i.getX(),i.getRight()-r.getRight()):r.getX()<=i.getX()&&r.getRight()>=i.getRight()&&(a[0]+=Math.min(i.getX()-r.getX(),r.getRight()-i.getRight())),i.getY()<=r.getY()&&i.getBottom()>=r.getBottom()?a[1]+=Math.min(r.getY()-i.getY(),i.getBottom()-r.getBottom()):r.getY()<=i.getY()&&r.getBottom()>=i.getBottom()&&(a[1]+=Math.min(i.getY()-r.getY(),r.getBottom()-i.getBottom()));var u=Math.abs((r.getCenterY()-i.getCenterY())/(r.getCenterX()-i.getCenterX()));r.getCenterY()===i.getCenterY()&&r.getCenterX()===i.getCenterX()&&(u=1);var t=u*a[0],s=a[1]/u;a[0]t)return a[0]=f,a[1]=o,a[2]=u,a[3]=U,!1;if(eu)return a[0]=s,a[1]=e,a[2]=P,a[3]=t,!1;if(fu?(a[0]=l,a[1]=T,n=!0):(a[0]=c,a[1]=o,n=!0):p===y&&(f>u?(a[0]=s,a[1]=o,n=!0):(a[0]=g,a[1]=T,n=!0)),-m===y?u>f?(a[2]=B,a[3]=U,E=!0):(a[2]=P,a[3]=w,E=!0):m===y&&(u>f?(a[2]=S,a[3]=w,E=!0):(a[2]=V,a[3]=U,E=!0)),n&&E)return!1;if(f>u?e>t?(I=this.getCardinalDirection(p,y,4),O=this.getCardinalDirection(m,y,2)):(I=this.getCardinalDirection(-p,y,3),O=this.getCardinalDirection(-m,y,1)):e>t?(I=this.getCardinalDirection(-p,y,1),O=this.getCardinalDirection(-m,y,3)):(I=this.getCardinalDirection(p,y,2),O=this.getCardinalDirection(m,y,4)),!n)switch(I){case 1:W=o,R=f+-C/y,a[0]=R,a[1]=W;break;case 2:R=g,W=e+d*y,a[0]=R,a[1]=W;break;case 3:W=T,R=f+C/y,a[0]=R,a[1]=W;break;case 4:R=l,W=e+-d*y,a[0]=R,a[1]=W;break}if(!E)switch(O){case 1:Q=w,x=u+-_/y,a[2]=x,a[3]=Q;break;case 2:x=V,Q=t+M*y,a[2]=x,a[3]=Q;break;case 3:Q=U,x=u+_/y,a[2]=x,a[3]=Q;break;case 4:x=B,Q=t+-M*y,a[2]=x,a[3]=Q;break}}return!1},h.getCardinalDirection=function(i,r,a){return i>r?a:1+a%4},h.getIntersection=function(i,r,a,f){if(f==null)return this.getIntersection2(i,r,a);var e=i.x,u=i.y,t=r.x,s=r.y,o=a.x,c=a.y,l=f.x,T=f.y,g=void 0,d=void 0,C=void 0,S=void 0,w=void 0,P=void 0,B=void 0,U=void 0,V=void 0;return C=s-u,w=e-t,B=t*u-e*s,S=T-c,P=o-l,U=l*c-o*T,V=C*P-S*w,V===0?null:(g=(w*U-P*B)/V,d=(S*B-C*U)/V,new v(g,d))},h.angleOfVector=function(i,r,a,f){var e=void 0;return i!==a?(e=Math.atan((f-r)/(a-i)),a=0){var T=(-o+Math.sqrt(o*o-4*s*c))/(2*s),g=(-o-Math.sqrt(o*o-4*s*c))/(2*s),d=null;return T>=0&&T<=1?[T]:g>=0&&g<=1?[g]:d}else return null},h.HALF_PI=.5*Math.PI,h.ONE_AND_HALF_PI=1.5*Math.PI,h.TWO_PI=2*Math.PI,h.THREE_PI=3*Math.PI,A.exports=h}),(function(A,G,N){function v(){}v.sign=function(h){return h>0?1:h<0?-1:0},v.floor=function(h){return h<0?Math.ceil(h):Math.floor(h)},v.ceil=function(h){return h<0?Math.floor(h):Math.ceil(h)},A.exports=v}),(function(A,G,N){function v(){}v.MAX_VALUE=2147483647,v.MIN_VALUE=-2147483648,A.exports=v}),(function(A,G,N){var v=(function(){function e(u,t){for(var s=0;s"u"?"undefined":v(i);return i==null||r!="object"&&r!="function"},A.exports=h}),(function(A,G,N){function v(o){if(Array.isArray(o)){for(var c=0,l=Array(o.length);c0&&c;){for(C.push(w[0]);C.length>0&&c;){var P=C[0];C.splice(0,1),d.add(P);for(var B=P.getEdges(),g=0;g-1&&w.splice(_,1)}d=new Set,S=new Map}}return o},s.prototype.createDummyNodesForBendpoints=function(o){for(var c=[],l=o.source,T=this.graphManager.calcLowestCommonAncestor(o.source,o.target),g=0;g0){for(var T=this.edgeToDummyNodes.get(l),g=0;g=0&&c.splice(U,1);var V=S.getNeighborsList();V.forEach(function(n){if(l.indexOf(n)<0){var E=T.get(n),p=E-1;p==1&&P.push(n),T.set(n,p)}})}l=l.concat(P),(c.length==1||c.length==2)&&(g=!0,d=c[0])}return d},s.prototype.setGraphManager=function(o){this.graphManager=o},A.exports=s}),(function(A,G,N){function v(){}v.seed=1,v.x=0,v.nextDouble=function(){return v.x=Math.sin(v.seed++)*1e4,v.x-Math.floor(v.x)},A.exports=v}),(function(A,G,N){var v=N(5);function h(i,r){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}h.prototype.getWorldOrgX=function(){return this.lworldOrgX},h.prototype.setWorldOrgX=function(i){this.lworldOrgX=i},h.prototype.getWorldOrgY=function(){return this.lworldOrgY},h.prototype.setWorldOrgY=function(i){this.lworldOrgY=i},h.prototype.getWorldExtX=function(){return this.lworldExtX},h.prototype.setWorldExtX=function(i){this.lworldExtX=i},h.prototype.getWorldExtY=function(){return this.lworldExtY},h.prototype.setWorldExtY=function(i){this.lworldExtY=i},h.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},h.prototype.setDeviceOrgX=function(i){this.ldeviceOrgX=i},h.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},h.prototype.setDeviceOrgY=function(i){this.ldeviceOrgY=i},h.prototype.getDeviceExtX=function(){return this.ldeviceExtX},h.prototype.setDeviceExtX=function(i){this.ldeviceExtX=i},h.prototype.getDeviceExtY=function(){return this.ldeviceExtY},h.prototype.setDeviceExtY=function(i){this.ldeviceExtY=i},h.prototype.transformX=function(i){var r=0,a=this.lworldExtX;return a!=0&&(r=this.ldeviceOrgX+(i-this.lworldOrgX)*this.ldeviceExtX/a),r},h.prototype.transformY=function(i){var r=0,a=this.lworldExtY;return a!=0&&(r=this.ldeviceOrgY+(i-this.lworldOrgY)*this.ldeviceExtY/a),r},h.prototype.inverseTransformX=function(i){var r=0,a=this.ldeviceExtX;return a!=0&&(r=this.lworldOrgX+(i-this.ldeviceOrgX)*this.lworldExtX/a),r},h.prototype.inverseTransformY=function(i){var r=0,a=this.ldeviceExtY;return a!=0&&(r=this.lworldOrgY+(i-this.ldeviceOrgY)*this.lworldExtY/a),r},h.prototype.inverseTransformPoint=function(i){var r=new v(this.inverseTransformX(i.x),this.inverseTransformY(i.y));return r},A.exports=h}),(function(A,G,N){function v(t){if(Array.isArray(t)){for(var s=0,o=Array(t.length);si.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*i.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-i.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>i.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(i.COOLING_ADAPTATION_FACTOR,1-(t-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*(1-i.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},e.prototype.calcSpringForces=function(){for(var t=this.getAllEdges(),s,o=0;o0&&arguments[0]!==void 0?arguments[0]:!0,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,o,c,l,T,g=this.getAllNodes(),d;if(this.useFRGridVariant)for(this.totalIterations%i.GRID_CALCULATION_CHECK_PERIOD==1&&t&&this.updateGrid(),d=new Set,o=0;oC||d>C)&&(t.gravitationForceX=-this.gravityConstant*l,t.gravitationForceY=-this.gravityConstant*T)):(C=s.getEstimatedSize()*this.compoundGravityRangeFactor,(g>C||d>C)&&(t.gravitationForceX=-this.gravityConstant*l*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*T*this.compoundGravityConstant))},e.prototype.isConverged=function(){var t,s=!1;return this.totalIterations>this.maxIterations/3&&(s=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement=g.length||C>=g[0].length)){for(var S=0;Se}}]),a})();A.exports=r}),(function(A,G,N){function v(){}v.svd=function(h){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=h.length,this.n=h[0].length;var i=Math.min(this.m,this.n);this.s=(function(Tt){for(var Ct=[];Tt-- >0;)Ct.push(0);return Ct})(Math.min(this.m+1,this.n)),this.U=(function(Tt){var Ct=function Bt(bt){if(bt.length==0)return 0;for(var zt=[],St=0;St0;)Ct.push(0);return Ct})(this.n),a=(function(Tt){for(var Ct=[];Tt-- >0;)Ct.push(0);return Ct})(this.m),f=!0,e=Math.min(this.m-1,this.n),u=Math.max(0,Math.min(this.n-2,this.m)),t=0;t=0;m--)if(this.s[m]!==0){for(var y=m+1;y=0;z--){if((function(Tt,Ct){return Tt&&Ct})(z0;){var J=void 0,It=void 0;for(J=n-2;J>=-1&&J!==-1;J--)if(Math.abs(r[J])<=ht+tt*(Math.abs(this.s[J])+Math.abs(this.s[J+1]))){r[J]=0;break}if(J===n-2)It=4;else{var Nt=void 0;for(Nt=n-1;Nt>=J&&Nt!==J;Nt--){var vt=(Nt!==n?Math.abs(r[Nt]):0)+(Nt!==J+1?Math.abs(r[Nt-1]):0);if(Math.abs(this.s[Nt])<=ht+tt*vt){this.s[Nt]=0;break}}Nt===J?It=3:Nt===n-1?It=1:(It=2,J=Nt)}switch(J++,It){case 1:{var it=r[n-2];r[n-2]=0;for(var ut=n-2;ut>=J;ut--){var Et=v.hypot(this.s[ut],it),wt=this.s[ut]/Et,Ot=it/Et;this.s[ut]=Et,ut!==J&&(it=-Ot*r[ut-1],r[ut-1]=wt*r[ut-1]);for(var mt=0;mt=this.s[J+1]);){var Lt=this.s[J];if(this.s[J]=this.s[J+1],this.s[J+1]=Lt,JMath.abs(i)?(r=i/h,r=Math.abs(h)*Math.sqrt(1+r*r)):i!=0?(r=h/i,r=Math.abs(i)*Math.sqrt(1+r*r)):r=0,r},A.exports=v}),(function(A,G,N){var v=(function(){function r(a,f){for(var e=0;e2&&arguments[2]!==void 0?arguments[2]:1,u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,t=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;h(this,r),this.sequence1=a,this.sequence2=f,this.match_score=e,this.mismatch_penalty=u,this.gap_penalty=t,this.iMax=a.length+1,this.jMax=f.length+1,this.grid=new Array(this.iMax);for(var s=0;s=0;a--){var f=this.listeners[a];f.event===i&&f.callback===r&&this.listeners.splice(a,1)}},h.emit=function(i,r){for(var a=0;a{var G={45:((i,r,a)=>{var f={};f.layoutBase=a(551),f.CoSEConstants=a(806),f.CoSEEdge=a(767),f.CoSEGraph=a(880),f.CoSEGraphManager=a(578),f.CoSELayout=a(765),f.CoSENode=a(991),f.ConstraintHandler=a(902),i.exports=f}),806:((i,r,a)=>{var f=a(551).FDLayoutConstants;function e(){}for(var u in f)e[u]=f[u];e.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,e.DEFAULT_RADIAL_SEPARATION=f.DEFAULT_EDGE_LENGTH,e.DEFAULT_COMPONENT_SEPERATION=60,e.TILE=!0,e.TILING_PADDING_VERTICAL=10,e.TILING_PADDING_HORIZONTAL=10,e.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,e.ENFORCE_CONSTRAINTS=!0,e.APPLY_LAYOUT=!0,e.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,e.TREE_REDUCTION_ON_INCREMENTAL=!0,e.PURE_INCREMENTAL=e.DEFAULT_INCREMENTAL,i.exports=e}),767:((i,r,a)=>{var f=a(551).FDLayoutEdge;function e(t,s,o){f.call(this,t,s,o)}e.prototype=Object.create(f.prototype);for(var u in f)e[u]=f[u];i.exports=e}),880:((i,r,a)=>{var f=a(551).LGraph;function e(t,s,o){f.call(this,t,s,o)}e.prototype=Object.create(f.prototype);for(var u in f)e[u]=f[u];i.exports=e}),578:((i,r,a)=>{var f=a(551).LGraphManager;function e(t){f.call(this,t)}e.prototype=Object.create(f.prototype);for(var u in f)e[u]=f[u];i.exports=e}),765:((i,r,a)=>{var f=a(551).FDLayout,e=a(578),u=a(880),t=a(991),s=a(767),o=a(806),c=a(902),l=a(551).FDLayoutConstants,T=a(551).LayoutConstants,g=a(551).Point,d=a(551).PointD,C=a(551).DimensionD,S=a(551).Layout,w=a(551).Integer,P=a(551).IGeometry,B=a(551).LGraph,U=a(551).Transform,V=a(551).LinkedList;function M(){f.call(this),this.toBeTiled={},this.constraints={}}M.prototype=Object.create(f.prototype);for(var _ in f)M[_]=f[_];M.prototype.newGraphManager=function(){var n=new e(this);return this.graphManager=n,n},M.prototype.newGraph=function(n){return new u(null,this.graphManager,n)},M.prototype.newNode=function(n){return new t(this.graphManager,n)},M.prototype.newEdge=function(n){return new s(null,null,n)},M.prototype.initParameters=function(){f.prototype.initParameters.call(this,arguments),this.isSubLayout||(o.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=o.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=l.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=l.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=l.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},M.prototype.initSpringEmbedder=function(){f.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/l.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},M.prototype.layout=function(){var n=T.DEFAULT_CREATE_BENDS_AS_NEEDED;return n&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},M.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(o.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(I){return E.has(I)});this.graphManager.setAllNodesToApplyGravitation(p)}}else{var n=this.getFlatForest();if(n.length>0)this.positionNodesRadially(n);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(m){return E.has(m)});this.graphManager.setAllNodesToApplyGravitation(p),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(c.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),o.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},M.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%l.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var n=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(y){return n.has(y)});this.graphManager.setAllNodesToApplyGravitation(E),this.graphManager.updateBounds(),this.updateGrid(),o.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),o.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var p=!this.isTreeGrowing&&!this.isGrowthFinished,m=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(p,m),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},M.prototype.getPositionsData=function(){for(var n=this.graphManager.getAllNodes(),E={},p=0;p0&&this.updateDisplacements();for(var p=0;p0&&(m.fixedNodeWeight=I)}}if(this.constraints.relativePlacementConstraint){var O=new Map,R=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(D){n.fixedNodesOnHorizontal.add(D),n.fixedNodesOnVertical.add(D)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var W=this.constraints.alignmentConstraint.vertical,p=0;p=2*D.length/3;tt--)H=Math.floor(Math.random()*(tt+1)),k=D[tt],D[tt]=D[H],D[H]=k;return D},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(D){if(D.left){var H=O.has(D.left)?O.get(D.left):D.left,k=O.has(D.right)?O.get(D.right):D.right;n.nodesInRelativeHorizontal.includes(H)||(n.nodesInRelativeHorizontal.push(H),n.nodeToRelativeConstraintMapHorizontal.set(H,[]),n.dummyToNodeForVerticalAlignment.has(H)?n.nodeToTempPositionMapHorizontal.set(H,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(H)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(H,n.idToNodeMap.get(H).getCenterX())),n.nodesInRelativeHorizontal.includes(k)||(n.nodesInRelativeHorizontal.push(k),n.nodeToRelativeConstraintMapHorizontal.set(k,[]),n.dummyToNodeForVerticalAlignment.has(k)?n.nodeToTempPositionMapHorizontal.set(k,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(k)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(k,n.idToNodeMap.get(k).getCenterX())),n.nodeToRelativeConstraintMapHorizontal.get(H).push({right:k,gap:D.gap}),n.nodeToRelativeConstraintMapHorizontal.get(k).push({left:H,gap:D.gap})}else{var tt=R.has(D.top)?R.get(D.top):D.top,ht=R.has(D.bottom)?R.get(D.bottom):D.bottom;n.nodesInRelativeVertical.includes(tt)||(n.nodesInRelativeVertical.push(tt),n.nodeToRelativeConstraintMapVertical.set(tt,[]),n.dummyToNodeForHorizontalAlignment.has(tt)?n.nodeToTempPositionMapVertical.set(tt,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(tt)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(tt,n.idToNodeMap.get(tt).getCenterY())),n.nodesInRelativeVertical.includes(ht)||(n.nodesInRelativeVertical.push(ht),n.nodeToRelativeConstraintMapVertical.set(ht,[]),n.dummyToNodeForHorizontalAlignment.has(ht)?n.nodeToTempPositionMapVertical.set(ht,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(ht)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(ht,n.idToNodeMap.get(ht).getCenterY())),n.nodeToRelativeConstraintMapVertical.get(tt).push({bottom:ht,gap:D.gap}),n.nodeToRelativeConstraintMapVertical.get(ht).push({top:tt,gap:D.gap})}});else{var Q=new Map,z=new Map;this.constraints.relativePlacementConstraint.forEach(function(D){if(D.left){var H=O.has(D.left)?O.get(D.left):D.left,k=O.has(D.right)?O.get(D.right):D.right;Q.has(H)?Q.get(H).push(k):Q.set(H,[k]),Q.has(k)?Q.get(k).push(H):Q.set(k,[H])}else{var tt=R.has(D.top)?R.get(D.top):D.top,ht=R.has(D.bottom)?R.get(D.bottom):D.bottom;z.has(tt)?z.get(tt).push(ht):z.set(tt,[ht]),z.has(ht)?z.get(ht).push(tt):z.set(ht,[tt])}});var X=function(H,k){var tt=[],ht=[],J=new V,It=new Set,Nt=0;return H.forEach(function(vt,it){if(!It.has(it)){tt[Nt]=[],ht[Nt]=!1;var ut=it;for(J.push(ut),It.add(ut),tt[Nt].push(ut);J.length!=0;){ut=J.shift(),k.has(ut)&&(ht[Nt]=!0);var Et=H.get(ut);Et.forEach(function(wt){It.has(wt)||(J.push(wt),It.add(wt),tt[Nt].push(wt))})}Nt++}}),{components:tt,isFixed:ht}},rt=X(Q,n.fixedNodesOnHorizontal);this.componentsOnHorizontal=rt.components,this.fixedComponentsOnHorizontal=rt.isFixed;var $=X(z,n.fixedNodesOnVertical);this.componentsOnVertical=$.components,this.fixedComponentsOnVertical=$.isFixed}}},M.prototype.updateDisplacements=function(){var n=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function($){var D=n.idToNodeMap.get($.nodeId);D.displacementX=0,D.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var E=this.constraints.alignmentConstraint.vertical,p=0;p1){var R;for(R=0;Rm&&(m=Math.floor(O.y)),I=Math.floor(O.x+o.DEFAULT_COMPONENT_SEPERATION)}this.transform(new d(T.WORLD_CENTER_X-O.x/2,T.WORLD_CENTER_Y-O.y/2))},M.radialLayout=function(n,E,p){var m=Math.max(this.maxDiagonalInTree(n),o.DEFAULT_RADIAL_SEPARATION);M.branchRadialLayout(E,null,0,359,0,m);var y=B.calculateBounds(n),I=new U;I.setDeviceOrgX(y.getMinX()),I.setDeviceOrgY(y.getMinY()),I.setWorldOrgX(p.x),I.setWorldOrgY(p.y);for(var O=0;O1;){var k=H[0];H.splice(0,1);var tt=z.indexOf(k);tt>=0&&z.splice(tt,1),$--,X--}E!=null?D=(z.indexOf(H[0])+1)%$:D=0;for(var ht=Math.abs(m-p)/X,J=D;rt!=X;J=++J%$){var It=z[J].getOtherEnd(n);if(It!=E){var Nt=(p+rt*ht)%360,vt=(Nt+ht)%360;M.branchRadialLayout(It,n,Nt,vt,y+I,I),rt++}}},M.maxDiagonalInTree=function(n){for(var E=w.MIN_VALUE,p=0;pE&&(E=y)}return E},M.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},M.prototype.groupZeroDegreeMembers=function(){var n=this,E={};this.memberGroups={},this.idToDummyNode={};for(var p=[],m=this.graphManager.getAllNodes(),y=0;y"u"&&(E[R]=[]),E[R]=E[R].concat(I)}Object.keys(E).forEach(function(W){if(E[W].length>1){var x="DummyCompound_"+W;n.memberGroups[x]=E[W];var Q=E[W][0].getParent(),z=new t(n.graphManager);z.id=x,z.paddingLeft=Q.paddingLeft||0,z.paddingRight=Q.paddingRight||0,z.paddingBottom=Q.paddingBottom||0,z.paddingTop=Q.paddingTop||0,n.idToDummyNode[x]=z;var X=n.getGraphManager().add(n.newGraph(),z),rt=Q.getChild();rt.add(z);for(var $=0;$y?(m.rect.x-=(m.labelWidth-y)/2,m.setWidth(m.labelWidth),m.labelMarginLeft=(m.labelWidth-y)/2):m.labelPosHorizontal=="right"&&m.setWidth(y+m.labelWidth)),m.labelHeight&&(m.labelPosVertical=="top"?(m.rect.y-=m.labelHeight,m.setHeight(I+m.labelHeight),m.labelMarginTop=m.labelHeight):m.labelPosVertical=="center"&&m.labelHeight>I?(m.rect.y-=(m.labelHeight-I)/2,m.setHeight(m.labelHeight),m.labelMarginTop=(m.labelHeight-I)/2):m.labelPosVertical=="bottom"&&m.setHeight(I+m.labelHeight))}})},M.prototype.repopulateCompounds=function(){for(var n=this.compoundOrder.length-1;n>=0;n--){var E=this.compoundOrder[n],p=E.id,m=E.paddingLeft,y=E.paddingTop,I=E.labelMarginLeft,O=E.labelMarginTop;this.adjustLocations(this.tiledMemberPack[p],E.rect.x,E.rect.y,m,y,I,O)}},M.prototype.repopulateZeroDegreeMembers=function(){var n=this,E=this.tiledZeroDegreePack;Object.keys(E).forEach(function(p){var m=n.idToDummyNode[p],y=m.paddingLeft,I=m.paddingTop,O=m.labelMarginLeft,R=m.labelMarginTop;n.adjustLocations(E[p],m.rect.x,m.rect.y,y,I,O,R)})},M.prototype.getToBeTiled=function(n){var E=n.id;if(this.toBeTiled[E]!=null)return this.toBeTiled[E];var p=n.getChild();if(p==null)return this.toBeTiled[E]=!1,!1;for(var m=p.getNodes(),y=0;y0)return this.toBeTiled[E]=!1,!1;if(I.getChild()==null){this.toBeTiled[I.id]=!1;continue}if(!this.getToBeTiled(I))return this.toBeTiled[E]=!1,!1}return this.toBeTiled[E]=!0,!0},M.prototype.getNodeDegree=function(n){n.id;for(var E=n.getEdges(),p=0,m=0;mQ&&(Q=X.rect.height)}p+=Q+n.verticalPadding}},M.prototype.tileCompoundMembers=function(n,E){var p=this;this.tiledMemberPack=[],Object.keys(n).forEach(function(m){var y=E[m];if(p.tiledMemberPack[m]=p.tileNodes(n[m],y.paddingLeft+y.paddingRight),y.rect.width=p.tiledMemberPack[m].width,y.rect.height=p.tiledMemberPack[m].height,y.setCenter(p.tiledMemberPack[m].centerX,p.tiledMemberPack[m].centerY),y.labelMarginLeft=0,y.labelMarginTop=0,o.NODE_DIMENSIONS_INCLUDE_LABELS){var I=y.rect.width,O=y.rect.height;y.labelWidth&&(y.labelPosHorizontal=="left"?(y.rect.x-=y.labelWidth,y.setWidth(I+y.labelWidth),y.labelMarginLeft=y.labelWidth):y.labelPosHorizontal=="center"&&y.labelWidth>I?(y.rect.x-=(y.labelWidth-I)/2,y.setWidth(y.labelWidth),y.labelMarginLeft=(y.labelWidth-I)/2):y.labelPosHorizontal=="right"&&y.setWidth(I+y.labelWidth)),y.labelHeight&&(y.labelPosVertical=="top"?(y.rect.y-=y.labelHeight,y.setHeight(O+y.labelHeight),y.labelMarginTop=y.labelHeight):y.labelPosVertical=="center"&&y.labelHeight>O?(y.rect.y-=(y.labelHeight-O)/2,y.setHeight(y.labelHeight),y.labelMarginTop=(y.labelHeight-O)/2):y.labelPosVertical=="bottom"&&y.setHeight(O+y.labelHeight))}})},M.prototype.tileNodes=function(n,E){var p=this.tileNodesByFavoringDim(n,E,!0),m=this.tileNodesByFavoringDim(n,E,!1),y=this.getOrgRatio(p),I=this.getOrgRatio(m),O;return IR&&(R=$.getWidth())});var W=I/y,x=O/y,Q=Math.pow(p-m,2)+4*(W+m)*(x+p)*y,z=(m-p+Math.sqrt(Q))/(2*(W+m)),X;E?(X=Math.ceil(z),X==z&&X++):X=Math.floor(z);var rt=X*(W+m)-m;return R>rt&&(rt=R),rt+=m*2,rt},M.prototype.tileNodesByFavoringDim=function(n,E,p){var m=o.TILING_PADDING_VERTICAL,y=o.TILING_PADDING_HORIZONTAL,I=o.TILING_COMPARE_BY,O={rows:[],rowWidth:[],rowHeight:[],width:0,height:E,verticalPadding:m,horizontalPadding:y,centerX:0,centerY:0};I&&(O.idealRowWidth=this.calcIdealRowWidth(n,p));var R=function(D){return D.rect.width*D.rect.height},W=function(D,H){return R(H)-R(D)};n.sort(function($,D){var H=W;return O.idealRowWidth?(H=I,H($.id,D.id)):H($,D)});for(var x=0,Q=0,z=0;z0&&(O+=n.horizontalPadding),n.rowWidth[p]=O,n.width0&&(R+=n.verticalPadding);var W=0;R>n.rowHeight[p]&&(W=n.rowHeight[p],n.rowHeight[p]=R,W=n.rowHeight[p]-W),n.height+=W,n.rows[p].push(E)},M.prototype.getShortestRowIndex=function(n){for(var E=-1,p=Number.MAX_VALUE,m=0;mp&&(E=m,p=n.rowWidth[m]);return E},M.prototype.canAddHorizontal=function(n,E,p){if(n.idealRowWidth){var m=n.rows.length-1,y=n.rowWidth[m];return y+E+n.horizontalPadding<=n.idealRowWidth}var I=this.getShortestRowIndex(n);if(I<0)return!0;var O=n.rowWidth[I];if(O+n.horizontalPadding+E<=n.width)return!0;var R=0;n.rowHeight[I]0&&(R=p+n.verticalPadding-n.rowHeight[I]);var W;n.width-O>=E+n.horizontalPadding?W=(n.height+R)/(O+E+n.horizontalPadding):W=(n.height+R)/n.width,R=p+n.verticalPadding;var x;return n.widthI&&E!=p){m.splice(-1,1),n.rows[p].push(y),n.rowWidth[E]=n.rowWidth[E]-I,n.rowWidth[p]=n.rowWidth[p]+I,n.width=n.rowWidth[instance.getLongestRowIndex(n)];for(var O=Number.MIN_VALUE,R=0;RO&&(O=m[R].height);E>0&&(O+=n.verticalPadding);var W=n.rowHeight[E]+n.rowHeight[p];n.rowHeight[E]=O,n.rowHeight[p]0)for(var rt=y;rt<=I;rt++)X[0]+=this.grid[rt][O-1].length+this.grid[rt][O].length-1;if(I0)for(var rt=O;rt<=R;rt++)X[3]+=this.grid[y-1][rt].length+this.grid[y][rt].length-1;for(var $=w.MAX_VALUE,D,H,k=0;k{var f=a(551).FDLayoutNode,e=a(551).IMath;function u(s,o,c,l){f.call(this,s,o,c,l)}u.prototype=Object.create(f.prototype);for(var t in f)u[t]=f[t];u.prototype.calculateDisplacement=function(){var s=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementX=s.coolingFactor*s.maxNodeDisplacement*e.sign(this.displacementX)),Math.abs(this.displacementY)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementY=s.coolingFactor*s.maxNodeDisplacement*e.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},u.prototype.propogateDisplacementToChildren=function(s,o){for(var c=this.getChild().getNodes(),l,T=0;T{function f(c){if(Array.isArray(c)){for(var l=0,T=Array(c.length);l0){var Lt=0;ot.forEach(function(st){Z=="horizontal"?(et.set(st,g.has(st)?d[g.get(st)]:q.get(st)),Lt+=et.get(st)):(et.set(st,g.has(st)?C[g.get(st)]:q.get(st)),Lt+=et.get(st))}),Lt=Lt/ot.length,lt.forEach(function(st){K.has(st)||et.set(st,Lt)})}else{var ft=0;lt.forEach(function(st){Z=="horizontal"?ft+=g.has(st)?d[g.get(st)]:q.get(st):ft+=g.has(st)?C[g.get(st)]:q.get(st)}),ft=ft/lt.length,lt.forEach(function(st){et.set(st,ft)})}});for(var At=function(){var ot=dt.shift(),Lt=Y.get(ot);Lt.forEach(function(ft){if(et.get(ft.id)st&&(st=kt),KtXt&&(Xt=Kt)}}catch(ee){Ct=!0,Bt=ee}finally{try{!Tt&&bt.return&&bt.return()}finally{if(Ct)throw Bt}}var fe=(Lt+st)/2-(ft+Xt)/2,Qt=!0,jt=!1,_t=void 0;try{for(var Jt=lt[Symbol.iterator](),ne;!(Qt=(ne=Jt.next()).done);Qt=!0){var te=ne.value;et.set(te,et.get(te)+fe)}}catch(ee){jt=!0,_t=ee}finally{try{!Qt&&Jt.return&&Jt.return()}finally{if(jt)throw _t}}})}return et},_=function(Y){var Z=0,K=0,q=0,at=0;if(Y.forEach(function(j){j.left?d[g.get(j.left)]-d[g.get(j.right)]>=0?Z++:K++:C[g.get(j.top)]-C[g.get(j.bottom)]>=0?q++:at++}),Z>K&&q>at)for(var ct=0;ctK)for(var nt=0;ntat)for(var et=0;et1)l.fixedNodeConstraint.forEach(function(F,Y){m[Y]=[F.position.x,F.position.y],y[Y]=[d[g.get(F.nodeId)],C[g.get(F.nodeId)]]}),I=!0;else if(l.alignmentConstraint)(function(){var F=0;if(l.alignmentConstraint.vertical){for(var Y=l.alignmentConstraint.vertical,Z=function(et){var j=new Set;Y[et].forEach(function(pt){j.add(pt)});var dt=new Set([].concat(f(j)).filter(function(pt){return R.has(pt)})),At=void 0;dt.size>0?At=d[g.get(dt.values().next().value)]:At=V(j).x,Y[et].forEach(function(pt){m[F]=[At,C[g.get(pt)]],y[F]=[d[g.get(pt)],C[g.get(pt)]],F++})},K=0;K0?At=d[g.get(dt.values().next().value)]:At=V(j).y,q[et].forEach(function(pt){m[F]=[d[g.get(pt)],At],y[F]=[d[g.get(pt)],C[g.get(pt)]],F++})},ct=0;ctz&&(z=Q[rt].length,X=rt);if(z0){var mt={x:0,y:0};l.fixedNodeConstraint.forEach(function(F,Y){var Z={x:d[g.get(F.nodeId)],y:C[g.get(F.nodeId)]},K=F.position,q=U(K,Z);mt.x+=q.x,mt.y+=q.y}),mt.x/=l.fixedNodeConstraint.length,mt.y/=l.fixedNodeConstraint.length,d.forEach(function(F,Y){d[Y]+=mt.x}),C.forEach(function(F,Y){C[Y]+=mt.y}),l.fixedNodeConstraint.forEach(function(F){d[g.get(F.nodeId)]=F.position.x,C[g.get(F.nodeId)]=F.position.y})}if(l.alignmentConstraint){if(l.alignmentConstraint.vertical)for(var Dt=l.alignmentConstraint.vertical,Rt=function(Y){var Z=new Set;Dt[Y].forEach(function(at){Z.add(at)});var K=new Set([].concat(f(Z)).filter(function(at){return R.has(at)})),q=void 0;K.size>0?q=d[g.get(K.values().next().value)]:q=V(Z).x,Z.forEach(function(at){R.has(at)||(d[g.get(at)]=q)})},Ht=0;Ht0?q=C[g.get(K.values().next().value)]:q=V(Z).y,Z.forEach(function(at){R.has(at)||(C[g.get(at)]=q)})},Ft=0;Ft{i.exports=A})},N={};function v(i){var r=N[i];if(r!==void 0)return r.exports;var a=N[i]={exports:{}};return G[i](a,a.exports,v),a.exports}var h=v(45);return h})()})})(he)),he.exports}var pr=se.exports,De;function yr(){return De||(De=1,(function(L,b){(function(G,N){L.exports=N(vr())})(pr,function(A){return(()=>{var G={658:(i=>{i.exports=Object.assign!=null?Object.assign.bind(Object):function(r){for(var a=arguments.length,f=Array(a>1?a-1:0),e=1;e{var f=(function(){function t(s,o){var c=[],l=!0,T=!1,g=void 0;try{for(var d=s[Symbol.iterator](),C;!(l=(C=d.next()).done)&&(c.push(C.value),!(o&&c.length===o));l=!0);}catch(S){T=!0,g=S}finally{try{!l&&d.return&&d.return()}finally{if(T)throw g}}return c}return function(s,o){if(Array.isArray(s))return s;if(Symbol.iterator in Object(s))return t(s,o);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),e=a(140).layoutBase.LinkedList,u={};u.getTopMostNodes=function(t){for(var s={},o=0;o0&&I.merge(x)});for(var O=0;O1){C=g[0],S=C.connectedEdges().length,g.forEach(function(y){y.connectedEdges().length0&&c.set("dummy"+(c.size+1),B),U},u.relocateComponent=function(t,s,o){if(!o.fixedNodeConstraint){var c=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY;if(o.quality=="draft"){var d=!0,C=!1,S=void 0;try{for(var w=s.nodeIndexes[Symbol.iterator](),P;!(d=(P=w.next()).done);d=!0){var B=P.value,U=f(B,2),V=U[0],M=U[1],_=o.cy.getElementById(V);if(_){var n=_.boundingBox(),E=s.xCoords[M]-n.w/2,p=s.xCoords[M]+n.w/2,m=s.yCoords[M]-n.h/2,y=s.yCoords[M]+n.h/2;El&&(l=p),mg&&(g=y)}}}catch(x){C=!0,S=x}finally{try{!d&&w.return&&w.return()}finally{if(C)throw S}}var I=t.x-(l+c)/2,O=t.y-(g+T)/2;s.xCoords=s.xCoords.map(function(x){return x+I}),s.yCoords=s.yCoords.map(function(x){return x+O})}else{Object.keys(s).forEach(function(x){var Q=s[x],z=Q.getRect().x,X=Q.getRect().x+Q.getRect().width,rt=Q.getRect().y,$=Q.getRect().y+Q.getRect().height;zl&&(l=X),rtg&&(g=$)});var R=t.x-(l+c)/2,W=t.y-(g+T)/2;Object.keys(s).forEach(function(x){var Q=s[x];Q.setCenter(Q.getCenterX()+R,Q.getCenterY()+W)})}}},u.calcBoundingBox=function(t,s,o,c){for(var l=Number.MAX_SAFE_INTEGER,T=Number.MIN_SAFE_INTEGER,g=Number.MAX_SAFE_INTEGER,d=Number.MIN_SAFE_INTEGER,C=void 0,S=void 0,w=void 0,P=void 0,B=t.descendants().not(":parent"),U=B.length,V=0;VC&&(l=C),Tw&&(g=w),d{var f=a(548),e=a(140).CoSELayout,u=a(140).CoSENode,t=a(140).layoutBase.PointD,s=a(140).layoutBase.DimensionD,o=a(140).layoutBase.LayoutConstants,c=a(140).layoutBase.FDLayoutConstants,l=a(140).CoSEConstants,T=function(d,C){var S=d.cy,w=d.eles,P=w.nodes(),B=w.edges(),U=void 0,V=void 0,M=void 0,_={};d.randomize&&(U=C.nodeIndexes,V=C.xCoords,M=C.yCoords);var n=function(x){return typeof x=="function"},E=function(x,Q){return n(x)?x(Q):x},p=f.calcParentsWithoutChildren(S,w),m=function W(x,Q,z,X){for(var rt=Q.length,$=0;$0){var J=void 0;J=z.getGraphManager().add(z.newGraph(),k),W(J,H,z,X)}}},y=function(x,Q,z){for(var X=0,rt=0,$=0;$0?l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=X/rt:n(d.idealEdgeLength)?l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=50:l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=d.idealEdgeLength,l.MIN_REPULSION_DIST=c.MIN_REPULSION_DIST=c.DEFAULT_EDGE_LENGTH/10,l.DEFAULT_RADIAL_SEPARATION=c.DEFAULT_EDGE_LENGTH)},I=function(x,Q){Q.fixedNodeConstraint&&(x.constraints.fixedNodeConstraint=Q.fixedNodeConstraint),Q.alignmentConstraint&&(x.constraints.alignmentConstraint=Q.alignmentConstraint),Q.relativePlacementConstraint&&(x.constraints.relativePlacementConstraint=Q.relativePlacementConstraint)};d.nestingFactor!=null&&(l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=d.nestingFactor),d.gravity!=null&&(l.DEFAULT_GRAVITY_STRENGTH=c.DEFAULT_GRAVITY_STRENGTH=d.gravity),d.numIter!=null&&(l.MAX_ITERATIONS=c.MAX_ITERATIONS=d.numIter),d.gravityRange!=null&&(l.DEFAULT_GRAVITY_RANGE_FACTOR=c.DEFAULT_GRAVITY_RANGE_FACTOR=d.gravityRange),d.gravityCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=d.gravityCompound),d.gravityRangeCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=d.gravityRangeCompound),d.initialEnergyOnIncremental!=null&&(l.DEFAULT_COOLING_FACTOR_INCREMENTAL=c.DEFAULT_COOLING_FACTOR_INCREMENTAL=d.initialEnergyOnIncremental),d.tilingCompareBy!=null&&(l.TILING_COMPARE_BY=d.tilingCompareBy),d.quality=="proof"?o.QUALITY=2:o.QUALITY=0,l.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=o.NODE_DIMENSIONS_INCLUDE_LABELS=d.nodeDimensionsIncludeLabels,l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!d.randomize,l.ANIMATE=c.ANIMATE=o.ANIMATE=d.animate,l.TILE=d.tile,l.TILING_PADDING_VERTICAL=typeof d.tilingPaddingVertical=="function"?d.tilingPaddingVertical.call():d.tilingPaddingVertical,l.TILING_PADDING_HORIZONTAL=typeof d.tilingPaddingHorizontal=="function"?d.tilingPaddingHorizontal.call():d.tilingPaddingHorizontal,l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!0,l.PURE_INCREMENTAL=!d.randomize,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=d.uniformNodeDimensions,d.step=="transformed"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!1),d.step=="enforced"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!1),d.step=="cose"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!0),d.step=="all"&&(d.randomize?l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!0),d.fixedNodeConstraint||d.alignmentConstraint||d.relativePlacementConstraint?l.TREE_REDUCTION_ON_INCREMENTAL=!1:l.TREE_REDUCTION_ON_INCREMENTAL=!0;var O=new e,R=O.newGraphManager();return m(R.addRoot(),f.getTopMostNodes(P),O,d),y(O,R,B),I(O,d),O.runLayout(),_};i.exports={coseLayout:T}}),212:((i,r,a)=>{var f=(function(){function d(C,S){for(var w=0;w0)if(p){var I=t.getTopMostNodes(w.eles.nodes());if(M=t.connectComponents(P,w.eles,I),M.forEach(function(vt){var it=vt.boundingBox();_.push({x:it.x1+it.w/2,y:it.y1+it.h/2})}),w.randomize&&M.forEach(function(vt){w.eles=vt,U.push(o(w))}),w.quality=="default"||w.quality=="proof"){var O=P.collection();if(w.tile){var R=new Map,W=[],x=[],Q=0,z={nodeIndexes:R,xCoords:W,yCoords:x},X=[];if(M.forEach(function(vt,it){vt.edges().length==0&&(vt.nodes().forEach(function(ut,Et){O.merge(vt.nodes()[Et]),ut.isParent()||(z.nodeIndexes.set(vt.nodes()[Et].id(),Q++),z.xCoords.push(vt.nodes()[0].position().x),z.yCoords.push(vt.nodes()[0].position().y))}),X.push(it))}),O.length>1){var rt=O.boundingBox();_.push({x:rt.x1+rt.w/2,y:rt.y1+rt.h/2}),M.push(O),U.push(z);for(var $=X.length-1;$>=0;$--)M.splice(X[$],1),U.splice(X[$],1),_.splice(X[$],1)}}M.forEach(function(vt,it){w.eles=vt,V.push(l(w,U[it])),t.relocateComponent(_[it],V[it],w)})}else M.forEach(function(vt,it){t.relocateComponent(_[it],U[it],w)});var D=new Set;if(M.length>1){var H=[],k=B.filter(function(vt){return vt.css("display")=="none"});M.forEach(function(vt,it){var ut=void 0;if(w.quality=="draft"&&(ut=U[it].nodeIndexes),vt.nodes().not(k).length>0){var Et={};Et.edges=[],Et.nodes=[];var wt=void 0;vt.nodes().not(k).forEach(function(Ot){if(w.quality=="draft")if(!Ot.isParent())wt=ut.get(Ot.id()),Et.nodes.push({x:U[it].xCoords[wt]-Ot.boundingbox().w/2,y:U[it].yCoords[wt]-Ot.boundingbox().h/2,width:Ot.boundingbox().w,height:Ot.boundingbox().h});else{var mt=t.calcBoundingBox(Ot,U[it].xCoords,U[it].yCoords,ut);Et.nodes.push({x:mt.topLeftX,y:mt.topLeftY,width:mt.width,height:mt.height})}else V[it][Ot.id()]&&Et.nodes.push({x:V[it][Ot.id()].getLeft(),y:V[it][Ot.id()].getTop(),width:V[it][Ot.id()].getWidth(),height:V[it][Ot.id()].getHeight()})}),vt.edges().forEach(function(Ot){var mt=Ot.source(),Dt=Ot.target();if(mt.css("display")!="none"&&Dt.css("display")!="none")if(w.quality=="draft"){var Rt=ut.get(mt.id()),Ht=ut.get(Dt.id()),Ut=[],Pt=[];if(mt.isParent()){var Ft=t.calcBoundingBox(mt,U[it].xCoords,U[it].yCoords,ut);Ut.push(Ft.topLeftX+Ft.width/2),Ut.push(Ft.topLeftY+Ft.height/2)}else Ut.push(U[it].xCoords[Rt]),Ut.push(U[it].yCoords[Rt]);if(Dt.isParent()){var Yt=t.calcBoundingBox(Dt,U[it].xCoords,U[it].yCoords,ut);Pt.push(Yt.topLeftX+Yt.width/2),Pt.push(Yt.topLeftY+Yt.height/2)}else Pt.push(U[it].xCoords[Ht]),Pt.push(U[it].yCoords[Ht]);Et.edges.push({startX:Ut[0],startY:Ut[1],endX:Pt[0],endY:Pt[1]})}else V[it][mt.id()]&&V[it][Dt.id()]&&Et.edges.push({startX:V[it][mt.id()].getCenterX(),startY:V[it][mt.id()].getCenterY(),endX:V[it][Dt.id()].getCenterX(),endY:V[it][Dt.id()].getCenterY()})}),Et.nodes.length>0&&(H.push(Et),D.add(it))}});var tt=E.packComponents(H,w.randomize).shifts;if(w.quality=="draft")U.forEach(function(vt,it){var ut=vt.xCoords.map(function(wt){return wt+tt[it].dx}),Et=vt.yCoords.map(function(wt){return wt+tt[it].dy});vt.xCoords=ut,vt.yCoords=Et});else{var ht=0;D.forEach(function(vt){Object.keys(V[vt]).forEach(function(it){var ut=V[vt][it];ut.setCenter(ut.getCenterX()+tt[ht].dx,ut.getCenterY()+tt[ht].dy)}),ht++})}}}else{var m=w.eles.boundingBox();if(_.push({x:m.x1+m.w/2,y:m.y1+m.h/2}),w.randomize){var y=o(w);U.push(y)}w.quality=="default"||w.quality=="proof"?(V.push(l(w,U[0])),t.relocateComponent(_[0],V[0],w)):t.relocateComponent(_[0],U[0],w)}var J=function(it,ut){if(w.quality=="default"||w.quality=="proof"){typeof it=="number"&&(it=ut);var Et=void 0,wt=void 0,Ot=it.data("id");return V.forEach(function(Dt){Ot in Dt&&(Et={x:Dt[Ot].getRect().getCenterX(),y:Dt[Ot].getRect().getCenterY()},wt=Dt[Ot])}),w.nodeDimensionsIncludeLabels&&(wt.labelWidth&&(wt.labelPosHorizontal=="left"?Et.x+=wt.labelWidth/2:wt.labelPosHorizontal=="right"&&(Et.x-=wt.labelWidth/2)),wt.labelHeight&&(wt.labelPosVertical=="top"?Et.y+=wt.labelHeight/2:wt.labelPosVertical=="bottom"&&(Et.y-=wt.labelHeight/2))),Et==null&&(Et={x:it.position("x"),y:it.position("y")}),{x:Et.x,y:Et.y}}else{var mt=void 0;return U.forEach(function(Dt){var Rt=Dt.nodeIndexes.get(it.id());Rt!=null&&(mt={x:Dt.xCoords[Rt],y:Dt.yCoords[Rt]})}),mt==null&&(mt={x:it.position("x"),y:it.position("y")}),{x:mt.x,y:mt.y}}};if(w.quality=="default"||w.quality=="proof"||w.randomize){var It=t.calcParentsWithoutChildren(P,B),Nt=B.filter(function(vt){return vt.css("display")=="none"});w.eles=B.not(Nt),B.nodes().not(":parent").not(Nt).layoutPositions(S,w,J),It.length>0&&It.forEach(function(vt){vt.position(J(vt))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),d})();i.exports=g}),657:((i,r,a)=>{var f=a(548),e=a(140).layoutBase.Matrix,u=a(140).layoutBase.SVD,t=function(o){var c=o.cy,l=o.eles,T=l.nodes(),g=l.nodes(":parent"),d=new Map,C=new Map,S=new Map,w=[],P=[],B=[],U=[],V=[],M=[],_=[],n=[],E=void 0,p=1e8,m=1e-9,y=o.piTol,I=o.samplingType,O=o.nodeSeparation,R=void 0,W=function(){for(var Y=0,Z=0,K=!1;Z=at;){nt=q[at++];for(var xt=w[nt],lt=0;ltdt&&(dt=V[Lt],At=Lt)}return At},Q=function(Y){var Z=void 0;if(Y){Z=Math.floor(Math.random()*E);for(var q=0;q=1)break;j=et}for(var pt=0;pt=1)break;j=et}for(var lt=0;lt0&&(Z.isParent()?w[Y].push(S.get(Z.id())):w[Y].push(Z.id()))})});var Nt=function(Y){var Z=C.get(Y),K=void 0;d.get(Y).forEach(function(q){c.getElementById(q).isParent()?K=S.get(q):K=q,w[Z].push(K),w[C.get(K)].push(Y)})},vt=!0,it=!1,ut=void 0;try{for(var Et=d.keys()[Symbol.iterator](),wt;!(vt=(wt=Et.next()).done);vt=!0){var Ot=wt.value;Nt(Ot)}}catch(F){it=!0,ut=F}finally{try{!vt&&Et.return&&Et.return()}finally{if(it)throw ut}}E=C.size;var mt=void 0;if(E>2){R=E{var f=a(212),e=function(t){t&&t("layout","fcose",f)};typeof cytoscape<"u"&&e(cytoscape),i.exports=e}),140:(i=>{i.exports=A})},N={};function v(i){var r=N[i];if(r!==void 0)return r.exports;var a=N[i]={exports:{}};return G[i](a,a.exports,v),a.exports}var h=v(579);return h})()})})(se)),se.exports}var mr=yr();const Er=cr(mr);var xe={L:"left",R:"right",T:"top",B:"bottom"},Ie={L:gt(L=>`${L},${L/2} 0,${L} 0,0`,"L"),R:gt(L=>`0,${L/2} ${L},0 ${L},${L}`,"R"),T:gt(L=>`0,0 ${L},0 ${L/2},${L}`,"T"),B:gt(L=>`${L/2},0 ${L},${L} 0,${L}`,"B")},oe={L:gt((L,b)=>L-b+2,"L"),R:gt((L,b)=>L-2,"R"),T:gt((L,b)=>L-b+2,"T"),B:gt((L,b)=>L-2,"B")},Tr=gt(function(L){return Wt(L)?L==="L"?"R":"L":L==="T"?"B":"T"},"getOppositeArchitectureDirection"),Re=gt(function(L){const b=L;return b==="L"||b==="R"||b==="T"||b==="B"},"isArchitectureDirection"),Wt=gt(function(L){const b=L;return b==="L"||b==="R"},"isArchitectureDirectionX"),qt=gt(function(L){const b=L;return b==="T"||b==="B"},"isArchitectureDirectionY"),Te=gt(function(L,b){const A=Wt(L)&&qt(b),G=qt(L)&&Wt(b);return A||G},"isArchitectureDirectionXY"),Nr=gt(function(L){const b=L[0],A=L[1],G=Wt(b)&&qt(A),N=qt(b)&&Wt(A);return G||N},"isArchitecturePairXY"),Lr=gt(function(L){return L!=="LL"&&L!=="RR"&&L!=="TT"&&L!=="BB"},"isValidArchitectureDirectionPair"),pe=gt(function(L,b){const A=`${L}${b}`;return Lr(A)?A:void 0},"getArchitectureDirectionPair"),Cr=gt(function([L,b],A){const G=A[0],N=A[1];return Wt(G)?qt(N)?[L+(G==="L"?-1:1),b+(N==="T"?1:-1)]:[L+(G==="L"?-1:1),b]:Wt(N)?[L+(N==="L"?1:-1),b+(G==="T"?1:-1)]:[L,b+(G==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),wr=gt(function(L){return L==="LT"||L==="TL"?[1,1]:L==="BL"||L==="LB"?[1,-1]:L==="BR"||L==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),Ar=gt(function(L,b){return Te(L,b)?"bend":Wt(L)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Mr=gt(function(L){return L.type==="service"},"isArchitectureService"),Or=gt(function(L){return L.type==="junction"},"isArchitectureJunction"),be=gt(L=>L.data(),"edgeData"),ie=gt(L=>L.data(),"nodeData"),Dr=ar.architecture,Pe=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.layoutHints=[],this.registeredIds={},this.elements={},this.diagramId="",this.setAccTitle=Qe,this.getAccTitle=Je,this.setDiagramTitle=Ke,this.getDiagramTitle=je,this.getAccDescription=_e,this.setAccDescription=tr,this.clear()}static{gt(this,"ArchitectureDB")}setDiagramId(L){this.diagramId=L}getDiagramId(){return this.diagramId}clear(){this.nodes={},this.groups={},this.edges=[],this.layoutHints=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},this.diagramId="",er()}addService({id:L,icon:b,in:A,title:G,iconText:N}){if(this.registeredIds[L]!==void 0)throw new Error(`The service id [${L}] is already in use by another ${this.registeredIds[L]}`);if(A!==void 0){if(L===A)throw new Error(`The service [${L}] cannot be placed within itself`);if(this.registeredIds[A]===void 0)throw new Error(`The service [${L}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[A]==="node")throw new Error(`The service [${L}]'s parent is not a group`)}this.registeredIds[L]="node",this.nodes[L]={id:L,type:"service",icon:b,iconText:N,title:G,edges:[],in:A}}getServices(){return Object.values(this.nodes).filter(Mr)}addJunction({id:L,in:b}){if(this.registeredIds[L]!==void 0)throw new Error(`The junction id [${L}] is already in use by another ${this.registeredIds[L]}`);if(b!==void 0){if(L===b)throw new Error(`The junction [${L}] cannot be placed within itself`);if(this.registeredIds[b]===void 0)throw new Error(`The junction [${L}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds[b]==="node")throw new Error(`The junction [${L}]'s parent is not a group`)}this.registeredIds[L]="node",this.nodes[L]={id:L,type:"junction",edges:[],in:b}}getJunctions(){return Object.values(this.nodes).filter(Or)}getNodes(){return Object.values(this.nodes)}getNode(L){return this.nodes[L]??null}addGroup({id:L,icon:b,in:A,title:G}){if(this.registeredIds?.[L]!==void 0)throw new Error(`The group id [${L}] is already in use by another ${this.registeredIds[L]}`);if(A!==void 0){if(L===A)throw new Error(`The group [${L}] cannot be placed within itself`);if(this.registeredIds?.[A]===void 0)throw new Error(`The group [${L}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds?.[A]==="node")throw new Error(`The group [${L}]'s parent is not a group`)}this.registeredIds[L]="group",this.groups[L]={id:L,icon:b,title:G,in:A}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:L,rhsId:b,lhsDir:A,rhsDir:G,lhsInto:N,rhsInto:v,lhsGroup:h,rhsGroup:i,title:r}){if(!Re(A))throw new Error(`Invalid direction given for left hand side of edge ${L}--${b}. Expected (L,R,T,B) got ${String(A)}`);if(!Re(G))throw new Error(`Invalid direction given for right hand side of edge ${L}--${b}. Expected (L,R,T,B) got ${String(G)}`);if(this.nodes[L]===void 0&&this.groups[L]===void 0)throw new Error(`The left-hand id [${L}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[b]===void 0&&this.groups[b]===void 0)throw new Error(`The right-hand id [${b}] does not yet exist. Please create the service/group before declaring an edge to it.`);const a=this.nodes[L].in,f=this.nodes[b].in;if(h&&a&&f&&a==f)throw new Error(`The left-hand id [${L}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(i&&a&&f&&a==f)throw new Error(`The right-hand id [${b}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const e={lhsId:L,lhsDir:A,lhsInto:N,lhsGroup:h,rhsId:b,rhsDir:G,rhsInto:v,rhsGroup:i,title:r};this.edges.push(e),this.nodes[L]&&this.nodes[b]&&(this.nodes[L].edges.push(this.edges[this.edges.length-1]),this.nodes[b].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}addLayoutHint(L){if(L.members.length<2)throw new Error(`An align directive requires at least two members; got ${L.members.length}`);const b=new Set;L.members.forEach(A=>{if(this.registeredIds[A]!=="node")throw new Error(`align ${L.direction} references [${A}], which is not a service or junction`);if(b.has(A))throw new Error(`align ${L.direction} lists [${A}] more than once`);b.add(A)}),this.layoutHints.push(L)}getLayoutHints(){return this.layoutHints}getDataStructures(){if(this.dataStructures===void 0){const L={},b=Object.entries(this.nodes).reduce((i,[r,a])=>(i[r]=a.edges.reduce((f,e)=>{const u=this.getNode(e.lhsId)?.in,t=this.getNode(e.rhsId)?.in;if(u&&t&&u!==t){const s=Ar(e.lhsDir,e.rhsDir);s!=="bend"&&(L[u]??={},L[u][t]=s,L[t]??={},L[t][u]=s)}if(e.lhsId===r){const s=pe(e.lhsDir,e.rhsDir);s&&(f[s]=e.rhsId)}else{const s=pe(e.rhsDir,e.lhsDir);s&&(f[s]=e.lhsId)}return f},{}),i),{}),A=Object.keys(b)[0],G={[A]:1},N=Object.keys(b).reduce((i,r)=>r===A?i:{...i,[r]:1},{}),v=gt(i=>{const r={[i]:[0,0]},a=[i];for(;a.length>0;){const f=a.shift();if(f){G[f]=1,delete N[f];const e=b[f],[u,t]=r[f];Object.entries(e).forEach(([s,o])=>{G[o]||(r[o]=Cr([u,t],s),a.push(o))})}}return r},"BFS"),h=[v(A)];for(;Object.keys(N).length>0;)h.push(v(Object.keys(N)[0]));this.dataStructures={adjList:b,spatialMaps:h,groupAlignments:L}}return this.dataStructures}setElementForId(L,b){this.elements[L]=b}getElementById(L){return this.elements[L]}getConfig(){return rr({...Dr,...ir().architecture})}getConfigField(L){return this.getConfig()[L]}},xr=gt((L,b)=>{ke(L,b),L.groups.map(A=>b.addGroup(A)),L.services.map(A=>b.addService({...A,type:"service"})),L.junctions.map(A=>b.addJunction({...A,type:"junction"})),L.edges.map(A=>b.addEdge(A)),L.alignments?.map(A=>b.addLayoutHint({direction:A.direction,members:[...A.members]}))},"populateDb"),Ge={parser:{yy:void 0},parse:gt(async L=>{const b=await fr("architecture",L);Se.debug(b);const A=Ge.parser?.yy;if(!(A instanceof Pe))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");xr(b,A)},"parse")},Ir=gt(L=>` .edge { stroke-width: ${L.archEdgeWidth}; stroke: ${L.archEdgeColor}; diff --git a/apps/kimi-code/dist-web/assets/blockDiagram-677ZJIJ3-DeafJYAk.js b/apps/kimi-code/dist-web/assets/blockDiagram-677ZJIJ3-fPyJR28f.js similarity index 99% rename from apps/kimi-code/dist-web/assets/blockDiagram-677ZJIJ3-DeafJYAk.js rename to apps/kimi-code/dist-web/assets/blockDiagram-677ZJIJ3-fPyJR28f.js index 4cda4354cb..71266bc5f8 100644 --- a/apps/kimi-code/dist-web/assets/blockDiagram-677ZJIJ3-DeafJYAk.js +++ b/apps/kimi-code/dist-web/assets/blockDiagram-677ZJIJ3-fPyJR28f.js @@ -1,4 +1,4 @@ -import{g as de}from"./chunk-5VM5RSS4-BRWxG5tM.js";import{aA as pe,aB as Kt,aC as fe,aD as xe,aE as ye,aF as be,aG as we,aH as me,aI as Se,aJ as Le,aK as ke,aL as ve,aM as Ee,aN as _e,aO as Te,aP as De,aQ as Be,aR as Ne,aS as Ie,aT as Ce,aU as Oe,aV as Re,aW as Ae,aX as ze,aY as Me,_ as g,y as rt,d as D,e as Pe,l as k,p as Fe,r as We,c as R,aZ as Ye,a7 as He,a8 as Ke,L as Ue,a_ as M,a$ as kt,b0 as Q,as as Xe,x as $,k as Ve,b1 as je,i as Ct,b2 as Ot,b3 as Ge}from"./mermaid.core-CqiFQExc.js";import{G as Ze}from"./graph-DOmOIIwC.js";import{c as qe}from"./channel-B8eMh4sk.js";import"./index--0t1wzw_.js";import"./_commonjsHelpers-CqkleIqs.js";function Je(e){return Array.isArray(e)}function Qe(e){if(pe(e))return e;const t=Kt(e);if(!$e(e))return{};if(Je(e)){const s=Array.from(e);return e.length>0&&typeof e[0]=="string"&&Object.hasOwn(e,"index")&&(s.index=e.index,s.input=e.input),s}if(fe(e)){const s=e,i=s.constructor;return new i(s.buffer,s.byteOffset,s.length)}if(t==="[object ArrayBuffer]")return new ArrayBuffer(e.byteLength);if(t==="[object DataView]"){const s=e,i=s.buffer,c=s.byteOffset,r=s.byteLength,n=new ArrayBuffer(r),l=new Uint8Array(i,c,r);return new Uint8Array(n).set(l),new DataView(n)}if(t==="[object Boolean]"||t==="[object Number]"||t==="[object String]"){const s=e.constructor,i=new s(e.valueOf());return t==="[object String]"?er(i,e):xt(i,e),i}if(t==="[object Date]")return new Date(Number(e));if(t==="[object RegExp]"){const s=e,i=new RegExp(s.source,s.flags);return i.lastIndex=s.lastIndex,i}if(t==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(e));if(t==="[object Map]"){const s=e,i=new Map;return s.forEach((c,r)=>{i.set(r,c)}),i}if(t==="[object Set]"){const s=e,i=new Set;return s.forEach(c=>{i.add(c)}),i}if(t==="[object Arguments]"){const s=e,i={};return xt(i,s),i.length=s.length,i[Symbol.iterator]=s[Symbol.iterator],i}const a={};return rr(a,e),xt(a,e),tr(a,e),a}function $e(e){switch(Kt(e)){case Me:case ze:case Ae:case Re:case Oe:case Ce:case Ie:case Ne:case Be:case De:case Te:case _e:case Ee:case ve:case ke:case Le:case Se:case me:case we:case be:case ye:case xe:return!0;default:return!1}}function xt(e,t){for(const a in t)Object.hasOwn(t,a)&&(e[a]=t[a])}function tr(e,t){const a=Object.getOwnPropertySymbols(t);for(let s=0;s=a)&&(e[s]=t[s])}function rr(e,t){const a=Object.getPrototypeOf(t);a!==null&&typeof t.constructor=="function"&&Object.setPrototypeOf(e,a)}var bt=(function(){var e=g(function(T,m,p,x){for(p=p||{},x=T.length;x--;p[T[x]]=m);return p},"o"),t=[1,15],a=[1,7],s=[1,13],i=[1,14],c=[1,19],r=[1,16],n=[1,17],l=[1,18],u=[8,30],h=[8,10,21,28,29,30,31,39,43,46],d=[1,23],b=[1,24],w=[8,10,15,16,21,28,29,30,31,39,43,46],y=[8,10,15,16,21,27,28,29,30,31,39,43,46],v=[1,49],S={trace:g(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:g(function(m,p,x,L,E,o,F){var f=o.length-1;switch(E){case 4:L.getLogger().debug("Rule: separator (NL) ");break;case 5:L.getLogger().debug("Rule: separator (Space) ");break;case 6:L.getLogger().debug("Rule: separator (EOF) ");break;case 7:L.getLogger().debug("Rule: hierarchy: ",o[f-1]),L.setHierarchy(o[f-1]);break;case 8:L.getLogger().debug("Stop NL ");break;case 9:L.getLogger().debug("Stop EOF ");break;case 10:L.getLogger().debug("Stop NL2 ");break;case 11:L.getLogger().debug("Stop EOF2 ");break;case 12:L.getLogger().debug("Rule: statement: ",o[f]),typeof o[f].length=="number"?this.$=o[f]:this.$=[o[f]];break;case 13:L.getLogger().debug("Rule: statement #2: ",o[f-1]),this.$=[o[f-1]].concat(o[f]);break;case 14:L.getLogger().debug("Rule: link: ",o[f],m),this.$={edgeTypeStr:o[f],label:""};break;case 15:L.getLogger().debug("Rule: LABEL link: ",o[f-3],o[f-1],o[f]),this.$={edgeTypeStr:o[f],label:o[f-1]};break;case 18:const C=parseInt(o[f]),Z=L.generateId();this.$={id:Z,type:"space",label:"",width:C,children:[]};break;case 23:L.getLogger().debug("Rule: (nodeStatement link node) ",o[f-2],o[f-1],o[f]," typestr: ",o[f-1].edgeTypeStr);const V=L.edgeStrToEdgeData(o[f-1].edgeTypeStr),at=L.edgeStrToEdgeStartData(o[f-1].edgeTypeStr),gt=L.edgeStrToThickness(o[f-1].edgeTypeStr),O=L.edgeStrToPattern(o[f-1].edgeTypeStr);this.$=[{id:o[f-2].id,label:o[f-2].label,type:o[f-2].type,directions:o[f-2].directions},{id:o[f-2].id+"-"+o[f].id,start:o[f-2].id,end:o[f].id,label:o[f-1].label,type:"edge",thickness:gt,pattern:O,directions:o[f].directions,arrowTypeEnd:V,arrowTypeStart:at},{id:o[f].id,label:o[f].label,type:L.typeStr2Type(o[f].typeStr),directions:o[f].directions}];break;case 24:L.getLogger().debug("Rule: nodeStatement (abc88 node size) ",o[f-1],o[f]),this.$={id:o[f-1].id,label:o[f-1].label,type:L.typeStr2Type(o[f-1].typeStr),directions:o[f-1].directions,widthInColumns:parseInt(o[f],10)};break;case 25:L.getLogger().debug("Rule: nodeStatement (node) ",o[f]),this.$={id:o[f].id,label:o[f].label,type:L.typeStr2Type(o[f].typeStr),directions:o[f].directions,widthInColumns:1};break;case 26:L.getLogger().debug("APA123",this?this:"na"),L.getLogger().debug("COLUMNS: ",o[f]),this.$={type:"column-setting",columns:o[f]==="auto"?-1:parseInt(o[f])};break;case 27:L.getLogger().debug("Rule: id-block statement : ",o[f-2],o[f-1]),L.generateId(),this.$={...o[f-2],type:"composite",children:o[f-1]};break;case 28:L.getLogger().debug("Rule: blockStatement : ",o[f-2],o[f-1],o[f]);const j=L.generateId();this.$={id:j,type:"composite",label:"",children:o[f-1]};break;case 29:L.getLogger().debug("Rule: node (NODE_ID separator): ",o[f]),this.$={id:o[f]};break;case 30:L.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",o[f-1],o[f]),this.$={id:o[f-1],label:o[f].label,typeStr:o[f].typeStr,directions:o[f].directions};break;case 31:L.getLogger().debug("Rule: dirList: ",o[f]),this.$=[o[f]];break;case 32:L.getLogger().debug("Rule: dirList: ",o[f-1],o[f]),this.$=[o[f-1]].concat(o[f]);break;case 33:L.getLogger().debug("Rule: nodeShapeNLabel: ",o[f-2],o[f-1],o[f]),this.$={typeStr:o[f-2]+o[f],label:o[f-1]};break;case 34:L.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",o[f-3],o[f-2]," #3:",o[f-1],o[f]),this.$={typeStr:o[f-3]+o[f],label:o[f-2],directions:o[f-1]};break;case 35:case 36:this.$={type:"classDef",id:o[f-1].trim(),css:o[f].trim()};break;case 37:this.$={type:"applyClass",id:o[f-1].trim(),styleClass:o[f].trim()};break;case 38:this.$={type:"applyStyles",id:o[f-1].trim(),stylesStr:o[f].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:t,11:3,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{8:[1,20]},e(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:t,21:a,28:s,29:i,31:c,39:r,43:n,46:l}),e(h,[2,16],{14:22,15:d,16:b}),e(h,[2,17]),e(h,[2,18]),e(h,[2,19]),e(h,[2,20]),e(h,[2,21]),e(h,[2,22]),e(w,[2,25],{27:[1,25]}),e(h,[2,26]),{19:26,26:12,31:c},{10:t,11:27,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(y,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(u,[2,13]),{26:35,31:c},{31:[2,14]},{17:[1,36]},e(w,[2,24]),{10:t,11:37,13:4,14:22,15:d,16:b,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(y,[2,30]),{18:[1,43]},{18:[1,44]},e(w,[2,23]),{18:[1,45]},{30:[1,46]},e(h,[2,28]),e(h,[2,35]),e(h,[2,36]),e(h,[2,37]),e(h,[2,38]),{36:[1,47]},{33:48,34:v},{15:[1,50]},e(h,[2,27]),e(y,[2,33]),{38:[1,51]},{33:52,34:v,38:[2,31]},{31:[2,15]},e(y,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:g(function(m,p){if(p.recoverable)this.trace(m);else{var x=new Error(m);throw x.hash=p,x}},"parseError"),parse:g(function(m){var p=this,x=[0],L=[],E=[null],o=[],F=this.table,f="",C=0,Z=0,V=2,at=1,gt=o.slice.call(arguments,1),O=Object.create(this.lexer),j={yy:{}};for(var ut in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ut)&&(j.yy[ut]=this.yy[ut]);O.setInput(m,j.yy),j.yy.lexer=O,j.yy.parser=this,typeof O.yylloc>"u"&&(O.yylloc={});var dt=O.yylloc;o.push(dt);var ge=O.options&&O.options.ranges;typeof j.yy.parseError=="function"?this.parseError=j.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ue(W){x.length=x.length-2*W,E.length=E.length-W,o.length=o.length-W}g(ue,"popStack");function Nt(){var W;return W=L.pop()||O.lex()||at,typeof W!="number"&&(W instanceof Array&&(L=W,W=L.pop()),W=p.symbols_[W]||W),W}g(Nt,"lex");for(var P,q,H,pt,J={},st,G,It,it;;){if(q=x[x.length-1],this.defaultActions[q]?H=this.defaultActions[q]:((P===null||typeof P>"u")&&(P=Nt()),H=F[q]&&F[q][P]),typeof H>"u"||!H.length||!H[0]){var ft="";it=[];for(st in F[q])this.terminals_[st]&&st>V&&it.push("'"+this.terminals_[st]+"'");O.showPosition?ft="Parse error on line "+(C+1)+`: +import{g as de}from"./chunk-5VM5RSS4-BJR-VYAu.js";import{aA as pe,aB as Kt,aC as fe,aD as xe,aE as ye,aF as be,aG as we,aH as me,aI as Se,aJ as Le,aK as ke,aL as ve,aM as Ee,aN as _e,aO as Te,aP as De,aQ as Be,aR as Ne,aS as Ie,aT as Ce,aU as Oe,aV as Re,aW as Ae,aX as ze,aY as Me,_ as g,y as rt,d as D,e as Pe,l as k,p as Fe,r as We,c as R,aZ as Ye,a7 as He,a8 as Ke,L as Ue,a_ as M,a$ as kt,b0 as Q,as as Xe,x as $,k as Ve,b1 as je,i as Ct,b2 as Ot,b3 as Ge}from"./mermaid.core-WW7RuneT.js";import{G as Ze}from"./graph-DOmOIIwC.js";import{c as qe}from"./channel-8Bt6a0tz.js";import"./index-CiHMlsuo.js";import"./_commonjsHelpers-CqkleIqs.js";function Je(e){return Array.isArray(e)}function Qe(e){if(pe(e))return e;const t=Kt(e);if(!$e(e))return{};if(Je(e)){const s=Array.from(e);return e.length>0&&typeof e[0]=="string"&&Object.hasOwn(e,"index")&&(s.index=e.index,s.input=e.input),s}if(fe(e)){const s=e,i=s.constructor;return new i(s.buffer,s.byteOffset,s.length)}if(t==="[object ArrayBuffer]")return new ArrayBuffer(e.byteLength);if(t==="[object DataView]"){const s=e,i=s.buffer,c=s.byteOffset,r=s.byteLength,n=new ArrayBuffer(r),l=new Uint8Array(i,c,r);return new Uint8Array(n).set(l),new DataView(n)}if(t==="[object Boolean]"||t==="[object Number]"||t==="[object String]"){const s=e.constructor,i=new s(e.valueOf());return t==="[object String]"?er(i,e):xt(i,e),i}if(t==="[object Date]")return new Date(Number(e));if(t==="[object RegExp]"){const s=e,i=new RegExp(s.source,s.flags);return i.lastIndex=s.lastIndex,i}if(t==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(e));if(t==="[object Map]"){const s=e,i=new Map;return s.forEach((c,r)=>{i.set(r,c)}),i}if(t==="[object Set]"){const s=e,i=new Set;return s.forEach(c=>{i.add(c)}),i}if(t==="[object Arguments]"){const s=e,i={};return xt(i,s),i.length=s.length,i[Symbol.iterator]=s[Symbol.iterator],i}const a={};return rr(a,e),xt(a,e),tr(a,e),a}function $e(e){switch(Kt(e)){case Me:case ze:case Ae:case Re:case Oe:case Ce:case Ie:case Ne:case Be:case De:case Te:case _e:case Ee:case ve:case ke:case Le:case Se:case me:case we:case be:case ye:case xe:return!0;default:return!1}}function xt(e,t){for(const a in t)Object.hasOwn(t,a)&&(e[a]=t[a])}function tr(e,t){const a=Object.getOwnPropertySymbols(t);for(let s=0;s=a)&&(e[s]=t[s])}function rr(e,t){const a=Object.getPrototypeOf(t);a!==null&&typeof t.constructor=="function"&&Object.setPrototypeOf(e,a)}var bt=(function(){var e=g(function(T,m,p,x){for(p=p||{},x=T.length;x--;p[T[x]]=m);return p},"o"),t=[1,15],a=[1,7],s=[1,13],i=[1,14],c=[1,19],r=[1,16],n=[1,17],l=[1,18],u=[8,30],h=[8,10,21,28,29,30,31,39,43,46],d=[1,23],b=[1,24],w=[8,10,15,16,21,28,29,30,31,39,43,46],y=[8,10,15,16,21,27,28,29,30,31,39,43,46],v=[1,49],S={trace:g(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:g(function(m,p,x,L,E,o,F){var f=o.length-1;switch(E){case 4:L.getLogger().debug("Rule: separator (NL) ");break;case 5:L.getLogger().debug("Rule: separator (Space) ");break;case 6:L.getLogger().debug("Rule: separator (EOF) ");break;case 7:L.getLogger().debug("Rule: hierarchy: ",o[f-1]),L.setHierarchy(o[f-1]);break;case 8:L.getLogger().debug("Stop NL ");break;case 9:L.getLogger().debug("Stop EOF ");break;case 10:L.getLogger().debug("Stop NL2 ");break;case 11:L.getLogger().debug("Stop EOF2 ");break;case 12:L.getLogger().debug("Rule: statement: ",o[f]),typeof o[f].length=="number"?this.$=o[f]:this.$=[o[f]];break;case 13:L.getLogger().debug("Rule: statement #2: ",o[f-1]),this.$=[o[f-1]].concat(o[f]);break;case 14:L.getLogger().debug("Rule: link: ",o[f],m),this.$={edgeTypeStr:o[f],label:""};break;case 15:L.getLogger().debug("Rule: LABEL link: ",o[f-3],o[f-1],o[f]),this.$={edgeTypeStr:o[f],label:o[f-1]};break;case 18:const C=parseInt(o[f]),Z=L.generateId();this.$={id:Z,type:"space",label:"",width:C,children:[]};break;case 23:L.getLogger().debug("Rule: (nodeStatement link node) ",o[f-2],o[f-1],o[f]," typestr: ",o[f-1].edgeTypeStr);const V=L.edgeStrToEdgeData(o[f-1].edgeTypeStr),at=L.edgeStrToEdgeStartData(o[f-1].edgeTypeStr),gt=L.edgeStrToThickness(o[f-1].edgeTypeStr),O=L.edgeStrToPattern(o[f-1].edgeTypeStr);this.$=[{id:o[f-2].id,label:o[f-2].label,type:o[f-2].type,directions:o[f-2].directions},{id:o[f-2].id+"-"+o[f].id,start:o[f-2].id,end:o[f].id,label:o[f-1].label,type:"edge",thickness:gt,pattern:O,directions:o[f].directions,arrowTypeEnd:V,arrowTypeStart:at},{id:o[f].id,label:o[f].label,type:L.typeStr2Type(o[f].typeStr),directions:o[f].directions}];break;case 24:L.getLogger().debug("Rule: nodeStatement (abc88 node size) ",o[f-1],o[f]),this.$={id:o[f-1].id,label:o[f-1].label,type:L.typeStr2Type(o[f-1].typeStr),directions:o[f-1].directions,widthInColumns:parseInt(o[f],10)};break;case 25:L.getLogger().debug("Rule: nodeStatement (node) ",o[f]),this.$={id:o[f].id,label:o[f].label,type:L.typeStr2Type(o[f].typeStr),directions:o[f].directions,widthInColumns:1};break;case 26:L.getLogger().debug("APA123",this?this:"na"),L.getLogger().debug("COLUMNS: ",o[f]),this.$={type:"column-setting",columns:o[f]==="auto"?-1:parseInt(o[f])};break;case 27:L.getLogger().debug("Rule: id-block statement : ",o[f-2],o[f-1]),L.generateId(),this.$={...o[f-2],type:"composite",children:o[f-1]};break;case 28:L.getLogger().debug("Rule: blockStatement : ",o[f-2],o[f-1],o[f]);const j=L.generateId();this.$={id:j,type:"composite",label:"",children:o[f-1]};break;case 29:L.getLogger().debug("Rule: node (NODE_ID separator): ",o[f]),this.$={id:o[f]};break;case 30:L.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",o[f-1],o[f]),this.$={id:o[f-1],label:o[f].label,typeStr:o[f].typeStr,directions:o[f].directions};break;case 31:L.getLogger().debug("Rule: dirList: ",o[f]),this.$=[o[f]];break;case 32:L.getLogger().debug("Rule: dirList: ",o[f-1],o[f]),this.$=[o[f-1]].concat(o[f]);break;case 33:L.getLogger().debug("Rule: nodeShapeNLabel: ",o[f-2],o[f-1],o[f]),this.$={typeStr:o[f-2]+o[f],label:o[f-1]};break;case 34:L.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",o[f-3],o[f-2]," #3:",o[f-1],o[f]),this.$={typeStr:o[f-3]+o[f],label:o[f-2],directions:o[f-1]};break;case 35:case 36:this.$={type:"classDef",id:o[f-1].trim(),css:o[f].trim()};break;case 37:this.$={type:"applyClass",id:o[f-1].trim(),styleClass:o[f].trim()};break;case 38:this.$={type:"applyStyles",id:o[f-1].trim(),stylesStr:o[f].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:t,11:3,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{8:[1,20]},e(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:t,21:a,28:s,29:i,31:c,39:r,43:n,46:l}),e(h,[2,16],{14:22,15:d,16:b}),e(h,[2,17]),e(h,[2,18]),e(h,[2,19]),e(h,[2,20]),e(h,[2,21]),e(h,[2,22]),e(w,[2,25],{27:[1,25]}),e(h,[2,26]),{19:26,26:12,31:c},{10:t,11:27,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(y,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(u,[2,13]),{26:35,31:c},{31:[2,14]},{17:[1,36]},e(w,[2,24]),{10:t,11:37,13:4,14:22,15:d,16:b,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(y,[2,30]),{18:[1,43]},{18:[1,44]},e(w,[2,23]),{18:[1,45]},{30:[1,46]},e(h,[2,28]),e(h,[2,35]),e(h,[2,36]),e(h,[2,37]),e(h,[2,38]),{36:[1,47]},{33:48,34:v},{15:[1,50]},e(h,[2,27]),e(y,[2,33]),{38:[1,51]},{33:52,34:v,38:[2,31]},{31:[2,15]},e(y,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:g(function(m,p){if(p.recoverable)this.trace(m);else{var x=new Error(m);throw x.hash=p,x}},"parseError"),parse:g(function(m){var p=this,x=[0],L=[],E=[null],o=[],F=this.table,f="",C=0,Z=0,V=2,at=1,gt=o.slice.call(arguments,1),O=Object.create(this.lexer),j={yy:{}};for(var ut in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ut)&&(j.yy[ut]=this.yy[ut]);O.setInput(m,j.yy),j.yy.lexer=O,j.yy.parser=this,typeof O.yylloc>"u"&&(O.yylloc={});var dt=O.yylloc;o.push(dt);var ge=O.options&&O.options.ranges;typeof j.yy.parseError=="function"?this.parseError=j.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ue(W){x.length=x.length-2*W,E.length=E.length-W,o.length=o.length-W}g(ue,"popStack");function Nt(){var W;return W=L.pop()||O.lex()||at,typeof W!="number"&&(W instanceof Array&&(L=W,W=L.pop()),W=p.symbols_[W]||W),W}g(Nt,"lex");for(var P,q,H,pt,J={},st,G,It,it;;){if(q=x[x.length-1],this.defaultActions[q]?H=this.defaultActions[q]:((P===null||typeof P>"u")&&(P=Nt()),H=F[q]&&F[q][P]),typeof H>"u"||!H.length||!H[0]){var ft="";it=[];for(st in F[q])this.terminals_[st]&&st>V&&it.push("'"+this.terminals_[st]+"'");O.showPosition?ft="Parse error on line "+(C+1)+`: `+O.showPosition()+` Expecting `+it.join(", ")+", got '"+(this.terminals_[P]||P)+"'":ft="Parse error on line "+(C+1)+": Unexpected "+(P==at?"end of input":"'"+(this.terminals_[P]||P)+"'"),this.parseError(ft,{text:O.match,token:this.terminals_[P]||P,line:O.yylineno,loc:dt,expected:it})}if(H[0]instanceof Array&&H.length>1)throw new Error("Parse Error: multiple actions possible at state: "+q+", token: "+P);switch(H[0]){case 1:x.push(P),E.push(O.yytext),o.push(O.yylloc),x.push(H[1]),P=null,Z=O.yyleng,f=O.yytext,C=O.yylineno,dt=O.yylloc;break;case 2:if(G=this.productions_[H[1]][1],J.$=E[E.length-G],J._$={first_line:o[o.length-(G||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(G||1)].first_column,last_column:o[o.length-1].last_column},ge&&(J._$.range=[o[o.length-(G||1)].range[0],o[o.length-1].range[1]]),pt=this.performAction.apply(J,[f,Z,C,j.yy,H[1],E,o].concat(gt)),typeof pt<"u")return pt;G&&(x=x.slice(0,-1*G*2),E=E.slice(0,-1*G),o=o.slice(0,-1*G)),x.push(this.productions_[H[1]][0]),E.push(J.$),o.push(J._$),It=F[x[x.length-2]][x[x.length-1]],x.push(It);break;case 3:return!0}}return!0},"parse")},N=(function(){var T={EOF:1,parseError:g(function(p,x){if(this.yy.parser)this.yy.parser.parseError(p,x);else throw new Error(p)},"parseError"),setInput:g(function(m,p){return this.yy=p||this.yy||{},this._input=m,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:g(function(){var m=this._input[0];this.yytext+=m,this.yyleng++,this.offset++,this.match+=m,this.matched+=m;var p=m.match(/(?:\r\n?|\n).*/g);return p?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),m},"input"),unput:g(function(m){var p=m.length,x=m.split(/(?:\r\n?|\n)/g);this._input=m+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-p),this.offset-=p;var L=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),x.length-1&&(this.yylineno-=x.length-1);var E=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:x?(x.length===L.length?this.yylloc.first_column:0)+L[L.length-x.length].length-x[0].length:this.yylloc.first_column-p},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-p]),this.yyleng=this.yytext.length,this},"unput"),more:g(function(){return this._more=!0,this},"more"),reject:g(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:g(function(m){this.unput(this.match.slice(m))},"less"),pastInput:g(function(){var m=this.matched.substr(0,this.matched.length-this.match.length);return(m.length>20?"...":"")+m.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:g(function(){var m=this.match;return m.length<20&&(m+=this._input.substr(0,20-m.length)),(m.substr(0,20)+(m.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:g(function(){var m=this.pastInput(),p=new Array(m.length+1).join("-");return m+this.upcomingInput()+` diff --git a/apps/kimi-code/dist-web/assets/c4Diagram-LMCZKHZV-oGCYLt-v.js b/apps/kimi-code/dist-web/assets/c4Diagram-LMCZKHZV-BAAq1RMs.js similarity index 99% rename from apps/kimi-code/dist-web/assets/c4Diagram-LMCZKHZV-oGCYLt-v.js rename to apps/kimi-code/dist-web/assets/c4Diagram-LMCZKHZV-BAAq1RMs.js index ad74b888a3..5395daf7ee 100644 --- a/apps/kimi-code/dist-web/assets/c4Diagram-LMCZKHZV-oGCYLt-v.js +++ b/apps/kimi-code/dist-web/assets/c4Diagram-LMCZKHZV-BAAq1RMs.js @@ -1,4 +1,4 @@ -import{g as Oe,d as Re}from"./chunk-32BRIVSS-mfMW4-bV.js";import{s as Se,g as De,a as Pe,b as Be,_ as y,c as Dt,d as Nt,l as he,e as Ie,f as Me,h as Tt,i as pe,j as Le,w as Ne,k as Jt,m as ue}from"./mermaid.core-CqiFQExc.js";import"./index--0t1wzw_.js";import"./_commonjsHelpers-CqkleIqs.js";var jt=(function(){var e=y(function(_t,x,v,E){for(v=v||{},E=_t.length;E--;v[_t[E]]=x);return v},"o"),t=[1,24],s=[1,25],o=[1,26],l=[1,27],r=[1,28],a=[1,63],n=[1,64],i=[1,65],u=[1,66],d=[1,67],p=[1,68],g=[1,69],m=[1,29],O=[1,30],S=[1,31],P=[1,32],M=[1,33],U=[1,34],H=[1,35],q=[1,36],G=[1,37],K=[1,38],J=[1,39],Z=[1,40],$=[1,41],tt=[1,42],et=[1,43],at=[1,44],it=[1,45],nt=[1,46],st=[1,47],rt=[1,48],lt=[1,50],ot=[1,51],ct=[1,52],ht=[1,53],ut=[1,54],dt=[1,55],ft=[1,56],pt=[1,57],yt=[1,58],gt=[1,59],bt=[1,60],Ct=[14,42],Xt=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Ot=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],A=[1,82],k=[1,83],C=[1,84],w=[1,85],T=[12,14,42],se=[12,14,33,42],Bt=[12,14,33,42,76,77,79,80],vt=[12,33],Wt=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Qt={trace:y(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:y(function(x,v,E,b,R,h,Rt){var f=h.length-1;switch(R){case 3:b.setDirection("TB");break;case 4:b.setDirection("BT");break;case 5:b.setDirection("RL");break;case 6:b.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:b.setC4Type(h[f-3]);break;case 19:b.setTitle(h[f].substring(6)),this.$=h[f].substring(6);break;case 20:b.setAccDescription(h[f].substring(15)),this.$=h[f].substring(15);break;case 21:this.$=h[f].trim(),b.setTitle(this.$);break;case 22:case 23:this.$=h[f].trim(),b.setAccDescription(this.$);break;case 28:h[f].splice(2,0,"ENTERPRISE"),b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 29:h[f].splice(2,0,"SYSTEM"),b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 30:b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 31:h[f].splice(2,0,"CONTAINER"),b.addContainerBoundary(...h[f]),this.$=h[f];break;case 32:b.addDeploymentNode("node",...h[f]),this.$=h[f];break;case 33:b.addDeploymentNode("nodeL",...h[f]),this.$=h[f];break;case 34:b.addDeploymentNode("nodeR",...h[f]),this.$=h[f];break;case 35:b.popBoundaryParseStack();break;case 39:b.addPersonOrSystem("person",...h[f]),this.$=h[f];break;case 40:b.addPersonOrSystem("external_person",...h[f]),this.$=h[f];break;case 41:b.addPersonOrSystem("system",...h[f]),this.$=h[f];break;case 42:b.addPersonOrSystem("system_db",...h[f]),this.$=h[f];break;case 43:b.addPersonOrSystem("system_queue",...h[f]),this.$=h[f];break;case 44:b.addPersonOrSystem("external_system",...h[f]),this.$=h[f];break;case 45:b.addPersonOrSystem("external_system_db",...h[f]),this.$=h[f];break;case 46:b.addPersonOrSystem("external_system_queue",...h[f]),this.$=h[f];break;case 47:b.addContainer("container",...h[f]),this.$=h[f];break;case 48:b.addContainer("container_db",...h[f]),this.$=h[f];break;case 49:b.addContainer("container_queue",...h[f]),this.$=h[f];break;case 50:b.addContainer("external_container",...h[f]),this.$=h[f];break;case 51:b.addContainer("external_container_db",...h[f]),this.$=h[f];break;case 52:b.addContainer("external_container_queue",...h[f]),this.$=h[f];break;case 53:b.addComponent("component",...h[f]),this.$=h[f];break;case 54:b.addComponent("component_db",...h[f]),this.$=h[f];break;case 55:b.addComponent("component_queue",...h[f]),this.$=h[f];break;case 56:b.addComponent("external_component",...h[f]),this.$=h[f];break;case 57:b.addComponent("external_component_db",...h[f]),this.$=h[f];break;case 58:b.addComponent("external_component_queue",...h[f]),this.$=h[f];break;case 60:b.addRel("rel",...h[f]),this.$=h[f];break;case 61:b.addRel("birel",...h[f]),this.$=h[f];break;case 62:b.addRel("rel_u",...h[f]),this.$=h[f];break;case 63:b.addRel("rel_d",...h[f]),this.$=h[f];break;case 64:b.addRel("rel_l",...h[f]),this.$=h[f];break;case 65:b.addRel("rel_r",...h[f]),this.$=h[f];break;case 66:b.addRel("rel_b",...h[f]),this.$=h[f];break;case 67:h[f].splice(0,1),b.addRel("rel",...h[f]),this.$=h[f];break;case 68:b.updateElStyle("update_el_style",...h[f]),this.$=h[f];break;case 69:b.updateRelStyle("update_rel_style",...h[f]),this.$=h[f];break;case 70:b.updateLayoutConfig("update_layout_config",...h[f]),this.$=h[f];break;case 71:this.$=[h[f]];break;case 72:h[f].unshift(h[f-1]),this.$=h[f];break;case 73:case 75:this.$=h[f].trim();break;case 74:let Et={};Et[h[f-1].trim()]=h[f].trim(),this.$=Et;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:70,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:71,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:72,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:73,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{14:[1,74]},e(Ct,[2,13],{43:23,29:49,30:61,32:62,20:75,34:a,36:n,37:i,38:u,39:d,40:p,41:g,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),e(Ct,[2,14]),e(Xt,[2,16],{12:[1,76]}),e(Ct,[2,36],{12:[1,77]}),e(Ot,[2,19]),e(Ot,[2,20]),{25:[1,78]},{27:[1,79]},e(Ot,[2,23]),{35:80,75:81,76:A,77:k,79:C,80:w},{35:86,75:81,76:A,77:k,79:C,80:w},{35:87,75:81,76:A,77:k,79:C,80:w},{35:88,75:81,76:A,77:k,79:C,80:w},{35:89,75:81,76:A,77:k,79:C,80:w},{35:90,75:81,76:A,77:k,79:C,80:w},{35:91,75:81,76:A,77:k,79:C,80:w},{35:92,75:81,76:A,77:k,79:C,80:w},{35:93,75:81,76:A,77:k,79:C,80:w},{35:94,75:81,76:A,77:k,79:C,80:w},{35:95,75:81,76:A,77:k,79:C,80:w},{35:96,75:81,76:A,77:k,79:C,80:w},{35:97,75:81,76:A,77:k,79:C,80:w},{35:98,75:81,76:A,77:k,79:C,80:w},{35:99,75:81,76:A,77:k,79:C,80:w},{35:100,75:81,76:A,77:k,79:C,80:w},{35:101,75:81,76:A,77:k,79:C,80:w},{35:102,75:81,76:A,77:k,79:C,80:w},{35:103,75:81,76:A,77:k,79:C,80:w},{35:104,75:81,76:A,77:k,79:C,80:w},e(T,[2,59]),{35:105,75:81,76:A,77:k,79:C,80:w},{35:106,75:81,76:A,77:k,79:C,80:w},{35:107,75:81,76:A,77:k,79:C,80:w},{35:108,75:81,76:A,77:k,79:C,80:w},{35:109,75:81,76:A,77:k,79:C,80:w},{35:110,75:81,76:A,77:k,79:C,80:w},{35:111,75:81,76:A,77:k,79:C,80:w},{35:112,75:81,76:A,77:k,79:C,80:w},{35:113,75:81,76:A,77:k,79:C,80:w},{35:114,75:81,76:A,77:k,79:C,80:w},{35:115,75:81,76:A,77:k,79:C,80:w},{20:116,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{12:[1,118],33:[1,117]},{35:119,75:81,76:A,77:k,79:C,80:w},{35:120,75:81,76:A,77:k,79:C,80:w},{35:121,75:81,76:A,77:k,79:C,80:w},{35:122,75:81,76:A,77:k,79:C,80:w},{35:123,75:81,76:A,77:k,79:C,80:w},{35:124,75:81,76:A,77:k,79:C,80:w},{35:125,75:81,76:A,77:k,79:C,80:w},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},e(Ct,[2,15]),e(Xt,[2,17],{21:22,19:130,22:t,23:s,24:o,26:l,28:r}),e(Ct,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:t,23:s,24:o,26:l,28:r,34:a,36:n,37:i,38:u,39:d,40:p,41:g,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),e(Ot,[2,21]),e(Ot,[2,22]),e(T,[2,39]),e(se,[2,71],{75:81,35:132,76:A,77:k,79:C,80:w}),e(Bt,[2,73]),{78:[1,133]},e(Bt,[2,75]),e(Bt,[2,76]),e(T,[2,40]),e(T,[2,41]),e(T,[2,42]),e(T,[2,43]),e(T,[2,44]),e(T,[2,45]),e(T,[2,46]),e(T,[2,47]),e(T,[2,48]),e(T,[2,49]),e(T,[2,50]),e(T,[2,51]),e(T,[2,52]),e(T,[2,53]),e(T,[2,54]),e(T,[2,55]),e(T,[2,56]),e(T,[2,57]),e(T,[2,58]),e(T,[2,60]),e(T,[2,61]),e(T,[2,62]),e(T,[2,63]),e(T,[2,64]),e(T,[2,65]),e(T,[2,66]),e(T,[2,67]),e(T,[2,68]),e(T,[2,69]),e(T,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},e(vt,[2,28]),e(vt,[2,29]),e(vt,[2,30]),e(vt,[2,31]),e(vt,[2,32]),e(vt,[2,33]),e(vt,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},e(Xt,[2,18]),e(Ct,[2,38]),e(se,[2,72]),e(Bt,[2,74]),e(T,[2,24]),e(T,[2,35]),e(Wt,[2,25]),e(Wt,[2,26],{12:[1,138]}),e(Wt,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:y(function(x,v){if(v.recoverable)this.trace(x);else{var E=new Error(x);throw E.hash=v,E}},"parseError"),parse:y(function(x){var v=this,E=[0],b=[],R=[null],h=[],Rt=this.table,f="",Et=0,re=0,ke=2,le=1,Ce=h.slice.call(arguments,1),D=Object.create(this.lexer),At={yy:{}};for(var Ht in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ht)&&(At.yy[Ht]=this.yy[Ht]);D.setInput(x,At.yy),At.yy.lexer=D,At.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var qt=D.yylloc;h.push(qt);var we=D.options&&D.options.ranges;typeof At.yy.parseError=="function"?this.parseError=At.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Te(L){E.length=E.length-2*L,R.length=R.length-L,h.length=h.length-L}y(Te,"popStack");function oe(){var L;return L=b.pop()||D.lex()||le,typeof L!="number"&&(L instanceof Array&&(b=L,L=b.pop()),L=v.symbols_[L]||L),L}y(oe,"lex");for(var I,kt,N,Gt,wt={},Mt,W,ce,Lt;;){if(kt=E[E.length-1],this.defaultActions[kt]?N=this.defaultActions[kt]:((I===null||typeof I>"u")&&(I=oe()),N=Rt[kt]&&Rt[kt][I]),typeof N>"u"||!N.length||!N[0]){var Kt="";Lt=[];for(Mt in Rt[kt])this.terminals_[Mt]&&Mt>ke&&Lt.push("'"+this.terminals_[Mt]+"'");D.showPosition?Kt="Parse error on line "+(Et+1)+`: +import{g as Oe,d as Re}from"./chunk-32BRIVSS-CRTrWqUr.js";import{s as Se,g as De,a as Pe,b as Be,_ as y,c as Dt,d as Nt,l as he,e as Ie,f as Me,h as Tt,i as pe,j as Le,w as Ne,k as Jt,m as ue}from"./mermaid.core-WW7RuneT.js";import"./index-CiHMlsuo.js";import"./_commonjsHelpers-CqkleIqs.js";var jt=(function(){var e=y(function(_t,x,v,E){for(v=v||{},E=_t.length;E--;v[_t[E]]=x);return v},"o"),t=[1,24],s=[1,25],o=[1,26],l=[1,27],r=[1,28],a=[1,63],n=[1,64],i=[1,65],u=[1,66],d=[1,67],p=[1,68],g=[1,69],m=[1,29],O=[1,30],S=[1,31],P=[1,32],M=[1,33],U=[1,34],H=[1,35],q=[1,36],G=[1,37],K=[1,38],J=[1,39],Z=[1,40],$=[1,41],tt=[1,42],et=[1,43],at=[1,44],it=[1,45],nt=[1,46],st=[1,47],rt=[1,48],lt=[1,50],ot=[1,51],ct=[1,52],ht=[1,53],ut=[1,54],dt=[1,55],ft=[1,56],pt=[1,57],yt=[1,58],gt=[1,59],bt=[1,60],Ct=[14,42],Xt=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Ot=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],A=[1,82],k=[1,83],C=[1,84],w=[1,85],T=[12,14,42],se=[12,14,33,42],Bt=[12,14,33,42,76,77,79,80],vt=[12,33],Wt=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Qt={trace:y(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:y(function(x,v,E,b,R,h,Rt){var f=h.length-1;switch(R){case 3:b.setDirection("TB");break;case 4:b.setDirection("BT");break;case 5:b.setDirection("RL");break;case 6:b.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:b.setC4Type(h[f-3]);break;case 19:b.setTitle(h[f].substring(6)),this.$=h[f].substring(6);break;case 20:b.setAccDescription(h[f].substring(15)),this.$=h[f].substring(15);break;case 21:this.$=h[f].trim(),b.setTitle(this.$);break;case 22:case 23:this.$=h[f].trim(),b.setAccDescription(this.$);break;case 28:h[f].splice(2,0,"ENTERPRISE"),b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 29:h[f].splice(2,0,"SYSTEM"),b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 30:b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 31:h[f].splice(2,0,"CONTAINER"),b.addContainerBoundary(...h[f]),this.$=h[f];break;case 32:b.addDeploymentNode("node",...h[f]),this.$=h[f];break;case 33:b.addDeploymentNode("nodeL",...h[f]),this.$=h[f];break;case 34:b.addDeploymentNode("nodeR",...h[f]),this.$=h[f];break;case 35:b.popBoundaryParseStack();break;case 39:b.addPersonOrSystem("person",...h[f]),this.$=h[f];break;case 40:b.addPersonOrSystem("external_person",...h[f]),this.$=h[f];break;case 41:b.addPersonOrSystem("system",...h[f]),this.$=h[f];break;case 42:b.addPersonOrSystem("system_db",...h[f]),this.$=h[f];break;case 43:b.addPersonOrSystem("system_queue",...h[f]),this.$=h[f];break;case 44:b.addPersonOrSystem("external_system",...h[f]),this.$=h[f];break;case 45:b.addPersonOrSystem("external_system_db",...h[f]),this.$=h[f];break;case 46:b.addPersonOrSystem("external_system_queue",...h[f]),this.$=h[f];break;case 47:b.addContainer("container",...h[f]),this.$=h[f];break;case 48:b.addContainer("container_db",...h[f]),this.$=h[f];break;case 49:b.addContainer("container_queue",...h[f]),this.$=h[f];break;case 50:b.addContainer("external_container",...h[f]),this.$=h[f];break;case 51:b.addContainer("external_container_db",...h[f]),this.$=h[f];break;case 52:b.addContainer("external_container_queue",...h[f]),this.$=h[f];break;case 53:b.addComponent("component",...h[f]),this.$=h[f];break;case 54:b.addComponent("component_db",...h[f]),this.$=h[f];break;case 55:b.addComponent("component_queue",...h[f]),this.$=h[f];break;case 56:b.addComponent("external_component",...h[f]),this.$=h[f];break;case 57:b.addComponent("external_component_db",...h[f]),this.$=h[f];break;case 58:b.addComponent("external_component_queue",...h[f]),this.$=h[f];break;case 60:b.addRel("rel",...h[f]),this.$=h[f];break;case 61:b.addRel("birel",...h[f]),this.$=h[f];break;case 62:b.addRel("rel_u",...h[f]),this.$=h[f];break;case 63:b.addRel("rel_d",...h[f]),this.$=h[f];break;case 64:b.addRel("rel_l",...h[f]),this.$=h[f];break;case 65:b.addRel("rel_r",...h[f]),this.$=h[f];break;case 66:b.addRel("rel_b",...h[f]),this.$=h[f];break;case 67:h[f].splice(0,1),b.addRel("rel",...h[f]),this.$=h[f];break;case 68:b.updateElStyle("update_el_style",...h[f]),this.$=h[f];break;case 69:b.updateRelStyle("update_rel_style",...h[f]),this.$=h[f];break;case 70:b.updateLayoutConfig("update_layout_config",...h[f]),this.$=h[f];break;case 71:this.$=[h[f]];break;case 72:h[f].unshift(h[f-1]),this.$=h[f];break;case 73:case 75:this.$=h[f].trim();break;case 74:let Et={};Et[h[f-1].trim()]=h[f].trim(),this.$=Et;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:70,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:71,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:72,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:73,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{14:[1,74]},e(Ct,[2,13],{43:23,29:49,30:61,32:62,20:75,34:a,36:n,37:i,38:u,39:d,40:p,41:g,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),e(Ct,[2,14]),e(Xt,[2,16],{12:[1,76]}),e(Ct,[2,36],{12:[1,77]}),e(Ot,[2,19]),e(Ot,[2,20]),{25:[1,78]},{27:[1,79]},e(Ot,[2,23]),{35:80,75:81,76:A,77:k,79:C,80:w},{35:86,75:81,76:A,77:k,79:C,80:w},{35:87,75:81,76:A,77:k,79:C,80:w},{35:88,75:81,76:A,77:k,79:C,80:w},{35:89,75:81,76:A,77:k,79:C,80:w},{35:90,75:81,76:A,77:k,79:C,80:w},{35:91,75:81,76:A,77:k,79:C,80:w},{35:92,75:81,76:A,77:k,79:C,80:w},{35:93,75:81,76:A,77:k,79:C,80:w},{35:94,75:81,76:A,77:k,79:C,80:w},{35:95,75:81,76:A,77:k,79:C,80:w},{35:96,75:81,76:A,77:k,79:C,80:w},{35:97,75:81,76:A,77:k,79:C,80:w},{35:98,75:81,76:A,77:k,79:C,80:w},{35:99,75:81,76:A,77:k,79:C,80:w},{35:100,75:81,76:A,77:k,79:C,80:w},{35:101,75:81,76:A,77:k,79:C,80:w},{35:102,75:81,76:A,77:k,79:C,80:w},{35:103,75:81,76:A,77:k,79:C,80:w},{35:104,75:81,76:A,77:k,79:C,80:w},e(T,[2,59]),{35:105,75:81,76:A,77:k,79:C,80:w},{35:106,75:81,76:A,77:k,79:C,80:w},{35:107,75:81,76:A,77:k,79:C,80:w},{35:108,75:81,76:A,77:k,79:C,80:w},{35:109,75:81,76:A,77:k,79:C,80:w},{35:110,75:81,76:A,77:k,79:C,80:w},{35:111,75:81,76:A,77:k,79:C,80:w},{35:112,75:81,76:A,77:k,79:C,80:w},{35:113,75:81,76:A,77:k,79:C,80:w},{35:114,75:81,76:A,77:k,79:C,80:w},{35:115,75:81,76:A,77:k,79:C,80:w},{20:116,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{12:[1,118],33:[1,117]},{35:119,75:81,76:A,77:k,79:C,80:w},{35:120,75:81,76:A,77:k,79:C,80:w},{35:121,75:81,76:A,77:k,79:C,80:w},{35:122,75:81,76:A,77:k,79:C,80:w},{35:123,75:81,76:A,77:k,79:C,80:w},{35:124,75:81,76:A,77:k,79:C,80:w},{35:125,75:81,76:A,77:k,79:C,80:w},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},e(Ct,[2,15]),e(Xt,[2,17],{21:22,19:130,22:t,23:s,24:o,26:l,28:r}),e(Ct,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:t,23:s,24:o,26:l,28:r,34:a,36:n,37:i,38:u,39:d,40:p,41:g,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),e(Ot,[2,21]),e(Ot,[2,22]),e(T,[2,39]),e(se,[2,71],{75:81,35:132,76:A,77:k,79:C,80:w}),e(Bt,[2,73]),{78:[1,133]},e(Bt,[2,75]),e(Bt,[2,76]),e(T,[2,40]),e(T,[2,41]),e(T,[2,42]),e(T,[2,43]),e(T,[2,44]),e(T,[2,45]),e(T,[2,46]),e(T,[2,47]),e(T,[2,48]),e(T,[2,49]),e(T,[2,50]),e(T,[2,51]),e(T,[2,52]),e(T,[2,53]),e(T,[2,54]),e(T,[2,55]),e(T,[2,56]),e(T,[2,57]),e(T,[2,58]),e(T,[2,60]),e(T,[2,61]),e(T,[2,62]),e(T,[2,63]),e(T,[2,64]),e(T,[2,65]),e(T,[2,66]),e(T,[2,67]),e(T,[2,68]),e(T,[2,69]),e(T,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},e(vt,[2,28]),e(vt,[2,29]),e(vt,[2,30]),e(vt,[2,31]),e(vt,[2,32]),e(vt,[2,33]),e(vt,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},e(Xt,[2,18]),e(Ct,[2,38]),e(se,[2,72]),e(Bt,[2,74]),e(T,[2,24]),e(T,[2,35]),e(Wt,[2,25]),e(Wt,[2,26],{12:[1,138]}),e(Wt,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:y(function(x,v){if(v.recoverable)this.trace(x);else{var E=new Error(x);throw E.hash=v,E}},"parseError"),parse:y(function(x){var v=this,E=[0],b=[],R=[null],h=[],Rt=this.table,f="",Et=0,re=0,ke=2,le=1,Ce=h.slice.call(arguments,1),D=Object.create(this.lexer),At={yy:{}};for(var Ht in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ht)&&(At.yy[Ht]=this.yy[Ht]);D.setInput(x,At.yy),At.yy.lexer=D,At.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var qt=D.yylloc;h.push(qt);var we=D.options&&D.options.ranges;typeof At.yy.parseError=="function"?this.parseError=At.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Te(L){E.length=E.length-2*L,R.length=R.length-L,h.length=h.length-L}y(Te,"popStack");function oe(){var L;return L=b.pop()||D.lex()||le,typeof L!="number"&&(L instanceof Array&&(b=L,L=b.pop()),L=v.symbols_[L]||L),L}y(oe,"lex");for(var I,kt,N,Gt,wt={},Mt,W,ce,Lt;;){if(kt=E[E.length-1],this.defaultActions[kt]?N=this.defaultActions[kt]:((I===null||typeof I>"u")&&(I=oe()),N=Rt[kt]&&Rt[kt][I]),typeof N>"u"||!N.length||!N[0]){var Kt="";Lt=[];for(Mt in Rt[kt])this.terminals_[Mt]&&Mt>ke&&Lt.push("'"+this.terminals_[Mt]+"'");D.showPosition?Kt="Parse error on line "+(Et+1)+`: `+D.showPosition()+` Expecting `+Lt.join(", ")+", got '"+(this.terminals_[I]||I)+"'":Kt="Parse error on line "+(Et+1)+": Unexpected "+(I==le?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError(Kt,{text:D.match,token:this.terminals_[I]||I,line:D.yylineno,loc:qt,expected:Lt})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+kt+", token: "+I);switch(N[0]){case 1:E.push(I),R.push(D.yytext),h.push(D.yylloc),E.push(N[1]),I=null,re=D.yyleng,f=D.yytext,Et=D.yylineno,qt=D.yylloc;break;case 2:if(W=this.productions_[N[1]][1],wt.$=R[R.length-W],wt._$={first_line:h[h.length-(W||1)].first_line,last_line:h[h.length-1].last_line,first_column:h[h.length-(W||1)].first_column,last_column:h[h.length-1].last_column},we&&(wt._$.range=[h[h.length-(W||1)].range[0],h[h.length-1].range[1]]),Gt=this.performAction.apply(wt,[f,re,Et,At.yy,N[1],R,h].concat(Ce)),typeof Gt<"u")return Gt;W&&(E=E.slice(0,-1*W*2),R=R.slice(0,-1*W),h=h.slice(0,-1*W)),E.push(this.productions_[N[1]][0]),R.push(wt.$),h.push(wt._$),ce=Rt[E[E.length-2]][E[E.length-1]],E.push(ce);break;case 3:return!0}}return!0},"parse")},Ae=(function(){var _t={EOF:1,parseError:y(function(v,E){if(this.yy.parser)this.yy.parser.parseError(v,E);else throw new Error(v)},"parseError"),setInput:y(function(x,v){return this.yy=v||this.yy||{},this._input=x,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:y(function(){var x=this._input[0];this.yytext+=x,this.yyleng++,this.offset++,this.match+=x,this.matched+=x;var v=x.match(/(?:\r\n?|\n).*/g);return v?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),x},"input"),unput:y(function(x){var v=x.length,E=x.split(/(?:\r\n?|\n)/g);this._input=x+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-v),this.offset-=v;var b=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),E.length-1&&(this.yylineno-=E.length-1);var R=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:E?(E.length===b.length?this.yylloc.first_column:0)+b[b.length-E.length].length-E[0].length:this.yylloc.first_column-v},this.options.ranges&&(this.yylloc.range=[R[0],R[0]+this.yyleng-v]),this.yyleng=this.yytext.length,this},"unput"),more:y(function(){return this._more=!0,this},"more"),reject:y(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:y(function(x){this.unput(this.match.slice(x))},"less"),pastInput:y(function(){var x=this.matched.substr(0,this.matched.length-this.match.length);return(x.length>20?"...":"")+x.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:y(function(){var x=this.match;return x.length<20&&(x+=this._input.substr(0,20-x.length)),(x.substr(0,20)+(x.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:y(function(){var x=this.pastInput(),v=new Array(x.length+1).join("-");return x+this.upcomingInput()+` diff --git a/apps/kimi-code/dist-web/assets/channel-8Bt6a0tz.js b/apps/kimi-code/dist-web/assets/channel-8Bt6a0tz.js new file mode 100644 index 0000000000..40aeb80412 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/channel-8Bt6a0tz.js @@ -0,0 +1 @@ +import{U as a,O as n}from"./mermaid.core-WW7RuneT.js";const t=(r,o)=>a.lang.round(n.parse(r)[o]);export{t as c}; diff --git a/apps/kimi-code/dist-web/assets/channel-B8eMh4sk.js b/apps/kimi-code/dist-web/assets/channel-B8eMh4sk.js deleted file mode 100644 index 597ca0988b..0000000000 --- a/apps/kimi-code/dist-web/assets/channel-B8eMh4sk.js +++ /dev/null @@ -1 +0,0 @@ -import{U as a,O as n}from"./mermaid.core-CqiFQExc.js";const t=(r,o)=>a.lang.round(n.parse(r)[o]);export{t as c}; diff --git a/apps/kimi-code/dist-web/assets/chunk-2Q5K7J3B-CdhiweKX.js b/apps/kimi-code/dist-web/assets/chunk-2Q5K7J3B-NzojNxDT.js similarity index 67% rename from apps/kimi-code/dist-web/assets/chunk-2Q5K7J3B-CdhiweKX.js rename to apps/kimi-code/dist-web/assets/chunk-2Q5K7J3B-NzojNxDT.js index 6201d36e75..152d15d422 100644 --- a/apps/kimi-code/dist-web/assets/chunk-2Q5K7J3B-CdhiweKX.js +++ b/apps/kimi-code/dist-web/assets/chunk-2Q5K7J3B-NzojNxDT.js @@ -1 +1 @@ -import{_ as i}from"./mermaid.core-CqiFQExc.js";var r=class{constructor(t){this.init=t,this.records=this.init()}static{i(this,"ImperativeState")}reset(){this.records=this.init()}};export{r as I}; +import{_ as i}from"./mermaid.core-WW7RuneT.js";var r=class{constructor(t){this.init=t,this.records=this.init()}static{i(this,"ImperativeState")}reset(){this.records=this.init()}};export{r as I}; diff --git a/apps/kimi-code/dist-web/assets/chunk-32BRIVSS-mfMW4-bV.js b/apps/kimi-code/dist-web/assets/chunk-32BRIVSS-CRTrWqUr.js similarity index 96% rename from apps/kimi-code/dist-web/assets/chunk-32BRIVSS-mfMW4-bV.js rename to apps/kimi-code/dist-web/assets/chunk-32BRIVSS-CRTrWqUr.js index df4c3fd89b..15d85f94f2 100644 --- a/apps/kimi-code/dist-web/assets/chunk-32BRIVSS-mfMW4-bV.js +++ b/apps/kimi-code/dist-web/assets/chunk-32BRIVSS-CRTrWqUr.js @@ -1 +1 @@ -import{_ as i,d as l,N as d,j as o}from"./mermaid.core-CqiFQExc.js";var x=i((r,t)=>{const e=r.append("rect");if(e.attr("x",t.x),e.attr("y",t.y),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("width",t.width),e.attr("height",t.height),t.name&&e.attr("name",t.name),t.rx&&e.attr("rx",t.rx),t.ry&&e.attr("ry",t.ry),t.attrs!==void 0)for(const s in t.attrs)e.attr(s,t.attrs[s]);return t.class&&e.attr("class",t.class),e},"drawRect"),p=i((r,t)=>{const e={x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"};x(r,e).lower()},"drawBackgroundRect"),y=i((r,t)=>{const e=t.text.replace(d," "),s=r.append("text");s.attr("x",t.x),s.attr("y",t.y),s.attr("class","legend"),s.style("text-anchor",t.anchor),t.class&&s.attr("class",t.class);const a=s.append("tspan");return a.attr("x",t.x+t.textMargin*2),a.text(e),s},"drawText"),m=i((r,t,e,s)=>{const a=r.append("image");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",n)},"drawImage"),g=i((r,t,e,s)=>{const a=r.append("use");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",`#${n}`)},"drawEmbeddedImage"),h=i(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),f=i(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),w=i(()=>{let r=l(".mermaidTooltip");return r.empty()&&(r=l("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),r},"createTooltip");export{p as a,f as b,g as c,x as d,m as e,w as f,h as g,y as h}; +import{_ as i,d as l,N as d,j as o}from"./mermaid.core-WW7RuneT.js";var x=i((r,t)=>{const e=r.append("rect");if(e.attr("x",t.x),e.attr("y",t.y),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("width",t.width),e.attr("height",t.height),t.name&&e.attr("name",t.name),t.rx&&e.attr("rx",t.rx),t.ry&&e.attr("ry",t.ry),t.attrs!==void 0)for(const s in t.attrs)e.attr(s,t.attrs[s]);return t.class&&e.attr("class",t.class),e},"drawRect"),p=i((r,t)=>{const e={x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"};x(r,e).lower()},"drawBackgroundRect"),y=i((r,t)=>{const e=t.text.replace(d," "),s=r.append("text");s.attr("x",t.x),s.attr("y",t.y),s.attr("class","legend"),s.style("text-anchor",t.anchor),t.class&&s.attr("class",t.class);const a=s.append("tspan");return a.attr("x",t.x+t.textMargin*2),a.text(e),s},"drawText"),m=i((r,t,e,s)=>{const a=r.append("image");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",n)},"drawImage"),g=i((r,t,e,s)=>{const a=r.append("use");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",`#${n}`)},"drawEmbeddedImage"),h=i(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),f=i(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),w=i(()=>{let r=l(".mermaidTooltip");return r.empty()&&(r=l("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),r},"createTooltip");export{p as a,f as b,g as c,x as d,m as e,w as f,h as g,y as h}; diff --git a/apps/kimi-code/dist-web/assets/chunk-5VM5RSS4-BRWxG5tM.js b/apps/kimi-code/dist-web/assets/chunk-5VM5RSS4-BJR-VYAu.js similarity index 83% rename from apps/kimi-code/dist-web/assets/chunk-5VM5RSS4-BRWxG5tM.js rename to apps/kimi-code/dist-web/assets/chunk-5VM5RSS4-BJR-VYAu.js index 6e705ac015..2668fd1dae 100644 --- a/apps/kimi-code/dist-web/assets/chunk-5VM5RSS4-BRWxG5tM.js +++ b/apps/kimi-code/dist-web/assets/chunk-5VM5RSS4-BJR-VYAu.js @@ -1,4 +1,4 @@ -import{_ as e}from"./mermaid.core-CqiFQExc.js";var l=e(()=>` +import{_ as e}from"./mermaid.core-WW7RuneT.js";var l=e(()=>` /* Font Awesome icon styling - consolidated */ .label-icon { display: inline-block; diff --git a/apps/kimi-code/dist-web/assets/chunk-EX3LRPZG-DoQjV3QX.js b/apps/kimi-code/dist-web/assets/chunk-EX3LRPZG-B-vU1qLF.js similarity index 99% rename from apps/kimi-code/dist-web/assets/chunk-EX3LRPZG-DoQjV3QX.js rename to apps/kimi-code/dist-web/assets/chunk-EX3LRPZG-B-vU1qLF.js index 493c183e22..19a0b216ca 100644 --- a/apps/kimi-code/dist-web/assets/chunk-EX3LRPZG-DoQjV3QX.js +++ b/apps/kimi-code/dist-web/assets/chunk-EX3LRPZG-B-vU1qLF.js @@ -1,4 +1,4 @@ -import{g as te}from"./chunk-XXDRQBXY-4LplLZkT.js";import{s as ee}from"./chunk-VR4S4FIN-DW1NNlBr.js";import{_ as f,l as _,c as $,v as se,x as ie,a as re,b as ae,g as ne,s as oe,n as le,o as ce,a9 as he,k as j,p as ue,d as bt,a5 as de}from"./mermaid.core-CqiFQExc.js";import{f as fe}from"./chunk-32BRIVSS-mfMW4-bV.js";var vt=(function(){var t=f(function(V,a,d,r){for(d=d||{},r=V.length;r--;d[V[r]]=a);return d},"o"),e=[1,2],o=[1,3],s=[1,4],c=[2,4],h=[1,9],p=[1,11],y=[1,16],n=[1,17],T=[1,18],m=[1,19],O=[1,33],x=[1,20],k=[1,21],u=[1,22],L=[1,23],I=[1,24],v=[1,26],F=[1,27],C=[1,28],P=[1,29],w=[1,30],H=[1,31],it=[1,32],rt=[1,35],at=[1,36],nt=[1,37],ot=[1,38],z=[1,34],S=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],lt=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],xt=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],yt={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:f(function(a,d,r,g,E,i,B){var l=i.length-1;switch(E){case 3:return g.setRootDoc(i[l]),i[l];case 4:this.$=[];break;case 5:i[l]!="nl"&&(i[l-1].push(i[l]),this.$=i[l-1]);break;case 6:case 7:this.$=i[l];break;case 8:this.$="nl";break;case 12:this.$=i[l];break;case 13:const Q=i[l-1];Q.description=g.trimColon(i[l]),this.$=Q;break;case 14:this.$={stmt:"relation",state1:i[l-2],state2:i[l]};break;case 15:const gt=g.trimColon(i[l]);this.$={stmt:"relation",state1:i[l-3],state2:i[l-1],description:gt};break;case 19:this.$={stmt:"state",id:i[l-3],type:"default",description:"",doc:i[l-1]};break;case 20:var Y=i[l],K=i[l-2].trim();if(i[l].match(":")){var ht=i[l].split(":");Y=ht[0],K=[K,ht[1]]}this.$={stmt:"state",id:Y,type:"default",description:K};break;case 21:this.$={stmt:"state",id:i[l-3],type:"default",description:i[l-5],doc:i[l-1]};break;case 22:this.$={stmt:"state",id:i[l],type:"fork"};break;case 23:this.$={stmt:"state",id:i[l],type:"join"};break;case 24:this.$={stmt:"state",id:i[l],type:"choice"};break;case 25:this.$={stmt:"state",id:g.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:i[l-1].trim(),note:{position:i[l-2].trim(),text:i[l].trim()}};break;case 29:this.$=i[l].trim(),g.setAccTitle(this.$);break;case 30:case 31:this.$=i[l].trim(),g.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:i[l-3],url:i[l-2],tooltip:i[l-1]};break;case 33:this.$={stmt:"click",id:i[l-3],url:i[l-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:i[l-1].trim(),classes:i[l].trim()};break;case 36:this.$={stmt:"style",id:i[l-1].trim(),styleClass:i[l].trim()};break;case 37:this.$={stmt:"applyClass",id:i[l-1].trim(),styleClass:i[l].trim()};break;case 38:g.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:g.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:g.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:g.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:i[l].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:i[l-2].trim(),classes:[i[l].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:i[l-2].trim(),classes:[i[l].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:o,6:s},{1:[3]},{3:5,4:e,5:o,6:s},{3:6,4:e,5:o,6:s},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],c,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:n,19:T,22:m,24:O,25:x,26:k,27:u,28:L,29:I,32:25,33:v,35:F,37:C,38:P,41:w,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:y,17:n,19:T,22:m,24:O,25:x,26:k,27:u,28:L,29:I,32:25,33:v,35:F,37:C,38:P,41:w,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,7]),t(S,[2,8]),t(S,[2,9]),t(S,[2,10]),t(S,[2,11]),t(S,[2,12],{14:[1,40],15:[1,41]}),t(S,[2,16]),{18:[1,42]},t(S,[2,18],{20:[1,43]}),{23:[1,44]},t(S,[2,22]),t(S,[2,23]),t(S,[2,24]),t(S,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(S,[2,28]),{34:[1,49]},{36:[1,50]},t(S,[2,31]),{13:51,24:O,57:z},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(lt,[2,44],{58:[1,56]}),t(lt,[2,45],{58:[1,57]}),t(S,[2,38]),t(S,[2,39]),t(S,[2,40]),t(S,[2,41]),t(S,[2,6]),t(S,[2,13]),{13:58,24:O,57:z},t(S,[2,17]),t(xt,c,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(S,[2,29]),t(S,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(S,[2,14],{14:[1,71]}),{4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:n,19:T,21:[1,72],22:m,24:O,25:x,26:k,27:u,28:L,29:I,32:25,33:v,35:F,37:C,38:P,41:w,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(S,[2,34]),t(S,[2,35]),t(S,[2,36]),t(S,[2,37]),t(lt,[2,46]),t(lt,[2,47]),t(S,[2,15]),t(S,[2,19]),t(xt,c,{7:78}),t(S,[2,26]),t(S,[2,27]),{5:[1,79]},{5:[1,80]},{4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:n,19:T,21:[1,81],22:m,24:O,25:x,26:k,27:u,28:L,29:I,32:25,33:v,35:F,37:C,38:P,41:w,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,32]),t(S,[2,33]),t(S,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:f(function(a,d){if(d.recoverable)this.trace(a);else{var r=new Error(a);throw r.hash=d,r}},"parseError"),parse:f(function(a){var d=this,r=[0],g=[],E=[null],i=[],B=this.table,l="",Y=0,K=0,ht=2,Q=1,gt=i.slice.call(arguments,1),b=Object.create(this.lexer),U={yy:{}};for(var Tt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Tt)&&(U.yy[Tt]=this.yy[Tt]);b.setInput(a,U.yy),U.yy.lexer=b,U.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var Et=b.yylloc;i.push(Et);var Qt=b.options&&b.options.ranges;typeof U.yy.parseError=="function"?this.parseError=U.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Zt(N){r.length=r.length-2*N,E.length=E.length-N,i.length=i.length-N}f(Zt,"popStack");function Lt(){var N;return N=g.pop()||b.lex()||Q,typeof N!="number"&&(N instanceof Array&&(g=N,N=g.pop()),N=d.symbols_[N]||N),N}f(Lt,"lex");for(var A,W,R,_t,X={},ut,G,It,dt;;){if(W=r[r.length-1],this.defaultActions[W]?R=this.defaultActions[W]:((A===null||typeof A>"u")&&(A=Lt()),R=B[W]&&B[W][A]),typeof R>"u"||!R.length||!R[0]){var mt="";dt=[];for(ut in B[W])this.terminals_[ut]&&ut>ht&&dt.push("'"+this.terminals_[ut]+"'");b.showPosition?mt="Parse error on line "+(Y+1)+`: +import{g as te}from"./chunk-XXDRQBXY-D_bv9kM4.js";import{s as ee}from"./chunk-VR4S4FIN-C_RujyXt.js";import{_ as f,l as _,c as $,v as se,x as ie,a as re,b as ae,g as ne,s as oe,n as le,o as ce,a9 as he,k as j,p as ue,d as bt,a5 as de}from"./mermaid.core-WW7RuneT.js";import{f as fe}from"./chunk-32BRIVSS-CRTrWqUr.js";var vt=(function(){var t=f(function(V,a,d,r){for(d=d||{},r=V.length;r--;d[V[r]]=a);return d},"o"),e=[1,2],o=[1,3],s=[1,4],c=[2,4],h=[1,9],p=[1,11],y=[1,16],n=[1,17],T=[1,18],m=[1,19],O=[1,33],x=[1,20],k=[1,21],u=[1,22],L=[1,23],I=[1,24],v=[1,26],F=[1,27],C=[1,28],P=[1,29],w=[1,30],H=[1,31],it=[1,32],rt=[1,35],at=[1,36],nt=[1,37],ot=[1,38],z=[1,34],S=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],lt=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],xt=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],yt={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:f(function(a,d,r,g,E,i,B){var l=i.length-1;switch(E){case 3:return g.setRootDoc(i[l]),i[l];case 4:this.$=[];break;case 5:i[l]!="nl"&&(i[l-1].push(i[l]),this.$=i[l-1]);break;case 6:case 7:this.$=i[l];break;case 8:this.$="nl";break;case 12:this.$=i[l];break;case 13:const Q=i[l-1];Q.description=g.trimColon(i[l]),this.$=Q;break;case 14:this.$={stmt:"relation",state1:i[l-2],state2:i[l]};break;case 15:const gt=g.trimColon(i[l]);this.$={stmt:"relation",state1:i[l-3],state2:i[l-1],description:gt};break;case 19:this.$={stmt:"state",id:i[l-3],type:"default",description:"",doc:i[l-1]};break;case 20:var Y=i[l],K=i[l-2].trim();if(i[l].match(":")){var ht=i[l].split(":");Y=ht[0],K=[K,ht[1]]}this.$={stmt:"state",id:Y,type:"default",description:K};break;case 21:this.$={stmt:"state",id:i[l-3],type:"default",description:i[l-5],doc:i[l-1]};break;case 22:this.$={stmt:"state",id:i[l],type:"fork"};break;case 23:this.$={stmt:"state",id:i[l],type:"join"};break;case 24:this.$={stmt:"state",id:i[l],type:"choice"};break;case 25:this.$={stmt:"state",id:g.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:i[l-1].trim(),note:{position:i[l-2].trim(),text:i[l].trim()}};break;case 29:this.$=i[l].trim(),g.setAccTitle(this.$);break;case 30:case 31:this.$=i[l].trim(),g.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:i[l-3],url:i[l-2],tooltip:i[l-1]};break;case 33:this.$={stmt:"click",id:i[l-3],url:i[l-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:i[l-1].trim(),classes:i[l].trim()};break;case 36:this.$={stmt:"style",id:i[l-1].trim(),styleClass:i[l].trim()};break;case 37:this.$={stmt:"applyClass",id:i[l-1].trim(),styleClass:i[l].trim()};break;case 38:g.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:g.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:g.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:g.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:i[l].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:i[l-2].trim(),classes:[i[l].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:i[l-2].trim(),classes:[i[l].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:o,6:s},{1:[3]},{3:5,4:e,5:o,6:s},{3:6,4:e,5:o,6:s},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],c,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:n,19:T,22:m,24:O,25:x,26:k,27:u,28:L,29:I,32:25,33:v,35:F,37:C,38:P,41:w,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:y,17:n,19:T,22:m,24:O,25:x,26:k,27:u,28:L,29:I,32:25,33:v,35:F,37:C,38:P,41:w,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,7]),t(S,[2,8]),t(S,[2,9]),t(S,[2,10]),t(S,[2,11]),t(S,[2,12],{14:[1,40],15:[1,41]}),t(S,[2,16]),{18:[1,42]},t(S,[2,18],{20:[1,43]}),{23:[1,44]},t(S,[2,22]),t(S,[2,23]),t(S,[2,24]),t(S,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(S,[2,28]),{34:[1,49]},{36:[1,50]},t(S,[2,31]),{13:51,24:O,57:z},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(lt,[2,44],{58:[1,56]}),t(lt,[2,45],{58:[1,57]}),t(S,[2,38]),t(S,[2,39]),t(S,[2,40]),t(S,[2,41]),t(S,[2,6]),t(S,[2,13]),{13:58,24:O,57:z},t(S,[2,17]),t(xt,c,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(S,[2,29]),t(S,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(S,[2,14],{14:[1,71]}),{4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:n,19:T,21:[1,72],22:m,24:O,25:x,26:k,27:u,28:L,29:I,32:25,33:v,35:F,37:C,38:P,41:w,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(S,[2,34]),t(S,[2,35]),t(S,[2,36]),t(S,[2,37]),t(lt,[2,46]),t(lt,[2,47]),t(S,[2,15]),t(S,[2,19]),t(xt,c,{7:78}),t(S,[2,26]),t(S,[2,27]),{5:[1,79]},{5:[1,80]},{4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:n,19:T,21:[1,81],22:m,24:O,25:x,26:k,27:u,28:L,29:I,32:25,33:v,35:F,37:C,38:P,41:w,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,32]),t(S,[2,33]),t(S,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:f(function(a,d){if(d.recoverable)this.trace(a);else{var r=new Error(a);throw r.hash=d,r}},"parseError"),parse:f(function(a){var d=this,r=[0],g=[],E=[null],i=[],B=this.table,l="",Y=0,K=0,ht=2,Q=1,gt=i.slice.call(arguments,1),b=Object.create(this.lexer),U={yy:{}};for(var Tt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Tt)&&(U.yy[Tt]=this.yy[Tt]);b.setInput(a,U.yy),U.yy.lexer=b,U.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var Et=b.yylloc;i.push(Et);var Qt=b.options&&b.options.ranges;typeof U.yy.parseError=="function"?this.parseError=U.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Zt(N){r.length=r.length-2*N,E.length=E.length-N,i.length=i.length-N}f(Zt,"popStack");function Lt(){var N;return N=g.pop()||b.lex()||Q,typeof N!="number"&&(N instanceof Array&&(g=N,N=g.pop()),N=d.symbols_[N]||N),N}f(Lt,"lex");for(var A,W,R,_t,X={},ut,G,It,dt;;){if(W=r[r.length-1],this.defaultActions[W]?R=this.defaultActions[W]:((A===null||typeof A>"u")&&(A=Lt()),R=B[W]&&B[W][A]),typeof R>"u"||!R.length||!R[0]){var mt="";dt=[];for(ut in B[W])this.terminals_[ut]&&ut>ht&&dt.push("'"+this.terminals_[ut]+"'");b.showPosition?mt="Parse error on line "+(Y+1)+`: `+b.showPosition()+` Expecting `+dt.join(", ")+", got '"+(this.terminals_[A]||A)+"'":mt="Parse error on line "+(Y+1)+": Unexpected "+(A==Q?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(mt,{text:b.match,token:this.terminals_[A]||A,line:b.yylineno,loc:Et,expected:dt})}if(R[0]instanceof Array&&R.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+A);switch(R[0]){case 1:r.push(A),E.push(b.yytext),i.push(b.yylloc),r.push(R[1]),A=null,K=b.yyleng,l=b.yytext,Y=b.yylineno,Et=b.yylloc;break;case 2:if(G=this.productions_[R[1]][1],X.$=E[E.length-G],X._$={first_line:i[i.length-(G||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(G||1)].first_column,last_column:i[i.length-1].last_column},Qt&&(X._$.range=[i[i.length-(G||1)].range[0],i[i.length-1].range[1]]),_t=this.performAction.apply(X,[l,K,Y,U.yy,R[1],E,i].concat(gt)),typeof _t<"u")return _t;G&&(r=r.slice(0,-1*G*2),E=E.slice(0,-1*G),i=i.slice(0,-1*G)),r.push(this.productions_[R[1]][0]),E.push(X.$),i.push(X._$),It=B[r[r.length-2]][r[r.length-1]],r.push(It);break;case 3:return!0}}return!0},"parse")},qt=(function(){var V={EOF:1,parseError:f(function(d,r){if(this.yy.parser)this.yy.parser.parseError(d,r);else throw new Error(d)},"parseError"),setInput:f(function(a,d){return this.yy=d||this.yy||{},this._input=a,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:f(function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var d=a.match(/(?:\r\n?|\n).*/g);return d?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},"input"),unput:f(function(a){var d=a.length,r=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-d),this.offset-=d;var g=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var E=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===g.length?this.yylloc.first_column:0)+g[g.length-r.length].length-r[0].length:this.yylloc.first_column-d},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-d]),this.yyleng=this.yytext.length,this},"unput"),more:f(function(){return this._more=!0,this},"more"),reject:f(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:f(function(a){this.unput(this.match.slice(a))},"less"),pastInput:f(function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:f(function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:f(function(){var a=this.pastInput(),d=new Array(a.length+1).join("-");return a+this.upcomingInput()+` diff --git a/apps/kimi-code/dist-web/assets/chunk-JWPE2WC7-C7S97jLg.js b/apps/kimi-code/dist-web/assets/chunk-JWPE2WC7-BJMJfnyy.js similarity index 71% rename from apps/kimi-code/dist-web/assets/chunk-JWPE2WC7-C7S97jLg.js rename to apps/kimi-code/dist-web/assets/chunk-JWPE2WC7-BJMJfnyy.js index 6c8bbe7957..b7b772f3ef 100644 --- a/apps/kimi-code/dist-web/assets/chunk-JWPE2WC7-C7S97jLg.js +++ b/apps/kimi-code/dist-web/assets/chunk-JWPE2WC7-BJMJfnyy.js @@ -1 +1 @@ -import{_ as i}from"./mermaid.core-CqiFQExc.js";function t(c,e){c.accDescr&&e.setAccDescription?.(c.accDescr),c.accTitle&&e.setAccTitle?.(c.accTitle),c.title&&e.setDiagramTitle?.(c.title)}i(t,"populateCommonDb");export{t as p}; +import{_ as i}from"./mermaid.core-WW7RuneT.js";function t(c,e){c.accDescr&&e.setAccDescription?.(c.accDescr),c.accTitle&&e.setAccTitle?.(c.accTitle),c.title&&e.setDiagramTitle?.(c.title)}i(t,"populateCommonDb");export{t as p}; diff --git a/apps/kimi-code/dist-web/assets/chunk-MOJQB5TN-DcgqWRh_.js b/apps/kimi-code/dist-web/assets/chunk-MOJQB5TN-DmVMZHwQ.js similarity index 99% rename from apps/kimi-code/dist-web/assets/chunk-MOJQB5TN-DcgqWRh_.js rename to apps/kimi-code/dist-web/assets/chunk-MOJQB5TN-DmVMZHwQ.js index abd164734f..fa350c5091 100644 --- a/apps/kimi-code/dist-web/assets/chunk-MOJQB5TN-DcgqWRh_.js +++ b/apps/kimi-code/dist-web/assets/chunk-MOJQB5TN-DmVMZHwQ.js @@ -1,4 +1,4 @@ -import{_ as p,l as w,D as L,y as E,p as I,E as X,e as H,i as q,c as G}from"./mermaid.core-CqiFQExc.js";var z="",b="",N="",A=[],R=new Map,k=p(e=>q(e,G()),"sanitizeText"),F=p(e=>{switch(e.type){case"terminal":return{...e,value:k(e.value)};case"nonterminal":return{...e,name:k(e.name)};case"sequence":return{...e,elements:e.elements.map(F)};case"choice":return{...e,alternatives:e.alternatives.map(F)};case"optional":return{...e,element:F(e.element)};case"repetition":return{...e,element:F(e.element),separator:e.separator?F(e.separator):void 0};case"special":return{...e,text:k(e.text)}}},"sanitizeAstNode"),U=p(()=>{z="",b="",N="",A.length=0,R.clear(),I(),w.debug("[Railroad] Database cleared")},"clear"),_=p(e=>{z=k(e),w.debug("[Railroad] Title set:",e)},"setTitle"),W=p(()=>z,"getTitle"),j=p(e=>{const i={...e,name:k(e.name),definition:F(e.definition),comment:e.comment?k(e.comment):void 0};w.debug("[Railroad] Adding rule:",i.name),R.has(i.name)&&w.warn(`[Railroad] Rule '${i.name}' is already defined. Overwriting.`),A.push(i),R.set(i.name,i)},"addRule"),K=p(()=>A,"getRules"),J=p(e=>R.get(e),"getRule"),Q=p(e=>{b=k(e).replace(/^\s+/g,""),w.debug("[Railroad] Accessibility title set:",e)},"setAccTitle"),Z=p(()=>b,"getAccTitle"),V=p(e=>{N=k(e).replace(/\n\s+/g,` +import{_ as p,l as w,D as L,y as E,p as I,E as X,e as H,i as q,c as G}from"./mermaid.core-WW7RuneT.js";var z="",b="",N="",A=[],R=new Map,k=p(e=>q(e,G()),"sanitizeText"),F=p(e=>{switch(e.type){case"terminal":return{...e,value:k(e.value)};case"nonterminal":return{...e,name:k(e.name)};case"sequence":return{...e,elements:e.elements.map(F)};case"choice":return{...e,alternatives:e.alternatives.map(F)};case"optional":return{...e,element:F(e.element)};case"repetition":return{...e,element:F(e.element),separator:e.separator?F(e.separator):void 0};case"special":return{...e,text:k(e.text)}}},"sanitizeAstNode"),U=p(()=>{z="",b="",N="",A.length=0,R.clear(),I(),w.debug("[Railroad] Database cleared")},"clear"),_=p(e=>{z=k(e),w.debug("[Railroad] Title set:",e)},"setTitle"),W=p(()=>z,"getTitle"),j=p(e=>{const i={...e,name:k(e.name),definition:F(e.definition),comment:e.comment?k(e.comment):void 0};w.debug("[Railroad] Adding rule:",i.name),R.has(i.name)&&w.warn(`[Railroad] Rule '${i.name}' is already defined. Overwriting.`),A.push(i),R.set(i.name,i)},"addRule"),K=p(()=>A,"getRules"),J=p(e=>R.get(e),"getRule"),Q=p(e=>{b=k(e).replace(/^\s+/g,""),w.debug("[Railroad] Accessibility title set:",e)},"setAccTitle"),Z=p(()=>b,"getAccTitle"),V=p(e=>{N=k(e).replace(/\n\s+/g,` `),w.debug("[Railroad] Accessibility description set:",e)},"setAccDescription"),ee=p(()=>N,"getAccDescription"),te=_,re=W,ie={clear:U,setTitle:_,getTitle:W,addRule:j,getRules:K,getRule:J,setAccTitle:Q,getAccTitle:Z,setAccDescription:V,getAccDescription:ee,setDiagramTitle:te,getDiagramTitle:re},g={compactMode:!1,padding:10,verticalSeparation:8,horizontalSeparation:10,arcRadius:10,fontSize:14,fontFamily:"monospace",terminalFill:"#FFFFC0",terminalStroke:"#000000",terminalTextColor:"#000000",nonTerminalFill:"#FFFFFF",nonTerminalStroke:"#000000",nonTerminalTextColor:"#000000",lineColor:"#000000",strokeWidth:2,markerFill:"#000000",commentFill:"#E8E8E8",commentStroke:"#888888",commentTextColor:"#666666",specialFill:"#F0E0FF",specialStroke:"#8800CC",ruleNameColor:"#000066",showMarkers:!0,markerRadius:5},ne=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,ae=/^[\w "',.-]+$/,oe=new Set(["compactMode","padding","verticalSeparation","horizontalSeparation","arcRadius","fontSize","fontFamily","terminalFill","terminalStroke","terminalTextColor","nonTerminalFill","nonTerminalStroke","nonTerminalTextColor","lineColor","strokeWidth","markerFill","commentFill","commentStroke","commentTextColor","specialFill","specialStroke","ruleNameColor","showMarkers","markerRadius"]),B=p(e=>e?Object.keys(e).every(i=>i==="railroad"||oe.has(i)):!1,"isRailroadStyleOptions"),le=p(e=>e?"railroad"in e&&e.railroad?e.railroad:B(e)?e:{}:{},"extractRailroadOverrides"),se=p(e=>{if(!e||B(e))return{};const{railroad:i,svgId:a,theme:r,look:t,...n}=e;return n},"extractThemeOverrides"),m=p((e,i)=>{if(typeof e!="string")return i;const a=e.trim();return ne.test(a)?a:i},"sanitizeColorValue"),Y=p((e,i)=>{if(typeof e!="string")return i;const a=e.trim();return ae.test(a)?a:i},"sanitizeFontFamilyValue"),S=p((e,i)=>{const a=typeof e=="number"?e:typeof e=="string"?Number.parseFloat(e):Number.NaN;return Number.isFinite(a)&&a>=0?a:i},"sanitizeNumberValue"),de=p(e=>{const i=typeof e=="number"?e:typeof e=="string"?Number.parseFloat(e):Number.NaN;return Number.isFinite(i)&&i>0?i:void 0},"parseThemeFontSize"),ce=p(e=>{const i=Y(e.fontFamily,g.fontFamily),a=de(e.fontSize)??g.fontSize;return{...g,fontFamily:i,fontSize:a,terminalFill:m(e.secondBkg??e.secondaryColor,g.terminalFill),terminalStroke:m(e.secondaryBorderColor??e.lineColor,g.terminalStroke),terminalTextColor:m(e.secondaryTextColor??e.textColor,g.terminalTextColor),nonTerminalFill:m(e.mainBkg??e.background,g.nonTerminalFill),nonTerminalStroke:m(e.primaryBorderColor??e.lineColor,g.nonTerminalStroke),nonTerminalTextColor:m(e.primaryTextColor??e.textColor,g.nonTerminalTextColor),lineColor:m(e.lineColor,g.lineColor),markerFill:m(e.lineColor,g.markerFill),commentFill:m(e.labelBackground??e.tertiaryColor,g.commentFill),commentStroke:m(e.tertiaryBorderColor??e.lineColor,g.commentStroke),commentTextColor:m(e.tertiaryTextColor??e.textColor,g.commentTextColor),specialFill:m(e.tertiaryColor??e.secondaryColor,g.specialFill),specialStroke:m(e.tertiaryBorderColor??e.secondaryBorderColor,g.specialStroke),ruleNameColor:m(e.titleColor??e.textColor,g.ruleNameColor)}},"buildThemeDefaults"),M=p(e=>{const i=E(),a={...X(),...i.themeVariables??{},...se(e)},r=ce(a),t={...i.railroad??{},...le(e)};return{compactMode:t.compactMode??r.compactMode,padding:S(t.padding,r.padding),verticalSeparation:S(t.verticalSeparation,r.verticalSeparation),horizontalSeparation:S(t.horizontalSeparation,r.horizontalSeparation),arcRadius:S(t.arcRadius,r.arcRadius),fontSize:S(t.fontSize,r.fontSize),fontFamily:Y(t.fontFamily,r.fontFamily),terminalFill:m(t.terminalFill,r.terminalFill),terminalStroke:m(t.terminalStroke,r.terminalStroke),terminalTextColor:m(t.terminalTextColor,r.terminalTextColor),nonTerminalFill:m(t.nonTerminalFill,r.nonTerminalFill),nonTerminalStroke:m(t.nonTerminalStroke,r.nonTerminalStroke),nonTerminalTextColor:m(t.nonTerminalTextColor,r.nonTerminalTextColor),lineColor:m(t.lineColor,r.lineColor),strokeWidth:S(t.strokeWidth,r.strokeWidth),markerFill:m(t.markerFill,r.markerFill),commentFill:m(t.commentFill,r.commentFill),commentStroke:m(t.commentStroke,r.commentStroke),commentTextColor:m(t.commentTextColor,r.commentTextColor),specialFill:m(t.specialFill,r.specialFill),specialStroke:m(t.specialStroke,r.specialStroke),ruleNameColor:m(t.ruleNameColor,r.ruleNameColor),showMarkers:t.showMarkers??r.showMarkers,markerRadius:S(t.markerRadius,r.markerRadius)}},"buildRailroadStyleOptions"),ue=p(e=>{const{fontFamily:i,fontSize:a,terminalFill:r,terminalStroke:t,terminalTextColor:n,nonTerminalFill:h,nonTerminalStroke:s,nonTerminalTextColor:o,lineColor:u,strokeWidth:c,markerFill:d,commentFill:x,commentStroke:l,commentTextColor:f,specialFill:y,specialStroke:v,ruleNameColor:C}=M(e);return` .railroad-diagram { font-family: ${i}; diff --git a/apps/kimi-code/dist-web/assets/chunk-RYQCIY6F-DRHEFBXE.js b/apps/kimi-code/dist-web/assets/chunk-RYQCIY6F-LhAgalr3.js similarity index 99% rename from apps/kimi-code/dist-web/assets/chunk-RYQCIY6F-DRHEFBXE.js rename to apps/kimi-code/dist-web/assets/chunk-RYQCIY6F-LhAgalr3.js index 12a47a911c..e617984326 100644 --- a/apps/kimi-code/dist-web/assets/chunk-RYQCIY6F-DRHEFBXE.js +++ b/apps/kimi-code/dist-web/assets/chunk-RYQCIY6F-LhAgalr3.js @@ -1 +1 @@ -import{_ as u,l as i}from"./mermaid.core-CqiFQExc.js";import{i as m,G as y}from"./graph-DOmOIIwC.js";import{b as _,m as X}from"./map-DxJ2ADlA.js";var j=4;function p(e){return _(e,j)}function C(e){var r={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:F(e),edges:M(e)};return m(e.graph())||(r.value=p(e.graph())),r}function F(e){return X(e.nodes(),function(r){var n=e.node(r),s=e.parent(r),t={v:r};return m(n)||(t.value=n),m(s)||(t.parent=s),t})}function M(e){return X(e.edges(),function(r){var n=e.edge(r),s={v:r.v,w:r.w};return m(r.name)||(s.name=r.name),m(n)||(s.value=n),s})}var c=new Map,w=new Map,A=new Map,J=u(()=>{w.clear(),A.clear(),c.clear()},"clear"),v=u((e,r)=>{const n=w.get(r)||[];return i.trace("In isDescendant",r," ",e," = ",n.includes(e)),n.includes(e)},"isDescendant"),R=u((e,r)=>{const n=w.get(r)||[];return i.info("Descendants of ",r," is ",n),i.info("Edge is ",e),e.v===r||e.w===r?!1:n?n.includes(e.v)||v(e.v,r)||v(e.w,r)||n.includes(e.w):(i.debug("Tilt, ",r,",not in descendants"),!1)},"edgeInCluster"),b=u((e,r,n,s)=>{i.warn("Copying children of ",e,"root",s,"data",r.node(e),s);const t=r.children(e)||[];e!==s&&t.push(e),i.warn("Copying (nodes) clusterId",e,"nodes",t),t.forEach(o=>{if(r.children(o).length>0)b(o,r,n,s);else{const l=r.node(o);i.info("cp ",o," to ",s," with parent ",e),n.setNode(o,l),s!==r.parent(o)&&(i.warn("Setting parent",o,r.parent(o)),n.setParent(o,r.parent(o))),e!==s&&o!==e?(i.debug("Setting parent",o,e),n.setParent(o,e)):(i.info("In copy ",e,"root",s,"data",r.node(e),s),i.debug("Not Setting parent for node=",o,"cluster!==rootId",e!==s,"node!==clusterId",o!==e));const f=r.edges(o);i.debug("Copying Edges",f),f.forEach(a=>{i.info("Edge",a);const d=r.edge(a.v,a.w,a.name);i.info("Edge data",d,s);try{if(R(a,s)){const g=w.get(s)||[],E=g.includes(a.v)||v(a.v,s)||a.v===s,x=g.includes(a.w)||v(a.w,s)||a.w===s;if(E&&x)i.info("Copying as ",a.v,a.w,d,a.name),n.setEdge(a.v,a.w,d,a.name),i.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]));else{const N=E?s:a.v,h=x?s:a.w;i.info("Rebinding cross-boundary edge as ",N,h,d,a.name),r.setEdge(N,h,d,a.name)}}else i.info("Skipping copy of edge ",a.v,"-->",a.w," rootId: ",s," clusterId:",e)}catch(g){i.error(g)}})}i.debug("Removing node",o),r.removeNode(o)})},"copy"),O=u((e,r)=>{const n=r.children(e);let s=[...n];for(const t of n)A.set(t,e),s=[...s,...O(t,r)];return s},"extractDescendants"),P=u((e,r,n)=>{const s=e.edges().filter(a=>a.v===r||a.w===r),t=e.edges().filter(a=>a.v===n||a.w===n),o=s.map(a=>({v:a.v===r?n:a.v,w:a.w===r?r:a.w})),l=t.map(a=>({v:a.v,w:a.w}));return o.filter(a=>l.some(d=>a.v===d.v&&a.w===d.w))},"findCommonEdges"),D=u((e,r,n)=>{const s=r.children(e);if(i.trace("Searching children of id ",e,s),s.length<1)return e;let t;for(const o of s){const l=D(o,r,n),f=P(r,n,l);if(l)if(f.length>0)t=l;else return l}return t},"findNonClusterChild"),S=u(e=>!c.has(e)||!c.get(e).externalConnections?e:c.has(e)?c.get(e).id:e,"getAnchorId"),U=u((e,r)=>{if(!e||r>10){i.debug("Opting out, no graph ");return}else i.debug("Opting in, graph ");e.nodes().forEach(function(n){e.children(n).length>0&&(i.warn("Cluster identified",n," Replacement id in edges: ",D(n,e,n)),w.set(n,O(n,e)),c.set(n,{id:D(n,e,n),clusterData:e.node(n)}))}),e.nodes().forEach(function(n){const s=e.children(n),t=e.edges();s.length>0?(i.debug("Cluster identified",n,w),t.forEach(o=>{const l=v(o.v,n),f=v(o.w,n);l^f&&(i.warn("Edge: ",o," leaves cluster ",n),i.warn("Descendants of XXX ",n,": ",w.get(n)),c.get(n).externalConnections=!0)})):i.debug("Not a cluster ",n,w)});for(let n of c.keys()){const s=c.get(n).id,t=e.parent(s);t!==n&&c.has(t)&&!c.get(t).externalConnections&&(c.get(n).id=t);const o=e.edges().some(l=>l.v===n);if(s&&c.get(n)?.externalConnections&&o&&L(e,s,n)){const l=T(e,n,e.parent(s));l&&(c.get(n).id=l)}}e.edges().forEach(function(n){const s=e.edge(n);i.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),i.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let t=n.v,o=n.w;if(i.warn("Fix XXX",c,"ids:",n.v,n.w,"Translating: ",c.get(n.v)," --- ",c.get(n.w)),c.get(n.v)||c.get(n.w)){if(i.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),t=S(n.v),o=S(n.w),e.removeEdge(n.v,n.w,n.name),t!==n.v){const l=e.parent(t);c.get(l).externalConnections=!0,s.fromCluster=n.v}if(o!==n.w){const l=e.parent(o);c.get(l).externalConnections=!0,s.toCluster=n.w}i.warn("Fix Replacing with XXX",t,o,n.name),e.setEdge(t,o,s,n.name)}}),i.warn("Adjusted Graph",C(e)),k(e,0),i.trace(c)},"adjustClustersAndEdges"),k=u((e,r)=>{if(i.warn("extractor - ",r,C(e),e.children("D")),r>10){i.error("Bailing out");return}let n=e.nodes(),s=!1;for(const t of n){const o=e.children(t);s=s||o.length>0}if(!s){i.debug("Done, no node has children",e.nodes());return}i.debug("Nodes = ",n,r);for(const t of n)if(i.debug("Extracting node",t,c,c.has(t)&&!c.get(t).externalConnections,!e.parent(t),e.node(t),e.children("D")," Depth ",r),!c.has(t))i.debug("Not a cluster",t,r);else if(c.get(t)?.clusterData?.explicitDir&&e.children(t)&&e.children(t).length>0){i.warn("Cluster with explicit dir, creating subgraph for children",t,r);const o=c.get(t).clusterData.dir,l=new y({multigraph:!0,compound:!0}).setGraph({rankdir:o,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});b(t,e,l,t);const f=e.node(t)||{};e.setNode(t,{...f,clusterNode:!0,id:t,clusterData:c.get(t).clusterData,label:c.get(t).label,graph:l}),i.warn("Subgraph for cluster with explicit dir created:",t,C(l))}else if(!c.get(t).externalConnections&&e.children(t)&&e.children(t).length>0){i.warn("Cluster without external connections, without a parent and with children",t,r);let l=e.graph().rankdir==="TB"?"LR":"TB";c.get(t)?.clusterData?.dir&&(l=c.get(t).clusterData.dir,i.warn("Fixing dir",c.get(t).clusterData.dir,l));const f=new y({multigraph:!0,compound:!0}).setGraph({rankdir:l,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});b(t,e,f,t);const a=e.node(t)||{};e.setNode(t,{...a,clusterNode:!0,id:t,clusterData:c.get(t).clusterData,label:c.get(t).label,graph:f}),i.debug("Old graph after copy",C(e))}else i.warn("Cluster ** ",t," **not meeting the criteria !externalConnections:",!c.get(t).externalConnections," no parent: ",!e.parent(t)," children ",e.children(t)&&e.children(t).length>0,e.children("D"),r),i.debug(c);n=e.nodes(),i.warn("New list of nodes",n);for(const t of n){const o=e.node(t);i.warn(" Now next level",t,o),o?.clusterNode&&k(o.graph,r+1)}},"extractor"),B=u((e,r)=>{if(r.length===0)return[];let n=Object.assign([],r);return r.forEach(s=>{const t=e.children(s),o=B(e,t);n=[...n,...o]}),n},"sorter"),W=u(e=>B(e,e.children()),"sortNodesByHierarchy"),L=u((e,r,n)=>{let s=e.parent(r);for(;s&&s!==n;){const t=c.get(s);if(t&&!t.externalConnections)return!0;s=e.parent(s)}return!1},"isNodeInExtractableCluster"),T=u((e,r,n)=>{const s=e.children(r)??[];for(const t of s){if(t===n||v(t,n))continue;const o=D(t,e,r);if(o&&!L(e,o,r))return o}return null},"findSafeAnchorNode");export{U as a,c as b,J as c,D as f,W as s,C as w}; +import{_ as u,l as i}from"./mermaid.core-WW7RuneT.js";import{i as m,G as y}from"./graph-DOmOIIwC.js";import{b as _,m as X}from"./map-DxJ2ADlA.js";var j=4;function p(e){return _(e,j)}function C(e){var r={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:F(e),edges:M(e)};return m(e.graph())||(r.value=p(e.graph())),r}function F(e){return X(e.nodes(),function(r){var n=e.node(r),s=e.parent(r),t={v:r};return m(n)||(t.value=n),m(s)||(t.parent=s),t})}function M(e){return X(e.edges(),function(r){var n=e.edge(r),s={v:r.v,w:r.w};return m(r.name)||(s.name=r.name),m(n)||(s.value=n),s})}var c=new Map,w=new Map,A=new Map,J=u(()=>{w.clear(),A.clear(),c.clear()},"clear"),v=u((e,r)=>{const n=w.get(r)||[];return i.trace("In isDescendant",r," ",e," = ",n.includes(e)),n.includes(e)},"isDescendant"),R=u((e,r)=>{const n=w.get(r)||[];return i.info("Descendants of ",r," is ",n),i.info("Edge is ",e),e.v===r||e.w===r?!1:n?n.includes(e.v)||v(e.v,r)||v(e.w,r)||n.includes(e.w):(i.debug("Tilt, ",r,",not in descendants"),!1)},"edgeInCluster"),b=u((e,r,n,s)=>{i.warn("Copying children of ",e,"root",s,"data",r.node(e),s);const t=r.children(e)||[];e!==s&&t.push(e),i.warn("Copying (nodes) clusterId",e,"nodes",t),t.forEach(o=>{if(r.children(o).length>0)b(o,r,n,s);else{const l=r.node(o);i.info("cp ",o," to ",s," with parent ",e),n.setNode(o,l),s!==r.parent(o)&&(i.warn("Setting parent",o,r.parent(o)),n.setParent(o,r.parent(o))),e!==s&&o!==e?(i.debug("Setting parent",o,e),n.setParent(o,e)):(i.info("In copy ",e,"root",s,"data",r.node(e),s),i.debug("Not Setting parent for node=",o,"cluster!==rootId",e!==s,"node!==clusterId",o!==e));const f=r.edges(o);i.debug("Copying Edges",f),f.forEach(a=>{i.info("Edge",a);const d=r.edge(a.v,a.w,a.name);i.info("Edge data",d,s);try{if(R(a,s)){const g=w.get(s)||[],E=g.includes(a.v)||v(a.v,s)||a.v===s,x=g.includes(a.w)||v(a.w,s)||a.w===s;if(E&&x)i.info("Copying as ",a.v,a.w,d,a.name),n.setEdge(a.v,a.w,d,a.name),i.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]));else{const N=E?s:a.v,h=x?s:a.w;i.info("Rebinding cross-boundary edge as ",N,h,d,a.name),r.setEdge(N,h,d,a.name)}}else i.info("Skipping copy of edge ",a.v,"-->",a.w," rootId: ",s," clusterId:",e)}catch(g){i.error(g)}})}i.debug("Removing node",o),r.removeNode(o)})},"copy"),O=u((e,r)=>{const n=r.children(e);let s=[...n];for(const t of n)A.set(t,e),s=[...s,...O(t,r)];return s},"extractDescendants"),P=u((e,r,n)=>{const s=e.edges().filter(a=>a.v===r||a.w===r),t=e.edges().filter(a=>a.v===n||a.w===n),o=s.map(a=>({v:a.v===r?n:a.v,w:a.w===r?r:a.w})),l=t.map(a=>({v:a.v,w:a.w}));return o.filter(a=>l.some(d=>a.v===d.v&&a.w===d.w))},"findCommonEdges"),D=u((e,r,n)=>{const s=r.children(e);if(i.trace("Searching children of id ",e,s),s.length<1)return e;let t;for(const o of s){const l=D(o,r,n),f=P(r,n,l);if(l)if(f.length>0)t=l;else return l}return t},"findNonClusterChild"),S=u(e=>!c.has(e)||!c.get(e).externalConnections?e:c.has(e)?c.get(e).id:e,"getAnchorId"),U=u((e,r)=>{if(!e||r>10){i.debug("Opting out, no graph ");return}else i.debug("Opting in, graph ");e.nodes().forEach(function(n){e.children(n).length>0&&(i.warn("Cluster identified",n," Replacement id in edges: ",D(n,e,n)),w.set(n,O(n,e)),c.set(n,{id:D(n,e,n),clusterData:e.node(n)}))}),e.nodes().forEach(function(n){const s=e.children(n),t=e.edges();s.length>0?(i.debug("Cluster identified",n,w),t.forEach(o=>{const l=v(o.v,n),f=v(o.w,n);l^f&&(i.warn("Edge: ",o," leaves cluster ",n),i.warn("Descendants of XXX ",n,": ",w.get(n)),c.get(n).externalConnections=!0)})):i.debug("Not a cluster ",n,w)});for(let n of c.keys()){const s=c.get(n).id,t=e.parent(s);t!==n&&c.has(t)&&!c.get(t).externalConnections&&(c.get(n).id=t);const o=e.edges().some(l=>l.v===n);if(s&&c.get(n)?.externalConnections&&o&&L(e,s,n)){const l=T(e,n,e.parent(s));l&&(c.get(n).id=l)}}e.edges().forEach(function(n){const s=e.edge(n);i.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),i.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let t=n.v,o=n.w;if(i.warn("Fix XXX",c,"ids:",n.v,n.w,"Translating: ",c.get(n.v)," --- ",c.get(n.w)),c.get(n.v)||c.get(n.w)){if(i.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),t=S(n.v),o=S(n.w),e.removeEdge(n.v,n.w,n.name),t!==n.v){const l=e.parent(t);c.get(l).externalConnections=!0,s.fromCluster=n.v}if(o!==n.w){const l=e.parent(o);c.get(l).externalConnections=!0,s.toCluster=n.w}i.warn("Fix Replacing with XXX",t,o,n.name),e.setEdge(t,o,s,n.name)}}),i.warn("Adjusted Graph",C(e)),k(e,0),i.trace(c)},"adjustClustersAndEdges"),k=u((e,r)=>{if(i.warn("extractor - ",r,C(e),e.children("D")),r>10){i.error("Bailing out");return}let n=e.nodes(),s=!1;for(const t of n){const o=e.children(t);s=s||o.length>0}if(!s){i.debug("Done, no node has children",e.nodes());return}i.debug("Nodes = ",n,r);for(const t of n)if(i.debug("Extracting node",t,c,c.has(t)&&!c.get(t).externalConnections,!e.parent(t),e.node(t),e.children("D")," Depth ",r),!c.has(t))i.debug("Not a cluster",t,r);else if(c.get(t)?.clusterData?.explicitDir&&e.children(t)&&e.children(t).length>0){i.warn("Cluster with explicit dir, creating subgraph for children",t,r);const o=c.get(t).clusterData.dir,l=new y({multigraph:!0,compound:!0}).setGraph({rankdir:o,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});b(t,e,l,t);const f=e.node(t)||{};e.setNode(t,{...f,clusterNode:!0,id:t,clusterData:c.get(t).clusterData,label:c.get(t).label,graph:l}),i.warn("Subgraph for cluster with explicit dir created:",t,C(l))}else if(!c.get(t).externalConnections&&e.children(t)&&e.children(t).length>0){i.warn("Cluster without external connections, without a parent and with children",t,r);let l=e.graph().rankdir==="TB"?"LR":"TB";c.get(t)?.clusterData?.dir&&(l=c.get(t).clusterData.dir,i.warn("Fixing dir",c.get(t).clusterData.dir,l));const f=new y({multigraph:!0,compound:!0}).setGraph({rankdir:l,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});b(t,e,f,t);const a=e.node(t)||{};e.setNode(t,{...a,clusterNode:!0,id:t,clusterData:c.get(t).clusterData,label:c.get(t).label,graph:f}),i.debug("Old graph after copy",C(e))}else i.warn("Cluster ** ",t," **not meeting the criteria !externalConnections:",!c.get(t).externalConnections," no parent: ",!e.parent(t)," children ",e.children(t)&&e.children(t).length>0,e.children("D"),r),i.debug(c);n=e.nodes(),i.warn("New list of nodes",n);for(const t of n){const o=e.node(t);i.warn(" Now next level",t,o),o?.clusterNode&&k(o.graph,r+1)}},"extractor"),B=u((e,r)=>{if(r.length===0)return[];let n=Object.assign([],r);return r.forEach(s=>{const t=e.children(s),o=B(e,t);n=[...n,...o]}),n},"sorter"),W=u(e=>B(e,e.children()),"sortNodesByHierarchy"),L=u((e,r,n)=>{let s=e.parent(r);for(;s&&s!==n;){const t=c.get(s);if(t&&!t.externalConnections)return!0;s=e.parent(s)}return!1},"isNodeInExtractableCluster"),T=u((e,r,n)=>{const s=e.children(r)??[];for(const t of s){if(t===n||v(t,n))continue;const o=D(t,e,r);if(o&&!L(e,o,r))return o}return null},"findSafeAnchorNode");export{U as a,c as b,J as c,D as f,W as s,C as w}; diff --git a/apps/kimi-code/dist-web/assets/chunk-V7JOEXUC-Ci6LL3n4.js b/apps/kimi-code/dist-web/assets/chunk-V7JOEXUC-BBRs-W-z.js similarity index 99% rename from apps/kimi-code/dist-web/assets/chunk-V7JOEXUC-Ci6LL3n4.js rename to apps/kimi-code/dist-web/assets/chunk-V7JOEXUC-BBRs-W-z.js index f791842c18..4b425774cc 100644 --- a/apps/kimi-code/dist-web/assets/chunk-V7JOEXUC-Ci6LL3n4.js +++ b/apps/kimi-code/dist-web/assets/chunk-V7JOEXUC-BBRs-W-z.js @@ -1,4 +1,4 @@ -import{g as tt}from"./chunk-5VM5RSS4-BRWxG5tM.js";import{g as st}from"./chunk-XXDRQBXY-4LplLZkT.js";import{s as it}from"./chunk-VR4S4FIN-DW1NNlBr.js";import{_ as f,l as Ie,c as F,u as at,v as nt,x as Oe,d as de,a5 as rt,b as ut,a as lt,s as ct,g as ot,n as ht,o as dt,k as I,p as pt,q as At,i as ft,a6 as G}from"./mermaid.core-CqiFQExc.js";import{f as gt}from"./chunk-32BRIVSS-mfMW4-bV.js";var we=(function(){var t=f(function(O,o,h,p){for(h=h||{},p=O.length;p--;h[O[p]]=o);return h},"o"),i=[1,18],a=[1,19],n=[1,20],r=[1,41],c=[1,26],u=[1,42],d=[1,24],m=[1,25],g=[1,32],N=[1,33],Ae=[1,34],b=[1,45],fe=[1,35],ge=[1,36],me=[1,37],Ce=[1,38],be=[1,27],ke=[1,28],Ee=[1,29],Te=[1,30],ye=[1,31],k=[1,44],E=[1,46],T=[1,43],y=[1,47],De=[1,9],A=[1,8,9],Z=[1,58],$=[1,59],ee=[1,60],te=[1,61],se=[1,62],Fe=[1,63],Be=[1,64],_=[1,8,9,41],Pe=[1,77],M=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],ie=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],ae=[13,60,86,100,102,103],U=[13,60,73,74,86,100,102,103],Me=[13,60,68,69,70,71,72,86,100,102,103],ne=[1,103],z=[1,121],Y=[1,117],K=[1,113],W=[1,119],Q=[1,114],j=[1,115],X=[1,116],q=[1,118],H=[1,120],Re=[22,50,60,61,82,86,87,88,89,90],Ge=[1,128],re=[12,39],_e=[1,8,9,39,41,44,46],ue=[1,8,9,22],Ue=[1,153],ze=[1,8,9,61],x=[1,8,9,22,50,60,61,82,86,87,88,89,90],Se={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,ANNOTATION_START:46,ANNOTATION_END:47,CLASS:48,emptyBody:49,SPACE:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",18:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"ANNOTATION_START",47:"ANNOTATION_END",48:"CLASS",50:"SPACE",51:"MEMBER",52:"SEPARATOR",54:"NOTE_FOR",56:"NOTE",57:"CLASSDEF",60:"ALPHA",61:"COMMA",62:"direction_tb",63:"direction_bt",64:"direction_rl",65:"direction_lr",68:"AGGREGATION",69:"EXTENSION",70:"COMPOSITION",71:"DEPENDENCY",72:"LOLLIPOP",73:"LINE",74:"DOTTED_LINE",75:"CALLBACK",76:"LINK",77:"LINK_TARGET",78:"CLICK",79:"CALLBACK_NAME",80:"CALLBACK_ARGS",81:"HREF",82:"STYLE",83:"CSSCLASS",86:"NUM",87:"COLON",88:"UNIT",89:"BRKT",90:"PCT",93:"graphCodeTokens",95:"TAGSTART",96:"TAGEND",97:"==",98:"--",99:"DEFAULT",100:"MINUS",101:"keywords",102:"UNICODE_TEXT",103:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[38,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[24,4],[24,7],[24,6],[43,2],[43,3],[49,0],[49,2],[49,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:f(function(o,h,p,l,C,e,J){var s=e.length-1;switch(C){case 8:this.$=e[s-1];break;case 9:case 10:case 13:case 15:this.$=e[s];break;case 11:case 14:this.$=e[s-2]+"."+e[s];break;case 12:case 16:this.$=e[s-1]+e[s];break;case 17:case 18:this.$=e[s-1]+"~"+e[s]+"~";break;case 19:l.addRelation(e[s]);break;case 20:e[s-1].title=l.cleanupLabel(e[s]),l.addRelation(e[s-1]);break;case 31:this.$=e[s].trim(),l.setAccTitle(this.$);break;case 32:case 33:this.$=e[s].trim(),l.setAccDescription(this.$);break;case 34:l.addClassesToNamespace(e[s-3],e[s-1][0],e[s-1][1]),l.popNamespace();break;case 35:l.addClassesToNamespace(e[s-4],e[s-1][0],e[s-1][1]),l.popNamespace();break;case 36:this.$=l.addNamespace(e[s]);break;case 37:this.$=l.addNamespace(e[s-1],e[s]);break;case 38:this.$=[[e[s]],[]];break;case 39:this.$=[[e[s-1]],[]];break;case 40:e[s][0].unshift(e[s-2]),this.$=e[s];break;case 41:this.$=[[],[e[s]]];break;case 42:this.$=[[],[e[s-1]]];break;case 43:e[s][1].unshift(e[s-2]),this.$=e[s];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=e[s];break;case 48:l.setCssClass(e[s-2],e[s]);break;case 49:l.addMembers(e[s-3],e[s-1]);break;case 51:l.setCssClass(e[s-5],e[s-3]),l.addMembers(e[s-5],e[s-1]);break;case 52:l.addAnnotation(e[s-3],e[s-1]);break;case 53:l.addAnnotation(e[s-6],e[s-4]),l.addMembers(e[s-6],e[s-1]);break;case 54:l.addAnnotation(e[s-5],e[s-3]);break;case 55:this.$=e[s],l.addClass(e[s]);break;case 56:this.$=e[s-1],l.addClass(e[s-1]),l.setClassLabel(e[s-1],e[s]);break;case 60:l.addAnnotation(e[s],e[s-2]);break;case 61:case 74:this.$=[e[s]];break;case 62:e[s].push(e[s-1]),this.$=e[s];break;case 63:break;case 64:l.addMember(e[s-1],l.cleanupLabel(e[s]));break;case 65:break;case 66:break;case 67:this.$={id1:e[s-2],id2:e[s],relation:e[s-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:e[s-3],id2:e[s],relation:e[s-1],relationTitle1:e[s-2],relationTitle2:"none"};break;case 69:this.$={id1:e[s-3],id2:e[s],relation:e[s-2],relationTitle1:"none",relationTitle2:e[s-1]};break;case 70:this.$={id1:e[s-4],id2:e[s],relation:e[s-2],relationTitle1:e[s-3],relationTitle2:e[s-1]};break;case 71:this.$=l.addNote(e[s],e[s-1]);break;case 72:this.$=l.addNote(e[s]);break;case 73:this.$=e[s-2],l.defineClass(e[s-1],e[s]);break;case 75:this.$=e[s-2].concat([e[s]]);break;case 76:l.setDirection("TB");break;case 77:l.setDirection("BT");break;case 78:l.setDirection("RL");break;case 79:l.setDirection("LR");break;case 80:this.$={type1:e[s-2],type2:e[s],lineType:e[s-1]};break;case 81:this.$={type1:"none",type2:e[s],lineType:e[s-1]};break;case 82:this.$={type1:e[s-1],type2:"none",lineType:e[s]};break;case 83:this.$={type1:"none",type2:"none",lineType:e[s]};break;case 84:this.$=l.relationType.AGGREGATION;break;case 85:this.$=l.relationType.EXTENSION;break;case 86:this.$=l.relationType.COMPOSITION;break;case 87:this.$=l.relationType.DEPENDENCY;break;case 88:this.$=l.relationType.LOLLIPOP;break;case 89:this.$=l.lineType.LINE;break;case 90:this.$=l.lineType.DOTTED_LINE;break;case 91:case 97:this.$=e[s-2],l.setClickEvent(e[s-1],e[s]);break;case 92:case 98:this.$=e[s-3],l.setClickEvent(e[s-2],e[s-1]),l.setTooltip(e[s-2],e[s]);break;case 93:this.$=e[s-2],l.setLink(e[s-1],e[s]);break;case 94:this.$=e[s-3],l.setLink(e[s-2],e[s-1],e[s]);break;case 95:this.$=e[s-3],l.setLink(e[s-2],e[s-1]),l.setTooltip(e[s-2],e[s]);break;case 96:this.$=e[s-4],l.setLink(e[s-3],e[s-2],e[s]),l.setTooltip(e[s-3],e[s-1]);break;case 99:this.$=e[s-3],l.setClickEvent(e[s-2],e[s-1],e[s]);break;case 100:this.$=e[s-4],l.setClickEvent(e[s-3],e[s-2],e[s-1]),l.setTooltip(e[s-3],e[s]);break;case 101:this.$=e[s-3],l.setLink(e[s-2],e[s]);break;case 102:this.$=e[s-4],l.setLink(e[s-3],e[s-1],e[s]);break;case 103:this.$=e[s-4],l.setLink(e[s-3],e[s-1]),l.setTooltip(e[s-3],e[s]);break;case 104:this.$=e[s-5],l.setLink(e[s-4],e[s-2],e[s]),l.setTooltip(e[s-4],e[s-1]);break;case 105:this.$=e[s-2],l.setCssStyle(e[s-1],e[s]);break;case 106:l.setCssClass(e[s-1],e[s]);break;case 107:this.$=[e[s]];break;case 108:e[s-2].push(e[s]),this.$=e[s-2];break;case 110:this.$=e[s-1]+e[s];break}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:n,38:22,42:r,43:23,46:c,48:u,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},t(De,[2,5],{8:[1,48]}),{8:[1,49]},t(A,[2,19],{22:[1,50]}),t(A,[2,21]),t(A,[2,22]),t(A,[2,23]),t(A,[2,24]),t(A,[2,25]),t(A,[2,26]),t(A,[2,27]),t(A,[2,28]),t(A,[2,29]),t(A,[2,30]),{34:[1,51]},{36:[1,52]},t(A,[2,33]),t(A,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:Z,69:$,70:ee,71:te,72:se,73:Fe,74:Be}),{39:[1,65]},t(_,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),t(A,[2,65]),t(A,[2,66]),{16:69,60:b,86:k,100:E,102:T},{16:39,17:40,19:70,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:71,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:72,60:b,86:k,100:E,102:T,103:y},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:b,86:k,100:E,102:T,103:y},{13:Pe,55:76},{58:78,60:[1,79]},t(A,[2,76]),t(A,[2,77]),t(A,[2,78]),t(A,[2,79]),t(M,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:b,86:k,100:E,102:T,103:y}),t(M,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:87,60:b,86:k,100:E,102:T,103:y},t(ie,[2,133]),t(ie,[2,134]),t(ie,[2,135]),t(ie,[2,136]),t([1,8,9,12,13,20,22,39,41,44,46,68,69,70,71,72,73,74,79,81],[2,137]),t(De,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:88,33:i,35:a,37:n,42:r,46:c,48:u,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y}),{5:89,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:n,38:22,42:r,43:23,46:c,48:u,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y},t(A,[2,20]),t(A,[2,31]),t(A,[2,32]),{13:[1,91],16:39,17:40,19:90,60:b,86:k,100:E,102:T,103:y},{53:92,66:56,67:57,68:Z,69:$,70:ee,71:te,72:se,73:Fe,74:Be},t(A,[2,64]),{67:93,73:Fe,74:Be},t(ae,[2,83],{66:94,68:Z,69:$,70:ee,71:te,72:se}),t(U,[2,84]),t(U,[2,85]),t(U,[2,86]),t(U,[2,87]),t(U,[2,88]),t(Me,[2,89]),t(Me,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:r,43:23,48:u,54:g,56:N},{16:100,60:b,86:k,100:E,102:T},{41:[1,102],45:101,51:ne},{16:104,60:b,86:k,100:E,102:T},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:z,50:Y,59:110,60:K,82:W,84:111,85:112,86:Q,87:j,88:X,89:q,90:H},{60:[1,122]},{13:Pe,55:123},t(_,[2,72]),t(_,[2,138]),{22:z,50:Y,59:124,60:K,61:[1,125],82:W,84:111,85:112,86:Q,87:j,88:X,89:q,90:H},t(Re,[2,74]),{16:39,17:40,19:126,60:b,86:k,100:E,102:T,103:y},t(M,[2,16]),t(M,[2,17]),t(M,[2,18]),{11:127,12:Ge,39:[2,36]},t(re,[2,9],{16:85,17:86,15:130,18:[1,129],60:b,86:k,100:E,102:T,103:y}),t(re,[2,10]),t(_e,[2,55],{11:131,12:Ge}),t(De,[2,7]),{9:[1,132]},t(ue,[2,67]),{16:39,17:40,19:133,60:b,86:k,100:E,102:T,103:y},{13:[1,135],16:39,17:40,19:134,60:b,86:k,100:E,102:T,103:y},t(ae,[2,82],{66:136,68:Z,69:$,70:ee,71:te,72:se}),t(ae,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:r,43:23,48:u,54:g,56:N},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},t(_,[2,48],{39:[1,142]}),{41:[1,143]},t(_,[2,50]),{41:[2,61],45:144,51:ne},{47:[1,145]},{16:39,17:40,19:146,60:b,86:k,100:E,102:T,103:y},t(A,[2,91],{13:[1,147]}),t(A,[2,93],{13:[1,149],77:[1,148]}),t(A,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},t(A,[2,105],{61:Ue}),t(ze,[2,107],{85:154,22:z,50:Y,60:K,82:W,86:Q,87:j,88:X,89:q,90:H}),t(x,[2,109]),t(x,[2,111]),t(x,[2,112]),t(x,[2,113]),t(x,[2,114]),t(x,[2,115]),t(x,[2,116]),t(x,[2,117]),t(x,[2,118]),t(x,[2,119]),t(A,[2,106]),t(_,[2,71]),t(A,[2,73],{61:Ue}),{60:[1,155]},t(M,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:b,86:k,100:E,102:T,103:y},t(re,[2,12]),t(_e,[2,56]),{1:[2,4]},t(ue,[2,69]),t(ue,[2,68]),{16:39,17:40,19:158,60:b,86:k,100:E,102:T,103:y},t(ae,[2,80]),t(_,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:r,43:23,48:u,54:g,56:N},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:r,43:23,48:u,54:g,56:N},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:r,43:23,48:u,54:g,56:N},{45:163,51:ne},t(_,[2,49]),{41:[2,62]},t(_,[2,52],{39:[1,164]}),t(A,[2,60]),t(A,[2,92]),t(A,[2,94]),t(A,[2,95],{77:[1,165]}),t(A,[2,98]),t(A,[2,99],{13:[1,166]}),t(A,[2,101],{13:[1,168],77:[1,167]}),{22:z,50:Y,60:K,82:W,84:169,85:112,86:Q,87:j,88:X,89:q,90:H},t(x,[2,110]),t(Re,[2,75]),{14:[1,170]},t(re,[2,11]),t(ue,[2,70]),t(_,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:ne},t(A,[2,96]),t(A,[2,100]),t(A,[2,102]),t(A,[2,103],{77:[1,174]}),t(ze,[2,108],{85:154,22:z,50:Y,60:K,82:W,86:Q,87:j,88:X,89:q,90:H}),t(_e,[2,8]),t(_,[2,51]),{41:[1,175]},t(_,[2,54]),t(A,[2,104]),t(_,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:f(function(o,h){if(h.recoverable)this.trace(o);else{var p=new Error(o);throw p.hash=h,p}},"parseError"),parse:f(function(o){var h=this,p=[0],l=[],C=[null],e=[],J=this.table,s="",ce=0,Ye=0,Je=2,Ke=1,Ze=e.slice.call(arguments,1),D=Object.create(this.lexer),w={yy:{}};for(var Ne in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ne)&&(w.yy[Ne]=this.yy[Ne]);D.setInput(o,w.yy),w.yy.lexer=D,w.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var Le=D.yylloc;e.push(Le);var $e=D.options&&D.options.ranges;typeof w.yy.parseError=="function"?this.parseError=w.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function et(S){p.length=p.length-2*S,C.length=C.length-S,e.length=e.length-S}f(et,"popStack");function We(){var S;return S=l.pop()||D.lex()||Ke,typeof S!="number"&&(S instanceof Array&&(l=S,S=l.pop()),S=h.symbols_[S]||S),S}f(We,"lex");for(var B,V,L,xe,R={},oe,v,Qe,he;;){if(V=p[p.length-1],this.defaultActions[V]?L=this.defaultActions[V]:((B===null||typeof B>"u")&&(B=We()),L=J[V]&&J[V][B]),typeof L>"u"||!L.length||!L[0]){var ve="";he=[];for(oe in J[V])this.terminals_[oe]&&oe>Je&&he.push("'"+this.terminals_[oe]+"'");D.showPosition?ve="Parse error on line "+(ce+1)+`: +import{g as tt}from"./chunk-5VM5RSS4-BJR-VYAu.js";import{g as st}from"./chunk-XXDRQBXY-D_bv9kM4.js";import{s as it}from"./chunk-VR4S4FIN-C_RujyXt.js";import{_ as f,l as Ie,c as F,u as at,v as nt,x as Oe,d as de,a5 as rt,b as ut,a as lt,s as ct,g as ot,n as ht,o as dt,k as I,p as pt,q as At,i as ft,a6 as G}from"./mermaid.core-WW7RuneT.js";import{f as gt}from"./chunk-32BRIVSS-CRTrWqUr.js";var we=(function(){var t=f(function(O,o,h,p){for(h=h||{},p=O.length;p--;h[O[p]]=o);return h},"o"),i=[1,18],a=[1,19],n=[1,20],r=[1,41],c=[1,26],u=[1,42],d=[1,24],m=[1,25],g=[1,32],N=[1,33],Ae=[1,34],b=[1,45],fe=[1,35],ge=[1,36],me=[1,37],Ce=[1,38],be=[1,27],ke=[1,28],Ee=[1,29],Te=[1,30],ye=[1,31],k=[1,44],E=[1,46],T=[1,43],y=[1,47],De=[1,9],A=[1,8,9],Z=[1,58],$=[1,59],ee=[1,60],te=[1,61],se=[1,62],Fe=[1,63],Be=[1,64],_=[1,8,9,41],Pe=[1,77],M=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],ie=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],ae=[13,60,86,100,102,103],U=[13,60,73,74,86,100,102,103],Me=[13,60,68,69,70,71,72,86,100,102,103],ne=[1,103],z=[1,121],Y=[1,117],K=[1,113],W=[1,119],Q=[1,114],j=[1,115],X=[1,116],q=[1,118],H=[1,120],Re=[22,50,60,61,82,86,87,88,89,90],Ge=[1,128],re=[12,39],_e=[1,8,9,39,41,44,46],ue=[1,8,9,22],Ue=[1,153],ze=[1,8,9,61],x=[1,8,9,22,50,60,61,82,86,87,88,89,90],Se={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,ANNOTATION_START:46,ANNOTATION_END:47,CLASS:48,emptyBody:49,SPACE:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",18:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"ANNOTATION_START",47:"ANNOTATION_END",48:"CLASS",50:"SPACE",51:"MEMBER",52:"SEPARATOR",54:"NOTE_FOR",56:"NOTE",57:"CLASSDEF",60:"ALPHA",61:"COMMA",62:"direction_tb",63:"direction_bt",64:"direction_rl",65:"direction_lr",68:"AGGREGATION",69:"EXTENSION",70:"COMPOSITION",71:"DEPENDENCY",72:"LOLLIPOP",73:"LINE",74:"DOTTED_LINE",75:"CALLBACK",76:"LINK",77:"LINK_TARGET",78:"CLICK",79:"CALLBACK_NAME",80:"CALLBACK_ARGS",81:"HREF",82:"STYLE",83:"CSSCLASS",86:"NUM",87:"COLON",88:"UNIT",89:"BRKT",90:"PCT",93:"graphCodeTokens",95:"TAGSTART",96:"TAGEND",97:"==",98:"--",99:"DEFAULT",100:"MINUS",101:"keywords",102:"UNICODE_TEXT",103:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[38,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[24,4],[24,7],[24,6],[43,2],[43,3],[49,0],[49,2],[49,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:f(function(o,h,p,l,C,e,J){var s=e.length-1;switch(C){case 8:this.$=e[s-1];break;case 9:case 10:case 13:case 15:this.$=e[s];break;case 11:case 14:this.$=e[s-2]+"."+e[s];break;case 12:case 16:this.$=e[s-1]+e[s];break;case 17:case 18:this.$=e[s-1]+"~"+e[s]+"~";break;case 19:l.addRelation(e[s]);break;case 20:e[s-1].title=l.cleanupLabel(e[s]),l.addRelation(e[s-1]);break;case 31:this.$=e[s].trim(),l.setAccTitle(this.$);break;case 32:case 33:this.$=e[s].trim(),l.setAccDescription(this.$);break;case 34:l.addClassesToNamespace(e[s-3],e[s-1][0],e[s-1][1]),l.popNamespace();break;case 35:l.addClassesToNamespace(e[s-4],e[s-1][0],e[s-1][1]),l.popNamespace();break;case 36:this.$=l.addNamespace(e[s]);break;case 37:this.$=l.addNamespace(e[s-1],e[s]);break;case 38:this.$=[[e[s]],[]];break;case 39:this.$=[[e[s-1]],[]];break;case 40:e[s][0].unshift(e[s-2]),this.$=e[s];break;case 41:this.$=[[],[e[s]]];break;case 42:this.$=[[],[e[s-1]]];break;case 43:e[s][1].unshift(e[s-2]),this.$=e[s];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=e[s];break;case 48:l.setCssClass(e[s-2],e[s]);break;case 49:l.addMembers(e[s-3],e[s-1]);break;case 51:l.setCssClass(e[s-5],e[s-3]),l.addMembers(e[s-5],e[s-1]);break;case 52:l.addAnnotation(e[s-3],e[s-1]);break;case 53:l.addAnnotation(e[s-6],e[s-4]),l.addMembers(e[s-6],e[s-1]);break;case 54:l.addAnnotation(e[s-5],e[s-3]);break;case 55:this.$=e[s],l.addClass(e[s]);break;case 56:this.$=e[s-1],l.addClass(e[s-1]),l.setClassLabel(e[s-1],e[s]);break;case 60:l.addAnnotation(e[s],e[s-2]);break;case 61:case 74:this.$=[e[s]];break;case 62:e[s].push(e[s-1]),this.$=e[s];break;case 63:break;case 64:l.addMember(e[s-1],l.cleanupLabel(e[s]));break;case 65:break;case 66:break;case 67:this.$={id1:e[s-2],id2:e[s],relation:e[s-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:e[s-3],id2:e[s],relation:e[s-1],relationTitle1:e[s-2],relationTitle2:"none"};break;case 69:this.$={id1:e[s-3],id2:e[s],relation:e[s-2],relationTitle1:"none",relationTitle2:e[s-1]};break;case 70:this.$={id1:e[s-4],id2:e[s],relation:e[s-2],relationTitle1:e[s-3],relationTitle2:e[s-1]};break;case 71:this.$=l.addNote(e[s],e[s-1]);break;case 72:this.$=l.addNote(e[s]);break;case 73:this.$=e[s-2],l.defineClass(e[s-1],e[s]);break;case 75:this.$=e[s-2].concat([e[s]]);break;case 76:l.setDirection("TB");break;case 77:l.setDirection("BT");break;case 78:l.setDirection("RL");break;case 79:l.setDirection("LR");break;case 80:this.$={type1:e[s-2],type2:e[s],lineType:e[s-1]};break;case 81:this.$={type1:"none",type2:e[s],lineType:e[s-1]};break;case 82:this.$={type1:e[s-1],type2:"none",lineType:e[s]};break;case 83:this.$={type1:"none",type2:"none",lineType:e[s]};break;case 84:this.$=l.relationType.AGGREGATION;break;case 85:this.$=l.relationType.EXTENSION;break;case 86:this.$=l.relationType.COMPOSITION;break;case 87:this.$=l.relationType.DEPENDENCY;break;case 88:this.$=l.relationType.LOLLIPOP;break;case 89:this.$=l.lineType.LINE;break;case 90:this.$=l.lineType.DOTTED_LINE;break;case 91:case 97:this.$=e[s-2],l.setClickEvent(e[s-1],e[s]);break;case 92:case 98:this.$=e[s-3],l.setClickEvent(e[s-2],e[s-1]),l.setTooltip(e[s-2],e[s]);break;case 93:this.$=e[s-2],l.setLink(e[s-1],e[s]);break;case 94:this.$=e[s-3],l.setLink(e[s-2],e[s-1],e[s]);break;case 95:this.$=e[s-3],l.setLink(e[s-2],e[s-1]),l.setTooltip(e[s-2],e[s]);break;case 96:this.$=e[s-4],l.setLink(e[s-3],e[s-2],e[s]),l.setTooltip(e[s-3],e[s-1]);break;case 99:this.$=e[s-3],l.setClickEvent(e[s-2],e[s-1],e[s]);break;case 100:this.$=e[s-4],l.setClickEvent(e[s-3],e[s-2],e[s-1]),l.setTooltip(e[s-3],e[s]);break;case 101:this.$=e[s-3],l.setLink(e[s-2],e[s]);break;case 102:this.$=e[s-4],l.setLink(e[s-3],e[s-1],e[s]);break;case 103:this.$=e[s-4],l.setLink(e[s-3],e[s-1]),l.setTooltip(e[s-3],e[s]);break;case 104:this.$=e[s-5],l.setLink(e[s-4],e[s-2],e[s]),l.setTooltip(e[s-4],e[s-1]);break;case 105:this.$=e[s-2],l.setCssStyle(e[s-1],e[s]);break;case 106:l.setCssClass(e[s-1],e[s]);break;case 107:this.$=[e[s]];break;case 108:e[s-2].push(e[s]),this.$=e[s-2];break;case 110:this.$=e[s-1]+e[s];break}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:n,38:22,42:r,43:23,46:c,48:u,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},t(De,[2,5],{8:[1,48]}),{8:[1,49]},t(A,[2,19],{22:[1,50]}),t(A,[2,21]),t(A,[2,22]),t(A,[2,23]),t(A,[2,24]),t(A,[2,25]),t(A,[2,26]),t(A,[2,27]),t(A,[2,28]),t(A,[2,29]),t(A,[2,30]),{34:[1,51]},{36:[1,52]},t(A,[2,33]),t(A,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:Z,69:$,70:ee,71:te,72:se,73:Fe,74:Be}),{39:[1,65]},t(_,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),t(A,[2,65]),t(A,[2,66]),{16:69,60:b,86:k,100:E,102:T},{16:39,17:40,19:70,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:71,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:72,60:b,86:k,100:E,102:T,103:y},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:b,86:k,100:E,102:T,103:y},{13:Pe,55:76},{58:78,60:[1,79]},t(A,[2,76]),t(A,[2,77]),t(A,[2,78]),t(A,[2,79]),t(M,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:b,86:k,100:E,102:T,103:y}),t(M,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:87,60:b,86:k,100:E,102:T,103:y},t(ie,[2,133]),t(ie,[2,134]),t(ie,[2,135]),t(ie,[2,136]),t([1,8,9,12,13,20,22,39,41,44,46,68,69,70,71,72,73,74,79,81],[2,137]),t(De,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:88,33:i,35:a,37:n,42:r,46:c,48:u,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y}),{5:89,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:n,38:22,42:r,43:23,46:c,48:u,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y},t(A,[2,20]),t(A,[2,31]),t(A,[2,32]),{13:[1,91],16:39,17:40,19:90,60:b,86:k,100:E,102:T,103:y},{53:92,66:56,67:57,68:Z,69:$,70:ee,71:te,72:se,73:Fe,74:Be},t(A,[2,64]),{67:93,73:Fe,74:Be},t(ae,[2,83],{66:94,68:Z,69:$,70:ee,71:te,72:se}),t(U,[2,84]),t(U,[2,85]),t(U,[2,86]),t(U,[2,87]),t(U,[2,88]),t(Me,[2,89]),t(Me,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:r,43:23,48:u,54:g,56:N},{16:100,60:b,86:k,100:E,102:T},{41:[1,102],45:101,51:ne},{16:104,60:b,86:k,100:E,102:T},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:z,50:Y,59:110,60:K,82:W,84:111,85:112,86:Q,87:j,88:X,89:q,90:H},{60:[1,122]},{13:Pe,55:123},t(_,[2,72]),t(_,[2,138]),{22:z,50:Y,59:124,60:K,61:[1,125],82:W,84:111,85:112,86:Q,87:j,88:X,89:q,90:H},t(Re,[2,74]),{16:39,17:40,19:126,60:b,86:k,100:E,102:T,103:y},t(M,[2,16]),t(M,[2,17]),t(M,[2,18]),{11:127,12:Ge,39:[2,36]},t(re,[2,9],{16:85,17:86,15:130,18:[1,129],60:b,86:k,100:E,102:T,103:y}),t(re,[2,10]),t(_e,[2,55],{11:131,12:Ge}),t(De,[2,7]),{9:[1,132]},t(ue,[2,67]),{16:39,17:40,19:133,60:b,86:k,100:E,102:T,103:y},{13:[1,135],16:39,17:40,19:134,60:b,86:k,100:E,102:T,103:y},t(ae,[2,82],{66:136,68:Z,69:$,70:ee,71:te,72:se}),t(ae,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:r,43:23,48:u,54:g,56:N},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},t(_,[2,48],{39:[1,142]}),{41:[1,143]},t(_,[2,50]),{41:[2,61],45:144,51:ne},{47:[1,145]},{16:39,17:40,19:146,60:b,86:k,100:E,102:T,103:y},t(A,[2,91],{13:[1,147]}),t(A,[2,93],{13:[1,149],77:[1,148]}),t(A,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},t(A,[2,105],{61:Ue}),t(ze,[2,107],{85:154,22:z,50:Y,60:K,82:W,86:Q,87:j,88:X,89:q,90:H}),t(x,[2,109]),t(x,[2,111]),t(x,[2,112]),t(x,[2,113]),t(x,[2,114]),t(x,[2,115]),t(x,[2,116]),t(x,[2,117]),t(x,[2,118]),t(x,[2,119]),t(A,[2,106]),t(_,[2,71]),t(A,[2,73],{61:Ue}),{60:[1,155]},t(M,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:b,86:k,100:E,102:T,103:y},t(re,[2,12]),t(_e,[2,56]),{1:[2,4]},t(ue,[2,69]),t(ue,[2,68]),{16:39,17:40,19:158,60:b,86:k,100:E,102:T,103:y},t(ae,[2,80]),t(_,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:r,43:23,48:u,54:g,56:N},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:r,43:23,48:u,54:g,56:N},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:r,43:23,48:u,54:g,56:N},{45:163,51:ne},t(_,[2,49]),{41:[2,62]},t(_,[2,52],{39:[1,164]}),t(A,[2,60]),t(A,[2,92]),t(A,[2,94]),t(A,[2,95],{77:[1,165]}),t(A,[2,98]),t(A,[2,99],{13:[1,166]}),t(A,[2,101],{13:[1,168],77:[1,167]}),{22:z,50:Y,60:K,82:W,84:169,85:112,86:Q,87:j,88:X,89:q,90:H},t(x,[2,110]),t(Re,[2,75]),{14:[1,170]},t(re,[2,11]),t(ue,[2,70]),t(_,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:ne},t(A,[2,96]),t(A,[2,100]),t(A,[2,102]),t(A,[2,103],{77:[1,174]}),t(ze,[2,108],{85:154,22:z,50:Y,60:K,82:W,86:Q,87:j,88:X,89:q,90:H}),t(_e,[2,8]),t(_,[2,51]),{41:[1,175]},t(_,[2,54]),t(A,[2,104]),t(_,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:f(function(o,h){if(h.recoverable)this.trace(o);else{var p=new Error(o);throw p.hash=h,p}},"parseError"),parse:f(function(o){var h=this,p=[0],l=[],C=[null],e=[],J=this.table,s="",ce=0,Ye=0,Je=2,Ke=1,Ze=e.slice.call(arguments,1),D=Object.create(this.lexer),w={yy:{}};for(var Ne in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ne)&&(w.yy[Ne]=this.yy[Ne]);D.setInput(o,w.yy),w.yy.lexer=D,w.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var Le=D.yylloc;e.push(Le);var $e=D.options&&D.options.ranges;typeof w.yy.parseError=="function"?this.parseError=w.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function et(S){p.length=p.length-2*S,C.length=C.length-S,e.length=e.length-S}f(et,"popStack");function We(){var S;return S=l.pop()||D.lex()||Ke,typeof S!="number"&&(S instanceof Array&&(l=S,S=l.pop()),S=h.symbols_[S]||S),S}f(We,"lex");for(var B,V,L,xe,R={},oe,v,Qe,he;;){if(V=p[p.length-1],this.defaultActions[V]?L=this.defaultActions[V]:((B===null||typeof B>"u")&&(B=We()),L=J[V]&&J[V][B]),typeof L>"u"||!L.length||!L[0]){var ve="";he=[];for(oe in J[V])this.terminals_[oe]&&oe>Je&&he.push("'"+this.terminals_[oe]+"'");D.showPosition?ve="Parse error on line "+(ce+1)+`: `+D.showPosition()+` Expecting `+he.join(", ")+", got '"+(this.terminals_[B]||B)+"'":ve="Parse error on line "+(ce+1)+": Unexpected "+(B==Ke?"end of input":"'"+(this.terminals_[B]||B)+"'"),this.parseError(ve,{text:D.match,token:this.terminals_[B]||B,line:D.yylineno,loc:Le,expected:he})}if(L[0]instanceof Array&&L.length>1)throw new Error("Parse Error: multiple actions possible at state: "+V+", token: "+B);switch(L[0]){case 1:p.push(B),C.push(D.yytext),e.push(D.yylloc),p.push(L[1]),B=null,Ye=D.yyleng,s=D.yytext,ce=D.yylineno,Le=D.yylloc;break;case 2:if(v=this.productions_[L[1]][1],R.$=C[C.length-v],R._$={first_line:e[e.length-(v||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(v||1)].first_column,last_column:e[e.length-1].last_column},$e&&(R._$.range=[e[e.length-(v||1)].range[0],e[e.length-1].range[1]]),xe=this.performAction.apply(R,[s,Ye,ce,w.yy,L[1],C,e].concat(Ze)),typeof xe<"u")return xe;v&&(p=p.slice(0,-1*v*2),C=C.slice(0,-1*v),e=e.slice(0,-1*v)),p.push(this.productions_[L[1]][0]),C.push(R.$),e.push(R._$),Qe=J[p[p.length-2]][p[p.length-1]],p.push(Qe);break;case 3:return!0}}return!0},"parse")},He=(function(){var O={EOF:1,parseError:f(function(h,p){if(this.yy.parser)this.yy.parser.parseError(h,p);else throw new Error(h)},"parseError"),setInput:f(function(o,h){return this.yy=h||this.yy||{},this._input=o,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:f(function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var h=o.match(/(?:\r\n?|\n).*/g);return h?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),o},"input"),unput:f(function(o){var h=o.length,p=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-h),this.offset-=h;var l=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),p.length-1&&(this.yylineno-=p.length-1);var C=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:p?(p.length===l.length?this.yylloc.first_column:0)+l[l.length-p.length].length-p[0].length:this.yylloc.first_column-h},this.options.ranges&&(this.yylloc.range=[C[0],C[0]+this.yyleng-h]),this.yyleng=this.yytext.length,this},"unput"),more:f(function(){return this._more=!0,this},"more"),reject:f(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:f(function(o){this.unput(this.match.slice(o))},"less"),pastInput:f(function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:f(function(){var o=this.match;return o.length<20&&(o+=this._input.substr(0,20-o.length)),(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:f(function(){var o=this.pastInput(),h=new Array(o.length+1).join("-");return o+this.upcomingInput()+` diff --git a/apps/kimi-code/dist-web/assets/chunk-VR4S4FIN-DW1NNlBr.js b/apps/kimi-code/dist-web/assets/chunk-VR4S4FIN-C_RujyXt.js similarity index 87% rename from apps/kimi-code/dist-web/assets/chunk-VR4S4FIN-DW1NNlBr.js rename to apps/kimi-code/dist-web/assets/chunk-VR4S4FIN-C_RujyXt.js index 5d3f7a2473..fdb77d4562 100644 --- a/apps/kimi-code/dist-web/assets/chunk-VR4S4FIN-DW1NNlBr.js +++ b/apps/kimi-code/dist-web/assets/chunk-VR4S4FIN-C_RujyXt.js @@ -1 +1 @@ -import{_ as a,e as w,l as x}from"./mermaid.core-CqiFQExc.js";var d=a((e,t,i,r)=>{e.attr("class",i);const{width:o,height:h,x:n,y:c}=u(e,t);w(e,h,o,r);const s=l(n,c,o,h,t);e.attr("viewBox",s),x.debug(`viewBox configured: ${s} with padding: ${t}`)},"setupViewPortForSVG"),u=a((e,t)=>{const i=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:i.width+t*2,height:i.height+t*2,x:i.x,y:i.y}},"calculateDimensionsWithPadding"),l=a((e,t,i,r,o)=>`${e-o} ${t-o} ${i} ${r}`,"createViewBox");export{d as s}; +import{_ as a,e as w,l as x}from"./mermaid.core-WW7RuneT.js";var d=a((e,t,i,r)=>{e.attr("class",i);const{width:o,height:h,x:n,y:c}=u(e,t);w(e,h,o,r);const s=l(n,c,o,h,t);e.attr("viewBox",s),x.debug(`viewBox configured: ${s} with padding: ${t}`)},"setupViewPortForSVG"),u=a((e,t)=>{const i=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:i.width+t*2,height:i.height+t*2,x:i.x,y:i.y}},"calculateDimensionsWithPadding"),l=a((e,t,i,r,o)=>`${e-o} ${t-o} ${i} ${r}`,"createViewBox");export{d as s}; diff --git a/apps/kimi-code/dist-web/assets/chunk-XXDRQBXY-4LplLZkT.js b/apps/kimi-code/dist-web/assets/chunk-XXDRQBXY-D_bv9kM4.js similarity index 72% rename from apps/kimi-code/dist-web/assets/chunk-XXDRQBXY-4LplLZkT.js rename to apps/kimi-code/dist-web/assets/chunk-XXDRQBXY-D_bv9kM4.js index ab05162271..921e62e77f 100644 --- a/apps/kimi-code/dist-web/assets/chunk-XXDRQBXY-4LplLZkT.js +++ b/apps/kimi-code/dist-web/assets/chunk-XXDRQBXY-D_bv9kM4.js @@ -1 +1 @@ -import{_ as a,d as o}from"./mermaid.core-CqiFQExc.js";var d=a((t,e)=>{let n;return e==="sandbox"&&(n=o("#i"+t)),(e==="sandbox"?o(n.nodes()[0].contentDocument.body):o("body")).select(`[id="${t}"]`)},"getDiagramElement");export{d as g}; +import{_ as a,d as o}from"./mermaid.core-WW7RuneT.js";var d=a((t,e)=>{let n;return e==="sandbox"&&(n=o("#i"+t)),(e==="sandbox"?o(n.nodes()[0].contentDocument.body):o("body")).select(`[id="${t}"]`)},"getDiagramElement");export{d as g}; diff --git a/apps/kimi-code/dist-web/assets/classDiagram-OUVF2IWQ-DDHH-ciJ.js b/apps/kimi-code/dist-web/assets/classDiagram-OUVF2IWQ-DDHH-ciJ.js deleted file mode 100644 index 1c821ae8f5..0000000000 --- a/apps/kimi-code/dist-web/assets/classDiagram-OUVF2IWQ-DDHH-ciJ.js +++ /dev/null @@ -1 +0,0 @@ -import{s as a,c as s,a as e,C as t}from"./chunk-V7JOEXUC-Ci6LL3n4.js";import{_ as i}from"./mermaid.core-CqiFQExc.js";import"./chunk-5VM5RSS4-BRWxG5tM.js";import"./chunk-XXDRQBXY-4LplLZkT.js";import"./chunk-VR4S4FIN-DW1NNlBr.js";import"./chunk-32BRIVSS-mfMW4-bV.js";import"./index--0t1wzw_.js";import"./_commonjsHelpers-CqkleIqs.js";var f={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{f as diagram}; diff --git a/apps/kimi-code/dist-web/assets/classDiagram-OUVF2IWQ-DLwxkoRX.js b/apps/kimi-code/dist-web/assets/classDiagram-OUVF2IWQ-DLwxkoRX.js new file mode 100644 index 0000000000..931a051ed2 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/classDiagram-OUVF2IWQ-DLwxkoRX.js @@ -0,0 +1 @@ +import{s as a,c as s,a as e,C as t}from"./chunk-V7JOEXUC-BBRs-W-z.js";import{_ as i}from"./mermaid.core-WW7RuneT.js";import"./chunk-5VM5RSS4-BJR-VYAu.js";import"./chunk-XXDRQBXY-D_bv9kM4.js";import"./chunk-VR4S4FIN-C_RujyXt.js";import"./chunk-32BRIVSS-CRTrWqUr.js";import"./index-CiHMlsuo.js";import"./_commonjsHelpers-CqkleIqs.js";var f={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{f as diagram}; diff --git a/apps/kimi-code/dist-web/assets/classDiagram-v2-EOCWNBFH-DDHH-ciJ.js b/apps/kimi-code/dist-web/assets/classDiagram-v2-EOCWNBFH-DDHH-ciJ.js deleted file mode 100644 index 1c821ae8f5..0000000000 --- a/apps/kimi-code/dist-web/assets/classDiagram-v2-EOCWNBFH-DDHH-ciJ.js +++ /dev/null @@ -1 +0,0 @@ -import{s as a,c as s,a as e,C as t}from"./chunk-V7JOEXUC-Ci6LL3n4.js";import{_ as i}from"./mermaid.core-CqiFQExc.js";import"./chunk-5VM5RSS4-BRWxG5tM.js";import"./chunk-XXDRQBXY-4LplLZkT.js";import"./chunk-VR4S4FIN-DW1NNlBr.js";import"./chunk-32BRIVSS-mfMW4-bV.js";import"./index--0t1wzw_.js";import"./_commonjsHelpers-CqkleIqs.js";var f={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{f as diagram}; diff --git a/apps/kimi-code/dist-web/assets/classDiagram-v2-EOCWNBFH-DLwxkoRX.js b/apps/kimi-code/dist-web/assets/classDiagram-v2-EOCWNBFH-DLwxkoRX.js new file mode 100644 index 0000000000..931a051ed2 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/classDiagram-v2-EOCWNBFH-DLwxkoRX.js @@ -0,0 +1 @@ +import{s as a,c as s,a as e,C as t}from"./chunk-V7JOEXUC-BBRs-W-z.js";import{_ as i}from"./mermaid.core-WW7RuneT.js";import"./chunk-5VM5RSS4-BJR-VYAu.js";import"./chunk-XXDRQBXY-D_bv9kM4.js";import"./chunk-VR4S4FIN-C_RujyXt.js";import"./chunk-32BRIVSS-CRTrWqUr.js";import"./index-CiHMlsuo.js";import"./_commonjsHelpers-CqkleIqs.js";var f={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{f as diagram}; diff --git a/apps/kimi-code/dist-web/assets/cose-bilkent-JH36ORCC-B9Aj57Fl.js b/apps/kimi-code/dist-web/assets/cose-bilkent-JH36ORCC-DzQyBzbl.js similarity index 99% rename from apps/kimi-code/dist-web/assets/cose-bilkent-JH36ORCC-B9Aj57Fl.js rename to apps/kimi-code/dist-web/assets/cose-bilkent-JH36ORCC-DzQyBzbl.js index dee7e487f1..4fcc151f95 100644 --- a/apps/kimi-code/dist-web/assets/cose-bilkent-JH36ORCC-B9Aj57Fl.js +++ b/apps/kimi-code/dist-web/assets/cose-bilkent-JH36ORCC-DzQyBzbl.js @@ -1 +1 @@ -import{_ as V,l as k,d as lt}from"./mermaid.core-CqiFQExc.js";import{c as tt}from"./cytoscape.esm-OyMbaexL.js";import{g as gt}from"./_commonjsHelpers-CqkleIqs.js";import"./index--0t1wzw_.js";var Z={exports:{}},$={exports:{}},Q={exports:{}},ut=Q.exports,j;function ft(){return j||(j=1,(function(G,b){(function(I,L){G.exports=L()})(ut,function(){return(function(N){var I={};function L(o){if(I[o])return I[o].exports;var e=I[o]={i:o,l:!1,exports:{}};return N[o].call(e.exports,e,e.exports,L),e.l=!0,e.exports}return L.m=N,L.c=I,L.i=function(o){return o},L.d=function(o,e,t){L.o(o,e)||Object.defineProperty(o,e,{configurable:!1,enumerable:!0,get:t})},L.n=function(o){var e=o&&o.__esModule?function(){return o.default}:function(){return o};return L.d(e,"a",e),e},L.o=function(o,e){return Object.prototype.hasOwnProperty.call(o,e)},L.p="",L(L.s=26)})([(function(N,I,L){function o(){}o.QUALITY=1,o.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,o.DEFAULT_INCREMENTAL=!1,o.DEFAULT_ANIMATION_ON_LAYOUT=!0,o.DEFAULT_ANIMATION_DURING_LAYOUT=!1,o.DEFAULT_ANIMATION_PERIOD=50,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,o.DEFAULT_GRAPH_MARGIN=15,o.NODE_DIMENSIONS_INCLUDE_LABELS=!1,o.SIMPLE_NODE_SIZE=40,o.SIMPLE_NODE_HALF_SIZE=o.SIMPLE_NODE_SIZE/2,o.EMPTY_COMPOUND_NODE_SIZE=40,o.MIN_EDGE_LENGTH=1,o.WORLD_BOUNDARY=1e6,o.INITIAL_WORLD_BOUNDARY=o.WORLD_BOUNDARY/1e3,o.WORLD_CENTER_X=1200,o.WORLD_CENTER_Y=900,N.exports=o}),(function(N,I,L){var o=L(2),e=L(8),t=L(9);function i(g,n,d){o.call(this,d),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=d,this.bendpoints=[],this.source=g,this.target=n}i.prototype=Object.create(o.prototype);for(var l in o)i[l]=o[l];i.prototype.getSource=function(){return this.source},i.prototype.getTarget=function(){return this.target},i.prototype.isInterGraph=function(){return this.isInterGraph},i.prototype.getLength=function(){return this.length},i.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},i.prototype.getBendpoints=function(){return this.bendpoints},i.prototype.getLca=function(){return this.lca},i.prototype.getSourceInLca=function(){return this.sourceInLca},i.prototype.getTargetInLca=function(){return this.targetInLca},i.prototype.getOtherEnd=function(g){if(this.source===g)return this.target;if(this.target===g)return this.source;throw"Node is not incident with this edge"},i.prototype.getOtherEndInGraph=function(g,n){for(var d=this.getOtherEnd(g),r=n.getGraphManager().getRoot();;){if(d.getOwner()==n)return d;if(d.getOwner()==r)break;d=d.getOwner().getParent()}return null},i.prototype.updateLength=function(){var g=new Array(4);this.isOverlapingSourceAndTarget=e.getIntersection(this.target.getRect(),this.source.getRect(),g),this.isOverlapingSourceAndTarget||(this.lengthX=g[0]-g[2],this.lengthY=g[1]-g[3],Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},i.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},N.exports=i}),(function(N,I,L){function o(e){this.vGraphObject=e}N.exports=o}),(function(N,I,L){var o=L(2),e=L(10),t=L(13),i=L(0),l=L(16),g=L(4);function n(r,h,a,p){a==null&&p==null&&(p=h),o.call(this,p),r.graphManager!=null&&(r=r.graphManager),this.estimatedSize=e.MIN_VALUE,this.inclusionTreeDepth=e.MAX_VALUE,this.vGraphObject=p,this.edges=[],this.graphManager=r,a!=null&&h!=null?this.rect=new t(h.x,h.y,a.width,a.height):this.rect=new t}n.prototype=Object.create(o.prototype);for(var d in o)n[d]=o[d];n.prototype.getEdges=function(){return this.edges},n.prototype.getChild=function(){return this.child},n.prototype.getOwner=function(){return this.owner},n.prototype.getWidth=function(){return this.rect.width},n.prototype.setWidth=function(r){this.rect.width=r},n.prototype.getHeight=function(){return this.rect.height},n.prototype.setHeight=function(r){this.rect.height=r},n.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},n.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},n.prototype.getCenter=function(){return new g(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},n.prototype.getLocation=function(){return new g(this.rect.x,this.rect.y)},n.prototype.getRect=function(){return this.rect},n.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},n.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},n.prototype.setRect=function(r,h){this.rect.x=r.x,this.rect.y=r.y,this.rect.width=h.width,this.rect.height=h.height},n.prototype.setCenter=function(r,h){this.rect.x=r-this.rect.width/2,this.rect.y=h-this.rect.height/2},n.prototype.setLocation=function(r,h){this.rect.x=r,this.rect.y=h},n.prototype.moveBy=function(r,h){this.rect.x+=r,this.rect.y+=h},n.prototype.getEdgeListToNode=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(p.target==r){if(p.source!=a)throw"Incorrect edge source!";h.push(p)}}),h},n.prototype.getEdgesBetween=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(!(p.source==a||p.target==a))throw"Incorrect edge source and/or target";(p.target==r||p.source==r)&&h.push(p)}),h},n.prototype.getNeighborsList=function(){var r=new Set,h=this;return h.edges.forEach(function(a){if(a.source==h)r.add(a.target);else{if(a.target!=h)throw"Incorrect incidency!";r.add(a.source)}}),r},n.prototype.withChildren=function(){var r=new Set,h,a;if(r.add(this),this.child!=null)for(var p=this.child.getNodes(),v=0;vh&&(this.rect.x-=(this.labelWidth-h)/2,this.setWidth(this.labelWidth)),this.labelHeight>a&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-a)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-a),this.setHeight(this.labelHeight))}}},n.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==e.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},n.prototype.transform=function(r){var h=this.rect.x;h>i.WORLD_BOUNDARY?h=i.WORLD_BOUNDARY:h<-i.WORLD_BOUNDARY&&(h=-i.WORLD_BOUNDARY);var a=this.rect.y;a>i.WORLD_BOUNDARY?a=i.WORLD_BOUNDARY:a<-i.WORLD_BOUNDARY&&(a=-i.WORLD_BOUNDARY);var p=new g(h,a),v=r.inverseTransformPoint(p);this.setLocation(v.x,v.y)},n.prototype.getLeft=function(){return this.rect.x},n.prototype.getRight=function(){return this.rect.x+this.rect.width},n.prototype.getTop=function(){return this.rect.y},n.prototype.getBottom=function(){return this.rect.y+this.rect.height},n.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},N.exports=n}),(function(N,I,L){function o(e,t){e==null&&t==null?(this.x=0,this.y=0):(this.x=e,this.y=t)}o.prototype.getX=function(){return this.x},o.prototype.getY=function(){return this.y},o.prototype.setX=function(e){this.x=e},o.prototype.setY=function(e){this.y=e},o.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},o.prototype.getCopy=function(){return new o(this.x,this.y)},o.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},N.exports=o}),(function(N,I,L){var o=L(2),e=L(10),t=L(0),i=L(6),l=L(3),g=L(1),n=L(13),d=L(12),r=L(11);function h(p,v,D){o.call(this,D),this.estimatedSize=e.MIN_VALUE,this.margin=t.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=p,v!=null&&v instanceof i?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}h.prototype=Object.create(o.prototype);for(var a in o)h[a]=o[a];h.prototype.getNodes=function(){return this.nodes},h.prototype.getEdges=function(){return this.edges},h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getParent=function(){return this.parent},h.prototype.getLeft=function(){return this.left},h.prototype.getRight=function(){return this.right},h.prototype.getTop=function(){return this.top},h.prototype.getBottom=function(){return this.bottom},h.prototype.isConnected=function(){return this.isConnected},h.prototype.add=function(p,v,D){if(v==null&&D==null){var u=p;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(u)>-1)throw"Node already in graph!";return u.owner=this,this.getNodes().push(u),u}else{var T=p;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(D)>-1))throw"Source or target not in graph!";if(!(v.owner==D.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=D.owner?null:(T.source=v,T.target=D,T.isInterGraph=!1,this.getEdges().push(T),v.edges.push(T),D!=v&&D.edges.push(T),T)}},h.prototype.remove=function(p){var v=p;if(p instanceof l){if(v==null)throw"Node is null!";if(!(v.owner!=null&&v.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var D=v.edges.slice(),u,T=D.length,y=0;y-1&&f>-1))throw"Source and/or target doesn't know this edge!";u.source.edges.splice(s,1),u.target!=u.source&&u.target.edges.splice(f,1);var O=u.source.owner.getEdges().indexOf(u);if(O==-1)throw"Not in owner's edge list!";u.source.owner.getEdges().splice(O,1)}},h.prototype.updateLeftTop=function(){for(var p=e.MAX_VALUE,v=e.MAX_VALUE,D,u,T,y=this.getNodes(),O=y.length,s=0;sD&&(p=D),v>u&&(v=u)}return p==e.MAX_VALUE?null:(y[0].getParent().paddingLeft!=null?T=y[0].getParent().paddingLeft:T=this.margin,this.left=v-T,this.top=p-T,new d(this.left,this.top))},h.prototype.updateBounds=function(p){for(var v=e.MAX_VALUE,D=-e.MAX_VALUE,u=e.MAX_VALUE,T=-e.MAX_VALUE,y,O,s,f,c,E=this.nodes,A=E.length,m=0;my&&(v=y),Ds&&(u=s),Ty&&(v=y),Ds&&(u=s),T=this.nodes.length){var A=0;D.forEach(function(m){m.owner==p&&A++}),A==this.nodes.length&&(this.isConnected=!0)}},N.exports=h}),(function(N,I,L){var o,e=L(1);function t(i){o=L(5),this.layout=i,this.graphs=[],this.edges=[]}t.prototype.addRoot=function(){var i=this.layout.newGraph(),l=this.layout.newNode(null),g=this.add(i,l);return this.setRootGraph(g),this.rootGraph},t.prototype.add=function(i,l,g,n,d){if(g==null&&n==null&&d==null){if(i==null)throw"Graph is null!";if(l==null)throw"Parent node is null!";if(this.graphs.indexOf(i)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(i),i.parent!=null)throw"Already has a parent!";if(l.child!=null)throw"Already has a child!";return i.parent=l,l.child=i,i}else{d=g,n=l,g=i;var r=n.getOwner(),h=d.getOwner();if(!(r!=null&&r.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(h!=null&&h.getGraphManager()==this))throw"Target not in this graph mgr!";if(r==h)return g.isInterGraph=!1,r.add(g,n,d);if(g.isInterGraph=!0,g.source=n,g.target=d,this.edges.indexOf(g)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(g),!(g.source!=null&&g.target!=null))throw"Edge source and/or target is null!";if(!(g.source.edges.indexOf(g)==-1&&g.target.edges.indexOf(g)==-1))throw"Edge already in source and/or target incidency list!";return g.source.edges.push(g),g.target.edges.push(g),g}},t.prototype.remove=function(i){if(i instanceof o){var l=i;if(l.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(l==this.rootGraph||l.parent!=null&&l.parent.graphManager==this))throw"Invalid parent node!";var g=[];g=g.concat(l.getEdges());for(var n,d=g.length,r=0;r=i.getRight()?l[0]+=Math.min(i.getX()-t.getX(),t.getRight()-i.getRight()):i.getX()<=t.getX()&&i.getRight()>=t.getRight()&&(l[0]+=Math.min(t.getX()-i.getX(),i.getRight()-t.getRight())),t.getY()<=i.getY()&&t.getBottom()>=i.getBottom()?l[1]+=Math.min(i.getY()-t.getY(),t.getBottom()-i.getBottom()):i.getY()<=t.getY()&&i.getBottom()>=t.getBottom()&&(l[1]+=Math.min(t.getY()-i.getY(),i.getBottom()-t.getBottom()));var d=Math.abs((i.getCenterY()-t.getCenterY())/(i.getCenterX()-t.getCenterX()));i.getCenterY()===t.getCenterY()&&i.getCenterX()===t.getCenterX()&&(d=1);var r=d*l[0],h=l[1]/d;l[0]r)return l[0]=g,l[1]=a,l[2]=d,l[3]=E,!1;if(nd)return l[0]=h,l[1]=n,l[2]=f,l[3]=r,!1;if(gd?(l[0]=v,l[1]=D,R=!0):(l[0]=p,l[1]=a,R=!0):S===w&&(g>d?(l[0]=h,l[1]=a,R=!0):(l[0]=u,l[1]=D,R=!0)),-Y===w?d>g?(l[2]=c,l[3]=E,M=!0):(l[2]=f,l[3]=s,M=!0):Y===w&&(d>g?(l[2]=O,l[3]=s,M=!0):(l[2]=A,l[3]=E,M=!0)),R&&M)return!1;if(g>d?n>r?(x=this.getCardinalDirection(S,w,4),F=this.getCardinalDirection(Y,w,2)):(x=this.getCardinalDirection(-S,w,3),F=this.getCardinalDirection(-Y,w,1)):n>r?(x=this.getCardinalDirection(-S,w,1),F=this.getCardinalDirection(-Y,w,3)):(x=this.getCardinalDirection(S,w,2),F=this.getCardinalDirection(Y,w,4)),!R)switch(x){case 1:P=a,U=g+-y/w,l[0]=U,l[1]=P;break;case 2:U=u,P=n+T*w,l[0]=U,l[1]=P;break;case 3:P=D,U=g+y/w,l[0]=U,l[1]=P;break;case 4:U=v,P=n+-T*w,l[0]=U,l[1]=P;break}if(!M)switch(F){case 1:X=s,_=d+-C/w,l[2]=_,l[3]=X;break;case 2:_=A,X=r+m*w,l[2]=_,l[3]=X;break;case 3:X=E,_=d+C/w,l[2]=_,l[3]=X;break;case 4:_=c,X=r+-m*w,l[2]=_,l[3]=X;break}}return!1},e.getCardinalDirection=function(t,i,l){return t>i?l:1+l%4},e.getIntersection=function(t,i,l,g){if(g==null)return this.getIntersection2(t,i,l);var n=t.x,d=t.y,r=i.x,h=i.y,a=l.x,p=l.y,v=g.x,D=g.y,u=void 0,T=void 0,y=void 0,O=void 0,s=void 0,f=void 0,c=void 0,E=void 0,A=void 0;return y=h-d,s=n-r,c=r*d-n*h,O=D-p,f=a-v,E=v*p-a*D,A=y*f-O*s,A===0?null:(u=(s*E-f*c)/A,T=(O*c-y*E)/A,new o(u,T))},e.angleOfVector=function(t,i,l,g){var n=void 0;return t!==l?(n=Math.atan((g-i)/(l-t)),l0?1:e<0?-1:0},o.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},o.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},N.exports=o}),(function(N,I,L){function o(){}o.MAX_VALUE=2147483647,o.MIN_VALUE=-2147483648,N.exports=o}),(function(N,I,L){var o=(function(){function n(d,r){for(var h=0;h"u"?"undefined":o(t);return t==null||i!="object"&&i!="function"},N.exports=e}),(function(N,I,L){function o(a){if(Array.isArray(a)){for(var p=0,v=Array(a.length);p0&&p;){for(y.push(s[0]);y.length>0&&p;){var f=y[0];y.splice(0,1),T.add(f);for(var c=f.getEdges(),u=0;u-1&&s.splice(C,1)}T=new Set,O=new Map}}return a},h.prototype.createDummyNodesForBendpoints=function(a){for(var p=[],v=a.source,D=this.graphManager.calcLowestCommonAncestor(a.source,a.target),u=0;u0){for(var D=this.edgeToDummyNodes.get(v),u=0;u=0&&p.splice(E,1);var A=O.getNeighborsList();A.forEach(function(R){if(v.indexOf(R)<0){var M=D.get(R),S=M-1;S==1&&f.push(R),D.set(R,S)}})}v=v.concat(f),(p.length==1||p.length==2)&&(u=!0,T=p[0])}return T},h.prototype.setGraphManager=function(a){this.graphManager=a},N.exports=h}),(function(N,I,L){function o(){}o.seed=1,o.x=0,o.nextDouble=function(){return o.x=Math.sin(o.seed++)*1e4,o.x-Math.floor(o.x)},N.exports=o}),(function(N,I,L){var o=L(4);function e(t,i){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}e.prototype.getWorldOrgX=function(){return this.lworldOrgX},e.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},e.prototype.getWorldOrgY=function(){return this.lworldOrgY},e.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},e.prototype.getWorldExtX=function(){return this.lworldExtX},e.prototype.setWorldExtX=function(t){this.lworldExtX=t},e.prototype.getWorldExtY=function(){return this.lworldExtY},e.prototype.setWorldExtY=function(t){this.lworldExtY=t},e.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},e.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},e.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},e.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},e.prototype.getDeviceExtX=function(){return this.ldeviceExtX},e.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},e.prototype.getDeviceExtY=function(){return this.ldeviceExtY},e.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},e.prototype.transformX=function(t){var i=0,l=this.lworldExtX;return l!=0&&(i=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/l),i},e.prototype.transformY=function(t){var i=0,l=this.lworldExtY;return l!=0&&(i=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/l),i},e.prototype.inverseTransformX=function(t){var i=0,l=this.ldeviceExtX;return l!=0&&(i=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/l),i},e.prototype.inverseTransformY=function(t){var i=0,l=this.ldeviceExtY;return l!=0&&(i=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/l),i},e.prototype.inverseTransformPoint=function(t){var i=new o(this.inverseTransformX(t.x),this.inverseTransformY(t.y));return i},N.exports=e}),(function(N,I,L){function o(r){if(Array.isArray(r)){for(var h=0,a=Array(r.length);ht.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*t.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-t.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT_INCREMENTAL):(r>t.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(t.COOLING_ADAPTATION_FACTOR,1-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*(1-t.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},n.prototype.calcSpringForces=function(){for(var r=this.getAllEdges(),h,a=0;a0&&arguments[0]!==void 0?arguments[0]:!0,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a,p,v,D,u=this.getAllNodes(),T;if(this.useFRGridVariant)for(this.totalIterations%t.GRID_CALCULATION_CHECK_PERIOD==1&&r&&this.updateGrid(),T=new Set,a=0;ay||T>y)&&(r.gravitationForceX=-this.gravityConstant*v,r.gravitationForceY=-this.gravityConstant*D)):(y=h.getEstimatedSize()*this.compoundGravityRangeFactor,(u>y||T>y)&&(r.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,r.gravitationForceY=-this.gravityConstant*D*this.compoundGravityConstant))},n.prototype.isConverged=function(){var r,h=!1;return this.totalIterations>this.maxIterations/3&&(h=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),r=this.totalDisplacement=u.length||y>=u[0].length)){for(var O=0;On}}]),l})();N.exports=i}),(function(N,I,L){var o=(function(){function i(l,g){for(var n=0;n2&&arguments[2]!==void 0?arguments[2]:1,d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;e(this,i),this.sequence1=l,this.sequence2=g,this.match_score=n,this.mismatch_penalty=d,this.gap_penalty=r,this.iMax=l.length+1,this.jMax=g.length+1,this.grid=new Array(this.iMax);for(var h=0;h=0;l--){var g=this.listeners[l];g.event===t&&g.callback===i&&this.listeners.splice(l,1)}},e.emit=function(t,i){for(var l=0;lg.coolingFactor*g.maxNodeDisplacement&&(this.displacementX=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementX)),Math.abs(this.displacementY)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementY=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),g.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},i.prototype.propogateDisplacementToChildren=function(g,n){for(var d=this.getChild().getNodes(),r,h=0;h0)this.positionNodesRadially(s);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var f=new Set(this.getAllNodes()),c=this.nodesWithGravity.filter(function(E){return f.has(E)});this.graphManager.setAllNodesToApplyGravitation(c),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},y.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%d.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),f=this.nodesWithGravity.filter(function(A){return s.has(A)});this.graphManager.setAllNodesToApplyGravitation(f),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var c=!this.isTreeGrowing&&!this.isGrowthFinished,E=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(c,E),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},y.prototype.getPositionsData=function(){for(var s=this.graphManager.getAllNodes(),f={},c=0;c1){var R;for(R=0;RE&&(E=Math.floor(C.y)),m=Math.floor(C.x+n.DEFAULT_COMPONENT_SEPERATION)}this.transform(new a(r.WORLD_CENTER_X-C.x/2,r.WORLD_CENTER_Y-C.y/2))},y.radialLayout=function(s,f,c){var E=Math.max(this.maxDiagonalInTree(s),n.DEFAULT_RADIAL_SEPARATION);y.branchRadialLayout(f,null,0,359,0,E);var A=u.calculateBounds(s),m=new T;m.setDeviceOrgX(A.getMinX()),m.setDeviceOrgY(A.getMinY()),m.setWorldOrgX(c.x),m.setWorldOrgY(c.y);for(var C=0;C1;){var X=_[0];_.splice(0,1);var H=w.indexOf(X);H>=0&&w.splice(H,1),U--,x--}f!=null?P=(w.indexOf(_[0])+1)%U:P=0;for(var W=Math.abs(E-c)/x,B=P;F!=x;B=++B%U){var K=w[B].getOtherEnd(s);if(K!=f){var q=(c+F*W)%360,ht=(q+W)%360;y.branchRadialLayout(K,s,q,ht,A+m,m),F++}}},y.maxDiagonalInTree=function(s){for(var f=v.MIN_VALUE,c=0;cf&&(f=A)}return f},y.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},y.prototype.groupZeroDegreeMembers=function(){var s=this,f={};this.memberGroups={},this.idToDummyNode={};for(var c=[],E=this.graphManager.getAllNodes(),A=0;A"u"&&(f[R]=[]),f[R]=f[R].concat(m)}Object.keys(f).forEach(function(M){if(f[M].length>1){var S="DummyCompound_"+M;s.memberGroups[S]=f[M];var Y=f[M][0].getParent(),w=new l(s.graphManager);w.id=S,w.paddingLeft=Y.paddingLeft||0,w.paddingRight=Y.paddingRight||0,w.paddingBottom=Y.paddingBottom||0,w.paddingTop=Y.paddingTop||0,s.idToDummyNode[S]=w;var x=s.getGraphManager().add(s.newGraph(),w),F=Y.getChild();F.add(w);for(var U=0;U=0;s--){var f=this.compoundOrder[s],c=f.id,E=f.paddingLeft,A=f.paddingTop;this.adjustLocations(this.tiledMemberPack[c],f.rect.x,f.rect.y,E,A)}},y.prototype.repopulateZeroDegreeMembers=function(){var s=this,f=this.tiledZeroDegreePack;Object.keys(f).forEach(function(c){var E=s.idToDummyNode[c],A=E.paddingLeft,m=E.paddingTop;s.adjustLocations(f[c],E.rect.x,E.rect.y,A,m)})},y.prototype.getToBeTiled=function(s){var f=s.id;if(this.toBeTiled[f]!=null)return this.toBeTiled[f];var c=s.getChild();if(c==null)return this.toBeTiled[f]=!1,!1;for(var E=c.getNodes(),A=0;A0)return this.toBeTiled[f]=!1,!1;if(m.getChild()==null){this.toBeTiled[m.id]=!1;continue}if(!this.getToBeTiled(m))return this.toBeTiled[f]=!1,!1}return this.toBeTiled[f]=!0,!0},y.prototype.getNodeDegree=function(s){s.id;for(var f=s.getEdges(),c=0,E=0;EM&&(M=Y.rect.height)}c+=M+s.verticalPadding}},y.prototype.tileCompoundMembers=function(s,f){var c=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(E){var A=f[E];c.tiledMemberPack[E]=c.tileNodes(s[E],A.paddingLeft+A.paddingRight),A.rect.width=c.tiledMemberPack[E].width,A.rect.height=c.tiledMemberPack[E].height})},y.prototype.tileNodes=function(s,f){var c=n.TILING_PADDING_VERTICAL,E=n.TILING_PADDING_HORIZONTAL,A={rows:[],rowWidth:[],rowHeight:[],width:0,height:f,verticalPadding:c,horizontalPadding:E};s.sort(function(R,M){return R.rect.width*R.rect.height>M.rect.width*M.rect.height?-1:R.rect.width*R.rect.height0&&(C+=s.horizontalPadding),s.rowWidth[c]=C,s.width0&&(R+=s.verticalPadding);var M=0;R>s.rowHeight[c]&&(M=s.rowHeight[c],s.rowHeight[c]=R,M=s.rowHeight[c]-M),s.height+=M,s.rows[c].push(f)},y.prototype.getShortestRowIndex=function(s){for(var f=-1,c=Number.MAX_VALUE,E=0;Ec&&(f=E,c=s.rowWidth[E]);return f},y.prototype.canAddHorizontal=function(s,f,c){var E=this.getShortestRowIndex(s);if(E<0)return!0;var A=s.rowWidth[E];if(A+s.horizontalPadding+f<=s.width)return!0;var m=0;s.rowHeight[E]0&&(m=c+s.verticalPadding-s.rowHeight[E]);var C;s.width-A>=f+s.horizontalPadding?C=(s.height+m)/(A+f+s.horizontalPadding):C=(s.height+m)/s.width,m=c+s.verticalPadding;var R;return s.widthm&&f!=c){E.splice(-1,1),s.rows[c].push(A),s.rowWidth[f]=s.rowWidth[f]-m,s.rowWidth[c]=s.rowWidth[c]+m,s.width=s.rowWidth[instance.getLongestRowIndex(s)];for(var C=Number.MIN_VALUE,R=0;RC&&(C=E[R].height);f>0&&(C+=s.verticalPadding);var M=s.rowHeight[f]+s.rowHeight[c];s.rowHeight[f]=C,s.rowHeight[c]0)for(var F=A;F<=m;F++)x[0]+=this.grid[F][C-1].length+this.grid[F][C].length-1;if(m0)for(var F=C;F<=R;F++)x[3]+=this.grid[A-1][F].length+this.grid[A][F].length-1;for(var U=v.MAX_VALUE,P,_,X=0;X0){var R;R=T.getGraphManager().add(T.newGraph(),c),this.processChildrenList(R,f,T)}}},a.prototype.stop=function(){return this.stopped=!0,this};var v=function(u){u("layout","cose-bilkent",a)};typeof cytoscape<"u"&&v(cytoscape),I.exports=v})])})})(Z)),Z.exports}var yt=vt();const Et=gt(yt);tt.use(Et);function et(G,b){G.forEach(N=>{const I={id:N.id,labelText:N.label,height:N.height,width:N.width,padding:N.padding??0};Object.keys(N).forEach(L=>{["id","label","height","width","padding","x","y"].includes(L)||(I[L]=N[L])}),b.add({group:"nodes",data:I,position:{x:N.x??0,y:N.y??0}})})}V(et,"addNodes");function rt(G,b){G.forEach(N=>{const I={id:N.id,source:N.start,target:N.end};Object.keys(N).forEach(L=>{["id","start","end"].includes(L)||(I[L]=N[L])}),b.add({group:"edges",data:I})})}V(rt,"addEdges");function it(G){return new Promise(b=>{const N=lt("body").append("div").attr("id","cy").attr("style","display:none"),I=tt({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});N.remove(),et(G.nodes,I),rt(G.edges,I),I.nodes().forEach(function(o){o.layoutDimensions=()=>{const e=o.data();return{w:e.width,h:e.height}}});const L={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};I.layout(L).run(),I.ready(o=>{k.info("Cytoscape ready",o),b(I)})})}V(it,"createCytoscapeInstance");function nt(G){return G.nodes().map(b=>{const N=b.data(),I=b.position(),L={id:N.id,x:I.x,y:I.y};return Object.keys(N).forEach(o=>{o!=="id"&&(L[o]=N[o])}),L})}V(nt,"extractPositionedNodes");function ot(G){return G.edges().map(b=>{const N=b.data(),I=b._private.rscratch,L={id:N.id,source:N.source,target:N.target,startX:I.startX,startY:I.startY,midX:I.midX,midY:I.midY,endX:I.endX,endY:I.endY};return Object.keys(N).forEach(o=>{["id","source","target"].includes(o)||(L[o]=N[o])}),L})}V(ot,"extractPositionedEdges");async function st(G,b){k.debug("Starting cose-bilkent layout algorithm");try{at(G);const N=await it(G),I=nt(N),L=ot(N);return k.debug(`Layout completed: ${I.length} nodes, ${L.length} edges`),{nodes:I,edges:L}}catch(N){throw k.error("Error in cose-bilkent layout algorithm:",N),N}}V(st,"executeCoseBilkentLayout");function at(G){if(!G)throw new Error("Layout data is required");if(!G.config)throw new Error("Configuration is required in layout data");if(!G.rootNode)throw new Error("Root node is required");if(!G.nodes||!Array.isArray(G.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(G.edges))throw new Error("Edges array is required in layout data");return!0}V(at,"validateLayoutData");var Lt=V(async(G,b,{insertCluster:N,insertEdge:I,insertEdgeLabel:L,insertMarkers:o,insertNode:e,log:t,positionEdgeLabel:i},{algorithm:l})=>{const g={},n={},d=b.select("g");o(d,G.markers,G.type,G.diagramId);const r=d.insert("g").attr("class","subgraphs"),h=d.insert("g").attr("class","edgePaths"),a=d.insert("g").attr("class","edgeLabels"),p=d.insert("g").attr("class","nodes");t.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(G.nodes.map(async u=>{if(u.isGroup){const T={...u};n[u.id]=T,g[u.id]=T,await N(r,u)}else{const T={...u};g[u.id]=T;const y=await e(p,u,{config:G.config,dir:G.direction||"TB"}),O=y.node().getBBox();T.width=O.width,T.height=O.height,T.domId=y,t.debug(`Node ${u.id} dimensions: ${O.width}x${O.height}`)}})),t.debug("Running cose-bilkent layout algorithm");const v={...G,nodes:G.nodes.map(u=>{const T=g[u.id];return{...u,width:T.width,height:T.height}})},D=await st(v,G.config);t.debug("Positioning nodes based on layout results"),D.nodes.forEach(u=>{const T=g[u.id];T?.domId&&(T.domId.attr("transform",`translate(${u.x}, ${u.y})`),T.x=u.x,T.y=u.y,t.debug(`Positioned node ${T.id} at center (${u.x}, ${u.y})`))}),D.edges.forEach(u=>{const T=G.edges.find(y=>y.id===u.id);T&&(T.points=[{x:u.startX,y:u.startY},{x:u.midX,y:u.midY},{x:u.endX,y:u.endY}])}),t.debug("Inserting and positioning edges"),await Promise.all(G.edges.map(async u=>{await L(a,u);const T=g[u.start??""],y=g[u.end??""];if(T&&y){const O=D.edges.find(s=>s.id===u.id);if(O){t.debug("APA01 positionedEdge",O);const s={...u},f=I(h,s,n,G.type,T,y,G.diagramId);i(s,f)}else{const s={...u,points:[{x:T.x||0,y:T.y||0},{x:y.x||0,y:y.y||0}]},f=I(h,s,n,G.type,T,y,G.diagramId);i(s,f)}}})),t.debug("Cose-bilkent rendering completed")},"render"),Ot=Lt;export{Ot as render}; +import{_ as V,l as k,d as lt}from"./mermaid.core-WW7RuneT.js";import{c as tt}from"./cytoscape.esm-OyMbaexL.js";import{g as gt}from"./_commonjsHelpers-CqkleIqs.js";import"./index-CiHMlsuo.js";var Z={exports:{}},$={exports:{}},Q={exports:{}},ut=Q.exports,j;function ft(){return j||(j=1,(function(G,b){(function(I,L){G.exports=L()})(ut,function(){return(function(N){var I={};function L(o){if(I[o])return I[o].exports;var e=I[o]={i:o,l:!1,exports:{}};return N[o].call(e.exports,e,e.exports,L),e.l=!0,e.exports}return L.m=N,L.c=I,L.i=function(o){return o},L.d=function(o,e,t){L.o(o,e)||Object.defineProperty(o,e,{configurable:!1,enumerable:!0,get:t})},L.n=function(o){var e=o&&o.__esModule?function(){return o.default}:function(){return o};return L.d(e,"a",e),e},L.o=function(o,e){return Object.prototype.hasOwnProperty.call(o,e)},L.p="",L(L.s=26)})([(function(N,I,L){function o(){}o.QUALITY=1,o.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,o.DEFAULT_INCREMENTAL=!1,o.DEFAULT_ANIMATION_ON_LAYOUT=!0,o.DEFAULT_ANIMATION_DURING_LAYOUT=!1,o.DEFAULT_ANIMATION_PERIOD=50,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,o.DEFAULT_GRAPH_MARGIN=15,o.NODE_DIMENSIONS_INCLUDE_LABELS=!1,o.SIMPLE_NODE_SIZE=40,o.SIMPLE_NODE_HALF_SIZE=o.SIMPLE_NODE_SIZE/2,o.EMPTY_COMPOUND_NODE_SIZE=40,o.MIN_EDGE_LENGTH=1,o.WORLD_BOUNDARY=1e6,o.INITIAL_WORLD_BOUNDARY=o.WORLD_BOUNDARY/1e3,o.WORLD_CENTER_X=1200,o.WORLD_CENTER_Y=900,N.exports=o}),(function(N,I,L){var o=L(2),e=L(8),t=L(9);function i(g,n,d){o.call(this,d),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=d,this.bendpoints=[],this.source=g,this.target=n}i.prototype=Object.create(o.prototype);for(var l in o)i[l]=o[l];i.prototype.getSource=function(){return this.source},i.prototype.getTarget=function(){return this.target},i.prototype.isInterGraph=function(){return this.isInterGraph},i.prototype.getLength=function(){return this.length},i.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},i.prototype.getBendpoints=function(){return this.bendpoints},i.prototype.getLca=function(){return this.lca},i.prototype.getSourceInLca=function(){return this.sourceInLca},i.prototype.getTargetInLca=function(){return this.targetInLca},i.prototype.getOtherEnd=function(g){if(this.source===g)return this.target;if(this.target===g)return this.source;throw"Node is not incident with this edge"},i.prototype.getOtherEndInGraph=function(g,n){for(var d=this.getOtherEnd(g),r=n.getGraphManager().getRoot();;){if(d.getOwner()==n)return d;if(d.getOwner()==r)break;d=d.getOwner().getParent()}return null},i.prototype.updateLength=function(){var g=new Array(4);this.isOverlapingSourceAndTarget=e.getIntersection(this.target.getRect(),this.source.getRect(),g),this.isOverlapingSourceAndTarget||(this.lengthX=g[0]-g[2],this.lengthY=g[1]-g[3],Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},i.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},N.exports=i}),(function(N,I,L){function o(e){this.vGraphObject=e}N.exports=o}),(function(N,I,L){var o=L(2),e=L(10),t=L(13),i=L(0),l=L(16),g=L(4);function n(r,h,a,p){a==null&&p==null&&(p=h),o.call(this,p),r.graphManager!=null&&(r=r.graphManager),this.estimatedSize=e.MIN_VALUE,this.inclusionTreeDepth=e.MAX_VALUE,this.vGraphObject=p,this.edges=[],this.graphManager=r,a!=null&&h!=null?this.rect=new t(h.x,h.y,a.width,a.height):this.rect=new t}n.prototype=Object.create(o.prototype);for(var d in o)n[d]=o[d];n.prototype.getEdges=function(){return this.edges},n.prototype.getChild=function(){return this.child},n.prototype.getOwner=function(){return this.owner},n.prototype.getWidth=function(){return this.rect.width},n.prototype.setWidth=function(r){this.rect.width=r},n.prototype.getHeight=function(){return this.rect.height},n.prototype.setHeight=function(r){this.rect.height=r},n.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},n.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},n.prototype.getCenter=function(){return new g(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},n.prototype.getLocation=function(){return new g(this.rect.x,this.rect.y)},n.prototype.getRect=function(){return this.rect},n.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},n.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},n.prototype.setRect=function(r,h){this.rect.x=r.x,this.rect.y=r.y,this.rect.width=h.width,this.rect.height=h.height},n.prototype.setCenter=function(r,h){this.rect.x=r-this.rect.width/2,this.rect.y=h-this.rect.height/2},n.prototype.setLocation=function(r,h){this.rect.x=r,this.rect.y=h},n.prototype.moveBy=function(r,h){this.rect.x+=r,this.rect.y+=h},n.prototype.getEdgeListToNode=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(p.target==r){if(p.source!=a)throw"Incorrect edge source!";h.push(p)}}),h},n.prototype.getEdgesBetween=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(!(p.source==a||p.target==a))throw"Incorrect edge source and/or target";(p.target==r||p.source==r)&&h.push(p)}),h},n.prototype.getNeighborsList=function(){var r=new Set,h=this;return h.edges.forEach(function(a){if(a.source==h)r.add(a.target);else{if(a.target!=h)throw"Incorrect incidency!";r.add(a.source)}}),r},n.prototype.withChildren=function(){var r=new Set,h,a;if(r.add(this),this.child!=null)for(var p=this.child.getNodes(),v=0;vh&&(this.rect.x-=(this.labelWidth-h)/2,this.setWidth(this.labelWidth)),this.labelHeight>a&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-a)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-a),this.setHeight(this.labelHeight))}}},n.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==e.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},n.prototype.transform=function(r){var h=this.rect.x;h>i.WORLD_BOUNDARY?h=i.WORLD_BOUNDARY:h<-i.WORLD_BOUNDARY&&(h=-i.WORLD_BOUNDARY);var a=this.rect.y;a>i.WORLD_BOUNDARY?a=i.WORLD_BOUNDARY:a<-i.WORLD_BOUNDARY&&(a=-i.WORLD_BOUNDARY);var p=new g(h,a),v=r.inverseTransformPoint(p);this.setLocation(v.x,v.y)},n.prototype.getLeft=function(){return this.rect.x},n.prototype.getRight=function(){return this.rect.x+this.rect.width},n.prototype.getTop=function(){return this.rect.y},n.prototype.getBottom=function(){return this.rect.y+this.rect.height},n.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},N.exports=n}),(function(N,I,L){function o(e,t){e==null&&t==null?(this.x=0,this.y=0):(this.x=e,this.y=t)}o.prototype.getX=function(){return this.x},o.prototype.getY=function(){return this.y},o.prototype.setX=function(e){this.x=e},o.prototype.setY=function(e){this.y=e},o.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},o.prototype.getCopy=function(){return new o(this.x,this.y)},o.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},N.exports=o}),(function(N,I,L){var o=L(2),e=L(10),t=L(0),i=L(6),l=L(3),g=L(1),n=L(13),d=L(12),r=L(11);function h(p,v,D){o.call(this,D),this.estimatedSize=e.MIN_VALUE,this.margin=t.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=p,v!=null&&v instanceof i?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}h.prototype=Object.create(o.prototype);for(var a in o)h[a]=o[a];h.prototype.getNodes=function(){return this.nodes},h.prototype.getEdges=function(){return this.edges},h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getParent=function(){return this.parent},h.prototype.getLeft=function(){return this.left},h.prototype.getRight=function(){return this.right},h.prototype.getTop=function(){return this.top},h.prototype.getBottom=function(){return this.bottom},h.prototype.isConnected=function(){return this.isConnected},h.prototype.add=function(p,v,D){if(v==null&&D==null){var u=p;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(u)>-1)throw"Node already in graph!";return u.owner=this,this.getNodes().push(u),u}else{var T=p;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(D)>-1))throw"Source or target not in graph!";if(!(v.owner==D.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=D.owner?null:(T.source=v,T.target=D,T.isInterGraph=!1,this.getEdges().push(T),v.edges.push(T),D!=v&&D.edges.push(T),T)}},h.prototype.remove=function(p){var v=p;if(p instanceof l){if(v==null)throw"Node is null!";if(!(v.owner!=null&&v.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var D=v.edges.slice(),u,T=D.length,y=0;y-1&&f>-1))throw"Source and/or target doesn't know this edge!";u.source.edges.splice(s,1),u.target!=u.source&&u.target.edges.splice(f,1);var O=u.source.owner.getEdges().indexOf(u);if(O==-1)throw"Not in owner's edge list!";u.source.owner.getEdges().splice(O,1)}},h.prototype.updateLeftTop=function(){for(var p=e.MAX_VALUE,v=e.MAX_VALUE,D,u,T,y=this.getNodes(),O=y.length,s=0;sD&&(p=D),v>u&&(v=u)}return p==e.MAX_VALUE?null:(y[0].getParent().paddingLeft!=null?T=y[0].getParent().paddingLeft:T=this.margin,this.left=v-T,this.top=p-T,new d(this.left,this.top))},h.prototype.updateBounds=function(p){for(var v=e.MAX_VALUE,D=-e.MAX_VALUE,u=e.MAX_VALUE,T=-e.MAX_VALUE,y,O,s,f,c,E=this.nodes,A=E.length,m=0;my&&(v=y),Ds&&(u=s),Ty&&(v=y),Ds&&(u=s),T=this.nodes.length){var A=0;D.forEach(function(m){m.owner==p&&A++}),A==this.nodes.length&&(this.isConnected=!0)}},N.exports=h}),(function(N,I,L){var o,e=L(1);function t(i){o=L(5),this.layout=i,this.graphs=[],this.edges=[]}t.prototype.addRoot=function(){var i=this.layout.newGraph(),l=this.layout.newNode(null),g=this.add(i,l);return this.setRootGraph(g),this.rootGraph},t.prototype.add=function(i,l,g,n,d){if(g==null&&n==null&&d==null){if(i==null)throw"Graph is null!";if(l==null)throw"Parent node is null!";if(this.graphs.indexOf(i)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(i),i.parent!=null)throw"Already has a parent!";if(l.child!=null)throw"Already has a child!";return i.parent=l,l.child=i,i}else{d=g,n=l,g=i;var r=n.getOwner(),h=d.getOwner();if(!(r!=null&&r.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(h!=null&&h.getGraphManager()==this))throw"Target not in this graph mgr!";if(r==h)return g.isInterGraph=!1,r.add(g,n,d);if(g.isInterGraph=!0,g.source=n,g.target=d,this.edges.indexOf(g)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(g),!(g.source!=null&&g.target!=null))throw"Edge source and/or target is null!";if(!(g.source.edges.indexOf(g)==-1&&g.target.edges.indexOf(g)==-1))throw"Edge already in source and/or target incidency list!";return g.source.edges.push(g),g.target.edges.push(g),g}},t.prototype.remove=function(i){if(i instanceof o){var l=i;if(l.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(l==this.rootGraph||l.parent!=null&&l.parent.graphManager==this))throw"Invalid parent node!";var g=[];g=g.concat(l.getEdges());for(var n,d=g.length,r=0;r=i.getRight()?l[0]+=Math.min(i.getX()-t.getX(),t.getRight()-i.getRight()):i.getX()<=t.getX()&&i.getRight()>=t.getRight()&&(l[0]+=Math.min(t.getX()-i.getX(),i.getRight()-t.getRight())),t.getY()<=i.getY()&&t.getBottom()>=i.getBottom()?l[1]+=Math.min(i.getY()-t.getY(),t.getBottom()-i.getBottom()):i.getY()<=t.getY()&&i.getBottom()>=t.getBottom()&&(l[1]+=Math.min(t.getY()-i.getY(),i.getBottom()-t.getBottom()));var d=Math.abs((i.getCenterY()-t.getCenterY())/(i.getCenterX()-t.getCenterX()));i.getCenterY()===t.getCenterY()&&i.getCenterX()===t.getCenterX()&&(d=1);var r=d*l[0],h=l[1]/d;l[0]r)return l[0]=g,l[1]=a,l[2]=d,l[3]=E,!1;if(nd)return l[0]=h,l[1]=n,l[2]=f,l[3]=r,!1;if(gd?(l[0]=v,l[1]=D,R=!0):(l[0]=p,l[1]=a,R=!0):S===w&&(g>d?(l[0]=h,l[1]=a,R=!0):(l[0]=u,l[1]=D,R=!0)),-Y===w?d>g?(l[2]=c,l[3]=E,M=!0):(l[2]=f,l[3]=s,M=!0):Y===w&&(d>g?(l[2]=O,l[3]=s,M=!0):(l[2]=A,l[3]=E,M=!0)),R&&M)return!1;if(g>d?n>r?(x=this.getCardinalDirection(S,w,4),F=this.getCardinalDirection(Y,w,2)):(x=this.getCardinalDirection(-S,w,3),F=this.getCardinalDirection(-Y,w,1)):n>r?(x=this.getCardinalDirection(-S,w,1),F=this.getCardinalDirection(-Y,w,3)):(x=this.getCardinalDirection(S,w,2),F=this.getCardinalDirection(Y,w,4)),!R)switch(x){case 1:P=a,U=g+-y/w,l[0]=U,l[1]=P;break;case 2:U=u,P=n+T*w,l[0]=U,l[1]=P;break;case 3:P=D,U=g+y/w,l[0]=U,l[1]=P;break;case 4:U=v,P=n+-T*w,l[0]=U,l[1]=P;break}if(!M)switch(F){case 1:X=s,_=d+-C/w,l[2]=_,l[3]=X;break;case 2:_=A,X=r+m*w,l[2]=_,l[3]=X;break;case 3:X=E,_=d+C/w,l[2]=_,l[3]=X;break;case 4:_=c,X=r+-m*w,l[2]=_,l[3]=X;break}}return!1},e.getCardinalDirection=function(t,i,l){return t>i?l:1+l%4},e.getIntersection=function(t,i,l,g){if(g==null)return this.getIntersection2(t,i,l);var n=t.x,d=t.y,r=i.x,h=i.y,a=l.x,p=l.y,v=g.x,D=g.y,u=void 0,T=void 0,y=void 0,O=void 0,s=void 0,f=void 0,c=void 0,E=void 0,A=void 0;return y=h-d,s=n-r,c=r*d-n*h,O=D-p,f=a-v,E=v*p-a*D,A=y*f-O*s,A===0?null:(u=(s*E-f*c)/A,T=(O*c-y*E)/A,new o(u,T))},e.angleOfVector=function(t,i,l,g){var n=void 0;return t!==l?(n=Math.atan((g-i)/(l-t)),l0?1:e<0?-1:0},o.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},o.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},N.exports=o}),(function(N,I,L){function o(){}o.MAX_VALUE=2147483647,o.MIN_VALUE=-2147483648,N.exports=o}),(function(N,I,L){var o=(function(){function n(d,r){for(var h=0;h"u"?"undefined":o(t);return t==null||i!="object"&&i!="function"},N.exports=e}),(function(N,I,L){function o(a){if(Array.isArray(a)){for(var p=0,v=Array(a.length);p0&&p;){for(y.push(s[0]);y.length>0&&p;){var f=y[0];y.splice(0,1),T.add(f);for(var c=f.getEdges(),u=0;u-1&&s.splice(C,1)}T=new Set,O=new Map}}return a},h.prototype.createDummyNodesForBendpoints=function(a){for(var p=[],v=a.source,D=this.graphManager.calcLowestCommonAncestor(a.source,a.target),u=0;u0){for(var D=this.edgeToDummyNodes.get(v),u=0;u=0&&p.splice(E,1);var A=O.getNeighborsList();A.forEach(function(R){if(v.indexOf(R)<0){var M=D.get(R),S=M-1;S==1&&f.push(R),D.set(R,S)}})}v=v.concat(f),(p.length==1||p.length==2)&&(u=!0,T=p[0])}return T},h.prototype.setGraphManager=function(a){this.graphManager=a},N.exports=h}),(function(N,I,L){function o(){}o.seed=1,o.x=0,o.nextDouble=function(){return o.x=Math.sin(o.seed++)*1e4,o.x-Math.floor(o.x)},N.exports=o}),(function(N,I,L){var o=L(4);function e(t,i){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}e.prototype.getWorldOrgX=function(){return this.lworldOrgX},e.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},e.prototype.getWorldOrgY=function(){return this.lworldOrgY},e.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},e.prototype.getWorldExtX=function(){return this.lworldExtX},e.prototype.setWorldExtX=function(t){this.lworldExtX=t},e.prototype.getWorldExtY=function(){return this.lworldExtY},e.prototype.setWorldExtY=function(t){this.lworldExtY=t},e.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},e.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},e.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},e.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},e.prototype.getDeviceExtX=function(){return this.ldeviceExtX},e.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},e.prototype.getDeviceExtY=function(){return this.ldeviceExtY},e.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},e.prototype.transformX=function(t){var i=0,l=this.lworldExtX;return l!=0&&(i=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/l),i},e.prototype.transformY=function(t){var i=0,l=this.lworldExtY;return l!=0&&(i=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/l),i},e.prototype.inverseTransformX=function(t){var i=0,l=this.ldeviceExtX;return l!=0&&(i=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/l),i},e.prototype.inverseTransformY=function(t){var i=0,l=this.ldeviceExtY;return l!=0&&(i=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/l),i},e.prototype.inverseTransformPoint=function(t){var i=new o(this.inverseTransformX(t.x),this.inverseTransformY(t.y));return i},N.exports=e}),(function(N,I,L){function o(r){if(Array.isArray(r)){for(var h=0,a=Array(r.length);ht.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*t.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-t.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT_INCREMENTAL):(r>t.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(t.COOLING_ADAPTATION_FACTOR,1-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*(1-t.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},n.prototype.calcSpringForces=function(){for(var r=this.getAllEdges(),h,a=0;a0&&arguments[0]!==void 0?arguments[0]:!0,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a,p,v,D,u=this.getAllNodes(),T;if(this.useFRGridVariant)for(this.totalIterations%t.GRID_CALCULATION_CHECK_PERIOD==1&&r&&this.updateGrid(),T=new Set,a=0;ay||T>y)&&(r.gravitationForceX=-this.gravityConstant*v,r.gravitationForceY=-this.gravityConstant*D)):(y=h.getEstimatedSize()*this.compoundGravityRangeFactor,(u>y||T>y)&&(r.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,r.gravitationForceY=-this.gravityConstant*D*this.compoundGravityConstant))},n.prototype.isConverged=function(){var r,h=!1;return this.totalIterations>this.maxIterations/3&&(h=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),r=this.totalDisplacement=u.length||y>=u[0].length)){for(var O=0;On}}]),l})();N.exports=i}),(function(N,I,L){var o=(function(){function i(l,g){for(var n=0;n2&&arguments[2]!==void 0?arguments[2]:1,d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;e(this,i),this.sequence1=l,this.sequence2=g,this.match_score=n,this.mismatch_penalty=d,this.gap_penalty=r,this.iMax=l.length+1,this.jMax=g.length+1,this.grid=new Array(this.iMax);for(var h=0;h=0;l--){var g=this.listeners[l];g.event===t&&g.callback===i&&this.listeners.splice(l,1)}},e.emit=function(t,i){for(var l=0;lg.coolingFactor*g.maxNodeDisplacement&&(this.displacementX=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementX)),Math.abs(this.displacementY)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementY=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),g.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},i.prototype.propogateDisplacementToChildren=function(g,n){for(var d=this.getChild().getNodes(),r,h=0;h0)this.positionNodesRadially(s);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var f=new Set(this.getAllNodes()),c=this.nodesWithGravity.filter(function(E){return f.has(E)});this.graphManager.setAllNodesToApplyGravitation(c),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},y.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%d.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),f=this.nodesWithGravity.filter(function(A){return s.has(A)});this.graphManager.setAllNodesToApplyGravitation(f),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var c=!this.isTreeGrowing&&!this.isGrowthFinished,E=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(c,E),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},y.prototype.getPositionsData=function(){for(var s=this.graphManager.getAllNodes(),f={},c=0;c1){var R;for(R=0;RE&&(E=Math.floor(C.y)),m=Math.floor(C.x+n.DEFAULT_COMPONENT_SEPERATION)}this.transform(new a(r.WORLD_CENTER_X-C.x/2,r.WORLD_CENTER_Y-C.y/2))},y.radialLayout=function(s,f,c){var E=Math.max(this.maxDiagonalInTree(s),n.DEFAULT_RADIAL_SEPARATION);y.branchRadialLayout(f,null,0,359,0,E);var A=u.calculateBounds(s),m=new T;m.setDeviceOrgX(A.getMinX()),m.setDeviceOrgY(A.getMinY()),m.setWorldOrgX(c.x),m.setWorldOrgY(c.y);for(var C=0;C1;){var X=_[0];_.splice(0,1);var H=w.indexOf(X);H>=0&&w.splice(H,1),U--,x--}f!=null?P=(w.indexOf(_[0])+1)%U:P=0;for(var W=Math.abs(E-c)/x,B=P;F!=x;B=++B%U){var K=w[B].getOtherEnd(s);if(K!=f){var q=(c+F*W)%360,ht=(q+W)%360;y.branchRadialLayout(K,s,q,ht,A+m,m),F++}}},y.maxDiagonalInTree=function(s){for(var f=v.MIN_VALUE,c=0;cf&&(f=A)}return f},y.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},y.prototype.groupZeroDegreeMembers=function(){var s=this,f={};this.memberGroups={},this.idToDummyNode={};for(var c=[],E=this.graphManager.getAllNodes(),A=0;A"u"&&(f[R]=[]),f[R]=f[R].concat(m)}Object.keys(f).forEach(function(M){if(f[M].length>1){var S="DummyCompound_"+M;s.memberGroups[S]=f[M];var Y=f[M][0].getParent(),w=new l(s.graphManager);w.id=S,w.paddingLeft=Y.paddingLeft||0,w.paddingRight=Y.paddingRight||0,w.paddingBottom=Y.paddingBottom||0,w.paddingTop=Y.paddingTop||0,s.idToDummyNode[S]=w;var x=s.getGraphManager().add(s.newGraph(),w),F=Y.getChild();F.add(w);for(var U=0;U=0;s--){var f=this.compoundOrder[s],c=f.id,E=f.paddingLeft,A=f.paddingTop;this.adjustLocations(this.tiledMemberPack[c],f.rect.x,f.rect.y,E,A)}},y.prototype.repopulateZeroDegreeMembers=function(){var s=this,f=this.tiledZeroDegreePack;Object.keys(f).forEach(function(c){var E=s.idToDummyNode[c],A=E.paddingLeft,m=E.paddingTop;s.adjustLocations(f[c],E.rect.x,E.rect.y,A,m)})},y.prototype.getToBeTiled=function(s){var f=s.id;if(this.toBeTiled[f]!=null)return this.toBeTiled[f];var c=s.getChild();if(c==null)return this.toBeTiled[f]=!1,!1;for(var E=c.getNodes(),A=0;A0)return this.toBeTiled[f]=!1,!1;if(m.getChild()==null){this.toBeTiled[m.id]=!1;continue}if(!this.getToBeTiled(m))return this.toBeTiled[f]=!1,!1}return this.toBeTiled[f]=!0,!0},y.prototype.getNodeDegree=function(s){s.id;for(var f=s.getEdges(),c=0,E=0;EM&&(M=Y.rect.height)}c+=M+s.verticalPadding}},y.prototype.tileCompoundMembers=function(s,f){var c=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(E){var A=f[E];c.tiledMemberPack[E]=c.tileNodes(s[E],A.paddingLeft+A.paddingRight),A.rect.width=c.tiledMemberPack[E].width,A.rect.height=c.tiledMemberPack[E].height})},y.prototype.tileNodes=function(s,f){var c=n.TILING_PADDING_VERTICAL,E=n.TILING_PADDING_HORIZONTAL,A={rows:[],rowWidth:[],rowHeight:[],width:0,height:f,verticalPadding:c,horizontalPadding:E};s.sort(function(R,M){return R.rect.width*R.rect.height>M.rect.width*M.rect.height?-1:R.rect.width*R.rect.height0&&(C+=s.horizontalPadding),s.rowWidth[c]=C,s.width0&&(R+=s.verticalPadding);var M=0;R>s.rowHeight[c]&&(M=s.rowHeight[c],s.rowHeight[c]=R,M=s.rowHeight[c]-M),s.height+=M,s.rows[c].push(f)},y.prototype.getShortestRowIndex=function(s){for(var f=-1,c=Number.MAX_VALUE,E=0;Ec&&(f=E,c=s.rowWidth[E]);return f},y.prototype.canAddHorizontal=function(s,f,c){var E=this.getShortestRowIndex(s);if(E<0)return!0;var A=s.rowWidth[E];if(A+s.horizontalPadding+f<=s.width)return!0;var m=0;s.rowHeight[E]0&&(m=c+s.verticalPadding-s.rowHeight[E]);var C;s.width-A>=f+s.horizontalPadding?C=(s.height+m)/(A+f+s.horizontalPadding):C=(s.height+m)/s.width,m=c+s.verticalPadding;var R;return s.widthm&&f!=c){E.splice(-1,1),s.rows[c].push(A),s.rowWidth[f]=s.rowWidth[f]-m,s.rowWidth[c]=s.rowWidth[c]+m,s.width=s.rowWidth[instance.getLongestRowIndex(s)];for(var C=Number.MIN_VALUE,R=0;RC&&(C=E[R].height);f>0&&(C+=s.verticalPadding);var M=s.rowHeight[f]+s.rowHeight[c];s.rowHeight[f]=C,s.rowHeight[c]0)for(var F=A;F<=m;F++)x[0]+=this.grid[F][C-1].length+this.grid[F][C].length-1;if(m0)for(var F=C;F<=R;F++)x[3]+=this.grid[A-1][F].length+this.grid[A][F].length-1;for(var U=v.MAX_VALUE,P,_,X=0;X0){var R;R=T.getGraphManager().add(T.newGraph(),c),this.processChildrenList(R,f,T)}}},a.prototype.stop=function(){return this.stopped=!0,this};var v=function(u){u("layout","cose-bilkent",a)};typeof cytoscape<"u"&&v(cytoscape),I.exports=v})])})})(Z)),Z.exports}var yt=vt();const Et=gt(yt);tt.use(Et);function et(G,b){G.forEach(N=>{const I={id:N.id,labelText:N.label,height:N.height,width:N.width,padding:N.padding??0};Object.keys(N).forEach(L=>{["id","label","height","width","padding","x","y"].includes(L)||(I[L]=N[L])}),b.add({group:"nodes",data:I,position:{x:N.x??0,y:N.y??0}})})}V(et,"addNodes");function rt(G,b){G.forEach(N=>{const I={id:N.id,source:N.start,target:N.end};Object.keys(N).forEach(L=>{["id","start","end"].includes(L)||(I[L]=N[L])}),b.add({group:"edges",data:I})})}V(rt,"addEdges");function it(G){return new Promise(b=>{const N=lt("body").append("div").attr("id","cy").attr("style","display:none"),I=tt({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});N.remove(),et(G.nodes,I),rt(G.edges,I),I.nodes().forEach(function(o){o.layoutDimensions=()=>{const e=o.data();return{w:e.width,h:e.height}}});const L={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};I.layout(L).run(),I.ready(o=>{k.info("Cytoscape ready",o),b(I)})})}V(it,"createCytoscapeInstance");function nt(G){return G.nodes().map(b=>{const N=b.data(),I=b.position(),L={id:N.id,x:I.x,y:I.y};return Object.keys(N).forEach(o=>{o!=="id"&&(L[o]=N[o])}),L})}V(nt,"extractPositionedNodes");function ot(G){return G.edges().map(b=>{const N=b.data(),I=b._private.rscratch,L={id:N.id,source:N.source,target:N.target,startX:I.startX,startY:I.startY,midX:I.midX,midY:I.midY,endX:I.endX,endY:I.endY};return Object.keys(N).forEach(o=>{["id","source","target"].includes(o)||(L[o]=N[o])}),L})}V(ot,"extractPositionedEdges");async function st(G,b){k.debug("Starting cose-bilkent layout algorithm");try{at(G);const N=await it(G),I=nt(N),L=ot(N);return k.debug(`Layout completed: ${I.length} nodes, ${L.length} edges`),{nodes:I,edges:L}}catch(N){throw k.error("Error in cose-bilkent layout algorithm:",N),N}}V(st,"executeCoseBilkentLayout");function at(G){if(!G)throw new Error("Layout data is required");if(!G.config)throw new Error("Configuration is required in layout data");if(!G.rootNode)throw new Error("Root node is required");if(!G.nodes||!Array.isArray(G.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(G.edges))throw new Error("Edges array is required in layout data");return!0}V(at,"validateLayoutData");var Lt=V(async(G,b,{insertCluster:N,insertEdge:I,insertEdgeLabel:L,insertMarkers:o,insertNode:e,log:t,positionEdgeLabel:i},{algorithm:l})=>{const g={},n={},d=b.select("g");o(d,G.markers,G.type,G.diagramId);const r=d.insert("g").attr("class","subgraphs"),h=d.insert("g").attr("class","edgePaths"),a=d.insert("g").attr("class","edgeLabels"),p=d.insert("g").attr("class","nodes");t.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(G.nodes.map(async u=>{if(u.isGroup){const T={...u};n[u.id]=T,g[u.id]=T,await N(r,u)}else{const T={...u};g[u.id]=T;const y=await e(p,u,{config:G.config,dir:G.direction||"TB"}),O=y.node().getBBox();T.width=O.width,T.height=O.height,T.domId=y,t.debug(`Node ${u.id} dimensions: ${O.width}x${O.height}`)}})),t.debug("Running cose-bilkent layout algorithm");const v={...G,nodes:G.nodes.map(u=>{const T=g[u.id];return{...u,width:T.width,height:T.height}})},D=await st(v,G.config);t.debug("Positioning nodes based on layout results"),D.nodes.forEach(u=>{const T=g[u.id];T?.domId&&(T.domId.attr("transform",`translate(${u.x}, ${u.y})`),T.x=u.x,T.y=u.y,t.debug(`Positioned node ${T.id} at center (${u.x}, ${u.y})`))}),D.edges.forEach(u=>{const T=G.edges.find(y=>y.id===u.id);T&&(T.points=[{x:u.startX,y:u.startY},{x:u.midX,y:u.midY},{x:u.endX,y:u.endY}])}),t.debug("Inserting and positioning edges"),await Promise.all(G.edges.map(async u=>{await L(a,u);const T=g[u.start??""],y=g[u.end??""];if(T&&y){const O=D.edges.find(s=>s.id===u.id);if(O){t.debug("APA01 positionedEdge",O);const s={...u},f=I(h,s,n,G.type,T,y,G.diagramId);i(s,f)}else{const s={...u,points:[{x:T.x||0,y:T.y||0},{x:y.x||0,y:y.y||0}]},f=I(h,s,n,G.type,T,y,G.diagramId);i(s,f)}}})),t.debug("Cose-bilkent rendering completed")},"render"),Ot=Lt;export{Ot as render}; diff --git a/apps/kimi-code/dist-web/assets/cynefin-VYW2F7L2-DEnbetzx.js b/apps/kimi-code/dist-web/assets/cynefin-VYW2F7L2-DI-9Z5R0.js similarity index 99% rename from apps/kimi-code/dist-web/assets/cynefin-VYW2F7L2-DEnbetzx.js rename to apps/kimi-code/dist-web/assets/cynefin-VYW2F7L2-DI-9Z5R0.js index 06a6c073ca..e219db65b9 100644 --- a/apps/kimi-code/dist-web/assets/cynefin-VYW2F7L2-DEnbetzx.js +++ b/apps/kimi-code/dist-web/assets/cynefin-VYW2F7L2-DI-9Z5R0.js @@ -1,4 +1,4 @@ -import{bR as et}from"./index--0t1wzw_.js";var RI=Object.create,Ds=Object.defineProperty,AI=Object.getOwnPropertyDescriptor,Ad=Object.getOwnPropertyNames,EI=Object.getPrototypeOf,CI=Object.prototype.hasOwnProperty,i=(e,t)=>Ds(e,"name",{value:t,configurable:!0}),bI=(e,t)=>function(){return e&&(t=(0,e[Ad(e)[0]])(e=0)),t},H=(e,t)=>function(){return t||(0,e[Ad(e)[0]])((t={exports:{}}).exports,t),t.exports},Vr=(e,t)=>{for(var r in t)Ds(e,r,{get:t[r],enumerable:!0})},Ed=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Ad(t))!CI.call(e,a)&&a!==r&&Ds(e,a,{get:()=>t[a],enumerable:!(n=AI(t,a))||n.enumerable});return e},Ll=(e,t,r)=>(Ed(e,t,"default"),r),Cd=(e,t,r)=>(r=e!=null?RI(EI(e)):{},Ed(Ds(r,"default",{value:e,enumerable:!0}),e)),bd=e=>Ed(Ds({},"__esModule",{value:!0}),e),Dl={};Vr(Dl,{AnnotatedTextEdit:()=>mr,ChangeAnnotation:()=>an,ChangeAnnotationIdentifier:()=>Ke,CodeAction:()=>ef,CodeActionContext:()=>Qc,CodeActionKind:()=>Zc,CodeActionTriggerKind:()=>Xi,CodeDescription:()=>Nc,CodeLens:()=>tf,Color:()=>Co,ColorInformation:()=>Cc,ColorPresentation:()=>bc,Command:()=>nn,CompletionItem:()=>zc,CompletionItemKind:()=>Lc,CompletionItemLabelDetails:()=>Fc,CompletionItemTag:()=>xc,CompletionList:()=>jc,CreateFile:()=>ya,DeleteFile:()=>va,Diagnostic:()=>Vi,DiagnosticRelatedInformation:()=>bo,DiagnosticSeverity:()=>wc,DiagnosticTag:()=>Ic,DocumentHighlight:()=>Vc,DocumentHighlightKind:()=>Wc,DocumentLink:()=>nf,DocumentSymbol:()=>Jc,DocumentUri:()=>Rc,EOL:()=>zg,FoldingRange:()=>Sc,FoldingRangeKind:()=>_c,FormattingOptions:()=>rf,Hover:()=>Bc,InlayHint:()=>pf,InlayHintKind:()=>wo,InlayHintLabelPart:()=>Io,InlineCompletionContext:()=>Tf,InlineCompletionItem:()=>hf,InlineCompletionList:()=>yf,InlineCompletionTriggerKind:()=>gf,InlineValueContext:()=>df,InlineValueEvaluatableExpression:()=>ff,InlineValueText:()=>uf,InlineValueVariableLookup:()=>cf,InsertReplaceEdit:()=>Mc,InsertTextFormat:()=>Dc,InsertTextMode:()=>Gc,Location:()=>Wi,LocationLink:()=>Ec,MarkedString:()=>Yi,MarkupContent:()=>Ta,MarkupKind:()=>So,OptionalVersionedTextDocumentIdentifier:()=>Hi,ParameterInformation:()=>Uc,Position:()=>ie,Range:()=>Q,RenameFile:()=>ga,SelectedCompletionInfo:()=>vf,SelectionRange:()=>af,SemanticTokenModifiers:()=>of,SemanticTokenTypes:()=>sf,SemanticTokens:()=>lf,SignatureInformation:()=>Kc,StringValue:()=>mf,SymbolInformation:()=>Yc,SymbolKind:()=>qc,SymbolTag:()=>Hc,TextDocument:()=>Rf,TextDocumentEdit:()=>qi,TextDocumentIdentifier:()=>Pc,TextDocumentItem:()=>Oc,TextEdit:()=>Yt,URI:()=>Eo,VersionedTextDocumentIdentifier:()=>kc,WorkspaceChange:()=>Fg,WorkspaceEdit:()=>_o,WorkspaceFolder:()=>$f,WorkspaceSymbol:()=>Xc,integer:()=>Ac,uinteger:()=>Ki});var Rc,Eo,Ac,Ki,ie,Q,Wi,Ec,Co,Cc,bc,_c,Sc,bo,wc,Ic,Nc,Vi,nn,Yt,an,Ke,mr,qi,ya,ga,va,_o,ki,Ku,Fg,Pc,kc,Hi,Oc,So,Ta,Lc,Dc,xc,Mc,Gc,Fc,zc,jc,Yi,Bc,Uc,Kc,Wc,Vc,qc,Hc,Yc,Xc,Jc,Zc,Xi,Qc,ef,tf,rf,nf,af,sf,of,lf,uf,cf,ff,df,wo,Io,pf,mf,hf,yf,gf,vf,Tf,$f,zg,Rf,lh,A,xs=bI({"../../node_modules/.pnpm/vscode-languageserver-types@3.17.5/node_modules/vscode-languageserver-types/lib/esm/main.js"(){(function(e){function t(r){return typeof r=="string"}i(t,"is"),e.is=t})(Rc||(Rc={})),(function(e){function t(r){return typeof r=="string"}i(t,"is"),e.is=t})(Eo||(Eo={})),(function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647;function t(r){return typeof r=="number"&&e.MIN_VALUE<=r&&r<=e.MAX_VALUE}i(t,"is"),e.is=t})(Ac||(Ac={})),(function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647;function t(r){return typeof r=="number"&&e.MIN_VALUE<=r&&r<=e.MAX_VALUE}i(t,"is"),e.is=t})(Ki||(Ki={})),(function(e){function t(n,a){return n===Number.MAX_VALUE&&(n=Ki.MAX_VALUE),a===Number.MAX_VALUE&&(a=Ki.MAX_VALUE),{line:n,character:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&A.uinteger(a.line)&&A.uinteger(a.character)}i(r,"is"),e.is=r})(ie||(ie={})),(function(e){function t(n,a,s,o){if(A.uinteger(n)&&A.uinteger(a)&&A.uinteger(s)&&A.uinteger(o))return{start:ie.create(n,a),end:ie.create(s,o)};if(ie.is(n)&&ie.is(a))return{start:n,end:a};throw new Error(`Range#create called with invalid arguments[${n}, ${a}, ${s}, ${o}]`)}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&ie.is(a.start)&&ie.is(a.end)}i(r,"is"),e.is=r})(Q||(Q={})),(function(e){function t(n,a){return{uri:n,range:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&Q.is(a.range)&&(A.string(a.uri)||A.undefined(a.uri))}i(r,"is"),e.is=r})(Wi||(Wi={})),(function(e){function t(n,a,s,o){return{targetUri:n,targetRange:a,targetSelectionRange:s,originSelectionRange:o}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&Q.is(a.targetRange)&&A.string(a.targetUri)&&Q.is(a.targetSelectionRange)&&(Q.is(a.originSelectionRange)||A.undefined(a.originSelectionRange))}i(r,"is"),e.is=r})(Ec||(Ec={})),(function(e){function t(n,a,s,o){return{red:n,green:a,blue:s,alpha:o}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.numberRange(a.red,0,1)&&A.numberRange(a.green,0,1)&&A.numberRange(a.blue,0,1)&&A.numberRange(a.alpha,0,1)}i(r,"is"),e.is=r})(Co||(Co={})),(function(e){function t(n,a){return{range:n,color:a}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&Q.is(a.range)&&Co.is(a.color)}i(r,"is"),e.is=r})(Cc||(Cc={})),(function(e){function t(n,a,s){return{label:n,textEdit:a,additionalTextEdits:s}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.string(a.label)&&(A.undefined(a.textEdit)||Yt.is(a))&&(A.undefined(a.additionalTextEdits)||A.typedArray(a.additionalTextEdits,Yt.is))}i(r,"is"),e.is=r})(bc||(bc={})),(function(e){e.Comment="comment",e.Imports="imports",e.Region="region"})(_c||(_c={})),(function(e){function t(n,a,s,o,l,u){const c={startLine:n,endLine:a};return A.defined(s)&&(c.startCharacter=s),A.defined(o)&&(c.endCharacter=o),A.defined(l)&&(c.kind=l),A.defined(u)&&(c.collapsedText=u),c}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.uinteger(a.startLine)&&A.uinteger(a.startLine)&&(A.undefined(a.startCharacter)||A.uinteger(a.startCharacter))&&(A.undefined(a.endCharacter)||A.uinteger(a.endCharacter))&&(A.undefined(a.kind)||A.string(a.kind))}i(r,"is"),e.is=r})(Sc||(Sc={})),(function(e){function t(n,a){return{location:n,message:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Wi.is(a.location)&&A.string(a.message)}i(r,"is"),e.is=r})(bo||(bo={})),(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(wc||(wc={})),(function(e){e.Unnecessary=1,e.Deprecated=2})(Ic||(Ic={})),(function(e){function t(r){const n=r;return A.objectLiteral(n)&&A.string(n.href)}i(t,"is"),e.is=t})(Nc||(Nc={})),(function(e){function t(n,a,s,o,l,u){let c={range:n,message:a};return A.defined(s)&&(c.severity=s),A.defined(o)&&(c.code=o),A.defined(l)&&(c.source=l),A.defined(u)&&(c.relatedInformation=u),c}i(t,"create"),e.create=t;function r(n){var a;let s=n;return A.defined(s)&&Q.is(s.range)&&A.string(s.message)&&(A.number(s.severity)||A.undefined(s.severity))&&(A.integer(s.code)||A.string(s.code)||A.undefined(s.code))&&(A.undefined(s.codeDescription)||A.string((a=s.codeDescription)===null||a===void 0?void 0:a.href))&&(A.string(s.source)||A.undefined(s.source))&&(A.undefined(s.relatedInformation)||A.typedArray(s.relatedInformation,bo.is))}i(r,"is"),e.is=r})(Vi||(Vi={})),(function(e){function t(n,a,...s){let o={title:n,command:a};return A.defined(s)&&s.length>0&&(o.arguments=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.title)&&A.string(a.command)}i(r,"is"),e.is=r})(nn||(nn={})),(function(e){function t(s,o){return{range:s,newText:o}}i(t,"replace"),e.replace=t;function r(s,o){return{range:{start:s,end:s},newText:o}}i(r,"insert"),e.insert=r;function n(s){return{range:s,newText:""}}i(n,"del"),e.del=n;function a(s){const o=s;return A.objectLiteral(o)&&A.string(o.newText)&&Q.is(o.range)}i(a,"is"),e.is=a})(Yt||(Yt={})),(function(e){function t(n,a,s){const o={label:n};return a!==void 0&&(o.needsConfirmation=a),s!==void 0&&(o.description=s),o}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.string(a.label)&&(A.boolean(a.needsConfirmation)||a.needsConfirmation===void 0)&&(A.string(a.description)||a.description===void 0)}i(r,"is"),e.is=r})(an||(an={})),(function(e){function t(r){const n=r;return A.string(n)}i(t,"is"),e.is=t})(Ke||(Ke={})),(function(e){function t(s,o,l){return{range:s,newText:o,annotationId:l}}i(t,"replace"),e.replace=t;function r(s,o,l){return{range:{start:s,end:s},newText:o,annotationId:l}}i(r,"insert"),e.insert=r;function n(s,o){return{range:s,newText:"",annotationId:o}}i(n,"del"),e.del=n;function a(s){const o=s;return Yt.is(o)&&(an.is(o.annotationId)||Ke.is(o.annotationId))}i(a,"is"),e.is=a})(mr||(mr={})),(function(e){function t(n,a){return{textDocument:n,edits:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Hi.is(a.textDocument)&&Array.isArray(a.edits)}i(r,"is"),e.is=r})(qi||(qi={})),(function(e){function t(n,a,s){let o={kind:"create",uri:n};return a!==void 0&&(a.overwrite!==void 0||a.ignoreIfExists!==void 0)&&(o.options=a),s!==void 0&&(o.annotationId=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return a&&a.kind==="create"&&A.string(a.uri)&&(a.options===void 0||(a.options.overwrite===void 0||A.boolean(a.options.overwrite))&&(a.options.ignoreIfExists===void 0||A.boolean(a.options.ignoreIfExists)))&&(a.annotationId===void 0||Ke.is(a.annotationId))}i(r,"is"),e.is=r})(ya||(ya={})),(function(e){function t(n,a,s,o){let l={kind:"rename",oldUri:n,newUri:a};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(l.options=s),o!==void 0&&(l.annotationId=o),l}i(t,"create"),e.create=t;function r(n){let a=n;return a&&a.kind==="rename"&&A.string(a.oldUri)&&A.string(a.newUri)&&(a.options===void 0||(a.options.overwrite===void 0||A.boolean(a.options.overwrite))&&(a.options.ignoreIfExists===void 0||A.boolean(a.options.ignoreIfExists)))&&(a.annotationId===void 0||Ke.is(a.annotationId))}i(r,"is"),e.is=r})(ga||(ga={})),(function(e){function t(n,a,s){let o={kind:"delete",uri:n};return a!==void 0&&(a.recursive!==void 0||a.ignoreIfNotExists!==void 0)&&(o.options=a),s!==void 0&&(o.annotationId=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return a&&a.kind==="delete"&&A.string(a.uri)&&(a.options===void 0||(a.options.recursive===void 0||A.boolean(a.options.recursive))&&(a.options.ignoreIfNotExists===void 0||A.boolean(a.options.ignoreIfNotExists)))&&(a.annotationId===void 0||Ke.is(a.annotationId))}i(r,"is"),e.is=r})(va||(va={})),(function(e){function t(r){let n=r;return n&&(n.changes!==void 0||n.documentChanges!==void 0)&&(n.documentChanges===void 0||n.documentChanges.every(a=>A.string(a.kind)?ya.is(a)||ga.is(a)||va.is(a):qi.is(a)))}i(t,"is"),e.is=t})(_o||(_o={})),ki=class{static{i(this,"TextEditChangeImpl")}constructor(e,t){this.edits=e,this.changeAnnotations=t}insert(e,t,r){let n,a;if(r===void 0?n=Yt.insert(e,t):Ke.is(r)?(a=r,n=mr.insert(e,t,r)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(r),n=mr.insert(e,t,a)),this.edits.push(n),a!==void 0)return a}replace(e,t,r){let n,a;if(r===void 0?n=Yt.replace(e,t):Ke.is(r)?(a=r,n=mr.replace(e,t,r)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(r),n=mr.replace(e,t,a)),this.edits.push(n),a!==void 0)return a}delete(e,t){let r,n;if(t===void 0?r=Yt.del(e):Ke.is(t)?(n=t,r=mr.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),n=this.changeAnnotations.manage(t),r=mr.del(e,n)),this.edits.push(r),n!==void 0)return n}add(e){this.edits.push(e)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(e){if(e===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}},Ku=class{static{i(this,"ChangeAnnotations")}constructor(e){this._annotations=e===void 0?Object.create(null):e,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(e,t){let r;if(Ke.is(e)?r=e:(r=this.nextId(),t=e),this._annotations[r]!==void 0)throw new Error(`Id ${r} is already in use.`);if(t===void 0)throw new Error(`No annotation provided for id ${r}`);return this._annotations[r]=t,this._size++,r}nextId(){return this._counter++,this._counter.toString()}},Fg=class{static{i(this,"WorkspaceChange")}constructor(e){this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new Ku(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(t=>{if(qi.is(t)){const r=new ki(t.edits,this._changeAnnotations);this._textEditChanges[t.textDocument.uri]=r}})):e.changes&&Object.keys(e.changes).forEach(t=>{const r=new ki(e.changes[t]);this._textEditChanges[t]=r})):this._workspaceEdit={}}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(e){if(Hi.is(e)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const t={uri:e.uri,version:e.version};let r=this._textEditChanges[t.uri];if(!r){const n=[],a={textDocument:t,edits:n};this._workspaceEdit.documentChanges.push(a),r=new ki(n,this._changeAnnotations),this._textEditChanges[t.uri]=r}return r}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let t=this._textEditChanges[e];if(!t){let r=[];this._workspaceEdit.changes[e]=r,t=new ki(r),this._textEditChanges[e]=t}return t}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Ku,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(e,t,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let n;an.is(t)||Ke.is(t)?n=t:r=t;let a,s;if(n===void 0?a=ya.create(e,r):(s=Ke.is(n)?n:this._changeAnnotations.manage(n),a=ya.create(e,r,s)),this._workspaceEdit.documentChanges.push(a),s!==void 0)return s}renameFile(e,t,r,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let a;an.is(r)||Ke.is(r)?a=r:n=r;let s,o;if(a===void 0?s=ga.create(e,t,n):(o=Ke.is(a)?a:this._changeAnnotations.manage(a),s=ga.create(e,t,n,o)),this._workspaceEdit.documentChanges.push(s),o!==void 0)return o}deleteFile(e,t,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let n;an.is(t)||Ke.is(t)?n=t:r=t;let a,s;if(n===void 0?a=va.create(e,r):(s=Ke.is(n)?n:this._changeAnnotations.manage(n),a=va.create(e,r,s)),this._workspaceEdit.documentChanges.push(a),s!==void 0)return s}},(function(e){function t(n){return{uri:n}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)}i(r,"is"),e.is=r})(Pc||(Pc={})),(function(e){function t(n,a){return{uri:n,version:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)&&A.integer(a.version)}i(r,"is"),e.is=r})(kc||(kc={})),(function(e){function t(n,a){return{uri:n,version:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)&&(a.version===null||A.integer(a.version))}i(r,"is"),e.is=r})(Hi||(Hi={})),(function(e){function t(n,a,s,o){return{uri:n,languageId:a,version:s,text:o}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)&&A.string(a.languageId)&&A.integer(a.version)&&A.string(a.text)}i(r,"is"),e.is=r})(Oc||(Oc={})),(function(e){e.PlainText="plaintext",e.Markdown="markdown";function t(r){const n=r;return n===e.PlainText||n===e.Markdown}i(t,"is"),e.is=t})(So||(So={})),(function(e){function t(r){const n=r;return A.objectLiteral(r)&&So.is(n.kind)&&A.string(n.value)}i(t,"is"),e.is=t})(Ta||(Ta={})),(function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25})(Lc||(Lc={})),(function(e){e.PlainText=1,e.Snippet=2})(Dc||(Dc={})),(function(e){e.Deprecated=1})(xc||(xc={})),(function(e){function t(n,a,s){return{newText:n,insert:a,replace:s}}i(t,"create"),e.create=t;function r(n){const a=n;return a&&A.string(a.newText)&&Q.is(a.insert)&&Q.is(a.replace)}i(r,"is"),e.is=r})(Mc||(Mc={})),(function(e){e.asIs=1,e.adjustIndentation=2})(Gc||(Gc={})),(function(e){function t(r){const n=r;return n&&(A.string(n.detail)||n.detail===void 0)&&(A.string(n.description)||n.description===void 0)}i(t,"is"),e.is=t})(Fc||(Fc={})),(function(e){function t(r){return{label:r}}i(t,"create"),e.create=t})(zc||(zc={})),(function(e){function t(r,n){return{items:r||[],isIncomplete:!!n}}i(t,"create"),e.create=t})(jc||(jc={})),(function(e){function t(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}i(t,"fromPlainText"),e.fromPlainText=t;function r(n){const a=n;return A.string(a)||A.objectLiteral(a)&&A.string(a.language)&&A.string(a.value)}i(r,"is"),e.is=r})(Yi||(Yi={})),(function(e){function t(r){let n=r;return!!n&&A.objectLiteral(n)&&(Ta.is(n.contents)||Yi.is(n.contents)||A.typedArray(n.contents,Yi.is))&&(r.range===void 0||Q.is(r.range))}i(t,"is"),e.is=t})(Bc||(Bc={})),(function(e){function t(r,n){return n?{label:r,documentation:n}:{label:r}}i(t,"create"),e.create=t})(Uc||(Uc={})),(function(e){function t(r,n,...a){let s={label:r};return A.defined(n)&&(s.documentation=n),A.defined(a)?s.parameters=a:s.parameters=[],s}i(t,"create"),e.create=t})(Kc||(Kc={})),(function(e){e.Text=1,e.Read=2,e.Write=3})(Wc||(Wc={})),(function(e){function t(r,n){let a={range:r};return A.number(n)&&(a.kind=n),a}i(t,"create"),e.create=t})(Vc||(Vc={})),(function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26})(qc||(qc={})),(function(e){e.Deprecated=1})(Hc||(Hc={})),(function(e){function t(r,n,a,s,o){let l={name:r,kind:n,location:{uri:s,range:a}};return o&&(l.containerName=o),l}i(t,"create"),e.create=t})(Yc||(Yc={})),(function(e){function t(r,n,a,s){return s!==void 0?{name:r,kind:n,location:{uri:a,range:s}}:{name:r,kind:n,location:{uri:a}}}i(t,"create"),e.create=t})(Xc||(Xc={})),(function(e){function t(n,a,s,o,l,u){let c={name:n,detail:a,kind:s,range:o,selectionRange:l};return u!==void 0&&(c.children=u),c}i(t,"create"),e.create=t;function r(n){let a=n;return a&&A.string(a.name)&&A.number(a.kind)&&Q.is(a.range)&&Q.is(a.selectionRange)&&(a.detail===void 0||A.string(a.detail))&&(a.deprecated===void 0||A.boolean(a.deprecated))&&(a.children===void 0||Array.isArray(a.children))&&(a.tags===void 0||Array.isArray(a.tags))}i(r,"is"),e.is=r})(Jc||(Jc={})),(function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll"})(Zc||(Zc={})),(function(e){e.Invoked=1,e.Automatic=2})(Xi||(Xi={})),(function(e){function t(n,a,s){let o={diagnostics:n};return a!=null&&(o.only=a),s!=null&&(o.triggerKind=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.typedArray(a.diagnostics,Vi.is)&&(a.only===void 0||A.typedArray(a.only,A.string))&&(a.triggerKind===void 0||a.triggerKind===Xi.Invoked||a.triggerKind===Xi.Automatic)}i(r,"is"),e.is=r})(Qc||(Qc={})),(function(e){function t(n,a,s){let o={title:n},l=!0;return typeof a=="string"?(l=!1,o.kind=a):nn.is(a)?o.command=a:o.edit=a,l&&s!==void 0&&(o.kind=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return a&&A.string(a.title)&&(a.diagnostics===void 0||A.typedArray(a.diagnostics,Vi.is))&&(a.kind===void 0||A.string(a.kind))&&(a.edit!==void 0||a.command!==void 0)&&(a.command===void 0||nn.is(a.command))&&(a.isPreferred===void 0||A.boolean(a.isPreferred))&&(a.edit===void 0||_o.is(a.edit))}i(r,"is"),e.is=r})(ef||(ef={})),(function(e){function t(n,a){let s={range:n};return A.defined(a)&&(s.data=a),s}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Q.is(a.range)&&(A.undefined(a.command)||nn.is(a.command))}i(r,"is"),e.is=r})(tf||(tf={})),(function(e){function t(n,a){return{tabSize:n,insertSpaces:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.uinteger(a.tabSize)&&A.boolean(a.insertSpaces)}i(r,"is"),e.is=r})(rf||(rf={})),(function(e){function t(n,a,s){return{range:n,target:a,data:s}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Q.is(a.range)&&(A.undefined(a.target)||A.string(a.target))}i(r,"is"),e.is=r})(nf||(nf={})),(function(e){function t(n,a){return{range:n,parent:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&Q.is(a.range)&&(a.parent===void 0||e.is(a.parent))}i(r,"is"),e.is=r})(af||(af={})),(function(e){e.namespace="namespace",e.type="type",e.class="class",e.enum="enum",e.interface="interface",e.struct="struct",e.typeParameter="typeParameter",e.parameter="parameter",e.variable="variable",e.property="property",e.enumMember="enumMember",e.event="event",e.function="function",e.method="method",e.macro="macro",e.keyword="keyword",e.modifier="modifier",e.comment="comment",e.string="string",e.number="number",e.regexp="regexp",e.operator="operator",e.decorator="decorator"})(sf||(sf={})),(function(e){e.declaration="declaration",e.definition="definition",e.readonly="readonly",e.static="static",e.deprecated="deprecated",e.abstract="abstract",e.async="async",e.modification="modification",e.documentation="documentation",e.defaultLibrary="defaultLibrary"})(of||(of={})),(function(e){function t(r){const n=r;return A.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId=="string")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]=="number")}i(t,"is"),e.is=t})(lf||(lf={})),(function(e){function t(n,a){return{range:n,text:a}}i(t,"create"),e.create=t;function r(n){const a=n;return a!=null&&Q.is(a.range)&&A.string(a.text)}i(r,"is"),e.is=r})(uf||(uf={})),(function(e){function t(n,a,s){return{range:n,variableName:a,caseSensitiveLookup:s}}i(t,"create"),e.create=t;function r(n){const a=n;return a!=null&&Q.is(a.range)&&A.boolean(a.caseSensitiveLookup)&&(A.string(a.variableName)||a.variableName===void 0)}i(r,"is"),e.is=r})(cf||(cf={})),(function(e){function t(n,a){return{range:n,expression:a}}i(t,"create"),e.create=t;function r(n){const a=n;return a!=null&&Q.is(a.range)&&(A.string(a.expression)||a.expression===void 0)}i(r,"is"),e.is=r})(ff||(ff={})),(function(e){function t(n,a){return{frameId:n,stoppedLocation:a}}i(t,"create"),e.create=t;function r(n){const a=n;return A.defined(a)&&Q.is(n.stoppedLocation)}i(r,"is"),e.is=r})(df||(df={})),(function(e){e.Type=1,e.Parameter=2;function t(r){return r===1||r===2}i(t,"is"),e.is=t})(wo||(wo={})),(function(e){function t(n){return{value:n}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&(a.tooltip===void 0||A.string(a.tooltip)||Ta.is(a.tooltip))&&(a.location===void 0||Wi.is(a.location))&&(a.command===void 0||nn.is(a.command))}i(r,"is"),e.is=r})(Io||(Io={})),(function(e){function t(n,a,s){const o={position:n,label:a};return s!==void 0&&(o.kind=s),o}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&ie.is(a.position)&&(A.string(a.label)||A.typedArray(a.label,Io.is))&&(a.kind===void 0||wo.is(a.kind))&&a.textEdits===void 0||A.typedArray(a.textEdits,Yt.is)&&(a.tooltip===void 0||A.string(a.tooltip)||Ta.is(a.tooltip))&&(a.paddingLeft===void 0||A.boolean(a.paddingLeft))&&(a.paddingRight===void 0||A.boolean(a.paddingRight))}i(r,"is"),e.is=r})(pf||(pf={})),(function(e){function t(r){return{kind:"snippet",value:r}}i(t,"createSnippet"),e.createSnippet=t})(mf||(mf={})),(function(e){function t(r,n,a,s){return{insertText:r,filterText:n,range:a,command:s}}i(t,"create"),e.create=t})(hf||(hf={})),(function(e){function t(r){return{items:r}}i(t,"create"),e.create=t})(yf||(yf={})),(function(e){e.Invoked=0,e.Automatic=1})(gf||(gf={})),(function(e){function t(r,n){return{range:r,text:n}}i(t,"create"),e.create=t})(vf||(vf={})),(function(e){function t(r,n){return{triggerKind:r,selectedCompletionInfo:n}}i(t,"create"),e.create=t})(Tf||(Tf={})),(function(e){function t(r){const n=r;return A.objectLiteral(n)&&Eo.is(n.uri)&&A.string(n.name)}i(t,"is"),e.is=t})($f||($f={})),zg=[` +import{bR as et}from"./index-CiHMlsuo.js";var RI=Object.create,Ds=Object.defineProperty,AI=Object.getOwnPropertyDescriptor,Ad=Object.getOwnPropertyNames,EI=Object.getPrototypeOf,CI=Object.prototype.hasOwnProperty,i=(e,t)=>Ds(e,"name",{value:t,configurable:!0}),bI=(e,t)=>function(){return e&&(t=(0,e[Ad(e)[0]])(e=0)),t},H=(e,t)=>function(){return t||(0,e[Ad(e)[0]])((t={exports:{}}).exports,t),t.exports},Vr=(e,t)=>{for(var r in t)Ds(e,r,{get:t[r],enumerable:!0})},Ed=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Ad(t))!CI.call(e,a)&&a!==r&&Ds(e,a,{get:()=>t[a],enumerable:!(n=AI(t,a))||n.enumerable});return e},Ll=(e,t,r)=>(Ed(e,t,"default"),r),Cd=(e,t,r)=>(r=e!=null?RI(EI(e)):{},Ed(Ds(r,"default",{value:e,enumerable:!0}),e)),bd=e=>Ed(Ds({},"__esModule",{value:!0}),e),Dl={};Vr(Dl,{AnnotatedTextEdit:()=>mr,ChangeAnnotation:()=>an,ChangeAnnotationIdentifier:()=>Ke,CodeAction:()=>ef,CodeActionContext:()=>Qc,CodeActionKind:()=>Zc,CodeActionTriggerKind:()=>Xi,CodeDescription:()=>Nc,CodeLens:()=>tf,Color:()=>Co,ColorInformation:()=>Cc,ColorPresentation:()=>bc,Command:()=>nn,CompletionItem:()=>zc,CompletionItemKind:()=>Lc,CompletionItemLabelDetails:()=>Fc,CompletionItemTag:()=>xc,CompletionList:()=>jc,CreateFile:()=>ya,DeleteFile:()=>va,Diagnostic:()=>Vi,DiagnosticRelatedInformation:()=>bo,DiagnosticSeverity:()=>wc,DiagnosticTag:()=>Ic,DocumentHighlight:()=>Vc,DocumentHighlightKind:()=>Wc,DocumentLink:()=>nf,DocumentSymbol:()=>Jc,DocumentUri:()=>Rc,EOL:()=>zg,FoldingRange:()=>Sc,FoldingRangeKind:()=>_c,FormattingOptions:()=>rf,Hover:()=>Bc,InlayHint:()=>pf,InlayHintKind:()=>wo,InlayHintLabelPart:()=>Io,InlineCompletionContext:()=>Tf,InlineCompletionItem:()=>hf,InlineCompletionList:()=>yf,InlineCompletionTriggerKind:()=>gf,InlineValueContext:()=>df,InlineValueEvaluatableExpression:()=>ff,InlineValueText:()=>uf,InlineValueVariableLookup:()=>cf,InsertReplaceEdit:()=>Mc,InsertTextFormat:()=>Dc,InsertTextMode:()=>Gc,Location:()=>Wi,LocationLink:()=>Ec,MarkedString:()=>Yi,MarkupContent:()=>Ta,MarkupKind:()=>So,OptionalVersionedTextDocumentIdentifier:()=>Hi,ParameterInformation:()=>Uc,Position:()=>ie,Range:()=>Q,RenameFile:()=>ga,SelectedCompletionInfo:()=>vf,SelectionRange:()=>af,SemanticTokenModifiers:()=>of,SemanticTokenTypes:()=>sf,SemanticTokens:()=>lf,SignatureInformation:()=>Kc,StringValue:()=>mf,SymbolInformation:()=>Yc,SymbolKind:()=>qc,SymbolTag:()=>Hc,TextDocument:()=>Rf,TextDocumentEdit:()=>qi,TextDocumentIdentifier:()=>Pc,TextDocumentItem:()=>Oc,TextEdit:()=>Yt,URI:()=>Eo,VersionedTextDocumentIdentifier:()=>kc,WorkspaceChange:()=>Fg,WorkspaceEdit:()=>_o,WorkspaceFolder:()=>$f,WorkspaceSymbol:()=>Xc,integer:()=>Ac,uinteger:()=>Ki});var Rc,Eo,Ac,Ki,ie,Q,Wi,Ec,Co,Cc,bc,_c,Sc,bo,wc,Ic,Nc,Vi,nn,Yt,an,Ke,mr,qi,ya,ga,va,_o,ki,Ku,Fg,Pc,kc,Hi,Oc,So,Ta,Lc,Dc,xc,Mc,Gc,Fc,zc,jc,Yi,Bc,Uc,Kc,Wc,Vc,qc,Hc,Yc,Xc,Jc,Zc,Xi,Qc,ef,tf,rf,nf,af,sf,of,lf,uf,cf,ff,df,wo,Io,pf,mf,hf,yf,gf,vf,Tf,$f,zg,Rf,lh,A,xs=bI({"../../node_modules/.pnpm/vscode-languageserver-types@3.17.5/node_modules/vscode-languageserver-types/lib/esm/main.js"(){(function(e){function t(r){return typeof r=="string"}i(t,"is"),e.is=t})(Rc||(Rc={})),(function(e){function t(r){return typeof r=="string"}i(t,"is"),e.is=t})(Eo||(Eo={})),(function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647;function t(r){return typeof r=="number"&&e.MIN_VALUE<=r&&r<=e.MAX_VALUE}i(t,"is"),e.is=t})(Ac||(Ac={})),(function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647;function t(r){return typeof r=="number"&&e.MIN_VALUE<=r&&r<=e.MAX_VALUE}i(t,"is"),e.is=t})(Ki||(Ki={})),(function(e){function t(n,a){return n===Number.MAX_VALUE&&(n=Ki.MAX_VALUE),a===Number.MAX_VALUE&&(a=Ki.MAX_VALUE),{line:n,character:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&A.uinteger(a.line)&&A.uinteger(a.character)}i(r,"is"),e.is=r})(ie||(ie={})),(function(e){function t(n,a,s,o){if(A.uinteger(n)&&A.uinteger(a)&&A.uinteger(s)&&A.uinteger(o))return{start:ie.create(n,a),end:ie.create(s,o)};if(ie.is(n)&&ie.is(a))return{start:n,end:a};throw new Error(`Range#create called with invalid arguments[${n}, ${a}, ${s}, ${o}]`)}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&ie.is(a.start)&&ie.is(a.end)}i(r,"is"),e.is=r})(Q||(Q={})),(function(e){function t(n,a){return{uri:n,range:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&Q.is(a.range)&&(A.string(a.uri)||A.undefined(a.uri))}i(r,"is"),e.is=r})(Wi||(Wi={})),(function(e){function t(n,a,s,o){return{targetUri:n,targetRange:a,targetSelectionRange:s,originSelectionRange:o}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&Q.is(a.targetRange)&&A.string(a.targetUri)&&Q.is(a.targetSelectionRange)&&(Q.is(a.originSelectionRange)||A.undefined(a.originSelectionRange))}i(r,"is"),e.is=r})(Ec||(Ec={})),(function(e){function t(n,a,s,o){return{red:n,green:a,blue:s,alpha:o}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.numberRange(a.red,0,1)&&A.numberRange(a.green,0,1)&&A.numberRange(a.blue,0,1)&&A.numberRange(a.alpha,0,1)}i(r,"is"),e.is=r})(Co||(Co={})),(function(e){function t(n,a){return{range:n,color:a}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&Q.is(a.range)&&Co.is(a.color)}i(r,"is"),e.is=r})(Cc||(Cc={})),(function(e){function t(n,a,s){return{label:n,textEdit:a,additionalTextEdits:s}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.string(a.label)&&(A.undefined(a.textEdit)||Yt.is(a))&&(A.undefined(a.additionalTextEdits)||A.typedArray(a.additionalTextEdits,Yt.is))}i(r,"is"),e.is=r})(bc||(bc={})),(function(e){e.Comment="comment",e.Imports="imports",e.Region="region"})(_c||(_c={})),(function(e){function t(n,a,s,o,l,u){const c={startLine:n,endLine:a};return A.defined(s)&&(c.startCharacter=s),A.defined(o)&&(c.endCharacter=o),A.defined(l)&&(c.kind=l),A.defined(u)&&(c.collapsedText=u),c}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.uinteger(a.startLine)&&A.uinteger(a.startLine)&&(A.undefined(a.startCharacter)||A.uinteger(a.startCharacter))&&(A.undefined(a.endCharacter)||A.uinteger(a.endCharacter))&&(A.undefined(a.kind)||A.string(a.kind))}i(r,"is"),e.is=r})(Sc||(Sc={})),(function(e){function t(n,a){return{location:n,message:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Wi.is(a.location)&&A.string(a.message)}i(r,"is"),e.is=r})(bo||(bo={})),(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(wc||(wc={})),(function(e){e.Unnecessary=1,e.Deprecated=2})(Ic||(Ic={})),(function(e){function t(r){const n=r;return A.objectLiteral(n)&&A.string(n.href)}i(t,"is"),e.is=t})(Nc||(Nc={})),(function(e){function t(n,a,s,o,l,u){let c={range:n,message:a};return A.defined(s)&&(c.severity=s),A.defined(o)&&(c.code=o),A.defined(l)&&(c.source=l),A.defined(u)&&(c.relatedInformation=u),c}i(t,"create"),e.create=t;function r(n){var a;let s=n;return A.defined(s)&&Q.is(s.range)&&A.string(s.message)&&(A.number(s.severity)||A.undefined(s.severity))&&(A.integer(s.code)||A.string(s.code)||A.undefined(s.code))&&(A.undefined(s.codeDescription)||A.string((a=s.codeDescription)===null||a===void 0?void 0:a.href))&&(A.string(s.source)||A.undefined(s.source))&&(A.undefined(s.relatedInformation)||A.typedArray(s.relatedInformation,bo.is))}i(r,"is"),e.is=r})(Vi||(Vi={})),(function(e){function t(n,a,...s){let o={title:n,command:a};return A.defined(s)&&s.length>0&&(o.arguments=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.title)&&A.string(a.command)}i(r,"is"),e.is=r})(nn||(nn={})),(function(e){function t(s,o){return{range:s,newText:o}}i(t,"replace"),e.replace=t;function r(s,o){return{range:{start:s,end:s},newText:o}}i(r,"insert"),e.insert=r;function n(s){return{range:s,newText:""}}i(n,"del"),e.del=n;function a(s){const o=s;return A.objectLiteral(o)&&A.string(o.newText)&&Q.is(o.range)}i(a,"is"),e.is=a})(Yt||(Yt={})),(function(e){function t(n,a,s){const o={label:n};return a!==void 0&&(o.needsConfirmation=a),s!==void 0&&(o.description=s),o}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.string(a.label)&&(A.boolean(a.needsConfirmation)||a.needsConfirmation===void 0)&&(A.string(a.description)||a.description===void 0)}i(r,"is"),e.is=r})(an||(an={})),(function(e){function t(r){const n=r;return A.string(n)}i(t,"is"),e.is=t})(Ke||(Ke={})),(function(e){function t(s,o,l){return{range:s,newText:o,annotationId:l}}i(t,"replace"),e.replace=t;function r(s,o,l){return{range:{start:s,end:s},newText:o,annotationId:l}}i(r,"insert"),e.insert=r;function n(s,o){return{range:s,newText:"",annotationId:o}}i(n,"del"),e.del=n;function a(s){const o=s;return Yt.is(o)&&(an.is(o.annotationId)||Ke.is(o.annotationId))}i(a,"is"),e.is=a})(mr||(mr={})),(function(e){function t(n,a){return{textDocument:n,edits:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Hi.is(a.textDocument)&&Array.isArray(a.edits)}i(r,"is"),e.is=r})(qi||(qi={})),(function(e){function t(n,a,s){let o={kind:"create",uri:n};return a!==void 0&&(a.overwrite!==void 0||a.ignoreIfExists!==void 0)&&(o.options=a),s!==void 0&&(o.annotationId=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return a&&a.kind==="create"&&A.string(a.uri)&&(a.options===void 0||(a.options.overwrite===void 0||A.boolean(a.options.overwrite))&&(a.options.ignoreIfExists===void 0||A.boolean(a.options.ignoreIfExists)))&&(a.annotationId===void 0||Ke.is(a.annotationId))}i(r,"is"),e.is=r})(ya||(ya={})),(function(e){function t(n,a,s,o){let l={kind:"rename",oldUri:n,newUri:a};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(l.options=s),o!==void 0&&(l.annotationId=o),l}i(t,"create"),e.create=t;function r(n){let a=n;return a&&a.kind==="rename"&&A.string(a.oldUri)&&A.string(a.newUri)&&(a.options===void 0||(a.options.overwrite===void 0||A.boolean(a.options.overwrite))&&(a.options.ignoreIfExists===void 0||A.boolean(a.options.ignoreIfExists)))&&(a.annotationId===void 0||Ke.is(a.annotationId))}i(r,"is"),e.is=r})(ga||(ga={})),(function(e){function t(n,a,s){let o={kind:"delete",uri:n};return a!==void 0&&(a.recursive!==void 0||a.ignoreIfNotExists!==void 0)&&(o.options=a),s!==void 0&&(o.annotationId=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return a&&a.kind==="delete"&&A.string(a.uri)&&(a.options===void 0||(a.options.recursive===void 0||A.boolean(a.options.recursive))&&(a.options.ignoreIfNotExists===void 0||A.boolean(a.options.ignoreIfNotExists)))&&(a.annotationId===void 0||Ke.is(a.annotationId))}i(r,"is"),e.is=r})(va||(va={})),(function(e){function t(r){let n=r;return n&&(n.changes!==void 0||n.documentChanges!==void 0)&&(n.documentChanges===void 0||n.documentChanges.every(a=>A.string(a.kind)?ya.is(a)||ga.is(a)||va.is(a):qi.is(a)))}i(t,"is"),e.is=t})(_o||(_o={})),ki=class{static{i(this,"TextEditChangeImpl")}constructor(e,t){this.edits=e,this.changeAnnotations=t}insert(e,t,r){let n,a;if(r===void 0?n=Yt.insert(e,t):Ke.is(r)?(a=r,n=mr.insert(e,t,r)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(r),n=mr.insert(e,t,a)),this.edits.push(n),a!==void 0)return a}replace(e,t,r){let n,a;if(r===void 0?n=Yt.replace(e,t):Ke.is(r)?(a=r,n=mr.replace(e,t,r)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(r),n=mr.replace(e,t,a)),this.edits.push(n),a!==void 0)return a}delete(e,t){let r,n;if(t===void 0?r=Yt.del(e):Ke.is(t)?(n=t,r=mr.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),n=this.changeAnnotations.manage(t),r=mr.del(e,n)),this.edits.push(r),n!==void 0)return n}add(e){this.edits.push(e)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(e){if(e===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}},Ku=class{static{i(this,"ChangeAnnotations")}constructor(e){this._annotations=e===void 0?Object.create(null):e,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(e,t){let r;if(Ke.is(e)?r=e:(r=this.nextId(),t=e),this._annotations[r]!==void 0)throw new Error(`Id ${r} is already in use.`);if(t===void 0)throw new Error(`No annotation provided for id ${r}`);return this._annotations[r]=t,this._size++,r}nextId(){return this._counter++,this._counter.toString()}},Fg=class{static{i(this,"WorkspaceChange")}constructor(e){this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new Ku(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(t=>{if(qi.is(t)){const r=new ki(t.edits,this._changeAnnotations);this._textEditChanges[t.textDocument.uri]=r}})):e.changes&&Object.keys(e.changes).forEach(t=>{const r=new ki(e.changes[t]);this._textEditChanges[t]=r})):this._workspaceEdit={}}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(e){if(Hi.is(e)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const t={uri:e.uri,version:e.version};let r=this._textEditChanges[t.uri];if(!r){const n=[],a={textDocument:t,edits:n};this._workspaceEdit.documentChanges.push(a),r=new ki(n,this._changeAnnotations),this._textEditChanges[t.uri]=r}return r}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let t=this._textEditChanges[e];if(!t){let r=[];this._workspaceEdit.changes[e]=r,t=new ki(r),this._textEditChanges[e]=t}return t}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Ku,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(e,t,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let n;an.is(t)||Ke.is(t)?n=t:r=t;let a,s;if(n===void 0?a=ya.create(e,r):(s=Ke.is(n)?n:this._changeAnnotations.manage(n),a=ya.create(e,r,s)),this._workspaceEdit.documentChanges.push(a),s!==void 0)return s}renameFile(e,t,r,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let a;an.is(r)||Ke.is(r)?a=r:n=r;let s,o;if(a===void 0?s=ga.create(e,t,n):(o=Ke.is(a)?a:this._changeAnnotations.manage(a),s=ga.create(e,t,n,o)),this._workspaceEdit.documentChanges.push(s),o!==void 0)return o}deleteFile(e,t,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let n;an.is(t)||Ke.is(t)?n=t:r=t;let a,s;if(n===void 0?a=va.create(e,r):(s=Ke.is(n)?n:this._changeAnnotations.manage(n),a=va.create(e,r,s)),this._workspaceEdit.documentChanges.push(a),s!==void 0)return s}},(function(e){function t(n){return{uri:n}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)}i(r,"is"),e.is=r})(Pc||(Pc={})),(function(e){function t(n,a){return{uri:n,version:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)&&A.integer(a.version)}i(r,"is"),e.is=r})(kc||(kc={})),(function(e){function t(n,a){return{uri:n,version:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)&&(a.version===null||A.integer(a.version))}i(r,"is"),e.is=r})(Hi||(Hi={})),(function(e){function t(n,a,s,o){return{uri:n,languageId:a,version:s,text:o}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)&&A.string(a.languageId)&&A.integer(a.version)&&A.string(a.text)}i(r,"is"),e.is=r})(Oc||(Oc={})),(function(e){e.PlainText="plaintext",e.Markdown="markdown";function t(r){const n=r;return n===e.PlainText||n===e.Markdown}i(t,"is"),e.is=t})(So||(So={})),(function(e){function t(r){const n=r;return A.objectLiteral(r)&&So.is(n.kind)&&A.string(n.value)}i(t,"is"),e.is=t})(Ta||(Ta={})),(function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25})(Lc||(Lc={})),(function(e){e.PlainText=1,e.Snippet=2})(Dc||(Dc={})),(function(e){e.Deprecated=1})(xc||(xc={})),(function(e){function t(n,a,s){return{newText:n,insert:a,replace:s}}i(t,"create"),e.create=t;function r(n){const a=n;return a&&A.string(a.newText)&&Q.is(a.insert)&&Q.is(a.replace)}i(r,"is"),e.is=r})(Mc||(Mc={})),(function(e){e.asIs=1,e.adjustIndentation=2})(Gc||(Gc={})),(function(e){function t(r){const n=r;return n&&(A.string(n.detail)||n.detail===void 0)&&(A.string(n.description)||n.description===void 0)}i(t,"is"),e.is=t})(Fc||(Fc={})),(function(e){function t(r){return{label:r}}i(t,"create"),e.create=t})(zc||(zc={})),(function(e){function t(r,n){return{items:r||[],isIncomplete:!!n}}i(t,"create"),e.create=t})(jc||(jc={})),(function(e){function t(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}i(t,"fromPlainText"),e.fromPlainText=t;function r(n){const a=n;return A.string(a)||A.objectLiteral(a)&&A.string(a.language)&&A.string(a.value)}i(r,"is"),e.is=r})(Yi||(Yi={})),(function(e){function t(r){let n=r;return!!n&&A.objectLiteral(n)&&(Ta.is(n.contents)||Yi.is(n.contents)||A.typedArray(n.contents,Yi.is))&&(r.range===void 0||Q.is(r.range))}i(t,"is"),e.is=t})(Bc||(Bc={})),(function(e){function t(r,n){return n?{label:r,documentation:n}:{label:r}}i(t,"create"),e.create=t})(Uc||(Uc={})),(function(e){function t(r,n,...a){let s={label:r};return A.defined(n)&&(s.documentation=n),A.defined(a)?s.parameters=a:s.parameters=[],s}i(t,"create"),e.create=t})(Kc||(Kc={})),(function(e){e.Text=1,e.Read=2,e.Write=3})(Wc||(Wc={})),(function(e){function t(r,n){let a={range:r};return A.number(n)&&(a.kind=n),a}i(t,"create"),e.create=t})(Vc||(Vc={})),(function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26})(qc||(qc={})),(function(e){e.Deprecated=1})(Hc||(Hc={})),(function(e){function t(r,n,a,s,o){let l={name:r,kind:n,location:{uri:s,range:a}};return o&&(l.containerName=o),l}i(t,"create"),e.create=t})(Yc||(Yc={})),(function(e){function t(r,n,a,s){return s!==void 0?{name:r,kind:n,location:{uri:a,range:s}}:{name:r,kind:n,location:{uri:a}}}i(t,"create"),e.create=t})(Xc||(Xc={})),(function(e){function t(n,a,s,o,l,u){let c={name:n,detail:a,kind:s,range:o,selectionRange:l};return u!==void 0&&(c.children=u),c}i(t,"create"),e.create=t;function r(n){let a=n;return a&&A.string(a.name)&&A.number(a.kind)&&Q.is(a.range)&&Q.is(a.selectionRange)&&(a.detail===void 0||A.string(a.detail))&&(a.deprecated===void 0||A.boolean(a.deprecated))&&(a.children===void 0||Array.isArray(a.children))&&(a.tags===void 0||Array.isArray(a.tags))}i(r,"is"),e.is=r})(Jc||(Jc={})),(function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll"})(Zc||(Zc={})),(function(e){e.Invoked=1,e.Automatic=2})(Xi||(Xi={})),(function(e){function t(n,a,s){let o={diagnostics:n};return a!=null&&(o.only=a),s!=null&&(o.triggerKind=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.typedArray(a.diagnostics,Vi.is)&&(a.only===void 0||A.typedArray(a.only,A.string))&&(a.triggerKind===void 0||a.triggerKind===Xi.Invoked||a.triggerKind===Xi.Automatic)}i(r,"is"),e.is=r})(Qc||(Qc={})),(function(e){function t(n,a,s){let o={title:n},l=!0;return typeof a=="string"?(l=!1,o.kind=a):nn.is(a)?o.command=a:o.edit=a,l&&s!==void 0&&(o.kind=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return a&&A.string(a.title)&&(a.diagnostics===void 0||A.typedArray(a.diagnostics,Vi.is))&&(a.kind===void 0||A.string(a.kind))&&(a.edit!==void 0||a.command!==void 0)&&(a.command===void 0||nn.is(a.command))&&(a.isPreferred===void 0||A.boolean(a.isPreferred))&&(a.edit===void 0||_o.is(a.edit))}i(r,"is"),e.is=r})(ef||(ef={})),(function(e){function t(n,a){let s={range:n};return A.defined(a)&&(s.data=a),s}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Q.is(a.range)&&(A.undefined(a.command)||nn.is(a.command))}i(r,"is"),e.is=r})(tf||(tf={})),(function(e){function t(n,a){return{tabSize:n,insertSpaces:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.uinteger(a.tabSize)&&A.boolean(a.insertSpaces)}i(r,"is"),e.is=r})(rf||(rf={})),(function(e){function t(n,a,s){return{range:n,target:a,data:s}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Q.is(a.range)&&(A.undefined(a.target)||A.string(a.target))}i(r,"is"),e.is=r})(nf||(nf={})),(function(e){function t(n,a){return{range:n,parent:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&Q.is(a.range)&&(a.parent===void 0||e.is(a.parent))}i(r,"is"),e.is=r})(af||(af={})),(function(e){e.namespace="namespace",e.type="type",e.class="class",e.enum="enum",e.interface="interface",e.struct="struct",e.typeParameter="typeParameter",e.parameter="parameter",e.variable="variable",e.property="property",e.enumMember="enumMember",e.event="event",e.function="function",e.method="method",e.macro="macro",e.keyword="keyword",e.modifier="modifier",e.comment="comment",e.string="string",e.number="number",e.regexp="regexp",e.operator="operator",e.decorator="decorator"})(sf||(sf={})),(function(e){e.declaration="declaration",e.definition="definition",e.readonly="readonly",e.static="static",e.deprecated="deprecated",e.abstract="abstract",e.async="async",e.modification="modification",e.documentation="documentation",e.defaultLibrary="defaultLibrary"})(of||(of={})),(function(e){function t(r){const n=r;return A.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId=="string")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]=="number")}i(t,"is"),e.is=t})(lf||(lf={})),(function(e){function t(n,a){return{range:n,text:a}}i(t,"create"),e.create=t;function r(n){const a=n;return a!=null&&Q.is(a.range)&&A.string(a.text)}i(r,"is"),e.is=r})(uf||(uf={})),(function(e){function t(n,a,s){return{range:n,variableName:a,caseSensitiveLookup:s}}i(t,"create"),e.create=t;function r(n){const a=n;return a!=null&&Q.is(a.range)&&A.boolean(a.caseSensitiveLookup)&&(A.string(a.variableName)||a.variableName===void 0)}i(r,"is"),e.is=r})(cf||(cf={})),(function(e){function t(n,a){return{range:n,expression:a}}i(t,"create"),e.create=t;function r(n){const a=n;return a!=null&&Q.is(a.range)&&(A.string(a.expression)||a.expression===void 0)}i(r,"is"),e.is=r})(ff||(ff={})),(function(e){function t(n,a){return{frameId:n,stoppedLocation:a}}i(t,"create"),e.create=t;function r(n){const a=n;return A.defined(a)&&Q.is(n.stoppedLocation)}i(r,"is"),e.is=r})(df||(df={})),(function(e){e.Type=1,e.Parameter=2;function t(r){return r===1||r===2}i(t,"is"),e.is=t})(wo||(wo={})),(function(e){function t(n){return{value:n}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&(a.tooltip===void 0||A.string(a.tooltip)||Ta.is(a.tooltip))&&(a.location===void 0||Wi.is(a.location))&&(a.command===void 0||nn.is(a.command))}i(r,"is"),e.is=r})(Io||(Io={})),(function(e){function t(n,a,s){const o={position:n,label:a};return s!==void 0&&(o.kind=s),o}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&ie.is(a.position)&&(A.string(a.label)||A.typedArray(a.label,Io.is))&&(a.kind===void 0||wo.is(a.kind))&&a.textEdits===void 0||A.typedArray(a.textEdits,Yt.is)&&(a.tooltip===void 0||A.string(a.tooltip)||Ta.is(a.tooltip))&&(a.paddingLeft===void 0||A.boolean(a.paddingLeft))&&(a.paddingRight===void 0||A.boolean(a.paddingRight))}i(r,"is"),e.is=r})(pf||(pf={})),(function(e){function t(r){return{kind:"snippet",value:r}}i(t,"createSnippet"),e.createSnippet=t})(mf||(mf={})),(function(e){function t(r,n,a,s){return{insertText:r,filterText:n,range:a,command:s}}i(t,"create"),e.create=t})(hf||(hf={})),(function(e){function t(r){return{items:r}}i(t,"create"),e.create=t})(yf||(yf={})),(function(e){e.Invoked=0,e.Automatic=1})(gf||(gf={})),(function(e){function t(r,n){return{range:r,text:n}}i(t,"create"),e.create=t})(vf||(vf={})),(function(e){function t(r,n){return{triggerKind:r,selectedCompletionInfo:n}}i(t,"create"),e.create=t})(Tf||(Tf={})),(function(e){function t(r){const n=r;return A.objectLiteral(n)&&Eo.is(n.uri)&&A.string(n.name)}i(t,"is"),e.is=t})($f||($f={})),zg=[` `,`\r `,"\r"],(function(e){function t(s,o,l,u){return new lh(s,o,l,u)}i(t,"create"),e.create=t;function r(s){let o=s;return!!(A.defined(o)&&A.string(o.uri)&&(A.undefined(o.languageId)||A.string(o.languageId))&&A.uinteger(o.lineCount)&&A.func(o.getText)&&A.func(o.positionAt)&&A.func(o.offsetAt))}i(r,"is"),e.is=r;function n(s,o){let l=s.getText(),u=a(o,(f,d)=>{let m=f.range.start.line-d.range.start.line;return m===0?f.range.start.character-d.range.start.character:m}),c=l.length;for(let f=u.length-1;f>=0;f--){let d=u[f],m=s.offsetAt(d.range.start),g=s.offsetAt(d.range.end);if(g<=c)l=l.substring(0,m)+d.newText+l.substring(g,l.length);else throw new Error("Overlapping edit");c=m}return l}i(n,"applyEdits"),e.applyEdits=n;function a(s,o){if(s.length<=1)return s;const l=s.length/2|0,u=s.slice(0,l),c=s.slice(l);a(u,o),a(c,o);let f=0,d=0,m=0;for(;f({domains:new Map,transitions:[]}),"createDefaultData"),H=rt(),St=s(()=>H.domains,"getDomains"),Mt=s(()=>H.transitions,"getTransitions"),zt=s(t=>{if(t)for(const e of t){const n=e.domain,a=(e.items??[]).map(c=>({label:c.label}));H.domains.set(n,{name:n,items:a})}},"setDomains"),Lt=s(t=>{t&&(H.transitions=t.filter(e=>e.from===e.to?(O.warn(`Cynefin: self-loop transition on domain "${e.from}" is not meaningful and will be skipped.`),!1):!0).map(e=>({from:e.from,to:e.to,label:e.label||void 0})))},"setTransitions"),Nt=s(()=>U({...Tt.cynefin,...Q().cynefin}),"getConfig"),Pt=s(()=>{At(),H=rt()},"clear"),Y={getDomains:St,getTransitions:Mt,setDomains:zt,setTransitions:Lt,getConfig:Nt,clear:Pt,setAccTitle:vt,getAccTitle:Ct,setDiagramTitle:wt,getDiagramTitle:bt,getAccDescription:$t,setAccDescription:gt},It=s(t=>{xt(t,Y),Y.setDomains(t.domains),Y.setTransitions(t.transitions)},"populate"),Wt={parse:s(async t=>{const e=await Bt("cynefin",t);O.debug(e),It(e)},"parse")};function V(t){let e=t+1831565813|0;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}s(V,"seededRandom");function st(t){let e=0;for(let n=0;n{const n=t/2,a=e/2;return{complex:{cx:n/2,cy:a/2,x:0,y:0,w:n,h:a},complicated:{cx:n+n/2,cy:a/2,x:n,y:0,w:n,h:a},chaotic:{cx:n/2,cy:a+a/2,x:0,y:a,w:n,h:a},clear:{cx:n+n/2,cy:a+a/2,x:n,y:a,w:n,h:a},confusion:{cx:n,cy:a,x:n*.7,y:a*.7,w:n*.6,h:a*.6}}},"getDomainLayouts"),_t=s(()=>{const t=ot(),e=Q();return U(t,e.themeVariables).cynefin},"getCynefinDomainColors"),q=3,Et=s((t,e,n,a)=>{const c=a.db,m=c.getDomains(),v=c.getTransitions(),W=c.getDiagramTitle(),d=c.getAccTitle(),D=c.getAccDescription(),o=c.getConfig(),p=_t();O.debug("Rendering Cynefin diagram");const i=o.width,f=o.height,b=o.padding,h=o.showDomainDescriptions,R=o.boundaryAmplitude,_=i+b*2,E=f+b*2,z={complex:p.complexBg,complicated:p.complicatedBg,clear:p.clearBg,chaotic:p.chaoticBg,confusion:p.confusionBg},k=Dt(e);kt(k,E,_,o.useMaxWidth??!0),k.attr("viewBox",`0 0 ${_} ${E}`),d&&k.append("title").text(d),D&&k.append("desc").text(D);const A=k.append("g").attr("transform",`translate(${b}, ${b})`),F=Rt(i,f),Z=it(o.seed,e),mt=A.append("g").attr("class","cynefin-backgrounds"),X=["complex","complicated","chaotic","clear"];for(const l of X){const r=F[l];mt.append("rect").attr("class","cynefinDomain").attr("x",r.x).attr("y",r.y).attr("width",r.w).attr("height",r.h).attr("fill",z[l]).attr("fill-opacity",.4).attr("stroke","none")}const j=A.append("g").attr("class","cynefin-boundaries");j.append("path").attr("class","cynefinBoundary").attr("d",ct(i,f,Z,R)).attr("fill","none"),j.append("path").attr("class","cynefinBoundary").attr("d",lt(i,f,Z+100,R)).attr("fill","none"),j.append("path").attr("class","cynefinCliff").attr("d",dt(i,f)).attr("fill","none");const pt=i*.15,yt=f*.15;A.append("path").attr("class","cynefinConfusion").attr("d",ft(i/2,f/2,pt,yt)).attr("fill",z.confusion).attr("fill-opacity",.5);const J=A.append("g").attr("class","cynefin-labels");for(const l of X){const r=F[l];J.append("text").attr("class","cynefinDomainLabel").attr("x",r.cx).attr("y",h?r.cy-30:r.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(l.charAt(0).toUpperCase()+l.slice(1))}if(J.append("text").attr("class","cynefinDomainLabel").attr("x",i/2).attr("y",h?f/2-10:f/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Confusion"),h){const l=A.append("g").attr("class","cynefin-subtitles");for(const r of X){const u=F[r],y=at[r];l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.model),l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.practice)}l.append("text").attr("class","cynefinSubtitle").attr("x",i/2).attr("y",f/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(at.confusion.practice)}const K=A.append("g").attr("class","cynefin-items"),T=26,tt=10,ut=["complex","complicated","chaotic","clear","confusion"];for(const l of ut){const r=m.get(l);if(!r||r.items.length===0)continue;const u=F[l],y=l==="confusion";let L=r.items,N=0;y&&r.items.length>q&&(N=r.items.length-q,L=r.items.slice(0,q));let B;if(y){const g=h?22:14;B=u.cy+g}else B=u.cy+(h?25:15);if([...L].forEach((g,S)=>{const w=B+S*(T+4),M=K.append("g"),P=M.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",T/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(g.label);let $=g.label.length*7;const x=P.node();if(x&&typeof x.getBBox=="function"){const G=x.getBBox();G.width>0&&($=G.width)}const C=$+tt*2,I=u.cx-C/2;M.attr("transform",`translate(${I}, ${w})`),M.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",C).attr("height",T).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.95),P.attr("x",C/2).attr("y",T/2)}),N>0){const g=B+L.length*(T+4),S=`+${N} more`,w=K.append("g"),M=w.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",T/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(S);let P=S.length*7;const $=M.node();if($&&typeof $.getBBox=="function"){const I=$.getBBox();I.width>0&&(P=I.width)}const x=P+tt*2,C=u.cx-x/2;w.attr("transform",`translate(${C}, ${g})`),w.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",x).attr("height",T).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.6),M.attr("x",x/2).attr("y",T/2)}}if(v.length>0){const l=k.select("defs").empty()?k.append("defs"):k.select("defs"),r=`cynefin-arrow-${e}`;l.append("marker").attr("id",r).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","cynefinArrowHead");const u=A.append("g").attr("class","cynefin-arrows");v.forEach(y=>{const L=F[y.from],N=F[y.to];if(!L||!N)return;if(y.from===y.to){O.warn(`Cynefin renderer: skipping self-loop on domain "${y.from}"`);return}const B=L.cx,g=L.cy,S=N.cx,w=N.cy,M=(B+S)/2,P=(g+w)/2,$=S-B,x=w-g,C=Math.sqrt($*$+x*x),I=C*.15,G=-x/C,ht=$/C,et=M+G*I,nt=P+ht*I;u.append("path").attr("class","cynefinArrowLine").attr("d",`M${B},${g} Q${et},${nt} ${S},${w}`).attr("fill","none").attr("marker-end",`url(#${r})`),y.label&&u.append("text").attr("class","cynefinArrowLabel").attr("x",et).attr("y",nt-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(y.label)})}W&&A.append("text").attr("class","cynefinTitle").attr("x",i/2).attr("y",-b/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(W)},"draw"),Ft={draw:Et},Vt=s(()=>{const t=ot(),e=Q();return U(t,e.themeVariables).cynefin},"getCynefinTheme"),Ht=s(()=>{const t=Vt();return` +import{p as xt}from"./chunk-JWPE2WC7-BJMJfnyy.js";import{s as gt,g as $t,o as bt,n as wt,a as Ct,b as vt,_ as s,l as O,D as Dt,e as kt,p as At,A as U,y as Q,B as Tt,E as ot}from"./mermaid.core-WW7RuneT.js";import{p as Bt}from"./cynefin-VYW2F7L2-DI-9Z5R0.js";import"./index-CiHMlsuo.js";import"./_commonjsHelpers-CqkleIqs.js";var rt=s(()=>({domains:new Map,transitions:[]}),"createDefaultData"),H=rt(),St=s(()=>H.domains,"getDomains"),Mt=s(()=>H.transitions,"getTransitions"),zt=s(t=>{if(t)for(const e of t){const n=e.domain,a=(e.items??[]).map(c=>({label:c.label}));H.domains.set(n,{name:n,items:a})}},"setDomains"),Lt=s(t=>{t&&(H.transitions=t.filter(e=>e.from===e.to?(O.warn(`Cynefin: self-loop transition on domain "${e.from}" is not meaningful and will be skipped.`),!1):!0).map(e=>({from:e.from,to:e.to,label:e.label||void 0})))},"setTransitions"),Nt=s(()=>U({...Tt.cynefin,...Q().cynefin}),"getConfig"),Pt=s(()=>{At(),H=rt()},"clear"),Y={getDomains:St,getTransitions:Mt,setDomains:zt,setTransitions:Lt,getConfig:Nt,clear:Pt,setAccTitle:vt,getAccTitle:Ct,setDiagramTitle:wt,getDiagramTitle:bt,getAccDescription:$t,setAccDescription:gt},It=s(t=>{xt(t,Y),Y.setDomains(t.domains),Y.setTransitions(t.transitions)},"populate"),Wt={parse:s(async t=>{const e=await Bt("cynefin",t);O.debug(e),It(e)},"parse")};function V(t){let e=t+1831565813|0;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}s(V,"seededRandom");function st(t){let e=0;for(let n=0;n{const n=t/2,a=e/2;return{complex:{cx:n/2,cy:a/2,x:0,y:0,w:n,h:a},complicated:{cx:n+n/2,cy:a/2,x:n,y:0,w:n,h:a},chaotic:{cx:n/2,cy:a+a/2,x:0,y:a,w:n,h:a},clear:{cx:n+n/2,cy:a+a/2,x:n,y:a,w:n,h:a},confusion:{cx:n,cy:a,x:n*.7,y:a*.7,w:n*.6,h:a*.6}}},"getDomainLayouts"),_t=s(()=>{const t=ot(),e=Q();return U(t,e.themeVariables).cynefin},"getCynefinDomainColors"),q=3,Et=s((t,e,n,a)=>{const c=a.db,m=c.getDomains(),v=c.getTransitions(),W=c.getDiagramTitle(),d=c.getAccTitle(),D=c.getAccDescription(),o=c.getConfig(),p=_t();O.debug("Rendering Cynefin diagram");const i=o.width,f=o.height,b=o.padding,h=o.showDomainDescriptions,R=o.boundaryAmplitude,_=i+b*2,E=f+b*2,z={complex:p.complexBg,complicated:p.complicatedBg,clear:p.clearBg,chaotic:p.chaoticBg,confusion:p.confusionBg},k=Dt(e);kt(k,E,_,o.useMaxWidth??!0),k.attr("viewBox",`0 0 ${_} ${E}`),d&&k.append("title").text(d),D&&k.append("desc").text(D);const A=k.append("g").attr("transform",`translate(${b}, ${b})`),F=Rt(i,f),Z=it(o.seed,e),mt=A.append("g").attr("class","cynefin-backgrounds"),X=["complex","complicated","chaotic","clear"];for(const l of X){const r=F[l];mt.append("rect").attr("class","cynefinDomain").attr("x",r.x).attr("y",r.y).attr("width",r.w).attr("height",r.h).attr("fill",z[l]).attr("fill-opacity",.4).attr("stroke","none")}const j=A.append("g").attr("class","cynefin-boundaries");j.append("path").attr("class","cynefinBoundary").attr("d",ct(i,f,Z,R)).attr("fill","none"),j.append("path").attr("class","cynefinBoundary").attr("d",lt(i,f,Z+100,R)).attr("fill","none"),j.append("path").attr("class","cynefinCliff").attr("d",dt(i,f)).attr("fill","none");const pt=i*.15,yt=f*.15;A.append("path").attr("class","cynefinConfusion").attr("d",ft(i/2,f/2,pt,yt)).attr("fill",z.confusion).attr("fill-opacity",.5);const J=A.append("g").attr("class","cynefin-labels");for(const l of X){const r=F[l];J.append("text").attr("class","cynefinDomainLabel").attr("x",r.cx).attr("y",h?r.cy-30:r.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(l.charAt(0).toUpperCase()+l.slice(1))}if(J.append("text").attr("class","cynefinDomainLabel").attr("x",i/2).attr("y",h?f/2-10:f/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Confusion"),h){const l=A.append("g").attr("class","cynefin-subtitles");for(const r of X){const u=F[r],y=at[r];l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.model),l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.practice)}l.append("text").attr("class","cynefinSubtitle").attr("x",i/2).attr("y",f/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(at.confusion.practice)}const K=A.append("g").attr("class","cynefin-items"),T=26,tt=10,ut=["complex","complicated","chaotic","clear","confusion"];for(const l of ut){const r=m.get(l);if(!r||r.items.length===0)continue;const u=F[l],y=l==="confusion";let L=r.items,N=0;y&&r.items.length>q&&(N=r.items.length-q,L=r.items.slice(0,q));let B;if(y){const g=h?22:14;B=u.cy+g}else B=u.cy+(h?25:15);if([...L].forEach((g,S)=>{const w=B+S*(T+4),M=K.append("g"),P=M.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",T/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(g.label);let $=g.label.length*7;const x=P.node();if(x&&typeof x.getBBox=="function"){const G=x.getBBox();G.width>0&&($=G.width)}const C=$+tt*2,I=u.cx-C/2;M.attr("transform",`translate(${I}, ${w})`),M.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",C).attr("height",T).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.95),P.attr("x",C/2).attr("y",T/2)}),N>0){const g=B+L.length*(T+4),S=`+${N} more`,w=K.append("g"),M=w.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",T/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(S);let P=S.length*7;const $=M.node();if($&&typeof $.getBBox=="function"){const I=$.getBBox();I.width>0&&(P=I.width)}const x=P+tt*2,C=u.cx-x/2;w.attr("transform",`translate(${C}, ${g})`),w.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",x).attr("height",T).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.6),M.attr("x",x/2).attr("y",T/2)}}if(v.length>0){const l=k.select("defs").empty()?k.append("defs"):k.select("defs"),r=`cynefin-arrow-${e}`;l.append("marker").attr("id",r).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","cynefinArrowHead");const u=A.append("g").attr("class","cynefin-arrows");v.forEach(y=>{const L=F[y.from],N=F[y.to];if(!L||!N)return;if(y.from===y.to){O.warn(`Cynefin renderer: skipping self-loop on domain "${y.from}"`);return}const B=L.cx,g=L.cy,S=N.cx,w=N.cy,M=(B+S)/2,P=(g+w)/2,$=S-B,x=w-g,C=Math.sqrt($*$+x*x),I=C*.15,G=-x/C,ht=$/C,et=M+G*I,nt=P+ht*I;u.append("path").attr("class","cynefinArrowLine").attr("d",`M${B},${g} Q${et},${nt} ${S},${w}`).attr("fill","none").attr("marker-end",`url(#${r})`),y.label&&u.append("text").attr("class","cynefinArrowLabel").attr("x",et).attr("y",nt-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(y.label)})}W&&A.append("text").attr("class","cynefinTitle").attr("x",i/2).attr("y",-b/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(W)},"draw"),Ft={draw:Et},Vt=s(()=>{const t=ot(),e=Q();return U(t,e.themeVariables).cynefin},"getCynefinTheme"),Ht=s(()=>{const t=Vt();return` .cynefinDomain { stroke: none; } diff --git a/apps/kimi-code/dist-web/assets/dagre-VKFMJZFB-BDxu-EPk.js b/apps/kimi-code/dist-web/assets/dagre-VKFMJZFB-G1--45o_.js similarity index 97% rename from apps/kimi-code/dist-web/assets/dagre-VKFMJZFB-BDxu-EPk.js rename to apps/kimi-code/dist-web/assets/dagre-VKFMJZFB-G1--45o_.js index 61cf831267..65e6290cd4 100644 --- a/apps/kimi-code/dist-web/assets/dagre-VKFMJZFB-BDxu-EPk.js +++ b/apps/kimi-code/dist-web/assets/dagre-VKFMJZFB-G1--45o_.js @@ -1,4 +1,4 @@ -import{c as O,w as I,a as J,f as P,b as E,s as A}from"./chunk-RYQCIY6F-DRHEFBXE.js";import{_ as w,am as v,an as D,ao as H,ap as Y,l,c as _,aq as W,ar as $,ag as j,as as q,ah as R,af as F,at as z,au as K,av as G}from"./mermaid.core-CqiFQExc.js";import{G as Q}from"./graph-DOmOIIwC.js";import{l as U}from"./layout-D-LzfAck.js";import"./map-DxJ2ADlA.js";import"./index--0t1wzw_.js";import"./_commonjsHelpers-CqkleIqs.js";var C=w((s,t,g)=>Math.max(t,Math.min(g,s)),"clamp"),B=w((s="TB")=>{switch(s){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),V=w(s=>s==="flowchart"||s==="flowchart-v2"||s==="stateDiagram","shouldMergeSelfLoopSegments"),Z=w((s,t,g,m,c)=>{const o=[],r=new Set;if(g.forEach(({start:i,end:n})=>{i!==m&&r.add(i),n!==m&&r.add(n)}),r.forEach(i=>{const n=s.node(i);typeof n?.x=="number"&&typeof n?.y=="number"&&o.push(n)}),o.length===0&&g.forEach(({edge:i})=>{(i.points??[]).forEach(n=>{typeof n?.x=="number"&&typeof n?.y=="number"&&o.push(n)})}),o.length===0)return B(c);const f=o.reduce((i,n)=>({x:i.x+n.x/o.length,y:i.y+n.y/o.length}),{x:0,y:0}),h=f.x-t.x,a=f.y-t.y;return Math.abs(h)>Math.abs(a)?h>0?"right":"left":Math.abs(a)>0?a>0?"bottom":"top":B(c)},"getSelfLoopSide"),ee=w((s,t="top",g=0,m=0)=>{const c=s.x,o=s.y-g,r=s.width/2,f=s.height/2,h=Math.max(36,Math.min(100,s.width*.8)),a=C(Math.max(m,s.width*.35),36,h),i=C(Math.min(s.width,s.height)*.45,24,48);switch(t){case"bottom":{const n=o+f;return[{x:c-a/2,y:n},{x:c-a/2,y:n+i},{x:c+a/2,y:n+i},{x:c+a/2,y:n}]}case"right":{const n=c+r;return[{x:n,y:o-a/2},{x:n+i,y:o-a/2},{x:n+i,y:o+a/2},{x:n,y:o+a/2}]}case"left":{const n=c-r;return[{x:n,y:o-a/2},{x:n-i,y:o-a/2},{x:n-i,y:o+a/2},{x:n,y:o+a/2}]}case"top":default:{const n=o-f;return[{x:c-a/2,y:n},{x:c-a/2,y:n-i},{x:c+a/2,y:n-i},{x:c+a/2,y:n}]}}},"getSelfLoopPoints"),te=w((s,t,g="top",m=0,c={})=>{const r=s.x,f=s.y-m,h=c.width??0,a=c.height??0;switch(g){case"bottom":return{x:r,y:Math.max(...t.map(i=>i.y))+a/2+4};case"right":return{x:Math.max(...t.map(i=>i.x))+h/2+4,y:f};case"left":return{x:Math.min(...t.map(i=>i.x))-h/2-4,y:f};case"top":default:return{x:r,y:Math.min(...t.map(i=>i.y))-a/2-4}}},"getSelfLoopLabelPosition"),ne=w((s,t=0,{mergeSelfLoops:g=!0}={})=>{const m=new Map,c=[],o=s.graph()?.rankdir;return s.edges().forEach(r=>{const f=s.edge(r);if(g&&f.selfLoop){const h=f.selfLoop.id;m.has(h)||m.set(h,[]),m.get(h).push({edge:f,start:r.v,end:r.w})}else c.push({edge:f,start:r.v,end:r.w})}),m.forEach(r=>{if(r.length!==3){r.forEach(L=>c.push(L));return}r.sort((L,d)=>L.edge.selfLoop.order-d.edge.selfLoop.order);const[f,h,a]=r,i=f.edge.originalEdge??h.edge.originalEdge??a.edge.originalEdge??h.edge,n=s.node(i.start);if(!n){r.forEach(L=>c.push(L));return}const p={width:h.edge.width,height:h.edge.height},y=Z(s,n,r,i.start,o),X=ee(n,y,t,p.width??0),S=te(n,X,y,t,p),b={...h.edge,...i,id:i.id,points:X,start:i.start,end:i.end,x:S.x,y:S.y,width:p.width,height:p.height,labelStyle:h.edge.labelStyle,fromCluster:f.edge.fromCluster??h.edge.fromCluster??a.edge.fromCluster,toCluster:f.edge.toCluster??h.edge.toCluster??a.edge.toCluster};delete b.selfLoop,delete b.originalEdge,c.push({edge:b,start:b.start,end:b.end})}),c},"getEdgesToRender"),T=w(async(s,t,g,m,c,o)=>{l.warn("Graph in recursive render:XAX",I(t),c);const r=t.graph().rankdir;l.trace("Dir in recursive render - dir:",r);const f=s.insert("g").attr("class","root");t.nodes()?l.info("Recursive render XXX",t.nodes()):l.info("No nodes found for",t),t.edges().length>0&&l.info("Recursive edges",t.edge(t.edges()[0]));const h=f.insert("g").attr("class","clusters"),a=f.insert("g").attr("class","edgePaths"),i=f.insert("g").attr("class","edgeLabels"),n=f.insert("g").attr("class","nodes"),p=V(g);await Promise.all(t.nodes().map(async function(d){const e=t.node(d);if(c!==void 0){const u=JSON.parse(JSON.stringify(c.clusterData));l.trace(`Setting data for parent cluster XXX +import{c as O,w as I,a as J,f as P,b as E,s as A}from"./chunk-RYQCIY6F-LhAgalr3.js";import{_ as w,am as v,an as D,ao as H,ap as Y,l,c as _,aq as W,ar as $,ag as j,as as q,ah as R,af as F,at as z,au as K,av as G}from"./mermaid.core-WW7RuneT.js";import{G as Q}from"./graph-DOmOIIwC.js";import{l as U}from"./layout-D-LzfAck.js";import"./map-DxJ2ADlA.js";import"./index-CiHMlsuo.js";import"./_commonjsHelpers-CqkleIqs.js";var C=w((s,t,g)=>Math.max(t,Math.min(g,s)),"clamp"),B=w((s="TB")=>{switch(s){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),V=w(s=>s==="flowchart"||s==="flowchart-v2"||s==="stateDiagram","shouldMergeSelfLoopSegments"),Z=w((s,t,g,m,c)=>{const o=[],r=new Set;if(g.forEach(({start:i,end:n})=>{i!==m&&r.add(i),n!==m&&r.add(n)}),r.forEach(i=>{const n=s.node(i);typeof n?.x=="number"&&typeof n?.y=="number"&&o.push(n)}),o.length===0&&g.forEach(({edge:i})=>{(i.points??[]).forEach(n=>{typeof n?.x=="number"&&typeof n?.y=="number"&&o.push(n)})}),o.length===0)return B(c);const f=o.reduce((i,n)=>({x:i.x+n.x/o.length,y:i.y+n.y/o.length}),{x:0,y:0}),h=f.x-t.x,a=f.y-t.y;return Math.abs(h)>Math.abs(a)?h>0?"right":"left":Math.abs(a)>0?a>0?"bottom":"top":B(c)},"getSelfLoopSide"),ee=w((s,t="top",g=0,m=0)=>{const c=s.x,o=s.y-g,r=s.width/2,f=s.height/2,h=Math.max(36,Math.min(100,s.width*.8)),a=C(Math.max(m,s.width*.35),36,h),i=C(Math.min(s.width,s.height)*.45,24,48);switch(t){case"bottom":{const n=o+f;return[{x:c-a/2,y:n},{x:c-a/2,y:n+i},{x:c+a/2,y:n+i},{x:c+a/2,y:n}]}case"right":{const n=c+r;return[{x:n,y:o-a/2},{x:n+i,y:o-a/2},{x:n+i,y:o+a/2},{x:n,y:o+a/2}]}case"left":{const n=c-r;return[{x:n,y:o-a/2},{x:n-i,y:o-a/2},{x:n-i,y:o+a/2},{x:n,y:o+a/2}]}case"top":default:{const n=o-f;return[{x:c-a/2,y:n},{x:c-a/2,y:n-i},{x:c+a/2,y:n-i},{x:c+a/2,y:n}]}}},"getSelfLoopPoints"),te=w((s,t,g="top",m=0,c={})=>{const r=s.x,f=s.y-m,h=c.width??0,a=c.height??0;switch(g){case"bottom":return{x:r,y:Math.max(...t.map(i=>i.y))+a/2+4};case"right":return{x:Math.max(...t.map(i=>i.x))+h/2+4,y:f};case"left":return{x:Math.min(...t.map(i=>i.x))-h/2-4,y:f};case"top":default:return{x:r,y:Math.min(...t.map(i=>i.y))-a/2-4}}},"getSelfLoopLabelPosition"),ne=w((s,t=0,{mergeSelfLoops:g=!0}={})=>{const m=new Map,c=[],o=s.graph()?.rankdir;return s.edges().forEach(r=>{const f=s.edge(r);if(g&&f.selfLoop){const h=f.selfLoop.id;m.has(h)||m.set(h,[]),m.get(h).push({edge:f,start:r.v,end:r.w})}else c.push({edge:f,start:r.v,end:r.w})}),m.forEach(r=>{if(r.length!==3){r.forEach(L=>c.push(L));return}r.sort((L,d)=>L.edge.selfLoop.order-d.edge.selfLoop.order);const[f,h,a]=r,i=f.edge.originalEdge??h.edge.originalEdge??a.edge.originalEdge??h.edge,n=s.node(i.start);if(!n){r.forEach(L=>c.push(L));return}const p={width:h.edge.width,height:h.edge.height},y=Z(s,n,r,i.start,o),X=ee(n,y,t,p.width??0),S=te(n,X,y,t,p),b={...h.edge,...i,id:i.id,points:X,start:i.start,end:i.end,x:S.x,y:S.y,width:p.width,height:p.height,labelStyle:h.edge.labelStyle,fromCluster:f.edge.fromCluster??h.edge.fromCluster??a.edge.fromCluster,toCluster:f.edge.toCluster??h.edge.toCluster??a.edge.toCluster};delete b.selfLoop,delete b.originalEdge,c.push({edge:b,start:b.start,end:b.end})}),c},"getEdgesToRender"),T=w(async(s,t,g,m,c,o)=>{l.warn("Graph in recursive render:XAX",I(t),c);const r=t.graph().rankdir;l.trace("Dir in recursive render - dir:",r);const f=s.insert("g").attr("class","root");t.nodes()?l.info("Recursive render XXX",t.nodes()):l.info("No nodes found for",t),t.edges().length>0&&l.info("Recursive edges",t.edge(t.edges()[0]));const h=f.insert("g").attr("class","clusters"),a=f.insert("g").attr("class","edgePaths"),i=f.insert("g").attr("class","edgeLabels"),n=f.insert("g").attr("class","nodes"),p=V(g);await Promise.all(t.nodes().map(async function(d){const e=t.node(d);if(c!==void 0){const u=JSON.parse(JSON.stringify(c.clusterData));l.trace(`Setting data for parent cluster XXX Node.id = `,d,` data=`,u.height,` Parent cluster`,c.height),t.setNode(c.id,u),t.parent(d)||(l.trace("Setting parent",d,c.id),t.setParent(d,c.id,u))}if(l.info("(Insert) Node XXX"+d+": "+JSON.stringify(t.node(d))),e?.clusterNode){l.info("Cluster identified XBX",d,e.width,t.node(d));const{ranksep:u,nodesep:x}=t.graph();e.graph.setGraph({...e.graph.graph(),ranksep:u+25,nodesep:x});const N=await T(n,e.graph,g,m,t.node(d),o),M=N.elem;W(e,M),e.diff=N.diff||0,l.info("New compound node after recursive render XAX",d,"width",e.width,"height",e.height),$(M,e)}else t.children(d).length>0?(l.trace("Cluster - the non recursive path XBX",d,e.id,e,e.width,"Graph:",t),l.trace(P(e.id,t)),E.set(e.id,{id:P(e.id,t),node:e})):(l.trace("Node - the non recursive path XAX",d,n,t.node(d),r),await j(n,t.node(d),{config:o,dir:r}))})),await w(async()=>{const d=t.edges().map(async function(e){const u=t.edge(e.v,e.w,e.name);if(l.info("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(e)),l.info("Edge "+e.v+" -> "+e.w+": ",e," ",JSON.stringify(t.edge(e))),l.info("Fix",E,"ids:",e.v,e.w,"Translating: ",E.get(e.v),E.get(e.w)),p&&u.selfLoop){if(u.selfLoop.order!==1)return;const x=u.id;u.id=u.selfLoop.id,await G(i,u),u.id=x;return}await G(i,u)});await Promise.all(d)},"processEdges")(),l.info("Graph before layout:",JSON.stringify(I(t))),l.info("############################################# XXX"),l.info("### Layout ### XXX"),l.info("############################################# XXX"),U(t),l.info("Graph after layout:",JSON.stringify(I(t)));let X=0,{subGraphTitleTotalMargin:S}=q(o);await Promise.all(A(t).map(async function(d){const e=t.node(d);if(l.info("Position XBX => "+d+": ("+e.x,","+e.y,") width: ",e.width," height: ",e.height),e?.clusterNode)e.y+=S,l.info("A tainted cluster node XBX1",d,e.id,e.width,e.height,e.x,e.y,t.parent(d)),E.get(e.id).node=e,R(e);else if(t.children(d).length>0){l.info("A pure cluster node XBX1",d,e.id,e.x,e.y,e.width,e.height,t.parent(d)),e.height+=S,t.node(e.parentId);const u=e?.padding/2||0,x=e?.labelBBox?.height||0,N=x-u||0;l.debug("OffsetY",N,"labelHeight",x,"halfPadding",u),await F(h,e),E.get(e.id).node=e}else{const u=t.node(e.parentId);e.y+=S/2,l.info("A regular node XBX1 - using the padding",e.id,"parent",e.parentId,e.width,e.height,e.x,e.y,"offsetY",e.offsetY,"parent",u,u?.offsetY,e),R(e)}}));const b=S/2;return ne(t,b,{mergeSelfLoops:p}).forEach(function({edge:d,start:e,end:u}){l.info("Edge "+e+" -> "+u+": "+JSON.stringify(d),d),d.points.forEach(k=>k.y+=b);const x=t.node(e),N=t.node(u),M=z(a,d,E,g,x,N,m);K(d,M)}),t.nodes().forEach(function(d){const e=t.node(d);l.info(d,e.type,e.diff),e.isGroup&&(X=e.diff)}),l.warn("Returning from recursive render XAX",f,X),{elem:f,diff:X}},"recursiveRender"),le=w(async(s,t)=>{const g=new Q({multigraph:!0,compound:!0}).setGraph({rankdir:s.direction,nodesep:s.config?.nodeSpacing||s.config?.flowchart?.nodeSpacing||s.nodeSpacing,ranksep:s.config?.rankSpacing||s.config?.flowchart?.rankSpacing||s.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),m=t.select("g");v(m,s.markers,s.type,s.diagramId),D(),H(),Y(),O(),s.nodes.forEach(o=>{g.setNode(o.id,{...o}),o.parentId&&g.setParent(o.id,o.parentId)}),l.debug("Edges:",s.edges),s.edges.forEach(o=>{if(o.start===o.end){const r=o.start,f=r+"---"+r+"---1",h=r+"---"+r+"---2",a=g.node(r);g.setNode(f,{domId:f,id:f,parentId:a.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),g.setParent(f,a.parentId),g.setNode(h,{domId:h,id:h,parentId:a.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),g.setParent(h,a.parentId);const i=structuredClone(o),n=structuredClone(o),p=structuredClone(o),y=structuredClone(o);n.originalEdge=i,n.selfLoop={id:i.id,order:0},p.originalEdge=i,p.selfLoop={id:i.id,order:1},y.originalEdge=i,y.selfLoop={id:i.id,order:2},n.label="",n.arrowTypeEnd="none",n.endLabelLeft="",n.endLabelRight="",n.startLabelLeft="",n.id=r+"-cyclic-special-1",p.startLabelRight="",p.startLabelLeft="",p.endLabelLeft="",p.endLabelRight="",p.arrowTypeStart="none",p.arrowTypeEnd="none",p.id=r+"-cyclic-special-mid",y.label="",y.startLabelRight="",y.startLabelLeft="",y.arrowTypeStart="none",a.isGroup&&(n.fromCluster=r,y.toCluster=r),y.id=r+"-cyclic-special-2",y.arrowTypeStart="none",g.setEdge(r,f,n,r+"-cyclic-special-0"),g.setEdge(f,h,p,r+"-cyclic-special-1"),g.setEdge(h,r,y,r+"-cyclic-special-2")}else g.setEdge(o.start,o.end,{...o},o.id)}),l.warn("Graph at first:",JSON.stringify(I(g))),J(g),l.warn("Graph after XAX:",JSON.stringify(I(g)));const c=_();await T(m,g,s.type,s.diagramId,void 0,c)},"render");export{ne as getEdgesToRender,le as render}; diff --git a/apps/kimi-code/dist-web/assets/diagram-FQU43EPY-D5Cw9BLp.js b/apps/kimi-code/dist-web/assets/diagram-FQU43EPY-DlPR1W9u.js similarity index 98% rename from apps/kimi-code/dist-web/assets/diagram-FQU43EPY-D5Cw9BLp.js rename to apps/kimi-code/dist-web/assets/diagram-FQU43EPY-DlPR1W9u.js index bbf8554bad..f51ffcc932 100644 --- a/apps/kimi-code/dist-web/assets/diagram-FQU43EPY-D5Cw9BLp.js +++ b/apps/kimi-code/dist-web/assets/diagram-FQU43EPY-DlPR1W9u.js @@ -1,3 +1,3 @@ -import{p as re}from"./chunk-JWPE2WC7-C7S97jLg.js";import{o as oe,n as se,s as de,g as le,a as ce,b as me,_ as o,l as g,c as T,d as ue,z as xe,p as fe,A as ge,y as M,B as he,i as y,w as P,ak as pe}from"./mermaid.core-CqiFQExc.js";import{p as be,i as ve}from"./cynefin-VYW2F7L2-DEnbetzx.js";import"./index--0t1wzw_.js";import"./_commonjsHelpers-CqkleIqs.js";var $="position frame",D="frame positioned",S="position relation",N="relation positioned",we=o(function(e){g.debug("options str",e)},"setOptions"),ye=o(function(){return{}},"getOptions"),Pe=o(function(){C(),fe()},"clear");function C(){B={}}o(C,"reset");var Se=he.eventmodeling,ke=o(()=>ge({...Se,...M().eventmodeling}),"getConfig"),B={};function O(){let e=Fe;const{ast:n}=B,t=E();if(!n)throw new Error("No data for EventModel");return n.frames.forEach((i,a)=>{const r=G(i,n.dataEntities,t);e=v(e,{$kind:$,index:a,frame:i,textProps:r});let d;K(i)?(g.debug("source frame",i.sourceFrames),d=n.frames.filter(l=>i.sourceFrames.some(c=>c.$refText===l.name)),d.forEach(l=>{e=v(e,{$kind:S,index:a,frame:i,sourceFrame:l})})):e=v(e,{$kind:S,index:a,frame:i})}),e={...e,sortedSwimlanesArray:A(e.swimlanes)},e}o(O,"getState");function I(e){B.ast=e}o(I,"setAst");var s={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function E(){return s}o(E,"getDiagramProps");var Fe={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function W(e){const n=e.split(".");if(n.length===2)return n[0]}o(W,"extractNamespace");function H(e){const n=e.split(".");return n.length===2?n[1]:e}o(H,"extractName");function U(e,n){if(!(!n||n.length===0))return Object.values(e).find(t=>t.namespace===n)}o(U,"findSwimlaneByNamespace");function b(e,n,t){return Math.max(n,...Object.keys(e).filter(i=>{const a=Number.parseInt(i);return a>n&&aNumber.parseInt(i)))+1}o(b,"findNextAvailableIndex");function _(e,n){const t=W(e.entityIdentifier),i=U(n,t);switch(e.modelEntityType){case"ui":case"pcr":case"processor":return i?{index:i.index,label:i.namespace||s.labelUiAutomation}:t?{index:b(n,0,100),label:s.labelUiAutomationPrefix+t}:{index:0,label:s.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return i?{index:i.index,label:i.namespace||s.labelCommandReadModel}:t?{index:b(n,100,200),label:s.labelCommandReadModelPrefix+t}:{index:100,label:s.labelCommandReadModel};case"evt":case"event":default:return i?{index:i.index,label:i.namespace||s.labelEvents}:t?{index:b(n,200,300),label:s.labelEventsPrefix+t}:{index:200,label:s.labelEvents}}}o(_,"calculateSwimlaneProps");function L(e){const{themeVariables:n}=M();switch(e.modelEntityType){case"ui":return{fill:n.emUiFill??"white",stroke:n.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:n.emProcessorFill??"#edb3f6",stroke:n.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:n.emReadModelFill??"#d3f1a2",stroke:n.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:n.emCommandFill??"#bcd6fe",stroke:n.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:n.emEventFill??"#ffb778",stroke:n.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}o(L,"calculateEntityVisualProps");function G(e,n,t){const i=M(),a=y(H(e.entityIdentifier)??"",i);let r;const d={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"
"};let c=`${P(a,t.textMaxWidth,d)}`;if(e.dataInlineValue&&(r=e.dataInlineValue,r=r.substring(r.indexOf("{")+1),r=r.substring(0,r.lastIndexOf("}")-1),r=y(r,i),r=P(r,t.textMaxWidth,d),r=r.replaceAll(" "," ")),e.dataReference){const p=n.find(w=>w.name===e.dataReference?.$refText);p&&(r=p.dataBlockValue,r=r.substring(r.indexOf(`{ +import{p as re}from"./chunk-JWPE2WC7-BJMJfnyy.js";import{o as oe,n as se,s as de,g as le,a as ce,b as me,_ as o,l as g,c as T,d as ue,z as xe,p as fe,A as ge,y as M,B as he,i as y,w as P,ak as pe}from"./mermaid.core-WW7RuneT.js";import{p as be,i as ve}from"./cynefin-VYW2F7L2-DI-9Z5R0.js";import"./index-CiHMlsuo.js";import"./_commonjsHelpers-CqkleIqs.js";var $="position frame",D="frame positioned",S="position relation",N="relation positioned",we=o(function(e){g.debug("options str",e)},"setOptions"),ye=o(function(){return{}},"getOptions"),Pe=o(function(){C(),fe()},"clear");function C(){B={}}o(C,"reset");var Se=he.eventmodeling,ke=o(()=>ge({...Se,...M().eventmodeling}),"getConfig"),B={};function O(){let e=Fe;const{ast:n}=B,t=E();if(!n)throw new Error("No data for EventModel");return n.frames.forEach((i,a)=>{const r=G(i,n.dataEntities,t);e=v(e,{$kind:$,index:a,frame:i,textProps:r});let d;K(i)?(g.debug("source frame",i.sourceFrames),d=n.frames.filter(l=>i.sourceFrames.some(c=>c.$refText===l.name)),d.forEach(l=>{e=v(e,{$kind:S,index:a,frame:i,sourceFrame:l})})):e=v(e,{$kind:S,index:a,frame:i})}),e={...e,sortedSwimlanesArray:A(e.swimlanes)},e}o(O,"getState");function I(e){B.ast=e}o(I,"setAst");var s={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function E(){return s}o(E,"getDiagramProps");var Fe={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function W(e){const n=e.split(".");if(n.length===2)return n[0]}o(W,"extractNamespace");function H(e){const n=e.split(".");return n.length===2?n[1]:e}o(H,"extractName");function U(e,n){if(!(!n||n.length===0))return Object.values(e).find(t=>t.namespace===n)}o(U,"findSwimlaneByNamespace");function b(e,n,t){return Math.max(n,...Object.keys(e).filter(i=>{const a=Number.parseInt(i);return a>n&&aNumber.parseInt(i)))+1}o(b,"findNextAvailableIndex");function _(e,n){const t=W(e.entityIdentifier),i=U(n,t);switch(e.modelEntityType){case"ui":case"pcr":case"processor":return i?{index:i.index,label:i.namespace||s.labelUiAutomation}:t?{index:b(n,0,100),label:s.labelUiAutomationPrefix+t}:{index:0,label:s.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return i?{index:i.index,label:i.namespace||s.labelCommandReadModel}:t?{index:b(n,100,200),label:s.labelCommandReadModelPrefix+t}:{index:100,label:s.labelCommandReadModel};case"evt":case"event":default:return i?{index:i.index,label:i.namespace||s.labelEvents}:t?{index:b(n,200,300),label:s.labelEventsPrefix+t}:{index:200,label:s.labelEvents}}}o(_,"calculateSwimlaneProps");function L(e){const{themeVariables:n}=M();switch(e.modelEntityType){case"ui":return{fill:n.emUiFill??"white",stroke:n.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:n.emProcessorFill??"#edb3f6",stroke:n.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:n.emReadModelFill??"#d3f1a2",stroke:n.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:n.emCommandFill??"#bcd6fe",stroke:n.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:n.emEventFill??"#ffb778",stroke:n.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}o(L,"calculateEntityVisualProps");function G(e,n,t){const i=M(),a=y(H(e.entityIdentifier)??"",i);let r;const d={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"
"};let c=`${P(a,t.textMaxWidth,d)}`;if(e.dataInlineValue&&(r=e.dataInlineValue,r=r.substring(r.indexOf("{")+1),r=r.substring(0,r.lastIndexOf("}")-1),r=y(r,i),r=P(r,t.textMaxWidth,d),r=r.replaceAll(" "," ")),e.dataReference){const p=n.find(w=>w.name===e.dataReference?.$refText);p&&(r=p.dataBlockValue,r=r.substring(r.indexOf(`{ `)+2),r=r.substring(0,r.lastIndexOf("}")-1),r=y(r,i),r=P(r,t.textMaxWidth,d),r=r.replaceAll(" "," "),r+="
")}const m=r!==void 0;m&&(c+=`

${r}`);const x={fontSize:d.fontSize,fontWeight:d.fontWeight,fontFamily:d.fontFamily},u=pe(c,x),h=m?u.width/3:u.width,f={content:c,width:h,height:u.height};return g.debug(`[${e.name}] ${e.entityIdentifier} text`,f),f}o(G,"calculateTextProps");function V(e,n){const t=n,i=L(t.frame),a={width:t.textProps.width+2*s.boxTextPadding,height:t.textProps.height+2*s.boxTextPadding};return[{$kind:D,frame:t.frame,index:t.index,visual:i,dimension:a,textProps:t.textProps}]}o(V,"decidePositionFrame");function X(e,n,t){return n===void 0?s.contentStartX:n.index===e.index&&e.r?e.r+s.boxPadding:t===void 0?s.contentStartX:t.r-s.boxOverlap+s.boxPadding}o(X,"calculateX");function j(e,n){const t=[...e.map(i=>i.r),n];return Math.max(...t)}o(j,"calculateMaxRight");function A(e){return Object.values(e).sort((n,t)=>n.index-t.index)}o(A,"sortedSwimlanesArray");function Y(e,n){const t=n,i=_(t.frame,e.swimlanes);let a;i.index in e.swimlanes?a=e.swimlanes[i.index]:a={index:i.index,label:i.label,r:0,y:i.index*s.swimlaneMinHeight+s.swimlaneGap,height:s.swimlaneMinHeight,maxHeight:s.swimlaneMinHeight};const r=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,d=e.previousSwimlaneNumber!==void 0?e.swimlanes[e.previousSwimlaneNumber]:void 0,l={width:Math.max(s.boxMinWidth,Math.min(s.boxMaxWidth,t.dimension.width))+2*s.boxPadding,height:Math.max(s.boxMinHeight,Math.min(s.boxMaxHeight,t.dimension.height))+2*s.boxPadding},c=X(a,d,r),m=c+l.width+s.boxPadding,x=j(Object.values(e.swimlanes),m);a.r=c+l.width,a.maxHeight=Math.max(a.maxHeight,l.height),a.height=Math.max(s.swimlaneMinHeight,a.maxHeight)+2*s.swimlanePadding;const u={x:c,y:s.swimlanePadding+a.y,r:m,dimension:l,leftSibling:!1,swimlane:a,visual:t.visual,text:t.textProps.content,frame:t.frame,index:t.index},h={...e,boxes:[...e.boxes,u],swimlanes:{...e.swimlanes,[`${a.index}`]:a},previousSwimlaneNumber:i.index,previousFrame:t.frame,maxR:x},f=A(h.swimlanes);f.length>0&&(f[0].y=0);for(let p=1;p0}o(K,"hasSourceFrame");function k(e,n){if(n!=null)return e.find(t=>t.frame.name===n.name)}o(k,"findBoxByFrame");function q(e,n,t){if(!(t<0))for(let i=t;i>=0;i--){const a=e[i];if(a.swimlane.index!==n)return a}}o(q,"findBoxByLineIndex");function J(e,n){const t=n;if(ve(t.frame)||z(t.index,t.frame))return[];const i=k(e.boxes,t.frame);if(i===void 0)throw new Error(`Target box not found for frame ${t.frame.name}`);let a;return t.sourceFrame?a=k(e.boxes,t.sourceFrame):a=q(e.boxes,i.swimlane.index,t.index-1),a===void 0?[]:[{$kind:N,frame:t.frame,index:t.index,sourceBox:a,targetBox:i}]}o(J,"decidePositionRelation");function Q(e,n){const t=n,i={visual:{fill:"none",stroke:"#000"},source:{x:t.sourceBox.x,y:t.sourceBox.y},target:{x:t.targetBox.x,y:t.targetBox.y},sourceBox:t.sourceBox,targetBox:t.targetBox};return{...e,relations:[...e.relations,i]}}o(Q,"evolveRelationPositioned");var Me={[$]:V,[S]:J},Be={[D]:Y,[N]:Q};function Z(e,n){const t=Me[n.$kind];if(t==null)return[];const i=t(e,n);return g.debug("decided events",i),i}o(Z,"decide");function ee(e,n){const t=n.reduce((i,a)=>{const r=Be[a.$kind];return r==null?i:r(i,a)},e);return g.debug("evolve events",{state:e,newState:t,events:n}),t}o(ee,"evolve");function v(e,n){const t=Z(e,n);return ee(e,t)}o(v,"dispatch");var F={getConfig:ke,setOptions:we,getOptions:ye,clear:Pe,setAccTitle:me,getAccTitle:ce,getAccDescription:le,setAccDescription:de,setDiagramTitle:se,getDiagramTitle:oe,setAst:I,getDiagramProps:E,getState:O},Ee={parse:o(async e=>{const n=await be("eventmodeling",e);g.debug(n),F.setAst(n),re(n,F)},"parse")},Ae=T(),Re=Ae?.eventmodeling;function te(e,n){return t=>{const i=t.swimlane.y+n.swimlanePadding,a=e.append("g").attr("class","em-box");a.append("rect").attr("x",t.x).attr("y",i).attr("rx","3").attr("width",t.dimension.width).attr("height",t.dimension.height).attr("stroke",t.visual.stroke).attr("fill",t.visual.fill),a.append("foreignObject").attr("x",t.x+n.boxPadding).attr("y",i+10).attr("width",t.dimension.width-2*n.boxPadding).attr("height",t.dimension.height-2*n.boxPadding).append("xhtml:div").style("display","table").style("height","100%").style("width","100%").append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(t.text)}}o(te,"renderD3Box");function ne(e,n){return e>n}o(ne,"dirUpwards");function ie(e,n,t,i){return a=>{const r=a.sourceBox.swimlane.y+n.swimlanePadding,d=a.targetBox.swimlane.y+n.swimlanePadding,l=ne(r,d),c=a.sourceBox.x+a.sourceBox.dimension.width*2/3,m=a.targetBox.x+a.targetBox.dimension.width/3;let x,u;g.debug(`rendering relation up=${l} for `,{sourceBox:a.sourceBox,targetBox:a.targetBox}),l?(x=r,u=d+a.targetBox.dimension.height):(x=r+a.sourceBox.dimension.height,u=d);const h=i.emRelationStroke??a.visual.stroke;e.append("path").attr("class","em-relation").attr("fill",a.visual.fill).attr("stroke",h).attr("stroke-width","1").attr("marker-end",`url(#${t})`).attr("d",`M${c} ${x} L${m} ${u}`)}}o(ie,"renderD3Relation");function ae(e,n,t,i){return a=>{const r=e.append("g").attr("class","em-swimlane"),d=i.emSwimlaneBackgroundOdd??"rgb(250,250,250)",l=i.emSwimlaneBackgroundStroke??"rgb(240,240,240)";r.append("rect").attr("x",0).attr("y",a.y).attr("rx","3").attr("width",n+t.swimlanePadding).attr("height",a.height).attr("fill",d).attr("stroke",l),r.append("text").attr("font-weight",t.swimlaneTextFontWeight).attr("x",30).attr("y",a.y+30).text(a.label)}}o(ae,"renderD3Swimlane");var Te=o(function(e,n,t,i){if(g.debug("in eventmodeling renderer",e+` `,"id:",n,t),!Re)throw new Error("EventModeling config not found");const a=i.db,{themeVariables:r,eventmodeling:d}=T(),l=ue(`[id="${n}"]`),c=a.getDiagramProps(),m=a.getState(),x=`em-arrowhead-${n}`,u=r.emArrowhead??"#000000";m.sortedSwimlanesArray.forEach(ae(l,m.maxR,c,r)),m.boxes.forEach(te(l,c)),m.relations.forEach(ie(l,c,x,r)),l.append("defs").append("marker").attr("id",x).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",u),xe(void 0,l,d?.padding??30,d?.useMaxWidth)},"draw"),$e={draw:Te},De=o(e=>"","getStyles"),Ne=De,Ue={parser:Ee,db:F,renderer:$e,styles:Ne};export{Ue as diagram}; diff --git a/apps/kimi-code/dist-web/assets/diagram-G47NLZAW-CgstEr0d.js b/apps/kimi-code/dist-web/assets/diagram-G47NLZAW-Bj3iAwJq.js similarity index 97% rename from apps/kimi-code/dist-web/assets/diagram-G47NLZAW-CgstEr0d.js rename to apps/kimi-code/dist-web/assets/diagram-G47NLZAW-Bj3iAwJq.js index f8334b11f3..cb6e45620c 100644 --- a/apps/kimi-code/dist-web/assets/diagram-G47NLZAW-CgstEr0d.js +++ b/apps/kimi-code/dist-web/assets/diagram-G47NLZAW-Bj3iAwJq.js @@ -1,4 +1,4 @@ -import{p as me}from"./chunk-JWPE2WC7-C7S97jLg.js";import{_ as w,E as ge,y as te,A as Q,D as ye,e as Se,l as ee,be as B,d as j,b as ve,a as xe,n as be,o as we,g as Ce,s as Te,B as Le,bf as $e,p as Ae}from"./mermaid.core-CqiFQExc.js";import{s as Fe}from"./chunk-VR4S4FIN-DW1NNlBr.js";import{p as Ne}from"./cynefin-VYW2F7L2-DEnbetzx.js";import{b as I}from"./defaultLocale-DX6XiGOO.js";import{o as K}from"./ordinal-Cboi1Yqb.js";import"./index--0t1wzw_.js";import"./_commonjsHelpers-CqkleIqs.js";import"./init-Gi6I4Gst.js";function Me(e){var a=0,n=e.children,l=n&&n.length;if(!l)a=1;else for(;--l>=0;)a+=n[l].value;e.value=a}function _e(){return this.eachAfter(Me)}function ke(e,a){let n=-1;for(const l of this)e.call(a,l,++n,this);return this}function ze(e,a){for(var n=this,l=[n],r,o,h=-1;n=l.pop();)if(e.call(a,n,++h,this),r=n.children)for(o=r.length-1;o>=0;--o)l.push(r[o]);return this}function Ve(e,a){for(var n=this,l=[n],r=[],o,h,d,g=-1;n=l.pop();)if(r.push(n),o=n.children)for(h=0,d=o.length;h=0;)n+=l[r].value;a.value=n})}function Be(e){return this.eachBefore(function(a){a.children&&a.children.sort(e)})}function Ee(e){for(var a=this,n=Re(a,e),l=[a];a!==n;)a=a.parent,l.push(a);for(var r=l.length;e!==n;)l.splice(r,0,e),e=e.parent;return l}function Re(e,a){if(e===a)return e;var n=e.ancestors(),l=a.ancestors(),r=null;for(e=n.pop(),a=l.pop();e===a;)r=e,e=n.pop(),a=l.pop();return r}function We(){for(var e=this,a=[e];e=e.parent;)a.push(e);return a}function He(){return Array.from(this)}function Ie(){var e=[];return this.eachBefore(function(a){a.children||e.push(a)}),e}function Oe(){var e=this,a=[];return e.each(function(n){n!==e&&a.push({source:n.parent,target:n})}),a}function*Ge(){var e=this,a,n=[e],l,r,o;do for(a=n.reverse(),n=[];e=a.pop();)if(yield e,l=e.children)for(r=0,o=l.length;r=0;--d)r.push(o=h[d]=new U(h[d])),o.parent=l,o.depth=l.depth+1;return n.eachBefore(Ue)}function qe(){return ae(this).eachBefore(je)}function Xe(e){return e.children}function Ye(e){return Array.isArray(e)?e[1]:null}function je(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function Ue(e){var a=0;do e.height=a;while((e=e.parent)&&e.height<++a)}function U(e){this.data=e,this.depth=this.height=0,this.parent=null}U.prototype=ae.prototype={constructor:U,count:_e,each:ke,eachAfter:Ve,eachBefore:ze,find:De,sum:Pe,sort:Be,path:Ee,ancestors:We,descendants:He,leaves:Ie,links:Oe,copy:qe,[Symbol.iterator]:Ge};function Ze(e){if(typeof e!="function")throw new Error;return e}function O(){return 0}function G(e){return function(){return e}}function Je(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function Ke(e,a,n,l,r){for(var o=e.children,h,d=-1,g=o.length,c=e.value&&(l-a)/e.value;++dN&&(N=c),M=u*u*R,$=Math.max(N/M,M/y),$>V){u-=c;break}V=$}h.push(g={value:u,dice:x1?l:1)},n})(et);function nt(){var e=at,a=!1,n=1,l=1,r=[0],o=O,h=O,d=O,g=O,c=O;function p(s){return s.x0=s.y0=0,s.x1=n,s.y1=l,s.eachBefore(b),r=[0],a&&s.eachBefore(Je),s}function b(s){var x=r[s.depth],S=s.x0+x,v=s.y0+x,u=s.x1-x,y=s.y1-x;u{$e(r)&&(n?.textStyles?n.textStyles.push(r):n.textStyles=[r]),n?.styles?n.styles.push(r):n.styles=[r]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){return this.classes.get(e)?.styles??[]}clear(){Ae(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function oe(e){if(!e.length)return[];const a=[],n=[];return e.forEach(l=>{const r={name:l.name,children:l.type==="Leaf"?void 0:[]};for(r.classSelector=l?.classSelector,l?.cssCompiledStyles&&(r.cssCompiledStyles=l.cssCompiledStyles),l.type==="Leaf"&&l.value!==void 0&&(r.value=l.value);n.length>0&&n[n.length-1].level>=l.level;)n.pop();if(n.length===0)a.push(r);else{const o=n[n.length-1].node;o.children?o.children.push(r):o.children=[r]}l.type!=="Leaf"&&n.push({node:r,level:l.level})}),a}w(oe,"buildHierarchy");var lt=w((e,a)=>{me(e,a);const n=[];for(const o of e.TreemapRows??[])o.$type==="ClassDefStatement"&&a.addClass(o.className??"",o.styleText??"");for(const o of e.TreemapRows??[]){const h=o.item;if(!h)continue;const d=o.indent?parseInt(o.indent):0,g=rt(h),c=h.classSelector?a.getStylesForClass(h.classSelector):[],p=c.length>0?c:void 0,b={level:d,name:g,type:h.$type,value:h.value,classSelector:h.classSelector,cssCompiledStyles:p};n.push(b)}const l=oe(n),r=w((o,h)=>{for(const d of o)a.addNode(d,h),d.children&&d.children.length>0&&r(d.children,h+1)},"addNodesRecursively");r(l,0)},"populate"),rt=w(e=>e.name?String(e.name):"","getItemName"),ce={parser:{yy:void 0},parse:w(async e=>{try{const n=await Ne("treemap",e);ee.debug("Treemap AST:",n);const l=ce.parser?.yy;if(!(l instanceof ie))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");lt(n,l)}catch(a){throw ee.error("Error parsing treemap:",a),a}},"parse")},st=10,E=10,q=25,it=w((e,a,n,l)=>{const r=l.db,o=r.getConfig(),h=o.padding??st,d=r.getDiagramTitle(),g=r.getRoot(),{themeVariables:c}=te();if(!g)return;const p=d?30:0,b=ye(a),s=o.nodeWidth?o.nodeWidth*E:960,x=o.nodeHeight?o.nodeHeight*E:500,S=s,v=x+p;b.attr("viewBox",`0 0 ${S} ${v}`),Se(b,v,S,o.useMaxWidth);let u;try{const t=o.valueFormat||",";if(t==="$0,0")u=w(i=>"$"+I(",")(i),"valueFormat");else if(t.startsWith("$")&&t.includes(",")){const i=/\.\d+/.exec(t),f=i?i[0]:"";u=w(C=>"$"+I(","+f)(C),"valueFormat")}else if(t.startsWith("$")){const i=t.substring(1);u=w(f=>"$"+I(i||"")(f),"valueFormat")}else u=I(t)}catch(t){ee.error("Error creating format function:",t),u=I(",")}const y=K().range(["transparent",c.cScale0,c.cScale1,c.cScale2,c.cScale3,c.cScale4,c.cScale5,c.cScale6,c.cScale7,c.cScale8,c.cScale9,c.cScale10,c.cScale11]),N=K().range(["transparent",c.cScalePeer0,c.cScalePeer1,c.cScalePeer2,c.cScalePeer3,c.cScalePeer4,c.cScalePeer5,c.cScalePeer6,c.cScalePeer7,c.cScalePeer8,c.cScalePeer9,c.cScalePeer10,c.cScalePeer11]),$=K().range([c.cScaleLabel0,c.cScaleLabel1,c.cScaleLabel2,c.cScaleLabel3,c.cScaleLabel4,c.cScaleLabel5,c.cScaleLabel6,c.cScaleLabel7,c.cScaleLabel8,c.cScaleLabel9,c.cScaleLabel10,c.cScaleLabel11]);d&&b.append("text").attr("x",S/2).attr("y",p/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(d);const V=b.append("g").attr("transform",`translate(0, ${p})`).attr("class","treemapContainer"),R=ae(g).sum(t=>t.value??0).sort((t,i)=>(i.value??0)-(t.value??0)),ne=nt().size([s,x]).paddingTop(t=>t.children&&t.children.length>0?q+E:0).paddingInner(h).paddingLeft(t=>t.children&&t.children.length>0?E:0).paddingRight(t=>t.children&&t.children.length>0?E:0).paddingBottom(t=>t.children&&t.children.length>0?E:0).round(!0)(R),he=ne.descendants().filter(t=>t.children&&t.children.length>0),W=V.selectAll(".treemapSection").data(he).enter().append("g").attr("class","treemapSection").attr("transform",t=>`translate(${t.x0},${t.y0})`);W.append("rect").attr("width",t=>t.x1-t.x0).attr("height",q).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",t=>t.depth===0?"display: none;":""),W.append("clipPath").attr("id",(t,i)=>`clip-section-${a}-${i}`).append("rect").attr("width",t=>Math.max(0,t.x1-t.x0-12)).attr("height",q),W.append("rect").attr("width",t=>t.x1-t.x0).attr("height",t=>t.y1-t.y0).attr("class",(t,i)=>`treemapSection section${i}`).attr("fill",t=>y(t.data.name)).attr("fill-opacity",.6).attr("stroke",t=>N(t.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",t=>{if(t.depth===0)return"display: none;";const i=B({cssCompiledStyles:t.data.cssCompiledStyles});return i.nodeStyles+";"+i.borderStyles.join(";")}),W.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",q/2).attr("dominant-baseline","middle").text(t=>t.depth===0?"":t.data.name).attr("font-weight","bold").attr("clip-path",(t,i)=>`url(#clip-section-${a}-${i})`).attr("style",t=>{if(t.depth===0)return"display: none;";const i="dominant-baseline: middle; font-size: 12px; fill:"+$(t.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")}).each(function(t){if(t.depth===0)return;const i=j(this),f=t.data.name;i.text(f);const C=t.x1-t.x0,L=6;let T;o.showValues!==!1&&t.value?T=C-10-30-10-L:T=C-L-6;const m=Math.max(15,T),_=i.node();if(_.getComputedTextLength()>m){let z=f;for(;z.length>0;){if(z=f.substring(0,z.length-1),z.length===0){i.text("..."),_.getComputedTextLength()>m&&i.text("");break}if(i.text(z+"..."),_.getComputedTextLength()<=m)break}}}),o.showValues!==!1&&W.append("text").attr("class","treemapSectionValue").attr("x",t=>t.x1-t.x0-10).attr("y",q/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(t=>t.value?u(t.value):"").attr("font-style","italic").attr("style",t=>{if(t.depth===0)return"display: none;";const i="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+$(t.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")});const le=ne.leaves(),A=le.length>20,de=A?16:38,X=A?14:28,D=A?4:8,H=A?4:6,Z=A?2:4,re=A?8:10,J=A?1:2,Y=V.selectAll(".treemapLeafGroup").data(le).enter().append("g").attr("class",(t,i)=>`treemapNode treemapLeafGroup leaf${i}${t.data.classSelector?` ${t.data.classSelector}`:""}x`).attr("transform",t=>`translate(${t.x0},${t.y0})`);Y.append("rect").attr("width",t=>t.x1-t.x0).attr("height",t=>t.y1-t.y0).attr("class","treemapLeaf").attr("fill",t=>t.parent?y(t.parent.data.name):y(t.data.name)).attr("style",t=>B({cssCompiledStyles:t.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",t=>t.parent?y(t.parent.data.name):y(t.data.name)).attr("stroke-width",3),Y.append("clipPath").attr("id",(t,i)=>`clip-${a}-${i}`).append("rect").attr("width",t=>Math.max(0,t.x1-t.x0-4)).attr("height",t=>Math.max(0,t.y1-t.y0-4)),Y.append("text").attr("class","treemapLabel").attr("x",t=>(t.x1-t.x0)/2).attr("y",t=>(t.y1-t.y0)/2).attr("style",t=>{const i=`text-anchor: middle; dominant-baseline: middle; font-size: ${de}px;fill:`+$(t.data.name)+";",f=B({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")}).attr("clip-path",(t,i)=>`url(#clip-${a}-${i})`).text(t=>t.data.name).each(function(t){const i=j(this),f=t.x1-t.x0,C=t.y1-t.y0,L=i.node(),T=f-2*Z,P=C-2*Z;if(TT&&m>D;)m--,i.style("font-size",`${m}px`);let F=Math.max(H,Math.min(X,Math.round(m*_))),k=m+J+F;for(;k>P&&m>D&&(m--,F=Math.max(H,Math.min(X,Math.round(m*_))),!(FT||m(i.x1-i.x0)/2).attr("y",function(i){return(i.y1-i.y0)/2}).attr("style",i=>{const f=`text-anchor: middle; dominant-baseline: hanging; font-size: ${X}px;fill:`+$(i.data.name)+";",C=B({cssCompiledStyles:i.data.cssCompiledStyles});return f+C.labelStyles.replace("color:","fill:")}).attr("clip-path",(i,f)=>`url(#clip-${a}-${f})`).text(i=>i.value?u(i.value):"").each(function(i){const f=j(this),C=this.parentNode;if(!C){f.style("display","none");return}const L=j(C).select(".treemapLabel");if(L.empty()||L.style("display")==="none"){f.style("display","none");return}const T=parseFloat(L.style("font-size")),m=Math.max(H,Math.min(X,Math.round(T*.6)));f.style("font-size",`${m}px`);const F=(i.y1-i.y0)/2+T/2+J;f.attr("y",F);const k=i.x1-i.x0,se=i.y1-i.y0-4,fe=k-2*Z;f.node().getComputedTextLength()>fe||F+m>se||m{const a=ge(),n=te(),l=Q(a,n.themeVariables),r=Q(ht,e),o=r.titleColor??l.titleColor,h=r.labelColor??l.textColor,d=r.valueColor??l.textColor;return` +import{p as me}from"./chunk-JWPE2WC7-BJMJfnyy.js";import{_ as w,E as ge,y as te,A as Q,D as ye,e as Se,l as ee,be as B,d as j,b as ve,a as xe,n as be,o as we,g as Ce,s as Te,B as Le,bf as $e,p as Ae}from"./mermaid.core-WW7RuneT.js";import{s as Fe}from"./chunk-VR4S4FIN-C_RujyXt.js";import{p as Ne}from"./cynefin-VYW2F7L2-DI-9Z5R0.js";import{b as I}from"./defaultLocale-DX6XiGOO.js";import{o as K}from"./ordinal-Cboi1Yqb.js";import"./index-CiHMlsuo.js";import"./_commonjsHelpers-CqkleIqs.js";import"./init-Gi6I4Gst.js";function Me(e){var a=0,n=e.children,l=n&&n.length;if(!l)a=1;else for(;--l>=0;)a+=n[l].value;e.value=a}function _e(){return this.eachAfter(Me)}function ke(e,a){let n=-1;for(const l of this)e.call(a,l,++n,this);return this}function ze(e,a){for(var n=this,l=[n],r,o,h=-1;n=l.pop();)if(e.call(a,n,++h,this),r=n.children)for(o=r.length-1;o>=0;--o)l.push(r[o]);return this}function Ve(e,a){for(var n=this,l=[n],r=[],o,h,d,g=-1;n=l.pop();)if(r.push(n),o=n.children)for(h=0,d=o.length;h=0;)n+=l[r].value;a.value=n})}function Be(e){return this.eachBefore(function(a){a.children&&a.children.sort(e)})}function Ee(e){for(var a=this,n=Re(a,e),l=[a];a!==n;)a=a.parent,l.push(a);for(var r=l.length;e!==n;)l.splice(r,0,e),e=e.parent;return l}function Re(e,a){if(e===a)return e;var n=e.ancestors(),l=a.ancestors(),r=null;for(e=n.pop(),a=l.pop();e===a;)r=e,e=n.pop(),a=l.pop();return r}function We(){for(var e=this,a=[e];e=e.parent;)a.push(e);return a}function He(){return Array.from(this)}function Ie(){var e=[];return this.eachBefore(function(a){a.children||e.push(a)}),e}function Oe(){var e=this,a=[];return e.each(function(n){n!==e&&a.push({source:n.parent,target:n})}),a}function*Ge(){var e=this,a,n=[e],l,r,o;do for(a=n.reverse(),n=[];e=a.pop();)if(yield e,l=e.children)for(r=0,o=l.length;r=0;--d)r.push(o=h[d]=new U(h[d])),o.parent=l,o.depth=l.depth+1;return n.eachBefore(Ue)}function qe(){return ae(this).eachBefore(je)}function Xe(e){return e.children}function Ye(e){return Array.isArray(e)?e[1]:null}function je(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function Ue(e){var a=0;do e.height=a;while((e=e.parent)&&e.height<++a)}function U(e){this.data=e,this.depth=this.height=0,this.parent=null}U.prototype=ae.prototype={constructor:U,count:_e,each:ke,eachAfter:Ve,eachBefore:ze,find:De,sum:Pe,sort:Be,path:Ee,ancestors:We,descendants:He,leaves:Ie,links:Oe,copy:qe,[Symbol.iterator]:Ge};function Ze(e){if(typeof e!="function")throw new Error;return e}function O(){return 0}function G(e){return function(){return e}}function Je(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function Ke(e,a,n,l,r){for(var o=e.children,h,d=-1,g=o.length,c=e.value&&(l-a)/e.value;++dN&&(N=c),M=u*u*R,$=Math.max(N/M,M/y),$>V){u-=c;break}V=$}h.push(g={value:u,dice:x1?l:1)},n})(et);function nt(){var e=at,a=!1,n=1,l=1,r=[0],o=O,h=O,d=O,g=O,c=O;function p(s){return s.x0=s.y0=0,s.x1=n,s.y1=l,s.eachBefore(b),r=[0],a&&s.eachBefore(Je),s}function b(s){var x=r[s.depth],S=s.x0+x,v=s.y0+x,u=s.x1-x,y=s.y1-x;u{$e(r)&&(n?.textStyles?n.textStyles.push(r):n.textStyles=[r]),n?.styles?n.styles.push(r):n.styles=[r]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){return this.classes.get(e)?.styles??[]}clear(){Ae(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function oe(e){if(!e.length)return[];const a=[],n=[];return e.forEach(l=>{const r={name:l.name,children:l.type==="Leaf"?void 0:[]};for(r.classSelector=l?.classSelector,l?.cssCompiledStyles&&(r.cssCompiledStyles=l.cssCompiledStyles),l.type==="Leaf"&&l.value!==void 0&&(r.value=l.value);n.length>0&&n[n.length-1].level>=l.level;)n.pop();if(n.length===0)a.push(r);else{const o=n[n.length-1].node;o.children?o.children.push(r):o.children=[r]}l.type!=="Leaf"&&n.push({node:r,level:l.level})}),a}w(oe,"buildHierarchy");var lt=w((e,a)=>{me(e,a);const n=[];for(const o of e.TreemapRows??[])o.$type==="ClassDefStatement"&&a.addClass(o.className??"",o.styleText??"");for(const o of e.TreemapRows??[]){const h=o.item;if(!h)continue;const d=o.indent?parseInt(o.indent):0,g=rt(h),c=h.classSelector?a.getStylesForClass(h.classSelector):[],p=c.length>0?c:void 0,b={level:d,name:g,type:h.$type,value:h.value,classSelector:h.classSelector,cssCompiledStyles:p};n.push(b)}const l=oe(n),r=w((o,h)=>{for(const d of o)a.addNode(d,h),d.children&&d.children.length>0&&r(d.children,h+1)},"addNodesRecursively");r(l,0)},"populate"),rt=w(e=>e.name?String(e.name):"","getItemName"),ce={parser:{yy:void 0},parse:w(async e=>{try{const n=await Ne("treemap",e);ee.debug("Treemap AST:",n);const l=ce.parser?.yy;if(!(l instanceof ie))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");lt(n,l)}catch(a){throw ee.error("Error parsing treemap:",a),a}},"parse")},st=10,E=10,q=25,it=w((e,a,n,l)=>{const r=l.db,o=r.getConfig(),h=o.padding??st,d=r.getDiagramTitle(),g=r.getRoot(),{themeVariables:c}=te();if(!g)return;const p=d?30:0,b=ye(a),s=o.nodeWidth?o.nodeWidth*E:960,x=o.nodeHeight?o.nodeHeight*E:500,S=s,v=x+p;b.attr("viewBox",`0 0 ${S} ${v}`),Se(b,v,S,o.useMaxWidth);let u;try{const t=o.valueFormat||",";if(t==="$0,0")u=w(i=>"$"+I(",")(i),"valueFormat");else if(t.startsWith("$")&&t.includes(",")){const i=/\.\d+/.exec(t),f=i?i[0]:"";u=w(C=>"$"+I(","+f)(C),"valueFormat")}else if(t.startsWith("$")){const i=t.substring(1);u=w(f=>"$"+I(i||"")(f),"valueFormat")}else u=I(t)}catch(t){ee.error("Error creating format function:",t),u=I(",")}const y=K().range(["transparent",c.cScale0,c.cScale1,c.cScale2,c.cScale3,c.cScale4,c.cScale5,c.cScale6,c.cScale7,c.cScale8,c.cScale9,c.cScale10,c.cScale11]),N=K().range(["transparent",c.cScalePeer0,c.cScalePeer1,c.cScalePeer2,c.cScalePeer3,c.cScalePeer4,c.cScalePeer5,c.cScalePeer6,c.cScalePeer7,c.cScalePeer8,c.cScalePeer9,c.cScalePeer10,c.cScalePeer11]),$=K().range([c.cScaleLabel0,c.cScaleLabel1,c.cScaleLabel2,c.cScaleLabel3,c.cScaleLabel4,c.cScaleLabel5,c.cScaleLabel6,c.cScaleLabel7,c.cScaleLabel8,c.cScaleLabel9,c.cScaleLabel10,c.cScaleLabel11]);d&&b.append("text").attr("x",S/2).attr("y",p/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(d);const V=b.append("g").attr("transform",`translate(0, ${p})`).attr("class","treemapContainer"),R=ae(g).sum(t=>t.value??0).sort((t,i)=>(i.value??0)-(t.value??0)),ne=nt().size([s,x]).paddingTop(t=>t.children&&t.children.length>0?q+E:0).paddingInner(h).paddingLeft(t=>t.children&&t.children.length>0?E:0).paddingRight(t=>t.children&&t.children.length>0?E:0).paddingBottom(t=>t.children&&t.children.length>0?E:0).round(!0)(R),he=ne.descendants().filter(t=>t.children&&t.children.length>0),W=V.selectAll(".treemapSection").data(he).enter().append("g").attr("class","treemapSection").attr("transform",t=>`translate(${t.x0},${t.y0})`);W.append("rect").attr("width",t=>t.x1-t.x0).attr("height",q).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",t=>t.depth===0?"display: none;":""),W.append("clipPath").attr("id",(t,i)=>`clip-section-${a}-${i}`).append("rect").attr("width",t=>Math.max(0,t.x1-t.x0-12)).attr("height",q),W.append("rect").attr("width",t=>t.x1-t.x0).attr("height",t=>t.y1-t.y0).attr("class",(t,i)=>`treemapSection section${i}`).attr("fill",t=>y(t.data.name)).attr("fill-opacity",.6).attr("stroke",t=>N(t.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",t=>{if(t.depth===0)return"display: none;";const i=B({cssCompiledStyles:t.data.cssCompiledStyles});return i.nodeStyles+";"+i.borderStyles.join(";")}),W.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",q/2).attr("dominant-baseline","middle").text(t=>t.depth===0?"":t.data.name).attr("font-weight","bold").attr("clip-path",(t,i)=>`url(#clip-section-${a}-${i})`).attr("style",t=>{if(t.depth===0)return"display: none;";const i="dominant-baseline: middle; font-size: 12px; fill:"+$(t.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")}).each(function(t){if(t.depth===0)return;const i=j(this),f=t.data.name;i.text(f);const C=t.x1-t.x0,L=6;let T;o.showValues!==!1&&t.value?T=C-10-30-10-L:T=C-L-6;const m=Math.max(15,T),_=i.node();if(_.getComputedTextLength()>m){let z=f;for(;z.length>0;){if(z=f.substring(0,z.length-1),z.length===0){i.text("..."),_.getComputedTextLength()>m&&i.text("");break}if(i.text(z+"..."),_.getComputedTextLength()<=m)break}}}),o.showValues!==!1&&W.append("text").attr("class","treemapSectionValue").attr("x",t=>t.x1-t.x0-10).attr("y",q/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(t=>t.value?u(t.value):"").attr("font-style","italic").attr("style",t=>{if(t.depth===0)return"display: none;";const i="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+$(t.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")});const le=ne.leaves(),A=le.length>20,de=A?16:38,X=A?14:28,D=A?4:8,H=A?4:6,Z=A?2:4,re=A?8:10,J=A?1:2,Y=V.selectAll(".treemapLeafGroup").data(le).enter().append("g").attr("class",(t,i)=>`treemapNode treemapLeafGroup leaf${i}${t.data.classSelector?` ${t.data.classSelector}`:""}x`).attr("transform",t=>`translate(${t.x0},${t.y0})`);Y.append("rect").attr("width",t=>t.x1-t.x0).attr("height",t=>t.y1-t.y0).attr("class","treemapLeaf").attr("fill",t=>t.parent?y(t.parent.data.name):y(t.data.name)).attr("style",t=>B({cssCompiledStyles:t.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",t=>t.parent?y(t.parent.data.name):y(t.data.name)).attr("stroke-width",3),Y.append("clipPath").attr("id",(t,i)=>`clip-${a}-${i}`).append("rect").attr("width",t=>Math.max(0,t.x1-t.x0-4)).attr("height",t=>Math.max(0,t.y1-t.y0-4)),Y.append("text").attr("class","treemapLabel").attr("x",t=>(t.x1-t.x0)/2).attr("y",t=>(t.y1-t.y0)/2).attr("style",t=>{const i=`text-anchor: middle; dominant-baseline: middle; font-size: ${de}px;fill:`+$(t.data.name)+";",f=B({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")}).attr("clip-path",(t,i)=>`url(#clip-${a}-${i})`).text(t=>t.data.name).each(function(t){const i=j(this),f=t.x1-t.x0,C=t.y1-t.y0,L=i.node(),T=f-2*Z,P=C-2*Z;if(TT&&m>D;)m--,i.style("font-size",`${m}px`);let F=Math.max(H,Math.min(X,Math.round(m*_))),k=m+J+F;for(;k>P&&m>D&&(m--,F=Math.max(H,Math.min(X,Math.round(m*_))),!(FT||m(i.x1-i.x0)/2).attr("y",function(i){return(i.y1-i.y0)/2}).attr("style",i=>{const f=`text-anchor: middle; dominant-baseline: hanging; font-size: ${X}px;fill:`+$(i.data.name)+";",C=B({cssCompiledStyles:i.data.cssCompiledStyles});return f+C.labelStyles.replace("color:","fill:")}).attr("clip-path",(i,f)=>`url(#clip-${a}-${f})`).text(i=>i.value?u(i.value):"").each(function(i){const f=j(this),C=this.parentNode;if(!C){f.style("display","none");return}const L=j(C).select(".treemapLabel");if(L.empty()||L.style("display")==="none"){f.style("display","none");return}const T=parseFloat(L.style("font-size")),m=Math.max(H,Math.min(X,Math.round(T*.6)));f.style("font-size",`${m}px`);const F=(i.y1-i.y0)/2+T/2+J;f.attr("y",F);const k=i.x1-i.x0,se=i.y1-i.y0-4,fe=k-2*Z;f.node().getComputedTextLength()>fe||F+m>se||m{const a=ge(),n=te(),l=Q(a,n.themeVariables),r=Q(ht,e),o=r.titleColor??l.titleColor,h=r.labelColor??l.textColor,d=r.valueColor??l.textColor;return` .treemapNode.section { stroke: ${r.sectionStrokeColor}; stroke-width: ${r.sectionStrokeWidth}; diff --git a/apps/kimi-code/dist-web/assets/diagram-NH7WQ7WH-BO_tIsIn.js b/apps/kimi-code/dist-web/assets/diagram-NH7WQ7WH-D0p601mB.js similarity index 93% rename from apps/kimi-code/dist-web/assets/diagram-NH7WQ7WH-BO_tIsIn.js rename to apps/kimi-code/dist-web/assets/diagram-NH7WQ7WH-D0p601mB.js index ebff734b45..76b28fd0a6 100644 --- a/apps/kimi-code/dist-web/assets/diagram-NH7WQ7WH-BO_tIsIn.js +++ b/apps/kimi-code/dist-web/assets/diagram-NH7WQ7WH-D0p601mB.js @@ -1,4 +1,4 @@ -import{p as B}from"./chunk-JWPE2WC7-C7S97jLg.js";import{_ as b,A as u,D as $,e as C,l as m,b as S,a as D,n as T,o as P,g as z,s as A,y as E,B as F,p as W}from"./mermaid.core-CqiFQExc.js";import{p as _}from"./cynefin-VYW2F7L2-DEnbetzx.js";import"./index--0t1wzw_.js";import"./_commonjsHelpers-CqkleIqs.js";var N=F.packet,w=class{constructor(){this.packet=[],this.setAccTitle=S,this.getAccTitle=D,this.setDiagramTitle=T,this.getDiagramTitle=P,this.getAccDescription=z,this.setAccDescription=A}static{b(this,"PacketDB")}getConfig(){const t=u({...N,...E().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){W(),this.packet=[]}},L=1e4,M=b((t,e)=>{B(t,e);let r=-1,o=[],n=1;const{bitsPerRow:l}=e.getConfig();for(let{start:a,end:i,bits:d,label:c}of t.blocks){if(a!==void 0&&i!==void 0&&i{if(t.start===void 0)throw new Error("start should have been set during first phase");if(t.end===void 0)throw new Error("end should have been set during first phase");if(t.start>t.end)throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);if(t.end+1<=e*r)return[t,void 0];const o=e*r-1,n=e*r;return[{start:t.start,end:o,label:t.label,bits:o-t.start},{start:n,end:t.end,label:t.label,bits:t.end-n}]},"getNextFittingBlock"),v={parser:{yy:void 0},parse:b(async t=>{const e=await _("packet",t),r=v.parser?.yy;if(!(r instanceof w))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");m.debug(e),M(e,r)},"parse")},I=b((t,e,r,o)=>{const n=o.db,l=n.getConfig(),{rowHeight:a,paddingY:i,bitWidth:d,bitsPerRow:c}=l,p=n.getPacket(),s=n.getDiagramTitle(),h=a+i,g=h*(p.length+1)-(s?0:a),k=d*c+2,f=$(e);f.attr("viewBox",`0 0 ${k} ${g}`),C(f,g,k,l.useMaxWidth);for(const[x,y]of p.entries())O(f,y,x,l);f.append("text").text(s).attr("x",k/2).attr("y",g-h/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),O=b((t,e,r,{rowHeight:o,paddingX:n,paddingY:l,bitWidth:a,bitsPerRow:i,showBits:d})=>{const c=t.append("g"),p=r*(o+l)+l;for(const s of e){const h=s.start%i*a+1,g=(s.end-s.start+1)*a-n;if(c.append("rect").attr("x",h).attr("y",p).attr("width",g).attr("height",o).attr("class","packetBlock"),c.append("text").attr("x",h+g/2).attr("y",p+o/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(s.label),!d)continue;const k=s.end===s.start,f=p-2;c.append("text").attr("x",h+(k?g/2:0)).attr("y",f).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",k?"middle":"start").text(s.start),k||c.append("text").attr("x",h+g).attr("y",f).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(s.end)}},"drawWord"),j={draw:I},G={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},H=b(({packet:t}={})=>{const e=u(G,t);return` +import{p as B}from"./chunk-JWPE2WC7-BJMJfnyy.js";import{_ as b,A as u,D as $,e as C,l as m,b as S,a as D,n as T,o as P,g as z,s as A,y as E,B as F,p as W}from"./mermaid.core-WW7RuneT.js";import{p as _}from"./cynefin-VYW2F7L2-DI-9Z5R0.js";import"./index-CiHMlsuo.js";import"./_commonjsHelpers-CqkleIqs.js";var N=F.packet,w=class{constructor(){this.packet=[],this.setAccTitle=S,this.getAccTitle=D,this.setDiagramTitle=T,this.getDiagramTitle=P,this.getAccDescription=z,this.setAccDescription=A}static{b(this,"PacketDB")}getConfig(){const t=u({...N,...E().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){W(),this.packet=[]}},L=1e4,M=b((t,e)=>{B(t,e);let r=-1,o=[],n=1;const{bitsPerRow:l}=e.getConfig();for(let{start:a,end:i,bits:d,label:c}of t.blocks){if(a!==void 0&&i!==void 0&&i{if(t.start===void 0)throw new Error("start should have been set during first phase");if(t.end===void 0)throw new Error("end should have been set during first phase");if(t.start>t.end)throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);if(t.end+1<=e*r)return[t,void 0];const o=e*r-1,n=e*r;return[{start:t.start,end:o,label:t.label,bits:o-t.start},{start:n,end:t.end,label:t.label,bits:t.end-n}]},"getNextFittingBlock"),v={parser:{yy:void 0},parse:b(async t=>{const e=await _("packet",t),r=v.parser?.yy;if(!(r instanceof w))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");m.debug(e),M(e,r)},"parse")},I=b((t,e,r,o)=>{const n=o.db,l=n.getConfig(),{rowHeight:a,paddingY:i,bitWidth:d,bitsPerRow:c}=l,p=n.getPacket(),s=n.getDiagramTitle(),h=a+i,g=h*(p.length+1)-(s?0:a),k=d*c+2,f=$(e);f.attr("viewBox",`0 0 ${k} ${g}`),C(f,g,k,l.useMaxWidth);for(const[x,y]of p.entries())O(f,y,x,l);f.append("text").text(s).attr("x",k/2).attr("y",g-h/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),O=b((t,e,r,{rowHeight:o,paddingX:n,paddingY:l,bitWidth:a,bitsPerRow:i,showBits:d})=>{const c=t.append("g"),p=r*(o+l)+l;for(const s of e){const h=s.start%i*a+1,g=(s.end-s.start+1)*a-n;if(c.append("rect").attr("x",h).attr("y",p).attr("width",g).attr("height",o).attr("class","packetBlock"),c.append("text").attr("x",h+g/2).attr("y",p+o/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(s.label),!d)continue;const k=s.end===s.start,f=p-2;c.append("text").attr("x",h+(k?g/2:0)).attr("y",f).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",k?"middle":"start").text(s.start),k||c.append("text").attr("x",h+g).attr("y",f).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(s.end)}},"drawWord"),j={draw:I},G={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},H=b(({packet:t}={})=>{const e=u(G,t);return` .packetByte { font-size: ${e.byteFontSize}; } diff --git a/apps/kimi-code/dist-web/assets/diagram-OA4YK3LP-BiXs8uY6.js b/apps/kimi-code/dist-web/assets/diagram-OA4YK3LP-BLpvk7p_.js similarity index 96% rename from apps/kimi-code/dist-web/assets/diagram-OA4YK3LP-BiXs8uY6.js rename to apps/kimi-code/dist-web/assets/diagram-OA4YK3LP-BLpvk7p_.js index 4b7335b898..e390e48157 100644 --- a/apps/kimi-code/dist-web/assets/diagram-OA4YK3LP-BiXs8uY6.js +++ b/apps/kimi-code/dist-web/assets/diagram-OA4YK3LP-BLpvk7p_.js @@ -1,4 +1,4 @@ -import{I as X}from"./chunk-2Q5K7J3B-CdhiweKX.js";import{p as O}from"./chunk-JWPE2WC7-C7S97jLg.js";import{n as G,b as Y,s as P,o as j,g as F,a as Z,_ as f,A,l as D,D as q,e as U,y as N,p as J,i as K,ai as Q,B as ee,aj as te}from"./mermaid.core-CqiFQExc.js";import{p as ne}from"./cynefin-VYW2F7L2-DEnbetzx.js";import"./index--0t1wzw_.js";import"./_commonjsHelpers-CqkleIqs.js";var E=/[─━│┃└┗├┣]/,S=/[└┗├┣]/,re=/[─━]/,V=/^[\s│┃]+$/,$=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,k=/^\s*%%/,ie=" ";function L(n){return n.some(e=>E.test(e))}f(L,"isBoxDrawingFormat");function _(n){for(const e of n){const t=S.exec(e);if(t?.index&&t.index>0)return t.index}return 4}f(_,"inferSegmentWidth");function M(n,e){return n.replace(/\bline\s+(\d+)\b/gi,(t,r)=>{const i=parseInt(r,10),a=e.get(i);return a?`line ${a}`:t})}f(M,"remapErrorLines");function R(n){const e=n.split(` +import{I as X}from"./chunk-2Q5K7J3B-NzojNxDT.js";import{p as O}from"./chunk-JWPE2WC7-BJMJfnyy.js";import{n as G,b as Y,s as P,o as j,g as F,a as Z,_ as f,A,l as D,D as q,e as U,y as N,p as J,i as K,ai as Q,B as ee,aj as te}from"./mermaid.core-WW7RuneT.js";import{p as ne}from"./cynefin-VYW2F7L2-DI-9Z5R0.js";import"./index-CiHMlsuo.js";import"./_commonjsHelpers-CqkleIqs.js";var E=/[─━│┃└┗├┣]/,S=/[└┗├┣]/,re=/[─━]/,V=/^[\s│┃]+$/,$=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,k=/^\s*%%/,ie=" ";function L(n){return n.some(e=>E.test(e))}f(L,"isBoxDrawingFormat");function _(n){for(const e of n){const t=S.exec(e);if(t?.index&&t.index>0)return t.index}return 4}f(_,"inferSegmentWidth");function M(n,e){return n.replace(/\bline\s+(\d+)\b/gi,(t,r)=>{const i=parseInt(r,10),a=e.get(i);return a?`line ${a}`:t})}f(M,"remapErrorLines");function R(n){const e=n.split(` `),t=new Map;let r=-1;for(const[s,o]of e.entries())if(o.trim()==="treeView-beta"){r=s;break}if(r===-1)return{text:n,lineMap:t};const i=[];for(let s=r+1;s({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),oe=f(()=>{x.reset(),J()},"clear"),se=f(()=>x.records.stack[0],"getRoot"),ae=f(()=>x.records.cnt,"getCount"),ce=ee.treeView,le=f(()=>A(ce,N().treeView),"getConfig"),de=f((n,e,t,r,i,a)=>{for(;n<=x.records.stack[x.records.stack.length-1].level;)x.records.stack.pop();const c={id:x.records.cnt++,level:n,name:e,nodeType:t,icon:i,cssClass:r,description:a,children:[]};x.records.stack[x.records.stack.length-1].children.push(c),x.records.stack.push(c)},"addNode"),he={clear:oe,addNode:de,getRoot:se,getCount:ae,getConfig:le,getAccTitle:Z,getAccDescription:F,getDiagramTitle:j,setAccDescription:P,setAccTitle:Y,setDiagramTitle:G},I=he,pe=f(n=>{O(n,I);for(const e of n.nodes){const t=typeof e.indent=="number"?e.indent:0;let r=e.name;const i=r.endsWith("/");i&&(r=r.slice(0,-1));const a=i?"directory":"file",c=e.classAnnotation||void 0,l=e.iconAnnotation,s=l!==void 0?l||"none":void 0,o=e.descAnnotation||void 0,h=o?K(o,N()):void 0;I.addNode(t,r,a,c,s,h)}},"populate"),fe={parse:f(async n=>{const{text:e,lineMap:t}=R(n);try{const r=await ne("treeView",e);D.debug(r),pe(r)}catch(r){throw t.size>0&&r instanceof Error&&(r.message=M(r.message,t)),r}},"parse")},b={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:''},file:{body:''}}};function H(n,e){const t=e?.filenameIcons?.[n];if(t)return t;const r=n.lastIndexOf(".");if(r>0){const i=n.substring(r).toLowerCase(),a=e?.extensionIcons;return a?.[i]??a?.[i.slice(1)]}}f(H,"detectIcon");function C(n,e){return n.includes(":")?n:n in b.icons||!e?`${b.prefix}:${n}`:`${e}:${n}`}f(C,"qualifyIcon");function B(n,e){if(n.icon!=="none"){if(n.icon)return C(n.icon,e.defaultIconPack);if(e.showIcons){if(n.nodeType==="file"){const t=H(n.name,e);if(t==="none")return;if(t)return C(t,e.defaultIconPack)}return`${b.prefix}:${n.nodeType==="directory"?"folder":"file"}`}}}f(B,"getNodeIcon");te([{name:b.prefix,icons:b}]);var y=14,ge=4,ue=16,z=f((n,e)=>`tv-icon-${n}-${e.replace(/[^\w-]/g,"-")}`,"iconSymbolId"),we=f(async(n,e,t,r)=>{const i=new Set,a=f(s=>{const o=B(s,t);o&&i.add(o),s.children.forEach(a)},"collect");if(a(e),i.size===0)return;const c=await Promise.all([...i].map(async s=>({icon:s,svg:await Q(s,{height:y,width:y})}))),l=n.append("defs");for(const{icon:s,svg:o}of c)l.append("g").attr("id",z(r,s)).html(o)},"injectIconDefs"),me=f((n,e,t,r,i,a)=>{const c=r.append("g");let l="treeView-node-label";t.nodeType==="directory"&&(l+=" treeView-node-dir"),t.cssClass&&(l+=` ${t.cssClass}`);const s=y+ge,o=B(t,i),h=o!==void 0;o&&c.append("use").attr("xlink:href",`#${z(a,o)}`).attr("x",n+i.paddingX).attr("y",e+i.paddingY).attr("class","treeView-node-icon");const p=c.append("text").text(t.name).attr("dominant-baseline","middle").attr("class",l),{height:d,width:w}=p.node().getBBox(),g=d+i.paddingY*2,m=n+i.paddingX+(h?s:0);p.attr("x",m),p.attr("y",e+g/2);const u=m+w,v=w+i.paddingX*2+(h?s:0);return t.BBox={x:n,y:e,width:v,height:g},t.cssClass?.split(/\s+/).includes("highlight")&&c.insert("rect",":first-child").attr("x",n).attr("y",e+1).attr("width",0).attr("height",g-2).attr("rx",3).attr("class","treeView-highlight-bg"),{node:t,nodeGroup:c,labelRightEdge:u,centerY:e+g/2}},"positionLabel"),T=f((n,e,t,r,i,a)=>n.append("line").attr("x1",e).attr("y1",t).attr("x2",r).attr("y2",i).attr("stroke-width",a).attr("class","treeView-node-line"),"positionLine"),xe=f((n,e,t,r)=>{let i=0,a=0;const c=[],l=f((h,p,d,w)=>{const g=w*(d.rowIndent+d.paddingX),m=me(g,i,p,h,d,r);c.push(m);const{height:u,width:v}=p.BBox;T(h,g-d.rowIndent,i+u/2,g,i+u/2,d.lineThickness),a=Math.max(a,g+v),i+=u},"drawNode"),s=f((h,p=0)=>{l(n,h,t,p),h.children.forEach(m=>{s(m,p+1)});const{x:d,y:w,height:g}=h.BBox;if(h.children.length){const{y:m,height:u}=h.children[h.children.length-1].BBox;T(n,d+t.paddingX,w+g,d+t.paddingX,m+u/2+t.lineThickness/2,t.lineThickness)}},"processNode");s(e);const o=c.filter(h=>h.node.description);if(o.length>0){const p=Math.max(...c.map(d=>d.labelRightEdge))+ue;for(const d of o){const g=d.nodeGroup.append("text").text(d.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",p).attr("y",d.centerY).node().getBBox();a=Math.max(a,p+g.width+t.paddingX)}}for(const h of c)if(h.node.cssClass?.split(/\s+/).includes("highlight")){const p=h.nodeGroup.select(".treeView-highlight-bg");if(!p.empty()){const d=a-h.node.BBox.x+8;p.attr("width",d),a=Math.max(a,h.node.BBox.x+d+2)}}return{totalHeight:i,totalWidth:a}},"drawTree"),ve=f(async(n,e,t,r)=>{D.debug(`Rendering treeView diagram `+n);const i=r.db,a=i.getRoot(),c=i.getConfig(),l=q(e);await we(l,a,c,e);const s=l.append("g");s.attr("class","tree-view");const{totalHeight:o,totalWidth:h}=xe(s,a,c,e);l.attr("viewBox",`-${c.lineThickness/2} 0 ${h} ${o}`),U(l,o,h,c.useMaxWidth)},"draw"),be={draw:ve},Ie=be,Ce={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},ye=f(({treeView:n})=>{const{labelFontSize:e,labelColor:t,lineColor:r,iconColor:i,descriptionColor:a,highlightBg:c,highlightStroke:l}=A(Ce,n);return` diff --git a/apps/kimi-code/dist-web/assets/diagram-WEI45ONY-DzHIyeb8.js b/apps/kimi-code/dist-web/assets/diagram-WEI45ONY-DKRP3hVn.js similarity index 95% rename from apps/kimi-code/dist-web/assets/diagram-WEI45ONY-DzHIyeb8.js rename to apps/kimi-code/dist-web/assets/diagram-WEI45ONY-DKRP3hVn.js index 457506eef4..38d04dbe8e 100644 --- a/apps/kimi-code/dist-web/assets/diagram-WEI45ONY-DzHIyeb8.js +++ b/apps/kimi-code/dist-web/assets/diagram-WEI45ONY-DKRP3hVn.js @@ -1,4 +1,4 @@ -import{p as k}from"./chunk-JWPE2WC7-C7S97jLg.js";import{s as R,g as E,o as I,n as _,a as D,b as F,_ as c,D as P,p as z,A as y,y as C,B as G,l as B,E as W,e as V}from"./mermaid.core-CqiFQExc.js";import{p as H}from"./cynefin-VYW2F7L2-DEnbetzx.js";import"./index--0t1wzw_.js";import"./_commonjsHelpers-CqkleIqs.js";var m={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},w={axes:[],curves:[],options:m},x=structuredClone(w),j=G.radar,N=c(()=>y({...j,...C().radar}),"getConfig"),b=c(()=>x.axes,"getAxes"),U=c(()=>x.curves,"getCurves"),X=c(()=>x.options,"getOptions"),Y=c(a=>{x.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),Z=c(a=>{x.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:q(t.entries)}))},"setCurves"),q=c(a=>{if(a[0].axis==null)return a.map(e=>e.value);const t=b();if(t.length===0)throw new Error("Axes must be populated before curves for reference entries");return t.map(e=>{const r=a.find(s=>s.axis?.$refText===e.name);if(r===void 0)throw new Error("Missing entry for axis "+e.label);return r.value})},"computeCurveEntries"),J=c(a=>{const t=a.reduce((e,r)=>(e[r.name]=r,e),{});x.options={showLegend:t.showLegend?.value??m.showLegend,ticks:t.ticks?.value??m.ticks,max:t.max?.value??m.max,min:t.min?.value??m.min,graticule:t.graticule?.value??m.graticule}},"setOptions"),K=c(()=>{z(),x=structuredClone(w)},"clear"),$={getAxes:b,getCurves:U,getOptions:X,setAxes:Y,setCurves:Z,setOptions:J,getConfig:N,clear:K,setAccTitle:F,getAccTitle:D,setDiagramTitle:_,getDiagramTitle:I,getAccDescription:E,setAccDescription:R},Q=c(a=>{k(a,$);const{axes:t,curves:e,options:r}=a;$.setAxes(t),$.setCurves(e),$.setOptions(r)},"populate"),tt={parse:c(async a=>{const t=await H("radar",a);B.debug(t),Q(t)},"parse")},et=c((a,t,e,r)=>{const s=r.db,i=s.getAxes(),l=s.getCurves(),n=s.getOptions(),o=s.getConfig(),d=s.getDiagramTitle(),p=P(t),u=at(p,o),g=n.max??Math.max(...l.map(f=>Math.max(...f.entries))),h=n.min,v=Math.min(o.width,o.height)/2;rt(u,i,v,n.ticks,n.graticule),st(u,i,v,o),A(u,i,l,h,g,n.graticule,o),T(u,l,n.showLegend,o),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-o.height/2-o.marginTop)},"draw"),at=c((a,t)=>{const e=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,s={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return V(a,r,e,t.useMaxWidth??!0),a.attr("viewBox",`0 0 ${e} ${r}`).attr("overflow","visible"),a.append("g").attr("transform",`translate(${s.x}, ${s.y})`)},"drawFrame"),rt=c((a,t,e,r,s)=>{if(s==="circle")for(let i=0;i{const u=2*p*Math.PI/i-Math.PI/2,g=n*Math.cos(u),h=n*Math.sin(u);return`${g},${h}`}).join(" ");a.append("polygon").attr("points",o).attr("class","radarGraticule")}}},"drawGraticule"),st=c((a,t,e,r)=>{const s=t.length;for(let i=0;i.01?"start":o<-.01?"end":"middle",u=d>.01?"hanging":d<-.01?"auto":"central",g=4;a.append("text").text(l).attr("x",e*r.axisLabelFactor*o+g*o).attr("y",e*r.axisLabelFactor*d+g*d).attr("text-anchor",p).attr("dominant-baseline",u).attr("class","radarAxisLabel")}},"drawAxes");function A(a,t,e,r,s,i,l){const n=t.length,o=Math.min(l.width,l.height)/2;e.forEach((d,p)=>{if(d.entries.length!==n)return;const u=d.entries.map((g,h)=>{const v=2*Math.PI*h/n-Math.PI/2,f=M(g,r,s,o),S=f*Math.cos(v),O=f*Math.sin(v);return{x:S,y:O}});i==="circle"?a.append("path").attr("d",L(u,l.curveTension)).attr("class",`radarCurve-${p}`):i==="polygon"&&a.append("polygon").attr("points",u.map(g=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${p}`)})}c(A,"drawCurves");function M(a,t,e,r){const s=Math.min(Math.max(a,t),e);return r*(s-t)/(e-t)}c(M,"relativeRadius");function L(a,t){const e=a.length;let r=`M${a[0].x},${a[0].y}`;for(let s=0;s{const d=a.append("g").attr("transform",`translate(${s}, ${i+o*l})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${o}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(n.label)})}c(T,"drawLegend");var nt={draw:et},ot=c((a,t)=>{let e="";for(let r=0;ry({...j,...C().radar}),"getConfig"),b=c(()=>x.axes,"getAxes"),U=c(()=>x.curves,"getCurves"),X=c(()=>x.options,"getOptions"),Y=c(a=>{x.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),Z=c(a=>{x.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:q(t.entries)}))},"setCurves"),q=c(a=>{if(a[0].axis==null)return a.map(e=>e.value);const t=b();if(t.length===0)throw new Error("Axes must be populated before curves for reference entries");return t.map(e=>{const r=a.find(s=>s.axis?.$refText===e.name);if(r===void 0)throw new Error("Missing entry for axis "+e.label);return r.value})},"computeCurveEntries"),J=c(a=>{const t=a.reduce((e,r)=>(e[r.name]=r,e),{});x.options={showLegend:t.showLegend?.value??m.showLegend,ticks:t.ticks?.value??m.ticks,max:t.max?.value??m.max,min:t.min?.value??m.min,graticule:t.graticule?.value??m.graticule}},"setOptions"),K=c(()=>{z(),x=structuredClone(w)},"clear"),$={getAxes:b,getCurves:U,getOptions:X,setAxes:Y,setCurves:Z,setOptions:J,getConfig:N,clear:K,setAccTitle:F,getAccTitle:D,setDiagramTitle:_,getDiagramTitle:I,getAccDescription:E,setAccDescription:R},Q=c(a=>{k(a,$);const{axes:t,curves:e,options:r}=a;$.setAxes(t),$.setCurves(e),$.setOptions(r)},"populate"),tt={parse:c(async a=>{const t=await H("radar",a);B.debug(t),Q(t)},"parse")},et=c((a,t,e,r)=>{const s=r.db,i=s.getAxes(),l=s.getCurves(),n=s.getOptions(),o=s.getConfig(),d=s.getDiagramTitle(),p=P(t),u=at(p,o),g=n.max??Math.max(...l.map(f=>Math.max(...f.entries))),h=n.min,v=Math.min(o.width,o.height)/2;rt(u,i,v,n.ticks,n.graticule),st(u,i,v,o),A(u,i,l,h,g,n.graticule,o),T(u,l,n.showLegend,o),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-o.height/2-o.marginTop)},"draw"),at=c((a,t)=>{const e=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,s={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return V(a,r,e,t.useMaxWidth??!0),a.attr("viewBox",`0 0 ${e} ${r}`).attr("overflow","visible"),a.append("g").attr("transform",`translate(${s.x}, ${s.y})`)},"drawFrame"),rt=c((a,t,e,r,s)=>{if(s==="circle")for(let i=0;i{const u=2*p*Math.PI/i-Math.PI/2,g=n*Math.cos(u),h=n*Math.sin(u);return`${g},${h}`}).join(" ");a.append("polygon").attr("points",o).attr("class","radarGraticule")}}},"drawGraticule"),st=c((a,t,e,r)=>{const s=t.length;for(let i=0;i.01?"start":o<-.01?"end":"middle",u=d>.01?"hanging":d<-.01?"auto":"central",g=4;a.append("text").text(l).attr("x",e*r.axisLabelFactor*o+g*o).attr("y",e*r.axisLabelFactor*d+g*d).attr("text-anchor",p).attr("dominant-baseline",u).attr("class","radarAxisLabel")}},"drawAxes");function A(a,t,e,r,s,i,l){const n=t.length,o=Math.min(l.width,l.height)/2;e.forEach((d,p)=>{if(d.entries.length!==n)return;const u=d.entries.map((g,h)=>{const v=2*Math.PI*h/n-Math.PI/2,f=M(g,r,s,o),S=f*Math.cos(v),O=f*Math.sin(v);return{x:S,y:O}});i==="circle"?a.append("path").attr("d",L(u,l.curveTension)).attr("class",`radarCurve-${p}`):i==="polygon"&&a.append("polygon").attr("points",u.map(g=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${p}`)})}c(A,"drawCurves");function M(a,t,e,r){const s=Math.min(Math.max(a,t),e);return r*(s-t)/(e-t)}c(M,"relativeRadius");function L(a,t){const e=a.length;let r=`M${a[0].x},${a[0].y}`;for(let s=0;s{const d=a.append("g").attr("transform",`translate(${s}, ${i+o*l})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${o}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(n.label)})}c(T,"drawLegend");var nt={draw:et},ot=c((a,t)=>{let e="";for(let r=0;r{const r=e.alternatives.map(E);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformChoice"),E=t(e=>{const r=e.elements.map(d);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),i=t(e=>{switch(e.$type){case"EbnfTerminal":return{type:"terminal",value:e.value};case"EbnfNonTerminal":return{type:"nonterminal",name:e.name};case"EbnfSpecial":return{type:"special",text:e.text};case"EbnfGroup":return s(e.element);case"EbnfOptional":return{type:"optional",element:s(e.element)};case"EbnfRepetition":return{type:"repetition",element:s(e.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${e.$type}`)}},"transformPrimary"),b=t((e,r)=>{switch(r.$type){case"EbnfOptionalPostfix":return{type:"optional",element:e};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:e,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:e,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[e,{type:"terminal",value:"-"},i(r.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${r.$type}`)}},"transformPostfix"),d=t(e=>e.postfixes.reduce((r,a)=>b(r,a),i(e.base)),"transformTerm"),y=t(e=>({name:e.name,definition:s(e.definition)}),"transformRule"),v=t(e=>{p(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(y(r)))},"populateDb"),g={parse:t(e=>{n.clear(),o.debug("[EBNF Parser] Starting Langium parse");const r=c.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const a=r.value;o.debug("[EBNF Parser] Parsed rules:",a.rules.length),v(a),o.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:n}},S={parser:g,db:n,renderer:m,styles:l};export{S as diagram}; +import{g as l,r as m,d as n}from"./chunk-MOJQB5TN-DmVMZHwQ.js";import{p}from"./chunk-JWPE2WC7-BJMJfnyy.js";import{_ as t,l as o}from"./mermaid.core-WW7RuneT.js";import{M as u,a as f}from"./cynefin-VYW2F7L2-DI-9Z5R0.js";import"./index-CiHMlsuo.js";import"./_commonjsHelpers-CqkleIqs.js";var c=f().RailroadEbnf.parser.LangiumParser,s=t(e=>{const r=e.alternatives.map(E);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformChoice"),E=t(e=>{const r=e.elements.map(d);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),i=t(e=>{switch(e.$type){case"EbnfTerminal":return{type:"terminal",value:e.value};case"EbnfNonTerminal":return{type:"nonterminal",name:e.name};case"EbnfSpecial":return{type:"special",text:e.text};case"EbnfGroup":return s(e.element);case"EbnfOptional":return{type:"optional",element:s(e.element)};case"EbnfRepetition":return{type:"repetition",element:s(e.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${e.$type}`)}},"transformPrimary"),b=t((e,r)=>{switch(r.$type){case"EbnfOptionalPostfix":return{type:"optional",element:e};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:e,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:e,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[e,{type:"terminal",value:"-"},i(r.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${r.$type}`)}},"transformPostfix"),d=t(e=>e.postfixes.reduce((r,a)=>b(r,a),i(e.base)),"transformTerm"),y=t(e=>({name:e.name,definition:s(e.definition)}),"transformRule"),v=t(e=>{p(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(y(r)))},"populateDb"),g={parse:t(e=>{n.clear(),o.debug("[EBNF Parser] Starting Langium parse");const r=c.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const a=r.value;o.debug("[EBNF Parser] Parsed rules:",a.rules.length),v(a),o.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:n}},S={parser:g,db:n,renderer:m,styles:l};export{S as diagram}; diff --git a/apps/kimi-code/dist-web/assets/erDiagram-Q63AITRT-Ca__aYfw.js b/apps/kimi-code/dist-web/assets/erDiagram-Q63AITRT-DPLVpHbv.js similarity index 99% rename from apps/kimi-code/dist-web/assets/erDiagram-Q63AITRT-Ca__aYfw.js rename to apps/kimi-code/dist-web/assets/erDiagram-Q63AITRT-DPLVpHbv.js index e54de5ab42..f55d23e837 100644 --- a/apps/kimi-code/dist-web/assets/erDiagram-Q63AITRT-Ca__aYfw.js +++ b/apps/kimi-code/dist-web/assets/erDiagram-Q63AITRT-DPLVpHbv.js @@ -1,4 +1,4 @@ -import{g as Mt}from"./chunk-XXDRQBXY-4LplLZkT.js";import{s as Bt}from"./chunk-VR4S4FIN-DW1NNlBr.js";import{_ as l,b as Ft,a as Yt,s as Pt,g as zt,n as Gt,o as Kt,c as it,l as V,p as Ut,q as Zt,r as jt,t as Wt,u as qt,v as Qt,d as Xt,x as Ht}from"./mermaid.core-CqiFQExc.js";import{c as Jt}from"./channel-B8eMh4sk.js";import"./index--0t1wzw_.js";import"./_commonjsHelpers-CqkleIqs.js";var _t=(function(){var e=l(function(I,n,c,o){for(c=c||{},o=I.length;o--;c[I[o]]=n);return c},"o"),i=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],h=[1,10],a=[1,11],u=[1,12],d=[1,13],y=[1,23],f=[1,24],m=[1,25],j=[1,26],W=[1,27],S=[1,19],q=[1,28],M=[1,29],D=[1,20],R=[1,18],T=[1,21],C=[1,22],nt=[1,36],at=[1,37],ct=[1,38],ot=[1,39],lt=[1,40],B=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,66,67,68,69,70],O=[1,45],N=[1,46],F=[1,55],Y=[40,48,50,51,52,71,72],P=[1,66],z=[1,64],A=[1,61],G=[1,65],K=[1,67],Q=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,66,67,68,69,70],gt=[66,67,68,69,70],bt=[1,85],kt=[1,84],mt=[1,82],Et=[1,83],St=[6,10,42,47],L=[6,10,13,41,42,47,48,49],X=[1,93],H=[1,92],J=[1,91],U=[19,58],Tt=[1,102],Ot=[1,101],ht=[19,58,61,63],ut={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,DECIMAL_NUM:51,ENTITY_ONE:52,attribute:53,attributeType:54,attributeName:55,attributeKeyTypeList:56,attributeComment:57,ATTRIBUTE_WORD:58,"?":59,attributeKeyType:60,",":61,ATTRIBUTE_KEY:62,COMMENT:63,cardinality:64,relType:65,ZERO_OR_ONE:66,ZERO_OR_MORE:67,ONE_OR_MORE:68,ONLY_ONE:69,MD_PARENT:70,NON_IDENTIFYING:71,IDENTIFYING:72,WORD:73,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",51:"DECIMAL_NUM",52:"ENTITY_ONE",58:"ATTRIBUTE_WORD",59:"?",61:",",62:"ATTRIBUTE_KEY",63:"COMMENT",66:"ZERO_OR_ONE",67:"ZERO_OR_MORE",68:"ONE_OR_MORE",69:"ONLY_ONE",70:"MD_PARENT",71:"NON_IDENTIFYING",72:"IDENTIFYING",73:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[54,2],[55,1],[56,1],[56,3],[60,1],[57,1],[12,3],[64,1],[64,1],[64,1],[64,1],[64,1],[65,1],[65,1],[14,1],[14,1],[14,1]],performAction:l(function(n,c,o,r,p,t,Z){var s=t.length-1;switch(p){case 1:break;case 2:this.$=[];break;case 3:t[s-1].push(t[s]),this.$=t[s-1];break;case 4:case 5:this.$=t[s];break;case 6:case 7:this.$=[];break;case 8:r.addEntity(t[s-4]),r.addEntity(t[s-2]),r.addRelationship(t[s-4],t[s],t[s-2],t[s-3]);break;case 9:r.addEntity(t[s-8]),r.addEntity(t[s-4]),r.addRelationship(t[s-8],t[s],t[s-4],t[s-5]),r.setClass([t[s-8]],t[s-6]),r.setClass([t[s-4]],t[s-2]);break;case 10:r.addEntity(t[s-6]),r.addEntity(t[s-2]),r.addRelationship(t[s-6],t[s],t[s-2],t[s-3]),r.setClass([t[s-6]],t[s-4]);break;case 11:r.addEntity(t[s-6]),r.addEntity(t[s-4]),r.addRelationship(t[s-6],t[s],t[s-4],t[s-5]),r.setClass([t[s-4]],t[s-2]);break;case 12:r.addEntity(t[s-3]),r.addAttributes(t[s-3],t[s-1]);break;case 13:r.addEntity(t[s-5]),r.addAttributes(t[s-5],t[s-1]),r.setClass([t[s-5]],t[s-3]);break;case 14:r.addEntity(t[s-2]);break;case 15:r.addEntity(t[s-4]),r.setClass([t[s-4]],t[s-2]);break;case 16:r.addEntity(t[s]);break;case 17:r.addEntity(t[s-2]),r.setClass([t[s-2]],t[s]);break;case 18:r.addEntity(t[s-6],t[s-4]),r.addAttributes(t[s-6],t[s-1]);break;case 19:r.addEntity(t[s-8],t[s-6]),r.addAttributes(t[s-8],t[s-1]),r.setClass([t[s-8]],t[s-3]);break;case 20:r.addEntity(t[s-5],t[s-3]);break;case 21:r.addEntity(t[s-7],t[s-5]),r.setClass([t[s-7]],t[s-2]);break;case 22:r.addEntity(t[s-3],t[s-1]);break;case 23:r.addEntity(t[s-5],t[s-3]),r.setClass([t[s-5]],t[s]);break;case 24:case 25:this.$=t[s].trim(),r.setAccTitle(this.$);break;case 26:case 27:this.$=t[s].trim(),r.setAccDescription(this.$);break;case 32:r.setDirection("TB");break;case 33:r.setDirection("BT");break;case 34:r.setDirection("RL");break;case 35:r.setDirection("LR");break;case 36:this.$=t[s-3],r.addClass(t[s-2],t[s-1]);break;case 37:case 38:case 59:case 68:this.$=[t[s]];break;case 39:case 40:this.$=t[s-2].concat([t[s]]);break;case 41:this.$=t[s-2],r.setClass(t[s-1],t[s]);break;case 42:this.$=t[s-3],r.addCssStyles(t[s-2],t[s-1]);break;case 43:this.$=[t[s]];break;case 44:t[s-2].push(t[s]),this.$=t[s-2];break;case 46:this.$=t[s-1]+t[s];break;case 54:case 80:case 81:this.$=t[s].replace(/"/g,"");break;case 55:case 56:case 57:case 58:case 82:this.$=t[s];break;case 60:t[s].push(t[s-1]),this.$=t[s];break;case 61:this.$={type:t[s-1],name:t[s]};break;case 62:this.$={type:t[s-2],name:t[s-1],keys:t[s]};break;case 63:this.$={type:t[s-2],name:t[s-1],comment:t[s]};break;case 64:this.$={type:t[s-3],name:t[s-2],keys:t[s-1],comment:t[s]};break;case 65:case 67:case 70:this.$=t[s];break;case 66:this.$=t[s-1]+t[s];break;case 69:t[s-2].push(t[s]),this.$=t[s-2];break;case 71:this.$=t[s].replace(/"/g,"");break;case 72:this.$={cardA:t[s],relType:t[s-1],cardB:t[s-2]};break;case 73:this.$=r.Cardinality.ZERO_OR_ONE;break;case 74:this.$=r.Cardinality.ZERO_OR_MORE;break;case 75:this.$=r.Cardinality.ONE_OR_MORE;break;case 76:this.$=r.Cardinality.ONLY_ONE;break;case 77:this.$=r.Cardinality.MD_PARENT;break;case 78:this.$=r.Identification.NON_IDENTIFYING;break;case 79:this.$=r.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},e(i,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:h,24:a,26:u,28:d,29:14,30:15,31:16,32:17,33:y,34:f,35:m,36:j,37:W,40:S,43:q,44:M,48:D,50:R,51:T,52:C},e(i,[2,7],{1:[2,1]}),e(i,[2,3]),{9:30,11:9,22:h,24:a,26:u,28:d,29:14,30:15,31:16,32:17,33:y,34:f,35:m,36:j,37:W,40:S,43:q,44:M,48:D,50:R,51:T,52:C},e(i,[2,5]),e(i,[2,6]),e(i,[2,16],{12:31,64:35,15:[1,32],17:[1,33],20:[1,34],66:nt,67:at,68:ct,69:ot,70:lt}),{23:[1,41]},{25:[1,42]},{27:[1,43]},e(i,[2,27]),e(i,[2,28]),e(i,[2,29]),e(i,[2,30]),e(i,[2,31]),e(B,[2,54]),e(B,[2,55]),e(B,[2,56]),e(B,[2,57]),e(B,[2,58]),e(i,[2,32]),e(i,[2,33]),e(i,[2,34]),e(i,[2,35]),{16:44,40:O,41:N},{16:47,40:O,41:N},{16:48,40:O,41:N},e(i,[2,4]),{11:49,40:S,48:D,50:R,51:T,52:C},{16:50,40:O,41:N},{18:51,19:[1,52],53:53,54:54,58:F},{11:56,40:S,48:D,50:R,51:T,52:C},{65:57,71:[1,58],72:[1,59]},e(Y,[2,73]),e(Y,[2,74]),e(Y,[2,75]),e(Y,[2,76]),e(Y,[2,77]),e(i,[2,24]),e(i,[2,25]),e(i,[2,26]),{13:P,38:60,41:z,42:A,45:62,46:63,48:G,49:K},e(Q,[2,37]),e(Q,[2,38]),{16:68,40:O,41:N,42:A},{13:P,38:69,41:z,42:A,45:62,46:63,48:G,49:K},{13:[1,70],15:[1,71]},e(i,[2,17],{64:35,12:72,17:[1,73],42:A,66:nt,67:at,68:ct,69:ot,70:lt}),{19:[1,74]},e(i,[2,14]),{18:75,19:[2,59],53:53,54:54,58:F},{55:76,58:[1,77]},{58:[2,65],59:[1,78]},{21:[1,79]},{64:80,66:nt,67:at,68:ct,69:ot,70:lt},e(gt,[2,78]),e(gt,[2,79]),{6:bt,10:kt,39:81,42:mt,47:Et},{40:[1,86],41:[1,87]},e(St,[2,43],{46:88,13:P,41:z,48:G,49:K}),e(L,[2,45]),e(L,[2,50]),e(L,[2,51]),e(L,[2,52]),e(L,[2,53]),e(i,[2,41],{42:A}),{6:bt,10:kt,39:89,42:mt,47:Et},{14:90,40:X,50:H,73:J},{16:94,40:O,41:N},{11:95,40:S,48:D,50:R,51:T,52:C},{18:96,19:[1,97],53:53,54:54,58:F},e(i,[2,12]),{19:[2,60]},e(U,[2,61],{56:98,57:99,60:100,62:Tt,63:Ot}),e([19,58,62,63],[2,67]),{58:[2,66]},e(i,[2,22],{15:[1,104],17:[1,103]}),e([40,48,50,51,52],[2,72]),e(i,[2,36]),{13:P,41:z,45:105,46:63,48:G,49:K},e(i,[2,47]),e(i,[2,48]),e(i,[2,49]),e(Q,[2,39]),e(Q,[2,40]),e(L,[2,46]),e(i,[2,42]),e(i,[2,8]),e(i,[2,80]),e(i,[2,81]),e(i,[2,82]),{13:[1,106],42:A},{13:[1,108],15:[1,107]},{19:[1,109]},e(i,[2,15]),e(U,[2,62],{57:110,61:[1,111],63:Ot}),e(U,[2,63]),e(ht,[2,68]),e(U,[2,71]),e(ht,[2,70]),{18:112,19:[1,113],53:53,54:54,58:F},{16:114,40:O,41:N},e(St,[2,44],{46:88,13:P,41:z,48:G,49:K}),{14:115,40:X,50:H,73:J},{16:116,40:O,41:N},{14:117,40:X,50:H,73:J},e(i,[2,13]),e(U,[2,64]),{60:118,62:Tt},{19:[1,119]},e(i,[2,20]),e(i,[2,23],{17:[1,120],42:A}),e(i,[2,11]),{13:[1,121],42:A},e(i,[2,10]),e(ht,[2,69]),e(i,[2,18]),{18:122,19:[1,123],53:53,54:54,58:F},{14:124,40:X,50:H,73:J},{19:[1,125]},e(i,[2,21]),e(i,[2,9]),e(i,[2,19])],defaultActions:{75:[2,60],78:[2,66]},parseError:l(function(n,c){if(c.recoverable)this.trace(n);else{var o=new Error(n);throw o.hash=c,o}},"parseError"),parse:l(function(n){var c=this,o=[0],r=[],p=[null],t=[],Z=this.table,s="",tt=0,Nt=0,Dt=2,At=1,Lt=t.slice.call(arguments,1),_=Object.create(this.lexer),x={yy:{}};for(var dt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,dt)&&(x.yy[dt]=this.yy[dt]);_.setInput(n,x.yy),x.yy.lexer=_,x.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var pt=_.yylloc;t.push(pt);var wt=_.options&&_.options.ranges;typeof x.yy.parseError=="function"?this.parseError=x.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Vt(b){o.length=o.length-2*b,p.length=p.length-b,t.length=t.length-b}l(Vt,"popStack");function It(){var b;return b=r.pop()||_.lex()||At,typeof b!="number"&&(b instanceof Array&&(r=b,b=r.pop()),b=c.symbols_[b]||b),b}l(It,"lex");for(var g,v,k,ft,w={},et,E,Rt,st;;){if(v=o[o.length-1],this.defaultActions[v]?k=this.defaultActions[v]:((g===null||typeof g>"u")&&(g=It()),k=Z[v]&&Z[v][g]),typeof k>"u"||!k.length||!k[0]){var yt="";st=[];for(et in Z[v])this.terminals_[et]&&et>Dt&&st.push("'"+this.terminals_[et]+"'");_.showPosition?yt="Parse error on line "+(tt+1)+`: +import{g as Mt}from"./chunk-XXDRQBXY-D_bv9kM4.js";import{s as Bt}from"./chunk-VR4S4FIN-C_RujyXt.js";import{_ as l,b as Ft,a as Yt,s as Pt,g as zt,n as Gt,o as Kt,c as it,l as V,p as Ut,q as Zt,r as jt,t as Wt,u as qt,v as Qt,d as Xt,x as Ht}from"./mermaid.core-WW7RuneT.js";import{c as Jt}from"./channel-8Bt6a0tz.js";import"./index-CiHMlsuo.js";import"./_commonjsHelpers-CqkleIqs.js";var _t=(function(){var e=l(function(I,n,c,o){for(c=c||{},o=I.length;o--;c[I[o]]=n);return c},"o"),i=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],h=[1,10],a=[1,11],u=[1,12],d=[1,13],y=[1,23],f=[1,24],m=[1,25],j=[1,26],W=[1,27],S=[1,19],q=[1,28],M=[1,29],D=[1,20],R=[1,18],T=[1,21],C=[1,22],nt=[1,36],at=[1,37],ct=[1,38],ot=[1,39],lt=[1,40],B=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,66,67,68,69,70],O=[1,45],N=[1,46],F=[1,55],Y=[40,48,50,51,52,71,72],P=[1,66],z=[1,64],A=[1,61],G=[1,65],K=[1,67],Q=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,66,67,68,69,70],gt=[66,67,68,69,70],bt=[1,85],kt=[1,84],mt=[1,82],Et=[1,83],St=[6,10,42,47],L=[6,10,13,41,42,47,48,49],X=[1,93],H=[1,92],J=[1,91],U=[19,58],Tt=[1,102],Ot=[1,101],ht=[19,58,61,63],ut={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,DECIMAL_NUM:51,ENTITY_ONE:52,attribute:53,attributeType:54,attributeName:55,attributeKeyTypeList:56,attributeComment:57,ATTRIBUTE_WORD:58,"?":59,attributeKeyType:60,",":61,ATTRIBUTE_KEY:62,COMMENT:63,cardinality:64,relType:65,ZERO_OR_ONE:66,ZERO_OR_MORE:67,ONE_OR_MORE:68,ONLY_ONE:69,MD_PARENT:70,NON_IDENTIFYING:71,IDENTIFYING:72,WORD:73,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",51:"DECIMAL_NUM",52:"ENTITY_ONE",58:"ATTRIBUTE_WORD",59:"?",61:",",62:"ATTRIBUTE_KEY",63:"COMMENT",66:"ZERO_OR_ONE",67:"ZERO_OR_MORE",68:"ONE_OR_MORE",69:"ONLY_ONE",70:"MD_PARENT",71:"NON_IDENTIFYING",72:"IDENTIFYING",73:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[54,2],[55,1],[56,1],[56,3],[60,1],[57,1],[12,3],[64,1],[64,1],[64,1],[64,1],[64,1],[65,1],[65,1],[14,1],[14,1],[14,1]],performAction:l(function(n,c,o,r,p,t,Z){var s=t.length-1;switch(p){case 1:break;case 2:this.$=[];break;case 3:t[s-1].push(t[s]),this.$=t[s-1];break;case 4:case 5:this.$=t[s];break;case 6:case 7:this.$=[];break;case 8:r.addEntity(t[s-4]),r.addEntity(t[s-2]),r.addRelationship(t[s-4],t[s],t[s-2],t[s-3]);break;case 9:r.addEntity(t[s-8]),r.addEntity(t[s-4]),r.addRelationship(t[s-8],t[s],t[s-4],t[s-5]),r.setClass([t[s-8]],t[s-6]),r.setClass([t[s-4]],t[s-2]);break;case 10:r.addEntity(t[s-6]),r.addEntity(t[s-2]),r.addRelationship(t[s-6],t[s],t[s-2],t[s-3]),r.setClass([t[s-6]],t[s-4]);break;case 11:r.addEntity(t[s-6]),r.addEntity(t[s-4]),r.addRelationship(t[s-6],t[s],t[s-4],t[s-5]),r.setClass([t[s-4]],t[s-2]);break;case 12:r.addEntity(t[s-3]),r.addAttributes(t[s-3],t[s-1]);break;case 13:r.addEntity(t[s-5]),r.addAttributes(t[s-5],t[s-1]),r.setClass([t[s-5]],t[s-3]);break;case 14:r.addEntity(t[s-2]);break;case 15:r.addEntity(t[s-4]),r.setClass([t[s-4]],t[s-2]);break;case 16:r.addEntity(t[s]);break;case 17:r.addEntity(t[s-2]),r.setClass([t[s-2]],t[s]);break;case 18:r.addEntity(t[s-6],t[s-4]),r.addAttributes(t[s-6],t[s-1]);break;case 19:r.addEntity(t[s-8],t[s-6]),r.addAttributes(t[s-8],t[s-1]),r.setClass([t[s-8]],t[s-3]);break;case 20:r.addEntity(t[s-5],t[s-3]);break;case 21:r.addEntity(t[s-7],t[s-5]),r.setClass([t[s-7]],t[s-2]);break;case 22:r.addEntity(t[s-3],t[s-1]);break;case 23:r.addEntity(t[s-5],t[s-3]),r.setClass([t[s-5]],t[s]);break;case 24:case 25:this.$=t[s].trim(),r.setAccTitle(this.$);break;case 26:case 27:this.$=t[s].trim(),r.setAccDescription(this.$);break;case 32:r.setDirection("TB");break;case 33:r.setDirection("BT");break;case 34:r.setDirection("RL");break;case 35:r.setDirection("LR");break;case 36:this.$=t[s-3],r.addClass(t[s-2],t[s-1]);break;case 37:case 38:case 59:case 68:this.$=[t[s]];break;case 39:case 40:this.$=t[s-2].concat([t[s]]);break;case 41:this.$=t[s-2],r.setClass(t[s-1],t[s]);break;case 42:this.$=t[s-3],r.addCssStyles(t[s-2],t[s-1]);break;case 43:this.$=[t[s]];break;case 44:t[s-2].push(t[s]),this.$=t[s-2];break;case 46:this.$=t[s-1]+t[s];break;case 54:case 80:case 81:this.$=t[s].replace(/"/g,"");break;case 55:case 56:case 57:case 58:case 82:this.$=t[s];break;case 60:t[s].push(t[s-1]),this.$=t[s];break;case 61:this.$={type:t[s-1],name:t[s]};break;case 62:this.$={type:t[s-2],name:t[s-1],keys:t[s]};break;case 63:this.$={type:t[s-2],name:t[s-1],comment:t[s]};break;case 64:this.$={type:t[s-3],name:t[s-2],keys:t[s-1],comment:t[s]};break;case 65:case 67:case 70:this.$=t[s];break;case 66:this.$=t[s-1]+t[s];break;case 69:t[s-2].push(t[s]),this.$=t[s-2];break;case 71:this.$=t[s].replace(/"/g,"");break;case 72:this.$={cardA:t[s],relType:t[s-1],cardB:t[s-2]};break;case 73:this.$=r.Cardinality.ZERO_OR_ONE;break;case 74:this.$=r.Cardinality.ZERO_OR_MORE;break;case 75:this.$=r.Cardinality.ONE_OR_MORE;break;case 76:this.$=r.Cardinality.ONLY_ONE;break;case 77:this.$=r.Cardinality.MD_PARENT;break;case 78:this.$=r.Identification.NON_IDENTIFYING;break;case 79:this.$=r.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},e(i,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:h,24:a,26:u,28:d,29:14,30:15,31:16,32:17,33:y,34:f,35:m,36:j,37:W,40:S,43:q,44:M,48:D,50:R,51:T,52:C},e(i,[2,7],{1:[2,1]}),e(i,[2,3]),{9:30,11:9,22:h,24:a,26:u,28:d,29:14,30:15,31:16,32:17,33:y,34:f,35:m,36:j,37:W,40:S,43:q,44:M,48:D,50:R,51:T,52:C},e(i,[2,5]),e(i,[2,6]),e(i,[2,16],{12:31,64:35,15:[1,32],17:[1,33],20:[1,34],66:nt,67:at,68:ct,69:ot,70:lt}),{23:[1,41]},{25:[1,42]},{27:[1,43]},e(i,[2,27]),e(i,[2,28]),e(i,[2,29]),e(i,[2,30]),e(i,[2,31]),e(B,[2,54]),e(B,[2,55]),e(B,[2,56]),e(B,[2,57]),e(B,[2,58]),e(i,[2,32]),e(i,[2,33]),e(i,[2,34]),e(i,[2,35]),{16:44,40:O,41:N},{16:47,40:O,41:N},{16:48,40:O,41:N},e(i,[2,4]),{11:49,40:S,48:D,50:R,51:T,52:C},{16:50,40:O,41:N},{18:51,19:[1,52],53:53,54:54,58:F},{11:56,40:S,48:D,50:R,51:T,52:C},{65:57,71:[1,58],72:[1,59]},e(Y,[2,73]),e(Y,[2,74]),e(Y,[2,75]),e(Y,[2,76]),e(Y,[2,77]),e(i,[2,24]),e(i,[2,25]),e(i,[2,26]),{13:P,38:60,41:z,42:A,45:62,46:63,48:G,49:K},e(Q,[2,37]),e(Q,[2,38]),{16:68,40:O,41:N,42:A},{13:P,38:69,41:z,42:A,45:62,46:63,48:G,49:K},{13:[1,70],15:[1,71]},e(i,[2,17],{64:35,12:72,17:[1,73],42:A,66:nt,67:at,68:ct,69:ot,70:lt}),{19:[1,74]},e(i,[2,14]),{18:75,19:[2,59],53:53,54:54,58:F},{55:76,58:[1,77]},{58:[2,65],59:[1,78]},{21:[1,79]},{64:80,66:nt,67:at,68:ct,69:ot,70:lt},e(gt,[2,78]),e(gt,[2,79]),{6:bt,10:kt,39:81,42:mt,47:Et},{40:[1,86],41:[1,87]},e(St,[2,43],{46:88,13:P,41:z,48:G,49:K}),e(L,[2,45]),e(L,[2,50]),e(L,[2,51]),e(L,[2,52]),e(L,[2,53]),e(i,[2,41],{42:A}),{6:bt,10:kt,39:89,42:mt,47:Et},{14:90,40:X,50:H,73:J},{16:94,40:O,41:N},{11:95,40:S,48:D,50:R,51:T,52:C},{18:96,19:[1,97],53:53,54:54,58:F},e(i,[2,12]),{19:[2,60]},e(U,[2,61],{56:98,57:99,60:100,62:Tt,63:Ot}),e([19,58,62,63],[2,67]),{58:[2,66]},e(i,[2,22],{15:[1,104],17:[1,103]}),e([40,48,50,51,52],[2,72]),e(i,[2,36]),{13:P,41:z,45:105,46:63,48:G,49:K},e(i,[2,47]),e(i,[2,48]),e(i,[2,49]),e(Q,[2,39]),e(Q,[2,40]),e(L,[2,46]),e(i,[2,42]),e(i,[2,8]),e(i,[2,80]),e(i,[2,81]),e(i,[2,82]),{13:[1,106],42:A},{13:[1,108],15:[1,107]},{19:[1,109]},e(i,[2,15]),e(U,[2,62],{57:110,61:[1,111],63:Ot}),e(U,[2,63]),e(ht,[2,68]),e(U,[2,71]),e(ht,[2,70]),{18:112,19:[1,113],53:53,54:54,58:F},{16:114,40:O,41:N},e(St,[2,44],{46:88,13:P,41:z,48:G,49:K}),{14:115,40:X,50:H,73:J},{16:116,40:O,41:N},{14:117,40:X,50:H,73:J},e(i,[2,13]),e(U,[2,64]),{60:118,62:Tt},{19:[1,119]},e(i,[2,20]),e(i,[2,23],{17:[1,120],42:A}),e(i,[2,11]),{13:[1,121],42:A},e(i,[2,10]),e(ht,[2,69]),e(i,[2,18]),{18:122,19:[1,123],53:53,54:54,58:F},{14:124,40:X,50:H,73:J},{19:[1,125]},e(i,[2,21]),e(i,[2,9]),e(i,[2,19])],defaultActions:{75:[2,60],78:[2,66]},parseError:l(function(n,c){if(c.recoverable)this.trace(n);else{var o=new Error(n);throw o.hash=c,o}},"parseError"),parse:l(function(n){var c=this,o=[0],r=[],p=[null],t=[],Z=this.table,s="",tt=0,Nt=0,Dt=2,At=1,Lt=t.slice.call(arguments,1),_=Object.create(this.lexer),x={yy:{}};for(var dt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,dt)&&(x.yy[dt]=this.yy[dt]);_.setInput(n,x.yy),x.yy.lexer=_,x.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var pt=_.yylloc;t.push(pt);var wt=_.options&&_.options.ranges;typeof x.yy.parseError=="function"?this.parseError=x.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Vt(b){o.length=o.length-2*b,p.length=p.length-b,t.length=t.length-b}l(Vt,"popStack");function It(){var b;return b=r.pop()||_.lex()||At,typeof b!="number"&&(b instanceof Array&&(r=b,b=r.pop()),b=c.symbols_[b]||b),b}l(It,"lex");for(var g,v,k,ft,w={},et,E,Rt,st;;){if(v=o[o.length-1],this.defaultActions[v]?k=this.defaultActions[v]:((g===null||typeof g>"u")&&(g=It()),k=Z[v]&&Z[v][g]),typeof k>"u"||!k.length||!k[0]){var yt="";st=[];for(et in Z[v])this.terminals_[et]&&et>Dt&&st.push("'"+this.terminals_[et]+"'");_.showPosition?yt="Parse error on line "+(tt+1)+`: `+_.showPosition()+` Expecting `+st.join(", ")+", got '"+(this.terminals_[g]||g)+"'":yt="Parse error on line "+(tt+1)+": Unexpected "+(g==At?"end of input":"'"+(this.terminals_[g]||g)+"'"),this.parseError(yt,{text:_.match,token:this.terminals_[g]||g,line:_.yylineno,loc:pt,expected:st})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+g);switch(k[0]){case 1:o.push(g),p.push(_.yytext),t.push(_.yylloc),o.push(k[1]),g=null,Nt=_.yyleng,s=_.yytext,tt=_.yylineno,pt=_.yylloc;break;case 2:if(E=this.productions_[k[1]][1],w.$=p[p.length-E],w._$={first_line:t[t.length-(E||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(E||1)].first_column,last_column:t[t.length-1].last_column},wt&&(w._$.range=[t[t.length-(E||1)].range[0],t[t.length-1].range[1]]),ft=this.performAction.apply(w,[s,Nt,tt,x.yy,k[1],p,t].concat(Lt)),typeof ft<"u")return ft;E&&(o=o.slice(0,-1*E*2),p=p.slice(0,-1*E),t=t.slice(0,-1*E)),o.push(this.productions_[k[1]][0]),p.push(w.$),t.push(w._$),Rt=Z[o[o.length-2]][o[o.length-1]],o.push(Rt);break;case 3:return!0}}return!0},"parse")},vt=(function(){var I={EOF:1,parseError:l(function(c,o){if(this.yy.parser)this.yy.parser.parseError(c,o);else throw new Error(c)},"parseError"),setInput:l(function(n,c){return this.yy=c||this.yy||{},this._input=n,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:l(function(){var n=this._input[0];this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n;var c=n.match(/(?:\r\n?|\n).*/g);return c?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),n},"input"),unput:l(function(n){var c=n.length,o=n.split(/(?:\r\n?|\n)/g);this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-c),this.offset-=c;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),o.length-1&&(this.yylineno-=o.length-1);var p=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:o?(o.length===r.length?this.yylloc.first_column:0)+r[r.length-o.length].length-o[0].length:this.yylloc.first_column-c},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-c]),this.yyleng=this.yytext.length,this},"unput"),more:l(function(){return this._more=!0,this},"more"),reject:l(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:l(function(n){this.unput(this.match.slice(n))},"less"),pastInput:l(function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:l(function(){var n=this.match;return n.length<20&&(n+=this._input.substr(0,20-n.length)),(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:l(function(){var n=this.pastInput(),c=new Array(n.length+1).join("-");return n+this.upcomingInput()+` diff --git a/apps/kimi-code/dist-web/assets/flowDiagram-23GEKE2U-CW0gFw60.js b/apps/kimi-code/dist-web/assets/flowDiagram-23GEKE2U-eOlMNTnl.js similarity index 99% rename from apps/kimi-code/dist-web/assets/flowDiagram-23GEKE2U-CW0gFw60.js rename to apps/kimi-code/dist-web/assets/flowDiagram-23GEKE2U-eOlMNTnl.js index fe5a8776b9..2f19e73a9b 100644 --- a/apps/kimi-code/dist-web/assets/flowDiagram-23GEKE2U-CW0gFw60.js +++ b/apps/kimi-code/dist-web/assets/flowDiagram-23GEKE2U-eOlMNTnl.js @@ -1,4 +1,4 @@ -import{g as He}from"./chunk-5VM5RSS4-BRWxG5tM.js";import{g as Xe}from"./chunk-XXDRQBXY-4LplLZkT.js";import{s as Qe}from"./chunk-VR4S4FIN-DW1NNlBr.js";import{_ as b,b6 as Je,F as Oe,l as J,c as g1,u as Ze,v as $e,x as ie,b as et,s as tt,n as st,a as it,g as rt,o as at,k as nt,G as ut,J as ot,bo as lt,q as te,d as se,a5 as ct,p as ht,b8 as dt,r as pt}from"./mermaid.core-CqiFQExc.js";import{f as ft}from"./chunk-32BRIVSS-mfMW4-bV.js";import{c as gt}from"./channel-B8eMh4sk.js";var bt="flowchart-",At=class{constructor(){this.vertexCounter=0,this.config=g1(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=et,this.setAccDescription=tt,this.setDiagramTitle=st,this.getAccTitle=it,this.getAccDescription=rt,this.getDiagramTitle=at,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{b(this,"FlowDB")}sanitizeText(e){return nt.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(const i of this.vertices.values())if(i.id===e)return this.diagramId?`${this.diagramId}-${i.domId}`:i.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,i,r,a,o,d,l={},A){if(!e||e.trim().length===0)return;let n;if(A!==void 0){let k;A.includes(` +import{g as He}from"./chunk-5VM5RSS4-BJR-VYAu.js";import{g as Xe}from"./chunk-XXDRQBXY-D_bv9kM4.js";import{s as Qe}from"./chunk-VR4S4FIN-C_RujyXt.js";import{_ as b,b6 as Je,F as Oe,l as J,c as g1,u as Ze,v as $e,x as ie,b as et,s as tt,n as st,a as it,g as rt,o as at,k as nt,G as ut,J as ot,bo as lt,q as te,d as se,a5 as ct,p as ht,b8 as dt,r as pt}from"./mermaid.core-WW7RuneT.js";import{f as ft}from"./chunk-32BRIVSS-CRTrWqUr.js";import{c as gt}from"./channel-8Bt6a0tz.js";var bt="flowchart-",At=class{constructor(){this.vertexCounter=0,this.config=g1(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=et,this.setAccDescription=tt,this.setDiagramTitle=st,this.getAccTitle=it,this.getAccDescription=rt,this.getDiagramTitle=at,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{b(this,"FlowDB")}sanitizeText(e){return nt.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(const i of this.vertices.values())if(i.id===e)return this.diagramId?`${this.diagramId}-${i.domId}`:i.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,i,r,a,o,d,l={},A){if(!e||e.trim().length===0)return;let n;if(A!==void 0){let k;A.includes(` `)?k=A+` `:k=`{ `+A+` diff --git a/apps/kimi-code/dist-web/assets/ganttDiagram-NO4QXBWP-BA6Xg4gl.js b/apps/kimi-code/dist-web/assets/ganttDiagram-NO4QXBWP-D1u5oYVA.js similarity index 99% rename from apps/kimi-code/dist-web/assets/ganttDiagram-NO4QXBWP-BA6Xg4gl.js rename to apps/kimi-code/dist-web/assets/ganttDiagram-NO4QXBWP-D1u5oYVA.js index 9e17ad561d..93a9f28759 100644 --- a/apps/kimi-code/dist-web/assets/ganttDiagram-NO4QXBWP-BA6Xg4gl.js +++ b/apps/kimi-code/dist-web/assets/ganttDiagram-NO4QXBWP-D1u5oYVA.js @@ -1,4 +1,4 @@ -import{bg as on,bh as On,bi as cn,bj as un,bk as ln,bl as ue,bm as Hn,g as Nn,s as Pn,o as Vn,n as Rn,a as zn,b as qn,_ as d,c as Yt,d as Zt,e as Bn,bn as it,l as Tt,k as Zn,j as Xn,p as Gn,x as jn}from"./mermaid.core-CqiFQExc.js";import{g as oe}from"./_commonjsHelpers-CqkleIqs.js";import{b as Qn,t as Ne,c as Jn,a as Kn,l as tr}from"./linear-DLj646oc.js";import{i as er}from"./init-Gi6I4Gst.js";import"./index--0t1wzw_.js";import"./defaultLocale-DX6XiGOO.js";function nr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n=i)&&(n=i)}return n}function rr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function ir(t){return t}var Gt=1,le=2,xe=3,Xt=4,Pe=1e-6;function sr(t){return"translate("+t+",0)"}function ar(t){return"translate(0,"+t+")"}function or(t){return e=>+t(e)}function cr(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function ur(){return!this.__axis}function fn(t,e){var n=[],r=null,i=null,s=6,a=6,y=3,F=typeof window<"u"&&window.devicePixelRatio>1?0:.5,S=t===Gt||t===Xt?-1:1,w=t===Xt||t===le?"x":"y",P=t===Gt||t===xe?sr:ar;function _(Y){var X=r??(e.ticks?e.ticks.apply(e,n):e.domain()),B=i??(e.tickFormat?e.tickFormat.apply(e,n):ir),v=Math.max(s,0)+y,U=e.range(),R=+U[0]+F,E=+U[U.length-1]+F,z=(e.bandwidth?cr:or)(e.copy(),F),G=Y.selection?Y.selection():Y,T=G.selectAll(".domain").data([null]),k=G.selectAll(".tick").data(X,e).order(),p=k.exit(),L=k.enter().append("g").attr("class","tick"),x=k.select("line"),C=k.select("text");T=T.merge(T.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),k=k.merge(L),x=x.merge(L.append("line").attr("stroke","currentColor").attr(w+"2",S*s)),C=C.merge(L.append("text").attr("fill","currentColor").attr(w,S*v).attr("dy",t===Gt?"0em":t===xe?"0.71em":"0.32em")),Y!==G&&(T=T.transition(Y),k=k.transition(Y),x=x.transition(Y),C=C.transition(Y),p=p.transition(Y).attr("opacity",Pe).attr("transform",function(M){return isFinite(M=z(M))?P(M+F):this.getAttribute("transform")}),L.attr("opacity",Pe).attr("transform",function(M){var D=this.parentNode.__axis;return P((D&&isFinite(D=D(M))?D:z(M))+F)})),p.remove(),T.attr("d",t===Xt||t===le?a?"M"+S*a+","+R+"H"+F+"V"+E+"H"+S*a:"M"+F+","+R+"V"+E:a?"M"+R+","+S*a+"V"+F+"H"+E+"V"+S*a:"M"+R+","+F+"H"+E),k.attr("opacity",1).attr("transform",function(M){return P(z(M)+F)}),x.attr(w+"2",S*s),C.attr(w,S*v).text(B),G.filter(ur).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===le?"start":t===Xt?"end":"middle"),G.each(function(){this.__axis=z})}return _.scale=function(Y){return arguments.length?(e=Y,_):e},_.ticks=function(){return n=Array.from(arguments),_},_.tickArguments=function(Y){return arguments.length?(n=Y==null?[]:Array.from(Y),_):n.slice()},_.tickValues=function(Y){return arguments.length?(r=Y==null?null:Array.from(Y),_):r&&r.slice()},_.tickFormat=function(Y){return arguments.length?(i=Y,_):i},_.tickSize=function(Y){return arguments.length?(s=a=+Y,_):s},_.tickSizeInner=function(Y){return arguments.length?(s=+Y,_):s},_.tickSizeOuter=function(Y){return arguments.length?(a=+Y,_):a},_.tickPadding=function(Y){return arguments.length?(y=+Y,_):y},_.offset=function(Y){return arguments.length?(F=+Y,_):F},_}function lr(t){return fn(Gt,t)}function fr(t){return fn(xe,t)}const dr=Math.PI/180,hr=180/Math.PI,ne=18,dn=.96422,hn=1,mn=.82521,gn=4/29,Ft=6/29,yn=3*Ft*Ft,mr=Ft*Ft*Ft;function kn(t){if(t instanceof ft)return new ft(t.l,t.a,t.b,t.opacity);if(t instanceof ht)return pn(t);t instanceof on||(t=On(t));var e=me(t.r),n=me(t.g),r=me(t.b),i=fe((.2225045*e+.7168786*n+.0606169*r)/hn),s,a;return e===n&&n===r?s=a=i:(s=fe((.4360747*e+.3850649*n+.1430804*r)/dn),a=fe((.0139322*e+.0971045*n+.7141733*r)/mn)),new ft(116*i-16,500*(s-i),200*(i-a),t.opacity)}function gr(t,e,n,r){return arguments.length===1?kn(t):new ft(t,e,n,r??1)}function ft(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}cn(ft,gr,un(ln,{brighter(t){return new ft(this.l+ne*(t??1),this.a,this.b,this.opacity)},darker(t){return new ft(this.l-ne*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=dn*de(e),t=hn*de(t),n=mn*de(n),new on(he(3.1338561*e-1.6168667*t-.4906146*n),he(-.9787684*e+1.9161415*t+.033454*n),he(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function fe(t){return t>mr?Math.pow(t,1/3):t/yn+gn}function de(t){return t>Ft?t*t*t:yn*(t-gn)}function he(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function me(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function yr(t){if(t instanceof ht)return new ht(t.h,t.c,t.l,t.opacity);if(t instanceof ft||(t=kn(t)),t.a===0&&t.b===0)return new ht(NaN,0(t(s=new Date(+s)),s),i.ceil=s=>(t(s=new Date(s-1)),e(s,1),t(s),s),i.round=s=>{const a=i(s),y=i.ceil(s);return s-a(e(s=new Date(+s),a==null?1:Math.floor(a)),s),i.range=(s,a,y)=>{const F=[];if(s=i.ceil(s),y=y==null?1:Math.floor(y),!(s0))return F;let S;do F.push(S=new Date(+s)),e(s,y),t(s);while(Snt(a=>{if(a>=a)for(;t(a),!s(a);)a.setTime(a-1)},(a,y)=>{if(a>=a)if(y<0)for(;++y<=0;)for(;e(a,-1),!s(a););else for(;--y>=0;)for(;e(a,1),!s(a););}),n&&(i.count=(s,a)=>(ge.setTime(+s),ye.setTime(+a),t(ge),t(ye),Math.floor(n(ge,ye))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?a=>r(a)%s===0:a=>i.count(0,a)%s===0):i)),i}const Et=nt(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Et.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?nt(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):Et);Et.range;const mt=1e3,ct=mt*60,gt=ct*60,yt=gt*24,Se=yt*7,Ve=yt*30,ke=yt*365,vt=nt(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*mt)},(t,e)=>(e-t)/mt,t=>t.getUTCSeconds());vt.range;const Nt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getMinutes());Nt.range;const Tr=nt(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getUTCMinutes());Tr.range;const Pt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt-t.getMinutes()*ct)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getHours());Pt.range;const xr=nt(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getUTCHours());xr.range;const xt=nt(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ct)/yt,t=>t.getDate()-1);xt.range;const _e=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>t.getUTCDate()-1);_e.range;const br=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>Math.floor(t/yt));br.range;function Dt(t){return nt(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*ct)/Se)}const zt=Dt(0),Vt=Dt(1),vn=Dt(2),Tn=Dt(3),bt=Dt(4),xn=Dt(5),bn=Dt(6);zt.range;Vt.range;vn.range;Tn.range;bt.range;xn.range;bn.range;function Mt(t){return nt(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/Se)}const wn=Mt(0),re=Mt(1),wr=Mt(2),Dr=Mt(3),It=Mt(4),Mr=Mt(5),Cr=Mt(6);wn.range;re.range;wr.range;Dr.range;It.range;Mr.range;Cr.range;const Rt=nt(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());Rt.range;const Sr=nt(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());Sr.range;const kt=nt(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());kt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});kt.range;const wt=nt(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());wt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});wt.range;function _r(t,e,n,r,i,s){const a=[[vt,1,mt],[vt,5,5*mt],[vt,15,15*mt],[vt,30,30*mt],[s,1,ct],[s,5,5*ct],[s,15,15*ct],[s,30,30*ct],[i,1,gt],[i,3,3*gt],[i,6,6*gt],[i,12,12*gt],[r,1,yt],[r,2,2*yt],[n,1,Se],[e,1,Ve],[e,3,3*Ve],[t,1,ke]];function y(S,w,P){const _=wv).right(a,_);if(Y===a.length)return t.every(Ne(S/ke,w/ke,P));if(Y===0)return Et.every(Math.max(Ne(S,w,P),1));const[X,B]=a[_/a[Y-1][2]53)return null;"w"in f||(f.w=1),"Z"in f?(A=ve($t(f.y,0,1)),Q=A.getUTCDay(),A=Q>4||Q===0?re.ceil(A):re(A),A=_e.offset(A,(f.V-1)*7),f.y=A.getUTCFullYear(),f.m=A.getUTCMonth(),f.d=A.getUTCDate()+(f.w+6)%7):(A=pe($t(f.y,0,1)),Q=A.getDay(),A=Q>4||Q===0?Vt.ceil(A):Vt(A),A=xt.offset(A,(f.V-1)*7),f.y=A.getFullYear(),f.m=A.getMonth(),f.d=A.getDate()+(f.w+6)%7)}else("W"in f||"U"in f)&&("w"in f||(f.w="u"in f?f.u%7:"W"in f?1:0),Q="Z"in f?ve($t(f.y,0,1)).getUTCDay():pe($t(f.y,0,1)).getDay(),f.m=0,f.d="W"in f?(f.w+6)%7+f.W*7-(Q+5)%7:f.w+f.U*7-(Q+6)%7);return"Z"in f?(f.H+=f.Z/100|0,f.M+=f.Z%100,ve(f)):pe(f)}}function p(h,N,V,f){for(var tt=0,A=N.length,Q=V.length,Z,st;tt=Q)return-1;if(Z=N.charCodeAt(tt++),Z===37){if(Z=N.charAt(tt++),st=G[Z in Re?N.charAt(tt++):Z],!st||(f=st(h,V,f))<0)return-1}else if(Z!=V.charCodeAt(f++))return-1}return f}function L(h,N,V){var f=S.exec(N.slice(V));return f?(h.p=w.get(f[0].toLowerCase()),V+f[0].length):-1}function x(h,N,V){var f=Y.exec(N.slice(V));return f?(h.w=X.get(f[0].toLowerCase()),V+f[0].length):-1}function C(h,N,V){var f=P.exec(N.slice(V));return f?(h.w=_.get(f[0].toLowerCase()),V+f[0].length):-1}function M(h,N,V){var f=U.exec(N.slice(V));return f?(h.m=R.get(f[0].toLowerCase()),V+f[0].length):-1}function D(h,N,V){var f=B.exec(N.slice(V));return f?(h.m=v.get(f[0].toLowerCase()),V+f[0].length):-1}function c(h,N,V){return p(h,e,N,V)}function g(h,N,V){return p(h,n,N,V)}function b(h,N,V){return p(h,r,N,V)}function m(h){return a[h.getDay()]}function I(h){return s[h.getDay()]}function o(h){return F[h.getMonth()]}function W(h){return y[h.getMonth()]}function u(h){return i[+(h.getHours()>=12)]}function K(h){return 1+~~(h.getMonth()/3)}function l(h){return a[h.getUTCDay()]}function $(h){return s[h.getUTCDay()]}function O(h){return F[h.getUTCMonth()]}function j(h){return y[h.getUTCMonth()]}function H(h){return i[+(h.getUTCHours()>=12)]}function J(h){return 1+~~(h.getUTCMonth()/3)}return{format:function(h){var N=T(h+="",E);return N.toString=function(){return h},N},parse:function(h){var N=k(h+="",!1);return N.toString=function(){return h},N},utcFormat:function(h){var N=T(h+="",z);return N.toString=function(){return h},N},utcParse:function(h){var N=k(h+="",!0);return N.toString=function(){return h},N}}}var Re={"-":"",_:" ",0:"0"},rt=/^\s*\d+/,Er=/^%/,Ir=/[\\^$*+?|[\]().{}]/g;function q(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",s=i.length;return r+(s[e.toLowerCase(),n]))}function Ar(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function Wr(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function $r(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function Or(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function Hr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function ze(t,e,n){var r=rt.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function qe(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Nr(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Pr(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function Vr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function Be(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function Rr(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function Ze(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function zr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function qr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function Br(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function Zr(t,e,n){var r=rt.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Xr(t,e,n){var r=Er.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function Gr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function jr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function Xe(t,e){return q(t.getDate(),e,2)}function Qr(t,e){return q(t.getHours(),e,2)}function Jr(t,e){return q(t.getHours()%12||12,e,2)}function Kr(t,e){return q(1+xt.count(kt(t),t),e,3)}function Dn(t,e){return q(t.getMilliseconds(),e,3)}function ti(t,e){return Dn(t,e)+"000"}function ei(t,e){return q(t.getMonth()+1,e,2)}function ni(t,e){return q(t.getMinutes(),e,2)}function ri(t,e){return q(t.getSeconds(),e,2)}function ii(t){var e=t.getDay();return e===0?7:e}function si(t,e){return q(zt.count(kt(t)-1,t),e,2)}function Mn(t){var e=t.getDay();return e>=4||e===0?bt(t):bt.ceil(t)}function ai(t,e){return t=Mn(t),q(bt.count(kt(t),t)+(kt(t).getDay()===4),e,2)}function oi(t){return t.getDay()}function ci(t,e){return q(Vt.count(kt(t)-1,t),e,2)}function ui(t,e){return q(t.getFullYear()%100,e,2)}function li(t,e){return t=Mn(t),q(t.getFullYear()%100,e,2)}function fi(t,e){return q(t.getFullYear()%1e4,e,4)}function di(t,e){var n=t.getDay();return t=n>=4||n===0?bt(t):bt.ceil(t),q(t.getFullYear()%1e4,e,4)}function hi(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+q(e/60|0,"0",2)+q(e%60,"0",2)}function Ge(t,e){return q(t.getUTCDate(),e,2)}function mi(t,e){return q(t.getUTCHours(),e,2)}function gi(t,e){return q(t.getUTCHours()%12||12,e,2)}function yi(t,e){return q(1+_e.count(wt(t),t),e,3)}function Cn(t,e){return q(t.getUTCMilliseconds(),e,3)}function ki(t,e){return Cn(t,e)+"000"}function pi(t,e){return q(t.getUTCMonth()+1,e,2)}function vi(t,e){return q(t.getUTCMinutes(),e,2)}function Ti(t,e){return q(t.getUTCSeconds(),e,2)}function xi(t){var e=t.getUTCDay();return e===0?7:e}function bi(t,e){return q(wn.count(wt(t)-1,t),e,2)}function Sn(t){var e=t.getUTCDay();return e>=4||e===0?It(t):It.ceil(t)}function wi(t,e){return t=Sn(t),q(It.count(wt(t),t)+(wt(t).getUTCDay()===4),e,2)}function Di(t){return t.getUTCDay()}function Mi(t,e){return q(re.count(wt(t)-1,t),e,2)}function Ci(t,e){return q(t.getUTCFullYear()%100,e,2)}function Si(t,e){return t=Sn(t),q(t.getUTCFullYear()%100,e,2)}function _i(t,e){return q(t.getUTCFullYear()%1e4,e,4)}function Yi(t,e){var n=t.getUTCDay();return t=n>=4||n===0?It(t):It.ceil(t),q(t.getUTCFullYear()%1e4,e,4)}function Fi(){return"+0000"}function je(){return"%"}function Qe(t){return+t}function Je(t){return Math.floor(+t/1e3)}var St,ie;Ui({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Ui(t){return St=Ur(t),ie=St.format,St.parse,St.utcFormat,St.utcParse,St}function Ei(t){return new Date(t)}function Ii(t){return t instanceof Date?+t:+new Date(+t)}function _n(t,e,n,r,i,s,a,y,F,S){var w=Jn(),P=w.invert,_=w.domain,Y=S(".%L"),X=S(":%S"),B=S("%I:%M"),v=S("%I %p"),U=S("%a %d"),R=S("%b %d"),E=S("%B"),z=S("%Y");function G(T){return(F(T)4&&(Y+=7),_.add(Y,n));return X.diff(B,"week")+1},y.isoWeekday=function(S){return this.$utils().u(S)?this.day()||7:this.day(this.day()%7?S:S-7)};var F=y.startOf;y.startOf=function(S,w){var P=this.$utils(),_=!!P.u(w)||w;return P.p(S)==="isoweek"?_?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):F.bind(this)(S,w)}}}))})(jt)),jt.exports}var $i=Wi();const Oi=oe($i);var Qt={exports:{}},Hi=Qt.exports,tn;function Ni(){return tn||(tn=1,(function(t,e){(function(n,r){t.exports=r()})(Hi,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,s=/\d\d/,a=/\d\d?/,y=/\d*[^-_:/,()\s\d]+/,F={},S=function(v){return(v=+v)+(v>68?1900:2e3)},w=function(v){return function(U){this[v]=+U}},P=[/[+-]\d\d:?(\d\d)?|Z/,function(v){(this.zone||(this.zone={})).offset=(function(U){if(!U||U==="Z")return 0;var R=U.match(/([+-]|\d\d)/g),E=60*R[1]+(+R[2]||0);return E===0?0:R[0]==="+"?-E:E})(v)}],_=function(v){var U=F[v];return U&&(U.indexOf?U:U.s.concat(U.f))},Y=function(v,U){var R,E=F.meridiem;if(E){for(var z=1;z<=24;z+=1)if(v.indexOf(E(z,0,U))>-1){R=z>12;break}}else R=v===(U?"pm":"PM");return R},X={A:[y,function(v){this.afternoon=Y(v,!1)}],a:[y,function(v){this.afternoon=Y(v,!0)}],Q:[i,function(v){this.month=3*(v-1)+1}],S:[i,function(v){this.milliseconds=100*+v}],SS:[s,function(v){this.milliseconds=10*+v}],SSS:[/\d{3}/,function(v){this.milliseconds=+v}],s:[a,w("seconds")],ss:[a,w("seconds")],m:[a,w("minutes")],mm:[a,w("minutes")],H:[a,w("hours")],h:[a,w("hours")],HH:[a,w("hours")],hh:[a,w("hours")],D:[a,w("day")],DD:[s,w("day")],Do:[y,function(v){var U=F.ordinal,R=v.match(/\d+/);if(this.day=R[0],U)for(var E=1;E<=31;E+=1)U(E).replace(/\[|\]/g,"")===v&&(this.day=E)}],w:[a,w("week")],ww:[s,w("week")],M:[a,w("month")],MM:[s,w("month")],MMM:[y,function(v){var U=_("months"),R=(_("monthsShort")||U.map((function(E){return E.slice(0,3)}))).indexOf(v)+1;if(R<1)throw new Error;this.month=R%12||R}],MMMM:[y,function(v){var U=_("months").indexOf(v)+1;if(U<1)throw new Error;this.month=U%12||U}],Y:[/[+-]?\d+/,w("year")],YY:[s,function(v){this.year=S(v)}],YYYY:[/\d{4}/,w("year")],Z:P,ZZ:P};function B(v){var U,R;U=v,R=F&&F.formats;for(var E=(v=U.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(x,C,M){var D=M&&M.toUpperCase();return C||R[M]||n[M]||R[D].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(c,g,b){return g||b.slice(1)}))}))).match(r),z=E.length,G=0;G-1)return new Date((I==="X"?1e3:1)*m);var u=B(I)(m),K=u.year,l=u.month,$=u.day,O=u.hours,j=u.minutes,H=u.seconds,J=u.milliseconds,h=u.zone,N=u.week,V=new Date,f=$||(K||l?1:V.getDate()),tt=K||V.getFullYear(),A=0;K&&!l||(A=l>0?l-1:V.getMonth());var Q,Z=O||0,st=j||0,at=H||0,pt=J||0;return h?new Date(Date.UTC(tt,A,f,Z,st,at,pt+60*h.offset*1e3)):o?new Date(Date.UTC(tt,A,f,Z,st,at,pt)):(Q=new Date(tt,A,f,Z,st,at,pt),N&&(Q=W(Q).week(N).toDate()),Q)}catch{return new Date("")}})(T,L,k,R),this.init(),D&&D!==!0&&(this.$L=this.locale(D).$L),M&&T!=this.format(L)&&(this.$d=new Date("")),F={}}else if(L instanceof Array)for(var c=L.length,g=1;g<=c;g+=1){p[1]=L[g-1];var b=R.apply(this,p);if(b.isValid()){this.$d=b.$d,this.$L=b.$L,this.init();break}g===c&&(this.$d=new Date(""))}else z.call(this,G)}}}))})(Qt)),Qt.exports}var Pi=Ni();const Vi=oe(Pi);var Jt={exports:{}},Ri=Jt.exports,en;function zi(){return en||(en=1,(function(t,e){(function(n,r){t.exports=r()})(Ri,(function(){return function(n,r){var i=r.prototype,s=i.format;i.format=function(a){var y=this,F=this.$locale();if(!this.isValid())return s.bind(this)(a);var S=this.$utils(),w=(a||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(P){switch(P){case"Q":return Math.ceil((y.$M+1)/3);case"Do":return F.ordinal(y.$D);case"gggg":return y.weekYear();case"GGGG":return y.isoWeekYear();case"wo":return F.ordinal(y.week(),"W");case"w":case"ww":return S.s(y.week(),P==="w"?1:2,"0");case"W":case"WW":return S.s(y.isoWeek(),P==="W"?1:2,"0");case"k":case"kk":return S.s(String(y.$H===0?24:y.$H),P==="k"?1:2,"0");case"X":return Math.floor(y.$d.getTime()/1e3);case"x":return y.$d.getTime();case"z":return"["+y.offsetName()+"]";case"zzz":return"["+y.offsetName("long")+"]";default:return P}}));return s.bind(this)(w)}}}))})(Jt)),Jt.exports}var qi=zi();const Bi=oe(qi);var Kt={exports:{}},Zi=Kt.exports,nn;function Xi(){return nn||(nn=1,(function(t,e){(function(n,r){t.exports=r()})(Zi,(function(){var n,r,i=1e3,s=6e4,a=36e5,y=864e5,F=31536e6,S=2628e6,w=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,P=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,_={years:F,months:S,days:y,hours:a,minutes:s,seconds:i,milliseconds:1,weeks:6048e5},Y=function(T){return T instanceof z},X=function(T,k,p){return new z(T,p,k.$l)},B=function(T){return r.p(T)+"s"},v=function(T){return T<0},U=function(T){return v(T)?Math.ceil(T):Math.floor(T)},R=function(T){return Math.abs(T)},E=function(T,k){return T?v(T)?{negative:!0,format:""+R(T)+k}:{negative:!1,format:""+T+k}:{negative:!1,format:""}},z=(function(){function T(p,L,x){var C=this;if(this.$d={},this.$l=x,p===void 0&&(this.$ms=0,this.parseFromMilliseconds()),L)return X(p*_[B(L)],this);if(typeof p=="number")return this.$ms=p,this.parseFromMilliseconds(),this;if(typeof p=="object")return Object.keys(p).forEach((function(c){C.$d[B(c)]=p[c]})),this.calMilliseconds(),this;if(typeof p=="string"){var M=p.match(w);if(M){var D=M.slice(2).map((function(c){return c!=null?Number(c):0}));return this.$d.years=D[0],this.$d.months=D[1],this.$d.weeks=D[2],this.$d.days=D[3],this.$d.hours=D[4],this.$d.minutes=D[5],this.$d.seconds=D[6],this.calMilliseconds(),this}}return this}var k=T.prototype;return k.calMilliseconds=function(){var p=this;this.$ms=Object.keys(this.$d).reduce((function(L,x){return L+(p.$d[x]||0)*_[x]}),0)},k.parseFromMilliseconds=function(){var p=this.$ms;this.$d.years=U(p/F),p%=F,this.$d.months=U(p/S),p%=S,this.$d.days=U(p/y),p%=y,this.$d.hours=U(p/a),p%=a,this.$d.minutes=U(p/s),p%=s,this.$d.seconds=U(p/i),p%=i,this.$d.milliseconds=p},k.toISOString=function(){var p=E(this.$d.years,"Y"),L=E(this.$d.months,"M"),x=+this.$d.days||0;this.$d.weeks&&(x+=7*this.$d.weeks);var C=E(x,"D"),M=E(this.$d.hours,"H"),D=E(this.$d.minutes,"M"),c=this.$d.seconds||0;this.$d.milliseconds&&(c+=this.$d.milliseconds/1e3,c=Math.round(1e3*c)/1e3);var g=E(c,"S"),b=p.negative||L.negative||C.negative||M.negative||D.negative||g.negative,m=M.format||D.format||g.format?"T":"",I=(b?"-":"")+"P"+p.format+L.format+C.format+m+M.format+D.format+g.format;return I==="P"||I==="-P"?"P0D":I},k.toJSON=function(){return this.toISOString()},k.format=function(p){var L=p||"YYYY-MM-DDTHH:mm:ss",x={Y:this.$d.years,YY:r.s(this.$d.years,2,"0"),YYYY:r.s(this.$d.years,4,"0"),M:this.$d.months,MM:r.s(this.$d.months,2,"0"),D:this.$d.days,DD:r.s(this.$d.days,2,"0"),H:this.$d.hours,HH:r.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:r.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:r.s(this.$d.seconds,2,"0"),SSS:r.s(this.$d.milliseconds,3,"0")};return L.replace(P,(function(C,M){return M||String(x[C])}))},k.as=function(p){return this.$ms/_[B(p)]},k.get=function(p){var L=this.$ms,x=B(p);return x==="milliseconds"?L%=1e3:L=x==="weeks"?U(L/_[x]):this.$d[x],L||0},k.add=function(p,L,x){var C;return C=L?p*_[B(L)]:Y(p)?p.$ms:X(p,this).$ms,X(this.$ms+C*(x?-1:1),this)},k.subtract=function(p,L){return this.add(p,L,!0)},k.locale=function(p){var L=this.clone();return L.$l=p,L},k.clone=function(){return X(this.$ms,this)},k.humanize=function(p){return n().add(this.$ms,"ms").locale(this.$l).fromNow(!p)},k.valueOf=function(){return this.asMilliseconds()},k.milliseconds=function(){return this.get("milliseconds")},k.asMilliseconds=function(){return this.as("milliseconds")},k.seconds=function(){return this.get("seconds")},k.asSeconds=function(){return this.as("seconds")},k.minutes=function(){return this.get("minutes")},k.asMinutes=function(){return this.as("minutes")},k.hours=function(){return this.get("hours")},k.asHours=function(){return this.as("hours")},k.days=function(){return this.get("days")},k.asDays=function(){return this.as("days")},k.weeks=function(){return this.get("weeks")},k.asWeeks=function(){return this.as("weeks")},k.months=function(){return this.get("months")},k.asMonths=function(){return this.as("months")},k.years=function(){return this.get("years")},k.asYears=function(){return this.as("years")},T})(),G=function(T,k,p){return T.add(k.years()*p,"y").add(k.months()*p,"M").add(k.days()*p,"d").add(k.hours()*p,"h").add(k.minutes()*p,"m").add(k.seconds()*p,"s").add(k.milliseconds()*p,"ms")};return function(T,k,p){n=p,r=p().$utils(),p.duration=function(C,M){var D=p.locale();return X(C,{$l:D},M)},p.isDuration=Y;var L=k.prototype.add,x=k.prototype.subtract;k.prototype.add=function(C,M){return Y(C)?G(this,C,1):L.bind(this)(C,M)},k.prototype.subtract=function(C,M){return Y(C)?G(this,C,-1):x.bind(this)(C,M)}}}))})(Kt)),Kt.exports}var Gi=Xi();const ji=oe(Gi);var we=(function(){var t=d(function(D,c,g,b){for(g=g||{},b=D.length;b--;g[D[b]]=c);return g},"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],n=[1,26],r=[1,27],i=[1,28],s=[1,29],a=[1,30],y=[1,31],F=[1,32],S=[1,33],w=[1,34],P=[1,9],_=[1,10],Y=[1,11],X=[1,12],B=[1,13],v=[1,14],U=[1,15],R=[1,16],E=[1,19],z=[1,20],G=[1,21],T=[1,22],k=[1,23],p=[1,25],L=[1,35],x={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:d(function(c,g,b,m,I,o,W){var u=o.length-1;switch(I){case 1:return o[u-1];case 2:this.$=[];break;case 3:o[u-1].push(o[u]),this.$=o[u-1];break;case 4:case 5:this.$=o[u];break;case 6:case 7:this.$=[];break;case 8:m.setWeekday("monday");break;case 9:m.setWeekday("tuesday");break;case 10:m.setWeekday("wednesday");break;case 11:m.setWeekday("thursday");break;case 12:m.setWeekday("friday");break;case 13:m.setWeekday("saturday");break;case 14:m.setWeekday("sunday");break;case 15:m.setWeekend("friday");break;case 16:m.setWeekend("saturday");break;case 17:m.setDateFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 18:m.enableInclusiveEndDates(),this.$=o[u].substr(18);break;case 19:m.TopAxis(),this.$=o[u].substr(8);break;case 20:m.setAxisFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 21:m.setTickInterval(o[u].substr(13)),this.$=o[u].substr(13);break;case 22:m.setExcludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 23:m.setIncludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 24:m.setTodayMarker(o[u].substr(12)),this.$=o[u].substr(12);break;case 27:m.setDiagramTitle(o[u].substr(6)),this.$=o[u].substr(6);break;case 28:this.$=o[u].trim(),m.setAccTitle(this.$);break;case 29:case 30:this.$=o[u].trim(),m.setAccDescription(this.$);break;case 31:m.addSection(o[u].substr(8)),this.$=o[u].substr(8);break;case 33:m.addTask(o[u-1],o[u]),this.$="task";break;case 34:this.$=o[u-1],m.setClickEvent(o[u-1],o[u],null);break;case 35:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],o[u]);break;case 36:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],null),m.setLink(o[u-2],o[u]);break;case 37:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-2],o[u-1]),m.setLink(o[u-3],o[u]);break;case 38:this.$=o[u-2],m.setClickEvent(o[u-2],o[u],null),m.setLink(o[u-2],o[u-1]);break;case 39:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-1],o[u]),m.setLink(o[u-3],o[u-2]);break;case 40:this.$=o[u-1],m.setLink(o[u-1],o[u]);break;case 41:case 47:this.$=o[u-1]+" "+o[u];break;case 42:case 43:case 45:this.$=o[u-2]+" "+o[u-1]+" "+o[u];break;case 44:case 46:this.$=o[u-3]+" "+o[u-2]+" "+o[u-1]+" "+o[u];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:S,21:w,22:P,23:_,24:Y,25:X,26:B,27:v,28:U,29:R,30:E,31:z,33:G,35:T,36:k,37:24,38:p,40:L},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:S,21:w,22:P,23:_,24:Y,25:X,26:B,27:v,28:U,29:R,30:E,31:z,33:G,35:T,36:k,37:24,38:p,40:L},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:d(function(c,g){if(g.recoverable)this.trace(c);else{var b=new Error(c);throw b.hash=g,b}},"parseError"),parse:d(function(c){var g=this,b=[0],m=[],I=[null],o=[],W=this.table,u="",K=0,l=0,$=2,O=1,j=o.slice.call(arguments,1),H=Object.create(this.lexer),J={yy:{}};for(var h in this.yy)Object.prototype.hasOwnProperty.call(this.yy,h)&&(J.yy[h]=this.yy[h]);H.setInput(c,J.yy),J.yy.lexer=H,J.yy.parser=this,typeof H.yylloc>"u"&&(H.yylloc={});var N=H.yylloc;o.push(N);var V=H.options&&H.options.ranges;typeof J.yy.parseError=="function"?this.parseError=J.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function f(ot){b.length=b.length-2*ot,I.length=I.length-ot,o.length=o.length-ot}d(f,"popStack");function tt(){var ot;return ot=m.pop()||H.lex()||O,typeof ot!="number"&&(ot instanceof Array&&(m=ot,ot=m.pop()),ot=g.symbols_[ot]||ot),ot}d(tt,"lex");for(var A,Q,Z,st,at={},pt,ut,He,Bt;;){if(Q=b[b.length-1],this.defaultActions[Q]?Z=this.defaultActions[Q]:((A===null||typeof A>"u")&&(A=tt()),Z=W[Q]&&W[Q][A]),typeof Z>"u"||!Z.length||!Z[0]){var ce="";Bt=[];for(pt in W[Q])this.terminals_[pt]&&pt>$&&Bt.push("'"+this.terminals_[pt]+"'");H.showPosition?ce="Parse error on line "+(K+1)+`: +import{bg as on,bh as On,bi as cn,bj as un,bk as ln,bl as ue,bm as Hn,g as Nn,s as Pn,o as Vn,n as Rn,a as zn,b as qn,_ as d,c as Yt,d as Zt,e as Bn,bn as it,l as Tt,k as Zn,j as Xn,p as Gn,x as jn}from"./mermaid.core-WW7RuneT.js";import{g as oe}from"./_commonjsHelpers-CqkleIqs.js";import{b as Qn,t as Ne,c as Jn,a as Kn,l as tr}from"./linear-UIDPGx_K.js";import{i as er}from"./init-Gi6I4Gst.js";import"./index-CiHMlsuo.js";import"./defaultLocale-DX6XiGOO.js";function nr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n=i)&&(n=i)}return n}function rr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function ir(t){return t}var Gt=1,le=2,xe=3,Xt=4,Pe=1e-6;function sr(t){return"translate("+t+",0)"}function ar(t){return"translate(0,"+t+")"}function or(t){return e=>+t(e)}function cr(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function ur(){return!this.__axis}function fn(t,e){var n=[],r=null,i=null,s=6,a=6,y=3,F=typeof window<"u"&&window.devicePixelRatio>1?0:.5,S=t===Gt||t===Xt?-1:1,w=t===Xt||t===le?"x":"y",P=t===Gt||t===xe?sr:ar;function _(Y){var X=r??(e.ticks?e.ticks.apply(e,n):e.domain()),B=i??(e.tickFormat?e.tickFormat.apply(e,n):ir),v=Math.max(s,0)+y,U=e.range(),R=+U[0]+F,E=+U[U.length-1]+F,z=(e.bandwidth?cr:or)(e.copy(),F),G=Y.selection?Y.selection():Y,T=G.selectAll(".domain").data([null]),k=G.selectAll(".tick").data(X,e).order(),p=k.exit(),L=k.enter().append("g").attr("class","tick"),x=k.select("line"),C=k.select("text");T=T.merge(T.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),k=k.merge(L),x=x.merge(L.append("line").attr("stroke","currentColor").attr(w+"2",S*s)),C=C.merge(L.append("text").attr("fill","currentColor").attr(w,S*v).attr("dy",t===Gt?"0em":t===xe?"0.71em":"0.32em")),Y!==G&&(T=T.transition(Y),k=k.transition(Y),x=x.transition(Y),C=C.transition(Y),p=p.transition(Y).attr("opacity",Pe).attr("transform",function(M){return isFinite(M=z(M))?P(M+F):this.getAttribute("transform")}),L.attr("opacity",Pe).attr("transform",function(M){var D=this.parentNode.__axis;return P((D&&isFinite(D=D(M))?D:z(M))+F)})),p.remove(),T.attr("d",t===Xt||t===le?a?"M"+S*a+","+R+"H"+F+"V"+E+"H"+S*a:"M"+F+","+R+"V"+E:a?"M"+R+","+S*a+"V"+F+"H"+E+"V"+S*a:"M"+R+","+F+"H"+E),k.attr("opacity",1).attr("transform",function(M){return P(z(M)+F)}),x.attr(w+"2",S*s),C.attr(w,S*v).text(B),G.filter(ur).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===le?"start":t===Xt?"end":"middle"),G.each(function(){this.__axis=z})}return _.scale=function(Y){return arguments.length?(e=Y,_):e},_.ticks=function(){return n=Array.from(arguments),_},_.tickArguments=function(Y){return arguments.length?(n=Y==null?[]:Array.from(Y),_):n.slice()},_.tickValues=function(Y){return arguments.length?(r=Y==null?null:Array.from(Y),_):r&&r.slice()},_.tickFormat=function(Y){return arguments.length?(i=Y,_):i},_.tickSize=function(Y){return arguments.length?(s=a=+Y,_):s},_.tickSizeInner=function(Y){return arguments.length?(s=+Y,_):s},_.tickSizeOuter=function(Y){return arguments.length?(a=+Y,_):a},_.tickPadding=function(Y){return arguments.length?(y=+Y,_):y},_.offset=function(Y){return arguments.length?(F=+Y,_):F},_}function lr(t){return fn(Gt,t)}function fr(t){return fn(xe,t)}const dr=Math.PI/180,hr=180/Math.PI,ne=18,dn=.96422,hn=1,mn=.82521,gn=4/29,Ft=6/29,yn=3*Ft*Ft,mr=Ft*Ft*Ft;function kn(t){if(t instanceof ft)return new ft(t.l,t.a,t.b,t.opacity);if(t instanceof ht)return pn(t);t instanceof on||(t=On(t));var e=me(t.r),n=me(t.g),r=me(t.b),i=fe((.2225045*e+.7168786*n+.0606169*r)/hn),s,a;return e===n&&n===r?s=a=i:(s=fe((.4360747*e+.3850649*n+.1430804*r)/dn),a=fe((.0139322*e+.0971045*n+.7141733*r)/mn)),new ft(116*i-16,500*(s-i),200*(i-a),t.opacity)}function gr(t,e,n,r){return arguments.length===1?kn(t):new ft(t,e,n,r??1)}function ft(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}cn(ft,gr,un(ln,{brighter(t){return new ft(this.l+ne*(t??1),this.a,this.b,this.opacity)},darker(t){return new ft(this.l-ne*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=dn*de(e),t=hn*de(t),n=mn*de(n),new on(he(3.1338561*e-1.6168667*t-.4906146*n),he(-.9787684*e+1.9161415*t+.033454*n),he(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function fe(t){return t>mr?Math.pow(t,1/3):t/yn+gn}function de(t){return t>Ft?t*t*t:yn*(t-gn)}function he(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function me(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function yr(t){if(t instanceof ht)return new ht(t.h,t.c,t.l,t.opacity);if(t instanceof ft||(t=kn(t)),t.a===0&&t.b===0)return new ht(NaN,0(t(s=new Date(+s)),s),i.ceil=s=>(t(s=new Date(s-1)),e(s,1),t(s),s),i.round=s=>{const a=i(s),y=i.ceil(s);return s-a(e(s=new Date(+s),a==null?1:Math.floor(a)),s),i.range=(s,a,y)=>{const F=[];if(s=i.ceil(s),y=y==null?1:Math.floor(y),!(s0))return F;let S;do F.push(S=new Date(+s)),e(s,y),t(s);while(Snt(a=>{if(a>=a)for(;t(a),!s(a);)a.setTime(a-1)},(a,y)=>{if(a>=a)if(y<0)for(;++y<=0;)for(;e(a,-1),!s(a););else for(;--y>=0;)for(;e(a,1),!s(a););}),n&&(i.count=(s,a)=>(ge.setTime(+s),ye.setTime(+a),t(ge),t(ye),Math.floor(n(ge,ye))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?a=>r(a)%s===0:a=>i.count(0,a)%s===0):i)),i}const Et=nt(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Et.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?nt(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):Et);Et.range;const mt=1e3,ct=mt*60,gt=ct*60,yt=gt*24,Se=yt*7,Ve=yt*30,ke=yt*365,vt=nt(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*mt)},(t,e)=>(e-t)/mt,t=>t.getUTCSeconds());vt.range;const Nt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getMinutes());Nt.range;const Tr=nt(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getUTCMinutes());Tr.range;const Pt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt-t.getMinutes()*ct)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getHours());Pt.range;const xr=nt(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getUTCHours());xr.range;const xt=nt(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ct)/yt,t=>t.getDate()-1);xt.range;const _e=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>t.getUTCDate()-1);_e.range;const br=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>Math.floor(t/yt));br.range;function Dt(t){return nt(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*ct)/Se)}const zt=Dt(0),Vt=Dt(1),vn=Dt(2),Tn=Dt(3),bt=Dt(4),xn=Dt(5),bn=Dt(6);zt.range;Vt.range;vn.range;Tn.range;bt.range;xn.range;bn.range;function Mt(t){return nt(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/Se)}const wn=Mt(0),re=Mt(1),wr=Mt(2),Dr=Mt(3),It=Mt(4),Mr=Mt(5),Cr=Mt(6);wn.range;re.range;wr.range;Dr.range;It.range;Mr.range;Cr.range;const Rt=nt(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());Rt.range;const Sr=nt(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());Sr.range;const kt=nt(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());kt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});kt.range;const wt=nt(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());wt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});wt.range;function _r(t,e,n,r,i,s){const a=[[vt,1,mt],[vt,5,5*mt],[vt,15,15*mt],[vt,30,30*mt],[s,1,ct],[s,5,5*ct],[s,15,15*ct],[s,30,30*ct],[i,1,gt],[i,3,3*gt],[i,6,6*gt],[i,12,12*gt],[r,1,yt],[r,2,2*yt],[n,1,Se],[e,1,Ve],[e,3,3*Ve],[t,1,ke]];function y(S,w,P){const _=wv).right(a,_);if(Y===a.length)return t.every(Ne(S/ke,w/ke,P));if(Y===0)return Et.every(Math.max(Ne(S,w,P),1));const[X,B]=a[_/a[Y-1][2]53)return null;"w"in f||(f.w=1),"Z"in f?(A=ve($t(f.y,0,1)),Q=A.getUTCDay(),A=Q>4||Q===0?re.ceil(A):re(A),A=_e.offset(A,(f.V-1)*7),f.y=A.getUTCFullYear(),f.m=A.getUTCMonth(),f.d=A.getUTCDate()+(f.w+6)%7):(A=pe($t(f.y,0,1)),Q=A.getDay(),A=Q>4||Q===0?Vt.ceil(A):Vt(A),A=xt.offset(A,(f.V-1)*7),f.y=A.getFullYear(),f.m=A.getMonth(),f.d=A.getDate()+(f.w+6)%7)}else("W"in f||"U"in f)&&("w"in f||(f.w="u"in f?f.u%7:"W"in f?1:0),Q="Z"in f?ve($t(f.y,0,1)).getUTCDay():pe($t(f.y,0,1)).getDay(),f.m=0,f.d="W"in f?(f.w+6)%7+f.W*7-(Q+5)%7:f.w+f.U*7-(Q+6)%7);return"Z"in f?(f.H+=f.Z/100|0,f.M+=f.Z%100,ve(f)):pe(f)}}function p(h,N,V,f){for(var tt=0,A=N.length,Q=V.length,Z,st;tt=Q)return-1;if(Z=N.charCodeAt(tt++),Z===37){if(Z=N.charAt(tt++),st=G[Z in Re?N.charAt(tt++):Z],!st||(f=st(h,V,f))<0)return-1}else if(Z!=V.charCodeAt(f++))return-1}return f}function L(h,N,V){var f=S.exec(N.slice(V));return f?(h.p=w.get(f[0].toLowerCase()),V+f[0].length):-1}function x(h,N,V){var f=Y.exec(N.slice(V));return f?(h.w=X.get(f[0].toLowerCase()),V+f[0].length):-1}function C(h,N,V){var f=P.exec(N.slice(V));return f?(h.w=_.get(f[0].toLowerCase()),V+f[0].length):-1}function M(h,N,V){var f=U.exec(N.slice(V));return f?(h.m=R.get(f[0].toLowerCase()),V+f[0].length):-1}function D(h,N,V){var f=B.exec(N.slice(V));return f?(h.m=v.get(f[0].toLowerCase()),V+f[0].length):-1}function c(h,N,V){return p(h,e,N,V)}function g(h,N,V){return p(h,n,N,V)}function b(h,N,V){return p(h,r,N,V)}function m(h){return a[h.getDay()]}function I(h){return s[h.getDay()]}function o(h){return F[h.getMonth()]}function W(h){return y[h.getMonth()]}function u(h){return i[+(h.getHours()>=12)]}function K(h){return 1+~~(h.getMonth()/3)}function l(h){return a[h.getUTCDay()]}function $(h){return s[h.getUTCDay()]}function O(h){return F[h.getUTCMonth()]}function j(h){return y[h.getUTCMonth()]}function H(h){return i[+(h.getUTCHours()>=12)]}function J(h){return 1+~~(h.getUTCMonth()/3)}return{format:function(h){var N=T(h+="",E);return N.toString=function(){return h},N},parse:function(h){var N=k(h+="",!1);return N.toString=function(){return h},N},utcFormat:function(h){var N=T(h+="",z);return N.toString=function(){return h},N},utcParse:function(h){var N=k(h+="",!0);return N.toString=function(){return h},N}}}var Re={"-":"",_:" ",0:"0"},rt=/^\s*\d+/,Er=/^%/,Ir=/[\\^$*+?|[\]().{}]/g;function q(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",s=i.length;return r+(s[e.toLowerCase(),n]))}function Ar(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function Wr(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function $r(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function Or(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function Hr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function ze(t,e,n){var r=rt.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function qe(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Nr(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Pr(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function Vr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function Be(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function Rr(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function Ze(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function zr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function qr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function Br(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function Zr(t,e,n){var r=rt.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Xr(t,e,n){var r=Er.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function Gr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function jr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function Xe(t,e){return q(t.getDate(),e,2)}function Qr(t,e){return q(t.getHours(),e,2)}function Jr(t,e){return q(t.getHours()%12||12,e,2)}function Kr(t,e){return q(1+xt.count(kt(t),t),e,3)}function Dn(t,e){return q(t.getMilliseconds(),e,3)}function ti(t,e){return Dn(t,e)+"000"}function ei(t,e){return q(t.getMonth()+1,e,2)}function ni(t,e){return q(t.getMinutes(),e,2)}function ri(t,e){return q(t.getSeconds(),e,2)}function ii(t){var e=t.getDay();return e===0?7:e}function si(t,e){return q(zt.count(kt(t)-1,t),e,2)}function Mn(t){var e=t.getDay();return e>=4||e===0?bt(t):bt.ceil(t)}function ai(t,e){return t=Mn(t),q(bt.count(kt(t),t)+(kt(t).getDay()===4),e,2)}function oi(t){return t.getDay()}function ci(t,e){return q(Vt.count(kt(t)-1,t),e,2)}function ui(t,e){return q(t.getFullYear()%100,e,2)}function li(t,e){return t=Mn(t),q(t.getFullYear()%100,e,2)}function fi(t,e){return q(t.getFullYear()%1e4,e,4)}function di(t,e){var n=t.getDay();return t=n>=4||n===0?bt(t):bt.ceil(t),q(t.getFullYear()%1e4,e,4)}function hi(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+q(e/60|0,"0",2)+q(e%60,"0",2)}function Ge(t,e){return q(t.getUTCDate(),e,2)}function mi(t,e){return q(t.getUTCHours(),e,2)}function gi(t,e){return q(t.getUTCHours()%12||12,e,2)}function yi(t,e){return q(1+_e.count(wt(t),t),e,3)}function Cn(t,e){return q(t.getUTCMilliseconds(),e,3)}function ki(t,e){return Cn(t,e)+"000"}function pi(t,e){return q(t.getUTCMonth()+1,e,2)}function vi(t,e){return q(t.getUTCMinutes(),e,2)}function Ti(t,e){return q(t.getUTCSeconds(),e,2)}function xi(t){var e=t.getUTCDay();return e===0?7:e}function bi(t,e){return q(wn.count(wt(t)-1,t),e,2)}function Sn(t){var e=t.getUTCDay();return e>=4||e===0?It(t):It.ceil(t)}function wi(t,e){return t=Sn(t),q(It.count(wt(t),t)+(wt(t).getUTCDay()===4),e,2)}function Di(t){return t.getUTCDay()}function Mi(t,e){return q(re.count(wt(t)-1,t),e,2)}function Ci(t,e){return q(t.getUTCFullYear()%100,e,2)}function Si(t,e){return t=Sn(t),q(t.getUTCFullYear()%100,e,2)}function _i(t,e){return q(t.getUTCFullYear()%1e4,e,4)}function Yi(t,e){var n=t.getUTCDay();return t=n>=4||n===0?It(t):It.ceil(t),q(t.getUTCFullYear()%1e4,e,4)}function Fi(){return"+0000"}function je(){return"%"}function Qe(t){return+t}function Je(t){return Math.floor(+t/1e3)}var St,ie;Ui({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Ui(t){return St=Ur(t),ie=St.format,St.parse,St.utcFormat,St.utcParse,St}function Ei(t){return new Date(t)}function Ii(t){return t instanceof Date?+t:+new Date(+t)}function _n(t,e,n,r,i,s,a,y,F,S){var w=Jn(),P=w.invert,_=w.domain,Y=S(".%L"),X=S(":%S"),B=S("%I:%M"),v=S("%I %p"),U=S("%a %d"),R=S("%b %d"),E=S("%B"),z=S("%Y");function G(T){return(F(T)4&&(Y+=7),_.add(Y,n));return X.diff(B,"week")+1},y.isoWeekday=function(S){return this.$utils().u(S)?this.day()||7:this.day(this.day()%7?S:S-7)};var F=y.startOf;y.startOf=function(S,w){var P=this.$utils(),_=!!P.u(w)||w;return P.p(S)==="isoweek"?_?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):F.bind(this)(S,w)}}}))})(jt)),jt.exports}var $i=Wi();const Oi=oe($i);var Qt={exports:{}},Hi=Qt.exports,tn;function Ni(){return tn||(tn=1,(function(t,e){(function(n,r){t.exports=r()})(Hi,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,s=/\d\d/,a=/\d\d?/,y=/\d*[^-_:/,()\s\d]+/,F={},S=function(v){return(v=+v)+(v>68?1900:2e3)},w=function(v){return function(U){this[v]=+U}},P=[/[+-]\d\d:?(\d\d)?|Z/,function(v){(this.zone||(this.zone={})).offset=(function(U){if(!U||U==="Z")return 0;var R=U.match(/([+-]|\d\d)/g),E=60*R[1]+(+R[2]||0);return E===0?0:R[0]==="+"?-E:E})(v)}],_=function(v){var U=F[v];return U&&(U.indexOf?U:U.s.concat(U.f))},Y=function(v,U){var R,E=F.meridiem;if(E){for(var z=1;z<=24;z+=1)if(v.indexOf(E(z,0,U))>-1){R=z>12;break}}else R=v===(U?"pm":"PM");return R},X={A:[y,function(v){this.afternoon=Y(v,!1)}],a:[y,function(v){this.afternoon=Y(v,!0)}],Q:[i,function(v){this.month=3*(v-1)+1}],S:[i,function(v){this.milliseconds=100*+v}],SS:[s,function(v){this.milliseconds=10*+v}],SSS:[/\d{3}/,function(v){this.milliseconds=+v}],s:[a,w("seconds")],ss:[a,w("seconds")],m:[a,w("minutes")],mm:[a,w("minutes")],H:[a,w("hours")],h:[a,w("hours")],HH:[a,w("hours")],hh:[a,w("hours")],D:[a,w("day")],DD:[s,w("day")],Do:[y,function(v){var U=F.ordinal,R=v.match(/\d+/);if(this.day=R[0],U)for(var E=1;E<=31;E+=1)U(E).replace(/\[|\]/g,"")===v&&(this.day=E)}],w:[a,w("week")],ww:[s,w("week")],M:[a,w("month")],MM:[s,w("month")],MMM:[y,function(v){var U=_("months"),R=(_("monthsShort")||U.map((function(E){return E.slice(0,3)}))).indexOf(v)+1;if(R<1)throw new Error;this.month=R%12||R}],MMMM:[y,function(v){var U=_("months").indexOf(v)+1;if(U<1)throw new Error;this.month=U%12||U}],Y:[/[+-]?\d+/,w("year")],YY:[s,function(v){this.year=S(v)}],YYYY:[/\d{4}/,w("year")],Z:P,ZZ:P};function B(v){var U,R;U=v,R=F&&F.formats;for(var E=(v=U.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(x,C,M){var D=M&&M.toUpperCase();return C||R[M]||n[M]||R[D].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(c,g,b){return g||b.slice(1)}))}))).match(r),z=E.length,G=0;G-1)return new Date((I==="X"?1e3:1)*m);var u=B(I)(m),K=u.year,l=u.month,$=u.day,O=u.hours,j=u.minutes,H=u.seconds,J=u.milliseconds,h=u.zone,N=u.week,V=new Date,f=$||(K||l?1:V.getDate()),tt=K||V.getFullYear(),A=0;K&&!l||(A=l>0?l-1:V.getMonth());var Q,Z=O||0,st=j||0,at=H||0,pt=J||0;return h?new Date(Date.UTC(tt,A,f,Z,st,at,pt+60*h.offset*1e3)):o?new Date(Date.UTC(tt,A,f,Z,st,at,pt)):(Q=new Date(tt,A,f,Z,st,at,pt),N&&(Q=W(Q).week(N).toDate()),Q)}catch{return new Date("")}})(T,L,k,R),this.init(),D&&D!==!0&&(this.$L=this.locale(D).$L),M&&T!=this.format(L)&&(this.$d=new Date("")),F={}}else if(L instanceof Array)for(var c=L.length,g=1;g<=c;g+=1){p[1]=L[g-1];var b=R.apply(this,p);if(b.isValid()){this.$d=b.$d,this.$L=b.$L,this.init();break}g===c&&(this.$d=new Date(""))}else z.call(this,G)}}}))})(Qt)),Qt.exports}var Pi=Ni();const Vi=oe(Pi);var Jt={exports:{}},Ri=Jt.exports,en;function zi(){return en||(en=1,(function(t,e){(function(n,r){t.exports=r()})(Ri,(function(){return function(n,r){var i=r.prototype,s=i.format;i.format=function(a){var y=this,F=this.$locale();if(!this.isValid())return s.bind(this)(a);var S=this.$utils(),w=(a||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(P){switch(P){case"Q":return Math.ceil((y.$M+1)/3);case"Do":return F.ordinal(y.$D);case"gggg":return y.weekYear();case"GGGG":return y.isoWeekYear();case"wo":return F.ordinal(y.week(),"W");case"w":case"ww":return S.s(y.week(),P==="w"?1:2,"0");case"W":case"WW":return S.s(y.isoWeek(),P==="W"?1:2,"0");case"k":case"kk":return S.s(String(y.$H===0?24:y.$H),P==="k"?1:2,"0");case"X":return Math.floor(y.$d.getTime()/1e3);case"x":return y.$d.getTime();case"z":return"["+y.offsetName()+"]";case"zzz":return"["+y.offsetName("long")+"]";default:return P}}));return s.bind(this)(w)}}}))})(Jt)),Jt.exports}var qi=zi();const Bi=oe(qi);var Kt={exports:{}},Zi=Kt.exports,nn;function Xi(){return nn||(nn=1,(function(t,e){(function(n,r){t.exports=r()})(Zi,(function(){var n,r,i=1e3,s=6e4,a=36e5,y=864e5,F=31536e6,S=2628e6,w=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,P=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,_={years:F,months:S,days:y,hours:a,minutes:s,seconds:i,milliseconds:1,weeks:6048e5},Y=function(T){return T instanceof z},X=function(T,k,p){return new z(T,p,k.$l)},B=function(T){return r.p(T)+"s"},v=function(T){return T<0},U=function(T){return v(T)?Math.ceil(T):Math.floor(T)},R=function(T){return Math.abs(T)},E=function(T,k){return T?v(T)?{negative:!0,format:""+R(T)+k}:{negative:!1,format:""+T+k}:{negative:!1,format:""}},z=(function(){function T(p,L,x){var C=this;if(this.$d={},this.$l=x,p===void 0&&(this.$ms=0,this.parseFromMilliseconds()),L)return X(p*_[B(L)],this);if(typeof p=="number")return this.$ms=p,this.parseFromMilliseconds(),this;if(typeof p=="object")return Object.keys(p).forEach((function(c){C.$d[B(c)]=p[c]})),this.calMilliseconds(),this;if(typeof p=="string"){var M=p.match(w);if(M){var D=M.slice(2).map((function(c){return c!=null?Number(c):0}));return this.$d.years=D[0],this.$d.months=D[1],this.$d.weeks=D[2],this.$d.days=D[3],this.$d.hours=D[4],this.$d.minutes=D[5],this.$d.seconds=D[6],this.calMilliseconds(),this}}return this}var k=T.prototype;return k.calMilliseconds=function(){var p=this;this.$ms=Object.keys(this.$d).reduce((function(L,x){return L+(p.$d[x]||0)*_[x]}),0)},k.parseFromMilliseconds=function(){var p=this.$ms;this.$d.years=U(p/F),p%=F,this.$d.months=U(p/S),p%=S,this.$d.days=U(p/y),p%=y,this.$d.hours=U(p/a),p%=a,this.$d.minutes=U(p/s),p%=s,this.$d.seconds=U(p/i),p%=i,this.$d.milliseconds=p},k.toISOString=function(){var p=E(this.$d.years,"Y"),L=E(this.$d.months,"M"),x=+this.$d.days||0;this.$d.weeks&&(x+=7*this.$d.weeks);var C=E(x,"D"),M=E(this.$d.hours,"H"),D=E(this.$d.minutes,"M"),c=this.$d.seconds||0;this.$d.milliseconds&&(c+=this.$d.milliseconds/1e3,c=Math.round(1e3*c)/1e3);var g=E(c,"S"),b=p.negative||L.negative||C.negative||M.negative||D.negative||g.negative,m=M.format||D.format||g.format?"T":"",I=(b?"-":"")+"P"+p.format+L.format+C.format+m+M.format+D.format+g.format;return I==="P"||I==="-P"?"P0D":I},k.toJSON=function(){return this.toISOString()},k.format=function(p){var L=p||"YYYY-MM-DDTHH:mm:ss",x={Y:this.$d.years,YY:r.s(this.$d.years,2,"0"),YYYY:r.s(this.$d.years,4,"0"),M:this.$d.months,MM:r.s(this.$d.months,2,"0"),D:this.$d.days,DD:r.s(this.$d.days,2,"0"),H:this.$d.hours,HH:r.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:r.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:r.s(this.$d.seconds,2,"0"),SSS:r.s(this.$d.milliseconds,3,"0")};return L.replace(P,(function(C,M){return M||String(x[C])}))},k.as=function(p){return this.$ms/_[B(p)]},k.get=function(p){var L=this.$ms,x=B(p);return x==="milliseconds"?L%=1e3:L=x==="weeks"?U(L/_[x]):this.$d[x],L||0},k.add=function(p,L,x){var C;return C=L?p*_[B(L)]:Y(p)?p.$ms:X(p,this).$ms,X(this.$ms+C*(x?-1:1),this)},k.subtract=function(p,L){return this.add(p,L,!0)},k.locale=function(p){var L=this.clone();return L.$l=p,L},k.clone=function(){return X(this.$ms,this)},k.humanize=function(p){return n().add(this.$ms,"ms").locale(this.$l).fromNow(!p)},k.valueOf=function(){return this.asMilliseconds()},k.milliseconds=function(){return this.get("milliseconds")},k.asMilliseconds=function(){return this.as("milliseconds")},k.seconds=function(){return this.get("seconds")},k.asSeconds=function(){return this.as("seconds")},k.minutes=function(){return this.get("minutes")},k.asMinutes=function(){return this.as("minutes")},k.hours=function(){return this.get("hours")},k.asHours=function(){return this.as("hours")},k.days=function(){return this.get("days")},k.asDays=function(){return this.as("days")},k.weeks=function(){return this.get("weeks")},k.asWeeks=function(){return this.as("weeks")},k.months=function(){return this.get("months")},k.asMonths=function(){return this.as("months")},k.years=function(){return this.get("years")},k.asYears=function(){return this.as("years")},T})(),G=function(T,k,p){return T.add(k.years()*p,"y").add(k.months()*p,"M").add(k.days()*p,"d").add(k.hours()*p,"h").add(k.minutes()*p,"m").add(k.seconds()*p,"s").add(k.milliseconds()*p,"ms")};return function(T,k,p){n=p,r=p().$utils(),p.duration=function(C,M){var D=p.locale();return X(C,{$l:D},M)},p.isDuration=Y;var L=k.prototype.add,x=k.prototype.subtract;k.prototype.add=function(C,M){return Y(C)?G(this,C,1):L.bind(this)(C,M)},k.prototype.subtract=function(C,M){return Y(C)?G(this,C,-1):x.bind(this)(C,M)}}}))})(Kt)),Kt.exports}var Gi=Xi();const ji=oe(Gi);var we=(function(){var t=d(function(D,c,g,b){for(g=g||{},b=D.length;b--;g[D[b]]=c);return g},"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],n=[1,26],r=[1,27],i=[1,28],s=[1,29],a=[1,30],y=[1,31],F=[1,32],S=[1,33],w=[1,34],P=[1,9],_=[1,10],Y=[1,11],X=[1,12],B=[1,13],v=[1,14],U=[1,15],R=[1,16],E=[1,19],z=[1,20],G=[1,21],T=[1,22],k=[1,23],p=[1,25],L=[1,35],x={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:d(function(c,g,b,m,I,o,W){var u=o.length-1;switch(I){case 1:return o[u-1];case 2:this.$=[];break;case 3:o[u-1].push(o[u]),this.$=o[u-1];break;case 4:case 5:this.$=o[u];break;case 6:case 7:this.$=[];break;case 8:m.setWeekday("monday");break;case 9:m.setWeekday("tuesday");break;case 10:m.setWeekday("wednesday");break;case 11:m.setWeekday("thursday");break;case 12:m.setWeekday("friday");break;case 13:m.setWeekday("saturday");break;case 14:m.setWeekday("sunday");break;case 15:m.setWeekend("friday");break;case 16:m.setWeekend("saturday");break;case 17:m.setDateFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 18:m.enableInclusiveEndDates(),this.$=o[u].substr(18);break;case 19:m.TopAxis(),this.$=o[u].substr(8);break;case 20:m.setAxisFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 21:m.setTickInterval(o[u].substr(13)),this.$=o[u].substr(13);break;case 22:m.setExcludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 23:m.setIncludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 24:m.setTodayMarker(o[u].substr(12)),this.$=o[u].substr(12);break;case 27:m.setDiagramTitle(o[u].substr(6)),this.$=o[u].substr(6);break;case 28:this.$=o[u].trim(),m.setAccTitle(this.$);break;case 29:case 30:this.$=o[u].trim(),m.setAccDescription(this.$);break;case 31:m.addSection(o[u].substr(8)),this.$=o[u].substr(8);break;case 33:m.addTask(o[u-1],o[u]),this.$="task";break;case 34:this.$=o[u-1],m.setClickEvent(o[u-1],o[u],null);break;case 35:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],o[u]);break;case 36:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],null),m.setLink(o[u-2],o[u]);break;case 37:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-2],o[u-1]),m.setLink(o[u-3],o[u]);break;case 38:this.$=o[u-2],m.setClickEvent(o[u-2],o[u],null),m.setLink(o[u-2],o[u-1]);break;case 39:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-1],o[u]),m.setLink(o[u-3],o[u-2]);break;case 40:this.$=o[u-1],m.setLink(o[u-1],o[u]);break;case 41:case 47:this.$=o[u-1]+" "+o[u];break;case 42:case 43:case 45:this.$=o[u-2]+" "+o[u-1]+" "+o[u];break;case 44:case 46:this.$=o[u-3]+" "+o[u-2]+" "+o[u-1]+" "+o[u];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:S,21:w,22:P,23:_,24:Y,25:X,26:B,27:v,28:U,29:R,30:E,31:z,33:G,35:T,36:k,37:24,38:p,40:L},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:S,21:w,22:P,23:_,24:Y,25:X,26:B,27:v,28:U,29:R,30:E,31:z,33:G,35:T,36:k,37:24,38:p,40:L},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:d(function(c,g){if(g.recoverable)this.trace(c);else{var b=new Error(c);throw b.hash=g,b}},"parseError"),parse:d(function(c){var g=this,b=[0],m=[],I=[null],o=[],W=this.table,u="",K=0,l=0,$=2,O=1,j=o.slice.call(arguments,1),H=Object.create(this.lexer),J={yy:{}};for(var h in this.yy)Object.prototype.hasOwnProperty.call(this.yy,h)&&(J.yy[h]=this.yy[h]);H.setInput(c,J.yy),J.yy.lexer=H,J.yy.parser=this,typeof H.yylloc>"u"&&(H.yylloc={});var N=H.yylloc;o.push(N);var V=H.options&&H.options.ranges;typeof J.yy.parseError=="function"?this.parseError=J.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function f(ot){b.length=b.length-2*ot,I.length=I.length-ot,o.length=o.length-ot}d(f,"popStack");function tt(){var ot;return ot=m.pop()||H.lex()||O,typeof ot!="number"&&(ot instanceof Array&&(m=ot,ot=m.pop()),ot=g.symbols_[ot]||ot),ot}d(tt,"lex");for(var A,Q,Z,st,at={},pt,ut,He,Bt;;){if(Q=b[b.length-1],this.defaultActions[Q]?Z=this.defaultActions[Q]:((A===null||typeof A>"u")&&(A=tt()),Z=W[Q]&&W[Q][A]),typeof Z>"u"||!Z.length||!Z[0]){var ce="";Bt=[];for(pt in W[Q])this.terminals_[pt]&&pt>$&&Bt.push("'"+this.terminals_[pt]+"'");H.showPosition?ce="Parse error on line "+(K+1)+`: `+H.showPosition()+` Expecting `+Bt.join(", ")+", got '"+(this.terminals_[A]||A)+"'":ce="Parse error on line "+(K+1)+": Unexpected "+(A==O?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(ce,{text:H.match,token:this.terminals_[A]||A,line:H.yylineno,loc:N,expected:Bt})}if(Z[0]instanceof Array&&Z.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Q+", token: "+A);switch(Z[0]){case 1:b.push(A),I.push(H.yytext),o.push(H.yylloc),b.push(Z[1]),A=null,l=H.yyleng,u=H.yytext,K=H.yylineno,N=H.yylloc;break;case 2:if(ut=this.productions_[Z[1]][1],at.$=I[I.length-ut],at._$={first_line:o[o.length-(ut||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(ut||1)].first_column,last_column:o[o.length-1].last_column},V&&(at._$.range=[o[o.length-(ut||1)].range[0],o[o.length-1].range[1]]),st=this.performAction.apply(at,[u,l,K,J.yy,Z[1],I,o].concat(j)),typeof st<"u")return st;ut&&(b=b.slice(0,-1*ut*2),I=I.slice(0,-1*ut),o=o.slice(0,-1*ut)),b.push(this.productions_[Z[1]][0]),I.push(at.$),o.push(at._$),He=W[b[b.length-2]][b[b.length-1]],b.push(He);break;case 3:return!0}}return!0},"parse")},C=(function(){var D={EOF:1,parseError:d(function(g,b){if(this.yy.parser)this.yy.parser.parseError(g,b);else throw new Error(g)},"parseError"),setInput:d(function(c,g){return this.yy=g||this.yy||{},this._input=c,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:d(function(){var c=this._input[0];this.yytext+=c,this.yyleng++,this.offset++,this.match+=c,this.matched+=c;var g=c.match(/(?:\r\n?|\n).*/g);return g?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),c},"input"),unput:d(function(c){var g=c.length,b=c.split(/(?:\r\n?|\n)/g);this._input=c+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var m=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),b.length-1&&(this.yylineno-=b.length-1);var I=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:b?(b.length===m.length?this.yylloc.first_column:0)+m[m.length-b.length].length-b[0].length:this.yylloc.first_column-g},this.options.ranges&&(this.yylloc.range=[I[0],I[0]+this.yyleng-g]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:d(function(c){this.unput(this.match.slice(c))},"less"),pastInput:d(function(){var c=this.matched.substr(0,this.matched.length-this.match.length);return(c.length>20?"...":"")+c.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var c=this.match;return c.length<20&&(c+=this._input.substr(0,20-c.length)),(c.substr(0,20)+(c.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var c=this.pastInput(),g=new Array(c.length+1).join("-");return c+this.upcomingInput()+` diff --git a/apps/kimi-code/dist-web/assets/gitGraphDiagram-IHSO6WYX-CuVLyl1X.js b/apps/kimi-code/dist-web/assets/gitGraphDiagram-IHSO6WYX-B9_pldp9.js similarity index 99% rename from apps/kimi-code/dist-web/assets/gitGraphDiagram-IHSO6WYX-CuVLyl1X.js rename to apps/kimi-code/dist-web/assets/gitGraphDiagram-IHSO6WYX-B9_pldp9.js index ee8aed3413..e31149b218 100644 --- a/apps/kimi-code/dist-web/assets/gitGraphDiagram-IHSO6WYX-CuVLyl1X.js +++ b/apps/kimi-code/dist-web/assets/gitGraphDiagram-IHSO6WYX-B9_pldp9.js @@ -1,4 +1,4 @@ -import{I as le}from"./chunk-2Q5K7J3B-CdhiweKX.js";import{p as he}from"./chunk-JWPE2WC7-C7S97jLg.js";import{o as $e,n as fe,s as ge,g as ue,a as ye,b as xe,_ as h,y as J,l as w,d as me,c as q,x as pe,z as be,p as we,k as B,A as ke,B as ve,C as Ce}from"./mermaid.core-CqiFQExc.js";import{p as Ee}from"./cynefin-VYW2F7L2-DEnbetzx.js";import"./index--0t1wzw_.js";import"./_commonjsHelpers-CqkleIqs.js";var m={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Be=ve.gitGraph,S=h(()=>ke({...Be,...J().gitGraph}),"getConfig"),d=new le(()=>{const e=S(),r=e.mainBranchName,t=e.mainBranchOrder;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:t}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function Y(){return Ce({length:7})}h(Y,"getID");function te(e,r){const t=Object.create(null);return e.reduce((s,o)=>{const i=r(o);return t[i]||(t[i]=!0,s.push(o)),s},[])}h(te,"uniqBy");var Te=h(function(e){d.records.direction=e},"setDirection"),Le=h(function(e){w.debug("options str",e),e=e?.trim(),e=e||"{}";try{d.records.options=JSON.parse(e)}catch(r){w.error("error while parsing gitGraph options",r.message)}},"setOptions"),Me=h(function(){return d.records.options},"getOptions"),Re=h(function(e){let r=e.msg,t=e.id;const s=e.type;let o=e.tags;w.info("commit",r,t,s,o),w.debug("Entering commit:",r,t,s,o);const i=S();t=B.sanitizeText(t,i),r=B.sanitizeText(r,i),o=o?.map(a=>B.sanitizeText(a,i));const n={id:t||d.records.seq+"-"+Y(),message:r,seq:d.records.seq++,type:s??m.NORMAL,tags:o??[],parents:d.records.head==null?[]:[d.records.head.id],branch:d.records.currBranch};d.records.head=n,w.info("main branch",i.mainBranchName),d.records.commits.has(n.id)&&w.warn(`Commit ID ${n.id} already exists`),d.records.commits.set(n.id,n),d.records.branches.set(d.records.currBranch,n.id),w.debug("in pushCommit "+n.id)},"commit"),Ie=h(function(e){let r=e.name;const t=e.order;if(r=B.sanitizeText(r,S()),d.records.branches.has(r))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`);d.records.branches.set(r,d.records.head!=null?d.records.head.id:null),d.records.branchConfig.set(r,{name:r,order:t}),ae(r),w.debug("in createBranch")},"branch"),Oe=h(e=>{let r=e.branch,t=e.id;const s=e.type,o=e.tags,i=S();r=B.sanitizeText(r,i),t&&(t=B.sanitizeText(t,i));const n=d.records.branches.get(d.records.currBranch),a=d.records.branches.get(r),l=n?d.records.commits.get(n):void 0,f=a?d.records.commits.get(a):void 0;if(l&&f&&l.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(d.records.currBranch===r){const c=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(l===void 0||!l){const c=new Error(`Incorrect usage of "merge". Current branch (${d.records.currBranch})has no commits`);throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},c}if(!d.records.branches.has(r)){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},c}if(f===void 0||!f){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},c}if(l===f){const c=new Error('Incorrect usage of "merge". Both branches have same head');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(t&&d.records.commits.has(t)){const c=new Error('Incorrect usage of "merge". Commit with id:'+t+" already exists, use different custom id");throw c.hash={text:`merge ${r} ${t} ${s} ${o?.join(" ")}`,token:`merge ${r} ${t} ${s} ${o?.join(" ")}`,expected:[`merge ${r} ${t}_UNIQUE ${s} ${o?.join(" ")}`]},c}const g=a||"",$={id:t||`${d.records.seq}-${Y()}`,message:`merged branch ${r} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,g],branch:d.records.currBranch,type:m.MERGE,customType:s,customId:!!t,tags:o??[]};d.records.head=$,d.records.commits.set($.id,$),d.records.branches.set(d.records.currBranch,$.id),w.debug(d.records.branches),w.debug("in mergeBranch")},"merge"),_e=h(function(e){let r=e.id,t=e.targetId,s=e.tags,o=e.parent;w.debug("Entering cherryPick:",r,t,s);const i=S();if(r=B.sanitizeText(r,i),t=B.sanitizeText(t,i),s=s?.map(l=>B.sanitizeText(l,i)),o=B.sanitizeText(o,i),!r||!d.records.commits.has(r)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},l}const n=d.records.commits.get(r);if(n===void 0||!n)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(o&&!(Array.isArray(n.parents)&&n.parents.includes(o)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const a=n.branch;if(n.type===m.MERGE&&!o)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!t||!d.records.commits.has(t)){if(a===d.records.currBranch){const $=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const l=d.records.branches.get(d.records.currBranch);if(l===void 0||!l){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const f=d.records.commits.get(l);if(f===void 0||!f){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const g={id:d.records.seq+"-"+Y(),message:`cherry-picked ${n?.message} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,n.id],branch:d.records.currBranch,type:m.CHERRY_PICK,tags:s?s.filter(Boolean):[`cherry-pick:${n.id}${n.type===m.MERGE?`|parent:${o}`:""}`]};d.records.head=g,d.records.commits.set(g.id,g),d.records.branches.set(d.records.currBranch,g.id),w.debug(d.records.branches),w.debug("in cherryPick")}},"cherryPick"),ae=h(function(e){if(e=B.sanitizeText(e,S()),d.records.branches.has(e)){d.records.currBranch=e;const r=d.records.branches.get(d.records.currBranch);r===void 0||!r?d.records.head=null:d.records.head=d.records.commits.get(r)??null}else{const r=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);throw r.hash={text:`checkout ${e}`,token:`checkout ${e}`,expected:[`branch ${e}`]},r}},"checkout");function V(e,r,t){const s=e.indexOf(r);s===-1?e.push(t):e.splice(s,1,t)}h(V,"upsert");function Q(e){const r=e.reduce((o,i)=>o.seq>i.seq?o:i,e[0]);let t="";e.forEach(function(o){o===r?t+=" *":t+=" |"});const s=[t,r.id,r.seq];for(const o in d.records.branches)d.records.branches.get(o)===r.id&&s.push(o);if(w.debug(s.join(" ")),r.parents&&r.parents.length==2&&r.parents[0]&&r.parents[1]){const o=d.records.commits.get(r.parents[0]);V(e,r,o),r.parents[1]&&e.push(d.records.commits.get(r.parents[1]))}else{if(r.parents.length==0)return;if(r.parents[0]){const o=d.records.commits.get(r.parents[0]);V(e,r,o)}}e=te(e,o=>o.id),Q(e)}h(Q,"prettyPrintCommitHistory");var Ge=h(function(){w.debug(d.records.commits);const e=ne()[0];Q([e])},"prettyPrint"),He=h(function(){d.reset(),we()},"clear"),Se=h(function(){return[...d.records.branchConfig.values()].map((r,t)=>r.order!==null&&r.order!==void 0?r:{...r,order:parseFloat(`0.${t}`)}).sort((r,t)=>(r.order??0)-(t.order??0)).map(({name:r})=>({name:r}))},"getBranchesAsObjArray"),Ae=h(function(){return d.records.branches},"getBranches"),De=h(function(){return d.records.commits},"getCommits"),ne=h(function(){const e=[...d.records.commits.values()];return e.forEach(function(r){w.debug(r.id)}),e.sort((r,t)=>r.seq-t.seq),e},"getCommitsArray"),Pe=h(function(){return d.records.currBranch},"getCurrentBranch"),We=h(function(){return d.records.direction},"getDirection"),qe=h(function(){return d.records.head},"getHead"),se={commitType:m,getConfig:S,setDirection:Te,setOptions:Le,getOptions:Me,commit:Re,branch:Ie,merge:Oe,cherryPick:_e,checkout:ae,prettyPrint:Ge,clear:He,getBranchesAsObjArray:Se,getBranches:Ae,getCommits:De,getCommitsArray:ne,getCurrentBranch:Pe,getDirection:We,getHead:qe,setAccTitle:xe,getAccTitle:ye,getAccDescription:ue,setAccDescription:ge,setDiagramTitle:fe,getDiagramTitle:$e},Ne=h((e,r)=>{he(e,r),e.dir&&r.setDirection(e.dir);for(const t of e.statements)Fe(t,r)},"populate"),Fe=h((e,r)=>{const s={Commit:h(o=>r.commit(ze(o)),"Commit"),Branch:h(o=>r.branch(Ye(o)),"Branch"),Merge:h(o=>r.merge(je(o)),"Merge"),Checkout:h(o=>r.checkout(Ue(o)),"Checkout"),CherryPicking:h(o=>r.cherryPick(Ke(o)),"CherryPicking")}[e.$type];s?s(e):w.error(`Unknown statement type: ${e.$type}`)},"parseStatement"),ze=h(e=>({id:e.id,msg:e.message??"",type:e.type!==void 0?m[e.type]:m.NORMAL,tags:e.tags??void 0}),"parseCommit"),Ye=h(e=>({name:e.name,order:e.order??0}),"parseBranch"),je=h(e=>({branch:e.branch,id:e.id??"",type:e.type!==void 0?m[e.type]:void 0,tags:e.tags??void 0}),"parseMerge"),Ue=h(e=>e.branch,"parseCheckout"),Ke=h(e=>({id:e.id,targetId:"",tags:e.tags?.length===0?void 0:e.tags,parent:e.parent}),"parseCherryPicking"),Ve={parse:h(async e=>{const r=await Ee("gitGraph",e);w.debug(r),Ne(r,se)},"parse")},O=10,_=40,L=4,R=2,G=8,j=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),X=12,Z=new Set(["redux-color","redux-dark-color"]),Xe=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),H=h((e,r,t=!1)=>t&&e>0?(e-1)%(r-1)+1:e%r,"calcColorIndex"),C=new Map,E=new Map,F=30,P=new Map,z=[],I=0,y="LR",Je=h(()=>{C.clear(),E.clear(),P.clear(),I=0,z=[],y="LR"},"clear"),oe=h(e=>{const r=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof e=="string"?e.split(/\\n|\n|/gi):e).forEach(s=>{const o=document.createElementNS("http://www.w3.org/2000/svg","tspan");o.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),o.setAttribute("dy","1em"),o.setAttribute("x","0"),o.setAttribute("class","row"),o.textContent=s.trim(),r.appendChild(o)}),r},"drawText"),ce=h(e=>{let r,t,s;return y==="BT"?(t=h((o,i)=>o<=i,"comparisonFunc"),s=1/0):(t=h((o,i)=>o>=i,"comparisonFunc"),s=0),e.forEach(o=>{const i=y==="TB"||y=="BT"?E.get(o)?.y:E.get(o)?.x;i!==void 0&&t(i,s)&&(r=o,s=i)}),r},"findClosestParent"),Qe=h(e=>{let r="",t=1/0;return e.forEach(s=>{const o=E.get(s).y;o<=t&&(r=s,t=o)}),r||void 0},"findClosestParentBT"),Ze=h((e,r,t)=>{let s=t,o=t;const i=[];e.forEach(n=>{const a=r.get(n);if(!a)throw new Error(`Commit not found for key ${n}`);a.parents.length?(s=rr(a),o=Math.max(s,o)):i.push(a),tr(a,s)}),s=o,i.forEach(n=>{ar(n,s,t)}),e.forEach(n=>{const a=r.get(n);if(a?.parents.length){const l=Qe(a.parents);s=E.get(l).y-_,s<=o&&(o=s);const f=C.get(a.branch).pos,g=s-O;E.set(a.id,{x:f,y:g})}})},"setParallelBTPos"),er=h(e=>{const r=ce(e.parents.filter(s=>s!==null));if(!r)throw new Error(`Closest parent not found for commit ${e.id}`);const t=E.get(r)?.y;if(t===void 0)throw new Error(`Closest parent position not found for commit ${e.id}`);return t},"findClosestParentPos"),rr=h(e=>er(e)+_,"calculateCommitPosition"),tr=h((e,r)=>{const t=C.get(e.branch);if(!t)throw new Error(`Branch not found for commit ${e.id}`);const s=t.pos,o=r+O;return E.set(e.id,{x:s,y:o}),{x:s,y:o}},"setCommitPosition"),ar=h((e,r,t)=>{const s=C.get(e.branch);if(!s)throw new Error(`Branch not found for commit ${e.id}`);const o=r+t,i=s.pos;E.set(e.id,{x:i,y:o})},"setRootPosition"),nr=h((e,r,t,s,o,i)=>{const{theme:n}=q(),a=j.has(n??""),l=Z.has(n??""),f=Xe.has(n??"");if(i===m.HIGHLIGHT)e.append("rect").attr("x",t.x-10+(a?3:0)).attr("y",t.y-10+(a?3:0)).attr("width",a?14:20).attr("height",a?14:20).attr("class",`commit ${r.id} commit-highlight${H(o,G,l)} ${s}-outer`),e.append("rect").attr("x",t.x-6+(a?2:0)).attr("y",t.y-6+(a?2:0)).attr("width",a?8:12).attr("height",a?8:12).attr("class",`commit ${r.id} commit${H(o,G,l)} ${s}-inner`);else if(i===m.CHERRY_PICK)e.append("circle").attr("cx",t.x).attr("cy",t.y).attr("r",a?7:10).attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x-3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x+3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x+3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x-3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`);else{const g=e.append("circle");if(g.attr("cx",t.x),g.attr("cy",t.y),g.attr("r",a?7:10),g.attr("class",`commit ${r.id} commit${H(o,G,l)}`),i===m.MERGE){const $=e.append("circle");$.attr("cx",t.x),$.attr("cy",t.y),$.attr("r",a?5:6),$.attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}if(i===m.REVERSE){const $=e.append("path"),c=a?4:5;$.attr("d",`M ${t.x-c},${t.y-c}L${t.x+c},${t.y+c}M${t.x-c},${t.y+c}L${t.x+c},${t.y-c}`).attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}}},"drawCommitBullet"),sr=h((e,r,t,s,o)=>{if(r.type!==m.CHERRY_PICK&&(r.customId&&r.type===m.MERGE||r.type!==m.MERGE)&&o.showCommitLabel){const i=e.append("g"),n=i.insert("rect").attr("class","commit-label-bkg"),a=i.append("text").attr("x",s).attr("y",t.y+25).attr("class","commit-label").text(r.id),l=a.node()?.getBBox();if(l&&(n.attr("x",t.posWithOffset-l.width/2-R).attr("y",t.y+13.5).attr("width",l.width+2*R).attr("height",l.height+2*R),y==="TB"||y==="BT"?(n.attr("x",t.x-(l.width+4*L+5)).attr("y",t.y-12),a.attr("x",t.x-(l.width+4*L)).attr("y",t.y+l.height-12)):a.attr("x",t.posWithOffset-l.width/2),o.rotateCommitLabel))if(y==="TB"||y==="BT")a.attr("transform","rotate(-45, "+t.x+", "+t.y+")"),n.attr("transform","rotate(-45, "+t.x+", "+t.y+")");else{const f=-7.5-(l.width+10)/25*9.5,g=10+l.width/25*8.5;i.attr("transform","translate("+f+", "+g+") rotate(-45, "+s+", "+t.y+")")}}},"drawCommitLabel"),or=h((e,r,t,s)=>{if(r.tags.length>0){let o=0,i=0,n=0;const a=[];for(const l of r.tags.reverse()){const f=e.insert("polygon"),g=e.append("circle"),$=e.append("text").attr("y",t.y-16-o).attr("class","tag-label").text(l),c=$.node()?.getBBox();if(!c)throw new Error("Tag bbox not found");i=Math.max(i,c.width),n=Math.max(n,c.height),$.attr("x",t.posWithOffset-c.width/2),a.push({tag:$,hole:g,rect:f,yOffset:o}),o+=20}for(const{tag:l,hole:f,rect:g,yOffset:$}of a){const c=n/2,x=t.y-19.2-$;if(g.attr("class","tag-label-bkg").attr("points",` +import{I as le}from"./chunk-2Q5K7J3B-NzojNxDT.js";import{p as he}from"./chunk-JWPE2WC7-BJMJfnyy.js";import{o as $e,n as fe,s as ge,g as ue,a as ye,b as xe,_ as h,y as J,l as w,d as me,c as q,x as pe,z as be,p as we,k as B,A as ke,B as ve,C as Ce}from"./mermaid.core-WW7RuneT.js";import{p as Ee}from"./cynefin-VYW2F7L2-DI-9Z5R0.js";import"./index-CiHMlsuo.js";import"./_commonjsHelpers-CqkleIqs.js";var m={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Be=ve.gitGraph,S=h(()=>ke({...Be,...J().gitGraph}),"getConfig"),d=new le(()=>{const e=S(),r=e.mainBranchName,t=e.mainBranchOrder;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:t}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function Y(){return Ce({length:7})}h(Y,"getID");function te(e,r){const t=Object.create(null);return e.reduce((s,o)=>{const i=r(o);return t[i]||(t[i]=!0,s.push(o)),s},[])}h(te,"uniqBy");var Te=h(function(e){d.records.direction=e},"setDirection"),Le=h(function(e){w.debug("options str",e),e=e?.trim(),e=e||"{}";try{d.records.options=JSON.parse(e)}catch(r){w.error("error while parsing gitGraph options",r.message)}},"setOptions"),Me=h(function(){return d.records.options},"getOptions"),Re=h(function(e){let r=e.msg,t=e.id;const s=e.type;let o=e.tags;w.info("commit",r,t,s,o),w.debug("Entering commit:",r,t,s,o);const i=S();t=B.sanitizeText(t,i),r=B.sanitizeText(r,i),o=o?.map(a=>B.sanitizeText(a,i));const n={id:t||d.records.seq+"-"+Y(),message:r,seq:d.records.seq++,type:s??m.NORMAL,tags:o??[],parents:d.records.head==null?[]:[d.records.head.id],branch:d.records.currBranch};d.records.head=n,w.info("main branch",i.mainBranchName),d.records.commits.has(n.id)&&w.warn(`Commit ID ${n.id} already exists`),d.records.commits.set(n.id,n),d.records.branches.set(d.records.currBranch,n.id),w.debug("in pushCommit "+n.id)},"commit"),Ie=h(function(e){let r=e.name;const t=e.order;if(r=B.sanitizeText(r,S()),d.records.branches.has(r))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`);d.records.branches.set(r,d.records.head!=null?d.records.head.id:null),d.records.branchConfig.set(r,{name:r,order:t}),ae(r),w.debug("in createBranch")},"branch"),Oe=h(e=>{let r=e.branch,t=e.id;const s=e.type,o=e.tags,i=S();r=B.sanitizeText(r,i),t&&(t=B.sanitizeText(t,i));const n=d.records.branches.get(d.records.currBranch),a=d.records.branches.get(r),l=n?d.records.commits.get(n):void 0,f=a?d.records.commits.get(a):void 0;if(l&&f&&l.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(d.records.currBranch===r){const c=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(l===void 0||!l){const c=new Error(`Incorrect usage of "merge". Current branch (${d.records.currBranch})has no commits`);throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},c}if(!d.records.branches.has(r)){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},c}if(f===void 0||!f){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},c}if(l===f){const c=new Error('Incorrect usage of "merge". Both branches have same head');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(t&&d.records.commits.has(t)){const c=new Error('Incorrect usage of "merge". Commit with id:'+t+" already exists, use different custom id");throw c.hash={text:`merge ${r} ${t} ${s} ${o?.join(" ")}`,token:`merge ${r} ${t} ${s} ${o?.join(" ")}`,expected:[`merge ${r} ${t}_UNIQUE ${s} ${o?.join(" ")}`]},c}const g=a||"",$={id:t||`${d.records.seq}-${Y()}`,message:`merged branch ${r} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,g],branch:d.records.currBranch,type:m.MERGE,customType:s,customId:!!t,tags:o??[]};d.records.head=$,d.records.commits.set($.id,$),d.records.branches.set(d.records.currBranch,$.id),w.debug(d.records.branches),w.debug("in mergeBranch")},"merge"),_e=h(function(e){let r=e.id,t=e.targetId,s=e.tags,o=e.parent;w.debug("Entering cherryPick:",r,t,s);const i=S();if(r=B.sanitizeText(r,i),t=B.sanitizeText(t,i),s=s?.map(l=>B.sanitizeText(l,i)),o=B.sanitizeText(o,i),!r||!d.records.commits.has(r)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},l}const n=d.records.commits.get(r);if(n===void 0||!n)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(o&&!(Array.isArray(n.parents)&&n.parents.includes(o)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const a=n.branch;if(n.type===m.MERGE&&!o)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!t||!d.records.commits.has(t)){if(a===d.records.currBranch){const $=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const l=d.records.branches.get(d.records.currBranch);if(l===void 0||!l){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const f=d.records.commits.get(l);if(f===void 0||!f){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const g={id:d.records.seq+"-"+Y(),message:`cherry-picked ${n?.message} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,n.id],branch:d.records.currBranch,type:m.CHERRY_PICK,tags:s?s.filter(Boolean):[`cherry-pick:${n.id}${n.type===m.MERGE?`|parent:${o}`:""}`]};d.records.head=g,d.records.commits.set(g.id,g),d.records.branches.set(d.records.currBranch,g.id),w.debug(d.records.branches),w.debug("in cherryPick")}},"cherryPick"),ae=h(function(e){if(e=B.sanitizeText(e,S()),d.records.branches.has(e)){d.records.currBranch=e;const r=d.records.branches.get(d.records.currBranch);r===void 0||!r?d.records.head=null:d.records.head=d.records.commits.get(r)??null}else{const r=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);throw r.hash={text:`checkout ${e}`,token:`checkout ${e}`,expected:[`branch ${e}`]},r}},"checkout");function V(e,r,t){const s=e.indexOf(r);s===-1?e.push(t):e.splice(s,1,t)}h(V,"upsert");function Q(e){const r=e.reduce((o,i)=>o.seq>i.seq?o:i,e[0]);let t="";e.forEach(function(o){o===r?t+=" *":t+=" |"});const s=[t,r.id,r.seq];for(const o in d.records.branches)d.records.branches.get(o)===r.id&&s.push(o);if(w.debug(s.join(" ")),r.parents&&r.parents.length==2&&r.parents[0]&&r.parents[1]){const o=d.records.commits.get(r.parents[0]);V(e,r,o),r.parents[1]&&e.push(d.records.commits.get(r.parents[1]))}else{if(r.parents.length==0)return;if(r.parents[0]){const o=d.records.commits.get(r.parents[0]);V(e,r,o)}}e=te(e,o=>o.id),Q(e)}h(Q,"prettyPrintCommitHistory");var Ge=h(function(){w.debug(d.records.commits);const e=ne()[0];Q([e])},"prettyPrint"),He=h(function(){d.reset(),we()},"clear"),Se=h(function(){return[...d.records.branchConfig.values()].map((r,t)=>r.order!==null&&r.order!==void 0?r:{...r,order:parseFloat(`0.${t}`)}).sort((r,t)=>(r.order??0)-(t.order??0)).map(({name:r})=>({name:r}))},"getBranchesAsObjArray"),Ae=h(function(){return d.records.branches},"getBranches"),De=h(function(){return d.records.commits},"getCommits"),ne=h(function(){const e=[...d.records.commits.values()];return e.forEach(function(r){w.debug(r.id)}),e.sort((r,t)=>r.seq-t.seq),e},"getCommitsArray"),Pe=h(function(){return d.records.currBranch},"getCurrentBranch"),We=h(function(){return d.records.direction},"getDirection"),qe=h(function(){return d.records.head},"getHead"),se={commitType:m,getConfig:S,setDirection:Te,setOptions:Le,getOptions:Me,commit:Re,branch:Ie,merge:Oe,cherryPick:_e,checkout:ae,prettyPrint:Ge,clear:He,getBranchesAsObjArray:Se,getBranches:Ae,getCommits:De,getCommitsArray:ne,getCurrentBranch:Pe,getDirection:We,getHead:qe,setAccTitle:xe,getAccTitle:ye,getAccDescription:ue,setAccDescription:ge,setDiagramTitle:fe,getDiagramTitle:$e},Ne=h((e,r)=>{he(e,r),e.dir&&r.setDirection(e.dir);for(const t of e.statements)Fe(t,r)},"populate"),Fe=h((e,r)=>{const s={Commit:h(o=>r.commit(ze(o)),"Commit"),Branch:h(o=>r.branch(Ye(o)),"Branch"),Merge:h(o=>r.merge(je(o)),"Merge"),Checkout:h(o=>r.checkout(Ue(o)),"Checkout"),CherryPicking:h(o=>r.cherryPick(Ke(o)),"CherryPicking")}[e.$type];s?s(e):w.error(`Unknown statement type: ${e.$type}`)},"parseStatement"),ze=h(e=>({id:e.id,msg:e.message??"",type:e.type!==void 0?m[e.type]:m.NORMAL,tags:e.tags??void 0}),"parseCommit"),Ye=h(e=>({name:e.name,order:e.order??0}),"parseBranch"),je=h(e=>({branch:e.branch,id:e.id??"",type:e.type!==void 0?m[e.type]:void 0,tags:e.tags??void 0}),"parseMerge"),Ue=h(e=>e.branch,"parseCheckout"),Ke=h(e=>({id:e.id,targetId:"",tags:e.tags?.length===0?void 0:e.tags,parent:e.parent}),"parseCherryPicking"),Ve={parse:h(async e=>{const r=await Ee("gitGraph",e);w.debug(r),Ne(r,se)},"parse")},O=10,_=40,L=4,R=2,G=8,j=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),X=12,Z=new Set(["redux-color","redux-dark-color"]),Xe=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),H=h((e,r,t=!1)=>t&&e>0?(e-1)%(r-1)+1:e%r,"calcColorIndex"),C=new Map,E=new Map,F=30,P=new Map,z=[],I=0,y="LR",Je=h(()=>{C.clear(),E.clear(),P.clear(),I=0,z=[],y="LR"},"clear"),oe=h(e=>{const r=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof e=="string"?e.split(/\\n|\n|/gi):e).forEach(s=>{const o=document.createElementNS("http://www.w3.org/2000/svg","tspan");o.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),o.setAttribute("dy","1em"),o.setAttribute("x","0"),o.setAttribute("class","row"),o.textContent=s.trim(),r.appendChild(o)}),r},"drawText"),ce=h(e=>{let r,t,s;return y==="BT"?(t=h((o,i)=>o<=i,"comparisonFunc"),s=1/0):(t=h((o,i)=>o>=i,"comparisonFunc"),s=0),e.forEach(o=>{const i=y==="TB"||y=="BT"?E.get(o)?.y:E.get(o)?.x;i!==void 0&&t(i,s)&&(r=o,s=i)}),r},"findClosestParent"),Qe=h(e=>{let r="",t=1/0;return e.forEach(s=>{const o=E.get(s).y;o<=t&&(r=s,t=o)}),r||void 0},"findClosestParentBT"),Ze=h((e,r,t)=>{let s=t,o=t;const i=[];e.forEach(n=>{const a=r.get(n);if(!a)throw new Error(`Commit not found for key ${n}`);a.parents.length?(s=rr(a),o=Math.max(s,o)):i.push(a),tr(a,s)}),s=o,i.forEach(n=>{ar(n,s,t)}),e.forEach(n=>{const a=r.get(n);if(a?.parents.length){const l=Qe(a.parents);s=E.get(l).y-_,s<=o&&(o=s);const f=C.get(a.branch).pos,g=s-O;E.set(a.id,{x:f,y:g})}})},"setParallelBTPos"),er=h(e=>{const r=ce(e.parents.filter(s=>s!==null));if(!r)throw new Error(`Closest parent not found for commit ${e.id}`);const t=E.get(r)?.y;if(t===void 0)throw new Error(`Closest parent position not found for commit ${e.id}`);return t},"findClosestParentPos"),rr=h(e=>er(e)+_,"calculateCommitPosition"),tr=h((e,r)=>{const t=C.get(e.branch);if(!t)throw new Error(`Branch not found for commit ${e.id}`);const s=t.pos,o=r+O;return E.set(e.id,{x:s,y:o}),{x:s,y:o}},"setCommitPosition"),ar=h((e,r,t)=>{const s=C.get(e.branch);if(!s)throw new Error(`Branch not found for commit ${e.id}`);const o=r+t,i=s.pos;E.set(e.id,{x:i,y:o})},"setRootPosition"),nr=h((e,r,t,s,o,i)=>{const{theme:n}=q(),a=j.has(n??""),l=Z.has(n??""),f=Xe.has(n??"");if(i===m.HIGHLIGHT)e.append("rect").attr("x",t.x-10+(a?3:0)).attr("y",t.y-10+(a?3:0)).attr("width",a?14:20).attr("height",a?14:20).attr("class",`commit ${r.id} commit-highlight${H(o,G,l)} ${s}-outer`),e.append("rect").attr("x",t.x-6+(a?2:0)).attr("y",t.y-6+(a?2:0)).attr("width",a?8:12).attr("height",a?8:12).attr("class",`commit ${r.id} commit${H(o,G,l)} ${s}-inner`);else if(i===m.CHERRY_PICK)e.append("circle").attr("cx",t.x).attr("cy",t.y).attr("r",a?7:10).attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x-3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x+3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x+3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x-3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`);else{const g=e.append("circle");if(g.attr("cx",t.x),g.attr("cy",t.y),g.attr("r",a?7:10),g.attr("class",`commit ${r.id} commit${H(o,G,l)}`),i===m.MERGE){const $=e.append("circle");$.attr("cx",t.x),$.attr("cy",t.y),$.attr("r",a?5:6),$.attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}if(i===m.REVERSE){const $=e.append("path"),c=a?4:5;$.attr("d",`M ${t.x-c},${t.y-c}L${t.x+c},${t.y+c}M${t.x-c},${t.y+c}L${t.x+c},${t.y-c}`).attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}}},"drawCommitBullet"),sr=h((e,r,t,s,o)=>{if(r.type!==m.CHERRY_PICK&&(r.customId&&r.type===m.MERGE||r.type!==m.MERGE)&&o.showCommitLabel){const i=e.append("g"),n=i.insert("rect").attr("class","commit-label-bkg"),a=i.append("text").attr("x",s).attr("y",t.y+25).attr("class","commit-label").text(r.id),l=a.node()?.getBBox();if(l&&(n.attr("x",t.posWithOffset-l.width/2-R).attr("y",t.y+13.5).attr("width",l.width+2*R).attr("height",l.height+2*R),y==="TB"||y==="BT"?(n.attr("x",t.x-(l.width+4*L+5)).attr("y",t.y-12),a.attr("x",t.x-(l.width+4*L)).attr("y",t.y+l.height-12)):a.attr("x",t.posWithOffset-l.width/2),o.rotateCommitLabel))if(y==="TB"||y==="BT")a.attr("transform","rotate(-45, "+t.x+", "+t.y+")"),n.attr("transform","rotate(-45, "+t.x+", "+t.y+")");else{const f=-7.5-(l.width+10)/25*9.5,g=10+l.width/25*8.5;i.attr("transform","translate("+f+", "+g+") rotate(-45, "+s+", "+t.y+")")}}},"drawCommitLabel"),or=h((e,r,t,s)=>{if(r.tags.length>0){let o=0,i=0,n=0;const a=[];for(const l of r.tags.reverse()){const f=e.insert("polygon"),g=e.append("circle"),$=e.append("text").attr("y",t.y-16-o).attr("class","tag-label").text(l),c=$.node()?.getBBox();if(!c)throw new Error("Tag bbox not found");i=Math.max(i,c.width),n=Math.max(n,c.height),$.attr("x",t.posWithOffset-c.width/2),a.push({tag:$,hole:g,rect:f,yOffset:o}),o+=20}for(const{tag:l,hole:f,rect:g,yOffset:$}of a){const c=n/2,x=t.y-19.2-$;if(g.attr("class","tag-label-bkg").attr("points",` ${s-i/2-L/2},${x+R} ${s-i/2-L/2},${x-R} ${t.posWithOffset-i/2-L},${x-c-R} diff --git a/apps/kimi-code/dist-web/assets/index--0t1wzw_.js b/apps/kimi-code/dist-web/assets/index--0t1wzw_.js deleted file mode 100644 index 65a341319f..0000000000 --- a/apps/kimi-code/dist-web/assets/index--0t1wzw_.js +++ /dev/null @@ -1,812 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mhchem-DtR62fUK.js","assets/katex-DnlPpQZa.js","assets/mermaid.core-CqiFQExc.js","assets/_commonjsHelpers-CqkleIqs.js","assets/CodeBlockNode-BNOCy4ai.js","assets/safeRaf-DGuzXxDK.js","assets/index5-DEKGWcGw.js","assets/index11-BuI7qYB6.js","assets/rive-CeXCFBdn.js"])))=>i.map(i=>d[i]); -(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const r of s.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&i(r)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();/** -* @vue/shared v3.5.39 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/function Hb(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const bi={},D1=[],Wa=()=>{},KP=()=>!1,Vv=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Wb=e=>e.startsWith("onUpdate:"),no=Object.assign,G6=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},_Y=Object.prototype.hasOwnProperty,$i=(e,t)=>_Y.call(e,t),En=Array.isArray,F1=e=>Mm(e)==="[object Map]",vp=e=>Mm(e)==="[object Set]",DI=e=>Mm(e)==="[object Date]",IY=e=>Mm(e)==="[object RegExp]",qn=e=>typeof e=="function",ho=e=>typeof e=="string",ka=e=>typeof e=="symbol",ji=e=>e!==null&&typeof e=="object",Q6=e=>(ji(e)||qn(e))&&qn(e.then)&&qn(e.catch),ZP=Object.prototype.toString,Mm=e=>ZP.call(e),MY=e=>Mm(e).slice(8,-1),qb=e=>Mm(e)==="[object Object]",Ub=e=>ho(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Bh=Hb(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Vb=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},TY=/-\w/g,ur=Vb(e=>e.replace(TY,t=>t.slice(1).toUpperCase())),EY=/\B([A-Z])/g,$l=Vb(e=>e.replace(EY,"-$1").toLowerCase()),Kb=Vb(e=>e.charAt(0).toUpperCase()+e.slice(1)),i9=Vb(e=>e?`on${Kb(e)}`:""),Cr=(e,t)=>!Object.is(e,t),R1=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:i,value:n})},Zb=e=>{const t=parseFloat(e);return isNaN(t)?e:t},V9=e=>{const t=ho(e)?Number(e):NaN;return isNaN(t)?e:t};let FI;const Gb=()=>FI||(FI=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),LY="Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol",NY=Hb(LY);function an(e){if(En(e)){const t={};for(let n=0;n{if(n){const i=n.split(FY);i.length>1&&(t[i[0].trim()]=i[1].trim())}}),t}function Pe(e){let t="";if(ho(e))t=e;else if(En(e))for(let n=0;nnd(n,t))}const YP=e=>!!(e&&e.__v_isRef===!0),P=e=>ho(e)?e:e==null?"":En(e)||ji(e)&&(e.toString===ZP||!qn(e.toString))?YP(e)?P(e.value):JSON.stringify(e,JP,2):String(e),JP=(e,t)=>YP(t)?JP(e,t.value):F1(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[i,o],s)=>(n[W3(i,s)+" =>"]=o,n),{})}:vp(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>W3(n))}:ka(t)?W3(t):ji(t)&&!En(t)&&!qb(t)?String(t):t,W3=(e,t="")=>{var n;return ka(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};function jY(e){return e==null?"initial":typeof e=="string"?e===""?" ":e:String(e)}/** -* @vue/reactivity v3.5.39 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/let or;class XP{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&or&&(or.active?(this.parent=or,this.index=(or.scopes||(or.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t0&&--this._on===0){if(or===this)or=this.prevScope;else{let t=or;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,i;for(n=0,i=this.effects.length;n0)return;if(y0){let t=y0;for(y0=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;v0;){let t=v0;for(v0=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(i){e||(e=i)}t=n}}if(e)throw e}function n$(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function i$(e){let t,n=e.depsTail,i=n;for(;i;){const o=i.prevDep;i.version===-1?(i===n&&(n=o),X6(i),HY(i)):t=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=o}e.deps=t,e.depsTail=n}function D5(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(o$(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function o$(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===ov)||(e.globalVersion=ov,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!D5(e))))return;e.flags|=2;const t=e.dep,n=Ao,i=yu;Ao=e,yu=!0;try{n$(e);const o=e.fn(e._value);(t.version===0||Cr(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{Ao=n,yu=i,i$(e),e.flags&=-3}}function X6(e,t=!1){const{dep:n,prevSub:i,nextSub:o}=e;if(i&&(i.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=i,e.nextSub=void 0),n.subs===e&&(n.subs=i,!i&&n.computed)){n.computed.flags&=-5;for(let s=n.computed.deps;s;s=s.nextDep)X6(s,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function HY(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function s3t(e,t){e.effect instanceof K9&&(e=e.effect.fn);const n=new K9(e);t&&no(n,t);try{n.run()}catch(o){throw n.stop(),o}const i=n.run.bind(n);return i.effect=n,i}function r3t(e){e.effect.stop()}let yu=!0;const s$=[];function lc(){s$.push(yu),yu=!1}function ac(){const e=s$.pop();yu=e===void 0?!0:e}function RI(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Ao;Ao=void 0;try{t()}finally{Ao=n}}}let ov=0,WY=class{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}};class Jb{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!Ao||!yu||Ao===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Ao)n=this.activeLink=new WY(Ao,this),Ao.deps?(n.prevDep=Ao.depsTail,Ao.depsTail.nextDep=n,Ao.depsTail=n):Ao.deps=Ao.depsTail=n,r$(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const i=n.nextDep;i.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=i),n.prevDep=Ao.depsTail,n.nextDep=void 0,Ao.depsTail.nextDep=n,Ao.depsTail=n,Ao.deps===n&&(Ao.deps=i)}return n}trigger(t){this.version++,ov++,this.notify(t)}notify(t){Y6();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{J6()}}}function r$(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let i=t.deps;i;i=i.nextDep)r$(i)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Z9=new WeakMap,zh=Symbol(""),F5=Symbol(""),sv=Symbol("");function el(e,t,n){if(yu&&Ao){let i=Z9.get(e);i||Z9.set(e,i=new Map);let o=i.get(n);o||(i.set(n,o=new Jb),o.map=i,o.key=n),o.track()}}function $c(e,t,n,i,o,s){const r=Z9.get(e);if(!r){ov++;return}const l=a=>{a&&a.trigger()};if(Y6(),t==="clear")r.forEach(l);else{const a=En(e),u=a&&Ub(n);if(a&&n==="length"){const c=Number(i);r.forEach((d,h)=>{(h==="length"||h===sv||!ka(h)&&h>=c)&&l(d)})}else switch((n!==void 0||r.has(void 0))&&l(r.get(n)),u&&l(r.get(sv)),t){case"add":a?u&&l(r.get("length")):(l(r.get(zh)),F1(e)&&l(r.get(F5)));break;case"delete":a||(l(r.get(zh)),F1(e)&&l(r.get(F5)));break;case"set":F1(e)&&l(r.get(zh));break}}J6()}function qY(e,t){const n=Z9.get(e);return n&&n.get(t)}function Hp(e){const t=xi(e);return t===e?t:(el(t,"iterate",sv),fa(e)?t:t.map(Au))}function Xb(e){return el(e=xi(e),"iterate",sv),e}function qu(e,t){return id(e)?rm(ku(e)?Au(t):t):Au(t)}const UY={__proto__:null,[Symbol.iterator](){return U3(this,Symbol.iterator,e=>qu(this,e))},concat(...e){return Hp(this).concat(...e.map(t=>En(t)?Hp(t):t))},entries(){return U3(this,"entries",e=>(e[1]=qu(this,e[1]),e))},every(e,t){return Ic(this,"every",e,t,void 0,arguments)},filter(e,t){return Ic(this,"filter",e,t,n=>n.map(i=>qu(this,i)),arguments)},find(e,t){return Ic(this,"find",e,t,n=>qu(this,n),arguments)},findIndex(e,t){return Ic(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Ic(this,"findLast",e,t,n=>qu(this,n),arguments)},findLastIndex(e,t){return Ic(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Ic(this,"forEach",e,t,void 0,arguments)},includes(...e){return V3(this,"includes",e)},indexOf(...e){return V3(this,"indexOf",e)},join(e){return Hp(this).join(e)},lastIndexOf(...e){return V3(this,"lastIndexOf",e)},map(e,t){return Ic(this,"map",e,t,void 0,arguments)},pop(){return kg(this,"pop")},push(...e){return kg(this,"push",e)},reduce(e,...t){return OI(this,"reduce",e,t)},reduceRight(e,...t){return OI(this,"reduceRight",e,t)},shift(){return kg(this,"shift")},some(e,t){return Ic(this,"some",e,t,void 0,arguments)},splice(...e){return kg(this,"splice",e)},toReversed(){return Hp(this).toReversed()},toSorted(e){return Hp(this).toSorted(e)},toSpliced(...e){return Hp(this).toSpliced(...e)},unshift(...e){return kg(this,"unshift",e)},values(){return U3(this,"values",e=>qu(this,e))}};function U3(e,t,n){const i=Xb(e),o=i[t]();return i!==e&&!fa(e)&&(o._next=o.next,o.next=()=>{const s=o._next();return s.done||(s.value=n(s.value)),s}),o}const VY=Array.prototype;function Ic(e,t,n,i,o,s){const r=Xb(e),l=r!==e&&!fa(e),a=r[t];if(a!==VY[t]){const d=a.apply(e,s);return l?Au(d):d}let u=n;r!==e&&(l?u=function(d,h){return n.call(this,qu(e,d),h,e)}:n.length>2&&(u=function(d,h){return n.call(this,d,h,e)}));const c=a.call(r,u,i);return l&&o?o(c):c}function OI(e,t,n,i){const o=Xb(e),s=o!==e&&!fa(e);let r=n,l=!1;o!==e&&(s?(l=i.length===0,r=function(u,c,d){return l&&(l=!1,u=qu(e,u)),n.call(this,u,qu(e,c),d,e)}):n.length>3&&(r=function(u,c,d){return n.call(this,u,c,d,e)}));const a=o[t](r,...i);return l?qu(e,a):a}function V3(e,t,n){const i=xi(e);el(i,"iterate",sv);const o=i[t](...n);return(o===-1||o===!1)&&n4(n[0])?(n[0]=xi(n[0]),i[t](...n)):o}function kg(e,t,n=[]){lc(),Y6();const i=xi(e)[t].apply(e,n);return J6(),ac(),i}const KY=Hb("__proto__,__v_isRef,__isVue"),l$=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(ka));function ZY(e){ka(e)||(e=String(e));const t=xi(this);return el(t,"has",e),t.hasOwnProperty(e)}class a${constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,i){if(n==="__v_skip")return t.__v_skip;const o=this._isReadonly,s=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return s;if(n==="__v_raw")return i===(o?s?p$:h$:s?f$:d$).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(i)?t:void 0;const r=En(t);if(!o){let a;if(r&&(a=UY[n]))return a;if(n==="hasOwnProperty")return ZY}const l=Reflect.get(t,n,mo(t)?t:i);if((ka(n)?l$.has(n):KY(n))||(o||el(t,"get",n),s))return l;if(mo(l)){const a=r&&Ub(n)?l:l.value;return o&&ji(a)?G9(a):a}return ji(l)?o?G9(l):Ki(l):l}}class u$ extends a${constructor(t=!1){super(!1,t)}set(t,n,i,o){let s=t[n];const r=En(t)&&Ub(n);if(!this._isShallow){const u=id(s);if(!fa(i)&&!id(i)&&(s=xi(s),i=xi(i)),!r&&mo(s)&&!mo(i))return u||(s.value=i),!0}const l=r?Number(n)e,q2=e=>Reflect.getPrototypeOf(e);function XY(e,t,n){return function(...i){const o=this.__v_raw,s=xi(o),r=F1(s),l=e==="entries"||e===Symbol.iterator&&r,a=e==="keys"&&r,u=o[e](...i),c=n?R5:t?rm:Au;return!t&&el(s,"iterate",a?F5:zh),no(Object.create(u),{next(){const{value:d,done:h}=u.next();return h?{value:d,done:h}:{value:l?[c(d[0]),c(d[1])]:c(d),done:h}}})}}function U2(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function eJ(e,t){const n={get(o){const s=this.__v_raw,r=xi(s),l=xi(o);e||(Cr(o,l)&&el(r,"get",o),el(r,"get",l));const{has:a}=q2(r),u=t?R5:e?rm:Au;if(a.call(r,o))return u(s.get(o));if(a.call(r,l))return u(s.get(l));s!==r&&s.get(o)},get size(){const o=this.__v_raw;return!e&&el(xi(o),"iterate",zh),o.size},has(o){const s=this.__v_raw,r=xi(s),l=xi(o);return e||(Cr(o,l)&&el(r,"has",o),el(r,"has",l)),o===l?s.has(o):s.has(o)||s.has(l)},forEach(o,s){const r=this,l=r.__v_raw,a=xi(l),u=t?R5:e?rm:Au;return!e&&el(a,"iterate",zh),l.forEach((c,d)=>o.call(s,u(c),u(d),r))}};return no(n,e?{add:U2("add"),set:U2("set"),delete:U2("delete"),clear:U2("clear")}:{add(o){const s=xi(this),r=q2(s),l=xi(o),a=!t&&!fa(o)&&!id(o)?l:o;return r.has.call(s,a)||Cr(o,a)&&r.has.call(s,o)||Cr(l,a)&&r.has.call(s,l)||(s.add(a),$c(s,"add",a,a)),this},set(o,s){!t&&!fa(s)&&!id(s)&&(s=xi(s));const r=xi(this),{has:l,get:a}=q2(r);let u=l.call(r,o);u||(o=xi(o),u=l.call(r,o));const c=a.call(r,o);return r.set(o,s),u?Cr(s,c)&&$c(r,"set",o,s):$c(r,"add",o,s),this},delete(o){const s=xi(this),{has:r,get:l}=q2(s);let a=r.call(s,o);a||(o=xi(o),a=r.call(s,o)),l&&l.call(s,o);const u=s.delete(o);return a&&$c(s,"delete",o,void 0),u},clear(){const o=xi(this),s=o.size!==0,r=o.clear();return s&&$c(o,"clear",void 0,void 0),r}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=XY(o,e,t)}),n}function e4(e,t){const n=eJ(e,t);return(i,o,s)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?i:Reflect.get($i(n,o)&&o in i?n:i,o,s)}const tJ={get:e4(!1,!1)},nJ={get:e4(!1,!0)},iJ={get:e4(!0,!1)},oJ={get:e4(!0,!0)},d$=new WeakMap,f$=new WeakMap,h$=new WeakMap,p$=new WeakMap;function sJ(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Ki(e){return id(e)?e:t4(e,!1,GY,tJ,d$)}function tp(e){return t4(e,!1,YY,nJ,f$)}function G9(e){return t4(e,!0,QY,iJ,h$)}function a3t(e){return t4(e,!0,JY,oJ,p$)}function t4(e,t,n,i,o){if(!ji(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const s=o.get(e);if(s)return s;const r=sJ(MY(e));if(r===0)return e;const l=new Proxy(e,r===2?i:n);return o.set(e,l),l}function ku(e){return id(e)?ku(e.__v_raw):!!(e&&e.__v_isReactive)}function id(e){return!!(e&&e.__v_isReadonly)}function fa(e){return!!(e&&e.__v_isShallow)}function n4(e){return e?!!e.__v_raw:!1}function xi(e){const t=e&&e.__v_raw;return t?xi(t):e}function Ot(e){return!$i(e,"__v_skip")&&Object.isExtensible(e)&&GP(e,"__v_skip",!0),e}const Au=e=>ji(e)?Ki(e):e,rm=e=>ji(e)?G9(e):e;function mo(e){return e?e.__v_isRef===!0:!1}function q(e){return m$(e,!1)}function _u(e){return m$(e,!0)}function m$(e,t){return mo(e)?e:new rJ(e,t)}class rJ{constructor(t,n){this.dep=new Jb,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:xi(t),this._value=n?t:Au(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,i=this.__v_isShallow||fa(t)||id(t);t=i?t:xi(t),Cr(t,n)&&(this._rawValue=t,this._value=i?t:Au(t),this.dep.trigger())}}function lJ(e){e.dep&&e.dep.trigger()}function f(e){return mo(e)?e.value:e}function au(e){return qn(e)?e():f(e)}const aJ={get:(e,t,n)=>t==="__v_raw"?e:f(Reflect.get(e,t,n)),set:(e,t,n,i)=>{const o=e[t];return mo(o)&&!mo(n)?(o.value=n,!0):Reflect.set(e,t,n,i)}};function g$(e){return ku(e)?e:new Proxy(e,aJ)}class uJ{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new Jb,{get:i,set:o}=t(n.track.bind(n),n.trigger.bind(n));this._get=i,this._set=o}get value(){return this._value=this._get()}set value(t){this._set(t)}}function cJ(e){return new uJ(e)}function dJ(e){const t=En(e)?new Array(e.length):{};for(const n in e)t[n]=v$(e,n);return t}class fJ{constructor(t,n,i){this._object=t,this._defaultValue=i,this.__v_isRef=!0,this._value=void 0,this._key=ka(n)?n:String(n),this._raw=xi(t);let o=!0,s=t;if(!En(t)||ka(this._key)||!Ub(this._key))do o=!n4(s)||fa(s);while(o&&(s=s.__v_raw));this._shallow=o}get value(){let t=this._object[this._key];return this._shallow&&(t=f(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&mo(this._raw[this._key])){const n=this._object[this._key];if(mo(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return qY(this._raw,this._key)}}class hJ{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function pJ(e,t,n){return mo(e)?e:qn(e)?new hJ(e):ji(e)&&arguments.length>1?v$(e,t,n):q(e)}function v$(e,t,n){return new fJ(e,t,n)}class mJ{constructor(t,n,i){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Jb(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=ov-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=i}notify(){if(this.flags|=16,!(this.flags&8)&&Ao!==this)return t$(this,!0),!0}get value(){const t=this.dep.track();return o$(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function gJ(e,t,n=!1){let i,o;return qn(e)?i=e:(i=e.get,o=e.set),new mJ(i,o,n)}const u3t={GET:"get",HAS:"has",ITERATE:"iterate"},c3t={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},V2={},Q9=new WeakMap;let Nd;function d3t(){return Nd}function vJ(e,t=!1,n=Nd){if(n){let i=Q9.get(n);i||Q9.set(n,i=[]),i.push(e)}}function yJ(e,t,n=bi){const{immediate:i,deep:o,once:s,scheduler:r,augmentJob:l,call:a}=n,u=w=>o?w:fa(w)||o===!1||o===0?Bc(w,1):Bc(w);let c,d,h,p,m=!1,g=!1;if(mo(e)?(d=()=>e.value,m=fa(e)):ku(e)?(d=()=>u(e),m=!0):En(e)?(g=!0,m=e.some(w=>ku(w)||fa(w)),d=()=>e.map(w=>{if(mo(w))return w.value;if(ku(w))return u(w);if(qn(w))return a?a(w,2):w()})):qn(e)?t?d=a?()=>a(e,2):e:d=()=>{if(h){lc();try{h()}finally{ac()}}const w=Nd;Nd=c;try{return a?a(e,3,[p]):e(p)}finally{Nd=w}}:d=Wa,t&&o){const w=d,M=o===!0?1/0:o;d=()=>Bc(w(),M)}const y=Tm(),b=()=>{c.stop(),y&&y.active&&G6(y.effects,c)};if(s&&t){const w=t;t=(...M)=>{const N=w(...M);return b(),N}}let v=g?new Array(e.length).fill(V2):V2;const C=w=>{if(!(!(c.flags&1)||!c.dirty&&!w))if(t){const M=c.run();if(w||o||m||(g?M.some((N,T)=>Cr(N,v[T])):Cr(M,v))){h&&h();const N=Nd;Nd=c;try{const T=[M,v===V2?void 0:g&&v[0]===V2?[]:v,p];v=M,a?a(t,3,T):t(...T)}finally{Nd=N}}}else c.run()};return l&&l(C),c=new K9(d),c.scheduler=r?()=>r(C,!1):C,p=w=>vJ(w,!1,c),h=c.onStop=()=>{const w=Q9.get(c);if(w){if(a)a(w,4);else for(const M of w)M();Q9.delete(c)}},t?i?C(!0):v=c.run():r?r(C.bind(null,!0),!0):c.run(),b.pause=c.pause.bind(c),b.resume=c.resume.bind(c),b.stop=b,b}function Bc(e,t=1/0,n){if(t<=0||!ji(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,mo(e))Bc(e.value,t,n);else if(En(e))for(let i=0;i{Bc(i,t,n)});else if(qb(e)){for(const i in e)Bc(e[i],t,n);for(const i of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,i)&&Bc(e[i],t,n)}return e}/** -* @vue/runtime-core v3.5.39 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/const y$=[];function kJ(e){y$.push(e)}function bJ(){y$.pop()}function f3t(e,t){}const h3t={SETUP_FUNCTION:0,0:"SETUP_FUNCTION",RENDER_FUNCTION:1,1:"RENDER_FUNCTION",NATIVE_EVENT_HANDLER:5,5:"NATIVE_EVENT_HANDLER",COMPONENT_EVENT_HANDLER:6,6:"COMPONENT_EVENT_HANDLER",VNODE_HOOK:7,7:"VNODE_HOOK",DIRECTIVE_HOOK:8,8:"DIRECTIVE_HOOK",TRANSITION_HOOK:9,9:"TRANSITION_HOOK",APP_ERROR_HANDLER:10,10:"APP_ERROR_HANDLER",APP_WARN_HANDLER:11,11:"APP_WARN_HANDLER",FUNCTION_REF:12,12:"FUNCTION_REF",ASYNC_COMPONENT_LOADER:13,13:"ASYNC_COMPONENT_LOADER",SCHEDULER:14,14:"SCHEDULER",COMPONENT_UPDATE:15,15:"COMPONENT_UPDATE",APP_UNMOUNT_CLEANUP:16,16:"APP_UNMOUNT_CLEANUP"},wJ={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function Kv(e,t,n,i){try{return i?e(...i):e()}catch(o){Em(o,t,n)}}function Ka(e,t,n,i){if(qn(e)){const o=Kv(e,t,n,i);return o&&Q6(o)&&o.catch(s=>{Em(s,t,n)}),o}if(En(e)){const o=[];for(let s=0;s>>1,o=ml[i],s=rv(o);s=rv(n)?ml.push(e):ml.splice(AJ(t),0,e),e.flags|=1,b$()}}function b$(){Y9||(Y9=k$.then(w$))}function J9(e){En(e)?O1.push(...e):Dd&&e.id===-1?Dd.splice(l1+1,0,e):e.flags&1||(O1.push(e),e.flags|=1),b$()}function PI(e,t,n=zu+1){for(;nrv(n)-rv(i));if(O1.length=0,Dd){Dd.push(...t);return}for(Dd=t,l1=0;l1e.id==null?e.flags&2?-1:1/0:e.id;function w$(e){try{for(zu=0;zua1.emit(o,...s)),K2=[]):typeof window<"u"&&window.HTMLElement&&!((i=(n=window.navigator)==null?void 0:n.userAgent)!=null&&i.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(s=>{C$(s,t)}),setTimeout(()=>{a1||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,K2=[])},3e3)):K2=[]}let zr=null,i4=null;function lv(e){const t=zr;return zr=e,i4=e&&e.type.__scopeId||null,t}function p3t(e){i4=e}function m3t(){i4=null}const g3t=e=>ae;function ae(e,t=zr,n){if(!t||e._n)return e;const i=(...o)=>{i._d&&sk(-1);const s=lv(t);let r;try{r=e(...o)}finally{lv(s),i._d&&sk(1)}return r};return i._n=!0,i._c=!0,i._d=!0,i}function mi(e,t){if(zr===null)return e;const n=Qv(zr),i=e.dirs||(e.dirs=[]);for(let o=0;o1)return n&&qn(t)?t.call(i&&i.proxy):t}}function xJ(){return!!(Vs()||jh)}const SJ=Symbol.for("v-scx"),_J=()=>rn(SJ);function P1(e,t){return Zv(e,null,t)}function v3t(e,t){return Zv(e,null,{flush:"post"})}function IJ(e,t){return Zv(e,null,{flush:"sync"})}function qe(e,t,n){return Zv(e,t,n)}function Zv(e,t,n=bi){const{immediate:i,deep:o,flush:s,once:r}=n,l=no({},n),a=t&&i||!t&&s!=="post";let u;if(ip){if(s==="sync"){const p=_J();u=p.__watcherHandles||(p.__watcherHandles=[])}else if(!a){const p=()=>{};return p.stop=Wa,p.resume=Wa,p.pause=Wa,p}}const c=$r;l.call=(p,m,g)=>Ka(p,c,m,g);let d=!1;s==="post"?l.scheduler=p=>{Es(p,c&&c.suspense)}:s!=="sync"&&(d=!0,l.scheduler=(p,m)=>{m?p():e7(p)}),l.augmentJob=p=>{t&&(p.flags|=4),d&&(p.flags|=2,c&&(p.id=c.uid,p.i=c))};const h=yJ(e,t,l);return ip&&(u?u.push(h):a&&h()),h}function MJ(e,t,n){const i=this.proxy,o=ho(e)?e.includes(".")?A$(i,e):()=>i[e]:e.bind(i,i);let s;qn(t)?s=t:(s=t.handler,n=t);const r=Dm(this),l=Zv(o,s.bind(i),n);return r(),l}function A$(e,t){const n=t.split(".");return()=>{let i=e;for(let o=0;oe.__isTeleport,vh=e=>e&&(e.disabled||e.disabled===""),TJ=e=>e&&(e.defer||e.defer===""),$I=e=>typeof SVGElement<"u"&&e instanceof SVGElement,BI=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,O5=(e,t)=>{const n=e&&e.to;return ho(n)?t?t(n):null:n},EJ={name:"Teleport",__isTeleport:!0,process(e,t,n,i,o,s,r,l,a,u){const{mc:c,pc:d,pbc:h,o:{insert:p,querySelector:m,createText:g,createComment:y,parentNode:b}}=u,v=vh(t.props);let{dynamicChildren:C}=t;const w=(T,S,x)=>{T.shapeFlag&16&&c(T.children,S,x,o,s,r,l,a)},M=(T=t)=>{const S=vh(T.props),x=T.target=O5(T.props,m),A=P5(x,T,g,p);x&&(r!=="svg"&&$I(x)?r="svg":r!=="mathml"&&BI(x)&&(r="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(x),S||(w(T,x,A),Ug(T,!1)))},N=T=>{const S=()=>{if(Sd.get(T)===S){if(Sd.delete(T),vh(T.props)){const x=b(T.el)||n;w(T,x,T.anchor),Ug(T,!0)}M(T)}};Sd.set(T,S),Es(S,s)};if(e==null){const T=t.el=g(""),S=t.anchor=g("");if(p(T,n,i),p(S,n,i),TJ(t.props)||s&&s.pendingBranch){N(t);return}v&&(w(t,n,S),Ug(t,!0)),M()}else{t.el=e.el;const T=t.anchor=e.anchor,S=Sd.get(e);if(S){S.flags|=8,Sd.delete(e),N(t);return}t.targetStart=e.targetStart;const x=t.target=e.target,A=t.targetAnchor=e.targetAnchor,E=vh(e.props),I=E?n:x,R=E?T:A;if(r==="svg"||$I(x)?r="svg":(r==="mathml"||BI(x))&&(r="mathml"),C?(h(e.dynamicChildren,C,I,o,s,r,l),c7(e,t,!0)):a||d(e,t,I,R,o,s,r,l,!1),v)E?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Z2(t,n,T,u,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const W=O5(t.props,m);W&&(t.target=W,Z2(t,W,null,u,0))}else E&&Z2(t,x,A,u,1);Ug(t,v)}},remove(e,t,n,{um:i,o:{remove:o}},s){const{shapeFlag:r,children:l,anchor:a,targetStart:u,targetAnchor:c,target:d,props:h}=e,p=vh(h),m=s||!p,g=Sd.get(e);if(g&&(g.flags|=8,Sd.delete(e)),d&&(o(u),o(c)),s&&o(a),!g&&(p||d)&&r&16)for(let y=0;y{e.isMounted=!0}),si(()=>{e.isUnmounting=!0}),e}const _a=[Function,Array],I$={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:_a,onEnter:_a,onAfterEnter:_a,onEnterCancelled:_a,onBeforeLeave:_a,onLeave:_a,onAfterLeave:_a,onLeaveCancelled:_a,onBeforeAppear:_a,onAppear:_a,onAfterAppear:_a,onAppearCancelled:_a},M$=e=>{const t=e.subTree;return t.component?M$(t.component):t},NJ={name:"BaseTransition",props:I$,setup(e,{slots:t}){const n=Vs(),i=_$();return()=>{const o=t.default&&t7(t.default(),!0),s=o&&o.length?T$(o):n.subTree?J():void 0;if(!s)return;const r=xi(e),{mode:l}=r;if(i.isLeaving)return K3(s);const a=zI(s);if(!a)return K3(s);let u=av(a,r,i,n,d=>u=d);a.type!==Bs&&af(a,u);let c=n.subTree&&zI(n.subTree);if(c&&c.type!==Bs&&!du(c,a)&&M$(n).type!==Bs){let d=av(c,r,i,n);if(af(c,d),l==="out-in"&&a.type!==Bs)return i.isLeaving=!0,d.afterLeave=()=>{i.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,c=void 0},K3(s);l==="in-out"&&a.type!==Bs?d.delayLeave=(h,p,m)=>{const g=E$(i,c);g[String(c.key)]=c,h[Na]=()=>{p(),h[Na]=void 0,delete u.delayedLeave,c=void 0},u.delayedLeave=()=>{m(),delete u.delayedLeave,c=void 0}}:c=void 0}else c&&(c=void 0);return s}}};function T$(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Bs){t=n;break}}return t}const DJ=NJ;function E$(e,t){const{leavingVNodes:n}=e;let i=n.get(t.type);return i||(i=Object.create(null),n.set(t.type,i)),i}function av(e,t,n,i,o){const{appear:s,mode:r,persisted:l=!1,onBeforeEnter:a,onEnter:u,onAfterEnter:c,onEnterCancelled:d,onBeforeLeave:h,onLeave:p,onAfterLeave:m,onLeaveCancelled:g,onBeforeAppear:y,onAppear:b,onAfterAppear:v,onAppearCancelled:C}=t,w=String(e.key),M=E$(n,e),N=(x,A)=>{x&&Ka(x,i,9,A)},T=(x,A)=>{const E=A[1];N(x,A),En(x)?x.every(I=>I.length<=1)&&E():x.length<=1&&E()},S={mode:r,persisted:l,beforeEnter(x){let A=a;if(!n.isMounted)if(s)A=y||a;else return;x[Na]&&x[Na](!0);const E=M[w];E&&du(e,E)&&E.el[Na]&&E.el[Na](),N(A,[x])},enter(x){if(M[w]===e)return;let A=u,E=c,I=d;if(!n.isMounted)if(s)A=b||u,E=v||c,I=C||d;else return;let R=!1;x[bg]=z=>{R||(R=!0,z?N(I,[x]):N(E,[x]),S.delayedLeave&&S.delayedLeave(),x[bg]=void 0)};const W=x[bg].bind(null,!1);A?T(A,[x,W]):W()},leave(x,A){const E=String(e.key);if(x[bg]&&x[bg](!0),n.isUnmounting)return A();N(h,[x]);let I=!1;x[Na]=W=>{I||(I=!0,A(),W?N(g,[x]):N(m,[x]),x[Na]=void 0,M[E]===e&&delete M[E])};const R=x[Na].bind(null,!1);M[E]=e,p?T(p,[x,R]):R()},clone(x){const A=av(x,t,n,i,o);return o&&o(A),A}};return S}function K3(e){if(Gv(e))return e=od(e),e.children=null,e}function zI(e){if(!Gv(e))return S$(e.type)&&e.children?T$(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&qn(n.default))return n.default()}}function af(e,t){e.shapeFlag&6&&e.component?(e.transition=t,af(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function t7(e,t=!1,n){let i=[],o=0;for(let s=0;s1)for(let s=0;sn.value,set:s=>n.value=s})}return n}function jI(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const ek=new WeakMap;function $1(e,t,n,i,o=!1){if(En(e)){e.forEach((g,y)=>$1(g,t&&(En(t)?t[y]:t),n,i,o));return}if(Zc(i)&&!o){i.shapeFlag&512&&i.type.__asyncResolved&&i.component.subTree.component&&$1(e,t,n,i.component.subTree);return}const s=i.shapeFlag&4?Qv(i.component):i.el,r=o?null:s,{i:l,r:a}=e,u=t&&t.r,c=l.refs===bi?l.refs={}:l.refs,d=l.setupState,h=xi(d),p=d===bi?KP:g=>jI(c,g)?!1:$i(h,g),m=(g,y)=>!(y&&jI(c,y));if(u!=null&&u!==a){if(HI(t),ho(u))c[u]=null,p(u)&&(d[u]=null);else if(mo(u)){const g=t;m(u,g.k)&&(u.value=null),g.k&&(c[g.k]=null)}}if(qn(a)){lc();try{Kv(a,l,12,[r,c])}finally{ac()}}else{const g=ho(a),y=mo(a);if(g||y){const b=()=>{if(e.f){const v=g?p(a)?d[a]:c[a]:m()||!e.k?a.value:c[e.k];if(o)En(v)&&G6(v,s);else if(En(v))v.includes(s)||v.push(s);else if(g)c[a]=[s],p(a)&&(d[a]=c[a]);else{const C=[s];m(a,e.k)&&(a.value=C),e.k&&(c[e.k]=C)}}else g?(c[a]=r,p(a)&&(d[a]=r)):y&&(m(a,e.k)&&(a.value=r),e.k&&(c[e.k]=r))};if(r){const v=()=>{b(),ek.delete(e)};v.id=-1,ek.set(e,v),Es(v,n)}else HI(e),b()}}}function HI(e){const t=ek.get(e);t&&(t.flags|=8,ek.delete(e))}let WI=!1;const Wp=()=>{WI||(console.error("Hydration completed but contains mismatches."),WI=!0)},RJ=e=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",OJ=e=>e.namespaceURI.includes("MathML"),G2=e=>{if(e.nodeType===1){if(RJ(e))return"svg";if(OJ(e))return"mathml"}},k1=e=>e.nodeType===8;function PJ(e){const{mt:t,p:n,o:{patchProp:i,createText:o,nextSibling:s,parentNode:r,remove:l,insert:a,createComment:u}}=e,c=(C,w)=>{if(!w.hasChildNodes()){n(null,C,w),X9(),w._vnode=C;return}d(w.firstChild,C,null,null,null),X9(),w._vnode=C},d=(C,w,M,N,T,S=!1)=>{S=S||!!w.dynamicChildren;const x=k1(C)&&C.data==="[",A=()=>g(C,w,M,N,T,x),{type:E,ref:I,shapeFlag:R,patchFlag:W}=w;let z=C.nodeType;w.el=C,W===-2&&(S=!1,w.dynamicChildren=null);let F=null;switch(E){case Qd:z!==3?w.children===""?(a(w.el=o(""),r(C),C),F=C):F=A():(C.data!==w.children&&(Wp(),C.data=w.children),F=s(C));break;case Bs:v(C)?(F=s(C),b(w.el=C.content.firstChild,C,M)):z!==8||x?F=A():F=s(C);break;case z1:if(x&&(C=s(C),z=C.nodeType),z===1||z===3){F=C;const O=!w.children.length;for(let B=0;B{S=S||!!w.dynamicChildren;const{type:x,dynamicProps:A,props:E,patchFlag:I,shapeFlag:R,dirs:W,transition:z}=w,F=x==="input"||x==="option",O=!!A;if(F||O||I!==-1){W&&Wu(w,null,M,"created");let B=!1;if(v(C)){B=J$(null,z)&&M&&M.vnode.props&&M.vnode.props.appear;const $=C.content.firstChild;if(B){const V=$.getAttribute("class");V&&($.$cls=V),z.beforeEnter($)}b($,C,M),w.el=C=$}if(R&16&&!(E&&(E.innerHTML||E.textContent))){let $=p(C.firstChild,w,C,M,N,T,S);for($&&!o9(C,1)&&Wp();$;){const V=$;$=$.nextSibling,l(V)}}else if(R&8){let $=w.children;$[0]===` -`&&(C.tagName==="PRE"||C.tagName==="TEXTAREA")&&($=$.slice(1));const{textContent:V}=C;V!==$&&V!==$.replace(/\r\n|\r/g,` -`)&&(o9(C,0)||Wp(),C.textContent=w.children)}if(E){if(F||O||!S||I&48){const $=C.tagName.includes("-");for(const V in E)(F&&(V.endsWith("value")||V==="indeterminate")||Vv(V)&&!Bh(V)||V[0]==="."||$&&!Bh(V)||A&&A.includes(V))&&i(C,V,null,E[V],void 0,M)}else if(E.onClick)i(C,"onClick",null,E.onClick,void 0,M);else if(I&4&&ku(E.style))for(const $ in E.style)E.style[$]}let j;(j=E&&E.onVnodeBeforeMount)&&Fl(j,M,w),W&&Wu(w,null,M,"beforeMount"),((j=E&&E.onVnodeMounted)||W||B)&&nB(()=>{j&&Fl(j,M,w),B&&z.enter(C),W&&Wu(w,null,M,"mounted")},N)}return C.nextSibling},p=(C,w,M,N,T,S,x)=>{x=x||!!w.dynamicChildren;const A=w.children,E=A.length;let I=!1;for(let R=0;R{const{slotScopeIds:x}=w;x&&(T=T?T.concat(x):x);const A=r(C),E=p(s(C),w,A,M,N,T,S);return E&&k1(E)&&E.data==="]"?s(w.anchor=E):(Wp(),a(w.anchor=u("]"),A,E),E)},g=(C,w,M,N,T,S)=>{if(BJ(C,w)||Wp(),w.el=null,S){const E=y(C);for(;;){const I=s(C);if(I&&I!==E)l(I);else break}}const x=s(C),A=r(C);return l(C),n(null,w,A,x,M,N,G2(A),T),M&&(M.vnode.el=w.el,r4(M,w.el)),x},y=(C,w="[",M="]")=>{let N=0;for(;C;)if(C=s(C),C&&k1(C)&&(C.data===w&&N++,C.data===M)){if(N===0)return s(C);N--}return C},b=(C,w,M)=>{const N=w.parentNode;N&&N.replaceChild(C,w);let T=M;for(;T;)T.vnode.el===w&&(T.vnode.el=T.subTree.el=C),T=T.parent},v=C=>C.nodeType===1&&C.tagName==="TEMPLATE";return[c,d]}const tk="data-allow-mismatch",$J={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function o9(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(tk);)e=e.parentElement;return i7(e&&e.getAttribute(tk),t)}function i7(e,t){if(e==null)return!1;if(e==="")return!0;{const n=e.split(",");return t===0&&n.includes("children")?!0:n.includes($J[t])}}function BJ(e,t){return o9(e.parentElement,1)||zJ(e)||jJ(t)}function zJ(e){return e.nodeType===1&&i7(e.getAttribute(tk),1)}function jJ({props:e}){const t=e&&e[tk];return typeof t=="string"&&i7(t,1)}const HJ=Gb().requestIdleCallback||(e=>setTimeout(e,1)),WJ=Gb().cancelIdleCallback||(e=>clearTimeout(e)),k3t=(e=1e4)=>t=>{const n=HJ(t,{timeout:e});return()=>WJ(n)};function qJ(e){const{top:t,left:n,bottom:i,right:o}=e.getBoundingClientRect(),{innerHeight:s,innerWidth:r}=window;return(t>0&&t0&&i0&&n0&&o(t,n)=>{const i=new IntersectionObserver(o=>{for(const s of o)if(s.isIntersecting){i.disconnect(),t();break}},e);return n(o=>{if(o instanceof Element){if(qJ(o))return t(),i.disconnect(),!1;i.observe(o)}}),()=>i.disconnect()},w3t=e=>t=>{if(e){const n=matchMedia(e);if(n.matches)t();else return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t)}},C3t=(e=[])=>(t,n)=>{ho(e)&&(e=[e]);let i=!1;const o=r=>{i||(i=!0,s(),t(),r.target.dispatchEvent(new r.constructor(r.type,r)))},s=()=>{n(r=>{for(const l of e)r.removeEventListener(l,o)})};return n(r=>{for(const l of e)r.addEventListener(l,o,{once:!0})}),s};function UJ(e,t){if(k1(e)&&e.data==="["){let n=1,i=e.nextSibling;for(;i;){if(i.nodeType===1){if(t(i)===!1)break}else if(k1(i))if(i.data==="]"){if(--n===0)break}else i.data==="["&&n++;i=i.nextSibling}}else t(e)}const Zc=e=>!!e.type.__asyncLoader;function Yu(e){qn(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:i,delay:o=200,hydrate:s,timeout:r,suspensible:l=!0,onError:a}=e;let u=null,c,d=0;const h=()=>(d++,u=null,p()),p=()=>{let m;return u||(m=u=t().catch(g=>{if(g=g instanceof Error?g:new Error(String(g)),a)return new Promise((y,b)=>{a(g,()=>y(h()),()=>b(g),d+1)});throw g}).then(g=>m!==u&&u?u:(g&&(g.__esModule||g[Symbol.toStringTag]==="Module")&&(g=g.default),c=g,g)))};return dt({name:"AsyncComponentWrapper",__asyncLoader:p,__asyncHydrate(m,g,y){let b=!1;(g.bu||(g.bu=[])).push(()=>b=!0);const v=()=>{b||y()},C=s?()=>{const w=s(v,M=>UJ(m,M));w&&(g.bum||(g.bum=[])).push(w)}:v;c?C():p().then(()=>!g.isUnmounted&&C())},get __asyncResolved(){return c},setup(){const m=$r;if(n7(m),c)return()=>Q2(c,m);const g=M=>{u=null,Em(M,m,13,!i)};if(l&&m.suspense||ip)return p().then(M=>()=>Q2(M,m)).catch(M=>(g(M),()=>i?U(i,{error:M}):null));const y=q(!1),b=q(),v=q(!!o);let C,w;return $n(()=>{C!=null&&clearTimeout(C),w!=null&&clearTimeout(w)}),o&&(w=setTimeout(()=>{m.isUnmounted||(v.value=!1)},o)),r!=null&&(C=setTimeout(()=>{if(!m.isUnmounted&&!y.value&&!b.value){const M=new Error(`Async component timed out after ${r}ms.`);g(M),b.value=M}},r)),p().then(()=>{m.isUnmounted||(y.value=!0,m.parent&&Gv(m.parent.vnode)&&m.parent.update())}).catch(M=>{if(m.isUnmounted){u=null;return}g(M),b.value=M}),()=>{if(y.value&&c)return Q2(c,m);if(b.value&&i)return U(i,{error:b.value});if(n&&!v.value)return Q2(n,m)}}})}function Q2(e,t){const{ref:n,props:i,children:o,ce:s}=t.vnode,r=U(e,i,o);return r.ref=n,r.ce=s,delete t.vnode.ce,r}const Gv=e=>e.type.__isKeepAlive,VJ={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=Vs(),i=n.ctx;if(!i.renderer)return()=>{const v=t.default&&t.default();return v&&v.length===1?v[0]:v};const o=new Map,s=new Set;let r=null;const l=n.suspense,{renderer:{p:a,m:u,um:c,o:{createElement:d}}}=i,h=d("div");i.activate=(v,C,w,M,N)=>{const T=v.component;u(v,C,w,0,l),a(T.vnode,v,C,w,T,l,M,v.slotScopeIds,N),Es(()=>{T.isDeactivated=!1,T.a&&R1(T.a);const S=v.props&&v.props.onVnodeMounted;S&&Fl(S,T.parent,v)},l)},i.deactivate=v=>{const C=v.component;ik(C.m),ik(C.a),u(v,h,null,1,l),Es(()=>{C.da&&R1(C.da);const w=v.props&&v.props.onVnodeUnmounted;w&&Fl(w,C.parent,v),C.isDeactivated=!0},l)};function p(v){Z3(v),c(v,n,l,!0)}function m(v){o.forEach((C,w)=>{const M=V5(Zc(C)?C.type.__asyncResolved||{}:C.type);M&&!v(M)&&g(w)})}function g(v){const C=o.get(v);C&&(!r||!du(C,r))?p(C):r&&Z3(r),o.delete(v),s.delete(v)}qe(()=>[e.include,e.exclude],([v,C])=>{v&&m(w=>Vg(v,w)),C&&m(w=>!Vg(C,w))},{flush:"post",deep:!0});let y=null;const b=()=>{y!=null&&(ok(n.subTree.type)?Es(()=>{o.set(y,Y2(n.subTree))},n.subTree.suspense):o.set(y,Y2(n.subTree)))};return xn(b),Lm(b),si(()=>{o.forEach(v=>{const{subTree:C,suspense:w}=n,M=Y2(C);if(v.type===M.type&&v.key===M.key){Z3(M);const N=M.component.da;N&&Es(N,w);return}p(v)})}),()=>{if(y=null,!t.default)return r=null;const v=t.default(),C=v[0];if(v.length>1)return r=null,v;if(!uf(C)||!(C.shapeFlag&4)&&!(C.shapeFlag&128))return r=null,C;let w=Y2(C);if(w.type===Bs)return r=null,w;const M=w.type,N=V5(Zc(w)?w.type.__asyncResolved||{}:M),{include:T,exclude:S,max:x}=e;if(T&&(!N||!Vg(T,N))||S&&N&&Vg(S,N))return w.shapeFlag&=-257,r=w,C;const A=w.key==null?M:w.key,E=o.get(A);return w.el&&(w=od(w),C.shapeFlag&128&&(C.ssContent=w)),y=A,E?(w.el=E.el,w.component=E.component,w.transition&&af(w,w.transition),w.shapeFlag|=512,s.delete(A),s.add(A)):(s.add(A),x&&s.size>parseInt(x,10)&&g(s.values().next().value)),w.shapeFlag|=256,r=w,ok(C.type)?C:w}}},A3t=VJ;function Vg(e,t){return En(e)?e.some(n=>Vg(n,t)):ho(e)?e.split(",").includes(t):IY(e)?(e.lastIndex=0,e.test(t)):!1}function KJ(e,t){L$(e,"a",t)}function ZJ(e,t){L$(e,"da",t)}function L$(e,t,n=$r){const i=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(o4(t,i,n),n){let o=n.parent;for(;o&&o.parent;)Gv(o.parent.vnode)&&GJ(i,t,n,o),o=o.parent}}function GJ(e,t,n,i){const o=o4(t,e,i,!0);$n(()=>{G6(i[t],o)},n)}function Z3(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function Y2(e){return e.shapeFlag&128?e.ssContent:e}function o4(e,t,n=$r,i=!1){if(n){const o=n[e]||(n[e]=[]),s=t.__weh||(t.__weh=(...r)=>{lc();const l=Dm(n),a=Ka(t,n,e,r);return l(),ac(),a});return i?o.unshift(s):o.push(s),s}}const ud=e=>(t,n=$r)=>{(!ip||e==="sp")&&o4(e,(...i)=>t(...i),n)},QJ=ud("bm"),xn=ud("m"),N$=ud("bu"),Lm=ud("u"),si=ud("bum"),$n=ud("um"),YJ=ud("sp"),JJ=ud("rtg"),XJ=ud("rtc");function D$(e,t=$r){o4("ec",e,t)}const o7="components",eX="directives";function F$(e,t){return s7(o7,e,!0,t)||e}const R$=Symbol.for("v-ndc");function fs(e){return ho(e)?s7(o7,e,!1)||e:e||R$}function x3t(e){return s7(eX,e)}function s7(e,t,n=!0,i=!1){const o=zr||$r;if(o){const s=o.type;if(e===o7){const l=V5(s,!1);if(l&&(l===t||l===ur(t)||l===Kb(ur(t))))return s}const r=qI(o[e]||s[e],t)||qI(o.appContext[e],t);return!r&&i?s:r}}function qI(e,t){return e&&(e[t]||e[ur(t)]||e[Kb(ur(t))])}function xt(e,t,n,i){let o;const s=n&&n[i],r=En(e);if(r||ho(e)){const l=r&&ku(e);let a=!1,u=!1;l&&(a=!fa(e),u=id(e),e=Xb(e)),o=new Array(e.length);for(let c=0,d=e.length;ct(l,a,void 0,s&&s[a]));else{const l=Object.keys(e);o=new Array(l.length);for(let a=0,u=l.length;a{const s=i.fn(...o);return s&&(s.key=i.key),s}:i.fn)}return e}function Gn(e,t,n={},i,o){if(zr.ce||zr.parent&&Zc(zr.parent)&&zr.parent.ce){const u=Object.keys(n).length>0;return t!=="default"&&(n.name=t),k(),ce(Fe,null,[U("slot",n,i&&i())],u?-2:64)}let s=e[t];s&&s._c&&(s._d=!1),k();const r=s&&r7(s(n)),l=n.key||r&&r.key,a=ce(Fe,{key:(l&&!ka(l)?l:`_${t}`)+(!r&&i?"_fb":"")},r||(i?i():[]),r&&e._===1?64:-2);return!o&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),s&&s._c&&(s._d=!0),a}function r7(e){return e.some(t=>uf(t)?!(t.type===Bs||t.type===Fe&&!r7(t.children)):!0)?e:null}function S3t(e,t){const n={};for(const i in e)n[t&&/[A-Z]/.test(i)?`on:${i}`:i9(i)]=e[i];return n}const $5=e=>e?aB(e)?Qv(e):$5(e.parent):null,k0=no(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>$5(e.parent),$root:e=>$5(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>l7(e),$forceUpdate:e=>e.f||(e.f=()=>{e7(e.update)}),$nextTick:e=>e.n||(e.n=mt.bind(e.proxy)),$watch:e=>MJ.bind(e)}),G3=(e,t)=>e!==bi&&!e.__isScriptSetup&&$i(e,t),B5={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:i,data:o,props:s,accessCache:r,type:l,appContext:a}=e;if(t[0]!=="$"){const h=r[t];if(h!==void 0)switch(h){case 1:return i[t];case 2:return o[t];case 4:return n[t];case 3:return s[t]}else{if(G3(i,t))return r[t]=1,i[t];if(o!==bi&&$i(o,t))return r[t]=2,o[t];if($i(s,t))return r[t]=3,s[t];if(n!==bi&&$i(n,t))return r[t]=4,n[t];z5&&(r[t]=0)}}const u=k0[t];let c,d;if(u)return t==="$attrs"&&el(e.attrs,"get",""),u(e);if((c=l.__cssModules)&&(c=c[t]))return c;if(n!==bi&&$i(n,t))return r[t]=4,n[t];if(d=a.config.globalProperties,$i(d,t))return d[t]},set({_:e},t,n){const{data:i,setupState:o,ctx:s}=e;return G3(o,t)?(o[t]=n,!0):i!==bi&&$i(i,t)?(i[t]=n,!0):$i(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(s[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:i,appContext:o,props:s,type:r}},l){let a;return!!(n[l]||e!==bi&&l[0]!=="$"&&$i(e,l)||G3(t,l)||$i(s,l)||$i(i,l)||$i(k0,l)||$i(o.config.globalProperties,l)||(a=r.__cssModules)&&a[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:$i(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},tX=no({},B5,{get(e,t){if(t!==Symbol.unscopables)return B5.get(e,t,e)},has(e,t){return t[0]!=="_"&&!NY(t)}});function _3t(){return null}function I3t(){return null}function M3t(e){}function T3t(e){}function E3t(){return null}function L3t(){}function N3t(e,t){return null}function D3t(){return P$().slots}function Nm(){return P$().attrs}function P$(e){const t=Vs();return t.setupContext||(t.setupContext=dB(t))}function uv(e){return En(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function F3t(e,t){const n=uv(e);for(const i in t){if(i.startsWith("__skip"))continue;let o=n[i];o?En(o)||qn(o)?o=n[i]={type:o,default:t[i]}:o.default=t[i]:o===null&&(o=n[i]={default:t[i]}),o&&t[`__skip_${i}`]&&(o.skipFactory=!0)}return n}function R3t(e,t){return!e||!t?e||t:En(e)&&En(t)?e.concat(t):no({},uv(e),uv(t))}function O3t(e,t){const n={};for(const i in e)t.includes(i)||Object.defineProperty(n,i,{enumerable:!0,get:()=>e[i]});return n}function P3t(e){const t=Vs(),n=ip;let i=e();dv(),n&&j1(!1);const o=()=>{Dm(t),n&&j1(!0)},s=()=>{Vs()!==t&&t.scope.off(),dv(),n&&j1(!1)};return Q6(i)&&(i=i.catch(r=>{throw o(),Promise.resolve().then(()=>Promise.resolve().then(s)),r})),[i,()=>{o(),Promise.resolve().then(s)}]}let z5=!0;function nX(e){const t=l7(e),n=e.proxy,i=e.ctx;z5=!1,t.beforeCreate&&UI(t.beforeCreate,e,"bc");const{data:o,computed:s,methods:r,watch:l,provide:a,inject:u,created:c,beforeMount:d,mounted:h,beforeUpdate:p,updated:m,activated:g,deactivated:y,beforeDestroy:b,beforeUnmount:v,destroyed:C,unmounted:w,render:M,renderTracked:N,renderTriggered:T,errorCaptured:S,serverPrefetch:x,expose:A,inheritAttrs:E,components:I,directives:R,filters:W}=t;if(u&&iX(u,i,null),r)for(const O in r){const B=r[O];qn(B)&&(i[O]=B.bind(n))}if(o){const O=o.call(n,n);ji(O)&&(e.data=Ki(O))}if(z5=!0,s)for(const O in s){const B=s[O],j=qn(B)?B.bind(n,n):qn(B.get)?B.get.bind(n,n):Wa,$=!qn(B)&&qn(B.set)?B.set.bind(n):Wa,V=D({get:j,set:$});Object.defineProperty(i,O,{enumerable:!0,configurable:!0,get:()=>V.value,set:ne=>V.value=ne})}if(l)for(const O in l)$$(l[O],i,n,O);if(a){const O=qn(a)?a.call(n):a;Reflect.ownKeys(O).forEach(B=>{ui(B,O[B])})}c&&UI(c,e,"c");function F(O,B){En(B)?B.forEach(j=>O(j.bind(n))):B&&O(B.bind(n))}if(F(QJ,d),F(xn,h),F(N$,p),F(Lm,m),F(KJ,g),F(ZJ,y),F(D$,S),F(XJ,N),F(JJ,T),F(si,v),F($n,w),F(YJ,x),En(A))if(A.length){const O=e.exposed||(e.exposed={});A.forEach(B=>{Object.defineProperty(O,B,{get:()=>n[B],set:j=>n[B]=j,enumerable:!0})})}else e.exposed||(e.exposed={});M&&e.render===Wa&&(e.render=M),E!=null&&(e.inheritAttrs=E),I&&(e.components=I),R&&(e.directives=R),x&&n7(e)}function iX(e,t,n=Wa){En(e)&&(e=j5(e));for(const i in e){const o=e[i];let s;ji(o)?"default"in o?s=rn(o.from||i,o.default,!0):s=rn(o.from||i):s=rn(o),mo(s)?Object.defineProperty(t,i,{enumerable:!0,configurable:!0,get:()=>s.value,set:r=>s.value=r}):t[i]=s}}function UI(e,t,n){Ka(En(e)?e.map(i=>i.bind(t.proxy)):e.bind(t.proxy),t,n)}function $$(e,t,n,i){let o=i.includes(".")?A$(n,i):()=>n[i];if(ho(e)){const s=t[e];qn(s)&&qe(o,s)}else if(qn(e))qe(o,e.bind(n));else if(ji(e))if(En(e))e.forEach(s=>$$(s,t,n,i));else{const s=qn(e.handler)?e.handler.bind(n):t[e.handler];qn(s)&&qe(o,s,e)}}function l7(e){const t=e.type,{mixins:n,extends:i}=t,{mixins:o,optionsCache:s,config:{optionMergeStrategies:r}}=e.appContext,l=s.get(t);let a;return l?a=l:!o.length&&!n&&!i?a=t:(a={},o.length&&o.forEach(u=>nk(a,u,r,!0)),nk(a,t,r)),ji(t)&&s.set(t,a),a}function nk(e,t,n,i=!1){const{mixins:o,extends:s}=t;s&&nk(e,s,n,!0),o&&o.forEach(r=>nk(e,r,n,!0));for(const r in t)if(!(i&&r==="expose")){const l=oX[r]||n&&n[r];e[r]=l?l(e[r],t[r]):t[r]}return e}const oX={data:VI,props:KI,emits:KI,methods:Kg,computed:Kg,beforeCreate:cl,created:cl,beforeMount:cl,mounted:cl,beforeUpdate:cl,updated:cl,beforeDestroy:cl,beforeUnmount:cl,destroyed:cl,unmounted:cl,activated:cl,deactivated:cl,errorCaptured:cl,serverPrefetch:cl,components:Kg,directives:Kg,watch:rX,provide:VI,inject:sX};function VI(e,t){return t?e?function(){return no(qn(e)?e.call(this,this):e,qn(t)?t.call(this,this):t)}:t:e}function sX(e,t){return Kg(j5(e),j5(t))}function j5(e){if(En(e)){const t={};for(let n=0;n{let c,d=bi,h;return IJ(()=>{const p=e[o];Cr(c,p)&&(c=p,u())}),{get(){return a(),n.get?n.get(c):c},set(p){const m=n.set?n.set(p):p;if(!Cr(m,c)&&!(d!==bi&&Cr(p,d)))return;const g=i.vnode.props,y=!!(g&&(t in g||o in g||s in g)&&(`onUpdate:${t}`in g||`onUpdate:${o}`in g||`onUpdate:${s}`in g));y||(c=p,u()),i.emit(`update:${t}`,m),Cr(p,d)&&(Cr(p,m)&&!Cr(m,h)||y&&d!==bi&&!Cr(m,c))&&u(),d=p,h=m}}});return l[Symbol.iterator]=()=>{let a=0;return{next(){return a<2?{value:a++?r||bi:l,done:!1}:{done:!0}}}},l}const z$=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${ur(t)}Modifiers`]||e[`${$l(t)}Modifiers`];function uX(e,t,...n){if(e.isUnmounted)return;const i=e.vnode.props||bi;let o=n;const s=t.startsWith("update:"),r=s&&z$(i,t.slice(7));r&&(r.trim&&(o=n.map(c=>ho(c)?c.trim():c)),r.number&&(o=n.map(Zb)));let l,a=i[l=i9(t)]||i[l=i9(ur(t))];!a&&s&&(a=i[l=i9($l(t))]),a&&Ka(a,e,6,o);const u=i[l+"Once"];if(u){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,Ka(u,e,6,o)}}const cX=new WeakMap;function j$(e,t,n=!1){const i=n?cX:t.emitsCache,o=i.get(e);if(o!==void 0)return o;const s=e.emits;let r={},l=!1;if(!qn(e)){const a=u=>{const c=j$(u,t,!0);c&&(l=!0,no(r,c))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!s&&!l?(ji(e)&&i.set(e,null),null):(En(s)?s.forEach(a=>r[a]=null):no(r,s),ji(e)&&i.set(e,r),r)}function s4(e,t){return!e||!Vv(t)?!1:(t=t.slice(2),t=t==="Once"?t:t.replace(/Once$/,""),$i(e,t[0].toLowerCase()+t.slice(1))||$i(e,$l(t))||$i(e,t))}function s9(e){const{type:t,vnode:n,proxy:i,withProxy:o,propsOptions:[s],slots:r,attrs:l,emit:a,render:u,renderCache:c,props:d,data:h,setupState:p,ctx:m,inheritAttrs:g}=e,y=lv(e);let b,v;try{if(n.shapeFlag&4){const w=o||i,M=w;b=Pl(u.call(M,w,c,d,p,h,m)),v=l}else{const w=t;b=Pl(w.length>1?w(d,{attrs:l,slots:r,emit:a}):w(d,null)),v=t.props?l:fX(l)}}catch(w){b0.length=0,Em(w,e,1),b=U(Bs)}let C=b;if(v&&g!==!1){const w=Object.keys(v),{shapeFlag:M}=C;w.length&&M&7&&(s&&w.some(Wb)&&(v=hX(v,s)),C=od(C,v,!1,!0))}return n.dirs&&(C=od(C,null,!1,!0),C.dirs=C.dirs?C.dirs.concat(n.dirs):n.dirs),n.transition&&af(C,n.transition),b=C,lv(y),b}function dX(e,t=!0){let n;for(let i=0;i{let t;for(const n in e)(n==="class"||n==="style"||Vv(n))&&((t||(t={}))[n]=e[n]);return t},hX=(e,t)=>{const n={};for(const i in e)(!Wb(i)||!(i.slice(9)in t))&&(n[i]=e[i]);return n};function pX(e,t,n){const{props:i,children:o,component:s}=e,{props:r,children:l,patchFlag:a}=t,u=s.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&a>=0){if(a&1024)return!0;if(a&16)return i?ZI(i,r,u):!!r;if(a&8){const c=t.dynamicProps;for(let d=0;dObject.create(W$),U$=e=>Object.getPrototypeOf(e)===W$;function mX(e,t,n,i=!1){const o={},s=q$();e.propsDefaults=Object.create(null),V$(e,t,o,s);for(const r in e.propsOptions[0])r in o||(o[r]=void 0);n?e.props=i?o:tp(o):e.type.props?e.props=o:e.props=s,e.attrs=s}function gX(e,t,n,i){const{props:o,attrs:s,vnode:{patchFlag:r}}=e,l=xi(o),[a]=e.propsOptions;let u=!1;if((i||r>0)&&!(r&16)){if(r&8){const c=e.vnode.dynamicProps;for(let d=0;d{a=!0;const[h,p]=K$(d,t,!0);no(r,h),p&&l.push(...p)};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}if(!s&&!a)return ji(e)&&i.set(e,D1),D1;if(En(s))for(let c=0;ce==="_"||e==="_ctx"||e==="$stable",u7=e=>En(e)?e.map(Pl):[Pl(e)],yX=(e,t,n)=>{if(t._n)return t;const i=ae((...o)=>u7(t(...o)),n);return i._c=!1,i},Z$=(e,t,n)=>{const i=e._ctx;for(const o in e){if(a7(o))continue;const s=e[o];if(qn(s))t[o]=yX(o,s,i);else if(s!=null){const r=u7(s);t[o]=()=>r}}},G$=(e,t)=>{const n=u7(t);e.slots.default=()=>n},Q$=(e,t,n)=>{for(const i in t)(n||!a7(i))&&(e[i]=t[i])},kX=(e,t,n)=>{const i=e.slots=q$();if(e.vnode.shapeFlag&32){const o=t._;o?(Q$(i,t,n),n&&GP(i,"_",o,!0)):Z$(t,i)}else t&&G$(e,t)},bX=(e,t,n)=>{const{vnode:i,slots:o}=e;let s=!0,r=bi;if(i.shapeFlag&32){const l=t._;l?n&&l===1?s=!1:Q$(o,t,n):(s=!t.$stable,Z$(t,o)),r=t}else t&&(G$(e,t),r={default:1});if(s)for(const l in o)!a7(l)&&r[l]==null&&delete o[l]},Es=nB;function wX(e){return Y$(e)}function CX(e){return Y$(e,PJ)}function Y$(e,t){const n=Gb();n.__VUE__=!0;const{insert:i,remove:o,patchProp:s,createElement:r,createText:l,createComment:a,setText:u,setElementText:c,parentNode:d,nextSibling:h,setScopeId:p=Wa,insertStaticContent:m}=e,g=(Z,Q,fe,de=null,pe=null,X=null,re=void 0,ke=null,le=!!Q.dynamicChildren)=>{if(Z===Q)return;Z&&!du(Z,Q)&&(de=ye(Z),ne(Z,pe,X,!0),Z=null),Q.patchFlag===-2&&(le=!1,Q.dynamicChildren=null);const{type:se,ref:_e,shapeFlag:ge}=Q;switch(se){case Qd:y(Z,Q,fe,de);break;case Bs:b(Z,Q,fe,de);break;case z1:Z==null&&v(Q,fe,de,re);break;case Fe:I(Z,Q,fe,de,pe,X,re,ke,le);break;default:ge&1?M(Z,Q,fe,de,pe,X,re,ke,le):ge&6?R(Z,Q,fe,de,pe,X,re,ke,le):(ge&64||ge&128)&&se.process(Z,Q,fe,de,pe,X,re,ke,le,Me)}_e!=null&&pe?$1(_e,Z&&Z.ref,X,Q||Z,!Q):_e==null&&Z&&Z.ref!=null&&$1(Z.ref,null,X,Z,!0)},y=(Z,Q,fe,de)=>{if(Z==null)i(Q.el=l(Q.children),fe,de);else{const pe=Q.el=Z.el;Q.children!==Z.children&&u(pe,Q.children)}},b=(Z,Q,fe,de)=>{Z==null?i(Q.el=a(Q.children||""),fe,de):Q.el=Z.el},v=(Z,Q,fe,de)=>{[Z.el,Z.anchor]=m(Z.children,Q,fe,de,Z.el,Z.anchor)},C=({el:Z,anchor:Q},fe,de)=>{let pe;for(;Z&&Z!==Q;)pe=h(Z),i(Z,fe,de),Z=pe;i(Q,fe,de)},w=({el:Z,anchor:Q})=>{let fe;for(;Z&&Z!==Q;)fe=h(Z),o(Z),Z=fe;o(Q)},M=(Z,Q,fe,de,pe,X,re,ke,le)=>{if(Q.type==="svg"?re="svg":Q.type==="math"&&(re="mathml"),Z==null)N(Q,fe,de,pe,X,re,ke,le);else{const se=Z.el&&Z.el._isVueCE?Z.el:null;try{se&&se._beginPatch(),x(Z,Q,pe,X,re,ke,le)}finally{se&&se._endPatch()}}},N=(Z,Q,fe,de,pe,X,re,ke)=>{let le,se;const{props:_e,shapeFlag:ge,transition:Le,dirs:be}=Z;if(le=Z.el=r(Z.type,X,_e&&_e.is,_e),ge&8?c(le,Z.children):ge&16&&S(Z.children,le,null,de,pe,Q3(Z,X),re,ke),be&&Wu(Z,null,de,"created"),T(le,Z,Z.scopeId,re,de),_e){for(const Oe in _e)Oe!=="value"&&!Bh(Oe)&&s(le,Oe,null,_e[Oe],X,de);"value"in _e&&s(le,"value",null,_e.value,X),(se=_e.onVnodeBeforeMount)&&Fl(se,de,Z)}be&&Wu(Z,null,de,"beforeMount");const xe=J$(pe,Le);xe&&Le.beforeEnter(le),i(le,Q,fe),((se=_e&&_e.onVnodeMounted)||xe||be)&&Es(()=>{try{se&&Fl(se,de,Z),xe&&Le.enter(le),be&&Wu(Z,null,de,"mounted")}finally{}},pe)},T=(Z,Q,fe,de,pe)=>{if(fe&&p(Z,fe),de)for(let X=0;X{for(let se=le;se{const ke=Q.el=Z.el;let{patchFlag:le,dynamicChildren:se,dirs:_e}=Q;le|=Z.patchFlag&16;const ge=Z.props||bi,Le=Q.props||bi;let be;if(fe&&Xf(fe,!1),(be=Le.onVnodeBeforeUpdate)&&Fl(be,fe,Q,Z),_e&&Wu(Q,Z,fe,"beforeUpdate"),fe&&Xf(fe,!0),se&&(!Z.dynamicChildren||Z.dynamicChildren.length!==se.length)&&(le=0,re=!1,se=null),(ge.innerHTML&&Le.innerHTML==null||ge.textContent&&Le.textContent==null)&&c(ke,""),se?A(Z.dynamicChildren,se,ke,fe,de,Q3(Q,pe),X):re||B(Z,Q,ke,null,fe,de,Q3(Q,pe),X,!1),le>0){if(le&16)E(ke,ge,Le,fe,pe);else if(le&2&&ge.class!==Le.class&&s(ke,"class",null,Le.class,pe),le&4&&s(ke,"style",ge.style,Le.style,pe),le&8){const xe=Q.dynamicProps;for(let Oe=0;Oe{be&&Fl(be,fe,Q,Z),_e&&Wu(Q,Z,fe,"updated")},de)},A=(Z,Q,fe,de,pe,X,re)=>{for(let ke=0;ke{if(Q!==fe){if(Q!==bi)for(const X in Q)!Bh(X)&&!(X in fe)&&s(Z,X,Q[X],null,pe,de);for(const X in fe){if(Bh(X))continue;const re=fe[X],ke=Q[X];re!==ke&&X!=="value"&&s(Z,X,ke,re,pe,de)}"value"in fe&&s(Z,"value",Q.value,fe.value,pe)}},I=(Z,Q,fe,de,pe,X,re,ke,le)=>{const se=Q.el=Z?Z.el:l(""),_e=Q.anchor=Z?Z.anchor:l("");let{patchFlag:ge,dynamicChildren:Le,slotScopeIds:be}=Q;be&&(ke=ke?ke.concat(be):be),Z==null?(i(se,fe,de),i(_e,fe,de),S(Q.children||[],fe,_e,pe,X,re,ke,le)):ge>0&&ge&64&&Le&&Z.dynamicChildren&&Z.dynamicChildren.length===Le.length?(A(Z.dynamicChildren,Le,fe,pe,X,re,ke),(Q.key!=null||pe&&Q===pe.subTree)&&c7(Z,Q,!0)):B(Z,Q,fe,_e,pe,X,re,ke,le)},R=(Z,Q,fe,de,pe,X,re,ke,le)=>{Q.slotScopeIds=ke,Z==null?Q.shapeFlag&512?pe.ctx.activate(Q,fe,de,re,le):W(Q,fe,de,pe,X,re,le):z(Z,Q,le)},W=(Z,Q,fe,de,pe,X,re)=>{const ke=Z.component=lB(Z,de,pe);if(Gv(Z)&&(ke.ctx.renderer=Me),uB(ke,!1,re),ke.asyncDep){if(pe&&pe.registerDep(ke,F,re),!Z.el){const le=ke.subTree=U(Bs);b(null,le,Q,fe),Z.placeholder=le.el}}else F(ke,Z,Q,fe,pe,X,re)},z=(Z,Q,fe)=>{const de=Q.component=Z.component;if(pX(Z,Q,fe))if(de.asyncDep&&!de.asyncResolved){O(de,Q,fe);return}else de.next=Q,de.update();else Q.el=Z.el,de.vnode=Q},F=(Z,Q,fe,de,pe,X,re)=>{const ke=()=>{if(Z.isMounted){let{next:ge,bu:Le,u:be,parent:xe,vnode:Oe}=Z;{const Gt=X$(Z);if(Gt){ge&&(ge.el=Oe.el,O(Z,ge,re)),Gt.asyncDep.then(()=>{Es(()=>{Z.isUnmounted||se()},pe)});return}}let Ze=ge,ct;Xf(Z,!1),ge?(ge.el=Oe.el,O(Z,ge,re)):ge=Oe,Le&&R1(Le),(ct=ge.props&&ge.props.onVnodeBeforeUpdate)&&Fl(ct,xe,ge,Oe),Xf(Z,!0);const yt=s9(Z),Wt=Z.subTree;Z.subTree=yt,g(Wt,yt,d(Wt.el),ye(Wt),Z,pe,X),ge.el=yt.el,Ze===null&&r4(Z,yt.el),be&&Es(be,pe),(ct=ge.props&&ge.props.onVnodeUpdated)&&Es(()=>Fl(ct,xe,ge,Oe),pe)}else{let ge;const{el:Le,props:be}=Q,{bm:xe,m:Oe,parent:Ze,root:ct,type:yt}=Z,Wt=Zc(Q);if(Xf(Z,!1),xe&&R1(xe),!Wt&&(ge=be&&be.onVnodeBeforeMount)&&Fl(ge,Ze,Q),Xf(Z,!0),Le&&oe){const Gt=()=>{Z.subTree=s9(Z),oe(Le,Z.subTree,Z,pe,null)};Wt&&yt.__asyncHydrate?yt.__asyncHydrate(Le,Z,Gt):Gt()}else{ct.ce&&ct.ce._hasShadowRoot()&&ct.ce._injectChildStyle(yt,Z.parent?Z.parent.type:void 0);const Gt=Z.subTree=s9(Z);g(null,Gt,fe,de,Z,pe,X),Q.el=Gt.el}if(Oe&&Es(Oe,pe),!Wt&&(ge=be&&be.onVnodeMounted)){const Gt=Q;Es(()=>Fl(ge,Ze,Gt),pe)}(Q.shapeFlag&256||Ze&&Zc(Ze.vnode)&&Ze.vnode.shapeFlag&256)&&Z.a&&Es(Z.a,pe),Z.isMounted=!0,Q=fe=de=null}};Z.scope.on();const le=Z.effect=new K9(ke);Z.scope.off();const se=Z.update=le.run.bind(le),_e=Z.job=le.runIfDirty.bind(le);_e.i=Z,_e.id=Z.uid,le.scheduler=()=>e7(_e),Xf(Z,!0),se()},O=(Z,Q,fe)=>{Q.component=Z;const de=Z.vnode.props;Z.vnode=Q,Z.next=null,gX(Z,Q.props,de,fe),bX(Z,Q.children,fe),lc(),PI(Z),ac()},B=(Z,Q,fe,de,pe,X,re,ke,le=!1)=>{const se=Z&&Z.children,_e=Z?Z.shapeFlag:0,ge=Q.children,{patchFlag:Le,shapeFlag:be}=Q;if(Le>0){if(Le&128){$(se,ge,fe,de,pe,X,re,ke,le);return}else if(Le&256){j(se,ge,fe,de,pe,X,re,ke,le);return}}be&8?(_e&16&&ie(se,pe,X),ge!==se&&c(fe,ge)):_e&16?be&16?$(se,ge,fe,de,pe,X,re,ke,le):ie(se,pe,X,!0):(_e&8&&c(fe,""),be&16&&S(ge,fe,de,pe,X,re,ke,le))},j=(Z,Q,fe,de,pe,X,re,ke,le)=>{Z=Z||D1,Q=Q||D1;const se=Z.length,_e=Q.length,ge=Math.min(se,_e);let Le;for(Le=0;Le_e?ie(Z,pe,X,!0,!1,ge):S(Q,fe,de,pe,X,re,ke,le,ge)},$=(Z,Q,fe,de,pe,X,re,ke,le)=>{let se=0;const _e=Q.length;let ge=Z.length-1,Le=_e-1;for(;se<=ge&&se<=Le;){const be=Z[se],xe=Q[se]=le?Oc(Q[se]):Pl(Q[se]);if(du(be,xe))g(be,xe,fe,null,pe,X,re,ke,le);else break;se++}for(;se<=ge&&se<=Le;){const be=Z[ge],xe=Q[Le]=le?Oc(Q[Le]):Pl(Q[Le]);if(du(be,xe))g(be,xe,fe,null,pe,X,re,ke,le);else break;ge--,Le--}if(se>ge){if(se<=Le){const be=Le+1,xe=be<_e?Q[be].el:de;for(;se<=Le;)g(null,Q[se]=le?Oc(Q[se]):Pl(Q[se]),fe,xe,pe,X,re,ke,le),se++}}else if(se>Le)for(;se<=ge;)ne(Z[se],pe,X,!0),se++;else{const be=se,xe=se,Oe=new Map;for(se=xe;se<=Le;se++){const Ke=Q[se]=le?Oc(Q[se]):Pl(Q[se]);Ke.key!=null&&Oe.set(Ke.key,se)}let Ze,ct=0;const yt=Le-xe+1;let Wt=!1,Gt=0;const Be=new Array(yt);for(se=0;se=yt){ne(Ke,pe,X,!0);continue}let ft;if(Ke.key!=null)ft=Oe.get(Ke.key);else for(Ze=xe;Ze<=Le;Ze++)if(Be[Ze-xe]===0&&du(Ke,Q[Ze])){ft=Ze;break}ft===void 0?ne(Ke,pe,X,!0):(Be[ft-xe]=se+1,ft>=Gt?Gt=ft:Wt=!0,g(Ke,Q[ft],fe,null,pe,X,re,ke,le),ct++)}const $e=Wt?AX(Be):D1;for(Ze=$e.length-1,se=yt-1;se>=0;se--){const Ke=xe+se,ft=Q[Ke],Ct=Q[Ke+1],Mt=Ke+1<_e?Ct.el||eB(Ct):de;Be[se]===0?g(null,ft,fe,Mt,pe,X,re,ke,le):Wt&&(Ze<0||se!==$e[Ze]?V(ft,fe,Mt,2):Ze--)}}},V=(Z,Q,fe,de,pe=null)=>{const{el:X,type:re,transition:ke,children:le,shapeFlag:se}=Z;if(se&6){V(Z.component.subTree,Q,fe,de);return}if(se&128){Z.suspense.move(Q,fe,de);return}if(se&64){re.move(Z,Q,fe,Me);return}if(re===Fe){i(X,Q,fe);for(let ge=0;geke.enter(X),pe));else{const{leave:ge,delayLeave:Le,afterLeave:be}=ke,xe=()=>{Z.ctx.isUnmounted?o(X):i(X,Q,fe)},Oe=()=>{const Ze=X._isLeaving||!!X[Na];X._isLeaving&&X[Na](!0),ke.persisted&&!Ze?xe():ge(X,()=>{xe(),be&&be()})};Le?Le(X,xe,Oe):Oe()}else i(X,Q,fe)},ne=(Z,Q,fe,de=!1,pe=!1)=>{const{type:X,props:re,ref:ke,children:le,dynamicChildren:se,shapeFlag:_e,patchFlag:ge,dirs:Le,cacheIndex:be,memo:xe}=Z;if(ge===-2&&(pe=!1),ke!=null&&(lc(),$1(ke,null,fe,Z,!0),ac()),be!=null&&(Q.renderCache[be]=void 0),_e&256){Q.ctx.deactivate(Z);return}const Oe=_e&1&&Le,Ze=!Zc(Z);let ct;if(Ze&&(ct=re&&re.onVnodeBeforeUnmount)&&Fl(ct,Q,Z),_e&6)ue(Z.component,fe,de);else{if(_e&128){Z.suspense.unmount(fe,de);return}Oe&&Wu(Z,null,Q,"beforeUnmount"),_e&64?Z.type.remove(Z,Q,fe,Me,de):se&&!se.hasOnce&&(X!==Fe||ge>0&&ge&64)?ie(se,Q,fe,!1,!0):(X===Fe&&ge&384||!pe&&_e&16)&&ie(le,Q,fe),de&&K(Z)}const yt=xe!=null&&be==null;(Ze&&(ct=re&&re.onVnodeUnmounted)||Oe||yt)&&Es(()=>{ct&&Fl(ct,Q,Z),Oe&&Wu(Z,null,Q,"unmounted"),yt&&(Z.el=null)},fe)},K=Z=>{const{type:Q,el:fe,anchor:de,transition:pe}=Z;if(Q===Fe){ee(fe,de);return}if(Q===z1){w(Z);return}const X=()=>{o(fe),pe&&!pe.persisted&&pe.afterLeave&&pe.afterLeave()};if(Z.shapeFlag&1&&pe&&!pe.persisted){const{leave:re,delayLeave:ke}=pe,le=()=>re(fe,X);ke?ke(Z.el,X,le):le()}else X()},ee=(Z,Q)=>{let fe;for(;Z!==Q;)fe=h(Z),o(Z),Z=fe;o(Q)},ue=(Z,Q,fe)=>{const{bum:de,scope:pe,job:X,subTree:re,um:ke,m:le,a:se}=Z;ik(le),ik(se),de&&R1(de),pe.stop(),X&&(X.flags|=8,ne(re,Z,Q,fe)),ke&&Es(ke,Q),Es(()=>{Z.isUnmounted=!0},Q)},ie=(Z,Q,fe,de=!1,pe=!1,X=0)=>{for(let re=X;re{if(Z.shapeFlag&6)return ye(Z.component.subTree);if(Z.shapeFlag&128)return Z.suspense.next();const Q=h(Z.anchor||Z.el),fe=Q&&Q[x$];return fe?h(fe):Q};let Te=!1;const Ee=(Z,Q,fe)=>{let de;Z==null?Q._vnode&&(ne(Q._vnode,null,null,!0),de=Q._vnode.component):g(Q._vnode||null,Z,Q,null,null,null,fe),Q._vnode=Z,Te||(Te=!0,PI(de),X9(),Te=!1)},Me={p:g,um:ne,m:V,r:K,mt:W,mc:S,pc:B,pbc:A,n:ye,o:e};let G,oe;return t&&([G,oe]=t(Me)),{render:Ee,hydrate:G,createApp:aX(Ee,G)}}function Q3({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function Xf({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function J$(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function c7(e,t,n=!1){const i=e.children,o=t.children;if(En(i)&&En(o))for(let s=0;s>1,e[n[l]]0&&(t[i]=n[s-1]),n[s]=i)}}for(s=n.length,r=n[s-1];s-- >0;)n[s]=r,r=t[r];return n}function X$(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:X$(t)}function ik(e){if(e)for(let t=0;te.__isSuspense;let W5=0;const xX={name:"Suspense",__isSuspense:!0,process(e,t,n,i,o,s,r,l,a,u){if(e==null)SX(t,n,i,o,s,r,l,a,u);else{if(s&&s.deps>0&&!e.suspense.isInFallback){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}_X(e,t,n,i,o,r,l,a,u)}},hydrate:IX,normalize:MX},B3t=xX;function cv(e,t){const n=e.props&&e.props[t];qn(n)&&n()}function SX(e,t,n,i,o,s,r,l,a){const{p:u,o:{createElement:c}}=a,d=c("div"),h=e.suspense=tB(e,o,i,t,d,n,s,r,l,a);u(null,h.pendingBranch=e.ssContent,d,null,i,h,s,r),h.deps>0?(cv(e,"onPending"),cv(e,"onFallback"),u(null,e.ssFallback,t,n,i,null,s,r),B1(h,e.ssFallback)):h.resolve(!1,!0)}function _X(e,t,n,i,o,s,r,l,{p:a,um:u,o:{createElement:c}}){const d=t.suspense=e.suspense;d.vnode=t,t.el=e.el;const h=t.ssContent,p=t.ssFallback,{activeBranch:m,pendingBranch:g,isInFallback:y,isHydrating:b}=d;if(g)d.pendingBranch=h,du(g,h)?(a(g,h,d.hiddenContainer,null,o,d,s,r,l),d.deps<=0?d.resolve():y&&(b||(a(m,p,n,i,o,null,s,r,l),B1(d,p)))):(d.pendingId=W5++,b?(d.isHydrating=!1,d.activeBranch=g):u(g,o,d),d.deps=0,d.effects.length=0,d.hiddenContainer=c("div"),y?(a(null,h,d.hiddenContainer,null,o,d,s,r,l),d.deps<=0?d.resolve():(a(m,p,n,i,o,null,s,r,l),B1(d,p))):m&&du(m,h)?(a(m,h,n,i,o,d,s,r,l),d.resolve(!0)):(a(null,h,d.hiddenContainer,null,o,d,s,r,l),d.deps<=0&&d.resolve()));else if(m&&du(m,h))a(m,h,n,i,o,d,s,r,l),B1(d,h);else if(cv(t,"onPending"),d.pendingBranch=h,h.shapeFlag&512?d.pendingId=h.component.suspenseId:d.pendingId=W5++,a(null,h,d.hiddenContainer,null,o,d,s,r,l),d.deps<=0)d.resolve();else{const{timeout:v,pendingId:C}=d;v>0?setTimeout(()=>{d.pendingId===C&&d.fallback(p)},v):v===0&&d.fallback(p)}}function tB(e,t,n,i,o,s,r,l,a,u,c=!1){const{p:d,m:h,um:p,n:m,o:{parentNode:g,remove:y}}=u;let b;const v=TX(e);v&&t&&t.pendingBranch&&(b=t.pendingId,t.deps++);const C=e.props?V9(e.props.timeout):void 0,w=s,M={vnode:e,parent:t,parentComponent:n,namespace:r,container:i,hiddenContainer:o,deps:0,pendingId:W5++,timeout:typeof C=="number"?C:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!c,isHydrating:c,isUnmounted:!1,effects:[],resolve(N=!1,T=!1){const{vnode:S,activeBranch:x,pendingBranch:A,pendingId:E,effects:I,parentComponent:R,container:W,isInFallback:z}=M;let F=!1;if(M.isHydrating)M.isHydrating=!1;else if(!N){F=x&&A.transition&&A.transition.mode==="out-in";let j=!1;F&&(x.transition.afterLeave=()=>{E===M.pendingId&&(h(A,W,s===w&&!j?m(x):s,0),J9(I),z&&S.ssFallback&&(S.ssFallback.el=null))}),x&&!M.isFallbackMountPending&&(g(x.el)===W&&(s=m(x),j=!0),p(x,R,M,!0),!F&&z&&S.ssFallback&&Es(()=>S.ssFallback.el=null,M)),F||h(A,W,s,0)}M.isFallbackMountPending=!1,B1(M,A),M.pendingBranch=null,M.isInFallback=!1;let O=M.parent,B=!1;for(;O;){if(O.pendingBranch){O.effects.push(...I),B=!0;break}O=O.parent}!B&&!F&&J9(I),M.effects=[],v&&t&&t.pendingBranch&&b===t.pendingId&&(t.deps--,t.deps===0&&!T&&t.resolve()),cv(S,"onResolve")},fallback(N){if(!M.pendingBranch)return;const{vnode:T,activeBranch:S,parentComponent:x,container:A,namespace:E}=M;cv(T,"onFallback");const I=m(S),R=()=>{M.isFallbackMountPending=!1,M.isInFallback&&(d(null,N,A,I,x,null,E,l,a),B1(M,N))},W=N.transition&&N.transition.mode==="out-in";W&&(M.isFallbackMountPending=!0,S.transition.afterLeave=R),M.isInFallback=!0,p(S,x,null,!0),W||R()},move(N,T,S){M.activeBranch&&h(M.activeBranch,N,T,S),M.container=N},next(){return M.activeBranch&&m(M.activeBranch)},registerDep(N,T,S){const x=!!M.pendingBranch;x&&M.deps++;const A=N.vnode.el;N.asyncDep.catch(E=>{Em(E,N,0)}).then(E=>{if(N.isUnmounted||M.isUnmounted||M.pendingId!==N.suspenseId)return;dv(),N.asyncResolved=!0;const{vnode:I}=N;q5(N,E,!1),A&&(I.el=A);const R=!A&&N.subTree.el;T(N,I,g(A||N.subTree.el),A?null:m(N.subTree),M,r,S),R&&(I.placeholder=null,y(R)),r4(N,I.el),x&&--M.deps===0&&M.resolve()})},unmount(N,T){M.isUnmounted=!0,M.activeBranch&&p(M.activeBranch,n,N,T),M.pendingBranch&&p(M.pendingBranch,n,N,T)}};return M}function IX(e,t,n,i,o,s,r,l,a){const u=t.suspense=tB(t,i,n,e.parentNode,document.createElement("div"),null,o,s,r,l,!0),c=a(e,u.pendingBranch=t.ssContent,n,u,s,r);return u.deps===0&&u.resolve(!1,!0),c}function MX(e){const{shapeFlag:t,children:n}=e,i=t&32;e.ssContent=QI(i?n.default:n),e.ssFallback=i?QI(n.fallback):U(Bs)}function QI(e){let t;if(qn(e)){const n=np&&e._c;n&&(e._d=!1,k()),e=e(),n&&(e._d=!0,t=nl,iB())}return En(e)&&(e=dX(e)),e=Pl(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(n=>n!==e)),e}function nB(e,t){t&&t.pendingBranch?En(e)?t.effects.push(...e):t.effects.push(e):J9(e)}function B1(e,t){e.activeBranch=t;const{vnode:n,parentComponent:i}=e;let o=t.el;for(;!o&&t.component;)t=t.component.subTree,o=t.el;n.el=o,i&&i.subTree===n&&(i.vnode.el=o,r4(i,o))}function TX(e){const t=e.props&&e.props.suspensible;return t!=null&&t!==!1}const Fe=Symbol.for("v-fgt"),Qd=Symbol.for("v-txt"),Bs=Symbol.for("v-cmt"),z1=Symbol.for("v-stc"),b0=[];let nl=null;function k(e=!1){b0.push(nl=e?null:[])}function iB(){b0.pop(),nl=b0[b0.length-1]||null}let np=1;function sk(e,t=!1){np+=e,e<0&&nl&&t&&(nl.hasOnce=!0)}function oB(e){return e.dynamicChildren=np>0?nl||D1:null,iB(),np>0&&nl&&nl.push(e),e}function L(e,t,n,i,o,s){return oB(_(e,t,n,i,o,s,!0))}function ce(e,t,n,i,o){return oB(U(e,t,n,i,o,!0))}function uf(e){return e?e.__v_isVNode===!0:!1}function du(e,t){return e.type===t.type&&e.key===t.key}function z3t(e){}const sB=({key:e})=>e??null,r9=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?ho(e)||mo(e)||qn(e)?{i:zr,r:e,k:t,f:!!n}:e:null);function _(e,t=null,n=null,i=0,o=null,s=e===Fe?0:1,r=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&sB(t),ref:t&&r9(t),scopeId:i4,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:i,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:zr};return l?(rk(a,n),s&128&&e.normalize(a)):n&&(a.shapeFlag|=ho(n)?8:16),np>0&&!r&&nl&&(a.patchFlag>0||s&6)&&a.patchFlag!==32&&nl.push(a),a}const U=EX;function EX(e,t=null,n=null,i=0,o=null,s=!1){if((!e||e===R$)&&(e=Bs),uf(e)){const l=od(e,t,!0);return n&&rk(l,n),np>0&&!s&&nl&&(l.shapeFlag&6?nl[nl.indexOf(e)]=l:nl.push(l)),l.patchFlag=-2,l}if(RX(e)&&(e=e.__vccOpts),t){t=rB(t);let{class:l,style:a}=t;l&&!ho(l)&&(t.class=Pe(l)),ji(a)&&(n4(a)&&!En(a)&&(a=no({},a)),t.style=an(a))}const r=ho(e)?1:ok(e)?128:S$(e)?64:ji(e)?4:qn(e)?2:0;return _(e,t,n,i,o,r,s,!0)}function rB(e){return e?n4(e)||U$(e)?no({},e):e:null}function od(e,t,n=!1,i=!1){const{props:o,ref:s,patchFlag:r,children:l,transition:a}=e,u=t?yi(o||{},t):o,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&sB(u),ref:t&&t.ref?n&&s?En(s)?s.concat(r9(t)):[s,r9(t)]:r9(t):s,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Fe?r===-1?16:r|16:r,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&od(e.ssContent),ssFallback:e.ssFallback&&od(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&i&&af(c,a.clone(c)),c}function He(e=" ",t=0){return U(Qd,null,e,t)}function If(e,t){const n=U(z1,null,e);return n.staticCount=t,n}function J(e="",t=!1){return t?(k(),ce(Bs,null,e)):U(Bs,null,e)}function Pl(e){return e==null||typeof e=="boolean"?U(Bs):En(e)?U(Fe,null,e.slice()):uf(e)?Oc(e):U(Qd,null,String(e))}function Oc(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:od(e)}function rk(e,t){let n=0;const{shapeFlag:i}=e;if(t==null)t=null;else if(En(t))n=16;else if(typeof t=="object")if(i&65){const o=t.default;o&&(o._c&&(o._d=!1),rk(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!U$(t)?t._ctx=zr:o===3&&zr&&(zr.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(qn(t)){if(i&65){rk(e,{default:t});return}t={default:t,_ctx:zr},n=32}else t=String(t),i&64?(n=16,t=[He(t)]):n=8;e.children=t,e.shapeFlag|=n}function yi(...e){const t={};for(let n=0;n$r||zr;let lk,j1;{const e=Gb(),t=(n,i)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(i),s=>{o.length>1?o.forEach(r=>r(s)):o[0](s)}};lk=t("__VUE_INSTANCE_SETTERS__",n=>$r=n),j1=t("__VUE_SSR_SETTERS__",n=>ip=n)}const Dm=e=>{const t=$r;return lk(e),e.scope.on(),()=>{e.scope.off(),lk(t)}},dv=()=>{$r&&$r.scope.off(),lk(null)};function aB(e){return e.vnode.shapeFlag&4}let ip=!1;function uB(e,t=!1,n=!1){t&&j1(t);const{props:i,children:o}=e.vnode,s=aB(e);mX(e,i,s,t),kX(e,o,n||t);const r=s?DX(e,t):void 0;return t&&j1(!1),r}function DX(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,B5);const{setup:i}=n;if(i){lc();const o=e.setupContext=i.length>1?dB(e):null,s=Dm(e),r=Kv(i,e,0,[e.props,o]),l=Q6(r);if(ac(),s(),(l||e.sp)&&!Zc(e)&&n7(e),l){if(r.then(dv,dv),t)return r.then(a=>{q5(e,a,t)}).catch(a=>{Em(a,e,0)});e.asyncDep=r}else q5(e,r,t)}else cB(e,t)}function q5(e,t,n){qn(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ji(t)&&(e.setupState=g$(t)),cB(e,n)}let ak,U5;function j3t(e){ak=e,U5=t=>{t.render._rc&&(t.withProxy=new Proxy(t.ctx,tX))}}const H3t=()=>!ak;function cB(e,t,n){const i=e.type;if(!e.render){if(!t&&ak&&!i.render){const o=i.template||l7(e).template;if(o){const{isCustomElement:s,compilerOptions:r}=e.appContext.config,{delimiters:l,compilerOptions:a}=i,u=no(no({isCustomElement:s,delimiters:l},r),a);i.render=ak(o,u)}}e.render=i.render||Wa,U5&&U5(e)}{const o=Dm(e);lc();try{nX(e)}finally{ac(),o()}}}const FX={get(e,t){return el(e,"get",""),e[t]}};function dB(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,FX),slots:e.slots,emit:e.emit,expose:t}}function Qv(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(g$(Ot(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in k0)return k0[n](e)},has(t,n){return n in t||n in k0}})):e.proxy}function V5(e,t=!0){return qn(e)?e.displayName||e.name:e.name||t&&e.__name}function RX(e){return qn(e)&&"__vccOpts"in e}const D=(e,t)=>gJ(e,t,ip);function jn(e,t,n){try{sk(-1);const i=arguments.length;return i===2?ji(t)&&!En(t)?uf(t)?U(e,null,[t]):U(e,t):U(e,null,t):(i>3?n=Array.prototype.slice.call(arguments,2):i===3&&uf(n)&&(n=[n]),U(e,t,n))}finally{sk(1)}}function W3t(){}function q3t(e,t,n,i){const o=n[i];if(o&&OX(o,e))return o;const s=t();return s.memo=e.slice(),s.cacheIndex=i,n[i]=s}function OX(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let i=0;i0&&nl&&nl.push(e),!0}const PX="3.5.39",U3t=Wa,V3t=wJ,K3t=a1,Z3t=C$,$X={createComponentInstance:lB,setupComponent:uB,renderComponentRoot:s9,setCurrentRenderingInstance:lv,isVNode:uf,normalizeVNode:Pl,getComponentPublicInstance:Qv,ensureValidVNode:r7,pushWarningContext:kJ,popWarningContext:bJ},G3t=$X,Q3t=null,Y3t=null,J3t=null;/** -* @vue/runtime-dom v3.5.39 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/let K5;const YI=typeof window<"u"&&window.trustedTypes;if(YI)try{K5=YI.createPolicy("vue",{createHTML:e=>e})}catch{}const fB=K5?e=>K5.createHTML(e):e=>e,BX="http://www.w3.org/2000/svg",zX="http://www.w3.org/1998/Math/MathML",Dc=typeof document<"u"?document:null,JI=Dc&&Dc.createElement("template"),jX={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,i)=>{const o=t==="svg"?Dc.createElementNS(BX,e):t==="mathml"?Dc.createElementNS(zX,e):n?Dc.createElement(e,{is:n}):Dc.createElement(e);return e==="select"&&i&&i.multiple!=null&&o.setAttribute("multiple",i.multiple),o},createText:e=>Dc.createTextNode(e),createComment:e=>Dc.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Dc.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,i,o,s){const r=n?n.previousSibling:t.lastChild;if(o&&(o===s||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===s||!(o=o.nextSibling)););else{JI.innerHTML=fB(i==="svg"?`${e}`:i==="mathml"?`${e}`:e);const l=JI.content;if(i==="svg"||i==="mathml"){const a=l.firstChild;for(;a.firstChild;)l.appendChild(a.firstChild);l.removeChild(a)}t.insertBefore(l,n)}return[r?r.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},vd="transition",wg="animation",lm=Symbol("_vtc"),hB={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},pB=no({},I$,hB),HX=e=>(e.displayName="Transition",e.props=pB,e),Po=HX((e,{slots:t})=>jn(DJ,mB(e),t)),eh=(e,t=[])=>{En(e)?e.forEach(n=>n(...t)):e&&e(...t)},XI=e=>e?En(e)?e.some(t=>t.length>1):e.length>1:!1;function mB(e){const t={};for(const I in e)I in hB||(t[I]=e[I]);if(e.css===!1)return t;const{name:n="v",type:i,duration:o,enterFromClass:s=`${n}-enter-from`,enterActiveClass:r=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:a=s,appearActiveClass:u=r,appearToClass:c=l,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:h=`${n}-leave-active`,leaveToClass:p=`${n}-leave-to`}=e,m=WX(o),g=m&&m[0],y=m&&m[1],{onBeforeEnter:b,onEnter:v,onEnterCancelled:C,onLeave:w,onLeaveCancelled:M,onBeforeAppear:N=b,onAppear:T=v,onAppearCancelled:S=C}=t,x=(I,R,W,z)=>{I._enterCancelled=z,_d(I,R?c:l),_d(I,R?u:r),W&&W()},A=(I,R)=>{I._isLeaving=!1,_d(I,d),_d(I,p),_d(I,h),R&&R()},E=I=>(R,W)=>{const z=I?T:v,F=()=>x(R,I,W);eh(z,[R,F]),eM(()=>{_d(R,I?a:s),$u(R,I?c:l),XI(z)||tM(R,i,g,F)})};return no(t,{onBeforeEnter(I){eh(b,[I]),$u(I,s),$u(I,r)},onBeforeAppear(I){eh(N,[I]),$u(I,a),$u(I,u)},onEnter:E(!1),onAppear:E(!0),onLeave(I,R){I._isLeaving=!0;const W=()=>A(I,R);$u(I,d),I._enterCancelled?($u(I,h),Z5(I)):(Z5(I),$u(I,h)),eM(()=>{I._isLeaving&&(_d(I,d),$u(I,p),XI(w)||tM(I,i,y,W))}),eh(w,[I,W])},onEnterCancelled(I){x(I,!1,void 0,!0),eh(C,[I])},onAppearCancelled(I){x(I,!0,void 0,!0),eh(S,[I])},onLeaveCancelled(I){A(I),eh(M,[I])}})}function WX(e){if(e==null)return null;if(ji(e))return[Y3(e.enter),Y3(e.leave)];{const t=Y3(e);return[t,t]}}function Y3(e){return V9(e)}function $u(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[lm]||(e[lm]=new Set)).add(t)}function _d(e,t){t.split(/\s+/).forEach(i=>i&&e.classList.remove(i));const n=e[lm];n&&(n.delete(t),n.size||(e[lm]=void 0))}function eM(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let qX=0;function tM(e,t,n,i){const o=e._endId=++qX,s=()=>{o===e._endId&&i()};if(n!=null)return setTimeout(s,n);const{type:r,timeout:l,propCount:a}=gB(e,t);if(!r)return i();const u=r+"end";let c=0;const d=()=>{e.removeEventListener(u,h),s()},h=p=>{p.target===e&&++c>=a&&d()};setTimeout(()=>{c(n[m]||"").split(", "),o=i(`${vd}Delay`),s=i(`${vd}Duration`),r=nM(o,s),l=i(`${wg}Delay`),a=i(`${wg}Duration`),u=nM(l,a);let c=null,d=0,h=0;t===vd?r>0&&(c=vd,d=r,h=s.length):t===wg?u>0&&(c=wg,d=u,h=a.length):(d=Math.max(r,u),c=d>0?r>u?vd:wg:null,h=c?c===vd?s.length:a.length:0);const p=c===vd&&/\b(?:transform|all)(?:,|$)/.test(i(`${vd}Property`).toString());return{type:c,timeout:d,propCount:h,hasTransform:p}}function nM(e,t){for(;e.lengthiM(n)+iM(e[i])))}function iM(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Z5(e){return(e?e.ownerDocument:document).body.offsetHeight}function UX(e,t,n){const i=e[lm];i&&(t=(t?[t,...i]:[...i]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const uk=Symbol("_vod"),d7=Symbol("_vsh"),hs={name:"show",beforeMount(e,{value:t},{transition:n}){e[uk]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):Cg(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:i}){!t!=!n&&(i?t?(i.beforeEnter(e),Cg(e,!0),i.enter(e)):i.leave(e,()=>{Cg(e,!1)}):Cg(e,t))},beforeUnmount(e,{value:t}){Cg(e,t)}};function Cg(e,t){e.style.display=t?e[uk]:"none",e[d7]=!t}function VX(){hs.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}}}const vB=Symbol("");function X3t(e){const t=Vs();if(!t)return;const n=t.ut=(o=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(s=>ck(s,o))},i=()=>{const o=e(t.proxy);t.ce?ck(t.ce,o):G5(t.subTree,o),n(o)};N$(()=>{J9(i)}),xn(()=>{qe(i,Wa,{flush:"post"});const o=new MutationObserver(i);o.observe(t.subTree.el.parentNode,{childList:!0}),$n(()=>o.disconnect())})}function G5(e,t){if(e.shapeFlag&128){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{G5(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)ck(e.el,t);else if(e.type===Fe)e.children.forEach(n=>G5(n,t));else if(e.type===z1){let{el:n,anchor:i}=e;for(;n&&(ck(n,t),n!==i);)n=n.nextSibling}}function ck(e,t){if(e.nodeType===1){const n=e.style;let i="";for(const o in t){const s=jY(t[o]);n.setProperty(`--${o}`,s),i+=`--${o}: ${s};`}n[vB]=i}}const KX=/(?:^|;)\s*display\s*:/;function ZX(e,t,n){const i=e.style,o=ho(n);let s=!1;if(n&&!o){if(t)if(ho(t))for(const r of t.split(";")){const l=r.slice(0,r.indexOf(":")).trim();n[l]==null&&Zg(i,l,"")}else for(const r in t)n[r]==null&&Zg(i,r,"");for(const r in n){r==="display"&&(s=!0);const l=n[r];l!=null?QX(e,r,!ho(t)&&t?t[r]:void 0,l)||Zg(i,r,l):Zg(i,r,"")}}else if(o){if(t!==n){const r=i[vB];r&&(n+=";"+r),i.cssText=n,s=KX.test(n)}}else t&&e.removeAttribute("style");uk in e&&(e[uk]=s?i.display:"",e[d7]&&(i.display="none"))}const oM=/\s*!important$/;function Zg(e,t,n){if(En(n))n.forEach(i=>Zg(e,t,i));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const i=GX(e,t);oM.test(n)?e.setProperty($l(i),n.replace(oM,""),"important"):e[i]=n}}const sM=["Webkit","Moz","ms"],J3={};function GX(e,t){const n=J3[t];if(n)return n;let i=ur(t);if(i!=="filter"&&i in e)return J3[t]=i;i=Kb(i);for(let o=0;oX3||(nee.then(()=>X3=0),X3=Date.now());function oee(e,t){const n=i=>{if(!i._vts)i._vts=Date.now();else if(i._vts<=n.attached)return;const o=n.value;if(En(o)){const s=i.stopImmediatePropagation;i.stopImmediatePropagation=()=>{s.call(i),i._stopped=!0};const r=o.slice(),l=[i];for(let a=0;ae.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,see=(e,t,n,i,o,s)=>{const r=o==="svg";t==="class"?UX(e,i,r):t==="style"?ZX(e,n,i):Vv(t)?Wb(t)||JX(e,t,n,i,s):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):ree(e,t,i,r))?(aM(e,t,i),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&lM(e,t,i,r,s,t!=="value")):e._isVueCE&&(lee(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!ho(i)))?aM(e,ur(t),i,s,t):(t==="true-value"?e._trueValue=i:t==="false-value"&&(e._falseValue=i),lM(e,t,i,r))};function ree(e,t,n,i){if(i)return!!(t==="innerHTML"||t==="textContent"||t in e&&cM(t)&&qn(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return cM(t)&&ho(n)?!1:t in e}function lee(e,t){const n=e._def.props;if(!n)return!1;const i=ur(t);return Array.isArray(n)?n.some(o=>ur(o)===i):Object.keys(n).some(o=>ur(o)===i)}const dM={};function aee(e,t,n){let i=dt(e,t);qb(i)&&(i=no({},i,t));class o extends f7{constructor(r){super(i,r,n)}}return o.def=i,o}const e8t=((e,t)=>aee(e,t,xee)),uee=typeof HTMLElement<"u"?HTMLElement:class{};class f7 extends uee{constructor(t,n={},i=hk){super(),this._def=t,this._props=n,this._createApp=i,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._patching=!1,this._dirty=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._styleAnchors=new WeakMap,this._ob=null,this.shadowRoot&&i!==hk?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow(no({},t.shadowRootOptions,{mode:"open"})),this._root=this.shadowRoot):this._root=this}connectedCallback(){if(!this.isConnected)return;!this.shadowRoot&&!this._resolved&&this._parseSlots(),this._connected=!0;let t=this;for(;t=t&&(t.assignedSlot||t.parentNode||t.host);)if(t instanceof f7){this._parent=t;break}this._instance||(this._resolved?this._mount(this._def):t&&t._pendingResolve?this._pendingResolve=t._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(t=this._parent){t&&(this._instance.parent=t._instance,this._inheritParentContext(t))}_inheritParentContext(t=this._parent){t&&this._app&&Object.setPrototypeOf(this._app._context.provides,t._instance.provides)}disconnectedCallback(){this._connected=!1,mt(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null,this._teleportTargets&&(this._teleportTargets.clear(),this._teleportTargets=void 0))})}_processMutations(t){for(const n of t)this._setAttr(n.attributeName)}_resolveDef(){if(this._pendingResolve)return;for(let i=0;i{this._resolved=!0,this._pendingResolve=void 0;const{props:s,styles:r}=i;let l;if(s&&!En(s))for(const a in s){const u=s[a];(u===Number||u&&u.type===Number)&&(a in this._props&&(this._props[a]=V9(this._props[a])),(l||(l=Object.create(null)))[ur(a)]=!0)}this._numberProps=l,this._resolveProps(i),this.shadowRoot&&this._applyStyles(r),this._mount(i)},n=this._def.__asyncLoader;n?this._pendingResolve=n().then(i=>{i.configureApp=this._def.configureApp,t(this._def=i,!0)}):t(this._def)}_mount(t){this._app=this._createApp(t),this._inheritParentContext(),t.configureApp&&t.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const n=this._instance&&this._instance.exposed;if(n)for(const i in n)$i(this,i)||Object.defineProperty(this,i,{get:()=>f(n[i])})}_resolveProps(t){const{props:n}=t,i=En(n)?n:Object.keys(n||{});for(const o of Object.keys(this))o[0]!=="_"&&i.includes(o)&&this._setProp(o,this[o]);for(const o of i.map(ur))Object.defineProperty(this,o,{get(){return this._getProp(o)},set(s){this._setProp(o,s,!0,!this._patching)}})}_setAttr(t){if(t.startsWith("data-v-"))return;const n=this.hasAttribute(t);let i=n?this.getAttribute(t):dM;const o=ur(t);n&&this._numberProps&&this._numberProps[o]&&(i=V9(i)),this._setProp(o,i,!1,!0)}_getProp(t){return this._props[t]}_setProp(t,n,i=!0,o=!1){if(n!==this._props[t]&&(this._dirty=!0,n===dM?delete this._props[t]:(this._props[t]=n,t==="key"&&this._app&&(this._app._ceVNode.key=n)),o&&this._instance&&this._update(),i)){const s=this._ob;s&&(this._processMutations(s.takeRecords()),s.disconnect()),n===!0?this.setAttribute($l(t),""):typeof n=="string"||typeof n=="number"?this.setAttribute($l(t),n+""):n||this.removeAttribute($l(t)),s&&s.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),Aee(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const n=U(this._def,no(t,this._props));return this._instance||(n.ce=i=>{this._instance=i,i.ce=this,i.isCE=!0;const o=(s,r)=>{this.dispatchEvent(new CustomEvent(s,qb(r[0])?no({detail:r},r[0]):{detail:r}))};i.emit=(s,...r)=>{o(s,r),$l(s)!==s&&o($l(s),r)},this._setParent()}),n}_applyStyles(t,n,i){if(!t)return;if(n){if(n===this._def||this._styleChildren.has(n))return;this._styleChildren.add(n)}const o=this._nonce,s=this.shadowRoot,r=i?this._getStyleAnchor(i)||this._getStyleAnchor(this._def):this._getRootStyleInsertionAnchor(s);let l=null;for(let a=t.length-1;a>=0;a--){const u=document.createElement("style");o&&u.setAttribute("nonce",o),u.textContent=t[a],s.insertBefore(u,l||r),l=u,a===0&&(i||this._styleAnchors.set(this._def,u),n&&this._styleAnchors.set(n,u))}}_getStyleAnchor(t){if(!t)return null;const n=this._styleAnchors.get(t);return n&&n.parentNode===this.shadowRoot?n:(n&&this._styleAnchors.delete(t),null)}_getRootStyleInsertionAnchor(t){for(let n=0;n(delete e.props.mode,e),fee=dee({name:"TransitionGroup",props:no({},pB,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=Vs(),i=_$();let o,s;return Lm(()=>{if(!o.length)return;const r=e.moveClass||`${e.name||"v"}-move`;if(!gee(o[0].el,n.vnode.el,r)){o=[];return}o.forEach(hee),o.forEach(pee);const l=o.filter(mee);Z5(n.vnode.el),l.forEach(a=>{const u=a.el,c=u.style;$u(u,r),c.transform=c.webkitTransform=c.transitionDuration="";const d=u[dk]=h=>{h&&h.target!==u||(!h||h.propertyName.endsWith("transform"))&&(u.removeEventListener("transitionend",d),u[dk]=null,_d(u,r))};u.addEventListener("transitionend",d)}),o=[]}),()=>{const r=xi(e),l=mB(r);let a=r.tag||Fe;if(o=[],s)for(let u=0;u{l.split(/\s+/).forEach(a=>a&&i.classList.remove(a))}),n.split(/\s+/).forEach(l=>l&&i.classList.add(l)),i.style.display="none";const s=t.nodeType===1?t:t.parentNode;s.appendChild(i);const{hasTransform:r}=gB(i);return s.removeChild(i),r}const cf=e=>{const t=e.props["onUpdate:modelValue"]||!1;return En(t)?n=>R1(t,n):t};function vee(e){e.target.composing=!0}function hM(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const qa=Symbol("_assign");function pM(e,t,n){return t&&(e=e.trim()),n&&(e=Zb(e)),e}const ol={created(e,{modifiers:{lazy:t,trim:n,number:i}},o){e[qa]=cf(o);const s=i||o.props&&o.props.type==="number";zc(e,t?"change":"input",r=>{r.target.composing||e[qa](pM(e.value,n,s))}),(n||s)&&zc(e,"change",()=>{e.value=pM(e.value,n,s)}),t||(zc(e,"compositionstart",vee),zc(e,"compositionend",hM),zc(e,"change",hM))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:i,trim:o,number:s}},r){if(e[qa]=cf(r),e.composing)return;const l=(s||e.type==="number")&&!/^0\d/.test(e.value)?Zb(e.value):e.value,a=t??"";if(l===a)return;const u=e.getRootNode();(u instanceof Document||u instanceof ShadowRoot)&&u.activeElement===e&&e.type!=="range"&&(i&&t===n||o&&e.value.trim()===a)||(e.value=a)}},fk={deep:!0,created(e,t,n){e[qa]=cf(n),zc(e,"change",()=>{const i=e._modelValue,o=am(e),s=e.checked,r=e[qa];if(En(i)){const l=Qb(i,o),a=l!==-1;if(s&&!a)r(i.concat(o));else if(!s&&a){const u=[...i];u.splice(l,1),r(u)}}else if(vp(i)){const l=new Set(i);s?l.add(o):l.delete(o),r(l)}else r(AB(e,s))})},mounted:mM,beforeUpdate(e,t,n){e[qa]=cf(n),mM(e,t,n)}};function mM(e,{value:t,oldValue:n},i){e._modelValue=t;let o;if(En(t))o=Qb(t,i.props.value)>-1;else if(vp(t))o=t.has(i.props.value);else{if(t===n)return;o=nd(t,AB(e,!0))}e.checked!==o&&(e.checked=o)}const CB={created(e,{value:t},n){e.checked=nd(t,n.props.value),e[qa]=cf(n),zc(e,"change",()=>{e[qa](am(e))})},beforeUpdate(e,{value:t,oldValue:n},i){e[qa]=cf(i),t!==n&&(e.checked=nd(t,i.props.value))}},Q5={deep:!0,created(e,{value:t,modifiers:{number:n}},i){const o=vp(t);zc(e,"change",()=>{const s=Array.prototype.filter.call(e.options,r=>r.selected).map(r=>n?Zb(am(r)):am(r));e[qa](e.multiple?o?new Set(s):s:s[0]),e._assigning=!0,mt(()=>{e._assigning=!1})}),e[qa]=cf(i)},mounted(e,{value:t}){gM(e,t)},beforeUpdate(e,t,n){e[qa]=cf(n)},updated(e,{value:t}){e._assigning||gM(e,t)}};function gM(e,t){const n=e.multiple,i=En(t);if(!(n&&!i&&!vp(t))){for(let o=0,s=e.options.length;oString(u)===String(l)):r.selected=Qb(t,l)>-1}else r.selected=t.has(l);else if(nd(am(r),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function am(e){return"_value"in e?e._value:e.value}function AB(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const yee={created(e,t,n){J2(e,t,n,null,"created")},mounted(e,t,n){J2(e,t,n,null,"mounted")},beforeUpdate(e,t,n,i){J2(e,t,n,i,"beforeUpdate")},updated(e,t,n,i){J2(e,t,n,i,"updated")}};function xB(e,t){switch(e){case"SELECT":return Q5;case"TEXTAREA":return ol;default:switch(t){case"checkbox":return fk;case"radio":return CB;default:return ol}}}function J2(e,t,n,i,o){const r=xB(e.tagName,n.props&&n.props.type)[o];r&&r(e,t,n,i)}function kee(){ol.getSSRProps=({value:e})=>({value:e}),CB.getSSRProps=({value:e},t)=>{if(t.props&&nd(t.props.value,e))return{checked:!0}},fk.getSSRProps=({value:e},t)=>{if(En(e)){if(t.props&&Qb(e,t.props.value)>-1)return{checked:!0}}else if(vp(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},yee.getSSRProps=(e,t)=>{if(typeof t.type!="string")return;const n=xB(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}const bee=["ctrl","shift","alt","meta"],wee={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>bee.some(n=>e[`${n}Key`]&&!t.includes(n))},Rt=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),i=t.join(".");return n[i]||(n[i]=((o,...s)=>{for(let r=0;r{const n=e._withKeys||(e._withKeys={}),i=t.join(".");return n[i]||(n[i]=(o=>{if(!("key"in o))return;const s=$l(o.key);if(t.some(r=>r===s||Cee[r]===s))return e(o)}))},SB=no({patchProp:see},jX);let w0,vM=!1;function _B(){return w0||(w0=wX(SB))}function IB(){return w0=vM?w0:CX(SB),vM=!0,w0}const Aee=((...e)=>{_B().render(...e)}),i8t=((...e)=>{IB().hydrate(...e)}),hk=((...e)=>{const t=_B().createApp(...e),{mount:n}=t;return t.mount=i=>{const o=TB(i);if(!o)return;const s=t._component;!qn(s)&&!s.render&&!s.template&&(s.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const r=n(o,!1,MB(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),r},t}),xee=((...e)=>{const t=IB().createApp(...e),{mount:n}=t;return t.mount=i=>{const o=TB(i);if(o)return n(o,!0,MB(o))},t});function MB(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function TB(e){return ho(e)?document.querySelector(e):e}let yM=!1;const o8t=()=>{yM||(yM=!0,kee(),VX())},EB=Symbol("IconResolver"),See={sm:14,md:16,lg:20},Ae=dt({__name:"Icon",props:{name:{},size:{default:"md"},label:{}},setup(e){const t=e,n=rn(EB,()=>{}),i=D(()=>n(t.name)),o=D(()=>See[t.size]);return(s,r)=>i.value?(k(),ce(fs(i.value),{key:0,class:"kw-icon",width:o.value,height:o.value,"aria-label":e.label,"aria-hidden":e.label?void 0:!0},null,8,["width","height","aria-label","aria-hidden"])):J("",!0)}}),_ee=["disabled"],Iee={key:0,class:"ui-action-card__leading"},Mee={class:"ui-action-card__text"},Tee={class:"ui-action-card__title"},Eee={key:0,class:"ui-action-card__hint"},Lee=dt({__name:"ActionCard",props:{disabled:{type:Boolean,default:!1}},emits:["select"],setup(e){return(t,n)=>(k(),L("button",{class:"ui-action-card",type:"button",disabled:e.disabled,onClick:n[0]||(n[0]=i=>t.$emit("select"))},[t.$slots.leading?(k(),L("span",Iee,[Gn(t.$slots,"leading",{},void 0,!0)])):J("",!0),_("span",Mee,[_("span",Tee,[Gn(t.$slots,"default",{},void 0,!0),Gn(t.$slots,"badge",{},void 0,!0)]),t.$slots.hint?(k(),L("span",Eee,[Gn(t.$slots,"hint",{},void 0,!0)])):J("",!0)]),U(Ae,{name:"chevron-right",size:"lg",class:"ui-action-card__chevron"})],8,_ee))}}),Lt=(e,t)=>{const n=e.__vccOpts||e;for(const[i,o]of t)n[i]=o;return n},Y5=Lt(Lee,[["__scopeId","data-v-e52e7748"]]);/*! - * shared v11.4.6 - * (c) 2026 kazuya kawaguchi - * Released under the MIT License. - */function Nee(e,t){typeof console<"u"&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const pk=typeof window<"u",Mf=(e,t=!1)=>t?Symbol.for(e):Symbol(e),Dee=(e,t,n)=>Fee({l:e,k:t,s:n}),Fee=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),zs=e=>typeof e=="number"&&isFinite(e),LB=e=>p7(e)==="[object Date]",um=e=>p7(e)==="[object RegExp]",l4=e=>Ii(e)&&Object.keys(e).length===0,Ws=Object.assign,Ree=Object.create,fo=(e=null)=>Ree(e);let kM;const Ih=()=>kM||(kM=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:fo());function bM(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/").replace(/=/g,"=")}function Oee(e){return e.replace(/&(?![a-zA-Z0-9#]{2,6};)/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}const Pee=/^\s*javascript\s*(?::|�*58;?|�*3a;?|:?)/i,$ee=/^(?:href|src|action|formaction)$/i;function h7(e){return Pee.test(e)}function Bee(e){const t=/url\s*\(/gi;let n="",i=0,o;for(;(o=t.exec(e))!==null;){const s=o.index,r=t.lastIndex-1;let l=r+1,a=1,u=null;for(;l`${i}="${wM(i,o)}"`),e=e.replace(/([\w:-]+)\s*=\s*'([^']*)'/g,(n,i,o)=>`${i}='${wM(i,o)}'`),/\s*on\w+\s*=\s*["']?[^"'>]+["']?/gi.test(e)&&(e=e.replace(/(\s+)(on)(\w+\s*=)/gi,"$1on$3")),e=e.replace(/(\s+(?:href|src|action|formaction)\s*=\s*)([^\s"'=<>`]+)/gi,(n,i,o)=>h7(o)?`${i}about:blank`:n),e}const jee=Object.prototype.hasOwnProperty;function Ba(e,t){return jee.call(e,t)}const ps=Array.isArray,Uo=e=>typeof e=="function",yn=e=>typeof e=="string",Ri=e=>typeof e=="boolean",Oi=e=>e!==null&&typeof e=="object",Hee=e=>Oi(e)&&Uo(e.then)&&Uo(e.catch),NB=Object.prototype.toString,p7=e=>NB.call(e),Ii=e=>p7(e)==="[object Object]",Wee=e=>e==null?"":ps(e)||Ii(e)&&e.toString===NB?JSON.stringify(e,null,2):String(e);function m7(e,t=""){return e.reduce((n,i,o)=>o===0?n+i:n+t+i,"")}const X2=e=>!Oi(e)||ps(e);function l9(e,t){if(X2(e)||X2(t))throw new Error("Invalid value");const n=[{src:e,des:t}];for(;n.length;){const{src:i,des:o}=n.pop();Object.keys(i).forEach(s=>{s!=="__proto__"&&(Oi(i[s])&&!Oi(o[s])&&(o[s]=Array.isArray(i[s])?[]:fo()),X2(o[s])||X2(i[s])?o[s]=i[s]:n.push({src:i[s],des:o[s]}))})}}/*! - * message-compiler v11.4.6 - * (c) 2026 kazuya kawaguchi - * Released under the MIT License. - */function qee(e,t,n){return{line:e,column:t,offset:n}}function J5(e,t,n){return{start:e,end:t}}const Ui={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14},Uee=17;function a4(e,t,n={}){const{domain:i,messages:o,args:s}=n,r=e,l=new SyntaxError(String(r));return l.code=e,t&&(l.location=t),l.domain=i,l}function Vee(e){throw e}const Fu=" ",Kee="\r",Yr=` -`,Zee="\u2028",Gee="\u2029";function Qee(e){const t=e;let n=0,i=1,o=1,s=0;const r=T=>t[T]===Kee&&t[T+1]===Yr,l=T=>t[T]===Yr,a=T=>t[T]===Gee,u=T=>t[T]===Zee,c=T=>r(T)||l(T)||a(T)||u(T),d=()=>n,h=()=>i,p=()=>o,m=()=>s,g=T=>r(T)||a(T)||u(T)?Yr:t[T],y=()=>g(n),b=()=>g(n+s);function v(){return s=0,c(n)&&(i++,o=0),r(n)&&n++,n++,o++,t[n]}function C(){return r(n+s)&&s++,s++,t[n+s]}function w(){n=0,i=1,o=1,s=0}function M(T=0){s=T}function N(){const T=n+s;for(;T!==n;)v();s=0}return{index:d,line:h,column:p,peekOffset:m,charAt:g,currentChar:y,currentPeek:b,next:v,peek:C,reset:w,resetPeek:M,skipToPeek:N}}const Mc=void 0,Yee=".",CM="'",Jee="tokenizer";function Xee(e,t={}){const n=t.location!==!1,i=Qee(e),o=()=>i.index(),s=()=>qee(i.line(),i.column(),i.index()),r=s(),l=o(),a={currentType:13,offset:l,startLoc:r,endLoc:r,lastType:13,lastOffset:l,lastStartLoc:r,lastEndLoc:r,braceNest:0,inLinked:!1,text:""},u=()=>a,{onError:c}=t;function d(X,re,ke,...le){const se=u();if(re.column+=ke,re.offset+=ke,c){const _e=n?J5(se.startLoc,re):null,ge=a4(X,_e,{domain:Jee,args:le});c(ge)}}function h(X,re,ke){X.endLoc=s(),X.currentType=re;const le={type:re};return n&&(le.loc=J5(X.startLoc,X.endLoc)),ke!=null&&(le.value=ke),le}const p=X=>h(X,13);function m(X,re){return X.currentChar()===re?(X.next(),re):(d(Ui.EXPECTED_TOKEN,s(),0,re),"")}function g(X){let re="";for(;X.currentPeek()===Fu||X.currentPeek()===Yr;)re+=X.currentPeek(),X.peek();return re}function y(X){const re=g(X);return X.skipToPeek(),re}function b(X){if(X===Mc)return!1;const re=X.charCodeAt(0);return re>=97&&re<=122||re>=65&&re<=90||re===95}function v(X){if(X===Mc)return!1;const re=X.charCodeAt(0);return re>=48&&re<=57}function C(X,re){const{currentType:ke}=re;if(ke!==2)return!1;g(X);const le=b(X.currentPeek());return X.resetPeek(),le}function w(X,re){const{currentType:ke}=re;if(ke!==2)return!1;g(X);const le=X.currentPeek()==="-"?X.peek():X.currentPeek(),se=v(le);return X.resetPeek(),se}function M(X,re){const{currentType:ke}=re;if(ke!==2)return!1;g(X);const le=X.currentPeek()===CM;return X.resetPeek(),le}function N(X,re){const{currentType:ke}=re;if(ke!==7)return!1;g(X);const le=X.currentPeek()===".";return X.resetPeek(),le}function T(X,re){const{currentType:ke}=re;if(ke!==8)return!1;g(X);const le=b(X.currentPeek());return X.resetPeek(),le}function S(X,re){const{currentType:ke}=re;if(!(ke===7||ke===11))return!1;g(X);const le=X.currentPeek()===":";return X.resetPeek(),le}function x(X,re){const{currentType:ke}=re;if(ke!==9)return!1;const le=()=>{const _e=X.currentPeek();return _e==="{"?b(X.peek()):_e==="@"||_e==="|"||_e===":"||_e==="."||_e===Fu||!_e?!1:_e===Yr?(X.peek(),le()):E(X,!1)},se=le();return X.resetPeek(),se}function A(X){g(X);const re=X.currentPeek()==="|";return X.resetPeek(),re}function E(X,re=!0){const ke=(se=!1,_e="")=>{const ge=X.currentPeek();return ge==="{"||ge==="@"||!ge?se:ge==="|"?!(_e===Fu||_e===Yr):ge===Fu?(X.peek(),ke(!0,Fu)):ge===Yr?(X.peek(),ke(!0,Yr)):!0},le=ke();return re&&X.resetPeek(),le}function I(X,re){const ke=X.currentChar();return ke===Mc?Mc:re(ke)?(X.next(),ke):null}function R(X){const re=X.charCodeAt(0);return re>=97&&re<=122||re>=65&&re<=90||re>=48&&re<=57||re===95||re===36}function W(X){return I(X,R)}function z(X){const re=X.charCodeAt(0);return re>=97&&re<=122||re>=65&&re<=90||re>=48&&re<=57||re===95||re===36||re===45}function F(X){return I(X,z)}function O(X){const re=X.charCodeAt(0);return re>=48&&re<=57}function B(X){return I(X,O)}function j(X){const re=X.charCodeAt(0);return re>=48&&re<=57||re>=65&&re<=70||re>=97&&re<=102}function $(X){return I(X,j)}function V(X){let re="",ke="";for(;re=B(X);)ke+=re;return ke}function ne(X){let re="";for(;;){const ke=X.currentChar();if(ke==="\\"){const le=X.peek();le==="{"||le==="}"||le==="@"||le==="|"||le==="\\"?(re+=ke+le,X.next(),X.next()):(X.resetPeek(),re+=ke,X.next())}else{if(ke==="{"||ke==="}"||ke==="@"||ke==="|"||!ke)break;if(ke===Fu||ke===Yr)if(E(X))re+=ke,X.next();else{if(A(X))break;re+=ke,X.next()}else re+=ke,X.next()}}return re}function K(X){y(X);let re="",ke="";for(;re=F(X);)ke+=re;const le=X.currentChar();if(le&&le!=="}"&&le!==Mc&&le!==Fu&&le!==Yr&&le!==" "){const se=Me(X);return d(Ui.INVALID_TOKEN_IN_PLACEHOLDER,s(),0,ke+se),ke+se}return X.currentChar()===Mc&&d(Ui.UNTERMINATED_CLOSING_BRACE,s(),0),ke}function ee(X){y(X);let re="";return X.currentChar()==="-"?(X.next(),re+=`-${V(X)}`):re+=V(X),X.currentChar()===Mc&&d(Ui.UNTERMINATED_CLOSING_BRACE,s(),0),re}function ue(X){return X!==CM&&X!==Yr}function ie(X){y(X),m(X,"'");let re="",ke="";for(;re=I(X,ue);)re==="\\"?ke+=ye(X):ke+=re;const le=X.currentChar();return le===Yr||le===Mc?(d(Ui.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,s(),0),le===Yr&&(X.next(),m(X,"'")),ke):(m(X,"'"),ke)}function ye(X){const re=X.currentChar();switch(re){case"\\":case"'":return X.next(),`\\${re}`;case"u":return Te(X,re,4);case"U":return Te(X,re,6);default:return d(Ui.UNKNOWN_ESCAPE_SEQUENCE,s(),0,re),""}}function Te(X,re,ke){m(X,re);let le="";for(let se=0;se{const le=X.currentChar();return le==="{"||le==="@"||le==="|"||le==="("||le===")"||!le||le===Fu?ke:(ke+=le,X.next(),re(ke))};return re("")}function Z(X){y(X);const re=m(X,"|");return y(X),re}function Q(X,re){let ke=null;switch(X.currentChar()){case"{":return re.braceNest>=1&&d(Ui.NOT_ALLOW_NEST_PLACEHOLDER,s(),0),X.next(),ke=h(re,2,"{"),y(X),re.braceNest++,ke;case"}":return re.braceNest>0&&re.currentType===2&&d(Ui.EMPTY_PLACEHOLDER,s(),0),X.next(),ke=h(re,3,"}"),re.braceNest--,re.braceNest>0&&y(X),re.inLinked&&re.braceNest===0&&(re.inLinked=!1),ke;case"@":return re.braceNest>0&&d(Ui.UNTERMINATED_CLOSING_BRACE,s(),0),ke=fe(X,re)||p(re),re.braceNest=0,ke;default:{let se=!0,_e=!0,ge=!0;if(A(X))return re.braceNest>0&&d(Ui.UNTERMINATED_CLOSING_BRACE,s(),0),ke=h(re,1,Z(X)),re.braceNest=0,re.inLinked=!1,ke;if(re.braceNest>0&&(re.currentType===4||re.currentType===5||re.currentType===6))return d(Ui.UNTERMINATED_CLOSING_BRACE,s(),0),re.braceNest=0,de(X,re);if(se=C(X,re))return ke=h(re,4,K(X)),y(X),ke;if(_e=w(X,re))return ke=h(re,5,ee(X)),y(X),ke;if(ge=M(X,re))return ke=h(re,6,ie(X)),y(X),ke;if(!se&&!_e&&!ge)return ke=h(re,12,Me(X)),d(Ui.INVALID_TOKEN_IN_PLACEHOLDER,s(),0,ke.value),y(X),ke;break}}return ke}function fe(X,re){const{currentType:ke}=re;let le=null;const se=X.currentChar();switch((ke===7||ke===8||ke===11||ke===9)&&(se===Yr||se===Fu)&&d(Ui.INVALID_LINKED_FORMAT,s(),0),se){case"@":return X.next(),le=h(re,7,"@"),re.inLinked=!0,le;case".":return y(X),X.next(),h(re,8,".");case":":return y(X),X.next(),h(re,9,":");default:return A(X)?(le=h(re,1,Z(X)),re.braceNest=0,re.inLinked=!1,le):N(X,re)||S(X,re)?(y(X),fe(X,re)):T(X,re)?(y(X),h(re,11,G(X))):x(X,re)?(y(X),se==="{"?Q(X,re)||le:h(re,10,oe(X))):(ke===7&&d(Ui.INVALID_LINKED_FORMAT,s(),0),re.braceNest=0,re.inLinked=!1,de(X,re))}}function de(X,re){let ke={type:13};if(re.braceNest>0)return Q(X,re)||p(re);if(re.inLinked)return fe(X,re)||p(re);switch(X.currentChar()){case"{":return Q(X,re)||p(re);case"}":return d(Ui.UNBALANCED_CLOSING_BRACE,s(),0),X.next(),h(re,3,"}");case"@":return fe(X,re)||p(re);default:{if(A(X))return ke=h(re,1,Z(X)),re.braceNest=0,re.inLinked=!1,ke;if(E(X))return h(re,0,ne(X));break}}return ke}function pe(){const{currentType:X,offset:re,startLoc:ke,endLoc:le}=a;return a.lastType=X,a.lastOffset=re,a.lastStartLoc=ke,a.lastEndLoc=le,a.offset=o(),a.startLoc=s(),i.currentChar()===Mc?h(a,13):de(i,a)}return{nextToken:pe,currentOffset:o,currentPosition:s,context:u}}const ete="parser",tte=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g,nte=/\\([\\@{}|])/g;function ite(e,t){return t}function ote(e,t,n){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const i=parseInt(t||n,16);return i<=55295||i>=57344?String.fromCodePoint(i):"�"}}}function ste(e={}){const t=e.location!==!1,{onError:n}=e;function i(b,v,C,w,...M){const N=b.currentPosition();if(N.offset+=w,N.column+=w,n){const T=t?J5(C,N):null,S=a4(v,T,{domain:ete,args:M});n(S)}}function o(b,v,C){const w={type:b};return t&&(w.start=v,w.end=v,w.loc={start:C,end:C}),w}function s(b,v,C,w){t&&(b.end=v,b.loc&&(b.loc.end=C))}function r(b,v){const C=b.context(),w=o(3,C.offset,C.startLoc);return w.value=v.replace(nte,ite),s(w,b.currentOffset(),b.currentPosition()),w}function l(b,v){const C=b.context(),{lastOffset:w,lastStartLoc:M}=C,N=o(5,w,M);return N.index=parseInt(v,10),b.nextToken(),s(N,b.currentOffset(),b.currentPosition()),N}function a(b,v){const C=b.context(),{lastOffset:w,lastStartLoc:M}=C,N=o(4,w,M);return N.key=v,b.nextToken(),s(N,b.currentOffset(),b.currentPosition()),N}function u(b,v){const C=b.context(),{lastOffset:w,lastStartLoc:M}=C,N=o(9,w,M);return N.value=v.replace(tte,ote),b.nextToken(),s(N,b.currentOffset(),b.currentPosition()),N}function c(b){const v=b.nextToken(),C=b.context(),{lastOffset:w,lastStartLoc:M}=C,N=o(8,w,M);return v.type!==11?(i(b,Ui.UNEXPECTED_EMPTY_LINKED_MODIFIER,C.lastStartLoc,0),N.value="",s(N,w,M),{nextConsumeToken:v,node:N}):(v.value==null&&i(b,Ui.UNEXPECTED_LEXICAL_ANALYSIS,C.lastStartLoc,0,Ru(v)),N.value=v.value||"",s(N,b.currentOffset(),b.currentPosition()),{node:N})}function d(b,v){const C=b.context(),w=o(7,C.offset,C.startLoc);return w.value=v,s(w,b.currentOffset(),b.currentPosition()),w}function h(b){const v=b.context(),C=o(6,v.offset,v.startLoc);let w=b.nextToken();if(w.type===8){const M=c(b);C.modifier=M.node,w=M.nextConsumeToken||b.nextToken()}switch(w.type!==9&&i(b,Ui.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,Ru(w)),w=b.nextToken(),w.type===2&&(w=b.nextToken()),w.type){case 10:w.value==null&&i(b,Ui.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,Ru(w)),C.key=d(b,w.value||"");break;case 4:w.value==null&&i(b,Ui.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,Ru(w)),C.key=a(b,w.value||"");break;case 5:w.value==null&&i(b,Ui.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,Ru(w)),C.key=l(b,w.value||"");break;case 6:w.value==null&&i(b,Ui.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,Ru(w)),C.key=u(b,w.value||"");break;default:{i(b,Ui.UNEXPECTED_EMPTY_LINKED_KEY,v.lastStartLoc,0);const M=b.context(),N=o(7,M.offset,M.startLoc);return N.value="",s(N,M.offset,M.startLoc),C.key=N,s(C,M.offset,M.startLoc),{nextConsumeToken:w,node:C}}}return s(C,b.currentOffset(),b.currentPosition()),{node:C}}function p(b){const v=b.context(),C=v.currentType===1?b.currentOffset():v.offset,w=v.currentType===1?v.endLoc:v.startLoc,M=o(2,C,w);M.items=[];let N=null;do{const x=N||b.nextToken();switch(N=null,x.type){case 0:x.value==null&&i(b,Ui.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,Ru(x)),M.items.push(r(b,x.value||""));break;case 5:x.value==null&&i(b,Ui.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,Ru(x)),M.items.push(l(b,x.value||""));break;case 4:x.value==null&&i(b,Ui.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,Ru(x)),M.items.push(a(b,x.value||""));break;case 6:x.value==null&&i(b,Ui.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,Ru(x)),M.items.push(u(b,x.value||""));break;case 7:{const A=h(b);M.items.push(A.node),N=A.nextConsumeToken||null;break}}}while(v.currentType!==13&&v.currentType!==1);const T=v.currentType===1?v.lastOffset:b.currentOffset(),S=v.currentType===1?v.lastEndLoc:b.currentPosition();return s(M,T,S),M}function m(b,v,C,w){const M=b.context();let N=w.items.length===0;const T=o(1,v,C);T.cases=[],T.cases.push(w);do{const S=p(b);N||(N=S.items.length===0),T.cases.push(S)}while(M.currentType!==13);return N&&i(b,Ui.MUST_HAVE_MESSAGES_IN_PLURAL,C,0),s(T,b.currentOffset(),b.currentPosition()),T}function g(b){const v=b.context(),{offset:C,startLoc:w}=v,M=p(b);return v.currentType===13?M:m(b,C,w,M)}function y(b){const v=Xee(b,Ws({},e)),C=v.context(),w=o(0,C.offset,C.startLoc);return t&&w.loc&&(w.loc.source=b),w.body=g(v),e.onCacheKey&&(w.cacheKey=e.onCacheKey(b)),C.currentType!==13&&i(v,Ui.UNEXPECTED_LEXICAL_ANALYSIS,C.lastStartLoc,0,b[C.offset]||""),s(w,v.currentOffset(),v.currentPosition()),w}return{parse:y}}function Ru(e){if(e.type===13)return"EOF";const t=(e.value||"").replace(/\r?\n/gu,"\\n");return t.length>10?t.slice(0,9)+"…":t}function rte(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:s=>(n.helpers.add(s),s)}}function AM(e,t){for(let n=0;nxM(n)),e}function xM(e){if(e.items.length===1){const t=e.items[0];(t.type===3||t.type===9)&&(e.static=t.value,delete t.value)}else{const t=[];for(let n=0;nr;function a(g,y){r.code+=g}function u(g,y=!0){const b=y?i:"";a(o?b+" ".repeat(g):b)}function c(g=!0){const y=++r.indentLevel;g&&u(y)}function d(g=!0){const y=--r.indentLevel;g&&u(y)}function h(){u(r.indentLevel)}return{context:l,push:a,indent:c,deindent:d,newline:h,helper:g=>`_${g}`,needIndent:()=>r.needIndent}}function cte(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),cm(e,t.key),t.modifier?(e.push(", "),cm(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function dte(e,t){const{helper:n,needIndent:i}=e;e.push(`${n("normalize")}([`),e.indent(i());const o=t.items.length;for(let s=0;s1){e.push(`${n("plural")}([`),e.indent(i());const o=t.cases.length;for(let s=0;s{const n=yn(t.mode)?t.mode:"normal",i=yn(t.filename)?t.filename:"message.intl";t.sourceMap;const o=t.breakLineCode!=null?t.breakLineCode:n==="arrow"?";":` -`,s=t.needIndent?t.needIndent:n!=="arrow",r=e.helpers||[],l=ute(e,{filename:i,breakLineCode:o,needIndent:s});l.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(s),r.length>0&&(l.push(`const { ${m7(r.map(c=>`${c}: _${c}`),", ")} } = ctx`),l.newline()),l.push("return "),cm(l,e),l.deindent(s),l.push("}"),delete e.helpers;const{code:a,map:u}=l.context();return{ast:e,code:a,map:u?u.toJSON():void 0}};function mte(e,t={}){const n=Ws({},t),i=!!n.jit,o=!!n.minify,s=n.optimize==null?!0:n.optimize,l=ste(n).parse(e);return i?(s&&ate(l),o&&u1(l),{ast:l,code:""}):(lte(l,n),pte(l,n))}/*! - * core-base v11.4.6 - * (c) 2026 kazuya kawaguchi - * Released under the MIT License. - */function gte(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Ih().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Ih().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function oc(e){return Oi(e)&&v7(e)===0&&(Ba(e,"b")||Ba(e,"body"))}const DB=["b","body"];function vte(e){return Tf(e,DB)}const FB=["c","cases"];function yte(e){return Tf(e,FB,[])}const RB=["s","static"];function kte(e){return Tf(e,RB)}const OB=["i","items"];function bte(e){return Tf(e,OB,[])}const PB=["t","type"];function v7(e){return Tf(e,PB)}const $B=["v","value"];function ey(e,t){const n=Tf(e,$B);if(n!=null)return n;throw fv(t)}const BB=["m","modifier"];function wte(e){return Tf(e,BB)}const zB=["k","key"];function Cte(e){const t=Tf(e,zB);if(t)return t;throw fv(6)}function Tf(e,t,n){for(let i=0;iAte(n,e)}function Ate(e,t){const n=vte(t);if(n==null)throw fv(0);if(v7(n)===1){const s=yte(n);return e.plural(s.reduce((r,l)=>[...r,SM(e,l)],[]))}else return SM(e,n)}function SM(e,t){const n=kte(t);if(n!=null)return e.type==="text"?n:e.normalize([n]);{const i=bte(t).reduce((o,s)=>[...o,X5(e,s)],[]);return e.normalize(i)}}function X5(e,t){const n=v7(t);switch(n){case 3:return ey(t,n);case 9:return ey(t,n);case 4:{const i=t;if(Ba(i,"k")&&i.k)return e.interpolate(e.named(i.k));if(Ba(i,"key")&&i.key)return e.interpolate(e.named(i.key));throw fv(n)}case 5:{const i=t;if(Ba(i,"i")&&zs(i.i))return e.interpolate(e.list(i.i));if(Ba(i,"index")&&zs(i.index))return e.interpolate(e.list(i.index));throw fv(n)}case 6:{const i=t,o=wte(i),s=Cte(i);return e.linked(X5(e,s),o?X5(e,o):void 0,e.type)}case 7:return ey(t,n);case 8:return ey(t,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const xte=e=>e;let ty=fo();function Ste(e,t={}){let n=!1;const i=t.onError||Vee;return t.onError=o=>{n=!0,i(o)},{...mte(e,t),detectError:n}}function _te(e,t){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&yn(e)){Ri(t.warnHtmlMessage)&&t.warnHtmlMessage;const i=(t.onCacheKey||xte)(e),o=ty[i];if(o)return o;const{ast:s,detectError:r}=Ste(e,{...t,location:!1,jit:!0}),l=e8(s);return r?l:ty[i]=l}else{const n=e.cacheKey;if(n){const i=ty[n];return i||(ty[n]=e8(e))}else return e8(e)}}let hv=null;function Ite(e){hv=e}function Mte(e,t,n){hv&&hv.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})}const Tte=Ete("function:translate");function Ete(e){return t=>hv&&hv.emit(e,t)}const Hc={INVALID_ARGUMENT:Uee,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},Lte=24;function Wc(e){return a4(e,null,void 0)}function y7(e,t){return t.locale!=null?_M(t.locale):_M(e.locale)}let t8;function _M(e){if(yn(e))return e;if(Uo(e)){if(e.resolvedOnce&&t8!=null)return t8;if(e.constructor.name==="Function"){const t=e();if(Hee(t))throw Wc(Hc.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return t8=t}else throw Wc(Hc.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw Wc(Hc.NOT_SUPPORT_LOCALE_TYPE)}function Nte(e,t,n){return[...new Set([n,...ps(t)?t:Oi(t)?Object.keys(t):yn(t)?[t]:[n]])]}function eC(e,t,n){const i=yn(n)?n:pv,o=e;o.__localeChainCache||(o.__localeChainCache=new Map);let s=o.__localeChainCache.get(i);if(!s){s=[];let r=[n];for(;ps(r);)r=IM(s,r,t);const l=ps(t)||!Ii(t)?t:t.default?t.default:null;r=yn(l)?[l]:l,ps(r)&&IM(s,r,!1),o.__localeChainCache.set(i,s)}return s}function IM(e,t,n){let i=!0;for(let o=0;o{r===void 0?r=l:r+=l},h[1]=()=>{r!==void 0&&(t.push(r),r=void 0)},h[2]=()=>{h[0](),o++},h[3]=()=>{if(o>0)o--,i=4,h[0]();else{if(o=0,r===void 0||(r=Bte(r),r===!1))return!1;h[1]()}};function p(){const m=e[n+1];if(i===5&&m==="'"||i===6&&m==='"')return n++,l="\\"+m,h[0](),!0}for(;i!==null;)if(n++,s=e[n],!(s==="\\"&&p())){if(a=$te(s),d=Ef[i],u=d[a]||d.l||8,u===8||(i=u[0],u[1]!==void 0&&(c=h[u[1]],c&&(l=s,c()===!1))))return;if(i===7)return t}}const MM=new Map;function jte(e,t){return Oi(e)?e[t]:null}function Hte(e,t){if(!Oi(e))return null;let n=MM.get(t);if(n||(n=zte(t),n&&MM.set(t,n)),!n)return null;const i=n.length;let o=e,s=0;for(;s`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function qte(){return{upper:(e,t)=>t==="text"&&yn(e)?e.toUpperCase():t==="vnode"&&Oi(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>t==="text"&&yn(e)?e.toLowerCase():t==="vnode"&&Oi(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>t==="text"&&yn(e)?TM(e):t==="vnode"&&Oi(e)&&"__v_isVNode"in e?TM(e.children):e}}let HB;function Ute(e){HB=e}let WB;function Vte(e){WB=e}let qB;function Kte(e){qB=e}let UB=null;const Zte=e=>{UB=e},Gte=()=>UB;let VB=null;const EM=e=>{VB=e},Qte=()=>VB;let LM=0;function Yte(e={}){const t=Uo(e.onWarn)?e.onWarn:Nee,n=yn(e.version)?e.version:Wte,i=yn(e.locale)||Uo(e.locale)?e.locale:pv,o=Uo(i)?pv:i,s=ps(e.fallbackLocale)||Ii(e.fallbackLocale)||yn(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:o,r=Ii(e.messages)?e.messages:n8(o),l=Ii(e.datetimeFormats)?e.datetimeFormats:n8(o),a=Ii(e.numberFormats)?e.numberFormats:n8(o),u=Ws(fo(),e.modifiers,qte()),c=e.pluralRules||fo(),d=Uo(e.missing)?e.missing:null,h=Ri(e.missingWarn)||um(e.missingWarn)?e.missingWarn:!0,p=Ri(e.fallbackWarn)||um(e.fallbackWarn)?e.fallbackWarn:!0,m=!!e.fallbackFormat,g=!!e.unresolving,y=Uo(e.postTranslation)?e.postTranslation:null,b=Ii(e.processor)?e.processor:null,v=Ri(e.warnHtmlMessage)?e.warnHtmlMessage:!0,C=!!e.escapeParameter,w=Uo(e.messageCompiler)?e.messageCompiler:HB,M=Uo(e.messageResolver)?e.messageResolver:WB||jte,N=Uo(e.localeFallbacker)?e.localeFallbacker:qB||Nte,T=Oi(e.fallbackContext)?e.fallbackContext:void 0,S=e,x=Oi(S.__datetimeFormatters)?S.__datetimeFormatters:new Map,A=Oi(S.__numberFormatters)?S.__numberFormatters:new Map,E=Oi(S.__meta)?S.__meta:{};LM++;const I={version:n,cid:LM,locale:i,fallbackLocale:s,messages:r,modifiers:u,pluralRules:c,missing:d,missingWarn:h,fallbackWarn:p,fallbackFormat:m,unresolving:g,postTranslation:y,processor:b,warnHtmlMessage:v,escapeParameter:C,messageCompiler:w,messageResolver:M,localeFallbacker:N,fallbackContext:T,onWarn:t,__meta:E};return I.datetimeFormats=l,I.numberFormats=a,I.__datetimeFormatters=x,I.__numberFormatters=A,__INTLIFY_PROD_DEVTOOLS__&&Mte(I,n,E),I}const n8=e=>({[e]:fo()});function k7(e,t,n,i,o){const{missing:s,onWarn:r}=e;if(s!==null){const l=s(e,n,t,o);return yn(l)?l:t}else return t}function Ag(e,t,n){const i=e;i.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function Jte(e,t){return e===t?!1:e.split("-")[0]===t.split("-")[0]}function Xte(e,t){const n=t.indexOf(e);if(n===-1)return!1;for(let i=n+1;i{KB.includes(a)?r[a]=n[a]:s[a]=n[a]}),yn(i)?s.locale=i:Ii(i)&&(r=i),Ii(o)&&(r=o),[s.key||"",l,s,r]}function DM(e,t,n){const i=e;for(const o in n){const s=`${t}__${o}`;i.__datetimeFormatters.has(s)&&i.__datetimeFormatters.delete(s)}}function FM(e,...t){const{numberFormats:n,unresolving:i,fallbackLocale:o,onWarn:s,localeFallbacker:r}=e,{__numberFormatters:l}=e;if(!zs(t[0]))return mk;const[a,u,c,d]=nC(...t),h=Ri(c.missingWarn)?c.missingWarn:e.missingWarn;Ri(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn;const p=!!c.part,m=y7(e,c),g=r(e,o,m);if(!yn(a)||a===""){const N=new Intl.NumberFormat(m.replace(/!/g,""),d);return p?N.formatToParts(u):N.format(u)}let y={},b,v=null;const C="number format";for(let N=0;N{ZB.includes(a)?r[a]=n[a]:s[a]=n[a]}),yn(i)?s.locale=i:Ii(i)&&(r=i),Ii(o)&&(r=o),[s.key||"",l,s,r]}function RM(e,t,n){const i=e;for(const o in n){const s=`${t}__${o}`;i.__numberFormatters.has(s)&&i.__numberFormatters.delete(s)}}const ene=e=>e,tne=e=>"",nne="text",ine=e=>e.length===0?"":m7(e),one=Wee;function i8(e,t){return e=Math.abs(e),t===2?e===1?0:1:Math.min(e,2)}function sne(e){const t=zs(e.pluralIndex)?e.pluralIndex:-1;return zs(e.named?.count)?e.named.count:zs(e.named?.n)?e.named.n:t}function rne(e={}){const t=e.locale,n=sne(e),i=yn(t)&&Uo(e.pluralRules?.[t])?e.pluralRules[t]:i8,o=i===i8?void 0:i8,s=b=>b[i(n,b.length,o)],r=e.list||[],l=b=>r[b],a=e.named||fo();zs(e.pluralIndex)&&(a.count||=e.pluralIndex,a.n||=e.pluralIndex);const u=b=>a[b];function c(b,v){const C=Uo(e.messages)?e.messages(b,!!v):Oi(e.messages)?e.messages[b]:!1;return C||(e.parent?e.parent.message(b):tne)}const d=b=>e.modifiers?e.modifiers[b]:ene,h=Uo(e.processor?.normalize)?e.processor.normalize:ine,p=Uo(e.processor?.interpolate)?e.processor.interpolate:one,m=yn(e.processor?.type)?e.processor.type:nne,y={list:l,named:u,plural:s,linked:(b,...v)=>{const[C,w]=v;let M="text",N="";v.length===1?Oi(C)?(N=C.modifier||N,M=C.type||M):yn(C)&&(N=C||N):v.length===2&&(yn(C)&&(N=C||N),yn(w)&&(M=w||M));const T=c(b,!0)(y),S=T===""||T===void 0?b:T,x=M==="vnode"&&ps(S)&&N?S[0]:S;return N?d(N)(x,M):x},message:c,type:m,interpolate:p,normalize:h,values:Ws(fo(),r,a)};return y}const OM=()=>"",Fa=e=>Uo(e);function PM(e,...t){const{fallbackFormat:n,postTranslation:i,unresolving:o,messageCompiler:s,fallbackLocale:r,messages:l}=e,[a,u]=iC(...t),c=Ri(u.missingWarn)?u.missingWarn:e.missingWarn,d=Ri(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn,h=Ri(u.escapeParameter)?u.escapeParameter:e.escapeParameter,p=!!u.resolvedMessage,m=yn(u.default)||Ri(u.default)?Ri(u.default)?s?a:()=>a:u.default:n?s?a:()=>a:null,g=n||m!=null&&(yn(m)||Uo(m)),y=y7(e,u);h&&lne(u);let[b,v,C]=p?[a,y,l[y]||fo()]:GB(e,a,y,r,d,c),w=b,M=a;if(!p&&!(yn(w)||oc(w)||Fa(w))&&g&&(w=m,M=w),!p&&(!(yn(w)||oc(w)||Fa(w))||!yn(v)))return o?u4:a;let N=!1;const T=()=>{N=!0},S=Fa(w)?w:QB(e,a,v,w,M,T);if(N)return w;const x=cne(e,v,C,u),A=rne(x),E=ane(e,S,A);let I=i?i(E,a):E;if(h&&yn(I)&&(I=zee(I)),__INTLIFY_PROD_DEVTOOLS__){const R={timestamp:Date.now(),key:yn(a)?a:Fa(w)?w.key:"",locale:v||(Fa(w)?w.locale:""),format:yn(w)?w:Fa(w)?w.source:"",message:I};R.meta=Ws({},e.__meta,Gte()||{}),Tte(R)}return I}function lne(e){ps(e.list)?e.list=e.list.map(t=>yn(t)?bM(t):t):Oi(e.named)&&Object.keys(e.named).forEach(t=>{yn(e.named[t])&&(e.named[t]=bM(e.named[t]))})}function GB(e,t,n,i,o,s){const{messages:r,onWarn:l,messageResolver:a,localeFallbacker:u}=e,c=u(e,i,n);let d=fo(),h,p=null;const m="translate";for(let g=0;gi);return u.locale=n,u.key=t,u}const a=r(i,une(e,n,o,i,l,s));return a.locale=n,a.key=t,a.source=i,a}function ane(e,t,n){return t(n)}function iC(...e){const[t,n,i]=e,o=fo();if(!yn(t)&&!zs(t)&&!Fa(t)&&!oc(t))throw Wc(Hc.INVALID_ARGUMENT);const s=zs(t)?String(t):(Fa(t),t);return zs(n)?o.plural=n:yn(n)?o.default=n:Ii(n)&&!l4(n)?o.named=n:ps(n)&&(o.list=n),zs(i)?o.plural=i:yn(i)?o.default=i:Ii(i)&&Ws(o,i),[s,o]}function une(e,t,n,i,o,s){return{locale:t,key:n,warnHtmlMessage:o,onError:r=>{throw s&&s(r),r},onCacheKey:r=>Dee(t,n,r)}}function cne(e,t,n,i){const{modifiers:o,pluralRules:s,messageResolver:r,fallbackLocale:l,fallbackWarn:a,missingWarn:u,fallbackContext:c}=e,h={locale:t,modifiers:o,pluralRules:s,messages:(p,m)=>{let g=r(n,p);if(g==null&&(c||m)){const[y,,b]=GB(c||e,p,t,l,a,u);g=y??r(b,p)}if(yn(g)||oc(g)){let y=!1;const v=QB(e,p,t,g,p,()=>{y=!0});return y?OM:v}else return Fa(g)?g:OM}};return e.processor&&(h.processor=e.processor),i.list&&(h.list=i.list),i.named&&(h.named=i.named),zs(i.plural)&&(h.pluralIndex=i.plural),h}gte();/*! - * vue-i18n v11.4.6 - * (c) 2026 kazuya kawaguchi - * Released under the MIT License. - */const dne="11.4.6";function fne(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(Ih().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(Ih().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Ih().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Ih().__INTLIFY_PROD_DEVTOOLS__=!1)}const vl={UNEXPECTED_RETURN_TYPE:Lte,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 Hl(e,...t){return a4(e,null,void 0)}const oC=Mf("__translateVNode"),sC=Mf("__datetimeParts"),rC=Mf("__numberParts"),YB=Mf("__setPluralRules"),JB=Mf("__injectWithOption"),b1=Mf("__dispose");function mv(e){if(!Oi(e)||oc(e))return e;for(const t in e)if(Ba(e,t))if(!t.includes("."))Oi(e[t])&&mv(e[t]);else{const n=t.split("."),i=n.length-1;let o=e,s=!1;for(let r=0;r{if("locale"in l&&"resource"in l){const{locale:a,resource:u}=l;a?(r[a]=r[a]||fo(),l9(u,r[a])):l9(u,r)}else yn(l)&&l9(JSON.parse(l),r)}),o==null&&s)for(const l in r)Ba(r,l)&&mv(r[l]);return r}function XB(e){return e.type}function ez(e,t,n){let i=Oi(t.messages)?t.messages:fo();"__i18nGlobal"in n&&(i=b7(e.locale.value,{messages:i,__i18n:n.__i18nGlobal}));const o=Object.keys(i);o.length&&o.forEach(s=>{e.mergeLocaleMessage(s,i[s])});{if(Oi(t.datetimeFormats)){const s=Object.keys(t.datetimeFormats);s.length&&s.forEach(r=>{e.mergeDateTimeFormat(r,t.datetimeFormats[r])})}if(Oi(t.numberFormats)){const s=Object.keys(t.numberFormats);s.length&&s.forEach(r=>{e.mergeNumberFormat(r,t.numberFormats[r])})}}}function $M(e){return U(Qd,null,e,0)}function gv(){return Vs()}const BM="__INTLIFY_META__",zM=()=>[],hne=()=>!1;let jM=0;function HM(e){return((t,n,i,o)=>e(n,i,gv()||void 0,o))}const pne=()=>{const e=gv();let t=null;return e&&(t=XB(e)[BM])?{[BM]:t}:null};function gk(e={}){const{__root:t,__injectWithOption:n}=e,i=t===void 0,o=e.flatJson,s=pk?q:_u;let r=Ri(e.inheritLocale)?e.inheritLocale:!0;const l=s(t&&r?t.locale.value:yn(e.locale)?e.locale:pv),a=s(t&&r?t.fallbackLocale.value:yn(e.fallbackLocale)||ps(e.fallbackLocale)||Ii(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:l.value),u=s(b7(l.value,e)),c=s(Ii(e.datetimeFormats)?e.datetimeFormats:{[l.value]:{}}),d=s(Ii(e.numberFormats)?e.numberFormats:{[l.value]:{}});let h=t?t.missingWarn:Ri(e.missingWarn)||um(e.missingWarn)?e.missingWarn:!0,p=t?t.fallbackWarn:Ri(e.fallbackWarn)||um(e.fallbackWarn)?e.fallbackWarn:!0,m=t?t.fallbackRoot:Ri(e.fallbackRoot)?e.fallbackRoot:!0,g=!!e.fallbackFormat,y=Uo(e.missing)?e.missing:null,b=Uo(e.missing)?HM(e.missing):null,v=Uo(e.postTranslation)?e.postTranslation:null,C=t?t.warnHtmlMessage:Ri(e.warnHtmlMessage)?e.warnHtmlMessage:!0,w=!!e.escapeParameter;const M=t?t.modifiers:Ii(e.modifiers)?e.modifiers:{};let N=e.pluralRules||t&&t.pluralRules,T;T=(()=>{i&&EM(null);const ge={version:dne,locale:l.value,fallbackLocale:a.value,messages:u.value,modifiers:M,pluralRules:N,missing:b===null?void 0:b,missingWarn:h,fallbackWarn:p,fallbackFormat:g,unresolving:!0,postTranslation:v===null?void 0:v,warnHtmlMessage:C,escapeParameter:w,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};ge.datetimeFormats=c.value,ge.numberFormats=d.value,ge.__datetimeFormatters=Ii(T)?T.__datetimeFormatters:void 0,ge.__numberFormatters=Ii(T)?T.__numberFormatters:void 0;const Le=Yte(ge);return i&&EM(Le),Le})(),Ag(T,l.value,a.value);function x(){return[l.value,a.value,u.value,c.value,d.value]}const A=D({get:()=>l.value,set:ge=>{T.locale=ge,l.value=ge}}),E=D({get:()=>a.value,set:ge=>{T.fallbackLocale=ge,a.value=ge,Ag(T,l.value,ge)}}),I=D(()=>u.value),R=D(()=>c.value),W=D(()=>d.value);function z(){return Uo(v)?v:null}function F(ge){v=ge,T.postTranslation=ge}function O(){return y}function B(ge){ge!==null&&(b=HM(ge)),y=ge,T.missing=b}const j=(ge,Le,be,xe,Oe,Ze)=>{x();let ct;try{__INTLIFY_PROD_DEVTOOLS__,i||(T.fallbackContext=t?Qte():void 0),ct=ge(T)}finally{__INTLIFY_PROD_DEVTOOLS__,i||(T.fallbackContext=void 0)}if(be!=="translate exists"&&zs(ct)&&ct===u4||be==="translate exists"&&!ct){const[yt,Wt]=Le();return t&&m?xe(t):Oe(yt)}else{if(Ze(ct))return ct;throw Hl(vl.UNEXPECTED_RETURN_TYPE)}};function $(...ge){return j(Le=>Reflect.apply(PM,null,[Le,...ge]),()=>iC(...ge),"translate",Le=>Reflect.apply(Le.t,Le,[...ge]),Le=>Le,Le=>yn(Le))}function V(...ge){const[Le,be,xe]=ge;if(xe&&!Oi(xe))throw Hl(vl.INVALID_ARGUMENT);return $(Le,be,Ws({resolvedMessage:!0},xe||{}))}function ne(...ge){return j(Le=>Reflect.apply(NM,null,[Le,...ge]),()=>tC(...ge),"datetime format",Le=>Reflect.apply(Le.d,Le,[...ge]),()=>mk,Le=>yn(Le)||ps(Le))}function K(...ge){return j(Le=>Reflect.apply(FM,null,[Le,...ge]),()=>nC(...ge),"number format",Le=>Reflect.apply(Le.n,Le,[...ge]),()=>mk,Le=>yn(Le)||ps(Le))}function ee(ge){return ge.map(Le=>yn(Le)||zs(Le)||Ri(Le)?$M(String(Le)):Le)}const ie={normalize:ee,interpolate:ge=>ge,type:"vnode"};function ye(...ge){return j(Le=>{let be;const xe=Le;try{xe.processor=ie,be=Reflect.apply(PM,null,[xe,...ge])}finally{xe.processor=null}return be},()=>iC(...ge),"translate",Le=>Le[oC](...ge),Le=>[$M(Le)],Le=>ps(Le))}function Te(...ge){return j(Le=>Reflect.apply(FM,null,[Le,...ge]),()=>nC(...ge),"number format",Le=>Le[rC](...ge),zM,Le=>yn(Le)||ps(Le))}function Ee(...ge){return j(Le=>Reflect.apply(NM,null,[Le,...ge]),()=>tC(...ge),"datetime format",Le=>Le[sC](...ge),zM,Le=>yn(Le)||ps(Le))}function Me(ge){N=ge,T.pluralRules=N}function G(ge,Le){return j(()=>{if(!ge)return!1;const be=yn(Le)?Le:l.value,xe=yn(Le)?[be]:eC(T,a.value,be);for(let Oe=0;Oe[ge],"translate exists",be=>Reflect.apply(be.te,be,[ge,Le]),hne,be=>Ri(be))}function oe(ge){let Le=null;const be=eC(T,a.value,l.value);for(let xe=0;xe{r&&(l.value=ge,T.locale=ge,Ag(T,l.value,a.value))}),qe(t.fallbackLocale,ge=>{r&&(a.value=ge,T.fallbackLocale=ge,Ag(T,l.value,a.value))}));const _e={id:jM,locale:A,fallbackLocale:E,get inheritLocale(){return r},set inheritLocale(ge){r=ge,ge&&t&&(l.value=t.locale.value,a.value=t.fallbackLocale.value,Ag(T,l.value,a.value))},get availableLocales(){return Object.keys(u.value).sort()},messages:I,get modifiers(){return M},get pluralRules(){return N||{}},get isGlobal(){return i},get missingWarn(){return h},set missingWarn(ge){h=ge,T.missingWarn=h},get fallbackWarn(){return p},set fallbackWarn(ge){p=ge,T.fallbackWarn=p},get fallbackRoot(){return m},set fallbackRoot(ge){m=ge},get fallbackFormat(){return g},set fallbackFormat(ge){g=ge,T.fallbackFormat=g},get warnHtmlMessage(){return C},set warnHtmlMessage(ge){C=ge,T.warnHtmlMessage=ge},get escapeParameter(){return w},set escapeParameter(ge){w=ge,T.escapeParameter=ge},t:$,getLocaleMessage:Q,setLocaleMessage:fe,mergeLocaleMessage:de,getPostTranslationHandler:z,setPostTranslationHandler:F,getMissingHandler:O,setMissingHandler:B,[YB]:Me};return _e.datetimeFormats=R,_e.numberFormats=W,_e.rt=V,_e.te=G,_e.tm=Z,_e.d=ne,_e.n=K,_e.getDateTimeFormat=pe,_e.setDateTimeFormat=X,_e.mergeDateTimeFormat=re,_e.getNumberFormat=ke,_e.setNumberFormat=le,_e.mergeNumberFormat=se,_e[JB]=n,_e[oC]=ye,_e[sC]=Ee,_e[rC]=Te,_e}function mne(e){const t=yn(e.locale)?e.locale:pv,n=yn(e.fallbackLocale)||ps(e.fallbackLocale)||Ii(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,i=Uo(e.missing)?e.missing:void 0,o=Ri(e.silentTranslationWarn)||um(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,s=Ri(e.silentFallbackWarn)||um(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,r=Ri(e.fallbackRoot)?e.fallbackRoot:!0,l=!!e.formatFallbackMessages,a=Ii(e.modifiers)?e.modifiers:{},u=e.pluralizationRules,c=Uo(e.postTranslation)?e.postTranslation:void 0,d=yn(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,h=!!e.escapeParameterHtml,p=Ri(e.sync)?e.sync:!0;let m=e.messages;if(Ii(e.sharedMessages)){const M=e.sharedMessages;m=Object.keys(M).reduce((T,S)=>{const x=T[S]||(T[S]={});return Ws(x,M[S]),T},m||{})}const{__i18n:g,__root:y,__injectWithOption:b}=e,v=e.datetimeFormats,C=e.numberFormats,w=e.flatJson;return{locale:t,fallbackLocale:n,messages:m,flatJson:w,datetimeFormats:v,numberFormats:C,missing:i,missingWarn:o,fallbackWarn:s,fallbackRoot:r,fallbackFormat:l,modifiers:a,pluralRules:u,postTranslation:c,warnHtmlMessage:d,escapeParameter:h,messageResolver:e.messageResolver,inheritLocale:p,__i18n:g,__root:y,__injectWithOption:b}}function lC(e={}){const t=gk(mne(e)),{__extender:n}=e,i={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 Ri(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(o){t.missingWarn=Ri(o)?!o:o},get silentFallbackWarn(){return Ri(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(o){t.fallbackWarn=Ri(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,s){return t.te(o,s)},tm(o){return t.tm(o)},getLocaleMessage(o){return t.getLocaleMessage(o)},setLocaleMessage(o,s){t.setLocaleMessage(o,s)},mergeLocaleMessage(o,s){t.mergeLocaleMessage(o,s)},d(...o){return Reflect.apply(t.d,t,[...o])},getDateTimeFormat(o){return t.getDateTimeFormat(o)},setDateTimeFormat(o,s){t.setDateTimeFormat(o,s)},mergeDateTimeFormat(o,s){t.mergeDateTimeFormat(o,s)},n(...o){return Reflect.apply(t.n,t,[...o])},getNumberFormat(o){return t.getNumberFormat(o)},setNumberFormat(o,s){t.setNumberFormat(o,s)},mergeNumberFormat(o,s){t.mergeNumberFormat(o,s)}};return i.__extender=n,i}function gne(e,t,n){return{beforeCreate(){const i=gv();if(!i)throw Hl(vl.UNEXPECTED_ERROR);const o=this.$options;if(o.i18n){const s=o.i18n;if(o.__i18n&&(s.__i18n=o.__i18n),s.__root=t,this===this.$root)this.$i18n=WM(e,s);else{s.__injectWithOption=!0,s.__extender=n.__vueI18nExtend,this.$i18n=lC(s);const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}}else if(o.__i18n)if(this===this.$root)this.$i18n=WM(e,o);else{this.$i18n=lC({__i18n:o.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:t});const s=this.$i18n;s.__extender&&(s.__disposer=s.__extender(this.$i18n))}else this.$i18n=e;o.__i18nGlobal&&ez(t,o,o),this.$t=(...s)=>this.$i18n.t(...s),this.$rt=(...s)=>this.$i18n.rt(...s),this.$te=(s,r)=>this.$i18n.te(s,r),this.$d=(...s)=>this.$i18n.d(...s),this.$n=(...s)=>this.$i18n.n(...s),this.$tm=s=>this.$i18n.tm(s),n.__setInstance(i,this.$i18n)},mounted(){},unmounted(){const i=gv();if(!i)throw Hl(vl.UNEXPECTED_ERROR);const o=this.$i18n;o&&(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(i),delete this.$i18n)}}}function WM(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[YB](t.pluralizationRules||e.pluralizationRules);const n=b7(e.locale,{messages:t.messages,__i18n:t.__i18n});return Object.keys(n).forEach(i=>e.mergeLocaleMessage(i,n[i])),t.datetimeFormats&&Object.keys(t.datetimeFormats).forEach(i=>e.mergeDateTimeFormat(i,t.datetimeFormats[i])),t.numberFormats&&Object.keys(t.numberFormats).forEach(i=>e.mergeNumberFormat(i,t.numberFormats[i])),e}const w7={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function vne({slots:e},t){return t.length===1&&t[0]==="default"?(e.default?e.default():[]).reduce((i,o)=>[...i,...o.type===Fe?o.children:[o]],[]):t.reduce((n,i)=>{const o=e[i];return o&&(n[i]=o()),n},fo())}function tz(){return Fe}const yne=dt({name:"i18n-t",props:Ws({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>zs(e)||!isNaN(e)}},w7),setup(e,t){const{slots:n,attrs:i}=t,o=e.i18n||Jt({useScope:e.scope,__useComponent:!0});return()=>{const s=()=>{const a=Object.keys(n).filter(d=>d[0]!=="_"),u=fo();e.locale&&(u.locale=e.locale),e.plural!==void 0&&(u.plural=yn(e.plural)?+e.plural:e.plural);const c=vne(t,a);return o[oC](e.keypath,c,u)},r=Ws(fo(),i),l=yn(e.tag)||Oi(e.tag)?e.tag:tz();return Oi(l)?jn(l,r,{default:s}):jn(l,r,s())}}}),qM=yne;function kne(e){return ps(e)&&!yn(e[0])}function nz(e,t,n,i){const{slots:o,attrs:s}=t;return()=>{const r=()=>{const u={part:!0};let c=fo();e.locale&&(u.locale=e.locale),yn(e.format)?u.key=e.format:Oi(e.format)&&(yn(e.format.key)&&(u.key=e.format.key),c=Object.keys(e.format).reduce((p,m)=>n.includes(m)?Ws(fo(),p,{[m]:e.format[m]}):p,fo()));const d=i(e.value,u,c);let h=[u.key];return ps(d)?h=d.map((p,m)=>{const g=o[p.type],y=g?g({[p.type]:p.value,index:m,parts:d}):[p.value];return kne(y)&&(y[0].key=`${p.type}-${m}`),y}):yn(d)&&(h=[d]),h},l=Ws(fo(),s),a=yn(e.tag)||Oi(e.tag)?e.tag:tz();return Oi(a)?jn(a,l,{default:r}):jn(a,l,r())}}const bne=dt({name:"i18n-n",props:Ws({value:{type:Number,required:!0},format:{type:[String,Object]}},w7),setup(e,t){const n=e.i18n||Jt({useScope:e.scope,__useComponent:!0});return nz(e,t,ZB,(...i)=>n[rC](...i))}}),UM=bne;function wne(e,t){const n=e;if(e.mode==="composition")return n.__getInstance(t)||e.global;{const i=n.__getInstance(t);return i!=null?i.__composer:e.global.__composer}}function Cne(e){const t=r=>{const{instance:l,value:a}=r;if(!l||!l.$)throw Hl(vl.UNEXPECTED_ERROR);const u=wne(e,l.$),c=VM(a);return[Reflect.apply(u.t,u,[...KM(c)]),u]};return{created:(r,l)=>{const[a,u]=t(l);pk&&(r.__i18nWatcher=qe(u.locale,()=>{l.instance&&l.instance.$forceUpdate()})),r.__composer=u,r.textContent=a},unmounted:r=>{pk&&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,u=VM(l);r.textContent=Reflect.apply(a.t,a,[...KM(u)])}},getSSRProps:r=>{const[l]=t(r);return{textContent:l}}}}function VM(e){if(yn(e))return{path:e};if(Ii(e)){if(!("path"in e))throw Hl(vl.REQUIRED_VALUE,"path");return e}else throw Hl(vl.INVALID_VALUE)}function KM(e){const{path:t,locale:n,args:i,choice:o,plural:s}=e,r={},l=i||{};return yn(n)&&(r.locale=n),zs(o)&&(r.plural=o),zs(s)&&(r.plural=s),[t,l,r]}function Ane(e,t,...n){const i=Ii(n[0])?n[0]:{};(Ri(i.globalInstall)?i.globalInstall:!0)&&([qM.name,"I18nT"].forEach(s=>e.component(s,qM)),[UM.name,"I18nN"].forEach(s=>e.component(s,UM)),[QM.name,"I18nD"].forEach(s=>e.component(s,QM))),e.directive("t",Cne(t))}const xne=Mf("global-vue-i18n");function Sne(e={}){const t=__VUE_I18N_LEGACY_API__&&Ri(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,n=Ri(e.globalInjection)?e.globalInjection:!0,i=new Map,[o,s]=_ne(e,t),r=Mf("");function l(d){return i.get(d)||null}function a(d,h){i.set(d,h)}function u(d){i.delete(d)}const c={get mode(){return __VUE_I18N_LEGACY_API__&&t?"legacy":"composition"},async install(d,...h){if(d.__VUE_I18N_SYMBOL__=r,d.provide(d.__VUE_I18N_SYMBOL__,c),Ii(h[0])){const g=h[0];c.__composerExtend=g.__composerExtend,c.__vueI18nExtend=g.__vueI18nExtend}let p=null;!t&&n&&(p=Dne(d,c.global)),__VUE_I18N_FULL_INSTALL__&&Ane(d,c,...h),__VUE_I18N_LEGACY_API__&&t&&d.mixin(gne(s,s.__composer,c));const m=d.unmount;d.unmount=()=>{p&&p(),c.dispose(),m()}},get global(){return s},dispose(){o.stop()},__instances:i,__getInstance:l,__setInstance:a,__deleteInstance:u};return c}function Jt(e={}){const t=gv();if(t==null)throw Hl(vl.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw Hl(vl.NOT_INSTALLED);const n=Ine(t),i=Tne(n),o=XB(t),s=Mne(e,o);if(s==="global")return ez(i,e,o),i;if(s==="parent"){let a=ZM(n,t,e.__useComponent);return a==null&&(a=i),a}if(s==="isolated"){if(n.mode!=="composition")throw Hl(vl.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const a=n,u=Ws({},e),c=ZM(n,t);u.__root=c||i;const d=gk(u);return a.__composerExtend&&(d[b1]=a.__composerExtend(d)),Tm()&&ad(()=>{const p=d[b1];p&&(p(),delete d[b1])}),d}const r=n;let l=r.__getInstance(t);if(l==null){const a=Ws({},e);"__i18n"in o&&(a.__i18n=o.__i18n),i&&(a.__root=i),l=gk(a),r.__composerExtend&&(l[b1]=r.__composerExtend(l)),Lne(r,t,l),r.__setInstance(t,l)}return l}function _ne(e,t){const n=Yb(),i=__VUE_I18N_LEGACY_API__&&t?n.run(()=>lC(e)):n.run(()=>gk(e));if(i==null)throw Hl(vl.UNEXPECTED_ERROR);return[n,i]}function Ine(e){const t=rn(e.isCE?xne:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw Hl(e.isCE?vl.NOT_INSTALLED_WITH_PROVIDE:vl.UNEXPECTED_ERROR);return t}function Mne(e,t){return l4(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function Tne(e){return e.mode==="composition"?e.global:e.global.__composer}function ZM(e,t,n=!1){let i=null;const o=t.root;let s=Ene(t,n);for(;s!=null;){const r=e;if(e.mode==="composition")i=r.__getInstance(s);else if(__VUE_I18N_LEGACY_API__){const l=r.__getInstance(s);l!=null&&(i=l.__composer,n&&i&&!i[JB]&&(i=null))}if(i!=null||o===s)break;s=s.parent}return i}function Ene(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function Lne(e,t,n){xn(()=>{},t),$n(()=>{const i=n;e.__deleteInstance(t);const o=i[b1];o&&(o(),delete i[b1])},t)}const Nne=["locale","fallbackLocale","availableLocales"],GM=["t","rt","d","n","tm","te"];function Dne(e,t){const n=Object.create(null);return Nne.forEach(o=>{const s=Object.getOwnPropertyDescriptor(t,o);if(!s)throw Hl(vl.UNEXPECTED_ERROR);const r=mo(s.value)?{get(){return s.value.value},set(l){s.value.value=l}}:{get(){return s.get&&s.get()}};Object.defineProperty(n,o,r)}),e.config.globalProperties.$i18n=n,GM.forEach(o=>{const s=Object.getOwnPropertyDescriptor(t,o);if(!s||!s.value)throw Hl(vl.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${o}`,s)}),()=>{delete e.config.globalProperties.$i18n,GM.forEach(o=>{delete e.config.globalProperties[`$${o}`]})}}const Fne=dt({name:"i18n-d",props:Ws({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},w7),setup(e,t){const n=e.i18n||Jt({useScope:e.scope,__useComponent:!0});return nz(e,t,KB,(...i)=>n[sC](...i))}}),QM=Fne;fne();Ute(_te);Vte(Hte);Kte(eC);if(__INTLIFY_PROD_DEVTOOLS__){const e=Ih();e.__INTLIFY__=!0,Ite(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const Rne={confirm:"Confirm",cancel:"Cancel",close:"Close",dismiss:"Dismiss",loading:"Loading",copy:"Copy",errorBoundaryTitle:"Something went wrong",errorBoundaryRetry:"Try again",asyncLoadFailed:"Failed to load. Close this view and try again."},One={connecting:"Connecting…",connectingStageAuth:"Checking sign-in…",connectingStageServer:"Connecting to server…",connectingStageConfig:"Loading configuration…",connectingStageSessions:"Loading sessions…",connectingStageSession:"Opening session…",connectingRetrySuffix:" (retry {n})",connectingIssueNetworkTitle:"Cannot connect to the Kimi server",connectingIssueNetworkMessage:"Check your network connection and make sure the server is still running.",connectingIssueTimeoutTitle:"The Kimi server is taking too long to respond",connectingIssueTimeoutMessage:"Still retrying automatically — please wait.",connectingIssueApiTitle:"The Kimi server returned an error",connectingIssueUnknownTitle:"Connection problem",internalBuildBanner:"Internal testing only",menuFile:"File",menuEdit:"Edit",menuView:"View",menuHelp:"Help",applicationMenu:"Application menu"},Pne={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",workspaces:"workspaces",viewSwitcher:"List options",viewGroup:"View",viewFlat:"Flat list",viewGrouped:"Group by workspace",sortGroup:"Sort order",sortManual:"Manual",sortRecent:"Recent activity",sessionAdmin:"Manage Sessions",collapseAll:"Collapse all workspaces",expandAll:"Expand all workspaces",newSession:"New Session",newChat:"New Session",newWorkspace:"New Workspace",dropToAddWorkspace:"Drop to add workspace",emptyState:"No sessions yet · click New Session to start",options:"Options",rename:"Rename",genTitle:"Gen Title",genTitleUnavailable:"Title generation unavailable — needs a managed Kimi Code login and at least one message",setEmoji:"Set Emoji…",sessionEmojiTitle:"Pick an emoji",removeEmoji:"Remove emoji",randomEmoji:"Random",searchEmoji:"Search emoji",recentEmojis:"Recently used",noEmojiResults:"No matching emoji",emojiGroupFaces:"Smileys & People",emojiGroupNature:"Animals & Nature",emojiGroupFood:"Food & Drink",emojiGroupActivity:"Activities & Travel",emojiGroupObjects:"Objects & Work",emojiGroupSymbols:"Symbols & Status",copyPath:"Copy path",copySessionId:"Copy session ID",copied:"Copied ✓",copyFailed:"Copy failed",archive:"Archive",archiveToastUndo:"Undo",archiveToastMid:"or view archived chats in",archiveToastSettings:"Settings",archiveToastTail:"",tabOpen:"Open",tabDone:"Done",tabWorkspaces:"Workspaces",tagOpen:"Open",tagDone:"Done",complete:"Done",markDone:"Mark as done",reopen:"Mark as open",noDoneSessions:"No completed sessions yet",noOpenSessions:"No open sessions yet",completeToastLead:"Done",reopenToastLead:"Back to open",fork:"Fork session",export:"Export session",pin:"Pin",unpin:"Unpin",lastActive:"Last updated: {time}",pinned:"Pinned",collapsePinned:"Collapse pinned",expandPinned:"Expand pinned",resizePinnedAria:"Resize pinned section height",delete:"Delete",removeWorkspace:"Remove workspace",brand:"Kimi Code",signedIn:"Signed in",signOut:"Sign out",notSignedIn:"Not signed in",signIn:"Sign in",defaultUserName:"Kimi User",upgrade:"Upgrade",upgradeMembership:"Upgrade membership",logoutConfirmTitle:"Sign out",logoutConfirmMessage:"Are you sure you want to sign out?",language:"Language",backendTitle:"Backend {backend} · {endpoint} — click to switch",noSessions:"No conversations yet",allPinned:"{count} conversations pinned",showMore:"Show more",loadMore:"Load more",showLess:"Show less",loadingMore:"Loading…",collapseSidebar:"Collapse sidebar",expandSidebar:"Expand sidebar",searchPlaceholder:"Search sessions and workspaces",search:"Search",searchHint:"↑↓ navigate · ↵ open · Esc close",searchHintSelect:"navigate",searchHintOpen:"open",searchHintClose:"close",searchClear:"Clear search",searchNoResults:"No matching sessions or workspaces",searchEmpty:"No sessions yet",update:"Upgrade",updateAvailable:"v{version} available",updateDownloadingButton:"Downloading… ({percent}%)",updateReady:"v{version} ready",updateDone:"Restart",updateFailed:"Download failed",updateRetry:"Retry",updateDownloadNow:"Download & Update",updateSkip:"Skip This Version",updateRestartNow:"Restart Now",updateRestartLater:"Later",updateReleaseDate:"Released {date}",updateCurrentVersion:"Current v{version}",updateWhatsNew:"What’s new",updateBackground:"Download in Background",updateAutoDownload:"Automatically download and install updates",rcSelectDevice:"Select device",rcCurrentDevice:"Current device: {name}",rcConnectable:"Connectable",rcUnavailable:"Unavailable",rcOnline:"Online",rcOffline:"Offline",rcDevicesLoadFailed:"Failed to load devices"},$ne={title:"Session Management",subtitle:"Manage all sessions. Mark the finished ones as done. Filter by last updated to clean up old sessions in bulk.",back:"Back",filterWorkspace:"Workspace",filterStatus:"Status",filterTime:"Updated",allWorkspaces:"All workspaces",selectAll:"Select all",searchWorkspace:"Search workspaces",noWorkspaceMatch:"No matching workspaces",removeTag:"Remove {name}",statusAll:"All statuses",statusOpen:"Open",statusDone:"Done",timeAll:"Any time",timeDaysAgo:"{n} days ago",query:"Query",reset:"Reset",colStatus:"Status",colTitle:"Title",colWorkspace:"Workspace",colPrompt:"Last prompt",colUpdated:"Updated",colCompleted:"Completed",colActions:"Actions",empty:"No sessions match the current filters",loading:"Loading…",total:"{n} total",pageSize:"{n} / page",prevPage:"Previous page",nextPage:"Next page",selectPageAll:"Select all on this page",batchSelected:"{n} selected",selectAllMatching:"Select all {total} matching sessions",materializingAll:"Selecting…",allMatchingSelected:"All {n} selected",clearSelection:"Clear selection",markDone:"Mark as done",reopen:"Mark as open",markDoneCount:"Mark as done ({n})",reopenCount:"Mark as open ({n})",batchDoneToast:"{n} marked as done",batchReopenedToast:"{n} moved back to open",batchFailedSuffix:", {n} failed",batchDoneFailedNotice:"Could not mark {n} as done",batchReopenFailedNotice:"Could not move {n} back to open",undo:"Undo",open:"Open session",rename:"Rename…",fork:"Fork",export:"Export",moreActions:"More actions"},Bne={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}"?',swarmEnableTitle:"Enable swarm mode?",swarmEnableConfirm:"The agent will run multiple sub-agents in parallel.",goalStartTitle:"Start goal?",goalStartConfirm:'"{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.",requiredTitle:"Choose a workspace first",requiredMessage:"Pick a folder to use as your workspace before sending a message.",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",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:"Failed",abortedTitle:"This session's latest turn ended on an error"},zne={jumpToLatestAria:"Jump to latest message",backToBottom:"Back to bottom",toc:"Conversation outline",newMessages:"Latest messages",loading:"Loading…",starting:"Starting conversation…",requesting:"Requesting…",working:"Working…",workingRetry:"Model request failed — retrying ({n}/{max})…",emptyWorkspaceHint:"Send in {name}",switchWorkspace:"Switch workspace",recentSessions:"Recent sessions",viewMoreSessions:"View more",sessionAdminTooltip:"View and manage more sessions in Session Management",addWorkspace:"New workspace",moreWorkspaces:"More workspaces ({count})",pickFolder:"Choose folder…",compacting:"Compacting context…",compactedPlain:"Context compacted",compactedAuto:"Context auto-compacted",compactedTokens:" ({before} → {after} tokens)",viewSummary:"View summary",undo:"Undo",undoTooltip:"Undo edit",undoConfirm:"Undo back to this message?",escUndoHintPre:"Press",escUndoHintPost:"again to undo",undone:"Undone — the message is back in the composer",turnInterrupted:"Manually stopped",turnFailed:"Model request failed — this turn was interrupted",turnFailedMaxSteps:"Step limit reached — this turn was interrupted",turnFailedResume:"Continue",turnFailedResumeText:"Continue",yesterday:"Yesterday",loadOlder:"Load earlier messages",loadingOlder:"Loading earlier messages…",widenTable:"Widen table",restoreTableWidth:"Restore default width",wrapCode:"Enable word wrap",unwrapCode:"Disable word wrap",showLineNumbers:"Show line numbers",hideLineNumbers:"Hide line numbers",cron:{fired:"Scheduled reminder fired",missed:"Missed scheduled reminders",job:"job {id}",oneShot:"one-shot",coalesced:"{n} fires coalesced",missedCount:"{n} missed",finalDelivery:"final delivery",expand:"Show more",collapse:"Show less"},fold:{worked:"Worked {duration}",workedUnknown:"Work details"},turnFiles:{titleOne:"{number} file changed",titleOther:"{number} files changed",more:"{number} more files",moreOne:"1 more file",showLess:"Show less",diffUnavailable:"This file’s changes can’t be shown line by line",openFile:"Open file"},goal:{continuation:"Goal continuation"},notification:{sentBy:{task:"From background (Bash)",subagent:"From background (Agent)"},bodyLine:"{status}: {description}",reason:"Reason: {reason}",userStopped:"Stopped by user",statusTitle:{completed:"Completed",failed:"Failed",timed_out:"Timed out",killed:"Stopped",lost:"Lost",info:"Notification"},status:{completed:"completed",failed:"failed",timed_out:"timed out",killed:"killed",lost:"lost",info:"info"},groupTitle:"{n} notifications",copyPath:"Copy path",copied:"Copied",rawPayload:"Raw payload",outputTruncated:"Output truncated — showing the tail",fields:{type:"Type",source:"Source",severity:"Severity"}},userMessage:{expand:"Show more",collapse:"Show less"},search:{placeholder:"Search chat…",searching:"Searching…",results:"{current}/{total} results",resultsCapped:"{current}/{total}+ results",noResults:"No results",previous:"Previous match",next:"Next match",close:"Close search"}},jne={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)",workModeDismiss:"Exit mode",goalLabel:"Goal",timeUnitHour:"h",timeUnitMinute:"m",timeUnitSecond:"s",planEmptyArmed:"Plan mode is on — the plan the agent writes will show up here.",planEmptyIdle:"No plan yet — turn plan mode on and the agent’s plan will show up here.",swarmLabel:"Swarm",swarmDismiss:"Turn off Swarm",modeOff:"Off",goalPlaceholder:"What should the agent achieve?",planPlaceholder:"What should the agent plan for?",goalStart:"Start",goalPause:"Pause",goalResume:"Resume",goalCancel:"Cancel",goalCancelConfirm:"Cancel this goal? It cannot be resumed afterwards.",goalCancelConfirmYes:"Yes",goalCancelConfirmNo:"No",goalDoneWhen:"Done when",goalStatusActive:"Active",goalStatusPaused:"Paused",goalStatusBlocked:"Blocked",goalStatusComplete:"Complete",modeNotSupported:"Not supported",thinkingLabel:"Thinking",thinkingTooltip:"Toggle thinking mode",cacheNote:"Note: Switching models or thinking effort invalidates the existing prompt cache. Start a new chat to avoid extra token costs.",starredModels:"Starred",moreModels:"More models…",statusPanelTitle:"Session status",statusPanelClose:"Close",statusModel:"Model",statusThinking:"Thinking",statusPermission:"Permission",statusPlanMode:"Plan mode",statusSwarmMode:"Swarm mode",swarmOn:"on",swarmOff:"off",statusContext:"Context",statusCost:"Cost",statusContextValue:"{used} / {max} ({pct}%)",statusNone:"—",activityRunning:"Running…",activityAwaitingApproval:"Awaiting approval",activityAwaitingQuestion:"Awaiting answer",interrupt:"Interrupt",runningShort:"in progress"},Hne={inputLabel:"Message input",placeholder:"Type a message…",send:"Send ↵",queueLabel:"Queue",placeholderRunning:"Press Enter to queue · Ctrl+S to inject into the running turn",placeholderRunningMobile:"Press Enter to queue",starting:"Sending…",queuePending:"{n} waiting to send",queueSteer:"Send into the running turn",queueDragTitle:"Drag to reorder",editQueued:"Edit (load back into the input)",queuedAttachments:"attachment ×{n}",queuedHasImage:"Contains {n} image(s) — remove only, not editable",attachmentImage:"Image",attachmentVideo:"Video",attachmentOpenUnsupported:"Can’t open {name} — this file type isn’t supported",dropToAttach:"Drop files to attach",remove:"Remove",uploading:"Uploading",uploadFailed:"Upload failed",attachFile:"Attach file",addMenu:"Add",addFiles:"Files",addFilesDesc:"Upload files",addGoalDesc:"Set a goal to keep pursuing",addPlanDesc:"Turn plan mode on",addSwarmDesc:"Turn swarm mode on",noCommands:"No commands",slashSheetTitle:"Commands",slashSearchPlaceholder:"Search commands…",mentionSheetTitle:"Files",mentionSearchPlaceholder:"Search files…",addSlash:"Commands",addSlashDesc:"Built-in commands or skills",addMention:"Mention",addMentionDesc:"Mention files in the project",interrupt:"Interrupt",interruptTitle:"Interrupt current operation",expandTitle:"Expand input for multi-line editing",collapseTitle:"Collapse input",emptyConversationTitle:"Kimi Code",emptyConversation:"No messages yet — type below to start the conversation",upgradeBanner:"Upgrade your Kimi account to use Kimi Code",quickStartPlaceholder:"Type a message to start a new conversation…",thinkingSuffix:" · thinking",thinkingSuffixEffort:" · {level}",noArgCommand:"{cmd} takes no arguments"},Wne={title:"Sign in to Kimi Code",close:"Close (Esc)",regionCnTitle:"Kimi Code",regionCnHint:"Sign in with your kimi.com account",regionOverseasTitle:"Kimi Code",regionOverseasHint:"Sign in with your kimi.ai account",oauthTitle:"Sign in with Kimi",oauthHint:"Finish authorizing in your browser to sign in",starting:"Starting sign-in flow…",openedHint:"Finish authorizing in your browser ({time}).",blockedTitle:"Could not open the login page",blockedHint:"The browser blocked the automatic opening — use the button below to continue authorizing.",notOpened:"Didn't open in your browser?",authorizeInBrowser:"Sign in via browser",orDivider:"or",fallbackPrefix:"On another device? Open ",fallbackSuffix:" and enter the device code:",copy:"Copy",copied:"Copied",copyLink:"Copy link",success:"Signed in",successHint:"Loading, will close automatically…",expiredTitle:"Device code expired",expiredHint:"Please restart the sign-in flow",deniedTitle:"Sign-in cancelled",retry:"Retry",closeBtn:"Close",failedTitle:"Login failed",errorHint:"Please upgrade kimi-code and try again",pollErrorTitle:"Lost connection",pollErrorHint:"Sign-in polling failed repeatedly. Check the kimi-code process and try again.",action:"Sign in",requiredTitle:"Sign in required",requiredMessage:"Sign in to your Kimi account and set up a model to start chatting.",goToLogin:"Sign in",upgradeRequiredTitle:"Upgrade required",upgradeRequiredMessage:"Your account is on the free plan. Upgrade to a membership to start chatting with Kimi models.",pickModelTitle:"Choose a model",pickModelMessage:"Models are available. Pick a default model to start chatting.",pickModelAction:"Choose",configureModelsTitle:"Set up a model",configureModelsMessage:"You're signed in, but no model is available yet. Set up a model to start chatting.",configureModelsGenericMessage:"No model is available yet. Set up a model to start chatting.",configureModelsAction:"Set up",rcSubtitle:"Remote Control session",rcChecking:"Checking sign-in status…",rcLead:"This Remote Control session requires authorization. Sign in with your Kimi account to continue.",rcSuccessHint:"Redirecting…",rcExpiredTitle:"Authorization expired or declined",rcDeniedTitle:"Authorization cancelled",rcStartErrorTitle:"Could not start sign-in",rcSessionErrorTitle:"Could not create your session",rcConnectionErrorHint:"Check your connection and try again.",rcSuccessNoRedirect:"You can close this page now."},qne={title:"Provider management",loading:"Loading providers…",unavailable:"Provider management is not available yet",empty:"No providers yet",status:{connected:"Connected",error:"Error",unconfigured:"Not configured"},keySet:"key set",keyNotSet:"key not set",managedBadge:"OAuth",modelCount:"{count} models",confirmDelete:"Confirm delete?",refresh:"Refresh",delete:"Delete",refreshTitle:"Refresh {type}",deleteTitle:"Delete {type}",loginKimi:"Sign in to Kimi",loginAnthropic:"Sign in to Anthropic",addProvider:"Add provider",added:"Provider added",enterApiKey:"Enter API Key",optional:"Optional",apiKeyRequired:"API Key cannot be empty",fieldId:"Name",fieldType:"API Protocol",types:{kimi:"Kimi",openai:"OpenAI",openai_responses:"OpenAI Responses",anthropic:"Anthropic","google-genai":"Google GenAI",vertexai:"Vertex AI"},fieldApiKey:"API Key",apiKeyManaged:"Signed in with OAuth",apiKeySet:"Set — enter a new key to replace",showApiKey:"Show API key",hideApiKey:"Hide API key",fieldBaseUrl:"Base URL",baseUrlPlaceholder:"https://api.example.com/v1",fieldModels:"Models",colModelId:"Model ID",colContext:"Context",colDisplayName:"Display name",modelIdPlaceholder:"kimi-k3",modelContextPlaceholder:"1048576",modelNamePlaceholder:"Optional",noModels:"No models",addModel:"Add model",removeModel:"Remove model",fieldDefaultModel:"Default model",save:"Save",saved:"Provider saved",deleteProvider:"Delete provider",deleteConfirm:"Delete {id} and its {count} models?",deleteConfirmYes:"Delete",managedHint:"Managed providers sign in and out on the Account tab",unsavedGuard:"You have unsaved changes.",guardStay:"Keep editing",guardDiscard:"Discard",add:"Add",catalog:{sourceCatalog:"From directory",sourceManual:"Manual",sourceRegistry:"Registry",registryHint:"Import providers and models from an api.json registry; re-importing the same URL refreshes it",registryUrlLabel:"Registry URL",registryImported:"{count} providers imported",searchPlaceholder:"Search providers",loading:"Loading directory…",loadError:"Failed to load the directory. Check your network and retry.",retry:"Retry",empty:"No matching providers",rejected:"Not importable",rejectReason:{"unknown-explicit-type":"Unsupported protocol","proprietary-sdk":"Proprietary SDK — cannot be imported","empty-base-url":"Blank base URL","placeholder-base-url":"Endpoint contains an env placeholder"},backToList:"Back to directory",willImport:"{count} models will be imported from the directory",overwriteWarning:"A provider with this name already exists; importing overwrites its config and models",importAction:"Import"},error:{idRequired:"Name cannot be empty",idInvalid:'Name must start with a letter or digit and may only contain letters, digits, "-", "_" and spaces',apiKeyRequired:"API Key cannot be empty",baseUrlRequired:"Base URL cannot be empty",registryUrlRequired:"Registry URL cannot be empty",modelRequired:"Model ID cannot be empty",contextSizeRequired:"Max context size cannot be empty",contextSizeInvalid:"Max context size must be a positive integer"},hintClose:"Close"},Une={dialogLabel:"Switch model",title:"Switch model",close:"Close (Esc)",allTab:"All",providerTabs:"Model providers",searchPlaceholder:"Search models or providers…",clearSearch:"Clear search",loading:"Loading models…",unavailable:"Model list is unavailable",contextSuffix:"{size} ctx",capabilityImageInput:"Image input",capabilityVideoInput:"Video input",capabilityToolUse:"Tool use",capabilityThinking:"Thinking",capabilityAlwaysThinking:"Always thinking",emptyNoModels:"No models available",emptyNoMatch:"No matching models",starTitle:"Add to favorites",unstarTitle:"Remove from favorites",hintNavigate:"Navigate",hintSelect:"Select",hintClose:"Close"},Vne={justNow:"just now"},Kne={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}",danger:"Danger: {detail}",searchQueryLabel:"query",searchScope:"scope: {scope}",feedbackPlaceholder:"Explain why you are rejecting… (Enter to submit, Shift+Enter for a new line, Esc to cancel)",feedbackHint:"Enter to submit · Shift+Enter for a new line · Esc to cancel",approve:"Approve",approveSession:"Approve for session",reject:"Reject",feedback:"Feedback",feedbackSubmit:"Reject with feedback",feedbackCancel:"Cancel",approvePlan:"Approve plan",revise:"Revise",rejectAndExit:"Reject and Exit",expandPlan:"Expand",collapsePlan:"Collapse"},Zne={back:"‹ Previous question",nextQuestion:"Next question ›",otherDefault:"Other…",submit:"Submit",dismiss:"Dismiss",minimize:"Minimize",expand:"Expand",hint:"↑↓ to choose · Enter to confirm"},Gne={tag:"tasks",summary:"{run} running · {done} done",copy:"Copy",calling:"Calling {label}",fieldTask:"Task",fieldOutput:"Output",fieldProgress:"Progress",fieldResult:"Result",moreLines:"… ({count} more)",copied:"Copied",stop:"stop",defaultDescription:"Background task",dockTasks:"Background tasks",dockBash:"Bash",dockSubagent:"Background Agent",dockTodos:"Todos",todoProgressTitle:"Progress",stateDone:"Done",stateFail:"Failed",stateCancelled:"Cancelled",filterRecent:"Recent",filterRunning:"Running",filterDone:"Done",filterAll:"All",running:"running",closePanel:"Close panel",openPanel:"Open in the side panel",timingRunning:"Running · {time}",timingDone:"Done · {time}",emptyTasks:"No background tasks running",emptyRecent:"No recent tasks",emptyRunning:"No running tasks",emptyDone:"No completed tasks",emptyBash:"No bash tasks running",emptySubagent:"No background agent tasks running",emptyTodo:"No todos yet",openTab:"Open the tasks tab",openDetail:"Open",toBackground:"To background",collapse:"Collapse",expand:"Expand",transcriptLoadError:"Failed to load this sub agent’s conversation.",copyCommand:"Copy command",copyOutput:"Copy output",copyAll:"Copy all"},Qne={panelTitle:"Thinking",streaming:"Thinking…"},Yne={aheadTitle:"ahead of remote",behindTitle:"behind remote",fileCountOne:"{number} file",fileCountOther:"{number} files",empty:"No git changes",clean:"Working tree clean, no changes",back:"Back",loading:"Loading diff…",noDiff:"No line changes for this file",emptyFile:"Empty file",list:"List",tree:"Tree"},Jne={},Xne={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",moreActions:"More actions",refresh:"Refresh",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:"Can't preview this file ({mime} · {size}). Open with another app",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",notFound:"File no longer exists or was moved",tooLarge:"File is too large to preview",loadFailed:"Unable to read this file"}},eie={searching:"Searching…",noMatch:"No matches",files:"Files",skills:"Skills",openSkill:"Open skill file",copyPath:"Copy path",attachmentUploadFailed:"Upload failed — remove the attachment, or drop the file in again to retry",attachmentUploadInterrupted:"Upload interrupted — remove the attachment, or drop the file in again to retry",viewFullscreen:"View fullscreen",mediaPreviewLoading:"Loading preview…",mediaPreviewUploading:"Uploading — preview when ready",mediaPreviewUnavailable:"Preview unavailable",stateUploading:"Uploading",stateUploaded:"Uploaded",stateUploadFailed:"Upload failed"},tie={dismiss:"Close",errorLabel:"Error",noteLabel:"Note",agentWarningFallback:"agent warning",unhandledEvent:"Unhandled event: {type}",agentError:{title:"Model request failed",connection:"Cannot connect to the model service",auth:"Model authentication failed",rateLimit:"Model rate limit reached",overloaded:"Model overloaded",filtered:"Response filtered by the provider",api:"Model API error",contextOverflow:"Context size exceeded"},details:{cause:"Cause",code:"Error code",connection:"Connection",contentType:"Content type",details:"Server details",duration:"Duration",endpoint:"Endpoint",errorName:"Error type",message:"Message",operation:"Operation",phase:"Failure phase",request:"Request",requestId:"Request ID",responsePreview:"Response preview",sessionId:"Session ID",stack:"Stack",status:"HTTP status",timeout:"Timeout",timestamp:"Time"},daemonApiTitle:"Kimi server returned an error",daemonNetworkMessage:"Web did not receive a response from the Kimi server. Check that it is still running, or refresh the page.",daemonNetworkTitle:"Cannot connect to Kimi server",daemonTimeoutMessage:"The Kimi server did not respond within the wait limit. The operation may still complete in the background — refresh later to check, or try again.",daemonTimeoutTitle:"Kimi server response timed out",diagnostics:"Diagnostics",hideDetails:"Hide details",operationFailedMessage:"The last operation did not finish. Try again later.",operationFailedTitle:"Operation failed",sendFailedTitle:"Send failed",sendFailedNoDefaultModelMessage:"No default model is configured. Choose a model again in Settings",sessionSnapshotMessage:"Web could not load the current conversation. Check that the Kimi server 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."}},nie={new:{desc:"Create a new session"},clear:{desc:"Clear and start a new session"},login:{desc:"Sign in to Kimi in the browser"},plan:{desc:"Toggle plan mode on/off"},swarm:{desc:"Toggle swarm mode; /swarm runs a task in swarm"},goal:{desc:"Create/control a goal: /goal , /goal pause{'|'}resume{'|'}cancel"},btw:{desc:"Side chat: /btw asks a forked side session"},compact:{desc:"Compact the conversation history"},fork:{desc:"Fork this session into a new one"},export:{desc:"Download this session and troubleshooting logs as a ZIP",noSession:"Open a session before exporting it.",started:"Exporting session…",done:"Session exported.",tooLarge:"Session data exceeds the export size limit. Export it from a terminal instead: kimi export {sessionId} -o session.zip"},status:{desc:"View session status"},undo:{desc:"Undo the last message"}},iie={label:{read:"Read",bash:"Run",edit:"Edit",write:"Write",grep:"Search",glob:"Find",ls:"List",web_fetch:"Fetch",search:"Search",todo:"Todo",task:"Task",swarm:"Swarm",ask_user:"Question",plan:"Plan",goal_create:"Start Goal",goal_get:"Read Goal",goal_budget:"Set Goal Budget",goal_update:"Update Goal",waitfor:"Wait"},waitfor:{waitingAny:"Waiting for any background task",waitingTask:"Waiting for {id}",noTasks:"No background tasks running",timedOut:"Timed out",stillRunning:"{count} still running",moreFinished:"+{count} finished during wait",moreRunning:"+{count} more"},swarm:{progress:"{done} / {total}",runningSub:"{count} in progress",doneSub:"{completed} completed · {failed} failed",doneSubWithCancelled:"{completed} completed · {failed} failed · {cancelled} cancelled",phaseQueued:"Queued",phaseWorking:"Working",phaseSuspended:"Suspended",phaseCompleted:"Completed",phaseFailed:"Failed",phaseCancelled:"Cancelled",waiting:"Waiting for subagents…"},chip:{lines:"{count} lines",results:"{count} results",files:"{count} files",edited:"edited",created:"created",todos:"{count} items"},disclosure:{expand:"Expand details",collapse:"Collapse details"},agent:{foreground:"Foreground",background:"Background",status:{running:"Running",ok:"Completed",error:"Failed",cancelled:"Cancelled"}},output:{waiting:"Waiting for output…",empty:"No output",saved:"Saved result"},plan:{review:{pending:"Pending review",approved:"Approved",rejected:"Rejected",cancelled:"Cancelled"},selectedOption:"Selected",pathOnlyHint:"No inline content — open it in the side panel:",feedback:"Feedback"},summary:{inScope:"{value} in {scope}"},goal:{objectiveWithCriterion:"{objective} · {criterion}",status:"Status: {status}",budget:"{value} {unit}",turns:"{value} turns",tokens:"{value} tokens",milliseconds:"{value} ms",seconds:"{value} sec",minutes:"{value} min",hours:"{value} hr"},group:{countOther:"{count} tool call | {count} tool calls",typed:{read:{done:"Read {count} file | Read {count} files"},bash:{done:"Ran {count} command | Ran {count} commands"},grep:{done:"Searched {count} pattern | Searched {count} patterns"},search:{done:"Ran {count} web search | Ran {count} web searches"},glob:{done:"Matched {count} file pattern | Matched {count} file patterns"},ls:{done:"Listed {count} directory | Listed {count} directories"},web_fetch:{done:"Fetched {count} page | Fetched {count} pages"},edit:{done:"Made {count} edit | Made {count} edits"},write:{done:"Wrote {count} file | Wrote {count} files"}}},activity:{failedClause:" ({count} failed)",liveDonePrefix:"",busy:"Working…",doing:{read:"Reading {subject}",bash:"Running {subject}",grep:"Searching {subject}",search:"Searching {subject}",glob:"Matching {subject}",ls:"Listing {subject}",web_fetch:"Fetching {subject}",edit:"Editing {subject}",write:"Writing {subject}"}},ask:{dismissed:"Dismissed",answer:"{count} answer",answers:"{count} answers",answered:"Answered",more:"(+{count} more)",collected:"Collected your answers",question:"{count} question",questions:"{count} questions",freeInput:"(free text)",unanswered:"No answer"}},oie={resizeHandleAria:"Resize sidebar width",resizePreviewAria:"Resize preview panel width",detailPanelAria:"Detail panel"},sie={openSwitcher:"Switch session / workspace",openSettings:"Session settings",settingsTitle:"Settings",groupSession:"Current session",groupApp:"App preferences",groupAccount:"Account",sheetLabel:"Sheet",closeSheet:"Close",tapToCycle:"tap to cycle",running:"running",idle:"idle",sessionCount:"{n} sessions",newSession:"New session",permManualSub:"confirm every tool",permAutoSub:"fully autonomous, never asks",permYoloSub:"auto-approve tools, may still ask",planModeSub:"Plan mode",goalModeSub:"Goal mode",swarmModeSub:"Swarm mode",archivedSessions:"Archived sessions",archivedSessionsSub:"Browse and restore archived sessions",archivedBack:"Back",viewFlat:"Flat",viewGrouped:"By workspace"},rie={colorSchemeLabel:"Appearance",light:"Moon bright",dark:"Moon dark",system:"System"},lie={continue:"Continue",back:"Back",skip:"Skip",welcome:{title:"Welcome to Kimi Code",subtitle:"The AI coding workbench for professional developers",languageLabel:"Language",themeLabel:"Appearance"},login:{title:"Configure Model",subtitle:"Choose the model service that powers Kimi Code. You can change it later in Settings",kimiTitle:"Sign in with Kimi",kimiHint:"Ready out of the box with Kimi membership benefits",kimiCnTitle:"Kimi Code",kimiCnHint:"Sign in with your kimi.com account",kimiOverseasTitle:"Kimi Code",kimiOverseasHint:"Sign in with your kimi.ai account",customProviderTitle:"Add a custom provider",customProviderHint:"Bring your own API key for OpenAI-compatible and other services",loggedInTitle:"Logged in with Kimi",loggedInHint:"Your model service is ready to use",finish:"Finish",skip:"Skip for now"}},aie={title:"Settings",internalTest:"Internal Test",close:"Close (Esc)",tabs:{general:"General",agent:"Agent",account:"Account",providers:"Providers",advanced:"Advanced",archived:"Archived",shortcuts:"Hotkeys",plugins:"Plugins",lab:"Lab"},lab:{sidebarTabs:"Multi-tab sidebar",sidebarTabsHint:"The sidebar shows Open / Done / Workspaces tabs"},plugins:{retry:"Retry",builtIn:"Built-in",official:"Official",thirdParty:"Third-party",installed:"Installed",install:"Install",update:"Update",remove:"Remove",enabled:"Enabled",homepage:"Homepage",empty:"No plugins found",hasErrors:"Error",customInstall:"Install custom plugin",customInstallPlaceholder:"https://… or /path/to/plugin",customInstallHint:"Accepts an https zip URL, a GitHub repo URL, or a local directory path.",extensionHintTitle:"One step left: install the browser extension",extensionGuide:"Manual install",dismissHint:"Dismiss",catalogUnavailable:"The marketplace catalog is currently unreachable; installed plugins remain manageable below.",source:{"local-path":"Local","zip-url":"ZIP",github:"GitHub"},counts:{skill:"1 skill | {n} skills",mcp:"1 MCP server | {n} MCP servers",mcpEnabled:"{n} on",hook:"1 hook | {n} hooks",command:"1 command | {n} commands"}},appearance:"Appearance",notifications:"Notifications",notifyEnabled:"System notifications",notifyEnabledHint:"Send a system notification when a turn completes, needs an answer, or needs approval",notifySound:"Notification sound",notifySoundHint:"Play the system sound with notifications",notifyDenied:"Blocked in browser settings",notifyTitle:"Kimi Code · Turn finished",notifyQuestionTitle:"Kimi Code · Needs answer",notifyApprovalTitle:"Kimi Code · Approval required",notifyFallback:"View result",notifyQuestionFallback:"A question is waiting for your answer",notifyApprovalFallback:"A tool needs your approval",account:"Account",signedIn:"Signed in",signedOutHint:"Sign in to view your account and model access",planUsage:{title:"Plan Usage",retry:"Retry",loadFailed:"Failed to load",empty:"No usage data yet",weekLimit:"Weekly limit",genericLimit:"Limit",hourLimit:"{n}h limit",dayLimit:"{n}d limit",minuteLimit:"{n}m limit",resetsIn:"resets in {duration}",resetDone:"reset",durationDay:"{n}d",durationHour:"{n}h",durationMinute:"{n}m",durationSecond:"{n}s",usedPct:"{pct}% used",boosterTitle:"Booster",boosterBalance:"Balance",monthlyUsed:"Used this month",monthlyLimit:"Monthly limit",unlimited:"Unlimited",freeTitle:"Free account",freeHint:"Upgrade to a membership to use Kimi models and see plan usage"},colorSchemeHint:"Choose the app’s light or dark appearance",appIcon:"Dock icon",appIconHint:"Choose the icon shown in the Dock",appIconDefault:"Default",appIconBlack:"Black",uiFontSize:"Font size",uiFontSizeHint:"Adjust interface and message text size",vibrancy:"Frosted sidebar",vibrancyHint:"Use the native macOS frosted-glass material behind the sidebar — turn it off if the translucency is hard to read",languageHint:"Choose the interface language",defaultOpenInApp:"Default open-in app",defaultOpenInAppHint:"App used when opening files and folders from the header menu",openWith:"Open with",agentDefaults:"Agent defaults",saving:"Saving",defaultModel:"Default model",defaultModelHint:"New sessions prefer this model",noDefaultModel:"No default model",defaultPermission:"Default permission",defaultPermissionHint:"Only affects newly-created sessions",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",secondaryModelSection:"Subagents",secondaryModel:"Subagent model",secondaryModelHint:"Model and thinking effort that subagents use by default",secondaryModelEffort:"Thinking effort",noSecondaryModel:"Not set (inherit primary)",secondaryModelEffortAuto:"Model default",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.",versionAndUpdates:"Version & updates",appVersion:"App version",appVersionHint:"The running app’s version and build time",checkUpdate:"Check for updates",checkUpdateHint:"Manually check whether a new version is available",checkUpdateBtn:"Check now",updateChecking:"Checking…",updateCheckLatest:"You’re on the latest version",updateCheckAvailable:"Version {version} is available — download it from the update entry in the sidebar",updateCheckUnsupported:"This build does not support update checks",updateCheckFailed:"Check failed. Please try again later.",updateCheckAvailableAuto:"Version {version} found — downloading in the background",updateCheckDownloaded:"Version {version} is ready — restart from the update entry in the sidebar",autoDownloadUpdate:"Auto-download updates",autoDownloadUpdateHint:"Download new versions in the background and install them on the next restart",canaryUpdate:"Update Canary",canaryGhMissing:"GitHub CLI not found — install it first (brew install gh) and sign in",canaryGhUnauthenticated:"GitHub CLI is not signed in — run gh auth login in a terminal first",canaryTrigger:"Repackage Canary",canaryTriggerHint:"Trigger the macOS arm64 build pipeline to produce a new canary build",canaryTriggerBtn:"Repackage Canary",canaryTriggerConfirm:"Click again to confirm",canaryTriggerDone:"Triggered — the build takes about 20–30 minutes",canaryTriggerFailed:"Failed to trigger: {error}",canaryViewWorkflow:"View workflow",canaryImportStable:"Import UI Settings from Stable…",canaryImportStableTitle:"Import UI Settings from Stable",canaryImportStableHint:"Copies the stable app’s UI settings (pinned sessions, appearance, and other localStorage preferences) into Canary, replacing the current ones (the existing copy is backed up as leveldb.bak). Canary restarts to finish the import; the stable app must stay quit.",canaryImportStableBtn:"Import & Restart",canaryImportStableRunning:"The stable app (Kimi Code) is running — quit it first, then import again.",canaryImportStableNoData:"No UI settings data from the stable app was found.",canaryImportStableFailed:"Import failed: {error}",privacy:"Data & privacy",diagnostics:"Diagnostics",messageFolding:"Message folding",turnFolding:"Auto-fold messages",turnFoldingHint:"When a turn ends, the work folds away automatically, leaving only the summary",activityRunFolding:"Tool call summary",activityRunFoldingHint:"During the answer, consecutive tool calls are summarized into one row",build:"Build",serverVersion:"Server version",serverAddress:"Server address",serverAddressHint:"The address of the connected server",serverVersionHint:"The version of the connected service",copyServerVersion:"Copy server version",copyServerAddress:"Copy server address",copied:"Copied",exportLog:"Troubleshooting log",exportLogHint:"Export the troubleshooting log collected by the app",logHint:"Enable with ?debug=1 to capture",exportLogBtn:"Export log",archivedTitle:"Archived sessions",archivedDesc:"Browse archived sessions, see their workspace path, name, and archive time, and restore them to the session list.",archivedSearch:"Search archived sessions",archivedAllWorkspaces:"All workspaces",archivedSortLabel:"Sort by",archivedSortArchived:"Archive time",archivedSortCreated:"Created time",archivedSortName:"Name",archivedRestore:"Restore",archivedEmpty:"No archived sessions yet",archivedNoMatch:"No matching archived sessions",archivedSessionsCount:"{count} sessions",archivedAt:"Archived {time}",archivedLoadMore:"Load more",archivedLoading:"Loading…",archivedLoadingAll:"Loading all archived sessions…"},uie={openInEditor:"Open in editor",openInEditorShort:"Open",openInApp:"Open in {app}",chooseOpenApp:"Choose application",copyAll:"Copy all as Markdown",copyFinalSummary:"Copy final summary",copied:"Copied",lastUsed:"Last used",copyPath:"Copy path",changed:"{n} changed",gitTooltip:"Open Files > Changed",detached:"detached",openPr:"Open pull request",prStatusOpen:"open",prStatusClosed:"closed",prStatusMerged:"merged",prStatusDraft:"draft",prStatusUnknown:"unknown",options:"Options",copySessionId:"Copy session ID",pinSession:"Pin",unpinSession:"Unpin",renameSession:"Rename",forkSession:"Fork session",archiveSession:"Archive",markSessionDone:"Mark as done",sessionDone:"Done",reopenSession:"Mark as open",exportSession:"Export session",devBadge:"Running in development mode"},cie={title:"Side chat",empty:"Ask a quick question on the side — it shares this session’s context.",placeholder:"Ask the side chat…",send:"Send"},die={comment:"Comment",addToChat:"Add to chat",commentPlaceholder:"Write a comment…",confirm:"Add",copyQuote:"Copy quote",copyComment:"Copy comment",quoteLabel:"Quote"},fie={actions:{summonApp:{label:"Show App Window",desc:"Bring the app window to the foreground from anywhere"},newSession:{label:"New Session",desc:"Start a new session in the current workspace"},searchSessions:{label:"Search Chats",desc:"Open the session search dialog"},archiveSession:{label:"Complete Chat",desc:"Mark the current chat as done right away (find it under Done)"},toggleSideChat:{label:"Toggle Side Chat",desc:"Open or close the /btw side chat"},toggleSidebar:{label:"Toggle Sidebar",desc:"Collapse or expand the session sidebar"},openFolder:{label:"Open Folder",desc:"Add a workspace folder with the native picker"},openInDefaultApp:{label:"Open in App",desc:"Open the workspace in your default editor/terminal"},openSettings:{label:"Open Settings",desc:"Show or hide the settings dialog"},toggleTerminal:{label:"Toggle Terminal",desc:"Show or hide the bottom terminal panel"},openDiffTab:{label:"Open Changes",desc:"Open or activate the workspace changes tab"},sidebarTabOpen:{label:"Open Tab",desc:"Switch to the Open list in the sidebar"},sidebarTabDone:{label:"Done Tab",desc:"Switch to the Done list in the sidebar"},sidebarTabWorkspaces:{label:"Workspaces Tab",desc:"Switch to the workspace directory in the sidebar"},selectPrevSibling:{label:"Previous Item",desc:"Select the previous chat / workspace in the current tab"},selectNextSibling:{label:"Next Item",desc:"Select the next chat / workspace in the current tab"},send:{label:"Send Message",desc:"Send the composer input"},newline:{label:"Newline",desc:"Insert a newline in the composer"}},searchPlaceholder:"Search shortcuts",unassigned:"Unassigned",unassign:"Unassign shortcut",edit:"Edit shortcut",reset:"Reset to default",resetAll:"Reset all to defaults",recording:"Press the new shortcut…",invalid:"This key combination can’t be used as a shortcut",notGlobal:"This key combination can’t be registered as a system-wide shortcut",globalTaken:"This shortcut is already taken by the system or another app",reserved:"Reserved by the system menu",reservedSteer:"Reserved for steer (Ctrl/Cmd+S)",reservedFind:"Reserved for transcript find (Ctrl/Cmd+F)",conflict:"Already used by “{action}”",customBadge:"Custom"},hie={panelAria:"Terminal",toolbarAria:"Terminal tabs",resizeAria:"Resize terminal panel height",toggle:"Toggle terminal",open:"Open terminal",close:"Close terminal",newTab:"New terminal",closeTab:"Close terminal",restartTab:"Restart terminal",collapse:"Collapse terminal panel",empty:"No terminal yet — click to start one",processExited:"[process exited]",processExitedWithCode:"[process exited with code {code}]"},pie={tabs:{diff:"Changes",file:"File",turnDiff:"Turn diff",compaction:"Compaction summary",agent:"Subagent",term:"Terminal"},newTab:"New tab",closeTab:"Close tab",expand:"Expand panel",collapse:"Restore panel",hide:"Close right panel",openPanel:"Open right panel",launcherAria:"Quick open"},mie={title:"PR Preview",intro:"Build a pull request or branch of this repo in an isolated worktree and open its UI in a separate window. The first build can take a few minutes.",prLabel:"Preview target",customRefPlaceholder:"PR number, branch, tag, or commit SHA",invalidRef:"Enter a valid branch name, tag, or commit SHA",start:"Start preview",cleanup:"Clean up preview cache",cleanupConfirm:"Delete all cached previews except the one currently being previewed? They will be rebuilt on demand next time.",cleanupDone:"Removed {count} cached preview(s)",fetching:"Fetching {pr}…",installing:"Installing dependencies…",building:"Building renderer…",activeText:"Previewing {pr}",stop:"Exit preview",rebuild:"Fetch & rebuild",errorTitle:"Preview failed",retry:"Retry",stageFetch:"fetch the code",stageInstall:"install dependencies",stageBuild:"build the renderer",stageFailed:"Failed to {stage}",stageHung:"Building the preview hung while trying to {stage} (no output for 5 minutes, killed — check the network/proxy)"},gie={title:"Server token required",hint:"This server is protected. Enter the bearer token printed when the server started (or the password set via {env}).",tokenPlaceholder:"Token",connect:"Connect",connecting:"Connecting…"},vie={common:Rne,app:One,sidebar:Pne,admin:$ne,workspace:Bne,conversation:zne,status:jne,composer:Hne,login:Wne,providers:qne,model:Une,sessions:Vne,approval:Kne,question:Zne,tasks:Gne,thinking:Qne,diff:Yne,fileTree:Jne,filePreview:Xne,mention:eie,warnings:tie,commands:nie,tools:iie,layout:oie,mobile:sie,theme:rie,onboarding:lie,settings:aie,header:uie,sideChat:cie,selection:die,shortcuts:fie,terminal:hie,panel:pie,prPreview:mie,serverAuth:gie},yie={confirm:"确认",cancel:"取消",close:"关闭",dismiss:"关闭",loading:"加载中",copy:"复制",errorBoundaryTitle:"出错了",errorBoundaryRetry:"重试",asyncLoadFailed:"加载失败,请关闭后重试"},kie={connecting:"连接中…",connectingStageAuth:"正在检查登录状态…",connectingStageServer:"正在连接服务器…",connectingStageConfig:"正在加载配置…",connectingStageSessions:"正在加载会话列表…",connectingStageSession:"正在打开会话…",connectingRetrySuffix:"(第 {n} 次重试)",connectingIssueNetworkTitle:"无法连接到 Kimi 服务器",connectingIssueNetworkMessage:"请检查网络连接,确认服务器仍在运行",connectingIssueTimeoutTitle:"Kimi 服务器响应超时",connectingIssueTimeoutMessage:"仍在自动重试,请稍候",connectingIssueApiTitle:"Kimi 服务器返回错误",connectingIssueUnknownTitle:"连接出现问题",internalBuildBanner:"仅供内部测试",menuFile:"文件",menuEdit:"编辑",menuView:"视图",menuHelp:"帮助",applicationMenu:"应用菜单"},bie={workspaceMeta:"工作空间 · {branch}",sessionsHeader:"会话",workspaces:"工作区",viewSwitcher:"列表管理",viewGroup:"视图",viewFlat:"平铺列表",viewGrouped:"按工作区分组",sortGroup:"排序",sortManual:"手动排序",sortRecent:"按最近活动",sessionAdmin:"会话管理",collapseAll:"折叠全部工作区",expandAll:"展开全部工作区",newSession:"新建会话",newChat:"新建会话",newWorkspace:"新建工作空间",dropToAddWorkspace:"松开鼠标添加工作区",emptyState:"还没有会话 · 点击 新建会话 开始",options:"选项",rename:"重命名",genTitle:"生成标题",genTitleUnavailable:"无法生成标题:需要登录 Kimi Code 托管账号,且会话中已有消息",setEmoji:"设置 Emoji…",sessionEmojiTitle:"选择 Emoji",removeEmoji:"移除 Emoji",randomEmoji:"随机",searchEmoji:"搜索 Emoji",recentEmojis:"最近使用",noEmojiResults:"没有匹配的 Emoji",emojiGroupFaces:"笑脸与人物",emojiGroupNature:"动物与自然",emojiGroupFood:"美食饮品",emojiGroupActivity:"活动与出行",emojiGroupObjects:"物品与工作",emojiGroupSymbols:"符号与状态",copyPath:"复制路径",copySessionId:"复制 Session ID",copied:"已复制 ✓",copyFailed:"复制失败",archive:"归档",archiveToastUndo:"撤销",archiveToastMid:"或到",archiveToastSettings:"设置",archiveToastTail:"查看已归档的会话",tabOpen:"进行中",tabDone:"已完成",tabWorkspaces:"工作空间",tagOpen:"进行中",tagDone:"已完成",complete:"完成",markDone:"标记为完成",reopen:"恢复进行中",noDoneSessions:"还没有已完成的会话",noOpenSessions:"还没有进行中的会话",completeToastLead:"已完成",reopenToastLead:"已恢复进行中",fork:"分叉会话",export:"导出会话",pin:"置顶",unpin:"取消置顶",lastActive:"最后更新:{time}",pinned:"置顶",collapsePinned:"折叠置顶区",expandPinned:"展开置顶区",resizePinnedAria:"调整置顶区高度",delete:"删除",removeWorkspace:"移除工作区",brand:"Kimi Code",signedIn:"已登录",signOut:"退出登录",notSignedIn:"未登录",signIn:"登录",defaultUserName:"Kimi 用户",upgrade:"升级",upgradeMembership:"会员升级",logoutConfirmTitle:"退出登录",logoutConfirmMessage:"确定要退出当前账号吗?",language:"语言",backendTitle:"后端 {backend} · {endpoint} — 点击切换",noSessions:"暂无对话",allPinned:"有 {count} 条对话被置顶",showMore:"展开更多",loadMore:"加载更多",showLess:"收起",loadingMore:"加载中…",collapseSidebar:"收起侧边栏",expandSidebar:"展开侧边栏",searchPlaceholder:"搜索会话或工作区",search:"搜索",searchHint:"↑↓ 选择 · ↵ 打开 · Esc 关闭",searchHintSelect:"选择",searchHintOpen:"打开",searchHintClose:"关闭",searchClear:"清除搜索",searchNoResults:"没有匹配的会话或工作区",searchEmpty:"暂无会话",update:"更新",updateAvailable:"发现新版本 v{version}",updateDownloadingButton:"下载中({percent}%)",updateReady:"v{version} 已就绪",updateDone:"重启并更新",updateFailed:"下载失败",updateRetry:"重试",updateDownloadNow:"下载并更新",updateSkip:"本次跳过",updateRestartNow:"立即重启",updateRestartLater:"下次启动",updateReleaseDate:"发布于 {date}",updateCurrentVersion:"当前版本 v{version}",updateWhatsNew:"更新内容",updateBackground:"后台下载",updateAutoDownload:"以后自动下载并安装更新",rcSelectDevice:"选择设备",rcCurrentDevice:"当前设备:{name}",rcConnectable:"可连接",rcUnavailable:"不可用",rcOnline:"在线",rcOffline:"离线",rcDevicesLoadFailed:"设备列表加载失败"},wie={title:"会话管理",subtitle:"管理所有会话,把任务完成的会话标记完成。旧会话按更新时间筛选,即可批量清理。",back:"返回",filterWorkspace:"工作空间",filterStatus:"状态",filterTime:"更新时间",allWorkspaces:"全部工作空间",selectAll:"全选",searchWorkspace:"搜索工作空间",noWorkspaceMatch:"没有匹配的工作空间",removeTag:"移除 {name}",statusAll:"全部状态",statusOpen:"进行中",statusDone:"已完成",timeAll:"全部时间",timeDaysAgo:"{n} 天以前",query:"查询",reset:"重置",colStatus:"状态",colTitle:"会话名",colWorkspace:"工作空间",colPrompt:"最后一条 prompt",colUpdated:"最后更新",colCompleted:"完成时间",colActions:"操作",empty:"没有符合当前筛选条件的会话",loading:"加载中…",total:"共 {n} 条",pageSize:"{n} 条/页",prevPage:"上一页",nextPage:"下一页",selectPageAll:"全选本页",batchSelected:"已选 {n} 项",selectAllMatching:"选中当前条件下的全部 {total} 项",materializingAll:"正在选中…",allMatchingSelected:"已选中全部 {n} 项",clearSelection:"清除选择",markDone:"标记完成",reopen:"恢复进行中",markDoneCount:"标记完成({n})",reopenCount:"恢复进行中({n})",batchDoneToast:"已标记完成 {n} 个会话",batchReopenedToast:"已将 {n} 个会话恢复为进行中",batchFailedSuffix:",{n} 个失败",batchDoneFailedNotice:"{n} 个会话未能标记完成",batchReopenFailedNotice:"{n} 个会话未能恢复为进行中",undo:"撤销",open:"打开会话",rename:"重命名…",fork:"分叉会话",export:"导出",moreActions:"更多操作"},Cie={switcherTitle:"切换工作区",switchTooltip:"切换工作区",eyebrow:"工作区",branchLabel:"分支: {branch}",noBranch:"无分支",sessionCount:"{count} 个会话",allWorkspaces:"全部工作区",currentWorkspace:"仅当前工作区",addWorkspace:"添加工作区…",noWorkspace:"暂无工作区",deleteHasSessions:"工作区内还有会话,请先归档这些会话再删除",removeWorkspaceConfirm:"移除工作区「{name}」?",swarmEnableTitle:"启用 swarm 模式?",swarmEnableConfirm:"Agent 将并行运行多个子 agent。",goalStartTitle:"启动 goal?",goalStartConfirm:"「{objective}」——Agent 将自主执行。",scopeCurrent:"当前工作区",scopeAll:"全部工作区",newInGroup:"在此工作区新建会话",addTitle:"添加工作区",pathLabel:"路径",pathPlaceholder:"/项目的绝对路径",recentLabel:"最近的文件夹",add:"添加",cancel:"取消",addHint:"粘贴一个绝对路径,或从最近用过的文件夹中选择。",addFailed:"无法打开此文件夹,请检查路径后重试。",requiredTitle:"请先选择工作空间",requiredMessage:"发送消息前,需要先选择一个文件夹作为工作区。",openThisFolder:"打开此文件夹",up:"上一级",browsing:"加载中…",filterPlaceholder:"过滤子文件夹…",searchPlaceholder:"在此目录下模糊搜索…",searching:"搜索中…",pasteToggle:"直接输入绝对路径",noFilterMatch:"没有匹配「{q}」的子文件夹",noSubfolders:"此处没有子文件夹",browseHint:'点击文件夹进入,再点"打开此文件夹"将其添加为工作区。',attentionTitle:"{count} 项待处理",awaitingAnswer:"待回答",awaitingAnswerTitle:"有提问等待你回答",awaitingPermission:"待授权",awaitingPermissionTitle:"有操作等待你授权",aborted:"失败",abortedTitle:"此会话的上一轮对话因错误中断"},Aie={jumpToLatestAria:"跳到最新消息",backToBottom:"回到底部",toc:"对话目录",newMessages:"最新消息",loading:"加载中…",starting:"正在创建对话…",requesting:"请求中…",working:"工作中…",workingRetry:"模型请求失败,正在重试(第 {n}/{max} 次)…",emptyWorkspaceHint:"在 {name} 中发送",switchWorkspace:"切换工作区",recentSessions:"最近会话",viewMoreSessions:"查看更多",sessionAdminTooltip:"在会话管理页面查看并管理更多会话",addWorkspace:"添加工作区",moreWorkspaces:"更多工作区 ({count})",pickFolder:"选择文件夹…",compacting:"正在压缩上下文…",compactedPlain:"上下文已压缩",compactedAuto:"已自动压缩上下文",compactedTokens:"({before} → {after} tokens)",viewSummary:"查看摘要",undo:"撤销",undoTooltip:"撤回编辑",undoConfirm:"撤回到这条消息?",escUndoHintPre:"再按",escUndoHintPost:"撤销本条",undone:"已撤销,原文已放回输入框",turnInterrupted:"已手动终止",turnFailed:"模型请求失败,本轮对话已中断",turnFailedMaxSteps:"达到本轮步数上限,对话已中断",turnFailedResume:"继续",turnFailedResumeText:"继续",yesterday:"昨天",loadOlder:"加载更早的消息",loadingOlder:"正在加载更早的消息…",widenTable:"加宽表格",restoreTableWidth:"恢复默认宽度",wrapCode:"开启自动换行",unwrapCode:"关闭自动换行",showLineNumbers:"显示行号",hideLineNumbers:"隐藏行号",cron:{fired:"定时任务已触发",missed:"错过的定时提醒",job:"任务 {id}",oneShot:"单次",coalesced:"已合并 {n} 次触发",missedCount:"错过 {n} 次",finalDelivery:"最后一次投递",expand:"展开",collapse:"收起"},fold:{worked:"已工作 {duration}",workedUnknown:"工作过程"},turnFiles:{titleOne:"{number} 个文件已修改",titleOther:"{number} 个文件已修改",more:"还有 {number} 个文件",moreOne:"还有 1 个文件",showLess:"收起",diffUnavailable:"此文件的改动无法逐项展示",openFile:"打开文件"},goal:{continuation:"目标续跑"},notification:{sentBy:{task:"由后台发送(Bash)",subagent:"由后台发送(Agent)"},bodyLine:"{status}:{description}",reason:"原因:{reason}",userStopped:"已被用户终止",statusTitle:{completed:"已完成",failed:"失败",timed_out:"超时",killed:"已终止",lost:"丢失",info:"通知"},status:{completed:"完成",failed:"失败",timed_out:"超时",killed:"已终止",lost:"丢失",info:"信息"},groupTitle:"{n} 条通知",copyPath:"复制路径",copied:"已复制",rawPayload:"原始 payload",outputTruncated:"输出已截断,仅显示末尾",fields:{type:"类型",source:"来源",severity:"严重度"}},userMessage:{expand:"展开",collapse:"收起"},search:{placeholder:"搜索对话…",searching:"搜索中…",results:"{current}/{total} 条结果",resultsCapped:"{current}/{total}+ 条结果",noResults:"无结果",previous:"上一个匹配",next:"下一个匹配",close:"关闭搜索"}},xie={connectionConnected:"已连接",connectionConnecting:"连接中…",connectionDisconnected:"未连接",ctxTooltip:"使用 {used} / {max} tokens ({pct}%)",modelLabel:"模型",permissionManual:"逐条确认",permissionAuto:"完全自主",permissionYolo:"自动通过",permissionManualDesc:"每个工具操作都需要你手动确认",permissionAutoDesc:"完全自主运行,智能体自己做决定,不再询问",permissionYoloDesc:"自动批准工具操作,但遇到关键问题仍会询问",planLabel:"计划",planOn:"开",planOff:"关",planTooltip:"切换计划模式(先调研再修改)",workModeDismiss:"退出模式",goalLabel:"目标",timeUnitHour:"小时",timeUnitMinute:"分",timeUnitSecond:"秒",planEmptyArmed:"计划模式已开启,智能体写出计划后会显示在这里",planEmptyIdle:"还没有计划——开启计划模式后,智能体写出的计划会显示在这里",swarmLabel:"Swarm",swarmDismiss:"关闭 Swarm",modeOff:"未启用",goalPlaceholder:"让智能体完成什么目标?",planPlaceholder:"让智能体先规划什么?",goalStart:"开始",goalPause:"暂停",goalResume:"继续",goalCancel:"取消",goalCancelConfirm:"是否需要取消当前目标?取消后将无法恢复。",goalCancelConfirmYes:"是",goalCancelConfirmNo:"否",goalDoneWhen:"完成条件",goalStatusActive:"进行中",goalStatusPaused:"已暂停",goalStatusBlocked:"已阻塞",goalStatusComplete:"已完成",modeNotSupported:"暂不支持",thinkingLabel:"思考",thinkingTooltip:"切换思考模式",cacheNote:"提示:切换模型或思考程度会使已有的提示词缓存失效。建议新建会话,避免额外的 token 消耗。",starredModels:"收藏",moreModels:"更多模型…",statusPanelTitle:"会话状态",statusPanelClose:"关闭",statusModel:"模型",statusThinking:"思考强度",statusPermission:"权限",statusPlanMode:"计划模式",statusSwarmMode:"Swarm 模式",swarmOn:"开",swarmOff:"关",statusContext:"上下文",statusCost:"花费",statusContextValue:"{used} / {max} ({pct}%)",statusNone:"—",activityRunning:"运行中…",activityAwaitingApproval:"等待批准",activityAwaitingQuestion:"等待回答",interrupt:"中断",runningShort:"进行中"},Sie={inputLabel:"消息输入框",placeholder:"输入消息…",send:"发送 ↵",queueLabel:"队列",placeholderRunning:"输入会加入队列 · Ctrl+S 立即插入运行中的回合",placeholderRunningMobile:"输入会加入队列",starting:"正在发送…",queuePending:"{n} 个任务等待发送",queueSteer:"立即发送到当前回合",queueDragTitle:"拖拽排序",editQueued:"编辑(载入到输入框)",queuedAttachments:"附件 ×{n}",queuedHasImage:"包含 {n} 张图片 — 只能移除,不能编辑",attachmentImage:"图片",attachmentVideo:"视频",attachmentOpenUnsupported:"无法打开 {name}:暂不支持此文件类型",dropToAttach:"松开鼠标添加附件",remove:"移除",uploading:"上传中",uploadFailed:"上传失败",attachFile:"添加附件",addMenu:"添加",addFiles:"文件",addFilesDesc:"上传文件",addGoalDesc:"设定目标并持续推进",addPlanDesc:"启用计划模式",addSwarmDesc:"启用 swarm 模式",noCommands:"无匹配命令",slashSheetTitle:"命令",slashSearchPlaceholder:"搜索命令…",mentionSheetTitle:"文件",mentionSearchPlaceholder:"搜索文件…",addSlash:"命令",addSlashDesc:"内置命令或技能",addMention:"提及",addMentionDesc:"提及项目中的文件",interrupt:"中断",interruptTitle:"中断当前操作",expandTitle:"展开输入框进行多行编辑",collapseTitle:"收起输入框",emptyConversationTitle:"Kimi Code",emptyConversation:"还没有消息 —— 在下方输入开始对话",upgradeBanner:"升级你的 Kimi 账户来使用 Kimi Code",quickStartPlaceholder:"输入消息开始新对话…",thinkingSuffix:" · 思考",thinkingSuffixEffort:" · {level}",noArgCommand:"{cmd} 不接受任何参数"},_ie={title:"登录 Kimi Code",close:"关闭 (Esc)",regionCnTitle:"Kimi Code",regionCnHint:"使用 kimi.com 账号登录",regionOverseasTitle:"Kimi Code",regionOverseasHint:"使用 kimi.ai 账号登录",oauthTitle:"登录 Kimi 账号",oauthHint:"在浏览器中完成授权即可登录",starting:"正在启动登录流程…",openedHint:"请在浏览器中完成授权({time})",blockedTitle:"未能自动打开登录页",blockedHint:"浏览器拦截了自动打开,请点击下方按钮继续完成授权。",notOpened:"没有自动打开浏览器?",authorizeInBrowser:"在浏览器中登录",orDivider:"或者",fallbackPrefix:"换个设备?在浏览器打开 ",fallbackSuffix:" 输入设备码:",copy:"复制",copied:"已复制",copyLink:"复制链接",success:"已登录",successHint:"正在加载,稍后自动关闭…",expiredTitle:"设备码已过期",expiredHint:"请重新开始登录流程",deniedTitle:"登录已取消",retry:"重试",closeBtn:"关闭",failedTitle:"登录失败",errorHint:"请升级 kimi-code 后重试",pollErrorTitle:"连接已断开",pollErrorHint:"登录轮询连续失败,请检查 kimi-code 进程后重试",action:"登录",requiredTitle:"请先登录",requiredMessage:"登录 Kimi 账号并配置模型后,才能开始对话。",goToLogin:"去登录",upgradeRequiredTitle:"请升级会员",upgradeRequiredMessage:"当前为免费账户,升级会员后即可使用 Kimi 模型开始对话。",pickModelTitle:"请选择模型",pickModelMessage:"已有可用模型,选择一个默认模型后即可开始对话。",pickModelAction:"选择模型",configureModelsTitle:"请配置模型",configureModelsMessage:"账号已登录,但还没有可用模型。配置模型后即可开始对话。",configureModelsGenericMessage:"还没有可用模型。配置模型后即可开始对话。",configureModelsAction:"去配置",rcSubtitle:"远程控制会话",rcChecking:"正在检查登录状态…",rcLead:"远程控制功能需要登录后使用。使用 Kimi 账号登录即可继续。",rcSuccessHint:"正在跳转…",rcExpiredTitle:"授权已过期或被取消",rcDeniedTitle:"已取消授权",rcStartErrorTitle:"无法开始登录",rcSessionErrorTitle:"无法创建登录会话",rcConnectionErrorHint:"请检查网络连接后重试。",rcSuccessNoRedirect:"现在可以关闭本页了。"},Iie={title:"供应商管理",loading:"加载提供商中…",unavailable:"暂不支持提供商管理",empty:"暂无提供商",status:{connected:"已连接",error:"错误",unconfigured:"未配置"},keySet:"key 已设置",keyNotSet:"未设置 key",managedBadge:"OAuth",modelCount:"{count} 个模型",confirmDelete:"确认删除?",refresh:"刷新",delete:"删除",refreshTitle:"刷新 {type}",deleteTitle:"删除 {type}",loginKimi:"登录 Kimi",loginAnthropic:"登录 Anthropic",addProvider:"添加供应商",added:"已添加",enterApiKey:"填写 API Key",optional:"可选",apiKeyRequired:"API Key 不能为空",fieldId:"名称",fieldType:"API 协议",types:{kimi:"Kimi",openai:"OpenAI",openai_responses:"OpenAI Responses",anthropic:"Anthropic","google-genai":"Google GenAI",vertexai:"Vertex AI"},fieldApiKey:"API Key",apiKeyManaged:"OAuth 托管登录",apiKeySet:"已设置,输入以更换",showApiKey:"显示 API Key",hideApiKey:"隐藏 API Key",fieldBaseUrl:"Base URL",baseUrlPlaceholder:"https://api.example.com/v1",fieldModels:"模型",colModelId:"模型 ID",colContext:"上下文",colDisplayName:"显示名",modelIdPlaceholder:"kimi-k3",modelContextPlaceholder:"1048576",modelNamePlaceholder:"可选",noModels:"暂无模型",addModel:"添加模型",removeModel:"移除模型",fieldDefaultModel:"默认模型",save:"保存",saved:"已保存",deleteProvider:"删除供应商",deleteConfirm:"确认删除 {id} 及其 {count} 个模型?",deleteConfirmYes:"确认删除",managedHint:"托管供应商在账户页登录 / 登出",unsavedGuard:"有未保存的修改。",guardStay:"继续编辑",guardDiscard:"丢弃",add:"添加",catalog:{sourceCatalog:"从目录添加",sourceManual:"手动添加",sourceRegistry:"注册表",registryHint:"从 api.json 注册表导入供应商与模型;同一 URL 重复导入即为刷新",registryUrlLabel:"注册表 URL",registryImported:"已导入 {count} 个供应商",searchPlaceholder:"搜索供应商",loading:"加载目录中…",loadError:"目录加载失败,请检查网络后重试",retry:"重试",empty:"没有匹配的供应商",rejected:"不可导入",rejectReason:{"unknown-explicit-type":"协议不受支持","proprietary-sdk":"私有协议,无法导入","empty-base-url":"Base URL 为空","placeholder-base-url":"端点包含环境变量占位符"},backToList:"返回目录列表",willImport:"将从目录导入 {count} 个模型",overwriteWarning:"已存在同名供应商,导入将覆盖其配置与模型",importAction:"导入"},error:{idRequired:"名称不能为空",idInvalid:'名称需以字母或数字开头,只能包含字母、数字、"-"、"_" 和空格',apiKeyRequired:"API Key 不能为空",baseUrlRequired:"Base URL 不能为空",registryUrlRequired:"注册表 URL 不能为空",modelRequired:"模型 ID 不能为空",contextSizeRequired:"上下文长度不能为空",contextSizeInvalid:"上下文长度需为正整数"},hintClose:"关闭"},Mie={dialogLabel:"切换模型",title:"切换模型",close:"关闭 (Esc)",allTab:"全部",providerTabs:"模型提供商",searchPlaceholder:"搜索模型或提供商…",clearSearch:"清除搜索",loading:"加载模型中…",unavailable:"暂无可用模型列表",contextSuffix:"{size} ctx",capabilityImageInput:"图片输入",capabilityVideoInput:"视频输入",capabilityToolUse:"工具调用",capabilityThinking:"思考",capabilityAlwaysThinking:"始终思考",emptyNoModels:"暂无可用模型",emptyNoMatch:"无匹配模型",starTitle:"添加到收藏",unstarTitle:"取消收藏",hintNavigate:"导航",hintSelect:"选择",hintClose:"关闭"},Tie={justNow:"刚刚"},Eie={title:{shell:"运行命令?",diff:"应用修改?",file:"写入文件?",fileop:"文件操作?",url:"抓取 URL?",search:"搜索?",invocation:"调用?",todo:"更新 todo?",plan_review:"按这份 plan 开始实现?",generic:"批准操作?"},subagentBadge:"子 agent · {name}",danger:"危险: {detail}",searchQueryLabel:"查询",searchScope:"范围:{scope}",feedbackPlaceholder:"说明拒绝原因… (Enter 提交, Shift+Enter 换行, Esc 取消)",feedbackHint:"Enter 提交 · Shift+Enter 换行 · Esc 取消",approve:"批准",approveSession:"本会话内批准",reject:"拒绝",feedback:"反馈",feedbackSubmit:"提交并拒绝",feedbackCancel:"取消",approvePlan:"批准 plan",revise:"修改",rejectAndExit:"拒绝并退出",expandPlan:"放大",collapsePlan:"还原"},Lie={back:"‹ 上一题",nextQuestion:"下一题 ›",otherDefault:"其他…",submit:"提交",dismiss:"放弃",minimize:"最小化",expand:"展开",hint:"↑↓ 选择 · Enter 确认"},Nie={tag:"任务",summary:"{run} 运行中 · {done} 完成",copy:"复制",calling:"调用 {label}",fieldTask:"任务",fieldOutput:"输出",fieldProgress:"进度",fieldResult:"结果",moreLines:"…(还有 {count} 行)",copied:"已复制",stop:"停止",defaultDescription:"后台任务",dockTasks:"后台任务",dockBash:"后台 Bash",dockSubagent:"后台 Agent",dockTodos:"待办",todoProgressTitle:"当前进度",stateDone:"完成",stateFail:"失败",stateCancelled:"已取消",filterRecent:"最近",filterRunning:"进行中",filterDone:"已完成",filterAll:"全部",running:"运行中",closePanel:"关闭面板",openPanel:"在侧边栏打开",timingRunning:"运行中 · {time}",timingDone:"完成 · {time}",emptyTasks:"暂无后台任务",emptyRecent:"暂无最近任务",emptyRunning:"暂无运行中的任务",emptyDone:"暂无已完成的任务",emptyBash:"暂无后台 Bash 任务",emptySubagent:"暂无后台 Agent 任务",emptyTodo:"暂无待办事项",openTab:"查看全部后台任务",openDetail:"查看",toBackground:"转后台",collapse:"折叠",expand:"展开",transcriptLoadError:"无法加载这个子 Agent 的对话。",copyCommand:"复制命令",copyOutput:"复制输出",copyAll:"复制全部"},Die={panelTitle:"思考过程",streaming:"思考中…"},Fie={aheadTitle:"领先远程",behindTitle:"落后远程",fileCountOne:"{number} 个文件",fileCountOther:"{number} 个文件",empty:"无 git 改动",clean:"工作区干净,无改动",back:"返回",loading:"正在加载 diff…",noDiff:"该文件没有行级改动",emptyFile:"空文件",list:"列表",tree:"树形"},Rie={},Oie={empty:"选择左侧文件预览",loading:"加载中…",lineCount:"{count} 行",copy:"复制",copied:"已复制",copyPath:"复制路径",openInEditor:"打开",reveal:"显示",download:"下载",close:"关闭",moreActions:"更多操作",refresh:"刷新",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:"请选择具体文件,而不是目录",notFound:"文件不存在或已被移动",tooLarge:"文件过大,暂不支持预览",loadFailed:"无法读取这个文件"}},Pie={searching:"搜索中…",noMatch:"无匹配",files:"文件",skills:"技能",openSkill:"打开技能文件",copyPath:"复制路径",attachmentUploadFailed:"上传失败——删除该附件,或重新拖入文件重试",attachmentUploadInterrupted:"上传中断——删除该附件,或重新拖入文件重试",viewFullscreen:"全屏查看",mediaPreviewLoading:"预览加载中…",mediaPreviewUploading:"上传中,完成后可预览",mediaPreviewUnavailable:"预览不可用",stateUploading:"上传中",stateUploaded:"已上传",stateUploadFailed:"上传失败"},$ie={dismiss:"关闭",errorLabel:"错误",noteLabel:"提示",agentWarningFallback:"agent 警告",unhandledEvent:"未处理的事件:{type}",agentError:{title:"模型请求失败",connection:"无法连接模型服务",auth:"模型认证失败",rateLimit:"模型请求被限流",overloaded:"模型服务过载",filtered:"响应被提供方过滤",api:"模型接口返回错误",contextOverflow:"上下文超出模型限制"},details:{cause:"底层原因",code:"错误码",connection:"连接状态",contentType:"响应类型",details:"服务端详情",duration:"耗时",endpoint:"请求地址",errorName:"错误类型",message:"错误信息",operation:"操作",phase:"失败阶段",request:"请求",requestId:"Request ID",responsePreview:"响应预览",sessionId:"Session ID",stack:"堆栈",status:"HTTP 状态",timeout:"超时设置",timestamp:"时间"},daemonApiTitle:"Kimi 服务器返回错误",daemonNetworkMessage:"Web 没有拿到 Kimi 服务器的响应。请确认它仍在运行,或刷新页面重试。",daemonNetworkTitle:"无法连接到 Kimi 服务器",daemonTimeoutMessage:"Kimi 服务器在等待时限内没有响应。操作可能仍在后台执行,请稍后刷新确认结果,或重试。",daemonTimeoutTitle:"Kimi 服务器响应超时",diagnostics:"诊断信息",hideDetails:"收起详情",operationFailedMessage:"刚才的操作没有完成,请稍后重试。",operationFailedTitle:"操作失败",sendFailedTitle:"发送失败",sendFailedNoDefaultModelMessage:"默认模型未配置,请到设置中重新选择模型",sessionSnapshotMessage:"Web 没能加载当前会话内容。请确认 Kimi 服务器仍在运行,或刷新页面重试。",sessionSnapshotTitle:"无法加载当前会话内容",showDetails:"查看详情",copyDetails:"复制诊断信息",copied:"已复制",wsTitle:"实时连接出错",goal:{alreadyExists:"当前会话已有一个进行中的目标,请先取消它再创建新目标。",notFound:"没有找到可操作的目标,可能它已经结束或被取消。",statusInvalid:"当前目标状态不支持这个操作。",notResumable:"这个目标无法恢复(可能已取消或已完成)。",objectiveTooLong:"目标描述太长了,请精简后重试。"}},Bie={new:{desc:"创建新会话"},clear:{desc:"清空并新建会话"},login:{desc:"在浏览器中登录 Kimi"},plan:{desc:"切换计划模式 开/关"},swarm:{desc:"切换 swarm 模式;/swarm <任务> 直接在 swarm 下执行"},goal:{desc:"创建/控制目标:/goal <目标>、/goal pause{'|'}resume{'|'}cancel"},btw:{desc:"侧边聊天:/btw <问题> 向 fork 的侧边会话提问"},compact:{desc:"压缩会话历史"},fork:{desc:"把当前会话 fork 出一个新会话"},export:{desc:"将当前会话和排障日志下载为 ZIP 压缩包",noSession:"请先打开一个会话再导出。",started:"正在导出会话…",done:"会话导出完成。",tooLarge:"会话数据超过导出大小限制,可在终端用 CLI 导出:kimi export {sessionId} -o session.zip"},status:{desc:"查看会话状态"},undo:{desc:"撤销上一条消息"}},zie={label:{read:"读取",bash:"运行",edit:"编辑",write:"写入",grep:"搜索",glob:"查找",ls:"列目录",web_fetch:"抓取",search:"搜索",todo:"待办",task:"任务",swarm:"Swarm",ask_user:"提问",plan:"计划",goal_create:"启动目标",goal_get:"读取目标",goal_budget:"设置目标预算",goal_update:"更新目标",waitfor:"等待"},waitfor:{waitingAny:"等待任一后台任务",waitingTask:"等待 {id}",noTasks:"没有后台任务在运行",timedOut:"等待超时",stillRunning:"{count} 个仍在运行",moreFinished:"另有 {count} 个在等待期间完成",moreRunning:"还有 {count} 个"},swarm:{progress:"{done} / {total}",runningSub:"{count} 个进行中",doneSub:"完成 {completed} · 失败 {failed}",doneSubWithCancelled:"完成 {completed} · 失败 {failed} · 已取消 {cancelled}",phaseQueued:"排队",phaseWorking:"运行中",phaseSuspended:"暂停",phaseCompleted:"完成",phaseFailed:"失败",phaseCancelled:"已取消",waiting:"等待子任务加入…"},chip:{lines:"{count} 行",results:"{count} 结果",files:"{count} 个文件",edited:"已编辑",created:"已创建",todos:"{count} 项"},disclosure:{expand:"展开详情",collapse:"收起详情"},agent:{foreground:"前台",background:"后台",status:{running:"运行中",ok:"已完成",error:"失败",cancelled:"已取消"}},output:{waiting:"等待输出…",empty:"(无输出)",saved:"已保存的结果"},plan:{review:{pending:"待确认",approved:"已通过",rejected:"已拒绝",cancelled:"已取消"},selectedOption:"已选择",pathOnlyHint:"该计划未保存内联内容,可在侧边栏打开:",feedback:"反馈"},summary:{inScope:"{value} 在 {scope} 中"},goal:{objectiveWithCriterion:"{objective} · {criterion}",status:"状态:{status}",budget:"{value} {unit}",turns:"{value} 轮",tokens:"{value} token",milliseconds:"{value} 毫秒",seconds:"{value} 秒",minutes:"{value} 分钟",hours:"{value} 小时"},group:{countOther:"执行了 {count} 次工具调用",typed:{read:{done:"读取了 {count} 个文件"},bash:{done:"运行了 {count} 条命令"},grep:{done:"搜索了 {count} 个模式"},search:{done:"网络搜索了 {count} 次"},glob:{done:"找了 {count} 次文件"},ls:{done:"列出了 {count} 个目录"},web_fetch:{done:"抓取了 {count} 个页面"},edit:{done:"编辑了 {count} 处"},write:{done:"写入了 {count} 个文件"}}},activity:{failedClause:"({count} 失败)",liveDonePrefix:"已",busy:"正在执行…",doing:{read:"正在读取 {subject}",bash:"正在运行 {subject}",grep:"正在搜索 {subject}",search:"正在搜索 {subject}",glob:"正在匹配 {subject}",ls:"正在列出 {subject}",web_fetch:"正在抓取 {subject}",edit:"正在编辑 {subject}",write:"正在写入 {subject}"}},ask:{dismissed:"已忽略",answer:"{count} 个回答",answers:"{count} 个回答",answered:"已回答",more:"(还有 {count} 个)",collected:"已收集回答",question:"{count} 个问题",questions:"{count} 个问题",freeInput:"(自由输入)",unanswered:"未作答"}},jie={resizeHandleAria:"调整侧栏宽度",resizePreviewAria:"调整预览面板宽度",detailPanelAria:"详情面板"},Hie={openSwitcher:"切换会话 / 工作区",openSettings:"会话设置",settingsTitle:"设置",groupSession:"当前会话",groupApp:"应用偏好",groupAccount:"账号",sheetLabel:"面板",closeSheet:"关闭",tapToCycle:"点击切换",running:"运行中",idle:"空闲",sessionCount:"{n} 个会话",newSession:"新建会话",permManualSub:"每个工具都确认",permAutoSub:"完全自主,不再提问",permYoloSub:"自动批准工具,仍可能提问",planModeSub:"计划模式",goalModeSub:"目标模式",swarmModeSub:"Swarm 模式",archivedSessions:"已归档会话",archivedSessionsSub:"查看并恢复已归档会话",archivedBack:"返回",viewFlat:"平铺",viewGrouped:"按工作区"},Wie={colorSchemeLabel:"外观",light:"月之亮面",dark:"月之暗面",system:"跟随系统"},qie={continue:"继续",back:"上一步",skip:"跳过",welcome:{title:"欢迎使用 Kimi Code",subtitle:"为专业开发者打造的 AI 编程工作台",languageLabel:"语言",themeLabel:"外观"},login:{title:"选择配置模型",subtitle:"选择驱动 Kimi Code 的模型服务,之后可在「设置」中更改。",kimiTitle:"登录 Kimi 账号",kimiHint:"使用 Kimi 会员权益,开箱即用",kimiCnTitle:"Kimi Code",kimiCnHint:"使用 kimi.com 账号登录",kimiOverseasTitle:"Kimi Code",kimiOverseasHint:"使用 kimi.ai 账号登录",customProviderTitle:"添加自定义供应商",customProviderHint:"使用自己的 API Key,接入 OpenAI 兼容等模型服务",loggedInTitle:"已登录 Kimi 账号",loggedInHint:"模型服务已就绪,可以开始使用",finish:"完成",skip:"跳过,稍后再说"}},Uie={title:"设置",internalTest:"内部测试",close:"关闭 (Esc)",tabs:{general:"通用",agent:"Agent",account:"账户",providers:"供应商",advanced:"高级",archived:"已归档",shortcuts:"快捷键",plugins:"插件",lab:"实验室"},lab:{sidebarTabs:"多标签页侧边栏",sidebarTabsHint:"侧边栏显示「进行中 / 已完成 / 工作空间」三个标签页"},plugins:{retry:"重试",builtIn:"内置",official:"官方",thirdParty:"第三方",installed:"已安装",install:"安装",update:"更新",remove:"移除",enabled:"启用",homepage:"主页",empty:"没有找到插件",hasErrors:"错误",customInstall:"安装自定义插件",customInstallPlaceholder:"https://… 或 /本地/目录",customInstallHint:"支持 https zip 链接、GitHub 仓库地址或本地目录路径。",extensionHintTitle:"还差一步:安装浏览器扩展",extensionGuide:"手动安装",dismissHint:"知道了",catalogUnavailable:"插件市场目录暂时不可达;已安装的插件仍可正常管理。",source:{"local-path":"本地","zip-url":"ZIP",github:"GitHub"},counts:{skill:"{n} 个技能",mcp:"{n} 个 MCP 服务",mcpEnabled:"启用 {n} 个",hook:"{n} 个钩子",command:"{n} 个命令"}},appearance:"外观",notifications:"通知",notifyEnabled:"系统通知",notifyEnabledHint:"回合完成、待回答或待审批时发送系统通知",notifySound:"通知提示音",notifySoundHint:"系统通知随附提示音",notifyDenied:"已在浏览器设置中被阻止",notifyTitle:"Kimi Code · 回合完成",notifyQuestionTitle:"Kimi Code · 待回答",notifyApprovalTitle:"Kimi Code · 等待审批",notifyFallback:"点击查看结果",notifyQuestionFallback:"有提问等待你回答",notifyApprovalFallback:"有工具等待你审批",account:"账户",signedIn:"已登录",signedOutHint:"登录后可查看账户和模型权益",planUsage:{title:"套餐用量",retry:"重试",loadFailed:"加载失败",empty:"暂无用量数据",weekLimit:"每周限额",genericLimit:"限额",hourLimit:"{n} 小时限额",dayLimit:"{n} 天限额",minuteLimit:"{n} 分钟限额",resetsIn:"{duration}后重置",resetDone:"已重置",durationDay:"{n} 天",durationHour:"{n} 小时",durationMinute:"{n} 分钟",durationSecond:"{n} 秒",usedPct:"已使用 {pct}%",boosterTitle:"加油包",boosterBalance:"余额",monthlyUsed:"本月已用",monthlyLimit:"每月上限",unlimited:"不限",freeTitle:"免费账户",freeHint:"升级会员后即可使用 Kimi 模型并查看套餐用量"},colorSchemeHint:"选择应用的明暗外观",appIcon:"程序坞图标",appIconHint:"选择程序坞中显示的图标",appIconDefault:"默认",appIconBlack:"黑色",uiFontSize:"字体大小",uiFontSizeHint:"调整界面和消息文字大小",vibrancy:"毛玻璃侧栏",vibrancyHint:"在侧栏使用 macOS 原生毛玻璃材质——如果半透明影响阅读可以关闭",languageHint:"选择界面显示语言",defaultOpenInApp:"默认打开应用",defaultOpenInAppHint:"从顶栏菜单打开文件和文件夹时默认使用的应用",openWith:"打开方式",agentDefaults:"Agent 默认值",saving:"保存中",defaultModel:"默认模型",defaultModelHint:"新会话会优先使用这个模型",noDefaultModel:"未设置默认模型",defaultPermission:"默认权限",defaultPermissionHint:"只影响之后新建的会话",defaultThinking:"默认开启思考",defaultThinkingHint:"新会话默认是否开启思考",defaultPlanMode:"默认计划模式",defaultPlanModeHint:"新会话默认进入计划模式",secondaryModelSection:"子智能体",secondaryModel:"子智能体模型",secondaryModelHint:"子智能体默认使用的模型与思考强度",secondaryModelEffort:"思考强度",noSecondaryModel:"未设置(跟随主模型)",secondaryModelEffortAuto:"模型默认",telemetry:"使用数据改进产品",telemetryHint:"开启后,我们会收集您的匿名交互数据(如点击、打断、功能使用等),用于改进产品体验。您可以随时关闭。",telemetryRestartHint:"更改后需重启服务生效。",credentialReady:"凭据已配置",credentialMissing:"缺少凭据",configUnavailable:"当前服务端没有返回 config,设置项暂不可用。",versionAndUpdates:"版本与更新",appVersion:"应用版本",appVersionHint:"当前应用的版本号和构建时间",checkUpdate:"检查更新",checkUpdateHint:"手动检查是否有新版本",checkUpdateBtn:"立即检查",updateChecking:"检查中…",updateCheckLatest:"已是最新版本",updateCheckAvailable:"发现新版本 {version},可从侧边栏的更新入口下载",updateCheckUnsupported:"当前构建不支持检查更新",updateCheckFailed:"检查失败,请稍后重试",updateCheckAvailableAuto:"发现新版本 {version},正在后台下载",updateCheckDownloaded:"新版本 {version} 已就绪,可从侧边栏的更新入口重启安装",autoDownloadUpdate:"自动下载更新",autoDownloadUpdateHint:"发现新版本时在后台自动下载,重启后完成安装",canaryUpdate:"更新 Canary",canaryGhMissing:"未检测到 GitHub CLI,请先安装(brew install gh)并登录",canaryGhUnauthenticated:"GitHub CLI 未登录,请先在终端运行 gh auth login",canaryTrigger:"重新打包 Canary",canaryTriggerHint:"触发 macOS arm64 构建流水线,产出新的 Canary 内测版",canaryTriggerBtn:"重新打包 Canary",canaryTriggerConfirm:"再点一次确认触发",canaryTriggerDone:"已触发,构建约需 20–30 分钟",canaryTriggerFailed:"触发失败:{error}",canaryViewWorkflow:"查看流水线",canaryImportStable:"从正式版导入界面设置…",canaryImportStableTitle:"从正式版导入界面设置",canaryImportStableHint:"把正式版的界面设置(置顶、外观等 localStorage 偏好)复制到 Canary 并覆盖当前设置(原设置自动备份为 leveldb.bak)。确认后 Canary 会重启完成导入;正式版需保持退出状态。",canaryImportStableBtn:"导入并重启",canaryImportStableRunning:"正式版(Kimi Code)正在运行——请先退出它,再重新导入。",canaryImportStableNoData:"没有找到正式版的界面设置数据。",canaryImportStableFailed:"导入失败:{error}",privacy:"数据与隐私",diagnostics:"诊断",messageFolding:"消息折叠",turnFolding:"消息自动折叠",turnFoldingHint:"回合结束时自动折叠工作过程,仅展示总结",activityRunFolding:"工具调用汇总",activityRunFoldingHint:"回答过程中,连续的工具调用自动汇总为一行摘要",build:"构建",serverVersion:"服务端版本",serverAddress:"服务器地址",serverAddressHint:"当前连接的服务器地址",serverVersionHint:"当前连接服务的版本",copyServerVersion:"复制服务端版本",copyServerAddress:"复制服务器地址",copied:"已复制",exportLog:"故障排查日志",exportLogHint:"导出已采集的故障排查日志",logHint:"加 ?debug=1 开启采集",exportLogBtn:"导出日志",archivedTitle:"已归档会话",archivedDesc:"查看已归档会话,确认其所属工作区路径、会话名称和归档时间,并可恢复到会话列表。",archivedSearch:"搜索已归档会话",archivedAllWorkspaces:"所有工作区",archivedSortLabel:"排序方式",archivedSortArchived:"归档时间",archivedSortCreated:"创建时间",archivedSortName:"按字母顺序",archivedRestore:"恢复",archivedEmpty:"还没有归档的会话",archivedNoMatch:"没有匹配的已归档会话",archivedSessionsCount:"{count} 个会话",archivedAt:"归档于 {time}",archivedLoadMore:"加载更多",archivedLoading:"加载中…",archivedLoadingAll:"正在加载全部归档会话…"},Vie={openInEditor:"在编辑器中打开",openInEditorShort:"打开",openInApp:"用 {app} 打开",chooseOpenApp:"选择应用",copyAll:"复制全部对话为 Markdown",copyFinalSummary:"仅复制最终总结",copied:"已复制",lastUsed:"上次使用",copyPath:"复制路径",changed:"{n} 处改动",gitTooltip:"打开「文件 > 改动」",detached:"游离",openPr:"打开 Pull Request",prStatusOpen:"已打开",prStatusClosed:"已关闭",prStatusMerged:"已合并",prStatusDraft:"草稿",prStatusUnknown:"未知",options:"选项",copySessionId:"复制 Session ID",pinSession:"置顶",unpinSession:"取消置顶",renameSession:"重命名",forkSession:"分叉会话",archiveSession:"归档",markSessionDone:"标记为完成",sessionDone:"已完成",reopenSession:"恢复进行中",exportSession:"导出会话",devBadge:"开发环境运行中"},Kie={title:"侧边聊天",empty:"在侧边随手问一句 —— 它共享当前会话的上下文。",placeholder:"问问侧边聊天…",send:"发送"},Zie={comment:"评论",addToChat:"添加到对话",commentPlaceholder:"写一句评论…",confirm:"确定",copyQuote:"复制引用",copyComment:"复制评论",quoteLabel:"引用"},Gie={actions:{summonApp:{label:"显示应用窗口",desc:"从任意位置将应用窗口唤起到前台"},newSession:{label:"新建会话",desc:"在当前工作区开始一个新会话"},searchSessions:{label:"搜索会话",desc:"打开会话搜索弹窗"},archiveSession:{label:"完成任务",desc:"立即完成当前会话(可在已完成列表找回)"},toggleSideChat:{label:"侧边聊天",desc:"打开或关闭 /btw 侧边聊天"},toggleSidebar:{label:"展开/收起侧边栏",desc:"收起或展开会话侧边栏"},openFolder:{label:"打开文件夹",desc:"通过系统原生选择器添加工作目录"},openInDefaultApp:{label:"在默认应用中打开",desc:"在默认编辑器或终端中打开当前工作目录"},openSettings:{label:"打开设置",desc:"显示或隐藏设置窗口"},toggleTerminal:{label:"切换终端",desc:"显示或隐藏底部终端面板"},openDiffTab:{label:"打开改动",desc:"打开或激活工作区改动标签页"},sidebarTabOpen:{label:"进行中标签页",desc:"切换到侧栏的进行中列表"},sidebarTabDone:{label:"已完成标签页",desc:"切换到侧栏的已完成列表"},sidebarTabWorkspaces:{label:"工作空间标签页",desc:"切换到侧栏的工作空间目录"},selectPrevSibling:{label:"上一条",desc:"在当前标签页中选中上一条会话 / 上一个工作空间"},selectNextSibling:{label:"下一条",desc:"在当前标签页中选中下一条会话 / 下一个工作空间"},send:{label:"发送消息",desc:"发送输入框中的内容"},newline:{label:"换行",desc:"在输入框中插入换行"}},searchPlaceholder:"搜索快捷键",unassigned:"未分配",unassign:"取消分配",edit:"编辑快捷键",reset:"恢复默认",resetAll:"全部恢复默认",recording:"按下新的快捷键…",invalid:"该按键组合不能用作快捷键",notGlobal:"该按键组合无法注册为系统级快捷键",globalTaken:"该快捷键已被系统或其他应用占用",reserved:"系统菜单已占用该快捷键",reservedSteer:"steer 固定快捷键(Ctrl/Cmd+S),不可占用",reservedFind:"对话搜索固定快捷键(Ctrl/Cmd+F),不可占用",conflict:"已被「{action}」占用",customBadge:"自定义"},Qie={panelAria:"终端",toolbarAria:"终端标签页",resizeAria:"调整终端面板高度",toggle:"切换终端",open:"打开终端",close:"关闭终端",newTab:"新建终端",closeTab:"关闭终端",restartTab:"重启终端",collapse:"收起终端面板",empty:"还没有终端,点击新建一个",processExited:"[进程已退出]",processExitedWithCode:"[进程已退出,退出码 {code}]"},Yie={tabs:{diff:"改动",file:"文件",turnDiff:"本轮改动",compaction:"压缩摘要",agent:"子 Agent",term:"终端"},newTab:"新建标签页",closeTab:"关闭标签页",expand:"展开面板",collapse:"恢复面板",hide:"关闭右侧面板",openPanel:"打开右侧面板",launcherAria:"快速打开"},Jie={title:"PR 预览",intro:"在隔离 worktree 中构建本仓库某个 PR 或分支的代码,构建完成后在独立窗口中打开它的界面。首次构建可能需要几分钟。",prLabel:"预览目标",customRefPlaceholder:"PR 编号、分支名、tag 或 commit sha",invalidRef:"请输入有效的分支名、tag 或 commit sha",start:"开始预览",cleanup:"清理预览缓存",cleanupConfirm:"删除除当前预览外的全部预览缓存?下次预览时会按需重新构建。",cleanupDone:"已清理 {count} 个预览缓存",fetching:"正在拉取 {pr} 的代码…",installing:"正在安装依赖…",building:"正在构建渲染产物…",activeText:"正在预览 {pr}",stop:"退出预览",rebuild:"重新拉取构建",errorTitle:"预览失败",retry:"重试",stageFetch:"拉取代码",stageInstall:"安装依赖",stageBuild:"构建渲染产物",stageFailed:"{stage}失败",stageHung:"{stage}时卡住超过 5 分钟,已终止(请检查网络/代理)"},Xie={title:"需要服务器 token",hint:"此服务器已开启访问保护。输入服务器启动时打印的 bearer token(或通过 {env} 设置的密码)。",tokenPlaceholder:"Token",connect:"连接",connecting:"连接中…"},eoe={common:yie,app:kie,sidebar:bie,admin:wie,workspace:Cie,conversation:Aie,status:xie,composer:Sie,login:_ie,providers:Iie,model:Mie,sessions:Tie,approval:Eie,question:Lie,tasks:Nie,thinking:Die,diff:Fie,fileTree:Rie,filePreview:Oie,mention:Pie,warnings:$ie,commands:Bie,tools:zie,layout:jie,mobile:Hie,theme:Wie,onboarding:qie,settings:Uie,header:Vie,sideChat:Kie,selection:Zie,shortcuts:Gie,terminal:Qie,panel:Yie,prPreview:Jie,serverAuth:Xie},toe={en:vie,zh:eoe},noe="kimi-locale";function iz(){let e=null;try{e=globalThis.localStorage?.getItem(noe)??null}catch{e=null}return e==="en"||e==="zh"?e:globalThis.navigator?.language?.toLowerCase().startsWith("zh")?"zh":"en"}function ioe(e){const t=e.locale??iz();return Sne({legacy:!1,locale:t,fallbackLocale:"en",messages:toe})}const oz=Symbol("KimiI18n"),ooe={t:e=>e};function Fm(){const e=rn(oz,null);if(e)return e;try{const t=Jt();return{t:(n,i)=>t.t(n,i),locale:t.locale.value}}catch{return ooe}}const aC=q(0),vk=D(()=>aC.value>0),uC=new Set;function sz(e){uC.add(e),aC.value+=1;let t=!1;return()=>{t||(t=!0,uC.delete(e)&&(aC.value-=1))}}function YM(e){if(!e)return!1;for(const t of uC)if(t===e||t.contains(e))return!0;return!1}function soe(e){return typeof e=="object"&&e!==null&&typeof e.contains=="function"}function H1(e,t){let n;qe([e,t],([i,o])=>{n?.(),n=void 0,i&&soe(o)&&(n=sz(o))},{flush:"post",immediate:!0}),ad(()=>{n?.(),n=void 0})}let cC=-1,dC=-1,ny=-1,o8=-1,rz=!1,JM=!1;function roe(e){const t=ny>=0;cC=ny,dC=o8,ny=e.clientX,o8=e.clientY,t&&(ny!==cC||o8!==dC)&&(rz=!0)}function lz(){JM||typeof document>"u"||(JM=!0,document.addEventListener("pointermove",roe,{capture:!0,passive:!0}))}function fC(e){return rz?e.clientX===cC&&e.clientY===dC:!0}const yd=6,kd=8,loe=150,aoe=dt({__name:"TooltipBubble",props:{target:{default:null},delegate:{default:null},text:{},placement:{default:"top"},maxWidth:{default:280},maxLines:{default:6}},setup(e){const t=e,n=q(),i=q(!1),o=q(!1),s=q({maxWidth:`${t.maxWidth}px`});let r,l=null,a,u=!1;function c(){if(t.target)return t.target;const A=t.delegate;return A?A.firstElementChild??A:null}function d(A){const E=n.value;if(!E)return;const I=A.getBoundingClientRect(),R=E.offsetWidth,W=E.offsetHeight,z=window.innerWidth,F=window.innerHeight;let O=t.placement;O==="top"&&I.top-yd-WF-kd?O="top":O==="left"&&I.left-yd-Rz-kd&&(O="left");let B=0,j=0;O==="top"?(B=I.top-yd-W,j=I.left+I.width/2-R/2):O==="bottom"?(B=I.bottom+yd,j=I.left+I.width/2-R/2):O==="left"?(B=I.top+I.height/2-W/2,j=I.left-yd-R):(B=I.top+I.height/2-W/2,j=I.right+yd),j=Math.min(Math.max(j,kd),z-kd-R),B=Math.min(Math.max(B,kd),F-kd-W),s.value={maxWidth:`${t.maxWidth}px`,top:`${Math.round(B)}px`,left:`${Math.round(j)}px`}}function h(){return vk.value&&!YM(c())}function p(){if(!t.text||h())return;const A=c();A&&(window.clearTimeout(r),r=window.setTimeout(()=>{i.value=!0,o.value=!1,mt(()=>{d(A),o.value=!0})},loe))}function m(){window.clearTimeout(r),u=!1,i.value=!1,o.value=!1}function g(A){u||fC(A)||(u=!0,p())}function y(){p()}function b(){m()}function v(A){return A instanceof Element?A.closest(".ui-tip"):null}function C(A){const E=t.delegate;if(E){if(v(A.target)!==E){m();return}u||fC(A)||(u=!0,p())}}function w(A){const E=t.delegate;if(!E)return;const I=A.relatedTarget;I instanceof Element&&E.contains(I)||m()}function M(A){v(A.target)===t.delegate&&p()}function N(){m()}function T(){l&&(t.delegate?(l.removeEventListener("pointermove",C),l.removeEventListener("mouseout",w),l.removeEventListener("focusin",M),l.removeEventListener("focusout",N)):(l.removeEventListener("pointermove",g),l.removeEventListener("mouseleave",b),l.removeEventListener("focusin",y),l.removeEventListener("focusout",b)),l=null)}function S(){T(),a?.disconnect(),a=void 0;const A=t.target??t.delegate;A&&(l=A,t.delegate?(A.addEventListener("pointermove",C,{passive:!0}),A.addEventListener("mouseout",w),A.addEventListener("focusin",M),A.addEventListener("focusout",N),a=new MutationObserver(()=>{i.value&&m()}),a.observe(A,{childList:!0})):(A.addEventListener("pointermove",g,{passive:!0}),A.addEventListener("mouseleave",b),A.addEventListener("focusin",y),A.addEventListener("focusout",b)))}qe(()=>[t.target,t.delegate],()=>{m(),S()}),qe(vk,A=>{A&&!YM(c())&&m()});function x(){i.value&&m()}return xn(()=>{lz(),S(),window.addEventListener("scroll",x,!0),window.addEventListener("resize",x)}),si(()=>{window.clearTimeout(r),a?.disconnect(),T(),window.removeEventListener("scroll",x,!0),window.removeEventListener("resize",x)}),(A,E)=>i.value?(k(),ce(Hs,{key:0,to:"body"},[_("div",{ref_key:"bubble",ref:n,class:Pe(["ui-tip__bubble",{positioned:o.value}]),style:an([s.value,{"--tip-lines":e.maxLines}]),role:"tooltip"},P(e.text),7)])):J("",!0)}}),az=Lt(aoe,[["__scopeId","data-v-da3fc01a"]]),uoe=["type","disabled","aria-label"],coe=dt({__name:"IconButton",props:{size:{default:"md"},disabled:{type:Boolean},label:{},tooltip:{},type:{default:"button"}},setup(e,{expose:t}){const n=q();return t({el:n}),(i,o)=>(k(),L("button",{ref_key:"el",ref:n,class:Pe(["ui-icon-button",`ui-icon-button--${e.size}`]),type:e.type,disabled:e.disabled,"aria-label":e.label},[Gn(i.$slots,"default",{},void 0,!0),e.tooltip?(k(),ce(az,{key:0,target:n.value??null,text:e.tooltip},null,8,["target","text"])):J("",!0)],10,uoe))}}),fn=Lt(coe,[["__scopeId","data-v-279bf6ac"]]),doe={class:"ui-action-toast-host"},foe={class:"ui-action-toast__body"},hoe=dt({__name:"ActionToast",props:{duration:{default:8e3},dismissLabel:{},dismissToken:{}},emits:["dismiss"],setup(e,{emit:t}){const n=e,i=t,{t:o}=Fm();let s=null,r=0,l=0;function a(d){s=setTimeout(()=>i("dismiss",n.dismissToken),d),r=Date.now()+d}function u(){s!==null&&(clearTimeout(s),s=null,l=Math.max(0,r-Date.now()))}function c(){s===null&&a(l)}return a(n.duration),$n(()=>{s!==null&&clearTimeout(s)}),(d,h)=>(k(),L("div",doe,[_("div",{class:"ui-action-toast",role:"status",onPointerenter:u,onPointerleave:c},[_("span",foe,[Gn(d.$slots,"default")]),U(fn,{class:"ui-action-toast__close",size:"sm",label:e.dismissLabel??f(o)("common.dismiss"),tooltip:e.dismissLabel??f(o)("common.dismiss"),onClick:h[0]||(h[0]=p=>i("dismiss",e.dismissToken))},{default:ae(()=>[U(Ae,{name:"close",size:"sm"})]),_:1},8,["label","tooltip"])],32)]))}}),poe=Lt(hoe,[["__scopeId","data-v-5464eaec"]]),moe={key:0,width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",stroke:"var(--color-success)","stroke-width":"2","aria-hidden":"true"},goe={key:1,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-danger)","stroke-width":"1.5","aria-hidden":"true"},voe={key:2,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-warning)","stroke-width":"1.5","aria-hidden":"true"},qd=dt({__name:"AuthStateIcon",props:{kind:{}},setup(e){return(t,n)=>e.kind==="success"?(k(),L("svg",moe,[...n[0]||(n[0]=[_("circle",{cx:"18",cy:"18",r:"15"},null,-1),_("polyline",{points:"10,18 15,24 26,12"},null,-1)])])):e.kind==="expired"?(k(),L("svg",goe,[...n[1]||(n[1]=[_("circle",{cx:"14",cy:"14",r:"12"},null,-1),_("line",{x1:"14",y1:"8",x2:"14",y2:"15"},null,-1),_("circle",{cx:"14",cy:"19",r:"1.2",fill:"var(--color-danger)"},null,-1)])])):(k(),L("svg",voe,[...n[2]||(n[2]=[_("path",{d:"M14 3 L26 24 H2 Z"},null,-1),_("line",{x1:"14",y1:"12",x2:"14",y2:"18"},null,-1),_("circle",{cx:"14",cy:"21.5",r:"1",fill:"var(--color-warning)"},null,-1)])]))}}),yoe={key:0,class:"ui-badge__dot","aria-hidden":"true"},koe=dt({__name:"Badge",props:{variant:{default:"neutral"},size:{default:"md"},dot:{type:Boolean}},setup(e){return(t,n)=>(k(),L("span",{class:Pe(["ui-badge",[`ui-badge--${e.variant}`,`ui-badge--${e.size}`]])},[e.dot?(k(),L("span",yoe)):J("",!0),Gn(t.$slots,"default",{},void 0,!0)],2))}}),Wl=Lt(koe,[["__scopeId","data-v-7b8349ab"]]),boe={class:"ui-banner__icon","aria-hidden":"true"},woe={class:"ui-banner__text"},Coe=dt({__name:"Banner",props:{variant:{default:"info"}},setup(e){return(t,n)=>(k(),L("div",{class:Pe(["ui-banner",`ui-banner--${e.variant}`]),role:"status"},[_("span",boe,[Gn(t.$slots,"icon",{},()=>[e.variant==="info"?(k(),ce(Ae,{key:0,name:"info",size:"md"})):(k(),ce(Ae,{key:1,name:"alert-triangle",size:"md"}))],!0)]),_("span",woe,[Gn(t.$slots,"default",{},void 0,!0)])],2))}}),yh=Lt(Coe,[["__scopeId","data-v-8fb5232f"]]),Aoe=["aria-label"],xoe=dt({__name:"Spinner",props:{size:{default:"md"},label:{}},setup(e){const{t}=Fm(),n=q(null);let i,o;function s(){const r=n.value;if(r){if(o?.matches){i?.cancel(),i=void 0;return}i||(i=r.animate([{transform:"rotate(0deg)"},{transform:"rotate(360deg)"}],{duration:850,iterations:1/0}),i.startTime=0)}}return xn(()=>{const r=n.value;!r||typeof r.animate!="function"||(o=window.matchMedia("(prefers-reduced-motion: reduce)"),o.addEventListener("change",s),s())}),si(()=>{o?.removeEventListener("change",s),o=void 0,i?.cancel(),i=void 0}),(r,l)=>(k(),L("span",{ref_key:"boxRef",ref:n,class:Pe(["ui-spinner",`ui-spinner--${e.size}`]),role:"status","aria-label":e.label??f(t)("common.loading")},[...l[0]||(l[0]=[_("svg",{class:"ui-spinner__svg",viewBox:"0 0 24 24","aria-hidden":"true"},[_("circle",{class:"ui-spinner__track",cx:"12",cy:"12",r:"9"}),_("circle",{class:"ui-spinner__arc",cx:"12",cy:"12",r:"9"})],-1)])],10,Aoe))}}),go=Lt(xoe,[["__scopeId","data-v-bf7852f3"]]),Soe=["type","disabled"],_oe={class:"ui-button__content"},Ioe=dt({__name:"Button",props:{variant:{default:"primary"},size:{default:"md"},disabled:{type:Boolean},loading:{type:Boolean},type:{default:"button"}},setup(e){return(t,n)=>(k(),L("button",{class:Pe(["ui-button",[`ui-button--${e.variant}`,`ui-button--${e.size}`,{"is-loading":e.loading}]]),type:e.type,disabled:e.disabled||e.loading},[e.loading?(k(),ce(go,{key:0,size:"sm",class:"ui-button__spinner"})):J("",!0),_("span",_oe,[Gn(t.$slots,"default",{},void 0,!0)])],10,Soe))}}),nn=Lt(Ioe,[["__scopeId","data-v-706daf1e"]]),Moe={key:0,class:"ui-card__head"},Toe={class:"ui-card__body"},Eoe={key:1,class:"ui-card__foot"},Loe=dt({__name:"Card",props:{elevated:{type:Boolean,default:!1}},setup(e){return(t,n)=>(k(),L("div",{class:Pe(["ui-card",{"is-elevated":e.elevated}])},[t.$slots.head?(k(),L("div",Moe,[Gn(t.$slots,"head",{},void 0,!0)])):J("",!0),_("div",Toe,[Gn(t.$slots,"default",{},void 0,!0)]),t.$slots.foot?(k(),L("div",Eoe,[Gn(t.$slots,"foot",{},void 0,!0)])):J("",!0)],2))}}),Noe=Lt(Loe,[["__scopeId","data-v-d0de153b"]]),Doe={class:"ctx-ring",viewBox:"0 0 20 20","aria-hidden":"true"},Foe=["stroke-dasharray","stroke-dashoffset"],s8=7,Roe=dt({__name:"ContextRing",props:{pct:{}},setup(e){const t=e,n=2*Math.PI*s8;return(i,o)=>(k(),L("svg",Doe,[_("circle",{class:"ctx-ring-track",cx:"10",cy:"10",r:s8,fill:"none","stroke-width":"2.5"}),_("circle",{class:"ctx-ring-fill",cx:"10",cy:"10",r:s8,fill:"none","stroke-width":"2.5","stroke-linecap":"round","stroke-dasharray":`${n}`,"stroke-dashoffset":`${n*(1-t.pct/100)}`},null,8,Foe)]))}}),Ooe=Lt(Roe,[["__scopeId","data-v-5a6777b1"]]),Br=q(0),c1=q(0),Poe=["aria-label"],$oe={key:0,class:"ui-dialog__head"},Boe={class:"ui-dialog__titles"},zoe={key:0,class:"ui-dialog__title"},joe={key:1,class:"ui-dialog__desc"},Hoe={class:"ui-dialog__body"},Woe={key:1,class:"ui-dialog__foot"},qoe='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])',Uoe=dt({__name:"Dialog",props:{open:{type:Boolean},title:{},ariaLabel:{},description:{},closeOnOverlay:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0},size:{default:"md"},height:{default:"auto"},padded:{type:Boolean,default:!0},hideClose:{type:Boolean},level:{default:"raised"},initialFocus:{},focusOnOpen:{type:Boolean,default:!0}},emits:["update:open","close"],setup(e,{emit:t}){const n=e,i=t,{t:o}=Fm(),s=q(null);let r=null;function l(){i("update:open",!1),i("close")}function a(){return s.value?Array.from(s.value.querySelectorAll(qoe)):[]}function u(){const{initialFocus:h}=n;return h?typeof h=="function"?h()??null:typeof h=="string"?s.value?.querySelector(h)??null:s.value?.contains(h)?h:null:null}function c(h){if(!n.open)return;if(h.key==="Escape"&&n.closeOnEsc){h.preventDefault(),l();return}if(h.key!=="Tab")return;const p=a(),m=p[0],g=p[p.length-1];if(!m||!g){h.preventDefault(),s.value?.focus();return}const y=document.activeElement;h.shiftKey&&y===m?(h.preventDefault(),g.focus()):!h.shiftKey&&y===g&&(h.preventDefault(),m.focus())}function d(h){n.closeOnOverlay&&h.target===h.currentTarget&&l()}return qe(()=>n.open,async h=>{if(h){if(Br.value+=1,r=document.activeElement,n.focusOnOpen){await mt();const p=u(),m=a();(p??m[0]??s.value)?.focus()}}else Br.value=Math.max(0,Br.value-1),r instanceof HTMLElement&&(r.focus(),r=null)},{immediate:!0}),typeof window<"u"&&window.addEventListener("keydown",c),si(()=>{typeof window<"u"&&window.removeEventListener("keydown",c),n.open&&(Br.value=Math.max(0,Br.value-1),r instanceof HTMLElement&&r.focus())}),(h,p)=>(k(),ce(Hs,{to:"body"},[e.open?(k(),L("div",{key:0,class:"ui-dialog__overlay",onMousedown:d},[_("div",{ref_key:"panel",ref:s,class:Pe(["ui-dialog",[`ui-dialog--${e.size}`,{"ui-dialog--flush":!e.padded,"ui-dialog--fixed-height":e.height==="fixed","ui-dialog--grouped":e.level==="grouped"}]]),role:"dialog","aria-modal":"true","aria-label":e.ariaLabel??e.title,tabindex:"-1"},[e.title||h.$slots.head?(k(),L("div",$oe,[Gn(h.$slots,"head",{},()=>[_("div",Boe,[e.title?(k(),L("div",zoe,P(e.title),1)):J("",!0),e.description?(k(),L("div",joe,P(e.description),1)):J("",!0)])],!0),e.hideClose?J("",!0):(k(),ce(fn,{key:0,class:"ui-dialog__close",size:"sm",label:f(o)("common.close"),tooltip:f(o)("common.close"),onClick:l},{default:ae(()=>[U(Ae,{name:"close",size:"md"})]),_:1},8,["label","tooltip"]))])):J("",!0),_("div",Hoe,[Gn(h.$slots,"default",{},void 0,!0)]),h.$slots.foot?(k(),L("div",Woe,[Gn(h.$slots,"foot",{},void 0,!0)])):J("",!0)],10,Poe)],32)):J("",!0)]))}}),Lf=Lt(Uoe,[["__scopeId","data-v-87c1966f"]]),Voe={class:"ui-empty"},Koe={key:0,class:"ui-empty__icon","aria-hidden":"true"},Zoe={key:1,class:"ui-empty__title"},Goe={key:2,class:"ui-empty__hint"},Qoe=dt({__name:"EmptyState",props:{title:{},hint:{}},setup(e){return(t,n)=>(k(),L("div",Voe,[t.$slots.icon?(k(),L("span",Koe,[Gn(t.$slots,"icon",{},void 0,!0)])):J("",!0),e.title?(k(),L("div",Zoe,P(e.title),1)):J("",!0),e.hint?(k(),L("div",Goe,P(e.hint),1)):J("",!0),Gn(t.$slots,"default",{},void 0,!0)]))}}),uz=Lt(Qoe,[["__scopeId","data-v-66c019cd"]]),Yoe={key:0,class:"ui-field__label"},Joe={key:1,class:"ui-field__error"},Xoe={key:2,class:"ui-field__hint"},ese=dt({__name:"Field",props:{label:{},hint:{},error:{}},setup(e){return(t,n)=>(k(),L("div",{class:Pe(["ui-field",{"has-error":!!e.error}])},[e.label?(k(),L("label",Yoe,P(e.label),1)):J("",!0),Gn(t.$slots,"default",{},void 0,!0),e.error?(k(),L("span",Joe,P(e.error),1)):e.hint?(k(),L("span",Xoe,P(e.hint),1)):J("",!0)],2))}}),tse=Lt(ese,[["__scopeId","data-v-a6fe84a4"]]),nse=["type","value","placeholder","disabled","readonly"],ise=dt({__name:"Input",props:{modelValue:{},size:{default:"md"},type:{default:"text"},placeholder:{},disabled:{type:Boolean},readonly:{type:Boolean},error:{type:Boolean}},emits:["update:modelValue","focus","blur"],setup(e,{expose:t,emit:n}){const i=n,o=q();function s(a){i("update:modelValue",a.target.value)}function r(){o.value?.focus()}function l(){o.value?.select()}return t({focus:r,select:l,el:o}),(a,u)=>(k(),L("input",{ref_key:"el",ref:o,class:Pe(["ui-input",[`ui-input--${e.size}`,{"has-error":e.error}]]),type:e.type,value:e.modelValue,placeholder:e.placeholder,disabled:e.disabled,readonly:e.readonly,onInput:s,onFocus:u[0]||(u[0]=c=>a.$emit("focus",c)),onBlur:u[1]||(u[1]=c=>a.$emit("blur",c))},null,42,nse))}}),$s=Lt(ise,[["__scopeId","data-v-3093c190"]]),ose={class:"ui-kbd"},sse=dt({__name:"Kbd",props:{keys:{}},setup(e){return(t,n)=>(k(),L("span",ose,[(k(!0),L(Fe,null,xt(e.keys,i=>(k(),L("kbd",{key:i,class:"ui-kbd__key"},P(i),1))),128))]))}}),Gc=Lt(sse,[["__scopeId","data-v-f33c235d"]]),rse=["href","target","rel"],lse=dt({__name:"Link",props:{href:{},variant:{default:"default"},external:{type:Boolean}},setup(e){return(t,n)=>e.href?(k(),L("a",{key:0,class:Pe(["ui-link",`ui-link--${e.variant}`]),href:e.href,target:e.external?"_blank":void 0,rel:e.external?"noopener noreferrer":void 0},[Gn(t.$slots,"default",{},void 0,!0)],10,rse)):(k(),L("span",{key:1,class:Pe(["ui-link",`ui-link--${e.variant}`])},[Gn(t.$slots,"default",{},void 0,!0)],2))}}),ase=Lt(lse,[["__scopeId","data-v-2c379b58"]]),use=["role"],cse=dt({__name:"Menu",props:{role:{default:"menu"}},setup(e,{expose:t}){const n=q();t({el:n});let i;return xn(()=>{n.value&&(i=sz(n.value))}),si(()=>i?.()),(o,s)=>(k(),L("div",{ref_key:"el",ref:n,class:"ui-menu",role:e.role},[Gn(o.$slots,"default",{},void 0,!0)],8,use))}}),ms=Lt(cse,[["__scopeId","data-v-a8172c5d"]]),dse={key:0,class:"ui-menu-sep",role:"separator"},fse=["role","disabled"],hse=dt({__name:"MenuItem",props:{active:{type:Boolean},danger:{type:Boolean},disabled:{type:Boolean},separator:{type:Boolean},size:{default:"md"},role:{default:"menuitem"}},emits:["click"],setup(e){return(t,n)=>e.separator?(k(),L("div",dse)):(k(),L("button",{key:1,class:Pe(["ui-menu-item",[`ui-menu-item--${e.size}`,{"is-active":e.active,"is-danger":e.danger}]]),type:"button",role:e.role,disabled:e.disabled,onClick:n[0]||(n[0]=i=>t.$emit("click",i))},[Gn(t.$slots,"default",{},void 0,!0)],10,fse))}}),en=Lt(hse,[["__scopeId","data-v-6cbd2f47"]]),pse=dt({__name:"Tooltip",props:{text:{},placement:{default:"top"},maxWidth:{default:280},maxLines:{default:6}},setup(e){const t=q();return(n,i)=>(k(),L(Fe,null,[_("span",{ref_key:"trigger",ref:t,class:"ui-tip"},[Gn(n.$slots,"default",{},void 0,!0)],512),U(az,{delegate:t.value??null,text:e.text,placement:e.placement,"max-width":e.maxWidth,"max-lines":e.maxLines},null,8,["delegate","text","placement","max-width","max-lines"])],64))}}),Pn=Lt(pse,[["__scopeId","data-v-4f57efde"]]),mse={class:"ui-panel-header__title"},gse={key:0,class:"ui-panel-header__sub"},vse=dt({__name:"PanelHeader",props:{title:{},titleTooltip:{},subtitle:{},closable:{type:Boolean,default:!0},closeLabel:{},closeIcon:{default:"close"},wrap:{type:Boolean}},emits:["close"],setup(e){const{t}=Fm();return(n,i)=>(k(),L("div",{class:Pe(["ui-panel-header",{wrap:e.wrap}])},[Gn(n.$slots,"leading",{},void 0,!0),e.title?(k(),ce(Pn,{key:0,text:e.titleTooltip??e.title},{default:ae(()=>[_("span",mse,P(e.title),1)]),_:1},8,["text"])):J("",!0),U(Pn,{text:e.subtitle},{default:ae(()=>[e.subtitle?(k(),L("span",gse,P(e.subtitle),1)):J("",!0)]),_:1},8,["text"]),Gn(n.$slots,"default",{},void 0,!0),e.closable?(k(),ce(fn,{key:1,class:"ui-panel-header__close",size:"sm",label:e.closeLabel??f(t)("common.close"),tooltip:e.closeLabel??f(t)("common.close"),onClick:i[0]||(i[0]=o=>n.$emit("close"))},{default:ae(()=>[U(Ae,{name:e.closeIcon,size:"sm"},null,8,["name"])]),_:1},8,["label","tooltip"])):J("",!0)],2))}}),yk=Lt(vse,[["__scopeId","data-v-bb2b5e64"]]),yse=["disabled","aria-pressed"],kse=dt({__name:"Pill",props:{clickable:{type:Boolean,default:!0},active:{type:Boolean},disabled:{type:Boolean},ariaPressed:{type:Boolean}},emits:["click"],setup(e){return(t,n)=>e.clickable?(k(),L("button",{key:0,class:Pe(["ui-pill",{"is-active":e.active}]),type:"button",disabled:e.disabled,"aria-pressed":e.ariaPressed,onClick:n[0]||(n[0]=i=>t.$emit("click",i))},[Gn(t.$slots,"default",{},void 0,!0)],10,yse)):(k(),L("span",{key:1,class:Pe(["ui-pill",{"is-active":e.active}])},[Gn(t.$slots,"default",{},void 0,!0)],2))}}),cz=Lt(kse,[["__scopeId","data-v-9fe3e0c7"]]),bse=dt({__name:"ScrollArea",props:{orientation:{default:"vertical"},hideDelay:{default:600}},setup(e,{expose:t}){const n=e,i=q(null),o=q(null),s=q(!1),r=q({overflow:!1,size:0,offset:0}),l=q({overflow:!1,size:0,offset:0}),a=q(null);let u=null,c=null,d=null;const h=D(()=>({overflowX:n.orientation==="vertical"?"hidden":"auto",overflowY:n.orientation==="horizontal"?"hidden":"auto"})),p=D(()=>({height:`${r.value.size}px`,transform:`translateY(${r.value.offset}px)`})),m=D(()=>({width:`${l.value.size}px`,transform:`translateX(${l.value.offset}px)`}));function g(x,A,E){if(!(A>x+1)||x<=0)return{overflow:!1,size:0,offset:0};const R=Math.max(0,x-4),W=Math.min(R,Math.max(24,R*x/A)),z=Math.max(0,R-W),F=Math.max(1,A-x);return{overflow:!0,size:W,offset:z*E/F}}function y(){const x=o.value;if(!x)return;const A=g(x.clientHeight,x.scrollHeight,x.scrollTop),E=g(x.clientWidth,x.scrollWidth,x.scrollLeft);(A.overflow!==r.value.overflow||A.size!==r.value.size||A.offset!==r.value.offset)&&(r.value=A),(E.overflow!==l.value.overflow||E.size!==l.value.size||E.offset!==l.value.offset)&&(l.value=E)}function b(){u!==null&&clearTimeout(u),u=null}function v(){b(),s.value=!0}function C(){b(),!(a.value||i.value?.matches(":hover, :focus-within"))&&(u=setTimeout(()=>{s.value=!1,u=null},n.hideDelay))}function w(){y(),v(),C()}function M(x,A){const E=o.value;E&&(A.preventDefault(),v(),a.value={axis:x,pointerId:A.pointerId,startPointer:x==="vertical"?A.clientY:A.clientX,startScroll:x==="vertical"?E.scrollTop:E.scrollLeft},A.currentTarget.setPointerCapture(A.pointerId))}function N(x){const A=a.value,E=o.value;if(!A||A.pointerId!==x.pointerId||!E)return;const I=A.axis==="vertical"?x.clientY:x.clientX,R=A.axis==="vertical"?E.clientHeight:E.clientWidth,W=A.axis==="vertical"?E.scrollHeight:E.scrollWidth,z=A.axis==="vertical"?r.value.size:l.value.size,F=Math.max(1,R-4-z),O=(I-A.startPointer)*(W-R)/F;A.axis==="vertical"?E.scrollTop=A.startScroll+O:E.scrollLeft=A.startScroll+O}function T(x){!a.value||a.value.pointerId!==x.pointerId||(a.value=null,C())}function S(){const x=o.value;if(!(!x||!c))for(const A of x.children)c.observe(A)}return xn(async()=>{await mt();const x=o.value;x&&(c=new ResizeObserver(y),c.observe(x),S(),d=new MutationObserver(()=>{S(),y()}),d.observe(x,{childList:!0,subtree:!0,characterData:!0}),y())}),si(()=>{b(),c?.disconnect(),d?.disconnect()}),t({viewport:o,updateMetrics:y}),(x,A)=>(k(),L("div",{ref_key:"root",ref:i,class:"ui-scroll-area",onPointerenter:v,onPointerleave:C,onFocusin:v,onFocusout:C},[_("div",{ref_key:"viewport",ref:o,class:"ui-scroll-area__viewport",style:an(h.value),tabindex:"0",onScroll:w},[Gn(x.$slots,"default",{},void 0,!0)],36),r.value.overflow&&n.orientation!=="horizontal"?(k(),L("div",{key:0,class:Pe(["ui-scroll-area__bar ui-scroll-area__bar--vertical",{"is-visible":s.value}]),"aria-hidden":"true"},[_("span",{class:"ui-scroll-area__thumb",style:an(p.value),onPointerdown:A[0]||(A[0]=E=>M("vertical",E)),onPointermove:N,onPointerup:T,onPointercancel:T},null,36)],2)):J("",!0),l.value.overflow&&n.orientation!=="vertical"?(k(),L("div",{key:1,class:Pe(["ui-scroll-area__bar ui-scroll-area__bar--horizontal",{"is-visible":s.value}]),"aria-hidden":"true"},[_("span",{class:"ui-scroll-area__thumb",style:an(m.value),onPointerdown:A[1]||(A[1]=E=>M("horizontal",E)),onPointermove:N,onPointerup:T,onPointercancel:T},null,36)],2)):J("",!0)],544))}}),XM=Lt(bse,[["__scopeId","data-v-797269ad"]]),wse=["data-icon","aria-selected","onClick"],Cse=dt({__name:"SegmentedControl",props:{modelValue:{},options:{},size:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,i=t,o=q(null),s=q([]),r=q(!1),l=q({});let a=null;function u(d,h){d instanceof HTMLElement&&(s.value[h]=d)}async function c(){await mt();const d=n.options.findIndex(p=>p.value===n.modelValue),h=s.value[d];h&&(l.value={width:`${h.offsetWidth}px`,height:`${h.offsetHeight}px`,transform:`translate(${h.offsetLeft}px, ${h.offsetTop}px)`},r.value=!0)}return qe(()=>[n.modelValue,n.options.length],c,{immediate:!0}),xn(()=>{a=new ResizeObserver(()=>c()),o.value&&a.observe(o.value);for(const d of s.value)a.observe(d);c()}),si(()=>a?.disconnect()),(d,h)=>(k(),L("div",{ref_key:"root",ref:o,class:Pe(["ui-seg",`ui-seg--${e.size??"md"}`]),role:"tablist"},[_("span",{class:Pe(["ui-seg__indicator",{"is-ready":r.value}]),style:an(l.value),"aria-hidden":"true"},null,6),(k(!0),L(Fe,null,xt(e.options,(p,m)=>(k(),L("button",{key:p.value,ref_for:!0,ref:g=>u(g,m),class:Pe(["ui-seg__item",{"is-on":p.value===e.modelValue}]),"data-icon":p.icon,type:"button",role:"tab","aria-selected":p.value===e.modelValue,onClick:g=>i("update:modelValue",p.value)},[p.icon?(k(),ce(Ae,{key:0,class:"ui-seg__icon",name:p.icon,size:"sm"},null,8,["name"])):J("",!0),p.swatch?(k(),L("span",{key:1,class:"ui-seg__swatch",style:an({backgroundColor:p.swatch})},null,4)):J("",!0),He(" "+P(p.label),1)],10,wse))),128))],2))}}),lr=Lt(Cse,[["__scopeId","data-v-c5824392"]]);function Ase(e){const{anchor:t,menuHeight:n,viewportWidth:i,viewportHeight:o,gap:s,margin:r}=e,l=o-r-(t.bottom+s),a=t.top-s-r,u=ll,c=u?a:l,d=Math.min(t.width,Math.max(0,i-2*r)),h=Math.min(Math.max(t.left,r),Math.max(r,i-r-d)),p={left:`${Math.round(h)}px`,width:`${Math.round(d)}px`};return cn.options.findIndex(ue=>String(ue.value)===String(n.modelValue??""))),w=D(()=>n.options[C.value]),M=D(()=>w.value?.label??n.placeholder);function N(ue,ie){a.value[ie]=ue instanceof HTMLElement?ue:null}function T(){const ue=l.value,ie=a.value[c.value];!ue||!ie||(ue.scrollTop=ie.offsetTop-(ue.clientHeight-ie.offsetHeight)/2)}function S(){const ue=r.value,ie=l.value;if(!ue||!ie)return;ie.style.maxHeight="";const ye=ue.getBoundingClientRect();h.value=Ase({anchor:ye,menuHeight:ie.offsetHeight,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,gap:y,margin:b}).style}function x(){n.disabled||u.value||(u.value=!0,c.value=C.value>=0?C.value:n.options.findIndex(ue=>!ue.disabled),y=v("--space-1",eT),b=v("--space-2",tT),ne(),mt(()=>{S(),mt(T)}))}function A({restoreFocus:ue=!1}={}){u.value&&(u.value=!1,ee(),ue&&mt(()=>r.value?.focus()))}function E(){u.value?A():x()}function I(ue){ue.disabled||(String(ue.value)!==String(n.modelValue??"")&&i("update:modelValue",ue.value),A({restoreFocus:!0}))}function R(ue){if(u.value||x(),n.options.length===0)return;let ie=c.value;for(let ye=0;yeye.disabled?-1:Te).filter(ye=>ye>=0);c.value=ue.key==="Home"?ie[0]??-1:ie.at(-1)??-1,mt(T)}}function z(ue){m=u.value;const ie=ue.target;s.value?.contains(ie)||l.value?.contains(ie)||A()}function F(){const ue=g;m=!1,g=!1,ee(),ue&&u.value&&r.value?.focus()}function O(){g=!0}function B(ue){const ie=ue.relatedTarget;ie instanceof Node&&(s.value?.contains(ie)||l.value?.contains(ie))||requestAnimationFrame(()=>{if(!u.value||g)return;const ye=document.activeElement;ye&&(s.value?.contains(ye)||l.value?.contains(ye))||A()})}function j(ue){u.value&&(l.value?.contains(ue.target)||S())}function $(){u.value&&S()}qe(()=>n.options.length,()=>{u.value&&mt(S)});function V(ue){(ue.type==="touchmove"?u.value||m:u.value)&&xse(ue.target,l.value)&&ue.preventDefault()}function ne(){p||(p=!0,document.addEventListener("wheel",V,{capture:!0,passive:!1}),document.addEventListener("touchmove",V,{capture:!0,passive:!1}))}function K(){p&&(p=!1,document.removeEventListener("wheel",V,{capture:!0}),document.removeEventListener("touchmove",V,{capture:!0}))}function ee(){u.value||m||K()}return xn(()=>{document.addEventListener("pointerdown",z,{passive:!0}),document.addEventListener("pointerup",F,{passive:!0}),document.addEventListener("pointercancel",F,{passive:!0}),document.addEventListener("scroll",j,!0),window.addEventListener("resize",$)}),$n(()=>{m=!1,K(),document.removeEventListener("pointerdown",z),document.removeEventListener("pointerup",F),document.removeEventListener("pointercancel",F),document.removeEventListener("scroll",j,!0),window.removeEventListener("resize",$)}),(ue,ie)=>(k(),L("div",{ref_key:"rootRef",ref:s,class:Pe(["ui-select",[`ui-select--${e.size}`,{"has-error":e.error,"is-open":u.value,"is-disabled":e.disabled}]])},[_("button",yi({ref_key:"triggerRef",ref:r},f(o),{class:"ui-select__trigger",type:"button",role:"combobox","aria-controls":d,"aria-expanded":u.value,"aria-haspopup":"listbox",disabled:e.disabled,onClick:E,onKeydown:W,onFocusout:B}),[_("span",{class:Pe(["ui-select__value",{"is-placeholder":!w.value}])},[w.value?.icon?(k(),L("img",{key:0,class:"ui-select__icon",src:w.value.icon,alt:""},null,8,_se)):J("",!0),_("span",Ise,P(M.value),1)],2),U(Ae,{class:"ui-select__chevron",name:"chevron-down",size:"sm"})],16,Sse),(k(),ce(Hs,{to:"body"},[u.value?(k(),L("div",{key:0,id:d,ref_key:"listRef",ref:l,class:"ui-select__menu",style:an(h.value),role:"listbox",onPointerdown:O,onFocusout:B},[(k(!0),L(Fe,null,xt(e.options,(ye,Te)=>(k(),L(Fe,{key:`${ye.group??""}:${ye.value}`},[ye.group&&ye.group!==e.options[Te-1]?.group?(k(),L("div",Mse,P(ye.group),1)):J("",!0),_("button",{ref_for:!0,ref:Ee=>N(Ee,Te),class:Pe(["ui-select__option",{"is-selected":Te===C.value,"is-active":Te===c.value}]),type:"button",role:"option","aria-selected":Te===C.value,disabled:ye.disabled,onMouseenter:Ee=>c.value=Te,onClick:Ee=>I(ye)},[U(Ae,{class:"ui-select__check",name:"check",size:"sm"}),ye.icon?(k(),L("img",{key:0,class:"ui-select__icon ui-select__icon--option",src:ye.icon,alt:""},null,8,Ese)):J("",!0),_("span",null,P(ye.label),1)],42,Tse)],64))),128))],36)):J("",!0)]))],2))}}),hC=Lt(Lse,[["__scopeId","data-v-e7628e92"]]),Nse=dt({__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"fail":case"danger":return"error";case"running":case"run":case"working":case"in_progress":case"active":return"running";case"suspended":return"suspended";default:return"idle"}}const i=D(()=>n(t.status));return(o,s)=>(k(),L("span",{class:Pe(["kw-dot",`kw-dot--${i.value}`]),"aria-hidden":"true"},null,2))}}),ba=Lt(Nse,[["__scopeId","data-v-ddf97fc4"]]),Dse=["aria-checked","aria-label","disabled"],Fse=dt({__name:"Switch",props:{modelValue:{type:Boolean},disabled:{type:Boolean},label:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(i,o)=>(k(),L("button",{class:Pe(["ui-switch",{"is-on":e.modelValue}]),type:"button",role:"switch","aria-checked":e.modelValue,"aria-label":e.label,disabled:e.disabled,onClick:o[0]||(o[0]=s=>n("update:modelValue",!e.modelValue))},[...o[1]||(o[1]=[_("span",{class:"ui-switch__thumb"},null,-1)])],10,Dse))}}),ru=Lt(Fse,[["__scopeId","data-v-eb53165a"]]),Rse=["value","rows","placeholder","disabled","readonly"],Ose=dt({__name:"Textarea",props:{modelValue:{},rows:{default:3},placeholder:{},disabled:{type:Boolean},readonly:{type:Boolean},error:{type:Boolean},resize:{type:Boolean,default:!0}},emits:["update:modelValue","focus","blur"],setup(e,{expose:t,emit:n}){const i=n;function o(r){i("update:modelValue",r.target.value)}const s=q(null);return t({el:s}),(r,l)=>(k(),L("textarea",{ref_key:"textareaRef",ref:s,class:Pe(["ui-textarea",{"has-error":e.error,"no-resize":!e.resize}]),value:e.modelValue,rows:e.rows,placeholder:e.placeholder,disabled:e.disabled,readonly:e.readonly,onInput:o,onFocus:l[0]||(l[0]=a=>r.$emit("focus",a)),onBlur:l[1]||(l[1]=a=>r.$emit("blur",a))},null,42,Rse))}}),Pse=Lt(Ose,[["__scopeId","data-v-1da4a9a7"]]),$se={class:"ui-toast__icon","aria-hidden":"true"},Bse={class:"ui-toast__body"},zse={class:"ui-toast__title"},jse={key:0,class:"ui-toast__msg"},Hse=dt({__name:"Toast",props:{variant:{default:"info"},title:{},message:{},dismissLabel:{}},emits:["dismiss"],setup(e){const{t}=Fm();return(n,i)=>(k(),L("div",{class:Pe(["ui-toast",`ui-toast--${e.variant}`])},[_("span",$se,[Gn(n.$slots,"icon",{},()=>[e.variant==="success"?(k(),ce(Ae,{key:0,name:"check"})):e.variant==="danger"?(k(),ce(Ae,{key:1,name:"close"})):e.variant==="warning"?(k(),ce(Ae,{key:2,name:"alert-triangle"})):(k(),ce(Ae,{key:3,name:"info"}))],!0)]),_("div",Bse,[_("div",zse,P(e.title),1),e.message?(k(),L("div",jse,P(e.message),1)):J("",!0),Gn(n.$slots,"default",{},void 0,!0)]),U(fn,{class:"ui-toast__close",size:"sm",label:e.dismissLabel??f(t)("common.dismiss"),tooltip:e.dismissLabel??f(t)("common.dismiss"),onClick:i[0]||(i[0]=o=>n.$emit("dismiss"))},{default:ae(()=>[U(Ae,{name:"close",size:"sm"})]),_:1},8,["label","tooltip"])],2))}}),Wse=Lt(Hse,[["__scopeId","data-v-09e5bc42"]]),qse=100;function Jl(){let e=!1,t=0;function n(){e=!0,t=0}function i(){e=!1,t=Date.now()}function o(){e=!1,t=0}function s(r){return e||r.isComposing||r.keyCode===229||Date.now()-t{typeof window<"u"&&(window.removeEventListener("focusin",o,!0),window.removeEventListener("focusout",o,!0))}),{handleCompositionStart:n,handleCompositionEnd:i,resetComposition:o,isComposingKeyEvent:s}}/*! - * pinia v4.0.3 - * (c) 2026 Eduardo San Martin Morote - * @license MIT - */let dz;const c4=e=>dz=e,fz=Symbol();function nT(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}function Use(){const e=Yb(!0),t=e.run(()=>q({}));let n=[],i=[];const o=Ot({install(s){c4(o),o._a=s,s.provide(fz,o),s.config.globalProperties.$pinia=o,i.forEach(r=>n.push(r)),i=[]},use(s){return this._a?n.push(s):i.push(s),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return o}const pC=()=>{};function iT(e,t,n,i=pC){e.add(t);const o=()=>{e.delete(t)&&i()};return!n&&Tm()&&ad(o),o}function qp(e,...t){e.forEach(n=>{n(...t)})}const Vse=e=>e(),oT=Symbol(),r8=Symbol();function mC(e,t){e instanceof Map&&t instanceof Map?t.forEach((n,i)=>e.set(i,n)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const n in t){if(!Object.hasOwn(t,n))continue;const i=t[n],o=e[n];nT(o)&&nT(i)&&Object.hasOwn(e,n)&&!mo(i)&&!ku(i)?e[n]=mC(o,i):e[n]=i}return e}const Kse=Symbol();function Zse(e){return!e||typeof e!="object"||!Object.hasOwn(e,Kse)}const{assign:Id}=Object;function Gse(e){return!!(mo(e)&&e.effect)}function Qse(e,t,n,i){const{state:o,actions:s,getters:r}=t,l=n.state.value[e];let a;function u(){l||(n.state.value[e]=o?o():{});const c=dJ(n.state.value[e]);return Id(c,s,Object.keys(r||{}).reduce((d,h)=>(d[h]=Ot(D(()=>{c4(n);const p=n._s.get(e);return r[h].call(p,p)})),d),{}))}return a=hz(e,u,t,n,i,!0),a}function hz(e,t,n={},i,o,s){let r;const l=Id({actions:{}},n),a={deep:!0};let u,c,d=new Set,h=new Set,p;const m=i.state.value[e];!s&&!m&&(i.state.value[e]={});let g;function y(T){let S;u=c=!1,typeof T=="function"?(T(i.state.value[e]),S={type:"patch function",storeId:e,events:p}):(mC(i.state.value[e],T),S={type:"patch object",payload:T,storeId:e,events:p});const x=g=Symbol();mt().then(()=>{g===x&&(u=!0)}),c=!0,qp(d,S,i.state.value[e])}const b=s?function(){const{state:S}=n,x=S?S():{};this.$patch(A=>{Id(A,x)})}:pC;function v(){r.stop(),d.clear(),h.clear(),i._s.delete(e)}const C=(T,S="")=>{if(oT in T)return T[r8]=S,T;const x=function(){c4(i);const A=Array.from(arguments),E=new Set,I=new Set;function R(F){E.add(F)}function W(F){I.add(F)}qp(h,{args:A,name:x[r8],store:M,after:R,onError:W});let z;try{z=T.apply(this&&this.$id===e?this:M,A)}catch(F){throw qp(I,F),F}return z instanceof Promise?z.then(F=>(qp(E,F),F)).catch(F=>(qp(I,F),Promise.reject(F))):(qp(E,z),z)};return x[oT]=!0,x[r8]=S,x},w={_p:i,$id:e,$onAction:iT.bind(null,h),$patch:y,$reset:b,$subscribe(T,S={}){if(d.has(T))return pC;const x=iT(d,T,S.detached,()=>A()),A=r.run(()=>qe(()=>i.state.value[e],E=>{(S.flush==="sync"?c:u)&&T({storeId:e,type:"direct",events:p},E)},Id({},a,S)));return x},$dispose:v},M=Ki(w);i._s.set(e,M);const N=(i._a&&i._a.runWithContext||Vse)(()=>i._e.run(()=>(r=Yb()).run(()=>t({action:C}))));for(const T in N){const S=N[T];mo(S)&&!Gse(S)||ku(S)?s||(m&&Zse(S)&&(mo(S)?S.value=m[T]:((S instanceof Set||S instanceof Map)&&S.clear(),mC(S,m[T]))),i.state.value[e][T]=S):typeof S=="function"&&(N[T]=C(S,T),l.actions[T]=S)}return Id(M,N),Id(xi(M),N),Object.defineProperty(M,"$state",{get:()=>i.state.value[e],set:T=>{y(S=>{Id(S,T)})}}),i._p.forEach(T=>{const S=r.run(()=>T({store:M,app:i._a,pinia:i,options:l}));Id(M,S)}),m&&s&&n.hydrate&&n.hydrate(M.$state,m),u=!0,c=!0,M}/*! #__NO_SIDE_EFFECTS__ */function Qa(e,t,n){let i;const o=typeof t=="function";i=o?n:t;function s(r,l){const a=xJ();return r=r||(a?rn(fz,null):null),r&&c4(r),r=dz,r._s.has(e)||(o?hz(e,t,i,r):Qse(e,i,r)),r._s.get(e)}return s.$id=e,s}function Up(e){const t=xi(e),n={};for(const i in t){const o=t[i];o?.effect?n[i]=D({get:()=>e[i],set(s){e[i]=s}}):(mo(o)||ku(o))&&(n[i]=pJ(e,i))}return n}function uc(e,t){const n=t??{h:"h",m:"m",s:"s"},i=Math.max(0,Math.floor(e/1e3));if(i<60)return i===0?"":`${i}${n.s}`;const o=Math.floor(i/60);if(o<60){const l=i%60;return l===0?`${o}${n.m}`:`${o}${n.m}${l}${n.s}`}const s=Math.floor(o/60),r=o%60;return r===0?`${s}${n.h}`:`${s}${n.h}${r}${n.m}`}const Yse={multiedit:"multi_edit",multiedits:"multi_edit",shell:"bash",run:"bash",exec:"bash",ripgrep:"grep",rg:"grep",find:"glob",fetch:"web_fetch",webfetch:"web_fetch",url_fetch:"web_fetch",urlfetch:"web_fetch",list:"ls",listdir:"ls",list_dir:"ls",todowrite:"todo",todo_write:"todo",todoread:"todo",todolist:"todo",todo_list:"todo",agent:"task",subagent:"task",websearch:"search",web_search:"search",create_goal:"creategoal",get_goal:"getgoal",set_goal_budget:"setgoalbudget",update_goal:"updategoal",wait_for:"waitfor"};function cr(e){const t=(e??"").trim().toLowerCase().replace(/[\s-]+/g,"_");return Yse[t]??t}const Jse={read:"tools.label.read",bash:"tools.label.bash",edit:"tools.label.edit",multi_edit:"tools.label.edit",write:"tools.label.write",grep:"tools.label.grep",glob:"tools.label.glob",ls:"tools.label.ls",web_fetch:"tools.label.web_fetch",search:"tools.label.search",todo:"tools.label.todo",task:"tools.label.task",agentswarm:"tools.label.swarm",askuserquestion:"tools.label.ask_user",exitplanmode:"tools.label.plan",creategoal:"tools.label.goal_create",getgoal:"tools.label.goal_get",setgoalbudget:"tools.label.goal_budget",updategoal:"tools.label.goal_update",waitfor:"tools.label.waitfor"};function pz(e,t){const n=Jse[cr(t)];return n?e(n):t}const mz=80;function Xse(e,t=mz){const n=e.trim();return n.length>t?n.slice(0,t-1)+"…":n}function ere(e,t){const n=e.trim();return!!(n===""||n==="{}"||n==="[]"||n==="null"||t&&Object.keys(t).length===0)}function tre(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 Ai(e){return typeof e=="string"&&e.length>0?e:void 0}function Md(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function nre(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 l8(e){return Ai(e.path)??Ai(e.file_path)??Ai(e.filePath)??Ai(e.filename)}const ire={active:"status.goalStatusActive",blocked:"status.goalStatusBlocked",complete:"status.goalStatusComplete"};function ore(e,t){const n=Ai(t);if(!n)return;const i=ire[n];return i?e(i):n}function sre(e,t){const n=Md(t.value),i=Ai(t.unit);if(!(n===void 0||!i))switch(i){case"turns":return e("tools.goal.turns",{value:n});case"tokens":return e("tools.goal.tokens",{value:n});case"milliseconds":return e("tools.goal.milliseconds",{value:n});case"seconds":return e("tools.goal.seconds",{value:n});case"minutes":return e("tools.goal.minutes",{value:n});case"hours":return e("tools.goal.hours",{value:n});default:return e("tools.goal.budget",{value:n,unit:i})}}function C7(e,t,n,i=!1){const o=(s,r=mz)=>i?s.trim():Xse(s,r);try{const s=tre(n);if(!i&&ere(n,s))return"";const r=()=>o(n.replace(/^·\s*/,""));if(!s)return r();switch(cr(t)){case"read":{const l=l8(s);if(!l)return r();const a=Md(s.offset)??Md(s.line_start)??Md(s.start_line),u=Md(s.limit)??Md(s.length),c=Md(s.line_end)??Md(s.end_line)??(a!==void 0&&u!==void 0?a+u:void 0);return o(a!==void 0&&c!==void 0?`${l}:${a}-${c}`:a!==void 0?`${l}:${a}`:l)}case"write":{const l=l8(s);return l?o(`${l} ${e("tools.chip.created")}`):r()}case"edit":case"multi_edit":{const l=l8(s);return l?o(l):r()}case"bash":{const l=Ai(s.command)??Ai(s.cmd)??Ai(s.script);return l?l.trim():r()}case"grep":case"search":{const l=Ai(s.pattern)??Ai(s.query)??Ai(s.regex),a=Ai(s.path)??Ai(s.glob)??Ai(s.include);return l&&a?o(e("tools.summary.inScope",{value:l,scope:a})):l?o(l):r()}case"glob":{const l=Ai(s.pattern)??Ai(s.glob)??Ai(s.query),a=Ai(s.path)??Ai(s.cwd);return l&&a?o(e("tools.summary.inScope",{value:l,scope:a})):l?o(l):Ai(s.path)?o(Ai(s.path)):r()}case"ls":{const l=Ai(s.path)??Ai(s.dir)??Ai(s.directory)??Ai(s.cwd);return l?o(l):r()}case"web_fetch":{const l=Ai(s.url)??Ai(s.uri);return l?o(nre(l)):r()}case"todo":case"task":{const l=Ai(s.description)??Ai(s.title)??Ai(s.prompt)??Ai(s.name)??Ai(s.subagent_type);if(l)return o(l);const a=Array.isArray(s.todos)?s.todos:Array.isArray(s.items)?s.items:void 0;return a?o(e("tools.chip.todos",{count:a.length})):r()}case"creategoal":{if(i)return r();const l=Ai(s.objective),a=Ai(s.completionCriterion);return l&&a?o(e("tools.goal.objectiveWithCriterion",{objective:l,criterion:a})):l?o(l):r()}case"getgoal":return i?r():"";case"setgoalbudget":{if(i)return r();const l=sre(e,s);return l?o(l):r()}case"updategoal":{if(i)return r();const l=ore(e,s.status);return l?o(e("tools.goal.status",{status:l})):r()}default:return r()}}catch{return n}}function rre(e,t){try{switch(cr(t.name)){case"bash":return t.timing?t.timing:"";case"read":{if(t.output&&t.output.length>0){const n=t.output.length;return e("tools.chip.lines",{count:n})}return""}case"edit":case"multi_edit":case"write":{if(t.output){for(const i of t.output){const o=i.match(/\+(\d+).*[-−](\d+)/);if(o)return`+${o[1]} −${o[2]}`}const n=t.output.find(i=>/\d+/.test(i));if(n){const i=n.match(/\+(\d+)/),o=n.match(/[-−](\d+)/);if(i||o)return`${i?`+${i[1]}`:""} ${o?`−${o[1]}`:""}`.trim()}if(t.status!=="error")return e("tools.chip.edited")}return""}case"grep":case"search":return t.output&&t.output.length>0?e("tools.chip.results",{count:t.output.length}):"";default:return""}}catch{return""}}const gz=new Set(["read","bash","grep","search","glob","ls","web_fetch","edit","write"]);function vz(e){const t=cr(e);return t==="multi_edit"?"edit":t}function yz(e){const t=[],n=new Map;for(const i of e){if(i.kind==="thinking")continue;const o=vz(i.tool.name);let s=n.get(o);s||(s={count:0,errors:0},n.set(o,s),t.push(o)),s.count++,i.tool.status==="error"&&s.errors++}return{order:t,byKind:n}}function kz(e,t,n){return gz.has(t)?e(`tools.group.typed.${t}.done`,{count:n}):e("tools.group.countOther",{count:n})}function bz(e,t){return{text:e("tools.activity.failedClause",{count:t}),tone:"danger"}}function wz(e){return e.map(t=>t.fragments.map(n=>n.text).join("")).join(" · ")}function lre(e,t,n={}){const{order:i,byKind:o}=yz(t),s=[];let r=!1;for(const l of i){const a=o.get(l);if(!a)continue;const u=[{text:kz(e,l,a.count),tone:"normal"}];a.errors>0&&(r=!0,u.push(bz(e,a.errors))),s.push({fragments:u})}if(n.durationMs!==void 0){const l=uc(n.durationMs);l&&s.push({fragments:[{text:l,tone:"faint"}]})}return{clauses:s,plain:wz(s),hasError:r}}function are(e,t){if(t.kind==="thinking")return{fragments:[{text:e("thinking.streaming"),tone:"normal"}]};const n=vz(t.tool.name);let i=C7(e,t.tool.name,t.tool.arg);if(n==="write"&&i){const s=e("tools.chip.created");i.endsWith(s)&&(i=i.slice(0,i.length-s.length).trimEnd())}return{fragments:[{text:i&&gz.has(n)?e(`tools.activity.doing.${n}`,{subject:i}):e("tools.activity.busy"),tone:"normal"}]}}function ure(e,t,n){const i=t.filter(c=>c!==n&&!(c.kind==="tool"&&c.tool.status==="running")),{order:o,byKind:s}=yz(i),r=e("tools.activity.liveDonePrefix"),l=[];for(const c of o){const d=s.get(c);if(!d)continue;const h=[{text:`${r}${kz(e,c,d.count)}`,tone:"faint"}];d.errors>0&&h.push(bz(e,d.errors)),l.push({fragments:h})}const a=n===null?null:are(e,n),u=a?[a,...l]:l;return{current:a,done:l,plain:wz(u)}}async function qs(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 cre(e)}function cre(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}const dre={ts:"ts",tsx:"tsx",js:"js",jsx:"jsx",mjs:"js",cjs:"js",vue:"vue",svelte:"svelte",py:"py",rb:"rb",go:"go",rs:"rs",java:"java",kt:"kt",kts:"kts",scala:"scala",swift:"swift",c:"c",h:"c",cpp:"cpp",cc:"cpp",cxx:"cpp",hpp:"cpp",cs:"cs",php:"php",sh:"sh",bash:"bash",zsh:"zsh",fish:"fish",ps1:"ps1",bat:"bat",cmd:"bat",sql:"sql",graphql:"graphql",prisma:"prisma",html:"html",htm:"html",xml:"xml",svg:"xml",css:"css",scss:"scss",sass:"sass",less:"less",json:"json",jsonc:"jsonc",json5:"json5",yaml:"yaml",yml:"yml",toml:"toml",ini:"ini",md:"md",markdown:"markdown",mdx:"mdx",lua:"lua",r:"r",dart:"dart",zig:"zig",mk:"makefile",cmake:"cmake",diff:"diff",proto:"proto"},fre={dockerfile:"dockerfile",makefile:"makefile","cmakelists.txt":"cmake"};function hre(e){const t=e?.split(/[\\/]/).pop()?.toLowerCase()??"";if(!t)return;const n=fre[t];if(n)return n;const i=t.lastIndexOf(".");if(!(i<=0))return dre[t.slice(i+1)]}class Vu 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 ra 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}}class A7 extends Error{size;limit;constructor(t){super(`file too large to preview: ${t.size} bytes (limit ${t.limit})`),this.name="FileTooLargeError",this.size=t.size,this.limit=t.limit}}function di(e){return e instanceof Vu||typeof e=="object"&&e!==null&&e.name==="DaemonApiError"&&typeof e.code=="number"}function Yv(e){return e instanceof ra||typeof e=="object"&&e!==null&&e.name==="DaemonNetworkError"&&typeof e.method=="string"&&typeof e.path=="string"}function Cz(e){return Yv(e)&&typeof e.cause=="object"&&e.cause!==null&&e.cause.name==="TimeoutError"}function pre(e){return e instanceof A7||typeof e=="object"&&e!==null&&e.name==="FileTooLargeError"&&typeof e.limit=="number"}const mre=41301,gre=40922;function sT(e){return di(e)&&e.code===gre}function vre(e){const t=(e instanceof Error?e.message:String(e)).slice(0,140);return Cz(e)?{kind:"timeout",message:t}:Yv(e)?{kind:"network",message:t}:di(e)?{kind:"api",message:t}:{kind:"unknown",message:t}}const yre="kimi_desktop",kre="platform",rT="kimi-desktop",lT="kimi-desktop-platform";function bre(){let e=!1,t=null;try{const n=new URLSearchParams(window.location.search);n.has(yre)?(sessionStorage.setItem(rT,"1"),e=!0):e=e||sessionStorage.getItem(rT)==="1";const i=n.get(kre);i?(sessionStorage.setItem(lT,i),t=i):t=sessionStorage.getItem(lT)}catch{}return{isDesktop:e,platform:t}}const gC=bre(),yp=gC.isDesktop,Yd=gC.isDesktop&&gC.platform==="darwin",wre=["faces","nature","food","activity","objects","symbols"],Cre=[["😀","faces","grinning smile happy 笑 开心"],["😄","faces","smile happy joy 笑 开心 高兴"],["😁","faces","grin beaming 咧嘴笑 开心"],["😂","faces","joy laugh tears 笑哭 爆笑"],["🤣","faces","rofl laugh rolling 笑翻 爆笑"],["😊","faces","blush shy happy 微笑 害羞"],["😉","faces","wink 眨眼"],["😍","faces","heart eyes love 爱心眼 喜欢 爱"],["🥰","faces","smiling hearts love 爱心 喜欢"],["😘","faces","kiss 飞吻 亲亲"],["😋","faces","yum tongue 好吃 馋"],["🤪","faces","zany crazy 鬼脸 疯"],["🤔","faces","thinking hmm consider 思考 想"],["🤨","faces","skeptical eyebrow 怀疑 挑眉"],["😐","faces","neutral meh 面无表情 无语"],["😑","faces","expressionless 面无表情 无语"],["🙄","faces","eye roll 翻白眼 无语"],["😶","faces","no mouth silent 无言 沉默"],["🫡","faces","salute 敬礼 收到"],["🤫","faces","shush quiet 嘘 安静"],["🤭","faces","oops giggle 捂嘴 偷笑"],["😴","faces","sleeping sleepy 睡觉 困"],["😪","faces","sleepy tired 困 疲惫"],["😷","faces","mask sick 口罩 生病"],["🤒","faces","sick fever 生病 发烧"],["🤕","faces","hurt bandage 受伤"],["🤢","faces","nauseated 恶心"],["🤯","faces","mind blown explode 震惊 爆炸"],["🥳","faces","party celebrate 庆祝 派对"],["🤩","faces","star struck 星星眼 激动"],["😎","faces","cool sunglasses 酷 墨镜"],["🥸","faces","disguise 伪装 假扮"],["🤓","faces","nerd geek 书呆子 学霸"],["😢","faces","cry sad 哭 难过"],["😭","faces","sob cry loudly 大哭 痛哭"],["😤","faces","triumph huff 哼 生气"],["😡","faces","angry rage mad 生气 愤怒"],["🤬","faces","swearing cursing 骂人 爆粗"],["😱","faces","scream fear 尖叫 害怕"],["😨","faces","fearful 害怕 恐惧"],["🥵","faces","hot heat 热 出汗"],["🥶","faces","cold freezing 冷 冻"],["🥴","faces","woozy drunk 晕 醉"],["😇","faces","angel innocent 天使 无辜"],["🙃","faces","upside down silly 倒脸 哭笑不得"],["💀","faces","skull dead 骷髅 笑死"],["👻","faces","ghost 鬼 幽灵"],["👍","faces","thumbs up like good 赞 好"],["👎","faces","thumbs down dislike 踩 差"],["👏","faces","clap applause 鼓掌 厉害"],["🙌","faces","raise hands celebrate 举手 庆祝"],["🙏","faces","pray thanks please 拜托 感谢 祈祷"],["💪","faces","muscle strong flex 加油 强壮 肌肉"],["👀","faces","eyes look watch 看 围观 眼睛"],["🤝","faces","handshake deal 握手 合作"],["✌️","faces","victory peace 胜利 耶"],["👋","faces","wave hello bye 挥手 你好 再见"],["🤞","faces","crossed fingers luck 祈祷 好运"],["👌","faces","ok okay 好的 可以"],["🫶","faces","heart hands love 比心 爱心"],["✍️","faces","writing hand 写字 记录"],["🧠","faces","brain smart 大脑 聪明"],["🦾","faces","mechanical arm 机械臂 力量"],["👤","faces","person user profile 个人 用户"],["👥","faces","people team group 团队 多人"],["🐶","nature","dog puppy 狗 小狗"],["🐱","nature","cat kitten 猫 小猫"],["🐭","nature","mouse rat 老鼠"],["🐹","nature","hamster 仓鼠"],["🐰","nature","rabbit bunny 兔子"],["🦊","nature","fox 狐狸"],["🐻","nature","bear 熊"],["🐼","nature","panda 熊猫"],["🐨","nature","koala 考拉"],["🐯","nature","tiger 老虎"],["🦁","nature","lion 狮子"],["🐮","nature","cow 牛"],["🐷","nature","pig 猪"],["🐸","nature","frog 青蛙"],["🐵","nature","monkey 猴子"],["🐔","nature","chicken 鸡"],["🐧","nature","penguin 企鹅"],["🐦","nature","bird 鸟"],["🐣","nature","chick hatching 小鸡 孵化"],["🦆","nature","duck 鸭子"],["🦉","nature","owl 猫头鹰"],["🐝","nature","bee 蜜蜂"],["🐛","nature","bug caterpillar 虫子 毛虫"],["🦋","nature","butterfly 蝴蝶"],["🐌","nature","snail slow 蜗牛 慢"],["🐢","nature","turtle slow 乌龟 慢"],["🐍","nature","snake 蛇"],["🐙","nature","octopus 章鱼"],["🦑","nature","squid 鱿鱼"],["🦐","nature","shrimp 虾"],["🦀","nature","crab 螃蟹"],["🐠","nature","tropical fish 鱼 热带鱼"],["🐳","nature","whale 鲸鱼"],["🦈","nature","shark 鲨鱼"],["🐊","nature","crocodile 鳄鱼"],["🦄","nature","unicorn 独角兽"],["🐴","nature","horse 马"],["🐑","nature","sheep 羊 绵羊"],["🐐","nature","goat 山羊"],["🦜","nature","parrot 鹦鹉"],["🌸","nature","blossom flower sakura 樱花 花"],["🌹","nature","rose flower 玫瑰 花"],["🌻","nature","sunflower 向日葵"],["🌷","nature","tulip 郁金香"],["🌱","nature","seedling sprout 发芽 幼苗"],["🌲","nature","tree evergreen 树 松树"],["🌳","nature","deciduous tree 树 大树"],["🌵","nature","cactus 仙人掌"],["🍀","nature","clover luck 四叶草 幸运"],["🍁","nature","maple leaf autumn 枫叶 秋天"],["🍄","nature","mushroom 蘑菇"],["🌈","nature","rainbow 彩虹"],["☀️","nature","sun sunny 太阳 晴"],["🌙","nature","moon crescent 月亮"],["⭐","nature","star 星星"],["🌟","nature","glowing star 星星 闪亮"],["☁️","nature","cloud 云"],["⛅","nature","partly cloudy 多云"],["🌧️","nature","rain rainy 下雨"],["❄️","nature","snowflake snow 雪 雪花"],["⛄","nature","snowman 雪人"],["⚡","nature","lightning bolt 闪电"],["🔥","nature","fire hot 火 燃"],["🌊","nature","wave ocean sea 海浪"],["🏔️","nature","mountain snow 雪山 山"],["☕","food","coffee 咖啡"],["🍵","food","tea 茶"],["🧋","food","bubble tea boba 奶茶"],["🥛","food","milk 牛奶"],["🍺","food","beer 啤酒"],["🍷","food","wine 红酒"],["🥂","food","champagne cheers 香槟 干杯"],["🥤","food","cup straw soda 饮料 可乐"],["🧃","food","juice box 果汁"],["🍎","food","apple 苹果"],["🍊","food","orange tangerine 橙子 橘子"],["🍋","food","lemon 柠檬"],["🍉","food","watermelon 西瓜"],["🍓","food","strawberry 草莓"],["🍑","food","peach 桃子"],["🥭","food","mango 芒果"],["🍍","food","pineapple 菠萝"],["🥝","food","kiwi 猕猴桃"],["🍇","food","grapes 葡萄"],["🍒","food","cherries 樱桃"],["🥑","food","avocado 牛油果"],["🥦","food","broccoli 西兰花"],["🌽","food","corn 玉米"],["🌶️","food","hot pepper spicy 辣椒 辣"],["🍔","food","burger hamburger 汉堡"],["🍟","food","fries 薯条"],["🍕","food","pizza 披萨"],["🌭","food","hot dog 热狗"],["🥪","food","sandwich 三明治"],["🌮","food","taco 墨西哥卷"],["🍜","food","ramen noodles 拉面 面条"],["🍝","food","spaghetti pasta 意面"],["🍣","food","sushi 寿司"],["🍱","food","bento 便当"],["🥟","food","dumpling 饺子"],["🍚","food","rice 米饭"],["🍞","food","bread 面包"],["🥐","food","croissant 可颂 牛角包"],["🧀","food","cheese 奶酪 芝士"],["🍳","food","cooking egg 煎蛋 做饭"],["🍦","food","ice cream 冰淇淋"],["🍰","food","cake 蛋糕"],["🎂","food","birthday cake 生日蛋糕"],["🍫","food","chocolate 巧克力"],["🍩","food","donut doughnut 甜甜圈"],["🍪","food","cookie 饼干"],["🍭","food","lollipop 棒棒糖"],["⚽","activity","soccer football 足球"],["🏀","activity","basketball 篮球"],["🏈","activity","american football 橄榄球"],["⚾","activity","baseball 棒球"],["🎾","activity","tennis 网球"],["🏐","activity","volleyball 排球"],["🏓","activity","ping pong 乒乓球"],["🏸","activity","badminton 羽毛球"],["🥊","activity","boxing 拳击"],["⛳","activity","golf 高尔夫"],["🎣","activity","fishing 钓鱼"],["🏊","activity","swim 游泳"],["🏄","activity","surf 冲浪"],["🚴","activity","cycling 骑行"],["🏋️","activity","weightlifting gym 举重 健身"],["🧘","activity","yoga meditation 瑜伽 冥想"],["🎮","activity","video game controller 游戏 游戏机"],["🎲","activity","dice 骰子"],["🎯","activity","target bullseye 目标 靶心"],["🎳","activity","bowling 保龄球"],["🎰","activity","slot machine 老虎机"],["♟️","activity","chess 国际象棋 棋"],["🎸","activity","guitar 吉他"],["🎹","activity","piano keyboard 钢琴"],["🥁","activity","drum 鼓"],["🎤","activity","microphone sing 麦克风 唱歌"],["🎧","activity","headphones 耳机"],["🎬","activity","clapper movie 电影 拍摄"],["🎨","activity","art palette paint 画画 艺术"],["🎭","activity","theater masks 戏剧 面具"],["🎪","activity","circus 马戏团"],["🎡","activity","ferris wheel 摩天轮"],["✈️","activity","airplane travel flight 飞机 旅行"],["🚗","activity","car drive 汽车 车"],["🚕","activity","taxi 出租车"],["🚌","activity","bus 公交车"],["🚑","activity","ambulance 救护车"],["🚒","activity","fire engine 消防车"],["🚀","activity","rocket launch ship 火箭 发射"],["🛸","activity","ufo flying saucer 飞碟"],["🚲","activity","bicycle bike 自行车"],["🛴","activity","scooter 滑板车"],["🚄","activity","bullet train 高铁 动车"],["🚢","activity","ship 船 轮船"],["⛵","activity","sailboat 帆船"],["🏠","activity","house home 房子 家"],["🏢","activity","office building 公司 办公楼"],["🏥","activity","hospital 医院"],["🏫","activity","school 学校"],["🏖️","activity","beach vacation 海滩 度假"],["⛺","activity","camping tent 露营 帐篷"],["🌋","activity","volcano 火山"],["🗺️","activity","map world 地图"],["🧭","activity","compass 指南针"],["💻","objects","laptop computer 电脑 笔记本"],["🖥️","objects","desktop computer 台式机 电脑"],["⌨️","objects","keyboard 键盘"],["🖱️","objects","computer mouse 鼠标"],["📱","objects","phone mobile 手机"],["🔋","objects","battery 电池"],["🔌","objects","plug electric 插头"],["💾","objects","floppy save 软盘 保存"],["📀","objects","cd disc 光盘"],["🎥","objects","movie camera 摄像机"],["📷","objects","camera 相机"],["🔭","objects","telescope 望远镜"],["📡","objects","satellite antenna 卫星 天线"],["🌐","objects","globe web internet 网络 全球 互联网"],["🕯️","objects","candle 蜡烛"],["💡","objects","bulb idea light 灯泡 点子"],["🔦","objects","flashlight 手电筒"],["📁","objects","folder 文件夹"],["📂","objects","open folder 文件夹 打开"],["🗂️","objects","card index archive 归档 索引"],["📅","objects","calendar date 日历 日期"],["📌","objects","pin pushpin 图钉 置顶"],["📍","objects","round pin location 定位 位置"],["📎","objects","paperclip attachment 回形针 附件"],["✂️","objects","scissors cut 剪刀 剪切"],["📏","objects","ruler 尺子"],["📝","objects","memo note write 备忘 记录"],["✏️","objects","pencil edit write 铅笔 编辑"],["📄","objects","document page 文档 文件"],["📃","objects","page curl 文档 文件"],["📑","objects","bookmark tabs 标签页 文档"],["📚","objects","books 书 书籍"],["📖","objects","open book 打开的书 阅读"],["🔖","objects","bookmark 书签"],["🏷️","objects","label tag 标签"],["📊","objects","bar chart stats 图表 统计"],["📈","objects","chart up growth 上涨 增长"],["📉","objects","chart down 下跌 下降"],["🔍","objects","search magnifier 搜索 查找"],["🔎","objects","search magnifier right 搜索 查找"],["🔒","objects","lock locked 锁 锁定"],["🔓","objects","unlock open 解锁"],["🔑","objects","key 钥匙 密钥"],["🔧","objects","wrench tool 扳手 工具"],["🔨","objects","hammer 锤子"],["🛠️","objects","tools hammer wrench 工具 修理"],["🧰","objects","toolbox 工具箱 工具"],["🪛","objects","screwdriver 螺丝刀 工具"],["🔩","objects","nut and bolt screw 螺母 螺栓"],["🏗️","objects","building construction crane 施工 建造"],["⚙️","objects","gear settings 齿轮 设置"],["🧲","objects","magnet 磁铁"],["⚗️","objects","alembic 蒸馏器 实验"],["🧪","objects","test tube experiment 实验 试管"],["🔬","objects","microscope science 显微镜 科学"],["🤖","objects","robot bot 机器人"],["👾","objects","alien monster game 外星人 游戏"],["💣","objects","bomb 炸弹"],["🧨","objects","firecracker 爆竹"],["🗑️","objects","trash delete 垃圾桶 删除"],["🧹","objects","broom clean 扫帚 清理"],["🧻","objects","toilet paper 纸巾"],["🧽","objects","sponge 海绵"],["📦","objects","package box 包裹 箱子"],["✉️","objects","envelope mail 邮件 信封"],["📮","objects","mailbox postbox 邮箱"],["📧","objects","email mail 邮件"],["📥","objects","inbox tray receive 收件箱 接收"],["📤","objects","outbox tray send 发件箱 发送"],["📞","objects","telephone receiver call phone 电话 通话"],["💬","objects","speech balloon chat message bubble 聊天 对话 气泡 消息"],["💭","objects","thought balloon thinking 思考 想法 气泡"],["📣","objects","megaphone announcement 喇叭 公告"],["📢","objects","loudspeaker broadcast 广播 喇叭 通知"],["🚨","objects","police light alert emergency 警报 告警 紧急"],["🗳️","objects","ballot box vote 投票箱 投票"],["🔗","objects","link chain 链接 连接"],["🧩","objects","puzzle piece plugin 拼图 插件"],["🪄","objects","magic wand 魔法 魔杖"],["🛡️","objects","shield security 盾牌 安全"],["⚔️","objects","crossed swords 交叉剑 战斗"],["💳","objects","credit card 信用卡"],["💰","objects","money bag 钱袋 钱"],["🧾","objects","receipt 收据 小票"],["📿","objects","prayer beads 念珠"],["💍","objects","ring 戒指"],["👑","objects","crown 皇冠"],["🎩","objects","top hat 礼帽"],["🎒","objects","backpack 背包 书包"],["👓","objects","glasses 眼镜"],["🌂","objects","umbrella 雨伞"],["🕰️","objects","mantel clock 座钟"],["⌚","objects","watch 手表"],["⏱️","objects","stopwatch 秒表"],["🧯","objects","fire extinguisher 灭火器"],["🩹","objects","bandage patch fix 创可贴 补丁 修复"],["🎓","objects","graduation cap study learn 毕业 学习"],["🎫","objects","ticket 票 门票 工单"],["✅","symbols","check done complete 完成 对勾"],["✔️","symbols","checkmark correct 对勾 正确"],["❌","symbols","cross x wrong 错误 叉"],["❓","symbols","question help 问题 问号"],["❔","symbols","white question 问题 问号"],["❗","symbols","exclamation important 感叹号 重要"],["❕","symbols","white exclamation 感叹号"],["⚠️","symbols","warning caution 警告 注意"],["🚧","symbols","construction wip 施工 进行中"],["🚫","symbols","prohibited no 禁止"],["💥","symbols","boom explosion 爆炸"],["✨","symbols","sparkles shiny 闪亮 星星"],["🎉","symbols","tada party celebrate 庆祝 撒花"],["🎊","symbols","confetti party 庆祝 彩带"],["🏆","symbols","trophy champion 奖杯 冠军"],["🥇","symbols","gold medal first 金牌 第一"],["🥈","symbols","silver medal second 银牌 第二"],["🥉","symbols","bronze medal third 铜牌 第三"],["🎖️","symbols","military medal 勋章"],["🚩","symbols","red flag mark 红旗 标记"],["🏁","symbols","checkered flag finish 终点 完成"],["⏳","symbols","hourglass time waiting 沙漏 时间"],["⌛","symbols","hourglass done 沙漏 时间"],["🕐","symbols","clock one time 时钟 一点"],["⏰","symbols","alarm clock 闹钟"],["🔔","symbols","bell notification 铃铛 通知"],["🔕","symbols","bell slash mute 静音 免打扰"],["🕹️","symbols","joystick game 摇杆 游戏"],["🔴","symbols","red circle record 红圆 录制"],["🟢","symbols","green circle online 绿圆 在线"],["🟡","symbols","yellow circle 黄圆"],["🟠","symbols","orange circle 橙圆"],["🔵","symbols","blue circle 蓝圆"],["🟣","symbols","purple circle 紫圆"],["⚫","symbols","black circle 黑圆"],["⚪","symbols","white circle 白圆"],["🟥","symbols","red square 红方"],["🟩","symbols","green square 绿方"],["🟦","symbols","blue square 蓝方"],["🔺","symbols","red triangle up 三角 上"],["🔻","symbols","triangle down 三角 下"],["🔸","symbols","diamond orange 菱形"],["🔹","symbols","diamond blue 菱形"],["💠","symbols","diamond dot 菱形 花"],["🔶","symbols","diamond orange big 菱形"],["🔷","symbols","diamond blue big 菱形"],["▶️","symbols","play 播放"],["⏸️","symbols","pause 暂停"],["⏹️","symbols","stop 停止"],["⏺️","symbols","record 录制"],["⏩","symbols","fast forward 快进"],["⏪","symbols","rewind 快退"],["🔀","symbols","shuffle 随机 打乱"],["🔁","symbols","repeat 重复 循环"],["🔂","symbols","repeat one 单曲循环"],["🔄","symbols","refresh sync 刷新 同步"],["🔃","symbols","reload 重载"],["➕","symbols","plus add 加 新增"],["➖","symbols","minus 减"],["➗","symbols","divide 除"],["✖️","symbols","multiply 乘"],["💲","symbols","dollar money 美元 钱"],["™️","symbols","trademark 商标"],["©️","symbols","copyright 版权"],["®️","symbols","registered 注册商标"],["↔️","symbols","left right arrow 左右箭头"],["⬆️","symbols","up arrow 上箭头"],["⬇️","symbols","down arrow 下箭头"],["➡️","symbols","right arrow 右箭头"],["⬅️","symbols","left arrow 左箭头"],["🔙","symbols","back 返回"],["🔜","symbols","soon 很快"],["🔝","symbols","top 置顶 顶部"],["💤","symbols","zzz sleep 睡觉"],["🆕","symbols","new 新 新品"],["🆒","symbols","cool 酷"],["🆓","symbols","free 免费"],["🆗","symbols","ok 可以"],["🆙","symbols","up 提升"],["🆚","symbols","vs versus 对比"],["♾️","symbols","infinity 无限"],["💯","symbols","hundred perfect 满分 一百"],["💢","symbols","anger 生气"],["♨️","symbols","hot springs 温泉"],["🚸","symbols","children crossing 注意儿童"],["🔞","symbols","no one under eighteen 十八禁"],["📵","symbols","no mobile phones 禁止手机"],["❤️","symbols","red heart love 红心 爱"],["🧡","symbols","orange heart 橙心"],["💛","symbols","yellow heart 黄心"],["💚","symbols","green heart 绿心"],["💙","symbols","blue heart 蓝心"],["💜","symbols","purple heart 紫心"],["🖤","symbols","black heart 黑心"],["🤍","symbols","white heart 白心"],["🤎","symbols","brown heart 棕心"],["💔","symbols","broken heart 心碎"],["💕","symbols","two hearts 双心 爱心"],["💖","symbols","sparkling heart 闪亮的心"],["💗","symbols","growing heart 心动"]],Az=Cre.map(([e,t,n])=>({emoji:e,group:t,keywords:n}));function Are(e,t=24){const n=e.trim().toLowerCase();if(!n)return[];const i=[];for(const o of Az)if((o.keywords.includes(n)||o.emoji===n)&&(i.push(o.emoji),i.length>=t))break;return i}const xre=8;function Sre(e,t,n=xre){return[t,...e.filter(i=>i!==t)].slice(0,n)}function xz(e,t){try{const n=new Date(e);if(Number.isNaN(n.getTime()))return e;const i=new Date,o=c=>String(c).padStart(2,"0"),s=`${o(n.getHours())}:${o(n.getMinutes())}`,r=n.getFullYear()===i.getFullYear(),l=n.getMonth()===i.getMonth(),a=n.getDate()===i.getDate();if(r&&l&&a)return s;const u=new Date(i);return u.setDate(i.getDate()-1),n.getFullYear()===u.getFullYear()&&n.getMonth()===u.getMonth()&&n.getDate()===u.getDate()?`${t} ${s}`:r?`${o(n.getMonth()+1)}-${o(n.getDate())} ${s}`:`${n.getFullYear()}-${o(n.getMonth()+1)}-${o(n.getDate())} ${s}`}catch{return e}}function sd(e){if(e>=1024*1024)return`${aT(e/(1024*1024))}M`;if(e>=1024){const t=e/1024;return`${t>=100?Math.round(t):aT(t)}k`}return String(e)}function aT(e){const t=e.toFixed(1);return t.endsWith(".0")?t.slice(0,-2):t}function _re(){return window.kimiDesktop}function Sz(e,t,n){const i=n.length===0?void 0:n.length===1?n[0]:n;try{_re()?.log?.(e,t,i)}catch{}}function bu(e,...t){console.warn(e,...t),Sz("warn",e,t)}function Ku(e,...t){console.error(e,...t),Sz("error",e,t)}function Qc(e){const t=e.split("/").filter(Boolean);return t.length>0?t[t.length-1]:e}const Ire=/^(?:[A-Za-z]:[\\/]|\\\\|\/\/)/;function la(e){const t=e.replaceAll("\\","/"),n=Ire.test(t),i=t.replace(/\/+$/,"");return n?i.toLowerCase():i}function Mre(e){const{workspaces:t,sessions:n,hiddenWorkspaceRoots:i,sessionsHasMoreByWorkspace:o}=e,s=new Set(i.map(la)),r=new Map;for(const h of t){const p=la(h.root);s.has(p)||r.has(p)||r.set(p,{...h})}for(const h of n){const p=h.cwd;if(!p)continue;const m=la(p);s.has(m)||r.has(m)||r.set(m,{id:h.workspaceId??p,root:p,name:Qc(p),sessionCount:0})}const l=new Map;for(const h of t){const p=la(h.root);l.has(p)||l.set(p,h.id)}const a=new Map;for(const h of n){const p=l.get(la(h.cwd))??h.workspaceId??h.cwd;a.set(p,(a.get(p)??0)+1)}const u=[];for(const h of t){const p=la(h.root);!s.has(p)&&!u.includes(p)&&u.push(p)}const c=[...r.keys()].filter(h=>!u.includes(h));c.sort((h,p)=>r.get(h).root.localeCompare(r.get(p).root));const d=[];for(const h of[...u,...c]){const p=r.get(h),m=a.get(p.id)??a.get(p.root)??0,g=o[p.id]===!1?m:Math.max(p.sessionCount,m);d.push({...p,sessionCount:g})}return d}function Tre(e,t){if(e===void 0||e.length===0)return;const n=t?.find(i=>i.id===e)??t?.find(i=>i.model===e);return n?.displayName||n?.model||(e.includes("/")?e.split("/").pop():e)}function Ere(e){if(!(e===void 0||e.length===0||e==="off"||e==="on"))return e}function Rm(e){if(e===void 0)return"toggle";const t=e.capabilities??[];return t.includes("always_thinking")?"always-on":t.includes("thinking")||e.adaptiveThinking===!0?"toggle":"unsupported"}function _z(e){return e?.supportEfforts??[]}function Lre(e){return e[Math.floor(e.length/2)]}function Hh(e){if(Rm(e)==="unsupported")return"off";const t=_z(e);return t.length>0?e?.defaultEffort??Lre(t):"on"}function Om(e){const t=_z(e),n=Rm(e);return t.length>0?n==="always-on"?[...t]:["off",...t]:n==="always-on"?["on"]:n==="unsupported"?["off"]:["on","off"]}function df(e){return e.length===0?e:e.charAt(0).toUpperCase()+e.slice(1)}function Nre(e){return e!=="off"}function kk(e,t){return Om(e).includes(t)}function d4(e,t){return t==="off"?"off":t==="on"?Hh(e):t}function x7(e,t){return t??Hh(e)}function Dre(e,t){if(e==="off")return{enabled:!1};if(e==="on")return{enabled:!0};const n=t?.at(-1);return n!==void 0&&e===n?{enabled:!0}:{enabled:!0,effort:e}}function S7(e,t){if(!e||typeof e!="object")return;const{enabled:n,effort:i}=e;if(n===!1)return kk(t,"off")?"off":void 0;if(typeof i=="string"&&kk(t,i))return i}function uT(e,t,n,i){return!n||e===void 0?t:S7(i,e)??Hh(e)}let Fre=0;function a9(e,t){const n=++Fre;return e.pendingThinkingBySession[t]=n,n}function za(e,t,n){return n===void 0||e.pendingThinkingBySession[t]!==n?!1:(delete e.pendingThinkingBySession[t],!0)}function _7(e,t,n){e.pendingThinkingBySession[t]===void 0&&(e.thinkingBySession[t]=n)}function Iz(){if(!(typeof window>"u"))return window.kimiDesktop}function iy(){return typeof Iz()?.getPathForFile=="function"}function f4(e){const t=Iz()?.getPathForFile;if(typeof t!="function")return null;try{return t(e)}catch{return null}}function cT(e){return f4(e)}function a8(e){return Array.from(e.dataTransfer?.items??[]).some(t=>t.kind==="file"&&t.type==="")}function vC(e,t=f4){const n=Array.from(e.dataTransfer?.items??[]);if(n.length===0){const l=Array.from(e.dataTransfer?.files??[]);return{files:l,folderPaths:[],items:l.map(a=>({kind:"file",file:a}))}}const i=[],o=[],s=[],r=new Set;for(const l of n){if(l.kind!=="file")continue;const a=l.getAsFile();if(a)if(l.webkitGetAsEntry()?.isDirectory===!0){const u=t(a);if(!u||r.has(u))continue;r.add(u),o.push(u),s.push({kind:"folder",path:u})}else i.push(a),s.push({kind:"file",file:a})}return{files:i,folderPaths:o,items:s}}function Rre(e,t=f4){return vC(e,t).folderPaths}function Ore(e,t=f4){const n=c=>`${c.size}:${c.type}:${c.name}`,i=[],o=new Set,s=new Set,r=[],l=new Set,a=[];let u=!1;for(const c of Array.from(e.items??[])){if(c.kind!=="file")continue;const d=c.getAsFile();if(c.webkitGetAsEntry?.()?.isDirectory===!0){u=!0,d&&s.add(n(d));const p=d?t(d):null;if(!p||l.has(p))continue;l.add(p),r.push(p),a.push({kind:"folder",path:p});continue}if(!d)continue;const h=n(d);o.has(h)||(o.add(h),i.push(d),a.push({kind:"file",file:d}))}for(const c of Array.from(e.files??[])){const d=n(c);s.has(d)||o.has(d)||(o.add(d),i.push(c),a.push({kind:"file",file:c}))}return{files:i,folderPaths:r,hasFolders:u,items:a}}function Mz(e,t,n){return e==="unsupported"?[{titleKey:n.titleKey,hintKey:n.hintKey,disabled:!1}]:t.map(i=>({...i,disabled:e==="pending"}))}function Pre(e,t,n){return n?e.filter(i=>i.sessions.length>0||i.workspace.id===t):e}const $re=/([\s\S]*?)<\/summary>/,Bre=/([\s\S]*?)<\/resume_hint>/,u8=/]*)>|<\/subagent>/g,zre="",dT=/(completed|failed|aborted):\s*(\d+)/g,fT=/([a-z_]+)="([^"]*)"/g;function jre(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function Hre(e){const t={};fT.lastIndex=0;let n;for(;(n=fT.exec(e))!==null;)t[n[1]]=jre(n[2]);return t}function Wre(e){const t={completed:0,failed:0,aborted:0};dT.lastIndex=0;let n;for(;(n=dT.exec(e))!==null;){const i=n[1];t[i]=Number(n[2])}return t}function qre(e,t){const n=Hre(e);return{outcome:n.outcome??"completed",item:n.item,agentId:n.agent_id,mode:n.mode,state:n.state,body:t.trim()}}function Ure(e){const t=[],n=[];u8.lastIndex=0;let i;for(;(i=u8.exec(e))!==null;)if(i[0]===zre){if(n.length===0)continue;const o=n.pop();o&&n.length===0&&t.push(qre(o.attrs,e.slice(o.bodyStart,i.index)))}else n.length===0?n.push({attrs:i[1]??"",bodyStart:u8.lastIndex}):n.push(null);return t}function Vre(e){if(e==null)return null;const t=Array.isArray(e)?e.join(` -`):e;if(!t.includes(""))return null;const n=$re.exec(t)?.[1]?.trim()??"",{completed:i,failed:o,aborted:s}=Wre(n),r=Bre.exec(t)?.[1]?.trim(),l=Ure(t),a=i+o+s;return{summary:n,completed:i,failed:o,aborted:s,total:a>0?a:l.length,subagents:l,resumeHint:r}}const Kre=3,Zre="Use TaskOutput with one of the task_id values above to read the full output.";function kh(e,t){return new RegExp(`^${t}: (.+)$`,"m").exec(e)?.[1]}function Gre(e,t){const n=Number(kh(e,t)??0);return Number.isFinite(n)?n:0}function Tz(e,t){return e.match(t)?.length??0}function hT(e,t,n){const i=new RegExp(`^\\[${t}\\]$`,"gm"),o=[];let s;for(;(s=i.exec(e))!==null;)s.index>=n&&o.push(s.index);return o}function pT(e,t){return t>=2&&e[t-1]===` -`&&e[t-2]===` -`}function mT(e,t,n){const i=e.slice(t+n.length+2),o=/^\[/m.exec(i);return(o===null?i:i.slice(0,o.index)).trim()}function Qre(e){return e.endsWith(Zre)}function Yre(e){const t=kh(e,"active_background_tasks");if(t===void 0)return!1;const n=Number(t);return Number.isFinite(n)?Tz(e,/^task_id: /gm)===n:!1}function Jre(e,t){return[...e.matchAll(/^description: (.+)$/gm)].map(i=>i[1]??"").slice(0,Math.min(Kre,t))}function Xre(e){if(e==null)return null;const t=Array.isArray(e)?e.join(` -`):e,n=/^\[/m.exec(t),i=n===null?t:t.slice(0,n.index),o=kh(i,"wait_status");if(o!=="completed"&&o!=="timed_out"&&o!=="no_tasks")return null;const s=Number(kh(i,"waited_ms")??0);let r,l=n?.index??t.length;o==="completed"&&n!==null&&t.slice(n.index).startsWith("[finished]")&&(r=mT(t,n.index,"finished"),l=n.index+10);let a=0,u=-1;for(const h of hT(t,"completed_during_wait",l)){if(!pT(t,h))continue;const p=mT(t,h,"completed_during_wait");Qre(p)&&(a=Tz(p,/^task_id: /gm),u=h)}let c=0,d=[];for(const h of hT(t,"still_running",l)){if(u>=0&&hc.replace(/\\/g,"/"),i=n(e);let o=n(t);o.length>1&&(o=o.replace(/\/+$/,""));const s=gT(o)||gT(i),r=s?o.toLowerCase():o,l=s?i.toLowerCase():i,a=r.endsWith("/")?r:`${r}/`;if(l!==r&&!l.startsWith(a))return null;const u=l===r?"":i.slice(a.length);return u.split("/").includes("..")?null:u||null}const hn={permission:"kimi-web.permission",permissionBySession:"kimi-web.permission-by-session",permissionExplicit:"kimi-web.permission-explicit",permissionStickyAt:"kimi-web.permission-sticky-at",permissionDaemonDefault:"kimi-web.permission-daemon-default",nonComposerPromptIds:"kimi-web.non-composer-prompt-ids",activeWorkspace:"kimi-active-workspace",planArmed:"kimi-web.plan-armed",swarmMode:"kimi-web.swarm-mode",goalMode:"kimi-web.goal-mode",fontScale:"kimi-web.font-scale",starredModels:"kimi-web.starred-models",unread:"kimi-web.unread",onboarded:"kimi-web.onboarded",colorScheme:"kimi-web.color-scheme",hiddenWorkspaces:"kimi-web.hidden-workspaces",collapsedWorkspaces:"kimi-web.collapsed-workspaces",workspaceOrder:"kimi-web.workspace-order",workspaceSort:"kimi-web.workspace-sort",workspaceRecencyFloor:"kimi-web.workspace-recency-floor",pinnedSessions:"kimi-web.pinned-sessions",pinnedCollapsed:"kimi-web.pinned-collapsed",workspaceNameOverrides:"kimi-web.workspace-name-overrides",notifyEnabled:"kimi-web.notify-enabled",notifySound:"kimi-web.notify-sound",inputHistory:"kimi-web.input-history",locale:"kimi-locale",clientId:"kimi-web.client-id",debug:"kimi-web.debug",openInDefaultTarget:"kimi-web.open-in.default-target",openInLastTarget:"kimi-web.open-in.last-target",sidebarCollapsed:"kimi-web.sidebar-collapsed",sidebarWidth:"kimi-web.sidebar-width",sidebarViewMode:"kimi-web.sidebar-view-mode",mobileSwitcherViewMode:"kimi-web.mobile-switcher-view-mode",diffViewMode:"kimi-web.diff-view-mode",sidebarPinnedHeight:"kimi-web.sidebar-pinned-height",shortcutOverrides:"kimi-web.shortcut-overrides",dockIconChoice:"kimi-web.dock-icon-choice",updateSkippedVersion:"kimi-web.update-skipped-version",canarySkippedVersion:"kimi-web.canary-skipped-version",planMode:"kimi-web.plan-mode",codeFont:"kimi-web.code-font",contentAlign:"kimi-web.content-align",theme:"kimi-web.theme",thinking:"kimi-web.thinking",accent:"kimi-web.accent",notifyOnComplete:"kimi-web.notify-on-complete",notifyOnQuestion:"kimi-web.notify-on-question",notifyOnApproval:"kimi-web.notify-on-approval",soundOnComplete:"kimi-web.sound-on-complete"},nle="__new__";function $d(e){return e&&e.length>0?e:nle}function bk(e){return`kimi-web.draft.${$d(e)}`}function vT(e){return`kimi-web.attachment-draft.${$d(e)}`}function wk(e){return`kimi-web.draft-atts.${$d(e)}`}function _o(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function $o(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function Hr(e){try{globalThis.localStorage.removeItem(e)}catch{}}function pc(e){const t=_o(e);if(t===null)return null;try{return JSON.parse(t)}catch{return null}}function Za(e,t){try{globalThis.localStorage.setItem(e,JSON.stringify(t))}catch{}}function yC(){const e=_o(hn.unread);if(!e)return{};try{const t=JSON.parse(e);if(!t||typeof t!="object")return{};const n={};for(const[i,o]of Object.entries(t))o===!0&&(n[i]=!0);return n}catch{return{}}}function yT(e){const n={...yC()};for(const[i,o]of Object.entries(e))o?n[i]=!0:delete n[i];$o(hn.unread,JSON.stringify(n))}function ile(){const e=pc(hn.collapsedWorkspaces);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function c8(e){Za(hn.collapsedWorkspaces,Array.from(e))}function ole(){return pc(hn.pinnedCollapsed)===!0}function kC(e){Za(hn.pinnedCollapsed,e)}function sle(){return _o(hn.sidebarViewMode)==="flat"?"flat":"grouped"}function rle(e){$o(hn.sidebarViewMode,e)}function lle(){return _o(hn.mobileSwitcherViewMode)==="grouped"?"grouped":"flat"}function ale(e){$o(hn.mobileSwitcherViewMode,e)}function ule(){return _o(hn.diffViewMode)==="tree"?"tree":"list"}function cle(e){$o(hn.diffViewMode,e)}function dle(){const e=pc(hn.workspaceOrder);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function kT(e){Za(hn.workspaceOrder,Array.from(e))}function fle(){return _o(hn.workspaceSort)==="recent"?"recent":"manual"}function hle(e){$o(hn.workspaceSort,e)}function ple(){const e=pc(hn.workspaceRecencyFloor);if(!e||typeof e!="object")return{};const t={};for(const[n,i]of Object.entries(e))typeof i=="number"&&Number.isFinite(i)&&(t[n]=i);return t}function bT(e){Za(hn.workspaceRecencyFloor,e)}function mle(){try{return _o(hn.activeWorkspace)}catch{return null}}function wT(e){try{$o(hn.activeWorkspace,e)}catch{}}function gle(){try{const e=_o(hn.hiddenWorkspaces);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function CT(e){try{$o(hn.hiddenWorkspaces,JSON.stringify(e))}catch{}}function Ez(){const e=pc(hn.pinnedSessions);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function d8(e){Za(hn.pinnedSessions,Array.from(e))}function Ck(){const e=pc(hn.workspaceNameOverrides);if(!e||typeof e!="object")return{};const t={};for(const[n,i]of Object.entries(e))typeof i=="string"&&(t[n]=i);return t}function AT(e){Za(hn.workspaceNameOverrides,e)}function ff(e){return e==="manual"||e==="auto"||e==="yolo"?e:void 0}function xT(){return ff(_o(hn.permission))??"manual"}function vle(e){$o(hn.permission,e)}function ST(){const e=_o(hn.permissionStickyAt),t=Number(e);return Number.isFinite(t)&&t>0?t:e===null&&_o(hn.permission)!==null?1:0}function Vp(e){$o(hn.permissionStickyAt,String(e))}function Lz(e){const t=_o(e);if(!t)return{};try{const n=JSON.parse(t);if(!n||typeof n!="object"||Array.isArray(n))return{};const i={};for(const[o,s]of Object.entries(n)){const r=ff(s);r!==void 0&&(i[o]=r)}return i}catch{return{}}}function Nz(e,t){$o(e,JSON.stringify(t))}function _T(){return Lz(hn.permissionBySession)}function f8(e){Nz(hn.permissionBySession,e)}function IT(){return Lz(hn.permissionExplicit)}function yle(e){Nz(hn.permissionExplicit,e)}const MT={manual:0,yolo:1,auto:2};function kle(e){let t="auto",n=!1;for(const i of e)i!==void 0&&(n=!0,MT[i]typeof n=="number"&&Number.isFinite(n)&&n>0).slice(0,2);return t.length===0?Dz:Math.round(t.reduce((n,i)=>n+i,0))}function Fz(e){return e==null||!Number.isFinite(e)||e<=0?Dz:Math.round(e)}const bC=96;function Ale(e,t,n){const i=e.filter(r=>r.visible),o=i[0],s=i[2];return{firstRowHeight:o?o.height:null,spanToThirdRow:s?s.viewportBottom-t+n:null}}function xle(e,t,n){const i=s=>s!=null&&Number.isFinite(s)&&s>0;return(s=>s!=null&&Number.isFinite(s)&&s>=0)(t)?i(e)?Math.round(e)+Math.round(t):i(n)?Math.round(n)*3+Math.round(t):bC:bC}function Sle(e){return e>wle}function TT(e){return Math.round(e*.4)}function _le(e){return e==null||!Number.isFinite(e)||e<=0?bC:Math.round(e)}function Ile(e,t,n,i){const o=Fz(n),s=_le(i),r=Math.max(o,Math.round(e*.6));if(t===void 0||!Number.isFinite(t))return r;const l=Math.round(t)-s;return Math.max(o,Math.min(r,l))}function h8(e,t,n){return t==null||!Number.isFinite(t)?e:Math.max(Fz(n),Math.min(e,Math.round(t)))}function Mle(e,t,n,i){return Math.max(Math.round(i),Math.min(Math.round(e+t),Math.round(n)))}function Tle(e,t){return t===null||t===e}const M7="application/x-kimi-session-row";function Ele(e,t){return e.includes(t)?e:[...e,t]}function Lle(e,t){return e.includes(t)?e.filter(n=>n!==t):e}function Nle(e,t){const n=new Set(t),i=new Map,o=[];for(const r of e)n.has(r.id)?i.set(r.id,r):o.push(r);const s=[];for(const r of t){const l=i.get(r);l!==void 0&&s.push(l)}return{pinned:s,unpinned:o}}const Dle={"&":"&","<":"<",">":">",'"':""","'":"'"};function C0(e){return e.replace(/[&<>"']/g,t=>Dle[t]??t)}function Fle(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Rle(e,t,n=40){const i=e.replace(/\s+/g," ").trim();if(i.length===0)return"";const o=t.trim();if(o.length===0)return ET(i,n*2);const s=i.toLowerCase().indexOf(o.toLowerCase());if(s<0)return ET(i,n*2);const r=Math.max(0,s-n),l=Math.min(i.length,s+o.length+n),a=r>0,u=l`${s}`)}const Rz=/([\s\S]*?)<\/kbd>/g;function Oz(e){let t="",n=0;for(const i of e.matchAll(Rz))t+=C0(e.slice(n,i.index)),t+=`${C0(i[1]??"")}`,n=i.index+i[0].length;return t+C0(e.slice(n))}function Ole(e){return e.replace(Rz,"$1")}let Ple=0;function $le(e,t){const n=++Ple;return e.pendingPlanBySession[t]=n,n}function T7(e,t,n){return n===void 0||e.pendingPlanBySession[t]!==n?!1:(delete e.pendingPlanBySession[t],!0)}function wC(e,t,n){e.pendingPlanBySession[t]===void 0&&(e.planModeBySession[t]=n)}function Ble(e,t,n){return e.find(i=>i.window?.duration===t&&i.window?.unit===n)}const zle=30;function jle(e){return e!==void 0&&e0?(l.push(t("settings.planUsage.durationDay",{n:o})),l.push(t("settings.planUsage.durationHour",{n:s})),l.push(t("settings.planUsage.durationMinute",{n:r}))):s>0?(l.push(t("settings.planUsage.durationHour",{n:s})),l.push(t("settings.planUsage.durationMinute",{n:r}))):r>0?l.push(t("settings.planUsage.durationMinute",{n:r})):l.push(t("settings.planUsage.durationSecond",{n:i})),t("settings.planUsage.resetsIn",{duration:l.join(" ")})}function CC(e,t){if(t<=0)return"ok";const n=e/t;return n>=.85?"danger":n>=.5?"warn":"ok"}function u9(e,t){return t<=0?0:Math.min(100,Math.round(e/t*100))}function Hle(e,t){const n=(e/100).toFixed(2);switch(t.toUpperCase()){case"CNY":return{symbol:"¥",number:n};case"USD":return{symbol:"$",number:n};default:return{symbol:"",number:`${n} ${t}`}}}const Bz="kimiWeb.compaction",zz="managed:kimi-code",Wle=["kimi","openai","openai_responses","anthropic","google-genai","vertexai"];function oy(){return{model:"",maxContextSize:"",displayName:"",capabilities:["tool_use","thinking"],supportEfforts:[],adaptiveThinking:!0}}function AC(e,t){const n=[];for(const i of Object.values(t??{})){if(i===null||typeof i!="object")continue;const o=i;o.provider===e.id&&n.push({model:typeof o.model=="string"?o.model:"",maxContextSize:typeof o.maxContextSize=="number"?String(o.maxContextSize):"",displayName:typeof o.displayName=="string"?o.displayName:"",capabilities:Array.isArray(o.capabilities)?o.capabilities.filter(s=>typeof s=="string"):[],supportEfforts:Array.isArray(o.supportEfforts)?o.supportEfforts.filter(s=>typeof s=="string"):[],...typeof o.adaptiveThinking=="boolean"?{adaptiveThinking:o.adaptiveThinking}:{}})}return n}const jz=/^[\p{L}\p{N}][\p{L}\p{N}\-_ ]*$/u;function qle(e,t={}){const n=e.id.trim();if(n==="")return"idRequired";if(!jz.test(n))return"idInvalid";if(t.requireApiKey===!0&&e.apiKey.trim()==="")return"apiKeyRequired";if(t.requireBaseUrl===!0&&e.baseUrl.trim()==="")return"baseUrlRequired";if(e.models.length===0)return"modelRequired";for(const i of e.models){if(i.model.trim()==="")return"modelRequired";const o=i.maxContextSize.trim();if(o==="")return"contextSizeRequired";if(!/^\d+$/.test(o)||Number(o)<1)return"contextSizeInvalid"}return null}function Hz(e){return e.map(t=>{const n=t.displayName.trim();return{model:t.model.trim(),maxContextSize:Number(t.maxContextSize.trim()),...t.capabilities.length>0?{capabilities:[...t.capabilities]}:{},...t.supportEfforts.length>0?{supportEfforts:[...t.supportEfforts]}:{},...t.adaptiveThinking!==void 0?{adaptiveThinking:t.adaptiveThinking}:{},...n===""?{}:{displayName:n}}})}function Ule(e){const t=e.apiKey.trim(),n=e.baseUrl.trim();return{id:e.id.trim(),type:e.type,models:Hz(e.models),...t===""?{}:{apiKey:t},...n===""?{}:{baseUrl:n}}}function Vle(e,t,n){const i=Hz(e.models),o=e.id.trim(),s=e.apiKey.trim(),r=e.baseUrl.trim(),l=n?.existingDefaultModel?.trim()??"",a=l.indexOf("/")>=0?l.slice(l.indexOf("/")+1):l;return{...t!==void 0&&o!==""&&o!==t.id?{newId:o}:{},type:e.type,models:i,...s===""&&n?.includeBlankApiKey!==!0?{}:{apiKey:s},...r===""?{}:{baseUrl:r},...a!==""&&i.some(u=>u.model===a)?{defaultModel:a}:{}}}function Wz(e){return e.id===zz&&e.type==="kimi"}function Kle(e,t){return t.startsWith("image/")||t==="application/pdf"?!0:e.toLowerCase().endsWith(".pdf")}const Ak="/devices/",qz="kimi-rc-device-id";function Zle(e){return new URLSearchParams(e.search).get("rc")==="1"}function Uz(e){const{pathname:t}=e;if(!t.startsWith(Ak))return;const n=t.slice(Ak.length).split("/")[0];if(n)try{const i=decodeURIComponent(n);return i.length>0?i:void 0}catch{return}}function Gle(e){if(Uz({pathname:e})===void 0)return e;const t=e.slice(Ak.length),n=t.indexOf("/");return n<0?"/":t.slice(n)}function Qle(e){return`${Ak}${encodeURIComponent(e)}/`}function Vz(e,t){const n=new URLSearchParams(t),i=n.get("rc"),o=n.get("from");if(i===null&&o===null)return e;const s=new URLSearchParams;return i!==null&&s.set("rc",i),o!==null&&s.set("from",o),`${e}?${s.toString()}`}function Yle(e){const t=Uz(e);return t!==void 0?(Xle(t),t):Jle()}function Jle(){try{return window.sessionStorage.getItem(qz)??void 0}catch{return}}function Xle(e){try{window.sessionStorage.setItem(qz,e)}catch{}}const eae=/^(\d+)\t(.*)$/;function tae(e){const t=e.at(-1)===""?e.slice(0,-1):e;if(t.length===0)return null;const n=[],i=[];for(const o of t){const s=eae.exec(o);if(!s)return null;i.push(Number(s[1])),n.push(s[2]??"")}return{contents:n,lineNumbers:i}}function LT(e,t){let n="",i=t;const o=/^((?:\\\\|\/\/)[^\\/]+[\\/][^\\/]+)/.exec(t),s=/^([a-zA-Z]:)[\\/]?/.exec(t);o?(n=o[1],i=t.slice(o[1].length)):t.startsWith("/")?(n="/",i=t.slice(1)):s&&(n=s[1],i=t.slice(s[0].length));const r=n!=="",l=i.split(/[\\/]+/).filter(Boolean);for(const u of e.split("/"))u===""||u==="."||(u===".."?l.length>0&&l[l.length-1]!==".."?l.pop():r||l.push(".."):l.push(u));const a=l.join("/");return n==="/"?`/${a}`:n!==""?a?`${n}/${a}`:`${n}/`:a}function Kz(e,t){for(const n of e.stateMachineNames){const i=(e.stateMachineInputs(n)??[]).find(o=>o.name===t);if(i!==void 0)return i}return null}function nae(e,t){const n=Kz(e,t);return n!==null&&typeof n.fire=="function"?(n.fire(),!0):!1}function NT(e,t,n){const i=Kz(e,t);return i!==null&&typeof i.value==typeof n?(i.value=n,!0):!1}const p8={isPageHidden:()=>typeof document<"u"&&document.hidden,onVisibilityChange:e=>typeof document>"u"?()=>{}:(document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)),observeIntersection:(e,t)=>{if(typeof IntersectionObserver!="function")return()=>{};const n=new IntersectionObserver(i=>{const o=i[0];o!==void 0&&t(o.isIntersecting)});return n.observe(e),()=>n.disconnect()}};function Zz(e,t,n={}){const i=n.isPageHidden??p8.isPageHidden,o=n.onVisibilityChange??p8.onVisibilityChange,s=n.observeIntersection??p8.observeIntersection;let r=!i(),l=!0,a=!1;function u(){const h=!r||!l;h!==a&&(a=h,a?e.pause():e.play())}const c=o(()=>{r=!i(),u()}),d=s(t,h=>{l=h,u()});return u(),()=>{c(),d()}}const Rr="kimi-web.server-credential",iae="token",oae=10080*60*1e3;let Ju;const xC=new Set;function sae(){if(typeof window>"u")return;const e=window.location.hash??"";if(!e.startsWith("#"))return;const n=new URLSearchParams(e.slice(1)).get(iae);if(!n)return;const i=new URL(window.location.href);return i.hash="",window.history.replaceState(window.history.state,"",`${i.pathname}${i.search}`),n}function SC(e){return{version:1,credential:e,expiresAt:Date.now()+oae}}function rae(e){return JSON.stringify(e)}function E7(e){try{const t=JSON.parse(e);if(typeof t!="object"||t===null)return;const n=t;return n.version!==1||typeof n.credential!="string"||n.credential.length===0||typeof n.expiresAt!="number"||!Number.isFinite(n.expiresAt)?void 0:{version:1,credential:n.credential,expiresAt:n.expiresAt}}catch{return}}function _C(e){globalThis.localStorage?.setItem(Rr,rae(e))}function lae(){try{const e=globalThis.localStorage?.getItem(Rr);if(e){const n=E7(e);if(n===void 0){const i=SC(e);let o=!1;try{_C(i),o=!0}catch{}if(!o)try{globalThis.localStorage?.getItem(Rr)===e&&globalThis.localStorage?.removeItem(Rr),o=!0}catch{}try{globalThis.sessionStorage?.removeItem(Rr)}catch{}return o?i:void 0}if(n.expiresAt>Date.now())return n;globalThis.sessionStorage?.removeItem(Rr),globalThis.localStorage?.getItem(Rr)===e&&globalThis.localStorage?.removeItem(Rr);return}const t=globalThis.sessionStorage?.getItem(Rr);if(t){const n=SC(t);let i=!1;try{_C(n),i=!0}catch{}try{globalThis.sessionStorage?.removeItem(Rr),i=!0}catch{}return i?n:void 0}return}catch{return}}function aae(){const e=sae();return e?(Gz(e),!0):(Ju=lae(),Ju!==void 0)}function uae(){if(Ju!==void 0){if(Ju.expiresAt<=Date.now()){cae(Ju);return}return Ju.credential}}function cae(e){Ju=void 0;try{globalThis.sessionStorage?.removeItem(Rr);const t=globalThis.localStorage?.getItem(Rr),n=t==null?void 0:E7(t);(n===void 0?t===e.credential:n.credential===e.credential&&n.expiresAt===e.expiresAt)&&globalThis.localStorage?.removeItem(Rr)}catch{}}function Gz(e){const t=SC(e);Ju=t;try{_C(t)}catch{}try{globalThis.sessionStorage?.removeItem(Rr)}catch{}}function dae(){const e=Ju;Ju=void 0;try{const t=globalThis.localStorage?.getItem(Rr),i=(t==null?void 0:E7(t))?.credential??t;e!==void 0&&i===e.credential&&globalThis.localStorage?.removeItem(Rr),globalThis.sessionStorage?.removeItem(Rr)}catch{}}function fae(e){return xC.add(e),()=>{xC.delete(e)}}function hae(){dae();for(const e of xC)try{e()}catch{}}function Jv(e){return e.approvalCount>0?"awaiting-approval":e.questionCount>0?"awaiting-question":e.pendingInteraction==="approval"?"awaiting-approval":e.pendingInteraction==="question"?"awaiting-question":e.busy?"running":e.lastTurnReason==="failed"?"aborted":e.unread?"unread":"idle"}function DT(e){let t=null;for(const n of e){const i=Jv(n);if(i==="awaiting-approval")return"approval";i==="awaiting-question"?t="question":i==="aborted"?t!=="question"&&(t="aborted"):i==="unread"&&t===null&&(t="unread")}return t}let FT;function pae(e){if(typeof Intl.Segmenter=="function")return FT??=new Intl.Segmenter("und",{granularity:"grapheme"}),FT.segment(e)}const mae=/\p{Emoji_Presentation}/u,gae=/\p{Regional_Indicator}/u,vae=/\p{Extended_Pictographic}/u,yae="️";function kae(e){return mae.test(e)||gae.test(e)?!0:vae.test(e)&&e.includes(yae)}function Qz(e){const t=pae(e)?.[Symbol.iterator]().next().value;if(t===void 0||!kae(t.segment))return{emoji:null,rest:e};const n=e.slice(t.index+t.segment.length).replace(/^\s+/,"");return{emoji:t.segment,rest:n}}function bae(e,t){const{rest:n}=Qz(e),i=t?.trim()??"";return i?n?`${i} ${n}`:i:n}function Yz(e,t){const n=e.findIndex(s=>s.id===t.id);if(n!==-1&&e[n].updatedAt===t.updatedAt)return e.map(s=>s.id===t.id?t:s);const i=e.filter(s=>s.id!==t.id),o=i.findIndex(s=>s.updatedAt0?i:void 0}catch{return}}function wae(e){return e===void 0||e.length===0?"/":`${IC}${encodeURIComponent(e)}`}function Xz(){if(typeof navigator>"u")return!1;if(/Mac|iPod|iPhone|iPad/.test(navigator.platform))return!0;const e=navigator.userAgentData;return e?.platform==="macOS"||e?.platform==="iOS"}function Cae(e,t=Xz()){return(t?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey)&&!e.altKey&&!e.shiftKey&&(e.code==="KeyA"||e.key.toLowerCase()==="a")&&!e.defaultPrevented}function Aae(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement&&(e.isContentEditable||e.closest("input, textarea")!==null)}function xae(e,t){return typeof Element>"u"||!(e instanceof Element)?null:e.closest(t)}function PT(e){e.ownerDocument.getSelection()?.selectAllChildren(e)}function Sae(e,t=Xz()){return(t?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey)&&!e.altKey&&!e.shiftKey&&(e.code==="KeyK"||e.key.toLowerCase()==="k")&&!e.defaultPrevented}const _ae=[{pattern:/\brm\s+(?:-[a-zA-Z]*[rf][a-zA-Z]*|--recursive|--force)\b/,detail:"rm -rf"},{pattern:/\bsudo\b/,detail:"sudo"},{pattern:/\bmkfs(?:\.[a-z0-9]+)?\b/,detail:"mkfs"},{pattern:/\bdd\b[^|;&]*\bof=/,detail:"dd of=…"},{pattern:/>\s*\/dev\/(?:sd|nvme|disk|hd)/,detail:"> /dev/…"},{pattern:/:\(\)\s*\{/,detail:"fork bomb"},{pattern:/\bgit\s+push\b[^|;&]*(?:--force(?:-with-lease)?\b|\s-f\b)/,detail:"git push --force"},{pattern:/\bchmod\s+(?:-[a-zA-Z]+\s+)*777\b/,detail:"chmod 777"},{pattern:/\b(?:curl|wget)\b[^|;&]*\|\s*(?:sudo\s+)?(?:ba|z)?sh\b/,detail:"curl | sh"},{pattern:/\b(?:shutdown|reboot|poweroff|halt)\b/,detail:"shutdown / reboot"}];function Iae(e){const t=e.replace(/"[^"]*"|'[^']*'/g," ");for(const{pattern:n,detail:i}of _ae)if(n.test(t))return i}function Nf(e){return Array.isArray?Array.isArray(e):tj(e)==="[object Array]"}function Mae(e){if(typeof e=="string")return e;if(typeof e=="bigint")return e.toString();const t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function MC(e){return e==null?"":Mae(e)}function tl(e){return typeof e=="string"}function c9(e){return typeof e=="number"}function Tae(e){return e===!0||e===!1||Eae(e)&&tj(e)=="[object Boolean]"}function ej(e){return typeof e=="object"}function Eae(e){return ej(e)&&e!==null}function aa(e){return e!=null}function sy(e){return!e.trim().length}function tj(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const Lae="Incorrect 'index' type",TC="Invalid doc index: must be a non-negative integer within the bounds of the docs array",Nae=e=>`Invalid value for key ${e}`,Dae=e=>`Pattern length exceeds max of ${e}.`,Fae=e=>`Missing ${e} property in key`,Rae=e=>`Property 'weight' in key '${e}' must be a positive integer`,Oae="Fuse.match does not support useTokenSearch: token search requires corpus-level statistics (df, fieldCount) that a one-off string comparison does not have. Use new Fuse(...).search(...) instead.",$T=Object.prototype.hasOwnProperty;var Pae=class{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(n=>{const i=nj(n);this._keys.push(i),this._keyMap[i.id]=i,t+=i.weight}),this._keys.forEach(n=>{n.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}};function nj(e){let t=null,n=null,i=null,o=1,s=null;if(tl(e)||Nf(e))i=e,t=BT(e),n=d9(e);else{if(!$T.call(e,"name"))throw new Error(Fae("name"));const r=e.name;if(i=r,$T.call(e,"weight")&&e.weight!==void 0&&(o=e.weight,o<=0))throw new Error(Rae(d9(r)));t=BT(r),n=d9(r),s=e.getFn??null}return{path:t,id:n,weight:o,src:i,getFn:s}}function BT(e){return Nf(e)?e:e.split(".")}function d9(e){return Nf(e)?e.join("."):e}function $ae(e,t){const n=[];let i=!1;const o=(s,r,l,a)=>{if(aa(s))if(!r[l])n.push(a!==void 0?{v:s,i:a}:s);else{const u=s[r[l]];if(!aa(u))return;if(l===r.length-1&&(tl(u)||c9(u)||Tae(u)||typeof u=="bigint"))n.push(a!==void 0?{v:MC(u),i:a}:MC(u));else if(Nf(u)){i=!0;for(let c=0,d=u.length;ce.score===t.score?e.idx=9&&e<=13||e===32||e===160}function qae(e=1,t=3){const n=new Map,i=Math.pow(10,t);return{get(o){let s=0,r=!1;for(let a=0;a{this._keysMap[t.id]=n})}create(){if(this.isCreated||!this.docs.length)return;this.isCreated=!0;const e=this.docs.length;this.records=new Array(e);let t=0;if(tl(this.docs[0]))for(let n=0;ne&&(this.records[t].i-=1)}removeAll(e){const t=new Set;for(const i of e)Number.isInteger(i)&&i>=0&&t.add(i);if(t.size===0)return;this.records=this.records.filter(i=>!t.has(i.i));const n=Array.from(t).sort((i,o)=>i-o);for(const i of this.records){let o=0,s=n.length;for(;o>>1;n[r]t),records:this.records}}};function ij(e,t,{getFn:n=Vn.getFn,fieldNormWeight:i=Vn.fieldNormWeight}={}){const o=new L7({getFn:n,fieldNormWeight:i});return o.setKeys(e.map(nj)),o.setSources(t),o.create(),o}function Uae(e,{getFn:t=Vn.getFn,fieldNormWeight:n=Vn.fieldNormWeight}={}){const{keys:i,records:o}=e,s=new L7({getFn:t,fieldNormWeight:n});return s.setKeys(i),s.setIndexRecords(o),s}function Vae(e=[],t=Vn.minMatchCharLength){const n=[];let i=-1,o=-1,s=0;for(let r=e.length;s=t&&n.push([i,o]),i=-1)}return e[s-1]&&s-i>=t&&n.push([i,s-1]),n}function Kae(e,t,n,{location:i=Vn.location,distance:o=Vn.distance,threshold:s=Vn.threshold,findAllMatches:r=Vn.findAllMatches,minMatchCharLength:l=Vn.minMatchCharLength,includeMatches:a=Vn.includeMatches,ignoreLocation:u=Vn.ignoreLocation}={}){if(t.length>32)throw new Error(Dae(32));const c=t.length,d=e.length,h=Math.max(0,Math.min(i,d));let p=s,m=h;const g=(x,A)=>{const E=x/c;if(u)return E;const I=Math.abs(h-A);return o?E+I/o:I?1:E},y=l>1||a,b=y?Array(d):[];let v;for(;(v=e.indexOf(t,m))>-1;){const x=g(0,v);if(p=Math.min(x,p),m=v+c,y){let A=0;for(;A=I;z-=1){const F=z-1,O=n[e[F]];if(W[z]=(W[z+1]<<1|1)&O,x&&(W[z]|=(C[z+1]|C[z])<<1|1|C[z+1]),W[z]&T&&(w=g(x,F),w<=p)){if(p=w,m=F,M=x,m<=h)break;I=Math.max(1,2*h-m)}}if(g(x+1,h)>p)break;C=W}if(y&&m>=0){const x=Math.min(d-1,m+c-1+M);for(let A=m;A<=x;A+=1)n[e[A]]&&(b[A]=1)}const S={isMatch:m>=0,score:Math.max(.001,w)};if(y){const x=Vae(b,l);x.length?a&&(S.indices=x):S.isMatch=!1}return S}function Zae(e){const t={};for(let n=0,i=e.length;nn[0]-i[0]||n[1]-i[1]);const t=[e[0]];for(let n=1,i=e.length;ne.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"").replace(Gae,t=>oj[t]):e=>e;var D7=class{constructor(e,{location:t=Vn.location,threshold:n=Vn.threshold,distance:i=Vn.distance,includeMatches:o=Vn.includeMatches,findAllMatches:s=Vn.findAllMatches,minMatchCharLength:r=Vn.minMatchCharLength,isCaseSensitive:l=Vn.isCaseSensitive,ignoreDiacritics:a=Vn.ignoreDiacritics,ignoreLocation:u=Vn.ignoreLocation}={}){if(this.options={location:t,threshold:n,distance:i,includeMatches:o,findAllMatches:s,minMatchCharLength:r,isCaseSensitive:l,ignoreDiacritics:a,ignoreLocation:u},e=l?e:e.toLowerCase(),e=a?vv(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const c=(h,p)=>{this.chunks.push({pattern:h,alphabet:Zae(h),startIndex:p})},d=this.pattern.length;if(d>32){let h=0;const p=d%32,m=d-p;for(;h{const{isMatch:b,score:v,indices:C}=Kae(e,m,g,{location:o+y,distance:s,threshold:r,findAllMatches:l,minMatchCharLength:a,includeMatches:i,ignoreLocation:u});b&&(h=!0),d+=v,b&&C&&c.push(...C)});const p={isMatch:h,score:h?d/this.chunks.length:1};return h&&i&&(p.indices=N7(c)),p}};const Qae=new Set(["fuzzy","include"]);function Yae(e){return e.startsWith("inverse")}const EC=[{type:"exact",multiRegex:/^="(.*)"$/,singleRegex:/^=(.*)$/,create:e=>({type:"exact",search(t){const n=t===e;return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}})},{type:"include",multiRegex:/^'"(.*)"$/,singleRegex:/^'(.*)$/,create:e=>({type:"include",search(t){let n=0,i;const o=[],s=e.length;for(;(i=t.indexOf(e,n))>-1;)n=i+s,o.push([i,n-1]);const r=!!o.length;return{isMatch:r,score:r?0:1,indices:o}}})},{type:"prefix-exact",multiRegex:/^\^"(.*)"$/,singleRegex:/^\^(.*)$/,create:e=>({type:"prefix-exact",search(t){const n=t.startsWith(e);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}})},{type:"inverse-prefix-exact",multiRegex:/^!\^"(.*)"$/,singleRegex:/^!\^(.*)$/,create:e=>({type:"inverse-prefix-exact",search(t){const n=!t.startsWith(e);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}})},{type:"inverse-suffix-exact",multiRegex:/^!"(.*)"\$$/,singleRegex:/^!(.*)\$$/,create:e=>({type:"inverse-suffix-exact",search(t){const n=!t.endsWith(e);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}})},{type:"suffix-exact",multiRegex:/^"(.*)"\$$/,singleRegex:/^(.*)\$$/,create:e=>({type:"suffix-exact",search(t){const n=t.endsWith(e);return{isMatch:n,score:n?0:1,indices:[t.length-e.length,t.length-1]}}})},{type:"inverse-exact",multiRegex:/^!"(.*)"$/,singleRegex:/^!(.*)$/,create:e=>({type:"inverse-exact",search(t){const n=t.indexOf(e)===-1;return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}})},{type:"fuzzy",multiRegex:/^"(.*)"$/,singleRegex:/^(.*)$/,create:(e,t={})=>{const n=new D7(e,{location:t.location??Vn.location,threshold:t.threshold??Vn.threshold,distance:t.distance??Vn.distance,includeMatches:t.includeMatches??Vn.includeMatches,findAllMatches:t.findAllMatches??Vn.findAllMatches,minMatchCharLength:t.minMatchCharLength??Vn.minMatchCharLength,isCaseSensitive:t.isCaseSensitive??Vn.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics??Vn.ignoreDiacritics,ignoreLocation:t.ignoreLocation??Vn.ignoreLocation});return{type:"fuzzy",search(i){return n.searchIn(i)}}}}],zT=EC.length,Jae="\0",Xae="|";function eue(e){const t=[],n=e.length;let i=0;for(;i=n)break;let o=i;for(;o=n||e[s]===" "){o++;break}if(e[s]==="$"&&(s+1>=n||e[s+1]===" ")){o+=2;break}}o++}t.push(e.substring(i,o)),i=o}else{for(;o{const i=eue(n.replace(/\u0000/g,"|").trim()).filter(s=>s&&!!s.trim()),o=[];for(let s=0,r=i.length;s!!(e[Sk.AND]||e[Sk.OR]),iue=e=>!!e[NC.PATH],oue=e=>!Nf(e)&&ej(e)&&!DC(e),HT=e=>({[Sk.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function sj(e,t,{auto:n=!0}={}){const i=o=>{if(tl(o)){const a={keyId:null,pattern:o};return n&&(a.searcher=xk(o,t)),a}const s=Object.keys(o),r=iue(o);if(!r&&s.length>1&&!DC(o))return i(HT(o));if(oue(o)){const a=r?o[NC.PATH]:s[0],u=r?o[NC.PATTERN]:o[a];if(!tl(u))throw new Error(Nae(a));const c={keyId:d9(a),pattern:u};return n&&(c.searcher=xk(u,t)),c}const l={children:[],operator:s[0]};return s.forEach(a=>{const u=o[a];Nf(u)&&u.forEach(c=>{l.children.push(i(c))})}),l};return DC(e)||(e=HT(e)),i(e)}function FC(e,{ignoreFieldNorm:t=Vn.ignoreFieldNorm}){let n=1;return e.forEach(({key:i,norm:o,score:s})=>{const r=i?i.weight:null;n*=Math.pow(s===0&&r?Number.EPSILON:s,(r||1)*(t?1:o))}),n}function sue(e,{ignoreFieldNorm:t=Vn.ignoreFieldNorm}){e.forEach(n=>{n.score=FC(n.matches,{ignoreFieldNorm:t})})}var rue=class{constructor(e,t){this.limit=e,this.heap=[],this.comparator=t}get size(){return this.heap.length}insert(e){this.size0;){const n=e-1>>1;if(this.comparator(t[e],t[n])<=0)break;const i=t[e];t[e]=t[n],t[n]=i,e=n}}_sinkDown(e){const t=this.heap,n=t.length;let i=e;do{e=i;const o=2*e+1,s=2*e+2;if(o0&&(i=o),s0&&(i=s),i!==e){const r=t[e];t[e]=t[i],t[i]=r}}while(i!==e)}};function lue(e){const t=[];return e.matches.forEach(n=>{if(!aa(n.indices)||!n.indices.length)return;const i={indices:n.indices,value:n.value};n.key&&(i.key=n.key.id),n.idx>-1&&(i.refIndex=n.idx),t.push(i)}),t}function aue(e,t,{includeMatches:n=Vn.includeMatches,includeScore:i=Vn.includeScore}={}){return e.map(o=>{const{idx:s}=o,r={item:t[s],refIndex:s};return n&&(r.matches=lue(o)),i&&(r.score=o.score),r})}const uue=/[\p{L}\p{M}\p{N}_]+/gu,WT=new WeakSet;function cue(e){WT.has(e)||(WT.add(e),console.warn(`[Fuse] tokenize regex ${e} lacks the global flag; only the first match per text will be returned. Add the 'g' flag.`))}function due(e){if(typeof e=="function"){let t=!1;return n=>{const i=e(n);if(!t&&(t=!0,!Array.isArray(i)||i.some(o=>typeof o!="string")))throw new Error(`[Fuse] tokenize function must return string[]; received ${Array.isArray(i)?"array containing non-strings":typeof i}.`);return i}}return e instanceof RegExp?(e.global||cue(e),t=>t.match(e)||[]):t=>t.match(uue)||[]}function RC({isCaseSensitive:e=!1,ignoreDiacritics:t=!1,tokenize:n}={}){const i=due(n);return{tokenize(o){return e||(o=o.toLowerCase()),t&&(o=vv(o)),i(o)}}}var fue=class{static condition(e,t){return t.useTokenSearch}constructor(e,t){this.options=t,this.analyzer=RC({isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,tokenize:t.tokenize});const n=this.analyzer.tokenize(e),{df:i,fieldCount:o}=t._invertedIndex;this.termSearchers=[],this.idfWeights=[];for(const s of n){this.termSearchers.push(new D7(s,{location:t.location,threshold:t.threshold,distance:t.distance,includeMatches:t.includeMatches,findAllMatches:t.findAllMatches,minMatchCharLength:t.minMatchCharLength,isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,ignoreLocation:!0}));const r=i.get(s)||0,l=Math.log(1+(o-r+.5)/(r+.5));this.idfWeights.push(l)}this.combineAll=t.tokenMatch==="all",this.numTerms=this.termSearchers.length,this.useMask=this.numTerms<=31}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};const t=[];let n=0,i=0,o=0,s=0;const r=this.combineAll&&!this.useMask?new Set:null;for(let u=0;u0?1-n/i:0,a={isMatch:!0,score:Math.max(.001,l)};return this.options.includeMatches&&t.length&&(a.indices=N7(t)),this.combineAll&&(this.useMask?a.matchedMask=s:a.matchedTerms=r,a.termCount=this.numTerms),a}};function m8(e,t,n,i){const o=i.tokenize(t);if(!o.length)return;e.fieldCount++,e.docFieldCount.set(n,(e.docFieldCount.get(n)||0)+1);const s=new Set(o);let r=e.docTermFieldHits.get(n);r||(r=new Map,e.docTermFieldHits.set(n,r));for(const l of s)r.set(l,(r.get(l)||0)+1),e.df.set(l,(e.df.get(l)||0)+1)}function rj(e,t,n,i){const{i:o,v:s,$:r}=t;if(s!==void 0){m8(e,s,o,i);return}if(r)for(let l=0;ll-a);for(const l of n)mue(e,l);const i=l=>{let a=0,u=n.length;for(;a>>1;n[c]o?i(l):l,a);e.docFieldCount=s;const r=new Map;for(const[l,a]of e.docTermFieldHits)r.set(l>o?i(l):l,a);e.docTermFieldHits=r}var Df=class{constructor(e,t,n){this.options={...Vn,...t},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new Pae(this.options.keys),this._docs=e,this._myIndex=null,this._invertedIndex=null,this.setCollection(e,n),this._lastQuery=null,this._lastSearcher=null}_getSearcher(e){if(this._lastQuery===e)return this._lastSearcher;const t=xk(e,this._invertedIndex?{...this.options,_invertedIndex:this._invertedIndex}:this.options);return this._lastQuery=e,this._lastSearcher=t,t}setCollection(e,t){if(this._docs=e,t&&!(t instanceof L7))throw new Error(Lae);if(this._myIndex=t||ij(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){const n=RC({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});this._invertedIndex=hue(this._myIndex.records,this._myIndex.keys.length,n)}this._invalidateSearcherCache()}add(e){if(!aa(e))return;this._docs.push(e);const t=this._myIndex.add(e,this._docs.length-1);if(this._invertedIndex&&t){const n=RC({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});pue(this._invertedIndex,t,this._myIndex.keys.length,n)}this._invalidateSearcherCache()}remove(e=()=>!1){const t=[],n=[];for(let i=0,o=this._docs.length;i!i.has(s)),this._myIndex.removeAll(n),this._invalidateSearcherCache()}return t}removeAt(e){if(!Number.isInteger(e)||e<0||e>=this._docs.length)throw new Error(TC);this._invertedIndex&&qT(this._invertedIndex,[e]);const t=this._docs.splice(e,1)[0];return this._myIndex.removeAt(e),this._invalidateSearcherCache(),t}_invalidateSearcherCache(){this._lastQuery=null,this._lastSearcher=null}getIndex(){return this._myIndex}_normalizedKeys(){return this._myIndex.keys.map(e=>this._keyStore.get(e.id)||e)}search(e,t){const{limit:n=-1}=t||{},{includeMatches:i,includeScore:o,shouldSort:s,sortFn:r,ignoreFieldNorm:l}=this.options;if(tl(e)&&!e.trim()){let h=this._docs.map((p,m)=>({item:p,refIndex:m}));return c9(n)&&n>-1&&(h=h.slice(0,n)),h}const a=s&&c9(n)&&n>0&&tl(e),u=r,c=(h,p)=>u(h,p)||h.idx-p.idx;let d;if(a){const h=new rue(n,c);tl(this._docs[0])?this._searchStringList(e,{heap:h,ignoreFieldNorm:l}):this._searchObjectList(e,{heap:h,ignoreFieldNorm:l}),d=h.extractSorted()}else d=tl(e)?tl(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),sue(d,{ignoreFieldNorm:l}),s&&d.sort(tl(e)?c:u),c9(n)&&n>-1&&(d=d.slice(0,n));return aue(d,this._docs,{includeMatches:i,includeScore:o})}_searchStringList(e,{heap:t,ignoreFieldNorm:n}={}){const i=this._getSearcher(e),o=this.options.useTokenSearch&&this.options.tokenMatch==="all",{records:s}=this._myIndex,r=t?null:[];return s.forEach(({v:l,i:a,n:u})=>{if(!aa(l))return;const c=i.searchIn(l);if(c.isMatch){const d={score:c.score,value:l,norm:u,indices:c.indices};o&&(d.matchedMask=c.matchedMask,d.matchedTerms=c.matchedTerms,d.termCount=c.termCount);const h=[d];if(!o||this._coversAllTokens(h)){const p={item:l,idx:a,matches:h};t?(p.score=FC(p.matches,{ignoreFieldNorm:n}),t.insert(p)):r.push(p)}}}),r}_searchLogical(e){const t=sj(e,this.options),n=this._normalizedKeys(),i=(l,a,u)=>{if(!("children"in l)){const{keyId:p,searcher:m}=l;let g;return p===null?(g=[],n.forEach((y,b)=>{g.push(...this._findMatches({key:y,value:a[b],searcher:m}))})):g=this._findMatches({key:this._keyStore.get(p),value:this._myIndex.getValueForItemAtKeyId(a,p),searcher:m}),g&&g.length?[{idx:u,item:a,matches:g}]:[]}const{children:c,operator:d}=l,h=[];for(let p=0,m=c.length;p{if(aa(l)){const u=i(t,l,a);u.length&&(s.has(a)||(s.set(a,{idx:a,item:l,matches:[]}),r.push(s.get(a))),u.forEach(({matches:c})=>{s.get(a).matches.push(...c)}))}}),r}_searchObjectList(e,{heap:t,ignoreFieldNorm:n}={}){const i=this._getSearcher(e),o=this.options.useTokenSearch&&this.options.tokenMatch==="all",{records:s}=this._myIndex,r=this._normalizedKeys(),l=t?null:[];return s.forEach(({$:a,i:u})=>{if(!aa(a))return;const c=[];let d=!1,h=!1;if(r.forEach((p,m)=>{const g=this._findMatches({key:p,value:a[m],searcher:i});g.length?(c.push(...g),g[0].hasInverse&&(h=!0)):d=!0}),!(h&&d)&&c.length&&(!o||this._coversAllTokens(c))){const p={idx:u,item:a,matches:c};t?(p.score=FC(p.matches,{ignoreFieldNorm:n}),t.insert(p)):l.push(p)}}),l}_findMatches({key:e,value:t,searcher:n}){if(!aa(t))return[];const i=[];if(Nf(t))t.forEach(({v:o,i:s,n:r})=>{if(!aa(o))return;const l=n.searchIn(o);if(l.isMatch){const a={score:l.score,key:e,value:o,idx:s,norm:r,indices:l.indices,hasInverse:l.hasInverse};l.termCount!==void 0&&(a.matchedMask=l.matchedMask,a.matchedTerms=l.matchedTerms,a.termCount=l.termCount),i.push(a)}});else{const{v:o,n:s}=t,r=n.searchIn(o);if(r.isMatch){const l={score:r.score,key:e,value:o,norm:s,indices:r.indices,hasInverse:r.hasInverse};r.termCount!==void 0&&(l.matchedMask=r.matchedMask,l.matchedTerms=r.matchedTerms,l.termCount=r.termCount),i.push(l)}}return i}_coversAllTokens(e){const t=e.length?e[0].termCount:void 0;if(t===void 0)return!0;if(t<=31){let i=0;for(let o=0;oF7(t))};var gue=Df;const vue=/^[\uD800-\uDBFF]$/,yue=/^[\uDC00-\uDFFF]$/,kue=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;var UT;(function(e){e[e.Unknown=1e-13]="Unknown",e[e.Rule=1e-12]="Rule",e[e.DICT=2e-8]="DICT",e[e.Surname=1]="Surname",e[e.Custom=1]="Custom"})(UT||(UT={}));const wa={Normal:1,Surname:10,Custom:100};function fu(e){var t;return e.length-(((t=e.match(kue))===null||t===void 0?void 0:t.length)||0)}function OC(e){const t=[];let n=0;for(;n1)return this.StringDICT.get(t);{const n=t.charCodeAt(0);return this.NumberDICT[n]}}set(t,n){if(t.length>1)this.StringDICT.set(t,n);else{const i=t.charCodeAt(0);this.NumberDICT[i]=n}}clear(){this.NumberDICT=[],this.StringDICT.clear()}}const bue=["zh","ch","sh","z","c","s","b","p","m","f","d","t","n","l","g","k","h","j","q","x","r","y","w",""],wue=["j","q","x"],Cue=["uān","uán","uǎn","uàn","uan","uē","ué","uě","uè","ue","ūn","ún","ǔn","ùn","un","ū","ú","ǔ","ù","u"],Aue={uān:"üān",uán:"üán",uǎn:"üǎn",uàn:"üàn",uan:"üan",uē:"üē",ué:"üé",uě:"üě",uè:"üè",ue:"üe",ūn:"ǖn",ún:"ǘn",ǔn:"ǚn",ùn:"ǜn",un:"ün",ū:"ǖ",ú:"ǘ",ǔ:"ǚ",ù:"ǜ",u:"ü"},xue=["ia","ian","iang","iao","ie","iu","iong","ua","uai","uan","uang","ue","ui","uo","üan","üe","van","ve"],VT={一:"yì",二:"èr",三:"sān",四:"sì",五:"wǔ",六:"liù",七:"qī",八:"bā",九:"jiǔ",十:"shí",百:"bǎi",千:"qiān",万:"wàn",亿:"yì",单:"dān",两:"liǎng",双:"shuāng",多:"duō",几:"jǐ",十一:"shí yī",零一:"líng yī",第一:"dì yī",一十:"yī shí",一十一:"yī shí yī"},KT={重:"chóng",行:"háng",斗:"dǒu",更:"gēng"};function Sue(){const e={零一:"líng yī","〇一":"líng yī",十一:"shí yī",一十:"yī shí",第一:"dì yī",一十一:"yī shí yī"};for(let t in VT)for(let n in KT){const i=`${t}${n}`,o=`${VT[t]} ${KT[n]}`;e[i]=o}return e}const ZT=Sue(),_ue=Object.keys(ZT).map(e=>({zh:e,pinyin:ZT[e],probability:1e-12,length:fu(e),priority:wa.Normal,dict:Symbol("rule")})),aj={不:{bú:[4]},一:{yí:[4],yì:[1,2,3]}},Iue={不:["的","而","之","后","也","还","地"],一:["的","而","之","后","也","还","是"]},Mue=Object.keys(aj),PC={南宫:"nán gōng",第五:"dì wǔ",万俟:"mò qí",司马:"sī mǎ",上官:"shàng guān",欧阳:"ōu yáng",夏侯:"xià hóu",诸葛:"zhū gě",闻人:"wén rén",东方:"dōng fāng",赫连:"hè lián",皇甫:"huáng fǔ",尉迟:"yù chí",公羊:"gōng yáng",澹台:"tán tái",公冶:"gōng yě",宗政:"zōng zhèng",濮阳:"pú yáng",淳于:"chún yú",太叔:"tài shū",申屠:"shēn tú",公孙:"gōng sūn",仲孙:"zhòng sūn",轩辕:"xuān yuán",令狐:"líng hú",钟离:"zhōng lí",宇文:"yǔ wén",长孙:"zhǎng sūn",慕容:"mù róng",鲜于:"xiān yú",闾丘:"lǘ qiū",司徒:"sī tú",司空:"sī kōng",亓官:"qí guān",司寇:"sī kòu",仉督:"zhǎng dū",子车:"zǐ jū",颛孙:"zhuān sūn",端木:"duān mù",巫马:"wū mǎ",公西:"gōng xī",漆雕:"qī diāo",乐正:"yuè zhèng",壤驷:"rǎng sì",公良:"gōng liáng",拓跋:"tuò bá",夹谷:"jiá gǔ",宰父:"zǎi fǔ",榖梁:"gǔ liáng",段干:"duàn gān",百里:"bǎi lǐ",东郭:"dōng guō",南门:"nán mén",呼延:"hū yán",羊舌:"yáng shé",梁丘:"liáng qiū",左丘:"zuǒ qiū",东门:"dōng mén",西门:"xī mén",句龙:"gōu lóng",毌丘:"guàn qiū",赵:"zhào",钱:"qián",孙:"sūn",李:"lǐ",周:"zhōu",吴:"wú",郑:"zhèng",王:"wáng",冯:"féng",陈:"chén",褚:"chǔ",卫:"wèi",蒋:"jiǎng",沈:"shěn",韩:"hán",杨:"yáng",朱:"zhū",秦:"qín",尤:"yóu",许:"xǔ",何:"hé",吕:"lǚ",施:"shī",张:"zhāng",孔:"kǒng",曹:"cáo",严:"yán",华:"huà",金:"jīn",魏:"wèi",陶:"táo",姜:"jiāng",戚:"qī",谢:"xiè",邹:"zōu",喻:"yù",柏:"bǎi",水:"shuǐ",窦:"dòu",章:"zhāng",云:"yún",苏:"sū",潘:"pān",葛:"gě",奚:"xī",范:"fàn",彭:"péng",郎:"láng",鲁:"lǔ",韦:"wéi",昌:"chāng",马:"mǎ",苗:"miáo",凤:"fèng",花:"huā",方:"fāng",俞:"yú",任:"rén",袁:"yuán",柳:"liǔ",酆:"fēng",鲍:"bào",史:"shǐ",唐:"táng",费:"fèi",廉:"lián",岑:"cén",薛:"xuē",雷:"léi",贺:"hè",倪:"ní",汤:"tāng",滕:"téng",殷:"yīn",罗:"luó",毕:"bì",郝:"hǎo",邬:"wū",安:"ān",常:"cháng",乐:"yuè",于:"yú",时:"shí",傅:"fù",皮:"pí",卞:"biàn",齐:"qí",康:"kāng",伍:"wǔ",余:"yú",元:"yuán",卜:"bǔ",顾:"gù",孟:"mèng",平:"píng",黄:"huáng",和:"hé",穆:"mù",萧:"xiāo",尹:"yǐn",姚:"yáo",邵:"shào",湛:"zhàn",汪:"wāng",祁:"qí",毛:"máo",禹:"yǔ",狄:"dí",米:"mǐ",贝:"bèi",明:"míng",臧:"zāng",计:"jì",伏:"fú",成:"chéng",戴:"dài",谈:"tán",宋:"sòng",茅:"máo",庞:"páng",熊:"xióng",纪:"jǐ",舒:"shū",屈:"qū",项:"xiàng",祝:"zhù",董:"dǒng",梁:"liáng",杜:"dù",阮:"ruǎn",蓝:"lán",闵:"mǐn",席:"xí",季:"jì",麻:"má",强:"qiáng",贾:"jiǎ",路:"lù",娄:"lóu",危:"wēi",江:"jiāng",童:"tóng",颜:"yán",郭:"guō",梅:"méi",盛:"shèng",林:"lín",刁:"diāo",钟:"zhōng",徐:"xú",邱:"qiū",骆:"luò",高:"gāo",夏:"xià",蔡:"cài",田:"tián",樊:"fán",胡:"hú",凌:"líng",霍:"huò",虞:"yú",万:"wàn",支:"zhī",柯:"kē",昝:"zǎn",管:"guǎn",卢:"lú",莫:"mò",经:"jīng",房:"fáng",裘:"qiú",缪:"miào",干:"gān",解:"xiè",应:"yīng",宗:"zōng",丁:"dīng",宣:"xuān",贲:"bēn",邓:"dèng",郁:"yù",单:"shàn",杭:"háng",洪:"hóng",包:"bāo",诸:"zhū",左:"zuǒ",石:"shí",崔:"cuī",吉:"jí",钮:"niǔ",龚:"gōng",程:"chéng",嵇:"jī",邢:"xíng",滑:"huá",裴:"péi",陆:"lù",荣:"róng",翁:"wēng",荀:"xún",羊:"yáng",於:"yū",惠:"huì",甄:"zhēn",曲:"qū",家:"jiā",封:"fēng",芮:"ruì",羿:"yì",储:"chǔ",靳:"jìn",汲:"jí",邴:"bǐng",糜:"mí",松:"sōng",井:"jǐng",段:"duàn",富:"fù",巫:"wū",乌:"wū",焦:"jiāo",巴:"bā",弓:"gōng",牧:"mù",隗:"wěi",山:"shān",谷:"gǔ",车:"chē",侯:"hóu",宓:"mì",蓬:"péng",全:"quán",郗:"xī",班:"bān",仰:"yǎng",秋:"qiū",仲:"zhòng",伊:"yī",宫:"gōng",宁:"nìng",仇:"qiú",栾:"luán",暴:"bào",甘:"gān",钭:"tǒu",厉:"lì",戎:"róng",祖:"zǔ",武:"wǔ",符:"fú",刘:"liú",景:"jǐng",詹:"zhān",束:"shù",龙:"lóng",叶:"yè",幸:"xìng",司:"sī",韶:"sháo",郜:"gào",黎:"lí",蓟:"jì",薄:"bó",印:"yìn",宿:"sù",白:"bái",怀:"huái",蒲:"pú",邰:"tái",从:"cóng",鄂:"è",索:"suǒ",咸:"xián",籍:"jí",赖:"lài",卓:"zhuó",蔺:"lìn",屠:"tú",蒙:"méng",池:"chí",乔:"qiáo",阴:"yīn",鬱:"yù",胥:"xū",能:"nài",苍:"cāng",双:"shuāng",闻:"wén",莘:"shēn",党:"dǎng",翟:"zhái",谭:"tán",贡:"gòng",劳:"láo",逄:"páng",姬:"jī",申:"shēn",扶:"fú",堵:"dǔ",冉:"rǎn",宰:"zǎi",郦:"lì",雍:"yōng",郤:"xì",璩:"qú",桑:"sāng",桂:"guì",濮:"pú",牛:"niú",寿:"shòu",通:"tōng",边:"biān",扈:"hù",燕:"yān",冀:"jì",郏:"jiá",浦:"pǔ",尚:"shàng",农:"nóng",温:"wēn",别:"bié",庄:"zhuāng",晏:"yàn",柴:"chái",瞿:"qú",阎:"yán",充:"chōng",慕:"mù",连:"lián",茹:"rú",习:"xí",宦:"huàn",艾:"ài",鱼:"yú",容:"róng",向:"xiàng",古:"gǔ",易:"yì",慎:"shèn",戈:"gē",廖:"liào",庾:"yǔ",终:"zhōng",暨:"jì",居:"jū",衡:"héng",步:"bù",都:"dū",耿:"gěng",满:"mǎn",弘:"hóng",匡:"kuāng",国:"guó",文:"wén",寇:"kòu",广:"guǎng",禄:"lù",阙:"quē",东:"dōng",欧:"ōu",殳:"shū",沃:"wò",利:"lì",蔚:"wèi",越:"yuè",夔:"kuí",隆:"lóng",师:"shī",巩:"gǒng",厍:"shè",聂:"niè",晁:"cháo",勾:"gōu",敖:"áo",融:"róng",冷:"lěng",訾:"zī",辛:"xīn",阚:"kàn",那:"nā",简:"jiǎn",饶:"ráo",空:"kōng",曾:"zēng",母:"mǔ",沙:"shā",乜:"niè",养:"yǎng",鞠:"jū",须:"xū",丰:"fēng",巢:"cháo",关:"guān",蒯:"kuǎi",相:"xiàng",查:"zhā",后:"hòu",荆:"jīng",红:"hóng",游:"yóu",竺:"zhú",权:"quán",逯:"lù",盖:"gě",益:"yì",桓:"huán",公:"gōng",牟:"móu",哈:"hǎ",言:"yán",福:"fú",肖:"xiāo",区:"ōu",覃:"qín",朴:"piáo",繁:"pó",员:"yùn",句:"gōu",要:"yāo",过:"guō",钻:"zuān",谌:"chén",折:"shé",召:"shào",郄:"qiè",撒:"sǎ",甯:"nìng",六:"lù",啜:"chuài",行:"xíng"},Tue=Object.keys(PC).map(e=>({zh:e,pinyin:PC[e],probability:1+fu(e),length:fu(e),priority:wa.Surname,dict:Symbol("surname")})),GT={"bǎng páng pāng":["膀"],líng:["〇","伶","凌","刢","囹","坽","夌","姈","婈","孁","岺","彾","掕","昤","朎","柃","棂","櫺","欞","泠","淩","澪","灵","燯","爧","狑","玲","琌","瓴","皊","砱","祾","秢","竛","笭","紷","綾","绫","羐","羚","翎","聆","舲","苓","菱","蓤","蔆","蕶","蛉","衑","裬","詅","跉","軨","輘","酃","醽","鈴","錂","铃","閝","陵","零","霊","霗","霛","霝","靈","駖","魿","鯪","鲮","鴒","鸰","鹷","麢","齡","齢","龄","龗","㥄"],yī:["一","乊","伊","依","医","吚","咿","噫","壱","壹","夁","嫛","嬄","弌","揖","撎","檹","毉","洢","渏","漪","瑿","畩","祎","禕","稦","繄","蛜","衤","譩","辷","郼","醫","銥","铱","鷖","鹥","黟","黳"],"dīng zhēng":["丁"],"kǎo qiǎo yú":["丂"],qī:["七","倛","僛","凄","嘁","墄","娸","悽","慼","慽","戚","捿","柒","桤","桼","棲","榿","欺","沏","淒","漆","紪","緀","萋","褄","諆","迉","郪","鏚","霋","魌","鶈"],shàng:["丄","尙","尚","恦","緔","绱"],xià:["丅","下","乤","圷","夏","夓","懗","梺","疜","睱","罅","鎼","鏬"],hǎn:["丆","喊","浫","罕","豃","㘎"],"wàn mò":["万"],zhàng:["丈","仗","墇","嶂","帐","帳","幛","扙","杖","涱","痮","瘬","瘴","瞕","粀","胀","脹","賬","账","障"],sān:["三","厁","叁","弎","毵","毶","毿","犙","鬖"],"shàng shǎng shang":["上"],"qí jī":["丌","其","奇"],"bù fǒu":["不"],"yǔ yù yú":["与"],miǎn:["丏","偭","免","冕","勉","勔","喕","娩","愐","汅","沔","湎","睌","緬","缅","腼","葂","靦","鮸","𩾃"],gài:["丐","乢","匃","匄","戤","概","槩","槪","溉","漑","瓂","葢","鈣","钙","𬮿"],chǒu:["丑","丒","侴","吜","杽","瞅","矁","醜","魗"],zhuān:["专","叀","嫥","専","專","瑼","甎","砖","磗","磚","蟤","諯","鄟","顓","颛","鱄","䏝"],"qiě jū":["且"],pī:["丕","伓","伾","噼","坯","岯","憵","批","披","炋","狉","狓","砒","磇","礔","礕","秛","秠","耚","豾","邳","鈚","鉟","銔","錃","錍","霹","駓","髬","魾","𬳵"],shì:["世","丗","亊","事","仕","侍","冟","势","勢","卋","呩","嗜","噬","士","奭","嬕","室","市","式","弑","弒","恀","恃","戺","拭","揓","是","昰","枾","柿","栻","澨","烒","煶","眂","眎","眡","睗","示","礻","筮","簭","舐","舓","襫","視","视","觢","試","誓","諡","謚","试","谥","貰","贳","軾","轼","逝","遾","釈","释","釋","鈰","鉃","鉽","铈","飾","餙","餝","饰","鰘","䏡","𬤊"],qiū:["丘","丠","坵","媝","恘","恷","楸","秋","秌","穐","篍","緧","萩","蘒","蚯","蝵","蟗","蠤","趥","邱","鞦","鞧","鰌","鰍","鳅","鶖","鹙","龝"],bǐng:["丙","屛","怲","抦","昞","昺","柄","棅","炳","禀","秉","稟","苪","蛃","邴","鈵","陃","鞆","餅","餠","饼"],yè:["业","亱","僷","墷","夜","嶪","嶫","抴","捙","擛","擪","擫","晔","曄","曅","曗","曳","曵","枼","枽","業","洂","液","澲","烨","燁","爗","璍","皣","瞱","瞸","礏","腋","葉","謁","谒","邺","鄴","鍱","鐷","靥","靨","頁","页","餣","饁","馌","驜","鵺","鸈"],cóng:["丛","从","叢","婃","孮","従","徔","徖","悰","樷","欉","淙","灇","爜","琮","藂","誴","賨","賩","錝"],dōng:["东","倲","冬","咚","埬","岽","崬","徚","昸","東","氡","氭","涷","笗","苳","菄","蝀","鮗","鯟","鶇","鶫","鸫","鼕","𬟽"],sī:["丝","俬","凘","厮","司","咝","嘶","噝","媤","廝","恖","撕","斯","楒","泀","澌","燍","禗","禠","私","糹","絲","緦","纟","缌","罳","蕬","虒","蛳","蜤","螄","蟖","蟴","鉰","銯","鍶","鐁","锶","颸","飔","騦","鷥","鸶","鼶","㟃"],chéng:["丞","呈","城","埕","堘","塍","塖","宬","峸","惩","懲","成","承","挰","掁","揨","枨","棖","橙","檙","洆","溗","澂","珵","珹","畻","程","窚","筬","絾","脭","荿","誠","诚","郕","酲","鋮","铖","騬","鯎"],diū:["丟","丢","銩","铥"],liǎng:["両","两","兩","唡","啢","掚","緉","脼","蜽","裲","魉","魎","𬜯"],yǒu:["丣","卣","友","梄","湵","牖","禉","羑","聈","苃","莠","蜏","酉","銪","铕","黝"],yán:["严","厳","啱","喦","嚴","塩","壛","壧","妍","姸","娫","娮","岩","嵒","嵓","巌","巖","巗","延","揅","昖","楌","檐","櫩","欕","沿","炎","炏","狿","琂","盐","碞","筵","簷","莚","蔅","虤","蜒","言","訁","訮","詽","讠","郔","閆","閻","闫","阎","顏","顔","颜","鹽","麣","𫄧"],bìng:["並","併","倂","傡","垪","摒","栤","病","窉","竝","誁","靐","鮩"],"sàng sāng":["丧"],gǔn:["丨","惃","滚","滾","磙","緄","绲","蓘","蔉","衮","袞","輥","辊","鮌","鯀","鲧"],jiū:["丩","勼","啾","揪","揫","朻","究","糾","纠","萛","赳","阄","鬏","鬮","鳩","鸠"],"gè gě":["个","個","各"],yā:["丫","圧","孲","庘","押","枒","桠","椏","錏","鐚","鴉","鴨","鵶","鸦","鸭"],pán:["丬","媻","幋","槃","洀","瀊","爿","盘","盤","磐","縏","蒰","蟠","蹒","蹣","鎜","鞶"],"zhōng zhòng":["中"],jǐ:["丮","妀","己","戟","挤","掎","撠","擠","橶","泲","犱","脊","虮","蟣","魢","鱾","麂"],jiè:["丯","介","借","唶","堺","屆","届","岕","庎","徣","戒","楐","犗","玠","琾","界","畍","疥","砎","蚧","蛶","衸","褯","誡","诫","鎅","骱","魪"],fēng:["丰","仹","偑","僼","凨","凬","凮","妦","寷","封","峯","峰","崶","枫","楓","檒","沣","沨","渢","灃","烽","犎","猦","琒","疯","瘋","盽","砜","碸","篈","蘴","蜂","蠭","豐","鄷","酆","鋒","鎽","鏠","锋","霻","靊","飌","麷"],"guàn kuàng":["丱"],chuàn:["串","汌","玔","賗","釧","钏"],chǎn:["丳","产","冁","剷","囅","嵼","旵","浐","滻","灛","產","産","簅","蒇","蕆","諂","譂","讇","谄","鏟","铲","閳","闡","阐","骣","𬊤"],lín:["临","冧","壣","崊","嶙","斴","晽","暽","林","潾","瀶","燐","琳","璘","瞵","碄","磷","粦","粼","繗","翷","臨","轔","辚","遴","邻","鄰","鏻","阾","隣","霖","驎","鱗","鳞","麐","麟","𬴊","𬭸"],zhuó:["丵","劅","卓","啄","圴","妰","娺","撯","擆","擢","斫","斮","斱","斲","斵","晫","椓","浊","浞","濁","灼","烵","琸","硺","禚","窡","籗","籱","罬","茁","蠗","蠿","諁","諑","謶","诼","酌","鐲","镯","鵫","鷟","䓬","𬸦"],zhǔ:["丶","主","劯","嘱","囑","宔","帾","拄","渚","濐","煑","煮","燝","瞩","矚","罜","詝","陼","鸀","麈","𬣞"],bā:["丷","仈","八","叭","哵","夿","岜","巴","捌","朳","玐","疤","笆","粑","羓","芭","蚆","豝","釟"],wán:["丸","刓","完","岏","抏","捖","汍","烷","玩","琓","笂","紈","纨","翫","芄","貦","頑","顽"],dān:["丹","勯","匰","単","妉","媅","殚","殫","甔","眈","砃","箪","簞","耼","耽","聃","聸","褝","襌","躭","郸","鄲","酖","頕"],"wèi wéi":["为"],"jǐng dǎn":["丼"],"lì lí":["丽"],jǔ:["举","弆","挙","擧","椇","榉","榘","櫸","欅","矩","筥","聥","舉","莒","蒟","襷","踽","齟","龃"],piě:["丿","苤","鐅","𬭯"],fú:["乀","伏","俘","凫","刜","匐","咈","哹","垘","孚","岪","巿","帗","幅","幞","弗","彿","怫","扶","柫","栿","桴","氟","泭","浮","涪","澓","炥","玸","甶","畉","癁","祓","福","稪","符","箙","紱","紼","絥","綍","绂","绋","罘","罦","翇","艀","芙","芣","苻","茀","茯","菔","葍","虙","蚨","蜉","蝠","袚","袱","襆","襥","諨","豧","踾","輻","辐","郛","鉘","鉜","韍","韨","颫","髴","鮄","鮲","鳧","鳬","鴔","鵩","黻"],"yí jí":["乁"],yì:["乂","义","亄","亦","亿","伇","伿","佾","俋","億","兿","刈","劓","劮","勚","勩","匇","呓","呭","呹","唈","囈","圛","坄","垼","埸","奕","嫕","嬑","寱","屹","峄","嶧","帟","帠","幆","廙","异","弈","弋","役","忆","怈","怿","悒","意","憶","懌","懿","抑","挹","敡","易","晹","曀","曎","杙","枍","棭","榏","槸","檍","歝","殔","殪","殹","毅","浂","浥","浳","湙","溢","潩","澺","瀷","炈","焲","熠","熤","熼","燚","燡","燱","獈","玴","異","疫","痬","瘗","瘞","瘱","癔","益","瞖","穓","竩","篒","縊","繶","繹","绎","缢","義","羿","翊","翌","翳","翼","耴","肄","肊","膉","臆","艗","艺","芅","苅","萟","蓺","薏","藙","藝","蘙","虉","蜴","螠","衪","袣","裔","裛","褹","襼","訲","訳","詍","詣","誼","譯","議","讛","议","译","诣","谊","豙","豛","豷","貖","贀","跇","轶","逸","邑","鄓","醷","釴","鈠","鎰","鐿","镒","镱","阣","隿","霬","饐","駅","驛","驿","骮","鮨","鶂","鶃","鶍","鷁","鷊","鷧","鷾","鸃","鹝","鹢","黓","齸","𬬩","㑊","𫄷","𬟁"],nǎi:["乃","倷","奶","嬭","廼","氖","疓","艿","迺","釢"],wǔ:["乄","五","仵","伍","侮","倵","儛","午","啎","妩","娬","嫵","庑","廡","忤","怃","憮","摀","武","潕","熓","牾","玝","珷","瑦","甒","碔","舞","躌","迕","逜","陚","鵡","鹉","𣲘"],jiǔ:["久","乆","九","乣","奺","杦","汣","灸","玖","紤","舏","酒","镹","韭","韮"],"tuō zhé":["乇","杔","馲"],"me mó ma yāo":["么"],zhī:["之","倁","卮","巵","搘","支","栀","梔","椥","榰","汁","泜","疷","祗","祬","秓","稙","綕","肢","胑","胝","脂","芝","蘵","蜘","衼","隻","鳷","鴲","鼅","𦭜"],"wū wù":["乌"],zhà:["乍","咤","宱","搾","榨","溠","痄","蚱","詐","诈","醡","霅","䃎"],hū:["乎","乯","匢","匫","呼","唿","嘑","垀","寣","幠","忽","惚","昒","歑","泘","淴","滹","烀","苸","虍","虖","謼","軤","轷","雐"],fá:["乏","伐","傠","坺","垡","墢","姂","栰","浌","瞂","笩","筏","罚","罰","罸","藅","閥","阀"],"lè yuè yào lào":["乐","樂"],yín:["乑","吟","噖","嚚","圁","垠","夤","婬","寅","峾","崟","崯","檭","殥","泿","淫","滛","烎","犾","狺","璌","硍","碒","荶","蔩","訔","訚","訡","誾","鄞","鈝","銀","银","霪","鷣","齦"],pīng:["乒","俜","娉","涄","甹","砯","聠","艵","頩"],pāng:["乓","滂","胮","膖","雱","霶"],qiáo:["乔","侨","僑","嫶","憔","桥","槗","樵","橋","櫵","犞","瞧","硚","礄","荍","荞","蕎","藮","譙","趫","鐈","鞒","鞽","顦"],hǔ:["乕","琥","萀","虎","虝","錿","鯱"],guāi:["乖"],"chéng shèng":["乗","乘","娍"],yǐ:["乙","乛","以","倚","偯","嬟","崺","已","庡","扆","攺","敼","旑","旖","檥","矣","礒","笖","舣","艤","苡","苢","蚁","螘","蟻","裿","踦","輢","轙","逘","酏","釔","鈘","鉯","钇","顗","鳦","齮","𫖮","𬺈"],"háo yǐ":["乚"],"niè miē":["乜"],qǐ:["乞","企","启","唘","啓","啔","啟","婍","屺","杞","棨","玘","盀","綺","绮","芑","諬","起","邔","闙"],yě:["也","冶","嘢","埜","壄","漜","野"],xí:["习","喺","媳","嶍","席","椺","檄","漝","習","蓆","袭","襲","覡","觋","謵","趘","郋","鎴","隰","霫","飁","騱","騽","驨","鰼","鳛","𠅤","𫘬"],xiāng:["乡","厢","廂","忀","楿","欀","湘","瓖","稥","箱","緗","缃","膷","芗","萫","葙","薌","襄","郷","鄉","鄊","鄕","鑲","镶","香","驤","骧","鱜","麘","𬙋"],shū:["书","倏","倐","儵","叔","姝","尗","抒","掓","摅","攄","書","枢","梳","樞","殊","殳","毹","毺","淑","瀭","焂","疎","疏","紓","綀","纾","舒","菽","蔬","踈","軗","輸","输","鄃","陎","鮛","鵨"],dǒu:["乧","抖","枓","蚪","鈄","阧","陡"],shǐ:["乨","使","兘","史","始","宩","屎","榁","矢","笶","豕","鉂","駛","驶"],jī:["乩","僟","击","刉","刏","剞","叽","唧","喞","嗘","嘰","圾","基","墼","姬","屐","嵆","嵇","撃","擊","朞","机","枅","樭","機","毄","激","犄","玑","璣","畸","畿","癪","矶","磯","积","積","笄","筓","箕","簊","緁","羁","羇","羈","耭","肌","芨","虀","覉","覊","譏","譤","讥","賫","賷","赍","跻","踑","躋","躸","銈","錤","鐖","鑇","鑙","隮","雞","鞿","韲","飢","饑","饥","魕","鳮","鶏","鶺","鷄","鸄","鸡","齎","齏","齑","𬯀","𫓯","𫓹","𫌀"],náng:["乪","嚢","欜","蠰","饢"],jiā:["乫","佳","傢","加","嘉","抸","枷","梜","毠","泇","浃","浹","犌","猳","珈","痂","笳","糘","耞","腵","葭","袈","豭","貑","跏","迦","鉫","鎵","镓","鴐","麚","𬂩"],jù:["乬","倨","倶","具","剧","劇","勮","埧","埾","壉","姖","屦","屨","岠","巨","巪","怇","惧","愳","懅","懼","拒","拠","昛","歫","洰","澽","炬","烥","犋","秬","窭","窶","簴","粔","耟","聚","虡","蚷","詎","讵","豦","距","踞","躆","遽","邭","醵","鉅","鐻","钜","颶","飓","駏","鮔"],shí:["乭","十","埘","塒","姼","实","実","寔","實","峕","嵵","时","旹","時","榯","湜","溡","炻","祏","竍","蚀","蝕","辻","遈","鉐","飠","饣","鮖","鰣","鲥","鼫","鼭"],mǎo:["乮","冇","卯","峁","戼","昴","泖","笷","蓩","鉚","铆"],mǎi:["买","嘪","荬","蕒","買","鷶"],luàn:["乱","亂","釠"],rǔ:["乳","擩","汝","肗","辱","鄏"],xué:["乴","学","學","峃","嶨","斈","泶","澩","燢","穴","茓","袕","踅","鷽","鸴"],yǎn:["䶮","乵","俨","偃","儼","兖","兗","厣","厴","噞","孍","嵃","巘","巚","弇","愝","戭","扊","抁","掩","揜","曮","椼","檿","沇","渷","演","琰","甗","眼","罨","萒","蝘","衍","褗","躽","遃","郾","隒","顩","魇","魘","鰋","鶠","黡","黤","黬","黭","黶","鼴","鼹","齴","龑","𬸘","𬙂","𪩘"],fǔ:["乶","俌","俛","俯","府","弣","抚","拊","撫","斧","椨","滏","焤","甫","盙","簠","腐","腑","蜅","輔","辅","郙","釜","釡","阝","頫","鬴","黼","㕮","𫖯"],shā:["乷","唦","杀","桬","殺","毮","猀","痧","砂","硰","紗","繺","纱","蔱","裟","鎩","铩","閷","髿","魦","鯊","鯋","鲨"],nǎ:["乸","雫"],qián:["乹","亁","仱","偂","前","墘","媊","岒","拑","掮","榩","橬","歬","潛","潜","濳","灊","箝","葥","虔","軡","鈐","鉗","銭","錢","鎆","钤","钱","钳","靬","騚","騝","鰬","黔","黚"],suǒ:["乺","唢","嗩","所","暛","溑","溹","琐","琑","瑣","索","褨","鎖","鎻","鏁","锁"],yú:["乻","于","亐","伃","余","堣","堬","妤","娛","娯","娱","嬩","崳","嵎","嵛","愚","扵","揄","旟","楡","楰","榆","欤","歈","歟","歶","渔","渝","湡","漁","澞","牏","狳","玗","玙","瑜","璵","盂","睮","窬","竽","籅","羭","腴","臾","舁","舆","艅","茰","萮","萸","蕍","蘛","虞","虶","蝓","螸","衧","褕","覦","觎","諛","謣","谀","踰","輿","轝","逾","邘","酑","鍝","隅","雓","雩","餘","馀","騟","骬","髃","魚","魣","鮽","鯲","鰅","鱼","鷠","鸆","齵"],zhù:["乼","伫","佇","住","坾","墸","壴","嵀","拀","杼","柱","樦","殶","注","炷","疰","眝","祝","祩","竚","筯","箸","篫","簗","紵","紸","纻","羜","翥","苎","莇","蛀","註","貯","贮","跓","軴","鉒","鋳","鑄","铸","馵","駐","驻"],zhě:["乽","者","褶","襵","赭","踷","鍺","锗"],"qián gān":["乾"],"zhì luàn":["乿"],guī:["亀","圭","妫","媯","嫢","嬀","帰","归","摫","椝","槻","槼","櫷","歸","珪","瑰","璝","瓌","皈","瞡","硅","茥","蘬","規","规","邽","郌","閨","闺","騩","鬶","鬹"],"lǐn lìn":["亃"],jué:["亅","决","刔","劂","匷","厥","噊","孒","孓","崛","崫","嶥","彏","憠","憰","戄","抉","挗","掘","攫","桷","橛","橜","欮","氒","決","灍","焳","熦","爑","爴","爵","獗","玃","玦","玨","珏","瑴","瘚","矍","矡","砄","絕","絶","绝","臄","芵","蕝","蕨","虳","蟨","蟩","觖","觮","觼","訣","譎","诀","谲","貜","赽","趉","蹷","躩","鈌","鐍","鐝","钁","镢","鴂","鴃","鷢","𫘝","㵐","𫔎"],"le liǎo":["了"],"gè mā":["亇"],"yǔ yú":["予","懙"],zhēng:["争","佂","凧","姃","媜","峥","崝","崢","征","徰","炡","烝","爭","狰","猙","癥","眐","睁","睜","筝","箏","篜","聇","脀","蒸","踭","鉦","錚","鏳","鬇"],èr:["二","刵","咡","弍","弐","樲","誀","貮","貳","贰","髶"],chù:["亍","傗","儊","怵","憷","搐","斶","歜","珿","琡","矗","竌","絀","绌","臅","触","觸","豖","鄐","閦","黜"],kuī:["亏","刲","岿","巋","盔","窥","窺","聧","虧","闚","顝"],yún:["云","伝","勻","匀","囩","妘","愪","抣","昀","橒","沄","涢","溳","澐","熉","畇","秐","筼","篔","紜","縜","纭","耘","芸","蒷","蕓","郧","鄖","鋆","雲"],hù:["互","冱","嗀","嚛","婟","嫭","嫮","岵","帍","弖","怙","戶","户","戸","戽","扈","护","昈","槴","沍","沪","滬","熩","瓠","祜","笏","簄","粐","綔","蔰","護","豰","鄠","鍙","頀","鱯","鳠","鳸","鸌","鹱"],qí:["亓","剘","埼","岐","岓","崎","嵜","愭","掑","斉","斊","旂","旗","棊","棋","檱","櫀","歧","淇","濝","猉","玂","琦","琪","璂","畦","疧","碁","碕","祁","祈","祺","禥","竒","簯","簱","籏","粸","綥","綦","肵","脐","臍","艩","芪","萁","萕","蕲","藄","蘄","蚑","蚚","蛴","蜝","蜞","螧","蠐","褀","軝","鄿","釮","錡","锜","陭","頎","颀","騎","騏","騹","骐","骑","鬐","鬿","鯕","鰭","鲯","鳍","鵸","鶀","麒","麡","𨙸","𬨂","䓫"],jǐng:["井","儆","刭","剄","坓","宑","幜","憬","暻","殌","汫","汬","澋","璄","璟","璥","穽","肼","蟼","警","阱","頚","頸"],sì:["亖","佀","価","儩","兕","嗣","四","姒","娰","孠","寺","巳","柶","榹","汜","泗","泤","洍","洠","涘","瀃","牭","祀","禩","竢","笥","耜","肂","肆","蕼","覗","貄","釲","鈶","鈻","飤","飼","饲","駟","騃","驷"],suì:["亗","嬘","岁","嵗","旞","檖","歲","歳","澻","煫","燧","璲","砕","碎","祟","禭","穂","穗","穟","繀","繐","繸","襚","誶","譢","谇","賥","邃","鐆","鐩","隧","韢","𫟦","𬭼"],gèn:["亘","亙","揯","搄","茛"],yà:["亚","亜","俹","冴","劜","圔","圠","埡","娅","婭","揠","氩","氬","犽","砑","稏","聐","襾","覀","訝","讶","迓","齾"],"xiē suò":["些"],"qí zhāi":["亝","齊"],"yā yà":["亞","压","垭","壓","铔"],"jí qì":["亟","焏"],tóu:["亠","投","頭","骰"],"wáng wú":["亡"],"kàng háng gāng":["亢"],dà:["亣","眔"],jiāo:["交","僬","娇","嬌","峧","嶕","嶣","憍","椒","浇","澆","焦","礁","穚","簥","胶","膠","膲","茭","茮","蕉","虠","蛟","蟭","跤","轇","郊","鐎","驕","骄","鮫","鲛","鵁","鷦","鷮","鹪","䴔"],hài:["亥","嗐","害","氦","餀","饚","駭","駴","骇"],"hēng pēng":["亨"],mǔ:["亩","姆","峔","拇","母","牡","牳","畂","畆","畒","畝","畞","畮","砪","胟","踇","鉧","𬭁","𧿹"],ye:["亪"],xiǎng:["享","亯","响","想","晑","蚃","蠁","響","飨","餉","饗","饷","鮝","鯗","鱶","鲞"],jīng:["京","亰","兢","坕","坙","婛","惊","旌","旍","晶","橸","泾","涇","猄","睛","秔","稉","粳","精","経","經","綡","聙","腈","茎","荆","荊","菁","葏","驚","鯨","鲸","鶁","鶄","麖","麠","鼱","䴖"],tíng:["亭","停","婷","嵉","庭","廷","楟","榳","筳","聤","莛","葶","蜓","蝏","諪","邒","霆","鼮","䗴"],liàng:["亮","喨","悢","晾","湸","諒","谅","輌","輛","辆","鍄"],"qīn qìng":["亲","親"],bó:["亳","仢","侼","僰","博","帛","愽","懪","挬","搏","欂","浡","淿","渤","煿","牔","狛","瓝","礴","秡","箔","簙","糪","胉","脖","膊","舶","艊","萡","葧","袯","襏","襮","謈","踣","郣","鈸","鉑","鋍","鎛","鑮","钹","铂","镈","餺","馎","馛","馞","駁","駮","驳","髆","鵓","鹁"],yòu:["亴","佑","佦","侑","又","右","哊","唀","囿","姷","宥","峟","幼","狖","祐","蚴","誘","诱","貁","迶","酭","釉","鼬"],xiè:["亵","伳","偞","偰","僁","卨","卸","噧","塮","夑","媟","屑","屧","廨","徢","懈","暬","械","榍","榭","泻","洩","渫","澥","瀉","瀣","灺","炧","炨","燮","爕","獬","祄","禼","糏","紲","絏","絬","繲","纈","绁","缷","薢","薤","蟹","蠏","褉","褻","謝","谢","躞","邂","靾","韰","齂","齘","齛","齥","𬹼","𤫉"],"dǎn dàn":["亶","馾"],lián:["亷","劆","匲","匳","嗹","噒","奁","奩","嫾","帘","廉","怜","憐","涟","漣","濂","濓","瀮","熑","燫","簾","籢","籨","縺","翴","联","聨","聫","聮","聯","臁","莲","蓮","薕","螊","蠊","裢","褳","覝","謰","蹥","连","連","鎌","鐮","镰","鬑","鰱","鲢"],duǒ:["亸","哚","嚲","埵","崜","朵","朶","綞","缍","趓","躱","躲","軃"],"wěi mén":["亹","斖"],rén:["人","亻","仁","壬","忈","忎","朲","秂","芢","魜","鵀"],jí:["亼","亽","伋","佶","偮","卙","即","卽","及","叝","吉","堲","塉","姞","嫉","岌","嵴","嶯","彶","忣","急","愱","戢","揤","极","棘","楫","極","槉","檝","殛","汲","湒","潗","疾","瘠","皍","笈","箿","籍","級","级","膌","艥","蒺","蕀","蕺","蝍","螏","襋","觙","谻","踖","蹐","躤","輯","轚","辑","郆","銡","鍓","鏶","集","雧","霵","鹡","㴔"],wáng:["亾","仼","兦","莣","蚟"],"shén shí":["什"],lè:["仂","叻","忇","氻","泐","玏","砳","簕","艻","阞","韷","餎","鰳","鱳","鳓"],dīng:["仃","叮","帄","玎","疔","盯","耵","虰","靪"],zè:["仄","崱","庂","捑","昃","昗","汄"],"jǐn jìn":["仅","僅","嫤"],"pú pū":["仆"],"chóu qiú":["仇"],zhǎng:["仉","幥","掌","礃"],jīn:["今","堻","巾","惍","斤","津","珒","琻","璡","砛","筋","荕","衿","襟","觔","金","釒","釿","钅","鹶","黅","𬬱"],bīng:["仌","仒","兵","冫","冰","掤","氷","鋲"],réng:["仍","礽","芿","辸","陾"],fó:["仏","坲","梻"],"jīn sǎn":["仐"],lún:["仑","伦","侖","倫","囵","圇","婨","崘","崙","棆","沦","淪","磮","腀","菕","蜦","踚","輪","轮","錀","陯","鯩","𬬭"],cāng:["仓","仺","倉","凔","嵢","沧","滄","濸","獊","舱","艙","苍","蒼","螥","鸧"],"zǎi zǐ zī":["仔"],tā:["他","塌","它","榙","溻","牠","祂","褟","趿","遢","闧"],fù:["付","偩","傅","冨","副","咐","坿","复","妇","婦","媍","嬔","富","復","椱","祔","禣","竎","緮","縛","缚","腹","萯","蕧","蚹","蛗","蝜","蝮","袝","複","覄","覆","訃","詂","讣","負","賦","賻","负","赋","赙","赴","輹","鍑","鍢","阜","附","馥","駙","驸","鮒","鰒","鲋","鳆","㳇"],xiān:["仙","仚","佡","僊","僲","先","嘕","奾","屳","廯","忺","憸","掀","暹","杴","氙","珗","祆","秈","籼","繊","纎","纖","苮","褼","襳","跹","蹮","躚","酰","鍁","锨","韯","韱","馦","鱻","鶱","𬸣"],"tuō chà duó":["仛"],hóng:["仜","吰","垬","妅","娂","宏","宖","弘","彋","汯","泓","洪","浤","渱","潂","玒","玜","竑","竤","篊","粠","紘","紭","綋","纮","翃","翝","耾","苰","荭","葒","葓","谹","谼","鈜","鉷","鋐","閎","闳","霐","霟","鞃","魟","鴻","鸿","黉","黌","𫟹","𬭎"],tóng:["仝","佟","哃","峂","峝","庝","彤","晍","曈","桐","氃","浵","潼","犝","獞","眮","瞳","砼","秱","童","粡","膧","茼","蚒","詷","赨","酮","鉖","鉵","銅","铜","餇","鮦","鲖","𫍣","𦒍"],rèn:["仞","仭","刃","刄","妊","姙","屻","岃","扨","牣","祍","紉","紝","絍","纫","纴","肕","腍","衽","袵","訒","認","认","讱","軔","轫","鈓","靭","靱","韌","韧","飪","餁","饪"],qiān:["仟","佥","僉","千","圲","奷","孯","岍","悭","愆","慳","扦","拪","搴","撁","攐","攑","攓","杄","櫏","汘","汧","牵","牽","竏","签","簽","籖","籤","粁","芊","茾","蚈","褰","諐","謙","谦","谸","迁","遷","釺","鈆","鉛","鏲","钎","阡","韆","顅","騫","骞","鬜","鬝","鵮","鹐"],"gǎn hàn":["仠"],"yì gē":["仡"],dài:["代","侢","叇","垈","埭","岱","帒","带","帯","帶","廗","怠","戴","曃","柋","殆","瀻","玳","瑇","甙","簤","紿","緿","绐","艜","蝳","袋","襶","貣","贷","蹛","軑","軚","軩","轪","迨","霴","靆","鴏","黛","黱"],"lìng líng lǐng":["令"],chào:["仦","耖","觘"],"cháng zhǎng":["仧","兏","長","长"],sā:["仨"],cháng:["仩","偿","償","嘗","嚐","嫦","尝","常","徜","瑺","瓺","甞","肠","腸","膓","苌","萇","镸","鱨","鲿"],yí:["仪","侇","儀","冝","匜","咦","圯","夷","姨","宐","宜","宧","寲","峓","嶬","嶷","巸","彛","彜","彝","彞","怡","恞","扅","暆","栘","椬","椸","沂","洟","熪","瓵","痍","移","簃","籎","羠","胰","萓","蛦","螔","觺","謻","貽","贻","跠","迻","遺","鏔","頉","頤","頥","顊","颐","饴","鮧","鴺"],mù:["仫","凩","募","墓","幕","幙","慔","慕","暮","暯","木","楘","毣","沐","炑","牧","狇","目","睦","穆","艒","苜","莯","蚞","鉬","钼","雮","霂"],"men mén":["们"],fǎn:["仮","反","橎","返"],"chào miǎo":["仯"],"yǎng áng":["仰"],zhòng:["仲","众","堹","妕","媑","狆","眾","祌","筗","茽","蚛","衆","衶","諥"],"pǐ pí":["仳"],wò:["仴","偓","卧","媉","幄","握","楃","沃","渥","濣","瓁","瞃","硪","肟","腛","臥","齷","龌"],jiàn:["件","俴","健","僭","剑","剣","剱","劍","劎","劒","劔","墹","寋","建","徤","擶","旔","楗","毽","洊","涧","澗","牮","珔","瞷","磵","礀","箭","糋","繝","腱","臶","舰","艦","荐","薦","覸","諓","諫","譛","谏","賎","賤","贱","趝","践","踐","踺","轞","鉴","鍳","鍵","鐱","鑑","鑒","鑬","鑳","键","間","餞","饯","𬣡"],"jià jiè jie":["价"],"yǎo fó":["仸"],"rèn rén":["任"],"fèn bīn":["份"],dī:["仾","低","啲","埞","堤","岻","彽","樀","滴","磾","秪","羝","袛","趆","隄","鞮","䃅"],fǎng:["仿","倣","旊","昉","昘","瓬","眆","紡","纺","舫","訪","访","髣","鶭"],zhōng:["伀","刣","妐","幒","彸","忠","柊","汷","泈","炂","盅","籦","終","终","舯","蔠","蜙","螤","螽","衳","衷","蹱","鈡","鍾","鐘","钟","锺","鴤","鼨"],pèi:["伂","佩","姵","帔","斾","旆","沛","浿","珮","蓜","轡","辔","配","霈","馷"],diào:["伄","吊","弔","掉","瘹","盄","窎","窵","竨","訋","釣","鈟","銱","鋽","鑃","钓","铞","雿","魡"],dùn:["伅","潡","炖","燉","盾","砘","碷","踲","逇","遁","遯","鈍","钝"],wěn:["伆","刎","吻","呅","抆","桽","稳","穏","穩","紊","肳","脗"],xǐn:["伈"],kàng:["伉","匟","囥","抗","炕","鈧","钪"],ài:["伌","僾","塧","壒","嫒","嬡","愛","懓","暧","曖","爱","瑷","璦","皧","瞹","砹","硋","碍","礙","薆","譺","賹","鑀","隘","靉","餲","馤","鱫","鴱"],"jì qí":["伎","薺"],"xiū xǔ":["休"],"jìn yín":["伒"],dǎn:["伔","刐","撢","玬","瓭","紞","胆","膽","衴","賧","赕","黕","𬘘"],fū:["伕","呋","娐","孵","尃","怤","懯","敷","旉","玞","砆","稃","筟","糐","綒","肤","膚","荂","荴","衭","趺","跗","邞","鄜","酜","鈇","麩","麬","麱","麸","𫓧"],tǎng:["伖","傥","儻","埫","戃","曭","爣","矘","躺","鎲","钂","镋"],yōu:["优","優","呦","嚘","峳","幽","忧","悠","憂","攸","櫌","滺","瀀","纋","羪","耰","逌","鄾","麀"],huǒ:["伙","夥","火","煷","邩","鈥","钬"],"huì kuài":["会","會","浍","璯"],yǔ:["伛","俁","俣","偊","傴","匬","噳","圄","圉","宇","寙","屿","嶼","庾","挧","敔","斞","楀","瑀","瘐","祤","禹","穥","窳","羽","與","萭","貐","鄅","頨","麌","齬","龉","㺄"],cuì:["伜","啛","忰","悴","毳","淬","焠","疩","瘁","竁","粋","粹","紣","綷","翆","翠","脃","脆","脺","膬","膵","臎","萃","襊","顇"],sǎn:["伞","傘","糤","繖","饊","馓"],wěi:["伟","伪","偉","偽","僞","儰","娓","寪","屗","崣","嶉","徫","愇","捤","暐","梶","洧","浘","渨","炜","煒","猥","玮","瑋","痿","緯","纬","腲","艉","芛","苇","荱","萎","葦","蒍","蔿","蜼","諉","诿","踓","鍡","韑","韙","韡","韪","頠","颹","骩","骪","骫","鮪","鲔","𫇭","𬀩","𬱟"],"chuán zhuàn":["传","傳"],"chē jū":["伡","俥","车"],"jū chē":["車"],yá:["伢","厑","厓","堐","岈","崕","崖","涯","漄","牙","玡","琊","睚","笌","芽","蚜","衙","齖"],qiàn:["伣","俔","倩","儙","刋","壍","嬱","悓","棈","椠","槧","欠","歉","皘","篏","篟","縴","芡","蒨","蔳","輤","𬘬"],shāng:["伤","傷","商","墒","慯","殇","殤","滳","漡","熵","蔏","螪","觞","觴","謪","鬺"],chāng:["伥","倀","娼","昌","椙","淐","猖","琩","菖","裮","錩","锠","閶","阊","鯧","鲳","鼚"],"chen cāng":["伧"],xùn:["伨","侚","卂","噀","巺","巽","徇","愻","殉","殾","汛","潠","狥","蕈","訊","訓","訙","训","讯","迅","迿","逊","遜","鑂","顨","馴","驯"],xìn:["伩","囟","孞","脪","舋","衅","訫","釁","阠","顖"],chǐ:["伬","侈","卶","叺","呎","垑","恥","歯","耻","肔","胣","蚇","裭","褫","豉","鉹","齒","齿"],"xián xuán":["伭"],"nú nǔ":["伮"],"bó bǎi":["伯"],"gū gù":["估"],nǐ:["伱","你","儞","孴","拟","擬","旎","晲","狔","苨","薿","隬"],"nì ní":["伲"],bàn:["伴","办","半","姅","怑","扮","瓣","秚","絆","绊","辦","鉡","靽"],xù:["伵","侐","勖","勗","卹","叙","垿","壻","婿","序","恤","敍","敘","旭","昫","朂","槒","欰","殈","汿","沀","洫","溆","漵","潊","烅","烼","煦","獝","珬","盢","瞁","稸","絮","続","緒","緖","續","绪","续","聓","聟","蓄","藚","訹","賉","酗","頊","鱮","㳚"],zhòu:["伷","僽","冑","呪","咒","咮","宙","昼","晝","甃","皱","皺","籀","籒","籕","粙","紂","縐","纣","绉","胄","荮","葤","詋","酎","駎","驟","骤","㤘","㑇"],shēn:["伸","侁","兟","呻","堔","妽","娠","屾","峷","扟","敒","曑","柛","氠","深","燊","珅","甡","甧","申","眒","砷","穼","籶","籸","糂","紳","绅","罙","罧","葠","蓡","蔘","薓","裑","訷","詵","诜","身","駪","鯓","鯵","鰺","鲹","鵢","𬳽"],qū:["伹","佉","匤","呿","坥","屈","岖","岴","嶇","憈","抾","敺","浀","煀","祛","筁","粬","胠","蛆","蛐","袪","覻","詘","诎","趍","躯","軀","阹","駆","駈","驅","驱","髷","魼","鰸","鱋","鶌","麯","麴","麹","黢","㭕","𪨰","䓛"],"sì cì":["伺"],bēng:["伻","嘣","奟","崩","嵭","閍"],"sì shì":["似"],"jiā qié gā":["伽"],"yǐ chì":["佁"],"diàn tián":["佃","钿"],"hān gàn":["佄"],mài:["佅","劢","勱","卖","唛","売","脈","衇","賣","迈","邁","霡","霢","麥","麦","鿏"],dàn:["但","僤","啖","啗","啿","噉","嚪","帎","憺","旦","柦","氮","沊","泹","淡","狚","疍","癚","禫","窞","腅","萏","蓞","蛋","蜑","觛","訑","誕","诞","贉","霮","餤","饏","駳","髧","鴠","𫢸"],bù:["佈","勏","吥","咘","埗","埠","布","廍","怖","悑","步","歨","歩","瓿","篰","荹","蔀","踄","部","郶","鈈","钚","餢"],bǐ:["佊","俾","匕","夶","妣","彼","朼","柀","比","毞","沘","疕","秕","笔","筆","粃","聛","舭","貏","鄙"],"zhāo shào":["佋"],cǐ:["佌","此","泚","皉","𫚖"],wèi:["位","卫","味","喂","墛","媦","慰","懀","未","渭","煟","熭","犚","猬","畏","緭","罻","胃","苿","菋","藯","蘶","蝟","螱","衛","衞","褽","謂","讆","讏","谓","躗","躛","軎","轊","鏏","霨","餧","餵","饖","魏","鮇","鳚"],zuǒ:["佐","左","繓"],yǎng:["佒","傟","养","坱","岟","慃","懩","攁","氧","氱","炴","痒","癢","礢","紻","蝆","軮","養","駚"],"tǐ tī":["体","體"],zhàn:["佔","偡","嶘","战","戦","戰","栈","桟","棧","湛","站","綻","绽","菚","蘸","虥","虦","譧","轏","驏"],"hé hē hè":["何"],bì:["佖","咇","哔","嗶","坒","堛","壁","奰","妼","婢","嬖","币","幣","幤","庇","庳","廦","弊","弻","弼","彃","必","怭","愊","愎","敝","斃","梐","毕","毖","毙","湢","滗","滭","潷","煏","熚","狴","獘","獙","珌","璧","畀","畢","疪","痹","痺","皕","睤","碧","筚","箅","箆","篦","篳","粊","綼","縪","繴","罼","腷","苾","荜","萆","萞","蓖","蓽","蔽","薜","蜌","袐","襅","襞","襣","觱","詖","诐","貱","贔","赑","跸","蹕","躃","躄","避","邲","鄨","鄪","鉍","鏎","鐴","铋","閇","閉","閟","闭","陛","韠","飶","饆","馝","駜","驆","髀","魓","鮅","鷝","鷩","鼊"],tuó:["佗","坨","堶","岮","槖","橐","沱","砣","砤","碢","紽","詑","跎","酡","阤","陀","陁","駝","駞","騨","驒","驝","驼","鮀","鴕","鸵","鼉","鼍","鼧","𬶍"],shé:["佘","舌","虵","蛥"],"yì dié":["佚","昳","泆","軼"],"fó fú bì bó":["佛"],"zuò zuō":["作"],gōu:["佝","沟","溝","痀","篝","簼","緱","缑","袧","褠","鈎","鉤","钩","鞲","韝"],nìng:["佞","侫","倿","寕","泞","澝","濘"],qú:["佢","劬","戵","斪","欋","欔","氍","淭","灈","爠","璖","璩","癯","磲","籧","絇","胊","臞","菃","葋","蕖","蘧","蟝","蠷","蠼","衐","衢","躣","軥","鑺","鴝","鸜","鸲","鼩"],"yōng yòng":["佣"],wǎ:["佤","咓","砙","邷"],kǎ:["佧","垰","胩","裃","鉲"],bāo:["佨","勹","包","孢","煲","笣","胞","苞","蕔","裦","褒","襃","闁","齙","龅"],"huái huí":["佪"],"gé hè":["佫"],lǎo:["佬","咾","恅","栳","狫","珯","硓","老","耂","荖","蛯","轑","銠","铑","鮱"],xiáng:["佭","庠","栙","祥","絴","翔","詳","跭"],gé:["佮","匌","呄","嗝","塥","愅","挌","搿","槅","櫊","滆","膈","臵","茖","觡","諽","輵","轕","閣","阁","隔","鞷","韐","韚","騔","骼","鮯"],yáng:["佯","劷","垟","崸","徉","扬","揚","敭","旸","昜","暘","杨","楊","洋","炀","珜","疡","瘍","眻","蛘","諹","輰","鍚","钖","阦","阳","陽","霷","颺","飏","鰑","鴹","鸉"],bǎi:["佰","捭","摆","擺","栢","百","竡","粨","襬"],fǎ:["佱","峜","法","灋","砝","鍅"],mǐng:["佲","凕","姳","慏","酩"],"èr nài":["佴"],hěn:["佷","很","狠","詪","𬣳"],huó:["佸","活"],guǐ:["佹","匦","匭","厬","垝","姽","宄","庋","庪","恑","晷","湀","癸","祪","簋","蛫","蟡","觤","詭","诡","軌","轨","陒","鬼"],quán:["佺","全","啳","埢","姾","峑","巏","拳","搼","权","楾","権","權","泉","洤","湶","牷","犈","瑔","痊","硂","筌","縓","荃","葲","蜷","蠸","觠","詮","诠","跧","踡","輇","辁","醛","銓","铨","闎","顴","颧","駩","騡","鬈","鰁","鳈","齤"],tiāo:["佻","庣","旫","祧","聎"],jiǎo:["佼","儌","孂","挢","搅","撟","撹","攪","敫","敽","敿","晈","暞","曒","灚","燞","狡","璬","皎","皦","絞","纐","绞","腳","臫","蟜","譑","賋","踋","鉸","铰","餃","饺","鱎","龣"],cì:["佽","刾","庛","朿","栨","次","絘","茦","莿","蛓","螆","賜","赐"],xíng:["侀","刑","哘","型","娙","形","洐","硎","蛵","邢","郉","鈃","鉶","銒","钘","铏","陉","陘","餳","𫰛"],tuō:["侂","咃","咜","圫","托","拕","拖","汑","脫","脱","莌","袥","託","讬","飥","饦","魠","鮵"],kǎn:["侃","偘","冚","坎","惂","砍","莰","輡","轗","顑"],zhí:["侄","値","值","埴","執","姪","嬂","戠","执","摭","植","樴","淔","漐","直","禃","絷","縶","聀","职","職","膱","蟙","跖","踯","蹠","躑","軄","釞","馽"],gāi:["侅","垓","姟","峐","晐","畡","祴","荄","該","该","豥","賅","賌","赅","陔"],lái:["來","俫","倈","崃","崍","庲","来","梾","棶","涞","淶","猍","琜","筙","箂","莱","萊","逨","郲","錸","铼","騋","鯠","鶆","麳"],kuǎ:["侉","咵","垮","銙"],gōng:["侊","公","功","匑","匔","塨","宫","宮","工","幊","弓","恭","攻","杛","碽","糼","糿","肱","觥","觵","躬","躳","髸","龔","龚","䢼"],lì:["例","俐","俪","傈","儮","儷","凓","利","力","励","勵","历","厉","厤","厯","厲","叓","吏","呖","唎","唳","嚦","囇","坜","塛","壢","娳","婯","屴","岦","悧","悷","慄","戾","搮","暦","曆","曞","朸","枥","栃","栗","栛","檪","櫔","櫪","欐","歴","歷","沥","沴","涖","溧","濿","瀝","爏","犡","猁","珕","瑮","瓅","瓑","瓥","疬","痢","癧","盭","睙","砅","砺","砾","磿","礪","礫","礰","禲","秝","立","笠","篥","粒","粝","糲","脷","苈","茘","荔","莅","莉","蒚","蒞","藶","蚸","蛎","蛠","蜧","蝷","蠇","蠣","詈","讈","赲","轢","轣","轹","酈","鉝","隶","隷","雳","靂","靋","鬁","鳨","鴗","鷅","麜","𫵷","𬍛"],yīn:["侌","凐","喑","噾","囙","因","垔","堙","姻","婣","愔","慇","栶","氤","洇","溵","濦","瘖","禋","秵","筃","絪","緸","茵","蒑","蔭","裀","諲","銦","铟","闉","阥","阴","陰","陻","隂","霒","霠","鞇","音","韾","駰","骃","齗","𬘡","𬤇","𬮱"],mǐ:["侎","孊","弭","敉","洣","渳","灖","米","粎","羋","脒","芈","葞","蔝","銤"],zhū:["侏","株","槠","橥","櫧","櫫","洙","潴","瀦","猪","珠","硃","秼","絑","茱","蕏","蛛","蝫","蠩","袾","誅","諸","诛","诸","豬","跦","邾","銖","铢","駯","鮢","鯺","鴸","鼄"],ān:["侒","偣","媕","安","峖","庵","桉","氨","盦","盫","腤","菴","萻","葊","蓭","誝","諳","谙","鞌","鞍","韽","馣","鮟","鵪","鶕","鹌","𩽾"],lù:["侓","僇","勎","勠","圥","坴","塶","娽","峍","廘","彔","录","戮","摝","椂","樚","淕","淥","渌","漉","潞","琭","璐","甪","盝","睩","硉","祿","禄","稑","穋","箓","簏","簬","簵","簶","籙","粶","蔍","蕗","虂","螰","賂","赂","趢","路","踛","蹗","輅","轆","辂","辘","逯","醁","錄","録","錴","鏴","陸","騄","騼","鯥","鴼","鵦","鵱","鷺","鹭","鹿","麓","𫘧"],móu:["侔","劺","恈","眸","蛑","謀","谋","踎","鍪","鴾","麰"],ér:["侕","儿","児","兒","峏","栭","洏","粫","而","胹","荋","袻","輀","轜","陑","隭","髵","鮞","鲕","鴯","鸸"],"dòng tǒng tóng":["侗"],chà:["侘","奼","姹","岔","汊","詫","诧"],chì:["侙","傺","勅","勑","叱","啻","彳","恜","慗","憏","懘","抶","敕","斥","杘","湁","灻","炽","烾","熾","痓","痸","瘛","翄","翅","翤","翨","腟","赤","趩","遫","鉓","雴","飭","饬","鶒","鷘"],"gòng gōng":["供","共"],zhōu:["侜","周","喌","州","徟","洲","淍","炿","烐","珘","矪","舟","謅","譸","诌","賙","赒","輈","輖","辀","週","郮","銂","霌","駲","騆","鵃","鸼"],rú:["侞","儒","嚅","如","嬬","孺","帤","曘","桇","渪","濡","筎","茹","蕠","薷","蝡","蠕","袽","襦","邚","醹","銣","铷","顬","颥","鱬","鴑","鴽"],"jiàn cún":["侟"],xiá:["侠","俠","匣","峡","峽","敮","暇","柙","炠","烚","狎","狭","狹","珨","瑕","硖","硤","碬","祫","筪","縖","翈","舝","舺","蕸","赮","轄","辖","遐","鍜","鎋","陜","陿","霞","騢","魻","鶷","黠"],lǚ:["侣","侶","儢","吕","呂","屡","屢","履","挔","捛","旅","梠","焒","祣","稆","穭","絽","縷","缕","膂","膐","褛","褸","郘","鋁","铝"],ta:["侤"],"jiǎo yáo":["侥","僥","徺"],zhēn:["侦","偵","寊","帧","帪","幀","搸","斟","桢","楨","榛","樼","殝","浈","湞","潧","澵","獉","珍","珎","瑧","甄","眞","真","砧","碪","祯","禎","禛","箴","胗","臻","葴","蒖","蓁","薽","貞","贞","轃","遉","酙","針","鉁","錱","鍼","针","鱵"],"cè zè zhāi":["侧","側"],kuài:["侩","儈","凷","哙","噲","圦","块","塊","巜","廥","快","旝","欳","狯","獪","筷","糩","脍","膾","郐","鄶","鱠","鲙"],chái:["侪","儕","喍","柴","犲","祡","豺"],nóng:["侬","儂","农","哝","噥","檂","欁","浓","濃","燶","禯","秾","穠","脓","膿","蕽","襛","譨","農","辳","醲","鬞","𬪩"],jǐn:["侭","儘","卺","厪","巹","槿","漌","瑾","紧","緊","菫","蓳","謹","谨","錦","锦","饉","馑"],"hóu hòu":["侯","矦"],jiǒng:["侰","僒","冏","囧","泂","澃","炯","烱","煚","煛","熲","燛","窘","綗","褧","迥","逈","顈","颎","䌹"],"chěng tǐng":["侱"],"zhèn zhēn":["侲","揕"],zuò:["侳","做","唑","坐","岝","岞","座","祚","糳","胙","葃","葄","蓙","袏","阼"],qīn:["侵","兓","媇","嵚","嶔","欽","衾","誛","钦","顉","駸","骎","鮼"],jú:["侷","啹","婅","局","巈","椈","橘","泦","淗","湨","焗","犑","狊","粷","菊","蘜","趜","跼","蹫","輂","郹","閰","駶","驧","鵙","鵴","鶪","鼰","鼳","䴗"],"shù dōu":["侸"],tǐng:["侹","圢","娗","挺","涏","烶","珽","脡","艇","誔","頲","颋"],shèn:["侺","愼","慎","昚","涁","渗","滲","瘆","瘮","眘","祳","肾","胂","脤","腎","蜃","蜄","鋠"],"tuì tuó":["侻"],nán:["侽","喃","娚","抩","暔","枏","柟","楠","男","畘","莮","萳","遖"],xiāo:["侾","哓","嘵","嚻","囂","婋","宯","宵","庨","彇","揱","枭","枵","梟","櫹","歊","毊","消","潇","瀟","灱","灲","烋","焇","猇","獢","痚","痟","硝","硣","窙","箫","簘","簫","綃","绡","翛","膮","萧","蕭","虈","虓","蟂","蟏","蟰","蠨","踃","逍","銷","销","霄","颵","驍","骁","髇","髐","魈","鴞","鴵","鷍","鸮"],"biàn pián":["便","緶","缏"],tuǐ:["俀","腿","蹆","骽"],xì:["係","匸","卌","呬","墍","屃","屓","屭","忥","怬","恄","椞","潝","潟","澙","熂","犔","磶","禊","細","綌","縘","细","绤","舃","舄","蕮","虩","衋","覤","赩","趇","郤","釳","阋","隙","隟","霼","餼","饩","鬩","黖"],cù:["促","媨","憱","猝","瘄","瘯","簇","縬","脨","蔟","誎","趗","踧","踿","蹙","蹴","蹵","醋","顣","鼀"],é:["俄","囮","娥","峉","峨","峩","涐","珴","皒","睋","磀","莪","訛","誐","譌","讹","迗","鈋","鋨","锇","頟","額","额","魤","鵝","鵞","鹅"],qiú:["俅","叴","唒","囚","崷","巯","巰","扏","梂","殏","毬","求","汓","泅","浗","湭","煪","犰","玌","球","璆","皳","盚","紌","絿","肍","芁","莍","虬","虯","蛷","裘","觓","觩","訄","訅","賕","赇","逎","逑","遒","酋","釚","釻","銶","頄","鮂","鯄","鰽","鼽","𨱇"],xú:["俆","徐","禑"],"guàng kuāng":["俇"],kù:["俈","喾","嚳","库","庫","廤","瘔","絝","绔","袴","裤","褲","酷"],wù:["俉","务","務","勿","卼","坞","塢","奦","婺","寤","屼","岉","嵨","忢","悞","悟","悮","戊","扤","晤","杌","溩","焐","熃","物","痦","矹","窹","粅","蘁","誤","误","鋈","阢","隖","雾","霚","霧","靰","騖","骛","鶩","鹜","鼿","齀"],jùn:["俊","儁","呁","埈","寯","峻","懏","捃","攟","晙","棞","燇","珺","畯","竣","箟","蜠","賐","郡","陖","餕","馂","駿","骏","鵔","鵕","鵘","䐃"],liáng:["俍","墚","梁","椋","樑","粮","粱","糧","良","輬","辌","𫟅"],zǔ:["俎","唨","爼","祖","組","组","詛","诅","鎺","阻","靻"],"qiào xiào":["俏"],yǒng:["俑","勇","勈","咏","埇","塎","嵱","彮","怺","恿","悀","惥","愑","愹","慂","柡","栐","永","泳","湧","甬","蛹","詠","踊","踴","鯒","鲬"],hùn:["俒","倱","圂","尡","慁","掍","溷","焝","睴","觨","諢","诨"],jìng:["俓","傹","境","妌","婙","婧","弪","弳","径","徑","敬","曔","桱","梷","浄","瀞","獍","痉","痙","竞","竟","竫","競","竸","胫","脛","莖","誩","踁","迳","逕","鏡","镜","靖","静","靜","鵛"],sàn:["俕","閐"],pěi:["俖"],sú:["俗"],xī:["俙","僖","兮","凞","卥","厀","吸","唏","唽","嘻","噏","嚱","夕","奚","嬆","嬉","屖","嵠","巇","希","徆","徯","息","悉","悕","惁","惜","昔","晞","晰","晳","曦","析","桸","榽","樨","橀","欷","氥","汐","浠","淅","渓","溪","烯","焁","焈","焟","熄","熈","熙","熹","熺","熻","燨","爔","牺","犀","犠","犧","琋","瘜","皙","睎","瞦","矽","硒","磎","礂","稀","穸","窸","粞","糦","緆","繥","羲","翕","翖","肸","肹","膝","舾","莃","菥","蒠","蜥","螅","蟋","蠵","西","觹","觽","觿","譆","谿","豀","豨","豯","貕","赥","邜","鄎","酅","醯","釸","錫","鏭","鐊","鑴","锡","隵","餏","饎","饻","鯑","鵗","鸂","鼷"],lǐ:["俚","娌","峢","峲","李","欚","浬","澧","理","礼","禮","粴","裏","裡","豊","逦","邐","醴","鋰","锂","鯉","鱧","鱱","鲤","鳢"],bǎo:["保","堢","媬","宝","寚","寳","寶","珤","緥","葆","藵","褓","賲","靌","飹","飽","饱","駂","鳵","鴇","鸨"],"yú shù yù":["俞"],"sì qí":["俟"],"xìn shēn":["信"],xiū:["俢","修","咻","庥","樇","烌","羞","脙","脩","臹","貅","銝","鎀","飍","饈","馐","髤","髹","鮴","鱃","鵂","鸺","䗛"],dì:["俤","偙","僀","埊","墑","墬","娣","帝","怟","旳","梊","焍","玓","甋","眱","睇","碲","祶","禘","第","締","缔","腣","菂","蒂","蔕","蝃","蝭","螮","諦","谛","踶","递","逓","遞","遰","鉪","𤧛","䗖"],chóu:["俦","儔","嬦","惆","愁","懤","栦","燽","畴","疇","皗","稠","筹","籌","絒","綢","绸","菗","詶","讎","讐","踌","躊","酧","酬","醻","雔","雠","雦"],zhì:["俧","偫","儨","制","劕","垁","娡","寘","帙","帜","幟","庢","庤","廌","彘","徏","徝","志","忮","懥","懫","挃","挚","掷","摯","擲","旘","晊","智","栉","桎","梽","櫍","櫛","治","洷","滍","滞","滯","潌","瀄","炙","熫","狾","猘","璏","瓆","痔","痣","礩","祑","秩","秷","稚","稺","穉","窒","紩","緻","置","翐","膣","至","致","芖","蛭","袟","袠","製","覟","觗","觯","觶","誌","豑","豒","貭","質","贄","质","贽","跱","踬","躓","輊","轾","郅","銍","鋕","鑕","铚","锧","陟","隲","雉","駤","騭","騺","驇","骘","鯯","鴙","鷙","鸷","𬃊"],"liǎ liǎng":["俩"],jiǎn:["俭","倹","儉","减","剪","堿","弿","彅","戩","戬","拣","挸","捡","揀","撿","枧","柬","梘","检","検","檢","減","湕","瀽","瑐","睑","瞼","硷","碱","礆","笕","筧","简","簡","絸","繭","翦","茧","藆","蠒","裥","襇","襉","襺","詃","謇","謭","譾","谫","趼","蹇","鐗","鬋","鰎","鹸","鹻","鹼"],huò:["俰","咟","嚯","嚿","奯","彠","惑","或","擭","旤","曤","檴","沎","湱","瀖","獲","癨","眓","矐","祸","禍","穫","窢","耯","臛","艧","获","蒦","藿","蠖","謋","貨","货","鍃","鑊","镬","雘","霍","靃","韄","㸌"],"jù jū":["俱","据","鋸","锯"],xiào:["俲","傚","効","咲","哮","啸","嘋","嘨","嘯","孝","效","斅","斆","歗","涍","熽","笑","詨","誟"],pái:["俳","徘","牌","犤","猅","簰","簲","輫"],biào:["俵","鰾","鳔"],"chù tì":["俶"],fèi:["俷","剕","厞","吠","屝","废","廃","廢","昲","曊","櫠","沸","濷","狒","癈","肺","萉","費","费","鐨","镄","陫","靅","鼣"],fèng:["俸","凤","奉","湗","焨","煈","賵","赗","鳯","鳳","鴌"],ǎn:["俺","唵","埯","揞","罯","銨","铵"],bèi:["俻","倍","偝","偹","備","僃","备","悖","惫","愂","憊","昁","梖","焙","牬","犕","狈","狽","珼","琲","碚","禙","糒","苝","蓓","蛽","褙","貝","贝","軰","輩","辈","邶","郥","鄁","鋇","鐾","钡","鞁","鞴","𬇙"],yù:["俼","儥","喅","喩","喻","域","堉","妪","嫗","寓","峪","嶎","庽","彧","御","愈","慾","戫","昱","棛","棜","棫","櫲","欎","欝","欲","毓","浴","淯","滪","潏","澦","灪","焴","煜","燏","燠","爩","狱","獄","玉","琙","瘉","癒","砡","硢","硲","礇","礖","礜","禦","秗","稢","稶","篽","籞","籲","粖","緎","罭","聿","肀","艈","芋","芌","茟","蒮","蓣","蓹","蕷","蘌","蜟","蜮","袬","裕","誉","諭","譽","谕","豫","軉","輍","逳","遇","遹","郁","醧","鈺","鋊","錥","鐭","钰","閾","阈","雤","霱","預","预","飫","饇","饫","馭","驈","驭","鬰","鬱","鬻","魊","鱊","鳿","鴥","鴧","鴪","鵒","鷸","鸒","鹆","鹬"],xīn:["俽","噺","妡","嬜","廞","心","忄","忻","惞","新","昕","杺","欣","歆","炘","盺","薪","訢","辛","邤","鈊","鋅","鑫","锌","馨","馫","䜣","𫷷"],"hǔ chí":["俿"],jiù:["倃","僦","匓","匛","匶","厩","咎","就","廄","廏","廐","慦","捄","救","旧","柩","柾","桕","欍","殧","疚","臼","舅","舊","鯦","鷲","鹫","麔","齨","㠇"],yáo:["倄","傜","嗂","垚","堯","姚","媱","尧","尭","峣","嶢","嶤","徭","揺","搖","摇","摿","暚","榣","烑","爻","猺","珧","瑤","瑶","磘","窑","窯","窰","肴","蘨","謠","謡","谣","軺","轺","遙","遥","邎","顤","颻","飖","餆","餚","鰩","鱙","鳐"],"cuì zú":["倅"],"liǎng liǎ":["倆"],wǎn:["倇","唍","婉","惋","挽","晚","晥","晩","晼","梚","椀","琬","畹","皖","盌","碗","綩","綰","绾","脘","萖","踠","輓","鋔"],zǒng:["倊","偬","傯","嵸","总","惣","捴","搃","摠","燪","総","緫","縂","總","蓗"],guān:["倌","关","官","棺","瘝","癏","窤","蒄","関","闗","關","鰥","鱞","鳏"],tiǎn:["倎","唺","忝","悿","晪","殄","淟","睓","腆","舔","覥","觍","賟","錪","餂"],mén:["們","扪","捫","璊","菛","虋","鍆","钔","門","閅","门","𫞩"],"dǎo dào":["倒"],"tán tàn":["倓","埮"],"juè jué":["倔"],chuí:["倕","垂","埀","捶","搥","桘","棰","槌","箠","腄","菙","錘","鎚","锤","陲","顀"],xìng:["倖","姓","婞","嬹","幸","性","悻","杏","涬","緈","臖","荇","莕","葕"],péng:["倗","傰","塜","塳","弸","憉","捀","朋","棚","椖","樥","硼","稝","竼","篷","纄","膨","芃","蓬","蘕","蟚","蟛","袶","輣","錋","鑝","韸","韼","騯","髼","鬅","鬔","鵬","鹏"],"tǎng cháng":["倘"],hòu:["候","厚","后","垕","堠","後","洉","茩","豞","逅","郈","鮜","鱟","鲎","鲘"],tì:["倜","剃","嚏","嚔","屉","屜","悌","悐","惕","惖","戻","掦","替","朑","歒","殢","涕","瓋","笹","籊","薙","褅","逖","逷","髰","鬀","鬄"],gàn:["倝","凎","幹","榦","檊","淦","灨","盰","紺","绀","詌","贑","赣","骭","㽏"],"liàng jìng":["倞","靓"],suī:["倠","哸","夊","滖","濉","眭","睢","芕","荽","荾","虽","雖","鞖"],"chàng chāng":["倡"],jié:["倢","偼","傑","刦","刧","刼","劫","劼","卩","卪","婕","媫","孑","岊","崨","嵥","嶻","巀","幯","截","捷","掶","擮","昅","杢","杰","桀","桝","楬","楶","榤","洁","滐","潔","狤","睫","礍","竭","節","羯","莭","蓵","蛣","蜐","蠘","蠞","蠽","衱","袺","訐","詰","誱","讦","踕","迼","鉣","鍻","镼","頡","鮚","鲒","㛃"],"kǒng kōng":["倥"],juàn:["倦","劵","奆","慻","桊","淃","狷","獧","眷","睊","睠","絭","絹","绢","罥","羂","腃","蔨","鄄","餋"],zōng:["倧","堫","宗","嵏","嵕","惾","朡","棕","椶","熧","猣","磫","緃","翪","腙","葼","蝬","豵","踨","踪","蹤","鍐","鑁","騌","騣","骔","鬃","鬉","鬷","鯮","鯼"],ní:["倪","坭","埿","尼","屔","怩","淣","猊","籾","聣","蚭","蜺","觬","貎","跜","輗","郳","鈮","铌","霓","馜","鯢","鲵","麑","齯","𫐐","𫠜"],zhuō:["倬","拙","捉","桌","梲","棁","棳","槕","涿","窧","鐯","䦃"],"wō wēi":["倭"],luǒ:["倮","剆","曪","瘰","癳","臝","蓏","蠃","裸","躶"],sōng:["倯","凇","娀","崧","嵩","庺","憽","松","枀","枩","柗","梥","檧","淞","濍","硹","菘","鬆"],lèng:["倰","堎","愣","睖","踜"],zì:["倳","剚","字","恣","渍","漬","牸","眥","眦","胔","胾","自","茡","荢"],bèn:["倴","坌","捹","撪","渀","笨","逩"],cǎi:["倸","啋","婇","彩","採","棌","毝","睬","綵","跴","踩"],zhài:["债","債","寨","瘵","砦"],yē:["倻","吔","噎","擨","暍","椰","歋","潱","蠮"],shà:["倽","唼","喢","歃","箑","翜","翣","萐","閯","霎"],qīng:["倾","傾","卿","圊","寈","氢","氫","淸","清","蜻","軽","輕","轻","郬","錆","鑋","靑","青","鯖"],yīng:["偀","嘤","噟","嚶","婴","媖","嫈","嬰","孆","孾","愥","撄","攖","朠","桜","樱","櫻","渶","煐","珱","瑛","璎","瓔","甇","甖","碤","礯","緓","纓","绬","缨","罂","罃","罌","膺","英","莺","蘡","蝧","蠳","褮","譻","賏","軈","鑍","锳","霙","韺","鴬","鶑","鶧","鶯","鷪","鷹","鸎","鸚","鹦","鹰","䓨"],"chēng chèn":["偁","爯"],ruǎn:["偄","朊","瑌","瓀","碝","礝","腝","軟","輭","软","阮"],"zhòng tóng":["偅"],chǔn:["偆","惷","睶","萶","蠢","賰"],"jiǎ jià":["假"],"jì jié":["偈"],"bǐng bìng":["偋"],ruò:["偌","叒","嵶","弱","楉","焫","爇","箬","篛","蒻","鄀","鰙","鰯","鶸"],tí:["偍","厗","啼","嗁","崹","漽","瑅","睼","禵","稊","緹","缇","罤","蕛","褆","謕","趧","蹄","蹏","醍","鍗","題","题","騠","鮷","鯷","鳀","鵜","鷤","鹈","𫘨"],wēi:["偎","危","喴","威","媙","嶶","巍","微","愄","揋","揻","椳","楲","溦","烓","煨","燰","癓","縅","葨","葳","薇","蜲","蝛","覣","詴","逶","隇","隈","霺","鰃","鰄","鳂"],piān:["偏","囨","媥","楄","犏","篇","翩","鍂"],yàn:["偐","厌","厭","唁","喭","嚈","嚥","堰","妟","姲","嬊","嬿","宴","彥","彦","敥","晏","暥","曕","曣","滟","灎","灔","灧","灩","焔","焰","焱","熖","燄","牪","猒","砚","硯","艳","艶","艷","覎","觃","觾","諺","讌","讞","谚","谳","豓","豔","贋","贗","赝","軅","酀","酽","醼","釅","雁","餍","饜","騐","験","騴","驗","驠","验","鬳","鳫","鴈","鴳","鷃","鷰","齞"],"tǎng dàng":["偒"],è:["偔","匎","卾","厄","呝","咢","噩","垩","堊","堮","岋","崿","廅","悪","愕","戹","扼","搤","搹","擜","櫮","歞","歺","湂","琧","砈","砐","硆","腭","苊","萼","蕚","蚅","蝁","覨","諤","讍","谔","豟","軛","軶","轭","遌","遏","遻","鄂","鈪","鍔","鑩","锷","阨","阸","頞","顎","颚","餓","餩","饿","鰐","鰪","鱷","鳄","鶚","鹗","齃","齶","𫫇","𥔲"],xié:["偕","勰","协","協","嗋","垥","奊","恊","愶","拹","携","撷","擕","擷","攜","斜","旪","熁","燲","綊","緳","縀","缬","翓","胁","脅","脇","脋","膎","蝢","衺","襭","諧","讗","谐","鞋","鞵","龤","㙦"],chě:["偖","扯","撦"],shěng:["偗","渻","眚"],chā:["偛","嗏","扠","挿","插","揷","疀","臿","艖","銟","鍤","锸","餷"],huáng:["偟","凰","喤","堭","墴","媓","崲","徨","惶","楻","湟","煌","獚","瑝","璜","癀","皇","磺","穔","篁","簧","艎","葟","蝗","蟥","諻","趪","遑","鍠","鐄","锽","隍","韹","餭","騜","鰉","鱑","鳇","鷬","黃","黄","𨱑"],yǎo:["偠","咬","婹","宎","岆","杳","柼","榚","溔","狕","窅","窈","舀","苭","闄","騕","鷕","齩"],"chǒu qiào":["偢"],yóu:["偤","尤","庮","怣","沋","油","浟","游","犹","猶","猷","由","疣","秞","肬","莜","莸","蕕","蚰","蝣","訧","輏","輶","逰","遊","邮","郵","鈾","铀","駀","魷","鮋","鱿","鲉","𬨎"],xū:["偦","墟","媭","嬃","楈","欨","歔","燸","疞","盱","綇","縃","繻","胥","蕦","虗","虚","虛","蝑","裇","訏","許","諝","譃","谞","鑐","需","須","须","顼","驉","鬚","魆","魖","𬣙","𦈡"],zhā:["偧","哳","抯","挓","揸","摣","樝","渣","皶","觰","譇","齄","齇"],cī:["偨","疵","蠀","趀","骴","髊","齹"],bī:["偪","屄","楅","毴","豍","逼","鰏","鲾","鵖"],xún:["偱","噚","寻","尋","峋","巡","廵","循","恂","揗","攳","旬","杊","栒","桪","樳","洵","浔","潯","燅","燖","珣","璕","畃","紃","荀","蟳","詢","询","鄩","鱏","鱘","鲟","𬘓","𬩽","𬍤","𬊈"],"cāi sī":["偲"],duān:["偳","媏","端","褍","鍴"],ǒu:["偶","吘","嘔","耦","腢","蕅","藕","𬉼","𠙶"],tōu:["偷","偸","鍮"],"zán zá zǎ":["偺"],"lǚ lóu":["偻","僂"],fèn:["偾","僨","奋","奮","弅","忿","愤","憤","瀵","瞓","秎","粪","糞","膹","鱝","鲼"],"kuǐ guī":["傀"],sǒu:["傁","叜","叟","嗾","櫢","瞍","薮","藪"],"zhì sī tí":["傂"],sù:["傃","僳","嗉","塐","塑","夙","嫊","愫","憟","榡","樎","樕","殐","泝","涑","溯","溸","潚","潥","玊","珟","璛","簌","粛","粟","素","縤","肃","肅","膆","蔌","藗","觫","訴","謖","诉","谡","趚","蹜","速","遡","遬","鋉","餗","驌","骕","鱐","鷫","鹔","𫗧"],xiā:["傄","煆","瞎","虲","谺","颬","鰕"],"yuàn yuán":["傆","媛"],rǒng:["傇","冗","宂","氄","軵"],nù:["傉","怒"],yùn:["傊","孕","恽","惲","愠","慍","枟","腪","蕴","薀","藴","蘊","褞","貟","运","運","郓","鄆","酝","醖","醞","韗","韞","韵","韻","餫"],"gòu jiǎng":["傋"],mà:["傌","嘜","榪","睰","祃","禡","罵","閁","駡","骂","鬕"],bàng:["傍","塝","棒","玤","稖","艕","蒡","蜯","謗","谤","鎊","镑"],diān:["傎","厧","嵮","巅","巓","巔","掂","攧","敁","槇","滇","癫","癲","蹎","顚","顛","颠","齻"],táng:["傏","唐","啺","坣","堂","塘","搪","棠","榶","溏","漟","煻","瑭","磄","禟","篖","糃","糖","糛","膅","膛","蓎","螗","螳","赯","踼","鄌","醣","鎕","隚","餹","饄","鶶","䣘"],hào:["傐","哠","恏","昊","昦","晧","暠","暤","暭","曍","浩","淏","澔","灏","灝","皓","皜","皞","皡","皥","耗","聕","薃","號","鄗","顥","颢","鰝"],"xī xì":["傒"],shān:["傓","删","刪","剼","圸","山","挻","搧","柵","檆","潸","澘","煽","狦","珊","笘","縿","羴","羶","脠","舢","芟","衫","跚","軕","邖","閊","鯅"],"qiàn jiān":["傔"],"què jué":["傕","埆"],"cāng chen":["傖"],róng:["傛","媶","嫆","嬫","容","峵","嵘","嶸","戎","搈","曧","栄","榕","榮","榵","毧","溶","瀜","烿","熔","狨","瑢","穁","絨","绒","羢","肜","茙","茸","荣","蓉","蝾","融","螎","蠑","褣","鎔","镕","駥"],"tà tàn":["傝"],suō:["傞","唆","嗍","嗦","娑","摍","桫","梭","睃","簑","簔","羧","莏","蓑","趖","鮻"],dǎi:["傣","歹"],zài:["傤","儎","再","在","扗","洅","載","酨"],gǔ:["傦","古","啒","尳","愲","榖","榾","汩","淈","濲","瀔","牯","皷","皼","盬","瞽","穀","罟","羖","股","脵","臌","薣","蛊","蠱","詁","诂","轂","逧","鈷","钴","餶","馉","鼓","鼔","𦙶"],bīn:["傧","宾","彬","斌","椕","滨","濒","濱","濵","瀕","繽","缤","虨","豩","豳","賓","賔","邠","鑌","镔","霦","顮"],chǔ:["储","儲","杵","椘","楚","楮","檚","濋","璴","础","礎","禇","處","齭","齼","𬺓"],nuó:["傩","儺","挪","梛","橠"],"cān càn":["傪"],lěi:["傫","儡","厽","垒","塁","壘","壨","櫐","灅","癗","矋","磊","礨","耒","蕌","蕾","藟","蘽","蠝","誄","讄","诔","鑸","鸓"],cuī:["催","凗","墔","崔","嵟","慛","摧","榱","獕","磪","鏙"],yōng:["傭","嗈","墉","壅","嫞","庸","廱","慵","拥","擁","滽","灉","牅","痈","癕","癰","臃","邕","郺","鄘","鏞","镛","雍","雝","饔","鱅","鳙","鷛"],"zāo cáo":["傮"],sǒng:["傱","嵷","怂","悚","愯","慫","竦","耸","聳","駷","㧐"],ào:["傲","坳","垇","墺","奡","嫯","岙","岰","嶴","懊","擙","澳","鏊","驁","骜"],"qī còu":["傶"],chuǎng:["傸","磢","闖","闯"],shǎ:["傻","儍"],hàn:["傼","垾","悍","憾","扞","捍","撖","撼","旱","晘","暵","汉","涆","漢","瀚","焊","猂","皔","睅","翰","莟","菡","蛿","蜭","螒","譀","輚","釬","銲","鋎","雗","頷","顄","颔","駻","鶾"],zhāng:["傽","嫜","张","張","彰","慞","暲","樟","漳","獐","璋","章","粻","蔁","蟑","遧","鄣","鏱","餦","騿","鱆","麞"],"yān yàn":["傿","墕","嬮"],"piào biāo":["僄","骠"],liàn:["僆","堜","媡","恋","戀","楝","殓","殮","湅","潋","澰","瀲","炼","煉","瑓","練","纞","练","萰","錬","鍊","鏈","链","鰊","𬶠"],màn:["㵘","僈","墁","幔","慢","曼","漫","澷","熳","獌","縵","缦","蔄","蘰","鄤","鏝","镘","𬜬"],"tàn tǎn":["僋"],yíng:["僌","営","塋","嬴","攍","楹","櫿","溁","溋","滢","潆","濙","濚","濴","瀅","瀛","瀠","瀯","灐","灜","熒","營","瑩","盁","盈","禜","籝","籯","縈","茔","荧","莹","萤","营","萦","萾","蓥","藀","蛍","蝇","蝿","螢","蠅","謍","贏","赢","迎","鎣"],dòng:["働","冻","凍","动","動","姛","戙","挏","栋","棟","湩","硐","胨","胴","腖","迵","霘","駧"],zhuàn:["僎","啭","囀","堟","撰","灷","瑑","篆","腞","蒃","襈","譔","饌","馔"],xiàng:["像","勨","向","嚮","姠","嶑","曏","橡","珦","缿","蟓","衖","襐","象","鐌","項","项","鱌"],shàn:["僐","善","墠","墡","嬗","擅","敾","椫","樿","歚","汕","灗","疝","磰","繕","缮","膳","蟮","蟺","訕","謆","譱","讪","贍","赡","赸","鄯","鐥","饍","騸","骟","鱓","鱔","鳝","𫮃"],"tuí tuǐ":["僓"],zǔn:["僔","噂","撙","譐"],pú:["僕","匍","圤","墣","濮","獛","璞","瞨","穙","莆","菐","菩","葡","蒱","蒲","贌","酺","鏷","镤"],láo:["僗","劳","労","勞","哰","崂","嶗","憥","朥","浶","牢","痨","癆","窂","簩","醪","鐒","铹","顟","髝","𫭼"],chǎng:["僘","厰","廠","敞","昶","氅","鋹","𬬮"],guāng:["僙","光","咣","垙","姯","洸","灮","炗","炚","炛","烡","珖","胱","茪","輄","銧","黆","𨐈"],liáo:["僚","嘹","嫽","寥","寮","尞","屪","嵺","嶚","嶛","廫","憀","敹","暸","橑","獠","璙","疗","療","竂","簝","繚","缭","聊","膋","膫","藔","蟟","豂","賿","蹘","辽","遼","飉","髎","鷯","鹩"],dèng:["僜","凳","墱","嶝","櫈","瞪","磴","覴","邓","鄧","隥"],"chán zhàn zhuàn":["僝"],bō:["僠","嶓","拨","撥","播","波","溊","玻","癶","盋","砵","碆","礡","缽","菠","袰","蹳","鉢","钵","餑","饽","驋","鱍","𬭛"],huì:["僡","匯","卉","喙","嘒","嚖","圚","嬒","寭","屶","屷","彗","彙","彚","徻","恚","恵","惠","慧","憓","懳","晦","暳","槥","橞","檅","櫘","汇","泋","滙","潓","烩","燴","獩","璤","瞺","硊","秽","穢","篲","絵","繪","绘","翙","翽","荟","蔧","蕙","薈","薉","蟪","詯","誨","諱","譓","譿","讳","诲","賄","贿","鐬","闠","阓","靧","頮","顪","颒","餯","𬤝","𬭬"],chuǎn:["僢","喘","舛","荈","踳"],"tiě jiàn":["僣"],sēng:["僧","鬙"],xiàn:["僩","僴","哯","垷","塪","姭","娊","宪","岘","峴","憲","撊","晛","橌","橺","涀","瀗","献","獻","现","現","県","睍","粯","糮","絤","綫","線","线","缐","羡","羨","腺","臔","臽","苋","莧","誢","豏","鋧","錎","限","陥","陷","霰","餡","馅","麲","鼸","𬀪","𪾢"],"yù jú":["僪"],"è wū":["僫"],"tóng zhuàng":["僮"],lǐn:["僯","凛","凜","廩","廪","懍","懔","撛","檁","檩","澟","癛","癝"],gù:["僱","凅","固","堌","崓","崮","故","梏","棝","牿","痼","祻","錮","锢","雇","顧","顾","鯝","鲴"],jiāng:["僵","壃","姜","橿","殭","江","畕","疅","礓","繮","缰","翞","茳","葁","薑","螀","螿","豇","韁","鱂","鳉"],mǐn:["僶","冺","刡","勄","悯","惽","愍","慜","憫","抿","敃","敏","敯","泯","潣","皿","笢","笽","簢","蠠","閔","閩","闵","闽","鰵","鳘","黽"],jìn:["僸","凚","噤","嚍","墐","壗","妗","嬧","搢","晉","晋","枃","殣","浕","浸","溍","濅","濜","烬","煡","燼","琎","瑨","璶","盡","祲","縉","缙","荩","藎","覲","觐","賮","贐","赆","近","进","進","靳","齽"],"jià jie":["價"],qiào:["僺","峭","帩","撬","殻","窍","竅","誚","诮","躈","陗","鞩","韒","髚"],pì:["僻","媲","嫓","屁","澼","甓","疈","譬","闢","鷿","鸊","䴙"],sài:["僿","簺","賽","赛"],"chán tǎn shàn":["儃"],"dāng dàng":["儅","当","闣"],xuān:["儇","喧","塇","媗","宣","愃","愋","揎","昍","暄","煊","煖","瑄","睻","矎","禤","箮","翧","翾","萱","萲","蓒","蕿","藼","蘐","蝖","蠉","諠","諼","譞","谖","軒","轩","鍹","駽","鰚","𫓶","𫍽"],"dān dàn":["儋","擔","瘅"],càn:["儏","澯","灿","燦","璨","粲","薒","謲"],"bīn bìn":["儐"],"án àn":["儑"],tái:["儓","坮","嬯","抬","擡","檯","炱","炲","籉","臺","薹","跆","邰","颱","鮐","鲐"],lán:["儖","兰","囒","婪","岚","嵐","幱","拦","攔","斓","斕","栏","欄","欗","澜","瀾","灆","灡","燣","燷","璼","篮","籃","籣","繿","葻","蓝","藍","蘫","蘭","褴","襕","襤","襴","襽","譋","讕","谰","躝","鑭","镧","闌","阑","韊","𬒗"],"nǐ yì ài yí":["儗"],méng:["儚","幪","曚","朦","橗","檬","氋","溕","濛","甍","甿","盟","礞","艨","莔","萌","蕄","虻","蝱","鄳","鄸","霿","靀","顭","饛","鯍","鸏","鹲","𫑡","㠓"],níng:["儜","凝","咛","嚀","嬣","柠","橣","檸","狞","獰","聍","聹","薴","鑏","鬡","鸋"],qióng:["儝","卭","宆","惸","憌","桏","橩","焪","焭","煢","熍","琼","瓊","睘","穷","穹","窮","竆","笻","筇","舼","茕","藑","藭","蛩","蛬","赹","跫","邛","銎","䓖"],liè:["儠","冽","列","劣","劽","埒","埓","姴","峛","巤","挒","捩","栵","洌","浖","烈","烮","煭","犣","猎","猟","獵","聗","脟","茢","蛚","趔","躐","迾","颲","鬛","鬣","鮤","鱲","鴷","䴕","𫚭"],kuǎng:["儣","夼","懭"],bào:["儤","勽","報","忁","报","抱","曓","爆","犦","菢","虣","蚫","豹","鉋","鑤","铇","骲","髱","鮑","鲍"],biāo:["儦","墂","幖","彪","标","標","滮","瀌","熛","爂","猋","瘭","磦","膘","臕","謤","贆","鏢","鑣","镖","镳","颮","颷","飆","飇","飈","飊","飑","飙","飚","驫","骉","髟"],zǎn:["儧","儹","噆","攅","昝","趱","趲"],háo:["儫","嗥","嘷","噑","嚎","壕","椃","毜","毫","濠","獆","獔","竓","籇","蚝","蠔","譹","豪"],qìng:["儬","凊","庆","慶","櫦","濪","碃","磬","罄","靘"],chèn:["儭","嚫","榇","櫬","疢","衬","襯","讖","谶","趁","趂","齓","齔","龀"],téng:["儯","幐","滕","漛","疼","籐","籘","縢","腾","藤","虅","螣","誊","謄","邆","駦","騰","驣","鰧","䲢"],"lǒng lóng lòng":["儱"],"chán chàn":["儳"],"ráng xiāng":["儴","勷"],"huì xié":["儶"],luó:["儸","攞","椤","欏","猡","玀","箩","籮","罗","羅","脶","腡","萝","蘿","螺","覼","逻","邏","鏍","鑼","锣","镙","饠","騾","驘","骡","鸁"],léi:["儽","嫘","檑","欙","瓃","畾","縲","纍","纝","缧","罍","羸","蔂","蘲","虆","轠","鐳","鑘","镭","雷","靁","鱩","鼺"],"nàng nāng":["儾"],"wù wū":["兀"],yǔn:["允","喗","夽","抎","殒","殞","狁","磒","荺","賱","鈗","阭","陨","隕","霣","馻","齫","齳"],zān:["兂","橵","簪","簮","糌","鐕","鐟","鵤"],yuán:["元","円","原","厡","厵","园","圆","圎","園","圓","垣","塬","媴","嫄","援","榞","榬","橼","櫞","沅","湲","源","溒","爰","猨","猿","笎","緣","縁","缘","羱","茒","薗","蝝","蝯","螈","袁","褤","謜","轅","辕","邍","邧","酛","鈨","鎱","騵","魭","鶢","鶰","黿","鼋","𫘪"],xiōng:["兄","兇","凶","匂","匈","哅","忷","恟","汹","洶","胷","胸","芎","訩","詾","讻"],chōng:["充","嘃","忡","憃","憧","摏","沖","浺","珫","罿","翀","舂","艟","茺","衝","蹖","㳘"],zhào:["兆","垗","旐","曌","枛","櫂","照","燳","狣","瞾","笊","罀","罩","羄","肁","肇","肈","詔","诏","赵","趙","鮡","𬶐"],"duì ruì yuè":["兊","兌","兑"],kè:["克","刻","勀","勊","堁","娔","客","恪","愙","氪","溘","碦","緙","缂","艐","衉","課","课","錁","锞","騍","骒"],tù:["兎","兔","堍","迌","鵵"],dǎng:["党","攩","欓","譡","讜","谠","黨","𣗋"],dōu:["兜","兠","唗","橷","篼","蔸"],huǎng:["兤","奛","幌","怳","恍","晄","炾","熀","縨","詤","謊","谎"],rù:["入","嗕","媷","扖","杁","洳","溽","縟","缛","蓐","褥","鳰"],nèi:["內","氝","氞","錗"],"yú shù":["兪"],"liù lù":["六"],han:["兯","爳"],tiān:["兲","天","婖","添","酟","靔","靝","黇"],"xīng xìng":["兴"],diǎn:["典","嚸","奌","婰","敟","椣","点","碘","蒧","蕇","踮","點"],"zī cí":["兹"],jiān:["兼","冿","囏","坚","堅","奸","姦","姧","尖","幵","惤","戋","戔","搛","椾","樫","櫼","歼","殱","殲","湔","瀐","瀸","煎","熞","熸","牋","瑊","睷","礛","礷","笺","箋","緘","縑","缄","缣","肩","艰","艱","菅","菺","葌","蒹","蔪","蕑","蕳","虃","譼","豜","鑯","雃","鞯","韀","韉","餰","馢","鰔","鰜","鰹","鲣","鳒","鵑","鵳","鶼","鹣","麉"],shòu:["兽","受","售","壽","夀","寿","授","狩","獣","獸","痩","瘦","綬","绶","膄"],jì:["兾","冀","剂","剤","劑","勣","坖","垍","塈","妓","季","寂","寄","廭","彑","徛","忌","悸","惎","懻","技","旡","既","旣","暨","暩","曁","梞","檕","檵","洎","漃","漈","瀱","痵","癠","禝","稩","稷","穄","穊","穧","紀","継","績","繋","繼","继","绩","罽","臮","芰","茍","茤","葪","蓟","蔇","薊","蘎","蘮","蘻","裚","襀","覬","觊","計","記","誋","计","记","跡","跽","蹟","迹","际","際","霁","霽","驥","骥","髻","鬾","魝","魥","鯚","鯽","鰶","鰿","鱀","鱭","鲚","鲫","鵋","鷑","齌","𪟝","𬶨","𬶭"],jiōng:["冂","冋","坰","埛","扃","蘏","蘔","駉","駫","𬳶"],mào:["冃","冐","媢","帽","愗","懋","暓","柕","楙","毷","瑁","皃","眊","瞀","耄","茂","萺","蝐","袤","覒","貌","貿","贸","鄚","鄮"],rǎn:["冄","冉","姌","媣","染","珃","苒","蒅","䎃"],"nèi nà":["内"],gāng:["冈","冮","刚","剛","堈","堽","岡","掆","摃","棡","牨","犅","疘","綱","纲","缸","罁","罡","肛","釭","鎠","㭎"],cè:["冊","册","厕","厠","夨","廁","恻","惻","憡","敇","测","測","笧","策","筞","筴","箣","荝","萗","萴","蓛"],guǎ:["冎","剐","剮","叧","寡"],"mào mò":["冒"],gòu:["冓","啂","坸","垢","够","夠","媾","彀","搆","撀","构","構","煹","覯","觏","訽","詬","诟","購","购","遘","雊"],xǔ:["冔","喣","暊","栩","珝","盨","糈","詡","諿","诩","鄦","醑"],mì:["冖","冪","嘧","塓","宻","密","峚","幂","幎","幦","怽","榓","樒","櫁","汨","淧","滵","漞","濗","熐","羃","蔤","蜜","覓","覔","覛","觅","謐","谧","鼏"],"yóu yín":["冘"],xiě:["写","冩","藛"],jūn:["军","君","均","桾","汮","皲","皸","皹","碅","莙","蚐","袀","覠","軍","鈞","銁","銞","鍕","钧","頵","鮶","鲪","麏"],mí:["冞","擟","瀰","爢","猕","獼","祢","禰","縻","蒾","藌","蘪","蘼","袮","詸","謎","迷","醚","醾","醿","釄","镾","鸍","麊","麋","麛"],"guān guàn":["冠","覌","観","觀","观"],měng:["冡","勐","懵","掹","猛","獴","艋","蜢","蠓","錳","锰","鯭","鼆"],zhǒng:["冢","塚","尰","歱","煄","瘇","肿","腫","踵"],zuì:["冣","嶵","晬","最","栬","槜","檇","檌","祽","絊","罪","蕞","辠","酔","酻","醉","錊"],yuān:["冤","剈","囦","嬽","寃","棩","淵","渁","渆","渊","渕","灁","眢","肙","葾","蒬","蜎","蜵","駌","鳶","鴛","鵷","鸢","鸳","鹓","鼘","鼝"],míng:["冥","名","明","暝","朙","榠","洺","溟","猽","眀","眳","瞑","茗","螟","覭","詺","鄍","銘","铭","鳴","鸣"],kòu:["冦","叩","宼","寇","扣","敂","滱","窛","筘","簆","蔲","蔻","釦","鷇"],tài:["冭","太","夳","忲","态","態","汰","汱","泰","溙","肽","舦","酞","鈦","钛"],"féng píng":["冯","馮"],"chōng chòng":["冲"],kuàng:["况","圹","壙","岲","懬","旷","昿","曠","框","況","爌","眖","眶","矿","砿","礦","穬","絋","絖","纊","纩","貺","贶","軦","邝","鄺","鉱","鋛","鑛","黋"],lěng:["冷"],pàn:["冸","判","叛","沜","泮","溿","炍","牉","畔","盼","聁","袢","襻","詊","鋬","鑻","頖","鵥"],fā:["冹","彂","沷","発","發"],xiǎn:["冼","尟","尠","崄","嶮","幰","攇","显","櫶","毨","灦","烍","燹","狝","猃","獫","獮","玁","禒","筅","箲","藓","蘚","蚬","蜆","譣","赻","跣","鍌","险","険","險","韅","顕","顯","㬎"],qià:["冾","圶","帢","恰","殎","洽","硈","胢","髂"],"jìng chēng":["净","凈","淨"],sōu:["凁","嗖","廀","廋","捜","搜","摉","溲","獀","艘","蒐","螋","鄋","醙","鎪","锼","颼","飕","餿","馊","騪"],měi:["凂","媄","媺","嬍","嵄","挴","毎","每","浼","渼","燘","美","躾","鎂","镁","黣"],tú:["凃","図","图","圖","圗","塗","屠","峹","嵞","庩","廜","徒","悇","揬","涂","瘏","筡","腯","荼","蒤","跿","途","酴","鈯","鍎","馟","駼","鵌","鶟","鷋","鷵","𬳿"],zhǔn:["准","凖","埻","準","𬘯"],"liáng liàng":["凉","涼","量"],diāo:["凋","刁","刟","叼","奝","弴","彫","汈","琱","碉","簓","虭","蛁","貂","錭","雕","鮉","鯛","鲷","鵰","鼦"],còu:["凑","湊","腠","輳","辏"],ái:["凒","啀","嘊","捱","溰","癌","皑","皚"],duó:["凙","剫","夺","奪","痥","踱","鈬","鐸","铎"],dú:["凟","匵","嬻","椟","櫝","殰","涜","牍","牘","犊","犢","独","獨","瓄","皾","裻","読","讀","讟","豄","贕","錖","鑟","韇","韣","韥","騳","髑","黩","黷"],"jǐ jī":["几"],fán:["凡","凢","凣","匥","墦","杋","柉","棥","樊","瀿","烦","煩","燔","璠","矾","礬","笲","籵","緐","羳","舤","舧","薠","蘩","蠜","襎","蹯","釩","鐇","鐢","钒","鷭","𫔍","𬸪"],jū:["凥","匊","娵","婮","居","崌","抅","挶","掬","梮","椐","檋","毩","毱","泃","涺","狙","琚","疽","砠","罝","腒","艍","蜛","裾","諊","跔","踘","躹","陱","雎","鞠","鞫","駒","驹","鮈","鴡","鶋","𬶋"],"chù chǔ":["処","处"],zhǐ:["凪","劧","咫","址","坧","帋","恉","扺","指","旨","枳","止","汦","沚","洔","淽","疻","砋","祉","秖","紙","纸","芷","藢","衹","襧","訨","趾","軹","轵","酯","阯","黹"],píng:["凭","凴","呯","坪","塀","岼","帡","帲","幈","平","慿","憑","枰","洴","焩","玶","瓶","甁","竮","箳","簈","缾","荓","萍","蓱","蚲","蛢","評","评","軿","輧","郱","鮃","鲆"],kǎi:["凯","凱","剀","剴","垲","塏","恺","愷","慨","暟","蒈","輆","鍇","鎧","铠","锴","闓","闿","颽"],gān:["凲","坩","尲","尴","尶","尷","柑","泔","漧","玕","甘","疳","矸","竿","筸","粓","肝","苷","迀","酐","魐"],"kǎn qiǎn":["凵"],tū:["凸","堗","嶀","捸","涋","湥","痜","禿","秃","突","葖","鋵","鵚","鼵","㻬"],"āo wā":["凹"],chū:["出","初","岀","摴","榋","樗","貙","齣","䢺","䝙"],dàng:["凼","圵","垱","壋","档","檔","氹","璗","瓽","盪","瞊","砀","碭","礑","簜","荡","菪","蕩","蘯","趤","逿","雼","𬍡"],hán:["函","凾","含","圅","娢","寒","崡","晗","梒","浛","涵","澏","焓","琀","甝","筨","蜬","邗","邯","鋡","韓","韩"],záo:["凿","鑿"],dāo:["刀","刂","忉","氘","舠","螩","釖","魛","鱽"],chuāng:["刅","摐","牎","牕","疮","瘡","窓","窗","窻"],"fēn fèn":["分"],"qiè qiē":["切"],kān:["刊","勘","堪","戡","栞","龕","龛"],cǔn:["刌","忖"],chú:["刍","厨","幮","廚","橱","櫉","櫥","滁","犓","篨","耡","芻","蒢","蒭","蜍","蟵","豠","趎","蹰","躇","躕","鉏","鋤","锄","除","雏","雛","鶵"],"huà huá":["划"],lí:["刕","剓","剺","劙","厘","喱","嚟","囄","嫠","孷","廲","悡","梨","梸","棃","漓","灕","犁","犂","狸","琍","璃","瓈","盠","睝","离","穲","竰","筣","篱","籬","糎","縭","缡","罹","艃","荲","菞","蓠","蔾","藜","蘺","蜊","蟍","蟸","蠫","褵","謧","貍","醨","鋫","錅","鏫","鑗","離","驪","骊","鯏","鯬","鱺","鲡","鵹","鸝","鹂","黎","黧","㰀"],yuè:["刖","嬳","岄","岳","嶽","恱","悅","悦","戉","抈","捳","月","樾","瀹","爚","玥","礿","禴","篗","籆","籥","籰","粤","粵","蘥","蚎","蚏","説","越","跀","跃","躍","軏","鈅","鉞","鑰","钺","閱","閲","阅","鸑","鸙","黦","龠","𫐄","𬸚"],liú:["刘","劉","嚠","媹","嵧","旈","旒","榴","橊","流","浏","瀏","琉","瑠","瑬","璢","畄","留","畱","疁","瘤","癅","硫","蒥","蓅","蟉","裗","鎏","鏐","鐂","镠","飀","飅","飗","駠","駵","騮","驑","骝","鰡","鶹","鹠","麍"],zé:["则","則","啧","嘖","嫧","帻","幘","択","樍","歵","沢","泎","溭","皟","瞔","矠","礋","箦","簀","舴","蔶","蠌","襗","謮","賾","赜","迮","鸅","齚","齰"],"chuàng chuāng":["创","創"],qù:["刞","厺","去","閴","闃","阒","麮","鼁"],"bié biè":["別","别"],"páo bào":["刨"],"chǎn chàn":["刬","剗","幝"],guā:["刮","劀","桰","歄","煱","瓜","胍","踻","颪","颳","騧","鴰","鸹"],gēng:["刯","庚","椩","浭","焿","畊","絚","羮","羹","耕","菮","賡","赓","鶊","鹒"],dào:["到","噵","悼","椡","檤","燾","瓙","盗","盜","稲","稻","纛","翿","艔","菿","衜","衟","軇","道"],chuàng:["刱","剏","剙","怆","愴"],kū:["刳","哭","圐","堀","枯","桍","矻","窟","跍","郀","骷","鮬"],duò:["刴","剁","墯","尮","惰","憜","挅","桗","舵","跥","跺","陊","陏","飿","饳","鵽"],"shuā shuà":["刷"],"quàn xuàn":["券"],"chà shā":["刹","剎"],"cì cī":["刺"],guì:["刽","刿","劊","劌","撌","攰","昋","桂","椢","槶","樻","櫃","猤","禬","筀","蓕","襘","貴","贵","跪","鐀","鑎","鞼","鱖","鱥"],lóu:["剅","娄","婁","廔","楼","樓","溇","漊","熡","耧","耬","艛","蒌","蔞","蝼","螻","謱","軁","遱","鞻","髅","髏","𪣻"],cuò:["剉","剒","厝","夎","挫","措","棤","莝","莡","蓌","逪","銼","錯","锉","错"],"xiāo xuē":["削"],"kēi kè":["剋","尅"],"là lá":["剌"],tī:["剔","梯","踢","銻","锑","鷈","鷉","䏲","䴘"],pōu:["剖"],wān:["剜","塆","壪","帵","弯","彎","湾","潫","灣","睕","蜿","豌"],"bāo bō":["剝","剥"],duō:["剟","咄","哆","嚉","多","夛","掇","毲","畓","裰","㙍"],qíng:["剠","勍","夝","情","擎","晴","暒","棾","樈","檠","氰","甠","硘","葝","黥"],"yǎn shàn":["剡"],"dū zhuó":["剢"],yān:["剦","嫣","崦","嶖","恹","懕","懨","樮","淊","淹","漹","烟","焉","焑","煙","珚","篶","胭","臙","菸","鄢","醃","閹","阉","黫"],huō:["剨","劐","吙","攉","秴","耠","锪","騞","𬴃"],shèng:["剩","剰","勝","圣","墭","嵊","晠","榺","橳","琞","聖","蕂","貹","賸"],"duān zhì":["剬"],wū:["剭","呜","嗚","圬","屋","巫","弙","杇","歍","汙","汚","污","洿","烏","窏","箼","螐","誈","誣","诬","邬","鄔","鎢","钨","鰞","鴮"],gē:["割","哥","圪","彁","戈","戓","戨","歌","滒","犵","肐","袼","謌","鎶","鴚","鴿","鸽"],"dá zhá":["剳"],chuán:["剶","暷","椽","篅","舡","舩","船","輲","遄"],"tuán zhuān":["剸","漙","篿"],"lù jiū":["剹"],pēng:["剻","匉","嘭","怦","恲","抨","梈","烹","砰","軯","駍"],piāo:["剽","勡","慓","旚","犥","翲","螵","飃","飄","飘","魒"],kōu:["剾","彄","抠","摳","眍","瞘","芤","𫸩"],"jiǎo chāo":["剿","劋","勦","摷"],qiāo:["劁","勪","墝","幧","敲","橇","毃","燆","硗","磽","繑","趬","跷","踍","蹺","蹻","郻","鄡","鄥","鍫","鍬","鐰","锹","頝"],"huá huà":["劃"],"zhā zhá":["劄"],"pī pǐ":["劈","悂"],tāng:["劏","嘡","羰","薚","蝪","蹚","鞺","鼞"],chán:["劖","嚵","壥","婵","嬋","巉","廛","棎","毚","湹","潹","潺","澶","瀍","瀺","煘","獑","磛","緾","纏","纒","缠","艬","蝉","蟐","蟬","蟾","誗","讒","谗","躔","鄽","酁","鋋","鑱","镵","饞","馋"],zuān:["劗","躜","躦","鉆","鑚"],mó:["劘","嫫","嬤","嬷","尛","摹","擵","橅","糢","膜","藦","蘑","謨","謩","谟","饃","饝","馍","髍","魔","魹"],zhú:["劚","斸","曯","欘","灟","炢","烛","燭","爥","瘃","竹","笁","笜","舳","茿","蓫","蠋","蠾","躅","逐","逫","钃","鱁"],quàn:["劝","勧","勸","牶","韏"],"jìn jìng":["劤","劲","勁"],kēng:["劥","坑","牼","硁","硜","誙","銵","鍞","鏗","铿","阬"],"xié liè":["劦"],"zhù chú":["助"],nǔ:["努","弩","砮","胬"],shào:["劭","卲","哨","潲","紹","綤","绍","袑","邵"],miǎo:["劰","杪","淼","渺","眇","秒","篎","緲","缈","藐","邈"],kǒu:["劶","口"],wā:["劸","娲","媧","屲","挖","攨","洼","溛","漥","瓾","畖","穵","窊","窪","蛙","韈","鼃"],kuāng:["劻","匡","匩","哐","恇","洭","筐","筺","誆","诓","軭","邼"],hé:["劾","咊","啝","姀","峆","敆","曷","柇","楁","毼","河","涸","渮","澕","熆","皬","盇","盉","盍","盒","禾","篕","籺","粭","翮","菏","萂","覈","訸","詥","郃","釛","鉌","鑉","閡","闔","阂","阖","鞨","頜","餄","饸","魺","鹖","麧","齕","龁","龢","𬌗"],gào:["勂","吿","告","峼","祮","祰","禞","筶","誥","诰","郜","鋯","锆"],"bó bèi":["勃"],láng:["勆","嫏","廊","斏","桹","榔","樃","欴","狼","琅","瑯","硠","稂","艆","蓈","蜋","螂","躴","郒","郞","鋃","鎯","锒"],xūn:["勋","勛","勲","勳","嚑","坃","埙","塤","壎","壦","曛","燻","獯","矄","纁","臐","薫","薰","蘍","醺","𫄸"],"juàn juān":["勌","瓹"],"lè lēi":["勒"],kài:["勓","炌","烗","鎎"],"wěng yǎng":["勜"],qín:["勤","嗪","噙","嶜","庈","懃","懄","捦","擒","斳","檎","澿","珡","琴","琹","瘽","禽","秦","耹","芩","芹","菦","螓","蠄","鈙","鈫","雂","靲","鳹","鵭"],jiàng:["勥","匞","匠","嵹","弜","弶","摾","櫤","洚","滰","犟","糡","糨","絳","绛","謽","酱","醤","醬"],fān:["勫","嬏","帆","幡","忛","憣","旙","旛","繙","翻","藩","轓","颿","飜","鱕"],juān:["勬","姢","娟","捐","涓","蠲","裐","鎸","鐫","镌","鹃"],"tóng dòng":["勭","烔","燑","狪"],lǜ:["勴","垏","嵂","律","慮","氯","滤","濾","爈","箻","綠","繂","膟","葎","虑","鑢"],chè:["勶","坼","彻","徹","掣","撤","澈","烢","爡","瞮","硩","聅","迠","頙","㬚"],sháo:["勺","玿","韶"],"gōu gòu":["勾"],cōng:["匆","囪","囱","忩","怱","悤","暰","樬","漗","瑽","璁","瞛","篵","繱","聡","聦","聪","聰","苁","茐","葱","蓯","蔥","蟌","鍯","鏓","鏦","騘","驄","骢"],"táo yáo":["匋","陶"],páo:["匏","咆","垉","庖","爮","狍","袍","褜","軳","鞄","麅"],dá:["匒","妲","怛","炟","燵","畣","笪","羍","荙","薘","蟽","詚","达","迏","迖","迚","逹","達","鐽","靼","鞑","韃","龖","龘","𫟼"],"huà huā":["化"],"běi bèi":["北"],nǎo:["匘","垴","堖","嫐","恼","悩","惱","瑙","碯","脑","脳","腦"],"chí shi":["匙"],fāng:["匚","堏","方","淓","牥","芳","邡","鈁","錺","钫","鴋"],zā:["匝","咂","帀","沞","臜","臢","迊","鉔","魳"],qiè:["匧","厒","妾","怯","悏","惬","愜","挈","穕","窃","竊","笡","箧","篋","籡","踥","鍥","锲","鯜"],"zāng cáng":["匨"],fěi:["匪","奜","悱","棐","榧","篚","翡","蕜","誹","诽"],"kuì guì":["匮","匱"],suǎn:["匴"],pǐ:["匹","噽","嚭","圮","庀","痞","癖","脴","苉","銢","鴄"],"qū ōu":["区","區"],"kē qià":["匼"],"yǎn yàn":["匽","棪"],biǎn:["匾","惼","揙","碥","稨","窆","藊","褊","貶","贬","鴘"],nì:["匿","堄","嫟","嬺","惄","愵","昵","暱","氼","眤","睨","縌","胒","腻","膩","逆","𨺙"],niàn:["卄","唸","埝","廿","念","惗","艌"],sà:["卅","櫒","脎","萨","蕯","薩","鈒","隡","颯","飒","馺"],zú:["卆","哫","崪","族","箤","足","踤","镞"],shēng:["升","呏","声","斘","昇","曻","枡","殅","泩","湦","焺","牲","珄","生","甥","竔","笙","聲","鉎","鍟","阩","陞","陹","鵿","鼪"],wàn:["卍","卐","忨","杤","瞣","脕","腕","萬","蟃","贎","輐","錽","𬇕"],"huá huà huā":["华","華"],bēi:["卑","悲","揹","杯","桮","盃","碑","藣","鵯","鹎"],"zú cù":["卒"],"dān shàn chán":["单","單"],"nán nā":["南"],"shuài lǜ":["卛"],"bǔ bo pú":["卜"],"kuàng guàn":["卝"],biàn:["卞","变","変","峅","弁","徧","忭","抃","昪","汳","汴","玣","艑","苄","覍","諚","變","辡","辧","辨","辩","辫","辮","辯","遍","釆","𨚕"],bǔ:["卟","哺","捕","补","補","鸔","𬷕"],"zhàn zhān":["占","覱"],"kǎ qiǎ":["卡"],lú:["卢","嚧","垆","壚","庐","廬","曥","枦","栌","櫨","泸","瀘","炉","爐","獹","玈","瓐","盧","矑","籚","纑","罏","胪","臚","舮","舻","艫","芦","蘆","蠦","轤","轳","鈩","鑪","顱","颅","馿","髗","魲","鱸","鲈","鸕","鸬","黸","𬬻"],lǔ:["卤","塷","掳","擄","樐","橹","櫓","氌","滷","澛","瀂","硵","磠","穞","艣","艪","蓾","虏","虜","鏀","鐪","鑥","镥","魯","鲁","鹵"],guà:["卦","啩","挂","掛","罣","褂","詿","诖"],"áng yǎng":["卬"],yìn:["印","垽","堷","廕","慭","憖","憗","懚","洕","湚","猌","癊","胤","茚","酳","鮣","䲟"],què:["却","卻","塙","崅","悫","愨","慤","搉","榷","燩","琷","皵","确","確","礭","闋","阕","鵲","鹊","𬒈"],luǎn:["卵"],"juàn juǎn":["卷","巻"],"chǎng ān hàn":["厂"],"wěi yán":["厃"],tīng:["厅","厛","听","庁","廰","廳","汀","烃","烴","綎","耓","聴","聼","聽","鞓","𬘩"],"zhé zhái":["厇"],"hàn àn":["厈","屽"],yǎ:["厊","唖","庌","痖","瘂","蕥"],shè:["厍","厙","弽","慑","慴","懾","摂","欇","涉","涻","渉","滠","灄","社","舎","蔎","蠂","設","设","赦","騇","麝"],dǐ:["厎","呧","坘","弤","抵","拞","掋","牴","砥","菧","觝","詆","诋","軧","邸","阺","骶","鯳"],"zhǎ zhǎi":["厏"],páng:["厐","嫎","庞","徬","舽","螃","逄","鰟","鳑","龎","龐"],"zhì shī":["厔"],máng:["厖","吂","哤","娏","忙","恾","杗","杧","汒","浝","牻","痝","盲","硭","笀","芒","茫","蘉","邙","釯","鋩","铓","駹"],zuī:["厜","樶","纗","蟕"],"shà xià":["厦","廈"],áo:["厫","嗷","嗸","廒","敖","滶","獒","獓","璈","翱","翶","翺","聱","蔜","螯","謷","謸","遨","鏖","隞","鰲","鳌","鷔","鼇"],"lán qiān":["厱"],"sī mǒu":["厶"],"gōng hóng":["厷"],"lín miǎo":["厸"],"qiú róu":["厹"],dū:["厾","嘟","督","醏"],"xiàn xuán":["县","縣"],"cān shēn cēn sān":["参","參","叄","叅"],"ài yǐ":["叆"],"chā chà chǎ chá":["叉"],shuāng:["双","孀","孇","欆","礵","艭","雙","霜","騻","驦","骦","鷞","鸘","鹴"],shōu:["収","收"],guái:["叏"],bá:["叐","妭","抜","拔","炦","癹","胈","茇","菝","詙","跋","軷","魃","鼥"],"fā fà":["发"],"zhuó yǐ lì jué":["叕"],qǔ:["取","娶","竬","蝺","詓","齲","龋"],"jiǎ xiá":["叚","徦"],"wèi yù":["叞","尉","蔚"],dié:["叠","垤","堞","峌","幉","恎","惵","戜","曡","殜","氎","牃","牒","瓞","畳","疂","疉","疊","碟","絰","绖","耊","耋","胅","艓","苵","蜨","蝶","褋","詄","諜","谍","跮","蹀","迭","镻","鰈","鲽","鴩","𫶇"],ruì:["叡","枘","汭","瑞","睿","芮","蚋","蜹","銳","鋭","锐"],"jù gōu":["句"],lìng:["另","呤","炩","蘦"],"dāo dáo tāo":["叨"],"zhī zhǐ":["只"],jiào:["叫","呌","嘂","嘦","噍","嬓","斍","斠","滘","漖","獥","珓","皭","窖","藠","訆","譥","趭","較","轎","轿","较","酵","醮","釂"],"zhào shào":["召"],"kě kè":["可"],"tái tāi":["台","苔"],pǒ:["叵","尀","笸","箥","鉕","钷","駊"],"yè xié":["叶"],"hào háo":["号"],tàn:["叹","嘆","探","歎","湠","炭","碳","舕"],"hōng hóng":["叿"],miē:["吀","咩","哶","孭"],"xū yū yù":["吁"],chī:["吃","哧","喫","嗤","噄","妛","媸","彨","彲","摛","攡","殦","瓻","痴","癡","眵","瞝","笞","粚","胵","蚩","螭","訵","魑","鴟","鵄","鸱","黐","齝","𫄨"],"xuān sòng":["吅"],yāo:["吆","喓","夭","妖","幺","楆","殀","祅","腰","葽","訞","邀","鴁","鴢","㙘"],zǐ:["吇","姉","姊","子","杍","梓","榟","橴","滓","矷","秭","笫","籽","紫","耔","虸","訿","釨"],"hé gě":["合","鲄"],"cùn dòu":["吋"],"tóng tòng":["同"],"tǔ tù":["吐","唋"],"zhà zhā":["吒","奓"],"xià hè":["吓"],"ā yā":["吖"],"ma má mǎ":["吗"],lìn:["吝","恡","悋","橉","焛","甐","膦","蔺","藺","賃","赁","蹸","躏","躙","躪","轥","閵"],tūn:["吞","暾","朜","焞"],"bǐ pǐ":["吡"],qìn:["吢","吣","唚","抋","揿","搇","撳","沁","瀙","菣","藽"],"jiè gè":["吤"],"fǒu pǐ":["否"],"ba bā":["吧"],dūn:["吨","噸","墩","墪","惇","撉","撴","犜","獤","礅","蜳","蹾","驐"],fēn:["吩","帉","昐","朆","梤","棻","氛","竕","紛","纷","翂","芬","衯","訜","躮","酚","鈖","雰","餴","饙","馚"],"é huā":["吪"],"kēng háng":["吭","妔"],shǔn:["吮"],"zhī zī":["吱"],"yǐn shěn":["吲"],wú:["吳","吴","呉","墲","峿","梧","橆","毋","洖","浯","無","珸","璑","祦","芜","茣","莁","蕪","蜈","蟱","譕","郚","鋙","铻","鯃","鵐","鷡","鹀","鼯"],"chǎo chāo":["吵"],"nà nè":["吶"],"xuè chuò jué":["吷"],chuī:["吹","炊","龡"],"dōu rú":["吺"],hǒu:["吼","犼"],"hōng hǒu ōu":["吽"],"wú yù":["吾"],"ya yā":["呀"],"è e":["呃"],dāi:["呆","懛","獃"],"mèn qǐ":["呇"],hōng:["呍","嚝","揈","灴","烘","焢","硡","薨","訇","谾","軣","輷","轟","轰","鍧"],nà:["呐","捺","笝","納","纳","肭","蒳","衲","豽","貀","軜","郍","鈉","钠","靹","魶"],"tūn tiān":["呑"],"fǔ ḿ":["呒","嘸"],"dāi tǎi":["呔"],"ǒu ōu òu":["呕"],"bài bei":["呗"],"yuán yún yùn":["员","員"],guō:["呙","啯","嘓","埚","堝","墎","崞","彉","彍","懖","猓","瘑","聒","蝈","蟈","郭","鈛","鍋","锅"],"huá qì":["呚"],"qiàng qiāng":["呛","跄"],shī:["呞","失","尸","屍","师","師","施","浉","湤","湿","溮","溼","濕","狮","獅","瑡","絁","葹","蒒","蓍","虱","蝨","褷","襹","詩","诗","邿","釃","鉇","鍦","鯴","鰤","鲺","鳲","鳾","鶳","鸤","䴓","𫚕"],juǎn:["呟","埍","臇","菤","錈","锩"],pěn:["呠","翸"],"wěn mǐn":["呡"],"ne ní":["呢"],"ḿ m̀ móu":["呣"],rán:["呥","嘫","然","燃","繎","肰","蚦","蚺","衻","袇","袡","髥","髯"],"tiè chè":["呫"],"qì zhī":["呮"],"zǐ cī":["呰"],"guā gū guǎ":["呱"],"cī zī":["呲"],"hǒu xǔ gòu":["呴"],"hē ā á ǎ à a":["呵"],náo:["呶","夒","峱","嶩","巎","挠","撓","猱","硇","蛲","蟯","詉","譊","鐃","铙"],"xiā gā":["呷"],pēi:["呸","怌","肧","胚","衃","醅"],"háo xiāo":["呺"],mìng:["命","掵"],"dá dàn":["呾"],"zuǐ jǔ":["咀"],"xián gān":["咁"],pǒu:["咅","哣","犃"],"yǎng yāng":["咉"],"zǎ zé zhā":["咋"],"hé hè huó huò hú":["和"],hāi:["咍"],dā:["咑","哒","噠","墶","搭","撘","耷","褡","鎝","𨱏"],"kǎ kā":["咔"],gū:["咕","唂","唃","姑","嫴","孤","巬","巭","柧","橭","沽","泒","稒","笟","箍","箛","篐","罛","苽","菇","菰","蓇","觚","軱","軲","轱","辜","酤","鈲","鮕","鴣","鸪"],"kā gā":["咖"],zuo:["咗"],lóng:["咙","嚨","嶐","巃","巄","昽","曨","朧","栊","槞","櫳","湰","滝","漋","爖","珑","瓏","癃","眬","矓","砻","礱","礲","窿","竜","聋","聾","胧","茏","蘢","蠪","蠬","襱","豅","鏧","鑨","霳","靇","驡","鸗","龍","龒","龙"],"xiàn xián":["咞"],qì:["咠","唭","噐","器","夡","弃","憇","憩","暣","棄","欫","气","気","氣","汔","汽","泣","湆","湇","炁","甈","盵","矵","碛","碶","磜","磧","罊","芞","葺","藒","蟿","訖","讫","迄","鐑"],"xì dié":["咥"],"liē liě lié lie":["咧"],zī:["咨","嗞","姕","姿","孜","孳","孶","崰","嵫","栥","椔","淄","湽","滋","澬","玆","禌","秶","粢","紎","緇","緕","纃","缁","茊","茲","葘","諮","谘","貲","資","赀","资","赼","趑","趦","輜","輺","辎","鄑","鈭","錙","鍿","鎡","锱","镃","頾","頿","髭","鯔","鰦","鲻","鶅","鼒","齍","齜","龇"],mī:["咪"],"jī xī qià":["咭"],"gē luò kǎ lo":["咯"],"shù xún":["咰"],"zán zá zǎ zan":["咱"],"hāi ké":["咳"],huī:["咴","噅","噕","婎","媈","幑","徽","恢","拻","挥","揮","晖","暉","楎","洃","瀈","灰","灳","烣","睳","禈","翚","翬","蘳","袆","褘","詼","诙","豗","輝","辉","鰴","麾","㧑"],"huài shì":["咶"],táo:["咷","啕","桃","檮","洮","淘","祹","綯","绹","萄","蜪","裪","迯","逃","醄","鋾","鞀","鞉","饀","駣","騊","鼗","𫘦"],xián:["咸","啣","娴","娹","婱","嫌","嫺","嫻","弦","挦","撏","涎","湺","澖","甉","痫","癇","癎","絃","胘","舷","藖","蚿","蛝","衔","衘","誸","諴","賢","贒","贤","輱","醎","銜","鑦","閑","闲","鷳","鷴","鷼","鹇","鹹","麙","𫍯"],"è àn":["咹"],"xuān xuǎn":["咺","烜"],"wāi hé wǒ guǎ guō":["咼"],"yàn yè yān":["咽"],āi:["哀","哎","埃","溾","銰","鎄","锿"],pǐn:["品","榀"],shěn:["哂","婶","嬸","审","宷","審","弞","曋","渖","瀋","瞫","矤","矧","覾","訠","諗","讅","谂","谉","邥","頣","魫"],"hǒng hōng hòng":["哄"],"wā wa":["哇"],"hā hǎ hà":["哈"],zāi:["哉","栽","渽","溨","災","灾","烖","睵","賳"],"dì diè":["哋"],pài:["哌","沠","派","渒","湃","蒎","鎃"],"gén hěn":["哏"],"yǎ yā":["哑","雅"],"yuě huì":["哕","噦"],nián:["哖","年","秊","秥","鮎","鯰","鲇","鲶","鵇","黏"],"huá huā":["哗","嘩"],"jì jiē zhāi":["哜","嚌"],mōu:["哞"],"yō yo":["哟","喲"],lòng:["哢","梇","贚"],"ò ó é":["哦"],"lī lǐ li":["哩"],"nǎ na nǎi né něi":["哪"],hè:["哬","垎","壑","寉","惒","焃","煂","燺","爀","癋","碋","翯","褐","謞","賀","贺","赫","靍","靎","靏","鶴","鸖","鹤"],"bō pò bā":["哱"],zhé:["哲","啠","喆","嚞","埑","悊","摺","晢","晣","歽","矺","砓","磔","籷","粍","虴","蛰","蟄","袩","詟","謫","謺","讁","讋","谪","輒","輙","轍","辄","辙","鮿"],"liàng láng":["哴"],"liè lǜ":["哷"],hān:["哻","憨","蚶","谽","酣","頇","顸","馠","魽","鼾"],"hēng hng":["哼"],gěng:["哽","埂","峺","挭","梗","綆","绠","耿","莄","郠","骾","鯁","鲠","𬒔"],"chuò yuè":["哾"],"gě jiā":["哿"],"bei bài":["唄"],"hán hàn":["唅"],chún:["唇","浱","湻","滣","漘","犉","純","纯","脣","莼","蒓","蓴","醇","醕","錞","陙","鯙","鶉","鹑","𬭚"],"ài āi":["唉"],"jiá qiǎn":["唊"],"yán dàn xián":["唌"],chē:["唓","砗","硨","莗","蛼"],"wú ńg ń":["唔"],zào:["唕","唣","噪","慥","梍","灶","煰","燥","皁","皂","竃","竈","簉","艁","譟","趮","躁","造","𥖨"],dí:["唙","啇","嘀","嚁","嫡","廸","敌","敵","梑","涤","滌","狄","笛","籴","糴","苖","荻","蔋","蔐","藡","覿","觌","豴","迪","靮","頔","馰","髢","鸐","𬱖"],"gòng hǒng gǒng":["唝","嗊"],dóu:["唞"],"lào láo":["唠","嘮","憦"],huàn:["唤","喚","奂","奐","宦","嵈","幻","患","愌","换","換","擐","攌","梙","槵","浣","涣","渙","漶","澣","烉","焕","煥","瑍","痪","瘓","睆","肒","藧","豢","轘","逭","鯇","鯶","鰀","鲩"],léng:["唥","塄","楞","碐","薐"],"wō wěi":["唩"],fěng:["唪","覂","諷","讽"],"yín jìn":["唫"],"hǔ xià":["唬"],wéi:["唯","围","圍","壝","峗","峞","嵬","帏","帷","幃","惟","桅","沩","洈","涠","湋","溈","潍","潙","潿","濰","犩","矀","維","维","蓶","覹","违","違","鄬","醀","鍏","闈","闱","韋","韦","鮠","𣲗","𬶏"],shuā:["唰"],chàng:["唱","怅","悵","暢","焻","畅","畼","誯","韔","鬯"],"ér wā":["唲"],qiàng:["唴","炝","熗","羻"],yō:["唷"],yū:["唹","淤","瘀","盓","箊","紆","纡","込","迂","迃","陓"],lài:["唻","濑","瀨","瀬","癞","癩","睐","睞","籁","籟","藾","賚","賴","赉","赖","頼","顂","鵣"],tuò:["唾","嶞","柝","毤","毻","箨","籜","萚","蘀","跅"],"zhōu zhāo tiào":["啁"],kěn:["啃","垦","墾","恳","懇","肎","肯","肻","豤","錹"],"zhuó zhào":["啅","濯"],"hēng hèng":["啈","悙"],"lín lán":["啉"],"a ā á ǎ à":["啊"],qiāng:["啌","嗴","嶈","戕","摤","斨","枪","槍","溬","牄","猐","獇","羌","羗","腔","蜣","謒","鏘","锖","锵"],"tūn zhūn xiāng duǐ":["啍"],wèn:["問","妏","揾","搵","璺","问","顐"],"cuì qi":["啐"],"dié shà jié tì":["啑"],"yuē wā":["啘"],"zǐ cǐ":["啙"],"bǐ tú":["啚"],"chuò chuài":["啜"],"yǎ yā è":["啞"],fēi:["啡","婓","婔","扉","暃","渄","猆","緋","绯","裶","霏","非","靟","飛","飝","飞","餥","馡","騑","騛","鯡","鲱","𬴂"],pí:["啤","壀","枇","毗","毘","焷","琵","疲","皮","篺","罴","羆","脾","腗","膍","蚍","蚽","蜱","螷","蠯","豼","貔","郫","鈹","阰","陴","隦","魮","鮍","鲏","鵧","鼙"],shá:["啥"],"lā la":["啦"],"yīng qíng":["啨"],pā:["啪","妑","舥","葩","趴"],"zhě shì":["啫"],sè:["啬","嗇","懎","擌","栜","歮","涩","渋","澀","澁","濇","濏","瀒","瑟","璱","瘷","穑","穡","穯","繬","譅","轖","銫","鏼","铯","飋"],niè:["啮","嗫","噛","嚙","囁","囓","圼","孼","孽","嵲","嶭","巕","帇","敜","枿","槷","櫱","涅","湼","痆","篞","籋","糱","糵","聂","聶","臬","臲","蘖","蠥","讘","踂","踗","踙","蹑","躡","錜","鎳","鑈","鑷","钀","镊","镍","闑","陧","隉","顳","颞","齧","𫔶"],"luō luó luo":["啰","囉"],"tān chǎn tuō":["啴"],bo:["啵","蔔"],dìng:["啶","定","椗","矴","碇","碠","磸","聢","腚","萣","蝊","訂","订","錠","锭","顁","飣","饤"],lāng:["啷"],"án ān":["啽"],kā:["喀","擖"],"yóng yú":["喁"],"lā lá lǎ":["喇"],jiē:["喈","喼","嗟","堦","媘","接","掲","擑","湝","煯","疖","痎","癤","皆","秸","稭","脻","蝔","街","謯","阶","階","鞂","鶛"],hóu:["喉","帿","猴","瘊","睺","篌","糇","翭","葔","鄇","鍭","餱","骺","鯸","𬭤"],"dié zhá":["喋"],wāi:["喎","歪","竵"],"nuò rě":["喏"],"xù huò guó":["喐"],zán:["喒"],"wō ō":["喔"],hú:["喖","嘝","囫","壶","壷","壺","媩","弧","搰","斛","楜","槲","湖","瀫","焀","煳","狐","猢","瑚","瓳","箶","絗","縠","胡","葫","蔛","蝴","螜","衚","觳","醐","鍸","頶","餬","鬍","魱","鰗","鵠","鶘","鶦","鹕"],"huàn yuán xuǎn hé":["喛"],xǐ:["喜","囍","壐","屣","徙","憙","枲","橲","歖","漇","玺","璽","矖","禧","縰","葈","葸","蓰","蟢","謑","蹝","躧","鈢","鉨","鉩","鱚","𬭳","𬶮"],"hē hè yè":["喝"],kuì:["喟","嘳","媿","嬇","愦","愧","憒","篑","簣","籄","聩","聭","聵","膭","蕢","謉","餽","饋","馈"],"zhǒng chuáng":["喠"],"wéi wèi":["喡","為","爲"],"duó zhà":["喥"],"sāng sàng":["喪"],"qiáo jiāo":["喬"],"pèn bēn":["喯"],"cān sūn qī":["喰"],"zhā chā":["喳"],miāo:["喵"],"pēn pèn":["喷"],kuí:["喹","夔","奎","巙","戣","揆","晆","暌","楏","楑","櫆","犪","睽","葵","藈","蘷","虁","蝰","躨","逵","鄈","鍨","鍷","頯","馗","騤","骙","魁"],"lou lóu":["喽"],"zào qiāo":["喿"],"hè xiāo xiào hù":["嗃"],"á shà":["嗄"],xiù:["嗅","岫","峀","溴","珛","琇","璓","秀","綉","繍","繡","绣","螑","袖","褎","褏","銹","鏥","鏽","锈","齅"],"qiāng qiàng":["嗆","戗","戧","蹌","蹡"],"ài yì":["嗌","艾"],"má mǎ ma":["嗎"],"kè kē":["嗑"],"dā tà":["嗒","鎉"],sǎng:["嗓","搡","磉","褬","鎟","顙","颡"],chēn:["嗔","抻","琛","瞋","諃","謓","賝","郴","𬘭"],"wā gǔ":["嗗"],"pǎng bēng":["嗙"],"xián qiǎn qiān":["嗛"],lào:["嗠","嫪","橯","涝","澇","耢","耮","躼","軂","酪"],wēng:["嗡","翁","聬","螉","鎓","鶲","鹟","𬭩"],wà:["嗢","腽","膃","袜","襪","韤"],"hēi hāi":["嗨"],hē:["嗬","欱","蠚","訶","诃"],zi:["嗭"],sǎi:["嗮"],"ǹg ńg ňg":["嗯"],gě:["嗰","舸"],ná:["嗱","拏","拿","鎿","镎"],diǎ:["嗲"],"ài ǎi āi":["嗳"],tōng:["嗵","樋","炵","蓪"],"zuī suī":["嗺"],"zhē zhè zhù zhe":["嗻"],mò:["嗼","圽","塻","墨","妺","嫼","寞","帞","昩","末","枺","歿","殁","沫","漠","爅","獏","瘼","皌","眽","眿","瞐","瞙","砞","礳","秣","絈","纆","耱","茉","莈","蓦","蛨","蟔","貃","貊","貘","銆","鏌","镆","陌","靺","驀","魩","默","黙","𬙊"],sòu:["嗽","瘶"],tǎn:["嗿","坦","忐","憳","憻","暺","毯","璮","菼","袒","襢","醓","鉭","钽"],"jiào dǎo":["嘄"],"kǎi gě":["嘅"],"shān càn":["嘇"],cáo:["嘈","嶆","曹","曺","槽","漕","艚","蓸","螬","褿","鏪","𥕢"],piào:["嘌","徱","蔈","驃"],"lóu lou":["嘍"],gǎ:["尕","玍"],"gǔ jiǎ":["嘏"],"jiāo xiāo":["嘐"],"xū shī":["嘘","噓"],pó:["嘙","嚩","婆","櫇","皤","鄱"],"dē dēi":["嘚"],"ma má":["嘛"],"lē lei":["嘞"],"gā gá gǎ":["嘠"],sāi:["嘥","噻","毢","腮","顋","鰓"],"zuō chuài":["嘬"],"cháo zhāo":["嘲","朝","鼂"],zuǐ:["嘴","噿","嶊","璻"],"qiáo qiào":["嘺","翹","谯"],"chù xù shòu":["嘼"],"tān chǎn":["嘽"],"dàn tán":["嘾","弾","彈","惔","澹"],"hēi mò":["嘿"],ě:["噁","砨","頋","騀","鵈"],"fān bo":["噃"],chuáng:["噇","床","牀"],"cù zā hé":["噈"],"tūn kuò":["噋"],"cēng chēng":["噌"],dēng:["噔","嬁","灯","燈","璒","登","竳","簦","艠","豋"],pū:["噗","扑","撲","攴","攵","潽","炇","陠"],juē:["噘","屩","屫","撧"],lū:["噜","嚕","撸","擼","謢"],zhān:["噡","岾","惉","旃","旜","枬","栴","毡","氈","氊","沾","瞻","薝","蛅","詀","詹","譫","谵","趈","邅","閚","霑","飦","饘","驙","魙","鱣","鸇","鹯","𫗴"],ō:["噢"],"zhòu zhuó":["噣"],"jiào qiào chī":["噭"],yuàn:["噮","妴","怨","愿","掾","瑗","禐","苑","衏","裫","褑","院","願"],"ǎi ài āi":["噯"],"yōng yǒng":["噰","澭"],"jué xué":["噱"],"pēn pèn fèn":["噴"],gá:["噶","尜","釓","錷","钆"],"xīn hěn hèn":["噷"],dāng:["噹","澢","珰","璫","筜","簹","艡","蟷","裆","襠"],làn:["嚂","滥","濫","烂","燗","爁","爛","爤","瓓","糷","钄"],tà:["嚃","嚺","崉","挞","搨","撻","榻","橽","毾","涾","澾","濌","禢","粏","誻","譶","蹋","蹹","躂","躢","遝","錔","闒","闥","闼","阘","鞜","鞳"],"huō huò ǒ":["嚄"],hāo:["嚆","茠","蒿","薅"],"hè xià":["嚇"],"xiù pì":["嚊"],"zhōu chóu":["嚋","盩","诪"],mē:["嚒"],"chā cā":["嚓"],"bó pào bào":["嚗"],"me mèi mò":["嚜"],"xié hái":["嚡"],"áo xiāo":["嚣"],mō:["嚤","摸"],pín:["嚬","娦","嫔","嬪","玭","矉","薲","蠙","貧","贫","顰","颦","𬞟"],mè:["嚰","濹"],"rǎng rāng":["嚷"],lá:["嚹","旯"],"jiáo jué jiào":["嚼"],chuò:["嚽","娖","擉","歠","涰","磭","踀","輟","辍","辵","辶","酫","鑡","餟","齪","龊"],"huān huàn":["嚾"],"zá cà":["囃"],chài:["囆","虿","蠆","袃","訍"],"náng nāng":["囊"],"zá zàn cān":["囋"],sū:["囌","櫯","甦","稣","穌","窣","蘇","蘓","酥","鯂"],zèng:["囎","熷","甑","贈","赠","鋥","锃"],"zá niè yàn":["囐"],nāng:["囔"],"luó luō luo":["囖"],"wéi guó":["囗"],huí:["囘","回","囬","廻","廽","恛","洄","痐","茴","蚘","蛔","蛕","蜖","迴","逥","鮰"],nín:["囜","您","脌"],"jiǎn nān":["囝"],nān:["囡"],tuán:["团","団","團","慱","抟","摶","檲","糰","鏄","鷒","鷻"],"tún dùn":["囤","坉"],guó:["囯","囶","囻","国","圀","國","帼","幗","慖","摑","漍","聝","腘","膕","蔮","虢","馘","𬇹"],kùn:["困","涃","睏"],"wéi tōng":["囲"],qūn:["囷","夋","逡"],rì:["囸","日","衵","鈤","馹","驲"],tāi:["囼","孡","胎"],pǔ:["圃","圑","擈","普","暜","樸","檏","氆","浦","溥","烳","諩","譜","谱","蹼","鐠","镨"],"quān juàn juān":["圈","圏"],"chuí chuán":["圌"],tuǎn:["圕","畽","疃"],lüè:["圙","掠","略","畧","稤","鋝","鋢","锊","䂮"],"huán yuán":["圜"],luán:["圝","圞","奱","娈","孌","孪","孿","峦","巒","挛","攣","曫","栾","欒","滦","灤","癴","癵","羉","脔","臠","虊","銮","鑾","鵉","鸞","鸾"],tǔ:["土","圡","釷","钍"],"xū wéi":["圩"],"dì de":["地","嶳"],"qiān sú":["圱"],zhèn:["圳","塦","挋","振","朕","栚","甽","眹","紖","絼","纼","誫","賑","赈","鋴","鎭","鎮","镇","阵","陣","震","鴆","鸩"],"chǎng cháng":["场","場","塲"],"qí yín":["圻"],jiá:["圿","忦","恝","戞","扴","脥","荚","莢","蛱","蛺","裌","跲","郏","郟","鋏","铗","頬","頰","颊","鴶","鵊"],"zhǐ zhì":["坁"],bǎn:["坂","岅","昄","板","版","瓪","粄","舨","蝂","鈑","钣","阪","魬"],qǐn:["坅","寑","寝","寢","昑","梫","笉","螼","赾","鋟","锓"],"méi fén":["坆"],"rǒng kēng":["坈"],"fāng fáng":["坊"],"fèn bèn":["坋"],tān:["坍","怹","摊","擹","攤","滩","灘","瘫","癱","舑","貪","贪"],"huài pēi pī péi":["坏"],"dì làn":["坔"],tán:["坛","墰","墵","壇","壜","婒","憛","昙","曇","榃","檀","潭","燂","痰","磹","罈","罎","藫","談","譚","譠","谈","谭","貚","郯","醰","錟","顃"],bà:["坝","垻","壩","弝","欛","灞","爸","矲","覇","霸","鮁","鲅"],fén:["坟","墳","妢","岎","幩","枌","棼","汾","焚","燌","燓","羒","羵","蒶","蕡","蚠","蚡","豮","豶","轒","鐼","隫","馩","魵","黂","鼖","鼢","𣸣"],zhuì:["坠","墜","惴","甀","畷","礈","綴","縋","缀","缒","腏","膇","諈","贅","赘","醊","錣","鑆"],pō:["坡","岥","泼","溌","潑","釙","鏺","钋","頗","颇","䥽"],"pǎn bàn":["坢"],kūn:["坤","堃","堒","崐","崑","昆","晜","潉","焜","熴","猑","琨","瑻","菎","蜫","裈","裩","褌","醌","錕","锟","騉","髠","髡","髨","鯤","鲲","鵾","鶤","鹍"],diàn:["坫","垫","墊","壂","奠","婝","店","惦","扂","橂","殿","淀","澱","玷","琔","电","癜","簟","蜔","鈿","電","靛","驔"],"mù mǔ":["坶"],"kē kě":["坷","軻"],xuè:["坹","岤","桖","瀥","狘","瞲","謔","谑","趐"],"dǐ chí":["坻","柢"],lā:["垃","柆","菈","邋"],lǒng:["垄","垅","壟","壠","拢","攏","竉","陇","隴","𬕂"],mín:["垊","姄","岷","崏","捪","旻","旼","民","珉","琘","琝","瑉","痻","盿","砇","緍","緡","缗","罠","苠","鈱","錉","鍲","鴖"],"dòng tóng":["垌","峒","洞"],cí:["垐","嬨","慈","柌","濨","珁","瓷","甆","磁","礠","祠","糍","茨","詞","词","辝","辞","辤","辭","雌","飺","餈","鴜","鶿","鷀","鹚"],duī:["垖","堆","塠","痽","磓","鐓","鐜","鴭"],"duò duǒ":["垛"],"duǒ duò":["垜","挆"],chá:["垞","察","嵖","搽","槎","檫","猹","茬","茶","詧","靫","𥻗"],shǎng:["垧","晌","樉","賞","贘","赏","鋿","鏛","鑜"],shǒu:["垨","守","手","扌","艏","首"],da:["垯","繨","跶"],háng:["垳","斻","杭","筕","絎","绗","航","苀","蚢","裄","貥","迒","頏","颃","魧"],"ān ǎn":["垵"],xīng:["垶","惺","星","曐","煋","猩","瑆","皨","篂","腥","興","觪","觲","謃","騂","骍","鮏","鯹"],"yuàn huán":["垸"],bāng:["垹","帮","幇","幚","幫","捠","梆","浜","邦","邫","鞤","𠳐"],"póu fú":["垺"],cén:["埁","岑","涔"],"běng fēng":["埄"],"dì fáng":["埅"],"xiá jiā":["埉"],"mái mán":["埋"],làng:["埌","崀","浪","蒗","閬","㫰"],"shān yán":["埏"],"qín jīn":["埐"],"pǔ bù":["埔"],huā:["埖","婲","椛","硴","糀","花","蒊","蘤","誮","錵"],"suì sù":["埣"],"pí pì":["埤"],"qīng zhēng":["埥","鲭"],"wǎn wān":["埦"],lǔn:["埨","稐","𫭢"],"zhēng chéng":["埩"],kōng:["埪","崆","箜","躻","錓","鵼"],"cǎi cài":["埰","寀","采"],"chù tòu":["埱"],běng:["埲","琫","菶","鞛"],"kǎn xiàn":["埳"],"yì shì":["埶","醳"],péi:["培","毰","裴","裵","賠","赔","錇","锫","阫","陪"],"sào sǎo":["埽"],"jǐn qīn jìn":["堇"],"péng bèng":["堋"],"qiàn zàn jiàn":["堑"],àn:["堓","屵","岸","按","暗","案","胺","荌","豻","貋","錌","闇","隌","黯"],"duò huī":["堕","墮"],huán:["堚","寏","寰","峘","桓","洹","澴","獂","环","環","糫","繯","缳","羦","荁","萈","萑","豲","鍰","鐶","锾","镮","闤","阛","雈","鬟","鹮","𬘫","𤩽"],"bǎo bǔ pù":["堡"],"máo móu wǔ":["堥"],ruán:["堧","壖","撋"],"ài è yè":["堨"],gèng:["堩","暅"],méi:["堳","塺","媒","嵋","徾","攗","枚","栂","梅","楣","楳","槑","湄","湈","煤","猸","玫","珻","瑂","眉","睂","禖","脄","脢","腜","苺","莓","葿","郿","酶","鎇","镅","霉","鶥","鹛","黴"],dǔ:["堵","琽","睹","笃","篤","覩","賭","赌"],féng:["堸","綘","艂","逢"],hèng:["堼"],chūn:["堾","媋","旾","春","暙","杶","椿","槆","橁","櫄","瑃","箺","萅","蝽","輴","鰆","鶞","䲠"],jiǎng:["塂","奖","奨","奬","桨","槳","獎","耩","膙","蒋","蔣","講","讲","顜"],huāng:["塃","巟","慌","肓","荒","衁"],duàn:["塅","断","斷","椴","段","毈","煅","瑖","碫","簖","籪","緞","缎","腶","葮","躖","鍛","锻"],tǎ:["塔","墖","獭","獺","鮙","鰨","鳎"],wěng:["塕","奣","嵡","攚","暡","瞈","蓊"],"sāi sài sè":["塞"],zàng:["塟","弉","臓","臟","葬","蔵","銺"],tián:["塡","屇","恬","沺","湉","璳","甛","甜","田","畋","畑","碵","磌","胋","闐","阗","鴫","鷆","鷏"],zhèng:["塣","幁","政","証","諍","證","证","诤","郑","鄭","靕","鴊"],"tián zhèn":["填"],wēn:["塭","昷","榲","殟","温","溫","瑥","瘟","蕰","豱","輼","轀","辒","鎾","饂","鰛","鰮","鳁"],liù:["塯","廇","磟","翏","雡","霤","餾","鬸","鷚","鹨"],hǎi:["塰","海","烸","酼","醢"],lǎng:["塱","朖","朗","朤","烺","蓢","㮾"],bèng:["塴","揼","泵","甏","綳","蹦","迸","逬","鏰","镚"],chén:["塵","宸","尘","忱","敐","敶","晨","曟","栕","樄","沉","煁","瘎","臣","茞","莀","莐","蔯","薼","螴","訦","諶","軙","辰","迧","鈂","陈","陳","霃","鷐","麎"],"ōu qiū":["塸"],"qiàn jiàn":["塹"],"zhuān tuán":["塼"],shuǎng:["塽","慡","漺","爽","縔","鏯"],shú:["塾","婌","孰","璹","秫","贖","赎"],lǒu:["塿","嵝","嶁","甊","篓","簍"],chí:["墀","弛","持","池","漦","竾","筂","箎","篪","茌","荎","蚳","謘","貾","赿","踟","迟","迡","遅","遟","遲","鍉","馳","驰"],shù:["墅","庶","庻","怷","恕","戍","束","树","樹","沭","漱","潄","濖","竖","竪","絉","腧","荗","蒁","虪","術","裋","豎","述","鉥","錰","鏣","霔","鶐","𬬸"],"dì zhì":["墆","疐"],kàn:["墈","崁","瞰","矙","磡","衎","鬫"],chěn:["墋","夦","硶","碜","磣","贂","趻","踸","鍖"],"zhǐ zhuó":["墌"],qiǎng:["墏","繈","繦","羥","襁"],zēng:["増","增","憎","璔","矰","磳","罾","譄","鄫","鱛","䎖"],qiáng:["墙","墻","嫱","嬙","樯","檣","漒","牆","艢","蔃","蔷","蘠"],"kuài tuí":["墤"],"tuǎn dǒng":["墥"],"qiáo què":["墧"],"zūn dūn":["墫"],"qiāo áo":["墽"],"yì tú":["墿"],"xué bó jué":["壆"],lǎn:["壈","嬾","孄","孏","懒","懶","揽","擥","攬","榄","欖","浨","漤","灠","纜","缆","罱","覧","覽","览","醂","顲"],huài:["壊","壞","蘾"],rǎng:["壌","壤","攘","爙"],"làn xiàn":["壏"],dǎo:["壔","导","導","岛","島","嶋","嶌","嶹","捣","搗","擣","槝","祷","禂","禱","蹈","陦","隝","隯"],ruǐ:["壡","桵","橤","繠","蕊","蕋","蘂","蘃"],san:["壭"],zhuàng:["壮","壯","壵","撞","焋","状","狀"],"ké qiào":["壳","殼"],kǔn:["壸","壼","悃","捆","梱","硱","祵","稇","稛","綑","裍","閫","閸","阃"],mǎng:["壾","漭","茻","莽","莾","蠎"],cún:["壿","存"],"zhǐ zhōng":["夂"],"gǔ yíng":["夃"],"jiàng xiáng":["夅","降"],"páng féng fēng":["夆"],zhāi:["夈","捚","摘","斋","斎","榸","粂","齋"],"xuàn xiòng":["夐"],wài:["外","顡"],"wǎn yuàn wān yuān":["夗"],"mǎo wǎn":["夘"],mèng:["夢","夣","孟","梦","癦","霥"],"dà dài":["大"],"fū fú":["夫","姇","枎","粰"],guài:["夬","怪","恠"],yāng:["央","姎","抰","殃","泱","秧","胦","鉠","鍈","雵","鴦","鸯"],"hāng bèn":["夯"],gǎo:["夰","搞","杲","槀","槁","檺","稁","稾","稿","縞","缟","菒","藁","藳"],"tāo běn":["夲"],"tóu tou":["头"],"yǎn tāo":["夵"],"kuā kuà":["夸","誇"],"jiá jiā gā xiá":["夹"],huà:["夻","婳","嫿","嬅","崋","摦","杹","枠","桦","槬","樺","澅","画","畫","畵","繣","舙","話","諙","譮","话","黊"],"jiā jiá gā xiá":["夾"],ēn:["奀","恩","蒽"],"dī tì":["奃"],"yǎn yān":["奄","渰"],pào:["奅","疱","皰","砲","礟","礮","靤","麭"],nài:["奈","柰","渿","耐","萘","褦","錼","鼐"],"quān juàn":["奍","弮","棬"],zòu:["奏","揍"],"qì qiè xiè":["契"],kāi:["奒","开","揩","鐦","锎","開"],"bēn bèn":["奔","泍"],tào:["套"],"zàng zhuǎng":["奘"],běn:["奙","本","楍","畚","翉","苯"],"xùn zhuì":["奞"],shē:["奢","檨","猞","畭","畲","賒","賖","赊","輋","𪨶"],"hǎ pò tǎi":["奤"],"ào yù":["奥","奧","澚"],yūn:["奫","氲","氳","蒀","蒕","蝹","贇","赟","𫖳"],"duǒ chě":["奲"],"nǚ rǔ":["女"],nú:["奴","孥","笯","駑","驽"],"dīng dǐng tiǎn":["奵"],"tā jiě":["她"],nuán:["奻"],"hǎo hào":["好"],fàn:["奿","嬎","梵","汎","泛","滼","瀪","犯","畈","盕","笵","範","范","訉","販","贩","軬","輽","飯","飰","饭"],shuò:["妁","搠","朔","槊","烁","爍","矟","蒴","鎙","鑠","铄"],"fēi pèi":["妃"],wàng:["妄","忘","旺","望","朢"],zhuāng:["妆","妝","娤","庄","庒","桩","梉","樁","粧","糚","荘","莊","装","裝"],mā:["妈","媽"],"fū yōu":["妋"],"hài jiè":["妎"],dù:["妒","妬","杜","殬","渡","秺","芏","荰","螙","蠧","蠹","鍍","镀","靯","𬭊"],miào:["妙","庙","庿","廟","玅","竗"],"fǒu pēi pī":["妚"],"yuè jué":["妜"],niū:["妞"],"nà nàn":["妠"],tuǒ:["妥","嫷","庹","椭","楕","橢","鬌","鰖","鵎"],"wàn yuán":["妧"],fáng:["妨","房","肪","防","魴","鲂"],nī:["妮"],zhóu:["妯","碡"],zhāo:["妱","巶","招","昭","釗","鉊","鍣","钊","駋","𬬿"],"nǎi nǐ":["妳"],tǒu:["妵","敨","紏","蘣","黈"],"xián xuán xù":["妶"],"zhí yì":["妷","秇"],ē:["妸","妿","婀","屙"],mèi:["妹","媚","寐","抺","旀","昧","沬","煝","痗","眛","睸","祙","篃","蝞","袂","跊","鬽","魅"],"qī qì":["妻"],"xū xǔ":["姁","稰"],"shān shàn":["姍","姗","苫","釤","钐"],mán:["姏","慲","樠","蛮","蠻","謾","饅","馒","鬗","鬘","鰻","鳗"],jiě:["姐","媎","檞","毑","飷"],"wěi wēi":["委"],pīn:["姘","拼","礗","穦","馪","驞"],"huá huó":["姡"],"jiāo xiáo":["姣"],"gòu dù":["姤"],"lǎo mǔ":["姥"],"nián niàn":["姩"],zhěn:["姫","屒","弫","抮","昣","枕","畛","疹","眕","稹","縝","縥","缜","聄","萙","袗","裖","覙","診","诊","軫","轸","辴","駗","鬒"],héng:["姮","恆","恒","烆","珩","胻","蘅","衡","鑅","鴴","鵆","鸻"],"jūn xún":["姰"],"kuā hù":["姱"],"è yà":["姶"],"xiān shēn":["姺"],wá:["娃"],"ráo rǎo":["娆","嬈"],"shào shāo":["娋"],xiē:["娎","揳","楔","歇","蝎","蠍"],"wǔ méi mǔ":["娒"],"chuò lài":["娕"],niáng:["娘","嬢","孃"],"nà nuó":["娜","𦰡"],"pōu bǐ":["娝"],"něi suī":["娞"],tuì:["娧","煺","蛻","蜕","退","駾"],mǎn:["娨","屘","満","满","滿","螨","蟎","襔","鏋"],"wú wù yú":["娪"],"xī āi":["娭"],"zhuì shuì":["娷"],"dōng dòng":["娻"],"ǎi ái è":["娾"],"ē ě":["娿"],mián:["婂","嬵","宀","杣","棉","檰","櫋","眠","矈","矊","矏","綿","緜","绵","芇","蝒"],"pǒu péi bù":["婄"],biǎo:["婊","脿","表","裱","褾","諘","錶"],"fù fàn":["婏"],wǒ:["婐","婑","我"],"ní nǐ":["婗","棿"],"quán juàn":["婘","惓"],hūn:["婚","昏","昬","棔","涽","睧","睯","碈","荤","葷","蔒","轋","閽","阍"],"qiān jǐn":["婜"],"wān wà":["婠"],"lái lài":["婡","徕","徠"],"zhōu chōu":["婤"],"chuò nào":["婥"],"nüè àn":["婩"],"hùn kūn":["婫"],"dàng yáng":["婸"],nàn:["婻"],"ruò chuò":["婼"],jiǎ:["婽","岬","斚","斝","榎","槚","檟","玾","甲","胛","鉀","钾"],"tōu yú":["婾","媮"],"yù yú":["媀"],"wéi wěi":["媁"],"dì tí":["媂","珶","苐"],róu:["媃","揉","柔","渘","煣","瑈","瓇","禸","粈","糅","脜","腬","葇","蝚","蹂","輮","鍒","鞣","騥","鰇","鶔","𫐓"],"ruǎn nèn":["媆"],miáo:["媌","嫹","描","瞄","苗","鶓","鹋"],"yí pèi":["媐"],"mián miǎn":["媔"],"tí shì":["媞","惿"],"duò tuó":["媠","沲"],ǎo:["媪","媼","艹","芺","袄","襖","镺"],"chú zòu":["媰"],yìng:["媵","映","暎","硬","膡","鱦"],"qín shēn":["嫀"],jià:["嫁","幏","架","榢","稼","駕","驾"],sǎo:["嫂"],"zhēn zhěn":["嫃"],"jiē suǒ":["嫅"],"míng mǐng":["嫇"],niǎo:["嫋","嬝","嬲","茑","蔦","袅","裊","褭","鸟"],tāo:["嫍","幍","弢","慆","掏","搯","槄","涛","滔","濤","瑫","絛","縚","縧","绦","詜","謟","轁","鞱","韜","韬","飸","饕"],biáo:["嫑"],"piáo piāo":["嫖","薸"],xuán:["嫙","悬","懸","暶","檈","漩","玄","璇","璿","痃","蜁","𫠊"],"màn mān":["嫚"],kāng:["嫝","嵻","康","慷","槺","漮","砊","穅","糠","躿","鏮","鱇","𡐓","𩾌"],"hān nǎn":["嫨"],nèn:["嫩","嫰"],zhē:["嫬","遮"],"mā má":["嫲"],piè:["嫳"],zhǎn:["嫸","展","搌","斩","斬","琖","盏","盞","輾","醆","颭","飐"],"xiān yǎn jìn":["嬐"],liǎn:["嬚","敛","斂","琏","璉","羷","脸","臉","蔹","蘝","蘞","裣","襝","鄻"],"qióng huán xuān":["嬛"],dǒng:["嬞","懂","箽","董","蕫","諌"],cān:["嬠","湌","爘","飡","餐","驂","骖"],tiǎo:["嬥","宨","晀","朓","窱","脁"],bí:["嬶","荸","鼻"],liǔ:["嬼","柳","栁","桞","桺","橮","熮","珋","綹","绺","罶","羀","鋶","锍"],"qiān xiān":["孅","欦"],"xié huī":["孈"],"huān quán":["孉"],"lí lì":["孋","麗"],"zhú chuò":["孎"],kǒng:["孔","恐"],"mā zī":["孖"],"sūn xùn":["孙","孫"],"bèi bó":["孛","誖"],"yòu niū":["孧"],zhuǎn:["孨","竱","轉"],hái:["孩","骸"],nāo:["孬"],"chán càn":["孱"],bò:["孹","檗","蘗","譒"],nái:["孻","腉"],"níng nìng":["宁","寍","寗","寜","寧","甯"],zhái:["宅"],"tū jiā":["宊"],sòng:["宋","訟","誦","讼","诵","送","鎹","頌","颂","餸"],ròu:["宍","肉","譳"],zhūn:["宒","窀","衠","諄","谆","迍"],"mì fú":["宓"],"dàng tàn":["宕"],"wǎn yuān":["宛"],chǒng:["宠","寵"],qún:["宭","峮","帬","羣","群","裙","裠"],zǎi:["宰","崽"],"bǎo shí":["宲"],"jiā jia jie":["家"],"huāng huǎng":["宺"],kuān:["宽","寛","寬","臗","鑧","髋","髖"],"sù xiǔ xiù":["宿"],"jié zǎn":["寁"],"bìng bǐng":["寎"],"jìn qǐn":["寖"],"lóu jù":["寠"],"xiě xiè":["寫"],"qīn qìn":["寴"],cùn:["寸","籿"],duì:["对","対","對","怼","憝","懟","濧","瀩","碓","祋","綐","薱","譈","譵","轛","队","陮"],"lüè luó":["寽"],"shè yè yì":["射"],"jiāng jiàng qiāng":["将"],"jiāng jiàng":["將","浆","漿","畺"],zūn:["尊","嶟","樽","罇","遵","鐏","鱒","鳟","鶎","鷷","𨱔"],"shù zhù":["尌","澍"],xiǎo:["小","晓","暁","曉","皛","皢","筱","筿","篠","謏","𫍲"],"jié jí":["尐","诘","鞊"],"shǎo shào":["少"],ěr:["尒","尓","尔","栮","毦","洱","爾","珥","耳","薾","衈","趰","迩","邇","鉺","铒","餌","饵","駬"],"wāng yóu":["尢"],wāng:["尣","尩","尪","尫","汪"],liào:["尥","尦","廖","撂","料","炓","窷","鐐","镣","𪤗"],"méng máng lóng páng":["尨"],gà:["尬","魀"],"kuì kuǐ":["尯"],tuí:["尵","弚","穨","蘈","蹪","隤","頹","頺","頽","颓","魋","𬯎"],yǐn:["尹","嶾","引","朄","檃","檼","櫽","淾","濥","瘾","癮","粌","蘟","蚓","螾","讔","赺","趛","輑","鈏","靷"],"chǐ chě":["尺"],kāo:["尻","髛"],"jìn jǐn":["尽"],"wěi yǐ":["尾"],"niào suī":["尿"],céng:["层","層","嶒","驓"],diǎo:["屌"],"píng bǐng bīng":["屏"],lòu:["屚","漏","瘘","瘺","瘻","鏤","镂","陋"],"shǔ zhǔ":["属","屬"],"xiè tì":["屟"],"chè cǎo":["屮"],"tún zhūn":["屯"],"nì jǐ":["屰"],"hóng lóng":["屸"],"qǐ kǎi":["岂","豈"],áng:["岇","昂","昻"],"gǎng gāng":["岗","崗"],kě:["岢","敤","渇","渴","炣"],gǒu:["岣","狗","玽","笱","耇","耈","耉","苟","豿"],tiáo:["岧","岹","樤","祒","笤","芀","萔","蓚","蓨","蜩","迢","鋚","鎥","鞗","髫","鯈","鰷","鲦","齠","龆"],"qū jū":["岨"],lǐng:["岭","嶺","領","领"],pò:["岶","敀","洦","湐","烞","珀","破","砶","粕","蒪","魄"],"bā kè":["峇"],luò:["峈","摞","洛","洜","犖","珞","笿","纙","荦","詻","雒","駱","骆","鵅"],"fù niè":["峊"],ěn:["峎"],"zhì shì":["峙","崻"],qiǎ:["峠","跒","酠","鞐"],"qiáo jiào":["峤","癄"],"xié yé":["峫"],bū:["峬","庯","晡","誧","逋","鈽","錻","钸","餔","鵏"],chóng:["崇","崈","爞","虫","蝩","蟲","褈","隀"],"zú cuì":["崒","椊"],"líng léng":["崚"],"dòng dōng":["崠"],xiáo:["崤","洨","淆","訤","誵"],"pí bǐ":["崥","芘"],"zhǎn chán":["崭","嶃","嶄"],"wǎi wēi":["崴"],"yáng dàng":["崵"],"shì dié":["崼"],yào:["崾","曜","熎","燿","矅","穾","窔","筄","耀","艞","药","葯","薬","藥","袎","覞","詏","讑","靿","鷂","鹞","鼼"],"kān zhàn":["嵁"],"hán dǎng":["嵅"],"qiàn kàn":["嵌"],"wù máo":["嵍"],"kě jié":["嵑","嶱"],"wēi wěi":["嵔"],kē:["嵙","柯","棵","榼","樖","牁","牱","犐","珂","疴","瞌","磕","礚","科","稞","窠","萪","薖","蚵","蝌","趷","轲","醘","鈳","钶","頦","顆","颗","髁"],"dàng táng":["嵣"],"róng yíng":["嵤","爃"],"ái kǎi":["嵦"],"kāo qiāo":["嵪"],cuó:["嵯","嵳","痤","矬","蒫","蔖","虘","鹺","鹾"],"qiǎn qīn":["嵰"],"dì dié":["嵽"],cēn:["嵾"],dǐng:["嵿","艼","薡","鐤","頂","顶","鼎","鼑"],"áo ào":["嶅"],"pǐ pèi":["嶏"],"jiào qiáo":["嶠","潐"],"jué guì":["嶡","鳜"],"zhān shàn":["嶦","鳣"],"xiè jiè":["嶰"],"guī xī juàn":["嶲"],rū:["嶿"],"lì liè":["巁","棙","爄","綟"],"xī guī juàn":["巂"],"yíng hōng":["巆"],yǐng:["巊","廮","影","摬","梬","潁","瘿","癭","矨","穎","郢","鐛","頴","颍","颕","颖"],chǎo:["巐","炒","煼","眧","麨"],cuán:["巑","櫕","欑"],chuān:["巛","川","氚","瑏","穿"],"jīng xíng":["巠"],cháo:["巢","巣","晁","漅","潮","牊","窲","罺","謿","轈","鄛","鼌"],qiǎo:["巧","愀","髜"],gǒng:["巩","廾","拱","拲","栱","汞","珙","輁","鞏"],"chà chā chāi cī":["差"],"xiàng hàng":["巷"],shuài:["帅","帥","蟀"],pà:["帊","帕","怕","袙"],"tǎng nú":["帑"],"mò wà":["帓"],"tiē tiě tiè":["帖"],zhǒu:["帚","晭","疛","睭","箒","肘","菷","鯞"],"juǎn juàn":["帣"],shuì:["帨","涗","涚","睡","稅","税","裞"],"chóu dào":["帱","幬"],"jiǎn jiān sàn":["帴"],"shà qiè":["帹"],"qí jì":["帺","荠"],"shān qiāo shēn":["幓"],"zhuàng chuáng":["幢"],"chān chàn":["幨"],miè:["幭","懱","搣","滅","灭","烕","礣","篾","蔑","薎","蠛","衊","鑖","鱴","鴓"],"gān gàn":["干"],"bìng bīng":["并","幷"],"jī jǐ":["幾"],"guǎng ān":["广"],guǎng:["広","廣","犷","獷"],me:["庅"],"dùn tún":["庉"],"bài tīng":["庍"],"yìng yīng":["应"],"dǐ de":["底"],"dù duó":["度"],"máng méng páng":["庬"],"bìng píng":["庰"],chěng:["庱","悜","睈","逞","騁","骋"],"jī cuò":["庴"],qǐng:["庼","廎","檾","漀","苘","請","謦","请","頃","顷"],"guī wěi huì":["廆"],"jǐn qín":["廑"],kuò:["廓","扩","拡","擴","濶","筈","萿","葀","蛞","闊","阔","霩","鞟","鞹","韕","頢","鬠"],"qiáng sè":["廧","薔"],"yǐn yìn":["廴","隐","隠","隱","飮","飲","饮"],"pò pǎi":["廹","迫"],"nòng lòng":["弄"],"dì tì tuí":["弟"],"jué zhāng":["弡"],"mí mǐ":["弥","彌","靡"],chāo:["弨","怊","抄","欩","訬","超","鈔","钞"],yi:["弬"],shāo:["弰","旓","烧","焼","燒","筲","艄","萷","蕱","輎","髾","鮹"],"xuān yuān":["弲"],"qiáng qiǎng jiàng":["強","强"],"tán dàn":["弹","醈"],biè:["彆"],"qiáng jiàng qiǎng":["彊"],"jì xuě":["彐"],tuàn:["彖","褖"],yuē:["彟","曰","曱","矱"],"shān xiǎn":["彡"],wén:["彣","文","炆","珳","瘒","繧","聞","芠","蚉","蚊","螡","蟁","閺","閿","闅","闦","闻","阌","雯","馼","駇","魰","鳼","鴍","鼤","𫘜"],"péng bāng":["彭"],"piāo piào":["彯"],"zhuó bó":["彴"],"tuǒ yí":["彵"],"páng fǎng":["彷"],wǎng:["彺","往","徃","惘","枉","棢","網","网","罒","罓","罔","罖","菵","蛧","蝄","誷","輞","辋","魍"],cú:["徂","殂"],"dài dāi":["待"],huái:["徊","怀","懐","懷","槐","淮","耲","蘹","褢","褱","踝"],"wā wàng jiā":["徍"],"chěng zhèng":["徎"],"dé děi de":["得"],"cóng zòng":["從"],"shì tǐ":["徥"],"tí chí":["徲","鶗","鶙"],dé:["徳","德","恴","悳","惪","淂","鍀","锝"],"zhǐ zhēng":["徴","徵"],bié:["徶","癿","莂","蛂","襒","蹩"],"chōng zhǒng":["徸"],"jiǎo jiào":["徼","笅","筊"],"lòng lǒng":["徿"],"qú jù":["忂","渠","瞿","螶"],"dìng tìng":["忊"],gǎi:["忋","改"],rěn:["忍","栠","栣","秹","稔","綛","荏","荵","躵"],chàn:["忏","懴","懺","硟","羼","韂","顫"],tè:["忑","慝","特","蟘","鋱","铽"],"tè tēi tuī":["忒"],"gān hàn":["忓","攼"],"yì qì":["忔"],"tài shì":["忕"],"xī liě":["忚"],"yīng yìng":["応","應","譍"],"mǐn wěn mín":["忞","忟"],"sōng zhōng":["忪"],"yù shū":["忬","悆"],"qí shì":["忯","耆"],"tún zhūn dùn":["忳"],"qián qín":["忴","扲"],hún:["忶","浑","渾","餛","馄","魂","鼲"],niǔ:["忸","扭","炄","狃","紐","纽","莥","鈕","钮","靵"],"kuáng wǎng":["忹"],"kāng hàng":["忼"],"kài xì":["忾","愾"],òu:["怄","慪"],"bǎo bào":["怉"],"mín mén":["怋"],"zuò zhà":["怍"],zěn:["怎"],yàng:["怏","恙","样","様","樣","漾","羕","詇"],"kòu jù":["怐"],"náo niú":["怓"],"zhēng zhèng":["怔","掙","钲","铮"],"tiē zhān":["怗"],"hù gù":["怘"],"cū jù zū":["怚"],"sī sāi":["思"],"yóu chóu":["怞"],"tū dié":["怢"],"yōu yào":["怮"],xuàn:["怰","昡","楦","泫","渲","炫","琄","眩","碹","絢","縼","繏","绚","蔙","衒","袨","贙","鉉","鏇","铉","镟","颴"],"xù xuè":["怴"],"bì pī":["怶"],"xī shù":["怸"],"nèn nín":["恁"],"tiāo yáo":["恌"],"xī qī xù":["恓"],"xiào jiǎo":["恔"],"hū kuā":["恗"],nǜ:["恧","朒","衂","衄"],hèn:["恨"],"dòng tōng":["恫"],"quán zhuān":["恮"],"è wù ě wū":["恶","惡"],tòng:["恸","慟","憅","痛","衕"],"yuān juàn":["悁"],"qiāo qiǎo":["悄"],"jiè kè":["悈"],"hào jiào":["悎"],huǐ:["悔","檓","毀","毁","毇","燬","譭"],"mán mèn":["悗","鞔"],"yī yì":["悘","衣"],quān:["悛","箞","鐉","𨟠"],"kuī lǐ":["悝"],"yì niàn":["悥"],"mèn mēn":["悶"],guàn:["悹","悺","惯","慣","掼","摜","樌","欟","泴","涫","潅","灌","爟","瓘","盥","礶","祼","罆","罐","貫","贯","躀","遦","鏆","鑵","鱹","鸛","鹳"],"kōng kǒng":["悾"],"lǔn lùn":["惀"],guǒ:["惈","果","椁","槨","粿","綶","菓","蜾","裹","褁","輠","餜","馃"],"yuān wǎn":["惌","箢"],"lán lín":["惏"],"yù xù":["惐","淢"],"chuò chuì":["惙"],"hūn mèn":["惛"],"chǎng tǎng":["惝"],"suǒ ruǐ":["惢"],cǎn:["惨","慘","憯","黪","黲","䅟"],cán:["惭","慙","慚","残","殘","蚕","蝅","蠶","蠺"],"dàn dá":["惮","憚"],rě:["惹"],"yú tōu":["愉"],"kài qì":["愒"],"dàng táng shāng yáng":["愓"],"chén xìn dān":["愖"],"kè qià":["愘"],nuò:["愞","懦","懧","掿","搦","榒","稬","穤","糑","糥","糯","諾","诺","蹃","逽","鍩","锘"],gǎn:["感","擀","敢","桿","橄","澉","澸","皯","秆","稈","笴","芉","衦","赶","趕","鱤","鳡"],"còng sōng":["愡"],"sāi sī sǐ":["愢"],"gōng gòng hǒng":["愩","慐"],"shuò sù":["愬","洬"],"yáo yào":["愮"],huàng:["愰","曂","榥","滉","皝","皩","鎤","㿠"],zhěng:["愸","抍","拯","整","晸"],cǎo:["愺","艸","草","騲"],"xì xié":["慀"],"cǎo sāo":["慅"],"xù chù":["慉"],"qiè qiàn":["慊"],"cáo cóng":["慒"],"ào áo":["慠"],"lián liǎn":["慩","梿","槤","櫣"],"jìn qín jǐn":["慬"],"dì chì":["慸"],"zhí zhé":["慹"],"lóu lǚ":["慺","鷜"],còng:["憁","謥"],"zhī zhì":["憄","知","織","织"],chēng:["憆","摚","撐","撑","晿","柽","棦","橕","檉","泟","浾","琤","瞠","碀","緽","罉","蛏","蟶","赪","赬","鏿","鐣","阷","靗","頳","饓"],biē:["憋","虌","鱉","鳖","鼈","龞"],"chéng dèng zhèng":["憕"],"xǐ xī":["憘"],"duì dùn tūn":["憞"],"xiāo jiāo":["憢"],"xián xiàn":["憪"],"liáo liǎo":["憭","燎","爎","爒"],shéng:["憴","縄","繉","繩","绳","譝"],"náo nǎo náng":["憹"],"jǐng jìng":["憼"],"jǐ jiǎo":["憿"],"xuān huān":["懁"],"cǎo sāo sào":["懆"],mèn:["懑","懣","暪","焖","燜"],"mèng méng měng":["懜"],"ài yì nǐ":["懝"],"méng měng":["懞","瞢","矒"],"qí jī jì":["懠"],mǒ:["懡"],"lán xiàn":["懢"],"yōu yǒu":["懮"],"liú liǔ":["懰","藰"],ràng:["懹","譲","讓","让"],huān:["懽","欢","歓","歡","獾","讙","貛","酄","驩","鴅","鵍"],nǎn:["戁","揇","湳","煵","腩","蝻","赧"],"mí mó":["戂"],"gàng zhuàng":["戅","戆"],"zhuàng gàng":["戇"],"xū qu":["戌"],"xì hū":["戏","戯","戲"],"jiá gā":["戛"],zéi:["戝","蠈","賊","贼","鰂","鱡","鲗"],děng:["戥","等"],"hū xì":["戱"],chuō:["戳","踔","逴"],"biǎn piān":["扁"],"shǎng jiōng":["扄"],"shàn shān":["扇"],cái:["才","材","纔","裁","財","财"],"zhā zā zhá":["扎"],"lè lì cái":["扐"],"bā pá":["扒"],"dǎ dá":["打"],rēng:["扔"],"fǎn fú":["払"],"diǎo dí yuē lì":["扚"],"káng gāng":["扛"],"yū wū":["扜"],"yū wū kū":["扝"],"tuō chǐ yǐ":["扡"],"gǔ jié xì gē":["扢"],dèn:["扥","扽"],"sǎo sào":["扫","掃"],rǎo:["扰","擾","隢"],"xī chā qì":["扱"],"bān pān":["扳"],"bā ào":["扷"],"xī zhé":["扸"],"zhì sǔn kǎn":["扻"],zhǎo:["找","沼","瑵"],"kuáng wǎng zài":["抂"],"hú gǔ":["抇","鹄","鹘"],"bǎ bà":["把"],"dǎn shěn":["抌"],"nè nì ruì nà":["抐"],zhuā:["抓","檛","簻","膼","髽"],póu:["抔","裒"],"zhé shé zhē":["折"],"póu pōu fū":["抙","捊"],pāo:["抛","拋","脬","萢"],"ǎo ào niù":["抝"],"lūn lún":["抡","掄"],"qiǎng qiāng chēng":["抢"],"zhǐ zhǎi":["抧"],"bù pū":["抪","柨"],"yǎo tāo":["抭"],"hē hè qiā":["抲"],"nǐ ní":["抳"],"pī pēi":["抷"],"mǒ mò mā":["抹"],chōu:["抽","犨","犫","瘳","篘"],"jiā yá":["拁"],"fú bì":["拂","畐","鶝"],zhǎ:["拃","眨","砟","鮺","鲝"],"dān dàn dǎn":["担"],"chāi cā":["拆"],niān:["拈","蔫"],"lā lá lǎ là":["拉"],"bàn pàn":["拌"],pāi:["拍"],līn:["拎"],guǎi:["拐","枴","柺"],"tuò tà zhí":["拓"],"ào ǎo niù":["拗"],"jū gōu":["拘"],"pīn pàn fān":["拚"],"bài bái":["拜"],bài:["拝","敗","稗","粺","薭","贁","败","韛"],qiá:["拤"],"nǐng níng nìng":["拧"],"zé zhái":["择","擇"],hén:["拫","痕","鞎"],"kuò guā":["括"],"jié jiá":["拮"],nǐn:["拰"],shuān:["拴","栓","閂","闩"],"cún zùn":["拵"],"zā zǎn":["拶","桚"],kǎo:["拷","攷","栲","烤","考"],"yí chǐ hài":["拸"],"cè sè chuò":["拺"],"zhuài zhuāi yè":["拽"],"shí shè":["拾"],bāi:["挀","掰"],"kuò guāng":["挄"],nòng:["挊","挵","齈"],"jiào jiāo":["挍","敎","教"],"kuà kū":["挎"],"ná rú":["挐"],"tiāo tiǎo":["挑"],"dié shè":["挕"],liě:["挘","毟"],"yà yǎ":["挜","掗"],"wō zhuā":["挝"],"xié jiā":["挟","挾"],"dǎng dàng":["挡","擋"],"zhèng zhēng":["挣","正","症"],"āi ái":["挨"],"tuō shuì":["挩","捝"],"tǐ tì":["挮"],"suō shā":["挱"],"sā shā suō":["挲"],"kēng qiān":["挳","摼"],"bàng péng":["挷"],"ruó ruá":["挼"],"jiǎo kù":["捁"],"wǔ wú":["捂"],tǒng:["捅","桶","筒","筩","統","綂","统","㛚"],"huò chì":["捇"],"tú shū chá":["捈"],"lǚ luō":["捋"],"shāo shào":["捎","稍"],niē:["捏","揑"],"shù sǒng sōu":["捒"],"yé yú":["捓"],"jué zhuó":["捔"],"bù pú zhì":["捗"],zùn:["捘","銌"],lāo:["捞","撈","粩"],sǔn:["损","損","榫","笋","筍","箰","鎨","隼"],"wàn wǎn wān yù":["捥"],pěng:["捧","淎","皏"],shě:["捨"],"fǔ fù bǔ":["捬"],dáo:["捯"],"luò luǒ wǒ":["捰"],"juǎn quán":["捲"],"chēn tiǎn":["捵"],"niǎn niē":["捻"],"ruó wěi ré":["捼"],zuó:["捽","昨","秨","稓","筰","莋","鈼"],"wò xiá":["捾"],"qìng qiàn":["掅"],"póu pǒu":["掊"],qiā:["掐","葜"],"pái pǎi":["排"],"qiān wàn":["掔"],"yè yē":["掖"],"niè nǐ yì":["掜"],"huò xù":["掝"],"yàn shàn yǎn":["掞"],"zhěng dìng":["掟"],kòng:["控","鞚"],tuī:["推","蓷","藬"],"zōu zhōu chōu":["掫"],tiàn:["掭","舚"],kèn:["掯","裉","褃"],pá:["掱","杷","潖","爬","琶","筢"],"guó guāi":["掴"],"dǎn shàn":["掸","撣"],"chān xiān càn shǎn":["掺"],sāo:["掻","搔","溞","繅","缫","螦","騒","騷","鰠","鱢","鳋"],pèng:["掽","椪","槰","碰","踫"],"zhēng kēng":["揁"],"jiū yóu":["揂"],"jiān jiǎn":["揃","籛"],"pì chè":["揊"],"sāi zǒng cāi":["揌"],"tí dī dǐ":["提"],"zǒng sōng":["揔"],"huáng yóng":["揘"],"zǎn zuàn":["揝"],"xū jū":["揟"],"ké qiā":["揢"],"chuāi chuǎi chuài tuán zhuī":["揣"],"dì tì":["揥"],"lá là":["揦"],là:["揧","楋","溂","瓎","瘌","翋","臘","蝋","蝲","蠟","辢","辣","鑞","镴","鬎","鯻","𬶟"],"jiē qì":["揭"],"chòng dǒng":["揰"],"dié shé yè":["揲"],"jiàn qián jiǎn":["揵"],yé:["揶","爷","爺","瑘","鋣","鎁","铘"],chān:["搀","摻","攙","裧","襜","覘","觇","辿","鋓"],"gē gé":["搁","擱"],"lǒu lōu":["搂","摟"],"chōu zǒu":["搊"],chuāi:["搋"],sūn:["搎","槂","狲","猻","荪","蓀","蕵","薞","飧","飱"],"róng náng nǎng":["搑"],"péng bàng":["搒"],cuō:["搓","瑳","磋","蹉","遳","醝"],"kē è":["搕"],"nù nuò nòu":["搙"],"lā xié xiàn":["搚"],qiǔ:["搝","糗"],"xiǎn xiān":["搟"],"jié zhé":["搩"],"pán bān pó":["搫"],bān:["搬","攽","斑","斒","班","瘢","癍","肦","螁","螌","褩","辬","頒","颁","𨭉"],"zhì nái":["搱"],"wā wǎ wà":["搲"],huá:["搳","撶","滑","猾","蕐","螖","譁","鏵","铧","驊","骅","鷨"],"qiāng qiǎng chēng":["搶"],"tián shēn":["搷"],"ná nuò":["搻"],èn:["摁"],"shè niè":["摄","攝"],bìn:["摈","擯","殡","殯","膑","臏","髌","髕","髩","鬂","鬓","鬢"],"shā sà shǎi":["摋"],"chǎn sùn":["摌"],"jiū liú liáo jiǎo náo":["摎"],"féng pěng":["摓"],shuāi:["摔"],"dì tú zhí":["摕"],"qì jì chá":["摖"],"sōu sǒng":["摗"],"liǎn liàn":["摙"],"gài xì":["摡"],"hù chū":["摢"],tàng:["摥","烫","燙","鐋"],"nái zhì":["摨"],"mó mā":["摩"],"jiāng qiàng":["摪"],"áo qiáo":["摮"],"niè chè":["摰"],"mán màn":["摱"],"chàn cán":["摲"],"sè mí sù":["摵"],"biāo biào":["摽"],"juē jué":["撅"],piē:["撆","暼","氕","瞥"],"piě piē":["撇"],"zǎn zān zēn qián":["撍"],"sā sǎ":["撒"],hòng:["撔","訌","讧","闀","鬨"],"héng guàng":["撗"],niǎn:["撚","撵","攆","涊","焾","碾","簐","蹍","蹨","躎","輦","辇"],"chéng zhěng":["撜"],"huī wéi":["撝"],cāo:["撡","操","糙"],"xiāo sōu":["撨"],"liáo liāo":["撩"],"cuō zuǒ":["撮"],"wěi tuǒ":["撱"],cuān:["撺","攛","汆","蹿","躥","鑹","镩"],"qiào yāo jī":["撽"],"zhuā wō":["撾"],"lèi léi":["擂"],nǎng:["擃","攮","曩","灢"],"qíng jǐng":["擏"],kuǎi:["擓","蒯","㧟"],"pǐ bò":["擗"],"bò bāi":["擘"],"jù jǐ":["據"],mēng:["擝"],"sǒu sòu":["擞"],xǐng:["擤","箵","醒"],cā:["擦"],"níng nǐng nìng":["擰"],"zhì jié":["擳"],"là liè":["擸","爉"],"sòu sǒu":["擻"],"lì luò yuè":["擽"],"tī zhāi zhì":["擿"],pān:["攀","潘","眅","萠"],lèi:["攂","泪","涙","淚","禷","类","纇","蘱","酹","銇","錑","頛","頪","類","颣"],"cā sǎ":["攃"],"jùn pèi":["攈"],"lì luò":["攊","躒"],"là lài":["攋","櫴"],"lú luó":["攎"],"zǎn cuán":["攒"],"xiān jiān":["攕"],"mí mǐ mó":["攠"],"zǎn cuán zàn zuān":["攢"],zuàn:["攥"],"lì shài":["攦"],"lì luǒ":["攭"],"guǐ guì":["攱"],"jī qī yǐ":["攲"],fàng:["放"],"wù móu":["敄"],"chù shōu":["敊"],"gé guó è":["敋"],"duó duì":["敓","敚"],"duō què":["敠","敪"],"sàn sǎn":["散"],"dūn duì":["敦","镦"],"qī yǐ jī":["敧"],"xiào xué":["敩"],"shù shǔ shuò":["数","數"],"ái zhú":["敱","敳"],"xiòng xuàn":["敻"],"zhuó zhú":["斀"],"yì dù":["斁"],"lí tái":["斄"],"fěi fēi":["斐"],"yǔ zhōng":["斔"],"dòu dǒu":["斗"],"wò guǎn":["斡"],"tǒu tiǎo":["斢"],dòu:["斣","梪","浢","痘","窦","竇","脰","荳","豆","逗","郖","酘","閗","闘","餖","饾","鬥","鬦","鬪","鬬","鬭"],"yín zhì":["斦"],"chǎn jiè":["斺"],"wū yū yú":["於"],"yóu liú":["斿"],"páng bàng":["旁"],"máo mào":["旄"],"pī bì":["旇"],"xuán xuàn":["旋"],"wú mó":["无"],zǎo:["早","枣","栆","棗","澡","璪","薻","藻","蚤"],gā:["旮"],"gàn hàn":["旰"],"tái yīng":["旲"],"xū xù":["旴"],"tūn zhùn":["旽"],"wù wǔ":["旿"],"pò pèi":["昢"],zòng:["昮","猔","疭","瘲","粽","糉","糭","縦"],ǎi:["昹","毐","矮","蔼","藹","譪","躷","霭","靄"],"huàng huǎng":["晃"],xuǎn:["晅","癣","癬","选","選"],"xù kuā":["晇"],hǒng:["晎"],shài:["晒","曬"],"yūn yùn":["晕","煴"],"shèng chéng":["晟","椉","盛"],"jǐng yǐng":["景"],shǎn:["晱","熌","睒","覢","閃","闪","陕","陝"],"qǐ dù":["晵"],"ǎn àn yǎn":["晻"],"wǎng wàng":["暀"],zàn:["暂","暫","瓉","瓒","瓚","禶","襸","讃","讚","賛","贊","赞","蹔","鄼","錾","鏨","饡"],"yùn yūn":["暈"],"mín mǐn":["暋"],"dǔ shǔ":["暏"],shǔ:["暑","曙","潻","癙","糬","署","薥","薯","藷","蜀","蠴","襡","襩","鱪","鱰","黍","鼠","鼡"],"jiǎn lán":["暕"],nuǎn:["暖","煗","餪"],"bào pù":["暴"],"xī xǐ":["暿"],"pù bào":["曝","瀑"],"qū qǔ":["紶"],"qǔ qū":["曲"],"gèng gēng":["更"],"hū hù":["曶","雽"],"zēng céng":["曽","橧"],"céng zēng":["曾","竲"],"cǎn qián jiàn":["朁"],"qiè hé":["朅"],"bì pí":["朇","禆","笓","裨"],"yǒu yòu":["有"],"bān fén":["朌","鳻"],"fú fù":["服","洑"],"fěi kū":["朏","胐"],"qú xù chǔn":["朐"],"juān zuī":["朘"],"huāng máng wáng":["朚"],"qī jī":["期"],"tóng chuáng":["朣","橦"],zhá:["札","牐","箚","蚻","譗","鍘","铡","閘","闸"],"zhú shù shú":["朮"],"shù shú zhú":["术"],"zhū shú":["朱"],"pǔ pò pō piáo":["朴"],"dāo tiáo mù":["朷"],"guǐ qiú":["朹"],xiǔ:["朽","滫","潃","糔"],"chéng chēng":["朾"],zá:["杂","沯","砸","襍","雑","雜","雥","韴"],"yú wū":["杅"],"gān gǎn":["杆"],"chā chà":["杈"],"shān shā":["杉"],cūn:["村","皴","竴","膥","踆","邨"],"rèn ér":["杒","梕"],"sháo biāo":["杓"],"dì duò":["杕","枤"],"gū gài":["杚"],"yí zhì lí duò":["杝"],"gàng gāng":["杠"],"tiáo tiāo":["条","條"],"mà mǎ":["杩"],"sì zhǐ xǐ":["杫"],"yuán wán":["杬","蚖"],"bèi fèi":["杮"],"shū duì":["杸"],"niǔ chǒu":["杻"],"wò yuè":["枂","臒"],máo:["枆","毛","氂","渵","牦","矛","罞","茅","茆","蝥","蟊","軞","酕","鉾","錨","锚","髦","鶜"],"pī mì":["枈"],àng:["枊","盎","醠"],"fāng bìng":["枋"],"hù dǐ":["枑"],xín:["枔","襑","鐔","鬵"],"yāo yǎo":["枖"],"ě è":["枙"],"zhī qí":["枝"],"cōng zōng":["枞","樅"],"xiān zhēn":["枮"],"tái sì":["枱"],"gǒu jǔ gōu":["枸"],"bāo fú":["枹"],"yì xiè":["枻","栧"],"tuó duò":["柁","馱","駄","驮"],"yí duò lí":["柂"],"nǐ chì":["柅"],"pán bàn":["柈","跘"],"yǎng yàng yāng yīng":["柍"],"fù fū fǔ":["柎"],"bǎi bó bò":["柏"],mǒu:["某"],"sháo shào":["柖"],zhè:["柘","樜","浙","淛","蔗","蟅","這","鷓","鹧","䗪"],"yòu yóu":["柚","櫾"],"guì jǔ":["柜"],"zhà zuò":["柞"],"dié zhì":["柣","眰"],"zhā zǔ zū":["柤"],"chá zhā":["查","査"],"āo ào":["柪","軪"],"bā fú pèi bó biē":["柭"],"duò zuó wù":["柮"],"bì bié":["柲"],"zhù chù":["柷"],"bēi pēi":["柸"],"shì fèi":["柹"],"shān zhà shi cè":["栅"],"lì yuè":["栎","櫟"],"qì qiè":["栔","砌"],"qī xī":["栖","蹊"],"guā kuò":["栝"],"bīng bēn":["栟"],"xiào jiào":["校"],"jiàn zùn":["栫","袸"],"yǒu yù":["栯"],"hé hú":["核"],gēn:["根","跟"],"zhī yì":["栺"],"gé gē":["格"],"héng háng":["桁"],"guàng guāng":["桄"],"yí tí":["桋","荑"],sāng:["桑","桒","槡"],"jú jié":["桔"],"yú móu":["桙"],"ráo náo":["桡","橈"],"guì huì":["桧","檜"],"chén zhèn":["桭"],"tīng yíng":["桯"],"bó po":["桲"],"bèn fàn":["桳"],"fēng fèng":["桻","葑"],"sù yìn":["梀"],"tǐng tìng":["梃"],"xuān juān xié":["梋"],"tú chá":["梌"],"āo yòu":["梎"],kuǎn:["梡","欵","款","歀"],"shāo sào":["梢"],"qín chén cén":["梣"],"lí sì qǐ":["梩"],"chān yán":["梴"],"bīn bīng":["梹","槟","檳"],"táo chóu dào":["梼"],"cōng sōng":["棇"],"gùn hùn":["棍"],"dé zhé":["棏"],"pái bèi pèi":["棑"],"bàng pǒu bèi bēi":["棓"],"dì dài tì":["棣"],sēn:["森","椮","槮","襂"],"rěn shěn":["棯"],"léng lēng líng":["棱"],"fú sù":["棴"],"zōu sǒu":["棷"],zōu:["棸","箃","緅","諏","诹","邹","郰","鄒","鄹","陬","騶","驺","鯫","鲰","黀","齱","齺"],"zhào zhuō":["棹"],"chēn shēn":["棽"],"jiē qiè":["椄"],"yǐ yī":["椅"],"chóu zhòu diāo":["椆"],"qiāng kōng":["椌"],"zhuī chuí":["椎"],"bēi pí":["椑"],mēn:["椚"],"quān juàn quán":["椦"],"duǒ chuán":["椯"],"wěi huī":["椲"],"jiǎ jiā":["椵"],"hán jiān":["椷"],"shèn zhēn":["椹"],"yàn yà":["椻"],"zhā chá":["楂"],"guō kuǎ":["楇"],"jí zhì":["楖"],"kǔ hù":["楛"],"yóu yǒu":["楢"],"sǒng cōng":["楤"],"yuán xuàn":["楥"],"yǎng yàng yīng":["楧"],pián:["楩","胼","腁","賆","蹁","駢","騈","骈","骿","㛹"],"dié yè":["楪"],"dùn shǔn":["楯"],"còu zòu":["楱"],"dì dǐ shì":["楴"],"kǎi jiē":["楷"],"róu ròu":["楺"],"lè yuè":["楽"],"wēn yùn":["榅","鞰"],lǘ:["榈","櫚","氀","膢","藘","閭","闾","驢","驴"],shén:["榊","神","鉮","鰰","𬬹"],"bī pi":["榌"],"zhǎn niǎn zhèn":["榐"],"fú fù bó":["榑"],"jiàn jìn":["榗"],"bǎng bàng":["榜"],"shā xiè":["榝","樧"],nòu:["槈","耨","鎒","鐞"],"qiǎn lián xiàn":["槏"],gàng:["槓","焵","焹","筻","鿍"],gāo:["槔","槹","橰","櫜","睾","篙","糕","羔","臯","韟","餻","高","髙","鷎","鷱","鼛"],"diān zhěn zhēn":["槙"],"kǎn jiàn":["槛"],"xí dié":["槢"],"jī guī":["槣"],"róng yōng":["槦"],"tuán shuàn quán":["槫"],"qì sè":["槭"],"cuī zhǐ":["槯"],"yǒu chǎo":["槱"],"màn wàn":["槾"],"lí chī":["樆"],"léi lěi":["樏","櫑","礌"],"cháo jiǎo chāo":["樔"],"chēng táng":["樘"],"jiū liáo":["樛"],"mó mú":["模"],"niǎo mù":["樢"],"héng hèng":["横","橫"],xuě:["樰","膤","艝","轌","雪","鱈","鳕"],"fá fèi":["橃"],rùn:["橍","润","潤","膶","閏","閠","闰"],"zhǎn jiǎn":["橏"],shùn:["橓","瞚","瞬","舜","蕣","順","顺","鬊"],"tuí dūn":["橔"],"táng chēng":["橖"],"sù qiū":["橚"],"tán diàn":["橝"],"fén fèn fèi":["橨"],"rǎn yān":["橪"],"cū chu":["橻"],"shū qiāo":["橾"],"píng bò":["檘"],"zhái shì tú":["檡"],"biǎo biāo":["檦"],"qiān lián":["檶"],"nǐ mí":["檷"],"jiàn kǎn":["檻"],"nòu ruǎn rú":["檽"],"jī jì":["櫅","禨"],"huǎng guǒ gǔ":["櫎"],"lǜ chū":["櫖"],"miè mèi":["櫗"],ōu:["櫙","欧","歐","殴","毆","瓯","甌","膒","藲","謳","讴","鏂","鴎","鷗","鸥"],"zhù zhuó":["櫡"],"jué jì":["櫭"],"huái guī":["櫰"],"chán zhàn":["欃"],"wéi zuì":["欈"],cáng:["欌","鑶"],"yù yì":["欥"],"chù qù xì":["欪"],"kài ài":["欬"],"yì yīn":["欭"],"xì kài":["欯"],"shuò sòu":["欶"],"ǎi ēi éi ěi èi ê̄ ế ê̌ ề":["欸"],"qī yī":["欹"],"chuā xū":["欻"],"chǐ chuài":["欼"],"kǎn qiàn":["欿"],"kǎn kè":["歁"],"chuǎn chuán":["歂"],"yīn yān":["歅"],"jìn qūn":["歏"],pēn:["歕"],"xū chuā":["歘"],"xī shè":["歙"],"liǎn hān":["歛"],"zhì chí":["歭"],"sè shà":["歰"],sǐ:["死"],"wěn mò":["歾"],piǎo:["殍","皫","瞟","醥","顠"],"qíng jìng":["殑"],"fǒu bó":["殕"],"zhí shi":["殖"],"yè yān yàn":["殗"],"hūn mèi":["殙"],chòu:["殠","臰","遚"],"kuì huì":["殨","溃","潰"],cuàn:["殩","熶","爨","窜","竄","篡","簒"],"yīn yān yǐn":["殷"],"qìng kēng shēng":["殸"],"yáo xiáo xiào":["殽"],"gū gǔ":["毂","蛄"],"guàn wān":["毌"],"dú dài":["毒"],"xún xùn":["毥"],mú:["毪","氁"],"dòu nuò":["毭"],"sāi suī":["毸"],lu:["氇"],sào:["氉","瘙","矂","髞"],"shì zhī":["氏"],"dī dǐ":["氐"],"máng méng":["氓"],"yáng rì":["氜"],shuǐ:["水","氵","氺","閖"],"zhěng chéng zhèng":["氶"],tǔn:["氽"],"fán fàn":["氾"],"guǐ jiǔ":["氿"],"bīn pà pā":["汃"],"zhuó què":["汋"],"dà tài":["汏"],pìn:["汖","牝","聘"],"hàn hán":["汗","馯"],tu:["汢"],"tāng shāng":["汤","湯"],"zhī jì":["汥"],"gàn hán cén":["汵"],"wèn mén":["汶"],"fāng pāng":["汸"],"hǔ huǎng":["汻"],"niú yóu":["汼"],hàng:["沆"],"shěn chén":["沈"],"dùn zhuàn":["沌"],"nǜ niǔ":["沑"],"méi mò":["沒","没"],"tà dá":["沓"],"mì wù":["沕"],"hóng pāng":["沗"],"shā shà":["沙"],"zhuǐ zǐ":["沝"],"ōu òu":["沤","漚"],"jǔ jù":["沮"],"tuō duó":["沰"],"mǐ lì":["沵"],"yí chí":["沶"],"xiè yì":["泄"],"bó pō":["泊"],"mì bì":["泌","秘"],"chù shè":["泏"],"yōu yòu āo":["泑"],"pēng píng":["泙","硑"],"pào pāo":["泡"],"ní nì":["泥","秜"],"yuè sà":["泧"],"jué xuè":["泬","疦"],"lóng shuāng":["泷","瀧"],"luò pō":["泺","濼"],"zé shì":["泽","澤"],"sǎ xǐ":["洒"],"sè qì zì":["洓"],"xǐ xiǎn":["洗"],"kǎo kào":["洘"],"àn yàn è":["洝"],"lěi lèi":["洡"],"qiè jié":["洯"],"qiǎn jiān":["浅"],"jì jǐ":["济","済","濟","纪"],"hǔ xǔ":["浒","滸"],"jùn xùn":["浚","濬"],"yǐng chéng yíng":["浧"],"liàn lì":["浰"],"féng hóng":["浲","溄"],"jiǒng jiōng":["浻"],"suī něi":["浽"],"yǒng chōng":["涌"],"tūn yūn":["涒"],"wō guō":["涡","渦"],hēng:["涥","脝"],"zhǎng zhàng":["涨","漲"],"shòu tāo":["涭"],shuàn:["涮","腨"],"kōng náng":["涳"],"wò wǎn yuān":["涴"],"tuō tuò":["涶"],wō:["涹","猧","窝","窩","莴","萵","蜗","蝸","踒"],"qiè jí":["淁"],"guǒ guàn":["淉"],"lín lìn":["淋","獜","疄"],"tǎng chǎng":["淌"],"nào chuò zhuō":["淖"],"péng píng":["淜"],féi:["淝","肥","腓","蜰"],"pì pèi":["淠"],"niǎn shěn":["淰"],"biāo hǔ":["淲"],"chún zhūn":["淳"],"hùn hún":["混"],qiǎn:["淺","繾","缱","肷","膁","蜸","譴","谴","遣","鑓"],"wèn mín":["渂"],"rè ruò luò":["渃"],"dú dòu":["渎","瀆","读"],"jiàn jiān":["渐","溅","漸","濺"],"miǎn shéng":["渑","澠"],"nuǎn nuán":["渜"],"qiú wù":["渞"],"tíng tīng":["渟"],"dì tí dī":["渧"],"gǎng jiǎng":["港"],"hōng qìng":["渹"],tuān:["湍","煓"],"huì mǐn xū":["湏"],"xǔ xù":["湑"],pén:["湓","瓫","盆","葐"],"mǐn hūn":["湣"],"tuàn nuǎn":["湪"],"qiū jiǎo":["湫","湬"],"yān yīn":["湮"],"bàn pán":["湴"],"zhuāng hún":["湷"],"yàn guì":["溎"],"lián liǎn nián xián xiàn":["溓"],"dá tǎ":["溚","鿎"],"liū liù":["溜","澑","蹓"],lùn:["溣"],mǎ:["溤","犸","獁","玛","瑪","码","碼","遤","鎷","馬","马","鰢","鷌"],"zhēn qín":["溱"],"nì niào":["溺"],"chù xù":["滀","畜"],"wěng wēng":["滃"],"hào xuè":["滈"],"qì xì xiē":["滊"],"xíng yíng":["滎"],"zé hào":["滜"],"piāo piào piǎo":["漂"],"cóng sǒng":["漎"],"féng péng":["漨"],"luò tà":["漯"],"pēng bēn":["漰"],"chóng shuāng":["漴"],"huǒ kuò huò":["漷"],"liáo liú":["漻"],"cuǐ cuī":["漼"],"cóng zǒng":["潀"],"cóng zōng":["潈"],"pì piē":["潎"],"dàng xiàng":["潒"],"huáng guāng":["潢"],"liáo lào lǎo":["潦"],"cōng zòng":["潨"],"zhí zhì":["潪"],"tān shàn":["潬"],"tú zhā":["潳"],"sàn sǎ":["潵"],hēi:["潶","黑","黒","𬭶"],"chéng dèng":["澄","瀓"],"cūn cún":["澊"],"péng pēng":["澎"],"hòng gǒng":["澒","銾"],"wàn màn":["澫"],"kuài huì":["澮"],"guō wō":["濄"],"pēn fén":["濆"],"jí shà":["濈"],"huì huò":["濊"],"dǐng tìng":["濎"],"mǐ nǐ":["濔"],"bì pì":["濞"],"cuì zuǐ":["濢"],"hù huò":["濩"],"ǎi kài kè":["濭"],"wěi duì":["濻","瀢"],"zàn cuán":["濽","灒"],"yǎng yàng":["瀁"],"wǎng wāng":["瀇"],"mò miè":["瀎","眜"],suǐ:["瀡","膸","髓"],"huái wāi":["瀤"],"zùn jiàn":["瀳"],"yīng yǐng yìng":["瀴"],"ráng ràng":["瀼"],shuàng:["灀"],"zhuó jiào zé":["灂"],sǎ:["灑","訯","靸"],"luán luàn":["灓"],"dǎng tǎng":["灙"],"xún quán quàn":["灥"],"huǒ biāo":["灬"],"zhà yù":["灹"],"fén bèn":["炃"],"jiǒng guì":["炅"],"pàng fēng":["炐"],quē:["炔","缺","缼","蒛"],biān:["炞","煸","甂","砭","笾","箯","籩","編","编","蝙","邉","邊","鍽","鞭","鯾","鯿","鳊"],"zhāo zhào":["炤"],"zhuō chù":["炪"],"pào páo bāo":["炮"],"páo fǒu":["炰"],"shǎn qián shān":["炶"],"zhà zhá":["炸"],"jiǎo yào":["烄"],quǎn:["烇","犬","犭","畎","綣","绻","虇"],"yàng yáng":["烊"],"lào luò":["烙"],"huí huǐ":["烠"],rè:["热","熱"],"fú páo":["烰"],"xiè chè":["烲","焎"],"yàn shān":["烻"],"hūn xūn":["焄"],kào:["焅","犒","銬","铐","靠","鮳","鯌","鲓","㸆"],"juān yè":["焆"],"jùn qū":["焌"],"tāo dào":["焘"],"chǎo jù":["焣"],"wò ài":["焥"],"zǒng cōng":["焧"],"xī yì":["焬"],"xìn xīn":["焮"],"chāo zhuō":["焯"],"xiǒng yīng":["焸","焽"],kuǐ:["煃","跬","蹞","頍","𫠆"],"huī yùn xūn":["煇"],"jiǎo qiāo":["煍"],"qián shǎn shān":["煔"],"xī yí":["煕"],"shà shā":["煞"],"yè zhá":["煠"],"yáng yàng":["煬"],"ēn yūn":["煾"],"yūn yǔn":["熅"],"hè xiāo":["熇"],xióng:["熊","熋","雄"],"xūn xùn":["熏","爋"],gòng:["熕","貢","贡"],liū:["熘"],"cōng zǒng":["熜"],"lù āo":["熝"],"shú shóu":["熟"],"fēng péng":["熢"],"cuǐ suī":["熣"],tēng:["熥","膯","鼟"],"yùn yù":["熨"],"áo āo":["熬"],"hàn rǎn":["熯"],"ōu ǒu":["熰"],"huáng huǎng":["熿"],"chǎn dǎn chàn":["燀"],"jiāo zhuó qiáo jué":["燋"],"yàn yān":["燕"],"tài liè":["燤"],āo:["爊"],"yàn xún":["爓"],"jué jiào":["爝","覐","覚","覺","觉"],"lǎn làn":["爦"],"zhuǎ zhǎo":["爪"],"zhǎo zhuǎ":["爫"],"fù fǔ":["父"],diē:["爹","褺","跌"],zāng:["牂","羘","臧","賍","賘","贓","贜","赃","髒"],"piàn piān":["片"],"biān miàn":["牑"],bǎng:["牓","綁","绑"],"yǒu yōng":["牗"],"chēng chèng":["牚","竀"],niú:["牛","牜"],"jiū lè":["牞"],"mù móu":["牟"],māng:["牤"],"gē qiú":["牫"],"yòu chōu":["牰"],"tè zhí":["犆"],bēn:["犇","錛","锛"],"jiān qián":["犍","玪"],má:["犘","痲","蔴","蟇","麻"],"máo lí":["犛"],"bá quǎn":["犮"],"zhuó bào":["犳"],"àn hān":["犴"],"kàng gǎng":["犺"],"pèi fèi":["犻"],"fān huān":["犿"],kuáng:["狂","狅","誑","诳","軖","軠","鵟","𫛭"],"yí quán chí":["狋"],"xīng shēng":["狌"],"tuó yí":["狏"],kǔ:["狜","苦"],"huán huān":["狟"],"hé mò":["狢"],"tà shì":["狧"],"máng dòu":["狵"],"xī shǐ":["狶"],suān:["狻","痠","酸"],"bài pí":["猈"],"jiān yàn":["猏","豣"],"yī yǐ":["猗"],"yá wèi":["猚"],cāi:["猜"],"māo máo":["猫","貓"],"chuàn chuān":["猭"],"tuān tuàn":["猯","貒"],"yà jiá qiè":["猰"],"hè xiē gé hài":["猲"],"biān piàn":["猵","獱"],"bó pò":["猼"],"háo gāo":["獋"],"fén fèn":["獖"],"yào xiāo":["獟"],"shuò xī":["獡"],"gé liè xiē":["獦"],"nòu rú":["獳"],"náo nǎo yōu":["獶"],ráng:["獽","瓤","禳","穣","穰","蘘","躟","鬤"],"náo yōu":["獿"],"lǜ shuài":["率"],"wáng wàng":["王"],"yáng chàng":["玚"],"mín wén":["玟"],"bīn fēn":["玢"],"mén yǔn":["玧"],"qiāng cāng":["玱","瑲","篬"],"án gān":["玵"],"xuán xián":["玹"],"cī cǐ":["玼","跐"],"yí tāi":["珆"],"zǔ jù":["珇"],fà:["珐","琺","蕟","髪","髮"],"yín kèn":["珢"],"huī hún":["珲"],"xuán qióng":["琁"],"fú fū":["琈"],"bǐng pín":["琕"],"cuì sè":["琗"],"yù wéi":["琟"],"tiǎn tiàn":["琠"],"zhuó zuó":["琢"],"běng pěi":["琣"],guǎn:["琯","璭","痯","筦","管","舘","輨","錧","館","馆","鳤"],"hún huī":["琿"],"xié jiē":["瑎"],"chàng dàng yáng":["瑒"],"tiàn zhèn":["瑱"],"bīn pián":["瑸","璸"],"tú shū":["瑹"],cuǐ:["璀","皠","趡"],"zǎo suǒ":["璅"],"jué qióng":["璚"],"lú fū":["璷"],"jì zī":["璾"],suí:["瓍","綏","绥","遀","随","隨","髄"],"mí xǐ":["瓕"],"qióng wěi wèi":["瓗"],"huán yè yà":["瓛"],"bó páo":["瓟"],"zhí hú":["瓡"],piáo:["瓢","闝"],"wǎ wà":["瓦"],"xiáng hóng":["瓨"],wèng:["瓮","甕","罋","蕹","齆"],"shèn shén":["甚"],ruí:["甤","緌","蕤"],yòng:["用","砽","苚","蒏","醟","㶲"],shuǎi:["甩"],béng:["甭","甮"],"yóu zhá":["甴"],"diàn tián shèng":["甸"],"tǐng dīng":["町","甼"],"zāi zī":["甾"],"bì qí":["畁"],"dá fú":["畗"],"cè jì":["畟"],"zāi zī tián":["畠"],"zhì chóu shì":["畤"],"fān pān":["畨","番"],"shē yú":["畬"],"dāng dàng dǎng":["當"],"jiāng qiáng":["疆"],"pǐ yǎ shū":["疋"],"jié qiè":["疌"],"yí nǐ":["疑"],nè:["疒","眲","訥","讷"],"gē yì":["疙"],"nüè yào":["疟","瘧"],"lì lài":["疠","癘"],"yǎ xiā":["疨"],xuē:["疶","蒆","薛","辥","辪","靴","鞾"],"dǎn da":["疸"],"fá biǎn":["疺"],"fèi féi":["疿","痱"],"shān diàn":["痁"],"téng chóng":["痋"],"tōng tóng":["痌"],"wěi yòu yù":["痏"],"tān shǐ":["痑"],"pū pù":["痡","鋪"],"bēng péng":["痭"],"má lìn":["痳"],"tiǎn diàn":["痶"],"ān yè è":["痷"],"kē ē":["痾"],"zhì chì":["瘈"],"jiǎ xiá xiā":["瘕"],"lěi huì":["瘣"],"chài cuó":["瘥"],"diān chēn":["瘨"],"da dá":["瘩"],"biě biē":["瘪"],qué:["瘸"],"dàn dān":["癉"],"guì wēi":["癐"],"nòng nóng":["癑"],"biē biě":["癟"],"bō bǒ":["癷"],bái:["白"],"jí bī":["皀"],"de dì dí dī":["的"],"pā bà":["皅"],"gāo háo":["皋"],"gāo yáo":["皐"],"lì luò bō":["皪"],"zhā cǔ":["皻"],"zhāo zhǎn dǎn":["皽"],"jiān jiàn":["监","監","鋻","间","鞬"],"gài gě hé":["盖"],"máng wàng":["盳"],yuǎn:["盶","逺","遠"],"tián xián":["盷"],"xiāng xiàng":["相"],dǔn:["盹","趸","躉"],"xì pǎn":["盻"],"shěng xǐng":["省"],"yún hùn":["眃"],"miǎn miàn":["眄"],"kàn kān":["看"],"yìng yāng yǎng":["眏"],"yǎo āo ǎo":["眑"],"jū xū kōu":["眗"],"yí chì":["眙"],"dié tì":["眣"],"bǐng fǎng":["眪"],"pàng pán":["眫"],"mī mí":["眯","瞇"],"xuàn shùn xún":["眴"],tiào:["眺","粜","糶","覜","趒"],"zhe zhuó zháo zhāo":["着"],"qiáo shào xiāo":["睄"],"cuó zhuài":["睉"],gùn:["睔","謴"],"suì zuì":["睟"],"pì bì":["睥","稫","辟"],"yì zé gāo":["睪"],"xǐng xìng":["睲"],"guì wèi kuì":["瞆"],"kòu jì":["瞉"],"qióng huán":["瞏"],"mán mén":["瞒","瞞"],"diāo dōu":["瞗"],"lou lóu lǘ":["瞜"],"shùn rún":["瞤"],"liào liǎo":["瞭","钌"],"jiàn xián":["瞯"],"wǔ mí":["瞴"],"guì kuì":["瞶"],"nǐng chēng":["矃"],"huò yuè":["矆"],"mēng méng":["矇"],"kuàng guō":["矌"],"guàn quán":["矔"],"mǎn mán":["矕"],"jīn guān qín":["矜"],"jīn qín guān":["矝"],"yù xù jué":["矞"],"jiǎo jiáo":["矫","矯"],duǎn:["短"],"shí dàn":["石"],"gāng qiāng kòng":["矼"],"huā xū":["砉"],"pīn bīn fēn":["砏"],"yán yàn":["研","硏"],"luǒ kē":["砢"],"fú fèi":["砩","笰"],"zhǔ zhù":["砫"],"lá lì lā":["砬"],"kuāng guāng":["硄"],"gè luò":["硌"],"shuò shí":["硕","碩"],"wèi wéi ái":["硙"],"què kè kù":["硞"],"mǎng bàng":["硥"],"luò lòng":["硦"],"yǒng tóng":["硧"],nüè:["硸","虐"],"kēng kěng":["硻"],"yān yǎn":["硽"],"zhuì chuí duǒ":["硾"],"kōng kòng":["硿"],"zòng cóng":["碂"],"jiān zhàn":["碊"],"lù liù":["碌","陆"],"què xī":["碏"],"lún lǔn lùn":["碖"],"náo gāng":["碙"],"jié yà":["碣"],"wèi wěi":["碨"],"tí dī":["碮"],"chá chā":["碴"],"qiāo què":["碻"],"sù xiè":["碿"],"liú liù":["磂","遛","鎦","馏"],"sī tí":["磃"],"bàng páng":["磅"],"huá kě gū":["磆"],"wěi kuǐ":["磈"],"xiá qià yà":["磍"],"lián qiān":["磏"],"wèi ái gài":["磑"],"lá lā":["磖"],"áo qiāo":["磝"],"pēng pèng":["磞","閛"],"yīn yǐn":["磤"],"lěi léi":["磥"],"mó mò":["磨"],"qì zhú":["磩"],"láo luò":["磱"],"pán bō":["磻"],"jí shé":["磼"],"hé qiāo qiào":["礉"],"kè huò":["礊"],"què hú":["礐"],"è qì":["礘"],cǎ:["礤","礸"],"xián xín":["礥"],"léi lěi lèi":["礧"],"yán yǎn":["礹"],"qí zhǐ":["祇","蚔"],"bēng fāng":["祊"],"bì mì":["祕"],suàn:["祘","笇","筭","算","蒜"],"piào piāo":["票"],"jì zhài":["祭"],"shuì lèi":["祱"],"jìn jīn":["禁"],"chán shàn":["禅"],"yáng shāng":["禓"],"zhī zhǐ tí":["禔"],"shàn chán":["禪"],"yú yù ǒu":["禺"],"zǐ zì":["秄"],"chá ná":["秅"],"zhǒng zhòng chóng":["种"],"hào mào":["秏"],"kù kū":["秙"],zū:["租","葅"],chèng:["秤","穪"],"huó kuò":["秮","秳"],"chēng chèn chèng":["称","稱"],"shì zhì":["秲","銴"],"fù pū":["秿"],"xùn zè":["稄"],"tú shǔ":["稌"],"zhùn zhǔn":["稕"],"jī qí":["稘","綨","觭"],"léng líng":["稜"],"zuì zú sū":["稡"],"xì qiè":["稧","郄"],"zhǒng zhòng":["種"],"zōng zǒng":["稯"],"xián jiān liàn":["稴"],"zī jiū":["稵"],"jī qǐ":["稽"],ròng:["穃"],"shān cǎn cēn":["穇"],"mén méi":["穈"],"jǐ jì":["穖"],"xiāo rào":["穘"],"zhuō bó":["穛"],"tóng zhǒng zhòng":["穜"],zuō:["穝"],"biāo pāo":["穮","藨"],"zhuō jué":["穱"],"cuán zàn":["穳"],"kōng kòng kǒng":["空"],"yū yǔ":["穻"],zhǎi:["窄","鉙"],báo:["窇","雹"],"kū zhú":["窋"],"jiào liáo liù":["窌"],"wā guī":["窐"],"tiǎo yáo":["窕"],"xūn yìn":["窨"],"yà yē":["窫"],"tián diān yǎn":["窴"],"chāo kē":["窼"],"kuǎn cuàn":["窽","窾"],"chù qì":["竐"],"qǔ kǒu":["竘"],"jìng zhěn":["竧"],"kǎn kàn":["竷"],"zhú dǔ":["竺"],"lè jīn":["竻"],"zhuì ruì":["笍"],"háng hàng":["笐"],"cén jìn hán":["笒"],"dā xiá nà":["笚"],"zé zuó":["笮"],"lóng lǒng":["笼","篭","籠","躘","龓"],"zhù zhú":["筑","築"],"dá dā":["答","荅"],shāi:["筛","篩","簁","籭"],"yún jūn":["筠"],"láng làng":["筤","郎","阆"],"zhì zhǐ":["筫"],o:["筽"],"póu bù fú pú":["箁"],"pái bēi":["箄"],gè:["箇","虼","鉻","铬"],"tái chí":["箈"],"guǎi dài":["箉"],"zhào dào":["箌"],"jīng qìng":["箐"],"lín lǐn":["箖"],"jùn qūn":["箘"],"shī yí":["箷","釶"],"yuē yào chuò":["箹"],"xiāo shuò qiào":["箾"],"gōng gǎn lǒng":["篢"],"páng péng":["篣"],"zhuó huò":["篧"],"jiǎn jiān":["篯"],"dí zhú":["篴"],"zān cēn cǎn":["篸"],"zhuàn suǎn zuàn":["篹"],"piǎo biāo":["篻"],"guó guì":["簂"],"cè jí":["簎"],"mì miè":["簚"],"shāi sī":["簛"],"sǔn zhuàn":["簨"],"gàn gǎn":["簳"],"bò bǒ":["簸"],"bó bù":["簿"],shi:["籂"],"zhēn jiān":["籈"],"zhuàn zuǎn":["籑"],"fān pān biān":["籓"],"sǒu shǔ":["籔"],zuǎn:["籫","繤","纂","纉","纘","缵"],nǚ:["籹","釹","钕"],"shā chǎo":["粆"],"kāng jīng":["粇"],fěn:["粉","黺"],cū:["粗","觕","麁","麄","麤"],"nián zhān":["粘"],"cè sè":["粣"],"zhōu yù":["粥"],"shēn sǎn":["糁"],"biān biǎn":["糄","萹"],miàn:["糆","面","靣","麪","麫","麵","麺"],"hú hū hù":["糊"],"gǔ gòu":["糓"],"mí méi":["糜"],"sǎn shēn":["糝","糣"],zāo:["糟","蹧","遭","醩"],"mì sī":["糸"],"jiū jiǔ":["糺"],"xì jì":["系","繫"],"zhēng zhěng":["糽"],"chà chǎ":["紁","衩"],"yuē yāo":["約","约"],"hóng gōng":["紅","红"],"hé gē":["紇","纥"],"wén wèn":["紋","纹"],fóu:["紑"],"jì jié jiè":["紒"],"pī pí bǐ":["紕","纰"],"jīn jìn":["紟"],"zhā zā":["紥","紮"],hā:["紦"],"fū fù":["紨"],"chōu chóu":["紬"],"lèi léi lěi":["累"],"bō bì":["紴"],"tiǎn zhěn":["紾"],"jiōng jiǒng":["絅"],"jié jiē":["結","结","节"],"guà kuā":["絓"],"bǎi mò":["絔"],"gēng huán":["絙"],"jié xié":["絜"],"quán shuān":["絟"],"gǎi ǎi":["絠"],"luò lào":["絡","络"],"bīng bēng pēng":["絣"],"gěi jǐ":["給","给"],"tóng tōng dòng":["絧"],"tiào diào dào":["絩"],"lěi lèi léi":["絫"],"gāi hài":["絯"],"chī zhǐ":["絺"],"wèn miǎn mán wàn":["絻"],"huán huàn wàn":["綄"],"qīn xiān":["綅"],"tì tí":["綈"],"yán xiàn":["綖"],"zōng zèng zòng":["綜"],"chēn lín":["綝"],"zhǔn zhùn":["綧"],"qiàn qīng zhēng":["綪"],"qìng qǐ":["綮"],"lún guān":["綸","纶"],"chuò chāo":["綽","绰"],"tián tǎn chān":["緂"],"lǜ lù":["緑","绿"],"ruǎn ruàn":["緛"],"jí qī":["緝"],"zhòng chóng":["緟","重"],"miáo máo":["緢"],"xiè yè":["緤"],huǎn:["緩","缓","㬊"],"gēng gèng":["緪","縆"],"tōu xū shū":["緰"],"zōng zòng":["緵","繌"],"yùn gǔn":["緷"],"guā wō":["緺"],"yùn yūn wēn":["緼","縕"],"bāng bàng":["縍"],"gǔ hú":["縎","鶻"],"cī cuò suǒ":["縒"],"cuī shuāi":["縗"],"róng rǒng ròng":["縙"],"zài zēng":["縡"],cài:["縩","菜","蔡"],"féng fèng":["縫"],"suō sù":["縮","缩"],"yǎn yǐn":["縯","酓"],"zòng zǒng":["縱","纵"],"zhuàn juàn":["縳"],"mò mù":["縸","莫"],"piǎo piāo":["縹","缥"],"fán pó":["繁"],"bēng bèng":["繃"],"móu miù miào liǎo":["繆"],"yáo yóu zhòu":["繇"],"zēng zèng":["繒","缯"],"jú jué":["繘"],"chuō chuò":["繛"],"zūn zǔn":["繜"],rào:["繞","绕","遶"],"chǎn chán":["繟"],"huì huí":["繢","缋","藱"],"qiāo sāo zǎo":["繰"],"jiǎo zhuó":["繳","缴"],"dàn tán chán":["繵"],nǒng:["繷"],"pú fú":["纀"],"yào lì":["纅"],"rǎng xiāng":["纕"],"lí sǎ xǐ lǐ":["纚"],"xiān qiàn":["纤"],"jīng jìng":["经"],"tí tì":["绨"],"bēng běng bèng":["绷"],"zōng zèng":["综"],"jī qī":["缉"],"wēn yùn yūn":["缊"],"fèng féng":["缝"],"shuāi cuī suī":["缞"],"miù móu liáo miào mù":["缪"],"qiāo sāo":["缲"],fǒu:["缶","缹","缻","雬","鴀"],"bà ba pí":["罢","罷"],"guà guǎi":["罫"],"yáng xiáng":["羊","羏"],"měi gāo":["羙"],"yì xī":["羛"],"qiǎng qiān":["羟"],"qiāng kòng":["羫"],"qián xián yán":["羬"],nóu:["羺"],"hóng gòng":["羾"],"pī bì pō":["翍"],"qú yù":["翑"],ké:["翗"],"qiào qiáo":["翘"],"zhái dí":["翟"],"dào zhōu":["翢"],"hóu qú":["翵"],shuǎ:["耍"],"ruǎn nuò":["耎"],"ér nài":["耏"],"zhuān duān":["耑"],"pá bà":["耙"],"chí sì":["耛"],"qù chú":["耝"],"lún lǔn":["耣"],"jí jiè":["耤"],"tāng tǎng":["耥"],pǎng:["耪","覫"],"zhá zé":["耫"],"yē yé":["耶"],"yún yíng":["耺"],"wà tuǐ zhuó":["聉"],"ér nǜ":["聏"],"tiē zhé":["聑"],"dǐ zhì":["聜"],qié:["聺"],"nǐ jiàn":["聻"],"lèi lē":["肋"],cào:["肏","襙","鄵","鼜"],"bó dí":["肑"],"xiào xiāo":["肖"],"dù dǔ":["肚"],chāi:["肞","釵","钗"],"hán qín hàn":["肣"],"pàng pán pàn":["肨","胖"],"zhūn chún":["肫"],āng:["肮","骯"],"yù yō":["育"],"pí bǐ bì":["肶"],"fèi bì":["胇"],"bèi bēi":["背"],"fèi zǐ":["胏"],"píng pēng":["胓","苹"],"fū fú zhǒu":["胕"],"shèng shēng":["胜"],kuà:["胯","跨","骻"],"gǎi hǎi":["胲"],"gē gé gā":["胳"],"néng nài":["能"],"guī kuì":["胿"],"mài mò":["脉"],"zāng zàng":["脏"],"jiǎo jué":["脚","角"],cuǒ:["脞"],"de te":["脦"],"zuī juān":["脧"],něi:["脮","腇","餒","馁","鮾","鯘"],"pú fǔ":["脯"],niào:["脲"],shuí:["脽"],guò:["腂","過","鐹"],"là xī":["腊"],"yān ā":["腌"],"gāo gào":["膏"],"lù biāo":["膔"],chuái:["膗"],"zhuān chuán chún zhuǎn":["膞"],chuài:["膪","踹"],"fán pán":["膰"],"wǔ hū":["膴"],"shān dàn":["膻"],tún:["臀","臋","蛌","豘","豚","軘","霕","飩","饨","魨","鲀","黗"],"bì bei":["臂"],"là gé":["臈"],"sào sāo":["臊"],nào:["臑","閙","闹","鬧"],"ní luán":["臡"],"qiān xián":["臤"],"guàng jiǒng":["臦"],"guǎng jiǒng":["臩"],"chòu xiù":["臭"],"mián biān":["臱"],"dié zhí":["臷"],"zhī jìn":["臸"],"shè shě":["舍"],pù:["舖","舗"],"bān bō pán":["般"],kuā:["舿"],"gèn gěn":["艮"],"sè shǎi":["色"],"fú bó":["艴"],"jiāo qiú":["艽"],"chāi chā":["芆"],"sháo què":["芍"],"hù xià":["芐"],"zì zǐ":["芓"],"huì hū":["芔"],"tún chūn":["芚"],"jiè gài":["芥"],"xù zhù":["芧"],"yuán yán":["芫"],"xīn xìn":["芯"],"lún huā":["芲"],"wù hū":["芴"],"gōu gǒu":["芶"],"mào máo":["芼"],"fèi fú":["芾"],"chán yín":["苂"],qiē:["苆"],"sū sù":["苏"],"tiáo sháo":["苕"],"lì jī":["苙"],"kē hē":["苛"],"jù qǔ":["苣"],"ruò rě":["若"],"zhù níng":["苧"],"pā bó":["苩"],xiú:["苬"],"zhǎ zuó":["苲"],"jū chá":["苴"],nié:["苶"],"shēng ruí":["苼"],"qié jiā":["茄"],"zǐ cí":["茈"],"qiàn xī":["茜"],chǎi:["茝"],"fá pèi":["茷"],ráo:["荛","蕘","襓","饒","饶"],"yíng xíng":["荥"],"qián xún":["荨","蕁"],"yìn yīn":["荫"],"hé hè":["荷"],"shā suō":["莎"],"péng fēng":["莑"],"shēn xīn":["莘"],"wǎn guān guǎn":["莞"],"yóu sù":["莤"],"shāo xiāo":["莦","蛸"],"làng liáng":["莨"],"piǎo fú":["莩"],"wèn wǎn miǎn":["莬"],"shì shí":["莳","蒔"],"tù tú":["莵"],"xiān liǎn":["莶","薟"],"wǎn yù":["菀"],"zōu chù":["菆"],"lù lǜ":["菉"],"jūn jùn":["菌"],"niè rěn":["菍"],"zī zì zāi":["菑"],"tú tù":["菟"],"jiē shà":["菨"],"qiáo zhǎo":["菬"],"tái zhī chí":["菭"],"fēi fěi":["菲","蜚"],"qín qīn jīn":["菳"],"zū jù":["菹","蒩"],"lǐn má":["菻"],"tián tiàn":["菾"],tiē:["萜","貼","贴"],"luò là lào luō":["落"],"zhù zhuó zhe":["著"],"shèn rèn":["葚"],"gě gé":["葛"],"jùn suǒ":["葰"],"kuì kuài":["蒉"],"rú ná":["蒘"],"méng mēng měng":["蒙"],"yuán huán":["蒝"],"xú shú":["蒣"],"xí xì":["蒵"],"mì míng":["蓂"],"sōu sǒu":["蓃"],"gài gě hé hài":["蓋"],"yǎo zhuó":["蓔"],"diào tiáo dí":["蓧"],"xū qiū fū":["蓲"],"zí jú":["蓻"],"liǎo lù":["蓼"],xu:["蓿"],"hàn hǎn":["蔊"],"màn wàn mán":["蔓"],"pó bò":["蔢"],"fān fán bō":["蕃"],"hóng hòng":["蕻"],"yù ào":["薁","隩"],"xí xiào":["薂"],"báo bó bò":["薄"],"cí zī":["薋"],"wàn luàn":["薍"],"kǎo hāo":["薧"],"yuǎn wěi":["薳"],"zhòu chóu":["薵"],"wō mái":["薶"],"xiāo hào":["藃"],"yù xù xū":["藇"],"jiè jí":["藉"],"diào zhuó":["藋"],"cáng zàng":["藏"],lǎ:["藞"],"chú zhū":["藸"],"pín píng":["蘋"],"gān hán":["虷"],"hóng jiàng":["虹"],"huī huǐ":["虺"],"xiā há":["虾"],"mǎ mà mā":["蚂"],"fāng bàng":["蚄"],"bàng bèng":["蚌"],"jué quē":["蚗"],"qín qián":["蚙"],"gōng zhōng":["蚣"],"fǔ fù":["蚥"],"dài dé":["蚮"],"gǒu qú xù":["蚼"],"bǒ pí":["蚾"],"shé yí":["蛇"],tiě:["蛈","鉄","銕","鐡","鐵","铁","驖"],"gé luò":["蛒"],"máng bàng":["蛖"],"yì xǔ":["蛡"],"há gé":["蛤"],"qiè ní":["蛪"],"é yǐ":["蛾"],"zhē zhé":["蜇"],"là zhà":["蜡"],suò:["蜶","逤"],"yóu qiú":["蝤"],"xiā hā":["蝦"],"xī qī":["螇"],"bī pí":["螕"],"nài něng":["螚"],"hé xiá":["螛"],"guì huǐ":["螝"],"mǎ mā mà":["螞"],"shì zhē":["螫"],"zhì dié":["螲"],"jiàn chán":["螹"],"ma má mò":["蟆"],"mǎng měng":["蟒"],"biē bié":["蟞"],"bēn fèi":["蟦"],"láo liáo":["蟧"],"yín xún":["蟫"],"lí lǐ":["蠡"],"xuè xiě":["血"],"xíng háng hàng héng":["行"],"shuāi cuī":["衰"],"tuó tuō":["袉"],"lǐng líng":["袊"],"bào páo pào":["袌"],"jù jiē":["袓"],"hè kè":["袔"],"yí yì":["袘","貤"],"nà jué":["袦"],"bèi pī":["被"],"chǐ nuǒ":["袲"],"chǐ qǐ duǒ nuǒ":["袳"],"jiá qiā jié":["袷"],"bó mò":["袹"],"guī guà":["袿"],"liè liě":["裂"],"chéng chěng":["裎"],"jiē gé":["裓"],"dāo chóu":["裯"],"shang cháng":["裳"],"yuān gǔn":["裷"],"yǎn ān":["裺"],"tì xī":["裼"],"fù fú":["褔"],"chǔ zhǔ":["褚"],"tuì tùn":["褪"],lǎi:["襰"],"yào yāo":["要"],"qín tán":["覃"],"jiàn xiàn":["見","见"],piǎn:["覑","諞","谝","貵","𡎚"],"piē miè":["覕"],"yíng yǐng":["覮"],"qù qū":["覰","覷","觑"],"jiàn biǎn":["覵"],"luó luǎn":["覶"],"zī zuǐ":["觜"],"huà xiè":["觟"],"jiě jiè xiè":["解","觧"],"xué hù":["觷"],"lì lù":["觻"],tǎo:["討","讨"],zhùn:["訰"],"zī zǐ":["訾"],"yí dài":["詒","诒"],xiòng:["詗","诇"],"diào tiǎo":["誂"],"yí chǐ chì":["誃"],"lǎng làng":["誏"],"ēi éi ěi èi xī":["誒","诶"],shuà:["誜"],"yǔ yù":["語","语","雨"],"shuō shuì yuè":["說","说"],"shuí shéi":["誰","谁"],"qū juè":["誳"],"chī lài":["誺"],"nì ná":["誽"],"diào tiáo":["調"],"pǐ bēi":["諀"],"jì jī":["諅"],"zé zuò zhǎ cuò":["諎"],"chù jí":["諔"],"háo xià":["諕"],"lùn lún":["論","论"],"shì dì":["諟"],"huà guā":["諣"],"xǐ shāi āi":["諰"],"nán nàn":["諵","難"],miù:["謬","谬"],zèn:["譖","谮"],"shí zhì":["識","识"],"juàn xuān":["讂"],"yí tuī":["讉"],zhán:["讝"],"xǔ hǔ":["许"],"xiáng yáng":["详"],"tiáo diào zhōu":["调"],"chén shèn":["谌"],"mí mèi":["谜"],"màn mán":["谩"],"gǔ yù":["谷"],"huō huò huá":["豁"],"zhì zhài":["豸"],"huān huán":["貆"],"kěn kūn":["貇"],"mò hé":["貈"],"mò hé háo":["貉"],"jù lóu":["貗"],"zé zhài":["責","责"],"dài tè":["貸"],"bì bēn":["賁"],"jiǎ gǔ jià":["賈"],"xiōng mín":["賯"],càng:["賶"],"zhuàn zuàn":["賺","赚"],"wàn zhuàn":["贃"],"gàn gòng zhuàng":["贛"],"yuán yùn":["贠"],"bēn bì":["贲"],"jiǎ gǔ":["贾"],zǒu:["走","赱","鯐"],"dié tú":["趃"],"jū qiè":["趄"],"qū cù":["趋","趨"],"jí jié":["趌"],"guā huó":["趏"],"què qì jí":["趞"],"tàng tāng":["趟"],"chuō zhuó":["趠"],"qù cù":["趣"],"yuè tì":["趯"],"bō bào":["趵"],"kuà wù":["趶"],"guì jué":["趹"],"fāng fàng páng":["趽"],"páo bà":["跁"],"qí qǐ":["跂"],"jiàn chén":["跈"],"pǎo páo":["跑"],"diǎn diē tiē":["跕"],"jū jù qiè":["跙"],bǒ:["跛"],"luò lì":["跞"],"dài duò duō chí":["跢"],zhuǎi:["跩"],"bèng pián":["跰"],"tiào táo":["跳"],"shū chōu":["跾"],"liàng liáng":["踉"],"tà tā":["踏"],chǎ:["蹅","鑔","镲"],"dí zhí":["蹢"],"dēng dèng":["蹬","鐙","镫"],cèng:["蹭"],"dūn cún":["蹲"],"juě jué":["蹶"],liāo:["蹽"],"xiè sǎ":["躠"],tǐ:["躰","軆","骵"],"yà zhá gá":["轧","軋"],"xìn xiàn":["軐"],"fàn guǐ":["軓"],"zhuàn zhuǎn":["転"],"zhóu zhòu":["軸","轴"],bú:["轐","醭","鳪"],"zhuǎn zhuàn zhuǎi":["转"],"zǎi zài":["载"],"niǎn zhǎn":["辗"],"biān bian":["边"],"dào biān":["辺"],"yǐ yí":["迆","迤","迱"],"guò guo guō":["过"],"wàng kuāng":["迋"],"hái huán":["还"],"zhè zhèi":["这"],"yuǎn yuàn":["远"],"zhì lì":["迣"],"zhù wǎng":["迬"],"zhuī duī":["追"],"shì kuò":["适"],tòu:["透"],"tōng tòng":["通"],guàng:["逛"],"dǎi dài":["逮"],"suì suí":["遂"],"tí dì":["遆"],"yí wèi":["遗"],"shì dí zhé":["適"],cà:["遪"],"huán hái":["還"],"lí chí":["邌"],"kàng háng":["邟"],"nà nèi nā":["那"],"xié yá yé yú xú":["邪"],"gāi hái":["郂"],"huán xún":["郇"],"chī xī":["郗"],hǎo:["郝"],"lì zhí":["郦"],"xiáo ǎo":["郩"],"dōu dū":["都"],liǎo:["曢","鄝","镽"],"zàn cuán cuó":["酂","酇"],"dīng dǐng":["酊"],"cù zuò":["酢"],"fā pō":["酦"],"shāi shī":["酾"],niàng:["酿","醸"],"qiú chōu":["醔"],"pō fā":["醗","醱"],"chǎn chěn":["醦"],"yàn liǎn xiān":["醶"],"niàng niáng":["釀"],"lǐ li":["里"],"lí xǐ xī":["釐"],"liǎo liào":["釕"],"dīng dìng":["釘","钉"],"qiǎo jiǎo":["釥"],"yú huá":["釪"],"huá wū":["釫"],"rì rèn jiàn":["釰","釼"],"dì dài":["釱"],"pī zhāo":["釽"],"yá yé":["釾"],"bǎ pá":["鈀","钯"],"tā tuó":["鉈","铊"],běi:["鉳"],"bǐng píng":["鉼"],"hā kē":["鉿","铪"],chòng:["銃","铳"],"xiǎng jiōng":["銄"],"yù sì":["銉"],"xù huì":["銊"],"rén rěn":["銋"],"shàn shuò":["銏"],"chì lì":["銐"],"xiǎn xǐ":["銑","铣"],"hóu xiàng":["銗"],"diào tiáo yáo":["銚"],"xiān kuò tiǎn guā":["銛","銽","铦"],"zhé niè":["銸"],"zhōng yōng":["銿"],"tōu tù dòu":["鋀"],"méi méng":["鋂"],"wàn jiǎn":["鋄","鎫"],"tǐng dìng":["鋌","铤"],"juān jiān cuān":["鋑"],"sī tuó":["鋖"],"juān xuān juàn":["鋗"],"wú huá wū":["鋘"],"zhuó chuò":["鋜"],"xíng xìng jīng":["鋞"],"jū jú":["鋦","锔"],"zuì niè":["鋷"],"yuān yuǎn wǎn wān":["鋺"],"gāng gàng":["鋼","钢"],zhuī:["錐","锥","騅","骓","鵻"],ā:["錒","锕"],"cuō chā":["鎈"],"suǒ sè":["鎍"],"yáo zú":["鎐"],"yè tà gé":["鎑"],"qiāng chēng":["鎗"],"gé lì":["鎘","镉","鬲"],"bī pī bì":["鎞"],"gǎo hào":["鎬"],"zú chuò":["鏃"],"xiū xiù":["鏅"],"shòu sōu":["鏉"],"dí dī":["鏑","镝"],"qiāo sǎn càn":["鏒"],"lù áo":["鏕"],"tāng táng":["鏜"],"jiàn zàn":["鏩"],"huì suì ruì":["鏸"],"qiǎng qiāng":["鏹","镪"],"sǎn xiàn sà":["鏾"],"jiǎn jiàn":["鐧","锏"],"dāng chēng":["鐺","铛"],"zuān zuàn":["鑽"],"sà xì":["钑"],"yào yuè":["钥"],"tǒu dǒu":["钭"],"zuàn zuān":["钻"],"qiān yán":["铅"],"pí pī":["铍"],"yáo diào tiáo":["铫"],"tāng tàng":["铴"],"pù pū":["铺"],"tán xiān":["锬"],"liù liú":["镏"],"hào gǎo":["镐"],"táng tāng":["镗"],"tán chán xín":["镡"],"huò shǎn":["閄"],"hàn bì":["閈","闬"],"kāng kàng":["閌","闶"],"xián jiàn jiān jiǎn":["閒"],"xiā xiǎ":["閕"],"xiǎ kě":["閜"],"biàn guān":["閞"],"hé gé":["閤","颌"],"hòng xiàng":["閧"],"sē xī":["閪"],"tíng tǐng":["閮"],"è yān":["閼","阏"],"hòng juǎn xiàng":["闂"],"bǎn pàn":["闆"],"dū shé":["闍","阇"],"què quē":["闕"],"tāng táng chāng":["闛"],"kàn hǎn":["闞","阚"],"xì sè tà":["闟"],"mēn mèn":["闷"],"quē què":["阙"],"yán diàn":["阽"],"ā ē":["阿"],"bēi pō pí":["陂"],"yàn yǎn":["隁"],"yú yáo shù":["隃"],"lóng lōng":["隆"],"duì zhuì":["隊"],"suí duò":["隋"],"gāi qí ái":["隑"],"huī duò":["隓","隳"],"wěi kuí":["隗"],"lì dài":["隸"],"zhuī cuī wéi":["隹"],"hè hú":["隺","鶮"],"jùn juàn":["隽","雋"],"nán nàn nuó":["难"],"què qiāo qiǎo":["雀"],"guàn huán":["雚"],"guī xī":["雟"],"sè xí":["雭"],án:["雸"],"wù méng":["雺"],tèng:["霯"],"lù lòu":["露"],mái:["霾"],"jìng liàng":["靚"],"gé jí":["革"],bǎ:["靶"],"yāng yàng":["鞅"],"gé tà sǎ":["鞈"],"biān yìng":["鞕"],"qiào shāo":["鞘"],"juān xuān":["鞙"],"shàng zhǎng":["鞝"],"pí bǐng bì bēi":["鞞"],la:["鞡"],"xiè dié":["鞢"],ēng:["鞥"],"móu mù":["鞪"],"bì bǐng":["鞸"],"mèi wà":["韎"],rǒu:["韖"],"shè xiè":["韘"],"yùn wēn":["韫"],"dùn dú":["頓","顿"],duǐ:["頧"],luō:["頱"],"bīn pín":["頻"],yóng:["顒","颙","鰫"],mān:["顢","颟"],"jǐng gěng":["颈"],"jié xié jiá":["颉"],"kē ké":["颏"],"pín bīn":["频"],"chàn zhàn":["颤"],"fēng fěng":["風","风"],"biāo diū":["颩"],"bá fú":["颰"],"sāo sōu":["颾"],"liù liáo":["飂"],"shí sì yì":["食"],"yǎng juàn":["飬"],"zhù tǒu":["飳"],"yí sì":["飴"],"zuò zé zhā":["飵"],tiè:["飻","餮"],"xiǎng náng":["饟"],"táng xíng":["饧"],"gē le":["饹"],"chā zha":["馇"],"náng nǎng":["馕"],"yūn wò":["馧"],"zhī shì":["馶"],"xìn jìn":["馸"],"kuài jué":["駃"],zǎng:["駔","驵"],"tái dài":["駘"],"xún xuān":["駨"],"liáng láng":["駺"],piàn:["騗","騙","骗","魸"],"dài tái":["骀"],"sāo sǎo":["骚"],"gǔ gū":["骨"],"bèi mó":["骳"],"xiāo qiāo":["骹"],"bǎng pǎng":["髈"],"bó jué":["髉"],"bì pǒ":["髲"],"máo méng":["髳"],"kuò yuè":["髺"],"bā bà":["魞","鲃"],"jì cǐ":["鮆"],"bó bà":["鮊"],"zhǎ zhà":["鮓","鲊"],"chóu dài":["鮘"],"luò gé":["鮥"],"guī xié wā kuí":["鮭"],"xiān xiǎn":["鮮","鲜"],"pū bū":["鯆"],"yì sī":["鯣"],"bà bó":["鲌"],"guī xié":["鲑"],"sāi xǐ":["鳃"],"niǎo diǎo":["鳥"],"diāo zhāo":["鳭"],"gān hàn yàn":["鳱"],"fū guī":["鳺"],"jiān qiān zhān":["鳽"],"hé jiè":["鶡"],"piān biǎn":["鶣"],"chuàn zhì":["鶨"],"cāng qiāng":["鶬"],"sǔn xùn":["鶽"],"biāo páo":["麃"],"zhù cū":["麆"],"jūn qún":["麇","麕"],chi:["麶"],"mó me":["麼"],"mó me ma":["麽"],"mí mǒ":["麿"],"dàn shèn":["黮"],"zhěn yān":["黰"],"dǎn zhǎn":["黵"],"miǎn mǐn měng":["黾"],hōu:["齁"],nàng:["齉"],"qí jì zī zhāi":["齐"],"yín kěn yǎn":["龂"],"yín kěn":["龈"],"gōng wò":["龏"],"guī jūn qiū":["龜","龟"],"kuí wā":["䖯"],lōu:["䁖"],"ōu qū":["𫭟"],"lóu lǘ":["𦝼"],"gǎ gā gá":["嘎"],"wā guà":["坬"],"zhǐ dǐ":["茋"],"gǒng hóng":["硔"],"yáo xiào":["滧"]},hf=new lj;Object.keys(GT).forEach(e=>{const t=GT[e];for(let n of t)hf.set(n,e)});const QT={这个:"zhè ge",成为:"chéng wéi",认为:"rèn wéi",作为:"zuò wéi",部分:"bù fen",要求:"yāo qiú",应该:"yīng gāi",增长:"zēng zhǎng",提供:"tí gōng",觉得:"jué de",任务:"rèn wu",那个:"nà ge",称为:"chēng wéi",为主:"wéi zhǔ",了解:"liǎo jiě",处理:"chǔ lǐ",皇上:"huáng shang",只要:"zhǐ yào",大量:"dà liàng",力量:"lì liàng",几乎:"jī hū",干部:"gàn bù",目的:"mù dì",行为:"xíng wéi",只见:"zhǐ jiàn",认识:"rèn shi",市长:"shì zhǎng",师父:"shī fu",调查:"diào chá",重新:"chóng xīn",分为:"fēn wéi",知识:"zhī shi",导弹:"dǎo dàn",质量:"zhì liàng",行款:"háng kuǎn",行列:"háng liè",行话:"háng huà",行业:"háng yè",隔行:"gé háng",在行:"zài háng",行家:"háng jia",内行:"nèi háng",外行:"wài háng",同行:"tóng háng",本行:"běn háng",行伍:"háng wǔ",洋行:"yáng háng",银行:"yín háng",商行:"shāng háng",支行:"zhī háng",总行:"zǒng háng",行情:"háng qíng",懂行:"dǒng háng",行规:"háng guī",行当:"háng dang",行货:"háng huò",太行:"tài háng",入行:"rù háng",中行:"zhōng háng",农行:"nóng háng",工行:"gōng háng",建行:"jiàn háng",各行:"gè háng",行号:"háng hào",行高:"háng gāo",行首:"háng shǒu",行尾:"háng wěi",行末:"háng mò",行长:"háng zhǎng",行距:"háng jù",换行:"huàn háng",行会:"háng huì",行辈:"háng bèi",行道:"háng dào",道行:"dào heng",参与:"cān yù",充分:"chōng fèn",尽管:"jǐn guǎn",生长:"shēng zhǎng",数量:"shù liàng",应当:"yīng dāng",院长:"yuàn zhǎng",强调:"qiáng diào",只能:"zhǐ néng",音乐:"yīn yuè",以为:"yǐ wéi",处于:"chǔ yú",部长:"bù zhǎng",蒙古:"měng gǔ",只有:"zhǐ yǒu",适当:"shì dàng",只好:"zhǐ hǎo",成长:"chéng zhǎng",高兴:"gāo xìng",不了:"bù liǎo",产量:"chǎn liàng",胖子:"pàng zi",显得:"xiǎn de",只是:"zhǐ shì",似的:"shì de",率领:"shuài lǐng",改为:"gǎi wéi",不禁:"bù jīn",成分:"chéng fèn",答应:"dā ying",少年:"shào nián",兴趣:"xìng qù",太监:"tài jian",休息:"xiū xi",校长:"xiào zhǎng",更新:"gēng xīn",合同:"hé tong",喝道:"hè dào",重庆:"chóng qìng",重建:"chóng jiàn",使得:"shǐ de",审查:"shěn chá",累计:"lěi jì",给予:"jǐ yǔ",极为:"jí wéi",冠军:"guàn jūn",仿佛:"fǎng fú",头发:"tóu fa",投降:"tóu xiáng",家长:"jiā zhǎng",仔细:"zǐ xì",要是:"yào shi",将领:"jiàng lǐng",含量:"hán liàng",更为:"gèng wéi",积累:"jī lěi",地处:"dì chǔ",县长:"xiàn zhǎng",少女:"shào nǚ",路上:"lù shang",只怕:"zhǐ pà",能量:"néng liàng",储量:"chǔ liàng",供应:"gōng yìng",挑战:"tiǎo zhàn",西藏:"xī zàng",记得:"jì de",总量:"zǒng liàng",当真:"dàng zhēn",将士:"jiàng shì",差别:"chā bié",较为:"jiào wéi",长老:"zhǎng lǎo",大夫:"dài fu",差异:"chā yì",懂得:"dǒng de",尽量:"jǐn liàng",模样:"mú yàng",的确:"dí què",为首:"wéi shǒu",便宜:"pián yi",更名:"gēng míng",石头:"shí tou",州长:"zhōu zhǎng",为止:"wéi zhǐ",漂亮:"piào liang",炮弹:"pào dàn",藏族:"zàng zú",角色:"jué sè",当作:"dàng zuò",尽快:"jǐn kuài",人为:"rén wéi",重复:"chóng fù",胡同:"hú tòng",差距:"chā jù",弟兄:"dì xiong",大将:"dà jiàng",睡觉:"shuì jiào",一觉:"yí jiào",团长:"tuán zhǎng",队长:"duì zhǎng",区长:"qū zhǎng",难得:"nán dé",丫头:"yā tou",会长:"huì zhǎng",弟弟:"dì di",王爷:"wáng ye",重量:"zhòng liàng",誉为:"yù wéi",家伙:"jiā huo",华山:"huà shān",椅子:"yǐ zi",流量:"liú liàng",长大:"zhǎng dà",勉强:"miǎn qiǎng",会计:"kuài jì",过分:"guò fèn",济南:"jǐ nán",调动:"diào dòng",燕京:"yān jīng",少将:"shào jiàng",中毒:"zhòng dú",晓得:"xiǎo de",变更:"biàn gēng",打更:"dǎ gēng",认得:"rèn de",苹果:"píng guǒ",念头:"niàn tou",挣扎:"zhēng zhá",三藏:"sān zàng",剥削:"bō xuē",丞相:"chéng xiàng",少量:"shǎo liàng",寻思:"xún si",夺得:"duó dé",干线:"gàn xiàn",呼吁:"hū yù",处罚:"chǔ fá",长官:"zhǎng guān",柏林:"bó lín",亲戚:"qīn qi",身分:"shēn fèn",胳膊:"gē bo",着手:"zhuó shǒu",炸弹:"zhà dàn",咳嗽:"ké sou",叶子:"yè zi",外长:"wài zhǎng",供给:"gōng jǐ",师长:"shī zhǎng",变量:"biàn liàng",应有:"yīng yǒu",下载:"xià zài",乐器:"yuè qì",间接:"jiàn jiē",底下:"dǐ xià",打扮:"dǎ bàn",子弹:"zǐ dàn",弹药:"dàn yào",热量:"rè liàng",削弱:"xuē ruò",骨干:"gǔ gàn",容量:"róng liàng",模糊:"mó hu",转动:"zhuàn dòng",称呼:"chēng hu",科长:"kē zhǎng",处置:"chǔ zhì",着重:"zhuó zhòng",着急:"zháo jí",强迫:"qiǎng pò",庭长:"tíng zhǎng",首相:"shǒu xiàng",喇嘛:"lǎ ma",镇长:"zhèn zhǎng",只管:"zhǐ guǎn",重重:"chóng chóng",免得:"miǎn de",着实:"zhuó shí",度假:"dù jià",真相:"zhēn xiàng",相貌:"xiàng mào",处分:"chǔ fèn",委屈:"wěi qu",为期:"wéi qī",伯伯:"bó bo",伯子:"bǎi zi",圈子:"quān zi",见识:"jiàn shi",笼罩:"lǒng zhào",与会:"yù huì",都督:"dū du",都市:"dū shì",成都:"chéng dū",首都:"shǒu dū",帝都:"dì dū",王都:"wáng dū",东都:"dōng dū",都护:"dū hù",都城:"dū chéng",建都:"jiàn dū",迁都:"qiān dū",故都:"gù dū",定都:"dìng dū",中都:"zhōng dū",六安:"lù ān",宰相:"zǎi xiàng",较量:"jiào liàng",对称:"duì chèn",总长:"zǒng zhǎng",相公:"xiàng gong",空白:"kòng bái",打量:"dǎ liang",水分:"shuǐ fèn",舌头:"shé tou",没收:"mò shōu",行李:"xíng li",判处:"pàn chǔ",散文:"sǎn wén",处境:"chǔ jìng",孙子:"sūn zi",拳头:"quán tou",打发:"dǎ fā",组长:"zǔ zhǎng",骨头:"gǔ tou",宁可:"nìng kě",更换:"gēng huàn",薄弱:"bó ruò",还原:"huán yuán",重修:"chóng xiū",重来:"chóng lái",只顾:"zhǐ gù",爱好:"ài hào",馒头:"mán tou",军长:"jūn zhǎng",首长:"shǒu zhǎng",厂长:"chǎng zhǎng",司长:"sī zhǎng",长子:"zhǎng zǐ",强劲:"qiáng jìng",恰当:"qià dàng",头儿:"tóu er",站长:"zhàn zhǎng",折腾:"zhē teng",相处:"xiāng chǔ",统率:"tǒng shuài",中将:"zhōng jiàng",命中:"mìng zhòng",名将:"míng jiàng",木头:"mù tou",动弹:"dòng tan",地壳:"dì qiào",干活:"gàn huó",少爷:"shào ye",水量:"shuǐ liàng",补给:"bǔ jǐ",尾巴:"wěi ba",来得:"lái de",好奇:"hào qí",钥匙:"yào shi",当做:"dàng zuò",沉着:"chén zhuó",哑巴:"yǎ ba",车子:"chē zi",上将:"shàng jiàng",恶心:"ě xīn",担子:"dàn zi",应届:"yīng jiè",主角:"zhǔ jué",运转:"yùn zhuǎn",兄长:"xiōng zhǎng",格式:"gé shì",正月:"zhēng yuè",营长:"yíng zhǎng",当成:"dàng chéng",女婿:"nǚ xu",咽喉:"yān hóu",重阳:"chóng yáng",化为:"huà wéi",吐蕃:"tǔ bō",钻进:"zuān jìn",乐队:"yuè duì",亮相:"liàng xiàng",被子:"bèi zi",舍得:"shě de",杉木:"shā mù",击中:"jī zhòng",排长:"pái zhǎng",假期:"jià qī",分量:"fèn liàng",数次:"shù cì",提防:"dī fáng",吆喝:"yāo he",查处:"chá chǔ",量子:"liàng zǐ",里头:"lǐ tou",调研:"diào yán",伺候:"cì hou",重申:"chóng shēn",枕头:"zhěn tou",拚命:"pīn mìng",社长:"shè zhǎng",归还:"guī huán",批量:"pī liàng",畜牧:"xù mù",点着:"diǎn zháo",甚为:"shèn wéi",小将:"xiǎo jiàng",着眼:"zhuó yǎn",处死:"chǔ sǐ",厌恶:"yàn wù",鼓乐:"gǔ yuè",树干:"shù gàn",秘鲁:"bì lǔ",大方:"dà fāng",外头:"wài tou",班长:"bān zhǎng",星宿:"xīng xiù",宁愿:"nìng yuàn",钦差:"qīn chāi",为数:"wéi shù",勾当:"gòu dàng",削减:"xuē jiǎn",间谍:"jiàn dié",埋怨:"mán yuàn",结实:"jiē shi",计量:"jì liáng",淹没:"yān mò",村长:"cūn zhǎng",连长:"lián zhǎng",自给:"zì jǐ",武将:"wǔ jiàng",温差:"wēn chā",直奔:"zhí bèn",供求:"gōng qiú",剂量:"jì liàng",道长:"dào zhǎng",泄露:"xiè lòu",王八:"wáng ba",切割:"qiē gē",间隔:"jiàn gé",一晃:"yì huǎng",长假:"cháng jià",令狐:"líng hú",为害:"wéi hài",句子:"jù zi",偿还:"cháng huán",疙瘩:"gē da",燕山:"yān shān",堵塞:"dǔ sè",夺冠:"duó guàn",扎实:"zhā shi",电荷:"diàn hè",看守:"kān shǒu",复辟:"fù bì",郁闷:"yù mèn",尽早:"jǐn zǎo",切断:"qiē duàn",指头:"zhǐ tou",为生:"wéi shēng",畜生:"chù sheng",切除:"qiē chú",着力:"zhuó lì",着想:"zhuó xiǎng",级差:"jí chā",投奔:"tóu bèn",棍子:"gùn zi",含糊:"hán hu",少妇:"shào fù",兴致:"xìng zhì",纳闷:"nà mèn",干流:"gàn liú",卷起:"juǎn qǐ",扇子:"shàn zi",更改:"gēng gǎi",笼络:"lǒng luò",喇叭:"lǎ ba",载荷:"zài hè",妥当:"tuǒ dàng",为难:"wéi nán",着陆:"zhuó lù",燕子:"yàn zi",干吗:"gàn má",白发:"bái fà",总得:"zǒng děi",夹击:"jiā jī",曝光:"bào guāng",曲调:"qǔ diào",相机:"xiàng jī",叫化:"jiào huà",角逐:"jué zhú",啊哟:"ā yō",载重:"zài zhòng",长辈:"zhǎng bèi",出差:"chū chāi",垛口:"duǒ kǒu",撇开:"piē kāi",厅长:"tīng zhǎng",组分:"zǔ fèn",误差:"wù chā",家当:"jiā dàng",传记:"zhuàn jì",个子:"gè zi",铺设:"pū shè",干事:"gàn shì",杆菌:"gǎn jūn",定量:"dìng liàng",运载:"yùn zài",会儿:"huì er",酋长:"qiú zhǎng",重返:"chóng fǎn",差额:"chā é",露面:"lòu miàn",钻研:"zuān yán",大城:"dài chéng",上当:"shàng dàng",销量:"xiāo liàng",作坊:"zuō fang",照相:"zhào xiàng",哎呀:"āi yā",调集:"diào jí",看中:"kàn zhòng",议长:"yì zhǎng",风筝:"fēng zheng",辟邪:"bì xié",空隙:"kòng xì",更迭:"gēng dié",偏差:"piān chā",声调:"shēng diào",适量:"shì liàng",屯子:"tún zi",无量:"wú liàng",空地:"kòng dì",调度:"diào dù",散射:"sǎn shè",创伤:"chuāng shāng",海参:"hǎi shēn",满载:"mǎn zài",重叠:"chóng dié",落差:"luò chā",单调:"dān diào",老将:"lǎo jiàng",人参:"rén shēn",间断:"jiàn duàn",重现:"chóng xiàn",夹杂:"jiā zá",调用:"diào yòng",萝卜:"luó bo",附着:"fù zhuó",应声:"yìng shēng",主将:"zhǔ jiàng",罪过:"zuì guo",咀嚼:"jǔ jué",为政:"wéi zhèng",过量:"guò liàng",乐曲:"yuè qǔ",负荷:"fù hè",枪弹:"qiāng dàn",悄然:"qiǎo rán",处方:"chǔ fāng",悄声:"qiǎo shēng",曲子:"qǔ zi",情调:"qíng diào",挑衅:"tiǎo xìn",代为:"dài wéi",了结:"liǎo jié",打中:"dǎ zhòng",酒吧:"jiǔ bā",懒得:"lǎn de",增量:"zēng liàng",衣着:"yī zhuó",部将:"bù jiàng",要塞:"yào sài",茶几:"chá jī",杠杆:"gàng gǎn",出没:"chū mò",鲜有:"xiǎn yǒu",间隙:"jiàn xì",重担:"zhòng dàn",重演:"chóng yǎn",重试:"chóng shì",应酬:"yìng chou",只当:"zhǐ dāng",毋宁:"wú nìng",包扎:"bāo zā",前头:"qián tou",卷烟:"juǎn yān",非得:"fēi děi",弹道:"dàn dào",杆子:"gān zi",门将:"mén jiàng",后头:"hòu tou",喝彩:"hè cǎi",暖和:"nuǎn huo",累积:"lěi jī",调遣:"diào qiǎn",倔强:"jué jiàng",宝藏:"bǎo zàng",丧事:"sāng shì",约莫:"yuē mo",纤夫:"qiàn fū",更替:"gēng tì",装载:"zhuāng zài",背包:"bēi bāo",帖子:"tiě zi",松散:"sōng sǎn",呼喝:"hū hè",可恶:"kě wù",自转:"zì zhuàn",供电:"gōng diàn",反省:"fǎn xǐng",坦率:"tǎn shuài",苏打:"sū dá",本分:"běn fèn",落得:"luò de",鄙薄:"bǐ bó",相间:"xiāng jiàn",单薄:"dān bó",混蛋:"hún dàn",贞观:"zhēn guān",附和:"fù hè",能耐:"néng nài",吓唬:"xià hu",未了:"wèi liǎo",引着:"yǐn zháo",抽调:"chōu diào",沙子:"shā zi",席卷:"xí juǎn",标的:"biāo dì",别扭:"biè niu",思量:"sī liang",喝采:"hè cǎi",论语:"lún yǔ",盖子:"gài zi",分外:"fèn wài",弄堂:"lòng táng",乐舞:"yuè wǔ",雨量:"yǔ liàng",毛发:"máo fà",差遣:"chāi qiǎn",背负:"bēi fù",转速:"zhuàn sù",声乐:"shēng yuè",夹攻:"jiā gōng",供水:"gōng shuǐ",主干:"zhǔ gàn",惩处:"chéng chǔ",长相:"zhǎng xiàng",公差:"gōng chāi",榴弹:"liú dàn",省得:"shěng de",条子:"tiáo zi",重围:"chóng wéi",阻塞:"zǔ sè",劲风:"jìng fēng",纠葛:"jiū gé",颠簸:"diān bǒ",点中:"diǎn zhòng",重创:"zhòng chuāng",姥姥:"lǎo lao",迷糊:"mí hu",公家:"gōng jia",几率:"jī lǜ",苦闷:"kǔ mèn",度量:"dù liàng",差错:"chā cuò",暑假:"shǔ jià",参差:"cēn cī",搭载:"dā zài",助长:"zhù zhǎng",相称:"xiāng chèn",红晕:"hóng yùn",舍命:"shě mìng",喜好:"xǐ hào",列传:"liè zhuàn",劲敌:"jìng dí",蛤蟆:"há ma",请假:"qǐng jià",钉子:"dīng zi",沉没:"chén mò",高丽:"gāo lí",休假:"xiū jià",无为:"wú wéi",巴结:"bā jie",了得:"liǎo dé",变相:"biàn xiàng",核弹:"hé dàn",亲家:"qìng jia",承载:"chéng zài",喝问:"hè wèn",还击:"huán jī",交还:"jiāo huán",将令:"jiàng lìng",单于:"chán yú",空缺:"kòng quē",绿林:"lù lín",胆量:"dǎn liàng",执着:"zhí zhuó",低调:"dī diào",闭塞:"bì sè",轻薄:"qīng bó",得当:"dé dàng",占卜:"zhān bǔ",扫帚:"sào zhou",龟兹:"qiū cí",年长:"nián zhǎng",外传:"wài zhuàn",头子:"tóu zi",裁缝:"cái feng",礼乐:"lǐ yuè",血泊:"xuè pō",散乱:"sǎn luàn",动量:"dòng liàng",倒腾:"dǎo teng",取舍:"qǔ shě",咱家:"zán jiā",长发:"cháng fà",爪哇:"zhǎo wā",弹壳:"dàn ké",省悟:"xǐng wù",嚷嚷:"rāng rang",连累:"lián lèi",应得:"yīng dé",族长:"zú zhǎng",柜子:"guì zi",擂鼓:"léi gǔ",眩晕:"xuàn yùn",调配:"tiáo pèi",躯干:"qū gàn",差役:"chāi yì",坎坷:"kǎn kě",少儿:"shào ér",乐团:"yuè tuán",养分:"yǎng fèn",退还:"tuì huán",格调:"gé diào",语调:"yǔ diào",音调:"yīn diào",乐府:"yuè fǔ",古朴:"gǔ pǔ",打点:"dǎ diǎn",差使:"chāi shǐ",匀称:"yún chèn",瘦削:"shòu xuē",膏药:"gāo yao",吞没:"tūn mò",调任:"diào rèn",散居:"sǎn jū",上头:"shàng tóu",风靡:"fēng mǐ",放假:"fàng jià",估量:"gū liang",失当:"shī dàng",中弹:"zhòng dàn",妄为:"wàng wéi",长者:"zhǎng zhě",起哄:"qǐ hòng",末了:"mò liǎo",相声:"xiàng sheng",校正:"jiào zhèng",劝降:"quàn xiáng",矢量:"shǐ liàng",沉闷:"chén mèn",给与:"jǐ yǔ",解法:"jiě fǎ",塞外:"sài wài",将校:"jiàng xiào",嗜好:"shì hào",没落:"mò luò",朴刀:"pō dāo",片子:"piān zi",切削:"qiē xiāo",弹丸:"dàn wán",稀薄:"xī bó",亏得:"kuī dé",间歇:"jiàn xiē",翘首:"qiáo shǒu",色调:"sè diào",处决:"chǔ jué",表率:"biǎo shuài",尺子:"chǐ zi",招降:"zhāo xiáng",称职:"chèn zhí",斗篷:"dǒu peng",铺子:"pù zi",底子:"dǐ zi",负载:"fù zài",干警:"gàn jǐng",倒数:"dào shǔ",将官:"jiàng guān",锄头:"chú tou",归降:"guī xiáng",疟疾:"nüè ji",唠叨:"láo dao",限量:"xiàn liàng",屏息:"bǐng xī",重逢:"chóng féng",器乐:"qì yuè",氢弹:"qīng dàn",脖颈:"bó gěng",妃子:"fēi zi",处事:"chǔ shì",参量:"cān liàng",轻率:"qīng shuài",缥缈:"piāo miǎo",中奖:"zhòng jiǎng",才干:"cái gàn",施舍:"shī shě",卷子:"juàn zi",游说:"yóu shuì",巷子:"xiàng zi",膀胱:"páng guāng",切勿:"qiè wù",看管:"kān guǎn",风头:"fēng tou",精干:"jīng gàn",高差:"gāo chā",恐吓:"kǒng hè",扁担:"biǎn dàn",给养:"jǐ yǎng",格子:"gé zi",供需:"gōng xū",反差:"fǎn chā",飞弹:"fēi dàn",微薄:"wēi bó",发型:"fà xíng",即兴:"jí xìng",攒动:"cuán dòng",间或:"jiàn huò",浅薄:"qiǎn bó",乐章:"yuè zhāng",顺差:"shùn chā",调子:"diào zi",相位:"xiàng wèi",转子:"zhuàn zǐ",劲旅:"jìng lǚ",咔嚓:"kā chā",了事:"liǎo shì",转悠:"zhuàn you",当铺:"dàng pù",爪子:"zhuǎ zi",单子:"dān zi",好战:"hào zhàn",燕麦:"yàn mài",只许:"zhǐ xǔ",干练:"gàn liàn",女将:"nǚ jiàng",酒量:"jiǔ liàng",划船:"huá chuán",伎俩:"jì liǎng",挑拨:"tiǎo bō",少校:"shào xiào",着落:"zhuó luò",憎恶:"zēng wù",刻薄:"kè bó",要挟:"yāo xié",用处:"yòng chu",还手:"huán shǒu",模具:"mú jù",执著:"zhí zhuó",喝令:"hè lìng",保长:"bǎo zhǎng",吸着:"xī zhe",症结:"zhēng jié",公转:"gōng zhuàn",校勘:"jiào kān",重提:"chóng tí",扫兴:"sǎo xìng",铺盖:"pū gài",长史:"zhǎng shǐ",差价:"chā jià",压根:"yà gēn",怔住:"zhèng zhù",应允:"yīng yǔn",切入:"qiē rù",战将:"zhàn jiàng",年少:"nián shào",舍身:"shě shēn",执拗:"zhí niù",处世:"chǔ shì",中风:"zhòng fēng",等量:"děng liàng",放量:"fàng liàng",腔调:"qiāng diào",老少:"lǎo shào",没入:"mò rù",瓜葛:"guā gé",将帅:"jiàng shuài",车载:"chē zài",窝囊:"wō nang",长进:"zhǎng jìn",可汗:"kè hán",并州:"bīng zhōu",供销:"gōng xiāo",切片:"qiē piàn",差事:"chāi shì",知会:"zhī hui",鹰爪:"yīng zhǎo",处女:"chǔ nǚ",切磋:"qiē cuō",日头:"rì tou",押解:"yā jiè",滋长:"zī zhǎng",道观:"dào guàn",脚色:"jué sè",当量:"dāng liàng",婆家:"pó jia",缘分:"yuán fèn",空闲:"kòng xián",好色:"hào sè",怒喝:"nù hè",笼统:"lǒng tǒng",边塞:"biān sài",何曾:"hé céng",重合:"chóng hé",零散:"líng sǎn",轰隆:"hōng lōng",化子:"huà zi",内蒙:"nèi měng",数落:"shǔ luò",逆差:"nì chā",牟利:"móu lì",栅栏:"zhà lan",中标:"zhòng biāo",调档:"diào dàng",佝偻:"gōu lóu",场子:"chǎng zi",甲壳:"jiǎ qiào",重温:"chóng wēn",炮制:"páo zhì",返还:"fǎn huán",自传:"zì zhuàn",高调:"gāo diào",殷红:"yān hóng",固着:"gù zhuó",强求:"qiǎng qiú",本相:"běn xiàng",骄横:"jiāo hèng",草率:"cǎo shuài",气闷:"qì mèn",着色:"zhuó sè",宁肯:"nìng kěn",兴头:"xìng tou",拘泥:"jū nì",夹角:"jiā jiǎo",发髻:"fà jì",猛将:"měng jiàng",约摸:"yuē mo",拖累:"tuō lěi",呢绒:"ní róng",钻探:"zuān tàn",夹层:"jiā céng",落魄:"luò pò",巷道:"hàng dào",运量:"yùn liàng",解闷:"jiě mèn",空儿:"kòng er",估摸:"gū mo",好客:"hào kè",钻孔:"zuān kǒng",糊弄:"hù nòng",荥阳:"xíng yáng",烦闷:"fán mèn",仓卒:"cāng cù",分叉:"fēn chà",厂子:"chǎng zi",小调:"xiǎo diào",少阳:"shào yáng",受降:"shòu xiáng",染坊:"rǎn fáng",胳臂:"gē bei",将门:"jiàng mén",模板:"mú bǎn",配给:"pèi jǐ",为伍:"wéi wǔ",跟头:"gēn tou",划算:"huá suàn",累赘:"léi zhui",哄笑:"hōng xiào",晕眩:"yūn xuàn",干掉:"gàn diào",缝制:"féng zhì",难处:"nán chù",着意:"zhuó yì",蛮横:"mán hèng",奇数:"jī shù",短发:"duǎn fà",生还:"shēng huán",还清:"huán qīng",看护:"kān hù",直率:"zhí shuài",奏乐:"zòu yuè",载客:"zài kè",专横:"zhuān hèng",湮没:"yān mò",空格:"kòng gé",铺垫:"pū diàn",良将:"liáng jiàng",哗啦:"huā lā",散漫:"sǎn màn",脱发:"tuō fà",送还:"sòng huán",埋没:"mái mò",累及:"lěi jí",薄雾:"bó wù",调离:"diào lí",舌苔:"shé tāi",机长:"jī zhǎng",栓塞:"shuān sè",配角:"pèi jué",切口:"qiē kǒu",创口:"chuāng kǒu",哈欠:"hā qian",实弹:"shí dàn",铺平:"pū píng",哈达:"hǎ dá",懒散:"lǎn sǎn",实干:"shí gàn",填空:"tián kòng",刁钻:"diāo zuān",乐师:"yuè shī",量变:"liàng biàn",诱降:"yòu xiáng",搪塞:"táng sè",征调:"zhēng diào",夹道:"jiā dào",干咳:"gān ké",止咳:"zhǐ ké",乐工:"yuè gōng",划过:"huá guò",着火:"zháo huǒ",更正:"gēng zhèng",给付:"jǐ fù",空子:"kòng zi",哪吒:"né zhā",正着:"zhèng zháo",刷子:"shuā zi",丧葬:"sāng zàng",夹带:"jiā dài",安分:"ān fèn",中意:"zhòng yì",长孙:"zhǎng sūn",校订:"jiào dìng",卷曲:"juǎn qū",载运:"zài yùn",投弹:"tóu dàn",柞蚕:"zuò cán",份量:"fèn liàng",调换:"diào huàn",了然:"liǎo rán",咧嘴:"liě zuǐ",典当:"diǎn dàng",寒假:"hán jià",长兄:"zhǎng xiōng",给水:"jǐ shuǐ",须发:"xū fà",枝干:"zhī gàn",属相:"shǔ xiàng",哄抢:"hōng qiǎng",刻划:"kè huà",塞子:"sāi zi",单干:"dān gàn",还乡:"huán xiāng",兆头:"zhào tou",寺观:"sì guàn",督率:"dū shuài",啊哈:"ā ha",割舍:"gē shě",抹布:"mā bù",好恶:"hào wù",下处:"xià chǔ",消长:"xiāo zhǎng",离间:"lí jiàn",准头:"zhǔn tou",校对:"jiào duì",什物:"shí wù",番禺:"pān yú",佛爷:"fó ye",吗啡:"mǎ fēi",盐分:"yán fèn",虎将:"hǔ jiàng",薄荷:"bò he",独处:"dú chǔ",空位:"kòng wèi",铺路:"pū lù",乌拉:"wū lā",调回:"diào huí",来头:"lái tou",闲散:"xián sǎn",胶卷:"jiāo juǎn",冒失:"mào shi",干劲:"gàn jìn",弦乐:"xián yuè",相国:"xiàng guó",丹参:"dān shēn",助兴:"zhù xìng",铺开:"pū kāi",次长:"cì zhǎng",发卡:"fà qiǎ",拮据:"jié jū",刹车:"shā chē",生发:"shēng fà",重播:"chóng bō",缝合:"féng hé",音量:"yīn liàng",少尉:"shào wèi",冲压:"chòng yā",苍劲:"cāng jìng",厚薄:"hòu báo",威吓:"wēi hè",外相:"wài xiàng",呼号:"hū háo",着迷:"zháo mí",挑担:"tiāo dàn",纹路:"wén lù",还俗:"huán sú",强横:"qiáng hèng",着数:"zhāo shù",降顺:"xiáng shùn",挑明:"tiǎo míng",眯缝:"mī feng",分内:"fèn nèi",更衣:"gēng yī",软和:"ruǎn huo",尽兴:"jìn xìng",号子:"hào zi",爪牙:"zhǎo yá",败将:"bài jiàng",猜中:"cāi zhòng",结扎:"jié zā",没空:"méi kòng",夹缝:"jiā fèng",拾掇:"shí duo",掺和:"chān huo",簸箕:"bò ji",电量:"diàn liàng",荷载:"hè zǎi",调式:"diào shì",处身:"chǔ shēn",打手:"dǎ shǒu",弹弓:"dàn gōng",横蛮:"hèng mán",能干:"néng gàn",校点:"jiào diǎn",加载:"jiā zài",干校:"gàn xiào",哄传:"hōng chuán",校注:"jiào zhù",淤塞:"yū sè",马扎:"mǎ zhá",月氏:"yuè zhī",高干:"gāo gàn",经传:"jīng zhuàn",曾孙:"zēng sūn",好斗:"hào dòu",关卡:"guān qiǎ",逃奔:"táo bèn",磨蹭:"mó ceng",牟取:"móu qǔ",颤栗:"zhàn lì",蚂蚱:"mà zha",撮合:"cuō he",趔趄:"liè qie",摔打:"shuāi dǎ",台子:"tái zi",分得:"fēn de",粘着:"nián zhuó",采邑:"cài yì",散装:"sǎn zhuāng",婀娜:"ē nuó",兴味:"xìng wèi",行头:"xíng tou",气量:"qì liàng",调运:"diào yùn",处治:"chǔ zhì",乐音:"yuè yīn",充塞:"chōng sè",恫吓:"dòng hè",论调:"lùn diào",相中:"xiāng zhòng",民乐:"mín yuè",炮仗:"pào zhang",丧服:"sāng fú",骁将:"xiāo jiàng",量刑:"liàng xíng",缝补:"féng bǔ",财会:"cái kuài",大干:"dà gàn",历数:"lì shǔ",校场:"jiào chǎng",塞北:"sài běi",识相:"shí xiàng",辱没:"rǔ mò",鲜亮:"xiān liàng",语塞:"yǔ sè",露脸:"lòu liǎn",凉快:"liáng kuai",腰杆:"yāo gǎn",溜达:"liū da",嘎嘎:"gā gā",公干:"gōng gàn",桔梗:"jié gěng",挑逗:"tiǎo dòu",看门:"kān mén",乐歌:"yuè gē",拓片:"tà piàn",挑动:"tiǎo dòng",准将:"zhǔn jiàng",遒劲:"qiú jìng",磨坊:"mò fáng",逶迤:"wēi yí",搅和:"jiǎo huo",摩挲:"mó suō",作弄:"zuò nòng",苗头:"miáo tou",打颤:"dǎ zhàn",大藏:"dà zàng",畜牲:"chù shēng",勾搭:"gōu da",树荫:"shù yīn",树杈:"shù chà",铁杆:"tiě gǎn",将相:"jiàng xiàng",份子:"fèn zi",视差:"shì chā",绿荫:"lǜ yīn",枪杆:"qiāng gǎn",缝纫:"féng rèn",愁闷:"chóu mèn",点将:"diǎn jiàng",华佗:"huà tuó",劲射:"jìng shè",箱笼:"xiāng lǒng",终了:"zhōng liǎo",鬓发:"bìn fà",结巴:"jiē ba",苦干:"kǔ gàn",看家:"kān jiā",正旦:"zhēng dàn",中肯:"zhòng kěn",厦门:"xià mén",东莞:"dōng guǎn",食量:"shí liàng",宫调:"gōng diào",间作:"jiàn zuò",弹片:"dàn piàn",差池:"chā chí",漂白:"piǎo bái",杠子:"gàng zi",调处:"tiáo chǔ",好动:"hào dòng",转炉:"zhuàn lú",屏气:"bǐng qì",夹板:"jiā bǎn",哀乐:"āi yuè",干道:"gàn dào",苦处:"kǔ chù",劈柴:"pǐ chái",长势:"zhǎng shì",天华:"tiān huá",共处:"gòng chǔ",校验:"jiào yàn",出塞:"chū sài",磨盘:"mò pán",萎靡:"wěi mǐ",奔丧:"bēn sāng",唱和:"chàng hè",大调:"dà diào",非分:"fēi fèn",钻营:"zuān yíng",夹子:"jiā zi",超载:"chāo zài",更始:"gēng shǐ",铃铛:"líng dang",披散:"pī sàn",发还:"fā huán",转轮:"zhuàn lún",横财:"hèng cái",泡桐:"pāo tóng",抛撒:"pāo sǎ",天呀:"tiān yā",糊糊:"hū hu",躯壳:"qū qiào",通量:"tōng liàng",奉还:"fèng huán",午觉:"wǔ jiào",闷棍:"mèn gùn",浪头:"làng tou",砚台:"yàn tái",油坊:"yóu fáng",学长:"xué zhǎng",过载:"guò zài",笔调:"bǐ diào",衣被:"yī bèi",畜产:"xù chǎn",调阅:"diào yuè",蛮干:"mán gàn",曾祖:"zēng zǔ",提干:"tí gàn",变调:"biàn diào",覆没:"fù mò",模子:"mú zi",乐律:"yuè lǜ",称心:"chèn xīn",木杆:"mù gān",重印:"chóng yìn",自省:"zì xǐng",提调:"tí diào",看相:"kàn xiàng",芋头:"yù tou",下切:"xià qiē",塞上:"sài shàng",铺张:"pū zhāng",藤蔓:"téng wàn",薄幸:"bó xìng",解数:"xiè shù",褪去:"tuì qù",霰弹:"xiàn dàn",柚木:"yóu mù",痕量:"hén liàng",雅乐:"yǎ yuè",号哭:"háo kū",诈降:"zhà xiáng",猪圈:"zhū juàn",咋舌:"zé shé",铣床:"xǐ chuáng",防弹:"fáng dàn",健将:"jiàn jiàng",丽水:"lí shuǐ",削发:"xuē fà",空当:"kòng dāng",多相:"duō xiàng",鲜见:"xiǎn jiàn",划桨:"huá jiǎng",载波:"zài bō",跳蚤:"tiào zao",俏皮:"qiào pí",吧嗒:"bā dā",结发:"jié fà",了断:"liǎo duàn",同调:"tóng diào",石磨:"shí mò",时差:"shí chā",鼻塞:"bí sè",挑子:"tiāo zi",推磨:"tuī mò",武侯:"wǔ hóu",抹煞:"mǒ shā",调转:"diào zhuǎn",籍没:"jí mò",还债:"huán zhài",调演:"diào yǎn",分划:"fēn huá",奇偶:"jī ǒu",断喝:"duàn hè",闷雷:"mèn léi",狼藉:"láng jí",饭量:"fàn liàng",还礼:"huán lǐ",转调:"zhuǎn diào",星相:"xīng xiàng",手相:"shǒu xiàng",配乐:"pèi yuè",盖头:"gài tou",连杆:"lián gǎn",簿记:"bù jì",刀把:"dāo bà",量词:"liàng cí",名角:"míng jué",步调:"bù diào",校本:"jiào běn",账簿:"zhàng bù",隽永:"juàn yǒng",稍为:"shāo wéi",易传:"yì zhuàn",乐谱:"yuè pǔ",牵累:"qiān lěi",答理:"dā li",喝斥:"hè chì",吟哦:"yín é",干渠:"gàn qú",海量:"hǎi liàng",精当:"jīng dàng",着床:"zhuó chuáng",月相:"yuè xiàng",庶几:"shù jī",宫观:"gōng guàn",论处:"lùn chǔ",征辟:"zhēng bì",厚朴:"hòu pò",介壳:"jiè qiào",吭哧:"kēng chī",咯血:"kǎ xiě",铺陈:"pū chén",重生:"chóng shēng",乐理:"yuè lǐ",哀号:"āi háo",藏历:"zàng lì",刚劲:"gāng jìng",削平:"xuē píng",浓荫:"nóng yīn",城垛:"chéng duǒ",当差:"dāng chāi",正传:"zhèng zhuàn",并处:"bìng chǔ",创面:"chuāng miàn",旦角:"dàn jué",薄礼:"bó lǐ",晃荡:"huàng dang",臊子:"sào zi",家什:"jiā shí",闷头:"mēn tóu",美发:"měi fà",度数:"dù shu",着凉:"zháo liáng",闯将:"chuǎng jiàng",几案:"jī àn",姘头:"pīn tou",差数:"chā shù",散碎:"sǎn suì",壅塞:"yōng sè",寒颤:"hán zhàn",牵强:"qiān qiǎng",无间:"wú jiàn",轮转:"lún zhuàn",号叫:"háo jiào",铺排:"pū pái",降伏:"xiáng fú",轧钢:"zhá gāng",东阿:"dōng ē",病假:"bìng jià",累加:"lěi jiā",梗塞:"gěng sè",弹夹:"dàn jiā",钻心:"zuān xīn",晃眼:"huǎng yǎn",魔爪:"mó zhǎo",标量:"biāo liàng",憋闷:"biē mèn",猜度:"cāi duó",处士:"chǔ shì",官差:"guān chāi",讨还:"tǎo huán",长门:"cháng mén",馏分:"liú fēn",里弄:"lǐ lòng",色相:"sè xiàng",雅兴:"yǎ xìng",角力:"jué lì",弹坑:"dàn kēng",枝杈:"zhī chà",夹具:"jiā jù",处刑:"chǔ xíng",悍将:"hàn jiàng",好学:"hào xué",好好:"hǎo hǎo",银发:"yín fà",扫把:"sào bǎ",法相:"fǎ xiàng",贵干:"guì gàn",供气:"gōng qì",空余:"kòng yú",捆扎:"kǔn zā",瘠薄:"jí bó",浆糊:"jiàng hu",嘎吱:"gā zhī",调令:"diào lìng",法帖:"fǎ tiè",淋病:"lìn bìng",调派:"diào pài",转盘:"zhuàn pán",供稿:"gōng gǎo",差官:"chāi guān",忧闷:"yōu mèn",教长:"jiào zhǎng",重唱:"chóng chàng",酒兴:"jiǔ xìng",乐坛:"yuè tán",花呢:"huā ní",叱喝:"chì hè",膀臂:"bǎng bì",得空:"dé kòng",转圈:"zhuàn quān",横暴:"hèng bào",哄抬:"hōng tái",引吭:"yǐn háng",载货:"zài huò",中计:"zhòng jì",官长:"guān zhǎng",相面:"xiàng miàn",看头:"kàn tou",盼头:"pàn tou",意兴:"yì xìng",军乐:"jūn yuè",累次:"lěi cì",骨嘟:"gǔ dū",燕赵:"yān zhào",报丧:"bào sāng",弥撒:"mí sa",挨斗:"ái dòu",扁舟:"piān zhōu",丑角:"chǒu jué",吊丧:"diào sāng",强将:"qiáng jiàng",重奏:"chóng zòu",发辫:"fà biàn",着魔:"zháo mó",着法:"zhāo fǎ",盛放:"shèng fàng",填塞:"tián sè",凶横:"xiōng hèng",稽首:"qǐ shǒu",碑帖:"bēi tiè",冲量:"chōng liàng",发菜:"fà cài",假发:"jiǎ fà",翻卷:"fān juǎn",小量:"xiǎo liàng",胶着:"jiāo zhuó",里子:"lǐ zi",调调:"diào diao",散兵:"sǎn bīng",高挑:"gāo tiǎo",播撒:"bō sǎ",夹心:"jiā xīn",扇动:"shān dòng",叨扰:"tāo rǎo",霓裳:"ní cháng",捻子:"niǎn zi",弥缝:"mí féng",撒布:"sǎ bù",场院:"cháng yuàn",省亲:"xǐng qīn",提拉:"tí lā",惯量:"guàn liàng",强逼:"qiáng bī",强征:"qiáng zhēng",晕车:"yùn chē",数道:"shù dào",带累:"dài lèi",拓本:"tà běn",嫌恶:"xián wù",宿将:"sù jiàng",龟裂:"jūn liè",缠夹:"chán jiā",发式:"fà shì",隔扇:"gé shàn",天分:"tiān fèn",癖好:"pǐ hào",四通:"sì tōng",白术:"bái zhú",划伤:"huá shāng",角斗:"jué dòu",听差:"tīng chāi",岁差:"suì chā",丧礼:"sāng lǐ",脉脉:"mò mò",削瘦:"xuē shòu",撒播:"sǎ bō",莎草:"suō cǎo",犍为:"qián wéi",调头:"diào tóu",龙卷:"lóng juǎn",外调:"wài diào",字帖:"zì tiè",卷发:"juǎn fà",揣度:"chuǎi duó",洋相:"yáng xiàng",散光:"sǎn guāng",骨碌:"gū lu",薄命:"bó mìng",笼头:"lóng tóu",咽炎:"yān yán",碌碡:"liù zhou",片儿:"piàn er",纤手:"qiàn shǒu",散体:"sǎn tǐ",内省:"nèi xǐng",强留:"qiáng liú",解送:"jiè sòng",反间:"fǎn jiàn",少壮:"shào zhuàng",留空:"liú kōng",告假:"gào jià",咳血:"ké xuè",薄暮:"bó mù",铺轨:"pū guǐ",磨削:"mó xuē",治丧:"zhì sāng",叉子:"chā zi",哄动:"hōng dòng",蛾子:"é zi",出落:"chū luò",股长:"gǔ zhǎng",贵处:"guì chù",还魂:"huán hún",例假:"lì jià",刹住:"shā zhù",身量:"shēn liàng",同好:"tóng hào",模量:"mó liàng",更生:"gēng shēng",服丧:"fú sāng",率直:"shuài zhí",字模:"zì mú",散架:"sǎn jià",答腔:"dā qiāng",交恶:"jiāo wù",薄情:"bó qíng",眼泡:"yǎn pāo",袅娜:"niǎo nuó",草垛:"cǎo duò",冲劲:"chòng jìn",呢喃:"ní nán",切中:"qiè zhòng",挑灯:"tiǎo dēng",还愿:"huán yuàn",激将:"jī jiàng",更鼓:"gēng gǔ",没药:"mò yào",败兴:"bài xìng",切面:"qiē miàn",散户:"sǎn hù",累进:"lěi jìn",背带:"bēi dài",秤杆:"chèng gǎn",碾坊:"niǎn fáng",簿子:"bù zi",扳手:"bān shǒu",铅山:"yán shān",儒将:"rú jiàng",重光:"chóng guāng",剪发:"jiǎn fà",长上:"zhǎng shàng",小传:"xiǎo zhuàn",压轴:"yā zhòu",弱冠:"ruò guàn",花卷:"huā juǎn",横祸:"hèng huò",夹克:"jiā kè",光晕:"guāng yùn",披靡:"pī mǐ",对调:"duì diào",夹持:"jiā chí",空额:"kòng é",平调:"píng diào",铺床:"pū chuáng",丧钟:"sāng zhōng",作乐:"zuò lè",少府:"shào fǔ",数数:"shuò shuò",奔头:"bèn tou",进给:"jìn jǐ",率性:"shuài xìng",乐子:"lè zi",绑扎:"bǎng zā",挑唆:"tiǎo suō",漂洗:"piǎo xǐ",夹墙:"jiā qiáng",咳喘:"ké chuǎn",乜斜:"miē xie",错处:"cuò chù",闷酒:"mèn jiǔ",时调:"shí diào",重孙:"chóng sūn",经幢:"jīng chuáng",圩场:"xū chǎng",调门:"diào mén",花头:"huā tóu",划拉:"huá la",套色:"tào shǎi",粗率:"cū shuài",相率:"xiāng shuài",款识:"kuǎn zhì",吁请:"yù qǐng",荫蔽:"yīn bì",文蛤:"wén gé",嘀嗒:"dī dā",调取:"diào qǔ",交差:"jiāo chāi",落子:"luò zǐ",相册:"xiàng cè",絮叨:"xù dao",落发:"luò fà",异相:"yì xiàng",浸没:"jìn mò",角抵:"jué dǐ",卸载:"xiè zài",春卷:"chūn juǎn",扎挣:"zhá zheng",畜养:"xù yǎng",吡咯:"bǐ luò",垛子:"duò zi",恶少:"è shào",发际:"fà jì",红苕:"hóng sháo",糨糊:"jiàng hu",哭丧:"kū sāng",稍息:"shào xī",晕船:"yùn chuán",校样:"jiào yàng",外差:"wài chā",脚爪:"jiǎo zhǎo",铺展:"pū zhǎn",芫荽:"yán sui",夹紧:"jiā jǐn",尿泡:"suī pào",丧乱:"sāng luàn",凶相:"xiōng xiàng",华发:"huá fà",打场:"dǎ cháng",云量:"yún liàng",正切:"zhèng qiē",划拳:"huá quán",划艇:"huá tǐng",评传:"píng zhuàn",拉纤:"lā qiàn",句读:"jù dòu",散剂:"sǎn jì",骨殖:"gǔ shi",塞音:"sè yīn",铺叙:"pū xù",阏氏:"yān zhī",冷颤:"lěng zhàn",煞住:"shā zhù",少男:"shào nán",管乐:"guǎn yuè",号啕:"háo táo",纳降:"nà xiáng",拥塞:"yōng sè",万乘:"wàn shèng",杆儿:"gǎn ér",葛藤:"gé téng",簿籍:"bù jí",皮夹:"pí jiā",校准:"jiào zhǔn",允当:"yǔn dàng",器量:"qì liàng",选调:"xuǎn diào",扮相:"bàn xiàng",干才:"gàn cái",基干:"jī gàn",割切:"gē qiē",国乐:"guó yuè",卡壳:"qiǎ ké",辟谷:"bì gǔ",磨房:"mò fáng",咿呀:"yī yā",芥末:"jiè mo",薄技:"bó jì",产假:"chǎn jià",诗兴:"shī xìng",重出:"chóng chū",转椅:"zhuàn yǐ",酌量:"zhuó liang",簿册:"bù cè",藏青:"zàng qīng",的士:"dī shì",调人:"diào rén",解元:"jiè yuán",茎干:"jīng gàn",巨量:"jù liàng",榔头:"láng tou",率真:"shuài zhēn",喷香:"pèn xiāng",锁钥:"suǒ yuè",虾蟆:"há má",相图:"xiàng tú",兴会:"xìng huì",灶头:"zào tóu",重婚:"chóng hūn",钻洞:"zuān dòng",忖度:"cǔn duó",党参:"dǎng shēn",调温:"diào wēn",杆塔:"gān tǎ",葛布:"gé bù",拱券:"gǒng xuàn",夹生:"jiā shēng",露馅:"lòu xiàn",恰切:"qià qiè",散见:"sǎn jiàn",哨卡:"shào qiǎ",烫发:"tàng fà",体量:"tǐ liàng",挺括:"tǐng kuò",系带:"jì dài",相士:"xiàng shì",羊圈:"yáng juàn",转矩:"zhuàn jǔ",吧台:"bā tái",苍术:"cāng zhú",菲薄:"fěi bó",蛤蚧:"gé jiè",蛤蜊:"gé lí",瓜蔓:"guā wàn",怪相:"guài xiàng",临帖:"lín tiè",女红:"nǚ gōng",刨床:"bào chuáng",翘楚:"qiáo chǔ",数九:"shǔ jiǔ",谈兴:"tán xìng",雄劲:"xióng jìng",扎染:"zā rǎn",遮荫:"zhē yīn",周正:"zhōu zhèng",赚头:"zhuàn tou",扒手:"pá shǒu",搀和:"chān huo",诚朴:"chéng pǔ",肚量:"dù liàng",干结:"gān jié",工尺:"gōng chě",家累:"jiā lěi",曲水:"qū shuǐ",沙参:"shā shēn",挑花:"tiǎo huā",阿门:"ā mén",背篓:"bēi lǒu",瘪三:"biē sān",裁处:"cái chǔ",创痛:"chuāng tòng",福相:"fú xiàng",更动:"gēng dòng",豪兴:"háo xìng",还阳:"huán yáng",还嘴:"huán zuǐ",借调:"jiè diào",卷云:"juǎn yún",流弹:"liú dàn",想头:"xiǎng tou",削价:"xuē jià",校阅:"jiào yuè",雅量:"yǎ liàng",别传:"bié zhuàn",薄酒:"bó jiǔ",春假:"chūn jià",发妻:"fà qī",哗哗:"huā huā",宽绰:"kuān chuo",了悟:"liǎo wù",切花:"qiē huā",审度:"shěn duó",应许:"yīng xǔ",转台:"zhuàn tái",仔猪:"zǐ zhū",裁量:"cái liáng",藏戏:"zàng xì",乘兴:"chéng xìng",绸缪:"chóu móu",摧折:"cuī zhé",调经:"tiáo jīng",调职:"diào zhí",缝缀:"féng zhuì",骨朵:"gū duǒ",核儿:"hú er",恒量:"héng liàng",还价:"huán jià",浑朴:"hún pǔ",苦差:"kǔ chāi",面糊:"miàn hù",煞车:"shā chē",省视:"xǐng shì",什锦:"shí jǐn",信差:"xìn chāi",余切:"yú qiē",攒眉:"cuán méi",炸糕:"zhá gāo",钻杆:"zuàn gǎn",扒灰:"pá huī",拌和:"bàn huò",长调:"cháng diào",大溜:"dà liù",抖搂:"dǒu lōu",飞转:"fēi zhuàn",干仗:"gàn zhàng",好胜:"hào shèng",画片:"huà piàn",搅混:"jiǎo hún",螺杆:"luó gǎn",木模:"mù mú",怒号:"nù háo",频数:"pín shù",无宁:"wú níng",遗少:"yí shào",邮差:"yóu chāi",占卦:"zhān guà",占星:"zhān xīng",重审:"chóng shěn",自量:"zì liàng",调防:"diào fáng",发廊:"fà láng",反调:"fǎn diào",缝子:"fèng zi",更夫:"gēng fū",骨子:"gǔ zi",光杆:"guāng gǎn",夹棍:"jiā gùn",居丧:"jū sāng",巨贾:"jù gǔ",看押:"kān yā",空转:"kōng zhuàn",量力:"liàng lì",炮烙:"páo luò",赔还:"péi huán",扑扇:"pū shān",散记:"sǎn jì",散件:"sǎn jiàn",删削:"shān xuē",射干:"shè gàn",条几:"tiáo jī",偷空:"tōu kòng",削壁:"xuē bì",校核:"jiào hé",阴干:"yīn gān",择菜:"zhái cài",重九:"chóng jiǔ",主调:"zhǔ diào",自禁:"zì jīn",吧唧:"bā jī",便溺:"biàn niào",词调:"cí diào",叨咕:"dáo gu",落枕:"lào zhěn",铺砌:"pū qì",刷白:"shuà bái",委靡:"wěi mǐ",系泊:"xì bó",相马:"xiàng mǎ",熨帖:"yù tiē",转筋:"zhuàn jīn",棒喝:"bàng hè",傧相:"bīn xiàng",镐头:"gǎo tóu",间苗:"jiàn miáo",乐池:"yuè chí",卖相:"mài xiàng",屏弃:"bǐng qì",铅弹:"qiān dàn",切变:"qiē biàn",请调:"qǐng diào",群氓:"qún méng",散板:"sǎn bǎn",省察:"xǐng chá",事假:"shì jià",纤绳:"qiàn shéng",重影:"chóng yǐng",耕种:"gēng zhòng",种地:"zhòng dì",种菜:"zhòng cài",栽种:"zāi zhòng",接种:"jiē zhòng",垦种:"kěn zhòng",种殖:"zhòng zhí",种瓜:"zhòng guā",种豆:"zhòng dòu",种树:"zhòng shù",睡着:"shuì zháo",笼子:"lóng zi",重启:"chóng qǐ",重整:"chóng zhěng",重弹:"chóng tán",重足:"chóng zú",重山:"chóng shān",重游:"chóng yóu",重峦:"chóng luán",爷爷:"yé ye",奶奶:"nǎi nai",姥爷:"lǎo ye",爸爸:"bà ba",妈妈:"mā ma",婶婶:"shěn shen",舅舅:"jiù jiu",姑姑:"gū gu",叔叔:"shū shu",姨夫:"yí fu",舅母:"jiù mu",姑父:"gū fu",姐夫:"jiě fu",婆婆:"pó po",公公:"gōng gong",舅子:"jiù zi",姐姐:"jiě jie",哥哥:"gē ge",妹妹:"mèi mei",妹夫:"mèi fu",姨子:"yí zi",宝宝:"bǎo bao",娃娃:"wá wa",孩子:"hái zi",日子:"rì zi",样子:"yàng zi",狮子:"shī zi",身子:"shēn zi",架子:"jià zi",嫂子:"sǎo zi",鼻子:"bí zi",亭子:"tíng zi",折子:"zhé zi",面子:"miàn zi",脖子:"bó zi",辈子:"bèi zi",帽子:"mào zi",拍子:"pāi zi",柱子:"zhù zi",辫子:"biàn zi",鸽子:"gē zi",房子:"fáng zi",丸子:"wán zi",摊子:"tān zi",牌子:"pái zi",胡子:"hú zi",鬼子:"guǐ zi",矮子:"ǎi zi",鸭子:"yā zi",小子:"xiǎo zi",影子:"yǐng zi",屋子:"wū zi",对子:"duì zi",点子:"diǎn zi",本子:"běn zi",种子:"zhǒng zi",儿子:"ér zi",兔子:"tù zi",骗子:"piàn zi",院子:"yuàn zi",猴子:"hóu zi",嗓子:"sǎng zi",侄子:"zhí zi",柿子:"shì zi",钳子:"qián zi",虱子:"shī zi",瓶子:"píng zi",豹子:"bào zi",筷子:"kuài zi",篮子:"lán zi",绳子:"shéng zi",嘴巴:"zuǐ ba",耳朵:"ěr duo",茄子:"qié zi",蚌埠:"bèng bù",崆峒:"kōng tóng",琵琶:"pí pa",蘑菇:"mó gu",葫芦:"hú lu",狐狸:"hú li",桔子:"jú zi",盒子:"hé zi",桌子:"zhuō zi",竹子:"zhú zi",师傅:"shī fu",衣服:"yī fu",袜子:"wà zi",杯子:"bēi zi",刺猬:"cì wei",麦子:"mài zi",队伍:"duì wu",知了:"zhī liǎo",鱼儿:"yú er",馄饨:"hún tun",灯笼:"dēng long",庄稼:"zhuāng jia",聪明:"cōng ming",镜子:"jìng zi",银子:"yín zi",盘子:"pán zi",了却:"liǎo què",力气:"lì qi",席子:"xí zi",林子:"lín zi",朝霞:"zhāo xiá",朝夕:"zhāo xī",朝气:"zhāo qì",翅膀:"chì bǎng",省长:"shěng zhǎng",臧否:"zāng pǐ",否泰:"pǐ tài",变得:"biàn de",丈夫:"zhàng fu",豆腐:"dòu fu",笔杆:"bǐ gǎn",枞阳:"zōng yáng",行人:"xíng rén",打着:"dǎ zhe",第一:"dì yī",万一:"wàn yī",之一:"zhī yī",得之:"dé zhī",统一:"tǒng yī",唯一:"wéi yī",专一:"zhuān yī",单一:"dān yī",如一:"rú yī",其一:"qí yī",合一:"hé yī",逐一:"zhú yī",周一:"zhōu yī",初一:"chū yī",研一:"yán yī",归一:"guī yī",假一:"jiǎ yī",闻一:"wén yī",了了:"liǎo liǎo",公了:"gōng liǎo",私了:"sī liǎo",一月:"yī yuè",一号:"yī hào",一级:"yī jí",一等:"yī děng",一哥:"yī gē",月一:"yuè yī",一一:"yī yī",二一:"èr yī",三一:"sān yī",四一:"sì yī",五一:"wǔ yī",六一:"liù yī",七一:"qī yī",八一:"bā yī",九一:"jiǔ yī","一〇":"yī líng",一零:"yī líng",一二:"yī èr",一三:"yī sān",一四:"yī sì",一五:"yī wǔ",一六:"yī liù",一七:"yī qī",一八:"yī bā",一九:"yī jiǔ",一又:"yī yòu",一饼:"yī bǐng",一楼:"yī lóu",为例:"wéi lì",为准:"wéi zhǔn",沧海:"cāng hǎi",难为:"nán wéi",责难:"zé nàn",患难:"huàn nàn",磨难:"mó nàn",大难:"dà nàn",刁难:"diāo nàn",殉难:"xùn nàn",落难:"luò nàn",罹难:"lí nàn",灾难:"zāi nàn",难民:"nàn mín",苦难:"kǔ nàn",危难:"wēi nàn",发难:"fā nàn",逃难:"táo nàn",避难:"bì nàn",遇难:"yù nàn",阻难:"zǔ nàn",厄难:"è nàn",徇难:"xùn nàn",空难:"kōng nàn",喜欢:"xǐ huan",朝朝:"zhāo zhāo",不行:"bù xíng",轧轧:"yà yà",弯曲:"wān qū",扭曲:"niǔ qū",曲直:"qū zhí",委曲:"wěi qū",酒曲:"jiǔ qū",曲径:"qū jìng",曲解:"qū jiě",歪曲:"wāi qū",曲线:"qū xiàn",曲阜:"qū fù",九曲:"jiǔ qū",曲折:"qū zhé",曲肱:"qū gōng",曲意:"qū yì",仡佬:"gē lǎo"},Eue=Object.keys(QT).map(e=>({zh:e,pinyin:QT[e],probability:2e-8,length:2,priority:wa.Normal,dict:Symbol("dict2")})),YT={为什么:"wèi shén me",实际上:"shí jì shang",检察长:"jiǎn chá zhǎng",干什么:"gàn shén me",这会儿:"zhè huì er",尽可能:"jǐn kě néng",董事长:"dǒng shì zhǎng",了不起:"liǎo bù qǐ",参谋长:"cān móu zhǎng",朝鲜族:"cháo xiǎn zú",海内外:"hǎi nèi wài",禁不住:"jīn bú zhù",柏拉图:"bó lā tú",不在乎:"bú zài hu",洛杉矶:"luò shān jī",有点儿:"yǒu diǎn er",迫击炮:"pǎi jī pào",不得了:"bù dé liǎo",马尾松:"mǎ wěi sōng",运输量:"yùn shū liàng",发脾气:"fā pí qi",士大夫:"shì dà fū",鸭绿江:"yā lù jiāng",压根儿:"yà gēn er",对得起:"duì de qǐ",那会儿:"nà huì er",自个儿:"zì gě er",物理量:"wù lǐ liàng",怎么着:"zěn me zhāo",明晃晃:"míng huǎng huǎng",节假日:"jié jià rì",心里话:"xīn lǐ huà",发行量:"fā xíng liàng",兴冲冲:"xìng chōng chōng",分子量:"fēn zǐ liàng",国子监:"guó zǐ jiàn",老大难:"lǎo dà nán",党内外:"dǎng nèi wài",这么着:"zhè me zhāo",少奶奶:"shào nǎi nai",暗地里:"àn dì lǐ",更年期:"gēng nián qī",工作量:"gōng zuò liàng",背地里:"bèi dì lǐ",山里红:"shān li hóng",好好儿:"hǎo hāo er",交响乐:"jiāo xiǎng yuè",好意思:"hǎo yì si",吐谷浑:"tǔ yù hún",没意思:"méi yì si",理发师:"lǐ fà shī",塔什干:"tǎ shí gān",充其量:"chōng qí liàng",靠得住:"kào de zhù",车行道:"chē xíng dào",人行道:"rén xíng dào",中郎将:"zhōng láng jiàng",照明弹:"zhào míng dàn",烟幕弹:"yān mù dàn",没奈何:"mò nài hé",乱哄哄:"luàn hōng hōng",惠更斯:"huì gēng sī",载重量:"zài zhòng liàng",瞧得起:"qiáo de qǐ",纪传体:"jì zhuàn tǐ",阿房宫:"ē páng gōng",卷心菜:"juǎn xīn cài",戏班子:"xì bān zi",过得去:"guò de qù",花岗石:"huā gāng shí",外甥女:"wài sheng nǚ",团团转:"tuán tuán zhuàn",大堡礁:"dà bǎo jiāo",燃烧弹:"rán shāo dàn",劳什子:"láo shí zi",摇滚乐:"yáo gǔn yuè",夹竹桃:"jiā zhú táo",闹哄哄:"nào hōng hōng",三连冠:"sān lián guàn",重头戏:"zhòng tóu xì",二人转:"èr rén zhuàn",节骨眼:"jiē gǔ yǎn",知识面:"zhī shi miàn",护士长:"hù shi zhǎng",信号弹:"xìn hào dàn",干电池:"gān diàn chí",枪杆子:"qiāng gǎn zi",哭丧棒:"kū sāng bàng",鼻咽癌:"bí yān ái",瓦岗军:"wǎ gāng jūn",买得起:"mǎi de qǐ",癞蛤蟆:"lài há ma",脊梁骨:"jǐ liang gǔ",子母弹:"zǐ mǔ dàn",开小差:"kāi xiǎo chāi",女强人:"nǚ qiáng rén",英雄传:"yīng xióng zhuàn",爵士乐:"jué shì yuè",说笑话:"shuō xiào hua",碰头会:"pèng tóu huì",玻璃钢:"bō li gāng",曳光弹:"yè guāng dàn",少林拳:"shào lín quán",咏叹调:"yǒng tàn diào",少先队:"shào xiān duì",灵长目:"líng zhǎng mù",对着干:"duì zhe gàn",蒙蒙亮:"méng méng liàng",软骨头:"ruǎn gǔ tou",铺盖卷:"pū gài juǎn",和稀泥:"huò xī ní",背黑锅:"bēi hēi guō",红彤彤:"hóng tōng tōng",武侯祠:"wǔ hóu cí",打哆嗦:"dǎ duō suo",户口簿:"hù kǒu bù",马尾藻:"mǎ wěi zǎo",夜猫子:"yè māo zi",打手势:"dǎ shǒu shì",龙王爷:"lóng wáng yé",气头上:"qì tóu shang",糊涂虫:"hú tu chóng",笔杆子:"bǐ gǎn zi",占便宜:"zhàn pián yi",打主意:"dǎ zhǔ yì",多弹头:"duō dàn tóu",露一手:"lòu yì shǒu",堰塞湖:"yàn sè hú",保得住:"bǎo de zhù",趵突泉:"bào tū quán",奥得河:"ào de hé",司务长:"sī wù zhǎng",禁不起:"jīn bù qǐ",什刹海:"shí chà hǎi",莲花落:"lián huā lào",见世面:"jiàn shì miàn",豁出去:"huō chū qù",电位差:"diàn wèi chā",挨个儿:"āi gè er",那阵儿:"nà zhèn er",肺活量:"fèi huó liàng",大师傅:"dà shī fu",掷弹筒:"zhì dàn tǒng",打呼噜:"dǎ hū lu",广渠门:"ān qú mén",未见得:"wèi jiàn dé",大婶儿:"dà shěn er",谈得来:"tán de lái",脚丫子:"jiǎo yā zi",空包弹:"kōng bāo dàn",窝里斗:"wō li dòu",弹着点:"dàn zhuó diǎn",个头儿:"gè tóu er",看得起:"kàn de qǐ",糊涂账:"hú tu zhàng",大猩猩:"dà xīng xing",禁得起:"jīn de qǐ",法相宗:"fǎ xiàng zōng",可怜相:"kě lián xiàng",吃得下:"chī de xià",汉堡包:"hàn bǎo bāo",闹嚷嚷:"nào rāng rāng",数来宝:"shǔ lái bǎo",合得来:"hé de lái",干性油:"gān xìng yóu",闷葫芦:"mèn hú lu",呱呱叫:"guā guā jiào",西洋参:"xī yáng shēn",林荫道:"lín yīn dào",拉家常:"lā jiā cháng",卷铺盖:"juǎn pū gài",过得硬:"guò de yìng",飞将军:"fēi jiāng jūn",挑大梁:"tiǎo dà liáng",哈巴狗:"hǎ ba gǒu",过家家:"guò jiā jiā",催泪弹:"cuī lèi dàn",雨夹雪:"yǔ jiā xuě",敲竹杠:"qiāo zhú gàng",列车长:"liè chē zhǎng",华达呢:"huá dá ní",犯得着:"fàn de zháo",土疙瘩:"tǔ gē da",煞风景:"shā fēng jǐng",轻量级:"qīng liàng jí",羞答答:"xiū dā dā",石子儿:"shí zǐ er",达姆弹:"dá mǔ dàn",科教片:"kē jiào piān",侃大山:"kǎn dà shān",丁点儿:"dīng diǎn er",吃得消:"chī de xiāo",捋虎须:"luō hǔ xū",高丽参:"gāo lí shēn",众生相:"zhòng shēng xiàng",咽峡炎:"yān xiá yán",禁得住:"jīn de zhù",吃得开:"chī de kāi",柞丝绸:"zuò sī chóu",应声虫:"yìng shēng chóng",数得着:"shǔ de zháo",傻劲儿:"shǎ jìn er",铅玻璃:"qiān bō li",可的松:"kě dì sōng",划得来:"huá de lái",晕乎乎:"yūn hū hū",屎壳郎:"shǐ ke làng",尥蹶子:"liào juě zi",藏红花:"zàng hóng huā",闷罐车:"mèn guàn chē",卡脖子:"qiǎ bó zi",红澄澄:"hóng deng deng",赶得及:"gǎn de jí",当间儿:"dāng jiàn er",露马脚:"lòu mǎ jiǎo",鸡内金:"jī nèi jīn",犯得上:"fàn de shàng",钉齿耙:"dīng chǐ bà",饱和点:"bǎo hé diǎn",龙爪槐:"lóng zhǎo huái",喝倒彩:"hè dào cǎi",定冠词:"dìng guàn cí",担担面:"dàn dan miàn",吃得住:"chī de zhù",爪尖儿:"zhuǎ jiān er",支着儿:"zhī zhāo er",折跟头:"zhē gēn tou",阴着儿:"yīn zhāo er",烟卷儿:"yān juǎn er",宣传弹:"xuān chuán dàn",信皮儿:"xìn pí er",弦切角:"xián qiē jiǎo",缩砂密:"sù shā mì",说得来:"shuō de lái",水漂儿:"shuǐ piāo er",耍笔杆:"shuǎ bǐ gǎn",数得上:"shǔ de shàng",数不着:"shǔ bù zháo",数不清:"shǔ bù qīng",什件儿:"shí jiàn er",生死簿:"shēng sǐ bù",扇风机:"shān fēng jī",撒呓挣:"sā yì zheng",日记簿:"rì jì bù",热得快:"rè de kuài",亲家公:"qìng jia gōng",奇函数:"jī hán shù",拍纸簿:"pāi zhǐ bù",努劲儿:"nǔ jìn er",泥娃娃:"ní wá wa",内切圆:"nèi qiē yuán",哪会儿:"nǎ huì er",闷头儿:"mēn tóu er",没谱儿:"méi pǔ er",铆劲儿:"mǎo jìn er",溜肩膀:"liū jiān bǎng",了望台:"liào wàng tái",老来少:"lǎo lái shào",坤角儿:"kūn jué er",考勤簿:"kǎo qín bù",卷笔刀:"juǎn bǐ dāo",进给量:"jìn jǐ liàng",划不来:"huá bù lái",汗褂儿:"hàn guà er",鼓囊囊:"gǔ nāng nāng",够劲儿:"gòu jìn er",公切线:"gōng qiē xiàn",搁得住:"gé de zhù",赶浪头:"gǎn làng tóu",赶得上:"gǎn de shàng",干酵母:"gān jiào mǔ",嘎渣儿:"gā zhā er",嘎嘣脆:"gā bēng cuì",对得住:"duì de zhù",逗闷子:"dòu mèn zi",顶呱呱:"dǐng guā guā",滴溜儿:"dī liù er",大轴子:"dà zhòu zi",打板子:"dǎ bǎn zi",寸劲儿:"cùn jìn er",醋劲儿:"cù jìn er",揣手儿:"chuāi shǒu er",冲劲儿:"chòng jìn er",吃得来:"chī de lái",不更事:"bù gēng shì",奔头儿:"bèn tou er",百夫长:"bǎi fū zhǎng",娃娃亲:"wá wa qīn",死劲儿:"sǐ jìn er",骨朵儿:"gū duǒ er",功劳簿:"gōng láo bù",都江堰:"dū jiāng yàn",一担水:"yí dàn shuǐ",否极泰:"pǐ jí tài",泰来否:"tài lái pǐ",咳特灵:"ké tè líng",开户行:"kāi hù háng",郦食其:"lì yì jī",花事了:"huā shì liǎo",一更更:"yì gēng gēng",一重山:"yì chóng shān",风一更:"fēng yì gēng",雪一更:"xuě yì gēng",归一码:"guī yì mǎ",星期一:"xīng qī yī",礼拜一:"lǐ bài yī",一季度:"yī jì dù",一月一:"yī yuè yī",一字马:"yī zì mǎ",一是一:"yī shì yī",一次方:"yī cì fāng",一阳指:"yī yáng zhǐ",一字决:"yī zì jué",一年级:"yī nián jí",一不做:"yī bú zuò",屈戌儿:"qū qu ér",难为水:"nán wéi shuǐ",难为情:"nán wéi qíng",行一行:"xíng yì háng",别别的:"biè bié de",干哪行:"gàn nǎ háng",干一行:"gàn yì háng",曲别针:"qū bié zhēn"},Lue=Object.keys(YT).map(e=>({zh:e,pinyin:YT[e],probability:2e-8,length:3,priority:wa.Normal,dict:Symbol("dict3")})),JT={成吉思汗:"chéng jí sī hán",四通八达:"sì tōng bā dá",一模一样:"yì mú yí yàng",青藏高原:"qīng zàng gāo yuán",阿弥陀佛:"ē mí tuó fó",解放思想:"jiè fàng sī xiǎng",所作所为:"suǒ zuò suǒ wéi",迷迷糊糊:"mí mí hu hū",荷枪实弹:"hè qiāng shí dàn",兴高采烈:"xìng gāo cǎi liè",无能为力:"wú néng wéi lì",布鲁塞尔:"bù lǔ sài ěr",为所欲为:"wéi suǒ yù wéi",克什米尔:"kè shí mǐ ěr",没完没了:"méi wán méi liǎo",不为人知:"bù wéi rén zhī",结结巴巴:"jiē jiē bā bā",前仆后继:"qián pū hòu jì",铺天盖地:"pū tiān gài dì",直截了当:"zhí jié liǎo dàng",供不应求:"gōng bú yìng qiú",御史大夫:"yù shǐ dà fū",不为瓦全:"bù wéi wǎ quán",不可收拾:"bù kě shōu shi",胡作非为:"hú zuò fēi wéi",分毫不差:"fēn háo bú chà",模模糊糊:"mó mó hu hū",不足为奇:"bù zú wéi qí",悄无声息:"qiǎo wú shēng xī",了如指掌:"liǎo rú zhǐ zhǎng",深恶痛绝:"shēn wù tòng jué",高高兴兴:"gāo gāo xìng xìng",唉声叹气:"āi shēng tàn qì",汉藏语系:"hàn zàng yǔ xì",处心积虑:"chǔ xīn jī lǜ",泣不成声:"qì bù chéng shēng",半夜三更:"bàn yè sān gēng",失魂落魄:"shī hún luò pò",二十八宿:"èr shí bā xiù",转来转去:"zhuàn lái zhuàn qù",数以万计:"shǔ yǐ wàn jì",相依为命:"xiāng yī wéi mìng",恋恋不舍:"liàn liàn bù shě",屈指可数:"qū zhǐ kě shǔ",神出鬼没:"shén chū guǐ mò",结结实实:"jiē jiē shí shí",有的放矢:"yǒu dì fàng shǐ",叽哩咕噜:"jī lǐ gū lū",调兵遣将:"diào bīng qiǎn jiàng",载歌载舞:"zài gē zài wǔ",转危为安:"zhuǎn wēi wéi ān",踏踏实实:"tā tā shi shí",桑给巴尔:"sāng jǐ bā ěr",装模作样:"zhuāng mú zuò yàng",见义勇为:"jiàn yì yǒng wéi",相差无几:"xiāng chā wú jǐ",叹为观止:"tàn wéi guān zhǐ",闷闷不乐:"mèn mèn bú lè",喜怒哀乐:"xǐ nù āi lè",鲜为人知:"xiǎn wéi rén zhī",张牙舞爪:"zhāng yá wǔ zhǎo",为非作歹:"wéi fēi zuò dǎi",含糊其辞:"hán hú qí cí",疲于奔命:"pí yú bēn mìng",勉为其难:"miǎn wéi qí nán",依依不舍:"yī yī bù shě",顶头上司:"dǐng tóu shàng si",不着边际:"bù zhuó biān jì",大模大样:"dà mú dà yàng",寻欢作乐:"xún huān zuò lè",一走了之:"yì zǒu liǎo zhī",字里行间:"zì lǐ háng jiān",含含糊糊:"hán hán hu hū",恰如其分:"qià rú qí fèn",破涕为笑:"pò tì wéi xiào",深更半夜:"shēn gēng bàn yè",千差万别:"qiān chā wàn bié",数不胜数:"shǔ bú shèng shǔ",据为己有:"jù wéi jǐ yǒu",天旋地转:"tiān xuán dì zhuàn",养尊处优:"yǎng zūn chǔ yōu",玻璃纤维:"bō li xiān wéi",吵吵闹闹:"chāo chao nào nào",晕头转向:"yūn tóu zhuàn xiàng",土生土长:"tǔ shēng tǔ zhǎng",宁死不屈:"nìng sǐ bù qū",不省人事:"bù xǐng rén shì",尽力而为:"jìn lì ér wéi",精明强干:"jīng míng qiáng gàn",唠唠叨叨:"láo lao dāo dāo",叽叽喳喳:"jī ji zhā zhā",功不可没:"gōng bù kě mò",锲而不舍:"qiè ér bù shě",排忧解难:"pái yōu jiě nàn",稀里糊涂:"xī li hú tú",各有所长:"gè yǒu suǒ cháng",的的确确:"dí dí què què",哄堂大笑:"hōng táng dà xiào",听而不闻:"tīng ér bù wén",刀耕火种:"dāo gēng huǒ zhòng",内分泌腺:"nèi fèn mì xiàn",化险为夷:"huà xiǎn wéi yí",百发百中:"bǎi fā bǎi zhòng",重见天日:"chóng jiàn tiān rì",反败为胜:"fǎn bài wéi shèng",一了百了:"yì liǎo bǎi liǎo",大大咧咧:"dà da liē liē",心急火燎:"xīn jí huǒ liǎo",粗心大意:"cū xīn dà yi",鸡皮疙瘩:"jī pí gē da",夷为平地:"yí wéi píng dì",日积月累:"rì jī yuè lěi",设身处地:"shè shēn chǔ dì",投其所好:"tóu qí suǒ hào",间不容发:"jiān bù róng fà",人满为患:"rén mǎn wéi huàn",穷追不舍:"qióng zhuī bù shě",为时已晚:"wéi shí yǐ wǎn",如数家珍:"rú shǔ jiā zhēn",心里有数:"xīn lǐ yǒu shù",以牙还牙:"yǐ yá huán yá",神不守舍:"shén bù shǒu shě",孟什维克:"mèng shí wéi kè",各自为战:"gè zì wéi zhàn",怨声载道:"yuàn shēng zài dào",救苦救难:"jiù kǔ jiù nàn",好好先生:"hǎo hǎo xiān sheng",怪模怪样:"guài mú guài yàng",抛头露面:"pāo tóu lù miàn",游手好闲:"yóu shǒu hào xián",无所不为:"wú suǒ bù wéi",调虎离山:"diào hǔ lí shān",步步为营:"bù bù wéi yíng",好大喜功:"hào dà xǐ gōng",众矢之的:"zhòng shǐ zhī dì",长生不死:"cháng shēng bù sǐ",蔚为壮观:"wèi wéi zhuàng guān",不可胜数:"bù kě shèng shǔ",鬼使神差:"guǐ shǐ shén chāi",洁身自好:"jié shēn zì hào",敢作敢为:"gǎn zuò gǎn wéi",茅塞顿开:"máo sè dùn kāi",走马换将:"zǒu mǎ huàn jiàng",为时过早:"wéi shí guò zǎo",为人师表:"wéi rén shī biǎo",阴差阳错:"yīn chā yáng cuò",油腔滑调:"yóu qiāng huá diào",重蹈覆辙:"chóng dǎo fù zhé",骂骂咧咧:"mà ma liē liē",絮絮叨叨:"xù xù dāo dāo",如履薄冰:"rú lǚ bó bīng",损兵折将:"sǔn bīng zhé jiàng",拐弯抹角:"guǎi wān mò jiǎo",像模像样:"xiàng mú xiàng yàng",供过于求:"gōng guò yú qiú",开花结果:"kāi huā jiē guǒ",仔仔细细:"zǐ zǐ xì xì",川藏公路:"chuān zàng gōng lù",河北梆子:"hé běi bāng zi",长年累月:"cháng nián lěi yuè",正儿八经:"zhèng er bā jīng",不识抬举:"bù shí tái ju",重振旗鼓:"chóng zhèn qí gǔ",气息奄奄:"qì xī yān yān",紧追不舍:"jǐn zhuī bù shě",服服帖帖:"fú fu tiē tiē",强词夺理:"qiǎng cí duó lǐ",噼里啪啦:"pī li pā lā",人才济济:"rén cái jǐ jǐ",发人深省:"fā rén shēn xǐng",不足为凭:"bù zú wéi píng",为富不仁:"wéi fù bù rén",连篇累牍:"lián piān lěi dú",呼天抢地:"hū tiān qiāng dì",落落大方:"luò luò dà fāng",自吹自擂:"zì chuī zì léi",乐善好施:"lè shàn hào shī",以攻为守:"yǐ gōng wéi shǒu",磨磨蹭蹭:"mó mó cèng cèng",削铁如泥:"xuē tiě rú ní",助纣为虐:"zhù zhòu wéi nüè",以退为进:"yǐ tuì wéi jìn",嘁嘁喳喳:"qī qī chā chā",枪林弹雨:"qiāng lín dàn yǔ",令人发指:"lìng rén fà zhǐ",转败为胜:"zhuǎn bài wéi shèng",转弯抹角:"zhuǎn wān mò jiǎo",在劫难逃:"zài jié nán táo",正当防卫:"zhèng dàng fáng wèi",不足为怪:"bù zú wéi guài",难兄难弟:"nàn xiōng nàn dì",咿咿呀呀:"yī yī yā yā",弹尽粮绝:"dàn jìn liáng jué",阿谀奉承:"ē yú fèng chéng",稀里哗啦:"xī li huā lā",返老还童:"fǎn lǎo huán tóng",好高骛远:"hào gāo wù yuǎn",鹿死谁手:"lù sǐ shéi shǒu",差强人意:"chā qiáng rén yì",大吹大擂:"dà chuī dà léi",成家立业:"chéng jiā lì yè",自怨自艾:"zì yuàn zì yì",负债累累:"fù zhài lěi lěi",古为今用:"gǔ wéi jīn yòng",入土为安:"rù tǔ wéi ān",下不为例:"xià bù wéi lì",一哄而上:"yì hōng ér shàng",没头苍蝇:"méi tóu cāng ying",天差地远:"tiān chā dì yuǎn",风卷残云:"fēng juǎn cán yún",多灾多难:"duō zāi duō nàn",乳臭未干:"rǔ xiù wèi gān",行家里手:"háng jiā lǐ shǒu",狼狈为奸:"láng bèi wéi jiān",处变不惊:"chǔ biàn bù jīng",一唱一和:"yí chàng yí hè",一念之差:"yí niàn zhī chā",金蝉脱壳:"jīn chán tuō qiào",滴滴答答:"dī dī dā dā",硕果累累:"shuò guǒ léi léi",好整以暇:"hào zhěng yǐ xiá",红得发紫:"hóng de fā zǐ",传为美谈:"chuán wéi měi tán",富商大贾:"fù shāng dà gǔ",四海为家:"sì hǎi wéi jiā",了若指掌:"liǎo ruò zhǐ zhǎng",大有可为:"dà yǒu kě wéi",出头露面:"chū tóu lù miàn",鼓鼓囊囊:"gǔ gu nāng nāng",窗明几净:"chuāng míng jī jìng",泰然处之:"tài rán chǔ zhī",怒发冲冠:"nù fà chōng guān",有机玻璃:"yǒu jī bō li",骨头架子:"gǔ tou jià zi",义薄云天:"yì bó yún tiān",一丁点儿:"yī dīng diǎn er",时来运转:"shí lái yùn zhuǎn",陈词滥调:"chén cí làn diào",化整为零:"huà zhěng wéi líng",火烧火燎:"huǒ shāo huǒ liǎo",干脆利索:"gàn cuì lì suǒ",吊儿郎当:"diào er láng dāng",广种薄收:"guǎng zhòng bó shōu",种瓜得瓜:"zhòng guā dé guā",种豆得豆:"zhòng dòu dé dòu",难舍难分:"nán shě nán fēn",歃血为盟:"shà xuè wéi méng",奋发有为:"fèn fā yǒu wéi",阴错阳差:"yīn cuò yáng chā",东躲西藏:"dōng duǒ xī cáng",烟熏火燎:"yān xūn huǒ liǎo",钻牛角尖:"zuān niú jiǎo jiān",乔装打扮:"qiáo zhuāng dǎ bàn",改弦更张:"gǎi xián gēng zhāng",河南梆子:"hé nán bāng zi",好吃懒做:"hào chī lǎn zuò",何乐不为:"hé lè bù wéi",大出风头:"dà chū fēng tóu",攻城掠地:"gōng chéng lüè dì",漂漂亮亮:"piào piào liang liang",折衷主义:"zhé zhōng zhǔ yì",大马哈鱼:"dà mǎ hǎ yú",绿树成荫:"lǜ shù chéng yīn",率先垂范:"shuài xiān chuí fàn",家长里短:"jiā cháng lǐ duǎn",宽大为怀:"kuān dà wéi huái",左膀右臂:"zuǒ bǎng yòu bì",一笑了之:"yí xiào liǎo zhī",天下为公:"tiān xià wéi gōng",还我河山:"huán wǒ hé shān",何足为奇:"hé zú wéi qí",好自为之:"hǎo zì wéi zhī",风姿绰约:"fēng zī chuò yuē",大雨滂沱:"dà yǔ pāng tuó",传为佳话:"chuán wéi jiā huà",吃里扒外:"chī lǐ pá wài",重操旧业:"chóng cāo jiù yè",小家子气:"xiǎo jiā zi qì",少不更事:"shào bù gēng shì",难分难舍:"nán fēn nán shě",添砖加瓦:"tiān zhuān jiā wǎ",是非分明:"shì fēi fēn míng",舍我其谁:"shě wǒ qí shuí",偏听偏信:"piān tīng piān xìn",量入为出:"liàng rù wéi chū",降龙伏虎:"xiáng lóng fú hǔ",钢化玻璃:"gāng huà bō li",正中下怀:"zhèng zhòng xià huái",以身许国:"yǐ shēn xǔ guó",一语中的:"yì yǔ zhòng dì",丧魂落魄:"sàng hún luò pò",三座大山:"sān zuò dà shān",济济一堂:"jǐ jǐ yì táng",好事之徒:"hào shì zhī tú",干净利索:"gàn jìng lì suǒ",出将入相:"chū jiàng rù xiàng",袅袅娜娜:"niǎo niǎo nuó nuó",狐狸尾巴:"hú li wěi ba",好逸恶劳:"hào yì wù láo",大而无当:"dà ér wú dàng",打马虎眼:"dǎ mǎ hu yǎn",板上钉钉:"bǎn shàng dìng dīng",吆五喝六:"yāo wǔ hè liù",虾兵蟹将:"xiā bīng xiè jiàng",水调歌头:"shuǐ diào gē tóu",数典忘祖:"shǔ diǎn wàng zǔ",人事不省:"rén shì bù xǐng",曲高和寡:"qǔ gāo hè guǎ",屡教不改:"lǚ jiào bù gǎi",互为因果:"hù wéi yīn guǒ",互为表里:"hù wéi biǎo lǐ",厚此薄彼:"hòu cǐ bó bǐ",过关斩将:"guò guān zhǎn jiàng",疙疙瘩瘩:"gē ge dā dā",大腹便便:"dà fù pián pián",走为上策:"zǒu wéi shàng cè",冤家对头:"yuān jia duì tóu",有隙可乘:"yǒu xì kě chèng",一鳞半爪:"yì lín bàn zhǎo",片言只语:"piàn yán zhǐ yǔ",开花结实:"kāi huā jié shí",经年累月:"jīng nián lěi yuè",含糊其词:"hán hú qí cí",寡廉鲜耻:"guǎ lián xiǎn chǐ",成年累月:"chéng nián lěi yuè",不徇私情:"bú xùn sī qíng",不当人子:"bù dāng rén zǐ",膀大腰圆:"bǎng dà yāo yuán",指腹为婚:"zhǐ fù wéi hūn",这么点儿:"zhè me diǎn er",意兴索然:"yì xīng suǒ rán",绣花枕头:"xiù huā zhěn tou",无的放矢:"wú dì fàng shǐ",望闻问切:"wàng wén wèn qiè",舍己为人:"shě jǐ wèi rén",穷年累月:"qióng nián lěi yuè",排难解纷:"pái nàn jiě fēn",处之泰然:"chǔ zhī tài rán",指鹿为马:"zhǐ lù wéi mǎ",危如累卵:"wēi rú lěi luǎn",天兵天将:"tiān bīng tiān jiàng",舍近求远:"shě jìn qiú yuǎn",南腔北调:"nán qiāng běi diào",苦中作乐:"kǔ zhōng zuò lè",厚积薄发:"hòu jī bó fā",臭味相投:"xiù wèi xiāng tóu",长幼有序:"zhǎng yòu yǒu xù",逼良为娼:"bī liáng wéi chāng",悲悲切切:"bēi bēi qiè qiē",败军之将:"bài jūn zhī jiàng",欺行霸市:"qī háng bà shì",削足适履:"xuē zú shì lǚ",先睹为快:"xiān dǔ wéi kuài",啼饥号寒:"tí jī háo hán",疏不间亲:"shū bú jiàn qīn",神差鬼使:"shén chāi guǐ shǐ",敲敲打打:"qiāo qiāo dǎ dǎ",平铺直叙:"píng pū zhí xù",没头没尾:"méi tóu mò wěi",寥寥可数:"liáo liáo kě shǔ",哼哈二将:"hēng hā èr jiàng",鹤发童颜:"hè fà tóng yán",各奔前程:"gè bèn qián chéng",弹无虚发:"dàn wú xū fā",大人先生:"dà rén xiān sheng",与民更始:"yǔ mín gēng shǐ",树碑立传:"shù bēi lì zhuàn",是非得失:"shì fēi dé shī",实逼处此:"shí bī chǔ cǐ",塞翁失马:"sài wēng shī mǎ",日薄西山:"rì bó xī shān",切身体会:"qiè shēn tǐ huì",片言只字:"piàn yán zhǐ zì",跑马卖解:"pǎo mǎ mài xiè",宁折不弯:"nìng zhé bù wān",零零散散:"líng líng sǎn sǎn",量体裁衣:"liàng tǐ cái yī",连中三元:"lián zhòng sān yuán",礼崩乐坏:"lǐ bēng yuè huài",不为已甚:"bù wéi yǐ shèn",转悲为喜:"zhuǎn bēi wéi xǐ",以眼还眼:"yǐ yǎn huán yǎn",蔚为大观:"wèi wéi dà guān",未为不可:"wèi wéi bù kě",童颜鹤发:"tóng yán hè fà",朋比为奸:"péng bǐ wéi jiān",莫此为甚:"mò cǐ wéi shèn",夹枪带棒:"jiā qiāng dài bàng",富商巨贾:"fù shāng jù jiǎ",淡然处之:"dàn rán chǔ zhī",箪食壶浆:"dān shí hú jiāng",创巨痛深:"chuāng jù tòng shēn",草长莺飞:"cǎo zhǎng yīng fēi",坐视不救:"zuò shī bú jiù",以己度人:"yǐ jǐ duó rén",随行就市:"suí háng jiù shì",文以载道:"wén yǐ zài dào",文不对题:"wén bú duì tí",铁板钉钉:"tiě bǎn dìng dīng",身体发肤:"shēn tǐ fà fū",缺吃少穿:"quē chī shǎo chuān",目无尊长:"mù wú zūn zhǎng",吉人天相:"jí rén tiān xiàng",毁家纾难:"huǐ jiā shū nàn",钢筋铁骨:"gāng jīn tiě gǔ",丢卒保车:"diū zú bǎo jū",丢三落四:"diū sān là sì",闭目塞听:"bì mù sè tīng",削尖脑袋:"xuē jiān nǎo dài",为非作恶:"wéi fēi zuò è",人才难得:"rén cái nán dé",情非得已:"qíng fēi dé yǐ",切中要害:"qiè zhòng yào hài",火急火燎:"huǒ jí huǒ liǎo",画地为牢:"huà dì wéi láo",好酒贪杯:"hào jiǔ tān bēi",长歌当哭:"cháng gē dàng kū",载沉载浮:"zài chén zài fú",遇难呈祥:"yù nàn chéng xiáng",榆木疙瘩:"yú mù gē da",以邻为壑:"yǐ lín wéi hè",洋为中用:"yáng wéi zhōng yòng",言为心声:"yán wéi xīn shēng",言必有中:"yán bì yǒu zhòng",图穷匕见:"tú qióng bǐ xiàn",滂沱大雨:"páng tuó dà yǔ",目不暇给:"mù bù xiá jǐ",量才录用:"liàng cái lù yòng",教学相长:"jiào xué xiāng zhǎng",悔不当初:"huǐ bù dāng chū",呼幺喝六:"hū yāo hè liù",不足为训:"bù zú wéi xùn",不拘形迹:"bù jū xíng jī",傍若无人:"páng ruò wú rén",罪责难逃:"zuì zé nán táo",自我吹嘘:"zì wǒ chuī xū",转祸为福:"zhuǎn huò wéi fú",勇冠三军:"yǒng guàn sān jūn",易地而处:"yì dì ér chǔ",卸磨杀驴:"xiè mò shā lǘ",玩儿不转:"wán ér bú zhuàn",天道好还:"tiān dào hǎo huán",身单力薄:"shēn dān lì bó",撒豆成兵:"sǎ dòu chéng bīng",片纸只字:"piàn zhǐ zhī zì",宁缺毋滥:"nìng quē wú làn",没没无闻:"mò mò wú wén",量力而为:"liàng lì ér wéi",历历可数:"lì lì kě shǔ",口碑载道:"kǒu bēi zài dào",君子好逑:"jūn zǐ hǎo qiú",好为人师:"hào wéi rén shī",豪商巨贾:"háo shāng jù jiǎ",各有所好:"gè yǒu suǒ hào",度德量力:"duó dé liàng lì",指天为誓:"zhǐ tiān wéi shì",逸兴遄飞:"yì xìng chuán fēi",心宽体胖:"xīn kuān tǐ pán",为德不卒:"wéi dé bù zú",天下为家:"tiān xià wéi jiā",视为畏途:"shì wéi wèi tú",三灾八难:"sān zāi bā nàn",沐猴而冠:"mù hóu ér guàn",哩哩啦啦:"lī li lā lā",见缝就钻:"jiàn fèng jiù zuān",夹层玻璃:"jiā céng bō li",急公好义:"jí gōng hào yì",积年累月:"jī nián lěi yuè",划地为牢:"huá dì wéi láo",更名改姓:"gēng míng gǎi xìng",奉为圭臬:"fèng wéi guī niè",多难兴邦:"duō nàn xīng bāng",不破不立:"bú pò bú lì",坐地自划:"zuò dì zì huá",坐不重席:"zuò bù chóng xí",坐不窥堂:"zuò bù kuī táng",作嫁衣裳:"zuò jià yī shang",左枝右梧:"zuǒ zhī yòu wú",左宜右有:"zuǒ yí yòu yǒu",钻头觅缝:"zuān tóu mì fèng",钻天打洞:"zuān tiān dǎ dòng",钻皮出羽:"zuān pí chū yǔ",钻火得冰:"zuān huǒ dé bīng",钻洞觅缝:"zuàn dòng mì féng",钻冰求火:"zuān bīng qiú huǒ",子为父隐:"zǐ wéi fù yǐn",擢发难数:"zhuó fà nán shǔ",着人先鞭:"zhuó rén xiān biān",斫雕为朴:"zhuó diāo wéi pǔ",锥处囊中:"zhuī chǔ náng zhōng",椎心饮泣:"chuí xīn yǐn qì",椎心泣血:"chuí xīn qì xuè",椎牛飨士:"chuí niú xiǎng shì",椎牛歃血:"chuí niú shà xuè",椎牛发冢:"chuí niú fà zhǒng",椎埋屠狗:"chuí mái tú gǒu",椎埋狗窃:"chuí mái gǒu qiè",壮发冲冠:"zhuàng fā chōng guàn",庄严宝相:"zhuāng yán bǎo xiàng",转愁为喜:"zhuǎn chóu wéi xǐ",转嗔为喜:"zhuǎn chēn wéi xǐ",拽巷啰街:"zhuài xiàng luó jiē",拽耙扶犁:"zhuāi pá fú lí",拽布拖麻:"zhuài bù tuō má",箸长碗短:"zhù cháng wǎn duǎn",铸剑为犁:"zhù jiàn wéi lí",杼柚其空:"zhù yòu qí kōng",杼柚空虚:"zhù yòu kōng xū",助天为虐:"zhù tiān wéi nüè",属垣有耳:"zhǔ yuán yǒu ěr",属毛离里:"zhǔ máo lí lǐ",属辞比事:"zhǔ cí bǐ shì",逐物不还:"zhú wù bù huán",铢量寸度:"zhū liáng cùn duó",铢两悉称:"zhū liǎng xī chèn",侏儒观戏:"zhū rú guān xì",朱轓皁盖:"zhū fān zào gài",昼度夜思:"zhòu duó yè sī",诪张为幻:"zhōu zhāng wéi huàn",重明继焰:"chóng míng jì yàn",众啄同音:"zhòng zhuó tóng yīn",众毛攒裘:"zhòng máo cuán qiú",众好众恶:"zhòng hào zhòng wù",擿埴索涂:"zhāi zhí suǒ tú",稚齿婑媠:"zhì chǐ wǒ tuó",至当不易:"zhì dàng bú yì",指皂为白:"zhǐ zào wéi bái",指雁为羹:"zhǐ yàn wéi gēng",指树为姓:"zhǐ shù wéi xìng",指山说磨:"zhǐ shān shuō mò",止戈为武:"zhǐ gē wéi wǔ",枝干相持:"zhī gàn xiāng chí",枝大于本:"zh dà yú běn",支吾其词:"zhī wú qí cí",正身率下:"zhèng shēn shuài xià",正冠李下:"zhèng guàn lǐ xià",整冠纳履:"zhěng guān nà lǚ",整躬率物:"zhěng gōng shuài wù",整顿干坤:"zhěng dùn gàn kūn",针头削铁:"zhēn tóu xuē tiě",贞松劲柏:"zhēn sōng jìng bǎi",赭衣塞路:"zhě yī sè lù",折箭为誓:"shé jiàn wéi shì",折而族之:"zhé ér zú zhī",昭德塞违:"zhāo dé sè wéi",章句小儒:"zhāng jù xiǎo rú",湛恩汪濊:"zhàn ēn wāng huì",占风望气:"zhān fēng wàng qì",斩将搴旗:"zhǎn jiàng qiān qí",曾母投杼:"zēng mǔ tóu zhù",曾参杀人:"zēng shēn shā rén",造谣中伤:"zào yáo zhòng shāng",早占勿药:"zǎo zhān wù yào",凿龟数策:"záo guī shǔ cè",攒三聚五:"cuán sān jù wǔ",攒眉蹙额:"cuán mei cù é",攒零合整:"cuán líng hé zhěng",攒锋聚镝:"cuán fēng jù dí",载笑载言:"zài xiào zài yán",载酒问字:"zài jiǔ wèn zì",殒身不恤:"yǔn shēn bú xù",云舒霞卷:"yún shū xiá juǎn",月中折桂:"yuè zhōng shé guì",月落参横:"yuè luò shēn héng",鬻驽窃价:"yù nú qiè jià",鬻鸡为凤:"yù jī wéi fèng",遇难成祥:"yù nàn chéng xiáng",郁郁累累:"yù yù lěi lěi",玉卮无当:"yù zhī wú dàng",语笑喧阗:"yǔ xiào xuān tián",与世沉浮:"yǔ shì chén fú",与时消息:"yǔ shí xiāo xi",逾墙钻隙:"yú qiáng zuān xì",渔夺侵牟:"yú duó qīn móu",杅穿皮蠹:"yú chuān pí dù",余勇可贾:"yú yǒng kě gǔ",予智予雄:"yú zhì yú xióng",予取予求:"yú qǔ yú qiú",于家为国:"yú jiā wéi guó",有借无还:"yǒu jiè wú huán",有加无已:"yǒu jiā wú yǐ",有国难投:"yǒu guó nán tóu",游必有方:"yóu bì yǒu fāng",油干灯尽:"yóu gàn dēng jìn",尤云殢雨:"yóu yún tì yǔ",庸中皦皦:"yōng zhōng jiǎo jiǎo",郢书燕说:"yǐng shū yān shuō",营蝇斐锦:"yíng yíng fēi jǐn",鹰心雁爪:"yīng xīn yàn zhǎo",莺吟燕儛:"yīng yín yàn wǔ",应天顺时:"yīng tiān shùn shí",印累绶若:"yìn léi shòu ruò",隐占身体:"yǐn zhàn shēn tǐ",饮犊上流:"yìn dú shàng liú",引绳切墨:"yǐn shéng qiē mò",龈齿弹舌:"yín chǐ dàn shé",因缘为市:"yīn yuán wéi shì",因树为屋:"yīn shù wéi wū",溢美溢恶:"yì měi yì wù",抑塞磊落:"yì sè lěi luò",倚闾望切:"yǐ lǘ wàng qiē",以意为之:"yǐ yì wéi zhī",以言为讳:"yǐ yán wéi huì",以疏间亲:"yǐ shū jiàn qīn",以水济水:"yǐ shuǐ jǐ shuǐ",以书为御:"yǐ shū wéi yù",以守为攻:"yǐ shǒu wéi gōng",以升量石:"yǐ shēng liáng dàn",以慎为键:"yǐ shèn wéi jiàn",以筌为鱼:"yǐ quán wéi yú",以利累形:"yǐ lì lěi xíng",以毁为罚:"yǐ huǐ wéi fá",以黑为白:"yǐ hēi wéi bái",以规为瑱:"yǐ guī wéi tiàn",以古为鉴:"yǐ gǔ wéi jiàn",以宫笑角:"yǐ gōng xiào jué",以法为教:"yǐ fǎ wéi jiào",以大恶细:"yǐ dà wù xì",遗世忘累:"yí shì wàng lěi",遗寝载怀:"yí qǐn zài huái",移的就箭:"yí dì jiù jiàn",依头缕当:"yī tóu lǚ dàng",衣租食税:"yì zū shí shuì",衣轻乘肥:"yì qīng chéng féi",衣裳之会:"yī shang zhī huì",衣单食薄:"yī dān shí bó",一还一报:"yì huán yí bào",叶公好龙:"yè gōng hào lóng",野调无腔:"yě diào wú qiāng",瑶池女使:"yáo chí nǚ shǐ",幺麽小丑:"yāo mó xiǎo chǒu",养精畜锐:"yǎng jīng xù ruì",卬首信眉:"áng shǒu shēn méi",洋洋纚纚:"yáng yáng sǎ sǎ",羊羔美酒:"yáng gāo měi jiǔ",扬风扢雅:"yáng fēng jié yǎ",燕昭市骏:"yān zhāo shì jùn",燕昭好马:"yān zhāo hǎo mǎ",燕石妄珍:"yān shí wàng zhēn",燕骏千金:"yān jùn qiān jīn",燕金募秀:"yān jīn mù xiù",燕驾越毂:"yān jià yuè gǔ",燕歌赵舞:"yān gē zhào wǔ",燕岱之石:"yān dài zhī shí",燕处危巢:"yàn chǔ wēi cháo",掞藻飞声:"shàn zǎo fēi shēng",偃革为轩:"yǎn gé wéi xuān",妍蚩好恶:"yán chī hǎo è",压良为贱:"yā liáng wéi jiàn",搀行夺市:"chān háng duó shì",泣数行下:"qì shù háng xià",当行出色:"dāng háng chū sè",秀出班行:"xiù chū bān háng",儿女成行:"ér nǚ chéng háng",大行大市:"dà háng dà shì",寻行数墨:"xún háng shǔ mò",埙篪相和:"xūn chí xiāng hè",血债累累:"xuè zhài lěi lěi",炫玉贾石:"xuàn yù gǔ shí",炫石为玉:"xuàn shí wéi yù",悬石程书:"xuán dàn chéng shū",悬狟素飡:"xuán huán sù cān",悬龟系鱼:"xuán guī xì yú",揎拳捋袖:"xuān quán luō xiù",轩鹤冠猴:"xuān hè guàn hóu",畜妻养子:"xù qī yǎng zǐ",羞人答答:"xiū rén dā dā",修鳞养爪:"xiū lín yǎng zhǎo",熊据虎跱:"xióng jù hǔ zhì",兄死弟及:"xiōng sǐ dì jí",腥闻在上:"xīng wén zài shàng",兴文匽武:"xīng wén yǎn wǔ",兴观群怨:"xìng guān qún yuàn",兴高彩烈:"xìng gāo cǎi liè",心手相应:"xīn shǒu xiāng yìng",心口相应:"xīn kǒu xiāng yīng",挟势弄权:"xié shì nòng quán",胁肩累足:"xié jiān lěi zú",校短量长:"jiào duǎn liáng cháng",小眼薄皮:"xiǎo yǎn bó pí",硝云弹雨:"xiāo yún dàn yǔ",鸮鸣鼠暴:"xiāo míng shǔ bào",削株掘根:"xuē zhū jué gēn",削铁无声:"xuē tiě wú shēng",削职为民:"xuē zhí wéi mín",削木为吏:"xuē mù wéi lì",想望风褱:"xiǎng wàng fēng huái",香培玉琢:"xiang pei yu zhuó",相鼠有皮:"xiàng shǔ yǒu pí",相时而动:"xiàng shí ér dòng",相切相磋:"xiāng qiē xiāng cuō",相女配夫:"xiàng nǚ pèi fū",相门有相:"xiàng mén yǒu xiàng",挦章撦句:"xián zhāng chě jù",先我着鞭:"xiān wǒ zhuó biān",习焉不察:"xí yān bù chá",歙漆阿胶:"shè qī ē jiāo",晰毛辨发:"xī máo biàn fà",悉索薄赋:"xī suǒ bó fù",雾鳞云爪:"wù lín yún zhǎo",物稀为贵:"wù xī wéi guì",碔砆混玉:"wǔ fū hùn yù",武断专横:"wǔ duàn zhuān héng",五石六鹢:"wǔ shí liù yì",五色相宣:"wǔ sè xiāng xuān",五侯七贵:"wǔ hóu qī guì",五侯蜡烛:"wǔ hòu là zhú",五羖大夫:"wǔ gǔ dà fū",吾自有处:"wú zì yǒu chǔ",无下箸处:"wú xià zhù chǔ",无伤无臭:"wú shāng wú xiù",无能为役:"wú néng wéi yì",无寇暴死:"wú kòu bào sǐ",无孔不钻:"wú kǒng bú zuàn",无间可乘:"wú jiān kě chéng",无间冬夏:"wú jiān dōng xià",无恶不为:"wú è bù wéi",无动为大:"wú dòng wéi dà",诬良为盗:"wū liáng wéi dào",握拳透爪:"wò quán tòu zhǎo",文武差事:"wén wǔ chāi shì",委委佗佗:"wēi wēi tuó tuó",惟日为岁:"wéi rì wéi suì",帷薄不修:"wéi bó bù xiū",为善最乐:"wéi shàn zuì lè",为山止篑:"wéi shān zhǐ kuì",为仁不富:"wéi rén bú fù",为裘为箕:"wéi qiú wéi jī",为民父母:"wéi mín fù mǔ",为虺弗摧:"wéi huǐ fú cuī",为好成歉:"wéi hǎo chéng qiàn",为鬼为蜮:"wéi guǐ wéi yù",望风响应:"wàng fēng xiǎng yīng",望尘僄声:"wàng chén piào shēng",往渚还汀:"wǎng zhǔ huán tīng",王贡弹冠:"wáng gòng dàn guàn",亡国大夫:"wáng guó dà fū",万贯家私:"wàn guàn jiā sī",晚食当肉:"wǎn shí dàng ròu",晚节不保:"wǎn jié bù bǎo",玩岁愒时:"wán suì kài shí",蛙蟆胜负:"wā má shèng fù",吞言咽理:"tūn yán yàn lǐ",颓垣断堑:"tuí yuán duàn qiàn",推干就湿:"tuī gàn jiù shī",剸繁决剧:"tuán fán jué jù",团头聚面:"tuán tóu jù miàn",兔丝燕麦:"tù sī yàn mài",兔头麞脑:"tù tóu zhāng nǎo",兔葵燕麦:"tù kuí yàn mài",吐哺握发:"tǔ bǔ wò fà",投传而去:"tóu zhuàn ér qù",头没杯案:"tóu mò bēi àn",头昏脑闷:"tóu hūn nǎo mèn",头会箕敛:"tóu kuài jī liǎn",头出头没:"tóu chū tóu mò",痛自创艾:"tòng zì chuāng yì",同恶相助:"tóng wù xiāng zhù",同恶相恤:"tóng wù xiāng xù",痌瘝在抱:"tōng guān zài bào",通文调武:"tōng wén diào wǔ",停留长智:"tíng liú zhǎng zhì",铁树开华:"tiě shù kāi huā",条贯部分:"tiáo guàn bù fēn",挑牙料唇:"tiǎo yá liào chún",挑么挑六:"tiāo yāo tiāo liù",挑唇料嘴:"tiǎo chún liào zuǐ",恬不为意:"tián bù wéi yì",恬不为怪:"tián bù wéi guài",天下为笼:"tiān xià wéi lóng",天台路迷:"tiān tái lù mí",天年不遂:"tiān nián bú suì",探囊胠箧:"tàn náng qū qiè",谭言微中:"tán yán wēi zhòng",谈言微中:"tán yán wēi zhòng",狧穅及米:"shì kāng jí mǐ",随物应机:"suí wù yīng jī",搜岩采干:"sōu yán cǎi gàn",宋斤鲁削:"sòng jīn lǔ xuē",松筠之节:"sōng yún zhī jié",四亭八当:"sì tíng bā dàng",四马攒蹄:"sì mǎ cuán tí",四不拗六:"sì bú niù liù",思所逐之:"sī suǒ zhú zhī",丝恩发怨:"sī ēn fà yuàn",硕望宿德:"shuò wàng xiǔ dé",铄古切今:"shuò gǔ qiē jīn",顺风而呼:"shùn fēng ér hū",顺风吹火:"shùn fēng chuī huǒ",水中著盐:"shuǐ zhōng zhuó yán",双柑斗酒:"shuāng gān dǒu jiǔ",数米而炊:"shǔ mǐ ér chuī",数米量柴:"shǔ mǐ liáng chái",数理逻辑:"shù lǐ luó ji",数黑论黄:"shǔ hēi lùn huáng",数白论黄:"shǔ bái lùn huáng",束缊还妇:"shù yūn huán fù",束蒲为脯:"shù pú wéi pú",束椽为柱:"shù chuán wéi zhù",书缺有间:"shū quē yǒu jiàn",手足重茧:"shǒu zú chóng jiǎn",手足异处:"shǒu zú yì chǔ",手脚干净:"shǒu jiǎo gàn jìng",手不应心:"shǒu bù yīng xīn",螫手解腕:"shì shǒu jiě wàn",释知遗形:"shì zhī yí xíng",适时应务:"shì shí yīng wù",适情率意:"shì qíng shuài yì",适当其冲:"shì dāng qí chōng",视为知己:"shì wéi zhī jǐ",使羊将狼:"shǐ yáng jiàng láng",食为民天:"shí wéi mín tiān",拾掇无遗:"shí duō wú yí",实与有力:"shí yù yǒu lì",石英玻璃:"shí yīng bō li",石室金匮:"shí shì jīn guì",什袭珍藏:"shí xí zhēn cáng",什伍东西:"shí wǔ dōng xī",什围伍攻:"shí wéi wǔ gōng",十魔九难:"shí mó jiǔ nàn",诗书发冢:"shī shū fà zhǒng",虱处裈中:"shī chǔ kūn zhōng",师直为壮:"shī zhí wéi zhuàng",尸居龙见:"shī jū lóng xiàn",圣经贤传:"shèng jīng xián zhuàn",圣君贤相:"shèng jūn xián xiàng",生拖死拽:"shēng tuō sǐ zhuài",审己度人:"shěn jǐ duó rén",神武挂冠:"shén wǔ guà guàn",神龙失埶:"shén lóng shī shì",深文曲折:"shēn wén qǔ shé",深厉浅揭:"shēn lì qiǎn qì",深谷为陵:"shēn gǔ wéi líng",深恶痛疾:"shēn wù tòng jí",深仇宿怨:"shēn chóu xiǔ yuàn",舍己为公:"shě jǐ wèi gōng",舍短取长:"shě duǎn qǔ cháng",舍策追羊:"shě cè zhuī yáng",蛇蝎为心:"shé xiē wéi xīn",少成若性:"shào chéng ruò xìng",上当学乖:"shàng dàng xué guāi",赏不当功:"shǎng bù dāng gōng",善自为谋:"shàn zì wéi móu",善为说辞:"shàn wéi shuō cí",善善恶恶:"shàn shàn wù è",善财难舍:"shàn cái nán shě",苫眼铺眉:"shān yǎn pū méi",讪牙闲嗑:"shàn yá xián kē",山阴乘兴:"shān yīn chéng xīng",山殽野湋:"shān yáo yě wéi",山溜穿石:"shān liù chuān shí",山节藻棁:"shān jié zǎo zhuō",杀鸡为黍:"shā jī wéi shǔ",色厉胆薄:"sè lì dǎn bó",桑荫未移:"sāng yīn wèi yí",桑荫不徙:"sāng yīn bù xǐ",桑土绸缪:"sāng tǔ chóu miù",桑户棬枢:"sāng hù juàn shū",三战三北:"sān zhàn sān běi",三瓦两舍:"sān wǎ liǎng shě",三人为众:"sān rén wèi zhòng",三差两错:"sān chā liǎng cuò",塞井焚舍:"sāi jǐng fén shě",洒心更始:"sǎ xīn gèng shǐ",洒扫应对:"sǎ sǎo yìng duì",软红香土:"ruǎn hóng xiāng tǔ",入吾彀中:"rù wú gòu zhōng",入铁主簿:"rù tiě zhǔ bù",入理切情:"rù lǐ qiē qíng",汝成人耶:"rǔ chéng rén yé",如水投石:"rú shuǐ tóu shí",如切如磋:"rú qiē rú cuō",如登春台:"rú dēng chūn tái",肉薄骨并:"ròu bó gǔ bìng",柔情绰态:"róu qíng chuò tài",戎马劻勷:"róng mǎ kuāng ráng",日中为市:"rì zhōng wéi shì",日月参辰:"rì yuè shēn chén",日省月修:"rì xǐng yuè xiū",日削月割:"rì xuē yuè gē",日省月试:"rì xǐng yuè shì",任达不拘:"rèn dá bù jū",人言藉藉:"rén yán jí jí",人模狗样:"rén mú gǒu yàng",人莫予毒:"rén mò yú dú",热熬翻饼:"rè áo fān bǐng",圈牢养物:"juàn láo yǎng wù",取予有节:"qǔ yǔ yǒu jié",诎要桡腘:"qū yāo ráo guó",穷形尽相:"qióng xíng jìn xiàng",情凄意切:"qíng qī yì qiè",情见势屈:"qíng xiàn shì qū",情见乎辞:"qíng xiàn hū cí",清都绛阙:"qīng dōu jiàng què",倾肠倒肚:"qīng cháng dào dǔ",青紫被体:"qīng zǐ pī tǐ",青林黑塞:"qīng lín hēi sài",螓首蛾眉:"qín shǒu é méi",琴瑟之好:"qín sè zhī hào",且住为佳:"qiě zhù wéi jiā",切树倒根:"qiē shù dǎo gēn",切理餍心:"qiē lǐ yàn xīn",切近的当:"qiē jìn de dāng",翘足引领:"qiáo zú yǐn lǐng",巧发奇中:"qiǎo fā qí zhòng",强嘴拗舌:"jiàng zuǐ niù shé",强直自遂:"qiáng zhí zì suí",强死强活:"qiǎng sǐ qiǎng huó",强食自爱:"qiǎng shí zì ài",强食靡角:"qiǎng shí mí jiǎo",强弓劲弩:"qiáng gōng jìng nǔ",强聒不舍:"qiǎng guō bù shě",强凫变鹤:"qiáng fú biàn hè",强而后可:"qiǎng ér hòu kě",强得易贫:"qiǎng dé yì pín",遣兴陶情:"qiǎn xìng táo qíng",牵羊担酒:"qiān yáng dān jiǔ",千了百当:"qiān liǎo bǎi dàng",泣下如雨:"qì xià rú yǔ",起偃为竖:"qǐ yǎn wéi shù",岂弟君子:"kǎi tì jūn zǐ",綦溪利跂:"qí xī lì qí",棋输先著:"qí shū xiān zhuó",齐王舍牛:"qí wáng shě niú",欺天诳地:"qī tiān kuáng dì",普天率土:"pǔ tiān shuài tǔ",铺胸纳地:"pū xiōng nà dì",铺锦列绣:"pū jǐn liè xiù",破家为国:"pò jiā wèi guó",破觚为圜:"pò gū wéi yuán",萍飘蓬转:"píng piāo péng zhuàn",帡天极地:"píng tiān jí dì",屏声息气:"bǐng shēng xī qì",凭几据杖:"píng jī jù zhàng",贫嘴薄舌:"pín zuǐ bó shé",片语只辞:"piàn yǔ zhī cí",披发文身:"pī fà wén shēn",烹龙炮凤:"pēng lóng páo fèng",炰鳖脍鲤:"fǒu biē kuài lǐ",庞眉皓发:"páng méi hào fà",攀花折柳:"pān huā zhé liǔ",攀蟾折桂:"pān chán shé guì",女大难留:"nǚ dà nán liú",弄玉吹箫:"nòng yù chuī xiāo",弄管调弦:"nòng guǎn tiáo xián",弄粉调朱:"nòng fěn diào zhū",浓抹淡妆:"nóng mò dàn zhuāng",捻土为香:"niǎn tǔ wéi xiāng",年谊世好:"nián yì shì hǎo",年华垂暮:"nián huá chuí mù",儗不于伦:"nǐ bù yú lún",泥而不滓:"ní ér bù zǐ",能者为师:"néng zhě wéi shī",能不称官:"néng bú chèn guān",挠直为曲:"náo zhí wéi qū",难进易退:"nán jìn yì tuì",难得糊涂:"nán dé hú tú",南蛮鴂舌:"nán mán jué shé",南贩北贾:"nán fàn běi gǔ",牧猪奴戏:"mù zhū nú xì",目眢心忳:"mù yuān xīn tún",目挑心招:"mù tiǎo xīn zhāo",目量意营:"mù liàng yì yíng",木头木脑:"mù tóu mù nǎo",木干鸟栖:"mù gàn niǎo qī",侔色揣称:"móu sè chuǎi chèn",莫予毒也:"mò yú dú yě",抹粉施脂:"mò fěn shī zhī",磨砻镌切:"mó lóng juān qiē",磨棱刓角:"mó léng wán jiǎo",摸门不着:"mō mén bù zháo",摸不着边:"mō bù zhuó biān",命中注定:"mìng zhōng zhù dìng",鸣鹤之应:"míng hè zhī yìng",明效大验:"míng xiào dà yàn",名我固当:"míng wǒ gù dāng",邈处欿视:"miǎo chǔ kǎn shì",黾穴鸲巢:"měng xué qú cháo",绵里薄材:"mián lǐ bó cái",靡有孑遗:"mǐ yǒu jié yí",靡衣偷食:"mǐ yī tōu shí",迷恋骸骨:"mí liàn hái gǔ",扪参历井:"mén shēn lì jǐng",门单户薄:"mén dān hù bó",昧旦晨兴:"mèi dàn chén xīng",冒名接脚:"mào míng jiē jiǎo",毛遂堕井:"máo suí duò jǐng",毛发倒竖:"máo fā dǎo shù",卖文为生:"mài wén wéi shēng",卖李钻核:"mài lǐ zuān hé",买椟还珠:"mǎi dú huán zhū",埋三怨四:"mán sān yuàn sì",马入华山:"mǎ rù huá shān",落魄江湖:"luò pò jiāng hú",落落难合:"luò luò nán hé",落草为寇:"luò cǎo wéi kòu",罗织构陷:"luó zhī gòu xiàn",鸾凤和鸣:"luán fèng hè míng",率由旧章:"shuài yóu jiù zhāng",率土同庆:"shuài tǔ tóng qìng",率兽食人:"shuài shòu shí rén",率土归心:"shuài tǔ guī xīn",率马以骥:"shuài mǎ yǐ jì",率尔成章:"shuài ěr chéng zhāng",鲁斤燕削:"lǔ jīn yàn xuē",漏尽更阑:"lòu jìn gēng lán",笼鸟槛猿:"lóng niǎo jiàn yuán",笼鸟池鱼:"lóng niǎo chí yú",龙游曲沼:"lóng yóu qū zhǎo",龙血玄黄:"lóng xuè xuán huáng",龙雕凤咀:"lóng diāo fèng jǔ",六尺之讬:"liù chǐ zhī tuō",令原之戚:"líng yuán zhī qī",令人捧腹:"lìng rén pěng fù",陵劲淬砺:"líng jìng cuì lì",临敌易将:"lín dí yì jiàng",裂裳衣疮:"liè shang yī chuāng",裂冠毁冕:"liè guàn huǐ miǎn",了无惧色:"liǎo wú jù sè",了身达命:"liǎo shēn dá mìng",了然无闻:"liǎo rán wú wén",了不可见:"liǎo bù kě jiàn",了不长进:"liǎo bù zhǎng jìn",燎发摧枯:"liǎo fà cuī kū",审时度势:"shěn shí duó shì",量小力微:"liàng xiǎo lì wēi",相时度力:"xiāng shí duó lì",量枘制凿:"liàng ruì zhì záo",量如江海:"liàng rú jiāng hǎi",量金买赋:"liàng jīn mǎi fù",量己审分:"liàng jǐ shěn fēn",敛骨吹魂:"liǎn gǔ chuī hún",詈夷为跖:"lì yí wéi zhí",利令志惛:"lì lìng zhì hūn",李广不侯:"lǐ guǎng bú hòu",礼为情貌:"lǐ wéi qíng mào",礼让为国:"lǐ ràng wéi guó",犁生骍角:"lí shēng xīng jiǎo",离本徼末:"lí běn jiǎo mò",楞眉横眼:"léng méi hèng yǎn",擂天倒地:"léi tiān dǎo dì",累足成步:"lěi zú chéng bù",累瓦结绳:"lěi wǎ jié shéng",累土至山:"lěi tǔ zhì shān",累土聚沙:"lěi tǔ jù shā",累卵之危:"lěi luǎn zhī wēi",累累如珠:"lěi lěi rú zhū",累块积苏:"lěi kuài jī sū",乐山乐水:"lè shān lè shuǐ",潦原浸天:"lǎo yuán jìn tiān",老师宿儒:"lǎo shī xiǔ rú",牢什古子:"láo shí gǔ zi",琅嬛福地:"láng huán fú dì",揆情度理:"kuí qíng duó lǐ",旷日累时:"kuàng rì lěi shí",匡救弥缝:"kuāng jiù mí fèng",枯树生华:"kū shù shēng huā",口轻舌薄:"kǒu qīng shé bó",口角生风:"kǒu jiǎo shēng fēng",口角春风:"kǒu jiǎo chūn fēng",口角风情:"kǒu jiǎo fēng qíng",口干舌焦:"kǒu gān shé jiāo",口腹之累:"kǒu fù zhī lěi",空腹便便:"kōng fù pián pián",嗑牙料嘴:"kē yá liào zuǐ",刻木为鹄:"kè mù wéi hú",咳珠唾玉:"ké zhū tuò yù",咳唾成珠:"ké tuò chéng zhū",抗颜为师:"kàng yán wéi shī",开华结果:"kāi huā jié guǒ",峻阪盐车:"jùn bǎn yán chē",嚼铁咀金:"jiáo tiě jǔ jīn",嚼墨喷纸:"jué mò pēn zhǐ",倔头强脑:"juè tóu jiàng nǎo",倔头倔脑:"juè tóu juè nǎo",倦鸟知还:"juàn niǎo zhī huán",卷席而葬:"juǎn xí ér zàng",卷甲倍道:"juǎn jiǎ bèi dào",聚米为山:"jù mǐ wéi shān",举手相庆:"jǔ shǒu xiāng qìng",举世混浊:"jǔ shì hún zhuó",鞠为茂草:"jū wéi mào cǎo",拘神遣将:"jū shén qiǎn jiàng",居下讪上:"jū xià shàn shàng",久要不忘:"jiǔ yāo bú wàng",九转功成:"jiǔ zhuǎn gōng chéng",九蒸三熯:"jiǔ zhēng sān hàn",敬业乐群:"jìng yè lè qún",井底虾蟆:"jǐng dǐ xiā má",旌旗卷舒:"jīng qí juǎn shū",荆棘载途:"jīng jí zài tú",禁舍开塞:"jìn shě kāi sāi",祲威盛容:"jìn wēi shèng róng",进退消长:"jìn tuì xiāo cháng",进退应矩:"jìn tuì yīng jǔ",进退触籓:"jìn tuì chù fān",进退跋疐:"jìn tuì bá zhì",尽多尽少:"jǐn duō jǐn shǎo",锦囊还矢:"jǐn náng huán shǐ",矜己自饰:"jīn jǐ zì shì",矜功负气:"jīn gōng fù qì",津关险塞:"jīn guān xiǎn sài",金吾不禁:"jīn wú bú jìn",金翅擘海:"jīn chì bāi hǎi",解衣衣人:"jiě yī yī rén",解人难得:"jiě rén nán dé",解铃系铃:"jiě líng xì líng",解发佯狂:"jiě fà yáng kuáng",诘屈磝碻:"jié qū áo qiāo",教猱升木:"jiāo náo shēng mù",较瘦量肥:"jiào shòu liàng féi",角立杰出:"jiǎo lì jié chū",焦沙烂石:"jiāo shā làn shí",骄儿騃女:"jiāo ér sì nǚ",浇风薄俗:"jiāo fēng bó sú",降妖捉怪:"xiáng yāo zhuō guài",将取固予:"jiāng qǔ gù yǔ",将门有将:"jiàng mén yǒu jiàng",将夺固与:"jiāng duó gù yǔ",槛花笼鹤:"jiàn huā lóng hè",鉴影度形:"jiàn yǐng duó xíng",渐不可长:"jiàn bù kě zhǎng",见素抱朴:"xiàn sù bào pǔ",见弃于人:"jiàn qì yú rén",简丝数米:"jiǎn sī shǔ mǐ",俭不中礼:"jiǎn bú zhòng lǐ",间见层出:"jiàn xiàn céng chū",尖嘴薄舌:"jiān zuǐ bó shé",甲冠天下:"jiǎ guàn tiān xià",葭莩之亲:"jiā fú zhī qīn",家累千金:"jiā lèi qiān jīn",家给人足:"jiā jǐ rén zú",家道从容:"jiā dào cóng róng",夹袋人物:"jiā dài rén wù",霁风朗月:"jì fēng lǎng yuè",寄兴寓情:"jì xìng yù qíng",计深虑远:"jì shēn lǜ yuǎn",计功量罪:"jì gōng liàng zuì",掎裳连襼:"jǐ shang lián yì",虮虱相吊:"jǐ shī xiāng diào",疾不可为:"jí bù kě wéi",极深研几:"jí shēn yán jī",及宾有鱼:"jí bīn yǒu yú",激薄停浇:"jī bó tíng jiāo",积素累旧:"jī sù lěi jiù",积时累日:"jī shí lěi rì",积露为波:"jī lù wéi bō",积德累功:"jī dé lěi gōng",积谗糜骨:"jī chán méi gǔ",击排冒没:"jī pái mào mò",祸为福先:"huò wéi fú xiān",祸福相依:"huò fú xiāng yī",获隽公车:"huò jùn gōng chē",混应滥应:"hùn yīng làn yīng",毁舟为杕:"huǐ zhōu wéi duò",毁钟为铎:"huǐ zhōng wéi duó",毁冠裂裳:"huǐ guān liè cháng",晦盲否塞:"huì máng pǐ sè",回船转舵:"huí chuán zhuàn duò",潢池盗弄:"huáng chí dào nòng",黄冠草履:"huáng guàn cǎo lǚ",黄发儿齿:"huáng fà ér chǐ",黄发垂髫:"huáng fà chuí tiáo",还珠返璧:"huán zhū fǎn bì",还年驻色:"huán nián zhù sè",还年却老:"huán nián què lǎo",坏裳为裤:"huài shang wéi kù",画荻和丸:"huà dí huò wán",化枭为鸠:"huà xiāo wéi jiū",化腐为奇:"huà fǔ wéi qí",化鸱为凤:"huà chī wéi fèng",花不棱登:"huā bu lēng dēng",户限为穿:"hù xiàn wéi chuān",呼卢喝雉:"hū lú hè zhì",呼来喝去:"hū lái hè qù",呼不给吸:"hū bù jǐ xī",厚味腊毒:"hòu wèi xī dú",厚德载物:"hòu dé zài wù",鸿渐于干:"hóng jiàn yú gàn",洪炉燎发:"hóng lú liáo fà",红绳系足:"hóng shéng jì zú",红不棱登:"hóng bu lēng dēng",横抢硬夺:"hèng qiǎng yìng duó",横恩滥赏:"hèng ēn làn shǎng",恨海难填:"hèn hǎi nán tián",鹤发鸡皮:"hè fà jī pí",涸思干虑:"hé sī gān lǜ",河涸海干:"hé hé hǎi gān",和颜说色:"hé yán yuè sè",合从连衡:"hé zòng lián héng",浩浩汤汤:"hào hào shāng shāng",好勇斗狠:"hào yǒng dòu hěn",好问则裕:"hào wèn zé yù",好为事端:"hào wéi shì duān",好问决疑:"hào wèn jué yí",好生之德:"hào shēng zhī dé",好奇尚异:"hǎo qí shàng yì",好恶不同:"hǎo è bù tóng",好丹非素:"hào dān fēi sù",豪干暴取:"háo gàn bào qǔ",毫发不爽:"háo fà bù shuǎng",寒酸落魄:"hán suān luò pò",含英咀华:"hán yīng jǔ huá",含糊不明:"hán hú bù míng",过为已甚:"guò wéi yǐ shèn",桂折兰摧:"guì shé lán cuī",规旋矩折:"guī xuán jǔ shé",广文先生:"guǎng wén xiān sheng",广陵散绝:"guǎng líng sǎn jué",冠山戴粒:"guàn shān dài lì",冠屦倒施:"guàn jù dǎo shī",挂席为门:"guà xí wéi mén",寡见鲜闻:"guǎ jiàn xiǎn wén",瓜葛相连:"guā gé xiāng lián",鼓吻奋爪:"gǔ wěn fèn zhǎo",古调单弹:"gǔ diào dān tán",古调不弹:"gǔ diào bù tán",姑射神人:"gū yè shén rén",苟合取容:"gǒu hé qǔ róng",狗续侯冠:"gǒu xù hòu guàn",钩爪锯牙:"gōu zhǎo jù yá",共枝别干:"gòng zhī bié gàn",共为唇齿:"gòng wéi chún chǐ",拱手而降:"gǒng shǒu ér xiáng",拱肩缩背:"gǒng jiān suō bèi",功薄蝉翼:"gōng bó chán yì",弓调马服:"gōng diào mǎ fú",更姓改物:"gēng xìng gǎi wù",更仆难数:"gēng pú nán shǔ",更令明号:"gēng lìng míng hào",更待干罢:"gèng dài gàn bà",更唱迭和:"gēng chàng dié hé",更长梦短:"gēng cháng mèng duǎn",各色名样:"gè sè míng yàng",格格不纳:"gé gé bú nà",格格不吐:"gé gé bù tǔ",告朔饩羊:"gù shuò xì yáng",膏车秣马:"gào chē mò mǎ",高义薄云:"gāo yì bó yún",岗头泽底:"gāng tóu zé dǐ",敢为敢做:"gǎn wéi gǎn zuò",甘分随时:"gān fèn suí shí",甘处下流:"gān chǔ xià liú",干啼湿哭:"gàn tí shī kū",干名犯义:"gàn míng fàn yì",干将莫邪:"gān jiāng mò yé",干城之将:"gān chéng zhī jiàng",腹载五车:"fù zài wǔ chē",父债子还:"fù zhài zǐ huán",父为子隐:"fù wéi zǐ yǐn",辅世长民:"fǔ shì zhǎng mín",福为祸始:"fú wéi huò shǐ",符号逻辑:"fú hào luó jí",浮收勒折:"fú shōu lè shé",肤受之愬:"fū shòu zhī sù",否终则泰:"pǐ zhōng zé tài",佛头著粪:"fó tóu zhuó fèn",奉为楷模:"fèng wéi kǎi mó",凤靡鸾吪:"fèng mǐ luán é",封豨修蛇:"fēng xī xiū shé",风影敷衍:"fēng yǐng fū yǎn",丰屋蔀家:"fēng wū bù jiā",粪土不如:"fèn tǔ bù rú",分风劈流:"fēn fēng pǐ liú",沸沸汤汤:"fèi fèi shāng shāng",菲食薄衣:"fěi shí bó yī",飞将数奇:"fēi jiàng shù qí",放辟邪侈:"fàng pì xié chǐ",方领圆冠:"fāng lǐng yuán guàn",犯而不校:"fàn ér bú jiào",返本还源:"fǎn běn huán yuán",反劳为逸:"fǎn láo wéi yì",法轮常转:"fǎ lún cháng zhuàn",罚不当罪:"fá bù dāng zuì",发引千钧:"fà yǐn qiān jūn",发奸擿伏:"fā jiān tī fú",发短心长:"fà duǎn xīn cháng",二竖为虐:"èr shù wéi nüè",儿女心肠:"ér nǚ xīn cháng",儿女亲家:"ér nǚ qìng jiā",遏恶扬善:"è wù yáng shàn",饿殍枕藉:"è piǎo zhěn jí",饿殍载道:"è piǎo zài dào",恶醉强酒:"wù zuì qiǎng jiǔ",恶意中伤:"è yì zhòng shāng",恶湿居下:"wù shī jū xià",恶居下流:"wù jū xià liú",恶不去善:"wù bú qù shàn",扼吭夺食:"è háng duó shí",扼襟控咽:"è jīn kòng yān",峨峨汤汤:"é é shāng shāng",屙金溺银:"ē jīn niào yín",朵颐大嚼:"duǒ yí dà jiáo",夺人所好:"duó rén suǒ hào",多言数穷:"duō yán shuò qióng",多文为富:"duō wén wéi fù",多端寡要:"duō duān guǎ yào",多财善贾:"duō cái shàn gǔ",遁世无闷:"dùn shì wú mèn",遁迹黄冠:"dùn jì huáng guàn",堆案盈几:"duī àn yíng jī",断还归宗:"duàn huán guī zōng",短见薄识:"duǎn jiàn bó shí",蠹居棊处:"dù jū qí chǔ",度己以绳:"duó jǐ yǐ shéng",杜默为诗:"dù mò wéi shī",杜鹃啼血:"dù juān tí xuè",笃近举远:"dǔ jìn jǔ yuǎn",独有千秋:"dú yǒu qiān qiū",读书得间:"dú shū dé jiàn",斗转参横:"dǒu zhuǎn shēn héng",兜肚连肠:"dōu dǔ lián cháng",洞见症结:"dòng jiàn zhèng jié",恫疑虚喝:"dòng yí xū hè",动中窾要:"dòng zhōng kuǎn yào",东鸣西应:"dōng míng xī yīng",东鳞西爪:"dōng lín xī zhǎo",东量西折:"dōng liàng xī shé",东家西舍:"dōng jiā xī shè",东扯西拽:"dōng chě xī zhuāi",鼎铛有耳:"dǐng chēng yǒu ěr",鼎铛玉石:"dǐng chēng yù shí",钉头磷磷:"dīng tóu lín lín",跌宕不羁:"diē dàng bù jī",跌弹斑鸠:"diē dàn bān jiū",雕心雁爪:"diāo xīn yàn zhǎo",颠倒衣裳:"diān dǎo yī cháng",德薄能鲜:"dé bó néng xiǎn",得马折足:"dé mǎ shé zú",蹈其覆辙:"dǎo qí fù zhé",捣虚撇抗:"dǎo xū piē kàng",倒载干戈:"dào zài gān gē",倒裳索领:"dào cháng suǒ lǐng",倒果为因:"dào guǒ wéi yīn",叨在知己:"tāo zài zhī jǐ",叨陪末座:"tāo péi mò zuò",党豺为虐:"dǎng chái wéi nüè",当轴处中:"dāng zhóu chǔ zhōng",当着不着:"dāng zhuó bù zhuó",当务始终:"dāng wù shǐ zhōng",淡汝浓抹:"dàn rǔ nóng mǒ",弹丸脱手:"tán wán tuō shǒu",弹铗无鱼:"dàn jiá wú yú",箪食瓢饮:"dān sì piáo yǐn",大璞不完:"dà pú bù wán",大明法度:"dà míng fǎ dù",大车以载:"dà chē yǐ zài",打闷葫芦:"dǎ mèn hú lu",沓来踵至:"tà lái zhǒng zhì",厝火燎原:"cuò huǒ liǎo yuán",撮科打哄:"cuō kē dǎ hòng",寸积铢累:"cùn jī zhū lěi",啛啛喳喳:"cuì cuì chā chā",摧折豪强:"cuī zhé háo qiáng",摧刚为柔:"cuī gāng wéi róu",从俗就简:"cóng sú jiù jiǎn",此发彼应:"cǐ fā bǐ yīng",此唱彼和:"cǐ chàng bǐ hè",慈悲为本:"cí bēi wéi běn",纯属骗局:"chún shǔ piàn jú",春笋怒发:"chūn sǔn nù fā",垂头搨翼:"chuí tóu tà yì",传为笑谈:"chuán wéi xiào tán",传风扇火:"chuán fēng shān huǒ",穿红着绿:"chuān hóng zhuó lǜ",触处机来:"chù chǔ jī lái",处尊居显:"chǔ zūn jū xiǎn",处堂燕雀:"chǔ táng yàn què",处实效功:"chǔ shí xiào gōng",处高临深:"chǔ gāo lín shēn",出入无间:"chū rù wú jiān",出门应辙:"chū mén yīng zhé",出处语默:"chū chǔ yǔ mò",出处殊途:"chū chǔ shū tú",出处进退:"chū chǔ jìn tuì",愁山闷海:"chóu shān mèn hǎi",冲冠眦裂:"chōng guàn zì liè",齿牙为祸:"chǐ yá wéi huò",尺二冤家:"chǐ èr yuān jia",尺短寸长:"chǐ duǎn cùn cháng",尺寸之功:"chǐ cùn zhī gōng",城北徐公:"chéng běi xú gōng",成败兴废:"chéng bài xīng fèi",趁水和泥:"chèn shuǐ huò ní",称雨道晴:"chēng yǔ dào qíng",称体载衣:"chēng tǐ zài yī",称体裁衣:"chèn tǐ cái yī",称家有无:"chèn jiā yǒu wú",称德度功:"chēng dé duó gōng",沉吟章句:"chén yín zhāng jù",沉吟不决:"chén yín bù jué",沉疴宿疾:"chén kē sù jí",扯纤拉烟:"chě qiàn lā yān",扯顺风旗:"chě shùn fēng qí",车载船装:"chē zǎi chuán zhuāng",朝升暮合:"zhāo shēng mù gě",朝攀暮折:"zhāo pān mù shé",超今冠古:"chāo jīn guàn gǔ",倡而不和:"chàng ér bú hè",畅所欲为:"chàng suǒ yù wéi",苌弘碧血:"cháng hóng bì xiě",长幼尊卑:"zhǎng yòu zūn bēi",长绳系日:"cháng shéng jì rì",长年三老:"zhǎng nián sān lǎo",长春不老:"cháng chūn bù lǎo",长傲饰非:"zhǎng ào shì fēi",昌亭旅食:"chāng tíng lǚ shí",禅絮沾泥:"chán xù zhān ní",差三错四:"chā sān cuò sì",层台累榭:"céng tái lěi xiè",层见迭出:"céng xiàn dié chū",藏踪蹑迹:"cáng zōng niè jì",苍蝇见血:"cāng yíng jiàn xiě",餐松啖柏:"cān sōng dàn bó",骖风驷霞:"cān fēng sì xiá",参伍错综:"cēn wǔ cuò zōng",参辰卯酉:"shēn chén mǎo yǒu",材优干济:"cái yōu gān jǐ",材薄质衰:"cái bó zhì shuāi",才大难用:"cái dà nán yòng",才薄智浅:"cái bó zhì qiǎn",不足为意:"bù zú wéi yì",不足为据:"bù zú wéi jù",不足为法:"bù zú wéi fǎ",不足齿数:"bù zú chǐ shǔ",不着疼热:"bù zhuó téng rè",不知薡蕫:"bù zhī dǐng dǒng",不越雷池:"bú yuè léi chí",不相为谋:"bù xiāng wéi móu",不贪为宝:"bù tān wéi bǎo",不了而了:"bù liǎo ér liǎo",不可揆度:"bù kě kuí duó",不遑启处:"bù huáng qǐ chǔ",不当不正:"bù dāng bú zhèng",不差什么:"bú chà shén me",不差累黍:"bù chā lěi shǔ",擘两分星:"bò liǎng fēn xīng",簸土扬沙:"bǒ tǔ yáng shā",薄物细故:"bó wù xì gù",薄寒中人:"bó hán zhòng rén",博文约礼:"bó wén yuē lǐ",播糠眯目:"bō kāng mí mù",剥皮抽筋:"bō pí chōu jīn",剥肤椎髓:"bō fū chuí suǐ",波属云委:"bō zhǔ yún wěi",波骇云属:"bō hài yún zhǔ",兵微将寡:"bīng wēi jiàng guǎ",兵强将勇:"bīng qiáng jiàng yǒng",兵多将广:"bīng duō jiàng guǎng",兵不由将:"bīng bù yóu jiàng",冰解的破:"bīng jiě dì pò",彬彬济济:"bīn bīn jǐ jǐ",摽梅之年:"biào méi zhī nián",表里为奸:"biǎo lǐ wéi jiān",飙发电举:"biāo fā diàn jǔ",变贪厉薄:"biàn tān lì bó",敝盖不弃:"bì gài bú qì",秕言谬说:"bǐ yán miù shuō",比物属事:"bǐ wù zhǔ shì",被山带河:"pī shān dài hé",被甲枕戈:"pī jiǎ zhěn gē",被甲据鞍:"pī jiǎ jù ān",被褐怀玉:"pī hè huái yù",被发缨冠:"pī fà yīng guàn",背曲腰躬:"bèi qǔ yāo gōng",北窗高卧:"běi chuāng gāo wò",北辰星拱:"běi chén xīng gǒng",北鄙之音:"běi bǐ zhī yīn",卑宫菲食:"bēi gōng fěi shí",暴衣露冠:"pù yī lù guàn",暴腮龙门:"pù sāi lóng mén",暴露文学:"bào lù wén xué",暴虎冯河:"bào hǔ píng hé",抱蔓摘瓜:"bào wàn zhāi guā",抱法处势:"bào fǎ chǔ shì",褒贬与夺:"bāo biǎn yǔ duó",帮闲钻懒:"bāng xián zuān lǎn",拜将封侯:"bài jiàng fēng hóu",百兽率舞:"bǎi shòu shuài wǔ",百孔千创:"bǎi kǒng qiān chuāng",白衣卿相:"bái yī qīng xiàng",白首为郎:"bái shǒu wéi láng",白首相知:"bái shǒu xiāng zhī",把玩无厌:"bǎ wán wú yàn",拔锅卷席:"bá guō juǎn xí",拔本塞源:"bá běn sè yuán",傲不可长:"ào bù kě zhǎng",熬更守夜:"áo gēng shǒu yè",安时处顺:"ān shí chǔ shùn",安身为乐:"ān shēn wéi lè",安老怀少:"ān lǎo huái shào",安步当车:"ān bù dàng chē",爱人好士:"ài rén hào shì",矮人观场:"ǎi rén guān chǎng",捱风缉缝:"ái fēng jī fèng",挨山塞海:"āi shān sè hǎi",阿家阿翁:"ā jiā ā wēng",阿党相为:"ē dǎng xiāng wéi",追亡逐北:"zhuī wáng zhú běi",竹篮打水:"zhú lán dá shuǐ",知疼着热:"zhī téng zháo rè",语不惊人:"yǔ bù jīng rén",于今为烈:"yú jīn wéi liè",一日三省:"yí rì sān xǐng",穴居野处:"xué jū yě chǔ",五脊六兽:"wǔ jǐ liù shòu",无声无臭:"wú shēng wú xiù",谓予不信:"wèi yú bú xìn",舍身为国:"shě shēn wéi guó",杀妻求将:"shā qī qiú jiàng",强作解人:"qiǎng zuò jiě rén",气冲斗牛:"qì chōng dǒu niú",临深履薄:"lín shēn lǚ bó",钧天广乐:"jūn tiān guǎng yuè",艰难竭蹶:"jiān nán jié jué",夹七夹八:"jiā qī jiā bā",混混噩噩:"hún hún è è",厚古薄今:"hòu gǔ bó jīn",鬼怕恶人:"guǐ pà è rén",伽马射线:"gā mǎ shè xiàn",佛头着粪:"fó tóu zhuó fèn",奉为至宝:"fèng wéi zhì bǎo",登坛拜将:"dēng tán bài jiàng",晨昏定省:"chén hūn dìng xǐng",察察为明:"chá chá wéi míng",博闻强识:"bó wén qiáng zhì",避难就易:"bì nán jiù yì",了无生机:"liǎo wú shēng jī",有一说一:"yǒu yī shuō yī",独一无二:"dú yī wú èr",说一不二:"shuō yī bù èr",举一反三:"jǔ yī fǎn sān",数一数二:"shǔ yī shǔ èr",杀一儆百:"shā yī jǐng bǎi",丁一卯二:"dīng yī mǎo èr",丁一确二:"dīng yī què èr",不一而止:"bù yī ér zhǐ",无一幸免:"wú yī xìng miǎn",表里不一:"biǎo lǐ bù yī",良莠不一:"liáng yǒu bù yī",心口不一:"xīn kǒu bù yī",言行不一:"yán xíng bù yī",政令不一:"zhèng lìng bù yī",参差不一:"cēn cī bù yī",纷纷不一:"fēn fēn bù yī",毁誉不一:"huǐ yù bù yī",不一而三:"bù yī ér sān",百不一遇:"bǎi bù yī yù",言行抱一:"yán xíng bào yī",瑜百瑕一:"yú bǎi xiá yī",背城借一:"bèi chéng jiè yī",凭城借一:"píng chéng jiè yī",劝百讽一:"quàn bǎi fěng yī",群居和一:"qún jū hé yī",百不获一:"bǎi bù huò yī",百不失一:"bǎi bù shī yī",百无失一:"bǎi wú shī yī",万不失一:"wàn bù shī yī",万无失一:"wàn wú shī yī",合而为一:"hé ér wéi yī",合两为一:"hé liǎng wéi yī",合二为一:"hé èr wéi yī",天下为一:"tiān xià wéi yī",相与为一:"xiāng yǔ wéi yī",较若画一:"jiào ruò huà yī",较如画一:"jiào rú huà yī",斠若画一:"jiào ruò huà yī",言行若一:"yán xíng ruò yī",始终若一:"shǐ zhōng ruò yī",终始若一:"zhōng shǐ ruò yī",惟精惟一:"wéi jīng wéi yī",众多非一:"zhòng duō fēi yī",不能赞一:"bù néng zàn yī",问一答十:"wèn yī dá shí",一不扭众:"yī bù niǔ zhòng",一以贯之:"yī yǐ guàn zhī",一以当百:"yī yǐ dāng bǎi",百不当一:"bǎi bù dāng yī",十不当一:"shí bù dāng yī",以一警百:"yǐ yī jǐng bǎi",以一奉百:"yǐ yī fèng bǎi",以一持万:"yǐ yī chí wàn",以一知万:"yǐ yī zhī wàn",百里挑一:"bǎi lǐ tiāo yī",整齐划一:"zhěng qí huà yī",一来二去:"yī lái èr qù",一路公交:"yī lù gōng jiāo",一路汽车:"yī lù qì chē",一路巴士:"yī lù bā shì",朝朝朝落:"zhāo cháo zhāo luò",曲意逢迎:"qū yì féng yíng",一行不行:"yì háng bù xíng",行行不行:"háng háng bù xíng"},Nue=Object.keys(JT).map(e=>({zh:e,pinyin:JT[e],probability:2e-8,length:4,priority:wa.Normal,dict:Symbol("dict4")})),XT={巴尔干半岛:"bā ěr gàn bàn dǎo",巴尔喀什湖:"bā ěr kā shí hú",不幸而言中:"bú xìng ér yán zhòng",布尔什维克:"bù ěr shí wéi kè",何乐而不为:"hé lè ér bù wéi",苛政猛于虎:"kē zhèng měng yú hǔ",蒙得维的亚:"méng dé wéi dì yà",民以食为天:"mín yǐ shí wéi tiān",事后诸葛亮:"shì hòu zhū gě liàng",物以稀为贵:"wù yǐ xī wéi guì",先下手为强:"xiān xià shǒu wéi qiáng",行行出状元:"háng háng chū zhuàng yuan",亚得里亚海:"yà dé lǐ yà hǎi",眼不见为净:"yǎn bú jiàn wéi jìng",竹筒倒豆子:"zhú tǒng dào dòu zi"},Due=Object.keys(XT).map(e=>({zh:e,pinyin:XT[e],probability:2e-8,length:5,priority:wa.Normal,dict:Symbol("dict5")}));function eE(e,t){return e&&(e.decimalt.probability)?e:t}function tE(e){e.probability<1e-300&&(e.probability*=1e300,e.decimal+=1)}function Fue(e){return e.priority===wa.Custom?-(e.length*e.length*100):e.priority===wa.Surname?-(e.length*e.length*10):0}function Rue(e,t){const n=[];let i=e.length-1,o=e[i];for(let s=t-1;s>=0;s--){const r=s+1>=t?{probability:1,decimal:0,patterns:[]}:n[s+1];for(;o&&o.index+o.length-1===s;){const a=o.index,u={probability:o.probability*r.probability,decimal:r.decimal+Fue(o),patterns:r.patterns,concatPattern:o};tE(u),n[a]=eE(n[a],u),o=e[--i]}const l={probability:1e-13*r.probability,decimal:0,patterns:r.patterns};tE(l),n[s]=eE(n[s],l),n[s].concatPattern&&(n[s].patterns=n[s].patterns.concat(n[s].concatPattern),n[s].concatPattern=void 0,delete n[s+1])}return n[0].patterns.reverse()}function nE(e,t){return e&&e.count<=t.count?e:t}function Oue(e){return e.priority===wa.Custom?-(e.length*e.length*1e5):e.priority===wa.Surname?-(e.length*e.length*100):1}function Pue(e,t){const n=[];let i=e.length-1,o=e[i];for(let s=t-1;s>=0;s--){const r=s+1>=t?{count:0,patterns:[]}:n[s+1];for(;o&&o.index+o.length-1===s;){const a=o.index,u={count:Oue(o)+r.count,patterns:r.patterns,concatPattern:o};n[a]=nE(n[a],u),o=e[--i]}const l={count:1+r.count,patterns:r.patterns};n[s]=nE(n[s],l),n[s].concatPattern&&(n[s].patterns=n[s].patterns.concat(n[s].concatPattern),n[s].concatPattern=void 0,delete n[s+1])}return n[0].patterns.reverse()}function $ue(e,t){return!(t.index+t.length<=e.index||t.priority>e.priority||t.priority===e.priority&&t.length>e.length)}function Bue(e){const t=[];for(let n=e.length-1;n>=0;){const{index:i}=e[n];let o=n-1;for(;o>=0&&$ue(e[n],e[o]);)o--;(o<0||e[o].index+e[o].length<=i)&&t.push(e[n]),n=o}return t.reverse()}var iE;(function(e){e[e.ReverseMaxMatch=1]="ReverseMaxMatch",e[e.MaxProbability=2]="MaxProbability",e[e.MinTokenization=3]="MinTokenization"})(iE||(iE={}));class oE{constructor(t,n="",i=""){this.children=new Map,this.fail=null,this.patterns=[],this.parent=t,this.prefix=n,this.key=i}}class zue{constructor(){this.dictMap=new Map,this.queues=[],this.root=new oE(null)}build(t){this.buildTrie(t),this.buildFailPointer()}buildTrie(t){for(let n of t){const i=OC(n.zh);let o=this.root;for(let s=0;s{t=t.concat(i)}),this.queues=[];t.length>n;){let i=t[n++],o=i.parent&&i.parent.fail,s=i.key;for(;o&&!o.children.has(s);)o=o.fail;o?i.fail=o.children.get(s):i.fail=this.root}}addPatternToDictMap(t){this.dictMap.has(t.dict)||this.dictMap.set(t.dict,new Set),this.dictMap.get(t.dict).add(t)}addNodeToQueues(t){this.queues[fu(t.prefix)]||(this.queues[fu(t.prefix)]=[]),this.queues[fu(t.prefix)].push(t)}insertPattern(t,n){for(let i=t.length-1;i>=0;i--){const o=t[i];if(n.priority===o.priority&&n.probability>=o.probability)t[i+1]=o;else if(n.priority>o.priority)t[i+1]=o;else{t[i+1]=n;return}}t[0]=n}removeDict(t){this.dictMap.has(t)&&(this.dictMap.get(t).forEach(i=>{i.node.patterns=i.node.patterns.filter(o=>o!==i)}),this.dictMap.delete(t))}match(t,n){let i=this.root,o=[];const s=OC(t);for(let r=0;rn==="off"?c.priority!==wa.Surname:n==="head"?c.length-1-r===0:!0);a&&o.push(Object.assign(Object.assign({},a),{index:r-a.length+1}));let u=i.fail;for(;u!==null;){const c=u.patterns.find(d=>n==="off"?d.priority!==wa.Surname:n==="head"?d.length-1-r===0:!0);c&&o.push(Object.assign(Object.assign({},c),{index:r-c.length+1})),u=u.fail}}}return o}search(t,n,i=2){const o=this.match(t,n);return i===1?Bue(o):i===3?Pue(o,fu(t)):Rue(o,fu(t))}}const jue=[...Due,...Nue,...Lue,...Eue,..._ue,...Tue],uj=new zue;uj.build(jue);const Hue=new lj,Wue=()=>Hue,que=[];function Uue(){return que}const Gg=e=>{const t=hf.get(e);return t?t.split(" ")[0]:e},Vue=e=>{const t=[],n=Uue();for(let i=0;i{const s=o?Vue(e):e,r=uj.search(s,n,i);let l=0;const a=OC(e);for(let u=0;ue.replace(/(ā|á|ǎ|à)/g,"a").replace(/(ō|ó|ǒ|ò)/g,"o").replace(/(ē|é|ě|è)/g,"e").replace(/(ī|í|ǐ|ì)/g,"i").replace(/(ū|ú|ǔ|ù)/g,"u").replace(/(ǖ|ǘ|ǚ|ǜ)/g,"ü").replace(/(n̄|ń|ň|ǹ)/g,"n").replace(/(m̄|ḿ|m̌|m̀)/g,"m").replace(/(ê̄|ế|ê̌|ề)/g,"ê"),cj=(e,t="off")=>{const n=Wue();let i=hf.get(e)?hf.get(e).split(" "):[];if(n.get(e))i=n.get(e).split(" ");else if(t!=="off"){const o=PC[e];o&&(i=[o].concat(i.filter(s=>s!==o)))}return i},Zue=(e,t="off")=>{let n=cj(e,t);return n.length>0?n.map(i=>({origin:e,result:i,isZh:!0,originPinyin:i})):[{origin:e,result:e,isZh:!1,originPinyin:e}]},_k=(e,t)=>{const n=e.split(" "),i=[],o=[];for(let s of n)for(let r of bue)if(s.startsWith(r)){let l=s.slice(r.length);wue.indexOf(r)!==-1&&Cue.indexOf(l)!==-1&&(l=Aue[l]),i.push(r),o.push(l);break}return t==="standard"&&i.forEach((s,r)=>{(s==="y"||s==="w")&&(i[r]="")}),{final:o.join(" "),initial:i.join(" ")}},f9=e=>{const{final:t}=_k(e);let n="",i="",o="";return xue.indexOf(h4(t))!==-1?(n=t[0],i=t[1],o=t.slice(2)):(i=t[0]||"",o=t.slice(1)||""),{head:n,body:i,tail:o}},p4=e=>{const t=/(ā|ō|ē|ī|ū|ǖ|n̄|m̄|ê̄)/,n=/(á|ó|é|í|ú|ǘ|ń|ḿ|ế)/,i=/(ǎ|ǒ|ě|ǐ|ǔ|ǚ|ň|m̌|ê̌)/,o=/(à|ò|è|ì|ù|ǜ|ǹ|m̀|ề)/,s=/(a|o|e|i|u|ü|ê)/,r=/(n|m)$/,l=[];return e.split(" ").forEach(u=>{t.test(u)?l.push("1"):n.test(u)?l.push("2"):i.test(u)?l.push("3"):o.test(u)?l.push("4"):s.test(u)||r.test(u)?l.push("0"):l.push("")}),l.join(" ")},Gue=(e,t)=>{const n=h4(e).split(" "),i=p4(t).split(" "),o=[];return n.forEach((s,r)=>{o.push(`${s}${i[r]}`)}),o.join(" ")},dj=(e,t)=>{const n=[];return e.split(" ").forEach(o=>{n.push(t?o[0]:o)}),n.join(" ")};function Que(e,t,n){if(Mue.indexOf(e)===-1)return Gg(e);if(t===n&&t&&Gg(t)!==t)return h4(Gg(e));if(n&&!Iue[e].includes(n)){const i=Gg(n);if(i!==n){const o=p4(i),s=aj[e];for(let r in s)if(s[r].indexOf(Number(o))!==-1)return r}}}function Yue(e,t){if(e==="了"&&(!t||!hf.get(t)))return"liǎo"}function Jue(e,t){if(e==="々")return!t||!hf.get(t)?"tóng":hf.get(t).split(" ")[0]}function sE(e,t,n){return Jue(e,t)||Yue(e,t)||Que(e,t,n)||Gg(e)}const Xue=e=>typeof e!="string"?(console.error("The first param of pinyin is error: "+e+' is not assignable to type "string".'),!1):!0;function g8(e,t){return t instanceof RegExp?t.test(e):!0}const ece=(e,t)=>{let n=t.nonZh;if(n==="removed")return e.filter(i=>i.isZh||!g8(i.origin,t.nonZhScope));if(n==="consecutive"){for(let i=e.length-2;i>=0;i--){const o=e[i],s=e[i+1];!o.isZh&&!s.isZh&&g8(o.origin,t.nonZhScope)&&g8(s.origin,t.nonZhScope)&&(o.origin+=s.origin,o.result+=s.result,s.delete=!0)}return e.filter(i=>!i.delete)}else return e},rE=(e,t)=>fu(e)===1&&t.multiple?Zue(e,t.surname):!1,tce=(e,t)=>{switch(t.pattern){case"pinyin":break;case"num":e.forEach(n=>{n.result=n.isZh?p4(n.result):""});break;case"initial":e.forEach(n=>{n.result=n.isZh?_k(n.result,t.initialPattern).initial:""});break;case"final":e.forEach(n=>{n.result=n.isZh?_k(n.result,t.initialPattern).final:""});break;case"first":e.forEach(n=>{n.result=dj(n.result,n.isZh)});break;case"finalHead":e.forEach(n=>{n.result=n.isZh?f9(n.result).head:""});break;case"finalBody":e.forEach(n=>{n.result=n.isZh?f9(n.result).body:""});break;case"finalTail":e.forEach(n=>{n.result=n.isZh?f9(n.result).tail:""});break}},nce=(e,t)=>{switch(t.toneType){case"symbol":break;case"none":e.forEach(n=>{n.isZh&&(n.result=h4(n.result))});break;case"num":{e.forEach(n=>{n.isZh&&(n.result=Gue(n.result,n.originPinyin))});break}}},ice=(e,t)=>{t.v&&e.forEach(n=>{n.isZh&&(n.result=n.result.replace(/ü/g,typeof t.v=="string"?t.v:"v"))})},oce=(e,t,n)=>{if(t.multiple&&fu(n)===1){let i="";e=e.filter(o=>{const s=o.result!==i;return i=o.result,s})}return t.type==="array"?e.map(i=>i.result):t.type==="all"?e.map(i=>{const o=i.isZh?i.result:"",{initial:s,final:r}=_k(o,t.initialPattern),{head:l,body:a,tail:u}=f9(o);let c=[];return o!==""&&(c=[o].concat(cj(i.origin,t.surname).filter(d=>d!==o))),{origin:i.origin,pinyin:o,initial:s,final:r,first:dj(i.result,i.isZh),finalHead:l,finalBody:a,finalTail:u,num:Number(p4(i.originPinyin)),isZh:i.isZh,polyphonic:c,inZhRange:!!hf.get(i.origin),result:i.result}}):e.map(i=>i.result).join(t.separator)},sce=(e,t)=>(t===!1&&e.forEach(n=>{n.origin==="一"?n.result=n.originPinyin="yī":n.origin==="不"&&(n.result=n.originPinyin="bù")}),e),rce={pattern:"pinyin",toneType:"symbol",type:"string",multiple:!1,mode:"normal",removeNonZh:!1,nonZh:"spaced",v:!1,separator:" ",toneSandhi:!0,segmentit:2};function Ik(e,t){if(t=Object.assign(Object.assign({},rce),t||{}),!Xue(e))return e;if(e==="")return t.type==="array"||t.type==="all"?[]:"";t.surname===void 0&&(t.mode==="surname"?t.surname="all":t.surname="off"),t.type==="all"&&(t.pattern="pinyin"),t.pattern==="num"&&(t.toneType="none"),t.removeNonZh&&(t.nonZh="removed");let i=Array(fu(e)),{list:o}=Kue(e,i,t.surname,t.segmentit,t.traditional);return o=sce(o,t.toneSandhi),o=ece(o,t),rE(e,t)&&(o=rE(e,t)),tce(o,t),nce(o,t),ice(o,t),oce(o,t,e)}var $C;(function(e){e[e.AllSegment=1]="AllSegment",e[e.AllArray=2]="AllArray",e[e.AllString=3]="AllString",e[e.PinyinSegment=4]="PinyinSegment",e[e.PinyinArray=5]="PinyinArray",e[e.PinyinString=6]="PinyinString",e[e.ZhSegment=7]="ZhSegment",e[e.ZhArray=8]="ZhArray",e[e.ZhString=9]="ZhString"})($C||($C={}));$C.AllSegment;const fj=[{name:"/new",desc:"commands.new.desc",noArgs:!0},{name:"/clear",desc:"commands.clear.desc",noArgs:!0},{name:"/login",desc:"commands.login.desc",noArgs:!0},{name:"/plan",desc:"commands.plan.desc"},{name:"/swarm",desc:"commands.swarm.desc"},{name:"/goal",desc:"commands.goal.desc"},{name:"/btw",desc:"commands.btw.desc",acceptsInput:!0},{name:"/compact",desc:"commands.compact.desc",acceptsInput:!0},{name:"/undo",desc:"commands.undo.desc",noArgs:!0},{name:"/fork",desc:"commands.fork.desc",noArgs:!0},{name:"/export",desc:"commands.export.desc",noArgs:!0},{name:"/status",desc:"commands.status.desc",noArgs:!0}];function BC(e){if(!e.startsWith("/"))return null;const t=e.indexOf(" ");return t===-1?{cmd:e,arg:""}:{cmd:e.slice(0,t),arg:e.slice(t+1)}}const sc="skill:";function lce(e,t){const n=e.find(r=>r.name===t);if(n!==void 0)return n;const i=`/${sc}${t.slice(1)}`,o=e.find(r=>r.name===i);if(o!==void 0)return o;if(!t.startsWith(`/${sc}`))return;const s=t.slice(1+sc.length);if(!(s.length===0||s.includes(" ")))return e.find(r=>r.isSkill===!0&&m4(r.name)===s)}function m4(e){const t=e.startsWith("/")?e.slice(1):e;return t.startsWith(sc)?t.slice(sc.length):t}function ace(e,t,n){for(const i of[`/${sc}${t}`,`/${t}`]){if(e===i)return;if(e.startsWith(`${i} `))return e.slice(i.length+1).trim()||void 0}return(n??"").trim()||void 0}function hj(e=[]){const t=e.map(n=>({name:n.source==="builtin"?`/${n.name}`:`/${sc}${n.name}`,desc:n.description,isSkill:!0,acceptsInput:!0}));return[...fj,...t]}const lE=new Map;function pj(e){let t=lE.get(e);if(!t){const n=Ik(e,{toneType:"none",type:"array"}),i=Ik(e,{pattern:"first",toneType:"none",type:"array"});t=uce(e,n,i),lE.set(e,t)}return t}const aE={full:[],first:[],offsets:[],literal:[]};function uce(e,t,n){if(t.length!==n.length)return aE;const i=[],o=[];let s=0;for(let r=0;r0&&e.slice(s,s+l.length).toLowerCase()===l.toLowerCase()?(o.push(!0),s+=l.length):(o.push(!1),s+=Array.from(e.slice(s))[0]?.length??0)}return i.push(s),s!==e.length?aE:{full:t,first:n,offsets:i,literal:o}}function zC(e,t,n,i){const o=e[t];let s=0,r=-1,l=-1,a=0,u=0;for(let h=0;h=0)return zC(i,"first",o,o+t.length);const s=i.full.join("").indexOf(t);if(!(s<0))return zC(i,"full",s,s+t.length)}function pce(e,t,n){const i=e.trim().replace(/^\//,"").toLowerCase();if(i==="")return{};const o=fce(t,i),s=hce(n,i);return{name:o?[o]:void 0,desc:s?[s]:void 0}}const mce={keys:[{name:"name",weight:3},{name:"desc",weight:1},{name:"pinyinFull",weight:1},{name:"pinyinFirst",weight:1}],includeScore:!0,includeMatches:!0,ignoreLocation:!0,threshold:.4};function gce(e,t){const n=e.toLowerCase(),i=t.toLowerCase();return n===i?0:n.startsWith(i)?1:2}function cE(e){const t=[...e].sort((i,o)=>i[0]-o[0]),n=[];for(const i of t){const o=n[n.length-1];o&&i[0]<=o[1]?o[1]=Math.max(o[1],i[1]):n.push([...i])}return n}function vce(e,t){const n=[],i=[];for(const o of t??[])for(const[s,r]of o.indices)if(o.key==="name")n.push([s+1,r+2]);else if(o.key==="desc")i.push([s,r+1]);else if(o.key==="pinyinFirst"||o.key==="pinyinFull"){const l=zC(pj(e.desc),o.key==="pinyinFirst"?"first":"full",s,r+1);l&&i.push(l)}return{name:n.length>0?cE(n):void 0,desc:i.length>0?cE(i):void 0}}function yce(e,t=fj,n=i=>i.desc){const i=e.trim().replace(/^\//,"");if(i==="")return t.map(s=>({item:s,ranges:{}}));const o=t.map((s,r)=>{const l=n(s),a=cce(l);return{index:r,item:s,name:s.name.replace(/^\//,""),desc:l,pinyinFull:a.full,pinyinFirst:a.first}});return new gue(o,mce).search(i).map(({item:s,score:r,matches:l})=>({doc:s,score:r??1,rank:gce(s.name,i),ranges:vce(s,l)})).sort((s,r)=>s.rank!==r.rank?s.rank-r.rank:s.score!==r.score?s.score-r.score:s.doc.index-r.doc.index).map(({doc:s,ranges:r})=>({item:s.item,ranges:r}))}function kce(e,t,n,i,o){const s=n-o-(t.right+i),r=t.left-i-o,l=e>s&&r>s,a=Math.min(e,l?r:s);return{left:l?t.left-i-a:t.right+i,maxWidth:a,flipped:l}}let bce=0;function wce(e,t){const n=++bce;return e.pendingSwarmBySession[t]=n,n}function R7(e,t,n){return n===void 0||e.pendingSwarmBySession[t]!==n?!1:(delete e.pendingSwarmBySession[t],!0)}function jC(e,t,n){e.pendingSwarmBySession[t]===void 0&&(e.swarmModeBySession[t]=n)}function dE(e,t){const n=new Set(e.map(u=>u.id)),i=t.filter(u=>u.kind==="subagent"&&!n.has(u.id));if(i.length===0)return e;const o=new Map(e.map(u=>[u.id,u])),s=new Map(e.filter(u=>u.kind==="subagent"&&u.agentId!==void 0).map(u=>[u.agentId,u])),r=new Set,l=i.map(u=>{const c=u.backgroundTaskId!==void 0?o.get(u.backgroundTaskId):void 0,d=s.get(u.agentId??u.id),h=(d?.status==="running"&&c?.status!=="running"?d:c)??d;if(h===void 0)return u;r.add(h.id);const p=u.status==="running"&&h.status!=="running";return{...u,status:u.status==="running"?h.status:u.status,subagentPhase:p?h.status==="completed"?"completed":"failed":u.subagentPhase,completedAt:h.completedAt??u.completedAt,completedAtEstimated:h.completedAt!==void 0?void 0:u.completedAtEstimated,outputPreview:h.outputPreview??u.outputPreview,outputBytes:h.outputBytes??u.outputBytes,model:u.model??h.model,thinkingEffort:u.thinkingEffort??h.thinkingEffort,backgroundTaskId:h.id}});return[...e.filter(u=>!r.has(u.id)),...l]}function Cce(){if(typeof navigator>"u")return!1;if(/Mac|iPod|iPhone|iPad/.test(navigator.platform))return!0;const e=navigator.userAgentData;return e?.platform==="macOS"||e?.platform==="iOS"}function Ace(e,t=Cce()){return(t?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey)&&!e.altKey&&!e.shiftKey&&(e.code==="KeyF"||e.key.toLowerCase()==="f")&&!e.defaultPrevented}const xce=new Map([["ς","σ"],["ß","ss"],["ſ","s"],["ff","ff"],["fi","fi"],["fl","fl"],["ffi","ffi"],["ffl","ffl"],["ſt","st"],["st","st"],["ʼn","ʼn"],["µ","μ"],["K","k"],["Å","å"],["Ω","ω"]]);function Sce(e){return e==="pre"||e==="pre-wrap"||e==="break-spaces"?"preserve":e==="pre-line"?"pre-line":"collapse"}function _ce(e,t){if(t==="preserve")return{text:e,map:Array.from({length:e.length},(r,l)=>l)};const n=t==="collapse"?/[\t\n\f\r ]/:/[\t ]/;let i="";const o=[];let s=!1;for(let r=0;rfE(c.text)),i="\0";let o="";const s=[];for(let c=0;c0&&e[c].gapBefore&&(o+=i),s[c]=o.length,o+=n[c].folded;const r=Tce(fE(t).folded);if(r===null)return;const l=new RegExp(r,"g");function a(c){let d=0,h=s.length-1,p=0;for(;d<=h;){const m=d+h>>1;s[m]<=c?(p=m,d=m+1):h=m-1}return p}let u;for(;;){const c=l.exec(o);if(c===null)return;const d=c.index,h=d+c[0].length-1,p=a(d),m=a(h),g=n[p].map[d-s[p]],y=n[m].map[h-s[m]],b={startSeg:p,startOffset:g.start,endSeg:m,endOffset:y.start+y.length};u!==void 0&&u.startSeg===b.startSeg&&u.startOffset===b.startOffset&&u.endSeg===b.endSeg&&u.endOffset===b.endOffset||(u=b,yield b)}}const Mce=/[.*+?^${}()|[\]\\]/g;function Tce(e){const t=[];let n=0;for(;n=Fce)return{ranges:a,truncated:!0};a.push(h)}}return{ranges:a,truncated:!1}}const gj="kimi-transcript-search",HC="kimi-transcript-search-current";function vj(){return globalThis.CSS?.highlights??null}function v8(e,t){const n=vj(),i=globalThis.Highlight;if(!n||!i)return;if(e.length===0){WC();return}const o=new i;for(const r of e)o.add(r);n.set(gj,o);const s=e[t];if(s!==void 0){const r=new i;r.add(s),n.set(HC,r)}else n.delete(HC)}function WC(){const e=vj();e?.delete(gj),e?.delete(HC)}let yj=null;function Oce(e){e!==null&&(yj=e)}let pE=0,ry=null;async function Mk(e){const t=++pE,n=(async()=>{const o=await e();t===pE&&Oce(o)})(),i=(async()=>{await n,ry!==null&&ry.seq>t&&await ry.promise})();return ry={seq:t,promise:i},i}let kj=null;function Pce(e){kj=e}const $ce=5e3;function Bce(e){return Promise.race([e(),new Promise(t=>{setTimeout(()=>t(null),$ce)})])}function ly(){return`${yj==="global"?"https://www.kimi.ai":"https://www.kimi.com"}/code?from=${yp?"kimi_code_desktop":"kimi_code_web"}`}function Xv(){const e=kj;if(e===null){window.open(ly(),"_blank","noopener");return}const t=()=>Bce(e);if(yp){Mk(t).then(()=>{window.open(ly(),"_blank","noopener")});return}const n=window.open("","_blank");if(n===null){window.open(ly(),"_blank","noopener");return}try{n.opener=null}catch{}Mk(t).then(()=>{try{n.location.href=ly()}catch{}})}function zce(e,t,n){if(e.length===0)return null;const i=new Set(e),o=t.filter(r=>i.has(r)),s=e.filter(r=>!t.includes(r));return s.length===0&&o.length===t.length?null:t.length===0&&n!==void 0?s.toSorted((r,l)=>(n.get(l)??Number.NEGATIVE_INFINITY)-(n.get(r)??Number.NEGATIVE_INFINITY)):[...s,...o]}function jce(e,t){const n=new Map(t.map((i,o)=>[i,o]));return e.toSorted((i,o)=>(n.get(i.id)??-1)-(n.get(o.id)??-1))}function Hce(e,t,n,i="before"){const o=e.indexOf(t),s=e.indexOf(n);if(o===-1||s===-1||o===s)return e;const r=[...e];r.splice(o,1);const l=o(t.get(i.id)??Number.NEGATIVE_INFINITY)-(t.get(n.id)??Number.NEGATIVE_INFINITY))}function qce(e,t){let n=!1;const i={...e};for(const[o,s]of t)s>(i[o]??Number.NEGATIVE_INFINITY)&&(i[o]=s,n=!0);return{next:i,changed:n}}function Uce(e,t){const n=new Map;for(const i of e){if(i.parentSessionId||i.archived)continue;const o=new Date(i.updatedAt).getTime();if(Number.isNaN(o))continue;const s=t(i);o>(n.get(s)??Number.NEGATIVE_INFINITY)&&n.set(s,o)}return n}function Vce(e,t){const n=new Map;for(const i of e){const o=t[i.id]??Number.NEGATIVE_INFINITY,s=i.lastOpenedAt?Date.parse(i.lastOpenedAt):Number.NaN,r=Number.isNaN(s)?Number.NEGATIVE_INFINITY:s;n.set(i.id,Math.max(o,r))}return n}function Kce(e,t){const n=Object.keys(e);if(!n.some(o=>!t.has(o)))return{next:e,changed:!1};const i={};for(const o of n)t.has(o)&&(i[o]=e[o]);return{next:i,changed:!0}}const Zce=5;function Gce(e,t,n,i=Zce){if(e.length<=i)return e;const o=e.slice(0,i);if(t&&!o.some(s=>s.id===t)){const s=e.find(r=>r.id===t);s&&(o[i-1]=s)}return o}const Qce={class:"error-boundary-title"},Yce=dt({__name:"ErrorBoundary",props:{closable:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1}},emits:["close"],setup(e,{emit:t}){const n=t,{t:i}=Jt(),o=q(!1);D$(()=>{o.value=!0});function s(){o.value=!1}return(r,l)=>o.value?(k(),L("div",{key:1,class:Pe(["error-boundary",{fullscreen:e.fullscreen}]),role:"alert"},[e.closable?(k(),ce(f(fn),{key:0,class:"error-boundary-close",size:"sm",label:f(i)("common.close"),tooltip:f(i)("common.close"),onClick:l[0]||(l[0]=a=>n("close"))},{default:ae(()=>[U(f(Ae),{name:"close",size:"sm"})]),_:1},8,["label","tooltip"])):J("",!0),U(f(Ae),{class:"error-boundary-icon",name:"alert-triangle",size:"lg"}),_("p",Qce,P(f(i)("common.errorBoundaryTitle")),1),U(f(nn),{size:"sm",onClick:s},{default:ae(()=>[He(P(f(i)("common.errorBoundaryRetry")),1)]),_:1})],2)):Gn(r.$slots,"default",{key:0},void 0,!0)}}),bj=Lt(Yce,[["__scopeId","data-v-3fe116a9"]]);var Jce=Object.create,O7=Object.defineProperty,Xce=Object.getOwnPropertyDescriptor,wj=Object.getOwnPropertyNames,ede=Object.getPrototypeOf,tde=Object.prototype.hasOwnProperty,Cj=(e,t)=>function(){return t||(0,e[wj(e)[0]])((t={exports:{}}).exports,t),t.exports},nde=e=>{let t={};for(var n in e)O7(t,n,{get:e[n],enumerable:!0});return t},ide=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(var o=wj(t),s=0,r=o.length,l;st[a]).bind(null,l),enumerable:!(i=Xce(t,l))||i.enumerable});return e},Aj=(e,t,n)=>(n=e!=null?Jce(ede(e)):{},ide(O7(n,"default",{value:e,enumerable:!0}),e));function ode(e,t,n,i){const o=Number(e[t].meta.id+1).toString();let s="";return typeof i.docId=="string"&&(s=`-${i.docId}-`),s+o}function sde(e,t){let n=Number(e[t].meta.id+1).toString();return e[t].meta.subId>0&&(n+=`:${e[t].meta.subId}`),`[${n}]`}function rde(e,t,n,i,o){const s=o.rules.footnote_anchor_name(e,t,n,i,o),r=o.rules.footnote_caption(e,t,n,i,o);let l=s;return e[t].meta.subId>0&&(l+=`:${e[t].meta.subId}`),`${r}`}function lde(e,t,n){return(n.xhtmlOut?`
-`:`
-`)+`
-
    -`}function ade(){return`
-
-`}function ude(e,t,n,i,o){let s=o.rules.footnote_anchor_name(e,t,n,i,o);return e[t].meta.subId>0&&(s+=`:${e[t].meta.subId}`),`
  • `}function cde(){return`
  • -`}function dde(e,t,n,i,o){let s=o.rules.footnote_anchor_name(e,t,n,i,o);return e[t].meta.subId>0&&(s+=`:${e[t].meta.subId}`),` ↩︎`}function fde(e){const t=e.helpers.parseLinkLabel,n=e.utils.isSpace;e.renderer.rules.footnote_ref=rde,e.renderer.rules.footnote_block_open=lde,e.renderer.rules.footnote_block_close=ade,e.renderer.rules.footnote_open=ude,e.renderer.rules.footnote_close=cde,e.renderer.rules.footnote_anchor=dde,e.renderer.rules.footnote_caption=sde,e.renderer.rules.footnote_anchor_name=ode;function i(l,a,u,c){const d=l.bMarks[a]+l.tShift[a],h=l.eMarks[a];if(d+4>h||l.src.charCodeAt(d)!==91||l.src.charCodeAt(d+1)!==94)return!1;let p;for(p=d+2;p=h||l.src.charCodeAt(++p)!==58)return!1;if(c)return!0;p++,l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.refs||(l.env.footnotes.refs={});const m=l.src.slice(d+2,p-2);l.env.footnotes.refs[`:${m}`]=-1;const g=new l.Token("footnote_reference_open","",1);g.meta={label:m},g.level=l.level++,l.tokens.push(g);const y=l.bMarks[a],b=l.tShift[a],v=l.sCount[a],C=l.parentType,w=p,M=l.sCount[a]+p-(l.bMarks[a]+l.tShift[a]);let N=M;for(;p=u||l.src.charCodeAt(c)!==94||l.src.charCodeAt(c+1)!==91)return!1;const d=c+2,h=t(l,c+1);if(h<0)return!1;if(!a){l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.list||(l.env.footnotes.list=[]);const p=l.env.footnotes.list.length,m=[];l.md.inline.parse(l.src.slice(d,h),l.md,l.env,m);const g=l.push("footnote_ref","",0);g.meta={id:p},l.env.footnotes.list[p]={content:l.src.slice(d,h),tokens:m}}return l.pos=h+1,l.posMax=u,!0}function s(l,a){const u=l.posMax,c=l.pos;if(c+3>u||!l.env.footnotes||!l.env.footnotes.refs||l.src.charCodeAt(c)!==91||l.src.charCodeAt(c+1)!==94)return!1;let d;for(d=c+2;d=u)return!1;d++;const h=l.src.slice(c+2,d-1);if(typeof l.env.footnotes.refs[`:${h}`]>"u")return!1;if(!a){l.env.footnotes.list||(l.env.footnotes.list=[]);let p;l.env.footnotes.refs[`:${h}`]<0?(p=l.env.footnotes.list.length,l.env.footnotes.list[p]={label:h,count:0},l.env.footnotes.refs[`:${h}`]=p):p=l.env.footnotes.refs[`:${h}`];const m=l.env.footnotes.list[p].count;l.env.footnotes.list[p].count++;const g=l.push("footnote_ref","",0);g.meta={id:p,subId:m,label:h}}return l.pos=d,l.posMax=u,!0}function r(l){let a,u,c,d=!1;const h={};if(!l.env.footnotes||(l.tokens=l.tokens.filter(function(m){return m.type==="footnote_reference_open"?(d=!0,u=[],c=m.meta.label,!1):m.type==="footnote_reference_close"?(d=!1,h[":"+c]=u,!1):(d&&u.push(m),!d)}),!l.env.footnotes.list))return;const p=l.env.footnotes.list;l.tokens.push(new l.Token("footnote_block_open","",1));for(let m=0,g=p.length;m0?p[m].count:1;for(let C=0;C?@[\]^_`{|}~-])/g;function gde(e,t){const n=e.posMax,i=e.pos;if(e.src.charCodeAt(i)!==94||t||i+2>=n)return!1;e.pos=i+1;let o=!1;for(;e.pos{t.exports=function(g,y){y=Object.assign({},{disabled:!0,divWrap:!1,divClass:"checkbox",idPrefix:"cbx_",ulClass:"task-list",liClass:"task-list-item"},y),g.core.ruler.after("inline","github-task-lists",function(b){for(var v=b.tokens,C=0,w=2;w=0;v--)if(g[v].level===b)return v;return-1}function o(g,y){return d(g[y])&&h(g[y-1])&&p(g[y-2])&&m(g[y])}function s(g,y,b,v){var C=b.idPrefix+y;g.children[0].content=g.children[0].content.slice(3),g.children.unshift(l(C,v)),g.children.push(a(v)),g.children.unshift(r(g,C,b,v)),b.divWrap&&(g.children.unshift(u(b,v)),g.children.push(c(v)))}function r(g,y,b,v){var C=new v("checkbox_input","input",0);return C.attrs=[["type","checkbox"],["id",y]],/^\[[xX]\][ \u00A0]/.test(g.content)===!0&&C.attrs.push(["checked","true"]),b.disabled===!0&&C.attrs.push(["disabled","true"]),C}function l(g,y){var b=new y("label_open","label",1);return b.attrs=[["for",g]],b}function a(g){return new g("label_close","label",-1)}function u(g,y){var b=new y("checkbox_open","div",0);return b.attrs=[["class",g.divClass]],b}function c(g){return new g("checkbox_close","div",-1)}function d(g){return g.type==="inline"}function h(g){return g.type==="paragraph_open"}function p(g){return g.type==="list_item_open"}function m(g){return/^\[[xX \u00A0]\][ \u00A0]/.test(g.content)}})});const kde=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function bde(e){return e>=55296&&e<=57343||e>1114111?65533:kde.get(e)??e}function wde(e){const t=atob(e),n=t.length&-2,i=new Uint16Array(n/2);for(let o=0,s=0;o=ns.ZERO&&e<=ns.NINE}function Ade(e){return e>=ns.UPPER_A&&e<=ns.UPPER_F||e>=ns.LOWER_A&&e<=ns.LOWER_F}function xde(e){return e>=ns.UPPER_A&&e<=ns.UPPER_Z||e>=ns.LOWER_A&&e<=ns.LOWER_Z||qC(e)}function Sde(e){return e===ns.EQUALS||xde(e)}var wr;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(wr||(wr={}));var Bd;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Bd||(Bd={}));var _de=class{decodeTree;emitCodePoint;errors;constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n}state=wr.EntityStart;consumed=1;result=0;treeIndex=0;excess=1;decodeMode=Bd.Strict;runConsumed=0;startEntity(e){this.decodeMode=e,this.state=wr.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1,this.runConsumed=0}write(e,t){switch(this.state){case wr.EntityStart:return e.charCodeAt(t)===ns.NUM?(this.state=wr.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=wr.NamedEntity,this.stateNamedEntity(e,t));case wr.NumericStart:return this.stateNumericStart(e,t);case wr.NumericDecimal:return this.stateNumericDecimal(e,t);case wr.NumericHex:return this.stateNumericHex(e,t);case wr.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|mE)===ns.LOWER_X?(this.state=wr.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=wr.NumericDecimal,this.stateNumericDecimal(e,t))}stateNumericHex(e,t){for(;t>14;for(;t>7;if(this.runConsumed===0){const l=i&fl.JUMP_TABLE;if(e.charCodeAt(t)!==l)return this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}for(;this.runConsumed=e.length)return-1;const l=this.runConsumed-1,a=n[this.treeIndex+1+(l>>1)],u=l%2===0?a&255:a>>8&255;if(e.charCodeAt(t)!==u)return this.runConsumed=0,this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}this.runConsumed=0,this.treeIndex+=1+(r>>1),i=n[this.treeIndex],o=(i&fl.VALUE_LENGTH)>>14}if(t>=e.length)break;const s=e.charCodeAt(t);if(s===ns.SEMI&&o!==0&&(i&fl.FLAG13)!==0)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);if(this.treeIndex=Mde(n,i,this.treeIndex+Math.max(1,o),s),this.treeIndex<0)return this.result===0||this.decodeMode===Bd.Attribute&&(o===0||Sde(s))?0:this.emitNotTerminatedNamedEntity();if(i=n[this.treeIndex],o=(i&fl.VALUE_LENGTH)>>14,o!==0){if(s===ns.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==Bd.Strict&&(i&fl.FLAG13)===0&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}t++,this.excess++}return-1}emitNotTerminatedNamedEntity(){const{result:e,decodeTree:t}=this,n=(t[e]&fl.VALUE_LENGTH)>>14;return this.emitNamedEntityData(e,n,this.consumed),this.errors?.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){const{decodeTree:i}=this;return this.emitCodePoint(t===1?i[e]&~(fl.VALUE_LENGTH|fl.FLAG13):i[e+1],n),t===3&&this.emitCodePoint(i[e+2],n),n}end(){switch(this.state){case wr.NamedEntity:return this.result!==0&&(this.decodeMode!==Bd.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case wr.NumericDecimal:return this.emitNumericEntity(0,2);case wr.NumericHex:return this.emitNumericEntity(0,3);case wr.NumericStart:return this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case wr.EntityStart:return 0}}};function Ide(e){let t="";const n=new _de(e,i=>t+=String.fromCodePoint(i));return function(o,s){let r=0,l=0;for(;(l=o.indexOf("&",l))>=0;){t+=o.slice(r,l),n.startEntity(s);const u=n.write(o,l+1);if(u<0){r=l+n.end();break}r=l+u,l=u===0?r+1:r}const a=t+o.slice(r);return t="",a}}function Mde(e,t,n,i){const o=(t&fl.BRANCH_LENGTH)>>7,s=t&fl.JUMP_TABLE;if(o===0)return s!==0&&i===s?n:-1;if(s){const u=i-s;return u<0||u>=o?-1:e[n+u]-1}const r=o+1>>1;let l=0,a=o-1;for(;l<=a;){const u=l+a>>>1,c=e[n+(u>>1)]>>(u&1)*8&255;if(ci)a=u-1;else return e[n+r+u]}return-1}const Tde=Ide(Cde);function P7(e,t=Bd.Legacy){return Tde(e,t)}var Ede=Aj(yde());const gE={};function Lde(e){let t=gE[e];if(t)return t;t=gE[e]=[];for(let n=0;n<128;n++){const i=String.fromCharCode(n);t.push(i)}for(let n=0;n=55296&&c<=57343?o+="���":o+=String.fromCharCode(c),s+=6;continue}}if((l&248)===240&&s+91114111?o+="����":(d-=65536,o+=String.fromCharCode(55296+(d>>10),56320+(d&1023))),s+=9;continue}}o+="�"}return o})}g4.defaultChars=";/?:@&=+$,#";g4.componentChars="";var UC=g4;const vE={};function Nde(e){let t=vE[e];if(t)return t;t=vE[e]=[];for(let n=0;n<128;n++){const i=String.fromCharCode(n);/^[0-9a-z]$/i.test(i)?t.push(i):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n"u"&&(n=!0);const i=Nde(t);let o="";for(let s=0,r=e.length;s=55296&&l<=57343){if(l>=55296&&l<=56319&&s+1=56320&&a<=57343){o+=encodeURIComponent(e[s]+e[s+1]),s++;continue}}o+="%EF%BF%BD";continue}o+=encodeURIComponent(e[s])}return o}v4.defaultChars=";/?:@&=+$,-_.!~*'()#";v4.componentChars="-_.!~*'()";var xj=v4;function $7(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function Tk(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const Dde=/^([a-z0-9.+-]+:)/i,Fde=/:[0-9]*$/,Rde=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Ode=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",` -`," "]),Pde=["'"].concat(Ode),yE=["%","/","?",";","#"].concat(Pde),kE=["/","?","#"],$de=255,bE=/^[+a-z0-9A-Z_-]{0,63}$/,Bde=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,wE={javascript:!0,"javascript:":!0},CE={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function zde(e,t){if(e&&e instanceof Tk)return e;const n=new Tk;return n.parse(e,t),n}Tk.prototype.parse=function(e,t){let n,i,o,s=e;if(s=s.trim(),!t&&e.split("#").length===1){const u=Rde.exec(s);if(u)return this.pathname=u[1],u[2]&&(this.search=u[2]),this}let r=Dde.exec(s);if(r&&(r=r[0],n=r.toLowerCase(),this.protocol=r,s=s.substr(r.length)),(t||r||s.match(/^\/\/[^@\/]+@[^@\/]+/))&&(o=s.substr(0,2)==="//",o&&!(r&&wE[r])&&(s=s.substr(2),this.slashes=!0)),!wE[r]&&(o||r&&!CE[r])){let u=-1;for(let m=0;m127?v+="x":v+=b[C];if(!v.match(bE)){const C=m.slice(0,g),w=m.slice(g+1),M=b.match(Bde);M&&(C.push(M[1]),w.unshift(M[2])),w.length&&(s=w.join(".")+s),this.hostname=C.join(".");break}}}}this.hostname.length>$de&&(this.hostname=""),p&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const l=s.indexOf("#");l!==-1&&(this.hash=s.substr(l),s=s.slice(0,l));const a=s.indexOf("?");return a!==-1&&(this.search=s.substr(a),s=s.slice(0,a)),s&&(this.pathname=s),CE[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};Tk.prototype.parseHost=function(e){let t=Fde.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var B7=zde,Sj=nde({decode:()=>UC,encode:()=>xj,format:()=>$7,parse:()=>B7}),jde=Object.defineProperty,_j=e=>{let t={};for(var n in e)jde(t,n,{get:e[n],enumerable:!0});return t},ar=class{type;tag;attrs;map;nesting;level;children;content;markup;info;meta;block;hidden;constructor(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}attrIndex(e){if(!this.attrs)return-1;const t=this.attrs;for(let n=0,i=t.length;n=0&&(n=this.attrs[t][1]),n}attrJoin(e,t){const n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=`${this.attrs[n][1]} ${t}`}},Hde=_j({arrayReplaceAt:()=>Gde,assign:()=>Kde,countLines:()=>ds,escapeHtml:()=>ofe,escapeRE:()=>rfe,fromCodePoint:()=>kv,has:()=>Vde,isMdAsciiPunct:()=>Nk,isPunctChar:()=>Lk,isPunctCode:()=>VC,isSpace:()=>Zde,isString:()=>qde,isValidEntityCode:()=>k4,isWhiteSpace:()=>yv,lib:()=>lfe,mdurl:()=>Sj,normalizeReference:()=>y4,ucmicro:()=>Ek,unescapeAll:()=>bv,unescapeMd:()=>Xde});const Ek={Any:/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Cc:/[\0-\x1F\x7F-\x9F]/,Cf:/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,P:/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,S:/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,Z:/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/};function Wde(e){return Object.prototype.toString.call(e)}function qde(e){return Wde(e)==="[object String]"}const Ude=Object.prototype.hasOwnProperty;function Vde(e,t){return Ude.call(e,t)}function Kde(e,...t){return t.forEach(n=>{if(n){if(typeof n!="object")throw new TypeError(`${String(n)}must be object`);Object.keys(n).forEach(i=>{e[i]=n[i]})}}),e}function Zde(e){return e===9||e===32}function yv(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function Lk(e){return Ek.P.test(e)||Ek.S.test(e)}const AE=new Map;function VC(e){if(Nk(e))return!0;if(e>=0&&e<128)return!1;const t=AE.get(e);if(t!==void 0)return t;const n=Lk(String.fromCharCode(e));return AE.set(e,n),n}function Nk(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function y4(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function Gde(e,t,n){return[...e.slice(0,t),...n,...e.slice(t+1)]}function k4(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function kv(e){if(e>65535){e-=65536;const t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}const Ij=/\\([!"#$%&'()*+,\-\./:;<=>?@[\\\]^_`{|}~])/g,Qde=new RegExp(`${Ij.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),Yde=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Jde(e,t){if(t.charCodeAt(0)===35&&Yde.test(t)){const i=t[1].toLowerCase()==="x"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return k4(i)?kv(i):e}const n=P7(e);return n!==e?n:e}function Xde(e){return e.includes("\\")?e.replace(Ij,"$1"):e}function bv(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(Qde,(t,n,i)=>n||Jde(t,i))}const efe=/[&<>"]/,tfe=/[&<>"]/g,nfe={"&":"&","<":"<",">":">",'"':"""};function ife(e){return nfe[e]}function ofe(e){return efe.test(e)?e.replace(tfe,ife):e}const sfe=/[.?*+^$[\]\\(){}|-]/g;function rfe(e){return e.replace(sfe,"\\$&")}const lfe={mdurl:Sj,ucmicro:Ek};function ds(e){if(e.length===0)return 0;let t=0,n=-1;for(;(n=e.indexOf(` -`,n+1))!==-1;)t++;return t}const afe=/(?:^|\n)[ \t]{0,3}\[\^[^\]\n]+\]:/m,ufe=/(?:^|\n)[ \t]{0,3}\*\[[^\]\n]+\]:/m,cfe=/(?:^|\n)[ \t]{0,3}\[(?!\^)(?:\\[\s\S]|[^\]\\[])+\][ \t]*:/m,z7=["references","footnotes","abbreviations","abbr","abbrs"],j7=Symbol.for("markdown-it-ts.global-state"),H7=Object.prototype.hasOwnProperty;function xE(e){return e==="reference-definition"||e==="footnote-definition"||e==="abbreviation-definition"}function mu(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Jd(e){if(Array.isArray(e))return e.map(t=>Jd(t));if(mu(e)){const t={};for(const n of Object.keys(e))t[n]=Jd(e[n]);return t}return e}function Dk(e){return Array.isArray(e)?e.map((t,n)=>String(n)):mu(e)?Object.keys(e):[]}function KC(e,t){if(Array.isArray(e)||Array.isArray(t)){if(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;ns.has(r)?!KC(o[r],Mj(i.value,r)):!0)}}function rd(e){const t=W7(e);if(t){for(const n of z7){const i=t.snapshot[n];if(!i){delete e[n];continue}if(i.ownedKeys){ffe(e,n,i);continue}i.existed?e[n]=dfe(e[n],i.value):delete e[n]}delete e[j7]}}function y8(e){return{area:e,attempted:!0,matched:!1,attemptMs:0,blocks:0,headings:0,paragraphs:0,lists:0,fences:0,paragraphCacheHits:0,paragraphCacheMisses:0,paragraphCacheBypasses:0,listCacheHits:0,listCacheMisses:0,fenceCacheHits:0,fenceCacheMisses:0}}const ZC=Symbol.for("markdown-it-ts.diagnostics");function t2(e,t){if(e)try{const n=e[ZC];if(n&&typeof n=="object")return n;if(!t)return;const i={};return e[ZC]=i,i}catch{return}}function Fc(e){return t2(e,!1)}function pfe(e){if(e)try{const t=e[ZC];t&&typeof t=="object"&&(delete t.strategy,delete t.chunk,delete t.unbounded,delete t.editable,delete t.stockFast)}catch{}}function hl(e){pfe(e)}function Sg(e,t){const n=t2(e,!0);n&&(n.stockFast=t)}function Ls(e,t){const n=t2(e,!0);n&&(n.strategy=t)}function k8(e,t){const n=t2(e,!0);n&&(n.chunk=t)}function Tj(e,t){const n=t2(e,!0);n&&(n.unbounded=t)}const mfe=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,gfe=/[\0-\x1F\x7F-\x9F]/,vfe=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B4E\u1B4F\u1B5A-\u1B60\u1B7D-\u1B7F\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDD6E\uDEAD\uDED0\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9\uDFD4\uDFD5\uDFD7\uDFD8]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09\uDFE1]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDD6D-\uDD6F\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD839\uDDFF|\uD83A[\uDD5E\uDD5F]/,yfe=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;var kfe=class{src_Any=mfe.source;src_Cc=gfe.source;src_Z=yfe.source;src_P=vfe.source;src_ZPCc=[this.src_Z,this.src_P,this.src_Cc].join("|");src_ZCc=[this.src_Z,this.src_Cc].join("|");cache={};opts={maxLength:1e4,urlAuth:!1,schema_names:[]};constructor(e={}){this.opts={...this.opts,...e}}set(e={}){return this.opts={...this.opts,...e},this.cache={},this}escapeRE(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}nestedPairRE(e,t,n=4){const i=this.escapeRE(e),o=this.escapeRE(t),s=`(?:(?!${this.src_ZCc}|${i}|${o}).)`;let r=`${i}${s}{0,1000}${o}`;for(let l=2;l<=n;l++)r=`${i}(?:${s}|${r}){0,1000}${o}`;return r}get_text_separators(){return this.cache.text_separators??=/[><\uff5c]/}get_pseudo_letter(){return this.cache.src_pseudo_letter??=new RegExp(`(?:(?!${this.get_text_separators().source}|${this.src_ZPCc})${this.src_Any})`)}get_ipv4_addr(){return this.cache.src_ip4??=new RegExp("(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])[.]){3}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])")}get_ipv6_addr(){const e="[0-9A-Fa-f]{1,4}",t=`(?:(?:${e}:${e})|${this.get_ipv4_addr().source})`;return this.cache.src_ip6_addr??=new RegExp(`(?:(?:${e}:){6}${t}|::(?:${e}:){5}${t}|(?:${e})?::(?:${e}:){4}${t}|(?:(?:${e}:){0,1}${e})?::(?:${e}:){3}${t}|(?:(?:${e}:){0,2}${e})?::(?:${e}:){2}${t}|(?:(?:${e}:){0,3}${e})?::${e}:${t}|(?:(?:${e}:){0,4}${e})?::${t}|(?:(?:${e}:){0,5}${e})?::${e}|(?:(?:${e}:){0,6}${e})?::)`)}get_ipv6_url_host(){return this.cache.src_ip6_host??=new RegExp(`\\[${this.get_ipv6_addr().source}\\]`)}get_ipv6_mail_host(){return this.cache.src_ipv6_mail_host??=new RegExp(`\\[IPv6:${this.get_ipv6_addr().source}\\]`)}get_auth(){return this.cache.src_auth??=new RegExp(`(?:(?:(?!${this.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`)}get_port(){return this.cache.src_port??=new RegExp("(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?")}get_host_terminator(){return this.cache.src_host_terminator??=new RegExp(`(?=$|${this.get_text_separators().source}|${this.src_ZPCc})(?!${this.opts["---"]?"-(?!--)|":"-|"}_|:\\d|\\.-|\\.(?!$|${this.src_ZPCc}))`)}get_path_terminator(){return this.cache.src_path_terminator??=new RegExp(`${this.src_ZPCc}|${this.get_text_separators().source}`)}get_path(){return this.cache.src_path??=new RegExp(`(?:[/?#](?:${this.nestedPairRE("[","]")}|${this.nestedPairRE("(",")")}|${this.nestedPairRE("{","}")}|\\"(?:(?!${this.src_ZCc}|["]).){1,100}\\"|\\'(?:(?!${this.src_ZCc}|[']).){1,100}\\'|\\'(?=${this.get_pseudo_letter().source}|[-])|\\.{2,20}[:]?[a-zA-Z0-9%/&]|\\.(?!${this.src_ZCc}|[.]|$)|`+(this.opts["---"]?"\\-(?!--(?:[^-]|$))(?:-{0,19})|":"\\-{1,20}|")+`,(?!${this.src_ZCc}|$)|;(?!${this.src_ZCc}|$)|\\!{1,20}(?!${this.src_ZCc}|[!]|$)|\\?(?!${this.src_ZCc}|[?]|$)|`+this.get_path_extra().source+`[\\\\/:%@#&=_~*]|(?!${this.get_path_terminator().source}).){1,${this.opts.maxLength}}|\\/)?`)}get_mail_name(){return this.cache.src_mail_name??=new RegExp("[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9](?:[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9]|[.](?=[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9])){0,63}")}get_xn(){return this.cache.src_xn??=new RegExp("xn--[a-z0-9\\-]{1,59}")}get_tld(){if(this.cache.tld)return this.cache.tld;const e=[...new Set(this.opts.tlds||[])].sort().reverse().join("|");return this.cache.tld=new RegExp(`${e||"$#none#$"}|${this.get_xn().source}`),this.cache.tld}get_domain_root(){return this.cache.src_domain_root??=new RegExp("(?:"+this.get_xn().source+`|${this.get_pseudo_letter().source}{1,63})`)}get_domain(){return this.cache.src_domain??=new RegExp("(?:"+this.get_xn().source+`|(?:${this.get_pseudo_letter().source})|(?:${this.get_pseudo_letter().source}(?:-|${this.get_pseudo_letter().source}){0,61}${this.get_pseudo_letter().source}))`)}get_url_host_port(){return this.cache.url_host_port??=new RegExp("(?:"+this.get_ipv6_url_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,10}${this.get_domain().source}))`+this.get_port().source+this.get_host_terminator().source)}get_fuzzy_url_host_port(){return this.cache.fuzzy_url_host_port??=new RegExp("(?:"+(this.opts.fuzzyIP?this.get_ipv4_addr().source+"|":"")+`(?:(?:(?:${this.get_domain().source})\\.){1,10}(?:${this.get_tld().source})))`+this.get_host_terminator().source)}get_mail_host(){return this.cache.src_mail_host??=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,4}${this.get_domain().source}))`+this.get_host_terminator().source)}get_fuzzy_mail_host(){return this.cache.src_fuzzy_mail_host??=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})[.]){1,4}${this.get_domain_root().source}))`+this.get_host_terminator().source)}get_path_extra(){return this.cache.src_path_extra??=new RegExp("")}get_fuzzy_mail_host_search(){return this.cache.mail_fuzzy_host_search??=new RegExp(`@${this.get_fuzzy_mail_host().source}`,"ig")}get_fuzzy_link_search(){return this.cache.link_fuzzy_search??=new RegExp(`(^|(?![.:/\\-_@])(?:[$+<=>^\`||]|${this.src_ZPCc}))(?:(?![$+<=>^\`||])${this.get_fuzzy_url_host_port().source}${this.get_path().source})`,"ig")}get_http_validator(){return this.cache.http_validator??=new RegExp("\\/\\/"+(this.opts.urlAuth?this.get_auth().source:"")+this.get_url_host_port().source+this.get_path().source,"iy")}get_relative_proto_validator(){return this.cache.relative_proto_validator??=new RegExp((this.opts.urlAuth?this.get_auth().source:"")+`(?:localhost|${this.get_ipv6_url_host().source}|(?:(?:${this.get_domain().source})[.]){1,10}${this.get_domain_root().source})`+this.get_port().source+this.get_host_terminator().source+this.get_path().source,"iy")}get_mail_name_validator(){return this.cache.mail_name_validator??=new RegExp(`(?:^|${this.get_text_separators().source}|"|\\(|${this.src_ZCc})(${this.get_mail_name().source})$`)}get_mailto_validator(){return this.cache.mailto_validator??=new RegExp(`${this.get_mail_name().source}@${this.get_mail_host().source}`,"iy")}get_schema_names(){return this.cache.schema_names??=new RegExp((this.opts.schema_names||[]).map(e=>this.escapeRE(e)).join("|"))}get_schema_search(){return this.cache.schema_search??=new RegExp(`(^|(?!_)(?:[><|]|${this.src_ZPCc}))(${this.get_schema_names().source})`,"ig")}get_schema_at_start(){return this.cache.schema_at_start??=new RegExp(`^${this.get_schema_search().source}`,"i")}},b8={validate:(e,t,n)=>{const i=n.re.get_http_validator();i.lastIndex=t;const o=i.exec(e);return o?o[0].length:0},normalize:(e,t)=>t.normalize(e)},bfe={"http:":b8,"https:":b8,"ftp:":b8,"//":{validate:function(e,t,n){const i=n.re.get_relative_proto_validator();i.lastIndex=t;const o=i.exec(e);return o?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:o[0].length:0},normalize:(e,t)=>t.normalize(e)},"mailto:":{validate:function(e,t,n){const i=n.re.get_mailto_validator();i.lastIndex=t;const o=i.exec(e);return o?o[0].length:0},normalize:(e,t)=>t.normalize(e)}},wfe="a:cdefgilmnoqrstuwxz|b:abdefghijmnorstvwyz|c:acdfghiklmnoruvwxyz|d:ejkmoz|e:cegrstu|f:ijkmor|g:abdefghilmnpqrstuwy|h:kmnrtu|i:delmnoqrst|j:emop|k:eghimnprwyz|l:abcikrstuvy|m:acdeghklmnopqrstuvwxyz|n:acefgilopruz|o:m|p:aefghklmnrstwy|q:a|r:eosuw|s:abcdeghijklmnortuvxyz|t:cdfghjklmnortvwz|u:agksyz|v:aceginu|w:fs|y:et|z:amw",Cfe="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф";function Afe(){const e=Cfe.split("|");return wfe.split("|").forEach(t=>{const n=t.indexOf(":"),i=t.slice(0,n);for(const o of t.slice(n+1))e.push(i+o)}),e}var xfe={fuzzyLink:!1,fuzzyEmail:!0,fuzzyIP:!1,"---":!1,tlds:Afe(),urlAuth:!1,maxLength:1e4},SE=class{schema;index;lastIndex;raw;text;url;constructor(e,t,n,i){const o=e.slice(n,i);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=i,this.raw=o,this.text=o,this.url=o}},Ej=class{__opts__;__schemas__;re;constructor(e={}){const{rebuilder:t,...n}=e;this.__opts__={...xfe,...n},this.__schemas__={...bfe},this.re=t||new kfe,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)})}add(e,t=null){if(!t)delete this.__schemas__[e];else{const n={normalize:(i,o)=>o.normalize(i),...t};this.__schemas__[e]=n}return this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}set(e={}){return this.__opts__={...this.__opts__,...e},this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}test(e){if(!e.length)return!1;let t,n;for(n=this.re.get_schema_search(),n.lastIndex=0;(t=n.exec(e))!==null;)if(this.testSchemaAt(e,t[2],n.lastIndex))return!0;if(this.__opts__.fuzzyLink&&this.__schemas__["http:"]&&(n=this.re.get_fuzzy_link_search(),n.lastIndex=0,n.exec(e)!==null))return!0;if(this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"]&&e.indexOf("@")>=0){const i=this.re.get_fuzzy_mail_host_search(),o=this.re.get_mail_name_validator();for(i.lastIndex=0;(t=i.exec(e))!==null;){const s=e.slice(Math.max(0,t.index-65),t.index);if(o.test(s))return!0}}return!1}testSchemaAt(e,t,n){return this.__schemas__[t.toLowerCase()]?this.__schemas__[t.toLowerCase()].validate(e.slice(0,n+this.__opts__.maxLength),n,this):0}match(e){const t=[],n=this.re.get_schema_search();let i,o,s,r,l,a,u=!1,c=!1,d=!1,h=0;if(!e.length)return null;for(n.lastIndex=0,this.__opts__.fuzzyLink&&this.__schemas__["http:"]&&(i=this.re.get_fuzzy_link_search(),i.lastIndex=0),this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"]&&(o=this.re.get_fuzzy_mail_host_search(),o.lastIndex=0,s=this.re.get_mail_name_validator());;){const p=Math.max(h-1,0);if(o&&s&&!d&&(!l||l.index=h)break;o.lastIndex=h)break;i.lastIndexm.lastIndex))&&(m=r);let g;if(!u)for(;;){if(!a){n.lastIndexm.index)break;const v=a;a=void 0;const C=this.testSchemaAt(e,v.schema,v.lastIndex);if(C){g={schema:v.schema,index:v.index,lastIndex:v.lastIndex+C};break}}let y=g;if((!y||l&&(l.indexy.lastIndex))&&(y=l),(!y||r&&(r.indexy.lastIndex))&&(y=r),!y)break;y===l?l=void 0:y===r&&(r=void 0);const b=new SE(e,y.schema,y.index,y.lastIndex);b.schema?this.__schemas__[b.schema].normalize(b,this):this.normalize(b),t.push(b),h=y.lastIndex}return t.length?t:null}matchAtStart(e){if(!e.length)return null;const t=this.re.get_schema_at_start().exec(e);if(!t)return null;const n=this.testSchemaAt(e,t[2],t[0].length);if(!n)return null;const i=new SE(e,t[2],t.index+t[1].length,t.index+t[0].length+n);return this.__schemas__[i.schema].normalize(i,this),i}tlds(e,t=!1){return e=Array.isArray(e)?e:[e],t?this.__opts__.tlds=this.__opts__.tlds.concat(e):this.__opts__.tlds=e,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}normalize(e){e.schema||(e.url=`http://${e.url}`),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:${e.url}`)}},Sfe=Cj({"../../node_modules/.pnpm/punycode.js@2.3.1/node_modules/punycode.js/punycode.js":((e,t)=>{const d=/^xn--/,h=/[^\0-\x7F]/,p=/[\x2E\u3002\uFF0E\uFF61]/g,m={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},g=35,y=Math.floor,b=String.fromCharCode;function v(z){throw new RangeError(m[z])}function C(z,F){const O=[];let B=z.length;for(;B--;)O[B]=F(z[B]);return O}function w(z,F){const O=z.split("@");let B="";O.length>1&&(B=O[0]+"@",z=O[1]),z=z.replace(p,".");const j=C(z.split("."),F).join(".");return B+j}function M(z){const F=[];let O=0;const B=z.length;for(;O=55296&&j<=56319&&OString.fromCodePoint(...z),T=function(z){return z>=48&&z<58?26+(z-48):z>=65&&z<91?z-65:z>=97&&z<123?z-97:36},S=function(z,F){return z+22+75*(z<26)-((F!=0)<<5)},x=function(z,F,O){let B=0;for(z=O?y(z/700):z>>1,z+=y(z/F);z>g*26>>1;B+=36)z=y(z/g);return y(B+(g+1)*z/(z+38))},A=function(z){const F=[],O=z.length;let B=0,j=128,$=72,V=z.lastIndexOf("-");V<0&&(V=0);for(let ne=0;ne=128&&v("not-basic"),F.push(z.charCodeAt(ne));for(let ne=V>0?V+1:0;ne=O&&v("invalid-input");const ye=T(z.charCodeAt(ne++));ye>=36&&v("invalid-input"),ye>y((2147483647-B)/ue)&&v("overflow"),B+=ye*ue;const Te=ie<=$?1:ie>=$+26?26:ie-$;if(yey(2147483647/Ee)&&v("overflow"),ue*=Ee}const ee=F.length+1;$=x(B-K,ee,K==0),y(B/ee)>2147483647-j&&v("overflow"),j+=y(B/ee),B%=ee,F.splice(B++,0,j)}return String.fromCodePoint(...F)},E=function(z){const F=[];z=M(z);const O=z.length;let B=128,j=0,$=72;for(const K of z)K<128&&F.push(b(K));const V=F.length;let ne=V;for(V&&F.push("-");ne=B&&uey((2147483647-j)/ee)&&v("overflow"),j+=(K-B)*ee,B=K;for(const ue of z)if(ue2147483647&&v("overflow"),ue===B){let ie=j;for(let ye=36;;ye+=36){const Te=ye<=$?1:ye>=$+26?26:ye-$;if(ie32))return s;if(i===41){if(r===0)break;r--}o++}return t===o||r!==0||(s.str=bv(e.slice(t,o)),s.pos=o,s.ok=!0),s}var Nj=V7;const h9=-2;function _fe(e,t,n,i){let o=1,s=t+1;for(;s=0&&t+1>=c)return-1;const d=l.indexOf("]",t+1);if(d<0||d>=a)return e.linkLabelNoCloseFrom=t+1,-1;const h=_fe(l,t,a,n);if(h!==h9)return h;for(e.pos=t+1;e.pos=n)return r;let l=e.charCodeAt(s);if(l!==34&&l!==39&&l!==40)return r;t++,s++,l===40&&(l=41),r.marker=l}for(;s=0?e.attrs[n][1]:null}function Tfe(e,t,n){const i=b4(e,t);i<0?G7(e,[t,n]):e.attrs[i][1]=`${e.attrs[i][1]} ${n}`}var Efe=_j({attrGet:()=>Mfe,attrIndex:()=>b4,attrJoin:()=>Tfe,attrPush:()=>G7,attrSet:()=>Ife,parseLinkDestination:()=>V7,parseLinkLabel:()=>K7,parseLinkTitle:()=>Z7});function Lfe(e){return e.includes("\r")||e.includes("\0")}function Fj(e){return typeof e=="string"?e:e.toString()}function Nfe(e){if(e.inlineMode){const t=new ar("inline","",0);t.content=Fj(e.src),t.map=[0,1],t.children=[],t.level=0,e.tokens.push(t)}else e.md&&e.md.block&&e.md.block.parse(e.src,e.md,e.env,e.tokens)}const Dfe=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,Ffe=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function Rfe(e,t){let n=e.pos;const i=e.src;if(i.charCodeAt(n)!==60)return!1;const o=n,s=e.posMax;for(;;){if(++n>=s)return!1;const l=i.charCodeAt(n);if(l===60)return!1;if(l===62)break}const r=i.slice(o+1,n);if(Ffe.test(r)){const l=e.md.normalizeLink(r);if(!e.md.validateLink(l))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",l]],a.markup="autolink",a.info="auto";const u=e.push("text","",0);u.content=e.md.normalizeLinkText(r);const c=e.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return e.pos+=r.length+2,!0}if(Dfe.test(r)){const l=e.md.normalizeLink(`mailto:${r}`);if(!e.md.validateLink(l))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",l]],a.markup="autolink",a.info="auto";const u=e.push("text","",0);u.content=e.md.normalizeLinkText(r);const c=e.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return e.pos+=r.length+2,!0}return!1}var Rj=Rfe;function Ofe(e,t){const n=e.src;let i=e.pos;if(n.charCodeAt(i)!==96)return!1;const o=i;i++;const s=e.posMax;for(;i2&&h.charCodeAt(0)===32&&h.charCodeAt(h.length-1)===32&&(h=h.slice(1,-1)),d.content=h}return e.pos=a,!0}e.backticks[c]=u}return e.backticksScanned=!0,t||(e.pending+=r),e.pos+=l,!0}var Oj=Ofe;function _E(e){const t={},n=e.length;if(!n)return;let i=0,o=-2;const s=[];for(let r=0;ra;u-=s[u]+1){const d=e[u];if(d.marker===l.marker&&d.open&&d.end<0){let h=!1;if((d.close||l.open)&&(d.length+l.length)%3===0&&(d.length%3!==0||l.length%3!==0)&&(h=!0),!h){const p=u>0&&!e[u-1].open?s[u-1]+1:0;s[r]=r-u+p,s[u]=p,l.open=!1,d.end=r,d.close=!1,c=-1,o=-2;break}}}c!==-1&&(t[l.marker][(l.open?3:0)+(l.length||0)%3]=c)}}function Pfe(e){const t=e.tokens_meta,n=e.tokens_meta.length;_E(e.delimiters);for(let i=0;i=0;o--){const s=t[o],r=s.marker;if(r!==95&&r!==42||s.end===-1)continue;const l=t[s.end],a=s.token,u=l.token,c=o>0&&t[o-1].end===s.end+1&&t[o-1].marker===r&&t[o-1].token===a-1&&t[s.end+1].token===u+1,d=r===42?Pj:$j,h=i[a];c?(h.type="strong_open",h.tag="strong",h.nesting=1,h.markup=d+d,h.content=""):(h.type="em_open",h.tag="em",h.nesting=1,h.markup=d,h.content="");const p=i[u];c?(p.type="strong_close",p.tag="strong",p.nesting=-1,p.markup=d+d,p.content=""):(p.type="em_close",p.tag="em",p.nesting=-1,p.markup=d,p.content=""),c&&(i[t[o-1].token].content="",i[t[s.end+1].token].content="",o--)}}function zfe(e){const t=e.tokens_meta,n=e.tokens_meta.length;IE(e,e.delimiters);for(let i=0;i=48&&e<=57}function jfe(e){const t=e|32;return Q7(e)||t>=97&&t<=102}function zj(e){const t=e|32;return t>=97&&t<=122}function Hfe(e){return zj(e)||Q7(e)}function Wfe(e,t,n){let i=t+2;if(i>=n)return null;let o=!1,s=7,r=i;for((e.charCodeAt(i)|32)===120&&(o=!0,s=6,i++,r=i);i=n||e.charCodeAt(i)!==59?null:e.slice(t,i+1)}function qfe(e,t,n){let i=t+1;if(i>=n||!zj(e.charCodeAt(i)))return null;for(i++;i=n||e.charCodeAt(i)!==59)return null;const o=e.slice(t,i+1);return Bj(o)!==o?o:null}function Ufe(e,t){const n=e.pos,i=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=i)return!1;if(e.src.charCodeAt(n+1)===35){const o=Wfe(e.src,n,i);if(o){if(!t){const s=(o.charCodeAt(2)|32)===120?Number.parseInt(o.slice(3,-1),16):Number.parseInt(o.slice(2,-1),10),r=e.push("text_special","",0);r.content=k4(s)?kv(s):kv(65533),r.markup=o,r.info="entity"}return e.pos+=o.length,!0}}else{const o=qfe(e.src,n,i);if(o){const s=Bj(o);if(!t){const r=e.push("text_special","",0);r.content=s,r.markup=o,r.info="entity"}return e.pos+=o.length,!0}}return!1}var jj=Ufe;const Hj=(()=>{const e=new Array(256).fill(0),t="\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-";for(let n=0;n<32;n++)e[t.charCodeAt(n)]=1;return e})(),QC=new Array(128),Wj=new Array(128);for(let e=0;e<128;e++){const t=String.fromCharCode(e);QC[e]=`\\${t}`,Wj[e]=Hj[e]?t:QC[e]}function ME(e,t,n){e.pending&&e.pushPending();const i=new ar("text_special","",0);i.level=e.level,i.content=t,i.markup=n,i.info="escape",e.pendingLevel=e.level,e.tokens.push(i),e.tokens_meta.push(null)}function Vfe(e,t){let n=e.pos;const i=e.posMax,o=e.src;if(o.charCodeAt(n)!==92||(n++,n>=i))return!1;let s=o.charCodeAt(n);if(s===10){for(t||e.push("hardbreak","br",0),n++;n=55296&&s<=56319&&n+1=56320&&a<=57343&&n++}return e.pos=n+1,!0}let r=o.charAt(n);if(s>=55296&&s<=56319&&n+1=56320&&a<=57343&&(r+=o.charAt(n+1),n++)}const l=`\\${r}`;return ME(e,s<256&&Hj[s]?r:l,l),e.pos=n+1,!0}var qj=Vfe;function Kfe(e){let t,n,i=0;const o=e.tokens,s=e.tokens.length;for(t=n=0;t0&&i++,r.type==="text"&&t+1\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,Vj="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",Gfe=new RegExp(`^(?:${Uj}|${Vj}||<\\?[\\s\\S]*?\\?>|]*>|)`),Qfe=new RegExp(`^(?:${Uj}|${Vj})`);function Kj(e){return e===32||e===9||e===10||e===12||e===13}function Yfe(e){if(e.length<3||e.charCodeAt(0)!==60||(e.charCodeAt(1)|32)!==97)return!1;const t=e.charCodeAt(2);return t===62||Kj(t)}function Jfe(e){if(e.length<4||e.charCodeAt(0)!==60||e.charCodeAt(1)!==47||(e.charCodeAt(2)|32)!==97)return!1;for(let t=3;t=97&&t<=122}function ehe(e,t){if(!e.md.options.html)return!1;const n=e.posMax,i=e.pos,o=e.src;if(o.charCodeAt(i)!==60||i+2>=n)return!1;const s=o.charCodeAt(i+1);if(s!==33&&s!==63&&s!==47&&!Xfe(s))return!1;const r=o.slice(i).match(Gfe);if(!r)return!1;const l=r[0];if(!t){const a=e.pushSimple("html_inline","");a.content=l,Yfe(l)&&e.linkLevel++,Jfe(l)&&e.linkLevel--}return e.pos+=l.length,!0}var Zj=ehe;function the(e,t){let n,i,o,s,r,l,a,u,c="";const d=e.pos,h=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const p=e.pos+2,m=Fk(e,e.pos+1,!1);if(m<0)return!1;if(s=m+1,s=h)return!1;if(l=Nj(e.src,s,e.posMax),l.ok){for(c=e.md.normalizeLink(l.str),e.md.validateLink(c)?s=l.pos:c="",u=s;s=h||e.src.charCodeAt(s)!==41)return e.pos=d,!1;s++}else{if(typeof e.env.references>"u")return!1;if(s=0?o=e.src.slice(u,s++):s=m+1):s=m+1,o||(o=e.src.slice(p,m)),r=e.env.references[y4(o)],!r)return e.pos=d,!1;c=r.href,a=r.title}if(!t){i=e.src.slice(p,m);const g=[];e.md.inline.parse(i,e.md,e.env,g);const y=e.push("image","img",0);y.attrs=[["src",c],["alt",""]],y.children=g,y.content=i,a&&y.attrs.push(["title",a])}return e.pos=s,e.posMax=h,!0}var Gj=the;function w8(e,t,n){for(;t"u")return!1;let d;if(l=r+1,l=0?(d=n.slice(p,m),d||(d=n.slice(s,r)),l=m+1):d=n.slice(s,r)}else d=n.slice(s,r);const h=e.env.references[y4(d)];if(!h)return e.pos=i,!1;a=h.href,u=h.title}if(!t){e.pos=s,e.posMax=r;const d=e.push("link_open","a",1);d.attrs=u?[["href",a],["title",u]]:[["href",a]],e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=l,e.posMax=o,!0}var Qj=nhe;function Yj(e){const t=e|32;return t>=97&&t<=122}function ihe(e){return e>=48&&e<=57}function ohe(e){return Yj(e)||ihe(e)||e===43||e===45||e===46}function she(e){if(e.length===0)return null;let t=e.length-1;for(;t>=0&&ohe(e.charCodeAt(t));)t--;return t++,t>=e.length||!Yj(e.charCodeAt(t))?null:e.slice(t)}function rhe(e,t,n){let i=t;for(;i0)return!1;const n=e.pos,i=e.posMax;if(n+3>i||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const o=she(e.pending);if(!o)return!1;const s=rhe(e.src,n-o.length,i),r=e.md.linkify.matchAtStart(s);if(!r)return!1;let l=r.url;if(l.length<=o.length)return!1;let a=l.length;for(;a>0&&l.charCodeAt(a-1)===42;)a--;a!==l.length&&(l=l.slice(0,a));const u=e.md.normalizeLink(l);if(!e.md.validateLink(u))return!1;if(!t){e.pending=e.pending.slice(0,-o.length);const c=e.push("link_open","a",1);c.attrs=[["href",u]],c.markup="linkify",c.info="auto";const d=e.push("text","",0);d.content=e.md.normalizeLinkText(l);const h=e.push("link_close","a",-1);h.markup="linkify",h.info="auto"}return e.pos+=l.length-o.length,!0}function lhe(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const i=e.pending.length-1,o=e.posMax;if(!t)if(i>=0&&e.pending.charCodeAt(i)===32)if(i>=1&&e.pending.charCodeAt(i-1)===32){let s=i-1;for(;s>=1&&e.pending.charCodeAt(s-1)===32;)s--;e.pending=e.pending.slice(0,s),e.pushSimple("hardbreak","br")}else e.pending=e.pending.slice(0,-1),e.pushSimple("softbreak","br");else e.pushSimple("softbreak","br");for(n++;n=o||EE(n.charCodeAt(i)))return!1;let s=i+1;for(;si-o),n=Math.floor(t.length/2);return t.length%2===0?(t[n-1]+t[n])/2:t[n]}function fhe(e,t){return{chain:e,name:t,calls:0,hits:0,inclusiveMs:0,medianMs:0,maxMs:0,normalCalls:0,normalHits:0,silentCalls:0,silentHits:0,samples:[]}}function tH(e){const t=e;if(!t)return null;if(t.__mdtsRuleProfile)return t.__mdtsRuleProfile;if(!t.__mdtsProfileRules)return null;const n=t.__mdtsProfileRules===!0?{}:t.__mdtsProfileRules,i={enabled:!0,fixture:n.fixture,mode:n.mode,startedAt:Y7(),records:Object.create(null)};return t.__mdtsRuleProfile=i,i}function q1(e,t,n,i,o,s){const r=tH(e);if(!r)return;const l=`${t}:${n}`,a=r.records[l]??(r.records[l]=fhe(t,n));a.calls++,a.inclusiveMs+=i,i>a.maxMs&&(a.maxMs=i),a.samples.push(i),s?(a.silentCalls++,o&&a.silentHits++):(a.normalCalls++,o&&a.normalHits++),o&&a.hits++,r.completedAt=Y7()}function hhe(e){const t=tH(e);if(!t)return null;const n=Object.keys(t.records);for(let i=0;io.name===e);i>=0&&this.rules.splice(i,1),this.rules.push({name:e,fn:t,alt:n?.alt||[],enabled:!0}),this.invalidateCache()}at(e,t,n){const i=this.rules.findIndex(o=>o.name===e);if(t===void 0){if(i<0)return;const o=this.rules[i];return Object.freeze({name:o.name,fn:o.fn,alt:o.alt?Object.freeze(o.alt.slice()):void 0,enabled:o.enabled})}if(i<0)throw new Error(`Parser rule not found: ${e}`);this.rules[i].fn=t,n?.alt!==void 0&&(this.rules[i].alt=n.alt),this.invalidateCache()}before(e,t,n,i){const o=this.rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this.rules.findIndex(r=>r.name===t);s>=0&&this.rules.splice(s,1),this.rules.splice(o,0,{name:t,fn:n,alt:i?.alt||[],enabled:!0}),this.invalidateCache()}after(e,t,n,i){const o=this.rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this.rules.findIndex(r=>r.name===t);s>=0&&this.rules.splice(s,1),this.rules.splice(o+1,0,{name:t,fn:n,alt:i?.alt||[],enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;for(const s of n){const r=this.rules.findIndex(l=>l.name===s);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${s}`);continue}i.push(s),this.rules[r].enabled||(this.rules[r].enabled=!0,o=!0)}return o&&this.invalidateCache(),i}disable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;for(const s of n){const r=this.rules.findIndex(l=>l.name===s);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${s}`);continue}i.push(s),this.rules[r].enabled&&(this.rules[r].enabled=!1,o=!0)}return o&&this.invalidateCache(),i}enableOnly(e){const t=new Set(e);let n=!1;for(const i of this.rules){const o=t.has(i.name);i.enabled!==o&&(i.enabled=o,n=!0)}n&&this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache.get(t)??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache.get(t)??[]}compileCache(){const e=new Set([""]);for(const i of this.rules)if(i.enabled&&i.alt)for(const o of i.alt)e.add(o);const t=new Map,n=new Map;for(const i of e){const o=[],s=[];for(const r of this.rules)r.enabled&&(i!==""&&!r.alt?.includes(i)||(o.push(r.fn),s.push({name:r.name,fn:r.fn})));t.set(i,o),n.set(i,s)}this.cache=t,this.namedCache=n}},nH=class{src;md;env;tokens;tokens_meta;pos;posMax;level;pending;pendingLevel;cache;delimiters;_prev_delimiters;backticks;backticksScanned;linkLevel;linkLabelNoCloseFrom;maxNesting;constructor(e,t,n,i){this.src=e,this.md=t,this.env=n,this.tokens=i,this.tokens_meta=new Array(i.length),this.pos=0,this.posMax=e.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache=[],this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0,this.linkLabelNoCloseFrom=-1,this.maxNesting=t.options.maxNesting}pushPending(){const e=new ar("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e}pushSimple(e,t){this.pending&&this.pushPending();const n=new ar(e,t,0);return n.level=this.level,this.pendingLevel=this.level,this.tokens.push(n),this.tokens_meta.push(null),n}push(e,t,n){if(this.pending&&this.pushPending(),n===0)return this.pushSimple(e,t);const i=new ar(e,t,n);let o=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),i.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(i),this.tokens_meta.push(o),i}scanDelims(e,t){const{src:n,posMax:i}=this,o=n.charCodeAt(e);let s=e;for(;s0?n.charCodeAt(e-1):32,a=s@[\]\\^_`{}~]/;function NE(e,t){switch(e.src.charCodeAt(e.pos)){case 10:return Xj(e,t);case 33:return Gj(e,t);case 38:return jj(e,t);case 42:case 95:return GC.tokenize(e,t);case 58:return e.md.options.linkify&&Jj(e,t);case 60:return Rj(e,t)||Zj(e,t);case 91:return Qj(e,t);case 92:return qj(e,t);case 96:return Oj(e,t);case 126:return YC.tokenize(e,t);default:return eH(e,t)}}function iH(e){return!phe.test(e)}var mhe=class{ruler;ruler2;cachedRulesVersion=-1;cachedRules=[];cachedRules2Version=-1;cachedRules2=[];defaultRulerVersion;defaultRuler2Version;constructor(){this.ruler=new LE,this.ruler2=new LE,this.ruler.push("text",eH),this.ruler.push("linkify",Jj),this.ruler.push("newline",Xj),this.ruler.push("escape",qj),this.ruler.push("backticks",Oj),this.ruler.push("strikethrough",YC.tokenize),this.ruler.push("emphasis",GC.tokenize),this.ruler.push("link",Qj),this.ruler.push("image",Gj),this.ruler.push("autolink",Rj),this.ruler.push("html_inline",Zj),this.ruler.push("entity",jj),this.ruler2.push("balance_pairs",$fe),this.ruler2.push("strikethrough",YC.postProcess),this.ruler2.push("emphasis",GC.postProcess),this.ruler2.push("fragments_join",Zfe),this.defaultRulerVersion=this.ruler.version,this.defaultRuler2Version=this.ruler2.version}skipToken(e){const t=e.pos,n=this.getRules(),i=n.length,o=e.cache,s=o[t],r=!!e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules"));if(s!==void 0){e.pos=s;return}let l=!1;if(e.level=e.pos)throw new Error("inline rule didn't increment state.pos");break}}}else if(this.isDefaultRuleset()){if(e.level++,l=NE(e,!0),e.level--,l&&t>=e.pos)throw new Error("inline rule didn't increment state.pos")}else for(let a=0;a=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;l||e.pos++,o[t]=e.pos}tokenize(e){const t=this.getRules(),n=t.length,i=e.posMax;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){const s=this.isDefaultRuleset();for(;e.pos=e.pos)throw new Error("inline rule didn't increment state.pos")}if(l){if(e.pos>=i)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending();return}const o=this.ruler.getNamedRules("");for(;e.pos=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(r){if(e.pos>=i)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending()}isDefaultRuleset(){return this.ruler.version===this.defaultRulerVersion&&this.ruler2.version===this.defaultRuler2Version}parseSource(e,t,n,i){if(typeof e=="string"&&e.length>0&&this.isDefaultRuleset()&&iH(e)){const a=new ar("text","",0);a.content=e,i.push(a);return}const o=new nH(e,t,n,i);this.tokenize(o);const s=this.getRules2(),r=s.length;if(!(o.env&&(Object.prototype.hasOwnProperty.call(o.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(o.env,"__mdtsProfileRules")))){for(let a=0;a0&&iH(s.content)){const r=new ar("text","",0);r.content=s.content,s.children.push(r);continue}e.md.inline.parse(s.content,e.md,e.env,s.children)}}}const vhe=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,yhe=/[0-9a-z]/i;function khe(e){return/^\s]/i.test(e)}function bhe(e){return/^<\/a\s*>/i.test(e)}function whe(e,t){if(t.schema||t.index!==0||!t.raw)return t;for(let n=1;n=0;r--){const l=o[r];if(l.type==="link_close"){for(r--;r>=0&&o[r].level!==l.level&&o[r].type!=="link_open";)r--;continue}if(l.type==="html_inline"&&(khe(l.content)&&s>0&&s--,bhe(l.content)&&s++),s>0||l.type!=="text"||!e.md.linkify.test(l.content))continue;const a=l.content;let u=(e.md.linkify.match(a)||[]).map(p=>whe(e.md.linkify,p));if(u.length===0)continue;const c=[];let d=l.level,h=0;u.length>0&&u[0].index===0&&r>0&&o[r-1].type==="text_special"&&(u=u.slice(1));for(let p=0;ph){const M=new ar("text","",0);M.content=a.slice(h,b),M.level=d,c.push(M)}const v=new ar("link_open","a",1);v.attrs=[["href",g]],v.level=d++,v.markup="linkify",v.info="auto",c.push(v);const C=new ar("text","",0);C.content=y,C.level=d,c.push(C);const w=new ar("link_close","a",-1);w.level=--d,w.markup="linkify",w.info="auto",c.push(w),h=m.lastIndex}if(h!==0){if(h=0;n--){const i=e[n];i.type==="text"&&!t&&(i.content=i.content.replace(Ihe,The)),i.type==="link_open"&&i.info==="auto"&&t--,i.type==="link_close"&&i.info==="auto"&&t++}}function Lhe(e){let t=0;for(let n=e.length-1;n>=0;n--){const i=e[n];i.type==="text"&&!t&&oH.test(i.content)&&(i.content=i.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),i.type==="link_open"&&i.info==="auto"&&t--,i.type==="link_close"&&i.info==="auto"&&t++}}function Nhe(e){if(e.md?.options?.typographer)for(let t=e.tokens.length-1;t>=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const i=n.content||(Array.isArray(n.children)?n.children.map(o=>o.type==="text"?o.content:"").join(""):"");_he.test(i)&&Ehe(n.children||[]),oH.test(i)&&Lhe(n.children||[])}}var Dhe=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t){const n=this.rules.findIndex(i=>i.name===e);n>=0&&this.rules.splice(n,1),this.rules.push({name:e,fn:t,enabled:!0}),this.invalidateCache()}at(e,t){const n=this.rules.findIndex(i=>i.name===e);if(n<0)throw new Error(`Parser rule not found: ${e}`);this.rules[n].fn=t,this.invalidateCache()}before(e,t,n){const i=this.rules.findIndex(s=>s.name===e);if(i<0)throw new Error(`Parser rule not found: ${e}`);const o=this.rules.findIndex(s=>s.name===t);o>=0&&this.rules.splice(o,1),this.rules.splice(i,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}after(e,t,n){const i=this.rules.findIndex(s=>s.name===e);if(i<0)throw new Error(`Parser rule not found: ${e}`);const o=this.rules.findIndex(s=>s.name===t);o>=0&&this.rules.splice(o,1),this.rules.splice(i+1,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;for(const s of n){const r=this.rules.findIndex(l=>l.name===s);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${s}`);continue}i.push(s),this.rules[r].enabled||(this.rules[r].enabled=!0,o=!0)}return o&&this.invalidateCache(),i}disable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;for(const s of n){const r=this.rules.findIndex(l=>l.name===s);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${s}`);continue}i.push(s),this.rules[r].enabled&&(this.rules[r].enabled=!1,o=!0)}return o&&this.invalidateCache(),i}enableOnly(e){const t=new Set(e);let n=!1;for(const i of this.rules){const o=t.has(i.name);i.enabled!==o&&(i.enabled=o,n=!0)}n&&this.invalidateCache()}compileCache(){this.cache=this.rules.filter(e=>e.enabled).map(e=>e.fn),this.namedCache=this.rules.filter(e=>e.enabled).map(e=>({name:e.name,fn:e.fn}))}getRules(e=""){return this.cache||this.compileCache(),this.cache}getNamedRules(e=""){return this.namedCache||this.compileCache(),this.namedCache}};const Fhe=/['"]/,DE=/['"]/g,FE="’";function ay(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function Rhe(e,t){let n;const i=[],o=t.md&&t.md.options&&t.md.options.quotes||"“”‘’";for(let s=0;s=0&&!(i[n].level<=l);n--);if(i.length=n+1,r.type!=="text")continue;let a=r.content,u=0,c=a.length;e:for(;u=0)g=a.charCodeAt(d.index-1);else for(n=s-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){g=e[n].content.charCodeAt(e[n].content.length-1);break}let y=32;if(u=48&&g<=57&&(p=h=!1),h&&p&&(h=b,p=v),!h&&!p){m&&(r.content=ay(r.content,d.index,FE));continue}if(p)for(n=i.length-1;n>=0;n--){let M=i[n];if(i[n].level=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const i=typeof n.content=="string"?n.content:(n.children||[]).map(o=>o.content||"").join("");!Fhe.test(i)||!n.children||Rhe(n.children,e)}}function Phe(e){const t=e.tokens||[],n=t.length;for(let i=0;i=4||o.charCodeAt(c)!==62)return!1;if(i)return!0;const p=[],m=[],g=[],y=[],b=e.md.block.ruler.getRulesForState(e,"blockquote"),v=e.parentType;e.parentType="blockquote";let C=!1,w;for(w=t;w=d)break;if(o.charCodeAt(c++)===62&&!x){let E=a[w]+1,I,R;o.charCodeAt(c)===32?(c++,E++,R=!1,I=!0):o.charCodeAt(c)===9?(I=!0,(u[w]+E)%4===3?(c++,E++,R=!1):R=!0):I=!1;let W=E;for(p.push(s[w]),s[w]=c;c=d,m.push(u[w]),u[w]=a[w]+1+(I?1:0),g.push(a[w]),a[w]=W-E,y.push(l[w]),l[w]=c-s[w];continue}if(C)break;let A=!1;for(let E=0,I=b.length;E";const T=[t,0];N.map=T,e.md.block.tokenize(e,t,w);const S=e.push("blockquote_close","blockquote",-1);S.markup=">",e.lineMax=h,e.parentType=v,T[1]=e.line;for(let x=0;x=4){i++,o=i;continue}break}e.line=o;const s=e.push("code_block","code",0);return s.content=`${e.getLines(t,o,4+e.blkIndent,!1)} -`,s.map=[t,e.line],!0}function Whe(e,t,n,i){let o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||o+3>s)return!1;const r=e.src.charCodeAt(o);if(r!==126&&r!==96)return!1;let l=o;o=e.skipChars(o,r);let a=o-l;if(a<3)return!1;const u=e.src.slice(l,o),c=e.src.slice(o,s);if(r===96&&c.includes(String.fromCharCode(r)))return!1;if(i)return!0;let d=t,h=!1;for(;d++,!(d>=n||(o=l=e.bMarks[d]+e.tShift[d],s=e.eMarks[d],o=4)&&(o=e.skipChars(o,r),!(o-l=4)return!1;let c=o.charCodeAt(a);if(c!==35||a>=u)return!1;let d=1;for(c=o.charCodeAt(++a);c===35&&a6||aa&&PE(o.charCodeAt(h-1))&&(u=h),e.line=t+1;const p=e.push("heading_open",RE[d],1);p.markup=OE[d],p.map=[t,e.line];const m=e.push("inline","",0);m.content=o.slice(a,u).trim(),m.map=[t,e.line],m.children=[];const g=e.push("heading_close",RE[d],-1);return g.markup=OE[d],!0}function Uhe(e){switch(e){case 9:case 32:return!0}return!1}function Vhe(e,t,n,i){const o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let s=e.bMarks[t]+e.tShift[t];const r=e.src.charCodeAt(s++);if(r!==42&&r!==45&&r!==95)return!1;let l=1;for(;s|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp(`^|$))`,"i"),/^$/,!0],[new RegExp(`${Qfe.source}\\s*$`),/^$/,!1]];function Khe(e,t,n,i){let o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(o)!==60)return!1;let r=e.src.slice(o,s),l=0;for(;l=48&&e<=57}var uH=class{src;md;env;tokens;bMarks=[];eMarks=[];tShift=[];sCount=[];bsCount=[];lineFlags=[];blkIndent=0;line=0;lineMax=0;tight=!1;ddIndent=-1;listIndent=-1;parentType="root";level=0;constructor(e,t,n,i){this.src=e,this.md=t,this.env=n,this.tokens=i;const o=this.src;let s=0,r=0,l=0,a=!1,u=0;for(let c=0,d=o.length;c0&&this.level++,this.tokens.push(i),i}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){const t=this.bMarks,n=this.tShift,i=this.eMarks;for(let o=this.lineMax;et;){const i=n.charCodeAt(--e);if(i!==9&&i!==32)return e+1}return e}skipChars(e,t){const n=this.src;for(let i=n.length;en;)if(t!==i.charCodeAt(--e))return e+1;return e}getLines(e,t,n,i){if(e>=t)return"";if(e+1===t){const c=e,d=this.bMarks[c];let h=d;const p=i?this.eMarks[c]+1:this.eMarks[c];let m=0;const g=this.src,y=this.bsCount,b=this.tShift;for(;hn?new Array(m-n+1).join(" ")+g.slice(h,p):g.slice(h,p)}const o=new Array(t-e),s=this.src,r=this.bMarks,l=this.eMarks,a=this.bsCount,u=this.tShift;for(let c=0,d=e;dn?o[c]=new Array(h-n+1).join(" ")+s.slice(m,g):o[c]=s.slice(m,g)}return o.join("")}};uH.prototype.Token=ar;function Ghe(e,t,n){for(let i=t;i=o)return!1;const s=n.charCodeAt(i);switch(s){case 35:case 42:case 43:case 45:case 60:case 62:case 95:case 96:case 126:return!0}return s>=48&&s<=57?!0:Ghe(n,i,o)}const BE=["","h1","h2"];function Qhe(e,t,n){const i=e.md.block.ruler.getRulesForState(e,"paragraph"),o=e.src,s=e.bMarks,r=e.tShift,l=e.eMarks,a=e.sCount,u=e.blkIndent,c=cH(e);if(a[t]-u>=4)return!1;const d=e.parentType;e.parentType="paragraph";let h=0,p,m=t+1;for(;m=M)break;if(a[m]-u>3)continue;if(a[m]>=u&&(p=o.charCodeAt(w),p===45||p===61)){let T=w+1,S=T;for(;T=M){h=p===61?1:2;break}if(S-w>1)continue}if(a[m]<0||c&&!dH(e,m,o,w,M))continue;let N=!1;for(let T=0,S=i.length;Tw;){const N=o.charCodeAt(M-1);if(N!==9&&N!==32)break;M--}g=o.slice(w,M)}else g=e.getLines(t,m,u,!1).trim();e.line=m+1;const y=p===61?"=":"-",b=e.push("heading_open",BE[h],1);b.markup=y,b.map=[t,e.line];const v=e.push("inline","",0);v.content=g,v.map=[t,e.line-1],v.children=[];const C=e.push("heading_close",BE[h],-1);return C.markup=y,e.parentType=d,!0}function fH(e){switch(e){case 9:case 32:return!0}return!1}function zE(e,t){const n=e.eMarks,i=e.bMarks,o=e.tShift,s=e.src,r=n[t];let l=i[t]+o[t];const a=s.charCodeAt(l++);return a!==42&&a!==45&&a!==43||l=l)return-1;let u=s.charCodeAt(a++);if(u<48||u>57)return-1;for(;;){if(a>=l)return-1;if(u=s.charCodeAt(a++),u>=48&&u<=57){if(a-r>=10)return-1;continue}if(u===41||u===46)break;return-1}return a0&&++o=4||e.listIndent>=0&&e.sCount[l]-e.listIndent>=4&&e.sCount[l]=e.blkIndent&&(u=!0);let c,d,h;const p=e.src,m=e.bMarks,g=e.tShift,y=e.eMarks,b=e.sCount,v=e.bsCount,C=m[l]+g[l];if(C>=y[l])return!1;const w=p.charCodeAt(C);if(w>=48&&w<=57){if(h=jE(e,l),h<0||(c=!0,r=C,d=Yhe(e,l,h),u&&d!==1))return!1}else if(w===42||w===45||w===43){if(h=zE(e,l),h<0)return!1;c=!1}else return!1;if(u&&e.skipSpaces(h)>=y[l])return!1;if(i)return!0;const M=p.charCodeAt(h-1),N=String.fromCharCode(M);if(c){const I=e.push("ordered_list_open","ol",1);d!==void 0&&d!==1&&(I.attrs=[["start",String(d)]])}else e.push("bullet_list_open","ul",1);const T=[l,0];e.tokens[e.tokens.length-1].map=T,e.tokens[e.tokens.length-1].markup=N;let S=!1;const x=e.tokens.length-1,A=e.md.block.ruler.getRulesForState(e,"list"),E=e.parentType;for(e.parentType="list";l=o?z=1:z=R-I,z>4&&(z=1);const F=I+z,O=e.push("list_item_open","li",1);O.markup=N;const B=[l,0];O.map=B,c&&(O.info=h-r-1===1?Jhe[p.charCodeAt(r)-48]:p.slice(r,h-1));const j=e.tight,$=e.tShift[l],V=e.sCount[l],ne=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=F,e.tight=!0,e.tShift[l]=W-m[l],e.sCount[l]=R,W>=o&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n,!0),(!e.tight||S)&&(a=!1),S=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=ne,e.tShift[l]=$,e.sCount[l]=V,e.tight=j,e.push("list_item_close","li",-1).markup=N,l=e.line,B[1]=l,l>=n||e.sCount[l]=4)break;let K=!1;for(let ee=0,ue=A.length;ee3||u[h]<0)continue;if(o==="list"&&u[h]>=c){const C=r[h]+l[h],w=a[h];if(C=w||HE(s.charCodeAt(C+1)))break}else if(M>=48&&M<=57&&C+1=w){N=-1;break}const T=s.charCodeAt(N++);if(T>=48&&T<=57){if(N-C>=10){N=-1;break}continue}if((T===41||T===46)&&(N>=w||HE(s.charCodeAt(N))))break;N=-1;break}if(N>=0)break}}}const y=r[h]+l[h],b=a[h];if(d&&!dH(e,h,s,y,b))continue;let v=!1;for(let C=0,w=i.length;C=4||e.src.charCodeAt(o)!==91)return!1;function a(C){const w=e.lineMax;if(C>=w||e.isEmpty(C))return null;let M=!1;if(e.sCount[C]-e.blkIndent>3&&(M=!0),e.sCount[C]<0&&(M=!0),!M){const S=e.parentType;e.parentType="reference";let x=!1;for(let A=0,E=l.length;A"u"&&(e.env.references={}),typeof e.env.references[v]>"u"&&(e.env.references[v]={title:b,href:h}),e.line=r),!0):!1}function C8(e){switch(e){case 9:case 32:return!0}return!1}const ipe=65536;function A8(e,t){const n=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];return e.src.slice(n,i)}function ope(e,t){if(e.lineFlags)return(e.lineFlags[t]&A0.Pipe)!==0;for(let n=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];nn)return!1;let o=t+1;if(e.sCount[o]=4)return!1;let s=e.bMarks[o]+e.tShift[o];if(s>=e.eMarks[o])return!1;const r=e.src.charCodeAt(s++);if(r!==124&&r!==45&&r!==58||s>=e.eMarks[o])return!1;const l=e.src.charCodeAt(s++);if(l!==124&&l!==45&&l!==58&&!C8(l)||r===45&&C8(l)||!ope(e,t))return!1;for(;s=4)return!1;u=WE(a),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop();const d=u.length;if(d===0||d!==c.length)return!1;if(i)return!0;const h=e.parentType;e.parentType="table";const p=e.md.block.ruler.getRulesForState(e,"blockquote"),m=e.push("table_open","table",1),g=[t,0];m.map=g;const y=e.push("thead_open","thead",1);y.map=[t,t+1];const b=e.push("tr_open","tr",1);b.map=[t,t+1];for(let w=0;w=4||(u=WE(a),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop(),C+=d-u.length,C>ipe))break;if(o===t+2){const N=e.push("tbody_open","tbody",1);N.map=v=[t+2,0]}const M=e.push("tr_open","tr",1);M.map=[o,o+1];for(let N=0;Nr.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this._rules.findIndex(r=>r.name===t);s>=0&&this._rules.splice(s,1),this._rules.splice(o,0,{name:t,enabled:!0,fn:n,alt:i?.alt||[]}),this.invalidateCache()}after(e,t,n,i){const o=this._rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this._rules.findIndex(r=>r.name===t);s>=0&&this._rules.splice(s,1),this._rules.splice(o+1,0,{name:t,enabled:!0,fn:n,alt:i?.alt||[]}),this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache[t]??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache[t]??[]}getRulesForState(e,t){const n=e?.env;return n&&(Object.prototype.hasOwnProperty.call(n,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(n,"__mdtsProfileRules"))?this.getNamedRules(t).map(({name:i,fn:o})=>(s,r,l,a)=>{const u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now(),c=o(s,r,l,a),d=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();return q1(s?.env,"block",i,d-u,c,!!a),c}):this.getRules(t)}at(e,t,n){const i=this._rules.findIndex(o=>o.name===e);if(i===-1)throw new Error(`Parser rule not found: ${e}`);this._rules[i].fn=t,n?.alt&&(this._rules[i].alt=n.alt),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;return n.forEach(s=>{const r=this._rules.findIndex(l=>l.name===s);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${s}`)}i.push(s),this._rules[r].enabled||(this._rules[r].enabled=!0,o=!0)}),o&&this.invalidateCache(),i}disable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;return n.forEach(s=>{const r=this._rules.findIndex(l=>l.name===s);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${s}`)}i.push(s),this._rules[r].enabled&&(this._rules[r].enabled=!1,o=!0)}),o&&this.invalidateCache(),i}enableOnly(e){const t=new Set(e);let n=!1;for(const i of this._rules){const o=t.has(i.name);i.enabled!==o&&(i.enabled=o,n=!0)}n&&this.invalidateCache()}compileCache(){const e=new Set([""]);for(const i of this._rules)if(i.enabled)for(const o of i.alt)e.add(o);const t=Object.create(null),n=Object.create(null);for(const i of e){const o=[],s=[];for(const r of this._rules)r.enabled&&(i!==""&&!r.alt.includes(i)||(o.push(r.fn),s.push({name:r.name,fn:r.fn})));t[i]=o,n[i]=s}this.cache=t,this.namedCache=n}};const cy=[["table",spe,["paragraph","reference"]],["code",Hhe],["fence",Whe,["paragraph","reference","blockquote","list"]],["blockquote",jhe,["paragraph","reference","blockquote","list"]],["hr",Vhe,["paragraph","reference","blockquote","list"]],["list",epe,["paragraph","reference","blockquote"]],["reference",npe],["html_block",Khe,["paragraph","reference","blockquote"]],["heading",qhe,["paragraph","reference","blockquote"]],["lheading",Qhe],["paragraph",tpe]];var lpe=class{ruler;cachedRulesVersion=-1;cachedRules=[];constructor(){this.ruler=new rpe;for(let e=0;e=a[c];)c++;if(e.line=c,c>=n||u[c]=s){e.line=n;break}const p=e.line;let m=!1;for(let g=0;g=e.line)throw new Error("block rule didn't increment state.line");break}if(!m)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),c=e.line,c=a[c]&&(d=!0,c++,e.line=c)}return}const h=this.ruler.getNamedRules("");for(;c=a[c];)c++;if(e.line=c,c>=n||u[c]=s){e.line=n;break}const p=e.line;let m=!1;for(let g=0;g=e.line)throw new Error("block rule didn't increment state.line");break}}if(!m)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),c=e.line,c=a[c]&&(d=!0,c++,e.line=c)}}parse(e,t,n,i){if(!e||e.length===0)return;const o=new uH(e,t,n,i);this.tokenize(o,o.line,o.lineMax)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(""),this.cachedRulesVersion=this.ruler.version),this.cachedRules}},hH=class{src;env;tokens;inlineMode;md;constructor(e,t,n={}){this.src=typeof e=="string"?e||"":e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}};hH.prototype.Token=ar;const qE=[["normalize",She],["block",Nfe],["inline",ghe],["linkify",Che],["replacements",Nhe],["smartquotes",Ohe],["text_join",Phe]],ape={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:100},upe={parseLinkLabel:K7,parseLinkDestination:V7,parseLinkTitle:Z7};function cpe(){return{...ape}}function dpe(){return{...upe}}var fpe=class{fallbackParser;lastState=null;block;inline;ruler;linkifyInstance=null;cachedCoreRulesVersion=-1;cachedCoreRules=[];cachedCoreNamedRulesVersion=-1;cachedCoreNamedRules=[];constructor(){this.block=new lpe,this.inline=new mhe,this.ruler=new Dhe;for(let e=0;e@[\]\\^_`{}~]/;function Rk(e){return!hpe.test(e)}function Qg(e,t){const n=e.indexOf(` -`,t);return n===-1?e.length:n}function p9(e,t,n){for(let i=t;i3)return Rk(e);for(let t=0;t=i||t.charCodeAt(r)!==32)return!1;let l=r+1;for(;ll&&t.charCodeAt(a-1)===32;)a--;let u=a;for(;u>l&&t.charCodeAt(u-1)===35;)u--;if(u>l&&t.charCodeAt(u-1)===32)for(a=u-1;a>l&&t.charCodeAt(a-1)===32;)a--;const c=t.slice(l,a);if(!Rk(c))return!1;const d=mpe[s],h=gpe[s],p=ja("heading_open",d,1,0);p.map=[o,o+1],p.markup=h,e.push(p),e.push(J7(c,o,1));const m=ja("heading_close",d,-1,0);return m.markup=h,e.push(m),!0}function ype(e,t,n){const i=ja("paragraph_open","p",1,0);i.map=[n,n+1],e.push(i),e.push(J7(t,n,1)),e.push(ja("paragraph_close","p",-1,0))}function kpe(e,t,n){const i=e.charCodeAt(n-1);return i===32||i===9?e.slice(t,n).trim():e.slice(t,n)}function I8(e,t){for(;t=1e5?VE:_8,o="",s=!1,r=!1,l=0,a=0;for(;l"]/,KE=/[&<>"]/g,_pe=/&/g,Ipe=/[<>"]/g,Mpe={"&":"&","<":"<",">":">",'"':"""};function M8(e){return Mpe[e]||e}function eo(e){if(e.length===0)return"";if(e.length<32)return Spe.test(e)?e.replace(KE,M8):e;const t=e.includes("&"),n=e.includes("<"),i=e.includes(">"),o=e.includes('"');return!t&&!n&&!i&&!o?e:t&&!n&&!i&&!o?e.replace(_pe,"&"):t?e.replace(KE,M8):e.replace(Ipe,M8)}const Tpe=new RegExp(`${/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),Epe=/^#(?:x[a-f0-9]{1,8}|\d{1,8})$/i;function pH(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(Tpe,(t,n,i)=>{if(n)return n;if(Epe.test(i)){const s=i[1].toLowerCase()==="x"?Number.parseInt(i.slice(2),16):Number.parseInt(i.slice(1),10);return k4(s)?kv(s):"�"}const o=P7(t);return o!==t?o:t})}const Lpe=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/,Npe=/[\n!"#$%&*+\-:<=>@[\]\\^_`{}~]/,Dpe=/"/g;function w1(e,t){const n=e.indexOf(` -`,t);return n===-1?e.length:n}function Ok(e,t,n){for(let i=t;i=e.length||e.charCodeAt(t)===10?!1:!Ok(e,t,w1(e,t))}function ZE(e,t,n){return t+2=n||e.charCodeAt(o)!==32)return null;let s=o+1;for(;ss&&e.charCodeAt(r-1)===32;)r--;let l=r;for(;l>s&&e.charCodeAt(l-1)===35;)l--;if(l>s&&e.charCodeAt(l-1)===32)for(r=l-1;r>s&&e.charCodeAt(r-1)===32;)r--;const a=X7(e.slice(s,r));return a===null?null:`${a} -`}function GE(e,t,n){return t+1" -`;case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return null}return`
  • ${e[t]}
  • -`}function $pe(e,t,n){const i=t+2;if(n===i+1)return Ppe(e,i);const o=X7(e.slice(t+2,n));return o===null?null:`
  • ${o}
  • -`}function Bpe(e,t,n){for(;tt;){const o=e.charCodeAt(n-1);if(o!==32&&o!==9)break;n--}let i=n;for(let o=t;o`:"
    ",i.lang=s,i.open=d),{html:`${d}${eo(c)}
    -`,nextPos:u=25e4,s=[],r={lang:null,open:""};let l="",a="",u="",c="";for(;n -`;w -`,l=b,a=v}let C=dy(e,y);for(;C${y}

    -`,u=p,c=m}const g=de.core.parse(t,n,e).tokens);let r=m9(t,o);if(o.maxChunks&&r.length>o.maxChunks&&(r=Upe(r,o.maxChunks)),g9(t,r))return k8(n,{count:1,fallback:!0,fallbackReason:"unsafe-chunk-boundary",maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines}),W1(n,s,()=>e.core.parse(t,n,e).tokens);let l=0;const a=[];return k8(n,{count:r.length,maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines,globalStateDetected:s||void 0,globalStateFallbackDisabled:o.fallbackOnGlobalState===!1&&!!s}),W1(n,s,()=>{for(let u=0;u=3&&(c?c.marker===C&&M>=c.length&&(c=null):c={marker:C,length:M})}}const y=m-h;o+=y,s+=1,l+=1,g?(a=0,u=0):(a+=1,u+=y);const b=g;if((o>=t.maxChunkChars||s>=t.maxChunkLines)&&!c)if(b)d(m);else{const v=Math.max(10,Math.floor(t.maxChunkLines*.5)),C=Math.max(t.maxChunkChars,8e3);(a>=v||u>=C)&&d(m)}h=m}return n&&d(e.length),i}function g9(e,t,n={rangesCoverWholeSource:!0}){const i=n.rangesCoverWholeSource?t.length-1:t.length;for(let o=0;oe.length||e.charCodeAt(t-1)!==10)return!1;let n=t-2;for(;n>=0&&e.charCodeAt(n)!==10;)n--;for(let i=n+1;i=0;i--)n.push(e[i]);for(;n.length;){const i=n.pop();if(i.map&&(i.map[0]+=t,i.map[1]+=t),i.children)for(let o=i.children.length-1;o>=0;o--)n.push(i.children[o])}}function qpe(e,t){for(let n=0;n=0;i--)n.push(e[i]);for(;n.length;){const i=n.pop();if(i.map&&(i.map[0]+=t,i.map[1]+=t),i.children)for(let o=i.children.length-1;o>=0;o--)n.push(i.children[o])}}function bd(e){return e.length===0?0:ds(e)+(e.charCodeAt(e.length-1)===10?0:1)}function Jpe(e,t,n){for(let i=t;i=3&&(n?n.marker===r&&a>=n.length&&(n=null):n={marker:r,length:a})}i=o===e.length?e.length:o+1}return n!==null}function e1e(e,t){if(e.length===0||e.charCodeAt(e.length-1)!==10)return!1;let n=e.length-2;for(;n>=0&&e.charCodeAt(n)!==10;)n--;return Jpe(e,n+1,e.length-1)?!Xpe(e,t):!1}function t1e(e,t,n,i={}){const o=i.mode??"full",s=i.fenceAware??(o==="stream"?e.options.streamChunkFenceAware??!0:e.options.fullChunkFenceAware??!0);if(i.maxChunkChars!==void 0||i.maxChunkLines!==void 0||i.autoTune===!1){const r=i.maxChunkChars??(o==="stream"?e.options.streamChunkSizeChars??Gpe:e.options.fullChunkSizeChars??Kpe),l=i.maxChunkLines??(o==="stream"?e.options.streamChunkSizeLines??Qpe:e.options.fullChunkSizeLines??Zpe);return{maxChunkChars:r,maxChunkLines:l,holdBelowChars:r,holdBelowLines:l,fenceAware:s}}return o==="stream"?t<=5e3?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:s}:t<=2e4?{maxChunkChars:16e3,maxChunkLines:200,holdBelowChars:16e3,holdBelowLines:200,fenceAware:s}:t<=5e4?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:s}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:s}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:s}:t<=1e5&&n<=2500?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:1e5,holdBelowLines:2500,fenceAware:s}:t<=2e5?{maxChunkChars:2e4,maxChunkLines:150,holdBelowChars:2e4,holdBelowLines:150,fenceAware:s}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:s}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:s}}var n2=class{md;options;pending="";tokens=[];committedChars=0;committedLines=0;fedChunks=0;parsedChunks=0;globalStateEnv=null;markedGlobalStateReason=null;constructor(e,t={}){if(this.md=e,this.options={mode:"full",autoTune:!0,retainTokens:!0,...t},this.options.retainTokens===!1&&!this.options.onChunkTokens)throw new Error("UnboundedBuffer with retainTokens=false requires onChunkTokens")}feed(e){e&&(this.pending+=e,this.fedChunks+=1)}flushAvailable(e={}){if(!this.pending)return null;const t=this.resolveWindow(),n=bd(this.pending);if(this.pending.length=i||n>=o}function bH(e,t,n){if(e.options.autoUnbounded===!1)return"no";if(t>=(e.options.autoUnboundedThresholdChars??gH))return"yes";const i=e.options.autoUnboundedThresholdLines??vH;return n!==void 0?n>=i?"yes":"no":t+1e.core.parse(t,n,e).tokens);const s=[],r=new n2(e,{mode:"full",...i,retainTokens:!1,onChunkTokens(l){yH(s,l)}});if(o&&q7(n,o),r.feed(t),r.flushForce(n),o&&(U7(n),i.fallbackOnGlobalState===!1)){const l=Fc(n)?.unbounded;l&&(l.globalStateDetected=o,l.globalStateFallbackDisabled=!0)}return s}const U1=(e,t,n)=>en?n:e;function wH(e){return e.experimental?{...e,...e.experimental}:e}const JE=[{max:5e3,strategy:"discrete",maxChunkChars:32e3,maxChunkLines:150,maxChunks:8,notes:"<=5k"},{max:2e4,strategy:"discrete",maxChunkChars:24e3,maxChunkLines:200,maxChunks:12,notes:"<=20k"},{max:1e5,strategy:"plain",notes:"<=100k plain"},{max:2e5,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:150,maxChunks:12,notes:"<=200k"},{max:5e5,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:16,notes:"<=500k"},{max:5e6,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:16,notes:"<=5M"}],XE=[{max:5e3,strategy:"discrete",maxChunkChars:16e3,maxChunkLines:250,maxChunks:8,notes:"<=5k"},{max:2e4,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:200,maxChunks:24,notes:"<=20k"},{max:1e5,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:200,maxChunks:24,notes:"<=100k"},{max:5e5,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:32,notes:"<=500k"},{max:5e6,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:32,notes:"<=5M"}];function CH(e,t){return{strategy:t.strategy,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,maxChunks:t.maxChunks,fenceAware:e,notes:t.notes}}function r1e(e,t=Math.max(0,e/40|0),n={}){const i=wH(n),o=i.fullChunkFenceAware??!0,s=i.fullChunkTargetChunks??8,r=i.fullChunkAdaptive!==!1;for(let l=0;l5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:U1(Math.ceil(e/s),8e3,64e3),maxChunkLines:U1(Math.ceil(t/s),150,700),maxChunks:U1(Math.ceil(e/64e3),s,16),fenceAware:o,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:i.fullChunkSizeChars??1e4,maxChunkLines:i.fullChunkSizeLines??200,fenceAware:o,maxChunks:i.fullChunkMaxChunks}}function eL(e,t=Math.max(0,e/40|0),n={}){const i=wH(n),o=i.streamChunkFenceAware??!0,s=i.streamChunkTargetChunks??8,r=i.streamChunkAdaptive!==!1;for(let l=0;l5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:U1(Math.ceil(e/s),8e3,64e3),maxChunkLines:U1(Math.ceil(t/s),150,700),maxChunks:U1(Math.ceil(e/64e3),s,32),fenceAware:o,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:i.streamChunkSizeChars??1e4,maxChunkLines:i.streamChunkSizeLines??200,maxChunks:i.streamChunkMaxChunks,fenceAware:o}}var l1e={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"]},inline2:{rules:["balance_pairs","emphasis","fragments_join"]}}},a1e={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},u1e={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"]},inline2:{rules:["balance_pairs","fragments_join"]}}};function w4(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function v9(e,t){if(w4(e))throw new TypeError(`Renderer rule "${t}" returned a Promise. Use renderAsync() instead.`);return e}const tL=e=>w4(e)?e:Promise.resolve(e);function S0(e){switch(e){case"alt":case"class":case"href":case"id":case"lang":case"rel":case"src":case"start":case"style":case"target":case"title":return e;default:return eo(e)}}function pf(e){if(!e||e.length===0)return"";const t=e[0];let n=` ${S0(t[0])}="${eo(t[1])}"`;for(let i=1;i=e.length)return{langName:e,langAttrs:""};let n=t;for(;n${t} -`;const s=e.attrIndex("class"),r=e.attrs?e.attrs.slice():[],l=`${o.langPrefix??"language-"}${i}`;return s<0?r.push(["class",l]):(r[s]=r[s].slice(),r[s][1]+=` ${l}`),`
    ${t}
    -`}return`
    ${t}
    -`}function wv(e){return!e.attrs||e.attrs.length===0?`${eo(e.content)}`:`${eo(e.content)}`}function JC(e){const t=eo(e.content);return e.attrs?`${t} -`:`
    ${t}
    -`}function c1e(e,t){const n=e.attrs;if(!n||n.length===0)switch(e.type){case"paragraph_open":return`${t}

    `;case"heading_open":return`<${e.tag}>`;case"td_open":return`${t}`;case"th_open":return`${t}`;default:return null}if(n.length===1&&n[0][0]==="style"){if(e.type==="td_open")return`${t}`;if(e.type==="th_open")return`${t}`}return null}function nL(e){const t=e.attrs;return!t||t.length===0?"":t.length===1?``:t.length===2?``:``}function d1e(e){switch(e.type){case"text":case"text_special":case"softbreak":case"hardbreak":case"html_inline":case"code_inline":case"image":return!0;default:return!1}}function iL(e){switch(e.type){case"text":case"text_special":case"softbreak":case"hardbreak":case"html_inline":case"code_inline":return!0;default:return!1}}function $k(e,t){if(e.hidden)return"";const n=e.attrs,i=e.nesting,o=e.tag;if(!n||n.length===0)return i===0?t?`<${o} />`:`<${o}>`:i===-1?``:`<${o}>`;let s=(i===-1?"`}const f1e={langPrefix:"language-",xhtmlOut:!1,breaks:!1},fy=Object.prototype.hasOwnProperty,Mi={code_inline(e,t){return wv(e[t])},code_block(e,t){return JC(e[t])},fence(e,t,n,i,o){const s=e[t],r=s.info?pH(s.info).trim():"",{langName:l,langAttrs:a}=AH(r),u=n.highlight,c=eo(s.content);if(!u)return _0(s,c,r,l,n);const d=u(s.content,l,a);return w4(d)?d.then(h=>_0(s,h||c,r,l,n)):_0(s,d||c,r,l,n)},image(e,t,n,i,o){const s=e[t],r=o.renderInlineAsText(s.children||[],n,i),l=s.attrIndex("alt");return l>=0&&s.attrs?s.attrs[l][1]=r:s.attrs?s.attrs.push(["alt",r]):s.attrs=[["alt",r]],$k(s,n.xhtmlOut===!0)},hardbreak(e,t,n){return n.xhtmlOut?`
    -`:`
    -`},softbreak(e,t,n){return n.breaks?n.xhtmlOut?`
    -`:`
    -`:` -`},text(e,t){return eo(e[t].content)},text_special(e,t){return eo(e[t].content)},html_block(e,t){return e[t].content},html_inline(e,t){return e[t].content}};function oL(e,t,n){const i=e.info?pH(e.info).trim():"",{langName:o,langAttrs:s}=AH(i),r=t.highlight,l=eo(e.content);if(!r)return _0(e,l,i,o,t);const a=r(e.content,o,s);if(w4(a))throw new TypeError('Renderer rule "fence" returned a Promise. Use renderAsync() instead.');return _0(e,a||l,i,o,t)}function T8(e,t,n,i){switch(e.type){case"text":return t.text===Mi.text?e.content.length===0?"":eo(e.content):null;case"text_special":return t.text_special===Mi.text_special?e.content.length===0?"":eo(e.content):null;case"softbreak":return t.softbreak===Mi.softbreak?i:null;case"hardbreak":return t.hardbreak===Mi.hardbreak?n:null;case"html_inline":return t.html_inline===Mi.html_inline?e.content:null;case"code_inline":return t.code_inline===Mi.code_inline?wv(e):null;default:return null}}function h1e(e,t,n,i,o){const s=e[0];switch(s.type){case"text":if(o.text===Mi.text)return s.content.length===0?"":eo(s.content);break;case"text_special":if(o.text_special===Mi.text_special)return s.content.length===0?"":eo(s.content);break;case"softbreak":if(o.softbreak===Mi.softbreak)return t.breaks?t.xhtmlOut?`
    -`:`
    -`:` -`;break;case"hardbreak":if(o.hardbreak===Mi.hardbreak)return t.xhtmlOut?`
    -`:`
    -`;break;case"html_inline":if(o.html_inline===Mi.html_inline)return s.content;break;case"code_inline":if(o.code_inline===Mi.code_inline)return wv(s);break}const r=o[s.type];if(!r)return $k(s,t.xhtmlOut===!0);const l=r(e,0,t,n,i);return typeof l=="string"?l:v9(l,s.type)}var p1e=class{rules;baseOptions;normalizedBase;constructor(e={}){this.baseOptions={...e},this.normalizedBase=this.buildNormalizedBase(),this.rules={...Mi}}set(e){return this.baseOptions={...this.baseOptions,...e},this.normalizedBase=this.buildNormalizedBase(),this}render(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");if(e.length===1)return this.renderSingleToken(e,e[0],t,n);const i=this.mergeOptions(t),o=n??{},s=this.rules,r=i.xhtmlOut===!0;let l,a,u,c,d,h,p="",m="",g=!1,y="";for(let b=0;b0&&e[b-1].hidden?` -`:"";if(C==="list_item_open"&&(!v.attrs||v.attrs.length===0)&&b+3${this.renderInlineTokens(S.children||[],i,o)}`,b+=3;continue}}if(b+2 -`,b+=2;continue}}}if(C==="inline"){const T=v.children||[];if(T.length===1){g||(l=s.text,a=s.text_special,u=s.softbreak,c=s.hardbreak,d=s.html_inline,h=s.code_inline,p=i.xhtmlOut?`
    -`:`
    -`,m=i.breaks?p:` -`,g=!0);const S=T[0];switch(S.type){case"text":if(l===Mi.text){y+=eo(S.content);continue}break;case"text_special":if(a===Mi.text_special){y+=eo(S.content);continue}break;case"softbreak":if(u===Mi.softbreak){y+=m;continue}break;case"hardbreak":if(c===Mi.hardbreak){y+=p;continue}break;case"html_inline":if(d===Mi.html_inline){y+=S.content;continue}break;case"code_inline":if(h===Mi.code_inline){y+=wv(S);continue}break}}y+=this.renderInlineTokens(T,i,o);continue}const M=s[C];if(!M){const T=v.attrs;if(!v.hidden){if(!T||T.length===0)switch(C){case"hr":y+=r?`


    -`:`
    -`;continue;case"heading_open":y+=`<${v.tag}>`;continue;case"heading_close":y+=` -`;continue;case"paragraph_open":y+=`${w}

    `;continue;case"paragraph_close":y+=`

    -`;continue;case"list_item_open":{const S=e[b+1];y+=w+(S&&(S.type==="inline"||S.hidden||S.nesting===-1&&S.tag==="li")?"
  • ":`
  • -`);continue}case"list_item_close":y+=`
  • -`;continue;case"bullet_list_open":y+=`${w}
      -`;continue;case"bullet_list_close":y+=`
    -`;continue;case"blockquote_open":y+=w+(e[b+1]&&e[b+1].nesting===-1&&e[b+1].tag==="blockquote"?"
    ":`
    -`);continue;case"blockquote_close":y+=`
    -`;continue;case"ordered_list_open":y+=`${w}
      -`;continue;case"ordered_list_close":y+=`
    -`;continue;case"table_open":y+=`${w} -`;continue;case"table_close":y+=`
    -`;continue;case"thead_open":y+=`${w} -`;continue;case"thead_close":y+=` -`;continue;case"tbody_open":y+=`${w} -`;continue;case"tbody_close":y+=` -`;continue;case"tr_open":y+=`${w} -`;continue;case"tr_close":y+=` -`;continue;case"td_open":y+=`${w}`;continue;case"td_close":y+=` -`;continue;case"th_open":y+=`${w}`;continue;case"th_close":y+=` -`;continue}else if(T.length===1){const S=T[0];if(C==="ordered_list_open"&&S[0]==="start"){y+=`${w}
      -`;continue}if(C==="td_open"&&S[0]==="style"){y+=`${w}`;continue}if(C==="th_open"&&S[0]==="style"){y+=`${w}`;continue}}}y+=this.renderToken(e,b,i);continue}if(C==="code_block"&&M===Mi.code_block){y+=JC(v);continue}if(C==="fence"&&M===Mi.fence){y+=oL(v,i);continue}if(C==="html_block"&&M===Mi.html_block){y+=v.content;continue}const N=M(e,b,i,o,this);typeof N=="string"?y+=N:y+=v9(N,v.type)}return y}async renderAsync(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");const i=this.mergeOptions(t),o=n??{},s=this.rules;let r="";for(let l=0;l0&&e[t-1].hidden?` -`:"",c=a?`> -`:">";if(!l||l.length===0)return s===0?n.xhtmlOut?`${u}<${r} /${c}`:`${u}<${r}${c}`:s===-1?`${u}(n||(n={...t}),n);if(fy.call(e,"highlight")&&e.highlight!==t.highlight&&(i().highlight=e.highlight),fy.call(e,"langPrefix")){const o=e.langPrefix;o!==t.langPrefix&&(i().langPrefix=o)}if(fy.call(e,"xhtmlOut")){const o=e.xhtmlOut;o!==t.xhtmlOut&&(i().xhtmlOut=o)}if(fy.call(e,"breaks")){const o=e.breaks;o!==t.breaks&&(i().breaks=o)}return n||t}buildNormalizedBase(){return Object.freeze({...f1e,...this.baseOptions})}renderSingleToken(e,t,n,i){const o=this.rules,s=t.type;if(s==="code_block"&&o.code_block===Mi.code_block)return JC(t);if(s==="html_block"&&o.html_block===Mi.html_block)return t.content;const r=this.mergeOptions(n),l=i??{};if(s==="inline")return this.renderInlineTokens(t.children||[],r,l);const a=o[s];if(!a)return t.block?this.renderToken(e,0,r):$k(t,r.xhtmlOut===!0);if(s==="fence"&&a===Mi.fence)return oL(t,r);const u=a(e,0,r,l,this);return typeof u=="string"?u:v9(u,s)}renderInlineTokens(e,t,n){if(!e||e.length===0)return"";const i=this.rules;if(e.length===1)return h1e(e,t,n,this,i);const o=t.xhtmlOut===!0,s=o?`
      -`:`
      -`,r=t.breaks?s:` -`,l=i.text,a=i.text_special,u=i.softbreak,c=i.hardbreak,d=i.html_inline,h=i.code_inline,p=i.link_open,m=i.link_close,g=i.em_open,y=i.em_close,b=i.strong_open,v=i.strong_close;let C="";for(let w=0;w`;if(u===Mi.softbreak&&w+3`,w+=1;continue}if(M.type==="em_open"&&!g&&!y&&w+2${x}`,w+=2;continue}}}if(M.type==="strong_open"&&!b&&!v&&w+2${x}`,w+=2;continue}}}switch(M.type){case"text":if(l===Mi.text){const S=M.content.length===0?"":eo(M.content);if(d===Mi.html_inline&&w+1=4)return!0;continue}if(l===9){if(r+=4-r%4,s++,r>=4)return!0;continue}break}if(s0&&u<=6){if(a=3)return!0;break}default:if(l>=48&&l<=57){let a=s+1;for(;a57)break;a++}if(a=Te,!G&&Ee!==void 0&&(Me=ds(e),G=Me>=Ee)),G){const Z=this.parseFullDocument(e,R,n,Me,!1);return this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",Ls(R,{area:"stream",path:"stream-full",reason:"skip-cache-large-one-shot",unbounded:!!Fc(R)?.unbounded}),Z.tokens}else if(B){const Z=(ke,le,se)=>kese?se:ke;Me===void 0&&(Me=ds(e));const Q=ue&&!ee?eL(e.length,Me,n.options):null,fe=Q?.maxChunkChars??(j?Z(Math.ceil(e.length/$),8e3,64e3):V??1e4),de=Q?.maxChunkLines??(j?Z(Math.ceil(Me/$),150,700):ne??200),pe=Q?.maxChunks??(j?Z(Math.ceil(e.length/64e3),$,32):K),X=e.length>0&&e.charCodeAt(e.length-1)===10,re=O&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&Q?.strategy!=="plain";if((F||re)&&(e.length>=fe*2||Me>=de*2)&&X){const ke=Pk(n,e,R,{maxChunkChars:fe,maxChunkLines:de,fenceAware:Q?.fenceAware??ie,maxChunks:pe});return this.cache={src:e,tokens:ke,env:R,lineCount:Me,lastSegment:void 0,globalStateReason:Rl(e)},this.updateCacheLineCount(this.cache,Me),this.recordChunkedParseResult(R,F?"explicit-initial-large-doc":"default-initial-large-doc"),ke}}const oe=this.parseFullDocument(e,R,n,Me);return Me=oe.lineCount,this.cache={src:e,tokens:oe.tokens,env:R,lineCount:Me,lastSegment:void 0,globalStateReason:Rl(e)},this.updateCacheLineCount(this.cache,Me),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",Ls(R,{area:"stream",path:"stream-full",reason:"initial-parse",unbounded:!!Fc(R)?.unbounded}),oe.tokens}if(e===o.src)return this.stats.total+=1,this.stats.cacheHits+=1,this.stats.lastMode="cache",Ls(o.env,{area:"stream",path:"stream-cache",reason:"same-source"}),o.tokens;const s=e.startsWith(o.src)?e.slice(o.src.length):null;let r=o.globalStateReason;r===void 0&&(r=Rl(o.src),o.globalStateReason=r);const l=r?null:s!==null?this.detectGlobalStateForAppend(o,s):Rl(e),a=r||l;if(a){const R=i??o.env;rd(R);const W=Rl(e),z=this.parseFullDocument(e,R,n),F=z.tokens,O=z.lineCount;return this.cache={src:e,tokens:F,env:R,lineCount:O,lastSegment:void 0,globalStateReason:W},this.updateCacheLineCount(this.cache,O),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",Ls(R,{area:"stream",path:"stream-full",reason:`global-state:${a}`,unbounded:!!Fc(R)?.unbounded}),F}const u=n.options?.streamOptimizationMinSize??this.MIN_SIZE_FOR_OPTIMIZATION;if(o.src.length5e3?W=8:c.length>1e3?W=6:c.length>200&&(W=4),W=Math.min(W,R);let z=null;const F=n.options?.streamContextParseStrategy??"chars",O=n.options?.streamContextParseMinChars??200,B=n.options?.streamContextParseMinLines??2;let j;const $=()=>(j===void 0&&(j=ds(c)),j),V=this.canDirectlyParseAppend(o),ne=V&&this.shouldUseUnboundedAppend(e,o,c);let K=!1;if(!V)switch(F){case"lines":K=$()>=B;break;case"constructs":if(c.length>=O){K=!0;break}if(v1e(c)){K=!0;break}K=$()>=B;break;case"chars":default:K=c.length>=O}if(W>0&&K){const ie=this.getTailLines(o.src,W)+c;try{const ye=this.core.parse(ie,o.env,n).tokens,Te=ye.findIndex(Ee=>Ee.map&&typeof Ee.map[1]=="number"&&Ee.map[1]>W);if(Te!==-1){const Ee=ye.slice(Te),Me=R-W;Me!==0&&this.shiftTokenLines(Ee,Me),z={tokens:Ee}}}catch{z=null}}else z=null;if(!z){const ie=R;if(ne)z={tokens:x0(n,c,o.env,{mode:"stream"})},ie>0&&this.shiftTokenLines(z.tokens,ie);else{const ye=this.core.parse(c,o.env,n);ie>0&&this.shiftTokenLines(ye.tokens,ie),z=ye}}let ee=0;if(o.tokens.length>0&&z.tokens.length>0){const ie=o.tokens[o.tokens.length-1],ye=z.tokens[0];try{ie.type==="inline"&&ye.type==="inline"&&(ye.children&&ye.children.length>0&&(ie.children||(ie.children=[]),this.appendTokens(ie.children,ye.children)),ie.content=(ie.content||"")+(ye.content||""),ee=1)}catch{ee=0}}const ue=o.tokens.length;if(z.tokens.length>ee){const ie=o.tokens,ye=z.tokens,Te=Math.min(ie.length,ye.length-ee);let Ee=0;for(let Me=Te;Me>0;Me--){let G=!0;for(let oe=0;oe0&&(ee+=Ee),ye.length>ee&&this.appendTokens(o.tokens,ye,ee)}if(o.src=e,o.globalStateReason=null,o.lineCount=R+(j??$()),o.tokens.length>ue){const ie=this.getLastSegment(o.tokens,e,ue,o.tokens.length,e.length-c.length,R);ie?o.lastSegment=ie:o.lastSegment=void 0}else o.lastSegment=void 0;return this.stats.total+=1,this.stats.appendHits+=1,ne&&(this.stats.unboundedAppendHits=(this.stats.unboundedAppendHits||0)+1),this.stats.lastMode="append",Ls(o.env,{area:"stream",path:ne?"stream-unbounded-append":"stream-append",reason:ne?"large-delta":"safe-append",unbounded:ne}),o.tokens}const d=i??o.env,h=this.tryTailSegmentReparse(e,o,d,n);if(h)return this.stats.total+=1,this.stats.tailHits+=1,this.stats.lastMode="tail",Ls(d,{area:"stream",path:"stream-tail",reason:"tail-reparse"}),h;const p=!!n.__explicitStreamChunkFallbackSetting,m=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,g=!!n.options?.streamChunkedFallback,y=!p&&!c&&m,b=g||y,v=n.options?.streamChunkAdaptive!==!1,C=n.options?.streamChunkTargetChunks??8,w=n.options?.streamChunkSizeChars,M=n.options?.streamChunkSizeLines,N=n.options?.streamChunkMaxChunks,T=!!n.__explicitStreamChunkConfig,S=n.options?.autoTuneChunks!==!1,x=n.options?.streamChunkFenceAware??!0;let A=c&&o.lineCount!==void 0?o.lineCount+ds(c):void 0;if(b){A===void 0&&(A=ds(e));const R=($,V,ne)=>$ne?ne:$,W=S&&!T?eL(e.length,A,n.options):null,z=W?.maxChunkChars??(v?R(Math.ceil(e.length/C),8e3,64e3):w??1e4),F=W?.maxChunkLines??(v?R(Math.ceil(A/C),150,700):M??200),O=W?.maxChunks??(v?R(Math.ceil(e.length/64e3),C,32):N),B=e.length>0&&e.charCodeAt(e.length-1)===10,j=y&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&W?.strategy!=="plain";if((g||j)&&(e.length>=z*2||A>=F*2)&&B){const $=Pk(n,e,d,{maxChunkChars:z,maxChunkLines:F,fenceAware:W?.fenceAware??x,maxChunks:O});return this.cache={src:e,tokens:$,env:d,lineCount:A,lastSegment:void 0,globalStateReason:Rl(e)},this.updateCacheLineCount(this.cache,A),this.recordChunkedParseResult(d,g?"explicit-fallback-large-doc":"default-fallback-large-doc"),$}}const E=this.parseFullDocument(e,d,n,A),I=E.tokens;return A=E.lineCount,this.cache={src:e,tokens:I,env:d,lineCount:A,lastSegment:void 0,globalStateReason:Rl(e)},this.updateCacheLineCount(this.cache,A),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",Ls(d,{area:"stream",path:"stream-full",reason:"fallback-full",unbounded:!!Fc(d)?.unbounded}),I}recordChunkedParseResult(e,t){const n=Fc(e)?.chunk,i=n?.fallback?String(n.fallbackReason||"global-state"):null;if(this.stats.total+=1,i){this.stats.fullParses+=1,this.stats.lastMode="full",Ls(e,{area:"stream",path:"stream-full",reason:`global-state:${i}`,unbounded:!!Fc(e)?.unbounded});return}this.stats.chunkedParses=(this.stats.chunkedParses||0)+1,this.stats.lastMode="chunked",Ls(e,{area:"stream",path:"stream-chunked",chunked:!0,reason:t})}parseFullDocument(e,t,n,i,o=!0){const s=Rl(e);e2(t)&&rd(t);const r=typeof n.__canUseImplicitLargeInputStrategy!="function"||n.__canUseImplicitLargeInputStrategy()?bH(n,e.length,i):"no";if(r==="yes"){const a=x0(n,e,t);return Ls(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-char-threshold",unbounded:!0}),{tokens:a,lineCount:i??(o?ds(e):0)}}let l=i;if(r==="need-lines"&&(l=ds(e),kH(n,e.length,l))){const a=x0(n,e,t);return Ls(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-line-threshold",unbounded:!0}),{tokens:a,lineCount:l}}return l===void 0&&(l=o?ds(e):0),{tokens:W1(t,s,()=>this.core.parse(e,t,n).tokens),lineCount:l}}shouldUseUnboundedAppend(e,t,n){return!n||e.length=this.MIN_UNBOUNDED_APPEND_CHARS?!0:ds(n)>=this.MIN_UNBOUNDED_APPEND_LINES}getAppendedSegment(e,t,n){if(n===null||n===void 0&&!t.startsWith(e)||!e.endsWith(` -`))return null;const i=n??t.slice(e.length);if(!i)return null;const o=i.length;if(i.charCodeAt(o-1)!==10)return null;let s=0,r=-1;for(let a=0;a=2));a++);if(s<2)return null;const l=(r===-1?i:i.slice(0,r)).trim();if(l.length===0)return null;if(/^[-=]+$/.test(l)){const a=e.slice(0,-1),u=a.lastIndexOf(` -`);if(a.slice(u+1).trim().length>0)return null}return this.endsInsideOpenFence(e)||this.mayContainReferenceDefinition(i)?null:i}tryTailSegmentReparse(e,t,n,i){const o=this.ensureLastSegment(t);if(!o||o.srcOffset<=0&&o.tokenStart<=0)return null;const s=t.src.slice(0,o.srcOffset);if(!e.startsWith(s))return null;const r=t.src.slice(o.srcOffset),l=e.slice(o.srcOffset);if(l===r)return null;const a=e.startsWith(t.src)?e.slice(t.src.length):null;if(a){const u=this.tryContainerTailAppendMerge(e,t,n,i,o,a);if(u)return u}if(this.mayContainReferenceDefinition(r)||this.mayContainReferenceDefinition(l))return null;try{const u=this.core.parse(l,n,i),c=this.getLastSegment(u.tokens,l);return o.lineStart>0&&this.shiftTokenLines(u.tokens,o.lineStart),t.src=e,t.env=n,t.globalStateReason=null,t.globalStateCarry=void 0,t.tokens.length=o.tokenStart,this.appendTokens(t.tokens,u.tokens),t.lineCount=o.lineStart+ds(l),c?t.lastSegment={tokenStart:o.tokenStart+c.tokenStart,tokenEnd:o.tokenStart+c.tokenEnd,lineStart:o.lineStart+c.lineStart,lineEnd:o.lineStart+c.lineEnd,srcOffset:o.srcOffset+c.srcOffset}:t.lastSegment=null,t.tokens}catch{return null}}getTailLines(e,t){if(t<=0)return"";let n=t;for(let i=e.length-1;i>=0;i--)if(e.charCodeAt(i)===10&&(n--,n===0))return e.slice(i+1);return e}endsInsideOpenFence(e){const n=e.length>4e3?e.length-4e3:0,i=e.slice(n),o=i.length;let s=null,r=0;for(;r<=o;){let l=i.indexOf(` -`,r);l===-1&&(l=o);let a=r;for(;a=3&&(s?s.marker===u&&d>=s.length&&(s=null):s={marker:u,length:d})}}if(l===o)break;r=l+1}return s!==null}peek(){return this.cache?.tokens??g1e}getStats(){return{...this.stats}}appendTokens(e,t,n=0,i=t.length){for(let o=n;oE8?n.slice(n.length-E8):n,i&&(e.globalStateReason=i),i}ensureLastSegment(e){return e.lastSegment!==void 0||(e.lastSegment=this.getLastSegment(e.tokens,e.src)),e.lastSegment}getLastSegment(e,t,n=0,i=e.length,o,s){if(i<=n)return null;let r=Number.POSITIVE_INFINITY,l=-1,a=0;for(let u=i-1;u>=n;u--){const c=e[u];if(c.map&&(c.map[0]l&&(l=c.map[1])),c.nesting<0){a+=-c.nesting;continue}if(c.nesting>0){if(a-=c.nesting,c.level===0&&a<=0){const d=Number.isFinite(r)?r:c.map?.[0]??0,h=l>=d?l:c.map?.[1]??d;return{tokenStart:u,tokenEnd:i,lineStart:d,lineEnd:h,srcOffset:this.getLineStartOffset(t,d,o,s)}}continue}if(c.level===0&&a===0){const d=Number.isFinite(r)?r:c.map?.[0]??0,h=l>=d?l:c.map?.[1]??d;return{tokenStart:u,tokenEnd:i,lineStart:d,lineEnd:h,srcOffset:this.getLineStartOffset(t,d,o,s)}}}return null}getLineStartOffset(e,t,n,i){if(n!==void 0&&i!==void 0&&t>=i)return this.getLineStartOffsetFrom(e,n,t-i);if(t<=0)return 0;let o=t,s=-1;for(;o>0;){if(s=e.indexOf(` -`,s+1),s===-1)return e.length;o--}return s+1}getLineStartOffsetFrom(e,t,n){if(n<=0)return t;let i=n,o=t-1;for(;i>0;){if(o=e.indexOf(` -`,o+1),o===-1)return e.length;i--}return o+1}mayContainReferenceDefinition(e){return e.includes("]:")?/(?:^|\n)[ \t]{0,3}\[[^\]\n]+\]:/.test(e):!1}canDirectlyParseAppend(e){if(!this.endsWithBlankLine(e.src))return!1;const t=this.ensureLastSegment(e);if(!t)return!1;switch(e.tokens[t.tokenStart]?.type){case"paragraph_open":case"heading_open":case"fence":case"code_block":case"html_block":case"hr":case"table_open":return!0;default:return!1}}tryContainerTailAppendMerge(e,t,n,i,o,s){if(!s||this.mayContainReferenceDefinition(s))return null;const r=t.tokens[o.tokenStart];switch(r?.type){case"bullet_list_open":case"ordered_list_open":return this.tryListTailAppendMerge(e,t,n,i,o,s,r);case"table_open":return this.tryTableTailAppendMerge(e,t,n,i,o,s,r);default:return null}}tryListTailAppendMerge(e,t,n,i,o,s,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10)return null;const l=o.lineEnd-o.lineStart,a=t.src.length-o.srcOffset;if(l0&&this.shiftTokenLines(d,h);const p=this.getListParagraphMode(t.tokens,o.tokenStart,t.tokens.length,r.level),m=this.getListParagraphMode(c,0,c.length,0);(p==="loose"||m==="loose"||this.endsWithBlankLine(t.src)||(c[0]?.map?.[0]??0)>0)&&(this.setListParagraphVisibility(t.tokens,o.tokenStart,t.tokens.length,r.level,!1),this.setListParagraphVisibility(d,0,d.length,r.level,!1)),t.tokens.splice(t.tokens.length-1,0,...d),t.src=e,t.env=n,t.globalStateReason=null;const g=h+ds(s);t.lineCount=g;const y=this.getDocLineCount(e,g);return r.map&&(r.map[1]=y),t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:y,srcOffset:o.srcOffset},t.tokens}tryTableTailAppendMerge(e,t,n,i,o,s,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10||/(?:^|\n)[ \t]*\n/.test(s))return null;const l=o.lineEnd-o.lineStart,a=t.src.length-o.srcOffset;if(l=0?d.slice(h.tbodyOpenIndex+1,h.tbodyCloseIndex):d.slice(h.tbodyOpenIndex,h.tbodyCloseIndex+1);if(m.length===0)return null;const g=o.lineEnd-2;g!==0&&this.shiftTokenLines(m,g);const y=p.tbodyCloseIndex>=0?p.tbodyCloseIndex:p.tableCloseIndex,b=t.lineCount??ds(t.src);t.tokens.splice(y,0,...m),t.src=e,t.env=n,t.globalStateReason=null;const v=b+ds(s);t.lineCount=v;const C=this.getDocLineCount(e,v);if(r.map&&(r.map[1]=C),p.tbodyOpenIndex>=0){const w=t.tokens[p.tbodyOpenIndex];w?.map&&(w.map[1]=C)}return t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:C,srcOffset:o.srcOffset},t.tokens}getTableHeaderContext(e){const t=e.indexOf(` -`);if(t<0)return null;const n=e.indexOf(` -`,t+1);return n<0?null:e.slice(0,n+1)}getTableBodySection(e,t,n,i){if(t<0||t>=n||e[t]?.type!=="table_open")return null;let o=-1;for(let l=n-1;l>t;l--){const a=e[l];if(a.type==="table_close"&&a.level===i){o=l;break}}if(o<0)return null;let s=-1,r=-1;for(let l=t+1;l=0){for(let l=o-1;l>s;l--){const a=e[l];if(a.type==="tbody_close"&&a.level===i+1){r=l;break}}if(r<0)return null}return{tableCloseIndex:o,tbodyOpenIndex:s,tbodyCloseIndex:r}}isSingleTopLevelContainer(e,t,n,i){if(e.length<2)return!1;const o=e[0],s=e[e.length-1];if(o.type!==t||s.type!==n||o.level!==0||s.level!==0||i!==void 0&&o.markup!==i)return!1;let r=0;for(let l=0;l0&&l0||a.nesting<0)&&(r+=a.nesting)}return r===0}getListParagraphMode(e,t,n,i){let o=!1,s=!1;const r=i+2;for(let l=t;l=0;){const i=e.charCodeAt(n);if(i===32||i===9){n--;continue}return i===10}return!0}getDocLineCount(e,t=ds(e)){return e.length===0?0:e.charCodeAt(e.length-1)===10?t:t+1}shiftTokenLines(e,t){if(t===0)return;let n=null;for(let i=0;i=0;s--)n.push(o.children[s]);for(;n.length>0;){const s=n.pop();if(s.map&&(s.map[0]+=t,s.map[1]+=t),s.children)for(let r=s.children.length-1;r>=0;r--)n.push(s.children[r])}}}}};const rL={default:a1e,zero:u1e,commonmark:l1e};function w1e(e){return{core:e.core.ruler.version,block:e.block.ruler.version,inline:e.inline.ruler.version,inline2:e.inline.ruler2.version}}function C1e(e,t){return e.core.ruler.version!==t.core||e.block.ruler.version!==t.block||e.inline.ruler.version!==t.inline||e.inline.ruler2.version!==t.inline2}function lL(e){return e.experimental?{...e,...e.experimental}:e}function La(e,t){if(!e)return!1;if(Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==void 0)return!0;const n=e.experimental;return!!n&&Object.prototype.hasOwnProperty.call(n,t)&&n[t]!==void 0}function aL(e,t,n){for(let i=0;i=4?n.quotes=[S[0],S[1],S[2],S[3]]:n.quotes=["“","”","‘","’"]}let r=aL(s?.options,o,["fullChunkSizeChars","fullChunkSizeLines","fullChunkMaxChunks"]),l=aL(s?.options,o,["streamChunkSizeChars","streamChunkSizeLines","streamChunkMaxChunks"]),a=uL(s?.options,o,"fullChunkedFallback"),u=uL(s?.options,o,"streamChunkedFallback"),c=!1,d=null,h=null;const p=new fpe;let m=null;const g=()=>(m||(m=new m1e(n)),m);let y=null;const b=()=>(y||(y=new b1e(p)),y);let v=null;const C=()=>(v||(v=new Ej({fuzzyLink:!0})),v),w=S=>!c&&!!d&&!C1e(S,d),M=(S,x)=>i==="default"&&!c&&m===null&&h!==null&&S.parse===h&&w(S)&&!S.stream.enabled&&x<(S.options.autoUnboundedThresholdChars??4e6)&&S.options.html===!1&&S.options.xhtmlOut===!1&&S.options.breaks===!1&&S.options.langPrefix==="language-"&&S.options.linkify===!1&&S.options.typographer===!1&&S.options.highlight===null,N=(S,x)=>i==="default"&&!c&&w(S)&&!S.stream.enabled&&!S.options.fullChunkedFallback&&x<(S.options.autoUnboundedThresholdChars??4e6)&&S.options.html===!1&&S.options.linkify===!1&&S.options.typographer===!1,T={core:p,block:p.block,inline:p.inline,get linkify(){const S=C();return Object.defineProperty(this,"linkify",{value:S,writable:!0,configurable:!0}),S},get renderer(){const S=g();return Object.defineProperty(this,"renderer",{value:S,writable:!0,configurable:!0}),S},options:n,__explicitFullChunkConfig:r,__explicitStreamChunkConfig:l,__explicitFullChunkFallbackSetting:a,__explicitStreamChunkFallbackSetting:u,__canUseImplicitLargeInputStrategy(){return w(this)},set(S){const x=lL(S);return this.options={...this.options,...x},(La(S,"fullChunkSizeChars")||La(S,"fullChunkSizeLines")||La(S,"fullChunkMaxChunks"))&&(r=!0,this.__explicitFullChunkConfig=!0),(La(S,"streamChunkSizeChars")||La(S,"streamChunkSizeLines")||La(S,"streamChunkMaxChunks"))&&(l=!0,this.__explicitStreamChunkConfig=!0),La(S,"fullChunkedFallback")&&(a=!0,this.__explicitFullChunkFallbackSetting=!0),La(S,"streamChunkedFallback")&&(u=!0,this.__explicitStreamChunkFallbackSetting=!0),m&&m.set(x),typeof x.stream=="boolean"&&(this.stream.enabled=x.stream,y&&(y.reset(),y.resetStats())),this},configure(S){const x=typeof S=="string"?rL[S]:S;if(!x)throw new Error("Wrong `markdown-it` preset, can't be empty");if(x.options&&this.set(x.options),x.components){const A=x.components;A.core?.rules&&this.core.ruler.enableOnly(A.core.rules),A.block?.rules&&this.block.ruler.enableOnly(A.block.rules),A.inline?.rules&&this.inline.ruler.enableOnly(A.inline.rules),A.inline2?.rules&&this.inline.ruler2.enableOnly(A.inline2.rules)}return this},enable(S,x){const A=Array.isArray(S)?S:[S],E=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],I=new Set;for(const R of E){if(!R)continue;const W=R.enable(A,!0);for(let z=0;z!I.has(W));if(R.length)throw new Error(`Rules manager: invalid rule name ${R.join(", ")}`)}return this},disable(S,x){const A=Array.isArray(S)?S:[S],E=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],I=new Set;for(const R of E){if(!R)continue;const W=R.disable(A,!0);for(let z=0;z!I.has(W));if(R.length)throw new Error(`Rules manager: invalid rule name ${R.join(", ")}`)}return this},use(S,...x){const A=typeof S=="function"?S:S&&typeof S.default=="function"?S.default:void 0;if(!A)throw new TypeError("MarkdownIt.use: plugin must be a function");const E=[this,...x],I=S;return c=!0,A.apply(I,E),this},render(S,x){let A;if(M(this,S.length)){x!==void 0&&(hl(x),A=y8("render"));const R=A?Zp():0,W=A?YE(S,A):QE(S);if(A&&(A.attemptMs=Zp()-R,W===null&&(A.fallbackReason="unsupported-stock-subset"),Sg(x,A)),W!==null)return x!==void 0&&Ls(x,{area:"render",path:"stock-fast",reason:"stock-subset"}),W}const E=x??{},I=this.parse(S,E);return A&&Sg(E,A),g().render(I,this.options,E)},async renderAsync(S,x){let A;if(M(this,S.length)){x!==void 0&&(hl(x),A=y8("render"));const R=A?Zp():0,W=A?YE(S,A):QE(S);if(A&&(A.attemptMs=Zp()-R,W===null&&(A.fallbackReason="unsupported-stock-subset"),Sg(x,A)),W!==null)return x!==void 0&&Ls(x,{area:"render",path:"stock-fast",reason:"stock-subset"}),W}const E=x??{},I=this.parse(S,E);return A&&Sg(E,A),g().renderAsync(I,this.options,E)},renderIterable(S,x={}){const A=this.parseIterable(S,x);return g().render(A,this.options,x)},async renderAsyncIterable(S,x={}){const A=await this.parseAsyncIterable(S,x);return g().renderAsync(A,this.options,x)},renderInline(S,x={}){const A=this.parseInline(S,x);return g().render(A,this.options,x)},validateLink:rH,normalizeLink:lH,normalizeLinkText:aH,utils:Hde,helpers:{...Efe},parse(S,x){if(typeof S!="string")throw new TypeError("Input data should be a String");if(x!==void 0&&hl(x),N(this,S.length)){const R=x===void 0?void 0:y8("parse"),W=R?Zp():0,z=xpe(S,R);if(R&&(R.attemptMs=Zp()-W,z===null&&(R.fallbackReason="unsupported-stock-subset"),Sg(x,R)),z!==null)return x!==void 0&&Ls(x,{area:"parse",path:"stock-fast",reason:"stock-subset"}),z}const A=x??{};let E;if(!this.stream.enabled&&!this.options.fullChunkedFallback&&w(this)){const R=bH(this,S.length);if(R==="yes"){const W=x0(this,S,A);return Ls(x,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"char-threshold"}),W}R==="need-lines"&&(E=ds(S))}if(!this.stream.enabled){const R=S.length,W=this.options.autoTuneChunks!==!1,z=r,F=!a&&w(this),O=!!this.options.fullChunkedFallback,B=F&&R>=2e5;let j;(O||B||E!==void 0)&&(j=E??ds(S));const $=(O||B)&&W&&!z?r1e(R,j,this.options):null;if(O||B){const V=j??0;if(O?R>=(this.options.fullChunkThresholdChars??2e4)||V>=(this.options.fullChunkThresholdLines??400):B){if($&&$.strategy!=="plain"){const ne=Pk(this,S,A,{maxChunkChars:$.maxChunkChars,maxChunkLines:$.maxChunkLines,fenceAware:$.fenceAware,maxChunks:$.maxChunks});return x&&cL(x,O?"explicit-full-chunk":"default-large-string"),ne}if(O){const ne=(G,oe,Z)=>GZ?Z:G,K=this.options.fullChunkAdaptive!==!1,ee=this.options.fullChunkTargetChunks??8,ue=ne(Math.ceil(R/ee),8e3,64e3),ie=ne(Math.ceil(V/ee),150,700),ye=K?ue:this.options.fullChunkSizeChars??1e4,Te=K?ie:this.options.fullChunkSizeLines??200,Ee=K?ne(Math.ceil(R/64e3),ee,32):this.options.fullChunkMaxChunks,Me=Pk(this,S,A,{maxChunkChars:ye,maxChunkLines:Te,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:Ee});return x&&cL(x,"explicit-full-chunk"),Me}}}if(E!==void 0&&w(this)&&kH(this,R,j??E)){const V=x0(this,S,A);return Ls(x,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"line-threshold"}),V}}const I=Rl(S);return Ls(x,{area:"parse",path:"plain",reason:"default-plain"}),W1(A,I,()=>p.parse(S,A,this).tokens)},parseIterable(S,x={}){return hl(x),n1e(this,S,x)},parseAsyncIterable(S,x={}){return hl(x),i1e(this,S,x)},parseIterableToSink(S,x,A={}){return hl(A),o1e(this,S,x,A)},parseAsyncIterableToSink(S,x,A={}){return hl(A),s1e(this,S,x,A)},parseInline(S,x={}){if(typeof S!="string")throw new TypeError("Input data should be a String");hl(x),e2(x)&&rd(x);const A=p.createState(S,x,this);return A.inlineMode=!0,p.process(A),A.tokens}};if(T.stream={enabled:!!n.stream,parse(S,x){return T.stream.enabled?b().parse(S,x,T):T.parse(S,x??{})},reset(){b().reset()},peek(){return y?y.peek():[]},stats(){return y?y.getStats():{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}},resetStats(){y&&y.resetStats()}},s?.components){const S=s.components;S.core?.rules&&T.core.ruler.enableOnly(S.core.rules),S.block?.rules&&T.block.ruler.enableOnly(S.block.rules),S.inline?.rules&&T.inline.ruler.enableOnly(S.inline.rules),S.inline2?.rules&&T.inline.ruler2.enableOnly(S.inline2.rules)}return d=w1e(T),h=T.parse,T}var x1e=A1e;const SH=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],S1e=["a","abbr","b","bdi","bdo","button","cite","code","data","del","dfn","em","font","i","ins","kbd","label","mark","q","s","samp","small","span","strong","sub","sup","time","u","var"],_H=["article","aside","blockquote","details","div","figcaption","figure","footer","header","h1","h2","h3","h4","h5","h6","li","main","nav","ol","p","pre","section","summary","table","tbody","td","th","thead","tr","ul"],_1e=["svg","g","path"],I1e=["address","audio","body","canvas","caption","colgroup","datalist","dd","dialog","dl","dt","fieldset","form","head","hgroup","html","iframe","legend","map","menu","meter","noscript","object","optgroup","option","output","picture","progress","rp","rt","ruby","script","select","style","template","textarea","tfoot","title","video"],M1e=["onclick","onerror","onload","onmouseover","onmouseout","onmousedown","onmouseup","onkeydown","onkeyup","onfocus","onblur","onsubmit","onreset","onchange","onselect","ondblclick","ontouchstart","ontouchend","ontouchmove","ontouchcancel","onwheel","onscroll","oncopy","oncut","onpaste","oninput","oninvalid","onsearch","innerhtml","outerhtml","textcontent","innertext","srcdoc","ping"],T1e=["action","data","href","src","srcset","poster","xlink:href","formaction"],E1e=["script"],L1e=["pre","iframe","picture","script","style","table","tbody","td","tfoot","th","thead","textarea","tr","title","video"],mf=new Set(SH),IH=new Set(_H),Cv=new Set([...SH,...S1e,..._H,..._1e]),MH=new Set([...Cv,...I1e]),N1e=new Set(M1e),D1e=new Set(T1e),i2=new Set(E1e),TH=new Set(L1e);function EH(e){let t="";for(const n of e){const i=n.charCodeAt(0);i<=31||i>=127&&i<=159||/\s/u.test(n)||(t+=n)}return t}const F1e={amp:"&",bsol:"\\",colon:":",newline:` -`,sol:"/",tab:" "};function LH(e){return e.replace(/&(?:#(\d+)|#x([0-9a-f]+)|([a-z][a-z0-9]+));?/gi,(t,n,i,o)=>{const s=n??i;if(s){const r=Number.parseInt(s,n?10:16);try{return Number.isFinite(r)?String.fromCodePoint(r):""}catch{return""}}return F1e[String(o??"").toLowerCase()]??t})}const hy=new Set(["http","https","mailto","tel"]),R1e=new Set(["javascript","vbscript","data","file","ftp","blob","filesystem","intent","chrome","chrome-extension","moz-extension","ms-browser-extension","view-source"]),th=new Set(["http","https"]);function NH(e){return e.match(/^([a-z][a-z0-9+.-]*):/i)?.[1]?.toLowerCase()??""}const O1e=/^https?:\/\//i;function P1e(e){if(!O1e.test(e))return!1;for(const t of e){const n=t.charCodeAt(0);if(t==="&"||n<=32||n>=127&&n<=159||n>127&&/\s/u.test(t))return!1}return!0}function $1e(e,t,n){if(!I0(t,n)||!e.startsWith("file:///"))return!1;const i=e.charAt(8);return i!=="/"&&i!=="\\"}function I0(e,t){return e?(e==="a"||e==="area")&&(!t||t==="href"||t==="xlink:href"):!t||t==="href"}function B1e(e,t){return t==="href"||t==="xlink:href"?I0(e,t)?hy:th:t==="src"||t==="srcset"||t==="poster"||t==="action"||t==="formaction"||t==="data"?th:(I0(e,t),hy)}function Wh(e,t={}){if(P1e(e))return!1;const n=EH(LH(e)).toLowerCase(),i=String(t.tagName??"").toLowerCase(),o=String(t.attrName??"").toLowerCase();if(!n)return!1;if(n.startsWith("data:")){const r=/^data:image\/(?:png|gif|jpe?g|webp|avif|bmp);/i.test(n);return i==="img"&&o==="src"?!r:!0}if(/^[\\/]{2}/.test(n))return!0;if(n.startsWith("/")||n.startsWith("./")||n.startsWith("../")||n.startsWith("#")||n.startsWith("?"))return!1;const s=NH(n);return s?s==="file"?!$1e(n,i,o):I0(i,o)?R1e.has(s):!B1e(i,o).has(s):!1}function z1e(e){const t=LH(String(e??"")).trim();if(!t||t.startsWith("#")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("?"))return!1;const n=NH(EH(t).toLowerCase());return n==="http"||n==="https"}function j1e(e,t={}){const n=String(e??"").trim();return n?Wh(n,t)?"":n:""}function dL(e){return j1e(e,{tagName:"img",attrName:"src"})}function H1e(e,t,n){function i(h){return h.trim().split(" ",2)[0]===t}function o(h,p,m,g,y){return h[p].nesting===1&&h[p].attrJoin("class",t),y.renderToken(h,p,m,g,y)}n=n||{};const s=3,r=n.marker||":",l=r.charCodeAt(0),a=r.length,u=n.validate||i,c=n.render||o;function d(h,p,m,g){let y,b=!1,v=h.bMarks[p]+h.tShift[p],C=h.eMarks[p];if(l!==h.src.charCodeAt(v))return!1;for(y=v+1;y<=C&&r[(y-v)%a]===h.src[y];y++);const w=Math.floor((y-v)/a);if(w=m||(v=h.bMarks[T]+h.tShift[T],C=h.eMarks[T],v=4)){for(y=v+1;y<=C&&r[(y-v)%a]===h.src[y];y++);if(!(Math.floor((y-v)/a)=2){const r=Number(s[0]),l=Number(s[1]);Number.isFinite(r)&&Number.isFinite(l)&&(o.map=[r+t,Math.min(l+t,n)])}Array.isArray(o.children)&&DH(o.children,t,n)}}function q1e(e){["admonition","info","warning","error","tip","danger","note","caution"].forEach(t=>{e.use(H1e,t,{render(n,i){return n[i].nesting===1?`
      `:`
      -`}})}),e.block.ruler.before("fence","vmr_container_fallback",(t,n,i,o)=>{const s=t,r=s.bMarks[n]+s.tShift[n],l=s.eMarks[n],a=s.src.slice(r,l),u=a.match(/^:::\s*([^\s{]+)/);if(!u)return!1;const c=u[1];if(!c.trim())return!1;const d=a.slice(u[0].length).trim();let h,p;const m=d.indexOf("{"),g=m>=0?d.slice(m).trimStart():void 0;if(m===-1)h=d||void 0;else{if(h=d.slice(0,m).trim()||void 0,g?.startsWith("{")){let N=0,T=-1;for(let S=0;S0&&(p=g.slice(0,T))}p||(h=d||void 0)}if(o)return!0;const y=!!s.env.__markstreamFinal;let b=n+1,v=!1;for(;b<=i;){const N=s.bMarks[b]+s.tShift[b],T=s.eMarks[b];if(s.src.slice(N,T).trim()===":::"){v=!0;break}b++}v||(b=i);const C=s.push("vmr_container_open","div",1);if(C.attrSet("class",`vmr-container vmr-container-${c}`),C.map=[n,v?b:i],C.meta={...C.meta??{},unclosed:!v&&!y},h&&C.attrSet("data-args",h),p)try{const N=JSON.parse(p);for(const[T,S]of Object.entries(N)){const x=S!=null&&typeof S=="object";C.attrSet(`data-${T}`,x?JSON.stringify(S):String(S))}}catch{const N=W1e(p);if(N)for(const[T,S]of Object.entries(N)){const x=S!=null&&typeof S=="object";C.attrSet(`data-${T}`,x?JSON.stringify(S):String(S))}else C.attrSet("data-attrs",p)}const w=[];for(let N=n+1;NN.trim().length>0)){let N=w.join(` -`);N.endsWith(` -`)||(N+=` -`),N.endsWith(` - -`)||(N+=` -`);const T=s.tokens[s.tokens.length-1];T&&(T.raw=N);const S=[];s.md.block.parse(N,s.md,s.env,S),DH(S,n+1,n+1+w.length),s.tokens.push(...S)}const M=s.push("vmr_container_close","div",-1);return v||(M.hidden=!0,M.map=[i,i]),s.line=v?b+1:b,!0},{alt:["paragraph","reference","blockquote","list"]})}function xu(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function gs(e){let t=!1,n=!1;for(let i=0;i")return i}return-1}function C4(e){const t=[],n=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let i;for(;(i=n.exec(e))!==null;){const o=i[1];if(!o)continue;const s=i[2]||i[3]||i[4]||"";t.push([o,s])}return t}const U1e=/^[a-z][a-z0-9_-]*$/;function fL(e){return U1e.test(String(e??"").trim().toLowerCase())}function Ga(e){const t=String(e??"").trim();if(!t)return"";if(!t.startsWith("<"))return fL(t)?t.toLowerCase():"";let n=1;for(;n]/.test(s)?"":fL(o)?o:""}function kp(e){if(!e||e.length===0)return[];const t=new Set,n=[];for(const i of e){const o=Ga(i);!o||t.has(o)||(t.add(o),n.push(o))}return n}function V1e(...e){const t=new Set,n=[];for(const i of e)for(const o of kp(i))t.has(o)||(t.add(o),n.push(o));return n}function K1e(e){const t=kp(e);return{key:t.join(","),tags:t}}function FH(e){return Ga(e)}function Z1e(e,t){const n=String(e??""),i=Ga(t);if(!i)return!1;const o=xu(i),s=n.match(new RegExp(String.raw`^\s*<\s*${o}(?:\s[^>]*)?(\s*\/)?>`,"i"));return s?s[1]?!0:new RegExp(String.raw`<\s*\/\s*${o}\s*>`,"i").test(n):!1}function RH(e,t){const n=Ga(t);return!!n&&!Cv.has(n)&&!Z1e(e,n)}function G1e(e,t){const n=String(e??""),i=Ga(t);if(!i)return n;const o=xu(i),s=new RegExp(String.raw`^\s*<\s*${o}(?:\s[^>]*)?>\s*`,"i"),r=new RegExp(String.raw`\s*<\s*\/\s*${o}\s*>\s*$`,"i");return n.replace(s,"").replace(r,"")}const OH=mf,Q1e=Cv,PH=new Set(IH);PH.delete("details");const Y1e=/<([A-Z][\w-]*)(?=[\s/>]|$)/gi,J1e=/<\/\s*([A-Z][\w-]*)(?=[\s/>]|$)/gi,XC=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,X1e=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function Bk(e){return(e.match(XC)?.[1]??"").toLowerCase()}function ex(e){return/^\s*<\s*\//.test(e)}function tx(e,t){return OH.has(t)||/\/\s*>\s*$/.test(e)}function eme(e,t){let n=0;for(let i=0;i0&&n--;continue}tx(o,s)||n++}}return n}function hL(e,t,n=0){const i=new RegExp(String.raw`<\s*(\/?)\s*${xu(t)}(?=[\s>/])[^>]*>`,"gi");i.lastIndex=Math.max(0,n);let o=0,s;for(;(s=i.exec(e))!==null;){const r=s[0]??"",l=!!s[1],a=!l&&/\/\s*>$/.test(r);if(l){if(o===0)return{start:s.index,end:s.index+r.length};o--;continue}a||o++}return null}function nme(e,t){const n=new RegExp(String.raw`<\s*(\/?)\s*${xu(t)}(?=[\s>/])[^>]*>`,"gi");let i=0,o;for(;(o=n.exec(e))!==null;){const s=o[0]??"",r=!!o[1],l=!r&&/\/\s*>$/.test(s);if(r){i>0&&i--;continue}l||i++}return i}function zk(e){const t=e;return String(t.raw??t.content??t.markup??"")}function ime(e){const t=e;return t.meta||(t.meta={}),t.meta}function L8(e,t,n){const i=ime(e);i.markstreamCustomHtmlRaw=t,i.markstreamCustomHtmlInner=n}function ome(e,t){if(!t.size)return;const n=Array.from(t,p=>new RegExp(String.raw`<\s*${xu(p)}(?=[\s>/])`,"i")),i=[];let o=!1;const s=p=>p?n.some(m=>m.test(p)):!1,r=p=>{if(!(!p||!i.length))for(const m of i)m.raw+=p,m.inner+=p},l=()=>{!i.length||!o||(r(` -`),o=!1)},a=p=>{r(p)},u=p=>{for(let g=0;g{const m=i[i.length-1]?.tag;if(!m)return null;const g=new RegExp(String.raw`^\s*<\s*\/\s*${xu(m)}\s*>`,"i");return p.match(g)?.[0]??null},d=p=>!!c(p),h=(p,m,g)=>{const y=g??(p.type==="html_inline"?Bk(m):"");if(!(y&&t.has(y))){r(m);return}const b=ex(m),v=!b&&tx(m,y);if(b){if(!i.length||i[i.length-1].tag!==y){r(m);return}u(m);return}if(r(m),v){L8(p,m,"");return}i.push({tag:y,token:p,raw:m,inner:""})};for(const p of e){if(p.type==="inline"&&Array.isArray(p.children)){const m=String(p.content??"");if(d(m)?o=!1:l(),!i.length&&!s(m)){o=!1;continue}let g=0,y=!0;for(const b of p.children){const v=zk(b),C=b.type==="html_inline"?Bk(v):"",w=C&&t.has(C);let M=v;if(y&&m&&v&&(i.length||w)){const N=m.indexOf(v,g);if(N!==-1)a(m.slice(g,N)),M=m.slice(N,N+v.length),g=N+v.length;else{if(i.length&&!w)continue;y=!1}}h(b,M,C)}y&&m&&g0;continue}if(i.length&&typeof p.content=="string"){const m=zk(p),g=p.type==="html_block"?c(m):null;if(g){u(`${o?` -`:""}${g}`),o=i.length>0;continue}if(!p.content)continue;l(),r(p.content),o=!0}}for(const p of i)L8(p.token,p.raw,p.inner)}function sme(e){return/^\s*<\s*[!?]/.test(e)}function rme(e){const t=new Set(Q1e);if(e&&Array.isArray(e))for(const n of e){const i=String(n??"").trim();if(!i)continue;const o=i.match(/^[<\s/]*([A-Z][\w-]*)/i);o&&t.add(o[1].toLowerCase())}return t}function pL(e,t){if(t.has(e))return!0;for(const n of t)if(n.startsWith(e))return!0;return!1}function lme(e,t){let n=null;for(const s of e.matchAll(Y1e)){const r=s.index??-1;if(r<0)continue;const l=(s[1]??"").toLowerCase();pL(l,t)&&gs(e.slice(r))===-1&&(!n||r")&&(!n||s")&&(!n||s{const p=h,m=new Set(n),g=Array.isArray(p.env?.__markstreamCustomHtmlTags)?p.env.__markstreamCustomHtmlTags:[];for(const C of g){const w=Ga(String(C??""));w&&m.add(w)}const y=rme(Array.from(m)),b=new Set(cme);for(const C of m)b.add(C);return{autoCloseInlineTagSet:b,commonHtmlTags:y,customTagSet:m,shouldMergeHtmlBlockTag:C=>m.has(C)||!y.has(C)||PH.has(C)}},o=h=>{if(h.type==="html_block")return String(h.content??"");if(h.type!=="inline"||!Array.isArray(h.children)||h.children.length!==1)return"";const p=h.children[0];return p?.type!=="html_block"?"":String(h.content??p.content??"")},s=(h,p)=>{h.type="html_block",h.content=p,h.raw=p,h.children=[]},r=h=>h.replace(/^(?:\r?\n)+/,""),l=h=>/^(?: {4}|\t)/.test(h),a=h=>h.replace(/^(?: {4}|\t)/gm,""),u=(h,p)=>{const m=r(h);if(!/\S/.test(m))return[];if(l(m))return[{type:"code_block",content:a(m),raw:m}];const g=m.replace(/^[\t ]+/,"");if(!g)return[];if(g.startsWith("<"))return[{type:"html_block",content:g}];const y={type:"inline",tag:"",nesting:0,content:g,children:[{type:"text",content:g,raw:g}]};return p==="paragraph"?[{type:"paragraph_open",tag:"p",nesting:1},y,{type:"paragraph_close",tag:"p",nesting:-1}]:p==="text"?[{type:"text",content:g,raw:g}]:[y]},c=(h,p,m)=>h[p-1]?.type==="paragraph_open"&&h[p+1]?.type==="paragraph_close"?"inline":m,d=(h,p)=>{const m=r(p);return!/\S/.test(m)||h.type!=="inline"||!Array.isArray(h.children)?!1:(h.content=`${String(h.content??"")}${m}`,h.children.push({type:"text",content:m,raw:m}),!0)};e.core.ruler.after("inline","fix_html_inline_streaming",h=>{const p=h.tokens??[],{commonHtmlTags:m,customTagSet:g}=i(h);for(const y of p){const b=y;if(b.type!=="inline"||!Array.isArray(b.children))continue;const v=String(b.content??""),C=b.children.length?b.children:v.includes("<")?[{type:"text",content:v,raw:v}]:null;if(C)try{const w=ume(C,m);if(b.children=w.children,w.pendingBuffer){const M=v.lastIndexOf(w.pendingBuffer);if(M!==-1){const N=v.slice(0,M);b.content=N,typeof b.raw=="string"&&(b.raw=N)}}}catch(w){console.error("[applyFixHtmlInlineTokens] failed to fix streaming html inline",w)}}ome(p,g)}),e.core.ruler.push("fix_html_inline_tokens",h=>{const p=h.tokens??[],{autoCloseInlineTagSet:m,customTagSet:g,shouldMergeHtmlBlockTag:y}=i(h),b=[];for(let v=0;v0){const[M,N]=b[b.length-1];if(v!==N){if(C.type==="paragraph_open"||C.type==="paragraph_close"){p.splice(v,1),v--;continue}const T=String(C.content??C.raw??"");if(T){const S=p[N],x=`${String(S.content||"")} -${T}`,A=gs(x),E=A===-1?null:hL(x,M,A+1);if(E){const I=x.slice(0,E.end),R=x.slice(E.end);S.content=I,S.loading=!1,p.splice(v,1),b.pop();const W=d(S,R)?[]:u(R,c(p,v,"paragraph"));W.length&&p.splice(v,0,...W),v--;continue}S.content=x,S.loading!==!1&&(S.loading=!0)}p.splice(v,1),v--;continue}}const w=o(C);if(w){if(sme(w))continue;const M=(w.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1]??"").toLowerCase(),N=/^\s*<\s*\//.test(w);if(!M||!y(M))continue;if(s(C,w),!N)M&&!new RegExp(`^\\s*<\\s*${M}\\b[^>]*\\/\\s*>`,"i").test(w)&&nme(w,M)>0&&b.push([M,v]);else if(b.length>0&&M&&b[b.length-1][0]===M){const[,T]=b[b.length-1],S=p[T];S.content=`${String(S.content||"")} -${w}`,S.loading=!1,b.pop(),p.splice(v,1),v--}continue}else if(b.length>0){if(C.type==="paragraph_open"||C.type==="paragraph_close"){p.splice(v,1),v--;continue}const M=C.content||"",N=new RegExp(`<\\s*\\/\\s*${b[b.length-1][0]}\\s*>`,"i").test(M);if(M){const[,T]=b[b.length-1],S=p[T];S.content=`${S.content||""} -${M}`,S.loading!==!1&&(S.loading=!N)}N&&b.pop(),p.splice(v,1),v--}else continue}if(g.size>0){const v=new Map,C=new Map,w=T=>{let S=v.get(T);return S||(S=new RegExp(`<\\s*${T}\\b`,"i"),v.set(T,S)),S},M=T=>{let S=C.get(T);return S||(S=new RegExp(`<\\s*\\/\\s*${T}\\s*>`,"i"),C.set(T,S)),S},N=[];for(let T=0;T0){const E=N[N.length-1],I=p[E.index],R=S.type==="html_block"?M(E.tag).exec(x):null;if(R){const F=R.index+R[0].length,O=x.slice(0,F),B=x.slice(F);I.content=`${String(I.content??"")} -${O}`,Array.isArray(I.children)&&I.children.push({type:"html_inline",content:``,raw:``}),N.pop();const j=d(I,B)?[]:u(B,c(p,T,"paragraph"));j.length?p.splice(T,1,...j):(p.splice(T,1),T--);continue}if(S.type!=="inline")continue;const W=Array.isArray(S.children)?S.children:[],z=eme(W,E.tag);if(z!==-1){const F=W.slice(0,z+1),O=W.slice(z+1),B=F.map(j=>String(j?.content??j?.raw??"")).join("");if(I.content=`${String(I.content??"")} -${B}`,Array.isArray(I.children)&&I.children.push(...F),O.length){const j=O.map($=>String($.content??$.raw??"")).join("");if(j.trim()){const $=j.replace(/^\s+/,"");if(d(I,j))p.splice(T,1),T--;else if($.startsWith("<"))p.splice(T,1,{type:"html_block",content:$});else{const V=u(j,c(p,T,"paragraph"));p.splice(T,1,...V)}}else p.splice(T,1),T--}else p.splice(T,1),T--;N.pop();continue}I.content=`${String(I.content??"")} -${x}`,Array.isArray(I.children)&&I.children.push(...W),p.splice(T,1),T--;continue}if(S.type!=="inline")continue;const A=Array.isArray(S.children)?S.children:[];for(const E of g)if((A.length?tme(A,E):w(E).test(x)&&!M(E).test(x)?1:0)>0){N.push({tag:E,index:T});break}}}{let v=0;for(let C=0;C0?v--:(p.splice(C,1),C--))}}for(let v=0;v/]+)/)?.[1]??"").toLowerCase();if(S.startsWith("!")||S.startsWith("?")){C.loading=!1;continue}if(g.has(S)){const z=String(C.content??""),F=gs(z),O=F===-1?null:hL(z,S,F+1);C.loading=O?!1:C.loading!==void 0?C.loading:!0;const B=O?.start??-1,j=O?O.end-O.start:0;if(B!==-1){const $=z.slice(0,B+j);let V="";F!==-1&&F]+)))?/g;let A;for(;(A=x.exec(C.content||""))!==null;)A[1],A[2]||A[3]||A[4];const E=String(C.content??""),I=new RegExp(`<\\/\\s*${S}\\s*>`,"i").exec(E),R=I?I.index:-1,W=I?I[0].length:0;if(R!==-1){const z=E.slice(0,R+W),F=(E.slice(R+W)||"").replace(/^\s+/,"");C.children=[{type:"html_block",content:z,tag:S,loading:!1}],C.content=z,C.raw=z,F&&p.splice(v+1,0,F.startsWith("<")?{type:"html_block",content:F}:{type:"text",content:F,raw:F})}else C.children=[{type:"html_block",content:C.content,tag:S,loading:!0}];continue}if(!C||C.type!=="inline")continue;if(C.children.length===2&&C.children[0].type==="html_inline"){const S=(C.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase(),x=C.children[1],A=String(x?.content??"").match(/^<\s*\/\s*([^\s>]+)/)?.[1]?.toLowerCase()??"";if(x?.type==="html_inline"&&A===S)continue;m.has(S)?(C.children[0].loading=!0,C.children[0].tag=S,C.children.push({type:"html_inline",tag:S,loading:!0,content:``})):C.children=[{type:"html_block",loading:!0,tag:S,content:String(C.children[0]?.content??"")+String(C.children[1]?.content??"")}];continue}else if(C.children.length===3&&C.children[0].type==="html_inline"&&C.children[2].type==="html_inline"){const S=(C.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(m.has(S))continue;C.children=[{type:"html_block",loading:!1,tag:S,content:C.children.map(x=>x.content).join("")}];continue}if(!C.content?.startsWith("<")||C.children?.length!==1)continue;const w=String(C.content),M=C,N=M.children[0];if(N?.type!=="html_inline"){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(w)&&(M.children.length=0);continue}const T=String(N.content??w).match(X1e)?.[1]?.toLowerCase()??"";if(T){if(/\/\s*>\s*$/.test(w)||OH.has(T)){M.children=[{type:"html_inline",content:w}];continue}M.children.length=0}}})}function fme(e){const t=e.trim();return!t||/^&[a-z0-9#]+;/i.test(t)?!1:!!(/^(?:const|let|var|function|class|import|export|if|for|while|return|await|async|yield|try|catch|throw|new|typeof|instanceof|switch|case|break|continue|def|ruby|perl|print|echo|true|false|null|undefined|NaN|Infinity|this)\b/.test(t)||/[a-z_$][\w$]*(?:\.[a-z_$][\w$]*|\['[^']*'\]|\["[^"]*"\]|\[\d+\])*\s*\(/i.test(t)||/[a-z_$][\w$]*(?:\.[a-z_$][\w$]*|\['[^']*'\]|\["[^"]*"\]|\[[\d+\]])+/i.test(t)||/\w+\s*(?:===?|!==?|<=?|>=?|\+\+|--|&&|\|\||\?\.)/.test(t)||/^(?:!!|\+\+|--)\s*\w/.test(t)||/[\w$]+\s*(?:\+=|-=|\*=|\/=|%=|\*\*=|=)/.test(t)||/^(?:https?:\/\/|ftp:\/\/|file:\/\/|\/\/|www\.)/i.test(t)||/`[^`]*\$\{[^}]*\}[^`]*`/.test(t)||/<\/?[A-Z][a-zA-Z0-9]*/.test(t)||/<[a-z][a-z0-9]*\s[^>]+>/.test(t)||/^(["'`]).*\1\s*[;,]?$/.test(t)||/^\[[\s\S]*\]$/.test(t)||/^\{[\s\S]*\}$/.test(t)||/^\(\s*\)$/.test(t)||/[\w$]+(?:\s*[+\-*/%<>=!&|^~:]+\s*[\w$]+|\s*\.\s*[\w$]+)/.test(t)||/=>|->|::/.test(t)||/^@[\w.$]+$/.test(t)||/^(?:0x[0-9a-fA-F]+|0b[01]+|0o[0-7]+|\d+(?:\.\d*)?(?:px|em|rem|%|vh|vw|deg|s|ms)?)$/.test(t)||/^\$[\w$]+\s*[=:]/.test(t)||/\|\s*\w+|\w+\s*\|/.test(t)||/^(?:git|npm|yarn|pnpm|bun|pip|cargo|go|rust|python|node|java|mvn|gradle|docker|kubectl)\s+/.test(t)||/(?:console|window|document|Math|JSON|Date|Array|Object|String|Number|Boolean)\.[a-zA-Z]/.test(t)||/^(?:\/\/|#|\/\*|\*\/|)/.test(t)||/^(?:<<<|<<\s*['"]?\w+['"]?)/.test(t))}function hme(e,t={}){t.enabled!==!1&&e.core.ruler.after("inline","fix_indented_code_block",n=>{const i=n.tokens??[];for(let o=0;oa.trim().length>0);if(l.length===1&&!fme(l[0]??"")){const a=l[0]??"",u=s.level??0;i.splice(o,1,{type:"paragraph_open",tag:"p",nesting:1,level:u},{type:"inline",tag:"",nesting:0,level:u,content:a,children:[{type:"text",content:a,level:u+1,raw:a}],block:!0},{type:"paragraph_close",tag:"p",nesting:-1,level:u}),o+=2}}})}const $H=/\.([a-z0-9]{1,15})$/i,pme=/[_()[\]{}<>]/u,mme=/^(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/i,gme=/[?#@]/u,vme=/[\\/]/u,yme=/^[\p{L}\p{N}./\\-]+$/u,kme=/^[A-Za-z0-9-]{1,63}$/u,bme=/^xn--[a-z0-9-]{2,59}$/i,wme=/^(?:[A-Z]{1,6}|\d{1,8})$/u,Cme=/^(?=.{1,12}$)[A-Z0-9]+(?:[-.][A-Z0-9]+)*$/iu,Ame=/文件名\s*[::]?|附件\s*[::]?|路径\s*[::]?|路徑\s*[::]?|文件列表\s*[::]?|文档列表\s*[::]?|文檔列表\s*[::]?|\bfile\s*names?\b\s*[::]?|\battachments?\b\s*[::]?|\bpaths?\b\s*[::]?|\bfile\s+lists?\b\s*[::]?|\bdocument\s+lists?\b\s*[::]?/iu,xme=/文件名\s*[::]?|文件\s*[::]?|附件\s*[::]?|档案\s*[::]?|檔案\s*[::]?|文档\s*[::]?|文檔\s*[::]?|资料\s*[::]?|資料\s*[::]?|路径\s*[::]?|路徑\s*[::]?|\bfile\s*name\b\s*[::]?|\battachments?\b\s*[::]?|\bfiles?\b\s*[::]?|\bdocuments?\b\s*[::]?|\bdocs?\b\s*[::]?|\bpaths?\b\s*[::]?/iu,Sme=/股票代码|股票代碼|证券代码|證券代碼|(?:代码|代碼|交易所|后缀|後綴|市场|市場)(?=$|[\s::/|,,、()()])|\btickers?\b|\bsymbols?\b|\bexchanges?\b/iu,_me=2e3,Ime=512,Mme={},Tme=new Set(["ai","md","py","rs","sh","zip"]),BH=new Set(["as","bj","de","hk","l","ln","ny","pa","sh","ss","sz","t","us"]),Eme=new Set([...BH,"at","ax","cn","co","it","jp","ks","mc","mx","nz","pl","sa","si","to","tw"]),Lme=new Set(["com","dev","io","page","site"]),Nme=new Set(["app","apk","dmg","exe","ipa","lock","log","markdown","webmanifest"]),Dme=new Set(["7z","ai","astro","avi","bash","bz2","c","cjs","cpp","cs","csv","doc","docx","fish","flac","gif","go","gz","h","hpp","html","java","jpeg","jpg","js","json","jsx","kt","md","mdx","mjs","mov","mp3","mp4","pdf","php","png","ppt","pptx","ps1","py","rar","rb","rs","sh","sql","svg","swift","svelte","tar","tgz","toml","ts","tsx","txt","vue","wav","webp","xls","xlsx","xml","yaml","yml","zip","zsh"]),Mh=new Map;function mL(e,t){if(!e||e.length>Ime)return t;for(Mh.set(e,t);Mh.size>_me;){const n=Mh.keys().next().value;if(!n)break;Mh.delete(n)}return t}function Av(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function N8(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return Av(n)?n:void 0}function gL(e,t){if(!Av(t))return e;const n=e?.__linkifyDemotionContext;return{...e,__linkifyDemotionContext:{filename:n?.filename||t?.filename,explicitFilename:n?.explicitFilename||t?.explicitFilename,marketTicker:n?.marketTicker||t?.marketTicker}}}function vL(e){const t=o2(e);return Av(t)?t:void 0}function Fme(e){return e.replace(/^[\s>*_`[\]((【《"'“‘]+/u,"").replace(/[\s<*_`\]))】》"'.。;;,,、::!?!?]+$/u,"")}function yL(e,t){if(!Av(t))return;const n=String(e??"").trim().split(/\s+/u).map(Fme).filter(Boolean);if(n.length===0)return;const i={};return t?.filename&&n.every(o=>jk(o,{filename:!0,explicitFilename:t.explicitFilename}))&&(i.filename=!0),t?.explicitFilename&&i.filename&&(i.explicitFilename=!0),t?.marketTicker&&n.every(o=>jk(o,{marketTicker:!0}))&&(i.marketTicker=!0),Av(i)?i:void 0}function Ff(e,t=!1){let n;return{options(i){return t||i==null?gL(e,n):gL(e,N8(vL(i),yL(i,n)))},remember(i){const o=vL(i);n=t?N8(n,o):N8(o,yL(i,n))},reset(){n=void 0}}}function kL(e){return kme.test(e)&&!e.startsWith("-")&&!e.endsWith("-")}function Rme(e){const t=e.split(".");if(t.length<2)return!1;const n=t[t.length-1]?.toLowerCase()??"";return kL(n)||bme.test(n)?t.every(kL):!1}function zH(e){return Array.from(e).some(t=>t.charCodeAt(0)>127)}function Ome(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0]??""}function Pme(e){return e.split(".").some(t=>t.toLowerCase().startsWith("xn--"))}function jH(e,t,n){const i=Ome(t);return zH(e)&&Pme(i)&&String(n??"").toLowerCase().includes(i.toLowerCase())}function $me(e){if(!e)return!1;if(e.includes("文件")||e.includes("附件")||e.includes("路径")||e.includes("路徑")||e.includes("文档")||e.includes("文檔")||e.includes("档案")||e.includes("檔案")||e.includes("资料")||e.includes("資料")||e.includes("股票")||e.includes("证券")||e.includes("證券")||e.includes("代码")||e.includes("代碼")||e.includes("交易所")||e.includes("后缀")||e.includes("後綴")||e.includes("市场")||e.includes("市場"))return!0;const t=e.toLowerCase();return t.includes("file")||t.includes("attachment")||t.includes("document")||t.includes("doc")||t.includes("path")||t.includes("ticker")||t.includes("symbol")||t.includes("exchange")}function o2(e){const t=String(e??""),n=Mh.get(t);return n?(Mh.delete(t),Mh.set(t,n),n):$me(t)?mL(t,{explicitFilename:Ame.test(t),filename:xme.test(t),marketTicker:Sme.test(t)}):mL(t,Mme)}function Bme(e){return Rme(e.split(/[\\/]/)[0]??"")}function zme(e){const t=e.replace(/[^a-z]/gi,"");return t.length>=2&&t===t.toUpperCase()}function jme(e){if(pme.test(e)||!yme.test(e))return!0;if(vme.test(e))return!Bme(e);const t=e.replace($H,"");return zH(t)?!0:t.split(".").filter(Boolean).some(zme)}function Hme(e,t,n){if(!(n?Eme:BH).has(t))return!1;const i=e.slice(0,-(t.length+1));return i===""?e.startsWith("."):(n?Cme:wme).test(i)}function jk(e,t={}){if(!e||mme.test(e)||gme.test(e))return!1;const n=e.match($H);if(!n)return!1;const i=String(n[1]??"").toLowerCase();return Hme(e,i,t.marketTicker===!0)?!0:Dme.has(i)?!Tme.has(i)||t.filename?!0:jme(e):!!(t.explicitFilename&&Lme.has(i)||t.filename&&Nme.has(i))}const HH=new WeakMap,WH=new WeakSet;function eA(e,t){return HH.set(e,t),e}function Wme(e){return HH.get(e)}function qme(e){WH.add(e)}function Ume(e){return e===void 0||WH.has(e)}const bL=["!"];function wL(e){return e==="linkify"||e==="autolink"?e:"recovery"}function Nl(e){return{type:"text",content:e,raw:e}}function nh(e,t){t===1?e.push({type:"em_open",tag:"em",nesting:1}):t===2?e.push({type:"strong_open",tag:"strong",nesting:1}):t===3&&(e.push({type:"strong_open",tag:"strong",nesting:1}),e.push({type:"em_open",tag:"em",nesting:1}))}function ih(e,t){t===1?e.push({type:"em_close",tag:"em",nesting:-1}):t===2?e.push({type:"strong_close",tag:"strong",nesting:-1}):t===3&&(e.push({type:"em_close",tag:"em",nesting:-1}),e.push({type:"strong_close",tag:"strong",nesting:-1}))}function wd(e,t,n,i="recovery"){let o="";if(t.includes('"')){const s=t.split('"');t=s[0].trim(),o=s[1].trim()}return eA({type:"link",loading:n,href:t,title:o,text:e,children:[{type:"text",content:e,raw:e}],raw:`[${e}](${t})`},i)}function Vme(e,t){if(!(!e||!t)&&(e.href=String(e.href??"")+t,e.text=String(e.text??"")+t,e.raw=`[${e.text}](${e.href})`,Array.isArray(e.children)&&e.children.length)){const n=e.children[e.children.length-1];n?.type==="text"?(n.content=String(n.content??"")+t,n.raw=String(n.raw??"")+t):e.children.push(Nl(t))}}function CL(e,t){let n=-1;for(const i of t){const o=e.indexOf(i);o!==-1&&(n===-1||on?.[0]==="href")?.[1];return typeof t=="string"?t:""}function Zme(e,t){if(!e)return;e.attrs=Array.isArray(e.attrs)?e.attrs:[];const n=e.attrs.findIndex(i=>i?.[0]==="href");n>=0?e.attrs[n][1]=t:e.attrs.push(["href",t])}function AL(e,t,n){let i="";for(let o=t+1;o{const n=t.tokens??[];for(let i=0;ir.type==="code_inline"),i=new Map;let o=0;for(let r=0;r0&&u?xL(u):-1;if(c!==-1&&u)for(const d of u.slice(c))d==="("?o++:d===")"&&o>0&&o--}a!==-1&&(r=a);continue}if(!(l.type!=="text"||typeof l.content!="string"))for(const a of l.content)a==="("?o++:a===")"&&o>0&&o--}const s=o2(t);for(let r=0;r<=e.length-1;r++){r<0&&(r=0);const l=e[r];if(!l)break;if(l.type==="link_open"&&(l.markup==="linkify"||l.markup==="autolink")){let a=-1;for(let u=r+1;u0){const m=xL(u);m!==-1&&(d===-1||m=g.content.length){p-=g.content.length;continue}if(p<0)break;const y=g.content[p],b=g.content.slice(0,p);let v=g.content.slice(p);for(let M=m+1;M0&&(e.splice(m+1,C),a=m+1);let w=c;if(y==="!"&&h!==-1)w=c.slice(0,h);else if(v){const M=encodeURI(v);if(M&&c.endsWith(M))w=c.slice(0,c.length-M.length);else{const N=y?encodeURI(y):"",T=N?c.indexOf(N):-1;T!==-1&&(w=c.slice(0,T))}}w!==c&&Zme(l,w),v&&e.splice(a+1,0,Nl(v));break}}}if(!n){if(l?.type==="em_open"&&e[r-1]?.type==="text"&&e[r-1].content?.endsWith("*")){const a=e[r-1].content?.replace(/(\*+)$/,"")||"";e[r-1].content=a,l.type="strong_open",l.tag="strong",l.markup="**";for(let u=r+1;ud[0]==="href")?.[1]||"";if(e[r+3]?.type==="text"){const d=(e[r+3]?.content??"").indexOf(")"),h=d===-1;d===-1&&(c+=e[r+3]?.content?.slice(0,d)||"",e[r+3].content=""),a.push(wd(u,c,h,"linkify"));const p=e[r+3].content?.replace(/^\)\**/,"");p&&a.push(Nl(p)),e.splice(r-4,8,...a)}else a.push(eA({type:"link",loading:!0,href:c,title:"",text:u,children:[{type:"text",content:c,raw:c}],raw:`[${u}](${c})`},"linkify")),e.splice(r-4,7,...a);continue}else if(e[r-1].content==="]("&&e[r-3]?.type==="text"&&e[r-3].content?.endsWith(")"))if(e[r-2]?.type==="strong_open"){const[a,u]=e[r-3].content?.split("[**")||[];e[r+1].content=u||"",e[r-3].content=a||"",e[r-1].content=""}else if(e[r-2]?.type==="em_open"){const[a,u]=e[r-3].content?.split("[*")||[];e[r+1].content=u||"",e[r-3].content=a||"",e[r-1].content=""}else{const[a,u]=e[r-3].content?.split("[")||[];e[r+1].content=u||"",e[r-3].content=a||"",e[r-1].content=""}}if(l.type==="link_close"&&l.nesting===-1&&e[r-2]?.type==="link_open"&&e[r+1]?.type==="text"&&e[r-1]?.type==="text"){const a=e[r-1].content||"",u=e[r-2].attrs||[],c=u.find(b=>b[0]==="href")?.[1]||"",d=u.find(b=>b[0]==="title")?.[1]||"";let h=3,p=2;const m=(e[r-3]?.content||"").match(/^(\*+)$/),g=[];if(m){p+=1;const b=m[1].length;nh(g,b)}if(l.markup!=="linkify"&&e[r+1].type==="text"&&e[r+1]?.content?.startsWith("](")){h+=1;for(let b=r+1;by[0]==="href")?.[1];e[r+5]?.type==="text"&&e[r+5].content==="."?(h=(g||h)+e[r+5].content,e[r+5].content=""):h=g||h,p+=3}let m=!0;if(l.nesting===-1&&(d=d.replace(/\*+$/,"")),e[r+2]?.type==="text"){const g=(e[r+2]?.content??"").indexOf(")");m=g===-1,g===-1&&(h+=e[r+2]?.content?.slice(0,g)||"",e[r+2].content="")}a.push(wd(d,h,m)),ih(a,2),e.splice(r-2,p,...a)}if(l.type==="text"&&/\*+\[[^\]]*$/.test(l.content||"")&&e[r+1]?.type==="strong_open"&&e[r+2]?.type==="text"&&e[r+2].content==="]("&&e[r+3]?.type==="link_open"&&e[r+5]?.type==="link_close"&&e[r+6]?.type==="text"&&e[r+6].content===")"&&e[r+7]?.type==="strong_close"){const a=(l.content||"").match(/^(\*+)\[(.*)$/);if(a){const u=(a[2]||"")+a[1];let c=e[r+3]?.attrs?.find(h=>h[0]==="href")?.[1]||"";!c&&e[r+4]?.type==="text"&&(c=e[r+4].content||"");const d=[];nh(d,2),d.push(wd(u,c,!1)),ih(d,2),e.splice(r,9,...d),r-=d.length-1;continue}}}}if(n)return e;for(let r=0;r{const n=t.tokens??[];for(let i=0;i{const n=t.tokens??[];for(let i=0;i=0&&e[m].type==="text"&&e[m].content==="";)m--;const g=e[m];let y=c+1;for(;y=0&&e[m].type==="text"&&e[m].content==="";)m--;const g=e[m];let y=c+1;for(;y{const n=t;try{const i=uge(n.tokens??[],!!n.env?.__markstreamFinal,n.src??"");Array.isArray(i)&&(n.tokens=i)}catch(i){console.error("[applyFixTableTokens] failed to fix table tokens",i)}})}function SL(){return[{type:"table_open",tag:"table",attrs:null,map:null,children:null,content:"",markup:"",info:"",level:0,loading:!0,meta:null},{type:"thead_open",tag:"thead",attrs:null,block:!0,level:1,children:null},{type:"tr_open",tag:"tr",attrs:null,block:!0,level:2,children:null}]}function _L(){return[{type:"tr_close",tag:"tr",attrs:null,block:!0,level:2,children:null},{type:"thead_close",tag:"thead",attrs:null,block:!0,level:1,children:null},{type:"table_close",tag:"table",attrs:null,map:null,children:null,content:"",markup:"",info:"",level:0,meta:null}]}function IL(e){return[{type:"th_open",tag:"th",attrs:null,block:!0,level:3,children:null},{type:"inline",tag:"",children:null,content:e,level:4,attrs:null,block:!0},{type:"th_close",tag:"th",attrs:null,block:!0,level:3,children:null}]}function qH(e,t){if(!e.startsWith("|")||e.includes(` -`)||!e.endsWith("|"))return null;const n=e.slice(1).split("|");return n.at(-1)===""&&n.pop(),n.length>0&&n.every(i=>i.trim().length>0)?n:null}function D8(e){return qH(e)!==null}function UH(e){return/^:?-+:?$/.test(e.trim())}function oge(e){if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|");return t.at(-1)===""&&t.pop(),t.length>0&&t.every(UH)}function sge(e){return/^(?:[::]-*|:?-+:?)?$/.test(e.trim())}function rge(e){if(e==="")return!0;if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|"),n=t.at(-1)??"";return t.slice(0,-1).every(UH)&&sge(n)}function lge(e){return e==="|"||e==="|:"}function age(e){const t=qH(e);return t!==null&&t.every(n=>!n.includes(":"))}function uge(e,t=!1,n=""){const i=[...e];if(e.length<3)return i;const o=e.length-2,s=e[o];if(s.type==="inline"){const r=String(s.content??""),l=r.split(` -`)[0]??"",[a="",u="",...c]=r.split(` -`),d=!t&&!r.includes(` -`)&&/\r?\n$/.test(n)&&D8(r);if(!t&&(r.includes(` -`)&&c.length===0&&D8(a)&&rge(u)||d)){const h=l.slice(1,-1).split("|").map(m=>m.trim()).flatMap(m=>IL(m)),p=[...SL(),...h,..._L()];i.splice(o-1,3,...p)}else if(r.includes(` -`)&&c.length===0&&D8(a)&&oge(u)){const h=l.slice(1,-1).split("|").map(m=>m.trim()).flatMap(m=>IL(m)),p=[...SL(),...h,..._L()];i.splice(o-1,3,...p)}else r.includes(` -`)&&c.length===0&&age(a)&&lge(u)&&(s.content=r.slice(0,-2),s.children.splice(2,1))}return i}function cge(e,t,n,i){const o=e.length;if(n==="$$"&&i==="$$"){let u=t;for(;u=0&&e[c]==="\\";)d++,c--;if(d%2===0)return u}u++}return-1}const s=n[n.length-1],r=i;let l=0,a=t;for(;a=0&&e[c]==="\\";)d++,c--;if(d%2===0){if(l===0)return a;l--,a+=r.length;continue}}const u=e[a];if(u==="\\"){a+=2;continue}u===s?l++:u===r[r.length-1]&&l>0&&l--,a++}return-1}var dge=cge;const fge=["boldsymbol","mathbb","mathcal","mathfrak","mathrm","mathit","mathsf","vec","hat","bar","tilde","overline","underline","mathscr","mathnormal","operatorname","mathbf*"],Hk=fge.map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,"\\$&")).join("|"),hge=/\\[a-z]+/i,VH="(?:\\\\|\\u0008)",pge=new RegExp(String.raw`${VH}(?:${Hk})\s*\{[^}]+\}`,"i"),mge=new RegExp(String.raw`(?:${VH})?(?:${Hk})\s*\{`,"i"),gge=/\\(?:text|frac|left|right|times)/,vge=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,yge=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,kge=/[A-Z]+\s*\([^)]+\)/i,bge=/^\(\s*[a-z](?:\s*,\s*[a-z])+\s*\)$/i,wge=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,Cge=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,Age={"\b":"\\b","\v":"\\v","\f":"\\f"};function xge(e){let t="";for(const n of e)t+=Age[n]??n;return t}function zd(e){if(!e)return!1;const t=xge(e),n=t.trim();if(Cge.test(n)||n.includes("**"))return!1;if(n.length>2e3)return!0;const i=hge.test(t),o=pge.test(t),s=mge.test(t),r=gge.test(t),l=/(?:^|[^\w\\])(?:[A-Z]|\\[A-Z]+)_(?:\{[^}]+\}|[A-Z0-9\\])/i.test(t)||/(?:^|[^\w\\])(?:[A-Z]|\\[A-Z]+)\^(?:\{[^}]+\}|[A-Z0-9\\])/i.test(t),a=vge.test(t)&&!yge.test(t),u=kge.test(t),c=bge.test(n),d=wge.test(t),h=/^\([a-z]\)$/i.test(n)||/^(?:[a-z]|pi)$/i.test(n),p=/^(?:[A-Z][a-z]?(?:_\{?\d+\}?|\^\{?\d+\}?)?)+$/.test(n);return i||o||s||r||l||a||u||c||d||h||p}const KH="__markstreamMathPluginApplied",tA=80,ZH=2e4,ML=ZH+4096;function nx(e){return!!e[KH]}function Sge(e){e[KH]=!0}const GH=["ldots","cdots","quad","in","displaystyle","int_","lim","lim_","ce","pu","end","infty","perp","mid","operatorname","to","rightarrow","leftarrow","math","mathrm","mathit","mathbb","mathcal","mathfrak","implies","alpha","beta","gamma","delta","epsilon","lambda","sum","sum_","prod","sqrt","fbox","boxed","color","rule","edef","fcolorbox","hline","hdashline","cdot","times","pm","le","ge","neq","sin","cos","tan","log","ln","exp","frac","text","left","right"],_ge=["cdot","mathbf{","partial","mu_{"],QH=GH.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),YH="[ \r\b\f\v]",Ige=new RegExp(`([^\\\\])(${_ge.map(e=>e).join("|")})+`,"g"),Mge=/span\{([^}]+)\}/,Tge=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,Ege=/(^|[^\\])\\\r?\n/g,Lge=/(^|[^\\])\\$/g,Nge=/[\p{L}\p{M}\p{N}\p{Pe}\p{Pf}'′″‴|‖]/u,Dge=new RegExp(`(${YH})|(${QH})\\b`,"g"),TL=new Map,EL=new Map;function Fge(e){if(!e)return Dge;const t=[...e];t.sort((r,l)=>l.length-r.length);const n=t.join(""),i=TL.get(n);if(i)return i;const o=`(?:${t.map(r=>r.replace(/[.*+?^${}()|[\\]\\"\]/g,"\\$&")).join("|")})`,s=new RegExp(`(${YH})|(${o})\\b`,"g");return TL.set(n,s),s}function Rge(e,t){const n=e?[]:[...t??[]];e||n.sort((l,a)=>a.length-l.length);const i=e?"__default__":n.join(""),o=EL.get(i);if(o)return o;const s=e?[Hk,QH].filter(Boolean).join("|"):[n.map(l=>l.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),Hk].filter(Boolean).join("|"),r=new RegExp(`(^|[^\\\\\\w])(${s})\\s*\\{`,"g");return EL.set(i,r),r}const LL={" ":"t","\r":"r","\b":"b","\f":"f","\v":"v"};function NL(e){const t=/(^|[^\\])(__|\*\*)/g;let n=0;for(;t.exec(e)!==null;)n++;return n}function Oge(e){return e.replace(/(^|[^\\])!+/gu,(t,n)=>{if(n&&Nge.test(n))return t;const i=n?t.slice(n.length):t;return`${n}${"\\!".repeat(i.length)}`})}function DL(e){const t=/(^|[^\\])(__|\*\*)/g;let n,i=null;for(;(n=t.exec(e))!==null;)i={marker:n[2],index:n.index+(n[1]?.length??0)};return i}function Cd(e,t){const n=t?.commands??GH,i=t?.escapeExclamation??!0,o=t?.commands==null,s=Fge(o?void 0:n);let r=e.replace(s,(u,c,d,h,p)=>{if(c!==void 0&&LL[c]!==void 0)return`\\${LL[c]}`;if(d&&n.includes(d)){const m=p&&typeof h=="number"?p[h-1]:void 0;return m==="\\"||m&&/\w/.test(m)?u:`\\${d}`}return u});i&&(r=Oge(r));let l=r;const a=Rge(o,o?void 0:n);return l=l.replace(a,(u,c,d)=>`${c}\\${d}{`),l=l.replace(Mge,"span\\{$1\\}").replace(Tge,"\\operatorname{span}\\{$1\\}"),l=l.replace(Ege,`$1\\\\ -`),l=l.replace(Lge,"$1\\\\"),l=l.replace(Ige,"$1\\$2"),l}function FL(e){const t=e.trim();return!(!zd(t)||/"[^"\n]{1,80}"\s*:\s*/.test(t)||!(/\\[a-z]+/i.test(t)||/[=+*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/.test(t)||/[_^]/.test(t))&&/\s-\s/.test(t))}function JH(e){const t=[];let n=0;for(;n=n[0]&&t0;){if(e[s]==="\\"&&s+10;){if(e[l]==="\\"&&l+1=0&&e[n]==="\\";)i++,n--;return i%2===1}function nA(e,t){let n=t;for(;n0&&e[i-1]==="$"||i+1=l)break;const u=Wk(o,a);if(u){r=Math.max(a+Math.max(1,t.length),u[1]);continue}s2(e,a)||s++,r=a+Math.max(1,t.length)}return s}function ix(e,t,n){const i=Sv(String(e??""));if(!i.endsWith(t))return-1;const o=i.length-t.length;if(o<=0||!Sv(i.slice(0,o)).trim()||s2(i,o))return-1;const s=JH(i);if(Wk(s,o))return-1;const r=RL(i,t,0,o,s);if(t==="$$"){if(r%2===1)return-1}else if(r>RL(i,n,0,o,s))return-1;return o}function xv(e){return e===" "||e===" "}function Sv(e){let t=e.length;for(;t>0&&xv(e[t-1]);)t--;return e.slice(0,t)}function OL(e){let t=0;for(let n=0;n=48&&t<=57}function $ge(e){if(e.length<3)return!1;const t=e[0];if(t!=="-"&&t!=="*"&&t!=="_"&&t!=="=")return!1;let n=0;for(let i=0;i=3}function Bge(e){const t=e.trim();if(!t)return!1;let n=0;t[n]===":"&&n++;let i=0;for(;t[n]==="-";)i++,n++;return i<3?!1:(t[n]===":"&&n++,n===t.length)}function zge(e){if(!e.includes("|"))return!1;const t=e[0]==="|"?e.slice(1):e;return(t.endsWith("|")?t.slice(0,-1):t).split("|").every(Bge)}function jge(e){let t=0;if(!PL(e[t]))return!1;for(;PL(e[t]);)t++;return e[t]!=="."&&e[t]!==")"?!1:xv(e[t+1])}function XH(e){const t=e.trimStart();if(!t||t.startsWith("```")||t.startsWith("~~~")||t.startsWith(":::")||t[0]===">"||t[0]==="<")return!0;if(t[0]==="#"){let n=0;for(;t[n]==="#";)n++;if(n>=1&&n<=6&&xv(t[n]))return!0}return!!((t[0]==="-"||t[0]==="+"||t[0]==="*")&&xv(t[1])||jge(t)||$ge(t)||zge(t))}function $L(e,t){return e?t?`${e} -${t}`:e:t}function iA(e){const t=String(e??"").trim();return t?zd(t):!1}function BL(e){let t=0;for(let n=0;ntA){p=!0;break}const g=o[m],y=d1(g,c);if(y!==-1){const b=$L(h,g.slice(0,y));if(!iA(b)){p=!0;break}const v=g.slice(y+c.length),C=v.trim()?`suffix:${BL(v)}`:"nosuffix";return["closed",u,i+l,d,i+m,y,BL(b),C].join(":")}if(XH(g)){p=!0;break}if(h=$L(h,g),h.length>ZH){p=!0;break}}if(!p&&iA(h))return["pending",u,i+l,d].join(":")}}return null}function R8(e,t){const n=String(e??"").trim();return!n||!/^\d[\d,.]*\s*[~~-]\s*$/.test(n)?!1:/\d/.test(String(t??""))}function Wge(e){const t=String(e??"").trimStart(),n=t.match(/^\d+(?:,\d{3})*(?:\.\d+)?/);if(!n)return!1;const i=t.slice(n[0].length);return/^\s*(?:[+\-*/^_=<>]|\\[a-z]+)/i.test(i)?!1:i===""||/^[)\s,.!?;:]/.test(i)}function O8(e){const t=String(e??"").trim();return t?/^(?:\.{3,}|…+)$/.test(t):!1}function qge(e,t){Sge(e);const n=(r,l,a)=>{const u=String(l??"").replace(/^[\t ]+/,"").replace(/[\t ]+$/,"");if(!u)return;const c=r.push("paragraph_open","p",1);c.map=[a,a+1];const d=r.push("inline","",0);d.content=u,d.map=[a,a+1],d.children=[],r.push("paragraph_close","p",-1)},i=(r,l)=>{const a=r,u=!!t?.strictDelimiters,c=!a?.env?.__markstreamFinal,d=(v,C)=>{let w=C;for(;w=3&&(!w||/\s/.test(w))){const M=a.push("text","",0);return M.content=a.src.slice(a.pos,v),a.pos=v,!0}}const h=[["$$","$$"],["$","$"],["\\(","\\)"]],p=String(a.pending??""),m=Math.max(0,a.pos-p.length);let g=m,y=m;const b=m;for(const[v,C]of h){const w=a.src,M=JH(w),N=Pge(w,c);let T=!1;v==="$$"&&g!==b&&(g=b);let S=-1,x=-1,A=0;const E=I=>{if((I==="undefined"||I==null)&&(I=""),I==="\\"){a.pos=a.pos+I.length,g=a.pos;return}if(I==="\\)"||I==="\\("){const z=a.push("text_special","",0);z.content=I==="\\)"?")":"(",z.markup=I,a.pos=a.pos+I.length,g=a.pos;return}if(!I)return;if(v==="$$"&&I.includes("$")){let z=0;for(;z0&&I[F-1]==="$"||F+10){const O=I.slice(0,R),B=a.push("text","",0);B.content=O,a.pos=a.pos+O.length,g=a.pos}const z=I.slice(R).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(z){const[,O,B]=z,j=B.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),$=j?j[1]:B,V=j&&j[2]?j[2]:null,ne=a.push("image","img",0);ne.attrs=[["src",$],["alt",O]],V&&ne.attrs.push(["title",V]),ne.content=O,ne.children=[{type:"text",content:O,tag:""}],a.pos=a.pos+z[0].length,g=a.pos;const K=I.slice(R+z[0].length);K&&E(K);return}const F=a.push("text","",0);F.content=I,a.pos=a.pos+I.length,g=a.pos;return}const W=a.push("text","",0);W.content=I,a.pos=a.pos+I.length,g=a.pos};for(;!(g>=w.length);){const I=w.indexOf(v,g);if(I===-1)break;if(s2(w,I)){g=I+Math.max(1,v.length);continue}const R=Wk(M,I);if(R){g=R[1];continue}const W=Wk(N,I);if(W){g=W[1];continue}if(I===S&&g===x){if(A++,A>2){g=I+Math.max(1,v.length);continue}}else A=0,S=I,x=g;if(v==="("&&I>0){let K=I-1;for(;K>=0&&w[K]===" ";)K--;if(K>=0&&w[K]==="]"){g=I+v.length;continue}}if(v==="$"&&I>0&&w[I-1]==="$"){g=I+1;continue}if(v==="$"&&I=w.length);){const R=nA(w,I);if(R===-1)break;if(R+10&&w[R-1]==="$"){I=R+1;continue}const W=F8(w,R+1);if(W===-1)break;const z=w.slice(R+1,W),F=z.includes("`"),O=!z||!z.trim(),B=w[W+1],j=R8(z,B),$=O8(z);if(!F&&!O&&!j&&!$){const V=w.slice(g,R);V&&E(V);const ne=a.push("math_inline","math",0);ne.content=Cd(z,t),ne.markup="$",ne.raw=`$${z}$`,ne.loading=!1,g=W+1,I=W+1}else E("$"),I=R+1}I{const c=r,d=!c?.env?.__markstreamFinal,h=t?.strictDelimiters,p=h?[["\\[","\\]"],["$$","$$"]]:[["\\[","\\]"],["[","]"],["$$","$$"]],m=c.bMarks[l]+c.tShift[l];let g=c.src.slice(m,c.eMarks[l]).trim(),y=!1,b="",v="",C=!1,w="",M=!1;for(const[V,ne]of p)if(g.startsWith(V))if(V.includes("[")){const K=V==="\\["?g.slice(V.length):"";if(V==="\\["&&d1(K,ne)===-1&&!/^\s*!\[/.test(K)&&!K.includes("`")&&zd(K)){y=!0,b=V,v=ne;break}if(t?.strictDelimiters){if(g.replace("\\","")==="["){if(l+1=0?"\\]":v,A=S>=0?S:d1(g,v,T);if(!C&&A>b.length){const V=g.slice(N+b.length,A),ne=c.push("math_block","math",0);ne.content=Cd(V),ne.markup=b==="$$"?"$$":b==="["?"[]":"\\[\\]",ne.map=[l,l+1],ne.raw=`${b}${V}${x}`,ne.block=!0,ne.loading=!1,c.line=l+1;const K=g.slice(A+x.length);return K.trim()&&n(c,K,l),!0}let E=l,I="",R=!1,W="",z=l;const F=C?g:g===b?"":g.slice(b.length),O=!h&&b==="\\["?"]":"",B=d1(F,v);if(B!==-1){const V=B;I=F.slice(0,V),W=F.slice(V+v.length),z=C?l+1:l,R=!0,E=z}else for(F&&!C&&(I=F),E=l+1;E{const c=r,d=c.bMarks[l]+c.tShift[l],h=c.src.slice(d,c.eMarks[l]).trim();return!h.startsWith("$$")&&!h.startsWith("\\[")?!1:o(r,l,a,u)};e.inline.ruler.before("escape","math",i),e.block.ruler.before("lheading","explicit_math_block",s,{alt:["paragraph","reference","blockquote","list"]}),e.block.ruler.before("paragraph","math_block",o,{alt:["paragraph","reference","blockquote","list"]})}function Uge(e){const t=e.renderer.rules.image||function(n,i,o,s,r){const l=n,a=r;return a.renderToken?a.renderToken(l,i,o):""};e.renderer.rules.image=(n,i,o,s,r)=>{const l=n;return l[i].attrSet?.("loading","lazy"),t(l,i,o,s,r)},e.renderer.rules.fence=e.renderer.rules.fence||((n,i)=>{const o=n[i],s=String(o.info??"").trim();return`
      ${e.utils.escapeHtml(String(o.content??""))}
      `})}const Vge=/^\s]/i,Kge=/^<\/a\s*>/i;function Zge(e,t){if(e?.type!=="inline")return!1;const n=e.children;if(!Array.isArray(n)||n.length===0)return t.test(String(e.content??""));let i=0;for(let o=n.length-1;o>=0;o--){const s=n[o];if(s?.type==="link_close"){for(o--;o>=0&&n[o]?.level!==s.level&&n[o]?.type!=="link_open";)o--;continue}if(s?.type==="html_inline"){const r=String(s.content??"");Vge.test(r)&&i>0&&i--,Kge.test(r)&&i++}if(!(i>0)&&s?.type==="text"&&t.test(String(s.content??"")))return!0}return!1}function Gge(e){const t=e.core?.ruler,n=t.getNamedRules?.().find(i=>i.name==="linkify")?.fn;typeof n=="function"&&t.at("linkify",i=>{if(!i.md?.options?.linkify)return;const o=Array.isArray(i.tokens)?i.tokens:[],s=i.md.linkify;if(!s)return;const r=o.filter(l=>Zge(l,s));if(r.length)return n(Object.assign(Object.create(Object.getPrototypeOf(i)),i,{tokens:r}))})}function Qge(e){const t=e.inline.ruler,n=t.getNamedRules?.(),i=n?.find(l=>l.name==="link")?.fn,o=n?.find(l=>l.name==="image")?.fn;if(typeof i!="function"||typeof o!="function")return;const s=e.validateLink,r=e;r.__markstreamOriginalValidateLink=s,t.at("link",(...l)=>{const a=l[0].md,u=a?.validateLink===s?a.options?.validateLink:a?.validateLink;if(!a||typeof u!="function")return i(...l);const c=a.validateLink;a.validateLink=u;try{return i(...l)}finally{a.validateLink=c}}),t.at("image",(...l)=>{const a=l[0].md;if(!a)return o(...l);const u=a.validateLink;a.validateLink=s;try{return o(...l)}finally{a.validateLink=u}})}function Yge(e={}){const t=e.markdownItOptions??{},n=typeof t.experimental=="object"&&t.experimental!==null?t.experimental:{},i=Object.prototype.hasOwnProperty.call(t,"stream")?!!t.stream:!0,o=Object.prototype.hasOwnProperty.call(t,"validateLink"),s=new x1e({html:!0,linkify:!0,typographer:!0,...t,experimental:{stream:i,...n}});if(!o){const r=l=>!Wh(l,{tagName:"a",attrName:"href"});qme(r),s.set({validateLink:r})}return Qge(s),Gge(s),(e.enableMath??!0)&&qge(s,{...e.mathOptions??{}}),(e.enableContainers??!0)&&q1e(s),e.enableFixIndentedCodeBlock!==!1&&hme(s),Gme(s),Xme(s),Yme(s),ige(s),Uge(s),dme(s,{customHtmlTags:e.customHtmlTags}),s}function qh(e){const t=Object.assign(Object.create(Object.getPrototypeOf(e)),e);return Array.isArray(e.attrs)&&(t.attrs=e.attrs.map(n=>[...n])),Array.isArray(e.map)&&(t.map=[...e.map]),Array.isArray(e.children)&&(t.children=e.children.map(n=>qh(n))),t}function Jge(e){const t=e.meta??{};return{type:"checkbox",checked:t.checked===!0,raw:t.checked?"[x]":"[ ]"}}function Xge(e){const t=e,n=t.attrGet?t.attrGet("checked"):void 0,i=n===""||n==="true";return{type:"checkbox_input",checked:i,raw:i?"[x]":"[ ]"}}function e0e(e){const t=String(e.content??"");return{type:"emoji",name:t,markup:String(e.markup??""),raw:`:${t}:`}}function py(e,t,n){const i=[];let o="",s=t+1;const r=[];for(;sn.startsWith(t)||t.startsWith(n)):!1}function zL(e,t,n,i){n.length>0&&e.push(...n),i.length>0&&t.push(...i),n.length=0,i.length=0}function jL(e,t){return!t&&e.startsWith(" ")&&!e.startsWith(" ")?` ${e}`:e}function o0e(e,t){const n=[],i=[],o=[],s=[],r=e.split(n0e),l=/\r?\n$/.test(e),a=r.some(p=>p.startsWith("diff ")||p.startsWith("--- ")||p.startsWith("+++ ")||p.startsWith("@@ ")),u=p=>{const m=p;if(!nW.some(g=>m.startsWith(g)))if(m.startsWith("-")){const g=m.slice(1);o.push(jL(g,a))}else if(m.startsWith("+")){const g=m.slice(1);s.push(jL(g,a))}else{zL(n,i,o,s);const g=a&&m.startsWith(" ")?m.slice(1):m;n.push(g),i.push(g)}},c=l?Math.max(0,r.length-1):r.length;for(let p=0;p0||s.length>0)&&zL(n,i,o,s);const d=n.join(` -`),h=i.join(` -`);return{original:t&&l&&d?`${d} -`:d,updated:t&&l&&h?`${h} -`:h}}function ox(e){const t=Array.isArray(e.map)&&e.map.length===2,n=e.meta??{},i=typeof n.closed=="boolean"?n.closed:void 0,o=i===!0||i!==!1&&t,s=String(e.info??""),r=s.startsWith("diff"),l=r?(()=>{const u=s,c=u.indexOf(" ");return c===-1?"":String(u.slice(c+1)??"")})():s;let a=String(e.content??"");if(!o&&e.markup){const u=e.markup[0],c=e.markup.length,d=t0e(u,c);d.test(a)&&(a=a.replace(d,""))}if(r){const{original:u,updated:c}=o0e(a,o===!0);return{type:"code_block",language:l,code:String(c??""),raw:String(a??""),diff:r,loading:i===!0?!1:i===!1?!0:!t,originalCode:u,updatedCode:c}}return{type:"code_block",language:l,code:String(a??""),raw:String(a??""),diff:r,loading:i===!0?!1:i===!1?!0:!t}}function s0e(e){const t=e.meta??{};return{type:"footnote_reference",id:String(t.label??""),raw:`[^${String(t.label??"")}]`}}function r0e(){return{type:"hardbreak",raw:`\\ -`}}function l0e(e,t,n){const i=[];let o="",s=t+1;const r=[];for(;s\s*$/.test(t)||mf.has(e)}function a0e(e){if(!e||e.length===0)return HL();const t=$8.get(e);if(t)return t;const n=e.map(Ga).filter(Boolean);if(!n.length){const o=HL();return $8.set(e,o),o}const i={customTagSet:new Set(n),allowedTagSet:_4({customHtmlTags:e})};return $8.set(e,i),i}function rW(e){const t=e,n=t.raw??t.content??t.markup??"";return String(n??"")}function u0e(e){const t=e.meta,n=t?.markstreamCustomHtmlRaw,i=t?.markstreamCustomHtmlInner;return typeof n=="string"&&typeof i=="string"?{raw:n,inner:i}:null}function qk(e,t){const n=t.toLowerCase();for(let i=e.length-1;i>=0;i--){const[o,s]=e[i];if(String(o).toLowerCase()===n)return s}}function c0e(e,t,n){const i=e.slice();return qk(i,"href")||i.push(["href",t]),n!=null&&!qk(i,"title")&&i.push(["title",n]),i}function oA(e){return e.map(rW).join("")}function y9(e){const t=[],n=i=>{const o=String(i??"");if(!o)return;const s=t[t.length-1];if(s?.type==="text"){s.content=`${s.content}${o}`,s.raw=`${s.raw}${o}`;return}t.push({type:"text",content:o,raw:o})};for(const i of e)if(i){if(i.type==="reference"||i.type==="footnote_reference"){n(String(i.raw??""));continue}if("children"in i&&Array.isArray(i.children)){t.push({...i,children:y9(i.children)});continue}t.push(i)}return t}function d0e(e,t,n){let i=0;for(let o=t;o`;g.toLowerCase().includes(M.toLowerCase())||(g+=M),b=!0,y=!0}const v=[],C=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let w;for(;(w=C.exec(l))!==null;){const M=w[1],N=w[2]||w[3]||w[4]||"";v.push([M,N])}if(u?.has(a)){const M=u0e(e);return[{type:a,tag:a,attrs:v,content:M?M.inner:p.innerTokens.length?oA(p.innerTokens):"",children:p.innerTokens.length?i(p.innerTokens,o,s,r):[],raw:M?.raw??g,loading:e.loading||y,autoClosed:b},p.nextIndex]}return[{type:"html_inline",tag:a,attrs:v,content:g,children:m,raw:g,loading:y,autoClosed:b},p.nextIndex]}function lW(e){if(e.type==="math_inline"){if(e.raw)return String(e.raw);const t=e.markup==="$$"?"$$":"$";return`${t}${String(e.content??"")}${t}`}return Array.isArray(e.children)&&e.children.length>0?e.children.map(t=>lW(t)).join(""):String(e.content??"")}function h0e(e){return!e||!Array.isArray(e.children)||e.children.length===0?"":e.children.map(t=>lW(t)).join("")}function WL(e,t=!1){let n=e.attrs??[],i=null;if((!n||n.length===0)&&Array.isArray(e.children))for(const d of e.children){const h=d.attrs;if(Array.isArray(h)&&h.length>0){n=h,i=d;break}}const o=String(n.find(d=>d[0]==="src")?.[1]??""),s=n.find(d=>d[0]==="alt")?.[1],r=h0e(i??e);let l="";r?l=r:s!=null&&String(s).length>0?l=String(s):i?.content!=null&&String(i.content).length>0?l=String(i.content):Array.isArray(i?.children)&&i.children[0]?.content?l=String(i.children[0].content):Array.isArray(e.children)&&e.children[0]?.content?l=String(e.children[0].content):e.content!=null&&String(e.content).length>0&&(l=String(e.content));const a=n.find(d=>d[0]==="title")?.[1]??null,u=a===null?null:String(a),c=String(e.content??"");return{type:"image",src:o,alt:l,title:u,raw:c,loading:t}}function p0e(e){const t=String(e.content??"");return{type:"inline_code",code:t,raw:t}}function m0e(e,t,n){const i=[];let o="",s=t+1;const r=[];for(;s=0;i--){const[o,s]=e[i];if(String(o).toLowerCase()===n)return s}}function v0e(e,t,n){const i=e.slice();return Uk(i,"href")||i.push(["href",t]),n!=null&&!Uk(i,"title")&&i.push(["title",n]),i}function my(e,t,n){const i=e[t],o=g0e(i.attrs),s=String(Uk(o,"href")??""),r=Uk(o,"title"),l=r==null?null:String(r),a=v0e(o,s,l);let u=t+1;const c=[];let d=!0;for(;uy.type==="strong_open")){const y=String(p.content??""),b=String(p.raw??y),v=qh(p);v.content=y.slice(0,-2),v.raw=b.replace(/\*\*$/,""),h=c.slice(),h[h.length-1]=v}const m=is(h,void 0,void 0,n),g=m.map(y=>{const b=y;return"content"in y?String(b.content??""):String(b.raw??"")}).join("");return{node:{type:"link",href:s,title:l,text:g,children:m,raw:`[${g}](${s}${l?` "${l}"`:""})`,loading:d,attrs:a},nextIndex:u0?i:[{type:"text",content:a,raw:a}],raw:`~${a}~`},nextIndex:s0?i:[{type:"text",content:o||String(e[t].content??""),raw:o||String(e[t].content??"")}],raw:`^${o||String(e[t].content??"")}^`},nextIndex:s?@[\\\]^_`{|}~]/,E0e=/\p{P}/u,L0e=/^[\x22\x27《「『【〔〖〘〚〈([{“‘﹁﹃﹙﹛﹝]$/u,N0e=/^[\x22\x27》」』】〕〗〙〛〉)]}”’﹂﹄﹚﹜﹞]$/u,D0e=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,F0e=/:\/\//,sA=1,aW=2,R0e=4,O0e=8,uW=16,Td=32,k9=64,Yg=128,cW=256,P0e=512,Jg=1024,$0e=1982;function gy(e){let t=0;for(let n=0;n=t){n++,i++;continue}n++,i++;continue}if(o==="*"&&n>=t)return n;n++}return-1}function gf(e){return!!e&&M0e.test(e)}function vf(e){return!!e&&(T0e.test(e)||E0e.test(e))}function fW(e,t){return!!e&&!!t&&/^\p{Script=Han}$/u.test(t)&&L0e.test(e)}function hW(e,t){return!!e&&!!t&&/^[\p{L}\p{N}]$/u.test(t)&&N0e.test(e)}function z0e(e,t){const n=t>0?e[t-1]:void 0,i=e[t+1];return!i||gf(i)?!1:!(vf(i)&&!fW(i,n)&&n&&!gf(n)&&!vf(n))}function j0e(e,t){const n=t>0?e[t-1]:void 0,i=e[t+1];return!n||gf(n)?!1:!(vf(n)&&!hW(n,i)&&i&&!gf(i)&&!vf(i))}function H0e(e,t,n=0){let i=n,o=!1;for(;i0?e[t-1]:void 0,i=e[t+2];return!i||gf(i)?!1:!(vf(i)&&!fW(i,n)&&n&&!gf(n)&&!vf(n))}function q0e(e,t){const n=t>0?e[t-1]:void 0,i=e[t+2];return!n||gf(n)?!1:!(vf(n)&&!hW(n,i)&&i&&!gf(i)&&!vf(i))}function U0e(e,t=0){let n=t,i=!1;for(;n=0&&e[s]==="\\";s--)o++;return o%2===1}const G0e=/[\p{L}\p{N}]/u,Q0e=/^[\p{L}\p{N}]+$/u;function rA(e){return e?G0e.test(e):!1}function pW(e){return e?Q0e.test(e):!1}function M0(e,t){let n=t;for(;n0?e[t-1]:void 0,o=n=2&&i.intraword&&t.push({start:n,end:o}),n=o}for(let n=0;n=3)return i;n=i+o.len}return-1}function eve(e){return e?D0e.test(e)||F0e.test(e):!1}function tve(e,t){if(!e||!t)return null;const n=e.match(/\[([^\]\n]+)\]\(([^)]*)$/);return n&&n[2]===t?n[1]:null}function is(e,t,n,i){if(!e||e.length===0)return[];const o=i?.__linkifyDemotionContext,s=o2(t),r={filename:o?.filename||s.filename,explicitFilename:o?.explicitFilename||s.explicitFilename,marketTicker:o?.marketTicker||s.marketTicker};(r.filename||r.explicitFilename||r.marketTicker)&&(i={...i,__linkifyDemotionContext:r});const l=i,a=[];let u=null,c=0;const d=i?.requireClosingStrong,h=e;function p(){return e===h&&(e=e.slice()),e}function m(){u=null}function g(G,oe){const Z=e.length===1?t:String(oe.content??""),Q=[],fe=Y0e(G);if(fe!==-1){M(G.slice(0,fe),G.slice(0,fe));const pe=G.slice(fe);return pe&&(E({type:"text",content:pe,raw:pe}),c--),c++,!0}if(x0e.test(G)){const pe=G.indexOf("~~");pe!==-1&&Q.push({type:"strikethrough",index:pe})}if(S0e.test(G)){const pe=G.indexOf("**");pe!==-1&&Q.push({type:"strong",index:pe})}if(/[^*]*\*[^*]+/.test(G)){const pe=Z?dW(Z,0):G.indexOf("*");if(Z&&pe===-1)return!1;pe!==-1&&Q.push({type:"emphasis",index:pe})}Q.sort((pe,X)=>pe.index!==X.index?pe.index-X.index:pe.type===X.type?0:pe.type==="strong"?-1:X.type==="strong"?1:0);const de=Q[0];if(!de)return!1;if(de.type==="strikethrough"){const pe=de.index,X=pe>-1?G.slice(0,pe):"";if(X&&M(X,X),pe===-1)return c++,!0;const re=G.indexOf("~~",pe+2),ke=re===-1?G.slice(pe+2):G.slice(pe+2,re),le=re===-1?"":G.slice(re+2),{node:se}=UL([{type:"s_open",tag:"s",content:"",markup:"~~",info:"",meta:null},{type:"text",tag:"",content:ke,markup:"",info:"",meta:null},{type:"s_close",tag:"s",content:"",markup:"~~",info:"",meta:null}],0,i);return m(),w(se),le&&(E({type:"text",content:le,raw:le}),c--),c++,!0}if(de.type==="strong"){const pe=de.index,X=pe>-1?G.slice(0,pe):"";if(X&&M(X,X),pe===-1)return c++,!0;if(t&&pe===0){let ge=!1,Le=0;for(;Le=2)return M(G,G),c++,!0}}if(t&&(G.match(/\*/g)||[]).length>B0e(t))return M(G.slice(X.length),G.slice(X.length)),c++,!0;const re=M0(G,pe);if(re.len>=3){const ge=X0e(G,pe+re.len);if(ge!==-1){const Le=G.slice(pe+re.len,ge);if(J0e(Le)){const{node:be}=_g([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:Le,markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,i);m(),w(be);const xe=G.slice(ge+3);return xe&&(E({type:"text",content:xe,raw:xe}),c--),c++,!0}}}if(!W0e(G,pe)){const ge=G.slice(pe,pe+re.len);M(ge,ge);const Le=G.slice(pe+re.len);return Le&&(E({type:"text",content:Le,raw:Le}),c--),c++,!0}const ke=U0e(G,pe+2);let le="",se="";if(ke.index!==-1){le=G.slice(pe+2,ke.index),se=G.slice(ke.index+2);const ge=ke.index,Le=M0(G,ge);if(re.intraword&&Le.intraword&&!pW(le)||!le&&re.len>=4&&re.intraword)return M(G.slice(X.length),G.slice(X.length)),c++,!0}else{if(d||ke.sawInvalidClose||re.intraword)return M(G.slice(X.length),G.slice(X.length)),c++,!0;le=G.slice(pe+2),se=""}if(!le&&/^\*+$/.test(se))return M(G,G),c++,!0;const{node:_e}=_g([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"text",tag:"",content:le,markup:"",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,i);return m(),w(_e),se&&(E({type:"text",content:se,raw:se}),c--),c++,!0}if(de.type==="emphasis"){let pe=de.index;pe===-1&&(pe=0);const X=G.slice(0,pe);if(X&&M(X,X),!z0e(G,pe)){M(G[pe],G[pe]);const ge=G.slice(pe+1);return ge&&(E({type:"text",content:ge,raw:ge}),c--),c++,!0}const re=M0(G,pe),ke=H0e(Z,G,pe+1),le=ke.index,se=e[c+1];if(i?.final&&se?.type==="em_open"&&le!==-1&&G.slice(pe+1,le).trim()!==G.slice(pe+1,le)||le===-1&&(ke.sawInvalidClose||i?.final||re.intraword||!rA(G[pe+1])))return M(G.slice(pe),G.slice(pe)),c++,!0;const{node:_e}=py([{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:le>-1?G.slice(pe+1,le):G.slice(pe+1),markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null}],0,i);if(m(),w(_e),le!==-1&&le{for(let _e=0;_e=0&&se[Le]==="\\";Le--)ge++;if(ge%2===0)return _e}return-1})(G);if(Q===-1)return!1;let fe=1;for(let se=Q+1;sede?.type==="math_inline")||!_0e.test(G))return null;const Z=oe.parseInline(G,{__markstreamFinal:!!i?.final});if(!Array.isArray(Z)||Z.length===0)return null;const Q=(Z.find(de=>de?.type==="inline")?.children??[]).filter(de=>!(de?.type==="text"&&String(de.content??"")===""));if(!Q.length||!Q.some(de=>de?.type!=="text")||Q.length===1&&Q[0]?.type==="text"&&String(Q[0].content??"")===G)return null;const fe=is(Q,G,n,i);return fe.length?fe:null}function v(G){m(),a.push(G)}function C(G){m();const oe=qh(G);a.push(oe)}function w(G){v(G)}function M(G,oe){u?(u.content+=G,u.raw+=oe??G):(u={type:"text",content:String(G??""),raw:String(oe??G??"")},a.push(u))}function N(G,oe){if(!G)return;const Z=is([{...oe,type:"text",content:G,raw:G}],G,n,i);if(Z.length===1&&Z[0]?.type==="text"){const Q=Z[0];M(String(Q.content??""),String(Q.raw??Q.content??""));return}for(const Q of Z)w(Q)}function T(G,oe){return String(G.markup??"").startsWith(oe)}function S(G){if(!u||G.loading!==!0||G.markup!=="\\(\\)")return;const oe=e[c-1];!oe||oe.type!=="text"||!T(oe,"\\(")||u.content.endsWith("(")&&(u.content=u.content.slice(0,-1),u.raw.endsWith("(")&&(u.raw=u.raw.slice(0,-1)),!u.content&&a[a.length-1]===u&&(a.pop(),u=null))}function x(G){return G.endsWith("](")?e[c+1]?.type==="link_open"&&e[c+1]?.markup==="linkify"&&e[c+2]?.type==="text"&&e[c+3]?.type==="link_close"&&e[c+4]?.type==="text"&&String(e[c+4]?.content??"").startsWith(")"):!1}function A(G,oe,Z=gy(G)){let Q=G;const fe=String(oe.content??"");return(Z&sA)!==0&&Q.endsWith("\\")&&!T(oe,"\\\\")&&!fe.endsWith("\\\\")&&(Q=Q.slice(0,-1)),(Z&Jg)!==0&&Q.endsWith("(")&&!T(oe,"\\(")&&!fe.endsWith("\\(")&&(Q=Q.slice(0,-1)),(Z&aW)!==0&&/\*+$/.test(Q)&&!T(oe,"\\*")&&!fe.endsWith("\\*")&&(Q=Q.replace(/\*+$/,"")),Q}for(;c=0;ge--){const Le=a[ge];if(Le.type!=="text")break;re=ge,ke=String(Le.content??"")+ke}rere==="href")?.[1],X=String(pe??"");if(t&&X){const re=t.indexOf("](");if(re!==-1){const ke=t.indexOf(")",re+2);ke===-1?Z.loading=!0:Z.loading&&t.slice(re+2,ke).includes(X)&&(Z.loading=!1)}}/^file:\/\/\/[a-z]:\//i.test(Z.href)&&$(Z,oe-1)||O(Z)||v(Z)}function z(G){if(G.markup!=="linkify")return!1;const{node:oe,nextIndex:Z}=my(e,c,i);return j(oe,Z)?(c=Z,!0):!1}function F(G){m(),w(y0e(G)),c++}function O(G){if(G.type!=="link")return!1;const oe=a[a.length-1];if(!oe||oe.type!=="text")return!1;const Z=String(oe.content??"").match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!Z)return!1;const Q=G,fe=String(Q.href??""),de=String(Q.text??""),pe=String(Z[2]??""),X=fe.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,"");if(!fe||!(de===fe||de===X||eve(de)))return!1;const re=String(Z[1]??"");return re?(oe.content=re,oe.raw=re):a.pop(),v({...G,text:pe,children:[{type:"text",content:pe,raw:pe}],raw:`[${pe}](${fe}${Q.title?` "${Q.title}"`:""})`}),!0}function B(G){if(G.type!=="link")return!1;const oe=G,Z=String(oe.href??"");return Z?j({href:Z,title:oe.title==null||oe.title===""?null:String(oe.title),loading:!!oe.loading},c+1):!1}function j(G,oe){const Z=a[a.length-1];if(Z?.type!=="image"||Z.src||!Z.loading||!String(Z.raw??"").endsWith("]("))return!1;const Q=e[oe],fe=String(Q?.content??"");if(Q?.type!=="text"||!fe.startsWith(")"))return!1;a.pop(),u=null;const de=String(Z.alt??"");v({type:"image",src:G.href,alt:de,title:G.title,raw:`![${de}](${G.href}${G.title?` "${G.title}"`:""})`,loading:!!G.loading});const pe=fe.slice(1),X=qh(Q);return X.content=pe,X.raw=pe,p()[oe]=X,!0}function $(G,oe=c-1){if(G.type!=="link")return!1;const Z=a[a.length-1],Q=e[oe];if(!Z||Z.type!=="text"||Q?.type!=="text")return!1;const fe=String(Z.content??""),de=String(Q.content??"");if(!fe.endsWith("!")||!de.endsWith("!")||T(Q,"\\!"))return!1;const pe=fe.slice(0,-1);pe?(Z.content=pe,Z.raw=pe,u=Z):(a.pop(),u=null);const X=G,re=String(X.text??X.children?.map(se=>String(se?.content??se?.raw??"")).join("")??""),ke=String(X.href??""),le=X.title==null||X.title===""?null:String(X.title);return v({type:"image",src:ke,alt:re,title:le,raw:`![${re}](${ke}${le?` "${le}"`:""})`,loading:!!X.loading}),!0}function V(G,oe="",Z=null){const Q=String(G.alt??G.raw??"");return{type:"link",href:oe,title:Z,text:Q,children:[G],raw:`[${Q}](${oe}${Z?` "${Z}"`:""})`,loading:!0}}function ne(G){const oe=G.startsWith("![")?G:`![${G}`,Z=oe.slice(2),Q=Z.indexOf("](");return{type:"image",src:"",alt:Q===-1?Z.replace(/\]$/,""):Z.slice(0,Q),title:null,raw:oe,loading:!0}}function K(G){const oe=G.indexOf("[![");if(oe===-1||typeof t=="string"&&e.length===1&&Z0e(t,oe,"["))return!1;const Z=G.slice(0,oe);return Z&&M(Z,Z),v(V(ne(G.slice(oe+1)))),c++,!0}function ee(G){if(i?.final)return!1;const oe=e[c-1];if(oe?.type!=="text"||!String(oe.content??"").endsWith("[")||T(oe,"\\["))return!1;const Z=a[a.length-1];if(Z?.type==="text"&&Z.content.endsWith("[")){const Q=Z.content.slice(0,-1);Q?(Z.content=Q,Z.raw=Q,u=Z):(a.pop(),u=null)}return v(V(WL(G))),c++,!0}function ue(G){if(G.type!=="link")return!1;const oe=G,Z=String(oe.raw??""),Q=String(oe.text??"");if(!Z.startsWith("[![")&&!Q.startsWith("!["))return!1;const fe=oe.title==null||oe.title===""?null:String(oe.title);return v(V({type:"image",src:String(oe.href??""),alt:Q.replace(/^!\[/,"").replace(/\]$/,""),title:fe,raw:Z.startsWith("[![")?Z.slice(1):Z,loading:!0})),!0}function ie(G){if(!G.startsWith("]("))return!1;const oe=e[c-2];if(oe?.type==="text"&&String(oe.content??"").endsWith("[")&&T(oe,"\\["))return!1;const Z=a[a.length-1];if(Z?.type!=="image"&&Z?.type!=="link")return!1;const Q=Z,fe=Z?.type==="link"&&Array.isArray(Q.children)&&Q.children.length===1&&Q.children[0]?.type==="image"?a.pop():null,de=fe?fe.children[0]:a.pop();if(!de||de.type!=="image")return!1;const pe=e[c+1];let X=String(fe?.href??""),re=fe?.title==null?null:String(fe.title),ke=!0;if(pe?.type==="link_open"){const{node:se,nextIndex:_e}=my(e,c+1,i);X=se.href,re=se.title,ke=!0,c=_e}else{if(X=G.slice(2),X.includes('"')){const se=X.split('"');X=String(se[0]??"").trim(),re=se[1]==null?null:String(se[1]).trim()}c++}const le=V(de,X,re);return le.loading=ke,v(le),!0}function ye(){const G=e[c-3];return e[c-2]?.type==="image"&&e[c-1]?.type==="text"&&String(e[c-1].content??"")==="]("&&G?.type==="text"&&String(G.content??"").endsWith("[")&&T(G,"\\[")}function Te(G,oe){const Z=G.indexOf("[");if(Z===-1)return!1;let Q=G.slice(0,Z);const fe=G.indexOf("](",Z);if(fe!==-1){const de=e[c+2];let pe=G.slice(Z+1,fe);if(pe.includes("[")){const ge=pe.indexOf("[");Q+=G.slice(0,Z+ge+1);const Le=Z+ge+1;pe=G.slice(Le+1,fe)}const X=e[c+1];if(G.endsWith("](")&&X?.type==="link_open"&&de){const ge=e[c+4];let Le=4,be=!0;if(ge?.type==="text"){const Oe=String(ge.content??"");if(Oe.startsWith(")")){be=!1;const Ze=Oe.slice(1);if(Ze){const ct=qh(ge);ct.content=Ze,ct.raw=Ze,p()[c+4]=ct}else Le++}else Oe==="."&&Le++}N(Q,oe);const xe=String(de.content??"");return i?.validateLink&&!i.validateLink(xe)?M(pe,pe):v({type:"link",href:xe,title:null,text:pe,children:[{type:"text",content:pe,raw:pe}],loading:be}),c+=Le,!0}const re=G.indexOf(")",fe),ke=re!==-1?G.slice(fe+2,re):"",le=re===-1;let se=Q.match(/\*+$/);if(se&&(Q=Q.replace(/\*+$/,"")),N(Q,oe),se||(se=pe.match(/^\*+/)),!d&&se){const ge=se[0].length;pe=pe.replace(/^\*+/,"").replace(/\*+$/,"");const Le=[];if(ge===1?Le.push({type:"em_open",tag:"em",nesting:1}):ge===2?Le.push({type:"strong_open",tag:"strong",nesting:1}):ge===3&&(Le.push({type:"strong_open",tag:"strong",nesting:1}),Le.push({type:"em_open",tag:"em",nesting:1})),Le.push({type:"link",href:ke,title:null,text:pe,children:[{type:"text",content:pe,raw:pe}],loading:le}),ge===1){Le.push({type:"em_close",tag:"em",nesting:-1});const{node:be}=py(Le,0,i);w(be)}else if(ge===2){Le.push({type:"strong_close",tag:"strong",nesting:-1});const{node:be}=_g(Le,0,void 0,i);w(be)}else if(ge===3){Le.push({type:"em_close",tag:"em",nesting:-1}),Le.push({type:"strong_close",tag:"strong",nesting:-1});const{node:be}=_g(Le,0,void 0,i);w(be)}else{const{node:be}=py(Le,0,i);w(be)}}else i?.validateLink&&!i.validateLink(ke)?M(pe,pe):v({type:"link",href:ke,title:null,text:pe,children:[{type:"text",content:pe,raw:pe}],loading:le});const _e=re!==-1?G.slice(re+1):"";return _e&&(E({type:"text",content:_e,raw:_e}),c--),c++,!0}return!1}function Ee(G){const oe=G.indexOf("![");if(oe===-1)return!1;const Z=G.slice(0,oe);return Z&&!u?u={type:"text",content:Z,raw:Z}:Z&&u&&(u.content+=Z),u&&(a.push(u),u=null),v(ne(G.slice(oe))),c++,!0}function Me(G){if(!(G?.startsWith("[")&&n?.type==="list_item_open"))return!1;const oe=G.slice(1).match(/[^\s\]]/);if(oe===null)return c++,!0;if(oe&&/x/i.test(oe[0])){const Z=oe[0]==="x"||oe[0]==="X";return v({type:"checkbox_input",checked:Z,raw:Z?"[x]":"[ ]"}),c++,!0}return!1}return a}function rx(e,t,n){const i=n?.__sourceLineMapper;if(!i)return{startLine:e,endLine:t};const o=i(e),s=t>e?i(t-1).endLine:i(t).startLine;return{startLine:o.startLine,endLine:Math.max(o.startLine,s)}}function VL(e,t){const n=Math.max(0,Math.min(e.length,Math.trunc(t)));let i=0;for(let o=0;oi&&e[o-1]!==` -`&&r++,{startLine:s,endLine:r}}function _v(e,t,n,i){const o=nve(e,t,n);return rx(o.startLine,o.endLine,i)}function ive(e,t){const n=e?.map;if(!Array.isArray(n)||n.length<2)return null;const i=Number(n[0]),o=Number(n[1]);return!Number.isFinite(i)||!Number.isFinite(o)?null:rx(i,o,t)}function Ei(e,t,n){if(!n?.includeSourceMap)return e;const i=ive(t,n);if(!i)return e;if(e.sourceMap=i,e.type==="code_block"){const o=e;o.startLine=i.startLine,o.endLine=i.endLine}return e}function ove(e,t,n,i){if(!i?.includeSourceMap)return e;const o=t?.map;if(!Array.isArray(o)||o.length<2)return e;const s=Number(o[0]),r=Number(o[1]),l=Number(n);return!Number.isFinite(s)||!Number.isFinite(r)||!Number.isFinite(l)||(e.sourceMap=rx(s,Math.max(r,l),i)),e}function sve(e){const t=String(e.content??""),n=t.replace(/[ \t\r\n]+$/g,"");if(n===t)return;e.content=n;const i=e.children;if(!(!Array.isArray(i)||i.length===0))for(;i.length;){const o=i[i.length-1];if(!o){i.pop();continue}if(o.type==="softbreak"||o.type==="hardbreak"){i.pop();continue}if(o.type==="text"){const s=String(o.content??""),r=s.replace(/[ \t\r\n]+$/g,"");if(r===s)break;if(r){o.content=r;break}i.pop();continue}break}}function rve(e){const t=String(e.content??""),n=t.match(/\r?\n\s*\d+[.)]?\s*$/);if(!n||typeof n.index!="number")return;e.content=t.slice(0,n.index);const i=e.children;if(!(!Array.isArray(i)||i.length===0))for(;i.length;){const o=i[i.length-1];if(!o){i.pop();continue}if(o.type==="softbreak"||o.type==="hardbreak"){i.pop();continue}if(o.type==="text"){const s=String(o.content??"");if(/^[ \t\r\n\d.)]*$/.test(s)){i.pop();continue}const r=s.replace(/[ \t\r\n\d.)]+$/g,"");r!==s&&(r?o.content=r:i.pop())}break}}function lve(e){const t=String(e.content??"");return/[ \t\r\n]+$/.test(t)||/\r?\n\s*\d+[.)]?\s*$/.test(t)}function Pm(e,t,n){const i=e[t],o=[],s=Ff(n,!0);let r=t+1;for(;rd.raw).join("")};n?.includeSourceMap&&Ei(c,e[r],n),o.push(c),r=u+1}else r+=1;const l={type:"list",ordered:i.type==="ordered_list_open",start:(()=>{if(i.attrs&&i.attrs.length){const a=i.attrs.find(u=>u[0]==="start");if(a){const u=Number(a[1]);return Number.isFinite(u)&&u!==0?u:1}}})(),items:o,raw:o.map(a=>a.raw).join(` -`)};return n?.includeSourceMap&&Ei(l,i,n),[l,r+1]}function ave(e,t,n,i){const o=String(n[1]??"note"),s=String(n[2]??o.charAt(0).toUpperCase()+o.slice(1)),r=[],l=Ff(i,!0);let a=t+1;for(;au.raw).join(` -`)} -:::`},a+1]}const uve=new Set(["warning","info","note","tip","danger","caution"]);function cve(e){let t=0;for(;t=0;g--){const y=h[g];if(y.type==="text"&&/:+/.test(y.content)){p=g;break}}const m={type:"paragraph",children:is((p!==-1?h.slice(0,p):h)||[],void 0,void 0,a.options()),raw:String(d.content??"").replace(/\n:+$/,"").replace(/\n\s*:::\s*$/,"")};n?.includeSourceMap&&Ei(m,e[u],n),l.push(m),a.remember(m.raw)}u+=3}else if(e[u].type==="bullet_list_open"||e[u].type==="ordered_list_open"){const[d,h]=Pm(e,u,a.options());n?.includeSourceMap&&Ei(d,e[u],n),l.push(d),a.remember(d.raw),u=h}else if(e[u].type==="blockquote_open"){const[d,h]=$m(e,u,a.options());n?.includeSourceMap&&Ei(d,e[u],n),l.push(d),a.remember(d.raw),u=h}else{const d=A4(e,u,a.options());d?(l.push(d[0]),a.remember(d[0].raw),u=d[1]):u++}return[{type:"admonition",kind:o,title:s,children:l,raw:`:::${o} ${s} -${l.map(d=>d.raw).join(` -`)} -:::`},u+1]}const fve=/^::: ?(warning|info|note|tip|danger|caution|error) ?(.*)$/;function hve(e,t,n){const i=e[t];if(i.type!=="container_open")return null;const o=fve.exec(String(i.info??""));return o?ave(e,t,o,n):null}const lx={parseContainer:(e,t,n)=>dve(e,t,n),matchAdmonition:hve};function $m(e,t,n){const i=[],o=Ff(n,!0);let s=t+1;for(;sl.raw).join(` -`)};return n?.includeSourceMap&&Ei(r,e[t],n),[r,s+1]}function pve(e){if(e.info?.startsWith("diff"))return ox(e);const t=String(e.content??""),n=t.match(/ type="application\/vnd\.ant\.([^"]+)"/);let i=t;n?.[1]&&(i=t.replace(/]*>/g,"").replace(/<\/antArtifact>/g,""));const o=Array.isArray(e.map)&&e.map.length===2;return{type:"code_block",language:n?n[1]:String(e.info??""),code:i,raw:i,loading:!o}}function mve(e,t,n){const i=[];let o=t+1,s=[],r=[];const l=Ff(n,!0);for(;ou.raw).join("")),o+=3}else if(e[o].type==="dd_open"){let a=o+1;for(r=[];a0&&(i.push({type:"definition_item",term:s,definition:r,raw:`${s.map(u=>u.raw).join("")}: ${r.map(u=>u.raw).join(` -`)}`}),s=[]),o=a+1}else o++;return[{type:"definition_list",items:i,raw:i.map(a=>a.raw).join(` -`)},o+1]}function gve(e,t,n){const i=e[t].meta??{},o=String(i?.label??"0"),s=[],r=Ff(n,!0);let l=t+1;for(;la.raw).join(` -`)}`},l+1]}function vve(e,t,n){const i=e[t],o=i.attrs,s=Array.isArray(o)&&o.length?Object.fromEntries(o.filter(c=>Array.isArray(c)&&c.length>=1&&c[0]).map(([c,d])=>[String(c),d==null||d===""?!0:String(d)])):void 0,r=String(i.tag?.substring(1)??"1"),l=Number.parseInt(r,10),a=e[t+1],u=String(a.content??"");return{type:"heading",level:l,text:u,...s?{attrs:s}:{},children:is(a.children||[],u,void 0,n),raw:u}}function yve(e,t,n){const i=t.toLowerCase(),o=new RegExp(String.raw`^<\s*${i}(?=\s|>|/)`,"i"),s=new RegExp(String.raw`^<\s*\/\s*${i}(?=\s|>)`,"i");let r=0,l=Math.max(0,n);for(;l$/.test(d)||r++,l=a+c+1;continue}l=a+1}return-1}function mW(e){const t=String(e.content??"");if(/^\s*");else if(a)a=!y.includes(">");else if(u)u=!y.includes("?>");else if(y.startsWith("");else if(y.startsWith("");else if(y.startsWith("");else{const b=o(y);if(b)if(b.closing){for(let v=r.length-1;v>=0;v--)if(r[v]===b.tag){r.length=v;break}}else b.selfClosing||s(b.after,b.tag)||r.push(b.tag)}}if(d===-1||d>=t)break;c=d+1}return l||a||u||r.length>0}function i2e(e,t,n){if(!n?.length)return!1;const i=new Set(kp(n));if(!i.size)return!1;const o=c=>{const d=c.charCodeAt(0);return d>=65&&d<=90||d>=97&&d<=122||d>=48&&d<=57||c==="_"||c==="-"||c===":"},s=c=>c===" "||c===" ",r=c=>{if(c[0]!=="<")return null;let d=1;for(;d"&&g!=="/")return null;const y=c.indexOf(">",d);if(y===-1)return null;let b=y-1;for(;b>=0&&s(c[b]);)b--;return{closing:h,tag:m,selfClosing:!h&&c[b]==="/",after:c.slice(y+1)}},l=(c,d)=>{const h=c.toLowerCase();let p=0;for(;p")return!0}}return!1},a=[];let u=0;for(;u=t?t:c,h=e.slice(u,d),p=h.endsWith("\r")?h.slice(0,-1):h,m=Bm(p);if(m){const g=r(p.slice(m.index));if(g)if(g.closing){for(let y=a.length-1;y>=0;y--)if(a[y]===g.tag){a.length=y;break}}else g.selfClosing||l(g.after,g.tag)||a.push(g.tag)}if(c===-1||c>=t)break;u=c+1}return a.length>0}function o2e(e,t){const n=Fve.exec(e);if(!n)return null;const i=n[1]??"",o=n.index+i.length,s=e.indexOf(` -`,o),r=e.slice(o,s===-1?e.length:s);return!Bm(r.endsWith("\r")?r.slice(0,-1):r)||SW(e,o)||n2e(e,o)||i2e(e,o,t)?null:`${e.slice(0,n.index)}${i}`}function px(e,t,n){let i=t;for(;ii&&(r=!0),t.inMath=!1,t.mathOpenOffset=null,s+=2;continue}s++;continue}if(t.inDollarMath){if(e.startsWith("$$",s)&&!Zu(e,l)){i!=null&&o&&n+s+2>i&&(r=!0),t.inDollarMath=!1,t.dollarMathOpenOffset=null,s+=2;continue}s++;continue}if(e[s]==="`"&&!Zu(e,l)){const a=px(e,s,"`"),u=_W(e,s+a,a);if(u===-1)break;s=u+a;continue}if(e.startsWith("\\[",s)&&!Zu(e,l)){t.inMath=!0,t.mathOpenOffset=n+s,s+=2;continue}if(e.startsWith("$$",s)&&!Zu(e,l)){t.inDollarMath=!0,t.dollarMathOpenOffset=n+s,s+=2;continue}s++}return r}function s2e(e,t){if(!nx(t))return e;const n=t,i=YL.get(n),o=i?.source===e?i.state:i&&e.startsWith(i.source)?IW(i.state,e.slice(i.source.length),i.source.length-i.state.lineBuffer.length).state:S4(e).state;YL.set(n,{source:e,state:o});const{context:s}=o,r=s.inMath?s.mathOpenOffset:s.inDollarMath?s.dollarMathOpenOffset:null;if(r==null)return e;const l=e.slice(r+2),a=e.lastIndexOf(` -`,r-1)+1;if(e.slice(a,r).trim()!==""&&!/^\r?\n/.test(l)||/^\s*!\[/.test(l))return e;const u=l.trim(),c=/^(?:[a-z]|pi)$/i.test(u);return zd(l)&&!c?e:e.slice(0,r)}function r2e(e,t,n,i,o){const s=cx(e),r=dx(e);if(t.inFence&&t.fenceInBlockquote&&e.trim()&&fx(e)==null&&q8(t),t.inFence&&t.fenceInList&&e.trim()&&s.column=t.fenceLen&&/^\s*$/.test(l.rest)&&q8(t):(t.inFence=!0,t.fenceChar=l.markerChar,t.fenceLen=l.markerLen,t.fenceInBlockquote=l.inBlockquote,t.fenceInList=l.inList||t.listContentIndent!=null&&!l.inBlockquote&&s.column>=t.listContentIndent,t.fenceListIndent=l.listIndent||t.listContentIndent||0);else if(!t.inFence)return tN(e,t,n,i,o)}else return tN(e,t,n,i,o);return!1}function S4(e,t=Yve(),n=null,i=!1,o=0){const s=E0(t);let r=E0(t),l="",a=!1,u=0;for(;uu&&e[c-1]==="\r"?c-1:d?c:e.length,p=e.slice(u,h);r2e(p,s,o+u,n,i)&&(a=!0),d?(r=E0(s),l=""):l=p,u=d?c+1:e.length}return{closedOpenMath:a,state:{committedContext:r,context:s,lineBuffer:l}}}function IW(e,t,n=0){return t&&!e.context.inMath&&!e.context.inDollarMath&&!e.context.inFence&&!e.committedContext.inFence&&!/[\\$`~\r\n]/.test(t)&&!(e.lineBuffer.endsWith("\\")&&(t[0]==="["||t[0]==="]"))?{closedOpenMath:!1,state:{committedContext:E0(e.committedContext),context:E0(e.context),lineBuffer:e.lineBuffer+t}}:S4(e.lineBuffer+t,e.committedContext,n+e.lineBuffer.length,e.context.inMath||e.context.inDollarMath,n)}function l2e(e,t){if(!nx(e))return;const n=e.stream;if(typeof n?.reset!="function")return;const i=e,o=x4.get(i);if(o?.source===t)return;const s=o?t.startsWith(o.source):!1,r=s&&o?t.slice(o.source.length):"",l=s&&o?IW(o.explicitBracketMath,r,o.source.length-o.explicitBracketMath.lineBuffer.length):S4(t),a=l.state,u=s&&o?l.closedOpenMath:!1;if(o&&s&&o.key===null&&o.pendingCandidate===!1&&!u&&!t2e(o.source,r)&&!Xve(t)){o.source=t,o.explicitBracketMath=a;return}const c=Hge(t);(o&&(o&&!s||o.key!==c||u)||!o&&c)&&n.reset(),Jve(e,t,c,a)}function a2e(e){return typeof e.preTransformTokens=="function"||typeof e.postTransformTokens=="function"}function MW(e,t){const n=e?.map,i=t?.map;return n===i?!0:!Array.isArray(n)||!Array.isArray(i)?!1:n.length===i.length&&n.every((o,s)=>o===i[s])}function u2e(e,t){const n=e?.attrs,i=t?.attrs;if(n===i)return!0;if(!Array.isArray(n)||!Array.isArray(i)||n.length!==i.length)return!1;for(let o=0;o":""}function sN(e){return{type:"paragraph",children:e,raw:e.map(h2e).join("")}}function rN(e,t){if(t.sourceMap)for(const n of e)n.sourceMap||(n.sourceMap=t.sourceMap)}function lN(e,t){if(e.type!=="paragraph")return null;const n=e.children,i=Array.isArray(n)?n:[];if(i.length===0)return null;const o=Vve(t);if(!o?.size)return null;let s=-1;for(let c=0;cp?.type==="hardbreak")){s=c;break}}if(s===-1)return null;const r=i.slice(0,s),l=i[s];if(!l)return null;const a=[];r.length&&a.push(sN(r)),a.push(l);const u=i.slice(s+1);return u.length&&a.push(sN(u)),a}function p2e(e){const t=e.trim();if(!t)return null;const n=/^(?:]*>\s*)?]*)?>/i.test(t),i=/<\/html>\s*$/i.test(t);return!n||!i?null:[{type:"html_block",tag:"html",raw:e,content:e,loading:!1}]}function L0(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:""}function m2e(e,t){if(e.type!=="html_block"||!t)return!1;const n=String(e.raw??e.content??"");return new RegExp(String.raw`^\s*<\s*\/\s*${xu(t)}\s*>\s*$`,"i").test(n)}const V8=new Set(["iframe","script","style","textarea","title"]);function r2(e,t,n){if(!e||!t)return null;const i=t.toLowerCase(),o=h=>{if(e.startsWith("",h+4);return{closing:!1,end:C===-1?e.length:C+3,selfClosing:!1,tag:""}}if(e.startsWith("",h+9);return{closing:!1,end:C===-1?e.length:C+3,selfClosing:!1,tag:""}}const p=gs(e.slice(h));if(p===-1)return null;const m=h+p+1,g=e.slice(h,m);if(/^<\s*[!?]/.test(g))return{closing:!1,end:m,selfClosing:!1,tag:""};let y=g.slice(1).trimStart();const b=y.startsWith("/");b&&(y=y.slice(1).trimStart());const v=y.match(/^([A-Z][\w:-]*)/i);return v?.[1]?{closing:b,end:m,selfClosing:/\/\s*>$/.test(g),tag:v[1].toLowerCase()}:{closing:!1,end:h+1,selfClosing:!1,tag:""}},s=(h,p)=>{const m=new RegExp(String.raw`<\s*\/\s*${xu(h)}(?=\s|>)`,"gi");m.lastIndex=p;const g=m.exec(e);if(!g||g.index==null)return null;const y=o(g.index);return y?{start:g.index,end:y.end}:null};let r=-1,l=-1,a=Math.max(0,n);for(;a$/.test(u))return{raw:u,start:r,end:l+1,closed:!0};if(V8.has(i)){const h=s(i,l+1);return h?{raw:e.slice(r,h.end),start:r,end:h.end,closeStart:h.start,closed:!0}:{raw:e.slice(r),start:r,end:e.length,closed:!1}}let c=1,d=l+1;for(;d]*$/,"")} -`}function aN(e){return e.replace(/\r\n/g,` -`).replace(/(^|\n)[ \t]{1,4}/g,"$1")}function y2e(e,t,n){return n?e.includes(n,t)?!0:aN(e.slice(Math.max(0,t))).includes(aN(n)):!1}function k2e(e,t){let n=Math.max(0,t);for(;n)`,"gi");let i=-1,o;for(;(o=n.exec(e))!==null;)i=o.index;return i}function EW(e,t){return{final:t,__disableStreamParse:!0,requireClosingStrong:e.requireClosingStrong,customHtmlTags:e.customHtmlTags,validateLink:e.validateLink}}const w2e=new Set(["admonition","blockquote","code_block","definition_list","footnote","heading","list","math_block","table","thematic_break"]),C2e=/(?:^|\n)\s{0,3}(?:#{1,6}\s+\S|[-+*]\s+\S|\d+[.)]\s+\S|>\s*\S|`{3,}|~{3,}|(?:\*{3,}|-{3,}|_{3,})(?:\s|$)|\|.*\|)/m;function A2e(e){return/\n\s*\n/.test(e)||C2e.test(e)}function x2e(e,t){if(!e.trim()||t.length===0)return!1;if(t.some(i=>w2e.has(String(i?.type??"").toLowerCase()))||t.some(i=>{if(i?.type!=="html_block")return!1;const o=i;return Array.isArray(o.children)&&o.children.length>0}))return!0;if(!A2e(e))return!1;if(t.length>1)return!0;const[n]=t;return!!(n&&n.type==="paragraph")}function S2e(e){const t=[];let n=0;for(;n=e.length)break;const i=e.slice(n).match(/^<([A-Z][\w:-]*)/i);if(!i?.[1])return null;const o=r2(e,i[1],n);if(!o||o.start!==n)return null;t.push(o.raw),n=o.end}return t.length>1?t:null}function _2e(e,t,n,i){const o=n.customHtmlTags?.join("\0")??"",s=t,r=QL.get(s),l=r&&r.final===i&&r.customHtmlTags===o&&r.requireClosingStrong===n.requireClosingStrong&&r.validateLink===n.validateLink,a=e.map((u,c)=>l&&r.blocks[c]===u?r.children[c]:V1(u,t,n));return QL.set(s,{blocks:e,children:a,customHtmlTags:o,final:i,requireClosingStrong:n.requireClosingStrong,validateLink:n.validateLink}),a.flat()}function I2e(e,t,n,i){return e.map(o=>{if(o?.type!=="html_block")return o;const s=o,r=String(s.tag??"").toLowerCase();if(!r||r==="details"||TH.has(r)||Array.isArray(s.children))return o;const l=String(o.raw??s.content??"");if(!l)return o;const a=gs(l);if(a===-1)return o;const u=r2(l,r,0),c=u?.closeStart??-1,d=u?.closed===!0&&c>=a+1,h=d?l.slice(a+1,c):l.slice(a+1);if(!h.trim())return o;const p=EW(n,i),m=d?null:S2e(h),g=m?_2e(m,t,p,i):V1(h,t,p);return x2e(h,g)?{...o,children:g}:o})}function M2e(e){for(const t of e)if(t?.type==="html_block")return!0;return!1}function V1(e,t,n){return e.trim()?NW(e,t,{...n,__disableStreamParse:!0,__disableStructuredReuse:!0}):[]}function T2e(e,t,n){const i=V1(e,t,n),o=i[0];return i.length===1&&o?.type==="paragraph"&&Array.isArray(o.children)?o.children:i}function E2e(e,t,n){const i=mW({content:e}),o=gs(e),s=TW(e,"summary");if(o!==-1&&s!==-1&&s>=o+1){const r=T2e(e.slice(o+1,s),t,n);r.length>0&&(i.children=r)}return i.raw=e,i}function L2e(e,t,n){const i=gs(e);if(i===-1)return[];const o=e.slice(i+1);if(!o.trim())return[];const s=r2(o,"summary",0);if(!s)return V1(o,t,n);const r=o.slice(0,s.start),l=o.slice(s.end);return[...V1(r,t,n),E2e(s.raw,t,n),...V1(l,t,n)]}function LW(e,t,n,i,o,s=0){const r=[];let l=s;for(let a=0;a{const $=TW(h,"details");return $!==-1?h.slice(0,$):h})():h,[C]=LW(b?[]:g===-1?e.slice(a+1):e.slice(a+1,g),t,n,i,o,p+h.length),w=L2e(v,n,EW(i,o)),M=g===-1?"":String(e[g].raw??L0(e[g])??""),N=b||g!==-1&&y?.closed===!0,T=M.replace(/[\t\r\n ]+$/,""),S=N?(()=>{const $=(y?.raw??"").lastIndexOf(T);return $===-1?t.length:p+$})():t.length,x=gs(h),A=b&&x!==-1?p+x+1:p+h.length,E=t.slice(A,S===-1?t.length:S),I=n.parse(E,{__markstreamFinal:o}),R=n.renderer.render(I,n.options,{__markstreamFinal:o}),W=S+T.length,z=N?Math.max(S+M.length,k2e(t,W)):t.length,F=N?t.slice(S,z):M,O=N?t.slice(p,z):t.slice(p),B=b&&x!==-1?h.slice(0,x+1):h,j={...u,tag:"details",attrs:C4(h.slice(0,x+1)),raw:O,content:`${B}${R}${F}`,children:[...w,...C],loading:!o&&!N};if(i.includeSourceMap&&(j.sourceMap=_v(t,p,N?z:t.length,i)),r.push(j),l=N?z:t.length,g===-1&&!b)break;g!==-1&&(a=g)}return[r,l]}function N2e(e,t,n,i){if(!n)return e;const o=e.slice();let s=0;for(let r=0;r=d.start&&x.end<=d.end){o.splice(N,1);continue}break}M=S+T.length,o.splice(N,1)}}return o}function D2e(e){const t=l=>l===" "||l===" "||l===` -`||l==="\r",n=l=>{if(!l||l[0]!=="<"||l.includes(">"))return!1;let a=1;if(a{const y=g.charCodeAt(0);return y>=65&&y<=90||y>=97&&y<=122},c=g=>{const y=g.charCodeAt(0);return y>=48&&y<=57},d=g=>g==="!"||u(g),h=g=>u(g)||c(g)||g===":"||g==="-",p=g=>u(g)||c(g)||g==="_"||g==="."||g===":"||g==="-",m=p;if(a>=l.length||!d(l[a]))return!1;for(a++;a=l.length)return!0;if(l[a]==="/"){for(a++;a=l.length}if(!p(l[a]))return!1;for(a++;a=l.length)return!0;const g=l[a];if(g==='"'||g==="'"){for(a++;a=l.length)return!0;a++}else{for(;a"||y==='"'||y==="'"||y==="`")break;a++}if(a>=l.length)return!0}}}return!0},i=(l,a)=>SW(l,a),o=String(e??""),s=o.lastIndexOf("<");if(s===-1||i(o,s))return o;if(s>0){const l=o[s-1],a=l===" "||l===" "||l===` -`||l==="\r",u=o[s-2];if(!a&&!((l==="n"||l==="r")&&u==="\\"))return o}const r=o.slice(s);return r.includes(">")||r.length>1&&(r[1]===" "||r[1]===" "||r[1]===` -`||r[1]==="\r")||!n(r)?o:o.slice(0,s)}function cN(e,t){if(e===t)return;const n=e.split(/\r?\n/),i=t.split(/\r?\n/),o=[];let s=0;for(let r=0;r{const l=Number.isFinite(r)?Math.max(0,Math.trunc(r)):0;if(lString(m??"").toLowerCase()).filter(Boolean));if(!n.size)return e;const i=m=>m===" "||m===" ",o=m=>{const g=m.charCodeAt(0);return g>=65&&g<=90||g>=97&&g<=122||g>=48&&g<=57||m==="_"||m==="-"||m===":"},s=m=>{if(!m)return!1;if(m[0]===" ")return!0;let g=0;for(let y=0;y=4)return!0;continue}if(b===" ")return!0;break}return!1},r=m=>{let g=!1,y=!1;for(let b=0;b")return b}return-1},l=m=>{let g=0;for(;g{if(s(m))return-1;const y=m.replace(/^[ \t]+/,"");if(!y||y.startsWith(">")||y.startsWith("|")||/^(?:[*+-]|\d+[.)])[\t ]+/.test(y))return-1;let b=!1,v=0;for(;v=M.length){b=!0,v++;continue}const T=M[N];if(T==="!"||T==="?"){b=!0,v+=w+1;continue}if(T==="/"){b=!0,v+=w+1;continue}const S=N;for(;N"&&A!=="/"){b=!0,v++;continue}const E=new RegExp(String.raw`<\s*\/\s*${x}\s*>`,"i"),I=/\/\s*>$/.test(M),R=E.test(m.slice(v+w+1)),W=E.test(e.slice(g+v+w+1)),z=/[\r\n]/.test(e.slice(g+v+w+1));if(b&&n.has(x)&&!I&&!R&&(W||z))return v;b=!0,v+=w+1}return-1};let u=!1,c="",d=0,h="",p=0;for(;pp&&e[m-1]==="\r",b=g?y?m-1:m:e.length,v=e.slice(p,b),C=g?y?`\r -`:` -`:"",w=l(v);let M=v;if(!u&&!w){const N=a(v,p);if(N!==-1){const T=C||` -`;M=`${v.slice(0,N).replace(/[ \t]+$/,"")}${T}${T}${v.slice(N).replace(/^[ \t]+/,"")}`}}h+=M,h+=C,w&&(u?w.markerChar===c&&w.markerLen>=d&&/^\s*$/.test(w.rest)&&(u=!1,c="",d=0):(u=!0,c=w.markerChar,d=w.markerLen)),p=g?m+1:e.length}return h}function R2e(e,t){if(!e||!t.length)return e;const n=new Set(t.map(d=>String(d??"").toLowerCase()));if(!n.size)return e;const i=d=>d===" "||d===" ",o=d=>{const h=d.charCodeAt(0);return h>=65&&h<=90||h>=97&&h<=122||h>=48&&h<=57||d==="_"||d==="-"},s=d=>{let h=0;for(;h{let h=!1,p=!1;for(let m=0;m")return m}return-1},l=(d,h,p)=>{const m=p.toLowerCase();let g=d.indexOf("<",h);for(;g!==-1;){let y=g+1;for(;y=d.length||d[y]!=="/"){g=d.indexOf("<",g+1);continue}for(y++;yd.length){g=d.indexOf("<",g+1);continue}let b=!0;for(let C=0;C="A"&&w<="Z"?String.fromCharCode(w.charCodeAt(0)+32):w)!==m[C]){b=!1;break}}if(!b){g=d.indexOf("<",g+1);continue}let v=y+m.length;if(v")return!0;g=d.indexOf("<",g+1)}return!1},a=d=>{let h=0;for(;h=d.length||d[h]!=="<")return d;for(h++;h=d.length||d[h]==="/")return d;const p=h;for(;hc&&e[d-1]==="\r",p=h?d-1:d,m=e.slice(c,p);u+=a(m),u+=h?`\r -`:` -`,c=d+1}return u}function O2e(e,t){if(!e||!t.length)return e;const n=new Set(t.map(h=>String(h??"").toLowerCase()));if(!n.size)return e;const i=h=>h===" "||h===" ",o=h=>{let p=0,m=!1,g=0;for(;p=h.length||h[p]!==">")break;for(m=!0,p++;p{let p=0;for(;pnew RegExp(String.raw`(<\s*\/\s*${h}\s*>)${"(?=[\\t ]*(?:#{1,6}[\\t ]+|>|(?:[*+-]|\\d+[.)])[\\t ]+|(?:`{3,}|~{3,})|\\||\\$\\$|:{3,}|\\[\\^[^\\]]+\\]:|(?:-{3,}|\\*{3,}|_{3,})))"}`,"gi"));let l=!1,a="",u=0,c="",d=0;for(;dd&&e[h-1]==="\r",g=p?m?h-1:h:e.length,y=e.slice(d,g),b=p?m?`\r -`:` -`:"",v=o(y),C=v?.prefix??"",w=v?.content??y,M=s(w);M&&(l?M.markerChar===a&&M.markerLen>=u&&/^\s*$/.test(M.rest)&&(l=!1,a="",u=0):(l=!0,a=M.markerChar,u=M.markerLen));let N=w;if(!l&&N.includes("{if(E.replace(/^[\t ]+/,"").startsWith("|"))return S;const I=E.slice(0,A).replace(/^[\t ]+/,"");if(I.length>0){const R=x.match(/^<\s*\/\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"",W=I.match(/^<\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"";if(!R||!W||R!==W)return S}return`${x} - -`});if(C){const T=C+N.split(` -`).join(` -${C}`);c+=T}else c+=N;c+=b,d=p?h+1:e.length}return c}function P2e(e,t){if(!e||!t.length)return e;const n=new Set(t.map(I=>String(I??"").toLowerCase()));if(!n.size)return e;const i=I=>I===" "||I===" ",o=I=>{if(!I)return!1;if(I[0]===" ")return!0;let R=0;for(let W=0;W=4)return!0;continue}if(z===" ")return!0;break}return!1},s=I=>{const R=I.charCodeAt(0);return R>=65&&R<=90||R>=97&&R<=122||R>=48&&R<=57||I==="_"||I==="-"||I===":"},r=I=>{let R=0;for(;R{let R=0,W=!1,z=0;for(;R=I.length||I[R]!==">")break;for(W=!0,R++;Rr(I).startsWith("<"),u=I=>{for(let R=0;R{if(o(I))return"";const R=r(I);if(!R.startsWith("<"))return"";let W=1;for(;W=R.length||R[W]==="/"||R[W]==="!"||R[W]==="?")return"";const z=W;for(;W"&&O!=="/"?"":F},d=I=>{if(o(I))return null;const R=r(I);if(!R.startsWith("<"))return null;let W=1;for(;W=R.length)return null;const z=R[W]==="/";if(z)for(W++;W"&&j!=="/")return null;if(z)return{type:"close",name:B};if(/\/\s*>\s*$/.test(R))return{type:"open",name:B,complete:!0};const $=R.indexOf(">",W);if($!==-1){const V=R.slice($+1);if(new RegExp(`<\\s*\\/\\s*${B}\\s*>`,"i").test(V))return{type:"open",name:B,complete:!0}}return{type:"open",name:B,complete:!1}},h=I=>{if(o(I))return null;const R=r(I).replace(/[ \t]+$/,"");if(!R.startsWith("<")||/^<\s*(?:!--|!doctype\b|\?)/i.test(R))return null;const W=R.match(/^<\s*([A-Z][\w:-]*)\b[^>]*\/\s*>\s*$/i);if(W?.[1])return W[1].toLowerCase();const z=R.match(/^<\s*([A-Z][\w:-]*)\b[^>]*>[\s\S]*<\s*\/\s*([A-Z][\w:-]*)\s*>\s*$/i);if(!z?.[1]||!z[2])return null;const F=z[1].toLowerCase();return F===z[2].toLowerCase()?F:null};let p=!1,m="",g=0;const y=I=>{let R=0;for(;Ry(I),v=I=>{const R=r(I);return R?o(I)?!0:/^(?:#{1,6}[ \t]+|>|[*+-][ \t]+|\d+[.)][ \t]+|`{3,}|~{3,}|\||\$\$|:{3,}|\[\^[^\]]+\]:|-{3,}|\*{3,}|_{3,})/.test(R):!1},C=(I,R,W)=>{let z=I,F=0;for(;zz&&e[O-1]==="\r",$=B?j?O-1:O:e.length,V=e.slice(z,$),ne=l(V),K=ne?.key??"";if(F>0&&R&&K!==R)break;const ee=ne?.content??V,ue=d(ee);if(ue?.name===W){if(ue.type==="open")ue.complete||F++;else if(F>0&&(F--,F===0))return!1}else if(F>0&&(u(ee)||v(ee)))return!0;if(B)z=O+1;else break}return!1};let w="",M=0,N=!0,T=!1,S=!1,x=` -`;const A=[];let E="";for(;MM&&e[I-1]==="\r",z=R?W?I-1:I:e.length,F=e.slice(M,z),O=R?W?`\r -`:` -`:"",B=l(F),j=B?.key??"",$=B?.content??F,V=b($);V&&(p?V.markerChar===m&&V.markerLen>=g&&/^\s*$/.test(V.rest)&&(p=!1,m="",g=0):(p=!0,m=V.markerChar,g=V.markerLen));const ne=A.length>0;if(!p&&!ne){const ee=c($),ue=!!ee&&!N&&T&&S&&C(M,j,ee);ee&&!N&&(!T||ue)&&(j&&E&&j===E?w+=`${j}${x}`:j||(w+=x))}if(w+=F,w+=O,O&&(x=O),!p){const ee=d($);if(ee){if(ee.type==="open")ee.complete||A.push(ee.name);else for(let ue=A.length-1;ue>=0;ue--)if(A[ue]===ee.name){A.length=ue;break}}}const K=u($);N=K,T=!K&&a($),S=!K&&!!h($),E=j,M=R?I+1:e.length}return w}function $2e(e){let t=!1,n="",i=0,o=!1,s=!1,r=!1,l=0;const a=(c,d)=>{const h=hx(c);if(h){t?h.markerChar===n&&h.markerLen>=i&&/^\s*$/.test(h.rest)&&(t=!1,n="",i=0):(t=!0,n=h.markerChar,i=h.markerLen);return}if(t)return;let p=0;for(;p{for(;l=c?c:d,p=h>l&&e[h-1]==="\r"?h-1:h;if(a(e.slice(l,p)),d===-1||d>=c){l=c;break}r=!1,l=d+1}},inMath:()=>o||s||r}}function K8(e,t,n,i){let o=e.replace(/([^\\])\r(ight|ho)/g,"$1\\r$2");const s=$2e(o);if(o=o.replace(/([^\\])\r?\n(abla|eq|ot|exists)/g,(r,l,a,u)=>{s.scanTo(u+1);const c=s.inMath();return s.scanTo(u+r.length),c?`${l}\\n${a}`:r}),t||(o.endsWith("- *")&&(o=o.replace(/- \*$/,"- \\*")),/(?:^|\n)\s*-\s*$/.test(o)?o=o.replace(/(?:^|\n)\s*-\s*$/,r=>r.startsWith(` -`)?` -`:""):/(?:^|\n)\s*--\s*$/.test(o)?o=o.replace(/(?:^|\n)\s*--\s*$/,r=>r.startsWith(` -`)?` -`:""):/(?:^|\n)\s*>\s*$/.test(o)?o=o.replace(/(?:^|\n)\s*>\s*$/,r=>r.startsWith(` -`)?` -`:""):/\n\s*[*+]\s*$/.test(o)?o=o.replace(/\n\s*[*+]\s*$/,` -`):/(?:^|\n)\s*\d+\s*$/.test(o)?/^\d+$/.test(o.trim())||(o=o.replace(/(?:^|\n)\s*\d+\s*$/,r=>r.startsWith(` -`)?` -`:"")):/(?:^|\n)\s*\d+[.)]\s+\*{1,3}\s*$/.test(o)?o=o.replace(/((?:^|\n)\s*\d+[.)]\s+)(\*{1,3})\s*$/,(r,l,a)=>`${l}${a.split("").map(()=>"\\*").join("")}`):/(?:^|\n)\s*\d+[.)]\s*$/.test(o)?o=o.replace(/(?:^|\n)\s*\d+[.)]\s*$/,r=>r.startsWith(` -`)?` -`:""):/\n[[(]\n*$/.test(o)&&(o=o.replace(/(\n\[|\n\()+\n*$/g,` -`)),o=o2e(o,i.customHtmlTags)??o),i.customHtmlTags?.length&&o.includes("<")){const r=kp(i.customHtmlTags);if(r.length&&(o=F2e(o,r),o=R2e(o,r),o=P2e(o,r),o=O2e(o,r),o.includes("[\t ]*)(\r?\n)(?![\t ]*\r?\n|$)`,"gim");o=o.replace(a,"$1$2$2")}}return t||(o=D2e(o)),o}function B2e(e,t,n,i){const o=e,s=`${n?"final":"stream"}:${(i.customHtmlTags??[]).join(",")}`,r=aA.get(o);let l;if(!n&&!i.customHtmlTags?.length&&r&&r.mode===s&&t.length>=r.source.length&&t.startsWith(r.source)){const a=Math.max(0,r.source.length-Rve-Ove),u=K8(t.slice(a),n,e,i),c=r.source.length-a;l=u.length>=c&&u.slice(0,c)===r.safeMarkdown.slice(-c)?r.safeMarkdown.slice(0,r.safeMarkdown.length-c)+u:K8(t,n,e,i)}else l=K8(t,n,e,i);return n||(l=s2e(l,e)),aA.set(o,{source:t,safeMarkdown:l,mode:s}),l}function NW(e,t,n={}){const i=kW(n),o=i?uu():0,s=!!n.final,r=(e??"").toString();Gve(t,n)&&(t.stream.reset(),Qve(t),aA.delete(t));const l=B2e(t,r,s,n);i&&Xd(i,"safeMarkdownMs",uu()-o);const a=p2e(l);if(a){if(n.includeSourceMap){const M={...n,__sourceLineMapper:cN(r,l)};a[0].sourceMap=_v(l,0,l.length,M)}const C=n.preTransformTokens,w=n.postTransformTokens;if(ux(t,n)||typeof C=="function"||typeof w=="function"){const M=oN(t,l,{__markstreamFinal:s},n),N=typeof C=="function"&&C(M)||M;typeof w=="function"&&w(N)}return JL(a,n,i,o)}const u=i?uu():0,c=oN(t,l,{__markstreamFinal:s},n);if(i&&Xd(i,"tokenizeMs",uu()-u),!c||!Array.isArray(c))return JL([],n,i,o);const d=n.preTransformTokens,h=n.postTransformTokens;let p=c;d&&typeof d=="function"&&(p=d(p)||p);const m=t,g=typeof m.validateLink=="function"&&m.__markstreamOriginalValidateLink&&m.validateLink!==m.__markstreamOriginalValidateLink?m.validateLink:void 0,y=n.validateLink??g??m.options?.validateLink??(typeof m.validateLink=="function"?m.validateLink:void 0),b={...n,validateLink:y,__markdownIt:t,__sourceLineMapper:n.includeSourceMap===!0?cN(r,l):void 0,__sourceMarkdown:l,__customHtmlBlockCursor:0};let v=Uve(t,l,p,b,i);if(h&&typeof h=="function"){const C=h(p);if(Array.isArray(C)){const w=C[0],M=w?.type;w&&typeof M=="string"?v=f1(C,{...b,__customHtmlBlockCursor:0},i):v=C}}if(M2e(v)){const C=i?uu():0;v=N2e(v,s,l,b),v=LW(v,l,t,b,s)[0],v=I2e(v,t,b,s),i&&Xd(i,"htmlBlockPassesMs",uu()-C)}if(s){const C=new WeakSet,w=M=>{if(!M||typeof M!="object"||C.has(M))return;if(C.add(M),Array.isArray(M)){for(const T of M)w(T);return}const N=M;N.type==="html_block"&&N.loading===!0&&(N.loading=!1);for(const T of Object.values(N))w(T)};w(v)}return v=wW(v,n),n.debug&&console.log("Parsed Markdown Tree Structure:",v),bW(v,i,o)}function dN(e,t){if(!e||!Array.isArray(e))return[];const n=[],i=Ff(t),o=t?.__linkifyDemotionSeed;if(Array.isArray(o)&&o.length)for(const l of o)i.remember(String(l??""));const s=t?.includeSourceMap===!0;let r=0;for(;rd.type==="html_block")){if(s)for(const d of c)Ei(d,a,t);for(const d of c)Ou(d,a,t);n.push(...c)}else{const d={type:"paragraph",raw:u,children:c};s&&Ei(d,a,t);const h=lN(d,t);if(h){s&&rN(h,d);for(const p of h)Ou(p,a,t);n.push(...h)}else Ou(d,a,t),n.push(d)}i.remember(u)}r+=1;break;default:r+=1;break}}return n}const z2e=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g,N0=/\d/u,j2e=/[,.!?;:,。;、!?:]/u,H2e=/\d\p{Script=Han}{1,3}$/u;function W2e(e){return e.pos>0&&e.pos+1{const u=l,c=u.posMax,d=u.pos;if(u.src.charCodeAt(d)!==r||a||s.refuseDigitRange&&W2e(u))return!1;u.pos=d+1;let h=!1;for(;u.pos]|$)/i,K2e=new Set([...i2,"base","button","datalist","dialog","embed","fieldset","form","iframe","input","legend","link","meta","object","optgroup","option","output","param","select","style","template","textarea","title"]),Z2e=new Set(["a","abbr","b","blockquote","br","caption","code","col","colgroup","dd","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","li","mark","ol","p","picture","pre","s","small","source","span","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","ul"]);function fN(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function G2e(e){return typeof e=="string"?e:e==null?"":String(e)}function DW(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function jd(e){return G2e(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function FW(e){return jd(e).replace(/`/g,"`")}function I4(e){return String(e??"").trim().toLowerCase()}function mx(e,t="safe"){const n=I4(e);return n?t==="escape"?!0:t==="trusted"?i2.has(n):!Z2e.has(n):!1}function RW(e,t="safe"){const n=I4(e);return n?t==="escape"?!0:t==="trusted"?i2.has(n):K2e.has(n):!1}function hN(e){const t=Object.entries(e);return t.length===0?"":t.map(([n,i])=>i===""?` ${n}`:` ${n}="${FW(i)}"`).join("")}function OW(e){const t=e.startsWith("/"),n=t?e.slice(1):e,i=n.match(V2e);return i?{attrsStr:t?"":n.slice(i[0].length).trimStart(),isClosing:t,isSelfClosing:!t&&e.trimEnd().endsWith("/"),tagName:i[1]}:null}function Q2e(e,t){const n=e.split(",").map(i=>i.trim()).filter(Boolean);return n.length===0?!1:n.some(i=>{const o=i.split(/\s+/,1)[0]??"";return!o||Wh(o,{tagName:t,attrName:"srcset"})})}function PW(e,t,n,i){return N1e.has(e)||n==="safe"&&e==="style"?!0:e==="srcset"?Q2e(t,i):!!(D1e.has(e)&&t&&Wh(t,{tagName:i,attrName:e}))}function wh(e,t){const n=t.toLowerCase();return Object.keys(e).find(i=>i.toLowerCase()===n)}function $W(e,t,n,i=!1){if(t!=="safe"||I4(n)!=="a")return e;const o=wh(e,"href");if(i&&(!o||!e[o])){const a=wh(e,"target"),u=wh(e,"rel");return a&&delete e[a],u&&delete e[u],e}const s=wh(e,"target");if((s?String(e[s]).trim():"").toLowerCase()!=="_blank")return e;const r=wh(e,"rel"),l=new Set(String(r?e[r]:"").split(/\s+/).map(a=>a.trim()).filter(Boolean).filter(a=>a.toLowerCase()!=="opener"));return l.add("noopener"),l.add("noreferrer"),r&&r!=="rel"&&delete e[r],e.rel=Array.from(l).join(" "),e}function pN(e,t="safe",n){const i={};for(const[o,s]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!DW(r)||PW(l,s,t,n)||(i[r]=s)}return $W(i,t,n,!!wh(e,"href"))}function BW(e,t){const n=e.toLowerCase();return MH.has(n)?!1:fN(t,n)||fN(t,e)}function gx(e,t="safe",n){const i={};for(const[o,s]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!DW(r)||PW(l,s,t,n)||(i[r]=s)}return $W(i,t,n,!!wh(e,"href"))}function D0(e){const t={};if(!Array.isArray(e)||e.length===0)return t;for(const[n,i]of e)n&&(t[String(n)]=i==null?"":String(i));return t}function b9(e,t="safe",n){const i=gx(D0(e),t,n),o=Object.entries(i).map(([s,r])=>[s,r]);return o.length>0?o:void 0}function Y2e(e,t){const n=t.toLowerCase();if(["checked","disabled","readonly","required","autofocus","multiple","hidden"].includes(n))return e==="true"||e===""||e===t;if(["value","min","max","step","width","height","size","maxlength"].includes(n)){const i=Number(e);if(e!==""&&!Number.isNaN(i))return i}return e}function J2e(e){const t={};for(const[n,i]of Object.entries(e))t[n]=Y2e(i,n);return t}function Z8(e){return e.trim().length>0}function zW(e){const t=[];let n=0;for(;n",n);if(r!==-1){n=r+3;continue}break}const i=e.indexOf("<",n);if(i===-1){if(nn){const r=e.slice(n,i);Z8(r)&&t.push({type:"text",content:r})}if(e.startsWith("![CDATA[",i+1)){const r=e.indexOf("]]>",i);if(r!==-1){t.push({type:"text",content:e.slice(i,r+3)}),n=r+3;continue}break}if(e.startsWith("!",i+1)){const r=e.indexOf(">",i);if(r!==-1){n=r+1;continue}break}const o=e.indexOf(">",i);if(o===-1)break;const s=OW(e.slice(i+1,o));if(!s){const r=e.slice(i,o+1);Z8(r)&&t.push({type:"text",content:r}),n=o+1;continue}if(s.isClosing)t.push({type:"tag_close",tagName:s.tagName});else{const r={};if(s.attrsStr){const l=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let a;for(;(a=l.exec(s.attrsStr))!==null;){const u=a[1],c=a[2]??a[3]??a[4]??"";u&&!u.endsWith("/")&&(r[u]=c)}}t.push({type:s.isSelfClosing||mf.has(s.tagName.toLowerCase())?"self_closing":"tag_open",tagName:s.tagName,attrs:r})}n=o+1}return t}function X2e(e){const t=[];let n=0;for(;n",n);if(l!==-1){n=l+3;continue}break}const i=e.indexOf("<",n);if(i===-1){nn&&t.push({type:"text",content:e.slice(n,i)}),e.startsWith("![CDATA[",i+1)){const l=e.indexOf("]]>",i);if(l!==-1){t.push({type:"text",content:e.slice(i,l+3)}),n=l+3;continue}break}if(e.startsWith("!",i+1)){const l=e.indexOf(">",i);if(l!==-1){n=l+1;continue}break}const o=e.indexOf(">",i);if(o===-1)break;const s=OW(e.slice(i+1,o));if(!s){t.push({type:"text",content:e.slice(i,o+1)}),n=o+1;continue}if(s.isClosing){t.push({type:"tag_close",tagName:s.tagName}),n=o+1;continue}const r={};if(s.attrsStr){const l=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let a;for(;(a=l.exec(s.attrsStr))!==null;){const u=a[1],c=a[2]??a[3]??a[4]??"";u&&!u.endsWith("/")&&(r[u]=c)}}t.push({type:s.isSelfClosing||mf.has(s.tagName.toLowerCase())?"self_closing":"tag_open",tagName:s.tagName,attrs:r}),n=o+1}return t}function eye(e){const t=String(e.tagName??"").trim();if(!t)return"";if(e.type==="tag_close")return`</${jd(t)}>`;const n=Object.entries(e.attrs??{}).map(([i,o])=>o===""?` ${jd(i)}`:` ${jd(i)}="${FW(o)}"`).join("");return e.type==="self_closing"?`<${jd(t)}${n} />`:`<${jd(t)}${n}>`}function tye(e,t){if(!e||!e.includes("<")||!t||Object.keys(t).length===0)return!1;for(const n of zW(e))if((n.type==="tag_open"||n.type==="self_closing")&&BW(n.tagName??"",t))return!0;return!1}function K1(e,t="safe"){if(!e)return"";if(t==="escape")return jd(e);const n=X2e(e),i=[],o=[],s=[];for(const r of n){if(r.type==="text"){s.length===0&&o.push(jd(r.content??""));continue}const l=I4(r.tagName);if(!l)continue;if(RW(l,t)){r.type==="tag_open"?s.push(l):r.type==="tag_close"&&s[s.length-1]===l&&s.pop();continue}if(s.length>0)continue;if(t==="safe"&&mx(l,t)){o.push(eye(r));continue}if(r.type==="self_closing"){o.push(`<${l}${hN(pN(r.attrs??{},t,l))}>`);continue}if(r.type==="tag_open"){o.push(`<${l}${hN(pN(r.attrs??{},t,l))}>`),mf.has(l)||i.push(l);continue}const a=i.lastIndexOf(l);if(a===-1)continue;for(;i.length>a+1;){const c=i.pop();c&&o.push(``)}const u=i.pop();u&&o.push(``)}for(;i.length>0;){const r=i.pop();r&&o.push(``)}return o.join("")}const nye=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],mN="http://www.w3.org/2000/svg",iye=new Set(["script","style","iframe","object","embed","link","meta"]),oye=new Set(["svg","style","g","a","defs","marker","path","rect","circle","ellipse","line","polyline","polygon","text","tspan","title","desc","use","image","lineargradient","radialgradient","stop","clippath","mask","pattern"]),sye=new Set(["href","xlink:href","src","srcdoc","action","data","formaction","poster"]),rye=new Set(["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),lye=new Set(["circle","ellipse","image","line","path","polygon","polyline","rect","text","tspan","use"]);function aye(e){return(e.getAttribute("href")||e.getAttribute("xlink:href"))?.startsWith("#")===!0}function uye(e){return!!(e.getAttribute("href")||e.getAttribute("xlink:href")||e.getAttribute("src"))}function cye(e){const t=e.nodeName.toLowerCase();return t==="use"?aye(e):t==="image"?uye(e):t==="text"||t==="tspan"?!!e.textContent?.trim():lye.has(t)}function dye(e){return e.replace(/(["'])\s*javascript:/gi,"$1#").replace(/\bjavascript:/gi,"#").replace(/(["'])\s*vbscript:/gi,"$1#").replace(/\bvbscript:/gi,"#").replace(/\bdata:text\/html/gi,"#")}function fye(e,t,n){const i=e.toLowerCase(),o=t.toLowerCase(),s=String(n??"").trim();return s?(i==="use"||i==="marker"||i==="clippath"||i==="mask")&&(o==="href"||o==="xlink:href")?s.startsWith("#")?s:"":i==="a"&&(o==="href"||o==="xlink:href")?Wh(s,{tagName:"a",attrName:"href"})?"":s:i==="image"&&(o==="href"||o==="xlink:href"||o==="src")?Wh(s,{tagName:"img",attrName:"src"})?"":s:o==="href"||o==="xlink:href"?s.startsWith("#")?s:"":Wh(s,{tagName:i,attrName:o})?"":s:""}function hye(e,t){let n=t+4;for(;n{const i=n.trim();if(/^[0-9a-f]+$/i.test(i)){const o=Number.parseInt(i,16);try{return Number.isFinite(o)?String.fromCodePoint(o):""}catch{return""}}return String(n).trim()})}function HW(e){const t=jW(e),n=t.toLowerCase();let i=0;for(;in.test(t))||HW(t)}function pye(e){if(e.tagName.toLowerCase()!=="a"||e.getAttribute("target")?.trim().toLowerCase()!=="_blank")return;const t=new Set(String(e.getAttribute("rel")??"").split(/\s+/).map(n=>n.trim()).filter(Boolean).filter(n=>n.toLowerCase()!=="opener"));t.add("noopener"),t.add("noreferrer"),e.setAttribute("rel",Array.from(t).join(" "))}function yy(e){const t=Number.parseFloat(String(e??""));return Number.isFinite(t)?t:0}function WW(e,t){if(e.nodeType===Node.TEXT_NODE){const o=e.textContent??"";o&&t.push(o);return}if(e.nodeType!==Node.ELEMENT_NODE)return;const n=e,i=n.tagName.toLowerCase();if(!iye.has(i)){if(i==="br"){t.push(` -`);return}for(const o of Array.from(n.childNodes))WW(o,t)}}function mye(e){for(const t of Array.from(e.querySelectorAll("foreignObject"))){const n=[];WW(t,n);const i=n.join("").split(/\r?\n/).map(c=>c.trim()).filter(Boolean);if(!i.length){t.remove();continue}const o=yy(t.getAttribute("width")),s=yy(t.getAttribute("height")),r=yy(t.getAttribute("x")),l=yy(t.getAttribute("y")),a=e.ownerDocument.createElementNS(mN,"text");a.setAttribute("x",String(r+o/2)),a.setAttribute("y",String(l+s/2)),a.setAttribute("text-anchor","middle"),a.setAttribute("dominant-baseline","central");const u=t.querySelector(".nodeLabel");if(u?.getAttribute("class")&&a.setAttribute("class",u.getAttribute("class")),i.length===1)a.textContent=i[0];else{const c=-.6*(i.length-1);for(const[d,h]of i.entries()){const p=e.ownerDocument.createElementNS(mN,"tspan");p.setAttribute("x",String(r+o/2)),p.setAttribute("dy",d===0?`${c}em`:"1.2em"),p.textContent=h,a.appendChild(p)}}t.parentNode?.replaceChild(a,t)}}function gye(e){mye(e);const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){const i=n.tagName.toLowerCase();if(!oye.has(i)){n.remove();continue}if(i==="style"&&gN(n.textContent??"")){n.remove();continue}const o=Array.from(n.attributes);for(const s of o){const r=s.name.toLowerCase();if(/^on/i.test(r)){n.removeAttribute(s.name);continue}if(r==="style"&&s.value&&gN(s.value)){n.removeAttribute(s.name);continue}if(r==="srcdoc"){n.removeAttribute(s.name);continue}if(sye.has(r)&&s.value){const l=fye(i,r,s.value);if(!l){n.removeAttribute(s.name);continue}l!==s.value&&n.setAttribute(s.name,l);continue}if(rye.has(r)&&s.value&&HW(s.value)){n.removeAttribute(s.name);continue}if(s.value){const l=dye(s.value);l!==s.value&&n.setAttribute(s.name,l)}}pye(n)}}function s8t(e){if(typeof DOMParser>"u"||!e)return null;try{const t=new DOMParser().parseFromString(e,"image/svg+xml").documentElement;if(!t||t.nodeName.toLowerCase()!=="svg")return null;const n=t;return gye(n),vye(n)?null:n}catch{return null}}function vye(e){const t=e.getAttribute("viewBox");if(t){const o=t.trim().split(/[\s,]+/);if(o.length===4){const s=Number.parseFloat(o[2]||""),r=Number.parseFloat(o[3]||"");if(!Number.isFinite(s)||!Number.isFinite(r)||s<=0||r<=0)return!0}}const n=[e,...Array.from(e.querySelectorAll("*"))];let i=!1;for(const o of n){cye(o)&&(i=!0);for(const s of Array.from(o.attributes))if(/\bNaN\b/i.test(s.value)||s.name==="style"&&/max-width:\s*0(?:px)?/i.test(s.value))return!0}return!i}const ky=[];function G8(e){return String(e??"").replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function yye(e){return(String(e||"text").trim().split(/\s+/)[0]||"text").replace(/[^\w+.#:-]/g,"-").replace(/-+/g,"-")||"text"}function kye(e){return e.replace(/[^\w:.+-]/g,"-").replace(/-+/g,"-")}function vN(e=`editor-${Date.now()}`,t={}){const n=Yge(t),i=n;i.__markstreamRegisteredPluginCount=ky.length,i.__markstreamHasCustomParserExtensions=!!(t.plugin?.length||t.apply?.length||ky.length);const o={"common.copy":"Copy"};let s;if(typeof t.i18n=="function")s=t.i18n;else if(t.i18n&&typeof t.i18n=="object"){const p=t.i18n;s=m=>p[m]??o[m]??m}else s=p=>o[p]??p;if(Array.isArray(t.plugin))for(const p of t.plugin){const m=p;if(Array.isArray(m)){const[g,...y]=m;typeof g=="function"&&n.use(g,...y)}else typeof m=="function"&&n.use(m)}if(Array.isArray(t.apply))for(const p of t.apply)try{p(n)}catch(m){console.error("[getMarkdown] apply function threw an error",m)}if(ky.length)for(const p of ky)if(Array.isArray(p)){const[m,...g]=p;typeof m=="function"&&n.use(m,...g)}else typeof p=="function"&&n.use(p);n.use(U2e),n.use(vde),n.use(pde);const r=Ede,l=r.default??r;n.use(l),n.use(hde),n.use(fde),n.core.ruler.after("block","mark_fence_closed",p=>{const m=p,g=m.src,y=!!m.env?.__markstreamFinal,b=g.split(/\r?\n/);for(const v of m.tokens){if(v.type!=="fence"||!v.map||!v.markup)continue;const C=v.map[0],w=v.map[1],M=v.markup,N=M[0],T=M.length,S=b[Math.max(0,w-1)]??"";let x=0;for(;xC+1&&A>=T&&E===S.length,R=v;R.meta=R.meta??{},R.meta.unclosed=!I,R.meta.closed=!!I}}),n.renderer.rules.fence=(p,m)=>{const g=p[m],y=String(g.info??"").trim(),b=String(g.content??""),v=btoa(unescape(encodeURIComponent(b))),C=yye(y),w=G8(C),M=kye(`editor-${e}-${m}-${C}`),N=G8(s("common.copy"));return`
      -
      - ${G8(C.toUpperCase())} - -
      -
      -
      `};const a=/^\[(\d+)\]/,u=/^\[([^\]\n]+)\]/,c=p=>{if(!p.startsWith("["))return!1;const m=u.exec(p);if(!m)return p!=="["&&!/^\[\d+$/.test(p);const g=String(m[1]??"");return p.slice(m[0].length).startsWith("(")?!1:!/^\d+$/.test(g)},d=(p,m)=>{const g=p;if(g.src[g.pos]!=="[")return!1;const y=a.exec(g.src.slice(g.pos));if(!y)return!1;const b=g.src.slice(Math.max(0,g.pos-120),g.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(b))return!1;const v=g.src.slice(g.pos+y[0].length);if(v.startsWith("](")||v.startsWith("(")||c(v))return!1;if(!m){const C=y[1],w=g.push("reference","span",0);w.content=C,w.markup=y[0],w.raw=y[0]}return g.pos+=y[0].length,!0};n.inline.ruler.before("escape","reference",d),n.renderer.rules.reference=(p,m)=>{const y=String(p[m].content??"");return`${y}`};const h=n.use.bind(n);return n.use=((...p)=>(i.__markstreamHasCustomParserExtensions=!0,h(...p))),n}const bye="modulepreload",wye=function(e){return"/"+e},yN={},_s=function(t,n,i){let o=Promise.resolve();if(n&&n.length>0){let r=function(u){return Promise.all(u.map(c=>Promise.resolve(c).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(u=>{if(u=wye(u),u in yN)return;yN[u]=!0;const c=u.endsWith(".css"),d=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${d}`))return;const h=document.createElement("link");if(h.rel=c?"stylesheet":bye,c||(h.as="script"),h.crossOrigin="",h.href=u,a&&h.setAttribute("nonce",a),document.head.appendChild(h),c)return new Promise((p,m)=>{h.addEventListener("load",p),h.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(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"&&s(l.reason);return t().catch(s)})};function Cye({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 qW({nextContent:e,persistedContent:t,currentState:n,typewriterEnabled:i,streamRenderVersionChanged:o=!1}){const s=`${n.settledContent}${n.streamedDelta}`;return i?n.streamedDelta&&s===e?o?{settledContent:s,streamedDelta:"",appended:!1}:{settledContent:n.settledContent,streamedDelta:n.streamedDelta,appended:!1}:Cye({nextContent:e,previousContent:t??s,typewriterEnabled:i}):{settledContent:e,streamedDelta:"",appended:!1}}const Aye={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 xye(e){const t=String(e??"").trim();if(!t)return"";const[n=""]=t.split(/\s+/);return n.split(":")[0]?.trim().toLowerCase()??""}function UW(e){const t=xye(e);return Aye[t]??t}function Sye(e){if(!Array.isArray(e))return;const t=e.filter(i=>typeof i=="string").map(i=>UW(i)).filter(Boolean),n=Array.from(new Set(t)).sort();return n.length>0?n:void 0}function _ye(e){if(!Array.isArray(e))return;const t=[],n=new Set;for(const i of e){if(typeof i!="string")continue;const o=i.trim();!o||n.has(o)||(n.add(o),t.push(o))}return t.length>0?t:void 0}function Iye(e){return _ye(e)?.join("\0")??""}function Mye(e,t){return`${Iye(e)}\0\0${Sye(t)?.join("\0")??""}`}function Gp(e,t,n=1){const i=Number(e);return Number.isFinite(i)?Math.max(n,i):t}function kN(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var Tye=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 h=this.source.length>0,p=this.pendingChars<=0;if(this.source+=d,p){const m=bN();this.startedAt=h&&this.hasStarted?m-this.normalizedStartDelayMs:m,this.lastTick=m,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=bN();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.startedAtthis.normalizedCatchUpThreshold?this.normalizedCatchUpLatencyMs:this.normalizedTargetLatencyMs,y=Dye(m/Math.max(.001,g/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(y-this.currentCps)*.2,this.charBudget+=this.currentCps*(p/1e3),this.charBudget<1){this.ensureLoop();return}const b=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),v=Nye(this.source.slice(this.visible.length),b,this.segmenter);v.text&&(this.visible+=v.text,this.charBudget=Math.max(0,this.charBudget-v.graphemeCount),this.emit()),this.ensureLoop()};const{minCharsPerSecond:n=40,maxCharsPerSecond:i=1e3,targetLatencyMs:o=900,catchUpLatencyMs:s=350,catchUpThreshold:r=600,maxCommitFps:l=30,startDelayMs:a=80,maxCharsPerCommit:u=80,flushOnFinish:c=!1}=e;this.minCharsPerSecond=Gp(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,Gp(i,1e3,1)),this.normalizedTargetLatencyMs=Gp(o,900,1),this.normalizedCatchUpLatencyMs=Gp(s,350,1),this.normalizedCatchUpThreshold=kN(r,600),this.normalizedStartDelayMs=kN(a,80),this.maxCommitFps=Math.trunc(Gp(l,30,1)),this.maxCharsPerCommit=Math.trunc(Gp(u,80,1)),this.flushOnFinish=c,this.segmenter=Lye(),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 Eye(e={},t){const n=new Tye(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 Lye(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function Nye(e,t,n){if(!e||t<=0)return{text:"",graphemeCount:0};if(!n){const s=Array.from(e).slice(0,t);return{text:s.join(""),graphemeCount:s.length}}let i="",o=0;for(const s of n.segment(e)){if(o>=t)break;i+=s.segment,o++}return{text:i,graphemeCount:o}}function bN(){return typeof performance<"u"?performance.now():Date.now()}function Dye(e,t,n){return Math.min(n,Math.max(t,e))}var Fye=(e,t,n)=>new Promise((i,o)=>{var s=a=>{try{l(n.next(a))}catch(u){o(u)}},r=a=>{try{l(n.throw(a))}catch(u){o(u)}},l=a=>a.done?i(a.value):Promise.resolve(a.value).then(s,r);l((n=n.apply(e,t)).next())});const cA=Symbol.for("markstream-vue:node-lifecycle");function r8t(){}const vx=new Map;let VW="material";const C1=new Map,wN=new Map;let dA=null;function Rye(e){vx.set(e.id,e)}function Oye(e){const t=vx.get(VW);if(!t)return;const n=t.core[e];if(n)return n;const i=C1.get(t.id);if(i){const o=i[e];if(o)return o}t.loadExtended&&!C1.has(t.id)&&$ye(t)}function Pye(){var e,t;return(t=(e=vx.get(VW))==null?void 0:e.fallback)!=null?t:""}function $ye(e){return Fye(this,null,function*(){var t,n,i;if(C1.has(e.id))return(t=C1.get(e.id))!=null?t:null;let o=wN.get(e.id);return o||(o=((i=(n=e.loadExtended)==null?void 0:n.call(e))!=null?i:Promise.resolve(null)).then(s=>(C1.set(e.id,s),dA?.(),s)).catch(()=>(C1.set(e.id,null),null)),wN.set(e.id,o)),o})}const CN='',AN='',Bye={id:"material",core:{"":AN,plain:'',text:AN,javascript:'',typescript:'',jsx:'',tsx:'',html:'',css:'',scss:'',json:'',python:'',ruby:'',go:'',java:'',kotlin:'',c:'',cpp:'',cs:CN,csharp:CN,php:'',shell:'',powershell:'',sql:'',yaml:'',markdown:'',xml:'',rust:'',vue:'',mermaid:''},fallback:'',loadExtended:()=>_s(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},zye=_u(0);dA=()=>{zye.value++},Rye(Bye);const jye={"":"",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 M4(e){var t;const n=(function(i){if(!i)return"";const o=i.trim();if(!o)return"";const[s]=o.split(/\s+/),[r]=s.split(":");return r.toLowerCase()})(e);return(t=jye[n])!=null?t:n}function l8t(e){const t=M4(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";case"objectivec":return"objective-c";case"objectivecpp":return"objective-cpp";default:return t}}function a8t(e){return Oye(M4(e))||Pye()}const xN={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"};var T4=(e,t,n)=>new Promise((i,o)=>{var s=a=>{try{l(n.next(a))}catch(u){o(u)}},r=a=>{try{l(n.throw(a))}catch(u){o(u)}},l=a=>a.done?i(a.value):Promise.resolve(a.value).then(s,r);l((n=n.apply(e,t)).next())});let gl=null,Th=!1,Eh=null,E4=kx;function l2(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function yx(){try{const e=globalThis;return l2(e?.katex)}catch{return null}}function kx(){return T4(null,null,function*(){const e=yx();if(e)return e;const t=yield _s(()=>import("./katex-DnlPpQZa.js"),[]);try{yield _s(()=>import("./mhchem-DtR62fUK.js"),__vite__mapDeps([0,1]))}catch{}return l2(t)})}function KW(e){const t=Promise.resolve(e).then(n=>{var i;return Eh===t&&n?(gl=(i=l2(n))!=null?i:n,gl):null}).catch(()=>null).finally(()=>{Eh===t&&(Eh=null)});return Eh=t,Th=!0,t}function Hye(e){E4=e,gl=null,Th=!1,Eh=null}function Wye(e){Hye(kx)}function ZW(){return typeof E4=="function"}function u8t(){var e;const t=E4;if(!t||t===kx)return null;if(gl)return gl;const n=yx();if(n)return gl=n,gl;if(Th)return null;try{const i=t();return i?typeof i?.then=="function"?(KW(i),null):(gl=(e=l2(i))!=null?e:i,gl):null}catch{return null}}function GW(){return T4(this,null,function*(){var e;const t=yx();if(t)return gl=t,gl;if(gl)return gl;if(Eh)return Eh;if(Th)return null;const n=E4;if(!n)return Th=!0,null;try{const i=n();if(typeof i?.then=="function")return KW(i);if(i)return gl=(e=l2(i))!=null?e:i,Th=!0,gl}catch{}return Th=!0,null})}function QW(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let w9=null,dh=null;const pl=new Map,qc=new Map;let Iv=5;const Uh=new Set;function F0(){if(pl.size{const{id:n,html:i,error:o}=t.data,s=pl.get(n);if(s)if(pl.delete(n),clearTimeout(s.timeoutId),s.cleanup(),F0(),o)s.aborted||s.reject(new Error(o));else{const{content:r,displayMode:l}=t.data;if(r){const a=`${l?"d":"i"}:${r}`;if(qc.set(a,i),qc.size>200){const u=qc.keys().next().value;qc.delete(u)}}s.aborted||s.resolve(i)}},w9.onerror=t=>{console.error("[katexWorkerClient] Worker error:",t);for(const[n,i]of pl.entries())clearTimeout(i.timeoutId),i.cleanup(),i.aborted||i.reject(new Error(`Worker error: ${t.message}`));pl.clear(),qye()}}function Vye(e,t=!0,n=2e3,i){return T4(this,null,function*(){performance.now();const o=QW(e);if(!ZW()){const a=new Error("KaTeX rendering disabled");return a.name="KaTeXDisabled",a.code="KATEX_DISABLED",Promise.reject(a)}if(dh)return Promise.reject(dh);const s=`${t?"d":"i"}:${o}`,r=qc.get(s);if(r)return F0(),Promise.resolve(r);const l=w9||(dh=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),dh.name="WorkerInitError",dh.code="WORKER_INIT_ERROR",null);if(!l)return Promise.reject(dh);if(pl.size>=Iv){const a=new Error("Worker busy");return a.name="WorkerBusy",a.code="WORKER_BUSY",a.busy=!0,a.inFlight=pl.size,a.max=Iv,Promise.reject(a)}return new Promise((a,u)=>{if(i?.aborted){const g=new Error("Aborted");return g.name="AbortError",void u(g)}const c=Math.random().toString(36).slice(2);let d=null;const h=globalThis.setTimeout(()=>{const g=pl.get(c);if(!g)return;pl.delete(c),g.cleanup();const y=new Error("Worker render timed out");y.name="WorkerTimeout",y.code="WORKER_TIMEOUT",g.aborted||g.reject(y),F0()},n);d=()=>{const g=pl.get(c);if(!g||g.aborted)return;g.aborted=!0,g.cleanup();const y=new Error("Aborted");y.name="AbortError",u(y)},i&&i.addEventListener("abort",d,{once:!0});const p=a,m=u;pl.set(c,{resolve:g=>{p(g)},reject:g=>{m(g)},timeoutId:h,aborted:!1,cleanup:()=>{i&&d&&i.removeEventListener("abort",d),d=null}});try{l.postMessage({id:c,content:o,displayMode:t})}catch(g){const y=pl.get(c);pl.delete(c),clearTimeout(h),y?.cleanup(),y?.reject(g),F0()}})})}function c8t(e,t=!0,n){const i=`${t?"d":"i"}:${QW(e)}`;if(qc.set(i,n),qc.size>200){const o=qc.keys().next().value;qc.delete(o)}}const Kye="WORKER_BUSY";function Zye(e=2e3,t){return pl.size{let o,s=!1,r=null,l=()=>{};const a=()=>{o&&globalThis.clearTimeout(o),Uh.delete(l),t&&r&&t.removeEventListener("abort",r),r=null};l=()=>{s||(s=!0,a(),n())},Uh.add(l),o=globalThis.setTimeout(()=>{if(s)return;s=!0,a();const u=new Error("Wait for worker slot timed out");u.name="WorkerBusyTimeout",u.code="WORKER_BUSY_TIMEOUT",i(u)},e),queueMicrotask(()=>F0()),t&&(r=()=>{if(s)return;s=!0,a();const u=new Error("Aborted");u.name="AbortError",i(u)},t.aborted?r():t.addEventListener("abort",r,{once:!0}))})}const Ig={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function d8t(e){return T4(this,arguments,function*(t,n=!0,i={}){var o,s,r,l;if(!ZW()){const g=new Error("KaTeX rendering disabled");throw g.name="KaTeXDisabled",g.code="KATEX_DISABLED",g}const a=(o=i.timeout)!=null?o:Ig.timeout,u=(s=i.waitTimeout)!=null?s:Ig.waitTimeout,c=(r=i.backoffMs)!=null?r:Ig.backoffMs,d=(l=i.maxRetries)!=null?l:Ig.maxRetries,h=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):Ig.maxRetries,p=i.signal;let m=0;for(;;){if(p?.aborted){const g=new Error("Aborted");throw g.name="AbortError",g}try{return yield Vye(t,n,a,p)}catch(g){if(g?.code!==Kye||m>=h)throw g;if(m++,yield Zye(u,p).catch(()=>{}),p?.aborted){const y=new Error("Aborted");throw y.name="AbortError",y}c>0&&(yield new Promise(y=>globalThis.setTimeout(y,c*m)))}}})}function A1(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function Gye(e){var t;for(const n of e.split(/\r?\n/)){const i=n.trim();if(!i||i.startsWith("%%"))continue;const o=i.match(/^([A-Z][\w-]*)\b/i);return((t=o?.[1])==null?void 0:t.toLowerCase())||""}return""}function Vk(e){const t=e.split(/\r?\n/).map(o=>o.trim()).filter(o=>o&&!o.startsWith("%%")),n=Math.max(1,t.length),i=Gye(e);return i==="gantt"?220+28*n:i==="sequencediagram"?180+26*n:i==="classdiagram"||i==="statediagram"||i==="erdiagram"?180+24*n:i==="flowchart"||i==="graph"?170+28*n:200+22*n}function Kk(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 YW(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function Zk(e,t=360,n=500){return YW(e,t,n)}function Gk(e,t=360,n=500){return YW(e,t,n)}var Qye=Object.defineProperty,Yye=Object.defineProperties,Jye=Object.getOwnPropertyDescriptors,SN=Object.getOwnPropertySymbols,Xye=Object.prototype.hasOwnProperty,e9e=Object.prototype.propertyIsEnumerable,_N=(e,t,n)=>t in e?Qye(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,JW=(e,t)=>{for(var n in t||(t={}))Xye.call(t,n)&&_N(e,n,t[n]);if(SN)for(var n of SN(t))e9e.call(t,n)&&_N(e,n,t[n]);return e},IN=(e,t,n)=>new Promise((i,o)=>{var s=a=>{try{l(n.next(a))}catch(u){o(u)}},r=a=>{try{l(n.throw(a))}catch(u){o(u)}},l=a=>a.done?i(a.value):Promise.resolve(a.value).then(s,r);l((n=n.apply(e,t)).next())});const Qk=()=>_s(()=>import("./mermaid.core-CqiFQExc.js").then(e=>e.bp),__vite__mapDeps([2,3]));let Ec=null,x1=Qk,e0=null,fA=!1,hA=!1,t0=0;function t9e(e){x1=e,t0++,Ec=null,e0=null,fA=!1,hA=!1}function n9e(e){t9e(Qk)}function MN(){return typeof x1=="function"}function TN(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=JW({},t),i={render:o.render.bind(o),parse:o.parse?o.parse.bind(o):void 0,initialize:s=>typeof t.initialize=="function"?t.initialize(s):o.initialize?o.initialize(s):void 0},Yye(n,Jye(i))}var n,i;return e.mermaid&&typeof e.mermaid.render=="function"?e.mermaid:t}function EN(e){if(e)try{const t=e?.initialize;e.initialize=n=>{const i=JW({suppressErrorRendering:!0},n||{});return typeof t=="function"?t.call(e,i):e?.mermaidAPI&&typeof e.mermaidAPI.initialize=="function"?e.mermaidAPI.initialize(i):void 0}}catch{}}function f8t(){return IN(this,null,function*(){if(Ec)return Ec;const e=(function(){try{const i=globalThis;return TN(i?.mermaid)}catch{return null}})();if(e)return Ec=e,EN(Ec),Ec;const t=x1,n=t0;return t?t===Qk&&fA?null:e0||(e0=IN(null,null,function*(){let i;try{i=yield t()}catch(o){if(t===Qk)return n===t0&&t===x1&&(fA=!0,(function(s){hA||(hA=!0,console.warn('[markstream-vue] Optional dependency "mermaid" is not installed. Mermaid blocks will render as source.',s))})(o)),null;throw o}finally{n===t0&&t===x1&&(e0=null)}return n!==t0||t!==x1?null:i?(Ec=TN(i),EN(Ec),Ec):null}),e0):null})}let Bu=null,fh=null;const cu=new Map,hh=new Map;function Q8(e){for(const t of cu.values())t.reject(e);cu.clear(),hh.clear()}let LN=5,NN=!1;const i9e="WORKER_BUSY",DN="MERMAID_DISABLED";function o9e(e){if(Bu&&Bu!==e){const n=new Error("Worker replaced");n.code="WORKER_REPLACED",Q8(n)}Bu=e,fh=null;const t=e;Bu.onmessage=n=>{if(Bu!==t)return;const{id:i,ok:o,result:s,error:r}=n.data,l=cu.get(i);l&&(o===!1||r?l.reject(new Error(r||"Unknown error")):l.resolve(s))},Bu.onerror=n=>{var i,o;if(Bu===t)if(cu.size!==0){try{NN?console.error("[mermaidWorkerClient] Worker error:",n?.message||n):(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker error:",n?.message||n)}catch{}Q8(new Error(`Worker error: ${n.message}`))}else(i=console.debug)==null||i.call(console,"[mermaidWorkerClient] Worker error (no pending):",n?.message||n)},Bu.onmessageerror=n=>{var i,o;if(Bu===t)if(cu.size!==0){try{NN?console.error("[mermaidWorkerClient] Worker messageerror:",n):(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker messageerror:",n)}catch{}Q8(new Error("Worker messageerror"))}else(i=console.debug)==null||i.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",n)}}function XW(e,t,n,i){if(!MN()){const r=new Error("Mermaid rendering disabled");return r.name="MermaidDisabled",r.code=DN,Promise.reject(r)}const o=`${e}\0${t.theme}\0${n}\0${t.code}`;let s=hh.get(o);return s||(s=(function(r,l,a=1400){if(!MN()){const c=new Error("Mermaid rendering disabled");return c.name="MermaidDisabled",c.code=DN,Promise.reject(c)}if(fh)return Promise.reject(fh);const u=Bu||(fh=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),fh.name="WorkerInitError",fh.code="WORKER_INIT_ERROR",null);if(!u)return Promise.reject(fh);if(cu.size>=LN){const c=new Error("Worker busy");return c.name="WorkerBusy",c.code=i9e,c.inFlight=cu.size,c.max=LN,Promise.reject(c)}return new Promise((c,d)=>{const h=Math.random().toString(36).slice(2);let p,m=!1;const g=()=>{m||(m=!0,p!=null&&globalThis.clearTimeout(p),cu.delete(h))},y={resolve:b=>{g(),c(b)},reject:b=>{g(),d(b)}};cu.set(h,y);try{u.postMessage({id:h,action:r,payload:l})}catch(b){return cu.delete(h),void d(b)}p=globalThis.setTimeout(()=>{const b=new Error("Worker call timed out");b.name="WorkerTimeout",b.code="WORKER_TIMEOUT";const v=cu.get(h);v&&v.reject(b)},a)})})(e,t,n),hh.set(o,s),s.then(()=>{hh.get(o)===s&&hh.delete(o)},()=>{hh.get(o)===s&&hh.delete(o)})),(function(r,l){if(!l)return r;if(l.aborted){const a=new Error("Aborted");return a.name="AbortError",Promise.reject(a)}return new Promise((a,u)=>{let c=()=>{};const d=()=>l.removeEventListener("abort",c);c=()=>{d();const h=new Error("Aborted");h.name="AbortError",u(h)},l.addEventListener("abort",c,{once:!0}),r.then(h=>{d(),a(h)},h=>{d(),u(h)})})})(s,i)}function h8t(e,t,n=1400,i){return XW("canParse",{code:e,theme:t},n,i)}function p8t(e,t,n=1400,i){return XW("findPrefix",{code:e,theme:t},n,i)}var s9e=Object.defineProperty,r9e=Object.defineProperties,l9e=Object.getOwnPropertyDescriptors,FN=Object.getOwnPropertySymbols,a9e=Object.prototype.hasOwnProperty,u9e=Object.prototype.propertyIsEnumerable,RN=(e,t,n)=>t in e?s9e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ht=(e,t)=>{for(var n in t||(t={}))a9e.call(t,n)&&RN(e,n,t[n]);if(FN)for(var n of FN(t))u9e.call(t,n)&&RN(e,n,t[n]);return e},Hn=(e,t)=>r9e(e,l9e(t)),xo=(e,t,n)=>new Promise((i,o)=>{var s=a=>{try{l(n.next(a))}catch(u){o(u)}},r=a=>{try{l(n.throw(a))}catch(u){o(u)}},l=a=>a.done?i(a.value):Promise.resolve(a.value).then(s,r);l((n=n.apply(e,t)).next())});const c9e="__global__",Y8="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",pA=(()=>{const e=globalThis;if(e[Y8])return e[Y8];const t={scopedCustomComponents:{},revision:_u(0)};return e[Y8]=t,t})(),ON=pA.revision,d9e=Symbol("markstreamCustomComponents"),f9e=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 a2(e){return f9e.has(String(e).trim().toLowerCase())}function h9e(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function J8(e={}){const t={};for(const[n,i]of Object.entries(e))if(i!=null){t[n]=i;for(const o of new Set([Ga(n),Ga(h9e(n))]))!o||a2(o)||Object.prototype.hasOwnProperty.call(t,o)||(t[o]=i)}return t}function Ks(e){const t=rn(d9e,null);return D(()=>{var n;return ON.value,(function(i,o={}){return ON.value,Ht(Ht(Ht({},J8(pA.scopedCustomComponents[c9e]||{})),J8(o)),J8((function(s){return s&&pA.scopedCustomComponents[s]||{}})(i)))})(e?.(),(n=t?.value)!=null?n:{})})}const p9e=["aria-label"],m9e={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"},g9e={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"},Hi=(e,t)=>{const n=e.__vccOpts||e;for(const[i,o]of t)n[i]=o;return n},ha=Hi(dt({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(k(),L("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(k(),L("svg",g9e,[...n[1]||(n[1]=[_("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",fill:"currentColor"},null,-1),_("path",{d:"M9 12l2 2 4-4",stroke:"hsl(var(--ms-background))","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(k(),L("svg",m9e,[...n[0]||(n[0]=[_("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,p9e))}),[["__scopeId","data-v-be21ab83"]]);ha.install=e=>{e.component(ha.__name,ha)};const v9e={class:"emoji-node"},ql=Hi(dt({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(k(),L("span",v9e,P(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);ql.install=e=>{e.component(ql.__name,ql)};const y9e=["id"],k9e=["title"],pa=Hi(dt({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const t=`#fnref--${e.node.id}`;function n(){if(typeof document>"u")return;const i=document.querySelector(t);i?i.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${t} not found`)}return(i,o)=>(k(),L("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[_("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+P(e.node.id)+"]",9,k9e)],8,y9e))}}),[["__scopeId","data-v-c1463a29"]]);pa.install=e=>{e.component(pa.__name,pa)};const eq=(()=>{try{return!1}catch{}return!1})();function X8(e){eq&&console.warn(e)}function PN(e,t="safe",n){return gx(e,t,n)}function tq(e){return J2e(e)}function ew(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function bx(e,t="safe"){const n=String(e.tag||e.type||"").trim(),i=b9((o=e.attrs)?Array.isArray(o)?o.every(Array.isArray)?o.map(([r,l])=>[String(r),ew(l)]):o.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),ew(r.value)]):Object.entries(o).map(([r,l])=>[r,ew(l)]):null,t,n);var o;if(!i)return;const s=tq(D0(i));return Object.keys(s).length>0?s:void 0}function $N(e,t,n=!1){const i=Object.entries(t??{}),o=i.length>0?i.map(([s,r])=>r===""?` ${s}`:` ${s}="${r}"`).join(""):"";return n?`<${e}${o} />`:`<${e}${o}>`}function Mg(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function tw(e,t,n,i,o,s,r=!1){const l=(function(d,h){return BW(d,h)})(e,i);if(i2.has(e.toLowerCase())||!l&&RW(e,s))return null;if(!l&&mx(e,s))return r?[$N(e,t,!0)]:[$N(e,t),...n,``];const a=gx(t,s,e),u=a.key,c=u!=null&&u!==""?u:o;if(l){const d=i[e]||i[e.toLowerCase()],h=tq(a);return jn(d,Hn(Ht({},h),{key:c}),n.length>0?n:void 0)}return jn(e,Hn(Ht({},a),{innerHTML:void 0,key:c}),n.length>0?n:void 0)}function nq(e,t){return tye(e,t)}function Yk(e,t,n="safe"){if(!e)return[];try{return(function(s,r,l="safe"){let a=0;const u=[],c=[];for(const d of s)if(d.type==="text")(u.length>0?u[u.length-1].children:c).push(d.content);else if(d.type==="self_closing"){const h=tw(d.tagName,d.attrs||{},[],r,"ms-html-"+a++,l,!0);Mg(u.length>0?u[u.length-1].children:c,h)}else if(d.type==="tag_open")u.push({tagName:d.tagName,children:[],attrs:d.attrs,autoKey:"ms-html-"+a++});else if(d.type==="tag_close"){const h=d.tagName.toLowerCase();let p=-1;for(let m=u.length-1;m>=0;m--)if(u[m].tagName.toLowerCase()===h){p=m;break}if(p!==-1)for(;u.length>p;){const m=u.pop(),g=tw(m.tagName,m.attrs||{},m.children,r,m.autoKey,l);u.length>0?Mg(u[u.length-1].children,g):Mg(c,g),m.tagName.toLowerCase()!==h&&u.length>p&&X8(`Auto-closing unclosed tag: <${m.tagName}>`)}else X8(`Ignoring closing tag with no matching opening tag: `)}for(;u.length>0;){const d=u.pop(),h=tw(d.tagName,d.attrs||{},d.children,r,d.autoKey,l);u.length>0?Mg(u[u.length-1].children,h):Mg(c,h),X8(`Auto-closing unclosed tag: <${d.tagName}>`)}return c})(zW(e),t,n)}catch(o){return i=o,eq&&console.error("Failed to parse HTML to VNodes:",i),null}var i}const b9e=["innerHTML"],ma=Hi(dt({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=rn("markstreamHtmlPolicy",void 0),i=D(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),o=Ks(()=>t.customId),s=dt({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=D(()=>{const l=t.node.content;if(!l)return{mode:"html",content:""};if(i.value==="escape")return{mode:"html",content:K1(l,i.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const u=Yk(l,o.value,i.value);if(u!==null)return{mode:"dynamic",nodes:u}}if(!nq(l,o.value))return{mode:"html",content:K1(l,i.value)};const a=Yk(l,o.value,i.value);return a===null?{mode:"html",content:K1(l,i.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>r.value.mode==="dynamic"?(k(),L("span",{key:0,class:Pe(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[U(f(s),{nodes:r.value.nodes},null,8,["nodes"])],2)):r.value.mode==="text"?(k(),L("span",{key:1,class:Pe(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},P(r.value.content),3)):(k(),L("span",{key:2,class:Pe(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,b9e))}}),[["__scopeId","data-v-d17f12b0"]]);ma.install=e=>{e.component(ma.__name,ma)};const w9e={class:"inline-code"},C9e={key:0},il=Hi(dt({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=Nm(),i=rn("markstreamFade",void 0),o=rn("markstreamTextStreamState",void 0),s=rn("markstreamStreamVersion",void 0),r=D(()=>{const v=n.fade;return v===""||v===!0||v==="true"||v!==!1&&v!=="false"&&void 0}),l=D(()=>typeof r.value=="boolean"?r.value:typeof i?.value!="boolean"||i.value),a=D(()=>{var v;return String((v=t.node.code)!=null?v:"")}),u=D(()=>!l.value),c=D(()=>{var v;const C=(v=n["index-key"])!=null?v:n.indexKey;return C==null||C===""?"":String(C)}),d=q(t.node.code),h=q(""),p=q(0);let m;function g(){m?.(),m=void 0}function y(){g(),h.value&&(d.value=d.value+h.value,h.value="")}qe([()=>t.node.code,c,l],([v])=>{const C=String(v??""),w=c.value,M=qW({nextContent:C,persistedContent:w?o?.get(w):void 0,currentState:{settledContent:d.value,streamedDelta:h.value},typewriterEnabled:l.value});d.value=M.settledContent,h.value=M.streamedDelta,M.appended?(p.value+=1,(function(){if(!h.value||m||!s)return;const N=s.value;m=qe(()=>s.value,T=>{T!==N&&y()},{flush:"sync"})})()):h.value||g(),w&&o?.set(w,C)},{immediate:!0}),ad(g);const b=D(()=>p.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(v,C)=>(k(),L("code",w9e,[u.value?(k(),L(Fe,{key:0},[He(P(a.value),1)],64)):(k(),L(Fe,{key:1},[d.value?(k(),L("span",C9e,P(d.value),1)):J("",!0),h.value?(k(),L("span",{key:1,class:Pe(["inline-code-stream-delta",[b.value]]),onAnimationend:y},P(h.value),35)):J("",!0)],64))]))}}),[["__scopeId","data-v-4e331c97"]]);il.install=e=>{e.component(il.__name,il)};const mA=q(!1),BN=q(""),zN=q("top"),R0=q(null),O0=q(null),gA=q(null),vA=q(null),jN=q(null);let C9=null,A9=null,yA=0;function iq(){C9&&(clearTimeout(C9),C9=null),A9&&(clearTimeout(A9),A9=null)}let by=!1,wy=null,HN=!1;function A9e(e,t,n="top",i=!1,o,s){if(!e)return;const r=++yA;iq();const l=()=>xo(null,null,function*(){var a,u;if(yield(function(){return xo(this,null,function*(){if(!by&&!HN&&typeof document<"u"){wy!=null||(wy=xo(null,null,function*(){const[{createApp:c,h:d},{default:h}]=yield Promise.all([_s(()=>import("./vue.runtime.esm-bundler-D7X8t2I9.js"),[]),_s(()=>import("./Tooltip-DebxPz-0.js"),[])]),p=document.createElement("div");p.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(p),c({setup:()=>()=>{var m;return d(h,{visible:mA.value,"anchor-el":R0.value,content:BN.value,placement:zN.value,id:O0.value,originX:gA.value,originY:vA.value,isDark:(m=jN.value)!=null?m:void 0})}}).mount(p),by=!0}));try{yield wy}catch(c){by=!1,wy=null,HN=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",c)}}})})(),by&&r===yA){O0.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,R0.value=e,BN.value=t,zN.value=n,gA.value=(a=o?.x)!=null?a:null,vA.value=(u=o?.y)!=null?u:null,jN.value=typeof s=="boolean"?s:null,mA.value=!0;try{e.setAttribute("aria-describedby",O0.value)}catch{}}});i?l():C9=setTimeout(l,80)}function x9e(e=!1){yA+=1,iq();const t=()=>{if(R0.value&&O0.value)try{R0.value.removeAttribute("aria-describedby")}catch{}mA.value=!1,R0.value=null,O0.value=null,gA.value=null,vA.value=null};e?t():A9=setTimeout(t,120)}const S9e={"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..."},_9e=Symbol("markstreamI18nFallback");function oq(e,t){var n;return(n=t?.[e])!=null?n:S9e[e]}const kA=(e,t)=>{var n;return(n=oq(e,t))!=null?n:(function(i){return(i.split(".").pop()||i).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,o=>o.toUpperCase()).trim()})(e)};function WN(e,t){return{t(n){const i=oq(n,t);if(e.te&&i!=null&&!e.te(n))return kA(n,t);const o=e.t(n);return o===n&&i!=null?kA(n,t):o}}}function I9e(){const e=(function(){var n,i,o;try{const s=Vs(),r=_9e,l=s?.provides,a=(n=s?.appContext)==null?void 0:n.provides;return(o=(i=l?.[r])!=null?i:a?.[r])!=null?o:null}catch{}return null})(),t=(function(){var n,i;try{const o=Vs(),s=o?.proxy,r=s?.$t;if(typeof r=="function"){const u=s?.$te;return{t:r.bind(s),te:typeof u=="function"?u.bind(s):void 0}}const l=(i=(n=o?.appContext)==null?void 0:n.config)==null?void 0:i.globalProperties,a=l?.$t;if(typeof a=="function"){const u=l?.$te;return{t:a.bind(l),te:typeof u=="function"?u.bind(l):void 0}}}catch{}return null})();if(t)return WN(t,e);try{const n=globalThis.$vueI18nUse||null;if(n&&typeof n=="function")try{const i=n();if(i&&typeof i.t=="function")return WN({t:i.t.bind(i),te:typeof i.te=="function"?i.te.bind(i):void 0},e)}catch{}}catch{}return{t:n=>kA(n,e)}}const sq=Symbol("ViewportPriority"),rq=Symbol("ViewportPriorityOptions"),lq=Symbol("OffscreenHeavyNodeDeferral"),M9e=D(()=>!1),op="400px";function wx(){return rn(rq,void 0)}function Cx(){return rn(lq,M9e)}function T9e(e,t){var n,i;const o=typeof window<"u"&&typeof document<"u",s=typeof t=="boolean"?q(t):t,r=o?(n=window.requestIdleCallback)!=null?n:T=>window.setTimeout(()=>T({didTimeout:!0,timeRemaining:()=>0}),16):null,l=o?(i=window.cancelIdleCallback)!=null?i:T=>window.clearTimeout(T):null,a=new WeakMap;let u=1;const c=new Map,d=new Map,h=new Set;let p=null,m=null;function g(T){if(!T)return"viewport";let S=a.get(T);return S||(S=u++,a.set(T,S)),String(S)}function y(){if(p!=null){try{l?.(p)}catch{}p=null}}function b(T){if(T){const S=c.get(T);if(S&&!S.targets.size){try{S.io.disconnect()}catch{}c.delete(T)}}d.size||h.size||y()}function v(T){const S=d.get(T);if(!S)return;const x=c.get(S.bucketKey);if(!S.visible.value){S.visible.value=!0;try{S.resolve()}catch{}}try{x?.io.unobserve(T)}catch{}x?.targets.delete(T),d.delete(T),h.delete(T),b(S.bucketKey)}function C(){window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&r&&p==null&&h.size&&(p=r(()=>{p=null;const T=h.values().next().value;T&&(h.delete(T),v(T),h.size&&C())},{timeout:1200}))}function w(T,S){if(!o||typeof IntersectionObserver>"u")return null;const x=(function(z,F){var O,B,j;return{root:(O=e?.(z??null))!=null?O:null,rootMargin:(B=F?.rootMargin)!=null?B:op,threshold:(j=F?.threshold)!=null?j:0}})(T,S),A=[g((E=x).root),E.rootMargin,E.threshold].join("\0");var E;const I=c.get(A);if(I)return{key:A,bucket:I};let R;try{R=new IntersectionObserver(z=>{for(const F of z)(F.isIntersecting||F.intersectionRatio>0)&&v(F.target)},{root:x.root,rootMargin:x.rootMargin,threshold:x.threshold})}catch{return null}const W={io:R,targets:new Map};return c.set(A,W),{key:A,bucket:W}}function M(){if(o&&s.value)for(const[T,S]of Array.from(d.entries())){const x=w(T,S.opts);if(!x){v(T);continue}if(x.key===S.bucketKey)continue;const A=S.bucketKey,E=c.get(A);try{E?.io.unobserve(T)}catch{}E?.targets.delete(T),S.bucketKey=x.key,x.bucket.targets.set(T,S),x.bucket.io.observe(T),b(A)}}qe(s,T=>{if(!T){for(const S of Array.from(d.keys()))v(S);y()}},{flush:"sync"});const N=(T,S)=>{const x=q(!1);let A,E=!1;const I=new Promise(F=>{A=()=>{E||(E=!0,F())}}),R=()=>{const F=d.get(T);if(!F)return h.delete(T),void b();const O=c.get(F.bucketKey);try{O?.io.unobserve(T)}catch{}O?.targets.delete(T),d.delete(T),h.delete(T),b(F.bucketKey)};if(!o||!s.value)return x.value=!0,A(),{isVisible:x,whenVisible:I,destroy:R};const W=w(T,S);if(!W)return x.value=!0,A(),{isVisible:x,whenVisible:I,destroy:R};const z={resolve:A,visible:x,bucketKey:W.key,opts:S};return d.set(T,z),W.bucket.targets.set(T,z),W.bucket.io.observe(T),o&&m==null&&(m=window.requestAnimationFrame(()=>{m=null,M()})),S?.allowIdle!==!1&&(h.add(T),C()),{isVisible:x,whenVisible:I,destroy:R}};return N.refresh=M,ui(sq,N),N}function Ax(){var e,t;const n=rn(sq,void 0);if(n)return n;const i=new WeakMap,o=new Map,s=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,u=()=>{if(r!=null){try{a?.(r)}catch{}r=null}},c=p=>{if(!p)return;const m=o.get(p);if(m&&!m.targets.size){try{m.io.disconnect()}catch{}o.delete(p)}},d=p=>{const m=i.get(p);if(!m)return;const g=o.get(m.bucketKey);if(!m.visible.value){m.visible.value=!0;try{m.resolve()}catch{}}try{g?.io.unobserve(p)}catch{}i.delete(p),g?.targets.delete(p),s.delete(p),c(m.bucketKey),s.size||u()},h=()=>{window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&l&&r==null&&s.size&&(r=l(()=>{r=null;const p=s.values().next().value;p&&(s.delete(p),d(p),s.size&&h())},{timeout:1200}))};return(p,m)=>{const g=q(!1);let y,b=!1;const v=new Promise(M=>{y=()=>{b||(b=!0,M())}}),C=()=>{const M=i.get(p);if(!M)return s.delete(p),void(s.size||u());const N=o.get(M.bucketKey);try{N?.io.unobserve(p)}catch{}i.delete(p),N?.targets.delete(p),s.delete(p),c(M.bucketKey),s.size||u()},w=(M=>{var N,T;if(typeof window>"u"||typeof IntersectionObserver>"u")return null;const S=(R=>{var W,z;return[(W=R?.rootMargin)!=null?W:op,(z=R?.threshold)!=null?z:0].join("\0")})(M),x=o.get(S);if(x)return{key:S,bucket:x};const A=(N=M?.rootMargin)!=null?N:op;let E;try{E=new IntersectionObserver(R=>{for(const W of R)(W.isIntersecting||W.intersectionRatio>0)&&d(W.target)},{root:null,rootMargin:A,threshold:(T=M?.threshold)!=null?T:0})}catch{return null}const I={io:E,targets:new Set};return o.set(S,I),{key:S,bucket:I}})(m);return w?(i.set(p,{resolve:y,visible:g,bucketKey:w.key}),w.bucket.targets.add(p),w.bucket.io.observe(p),m?.allowIdle!==!1&&(s.add(p),h()),{isVisible:g,whenVisible:v,destroy:C}):(g.value=!0,y(),{isVisible:g,whenVisible:v,destroy:C})}}function E9e(e,t){var n,i;const o=(i=(n=e.indexKey)!=null?n:t["index-key"])!=null?i:t.indexKey;return o==null||o===""?"":String(o)}const L9e=["data-markstream-viewport-pending"],N9e=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],D9e={key:1,class:"image-placeholder"},F9e={key:1,class:"image-node__raw-text"},R9e={key:2,class:"image-shimmer-overlay"},O9e={key:1,class:"image-node__raw-text"},P9e={key:3,class:"image-error"},ef=Hi(dt({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},lazy:{type:Boolean,default:!1},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:t}){var n,i,o;const s=e,r=t,l=q(!1),a=q(!1),u=q(""),c=q("primary"),d=q(null),h=Nm(),p=rn(cA,null),m=Ax(),g=wx(),y=Cx(),b=D(()=>dL(s.node.src)),v=D(()=>dL(s.fallbackSrc)),C=(o=(i=(n=Vs())==null?void 0:n.vnode.el)==null?void 0:i.querySelector)==null?void 0:o.call(i,"img"),w=typeof window<"u"&&C?.getAttribute("src")===(b.value||v.value),M=q(typeof window>"u"||w||!y.value),N=_u(null);let T="",S=null;const x=D(()=>u.value),A=D(()=>!s.lazy),E=D(()=>typeof window<"u"&&y.value&&!w),I=D(()=>!E.value||M.value),R=D(()=>I.value?x.value:""),W=D(()=>{var Te,Ee;return(Ee=(Te=g?.value.heavyBlockMargin)!=null?Te:g?.value.rootMargin)!=null?Ee:op}),z=D(()=>!s.node.loading&&c.value!=="failed"&&u.value.length>0),F=D(()=>c.value==="failed"),O=D(()=>(!A.value||E.value&&!M.value)&&!l.value&&!a.value&&c.value!=="failed"&&u.value.length>0),B=D(()=>E9e(s,h));function j(Te=B.value){Te&&d.value&&p?.reportHeight(Te,d.value.offsetHeight)}function $(Te=B.value){Te&&mt(()=>{j(Te)})}function V(){S&&(clearTimeout(S),S=null)}function ne(){const Te=B.value;Te&&T!==Te&&(T&&p?.markSettled(T),V(),T=Te,p?.markPending(Te),typeof window<"u"&&(S=window.setTimeout(()=>{T===Te&&($(Te),K())},8e3)))}function K(){return xo(this,null,function*(){const Te=T;Te&&(V(),T="",yield mt(),j(Te),p?.markSettled(Te))})}function ee(){if(c.value==="primary"&&v.value&&v.value!==u.value)return c.value="fallback",u.value=v.value,l.value=!1,a.value=!1,void $();c.value="failed",a.value=!0,r("error",u.value),$()}function ue(){l.value=!0,a.value=!1,r("load",x.value),$()}function ie(Te){Te.preventDefault(),l.value&&!a.value&&r("click",[Te,x.value])}const{t:ye}=I9e();return qe([b,v,()=>s.node.loading],()=>(l.value=!1,a.value=!1,s.node.loading||b.value?(u.value=b.value,void(c.value="primary")):v.value?(u.value=v.value,void(c.value="fallback")):(u.value="",c.value="failed",void(a.value=!0))),{immediate:!0}),typeof window<"u"&&qe([d,E],([Te,Ee],Me,G)=>{var oe;if((oe=N.value)==null||oe.destroy(),N.value=null,!Ee||M.value)return void(M.value=!0);if(!Te)return void(M.value=!1);let Z=!0;const Q=m(Te,{rootMargin:W.value,allowIdle:!1});N.value=Q,M.value=Q.isVisible.value,Q.whenVisible.then(()=>{Z&&N.value===Q&&(M.value=!0)}),G(()=>{Z=!1,Q.destroy(),N.value===Q&&(N.value=null)})},{immediate:!0}),qe([z,l,a,x,()=>s.lazy,I],([Te,Ee,Me,G,oe,Z])=>Te&&G&&!Me&&Z?Ee?(K(),void $()):oe?(ne(),void $()):void(Ee||Me||ne()):(K(),void $()),{flush:"post",immediate:!0}),si(()=>{var Te;(Te=N.value)==null||Te.destroy(),N.value=null,(function(){const Ee=T;Ee&&(V(),T="",p?.markSettled(Ee))})()}),(Te,Ee)=>{var Me,G,oe,Z,Q;return k(),L("span",{ref_key:"rootRef",ref:d,class:"image-node-container","data-markstream-viewport-pending":E.value&&!M.value?"true":void 0},[z.value?(k(),L("img",{key:0,src:R.value||void 0,alt:String((G=(Me=s.node.alt)!=null?Me:s.node.title)!=null?G:""),title:String((Z=(oe=s.node.title)!=null?oe:s.node.alt)!=null?Z:""),class:Pe(["image-node__img",{"is-loading":!A.value&&!l.value,"is-loaded":A.value||l.value,"has-natural-size":l.value,"cursor-pointer":l.value}]),loading:s.lazy?"lazy":void 0,fetchpriority:A.value?"high":void 0,decoding:A.value?"sync":"async",tabindex:l.value?0:-1,"aria-label":(Q=s.node.alt)!=null?Q:f(ye)("image.preview"),onError:ee,onLoad:ue,onClick:ie},null,42,N9e)):J("",!0),e.node.loading&&!a.value?(k(),L("span",D9e,[s.usePlaceholder?Gn(Te.$slots,"placeholder",{key:0,node:s.node,displaySrc:x.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:s.fallbackSrc,lazy:s.lazy},()=>[Ee[0]||(Ee[0]=_("span",{class:"image-shimmer"},null,-1))],!0):(k(),L("span",F9e,P(e.node.raw),1))])):J("",!0),O.value&&!e.node.loading?(k(),L("span",R9e,[s.usePlaceholder?Gn(Te.$slots,"placeholder",{key:0,node:s.node,displaySrc:x.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:s.fallbackSrc,lazy:s.lazy},()=>[Ee[1]||(Ee[1]=_("span",{class:"image-shimmer"},null,-1))],!0):(k(),L("span",O9e,P(e.node.raw),1))])):J("",!0),F.value?(k(),L("span",P9e,[Gn(Te.$slots,"error",{node:s.node,displaySrc:x.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:s.fallbackSrc,lazy:s.lazy},()=>[Ee[2]||(Ee[2]=_("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[_("path",{fill:"currentColor",d:"M2 2h20v10h-2V4H4v9.586l5-5L14.414 14L13 15.414l-4-4l-5 5V20h8v2H2zm13.547 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-3 1a3 3 0 1 1 6 0a3 3 0 0 1-6 0m3.625 6.757L19 17.586l2.828-2.829l1.415 1.415L20.414 19l2.829 2.828l-1.415 1.415L19 20.414l-2.828 2.829l-1.415-1.415L17.586 19l-2.829-2.828z"})],-1)),_("span",null,P(f(ye)("image.loadError")),1)],!0)])):J("",!0)],8,L9e)}}}),[["__scopeId","data-v-046e82ac"]]);ef.install=e=>{e.component(ef.__name,ef)};const $9e={key:2},mc=dt({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=Ks(()=>t.customId),i=rn("markstreamHtmlPolicy",void 0),o=rn("markstreamNestedRendererProps",void 0),s=D(()=>{var m;return(m=i?.value)!=null?m:"safe"}),r=D(()=>{var m,g;const y=(m=o?.value)!=null?m:{};return Hn(Ht({},y),{customId:(g=t.customId)!=null?g:y.customId,htmlPolicy:s.value})}),l=Yu({loader:()=>Promise.resolve().then(()=>Fx),suspensible:!1}),a=D(()=>t.components[String(t.node.type)]),u=D(()=>!!(a.value&&n.value[t.node.type]&&!a2(String(t.node.type)))),c=D(()=>u.value?bx(t.node,s.value):void 0),d=D(()=>Array.isArray(t.node.children)&&t.node.children.length>0),h=D(()=>{var m;return String((m=t.node.content)!=null?m:"")}),p=D(()=>{var m,g;return String((g=(m=t.node.content)!=null?m:t.node.raw)!=null?g:"")});return(m,g)=>a.value&&u.value?(k(),ce(fs(a.value),yi({key:0},c.value,{node:e.node,loading:e.node.loading,"index-key":e.indexKey,"custom-id":e.customId,"is-dark":r.value.isDark}),{default:ae(()=>[d.value?(k(),ce(f(l),yi({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"])):h.value?(k(),ce(f(l),yi({key:1},r.value,{content:h.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"])):J("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):a.value?(k(),ce(fs(a.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey},null,8,["node","custom-id","index-key"])):e.fallbackToText?(k(),L("span",$9e,P(p.value),1)):J("",!0)}}),qN=Object.freeze({enabled:!0,contextLineCount:2,minimumLineCount:4,revealLineCount:5});function B9e(e){var t;if(typeof e=="boolean")return e;if(e&&typeof e=="object"){const n=e;return Hn(Ht(Ht({},qN),n),{enabled:(t=n.enabled)==null||t})}return Ht({},qN)}function xx(e,t){if(e.renderSideBySide===!1)return!0;if(e.useInlineViewWhenSpaceIsLimited!==!0)return!1;const n=e.renderSideBySideInlineBreakpoint,i=typeof n=="number"&&Number.isFinite(n)?n:900;return t>0&&t<=i}function aq(e){var t,n;const i=(n=(t=String(e??"").split(/\r?\n/,1)[0])==null?void 0:t.trim())!=null?n:"";if(i.length<3)return"";const o=i[0];if(o!=="`"&&o!=="~"||i[1]!==o||i[2]!==o)return"";let s=3;for(;i[s]===o;)s+=1;return i.slice(s).trim()}function UN(e){var t;return((t=String(e??"").trim().split(/\s+/,1)[0])!=null?t:"")==="diff"}function z9e(e){var t;return e.diff===!0||UN(e.language)||UN(aq(String((t=e.raw)!=null?t:"")))}function j9e(e,t,n){const i=(function(o){const s=aq(o);if(!s)return"";const r=s.split(/\s+/).filter(Boolean);if(!r.length)return"";const l=r[0]==="diff"?r.slice(1):r;for(const a of l){const u=a.includes(":")?a.slice(a.indexOf(":")+1):a;if(u&&/[./\\-]/.test(u))return u}return""})(e);return{title:i||t,caption:i?n?`Diff / ${t}`:t:""}}const H9e=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],W9e={key:0,translate:"no",class:"markstream-pre__diff-code"},q9e={class:"markstream-pre__diff-pane-content"},U9e={class:"markstream-pre__diff-number","aria-hidden":"true"},V9e={class:"markstream-pre__diff-content"},K9e={class:"markstream-pre__diff-content-inner"},Z9e={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},G9e=["textContent"],Q9e=["textContent"],Ol=dt({__name:"PreCodeNode",props:{node:{},loading:{type:Boolean},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},diffHideUnchangedRegions:{type:[Boolean,Object]},reservedHeightPx:{}},setup(e){const t=e;function n(ie,ye){const Te=String(ie??"");return ye?Te:Te.replace(/\r\n$|\n$|\r$/,"")}const i=D(()=>{var ie,ye,Te;const Ee=String((ye=(ie=t.node)==null?void 0:ie.language)!=null?ye:"");return String((Te=String(Ee).split(/\s+/g)[0])!=null?Te:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),o=D(()=>`language-${i.value}`),s=D(()=>{var ie;return t.loading===!0||((ie=t.node)==null?void 0:ie.loading)===!0}),r=D(()=>{var ie;return n((ie=t.node)==null?void 0:ie.code,s.value)});let l="",a=1;const u=D(()=>(function(ie){let ye=0,Te=1;ie.startsWith(l)&&(ye=l.length,Te=a,ye>0&&ie[ye-1]==="\r"&&ie[ye]===` -`&&ye++);for(let Ee=ye;Eer.value.split(/\r\n|\n|\r/));let d=0,h="";const p=D(()=>{const ie=u.value;ie{var ie;return t.showLineNumbers===!0&&((ie=t.node)==null?void 0:ie.diff)===!0}),g=D(()=>m.value&&t.diffInline===!0),y=D(()=>{const ie=Number(t.reservedHeightPx);if(!Number.isFinite(ie)||ie<=0)return;const ye=`${Math.ceil(ie)}px`;return s.value?{maxHeight:ye,overflow:"auto"}:{height:ye,minHeight:ye,maxHeight:ye,overflow:"auto"}}),b=["diff ","index ","--- ","+++ ","@@ "];function v(ie){return String(ie??"").trim().length===0}function C(ie,ye="context",Te={}){const Ee=v(ie);return{code:ie,kind:Ee&&ye!=="hunk"&&ye!=="spacer"&&!Te.preserveBlankKind?"context":ye,empty:Ee}}function w(ie){const ye=n(ie,s.value);return ye?ye.split(/\r\n|\n|\r/):[]}function M(ie,ye){return!v(ie[ye])||yeb.some(Te=>ye.startsWith(Te)))}function x(ie,ye){return ye||!ie.startsWith(" ")||ie.startsWith(" ")?ie:` ${ie}`}function A(ie,ye){const Te=ie.length,Ee=ye.length,Me=[];let G=0;for(;G=G&&Q>=G&&ie[Z]===ye[Q];)oe.unshift({originalIndex:Z,modifiedIndex:Q}),Z--,Q--;const fe=Z-G+1,de=Q-G+1;if(fe<=0||de<=0||s.value||(fe+1)*(de+1)>15e5)return Me.concat(oe);const pe=de+1,X=new Uint32Array((fe+1)*(de+1));for(let se=fe-1;se>=0;se--)for(let _e=de-1;_e>=0;_e--){const ge=se*pe+_e;if(ie[G+se]===ye[G+_e])X[ge]=X[(se+1)*pe+_e+1]+1;else{const Le=X[(se+1)*pe+_e],be=X[se*pe+_e+1];X[ge]=Le>=be?Le:be}}const re=[];let ke=0,le=0;for(;ke=X[ke*pe+le+1]?ke++:le++;return Me.concat(re,oe)}function E(ie){var ye;const Te=(function(){var Q,fe;const de=t.diffHideUnchangedRegions;if(de==null||de===!1)return null;const pe=de===!0?{}:de;return pe.enabled===!1?null:{contextLineCount:Math.max(0,Math.floor((Q=pe.contextLineCount)!=null?Q:2)),minimumLineCount:Math.max(1,Math.floor((fe=pe.minimumLineCount)!=null?fe:4))}})();if(!Te||ie.length<1||ie.length>2||ie.length===2&&ie[0].lines.length!==ie[1].lines.length)return ie;const Ee=ie[0].lines,Me=(ye=ie[1])==null?void 0:ye.lines,G=Q=>Ee[Q].kind==="context"&&(Me===void 0||Me[Q].kind==="context"&&Ee[Q].code===Me[Q].code),oe=[];let Z=0;for(;Z=Te.minimumLineCount){const de=Q+(Q===0?0:Te.contextLineCount),pe=fe-(fe===Ee.length?0:Te.contextLineCount);pe-de>=Te.minimumLineCount&&oe.push({start:de,end:pe})}Z===Q&&Z++}return oe.length?ie.map((Q,fe)=>{const de=[];let pe=0;for(const X of oe)de.push(...Q.lines.slice(pe,X.start)),de.push({code:fe===0?"Unmodified lines":"",kind:"collapsed",empty:!1,key:`${Q.key}-collapsed-${X.start}-${X.end}`,number:""}),pe=X.end;return de.push(...Q.lines.slice(pe)),Hn(Ht({},Q),{lines:de})}):ie}const I=D(()=>{var ie,ye,Te,Ee;if(!m.value)return[];const Me=(function(fe){const de=fe.some(X=>N(X)),pe=fe.some(X=>T(X));return de&&pe||(function(){var X,re,ke,le;if(i.value==="diff")return!0;const se=(le=(ke=String((re=(X=t.node)==null?void 0:X.raw)!=null?re:"").split(/\r?\n/,1)[0])==null?void 0:ke.trim())!=null?le:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(se)})()&&(de||pe)})(c.value),G=(function(){var fe,de;return((fe=t.node)==null?void 0:fe.originalCode)!=null||((de=t.node)==null?void 0:de.updatedCode)!=null})();if(g.value){const fe=G?(function(de,pe){const X=w(de),re=w(pe),ke=A(X,re);if(ke.length>0){const be=[];let xe=0,Oe=0;for(const Ze of ke){for(;xe=se&&ge>=se&&X[_e]===re[ge];)Le.unshift(Hn(Ht({},C(re[ge])),{key:`inline-suffix-${ge}`,number:ge+1})),_e--,ge--;for(let be=se;be<=_e;be++)le.push(Hn(Ht({},C(X[be],"removed",{preserveBlankKind:M(X,be)})),{key:`inline-removed-source-${be}`,number:be+1}));for(let be=se;be<=ge;be++)le.push(Hn(Ht({},C(re[be],"added",{preserveBlankKind:M(re,be)})),{key:`inline-added-source-${be}`,number:be+1}));return le.concat(Le)})((ie=t.node)==null?void 0:ie.originalCode,(ye=t.node)==null?void 0:ye.updatedCode):(function(de){const pe=[];let X=1,re=1;const ke=S(de);for(const[le,se]of de.entries())if(se.startsWith("@@")){const _e=se.match(/^@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/);_e&&(X=Number(_e[1]),re=Number(_e[2])),pe.push(Hn(Ht({},C(se,"hunk")),{key:`inline-hunk-${le}`,number:""}))}else if(N(se))pe.push(Hn(Ht({},C(x(se.slice(1),ke),"removed",{preserveBlankKind:!0})),{key:`inline-removed-${le}`,number:X++}));else if(T(se))pe.push(Hn(Ht({},C(x(se.slice(1),ke),"added",{preserveBlankKind:!0})),{key:`inline-added-${le}`,number:re++}));else{const _e=ke&&se.startsWith(" ")?se.slice(1):se;pe.push(Hn(Ht({},C(_e)),{key:`inline-context-${le}`,number:re})),X++,re++}return pe})(c.value);return E([{key:"inline",className:"markstream-pre__diff-pane--inline",lines:fe}])}if(!Me&&G)return(function(fe,de){const pe=w(fe),X=w(de),re=A(pe,X),ke=[],le=[];let se=0,_e=0,ge=0;const Le=(be,xe)=>{const Oe=Math.max(be-se,xe-_e);for(let Ze=0;ZeHn(Ht({},fe),{key:`original-${de}`,number:de+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:Z.map((fe,de)=>Hn(Ht({},fe),{key:`modified-${de}`,number:de+1}))}])}),R=D(()=>{var ie,ye;if(t.showLineNumbers!==!0)return;let Te=m.value?1:u.value;if(m.value){Te=Math.max(Te,w((ie=t.node)==null?void 0:ie.originalCode).length,w((ye=t.node)==null?void 0:ye.updatedCode).length);for(const Me of I.value)for(const G of Me.lines)typeof G.number=="number"&&(Te=Math.max(Te,G.number))}const Ee=`${Math.max(2,String(Te).length)}ch`;return{"--markstream-pre-line-number-width":Ee,"--markstream-pre-diff-line-number-width":Ee,"--markstream-code-padding-left":"calc(var(--markstream-pre-line-number-padding-left, 2ch) + var(--markstream-pre-line-number-width, 2ch) + var(--markstream-pre-line-number-padding-right, 1ch) + var(--markstream-pre-line-number-separator-width, 2px) + var(--markstream-pre-line-number-gap-to-code, 1ch))"}}),W=D(()=>I.value.some(ie=>ie.lines.some(ye=>ye.kind==="collapsed"))),z=D(()=>{const ie=i.value;return ie?`Code block: ${ie}`:"Code block"}),F=q(null),O=q([]);let B=null,j=!1,$=null;function V(ie){const ye=Number.parseFloat(String(ie??""));return Number.isFinite(ye)&&ye>0?ye:0}function ne(ie,ye){var Te;if(!ie)return ye;if(ie.classList.contains("markstream-pre__diff-line--collapsed"))return 32;const Ee=ie.querySelector(".markstream-pre__diff-content"),Me=Ee?.getBoundingClientRect(),G=(Te=Me?.height)!=null?Te:0;return Math.max(ye,Math.ceil(G))}function K(){j||typeof window>"u"||(B!=null&&window.cancelAnimationFrame(B),B=window.requestAnimationFrame(()=>{B=null,j||(function(){var ie,ye;B=null;const Te=F.value;if(!Te||!m.value||g.value||!Te.classList.contains("is-wrap"))return void(O.value.length&&(O.value=[]));const Ee=(function(de){const pe=window.getComputedStyle(de),X=V(pe.getPropertyValue("--markstream-pre-diff-line-height"));if(X>0)return X;const re=V(pe.lineHeight);return re>0?re:18})(Te),Me=Array.from(Te.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),G=Array.from(Te.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),oe=Math.max(Me.length,G.length),Z=[];for(let de=0;de{const X=fe[pe];return X&&Math.abs(de.rowHeight-X.rowHeight)<=.5&&Math.abs(de.originalHeight-X.originalHeight)<=.5&&Math.abs(de.modifiedHeight-X.modifiedHeight)<=.5})||(O.value=Z)})()}))}function ee(ie){$?.disconnect(),$=null,ie&&m.value&&!g.value&&typeof ResizeObserver<"u"&&($=new ResizeObserver(()=>{K()}),$.observe(ie))}function ue(ie,ye){const Te=O.value[ie];if(!Te)return;const Ee=ye==="original"?Te.originalHeight:Te.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(Te.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(Ee)}px`}}return qe(F,ie=>{ee(ie),mt(()=>K())},{flush:"post"}),qe([m,g,I],()=>{ee(F.value),mt(()=>K())},{flush:"post",immediate:!0}),si(()=>{j=!0,B!=null&&(window.cancelAnimationFrame(B),B=null),$?.disconnect(),$=null}),(ie,ye)=>(k(),L("pre",{ref_key:"preRef",ref:F,style:an([y.value,R.value]),class:Pe([o.value,{"markstream-pre--line-numbers":t.showLineNumbers,"markstream-pre--diff-preview":m.value,"markstream-pre--diff-inline":g.value,"markstream-pre--diff-collapsed":W.value}]),"aria-busy":s.value,"aria-label":z.value,"data-language":i.value,"data-markstream-line-numbers":t.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"},[m.value?(k(),L("code",W9e,[(k(!0),L(Fe,null,xt(I.value,Te=>(k(),L("span",{key:Te.key,class:Pe(["markstream-pre__diff-pane",Te.className])},[_("span",q9e,[(k(!0),L(Fe,null,xt(Te.lines,(Ee,Me)=>(k(),L("span",{key:Ee.key,class:Pe(["markstream-pre__diff-line",[`markstream-pre__diff-line--${Ee.kind}`,{"markstream-pre__diff-line--empty":Ee.empty}]]),style:an(ue(Me,Te.key))},[ye[0]||(ye[0]=_("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),_("span",U9e,P(Ee.number),1),_("span",V9e,[_("span",K9e,P(Ee.code),1)])],6))),128))])],2))),128))])):(k(),L(Fe,{key:1},[t.showLineNumbers?(k(),L("span",Z9e,[_("span",{class:"markstream-pre__line-numbers-text",textContent:P(p.value)},null,8,G9e)])):J("",!0),_("code",{translate:"no",class:"markstream-pre__code",textContent:P(r.value)},null,8,Q9e)],64))],14,H9e))}});Ol.install=e=>{e.component(Ol.__name,Ol)};const vs=Hi(dt({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=Nm(),i=rn("markstreamFade",void 0),o=rn("markstreamTextStreamState",void 0),s=rn("markstreamStreamVersion",void 0),r=D(()=>{const M=n.fade;return M===""||M===!0||M==="true"||M!==!1&&M!=="false"&&void 0}),l=D(()=>typeof r.value=="boolean"?r.value:typeof i?.value!="boolean"||i.value),a=D(()=>{var M;const N=(M=n["index-key"])!=null?M:n.indexKey;return N==null||N===""?"":String(N)}),u=q(t.node.content),c=q(""),d=q(0),h=q(t.node.content);let p;const m=q(null),g=q(null);let y="",b=null;function v(){p?.(),p=void 0}function C(){v(),c.value&&(u.value=u.value+c.value,c.value="")}qe([u,m,g],function(){var M,N;const T=m.value;if(!T)return;const S=String((M=u.value)!=null?M:""),x=g.value;return b||(b=T.firstChild,y=(N=b?.data)!=null?N:""),S.startsWith(y)?!b&&S?(T.textContent=S,b=T.firstChild,void(y=S)):void(S.length>y.length&&x&&(x.appendChild(document.createTextNode(S.slice(y.length))),y=S)):(T.textContent=S,b=T.firstChild,x&&(x.textContent=""),void(y=S))},{immediate:!0}),qe([()=>t.node.content,a,l],([M])=>{const N=String(M??""),T=a.value,S=qW({nextContent:N,persistedContent:T?o?.get(T):void 0,currentState:{settledContent:u.value,streamedDelta:c.value},typewriterEnabled:l.value});u.value=S.settledContent,c.value=S.streamedDelta,S.appended?(d.value+=1,(function(){if(!c.value||p||!s)return;const x=s.value;p=qe(()=>s.value,A=>{A!==x&&C()},{flush:"sync"})})()):c.value||v(),T&&o?.set(T,N)},{immediate:!0}),ad(v);const w=D(()=>d.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(M,N)=>(k(),L("span",{class:Pe([[e.node.center?"text-node-center":""],"text-node"])},[mi(_("span",{ref_key:"settledTextEl",ref:m},P(h.value),513),[[hs,u.value!==""]]),mi(_("span",{ref_key:"settledAppendsEl",ref:g},null,512),[[hs,u.value!==""]]),c.value?(k(),L("span",{key:0,class:Pe(["text-node-stream-delta",[w.value]]),onAnimationend:C},P(c.value),35)):J("",!0)],2))}}),[["__scopeId","data-v-fd79037c"]]);function n0(e,t,n){return dt({name:e,inheritAttrs:!1,setup(i,{attrs:o,slots:s}){var r,l;const a=Ax(),u=wx(),c=Cx(),d=typeof window<"u"&&((l=(r=Vs())==null?void 0:r.vnode.el)==null?void 0:l.nodeType)===1,h=q(typeof window>"u"||d||!c.value),p=_u(null);let m=null;function g(y){const b=y&&"$el"in y?y.$el:y;p.value=b instanceof HTMLElement?b:null}return typeof window<"u"&&qe([p,c],([y,b],v,C)=>{if(m?.destroy(),m=null,!b||h.value)return void(h.value=!0);if(!y)return;let w=!0;const M=a(y,{rootMargin:u?.value.heavyBlockMargin,allowIdle:!1});m=M,h.value=M.isVisible.value,M.whenVisible.then(()=>{w&&m===M&&(h.value=!0)}),C(()=>{w=!1,M.destroy(),m===M&&(m=null)})},{immediate:!0}),si(()=>{m?.destroy(),m=null}),()=>jn(h.value?t:n,Hn(Ht({},o),{ref:g}),s)}})}vs.install=e=>{e.component(vs.__name,vs)};const Jk=dt({name:"CodeBlockNodeLoading",inheritAttrs:!1,props:["node","isDark","loading","stream","theme","darkTheme","lightTheme","isShowPreview","monacoOptions","enableFontSizeControl","minWidth","maxWidth","themes","showHeader","showCopyButton","showExpandButton","showPreviewButton","showCollapseButton","showFontSizeButtons","showTooltips","htmlPreviewAllowScripts","htmlPreviewSandbox","customId","estimatedHeightPx","estimatedContentHeightPx","estimatedDiffInline"],emits:["previewCode","copy"],setup(e,{attrs:t}){const n=e;return()=>{var i,o,s,r,l,a,u;const c=M4(String((o=(i=n.node)==null?void 0:i.language)!=null?o:"")),d=xN[c]||(c?c.charAt(0).toUpperCase()+c.slice(1):xN[""]),h=z9e(n.node),p=j9e(String((r=(s=n.node)==null?void 0:s.raw)!=null?r:""),d,h),m=n.monacoOptions,g=h&&((l=n.estimatedDiffInline)!=null?l:xx(m??{},typeof window>"u"?0:window.innerWidth)),y=m?.diffAppearance,b=y==="dark"||y!=="light"&&n.isDark===!0,v=typeof m?.fontSize=="number"&&Number.isFinite(m.fontSize)&&m.fontSize>0?m.fontSize:12,C=typeof m?.lineHeight=="number"&&Number.isFinite(m.lineHeight)&&m.lineHeight>0?m.lineHeight:v===12?18:Math.max(12,Math.round(1.5*v)),w=typeof m?.tabSize=="number"&&Number.isFinite(m.tabSize)&&m.tabSize>0?m.tabSize:4,M=h?0:8,N=typeof((a=m?.padding)==null?void 0:a.top)=="number"&&Number.isFinite(m.padding.top)&&m.padding.top>=0?m.padding.top:M,T=typeof((u=m?.padding)==null?void 0:u.bottom)=="number"&&Number.isFinite(m.padding.bottom)&&m.padding.bottom>=0?m.padding.bottom:M,S=typeof m?.fontFamily=="string"?m.fontFamily.trim():"",x=Ht(Ht({fontSize:`${v}px`,lineHeight:`${C}px`,tabSize:w,paddingTop:`${N}px`,paddingBottom:`${T}px`,"--markstream-pre-line-number-top":`${N}px`},h?{"--markstream-pre-diff-line-height":`${C}px`}:{}),S?{"--markstream-code-font-family":S}:{}),A=()=>jn("button",{class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0","aria-hidden":"true",disabled:!0,tabindex:-1,type:"button"},[jn("svg",{class:"action-icon",width:"14",height:"14"})]),E=n.isShowPreview!==!1&&(c==="html"||c==="svg"),I=n.showFontSizeButtons!==!1&&n.enableFontSizeControl!==!1||n.showExpandButton!==!1||E&&n.showPreviewButton!==!1,R=z=>{if(z!=null)return typeof z=="number"?`${z}px`:String(z)},W=Ht(Ht(Ht({"--markstream-code-layout-character-width":"1ch"},R(n.minWidth)?{minWidth:R(n.minWidth)}:{}),R(n.maxWidth)?{maxWidth:R(n.maxWidth)}:{}),h?{}:{color:"var(--vscode-editor-foreground, var(--markstream-code-fallback-fg, var(--code-fg)))",backgroundColor:"var(--markstream-code-fallback-bg, var(--code-bg, #fff))",borderColor:"var(--markstream-code-border-color, var(--code-border))"});return jn("div",Hn(Ht({},t),{class:["code-block-container","rounded-lg","border",{dark:n.isDark===!0,"is-rendering":n.loading!==!1,"is-dark":b,"is-diff":h,"is-plain-text":c===""||c==="plaintext"||c==="text"},t.class],style:[W,t.style],"data-markstream-code-block":"1","data-markstream-enhanced":"false","data-markstream-code-block-state":n.loading?"streaming":"settled","data-markstream-code-loading":"1"}),[n.showHeader===!1?null:jn("div",{class:"code-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)] border-[var(--code-border)] bg-[var(--code-header-bg)] text-[var(--code-fg)]"},[jn("div",{class:"code-header-main",style:{minWidth:0,flex:"1 1 auto",display:"flex",alignItems:"center",gap:"var(--ms-gap-header-main, 0.625rem)",overflow:"hidden"}},[jn("span",{class:"icon-slot h-4 w-4 flex-shrink-0","aria-hidden":"true",style:{display:"inline-flex",width:"1rem",height:"1rem",flex:"0 0 auto"}}),jn("div",{class:"code-header-copy",style:{minWidth:0,display:"grid",gap:"2px"}},[jn("div",{class:"code-header-title",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"var(--ms-text-label, 0.75rem)",fontWeight:"500",color:"var(--code-action-fg)"}},p.title),p.caption?jn("div",{class:"code-header-caption",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"0.75rem",color:"var(--code-line-number)"}},p.caption):null])]),jn("div",{class:"flex items-center gap-0.5",style:{visibility:"hidden"}},[h?jn("div",{class:"code-diff-stats","aria-hidden":"true"},[jn("span",{class:"code-diff-stat removed"},"-0"),jn("span",{class:"code-diff-stat added"},"+0")]):null,n.showCopyButton===!1?null:A(),n.showCollapseButton===!1?null:A(),I?jn("div",{class:"relative"},[A()]):null])]),jn("div",{class:"code-block-shell-content",style:n.stream!==!1||n.loading===!1?void 0:{display:"none"}},[jn(Ol,{node:n.node,loading:n.loading,showLineNumbers:!0,reservedHeightPx:h?void 0:n.estimatedContentHeightPx,diffInline:g,diffHideUnchangedRegions:h?B9e(m?.diffHideUnchangedRegions):void 0,class:"code-pre-fallback",style:x,"data-markstream-code-loading":"1"})]),jn("div",{class:"code-loading-placeholder",style:n.stream===!1&&n.loading!==!1?void 0:{display:"none"}},[jn("div",{class:"loading-skeleton"},[jn("div",{class:"skeleton-line"}),jn("div",{class:"skeleton-line"}),jn("div",{class:"skeleton-line short"})])]),jn("span",{class:"sr-only","aria-live":"polite",role:"status"})])}}}),nw=n0("ViewportDeferredCodeBlockNode",Yu({loader:()=>xo(null,null,function*(){try{return(yield _s(()=>import("./CodeBlockNode-BNOCy4ai.js"),__vite__mapDeps([4,5]))).default}catch(e){return console.warn('[markstream-vue] Failed to load the enhanced CodeBlockNode chunk; falling back to preformatted code rendering. Enhanced code blocks require the optional "stream-diffs" peer (or "stream-monaco" as a fallback).',e),Ol}}),loadingComponent:Jk,delay:0,suspensible:!1}),Jk),Iu=Yu(()=>xo(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,i,o,s;return jn(vs,Hn(Ht({},t),{node:{type:"text",content:(i=t.node.raw)!=null?i:`$${(n=t.node.content)!=null?n:""}$`,raw:(s=t.node.raw)!=null?s:`$${(o=t.node.content)!=null?o:""}$`}}))};try{return yield GW(),(yield _s(()=>import("./index7-N0eJaunx.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,i,o,s;return jn(vs,Hn(Ht({},t),{node:{type:"text",content:(i=t.node.raw)!=null?i:`$${(n=t.node.content)!=null?n:""}$`,raw:(s=t.node.raw)!=null?s:`$${(o=t.node.content)!=null?o:""}$`}}))}})),uq=Yu(()=>xo(null,null,function*(){try{return yield GW(),(yield _s(()=>import("./index6-BW9QZVgb.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,i,o;return jn(vs,Hn(Ht({},e),{node:{type:"text",content:(n=e.node.raw)!=null?n:`$$${(t=e.node.content)!=null?t:""}$$`,raw:(o=e.node.raw)!=null?o:`$$${(i=e.node.content)!=null?i:""}$$`}}))}})),yl=Hi(dt({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(k(),L("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]=i=>t.$emit("click",i,e.node.id,e.messageId,e.threadId)),onMouseenter:n[1]||(n[1]=i=>t.$emit("mouseEnter",i,e.node.id,e.messageId,e.threadId)),onMouseleave:n[2]||(n[2]=i=>t.$emit("mouseLeave",i,e.node.id,e.messageId,e.threadId))},P(e.node.id),33))}),[["__scopeId","data-v-775c65e4"]]);yl.install=e=>{e.component(yl.__name,yl)};const Y9e={class:"superscript-node"},Ul=Hi(dt({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Ks(()=>t.customId),i=D(()=>Ht({text:vs,inline_code:il,link:wl,html_inline:ma,strong:kl,emphasis:Cl,footnote_reference:pa,strikethrough:bl,highlight:ga,insert:Kl,subscript:Vl,emoji:ql,math_inline:Iu,reference:yl},n.value));return(o,s)=>(k(),L("sup",Y9e,[(k(!0),L(Fe,null,xt(e.node.children,(r,l)=>(k(),ce(f(mc),{key:`${e.indexKey||"superscript"}-${l}`,components:i.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"]]);Ul.install=e=>{e.component(Ul.__name,Ul)};const J9e={class:"subscript-node"},Vl=Hi(dt({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Ks(()=>t.customId),i=D(()=>Ht({text:vs,inline_code:il,link:wl,html_inline:ma,strong:kl,emphasis:Cl,footnote_reference:pa,strikethrough:bl,highlight:ga,insert:Kl,superscript:Ul,emoji:ql,math_inline:Iu,reference:yl},n.value));return(o,s)=>(k(),L("sub",J9e,[(k(!0),L(Fe,null,xt(e.node.children,(r,l)=>(k(),ce(f(mc),{key:`${e.indexKey||"subscript"}-${l}`,components:i.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"]]);Vl.install=e=>{e.component(Vl.__name,Vl)};const X9e={class:"strong-node"},kl=Hi(dt({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Ks(()=>t.customId),i=D(()=>Ht({text:vs,inline_code:il,link:wl,html_inline:ma,emphasis:Cl,strikethrough:bl,highlight:ga,insert:Kl,subscript:Vl,superscript:Ul,emoji:ql,footnote_reference:pa,math_inline:Iu,reference:yl},n.value));return(o,s)=>(k(),L("strong",X9e,[(k(!0),L(Fe,null,xt(e.node.children,(r,l)=>(k(),ce(f(mc),{key:`${e.indexKey||"strong"}-${l}`,components:i.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"]]);kl.install=e=>{e.component(kl.__name,kl)};const eke={class:"strikethrough-node"},bl=Hi(dt({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Ks(()=>t.customId),i=D(()=>Ht({text:vs,inline_code:il,link:wl,html_inline:ma,strong:kl,emphasis:Cl,highlight:ga,insert:Kl,subscript:Vl,superscript:Ul,emoji:ql,footnote_reference:pa,math_inline:Iu,reference:yl},n.value));return(o,s)=>(k(),L("del",eke,[(k(!0),L(Fe,null,xt(e.node.children,(r,l)=>(k(),ce(f(mc),{key:`${e.indexKey||"strikethrough"}-${l}`,components:i.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"]]);bl.install=e=>{e.component(bl.__name,bl)};const tke=["href","title","aria-label","aria-hidden","target","rel"],nke=["aria-hidden"],ike={class:"link-text-wrapper relative inline-flex"},oke={class:"leading-[normal] link-text"},wl=Hi(dt({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=rn("markstreamShowTooltips",void 0),i=D(()=>{const b=n?.value;return typeof b=="boolean"?b:t.showTooltip}),o=D(()=>{var b,v,C,w,M;const N=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",T=(b=t.animationOpacity)!=null?b:.35,S=Math.max(.12,Math.min(.5*T,T)),x={"--underline-height":`${(v=t.underlineHeight)!=null?v:2}px`,"--underline-bottom":N,"--underline-opacity":String(T),"--underline-rest-opacity":String(S),"--underline-duration":`${(C=t.animationDuration)!=null?C:1.6}s`,"--underline-timing":(w=t.animationTiming)!=null?w:"ease-in-out","--underline-iteration":typeof t.animationIteration=="number"?String(t.animationIteration):(M=t.animationIteration)!=null?M:"infinite"};return t.color&&(x["--link-color"]=t.color),x}),s=Ks(()=>t.customId),r=D(()=>Ht({text:vs,strong:kl,strikethrough:bl,emphasis:Cl,image:ef,html_inline:ma,inline_code:il},s.value)),l=Nm(),a=D(()=>{var b,v;const C=(b=t.node)==null?void 0:b.attrs;if(!C||typeof C!="object")return{};const w={};if(Array.isArray(C))for(const M of C)Array.isArray(M)&&M[0]&&(w[String(M[0])]=String((v=M[1])!=null?v:""));else for(const[M,N]of Object.entries(C))M&&N!=null&&N!==!1&&(w[M]=N===!0?"":String(N));return PN(w,"safe","a")}),u=D(()=>Ht(Ht({},l),a.value)),c=D(()=>{var b,v;return PN({href:String((v=(b=t.node)==null?void 0:b.href)!=null?v:"")},"safe","a").href}),d=D(()=>{if(!c.value)return;const b=u.value.target;return(typeof b=="string"?b.trim():String(b??"").trim())||(z1e(c.value)?"_blank":void 0)}),h=D(()=>{var b;return String((b=d.value)!=null?b:"").trim().toLowerCase()==="_blank"}),p=D(()=>{if(!c.value)return;const b=u.value.rel,v=new Set((typeof b=="string"?b:String(b??"")).split(/\s+/).filter(Boolean)),C=new Set(Array.from(v).filter(w=>w.toLowerCase()!=="opener"));return h.value&&(C.add("noopener"),C.add("noreferrer")),C.size>0?Array.from(C).join(" "):void 0}),m=D(()=>{const b=Ht({},u.value);return delete b.title,delete b.href,delete b.target,delete b.rel,b});function g(){i.value&&x9e()}const y=D(()=>{var b,v;const C=(b=t.node)==null?void 0:b.title;return typeof C=="string"&&C.trim().length>0?C:String((v=c.value)!=null?v:"")});return(b,v)=>{var C,w;return e.node.loading?(k(),L("span",yi({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},f(l),{style:o.value}),[_("span",ike,[_("span",oke,[U(f(vs),{class:"leading-[normal] link-text",node:{type:"text",content:String((C=e.node.text)!=null?C:""),raw:String((w=e.node.text)!=null?w:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),v[1]||(v[1]=_("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,nke)):(k(),L("a",yi({key:0,class:"link-node",href:c.value,title:i.value?"":y.value,"aria-label":`Link: ${y.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:p.value},m.value,{style:o.value,onMouseenter:v[0]||(v[0]=M=>(function(N){var T,S,x,A;if(!i.value)return;const E=N,I=E?.clientX!=null&&E?.clientY!=null?{x:E.clientX,y:E.clientY}:void 0,R=((T=t.node)==null?void 0:T.title)||((S=c.value)!=null&&S.includes("xn--")&&((A=(x=t.node)==null?void 0:x.text)!=null&&A.includes("://"))?t.node.text:c.value)||"";A9e(N.currentTarget,R,"top",!1,I)})(M)),onMouseleave:g}),[(k(!0),L(Fe,null,xt(e.node.children,(M,N)=>(k(),ce(f(mc),{key:`${e.indexKey||"emphasis"}-${N}`,components:r.value,node:M,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${N}`},null,8,["components","node","custom-id","index-key"]))),128))],16,tke))}}}),[["__scopeId","data-v-367e6ca4"]]);wl.install=e=>{e.component(wl.__name,wl)};const ske={class:"insert-node"},Kl=Hi(dt({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Ks(()=>t.customId),i=D(()=>Ht({text:vs,inline_code:il,link:wl,html_inline:ma,strong:kl,emphasis:Cl,strikethrough:bl,highlight:ga,subscript:Vl,superscript:Ul,emoji:ql,footnote_reference:pa,math_inline:Iu,reference:yl},n.value));return(o,s)=>(k(),L("ins",ske,[(k(!0),L(Fe,null,xt(e.node.children,(r,l)=>(k(),ce(f(mc),{key:`${e.indexKey||"insert"}-${l}`,components:i.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"]]);Kl.install=e=>{e.component(Kl.__name,Kl)};const rke={class:"highlight-node"},ga=Hi(dt({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Ks(()=>t.customId),i=D(()=>Ht({text:vs,inline_code:il,link:wl,html_inline:ma,strong:kl,emphasis:Cl,strikethrough:bl,insert:Kl,subscript:Vl,superscript:Ul,emoji:ql,footnote_reference:pa,math_inline:Iu,reference:yl},n.value));return(o,s)=>(k(),L("mark",rke,[(k(!0),L(Fe,null,xt(e.node.children,(r,l)=>(k(),ce(f(mc),{key:`${e.indexKey||"highlight"}-${l}`,components:i.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"]]);ga.install=e=>{e.component(ga.__name,ga)};const lke={class:"emphasis-node"},Cl=Hi(dt({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Ks(()=>t.customId),i=D(()=>Ht({text:vs,inline_code:il,link:wl,html_inline:ma,strong:kl,strikethrough:bl,highlight:ga,insert:Kl,subscript:Vl,superscript:Ul,emoji:ql,footnote_reference:pa,math_inline:Iu,reference:yl},n.value));return(o,s)=>(k(),L("em",lke,[(k(!0),L(Fe,null,xt(e.node.children,(r,l)=>(k(),ce(f(mc),{key:`${e.indexKey||"emphasis"}-${l}`,components:i.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"]]);Cl.install=e=>{e.component(Cl.__name,Cl)};const ake={class:"hard-break"},tf=Hi(dt({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(k(),L("br",ake))}),[["__scopeId","data-v-50c58f70"]]);tf.install=e=>{e.component(tf.__name,tf)};const Mv=dt({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=Ot({checkbox:ha,checkbox_input:ha,emoji:ql,emphasis:Cl,hardbreak:tf,highlight:ga,inline_code:il,insert:Kl,link:wl,reference:yl,strikethrough:bl,strong:kl,subscript:Vl,superscript:Ul,text:vs}),i=Ks(()=>t.customId),o=D(()=>{const s=i.value;return Object.keys(s).length>0?Ht(Ht({},n),s):n});return(s,r)=>(k(!0),L(Fe,null,xt(e.nodes,(l,a)=>(k(),ce(f(mc),{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 bA(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(bA)}function Xk(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(bA))return e;if(!t||e.length!==1)return null;const i=e[0];if(i?.type!=="paragraph"||!Array.isArray(i.children))return null;const o=i.children;return(n||o.length>0)&&o.every(bA)?o:null}function sp(e){var t,n;if(!e?.length)return null;let i="";for(const o of e){if(o?.type!=="text"||o.center===!0)return null;i+=String((n=(t=o.content)!=null?t:o.raw)!=null?n:"")}return i}const uke=["cite"],cke={key:0,dir:"auto",class:"paragraph-node"},dke=["custom-id"],x9=Hi(dt({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=Ks(()=>t.customId),i=D(()=>!!n.value.paragraph),o=D(()=>!!n.value.text),s=D(()=>Xk(t.node.children,!i.value)),r=D(()=>t.fade!==!1||o.value?null:sp(s.value));return ui("markstreamShowTooltips",D(()=>t.showTooltips)),ui("markstreamFade",D(()=>t.fade)),(l,a)=>(k(),L("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[s.value?(k(),L("p",cke,[r.value!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},P(r.value),9,dke)):(k(),ce(f(Mv),{key:1,nodes:s.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(k(),ce(f(Zl),{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]=u=>l.$emit("copy",u))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade"]))],8,uke))}}),[["__scopeId","data-v-abfecebc"]]);x9.install=e=>{e.component(x9.__name,x9)};const fke={class:"definition-list"},hke={class:"definition-term"},pke={class:"definition-desc"},S9=Hi(dt({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,i)=>(k(),L("dl",fke,[(k(!0),L(Fe,null,xt(t.node.items,(o,s)=>(k(),L(Fe,{key:s},[_("dt",hke,[U(f(Zl),{"index-key":`definition-term-${t.indexKey}-${s}`,nodes:o.term,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:i[0]||(i[0]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])]),_("dd",pke,[U(f(Zl),{"index-key":`definition-desc-${t.indexKey}-${s}`,nodes:o.definition,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:i[1]||(i[1]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],64))),128))]))}}),[["__scopeId","data-v-4e103b30"]]);S9.install=e=>{e.component(S9.__name,S9)};const mke=["href","title"],P0=Hi(dt({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const t=e;function n(i){var o;if(i.preventDefault(),typeof document>"u")return;const s=`fnref-${String((o=t.node.id)!=null?o:"")}`,r=document.getElementById(s);r&&r.scrollIntoView({behavior:"smooth",block:"center"})}return(i,o)=>(k(),L("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,mke))}}),[["__scopeId","data-v-e1eb37b6"]]);P0.install=e=>{e.component(P0.__name,P0)};const gke=["id"],vke={class:"flex-1"},_9=dt({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,i)=>(k(),L("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[_("div",vke,[U(f(Zl),{"index-key":`footnote-${t.indexKey}`,nodes:t.node.children,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:i[0]||(i[0]=o=>n.$emit("copy",o))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],8,gke))}});_9.install=e=>{e.component(_9.__name,_9)};const yke=["custom-id"],wA=Hi(dt({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Ks(()=>t.customId),i=rn("markstreamFade",void 0),o=D(()=>i?.value!==!1||n.value.text?null:sp(t.node.children)),s=D(()=>Ht({text:vs,inline_code:il,link:wl,image:ef,strong:kl,emphasis:Cl,strikethrough:bl,highlight:ga,insert:Kl,subscript:Vl,superscript:Ul,emoji:ql,checkbox:ha,checkbox_input:ha,footnote_reference:pa,hardbreak:tf,math_inline:Iu,reference:yl},n.value));return(r,l)=>(k(),ce(fs(`h${e.node.level}`),yi({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:ae(()=>[o.value!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},P(o.value),9,yke)):(k(!0),L(Fe,{key:1},xt(e.node.children,(a,u)=>(k(),ce(f(mc),{key:u,components:s.value,"custom-id":t.customId,node:a,"index-key":`${e.indexKey||"heading"}-${u}`},null,8,["components","custom-id","node","index-key"]))),128))]),_:1},16,["class"]))}}),[["__scopeId","data-v-7122dbe1"]]),L4=wA;L4.install=e=>{e.component(wA.__name,wA)};const kke={key:0,dir:"auto",class:"paragraph-node"},bke=["custom-id"],wke={dir:"auto",class:"paragraph-node"},Cke=["custom-id"],Z1=Hi(dt({__name:"ListItemNode",props:{node:{},item:{},indexKey:{},customId:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},value:{},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=D(()=>{var p;return(p=t.node)!=null?p:t.item}),i=Ks(()=>t.customId),o=D(()=>!!i.value.paragraph),s=D(()=>!!i.value.text),r=D(()=>{var p;return Xk((p=n.value)==null?void 0:p.children,!o.value)}),l=D(()=>{var p;if(o.value)return null;const m=(p=n.value)==null?void 0:p.children;if(!Array.isArray(m)||m.length<2)return null;const g=m[0];if(g?.type!=="paragraph"||!Array.isArray(g.children))return null;const y=m.slice(1);if(!y.every(v=>v?.type==="list"))return null;const b=Xk([g]);return b?{paragraphChildren:b,nestedLists:y}:null});function a(){return t.fade===!1&&!s.value}const u=D(()=>a()?sp(r.value):null),c=D(()=>{var p;return a()?sp((p=l.value)==null?void 0:p.paragraphChildren):null}),d=Object.freeze({}),h=D(()=>{const{value:p}=t;return typeof p=="number"&&Number.isFinite(p)?{value:p}:d});return ui("markstreamShowTooltips",D(()=>t.showTooltips)),ui("markstreamFade",D(()=>t.fade)),(p,m)=>{var g,y;return k(),L("li",yi({class:"list-item",dir:"auto"},h.value),[r.value?(k(),L("p",kke,[u.value!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},P(u.value),9,bke)):(k(),ce(f(Mv),{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?(k(),L(Fe,{key:1},[_("p",wke,[c.value!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},P(c.value),9,Cke)):(k(),ce(f(Mv),{key:1,nodes:l.value.paragraphChildren,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))]),(k(!0),L(Fe,null,xt(l.value.nestedLists,(b,v)=>(k(),ce(f(Zl),{key:v,nodes:[b],"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-nested-${v}`,"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:m[0]||(m[0]=C=>p.$emit("copy",C))},null,8,["nodes","custom-id","index-key","show-tooltips","typewriter","fade","is-dark"]))),128))],64)):(k(),ce(f(Zl),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(y=(g=n.value)==null?void 0:g.children)!=null?y:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,onCopy:m[1]||(m[1]=b=>p.$emit("copy",b))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade","is-dark"]))],16)}}}),[["__scopeId","data-v-617214f9"]]);Z1.install=e=>{e.component(Z1.__name,Z1)};const G1=Hi(dt({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=Ks(()=>e.customId),n=D(()=>t.value.list_item||Z1);return(i,o)=>(k(),ce(fs(e.node.ordered?"ol":"ul"),{class:Pe(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:ae(()=>[(k(!0),L(Fe,null,xt(e.node.items,(s,r)=>{var l;return k(),ce(fs(n.value),yi({key:`${e.indexKey||"list"}-${r}`},{ref_for:!0},{showTooltips:e.showTooltips},{node:s,"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=>i.$emit("copy",a))}),null,16,["node","custom-id","index-key","typewriter","fade","is-dark","value"])}),128))]),_:1},8,["class"]))}}),[["__scopeId","data-v-99cb95e0"]]);G1.install=e=>{e.component(G1.__name,G1)};const Ake={key:2,class:"html-block-node__raw"},xke=["innerHTML"],Ske={key:1,class:"html-block-node__placeholder"},$0=Hi(dt({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=rn("markstreamHtmlPolicy",void 0),i=rn("markstreamNestedRendererProps",void 0),o=D(()=>{var I,R;return(R=(I=t.htmlPolicy)!=null?I:n?.value)!=null?R:"safe"}),s=D(()=>{var I,R;const W=(I=i?.value)!=null?I:{};return Hn(Ht({},W),{customId:(R=t.customId)!=null?R:W.customId,htmlPolicy:o.value})}),r=Yu({loader:()=>Promise.resolve().then(()=>Fx),suspensible:!1}),l=D(()=>{const I=b9(t.node.attrs,o.value);if(!I)return;const R=D0(I);return Object.keys(R).length>0?R:void 0}),a=D(()=>{const I=String(t.node.tag||"").trim(),R=b9(t.node.attrs,o.value,I);if(!R)return;const W=D0(R);return Object.keys(W).length>0?W:void 0}),u=Ks(()=>t.customId),c=dt({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=q(null),h=q(typeof window>"u"),p=q(t.node.content),m=D(()=>Array.isArray(t.node.children)?t.node.children:[]),g=D(()=>String(t.node.tag||"div")),y=D(()=>{var I;if(g.value.trim().toLowerCase()!=="details"||(I=t.node.attrs)!=null&&I.some(([W])=>String(W).toLowerCase()==="open"))return null;const R=m.value[0];return R?.type==="html_block"&&String(R.tag||"").toLowerCase()==="summary"?R:null}),b=D(()=>{var I;return sp((I=y.value)==null?void 0:I.children)}),v=D(()=>{const I=y.value;if(!I)return;const R=b9(I.attrs,o.value,"summary");if(!R)return;const W=D0(R);return Object.keys(W).length>0?W:void 0}),C=D(()=>b.value==null?m.value:m.value.slice(1)),w=D(()=>{const I=g.value.trim().toLowerCase();return TH.has(I)||mx(I,o.value)}),M=D(()=>m.value.length>0&&!!t.node.tag&&!w.value),N=D(()=>{var I,R,W;if(M.value)return{mode:"structured"};if(!h.value)return{mode:"html",content:(I=p.value)!=null?I:""};const z=(R=p.value)!=null?R:t.node.content;if(!z)return{mode:"html",content:""};if(o.value==="escape")return{mode:"html",content:K1(z,o.value)};if(t.node.loading){const O=Yk(z,u.value,o.value);return O===null?{mode:"text",content:(W=t.node.raw)!=null?W:z}:{mode:"dynamic",nodes:O}}if(!nq(z,u.value))return{mode:"html",content:K1(z,o.value)};const F=Yk(z,u.value,o.value);return F===null?{mode:"html",content:K1(z,o.value)}:{mode:"dynamic",nodes:F}}),T=Ax(),S=wx(),x=Cx(),A=_u(null),E=!!t.node.loading;return typeof window<"u"?(qe([()=>d.value,()=>S?.value.heavyBlockMargin,()=>S?.value.rootMargin],([I],R,W)=>{var z,F,O,B;if((F=(z=A.value)==null?void 0:z.destroy)==null||F.call(z),A.value=null,!E)return h.value=!0,void(p.value=t.node.content);if(!I)return void(h.value=!1);let j=!0;const $=(B=(O=S?.value.heavyBlockMargin)!=null?O:S?.value.rootMargin)!=null?B:op,V=T(I,{rootMargin:$,allowIdle:!x.value});A.value=V,h.value=h.value||V.isVisible.value,V.whenVisible.then(()=>{j&&A.value===V&&(h.value=!0)}),W(()=>{j=!1,V.destroy(),A.value===V&&(A.value=null)})},{immediate:!0}),qe(()=>t.node.content,I=>{E&&!h.value||(p.value=I)})):h.value=!0,si(()=>{var I,R;(R=(I=A.value)==null?void 0:I.destroy)==null||R.call(I),A.value=null}),(I,R)=>(k(),ce(fs(M.value?g.value:"div"),yi({ref_key:"htmlRef",ref:d,class:"html-block-node","data-markstream-viewport-pending":f(x)&&!h.value?"true":void 0},M.value?a.value:void 0),{default:ae(()=>[h.value?(k(),L(Fe,{key:0},[N.value.mode==="structured"?(k(),L(Fe,{key:0},[b.value!==null?(k(),L(Fe,{key:0},[_("summary",PY(rB(v.value)),P(b.value),17),C.value.length?(k(),ce(f(r),yi({key:0},s.value,{nodes:C.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):J("",!0)],64)):(k(),ce(f(r),yi({key:1},s.value,{nodes:m.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"]))],64)):N.value.mode==="dynamic"?(k(),ce(f(c),{key:1,nodes:N.value.nodes},null,8,["nodes"])):N.value.mode==="text"?(k(),L("pre",Ake,P(N.value.content),1)):(k(),L("div",yi({key:3},l.value,{innerHTML:N.value.content}),null,16,xke))],64)):(k(),L("div",Ske,[Gn(I.$slots,"placeholder",{node:e.node},()=>[R[0]||(R[0]=_("span",{class:"html-block-node__placeholder-bar"},null,-1)),R[1]||(R[1]=_("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),R[2]||(R[2]=_("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16,["data-markstream-viewport-pending"]))}}),[["__scopeId","data-v-e140a874"]]);$0.install=e=>{e.component($0.__name,$0)};const _ke={dir:"auto",class:"paragraph-node"},Ike=["custom-id"],Vh=Hi(dt({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=Ks(()=>t.customId),i=rn("markstreamHtmlPolicy",void 0),o=rn("markstreamFade",void 0),s=rn("markstreamParseOptions",void 0),r=rn("markstreamCustomMarkdownIt",void 0),l=rn("markstreamNestedRendererProps",void 0),a=D(()=>{var S;return(S=i?.value)!=null?S:"safe"}),u=D(()=>{var S;return(S=t.parseOptions)!=null?S:s?.value}),c=D(()=>{var S;return(S=t.customMarkdownIt)!=null?S:r?.value}),d=D(()=>{var S,x;return(x=t.customHtmlTags)!=null?x:(S=l?.value)==null?void 0:S.customHtmlTags}),h=D(()=>{var S,x;const A=(S=l?.value)!=null?S:{};return Hn(Ht({},A),{customId:(x=t.customId)!=null?x:A.customId,customHtmlTags:d.value,parseOptions:u.value,customMarkdownIt:c.value,htmlPolicy:a.value})}),p=Yu({loader:()=>Promise.resolve().then(()=>Fx),suspensible:!1});function m(S){var x;return S.type==="text"&&String((x=S.content)!=null?x:"").trim()===""}const g=D(()=>t.node.children.filter(S=>!m(S))),y=D(()=>g.value.length>0&&g.value.every(S=>S.type==="image"||(function(x){var A;const E=(function(I){return I.type==="link"&&Array.isArray(I.children)?I.children.filter(R=>!m(R)):[]})(x);return E.length===1&&((A=E[0])==null?void 0:A.type)==="image"})(S))),b=D(()=>new Set(kp(d.value))),v=D(()=>{if(!y.value||g.value.length<=1)return t.node.children;const S=[];for(let x=0;x0,I=t.node.children.slice(x+1).some(R=>!m(R));E&&I&&S.push(Hn(Ht({},A),{content:" ",raw:" "}))}return S}),C=D(()=>o?.value===!1&&!n.value.text),w=D(()=>C.value?sp(v.value):null);function M(S,x){return{node:S,"index-key":`${t.indexKey}-${x}`,"custom-id":t.customId,"custom-html-tags":d.value}}const N=D(()=>Ht({inline_code:il,image:ef,link:wl,hardbreak:tf,emphasis:Cl,strong:kl,strikethrough:bl,highlight:ga,insert:Kl,subscript:Vl,superscript:Ul,html_inline:ma,html_block:$0,emoji:ql,checkbox:ha,math_inline:Iu,checkbox_input:ha,reference:yl,footnote_anchor:P0,footnote_reference:pa,text:vs},n.value)),T=D(()=>v.value.map((S,x)=>{var A;const E=(function(I){var R,W,z,F;if(I.type==="html_block"||I.type==="html_inline"){const O=String((R=I.tag)!=null?R:"").trim().toLowerCase()||FH(I.content);if(O&&!b.value.has(O)&&RH((W=I.content)!=null?W:I.raw,O)){const B=String((F=(z=I.content)!=null?z:I.raw)!=null?F:"");return{child:{type:"text",content:B,raw:B},component:vs,isCustomComponent:!1}}}return{child:I,component:N.value[I.type],isCustomComponent:!!(n.value[I.type]&&!a2(String(I.type)))}})(S);return Hn(Ht({},E),{index:x,key:`${t.indexKey||"paragraph"}-${x}`,customAttrs:E.isCustomComponent?bx(E.child,a.value):void 0,hasSlotChildren:Array.isArray(E.child.children)&&E.child.children.length>0,slotContent:String((A=E.child.content)!=null?A:""),originalChild:S})}));return(S,x)=>(k(),L("p",_ke,[w.value!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},P(w.value),9,Ike)):(k(!0),L(Fe,{key:1},xt(T.value,A=>{return k(),L(Fe,{key:A.key},[y.value&&m(A.originalChild)?(k(),L(Fe,{key:0},[He(P((E=A.originalChild,String((I=E.content)!=null?I:""))),1)],64)):A.isCustomComponent?(k(),ce(fs(A.component),yi({key:1,ref_for:!0},A.customAttrs,{node:A.child,loading:A.child.loading,"index-key":A.key,"custom-id":t.customId,"custom-html-tags":d.value,"is-dark":h.value.isDark}),{default:ae(()=>[A.hasSlotChildren?(k(),ce(f(p),yi({key:0,ref_for:!0},h.value,{nodes:A.child.children,"index-key":A.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):A.slotContent?(k(),ce(f(p),yi({key:1,ref_for:!0},h.value,{content:A.slotContent,final:!A.child.loading,"index-key":`${A.key}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):J("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(k(),ce(fs(A.component),yi({key:2,ref_for:!0},M(A.child,A.index)),null,16))],64);var E,I}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);Vh.install=e=>{e.component(Vh.__name,Vh)};const Mke={class:"table-node-wrapper"},Tke=["aria-busy"],Eke={key:0},Lke=["custom-id"],Nke=["aria-label","onPointerdown"],Dke=["custom-id"],Fke={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},B0=Hi(dt({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=D(()=>{var b;return(b=t.node.loading)!=null&&b}),i=D(()=>{var b;return(b=t.node.rows)!=null?b:[]}),o=q(null),s=q([]);let r=null;const l=D(()=>t.node.header.cells.length),a=D(()=>s.value.some(b=>Number.isFinite(b)&&b>0)),u=D(()=>a.value?s.value.map(b=>b>0?{width:`${b}px`}:void 0):[]);ui("markstreamShowTooltips",D(()=>t.showTooltips)),ui("markstreamFade",D(()=>t.fade));const c=Ks(()=>t.customId),d=D(()=>!!c.value.text),h=D(()=>!!c.value.paragraph),p=new WeakMap;function m(b){const v=t.fade===!1&&!d.value,C=!h.value,w=p.get(b);if(w?.children===b.children&&w.textFastPath===v&&w.paragraphFastPath===C)return w.info;const M=Xk(b.children,C,!0),N={simpleChildren:M,plainText:M&&v?sp(M):null};return p.set(b,{children:b.children,textFastPath:v,paragraphFastPath:C,info:N}),N}function g(b){if(!r)return;b.preventDefault();const v=r.startWidth+r.nextStartWidth,C=Math.min(48,Math.floor(v/2)),w=Math.max(C,Math.min(v-C,Math.round(r.startWidth+b.clientX-r.startX))),M=[...r.widths];M[r.index]=w,M[r.index+1]=v-w,s.value=M}function y(){r&&(window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",y),r=null)}return qe(l,()=>{y(),s.value=[]}),si(y),(b,v)=>(k(),L("div",Mke,[_("table",{ref_key:"tableRef",ref:o,class:Pe(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(k(),L("colgroup",Eke,[(k(!0),L(Fe,null,xt(e.node.header.cells,(C,w)=>(k(),L("col",{key:w,style:an(u.value[w])},null,4))),128))])):J("",!0),_("thead",null,[_("tr",null,[(k(!0),L(Fe,null,xt(e.node.header.cells,(C,w)=>(k(),L("th",{key:w,dir:"auto",class:Pe([C.align==="right"?"text-right":C.align==="center"?"text-center":"text-left"])},[m(C).plainText!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},P(m(C).plainText),9,Lke)):m(C).simpleChildren?(k(),ce(f(Mv),{key:1,nodes:m(C).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${w}`},null,8,["nodes","custom-id","index-key"])):(k(),ce(f(Zl),{key:2,nodes:C.children,"index-key":`table-th-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:v[0]||(v[0]=M=>b.$emit("copy",M))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),w(function(N,T){if(T.button!==0)return;const S=(function(){var E;const I=(E=o.value)==null?void 0:E.querySelectorAll("thead th");return Array.from(I??[],R=>Math.round(R.getBoundingClientRect().width))})(),x=S[N],A=S[N+1];x&&A&&(T.preventDefault(),r={index:N,startX:T.clientX,startWidth:x,nextStartWidth:A,widths:S},s.value=S,window.addEventListener("pointermove",g),window.addEventListener("pointerup",y),window.addEventListener("pointercancel",y))})(w,M)},null,40,Nke)):J("",!0)],2))),128))])]),_("tbody",null,[(k(!0),L(Fe,null,xt(i.value,(C,w)=>(k(),L("tr",{key:w},[(k(!0),L(Fe,null,xt(C.cells,(M,N)=>(k(),L("td",{key:N,class:Pe([M.align==="right"?"text-right":M.align==="center"?"text-center":"text-left"]),dir:"auto"},[m(M).plainText!==null?(k(),L("span",{key:0,class:"text-node","custom-id":t.customId},P(m(M).plainText),9,Dke)):m(M).simpleChildren?(k(),ce(f(Mv),{key:1,nodes:m(M).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${w}-${N}`},null,8,["nodes","custom-id","index-key"])):(k(),ce(f(Zl),{key:2,nodes:M.children,"index-key":`table-td-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:v[1]||(v[1]=T=>b.$emit("copy",T))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,Tke),U(Po,{name:"table-node-fade"},{default:ae(()=>[n.value?(k(),L("div",Fke,[Gn(b.$slots,"loading",{isLoading:n.value},()=>[v[2]||(v[2]=_("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),v[3]||(v[3]=_("span",{class:"sr-only"},"Loading",-1))],!0)])):J("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);B0.install=e=>{e.component(B0.__name,B0)};const Rke={class:"hr-node"},I9=Hi({},[["render",function(e,t){return k(),L("hr",Rke)}],["__scopeId","data-v-39b2349c"]]);I9.install=e=>{e.component(I9.__name,I9)};const Oke={class:"unknown-node"},CA=dt({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(k(),L("div",Oke,P(e.node.raw),1))}),M9=Hi(dt({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){const t=e,n=D(()=>`vmr-container vmr-container-${t.node.name}`),i=Ks(()=>t.customId),o=D(()=>Ht({text:vs,paragraph:Vh,heading:L4,inline_code:il,link:wl,image:ef,strong:kl,emphasis:Cl,strikethrough:bl,insert:Kl,subscript:Vl,superscript:Ul,checkbox:ha,checkbox_input:ha,hardbreak:tf,math_inline:Iu,reference:yl,list:G1,math_block:uq,table:B0},i.value));return(s,r)=>(k(),L("div",yi({class:n.value},e.node.attrs),[(k(!0),L(Fe,null,xt(e.node.children,(l,a)=>{return k(),ce(fs((u=l.type,o.value[u]||CA)),{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 u}),128))],16))}}),[["__scopeId","data-v-911e41c4"]]);M9.install=e=>{e.component(M9.__name,M9)};const Pke=["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"],VN=[[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 $ke(e){if(e<=255)return Pke[e];let t=0,n=VN.length-1;for(;t<=n;){const i=t+n>>1,o=VN[i];if(eo[1]))return o[2];t=i+1}}return"L"}const Bke=/[ \t\n\r\f]+/g,zke=/[\t\n\r\f]| {2,}|^ | $/;let iw=null;const jke=new RegExp("\\p{Script=Arabic}","u"),yf=new RegExp("\\p{M}","u"),Sx=new RegExp("\\p{Nd}","u");function KN(e){return jke.test(e)}function ZN(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=183984&&e<=191471||e>=191472&&e<=192093||e>=194560&&e<=195103||e>=196608&&e<=201551||e>=201552&&e<=205743||e>=205744&&e<=210041||e>=63744&&e<=64255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=12592&&e<=12687||e>=44032&&e<=55215||e>=65280&&e<=65519}function Xu(e){for(let t=0;t=55296&&n<=56319&&t+1=56320&&i<=57343){if(ZN(i-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(ZN(n))return!0}}return!1}const Hke=new Set([" "," ","⁠","\uFEFF"]),Wke=new Set(["-","‐","–","—"]);function cq(e,t){return!((function(n){const i=z0(n);return i!==null&&Hke.has(i)})(e)||t&&((function(n){const i=z0(n);return i!==null&&(_x.has(i)||rp.has(i))})(e)||(function(n){const i=z0(n);return i!==null&&Wke.has(i)})(e)))}const _x=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),N4=new Set(['"',"(","[","{","¡","¿","“","‘","‚","„","«","‹","⸘","(","〔","〈","《","「","『","【","〖","〘","〚"]),Ix=new Set(["'","’"]),rp=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),qke=new Set([":",".","،","؛"]),Uke=new Set(["၏"]),Vke=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function Kke(e){if(Mx(e))return!0;let t=!1;for(const n of e)if(rp.has(n)||tb(n))t=!0;else if(!t||!yf.test(n))return!1;return t}function Zke(e){for(const t of e)if(!_x.has(t)&&!rp.has(t))return!1;return e.length>0}function Gke(e){if(Mx(e))return!0;for(const t of e)if(!(N4.has(t)||Ix.has(t)||yf.test(t)||tb(t)))return!1;return e.length>0}function Mx(e){let t=!1;for(const n of e)if(n!=="\\"&&!yf.test(n)){if(!(N4.has(n)||rp.has(n)||Ix.has(n)))return!1;t=!0}return t}function eb(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const i=e.charCodeAt(n);if(i<56320||i>57343)return n;const o=n-1;if(o<0)return n;const s=e.charCodeAt(o);return s>=55296&&s<=56319?o:n}function z0(e){if(e.length===0)return null;const t=eb(e,e.length);return e.slice(t)}const Qke=[36,37,43,43,92,92,162,165,176,177,1423,1423,1545,1547,1642,1642,2046,2047,2546,2547,2553,2555,2801,2801,3065,3065,3449,3449,3647,3647,6107,6107,8240,8247,8279,8279,8352,8399,8451,8451,8457,8457,8470,8470,8722,8723,43064,43064,65020,65020,65129,65130,65284,65285,65504,65505,65509,65510,73693,73696,123647,123647,126124,126124,126128,126128];function tb(e){const t=e.codePointAt(0);return t!==void 0&&(function(n,i){for(let o=0;o=i[o]&&n<=i[o+1])return!0;return!1})(t,Qke)}function Yke(e){const t=(function(n){for(const i of n)if(!yf.test(i))return i;return null})(e);return t!==null&&Sx.test(t)}function Jke(e){const t=Array.from(e);let n=t.length;for(;n>0;){const i=t[n-1];if(yf.test(i))n--;else{if(!N4.has(i)&&!Ix.has(i))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function Xke(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function GN(e,t,n,i){const o=t[i],s=e[i];if(o==null)return s;const r=n[i];if(s.length===r)return s;const l=o.repeat(r);return e[i]=l,l}function QN(e,t){return e&&t!==null&&qke.has(t)}function ebe(e){const t=z0(e);return t!==null&&Uke.has(t)}function tbe(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 AA(e){let t=e.length;for(;t>0;){const n=eb(e,t),i=e.slice(n,t);if(Vke.has(i))return!0;if(!rp.has(i))return!1;t=n}return!1}function nbe(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===` -`)return"hard-break"}return e===" "?"space":e===" "||e===" "||e==="⁠"||e==="\uFEFF"?"glue":e==="​"?"zero-width-break":e==="­"?"soft-hyphen":"text"}const ibe=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function lu(e){return e.length===1?e[0]:e.join("")}function obe(e,t){const n=[];for(let i=e.length-1;i>=0;i--)n.push(e[i]);return n.push(t),lu(n)}function sbe(e,t,n,i){if(!ibe.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const o=[];let s=null,r=[],l=n,a=!1,u=0;for(const c of e){const d=nbe(c,i),h=d==="text"&&t;s===null||d!==s||h!==a?(s!==null&&o.push({text:lu(r),isWordLike:a,kind:s,start:l}),s=d,r=[c],l=n+u,a=h,u+=c.length):(r.push(c),u+=c.length)}return s!==null&&o.push({text:lu(r),isWordLike:a,kind:s,start:l}),o}function ow(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const rbe=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function lbe(e,t){const n=e.texts[t];return!!n.startsWith("www.")||rbe.test(n)&&t+1=33&&n<=47&&n!==45||n>=58&&n<=64&&n!==63||n>=91&&n<=96||n>=123&&n<=126})(t):!fbe.has(e)&&!dbe.test(e)&&cbe.test(e)}function YN(e){let t=!1;for(const n of e)if(!yf.test(n)){if(!dq(n))return!1;t=!0}return t}function hbe(e,t,n,i){const o=!t&&YN(e),s=!i&&YN(n),r=(function(a){const u=(function(c){for(let d=c.length;d>0;){const h=eb(c,d),p=c.slice(h,d);if(!yf.test(p))return p;d=h}return null})(a);return u!==null&&tb(u)})(e),l=(t||r)&&(function(a){for(let u=a.length;u>0;){const c=eb(a,u),d=a.slice(c,u);if(!yf.test(d))return dq(d)||tb(d);u=c}return!1})(e);return!!(o||s||l)&&!Xu(e)&&!Xu(n)&&(t||o||r)&&(i||s)}function JN(e){for(const t of e)if(Sx.test(t))return!0;return!1}function T9(e){if(e.length===0)return!1;for(const t of e)if(!Sx.test(t)&&!ube.has(t))return!1;return!0}function pbe(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const n=[];let i=0;for(let o=0;o0&&u.charCodeAt(u.length-1)===32&&(u=u.slice(0,-1)),u})(e);if(s.length===0)return{normalized:s,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const r=(function(a,u,c){var d,h,p;const m=(iw===null&&(iw=new Intl.Segmenter(void 0,{granularity:"word"})),iw);let g=0;const y=[],b=[],v=[],C=[],w=[],M=[],N=[],T=[],S=[],x=[],A=[],E=[];for(const F of m.segment(a))for(const O of sbe(F.segment,(d=F.isWordLike)!=null&&d,F.index,c)){let B=function(){M[ie]!==null&&(b[ie]=[GN(y,M,N,ie)],M[ie]=null),b[ie].push(O.text),v[ie]=v[ie]||O.isWordLike,T[ie]=T[ie]||V,S[ie]=S[ie]||ne,x[ie]=ee,A[ie]=ue,E[ie]=QN(S[ie],K)};const j=O.kind==="text",$=Xke(O.text,O.isWordLike,O.kind),V=Xu(O.text),ne=KN(O.text),K=z0(O.text),ee=AA(O.text),ue=ebe(O.text),ie=g-1;u.carryCJKAfterClosingQuote&&j&&g>0&&C[ie]==="text"&&V&&T[ie]&&x[ie]||j&&g>0&&C[ie]==="text"&&Zke(O.text)&&T[ie]||j&&g>0&&C[ie]==="text"&&A[ie]?B():j&&g>0&&C[ie]==="text"&&O.isWordLike&&ne&&E[ie]?(B(),v[ie]=!0):$!==null&&g>0&&C[ie]==="text"&&M[ie]===$?N[ie]=((h=N[ie])!=null?h:1)+1:j&&!O.isWordLike&&g>0&&C[ie]==="text"&&!T[ie]&&(Kke(O.text)||O.text==="-"&&v[ie])?B():(y[g]=O.text,b[g]=[O.text],v[g]=O.isWordLike,C[g]=O.kind,w[g]=O.start,M[g]=$,N[g]=$===null?0:1,T[g]=V,S[g]=ne,x[g]=ee,A[g]=ue,E[g]=QN(ne,K),g++)}for(let F=0;Fnull);let R=-1;for(let F=g-1;F>=0;F--){const O=y[F];if(O.length!==0){if(C[F]==="text"&&!v[F]&&R>=0&&C[R]==="text"&&(Gke(O)||O==="-"&&Yke(y[R]))){const B=(p=I[R])!=null?p:[];B.push(O),I[R]=B,w[R]=w[F],y[F]="";continue}R=F}}for(let F=0;FV+1){O.push(lu(ue)),B.push(ye),j.push("text"),$.push(F.starts[V]),V=ie;continue}}O.push(ne),B.push(ee),j.push(K),$.push(F.starts[V]),V++}return{len:O.length,texts:O,isWordLike:B,kinds:j,starts:$}})((function(F){const O=[],B=[],j=[],$=[];for(let V=0;V1;for(let ue=0;ue=F.len||ow(F.kinds[K]))continue;const ee=[],ue=F.starts[K];let ie=K;for(;ie0&&(O.push(lu(ee)),B.push(!0),j.push("text"),$.push(ue),V=ie-1)}return{len:O.length,texts:O,isWordLike:B,kinds:j,starts:$}})((function(F){const O=F.texts.slice(),B=F.isWordLike.slice(),j=F.kinds.slice(),$=F.starts.slice();for(let ne=0;ne=0&&!cq(u.texts[C-1],c)&&v(C),g<0&&(g=C),y=y||Xu(w))}return v(u.len),{len:d.length,texts:d,isWordLike:h,kinds:p,starts:m}})(s,r,t.breakKeepAllAfterPunctuation):r;return Ht({normalized:s,chunks:pbe(l,o)},l)}let Qp=null;const XN=new Map;let Yp=null;const gbe=new RegExp("\\p{Emoji_Presentation}","u"),vbe=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let sw=null;const eD=new Map;function xA(){if(Qp!==null)return Qp;if(typeof OffscreenCanvas<"u")return Qp=new OffscreenCanvas(1,1).getContext("2d"),Qp;if(typeof document<"u")return Qp=document.createElement("canvas").getContext("2d"),Qp;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function Ad(e,t){let n=t.get(e);return n===void 0&&(n={width:xA().measureText(e).width,containsCJK:Xu(e)},t.set(e,n)),n}function nb(){if(Yp!==null)return Yp;if(typeof navigator>"u")return Yp={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,breakKeepAllAfterPunctuation:!0,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},Yp;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 Yp={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,breakKeepAllAfterPunctuation:!t,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},Yp}function fq(){return sw===null&&(sw=new Intl.Segmenter(void 0,{granularity:"grapheme"})),sw}function ybe(e){return gbe.test(e)||e.includes("️")}function oh(e,t,n){return n===0?t.width:t.width-(function(i,o){return o.emojiCount===void 0&&(o.emojiCount=(function(s){let r=0;const l=fq();for(const a of l.segment(s))ybe(a.segment)&&r++;return r})(i)),o.emojiCount})(e,t)*n}function kbe(e){return e==="space"||e==="zero-width-break"||e==="soft-hyphen"}function tD(e){return e==="space"||e==="preserved-space"||e==="tab"||e==="zero-width-break"||e==="soft-hyphen"}function nD(e,t,n=e.widths.length){for(;t0?e.letterSpacing:0}function Tx(e,t){return t===0?0:e+t}function Cbe(e,t,n,i,o){return Tx(i,t==="tab"?o+(function(s,r){return s.letterSpacing!==0&&s.spacingGraphemeCounts[r]>0?s.letterSpacing:0})(e,n):e.lineEndFitAdvances[n])}function iD(e,t,n,i){return Tx(i,t==="tab"?0:e.lineEndFitAdvances[n])}function oD(e,t,n,i,o){return Tx(i,t==="tab"?o:e.lineEndPaintAdvances[n])}function Abe(e,t,n){return e.letterSpacing!==0&&t?n+e.letterSpacing:n}function xbe(e,t){return e.letterSpacing===0?t:t+e.letterSpacing}function Cy(e,t,n){let i=t;for(;iB){if(de!==null&&X>Z){ie(oe,X,re),ke=X,pe=Cy(de,pe,ke+1),X=-1,re=0;continue}ie(),Te(oe,ke,le)}else $+=le,ne=oe,K=ke+1;else Te(oe,ke,le);const se=ke+1;de!==null&&de[pe]===se&&(X=se,re=$,pe++),ke++}V&&ne===oe&&K===fe.length&&(ne=oe+1,K=0)}let G=0;for(;G=W.length)));){const oe=W[G],Z=tD(z[G]);if(V)if($+oe>B){if(Z){Ee(G,oe),ie(G+1,0,$-oe),G++;continue}if(ee>=0){if(ne>ee||ne===ee&&K>0){ie();continue}ie(ee,0,ue);continue}if(oe>B&&F[G]!==null){ie(),Me(G,0),G++;continue}ie()}else Ee(G,oe),Z&&(ee=G+1,ue=$-oe),G++;else oe>B&&F[G]!==null?Me(G,0):ye(G,oe),Z&&(ee=G+1,ue=$-oe),G++}return V&&ie(),j})(n,i);const{widths:o,kinds:s,breakableFitAdvances:r,breakablePreferredBreaks:l,discretionaryHyphenWidth:a,chunks:u}=n;if(o.length===0||u.length===0)return 0;const c=nb(),d=i+c.lineFitEpsilon;let h=0,p=0,m=!1,g=0,y=0,b=-1,v=0,C=null;function w(){b=-1,v=0,C=null}function M(I=g,R=y,W){h++,p=0,m=!1,w()}function N(I,R){m=!0,g=I+1,y=0,p=R}function T(I,R,W){m=!0,g=I,y=R+1,p=W}function S(I,R){m?(p+=R,g=I+1,y=0):N(I,R)}function x(I,R,W,z,F,O){if(!R)return;const B=iD(n,I,W,F);oD(n,I,W,F,z),b=W+1,v=p-O+B,C=I}function A(I,R){var W;const z=r[I],F=(W=l[I])!=null?W:null;let O=F===null?-1:Cy(F,0,R+1),B=-1,j=R;for(;jd){if(F!==null&&B>R){M(I,B),j=B,O=Cy(F,O,j+1),B=-1;continue}M(),T(I,j,$)}else p=K,g=I,y=j+1}else T(I,j,$);const V=j+1;F!==null&&F[O]===V&&(B=V,O++),j++}m&&g===I&&y===z.length&&(g=I+1,y=0)}function E(I){h++,w()}for(let I=0;I=R.endSegmentIndex)));){const z=s[W],F=tD(z),O=wbe(n,m,W),B=z==="tab"?bbe(p+O,n.tabStopAdvance):o[W],j=O+B,$=Cbe(n,z,W,O,B);if(z!=="soft-hyphen")if(m){if(p+$>d){const V=p+iD(n,z,W,O);if(oD(n,z,W,O,B),C==="soft-hyphen"&&c.preferEarlySoftHyphenBreak&&v<=d){M(b,0);continue}if(F&&V<=d){S(W,j),M(W+1,0),W++;continue}if(b>=0&&v<=d){if(g>b||g===b&&y>0){M();continue}const ne=b;M(ne,0),W=ne;continue}if($>d&&r[W]!==null){M(),A(W,0),W++;continue}M();continue}S(W,j),x(z,F,W,B,O,j),W++}else $>d&&r[W]!==null?A(W,0):N(W,B),x(z,F,W,B,O,j),W++;else m&&(g=W+1,y=0,b=W+1,v=p+a,C=z),W++}m&&(R.consumedEndSegmentIndex,M(R.consumedEndSegmentIndex,0))}return h})(e,t)}let rw=null;function Ex(){return rw===null&&(rw=new Intl.Segmenter(void 0,{granularity:"grapheme"})),rw}function _be(e,t){const n=[];let i=[],o=0,s=!1,r=!1,l=!1;function a(){i.length!==0&&(n.push({text:i.length===1?i[0]:i.join(""),start:o}),i=[],s=!1,r=!1,l=!1)}function u(d,h,p){i=[d],o=h,s=p,r=AA(d),l=N4.has(d)}function c(d,h){i.push(d),s=s||h;const p=AA(d);r=d.length===1&&rp.has(d)&&r||p,l=!1}for(const d of Ex().segment(e)){const h=d.segment,p=Xu(h);i.length!==0?l||_x.has(h)||rp.has(h)||t.carryCJKAfterClosingQuote&&p&&r?c(h,p):s||p?(a(),u(h,d.index,p)):c(h,p):u(h,d.index,p)}return a(),n}function Ibe(e,t,n){if(t.length<=1)return t;const i=[];let o=-1,s=!1;function r(l){if(!(o<0)){if(s)o+1===l?i.push(t[o]):(function(a,u){const c=t[a].start,d=u=0&&!cq(t[l-1].text,n)&&r(l),o<0&&(o=l),s=s||Xu(a.text)}return r(t.length),i}function sD(e,t){if(t==="zero-width-break"||t==="soft-hyphen"||t==="hard-break")return 0;if(t==="tab")return 1;let n=0;const i=Ex();for(const o of i.segment(e))n++;return n}function Mbe(e){return e==="-"||e==="֊"||e==="‐"||e==="‒"||e==="–"||e==="—"}function Tbe(e,t,n,i,o){const s=nb(),{cache:r,emojiCorrection:l}=(function(E,I){xA().font=E;const R=(function(F){let O=XN.get(F);return O||(O=new Map,XN.set(F,O)),O})(E),W=(function(F){const O=F.match(/(\d+(?:\.\d+)?)\s*px/);return O?parseFloat(O[1]):16})(E),z=I?(function(F,O){let B=eD.get(F);if(B!==void 0)return B;const j=xA();j.font=F;const $=j.measureText("😀").width;if(B=0,$>O+.5&&typeof document<"u"&&document.body!==null){const V=document.createElement("span");V.style.font=F,V.style.display="inline-block",V.style.visibility="hidden",V.style.position="absolute",V.textContent="😀",document.body.appendChild(V);const ne=V.getBoundingClientRect().width;document.body.removeChild(V),$-ne>.5&&(B=$-ne)}return eD.set(F,B),B})(E,W):0;return{cache:R,fontSize:W,emojiCorrection:z}})(t,(a=e.normalized,vbe.test(a)));var a;const u=oh("-",Ad("-",r),l)+(o===0?0:2*o),c=8*oh(" ",Ad(" ",r),l),d=o!==0;if(e.len===0)return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],breakablePreferredBreaks:[],letterSpacing:0,spacingGraphemeCounts:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]};const h=[],p=[],m=[],g=[];let y=e.chunks.length<=1&&!d;const b=null,v=[],C=[],w=[],M=null,N=Array.from({length:e.len});function T(E,I,R,W,z,F,O,B,j){z!=="text"&&z!=="space"&&z!=="zero-width-break"&&(y=!1),h.push(I),p.push(R),m.push(W),g.push(z),v.push(O),C.push(B),d&&w.push(j)}function S(E,I,R,W,z){const F=Ad(E,r),O=d?sD(E,I):0,B=(function(ne,K,ee){return K>1?ne+(K-1)*ee:ne})(oh(E,F,l),O,o),j=I==="space"||I==="preserved-space"||I==="zero-width-break"?0:B,$=j===0?0:j+(O>0?o:0),V=I==="space"||I==="zero-width-break"?0:B;if(z&&W&&E.length>1){let ne="sum-graphemes";o!==0?ne="segment-prefixes":T9(E)?ne="pair-context":s.preferPrefixWidthsForBreakableRuns&&(ne="segment-prefixes");const K=(function(ue,ie,ye,Te,Ee){if(ie.breakableFitAdvances!==void 0&&ie.breakableFitMode===Ee)return ie.breakableFitAdvances;ie.breakableFitMode=Ee;const Me=fq(),G=[];for(const fe of Me.segment(ue))G.push(fe.segment);if(G.length<=1)return ie.breakableFitAdvances=null,ie.breakableFitAdvances;if(Ee==="sum-graphemes"){const fe=[];for(const de of G){const pe=Ad(de,ye);fe.push(oh(de,pe,Te))}return ie.breakableFitAdvances=fe,ie.breakableFitAdvances}if(Ee==="pair-context"||G.length>96){const fe=[];let de=null,pe=0;for(const X of G){const re=oh(X,Ad(X,ye),Te);if(de===null)fe.push(re);else{const ke=de+X,le=Ad(ke,ye);fe.push(oh(ke,le,Te)-pe)}de=X,pe=re}return ie.breakableFitAdvances=fe,ie.breakableFitAdvances}const oe=[];let Z="",Q=0;for(const fe of G){Z+=fe;const de=oh(Z,Ad(Z,ye),Te);oe.push(de-Q),Q=de}return ie.breakableFitAdvances=oe,ie.breakableFitAdvances})(E,F,r,l,ne),ee=K===null||i==="keep-all"?null:(function(ue){if(!/[-\u058A\u2010\u2012\u2013\u2014]/u.test(ue))return null;const ie=[];let ye=0;for(const Te of Ex().segment(ue))ye++,Mbe(Te.segment)&&ie.push(ye);return ie.length===0?null:ie})(E);return void T(E,B,$,V,I,R,K,ee,O)}T(E,B,$,V,I,R,null,null,O)}for(let E=0;E=55296&&ue<=56319&&ee+1=56320&&Ee<=57343&&(ie=Ee-56320+(ue-55296<<10)+65536,ye=2)}const Te=$ke(ie);Te!=="R"&&Te!=="AL"&&Te!=="AN"||(B=!0);for(let Ee=0;Ee=0&&O[ue]==="ET";ue--)O[ue]="EN";for(ue=ee+1;ue0?O[ee-1]:ne)!=="L"?"R":"L";if(ie===((ue{const e=globalThis;if(e[lw])return e[lw];const t={configs:{},controllers:{},revision:_u(0),preparedCache:new Map,blockEstimateCache:new Map};return e[lw]=t,t})();let Tg=null;const aw=ir.revision;function rD(e){var t;return e&&(t=ir.configs[e])!=null?t:null}function lD(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function Lbe(e){return e?.type==="text"||e?.type==="emoji"||e?.type==="hardbreak"}function uw(e){var t,n,i;if(!Array.isArray(e)||e.length===0)return null;let o="";for(const s of e){if(!Lbe(s))return null;s.type==="text"?o+=String((t=s.content)!=null?t:""):s.type==="emoji"?o+=String((i=(n=s.name)!=null?n:s.raw)!=null?i:""):s.type==="hardbreak"&&(o+=` -`)}return o.length>0?o:null}function cw(e,t,n){var i,o;if(!e||!Number.isFinite(t)||t<=0||!(function(){var s;if(Tg!=null)return Tg;if(typeof document>"u")return!1;try{const r=document.createElement("canvas");return Tg=!!((s=r.getContext)!=null&&s.call(r,"2d")),Tg}catch{return Tg=!1,!1}})())return null;try{const s=Math.round(100*t)/100,r=[(i=n.whiteSpace)!=null?i:"pre-wrap",n.font,n.lineHeight,n.wrapperOverhead,n.widthAdjustment,s,e].join("\0"),l=ir.blockEstimateCache.get(r);if(l)return ir.blockEstimateCache.delete(r),ir.blockEstimateCache.set(r,l),{kind:"simple-text",height:l.height,contentHeight:l.contentHeight};const a=(o=n.whiteSpace)!=null?o:"pre-wrap",u=(function(p,m,g){const y=`${g}\0${m}\0${p}`,b=ir.preparedCache.get(y);if(b)return ir.preparedCache.delete(y),ir.preparedCache.set(y,b),b.prepared;const v=(function(C,w,M){return(function(N,T,S,x){var A,E;const I=(A=x?.wordBreak)!=null?A:"normal",R=(E=x?.letterSpacing)!=null?E:0;return Tbe(mbe(N,nb(),x?.whiteSpace,I),T,!1,I,R)})(C,w,0,M)})(p,m,{whiteSpace:g});for(ir.preparedCache.set(y,{prepared:v});ir.preparedCache.size>240;){const C=ir.preparedCache.keys().next().value;if(!C)break;ir.preparedCache.delete(C)}return v})(e,n.font,a),c=(function(p,m,g){const y=Sbe(p,m);return{lineCount:y,height:y*g}})(u,Math.max(24,s-n.widthAdjustment),n.lineHeight),d=Math.max(n.lineHeight,c.height),h=Math.max(n.lineHeight,Math.round(d+n.wrapperOverhead));for(ir.blockEstimateCache.set(r,{height:h,contentHeight:Math.round(d)});ir.blockEstimateCache.size>4e3;){const p=ir.blockEstimateCache.keys().next().value;if(!p)break;ir.blockEstimateCache.delete(p)}return{kind:"simple-text",height:h,contentHeight:Math.round(d)}}catch{return null}}function hq(e,t,n){var i,o;if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type==="paragraph"){const s=uw(e.children);return s&&n.paragraph?cw(s,t,n.paragraph):null}if(e.type==="heading"){const s=Number(e.level||0),r=uw(e.children),l=n.headings[s];return r&&l?cw(r,t,l):null}if(e.type==="list_item"){const s=Array.isArray(e.children)?e.children:[];if(s.length!==1||((i=s[0])==null?void 0:i.type)!=="paragraph"||!n.listItem)return null;const r=uw((o=s[0])==null?void 0:o.children);return r?cw(r,t,n.listItem):null}if(e.type==="list"){const s=Array.isArray(e.items)?e.items:[];if(!s.length)return null;let r=Math.max(0,n.listWrapperOverhead);for(const l of s){const a=hq(l,t,n);if(!a)return null;r+=a.height}return{kind:"simple-text",height:Math.max(1,Math.round(r)),contentHeight:Math.max(1,Math.round(r))}}return null}function Eg(e){if(!e)return 1;const t=String(e).split(/\r?\n/);return Math.max(1,t.length)}function sh(e,t){const n=String(e??"");return t?n:n.replace(/\r\n$|\n$|\r$/,"")}function dw(e,t,n=0){return e.diff?xx(t??{},n)?(function(i){const o=sh(i.raw);if(o){const s=o.split(/\r?\n/);return i.originalCode!=null||i.updatedCode!=null?Math.max(1,s.filter(r=>!Ebe.some(l=>r.startsWith(l))).length):Math.max(1,s.length)}return Eg(sh(i.originalCode))+Eg(sh(i.updatedCode))})(e):(function(i){const o=i.originalCode,s=i.updatedCode;if(o!=null||s!=null)return Math.max(Eg(sh(o)),Eg(sh(s)));const r=sh(i.code).split(/\r?\n/);let l=0,a=0;for(const u of r)u.startsWith("+")&&!u.startsWith("+++")?a++:u.startsWith("-")&&!u.startsWith("---")?l++:(l++,a++);return Math.max(1,l,a)})(e):Eg(sh(e.code,e.loading===!0))}function Nbe(e){return e?`${e.fontStyle||"normal"} ${e.fontWeight||"400"} ${e.fontSize||"16px"} ${e.fontFamily||"sans-serif"}`:""}function fw(e,t,n="pre-wrap"){if(!e||!t||typeof window>"u")return null;const i=window.getComputedStyle(t),o=e.offsetHeight,s=lD(i.lineHeight,1.5*lD(i.fontSize,16)),r=e.getBoundingClientRect().width,l=t.getBoundingClientRect().width;return{font:Nbe(i),lineHeight:s,wrapperOverhead:Math.max(0,o-s),widthAdjustment:Math.max(0,r-l),whiteSpace:n}}const Dbe=new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function aD(e,t={}){var n;const i={},o=new Set((n=t.omit)!=null?n:[]);if(!e||typeof e!="object")return i;const s=Object.getOwnPropertyDescriptors(e);for(const[r,l]of Object.entries(s))Dbe.has(r)||o.has(r)||l.enumerable&&"value"in l&&(i[r]=l.value);return i}function uD(e,t,n,i){var o;const s=(function(h){return Math.max(0,Math.ceil(h.scrollHeight||0)-Math.ceil(h.clientHeight||0))})(e),r=(function(h,p){return Number.isFinite(h)?Math.min(Math.max(0,h),p):0})(n,s);if(!i.isReverseFlexScrollRoot(e))return void(e.scrollTop=r);const l=Math.max(0,s-r),a=[-l,l];let u=a[0],c=Number.POSITIVE_INFINITY;for(const h of a){e.scrollTop=h;const p=i.getNormalizedScrollTop(e,t,!1),m=Math.abs(p-r);md&&(e.scrollTop=u)}function cD(e,t){let n=0,i=null,o=null;const s=()=>{const r=o;o=null,i=null,r&&(n=Date.now(),e(...r))};return function(...r){const l=Date.now(),a=t-(l-n);o=r,a<=0?(i&&(clearTimeout(i),i=null),n=l,o=null,e(...r)):i||(i=setTimeout(s,a))}}function dD(e){return e==="simple"?"simple":e===!0||e==="true"||e==="precise"?"precise":"off"}const pq=Symbol("MarkstreamMathBlockMinHeightCache");function m8t(){return rn(pq,null)}const Fbe=new Set(["text","inline_code","emoji","footnote_reference"]),Rbe=new Set(["strong","emphasis","strikethrough","highlight","insert","subscript","superscript","link"]);function Lg(e){const t=Number(e);return!Number.isFinite(t)||t<=0?-1:Math.round(t/32)}function rh(e,t,n,i=22){const o=String(e??"");if(!o)return n;const s=Math.max(18,Math.floor(Math.max(320,t)/8)),r=o.split(/\r?\n/).length,l=Math.ceil(o.length/s),a=Math.max(1,r,l);return Math.max(n,Math.ceil(a*i+12))}function mq(e){var t;if(!e||typeof e!="object")return!1;const n=e,i=String((t=n.type)!=null?t:"");if(Fbe.has(i))return!0;if(!Rbe.has(i))return!1;const o=n.children;return!Array.isArray(o)||!o.length||o.every(mq)}function SA(e){var t,n,i,o,s,r,l,a;if(!e||typeof e!="object")return"";const u=e,c=String((t=u.type)!=null?t:"");if(c==="text")return String((i=(n=u.content)!=null?n:u.raw)!=null?i:"");if(c==="inline_code")return String((r=(s=(o=u.code)!=null?o:u.content)!=null?s:u.raw)!=null?r:"");if(c==="emoji")return String((a=(l=u.name)!=null?l:u.raw)!=null?a:"");if(typeof u.text=="string")return u.text;const d=[];for(const h of["children","items","cells","rows"]){const p=u[h];if(Array.isArray(p)){const m=p.map(SA).filter(Boolean).join(" ");m&&d.push(m)}}return d.join(" ").replace(/\s+/g," ").trim()}function gq(e){if(!e||typeof e!="object")return!1;const t=e;return t.type==="inline_code"||["children","items","cells","rows"].some(n=>{const i=t[n];return Array.isArray(i)&&i.some(gq)})}function Obe(e,t){if(!e)return 30;const n=Math.max(18,Math.floor(Math.max(320,t)/8)),i=e.split(/\r?\n/).length,o=Math.ceil(e.length/n),s=Math.max(1,i,o);return 30+26*Math.max(0,s-1)}function Pbe(e,t){var n,i,o,s,r,l,a,u,c,d,h,p,m,g;if(!e||typeof e!="object")return 32;const y=e,b=String((n=y.type)!=null?n:""),v=Number.isFinite(t)&&t>0?t:640;switch(b){case"heading":return(function(C){var w;const M=Number((w=C.level)!=null?w:C.depth);return M>=4?20:M===3?30:M===2?32:44})(y);case"paragraph":return(function(C,w){const M=String(C??"");if(!M)return 28;const N=Math.max(18,Math.floor(Math.max(320,w)/8)),T=M.split(/\r?\n/).length,S=Math.ceil(M.length/N);return Math.max(1,T,S)<=1?28:rh(M,w,34)})(String((o=(i=y.raw)!=null?i:y.content)!=null?o:""),v);case"list":return(function(C,w){var M;const N=Array.isArray(C.items)?C.items:[];if(!N.length)return 48;const T=Math.max(48,30*N.length+12);let S=12;for(const E of N)S+=Obe(SA(E)||String((M=E.raw)!=null?M:""),w);const x=Math.max(0,S-T);if(N.length>20){const E=Math.round(2.4*N.length);return Math.round(T+Math.max(E,Math.min(x,3*N.length)))}if(x<=0)return T;const A=N.length>8?8*N.length:x;return Math.round(T+Math.min(x,A))})(y,v);case"list_item":return rh(String((r=(s=y.raw)!=null?s:y.content)!=null?r:""),v,34);case"blockquote":return rh(String((a=(l=y.raw)!=null?l:y.content)!=null?a:""),v,56);case"table":return(function(C,w){const M=[...C.header?[C.header]:[],...Array.isArray(C.rows)?C.rows:[]];if(!M.length){const N=Array.isArray(C.children)?C.children.length:3;return Math.max(120,38*N+48)}return Math.max(120,Math.round(4+M.reduce((N,T)=>N+(function(S,x){const A=Math.max(1,S.length),E=Math.max(80,(x-32)/A),I=Math.max(10,Math.floor(E/8)),R=Math.max(1,...S.map(W=>{var z;const F=SA(W)||String((z=W?.raw)!=null?z:"");return Math.ceil(F.length/I)||1}));return 54+34*Math.max(0,R-1)+(A<=3&&S.some(gq)?14:0)})((function(S){var x;return Array.isArray(S?.cells)&&(x=S.cells)!=null?x:[]})(T),w),0)))})(y,v);case"code_block":{const C=String((u=y.language)!=null?u:"").trim().toLowerCase(),w=String((d=(c=y.code)!=null?c:y.raw)!=null?d:"");return C==="mermaid"?Zk(Vk(w)):C==="infographic"?Gk(Kk(w)):rh(w,v,96,20)}case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return(function(C,w){var M,N,T;const S=C.match(/^\s*]*)>/i);return S&&!/(?:^|\s)open(?:\s|=|$)/i.test((M=S[1])!=null?M:"")?rh(((T=(N=C.match(/]*>([\s\S]*?)<\/summary>/i))==null?void 0:N[1])==null?void 0:T.replace(/<[^>]*>/g,"").trim())||"Details",w,28,28):rh(C,w,96)})(String((p=(h=y.raw)!=null?h:y.content)!=null?p:""),v);case"thematic_break":return 24;default:return rh(String((g=(m=y.raw)!=null?m:y.content)!=null?g:""),v,40)}}function fD(e,t,n){return Math.min(Math.max(e,t),n)}const $be=["total","cacheHits","appendHits","tailHits","fullParses","chunkedParses"],Bbe=["tokenCloneMs","processTokensInputTokens","processTokensReusedTopLevelNodes","processTokensMs","safeMarkdownMs","tokenizeMs","htmlBlockPassesMs","parseMarkdownToStructureTotalMs"],zbe=new Set(["attrs","data","items","header","payload","props","rows","cells","term","definition","sourceMap"]),vq=["raw","content","code","originalCode","updatedCode"],hD=new WeakMap,pD=new WeakMap;let jbe=1;function su(){return typeof performance<"u"?performance.now():Date.now()}function mD(e){const t=e.stream;return t&&typeof t.stats=="function"?t.stats():null}function ua(e){if(typeof e!="object"&&typeof e!="function"||e===null)return"";const t=e;let n=hD.get(t);return n||(n=jbe++,hD.set(t,n)),String(n)}function gD(e,t,n,i={}){var o,s;const r=i.includeFinal!==!1,l={md:ua(t),customMarkdownIt:ua(n),requireClosingStrong:e.requireClosingStrong===!0,customHtmlTags:(o=e.customHtmlTags)!=null?o:[],includeSourceMap:e.includeSourceMap===!0,streamParse:(s=e.streamParse)!=null?s:"auto",validateLink:ua(e.validateLink),preTransformTokens:ua(e.preTransformTokens),postTransformTokens:ua(e.postTransformTokens),postTransformNodes:ua(e.postTransformNodes)};return r&&(l.final=e.final===!0),JSON.stringify(l)}function vD(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===10;)t-=1;const n=e.lastIndexOf(` -`,t-1)+1;return e.slice(n,t).trim()}function yD(e){const t=yq(e);return t.length>=2&&t.every(n=>{const i=n.trim();return i.length>=1&&i.replace(/^:/,"").replace(/:$/,"").split("").every(o=>o==="-")})}function yq(e){return e.includes("|")?e.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]}function kq(e){let t=2166136261;for(let n=0;n>>0).toString(36)}function Lx(e){const t=String(e??"");return`${t.length}:${kq(t)}`}function _A(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?Lx(r):`${r.length}:${kq(r.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${ua(e)}`;if(typeof e!="object")return typeof e;const i=e,o=t.get(i);if(o)return`cycle:${o}`;if(n>=6)return`object:${ua(i)}`;const s=ua(i);if(t.set(i,s),Array.isArray(e)){const r=e.slice(0,200);return`a:${e.length}:${r.map(l=>_A(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(u=>`${u}:${_A(r[u],t,n+1)}`).join(";")}`}return typeof e}function ib(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function bq(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(i=>ib(i)?kf(i,t,n+1):bq(i,t,n+1)).join(",")}`:ib(e)?kf(e,t,n):_A(e,t,n)}function Hbe(e,t,n){return Object.keys(e).sort().filter(i=>i!=="children"&&!vq.includes(i)).map(i=>{const o=e[i];return typeof o=="string"?`${i}=s:${Lx(o)}`:typeof o=="number"||typeof o=="boolean"||o==null?`${i}=${String(o)}`:typeof o=="function"?`${i}=fn:${ua(o)}`:zbe.has(i)&&(Array.isArray(o)||typeof o=="object")?`${i}=${bq(o,t,n+1)}`:o&&typeof o=="object"?`${i}=object:${ua(o)}`:""}).filter(Boolean).join(";")}function Wbe(e){return vq.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${Lx(n)}`:""}).filter(Boolean).join(";")}function kf(e,t=new WeakMap,n=0){const i=pD.get(e);if(i)return i;const o=e,s=t.get(o);if(s)return`node-cycle:${s}`;if(n>=6)return`node:${e.type}:${ua(o)}`;const r=ua(o);t.set(o,r);const l=(function(a,u,c){const d=a,h=Array.isArray(d.children)?d.children:[],p=h.length?h.slice(0,200).map(m=>kf(m,u,c+1)).join("|"):"";return[a.type,Wbe(d),Hbe(d,u,c),h.length,p].join(":")})(e,t,n);return pD.set(o,l),l}function wq(e,t){return kf(e)===kf(t)}function Nx(e,t,n){const i=su(),o=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=su()-i,e[o]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function kD(e,t,n){return Nx(t,n,()=>kf(e))}function Cq(e,t,n){return kD(e,n,"stabilizeSignatureMs")===kD(t,n,"stabilizeSignatureMs")}function Ay(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function bD(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function wD(e){return e.__markstreamHasCustomParserExtensions===!0||(function(t){var n;return Number((n=t.__markstreamRegisteredPluginCount)!=null?n:0)>0})(e)}function qbe(e,t){return e.length===t.length&&e===t}function Dx(e,t,n=0){if(n>=4)return null;if(e.type!==t.type)return!1;const i=e,o=t,s=Object.keys(i).filter(c=>c!=="type"&&c!=="children").sort(),r=Object.keys(o).filter(c=>c!=="type"&&c!=="children").sort();if(s.length!==r.length)return!1;for(let c=0;c{i=Dx(e,t)}),i??Cq(e,t,n)}function Kbe(e,t){const n={};for(const i of $be){const o=e[i],s=t?.[i];typeof o=="number"&&(n[i]=o-(typeof s=="number"?s:0))}return n}function Zbe(e,t){var n;const i=vN(t.instanceMsgId),o=new Map,s=(n=t.smoothStreamingEnabled)!=null?n:D(()=>!1),r=q(t.renderContent.value);let l=[],a="",u="",c="",d=!1;const h=(function(){let W="",z=0,F=!1,O=!1,B=!1,j=!1;function $(){W="",z=0,F=!1,O=!1,B=!1,j=!1}function V(ne){let K=!1;for(let ee=0;ee{if(!ne||!K.startsWith(ne)||K.length<=ne.length)return $(),[!0,0];let ee=0;W!==ne&&($(),V(ne),ee=ne.length);const ue=K.slice(ne.length),ie=V(ue);return W=K,[ie,ee+ue.length]}})();let p,m=0,g=0,y=su(),b=-1,v=0;function C(W){b=Number.isInteger(W)?W:0,v+=1}function w(){p&&(clearTimeout(p),p=void 0)}function M(){w();const W=t.renderContent.value;r.value!==W&&(r.value=W),y=su()}qe([t.renderContent,t.effectiveFinal,s],([W,z,F])=>{r.value!==W&&(!F||z||(function(O,B){if(!O&&B||B.length<=80||B.length\s*|`{3,}|~{3,})/.test(j))||j.endsWith(` -`)&&!(function($){const V=vD($);if(yD(V))return!1;const ne=yq(V);return ne.length>=2&&ne.some(K=>K.trim())})(B))})(r.value,W)?M():(function(){if(g+=1,p)return;const O=Math.max(0,(function(B){const j=B.parseCoalesceMs;return typeof j=="number"&&Number.isFinite(j)&&j>=0?j:80})(e)-(su()-y));O<=0?M():p=setTimeout(M,O)})())},{flush:"sync",immediate:!0}),ad(w);const N=D(()=>{var W,z,F,O;return V1e(e.customHtmlTags,(W=e.parseOptions)==null?void 0:W.customHtmlTags,(O=(F=(z=t.customComponentsMap)==null?void 0:z.value)!=null?F:{},Object.entries(O).map(([B,j])=>{const $=Ga(B);return j==null||!$||a2($)||MH.has($)||i2.has($)?"":$}).filter(Boolean)))}),T=D(()=>{const{key:W,tags:z}=K1e(N.value);if(!W)return i;const F=o.get(W);if(F)return F;const O=vN(t.instanceMsgId,{customHtmlTags:z});return o.set(W,O),O}),S=D(()=>{const W=T.value;if(!e.customMarkdownIt)return W;const z=e.customMarkdownIt(W);return W.__markstreamHasCustomParserExtensions=!0,z.__markstreamHasCustomParserExtensions=!0,z}),x=D(()=>{var W,z;const F=(W=e.parseOptions)!=null?W:{},O=t.effectiveFinal.value,B=N.value,j=O!=null,$=B.length>0;return j||$||F.streamParse==null?Ht(Ht(Hn(Ht({},F),{streamParse:(z=F.streamParse)==null||z}),j?{final:O}:{}),$?{customHtmlTags:B}:{}):F}),A=D(()=>{var W;return new Set(((W=x.value.customHtmlTags)!=null?W:[]).map(z=>String(z).trim().toLowerCase()).filter(Boolean))}),E=D(()=>gD(x.value,S.value,e.customMarkdownIt,{includeFinal:!0})),I=D(()=>gD(x.value,S.value,e.customMarkdownIt,{includeFinal:!1}));qe([E,I],([W,z],[F,O])=>{F&&(W===F&&z===O||(M(),z!==O&&(l=[],c="")))},{flush:"sync"});const R=D(()=>{var W,z,F,O,B,j,$,V,ne,K,ee;if((W=e.nodes)!=null&&W.length)return l=[],c="",C(0),Ot(e.nodes.slice());const ue=r.value;if(!ue)return l=[],c="",C(-1),[];const ie=t.debugPerformanceEnabled.value,ye=ie?su():0,Te=S.value,Ee=E.value,Me=I.value;a&&Ee!==a&&(function(xe){var Oe,Ze;(Ze=(Oe=xe.stream)==null?void 0:Oe.reset)==null||Ze.call(Oe)})(Te),u&&Me!==u&&(l=[],c="");const G=Object.keys((F=(z=t.customComponentsMap)==null?void 0:z.value)!=null?F:{}).length>0||typeof x.value.postTransformNodes=="function";G!==d&&(l=[],c="");const oe=!G&&l.length>0&&ue.startsWith(c)&&Me===u,Z=ie?mD(Te):null,Q=ie?{}:void 0,fe=wD(Te),de=!fe&&!G,pe=Ht(Ht(Hn(Ht({},x.value),{__reuseStableTopLevelNodes:de}),fe?{__disableStreamParse:!0}:{}),Q?{__timing:Q}:{}),X=NW(ue,Te,pe),re=ie?su():0,ke=ie?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let le,se=ie?Ay(X.length):void 0,_e=0,ge=0,Le=0;if(oe){const xe=ie?su():0,[Oe,Ze]=(function(yt){var Wt,Gt;const[Be,$e]=yt.scanGlobalReferenceAppend(yt.previousContent,yt.content),Ke=yt.parseOptions;return[yt.previousDirtyStartIndex>0&&Ke.final!==!0&&!yt.customMarkdownIt&&!wD(yt.md)&&!Be&&typeof Ke.preTransformTokens!="function"&&typeof Ke.postTransformTokens!="function"&&typeof Ke.postTransformNodes!="function"&&((Gt=(Wt=Ke.customHtmlTags)==null?void 0:Wt.length)!=null?Gt:0)===0?yt.previousDirtyStartIndex:0,$e]})({content:ue,previousContent:c,previousDirtyStartIndex:b,parseOptions:x.value,customMarkdownIt:e.customMarkdownIt,md:Te,scanGlobalReferenceAppend:h});Le=Ze;const ct=Oe<=0;if(ke){const yt=(function(Wt,Gt,Be,$e={}){var Ke;if(!Gt.length)return{nodes:Wt,metrics:Ay(Wt.length)};const ft=(Ke=$e.scanStartIndex)!=null?Ke:0,Ct=$e.reuseDirtyTail!==!1,Mt=(function(it,ot,zt,cn=0){const gt=Math.min(it.length,ot.length);for(let st=Math.min(gt,Math.max(0,cn));stkf(xe[ct]))})(le,ke,ge):(function(xe,Oe=0){for(let Ze=Math.max(0,Oe);Ze((B=Z?.total)!=null?B:0);t.logPerf(Oe?"parse(stream)":"parse(sync)",Ht(Ht(Ht({rendererId:t.instanceMsgId,ms:Math.round(su()-ye),nodes:le.length,contentLength:ue.length,parseCommitCount:m,parseCoalescedCount:g,nodeReuseMs:be,referenceDefinitionScanChars:Le,signatureMs:(j=ke?.signatureMs)!=null?j:0,stabilizeSignatureMs:($=ke?.stabilizeSignatureMs)!=null?$:0,primeSignatureMs:(V=ke?.primeSignatureMs)!=null?V:0,signatureCallCount:(ne=ke?.signatureCallCount)!=null?ne:0,stabilizeSignatureCallCount:(K=ke?.stabilizeSignatureCallCount)!=null?K:0,primeSignatureCallCount:(ee=ke?.primeSignatureCallCount)!=null?ee:0,stabilizeMs:_e},se??{}),Q?Object.fromEntries(Bbe.map(Ze=>{var ct;return[Ze,(ct=Q[Ze])!=null?ct:0]})):{}),xe?{streamMode:xe.lastMode,streamDelta:Kbe(xe,Z),streamStats:xe}:{}))}return Ot(le)});return{effectiveCustomHtmlTags:N,effectiveCustomHtmlTagsSet:A,mdBase:T,mdInstance:S,mergedParseOptions:x,getParsedNodesDirtyStartIndex:()=>b,getParsedNodesRevision:()=>v,parsedNodes:R}}function Gbe(e){const{isClient:t}=e,n=q(new Set),i=new Map,o=new Map,s=new Map;function r(u){if(!t)return;const c=s.get(u);c!=null&&(window.clearTimeout(c),s.delete(u))}function l(){if(t)for(const u of s.values())window.clearTimeout(u);s.clear()}function a(){n.value=new Set}return{visibleNodeIndices:n,nodeVisibilityHandles:i,nodeVisibilityWatchStops:o,nodeVisibilityFallbackTimers:s,clearVisibilityFallback:r,clearAllVisibilityFallbacks:l,markNodeVisible:function(u,c=!0){var d;c&&r(u),(function(h,p){if((g=(m=e.shouldTrackVisibleNodeIndices)==null?void 0:m.call(e))!=null&&!g)return;var m,g;const y=n.value,b=y.has(h);if(p){if(b)return;const C=new Set(y);return C.add(h),void(n.value=C)}if(!b)return;const v=new Set(y);v.delete(h),n.value=v})(u,c),c&&((d=e.onNodeMarkedVisible)==null||d.call(e,u))},resetNodeVisibleState:a,cleanupNodeVisibility:function(u){var c;if(e.shouldCleanupNodeVisibility&&!e.shouldCleanupNodeVisibility())return;for(const[h,p]of o.entries())h{const c=o.getSnapshot();t.value=c.source,n.value=c.visible,i.value=c.done},r=o.subscribe(s);s();const l=D(()=>Math.max(0,t.value.length-n.value.length)),a=D(()=>l.value===0),u=D(()=>i.value&&a.value);return Tm()&&ad(()=>{r(),o.destroy()}),{source:t,visible:n,done:i,final:u,caughtUp:a,pendingChars:l,enqueue:c=>o.enqueue(c),finish:c=>o.finish(c),flush:()=>o.flush(),reset:c=>o.reset(c),pause:()=>o.pause(),resume:()=>o.resume()}}const Ybe={maxCharsPerSecond:3e3,maxCommitFps:20,maxCharsPerCommit:160,catchUpLatencyMs:220,catchUpThreshold:400},CD=/auto|scroll|overlay/i;function Jbe(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return CD.test(t)||CD.test(n)}function Xbe(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 e4e={class:"m-0 p-0"},t4e=["data-probe"],n4e=Hi(dt(Hn(Ht({},{name:"HeightEstimationProbes"}),{__name:"HeightEstimationProbes",props:{width:{},flowRoot:{type:Boolean},paragraphNode:{},listItemNode:{},listNode:{},headingNodes:{},setParagraphWrapper:{type:Function},setListItemWrapper:{type:Function},setListWrapper:{type:Function},setHeadingWrapper:{type:Function}},setup(e){const t=e;function n(i){var o,s;return(s=(o=t.headingNodes)==null?void 0:o[i])!=null?s:null}return(i,o)=>(k(),L("div",{class:"height-estimation-probes",style:an({width:`${e.width}px`}),"aria-hidden":"true"},[_("div",{ref:s=>e.setParagraphWrapper(s),class:Pe(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"paragraph"},[U(f(Vh),{node:e.paragraphNode,"index-key":"probe-paragraph"},null,8,["node"])],2),_("div",{ref:s=>e.setListItemWrapper(s),class:Pe(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"list-item"},[_("ul",e4e,[U(f(Z1),{node:e.listItemNode,"index-key":"probe-list-item"},null,8,["node"])])],2),_("div",{ref:s=>e.setListWrapper(s),class:Pe(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"list"},[U(f(G1),{node:e.listNode,"index-key":"probe-list"},null,8,["node"])],2),(k(),L(Fe,null,xt(6,s=>_("div",{key:`probe-heading-${s}`,ref_for:!0,ref:r=>e.setHeadingWrapper(s,r),class:Pe(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":`heading-${s}`},[U(f(L4),{node:n(s),"index-key":`probe-heading-${s}`},null,8,["node","index-key"])],10,t4e)),64))],4))}})),[["__scopeId","data-v-3e0766e2"]]),AD=dt({name:"InfographicBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=D(()=>{var n,i;return Gk((i=A1(e.estimatedPreviewHeightPx))!=null?i:Kk(String((n=e.node.code)!=null?n:"")))});return()=>{var n;return jn("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?jn("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)"}},[jn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[jn("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),jn("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),jn("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},()=>jn("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,jn("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[jn("pre",{class:"infographic-pending-source text-sm font-mono whitespace-pre-wrap",style:{position:"absolute",inset:"0",zIndex:"1",margin:"0",padding:"var(--ms-inset-panel-body)",overflow:"auto",textAlign:"left"}},String((n=e.node.code)!=null?n:"")),jn("div",{class:"absolute inset-0"},[jn("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}}),xD=dt({name:"MermaidBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=D(()=>{var n,i;return Zk((i=A1(e.estimatedPreviewHeightPx))!=null?i:Vk(String((n=e.node.code)!=null?n:"")))});return()=>{var n;return jn("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?jn("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)"}},[jn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[jn("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),jn("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},()=>jn("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[jn("span",{class:"action-icon block"})])))]):null,jn("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)"}},[jn("pre",{class:"mermaid-source-code text-sm font-mono whitespace-pre-wrap",style:{position:"absolute",inset:"0",margin:"0",padding:"var(--ms-inset-panel-body)",overflow:"auto",textAlign:"left"}},String((n=e.node.code)!=null?n:"")),jn("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"}})])])}}}),i4e={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:32,renderBatchSize:48,renderBatchDelay:6,renderBatchBudgetMs:8,renderBatchIdleTimeoutMs:60,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"},minimal:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:32,renderBatchSize:48,renderBatchDelay:6,renderBatchBudgetMs:8,renderBatchIdleTimeoutMs:60,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"}};function br(e){if(e==null)return"";if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}const o4e=["data-custom-id"],s4e=["data-node-index","data-node-type"],SD="typewriter-simple-cursor-target",Aq=Hi(dt(Hn(Ht({},{name:"NodeRenderer"}),{__name:"NodeRenderer",props:{content:{},nodes:{},final:{type:Boolean},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},mode:{},domMode:{},htmlPolicy:{},viewportPriority:{type:Boolean,default:void 0},viewportPriorityOptions:{},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,String],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","copy-code","handleArtifactClick","click","mouseover","mouseout","virtual-state-change","height-change","render-settled","render-final","anchor-change"],setup(e,{expose:t,emit:n}){const i=e,o=n;function s(H){if(!(typeof Event<"u"&&H instanceof Event))return typeof H=="string"&&o("copy-code",H),void o("copy",H)}const r=Vs(),l=rn("markstreamNestedRendererProps",void 0);function a(H){const te=r?.vnode.props;return!!te&&(Object.prototype.hasOwnProperty.call(te,H)||Object.prototype.hasOwnProperty.call(te,String(H).replace(/[A-Z]/g,he=>`-${he.toLowerCase()}`)))}function u(H){var te,he;const ve=i[H];return a(H)?ve:(he=(te=l?.value)==null?void 0:te[H])!=null?he:ve}const c=D(()=>{return(H=u("mode"))==="chat"||H==="minimal"||H==="docs"?H:"docs";var H}),d=D(()=>dD(u("typewriter"))),h=D(()=>d.value!=="off"),p=D(()=>u("domMode")==="minimal"?"minimal":"full"),m=D(()=>{return(H={mode:c.value,codeRenderer:u("codeRenderer"),renderCodeBlocksAsPre:u("renderCodeBlocksAsPre")}).renderCodeBlocksAsPre===!0?"pre":H.codeRenderer==="pre"||H.codeRenderer==="shiki"||H.codeRenderer==="monaco"?H.codeRenderer:H.renderCodeBlocksAsPre===!1||H.mode==="docs"?"monaco":"pre";var H}),g=D(()=>i4e[c.value]),y=D(()=>{var H;return(H=u("showTooltips"))!=null?H:g.value.showTooltips}),b=D(()=>{var H;return(H=u("fade"))!=null?H:g.value.fade}),v=D(()=>{var H;return(H=u("batchRendering"))!=null?H:g.value.batchRendering}),C=D(()=>{var H;return(H=u("initialRenderBatchSize"))!=null?H:g.value.initialRenderBatchSize}),w=D(()=>{var H;return(H=u("renderBatchSize"))!=null?H:g.value.renderBatchSize}),M=D(()=>{var H;return(H=u("renderBatchDelay"))!=null?H:g.value.renderBatchDelay}),N=D(()=>{var H;return(H=u("renderBatchBudgetMs"))!=null?H:g.value.renderBatchBudgetMs}),T=D(()=>{var H;return(H=u("renderBatchIdleTimeoutMs"))!=null?H:g.value.renderBatchIdleTimeoutMs}),S=D(()=>{var H;return(H=u("deferNodesUntilVisible"))!=null?H:g.value.deferNodesUntilVisible}),x=D(()=>{var H;return(H=u("maxLiveNodes"))!=null?H:g.value.maxLiveNodes}),A=D(()=>{var H;return(H=u("liveNodeBuffer"))!=null?H:g.value.liveNodeBuffer}),E=D(()=>{var H;return(H=u("nodeVirtual"))!=null?H:g.value.nodeVirtual}),I={get content(){return i.content},get nodes(){return i.nodes},get final(){return i.final},get parseOptions(){return u("parseOptions")},get customMarkdownIt(){return u("customMarkdownIt")},get debugPerformance(){return i.debugPerformance},get customHtmlTags(){return u("customHtmlTags")},get mode(){return u("mode")},get domMode(){return p.value},get htmlPolicy(){return u("htmlPolicy")},get viewportPriority(){return u("viewportPriority")},get viewportPriorityOptions(){return u("viewportPriorityOptions")},get codeBlockStream(){return u("codeBlockStream")},get codeBlockDarkTheme(){return u("codeBlockDarkTheme")},get codeBlockLightTheme(){return u("codeBlockLightTheme")},get codeBlockMonacoOptions(){return u("codeBlockMonacoOptions")},get codeRenderer(){return u("codeRenderer")},get renderCodeBlocksAsPre(){return u("renderCodeBlocksAsPre")},get codeBlockMinWidth(){return u("codeBlockMinWidth")},get codeBlockMaxWidth(){return u("codeBlockMaxWidth")},get codeBlockProps(){return u("codeBlockProps")},get mermaidProps(){return u("mermaidProps")},get d2Props(){return u("d2Props")},get infographicProps(){return u("infographicProps")},get showTooltips(){return y.value},get themes(){return u("themes")},get langs(){return u("langs")},get isDark(){return u("isDark")},get customId(){return u("customId")},get indexKey(){return i.indexKey},get typewriter(){return u("typewriter")},get smoothStreaming(){return i.smoothStreaming},get smoothStreamingOptions(){return u("smoothStreamingOptions")},get parseCoalesceMs(){return u("parseCoalesceMs")},get fade(){return b.value},get batchRendering(){return v.value},get initialRenderBatchSize(){return C.value},get renderBatchSize(){return w.value},get renderBatchDelay(){return M.value},get renderBatchBudgetMs(){return N.value},get renderBatchIdleTimeoutMs(){return T.value},get deferNodesUntilVisible(){return S.value},get maxLiveNodes(){return x.value},get liveNodeBuffer(){return A.value},get nodeVirtual(){return E.value},get virtualScroll(){return i.virtualScroll},get renderAsFragment(){return i.renderAsFragment}};function R(H){o("height-change",H)}function W(H){o("virtual-state-change",H)}function z(H){o("anchor-change",H)}const F=q(),O=q(null),B=q(null),j=q(null),$=Ki({1:null,2:null,3:null,4:null,5:null,6:null}),V=q(!1),ne=new Map,K=q(0),ee=q(0),ue=q({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function ie(H,te){return typeof H!="string"?te:H.trim()||te}function ye(H){const te=Number(H);return Number.isFinite(te)&&te>0?Math.max(1,Math.trunc(te)):640}const Te=D(()=>{var H;const te=(H=I.viewportPriorityOptions)!=null?H:{},he=ie(te.rootMargin,op);return{rootMargin:he,heavyBlockMargin:ie(te.heavyBlockMargin,he),maxTargets:ye(te.maxTargets)}}),Ee=D(()=>{var H;return(H=Te.value.rootMargin)!=null?H:op}),Me=D(()=>{var H;return(H=Te.value.maxTargets)!=null?H:640});function G(){var H,te;if(((H=i.virtualScroll)==null?void 0:H.enabled)!==!0)return null;const he=(te=i.virtualScroll)==null?void 0:te.scrollRoot;return oe(typeof he=="function"?he():he)}function oe(H){return H?typeof HTMLElement<"u"&&H instanceof HTMLElement?H:typeof H=="object"&&"value"in H?oe(H.value):typeof H=="object"&&"$el"in H?oe(H.$el):null:null}ui(rq,Te);const{isClient:Z,renderAsFragment:Q,debugPerformanceEnabled:fe,resolvedShowTooltips:de,resolvedHtmlPolicy:pe,inheritedSmoothStreaming:X,ownsTypewriterCursor:re}=(function(H){const te=typeof window<"u",he=Nm(),ve=rn("markstreamHtmlPolicy",void 0),Ne=rn("markstreamTypewriterCursor",void 0),Ue=rn("markstreamSmoothStreaming",void 0),Ye=D(()=>H.renderAsFragment===!0),tt=D(()=>!!(H.debugPerformance&&te&&typeof console<"u")),bt=D(()=>{var kt;if(typeof H.showTooltips=="boolean")return H.showTooltips;const Je=(kt=he.showTooltips)!=null?kt:he["show-tooltips"];return Je===""||Je===!0||Je==="true"||Je!==!1&&Je!=="false"&&void 0}),nt=D(()=>{var kt,Je;return(Je=(kt=H.htmlPolicy)!=null?kt:ve?.value)!=null?Je:"safe"}),ht=D(()=>Ne?.value!==!0);return{isClient:te,renderAsFragment:Ye,debugPerformanceEnabled:tt,resolvedShowTooltips:bt,resolvedHtmlPolicy:nt,inheritedSmoothStreaming:Ue,inheritedTypewriterCursor:Ne,ownsTypewriterCursor:ht}})(I),{resolveViewportRoot:ke,resolveScrollContainer:le,isReverseFlexScrollRoot:se,getNormalizedScrollTop:_e,getOffsetTopWithinRoot:ge}=(function(H,te){function he(){var tt,bt;return(bt=(tt=te.scrollRoot)==null?void 0:tt.call(te))!=null?bt:null}function ve(tt){if(typeof window>"u")return null;const bt=he();if(bt)return bt;const nt=tt??H.value;if(!nt)return null;const ht=nt.ownerDocument||document,kt=ht.scrollingElement||ht.documentElement;let Je=nt;for(;Je&&Je!==ht.body&&Je!==kt;){if(Jbe(window.getComputedStyle(Je))&&Xbe(Je))return Je;Je=Je.parentElement}return null}function Ne(tt){if(!te.isClient)return!1;try{const bt=window.getComputedStyle(tt);return!!(bt.display||"").toLowerCase().includes("flex")&&(bt.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function Ue(tt,bt,nt){var ht,kt;if(nt)return Ye(bt);const Je=tt.scrollTop;if(!Ne(tt))return Je;const pt=Je<0?-Je:Je;return Math.max(0,((ht=tt.scrollHeight)!=null?ht:0)-((kt=tt.clientHeight)!=null?kt:0))-pt}function Ye(tt){var bt,nt,ht,kt,Je;const pt=Number((bt=tt.scrollingElement)==null?void 0:bt.scrollTop),Nt=Number((ht=(nt=tt.documentElement)==null?void 0:nt.scrollTop)!=null?ht:0),_t=Number((Je=(kt=tt.body)==null?void 0:kt.scrollTop)!=null?Je:0);return Math.max(0,Number.isFinite(pt)?pt:0,Number.isFinite(Nt)?Nt:0,Number.isFinite(_t)?_t:0)}return{resolveViewportRoot:ve,resolveScrollContainer:function(tt){var bt,nt,ht,kt;const Je=he();if(Je)return Je;const pt=ve((bt=tt??H.value)!=null?bt:null);if(pt)return pt;const Nt=(kt=(ht=tt?.ownerDocument)!=null?ht:(nt=H.value)==null?void 0:nt.ownerDocument)!=null?kt:typeof document<"u"?document:null;return Nt?.scrollingElement||Nt?.documentElement||null},isReverseFlexScrollRoot:Ne,getNormalizedScrollTop:Ue,getOffsetTopWithinRoot:function(tt,bt){const nt=bt.ownerDocument||tt.ownerDocument||document;if((function(pt,Nt){return pt===Nt.documentElement||pt===Nt.body||pt===Nt.scrollingElement})(bt,nt))return tt.getBoundingClientRect().top+Ye(nt);const ht=bt.getBoundingClientRect(),kt=tt.getBoundingClientRect(),Je=Ue(bt,nt,!1);return kt.top-ht.top+Je}}})(F,{isClient:Z,scrollRoot:G});ui("markstreamShowTooltips",de),ui("markstreamHtmlPolicy",pe),ui("markstreamTypewriter",h),ui("markstreamFade",D(()=>I.fade!==!1)),ui("markstreamTypewriterCursor",D(()=>!0)),ui("markstreamTextStreamState",ne),ui("markstreamStreamVersion",K),ui("markstreamParseOptions",D(()=>I.parseOptions)),ui("markstreamCustomMarkdownIt",D(()=>I.customMarkdownIt));const{smoothStreamingEnabled:Le,renderContent:be,requestedFinal:xe,effectiveFinal:Oe}=(function(H,te){const he=Qbe(Ht(Ht({},Ybe),H.smoothStreamingOptions)),ve=D(()=>{var Je,pt,Nt;return H.smoothStreaming!==!1&&!((Je=H.nodes)!=null&&Je.length)&&(H.smoothStreaming===!0||!((pt=te.inheritedSmoothStreaming)!=null&&pt.value))&&(H.smoothStreaming===!0||dD(H.typewriter)!=="off"||((Nt=H.maxLiveNodes)!=null?Nt:0)<=0)}),Ne=q(!te.isClient||H.smoothStreaming===!0);xn(()=>{Ne.value=!0});const Ue=D(()=>Ne.value&&ve.value),Ye=D(()=>{var Je;return Ue.value?he.visible.value:(Je=H.content)!=null?Je:""}),tt=D(()=>{var Je,pt;const Nt=(Je=H.parseOptions)!=null?Je:{};return(pt=H.final)!=null?pt:Nt.final}),bt=D(()=>{const Je=tt.value;return Ue.value&&Je!=null?!!Je&&he.caughtUp.value:Je});let nt=0,ht=!1;function kt(){nt=0,ht=!1}return qe([()=>H.content,()=>H.nodes,Ue,tt],([Je,pt,Nt,_t])=>{if(pt?.length)return kt(),void he.reset("");const Yt=Je??"";if(!Nt)return kt(),he.reset(Yt),void(_t&&he.finish({flush:!0}));const $t=he.source.value;if(Yt){if(Yt!==$t)if(Yt.startsWith($t)){const pn=Yt.slice($t.length),vn=he.pendingChars.value;pn.length<=8?(nt++,ht||nt>=2&&vn<=8?(ht=!0,he.reset(Yt)):he.enqueue(pn)):(kt(),he.enqueue(pn))}else kt(),he.reset(Yt)}else kt(),he.reset("");_t&&he.finish()},{immediate:!0}),{smoothStream:he,smoothStreamingEligible:ve,smoothStreamingEnabled:Ue,renderContent:Ye,requestedFinal:tt,effectiveFinal:bt}})(I,{isClient:Z,inheritedSmoothStreaming:X}),Ze=xe.value===!0;ui("markstreamSmoothStreaming",Le);const ct=q(!1),yt=q(!1),Wt=q(!1);let Gt="",Be=!1,$e=null;function Ke(){Z&&$e!=null&&(window.clearTimeout($e),$e=null)}function ft(){ct.value=!1,Ke()}function Ct(H,te){if(!fe.value)return;const he=(function(){if(!fe.value)return null;const ve=ot(Mt),Ne=ot(qt),Ue=Math.max(it,Ne);if(ve<=0&&Ue<=0)return null;const Ye={total:ve,maxPerFrame:Ue,byLabel:(tt=Mt,Object.fromEntries(Array.from(tt.entries()).sort((bt,nt)=>nt[1]-bt[1]||bt[0].localeCompare(nt[0]))))};var tt;return Mt.clear(),qt.clear(),it=0,Ye})();console.info(`[markstream-vue][perf] ${H}`,he?Hn(Ht({},te),{layoutReads:he}):te)}qe([()=>I.indexKey,()=>I.customId],()=>{var H,te;ft(),yt.value=!1,Wt.value=!((H=i.nodes)!=null&&H.length)&&xe.value!==!0&&!!i.content,Gt=(te=be.value)!=null?te:"",Be=Gt.length>0},{flush:"sync"}),qe([()=>i.content,()=>i.nodes,xe],([H,te,he])=>{!te?.length&&he!==!0&&H&&(Wt.value=!0)},{flush:"sync",immediate:!0}),qe([be,()=>i.nodes,xe],([H,te,he])=>{const ve=H??"";return te?.length||he===!0?(ft(),yt.value=!1,Gt=ve,void(Be=!0)):(ve.length>0&&(Wt.value=!0),Be?(Gt&&ve.length>Gt.length&&ve.startsWith(Gt)?(ct.value=!0,yt.value=!0,Z&&(Ke(),$e=window.setTimeout(()=>{var Ne;$e=null,Oe.value===!0||(Ne=i.nodes)!=null&&Ne.length||(Op(),ct.value=!1,Ac())},1200))):(ve.length"u")return null;const Ue=window;if(Ue.__markstreamLayoutReadPerformance)return Ue.__markstreamLayoutReadPerformance;const Ye={total:0,maxPerFrame:0,byLabel:{}};return Ue.__markstreamLayoutReadPerformance=Ye,Ye})();Ne&&(Ne.total=Number(Ne.total||0)+1,Ne.byLabel[ve]=Number(Ne.byLabel[ve]||0)+1,Ne.currentFrameTotal=Number(Ne.currentFrameTotal||0)+1,Ne.frameScheduled||(Ne.frameScheduled=!0,typeof window.requestAnimationFrame!="function"?typeof queueMicrotask!="function"?setTimeout(()=>cn(Ne),0):queueMicrotask(()=>cn(Ne)):window.requestAnimationFrame(()=>cn(Ne))))})(H),De||(De=!0,Z&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(zt):typeof queueMicrotask!="function"?setTimeout(zt,0):queueMicrotask(zt)))}function st(H,te){return gt(H),te()}const Tt=I.customId?`renderer-${I.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,sn=(function(H){const te=new Map;return{scope:H,cache:te,clear:()=>te.clear()}})(Tt),ki=Tt;ui(pq,sn);const In=Ks(()=>I.customId),{effectiveCustomHtmlTagsSet:Zo,mergedParseOptions:Go,parsedNodes:ze,getParsedNodesDirtyStartIndex:At,getParsedNodesRevision:lt}=Zbe(I,{instanceMsgId:Tt,renderContent:be,effectiveFinal:Oe,smoothStreamingEnabled:Le,debugPerformanceEnabled:fe,customComponentsMap:In,logPerf:Ct});qe(ze,()=>{ct.value||sn.clear(),K.value+=1},{immediate:!0});const kn=D(()=>({customId:I.customId,customHtmlTags:Go.value.customHtmlTags,parseOptions:I.parseOptions,customMarkdownIt:I.customMarkdownIt,htmlPolicy:pe.value,viewportPriority:I.viewportPriority,viewportPriorityOptions:Te.value,mode:c.value,domMode:I.domMode,codeRenderer:m.value,codeBlockStream:I.codeBlockStream,codeBlockDarkTheme:I.codeBlockDarkTheme,codeBlockLightTheme:I.codeBlockLightTheme,codeBlockMonacoOptions:I.codeBlockMonacoOptions,renderCodeBlocksAsPre:I.renderCodeBlocksAsPre,codeBlockMinWidth:I.codeBlockMinWidth,codeBlockMaxWidth:I.codeBlockMaxWidth,codeBlockProps:I.codeBlockProps,mermaidProps:I.mermaidProps,d2Props:I.d2Props,infographicProps:I.infographicProps,showTooltips:de.value,themes:I.themes,langs:I.langs,isDark:I.isDark,typewriter:h.value,smoothStreamingOptions:I.smoothStreamingOptions,parseCoalesceMs:I.parseCoalesceMs,fade:I.fade}));ui("markstreamNestedRendererProps",kn);const Dt=D(()=>ze.value),wi=D(()=>ze.value.length),vo=q(null),Io=q(null),Wr=q(null),Mo=q(null),Bo=i.indexKey!=null&&String(i.indexKey).startsWith("list-item-"),yo=!Bo&&I.customId?rD(I.customId):null,Zs=D(()=>yo?(aw.value,rD(I.customId)):null),ni=D(()=>{var H;return!!(!Q.value&&I.customId&&!Bo&&((H=Zs.value)!=null&&H.enabled))}),Li=D(()=>!!(Z&&ni.value)),Sn=D(()=>{var H;return!!(!Q.value&&((H=i.virtualScroll)!=null&&H.enabled))}),To=D(()=>Sn.value),Gs=q(!1);xn(()=>{Gs.value=!0});const Bn=D(()=>!!(Z&&Sn.value));ui("markstreamHostScrollManaged",Bn);const io=D(()=>!!(Gs.value&&Bn.value)),oo=D(()=>Li.value||Bn.value),ks=D(()=>Li.value||io.value),ri=D(()=>{var H;return oo.value&&((H=Zs.value)==null?void 0:H.textEstimation)!==!1});function hi(){const H=ee.value||st("getMeasuredContainerWidth.clientWidth",()=>{var te;return((te=F.value)==null?void 0:te.clientWidth)||0});return Number.isFinite(H)&&H>0?H:0}const _r=D(()=>{const H=hi();return H>0?Math.max(1,Math.round(H)):640}),Eo=D(()=>{var H,te;return!(Oe.value!==!0||Sn.value||c.value!=="chat"&&c.value!=="minimal"||a("maxLiveNodes")||a("liveNodeBuffer")||(H=i.nodes)!=null&&H.length||Wt.value||!(((te=I.maxLiveNodes)!=null?te:0)<=0))}),qr=D(()=>{var H;return Eo.value?50:Math.max(1,(H=I.maxLiveNodes)!=null?H:320)}),Lo=D(()=>{var H;return Eo.value?16:Math.max(0,(H=I.liveNodeBuffer)!=null?H:60)}),An=D(()=>{var H;return!Q.value&&I.nodeVirtual!==!1&&!(((H=I.maxLiveNodes)!=null?H:0)<=0&&!Eo.value)&&(I.nodeVirtual===!0?ze.value.length>0:ze.value.length>qr.value)}),Qs=D(()=>An.value||Li.value||Bn.value),fr=D(()=>I.viewportPriority!==!1),ta=D(()=>!!fr.value&&!V.value);var Ys;Ys=D(()=>fr.value),ui(lq,Ys);const ll=D(()=>{var H;return!(Q.value||I.deferNodesUntilVisible===!1||((H=I.maxLiveNodes)!=null?H:0)<=0||An.value||ze.value.length>900||I.viewportPriority===!1)}),so=T9e(H=>{var te;return ke((te=H??F.value)!=null?te:null)},fr),{requestFrame:Wi,cancelFrame:Ni,hasIdleCallback:Qo,isTestEnv:No}=(function(H){const te=H.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,he=H.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,ve=H.isClient&&typeof window.requestIdleCallback=="function",Ne=(function(){var Ue;if(typeof globalThis>"u"||!("process"in globalThis))return;const Ye=(Ue=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:Ue.value;return Ye?.env})();return{requestFrame:te,cancelFrame:he,hasIdleCallback:ve,isTestEnv:Ne?.NODE_ENV==="test"}})({isClient:Z}),hr=D(()=>Oe.value===!0&&!Sn.value),{resolvedBatchSize:Ir,resolvedInitialBatch:Js,batchingEnabled:na,incrementalRenderingActive:pr,renderedCount:us,previousRenderContext:Di,adaptiveBatchSize:Pi,previousBatchConfig:qi}=(function(H,te){var he;const ve=D(()=>{var kt;const Je=Math.trunc((kt=H.renderBatchSize)!=null?kt:80);return Number.isFinite(Je)?Math.max(0,Je):0}),Ne=D(()=>{var kt;const Je=Math.trunc((kt=H.initialRenderBatchSize)!=null?kt:ve.value);return Number.isFinite(Je)?Math.max(0,Je):ve.value}),Ue=D(()=>!te.renderAsFragment.value&&H.batchRendering!==!1&&ve.value>0&&te.isClient&&!te.isTestEnv),Ye=q(0),tt=q({key:H.indexKey,total:0}),bt=q(Math.max(1,ve.value||1)),nt=D(()=>{var kt,Je,pt;return Ue.value&&!((kt=te.continuousStreaming)!=null&&kt.value)&&!((Je=te.forceFullRenderFinalContent)!=null&&Je.value)&&((pt=H.maxLiveNodes)!=null?pt:0)<=0}),ht=q({batchSize:ve.value,initial:Ne.value,delay:(he=H.renderBatchDelay)!=null?he:16,enabled:nt.value});return{resolvedBatchSize:ve,resolvedInitialBatch:Ne,batchingEnabled:Ue,incrementalRenderingActive:nt,renderedCount:Ye,previousRenderContext:tt,adaptiveBatchSize:bt,previousBatchConfig:ht}})(I,{isClient:Z,isTestEnv:No,renderAsFragment:Q,forceFullRenderFinalContent:hr,continuousStreaming:D(()=>yt.value&&Oe.value!==!0)}),Fi=D(()=>{var H;return!Q.value&&I.batchRendering!==!1&&Ir.value>0&&!No&&((H=I.maxLiveNodes)!=null?H:0)<=0&&!hr.value}),pi=D(()=>Fi.value),Gi=D(()=>oo.value||pi.value),ro=D(()=>{var H;return Gi.value&&((H=Zs.value)==null?void 0:H.codeBlockEstimation)!==!1}),Qi=new Map,Ur=new Map,al=new WeakMap;let po=null;const Vr=new WeakMap,Yi=new Map,bs=[];let at=[],et=[],wt=-1;const Et=_u(bs),bn=new Set,Do=q(0);let Ji=0;const Kr=q(0),zo=D(()=>(Kr.value,Array.from(Qi.entries()).sort((H,te)=>H[0]-te[0]))),ko=q(null),Ci=q(null);let bo,Xs=null,wo=0,Fo=null;function Ro(){bo.markFallbackHeightPrefixDirty()}function Is(H){return bo.getFallbackNodeHeight(H)}function er(H,te){return bo.estimateHeightRange(H,te)}function Zr(H){return bo.estimateIndexForOffset(H)}const{activeRestoreAnchor:ws,getRelativeScrollTopWithinContainer:Mr,setRelativeScrollTopWithinContainer:_l,resolveAnchorOffset:Eu,clearRestoreReconcile:Il,scheduleRestoreReconcile:jo,captureRestoreAnchor:Gr,restoreAnchor:Tr,getAnchorDrift:Ml}=(function(H){const{isClient:te,containerRef:he,parsedNodeCount:ve,requestFrame:Ne,cancelFrame:Ue,resolveScrollContainer:Ye,getNormalizedScrollTop:tt,getOffsetTopWithinRoot:bt,isReverseFlexScrollRoot:nt,estimateIndexForOffset:ht,estimateHeightRange:kt,getFallbackNodeHeight:Je,clamp:pt}=H,Nt=q(null);let _t=null,Yt=[];function $t(){const Nn=Ye(),Qn=he.value;if(!Nn||!Qn)return null;const Jn=Nn.ownerDocument||Qn.ownerDocument||document;if(Nn===Jn.documentElement||Nn===Jn.body||Nn===Jn.scrollingElement){const Xi=Qn.getBoundingClientRect();return Math.max(0,-Xi.top)}return Math.max(0,tt(Nn,Jn,!1)-bt(Qn,Nn))}function pn(Nn){var Qn;const Jn=Ye(),Xi=he.value;if(!Jn||!Xi)return;const Nr=Math.max(0,Nn),kr=Jn.ownerDocument||Xi.ownerDocument||document,iu=kr.defaultView||(typeof window<"u"?window:null);if(Jn===kr.documentElement||Jn===kr.body||Jn===kr.scrollingElement){const Du=tt(Jn,kr,!0)+Xi.getBoundingClientRect().top;return void((Qn=iu?.scrollTo)==null||Qn.call(iu,0,Math.max(0,Du+Nr)))}uD(Jn,kr,bt(Xi,Jn)+Nr,{isReverseFlexScrollRoot:Du=>{var vg;return(vg=nt?.(Du))!=null&&vg},getNormalizedScrollTop:tt})}function vn(Nn){const Qn=ve.value,Jn=pt(Nn.nodeIndex,0,Math.max(0,Qn-1));return kt(0,Jn)+Math.max(0,Nn.offsetWithinNodePx)}function Ln(){if(_t!=null&&(Ue?.(_t),_t=null),te)for(const Nn of Yt)window.clearTimeout(Nn);Yt=[]}function Mn(Nn){const Qn=vn(Nn),Jn=$t();Jn!=null&&Math.abs(Jn-Qn)<=.5||pn(Qn)}return{activeRestoreAnchor:Nt,getRelativeScrollTopWithinContainer:$t,setRelativeScrollTopWithinContainer:pn,resolveAnchorOffset:vn,clearRestoreReconcile:Ln,applyRestoreAnchor:Mn,scheduleRestoreReconcile:function(){Nt.value&&te&&_t==null&&(_t=Ne?Ne(()=>{_t=null,Nt.value&&Mn(Nt.value)}):null,_t==null&&Nt.value&&Mn(Nt.value))},captureRestoreAnchor:function(){const Nn=$t(),Qn=ve.value;if(Nn==null||Qn<=0)return null;const Jn=pt(ht(Nn+1),0,Qn-1),Xi=kt(0,Jn),Nr=Je(Jn);return{nodeIndex:Jn,offsetWithinNodePx:pt(Nn-Xi,0,Math.max(0,Nr-1))}},restoreAnchor:function(Nn){const Qn=ve.value;if(Nt.value={nodeIndex:pt(Nn.nodeIndex,0,Math.max(0,Qn-1)),offsetWithinNodePx:Math.max(0,Nn.offsetWithinNodePx)},Ln(),Mn(Nt.value),te)for(const Jn of[0,120,280,480])Yt.push(window.setTimeout(()=>{Nt.value&&Mn(Nt.value)},Jn))},getAnchorDrift:function(Nn){const Qn=$t();return Qn==null?null:Qn-vn(Nn)}}})({isClient:Z,containerRef:F,parsedNodeCount:wi,requestFrame:Wi,cancelFrame:Ni,resolveScrollContainer:()=>ko.value||le(),getNormalizedScrollTop:_e,getOffsetTopWithinRoot:ge,isReverseFlexScrollRoot:se,estimateIndexForOffset:Zr,estimateHeightRange:er,getFallbackNodeHeight:Is,clamp:Wo}),{nodeHeights:Ho,heightStats:Cs,heightTreeSize:cs,heightSumTree:Yo,heightKnownTree:vc,averageNodeHeight:Xa,resetHeightMeasurements:mr,pruneHeightMeasurements:Er,rebuildHeightTrees:ia,recordNodeHeight:yc,removeNodeHeights:Y,exportHeightCache:we,importHeightCache:Re,fenwickRangeSum:Ve}=(function(H={}){const te=Ki({}),he=Ki({total:0,count:0}),ve=q(0),Ne=q([]),Ue=q([]);function Ye(){for(const Je of Object.keys(te))delete te[Number(Je)];he.total=0,he.count=0,ve.value=0,Ne.value=[],Ue.value=[]}function tt(Je,pt,Nt){for(let _t=pt+1;_t0;_t-=_t&-_t)Nt+=Je[_t];return Nt}function nt(Je){ve.value=Je;const pt=new Array(Je+1).fill(0),Nt=new Array(Je+1).fill(0);for(const[_t,Yt]of Object.entries(te)){const $t=Number(_t),pn=Number(Yt);!Number.isFinite($t)||$t<0||$t>=Je||!Number.isFinite(pn)||pn<=0||(tt(pt,$t,pn),tt(Nt,$t,1))}Ne.value=pt,Ue.value=Nt}function ht(Je){if(!Number.isInteger(Je)||Je<0)return!1;const pt=te[Je];if(!Number.isFinite(pt)||pt<=0)return!1;if(delete te[Je],he.total=Math.max(0,he.total-pt),he.count=Math.max(0,he.count-1),ve.value>Je){const Nt=Ne.value,_t=Ue.value;Nt.length&&_t.length&&(tt(Nt,Je,-pt),tt(_t,Je,-1))}return!0}const kt=D(()=>he.count>0?Math.max(12,he.total/he.count):32);return{nodeHeights:te,heightStats:he,heightTreeSize:ve,heightSumTree:Ne,heightKnownTree:Ue,averageNodeHeight:kt,resetHeightMeasurements:Ye,pruneHeightMeasurements:function(Je){if(Je<=0)return void Ye();let pt=0,Nt=0;for(const[_t,Yt]of Object.entries(te)){const $t=Number(_t),pn=Number(Yt);!Number.isFinite($t)||$t<0||$t>=Je||!Number.isFinite(pn)||pn<=0?delete te[$t]:(pt+=pn,Nt++)}he.total=pt,he.count=Nt},rebuildHeightTrees:nt,recordNodeHeight:function(Je,pt,Nt={}){(function(_t,Yt,$t={}){var pn;if(!Number.isFinite(Yt)||Yt<=0)return!1;const vn=te[_t];if(vn&&($t.allowShrink===!1&&Yt_t){const Ln=Ne.value,Mn=Ue.value;if(Ln.length&&Mn.length)if(vn){const Nn=Yt-vn;Nn!==0&&tt(Ln,_t,Nn)}else tt(Ln,_t,Yt),tt(Mn,_t,1)}$t.notify!==!1&&((pn=H.onHeightRecorded)==null||pn.call(H))})(Je,pt,Hn(Ht({},Nt),{notify:!0}))},removeNodeHeight:function(Je,pt={}){var Nt;const _t=ht(Je);return _t&&pt.notify!==!1&&((Nt=H.onHeightRecorded)==null||Nt.call(H)),_t},removeNodeHeights:function(Je,pt={}){var Nt;let _t=0;for(const Yt of Je)ht(Number(Yt))&&_t++;return _t>0&&pt.notify!==!1&&((Nt=H.onHeightRecorded)==null||Nt.call(H)),_t},exportHeightCache:function(){return Object.entries(te).map(([Je,pt])=>({index:Number(Je),height:Number(pt)})).filter(Je=>Number.isFinite(Je.index)&&Je.index>=0&&Number.isFinite(Je.height)&&Je.height>0).sort((Je,pt)=>Je.index-pt.index)},importHeightCache:function(Je,pt={}){var Nt;if(!Array.isArray(Je))return;const _t=ve.value;let Yt=!1;if(pt.mode!=="merge"){const $t=Object.keys(te);if($t.length>0){for(const pn of $t)delete te[Number(pn)];Yt=!0}}for(const $t of Je){const pn=Number($t.index),vn=Number($t.height);if(!Number.isInteger(pn)||pn<0||_t>0&&pn>=_t||!Number.isFinite(vn)||vn<=0)continue;const Ln=te[pn];Ln&&Math.abs(Ln-vn)<=1||(te[pn]=vn,Yt=!0)}Yt&&((function(){let $t=0,pn=0;const vn=ve.value;for(const[Ln,Mn]of Object.entries(te)){const Nn=Number(Ln),Qn=Number(Mn);!Number.isFinite(Nn)||Nn<0||vn>0&&Nn>=vn||!Number.isFinite(Qn)||Qn<=0?delete te[Nn]:($t+=Qn,pn++)}he.total=$t,he.count=pn})(),_t>0&&nt(_t),(Nt=H.onHeightRecorded)==null||Nt.call(H))},fenwickRangeSum:function(Je,pt,Nt){if(Nt<=pt)return 0;const _t=bt(Je,Nt-1);return pt<=0?_t:_t-bt(Je,pt-1)}}})({onHeightRecorded:()=>{Ro(),Bn.value&&dg(),ws.value&&jo(),Ci.value&&Dp(),Co("node-resize")}});function Qe(H){Number.isInteger(H)&&H>=0&&bn.add(H)}function rt(H){for(const te of H)Qe(Number(te))}function me(H){Ji++;let te=!0;try{const he=H();return te=he!==!1,he}finally{Ji--,Ji===0&&te&&Do.value++}}function Ce(){at=[],et=[],wt=-1,bn.clear(),Et.value=bs}function Ge(){Ce(),me(()=>mr()),Yi.clear()}function Ft(H){!Number.isInteger(H)||H<0||H>=ze.value.length||Yi.set(H,eg(H))}function Bt(H,te,he={}){const ve=Ho[H];Qe(H),yc(H,te,he);const Ne=Ho[H];return Object.is(ve,Ne)?(bn.delete(H),!1):(Ne&&Ne>0?Ft(H):ve&&Yi.delete(H),!0)}function Qt(H,te){const he=st("getNodeLayoutHeight.slot.offsetHeight",()=>{var ve,Ne;return(Ne=(ve=Qi.get(H))==null?void 0:ve.offsetHeight)!=null?Ne:0});return he>0?he:st("getNodeLayoutHeight.content.offsetHeight",()=>te.offsetHeight)}function mn(H,te={}){te.mode!=="merge"?Ce():rt(H.map(he=>he.index)),me(()=>Re(H,te)),S3()}const on=D(()=>ll.value&&ta.value),Dn=D(()=>{var H;return!Q.value&&I.batchRendering!==!1&&Ir.value>0&&((H=I.maxLiveNodes)!=null?H:0)<=0}),gi=D(()=>!Q.value&&Ze&&Oe.value===!0&&!An.value&&!Sn.value&&!ni.value&&!on.value&&!Dn.value),ii=D(()=>!!so&&on.value),Jo=D(()=>An.value||Bn.value),{focusIndex:Xo,liveRange:lo,updateLiveRange:Oo}=(function(H,te){const{parsedNodeCount:he,virtualizationEnabled:ve,maxLiveNodesResolved:Ne,liveNodeBufferResolved:Ue,clamp:Ye}=te,tt=Ue??D(()=>{var ht;return Math.max(0,(ht=H.liveNodeBuffer)!=null?ht:60)}),bt=q(0),nt=Ki({start:0,end:0});return{liveNodeBufferResolved:tt,focusIndex:bt,liveRange:nt,updateLiveRange:function(){const ht=he.value;if(!ve.value||ht===0)return nt.start=0,void(nt.end=ht);const kt=Math.min(Ne.value,ht),Je=tt.value,pt=Ye(bt.value-Je,0,Math.max(0,ht-kt));nt.start=pt,nt.end=Math.min(ht,pt+kt)}}})(I,{parsedNodeCount:wi,virtualizationEnabled:An,maxLiveNodesResolved:qr,liveNodeBufferResolved:Lo,clamp:Wo}),ao=new Map,Lr=new Map,tr=new Map,eu=[],es=new Map,vi=new Set,xa=q(0);let gr=!1;const Sa=D(()=>(xa.value,vi.size)),vr=new Map,ul=new Map,Wf=q(0),Lu=D(()=>{Wf.value;let H=0;for(const te of vr.values())H+=Math.max(0,te);return H});let nr=null;const hd=D(()=>{if(!An.value)return ze.value.length;const H=Lo.value,te=Math.max(lo.end+H,Js.value),he=Math.min(ze.value.length,te);return Math.max(us.value,he)});function kc(){gr||(gr=!0,queueMicrotask(()=>{gr=!1,xa.value+=1}))}function Se(H,te,he="node-resize"){if(!Z||typeof window>"u")return null;const ve=window.setTimeout(()=>{vi.delete(ve)&&kc();try{te()}finally{Co(he)}},Math.max(0,H));return vi.add(ve),kc(),ve}function We(H){Z&&H!=null&&(vi.delete(H)&&kc(),window.clearTimeout(H))}function vt(){if(Z&&typeof window<"u")for(const H of vi)window.clearTimeout(H);vi.size&&(vi.clear(),kc()),eu.length=0,tr.clear()}function Kt(H){O.value=H}function _n(H){B.value=H}function Un(H){j.value=H}const{cancelScheduledFocusSync:li,scheduleFocusSync:ai}=(function(H){const{isClient:te,containerRef:he,virtualizationEnabled:ve,requestFrame:Ne,cancelFrame:Ue,syncFocusToScroll:Ye}=H;let tt=null;function bt(){var ht,kt,Je;return(Je=(kt=(ht=he.value)==null?void 0:ht.ownerDocument)==null?void 0:kt.defaultView)!=null?Je:typeof window<"u"?window:null}function nt(){if(!tt)return;const ht=bt();tt.viaTimeout?ht?ht.clearTimeout(tt.id):clearTimeout(tt.id):Ue?.(tt.id),tt=null}return{cancelScheduledFocusSync:nt,scheduleFocusSync:function(ht={}){if(!ve.value)return;if(!te)return void Ye(!0);if(ht.immediate)return nt(),void Ye(!0);if(tt)return;const kt=()=>{tt=null,Ye()};if(Ne)return void(tt={id:Ne(kt),viaTimeout:!1});const Je=bt();tt={id:Je?Je.setTimeout(kt,16):setTimeout(kt,16),viaTimeout:!0}}}})({isClient:Z,containerRef:F,virtualizationEnabled:An,requestFrame:Wi,cancelFrame:Ni,syncFocusToScroll:function(H=!1){var te;if(!An.value)return;const he=ko.value||le();if(!he)return;const ve=he.ownerDocument||((te=F.value)==null?void 0:te.ownerDocument)||document,Ne=ve?.defaultView||(typeof window<"u"?window:null),Ue=he===ve?.documentElement||he===ve?.body,Ye=ze.value.length;if(Ye<=0)return;if(!Ue&&Ye>0&&se(he)){const _t=st("syncFocusToScroll.clientHeight",()=>he.clientHeight||0),Yt=st("syncFocusToScroll.scrollTop",()=>he.scrollTop),$t=Yt<0?-Yt:Yt;return void _p(Wo((tt=Math.max(0,$t)+.5*Math.max(0,_t),bo.estimateIndexForOffsetFromEnd(tt)),0,Math.max(0,Ye-1)),H)}var tt;const bt=(function(_t,Yt,$t,pn){const vn=F.value;if(!vn)return null;const Ln=pn?0:st("syncFocusToScroll.model.root.getBoundingClientRect",()=>_t.getBoundingClientRect().top),Mn=st("syncFocusToScroll.model.container.getBoundingClientRect",()=>vn.getBoundingClientRect().top),Nn=Math.max(0,Ln-Mn),Qn=pn?st("syncFocusToScroll.model.viewport.clientHeight",()=>{var Jn,Xi,Nr,kr;return(kr=(Nr=(Xi=$t?.innerHeight)!=null?Xi:(Jn=Yt.documentElement)==null?void 0:Jn.clientHeight)!=null?Nr:_t.clientHeight)!=null?kr:0}):st("syncFocusToScroll.model.root.clientHeight",()=>_t.clientHeight);return Wo(Zr(Nn+.5*Math.max(0,Qn)),0,Math.max(0,ze.value.length-1))})(he,ve,Ne,Ue);if(bt!=null)return void _p(bt,H);const nt=Ue?null:st("syncFocusToScroll.root.getBoundingClientRect",()=>he.getBoundingClientRect()),ht=Ue?0:nt.top,kt=Ue?st("syncFocusToScroll.viewport.clientHeight",()=>{var _t,Yt;return(Yt=(_t=Ne?.innerHeight)!=null?_t:he.clientHeight)!=null?Yt:0}):nt.bottom,Je=zo.value;let pt=null,Nt=null;for(const[_t,Yt]of Je){if(!Yt)continue;const $t=st("syncFocusToScroll.slot.getBoundingClientRect",()=>Yt.getBoundingClientRect());$t.bottom<=ht||$t.top>=kt||(pt==null&&(pt=_t),Nt=_t)}if(pt==null||Nt==null){const _t=F.value;if(!_t)return;const Yt=Ue?{top:0}:st("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>he.getBoundingClientRect()),$t=st("syncFocusToScroll.fallback.scrollTop",()=>_e(he,ve,Ue)),pn=Ue?(()=>{const Ln=st("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>_t.getBoundingClientRect()),Mn=(Ue?0:Yt.top)-Ln.top;return Math.max(0,Mn)})():(()=>{const Ln=ge(_t,he);return Math.max(0,$t-Ln)})(),vn=Ue?st("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var Ln,Mn,Nn,Qn;return(Qn=(Nn=(Mn=Ne?.innerHeight)!=null?Mn:(Ln=ve?.documentElement)==null?void 0:Ln.clientHeight)!=null?Nn:he.clientHeight)!=null?Qn:0}):st("syncFocusToScroll.fallback.root.clientHeight",()=>he.clientHeight);return void _p(Wo(Zr(pn+.5*Math.max(0,vn)),0,Math.max(0,ze.value.length-1)),!0)}_p(Math.round((pt+Nt)/2),H)}}),{visibleNodeIndices:Ms,nodeVisibilityHandles:oa,nodeVisibilityWatchStops:Nu,nodeVisibilityFallbackTimers:x2,clearVisibilityFallback:Ap,markNodeVisible:tu,cleanupNodeVisibility:Gm,destroyNodeVisibilityState:xp}=Gbe({isClient:Z,shouldTrackVisibleNodeIndices:()=>on.value,shouldCleanupNodeVisibility:()=>An.value,onNodeMarkedVisible:H=>{An.value?ai():Xo.value=Wo(H,0,Math.max(0,ze.value.length-1))},onNodeVisibilityCleaned:H=>{Qi.delete(H)&&oI()}}),{cleanupScrollListener:Qm,setupScrollListener:Sp}=(function(H){const{isClient:te,virtualizationEnabled:he,listenerEnabled:ve,scrollRootElement:Ne,resolveScrollContainer:Ue,scheduleFocusSync:Ye,onScroll:tt}=H;let bt=null,nt=null;function ht(){bt&&(bt(),bt=null),nt=null,Ne.value=null}function kt(Je){const pt=H.getScrollTop?H.getScrollTop(Je):Je.scrollTop;return Math.max(0,Number.isFinite(pt)?Math.abs(pt):0)}return{cleanupScrollListener:ht,setupScrollListener:function(){if(!te)return;if(!((Je=ve?.value)!=null?Je:he.value))return void ht();var Je;const pt=Ue();if(!pt)return void ht();if(Ne.value===pt&&bt)return;ht(),nt=kt(pt);const Nt=()=>{if(tt?.(),he.value){const _t=(function(Yt){const $t=kt(Yt),pn=nt;nt=$t;const vn=Math.max(480,.75*(Yt.clientHeight||0));return pn==null?$t>vn?{immediate:!0}:void 0:Math.abs($t-pn)>vn?{immediate:!0}:void 0})(pt);_t?Ye(_t):Ye()}};pt.addEventListener("scroll",Nt,{passive:!0}),Ne.value=pt,bt=()=>{pt.removeEventListener("scroll",Nt)}}}})({isClient:Z,virtualizationEnabled:An,listenerEnabled:Jo,scrollRootElement:ko,resolveScrollContainer:le,scheduleFocusSync:ai,onScroll:function(){const H=Ci.value;if(!H)return;const te=Xm();if(!te||(function(ve){if(sg()>=wo)return Fo=null,!1;const Ne=Fo;if(Ne==null)return!0;const Ue=Math.abs(ve.scrollTop-Ne)<=2;return Ue||(Fo=null),Ue})(te))return;const he=V_(te);he!=null?(he<-32||Math.abs(Math.max(0,he)-Math.max(0,H.distanceFromBottomPx))>32)&&Np("restore"):Np("restore")},getScrollTop:H=>{var te;const he=H.ownerDocument||((te=F.value)==null?void 0:te.ownerDocument)||document,ve=H===he.documentElement||H===he.body||H===he.scrollingElement;return st("scrollListener.getScrollTop",()=>_e(H,he,ve))}});function _p(H,te=!1){const he=Wo(H,0,Math.max(0,ze.value.length-1));!te&&Math.abs(he-Xo.value)<=1||(Xo.value=he,Oo())}function Wo(H,te,he){return Math.min(Math.max(H,te),he)}function Ym(H=ze.value.length){const te=At();return!Number.isInteger(te)||te<0?H:Wo(te,0,H)}function Ip(H){return H?.firstElementChild}function S2(H,te){var he;return H?(he=H.matches)!=null&&he.call(H,te)?H:H.querySelector(te):null}function Jm(H,te){H<1||H>6||($[H]=te)}function Ie(){if(!oo.value)return void(ee.value=0);const H=st("updateExperimentContainerWidth.clientWidth",()=>{var te,he;return(he=(te=F.value)==null?void 0:te.clientWidth)!=null?he:0});ee.value=H>0?H:0}let ut=null;function Xe(){ut?.disconnect(),ut=null}const It=n0("ViewportDeferredMarkdownCodeBlockNode",Yu({loader:()=>xo(null,null,function*(){return(yield _s(()=>import("./index5-DEKGWcGw.js"),__vite__mapDeps([6,4,5]))).default}),loadingComponent:Jk,delay:0,suspensible:!1}),Jk);function wn(H){return H===It}const Wn=D(()=>m.value==="pre"?Ol:m.value==="shiki"?It:nw);function Rn(){var H;return((H=I.codeBlockProps)==null?void 0:H.showHeader)!==!1}function zn(H,te,he){const ve=Ho[te],Ne=typeof ve=="number"&&ve>0;if(ri.value&&!Ne&&!(function(Ue){return!!In.value.paragraph&&(Ue.type==="paragraph"||Ue.type==="list_item"||Ue.type==="list")})(H)){const Ue=hq(H,he,ue.value);if(Ue)return Ue}if(ro.value&&H.type==="code_block"){const Ue=(function(Ye){if(Ye.type!=="code_block")return null;const tt=gI(Ye,R2(Ye));return wn(tt)?"markdown":tt===Ol?"pre":tt===Wn.value||tt===nw?"monaco":null})(H);if(Ue==="monaco"||Ue==="markdown"||Ue==="pre")return(function(Ye,tt){var bt,nt,ht;if(!Ye||Ye.type!=="code_block")return null;const kt=tt.rendererKind,Je=kt!=="pre"&&tt.showHeader!==!1,pt=!!Ye.diff;let Nt=0,_t=500;if(kt==="monaco"){const $t=(bt=tt.monacoOptions)!=null?bt:{},pn=dw(Ye,$t,tt.width),vn=(function(Mn){const Nn=typeof Mn?.fontSize=="number"&&Mn.fontSize>0?Mn.fontSize:12;return typeof Mn?.lineHeight=="number"&&Mn.lineHeight>0?Mn.lineHeight:Math.round(1.5*Nn)})($t),Ln=(function(Mn,Nn){var Qn,Jn;const Xi=typeof((Qn=Mn?.padding)==null?void 0:Qn.top)=="number"?Mn.padding.top:Nn?0:8,Nr=typeof((Jn=Mn?.padding)==null?void 0:Jn.bottom)=="number"?Mn.padding.bottom:Nn?0:8;return Math.max(0,Xi)+Math.max(0,Nr)})($t,pt);_t=typeof $t.MAX_HEIGHT=="number"&&$t.MAX_HEIGHT>0?$t.MAX_HEIGHT:500,Nt=Math.round(pn*vn+Ln)}else if(kt==="markdown"){const $t=dw(Ye);Nt=Math.round(21*$t+32)}else{const $t=dw(Ye);Nt=Math.round(28*$t),_t=Number.POSITIVE_INFINITY}const Yt=Math.max(1,Math.min(Nt,_t));return Ht({kind:"code-block",height:Math.round(Yt+(Je?40:0)),contentHeight:Yt,rendererKind:kt},pt&&kt==="monaco"?{diffInline:xx((nt=tt.monacoOptions)!=null?nt:{},(ht=tt.width)!=null?ht:0)}:{})})(H,{rendererKind:Ue,monacoOptions:I.codeBlockMonacoOptions,showHeader:Rn(),width:he})}return null}P1(()=>{if(Do.value,Ji>0)return;const H=ze.value,te=lt();if(!H.length||!Gi.value)return at=[],et=[],wt=-1,bn.clear(),void(Et.value=bs);const he=ee.value||st("estimatedNodeHeights.clientWidth",()=>{var nt;return((nt=F.value)==null?void 0:nt.clientWidth)||0});if(!Number.isFinite(he)||he<=0)return at=[],et=[],wt=-1,bn.clear(),void(Et.value=bs);const ve=(function(nt){return[Math.round(nt),ri.value,ro.value,ue.value,I.codeBlockMonacoOptions,Rn(),m.value,In.value,aw.value]})(he),Ne=at.length<=H.length&&(Ye=ve,(Ue=et).length===Ye.length&&Ue.every((nt,ht)=>Object.is(nt,Ye[ht])));var Ue,Ye;const tt=Ne&&wt===te?H.length:Ne?Ym(H.length):0,bt=Ne?Array.from(bn):[];at.length=H.length;for(let nt=tt;nt=0&&ntEt.value);bo=(function(H){let te=!0,he=[0],ve="";function Ne(ht){var kt;const Je=H.nodeHeights[ht];if(Number.isFinite(Je)&&Je>0)return Je;const pt=H.parsedNodes.value[ht],Nt=pt?.type,_t=!!((kt=H.hasCustomParagraphComponent)!=null&&kt.call(H)),Yt=H.estimatedNodeHeights.value[ht],$t=Yt?.height;if(!(function(vn,Ln,Mn){return!!(Mn&&Ln?.kind==="simple-text"&&(vn==="paragraph"||vn==="list_item"||vn==="list"))})(Nt,Yt,_t)&&Number.isFinite($t)&&$t>0)return $t;const pn=Pbe(pt,H.getContainerWidth()||640);return Nt==="heading"||Nt==="paragraph"&&pn<=28&&(function(vn,Ln){if(Ln)return!1;const Mn=vn.children;return!Array.isArray(Mn)||!Mn.length||Mn.every(mq)})(pt,_t)?pn:Math.max(H.averageNodeHeight.value,pn)}function Ue(){var ht;const kt=H.parsedNodes.value.length,Je=H.getPrefixCacheKeyParts().join(":");if(!te&&ve===Je)return he;const pt=new Array(kt+1);pt[0]=0;for(let Nt=0;Nt=((kt=Nt[pt])!=null?kt:0))return pt-1;let _t=0,Yt=pt-1,$t=pt-1;for(;_t<=Yt;){const pn=_t+Yt>>1;((Je=Nt[pn+1])!=null?Je:0)>=ht?($t=pn,Yt=pn-1):_t=pn+1}return $t}function tt(ht,kt){var Je,pt;if(ht>=kt)return 0;if(H.heightEstimationActive.value)return(function(Yt,$t){var pn,vn;const Ln=H.parsedNodes.value.length,Mn=fD(Math.trunc(Yt),0,Ln),Nn=fD(Math.trunc($t),Mn,Ln);if(Mn>=Nn)return 0;const Qn=Ue();return((pn=Qn[Nn])!=null?pn:0)-((vn=Qn[Mn])!=null?vn:0)})(ht,kt);if(H.heightTreeSize.value!==H.parsedNodes.value.length){let Yt=0;for(let $t=ht;$tMn<=0?0:H.fenwickRangeSum(_t,0,Mn)+(Mn-H.fenwickRangeSum(Yt,0,Mn))*Nt;let pn=0,vn=Je.length-1,Ln=Je.length-1;for(;pn<=vn;){const Mn=pn+vn>>1;$t(Mn+1)>=ht?(Ln=Mn,vn=Mn-1):pn=Mn+1}return Ln}let pt=ht;for(let Nt=0;Nt0||ht++}return ht}return{markFallbackHeightPrefixDirty:function(){te=!0},getFallbackNodeHeight:Ne,estimateHeightRange:tt,estimateIndexForOffset:bt,estimateIndexForOffsetFromEnd:function(ht){var kt,Je;const pt=H.parsedNodes.value;if(!pt.length)return 0;if(ht<=0)return Math.max(0,pt.length-1);if(H.heightEstimationActive.value){const _t=(kt=Ue()[pt.length])!=null?kt:0;return Ye(Math.max(0,_t-ht))}if(H.heightTreeSize.value===pt.length){const _t=tt(0,pt.length);return bt(Math.max(0,_t-ht))}let Nt=ht;for(let _t=pt.length-1;_t>=0;_t--){const Yt=(Je=H.nodeHeights[_t])!=null?Je:H.averageNodeHeight.value;if(Nt<=Yt)return _t;Nt-=Yt}return 0},getEstimatedNodeHeightCount:nt,buildVirtualHeightSummary:function(ht){var kt;const Je=H.parsedNodes.value.length;return{totalNodes:Je,measuredCount:H.heightStats.count,estimatedCount:nt(),averageNodeHeight:H.averageNodeHeight.value,topSpacerHeight:ht.topSpacerHeight,bottomSpacerHeight:ht.bottomSpacerHeight,estimatedTotalHeight:tt(0,Je),width:(kt=ht.width)!=null?kt:H.getContainerWidth()}}}})({parsedNodes:ze,nodeHeights:Ho,heightStats:Cs,heightTreeSize:cs,heightSumTree:Yo,heightKnownTree:vc,averageNodeHeight:Xa,heightEstimationActive:oo,estimatedNodeHeights:Fn,getContainerWidth:hi,hasCustomParagraphComponent:()=>!!In.value.paragraph,getPrefixCacheKeyParts:()=>{var H;const te=Lg(ee.value||st("getFallbackHeightPrefix.clientWidth",()=>{var ve;return((ve=F.value)==null?void 0:ve.clientWidth)||0})),he=((H=i.virtualScroll)==null?void 0:H.measurementKey)==null?"":String(i.virtualScroll.measurementKey);return[ze.value.length,Cs.count,Math.round(Cs.total),Math.round(100*Xa.value),he,te,oo.value?1:0,aw.value,K.value,In.value.paragraph?1:0]},fenwickRangeSum:Ve}),qe(()=>ze.value.length,H=>{var te;Ro(),H<=0?Ge():(HEr(te))),H!==cs.value&&ia(H))},{immediate:!0});const uo=D(()=>{if(!An.value)return ze.value.map((ve,Ne)=>({node:ve,index:Ne}));const H=ze.value.length,te=Wo(lo.start,0,H),he=Wo(lo.end,te,H);return ze.value.slice(te,he).map((ve,Ne)=>({node:ve,index:te+Ne}))}),yr=D(()=>An.value?er(0,Math.min(lo.start,ze.value.length)):0),Tl=D(()=>{if(!An.value)return 0;const H=ze.value.length;return er(Math.min(lo.end,H),H)});function nu(){return bo.buildVirtualHeightSummary({topSpacerHeight:yr.value,bottomSpacerHeight:Tl.value,width:qf()})}function bc(){const H=ze.value,te=nu();return Hn(Ht({},te),{probe:{paragraphReady:!!ue.value.paragraph,listItemReady:!!ue.value.listItem,listWrapperOverhead:ue.value.listWrapperOverhead,headingReadyLevels:Object.entries(ue.value.headings).filter(([,he])=>!!he).map(([he])=>Number(he))},nodes:H.map((he,ve)=>{var Ne,Ue,Ye,tt,bt,nt,ht,kt,Je;return{index:ve,type:he.type,estimateKind:(Ue=(Ne=Fn.value[ve])==null?void 0:Ne.kind)!=null?Ue:null,rendererKind:(tt=(Ye=Fn.value[ve])==null?void 0:Ye.rendererKind)!=null?tt:null,estimatedHeight:(nt=(bt=Fn.value[ve])==null?void 0:bt.height)!=null?nt:null,estimatedContentHeight:(kt=(ht=Fn.value[ve])==null?void 0:ht.contentHeight)!=null?kt:null,measuredHeight:(Je=Ho[ve])!=null?Je:null}})})}function wc(){return i.indexKey!=null?String(i.indexKey):Sn.value?`virtual-${qo()}`:"markdown-renderer"}function z_(H){const te=String(H),he=`${wc()}-`;if(!te.startsWith(he))return null;const ve=te.slice(he.length).match(/^(\d+)(?:$|-)/);if(!ve)return null;const Ne=Number(ve[1]);return!Number.isInteger(Ne)||Ne<0||Ne>=ze.value.length?null:Ne}function qo(){var H,te,he;const ve=(H=i.virtualScroll)==null?void 0:H.sessionKey;return String(ve!=null&&ve!==""?ve:(he=(te=i.indexKey)!=null?te:I.customId)!=null?he:Tt)}function Ts(){var H;const te=(H=i.virtualScroll)==null?void 0:H.threadKey;return te==null||te===""?void 0:String(te)}const UQ=D(()=>{var H,te,he;return(he=Ts())!=null?he:String((te=(H=i.indexKey)!=null?H:I.customId)!=null?te:Tt)});function u3(H){var te;return(H??"")===((te=Ts())!=null?te:"")}function Cc(){var H,te,he;return te=(H=i.virtualScroll)==null?void 0:H.measurementKey,he=(function(){const ve=m.value;return(function(Ne){var Ue,Ye;const tt=Ne.renderer,bt=tt==="monaco"?Ne.codeBlockMonacoOptions:void 0,nt=Ne.codeBlockProps,ht=tt==="shiki";return[Ne.isDark?"dark":"light",tt==="monaco"?"code-rich":tt==="pre"?"code-pre":"code-shiki",Ne.codeBlockStream===!1?"code-static":"code-stream",br(Ne.codeBlockMinWidth),br(Ne.codeBlockMaxWidth),...ht?[Mye((Ue=nt?.themes)!=null?Ue:Ne.themes,(Ye=nt?.langs)!=null?Ye:Ne.langs)]:[],br(bt?.fontSize),br(bt?.lineHeight),br(bt?.fontFamily),br(bt?.tabSize),br(bt?.MAX_HEIGHT),br(bt?.wordWrap),br(bt?.wrappingIndent),br(bt?.padding),br(nt?.showHeader),br(nt?.showCopyButton),br(nt?.showExpandButton),br(nt?.showPreviewButton),br(nt?.showCollapseButton),br(nt?.showFontSizeButtons)].join("\0")})({renderer:ve,isDark:I.isDark,codeBlockStream:I.codeBlockStream,codeBlockMinWidth:I.codeBlockMinWidth,codeBlockMaxWidth:I.codeBlockMaxWidth,codeBlockMonacoOptions:ve==="monaco"?I.codeBlockMonacoOptions:void 0,codeBlockProps:I.codeBlockProps,themes:ve==="shiki"?I.themes:void 0,langs:ve==="shiki"?I.langs:void 0})})(),[te==null?"":String(te),he].join("\0")}function qf(){return hi()}const _2=D(()=>Lg(qf())),sa=D(()=>[Cc(),_2.value].join("\0")),VQ=D(()=>{var H;return Sn.value?["virtual",(H=Ts())!=null?H:"",qo(),sa.value].join("\0"):i.indexKey});function Mp(){Wf.value+=1}function c3(H){return!(!H||!Number.isInteger(H.index)||H.index<0||H.index>=ze.value.length||H.sessionKey!==qo()||H.threadKey!==Ts()||H.layoutEpochKey!==sa.value)}function j_(H){const te=String(H),he=ul.get(te);return he?c3(he)?he.index:null:z_(te)}function H_(H="async-node"){(vr.size||ul.size)&&(vr.clear(),ul.clear(),Mp(),Co(H))}const Tp=rn(cA,null),d3={reportHeight(H,te){if(!Bn.value)return;const he=j_(H);if(he==null)return;const ve=ao.get(he);if(!ve)return;const Ne=Number(te),Ue=Qt(he,ve);(function(Ye,tt,bt={}){me(()=>Bt(Ye,tt,bt))})(he,Number.isFinite(Ne)&&Ne>0?Math.max(Ne,Ue||0):Ue)},markPending(H){if(!Bn.value)return;const te=z_(H);te!=null&&(function(he,ve){var Ne;const Ue=ul.get(he);if(Ue&&c3(Ue))return vr.set(he,Math.max(0,(Ne=vr.get(he))!=null?Ne:0)+1),Mp(),void Co("async-node");vr.set(he,1),ul.set(he,(function(Ye){return{index:Ye,sessionKey:qo(),threadKey:Ts(),layoutEpochKey:sa.value}})(ve)),Mp(),Co("async-node")})(String(H),te)},markSettled(H){if(!Bn.value)return;const te=String(H),he=j_(H);(he!=null||(function(ve){return vr.has(String(ve))})(te))&&(function(ve){var Ne;const Ue=(Ne=vr.get(ve))!=null?Ne:0;return!(Ue<=0||(Ue<=1?(vr.delete(ve),ul.delete(ve)):vr.set(ve,Ue-1),Mp(),Ue===1&&Co("async-node"),0))})(te)&&he!=null&&Ac()}};function KQ(){let H=0;for(const te of ao.values())H+=st("getVisibleDomHeight.offsetHeight",()=>{var he;return(he=te?.offsetHeight)!=null?he:0});return Math.ceil(Math.max(0,H))}ui(cA,{reportHeight(H,te){d3.reportHeight(H,te),Tp?.reportHeight(H,te)},markPending(H){d3.markPending(H),Tp?.markPending(H)},markSettled(H){d3.markSettled(H),Tp?.markSettled(H)}});let f3,h3=null,Ep=null;function I2(H){return H!==!1&&H!=null&&H!==""}function W_(){return An.value?(function(){if(!An.value)return!0;const H=ze.value.length,te=Wo(lo.start,0,H),he=Wo(lo.end,te,H);if(te>=he)return!0;for(let ve=te;ve=hd.value}function p3(){return Oe.value===!0&&!ct.value&&Lu.value===0&&vi.size===0&&es.size===0&&nr==null&&W_()}function q_(){var H,te;if(((H=i.virtualScroll)==null?void 0:H.settleMode)!=="manual"||h3===qo()&&f3===Ts())return!0;const he=(te=i.virtualScroll)==null?void 0:te.settledToken;return!!I2(he)&&Ep===fg(he)}function m3(){return p3()&&q_()}function ZQ(H,te){return te.totalNodes<=0?H==="final"?"final":"estimate":te.measuredCount>=te.totalNodes?H==="final"?"final":"measured":te.measuredCount>0||te.estimatedCount>0?"mixed":"estimate"}function Uf(H="manual",te){const he=nu(),ve=(function(Ne){return Ne||(Oe.value!==!0?ze.value.length>0?"streaming":"estimating":!W_()||es.size>0||nr!=null?"measuring":m3()?"settled":"settling")})(te);return{sessionKey:qo(),threadKey:Ts(),phase:ve,nodeCount:he.totalNodes,liveRange:{start:lo.start,end:lo.end},renderedCount:us.value,measuredCount:he.measuredCount,estimatedCount:he.estimatedCount,averageNodeHeight:he.averageNodeHeight,topSpacerHeight:he.topSpacerHeight,bottomSpacerHeight:he.bottomSpacerHeight,visibleDomHeight:KQ(),totalHeight:U_(),width:he.width,final:Oe.value===!0,stable:m3(),confidence:ZQ(ve,he),reason:H}}function Xm(){const H=ko.value||le(),te=F.value;if(!H||!te)return null;const he=H.ownerDocument||te.ownerDocument||document,ve=H===he.documentElement||H===he.body||H===he.scrollingElement,Ne=st("getScrollBox.scrollTop",()=>_e(H,he,ve)),Ue=st("getScrollBox.scrollHeight",()=>{var tt,bt,nt,ht,kt;return ve?Math.max((bt=(tt=he.documentElement)==null?void 0:tt.scrollHeight)!=null?bt:0,(ht=(nt=he.body)==null?void 0:nt.scrollHeight)!=null?ht:0,(kt=H.scrollHeight)!=null?kt:0):H.scrollHeight}),Ye=st("getScrollBox.clientHeight",()=>{var tt;return ve?((tt=he.documentElement)==null?void 0:tt.clientHeight)||H.clientHeight||0:H.clientHeight});return{root:H,doc:he,isViewportRoot:ve,scrollTop:Ne,scrollHeight:Ue,clientHeight:Ye}}function U_(){const H=ze.value.length,te=Math.max(0,er(0,H)),he=st("getRendererLogicalHeight.offsetHeight",()=>{var Ne,Ue;return(Ue=(Ne=F.value)==null?void 0:Ne.offsetHeight)!=null?Ue:0}),ve=Math.max(0,he>0?he:st("getRendererLogicalHeight.scrollHeight",()=>{var Ne,Ue;return(Ue=(Ne=F.value)==null?void 0:Ne.scrollHeight)!=null?Ue:0}));return H<=0?Math.ceil(he):An.value?te>0?Math.max(1,Math.ceil(te),(function(){let Ne=yr.value+Tl.value;for(const Ue of Qi.values())Ue&&(Ne+=Math.max(0,st("getVirtualizedDomLogicalHeight.offsetHeight",()=>Ue.offsetHeight||0)));return Math.ceil(Math.max(0,Ne))})(),(function(Ne,Ue){return Ne<=0||Ue<=0?0:Ue<=Ne+Math.max(512,.05*Ne)?Math.ceil(Ue):0})(te,ve)):Math.max(1,Math.ceil(ve)):Bn.value?te>0||Cs.count>0||bo.getEstimatedNodeHeightCount()>0?(pr.value&&us.value,Math.max(1,Math.ceil(ve),Math.ceil(te))):Math.ceil(ve):Math.max(1,Math.ceil(ve),Math.ceil(te))}function V_(H){const te=F.value;if(!te)return null;const he=st("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>te.getBoundingClientRect());return(function(Ne){return Ne.isViewportRoot?Ne.clientHeight:st("getViewportBottomInRoot.getBoundingClientRect",()=>Ne.root.getBoundingClientRect().bottom)})(H)-he.bottom}function GQ(H={}){const te=H.requireViewport!==!1,he=(function(Ue=64){const Ye=Xm(),tt=F.value;if(!Ye||!tt)return!1;const bt=(function(ht){if(ht.isViewportRoot)return{top:0,bottom:ht.clientHeight};const kt=st("getVirtualViewportRect.getBoundingClientRect",()=>ht.root.getBoundingClientRect());return{top:kt.top,bottom:kt.bottom}})(Ye),nt=st("isRendererNearVirtualViewport.getBoundingClientRect",()=>tt.getBoundingClientRect());return nt.bottom>=bt.top-Ue&&nt.top<=bt.bottom+Ue})();if(te&&!he)return null;const ve=(function(){const Ue=Xm(),Ye=F.value;if(!Ue||!Ye||Math.max(0,Ue.scrollHeight-Ue.scrollTop-Ue.clientHeight)>64)return null;const tt=V_(Ue);return tt==null?null:tt>=-8&&tt<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,tt)}:null})();if(ve)return{anchor:ve,captured:!0};const Ne=Gr();if(Ne)return{anchor:{type:"node",nodeIndex:Ne.nodeIndex,offsetWithinNodePx:Ne.offsetWithinNodePx},captured:he};if(H.allowFallback===!0){const Ue=(function(){const Ye=ze.value.length;return Ye<=0?null:{type:"node",nodeIndex:Wo(Xo.value,0,Math.max(0,Ye-1)),offsetWithinNodePx:0}})();return Ue?{anchor:Ue,captured:!1}:null}return null}function g3(H){let te=2166136261;for(let he=0;he>>0).toString(36)}function QQ(H,te){let he=H;for(let ve=0;ve8192?`${ve.slice(0,8192)}...${ve.length}`:ve;return`${ve.length}:${g3(Ne)}`})(H)}`;if(typeof H=="function")return"fn";if(typeof H!="object")return typeof H;if(te.has(H))return"cycle";if(he>=6)return"max-depth";te.add(H);try{if(Array.isArray(H)){if(H.length<=160){const nt=[];for(let ht=0;ht=tt&&Ye.push(ht)}return[`a:${H.length}`,`h=${Ue.join(",")}`,`t=${Ye.join(",")}`,`all=${(bt>>>0).toString(36)}`].join(":")}const ve=H,Ne=Object.keys(ve).filter(Ue=>{const Ye=ve[Ue];return Ue!=="parent"&&Ue!=="el"&&Ue!=="component"&&(Ye==null||typeof Ye=="string"||typeof Ye=="number"||typeof Ye=="boolean"||YQ.has(Ue))}).sort();return`o:${Ne.length}:${Ne.map(Ue=>`${Ue}=${M2(ve[Ue],te,he+1)}`).join(";")}`}finally{te.delete(H)}}let v3=-1,y3="",Vf=[2166136261];function eg(H){const te=ze.value[H];return te?g3(M2(te)):""}function JQ(H,te){let he=H;for(let ve=0;ve>>0}function k3(){var H,te;const he=K.value;if(v3===he)return y3;const ve=ze.value.length;let Ne=Ym(ve);(v3!==he-1||Ne>ve||Vf.length>>0).toString(36),v3=he,y3}function Lp(H,te={}){var he;const ve=te.includeHeightCache===!0,Ne=(he=te.includeContentHash)!=null?he:ve,Ue=ve?(function(tt){const bt=(function(){var _t,Yt;const $t=Number((Yt=(_t=i.virtualScroll)==null?void 0:_t.heightCacheLimit)!=null?Yt:5e3);return!Number.isFinite($t)||$t<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc($t))})();if(!Number.isFinite(bt)||tt.length<=bt)return tt;const nt=new Map,ht=_t=>{!_t||nt.size>=bt||nt.set(_t.index,_t)},kt=ze.value.length,Je=Wo(lo.start-2*Lo.value,0,kt),pt=Wo(lo.end+2*Lo.value,Je,kt);for(const _t of tt)_t.index>=Je&&_t.index=0&&nt.size_t.index-Yt.index).slice(0,bt)})(we().map(tt=>{var bt;const nt=ze.value[tt.index];return nt?Hn(Ht({},tt),{nodeType:String((bt=nt.type)!=null?bt:""),signature:eg(tt.index)}):null}).filter(tt=>!!tt)):[],Ye=GQ({allowFallback:te.allowAnchorFallback===!0,requireViewport:te.requireViewport});return Ye||Ue.length||te.includeEmptyState===!0?Hn(Ht({sessionKey:H.sessionKey,threadKey:H.threadKey},Ye?{anchor:Ye.anchor,anchorCaptured:Ye.captured}:{anchorCaptured:!1}),{metrics:H,width:H.width,contentHash:Ne?k3():void 0,measurementKey:Cc()||void 0,heightCache:Ue.length?Ue:void 0}):null}function b3(H){var te,he;const ve=Xm();if(!ve)return;const Ne=(function(tt){const bt=F.value;if(!bt)return null;const nt=ge(bt,tt.root),ht=ze.value.length,kt=st("getRendererBottomOffsetWithinRoot.offsetHeight",()=>bt.offsetHeight||0),Je=Math.max(0,kt>0?kt:ht>0?st("getRendererBottomOffsetWithinRoot.scrollHeight",()=>bt.scrollHeight||0):0),pt=U_();return nt+Math.max(Je,pt)})(ve);if(Ne==null)return;const Ue=Math.max(0,H.distanceFromBottomPx),Ye=Math.max(0,Ne-ve.clientHeight-Ue);(function(tt){wo=sg()+120,Fo=tt})(Ye),ve.isViewportRoot?(he=(te=ve.doc.defaultView)==null?void 0:te.scrollTo)==null||he.call(te,0,Ye):uD(ve.root,ve.doc,Ye,{isReverseFlexScrollRoot:se,getNormalizedScrollTop:_e})}const w3=[];function K_(){if(Z)for(Xs!=null&&(Ni?.(Xs),Xs=null);w3.length;){const H=w3.pop();H!=null&&window.clearTimeout(H)}}function Np(H){const te=!!Ci.value;Ci.value=null,wo=0,Fo=null,K_(),te&&H&&Co(H)}function Dp(){if(!Ci.value||!Z||Xs!=null)return;const H=()=>{Xs=null;const te=Ci.value;te&&b3(te)};Xs=Wi?Wi(H):null,Xs==null&&H()}function Z_(H,te={}){const he=ze.value.length;return he<=0?[]:H.filter(ve=>!(!Number.isInteger(ve.index)||ve.index<0||ve.index>=he)&&!(!Number.isFinite(ve.height)||ve.height<=0)&&!(te.requireSignature&&!ve.signature)&&!(te.requireCompatibilityMetadata&&!ve.nodeType&&!ve.signature)&&(function(Ne){var Ue;const Ye=ze.value[Ne.index];return!(!Ye||Ne.nodeType&&Ne.nodeType!==String((Ue=Ye.type)!=null?Ue:"")||Ne.signature&&Ne.signature!==eg(Ne.index))})(ve))}function G_(H){const te=Lg(qf()),he=Lg(H);return te!==-1&&he!==-1&&te===he}function C3(H){var te;const he=Number(H?.width);if(Number.isFinite(he)&&he>0)return he;const ve=Number((te=H?.metrics)==null?void 0:te.width);return Number.isFinite(ve)&&ve>0?ve:null}function Q_(H){var te;return H.sessionKey===qo()&&!!u3(H.threadKey)&&((te=H.measurementKey)!=null?te:"")===Cc()&&!!G_(C3(H))&&!!(function(he){const ve=he.heightCache;return!!ve?.length&&(Y_(he)?ve.some(Ne=>!!(Ne.nodeType||Ne.signature)):ve.some(Ne=>!!Ne.signature))})(H)}function Y_(H){return!!(H.contentHash&&H.contentHash===k3())}function XQ(H){return!Y_(H)}let Kf=null,Zf=null,T2=null,tg=null,ng=null;function A3(H){var te;const he=H.map(Ne=>{var Ue,Ye;return[Ne.index,Math.round(10*Ne.height),(Ue=Ne.nodeType)!=null?Ue:"",(Ye=Ne.signature)!=null?Ye:""].join("")}).join(""),ve=Lg(qf());return[(te=Ts())!=null?te:"",qo(),Cc(),ze.value.length,ve,H.length,g3(he)].join(":")}function J_(H=(te=>(te=i.virtualScroll)==null?void 0:te.heightCache)()){if(!Bn.value||!H?.length||ze.value.length<=0||!G_((te=i.virtualScroll)==null?void 0:te.heightCacheWidth))return!1;var te;const he=Z_(H,{requireSignature:!0});if(!he.length)return!1;const ve=A3(he);return ve===Kf?(Zf="standalone",!0):(mn(he,{mode:"merge"}),Ro(),Kf=ve,Zf="standalone",lg(),Co("restore"),!0)}function x3(H,te={}){var he,ve,Ne;if(!Bn.value||!H||H.sessionKey!==qo()||!u3(H.threadKey)||ze.value.length<=0)return!1;const Ue=!!((he=H.heightCache)!=null&&he.length)&&!E2(),Ye=!H.anchor||H.anchorCaptured===!1&&te.allowUncapturedAnchor!==!0?null:H.anchor,tt=te.restoreAnchor===!0&&!!Ye&&!E2()&&Number(C3(H))>0;let bt=!1;if((ve=H.heightCache)!=null&&ve.length&&Q_(H)){const ht=Z_(H.heightCache,{requireCompatibilityMetadata:!H.contentHash,requireSignature:XQ(H)});ht.length&&(mn(ht,{mode:"merge"}),Ro(),Kf=A3(ht),Zf="restore",lg(),bt=!0)}if(Ue||tt)return!1;if(!te.restoreAnchor||!Ye)return bt&&Co("restore"),!0;const nt=(function(ht,kt){var Je;const pt=ht.anchor,Nt=pt?pt.type==="bottom"?`bottom:${Math.round(pt.distanceFromBottomPx)}`:`node:${pt.nodeIndex}:${Math.round(pt.offsetWithinNodePx)}`:"none";return[(Je=Ts())!=null?Je:"",qo(),Cc(),_2.value,kt,Nt].join(":")})(H,(Ne=te.restoreToken)!=null?Ne:"imperative");return T2===nt?(bt&&Co("restore"),!0):(T2=nt,(function(ht){const kt=()=>{if(ht.type==="node")return Np(),void Tr({nodeIndex:ht.nodeIndex,offsetWithinNodePx:ht.offsetWithinNodePx});if(Il(),ws.value=null,Ci.value=ht,K_(),b3(ht),Z)for(const Je of[0,120,280,480])w3.push(window.setTimeout(()=>{const pt=Ci.value;pt&&b3(pt)},Je))};(function(Je){if(!An.value)return!1;const pt=ze.value.length;return!(pt<=0||(Xo.value=Je.type==="node"?Wo(Je.nodeIndex,0,pt-1):pt-1,Oo(),0))})(ht)?mt(kt):kt()})(Ye),Co("restore"),!0)}function E2(){const H=qf();return Number.isFinite(H)&&H>0}function X_(H){var te;return H.sessionKey===qo()&&!!u3(H.threadKey)&&(ze.value.length<=0||!(!((te=H.heightCache)!=null&&te.length)||E2())||!(!(H.anchor&&Number(C3(H))>0)||E2()))}function S3(){Yi.clear();for(const H of Object.keys(Ho)){const te=Number(H);Number.isInteger(te)&&te>=0&&te{let te=!1,he=null;const ve=()=>{te||(te=!0,he!=null&&window.clearTimeout(he),H())};if(Wi)return Wi(ve),void(he=window.setTimeout(ve,50));he=window.setTimeout(ve,0)})}function _3(H,te=Ts(),he=sa.value){return qo()===H&&Ts()===te&&sa.value===he}function I3(){return xo(this,arguments,function*(H={}){var te,he,ve,Ne,Ue;const Ye=qo(),tt=Ts(),bt=sa.value,nt=(te=H.frames)!=null?te:2,ht=(he=H.timeoutMs)!=null?he:120,kt=(ve=H.reason)!=null?ve:"manual",Je=H.expectedSettledTokenKey,pt=H.flushPendingTimers===!0,Nt=Uf(kt),_t=()=>Hn(Ht({},Nt),{phase:Nt.final?"settling":Nt.phase,stable:!1,confidence:Nt.confidence==="final"?"mixed":Nt.confidence,reason:kt}),Yt=()=>_3(Ye,tt,bt)&&(Je==null||rg()===Je);for(let Ln=0;Lnwindow.setTimeout(Mn,Ln))})(ht),!Yt()||(pt&&vt(),Ac(),ig(),!Yt()))return _t();const $t=p3();$t&&(h3=Ye,f3=tt,((Ne=i.virtualScroll)==null?void 0:Ne.settleMode)==="manual"&&Je!=null&&I2((Ue=i.virtualScroll)==null?void 0:Ue.settledToken)&&rg()===Je&&(Ep=fg(i.virtualScroll.settledToken)));const pn=Yt()&&$t&&q_(),vn=Uf(kt,pn?"final":void 0);return N3(vn,!0),vn})}let M3="content",Gf=null,Qf=null,T3=0,og=null,Fp=null,E3=null,L3=null;function sg(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function tI(H){var te,he;const ve=og;if(!ve)return!0;const Ne=(he=(te=i.virtualScroll)==null?void 0:te.heightDiffThresholdPx)!=null?he:1;return Math.abs(H.totalHeight-ve.totalHeight)>Ne||H.sessionKey!==ve.sessionKey||H.phase!==ve.phase||H.stable!==ve.stable||H.final!==ve.final||H.threadKey!==ve.threadKey||H.nodeCount!==ve.nodeCount||H.measuredCount!==ve.measuredCount||H.width!==ve.width}function rg(H=(te=>(te=i.virtualScroll)==null?void 0:te.settledToken)()){return br(H)}function nI(H,te){var he,ve;return[H,te.sessionKey,(he=te.threadKey)!=null?he:"",Cc(),k3(),br((ve=i.virtualScroll)==null?void 0:ve.settledToken),Math.round(te.totalHeight),Math.round(te.width)].join("\0")}function lg(){E3=null,L3=null,Fp=null}function eY(H){const te=H.heightCache;return te?.length?A3(te):""}function ag(H){var te,he,ve;const Ne=H.metrics,Ue=H.anchor?(Ye=H.anchor).type==="bottom"?`bottom:${Math.round(Ye.distanceFromBottomPx)}`:`node:${Ye.nodeIndex}:${Math.round(Ye.offsetWithinNodePx)}`:"none";var Ye;return[H.sessionKey,(te=H.threadKey)!=null?te:"",(he=H.measurementKey)!=null?he:Cc(),(ve=H.contentHash)!=null?ve:"",eY(H),Ue,H.anchorCaptured?1:0,Ne.liveRange.start,Ne.liveRange.end,Ne.renderedCount,Ne.nodeCount,Math.round(Ne.totalHeight),Math.round(Ne.width),Ne.phase,Ne.stable?1:0].join("\0")}function N3(H,te=!1){if(!Bn.value||(function(Ye=!1){return!Ye&&Sn.value&&!io.value})(te))return;const he=te||tI(H),ve=(function(Ye,tt=!1){return tt||Ye.stable||Ye.phase==="final"?{state:Lp(Ye,{includeHeightCache:!0})}:{state:Lp(Ye)}})(H,te),Ne=ve.state,Ue=!!(Ne&&(he||(function(Ye,tt=!1){return!!tt||ag(Ye)!==Fp})(Ne,te)));if(he&&(R(H),og=H,T3=sg()),Ne&&Ue&&(W(Ne),Ne.anchor&&z(Ne.anchor),Fp=ag(Ne)),H.stable){const Ye=nI("settled",H);if(Ye!==E3){E3=Ye;const tt=Lp(H,{includeHeightCache:!0});tt&&(W(tt),Fp=ag(tt)),(function(bt){o("render-settled",bt)})(H)}}if(H.phase==="final"){const Ye=nI("final",H);if(Ye!==L3){L3=Ye;const tt=Lp(H,{includeHeightCache:!0});tt&&(W(tt),Fp=ag(tt)),(function(bt){o("render-final",bt)})(H)}}}function D3(){Gf!=null&&(Ni?.(Gf),Gf=null),Qf!=null&&Z&&(window.clearTimeout(Qf),Qf=null)}function iI(){Gf=null,Qf=null,(function(H){if(es.size>0||nr!=null)return!0;switch(H){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(M3)&&(Ac(),ig()),N3(Uf(M3))}function Co(H){var te,he;if(!Bn.value||(M3=H,Gf!=null||Qf!=null))return;const ve=Math.max(0,(he=(te=i.virtualScroll)==null?void 0:te.emitIntervalMs)!=null?he:32),Ne=Math.max(0,ve-(sg()-T3)),Ue=()=>{Qf=null,Gf=Wi?Wi(iI):null,Gf==null&&iI()};Z&&Ne>0?Qf=window.setTimeout(Ue,Ne):Ue()}function oI(){Kr.value+=1}function L2(H){if(pr.value&&H>=us.value){const te=ze.value[H],he=xe.value===!0&&Oe.value!==!0&&H>=ze.value.length-2,ve=te?.type==="code_block"||te?.type==="image"||te?.type==="mermaid"||te?.type==="infographic";if(!he||ve)return!1}return!on.value||H=Me.value&&(V.value||(V.value=!0,xp()),!ii.value||!so))return Rp(H),void(te&&tu(H,!0));if(H{if(x2.delete(Ue),!on.value||Ms.value.has(Ue))return;const bt=Qi.get(Ue);if(!bt)return;const nt=le(bt),ht=bt.ownerDocument||document,kt=ht.defaultView||window,Je=!nt||nt===ht.documentElement||nt===ht.body,pt=!Je&&nt?st("nodeVisibilityFallback.root.getBoundingClientRect",()=>nt.getBoundingClientRect()):null,Nt=Je?0:pt.top,_t=Je?st("nodeVisibilityFallback.clientHeight",()=>{var $t,pn;return(pn=($t=kt.innerHeight)!=null?$t:nt?.clientHeight)!=null?pn:0}):pt.bottom,Yt=st("nodeVisibilityFallback.node.getBoundingClientRect",()=>bt.getBoundingClientRect());Yt.bottom>=Nt-500&&Yt.top<=_t+500&&tu(Ue,!0)},1800+Ye);x2.set(Ue,tt)})(H);let Ne=null;Ne=qe(()=>ve.isVisible.value,Ue=>{if(Ue){Ap(H),tu(H,!0),Ne?.(),Nu.delete(H),oa.get(H)===ve&&oa.delete(H);try{ve.destroy()}catch{}}},{immediate:!0}),Nu.set(H,Ne),An.value&&ai()}function F3(){nr=null,me(()=>{let H=!1;for(const[te,he]of es)es.delete(te),ao.get(te)===he.el&&Lr.get(te)===he.version&&(H=Bt(te,he.height,{allowShrink:he.allowShrink})||H);return H})}function Op(){nr!=null&&(Ni?.(nr),nr=null),es.clear()}function D2(H,te){(function(he,ve,Ne){var Ue;if(!Number.isFinite(Ne)||Ne<=0||ao.get(he)!==ve)return;const Ye=Lr.get(he);if(Ye==null)return;const tt=ze.value[he],bt=ct.value&&Oe.value!==!0&&!((Ue=i.nodes)!=null&&Ue.length)&&he>=ze.value.length-2,nt=!(tt?.loading===!0||bt),ht=es.get(he),kt=ht?ht.allowShrink&&nt:nt,Je=ht&&!kt?Math.max(ht.height,Ne):Ne;es.set(he,{height:Je,allowShrink:kt,version:Ye,el:ve}),nr==null&&(nr=Wi?Wi(F3):null,nr==null&&F3())})(H,te,Qt(H,te))}function Ac(){for(const[H,te]of ao)te&&D2(H,te)}function sI(){po?.disconnect(),po=null,Ur.clear()}function R3(){for(;eu.length;)We(eu.pop())}qe(io,H=>{H&&Co("content")},{flush:"post"}),t({getVirtualMetrics:Uf,captureVirtualState:function(H={}){var te;return Lp(Uf("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:H.allowFallbackAnchor===!0,requireViewport:H.requireViewport===!0,includeEmptyState:(te=H.includeEmptyState)==null||te})},restoreVirtualState:function(H,te={}){const he=te.restoreAnchor===!0,ve=te.restoreToken==null?"imperative":String(te.restoreToken);tg=H,ng={restoreAnchor:he,restoreToken:ve,allowUncapturedAnchor:te.allowUncapturedAnchor===!0},!x3(H,{restoreAnchor:he,restoreToken:ve,allowUncapturedAnchor:te.allowUncapturedAnchor===!0})&&X_(H)||(tg=null,ng=null)},forceMeasure:function(H="manual"){return xo(this,null,function*(){yield mt(),yield eI(),Ac(),ig(),yield mt();const te=Uf(H);return N3(te,!0),te})},settle:I3,scrollToNode:function(H,te="start"){Np(),Il();const he=ze.value.length;if(he<=0)return;const ve=Wo(H,0,he-1),Ne=()=>{var Ue;const Ye=Eu({nodeIndex:ve,offsetWithinNodePx:0}),tt=Is(ve),bt=Xm(),nt=(Ue=bt?.clientHeight)!=null?Ue:0,ht=Mr();let kt=Ye;if(te==="center")kt=Ye-nt/2+tt/2;else if(te==="end")kt=Ye-nt+tt;else if(te==="nearest"&&ht!=null){if(Ye>=ht&&Ye+tt<=ht+nt)return;kt=YeQs.value,H=>{if(!H){sI();for(const te of tr.values())for(const he of te)We(he);tr.clear(),Lr.clear(),R3(),Op()}},{immediate:!0}),qe(Oe,H=>{H&&(function(){if(Z&&Oe.value&&ao.size){R3();for(const te of[80,240,640]){const he=Se(te,()=>{for(const[ve,Ne]of ao)Ne&&D2(ve,Ne)},"final");he!=null&&eu.push(he)}}})(),Co(H?"final":"content")});const tY=cD(()=>Co("content"),16),nY=cD(()=>Co("batch"),16);qe([()=>ze.value.length,()=>us.value],()=>{Ci.value&&Dp(),tY()},{flush:"post",immediate:!0}),qe([()=>lo.start,()=>lo.end],()=>{nY()},{flush:"post"});const{cleanupBatchScheduler:iY}=(function(H){const{props:te,isClient:he,isTestEnv:ve,parsedNodesIdentity:Ne,parsedNodeCount:Ue,desiredRenderedCount:Ye,datasetKey:tt,batchingEnabled:bt,incrementalRenderingActive:nt,resolvedBatchSize:ht,resolvedInitialBatch:kt,renderedCount:Je,adaptiveBatchSize:pt,previousRenderContext:Nt,previousBatchConfig:_t,requestFrame:Yt,cancelFrame:$t,hasIdleCallback:pn,cleanupNodeVisibility:vn,onDatasetKeyChanged:Ln,onDatasetChanged:Mn}=H;let Nn=null,Qn="raf",Jn=null,Xi=0,Nr=!1,kr=!1;const iu=new Set,Du=new Set;function vg(){if(he){Nn!=null&&(Qn==="raf"&&$t?$t(Nn):Qn==="idle"&&typeof window.cancelIdleCallback=="function"?window.cancelIdleCallback(Nn):Qn==="timeout"&&window.clearTimeout(Nn),Nn=null),Xi+=1;for(const Qr of iu)$t&&$t(Qr);for(const Qr of Du)window.clearTimeout(Qr);iu.clear(),Du.clear(),Jn=null,Nr=!1,kr=!1}}function H2(){return typeof performance<"u"?performance.now():Date.now()}function AI(Qr){(function(xc){var md;if(!nt.value)return;const Sc=Math.max(2,(md=te.renderBatchBudgetMs)!=null?md:6),_c=Math.max(1,ht.value||1),ou=Math.max(1,Math.floor(_c/4));xc>1.5*Sc?pt.value=Math.max(ou,Math.floor(.8*pt.value)):xc<.6*Sc&&pt.value<_c&&(pt.value=Math.min(_c,Math.ceil(1.2*pt.value)))})(Qr),Nr=!1;const Ll=kr||Je.value=Sc)return;const _c=Math.max(1,Qr),ou=()=>{const Bp=H2();Nn=null;const yg=Jn??_c;Jn=null;const zp=H2();Je.value=Math.min(Sc,Je.value+yg),vn(Je.value),(function(H3,W2){if(!he)return void AI(W2);Nr=!0;const II=++Xi;mt().then(()=>{var MI;if(II!==Xi)return;const xY=H2(),SY=Math.max(W2,xY-H3),TI=()=>{II===Xi&&AI(SY)};if(Yt){let Jf=null,jp=null,LI=!1;const NI=()=>{LI||(LI=!0,Jf!==null&&(iu.delete(Jf),Jf=null),jp!==null&&(Du.delete(jp),window.clearTimeout(jp),jp=null),TI())};return Jf=Yt(()=>{NI()}),iu.add(Jf),jp=window.setTimeout(()=>{Jf!==null&&$t&&$t(Jf),NI()},Math.max(32,(MI=te.renderBatchIdleTimeoutMs)!=null?MI:120)),void Du.add(jp)}const EI=window.setTimeout(()=>{Du.delete(EI),TI()},0);Du.add(EI)})})(Bp,H2()-zp)};if(!he||Ll.immediate)return void ou();const gd=Math.max(0,(xc=te.renderBatchDelay)!=null?xc:16);if(Jn=Jn!=null?Math.max(Jn,_c):_c,Nn==null){if(!ve&&pn&&window.requestIdleCallback){const Bp=Math.max(0,(md=te.renderBatchIdleTimeoutMs)!=null?md:120);return Qn="idle",void(Nn=window.requestIdleCallback(()=>ou(),{timeout:Bp}))}if(Yt&&!ve)return Qn="raf",void(Nn=Yt(()=>{gd===0?ou():(Qn="timeout",Nn=window.setTimeout(()=>ou(),gd))}));Qn="timeout",Nn=window.setTimeout(()=>ou(),gd)}}function SI(Qr,Ll={}){Nr?kr=!0:Qr==null?_I():xI(Qr,Ll)}function _I(){nt.value&&xI(bt.value?Math.max(1,Math.round(pt.value)):Math.max(1,ht.value))}return qe([Ne,Ue,tt,nt,ht,kt,()=>te.renderBatchDelay],()=>{var Qr;const Ll=Ue.value,xc=Nt.value,md=tt.value,Sc=!Object.is(md,xc.key),_c=Ll!==xc.total,ou=Sc||_c;Nt.value={key:md,total:Ll};const gd=_t.value,Bp=(Qr=te.renderBatchDelay)!=null?Qr:16,yg=gd.batchSize!==ht.value||gd.initial!==kt.value||gd.delay!==Bp||gd.enabled!==nt.value;_t.value={batchSize:ht.value,initial:kt.value,delay:Bp,enabled:nt.value},Sc&&Ln(Ll),(ou||yg||!nt.value)&&vg(),(ou||yg)&&(pt.value=Math.max(1,ht.value||1)),ou&&Mn();const zp=Ye.value;if(!Ll)return Je.value=0,void vn(0);if(!nt.value)return Je.value=zp,void vn(Je.value);const H3=Sc||xc.total===0;Je.value=H3||yg?Math.min(zp,kt.value):Math.min(Je.value,zp);const W2=Math.max(1,kt.value||ht.value||Ll);Je.value{nt.value&&(typeof Ll=="number"&&Qr<=Ll||Qr>Je.value&&SI())}),{cleanupBatchScheduler:vg}})({props:I,isClient:Z,isTestEnv:No,parsedNodesIdentity:Dt,parsedNodeCount:wi,desiredRenderedCount:hd,datasetKey:VQ,batchingEnabled:na,incrementalRenderingActive:pr,resolvedBatchSize:Ir,resolvedInitialBatch:Js,renderedCount:us,adaptiveBatchSize:Pi,previousRenderContext:Di,previousBatchConfig:qi,requestFrame:Wi,cancelFrame:Ni,hasIdleCallback:Qo,cleanupNodeVisibility:Gm,onDatasetKeyChanged:H=>{Op(),Ge(),Ro(),lg(),H>0&&ia(H)},onDatasetChanged:()=>{An.value&&ai({immediate:!0})}});qe([Jo,An,()=>F.value,()=>G()],([H,te])=>{if(!H)return Qm(),void li();Sp(),te?ai({immediate:!0}):li()},{flush:"post",immediate:!0}),qe([()=>ze.value.length,()=>An.value],H=>xo(null,[H],function*([te,he]){he&&te&&Z&&(yield mt(),ai({immediate:!0}))}),{flush:"post"}),qe(oo,H=>{H&&(function(){var te;if(vo.value&&Io.value&&Wr.value&&((te=Mo.value)!=null&&te[1]))return;const he=Ot({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),ve=Ot({type:"list_item",children:[he],raw:"- Probe paragraph text"}),Ne=Ot({type:"list",ordered:!1,items:[ve],raw:"- Probe paragraph text"});vo.value=he,Io.value=ve,Wr.value=Ne;const Ue={1:null,2:null,3:null,4:null,5:null,6:null};for(let Ye=1;Ye<=6;Ye++)Ue[Ye]=Ot({type:"heading",level:Ye,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(Ye)} Probe heading`});Mo.value=Ue})()},{immediate:!0}),qe([()=>F.value,oo],()=>{if(!oo.value)return Xe(),void(ee.value=0);Ie(),Xe(),oo.value&&F.value&&typeof ResizeObserver<"u"&&(ut=new ResizeObserver(()=>{Ie(),ws.value&&jo(),Ci.value&&Dp(),Co("resize")}),ut.observe(F.value))},{immediate:!0}),qe([oo,_r,sa],()=>xo(null,null,function*(){if(!oo.value)return ue.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void Ro();yield mt(),(function(){if(!oo.value||typeof window>"u")return ue.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void Ro();const H={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},te=S2(Ip(O.value),".paragraph-node");H.paragraph=fw(O.value,te,"pre-wrap");const he=Ip(B.value),ve=he?.querySelector(".paragraph-node");H.listItem=fw(B.value,ve,"pre-wrap");const Ne=st("readSimpleTextProbeProfile.list.offsetHeight",()=>{var Ye,tt;return(tt=(Ye=j.value)==null?void 0:Ye.offsetHeight)!=null?tt:0}),Ue=st("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var Ye,tt;return(tt=(Ye=B.value)==null?void 0:Ye.offsetHeight)!=null?tt:0});H.listWrapperOverhead=Math.max(0,Ne-Ue);for(let Ye=1;Ye<=6;Ye++){const tt=S2(Ip($[Ye]),`h${Ye}`);H.headings[Ye]=fw($[Ye],tt,"pre-wrap")}ue.value=H,Ro()})()}),{flush:"post",immediate:!0}),qe(()=>ze.value.length,()=>{An.value&&ai({immediate:!0})}),qe([oo,ee],()=>{Ro(),An.value&&ai({immediate:!0}),ws.value&&jo(),Ci.value&&Dp(),Co("resize")},{immediate:!1}),qe(()=>on.value,H=>{if(H)for(const[te,he]of Qi)N2(te,he);else if(xp(),An.value)ai({immediate:!0});else for(const[te,he]of Qi)he&&tu(te,!0)},{immediate:!1}),qe([Ee,Me,()=>G()],()=>{var H;(H=so.refresh)==null||H.call(so);for(const[te,he]of Qi)N2(te,he)},{immediate:!1}),qe([()=>I.viewportPriority,()=>ze.value.length,Me],([H,te,he])=>{if(H!==!1){if(V.value&&(te<=200||te<=he)){V.value=!1;for(const[ve,Ne]of Qi)N2(ve,Ne)}}else V.value=!1}),qe(()=>us.value,()=>{An.value&&ai({immediate:!0})}),qe([Xo,qr,Lo,()=>ze.value.length,An],()=>{Oo()},{immediate:!0});let ug=null,cg=!1,Pp=null;function dg(){ug=null,h3=null,f3=void 0,Ep=null,lg()}function O3(){Op(),Ge(),Ro(),Yi.clear();const H=ze.value.length;H>0&&ia(H),S3()}function P3(){D3(),vt(),og=null,Kf=null,Zf=null,T2=null,tg=null,ng=null,cg=!1,dg(),H_("restore"),Il(),Np()}function fg(H){var te;return[(te=Ts())!=null?te:"",qo(),Cc(),_2.value,rg(H),ze.value.length,Math.round(er(0,ze.value.length)),Math.round(qf()),Cs.count,Math.round(Cs.total)].join(":")}function rI(){return xo(this,null,function*(){var H,te,he,ve;const Ne=(H=i.virtualScroll)==null?void 0:H.settledToken,Ue=rg(Ne),Ye=qo(),tt=Ts(),bt=sa.value;if(Bn.value&&((te=i.virtualScroll)==null?void 0:te.settleMode)==="manual"&&I2(Ne))if(p3()){if(fg(Ne)!==Ep&&!cg){cg=!0;try{const nt=yield I3({reason:"manual",expectedSettledTokenKey:Ue}),ht=rg()===Ue;_3(Ye,tt,bt)&&nt.sessionKey===Ye&&nt.threadKey===tt&&ht&&nt.stable&&nt.phase==="final"&&(Ep=fg((he=i.virtualScroll)==null?void 0:he.settledToken))}finally{cg=!1,yield mt();const nt=(ve=i.virtualScroll)==null?void 0:ve.settledToken,ht=I2(nt)?fg(nt):"";_3(Ye,tt,bt)&&ht&&Ep!==ht&&rI()}}}else Co("manual")})}qe(Bn,(H,te)=>{if(H!==te){if(!H)return P3(),void D3();P3(),O3(),Pp=sa.value,Co("content")}},{flush:"post"}),qe([Bn,sa],([H,te])=>{H?Pp!=null?Pp!==te&&(Pp=te,(function(he="resize"){Op(),Ge(),Ro(),Yi.clear();const ve=ze.value.length;ve>0&&ia(ve),S3(),Kf=null,Zf=null,T2=null,og=null,cg=!1,dg(),J_(),mt(()=>{Ac(),ws.value&&jo(),Ci.value&&Dp(),Co(he)})})("resize")):Pp=te:Pp=null},{flush:"post",immediate:!0}),qe([Bn,()=>qo(),()=>Ts()],([H])=>{H&&(P3(),O3(),H_("content"),Co("content"))}),qe([Bn,()=>qo(),()=>Ts(),sa,()=>ze.value.length],([H])=>{H&&(function(te="async-node"){let he=!1;for(const[ve,Ne]of Array.from(ul.entries()))c3(Ne)||(ul.delete(ve),vr.delete(ve),he=!0);he&&(Mp(),Co(te))})("async-node")},{flush:"post"}),qe([Bn,()=>{var H;return(H=i.virtualScroll)==null?void 0:H.sessionKey},()=>{var H;return(H=i.virtualScroll)==null?void 0:H.measurementKey},()=>i.indexKey,()=>K.value],([H])=>{H&&(lg(),(function(te="content"){if(!Bn.value)return;const he=[],ve=ze.value.length,Ne=Ym(ve);for(const Ue of Array.from(Yi.keys())){if(Ue>=ve){he.push(Ue);continue}if(Ue=ve&&Yi.delete(Ue);he.length&&((function(Ue,Ye={}){const tt=Array.from(Ue,Number);rt(tt);let bt=0;if(me(()=>(bt=Y(tt,Ye),bt>0)),bt>0)(function(nt){for(const ht of nt)Yi.delete(ht)})(tt);else for(const nt of tt)bn.delete(nt)})(he,{notify:!1}),Ro(),dg(),ws.value&&jo(),Ci.value&&Dp(),Co(te))})("content"))},{flush:"post",immediate:!0}),qe([Bn,()=>ze.value.length,()=>qo(),()=>Ts()],([H,te,he,ve],[Ne,Ue,Ye,tt])=>{H&&Ne&&he===Ye&&ve===tt&&te!==Ue&&dg()},{flush:"post"}),qe([Bn,()=>{var H;return(H=i.virtualScroll)==null?void 0:H.heightCache},()=>{var H;return(H=i.virtualScroll)==null?void 0:H.heightCacheWidth},()=>{var H;return(H=i.virtualScroll)==null?void 0:H.restoreState},()=>{var H;return(H=i.virtualScroll)==null?void 0:H.measurementKey},()=>ze.value.length,()=>qo(),ee],()=>{J_()},{flush:"post",immediate:!0}),qe([Bn,()=>{var H;return(H=i.virtualScroll)==null?void 0:H.restoreState},()=>{var H;return(H=i.virtualScroll)==null?void 0:H.restoreAnchor},()=>{var H;return(H=i.virtualScroll)==null?void 0:H.measurementKey},()=>ze.value.length,()=>qo(),ee],H=>xo(null,[H],function*([te,he]){if(!te||!he)return;yield mt();const ve=(function(){var Ne;const Ue=(Ne=i.virtualScroll)==null?void 0:Ne.restoreAnchor;return Ue==null||Ue===!1?null:Ue===!0?"true":String(Ue)})();x3(he,{restoreAnchor:ve!=null,restoreToken:ve??void 0})}),{flush:"post",immediate:!0}),qe([Bn,ee,()=>{var H;return(H=i.virtualScroll)==null?void 0:H.restoreState},()=>{var H;return(H=i.virtualScroll)==null?void 0:H.measurementKey}],([H])=>{var te;if(!H)return;const he=(te=i.virtualScroll)==null?void 0:te.restoreState;he&&Kf&&Zf==="restore"&&(Q_(he)||(O3(),Kf=null,Zf=null,Co("resize")))},{flush:"post"}),qe([Bn,()=>ze.value.length,()=>qo(),ee],H=>xo(null,[H],function*([te]){var he;const ve=tg,Ne=ng;te&&ve&&(yield mt(),!x3(ve,{restoreAnchor:Ne?.restoreAnchor===!0,restoreToken:(he=Ne?.restoreToken)!=null?he:"imperative",allowUncapturedAnchor:Ne?.allowUncapturedAnchor===!0})&&X_(ve)||(tg=null,ng=null))}),{flush:"post",immediate:!0}),qe([Bn,Oe,()=>{var H;return(H=i.virtualScroll)==null?void 0:H.settleMode},()=>qo(),()=>Ts(),sa,Lu,Sa,()=>us.value,hd,()=>Cs.count,()=>Cs.total],([H,te,he])=>{if(!H||te!==!0||he==="manual"||!m3())return;const ve=(function(){var Ne;const Ue=ze.value.length;return[(Ne=Ts())!=null?Ne:"",qo(),Cc(),_2.value,Ue,Math.round(er(0,Ue)),Math.round(qf()),Cs.count,Math.round(Cs.total)].join(":")})();ug!==ve&&(ug=ve,I3({reason:"final"}).then(Ne=>{Ne.stable||ug!==ve||(ug=null)}))},{flush:"post",immediate:!0}),qe([Bn,Oe,()=>{var H;return(H=i.virtualScroll)==null?void 0:H.settleMode},()=>{var H;return(H=i.virtualScroll)==null?void 0:H.settledToken},()=>qo(),()=>Ts(),sa,Lu,Sa,()=>us.value,hd,()=>ze.value.length,()=>Cs.count,()=>Cs.total],()=>{rI()},{flush:"post",immediate:!0}),qe([()=>ze.value.length,An,qr,Lo,()=>lo.start,()=>lo.end],([H,te,he,ve,Ne,Ue])=>{fe.value&&Ct("virtualization",{nodes:H,virtualization:te,maxLiveNodes:he,buffer:ve,focusIndex:Xo.value,scroll:te?(()=>{const Ye=ko.value||le();return Ye?{reverse:se(Ye),scrollTop:Math.round(Ye.scrollTop),scrollTopAbs:Math.round(Math.abs(Ye.scrollTop)),scrollHeight:Math.round(Ye.scrollHeight),clientHeight:Math.round(Ye.clientHeight)}:null})():null,liveRange:{start:Ne,end:Ue},rendered:us.value})}),qe([()=>I.customId],([H],te,he)=>{if(!H||Bo)return;const ve=(function(Ne,Ue){return Ne?(ir.controllers[Ne]=Ue,()=>{ir.controllers[Ne]===Ue&&delete ir.controllers[Ne]}):()=>{}})(H,{captureRestoreAnchor:Gr,restoreAnchor:Tr,getAnchorDrift:Ml,getReport:bc});he(()=>{ve()})},{immediate:!0}),si(()=>{(function(){if(Bn.value)try{Ac(),ig();const H=Uf("manual");tI(H)&&(R(H),og=H,T3=sg());const te=Lp(H,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});te&&(W(te),te.anchor&&z(te.anchor),Fp=ag(te))}catch{}})(),iY(),xp(),Ke(),sI();for(const H of tr.values())for(const te of H)We(te);tr.clear(),Lr.clear(),Yi.clear(),R3(),Op(),Xe(),Il(),Np(),D3(),Qm(),li()});const oY=n0("ViewportDeferredMermaidBlockNode",Yu({loader:()=>xo(null,null,function*(){try{return(yield _s(()=>import("./index11-BuI7qYB6.js"),__vite__mapDeps([7,5]))).default}catch(H){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".',H),Ol}}),loadingComponent:xD,delay:0}),xD),sY=n0("ViewportDeferredInfographicBlockNode",Yu({loader:()=>xo(null,null,function*(){try{return(yield _s(()=>import("./index10-BOfr-M0b.js"),[])).default}catch(H){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.',H),Ol}}),loadingComponent:AD,delay:0}),AD),rY=n0("ViewportDeferredD2BlockNode",Yu(()=>xo(null,null,function*(){try{return(yield _s(()=>import("./index8-DQP5_GpC.js"),[])).default}catch(H){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".',H),Ol}})),Ol),lI={text:vs,paragraph:Vh,heading:L4,code_block:nw,list:G1,list_item:Z1,blockquote:x9,table:B0,definition_list:S9,footnote:_9,footnote_reference:pa,footnote_anchor:P0,admonition:E9,vmr_container:M9,hardbreak:tf,link:wl,image:ef,thematic_break:I9,math_inline:Iu,math_block:uq,strong:kl,emphasis:Cl,strikethrough:bl,highlight:ga,insert:Kl,subscript:Vl,superscript:Ul,emoji:ql,checkbox:ha,checkbox_input:ha,inline_code:il,html_inline:ma,reference:yl,html_block:$0},lY=D(()=>wc()),aI=D(()=>aD(I.codeBlockProps)),aY=D(()=>aD(I.codeBlockProps,{omit:["langs"]})),uI=D(()=>Ht(Ht({stream:I.codeBlockStream,darkTheme:I.codeBlockDarkTheme,lightTheme:I.codeBlockLightTheme,monacoOptions:I.codeBlockMonacoOptions,themes:I.themes,langs:m.value==="shiki"?I.langs:void 0,minWidth:I.codeBlockMinWidth,maxWidth:I.codeBlockMaxWidth},typeof de.value=="boolean"?{showTooltips:de.value}:{}),aY.value)),cI=D(()=>Ht(Hn(Ht({},uI.value),{langs:I.langs}),aI.value));function dI(H){return typeof H=="boolean"?H:void 0}const uY=D(()=>{const H=I.codeBlockProps||{},te={},he=dI(H.showLineNumbers);he!==void 0&&(te.showLineNumbers=he);const ve=dI(H.diffInline);ve!==void 0&&(te.diffInline=ve);const Ne=(function(Ue){const Ye=Number(Ue);return Number.isFinite(Ye)&&Ye>0?Ye:void 0})(H.reservedHeightPx);return Ne!==void 0&&(te.reservedHeightPx=Ne),te}),cY=D(()=>Ht(Ht({stream:I.codeBlockStream,darkTheme:I.codeBlockDarkTheme,lightTheme:I.codeBlockLightTheme,themes:I.themes,langs:I.langs,minWidth:I.codeBlockMinWidth,maxWidth:I.codeBlockMaxWidth},typeof de.value=="boolean"?{showTooltips:de.value}:{}),aI.value)),dY=D(()=>Ht({},I.mermaidProps||{})),fI=D(()=>Ht({},I.d2Props||{})),fY=D(()=>Ht({},I.infographicProps||{})),hg=D(()=>({typewriter:h.value,fade:I.fade,customHtmlTags:Go.value.customHtmlTags})),hY=D(()=>Ht(Ht({},hg.value),typeof de.value=="boolean"?{showTooltip:de.value}:{})),pY=D(()=>Ht(Ht({},hg.value),typeof de.value=="boolean"?{showTooltips:de.value}:{})),mY=D(()=>Ht(Ht({},hg.value),typeof de.value=="boolean"?{showTooltips:de.value}:{})),gY=D(()=>Ht(Ht({},hg.value),typeof de.value=="boolean"?{showTooltips:de.value}:{}));function vY(H){return Array.isArray(H.children)&&H.children.length>0}const F2=D(()=>uo.value.map(H=>{var te,he,ve,Ne,Ue,Ye,tt,bt;let nt=(function($t){var pn,vn,Ln,Mn,Nn,Qn,Jn;if($t.type!=="code_block")return $t;const Xi=$t,Nr=[String((pn=Xi.language)!=null?pn:""),String((vn=Xi.loading)!=null?vn:""),String((Ln=Xi.diff)!=null?Ln:""),String((Mn=Xi.code)!=null?Mn:""),String((Nn=Xi.originalCode)!=null?Nn:""),String((Qn=Xi.updatedCode)!=null?Qn:""),String((Jn=Xi.raw)!=null?Jn:"")].join("\0"),kr=Vr.get(Xi);if(kr&&kr.signature===Nr)return kr.node;const iu=Ht({},Xi);return Vr.set(Xi,{signature:Nr,node:iu}),iu})(H.node);const ht=R2(nt);let kt=gI(nt,ht);if((nt.type==="html_block"||nt.type==="html_inline")&&kt===lI[nt.type]){const $t=nt,pn=String((te=$t.tag)!=null?te:"").trim().toLowerCase()||FH($t.content);if(pn){const vn=In.value[pn];if(Zo.value.has(pn)&&vn)kt=vn,nt=Hn(Ht({},$t),{type:pn,tag:pn,content:G1e($t.content,pn)});else if(RH((he=$t.content)!=null?he:$t.raw,pn)){const Ln=String((Ne=(ve=$t.content)!=null?ve:$t.raw)!=null?Ne:"");nt.type==="html_inline"?(kt=vs,nt={type:"text",content:Ln,raw:Ln}):(kt=Vh,nt={type:"paragraph",children:[{type:"text",content:Ln,raw:Ln}],raw:Ln})}}}const Je=nt.type==="code_block"&&m.value==="pre"&&kt===Ol&&!$3(In.value,ht);let pt=Ht({},(function($t,pn,vn){const Ln=pn??R2($t);if($t.type==="code_block"){const Mn=Ln?$3(In.value,Ln):void 0;if(vn&&m.value==="pre"&&!Mn&&vn===Ol)return uY.value;if(vn&&Ln&&vn===Mn)return Ln==="mermaid"?pI($t):Ln==="infographic"?mI($t):Ln==="d2"||Ln==="d2lang"?fI.value:cI.value;if(vn&&vn===In.value.code_block)return cI.value;if(wn(vn))return cY.value}return Ln==="mermaid"?pI($t):Ln==="infographic"?mI($t):Ln==="d2"||Ln==="d2lang"?fI.value:$t.type==="link"?hY.value:$t.type==="list"?pY.value:$t.type==="blockquote"?mY.value:$t.type==="table"?gY.value:$t.type==="code_block"?uI.value:hg.value})(nt,ht,kt));const Nt=oo.value?Fn.value[H.index]:null;nt.type==="code_block"&&Nt?.kind==="code-block"&&(pt=Hn(Ht({},pt),Je?{reservedHeightPx:(Ue=Nt.height)!=null?Ue:Nt.contentHeight}:{estimatedHeightPx:Nt.height,estimatedContentHeightPx:Nt.contentHeight,estimatedDiffInline:Nt.diffInline})),Je||nt.type!=="code_block"||ht!=="mermaid"||A1(pt.estimatedPreviewHeightPx)!=null||(pt=Hn(Ht({},pt),{estimatedPreviewHeightPx:Zk(Vk(String((Ye=nt.code)!=null?Ye:"")))})),Je||nt.type!=="code_block"||ht!=="infographic"||A1(pt.estimatedPreviewHeightPx)!=null||(pt=Hn(Ht({},pt),{estimatedPreviewHeightPx:Gk(Kk(String((tt=nt.code)!=null?tt:"")))})),nt.type==="math_block"&&(pt=Hn(Ht({},pt),{cacheScope:ki}));const _t=(function($t,pn){const vn=String($t.type);return!a2(vn)&&In.value[vn]===pn})(nt,kt),Yt=_t?bx(nt,pe.value):void 0;return Hn(Ht({},H),{node:nt,component:kt,bindings:pt,customBindings:Ht(Ht({},Yt??{}),pt),rendersCustomNode:_t,hasSlotChildren:vY(nt),slotContent:String((bt=nt.content)!=null?bt:""),isCodeBlock:nt.type==="code_block",indexKey:`${lY.value}-${H.index}`,vnodeKey:`${UQ.value}\0${H.index}\0${nt.type}`})}));function R2(H){var te;return H?.type==="code_block"?String((te=H.language)!=null?te:"").trim().toLowerCase():""}function $3(H,te){const he=te.trim().toLowerCase();if(he)for(const ve of[he,M4(he),UW(he)]){const Ne=ve&&H[ve];if(Ne)return Ne}}function hI(H,te,he,ve){var Ne,Ue;const Ye=Ht({},H.value);return A1(Ye.estimatedPreviewHeightPx)==null&&(Ye.estimatedPreviewHeightPx=ve(he(String((Ne=te?.code)!=null?Ne:"")),void 0,Ye.maxHeight==="none"?null:(Ue=A1(Ye.maxHeight))!=null?Ue:void 0)),Ye}function pI(H){return hI(dY,H,Vk,Zk)}function mI(H){return hI(fY,H,Kk,Gk)}function gI(H,te){if(!H)return CA;const he=In.value,ve=he[String(H.type)];if(H.type==="code_block"){const Ne=te??R2(H),Ue=Ne?$3(he,Ne):void 0;return Ue||(m.value==="pre"?he.code_block||Ol:Ne==="mermaid"?he.mermaid||oY:Ne==="infographic"?he.infographic||sY:Ne==="d2"||Ne==="d2lang"?he.d2||rY:ve||he.code_block||Wn.value)}return ve||lI[String(H.type)]||CA}function B3(H){o("click",H)}function yY(H){var te;(te=H.target)!=null&&te.closest("[data-node-index]")&&o("mouseover",H)}function kY(H){var te;(te=H.target)!=null&&te.closest("[data-node-index]")&&o("mouseout",H)}function vI(H){o("mouseover",H)}function yI(H){o("mouseout",H)}const Yf=q(null),El=q(!1),pg=q(null),bY=D(()=>!(I.domMode!=="minimal"||Q.value||I.fade!==!1||h.value||El.value||Fi.value||An.value||To.value||ni.value||ll.value||Object.keys(In.value).length!==0));let mg,$p=null,z3=0,O2=0,P2=0;const kI=["code_block","admonition","table","math_block","html_block","image","thematic_break"],wY=new Set(kI),bI=[".typewriter-cursor",".height-estimation-probes",...kI.map(H=>`[data-node-type="${H}"]`),"script","style"].join(",");function wI(H){if(!H||typeof H!="object")return!1;const te=H.type;return typeof te=="string"&&wY.has(te)}function $2(H){var te,he;if(!H||typeof H!="object")return 0;const ve=H,Ne=(he=(te=ve.raw)!=null?te:ve.content)!=null?he:ve.code;if(typeof Ne=="string")return Ne.length;const Ue=ve.children;if(Array.isArray(Ue))return Ue.reduce((tt,bt)=>tt+$2(bt),0);const Ye=ve.items;return Array.isArray(Ye)?Ye.reduce((tt,bt)=>tt+$2(bt),0):0}function B2(){mg&&(clearTimeout(mg),mg=void 0)}function j3(){z3+=1,$p!=null&&(Ni?.($p),$p=null)}function gg(){j3(),pd(),Yf.value&&(Yf.value.style.visibility="hidden")}function CY(H){var te;if(H.nodeType!==Node.TEXT_NODE||!((te=H.textContent)!=null?te:"").trim())return!1;const he=H.parentElement;return!!he&&!he.closest(bI)}function AY(H){let te=H.lastChild;for(;te;){if(CY(te))return te;if(te.nodeType===Node.ELEMENT_NODE){const he=te;if(!he.matches(bI)&&he.lastChild){te=he.lastChild;continue}}for(;te&&te!==H&&!te.previousSibling;)te=te.parentNode;if(!te||te===H)break;te=te.previousSibling}return null}function CI(){const H=F2.value;for(let te=H.length-1;te>=0;te--){const he=H[te];if(!he||wI(he.node)||!L2(he.index))continue;const ve=Qi.get(he.index);if(!ve)continue;const Ne=AY(ve);if(Ne)return Ne}return null}function pd(){pg.value&&(pg.value.classList.remove(SD),pg.value=null)}function z2(){if(d.value!=="simple"||!Z||!El.value||!F.value)return void pd();const H=CI(),te=H?(function(he){var ve;const Ne=(ve=he.parentElement)==null?void 0:ve.closest(".text-node");return Ne instanceof HTMLElement?Ne:he.parentElement})(H):null;te!==pg.value&&(pd(),te&&(te.classList.add(SD),pg.value=te))}function j2(){if(d.value!=="precise"||!Z||!El.value||$p!=null)return;const H=z3,te=()=>{$p=null,H===z3&&(function(){var he,ve;if(d.value!=="precise"||!(Z&&El.value&&F.value&&Yf.value))return;const Ne=F.value,Ue=Yf.value;Ue.style.visibility="hidden";const Ye=CI();if(!Ye)return;let tt=0,bt=0,nt=20,ht=!1;if(Ye?.textContent){const kt=Ye.textContent.length,Je=document.createRange();Je.setStart(Ye,Math.max(0,kt-1)),Je.setEnd(Ye,kt);const pt=typeof Je.getClientRects=="function"?Je.getClientRects():void 0,Nt=(ve=pt?.[pt.length-1])!=null?ve:(he=Ye.parentElement)==null?void 0:he.getBoundingClientRect();if(Nt){const _t=st("typewriterCursor.root.getBoundingClientRect",()=>Ne.getBoundingClientRect());tt=Nt.right-_t.left+Ne.scrollLeft,bt=Nt.top-_t.top+Ne.scrollTop,nt=Nt.height||nt,ht=!0}Je.detach()}ht&&(Ue.style.transform=`translate(${Math.max(0,tt)}px, ${Math.max(0,bt)}px)`,Ue.style.height=`${nt}px`,Ue.style.visibility="visible")})()};Wi?$p=Wi(te):te()}return qe([be,()=>i.content,()=>i.nodes,()=>I.typewriter,Oe],()=>xo(null,null,function*(){var H,te;if(!Z||Q.value||!re.value)return;if(Oe.value)return El.value=!1,B2(),void gg();if((H=i.nodes)!=null&&H.length)return El.value=!1,B2(),gg(),O2=((te=i.content)!=null?te:"").length,void(P2=be.value.length);const he=(function(){var tt,bt;return(tt=i.nodes)!=null&&tt.length?i.nodes.reduce((nt,ht)=>nt+$2(ht),0):((bt=i.content)!=null?bt:"").length})(),ve=(function(){var tt;return(tt=i.nodes)!=null&&tt.length?i.nodes.reduce((bt,nt)=>bt+$2(nt),0):be.value.length})(),Ne=!wI(ze.value[ze.value.length-1]),Ue=he>O2,Ye=ve>P2;if(!h.value||!Ne||!Ue&&!Ye)return h.value&&Ne||(El.value=!1,gg()),O2=he,void(P2=ve);O2=he,P2=ve,El.value=!0,d.value==="precise"&&Yf.value&&(Yf.value.style.visibility="hidden"),B2(),yield mt(),d.value==="simple"?z2():(pd(),j2()),mg=setTimeout(()=>{mg=void 0,El.value=!1},3e3)}),{flush:"post",immediate:!0}),qe(El,H=>xo(null,null,function*(){H?(yield mt(),d.value!=="simple"?(pd(),d.value==="precise"&&j2()):z2()):gg()}),{flush:"post"}),qe(d,()=>xo(null,null,function*(){if(Z&&!Q.value&&re.value&&El.value){if(yield mt(),d.value==="simple")return j3(),void z2();pd(),d.value!=="precise"?gg():j2()}}),{flush:"post"}),qe([()=>us.value,()=>lo.start,()=>lo.end],()=>xo(null,null,function*(){Z&&!Q.value&&re.value&&El.value&&(yield mt(),d.value!=="simple"?(pd(),d.value==="precise"&&j2()):z2())}),{flush:"post"}),si(()=>{B2(),j3(),pd(),sn.clear()}),(H,te)=>{const he=F$("NodeRenderer",!0);return f(Q)?(k(!0),L(Fe,{key:0},xt(F2.value,ve=>(k(),L(Fe,{key:ve.vnodeKey},[ve.rendersCustomNode?(k(),ce(fs(ve.component),yi({key:0,ref_for:!0},ve.customBindings,{node:ve.node,loading:ve.node.loading,"index-key":ve.indexKey,"custom-id":I.customId,"is-dark":I.isDark,onClick:B3,onMouseover:vI,onMouseout:yI,onCopy:te[0]||(te[0]=Ne=>s(Ne)),onHandleArtifactClick:te[1]||(te[1]=Ne=>o("handleArtifactClick",Ne))}),{default:ae(()=>[ve.hasSlotChildren?(k(),ce(he,yi({key:0,ref_for:!0},kn.value,{nodes:ve.node.children,"index-key":ve.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):ve.slotContent?(k(),ce(he,yi({key:1,ref_for:!0},kn.value,{content:ve.slotContent,final:!ve.node.loading,"index-key":`${ve.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):J("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(k(),ce(fs(ve.component),yi({key:1,node:ve.node,loading:ve.node.loading,"index-key":ve.indexKey},{ref_for:!0},ve.bindings,{"custom-id":I.customId,"is-dark":I.isDark,onClick:B3,onMouseover:vI,onMouseout:yI,onCopy:te[2]||(te[2]=Ne=>s(Ne)),onHandleArtifactClick:te[3]||(te[3]=Ne=>o("handleArtifactClick",Ne))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(k(),L("div",{key:1,ref_key:"containerRef",ref:F,class:Pe(["markstream-vue markdown-renderer",[{dark:I.isDark},{virtualized:An.value},{"virtual-scroll-coordinated":io.value},{"stable-layout":gi.value},{"typewriter-simple-cursor":El.value&&d.value==="simple"}]]),"data-custom-id":I.customId,onClick:B3,onMouseover:yY,onMouseout:kY},[ks.value||An.value?(k(),L(Fe,{key:0},[ks.value?(k(),ce(n4e,{key:0,width:_r.value,"flow-root":An.value||io.value,"paragraph-node":vo.value,"list-item-node":Io.value,"list-node":Wr.value,"heading-nodes":Mo.value,"set-paragraph-wrapper":Kt,"set-list-item-wrapper":_n,"set-list-wrapper":Un,"set-heading-wrapper":Jm},null,8,["width","flow-root","paragraph-node","list-item-node","list-node","heading-nodes"])):J("",!0),An.value?(k(),L("div",{key:1,class:"node-spacer",style:an({height:`${yr.value}px`}),"aria-hidden":"true"},null,4)):J("",!0)],64)):J("",!0),bY.value?(k(!0),L(Fe,{key:1},xt(F2.value,ve=>(k(),L(Fe,{key:ve.vnodeKey},[L2(ve.index)?(k(),ce(fs(ve.component),yi({key:0,node:ve.node,loading:ve.node.loading,"index-key":ve.indexKey},{ref_for:!0},ve.bindings,{"custom-id":I.customId,"is-dark":I.isDark,onMouseover:te[4]||(te[4]=Ne=>o("mouseover",Ne)),onMouseout:te[5]||(te[5]=Ne=>o("mouseout",Ne)),onCopy:te[6]||(te[6]=Ne=>s(Ne)),onHandleArtifactClick:te[7]||(te[7]=Ne=>o("handleArtifactClick",Ne))}),null,16,["node","loading","index-key","custom-id","is-dark"])):J("",!0)],64))),128)):(k(!0),L(Fe,{key:2},xt(F2.value,ve=>(k(),L("div",{key:ve.vnodeKey,ref_for:!0,ref:Ne=>N2(ve.index,Ne),class:"node-slot","data-node-index":ve.index,"data-node-type":ve.node.type},[L2(ve.index)?(k(),L("div",{key:0,ref_for:!0,ref:Ne=>(function(Ue,Ye){var tt;Ye||(function(kt){const Je=`${wc()}-${kt}`;let pt=!1;for(const Nt of Array.from(vr.keys())){const _t=ul.get(Nt);(_t?.index===kt||Nt===Je||Nt.startsWith(`${Je}-`))&&(vr.delete(Nt),ul.delete(Nt),pt=!0)}pt&&(Mp(),Co("async-node"))})(Ue),es.delete(Ue),(function(kt){var Je;const pt=((Je=Lr.get(kt))!=null?Je:0)+1;Lr.set(kt,pt)})(Ue);const bt=tr.get(Ue);if(bt){for(const kt of bt)We(kt);tr.delete(Ue)}if((function(kt){const Je=Ur.get(kt);Je&&(po?.unobserve(Je),al.delete(Je),Ur.delete(kt))})(Ue),!Ye||!Qs.value)return ao.delete(Ue),void Lr.delete(Ue);ao.set(Ue,Ye);const nt=()=>{D2(Ue,Ye)};queueMicrotask(nt);const ht=(po||typeof ResizeObserver>"u"||(po=new ResizeObserver(kt=>{if(kt.length)for(const Je of kt){const pt=al.get(Je.target),Nt=Ur.get(pt??-1);pt!=null&&Nt&&D2(pt,Nt)}else Ac()})),po);if(ht&&(Ur.set(Ue,Ye),al.set(Ye,Ue),ht.observe(Ye)),typeof window<"u"){const kt=((tt=ze.value[Ue])==null?void 0:tt.type)==="code_block"?[16,80,240,800]:Oe.value?[80]:[];if(kt.length){const Je=kt.map(pt=>Se(pt,nt,"node-resize")).filter(pt=>pt!=null);Je.length&&tr.set(Ue,Je)}}})(ve.index,Ne),class:"node-content"},[ve.isCodeBlock?ve.rendersCustomNode?(k(),ce(fs(ve.component),yi({key:1,ref_for:!0},ve.customBindings,{node:ve.node,loading:ve.node.loading,"index-key":ve.indexKey,"custom-id":I.customId,"is-dark":I.isDark,onCopy:te[12]||(te[12]=Ne=>s(Ne)),onHandleArtifactClick:te[13]||(te[13]=Ne=>o("handleArtifactClick",Ne))}),{default:ae(()=>[ve.hasSlotChildren?(k(),ce(he,yi({key:0,ref_for:!0},kn.value,{nodes:ve.node.children,"index-key":ve.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):ve.slotContent?(k(),ce(he,yi({key:1,ref_for:!0},kn.value,{content:ve.slotContent,final:!ve.node.loading,"index-key":`${ve.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):J("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(k(),ce(fs(ve.component),yi({key:2,node:ve.node,loading:ve.node.loading,"index-key":ve.indexKey},{ref_for:!0},ve.bindings,{"custom-id":I.customId,"is-dark":I.isDark,onCopy:te[14]||(te[14]=Ne=>s(Ne)),onHandleArtifactClick:te[15]||(te[15]=Ne=>o("handleArtifactClick",Ne))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(k(),ce(Po,{key:0,name:"fade",css:I.fade!==!1,appear:I.fade!==!1},{default:ae(()=>[ve.rendersCustomNode?(k(),ce(fs(ve.component),yi({key:0,ref_for:!0},ve.customBindings,{node:ve.node,loading:ve.node.loading,"index-key":ve.indexKey,"custom-id":I.customId,"is-dark":I.isDark,onCopy:te[8]||(te[8]=Ne=>s(Ne)),onHandleArtifactClick:te[9]||(te[9]=Ne=>o("handleArtifactClick",Ne))}),{default:ae(()=>[ve.hasSlotChildren?(k(),ce(he,yi({key:0,ref_for:!0},kn.value,{nodes:ve.node.children,"index-key":ve.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):ve.slotContent?(k(),ce(he,yi({key:1,ref_for:!0},kn.value,{content:ve.slotContent,final:!ve.node.loading,"index-key":`${ve.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):J("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(k(),ce(fs(ve.component),yi({key:1,node:ve.node,loading:ve.node.loading,"index-key":ve.indexKey},{ref_for:!0},ve.bindings,{"custom-id":I.customId,"is-dark":I.isDark,onCopy:te[10]||(te[10]=Ne=>s(Ne)),onHandleArtifactClick:te[11]||(te[11]=Ne=>o("handleArtifactClick",Ne))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(k(),L("div",{key:1,class:"node-placeholder",style:an({height:`${Is(ve.index)}px`})},null,4))],8,s4e))),128)),El.value&&d.value==="precise"?(k(),L("span",{key:3,ref_key:"typewriterCursorRef",ref:Yf,class:"typewriter-cursor","aria-hidden":"true"},null,512)):J("",!0),An.value?(k(),L("div",{key:4,class:"node-spacer",style:an({height:`${Tl.value}px`}),"aria-hidden":"true"},null,4)):J("",!0)],42,o4e))}}})),[["__scopeId","data-v-a9489508"]]),Zl=Aq;Zl.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",Zl.__name,Zl.name].filter(n=>!!n));for(const n of t)e.component(n,Aq)};const Fx=Object.freeze(Object.defineProperty({__proto__:null,default:Zl},Symbol.toStringTag,{value:"Module"})),r4e={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"},l4e={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"},a4e={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"},u4e={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"},c4e={class:"admonition-title"},d4e=["aria-expanded","aria-controls"],f4e=["id"],E9=Hi(dt({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:t}){var n;const i=e,o=t,s=D(()=>{if(i.node.title&&i.node.title.trim().length)return i.node.title;const u=i.node.kind||"note";return u.charAt(0).toUpperCase()+u.slice(1)}),r=q(!!i.node.collapsible&&!((n=i.node.open)==null||n));function l(){i.node.collapsible&&(r.value=!r.value)}const a=`admonition-${Math.random().toString(36).slice(2,9)}`;return(u,c)=>(k(),L("div",{class:Pe(["admonition",[`admonition-${i.node.kind}`]])},[_("div",{id:a,class:"admonition-legend"},[i.node.kind==="note"||i.node.kind==="info"?(k(),L("svg",r4e,[...c[1]||(c[1]=[_("circle",{cx:"12",cy:"12",r:"10"},null,-1),_("path",{d:"M12 16v-4"},null,-1),_("path",{d:"M12 8h.01"},null,-1)])])):i.node.kind==="tip"?(k(),L("svg",l4e,[...c[2]||(c[2]=[_("path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5"},null,-1),_("path",{d:"M9 18h6"},null,-1),_("path",{d:"M10 22h4"},null,-1)])])):i.node.kind==="warning"||i.node.kind==="caution"?(k(),L("svg",a4e,[...c[3]||(c[3]=[_("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"},null,-1),_("path",{d:"M12 9v4"},null,-1),_("path",{d:"M12 17h.01"},null,-1)])])):i.node.kind==="danger"||i.node.kind==="error"?(k(),L("svg",u4e,[...c[4]||(c[4]=[_("polygon",{points:"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"},null,-1),_("path",{d:"M12 8v4"},null,-1),_("path",{d:"M12 16h.01"},null,-1)])])):J("",!0),_("span",c4e,P(s.value),1),i.node.collapsible?(k(),L("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${a}-content`,onClick:l},[(k(),L("svg",{style:an({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"},[...c[5]||(c[5]=[_("path",{d:"m9 18 6-6-6-6"},null,-1)])],4))],8,d4e)):J("",!0)]),mi(_("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[U(f(Zl),{"index-key":`admonition-${e.indexKey}`,nodes:i.node.children,"custom-id":i.customId,typewriter:i.typewriter,fade:i.fade,onCopy:c[0]||(c[0]=d=>o("copy",d))},null,8,["index-key","nodes","custom-id","typewriter","fade"])],8,f4e),[[hs,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);E9.install=e=>{e.component(E9.__name,E9)};const IA=()=>_s(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let xy=null,Sy=IA,_y=null,_D=!1,ID=!1;function g8t(){return xo(this,null,function*(){if(xy)return xy;const e=Sy;return e?e===IA&&_D?null:_y||(_y=xo(null,null,function*(){let t;try{t=yield e()}catch(n){if(e===IA)return e===Sy&&(_D=!0,(function(i){ID||(ID=!0,console.warn('[markstream-vue] Optional dependency "@terrastruct/d2" is not installed. D2 blocks will render as source.',i))})(n)),null;throw n}finally{e===Sy&&(_y=null)}return e!==Sy?null:t?(xy=(function(n){var i;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=(i=n.default)!=null?i:n;return typeof o=="function"?o:o?.D2&&typeof o.D2=="function"?o.D2:o})(t),xy):null}),_y):null})}let Iy=null,xq=null,My=null;function v8t(){return typeof xq=="function"}function y8t(){return xo(this,null,function*(){if(Iy)return Iy;const e=xq;return e?My||(My=xo(null,null,function*(){const t=yield e(),n=(function(i){var o,s,r;if(!i)return null;const l=(o=i.default)!=null?o:i,a=typeof l=="function"&&typeof((s=l.prototype)==null?void 0:s.render)=="function"?l:(r=i.Infographic)!=null?r:l?.Infographic;return typeof a=="function"?a:null})(t);return n?(Iy=n,Iy):null}).finally(()=>{My=null}),My):null})}const k8t=Symbol("markstreamLanguageIconResolver");function h4e(e){return new Worker("/assets/katexRenderer.worker-CO_gEm4q.js",{type:"module",name:e?.name})}function p4e(e){return new Worker("/assets/mermaidParser.worker-BFSlSHEW.js",{type:"module",name:e?.name})}let MD=!1;function Sq(){MD||typeof Worker>"u"||(MD=!0,Uye(new h4e),o9e(new p4e))}Sq();function Hd(e,t,n="/api/v1"){return`${e}${n}${t.startsWith("/")?t:`/${t}`}`}function TD(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()}const Rx={},ob=Symbol("resolveImage"),Lc=3e4,Ty=5*6e4,ED=5*6e4,_q="0123456789ABCDEFGHJKMNPQRSTVWXYZ",MA=500,Iq=40101;function LD(e,t){for(const[n,i]of Object.entries(t))if(i!==void 0)if(Array.isArray(i))for(const o of i)o!==void 0&&e.append(n,String(o));else e.set(n,String(i))}function i0(e=Lc){try{return AbortSignal.timeout(e)}catch{return}}function m4e(e,t){const n=i0(e);if(n===void 0)return t;try{return AbortSignal.any([n,t])}catch{return t}}function g4e(e,t){let n="",i=e;for(let o=0;o_q[n%32]).join("")}function Ng(){return`${g4e(Date.now(),10)}${v4e(16)}`}function ND(e){try{const t=[];return e.forEach((n,i)=>{typeof n=="string"?t.push({field:i,value:n}):t.push({field:i,file:n.name,size:n.size,type:n.type})}),{formData:t}}catch{return"[FormData]"}}async function hw(e){try{const t=await e.text();return t?t.length>MA?`${t.slice(0,MA)}...`:t:void 0}catch{return}}class DD{constructor(t){this.opts=t,this.tracer=t.tracer??Rx}tracer;async get(t,n){return this.request("GET",t,void 0,n)}async getBlob(t,n,i){let o=Hd(this.opts.origin,t,this.opts.restBasePath);if(n){const c=new URLSearchParams;LD(c,n);const d=c.toString();d&&(o=`${o}?${d}`)}const s=Ng(),r={"X-Request-Id":s};this.addClientHeaders(r);const l=Date.now();this.tracer.restRequest?.({method:"GET",path:t,url:o,requestId:s});let a;try{a=await fetch(o,{method:"GET",headers:r,signal:i0()})}catch(c){throw this.tracer.restFailure?.({method:"GET",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-l,error:c}),new ra({message:`Network error calling GET ${t}`,cause:c,method:"GET",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:Lc,timestamp:Date.now(),durationMs:Date.now()-l})}if(a.ok){this.tracer.restResponse?.({method:"GET",path:t,requestId:s,status:a.status,durationMs:Date.now()-l,code:0,msg:""});const c=Number(a.headers.get("content-length")??0);if(i?.maxBytes!==void 0&&c>i.maxBytes)throw a.body?.cancel(),new A7({size:c,limit:i.maxBytes});return a.blob()}let u;try{u=await a.clone().json()}catch{}throw this.checkAuthRequired(a,u?.code??0),this.tracer.restResponse?.({method:"GET",path:t,requestId:s,status:a.status,durationMs:Date.now()-l,code:u?.code??a.status,msg:u?.msg??a.statusText,envelopeRequestId:u?.request_id}),new Vu({code:u?.code??a.status,msg:u?.msg??a.statusText,requestId:u?.request_id??s,details:u?.details,timestamp:Date.now(),durationMs:Date.now()-l})}async post(t,n,i){return this.request("POST",t,n,void 0,i)}async postZip(t,n,i){const o="POST",s=Hd(this.opts.origin,t,this.opts.restBasePath),r=Ng(),l={"X-Request-Id":r,"Content-Type":"application/json; charset=utf-8"};this.addClientHeaders(l);const a=Date.now();this.tracer.restRequest?.({method:o,path:t,url:s,requestId:r,body:i});let u;try{u=await fetch(s,{method:o,headers:l,body:JSON.stringify(n),signal:i0(Ty)})}catch(p){throw this.tracer.restFailure?.({method:o,path:t,requestId:r,phase:"fetch",durationMs:Date.now()-a,error:p}),new ra({message:`Network error calling ${o} ${t}`,cause:p,method:o,path:t,url:s,requestId:r,phase:"fetch",timeoutMs:Ty,timestamp:Date.now(),durationMs:Date.now()-a})}const c=u.headers.get("content-type")??void 0,d=c?.split(";",1)[0]?.trim().toLowerCase();if(!u.ok||d!=="application/zip"){let p;try{p=await u.clone().json()}catch{}if(this.checkAuthRequired(u,p?.code??0),!u.ok||p!==void 0&&p.code!==0){const y=p?.code??u.status,b=p?.msg??u.statusText;throw this.tracer.restResponse?.({method:o,path:t,requestId:r,status:u.status,durationMs:Date.now()-a,code:y,msg:b,envelopeRequestId:p?.request_id}),new Vu({code:y,msg:b,requestId:p?.request_id??r,details:p?.details,timestamp:Date.now(),durationMs:Date.now()-a})}const m=u.clone(),g=new TypeError(`Expected application/zip, received ${c??"no content type"}`);throw this.tracer.restFailure?.({method:o,path:t,requestId:r,phase:"parse",durationMs:Date.now()-a,status:u.status,error:g}),new ra({message:`Invalid ZIP response from ${o} ${t}`,cause:g,method:o,path:t,url:s,requestId:r,phase:"parse",timeoutMs:Ty,status:u.status,statusText:u.statusText,contentType:c,bodyPreview:await hw(m),timestamp:Date.now(),durationMs:Date.now()-a})}let h;try{h=await u.blob()}catch(p){throw this.tracer.restFailure?.({method:o,path:t,requestId:r,phase:"parse",durationMs:Date.now()-a,status:u.status,error:p}),new ra({message:`Failed to read ZIP response from ${o} ${t}`,cause:p,method:o,path:t,url:s,requestId:r,phase:"parse",timeoutMs:Ty,status:u.status,statusText:u.statusText,contentType:c,timestamp:Date.now(),durationMs:Date.now()-a})}return this.tracer.restResponse?.({method:o,path:t,requestId:r,status:u.status,durationMs:Date.now()-a,code:0,msg:""}),{blob:h,contentDisposition:u.headers.get("content-disposition")??void 0}}async postForm(t,n,i){if(i?.onUploadProgress!==void 0)return this.postFormXhr(t,n,i.onUploadProgress);const o=Hd(this.opts.origin,t,this.opts.restBasePath),s=Ng(),r={"X-Request-Id":s};this.addClientHeaders(r);const l=Date.now();this.tracer.restRequest?.({method:"POST",path:t,url:o,requestId:s,body:ND(n)});let a;try{a=await fetch(o,{method:"POST",headers:r,body:n,signal:i0()})}catch(d){throw this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-l,error:d}),new ra({message:`Network error calling POST ${t}`,cause:d,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:Lc,timestamp:Date.now(),durationMs:Date.now()-l})}let u;const c=a.clone();try{u=await a.json()}catch(d){throw this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"parse",durationMs:Date.now()-l,status:a.status,error:d}),new ra({message:`Failed to parse JSON response from POST ${t}`,cause:d,method:"POST",path:t,url:o,requestId:s,phase:"parse",timeoutMs:Lc,status:a.status,statusText:a.statusText,contentType:a.headers.get("content-type")??void 0,bodyPreview:await hw(c),timestamp:Date.now(),durationMs:Date.now()-l})}if(this.tracer.restResponse?.({method:"POST",path:t,requestId:s,status:a.status,durationMs:Date.now()-l,code:u.code,msg:u.msg,envelopeRequestId:u.request_id,data:u.data}),this.checkAuthRequired(a,u.code),u.code!==0){const d=u.code??a.status;throw new Vu({code:d,msg:u.msg??a.statusText,requestId:u.request_id??s,details:u.details,timestamp:Date.now(),durationMs:Date.now()-l})}return u.data}postFormXhr(t,n,i){const o=Hd(this.opts.origin,t,this.opts.restBasePath),s=Ng(),r={"X-Request-Id":s};this.addClientHeaders(r);const l=Date.now();return this.tracer.restRequest?.({method:"POST",path:t,url:o,requestId:s,body:ND(n)}),new Promise((a,u)=>{const c=new XMLHttpRequest;c.open("POST",o),c.timeout=Lc;for(const[d,h]of Object.entries(r))c.setRequestHeader(d,h);c.upload.onprogress=d=>{d.lengthComputable&&i(d.loaded,d.total)},c.onerror=()=>{this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-l,error:c.statusText||"network error"}),u(new ra({message:`Network error calling POST ${t}`,cause:null,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:Lc,timestamp:Date.now(),durationMs:Date.now()-l}))},c.ontimeout=()=>{this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-l,error:"timeout"}),u(new ra({message:`Timeout calling POST ${t}`,cause:null,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:Lc,timestamp:Date.now(),durationMs:Date.now()-l}))},c.onload=()=>{let d;try{d=JSON.parse(c.responseText)}catch(h){this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"parse",durationMs:Date.now()-l,status:c.status,error:h}),u(new ra({message:`Failed to parse JSON response from POST ${t}`,cause:h,method:"POST",path:t,url:o,requestId:s,phase:"parse",timeoutMs:Lc,status:c.status,statusText:c.statusText,bodyPreview:c.responseText.slice(0,MA),timestamp:Date.now(),durationMs:Date.now()-l}));return}if(this.tracer.restResponse?.({method:"POST",path:t,requestId:s,status:c.status,durationMs:Date.now()-l,code:d.code,msg:d.msg,envelopeRequestId:d.request_id,data:d.data}),this.checkAuthStatus(c.status,d.code),d.code!==0){const h=d.code??c.status;u(new Vu({code:h,msg:d.msg??c.statusText,requestId:d.request_id??s,details:d.details,timestamp:Date.now(),durationMs:Date.now()-l}));return}a(d.data)},c.send(n)})}async patch(t,n){return this.request("PATCH",t,n)}async put(t,n){return this.request("PUT",t,n)}async delete(t){return this.request("DELETE",t)}async request(t,n,i,o,s={}){const r=s.allowCodes??[],l=s.timeoutMs??Lc,a=s.signal;let u=Hd(this.opts.origin,n,this.opts.restBasePath);if(o){const y=new URLSearchParams;LD(y,o);const b=y.toString();b&&(u=`${u}?${b}`)}const c=Ng(),d={"X-Request-Id":c};this.addClientHeaders(d),i!==void 0&&(d["Content-Type"]="application/json; charset=utf-8");const h=Date.now();this.tracer.restRequest?.({method:t,path:n,url:u,requestId:c,body:i});let p;try{p=await fetch(u,{method:t,headers:d,body:i!==void 0?JSON.stringify(i):void 0,signal:a!==void 0?m4e(l,a):i0(l)})}catch(y){throw a?.aborted&&y instanceof Error&&y.name==="AbortError"?y:(this.tracer.restFailure?.({method:t,path:n,requestId:c,phase:"fetch",durationMs:Date.now()-h,error:y}),new ra({message:`Network error calling ${t} ${n}`,cause:y,method:t,path:n,url:u,requestId:c,phase:"fetch",timeoutMs:l,timestamp:Date.now(),durationMs:Date.now()-h}))}let m;const g=p.clone();try{const y=await p.text();m=p.status===204&&y===""?{code:0,msg:"",data:null,request_id:c}:JSON.parse(y)}catch(y){throw a?.aborted&&y instanceof Error&&y.name==="AbortError"?y:(this.tracer.restFailure?.({method:t,path:n,requestId:c,phase:"parse",durationMs:Date.now()-h,status:p.status,error:y}),new ra({message:`Failed to parse JSON response from ${t} ${n}`,cause:y,method:t,path:n,url:u,requestId:c,phase:"parse",timeoutMs:l,status:p.status,statusText:p.statusText,contentType:p.headers.get("content-type")??void 0,bodyPreview:await hw(g),timestamp:Date.now(),durationMs:Date.now()-h}))}if(this.tracer.restResponse?.({method:t,path:n,requestId:c,status:p.status,durationMs:Date.now()-h,code:m.code,msg:m.msg,envelopeRequestId:m.request_id,data:m.data}),this.checkAuthRequired(p,m.code),m.code!==0&&!r.includes(m.code))throw new Vu({code:typeof m.code=="number"?m.code:p.status,msg:typeof m.msg=="string"&&m.msg.length>0?m.msg:`HTTP ${p.status}${p.statusText?` ${p.statusText}`:""}`,requestId:m.request_id??c,details:m.details,timestamp:Date.now(),durationMs:Date.now()-h});return m.data}addClientHeaders(t){const n=this.opts.credentialStore?.getToken();n!==void 0&&(t.Authorization=`Bearer ${n}`);const i=this.opts.identity;i!==void 0&&(t["X-Kimi-Client-Id"]=i.clientId,t["X-Kimi-Client-Name"]=i.clientName,t["X-Kimi-Client-Version"]=i.clientVersion,t["X-Kimi-Client-Ui-Mode"]=i.clientUiMode)}checkAuthRequired(t,n){this.checkAuthStatus(t.status,n)}checkAuthStatus(t,n){(t===401||n===Iq)&&this.opts.credentialStore?.markAuthRequired?.()}}function Mq(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 FD(e){return e.contextTokens===0&&e.contextLimit===0&&e.inputTokens===0&&e.outputTokens===0&&e.turnCount===0}function ju(e){return{id:e.id,title:e.title,createdAt:e.created_at,updatedAt:e.updated_at,busy:e.busy,mainTurnActive:e.main_turn_active,pendingInteraction:e.pending_interaction,lastTurnReason:e.last_turn_reason,archived:e.archived??!1,archivedAt:e.archived_at,currentPromptId:e.current_prompt_id,lastPrompt:e.last_prompt,cwd:e.metadata.cwd,model:e.agent_config.model,usage:Mq(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 Ey(e){const t=e.activity.status;return{id:e.id,title:e.meta.title??e.meta.last_prompt??e.id.slice(0,12),createdAt:new Date(e.meta.created_at).toISOString(),updatedAt:new Date(e.meta.updated_at).toISOString(),busy:t==="running",pendingInteraction:t==="approval"?"approval":t==="question"?"question":void 0,lastTurnReason:t==="failed"?"failed":void 0,archived:e.meta.archived,archivedAt:e.meta.archived_at==null?void 0:new Date(e.meta.archived_at).toISOString(),lastPrompt:e.meta.last_prompt??void 0,cwd:e.workspace.cwd??"",model:e.activity.model??"",pullRequest:e.git===void 0?void 0:e.git.pull_request,usage:{inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheCreationTokens:0,totalCostUsd:0,contextTokens:0,contextLimit:0,turnCount:0},messageCount:0,lastSeq:0,workspaceId:e.workspace.id.length>0?e.workspace.id:void 0}}function j0(e){return{id:e.id,root:e.root,name:e.name,lastOpenedAt:e.last_opened_at,sessionCount:e.session_count}}function RD(e){return e.kind==="base64"?{kind:"base64",mediaType:e.media_type,data:e.data}:e.kind==="file"?{kind:"file",fileId:e.file_id}:e.kind==="session_media"?{kind:"sessionMedia",fileId:e.file_id}:{kind:"url",url:e.url}}function D4(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:RD(e.source)};case"video":return{type:"video",source:RD(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 Tq(e){return{id:e.id,sessionId:e.session_id,role:e.role,content:e.content.map(D4),createdAt:e.created_at,promptId:e.prompt_id,parentMessageId:e.parent_message_id,metadata:e.metadata}}function Eq(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}:t.kind==="sessionMedia"?n={kind:"session_media",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 y4e(e){return{content:e.content.map(Eq),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,skills:e.skills}}function k4e(e){return{decision:e.decision,scope:e.scope,feedback:e.feedback,selected_label:e.selectedLabel}}function b4e(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 w4e(e){return{id:e.id,label:e.label,description:e.description,recommended:e.recommended===!0||e.is_recommended===!0}}function C4e(e){return{id:e.id,question:e.question,header:e.header,body:e.body,options:e.options.map(w4e),multiSelect:e.multi_select,allowOther:e.allow_other,otherLabel:e.other_label,otherDescription:e.other_description}}function A4e(e){return{questionId:e.question_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,questions:e.questions.map(C4e),createdAt:e.created_at}}function x4e(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 S4e(e){const t={};for(const[n,i]of Object.entries(e.answers))t[n]=x4e(i);return{answers:t,method:e.method,note:e.note}}function TA(e,t){if(typeof e.run_in_background!="boolean")throw new Error(`task wire missing required run_in_background (id ${e.id})`);return{id:e.id,agentId:e.agent_id??t,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,model:e.model,thinkingEffort:e.thinking_effort,parentToolCallId:e.parent_tool_call_id,suspendedReason:e.suspended_reason,swarmIndex:e.swarm_index,runInBackground:e.run_in_background}}function OD(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 xd(e,t){const n=e[t];return typeof n=="string"?n:void 0}function Jp(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function Ia(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function Lq(e){if(!e||typeof e!="object")return null;const t=e,n=xd(t,"status");if(n!=="active"&&n!=="paused"&&n!=="blocked"&&n!=="complete")return null;const i=t.budget,o=i&&typeof i=="object"?i:{};return{goalId:xd(t,"goalId")??xd(t,"goal_id")??"goal",objective:xd(t,"objective")??"",completionCriterion:xd(t,"completionCriterion")??xd(t,"completion_criterion"),status:n,turnsUsed:Jp(t,"turnsUsed")??Jp(t,"turns_used")??0,tokensUsed:Jp(t,"tokensUsed")??Jp(t,"tokens_used")??0,wallClockMs:Jp(t,"wallClockMs")??Jp(t,"wall_clock_ms")??0,terminalReason:xd(t,"terminalReason")??xd(t,"terminal_reason"),budget:{tokenBudget:Ia(o,"tokenBudget")??Ia(o,"token_budget"),remainingTokens:Ia(o,"remainingTokens")??Ia(o,"remaining_tokens"),turnBudget:Ia(o,"turnBudget")??Ia(o,"turn_budget"),remainingTurns:Ia(o,"remainingTurns")??Ia(o,"remaining_turns"),wallClockBudgetMs:Ia(o,"wallClockBudgetMs")??Ia(o,"wall_clock_budget_ms"),remainingWallClockMs:Ia(o,"remainingWallClockMs")??Ia(o,"remaining_wall_clock_ms"),overBudget:o.overBudget===!0||o.over_budget===!0}}}function _4e(e){const t=e;switch(e.type){case"event.session.created":return{type:"sessionCreated",session:ju(t.payload.session)};case"event.session.updated":return{type:"sessionUpdated",session:ju(t.payload.session),changedFields:t.payload.changed_fields};case"event.session.deleted":return{type:"sessionDeleted",sessionId:t.session_id};case"event.session.archived":{const n=t.payload?.sessionId??t.payload?.session_id;if(typeof n!="string"||n.length===0)return{type:"unknown",raw:{_noop:!0,_wireType:t.type}};const i=t.payload?.workspace_id;return{type:"sessionArchived",sessionId:n,workspaceId:typeof i=="string"&&i.length>0?i:void 0}}case"event.workspace.created":return{type:"workspaceCreated",workspace:j0(t.payload.workspace)};case"event.workspace.updated":return{type:"workspaceUpdated",workspace:j0(t.payload.workspace)};case"event.workspace.deleted":return{type:"workspaceDeleted",workspaceId:t.payload.workspace_id,root:t.payload.root};case"event.session.work_changed":return{type:"sessionWorkChanged",sessionId:t.session_id,busy:t.payload.busy,mainTurnActive:t.payload.main_turn_active,pendingInteraction:t.payload.pending_interaction,lastTurnReason:t.payload.last_turn_reason};case"event.session.status_changed":return{type:"sessionWorkChanged",sessionId:t.session_id,busy:t.payload.status!=="idle"&&t.payload.status!=="aborted",mainTurnActive:t.payload.status!=="idle"&&t.payload.status!=="aborted",pendingInteraction:t.payload.status==="awaiting_approval"?"approval":t.payload.status==="awaiting_question"?"question":"none",lastTurnReason:t.payload.status==="aborted"?"cancelled":void 0};case"event.session.usage_updated":return{type:"sessionUsageUpdated",sessionId:t.session_id,usage:Mq(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=Lq(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:Tq(t.payload.message)};case"event.message.updated":return{type:"messageUpdated",sessionId:t.session_id,messageId:t.payload.message_id,content:t.payload.content.map(D4),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:b4e(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,feedback:t.payload.feedback,selectedLabel:t.payload.selected_label};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:A4e(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:TA(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.plugin.changed":return{type:"pluginsChanged"};case"event.capability.changed":return{type:"capabilityChanged",capabilityId:t.payload.capability_id,install:t.payload.install};case"event.config.changed":return{type:"configChanged",changedFields:t.payload.changed_fields,config:EA(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 I4e(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 Xp(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 PD(e){return{id:e.id,name:e.name,wireType:e.wire_type,guessed:e.guessed,needsBaseUrl:e.needs_base_url,rejected:e.rejected,rejectReason:e.reject_reason,envKey:e.env_key,models:e.models.map(t=>({id:t.id,name:t.name,maxContextSize:t.max_context_size,capabilities:t.capabilities,reasoning:t.reasoning}))}}function EA(e){const t={};for(const[n,i]of Object.entries(e.providers))t[n]={type:i.type,baseUrl:i.base_url,defaultModel:i.default_model,hasApiKey:i.has_api_key};return{providers:t,defaultProvider:e.default_provider,defaultModel:e.default_model,secondaryModel:e.secondary_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 M4e(e){return e.session_id}function T4e(e){return e.seq}function E4e(e){const t=Number(e.slice(1));return Number.isFinite(t)?t:0}function $D(e){switch(e.kind){case"turn":return e.turnId;case"marker":return e.markerId;case"taskref":return e.refId}}const L4e={items:[],tasks:new Map,interactions:new Map,attachments:new Map,todos:new Map,prompts:new Map,meta:{},pendingInteractions:new Set,hasMoreOlder:!1};function N4e(e,t){switch(t.op){case"reset":return D4e(e,t);case"turn.upsert":return R4e(e,t.turn);case"step.upsert":return P4e(e,t.turnId,t.step);case"frame.upsert":return B4e(e,t);case"append":return j4e(e,t);case"marker.upsert":return zD(e,t.item,t.item.markerId,t.beforeTurn);case"taskref.upsert":return zD(e,t.item,t.item.refId,t.beforeTurn);case"task.upsert":return q4e(e,t.task);case"interaction.upsert":return U4e(e,t.interaction);case"attachment.upsert":return K4e(e,t.attachment);case"todo.upsert":return G4e(e,t.todo);case"prompt.upsert":return Y4e(e,t.prompt);case"meta.merge":return e3e(e,t.meta);case"items.remove":return W4e(e,t.ids)}}function D4e(e,t){const n=new Set;for(const i of t.snapshot.interactions)i.state==="pending"&&n.add(i.interactionId);return{state:{items:t.snapshot.items,tasks:new Map(t.snapshot.tasks.map(i=>[i.taskId,i])),interactions:new Map(t.snapshot.interactions.map(i=>[i.interactionId,i])),attachments:new Map(t.snapshot.attachments.map(i=>[i.attachmentId,i])),todos:new Map(t.snapshot.todos.map(i=>[i.todoId,i])),prompts:new Map(t.snapshot.prompts.map(i=>[i.promptId,i])),meta:t.snapshot.meta,pendingInteractions:n,hasMoreOlder:t.snapshot.hasMoreOlder??!1},changed:!0}}function BD(e,t){return{...e,kind:"turn",steps:[...t]}}function Nq(e){return{kind:"turn",turnId:e,ordinal:E4e(e),state:"running",origin:{kind:"other"},steps:[]}}function F4e(e,t){const n=Number(e.slice(t.length+1))||0;return{kind:"step",stepId:e,turnId:t,ordinal:n,state:"running",frames:[]}}function dm(e,t){const n=e.items.find(i=>i.kind==="turn"&&i.turnId===t);return n?.kind==="turn"?n:void 0}function Ox(e,t){const n=[...e];let i=n.length;for(let o=0;ot.ordinal){i=o;break}}return n.splice(i,0,t),n}function F4(e,t,n){return e.map(i=>i.kind==="turn"&&i.turnId===t?n(i):i)}function R4e(e,t){const n=dm(e,t.turnId);return n?O4e(n,t)?{state:e,changed:!1}:{state:{...e,items:F4(e.items,t.turnId,i=>BD(t,i.steps))},changed:!0}:{state:{...e,items:Ox(e.items,BD(t,[]))},changed:!0}}function O4e(e,t){return e.ordinal===t.ordinal&&e.triggerPromptId===t.triggerPromptId&&e.state===t.state&&e.prompt===t.prompt&&e.attachmentIds===t.attachmentIds&&e.startedAt===t.startedAt&&e.endedAt===t.endedAt&&e.origin.kind===t.origin.kind&&e.origin.payload===t.origin.payload&&e.usage===t.usage&&e.durationMs===t.durationMs&&e.error===t.error}function P4e(e,t,n){const i=dm(e,t)??Nq(t),o=i.steps.findIndex(u=>u.stepId===n.stepId);let s,r=!0;if(o>=0){const u=i.steps[o];u&&$4e(u,n)?(r=!1,s=i.steps):s=i.steps.map(c=>c.stepId===n.stepId?{...n,kind:"step",frames:c.frames}:c)}else s=[...i.steps,{...n,kind:"step",frames:[]}].toSorted((u,c)=>u.ordinal-c.ordinal);if(!r)return{state:e,changed:!1};const l={...i,steps:[...s]},a=dm(e,t)?F4(e.items,t,()=>l):Ox(e.items,l);return{state:{...e,items:a},changed:!0}}function $4e(e,t){return e.ordinal===t.ordinal&&e.state===t.state&&e.startedAt===t.startedAt&&e.endedAt===t.endedAt&&e.usage===t.usage&&e.finishReason===t.finishReason&&e.timing===t.timing&&e.retry===t.retry&&e.endReason===t.endReason&&e.endMessage===t.endMessage}function B4e(e,t){const n=dm(e,t.turnId)??Nq(t.turnId),i=n.steps.find(c=>c.stepId===t.stepId)??F4e(t.stepId,t.turnId),o=i.frames.findIndex(c=>c.frameId===t.frame.frameId);let s;if(o>=0){const c=i.frames[o];if(c!==void 0&&z4e(c,t.frame))return{state:e,changed:!1};s=i.frames.map(d=>d.frameId===t.frame.frameId?t.frame:d)}else s=[...i.frames,t.frame];const r={...i,frames:[...s]},l=n.steps.some(c=>c.stepId===t.stepId)?n.steps.map(c=>c.stepId===t.stepId?r:c):[...n.steps,r].toSorted((c,d)=>c.ordinal-d.ordinal),a={...n,steps:l},u=dm(e,t.turnId)?F4(e.items,t.turnId,()=>a):Ox(e.items,a);return{state:{...e,items:u},changed:!0}}function z4e(e,t){return e.kind!==t.kind?!1:e.kind==="text"&&t.kind==="text"?e.text===t.text&&e.role===t.role&&e.attachmentIds===t.attachmentIds&&e.taskId===t.taskId:e.kind==="thinking"&&t.kind==="thinking"?e.text===t.text:e.kind==="tool"&&t.kind==="tool"?e.state===t.state&&e.toolCallId===t.toolCallId&&e.name===t.name&&e.view===t.view&&e.input===t.input&&e.output===t.output&&e.display===t.display&&e.error===t.error&&e.inputText===t.inputText&&e.progress===t.progress&&e.taskId===t.taskId&&e.approvalId===t.approvalId&&e.todoId===t.todoId&&e.agentRefs===t.agentRefs:e.kind==="notice"&&t.kind==="notice"?e.message===t.message&&e.level===t.level&&e.detail===t.detail:!1}function j4e(e,t){if(t.target.type==="task")return H4e(e,t);const{turnId:n,stepId:i,frameId:o}=t.target,s=dm(e,n),r=s?.steps.find(h=>h.stepId===i),l=r?.frames.find(h=>h.frameId===o);if(!s||!r||!l||l.kind!=="text"&&l.kind!=="thinking")return{state:e,changed:!1,gap:{expected:0,got:t.offset}};const a=Dq(l.text,t.offset,t.text);if(a.gap)return{state:e,changed:!1,gap:a.gap};if(!a.changed)return{state:e,changed:!1};const u={...l,text:a.text},c={...r,frames:r.frames.map(h=>h.frameId===o?u:h)},d={...s,steps:s.steps.map(h=>h.stepId===i?c:h)};return{state:{...e,items:F4(e.items,n,()=>d)},changed:!0}}function H4e(e,t){if(t.target.type!=="task")throw new Error("unreachable");const n=t.target.taskId,i=e.tasks.get(n),o=i?.outputTail??"",s=Dq(o,t.offset,t.text);if(s.gap)return{state:e,changed:!1,gap:s.gap};if(!s.changed)return{state:e,changed:!1};const r=i?{...i,outputTail:s.text}:{taskId:n,kind:"other",state:"running",detached:!1,outputTail:s.text},l=new Map(e.tasks);return l.set(n,r),{state:{...e,tasks:l},changed:!0}}function Dq(e,t,n){if(t>e.length)return{text:e,changed:!1,gap:{expected:e.length,got:t}};if(e.slice(t,t+n.length)===n)return{text:e,changed:!1};const i=e.length-t;return e.slice(t)!==n.slice(0,i)?{text:e,changed:!1,gap:{expected:e.length,got:t}}:(i>0?n.slice(i):n).length===0?{text:e,changed:!1}:{text:e.slice(0,t)+n,changed:!0}}function zD(e,t,n,i){if(e.items.some(s=>LA(s)===n)){let s=!1;const r=e.items.map(l=>LA(l)!==n||l===t?l:(s=!0,t));return s?{state:{...e,items:r},changed:!0}:{state:e,changed:!1}}if(i!==void 0){const s=[...e.items];let r=s.length;for(let l=0;l=i){r=l;break}}return s.splice(r,0,t),{state:{...e,items:s},changed:!0}}return{state:{...e,items:[...e.items,t]},changed:!0}}function LA(e){switch(e.kind){case"turn":return e.turnId;case"marker":return e.markerId;case"taskref":return e.refId}}function W4e(e,t){const n=new Set(t),i=e.items.filter(l=>l.kind==="turn"&&n.has(l.turnId)),o=e.items.filter(l=>!n.has(LA(l)));if(o.length===e.items.length)return{state:e,changed:!1};let s=e.pendingInteractions,r=e.interactions;if(i.length>0){const l=new Set,a=new Set(s),u=new Set;for(const c of i)for(const d of c.steps)for(const h of d.frames)h.kind==="tool"&&l.add(h.toolCallId);for(const c of r.values())c.toolCallId!==void 0&&l.has(c.toolCallId)&&(u.add(c.interactionId),a.delete(c.interactionId));if(u.size>0){const c=new Map(r);for(const d of u)c.delete(d);r=c}s=a}return{state:{...e,items:o,interactions:r,pendingInteractions:s},changed:!0}}function q4e(e,t){const n=e.tasks.get(t.taskId);if(n&&X4e(n,t))return{state:e,changed:!1};const i=new Map(e.tasks);return i.set(t.taskId,t),{state:{...e,tasks:i},changed:!0}}function U4e(e,t){const n=e.interactions.get(t.interactionId);if(n&&V4e(n,t))return{state:e,changed:!1};const i=new Map(e.interactions);i.set(t.interactionId,t);let o=e.pendingInteractions;if(t.state==="pending"){if(!o.has(t.interactionId)){const s=new Set(o);s.add(t.interactionId),o=s}}else if(o.has(t.interactionId)){const s=new Set(o);s.delete(t.interactionId),o=s}return{state:{...e,interactions:i,pendingInteractions:o},changed:!0}}function V4e(e,t){return e.interactionKind===t.interactionKind&&e.toolCallId===t.toolCallId&&e.state===t.state&&e.request===t.request&&e.response===t.response}function K4e(e,t){const n=e.attachments.get(t.attachmentId);if(n&&Z4e(n,t))return{state:e,changed:!1};const i=new Map(e.attachments);return i.set(t.attachmentId,t),{state:{...e,attachments:i},changed:!0}}function Z4e(e,t){return e.mediaType===t.mediaType&&e.name===t.name&&e.size===t.size&&e.source===t.source&&e.placeholder===t.placeholder}function G4e(e,t){const n=e.todos.get(t.todoId);if(n&&Q4e(n,t))return{state:e,changed:!1};const i=new Map(e.todos);return i.set(t.todoId,t),{state:{...e,todos:i},changed:!0}}function Q4e(e,t){return e.items===t.items&&e.updatedAt===t.updatedAt}function Y4e(e,t){const n=e.prompts.get(t.promptId);if(n&&J4e(n,t))return{state:e,changed:!1};const i=new Map(e.prompts);return i.set(t.promptId,t),{state:{...e,prompts:i},changed:!0}}function J4e(e,t){return e.status===t.status&&e.userMessageId===t.userMessageId&&e.content===t.content&&e.createdAt===t.createdAt&&e.finishedAt===t.finishedAt&&e.steeredAt===t.steeredAt}function X4e(e,t){return e.kind===t.kind&&e.state===t.state&&e.detached===t.detached&&e.description===t.description&&e.agentId===t.agentId&&e.outputTail===t.outputTail&&e.startedAt===t.startedAt&&e.endedAt===t.endedAt&&e.resultSummary===t.resultSummary&&e.error===t.error&&e.stateReason===t.stateReason&&e.usage===t.usage}function e3e(e,t){const n=t.modes!==void 0?{plan:t.modes.plan===null?void 0:t.modes.plan??e.meta.modes?.plan,swarm:t.modes.swarm===null?void 0:t.modes.swarm??e.meta.modes?.swarm,tower:t.modes.tower===null?void 0:t.modes.tower??e.meta.modes?.tower}:e.meta.modes,i=t.agent!==void 0?{...e.meta.agent,...t.agent}:e.meta.agent,o={goal:t.goal===null?void 0:t.goal??e.meta.goal,activity:t.activity??e.meta.activity,modes:n!==void 0&&n.plan===void 0&&n.swarm===void 0&&n.tower===void 0?void 0:n,agent:i};return o.goal===e.meta.goal&&o.activity===e.meta.activity&&o.modes===e.meta.modes&&o.agent===e.meta.agent?{state:e,changed:!1}:{state:{...e,meta:o},changed:!0}}class t3e{constructor(t){this.agentId=t}#e=L4e;#t=new Set;receive(t){return this.apply(t)}apply(t){const n=[];let i,o=this.#e;for(const s of t){const r=N4e(o,s);if(r.gap){i={target:s.target,...r.gap};continue}r.changed&&(o=r.state,n.push(s))}if(this.#e=o,n.length>0){const s={agentId:this.agentId,ops:n};for(const r of this.#t)r(s)}return{accepted:n,gap:i}}onChange(t){return this.#t.add(t),{dispose:()=>void this.#t.delete(t)}}getItems(){return this.#e.items}getTurn(t){const n=this.#e.items.find(i=>i.kind==="turn"&&i.turnId===t);return n?.kind==="turn"?n:void 0}getTasks(){return this.#e.tasks}getTask(t){return this.#e.tasks.get(t)}getInteractions(){return this.#e.interactions}getInteraction(t){return this.#e.interactions.get(t)}getAttachments(){return this.#e.attachments}getAttachment(t){return this.#e.attachments.get(t)}getTodos(){return this.#e.todos}getTodo(t){return this.#e.todos.get(t)}getPrompts(){return this.#e.prompts}getPrompt(t){return this.#e.prompts.get(t)}getMeta(){return this.#e.meta}listPendingInteractions(){return[...this.#e.pendingInteractions]}get hasMoreOlder(){return this.#e.hasMoreOlder}snapshot(t){let n=this.#e.items,i=this.#e.hasMoreOlder;if(t!==void 0){const o=n.reduce((s,r)=>r.kind==="turn"?s+1:s,0);if(o>t.tailTurns){const s=o-t.tailTurns,r=[];let l=0;for(const a of n)if(a.kind==="turn"){if(l+=1,l<=s)continue;r.push(a)}else l>s&&r.push(a);n=r,i=!0}}return{items:n,tasks:[...this.#e.tasks.values()],interactions:[...this.#e.interactions.values()],attachments:[...this.#e.attachments.values()],todos:[...this.#e.todos.values()],prompts:[...this.#e.prompts.values()],meta:this.#e.meta,hasMoreOlder:i}}}function Pt(e,t,n){function i(l,a){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:a,constr:r,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,a);const u=r.prototype,c=Object.keys(u);for(let d=0;dn?.Parent&&l instanceof n.Parent?!0:l?._zod?.traits?.has(e)}),Object.defineProperty(r,"name",{value:e}),r}class Q1 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Fq extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Rq={};function bf(e){return Rq}function Oq(e){const t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,o])=>t.indexOf(+i)===-1).map(([i,o])=>o)}function NA(e,t){return typeof t=="bigint"?t.toString():t}function R4(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Px(e){return e==null}function $x(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function n3e(e,t){const n=(e.toString().split(".")[1]||"").length,i=t.toString();let o=(i.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(i)){const a=i.match(/\d?e-(\d?)/);a?.[1]&&(o=Number.parseInt(a[1]))}const s=n>o?n:o,r=Number.parseInt(e.toFixed(s).replace(".","")),l=Number.parseInt(t.toFixed(s).replace(".",""));return r%l/10**s}const jD=Symbol("evaluating");function Zi(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==jD)return i===void 0&&(i=jD,i=n()),i},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function bp(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Rf(...e){const t={};for(const n of e){const i=Object.getOwnPropertyDescriptors(n);Object.assign(t,i)}return Object.defineProperties({},t)}function HD(e){return JSON.stringify(e)}function i3e(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Pq="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Tv(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const o3e=R4(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function fm(e){if(Tv(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Tv(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function $q(e){return fm(e)?{...e}:Array.isArray(e)?[...e]:e}const s3e=new Set(["string","number","symbol"]);function hm(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Of(e,t,n){const i=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(i._zod.parent=e),i}function On(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function r3e(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const l3e={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function a3e(e,t){const n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=Rf(e._zod.def,{get shape(){const r={};for(const l in t){if(!(l in n.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&(r[l]=n.shape[l])}return bp(this,"shape",r),r},checks:[]});return Of(e,s)}function u3e(e,t){const n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=Rf(e._zod.def,{get shape(){const r={...e._zod.def.shape};for(const l in t){if(!(l in n.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&delete r[l]}return bp(this,"shape",r),r},checks:[]});return Of(e,s)}function c3e(e,t){if(!fm(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const s=e._zod.def.shape;for(const r in t)if(Object.getOwnPropertyDescriptor(s,r)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=Rf(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return bp(this,"shape",s),s}});return Of(e,o)}function d3e(e,t){if(!fm(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Rf(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return bp(this,"shape",i),i}});return Of(e,n)}function f3e(e,t){const n=Rf(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t._zod.def.shape};return bp(this,"shape",i),i},get catchall(){return t._zod.def.catchall},checks:[]});return Of(e,n)}function h3e(e,t,n){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const r=Rf(t._zod.def,{get shape(){const l=t._zod.def.shape,a={...l};if(n)for(const u in n){if(!(u in l))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(a[u]=e?new e({type:"optional",innerType:l[u]}):l[u])}else for(const u in l)a[u]=e?new e({type:"optional",innerType:l[u]}):l[u];return bp(this,"shape",a),a},checks:[]});return Of(t,r)}function p3e(e,t,n){const i=Rf(t._zod.def,{get shape(){const o=t._zod.def.shape,s={...o};if(n)for(const r in n){if(!(r in s))throw new Error(`Unrecognized key: "${r}"`);n[r]&&(s[r]=new e({type:"nonoptional",innerType:o[r]}))}else for(const r in o)s[r]=new e({type:"nonoptional",innerType:o[r]});return bp(this,"shape",s),s}});return Of(t,i)}function S1(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n{var i;return(i=n).path??(i.path=[]),n.path.unshift(e),n})}function Ly(e){return typeof e=="string"?e:e?.message}function wf(e,t,n){const i={...e,path:e.path??[]};if(!e.message){const o=Ly(e.inst?._zod.def?.error?.(e))??Ly(t?.error?.(e))??Ly(n.customError?.(e))??Ly(n.localeError?.(e))??"Invalid input";i.message=o}return delete i.inst,delete i.continue,t?.reportInput||delete i.input,i}function Bx(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Ev(...e){const[t,n,i]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:i}:{...t}}const Bq=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,NA,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},zq=Pt("$ZodError",Bq),jq=Pt("$ZodError",Bq,{Parent:Error});function m3e(e,t=n=>n.message){const n={},i=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):i.push(t(o));return{formErrors:i,fieldErrors:n}}function g3e(e,t=n=>n.message){const n={_errors:[]},i=o=>{for(const s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(r=>i({issues:r}));else if(s.code==="invalid_key")i({issues:s.issues});else if(s.code==="invalid_element")i({issues:s.issues});else if(s.path.length===0)n._errors.push(t(s));else{let r=n,l=0;for(;l(t,n,i,o)=>{const s=i?Object.assign(i,{async:!1}):{async:!1},r=t._zod.run({value:n,issues:[]},s);if(r instanceof Promise)throw new Q1;if(r.issues.length){const l=new(o?.Err??e)(r.issues.map(a=>wf(a,s,bf())));throw Pq(l,o?.callee),l}return r.value},jx=e=>async(t,n,i,o)=>{const s=i?Object.assign(i,{async:!0}):{async:!0};let r=t._zod.run({value:n,issues:[]},s);if(r instanceof Promise&&(r=await r),r.issues.length){const l=new(o?.Err??e)(r.issues.map(a=>wf(a,s,bf())));throw Pq(l,o?.callee),l}return r.value},O4=e=>(t,n,i)=>{const o=i?{...i,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new Q1;return s.issues.length?{success:!1,error:new(e??zq)(s.issues.map(r=>wf(r,o,bf())))}:{success:!0,data:s.value}},v3e=O4(jq),P4=e=>async(t,n,i)=>{const o=i?Object.assign(i,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(r=>wf(r,o,bf())))}:{success:!0,data:s.value}},y3e=P4(jq),k3e=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return zx(e)(t,n,o)},b3e=e=>(t,n,i)=>zx(e)(t,n,i),w3e=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return jx(e)(t,n,o)},C3e=e=>async(t,n,i)=>jx(e)(t,n,i),A3e=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return O4(e)(t,n,o)},x3e=e=>(t,n,i)=>O4(e)(t,n,i),S3e=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return P4(e)(t,n,o)},_3e=e=>async(t,n,i)=>P4(e)(t,n,i),I3e=/^[cC][^\s-]{8,}$/,M3e=/^[0-9a-z]+$/,T3e=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,E3e=/^[0-9a-vA-V]{20}$/,L3e=/^[A-Za-z0-9]{27}$/,N3e=/^[a-zA-Z0-9_-]{21}$/,D3e=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,F3e=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,WD=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,R3e=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,O3e="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function P3e(){return new RegExp(O3e,"u")}const $3e=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,B3e=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,z3e=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,j3e=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,H3e=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Hq=/^[A-Za-z0-9_-]*$/,W3e=/^\+[1-9]\d{6,14}$/,Wq="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",q3e=new RegExp(`^${Wq}$`);function qq(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function U3e(e){return new RegExp(`^${qq(e)}$`)}function V3e(e){const t=qq({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const i=`${t}(?:${n.join("|")})`;return new RegExp(`^${Wq}T(?:${i})$`)}const K3e=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Z3e=/^-?\d+$/,Uq=/^-?\d+(?:\.\d+)?$/,G3e=/^(?:true|false)$/i,Q3e=/^[^A-Z]*$/,Y3e=/^[^a-z]*$/,Xl=Pt("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Vq={number:"number",bigint:"bigint",object:"date"},Kq=Pt("$ZodCheckLessThan",(e,t)=>{Xl.init(e,t);const n=Vq[typeof t.value];e._zod.onattach.push(i=>{const o=i._zod.bag,s=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value{(t.inclusive?i.value<=t.value:i.value{Xl.init(e,t);const n=Vq[typeof t.value];e._zod.onattach.push(i=>{const o=i._zod.bag,s=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),J3e=Pt("$ZodCheckMultipleOf",(e,t)=>{Xl.init(e,t),e._zod.onattach.push(n=>{var i;(i=n._zod.bag).multipleOf??(i.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):n3e(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),X3e=Pt("$ZodCheckNumberFormat",(e,t)=>{Xl.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),i=n?"int":"number",[o,s]=l3e[t.format];e._zod.onattach.push(r=>{const l=r._zod.bag;l.format=t.format,l.minimum=o,l.maximum=s,n&&(l.pattern=Z3e)}),e._zod.check=r=>{const l=r.value;if(n){if(!Number.isInteger(l)){r.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?r.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort}):r.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort});return}}ls&&r.issues.push({origin:"number",input:l,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),e8e=Pt("$ZodCheckMaxLength",(e,t)=>{var n;Xl.init(e,t),(n=e._zod.def).when??(n.when=i=>{const o=i.value;return!Px(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum{const o=i.value;if(o.length<=t.maximum)return;const r=Bx(o);i.issues.push({origin:r,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),t8e=Pt("$ZodCheckMinLength",(e,t)=>{var n;Xl.init(e,t),(n=e._zod.def).when??(n.when=i=>{const o=i.value;return!Px(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{const o=i.value;if(o.length>=t.minimum)return;const r=Bx(o);i.issues.push({origin:r,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),n8e=Pt("$ZodCheckLengthEquals",(e,t)=>{var n;Xl.init(e,t),(n=e._zod.def).when??(n.when=i=>{const o=i.value;return!Px(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=i=>{const o=i.value,s=o.length;if(s===t.length)return;const r=Bx(o),l=s>t.length;i.issues.push({origin:r,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),$4=Pt("$ZodCheckStringFormat",(e,t)=>{var n,i;Xl.init(e,t),e._zod.onattach.push(o=>{const s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})}),i8e=Pt("$ZodCheckRegex",(e,t)=>{$4.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),o8e=Pt("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Q3e),$4.init(e,t)}),s8e=Pt("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Y3e),$4.init(e,t)}),r8e=Pt("$ZodCheckIncludes",(e,t)=>{Xl.init(e,t);const n=hm(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=i,e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(i)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),l8e=Pt("$ZodCheckStartsWith",(e,t)=>{Xl.init(e,t);const n=new RegExp(`^${hm(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(i=>{const o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),a8e=Pt("$ZodCheckEndsWith",(e,t)=>{Xl.init(e,t);const n=new RegExp(`.*${hm(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(i=>{const o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}}),u8e=Pt("$ZodCheckOverwrite",(e,t)=>{Xl.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class c8e{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const i=t.split(` -`).filter(r=>r),o=Math.min(...i.map(r=>r.length-r.trimStart().length)),s=i.map(r=>r.slice(o)).map(r=>" ".repeat(this.indent*2)+r);for(const r of s)this.content.push(r)}compile(){const t=Function,n=this?.args,o=[...(this?.content??[""]).map(s=>` ${s}`)];return new t(...n,o.join(` -`))}}const d8e={major:4,minor:3,patch:6},rs=Pt("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=d8e;const i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(const o of i)for(const s of o._zod.onattach)s(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(r,l,a)=>{let u=S1(r),c;for(const d of l){if(d._zod.def.when){if(!d._zod.def.when(r))continue}else if(u)continue;const h=r.issues.length,p=d._zod.check(r);if(p instanceof Promise&&a?.async===!1)throw new Q1;if(c||p instanceof Promise)c=(c??Promise.resolve()).then(async()=>{await p,r.issues.length!==h&&(u||(u=S1(r,h)))});else{if(r.issues.length===h)continue;u||(u=S1(r,h))}}return c?c.then(()=>r):r},s=(r,l,a)=>{if(S1(r))return r.aborted=!0,r;const u=o(l,i,a);if(u instanceof Promise){if(a.async===!1)throw new Q1;return u.then(c=>e._zod.parse(c,a))}return e._zod.parse(u,a)};e._zod.run=(r,l)=>{if(l.skipChecks)return e._zod.parse(r,l);if(l.direction==="backward"){const u=e._zod.parse({value:r.value,issues:[]},{...l,skipChecks:!0});return u instanceof Promise?u.then(c=>s(c,r,l)):s(u,r,l)}const a=e._zod.parse(r,l);if(a instanceof Promise){if(l.async===!1)throw new Q1;return a.then(u=>o(u,i,l))}return o(a,i,l)}}Zi(e,"~standard",()=>({validate:o=>{try{const s=v3e(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return y3e(e,o).then(r=>r.success?{value:r.data}:{issues:r.error?.issues})}},vendor:"zod",version:1}))}),Hx=Pt("$ZodString",(e,t)=>{rs.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??K3e(e._zod.bag),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Ko=Pt("$ZodStringFormat",(e,t)=>{$4.init(e,t),Hx.init(e,t)}),f8e=Pt("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=F3e),Ko.init(e,t)}),h8e=Pt("$ZodUUID",(e,t)=>{if(t.version){const i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(i===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=WD(i))}else t.pattern??(t.pattern=WD());Ko.init(e,t)}),p8e=Pt("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=R3e),Ko.init(e,t)}),m8e=Pt("$ZodURL",(e,t)=>{Ko.init(e,t),e._zod.check=n=>{try{const i=n.value.trim(),o=new URL(i);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=o.href:n.value=i;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),g8e=Pt("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=P3e()),Ko.init(e,t)}),v8e=Pt("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=N3e),Ko.init(e,t)}),y8e=Pt("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=I3e),Ko.init(e,t)}),k8e=Pt("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=M3e),Ko.init(e,t)}),b8e=Pt("$ZodULID",(e,t)=>{t.pattern??(t.pattern=T3e),Ko.init(e,t)}),w8e=Pt("$ZodXID",(e,t)=>{t.pattern??(t.pattern=E3e),Ko.init(e,t)}),C8e=Pt("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=L3e),Ko.init(e,t)}),A8e=Pt("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=V3e(t)),Ko.init(e,t)}),x8e=Pt("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=q3e),Ko.init(e,t)}),S8e=Pt("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=U3e(t)),Ko.init(e,t)}),_8e=Pt("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=D3e),Ko.init(e,t)}),I8e=Pt("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=$3e),Ko.init(e,t),e._zod.bag.format="ipv4"}),M8e=Pt("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=B3e),Ko.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),T8e=Pt("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=z3e),Ko.init(e,t)}),E8e=Pt("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=j3e),Ko.init(e,t),e._zod.check=n=>{const i=n.value.split("/");try{if(i.length!==2)throw new Error;const[o,s]=i;if(!s)throw new Error;const r=Number(s);if(`${r}`!==s)throw new Error;if(r<0||r>128)throw new Error;new URL(`http://[${o}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function Gq(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const L8e=Pt("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=H3e),Ko.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{Gq(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function N8e(e){if(!Hq.test(e))return!1;const t=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Gq(n)}const D8e=Pt("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Hq),Ko.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{N8e(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),F8e=Pt("$ZodE164",(e,t)=>{t.pattern??(t.pattern=W3e),Ko.init(e,t)});function R8e(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[i]=n;if(!i)return!1;const o=JSON.parse(atob(i));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const O8e=Pt("$ZodJWT",(e,t)=>{Ko.init(e,t),e._zod.check=n=>{R8e(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Qq=Pt("$ZodNumber",(e,t)=>{rs.init(e,t),e._zod.pattern=e._zod.bag.pattern??Uq,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const o=n.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return n;const s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),n}}),P8e=Pt("$ZodNumberFormat",(e,t)=>{X3e.init(e,t),Qq.init(e,t)}),$8e=Pt("$ZodBoolean",(e,t)=>{rs.init(e,t),e._zod.pattern=G3e,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=!!n.value}catch{}const o=n.value;return typeof o=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),B8e=Pt("$ZodUnknown",(e,t)=>{rs.init(e,t),e._zod.parse=n=>n}),z8e=Pt("$ZodNever",(e,t)=>{rs.init(e,t),e._zod.parse=(n,i)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function qD(e,t,n){e.issues.length&&t.issues.push(..._1(n,e.issues)),t.value[n]=e.value}const j8e=Pt("$ZodArray",(e,t)=>{rs.init(e,t),e._zod.parse=(n,i)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const s=[];for(let r=0;rqD(u,n,r))):qD(a,n,r)}return s.length?Promise.all(s).then(()=>n):n}});function sb(e,t,n,i,o){if(e.issues.length){if(o&&!(n in i))return;t.issues.push(..._1(n,e.issues))}e.value===void 0?n in i&&(t.value[n]=void 0):t.value[n]=e.value}function Yq(e){const t=Object.keys(e.shape);for(const i of t)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);const n=r3e(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Jq(e,t,n,i,o,s){const r=[],l=o.keySet,a=o.catchall._zod,u=a.def.type,c=a.optout==="optional";for(const d in t){if(l.has(d))continue;if(u==="never"){r.push(d);continue}const h=a.run({value:t[d],issues:[]},i);h instanceof Promise?e.push(h.then(p=>sb(p,n,d,t,c))):sb(h,n,d,t,c)}return r.length&&n.issues.push({code:"unrecognized_keys",keys:r,input:t,inst:s}),e.length?Promise.all(e).then(()=>n):n}const H8e=Pt("$ZodObject",(e,t)=>{if(rs.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const l=t.shape;Object.defineProperty(t,"shape",{get:()=>{const a={...l};return Object.defineProperty(t,"shape",{value:a}),a}})}const i=R4(()=>Yq(t));Zi(e._zod,"propValues",()=>{const l=t.shape,a={};for(const u in l){const c=l[u]._zod;if(c.values){a[u]??(a[u]=new Set);for(const d of c.values)a[u].add(d)}}return a});const o=Tv,s=t.catchall;let r;e._zod.parse=(l,a)=>{r??(r=i.value);const u=l.value;if(!o(u))return l.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),l;l.value={};const c=[],d=r.shape;for(const h of r.keys){const p=d[h],m=p._zod.optout==="optional",g=p._zod.run({value:u[h],issues:[]},a);g instanceof Promise?c.push(g.then(y=>sb(y,l,h,u,m))):sb(g,l,h,u,m)}return s?Jq(c,u,l,a,i.value,e):c.length?Promise.all(c).then(()=>l):l}}),W8e=Pt("$ZodObjectJIT",(e,t)=>{H8e.init(e,t);const n=e._zod.parse,i=R4(()=>Yq(t)),o=h=>{const p=new c8e(["shape","payload","ctx"]),m=i.value,g=C=>{const w=HD(C);return`shape[${w}]._zod.run({ value: input[${w}], issues: [] }, ctx)`};p.write("const input = payload.value;");const y=Object.create(null);let b=0;for(const C of m.keys)y[C]=`key_${b++}`;p.write("const newResult = {};");for(const C of m.keys){const w=y[C],M=HD(C),T=h[C]?._zod?.optout==="optional";p.write(`const ${w} = ${g(C)};`),T?p.write(` - if (${w}.issues.length) { - if (${M} in input) { - payload.issues = payload.issues.concat(${w}.issues.map(iss => ({ - ...iss, - path: iss.path ? [${M}, ...iss.path] : [${M}] - }))); - } - } - - if (${w}.value === undefined) { - if (${M} in input) { - newResult[${M}] = undefined; - } - } else { - newResult[${M}] = ${w}.value; - } - - `):p.write(` - if (${w}.issues.length) { - payload.issues = payload.issues.concat(${w}.issues.map(iss => ({ - ...iss, - path: iss.path ? [${M}, ...iss.path] : [${M}] - }))); - } - - if (${w}.value === undefined) { - if (${M} in input) { - newResult[${M}] = undefined; - } - } else { - newResult[${M}] = ${w}.value; - } - - `)}p.write("payload.value = newResult;"),p.write("return payload;");const v=p.compile();return(C,w)=>v(h,C,w)};let s;const r=Tv,l=!Rq.jitless,u=l&&o3e.value,c=t.catchall;let d;e._zod.parse=(h,p)=>{d??(d=i.value);const m=h.value;return r(m)?l&&u&&p?.async===!1&&p.jitless!==!0?(s||(s=o(t.shape)),h=s(h,p),c?Jq([],m,h,p,d,e):h):n(h,p):(h.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),h)}});function UD(e,t,n,i){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const o=e.filter(s=>!S1(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(s=>s.issues.map(r=>wf(r,i,bf())))}),t)}const Xq=Pt("$ZodUnion",(e,t)=>{rs.init(e,t),Zi(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),Zi(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),Zi(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),Zi(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>$x(s.source)).join("|")})$`)}});const n=t.options.length===1,i=t.options[0]._zod.run;e._zod.parse=(o,s)=>{if(n)return i(o,s);let r=!1;const l=[];for(const a of t.options){const u=a._zod.run({value:o.value,issues:[]},s);if(u instanceof Promise)l.push(u),r=!0;else{if(u.issues.length===0)return u;l.push(u)}}return r?Promise.all(l).then(a=>UD(a,o,e,s)):UD(l,o,e,s)}}),q8e=Pt("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Xq.init(e,t);const n=e._zod.parse;Zi(e._zod,"propValues",()=>{const o={};for(const s of t.options){const r=s._zod.propValues;if(!r||Object.keys(r).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(const[l,a]of Object.entries(r)){o[l]||(o[l]=new Set);for(const u of a)o[l].add(u)}}return o});const i=R4(()=>{const o=t.options,s=new Map;for(const r of o){const l=r._zod.propValues?.[t.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(const a of l){if(s.has(a))throw new Error(`Duplicate discriminator value "${String(a)}"`);s.set(a,r)}}return s});e._zod.parse=(o,s)=>{const r=o.value;if(!Tv(r))return o.issues.push({code:"invalid_type",expected:"object",input:r,inst:e}),o;const l=i.value.get(r?.[t.discriminator]);return l?l._zod.run(o,s):t.unionFallback?n(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:r,path:[t.discriminator],inst:e}),o)}}),U8e=Pt("$ZodIntersection",(e,t)=>{rs.init(e,t),e._zod.parse=(n,i)=>{const o=n.value,s=t.left._zod.run({value:o,issues:[]},i),r=t.right._zod.run({value:o,issues:[]},i);return s instanceof Promise||r instanceof Promise?Promise.all([s,r]).then(([a,u])=>VD(n,a,u)):VD(n,s,r)}});function DA(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(fm(e)&&fm(t)){const n=Object.keys(t),i=Object.keys(e).filter(s=>n.indexOf(s)!==-1),o={...e,...t};for(const s of i){const r=DA(e[s],t[s]);if(!r.valid)return{valid:!1,mergeErrorPath:[s,...r.mergeErrorPath]};o[s]=r.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let i=0;il.l&&l.r).map(([l])=>l);if(s.length&&o&&e.issues.push({...o,keys:s}),S1(e))return e;const r=DA(t.value,n.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const V8e=Pt("$ZodRecord",(e,t)=>{rs.init(e,t),e._zod.parse=(n,i)=>{const o=n.value;if(!fm(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;const s=[],r=t.keyType._zod.values;if(r){n.value={};const l=new Set;for(const u of r)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){l.add(typeof u=="number"?u.toString():u);const c=t.valueType._zod.run({value:o[u],issues:[]},i);c instanceof Promise?s.push(c.then(d=>{d.issues.length&&n.issues.push(..._1(u,d.issues)),n.value[u]=d.value})):(c.issues.length&&n.issues.push(..._1(u,c.issues)),n.value[u]=c.value)}let a;for(const u in o)l.has(u)||(a=a??[],a.push(u));a&&a.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:a})}else{n.value={};for(const l of Reflect.ownKeys(o)){if(l==="__proto__")continue;let a=t.keyType._zod.run({value:l,issues:[]},i);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&Uq.test(l)&&a.issues.length){const d=t.keyType._zod.run({value:Number(l),issues:[]},i);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(a=d)}if(a.issues.length){t.mode==="loose"?n.value[l]=o[l]:n.issues.push({code:"invalid_key",origin:"record",issues:a.issues.map(d=>wf(d,i,bf())),input:l,path:[l],inst:e});continue}const c=t.valueType._zod.run({value:o[l],issues:[]},i);c instanceof Promise?s.push(c.then(d=>{d.issues.length&&n.issues.push(..._1(l,d.issues)),n.value[a.value]=d.value})):(c.issues.length&&n.issues.push(..._1(l,c.issues)),n.value[a.value]=c.value)}}return s.length?Promise.all(s).then(()=>n):n}}),K8e=Pt("$ZodEnum",(e,t)=>{rs.init(e,t);const n=Oq(t.entries),i=new Set(n);e._zod.values=i,e._zod.pattern=new RegExp(`^(${n.filter(o=>s3e.has(typeof o)).map(o=>typeof o=="string"?hm(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{const r=o.value;return i.has(r)||o.issues.push({code:"invalid_value",values:n,input:r,inst:e}),o}}),Z8e=Pt("$ZodLiteral",(e,t)=>{if(rs.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(i=>typeof i=="string"?hm(i):i?hm(i.toString()):String(i)).join("|")})$`),e._zod.parse=(i,o)=>{const s=i.value;return n.has(s)||i.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),i}}),G8e=Pt("$ZodTransform",(e,t)=>{rs.init(e,t),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new Fq(e.constructor.name);const o=t.transform(n.value,n);if(i.async)return(o instanceof Promise?o:Promise.resolve(o)).then(r=>(n.value=r,n));if(o instanceof Promise)throw new Q1;return n.value=o,n}});function KD(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const eU=Pt("$ZodOptional",(e,t)=>{rs.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Zi(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Zi(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${$x(n.source)})?$`):void 0}),e._zod.parse=(n,i)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(s=>KD(s,n.value)):KD(o,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,i)}}),Q8e=Pt("$ZodExactOptional",(e,t)=>{eU.init(e,t),Zi(e._zod,"values",()=>t.innerType._zod.values),Zi(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,i)=>t.innerType._zod.run(n,i)}),Y8e=Pt("$ZodNullable",(e,t)=>{rs.init(e,t),Zi(e._zod,"optin",()=>t.innerType._zod.optin),Zi(e._zod,"optout",()=>t.innerType._zod.optout),Zi(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${$x(n.source)}|null)$`):void 0}),Zi(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,i)=>n.value===null?n:t.innerType._zod.run(n,i)}),J8e=Pt("$ZodDefault",(e,t)=>{rs.init(e,t),e._zod.optin="optional",Zi(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(s=>ZD(s,t)):ZD(o,t)}});function ZD(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const X8e=Pt("$ZodPrefault",(e,t)=>{rs.init(e,t),e._zod.optin="optional",Zi(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>(i.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,i))}),ewe=Pt("$ZodNonOptional",(e,t)=>{rs.init(e,t),Zi(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(i=>i!==void 0)):void 0}),e._zod.parse=(n,i)=>{const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(s=>GD(s,e)):GD(o,e)}});function GD(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const twe=Pt("$ZodCatch",(e,t)=>{rs.init(e,t),Zi(e._zod,"optin",()=>t.innerType._zod.optin),Zi(e._zod,"optout",()=>t.innerType._zod.optout),Zi(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(s=>(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(r=>wf(r,i,bf()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(s=>wf(s,i,bf()))},input:n.value}),n.issues=[]),n)}}),nwe=Pt("$ZodPipe",(e,t)=>{rs.init(e,t),Zi(e._zod,"values",()=>t.in._zod.values),Zi(e._zod,"optin",()=>t.in._zod.optin),Zi(e._zod,"optout",()=>t.out._zod.optout),Zi(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,i)=>{if(i.direction==="backward"){const s=t.out._zod.run(n,i);return s instanceof Promise?s.then(r=>Ny(r,t.in,i)):Ny(s,t.in,i)}const o=t.in._zod.run(n,i);return o instanceof Promise?o.then(s=>Ny(s,t.out,i)):Ny(o,t.out,i)}});function Ny(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const iwe=Pt("$ZodReadonly",(e,t)=>{rs.init(e,t),Zi(e._zod,"propValues",()=>t.innerType._zod.propValues),Zi(e._zod,"values",()=>t.innerType._zod.values),Zi(e._zod,"optin",()=>t.innerType?._zod?.optin),Zi(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(QD):QD(o)}});function QD(e){return e.value=Object.freeze(e.value),e}const owe=Pt("$ZodCustom",(e,t)=>{Xl.init(e,t),rs.init(e,t),e._zod.parse=(n,i)=>n,e._zod.check=n=>{const i=n.value,o=t.fn(i);if(o instanceof Promise)return o.then(s=>YD(s,n,i,e));YD(o,n,i,e)}});function YD(e,t,n,i){if(!e){const o={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(o.params=i._zod.def.params),t.issues.push(Ev(o))}}var JD;class swe{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const i=n[0];return this._map.set(t,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const i={...this.get(n)??{}};delete i.id;const o={...i,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function rwe(){return new swe}(JD=globalThis).__zod_globalRegistry??(JD.__zod_globalRegistry=rwe());const o0=globalThis.__zod_globalRegistry;function lwe(e,t){return new e({type:"string",...On(t)})}function awe(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...On(t)})}function XD(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...On(t)})}function uwe(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...On(t)})}function cwe(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...On(t)})}function dwe(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...On(t)})}function fwe(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...On(t)})}function hwe(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...On(t)})}function pwe(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...On(t)})}function mwe(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...On(t)})}function gwe(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...On(t)})}function vwe(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...On(t)})}function ywe(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...On(t)})}function kwe(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...On(t)})}function bwe(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...On(t)})}function wwe(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...On(t)})}function Cwe(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...On(t)})}function Awe(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...On(t)})}function xwe(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...On(t)})}function Swe(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...On(t)})}function _we(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...On(t)})}function Iwe(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...On(t)})}function Mwe(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...On(t)})}function Twe(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...On(t)})}function Ewe(e,t){return new e({type:"string",format:"date",check:"string_format",...On(t)})}function Lwe(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...On(t)})}function Nwe(e,t){return new e({type:"string",format:"duration",check:"string_format",...On(t)})}function Dwe(e,t){return new e({type:"number",checks:[],...On(t)})}function Fwe(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...On(t)})}function Rwe(e,t){return new e({type:"boolean",...On(t)})}function Owe(e){return new e({type:"unknown"})}function Pwe(e,t){return new e({type:"never",...On(t)})}function eF(e,t){return new Kq({check:"less_than",...On(t),value:e,inclusive:!1})}function pw(e,t){return new Kq({check:"less_than",...On(t),value:e,inclusive:!0})}function tF(e,t){return new Zq({check:"greater_than",...On(t),value:e,inclusive:!1})}function mw(e,t){return new Zq({check:"greater_than",...On(t),value:e,inclusive:!0})}function nF(e,t){return new J3e({check:"multiple_of",...On(t),value:e})}function tU(e,t){return new e8e({check:"max_length",...On(t),maximum:e})}function rb(e,t){return new t8e({check:"min_length",...On(t),minimum:e})}function nU(e,t){return new n8e({check:"length_equals",...On(t),length:e})}function $we(e,t){return new i8e({check:"string_format",format:"regex",...On(t),pattern:e})}function Bwe(e){return new o8e({check:"string_format",format:"lowercase",...On(e)})}function zwe(e){return new s8e({check:"string_format",format:"uppercase",...On(e)})}function jwe(e,t){return new r8e({check:"string_format",format:"includes",...On(t),includes:e})}function Hwe(e,t){return new l8e({check:"string_format",format:"starts_with",...On(t),prefix:e})}function Wwe(e,t){return new a8e({check:"string_format",format:"ends_with",...On(t),suffix:e})}function zm(e){return new u8e({check:"overwrite",tx:e})}function qwe(e){return zm(t=>t.normalize(e))}function Uwe(){return zm(e=>e.trim())}function Vwe(){return zm(e=>e.toLowerCase())}function Kwe(){return zm(e=>e.toUpperCase())}function Zwe(){return zm(e=>i3e(e))}function Gwe(e,t,n){return new e({type:"array",element:t,...On(n)})}function Qwe(e,t,n){return new e({type:"custom",check:"custom",fn:t,...On(n)})}function Ywe(e){const t=Jwe(n=>(n.addIssue=i=>{if(typeof i=="string")n.issues.push(Ev(i,n.value,t._zod.def));else{const o=i;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),n.issues.push(Ev(o))}},e(n.value,n)));return t}function Jwe(e,t){const n=new Xl({check:"custom",...On(t)});return n._zod.check=e,n}function iU(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??o0,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Us(e,t,n={path:[],schemaPath:[]}){var i;const o=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;const r={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,r);const l=e._zod.toJSONSchema?.();if(l)r.schema=l;else{const c={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,r.schema,c);else{const h=r.schema,p=t.processors[o.type];if(!p)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);p(e,t,h,c)}const d=e._zod.parent;d&&(r.ref||(r.ref=d),Us(d,t,c),t.seen.get(d).isParent=!0)}const a=t.metadataRegistry.get(e);return a&&Object.assign(r.schema,a),t.io==="input"&&dl(e)&&(delete r.schema.examples,delete r.schema.default),t.io==="input"&&r.schema._prefault&&((i=r.schema).default??(i.default=r.schema._prefault)),delete r.schema._prefault,t.seen.get(e).schema}function oU(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=new Map;for(const r of e.seen.entries()){const l=e.metadataRegistry.get(r[0])?.id;if(l){const a=i.get(l);if(a&&a!==r[0])throw new Error(`Duplicate schema id "${l}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(l,r[0])}}const o=r=>{const l=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const d=e.external.registry.get(r[0])?.id,h=e.external.uri??(m=>m);if(d)return{ref:h(d)};const p=r[1].defId??r[1].schema.id??`schema${e.counter++}`;return r[1].defId=p,{defId:p,ref:`${h("__shared")}#/${l}/${p}`}}if(r[1]===n)return{ref:"#"};const u=`#/${l}/`,c=r[1].schema.id??`__schema${e.counter++}`;return{defId:c,ref:u+c}},s=r=>{if(r[1].schema.$ref)return;const l=r[1],{ref:a,defId:u}=o(r);l.def={...l.schema},u&&(l.defId=u);const c=l.schema;for(const d in c)delete c[d];c.$ref=a};if(e.cycles==="throw")for(const r of e.seen.entries()){const l=r[1];if(l.cycle)throw new Error(`Cycle detected: #/${l.cycle?.join("/")}/ - -Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const r of e.seen.entries()){const l=r[1];if(t===r[0]){s(r);continue}if(e.external){const u=e.external.registry.get(r[0])?.id;if(t!==r[0]&&u){s(r);continue}}if(e.metadataRegistry.get(r[0])?.id){s(r);continue}if(l.cycle){s(r);continue}if(l.count>1&&e.reused==="ref"){s(r);continue}}}function sU(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=r=>{const l=e.seen.get(r);if(l.ref===null)return;const a=l.def??l.schema,u={...a},c=l.ref;if(l.ref=null,c){i(c);const h=e.seen.get(c),p=h.schema;if(p.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(a.allOf=a.allOf??[],a.allOf.push(p)):Object.assign(a,p),Object.assign(a,u),r._zod.parent===c)for(const g in a)g==="$ref"||g==="allOf"||g in u||delete a[g];if(p.$ref&&h.def)for(const g in a)g==="$ref"||g==="allOf"||g in h.def&&JSON.stringify(a[g])===JSON.stringify(h.def[g])&&delete a[g]}const d=r._zod.parent;if(d&&d!==c){i(d);const h=e.seen.get(d);if(h?.schema.$ref&&(a.$ref=h.schema.$ref,h.def))for(const p in a)p==="$ref"||p==="allOf"||p in h.def&&JSON.stringify(a[p])===JSON.stringify(h.def[p])&&delete a[p]}e.override({zodSchema:r,jsonSchema:a,path:l.path??[]})};for(const r of[...e.seen.entries()].reverse())i(r[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const r=e.external.registry.get(t)?.id;if(!r)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(r)}Object.assign(o,n.def??n.schema);const s=e.external?.defs??{};for(const r of e.seen.entries()){const l=r[1];l.def&&l.defId&&(s[l.defId]=l.def)}e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?o.$defs=s:o.definitions=s);try{const r=JSON.parse(JSON.stringify(o));return Object.defineProperty(r,"~standard",{value:{...t["~standard"],jsonSchema:{input:lb(t,"input",e.processors),output:lb(t,"output",e.processors)}},enumerable:!1,writable:!1}),r}catch{throw new Error("Error converting schema to JSON.")}}function dl(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const i=e._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return dl(i.element,n);if(i.type==="set")return dl(i.valueType,n);if(i.type==="lazy")return dl(i.getter(),n);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return dl(i.innerType,n);if(i.type==="intersection")return dl(i.left,n)||dl(i.right,n);if(i.type==="record"||i.type==="map")return dl(i.keyType,n)||dl(i.valueType,n);if(i.type==="pipe")return dl(i.in,n)||dl(i.out,n);if(i.type==="object"){for(const o in i.shape)if(dl(i.shape[o],n))return!0;return!1}if(i.type==="union"){for(const o of i.options)if(dl(o,n))return!0;return!1}if(i.type==="tuple"){for(const o of i.items)if(dl(o,n))return!0;return!!(i.rest&&dl(i.rest,n))}return!1}const Xwe=(e,t={})=>n=>{const i=iU({...n,processors:t});return Us(e,i),oU(i,e),sU(i,e)},lb=(e,t,n={})=>i=>{const{libraryOptions:o,target:s}=i??{},r=iU({...o??{},target:s,io:t,processors:n});return Us(e,r),oU(r,e),sU(r,e)},e5e={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},t5e=(e,t,n,i)=>{const o=n;o.type="string";const{minimum:s,maximum:r,format:l,patterns:a,contentEncoding:u}=e._zod.bag;if(typeof s=="number"&&(o.minLength=s),typeof r=="number"&&(o.maxLength=r),l&&(o.format=e5e[l]??l,o.format===""&&delete o.format,l==="time"&&delete o.format),u&&(o.contentEncoding=u),a&&a.size>0){const c=[...a];c.length===1?o.pattern=c[0].source:c.length>1&&(o.allOf=[...c.map(d=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},n5e=(e,t,n,i)=>{const o=n,{minimum:s,maximum:r,format:l,multipleOf:a,exclusiveMaximum:u,exclusiveMinimum:c}=e._zod.bag;typeof l=="string"&&l.includes("int")?o.type="integer":o.type="number",typeof c=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.minimum=c,o.exclusiveMinimum=!0):o.exclusiveMinimum=c),typeof s=="number"&&(o.minimum=s,typeof c=="number"&&t.target!=="draft-04"&&(c>=s?delete o.minimum:delete o.exclusiveMinimum)),typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.maximum=u,o.exclusiveMaximum=!0):o.exclusiveMaximum=u),typeof r=="number"&&(o.maximum=r,typeof u=="number"&&t.target!=="draft-04"&&(u<=r?delete o.maximum:delete o.exclusiveMaximum)),typeof a=="number"&&(o.multipleOf=a)},i5e=(e,t,n,i)=>{n.type="boolean"},o5e=(e,t,n,i)=>{n.not={}},s5e=(e,t,n,i)=>{},r5e=(e,t,n,i)=>{const o=e._zod.def,s=Oq(o.entries);s.every(r=>typeof r=="number")&&(n.type="number"),s.every(r=>typeof r=="string")&&(n.type="string"),n.enum=s},l5e=(e,t,n,i)=>{const o=e._zod.def,s=[];for(const r of o.values)if(r===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof r=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(r))}else s.push(r);if(s.length!==0)if(s.length===1){const r=s[0];n.type=r===null?"null":typeof r,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[r]:n.const=r}else s.every(r=>typeof r=="number")&&(n.type="number"),s.every(r=>typeof r=="string")&&(n.type="string"),s.every(r=>typeof r=="boolean")&&(n.type="boolean"),s.every(r=>r===null)&&(n.type="null"),n.enum=s},a5e=(e,t,n,i)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},u5e=(e,t,n,i)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},c5e=(e,t,n,i)=>{const o=n,s=e._zod.def,{minimum:r,maximum:l}=e._zod.bag;typeof r=="number"&&(o.minItems=r),typeof l=="number"&&(o.maxItems=l),o.type="array",o.items=Us(s.element,t,{...i,path:[...i.path,"items"]})},d5e=(e,t,n,i)=>{const o=n,s=e._zod.def;o.type="object",o.properties={};const r=s.shape;for(const u in r)o.properties[u]=Us(r[u],t,{...i,path:[...i.path,"properties",u]});const l=new Set(Object.keys(r)),a=new Set([...l].filter(u=>{const c=s.shape[u]._zod;return t.io==="input"?c.optin===void 0:c.optout===void 0}));a.size>0&&(o.required=Array.from(a)),s.catchall?._zod.def.type==="never"?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=Us(s.catchall,t,{...i,path:[...i.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},f5e=(e,t,n,i)=>{const o=e._zod.def,s=o.inclusive===!1,r=o.options.map((l,a)=>Us(l,t,{...i,path:[...i.path,s?"oneOf":"anyOf",a]}));s?n.oneOf=r:n.anyOf=r},h5e=(e,t,n,i)=>{const o=e._zod.def,s=Us(o.left,t,{...i,path:[...i.path,"allOf",0]}),r=Us(o.right,t,{...i,path:[...i.path,"allOf",1]}),l=u=>"allOf"in u&&Object.keys(u).length===1,a=[...l(s)?s.allOf:[s],...l(r)?r.allOf:[r]];n.allOf=a},p5e=(e,t,n,i)=>{const o=n,s=e._zod.def;o.type="object";const r=s.keyType,a=r._zod.bag?.patterns;if(s.mode==="loose"&&a&&a.size>0){const c=Us(s.valueType,t,{...i,path:[...i.path,"patternProperties","*"]});o.patternProperties={};for(const d of a)o.patternProperties[d.source]=c}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(o.propertyNames=Us(s.keyType,t,{...i,path:[...i.path,"propertyNames"]})),o.additionalProperties=Us(s.valueType,t,{...i,path:[...i.path,"additionalProperties"]});const u=r._zod.values;if(u){const c=[...u].filter(d=>typeof d=="string"||typeof d=="number");c.length>0&&(o.required=c)}},m5e=(e,t,n,i)=>{const o=e._zod.def,s=Us(o.innerType,t,i),r=t.seen.get(e);t.target==="openapi-3.0"?(r.ref=o.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]},g5e=(e,t,n,i)=>{const o=e._zod.def;Us(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType},v5e=(e,t,n,i)=>{const o=e._zod.def;Us(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},y5e=(e,t,n,i)=>{const o=e._zod.def;Us(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},k5e=(e,t,n,i)=>{const o=e._zod.def;Us(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType;let r;try{r=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=r},b5e=(e,t,n,i)=>{const o=e._zod.def,s=t.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;Us(s,t,i);const r=t.seen.get(e);r.ref=s},w5e=(e,t,n,i)=>{const o=e._zod.def;Us(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType,n.readOnly=!0},rU=(e,t,n,i)=>{const o=e._zod.def;Us(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType},C5e=Pt("ZodISODateTime",(e,t)=>{A8e.init(e,t),as.init(e,t)});function A5e(e){return Twe(C5e,e)}const x5e=Pt("ZodISODate",(e,t)=>{x8e.init(e,t),as.init(e,t)});function S5e(e){return Ewe(x5e,e)}const _5e=Pt("ZodISOTime",(e,t)=>{S8e.init(e,t),as.init(e,t)});function I5e(e){return Lwe(_5e,e)}const M5e=Pt("ZodISODuration",(e,t)=>{_8e.init(e,t),as.init(e,t)});function T5e(e){return Nwe(M5e,e)}const E5e=(e,t)=>{zq.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>g3e(e,n)},flatten:{value:n=>m3e(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,NA,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,NA,2)}},isEmpty:{get(){return e.issues.length===0}}})},Ya=Pt("ZodError",E5e,{Parent:Error}),L5e=zx(Ya),N5e=jx(Ya),D5e=O4(Ya),F5e=P4(Ya),R5e=k3e(Ya),O5e=b3e(Ya),P5e=w3e(Ya),$5e=C3e(Ya),B5e=A3e(Ya),z5e=x3e(Ya),j5e=S3e(Ya),H5e=_3e(Ya),ls=Pt("ZodType",(e,t)=>(rs.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:lb(e,"input"),output:lb(e,"output")}}),e.toJSONSchema=Xwe(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Rf(t,{checks:[...t.checks??[],...n.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0}),e.with=e.check,e.clone=(n,i)=>Of(e,n,i),e.brand=()=>e,e.register=((n,i)=>(n.add(e,i),e)),e.parse=(n,i)=>L5e(e,n,i,{callee:e.parse}),e.safeParse=(n,i)=>D5e(e,n,i),e.parseAsync=async(n,i)=>N5e(e,n,i,{callee:e.parseAsync}),e.safeParseAsync=async(n,i)=>F5e(e,n,i),e.spa=e.safeParseAsync,e.encode=(n,i)=>R5e(e,n,i),e.decode=(n,i)=>O5e(e,n,i),e.encodeAsync=async(n,i)=>P5e(e,n,i),e.decodeAsync=async(n,i)=>$5e(e,n,i),e.safeEncode=(n,i)=>B5e(e,n,i),e.safeDecode=(n,i)=>z5e(e,n,i),e.safeEncodeAsync=async(n,i)=>j5e(e,n,i),e.safeDecodeAsync=async(n,i)=>H5e(e,n,i),e.refine=(n,i)=>e.check(RCe(n,i)),e.superRefine=n=>e.check(OCe(n)),e.overwrite=n=>e.check(zm(n)),e.optional=()=>sF(e),e.exactOptional=()=>CCe(e),e.nullable=()=>rF(e),e.nullish=()=>sF(rF(e)),e.nonoptional=n=>MCe(e,n),e.array=()=>Si(e),e.or=n=>hCe([e,n]),e.and=n=>gCe(e,n),e.transform=n=>lF(e,bCe(n)),e.default=n=>SCe(e,n),e.prefault=n=>ICe(e,n),e.catch=n=>ECe(e,n),e.pipe=n=>lF(e,n),e.readonly=()=>DCe(e),e.describe=n=>{const i=e.clone();return o0.add(i,{description:n}),i},Object.defineProperty(e,"description",{get(){return o0.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return o0.get(e);const i=e.clone();return o0.add(i,n[0]),i},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),lU=Pt("_ZodString",(e,t)=>{Hx.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(i,o,s)=>t5e(e,i,o);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...i)=>e.check($we(...i)),e.includes=(...i)=>e.check(jwe(...i)),e.startsWith=(...i)=>e.check(Hwe(...i)),e.endsWith=(...i)=>e.check(Wwe(...i)),e.min=(...i)=>e.check(rb(...i)),e.max=(...i)=>e.check(tU(...i)),e.length=(...i)=>e.check(nU(...i)),e.nonempty=(...i)=>e.check(rb(1,...i)),e.lowercase=i=>e.check(Bwe(i)),e.uppercase=i=>e.check(zwe(i)),e.trim=()=>e.check(Uwe()),e.normalize=(...i)=>e.check(qwe(...i)),e.toLowerCase=()=>e.check(Vwe()),e.toUpperCase=()=>e.check(Kwe()),e.slugify=()=>e.check(Zwe())}),W5e=Pt("ZodString",(e,t)=>{Hx.init(e,t),lU.init(e,t),e.email=n=>e.check(awe(q5e,n)),e.url=n=>e.check(hwe(U5e,n)),e.jwt=n=>e.check(Mwe(rCe,n)),e.emoji=n=>e.check(pwe(V5e,n)),e.guid=n=>e.check(XD(iF,n)),e.uuid=n=>e.check(uwe(Dy,n)),e.uuidv4=n=>e.check(cwe(Dy,n)),e.uuidv6=n=>e.check(dwe(Dy,n)),e.uuidv7=n=>e.check(fwe(Dy,n)),e.nanoid=n=>e.check(mwe(K5e,n)),e.guid=n=>e.check(XD(iF,n)),e.cuid=n=>e.check(gwe(Z5e,n)),e.cuid2=n=>e.check(vwe(G5e,n)),e.ulid=n=>e.check(ywe(Q5e,n)),e.base64=n=>e.check(Swe(iCe,n)),e.base64url=n=>e.check(_we(oCe,n)),e.xid=n=>e.check(kwe(Y5e,n)),e.ksuid=n=>e.check(bwe(J5e,n)),e.ipv4=n=>e.check(wwe(X5e,n)),e.ipv6=n=>e.check(Cwe(eCe,n)),e.cidrv4=n=>e.check(Awe(tCe,n)),e.cidrv6=n=>e.check(xwe(nCe,n)),e.e164=n=>e.check(Iwe(sCe,n)),e.datetime=n=>e.check(A5e(n)),e.date=n=>e.check(S5e(n)),e.time=n=>e.check(I5e(n)),e.duration=n=>e.check(T5e(n))});function Ut(e){return lwe(W5e,e)}const as=Pt("ZodStringFormat",(e,t)=>{Ko.init(e,t),lU.init(e,t)}),q5e=Pt("ZodEmail",(e,t)=>{p8e.init(e,t),as.init(e,t)}),iF=Pt("ZodGUID",(e,t)=>{f8e.init(e,t),as.init(e,t)}),Dy=Pt("ZodUUID",(e,t)=>{h8e.init(e,t),as.init(e,t)}),U5e=Pt("ZodURL",(e,t)=>{m8e.init(e,t),as.init(e,t)}),V5e=Pt("ZodEmoji",(e,t)=>{g8e.init(e,t),as.init(e,t)}),K5e=Pt("ZodNanoID",(e,t)=>{v8e.init(e,t),as.init(e,t)}),Z5e=Pt("ZodCUID",(e,t)=>{y8e.init(e,t),as.init(e,t)}),G5e=Pt("ZodCUID2",(e,t)=>{k8e.init(e,t),as.init(e,t)}),Q5e=Pt("ZodULID",(e,t)=>{b8e.init(e,t),as.init(e,t)}),Y5e=Pt("ZodXID",(e,t)=>{w8e.init(e,t),as.init(e,t)}),J5e=Pt("ZodKSUID",(e,t)=>{C8e.init(e,t),as.init(e,t)}),X5e=Pt("ZodIPv4",(e,t)=>{I8e.init(e,t),as.init(e,t)}),eCe=Pt("ZodIPv6",(e,t)=>{M8e.init(e,t),as.init(e,t)}),tCe=Pt("ZodCIDRv4",(e,t)=>{T8e.init(e,t),as.init(e,t)}),nCe=Pt("ZodCIDRv6",(e,t)=>{E8e.init(e,t),as.init(e,t)}),iCe=Pt("ZodBase64",(e,t)=>{L8e.init(e,t),as.init(e,t)}),oCe=Pt("ZodBase64URL",(e,t)=>{D8e.init(e,t),as.init(e,t)}),sCe=Pt("ZodE164",(e,t)=>{F8e.init(e,t),as.init(e,t)}),rCe=Pt("ZodJWT",(e,t)=>{O8e.init(e,t),as.init(e,t)}),aU=Pt("ZodNumber",(e,t)=>{Qq.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(i,o,s)=>n5e(e,i,o),e.gt=(i,o)=>e.check(tF(i,o)),e.gte=(i,o)=>e.check(mw(i,o)),e.min=(i,o)=>e.check(mw(i,o)),e.lt=(i,o)=>e.check(eF(i,o)),e.lte=(i,o)=>e.check(pw(i,o)),e.max=(i,o)=>e.check(pw(i,o)),e.int=i=>e.check(oF(i)),e.safe=i=>e.check(oF(i)),e.positive=i=>e.check(tF(0,i)),e.nonnegative=i=>e.check(mw(0,i)),e.negative=i=>e.check(eF(0,i)),e.nonpositive=i=>e.check(pw(0,i)),e.multipleOf=(i,o)=>e.check(nF(i,o)),e.step=(i,o)=>e.check(nF(i,o)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Tn(e){return Dwe(aU,e)}const lCe=Pt("ZodNumberFormat",(e,t)=>{P8e.init(e,t),aU.init(e,t)});function oF(e){return Fwe(lCe,e)}const aCe=Pt("ZodBoolean",(e,t)=>{$8e.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(n,i,o)=>i5e(e,n,i)});function u2(e){return Rwe(aCe,e)}const uCe=Pt("ZodUnknown",(e,t)=>{B8e.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(n,i,o)=>s5e()});function rr(){return Owe(uCe)}const cCe=Pt("ZodNever",(e,t)=>{z8e.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(n,i,o)=>o5e(e,n,i)});function uU(e){return Pwe(cCe,e)}const dCe=Pt("ZodArray",(e,t)=>{j8e.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(n,i,o)=>c5e(e,n,i,o),e.element=t.element,e.min=(n,i)=>e.check(rb(n,i)),e.nonempty=n=>e.check(rb(1,n)),e.max=(n,i)=>e.check(tU(n,i)),e.length=(n,i)=>e.check(nU(n,i)),e.unwrap=()=>e.element});function Si(e,t){return Gwe(dCe,e,t)}const fCe=Pt("ZodObject",(e,t)=>{W8e.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(n,i,o)=>d5e(e,n,i,o),Zi(e,"shape",()=>t.shape),e.keyof=()=>ss(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:rr()}),e.loose=()=>e.clone({...e._zod.def,catchall:rr()}),e.strict=()=>e.clone({...e._zod.def,catchall:uU()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>c3e(e,n),e.safeExtend=n=>d3e(e,n),e.merge=n=>f3e(e,n),e.pick=n=>a3e(e,n),e.omit=n=>u3e(e,n),e.partial=(...n)=>h3e(dU,e,n[0]),e.required=(...n)=>p3e(fU,e,n[0])});function tn(e,t){const n={type:"object",shape:e??{},...On(t)};return new fCe(n)}const cU=Pt("ZodUnion",(e,t)=>{Xq.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(n,i,o)=>f5e(e,n,i,o),e.options=t.options});function hCe(e,t){return new cU({type:"union",options:e,...On(t)})}const pCe=Pt("ZodDiscriminatedUnion",(e,t)=>{cU.init(e,t),q8e.init(e,t)});function cd(e,t,n){return new pCe({type:"union",options:t,discriminator:e,...On(n)})}const mCe=Pt("ZodIntersection",(e,t)=>{U8e.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(n,i,o)=>h5e(e,n,i,o)});function gCe(e,t){return new mCe({type:"intersection",left:e,right:t})}const vCe=Pt("ZodRecord",(e,t)=>{V8e.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(n,i,o)=>p5e(e,n,i,o),e.keyType=t.keyType,e.valueType=t.valueType});function Wx(e,t,n){return new vCe({type:"record",keyType:e,valueType:t,...On(n)})}const FA=Pt("ZodEnum",(e,t)=>{K8e.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(i,o,s)=>r5e(e,i,o),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(i,o)=>{const s={};for(const r of i)if(n.has(r))s[r]=t.entries[r];else throw new Error(`Key ${r} not found in enum`);return new FA({...t,checks:[],...On(o),entries:s})},e.exclude=(i,o)=>{const s={...t.entries};for(const r of i)if(n.has(r))delete s[r];else throw new Error(`Key ${r} not found in enum`);return new FA({...t,checks:[],...On(o),entries:s})}});function ss(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new FA({type:"enum",entries:n,...On(t)})}const yCe=Pt("ZodLiteral",(e,t)=>{Z8e.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(n,i,o)=>l5e(e,n,i),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Kn(e,t){return new yCe({type:"literal",values:Array.isArray(e)?e:[e],...On(t)})}const kCe=Pt("ZodTransform",(e,t)=>{G8e.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(n,i,o)=>u5e(e,n),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new Fq(e.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push(Ev(s,n.value,t));else{const r=s;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=e),n.issues.push(Ev(r))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(s=>(n.value=s,n)):(n.value=o,n)}});function bCe(e){return new kCe({type:"transform",transform:e})}const dU=Pt("ZodOptional",(e,t)=>{eU.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(n,i,o)=>rU(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function sF(e){return new dU({type:"optional",innerType:e})}const wCe=Pt("ZodExactOptional",(e,t)=>{Q8e.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(n,i,o)=>rU(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function CCe(e){return new wCe({type:"optional",innerType:e})}const ACe=Pt("ZodNullable",(e,t)=>{Y8e.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(n,i,o)=>m5e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function rF(e){return new ACe({type:"nullable",innerType:e})}const xCe=Pt("ZodDefault",(e,t)=>{J8e.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(n,i,o)=>v5e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function SCe(e,t){return new xCe({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():$q(t)}})}const _Ce=Pt("ZodPrefault",(e,t)=>{X8e.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(n,i,o)=>y5e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function ICe(e,t){return new _Ce({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():$q(t)}})}const fU=Pt("ZodNonOptional",(e,t)=>{ewe.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(n,i,o)=>g5e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function MCe(e,t){return new fU({type:"nonoptional",innerType:e,...On(t)})}const TCe=Pt("ZodCatch",(e,t)=>{twe.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(n,i,o)=>k5e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function ECe(e,t){return new TCe({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const LCe=Pt("ZodPipe",(e,t)=>{nwe.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(n,i,o)=>b5e(e,n,i,o),e.in=t.in,e.out=t.out});function lF(e,t){return new LCe({type:"pipe",in:e,out:t})}const NCe=Pt("ZodReadonly",(e,t)=>{iwe.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(n,i,o)=>w5e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function DCe(e){return new NCe({type:"readonly",innerType:e})}const FCe=Pt("ZodCustom",(e,t)=>{owe.init(e,t),ls.init(e,t),e._zod.processJSONSchema=(n,i,o)=>a5e(e,n)});function RCe(e,t={}){return Qwe(FCe,e,t)}function OCe(e){return Ywe(e)}const lp=Ut().min(1),qx=Ut().min(1),c2=Ut().min(1),ap=Ut().min(1),Ca=Ut().min(1),PCe=/^[A-Za-z0-9._-]{1,128}$/;function $Ce(e){return PCe.test(e)&&e!=="."&&e!==".."}const hU=cd("kind",[tn({kind:Kn("user"),payload:rr().optional()}),tn({kind:Kn("cron"),taskId:ap.optional(),payload:rr().optional()}),tn({kind:Kn("task"),taskId:ap,payload:rr().optional()}),tn({kind:Kn("hook"),payload:rr().optional()}),tn({kind:Kn("compaction"),payload:rr().optional()}),tn({kind:Kn("side"),payload:rr().optional()}),tn({kind:Kn("other"),payload:rr().optional()})]),BCe=tn({inputTokens:Tn().optional(),outputTokens:Tn().optional(),cachedTokens:Tn().optional(),cost:Tn().optional()}),H0=tn({inputOther:Tn(),output:Tn(),inputCacheRead:Tn(),inputCacheCreation:Tn()}),zCe=tn({llmFirstTokenLatencyMs:Tn().optional(),llmStreamDurationMs:Tn().optional(),llmRequestBuildMs:Tn().optional(),llmServerFirstTokenMs:Tn().optional(),llmServerDecodeMs:Tn().optional(),llmClientConsumeMs:Tn().optional()}),jCe=tn({failedAttempt:Tn(),nextAttempt:Tn(),maxAttempts:Tn(),delayMs:Tn(),errorName:Ut(),errorMessage:Ut(),statusCode:Tn().optional()}),pU=ss(["queued","running","completed","failed","cancelled"]),HCe=ss(["running","completed","interrupted","failed"]),WCe=tn({skillName:Ut(),skillArgs:Ut().optional()}),qCe=tn({kind:Kn("user"),skillActivations:Si(WCe).optional()}),aF={kind:Kn("text"),frameId:c2,text:Ut(),attachmentIds:Si(Ut()).optional(),taskId:ap.optional(),promptIds:Si(Ut()).optional()},UCe=cd("role",[tn({...aF,role:Kn("assistant"),origin:uU().optional()}),tn({...aF,role:Kn("user"),origin:qCe.optional()})]),VCe=tn({kind:Kn("thinking"),frameId:c2,text:Ut()}),KCe=tn({agentId:Ca,role:ss(["child","member"]).optional()}),ZCe=tn({kind:ss(["stdout","stderr","progress","status","custom"]),text:Ut().optional(),percent:Tn().optional(),customKind:Ut().optional(),customData:rr().optional()}),GCe=tn({kind:Kn("tool"),frameId:c2,toolCallId:Ut(),name:Ut(),view:Ut().optional(),state:ss(["running","done","error"]),input:rr().optional(),output:rr().optional(),display:rr().optional(),error:Ut().optional(),inputText:Ut().optional(),progress:ZCe.optional(),taskId:ap.optional(),approvalId:Ut().optional(),todoId:Ut().optional(),agentRefs:Si(KCe).optional()}),Ux=tn({interactionId:Ut(),interactionKind:ss(["approval","question"]),toolCallId:Ut().optional(),state:ss(["pending","approved","rejected","cancelled","answered","dismissed"]),request:rr().optional(),response:rr().optional()}),QCe=tn({kind:Kn("notice"),frameId:c2,level:ss(["error","warning","info"]),source:Ut().optional(),message:Ut(),detail:rr().optional()}),mU=cd("kind",[UCe,VCe,GCe,QCe]),gU=tn({kind:Kn("step"),stepId:qx,turnId:lp,ordinal:Tn().int(),state:HCe,frames:Si(mU),startedAt:Ut().optional(),endedAt:Ut().optional(),usage:H0.optional(),finishReason:Ut().optional(),timing:zCe.optional(),retry:jCe.optional(),endReason:Ut().optional(),endMessage:Ut().optional()}),vU=tn({kind:Kn("turn"),turnId:lp,triggerPromptId:Ut().min(1).optional(),ordinal:Tn().int(),state:pU,origin:hU,prompt:Ut().optional(),attachmentIds:Si(Ut()).optional(),steps:Si(gU),startedAt:Ut().optional(),endedAt:Ut().optional(),usage:BCe.optional(),durationMs:Tn().optional(),error:Ut().optional()}),yU=tn({kind:Kn("marker"),markerId:Ut(),marker:Ut(),payload:rr().optional(),at:Ut().optional()}),kU=tn({kind:Kn("taskref"),refId:Ut(),taskId:ap,at:Ut().optional()}),bU=cd("kind",[vU,yU,kU]),Vx=tn({taskId:ap,kind:ss(["shell","subagent","tool","other"]),state:ss(["running","completed","failed","timed_out","killed","lost"]),detached:u2(),description:Ut().optional(),agentId:Ca.optional(),outputTail:Ut(),startedAt:Ut().optional(),endedAt:Ut().optional(),resultSummary:Ut().optional(),error:Ut().optional(),stateReason:Ut().optional(),usage:H0.optional(),model:Ut().optional(),thinkingEffort:Ut().optional()}),wU=tn({objective:Ut(),status:ss(["active","paused","blocked","complete"]),completionCriterion:Ut().optional(),budgetUsed:Tn().optional(),budgetLimit:Tn().optional()}),YCe=tn({plan:tn({reviewPath:Ut().optional(),version:Tn().optional()}).optional(),swarm:tn({trigger:Ut().optional()}).optional(),tower:tn({}).optional()}),JCe=tn({plan:tn({reviewPath:Ut().optional(),version:Tn().optional()}).nullable().optional(),swarm:tn({trigger:Ut().optional()}).nullable().optional(),tower:tn({}).nullable().optional()}),XCe=cd("kind",[tn({kind:Kn("idle")}),tn({kind:Kn("running"),turnId:Tn(),step:Tn(),stepId:Ut(),since:Tn()}),tn({kind:Kn("streaming"),turnId:Tn(),step:Tn(),stepId:Ut(),stream:ss(["assistant","thinking","tool_call"]),toolCallId:Ut().optional(),toolName:Ut().optional(),since:Tn()}),tn({kind:Kn("tool_call"),turnId:Tn(),step:Tn(),toolCallId:Ut(),name:Ut(),since:Tn()}),tn({kind:Kn("retrying"),turnId:Tn(),step:Tn(),stepId:Ut(),failedAttempt:Tn(),nextAttempt:Tn(),maxAttempts:Tn(),delayMs:Tn(),errorName:Ut().optional(),statusCode:Tn().optional(),since:Tn()}),tn({kind:Kn("awaiting_approval"),turnId:Tn(),step:Tn().optional(),approval:rr().optional(),since:Tn()}),tn({kind:Kn("interrupted"),turnId:Tn(),step:Tn().optional(),reason:ss(["aborted","max_steps","error"]),message:Ut().optional(),at:Tn()}),tn({kind:Kn("ended"),turnId:Tn(),reason:ss(["completed","cancelled","failed","blocked"]),durationMs:Tn().optional(),at:Tn()})]),eAe=tn({byModel:Wx(Ut(),H0).optional(),currentTurn:H0.optional(),total:H0.optional()}),tAe=tn({model:Ut().optional(),thinkingEffort:Ut().optional(),usage:eAe.optional(),contextTokens:Tn().optional(),maxContextTokens:Tn().optional(),contextUsage:Tn().optional(),permission:ss(["manual","yolo","auto"]).optional(),phase:XCe.optional()}),Kx=tn({goal:wU.optional(),modes:YCe.optional(),activity:ss(["idle","turn","disposing","unknown"]).optional(),agent:tAe.optional()}),nAe=Kx.extend({goal:wU.nullable().optional(),modes:JCe.optional()}),B4=tn({attachmentId:Ut(),mediaType:Ut(),name:Ut().optional(),size:Tn().optional(),source:cd("kind",[tn({kind:Kn("url"),url:Ut()}),tn({kind:Kn("file"),fileId:Ut()}),tn({kind:Kn("session_media"),fileId:Ut()})]).optional(),placeholder:Ut().optional()}),iAe=tn({title:Ut(),status:ss(["pending","in_progress","done"])}),Zx=tn({todoId:Ut(),items:Si(iAe),updatedAt:Ut().optional()}),Gx=tn({promptId:Ut(),status:ss(["running","queued","blocked","completed","failed","aborted"]),userMessageId:Ut().optional(),content:rr().optional(),createdAt:Ut(),finishedAt:Ut().optional(),steeredAt:Ut().optional()}),CU=tn({items:Si(bU),tasks:Si(Vx),interactions:Si(Ux).default([]),attachments:Si(B4).default([]),todos:Si(Zx).default([]),prompts:Si(Gx).default([]),meta:Kx,hasMoreOlder:u2().optional()}),oAe=vU.omit({steps:!0}),sAe=gU.omit({frames:!0}),rAe=cd("type",[tn({type:Kn("frame"),turnId:lp,stepId:qx,frameId:c2}),tn({type:Kn("task"),taskId:ap})]),Qx=cd("op",[tn({op:Kn("reset"),agentId:Ca,snapshot:CU}),tn({op:Kn("turn.upsert"),turn:oAe}),tn({op:Kn("step.upsert"),turnId:lp,step:sAe}),tn({op:Kn("frame.upsert"),turnId:lp,stepId:qx,frame:mU}),tn({op:Kn("append"),target:rAe,offset:Tn().int().nonnegative(),text:Ut()}),tn({op:Kn("marker.upsert"),item:yU,beforeTurn:Tn().int().optional()}),tn({op:Kn("taskref.upsert"),item:kU,beforeTurn:Tn().int().optional()}),tn({op:Kn("task.upsert"),task:Vx}),tn({op:Kn("interaction.upsert"),interaction:Ux}),tn({op:Kn("attachment.upsert"),attachment:B4}),tn({op:Kn("todo.upsert"),todo:Zx}),tn({op:Kn("prompt.upsert"),prompt:Gx}),tn({op:Kn("meta.merge"),meta:nAe}),tn({op:Kn("items.remove"),ids:Si(Ut())})]);tn({agentId:Ca,ops:Si(Qx)});const lAe=ss(["off","turn","block","delta"]),pm=Tn().int().nonnegative(),aAe=Wx(Ut(),lAe);tn({session_id:Ut().min(1),transcript:aAe,transcript_since:Wx(Ut(),pm).optional()});tn({agent_id:Ca,before_turn:Ut().min(1).optional(),after_turn:Ut().min(1).optional(),page_size:Tn().int().min(1).max(100).optional()}).superRefine((e,t)=>{e.before_turn!==void 0&&e.after_turn!==void 0&&t.addIssue({code:"custom",message:"before_turn and after_turn are mutually exclusive",path:["before_turn"]}),$Ce(e.agent_id)||t.addIssue({code:"custom",message:"agent_id must be a plain agent id (no path separators)",path:["agent_id"]})});const uAe=tn({agentId:Ca,type:ss(["main","sub","independent"]).optional(),parentAgentId:Ca.optional(),label:Ut().optional(),createdAt:Ut().optional(),disposedAt:Ut().optional()}),cAe=tn({agent_id:Ca,items:Si(bU),has_more:u2(),tasks:Si(Vx),interactions:Si(Ux).default([]),attachments:Si(B4).default([]),todos:Si(Zx).default([]),prompts:Si(Gx).default([]),meta:Kx,agents:Si(uAe),pending_interactions:Si(Ut()),seq:pm.optional()});tn({agent_id:Ca,batches:Si(tn({seq:pm,ops:Si(Qx)})),latest_seq:pm,complete:u2()});const dAe=tn({turn_id:lp,ordinal:Tn().int(),state:pU,origin:hU,prompt:Ut(),attachment_ids:Si(Ut()).optional(),started_at:Ut().optional()});tn({agents:Si(tn({agent_id:Ca,messages:Si(dAe),attachments:Si(B4).default([])}))});const fAe=tn({state:ss(["pending","approved","rejected","cancelled"]),selected_option:Ut().optional(),feedback:Ut().optional()}),hAe=tn({tool_call_id:Ut(),turn_id:lp,source:ss(["interaction","display","output"]),plan:Ut(),path:Ut().optional(),options:Si(tn({label:Ut(),description:Ut().optional()})).optional(),review:fAe.optional()});tn({agent_id:Ca,plans:Si(hAe)});const pAe=tn({agent_id:Ca,snapshot:CU,has_more_older:u2(),seq:pm.optional()}),mAe=tn({agent_id:Ca,ops:Si(Qx),seq:pm.optional()}),AU=pAe.extend({type:Kn("transcript.reset")}),xU=mAe.extend({type:Kn("transcript.ops")});cd("type",[AU,xU]);const uF=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.call.started","tool.use","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.submitted","prompt.completed","prompt.aborted","session.meta.updated","compaction.started","compaction.completed","compaction.cancelled","goal.updated","error","warning","subagent.spawned","subagent.started","subagent.suspended","subagent.completed","subagent.failed","task.started","task.terminated","background.task.started","background.task.terminated","cron.fired"]),gAe=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"]),vAe=new Set(["server_hello","ack","ping","resync_required","error","pong"]),yAe=new Set(["assistant.delta","thinking.delta"]);function kAe(e,t){if(vAe.has(e))return{route:"ignore"};const n=e.startsWith("event."),i=n?e.slice(6):e;return yAe.has(i)?bAe(t)?{route:"agent",agentType:i}:{route:"protocol"}:n?gAe.has(i)?{route:"protocol"}:uF.has(i)?{route:"agent",agentType:i}:{route:"protocol"}:uF.has(i)?{route:"agent",agentType:i}:{route:"agent",agentType:i}}function bAe(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"}const wAe="kimi-code.bearer.",CAe=3e4;class cF{constructor(t){this.opts=t,this.tracer=t.tracer??Rx}ws=null;connected=!1;closed=!1;subscriptions=new Map;transcriptSubscriptions=new Map;sideChannelAgents=new Map;pendingSubscriptions=[];terminalAttachments=new Map;msgSeq=0;clientHelloId=null;reconnectAttempts=0;reconnectTimer=null;heartbeatMs=3e4;lastActivityAt=0;tracer;connect(){if(this.ws!==null||this.closed)return;this.lastActivityAt=Date.now(),this.tracer.wsEvent?.({kind:"lifecycle",event:"connect",detail:{url:this.opts.wsUrl,attempt:this.reconnectAttempts}});const t=this.opts.credentialStore?.getToken(),n=t!==void 0?[`${wAe}${t}`]:void 0,i=new WebSocket(this.opts.wsUrl,n);this.ws=i,i.onopen=()=>{this.tracer.wsEvent?.({kind:"lifecycle",event:"open"})},i.onmessage=o=>{this.lastActivityAt=Date.now();try{const s=JSON.parse(String(o.data));this.tracer.wsEvent?.({kind:"in",frame:s}),this.handleFrame(s)}catch(s){this.tracer.wsEvent?.({kind:"lifecycle",event:"parse-error",detail:{error:String(s)}}),this.opts.handlers.onError(0,`Failed to parse WS frame: ${String(s)}`,!1)}},i.onerror=()=>{this.tracer.wsEvent?.({kind:"lifecycle",event:"error"}),this.opts.handlers.onError(0,"WebSocket error",!1)},i.onclose=o=>{this.tracer.wsEvent?.({kind:"lifecycle",event:"close",detail:o?{code:o.code,reason:o.reason,wasClean:o.wasClean}:void 0}),this.connected=!1,this.ws=null,this.opts.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,this.tracer.wsEvent?.({kind:"lifecycle",event:"reconnect-scheduled",detail:{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 i=this.pendingSubscriptions.findIndex(o=>o.sessionId===t);i!==-1&&this.pendingSubscriptions.splice(i,1),this.pendingSubscriptions.push({sessionId:t,cursor:{...n}})}}unsubscribe(t){this.subscriptions.delete(t);const n=this.pendingSubscriptions.findIndex(i=>i.sessionId===t);n!==-1&&this.pendingSubscriptions.splice(n,1),this.connected&&this.ws&&this.send({type:"unsubscribe",id:this.nextId(),payload:{session_ids:[t]}})}subscribeTranscript(t,n,i){let o=this.transcriptSubscriptions.get(t);o===void 0&&(o=new Map,this.transcriptSubscriptions.set(t,o)),o.set(n,i!==void 0?{sinceSeq:i}:{}),this.connected&&this.sendTranscriptSubscribe(t,n)}unsubscribeTranscript(t,n){const i=this.transcriptSubscriptions.get(t);if(i!==void 0)if(n===void 0)this.transcriptSubscriptions.delete(t);else{for(const o of n)i.delete(o);i.size===0&&this.transcriptSubscriptions.delete(t)}!this.connected||!this.ws||this.send({type:"unsubscribe_v2",id:this.nextId(),payload:{session_id:t,...n!==void 0?{agent_ids:n}:{}}})}markSideChannelAgent(t,n){if(!this.opts.mainAgentOnly)return;let i=this.sideChannelAgents.get(t);if(i===void 0&&(i=new Set,this.sideChannelAgents.set(t,i)),i.has(n))return;i.add(n);const o=this.subscriptions.get(t);this.connected&&o!==void 0&&this.sendSubscribe([t],{[t]:o})}abort(t,n){!this.connected||!this.ws||this.send({type:"abort",id:this.nextId(),payload:{session_id:t,prompt_id:n}})}terminalAttach(t,n,i){const o=Fy(t,n),s=this.terminalAttachments.get(o),r=i??s?.lastSeq??0;this.terminalAttachments.set(o,{sessionId:t,terminalId:n,lastSeq:r}),!(!this.connected||!this.ws)&&this.sendTerminalAttach(t,n,r)}terminalInput(t,n,i){!this.connected||!this.ws||this.send({type:"terminal_input",id:this.nextId(),payload:{session_id:t,terminal_id:n,data:i}})}terminalResize(t,n,i,o){!this.connected||!this.ws||this.send({type:"terminal_resize",id:this.nextId(),payload:{session_id:t,terminal_id:n,cols:i,rows:o}})}terminalDetach(t,n){this.terminalAttachments.delete(Fy(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(Fy(t,n)),!(!this.connected||!this.ws)&&this.send({type:"terminal_close",id:this.nextId(),payload:{session_id:t,terminal_id:n}})}close(){this.closed=!0,this.connected=!1,this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.ws&&(this.ws.close(1e3),this.ws=null)}health(){const t=this.ws!==null&&this.ws.readyState===WebSocket.OPEN,n=Math.max(this.heartbeatMs*2,CAe),i=this.lastActivityAt>0&&Date.now()-this.lastActivityAt>n;return{connected:this.connected,open:t,stale:i}}reconnect(){if(this.closed)return;this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null);const t=this.ws;if(t!==null){t.onopen=null,t.onmessage=null,t.onerror=null,t.onclose=null;try{t.close(1e3,"reconnect")}catch{}}const n=this.connected;this.ws=null,this.connected=!1,n&&this.opts.handlers.onConnectionState(!1),this.connect()}handleFrame(t){const n=t,i=t.type;if(i==="transcript.reset"){const o=AU.safeParse({type:i,...n.payload}),s=n.session_id;if(!o.success||typeof s!="string"){this.opts.handlers.onError(0,"Invalid transcript.reset frame",!1);return}const r=o.data;this.opts.handlers.onTranscriptReset?.(s,r.agent_id,{...r.snapshot,hasMoreOlder:r.has_more_older},r.seq);const l=this.transcriptSubscriptions.get(s)?.get(r.agent_id);l!==void 0&&r.seq!==void 0&&(l.sinceSeq=r.seq);return}if(i==="transcript.ops"){const o=xU.safeParse({type:i,...n.payload}),s=n.session_id;if(!o.success||typeof s!="string"){this.opts.handlers.onError(0,"Invalid transcript.ops frame",!1);return}const r=o.data,l=this.opts.handlers.onTranscriptOps?.(s,r.agent_id,r.ops,r.seq),a=this.transcriptSubscriptions.get(s)?.get(r.agent_id);l!==!1&&a!==void 0&&r.seq!==void 0&&(a.sinceSeq=r.seq);return}switch(i){case"server_hello":{const o=n.payload?.heartbeat_ms;typeof o=="number"&&o>0&&(this.heartbeatMs=o),this.onServerHello();break}case"ping":this.send({type:"pong",payload:{nonce:n.payload.nonce}});break;case"resync_required":{const o=n.payload.session_id,s=n.payload.epoch;this.subscriptions.set(o,{seq:n.payload.current_seq,epoch:s}),this.opts.handlers.onResync(o,n.payload.current_seq,s);break}case"error":{const o=n.session_id;typeof o=="string"&&this.opts.handlers.onRawAgentEvent?this.opts.handlers.onRawAgentEvent({type:"error",seq:n.seq,session_id:o,timestamp:n.timestamp,payload:n.payload}):this.opts.handlers.onError(n.payload.code,n.payload.msg,n.payload.fatal);break}case"ack":n.id===this.clientHelloId&&(this.clientHelloId=null,n.code===0&&this.opts.handlers.onReplayComplete?.());break;case"terminal_output":{const o=n.session_id,s=n.terminal_id,r=n.seq,l=Fy(o,s),a=this.terminalAttachments.get(l);a&&this.terminalAttachments.set(l,{...a,lastSeq:Math.max(a.lastSeq,r)});const u=typeof n.payload?.data=="string"?n.payload.data:"";this.opts.handlers.onTerminalOutput?.(o,s,u,r);break}case"terminal_exit":{const o=n.session_id,s=n.terminal_id,r=n.payload?.exit_code,l=typeof r=="number"?r:null;this.opts.handlers.onTerminalExit?.(o,s,l);break}default:{this.trackCursor(n);const o=n.type,s=kAe(o,n.payload);if(s.route==="protocol"){this.opts.handlers.onWireEvent(n);break}if(s.route==="agent"){if(this.opts.handlers.onRawAgentEvent&&typeof n.session_id=="string"){const r=n,l=n;this.opts.handlers.onRawAgentEvent({type:s.agentType,seq:r.seq,session_id:r.session_id,timestamp:r.timestamp,payload:r.payload,...l.volatile!==void 0?{volatile:l.volatile}:{},...l.offset!==void 0?{offset:l.offset}:{}})}break}break}}}onServerHello(){this.connected=!0,this.reconnectAttempts=0,this.opts.handlers.onConnectionState(!0);const t=Array.from(this.subscriptions.keys());for(const o of this.pendingSubscriptions)this.subscriptions.set(o.sessionId,o.cursor),t.includes(o.sessionId)||t.push(o.sessionId);this.pendingSubscriptions.length=0;const n={};for(const[o,s]of this.subscriptions.entries())n[o]=s;const i=this.nextId();this.clientHelloId=i,this.send({type:"client_hello",id:i,payload:{client_id:this.opts.clientId,subscriptions:t,cursors:n,...this.opts.mainAgentOnly?{agent_filter:this.rawAgentFilter(t)}:{}}});for(const o of this.transcriptSubscriptions.keys())this.sendTranscriptSubscribe(o);for(const o of this.terminalAttachments.values())this.sendTerminalAttach(o.sessionId,o.terminalId,o.lastSeq)}sendSubscribe(t,n){this.send({type:"subscribe",id:this.nextId(),payload:{session_ids:t,cursors:n,...this.opts.mainAgentOnly?{agent_filter:this.rawAgentFilter(t)}:{}}})}rawAgentFilter(t){return Object.fromEntries(t.map(n=>[n,["main",...this.sideChannelAgents.get(n)??[]]]))}sendTranscriptSubscribe(t,n){const i=this.transcriptSubscriptions.get(t);if(i===void 0||i.size===0)return;const o={},s={};for(const[r,l]of i)o[r]="delta",l.sinceSeq!==void 0&&(n===void 0||n===r)&&(s[r]=l.sinceSeq);this.send({type:"subscribe_v2",id:this.nextId(),payload:{session_id:t,transcript:o,...Object.keys(s).length>0?{transcript_since:s}:{}}})}sendTerminalAttach(t,n,i){this.send({type:"terminal_attach",id:this.nextId(),payload:{session_id:t,terminal_id:n,since_seq:i>0?i:void 0}})}trackCursor(t){if(t.volatile===!0)return;const n=t.session_id,i=t.seq;if(typeof n!="string"||typeof i!="number")return;const o=this.subscriptions.get(n);if(!o||i<=o.seq&&o.epoch!==void 0)return;const s=typeof t.epoch=="string"?t.epoch:o.epoch;this.subscriptions.set(n,{seq:Math.max(i,o.seq),epoch:s})}send(t){if(!(!this.ws||this.ws.readyState!==WebSocket.OPEN))try{this.ws.send(JSON.stringify(t)),this.tracer.wsEvent?.({kind:"out",frame:t})}catch{}}nextId(){return`c_${++this.msgSeq}`}}function Fy(e,t){return`${e}\0${t}`}async function AAe(e,t,n){const i=await e.get(`/sessions/${encodeURIComponent(t)}/transcript`,{agent_id:n.agentId,before_turn:n.beforeTurn,after_turn:n.afterTurn,page_size:n.pageSize}),o=cAe.parse(i),s={items:o.items,tasks:o.tasks,interactions:o.interactions,attachments:o.attachments,todos:o.todos,prompts:o.prompts,meta:o.meta,hasMoreOlder:o.has_more};return{agentId:o.agent_id,...s,agents:o.agents,pendingInteractions:o.pending_interactions,...o.seq!==void 0?{seq:o.seq}:{}}}const gw=10485760,xAe=5e3,dF=40001;function SAe(e,t){if(e===void 0)return t;let n;const i=/filename\*\s*=\s*UTF-8''([^;]+)/i.exec(e)?.[1]?.trim();if(i!==void 0)try{n=decodeURIComponent(i.replaceAll(/^"|"$/g,""))}catch{return t}else n=/filename\s*=\s*"([^"]*)"/i.exec(e)?.[1]??/filename\s*=\s*([^;]+)/i.exec(e)?.[1]?.trim();return n===void 0||n.length===0||n.length>200||n==="."||n===".."||/[\u0000-\u001F\u007F/\\]/.test(n)||!n.toLowerCase().endsWith(".zip")?t:n}function _Ae(e){if(typeof e!="object"||e===null)return{errorName:typeof e};const t=e;return{errorName:typeof t.name=="string"?t.name:"Error",errorCode:typeof t.code=="number"?t.code:void 0,requestId:typeof t.requestId=="string"?t.requestId:void 0,phase:typeof t.phase=="string"?t.phase:void 0,httpStatus:typeof t.status=="number"?t.status:void 0}}function vw(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 fF(e){return e==="auto_compact"||e==="manual_compact"}class IAe{constructor(t){this.opts=t,this.tracer=t.tracer??Rx,this.http=new DD({origin:t.origin,identity:t.identity,tracer:this.tracer,credentialStore:t.credentialStore}),this.httpV2=new DD({origin:t.origin,identity:t.identity,tracer:this.tracer,credentialStore:t.credentialStore,restBasePath:"/api/v2"})}http;httpV2;tracer;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,experimentalFlags:t.experimental_flags??{},backend:t.backend==="v2"?"v2":"v1",webTitle:t.web_title??""}}async listSessions(t){const n={before_id:t?.beforeId,after_id:t?.afterId,page_size:t?.pageSize,busy:t?.busy,include_archive:t?.includeArchive,archived_only:t?.archivedOnly,exclude_empty:t?.excludeEmpty,workspace_id:t?.workspaceId},i=await this.http.get("/sessions",n);return{items:i.items.map(ju),hasMore:i.has_more}}async listSessionsV2(t){const n={sort:t?.sort,page_size:t?.pageSize,page_token:t?.pageToken,page:t?.page,"meta.updated_after":t?.updatedAfter,"meta.updated_before":t?.updatedBefore,"meta.archived":t?.archived===void 0?void 0:String(t.archived),include:t?.include,"workspace.id":t?.workspaceIds,"activity.status":t?.statuses},i=await this.httpV2.get("/sessions",n);return{items:i.items,hasMore:i.has_more,nextPageToken:i.next_page_token,total:i.total}}async listSessionIdsV2(t){const n={sort:t?.sort,page_size:t?.pageSize,page_token:t?.pageToken,page:t?.page,"meta.updated_after":t?.updatedAfter,"meta.updated_before":t?.updatedBefore,"meta.archived":t?.archived===void 0?void 0:String(t.archived),fields:"id,archived","workspace.id":t?.workspaceIds,"activity.status":t?.statuses},i=await this.httpV2.get("/sessions",n);return{items:i.items,hasMore:i.has_more,nextPageToken:i.next_page_token,total:i.total}}async listSessionGroupsV2(t){const n={view:"by_workspace","group.page_size":t?.groupPageSize,"meta.has_prompt":t?.hasPrompt===void 0?void 0:String(t.hasPrompt),sort:t?.sort,page_size:t?.pageSize,page_token:t?.pageToken,"meta.archived":t?.archived===void 0?void 0:String(t.archived),"workspace.id":t?.workspaceIds,"activity.status":t?.statuses},i=await this.httpV2.get("/sessions",n);return{groups:i.groups,hasMore:i.has_more,nextPageToken:i.next_page_token,total:i.total}}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 i=await this.http.post("/sessions",n);return ju(i)}async getSession(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}`);return ju(n)}async updateSession(t,n){const i={};n.title!==void 0&&(i.title=n.title),n.cwd!==void 0&&(i.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&&(i.agent_config=o);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/profile`,i);return ju(s)}async getSessionStatus(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/status`);return{model:n.model&&n.model.length>0?n.model:null,thinkingEffort:n.thinking_level,permission:n.permission,planMode:n.plan_mode===!0,swarmMode:n.swarm_mode===!0,contextTokens:n.context_tokens??0,maxContextTokens:n.max_context_tokens??0,contextUsage:n.context_usage??0}}async getSessionGoal(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/goal`);return Lq(n)}async getSessionPlans(t,n){const i=await this.http.get(`/sessions/${encodeURIComponent(t)}/transcript/plan`,{agent_id:n.agentId,tool_call_id:n.toolCallId});return i.plans.map(o=>({agentId:i.agent_id,toolCallId:o.tool_call_id,turnId:o.turn_id,source:o.source,plan:o.plan,...o.path!==void 0?{path:o.path}:{},...o.options!==void 0?{options:o.options.map(s=>({label:s.label,...s.description!==void 0?{description:s.description}:{}}))}:{},...o.review!==void 0?{review:{state:o.review.state,...o.review.selected_option!==void 0?{selectedOption:o.review.selected_option}:{},...o.review.feedback!==void 0?{feedback:o.review.feedback}:{}}}:{}}))}async getSessionWarnings(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/warnings`)).warnings??[]}async archiveSession(t){return await this.http.post(`/sessions/${encodeURIComponent(t)}:archive`,{})}async restoreSession(t){const n=await this.http.post(`/sessions/${encodeURIComponent(t)}:restore`,{});return ju(n)}async archiveSessions(t){return this.httpV2.post("/sessions:archive",{ids:t})}async restoreSessions(t){return this.httpV2.post("/sessions:restore",{ids:t})}async listMessages(t,n){const i={before_id:n?.beforeId,after_id:n?.afterId,page_size:n?.pageSize,role:n?.role},o=await this.http.get(`/sessions/${encodeURIComponent(t)}/messages`,i);return{items:o.items.map(Tq),hasMore:o.has_more}}async getSessionTranscript(t,n){return AAe(this.http,t,n)}async exportSession(t,n,i){const o=n===void 0?0:new TextEncoder().encode(n).byteLength,s=n===void 0||n.length===0?0:n.split(` -`).length,r=`/sessions/${encodeURIComponent(t)}/export`,l={web_log_bytes:o,web_log_entries:s},a=i?.desktop===!0;let u;try{u=await this.http.postZip(r,{web_log:n,...a?{desktop:!0}:{}},l)}catch(d){if(a&&di(d)&&d.code===dF)u=await this.http.postZip(r,{web_log:n},l);else throw d}const c=`${t}.zip`;return{blob:u.blob,fileName:SAe(u.contentDisposition,c)}}async submitPrompt(t,n){const i=Date.now();this.tracer.traceKeyEvent?.("prompt:start",{sessionId:t,contentCount:n.content.length,mediaCount:n.content.filter(o=>o.type==="image"||o.type==="video"||o.type==="file").length});try{const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts`,y4e(n));return this.tracer.traceKeyEvent?.("prompt:accepted",{sessionId:t,promptId:o.prompt_id,status:o.status,durationMs:Date.now()-i}),{promptId:o.prompt_id,userMessageId:o.user_message_id,origin:o.origin,status:o.status}}catch(o){throw this.tracer.traceKeyEvent?.("prompt:failed",{sessionId:t,status:"failed",durationMs:Date.now()-i,..._Ae(o)}),o}}async steerPrompts(t,n){const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts:steer`,{prompt_ids:n});return{steered:i.steered,promptIds:i.prompt_ids}}async abortPrompt(t,n){const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts/${encodeURIComponent(n)}:abort`,void 0,{allowCodes:[40903]});return{aborted:i.aborted,atSeq:i.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 generateSessionTitle(t,n){try{const i={};n?.force===!0&&(i.force=!0),n?.source!==void 0&&(i.source=n.source);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/title/generate`,i);return typeof o?.title=="string"&&o.title.length>0?o.title:null}catch{return null}}async forkSession(t,n){const i={};n?.title!==void 0&&(i.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}:fork`,i,{timeoutMs:ED});return ju(o)}async createChildSession(t,n){const i={};n?.title!==void 0&&(i.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/children`,i,{timeoutMs:ED});return ju(o)}async listChildSessions(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/children`)).items.map(ju)}async startBtw(t){return{agentId:(await this.http.post(`/sessions/${encodeURIComponent(t)}:btw`,{})).agent_id}}async respondApproval(t,n,i){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/approvals/${encodeURIComponent(n)}`,k4e(i));return{resolved:o.resolved,resolvedAt:o.resolved_at}}async respondQuestion(t,n,i){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}`,S4e(i));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 i={status:n};return(await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks`,i)).items.map(s=>TA(s))}async getTask(t,n,i){const o={with_output:i?.withOutput,output_bytes:i?.outputBytes},s=await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}`,o);return TA(s)}async cancelTask(t,n){return await this.http.post(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}:cancel`)}async detachTask(t,n){return await this.http.post(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}:detach`)}async listTerminals(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals`)).items.map(vw)}async createTerminal(t,n={}){const i={cwd:n.cwd,shell:n.shell,cols:n.cols,rows:n.rows},o=await this.http.post(`/sessions/${encodeURIComponent(t)}/terminals`,i);return vw(o)}async getTerminal(t,n){const i=await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}`);return vw(i)}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(i=>({name:i.name,description:i.description,path:i.path,source:i.source}))}async listSkillsForWorkspace(t){return((await this.http.get(`/workspaces/${encodeURIComponent(t)}/skills`)).skills??[]).map(i=>({name:i.name,description:i.description,path:i.path,source:i.source}))}async activateSkill(t,n,i,o){const s={};i!==void 0&&i.length>0&&(s.args=i),o!==void 0&&o.length>0&&(s.attachments=o.map(Eq));const r=await this.http.post(`/sessions/${encodeURIComponent(t)}/skills/${encodeURIComponent(n)}:activate`,s);return{activated:r.activated,skillName:r.skill_name}}async listCapabilities(){return(await this.http.get("/capabilities")).capabilities??[]}async getCapability(t){return this.http.get(`/capabilities/${encodeURIComponent(t)}`)}async installCapability(t){return this.http.post(`/capabilities/${encodeURIComponent(t)}:install`,{})}async listPlugins(){return(await this.http.get("/plugins")).plugins??[]}async listPluginMarketplace(){return(await this.http.get("/plugins/marketplace")).entries??[]}async installPlugin(t){return this.http.post("/plugins",{source:t})}async setPluginEnabled(t,n){return this.http.post(`/plugins/${encodeURIComponent(t)}:${n?"enable":"disable"}`,{})}async removePlugin(t){return this.http.post(`/plugins/${encodeURIComponent(t)}:remove`,{})}async listDirectory(t,n){const i={};n.path!==void 0&&(i.path=n.path),n.depth!==void 0&&(i.depth=n.depth),n.includeGitStatus!==void 0&&(i.include_git_status=n.includeGitStatus);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:list`,i),s=o.children_by_path?Object.fromEntries(Object.entries(o.children_by_path).map(([r,l])=>[r,l.map(OD)])):void 0;return{items:o.items.map(OD),childrenByPath:s,truncated:o.truncated}}async readFile(t,n){const i={path:n.path};n.offset!==void 0&&(i.offset=n.offset),n.length!==void 0&&(i.length=n.length);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:read`,i);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,i){const o={workspace:t,query:n.query};n.limit!==void 0&&(o.limit=n.limit);const s=await this.http.post("/workspace/fs:search",o,{signal:i?.signal});return{items:s.items.map(r=>({path:r.path,name:r.name,kind:r.kind,score:r.score,matchPositions:r.match_positions})),truncated:s.truncated}}async suggestFiles(t,n,i){const o={workspace:t,query:n.query};n.limit!==void 0&&(o.limit=n.limit);const s=await this.http.post("/workspace/fs:suggest",o,{signal:i?.signal});return{items:s.items.map(r=>({path:r.path,name:r.name,kind:r.kind,score:r.score,matchPositions:r.match_positions})),truncated:s.truncated}}async grepFiles(t,n){const i={pattern:n.pattern};n.regex!==void 0&&(i.regex=n.regex),n.caseSensitive!==void 0&&(i.case_sensitive=n.caseSensitive);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:grep`,i);return{files:o.files,filesScanned:o.files_scanned,truncated:o.truncated,elapsedMs:o.elapsed_ms}}async getGitStatus(t,n){const i={};n!==void 0&&(i.paths=n);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:git_status`,i);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 i=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:diff`,{path:n});return{path:i.path,diff:i.diff,truncated:i.truncated??!1}}getFileDownloadUrl(t,n){const i=n.split("/").map(o=>encodeURIComponent(o)).join("/");return Hd(this.opts.origin,`/sessions/${encodeURIComponent(t)}/fs/${i}:download`)}async openFile(t,n){const i={path:n.path};return n.line!==void 0&&(i.line=n.line),this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open`,i)}async revealFile(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/fs:reveal`,{path:n.path})}async openInApp(t,n,i,o){const s={app_id:n,path:i};o!==void 0&&(s.line=o),await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open-in`,s)}async listWorkspaces(){try{return((await this.http.get("/workspaces")).items??[]).map(j0)}catch{return[]}}async addWorkspace(t){const n={root:t.root};t.name!==void 0&&(n.name=t.name);const i=await this.http.post("/workspaces",n);return j0(i)}async deleteWorkspace(t){await this.http.delete(`/workspaces/${encodeURIComponent(t)}`)}async updateWorkspace(t,n){const i=await this.http.patch(`/workspaces/${encodeURIComponent(t)}`,{name:n.name});return j0(i)}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(i=>({name:i.name,path:i.path,isDir:i.is_dir}))}}catch{return{path:"",parent:null,entries:[]}}}async getFsHome(){try{const t=await this.http.get("/fs:home");return{home:t.home,recentRoots:t.recent_roots??[]}}catch{return{home:"",recentRoots:[]}}}async listModels(){return(await this.http.get("/models")).items.map(I4e)}async listProviders(){return(await this.http.get("/providers")).items.map(Xp)}async getProvider(t){const n=await this.http.get(`/providers/${encodeURIComponent(t)}`),i=Xp(n);return n.api_key!==void 0?{...i,apiKey:n.api_key}:i}async addProvider(t){const n={id:t.id??"",type:t.type,models:(t.models??[]).map(o=>{const s={model:o.model,max_context_size:o.maxContextSize};return o.displayName!==void 0&&(s.display_name=o.displayName),o.capabilities!==void 0&&(s.capabilities=o.capabilities),o.maxOutputSize!==void 0&&(s.max_output_size=o.maxOutputSize),o.supportEfforts!==void 0&&(s.support_efforts=o.supportEfforts),o.adaptiveThinking!==void 0&&(s.adaptive_thinking=o.adaptiveThinking),s})};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 i=await this.http.post("/providers",n);return Xp(i)}async updateProvider(t,n){const i={type:n.type,models:(n.models??[]).map(s=>{const r={model:s.model,max_context_size:s.maxContextSize};return s.displayName!==void 0&&(r.display_name=s.displayName),s.capabilities!==void 0&&(r.capabilities=s.capabilities),s.maxOutputSize!==void 0&&(r.max_output_size=s.maxOutputSize),s.supportEfforts!==void 0&&(r.support_efforts=s.supportEfforts),s.adaptiveThinking!==void 0&&(r.adaptive_thinking=s.adaptiveThinking),r})};n.newId!==void 0&&(i.new_id=n.newId),n.apiKey!==void 0&&(i.api_key=n.apiKey),n.baseUrl!==void 0&&(i.base_url=n.baseUrl),n.defaultModel!==void 0&&(i.default_model=n.defaultModel);const o=await this.http.put(`/providers/${encodeURIComponent(t)}`,i);return{provider:Xp(o.provider)}}async deleteProvider(t){return await this.http.delete(`/providers/${encodeURIComponent(t)}`),{deleted:t}}async listCatalogProviders(){return(await this.http.get("/catalog/providers")).items.map(PD)}async getCatalogProvider(t){const n=await this.http.get(`/catalog/providers/${encodeURIComponent(t)}`);return PD(n)}async importCatalogProvider(t){const n={catalog_id:t.catalogId};t.apiKey!==void 0&&(n.api_key=t.apiKey),t.baseUrl!==void 0&&(n.base_url=t.baseUrl),t.id!==void 0&&(n.id=t.id);const i=await this.http.post("/providers:import_catalog",n);return{provider:Xp(i.provider),modelsImported:i.models_imported}}async importCustomRegistry(t){const n={url:t.url};t.apiKey!==void 0&&(n.api_key=t.apiKey);const i=await this.http.post("/providers:import_registry",n);return{providers:i.providers.map(Xp),modelsImported:i.models_imported}}async refreshProvider(t){const n=await this.http.post(`/providers/${encodeURIComponent(t)}:refresh`);return yw(n)}async refreshAllProviders(){const t=await this.http.post("/providers:refresh");return yw(t)}async refreshOAuthProviderModels(){const t=await this.http.post("/providers:refresh_oauth");return yw(t)}async getConfig(){const t=await this.http.get("/config");return EA(t)}async setConfig(t){const n={},i={providers:"providers",defaultProvider:"default_provider",defaultModel:"default_model",secondaryModel:"secondary_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[s,r]of Object.entries(t)){const l=i[s];l!==void 0&&(n[l]=r)}const o=await this.http.post("/config",n);return EA(o)}async getAuth(){const t=await this.http.get("/auth");return{modelsReady:t.models_ready,providersCount:t.providers_count,managedProvider:t.managed_provider?{status:t.managed_provider.status}:null}}async startOAuthLogin(t){let n;try{n=await this.http.post("/oauth/login",t===void 0?{}:{region:t})}catch(i){if(t!==void 0&&di(i)&&i.code===dF)n=await this.http.post("/oauth/login",{});else throw i}return n.status==="authenticated"?{flowId:n.flow_id,provider:n.provider,status:"authenticated"}:{flowId:n.flow_id,provider:n.provider,status:"pending",verificationUri:n.verification_uri,verificationUriComplete:n.verification_uri_complete,userCode:n.user_code,expiresIn:n.expires_in,interval:n.interval,expiresAt:n.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,errorMessage:t.error_message}: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 getUsage(){const t=await this.http.get("/oauth/usage");if(t.kind==="error")return{kind:"error",message:t.message,status:t.status};const n=i=>({name:i.name,window:i.window,used:i.used,limit:i.limit,resetAt:i.reset_at});return{kind:"ok",summary:t.summary===null?null:n(t.summary),limits:t.limits.map(n),extraUsage:t.extra_usage===null?null:{balanceCents:t.extra_usage.balance_cents,totalCents:t.extra_usage.total_cents,monthlyChargeLimitEnabled:t.extra_usage.monthly_charge_limit_enabled,monthlyChargeLimitCents:t.extra_usage.monthly_charge_limit_cents,monthlyUsedCents:t.extra_usage.monthly_used_cents,currency:t.extra_usage.currency}}}async getUserInfo(){return this.http.get("/oauth/userinfo")}async getOAuthRegion(){try{const t=await Promise.race([this.http.get("/oauth/region"),new Promise((n,i)=>{setTimeout(()=>i(new Error("oauth region probe timed out")),xAe)})]);return t.region==="mainland-cn"||t.region==="global"?t.region:null}catch{return null}}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 i=await this.http.postForm("/files",n,t.onProgress===void 0?void 0:{onUploadProgress:t.onProgress});return{id:i.id,name:i.name,mediaType:i.media_type,size:i.size}}getFileUrl(t){return Hd(this.opts.origin,`/files/${encodeURIComponent(t)}`)}async getFileBlob(t){return this.http.getBlob(`/files/${encodeURIComponent(t)}`)}getSessionMediaUrl(t,n){return Hd(this.opts.origin,`/sessions/${encodeURIComponent(t)}/media/${encodeURIComponent(n)}`)}async getSessionMediaBlob(t,n){return this.http.getBlob(`/sessions/${encodeURIComponent(t)}/media/${encodeURIComponent(n)}`)}async readHostFileContent(t){const n=await this.http.getBlob("/fs:content",{path:t},{maxBytes:gw});if(n.size>gw)throw new A7({size:n.size,limit:gw});const i=n.type,o=!MAe(i),s=i||(o?"application/octet-stream":"text/plain");if(o){const l=await TAe(n);return{path:t,content:l,encoding:"base64",mime:s,isBinary:!0,size:n.size}}const r=await n.text();return{path:t,content:r,encoding:"utf-8",mime:s,isBinary:!1,size:n.size}}connectEvents(t){const n=TD(this.opts.origin,this.opts.identity.clientId),i=this.opts.projectorFactory(),o=new cF({wsUrl:n,clientId:this.opts.identity.clientId,tracer:this.tracer,credentialStore:this.opts.credentialStore,mainAgentOnly:this.opts.mainAgentOnly,handlers:{onWireEvent:s=>{const r=M4e(s),l=T4e(s),a=_4e(s);a.type==="historyCompacted"&&!fF(a.reason)&&t.onResync(a.sessionId,a.beforeSeq),t.onEvent(a,{sessionId:r,seq:l})},onRawAgentEvent:s=>{const{type:r,seq:l,session_id:a,payload:u,offset:c}=s,d=i.project(r,u,a,{offset:c});for(const h of d){const p=u?.turnId,m=h.type==="assistantDelta"&&typeof p=="number"&&typeof c=="number"&&(r==="assistant.delta"||r==="thinking.delta")?{turnId:p,offset:c,kind:r==="assistant.delta"?"text":"thinking"}:void 0;h.type==="historyCompacted"&&!fF(h.reason)&&t.onResync(a,l),t.onEvent(h,{sessionId:a,seq:l,stream:m})}},onResync:(s,r,l)=>{i.reset(s),t.onResync(s,r,l)},onConnectionState:s=>{t.onConnectionChange(s)},onReplayComplete:()=>{t.onReplayComplete?.()},onError:(s,r,l)=>{t.onError(s,r,l)},onTerminalOutput:(s,r,l,a)=>{t.onTerminalOutput?.(s,r,l,a)},onTerminalExit:(s,r,l)=>{t.onTerminalExit?.(s,r,l)},onTranscriptReset:(s,r,l,a)=>{t.onTranscriptReset?.(s,r,l,a)},onTranscriptOps:(s,r,l,a)=>t.onTranscriptOps?.(s,r,l,a)??!0}});return o.connect(),{subscribe(s,r){o.subscribe(s,r??{seq:0})},unsubscribe(s){o.unsubscribe(s),i.forgetSession(s)},subscribeTranscript(s,r,l){o.subscribeTranscript(s,r,l)},unsubscribeTranscript(s,r){o.unsubscribeTranscript(s,r)},bindNextPromptId(s,r){i.bindNextPromptId(s,r)},abort(s,r){o.abort(s,r)},terminalAttach(s,r,l){o.terminalAttach(s,r,l)},terminalInput(s,r,l){o.terminalInput(s,r,l)},terminalResize(s,r,l,a){o.terminalResize(s,r,l,a)},terminalDetach(s,r){o.terminalDetach(s,r)},terminalClose(s,r){o.terminalClose(s,r)},markSideChannelAgent(s,r){o.markSideChannelAgent(s,r),i.markSideChannelAgent(r)},health(){return o.health()},reconnect(){o.reconnect()},close(){o.close()}}}connectTranscriptChannel(t){const n=`${this.opts.identity.clientId}-transcript`,i=new cF({wsUrl:TD(this.opts.origin,n),clientId:n,tracer:this.tracer,credentialStore:this.opts.credentialStore,handlers:{onWireEvent:()=>{},onResync:()=>{},onConnectionState:o=>t.onConnectionState?.(o),onError:(o,s,r)=>t.onError?.(o,s,r),onTranscriptReset:t.onTranscriptReset,onTranscriptOps:t.onTranscriptOps}});return i.connect(),{subscribe:()=>{},unsubscribe:()=>{},subscribeTranscript:(o,s,r)=>i.subscribeTranscript(o,s,r),unsubscribeTranscript:(o,s)=>i.unsubscribeTranscript(o,s),bindNextPromptId:()=>{},abort:()=>{},terminalAttach:()=>{},terminalInput:()=>{},terminalResize:()=>{},terminalDetach:()=>{},terminalClose:()=>{},markSideChannelAgent:()=>{},health:()=>i.health(),reconnect:()=>i.reconnect(),close:()=>i.close()}}}function yw(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}}function MAe(e){const t=e.toLowerCase().split(";")[0].trim();return t===""||t==="text/plain"||t.startsWith("text/")?!0:/(json|xml|javascript|typescript|x-yaml|yaml|svg|x-sh|x-python|markdown|csv|html|css)$/.test(t)}function TAe(e){return new Promise((t,n)=>{const i=new FileReader;i.onload=()=>{const o=typeof i.result=="string"?i.result:"";t(o.slice(o.indexOf(",")+1))},i.onerror=()=>n(i.error),i.readAsDataURL(e)})}const EAe="main",LAe=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.use","tool.call.started","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.completed","prompt.aborted","error"]);function kw(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 NAe(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 hF(){return{turnPromptId:new Map,currentPromptId:void 0,totalInput:0,totalOutput:0,totalCacheRead:0,totalCacheCreate:0,contextTokens:0,contextLimit:0,turnCount:0,model:"",subagentMeta:new Map,restartedThisRun:new Set,settledByKernel:new Set,retiredBindings:new Set,registrationSeq:0,registrationOrderByKey:new Map,retryActive:!1}}function Xr(e,t){const n=e[t];return typeof n=="string"?n:void 0}function Fr(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function Ma(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function DAe(e){if(!e||typeof e!="object")return null;const t=e,n=t.budget,i=n&&typeof n=="object"?n:{},o=Xr(t,"status");if(o!=="active"&&o!=="paused"&&o!=="blocked"&&o!=="complete")return null;const s=Xr(t,"goalId")??Xr(t,"goal_id")??"goal",r=Xr(t,"objective")??"";return{goalId:s,objective:r,completionCriterion:Xr(t,"completionCriterion")??Xr(t,"completion_criterion"),status:o,turnsUsed:Fr(t,"turnsUsed")??Fr(t,"turns_used")??0,tokensUsed:Fr(t,"tokensUsed")??Fr(t,"tokens_used")??0,wallClockMs:Fr(t,"wallClockMs")??Fr(t,"wall_clock_ms")??0,terminalReason:Xr(t,"terminalReason")??Xr(t,"terminal_reason"),budget:{tokenBudget:Ma(i,"tokenBudget")??Ma(i,"token_budget"),remainingTokens:Ma(i,"remainingTokens")??Ma(i,"remaining_tokens"),turnBudget:Ma(i,"turnBudget")??Ma(i,"turn_budget"),remainingTurns:Ma(i,"remainingTurns")??Ma(i,"remaining_turns"),wallClockBudgetMs:Ma(i,"wallClockBudgetMs")??Ma(i,"wall_clock_budget_ms"),remainingWallClockMs:Ma(i,"remainingWallClockMs")??Ma(i,"remaining_wall_clock_ms"),overBudget:i.overBudget===!0||i.over_budget===!0}}}function Fd(e,t,n,i,o){if(typeof i!="string"||i.length===0)return null;const r={...t.subagentMeta.get(i)??{id:i,agentId:i,sessionId:n,kind:"subagent",description:e("tasks.dockSubagent"),status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued"},...o,id:i,sessionId:n,kind:"subagent"};return t.subagentMeta.set(i,r),r}function FAe(e,t,n){if(t==="turn.step.started")return null;if(t==="tool.use"||t==="tool.call.started"){const i=Xr(n,"name")??Xr(n,"toolName")??"tool",o=pz(e,RAe(i)),s=OAe(e,i,n.args??n.input);return s?`Calling ${o}: ${s}`:`Calling ${o}`}if(t==="tool.progress"){const i=n.update;if(i&&typeof i=="object"){const s=Xr(i,"text");if(s)return bw(s);const r=Xr(i,"message");if(r)return bw(r)}const o=Xr(n,"message");if(o)return bw(o)}return null}function RAe(e){return e.replace(/_\d+$/,"")}const pF=2e3;function bw(e){return e.length>pF?`${e.slice(0,pF)}…`:e}function OAe(e,t,n){if(n==null)return"";const i=typeof n=="string"?n:JSON.stringify(n);return C7(e,t,i)}function PAe(e,t,n,i,o,s,r){if(r.has(i)&&o==="turn.step.started")return[];if(o==="assistant.delta"){const p=Xr(s,"delta");if(!p)return[];const m=t.subagentMeta.get(i),g=Fd(e,t,n,i,{status:"running",subagentPhase:"working",startedAt:m?.startedAt??new Date().toISOString()}),y=[];return g&&y.push({type:"taskCreated",sessionId:n,task:g}),y.push({type:"taskProgress",sessionId:n,taskId:i,outputChunk:p,stream:"stdout",kind:"text"}),y}const l=FAe(e,o,s);if(l===null||l.length===0)return[];const a=o==="tool.progress"?s.update:void 0,u=a!=null&&typeof a=="object"?a.replace===!0:!1,c=t.subagentMeta.get(i),d=Fd(e,t,n,i,{status:"running",subagentPhase:"working",startedAt:c?.startedAt??new Date().toISOString()}),h=[];return d&&h.push({type:"taskCreated",sessionId:n,task:d}),h.push({type:"taskProgress",sessionId:n,taskId:i,outputChunk:l,stream:"stdout",replace:u}),h}function $Ae(e){return Array.isArray(e)?e.map(t=>D4(t)):[]}function BAe(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}}const zAe=new Set(["session.meta.updated","goal.updated","compaction.completed","compaction.started","compaction.cancelled","compaction.blocked","hook.result","mcp.server.status","skill.activated","tool.list.updated"]);function jAe(e,t,n){switch(e){case"session.meta.updated":{const i=t?.patch?.title??t?.title,o=t?.patch?.lastPrompt,s={};return typeof i=="string"&&i.length>0&&(s.title=i),typeof o=="string"&&(s.lastPrompt=o),s.title!==void 0||s.lastPrompt!==void 0?[{type:"sessionMetaUpdated",sessionId:n,...s}]:[]}case"goal.updated":{const i=DAe(t?.snapshot??null);return[{type:"goalUpdated",sessionId:n,goal:i?.status==="complete"?null:i}]}case"compaction.completed":{const i=t?.result??{};return[{type:"compactionCompleted",sessionId:n,tokensBefore:typeof i.tokensBefore=="number"?i.tokensBefore:void 0,tokensAfter:typeof i.tokensAfter=="number"?i.tokensAfter:void 0,summary:typeof i.summary=="string"?i.summary:void 0},{type:"historyCompacted",sessionId:n,beforeSeq:0,reason:"auto_compact"}]}case"compaction.started":return[{type:"compactionStarted",sessionId:n,trigger:t?.trigger==="manual"?"manual":"auto",instruction:typeof t?.instruction=="string"?t.instruction:void 0}];case"compaction.cancelled":return[{type:"compactionCancelled",sessionId:n}];default:return[]}}function HAe(e){const{t}=e,n=new Map,i=new Set;function o(h){let p=n.get(h);return p||(p=hF(),n.set(h,p)),p}function s(h){n.set(h,hF())}function r(h){n.delete(h)}function l(h){return n.has(h)}function a(h){i.add(h)}function u(h,p){const m=o(h);m.currentPromptId=p}function c(h,p,m,g){try{return d(h,p,m,g)}catch(y){return Ku("[agentProjector] Error projecting event:",h,y instanceof Error?y.message:y),[]}}function d(h,p,m,g){if(zAe.has(h))return jAe(h,p,m);const y=o(m),b=p,v=[],C=b?.agentId;if(typeof C=="string"&&C!==EAe){const w=i.has(C);if(h==="prompt.submitted"){if(!w)return[];const M=b?.promptId,N=b?.userMessageId;if(!M||!N)return[];const T=$Ae(b?.content);return T.length===0?[]:[{type:"messageCreated",agentId:C,message:{id:N,sessionId:m,role:"user",content:T,createdAt:typeof b?.createdAt=="string"?b.createdAt:new Date().toISOString(),promptId:M}}]}if(w&&(h==="thinking.delta"||h==="assistant.delta")){const M=b?.delta??"";return M?[{type:"agentDelta",sessionId:m,agentId:C,delta:{[h==="thinking.delta"?"thinking":"text"]:M}}]:[]}if(w&&h==="turn.ended")return[{type:"agentTurnEnded",sessionId:m,agentId:C,reason:b?.reason}];if(LAe.has(h))return PAe(t,y,m,C,h,b??{},i)}switch(h){case"turn.started":{const w=b?.turnId,M=y.currentPromptId??kw("pr_");y.currentPromptId=M,w!==void 0&&y.turnPromptId.set(w,M),v.push({type:"turnActiveChanged",sessionId:m,active:!0});break}case"turn.step.started":case"thinking.delta":case"assistant.delta":case"tool.use":case"tool.call.started":case"tool.call.delta":case"tool.progress":case"tool.result":break;case"turn.step.completed":{const w=NAe(b?.usage);y.totalInput+=w.input,y.totalOutput+=w.output,y.totalCacheRead+=w.cacheRead,y.totalCacheCreate+=w.cacheCreate;break}case"agent.status.updated":{b?.model&&(y.model=b.model),b?.contextTokens!==void 0&&(y.contextTokens=b.contextTokens),b?.maxContextTokens!==void 0&&(y.contextLimit=b.maxContextTokens);const w=b?.phase;w!=null&&w.kind==="retrying"?(y.retryActive=!0,v.push({type:"turnRetry",sessionId:m,retry:{failedAttempt:Fr(w,"failedAttempt")??0,nextAttempt:Fr(w,"nextAttempt")??0,maxAttempts:Fr(w,"maxAttempts")??0,delayMs:Fr(w,"delayMs")??0,errorName:Xr(w,"errorName"),statusCode:Fr(w,"statusCode"),turnId:Fr(w,"turnId")}})):y.retryActive&&w!==void 0&&w!==null&&typeof w.kind=="string"&&(y.retryActive=!1,v.push({type:"turnRetry",sessionId:m,retry:void 0})),v.push({type:"sessionUsageUpdated",sessionId:m,usage:BAe(y),model:y.model||void 0,swarmMode:b?.swarmMode===!0?!0:b?.swarmMode===!1?!1:void 0,planMode:b?.planMode===!0?!0:b?.planMode===!1?!1:void 0,thinking:typeof b?.thinkingEffort=="string"&&b.thinkingEffort.length>0?b.thinkingEffort:void 0});break}case"turn.ended":{const w=b?.turnId,M=(w!==void 0?y.turnPromptId.get(w):void 0)??y.currentPromptId;v.push({type:"turnActiveChanged",sessionId:m,active:!1,reason:b?.reason,promptId:M}),y.turnCount++,y.currentPromptId=void 0;break}case"prompt.completed":{const w=b?.promptId;typeof w=="string"&&w.length>0&&v.push({type:"promptCompleted",sessionId:m,promptId:w,reason:b?.reason??"completed"});break}case"prompt.aborted":{const w=b?.promptId;typeof w=="string"&&w.length>0&&v.push({type:"promptAborted",sessionId:m,promptId:w});break}case"turn.step.retrying":{y.retryActive=!0,v.push({type:"turnRetry",sessionId:m,retry:{failedAttempt:Fr(b??{},"failedAttempt")??0,nextAttempt:Fr(b??{},"nextAttempt")??0,maxAttempts:Fr(b??{},"maxAttempts")??0,delayMs:Fr(b??{},"delayMs")??0,errorName:Xr(b??{},"errorName"),statusCode:Fr(b??{},"statusCode"),turnId:typeof b?.turnId=="number"?b.turnId:void 0}});break}case"turn.step.interrupted":break;case"subagent.spawned":{const w=typeof b?.subagentId=="string"&&b.subagentId.length>0?b.subagentId:kw("task_"),M=typeof b?.taskId=="string"&&b.taskId.length>0?b.taskId:void 0,N=M!==void 0&&M!==w?y.subagentMeta.get(M):void 0,T=y.subagentMeta.get(w);N!==void 0&&y.subagentMeta.delete(M),M!==void 0&&!y.registrationOrderByKey.has(M)&&y.registrationOrderByKey.set(M,++y.registrationSeq);const S=T===void 0||N===void 0?T??N:{...T,createdAt:N.createdAt,startedAt:N.startedAt??T.startedAt,runInBackground:!0,backgroundTaskId:T.backgroundTaskId??M},x=S?.backgroundTaskId??(S!==void 0&&M!==void 0&&S.id===M?M:void 0),A=M!==void 0?y.registrationOrderByKey.get(M):void 0,E=x!==void 0?y.registrationOrderByKey.get(x):void 0,I=y.retiredBindings.has(M??"")||A!==void 0&&E!==void 0&&A0?b.model:S?.model,thinkingEffort:typeof b?.thinkingEffort=="string"&&b.thinkingEffort.length>0?b.thinkingEffort:S?.thinkingEffort,parentToolCallId:typeof b?.parentToolCallId=="string"?b.parentToolCallId:S?.parentToolCallId,swarmIndex:typeof b?.swarmIndex=="number"?b.swarmIndex:S?.swarmIndex,runInBackground:R?b?.runInBackground===!0||b?.runInBackground===void 0&&S?.runInBackground===!0:b?.runInBackground===!0||S?.runInBackground===!0,outputPreview:R?void 0:S?.outputPreview,outputBytes:R?void 0:S?.outputBytes,outputLines:R?void 0:S?.outputLines,suspendedReason:R?void 0:S?.suspendedReason,text:R?void 0:S?.text,backgroundTaskId:I?S?.backgroundTaskId:R?M:M??S?.backgroundTaskId};y.subagentMeta.set(z.id,z),v.push({type:"taskCreated",sessionId:m,task:z});break}case"subagent.started":{const w=typeof b?.subagentId=="string"?b.subagentId:void 0,M=w!==void 0&&(y.subagentMeta.get(w)?.status!==void 0&&y.subagentMeta.get(w).status!=="running"||y.settledByKernel.has(w));M&&y.settledByKernel.delete(w);const N=Fd(t,y,m,b?.subagentId,{subagentPhase:"working",status:"running",startedAt:new Date().toISOString(),suspendedReason:void 0,...M?{createdAt:new Date().toISOString(),completedAt:void 0,completedAtEstimated:void 0,outputPreview:void 0,outputBytes:void 0,outputLines:void 0,text:void 0}:{}});M&&w!==void 0&&y.restartedThisRun.add(w),N&&v.push({type:"taskCreated",sessionId:m,task:N});break}case"subagent.suspended":{const w=Fd(t,y,m,b?.subagentId,{subagentPhase:"suspended",status:"running",suspendedReason:typeof b?.reason=="string"?b.reason:void 0});w&&v.push({type:"taskCreated",sessionId:m,task:w});break}case"subagent.completed":{const w=typeof b?.resultSummary=="string"?b.resultSummary:void 0,M=Fd(t,y,m,b?.subagentId,{subagentPhase:"completed",status:"completed",completedAt:new Date().toISOString(),completedAtEstimated:!0,outputPreview:w});M&&v.push({type:"taskCreated",sessionId:m,task:M}),M!==null&&y.restartedThisRun.delete(M.id),v.push({type:"taskCompleted",sessionId:m,taskId:b?.subagentId??"",status:"completed",outputPreview:w});break}case"subagent.failed":{const w=typeof b?.error=="string"?b.error:void 0,M=Fd(t,y,m,b?.subagentId,{subagentPhase:"failed",status:"failed",completedAt:new Date().toISOString(),completedAtEstimated:!0,outputPreview:w});M&&v.push({type:"taskCreated",sessionId:m,task:M}),M!==null&&y.restartedThisRun.delete(M.id),v.push({type:"taskCompleted",sessionId:m,taskId:b?.subagentId??"",status:"failed",outputPreview:w});break}case"error":{v.push({type:"unknown",raw:{_agentError:!0,code:b?.code,message:b?.message,name:b?.name,details:b?.details,retryable:b?.retryable}});break}case"warning":{v.push({type:"unknown",raw:{_agentWarning:!0,message:b?.message}});break}case"task.started":case"background.task.started":{const w=b?.info??{},M=typeof w.startedAt=="number"?new Date(w.startedAt).toISOString():void 0,N=typeof w.taskId=="string"?w.taskId:typeof w.taskId=="number"?String(w.taskId):kw("task_"),T=typeof w.description=="string"?w.description:typeof w.command=="string"?w.command:t("tasks.defaultDescription");if(w.kind==="agent"){const x=typeof w.agentId=="string"&&w.agentId.length>0?w.agentId:void 0;if(x!==void 0){const A=y.subagentMeta.get(x),E=y.registrationOrderByKey.get(N),I=A?.backgroundTaskId!==void 0?y.registrationOrderByKey.get(A.backgroundTaskId):void 0;if(y.retiredBindings.has(N)||E!==void 0&&I!==void 0&&EI.backgroundTaskId===N);if(A===void 0&&(y.retiredBindings.has(N)||y.registrationOrderByKey.has(N)&&y.registrationOrderByKey.get(N)0&&y.settledByKernel.add(w.agentId),v.push({type:"taskCompleted",sessionId:m,taskId:typeof w.taskId=="string"?w.taskId:typeof w.taskId=="number"?String(w.taskId):"",status:w.status==="killed"?"cancelled":M?"failed":"completed"});break}}return v}return{project:c,bindNextPromptId:u,reset:s,forgetSession:r,markSideChannelAgent:a,hasSessionState:l}}function WAe(e){return new IAe({origin:e.origin,identity:e.identity,tracer:e.tracer,credentialStore:e.credentialStore,projectorFactory:()=>HAe({t:e.t}),mainAgentOnly:e.mainAgentOnly})}const qAe={t:e=>e},mF="Sub Agent";function UAe(){return{sessions:[],activeSessionId:void 0,approvalsBySession:{},planReviewByToolCallId:{},questionsBySession:{},tasksBySession:{},goalBySession:{},goalVersionBySession:{},lastSeqBySession:{},turnActiveBySession:{},turnErrorBySession:{},turnRetryBySession:{},compactionBySession:{},warnings:[]}}function VAe(e){return{...e,sessions:e.sessions,approvalsBySession:{...e.approvalsBySession},planReviewByToolCallId:{...e.planReviewByToolCallId},questionsBySession:{...e.questionsBySession},tasksBySession:{...e.tasksBySession},goalBySession:{...e.goalBySession},goalVersionBySession:{...e.goalVersionBySession},lastSeqBySession:{...e.lastSeqBySession},turnActiveBySession:{...e.turnActiveBySession},turnErrorBySession:{...e.turnErrorBySession},turnRetryBySession:{...e.turnRetryBySession},compactionBySession:{...e.compactionBySession},warnings:[...e.warnings]}}function KAe(e,t,n){if(t!==void 0&&n!==void 0&&n>0){const i=e.lastSeqBySession[t]??0;n>i&&(e.lastSeqBySession[t]=n)}}function Ry(e,t){const n=e.sessions.find(i=>i.id===t.sessionId)?.lastSeq??0;return t.seq>Math.max(e.lastSeqBySession[t.sessionId]??0,n)}const ZAe={"provider.connection_error":"connection","provider.auth_error":"auth","provider.rate_limit":"rateLimit","provider.overloaded":"overloaded","provider.filtered":"filtered","provider.api_error":"api","context.overflow":"contextOverflow"};function RA(e,t){const n=[],i=(r,l)=>{typeof l=="number"||typeof l=="boolean"?n.push({label:r,value:String(l)}):typeof l=="string"&&l.length>0&&n.push({label:r,value:l})};i(t("warnings.details.code"),e.code);const o=e.details??{};i(t("warnings.details.status"),o.statusCode),i(t("warnings.details.requestId"),o.requestId),i(t("warnings.details.errorName"),e.name);for(const[r,l]of Object.entries(o))r==="statusCode"||r==="requestId"||i(r,l);const s=(e.code!==void 0?ZAe[e.code]:void 0)??"title";return{severity:"error",title:t(`warnings.agentError.${s}`),message:e.message,details:n.length>0?n:void 0}}function GAe(e,t,n,i=qAe){const o=VAe(e);switch(KAe(o,n.sessionId,n.seq),t.type){case"sessionCreated":{o.sessions.some(r=>r.id===t.session.id)||(o.sessions=[t.session,...o.sessions]);break}case"sessionUpdated":{o.sessions=o.sessions.map(s=>s.id===t.session.id?{...t.session,pullRequest:s.pullRequest}:s);break}case"sessionDeleted":{const s=t.sessionId;o.sessions=o.sessions.filter(r=>r.id!==s),delete o.tasksBySession[s],delete o.goalBySession[s],delete o.goalVersionBySession[s],delete o.approvalsBySession[s],delete o.questionsBySession[s],delete o.lastSeqBySession[s],delete o.turnActiveBySession[s],delete o.turnErrorBySession[s],delete o.turnRetryBySession[s],o.activeSessionId===s&&(o.activeSessionId=void 0);break}case"sessionWorkChanged":{if(!Ry(e,n))break;let s;o.sessions=o.sessions.map(r=>r.id!==t.sessionId?r:(s=t.pendingInteraction??(t.busy?r.pendingInteraction:"none"),{...r,busy:t.busy,mainTurnActive:t.mainTurnActive??(t.busy?r.mainTurnActive:!1),pendingInteraction:s,lastTurnReason:t.lastTurnReason})),s==="none"?(delete o.approvalsBySession[t.sessionId],delete o.questionsBySession[t.sessionId]):s==="question"&&delete o.approvalsBySession[t.sessionId],t.mainTurnActive===!0?o.turnActiveBySession[t.sessionId]=!0:(t.mainTurnActive===!1||!t.busy)&&(delete o.turnActiveBySession[t.sessionId],delete o.turnRetryBySession[t.sessionId]);break}case"sessionMetaUpdated":{o.sessions=o.sessions.map(s=>s.id===t.sessionId?{...s,title:t.title??s.title,lastPrompt:t.lastPrompt??s.lastPrompt}:s);break}case"sessionUsageUpdated":{o.sessions=o.sessions.map(s=>{if(s.id!==t.sessionId)return s;const r=t.model&&t.model.length>0?t.model:s.model;return{...s,usage:t.usage,model:r}});break}case"historyCompacted":break;case"compactionStarted":{o.compactionBySession={...o.compactionBySession,[t.sessionId]:{status:"running",trigger:t.trigger}};break}case"compactionCompleted":{const s=t.sessionId,{[s]:r,...l}=o.compactionBySession;o.compactionBySession=l;break}case"compactionCancelled":{const{[t.sessionId]:s,...r}=o.compactionBySession;o.compactionBySession=r;break}case"messageCreated":case"messageUpdated":case"assistantDelta":case"toolOutput":break;case"approvalRequested":{const s=t.sessionId,r=o.approvalsBySession[s]??[];r.some(u=>u.approvalId===t.approval.approvalId)||(o.approvalsBySession[s]=[...r,t.approval]);const a=t.approval.display;a?.kind==="plan_review"&&typeof a.plan=="string"&&a.plan.length>0&&(o.planReviewByToolCallId={...o.planReviewByToolCallId,[t.approval.toolCallId]:{plan:a.plan,path:typeof a.path=="string"?a.path:void 0}});break}case"approvalResolved":case"approvalExpired":{const s=t.sessionId,r=t.approvalId,l=o.approvalsBySession[s]??[];o.approvalsBySession[s]=l.filter(a=>a.approvalId!==r);break}case"questionRequested":{const s=t.sessionId,r=o.questionsBySession[s]??[];r.some(a=>a.questionId===t.question.questionId)||(o.questionsBySession[s]=[...r,t.question]);break}case"questionAnswered":case"questionDismissed":{const s=t.sessionId,r=t.questionId,l=o.questionsBySession[s]??[];o.questionsBySession[s]=l.filter(a=>a.questionId!==r);break}case"taskCreated":{const s=t.sessionId,r=o.tasksBySession[s]??[],l=r.findIndex(h=>h.id===t.task.id),a=t.task.backgroundTaskId===void 0?-1:r.findIndex(h=>h.id===t.task.backgroundTaskId),u=a!==-1&&l!==-1&&a!==l?r[a]:void 0,c=u!==void 0?r.filter((h,p)=>p!==a):r,d=c.findIndex(h=>h.id===t.task.id||t.task.backgroundTaskId!==void 0&&h.id===t.task.backgroundTaskId);if(d===-1)o.tasksBySession[s]=[...c,t.task];else{const h=[...c],p=c[d],m=t.task.backgroundTaskId!==void 0&&(t.task.backgroundTaskId===p.backgroundTaskId||p.id===t.task.backgroundTaskId)||p.id===t.task.id&&(p.kind!=="subagent"||p.agentId===void 0),g=(m&&p.status!=="running"?p:void 0)??(u!==void 0&&u.status!=="running"?u:void 0),y=g!==void 0&&(t.task.status==="running"||t.task.status!==g.status),b=!m&&p.status!=="running"||t.task.backgroundTaskId!==void 0&&p.backgroundTaskId!==void 0&&t.task.backgroundTaskId!==p.backgroundTaskId,v=m&&p.completedAt!==void 0&&p.completedAtEstimated!==!0;h[d]={...t.task,status:y?g.status:t.task.status,subagentPhase:y?g.subagentPhase:t.task.subagentPhase,completedAt:y?g.completedAt:v?p.completedAt:t.task.completedAt,completedAtEstimated:y?g.completedAtEstimated:v?p.completedAtEstimated:t.task.completedAtEstimated,outputLines:y?g.outputLines:b?u?.outputLines??t.task.outputLines:p.outputLines??u?.outputLines??t.task.outputLines,text:y?g.text:b?u?.text??t.task.text:p.text??u?.text??t.task.text,outputPreview:y?g.outputPreview:t.task.outputPreview??(b?u?.outputPreview:p.outputPreview??u?.outputPreview),outputBytes:y?g.outputBytes:t.task.outputBytes??(b?u?.outputBytes:p.outputBytes??u?.outputBytes),description:t.task.description===mF&&p.description!==mF?p.description:t.task.description,swarmIndex:t.task.swarmIndex??p.swarmIndex,parentToolCallId:t.task.parentToolCallId??p.parentToolCallId,subagentType:t.task.subagentType??p.subagentType,model:t.task.model??p.model,thinkingEffort:t.task.thinkingEffort??p.thinkingEffort,runInBackground:b?t.task.runInBackground:t.task.runInBackground??p.runInBackground,backgroundTaskId:b?t.task.backgroundTaskId:t.task.backgroundTaskId??p.backgroundTaskId,agentId:t.task.agentId??p.agentId},o.tasksBySession[s]=h}break}case"taskProgress":{const s=t.sessionId,r=o.tasksBySession[s]??[];o.tasksBySession[s]=r.map(l=>{if(l.id!==t.taskId)return l;if(l.kind==="subagent"&&t.kind==="text")return{...l,text:(l.text??"")+t.outputChunk};const a=l.outputLines??[];if(t.replace===!0){const c=a.length>0?[...a.slice(0,-1),t.outputChunk]:[t.outputChunk];return{...l,outputLines:c}}if(a.at(-1)===t.outputChunk)return l;const u=[...a,t.outputChunk];return{...l,outputLines:l.kind==="subagent"?u:u.slice(-40)}});break}case"taskCompleted":{const s=t.sessionId,r=o.tasksBySession[s]??[];o.tasksBySession[s]=r.map(l=>l.id!==t.taskId&&l.backgroundTaskId!==t.taskId||t.status==="completed"&&(l.status==="cancelled"||l.status==="failed")||t.status==="failed"&&l.status==="cancelled"?l:{...l,status:t.status,completedAt:l.completedAt??new Date().toISOString(),completedAtEstimated:l.completedAt===void 0?!0:l.completedAtEstimated,outputPreview:t.outputPreview??l.outputPreview,outputBytes:t.outputBytes??l.outputBytes});break}case"goalUpdated":{const s=t.sessionId;o.goalVersionBySession[s]=(o.goalVersionBySession[s]??0)+1,t.goal===null||t.goal.status==="complete"?delete o.goalBySession[s]:o.goalBySession[s]=t.goal;break}case"configChanged":{o.config=t.config;break}case"modelCatalogChanged":break;case"agentDelta":case"agentTurnEnded":break;case"promptCompleted":case"promptAborted":break;case"turnActiveChanged":{if(!Ry(e,n))break;if(o.sessions=o.sessions.map(s=>s.id===t.sessionId?{...s,mainTurnActive:t.active}:s),t.active)o.turnActiveBySession[t.sessionId]=!0,delete o.turnErrorBySession[t.sessionId],delete o.turnRetryBySession[t.sessionId];else{delete o.turnActiveBySession[t.sessionId],delete o.turnRetryBySession[t.sessionId];const s=t.reason===void 0||t.reason==="completed"?"completed":"failed",r=o.tasksBySession[t.sessionId];r!==void 0&&(o.tasksBySession[t.sessionId]=r.map(l=>l.kind!=="subagent"||l.status!=="running"||l.runInBackground===!0?l:{...l,status:s,subagentPhase:s,completedAt:l.completedAt??new Date().toISOString(),completedAtEstimated:l.completedAt===void 0?!0:l.completedAtEstimated,suspendedReason:void 0}))}break}case"turnRetry":{if(!Ry(e,n))break;t.retry===void 0?delete o.turnRetryBySession[t.sessionId]:o.turnRetryBySession[t.sessionId]=t.retry;break}case"unknown":{const s=t.raw;if(!(s&&s._noop===!0))if(s&&s._agentError){if(Ry(e,n)){if(n.sessionId!==void 0){const r=s.details??{};o.turnErrorBySession[n.sessionId]={code:s.code,message:s.message,name:s.name,retryable:s.retryable,statusCode:typeof r.statusCode=="number"?r.statusCode:void 0,requestId:typeof r.requestId=="string"?r.requestId:void 0}}(n.sessionId===void 0||n.sessionId!==e.activeSessionId)&&(o.warnings=[...o.warnings,RA(s,i.t)])}}else if(s&&s._agentWarning){const r=s.message??s.code??i.t("warnings.agentWarningFallback");o.warnings=[...o.warnings,`${i.t("warnings.noteLabel")}: ${r}`]}else{const r=s?.type??"(unknown)";o.warnings=[...o.warnings,i.t("warnings.unhandledEvent",{type:r})]}break}}return o}function QAe(e,t){if(e===t)return!0;const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(const o of n)if(e[o]!==t[o])return!1;return!0}function YAe(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n]*)>([\s\S]*?)<\/notification>/g,XAe=/([\w-]+)="([^"]*)"/g,e6e=/]*)>[\s\S]*?<\/output-file>/,t6e=/]*)>([\s\S]*?)<\/output-preview>/,n6e=/^Title: (.*)$/m,i6e=/^Severity: (.*)$/m;function L9(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function ww(e){const t={};for(const n of e.matchAll(XAe))n[1]!==void 0&&n[2]!==void 0&&(t[n[1]]=L9(n[2]));return t}function o6e(e,t,n){const i=ww(e),o=n6e.exec(t)?.[1]?.trim()??"",s=i6e.exec(t)?.[1]?.trim()??"";let r=t.split(` -`).filter(h=>!h.startsWith("Title: ")&&!h.startsWith("Severity: ")).join(` -`);const l=r.search(/^<\w/m);l!==-1&&(r=r.slice(0,l)),r=r.trim();const a=e6e.exec(t),u=a?(()=>{const h=ww(a[1]??""),p=Number(h.bytes);return h.path!==void 0&&h.path!==""?{path:h.path,bytes:Number.isFinite(p)?p:void 0}:void 0})():void 0,c=t6e.exec(t),d=c?(()=>{const h=ww(c[1]??""),p=(c[2]??"").replace(/^\n/,""),m=p.indexOf(` -`),g=L9(m===-1?"":p.slice(m+1)).replace(/\n$/,""),y=Number(h.bytes),b=Number(h.total_bytes);return{text:g,bytes:Number.isFinite(y)?y:void 0,totalBytes:Number.isFinite(b)?b:void 0,truncated:h.truncated==="true"?!0:h.truncated==="false"?!1:void 0}})():void 0;return{id:i.id??"",category:i.category??"",type:i.type??"",sourceKind:i.source_kind??"",sourceId:i.source_id??"",agentId:i.agent_id,title:L9(o),severity:s,body:L9(r),outputFile:u,outputPreview:d,raw:n}}function s6e(e){if(!e.includes("(/^Background (process|agent)$/.test(u.description)&&(u={...u,description:""}),u),r=u6e.exec(n);if(r?.[1]!==void 0&&r[2]!==void 0)return s({status:r[2]==="timed out"?"timed_out":r[2],description:r[1],reason:r[3],rest:o});const l=c6e.exec(n);if(l?.[1]!==void 0)return s({status:"killed",description:l[1],userStopped:l[2]!==void 0,reason:l[3],rest:o});const a=d6e.exec(n);if(a?.[1]!==void 0&&a[2]!==void 0)return s({status:a[2]==="was killed"?"killed":a[2]==="timed out"?"timed_out":a[2],description:a[1],reason:a[3],rest:o})}function h6e(e){if(!_U(e.title))return;const t=f6e(e.body);if(!(t===void 0||t.status!==ab(e)))return t}const p6e=1e6,gF=5e3;function cc(e){return e===""?[]:e.endsWith(` -`)?e.slice(0,-1).split(` -`):e.split(` -`)}function ub(e,t){const n=cc(e),i=cc(t),o=n.length,s=i.length;if(o===0&&s===0)return[];if(o>gF||s>gF||(o+1)*(s+1)>p6e)return null;const r=Array.from({length:o+1},()=>Array.from({length:s+1},()=>0));for(let p=1;p<=o;p++)for(let m=1;m<=s;m++)r[p][m]=n[p-1]===i[m-1]?r[p-1][m-1]+1:Math.max(r[p-1][m],r[p][m-1]);const l=[];let a=o,u=s;for(;a>0||u>0;)a>0&&u>0&&n[a-1]===i[u-1]?(l.push({type:"context",text:n[a-1]}),a--,u--):u>0&&(a===0||r[a][u-1]>=r[a-1][u])?(l.push({type:"add",text:i[u-1]}),u--):(l.push({type:"del",text:n[a-1]}),a--);l.reverse();const c=[];let d=1,h=1;for(const p of l)p.type==="context"?(c.push({type:"context",text:p.text,oldNo:d,newNo:h}),d++,h++):p.type==="add"?(c.push({type:"add",text:p.text,newNo:h}),h++):(c.push({type:"del",text:p.text,oldNo:d}),d++);return c}const vF=500;function yF(e,t){const n=[],i=cc(e),o=cc(t),s=Math.min(i.length,vF),r=Math.min(o.length,vF);for(let l=1;l<=s;l++)n.push({type:"del",text:i[l-1],oldNo:l});i.length>s&&n.push({type:"context",text:`… ${i.length-s} more lines …`});for(let l=1;l<=r;l++)n.push({type:"add",text:o[l-1],newNo:l});return o.length>r&&n.push({type:"context",text:`… ${o.length-r} more lines …`}),n}function IU(e){let t=0,n=0;for(const i of e)i.type==="add"?t++:i.type==="del"&&n++;return{added:t,removed:n}}function Yc(e){const t=e;return t?.kind!=="user"||!Array.isArray(t.skillActivations)?[]:t.skillActivations.flatMap(n=>{if(typeof n!="object"||n===null)return[];const i=n;return typeof i.skillName!="string"?[]:[{name:i.skillName,...typeof i.skillArgs=="string"?{args:i.skillArgs}:{}}]})}function m6e(e){return{content:e.content,skillActivations:Yc(e.metadata?.origin)}}function W0(e,t){return e.length===t.length&&e.every((n,i)=>{const o=t[i];return o!==void 0&&n.name===o.name&&n.args===o.args})}const g6e=/^read[_-]?media(?:file)?$/i,v6e=/^data:([^;]+);base64,(.*)$/s,y6e=/^<(image|video|audio)\s+path="([^"]+)">$/,k6e=/^<(image|video|audio)\s+path="([^"]+)">(?:<\/\1>)?$/,b6e=/Mime type:\s*([^.\s]+)/i,w6e=/Size:\s*(\d+)\s*bytes/i,C6e=/Original dimensions:\s*(\d+)x(\d+)\s*pixels/i,A6e="Image compressed to fit model limits:",x6e=/Image compressed to fit model limits:[\s\S]*?<\/system>/g;function kF(e){return e.includes(A6e)?e.replace(x6e,""):e}function S6e(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function bF(e){const t=k6e.exec(e.trim());return t?{kind:t[1],path:S6e(t[2])}:null}const MU=/^f_(?:[0-9A-Za-z]{26}|[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})$/,_6e=/f_(?:[0-9A-Za-z]{26}|[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})$/;function OA(e){const t=e.split(/[\\/]/).at(-1)??"",n=t.lastIndexOf("."),i=n>0?t.slice(0,n):t;return MU.test(i)?i:void 0}const Uc='Attached file "',TU=" — open it with the Read tool";function I6e(e,t,n,i){const o=`-${e}`,s=i.endsWith(o)?i.slice(0,-o.length):i,r=_6e.exec(s)?.[0];return{name:e,mediaType:t,size:Number(n),fileId:r!==void 0&&MU.test(r)?r:void 0}}const EU="attachmentRecords",M6e=65536;function T6e(e,t,n){const i=t+Uc.length,o=e.slice(i,n),s=o.indexOf('" (');if(s<=0)return!1;const r=o.indexOf(", ",s+3);if(r<=s+3)return!1;let l=i+r+2;if(l>=n||e.charCodeAt(l)<48||e.charCodeAt(l)>57)return!1;for(;l=48&&e.charCodeAt(l)<=57;)l++;return e.startsWith(" bytes): ",l)}function E6e(e,t,n){let i=e.indexOf(Uc,t);for(;i>=0&&i=n?n:s;if(T6e(e,i,r))return i;if(s<0||s>=n)return-1;i=s}return-1}function L6e(e,t){const n=t+Uc.length,i=Math.min(e.length,n+M6e),o=e.slice(n,i),s=o.indexOf('" (');if(s<=0)return null;const r=n+s,l=o.indexOf(", ",s+3);if(l<=s+3)return null;const a=n+l+2;let u=a;for(;u=48&&e.charCodeAt(u)<=57;)u++;if(u===a||!e.startsWith(" bytes): ",u))return null;const c=e.slice(a,u),d=u+9,h=E6e(e,r,i),p=h>=0?Math.min(h,i):i,m=e.slice(d,p),g=o.slice(0,s),y=`-${g}${TU}`;let b=m.lastIndexOf(y);for(;b>=0;){const C=m.slice(0,b),w=Math.max(C.lastIndexOf("/"),C.lastIndexOf("\\"));if(!/\s/.test(C.slice(w+1)))break;b=m.lastIndexOf(y,b-1)}if(b<0)return null;const v=m.slice(0,b+1+g.length);return{start:t,end:d+b+y.length,info:I6e(g,o.slice(s+3,l),c,v)}}function Yx(e){if(!e.includes(TU))return[];const t=[];let n=e.indexOf(Uc);for(;n>=0;){const i=L6e(e,n);n=i?e.indexOf(Uc,i.end):e.indexOf(Uc,n+Uc.length),i&&t.push(i)}return t}function wF(e){const t=Yx(e);if(t.length===0)return e;let n="",i=0;for(const o of t)n+=e.slice(i,o.start),i=o.end;return n+e.slice(i)}function N6e(e){const t=[];for(const o of e.content)o.type==="file"&&t.push({fileId:o.fileId,name:o.name});const n=[...t],i=e.metadata?.[EU];if(Array.isArray(i))for(const o of i){if(typeof o!="object"||o===null)continue;const s=o.fileId,r=o.name,l={fileId:typeof s=="string"&&s.length>0?s:void 0,name:typeof r=="string"&&r.length>0?r:void 0},a=n.findIndex(u=>l.fileId!==void 0?u.fileId===l.fileId:u.fileId===void 0&&u.name===l.name);a>=0?n.splice(a,1):t.push(l)}return t.length>0?t:null}function D6e(e){const t=N6e(e);if(t)return{kind:"paired",records:t};let n=0;for(const s of e.content)if(s.type==="text")for(const r of PA(s.text))n=Math.max(n,r);const i=e.metadata?.origin;for(const s of[i?.skillArgs,i?.commandArgs])if(typeof s=="string")for(const r of PA(s))n=Math.max(n,r);if(n===0)return{kind:"legacy"};let o=0;for(const s of e.content)s.type==="text"&&(o+=Yx(s.text).length);return{kind:"pill",keepLast:n,total:o}}function F6e(e){let t=0;const n=e.kind==="pill"?Math.max(0,e.total-e.keepLast):0;return i=>{const o=Yx(i);if(o.length===0)return{notices:[],text:i};const s=[];for(const a of o){const u=t++;if(e.kind==="legacy")s.push(a);else if(e.kind==="pill")u>=n&&s.push(a);else{const c=a.info.fileId,d=e.records.findIndex(h=>c!==void 0?h.fileId===c:h.fileId===void 0&&h.name===a.info.name);d>=0&&(e.records.splice(d,1),s.push(a))}}if(s.length===0)return{notices:[],text:i};let r="",l=0;for(const a of s)r+=i.slice(l,a.start),l=a.end;return{notices:s.map(a=>a.info),text:r+i.slice(l)}}}const R6e=/(?=0&&e[i]==="\\";)n+=1,i-=1;return n%2===1}function LU(e){let t="",n=0,i=0;for(;i0?t:void 0}return[JSON.stringify(e)]}}function W6e(e,t){if(cr(e)==="task")for(const n of t??[]){const i=/^agent_id:\s*(\S+)\s*$/.exec(n);if(i?.[1])return i[1]}}function q6e(e,t){return{id:e.agentId??e.id,toolCallId:e.parentToolCallId,name:e.description,kind:e.kind,subagentType:e.subagentType,prompt:e.command??t,model:e.model,thinkingEffort:e.thinkingEffort,phase:e.status==="completed"?"completed":e.status==="failed"?"failed":e.status==="cancelled"?"cancelled":e.subagentPhase??"working",status:e.status,summary:e.outputPreview,outputLines:e.outputLines,text:e.text,suspendedReason:e.suspendedReason,swarmIndex:e.swarmIndex}}function NU(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const i=typeof t.path=="string"?t.path:"";if(Array.isArray(t.diff))return{kind:"diff",path:i,diff:t.diff};const o=typeof t.old_text=="string"?t.old_text:typeof t.before=="string"?t.before:void 0,s=typeof t.new_text=="string"?t.new_text:typeof t.after=="string"?t.after:void 0;if(o!==void 0&&s!==void 0){const r=ub(o,s)??yF(o,s);return{kind:"diff",path:i,diff:r}}return{kind:"diff",path:i,diff:[]}}if(n==="file_io"){const i=typeof t.path=="string"?t.path:"",o=typeof t.operation=="string"?t.operation:"";if(o==="write"&&typeof t.content=="string")return{kind:"file",path:i,content:t.content};if(o==="edit"&&typeof t.before=="string"&&typeof t.after=="string"){const r=ub(t.before,t.after)??yF(t.before,t.after);return{kind:"diff",path:i,diff:r}}const s=typeof t.detail=="string"?t.detail:void 0;return{kind:"fileop",op:o||n,path:i,detail:s}}if(n==="shell"||n==="command"){const i=typeof t.command=="string"?t.command:e.action;return{kind:"shell",command:i,cwd:typeof t.cwd=="string"?t.cwd:void 0,danger:typeof t.danger=="string"?t.danger:Iae(i)}}if(n==="file_content"||n==="file")return{kind:"file",path:typeof t.path=="string"?t.path:"",content:typeof t.content=="string"?t.content:"",language:typeof t.language=="string"?t.language:void 0};if(n==="file_op"||n==="fileop")return{kind:"fileop",op:typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,path:typeof t.path=="string"?t.path:"",detail:typeof t.detail=="string"?t.detail:void 0};if(n==="url_fetch"||n==="url")return{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:typeof t.url=="string"?t.url:e.action};if(n==="search")return{kind:"search",query:typeof t.query=="string"?t.query:e.action,scope:typeof t.scope=="string"?t.scope:void 0};if(n==="invocation"||n==="agent_call"||n==="skill_call")return{kind:"invocation",kind2:typeof t.kind=="string"?t.kind:n,name:typeof t.name=="string"?t.name:e.toolName,description:typeof t.description=="string"?t.description:void 0};if(n==="todo"||n==="todo_list")return{kind:"todo",items:(Array.isArray(t.items)?t.items:[]).map(s=>{const r=s??{};return{title:typeof r.title=="string"?r.title:"",status:typeof r.status=="string"?r.status:"pending"}})};if(n==="plan_review"){const i=typeof t.plan=="string"?t.plan:"",o=typeof t.path=="string"?t.path:void 0,r=(Array.isArray(t.options)?t.options:[]).map(l=>{const a=l??{},u=typeof a.label=="string"?a.label:"";if(!u)return null;const c=typeof a.description=="string"?a.description:void 0;return{label:u,description:c}}).filter(l=>l!==null);return{kind:"plan_review",plan:i,path:o,options:r.length>0?r:void 0}}return{kind:"generic",summary:e.action}}function DU(e){const t=` -`,n=` -`,i=e.indexOf(t),o=e.lastIndexOf(n);return i>=0&&o>=i+t.length?e.slice(i+t.length,o):U6e(e)}function U6e(e){const t=e.split(` -`);return t.length>=2&&t[0]?.startsWith(""?t.slice(1,-1).join(` -`):e}function V6e(e){const t=e.metadata?.origin;if(t?.kind==="cron_job"||t?.kind==="cron_missed")return t.kind}function K6e(e){const t=e.content.filter(n=>n.type==="text").map(n=>n.text).join(` -`);return DU(t)}function Z6e(e,t){const n=e.metadata?.origin??{},i=K6e(e);return t==="cron_missed"?{text:i,cron:{missedCount:typeof n.count=="number"?n.count:void 0}}:{text:i,cron:{jobId:typeof n.jobId=="string"?n.jobId:void 0,cron:typeof n.cron=="string"?n.cron:void 0,recurring:typeof n.recurring=="boolean"?n.recurring:void 0,coalescedCount:typeof n.coalescedCount=="number"?n.coalescedCount:void 0,stale:typeof n.stale=="boolean"?n.stale:void 0}}}function G6e(e,t,n){const{text:i,cron:o}=Z6e(e,n);return{id:e.id,role:"cron",no:t,text:i,createdAt:e.createdAt,cron:o}}function Q6e(e){const t=e.metadata?.origin,n=t?.kind;return n===void 0||n==="user"?!0:n==="skill_activation"||n==="plugin_command"?t?.trigger==="user-slash":!1}function Y6e(e){const t=e.metadata?.["kimiWeb.steeredPromptIds"];if(Array.isArray(t)){const i=t.filter(o=>typeof o=="string"&&o.length>0);if(i.length>0)return i}if(e.promptId!==void 0&&e.promptId.length>0)return[e.promptId];const n=e.metadata?.["kimiWeb.promptId"];if(typeof n=="string"&&n.length>0)return[n]}function J6e(e){return e.metadata?.origin?.kind==="compaction_summary"}function X6e(e,t){return e===null?!1:e.promptId===void 0||t===void 0||e.promptId===t}function e7e(e){if(!e||e.length===0)return;const t="Plan saved to: ";for(const n of e)if(n.startsWith(t))return n.slice(t.length).trim()}function t7e(e){const t=[];for(const n of e){const i=t.at(-1);n.type==="text"&&i?.type==="text"?i.text+=n.text:n.type==="thinking"&&i?.type==="thinking"?i.thinking+=n.thinking:n.type==="thinking"?t.push({type:"thinking",thinking:n.thinking}):t.push({...n})}return JSON.stringify(t)}function z4(e,t,n,i=!0,o={},s={},r){const l=[];let a=r?.startNo??1;const u=r?.collect,c=new Map;for(const g of t)c.set(g.toolCallId,g);let d=null;function h(g=!1){if(!d)return;const y=d;if(d=null,!g&&y.blocks.length===0&&y.textParts.length===0&&y.thinkingParts.length===0&&y.tools.length===0)return;if(!g||!i)for(let v=0;vN.kind==="tool"&&N.tool.id===w.id);M&&M.kind==="tool"&&(M.tool=w)}const b={id:y.id,role:"assistant",no:a++,text:y.textParts.join(` -`),thinking:y.thinkingParts.length>0?y.thinkingParts.join(` -`):void 0,tools:y.tools.length>0?y.tools:void 0,blocks:y.blocks.length>0?y.blocks:void 0,approval:y.approval,approvalId:y.approvalId,durationMs:y.durationMs,createdAt:y.createdAt,endedAt:y.endedAt,goalContinuation:y.goalContinuation};l.push(b),u?.(b,y.sources)}function p(g,y){let b=null;for(const v of y)if(v.type==="text"){if(v.text){b==="text"?g.textParts[g.textParts.length-1]+=v.text:g.textParts.push(v.text);const C=g.blocks.at(-1);C&&C.kind==="text"?C.text+=(b==="text"?"":` -`)+v.text:g.blocks.push({kind:"text",text:v.text}),b="text"}}else if(v.type==="thinking"){if(v.thinking){b==="thinking"?g.thinkingParts[g.thinkingParts.length-1]+=v.thinking:g.thinkingParts.push(v.thinking);const C=g.blocks.at(-1);if(C&&C.kind==="thinking"){C.thinking+=(b==="thinking"?"":` -`)+v.thinking;const w=[C.startedAt,v.startedAt].filter(T=>T!==void 0).sort()[0],M=C.startedAt!==void 0&&C.durationMs===void 0||v.startedAt!==void 0&&v.durationMs===void 0,N=[C,v].flatMap(T=>T.startedAt!==void 0&&T.durationMs!==void 0?[Date.parse(T.startedAt)+T.durationMs]:[]);C.startedAt=w,C.durationMs=!M&&w!==void 0&&N.length>0?Math.max(...N)-Date.parse(w):void 0}else g.blocks.push({kind:"thinking",thinking:v.thinking,startedAt:v.startedAt,durationMs:v.durationMs});b="thinking"}}else if(v.type==="toolUse"){b=null;const C=c.get(v.toolCallId),w=v.toolName==="ExitPlanMode"?s[v.toolCallId]:void 0,M={id:v.toolCallId,name:v.toolName,arg:typeof v.input=="string"?v.input:JSON.stringify(v.input),agentId:cr(v.toolName)==="task"?v.agentRefs?.find(N=>N.role!=="member")?.agentId??v.agentRefs?.[0]?.agentId:void 0,status:"running",output:v.outputLines,plan:w,planPath:v.toolName==="ExitPlanMode"?w?.path??o[v.toolCallId]?.path:void 0};g.tools.push(M),g.blocks.push({kind:"tool",tool:M}),C&&(g.approval=NU(C),g.approvalId=C.approvalId)}else if(v.type==="toolResult"){b=null;const C=g.tools.findIndex(w=>w.id===v.toolCallId);if(C!==-1){const w=g.tools[C],M=Jx(v.output),N={...w,status:v.isError?"error":"ok",output:M,media:v.isError?void 0:H6e(w.name,v.output),agentId:w.agentId??W6e(w.name,M)};N.name==="ExitPlanMode"&&!N.planPath&&(N.planPath=e7e(N.output)),g.tools[C]=N;const T=g.blocks.find(S=>S.kind==="tool"&&S.tool.id===v.toolCallId);T&&T.kind==="tool"&&(T.tool=N)}}else b=null}function m(g,y){if(g.type==="image"||g.type==="video"){const b=g.type,v=g.source;if(v.kind==="url")return{url:v.url,kind:b};if(v.kind==="base64")return{url:`data:${v.mediaType};base64,${v.data}`,kind:b};if(v.kind==="file"&&n)return{url:n(v.fileId),kind:b,fileId:v.fileId};if(v.kind==="sessionMedia")return{url:r?.getSessionMediaUrl?.(y,v.fileId)??"",kind:b,fileId:v.fileId,sessionId:y}}if(g.type==="file"&&n){if(g.mediaType.startsWith("image/"))return{url:n(g.fileId),kind:"image",fileId:g.fileId};if(g.mediaType.startsWith("video/"))return{url:n(g.fileId),kind:"video",fileId:g.fileId}}}for(const g of e){if(g.role==="system")continue;if(J6e(g)){h();const w=g.metadata?.[Bz],M={id:g.id,role:"compaction",no:a,text:g.content.filter(N=>N.type==="text").map(N=>N.text).join(` -`),compaction:{trigger:w?.trigger,tokensBefore:w?.tokensBefore,tokensAfter:w?.tokensAfter}};l.push(M),u?.(M,[g]);continue}if(g.role==="user"){const w=V6e(g),M=g.metadata?.origin?.kind,N=M==="skill_activation"&&g.metadata?.origin?.trigger!=="user-slash";if(w===void 0&&(M==="injection"||N))continue;if(w===void 0&&(M==="task"||M==="background_task"||M==="task_notification")){const oe=g.content.filter(fe=>fe.type==="text").map(fe=>fe.text).join(` -`),Z=r6e(g.metadata),Q=Z!==void 0?[Z]:s6e(oe);if(Q.length>0){d??={id:g.id,promptId:void 0,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,sources:[g],createdAt:g.createdAt};for(const fe of Q)d.blocks.push({kind:"notification",notification:{...fe,createdAt:g.createdAt}})}continue}if(h(),w!==void 0){const oe=G6e(g,a++,w);l.push(oe),u?.(oe,[g]);continue}if(M==="system_trigger"&&g.metadata?.origin?.name==="goal_continuation"){d={id:g.id,promptId:void 0,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,sources:[g],createdAt:g.createdAt,goalContinuation:!0};continue}if(!Q6e(g))continue;const T=g.metadata?.origin,S=T?.kind==="skill_activation"&&T?.trigger==="user-slash",x=T?.kind==="plugin_command"&&T?.trigger==="user-slash",A=m6e(g),E=A.skillActivations,I=A.content,R=[];let W=[];const z=F6e(D6e(g)),F=new Set,O=oe=>{const Z={kind:"file",url:oe.fileId&&n?n(oe.fileId):"",fileId:oe.fileId,name:oe.name,mediaType:oe.mediaType,size:oe.size};W.push(Z),F.add(Z)};for(const oe of I){if(oe.type==="text")if(S){const Q=bF(oe.text);if(Q&&(Q.kind==="video"||Q.kind==="image")&&n){const fe=OA(Q.path);if(fe){W.push({url:n(fe),kind:Q.kind,fileId:fe});continue}}for(const fe of z(oe.text).notices)O(fe)}else if(x)R.push(T.commandArgs??"");else{const Q=bF(oe.text);if(Q&&(Q.kind==="video"||Q.kind==="image")&&n){const pe=OA(Q.path);if(pe){W.push({url:n(pe),kind:Q.kind,fileId:pe});continue}}const fe=z(oe.text);if(fe.notices.length>0){for(const X of fe.notices)O(X);if(fe.text.trim().length===0)continue;const pe=kF(fe.text);if(pe!==fe.text&&pe.trim().length===0)continue;R.push(pe);continue}const de=kF(oe.text);if(de!==oe.text&&de.trim().length===0)continue;R.push(de)}const Z=m(oe,g.sessionId);if(Z){W.push({url:Z.url,kind:Z.kind,name:oe.type==="file"?oe.name:void 0,fileId:Z.fileId,sessionId:Z.sessionId});continue}oe.type==="file"&&n&&W.push({kind:"file",url:n(oe.fileId),fileId:oe.fileId,name:oe.name,mediaType:oe.mediaType||void 0,size:oe.size})}const B=new Map;for(const oe of F){if(oe.fileId===void 0)continue;const Z=`${oe.kind}|${oe.fileId}`;B.set(Z,(B.get(Z)??0)+1)}W=W.filter(oe=>{if(F.has(oe)||oe.fileId===void 0)return!0;const Z=`${oe.kind}|${oe.fileId}`,Q=B.get(Z)??0;return Q>0?(B.set(Z,Q-1),!1):!0});const j=S?T?.skillArgs??"":R.join(` -`),$=PA(j),V=$6e(j),ne=W.filter(oe=>oe.kind==="file"),K=W.filter(oe=>oe.kind==="image"||oe.kind==="video"),ee=[...$].some(oe=>oe<=ne.length),ue=[...V].some(oe=>oe<=K.length),ie=ee||ue?W:[];let ye=0,Te=0;const Ee=W.filter(oe=>oe.kind==="file"?(ye+=1,!(ee&&$.has(ye))):oe.kind==="image"||oe.kind==="video"?(Te+=1,!(ue&&V.has(Te))):!0),Me=g.metadata?.["kimiWeb.steeredPromptIds"],G={id:g.id,role:"user",no:a++,text:j,hasUndoAnchor:g.metadata?.["kimiWeb.settledWithoutEcho"]===!0||g.metadata?.["kimiWeb.steered"]===!0?!1:void 0,steered:g.metadata?.["kimiWeb.steered"]===!0||Array.isArray(Me)&&Me.length>0?!0:void 0,promptIds:Y6e(g),attachments:Ee.length>0?Ee:void 0,inlineAttachments:ie.length>0?ie:void 0,skillActivation:S?{name:T.skillName,args:T.skillArgs}:void 0,skillActivations:E.length>0?E.map(oe=>({name:oe.name,args:oe.args})):void 0,pluginCommand:x?{pluginId:T.pluginId,commandName:T.commandName,args:T.commandArgs}:void 0,createdAt:g.createdAt};l.push(G),u?.(G,[g]);continue}if(g.role==="tool"){d&&(d.sources.push(g),p(d,g.content),d.endedAt=g.createdAt);continue}const y=g.promptId;X6e(d,y)?d!==null&&d.promptId===void 0&&y!==void 0&&(d.promptId=y):(h(),d={id:g.id,promptId:y,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,sources:[],durationMs:g.durationMs,createdAt:g.createdAt});const v=d;if(v===null)continue;const C=t7e(g.content);v.promptId!==void 0&&v.seenSigs.has(C)||(v.seenSigs.add(C),v.sources.push(g),g.durationMs!==void 0&&(v.durationMs=g.durationMs),p(v,g.content),g.endedAt!==void 0?v.endedAt=g.endedAt:g.id!==v.id&&(v.endedAt=g.createdAt))}return h(!0),l}function FU(e,t,n){return e.state==="running"&&e.frames.at(-1)===t&&!n}function n7e(e,t){if(t.size===0)return;let n=!1;for(const l of t.values())if(l.settledAt===void 0){n=!0;break}if(!n)return;const i=new Date().toISOString(),o=e.items.findLast(l=>l.kind==="turn"&&l.state==="running"),s=o?.kind==="turn"?o.steps.findLast(l=>l.state==="running"):void 0,r=e.interactions.some(l=>l.state==="pending");for(const l of e.items)if(l.kind==="turn")for(const a of l.steps){const u=r&&a===s;for(const c of a.frames){if(c.kind!=="thinking")continue;const d=t.get(c.frameId);d===void 0||d.settledAt!==void 0||FU(a,c,u)||(d.settledAt=i)}}}function i7e(e,t){if(t.size===0)return;const n=new Set;for(const i of e.items)if(i.kind==="turn")for(const o of i.steps)for(const s of o.frames)s.kind==="thinking"&&n.add(s.frameId);for(const i of[...t.keys()])n.has(i)||t.delete(i)}function o7e(e,t,n,i){const o=e.items.filter(h=>h.kind==="turn"),s=o[0]?.turnId,r=o.length===1?s:void 0,l=new Map(e.tasks.map(h=>[h.taskId,h])),a=new Map(e.prompts.map(h=>[h.promptId,h])),u=OU(e.prompts,RU(e.items)),c=e.items.flatMap(h=>h.kind==="turn"?Xx(h,e.attachments,l,h.turnId===s?n?.createdAt:void 0,h.turnId===r?n?.disposedAt:void 0,i?.sessionId,{promptById:a,promptForTurn:u}):[]),d=e.meta.activity==="turn";return z4(c,[],t,d,{},{},{getSessionMediaUrl:i?.getSessionMediaUrl}).map(u7e)}function CF(e){if(!Array.isArray(e))return[];const t=[];for(const n of e){if(typeof n!="object"||n===null)continue;const i=n;if(i.type!=="file")continue;const o=typeof i.fileId=="string"?i.fileId:i.file_id;t.push({fileId:typeof o=="string"?o:void 0,name:typeof i.name=="string"?i.name:void 0})}return t}function AF(e,t){return t.length===0?e:{...e,[EU]:t}}const s7e=new Set(["user","skill_activation","plugin_command"]);function r7e(e){return(e.origin.payload??e.origin)?.kind}function l7e(e){const t=e.content;if(!Array.isArray(t))return;const n=[];for(const i of t)if(typeof i=="object"&&i!==null&&i.type==="text"){const o=i.text;typeof o=="string"&&n.push(o)}return n.join("")}function RU(e){const t=new Set;for(const n of e)if(n.kind==="turn"){for(const i of n.steps)for(const o of i.frames)if(o.kind==="text")for(const s of o.promptIds??[])t.add(s)}return t}function OU(e,t){const n=new Set(t??[]);return i=>{const o=r7e(i);if(o!==void 0&&!s7e.has(o)||i.prompt===void 0&&(i.attachmentIds??[]).length===0)return;const s=wF(i.prompt??"");for(const r of e){if(n.has(r.promptId))continue;const l=l7e(r);if(l!==void 0&&wF(l)===s)return n.add(r.promptId),r}}}function Xx(e,t,n,i,o,s="",r){const l=[],a=new Map(t.map(b=>[b.attachmentId,b])),u=$A([e.startedAt,...e.steps.map(b=>b.startedAt),i])??"",c=xF(e.endedAt)??xF(o),d=e.triggerPromptId??e.turnId,h=e.origin.payload??e.origin,p=(e.attachmentIds??[]).length>0,m=r?.includeOrigin===!0&&Yc(h).length>0;if(e.prompt!==void 0&&e.prompt.length>0||p||m){const b=e.prompt!==void 0&&e.prompt.length>0?[{type:"text",text:e.prompt}]:[];for(const v of e.attachmentIds??[]){const C=SF(a.get(v));C!==void 0&&b.push(C)}l.push({id:`${e.turnId}:input`,sessionId:s,role:"user",content:b,createdAt:u,promptId:d,metadata:AF(r?.includeOrigin===!0||e.origin.kind==="task"&&(e.prompt??"").includes("0;if(v.role==="user"){if(v.taskId!==void 0){if(v.text.length===0&&!C)continue;const A=a7e(v.taskId,v.text,n.get(v.taskId));l.push({id:v.frameId,sessionId:"",role:"user",content:[{type:"text",text:v.text}],createdAt:b.startedAt??u,promptId:d,metadata:{origin:{kind:"task",taskId:v.taskId},[SU]:A}});continue}const w=v.text.length>0?[{type:"text",text:v.text}]:[];for(const A of v.attachmentIds??[]){const E=SF(a.get(A));E!==void 0&&w.push(E)}const M=v.promptIds?.map(A=>r?.promptById?.get(A)).find(A=>A!==void 0),N=[];for(const A of v.promptIds??[])N.push(...CF(r?.promptById?.get(A)?.content));const T=v.origin,S=Yc(T);if(v.text.length===0&&!C&&S.length===0)continue;const x={...S.length>0?{origin:T}:{},...(v.promptIds?.length??0)>0?{"kimiWeb.steeredPromptIds":v.promptIds}:{}};l.push({id:v.frameId,sessionId:s,role:"user",content:w,createdAt:M?.createdAt??b.startedAt??u,promptId:d,metadata:AF(Object.keys(x).length>0?x:void 0,N)});continue}if(v.text.length===0&&!C)continue;l.push({id:v.frameId,sessionId:"",role:"assistant",content:[{type:"text",text:v.text}],createdAt:b.startedAt??u,promptId:d})}else if(v.kind==="thinking"){if(v.text.length===0)continue;const C=r?.pendingInteractionAtByStepId?.get(b.stepId),w=FU(b,v,C!==void 0),M=r?.thinkingTiming,N=M?.get(v.frameId);let T,S;if(N!==void 0)N.settledAt===void 0&&!w&&(N.settledAt=new Date().toISOString()),T=N.startedAt,S=Cw(N.startedAt,N.settledAt);else if(M!==void 0&&w){const x=new Date().toISOString();M.set(v.frameId,{startedAt:x}),T=x}else T=b.startedAt,S=Cw(b.startedAt,$A([b.endedAt,C]));l.push({id:v.frameId,sessionId:"",role:"assistant",content:[{type:"thinking",thinking:v.text,startedAt:T,durationMs:S}],createdAt:b.startedAt??u,promptId:d})}else v.kind==="tool"&&(l.push({id:`${v.frameId}:call`,sessionId:"",role:"assistant",content:[{type:"toolUse",toolCallId:v.toolCallId,toolName:v.name,input:v.input??v.display??{},outputLines:v.state==="running"?Jx(v.output):void 0,agentRefs:v.agentRefs}],createdAt:b.startedAt??u,promptId:d}),v.state!=="running"&&l.push({id:`${v.frameId}:result`,sessionId:"",role:"tool",content:[{type:"toolResult",toolCallId:v.toolCallId,output:v.output??v.error??"",isError:v.state==="error"}],createdAt:b.endedAt??b.startedAt??u,promptId:d}));const g=e.durationMs??Cw(u||void 0,c),y=l.findLastIndex(b=>b.role==="assistant");return y>=0&&(g!==void 0||c!==void 0)&&(l[y]={...l[y],durationMs:g,endedAt:c??l[y].endedAt}),l}function a7e(e,t,n){const[i="",...o]=t.split(` -`),s=n?.state??"info";return{id:`task:${e}:${s}`,category:"task",type:`task.${s}`,sourceKind:n?.kind==="subagent"?"subagent":"background_task",sourceId:e,agentId:n?.agentId,title:i.trim(),severity:s==="completed"?"info":"warning",body:o.join(` -`).trim(),raw:t}}function u7e(e){if(e.createdAt!==""&&e.endedAt!=="")return e;const t={...e};return t.createdAt===""&&delete t.createdAt,t.endedAt===""&&delete t.endedAt,t}function $A(e){let t;for(const n of e){if(n===void 0)continue;const i=Date.parse(n);Number.isFinite(i)&&(t===void 0||i=0?n:void 0}const _F=6e3,BA=256*1024,c7e=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/;function IF(e,t){return t===0?e:e-1}function d7e(e,t){const n=cc(t),i=[];let o=0;for(const s of e){if(s.type==="hunk"){const r=c7e.exec(s.text);if(!r)return null;const l=IF(Number(r[1]),r[2]===void 0?1:Number(r[2])),a=IF(Number(r[3]),r[4]===void 0?1:Number(r[4]));if(an.length)return null;for(;o=n.length||n[o]!==s.text)return null;o++,s.type==="context"&&i.push(s.text)}for(;oBA||cc(n).length>_F)return null;const i=d7e(e,n);return i===null||i.length>BA||cc(i).length>_F?null:{before:i,after:n}}const h7e=new Set(["assistantDelta","agentDelta","toolOutput","taskProgress"]);function p7e(e){return h7e.has(e.type)}const m7e=50,g7e=100,zA=32*1024,v7e={requestFrame(e){return typeof requestAnimationFrame=="function"?requestAnimationFrame(e):null},cancelFrame(e){typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(e)},requestTask(e){return setTimeout(e,m7e)},cancelTask(e){clearTimeout(e)}};function y7e(e,t,n={}){const i=n.scheduler??v7e,o=Math.max(1,Math.floor(n.maxItemsPerSlice??g7e)),s=[];let r=0,l=null,a=null,u=0,c=!1;const d=()=>s.length-r,h=()=>{u+=1,l!==null&&(i.cancelFrame(l),l=null),a!==null&&(i.cancelTask(a),a=null)},p=()=>{r===s.length?(s.length=0,r=0):r>=1024&&(s.splice(0,r),r=0)};let m;const g=()=>{if(c||l!==null||a!==null||d()===0)return;const b=++u,v=()=>{b===u&&m()};l=i.requestFrame(v),a=i.requestTask(v)};m=()=>{h();let b=0;for(;!c&&b{if(!c){if(t(b)){const v=s.length>r?s.at(-1):void 0,C=v===void 0?void 0:n.coalesce?.(v,b);C===void 0?s.push(b):s[s.length-1]=C,g();return}if(d()===0){e(b);return}s.push(b),m()}});return y.flush=()=>{if(!c){for(h();!c&&r{if(c||d()===0)return;let v=r;for(let C=r;C{c||(c=!0,h(),s.length=0,r=0)},y}function jA(e){if(e.type==="assistantDelta"){if(e.delta.text!==void 0&&e.delta.thinking===void 0)return{kind:"text",value:e.delta.text};if(e.delta.thinking!==void 0&&e.delta.text===void 0)return{kind:"thinking",value:e.delta.thinking}}}function k7e(e){if(e.appEvent.type!=="assistantDelta")return[e];const t=e.appEvent,n=e.meta.stream,i=jA(t);if(n===void 0||i===void 0||n.kind!==i.kind||i.value.length<=zA)return[e];const o=[];let s=0;for(;ss&&/[\uD800-\uDBFF]/u.test(i.value[r-1])&&/[\uDC00-\uDFFF]/u.test(i.value[r])&&(r-=1);const l=i.value.slice(s,r);o.push({appEvent:{...t,delta:i.kind==="text"?{text:l}:{thinking:l}},meta:{...e.meta,stream:{...n,offset:n.offset+s}}}),s=r}return o}function b7e(e,t){if(e.appEvent.type!=="assistantDelta"||t.appEvent.type!=="assistantDelta")return;const n=e.meta.stream,i=t.meta.stream,o=jA(e.appEvent),s=jA(t.appEvent);if(n===void 0||i===void 0||o===void 0||s===void 0||e.meta.sessionId!==t.meta.sessionId||e.appEvent.sessionId!==t.appEvent.sessionId||e.appEvent.messageId!==t.appEvent.messageId||e.appEvent.contentIndex!==t.appEvent.contentIndex||n.turnId!==i.turnId||n.kind!==i.kind||o.kind!==s.kind||n.kind!==o.kind||i.kind!==s.kind||i.offset!==n.offset+o.value.length||o.value.length+s.value.length>zA)return;const r=o.value+s.value;return{appEvent:{...e.appEvent,delta:o.kind==="text"?{text:r}:{thinking:r}},meta:{...t.meta,stream:{...n}}}}function w7e(e,t){const i=e.items.filter(p=>p.kind==="turn")[0]?.turnId,o=new Map(e.tasks.map(p=>[p.taskId,p])),s=new Map(e.prompts.map(p=>[p.promptId,p])),r=OU(e.prompts,RU(e.items)),l=p=>p.kind==="turn"?p.origin.payload??p.origin:void 0,a=new Set,u=C7e(e.items),c=e.items.flatMap((p,m)=>{if(p.kind==="turn"){const g=u.turnPart.get(m)??p,y=g.startedAt!==void 0||g.steps.some(b=>b.startedAt!==void 0);return MF(g,e.attachments,o,p.turnId===i&&!y&&e.hasMoreOlder!==!0?t.agentCreatedAt:void 0,void 0,t.sessionId,t.pendingInteractionAtByStepId,t.thinkingTiming,s,r)}if(p.kind==="marker"&&p.marker==="compaction"){const g=A7e(p.payload,p.at,t.sessionId,p.markerId,S7e(e.items,m));if(g===void 0)return[];const y=u.continuation.get(p.markerId);return y===void 0?[g]:[g,...MF(y,e.attachments,o,void 0,void 0,t.sessionId,t.pendingInteractionAtByStepId,t.thinkingTiming,s,r,!0,`:${p.markerId}`)]}if(p.kind==="marker"&&p.marker==="cron.fired"){const g=p.payload,y=g?.origin?.jobId,b=typeof g?.prompt=="string"?g.prompt:void 0,v=e.items.slice(m+1).find(w=>{if(w.kind!=="turn"||a.has(w.turnId))return!1;const M=l(w);return M?.kind==="cron_job"&&(y===void 0||M.jobId===y)&&(b===void 0||w.kind==="turn"&&DU(w.prompt??"")===b)});if(v!==void 0&&v.kind==="turn")return a.add(v.turnId),[];const C=x7e(p.payload,p.at,t.sessionId,p.markerId);return C===void 0?[]:[C]}return[]}),d=e.interactions.map(p=>h1(p,t.sessionId)).filter(p=>p!==void 0),h=e.meta.activity==="turn";return z4(c,d,t.getFileUrl,h,t.planReviewByToolCallId??{},t.plansByToolCallId??{},{getSessionMediaUrl:t.getSessionMediaUrl}).map(M7e)}function C7e(e){const t=new Map,n=new Map;for(let i=0;i[]);let a=-1;for(const u of o.steps){for(;a+1=s[a+1].at;)a+=1;a<0?r.push(u):l[a].push(u)}if(r.length!==o.steps.length){t.set(i,{...o,steps:r,endedAt:r.at(-1)?.endedAt,durationMs:void 0});for(let u=0;ug.startedAt),i])??"",promptId:e.turnId,metadata:{origin:h}}]:[],...Xx(e,t,n,i,o,s,{includeOrigin:c!==!0,pendingInteractionAtByStepId:r,thinkingTiming:l,promptById:a,promptForTurn:u})]}function A7e(e,t,n,i,o){const s=e;if(s?.phase!=="completed")return;const r=s.result??{},l={trigger:o,tokensBefore:typeof r.tokensBefore=="number"?r.tokensBefore:void 0,tokensAfter:typeof r.tokensAfter=="number"?r.tokensAfter:void 0};return{id:i,sessionId:n,role:"assistant",content:typeof r.summary=="string"?[{type:"text",text:r.summary}]:[],createdAt:t??"",metadata:{origin:{kind:"compaction_summary"},[Bz]:l}}}function x7e(e,t,n,i){const o=e,s=o?.origin;if(!(s?.kind!=="cron_job"||typeof o?.prompt!="string"))return{id:i,sessionId:n,role:"user",content:[{type:"text",text:o.prompt}],createdAt:t??"",metadata:{origin:s}}}function S7e(e,t){for(let n=t-1;n>=0;n--){const i=e[n];if(i?.kind!=="marker"||i.marker!=="compaction")continue;const o=i.payload;if(o?.phase==="started")return o.trigger==="manual"?"manual":"auto"}return"auto"}function h1(e,t){if(e.interactionKind!=="approval"||e.state!=="pending")return;const n=e.request??{};if(typeof n.toolName!="string"||typeof n.action!="string")return;const i=typeof e.toolCallId=="string"?e.toolCallId:typeof n.toolCallId=="string"?n.toolCallId:void 0;if(i!==void 0)return{approvalId:e.interactionId,sessionId:t,turnId:typeof n.turnId=="number"?n.turnId:void 0,toolCallId:i,toolName:n.toolName,action:n.action,display:n.display,expiresAt:"",createdAt:""}}function Dg(e,t){if(e.interactionKind!=="question"||e.state!=="pending")return;const n=e.request??{};if(!Array.isArray(n.questions))return;const i=typeof e.toolCallId=="string"?e.toolCallId:typeof n.toolCallId=="string"?n.toolCallId:typeof n.tool_call_id=="string"?n.tool_call_id:void 0;return{questionId:e.interactionId,sessionId:t,turnId:typeof n.turnId=="number"?n.turnId:typeof n.turn_id=="number"?n.turn_id:void 0,toolCallId:i,questions:n.questions.map(_7e),createdAt:""}}function _7e(e){const t=Array.isArray(e.options)?e.options:[];return{id:typeof e.id=="string"?e.id:"",question:typeof e.question=="string"?e.question:"",header:typeof e.header=="string"?e.header:void 0,body:typeof e.body=="string"?e.body:void 0,options:t.map(I7e),multiSelect:e.multi_select===!0,allowOther:e.allow_other===!0,otherLabel:typeof e.other_label=="string"?e.other_label:void 0,otherDescription:typeof e.other_description=="string"?e.other_description:void 0}}function I7e(e){const t=e??{};return{id:typeof t.id=="string"?t.id:"",label:typeof t.label=="string"?t.label:"",description:typeof t.description=="string"?t.description:void 0,recommended:t.recommended===!0||t.is_recommended===!0}}function M7e(e){if(e.createdAt!==""&&e.endedAt!=="")return e;const t={...e};return t.createdAt===""&&delete t.createdAt,t.endedAt===""&&delete t.endedAt,t}function T7e(){let e=[];const t=(n,i)=>{const s=w7e(n,i).map((r,l)=>{const a=JSON.stringify(r),u=e[l],c=u!==void 0&&u.fingerprint===a?u.turn:r;return e[l]={turn:c,fingerprint:a},c});return e.length=s.length,s};return t.reset=()=>{e=[]},t}function E7e(e,t,n){const i=D7e(e),o=N7e(e),s=new Map(e.prompts.map(d=>[d.promptId,d])),r=n.filter(d=>{const h=d.metadata?.["kimiWeb.promptId"];if(h===void 0||o===void 0)return!0;const p=s.get(h)?.steeredAt;return p===void 0||p>=o}),l=e.prompts.filter(L7e).filter(d=>!i.has(d.promptId)).filter(d=>o===void 0||d.steeredAt>=o);if(l.length===0)return[...r];l.sort((d,h)=>d.steeredAtt)&&(t=n.startedAt);return t}function D7e(e){const t=new Set;for(const n of e.items)if(n.kind==="turn"){for(const i of n.steps)for(const o of i.frames)if(!(o.kind!=="text"||o.role!=="user"))for(const s of o.promptIds??[])t.add(s)}return t}function F7e(e){return Array.isArray(e)?e.map(t=>D4(t)).filter(t=>t.type!=="text"||t.text.length>0):[]}function R7e(e){return e.startsWith("diff --git")||e.startsWith("index ")||e.startsWith("--- ")||e.startsWith("+++ ")||e.startsWith("new file mode")||e.startsWith("deleted file mode")||e.startsWith("old mode")||e.startsWith("new mode")||e.startsWith("similarity index")||e.startsWith("dissimilarity index")||e.startsWith("rename from")||e.startsWith("rename to")||e.startsWith("copy from")||e.startsWith("copy to")||e.startsWith("Binary files")}function O7e(e){const t=[];if(!e)return t;let n=0,i=0,o=!1;for(const s of e.split(` -`)){if(s.startsWith("diff --git")){o=!1;continue}if(!o&&R7e(s))continue;if(s.startsWith("@@")){const a=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(s);a&&(n=Number.parseInt(a[1],10),i=Number.parseInt(a[2],10)),o=!0,t.push({type:"hunk",text:s});continue}if(!o||s.startsWith("\\"))continue;const r=s.charAt(0),l=s.slice(1);r==="+"?(t.push({type:"add",text:l,newNo:i}),i+=1):r==="-"?(t.push({type:"del",text:l,oldNo:n}),n+=1):r===" "&&(t.push({type:"context",text:l,oldNo:n,newNo:i}),n+=1,i+=1)}return t}function TF(e){return e?e.split(` -`).map(t=>t.trimEnd()).filter(Boolean).at(-1)??"":""}function P7e(e){return e.suspendedReason||TF(e.text)||TF(e.outputLines?.join(` -`))||e.summary||""}function $7e(e){return e.suspendedReason?e.suspendedReason:e.text?e.text:e.outputLines&&e.outputLines.length>0?e.outputLines.join(` -`):e.summary??""}function B7e(e){return e==="completed"?"completed":e==="failed"?"failed":e==="aborted"?"cancelled":"working"}function EF(e,t){return{id:e.agentId??e.item??`result-${t}`,agentId:e.agentId,name:e.item??`subagent ${t+1}`,activity:e.body.split(` -`)[0]??"",phase:B7e(e.outcome),body:e.body}}function z7e(e,t){return!!(t.agentId&&e.agentId===t.agentId||t.item&&e.name.includes(t.item))}function j7e(e,t){const n=e.map(o=>({id:o.id,agentId:o.agentId,name:o.name,activity:P7e(o),phase:o.phase,body:$7e(o)}));if(!t)return n;const i=t.subagents.filter(o=>(o.outcome==="aborted"||o.state==="not_started")&&!e.some(s=>z7e(s,o))).map((o,s)=>EF(o,s));return n.length>0?[...n,...i]:t.subagents.map((o,s)=>EF(o,s))}const H7e=["queued","working","suspended","completed","failed","cancelled"];function PU(e){return e.status==="completed"?"completed":e.status==="failed"?"failed":e.status==="cancelled"?"cancelled":e.subagentPhase?e.subagentPhase:"working"}function W7e(){return{queued:0,working:0,suspended:0,completed:0,failed:0,cancelled:0}}function q7e(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||n.swarmIndex===void 0)continue;const i=n.parentToolCallId??"swarm",o=t.get(i)??[];o.push({id:n.id,agentId:n.agentId,name:n.description,subagentType:n.subagentType,model:n.model,thinkingEffort:n.thinkingEffort,phase:PU(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex}),t.set(i,o)}return[...t.entries()].map(([n,i])=>{const o=i.toSorted((r,l)=>r.swarmIndex-l.swarmIndex||r.id.localeCompare(l.id)),s=W7e();for(const r of o)s[r.phase]++;return{id:n,members:o,counts:s}}).filter(n=>n.members.length>1).toSorted((n,i)=>{const o=n.members.at(0)?.swarmIndex??0,s=i.members.at(0)?.swarmIndex??0;return o!==s?o-s:n.id.localeCompare(i.id)})}function U7e(e){let t=0,n=0;for(const i of e){n+=i.members.length;for(const o of H7e)(o==="completed"||o==="failed"||o==="cancelled")&&(t+=i.counts[o])}return{done:t,total:n}}function V7e(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||!n.parentToolCallId)continue;const i=t.get(n.parentToolCallId)??[];i.push({id:n.id,agentId:n.agentId,name:n.description,subagentType:n.subagentType,model:n.model,thinkingEffort:n.thinkingEffort,phase:PU(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex??Number.MAX_SAFE_INTEGER}),t.set(n.parentToolCallId,i)}for(const[n,i]of t)t.set(n,i.toSorted((o,s)=>o.swarmIndex-s.swarmIndex||o.id.localeCompare(s.id)));return t}function eS(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 $U(e){for(const t of["path","file_path","filePath","filename"]){const n=e[t];if(typeof n=="string"&&n.length>0)return n}}const s0=100*1024;function BU(e){const t=cr(e.name);if(t!=="edit"&&t!=="multi_edit")return null;const n=eS(e.arg);if(!n)return null;if(t==="edit"){if(n.replace_all===!0)return null;const l=typeof n.old_string=="string"?n.old_string:void 0,a=typeof n.new_string=="string"?n.new_string:void 0;return l===void 0||a===void 0||l.length>s0||a.length>s0?null:ub(l,a)}const i=Array.isArray(n.edits)?n.edits:void 0;if(!i||i.length===0)return null;const o=[];let s=0,r=0;for(const l of i){if(!l||typeof l!="object")return null;const a=l;if(a.replace_all===!0)return null;const u=typeof a.old_string=="string"?a.old_string:void 0,c=typeof a.new_string=="string"?a.new_string:void 0;if(u===void 0||c===void 0||u.length>s0||c.length>s0)return null;const d=ub(u,c);if(d===null)return null;o.length>0&&o.push({type:"hunk",text:"···"});for(const h of d)o.push({...h,oldNo:h.oldNo!==void 0?h.oldNo+s:void 0,newNo:h.newNo!==void 0?h.newNo+r:void 0});s+=cc(u).length,r+=cc(c).length}return o}const K7e=5e3;function Z7e(e){if(cr(e.name)!=="write")return null;const t=eS(e.arg);return!t||typeof t.content!="string"||t.content.length>s0||t.content.split(` -`).length>K7e?null:{content:t.content,path:$U(t)}}function HA(e){const t=eS(e.arg);return t?$U(t):void 0}function G7e(e){switch(e){case"running":return"running";case"completed":return"completed";case"killed":return"cancelled";default:return"failed"}}function Q7e(e,t){return t==="running"?e.stateReason!==void 0?"suspended":"working":t}function Y7e(e){return e==="subagent"?"subagent":e==="shell"?"bash":"tool"}function J7e(e){return zU(e).parents}function zU(e){const t=new Map,n=new Map;for(const i of e.items)if(i.kind==="turn")for(const o of i.steps)for(const s of o.frames)s.kind!=="tool"||s.agentRefs===void 0||s.agentRefs.forEach((r,l)=>{t.set(r.agentId,s.toolCallId),n.set(r.agentId,l)});return{parents:t,swarmIndexes:n}}function X7e(e,t,n){const i=zU(e);let o=i.parents,s=i.swarmIndexes;if(n!==void 0){for(const[u,c]of i.parents)n.parents.set(u,c);for(const[u,c]of i.swarmIndexes)n.swarmIndexes.set(u,c);o=n.parents,s=n.swarmIndexes}const r=e.tasks.map(u=>{const c=G7e(u.state);return{id:u.taskId,agentId:u.agentId,sessionId:t,kind:Y7e(u.kind),description:u.description??"",status:c,createdAt:u.startedAt??"",startedAt:u.startedAt,completedAt:u.endedAt,outputPreview:u.outputTail.length>0?u.outputTail:void 0,text:u.resultSummary,subagentPhase:u.kind==="subagent"?Q7e(u,c):void 0,suspendedReason:c==="running"?u.stateReason:void 0,model:u.model,thinkingEffort:u.thinkingEffort,runInBackground:u.detached,parentToolCallId:u.agentId!==void 0?o.get(u.agentId):void 0,swarmIndex:u.agentId!==void 0?s.get(u.agentId):void 0}}),l=new Map;r.forEach((u,c)=>{u.agentId!==void 0&&u.id===u.agentId&&l.set(u.agentId,c)});const a=new Set;return r.forEach((u,c)=>{if(u.agentId===void 0||u.id===u.agentId)return;const d=l.get(u.agentId);if(d===void 0)return;const h=r[d],p=u.completedAt!==void 0&&h.startedAt!==void 0&&u.completedAt>=h.startedAt,m=h.status==="running"&&u.status!=="running"&&p;r[d]={...h,backgroundTaskId:u.status==="running"||p?u.id:void 0,status:m?u.status:h.status,subagentPhase:m?u.status==="completed"?"completed":u.status==="cancelled"?"cancelled":"failed":h.subagentPhase,description:h.description.length>0?h.description:u.description,model:h.model??u.model,thinkingEffort:h.thinkingEffort??u.thinkingEffort,completedAt:p?u.completedAt??h.completedAt:h.completedAt,outputPreview:p?h.outputPreview??u.outputPreview:h.outputPreview,text:p?h.text??u.text:h.text},a.add(c)}),r.filter((u,c)=>!a.has(c))}function exe(){let e=[],t=null,n=null,i=null,o,s,r=!0;const l=new WeakMap,a=u=>{const{messages:c,approvals:d}=u,h=u.sessionActive??!0,p=u.planReviewByToolCallId??{},m=u.plansByToolCallId??{},g=(S,x)=>l.set(S,x);let y=n!==null;if(y){const S=n,x=Object.keys(p);y=x.length===Object.keys(S).length&&x.every(A=>p[A]===S[A])}let b=i!==null;if(b){const S=i,x=Object.keys(m);b=x.length===Object.keys(S).length&&x.every(A=>m[A]===S[A])}const v=e.length>0&&d===t&&y&&b&&u.getFileUrl===o&&u.getSessionMediaUrl===s;let C=0,w=0,M=1;if(v){let S=-1;for(let x=e.length-1;x>=0;x--)if(e[x].role==="assistant"){S=x;break}for(let x=0;x0?[...e.slice(0,C),...N]:N;return e=T,t=d,n={...p},i={...m},o=u.getFileUrl,s=u.getSessionMediaUrl,r=h,T};return a.reset=()=>{e=[],t=null,n=null,i=null,o=void 0,r=!0},a}function txe(e){const t=new Map;let n=0;for(let i=e.length-1;i>=0;i--){const o=e[i];if(o.role==="compaction"||o.goalContinuation===!0)break;o.role==="user"&&o.hasUndoAnchor!==!1&&(n++,t.set(o.id,n))}return t}const jU=["light","dark","system"],nxe=["small","medium","large","xlarge"],Aw="medium",HU="kimi-web.color-scheme",WA="kimi-web.font-scale",LF="kimi-web.ui-font-size";function qA(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function tS(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function ixe(e){try{globalThis.localStorage.removeItem(e)}catch{}}function oxe(){const e=qA(HU);return e&&jU.includes(e)?e:"system"}const Oy={light:"#ffffff",dark:"#121212"};function sxe(e){if(typeof document>"u"||!document.documentElement)return;document.documentElement.dataset.colorScheme=e;const t=document.querySelectorAll('meta[name="theme-color"]');if(t.length===0)return;const n=e==="dark"?Oy.dark:e==="light"?Oy.light:null;t.forEach(i=>{const s=(i.getAttribute("media")??"").includes("dark")?Oy.dark:Oy.light;i.setAttribute("content",n??s)})}function WU(e){return nxe.includes(e)}function rxe(e){return e<=13?"small":e<=15?"medium":e<=17?"large":"xlarge"}function lxe(){const e=qA(WA);if(e==="xxlarge")return"xlarge";if(e!==null)return WU(e)?e:Aw;const t=qA(LF);if(t===null)return Aw;const n=Number(t),i=Number.isFinite(n)?rxe(n):Aw;return tS(WA,i),ixe(LF),i}function axe(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.fontScale=e)}const nS=q(oxe()),iS=q(lxe());let NF=!1;function uxe(){NF||(NF=!0,qe(nS,sxe,{immediate:!0}),qe(iS,axe,{immediate:!0}))}function cxe(e){jU.includes(e)&&(nS.value=e,tS(HU,e))}function dxe(e){WU(e)&&(iS.value=e,tS(WA,e))}function jm(){return uxe(),{colorScheme:nS,fontScale:iS,setColorScheme:cxe,setFontScale:dxe}}const Py=q(!1);let DF=!1;function xw(){const e=document.documentElement.dataset.colorScheme;return e==="dark"?!0:e==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function j4(){return!DF&&typeof window<"u"&&typeof document<"u"&&(DF=!0,Py.value=xw(),new MutationObserver(()=>{Py.value=xw()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{Py.value=xw()})),Py}const qU="kimi-web.sidebar-multi-tab";function fxe(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function hxe(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function pxe(){return fxe(qU)==="1"}const UU=q(pxe());function mxe(e){UU.value=e,hxe(qU,e?"1":"0")}function Hm(){return{sidebarTabs:UU,setSidebarTabs:mxe}}function q0(e){let t="";for(const n of e)n.codePointAt(0)>127||/[A-Za-z0-9\-._~]/.test(n)?t+=n:t+=`%${n.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0")}`;return t}function gxe(e){const t=e.split("/").map(q0).join("/");return t.startsWith("//")?`/%2F${t.slice(2)}`:t}function oS(e){return e.replace(/%/g,"%25").replace(/&/g,"%26").replace(//g,"%3E").replace(/([\\[\]])/g,"\\$1").replace(/\n/g,"%0A").replace(/\r/g,"%0D")}function FF(e){return e.replace(/\\([\\[\]])/g,"$1").replace(/%0A/g,` -`).replace(/%0D/g,"\r").replace(/%26/g,"&").replace(/%3C/g,"<").replace(/%3E/g,">").replace(/%25/g,"%")}function vxe(e){return e.replace(/%0A/g,` -`).replace(/%0D/g,"\r").replace(/%26/g,"&").replace(/%3C/g,"<").replace(/%3E/g,">").replace(/%25/g,"%")}function yxe(e,t){const n=t?e.replace(/\\([\\<>])/g,"$1"):e.replace(/\\([\\()])/g,"$1");return U0(n)}function U0(e){try{return decodeURIComponent(e)}catch{return e}}let RF;function UA(e){return RF??=new Intl.Segmenter("und",{granularity:"grapheme"}),[...RF.segment(e)].map(t=>t.segment)}function VU(e,t){const n=UA(e);return n.length<=t?e:`${n.slice(0,t-1).join("")}…`}const cb="kimi-code://skill/";function sS(e){return e?e.startsWith(cb)&&e.length>cb.length?"skill":e.startsWith("#")||e.startsWith("?")||e.startsWith("//")||/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(e)&&!/^[a-zA-Z]:(?:[\\/]|%5c)/i.test(e)?null:e.endsWith("/")||e.endsWith("\\")||/%5c$/i.test(e)?"folder":"file":null}function I1(e){const t=e.search(/[#?]/);return t>0?e.slice(0,t):e}function KU(e){const t=e.slice(cb.length);return U0(t)}function wp(e){const t=oS(e.name);if(e.kind==="skill")return`[${t}](${cb}${q0(e.name)})`;const n=e.kind==="folder"&&!e.path.endsWith("/")&&!e.path.endsWith("\\")?`${e.path}/`:e.path;return`[${t}](${gxe(n)})`}const N9="kimi-code-composer://attachments/";function Cf(e){return`[${oS(e.name)}](${N9}${e.attId})`}const Lh="kimi-code-composer://quote/",kxe=24;function mm(e){const t=e.split(` -`).map(i=>i.trim()).find(i=>i.length>0)??"",n=VU(t,kxe);return n.length>0?n:"…"}function H4(e){const t=e.source!==void 0&&e.source.length>0?`?source=${q0(e.source)}`:"",n=e.comment!==void 0&&e.comment.length>0?`?comment=${q0(e.comment)}`:"";return`[${oS(mm(e.text))}](${Lh}${q0(e.text)}${t}${n})`}function ZU(e){const t=e.indexOf("?source="),n=e.indexOf("?comment="),i=[t,n].filter(s=>s>=0).sort((s,r)=>s-r)[0]??-1,o={text:U0(i===-1?e:e.slice(0,i))};if(t>=0){const s=n>t?n:e.length;o.source=U0(e.slice(t+8,s))}if(n>=0){const s=t>n?t:e.length;o.comment=U0(e.slice(n+9,s))}return o}const OF=document.createElement("i");function bxe(e){const t="&"+e+";";OF.innerHTML=t;const n=OF.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function dc(e,t,n,i){const o=e.length;let s=0,r;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,n=n>0?n:0,i.length<1e4)r=Array.from(i),r.unshift(t,n),e.splice(...r);else for(n&&e.splice(t,n);s0?(dc(e,e.length,0,t),e):t}const PF={}.hasOwnProperty;function wxe(e){const t={};let n=-1;for(;++n-1&&e.test(String.fromCharCode(n))}}function So(e,t,n,i){const o=i?i-1:Number.POSITIVE_INFINITY;let s=0;return r;function r(a){return Bi(a)?(e.enter(n),l(a)):t(a)}function l(a){return Bi(a)&&s++r))return;const T=t.events.length;let S=T,x,A;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){if(x){A=t.events[S][1].end;break}x=!0}for(b(i),N=T;NC;){const M=n[w];t.containerState=M[1],M[0].exit.call(t,e)}n.length=C}function v(){o.write([null]),s=void 0,o=void 0,t.containerState._closeFlow=void 0}}function Dxe(e,t,n){return So(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function BF(e){if(e===null||Gl(e)||Mxe(e))return 1;if(Ixe(e))return 2}function lS(e,t,n){const i=[];let o=-1;for(;++o1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[i][1].end},h={...e[n][1].start};zF(d,-a),zF(h,a),r={type:a>1?"strongSequence":"emphasisSequence",start:d,end:{...e[i][1].end}},l={type:a>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},s={type:a>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},o={type:a>1?"strong":"emphasis",start:{...r.start},end:{...l.end}},e[i][1].end={...r.start},e[n][1].start={...l.end},u=[],e[i][1].end.offset-e[i][1].start.offset&&(u=Ra(u,[["enter",e[i][1],t],["exit",e[i][1],t]])),u=Ra(u,[["enter",o,t],["enter",r,t],["exit",r,t],["enter",s,t]]),u=Ra(u,lS(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),u=Ra(u,[["exit",s,t],["enter",l,t],["exit",l,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,u=Ra(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,dc(e,i-1,n-i+3,u),n=i+u.length-c-2;break}}for(n=-1;++n0&&Bi(N)?So(e,v,"linePrefix",s+1)(N):v(N)}function v(N){return N===null||Zn(N)?e.check(jF,g,w)(N):(e.enter("codeFlowValue"),C(N))}function C(N){return N===null||Zn(N)?(e.exit("codeFlowValue"),v(N)):(e.consume(N),C)}function w(N){return e.exit("codeFenced"),t(N)}function M(N,T,S){let x=0;return A;function A(z){return N.enter("lineEnding"),N.consume(z),N.exit("lineEnding"),E}function E(z){return N.enter("codeFencedFence"),Bi(z)?So(N,I,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):I(z)}function I(z){return z===l?(N.enter("codeFencedFenceSequence"),R(z)):S(z)}function R(z){return z===l?(x++,N.consume(z),R):x>=r?(N.exit("codeFencedFenceSequence"),Bi(z)?So(N,W,"whitespace")(z):W(z)):S(z)}function W(z){return z===null||Zn(z)?(N.exit("codeFencedFence"),T(z)):S(z)}}}function Uxe(e,t,n){const i=this;return o;function o(r){return r===null?n(r):(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),s)}function s(r){return i.parser.lazy[i.now().line]?n(r):t(r)}}const Sw={name:"codeIndented",tokenize:Kxe},Vxe={partial:!0,tokenize:Zxe};function Kxe(e,t,n){const i=this;return o;function o(u){return e.enter("codeIndented"),So(e,s,"linePrefix",5)(u)}function s(u){const c=i.events[i.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?r(u):n(u)}function r(u){return u===null?a(u):Zn(u)?e.attempt(Vxe,r,a)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||Zn(u)?(e.exit("codeFlowValue"),r(u)):(e.consume(u),l)}function a(u){return e.exit("codeIndented"),t(u)}}function Zxe(e,t,n){const i=this;return o;function o(r){return i.parser.lazy[i.now().line]?n(r):Zn(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),o):So(e,s,"linePrefix",5)(r)}function s(r){const l=i.events[i.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(r):Zn(r)?o(r):n(r)}}const Gxe={name:"codeText",previous:Yxe,resolve:Qxe,tokenize:Jxe};function Qxe(e){let t=e.length-4,n=3,i,o;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=n;++i=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,n,i){const o=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return i&&Fg(this.left,i),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Fg(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Fg(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(r):e.interrupt(i.parser.constructs.flow,n,t)(r)}}function XU(e,t,n,i,o,s,r,l,a){const u=a||Number.POSITIVE_INFINITY;let c=0;return d;function d(b){return b===60?(e.enter(i),e.enter(o),e.enter(s),e.consume(b),e.exit(s),h):b===null||b===32||b===41||VA(b)?n(b):(e.enter(i),e.enter(r),e.enter(l),e.enter("chunkString",{contentType:"string"}),g(b))}function h(b){return b===62?(e.enter(s),e.consume(b),e.exit(s),e.exit(o),e.exit(i),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),p(b))}function p(b){return b===62?(e.exit("chunkString"),e.exit(l),h(b)):b===null||b===60||Zn(b)?n(b):(e.consume(b),b===92?m:p)}function m(b){return b===60||b===62||b===92?(e.consume(b),p):p(b)}function g(b){return!c&&(b===null||b===41||Gl(b))?(e.exit("chunkString"),e.exit(l),e.exit(r),e.exit(i),t(b)):c999||p===null||p===91||p===93&&!a||p===94&&!l&&"_hiddenFootnoteSupport"in r.parser.constructs?n(p):p===93?(e.exit(s),e.enter(o),e.consume(p),e.exit(o),e.exit(i),t):Zn(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===null||p===91||p===93||Zn(p)||l++>999?(e.exit("chunkString"),c(p)):(e.consume(p),a||(a=!Bi(p)),p===92?h:d)}function h(p){return p===91||p===92||p===93?(e.consume(p),l++,d):d(p)}}function tV(e,t,n,i,o,s){let r;return l;function l(h){return h===34||h===39||h===40?(e.enter(i),e.enter(o),e.consume(h),e.exit(o),r=h===40?41:h,a):n(h)}function a(h){return h===r?(e.enter(o),e.consume(h),e.exit(o),e.exit(i),t):(e.enter(s),u(h))}function u(h){return h===r?(e.exit(s),a(r)):h===null?n(h):Zn(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),So(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(h))}function c(h){return h===r||h===null||Zn(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?d:c)}function d(h){return h===r||h===92?(e.consume(h),c):c(h)}}function V0(e,t){let n;return i;function i(o){return Zn(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,i):Bi(o)?So(e,i,n?"linePrefix":"lineSuffix")(o):t(o)}}const rSe={name:"definition",tokenize:aSe},lSe={partial:!0,tokenize:uSe};function aSe(e,t,n){const i=this;let o;return s;function s(p){return e.enter("definition"),r(p)}function r(p){return eV.call(i,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function l(p){return o=rS(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),a):n(p)}function a(p){return Gl(p)?V0(e,u)(p):u(p)}function u(p){return XU(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function c(p){return e.attempt(lSe,d,d)(p)}function d(p){return Bi(p)?So(e,h,"whitespace")(p):h(p)}function h(p){return p===null||Zn(p)?(e.exit("definition"),i.parser.defined.push(o),t(p)):n(p)}}function uSe(e,t,n){return i;function i(l){return Gl(l)?V0(e,o)(l):n(l)}function o(l){return tV(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function s(l){return Bi(l)?So(e,r,"whitespace")(l):r(l)}function r(l){return l===null||Zn(l)?t(l):n(l)}}const cSe={name:"hardBreakEscape",tokenize:dSe};function dSe(e,t,n){return i;function i(s){return e.enter("hardBreakEscape"),e.consume(s),o}function o(s){return Zn(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const fSe={name:"headingAtx",resolve:hSe,tokenize:pSe};function hSe(e,t){let n=e.length-2,i=3,o,s;return e[i][1].type==="whitespace"&&(i+=2),n-2>i&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&e[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(o={type:"atxHeadingText",start:e[i][1].start,end:e[n][1].end},s={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},dc(e,i,n-i+1,[["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t]])),e}function pSe(e,t,n){let i=0;return o;function o(c){return e.enter("atxHeading"),s(c)}function s(c){return e.enter("atxHeadingSequence"),r(c)}function r(c){return c===35&&i++<6?(e.consume(c),r):c===null||Gl(c)?(e.exit("atxHeadingSequence"),l(c)):n(c)}function l(c){return c===35?(e.enter("atxHeadingSequence"),a(c)):c===null||Zn(c)?(e.exit("atxHeading"),t(c)):Bi(c)?So(e,l,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function a(c){return c===35?(e.consume(c),a):(e.exit("atxHeadingSequence"),l(c))}function u(c){return c===null||c===35||Gl(c)?(e.exit("atxHeadingText"),l(c)):(e.consume(c),u)}}const mSe=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],WF=["pre","script","style","textarea"],gSe={concrete:!0,name:"htmlFlow",resolveTo:kSe,tokenize:bSe},vSe={partial:!0,tokenize:CSe},ySe={partial:!0,tokenize:wSe};function kSe(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function bSe(e,t,n){const i=this;let o,s,r,l,a;return u;function u(K){return c(K)}function c(K){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(K),d}function d(K){return K===33?(e.consume(K),h):K===47?(e.consume(K),s=!0,g):K===63?(e.consume(K),o=3,i.interrupt?t:$):Gu(K)?(e.consume(K),r=String.fromCharCode(K),y):n(K)}function h(K){return K===45?(e.consume(K),o=2,p):K===91?(e.consume(K),o=5,l=0,m):Gu(K)?(e.consume(K),o=4,i.interrupt?t:$):n(K)}function p(K){return K===45?(e.consume(K),i.interrupt?t:$):n(K)}function m(K){const ee="CDATA[";return K===ee.charCodeAt(l++)?(e.consume(K),l===ee.length?i.interrupt?t:I:m):n(K)}function g(K){return Gu(K)?(e.consume(K),r=String.fromCharCode(K),y):n(K)}function y(K){if(K===null||K===47||K===62||Gl(K)){const ee=K===47,ue=r.toLowerCase();return!ee&&!s&&WF.includes(ue)?(o=1,i.interrupt?t(K):I(K)):mSe.includes(r.toLowerCase())?(o=6,ee?(e.consume(K),b):i.interrupt?t(K):I(K)):(o=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(K):s?v(K):C(K))}return K===45||gu(K)?(e.consume(K),r+=String.fromCharCode(K),y):n(K)}function b(K){return K===62?(e.consume(K),i.interrupt?t:I):n(K)}function v(K){return Bi(K)?(e.consume(K),v):A(K)}function C(K){return K===47?(e.consume(K),A):K===58||K===95||Gu(K)?(e.consume(K),w):Bi(K)?(e.consume(K),C):A(K)}function w(K){return K===45||K===46||K===58||K===95||gu(K)?(e.consume(K),w):M(K)}function M(K){return K===61?(e.consume(K),N):Bi(K)?(e.consume(K),M):C(K)}function N(K){return K===null||K===60||K===61||K===62||K===96?n(K):K===34||K===39?(e.consume(K),a=K,T):Bi(K)?(e.consume(K),N):S(K)}function T(K){return K===a?(e.consume(K),a=null,x):K===null||Zn(K)?n(K):(e.consume(K),T)}function S(K){return K===null||K===34||K===39||K===47||K===60||K===61||K===62||K===96||Gl(K)?M(K):(e.consume(K),S)}function x(K){return K===47||K===62||Bi(K)?C(K):n(K)}function A(K){return K===62?(e.consume(K),E):n(K)}function E(K){return K===null||Zn(K)?I(K):Bi(K)?(e.consume(K),E):n(K)}function I(K){return K===45&&o===2?(e.consume(K),F):K===60&&o===1?(e.consume(K),O):K===62&&o===4?(e.consume(K),V):K===63&&o===3?(e.consume(K),$):K===93&&o===5?(e.consume(K),j):Zn(K)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(vSe,ne,R)(K)):K===null||Zn(K)?(e.exit("htmlFlowData"),R(K)):(e.consume(K),I)}function R(K){return e.check(ySe,W,ne)(K)}function W(K){return e.enter("lineEnding"),e.consume(K),e.exit("lineEnding"),z}function z(K){return K===null||Zn(K)?R(K):(e.enter("htmlFlowData"),I(K))}function F(K){return K===45?(e.consume(K),$):I(K)}function O(K){return K===47?(e.consume(K),r="",B):I(K)}function B(K){if(K===62){const ee=r.toLowerCase();return WF.includes(ee)?(e.consume(K),V):I(K)}return Gu(K)&&r.length<8?(e.consume(K),r+=String.fromCharCode(K),B):I(K)}function j(K){return K===93?(e.consume(K),$):I(K)}function $(K){return K===62?(e.consume(K),V):K===45&&o===2?(e.consume(K),$):I(K)}function V(K){return K===null||Zn(K)?(e.exit("htmlFlowData"),ne(K)):(e.consume(K),V)}function ne(K){return e.exit("htmlFlow"),t(K)}}function wSe(e,t,n){const i=this;return o;function o(r){return Zn(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),s):n(r)}function s(r){return i.parser.lazy[i.now().line]?n(r):t(r)}}function CSe(e,t,n){return i;function i(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(W4,t,n)}}const ASe={name:"htmlText",tokenize:xSe};function xSe(e,t,n){const i=this;let o,s,r;return l;function l($){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume($),a}function a($){return $===33?(e.consume($),u):$===47?(e.consume($),M):$===63?(e.consume($),C):Gu($)?(e.consume($),S):n($)}function u($){return $===45?(e.consume($),c):$===91?(e.consume($),s=0,m):Gu($)?(e.consume($),v):n($)}function c($){return $===45?(e.consume($),p):n($)}function d($){return $===null?n($):$===45?(e.consume($),h):Zn($)?(r=d,O($)):(e.consume($),d)}function h($){return $===45?(e.consume($),p):d($)}function p($){return $===62?F($):$===45?h($):d($)}function m($){const V="CDATA[";return $===V.charCodeAt(s++)?(e.consume($),s===V.length?g:m):n($)}function g($){return $===null?n($):$===93?(e.consume($),y):Zn($)?(r=g,O($)):(e.consume($),g)}function y($){return $===93?(e.consume($),b):g($)}function b($){return $===62?F($):$===93?(e.consume($),b):g($)}function v($){return $===null||$===62?F($):Zn($)?(r=v,O($)):(e.consume($),v)}function C($){return $===null?n($):$===63?(e.consume($),w):Zn($)?(r=C,O($)):(e.consume($),C)}function w($){return $===62?F($):C($)}function M($){return Gu($)?(e.consume($),N):n($)}function N($){return $===45||gu($)?(e.consume($),N):T($)}function T($){return Zn($)?(r=T,O($)):Bi($)?(e.consume($),T):F($)}function S($){return $===45||gu($)?(e.consume($),S):$===47||$===62||Gl($)?x($):n($)}function x($){return $===47?(e.consume($),F):$===58||$===95||Gu($)?(e.consume($),A):Zn($)?(r=x,O($)):Bi($)?(e.consume($),x):F($)}function A($){return $===45||$===46||$===58||$===95||gu($)?(e.consume($),A):E($)}function E($){return $===61?(e.consume($),I):Zn($)?(r=E,O($)):Bi($)?(e.consume($),E):x($)}function I($){return $===null||$===60||$===61||$===62||$===96?n($):$===34||$===39?(e.consume($),o=$,R):Zn($)?(r=I,O($)):Bi($)?(e.consume($),I):(e.consume($),W)}function R($){return $===o?(e.consume($),o=void 0,z):$===null?n($):Zn($)?(r=R,O($)):(e.consume($),R)}function W($){return $===null||$===34||$===39||$===60||$===61||$===96?n($):$===47||$===62||Gl($)?x($):(e.consume($),W)}function z($){return $===47||$===62||Gl($)?x($):n($)}function F($){return $===62?(e.consume($),e.exit("htmlTextData"),e.exit("htmlText"),t):n($)}function O($){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume($),e.exit("lineEnding"),B}function B($){return Bi($)?So(e,j,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):j($)}function j($){return e.enter("htmlTextData"),r($)}}const aS={name:"labelEnd",resolveAll:MSe,resolveTo:TSe,tokenize:ESe},SSe={tokenize:LSe},_Se={tokenize:NSe},ISe={tokenize:DSe};function MSe(e){let t=-1;const n=[];for(;++t=3&&(u===null||Zn(u))?(e.exit("thematicBreak"),t(u)):n(u)}function a(u){return u===o?(e.consume(u),i++,a):(e.exit("thematicBreakSequence"),Bi(u)?So(e,l,"whitespace")(u):l(u))}}const Dl={continuation:{tokenize:WSe},exit:USe,name:"list",tokenize:HSe},zSe={partial:!0,tokenize:VSe},jSe={partial:!0,tokenize:qSe};function HSe(e,t,n){const i=this,o=i.events[i.events.length-1];let s=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,r=0;return l;function l(p){const m=i.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!i.containerState.marker||p===i.containerState.marker:KA(p)){if(i.containerState.type||(i.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(D9,n,u)(p):u(p);if(!i.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),a(p)}return n(p)}function a(p){return KA(p)&&++r<10?(e.consume(p),a):(!i.interrupt||r<2)&&(i.containerState.marker?p===i.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),u(p)):n(p)}function u(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||p,e.check(W4,i.interrupt?n:c,e.attempt(zSe,h,d))}function c(p){return i.containerState.initialBlankLine=!0,s++,h(p)}function d(p){return Bi(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return i.containerState.size=s+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function WSe(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(W4,o,s);function o(l){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,So(e,t,"listItemIndent",i.containerState.size+1)(l)}function s(l){return i.containerState.furtherBlankLines||!Bi(l)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,r(l)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(jSe,t,r)(l))}function r(l){return i.containerState._closeFlow=!0,i.interrupt=void 0,So(e,e.attempt(Dl,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function qSe(e,t,n){const i=this;return So(e,o,"listItemIndent",i.containerState.size+1);function o(s){const r=i.events[i.events.length-1];return r&&r[1].type==="listItemIndent"&&r[2].sliceSerialize(r[1],!0).length===i.containerState.size?t(s):n(s)}}function USe(e){e.exit(this.containerState.type)}function VSe(e,t,n){const i=this;return So(e,o,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(s){const r=i.events[i.events.length-1];return!Bi(s)&&r&&r[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const qF={name:"setextUnderline",resolveTo:KSe,tokenize:ZSe};function KSe(e,t){let n=e.length,i,o,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){i=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const r={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",s?(e.splice(o,0,["enter",r,t]),e.splice(s+1,0,["exit",e[i][1],t]),e[i][1].end={...e[s][1].end}):e[i][1]=r,e.push(["exit",r,t]),e}function ZSe(e,t,n){const i=this;let o;return s;function s(u){let c=i.events.length,d;for(;c--;)if(i.events[c][1].type!=="lineEnding"&&i.events[c][1].type!=="linePrefix"&&i.events[c][1].type!=="content"){d=i.events[c][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||d)?(e.enter("setextHeadingLine"),o=u,r(u)):n(u)}function r(u){return e.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===o?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),Bi(u)?So(e,a,"lineSuffix")(u):a(u))}function a(u){return u===null||Zn(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const GSe={tokenize:QSe};function QSe(e){const t=this,n=e.attempt(W4,i,e.attempt(this.parser.constructs.flowInitial,o,So(e,e.attempt(this.parser.constructs.flow,o,e.attempt(tSe,o)),"linePrefix")));return n;function i(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const YSe={resolveAll:iV()},JSe=nV("string"),XSe=nV("text");function nV(e){return{resolveAll:iV(e==="text"?e_e:void 0),tokenize:t};function t(n){const i=this,o=this.parser.constructs[e],s=n.attempt(o,r,l);return r;function r(c){return u(c)?s(c):l(c)}function l(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),a}function a(c){return u(c)?(n.exit("data"),s(c)):(n.consume(c),a)}function u(c){if(c===null)return!0;const d=o[c];let h=-1;if(d)for(;++h-1){const l=r[0];typeof l=="string"?r[0]=l.slice(i):r.shift()}s>0&&r.push(e[o].slice(0,s))}return r}function h_e(e,t){let n=-1;const i=[];let o;for(;++n0;if(s||e[c]!==(p?"!":"[")||r===null)continue;const m=e.slice(c+(p?2:1),d-1);let g=e.slice(r.start,r.end),y=!1;g.startsWith("<")&&(y=!0,g=g.slice(1,-1)),!(!m||!g)&&n.push({start:c,end:h,rawText:m,rawDest:g,angle:y,image:p})}return n}function y_e(e,t){const{start:n,end:i,rawText:o,rawDest:s,angle:r,image:l}=e;if(l&&!s.startsWith(Lh))return null;if(s.startsWith(N9)&&s.length>N9.length){const u=FF(o),c=s.slice(N9.length);return{type:"attachment",start:n,end:i,attrs:{attId:c,name:u,kind:t?.(c)??(u.endsWith("/")?"folder":"file")},rawDest:s}}if(s.startsWith(Lh)&&s.length>Lh.length)return{type:"quote",start:n,end:i,attrs:ZU(s.slice(Lh.length)),rawDest:s};const a=sS(s);return a===null?null:a==="skill"?{type:"mention",start:n,end:i,attrs:{kind:a,name:KU(s),path:""},rawDest:s}:{type:"mention",start:n,end:i,attrs:{kind:a,name:FF(o),path:yxe(s,r)},rawDest:s}}const VF=/\[(?:\\.|[^\\[\]\n])*\]\((kimi-code-composer:\/\/quote\/[^\s)]+)\)/g;function k_e(e){const t=[];VF.lastIndex=0;let n;for(;(n=VF.exec(e))!==null;){let i=0;for(let s=n.index-1;s>=0&&e[s]==="\\";s-=1)i+=1;if(i%2===0)continue;const o=n[1];o===void 0||o.length<=Lh.length||t.push({type:"quote",start:n.index-1,end:n.index+n[0].length,attrs:ZU(o.slice(Lh.length)),rawDest:o})}return t}function q4(e,t){const n=[];for(const i of oV(e)){const o=y_e(i,t);o&&n.push(o)}return n.push(...k_e(e)),n.sort((i,o)=>i.start-o.start),n}function Af(e){return q4(e).filter(t=>t.type==="mention").map(({start:t,end:n,attrs:i,rawDest:o})=>({start:t,end:n,attrs:i,rawDest:o}))}function Bl(e){return q4(e).filter(t=>t.type==="attachment").map(({start:t,end:n,attrs:i,rawDest:o})=>({start:t,end:n,attrs:i,rawDest:o}))}function sV(e){return q4(e).filter(t=>t.type==="quote").map(({start:t,end:n,attrs:i,rawDest:o})=>({start:t,end:n,attrs:i,rawDest:o}))}function rV(e,t){const n=q4(e,t);if(n.length===0)return[{type:"text",value:e}];const i=[];let o=0;for(const s of n)s.start>o&&i.push({type:"text",value:e.slice(o,s.start)}),s.type==="mention"?i.push({type:"mention",attrs:s.attrs,rawDest:s.rawDest}):s.type==="attachment"?i.push({type:"attachment",attrs:s.attrs,rawDest:s.rawDest}):i.push({type:"quote",attrs:s.attrs,rawDest:s.rawDest}),o=s.end;return o[a,u+1])),s=new Map(t.mediaAttIds.map((a,u)=>[a,u+1]));let r="",l=0;for(const a of i){r+=e.slice(l,a.start),l=a.end;const{attId:u,name:c,kind:d}=a.attrs,h=d==="folder"?n?.resolveFolder?.(u):void 0;if(h!==void 0){const y=h==="/"||/^[a-zA-Z]:\/$/.test(h)?h.slice(0,-1)||"/":c.endsWith("/")?c.slice(0,-1):c;r+=wp({kind:"folder",name:y,path:h});continue}const p=o.get(u);if(p!==void 0){r+=Cf({attId:String(p),name:c});continue}const m=s.get(u);if(m!==void 0){r+=Cf({attId:`m${m}`,name:c});continue}r+=c}return r+=e.slice(l),r}function KF(e,t,n=0){if(t<=0&&n<=0)return e;const i=Bl(e);if(i.length===0)return e;let o="",s=0;for(const r of i){const{attId:l,name:a,kind:u}=r.attrs;let c;t>0&&/^[1-9]\d*$/.test(l)?c=String(Number(l)+t):n>0&&/^m[1-9]\d*$/.test(l)&&(c=`m${Number(l.slice(1))+n}`),c!==void 0&&(o+=e.slice(s,r.start),s=r.end,o+=Cf({attId:c,name:a}))}return o+=e.slice(s),o}function Ud(e,t){const n=Bl(e);if(n.length===0)return e;let i="",o=0;for(const s of n)i+=e.slice(o,s.start)+(t?.(s.attrs.name)??s.attrs.name),o=s.end;return i+=e.slice(o),i}function ZF(e,t){const n=Bl(e);if(n.length===0)return e;let i="",o=0;for(const s of n)t.has(s.attrs.attId)||(i+=e.slice(o,s.start)+s.attrs.name,o=s.end);return i+=e.slice(o),i}function GA(e){const t=Bl(e);if(t.length===0)return e;let n="",i=0;for(const o of t)n+=e.slice(i,o.start),i=o.end;return n+=e.slice(i),n}let w_e=!1;function uS(e){return e.replaceAll("%","%25").replaceAll(` -`,"%0A").replaceAll("\r","%0D")}function cS(e){const t=[];for(const i of e.split(/(\n{2,})/))if(i!==""){if(/^\n{2,}$/.test(i)){t.push({type:"sep",text:i});continue}t.push({type:"inline",text:i})}const n=[];for(let i=0;i`> ${t}`).join(` -`)}function aV(e){const t=cS(e),n=new Set;return t.forEach((i,o)=>{i.type==="sep"&&i.text===` - -`&&t[o-1]?.type==="quote"&&t[o+1]?.type==="quote"&&n.add(o)}),t.map((i,o)=>{if(n.has(o))return" ";if(i.type!=="quote")return i.text;const s={text:i.text};return i.source!==void 0&&(s.source=i.source),i.comment!==void 0&&(s.comment=i.comment),H4(s)}).join("")}function Dr(e){this.content=e}Dr.prototype={constructor:Dr,find:function(e){for(var t=0;t>1}};Dr.from=function(e){if(e instanceof Dr)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Dr(t)};function uV(e,t,n){for(let i=0;;i++){if(i==e.childCount||i==t.childCount)return e.childCount==t.childCount?null:n;let o=e.child(i),s=t.child(i);if(o==s){n+=o.nodeSize;continue}if(!o.sameMarkup(s))return n;if(o.isText&&o.text!=s.text){let r=o.text,l=s.text,a=0;for(;r[a]==l[a];a++)n++;return a&&a0&&h>0&&u[d-1]==c[h-1];)d--,h--,n--,i--;return d&&h&&d=56320&&e<57344}function fV(e){return e>=55296&&e<56320}class dn{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let i=0;it&&i(a,o+l,s||null,r)!==!1&&a.content.size){let c=l+1;a.nodesBetween(Math.max(0,t-c),Math.min(a.content.size,n-c),i,o+c)}l=u}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,i,o){let s="",r=!0;return this.nodesBetween(t,n,(l,a)=>{let u=l.isText?l.text.slice(Math.max(t,a)-a,n-a):l.isLeaf?o?typeof o=="function"?o(l):o:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&u||l.isTextblock)&&i&&(r?r=!1:s+=i),s+=u},0),s}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,i=t.firstChild,o=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(i)&&(o[o.length-1]=n.withText(n.text+i.text),s=1);st)for(let s=0,r=0;rt&&((rn)&&(l.isText?l=l.cut(Math.max(0,t-r),Math.min(l.text.length,n-r)):l=l.cut(Math.max(0,t-r-1),Math.min(l.content.size,n-r-1))),i.push(l),o+=l.nodeSize),r=a}return new dn(i,o)}cutByIndex(t,n){return t==n?dn.empty:t==0&&n==this.content.length?this:new dn(this.content.slice(t,n))}replaceChild(t,n){let i=this.content[t];if(i==n)return this;let o=this.content.slice(),s=this.size+n.nodeSize-i.nodeSize;return o[t]=n,new dn(o,s)}addToStart(t){return new dn([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new dn(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;nthis.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,i=0;;n++){let o=this.child(n),s=i+o.nodeSize;if(s>=t)return s==t?$y(n+1,s):$y(n,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return dn.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return dn.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return dn.empty;let n,i=0;for(let o=0;othis.type.rank&&(n||(n=t.slice(0,o)),n.push(this),i=!0),n&&n.push(s)}}return n||(n=t.slice()),i||n.push(this),n}removeFromSet(t){for(let n=0;ni.type.rank-o.type.rank),n}}Vi.none=[];class Lv extends Error{}class Cn{constructor(t,n,i){this.content=t,this.openStart=n,this.openEnd=i}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let i=pV(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return i&&new Cn(i,this.openStart,this.openEnd)}removeBetween(t,n){return new Cn(hV(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return Cn.empty;let i=n.openStart||0,o=n.openEnd||0;if(typeof i!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Cn(dn.fromJSON(t,n.content),i,o)}static maxOpen(t,n=!0){let i=0,o=0;for(let s=t.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)i++;for(let s=t.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)o++;return new Cn(t,i,o)}}Cn.empty=new Cn(dn.empty,0,0);function hV(e,t,n){let{index:i,offset:o}=e.findIndex(t),s=e.maybeChild(i),{index:r,offset:l}=e.findIndex(n);if(o==t||s.isText){if(l!=n&&!e.child(r).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(i!=r)throw new RangeError("Removing non-flat range");return e.replaceChild(i,s.copy(hV(s.content,t-o-1,n-o-1)))}function pV(e,t,n,i,o,s){let{index:r,offset:l}=e.findIndex(t),a=e.maybeChild(r);if(l==t||a.isText)return s&&i<=0&&o<=0&&!s.canReplace(r,r,n)?null:e.cut(0,t).append(n).append(e.cut(t));let u=pV(a.content,t-l-1,n,r==0?i-1:0,r==e.childCount-1?o-1:0,a);return u&&e.replaceChild(r,a.copy(u))}function A_e(e,t,n){if(n.openStart>e.depth)throw new Lv("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Lv("Inconsistent open depths");return mV(e,t,n,0)}function mV(e,t,n,i){let o=e.index(i),s=e.node(i);if(o==t.index(i)&&i=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function K0(e,t,n,i){let o=(t||e).node(n),s=0,r=t?t.index(n):o.childCount;e&&(s=e.index(n),e.depth>n?s++:e.textOffset&&(Kh(e.nodeAfter,i),s++));for(let l=s;lo&&QA(e,t,o+1),r=i.depth>o&&QA(n,i,o+1),l=[];return K0(null,e,o,l),s&&r&&t.index(o)==n.index(o)?(gV(s,r),Kh(Zh(s,vV(e,t,n,i,o+1)),l)):(s&&Kh(Zh(s,fb(e,t,o+1)),l),K0(t,n,o,l),r&&Kh(Zh(r,fb(n,i,o+1)),l)),K0(i,null,o,l),new dn(l)}function fb(e,t,n){let i=[];if(K0(null,e,n,i),e.depth>n){let o=QA(e,t,n+1);Kh(Zh(o,fb(e,t,n+1)),i)}return K0(t,null,n,i),new dn(i)}function x_e(e,t){let n=t.depth-e.openStart,o=t.node(n).copy(e.content);for(let s=n-1;s>=0;s--)o=t.node(s).copy(dn.from(o));return{start:o.resolveNoCache(e.openStart+n),end:o.resolveNoCache(o.content.size-e.openEnd-n)}}class Nv{constructor(t,n,i){this.pos=t,this.path=n,this.parentOffset=i,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let i=this.pos-this.path[this.path.length-1],o=t.child(n);return i?t.child(n).cut(i):o}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let i=this.path[n*3],o=n==0?0:this.path[n*3-1]+1;for(let s=0;s0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos=0;i--)if(t.pos<=this.end(i)&&(!n||n(this.node(i))))return new I_e(this,t,i);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let i=[],o=0,s=n;for(let r=t;;){let{index:l,offset:a}=r.content.findIndex(s),u=s-a;if(i.push(r,l,o+a),!u||(r=r.child(l),r.isText))break;s=u-1,o+=a+1}return new Nv(n,i,s)}static resolveCached(t,n){let i=GF.get(t);if(i)for(let s=0;st&&this.nodesBetween(t,n,s=>(i.isInSet(s.marks)&&(o=!0),!o)),o}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),yV(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,i=dn.empty,o=0,s=i.childCount){let r=this.contentMatchAt(t).matchFragment(i,o,s),l=r&&r.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let a=o;an.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let i;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");i=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,i)}let o=dn.fromJSON(t,n.content),s=t.nodeType(n.type).create(n.attrs,o,i);return s.type.checkAttrs(s.attrs),s}};Gh.prototype.text=void 0;class hb extends Gh{constructor(t,n,i,o){if(super(t,n,null,o),!i)throw new RangeError("Empty text nodes are not allowed");this.text=i}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):yV(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new hb(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new hb(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function yV(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class up{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let i=new T_e(t,n);if(i.next==null)return up.empty;let o=kV(i);i.next&&i.err("Unexpected trailing text");let s=O_e(R_e(o));return P_e(s,i),s}matchType(t){for(let n=0;nu.createAndFill()));for(let u=0;u=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(i){t.push(i);for(let o=0;o{let s=o+(i.validEnd?"*":" ")+" ";for(let r=0;r"+t.indexOf(i.next[r].next);return s}).join(` -`)}}up.empty=new up(!0);class T_e{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function kV(e){let t=[];do t.push(E_e(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function E_e(e){let t=[];do t.push(L_e(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function L_e(e){let t=F_e(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=N_e(e,t);else break;return t}function QF(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function N_e(e,t){let n=QF(e),i=n;return e.eat(",")&&(e.next!="}"?i=QF(e):i=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:i,expr:t}}function D_e(e,t){let n=e.nodeTypes,i=n[t];if(i)return[i];let o=[];for(let s in n){let r=n[s];r.isInGroup(t)&&o.push(r)}return o.length==0&&e.err("No node type or group '"+t+"' found"),o}function F_e(e){if(e.eat("(")){let t=kV(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=D_e(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function R_e(e){let t=[[]];return o(s(e,0),n()),t;function n(){return t.push([])-1}function i(r,l,a){let u={term:a,to:l};return t[r].push(u),u}function o(r,l){r.forEach(a=>a.to=l)}function s(r,l){if(r.type=="choice")return r.exprs.reduce((a,u)=>a.concat(s(u,l)),[]);if(r.type=="seq")for(let a=0;;a++){let u=s(r.exprs[a],l);if(a==r.exprs.length-1)return u;o(u,l=n())}else if(r.type=="star"){let a=n();return i(l,a),o(s(r.expr,a),a),[i(a)]}else if(r.type=="plus"){let a=n();return o(s(r.expr,l),a),o(s(r.expr,a),a),[i(a)]}else{if(r.type=="opt")return[i(l)].concat(s(r.expr,l));if(r.type=="range"){let a=l;for(let u=0;u{e[r].forEach(({term:l,to:a})=>{if(!l)return;let u;for(let c=0;c{u||o.push([l,u=[]]),u.indexOf(c)==-1&&u.push(c)})})});let s=t[i.join(",")]=new up(i.indexOf(e.length-1)>-1);for(let r=0;r-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:CV(this.attrs,t)}create(t=null,n,i){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Gh(this,this.computeAttrs(t),dn.from(n),Vi.setFrom(i))}createChecked(t=null,n,i){return n=dn.from(n),this.checkContent(n),new Gh(this,this.computeAttrs(t),n,Vi.setFrom(i))}createAndFill(t=null,n,i){if(t=this.computeAttrs(t),n=dn.from(n),n.size){let r=this.contentMatch.fillBefore(n);if(!r)return null;n=r.append(n)}let o=this.contentMatch.matchFragment(n),s=o&&o.fillBefore(dn.empty,!0);return s?new Gh(this,t,n.append(s),Vi.setFrom(i)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let i=0;i-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;ni[s]=new SV(s,n,r));let o=n.spec.topNode||"doc";if(!i[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!i.text)throw new RangeError("Every schema needs a 'text' type");for(let s in i.text.attrs)throw new RangeError("The text node type should not have attributes");return i}};function $_e(e,t,n){let i=n.split("|");return o=>{let s=o===null?"null":typeof o;if(i.indexOf(s)<0)throw new RangeError(`Expected value of type ${i} for attribute ${t} on type ${e}, got ${s}`)}}class B_e{constructor(t,n,i){this.hasDefault=Object.prototype.hasOwnProperty.call(i,"default"),this.default=i.default,this.validate=typeof i.validate=="string"?$_e(t,n,i.validate):i.validate}get isRequired(){return!this.hasDefault}}class U4{constructor(t,n,i,o){this.name=t,this.rank=n,this.schema=i,this.spec=o,this.attrs=xV(t,o.attrs),this.excluded=null;let s=wV(this.attrs);this.instance=s?new Vi(this,s):null}create(t=null){return!t&&this.instance?this.instance:new Vi(this,CV(this.attrs,t))}static compile(t,n){let i=Object.create(null),o=0;return t.forEach((s,r)=>i[s]=new U4(s,o++,n,r)),i}removeFromSet(t){for(var n=0;n-1}}class z_e{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let o in t)n[o]=t[o];n.nodes=Dr.from(t.nodes),n.marks=Dr.from(t.marks||{}),this.nodes=JF.compile(this.spec.nodes,this),this.marks=U4.compile(this.spec.marks,this);let i=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let s=this.nodes[o],r=s.spec.content||"",l=s.spec.marks;if(s.contentMatch=i[r]||(i[r]=up.parse(r,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=l=="_"?null:l?XF(this,l.split(" ")):l==""||!s.inlineContent?[]:null}for(let o in this.marks){let s=this.marks[o],r=s.spec.excludes;s.excluded=r==null?[s]:r==""?[]:XF(this,r.split(" "))}this.nodeFromJSON=o=>Gh.fromJSON(this,o),this.markFromJSON=o=>Vi.fromJSON(this,o),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,i,o){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof JF){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,i,o)}text(t,n){let i=this.nodes.text;return new hb(i,i.defaultAttrs,t,Vi.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}}function XF(e,t){let n=[];for(let i=0;i-1)&&n.push(r=a)}if(!r)throw new SyntaxError("Unknown mark type: '"+t[i]+"'")}return n}function j_e(e){return e.tag!=null}function H_e(e){return e.style!=null}let _V=class JA{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[];let i=this.matchedStyles=[];n.forEach(o=>{if(j_e(o))this.tags.push(o);else if(H_e(o)){let s=/[^=]*/.exec(o.style)[0];i.indexOf(s)<0&&i.push(s),this.styles.push(o)}}),this.normalizeLists=!this.tags.some(o=>{if(!/^(ul|ol)\b/.test(o.tag)||!o.node)return!1;let s=t.nodes[o.node];return s.contentMatch.matchType(s)})}parse(t,n={}){let i=new tR(this,n,!1);return i.addAll(t,Vi.none,n.from,n.to),i.finish()}parseSlice(t,n={}){let i=new tR(this,n,!0);return i.addAll(t,Vi.none,n.from,n.to),Cn.maxOpen(i.finish())}matchTag(t,n,i){for(let o=i?this.tags.indexOf(i)+1:0;ot.length&&(l.charCodeAt(t.length)!=61||l.slice(t.length+1)!=n))){if(r.getAttrs){let a=r.getAttrs(n);if(a===!1)continue;r.attrs=a||void 0}return r}}}static schemaRules(t){let n=[];function i(o){let s=o.priority==null?50:o.priority,r=0;for(;r{i(r=nR(r)),r.mark||r.ignore||r.clearMark||(r.mark=o)})}for(let o in t.nodes){let s=t.nodes[o].spec.parseDOM;s&&s.forEach(r=>{i(r=nR(r)),r.node||r.ignore||r.mark||(r.node=o)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new JA(t,JA.schemaRules(t)))}};const IV={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},W_e={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},MV={ol:!0,ul:!0},Dv=1,XA=2,Z0=4;function eR(e,t,n){return t!=null?(t?Dv:0)|(t==="full"?XA:0):e&&e.whitespace=="pre"?Dv|XA:n&~Z0}class By{constructor(t,n,i,o,s,r){this.type=t,this.attrs=n,this.marks=i,this.solid=o,this.options=r,this.content=[],this.activeMarks=Vi.none,this.match=s||(r&Z0?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(dn.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let i=this.type.contentMatch,o;return(o=i.findWrapping(t.type))?(this.match=i,o):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&Dv)){let i=this.content[this.content.length-1],o;if(i&&i.isText&&(o=/[ \t\r\n\u000c]+$/.exec(i.text))){let s=i;i.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-o[0].length))}}let n=dn.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(dn.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!IV.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class tR{constructor(t,n,i){this.parser=t,this.options=n,this.isOpen=i,this.open=0,this.localPreserveWS=!1;let o=n.topNode,s,r=eR(null,n.preserveWhitespace,0)|(i?Z0:0);o?s=new By(o.type,o.attrs,Vi.none,!0,n.topMatch||o.type.contentMatch,r):i?s=new By(null,null,Vi.none,!0,null,r):s=new By(t.schema.topNodeType,null,Vi.none,!0,null,r),this.nodes=[s],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,n){t.nodeType==3?this.addTextNode(t,n):t.nodeType==1&&this.addElement(t,n)}addTextNode(t,n){let i=t.nodeValue,o=this.top,s=o.options&XA?"full":this.localPreserveWS||(o.options&Dv)>0,{schema:r}=this.parser;if(s==="full"||o.inlineContext(t)||/[^ \t\r\n\u000c]/.test(i)){if(s)if(s==="full")i=i.replace(/\r\n?/g,` -`);else if(r.linebreakReplacement&&/[\r\n]/.test(i)&&this.top.findWrapping(r.linebreakReplacement.create())){let l=i.split(/\r?\n|\r/);for(let a=0;a!a.clearMark(u)):n=n.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return n}addElementByRule(t,n,i,o){let s,r;if(n.node)if(r=this.parser.schema.nodes[n.node],r.isLeaf)this.insertNode(r.create(n.attrs),i,t.nodeName=="BR")||this.leafFallback(t,i);else{let a=this.enter(r,n.attrs||null,i,n.preserveWhitespace);a&&(s=!0,i=a)}else{let a=this.parser.schema.marks[n.mark];i=i.concat(a.create(n.attrs))}let l=this.top;if(r&&r.isLeaf)this.findInside(t);else if(o)this.addElement(t,i,o);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(a=>this.insertNode(a,i,!1));else{let a=t;typeof n.contentElement=="string"?a=t.querySelector(n.contentElement):typeof n.contentElement=="function"?a=n.contentElement(t):n.contentElement&&(a=n.contentElement),this.findAround(t,a,!0),this.addAll(a,i),this.findAround(t,a,!1)}s&&this.sync(l)&&this.open--}addAll(t,n,i,o){let s=i||0;for(let r=i?t.childNodes[i]:t.firstChild,l=o==null?null:t.childNodes[o];r!=l;r=r.nextSibling,++s)this.findAtPoint(t,s),this.addDOM(r,n);this.findAtPoint(t,s)}findPlace(t,n,i){let o,s;for(let r=this.open,l=0;r>=0;r--){let a=this.nodes[r],u=a.findWrapping(t);if(u&&(!o||o.length>u.length+l)&&(o=u,s=a,!u.length))break;if(a.solid){if(i)break;l+=2}}if(!o)return null;this.sync(s);for(let r=0;r(r.type?r.type.allowsMarkType(u.type):iR(u.type,t))?(a=u.addToSet(a),!1):!0),this.nodes.push(new By(t,n,a,o,null,l)),this.open++,i}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(t){for(let n=this.open;n>=0;n--){if(this.nodes[n]==t)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=Dv)}return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let i=this.nodes[n].content;for(let o=i.length-1;o>=0;o--)t+=i[o].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let i=0;i-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),i=this.options.context,o=!this.isOpen&&(!i||i.parent.type==this.nodes[0].type),s=-(i?i.depth+1:0)+(o?0:1),r=(l,a)=>{for(;l>=0;l--){let u=n[l];if(u==""){if(l==n.length-1||l==0)continue;for(;a>=s;a--)if(r(l-1,a))return!0;return!1}else{let c=a>0||a==0&&o?this.nodes[a].type:i&&a>=s?i.node(a-s).type:null;if(!c||c.name!=u&&!c.isInGroup(u))return!1;a--}}return!0};return r(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let i=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(i&&i.isTextblock&&i.defaultAttrs)return i}for(let n in this.parser.schema.nodes){let i=this.parser.schema.nodes[n];if(i.isTextblock&&i.defaultAttrs)return i}}}function q_e(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let i=t.nodeType==1?t.nodeName.toLowerCase():null;i&&MV.hasOwnProperty(i)&&n?(n.appendChild(t),t=n):i=="li"?n=t:i&&(n=null)}}function U_e(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function nR(e){let t={};for(let n in e)t[n]=e[n];return t}function iR(e,t){let n=t.schema.nodes;for(let i in n){let o=n[i];if(!o.allowsMarkType(e))continue;let s=[],r=l=>{s.push(l);for(let a=0;a{if(s.length||r.marks.length){let l=0,a=0;for(;l=0;o--){let s=this.serializeMark(t.marks[o],t.isInline,n);s&&((s.contentDOM||s.dom).appendChild(i),i=s.dom)}return i}serializeMark(t,n,i={}){let o=this.marks[t.type.name];return o&&F9(zy(i),o(t,n),null,t.attrs)}static renderSpec(t,n,i=null,o){return typeof n=="string"?{dom:t.createTextNode(n)}:F9(t,n,i,o)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new rc(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=oR(t.nodes);return n.text||(n.text=i=>i.text),n}static marksFromSchema(t){return oR(t.marks)}}function oR(e){let t={};for(let n in e){let i=e[n].spec.toDOM;i&&(t[n]=i)}return t}function zy(e){return e.document||window.document}const sR=new WeakMap;function V_e(e){let t=sR.get(e);return t===void 0&&sR.set(e,t=K_e(e)),t}function K_e(e){let t=null;function n(i){if(i&&typeof i=="object")if(Array.isArray(i))if(typeof i[0]=="string")t||(t=[]),t.push(i);else for(let o=0;o-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let r=o.indexOf(" ");r>0&&(n=o.slice(0,r),o=o.slice(r+1));let l,a=n?e.createElementNS(n,o):e.createElement(o),u=t[1],c=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){c=2;for(let d in u)if(u[d]!=null){let h=d.indexOf(" ");h>0?a.setAttributeNS(d.slice(0,h),d.slice(h+1),u[d]):d=="style"&&a.style?a.style.cssText=u[d]:a.setAttribute(d,u[d])}}for(let d=c;dc)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else if(typeof h=="string")a.appendChild(e.createTextNode(h));else{let{dom:p,contentDOM:m}=F9(e,h,n,i);if(a.appendChild(p),m){if(l)throw new RangeError("Multiple content holes");l=m}}}return{dom:a,contentDOM:l}}const fi=new z_e({nodes:{doc:{content:"block+"},paragraph:{group:"block",content:"inline*",toDOM:()=>["p",0],parseDOM:[{tag:"p"}]},text:{group:"inline"},mention:{group:"inline",inline:!0,atom:!0,selectable:!0,attrs:{kind:{},name:{},path:{default:""}},leafText:e=>wp(e.attrs),toDOM:e=>{const t=e.attrs;return["span",{class:`mention-pill mention-${t.kind}`,"data-mention-path":t.path},t.name]}},attachment:{group:"inline",inline:!0,atom:!0,selectable:!0,attrs:{attId:{},name:{},kind:{}},leafText:e=>Cf(e.attrs),toDOM:e=>{const t=e.attrs;return["span",{class:`attachment-pill attachment-${t.kind}`,"data-attachment-id":t.attId,"data-attachment-kind":t.kind,"data-attachment-name":t.name},t.name]}},quote:{group:"inline",inline:!0,atom:!0,selectable:!0,attrs:{text:{},comment:{default:""},source:{default:""}},leafText:e=>H4(e.attrs),toDOM:e=>{const t=e.attrs,n={class:"quote-pill","data-quote-text":t.text};return typeof t.comment=="string"&&t.comment.length>0&&(n["data-quote-comment"]=t.comment),typeof t.source=="string"&&t.source.length>0&&(n["data-quote-source"]=t.source),["span",n,mm(t.text)]}}}});function TV(e){return fi.nodes.mention.create(e)}function EV(e){return fi.nodes.attachment.create(e)}function LV(e){return fi.nodes.quote.create(e)}function Z_e(e,t){return e?rV(e,t).map(n=>n.type==="mention"?TV(n.attrs):n.type==="attachment"?EV(n.attrs):n.type==="quote"?LV(n.attrs):fi.text(n.value)):[]}function Fv(e,t){const n=e.split(` -`);return fi.node("doc",null,n.map(i=>i?fi.node("paragraph",null,t?.reviveMentions?Z_e(i,t?.attachmentKindFor):fi.text(i)):fi.node("paragraph")))}function Rv(e){return e.textBetween(0,e.content.size,` -`)}const NV=65535,DV=Math.pow(2,16);function G_e(e,t){return e+t*DV}function rR(e){return e&NV}function Q_e(e){return(e-(e&NV))/DV}const FV=1,RV=2,R9=4,OV=8;class e6{constructor(t,n,i){this.pos=t,this.delInfo=n,this.recover=i}get deleted(){return(this.delInfo&OV)>0}get deletedBefore(){return(this.delInfo&(FV|R9))>0}get deletedAfter(){return(this.delInfo&(RV|R9))>0}get deletedAcross(){return(this.delInfo&R9)>0}}class ca{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&ca.empty)return ca.empty}recover(t){let n=0,i=rR(t);if(!this.inverted)for(let o=0;ot)break;let u=this.ranges[l+s],c=this.ranges[l+r],d=a+u;if(t<=d){let h=u?t==a?-1:t==d?1:n:n,p=a+o+(h<0?0:c);if(i)return p;let m=t==(n<0?a:d)?null:G_e(l/3,t-a),g=t==a?RV:t==d?FV:R9;return(n<0?t!=a:t!=d)&&(g|=OV),new e6(p,g,m)}o+=c-u}return i?t+o:new e6(t+o,0,null)}touches(t,n){let i=0,o=rR(n),s=this.inverted?2:1,r=this.inverted?1:2;for(let l=0;lt)break;let u=this.ranges[l+s],c=a+u;if(t<=c&&l==o*3)return!0;i+=this.ranges[l+r]-u}return!1}forEach(t){let n=this.inverted?2:1,i=this.inverted?1:2;for(let o=0,s=0;o=0;n--){let o=t.getMirror(n);this.appendMap(t._maps[n].invert(),o!=null&&o>n?i-o-1:void 0)}}invert(){let t=new Ov;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let i=this.from;is&&a!r.isAtom||!l.type.allowsMarkType(this.mark.type)?r:r.mark(this.mark.addToSet(r.marks)),o),n.openStart,n.openEnd);return js.fromReplace(t,this.from,this.to,s)}invert(){return new ec(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),i=t.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new Vd(n.pos,i.pos,this.mark)}merge(t){return t instanceof Vd&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Vd(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Vd(n.from,n.to,t.markFromJSON(n.mark))}}rl.jsonID("addMark",Vd);class ec extends rl{constructor(t,n,i){super(),this.from=t,this.to=n,this.mark=i}apply(t){let n=t.slice(this.from,this.to),i=new Cn(dS(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),t),n.openStart,n.openEnd);return js.fromReplace(t,this.from,this.to,i)}invert(){return new Vd(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),i=t.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new ec(n.pos,i.pos,this.mark)}merge(t){return t instanceof ec&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new ec(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new ec(n.from,n.to,t.markFromJSON(n.mark))}}rl.jsonID("removeMark",ec);class Kd extends rl{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return js.fail("No node at mark step's position");let i=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return js.fromReplace(t,this.pos,this.pos+1,new Cn(dn.from(i),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let i=this.mark.addToSet(n.marks);if(i.length==n.marks.length){for(let o=0;oi.pos?null:new va(n.pos,i.pos,o,s,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new va(n.from,n.to,n.gapFrom,n.gapTo,Cn.fromJSON(t,n.slice),n.insert,!!n.structure)}}rl.jsonID("replaceAround",va);function t6(e,t,n){let i=e.resolve(t),o=n-t,s=i.depth;for(;o>0&&s>0&&i.indexAfter(s)==i.node(s).childCount;)s--,o--;if(o>0){let r=i.node(s).maybeChild(i.indexAfter(s));for(;o>0;){if(!r||r.isLeaf)return!0;r=r.firstChild,o--}}return!1}function Y_e(e,t,n,i){let o=[],s=[],r,l;e.doc.nodesBetween(t,n,(a,u,c)=>{if(!a.isInline)return;let d=a.marks;if(!i.isInSet(d)&&c.type.allowsMarkType(i.type)){let h=Math.max(u,t),p=Math.min(u+a.nodeSize,n),m=i.addToSet(d);for(let g=0;ge.step(a)),s.forEach(a=>e.step(a))}function J_e(e,t,n,i){let o=[],s=0;e.doc.nodesBetween(t,n,(r,l)=>{if(!r.isInline)return;s++;let a=null;if(i instanceof U4){let u=r.marks,c;for(;c=i.isInSet(u);)(a||(a=[])).push(c),u=c.removeFromSet(u)}else i?i.isInSet(r.marks)&&(a=[i]):a=r.marks;if(a&&a.length){let u=Math.min(l+r.nodeSize,n);for(let c=0;ce.step(new ec(r.from,r.to,r.style)))}function fS(e,t,n,i=n.contentMatch,o=!0){let s=e.doc.nodeAt(t),r=[],l=t+1;for(let a=0;a=0;a--)e.step(r[a])}function X_e(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function hS(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let i=e.depth,o=0,s=0;;--i){let r=e.$from.node(i),l=e.$from.index(i)+o,a=e.$to.indexAfter(i)-s;if(in;m--)g||i.index(m)>0?(g=!0,c=dn.from(i.node(m).copy(c)),d++):a--;let h=dn.empty,p=0;for(let m=s,g=!1;m>n;m--)g||o.after(m+1)=0;r--){if(i.size){let l=n[r].type.contentMatch.matchFragment(i);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=dn.from(n[r].type.create(n[r].attrs,i))}let o=t.start,s=t.end;e.step(new va(o,s,o,s,new Cn(i,0,0),n.length,!0))}function nIe(e,t,n,i,o){if(!i.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=e.steps.length;e.doc.nodesBetween(t,n,(r,l)=>{let a=typeof o=="function"?o(r):o;if(r.isTextblock&&!r.hasMarkup(i,a)&&iIe(e.doc,e.mapping.slice(s).map(l),i)){let u=null;if(i.schema.linebreakReplacement){let p=i.whitespace=="pre",m=!!i.contentMatch.matchType(i.schema.linebreakReplacement);p&&!m?u=!1:!p&&m&&(u=!0)}u===!1&&$V(e,r,l,s),fS(e,e.mapping.slice(s).map(l,1),i,void 0,u===null);let c=e.mapping.slice(s),d=c.map(l,1),h=c.map(l+r.nodeSize,1);return e.step(new va(d,h,d+1,h-1,new Cn(dn.from(i.create(a,null,r.marks)),0,0),1,!0)),u===!0&&PV(e,r,l,s),!1}})}function PV(e,t,n,i){t.forEach((o,s)=>{if(o.isText){let r,l=/\r?\n|\r/g;for(;r=l.exec(o.text);){let a=e.mapping.slice(i).map(n+1+s+r.index);e.replaceWith(a,a+1,t.type.schema.linebreakReplacement.create())}}})}function $V(e,t,n,i){t.forEach((o,s)=>{if(o.type==o.type.schema.linebreakReplacement){let r=e.mapping.slice(i).map(n+1+s);e.replaceWith(r,r+1,t.type.schema.text(` -`))}})}function iIe(e,t,n){let i=e.resolve(t),o=i.index();return i.parent.canReplaceWith(o,o+1,n)}function oIe(e,t,n,i,o){let s=e.doc.nodeAt(t);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let r=n.create(i,null,o||s.marks);if(s.isLeaf)return e.replaceWith(t,t+s.nodeSize,r);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new va(t,t+s.nodeSize,t+1,t+s.nodeSize-1,new Cn(dn.from(r),0,0),1,!0))}function O9(e,t,n=1,i){let o=e.resolve(t),s=o.depth-n,r=i&&i[i.length-1]||o.parent;if(s<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!r.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let u=o.depth-1,c=n-2;u>s;u--,c--){let d=o.node(u),h=o.index(u);if(d.type.spec.isolating)return!1;let p=d.content.cutByIndex(h,d.childCount),m=i&&i[c+1];m&&(p=p.replaceChild(0,m.type.create(m.attrs)));let g=i&&i[c]||d;if(!d.canReplace(h+1,d.childCount)||!g.type.validContent(p))return!1}let l=o.indexAfter(s),a=i&&i[0];return o.node(s).canReplaceWith(l,l,a?a.type:o.node(s+1).type)}function sIe(e,t,n=1,i){let o=e.doc.resolve(t),s=dn.empty,r=dn.empty;for(let l=o.depth,a=o.depth-n,u=n-1;l>a;l--,u--){s=dn.from(o.node(l).copy(s));let c=i&&i[u];r=dn.from(c?c.type.create(c.attrs,r):o.node(l).copy(r))}e.step(new Ar(t,t,new Cn(s.append(r),n,n),!0))}function BV(e,t){let n=e.resolve(t),i=n.index();return lIe(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(i,i+1)}function rIe(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:i}=e.type.schema;for(let o=0;o=0;o--){let s=i.index(o);if(i.node(o).canReplaceWith(s,s,n))return i.before(o+1);if(s>0)return null}if(i.parentOffset==i.parent.content.size)for(let o=i.depth-1;o>=0;o--){let s=i.indexAfter(o);if(i.node(o).canReplaceWith(s,s,n))return i.after(o+1);if(s=0;r--){let l=r==i.depth?0:i.pos<=(i.start(r+1)+i.end(r+1))/2?-1:1,a=i.index(r)+(l>0?1:0),u=i.node(r),c=!1;if(s==1)c=u.canReplace(a,a,o);else{let d=u.contentMatchAt(a).findWrapping(o.firstChild.type);c=d&&u.canReplaceWith(a,a,d[0])}if(c)return l==0?i.pos:l<0?i.before(r+1):i.after(r+1)}return null}function pS(e,t,n=t,i=Cn.empty){if(t==n&&!i.size)return null;let o=e.resolve(t),s=e.resolve(n);return zV(o,s,i)?new Ar(t,n,i):new dIe(o,s,i).fit()}function zV(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class dIe{constructor(t,n,i){this.$from=t,this.$to=n,this.unplaced=i,this.frontier=[],this.placed=dn.empty;for(let o=0;o<=t.depth;o++){let s=t.node(o);this.frontier.push({type:s.type,match:s.contentMatchAt(t.indexAfter(o))})}for(let o=t.depth;o>0;o--)this.placed=dn.from(t.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,i=this.$from,o=this.close(t<0?this.$to:i.doc.resolve(t));if(!o)return null;let s=this.placed,r=i.depth,l=o.depth;for(;r&&l&&s.childCount==1;)s=s.firstChild.content,r--,l--;let a=new Cn(s,r,l);return t>-1?new va(i.pos,t,this.$to.pos,this.$to.end(),a,n):a.size||i.pos!=this.$to.pos?new Ar(i.pos,o.pos,a):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,i=0,o=this.unplaced.openEnd;i1&&(o=0),s.type.spec.isolating&&o<=i){t=i;break}n=s.content}for(let n=1;n<=2;n++)for(let i=n==1?t:this.unplaced.openStart;i>=0;i--){let o,s=null;i?(s=Tw(this.unplaced.content,i-1).firstChild,o=s.content):o=this.unplaced.content;let r=o.firstChild;for(let l=this.depth;l>=0;l--){let{type:a,match:u}=this.frontier[l],c,d=null;if(n==1&&(r?u.matchType(r.type)||(d=u.fillBefore(dn.from(r),!1)):s&&a.compatibleContent(s.type)))return{sliceDepth:i,frontierDepth:l,parent:s,inject:d};if(n==2&&r&&(c=u.findWrapping(r.type)))return{sliceDepth:i,frontierDepth:l,parent:s,wrap:c};if(s&&u.matchType(s.type))break}}}openMore(){let{content:t,openStart:n,openEnd:i}=this.unplaced,o=Tw(t,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new Cn(t,n+1,Math.max(i,o.size+n>=t.size-i?n+1:0)),!0)}dropNode(){let{content:t,openStart:n,openEnd:i}=this.unplaced,o=Tw(t,n);if(o.childCount<=1&&n>0){let s=t.size-n<=n+o.size;this.unplaced=new Cn(r0(t,n-1,1),n-1,s?n-1:i)}else this.unplaced=new Cn(r0(t,n,1),n,i)}placeNodes({sliceDepth:t,frontierDepth:n,parent:i,inject:o,wrap:s}){for(;this.depth>n;)this.closeFrontierNode();if(s)for(let g=0;g1||a==0||g.content.size)&&(d=y,c.push(jV(g.mark(h.allowedMarks(g.marks)),u==1?a:0,u==l.childCount?p:-1)))}let m=u==l.childCount;m||(p=-1),this.placed=l0(this.placed,n,dn.from(c)),this.frontier[n].match=d,m&&p<0&&i&&i.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,y=l;g1&&o==this.$to.end(--i);)++o;return o}findCloseLevel(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:i,type:o}=this.frontier[n],s=n=0;l--){let{match:a,type:u}=this.frontier[l],c=Ew(t,l,u,a,!0);if(!c||c.childCount)continue e}return{depth:n,fit:r,move:s?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=l0(this.placed,n.depth,n.fit)),t=n.move;for(let i=n.depth+1;i<=t.depth;i++){let o=t.node(i),s=o.type.contentMatch.fillBefore(o.content,!0,t.index(i));this.openFrontierNode(o.type,o.attrs,s)}return t}openFrontierNode(t,n=null,i){let o=this.frontier[this.depth];o.match=o.match.matchType(t),this.placed=l0(this.placed,this.depth,dn.from(t.create(n,i))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(dn.empty,!0);n.childCount&&(this.placed=l0(this.placed,this.frontier.length,n))}}function r0(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(r0(e.firstChild.content,t-1,n)))}function l0(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(l0(e.lastChild.content,t-1,n)))}function Tw(e,t){for(let n=0;n1&&(i=i.replaceChild(0,jV(i.firstChild,t-1,i.childCount==1?n-1:0))),t>0&&(i=e.type.contentMatch.fillBefore(i).append(i),n<=0&&(i=i.append(e.type.contentMatch.matchFragment(i).fillBefore(dn.empty,!0)))),e.copy(i)}function Ew(e,t,n,i,o){let s=e.node(t),r=o?e.indexAfter(t):e.index(t);if(r==s.childCount&&!n.compatibleContent(s.type))return null;let l=i.fillBefore(s.content,!0,r);return l&&!fIe(n,s.content,r)?l:null}function fIe(e,t,n){for(let i=n;i0;h--,p--){let m=o.node(h).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;r.indexOf(h)>-1?l=h:o.before(h)==p&&r.splice(1,0,-h)}let a=r.indexOf(l),u=[],c=i.openStart;for(let h=i.content,p=0;;p++){let m=h.firstChild;if(u.push(m),p==i.openStart)break;h=m.content}for(let h=c-1;h>=0;h--){let p=u[h],m=hIe(p.type);if(m&&!p.sameMarkup(o.node(Math.abs(l)-1)))c=h;else if(m||!p.type.isTextblock)break}for(let h=i.openStart;h>=0;h--){let p=(h+c+1)%(i.openStart+1),m=u[p];if(m)for(let g=0;g=0&&(e.replace(t,n,i),!(e.steps.length>d));h--){let p=r[h];p<0||(t=o.before(p),n=s.after(p))}}function HV(e,t,n,i,o){if(ti){let s=o.contentMatchAt(0),r=s.fillBefore(e).append(e);e=r.append(s.matchFragment(r).fillBefore(dn.empty,!0))}return e}function mIe(e,t,n,i){if(!i.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let o=uIe(e.doc,t,i.type);o!=null&&(t=n=o)}e.replaceRange(t,n,new Cn(dn.from(i),0,0))}function gIe(e,t,n){let i=e.doc.resolve(t),o=e.doc.resolve(n);if(i.parent.isTextblock&&o.parent.isTextblock&&i.start()!=o.start()&&i.parentOffset==0&&o.parentOffset==0){let r=i.sharedDepth(n),l=!1;for(let a=i.depth;a>r;a--)i.node(a).type.spec.isolating&&(l=!0);for(let a=o.depth;a>r;a--)o.node(a).type.spec.isolating&&(l=!0);if(!l){for(let a=i.depth;a>0&&t==i.start(a);a--)t=i.before(a);for(let a=o.depth;a>0&&n==o.start(a);a--)n=o.before(a);i=e.doc.resolve(t),o=e.doc.resolve(n)}}let s=WV(i,o);for(let r=0;r0&&(a||i.node(l-1).canReplace(i.index(l-1),o.indexAfter(l-1))))return e.delete(i.before(l),o.after(l))}for(let r=1;r<=i.depth&&r<=o.depth;r++)if(t-i.start(r)==i.depth-r&&n>i.end(r)&&o.end(r)-n!=o.depth-r&&i.start(r-1)==o.start(r-1)&&i.node(r-1).canReplace(i.index(r-1),o.index(r-1)))return e.delete(i.before(r),n);e.delete(t,n)}function WV(e,t){let n=[],i=Math.min(e.depth,t.depth);for(let o=i;o>=0;o--){let s=e.start(o);if(st.pos+(t.depth-o)||e.node(o).type.spec.isolating||t.node(o).type.spec.isolating)break;(s==t.start(o)||o==e.depth&&o==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&o&&t.start(o-1)==s-1)&&n.push(o)}return n}class Y1 extends rl{constructor(t,n,i){super(),this.pos=t,this.attr=n,this.value=i}apply(t){let n=t.nodeAt(this.pos);if(!n)return js.fail("No node at attribute step's position");let i=Object.create(null);for(let s in n.attrs)i[s]=n.attrs[s];i[this.attr]=this.value;let o=n.type.create(i,null,n.marks);return js.fromReplace(t,this.pos,this.pos+1,new Cn(dn.from(o),0,n.isLeaf?0:1))}getMap(){return ca.empty}invert(t){return new Y1(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Y1(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Y1(n.pos,n.attr,n.value)}}rl.jsonID("attr",Y1);class Pv extends rl{constructor(t,n){super(),this.attr=t,this.value=n}apply(t){let n=Object.create(null);for(let o in t.attrs)n[o]=t.attrs[o];n[this.attr]=this.value;let i=t.type.create(n,t.content,t.marks);return js.ok(i)}getMap(){return ca.empty}invert(t){return new Pv(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Pv(n.attr,n.value)}}rl.jsonID("docAttr",Pv);let gm=class extends Error{};gm=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};gm.prototype=Object.create(Error.prototype);gm.prototype.constructor=gm;gm.prototype.name="TransformError";class vIe{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new Ov}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new gm(n.failed);return this}maybeStep(t){let n=t.apply(this.doc);return n.failed||this.addStep(t,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let t=1e9,n=-1e9;for(let i=0;i{t=Math.min(t,l),n=Math.max(n,a)})}return t==1e9?null:{from:t,to:n}}addStep(t,n){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=n}replace(t,n=t,i=Cn.empty){let o=pS(this.doc,t,n,i);return o&&this.step(o),this}replaceWith(t,n,i){return this.replace(t,n,new Cn(dn.from(i),0,0))}delete(t,n){return this.replace(t,n,Cn.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,i){return pIe(this,t,n,i),this}replaceRangeWith(t,n,i){return mIe(this,t,n,i),this}deleteRange(t,n){return gIe(this,t,n),this}lift(t,n){return eIe(this,t,n),this}join(t,n=1){return aIe(this,t,n),this}wrap(t,n){return tIe(this,t,n),this}setBlockType(t,n=t,i,o=null){return nIe(this,t,n,i,o),this}setNodeMarkup(t,n,i=null,o){return oIe(this,t,n,i,o),this}setNodeAttribute(t,n,i){return this.step(new Y1(t,n,i)),this}setDocAttribute(t,n){return this.step(new Pv(t,n)),this}addNodeMark(t,n){return this.step(new Kd(t,n)),this}removeNodeMark(t,n){let i=this.doc.nodeAt(t);if(!i)throw new RangeError("No node at position "+t);if(n instanceof Vi)n.isInSet(i.marks)&&this.step(new cp(t,n));else{let o=i.marks,s,r=[];for(;s=n.isInSet(o);)r.push(new cp(t,s)),o=s.removeFromSet(o);for(let l=r.length-1;l>=0;l--)this.step(r[l])}return this}split(t,n=1,i){return sIe(this,t,n,i),this}addMark(t,n,i){return Y_e(this,t,n,i),this}removeMark(t,n,i){return J_e(this,t,n,i),this}clearIncompatible(t,n,i){return fS(this,t,n,i),this}}const Lw=Object.create(null);class to{constructor(t,n,i){this.$anchor=t,this.$head=n,this.ranges=i||[new yIe(t.min(n),t.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let n=0;n=0;s--){let r=n<0?p1(t.node(0),t.node(s),t.before(s+1),t.index(s),n,i):p1(t.node(0),t.node(s),t.after(s+1),t.index(s)+1,n,i);if(r)return r}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new ya(t.node(0))}static atStart(t){return p1(t,t,0,0,1)||new ya(t)}static atEnd(t){return p1(t,t,t.content.size,t.childCount,-1)||new ya(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let i=Lw[n.type];if(!i)throw new RangeError(`No selection type ${n.type} defined`);return i.fromJSON(t,n)}static jsonID(t,n){if(t in Lw)throw new RangeError("Duplicate use of selection JSON ID "+t);return Lw[t]=n,n.prototype.jsonID=t,n}getBookmark(){return ti.between(this.$anchor,this.$head).getBookmark()}}to.prototype.visible=!0;class yIe{constructor(t,n){this.$from=t,this.$to=n}}let lR=!1;function aR(e){!lR&&!e.parent.inlineContent&&(lR=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class ti extends to{constructor(t,n=t){aR(t),aR(n),super(t,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let i=t.resolve(n.map(this.head));if(!i.parent.inlineContent)return to.near(i);let o=t.resolve(n.map(this.anchor));return new ti(o.parent.inlineContent?o:i,i)}replace(t,n=Cn.empty){if(super.replace(t,n),n==Cn.empty){let i=this.$from.marksAcross(this.$to);i&&t.ensureMarks(i)}}eq(t){return t instanceof ti&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new V4(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new ti(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,i=n){let o=t.resolve(n);return new this(o,i==n?o:t.resolve(i))}static between(t,n,i){let o=t.pos-n.pos;if((!i||o)&&(i=o>=0?1:-1),!n.parent.inlineContent){let s=to.findFrom(n,i,!0)||to.findFrom(n,-i,!0);if(s)n=s.$head;else return to.near(n,i)}return t.parent.inlineContent||(o==0?t=n:(t=(to.findFrom(t,-i,!0)||to.findFrom(t,i,!0)).$anchor,t.pos0?0:1);o>0?r=0;r+=o){let l=t.child(r);if(l.isAtom){if(!s&&Yn.isSelectable(l))return Yn.create(e,n-(o<0?l.nodeSize:0))}else{let a=p1(e,l,n+o,o<0?l.childCount:0,o,s);if(a)return a}n+=l.nodeSize*o}return null}function uR(e,t,n){let i=e.steps.length-1;if(i{r==null&&(r=c)}),e.setSelection(to.near(e.doc.resolve(r),n))}const cR=1,jy=2,dR=4;class bIe extends vIe{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(t){return this.storedMarks=t,this.updated|=jy,this}ensureMarks(t){return Vi.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&jy)>0}addStep(t,n){super.addStep(t,n),this.updated=this.updated&~jy,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,n=!0){let i=this.selection;return n&&(t=t.mark(this.storedMarks||(i.empty?i.$from.marks():i.$from.marksAcross(i.$to)||Vi.none))),i.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,n,i){let o=this.doc.type.schema;if(n==null)return t?this.replaceSelectionWith(o.text(t),!0):this.deleteSelection();{if(i==null&&(i=n),!t)return this.deleteRange(n,i);let s=this.storedMarks;if(!s){let r=this.doc.resolve(n);s=i==n?r.marks():r.marksAcross(this.doc.resolve(i))}return this.replaceRangeWith(n,i,o.text(t,s)),!this.selection.empty&&this.selection.to==n+t.length&&this.setSelection(to.near(this.selection.$to)),this}}setMeta(t,n){return this.meta[typeof t=="string"?t:t.key]=n,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=dR,this}get scrolledIntoView(){return(this.updated&dR)>0}}function fR(e,t){return!t||!e?e:e.bind(t)}class a0{constructor(t,n,i){this.name=t,this.init=fR(n.init,i),this.apply=fR(n.apply,i)}}const wIe=[new a0("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new a0("selection",{init(e,t){return e.selection||to.atStart(t.doc)},apply(e){return e.selection}}),new a0("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,i){return i.selection.$cursor?e.storedMarks:null}}),new a0("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class Nw{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=wIe.slice(),n&&n.forEach(i=>{if(this.pluginsByKey[i.key])throw new RangeError("Adding different instances of a keyed plugin ("+i.key+")");this.plugins.push(i),this.pluginsByKey[i.key]=i,i.spec.state&&this.fields.push(new a0(i.key,i.spec.state,i))})}}class Nh{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,n=-1){for(let i=0;ii.toJSON())),t&&typeof t=="object")for(let i in t){if(i=="doc"||i=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=t[i],s=o.spec.state;s&&s.toJSON&&(n[i]=s.toJSON.call(o,this[o.key]))}return n}static fromJSON(t,n,i){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let o=new Nw(t.schema,t.plugins),s=new Nh(o);return o.fields.forEach(r=>{if(r.name=="doc")s.doc=Gh.fromJSON(t.schema,n.doc);else if(r.name=="selection")s.selection=to.fromJSON(s.doc,n.selection);else if(r.name=="storedMarks")n.storedMarks&&(s.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(i)for(let l in i){let a=i[l],u=a.spec.state;if(a.key==r.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(n,l)){s[r.name]=u.fromJSON.call(a,t,n[l],s);return}}s[r.name]=r.init(t,s)}}),s}}function qV(e,t,n){for(let i in e){let o=e[i];o instanceof Function?o=o.bind(t):i=="handleDOMEvents"&&(o=qV(o,t,{})),n[i]=o}return n}class d2{constructor(t){this.spec=t,this.props={},t.props&&qV(t.props,this,this.props),this.key=t.key?t.key.key:UV("plugin")}getState(t){return t[this.key]}}const Dw=Object.create(null);function UV(e){return e in Dw?e+"$"+ ++Dw[e]:(Dw[e]=0,e+"$")}class gS{constructor(t="key"){this.key=UV(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}function G0(e){return e.isText?e.text.length:e.type===fi.nodes.attachment?Cf(e.attrs).length:e.type===fi.nodes.quote?H4(e.attrs).length:wp(e.attrs).length}function CIe(e,t){if(!t.parent.isTextblock)return tc(e,t.pos);if(t.textOffset>0)return tc(e,t.pos-t.textOffset);const n=t.nodeBefore;return n&&n.isText?tc(e,t.pos-n.nodeSize):tc(e,t.pos)}function Jc(e,t){let n=Math.max(0,t),i=-1;return e.forEach((o,s)=>{if(i!==-1)return;let r=0;if(o.forEach(l=>{r+=G0(l)}),n>r){n-=r+1;return}o.forEach((l,a)=>{if(i!==-1)return;const u=s+1+a,c=G0(l);if(n<=c){l.isText?i=u+n:i=n===0?u:u+1;return}n-=c}),i===-1&&(i=s+1+o.content.size)}),i===-1?e.content.size-1:i}function tc(e,t){let n=0,i=-1;return e.forEach((o,s)=>{if(i!==-1)return;const r=s+o.nodeSize;if(t>r){o.forEach(a=>{n+=G0(a)}),n+=1;return}let l=0;o.forEach((a,u)=>{if(i!==-1)return;const c=s+1+u;if(a.isText){const d=c+a.nodeSize;if(t<=d){i=n+l+Math.max(0,t-c);return}l+=a.text.length}else{const d=c+1;if(t<=d){i=n+l+(t<=c?0:G0(a));return}l+=G0(a)}}),i===-1&&(i=n+l)}),i===-1?n:i}function AIe(e){const t=[];return e.forEach(n=>{n.forEach(i=>{!i.isText&&i.type===fi.nodes.mention&&i.attrs.kind==="skill"&&t.push({name:i.attrs.name})})}),t}function hR(e){return(t,n)=>{const i=t.selection.$head,o=e?i.start():i.end();return n&&n(t.tr.setSelection(ti.create(t.doc,t.selection.$anchor.pos,o)).scrollIntoView()),!0}}var pb=200,Sr=function(){};Sr.prototype.append=function(t){return t.length?(t=Sr.from(t),!this.length&&t||t.length=n?Sr.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))};Sr.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};Sr.prototype.forEach=function(t,n,i){n===void 0&&(n=0),i===void 0&&(i=this.length),n<=i?this.forEachInner(t,n,i,0):this.forEachInvertedInner(t,n,i,0)};Sr.prototype.map=function(t,n,i){n===void 0&&(n=0),i===void 0&&(i=this.length);var o=[];return this.forEach(function(s,r){return o.push(t(s,r))},n,i),o};Sr.from=function(t){return t instanceof Sr?t:t&&t.length?new VV(t):Sr.empty};var VV=(function(e){function t(i){e.call(this),this.values=i}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(o,s){return o==0&&s==this.length?this:new t(this.values.slice(o,s))},t.prototype.getInner=function(o){return this.values[o]},t.prototype.forEachInner=function(o,s,r,l){for(var a=s;a=r;a--)if(o(this.values[a],l+a)===!1)return!1},t.prototype.leafAppend=function(o){if(this.length+o.length<=pb)return new t(this.values.concat(o.flatten()))},t.prototype.leafPrepend=function(o){if(this.length+o.length<=pb)return new t(o.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t})(Sr);Sr.empty=new VV([]);var xIe=(function(e){function t(n,i){e.call(this),this.left=n,this.right=i,this.length=n.length+i.length,this.depth=Math.max(n.depth,i.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(i){return il&&this.right.forEachInner(i,Math.max(o-l,0),Math.min(this.length,s)-l,r+l)===!1)return!1},t.prototype.forEachInvertedInner=function(i,o,s,r){var l=this.left.length;if(o>l&&this.right.forEachInvertedInner(i,o-l,Math.max(s,l)-l,r+l)===!1||s=s?this.right.slice(i-s,o-s):this.left.slice(i,s).append(this.right.slice(0,o-s))},t.prototype.leafAppend=function(i){var o=this.right.leafAppend(i);if(o)return new t(this.left,o)},t.prototype.leafPrepend=function(i){var o=this.left.leafPrepend(i);if(o)return new t(o,this.right)},t.prototype.appendInner=function(i){return this.left.depth>=Math.max(this.right.depth,i.depth)+1?new t(this.left,new t(this.right,i)):new t(this,i)},t})(Sr);const SIe=500;class hu{constructor(t,n){this.items=t,this.eventCount=n}popEvent(t,n){if(this.eventCount==0)return null;let i=this.items.length;for(;;i--)if(this.items.get(i-1).selection){--i;break}let o,s;n&&(o=this.remapping(i,this.items.length),s=o.maps.length);let r=t.tr,l,a,u=[],c=[];return this.items.forEach((d,h)=>{if(!d.step){o||(o=this.remapping(i,h+1),s=o.maps.length),s--,c.push(d);return}if(o){c.push(new Hu(d.map));let p=d.step.map(o.slice(s)),m;p&&r.maybeStep(p).doc&&(m=r.mapping.maps[r.mapping.maps.length-1],u.push(new Hu(m,void 0,void 0,u.length+c.length))),s--,m&&o.appendMap(m,s)}else r.maybeStep(d.step);if(d.selection)return l=o?d.selection.map(o.slice(s)):d.selection,a=new hu(this.items.slice(0,i).append(c.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:a,transform:r,selection:l}}addTransform(t,n,i,o){let s=[],r=this.eventCount,l=this.items,a=!o&&l.length?l.get(l.length-1):null;for(let c=0;cIIe&&(l=_Ie(l,u),r-=u),new hu(l.append(s),r)}remapping(t,n){let i=new Ov;return this.items.forEach((o,s)=>{let r=o.mirrorOffset!=null&&s-o.mirrorOffset>=t?i.maps.length-o.mirrorOffset:void 0;i.appendMap(o.map,r)},t,n),i}addMaps(t){return this.eventCount==0?this:new hu(this.items.append(t.map(n=>new Hu(n))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let i=[],o=Math.max(0,this.items.length-n),s=t.mapping,r=t.steps.length,l=this.eventCount;this.items.forEach(h=>{h.selection&&l--},o);let a=n;this.items.forEach(h=>{let p=s.getMirror(--a);if(p==null)return;r=Math.min(r,p);let m=s.maps[p];if(h.step){let g=t.steps[p].invert(t.docs[p]),y=h.selection&&h.selection.map(s.slice(a+1,p));y&&l++,i.push(new Hu(m,g,y))}else i.push(new Hu(m))},o);let u=[];for(let h=n;hSIe&&(d=d.compress(this.items.length-i.length)),d}emptyItemCount(){let t=0;return this.items.forEach(n=>{n.step||t++}),t}compress(t=this.items.length){let n=this.remapping(0,t),i=n.maps.length,o=[],s=0;return this.items.forEach((r,l)=>{if(l>=t)o.push(r),r.selection&&s++;else if(r.step){let a=r.step.map(n.slice(i)),u=a&&a.getMap();if(i--,u&&n.appendMap(u,i),a){let c=r.selection&&r.selection.map(n.slice(i));c&&s++;let d=new Hu(u.invert(),a,c),h,p=o.length-1;(h=o.length&&o[p].merge(d))?o[p]=h:o.push(d)}}else r.map&&i--},this.items.length,0),new hu(Sr.from(o.reverse()),s)}}hu.empty=new hu(Sr.empty,0);function _Ie(e,t){let n;return e.forEach((i,o)=>{if(i.selection&&t--==0)return n=o,!1}),e.slice(n)}class Hu{constructor(t,n,i,o){this.map=t,this.step=n,this.selection=i,this.mirrorOffset=o}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new Hu(n.getMap().invert(),n,this.selection)}}}class Rd{constructor(t,n,i,o,s){this.done=t,this.undone=n,this.prevRanges=i,this.prevTime=o,this.prevComposition=s}}const IIe=20;function MIe(e,t,n,i){let o=n.getMeta(Qh),s;if(o)return o.historyState;n.getMeta(ZV)&&(e=new Rd(e.done,e.undone,null,0,-1));let r=n.getMeta("appendedTransaction");if(n.steps.length==0)return e;if(r&&r.getMeta(Qh))return r.getMeta(Qh).redo?new Rd(e.done.addTransform(n,void 0,i,P9(t)),e.undone,pR(n.mapping.maps),e.prevTime,e.prevComposition):new Rd(e.done,e.undone.addTransform(n,void 0,i,P9(t)),null,e.prevTime,e.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(r&&r.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),a=e.prevTime==0||!r&&e.prevComposition!=l&&(e.prevTime<(n.time||0)-i.newGroupDelay||!TIe(n,e.prevRanges)),u=r?Fw(e.prevRanges,n.mapping):pR(n.mapping.maps);return new Rd(e.done.addTransform(n,a?t.selection.getBookmark():void 0,i,P9(t)),hu.empty,u,n.time,l??e.prevComposition)}else return(s=n.getMeta("rebased"))?new Rd(e.done.rebased(n,s),e.undone.rebased(n,s),Fw(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new Rd(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),Fw(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function TIe(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((i,o)=>{for(let s=0;s=t[s]&&(n=!0)}),n}function pR(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((i,o,s,r)=>t.push(s,r));return t}function Fw(e,t){if(!e)return null;let n=[];for(let i=0;i{let o=Qh.getState(n);if(!o||(e?o.undone:o.done).eventCount==0)return!1;if(i){let s=EIe(o,n,e);s&&i(t?s.scrollIntoView():s)}return!0}}const QV=GV(!1,!0),n6=GV(!0,!0);function NIe(e,t,n){const i=Jc(e.doc,n.start),o=Jc(e.doc,n.end),s=Rv(e.doc),r=n.start>0?s.charAt(n.start-1):"",l=s.charAt(n.end),a=[];(r==="!"||r==="\\")&&a.push(fi.text(" ")),a.push(TV(t)),(l===""||!/\s/.test(l))&&a.push(fi.text(" "));const u=e.tr.replaceWith(i,o,a);return u.setSelection(ti.create(u.doc,i+a.reduce((c,d)=>c+d.nodeSize,0))),u.scrollIntoView()}function DIe(e,t,n){const i=Jc(e.doc,n.start),o=Jc(e.doc,n.end),s=e.tr.insertText(t,i,o);return s.setSelection(ti.create(s.doc,i+t.length)),KV(s.scrollIntoView())}function FIe(e,t,n){const i=n?n.start:tc(e.doc,e.selection.from),o=n?n.end:tc(e.doc,e.selection.to),s=Jc(e.doc,i),r=Jc(e.doc,o),l=Rv(e.doc),a=i>0?l.charAt(i-1):"",u=l.charAt(o),c=[];(a==="!"||a==="\\")&&c.push(fi.text(" ")),c.push(EV(t)),(u===""||!/\s/.test(u))&&c.push(fi.text(" "));const d=e.tr.replaceWith(s,r,c);return d.setSelection(ti.create(d.doc,s+c.reduce((h,p)=>h+p.nodeSize,0))),d.scrollIntoView()}function RIe(e,t,n){const i=e.selection.to,o=Rv(e.doc),s=tc(e.doc,i),r=s>0?o.charAt(s-1):"",l=o.charAt(s),a=[];r!==""&&!/\s/.test(r)&&a.push(fi.text(" ")),a.push(LV(n!==void 0&&n.length>0?{...t,comment:n}:t)),(l===""||!/\s/.test(l))&&a.push(fi.text(" "));const u=e.tr.replaceWith(i,i,a);return u.setSelection(ti.create(u.doc,i+a.reduce((c,d)=>c+d.nodeSize,0))),u.scrollIntoView()}function Hy(e,t){return Cn.maxOpen(Fv(e.replace(/\r\n?/g,` -`),t).content)}function gR(e){const t=typeof e.source=="string"&&e.source.length>0?`from: ${uS(e.source)} -`:"",n=typeof e.comment=="string"&&e.comment.length>0?` - -${e.comment}`:"";return`${t}${lV(e.text)}${n}`}function YV(e){const t=i=>i.isText?i.text??"":i.type===fi.nodes.mention?wp(i.attrs):i.type===fi.nodes.attachment?i.attrs.name:i.type===fi.nodes.quote?gR(i.attrs):i.textBetween(0,i.content.size,""),n=[];return e.content.forEach(i=>{if(i.type===fi.nodes.mention||i.type===fi.nodes.attachment||i.type===fi.nodes.quote)n.push(t(i));else{let o="",s=!1;i.forEach(r=>{if(r.type===fi.nodes.quote){const a=gR(r.attrs);o=o.length>0?`${o.replace(/ +$/,"")} - -${a}`:a,s=!0;return}let l=t(r);s&&(l=l.replace(/^ /,""),o+=` - -`,s=!1),o+=l}),n.push(o)}}),n.join(` -`)}const i6=` - - - - -`,JV=` - - - - -`,XV='',eK=` - - - -`,tK=` - - -`,nK='',iK=` - - -`,oK=` - - -`,sK=` - - -`,OIe='',PIe='',$Ie='',BIe='',zIe='',jIe={sm:14,md:16,lg:20},HIe={file:i6,folder:JV,skill:XV,copy:eK,check:tK,"external-link":nK,target:iK,"file-edit":oK,close:sK,attachment:OIe,image:PIe,video:$Ie,fullscreen:BIe,quote:zIe};function Al(e,t="md"){const n=jIe[t];return HIe[e].replace(/]*>/,i=>i.replace(/\s(?:width|height)="[^"]*"/g,"")).replace(/^
      ↩︎`}function Fde(e){const t=e.helpers.parseLinkLabel,n=e.utils.isSpace;e.renderer.rules.footnote_ref=Ide,e.renderer.rules.footnote_block_open=Mde,e.renderer.rules.footnote_block_close=Tde,e.renderer.rules.footnote_open=Ede,e.renderer.rules.footnote_close=Lde,e.renderer.rules.footnote_anchor=Nde,e.renderer.rules.footnote_caption=_de,e.renderer.rules.footnote_anchor_name=Sde;function i(l,a,u,c){const d=l.bMarks[a]+l.tShift[a],f=l.eMarks[a];if(d+4>f||l.src.charCodeAt(d)!==91||l.src.charCodeAt(d+1)!==94)return!1;let h;for(h=d+2;h=f||l.src.charCodeAt(++h)!==58)return!1;if(c)return!0;h++,l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.refs||(l.env.footnotes.refs={});const m=l.src.slice(d+2,h-2);l.env.footnotes.refs[`:${m}`]=-1;const g=new l.Token("footnote_reference_open","",1);g.meta={label:m},g.level=l.level++,l.tokens.push(g);const y=l.bMarks[a],k=l.tShift[a],v=l.sCount[a],C=l.parentType,w=h,M=l.sCount[a]+h-(l.bMarks[a]+l.tShift[a]);let L=M;for(;h=u||l.src.charCodeAt(c)!==94||l.src.charCodeAt(c+1)!==91)return!1;const d=c+2,f=t(l,c+1);if(f<0)return!1;if(!a){l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.list||(l.env.footnotes.list=[]);const h=l.env.footnotes.list.length,m=[];l.md.inline.parse(l.src.slice(d,f),l.md,l.env,m);const g=l.push("footnote_ref","",0);g.meta={id:h},l.env.footnotes.list[h]={content:l.src.slice(d,f),tokens:m}}return l.pos=f+1,l.posMax=u,!0}function s(l,a){const u=l.posMax,c=l.pos;if(c+3>u||!l.env.footnotes||!l.env.footnotes.refs||l.src.charCodeAt(c)!==91||l.src.charCodeAt(c+1)!==94)return!1;let d;for(d=c+2;d=u)return!1;d++;const f=l.src.slice(c+2,d-1);if(typeof l.env.footnotes.refs[`:${f}`]>"u")return!1;if(!a){l.env.footnotes.list||(l.env.footnotes.list=[]);let h;l.env.footnotes.refs[`:${f}`]<0?(h=l.env.footnotes.list.length,l.env.footnotes.list[h]={label:f,count:0},l.env.footnotes.refs[`:${f}`]=h):h=l.env.footnotes.refs[`:${f}`];const m=l.env.footnotes.list[h].count;l.env.footnotes.list[h].count++;const g=l.push("footnote_ref","",0);g.meta={id:h,subId:m,label:f}}return l.pos=d,l.posMax=u,!0}function r(l){let a,u,c,d=!1;const f={};if(!l.env.footnotes||(l.tokens=l.tokens.filter(function(m){return m.type==="footnote_reference_open"?(d=!0,u=[],c=m.meta.label,!1):m.type==="footnote_reference_close"?(d=!1,f[":"+c]=u,!1):(d&&u.push(m),!d)}),!l.env.footnotes.list))return;const h=l.env.footnotes.list;l.tokens.push(new l.Token("footnote_block_open","",1));for(let m=0,g=h.length;m0?h[m].count:1;for(let C=0;C?@[\]^_`{|}~-])/g;function Pde(e,t){const n=e.posMax,i=e.pos;if(e.src.charCodeAt(i)!==94||t||i+2>=n)return!1;e.pos=i+1;let o=!1;for(;e.pos{t.exports=function(g,y){y=Object.assign({},{disabled:!0,divWrap:!1,divClass:"checkbox",idPrefix:"cbx_",ulClass:"task-list",liClass:"task-list-item"},y),g.core.ruler.after("inline","github-task-lists",function(k){for(var v=k.tokens,C=0,w=2;w=0;v--)if(g[v].level===k)return v;return-1}function o(g,y){return d(g[y])&&f(g[y-1])&&h(g[y-2])&&m(g[y])}function s(g,y,k,v){var C=k.idPrefix+y;g.children[0].content=g.children[0].content.slice(3),g.children.unshift(l(C,v)),g.children.push(a(v)),g.children.unshift(r(g,C,k,v)),k.divWrap&&(g.children.unshift(u(k,v)),g.children.push(c(v)))}function r(g,y,k,v){var C=new v("checkbox_input","input",0);return C.attrs=[["type","checkbox"],["id",y]],/^\[[xX]\][ \u00A0]/.test(g.content)===!0&&C.attrs.push(["checked","true"]),k.disabled===!0&&C.attrs.push(["disabled","true"]),C}function l(g,y){var k=new y("label_open","label",1);return k.attrs=[["for",g]],k}function a(g){return new g("label_close","label",-1)}function u(g,y){var k=new y("checkbox_open","div",0);return k.attrs=[["class",g.divClass]],k}function c(g){return new g("checkbox_close","div",-1)}function d(g){return g.type==="inline"}function f(g){return g.type==="paragraph_open"}function h(g){return g.type==="list_item_open"}function m(g){return/^\[[xX \u00A0]\][ \u00A0]/.test(g.content)}})});const zde=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function jde(e){return e>=55296&&e<=57343||e>1114111?65533:zde.get(e)??e}function Hde(e){const t=atob(e),n=t.length&-2,i=new Uint16Array(n/2);for(let o=0,s=0;o=ko.ZERO&&e<=ko.NINE}function qde(e){return e>=ko.UPPER_A&&e<=ko.UPPER_F||e>=ko.LOWER_A&&e<=ko.LOWER_F}function Ude(e){return e>=ko.UPPER_A&&e<=ko.UPPER_Z||e>=ko.LOWER_A&&e<=ko.LOWER_Z||aA(e)}function Vde(e){return e===ko.EQUALS||Ude(e)}var Ks;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(Ks||(Ks={}));var Gd;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Gd||(Gd={}));var Kde=class{decodeTree;emitCodePoint;errors;constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n}state=Ks.EntityStart;consumed=1;result=0;treeIndex=0;excess=1;decodeMode=Gd.Strict;runConsumed=0;startEntity(e){this.decodeMode=e,this.state=Ks.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1,this.runConsumed=0}write(e,t){switch(this.state){case Ks.EntityStart:return e.charCodeAt(t)===ko.NUM?(this.state=Ks.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=Ks.NamedEntity,this.stateNamedEntity(e,t));case Ks.NumericStart:return this.stateNumericStart(e,t);case Ks.NumericDecimal:return this.stateNumericDecimal(e,t);case Ks.NumericHex:return this.stateNumericHex(e,t);case Ks.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|IE)===ko.LOWER_X?(this.state=Ks.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=Ks.NumericDecimal,this.stateNumericDecimal(e,t))}stateNumericHex(e,t){for(;t>14;for(;t>7;if(this.runConsumed===0){const l=i&qr.JUMP_TABLE;if(e.charCodeAt(t)!==l)return this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}for(;this.runConsumed=e.length)return-1;const l=this.runConsumed-1,a=n[this.treeIndex+1+(l>>1)],u=l%2===0?a&255:a>>8&255;if(e.charCodeAt(t)!==u)return this.runConsumed=0,this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}this.runConsumed=0,this.treeIndex+=1+(r>>1),i=n[this.treeIndex],o=(i&qr.VALUE_LENGTH)>>14}if(t>=e.length)break;const s=e.charCodeAt(t);if(s===ko.SEMI&&o!==0&&(i&qr.FLAG13)!==0)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);if(this.treeIndex=Gde(n,i,this.treeIndex+Math.max(1,o),s),this.treeIndex<0)return this.result===0||this.decodeMode===Gd.Attribute&&(o===0||Vde(s))?0:this.emitNotTerminatedNamedEntity();if(i=n[this.treeIndex],o=(i&qr.VALUE_LENGTH)>>14,o!==0){if(s===ko.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==Gd.Strict&&(i&qr.FLAG13)===0&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}t++,this.excess++}return-1}emitNotTerminatedNamedEntity(){const{result:e,decodeTree:t}=this,n=(t[e]&qr.VALUE_LENGTH)>>14;return this.emitNamedEntityData(e,n,this.consumed),this.errors?.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){const{decodeTree:i}=this;return this.emitCodePoint(t===1?i[e]&~(qr.VALUE_LENGTH|qr.FLAG13):i[e+1],n),t===3&&this.emitCodePoint(i[e+2],n),n}end(){switch(this.state){case Ks.NamedEntity:return this.result!==0&&(this.decodeMode!==Gd.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Ks.NumericDecimal:return this.emitNumericEntity(0,2);case Ks.NumericHex:return this.emitNumericEntity(0,3);case Ks.NumericStart:return this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Ks.EntityStart:return 0}}};function Zde(e){let t="";const n=new Kde(e,i=>t+=String.fromCodePoint(i));return function(o,s){let r=0,l=0;for(;(l=o.indexOf("&",l))>=0;){t+=o.slice(r,l),n.startEntity(s);const u=n.write(o,l+1);if(u<0){r=l+n.end();break}r=l+u,l=u===0?r+1:r}const a=t+o.slice(r);return t="",a}}function Gde(e,t,n,i){const o=(t&qr.BRANCH_LENGTH)>>7,s=t&qr.JUMP_TABLE;if(o===0)return s!==0&&i===s?n:-1;if(s){const u=i-s;return u<0||u>=o?-1:e[n+u]-1}const r=o+1>>1;let l=0,a=o-1;for(;l<=a;){const u=l+a>>>1,c=e[n+(u>>1)]>>(u&1)*8&255;if(ci)a=u-1;else return e[n+r+u]}return-1}const Qde=Zde(Wde);function nx(e,t=Gd.Legacy){return Qde(e,t)}var Yde=zj($de());const ME={};function Jde(e){let t=ME[e];if(t)return t;t=ME[e]=[];for(let n=0;n<128;n++){const i=String.fromCharCode(n);t.push(i)}for(let n=0;n=55296&&c<=57343?o+="���":o+=String.fromCharCode(c),s+=6;continue}}if((l&248)===240&&s+91114111?o+="����":(d-=65536,o+=String.fromCharCode(55296+(d>>10),56320+(d&1023))),s+=9;continue}}o+="�"}return o})}F4.defaultChars=";/?:@&=+$,#";F4.componentChars="";var uA=F4;const TE={};function Xde(e){let t=TE[e];if(t)return t;t=TE[e]=[];for(let n=0;n<128;n++){const i=String.fromCharCode(n);/^[0-9a-z]$/i.test(i)?t.push(i):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n"u"&&(n=!0);const i=Xde(t);let o="";for(let s=0,r=e.length;s=55296&&l<=57343){if(l>=55296&&l<=56319&&s+1=56320&&a<=57343){o+=encodeURIComponent(e[s]+e[s+1]),s++;continue}}o+="%EF%BF%BD";continue}o+=encodeURIComponent(e[s])}return o}D4.defaultChars=";/?:@&=+$,-_.!~*'()#";D4.componentChars="-_.!~*'()";var jj=D4;function ix(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function Kk(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const efe=/^([a-z0-9.+-]+:)/i,tfe=/:[0-9]*$/,nfe=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,ife=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",` +`," "]),ofe=["'"].concat(ife),EE=["%","/","?",";","#"].concat(ofe),LE=["/","?","#"],sfe=255,NE=/^[+a-z0-9A-Z_-]{0,63}$/,rfe=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,FE={javascript:!0,"javascript:":!0},DE={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function lfe(e,t){if(e&&e instanceof Kk)return e;const n=new Kk;return n.parse(e,t),n}Kk.prototype.parse=function(e,t){let n,i,o,s=e;if(s=s.trim(),!t&&e.split("#").length===1){const u=nfe.exec(s);if(u)return this.pathname=u[1],u[2]&&(this.search=u[2]),this}let r=efe.exec(s);if(r&&(r=r[0],n=r.toLowerCase(),this.protocol=r,s=s.substr(r.length)),(t||r||s.match(/^\/\/[^@\/]+@[^@\/]+/))&&(o=s.substr(0,2)==="//",o&&!(r&&FE[r])&&(s=s.substr(2),this.slashes=!0)),!FE[r]&&(o||r&&!DE[r])){let u=-1;for(let m=0;m127?v+="x":v+=k[C];if(!v.match(NE)){const C=m.slice(0,g),w=m.slice(g+1),M=k.match(rfe);M&&(C.push(M[1]),w.unshift(M[2])),w.length&&(s=w.join(".")+s),this.hostname=C.join(".");break}}}}this.hostname.length>sfe&&(this.hostname=""),h&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const l=s.indexOf("#");l!==-1&&(this.hash=s.substr(l),s=s.slice(0,l));const a=s.indexOf("?");return a!==-1&&(this.search=s.substr(a),s=s.slice(0,a)),s&&(this.pathname=s),DE[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};Kk.prototype.parseHost=function(e){let t=tfe.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var ox=lfe,Hj=Ade({decode:()=>uA,encode:()=>jj,format:()=>ix,parse:()=>ox}),afe=Object.defineProperty,Wj=e=>{let t={};for(var n in e)afe(t,n,{get:e[n],enumerable:!0});return t},Ns=class{type;tag;attrs;map;nesting;level;children;content;markup;info;meta;block;hidden;constructor(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}attrIndex(e){if(!this.attrs)return-1;const t=this.attrs;for(let n=0,i=t.length;n=0&&(n=this.attrs[t][1]),n}attrJoin(e,t){const n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=`${this.attrs[n][1]} ${t}`}},ufe=Wj({arrayReplaceAt:()=>gfe,assign:()=>pfe,countLines:()=>Mo,escapeHtml:()=>Sfe,escapeRE:()=>Ife,fromCodePoint:()=>Mv,has:()=>hfe,isMdAsciiPunct:()=>Qk,isPunctChar:()=>Gk,isPunctCode:()=>cA,isSpace:()=>mfe,isString:()=>dfe,isValidEntityCode:()=>O4,isWhiteSpace:()=>Iv,lib:()=>Mfe,mdurl:()=>Hj,normalizeReference:()=>R4,ucmicro:()=>Zk,unescapeAll:()=>Tv,unescapeMd:()=>bfe});const Zk={Any:/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Cc:/[\0-\x1F\x7F-\x9F]/,Cf:/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,P:/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,S:/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,Z:/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/};function cfe(e){return Object.prototype.toString.call(e)}function dfe(e){return cfe(e)==="[object String]"}const ffe=Object.prototype.hasOwnProperty;function hfe(e,t){return ffe.call(e,t)}function pfe(e,...t){return t.forEach(n=>{if(n){if(typeof n!="object")throw new TypeError(`${String(n)}must be object`);Object.keys(n).forEach(i=>{e[i]=n[i]})}}),e}function mfe(e){return e===9||e===32}function Iv(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function Gk(e){return Zk.P.test(e)||Zk.S.test(e)}const RE=new Map;function cA(e){if(Qk(e))return!0;if(e>=0&&e<128)return!1;const t=RE.get(e);if(t!==void 0)return t;const n=Gk(String.fromCharCode(e));return RE.set(e,n),n}function Qk(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function R4(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function gfe(e,t,n){return[...e.slice(0,t),...n,...e.slice(t+1)]}function O4(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function Mv(e){if(e>65535){e-=65536;const t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}const qj=/\\([!"#$%&'()*+,\-\./:;<=>?@[\\\]^_`{|}~])/g,vfe=new RegExp(`${qj.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),yfe=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function kfe(e,t){if(t.charCodeAt(0)===35&&yfe.test(t)){const i=t[1].toLowerCase()==="x"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return O4(i)?Mv(i):e}const n=nx(e);return n!==e?n:e}function bfe(e){return e.includes("\\")?e.replace(qj,"$1"):e}function Tv(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(vfe,(t,n,i)=>n||kfe(t,i))}const wfe=/[&<>"]/,Cfe=/[&<>"]/g,Afe={"&":"&","<":"<",">":">",'"':"""};function xfe(e){return Afe[e]}function Sfe(e){return wfe.test(e)?e.replace(Cfe,xfe):e}const _fe=/[.?*+^$[\]\\(){}|-]/g;function Ife(e){return e.replace(_fe,"\\$&")}const Mfe={mdurl:Hj,ucmicro:Zk};function Mo(e){if(e.length===0)return 0;let t=0,n=-1;for(;(n=e.indexOf(` +`,n+1))!==-1;)t++;return t}const Tfe=/(?:^|\n)[ \t]{0,3}\[\^[^\]\n]+\]:/m,Efe=/(?:^|\n)[ \t]{0,3}\*\[[^\]\n]+\]:/m,Lfe=/(?:^|\n)[ \t]{0,3}\[(?!\^)(?:\\[\s\S]|[^\]\\[])+\][ \t]*:/m,sx=["references","footnotes","abbreviations","abbr","abbrs"],rx=Symbol.for("markdown-it-ts.global-state"),lx=Object.prototype.hasOwnProperty;function OE(e){return e==="reference-definition"||e==="footnote-definition"||e==="abbreviation-definition"}function pu(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function uf(e){if(Array.isArray(e))return e.map(t=>uf(t));if(pu(e)){const t={};for(const n of Object.keys(e))t[n]=uf(e[n]);return t}return e}function Yk(e){return Array.isArray(e)?e.map((t,n)=>String(n)):pu(e)?Object.keys(e):[]}function dA(e,t){if(Array.isArray(e)||Array.isArray(t)){if(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;ns.has(r)?!dA(o[r],Uj(i.value,r)):!0)}}function ad(e){const t=ax(e);if(t){for(const n of sx){const i=t.snapshot[n];if(!i){delete e[n];continue}if(i.ownedKeys){Ffe(e,n,i);continue}i.existed?e[n]=Nfe(e[n],i.value):delete e[n]}delete e[rx]}}function R3(e){return{area:e,attempted:!0,matched:!1,attemptMs:0,blocks:0,headings:0,paragraphs:0,lists:0,fences:0,paragraphCacheHits:0,paragraphCacheMisses:0,paragraphCacheBypasses:0,listCacheHits:0,listCacheMisses:0,fenceCacheHits:0,fenceCacheMisses:0}}const fA=Symbol.for("markdown-it-ts.diagnostics");function c2(e,t){if(e)try{const n=e[fA];if(n&&typeof n=="object")return n;if(!t)return;const i={};return e[fA]=i,i}catch{return}}function Bc(e){return c2(e,!1)}function Rfe(e){if(e)try{const t=e[fA];t&&typeof t=="object"&&(delete t.strategy,delete t.chunk,delete t.unbounded,delete t.editable,delete t.stockFast)}catch{}}function Ur(e){Rfe(e)}function Dg(e,t){const n=c2(e,!0);n&&(n.stockFast=t)}function ts(e,t){const n=c2(e,!0);n&&(n.strategy=t)}function O3(e,t){const n=c2(e,!0);n&&(n.chunk=t)}function Vj(e,t){const n=c2(e,!0);n&&(n.unbounded=t)}const Ofe=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Pfe=/[\0-\x1F\x7F-\x9F]/,Bfe=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B4E\u1B4F\u1B5A-\u1B60\u1B7D-\u1B7F\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDD6E\uDEAD\uDED0\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9\uDFD4\uDFD5\uDFD7\uDFD8]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09\uDFE1]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDD6D-\uDD6F\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD839\uDDFF|\uD83A[\uDD5E\uDD5F]/,$fe=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;var zfe=class{src_Any=Ofe.source;src_Cc=Pfe.source;src_Z=$fe.source;src_P=Bfe.source;src_ZPCc=[this.src_Z,this.src_P,this.src_Cc].join("|");src_ZCc=[this.src_Z,this.src_Cc].join("|");cache={};opts={maxLength:1e4,urlAuth:!1,schema_names:[]};constructor(e={}){this.opts={...this.opts,...e}}set(e={}){return this.opts={...this.opts,...e},this.cache={},this}escapeRE(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}nestedPairRE(e,t,n=4){const i=this.escapeRE(e),o=this.escapeRE(t),s=`(?:(?!${this.src_ZCc}|${i}|${o}).)`;let r=`${i}${s}{0,1000}${o}`;for(let l=2;l<=n;l++)r=`${i}(?:${s}|${r}){0,1000}${o}`;return r}get_text_separators(){return this.cache.text_separators??=/[><\uff5c]/}get_pseudo_letter(){return this.cache.src_pseudo_letter??=new RegExp(`(?:(?!${this.get_text_separators().source}|${this.src_ZPCc})${this.src_Any})`)}get_ipv4_addr(){return this.cache.src_ip4??=new RegExp("(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])[.]){3}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])")}get_ipv6_addr(){const e="[0-9A-Fa-f]{1,4}",t=`(?:(?:${e}:${e})|${this.get_ipv4_addr().source})`;return this.cache.src_ip6_addr??=new RegExp(`(?:(?:${e}:){6}${t}|::(?:${e}:){5}${t}|(?:${e})?::(?:${e}:){4}${t}|(?:(?:${e}:){0,1}${e})?::(?:${e}:){3}${t}|(?:(?:${e}:){0,2}${e})?::(?:${e}:){2}${t}|(?:(?:${e}:){0,3}${e})?::${e}:${t}|(?:(?:${e}:){0,4}${e})?::${t}|(?:(?:${e}:){0,5}${e})?::${e}|(?:(?:${e}:){0,6}${e})?::)`)}get_ipv6_url_host(){return this.cache.src_ip6_host??=new RegExp(`\\[${this.get_ipv6_addr().source}\\]`)}get_ipv6_mail_host(){return this.cache.src_ipv6_mail_host??=new RegExp(`\\[IPv6:${this.get_ipv6_addr().source}\\]`)}get_auth(){return this.cache.src_auth??=new RegExp(`(?:(?:(?!${this.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`)}get_port(){return this.cache.src_port??=new RegExp("(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?")}get_host_terminator(){return this.cache.src_host_terminator??=new RegExp(`(?=$|${this.get_text_separators().source}|${this.src_ZPCc})(?!${this.opts["---"]?"-(?!--)|":"-|"}_|:\\d|\\.-|\\.(?!$|${this.src_ZPCc}))`)}get_path_terminator(){return this.cache.src_path_terminator??=new RegExp(`${this.src_ZPCc}|${this.get_text_separators().source}`)}get_path(){return this.cache.src_path??=new RegExp(`(?:[/?#](?:${this.nestedPairRE("[","]")}|${this.nestedPairRE("(",")")}|${this.nestedPairRE("{","}")}|\\"(?:(?!${this.src_ZCc}|["]).){1,100}\\"|\\'(?:(?!${this.src_ZCc}|[']).){1,100}\\'|\\'(?=${this.get_pseudo_letter().source}|[-])|\\.{2,20}[:]?[a-zA-Z0-9%/&]|\\.(?!${this.src_ZCc}|[.]|$)|`+(this.opts["---"]?"\\-(?!--(?:[^-]|$))(?:-{0,19})|":"\\-{1,20}|")+`,(?!${this.src_ZCc}|$)|;(?!${this.src_ZCc}|$)|\\!{1,20}(?!${this.src_ZCc}|[!]|$)|\\?(?!${this.src_ZCc}|[?]|$)|`+this.get_path_extra().source+`[\\\\/:%@#&=_~*]|(?!${this.get_path_terminator().source}).){1,${this.opts.maxLength}}|\\/)?`)}get_mail_name(){return this.cache.src_mail_name??=new RegExp("[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9](?:[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9]|[.](?=[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9])){0,63}")}get_xn(){return this.cache.src_xn??=new RegExp("xn--[a-z0-9\\-]{1,59}")}get_tld(){if(this.cache.tld)return this.cache.tld;const e=[...new Set(this.opts.tlds||[])].sort().reverse().join("|");return this.cache.tld=new RegExp(`${e||"$#none#$"}|${this.get_xn().source}`),this.cache.tld}get_domain_root(){return this.cache.src_domain_root??=new RegExp("(?:"+this.get_xn().source+`|${this.get_pseudo_letter().source}{1,63})`)}get_domain(){return this.cache.src_domain??=new RegExp("(?:"+this.get_xn().source+`|(?:${this.get_pseudo_letter().source})|(?:${this.get_pseudo_letter().source}(?:-|${this.get_pseudo_letter().source}){0,61}${this.get_pseudo_letter().source}))`)}get_url_host_port(){return this.cache.url_host_port??=new RegExp("(?:"+this.get_ipv6_url_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,10}${this.get_domain().source}))`+this.get_port().source+this.get_host_terminator().source)}get_fuzzy_url_host_port(){return this.cache.fuzzy_url_host_port??=new RegExp("(?:"+(this.opts.fuzzyIP?this.get_ipv4_addr().source+"|":"")+`(?:(?:(?:${this.get_domain().source})\\.){1,10}(?:${this.get_tld().source})))`+this.get_host_terminator().source)}get_mail_host(){return this.cache.src_mail_host??=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,4}${this.get_domain().source}))`+this.get_host_terminator().source)}get_fuzzy_mail_host(){return this.cache.src_fuzzy_mail_host??=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})[.]){1,4}${this.get_domain_root().source}))`+this.get_host_terminator().source)}get_path_extra(){return this.cache.src_path_extra??=new RegExp("")}get_fuzzy_mail_host_search(){return this.cache.mail_fuzzy_host_search??=new RegExp(`@${this.get_fuzzy_mail_host().source}`,"ig")}get_fuzzy_link_search(){return this.cache.link_fuzzy_search??=new RegExp(`(^|(?![.:/\\-_@])(?:[$+<=>^\`||]|${this.src_ZPCc}))(?:(?![$+<=>^\`||])${this.get_fuzzy_url_host_port().source}${this.get_path().source})`,"ig")}get_http_validator(){return this.cache.http_validator??=new RegExp("\\/\\/"+(this.opts.urlAuth?this.get_auth().source:"")+this.get_url_host_port().source+this.get_path().source,"iy")}get_relative_proto_validator(){return this.cache.relative_proto_validator??=new RegExp((this.opts.urlAuth?this.get_auth().source:"")+`(?:localhost|${this.get_ipv6_url_host().source}|(?:(?:${this.get_domain().source})[.]){1,10}${this.get_domain_root().source})`+this.get_port().source+this.get_host_terminator().source+this.get_path().source,"iy")}get_mail_name_validator(){return this.cache.mail_name_validator??=new RegExp(`(?:^|${this.get_text_separators().source}|"|\\(|${this.src_ZCc})(${this.get_mail_name().source})$`)}get_mailto_validator(){return this.cache.mailto_validator??=new RegExp(`${this.get_mail_name().source}@${this.get_mail_host().source}`,"iy")}get_schema_names(){return this.cache.schema_names??=new RegExp((this.opts.schema_names||[]).map(e=>this.escapeRE(e)).join("|"))}get_schema_search(){return this.cache.schema_search??=new RegExp(`(^|(?!_)(?:[><|]|${this.src_ZPCc}))(${this.get_schema_names().source})`,"ig")}get_schema_at_start(){return this.cache.schema_at_start??=new RegExp(`^${this.get_schema_search().source}`,"i")}},P3={validate:(e,t,n)=>{const i=n.re.get_http_validator();i.lastIndex=t;const o=i.exec(e);return o?o[0].length:0},normalize:(e,t)=>t.normalize(e)},jfe={"http:":P3,"https:":P3,"ftp:":P3,"//":{validate:function(e,t,n){const i=n.re.get_relative_proto_validator();i.lastIndex=t;const o=i.exec(e);return o?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:o[0].length:0},normalize:(e,t)=>t.normalize(e)},"mailto:":{validate:function(e,t,n){const i=n.re.get_mailto_validator();i.lastIndex=t;const o=i.exec(e);return o?o[0].length:0},normalize:(e,t)=>t.normalize(e)}},Hfe="a:cdefgilmnoqrstuwxz|b:abdefghijmnorstvwyz|c:acdfghiklmnoruvwxyz|d:ejkmoz|e:cegrstu|f:ijkmor|g:abdefghilmnpqrstuwy|h:kmnrtu|i:delmnoqrst|j:emop|k:eghimnprwyz|l:abcikrstuvy|m:acdeghklmnopqrstuvwxyz|n:acefgilopruz|o:m|p:aefghklmnrstwy|q:a|r:eosuw|s:abcdeghijklmnortuvxyz|t:cdfghjklmnortvwz|u:agksyz|v:aceginu|w:fs|y:et|z:amw",Wfe="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф";function qfe(){const e=Wfe.split("|");return Hfe.split("|").forEach(t=>{const n=t.indexOf(":"),i=t.slice(0,n);for(const o of t.slice(n+1))e.push(i+o)}),e}var Ufe={fuzzyLink:!1,fuzzyEmail:!0,fuzzyIP:!1,"---":!1,tlds:qfe(),urlAuth:!1,maxLength:1e4},PE=class{schema;index;lastIndex;raw;text;url;constructor(e,t,n,i){const o=e.slice(n,i);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=i,this.raw=o,this.text=o,this.url=o}},Kj=class{__opts__;__schemas__;re;constructor(e={}){const{rebuilder:t,...n}=e;this.__opts__={...Ufe,...n},this.__schemas__={...jfe},this.re=t||new zfe,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)})}add(e,t=null){if(!t)delete this.__schemas__[e];else{const n={normalize:(i,o)=>o.normalize(i),...t};this.__schemas__[e]=n}return this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}set(e={}){return this.__opts__={...this.__opts__,...e},this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}test(e){if(!e.length)return!1;let t,n;for(n=this.re.get_schema_search(),n.lastIndex=0;(t=n.exec(e))!==null;)if(this.testSchemaAt(e,t[2],n.lastIndex))return!0;if(this.__opts__.fuzzyLink&&this.__schemas__["http:"]&&(n=this.re.get_fuzzy_link_search(),n.lastIndex=0,n.exec(e)!==null))return!0;if(this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"]&&e.indexOf("@")>=0){const i=this.re.get_fuzzy_mail_host_search(),o=this.re.get_mail_name_validator();for(i.lastIndex=0;(t=i.exec(e))!==null;){const s=e.slice(Math.max(0,t.index-65),t.index);if(o.test(s))return!0}}return!1}testSchemaAt(e,t,n){return this.__schemas__[t.toLowerCase()]?this.__schemas__[t.toLowerCase()].validate(e.slice(0,n+this.__opts__.maxLength),n,this):0}match(e){const t=[],n=this.re.get_schema_search();let i,o,s,r,l,a,u=!1,c=!1,d=!1,f=0;if(!e.length)return null;for(n.lastIndex=0,this.__opts__.fuzzyLink&&this.__schemas__["http:"]&&(i=this.re.get_fuzzy_link_search(),i.lastIndex=0),this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"]&&(o=this.re.get_fuzzy_mail_host_search(),o.lastIndex=0,s=this.re.get_mail_name_validator());;){const h=Math.max(f-1,0);if(o&&s&&!d&&(!l||l.index=f)break;o.lastIndex=f)break;i.lastIndexm.lastIndex))&&(m=r);let g;if(!u)for(;;){if(!a){n.lastIndexm.index)break;const v=a;a=void 0;const C=this.testSchemaAt(e,v.schema,v.lastIndex);if(C){g={schema:v.schema,index:v.index,lastIndex:v.lastIndex+C};break}}let y=g;if((!y||l&&(l.indexy.lastIndex))&&(y=l),(!y||r&&(r.indexy.lastIndex))&&(y=r),!y)break;y===l?l=void 0:y===r&&(r=void 0);const k=new PE(e,y.schema,y.index,y.lastIndex);k.schema?this.__schemas__[k.schema].normalize(k,this):this.normalize(k),t.push(k),f=y.lastIndex}return t.length?t:null}matchAtStart(e){if(!e.length)return null;const t=this.re.get_schema_at_start().exec(e);if(!t)return null;const n=this.testSchemaAt(e,t[2],t[0].length);if(!n)return null;const i=new PE(e,t[2],t.index+t[1].length,t.index+t[0].length+n);return this.__schemas__[i.schema].normalize(i,this),i}tlds(e,t=!1){return e=Array.isArray(e)?e:[e],t?this.__opts__.tlds=this.__opts__.tlds.concat(e):this.__opts__.tlds=e,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}normalize(e){e.schema||(e.url=`http://${e.url}`),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:${e.url}`)}},Vfe=$j({"../../node_modules/.pnpm/punycode.js@2.3.1/node_modules/punycode.js/punycode.js":((e,t)=>{const d=/^xn--/,f=/[^\0-\x7F]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,m={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},g=35,y=Math.floor,k=String.fromCharCode;function v(R){throw new RangeError(m[R])}function C(R,F){const P=[];let z=R.length;for(;z--;)P[z]=F(R[z]);return P}function w(R,F){const P=R.split("@");let z="";P.length>1&&(z=P[0]+"@",R=P[1]),R=R.replace(h,".");const W=C(R.split("."),F).join(".");return z+W}function M(R){const F=[];let P=0;const z=R.length;for(;P=55296&&W<=56319&&PString.fromCodePoint(...R),E=function(R){return R>=48&&R<58?26+(R-48):R>=65&&R<91?R-65:R>=97&&R<123?R-97:36},S=function(R,F){return R+22+75*(R<26)-((F!=0)<<5)},x=function(R,F,P){let z=0;for(R=P?y(R/700):R>>1,R+=y(R/F);R>g*26>>1;z+=36)R=y(R/g);return y(z+(g+1)*R/(R+38))},A=function(R){const F=[],P=R.length;let z=0,W=128,$=72,K=R.lastIndexOf("-");K<0&&(K=0);for(let ne=0;ne=128&&v("not-basic"),F.push(R.charCodeAt(ne));for(let ne=K>0?K+1:0;ne=P&&v("invalid-input");const _e=E(R.charCodeAt(ne++));_e>=36&&v("invalid-input"),_e>y((2147483647-z)/le)&&v("overflow"),z+=_e*le;const Z=ie<=$?1:ie>=$+26?26:ie-$;if(_ey(2147483647/se)&&v("overflow"),le*=se}const te=F.length+1;$=x(z-G,te,G==0),y(z/te)>2147483647-W&&v("overflow"),W+=y(z/te),z%=te,F.splice(z++,0,W)}return String.fromCodePoint(...F)},T=function(R){const F=[];R=M(R);const P=R.length;let z=128,W=0,$=72;for(const G of R)G<128&&F.push(k(G));const K=F.length;let ne=K;for(K&&F.push("-");ne=z&&ley((2147483647-W)/te)&&v("overflow"),W+=(G-z)*te,z=G;for(const le of R)if(le2147483647&&v("overflow"),le===z){let ie=W;for(let _e=36;;_e+=36){const Z=_e<=$?1:_e>=$+26?26:_e-$;if(ie32))return s;if(i===41){if(r===0)break;r--}o++}return t===o||r!==0||(s.str=Tv(e.slice(t,o)),s.pos=o,s.ok=!0),s}var Gj=dx;const E9=-2;function Kfe(e,t,n,i){let o=1,s=t+1;for(;s=0&&t+1>=c)return-1;const d=l.indexOf("]",t+1);if(d<0||d>=a)return e.linkLabelNoCloseFrom=t+1,-1;const f=Kfe(l,t,a,n);if(f!==E9)return f;for(e.pos=t+1;e.pos=n)return r;let l=e.charCodeAt(s);if(l!==34&&l!==39&&l!==40)return r;t++,s++,l===40&&(l=41),r.marker=l}for(;s=0?e.attrs[n][1]:null}function Qfe(e,t,n){const i=P4(e,t);i<0?px(e,[t,n]):e.attrs[i][1]=`${e.attrs[i][1]} ${n}`}var Yfe=Wj({attrGet:()=>Gfe,attrIndex:()=>P4,attrJoin:()=>Qfe,attrPush:()=>px,attrSet:()=>Zfe,parseLinkDestination:()=>dx,parseLinkLabel:()=>fx,parseLinkTitle:()=>hx});function Jfe(e){return e.includes("\r")||e.includes("\0")}function Yj(e){return typeof e=="string"?e:e.toString()}function Xfe(e){if(e.inlineMode){const t=new Ns("inline","",0);t.content=Yj(e.src),t.map=[0,1],t.children=[],t.level=0,e.tokens.push(t)}else e.md&&e.md.block&&e.md.block.parse(e.src,e.md,e.env,e.tokens)}const ehe=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,the=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function nhe(e,t){let n=e.pos;const i=e.src;if(i.charCodeAt(n)!==60)return!1;const o=n,s=e.posMax;for(;;){if(++n>=s)return!1;const l=i.charCodeAt(n);if(l===60)return!1;if(l===62)break}const r=i.slice(o+1,n);if(the.test(r)){const l=e.md.normalizeLink(r);if(!e.md.validateLink(l))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",l]],a.markup="autolink",a.info="auto";const u=e.push("text","",0);u.content=e.md.normalizeLinkText(r);const c=e.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return e.pos+=r.length+2,!0}if(ehe.test(r)){const l=e.md.normalizeLink(`mailto:${r}`);if(!e.md.validateLink(l))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",l]],a.markup="autolink",a.info="auto";const u=e.push("text","",0);u.content=e.md.normalizeLinkText(r);const c=e.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return e.pos+=r.length+2,!0}return!1}var Jj=nhe;function ihe(e,t){const n=e.src;let i=e.pos;if(n.charCodeAt(i)!==96)return!1;const o=i;i++;const s=e.posMax;for(;i2&&f.charCodeAt(0)===32&&f.charCodeAt(f.length-1)===32&&(f=f.slice(1,-1)),d.content=f}return e.pos=a,!0}e.backticks[c]=u}return e.backticksScanned=!0,t||(e.pending+=r),e.pos+=l,!0}var Xj=ihe;function BE(e){const t={},n=e.length;if(!n)return;let i=0,o=-2;const s=[];for(let r=0;ra;u-=s[u]+1){const d=e[u];if(d.marker===l.marker&&d.open&&d.end<0){let f=!1;if((d.close||l.open)&&(d.length+l.length)%3===0&&(d.length%3!==0||l.length%3!==0)&&(f=!0),!f){const h=u>0&&!e[u-1].open?s[u-1]+1:0;s[r]=r-u+h,s[u]=h,l.open=!1,d.end=r,d.close=!1,c=-1,o=-2;break}}}c!==-1&&(t[l.marker][(l.open?3:0)+(l.length||0)%3]=c)}}function ohe(e){const t=e.tokens_meta,n=e.tokens_meta.length;BE(e.delimiters);for(let i=0;i=0;o--){const s=t[o],r=s.marker;if(r!==95&&r!==42||s.end===-1)continue;const l=t[s.end],a=s.token,u=l.token,c=o>0&&t[o-1].end===s.end+1&&t[o-1].marker===r&&t[o-1].token===a-1&&t[s.end+1].token===u+1,d=r===42?eH:tH,f=i[a];c?(f.type="strong_open",f.tag="strong",f.nesting=1,f.markup=d+d,f.content=""):(f.type="em_open",f.tag="em",f.nesting=1,f.markup=d,f.content="");const h=i[u];c?(h.type="strong_close",h.tag="strong",h.nesting=-1,h.markup=d+d,h.content=""):(h.type="em_close",h.tag="em",h.nesting=-1,h.markup=d,h.content=""),c&&(i[t[o-1].token].content="",i[t[s.end+1].token].content="",o--)}}function lhe(e){const t=e.tokens_meta,n=e.tokens_meta.length;$E(e,e.delimiters);for(let i=0;i=48&&e<=57}function ahe(e){const t=e|32;return mx(e)||t>=97&&t<=102}function iH(e){const t=e|32;return t>=97&&t<=122}function uhe(e){return iH(e)||mx(e)}function che(e,t,n){let i=t+2;if(i>=n)return null;let o=!1,s=7,r=i;for((e.charCodeAt(i)|32)===120&&(o=!0,s=6,i++,r=i);i=n||e.charCodeAt(i)!==59?null:e.slice(t,i+1)}function dhe(e,t,n){let i=t+1;if(i>=n||!iH(e.charCodeAt(i)))return null;for(i++;i=n||e.charCodeAt(i)!==59)return null;const o=e.slice(t,i+1);return nH(o)!==o?o:null}function fhe(e,t){const n=e.pos,i=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=i)return!1;if(e.src.charCodeAt(n+1)===35){const o=che(e.src,n,i);if(o){if(!t){const s=(o.charCodeAt(2)|32)===120?Number.parseInt(o.slice(3,-1),16):Number.parseInt(o.slice(2,-1),10),r=e.push("text_special","",0);r.content=O4(s)?Mv(s):Mv(65533),r.markup=o,r.info="entity"}return e.pos+=o.length,!0}}else{const o=dhe(e.src,n,i);if(o){const s=nH(o);if(!t){const r=e.push("text_special","",0);r.content=s,r.markup=o,r.info="entity"}return e.pos+=o.length,!0}}return!1}var oH=fhe;const sH=(()=>{const e=new Array(256).fill(0),t="\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-";for(let n=0;n<32;n++)e[t.charCodeAt(n)]=1;return e})(),pA=new Array(128),rH=new Array(128);for(let e=0;e<128;e++){const t=String.fromCharCode(e);pA[e]=`\\${t}`,rH[e]=sH[e]?t:pA[e]}function zE(e,t,n){e.pending&&e.pushPending();const i=new Ns("text_special","",0);i.level=e.level,i.content=t,i.markup=n,i.info="escape",e.pendingLevel=e.level,e.tokens.push(i),e.tokens_meta.push(null)}function hhe(e,t){let n=e.pos;const i=e.posMax,o=e.src;if(o.charCodeAt(n)!==92||(n++,n>=i))return!1;let s=o.charCodeAt(n);if(s===10){for(t||e.push("hardbreak","br",0),n++;n=55296&&s<=56319&&n+1=56320&&a<=57343&&n++}return e.pos=n+1,!0}let r=o.charAt(n);if(s>=55296&&s<=56319&&n+1=56320&&a<=57343&&(r+=o.charAt(n+1),n++)}const l=`\\${r}`;return zE(e,s<256&&sH[s]?r:l,l),e.pos=n+1,!0}var lH=hhe;function phe(e){let t,n,i=0;const o=e.tokens,s=e.tokens.length;for(t=n=0;t0&&i++,r.type==="text"&&t+1\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,uH="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",ghe=new RegExp(`^(?:${aH}|${uH}||<\\?[\\s\\S]*?\\?>|]*>|)`),vhe=new RegExp(`^(?:${aH}|${uH})`);function cH(e){return e===32||e===9||e===10||e===12||e===13}function yhe(e){if(e.length<3||e.charCodeAt(0)!==60||(e.charCodeAt(1)|32)!==97)return!1;const t=e.charCodeAt(2);return t===62||cH(t)}function khe(e){if(e.length<4||e.charCodeAt(0)!==60||e.charCodeAt(1)!==47||(e.charCodeAt(2)|32)!==97)return!1;for(let t=3;t=97&&t<=122}function whe(e,t){if(!e.md.options.html)return!1;const n=e.posMax,i=e.pos,o=e.src;if(o.charCodeAt(i)!==60||i+2>=n)return!1;const s=o.charCodeAt(i+1);if(s!==33&&s!==63&&s!==47&&!bhe(s))return!1;const r=o.slice(i).match(ghe);if(!r)return!1;const l=r[0];if(!t){const a=e.pushSimple("html_inline","");a.content=l,yhe(l)&&e.linkLevel++,khe(l)&&e.linkLevel--}return e.pos+=l.length,!0}var dH=whe;function Che(e,t){let n,i,o,s,r,l,a,u,c="";const d=e.pos,f=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const h=e.pos+2,m=Jk(e,e.pos+1,!1);if(m<0)return!1;if(s=m+1,s=f)return!1;if(l=Gj(e.src,s,e.posMax),l.ok){for(c=e.md.normalizeLink(l.str),e.md.validateLink(c)?s=l.pos:c="",u=s;s=f||e.src.charCodeAt(s)!==41)return e.pos=d,!1;s++}else{if(typeof e.env.references>"u")return!1;if(s=0?o=e.src.slice(u,s++):s=m+1):s=m+1,o||(o=e.src.slice(h,m)),r=e.env.references[R4(o)],!r)return e.pos=d,!1;c=r.href,a=r.title}if(!t){i=e.src.slice(h,m);const g=[];e.md.inline.parse(i,e.md,e.env,g);const y=e.push("image","img",0);y.attrs=[["src",c],["alt",""]],y.children=g,y.content=i,a&&y.attrs.push(["title",a])}return e.pos=s,e.posMax=f,!0}var fH=Che;function B3(e,t,n){for(;t"u")return!1;let d;if(l=r+1,l=0?(d=n.slice(h,m),d||(d=n.slice(s,r)),l=m+1):d=n.slice(s,r)}else d=n.slice(s,r);const f=e.env.references[R4(d)];if(!f)return e.pos=i,!1;a=f.href,u=f.title}if(!t){e.pos=s,e.posMax=r;const d=e.push("link_open","a",1);d.attrs=u?[["href",a],["title",u]]:[["href",a]],e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=l,e.posMax=o,!0}var hH=Ahe;function pH(e){const t=e|32;return t>=97&&t<=122}function xhe(e){return e>=48&&e<=57}function She(e){return pH(e)||xhe(e)||e===43||e===45||e===46}function _he(e){if(e.length===0)return null;let t=e.length-1;for(;t>=0&&She(e.charCodeAt(t));)t--;return t++,t>=e.length||!pH(e.charCodeAt(t))?null:e.slice(t)}function Ihe(e,t,n){let i=t;for(;i0)return!1;const n=e.pos,i=e.posMax;if(n+3>i||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const o=_he(e.pending);if(!o)return!1;const s=Ihe(e.src,n-o.length,i),r=e.md.linkify.matchAtStart(s);if(!r)return!1;let l=r.url;if(l.length<=o.length)return!1;let a=l.length;for(;a>0&&l.charCodeAt(a-1)===42;)a--;a!==l.length&&(l=l.slice(0,a));const u=e.md.normalizeLink(l);if(!e.md.validateLink(u))return!1;if(!t){e.pending=e.pending.slice(0,-o.length);const c=e.push("link_open","a",1);c.attrs=[["href",u]],c.markup="linkify",c.info="auto";const d=e.push("text","",0);d.content=e.md.normalizeLinkText(l);const f=e.push("link_close","a",-1);f.markup="linkify",f.info="auto"}return e.pos+=l.length-o.length,!0}function Mhe(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const i=e.pending.length-1,o=e.posMax;if(!t)if(i>=0&&e.pending.charCodeAt(i)===32)if(i>=1&&e.pending.charCodeAt(i-1)===32){let s=i-1;for(;s>=1&&e.pending.charCodeAt(s-1)===32;)s--;e.pending=e.pending.slice(0,s),e.pushSimple("hardbreak","br")}else e.pending=e.pending.slice(0,-1),e.pushSimple("softbreak","br");else e.pushSimple("softbreak","br");for(n++;n=o||HE(n.charCodeAt(i)))return!1;let s=i+1;for(;si-o),n=Math.floor(t.length/2);return t.length%2===0?(t[n-1]+t[n])/2:t[n]}function Fhe(e,t){return{chain:e,name:t,calls:0,hits:0,inclusiveMs:0,medianMs:0,maxMs:0,normalCalls:0,normalHits:0,silentCalls:0,silentHits:0,samples:[]}}function yH(e){const t=e;if(!t)return null;if(t.__mdtsRuleProfile)return t.__mdtsRuleProfile;if(!t.__mdtsProfileRules)return null;const n=t.__mdtsProfileRules===!0?{}:t.__mdtsProfileRules,i={enabled:!0,fixture:n.fixture,mode:n.mode,startedAt:gx(),records:Object.create(null)};return t.__mdtsRuleProfile=i,i}function om(e,t,n,i,o,s){const r=yH(e);if(!r)return;const l=`${t}:${n}`,a=r.records[l]??(r.records[l]=Fhe(t,n));a.calls++,a.inclusiveMs+=i,i>a.maxMs&&(a.maxMs=i),a.samples.push(i),s?(a.silentCalls++,o&&a.silentHits++):(a.normalCalls++,o&&a.normalHits++),o&&a.hits++,r.completedAt=gx()}function Dhe(e){const t=yH(e);if(!t)return null;const n=Object.keys(t.records);for(let i=0;io.name===e);i>=0&&this.rules.splice(i,1),this.rules.push({name:e,fn:t,alt:n?.alt||[],enabled:!0}),this.invalidateCache()}at(e,t,n){const i=this.rules.findIndex(o=>o.name===e);if(t===void 0){if(i<0)return;const o=this.rules[i];return Object.freeze({name:o.name,fn:o.fn,alt:o.alt?Object.freeze(o.alt.slice()):void 0,enabled:o.enabled})}if(i<0)throw new Error(`Parser rule not found: ${e}`);this.rules[i].fn=t,n?.alt!==void 0&&(this.rules[i].alt=n.alt),this.invalidateCache()}before(e,t,n,i){const o=this.rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this.rules.findIndex(r=>r.name===t);s>=0&&this.rules.splice(s,1),this.rules.splice(o,0,{name:t,fn:n,alt:i?.alt||[],enabled:!0}),this.invalidateCache()}after(e,t,n,i){const o=this.rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this.rules.findIndex(r=>r.name===t);s>=0&&this.rules.splice(s,1),this.rules.splice(o+1,0,{name:t,fn:n,alt:i?.alt||[],enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;for(const s of n){const r=this.rules.findIndex(l=>l.name===s);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${s}`);continue}i.push(s),this.rules[r].enabled||(this.rules[r].enabled=!0,o=!0)}return o&&this.invalidateCache(),i}disable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;for(const s of n){const r=this.rules.findIndex(l=>l.name===s);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${s}`);continue}i.push(s),this.rules[r].enabled&&(this.rules[r].enabled=!1,o=!0)}return o&&this.invalidateCache(),i}enableOnly(e){const t=new Set(e);let n=!1;for(const i of this.rules){const o=t.has(i.name);i.enabled!==o&&(i.enabled=o,n=!0)}n&&this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache.get(t)??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache.get(t)??[]}compileCache(){const e=new Set([""]);for(const i of this.rules)if(i.enabled&&i.alt)for(const o of i.alt)e.add(o);const t=new Map,n=new Map;for(const i of e){const o=[],s=[];for(const r of this.rules)r.enabled&&(i!==""&&!r.alt?.includes(i)||(o.push(r.fn),s.push({name:r.name,fn:r.fn})));t.set(i,o),n.set(i,s)}this.cache=t,this.namedCache=n}},kH=class{src;md;env;tokens;tokens_meta;pos;posMax;level;pending;pendingLevel;cache;delimiters;_prev_delimiters;backticks;backticksScanned;linkLevel;linkLabelNoCloseFrom;maxNesting;constructor(e,t,n,i){this.src=e,this.md=t,this.env=n,this.tokens=i,this.tokens_meta=new Array(i.length),this.pos=0,this.posMax=e.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache=[],this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0,this.linkLabelNoCloseFrom=-1,this.maxNesting=t.options.maxNesting}pushPending(){const e=new Ns("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e}pushSimple(e,t){this.pending&&this.pushPending();const n=new Ns(e,t,0);return n.level=this.level,this.pendingLevel=this.level,this.tokens.push(n),this.tokens_meta.push(null),n}push(e,t,n){if(this.pending&&this.pushPending(),n===0)return this.pushSimple(e,t);const i=new Ns(e,t,n);let o=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),i.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(i),this.tokens_meta.push(o),i}scanDelims(e,t){const{src:n,posMax:i}=this,o=n.charCodeAt(e);let s=e;for(;s0?n.charCodeAt(e-1):32,a=s@[\]\\^_`{}~]/;function qE(e,t){switch(e.src.charCodeAt(e.pos)){case 10:return gH(e,t);case 33:return fH(e,t);case 38:return oH(e,t);case 42:case 95:return hA.tokenize(e,t);case 58:return e.md.options.linkify&&mH(e,t);case 60:return Jj(e,t)||dH(e,t);case 91:return hH(e,t);case 92:return lH(e,t);case 96:return Xj(e,t);case 126:return mA.tokenize(e,t);default:return vH(e,t)}}function bH(e){return!Rhe.test(e)}var Ohe=class{ruler;ruler2;cachedRulesVersion=-1;cachedRules=[];cachedRules2Version=-1;cachedRules2=[];defaultRulerVersion;defaultRuler2Version;constructor(){this.ruler=new WE,this.ruler2=new WE,this.ruler.push("text",vH),this.ruler.push("linkify",mH),this.ruler.push("newline",gH),this.ruler.push("escape",lH),this.ruler.push("backticks",Xj),this.ruler.push("strikethrough",mA.tokenize),this.ruler.push("emphasis",hA.tokenize),this.ruler.push("link",hH),this.ruler.push("image",fH),this.ruler.push("autolink",Jj),this.ruler.push("html_inline",dH),this.ruler.push("entity",oH),this.ruler2.push("balance_pairs",she),this.ruler2.push("strikethrough",mA.postProcess),this.ruler2.push("emphasis",hA.postProcess),this.ruler2.push("fragments_join",mhe),this.defaultRulerVersion=this.ruler.version,this.defaultRuler2Version=this.ruler2.version}skipToken(e){const t=e.pos,n=this.getRules(),i=n.length,o=e.cache,s=o[t],r=!!e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules"));if(s!==void 0){e.pos=s;return}let l=!1;if(e.level=e.pos)throw new Error("inline rule didn't increment state.pos");break}}}else if(this.isDefaultRuleset()){if(e.level++,l=qE(e,!0),e.level--,l&&t>=e.pos)throw new Error("inline rule didn't increment state.pos")}else for(let a=0;a=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;l||e.pos++,o[t]=e.pos}tokenize(e){const t=this.getRules(),n=t.length,i=e.posMax;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){const s=this.isDefaultRuleset();for(;e.pos=e.pos)throw new Error("inline rule didn't increment state.pos")}if(l){if(e.pos>=i)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending();return}const o=this.ruler.getNamedRules("");for(;e.pos=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(r){if(e.pos>=i)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending()}isDefaultRuleset(){return this.ruler.version===this.defaultRulerVersion&&this.ruler2.version===this.defaultRuler2Version}parseSource(e,t,n,i){if(typeof e=="string"&&e.length>0&&this.isDefaultRuleset()&&bH(e)){const a=new Ns("text","",0);a.content=e,i.push(a);return}const o=new kH(e,t,n,i);this.tokenize(o);const s=this.getRules2(),r=s.length;if(!(o.env&&(Object.prototype.hasOwnProperty.call(o.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(o.env,"__mdtsProfileRules")))){for(let a=0;a0&&bH(s.content)){const r=new Ns("text","",0);r.content=s.content,s.children.push(r);continue}e.md.inline.parse(s.content,e.md,e.env,s.children)}}}const Bhe=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,$he=/[0-9a-z]/i;function zhe(e){return/^\s]/i.test(e)}function jhe(e){return/^<\/a\s*>/i.test(e)}function Hhe(e,t){if(t.schema||t.index!==0||!t.raw)return t;for(let n=1;n=0;r--){const l=o[r];if(l.type==="link_close"){for(r--;r>=0&&o[r].level!==l.level&&o[r].type!=="link_open";)r--;continue}if(l.type==="html_inline"&&(zhe(l.content)&&s>0&&s--,jhe(l.content)&&s++),s>0||l.type!=="text"||!e.md.linkify.test(l.content))continue;const a=l.content;let u=(e.md.linkify.match(a)||[]).map(h=>Hhe(e.md.linkify,h));if(u.length===0)continue;const c=[];let d=l.level,f=0;u.length>0&&u[0].index===0&&r>0&&o[r-1].type==="text_special"&&(u=u.slice(1));for(let h=0;hf){const M=new Ns("text","",0);M.content=a.slice(f,k),M.level=d,c.push(M)}const v=new Ns("link_open","a",1);v.attrs=[["href",g]],v.level=d++,v.markup="linkify",v.info="auto",c.push(v);const C=new Ns("text","",0);C.content=y,C.level=d,c.push(C);const w=new Ns("link_close","a",-1);w.level=--d,w.markup="linkify",w.info="auto",c.push(w),f=m.lastIndex}if(f!==0){if(f=0;n--){const i=e[n];i.type==="text"&&!t&&(i.content=i.content.replace(Zhe,Qhe)),i.type==="link_open"&&i.info==="auto"&&t--,i.type==="link_close"&&i.info==="auto"&&t++}}function Jhe(e){let t=0;for(let n=e.length-1;n>=0;n--){const i=e[n];i.type==="text"&&!t&&wH.test(i.content)&&(i.content=i.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),i.type==="link_open"&&i.info==="auto"&&t--,i.type==="link_close"&&i.info==="auto"&&t++}}function Xhe(e){if(e.md?.options?.typographer)for(let t=e.tokens.length-1;t>=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const i=n.content||(Array.isArray(n.children)?n.children.map(o=>o.type==="text"?o.content:"").join(""):"");Khe.test(i)&&Yhe(n.children||[]),wH.test(i)&&Jhe(n.children||[])}}var epe=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t){const n=this.rules.findIndex(i=>i.name===e);n>=0&&this.rules.splice(n,1),this.rules.push({name:e,fn:t,enabled:!0}),this.invalidateCache()}at(e,t){const n=this.rules.findIndex(i=>i.name===e);if(n<0)throw new Error(`Parser rule not found: ${e}`);this.rules[n].fn=t,this.invalidateCache()}before(e,t,n){const i=this.rules.findIndex(s=>s.name===e);if(i<0)throw new Error(`Parser rule not found: ${e}`);const o=this.rules.findIndex(s=>s.name===t);o>=0&&this.rules.splice(o,1),this.rules.splice(i,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}after(e,t,n){const i=this.rules.findIndex(s=>s.name===e);if(i<0)throw new Error(`Parser rule not found: ${e}`);const o=this.rules.findIndex(s=>s.name===t);o>=0&&this.rules.splice(o,1),this.rules.splice(i+1,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;for(const s of n){const r=this.rules.findIndex(l=>l.name===s);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${s}`);continue}i.push(s),this.rules[r].enabled||(this.rules[r].enabled=!0,o=!0)}return o&&this.invalidateCache(),i}disable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;for(const s of n){const r=this.rules.findIndex(l=>l.name===s);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${s}`);continue}i.push(s),this.rules[r].enabled&&(this.rules[r].enabled=!1,o=!0)}return o&&this.invalidateCache(),i}enableOnly(e){const t=new Set(e);let n=!1;for(const i of this.rules){const o=t.has(i.name);i.enabled!==o&&(i.enabled=o,n=!0)}n&&this.invalidateCache()}compileCache(){this.cache=this.rules.filter(e=>e.enabled).map(e=>e.fn),this.namedCache=this.rules.filter(e=>e.enabled).map(e=>({name:e.name,fn:e.fn}))}getRules(e=""){return this.cache||this.compileCache(),this.cache}getNamedRules(e=""){return this.namedCache||this.compileCache(),this.namedCache}};const tpe=/['"]/,UE=/['"]/g,VE="’";function wy(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function npe(e,t){let n;const i=[],o=t.md&&t.md.options&&t.md.options.quotes||"“”‘’";for(let s=0;s=0&&!(i[n].level<=l);n--);if(i.length=n+1,r.type!=="text")continue;let a=r.content,u=0,c=a.length;e:for(;u=0)g=a.charCodeAt(d.index-1);else for(n=s-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){g=e[n].content.charCodeAt(e[n].content.length-1);break}let y=32;if(u=48&&g<=57&&(h=f=!1),f&&h&&(f=k,h=v),!f&&!h){m&&(r.content=wy(r.content,d.index,VE));continue}if(h)for(n=i.length-1;n>=0;n--){let M=i[n];if(i[n].level=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const i=typeof n.content=="string"?n.content:(n.children||[]).map(o=>o.content||"").join("");!tpe.test(i)||!n.children||npe(n.children,e)}}function ope(e){const t=e.tokens||[],n=t.length;for(let i=0;i=4||o.charCodeAt(c)!==62)return!1;if(i)return!0;const h=[],m=[],g=[],y=[],k=e.md.block.ruler.getRulesForState(e,"blockquote"),v=e.parentType;e.parentType="blockquote";let C=!1,w;for(w=t;w=d)break;if(o.charCodeAt(c++)===62&&!x){let T=a[w]+1,I,O;o.charCodeAt(c)===32?(c++,T++,O=!1,I=!0):o.charCodeAt(c)===9?(I=!0,(u[w]+T)%4===3?(c++,T++,O=!1):O=!0):I=!1;let H=T;for(h.push(s[w]),s[w]=c;c=d,m.push(u[w]),u[w]=a[w]+1+(I?1:0),g.push(a[w]),a[w]=H-T,y.push(l[w]),l[w]=c-s[w];continue}if(C)break;let A=!1;for(let T=0,I=k.length;T";const E=[t,0];L.map=E,e.md.block.tokenize(e,t,w);const S=e.push("blockquote_close","blockquote",-1);S.markup=">",e.lineMax=f,e.parentType=v,E[1]=e.line;for(let x=0;x=4){i++,o=i;continue}break}e.line=o;const s=e.push("code_block","code",0);return s.content=`${e.getLines(t,o,4+e.blkIndent,!1)} +`,s.map=[t,e.line],!0}function cpe(e,t,n,i){let o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||o+3>s)return!1;const r=e.src.charCodeAt(o);if(r!==126&&r!==96)return!1;let l=o;o=e.skipChars(o,r);let a=o-l;if(a<3)return!1;const u=e.src.slice(l,o),c=e.src.slice(o,s);if(r===96&&c.includes(String.fromCharCode(r)))return!1;if(i)return!0;let d=t,f=!1;for(;d++,!(d>=n||(o=l=e.bMarks[d]+e.tShift[d],s=e.eMarks[d],o=4)&&(o=e.skipChars(o,r),!(o-l=4)return!1;let c=o.charCodeAt(a);if(c!==35||a>=u)return!1;let d=1;for(c=o.charCodeAt(++a);c===35&&a6||aa&&GE(o.charCodeAt(f-1))&&(u=f),e.line=t+1;const h=e.push("heading_open",KE[d],1);h.markup=ZE[d],h.map=[t,e.line];const m=e.push("inline","",0);m.content=o.slice(a,u).trim(),m.map=[t,e.line],m.children=[];const g=e.push("heading_close",KE[d],-1);return g.markup=ZE[d],!0}function fpe(e){switch(e){case 9:case 32:return!0}return!1}function hpe(e,t,n,i){const o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let s=e.bMarks[t]+e.tShift[t];const r=e.src.charCodeAt(s++);if(r!==42&&r!==45&&r!==95)return!1;let l=1;for(;s|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp(`^|$))`,"i"),/^$/,!0],[new RegExp(`${vhe.source}\\s*$`),/^$/,!1]];function ppe(e,t,n,i){let o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(o)!==60)return!1;let r=e.src.slice(o,s),l=0;for(;l=48&&e<=57}var _H=class{src;md;env;tokens;bMarks=[];eMarks=[];tShift=[];sCount=[];bsCount=[];lineFlags=[];blkIndent=0;line=0;lineMax=0;tight=!1;ddIndent=-1;listIndent=-1;parentType="root";level=0;constructor(e,t,n,i){this.src=e,this.md=t,this.env=n,this.tokens=i;const o=this.src;let s=0,r=0,l=0,a=!1,u=0;for(let c=0,d=o.length;c0&&this.level++,this.tokens.push(i),i}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){const t=this.bMarks,n=this.tShift,i=this.eMarks;for(let o=this.lineMax;et;){const i=n.charCodeAt(--e);if(i!==9&&i!==32)return e+1}return e}skipChars(e,t){const n=this.src;for(let i=n.length;en;)if(t!==i.charCodeAt(--e))return e+1;return e}getLines(e,t,n,i){if(e>=t)return"";if(e+1===t){const c=e,d=this.bMarks[c];let f=d;const h=i?this.eMarks[c]+1:this.eMarks[c];let m=0;const g=this.src,y=this.bsCount,k=this.tShift;for(;fn?new Array(m-n+1).join(" ")+g.slice(f,h):g.slice(f,h)}const o=new Array(t-e),s=this.src,r=this.bMarks,l=this.eMarks,a=this.bsCount,u=this.tShift;for(let c=0,d=e;dn?o[c]=new Array(f-n+1).join(" ")+s.slice(m,g):o[c]=s.slice(m,g)}return o.join("")}};_H.prototype.Token=Ns;function gpe(e,t,n){for(let i=t;i=o)return!1;const s=n.charCodeAt(i);switch(s){case 35:case 42:case 43:case 45:case 60:case 62:case 95:case 96:case 126:return!0}return s>=48&&s<=57?!0:gpe(n,i,o)}const YE=["","h1","h2"];function vpe(e,t,n){const i=e.md.block.ruler.getRulesForState(e,"paragraph"),o=e.src,s=e.bMarks,r=e.tShift,l=e.eMarks,a=e.sCount,u=e.blkIndent,c=IH(e);if(a[t]-u>=4)return!1;const d=e.parentType;e.parentType="paragraph";let f=0,h,m=t+1;for(;m=M)break;if(a[m]-u>3)continue;if(a[m]>=u&&(h=o.charCodeAt(w),h===45||h===61)){let E=w+1,S=E;for(;E=M){f=h===61?1:2;break}if(S-w>1)continue}if(a[m]<0||c&&!MH(e,m,o,w,M))continue;let L=!1;for(let E=0,S=i.length;Ew;){const L=o.charCodeAt(M-1);if(L!==9&&L!==32)break;M--}g=o.slice(w,M)}else g=e.getLines(t,m,u,!1).trim();e.line=m+1;const y=h===61?"=":"-",k=e.push("heading_open",YE[f],1);k.markup=y,k.map=[t,e.line];const v=e.push("inline","",0);v.content=g,v.map=[t,e.line-1],v.children=[];const C=e.push("heading_close",YE[f],-1);return C.markup=y,e.parentType=d,!0}function TH(e){switch(e){case 9:case 32:return!0}return!1}function JE(e,t){const n=e.eMarks,i=e.bMarks,o=e.tShift,s=e.src,r=n[t];let l=i[t]+o[t];const a=s.charCodeAt(l++);return a!==42&&a!==45&&a!==43||l=l)return-1;let u=s.charCodeAt(a++);if(u<48||u>57)return-1;for(;;){if(a>=l)return-1;if(u=s.charCodeAt(a++),u>=48&&u<=57){if(a-r>=10)return-1;continue}if(u===41||u===46)break;return-1}return a0&&++o=4||e.listIndent>=0&&e.sCount[l]-e.listIndent>=4&&e.sCount[l]=e.blkIndent&&(u=!0);let c,d,f;const h=e.src,m=e.bMarks,g=e.tShift,y=e.eMarks,k=e.sCount,v=e.bsCount,C=m[l]+g[l];if(C>=y[l])return!1;const w=h.charCodeAt(C);if(w>=48&&w<=57){if(f=XE(e,l),f<0||(c=!0,r=C,d=ype(e,l,f),u&&d!==1))return!1}else if(w===42||w===45||w===43){if(f=JE(e,l),f<0)return!1;c=!1}else return!1;if(u&&e.skipSpaces(f)>=y[l])return!1;if(i)return!0;const M=h.charCodeAt(f-1),L=String.fromCharCode(M);if(c){const I=e.push("ordered_list_open","ol",1);d!==void 0&&d!==1&&(I.attrs=[["start",String(d)]])}else e.push("bullet_list_open","ul",1);const E=[l,0];e.tokens[e.tokens.length-1].map=E,e.tokens[e.tokens.length-1].markup=L;let S=!1;const x=e.tokens.length-1,A=e.md.block.ruler.getRulesForState(e,"list"),T=e.parentType;for(e.parentType="list";l=o?R=1:R=O-I,R>4&&(R=1);const F=I+R,P=e.push("list_item_open","li",1);P.markup=L;const z=[l,0];P.map=z,c&&(P.info=f-r-1===1?kpe[h.charCodeAt(r)-48]:h.slice(r,f-1));const W=e.tight,$=e.tShift[l],K=e.sCount[l],ne=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=F,e.tight=!0,e.tShift[l]=H-m[l],e.sCount[l]=O,H>=o&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n,!0),(!e.tight||S)&&(a=!1),S=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=ne,e.tShift[l]=$,e.sCount[l]=K,e.tight=W,e.push("list_item_close","li",-1).markup=L,l=e.line,z[1]=l,l>=n||e.sCount[l]=4)break;let G=!1;for(let te=0,le=A.length;te3||u[f]<0)continue;if(o==="list"&&u[f]>=c){const C=r[f]+l[f],w=a[f];if(C=w||eL(s.charCodeAt(C+1)))break}else if(M>=48&&M<=57&&C+1=w){L=-1;break}const E=s.charCodeAt(L++);if(E>=48&&E<=57){if(L-C>=10){L=-1;break}continue}if((E===41||E===46)&&(L>=w||eL(s.charCodeAt(L))))break;L=-1;break}if(L>=0)break}}}const y=r[f]+l[f],k=a[f];if(d&&!MH(e,f,s,y,k))continue;let v=!1;for(let C=0,w=i.length;C=4||e.src.charCodeAt(o)!==91)return!1;function a(C){const w=e.lineMax;if(C>=w||e.isEmpty(C))return null;let M=!1;if(e.sCount[C]-e.blkIndent>3&&(M=!0),e.sCount[C]<0&&(M=!0),!M){const S=e.parentType;e.parentType="reference";let x=!1;for(let A=0,T=l.length;A"u"&&(e.env.references={}),typeof e.env.references[v]>"u"&&(e.env.references[v]={title:k,href:f}),e.line=r),!0):!1}function $3(e){switch(e){case 9:case 32:return!0}return!1}const xpe=65536;function z3(e,t){const n=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];return e.src.slice(n,i)}function Spe(e,t){if(e.lineFlags)return(e.lineFlags[t]&F0.Pipe)!==0;for(let n=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];nn)return!1;let o=t+1;if(e.sCount[o]=4)return!1;let s=e.bMarks[o]+e.tShift[o];if(s>=e.eMarks[o])return!1;const r=e.src.charCodeAt(s++);if(r!==124&&r!==45&&r!==58||s>=e.eMarks[o])return!1;const l=e.src.charCodeAt(s++);if(l!==124&&l!==45&&l!==58&&!$3(l)||r===45&&$3(l)||!Spe(e,t))return!1;for(;s=4)return!1;u=tL(a),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop();const d=u.length;if(d===0||d!==c.length)return!1;if(i)return!0;const f=e.parentType;e.parentType="table";const h=e.md.block.ruler.getRulesForState(e,"blockquote"),m=e.push("table_open","table",1),g=[t,0];m.map=g;const y=e.push("thead_open","thead",1);y.map=[t,t+1];const k=e.push("tr_open","tr",1);k.map=[t,t+1];for(let w=0;w=4||(u=tL(a),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop(),C+=d-u.length,C>xpe))break;if(o===t+2){const L=e.push("tbody_open","tbody",1);L.map=v=[t+2,0]}const M=e.push("tr_open","tr",1);M.map=[o,o+1];for(let L=0;Lr.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this._rules.findIndex(r=>r.name===t);s>=0&&this._rules.splice(s,1),this._rules.splice(o,0,{name:t,enabled:!0,fn:n,alt:i?.alt||[]}),this.invalidateCache()}after(e,t,n,i){const o=this._rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this._rules.findIndex(r=>r.name===t);s>=0&&this._rules.splice(s,1),this._rules.splice(o+1,0,{name:t,enabled:!0,fn:n,alt:i?.alt||[]}),this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache[t]??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache[t]??[]}getRulesForState(e,t){const n=e?.env;return n&&(Object.prototype.hasOwnProperty.call(n,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(n,"__mdtsProfileRules"))?this.getNamedRules(t).map(({name:i,fn:o})=>(s,r,l,a)=>{const u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now(),c=o(s,r,l,a),d=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();return om(s?.env,"block",i,d-u,c,!!a),c}):this.getRules(t)}at(e,t,n){const i=this._rules.findIndex(o=>o.name===e);if(i===-1)throw new Error(`Parser rule not found: ${e}`);this._rules[i].fn=t,n?.alt&&(this._rules[i].alt=n.alt),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;return n.forEach(s=>{const r=this._rules.findIndex(l=>l.name===s);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${s}`)}i.push(s),this._rules[r].enabled||(this._rules[r].enabled=!0,o=!0)}),o&&this.invalidateCache(),i}disable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;return n.forEach(s=>{const r=this._rules.findIndex(l=>l.name===s);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${s}`)}i.push(s),this._rules[r].enabled&&(this._rules[r].enabled=!1,o=!0)}),o&&this.invalidateCache(),i}enableOnly(e){const t=new Set(e);let n=!1;for(const i of this._rules){const o=t.has(i.name);i.enabled!==o&&(i.enabled=o,n=!0)}n&&this.invalidateCache()}compileCache(){const e=new Set([""]);for(const i of this._rules)if(i.enabled)for(const o of i.alt)e.add(o);const t=Object.create(null),n=Object.create(null);for(const i of e){const o=[],s=[];for(const r of this._rules)r.enabled&&(i!==""&&!r.alt.includes(i)||(o.push(r.fn),s.push({name:r.name,fn:r.fn})));t[i]=o,n[i]=s}this.cache=t,this.namedCache=n}};const Ay=[["table",_pe,["paragraph","reference"]],["code",upe],["fence",cpe,["paragraph","reference","blockquote","list"]],["blockquote",ape,["paragraph","reference","blockquote","list"]],["hr",hpe,["paragraph","reference","blockquote","list"]],["list",wpe,["paragraph","reference","blockquote"]],["reference",Ape],["html_block",ppe,["paragraph","reference","blockquote"]],["heading",dpe,["paragraph","reference","blockquote"]],["lheading",vpe],["paragraph",Cpe]];var Mpe=class{ruler;cachedRulesVersion=-1;cachedRules=[];constructor(){this.ruler=new Ipe;for(let e=0;e=a[c];)c++;if(e.line=c,c>=n||u[c]=s){e.line=n;break}const h=e.line;let m=!1;for(let g=0;g=e.line)throw new Error("block rule didn't increment state.line");break}if(!m)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),c=e.line,c=a[c]&&(d=!0,c++,e.line=c)}return}const f=this.ruler.getNamedRules("");for(;c=a[c];)c++;if(e.line=c,c>=n||u[c]=s){e.line=n;break}const h=e.line;let m=!1;for(let g=0;g=e.line)throw new Error("block rule didn't increment state.line");break}}if(!m)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),c=e.line,c=a[c]&&(d=!0,c++,e.line=c)}}parse(e,t,n,i){if(!e||e.length===0)return;const o=new _H(e,t,n,i);this.tokenize(o,o.line,o.lineMax)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(""),this.cachedRulesVersion=this.ruler.version),this.cachedRules}},EH=class{src;env;tokens;inlineMode;md;constructor(e,t,n={}){this.src=typeof e=="string"?e||"":e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}};EH.prototype.Token=Ns;const nL=[["normalize",Vhe],["block",Xfe],["inline",Phe],["linkify",Whe],["replacements",Xhe],["smartquotes",ipe],["text_join",ope]],Tpe={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:100},Epe={parseLinkLabel:fx,parseLinkDestination:dx,parseLinkTitle:hx};function Lpe(){return{...Tpe}}function Npe(){return{...Epe}}var Fpe=class{fallbackParser;lastState=null;block;inline;ruler;linkifyInstance=null;cachedCoreRulesVersion=-1;cachedCoreRules=[];cachedCoreNamedRulesVersion=-1;cachedCoreNamedRules=[];constructor(){this.block=new Mpe,this.inline=new Ohe,this.ruler=new epe;for(let e=0;e@[\]\\^_`{}~]/;function Xk(e){return!Dpe.test(e)}function s0(e,t){const n=e.indexOf(` +`,t);return n===-1?e.length:n}function L9(e,t,n){for(let i=t;i3)return Xk(e);for(let t=0;t=i||t.charCodeAt(r)!==32)return!1;let l=r+1;for(;ll&&t.charCodeAt(a-1)===32;)a--;let u=a;for(;u>l&&t.charCodeAt(u-1)===35;)u--;if(u>l&&t.charCodeAt(u-1)===32)for(a=u-1;a>l&&t.charCodeAt(a-1)===32;)a--;const c=t.slice(l,a);if(!Xk(c))return!1;const d=Ope[s],f=Ppe[s],h=Ba("heading_open",d,1,0);h.map=[o,o+1],h.markup=f,e.push(h),e.push(vx(c,o,1));const m=Ba("heading_close",d,-1,0);return m.markup=f,e.push(m),!0}function $pe(e,t,n){const i=Ba("paragraph_open","p",1,0);i.map=[n,n+1],e.push(i),e.push(vx(t,n,1)),e.push(Ba("paragraph_close","p",-1,0))}function zpe(e,t,n){const i=e.charCodeAt(n-1);return i===32||i===9?e.slice(t,n).trim():e.slice(t,n)}function q3(e,t){for(;t=1e5?oL:W3,o="",s=!1,r=!1,l=0,a=0;for(;l"]/,sL=/[&<>"]/g,Kpe=/&/g,Zpe=/[<>"]/g,Gpe={"&":"&","<":"<",">":">",'"':"""};function U3(e){return Gpe[e]||e}function Pi(e){if(e.length===0)return"";if(e.length<32)return Vpe.test(e)?e.replace(sL,U3):e;const t=e.includes("&"),n=e.includes("<"),i=e.includes(">"),o=e.includes('"');return!t&&!n&&!i&&!o?e:t&&!n&&!i&&!o?e.replace(Kpe,"&"):t?e.replace(sL,U3):e.replace(Zpe,U3)}const Qpe=new RegExp(`${/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),Ype=/^#(?:x[a-f0-9]{1,8}|\d{1,8})$/i;function LH(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(Qpe,(t,n,i)=>{if(n)return n;if(Ype.test(i)){const s=i[1].toLowerCase()==="x"?Number.parseInt(i.slice(2),16):Number.parseInt(i.slice(1),10);return O4(s)?Mv(s):"�"}const o=nx(t);return o!==t?o:t})}const Jpe=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/,Xpe=/[\n!"#$%&*+\-:<=>@[\]\\^_`{}~]/,e1e=/"/g;function D1(e,t){const n=e.indexOf(` +`,t);return n===-1?e.length:n}function eb(e,t,n){for(let i=t;i=e.length||e.charCodeAt(t)===10?!1:!eb(e,t,D1(e,t))}function rL(e,t,n){return t+2=n||e.charCodeAt(o)!==32)return null;let s=o+1;for(;ss&&e.charCodeAt(r-1)===32;)r--;let l=r;for(;l>s&&e.charCodeAt(l-1)===35;)l--;if(l>s&&e.charCodeAt(l-1)===32)for(r=l-1;r>s&&e.charCodeAt(r-1)===32;)r--;const a=yx(e.slice(s,r));return a===null?null:`${a} +`}function lL(e,t,n){return t+1" +`;case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return null}return`
    1. ${e[t]}
    2. +`}function s1e(e,t,n){const i=t+2;if(n===i+1)return o1e(e,i);const o=yx(e.slice(t+2,n));return o===null?null:`
    3. ${o}
    4. +`}function r1e(e,t,n){for(;tt;){const o=e.charCodeAt(n-1);if(o!==32&&o!==9)break;n--}let i=n;for(let o=t;o`:"
      ",i.lang=s,i.open=d),{html:`${d}${Pi(c)}
      +`,nextPos:u=25e4,s=[],r={lang:null,open:""};let l="",a="",u="",c="";for(;n +`;w +`,l=k,a=v}let C=xy(e,y);for(;C${y}

      +`,u=h,c=m}const g=de.core.parse(t,n,e).tokens);let r=N9(t,o);if(o.maxChunks&&r.length>o.maxChunks&&(r=f1e(r,o.maxChunks)),F9(t,r))return O3(n,{count:1,fallback:!0,fallbackReason:"unsafe-chunk-boundary",maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines}),im(n,s,()=>e.core.parse(t,n,e).tokens);let l=0;const a=[];return O3(n,{count:r.length,maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines,globalStateDetected:s||void 0,globalStateFallbackDisabled:o.fallbackOnGlobalState===!1&&!!s}),im(n,s,()=>{for(let u=0;u=3&&(c?c.marker===C&&M>=c.length&&(c=null):c={marker:C,length:M})}}const y=m-f;o+=y,s+=1,l+=1,g?(a=0,u=0):(a+=1,u+=y);const k=g;if((o>=t.maxChunkChars||s>=t.maxChunkLines)&&!c)if(k)d(m);else{const v=Math.max(10,Math.floor(t.maxChunkLines*.5)),C=Math.max(t.maxChunkChars,8e3);(a>=v||u>=C)&&d(m)}f=m}return n&&d(e.length),i}function F9(e,t,n={rangesCoverWholeSource:!0}){const i=n.rangesCoverWholeSource?t.length-1:t.length;for(let o=0;oe.length||e.charCodeAt(t-1)!==10)return!1;let n=t-2;for(;n>=0&&e.charCodeAt(n)!==10;)n--;for(let i=n+1;i=0;i--)n.push(e[i]);for(;n.length;){const i=n.pop();if(i.map&&(i.map[0]+=t,i.map[1]+=t),i.children)for(let o=i.children.length-1;o>=0;o--)n.push(i.children[o])}}function d1e(e,t){for(let n=0;n=0;i--)n.push(e[i]);for(;n.length;){const i=n.pop();if(i.map&&(i.map[0]+=t,i.map[1]+=t),i.children)for(let o=i.children.length-1;o>=0;o--)n.push(i.children[o])}}function Td(e){return e.length===0?0:Mo(e)+(e.charCodeAt(e.length-1)===10?0:1)}function k1e(e,t,n){for(let i=t;i=3&&(n?n.marker===r&&a>=n.length&&(n=null):n={marker:r,length:a})}i=o===e.length?e.length:o+1}return n!==null}function w1e(e,t){if(e.length===0||e.charCodeAt(e.length-1)!==10)return!1;let n=e.length-2;for(;n>=0&&e.charCodeAt(n)!==10;)n--;return k1e(e,n+1,e.length-1)?!b1e(e,t):!1}function C1e(e,t,n,i={}){const o=i.mode??"full",s=i.fenceAware??(o==="stream"?e.options.streamChunkFenceAware??!0:e.options.fullChunkFenceAware??!0);if(i.maxChunkChars!==void 0||i.maxChunkLines!==void 0||i.autoTune===!1){const r=i.maxChunkChars??(o==="stream"?e.options.streamChunkSizeChars??g1e:e.options.fullChunkSizeChars??p1e),l=i.maxChunkLines??(o==="stream"?e.options.streamChunkSizeLines??v1e:e.options.fullChunkSizeLines??m1e);return{maxChunkChars:r,maxChunkLines:l,holdBelowChars:r,holdBelowLines:l,fenceAware:s}}return o==="stream"?t<=5e3?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:s}:t<=2e4?{maxChunkChars:16e3,maxChunkLines:200,holdBelowChars:16e3,holdBelowLines:200,fenceAware:s}:t<=5e4?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:s}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:s}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:s}:t<=1e5&&n<=2500?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:1e5,holdBelowLines:2500,fenceAware:s}:t<=2e5?{maxChunkChars:2e4,maxChunkLines:150,holdBelowChars:2e4,holdBelowLines:150,fenceAware:s}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:s}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:s}}var d2=class{md;options;pending="";tokens=[];committedChars=0;committedLines=0;fedChunks=0;parsedChunks=0;globalStateEnv=null;markedGlobalStateReason=null;constructor(e,t={}){if(this.md=e,this.options={mode:"full",autoTune:!0,retainTokens:!0,...t},this.options.retainTokens===!1&&!this.options.onChunkTokens)throw new Error("UnboundedBuffer with retainTokens=false requires onChunkTokens")}feed(e){e&&(this.pending+=e,this.fedChunks+=1)}flushAvailable(e={}){if(!this.pending)return null;const t=this.resolveWindow(),n=Td(this.pending);if(this.pending.length=i||n>=o}function PH(e,t,n){if(e.options.autoUnbounded===!1)return"no";if(t>=(e.options.autoUnboundedThresholdChars??FH))return"yes";const i=e.options.autoUnboundedThresholdLines??DH;return n!==void 0?n>=i?"yes":"no":t+1e.core.parse(t,n,e).tokens);const s=[],r=new d2(e,{mode:"full",...i,retainTokens:!1,onChunkTokens(l){RH(s,l)}});if(o&&ux(n,o),r.feed(t),r.flushForce(n),o&&(cx(n),i.fallbackOnGlobalState===!1)){const l=Bc(n)?.unbounded;l&&(l.globalStateDetected=o,l.globalStateFallbackDisabled=!0)}return s}const sm=(e,t,n)=>en?n:e;function BH(e){return e.experimental?{...e,...e.experimental}:e}const cL=[{max:5e3,strategy:"discrete",maxChunkChars:32e3,maxChunkLines:150,maxChunks:8,notes:"<=5k"},{max:2e4,strategy:"discrete",maxChunkChars:24e3,maxChunkLines:200,maxChunks:12,notes:"<=20k"},{max:1e5,strategy:"plain",notes:"<=100k plain"},{max:2e5,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:150,maxChunks:12,notes:"<=200k"},{max:5e5,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:16,notes:"<=500k"},{max:5e6,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:16,notes:"<=5M"}],dL=[{max:5e3,strategy:"discrete",maxChunkChars:16e3,maxChunkLines:250,maxChunks:8,notes:"<=5k"},{max:2e4,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:200,maxChunks:24,notes:"<=20k"},{max:1e5,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:200,maxChunks:24,notes:"<=100k"},{max:5e5,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:32,notes:"<=500k"},{max:5e6,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:32,notes:"<=5M"}];function $H(e,t){return{strategy:t.strategy,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,maxChunks:t.maxChunks,fenceAware:e,notes:t.notes}}function I1e(e,t=Math.max(0,e/40|0),n={}){const i=BH(n),o=i.fullChunkFenceAware??!0,s=i.fullChunkTargetChunks??8,r=i.fullChunkAdaptive!==!1;for(let l=0;l5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:sm(Math.ceil(e/s),8e3,64e3),maxChunkLines:sm(Math.ceil(t/s),150,700),maxChunks:sm(Math.ceil(e/64e3),s,16),fenceAware:o,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:i.fullChunkSizeChars??1e4,maxChunkLines:i.fullChunkSizeLines??200,fenceAware:o,maxChunks:i.fullChunkMaxChunks}}function fL(e,t=Math.max(0,e/40|0),n={}){const i=BH(n),o=i.streamChunkFenceAware??!0,s=i.streamChunkTargetChunks??8,r=i.streamChunkAdaptive!==!1;for(let l=0;l5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:sm(Math.ceil(e/s),8e3,64e3),maxChunkLines:sm(Math.ceil(t/s),150,700),maxChunks:sm(Math.ceil(e/64e3),s,32),fenceAware:o,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:i.streamChunkSizeChars??1e4,maxChunkLines:i.streamChunkSizeLines??200,maxChunks:i.streamChunkMaxChunks,fenceAware:o}}var M1e={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"]},inline2:{rules:["balance_pairs","emphasis","fragments_join"]}}},T1e={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},E1e={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"]},inline2:{rules:["balance_pairs","fragments_join"]}}};function B4(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function D9(e,t){if(B4(e))throw new TypeError(`Renderer rule "${t}" returned a Promise. Use renderAsync() instead.`);return e}const hL=e=>B4(e)?e:Promise.resolve(e);function R0(e){switch(e){case"alt":case"class":case"href":case"id":case"lang":case"rel":case"src":case"start":case"style":case"target":case"title":return e;default:return Pi(e)}}function xf(e){if(!e||e.length===0)return"";const t=e[0];let n=` ${R0(t[0])}="${Pi(t[1])}"`;for(let i=1;i=e.length)return{langName:e,langAttrs:""};let n=t;for(;n${t} +`;const s=e.attrIndex("class"),r=e.attrs?e.attrs.slice():[],l=`${o.langPrefix??"language-"}${i}`;return s<0?r.push(["class",l]):(r[s]=r[s].slice(),r[s][1]+=` ${l}`),`
      ${t}
      +`}return`
      ${t}
      +`}function Ev(e){return!e.attrs||e.attrs.length===0?`${Pi(e.content)}`:`${Pi(e.content)}`}function gA(e){const t=Pi(e.content);return e.attrs?`${t} +`:`
      ${t}
      +`}function L1e(e,t){const n=e.attrs;if(!n||n.length===0)switch(e.type){case"paragraph_open":return`${t}

      `;case"heading_open":return`<${e.tag}>`;case"td_open":return`${t}`;case"th_open":return`${t}`;default:return null}if(n.length===1&&n[0][0]==="style"){if(e.type==="td_open")return`${t}`;if(e.type==="th_open")return`${t}`}return null}function pL(e){const t=e.attrs;return!t||t.length===0?"":t.length===1?``:t.length===2?``:``}function N1e(e){switch(e.type){case"text":case"text_special":case"softbreak":case"hardbreak":case"html_inline":case"code_inline":case"image":return!0;default:return!1}}function mL(e){switch(e.type){case"text":case"text_special":case"softbreak":case"hardbreak":case"html_inline":case"code_inline":return!0;default:return!1}}function nb(e,t){if(e.hidden)return"";const n=e.attrs,i=e.nesting,o=e.tag;if(!n||n.length===0)return i===0?t?`<${o} />`:`<${o}>`:i===-1?``:`<${o}>`;let s=(i===-1?"`}const F1e={langPrefix:"language-",xhtmlOut:!1,breaks:!1},Sy=Object.prototype.hasOwnProperty,yi={code_inline(e,t){return Ev(e[t])},code_block(e,t){return gA(e[t])},fence(e,t,n,i,o){const s=e[t],r=s.info?LH(s.info).trim():"",{langName:l,langAttrs:a}=zH(r),u=n.highlight,c=Pi(s.content);if(!u)return O0(s,c,r,l,n);const d=u(s.content,l,a);return B4(d)?d.then(f=>O0(s,f||c,r,l,n)):O0(s,d||c,r,l,n)},image(e,t,n,i,o){const s=e[t],r=o.renderInlineAsText(s.children||[],n,i),l=s.attrIndex("alt");return l>=0&&s.attrs?s.attrs[l][1]=r:s.attrs?s.attrs.push(["alt",r]):s.attrs=[["alt",r]],nb(s,n.xhtmlOut===!0)},hardbreak(e,t,n){return n.xhtmlOut?`
      +`:`
      +`},softbreak(e,t,n){return n.breaks?n.xhtmlOut?`
      +`:`
      +`:` +`},text(e,t){return Pi(e[t].content)},text_special(e,t){return Pi(e[t].content)},html_block(e,t){return e[t].content},html_inline(e,t){return e[t].content}};function gL(e,t,n){const i=e.info?LH(e.info).trim():"",{langName:o,langAttrs:s}=zH(i),r=t.highlight,l=Pi(e.content);if(!r)return O0(e,l,i,o,t);const a=r(e.content,o,s);if(B4(a))throw new TypeError('Renderer rule "fence" returned a Promise. Use renderAsync() instead.');return O0(e,a||l,i,o,t)}function V3(e,t,n,i){switch(e.type){case"text":return t.text===yi.text?e.content.length===0?"":Pi(e.content):null;case"text_special":return t.text_special===yi.text_special?e.content.length===0?"":Pi(e.content):null;case"softbreak":return t.softbreak===yi.softbreak?i:null;case"hardbreak":return t.hardbreak===yi.hardbreak?n:null;case"html_inline":return t.html_inline===yi.html_inline?e.content:null;case"code_inline":return t.code_inline===yi.code_inline?Ev(e):null;default:return null}}function D1e(e,t,n,i,o){const s=e[0];switch(s.type){case"text":if(o.text===yi.text)return s.content.length===0?"":Pi(s.content);break;case"text_special":if(o.text_special===yi.text_special)return s.content.length===0?"":Pi(s.content);break;case"softbreak":if(o.softbreak===yi.softbreak)return t.breaks?t.xhtmlOut?`
      +`:`
      +`:` +`;break;case"hardbreak":if(o.hardbreak===yi.hardbreak)return t.xhtmlOut?`
      +`:`
      +`;break;case"html_inline":if(o.html_inline===yi.html_inline)return s.content;break;case"code_inline":if(o.code_inline===yi.code_inline)return Ev(s);break}const r=o[s.type];if(!r)return nb(s,t.xhtmlOut===!0);const l=r(e,0,t,n,i);return typeof l=="string"?l:D9(l,s.type)}var R1e=class{rules;baseOptions;normalizedBase;constructor(e={}){this.baseOptions={...e},this.normalizedBase=this.buildNormalizedBase(),this.rules={...yi}}set(e){return this.baseOptions={...this.baseOptions,...e},this.normalizedBase=this.buildNormalizedBase(),this}render(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");if(e.length===1)return this.renderSingleToken(e,e[0],t,n);const i=this.mergeOptions(t),o=n??{},s=this.rules,r=i.xhtmlOut===!0;let l,a,u,c,d,f,h="",m="",g=!1,y="";for(let k=0;k0&&e[k-1].hidden?` +`:"";if(C==="list_item_open"&&(!v.attrs||v.attrs.length===0)&&k+3${this.renderInlineTokens(S.children||[],i,o)}`,k+=3;continue}}if(k+2 +`,k+=2;continue}}}if(C==="inline"){const E=v.children||[];if(E.length===1){g||(l=s.text,a=s.text_special,u=s.softbreak,c=s.hardbreak,d=s.html_inline,f=s.code_inline,h=i.xhtmlOut?`
      +`:`
      +`,m=i.breaks?h:` +`,g=!0);const S=E[0];switch(S.type){case"text":if(l===yi.text){y+=Pi(S.content);continue}break;case"text_special":if(a===yi.text_special){y+=Pi(S.content);continue}break;case"softbreak":if(u===yi.softbreak){y+=m;continue}break;case"hardbreak":if(c===yi.hardbreak){y+=h;continue}break;case"html_inline":if(d===yi.html_inline){y+=S.content;continue}break;case"code_inline":if(f===yi.code_inline){y+=Ev(S);continue}break}}y+=this.renderInlineTokens(E,i,o);continue}const M=s[C];if(!M){const E=v.attrs;if(!v.hidden){if(!E||E.length===0)switch(C){case"hr":y+=r?`


      +`:`
      +`;continue;case"heading_open":y+=`<${v.tag}>`;continue;case"heading_close":y+=` +`;continue;case"paragraph_open":y+=`${w}

      `;continue;case"paragraph_close":y+=`

      +`;continue;case"list_item_open":{const S=e[k+1];y+=w+(S&&(S.type==="inline"||S.hidden||S.nesting===-1&&S.tag==="li")?"
    5. ":`
    6. +`);continue}case"list_item_close":y+=`
    7. +`;continue;case"bullet_list_open":y+=`${w}
        +`;continue;case"bullet_list_close":y+=`
      +`;continue;case"blockquote_open":y+=w+(e[k+1]&&e[k+1].nesting===-1&&e[k+1].tag==="blockquote"?"
      ":`
      +`);continue;case"blockquote_close":y+=`
      +`;continue;case"ordered_list_open":y+=`${w}
        +`;continue;case"ordered_list_close":y+=`
      +`;continue;case"table_open":y+=`${w} +`;continue;case"table_close":y+=`
      +`;continue;case"thead_open":y+=`${w} +`;continue;case"thead_close":y+=` +`;continue;case"tbody_open":y+=`${w} +`;continue;case"tbody_close":y+=` +`;continue;case"tr_open":y+=`${w} +`;continue;case"tr_close":y+=` +`;continue;case"td_open":y+=`${w}`;continue;case"td_close":y+=` +`;continue;case"th_open":y+=`${w}`;continue;case"th_close":y+=` +`;continue}else if(E.length===1){const S=E[0];if(C==="ordered_list_open"&&S[0]==="start"){y+=`${w}
        +`;continue}if(C==="td_open"&&S[0]==="style"){y+=`${w}`;continue}if(C==="th_open"&&S[0]==="style"){y+=`${w}`;continue}}}y+=this.renderToken(e,k,i);continue}if(C==="code_block"&&M===yi.code_block){y+=gA(v);continue}if(C==="fence"&&M===yi.fence){y+=gL(v,i);continue}if(C==="html_block"&&M===yi.html_block){y+=v.content;continue}const L=M(e,k,i,o,this);typeof L=="string"?y+=L:y+=D9(L,v.type)}return y}async renderAsync(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");const i=this.mergeOptions(t),o=n??{},s=this.rules;let r="";for(let l=0;l0&&e[t-1].hidden?` +`:"",c=a?`> +`:">";if(!l||l.length===0)return s===0?n.xhtmlOut?`${u}<${r} /${c}`:`${u}<${r}${c}`:s===-1?`${u}(n||(n={...t}),n);if(Sy.call(e,"highlight")&&e.highlight!==t.highlight&&(i().highlight=e.highlight),Sy.call(e,"langPrefix")){const o=e.langPrefix;o!==t.langPrefix&&(i().langPrefix=o)}if(Sy.call(e,"xhtmlOut")){const o=e.xhtmlOut;o!==t.xhtmlOut&&(i().xhtmlOut=o)}if(Sy.call(e,"breaks")){const o=e.breaks;o!==t.breaks&&(i().breaks=o)}return n||t}buildNormalizedBase(){return Object.freeze({...F1e,...this.baseOptions})}renderSingleToken(e,t,n,i){const o=this.rules,s=t.type;if(s==="code_block"&&o.code_block===yi.code_block)return gA(t);if(s==="html_block"&&o.html_block===yi.html_block)return t.content;const r=this.mergeOptions(n),l=i??{};if(s==="inline")return this.renderInlineTokens(t.children||[],r,l);const a=o[s];if(!a)return t.block?this.renderToken(e,0,r):nb(t,r.xhtmlOut===!0);if(s==="fence"&&a===yi.fence)return gL(t,r);const u=a(e,0,r,l,this);return typeof u=="string"?u:D9(u,s)}renderInlineTokens(e,t,n){if(!e||e.length===0)return"";const i=this.rules;if(e.length===1)return D1e(e,t,n,this,i);const o=t.xhtmlOut===!0,s=o?`
        +`:`
        +`,r=t.breaks?s:` +`,l=i.text,a=i.text_special,u=i.softbreak,c=i.hardbreak,d=i.html_inline,f=i.code_inline,h=i.link_open,m=i.link_close,g=i.em_open,y=i.em_close,k=i.strong_open,v=i.strong_close;let C="";for(let w=0;w`;if(u===yi.softbreak&&w+3`,w+=1;continue}if(M.type==="em_open"&&!g&&!y&&w+2${x}`,w+=2;continue}}}if(M.type==="strong_open"&&!k&&!v&&w+2${x}`,w+=2;continue}}}switch(M.type){case"text":if(l===yi.text){const S=M.content.length===0?"":Pi(M.content);if(d===yi.html_inline&&w+1=4)return!0;continue}if(l===9){if(r+=4-r%4,s++,r>=4)return!0;continue}break}if(s0&&u<=6){if(a=3)return!0;break}default:if(l>=48&&l<=57){let a=s+1;for(;a57)break;a++}if(a=Z,!Y&&se!==void 0&&(he=Mo(e),Y=he>=se)),Y){const U=this.parseFullDocument(e,O,n,he,!1);return this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ts(O,{area:"stream",path:"stream-full",reason:"skip-cache-large-one-shot",unbounded:!!Bc(O)?.unbounded}),U.tokens}else if(z){const U=(ge,ae,Ce)=>geCe?Ce:ge;he===void 0&&(he=Mo(e));const Q=le&&!te?fL(e.length,he,n.options):null,ue=Q?.maxChunkChars??(W?U(Math.ceil(e.length/$),8e3,64e3):K??1e4),me=Q?.maxChunkLines??(W?U(Math.ceil(he/$),150,700):ne??200),pe=Q?.maxChunks??(W?U(Math.ceil(e.length/64e3),$,32):G),ee=e.length>0&&e.charCodeAt(e.length-1)===10,re=P&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&Q?.strategy!=="plain";if((F||re)&&(e.length>=ue*2||he>=me*2)&&ee){const ge=tb(n,e,O,{maxChunkChars:ue,maxChunkLines:me,fenceAware:Q?.fenceAware??ie,maxChunks:pe});return this.cache={src:e,tokens:ge,env:O,lineCount:he,lastSegment:void 0,globalStateReason:kl(e)},this.updateCacheLineCount(this.cache,he),this.recordChunkedParseResult(O,F?"explicit-initial-large-doc":"default-initial-large-doc"),ge}}const J=this.parseFullDocument(e,O,n,he);return he=J.lineCount,this.cache={src:e,tokens:J.tokens,env:O,lineCount:he,lastSegment:void 0,globalStateReason:kl(e)},this.updateCacheLineCount(this.cache,he),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ts(O,{area:"stream",path:"stream-full",reason:"initial-parse",unbounded:!!Bc(O)?.unbounded}),J.tokens}if(e===o.src)return this.stats.total+=1,this.stats.cacheHits+=1,this.stats.lastMode="cache",ts(o.env,{area:"stream",path:"stream-cache",reason:"same-source"}),o.tokens;const s=e.startsWith(o.src)?e.slice(o.src.length):null;let r=o.globalStateReason;r===void 0&&(r=kl(o.src),o.globalStateReason=r);const l=r?null:s!==null?this.detectGlobalStateForAppend(o,s):kl(e),a=r||l;if(a){const O=i??o.env;ad(O);const H=kl(e),R=this.parseFullDocument(e,O,n),F=R.tokens,P=R.lineCount;return this.cache={src:e,tokens:F,env:O,lineCount:P,lastSegment:void 0,globalStateReason:H},this.updateCacheLineCount(this.cache,P),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ts(O,{area:"stream",path:"stream-full",reason:`global-state:${a}`,unbounded:!!Bc(O)?.unbounded}),F}const u=n.options?.streamOptimizationMinSize??this.MIN_SIZE_FOR_OPTIMIZATION;if(o.src.length5e3?H=8:c.length>1e3?H=6:c.length>200&&(H=4),H=Math.min(H,O);let R=null;const F=n.options?.streamContextParseStrategy??"chars",P=n.options?.streamContextParseMinChars??200,z=n.options?.streamContextParseMinLines??2;let W;const $=()=>(W===void 0&&(W=Mo(c)),W),K=this.canDirectlyParseAppend(o),ne=K&&this.shouldUseUnboundedAppend(e,o,c);let G=!1;if(!K)switch(F){case"lines":G=$()>=z;break;case"constructs":if(c.length>=P){G=!0;break}if(B1e(c)){G=!0;break}G=$()>=z;break;case"chars":default:G=c.length>=P}if(H>0&&G){const ie=this.getTailLines(o.src,H)+c;try{const _e=this.core.parse(ie,o.env,n).tokens,Z=_e.findIndex(se=>se.map&&typeof se.map[1]=="number"&&se.map[1]>H);if(Z!==-1){const se=_e.slice(Z),he=O-H;he!==0&&this.shiftTokenLines(se,he),R={tokens:se}}}catch{R=null}}else R=null;if(!R){const ie=O;if(ne)R={tokens:D0(n,c,o.env,{mode:"stream"})},ie>0&&this.shiftTokenLines(R.tokens,ie);else{const _e=this.core.parse(c,o.env,n);ie>0&&this.shiftTokenLines(_e.tokens,ie),R=_e}}let te=0;if(o.tokens.length>0&&R.tokens.length>0){const ie=o.tokens[o.tokens.length-1],_e=R.tokens[0];try{ie.type==="inline"&&_e.type==="inline"&&(_e.children&&_e.children.length>0&&(ie.children||(ie.children=[]),this.appendTokens(ie.children,_e.children)),ie.content=(ie.content||"")+(_e.content||""),te=1)}catch{te=0}}const le=o.tokens.length;if(R.tokens.length>te){const ie=o.tokens,_e=R.tokens,Z=Math.min(ie.length,_e.length-te);let se=0;for(let he=Z;he>0;he--){let Y=!0;for(let J=0;J0&&(te+=se),_e.length>te&&this.appendTokens(o.tokens,_e,te)}if(o.src=e,o.globalStateReason=null,o.lineCount=O+(W??$()),o.tokens.length>le){const ie=this.getLastSegment(o.tokens,e,le,o.tokens.length,e.length-c.length,O);ie?o.lastSegment=ie:o.lastSegment=void 0}else o.lastSegment=void 0;return this.stats.total+=1,this.stats.appendHits+=1,ne&&(this.stats.unboundedAppendHits=(this.stats.unboundedAppendHits||0)+1),this.stats.lastMode="append",ts(o.env,{area:"stream",path:ne?"stream-unbounded-append":"stream-append",reason:ne?"large-delta":"safe-append",unbounded:ne}),o.tokens}const d=i??o.env,f=this.tryTailSegmentReparse(e,o,d,n);if(f)return this.stats.total+=1,this.stats.tailHits+=1,this.stats.lastMode="tail",ts(d,{area:"stream",path:"stream-tail",reason:"tail-reparse"}),f;const h=!!n.__explicitStreamChunkFallbackSetting,m=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,g=!!n.options?.streamChunkedFallback,y=!h&&!c&&m,k=g||y,v=n.options?.streamChunkAdaptive!==!1,C=n.options?.streamChunkTargetChunks??8,w=n.options?.streamChunkSizeChars,M=n.options?.streamChunkSizeLines,L=n.options?.streamChunkMaxChunks,E=!!n.__explicitStreamChunkConfig,S=n.options?.autoTuneChunks!==!1,x=n.options?.streamChunkFenceAware??!0;let A=c&&o.lineCount!==void 0?o.lineCount+Mo(c):void 0;if(k){A===void 0&&(A=Mo(e));const O=($,K,ne)=>$ne?ne:$,H=S&&!E?fL(e.length,A,n.options):null,R=H?.maxChunkChars??(v?O(Math.ceil(e.length/C),8e3,64e3):w??1e4),F=H?.maxChunkLines??(v?O(Math.ceil(A/C),150,700):M??200),P=H?.maxChunks??(v?O(Math.ceil(e.length/64e3),C,32):L),z=e.length>0&&e.charCodeAt(e.length-1)===10,W=y&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&H?.strategy!=="plain";if((g||W)&&(e.length>=R*2||A>=F*2)&&z){const $=tb(n,e,d,{maxChunkChars:R,maxChunkLines:F,fenceAware:H?.fenceAware??x,maxChunks:P});return this.cache={src:e,tokens:$,env:d,lineCount:A,lastSegment:void 0,globalStateReason:kl(e)},this.updateCacheLineCount(this.cache,A),this.recordChunkedParseResult(d,g?"explicit-fallback-large-doc":"default-fallback-large-doc"),$}}const T=this.parseFullDocument(e,d,n,A),I=T.tokens;return A=T.lineCount,this.cache={src:e,tokens:I,env:d,lineCount:A,lastSegment:void 0,globalStateReason:kl(e)},this.updateCacheLineCount(this.cache,A),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ts(d,{area:"stream",path:"stream-full",reason:"fallback-full",unbounded:!!Bc(d)?.unbounded}),I}recordChunkedParseResult(e,t){const n=Bc(e)?.chunk,i=n?.fallback?String(n.fallbackReason||"global-state"):null;if(this.stats.total+=1,i){this.stats.fullParses+=1,this.stats.lastMode="full",ts(e,{area:"stream",path:"stream-full",reason:`global-state:${i}`,unbounded:!!Bc(e)?.unbounded});return}this.stats.chunkedParses=(this.stats.chunkedParses||0)+1,this.stats.lastMode="chunked",ts(e,{area:"stream",path:"stream-chunked",chunked:!0,reason:t})}parseFullDocument(e,t,n,i,o=!0){const s=kl(e);u2(t)&&ad(t);const r=typeof n.__canUseImplicitLargeInputStrategy!="function"||n.__canUseImplicitLargeInputStrategy()?PH(n,e.length,i):"no";if(r==="yes"){const a=D0(n,e,t);return ts(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-char-threshold",unbounded:!0}),{tokens:a,lineCount:i??(o?Mo(e):0)}}let l=i;if(r==="need-lines"&&(l=Mo(e),OH(n,e.length,l))){const a=D0(n,e,t);return ts(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-line-threshold",unbounded:!0}),{tokens:a,lineCount:l}}return l===void 0&&(l=o?Mo(e):0),{tokens:im(t,s,()=>this.core.parse(e,t,n).tokens),lineCount:l}}shouldUseUnboundedAppend(e,t,n){return!n||e.length=this.MIN_UNBOUNDED_APPEND_CHARS?!0:Mo(n)>=this.MIN_UNBOUNDED_APPEND_LINES}getAppendedSegment(e,t,n){if(n===null||n===void 0&&!t.startsWith(e)||!e.endsWith(` +`))return null;const i=n??t.slice(e.length);if(!i)return null;const o=i.length;if(i.charCodeAt(o-1)!==10)return null;let s=0,r=-1;for(let a=0;a=2));a++);if(s<2)return null;const l=(r===-1?i:i.slice(0,r)).trim();if(l.length===0)return null;if(/^[-=]+$/.test(l)){const a=e.slice(0,-1),u=a.lastIndexOf(` +`);if(a.slice(u+1).trim().length>0)return null}return this.endsInsideOpenFence(e)||this.mayContainReferenceDefinition(i)?null:i}tryTailSegmentReparse(e,t,n,i){const o=this.ensureLastSegment(t);if(!o||o.srcOffset<=0&&o.tokenStart<=0)return null;const s=t.src.slice(0,o.srcOffset);if(!e.startsWith(s))return null;const r=t.src.slice(o.srcOffset),l=e.slice(o.srcOffset);if(l===r)return null;const a=e.startsWith(t.src)?e.slice(t.src.length):null;if(a){const u=this.tryContainerTailAppendMerge(e,t,n,i,o,a);if(u)return u}if(this.mayContainReferenceDefinition(r)||this.mayContainReferenceDefinition(l))return null;try{const u=this.core.parse(l,n,i),c=this.getLastSegment(u.tokens,l);return o.lineStart>0&&this.shiftTokenLines(u.tokens,o.lineStart),t.src=e,t.env=n,t.globalStateReason=null,t.globalStateCarry=void 0,t.tokens.length=o.tokenStart,this.appendTokens(t.tokens,u.tokens),t.lineCount=o.lineStart+Mo(l),c?t.lastSegment={tokenStart:o.tokenStart+c.tokenStart,tokenEnd:o.tokenStart+c.tokenEnd,lineStart:o.lineStart+c.lineStart,lineEnd:o.lineStart+c.lineEnd,srcOffset:o.srcOffset+c.srcOffset}:t.lastSegment=null,t.tokens}catch{return null}}getTailLines(e,t){if(t<=0)return"";let n=t;for(let i=e.length-1;i>=0;i--)if(e.charCodeAt(i)===10&&(n--,n===0))return e.slice(i+1);return e}endsInsideOpenFence(e){const n=e.length>4e3?e.length-4e3:0,i=e.slice(n),o=i.length;let s=null,r=0;for(;r<=o;){let l=i.indexOf(` +`,r);l===-1&&(l=o);let a=r;for(;a=3&&(s?s.marker===u&&d>=s.length&&(s=null):s={marker:u,length:d})}}if(l===o)break;r=l+1}return s!==null}peek(){return this.cache?.tokens??P1e}getStats(){return{...this.stats}}appendTokens(e,t,n=0,i=t.length){for(let o=n;oK3?n.slice(n.length-K3):n,i&&(e.globalStateReason=i),i}ensureLastSegment(e){return e.lastSegment!==void 0||(e.lastSegment=this.getLastSegment(e.tokens,e.src)),e.lastSegment}getLastSegment(e,t,n=0,i=e.length,o,s){if(i<=n)return null;let r=Number.POSITIVE_INFINITY,l=-1,a=0;for(let u=i-1;u>=n;u--){const c=e[u];if(c.map&&(c.map[0]l&&(l=c.map[1])),c.nesting<0){a+=-c.nesting;continue}if(c.nesting>0){if(a-=c.nesting,c.level===0&&a<=0){const d=Number.isFinite(r)?r:c.map?.[0]??0,f=l>=d?l:c.map?.[1]??d;return{tokenStart:u,tokenEnd:i,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,o,s)}}continue}if(c.level===0&&a===0){const d=Number.isFinite(r)?r:c.map?.[0]??0,f=l>=d?l:c.map?.[1]??d;return{tokenStart:u,tokenEnd:i,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,o,s)}}}return null}getLineStartOffset(e,t,n,i){if(n!==void 0&&i!==void 0&&t>=i)return this.getLineStartOffsetFrom(e,n,t-i);if(t<=0)return 0;let o=t,s=-1;for(;o>0;){if(s=e.indexOf(` +`,s+1),s===-1)return e.length;o--}return s+1}getLineStartOffsetFrom(e,t,n){if(n<=0)return t;let i=n,o=t-1;for(;i>0;){if(o=e.indexOf(` +`,o+1),o===-1)return e.length;i--}return o+1}mayContainReferenceDefinition(e){return e.includes("]:")?/(?:^|\n)[ \t]{0,3}\[[^\]\n]+\]:/.test(e):!1}canDirectlyParseAppend(e){if(!this.endsWithBlankLine(e.src))return!1;const t=this.ensureLastSegment(e);if(!t)return!1;switch(e.tokens[t.tokenStart]?.type){case"paragraph_open":case"heading_open":case"fence":case"code_block":case"html_block":case"hr":case"table_open":return!0;default:return!1}}tryContainerTailAppendMerge(e,t,n,i,o,s){if(!s||this.mayContainReferenceDefinition(s))return null;const r=t.tokens[o.tokenStart];switch(r?.type){case"bullet_list_open":case"ordered_list_open":return this.tryListTailAppendMerge(e,t,n,i,o,s,r);case"table_open":return this.tryTableTailAppendMerge(e,t,n,i,o,s,r);default:return null}}tryListTailAppendMerge(e,t,n,i,o,s,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10)return null;const l=o.lineEnd-o.lineStart,a=t.src.length-o.srcOffset;if(l0&&this.shiftTokenLines(d,f);const h=this.getListParagraphMode(t.tokens,o.tokenStart,t.tokens.length,r.level),m=this.getListParagraphMode(c,0,c.length,0);(h==="loose"||m==="loose"||this.endsWithBlankLine(t.src)||(c[0]?.map?.[0]??0)>0)&&(this.setListParagraphVisibility(t.tokens,o.tokenStart,t.tokens.length,r.level,!1),this.setListParagraphVisibility(d,0,d.length,r.level,!1)),t.tokens.splice(t.tokens.length-1,0,...d),t.src=e,t.env=n,t.globalStateReason=null;const g=f+Mo(s);t.lineCount=g;const y=this.getDocLineCount(e,g);return r.map&&(r.map[1]=y),t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:y,srcOffset:o.srcOffset},t.tokens}tryTableTailAppendMerge(e,t,n,i,o,s,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10||/(?:^|\n)[ \t]*\n/.test(s))return null;const l=o.lineEnd-o.lineStart,a=t.src.length-o.srcOffset;if(l=0?d.slice(f.tbodyOpenIndex+1,f.tbodyCloseIndex):d.slice(f.tbodyOpenIndex,f.tbodyCloseIndex+1);if(m.length===0)return null;const g=o.lineEnd-2;g!==0&&this.shiftTokenLines(m,g);const y=h.tbodyCloseIndex>=0?h.tbodyCloseIndex:h.tableCloseIndex,k=t.lineCount??Mo(t.src);t.tokens.splice(y,0,...m),t.src=e,t.env=n,t.globalStateReason=null;const v=k+Mo(s);t.lineCount=v;const C=this.getDocLineCount(e,v);if(r.map&&(r.map[1]=C),h.tbodyOpenIndex>=0){const w=t.tokens[h.tbodyOpenIndex];w?.map&&(w.map[1]=C)}return t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:C,srcOffset:o.srcOffset},t.tokens}getTableHeaderContext(e){const t=e.indexOf(` +`);if(t<0)return null;const n=e.indexOf(` +`,t+1);return n<0?null:e.slice(0,n+1)}getTableBodySection(e,t,n,i){if(t<0||t>=n||e[t]?.type!=="table_open")return null;let o=-1;for(let l=n-1;l>t;l--){const a=e[l];if(a.type==="table_close"&&a.level===i){o=l;break}}if(o<0)return null;let s=-1,r=-1;for(let l=t+1;l=0){for(let l=o-1;l>s;l--){const a=e[l];if(a.type==="tbody_close"&&a.level===i+1){r=l;break}}if(r<0)return null}return{tableCloseIndex:o,tbodyOpenIndex:s,tbodyCloseIndex:r}}isSingleTopLevelContainer(e,t,n,i){if(e.length<2)return!1;const o=e[0],s=e[e.length-1];if(o.type!==t||s.type!==n||o.level!==0||s.level!==0||i!==void 0&&o.markup!==i)return!1;let r=0;for(let l=0;l0&&l0||a.nesting<0)&&(r+=a.nesting)}return r===0}getListParagraphMode(e,t,n,i){let o=!1,s=!1;const r=i+2;for(let l=t;l=0;){const i=e.charCodeAt(n);if(i===32||i===9){n--;continue}return i===10}return!0}getDocLineCount(e,t=Mo(e)){return e.length===0?0:e.charCodeAt(e.length-1)===10?t:t+1}shiftTokenLines(e,t){if(t===0)return;let n=null;for(let i=0;i=0;s--)n.push(o.children[s]);for(;n.length>0;){const s=n.pop();if(s.map&&(s.map[0]+=t,s.map[1]+=t),s.children)for(let r=s.children.length-1;r>=0;r--)n.push(s.children[r])}}}}};const yL={default:T1e,zero:E1e,commonmark:M1e};function H1e(e){return{core:e.core.ruler.version,block:e.block.ruler.version,inline:e.inline.ruler.version,inline2:e.inline.ruler2.version}}function W1e(e,t){return e.core.ruler.version!==t.core||e.block.ruler.version!==t.block||e.inline.ruler.version!==t.inline||e.inline.ruler2.version!==t.inline2}function kL(e){return e.experimental?{...e,...e.experimental}:e}function Ea(e,t){if(!e)return!1;if(Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==void 0)return!0;const n=e.experimental;return!!n&&Object.prototype.hasOwnProperty.call(n,t)&&n[t]!==void 0}function bL(e,t,n){for(let i=0;i=4?n.quotes=[S[0],S[1],S[2],S[3]]:n.quotes=["“","”","‘","’"]}let r=bL(s?.options,o,["fullChunkSizeChars","fullChunkSizeLines","fullChunkMaxChunks"]),l=bL(s?.options,o,["streamChunkSizeChars","streamChunkSizeLines","streamChunkMaxChunks"]),a=wL(s?.options,o,"fullChunkedFallback"),u=wL(s?.options,o,"streamChunkedFallback"),c=!1,d=null,f=null;const h=new Fpe;let m=null;const g=()=>(m||(m=new O1e(n)),m);let y=null;const k=()=>(y||(y=new j1e(h)),y);let v=null;const C=()=>(v||(v=new Kj({fuzzyLink:!0})),v),w=S=>!c&&!!d&&!W1e(S,d),M=(S,x)=>i==="default"&&!c&&m===null&&f!==null&&S.parse===f&&w(S)&&!S.stream.enabled&&x<(S.options.autoUnboundedThresholdChars??4e6)&&S.options.html===!1&&S.options.xhtmlOut===!1&&S.options.breaks===!1&&S.options.langPrefix==="language-"&&S.options.linkify===!1&&S.options.typographer===!1&&S.options.highlight===null,L=(S,x)=>i==="default"&&!c&&w(S)&&!S.stream.enabled&&!S.options.fullChunkedFallback&&x<(S.options.autoUnboundedThresholdChars??4e6)&&S.options.html===!1&&S.options.linkify===!1&&S.options.typographer===!1,E={core:h,block:h.block,inline:h.inline,get linkify(){const S=C();return Object.defineProperty(this,"linkify",{value:S,writable:!0,configurable:!0}),S},get renderer(){const S=g();return Object.defineProperty(this,"renderer",{value:S,writable:!0,configurable:!0}),S},options:n,__explicitFullChunkConfig:r,__explicitStreamChunkConfig:l,__explicitFullChunkFallbackSetting:a,__explicitStreamChunkFallbackSetting:u,__canUseImplicitLargeInputStrategy(){return w(this)},set(S){const x=kL(S);return this.options={...this.options,...x},(Ea(S,"fullChunkSizeChars")||Ea(S,"fullChunkSizeLines")||Ea(S,"fullChunkMaxChunks"))&&(r=!0,this.__explicitFullChunkConfig=!0),(Ea(S,"streamChunkSizeChars")||Ea(S,"streamChunkSizeLines")||Ea(S,"streamChunkMaxChunks"))&&(l=!0,this.__explicitStreamChunkConfig=!0),Ea(S,"fullChunkedFallback")&&(a=!0,this.__explicitFullChunkFallbackSetting=!0),Ea(S,"streamChunkedFallback")&&(u=!0,this.__explicitStreamChunkFallbackSetting=!0),m&&m.set(x),typeof x.stream=="boolean"&&(this.stream.enabled=x.stream,y&&(y.reset(),y.resetStats())),this},configure(S){const x=typeof S=="string"?yL[S]:S;if(!x)throw new Error("Wrong `markdown-it` preset, can't be empty");if(x.options&&this.set(x.options),x.components){const A=x.components;A.core?.rules&&this.core.ruler.enableOnly(A.core.rules),A.block?.rules&&this.block.ruler.enableOnly(A.block.rules),A.inline?.rules&&this.inline.ruler.enableOnly(A.inline.rules),A.inline2?.rules&&this.inline.ruler2.enableOnly(A.inline2.rules)}return this},enable(S,x){const A=Array.isArray(S)?S:[S],T=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],I=new Set;for(const O of T){if(!O)continue;const H=O.enable(A,!0);for(let R=0;R!I.has(H));if(O.length)throw new Error(`Rules manager: invalid rule name ${O.join(", ")}`)}return this},disable(S,x){const A=Array.isArray(S)?S:[S],T=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],I=new Set;for(const O of T){if(!O)continue;const H=O.disable(A,!0);for(let R=0;R!I.has(H));if(O.length)throw new Error(`Rules manager: invalid rule name ${O.join(", ")}`)}return this},use(S,...x){const A=typeof S=="function"?S:S&&typeof S.default=="function"?S.default:void 0;if(!A)throw new TypeError("MarkdownIt.use: plugin must be a function");const T=[this,...x],I=S;return c=!0,A.apply(I,T),this},render(S,x){let A;if(M(this,S.length)){x!==void 0&&(Ur(x),A=R3("render"));const O=A?l1():0,H=A?uL(S,A):aL(S);if(A&&(A.attemptMs=l1()-O,H===null&&(A.fallbackReason="unsupported-stock-subset"),Dg(x,A)),H!==null)return x!==void 0&&ts(x,{area:"render",path:"stock-fast",reason:"stock-subset"}),H}const T=x??{},I=this.parse(S,T);return A&&Dg(T,A),g().render(I,this.options,T)},async renderAsync(S,x){let A;if(M(this,S.length)){x!==void 0&&(Ur(x),A=R3("render"));const O=A?l1():0,H=A?uL(S,A):aL(S);if(A&&(A.attemptMs=l1()-O,H===null&&(A.fallbackReason="unsupported-stock-subset"),Dg(x,A)),H!==null)return x!==void 0&&ts(x,{area:"render",path:"stock-fast",reason:"stock-subset"}),H}const T=x??{},I=this.parse(S,T);return A&&Dg(T,A),g().renderAsync(I,this.options,T)},renderIterable(S,x={}){const A=this.parseIterable(S,x);return g().render(A,this.options,x)},async renderAsyncIterable(S,x={}){const A=await this.parseAsyncIterable(S,x);return g().renderAsync(A,this.options,x)},renderInline(S,x={}){const A=this.parseInline(S,x);return g().render(A,this.options,x)},validateLink:AH,normalizeLink:xH,normalizeLinkText:SH,utils:ufe,helpers:{...Yfe},parse(S,x){if(typeof S!="string")throw new TypeError("Input data should be a String");if(x!==void 0&&Ur(x),L(this,S.length)){const O=x===void 0?void 0:R3("parse"),H=O?l1():0,R=Upe(S,O);if(O&&(O.attemptMs=l1()-H,R===null&&(O.fallbackReason="unsupported-stock-subset"),Dg(x,O)),R!==null)return x!==void 0&&ts(x,{area:"parse",path:"stock-fast",reason:"stock-subset"}),R}const A=x??{};let T;if(!this.stream.enabled&&!this.options.fullChunkedFallback&&w(this)){const O=PH(this,S.length);if(O==="yes"){const H=D0(this,S,A);return ts(x,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"char-threshold"}),H}O==="need-lines"&&(T=Mo(S))}if(!this.stream.enabled){const O=S.length,H=this.options.autoTuneChunks!==!1,R=r,F=!a&&w(this),P=!!this.options.fullChunkedFallback,z=F&&O>=2e5;let W;(P||z||T!==void 0)&&(W=T??Mo(S));const $=(P||z)&&H&&!R?I1e(O,W,this.options):null;if(P||z){const K=W??0;if(P?O>=(this.options.fullChunkThresholdChars??2e4)||K>=(this.options.fullChunkThresholdLines??400):z){if($&&$.strategy!=="plain"){const ne=tb(this,S,A,{maxChunkChars:$.maxChunkChars,maxChunkLines:$.maxChunkLines,fenceAware:$.fenceAware,maxChunks:$.maxChunks});return x&&CL(x,P?"explicit-full-chunk":"default-large-string"),ne}if(P){const ne=(Y,J,U)=>YU?U:Y,G=this.options.fullChunkAdaptive!==!1,te=this.options.fullChunkTargetChunks??8,le=ne(Math.ceil(O/te),8e3,64e3),ie=ne(Math.ceil(K/te),150,700),_e=G?le:this.options.fullChunkSizeChars??1e4,Z=G?ie:this.options.fullChunkSizeLines??200,se=G?ne(Math.ceil(O/64e3),te,32):this.options.fullChunkMaxChunks,he=tb(this,S,A,{maxChunkChars:_e,maxChunkLines:Z,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:se});return x&&CL(x,"explicit-full-chunk"),he}}}if(T!==void 0&&w(this)&&OH(this,O,W??T)){const K=D0(this,S,A);return ts(x,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"line-threshold"}),K}}const I=kl(S);return ts(x,{area:"parse",path:"plain",reason:"default-plain"}),im(A,I,()=>h.parse(S,A,this).tokens)},parseIterable(S,x={}){return Ur(x),A1e(this,S,x)},parseAsyncIterable(S,x={}){return Ur(x),x1e(this,S,x)},parseIterableToSink(S,x,A={}){return Ur(A),S1e(this,S,x,A)},parseAsyncIterableToSink(S,x,A={}){return Ur(A),_1e(this,S,x,A)},parseInline(S,x={}){if(typeof S!="string")throw new TypeError("Input data should be a String");Ur(x),u2(x)&&ad(x);const A=h.createState(S,x,this);return A.inlineMode=!0,h.process(A),A.tokens}};if(E.stream={enabled:!!n.stream,parse(S,x){return E.stream.enabled?k().parse(S,x,E):E.parse(S,x??{})},reset(){k().reset()},peek(){return y?y.peek():[]},stats(){return y?y.getStats():{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}},resetStats(){y&&y.resetStats()}},s?.components){const S=s.components;S.core?.rules&&E.core.ruler.enableOnly(S.core.rules),S.block?.rules&&E.block.ruler.enableOnly(S.block.rules),S.inline?.rules&&E.inline.ruler.enableOnly(S.inline.rules),S.inline2?.rules&&E.inline.ruler2.enableOnly(S.inline2.rules)}return d=H1e(E),f=E.parse,E}var U1e=q1e;const HH=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],V1e=["a","abbr","b","bdi","bdo","button","cite","code","data","del","dfn","em","font","i","ins","kbd","label","mark","q","s","samp","small","span","strong","sub","sup","time","u","var"],WH=["article","aside","blockquote","details","div","figcaption","figure","footer","header","h1","h2","h3","h4","h5","h6","li","main","nav","ol","p","pre","section","summary","table","tbody","td","th","thead","tr","ul"],K1e=["svg","g","path"],Z1e=["address","audio","body","canvas","caption","colgroup","datalist","dd","dialog","dl","dt","fieldset","form","head","hgroup","html","iframe","legend","map","menu","meter","noscript","object","optgroup","option","output","picture","progress","rp","rt","ruby","script","select","style","template","textarea","tfoot","title","video"],G1e=["onclick","onerror","onload","onmouseover","onmouseout","onmousedown","onmouseup","onkeydown","onkeyup","onfocus","onblur","onsubmit","onreset","onchange","onselect","ondblclick","ontouchstart","ontouchend","ontouchmove","ontouchcancel","onwheel","onscroll","oncopy","oncut","onpaste","oninput","oninvalid","onsearch","innerhtml","outerhtml","textcontent","innertext","srcdoc","ping"],Q1e=["action","data","href","src","srcset","poster","xlink:href","formaction"],Y1e=["script"],J1e=["pre","iframe","picture","script","style","table","tbody","td","tfoot","th","thead","textarea","tr","title","video"],Sf=new Set(HH),qH=new Set(WH),Lv=new Set([...HH,...V1e,...WH,...K1e]),UH=new Set([...Lv,...Z1e]),X1e=new Set(G1e),eme=new Set(Q1e),f2=new Set(Y1e),VH=new Set(J1e);function KH(e){let t="";for(const n of e){const i=n.charCodeAt(0);i<=31||i>=127&&i<=159||/\s/u.test(n)||(t+=n)}return t}const tme={amp:"&",bsol:"\\",colon:":",newline:` +`,sol:"/",tab:" "};function ZH(e){return e.replace(/&(?:#(\d+)|#x([0-9a-f]+)|([a-z][a-z0-9]+));?/gi,(t,n,i,o)=>{const s=n??i;if(s){const r=Number.parseInt(s,n?10:16);try{return Number.isFinite(r)?String.fromCodePoint(r):""}catch{return""}}return tme[String(o??"").toLowerCase()]??t})}const _y=new Set(["http","https","mailto","tel"]),nme=new Set(["javascript","vbscript","data","file","ftp","blob","filesystem","intent","chrome","chrome-extension","moz-extension","ms-browser-extension","view-source"]),fh=new Set(["http","https"]);function GH(e){return e.match(/^([a-z][a-z0-9+.-]*):/i)?.[1]?.toLowerCase()??""}const ime=/^https?:\/\//i;function ome(e){if(!ime.test(e))return!1;for(const t of e){const n=t.charCodeAt(0);if(t==="&"||n<=32||n>=127&&n<=159||n>127&&/\s/u.test(t))return!1}return!0}function sme(e,t,n){if(!P0(t,n)||!e.startsWith("file:///"))return!1;const i=e.charAt(8);return i!=="/"&&i!=="\\"}function P0(e,t){return e?(e==="a"||e==="area")&&(!t||t==="href"||t==="xlink:href"):!t||t==="href"}function rme(e,t){return t==="href"||t==="xlink:href"?P0(e,t)?_y:fh:t==="src"||t==="srcset"||t==="poster"||t==="action"||t==="formaction"||t==="data"?fh:(P0(e,t),_y)}function ip(e,t={}){if(ome(e))return!1;const n=KH(ZH(e)).toLowerCase(),i=String(t.tagName??"").toLowerCase(),o=String(t.attrName??"").toLowerCase();if(!n)return!1;if(n.startsWith("data:")){const r=/^data:image\/(?:png|gif|jpe?g|webp|avif|bmp);/i.test(n);return i==="img"&&o==="src"?!r:!0}if(/^[\\/]{2}/.test(n))return!0;if(n.startsWith("/")||n.startsWith("./")||n.startsWith("../")||n.startsWith("#")||n.startsWith("?"))return!1;const s=GH(n);return s?s==="file"?!sme(n,i,o):P0(i,o)?nme.has(s):!rme(i,o).has(s):!1}function lme(e){const t=ZH(String(e??"")).trim();if(!t||t.startsWith("#")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("?"))return!1;const n=GH(KH(t).toLowerCase());return n==="http"||n==="https"}function ame(e,t={}){const n=String(e??"").trim();return n?ip(n,t)?"":n:""}function AL(e){return ame(e,{tagName:"img",attrName:"src"})}function ume(e,t,n){function i(f){return f.trim().split(" ",2)[0]===t}function o(f,h,m,g,y){return f[h].nesting===1&&f[h].attrJoin("class",t),y.renderToken(f,h,m,g,y)}n=n||{};const s=3,r=n.marker||":",l=r.charCodeAt(0),a=r.length,u=n.validate||i,c=n.render||o;function d(f,h,m,g){let y,k=!1,v=f.bMarks[h]+f.tShift[h],C=f.eMarks[h];if(l!==f.src.charCodeAt(v))return!1;for(y=v+1;y<=C&&r[(y-v)%a]===f.src[y];y++);const w=Math.floor((y-v)/a);if(w=m||(v=f.bMarks[E]+f.tShift[E],C=f.eMarks[E],v=4)){for(y=v+1;y<=C&&r[(y-v)%a]===f.src[y];y++);if(!(Math.floor((y-v)/a)=2){const r=Number(s[0]),l=Number(s[1]);Number.isFinite(r)&&Number.isFinite(l)&&(o.map=[r+t,Math.min(l+t,n)])}Array.isArray(o.children)&&QH(o.children,t,n)}}function dme(e){["admonition","info","warning","error","tip","danger","note","caution"].forEach(t=>{e.use(ume,t,{render(n,i){return n[i].nesting===1?`
        `:`
        +`}})}),e.block.ruler.before("fence","vmr_container_fallback",(t,n,i,o)=>{const s=t,r=s.bMarks[n]+s.tShift[n],l=s.eMarks[n],a=s.src.slice(r,l),u=a.match(/^:::\s*([^\s{]+)/);if(!u)return!1;const c=u[1];if(!c.trim())return!1;const d=a.slice(u[0].length).trim();let f,h;const m=d.indexOf("{"),g=m>=0?d.slice(m).trimStart():void 0;if(m===-1)f=d||void 0;else{if(f=d.slice(0,m).trim()||void 0,g?.startsWith("{")){let L=0,E=-1;for(let S=0;S0&&(h=g.slice(0,E))}h||(f=d||void 0)}if(o)return!0;const y=!!s.env.__markstreamFinal;let k=n+1,v=!1;for(;k<=i;){const L=s.bMarks[k]+s.tShift[k],E=s.eMarks[k];if(s.src.slice(L,E).trim()===":::"){v=!0;break}k++}v||(k=i);const C=s.push("vmr_container_open","div",1);if(C.attrSet("class",`vmr-container vmr-container-${c}`),C.map=[n,v?k:i],C.meta={...C.meta??{},unclosed:!v&&!y},f&&C.attrSet("data-args",f),h)try{const L=JSON.parse(h);for(const[E,S]of Object.entries(L)){const x=S!=null&&typeof S=="object";C.attrSet(`data-${E}`,x?JSON.stringify(S):String(S))}}catch{const L=cme(h);if(L)for(const[E,S]of Object.entries(L)){const x=S!=null&&typeof S=="object";C.attrSet(`data-${E}`,x?JSON.stringify(S):String(S))}else C.attrSet("data-attrs",h)}const w=[];for(let L=n+1;LL.trim().length>0)){let L=w.join(` +`);L.endsWith(` +`)||(L+=` +`),L.endsWith(` + +`)||(L+=` +`);const E=s.tokens[s.tokens.length-1];E&&(E.raw=L);const S=[];s.md.block.parse(L,s.md,s.env,S),QH(S,n+1,n+1+w.length),s.tokens.push(...S)}const M=s.push("vmr_container_close","div",-1);return v||(M.hidden=!0,M.map=[i,i]),s.line=v?k+1:k,!0},{alt:["paragraph","reference","blockquote","list"]})}function Au(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function No(e){let t=!1,n=!1;for(let i=0;i")return i}return-1}function $4(e){const t=[],n=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let i;for(;(i=n.exec(e))!==null;){const o=i[1];if(!o)continue;const s=i[2]||i[3]||i[4]||"";t.push([o,s])}return t}const fme=/^[a-z][a-z0-9_-]*$/;function xL(e){return fme.test(String(e??"").trim().toLowerCase())}function Va(e){const t=String(e??"").trim();if(!t)return"";if(!t.startsWith("<"))return xL(t)?t.toLowerCase():"";let n=1;for(;n]/.test(s)?"":xL(o)?o:""}function Np(e){if(!e||e.length===0)return[];const t=new Set,n=[];for(const i of e){const o=Va(i);!o||t.has(o)||(t.add(o),n.push(o))}return n}function hme(...e){const t=new Set,n=[];for(const i of e)for(const o of Np(i))t.has(o)||(t.add(o),n.push(o));return n}function pme(e){const t=Np(e);return{key:t.join(","),tags:t}}function YH(e){return Va(e)}function mme(e,t){const n=String(e??""),i=Va(t);if(!i)return!1;const o=Au(i),s=n.match(new RegExp(String.raw`^\s*<\s*${o}(?:\s[^>]*)?(\s*\/)?>`,"i"));return s?s[1]?!0:new RegExp(String.raw`<\s*\/\s*${o}\s*>`,"i").test(n):!1}function JH(e,t){const n=Va(t);return!!n&&!Lv.has(n)&&!mme(e,n)}function gme(e,t){const n=String(e??""),i=Va(t);if(!i)return n;const o=Au(i),s=new RegExp(String.raw`^\s*<\s*${o}(?:\s[^>]*)?>\s*`,"i"),r=new RegExp(String.raw`\s*<\s*\/\s*${o}\s*>\s*$`,"i");return n.replace(s,"").replace(r,"")}const XH=Sf,vme=Lv,eW=new Set(qH);eW.delete("details");const yme=/<([A-Z][\w-]*)(?=[\s/>]|$)/gi,kme=/<\/\s*([A-Z][\w-]*)(?=[\s/>]|$)/gi,vA=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,bme=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function ib(e){return(e.match(vA)?.[1]??"").toLowerCase()}function kx(e){return/^\s*<\s*\//.test(e)}function bx(e,t){return XH.has(t)||/\/\s*>\s*$/.test(e)}function wme(e,t){let n=0;for(let i=0;i0&&n--;continue}bx(o,s)||n++}}return n}function SL(e,t,n=0){const i=new RegExp(String.raw`<\s*(\/?)\s*${Au(t)}(?=[\s>/])[^>]*>`,"gi");i.lastIndex=Math.max(0,n);let o=0,s;for(;(s=i.exec(e))!==null;){const r=s[0]??"",l=!!s[1],a=!l&&/\/\s*>$/.test(r);if(l){if(o===0)return{start:s.index,end:s.index+r.length};o--;continue}a||o++}return null}function Ame(e,t){const n=new RegExp(String.raw`<\s*(\/?)\s*${Au(t)}(?=[\s>/])[^>]*>`,"gi");let i=0,o;for(;(o=n.exec(e))!==null;){const s=o[0]??"",r=!!o[1],l=!r&&/\/\s*>$/.test(s);if(r){i>0&&i--;continue}l||i++}return i}function ob(e){const t=e;return String(t.raw??t.content??t.markup??"")}function xme(e){const t=e;return t.meta||(t.meta={}),t.meta}function Z3(e,t,n){const i=xme(e);i.markstreamCustomHtmlRaw=t,i.markstreamCustomHtmlInner=n}function Sme(e,t){if(!t.size)return;const n=Array.from(t,h=>new RegExp(String.raw`<\s*${Au(h)}(?=[\s>/])`,"i")),i=[];let o=!1;const s=h=>h?n.some(m=>m.test(h)):!1,r=h=>{if(!(!h||!i.length))for(const m of i)m.raw+=h,m.inner+=h},l=()=>{!i.length||!o||(r(` +`),o=!1)},a=h=>{r(h)},u=h=>{for(let g=0;g{const m=i[i.length-1]?.tag;if(!m)return null;const g=new RegExp(String.raw`^\s*<\s*\/\s*${Au(m)}\s*>`,"i");return h.match(g)?.[0]??null},d=h=>!!c(h),f=(h,m,g)=>{const y=g??(h.type==="html_inline"?ib(m):"");if(!(y&&t.has(y))){r(m);return}const k=kx(m),v=!k&&bx(m,y);if(k){if(!i.length||i[i.length-1].tag!==y){r(m);return}u(m);return}if(r(m),v){Z3(h,m,"");return}i.push({tag:y,token:h,raw:m,inner:""})};for(const h of e){if(h.type==="inline"&&Array.isArray(h.children)){const m=String(h.content??"");if(d(m)?o=!1:l(),!i.length&&!s(m)){o=!1;continue}let g=0,y=!0;for(const k of h.children){const v=ob(k),C=k.type==="html_inline"?ib(v):"",w=C&&t.has(C);let M=v;if(y&&m&&v&&(i.length||w)){const L=m.indexOf(v,g);if(L!==-1)a(m.slice(g,L)),M=m.slice(L,L+v.length),g=L+v.length;else{if(i.length&&!w)continue;y=!1}}f(k,M,C)}y&&m&&g0;continue}if(i.length&&typeof h.content=="string"){const m=ob(h),g=h.type==="html_block"?c(m):null;if(g){u(`${o?` +`:""}${g}`),o=i.length>0;continue}if(!h.content)continue;l(),r(h.content),o=!0}}for(const h of i)Z3(h.token,h.raw,h.inner)}function _me(e){return/^\s*<\s*[!?]/.test(e)}function Ime(e){const t=new Set(vme);if(e&&Array.isArray(e))for(const n of e){const i=String(n??"").trim();if(!i)continue;const o=i.match(/^[<\s/]*([A-Z][\w-]*)/i);o&&t.add(o[1].toLowerCase())}return t}function _L(e,t){if(t.has(e))return!0;for(const n of t)if(n.startsWith(e))return!0;return!1}function Mme(e,t){let n=null;for(const s of e.matchAll(yme)){const r=s.index??-1;if(r<0)continue;const l=(s[1]??"").toLowerCase();_L(l,t)&&No(e.slice(r))===-1&&(!n||r")&&(!n||s")&&(!n||s{const h=f,m=new Set(n),g=Array.isArray(h.env?.__markstreamCustomHtmlTags)?h.env.__markstreamCustomHtmlTags:[];for(const C of g){const w=Va(String(C??""));w&&m.add(w)}const y=Ime(Array.from(m)),k=new Set(Lme);for(const C of m)k.add(C);return{autoCloseInlineTagSet:k,commonHtmlTags:y,customTagSet:m,shouldMergeHtmlBlockTag:C=>m.has(C)||!y.has(C)||eW.has(C)}},o=f=>{if(f.type==="html_block")return String(f.content??"");if(f.type!=="inline"||!Array.isArray(f.children)||f.children.length!==1)return"";const h=f.children[0];return h?.type!=="html_block"?"":String(f.content??h.content??"")},s=(f,h)=>{f.type="html_block",f.content=h,f.raw=h,f.children=[]},r=f=>f.replace(/^(?:\r?\n)+/,""),l=f=>/^(?: {4}|\t)/.test(f),a=f=>f.replace(/^(?: {4}|\t)/gm,""),u=(f,h)=>{const m=r(f);if(!/\S/.test(m))return[];if(l(m))return[{type:"code_block",content:a(m),raw:m}];const g=m.replace(/^[\t ]+/,"");if(!g)return[];if(g.startsWith("<"))return[{type:"html_block",content:g}];const y={type:"inline",tag:"",nesting:0,content:g,children:[{type:"text",content:g,raw:g}]};return h==="paragraph"?[{type:"paragraph_open",tag:"p",nesting:1},y,{type:"paragraph_close",tag:"p",nesting:-1}]:h==="text"?[{type:"text",content:g,raw:g}]:[y]},c=(f,h,m)=>f[h-1]?.type==="paragraph_open"&&f[h+1]?.type==="paragraph_close"?"inline":m,d=(f,h)=>{const m=r(h);return!/\S/.test(m)||f.type!=="inline"||!Array.isArray(f.children)?!1:(f.content=`${String(f.content??"")}${m}`,f.children.push({type:"text",content:m,raw:m}),!0)};e.core.ruler.after("inline","fix_html_inline_streaming",f=>{const h=f.tokens??[],{commonHtmlTags:m,customTagSet:g}=i(f);for(const y of h){const k=y;if(k.type!=="inline"||!Array.isArray(k.children))continue;const v=String(k.content??""),C=k.children.length?k.children:v.includes("<")?[{type:"text",content:v,raw:v}]:null;if(C)try{const w=Eme(C,m);if(k.children=w.children,w.pendingBuffer){const M=v.lastIndexOf(w.pendingBuffer);if(M!==-1){const L=v.slice(0,M);k.content=L,typeof k.raw=="string"&&(k.raw=L)}}}catch(w){console.error("[applyFixHtmlInlineTokens] failed to fix streaming html inline",w)}}Sme(h,g)}),e.core.ruler.push("fix_html_inline_tokens",f=>{const h=f.tokens??[],{autoCloseInlineTagSet:m,customTagSet:g,shouldMergeHtmlBlockTag:y}=i(f),k=[];for(let v=0;v0){const[M,L]=k[k.length-1];if(v!==L){if(C.type==="paragraph_open"||C.type==="paragraph_close"){h.splice(v,1),v--;continue}const E=String(C.content??C.raw??"");if(E){const S=h[L],x=`${String(S.content||"")} +${E}`,A=No(x),T=A===-1?null:SL(x,M,A+1);if(T){const I=x.slice(0,T.end),O=x.slice(T.end);S.content=I,S.loading=!1,h.splice(v,1),k.pop();const H=d(S,O)?[]:u(O,c(h,v,"paragraph"));H.length&&h.splice(v,0,...H),v--;continue}S.content=x,S.loading!==!1&&(S.loading=!0)}h.splice(v,1),v--;continue}}const w=o(C);if(w){if(_me(w))continue;const M=(w.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1]??"").toLowerCase(),L=/^\s*<\s*\//.test(w);if(!M||!y(M))continue;if(s(C,w),!L)M&&!new RegExp(`^\\s*<\\s*${M}\\b[^>]*\\/\\s*>`,"i").test(w)&&Ame(w,M)>0&&k.push([M,v]);else if(k.length>0&&M&&k[k.length-1][0]===M){const[,E]=k[k.length-1],S=h[E];S.content=`${String(S.content||"")} +${w}`,S.loading=!1,k.pop(),h.splice(v,1),v--}continue}else if(k.length>0){if(C.type==="paragraph_open"||C.type==="paragraph_close"){h.splice(v,1),v--;continue}const M=C.content||"",L=new RegExp(`<\\s*\\/\\s*${k[k.length-1][0]}\\s*>`,"i").test(M);if(M){const[,E]=k[k.length-1],S=h[E];S.content=`${S.content||""} +${M}`,S.loading!==!1&&(S.loading=!L)}L&&k.pop(),h.splice(v,1),v--}else continue}if(g.size>0){const v=new Map,C=new Map,w=E=>{let S=v.get(E);return S||(S=new RegExp(`<\\s*${E}\\b`,"i"),v.set(E,S)),S},M=E=>{let S=C.get(E);return S||(S=new RegExp(`<\\s*\\/\\s*${E}\\s*>`,"i"),C.set(E,S)),S},L=[];for(let E=0;E0){const T=L[L.length-1],I=h[T.index],O=S.type==="html_block"?M(T.tag).exec(x):null;if(O){const F=O.index+O[0].length,P=x.slice(0,F),z=x.slice(F);I.content=`${String(I.content??"")} +${P}`,Array.isArray(I.children)&&I.children.push({type:"html_inline",content:``,raw:``}),L.pop();const W=d(I,z)?[]:u(z,c(h,E,"paragraph"));W.length?h.splice(E,1,...W):(h.splice(E,1),E--);continue}if(S.type!=="inline")continue;const H=Array.isArray(S.children)?S.children:[],R=wme(H,T.tag);if(R!==-1){const F=H.slice(0,R+1),P=H.slice(R+1),z=F.map(W=>String(W?.content??W?.raw??"")).join("");if(I.content=`${String(I.content??"")} +${z}`,Array.isArray(I.children)&&I.children.push(...F),P.length){const W=P.map($=>String($.content??$.raw??"")).join("");if(W.trim()){const $=W.replace(/^\s+/,"");if(d(I,W))h.splice(E,1),E--;else if($.startsWith("<"))h.splice(E,1,{type:"html_block",content:$});else{const K=u(W,c(h,E,"paragraph"));h.splice(E,1,...K)}}else h.splice(E,1),E--}else h.splice(E,1),E--;L.pop();continue}I.content=`${String(I.content??"")} +${x}`,Array.isArray(I.children)&&I.children.push(...H),h.splice(E,1),E--;continue}if(S.type!=="inline")continue;const A=Array.isArray(S.children)?S.children:[];for(const T of g)if((A.length?Cme(A,T):w(T).test(x)&&!M(T).test(x)?1:0)>0){L.push({tag:T,index:E});break}}}{let v=0;for(let C=0;C0?v--:(h.splice(C,1),C--))}}for(let v=0;v/]+)/)?.[1]??"").toLowerCase();if(S.startsWith("!")||S.startsWith("?")){C.loading=!1;continue}if(g.has(S)){const R=String(C.content??""),F=No(R),P=F===-1?null:SL(R,S,F+1);C.loading=P?!1:C.loading!==void 0?C.loading:!0;const z=P?.start??-1,W=P?P.end-P.start:0;if(z!==-1){const $=R.slice(0,z+W);let K="";F!==-1&&F]+)))?/g;let A;for(;(A=x.exec(C.content||""))!==null;)A[1],A[2]||A[3]||A[4];const T=String(C.content??""),I=new RegExp(`<\\/\\s*${S}\\s*>`,"i").exec(T),O=I?I.index:-1,H=I?I[0].length:0;if(O!==-1){const R=T.slice(0,O+H),F=(T.slice(O+H)||"").replace(/^\s+/,"");C.children=[{type:"html_block",content:R,tag:S,loading:!1}],C.content=R,C.raw=R,F&&h.splice(v+1,0,F.startsWith("<")?{type:"html_block",content:F}:{type:"text",content:F,raw:F})}else C.children=[{type:"html_block",content:C.content,tag:S,loading:!0}];continue}if(!C||C.type!=="inline")continue;if(C.children.length===2&&C.children[0].type==="html_inline"){const S=(C.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase(),x=C.children[1],A=String(x?.content??"").match(/^<\s*\/\s*([^\s>]+)/)?.[1]?.toLowerCase()??"";if(x?.type==="html_inline"&&A===S)continue;m.has(S)?(C.children[0].loading=!0,C.children[0].tag=S,C.children.push({type:"html_inline",tag:S,loading:!0,content:``})):C.children=[{type:"html_block",loading:!0,tag:S,content:String(C.children[0]?.content??"")+String(C.children[1]?.content??"")}];continue}else if(C.children.length===3&&C.children[0].type==="html_inline"&&C.children[2].type==="html_inline"){const S=(C.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(m.has(S))continue;C.children=[{type:"html_block",loading:!1,tag:S,content:C.children.map(x=>x.content).join("")}];continue}if(!C.content?.startsWith("<")||C.children?.length!==1)continue;const w=String(C.content),M=C,L=M.children[0];if(L?.type!=="html_inline"){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(w)&&(M.children.length=0);continue}const E=String(L.content??w).match(bme)?.[1]?.toLowerCase()??"";if(E){if(/\/\s*>\s*$/.test(w)||XH.has(E)){M.children=[{type:"html_inline",content:w}];continue}M.children.length=0}}})}function Fme(e){const t=e.trim();return!t||/^&[a-z0-9#]+;/i.test(t)?!1:!!(/^(?:const|let|var|function|class|import|export|if|for|while|return|await|async|yield|try|catch|throw|new|typeof|instanceof|switch|case|break|continue|def|ruby|perl|print|echo|true|false|null|undefined|NaN|Infinity|this)\b/.test(t)||/[a-z_$][\w$]*(?:\.[a-z_$][\w$]*|\['[^']*'\]|\["[^"]*"\]|\[\d+\])*\s*\(/i.test(t)||/[a-z_$][\w$]*(?:\.[a-z_$][\w$]*|\['[^']*'\]|\["[^"]*"\]|\[[\d+\]])+/i.test(t)||/\w+\s*(?:===?|!==?|<=?|>=?|\+\+|--|&&|\|\||\?\.)/.test(t)||/^(?:!!|\+\+|--)\s*\w/.test(t)||/[\w$]+\s*(?:\+=|-=|\*=|\/=|%=|\*\*=|=)/.test(t)||/^(?:https?:\/\/|ftp:\/\/|file:\/\/|\/\/|www\.)/i.test(t)||/`[^`]*\$\{[^}]*\}[^`]*`/.test(t)||/<\/?[A-Z][a-zA-Z0-9]*/.test(t)||/<[a-z][a-z0-9]*\s[^>]+>/.test(t)||/^(["'`]).*\1\s*[;,]?$/.test(t)||/^\[[\s\S]*\]$/.test(t)||/^\{[\s\S]*\}$/.test(t)||/^\(\s*\)$/.test(t)||/[\w$]+(?:\s*[+\-*/%<>=!&|^~:]+\s*[\w$]+|\s*\.\s*[\w$]+)/.test(t)||/=>|->|::/.test(t)||/^@[\w.$]+$/.test(t)||/^(?:0x[0-9a-fA-F]+|0b[01]+|0o[0-7]+|\d+(?:\.\d*)?(?:px|em|rem|%|vh|vw|deg|s|ms)?)$/.test(t)||/^\$[\w$]+\s*[=:]/.test(t)||/\|\s*\w+|\w+\s*\|/.test(t)||/^(?:git|npm|yarn|pnpm|bun|pip|cargo|go|rust|python|node|java|mvn|gradle|docker|kubectl)\s+/.test(t)||/(?:console|window|document|Math|JSON|Date|Array|Object|String|Number|Boolean)\.[a-zA-Z]/.test(t)||/^(?:\/\/|#|\/\*|\*\/|)/.test(t)||/^(?:<<<|<<\s*['"]?\w+['"]?)/.test(t))}function Dme(e,t={}){t.enabled!==!1&&e.core.ruler.after("inline","fix_indented_code_block",n=>{const i=n.tokens??[];for(let o=0;oa.trim().length>0);if(l.length===1&&!Fme(l[0]??"")){const a=l[0]??"",u=s.level??0;i.splice(o,1,{type:"paragraph_open",tag:"p",nesting:1,level:u},{type:"inline",tag:"",nesting:0,level:u,content:a,children:[{type:"text",content:a,level:u+1,raw:a}],block:!0},{type:"paragraph_close",tag:"p",nesting:-1,level:u}),o+=2}}})}const tW=/\.([a-z0-9]{1,15})$/i,Rme=/[_()[\]{}<>]/u,Ome=/^(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/i,Pme=/[?#@]/u,Bme=/[\\/]/u,$me=/^[\p{L}\p{N}./\\-]+$/u,zme=/^[A-Za-z0-9-]{1,63}$/u,jme=/^xn--[a-z0-9-]{2,59}$/i,Hme=/^(?:[A-Z]{1,6}|\d{1,8})$/u,Wme=/^(?=.{1,12}$)[A-Z0-9]+(?:[-.][A-Z0-9]+)*$/iu,qme=/文件名\s*[::]?|附件\s*[::]?|路径\s*[::]?|路徑\s*[::]?|文件列表\s*[::]?|文档列表\s*[::]?|文檔列表\s*[::]?|\bfile\s*names?\b\s*[::]?|\battachments?\b\s*[::]?|\bpaths?\b\s*[::]?|\bfile\s+lists?\b\s*[::]?|\bdocument\s+lists?\b\s*[::]?/iu,Ume=/文件名\s*[::]?|文件\s*[::]?|附件\s*[::]?|档案\s*[::]?|檔案\s*[::]?|文档\s*[::]?|文檔\s*[::]?|资料\s*[::]?|資料\s*[::]?|路径\s*[::]?|路徑\s*[::]?|\bfile\s*name\b\s*[::]?|\battachments?\b\s*[::]?|\bfiles?\b\s*[::]?|\bdocuments?\b\s*[::]?|\bdocs?\b\s*[::]?|\bpaths?\b\s*[::]?/iu,Vme=/股票代码|股票代碼|证券代码|證券代碼|(?:代码|代碼|交易所|后缀|後綴|市场|市場)(?=$|[\s::/|,,、()()])|\btickers?\b|\bsymbols?\b|\bexchanges?\b/iu,Kme=2e3,Zme=512,Gme={},Qme=new Set(["ai","md","py","rs","sh","zip"]),nW=new Set(["as","bj","de","hk","l","ln","ny","pa","sh","ss","sz","t","us"]),Yme=new Set([...nW,"at","ax","cn","co","it","jp","ks","mc","mx","nz","pl","sa","si","to","tw"]),Jme=new Set(["com","dev","io","page","site"]),Xme=new Set(["app","apk","dmg","exe","ipa","lock","log","markdown","webmanifest"]),ege=new Set(["7z","ai","astro","avi","bash","bz2","c","cjs","cpp","cs","csv","doc","docx","fish","flac","gif","go","gz","h","hpp","html","java","jpeg","jpg","js","json","jsx","kt","md","mdx","mjs","mov","mp3","mp4","pdf","php","png","ppt","pptx","ps1","py","rar","rb","rs","sh","sql","svg","swift","svelte","tar","tgz","toml","ts","tsx","txt","vue","wav","webp","xls","xlsx","xml","yaml","yml","zip","zsh"]),jh=new Map;function IL(e,t){if(!e||e.length>Zme)return t;for(jh.set(e,t);jh.size>Kme;){const n=jh.keys().next().value;if(!n)break;jh.delete(n)}return t}function Nv(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function G3(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return Nv(n)?n:void 0}function ML(e,t){if(!Nv(t))return e;const n=e?.__linkifyDemotionContext;return{...e,__linkifyDemotionContext:{filename:n?.filename||t?.filename,explicitFilename:n?.explicitFilename||t?.explicitFilename,marketTicker:n?.marketTicker||t?.marketTicker}}}function TL(e){const t=h2(e);return Nv(t)?t:void 0}function tge(e){return e.replace(/^[\s>*_`[\]((【《"'“‘]+/u,"").replace(/[\s<*_`\]))】》"'.。;;,,、::!?!?]+$/u,"")}function EL(e,t){if(!Nv(t))return;const n=String(e??"").trim().split(/\s+/u).map(tge).filter(Boolean);if(n.length===0)return;const i={};return t?.filename&&n.every(o=>sb(o,{filename:!0,explicitFilename:t.explicitFilename}))&&(i.filename=!0),t?.explicitFilename&&i.filename&&(i.explicitFilename=!0),t?.marketTicker&&n.every(o=>sb(o,{marketTicker:!0}))&&(i.marketTicker=!0),Nv(i)?i:void 0}function qf(e,t=!1){let n;return{options(i){return t||i==null?ML(e,n):ML(e,G3(TL(i),EL(i,n)))},remember(i){const o=TL(i);n=t?G3(n,o):G3(o,EL(i,n))},reset(){n=void 0}}}function LL(e){return zme.test(e)&&!e.startsWith("-")&&!e.endsWith("-")}function nge(e){const t=e.split(".");if(t.length<2)return!1;const n=t[t.length-1]?.toLowerCase()??"";return LL(n)||jme.test(n)?t.every(LL):!1}function iW(e){return Array.from(e).some(t=>t.charCodeAt(0)>127)}function ige(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0]??""}function oge(e){return e.split(".").some(t=>t.toLowerCase().startsWith("xn--"))}function oW(e,t,n){const i=ige(t);return iW(e)&&oge(i)&&String(n??"").toLowerCase().includes(i.toLowerCase())}function sge(e){if(!e)return!1;if(e.includes("文件")||e.includes("附件")||e.includes("路径")||e.includes("路徑")||e.includes("文档")||e.includes("文檔")||e.includes("档案")||e.includes("檔案")||e.includes("资料")||e.includes("資料")||e.includes("股票")||e.includes("证券")||e.includes("證券")||e.includes("代码")||e.includes("代碼")||e.includes("交易所")||e.includes("后缀")||e.includes("後綴")||e.includes("市场")||e.includes("市場"))return!0;const t=e.toLowerCase();return t.includes("file")||t.includes("attachment")||t.includes("document")||t.includes("doc")||t.includes("path")||t.includes("ticker")||t.includes("symbol")||t.includes("exchange")}function h2(e){const t=String(e??""),n=jh.get(t);return n?(jh.delete(t),jh.set(t,n),n):sge(t)?IL(t,{explicitFilename:qme.test(t),filename:Ume.test(t),marketTicker:Vme.test(t)}):IL(t,Gme)}function rge(e){return nge(e.split(/[\\/]/)[0]??"")}function lge(e){const t=e.replace(/[^a-z]/gi,"");return t.length>=2&&t===t.toUpperCase()}function age(e){if(Rme.test(e)||!$me.test(e))return!0;if(Bme.test(e))return!rge(e);const t=e.replace(tW,"");return iW(t)?!0:t.split(".").filter(Boolean).some(lge)}function uge(e,t,n){if(!(n?Yme:nW).has(t))return!1;const i=e.slice(0,-(t.length+1));return i===""?e.startsWith("."):(n?Wme:Hme).test(i)}function sb(e,t={}){if(!e||Ome.test(e)||Pme.test(e))return!1;const n=e.match(tW);if(!n)return!1;const i=String(n[1]??"").toLowerCase();return uge(e,i,t.marketTicker===!0)?!0:ege.has(i)?!Qme.has(i)||t.filename?!0:age(e):!!(t.explicitFilename&&Jme.has(i)||t.filename&&Xme.has(i))}const sW=new WeakMap,rW=new WeakSet;function yA(e,t){return sW.set(e,t),e}function cge(e){return sW.get(e)}function dge(e){rW.add(e)}function fge(e){return e===void 0||rW.has(e)}const NL=["!"];function FL(e){return e==="linkify"||e==="autolink"?e:"recovery"}function gl(e){return{type:"text",content:e,raw:e}}function hh(e,t){t===1?e.push({type:"em_open",tag:"em",nesting:1}):t===2?e.push({type:"strong_open",tag:"strong",nesting:1}):t===3&&(e.push({type:"strong_open",tag:"strong",nesting:1}),e.push({type:"em_open",tag:"em",nesting:1}))}function ph(e,t){t===1?e.push({type:"em_close",tag:"em",nesting:-1}):t===2?e.push({type:"strong_close",tag:"strong",nesting:-1}):t===3&&(e.push({type:"em_close",tag:"em",nesting:-1}),e.push({type:"strong_close",tag:"strong",nesting:-1}))}function Ed(e,t,n,i="recovery"){let o="";if(t.includes('"')){const s=t.split('"');t=s[0].trim(),o=s[1].trim()}return yA({type:"link",loading:n,href:t,title:o,text:e,children:[{type:"text",content:e,raw:e}],raw:`[${e}](${t})`},i)}function hge(e,t){if(!(!e||!t)&&(e.href=String(e.href??"")+t,e.text=String(e.text??"")+t,e.raw=`[${e.text}](${e.href})`,Array.isArray(e.children)&&e.children.length)){const n=e.children[e.children.length-1];n?.type==="text"?(n.content=String(n.content??"")+t,n.raw=String(n.raw??"")+t):e.children.push(gl(t))}}function DL(e,t){let n=-1;for(const i of t){const o=e.indexOf(i);o!==-1&&(n===-1||on?.[0]==="href")?.[1];return typeof t=="string"?t:""}function mge(e,t){if(!e)return;e.attrs=Array.isArray(e.attrs)?e.attrs:[];const n=e.attrs.findIndex(i=>i?.[0]==="href");n>=0?e.attrs[n][1]=t:e.attrs.push(["href",t])}function RL(e,t,n){let i="";for(let o=t+1;o{const n=t.tokens??[];for(let i=0;ir.type==="code_inline"),i=new Map;let o=0;for(let r=0;r0&&u?OL(u):-1;if(c!==-1&&u)for(const d of u.slice(c))d==="("?o++:d===")"&&o>0&&o--}a!==-1&&(r=a);continue}if(!(l.type!=="text"||typeof l.content!="string"))for(const a of l.content)a==="("?o++:a===")"&&o>0&&o--}const s=h2(t);for(let r=0;r<=e.length-1;r++){r<0&&(r=0);const l=e[r];if(!l)break;if(l.type==="link_open"&&(l.markup==="linkify"||l.markup==="autolink")){let a=-1;for(let u=r+1;u0){const m=OL(u);m!==-1&&(d===-1||m=g.content.length){h-=g.content.length;continue}if(h<0)break;const y=g.content[h],k=g.content.slice(0,h);let v=g.content.slice(h);for(let M=m+1;M0&&(e.splice(m+1,C),a=m+1);let w=c;if(y==="!"&&f!==-1)w=c.slice(0,f);else if(v){const M=encodeURI(v);if(M&&c.endsWith(M))w=c.slice(0,c.length-M.length);else{const L=y?encodeURI(y):"",E=L?c.indexOf(L):-1;E!==-1&&(w=c.slice(0,E))}}w!==c&&mge(l,w),v&&e.splice(a+1,0,gl(v));break}}}if(!n){if(l?.type==="em_open"&&e[r-1]?.type==="text"&&e[r-1].content?.endsWith("*")){const a=e[r-1].content?.replace(/(\*+)$/,"")||"";e[r-1].content=a,l.type="strong_open",l.tag="strong",l.markup="**";for(let u=r+1;ud[0]==="href")?.[1]||"";if(e[r+3]?.type==="text"){const d=(e[r+3]?.content??"").indexOf(")"),f=d===-1;d===-1&&(c+=e[r+3]?.content?.slice(0,d)||"",e[r+3].content=""),a.push(Ed(u,c,f,"linkify"));const h=e[r+3].content?.replace(/^\)\**/,"");h&&a.push(gl(h)),e.splice(r-4,8,...a)}else a.push(yA({type:"link",loading:!0,href:c,title:"",text:u,children:[{type:"text",content:c,raw:c}],raw:`[${u}](${c})`},"linkify")),e.splice(r-4,7,...a);continue}else if(e[r-1].content==="]("&&e[r-3]?.type==="text"&&e[r-3].content?.endsWith(")"))if(e[r-2]?.type==="strong_open"){const[a,u]=e[r-3].content?.split("[**")||[];e[r+1].content=u||"",e[r-3].content=a||"",e[r-1].content=""}else if(e[r-2]?.type==="em_open"){const[a,u]=e[r-3].content?.split("[*")||[];e[r+1].content=u||"",e[r-3].content=a||"",e[r-1].content=""}else{const[a,u]=e[r-3].content?.split("[")||[];e[r+1].content=u||"",e[r-3].content=a||"",e[r-1].content=""}}if(l.type==="link_close"&&l.nesting===-1&&e[r-2]?.type==="link_open"&&e[r+1]?.type==="text"&&e[r-1]?.type==="text"){const a=e[r-1].content||"",u=e[r-2].attrs||[],c=u.find(k=>k[0]==="href")?.[1]||"",d=u.find(k=>k[0]==="title")?.[1]||"";let f=3,h=2;const m=(e[r-3]?.content||"").match(/^(\*+)$/),g=[];if(m){h+=1;const k=m[1].length;hh(g,k)}if(l.markup!=="linkify"&&e[r+1].type==="text"&&e[r+1]?.content?.startsWith("](")){f+=1;for(let k=r+1;ky[0]==="href")?.[1];e[r+5]?.type==="text"&&e[r+5].content==="."?(f=(g||f)+e[r+5].content,e[r+5].content=""):f=g||f,h+=3}let m=!0;if(l.nesting===-1&&(d=d.replace(/\*+$/,"")),e[r+2]?.type==="text"){const g=(e[r+2]?.content??"").indexOf(")");m=g===-1,g===-1&&(f+=e[r+2]?.content?.slice(0,g)||"",e[r+2].content="")}a.push(Ed(d,f,m)),ph(a,2),e.splice(r-2,h,...a)}if(l.type==="text"&&/\*+\[[^\]]*$/.test(l.content||"")&&e[r+1]?.type==="strong_open"&&e[r+2]?.type==="text"&&e[r+2].content==="]("&&e[r+3]?.type==="link_open"&&e[r+5]?.type==="link_close"&&e[r+6]?.type==="text"&&e[r+6].content===")"&&e[r+7]?.type==="strong_close"){const a=(l.content||"").match(/^(\*+)\[(.*)$/);if(a){const u=(a[2]||"")+a[1];let c=e[r+3]?.attrs?.find(f=>f[0]==="href")?.[1]||"";!c&&e[r+4]?.type==="text"&&(c=e[r+4].content||"");const d=[];hh(d,2),d.push(Ed(u,c,!1)),ph(d,2),e.splice(r,9,...d),r-=d.length-1;continue}}}}if(n)return e;for(let r=0;r{const n=t.tokens??[];for(let i=0;i{const n=t.tokens??[];for(let i=0;i=0&&e[m].type==="text"&&e[m].content==="";)m--;const g=e[m];let y=c+1;for(;y=0&&e[m].type==="text"&&e[m].content==="";)m--;const g=e[m];let y=c+1;for(;y{const n=t;try{const i=Ege(n.tokens??[],!!n.env?.__markstreamFinal,n.src??"");Array.isArray(i)&&(n.tokens=i)}catch(i){console.error("[applyFixTableTokens] failed to fix table tokens",i)}})}function PL(){return[{type:"table_open",tag:"table",attrs:null,map:null,children:null,content:"",markup:"",info:"",level:0,loading:!0,meta:null},{type:"thead_open",tag:"thead",attrs:null,block:!0,level:1,children:null},{type:"tr_open",tag:"tr",attrs:null,block:!0,level:2,children:null}]}function BL(){return[{type:"tr_close",tag:"tr",attrs:null,block:!0,level:2,children:null},{type:"thead_close",tag:"thead",attrs:null,block:!0,level:1,children:null},{type:"table_close",tag:"table",attrs:null,map:null,children:null,content:"",markup:"",info:"",level:0,meta:null}]}function $L(e){return[{type:"th_open",tag:"th",attrs:null,block:!0,level:3,children:null},{type:"inline",tag:"",children:null,content:e,level:4,attrs:null,block:!0},{type:"th_close",tag:"th",attrs:null,block:!0,level:3,children:null}]}function lW(e,t){if(!e.startsWith("|")||e.includes(` +`)||!e.endsWith("|"))return null;const n=e.slice(1).split("|");return n.at(-1)===""&&n.pop(),n.length>0&&n.every(i=>i.trim().length>0)?n:null}function Q3(e){return lW(e)!==null}function aW(e){return/^:?-+:?$/.test(e.trim())}function Sge(e){if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|");return t.at(-1)===""&&t.pop(),t.length>0&&t.every(aW)}function _ge(e){return/^(?:[::]-*|:?-+:?)?$/.test(e.trim())}function Ige(e){if(e==="")return!0;if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|"),n=t.at(-1)??"";return t.slice(0,-1).every(aW)&&_ge(n)}function Mge(e){return e==="|"||e==="|:"}function Tge(e){const t=lW(e);return t!==null&&t.every(n=>!n.includes(":"))}function Ege(e,t=!1,n=""){const i=[...e];if(e.length<3)return i;const o=e.length-2,s=e[o];if(s.type==="inline"){const r=String(s.content??""),l=r.split(` +`)[0]??"",[a="",u="",...c]=r.split(` +`),d=!t&&!r.includes(` +`)&&/\r?\n$/.test(n)&&Q3(r);if(!t&&(r.includes(` +`)&&c.length===0&&Q3(a)&&Ige(u)||d)){const f=l.slice(1,-1).split("|").map(m=>m.trim()).flatMap(m=>$L(m)),h=[...PL(),...f,...BL()];i.splice(o-1,3,...h)}else if(r.includes(` +`)&&c.length===0&&Q3(a)&&Sge(u)){const f=l.slice(1,-1).split("|").map(m=>m.trim()).flatMap(m=>$L(m)),h=[...PL(),...f,...BL()];i.splice(o-1,3,...h)}else r.includes(` +`)&&c.length===0&&Tge(a)&&Mge(u)&&(s.content=r.slice(0,-2),s.children.splice(2,1))}return i}function Lge(e,t,n,i){const o=e.length;if(n==="$$"&&i==="$$"){let u=t;for(;u=0&&e[c]==="\\";)d++,c--;if(d%2===0)return u}u++}return-1}const s=n[n.length-1],r=i;let l=0,a=t;for(;a=0&&e[c]==="\\";)d++,c--;if(d%2===0){if(l===0)return a;l--,a+=r.length;continue}}const u=e[a];if(u==="\\"){a+=2;continue}u===s?l++:u===r[r.length-1]&&l>0&&l--,a++}return-1}var Nge=Lge;const Fge=["boldsymbol","mathbb","mathcal","mathfrak","mathrm","mathit","mathsf","vec","hat","bar","tilde","overline","underline","mathscr","mathnormal","operatorname","mathbf*"],rb=Fge.map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,"\\$&")).join("|"),Dge=/\\[a-z]+/i,uW="(?:\\\\|\\u0008)",Rge=new RegExp(String.raw`${uW}(?:${rb})\s*\{[^}]+\}`,"i"),Oge=new RegExp(String.raw`(?:${uW})?(?:${rb})\s*\{`,"i"),Pge=/\\(?:text|frac|left|right|times)/,Bge=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,$ge=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,zge=/[A-Z]+\s*\([^)]+\)/i,jge=/^\(\s*[a-z](?:\s*,\s*[a-z])+\s*\)$/i,Hge=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,Wge=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,qge={"\b":"\\b","\v":"\\v","\f":"\\f"};function Uge(e){let t="";for(const n of e)t+=qge[n]??n;return t}function Qd(e){if(!e)return!1;const t=Uge(e),n=t.trim();if(Wge.test(n)||n.includes("**"))return!1;if(n.length>2e3)return!0;const i=Dge.test(t),o=Rge.test(t),s=Oge.test(t),r=Pge.test(t),l=/(?:^|[^\w\\])(?:[A-Z]|\\[A-Z]+)_(?:\{[^}]+\}|[A-Z0-9\\])/i.test(t)||/(?:^|[^\w\\])(?:[A-Z]|\\[A-Z]+)\^(?:\{[^}]+\}|[A-Z0-9\\])/i.test(t),a=Bge.test(t)&&!$ge.test(t),u=zge.test(t),c=jge.test(n),d=Hge.test(t),f=/^\([a-z]\)$/i.test(n)||/^(?:[a-z]|pi)$/i.test(n),h=/^(?:[A-Z][a-z]?(?:_\{?\d+\}?|\^\{?\d+\}?)?)+$/.test(n);return i||o||s||r||l||a||u||c||d||f||h}const cW="__markstreamMathPluginApplied",kA=80,dW=2e4,zL=dW+4096;function wx(e){return!!e[cW]}function Vge(e){e[cW]=!0}const fW=["ldots","cdots","quad","in","displaystyle","int_","lim","lim_","ce","pu","end","infty","perp","mid","operatorname","to","rightarrow","leftarrow","math","mathrm","mathit","mathbb","mathcal","mathfrak","implies","alpha","beta","gamma","delta","epsilon","lambda","sum","sum_","prod","sqrt","fbox","boxed","color","rule","edef","fcolorbox","hline","hdashline","cdot","times","pm","le","ge","neq","sin","cos","tan","log","ln","exp","frac","text","left","right"],Kge=["cdot","mathbf{","partial","mu_{"],hW=fW.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),pW="[ \r\b\f\v]",Zge=new RegExp(`([^\\\\])(${Kge.map(e=>e).join("|")})+`,"g"),Gge=/span\{([^}]+)\}/,Qge=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,Yge=/(^|[^\\])\\\r?\n/g,Jge=/(^|[^\\])\\$/g,Xge=/[\p{L}\p{M}\p{N}\p{Pe}\p{Pf}'′″‴|‖]/u,e0e=new RegExp(`(${pW})|(${hW})\\b`,"g"),jL=new Map,HL=new Map;function t0e(e){if(!e)return e0e;const t=[...e];t.sort((r,l)=>l.length-r.length);const n=t.join(""),i=jL.get(n);if(i)return i;const o=`(?:${t.map(r=>r.replace(/[.*+?^${}()|[\\]\\"\]/g,"\\$&")).join("|")})`,s=new RegExp(`(${pW})|(${o})\\b`,"g");return jL.set(n,s),s}function n0e(e,t){const n=e?[]:[...t??[]];e||n.sort((l,a)=>a.length-l.length);const i=e?"__default__":n.join(""),o=HL.get(i);if(o)return o;const s=e?[rb,hW].filter(Boolean).join("|"):[n.map(l=>l.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),rb].filter(Boolean).join("|"),r=new RegExp(`(^|[^\\\\\\w])(${s})\\s*\\{`,"g");return HL.set(i,r),r}const WL={" ":"t","\r":"r","\b":"b","\f":"f","\v":"v"};function qL(e){const t=/(^|[^\\])(__|\*\*)/g;let n=0;for(;t.exec(e)!==null;)n++;return n}function i0e(e){return e.replace(/(^|[^\\])!+/gu,(t,n)=>{if(n&&Xge.test(n))return t;const i=n?t.slice(n.length):t;return`${n}${"\\!".repeat(i.length)}`})}function UL(e){const t=/(^|[^\\])(__|\*\*)/g;let n,i=null;for(;(n=t.exec(e))!==null;)i={marker:n[2],index:n.index+(n[1]?.length??0)};return i}function Ld(e,t){const n=t?.commands??fW,i=t?.escapeExclamation??!0,o=t?.commands==null,s=t0e(o?void 0:n);let r=e.replace(s,(u,c,d,f,h)=>{if(c!==void 0&&WL[c]!==void 0)return`\\${WL[c]}`;if(d&&n.includes(d)){const m=h&&typeof f=="number"?h[f-1]:void 0;return m==="\\"||m&&/\w/.test(m)?u:`\\${d}`}return u});i&&(r=i0e(r));let l=r;const a=n0e(o,o?void 0:n);return l=l.replace(a,(u,c,d)=>`${c}\\${d}{`),l=l.replace(Gge,"span\\{$1\\}").replace(Qge,"\\operatorname{span}\\{$1\\}"),l=l.replace(Yge,`$1\\\\ +`),l=l.replace(Jge,"$1\\\\"),l=l.replace(Zge,"$1\\$2"),l}function VL(e){const t=e.trim();return!(!Qd(t)||/"[^"\n]{1,80}"\s*:\s*/.test(t)||!(/\\[a-z]+/i.test(t)||/[=+*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/.test(t)||/[_^]/.test(t))&&/\s-\s/.test(t))}function mW(e){const t=[];let n=0;for(;n=n[0]&&t0;){if(e[s]==="\\"&&s+10;){if(e[l]==="\\"&&l+1=0&&e[n]==="\\";)i++,n--;return i%2===1}function bA(e,t){let n=t;for(;n0&&e[i-1]==="$"||i+1=l)break;const u=lb(o,a);if(u){r=Math.max(a+Math.max(1,t.length),u[1]);continue}p2(e,a)||s++,r=a+Math.max(1,t.length)}return s}function Cx(e,t,n){const i=Dv(String(e??""));if(!i.endsWith(t))return-1;const o=i.length-t.length;if(o<=0||!Dv(i.slice(0,o)).trim()||p2(i,o))return-1;const s=mW(i);if(lb(s,o))return-1;const r=KL(i,t,0,o,s);if(t==="$$"){if(r%2===1)return-1}else if(r>KL(i,n,0,o,s))return-1;return o}function Fv(e){return e===" "||e===" "}function Dv(e){let t=e.length;for(;t>0&&Fv(e[t-1]);)t--;return e.slice(0,t)}function ZL(e){let t=0;for(let n=0;n=48&&t<=57}function s0e(e){if(e.length<3)return!1;const t=e[0];if(t!=="-"&&t!=="*"&&t!=="_"&&t!=="=")return!1;let n=0;for(let i=0;i=3}function r0e(e){const t=e.trim();if(!t)return!1;let n=0;t[n]===":"&&n++;let i=0;for(;t[n]==="-";)i++,n++;return i<3?!1:(t[n]===":"&&n++,n===t.length)}function l0e(e){if(!e.includes("|"))return!1;const t=e[0]==="|"?e.slice(1):e;return(t.endsWith("|")?t.slice(0,-1):t).split("|").every(r0e)}function a0e(e){let t=0;if(!GL(e[t]))return!1;for(;GL(e[t]);)t++;return e[t]!=="."&&e[t]!==")"?!1:Fv(e[t+1])}function gW(e){const t=e.trimStart();if(!t||t.startsWith("```")||t.startsWith("~~~")||t.startsWith(":::")||t[0]===">"||t[0]==="<")return!0;if(t[0]==="#"){let n=0;for(;t[n]==="#";)n++;if(n>=1&&n<=6&&Fv(t[n]))return!0}return!!((t[0]==="-"||t[0]==="+"||t[0]==="*")&&Fv(t[1])||a0e(t)||s0e(t)||l0e(t))}function QL(e,t){return e?t?`${e} +${t}`:e:t}function wA(e){const t=String(e??"").trim();return t?Qd(t):!1}function YL(e){let t=0;for(let n=0;nkA){h=!0;break}const g=o[m],y=x1(g,c);if(y!==-1){const k=QL(f,g.slice(0,y));if(!wA(k)){h=!0;break}const v=g.slice(y+c.length),C=v.trim()?`suffix:${YL(v)}`:"nosuffix";return["closed",u,i+l,d,i+m,y,YL(k),C].join(":")}if(gW(g)){h=!0;break}if(f=QL(f,g),f.length>dW){h=!0;break}}if(!h&&wA(f))return["pending",u,i+l,d].join(":")}}return null}function J3(e,t){const n=String(e??"").trim();return!n||!/^\d[\d,.]*\s*[~~-]\s*$/.test(n)?!1:/\d/.test(String(t??""))}function c0e(e){const t=String(e??"").trimStart(),n=t.match(/^\d+(?:,\d{3})*(?:\.\d+)?/);if(!n)return!1;const i=t.slice(n[0].length);return/^\s*(?:[+\-*/^_=<>]|\\[a-z]+)/i.test(i)?!1:i===""||/^[)\s,.!?;:]/.test(i)}function X3(e){const t=String(e??"").trim();return t?/^(?:\.{3,}|…+)$/.test(t):!1}function d0e(e,t){Vge(e);const n=(r,l,a)=>{const u=String(l??"").replace(/^[\t ]+/,"").replace(/[\t ]+$/,"");if(!u)return;const c=r.push("paragraph_open","p",1);c.map=[a,a+1];const d=r.push("inline","",0);d.content=u,d.map=[a,a+1],d.children=[],r.push("paragraph_close","p",-1)},i=(r,l)=>{const a=r,u=!!t?.strictDelimiters,c=!a?.env?.__markstreamFinal,d=(v,C)=>{let w=C;for(;w=3&&(!w||/\s/.test(w))){const M=a.push("text","",0);return M.content=a.src.slice(a.pos,v),a.pos=v,!0}}const f=[["$$","$$"],["$","$"],["\\(","\\)"]],h=String(a.pending??""),m=Math.max(0,a.pos-h.length);let g=m,y=m;const k=m;for(const[v,C]of f){const w=a.src,M=mW(w),L=o0e(w,c);let E=!1;v==="$$"&&g!==k&&(g=k);let S=-1,x=-1,A=0;const T=I=>{if((I==="undefined"||I==null)&&(I=""),I==="\\"){a.pos=a.pos+I.length,g=a.pos;return}if(I==="\\)"||I==="\\("){const R=a.push("text_special","",0);R.content=I==="\\)"?")":"(",R.markup=I,a.pos=a.pos+I.length,g=a.pos;return}if(!I)return;if(v==="$$"&&I.includes("$")){let R=0;for(;R0&&I[F-1]==="$"||F+10){const P=I.slice(0,O),z=a.push("text","",0);z.content=P,a.pos=a.pos+P.length,g=a.pos}const R=I.slice(O).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(R){const[,P,z]=R,W=z.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),$=W?W[1]:z,K=W&&W[2]?W[2]:null,ne=a.push("image","img",0);ne.attrs=[["src",$],["alt",P]],K&&ne.attrs.push(["title",K]),ne.content=P,ne.children=[{type:"text",content:P,tag:""}],a.pos=a.pos+R[0].length,g=a.pos;const G=I.slice(O+R[0].length);G&&T(G);return}const F=a.push("text","",0);F.content=I,a.pos=a.pos+I.length,g=a.pos;return}const H=a.push("text","",0);H.content=I,a.pos=a.pos+I.length,g=a.pos};for(;!(g>=w.length);){const I=w.indexOf(v,g);if(I===-1)break;if(p2(w,I)){g=I+Math.max(1,v.length);continue}const O=lb(M,I);if(O){g=O[1];continue}const H=lb(L,I);if(H){g=H[1];continue}if(I===S&&g===x){if(A++,A>2){g=I+Math.max(1,v.length);continue}}else A=0,S=I,x=g;if(v==="("&&I>0){let G=I-1;for(;G>=0&&w[G]===" ";)G--;if(G>=0&&w[G]==="]"){g=I+v.length;continue}}if(v==="$"&&I>0&&w[I-1]==="$"){g=I+1;continue}if(v==="$"&&I=w.length);){const O=bA(w,I);if(O===-1)break;if(O+10&&w[O-1]==="$"){I=O+1;continue}const H=Y3(w,O+1);if(H===-1)break;const R=w.slice(O+1,H),F=R.includes("`"),P=!R||!R.trim(),z=w[H+1],W=J3(R,z),$=X3(R);if(!F&&!P&&!W&&!$){const K=w.slice(g,O);K&&T(K);const ne=a.push("math_inline","math",0);ne.content=Ld(R,t),ne.markup="$",ne.raw=`$${R}$`,ne.loading=!1,g=H+1,I=H+1}else T("$"),I=O+1}I{const c=r,d=!c?.env?.__markstreamFinal,f=t?.strictDelimiters,h=f?[["\\[","\\]"],["$$","$$"]]:[["\\[","\\]"],["[","]"],["$$","$$"]],m=c.bMarks[l]+c.tShift[l];let g=c.src.slice(m,c.eMarks[l]).trim(),y=!1,k="",v="",C=!1,w="",M=!1;for(const[K,ne]of h)if(g.startsWith(K))if(K.includes("[")){const G=K==="\\["?g.slice(K.length):"";if(K==="\\["&&x1(G,ne)===-1&&!/^\s*!\[/.test(G)&&!G.includes("`")&&Qd(G)){y=!0,k=K,v=ne;break}if(t?.strictDelimiters){if(g.replace("\\","")==="["){if(l+1=0?"\\]":v,A=S>=0?S:x1(g,v,E);if(!C&&A>k.length){const K=g.slice(L+k.length,A),ne=c.push("math_block","math",0);ne.content=Ld(K),ne.markup=k==="$$"?"$$":k==="["?"[]":"\\[\\]",ne.map=[l,l+1],ne.raw=`${k}${K}${x}`,ne.block=!0,ne.loading=!1,c.line=l+1;const G=g.slice(A+x.length);return G.trim()&&n(c,G,l),!0}let T=l,I="",O=!1,H="",R=l;const F=C?g:g===k?"":g.slice(k.length),P=!f&&k==="\\["?"]":"",z=x1(F,v);if(z!==-1){const K=z;I=F.slice(0,K),H=F.slice(K+v.length),R=C?l+1:l,O=!0,T=R}else for(F&&!C&&(I=F),T=l+1;T{const c=r,d=c.bMarks[l]+c.tShift[l],f=c.src.slice(d,c.eMarks[l]).trim();return!f.startsWith("$$")&&!f.startsWith("\\[")?!1:o(r,l,a,u)};e.inline.ruler.before("escape","math",i),e.block.ruler.before("lheading","explicit_math_block",s,{alt:["paragraph","reference","blockquote","list"]}),e.block.ruler.before("paragraph","math_block",o,{alt:["paragraph","reference","blockquote","list"]})}function f0e(e){const t=e.renderer.rules.image||function(n,i,o,s,r){const l=n,a=r;return a.renderToken?a.renderToken(l,i,o):""};e.renderer.rules.image=(n,i,o,s,r)=>{const l=n;return l[i].attrSet?.("loading","lazy"),t(l,i,o,s,r)},e.renderer.rules.fence=e.renderer.rules.fence||((n,i)=>{const o=n[i],s=String(o.info??"").trim();return`
        ${e.utils.escapeHtml(String(o.content??""))}
        `})}const h0e=/^\s]/i,p0e=/^<\/a\s*>/i;function m0e(e,t){if(e?.type!=="inline")return!1;const n=e.children;if(!Array.isArray(n)||n.length===0)return t.test(String(e.content??""));let i=0;for(let o=n.length-1;o>=0;o--){const s=n[o];if(s?.type==="link_close"){for(o--;o>=0&&n[o]?.level!==s.level&&n[o]?.type!=="link_open";)o--;continue}if(s?.type==="html_inline"){const r=String(s.content??"");h0e.test(r)&&i>0&&i--,p0e.test(r)&&i++}if(!(i>0)&&s?.type==="text"&&t.test(String(s.content??"")))return!0}return!1}function g0e(e){const t=e.core?.ruler,n=t.getNamedRules?.().find(i=>i.name==="linkify")?.fn;typeof n=="function"&&t.at("linkify",i=>{if(!i.md?.options?.linkify)return;const o=Array.isArray(i.tokens)?i.tokens:[],s=i.md.linkify;if(!s)return;const r=o.filter(l=>m0e(l,s));if(r.length)return n(Object.assign(Object.create(Object.getPrototypeOf(i)),i,{tokens:r}))})}function v0e(e){const t=e.inline.ruler,n=t.getNamedRules?.(),i=n?.find(l=>l.name==="link")?.fn,o=n?.find(l=>l.name==="image")?.fn;if(typeof i!="function"||typeof o!="function")return;const s=e.validateLink,r=e;r.__markstreamOriginalValidateLink=s,t.at("link",(...l)=>{const a=l[0].md,u=a?.validateLink===s?a.options?.validateLink:a?.validateLink;if(!a||typeof u!="function")return i(...l);const c=a.validateLink;a.validateLink=u;try{return i(...l)}finally{a.validateLink=c}}),t.at("image",(...l)=>{const a=l[0].md;if(!a)return o(...l);const u=a.validateLink;a.validateLink=s;try{return o(...l)}finally{a.validateLink=u}})}function y0e(e={}){const t=e.markdownItOptions??{},n=typeof t.experimental=="object"&&t.experimental!==null?t.experimental:{},i=Object.prototype.hasOwnProperty.call(t,"stream")?!!t.stream:!0,o=Object.prototype.hasOwnProperty.call(t,"validateLink"),s=new U1e({html:!0,linkify:!0,typographer:!0,...t,experimental:{stream:i,...n}});if(!o){const r=l=>!ip(l,{tagName:"a",attrName:"href"});dge(r),s.set({validateLink:r})}return v0e(s),g0e(s),(e.enableMath??!0)&&d0e(s,{...e.mathOptions??{}}),(e.enableContainers??!0)&&dme(s),e.enableFixIndentedCodeBlock!==!1&&Dme(s),gge(s),bge(s),yge(s),xge(s),f0e(s),Nme(s,{customHtmlTags:e.customHtmlTags}),s}function op(e){const t=Object.assign(Object.create(Object.getPrototypeOf(e)),e);return Array.isArray(e.attrs)&&(t.attrs=e.attrs.map(n=>[...n])),Array.isArray(e.map)&&(t.map=[...e.map]),Array.isArray(e.children)&&(t.children=e.children.map(n=>op(n))),t}function k0e(e){const t=e.meta??{};return{type:"checkbox",checked:t.checked===!0,raw:t.checked?"[x]":"[ ]"}}function b0e(e){const t=e,n=t.attrGet?t.attrGet("checked"):void 0,i=n===""||n==="true";return{type:"checkbox_input",checked:i,raw:i?"[x]":"[ ]"}}function w0e(e){const t=String(e.content??"");return{type:"emoji",name:t,markup:String(e.markup??""),raw:`:${t}:`}}function Iy(e,t,n){const i=[];let o="",s=t+1;const r=[];for(;sn.startsWith(t)||t.startsWith(n)):!1}function JL(e,t,n,i){n.length>0&&e.push(...n),i.length>0&&t.push(...i),n.length=0,i.length=0}function XL(e,t){return!t&&e.startsWith(" ")&&!e.startsWith(" ")?` ${e}`:e}function S0e(e,t){const n=[],i=[],o=[],s=[],r=e.split(A0e),l=/\r?\n$/.test(e),a=r.some(h=>h.startsWith("diff ")||h.startsWith("--- ")||h.startsWith("+++ ")||h.startsWith("@@ ")),u=h=>{const m=h;if(!kW.some(g=>m.startsWith(g)))if(m.startsWith("-")){const g=m.slice(1);o.push(XL(g,a))}else if(m.startsWith("+")){const g=m.slice(1);s.push(XL(g,a))}else{JL(n,i,o,s);const g=a&&m.startsWith(" ")?m.slice(1):m;n.push(g),i.push(g)}},c=l?Math.max(0,r.length-1):r.length;for(let h=0;h0||s.length>0)&&JL(n,i,o,s);const d=n.join(` +`),f=i.join(` +`);return{original:t&&l&&d?`${d} +`:d,updated:t&&l&&f?`${f} +`:f}}function Ax(e){const t=Array.isArray(e.map)&&e.map.length===2,n=e.meta??{},i=typeof n.closed=="boolean"?n.closed:void 0,o=i===!0||i!==!1&&t,s=String(e.info??""),r=s.startsWith("diff"),l=r?(()=>{const u=s,c=u.indexOf(" ");return c===-1?"":String(u.slice(c+1)??"")})():s;let a=String(e.content??"");if(!o&&e.markup){const u=e.markup[0],c=e.markup.length,d=C0e(u,c);d.test(a)&&(a=a.replace(d,""))}if(r){const{original:u,updated:c}=S0e(a,o===!0);return{type:"code_block",language:l,code:String(c??""),raw:String(a??""),diff:r,loading:i===!0?!1:i===!1?!0:!t,originalCode:u,updatedCode:c}}return{type:"code_block",language:l,code:String(a??""),raw:String(a??""),diff:r,loading:i===!0?!1:i===!1?!0:!t}}function _0e(e){const t=e.meta??{};return{type:"footnote_reference",id:String(t.label??""),raw:`[^${String(t.label??"")}]`}}function I0e(){return{type:"hardbreak",raw:`\\ +`}}function M0e(e,t,n){const i=[];let o="",s=t+1;const r=[];for(;s\s*$/.test(t)||Sf.has(e)}function T0e(e){if(!e||e.length===0)return eN();const t=t8.get(e);if(t)return t;const n=e.map(Va).filter(Boolean);if(!n.length){const o=eN();return t8.set(e,o),o}const i={customTagSet:new Set(n),allowedTagSet:W4({customHtmlTags:e})};return t8.set(e,i),i}function AW(e){const t=e,n=t.raw??t.content??t.markup??"";return String(n??"")}function E0e(e){const t=e.meta,n=t?.markstreamCustomHtmlRaw,i=t?.markstreamCustomHtmlInner;return typeof n=="string"&&typeof i=="string"?{raw:n,inner:i}:null}function ab(e,t){const n=t.toLowerCase();for(let i=e.length-1;i>=0;i--){const[o,s]=e[i];if(String(o).toLowerCase()===n)return s}}function L0e(e,t,n){const i=e.slice();return ab(i,"href")||i.push(["href",t]),n!=null&&!ab(i,"title")&&i.push(["title",n]),i}function CA(e){return e.map(AW).join("")}function R9(e){const t=[],n=i=>{const o=String(i??"");if(!o)return;const s=t[t.length-1];if(s?.type==="text"){s.content=`${s.content}${o}`,s.raw=`${s.raw}${o}`;return}t.push({type:"text",content:o,raw:o})};for(const i of e)if(i){if(i.type==="reference"||i.type==="footnote_reference"){n(String(i.raw??""));continue}if("children"in i&&Array.isArray(i.children)){t.push({...i,children:R9(i.children)});continue}t.push(i)}return t}function N0e(e,t,n){let i=0;for(let o=t;o`;g.toLowerCase().includes(M.toLowerCase())||(g+=M),k=!0,y=!0}const v=[],C=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let w;for(;(w=C.exec(l))!==null;){const M=w[1],L=w[2]||w[3]||w[4]||"";v.push([M,L])}if(u?.has(a)){const M=E0e(e);return[{type:a,tag:a,attrs:v,content:M?M.inner:h.innerTokens.length?CA(h.innerTokens):"",children:h.innerTokens.length?i(h.innerTokens,o,s,r):[],raw:M?.raw??g,loading:e.loading||y,autoClosed:k},h.nextIndex]}return[{type:"html_inline",tag:a,attrs:v,content:g,children:m,raw:g,loading:y,autoClosed:k},h.nextIndex]}function xW(e){if(e.type==="math_inline"){if(e.raw)return String(e.raw);const t=e.markup==="$$"?"$$":"$";return`${t}${String(e.content??"")}${t}`}return Array.isArray(e.children)&&e.children.length>0?e.children.map(t=>xW(t)).join(""):String(e.content??"")}function D0e(e){return!e||!Array.isArray(e.children)||e.children.length===0?"":e.children.map(t=>xW(t)).join("")}function tN(e,t=!1){let n=e.attrs??[],i=null;if((!n||n.length===0)&&Array.isArray(e.children))for(const d of e.children){const f=d.attrs;if(Array.isArray(f)&&f.length>0){n=f,i=d;break}}const o=String(n.find(d=>d[0]==="src")?.[1]??""),s=n.find(d=>d[0]==="alt")?.[1],r=D0e(i??e);let l="";r?l=r:s!=null&&String(s).length>0?l=String(s):i?.content!=null&&String(i.content).length>0?l=String(i.content):Array.isArray(i?.children)&&i.children[0]?.content?l=String(i.children[0].content):Array.isArray(e.children)&&e.children[0]?.content?l=String(e.children[0].content):e.content!=null&&String(e.content).length>0&&(l=String(e.content));const a=n.find(d=>d[0]==="title")?.[1]??null,u=a===null?null:String(a),c=String(e.content??"");return{type:"image",src:o,alt:l,title:u,raw:c,loading:t}}function R0e(e){const t=String(e.content??"");return{type:"inline_code",code:t,raw:t}}function O0e(e,t,n){const i=[];let o="",s=t+1;const r=[];for(;s=0;i--){const[o,s]=e[i];if(String(o).toLowerCase()===n)return s}}function B0e(e,t,n){const i=e.slice();return ub(i,"href")||i.push(["href",t]),n!=null&&!ub(i,"title")&&i.push(["title",n]),i}function My(e,t,n){const i=e[t],o=P0e(i.attrs),s=String(ub(o,"href")??""),r=ub(o,"title"),l=r==null?null:String(r),a=B0e(o,s,l);let u=t+1;const c=[];let d=!0;for(;uy.type==="strong_open")){const y=String(h.content??""),k=String(h.raw??y),v=op(h);v.content=y.slice(0,-2),v.raw=k.replace(/\*\*$/,""),f=c.slice(),f[f.length-1]=v}const m=bo(f,void 0,void 0,n),g=m.map(y=>{const k=y;return"content"in y?String(k.content??""):String(k.raw??"")}).join("");return{node:{type:"link",href:s,title:l,text:g,children:m,raw:`[${g}](${s}${l?` "${l}"`:""})`,loading:d,attrs:a},nextIndex:u0?i:[{type:"text",content:a,raw:a}],raw:`~${a}~`},nextIndex:s0?i:[{type:"text",content:o||String(e[t].content??""),raw:o||String(e[t].content??"")}],raw:`^${o||String(e[t].content??"")}^`},nextIndex:s?@[\\\]^_`{|}~]/,Y0e=/\p{P}/u,J0e=/^[\x22\x27《「『【〔〖〘〚〈([{“‘﹁﹃﹙﹛﹝]$/u,X0e=/^[\x22\x27》」』】〕〗〙〛〉)]}”’﹂﹄﹚﹜﹞]$/u,eve=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,tve=/:\/\//,AA=1,SW=2,nve=4,ive=8,_W=16,Bd=32,O9=64,r0=128,IW=256,ove=512,l0=1024,sve=1982;function Ty(e){let t=0;for(let n=0;n=t){n++,i++;continue}n++,i++;continue}if(o==="*"&&n>=t)return n;n++}return-1}function _f(e){return!!e&&G0e.test(e)}function If(e){return!!e&&(Q0e.test(e)||Y0e.test(e))}function TW(e,t){return!!e&&!!t&&/^\p{Script=Han}$/u.test(t)&&J0e.test(e)}function EW(e,t){return!!e&&!!t&&/^[\p{L}\p{N}]$/u.test(t)&&X0e.test(e)}function lve(e,t){const n=t>0?e[t-1]:void 0,i=e[t+1];return!i||_f(i)?!1:!(If(i)&&!TW(i,n)&&n&&!_f(n)&&!If(n))}function ave(e,t){const n=t>0?e[t-1]:void 0,i=e[t+1];return!n||_f(n)?!1:!(If(n)&&!EW(n,i)&&i&&!_f(i)&&!If(i))}function uve(e,t,n=0){let i=n,o=!1;for(;i0?e[t-1]:void 0,i=e[t+2];return!i||_f(i)?!1:!(If(i)&&!TW(i,n)&&n&&!_f(n)&&!If(n))}function dve(e,t){const n=t>0?e[t-1]:void 0,i=e[t+2];return!n||_f(n)?!1:!(If(n)&&!EW(n,i)&&i&&!_f(i)&&!If(i))}function fve(e,t=0){let n=t,i=!1;for(;n=0&&e[s]==="\\";s--)o++;return o%2===1}const gve=/[\p{L}\p{N}]/u,vve=/^[\p{L}\p{N}]+$/u;function xA(e){return e?gve.test(e):!1}function LW(e){return e?vve.test(e):!1}function B0(e,t){let n=t;for(;n0?e[t-1]:void 0,o=n=2&&i.intraword&&t.push({start:n,end:o}),n=o}for(let n=0;n=3)return i;n=i+o.len}return-1}function wve(e){return e?eve.test(e)||tve.test(e):!1}function Cve(e,t){if(!e||!t)return null;const n=e.match(/\[([^\]\n]+)\]\(([^)]*)$/);return n&&n[2]===t?n[1]:null}function bo(e,t,n,i){if(!e||e.length===0)return[];const o=i?.__linkifyDemotionContext,s=h2(t),r={filename:o?.filename||s.filename,explicitFilename:o?.explicitFilename||s.explicitFilename,marketTicker:o?.marketTicker||s.marketTicker};(r.filename||r.explicitFilename||r.marketTicker)&&(i={...i,__linkifyDemotionContext:r});const l=i,a=[];let u=null,c=0;const d=i?.requireClosingStrong,f=e;function h(){return e===f&&(e=e.slice()),e}function m(){u=null}function g(Y,J){const U=e.length===1?t:String(J.content??""),Q=[],ue=yve(Y);if(ue!==-1){M(Y.slice(0,ue),Y.slice(0,ue));const pe=Y.slice(ue);return pe&&(T({type:"text",content:pe,raw:pe}),c--),c++,!0}if(U0e.test(Y)){const pe=Y.indexOf("~~");pe!==-1&&Q.push({type:"strikethrough",index:pe})}if(V0e.test(Y)){const pe=Y.indexOf("**");pe!==-1&&Q.push({type:"strong",index:pe})}if(/[^*]*\*[^*]+/.test(Y)){const pe=U?MW(U,0):Y.indexOf("*");if(U&&pe===-1)return!1;pe!==-1&&Q.push({type:"emphasis",index:pe})}Q.sort((pe,ee)=>pe.index!==ee.index?pe.index-ee.index:pe.type===ee.type?0:pe.type==="strong"?-1:ee.type==="strong"?1:0);const me=Q[0];if(!me)return!1;if(me.type==="strikethrough"){const pe=me.index,ee=pe>-1?Y.slice(0,pe):"";if(ee&&M(ee,ee),pe===-1)return c++,!0;const re=Y.indexOf("~~",pe+2),ge=re===-1?Y.slice(pe+2):Y.slice(pe+2,re),ae=re===-1?"":Y.slice(re+2),{node:Ce}=iN([{type:"s_open",tag:"s",content:"",markup:"~~",info:"",meta:null},{type:"text",tag:"",content:ge,markup:"",info:"",meta:null},{type:"s_close",tag:"s",content:"",markup:"~~",info:"",meta:null}],0,i);return m(),w(Ce),ae&&(T({type:"text",content:ae,raw:ae}),c--),c++,!0}if(me.type==="strong"){const pe=me.index,ee=pe>-1?Y.slice(0,pe):"";if(ee&&M(ee,ee),pe===-1)return c++,!0;if(t&&pe===0){let ce=!1,Te=0;for(;Te=2)return M(Y,Y),c++,!0}}if(t&&(Y.match(/\*/g)||[]).length>rve(t))return M(Y.slice(ee.length),Y.slice(ee.length)),c++,!0;const re=B0(Y,pe);if(re.len>=3){const ce=bve(Y,pe+re.len);if(ce!==-1){const Te=Y.slice(pe+re.len,ce);if(kve(Te)){const{node:ke}=Rg([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:Te,markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,i);m(),w(ke);const Ae=Y.slice(ce+3);return Ae&&(T({type:"text",content:Ae,raw:Ae}),c--),c++,!0}}}if(!cve(Y,pe)){const ce=Y.slice(pe,pe+re.len);M(ce,ce);const Te=Y.slice(pe+re.len);return Te&&(T({type:"text",content:Te,raw:Te}),c--),c++,!0}const ge=fve(Y,pe+2);let ae="",Ce="";if(ge.index!==-1){ae=Y.slice(pe+2,ge.index),Ce=Y.slice(ge.index+2);const ce=ge.index,Te=B0(Y,ce);if(re.intraword&&Te.intraword&&!LW(ae)||!ae&&re.len>=4&&re.intraword)return M(Y.slice(ee.length),Y.slice(ee.length)),c++,!0}else{if(d||ge.sawInvalidClose||re.intraword)return M(Y.slice(ee.length),Y.slice(ee.length)),c++,!0;ae=Y.slice(pe+2),Ce=""}if(!ae&&/^\*+$/.test(Ce))return M(Y,Y),c++,!0;const{node:ve}=Rg([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"text",tag:"",content:ae,markup:"",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,i);return m(),w(ve),Ce&&(T({type:"text",content:Ce,raw:Ce}),c--),c++,!0}if(me.type==="emphasis"){let pe=me.index;pe===-1&&(pe=0);const ee=Y.slice(0,pe);if(ee&&M(ee,ee),!lve(Y,pe)){M(Y[pe],Y[pe]);const ce=Y.slice(pe+1);return ce&&(T({type:"text",content:ce,raw:ce}),c--),c++,!0}const re=B0(Y,pe),ge=uve(U,Y,pe+1),ae=ge.index,Ce=e[c+1];if(i?.final&&Ce?.type==="em_open"&&ae!==-1&&Y.slice(pe+1,ae).trim()!==Y.slice(pe+1,ae)||ae===-1&&(ge.sawInvalidClose||i?.final||re.intraword||!xA(Y[pe+1])))return M(Y.slice(pe),Y.slice(pe)),c++,!0;const{node:ve}=Iy([{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:ae>-1?Y.slice(pe+1,ae):Y.slice(pe+1),markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null}],0,i);if(m(),w(ve),ae!==-1&&ae{for(let ve=0;ve=0&&Ce[Te]==="\\";Te--)ce++;if(ce%2===0)return ve}return-1})(Y);if(Q===-1)return!1;let ue=1;for(let Ce=Q+1;Ceme?.type==="math_inline")||!K0e.test(Y))return null;const U=J.parseInline(Y,{__markstreamFinal:!!i?.final});if(!Array.isArray(U)||U.length===0)return null;const Q=(U.find(me=>me?.type==="inline")?.children??[]).filter(me=>!(me?.type==="text"&&String(me.content??"")===""));if(!Q.length||!Q.some(me=>me?.type!=="text")||Q.length===1&&Q[0]?.type==="text"&&String(Q[0].content??"")===Y)return null;const ue=bo(Q,Y,n,i);return ue.length?ue:null}function v(Y){m(),a.push(Y)}function C(Y){m();const J=op(Y);a.push(J)}function w(Y){v(Y)}function M(Y,J){u?(u.content+=Y,u.raw+=J??Y):(u={type:"text",content:String(Y??""),raw:String(J??Y??"")},a.push(u))}function L(Y,J){if(!Y)return;const U=bo([{...J,type:"text",content:Y,raw:Y}],Y,n,i);if(U.length===1&&U[0]?.type==="text"){const Q=U[0];M(String(Q.content??""),String(Q.raw??Q.content??""));return}for(const Q of U)w(Q)}function E(Y,J){return String(Y.markup??"").startsWith(J)}function S(Y){if(!u||Y.loading!==!0||Y.markup!=="\\(\\)")return;const J=e[c-1];!J||J.type!=="text"||!E(J,"\\(")||u.content.endsWith("(")&&(u.content=u.content.slice(0,-1),u.raw.endsWith("(")&&(u.raw=u.raw.slice(0,-1)),!u.content&&a[a.length-1]===u&&(a.pop(),u=null))}function x(Y){return Y.endsWith("](")?e[c+1]?.type==="link_open"&&e[c+1]?.markup==="linkify"&&e[c+2]?.type==="text"&&e[c+3]?.type==="link_close"&&e[c+4]?.type==="text"&&String(e[c+4]?.content??"").startsWith(")"):!1}function A(Y,J,U=Ty(Y)){let Q=Y;const ue=String(J.content??"");return(U&AA)!==0&&Q.endsWith("\\")&&!E(J,"\\\\")&&!ue.endsWith("\\\\")&&(Q=Q.slice(0,-1)),(U&l0)!==0&&Q.endsWith("(")&&!E(J,"\\(")&&!ue.endsWith("\\(")&&(Q=Q.slice(0,-1)),(U&SW)!==0&&/\*+$/.test(Q)&&!E(J,"\\*")&&!ue.endsWith("\\*")&&(Q=Q.replace(/\*+$/,"")),Q}for(;c=0;ce--){const Te=a[ce];if(Te.type!=="text")break;re=ce,ge=String(Te.content??"")+ge}rere==="href")?.[1],ee=String(pe??"");if(t&&ee){const re=t.indexOf("](");if(re!==-1){const ge=t.indexOf(")",re+2);ge===-1?U.loading=!0:U.loading&&t.slice(re+2,ge).includes(ee)&&(U.loading=!1)}}/^file:\/\/\/[a-z]:\//i.test(U.href)&&$(U,J-1)||P(U)||v(U)}function R(Y){if(Y.markup!=="linkify")return!1;const{node:J,nextIndex:U}=My(e,c,i);return W(J,U)?(c=U,!0):!1}function F(Y){m(),w($0e(Y)),c++}function P(Y){if(Y.type!=="link")return!1;const J=a[a.length-1];if(!J||J.type!=="text")return!1;const U=String(J.content??"").match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!U)return!1;const Q=Y,ue=String(Q.href??""),me=String(Q.text??""),pe=String(U[2]??""),ee=ue.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,"");if(!ue||!(me===ue||me===ee||wve(me)))return!1;const re=String(U[1]??"");return re?(J.content=re,J.raw=re):a.pop(),v({...Y,text:pe,children:[{type:"text",content:pe,raw:pe}],raw:`[${pe}](${ue}${Q.title?` "${Q.title}"`:""})`}),!0}function z(Y){if(Y.type!=="link")return!1;const J=Y,U=String(J.href??"");return U?W({href:U,title:J.title==null||J.title===""?null:String(J.title),loading:!!J.loading},c+1):!1}function W(Y,J){const U=a[a.length-1];if(U?.type!=="image"||U.src||!U.loading||!String(U.raw??"").endsWith("]("))return!1;const Q=e[J],ue=String(Q?.content??"");if(Q?.type!=="text"||!ue.startsWith(")"))return!1;a.pop(),u=null;const me=String(U.alt??"");v({type:"image",src:Y.href,alt:me,title:Y.title,raw:`![${me}](${Y.href}${Y.title?` "${Y.title}"`:""})`,loading:!!Y.loading});const pe=ue.slice(1),ee=op(Q);return ee.content=pe,ee.raw=pe,h()[J]=ee,!0}function $(Y,J=c-1){if(Y.type!=="link")return!1;const U=a[a.length-1],Q=e[J];if(!U||U.type!=="text"||Q?.type!=="text")return!1;const ue=String(U.content??""),me=String(Q.content??"");if(!ue.endsWith("!")||!me.endsWith("!")||E(Q,"\\!"))return!1;const pe=ue.slice(0,-1);pe?(U.content=pe,U.raw=pe,u=U):(a.pop(),u=null);const ee=Y,re=String(ee.text??ee.children?.map(Ce=>String(Ce?.content??Ce?.raw??"")).join("")??""),ge=String(ee.href??""),ae=ee.title==null||ee.title===""?null:String(ee.title);return v({type:"image",src:ge,alt:re,title:ae,raw:`![${re}](${ge}${ae?` "${ae}"`:""})`,loading:!!ee.loading}),!0}function K(Y,J="",U=null){const Q=String(Y.alt??Y.raw??"");return{type:"link",href:J,title:U,text:Q,children:[Y],raw:`[${Q}](${J}${U?` "${U}"`:""})`,loading:!0}}function ne(Y){const J=Y.startsWith("![")?Y:`![${Y}`,U=J.slice(2),Q=U.indexOf("](");return{type:"image",src:"",alt:Q===-1?U.replace(/\]$/,""):U.slice(0,Q),title:null,raw:J,loading:!0}}function G(Y){const J=Y.indexOf("[![");if(J===-1||typeof t=="string"&&e.length===1&&mve(t,J,"["))return!1;const U=Y.slice(0,J);return U&&M(U,U),v(K(ne(Y.slice(J+1)))),c++,!0}function te(Y){if(i?.final)return!1;const J=e[c-1];if(J?.type!=="text"||!String(J.content??"").endsWith("[")||E(J,"\\["))return!1;const U=a[a.length-1];if(U?.type==="text"&&U.content.endsWith("[")){const Q=U.content.slice(0,-1);Q?(U.content=Q,U.raw=Q,u=U):(a.pop(),u=null)}return v(K(tN(Y))),c++,!0}function le(Y){if(Y.type!=="link")return!1;const J=Y,U=String(J.raw??""),Q=String(J.text??"");if(!U.startsWith("[![")&&!Q.startsWith("!["))return!1;const ue=J.title==null||J.title===""?null:String(J.title);return v(K({type:"image",src:String(J.href??""),alt:Q.replace(/^!\[/,"").replace(/\]$/,""),title:ue,raw:U.startsWith("[![")?U.slice(1):U,loading:!0})),!0}function ie(Y){if(!Y.startsWith("]("))return!1;const J=e[c-2];if(J?.type==="text"&&String(J.content??"").endsWith("[")&&E(J,"\\["))return!1;const U=a[a.length-1];if(U?.type!=="image"&&U?.type!=="link")return!1;const Q=U,ue=U?.type==="link"&&Array.isArray(Q.children)&&Q.children.length===1&&Q.children[0]?.type==="image"?a.pop():null,me=ue?ue.children[0]:a.pop();if(!me||me.type!=="image")return!1;const pe=e[c+1];let ee=String(ue?.href??""),re=ue?.title==null?null:String(ue.title),ge=!0;if(pe?.type==="link_open"){const{node:Ce,nextIndex:ve}=My(e,c+1,i);ee=Ce.href,re=Ce.title,ge=!0,c=ve}else{if(ee=Y.slice(2),ee.includes('"')){const Ce=ee.split('"');ee=String(Ce[0]??"").trim(),re=Ce[1]==null?null:String(Ce[1]).trim()}c++}const ae=K(me,ee,re);return ae.loading=ge,v(ae),!0}function _e(){const Y=e[c-3];return e[c-2]?.type==="image"&&e[c-1]?.type==="text"&&String(e[c-1].content??"")==="]("&&Y?.type==="text"&&String(Y.content??"").endsWith("[")&&E(Y,"\\[")}function Z(Y,J){const U=Y.indexOf("[");if(U===-1)return!1;let Q=Y.slice(0,U);const ue=Y.indexOf("](",U);if(ue!==-1){const me=e[c+2];let pe=Y.slice(U+1,ue);if(pe.includes("[")){const ce=pe.indexOf("[");Q+=Y.slice(0,U+ce+1);const Te=U+ce+1;pe=Y.slice(Te+1,ue)}const ee=e[c+1];if(Y.endsWith("](")&&ee?.type==="link_open"&&me){const ce=e[c+4];let Te=4,ke=!0;if(ce?.type==="text"){const Ne=String(ce.content??"");if(Ne.startsWith(")")){ke=!1;const Ze=Ne.slice(1);if(Ze){const rt=op(ce);rt.content=Ze,rt.raw=Ze,h()[c+4]=rt}else Te++}else Ne==="."&&Te++}L(Q,J);const Ae=String(me.content??"");return i?.validateLink&&!i.validateLink(Ae)?M(pe,pe):v({type:"link",href:Ae,title:null,text:pe,children:[{type:"text",content:pe,raw:pe}],loading:ke}),c+=Te,!0}const re=Y.indexOf(")",ue),ge=re!==-1?Y.slice(ue+2,re):"",ae=re===-1;let Ce=Q.match(/\*+$/);if(Ce&&(Q=Q.replace(/\*+$/,"")),L(Q,J),Ce||(Ce=pe.match(/^\*+/)),!d&&Ce){const ce=Ce[0].length;pe=pe.replace(/^\*+/,"").replace(/\*+$/,"");const Te=[];if(ce===1?Te.push({type:"em_open",tag:"em",nesting:1}):ce===2?Te.push({type:"strong_open",tag:"strong",nesting:1}):ce===3&&(Te.push({type:"strong_open",tag:"strong",nesting:1}),Te.push({type:"em_open",tag:"em",nesting:1})),Te.push({type:"link",href:ge,title:null,text:pe,children:[{type:"text",content:pe,raw:pe}],loading:ae}),ce===1){Te.push({type:"em_close",tag:"em",nesting:-1});const{node:ke}=Iy(Te,0,i);w(ke)}else if(ce===2){Te.push({type:"strong_close",tag:"strong",nesting:-1});const{node:ke}=Rg(Te,0,void 0,i);w(ke)}else if(ce===3){Te.push({type:"em_close",tag:"em",nesting:-1}),Te.push({type:"strong_close",tag:"strong",nesting:-1});const{node:ke}=Rg(Te,0,void 0,i);w(ke)}else{const{node:ke}=Iy(Te,0,i);w(ke)}}else i?.validateLink&&!i.validateLink(ge)?M(pe,pe):v({type:"link",href:ge,title:null,text:pe,children:[{type:"text",content:pe,raw:pe}],loading:ae});const ve=re!==-1?Y.slice(re+1):"";return ve&&(T({type:"text",content:ve,raw:ve}),c--),c++,!0}return!1}function se(Y){const J=Y.indexOf("![");if(J===-1)return!1;const U=Y.slice(0,J);return U&&!u?u={type:"text",content:U,raw:U}:U&&u&&(u.content+=U),u&&(a.push(u),u=null),v(ne(Y.slice(J))),c++,!0}function he(Y){if(!(Y?.startsWith("[")&&n?.type==="list_item_open"))return!1;const J=Y.slice(1).match(/[^\s\]]/);if(J===null)return c++,!0;if(J&&/x/i.test(J[0])){const U=J[0]==="x"||J[0]==="X";return v({type:"checkbox_input",checked:U,raw:U?"[x]":"[ ]"}),c++,!0}return!1}return a}function Sx(e,t,n){const i=n?.__sourceLineMapper;if(!i)return{startLine:e,endLine:t};const o=i(e),s=t>e?i(t-1).endLine:i(t).startLine;return{startLine:o.startLine,endLine:Math.max(o.startLine,s)}}function oN(e,t){const n=Math.max(0,Math.min(e.length,Math.trunc(t)));let i=0;for(let o=0;oi&&e[o-1]!==` +`&&r++,{startLine:s,endLine:r}}function Rv(e,t,n,i){const o=Ave(e,t,n);return Sx(o.startLine,o.endLine,i)}function xve(e,t){const n=e?.map;if(!Array.isArray(n)||n.length<2)return null;const i=Number(n[0]),o=Number(n[1]);return!Number.isFinite(i)||!Number.isFinite(o)?null:Sx(i,o,t)}function bi(e,t,n){if(!n?.includeSourceMap)return e;const i=xve(t,n);if(!i)return e;if(e.sourceMap=i,e.type==="code_block"){const o=e;o.startLine=i.startLine,o.endLine=i.endLine}return e}function Sve(e,t,n,i){if(!i?.includeSourceMap)return e;const o=t?.map;if(!Array.isArray(o)||o.length<2)return e;const s=Number(o[0]),r=Number(o[1]),l=Number(n);return!Number.isFinite(s)||!Number.isFinite(r)||!Number.isFinite(l)||(e.sourceMap=Sx(s,Math.max(r,l),i)),e}function _ve(e){const t=String(e.content??""),n=t.replace(/[ \t\r\n]+$/g,"");if(n===t)return;e.content=n;const i=e.children;if(!(!Array.isArray(i)||i.length===0))for(;i.length;){const o=i[i.length-1];if(!o){i.pop();continue}if(o.type==="softbreak"||o.type==="hardbreak"){i.pop();continue}if(o.type==="text"){const s=String(o.content??""),r=s.replace(/[ \t\r\n]+$/g,"");if(r===s)break;if(r){o.content=r;break}i.pop();continue}break}}function Ive(e){const t=String(e.content??""),n=t.match(/\r?\n\s*\d+[.)]?\s*$/);if(!n||typeof n.index!="number")return;e.content=t.slice(0,n.index);const i=e.children;if(!(!Array.isArray(i)||i.length===0))for(;i.length;){const o=i[i.length-1];if(!o){i.pop();continue}if(o.type==="softbreak"||o.type==="hardbreak"){i.pop();continue}if(o.type==="text"){const s=String(o.content??"");if(/^[ \t\r\n\d.)]*$/.test(s)){i.pop();continue}const r=s.replace(/[ \t\r\n\d.)]+$/g,"");r!==s&&(r?o.content=r:i.pop())}break}}function Mve(e){const t=String(e.content??"");return/[ \t\r\n]+$/.test(t)||/\r?\n\s*\d+[.)]?\s*$/.test(t)}function Gm(e,t,n){const i=e[t],o=[],s=qf(n,!0);let r=t+1;for(;rd.raw).join("")};n?.includeSourceMap&&bi(c,e[r],n),o.push(c),r=u+1}else r+=1;const l={type:"list",ordered:i.type==="ordered_list_open",start:(()=>{if(i.attrs&&i.attrs.length){const a=i.attrs.find(u=>u[0]==="start");if(a){const u=Number(a[1]);return Number.isFinite(u)&&u!==0?u:1}}})(),items:o,raw:o.map(a=>a.raw).join(` +`)};return n?.includeSourceMap&&bi(l,i,n),[l,r+1]}function Tve(e,t,n,i){const o=String(n[1]??"note"),s=String(n[2]??o.charAt(0).toUpperCase()+o.slice(1)),r=[],l=qf(i,!0);let a=t+1;for(;au.raw).join(` +`)} +:::`},a+1]}const Eve=new Set(["warning","info","note","tip","danger","caution"]);function Lve(e){let t=0;for(;t=0;g--){const y=f[g];if(y.type==="text"&&/:+/.test(y.content)){h=g;break}}const m={type:"paragraph",children:bo((h!==-1?f.slice(0,h):f)||[],void 0,void 0,a.options()),raw:String(d.content??"").replace(/\n:+$/,"").replace(/\n\s*:::\s*$/,"")};n?.includeSourceMap&&bi(m,e[u],n),l.push(m),a.remember(m.raw)}u+=3}else if(e[u].type==="bullet_list_open"||e[u].type==="ordered_list_open"){const[d,f]=Gm(e,u,a.options());n?.includeSourceMap&&bi(d,e[u],n),l.push(d),a.remember(d.raw),u=f}else if(e[u].type==="blockquote_open"){const[d,f]=Qm(e,u,a.options());n?.includeSourceMap&&bi(d,e[u],n),l.push(d),a.remember(d.raw),u=f}else{const d=z4(e,u,a.options());d?(l.push(d[0]),a.remember(d[0].raw),u=d[1]):u++}return[{type:"admonition",kind:o,title:s,children:l,raw:`:::${o} ${s} +${l.map(d=>d.raw).join(` +`)} +:::`},u+1]}const Fve=/^::: ?(warning|info|note|tip|danger|caution|error) ?(.*)$/;function Dve(e,t,n){const i=e[t];if(i.type!=="container_open")return null;const o=Fve.exec(String(i.info??""));return o?Tve(e,t,o,n):null}const _x={parseContainer:(e,t,n)=>Nve(e,t,n),matchAdmonition:Dve};function Qm(e,t,n){const i=[],o=qf(n,!0);let s=t+1;for(;sl.raw).join(` +`)};return n?.includeSourceMap&&bi(r,e[t],n),[r,s+1]}function Rve(e){if(e.info?.startsWith("diff"))return Ax(e);const t=String(e.content??""),n=t.match(/ type="application\/vnd\.ant\.([^"]+)"/);let i=t;n?.[1]&&(i=t.replace(/]*>/g,"").replace(/<\/antArtifact>/g,""));const o=Array.isArray(e.map)&&e.map.length===2;return{type:"code_block",language:n?n[1]:String(e.info??""),code:i,raw:i,loading:!o}}function Ove(e,t,n){const i=[];let o=t+1,s=[],r=[];const l=qf(n,!0);for(;ou.raw).join("")),o+=3}else if(e[o].type==="dd_open"){let a=o+1;for(r=[];a0&&(i.push({type:"definition_item",term:s,definition:r,raw:`${s.map(u=>u.raw).join("")}: ${r.map(u=>u.raw).join(` +`)}`}),s=[]),o=a+1}else o++;return[{type:"definition_list",items:i,raw:i.map(a=>a.raw).join(` +`)},o+1]}function Pve(e,t,n){const i=e[t].meta??{},o=String(i?.label??"0"),s=[],r=qf(n,!0);let l=t+1;for(;la.raw).join(` +`)}`},l+1]}function Bve(e,t,n){const i=e[t],o=i.attrs,s=Array.isArray(o)&&o.length?Object.fromEntries(o.filter(c=>Array.isArray(c)&&c.length>=1&&c[0]).map(([c,d])=>[String(c),d==null||d===""?!0:String(d)])):void 0,r=String(i.tag?.substring(1)??"1"),l=Number.parseInt(r,10),a=e[t+1],u=String(a.content??"");return{type:"heading",level:l,text:u,...s?{attrs:s}:{},children:bo(a.children||[],u,void 0,n),raw:u}}function $ve(e,t,n){const i=t.toLowerCase(),o=new RegExp(String.raw`^<\s*${i}(?=\s|>|/)`,"i"),s=new RegExp(String.raw`^<\s*\/\s*${i}(?=\s|>)`,"i");let r=0,l=Math.max(0,n);for(;l$/.test(d)||r++,l=a+c+1;continue}l=a+1}return-1}function NW(e){const t=String(e.content??"");if(/^\s*");else if(a)a=!y.includes(">");else if(u)u=!y.includes("?>");else if(y.startsWith("");else if(y.startsWith("");else if(y.startsWith("");else{const k=o(y);if(k)if(k.closing){for(let v=r.length-1;v>=0;v--)if(r[v]===k.tag){r.length=v;break}}else k.selfClosing||s(k.after,k.tag)||r.push(k.tag)}}if(d===-1||d>=t)break;c=d+1}return l||a||u||r.length>0}function x2e(e,t,n){if(!n?.length)return!1;const i=new Set(Np(n));if(!i.size)return!1;const o=c=>{const d=c.charCodeAt(0);return d>=65&&d<=90||d>=97&&d<=122||d>=48&&d<=57||c==="_"||c==="-"||c===":"},s=c=>c===" "||c===" ",r=c=>{if(c[0]!=="<")return null;let d=1;for(;d"&&g!=="/")return null;const y=c.indexOf(">",d);if(y===-1)return null;let k=y-1;for(;k>=0&&s(c[k]);)k--;return{closing:f,tag:m,selfClosing:!f&&c[k]==="/",after:c.slice(y+1)}},l=(c,d)=>{const f=c.toLowerCase();let h=0;for(;h")return!0}}return!1},a=[];let u=0;for(;u=t?t:c,f=e.slice(u,d),h=f.endsWith("\r")?f.slice(0,-1):f,m=Ym(h);if(m){const g=r(h.slice(m.index));if(g)if(g.closing){for(let y=a.length-1;y>=0;y--)if(a[y]===g.tag){a.length=y;break}}else g.selfClosing||l(g.after,g.tag)||a.push(g.tag)}if(c===-1||c>=t)break;u=c+1}return a.length>0}function S2e(e,t){const n=t2e.exec(e);if(!n)return null;const i=n[1]??"",o=n.index+i.length,s=e.indexOf(` +`,o),r=e.slice(o,s===-1?e.length:s);return!Ym(r.endsWith("\r")?r.slice(0,-1):r)||HW(e,o)||A2e(e,o)||x2e(e,o,t)?null:`${e.slice(0,n.index)}${i}`}function Fx(e,t,n){let i=t;for(;ii&&(r=!0),t.inMath=!1,t.mathOpenOffset=null,s+=2;continue}s++;continue}if(t.inDollarMath){if(e.startsWith("$$",s)&&!Qu(e,l)){i!=null&&o&&n+s+2>i&&(r=!0),t.inDollarMath=!1,t.dollarMathOpenOffset=null,s+=2;continue}s++;continue}if(e[s]==="`"&&!Qu(e,l)){const a=Fx(e,s,"`"),u=WW(e,s+a,a);if(u===-1)break;s=u+a;continue}if(e.startsWith("\\[",s)&&!Qu(e,l)){t.inMath=!0,t.mathOpenOffset=n+s,s+=2;continue}if(e.startsWith("$$",s)&&!Qu(e,l)){t.inDollarMath=!0,t.dollarMathOpenOffset=n+s,s+=2;continue}s++}return r}function _2e(e,t){if(!wx(t))return e;const n=t,i=uN.get(n),o=i?.source===e?i.state:i&&e.startsWith(i.source)?qW(i.state,e.slice(i.source.length),i.source.length-i.state.lineBuffer.length).state:H4(e).state;uN.set(n,{source:e,state:o});const{context:s}=o,r=s.inMath?s.mathOpenOffset:s.inDollarMath?s.dollarMathOpenOffset:null;if(r==null)return e;const l=e.slice(r+2),a=e.lastIndexOf(` +`,r-1)+1;if(e.slice(a,r).trim()!==""&&!/^\r?\n/.test(l)||/^\s*!\[/.test(l))return e;const u=l.trim(),c=/^(?:[a-z]|pi)$/i.test(u);return Qd(l)&&!c?e:e.slice(0,r)}function I2e(e,t,n,i,o){const s=Tx(e),r=Ex(e);if(t.inFence&&t.fenceInBlockquote&&e.trim()&&Lx(e)==null&&l8(t),t.inFence&&t.fenceInList&&e.trim()&&s.column=t.fenceLen&&/^\s*$/.test(l.rest)&&l8(t):(t.inFence=!0,t.fenceChar=l.markerChar,t.fenceLen=l.markerLen,t.fenceInBlockquote=l.inBlockquote,t.fenceInList=l.inList||t.listContentIndent!=null&&!l.inBlockquote&&s.column>=t.listContentIndent,t.fenceListIndent=l.listIndent||t.listContentIndent||0);else if(!t.inFence)return hN(e,t,n,i,o)}else return hN(e,t,n,i,o);return!1}function H4(e,t=y2e(),n=null,i=!1,o=0){const s=z0(t);let r=z0(t),l="",a=!1,u=0;for(;uu&&e[c-1]==="\r"?c-1:d?c:e.length,h=e.slice(u,f);I2e(h,s,o+u,n,i)&&(a=!0),d?(r=z0(s),l=""):l=h,u=d?c+1:e.length}return{closedOpenMath:a,state:{committedContext:r,context:s,lineBuffer:l}}}function qW(e,t,n=0){return t&&!e.context.inMath&&!e.context.inDollarMath&&!e.context.inFence&&!e.committedContext.inFence&&!/[\\$`~\r\n]/.test(t)&&!(e.lineBuffer.endsWith("\\")&&(t[0]==="["||t[0]==="]"))?{closedOpenMath:!1,state:{committedContext:z0(e.committedContext),context:z0(e.context),lineBuffer:e.lineBuffer+t}}:H4(e.lineBuffer+t,e.committedContext,n+e.lineBuffer.length,e.context.inMath||e.context.inDollarMath,n)}function M2e(e,t){if(!wx(e))return;const n=e.stream;if(typeof n?.reset!="function")return;const i=e,o=j4.get(i);if(o?.source===t)return;const s=o?t.startsWith(o.source):!1,r=s&&o?t.slice(o.source.length):"",l=s&&o?qW(o.explicitBracketMath,r,o.source.length-o.explicitBracketMath.lineBuffer.length):H4(t),a=l.state,u=s&&o?l.closedOpenMath:!1;if(o&&s&&o.key===null&&o.pendingCandidate===!1&&!u&&!C2e(o.source,r)&&!b2e(t)){o.source=t,o.explicitBracketMath=a;return}const c=u0e(t);(o&&(o&&!s||o.key!==c||u)||!o&&c)&&n.reset(),k2e(e,t,c,a)}function T2e(e){return typeof e.preTransformTokens=="function"||typeof e.postTransformTokens=="function"}function UW(e,t){const n=e?.map,i=t?.map;return n===i?!0:!Array.isArray(n)||!Array.isArray(i)?!1:n.length===i.length&&n.every((o,s)=>o===i[s])}function E2e(e,t){const n=e?.attrs,i=t?.attrs;if(n===i)return!0;if(!Array.isArray(n)||!Array.isArray(i)||n.length!==i.length)return!1;for(let o=0;o":""}function vN(e){return{type:"paragraph",children:e,raw:e.map(D2e).join("")}}function yN(e,t){if(t.sourceMap)for(const n of e)n.sourceMap||(n.sourceMap=t.sourceMap)}function kN(e,t){if(e.type!=="paragraph")return null;const n=e.children,i=Array.isArray(n)?n:[];if(i.length===0)return null;const o=h2e(t);if(!o?.size)return null;let s=-1;for(let c=0;ch?.type==="hardbreak")){s=c;break}}if(s===-1)return null;const r=i.slice(0,s),l=i[s];if(!l)return null;const a=[];r.length&&a.push(vN(r)),a.push(l);const u=i.slice(s+1);return u.length&&a.push(vN(u)),a}function R2e(e){const t=e.trim();if(!t)return null;const n=/^(?:]*>\s*)?]*)?>/i.test(t),i=/<\/html>\s*$/i.test(t);return!n||!i?null:[{type:"html_block",tag:"html",raw:e,content:e,loading:!1}]}function j0(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:""}function O2e(e,t){if(e.type!=="html_block"||!t)return!1;const n=String(e.raw??e.content??"");return new RegExp(String.raw`^\s*<\s*\/\s*${Au(t)}\s*>\s*$`,"i").test(n)}const u8=new Set(["iframe","script","style","textarea","title"]);function m2(e,t,n){if(!e||!t)return null;const i=t.toLowerCase(),o=f=>{if(e.startsWith("",f+4);return{closing:!1,end:C===-1?e.length:C+3,selfClosing:!1,tag:""}}if(e.startsWith("",f+9);return{closing:!1,end:C===-1?e.length:C+3,selfClosing:!1,tag:""}}const h=No(e.slice(f));if(h===-1)return null;const m=f+h+1,g=e.slice(f,m);if(/^<\s*[!?]/.test(g))return{closing:!1,end:m,selfClosing:!1,tag:""};let y=g.slice(1).trimStart();const k=y.startsWith("/");k&&(y=y.slice(1).trimStart());const v=y.match(/^([A-Z][\w:-]*)/i);return v?.[1]?{closing:k,end:m,selfClosing:/\/\s*>$/.test(g),tag:v[1].toLowerCase()}:{closing:!1,end:f+1,selfClosing:!1,tag:""}},s=(f,h)=>{const m=new RegExp(String.raw`<\s*\/\s*${Au(f)}(?=\s|>)`,"gi");m.lastIndex=h;const g=m.exec(e);if(!g||g.index==null)return null;const y=o(g.index);return y?{start:g.index,end:y.end}:null};let r=-1,l=-1,a=Math.max(0,n);for(;a$/.test(u))return{raw:u,start:r,end:l+1,closed:!0};if(u8.has(i)){const f=s(i,l+1);return f?{raw:e.slice(r,f.end),start:r,end:f.end,closeStart:f.start,closed:!0}:{raw:e.slice(r),start:r,end:e.length,closed:!1}}let c=1,d=l+1;for(;d]*$/,"")} +`}function bN(e){return e.replace(/\r\n/g,` +`).replace(/(^|\n)[ \t]{1,4}/g,"$1")}function $2e(e,t,n){return n?e.includes(n,t)?!0:bN(e.slice(Math.max(0,t))).includes(bN(n)):!1}function z2e(e,t){let n=Math.max(0,t);for(;n)`,"gi");let i=-1,o;for(;(o=n.exec(e))!==null;)i=o.index;return i}function KW(e,t){return{final:t,__disableStreamParse:!0,requireClosingStrong:e.requireClosingStrong,customHtmlTags:e.customHtmlTags,validateLink:e.validateLink}}const H2e=new Set(["admonition","blockquote","code_block","definition_list","footnote","heading","list","math_block","table","thematic_break"]),W2e=/(?:^|\n)\s{0,3}(?:#{1,6}\s+\S|[-+*]\s+\S|\d+[.)]\s+\S|>\s*\S|`{3,}|~{3,}|(?:\*{3,}|-{3,}|_{3,})(?:\s|$)|\|.*\|)/m;function q2e(e){return/\n\s*\n/.test(e)||W2e.test(e)}function U2e(e,t){if(!e.trim()||t.length===0)return!1;if(t.some(i=>H2e.has(String(i?.type??"").toLowerCase()))||t.some(i=>{if(i?.type!=="html_block")return!1;const o=i;return Array.isArray(o.children)&&o.children.length>0}))return!0;if(!q2e(e))return!1;if(t.length>1)return!0;const[n]=t;return!!(n&&n.type==="paragraph")}function V2e(e){const t=[];let n=0;for(;n=e.length)break;const i=e.slice(n).match(/^<([A-Z][\w:-]*)/i);if(!i?.[1])return null;const o=m2(e,i[1],n);if(!o||o.start!==n)return null;t.push(o.raw),n=o.end}return t.length>1?t:null}function K2e(e,t,n,i){const o=n.customHtmlTags?.join("\0")??"",s=t,r=aN.get(s),l=r&&r.final===i&&r.customHtmlTags===o&&r.requireClosingStrong===n.requireClosingStrong&&r.validateLink===n.validateLink,a=e.map((u,c)=>l&&r.blocks[c]===u?r.children[c]:rm(u,t,n));return aN.set(s,{blocks:e,children:a,customHtmlTags:o,final:i,requireClosingStrong:n.requireClosingStrong,validateLink:n.validateLink}),a.flat()}function Z2e(e,t,n,i){return e.map(o=>{if(o?.type!=="html_block")return o;const s=o,r=String(s.tag??"").toLowerCase();if(!r||r==="details"||VH.has(r)||Array.isArray(s.children))return o;const l=String(o.raw??s.content??"");if(!l)return o;const a=No(l);if(a===-1)return o;const u=m2(l,r,0),c=u?.closeStart??-1,d=u?.closed===!0&&c>=a+1,f=d?l.slice(a+1,c):l.slice(a+1);if(!f.trim())return o;const h=KW(n,i),m=d?null:V2e(f),g=m?K2e(m,t,h,i):rm(f,t,h);return U2e(f,g)?{...o,children:g}:o})}function G2e(e){for(const t of e)if(t?.type==="html_block")return!0;return!1}function rm(e,t,n){return e.trim()?GW(e,t,{...n,__disableStreamParse:!0,__disableStructuredReuse:!0}):[]}function Q2e(e,t,n){const i=rm(e,t,n),o=i[0];return i.length===1&&o?.type==="paragraph"&&Array.isArray(o.children)?o.children:i}function Y2e(e,t,n){const i=NW({content:e}),o=No(e),s=VW(e,"summary");if(o!==-1&&s!==-1&&s>=o+1){const r=Q2e(e.slice(o+1,s),t,n);r.length>0&&(i.children=r)}return i.raw=e,i}function J2e(e,t,n){const i=No(e);if(i===-1)return[];const o=e.slice(i+1);if(!o.trim())return[];const s=m2(o,"summary",0);if(!s)return rm(o,t,n);const r=o.slice(0,s.start),l=o.slice(s.end);return[...rm(r,t,n),Y2e(s.raw,t,n),...rm(l,t,n)]}function ZW(e,t,n,i,o,s=0){const r=[];let l=s;for(let a=0;a{const $=VW(f,"details");return $!==-1?f.slice(0,$):f})():f,[C]=ZW(k?[]:g===-1?e.slice(a+1):e.slice(a+1,g),t,n,i,o,h+f.length),w=J2e(v,n,KW(i,o)),M=g===-1?"":String(e[g].raw??j0(e[g])??""),L=k||g!==-1&&y?.closed===!0,E=M.replace(/[\t\r\n ]+$/,""),S=L?(()=>{const $=(y?.raw??"").lastIndexOf(E);return $===-1?t.length:h+$})():t.length,x=No(f),A=k&&x!==-1?h+x+1:h+f.length,T=t.slice(A,S===-1?t.length:S),I=n.parse(T,{__markstreamFinal:o}),O=n.renderer.render(I,n.options,{__markstreamFinal:o}),H=S+E.length,R=L?Math.max(S+M.length,z2e(t,H)):t.length,F=L?t.slice(S,R):M,P=L?t.slice(h,R):t.slice(h),z=k&&x!==-1?f.slice(0,x+1):f,W={...u,tag:"details",attrs:$4(f.slice(0,x+1)),raw:P,content:`${z}${O}${F}`,children:[...w,...C],loading:!o&&!L};if(i.includeSourceMap&&(W.sourceMap=Rv(t,h,L?R:t.length,i)),r.push(W),l=L?R:t.length,g===-1&&!k)break;g!==-1&&(a=g)}return[r,l]}function X2e(e,t,n,i){if(!n)return e;const o=e.slice();let s=0;for(let r=0;r=d.start&&x.end<=d.end){o.splice(L,1);continue}break}M=S+E.length,o.splice(L,1)}}return o}function eye(e){const t=l=>l===" "||l===" "||l===` +`||l==="\r",n=l=>{if(!l||l[0]!=="<"||l.includes(">"))return!1;let a=1;if(a{const y=g.charCodeAt(0);return y>=65&&y<=90||y>=97&&y<=122},c=g=>{const y=g.charCodeAt(0);return y>=48&&y<=57},d=g=>g==="!"||u(g),f=g=>u(g)||c(g)||g===":"||g==="-",h=g=>u(g)||c(g)||g==="_"||g==="."||g===":"||g==="-",m=h;if(a>=l.length||!d(l[a]))return!1;for(a++;a=l.length)return!0;if(l[a]==="/"){for(a++;a=l.length}if(!h(l[a]))return!1;for(a++;a=l.length)return!0;const g=l[a];if(g==='"'||g==="'"){for(a++;a=l.length)return!0;a++}else{for(;a"||y==='"'||y==="'"||y==="`")break;a++}if(a>=l.length)return!0}}}return!0},i=(l,a)=>HW(l,a),o=String(e??""),s=o.lastIndexOf("<");if(s===-1||i(o,s))return o;if(s>0){const l=o[s-1],a=l===" "||l===" "||l===` +`||l==="\r",u=o[s-2];if(!a&&!((l==="n"||l==="r")&&u==="\\"))return o}const r=o.slice(s);return r.includes(">")||r.length>1&&(r[1]===" "||r[1]===" "||r[1]===` +`||r[1]==="\r")||!n(r)?o:o.slice(0,s)}function CN(e,t){if(e===t)return;const n=e.split(/\r?\n/),i=t.split(/\r?\n/),o=[];let s=0;for(let r=0;r{const l=Number.isFinite(r)?Math.max(0,Math.trunc(r)):0;if(lString(m??"").toLowerCase()).filter(Boolean));if(!n.size)return e;const i=m=>m===" "||m===" ",o=m=>{const g=m.charCodeAt(0);return g>=65&&g<=90||g>=97&&g<=122||g>=48&&g<=57||m==="_"||m==="-"||m===":"},s=m=>{if(!m)return!1;if(m[0]===" ")return!0;let g=0;for(let y=0;y=4)return!0;continue}if(k===" ")return!0;break}return!1},r=m=>{let g=!1,y=!1;for(let k=0;k")return k}return-1},l=m=>{let g=0;for(;g{if(s(m))return-1;const y=m.replace(/^[ \t]+/,"");if(!y||y.startsWith(">")||y.startsWith("|")||/^(?:[*+-]|\d+[.)])[\t ]+/.test(y))return-1;let k=!1,v=0;for(;v=M.length){k=!0,v++;continue}const E=M[L];if(E==="!"||E==="?"){k=!0,v+=w+1;continue}if(E==="/"){k=!0,v+=w+1;continue}const S=L;for(;L"&&A!=="/"){k=!0,v++;continue}const T=new RegExp(String.raw`<\s*\/\s*${x}\s*>`,"i"),I=/\/\s*>$/.test(M),O=T.test(m.slice(v+w+1)),H=T.test(e.slice(g+v+w+1)),R=/[\r\n]/.test(e.slice(g+v+w+1));if(k&&n.has(x)&&!I&&!O&&(H||R))return v;k=!0,v+=w+1}return-1};let u=!1,c="",d=0,f="",h=0;for(;hh&&e[m-1]==="\r",k=g?y?m-1:m:e.length,v=e.slice(h,k),C=g?y?`\r +`:` +`:"",w=l(v);let M=v;if(!u&&!w){const L=a(v,h);if(L!==-1){const E=C||` +`;M=`${v.slice(0,L).replace(/[ \t]+$/,"")}${E}${E}${v.slice(L).replace(/^[ \t]+/,"")}`}}f+=M,f+=C,w&&(u?w.markerChar===c&&w.markerLen>=d&&/^\s*$/.test(w.rest)&&(u=!1,c="",d=0):(u=!0,c=w.markerChar,d=w.markerLen)),h=g?m+1:e.length}return f}function nye(e,t){if(!e||!t.length)return e;const n=new Set(t.map(d=>String(d??"").toLowerCase()));if(!n.size)return e;const i=d=>d===" "||d===" ",o=d=>{const f=d.charCodeAt(0);return f>=65&&f<=90||f>=97&&f<=122||f>=48&&f<=57||d==="_"||d==="-"},s=d=>{let f=0;for(;f{let f=!1,h=!1;for(let m=0;m")return m}return-1},l=(d,f,h)=>{const m=h.toLowerCase();let g=d.indexOf("<",f);for(;g!==-1;){let y=g+1;for(;y=d.length||d[y]!=="/"){g=d.indexOf("<",g+1);continue}for(y++;yd.length){g=d.indexOf("<",g+1);continue}let k=!0;for(let C=0;C="A"&&w<="Z"?String.fromCharCode(w.charCodeAt(0)+32):w)!==m[C]){k=!1;break}}if(!k){g=d.indexOf("<",g+1);continue}let v=y+m.length;if(v")return!0;g=d.indexOf("<",g+1)}return!1},a=d=>{let f=0;for(;f=d.length||d[f]!=="<")return d;for(f++;f=d.length||d[f]==="/")return d;const h=f;for(;fc&&e[d-1]==="\r",h=f?d-1:d,m=e.slice(c,h);u+=a(m),u+=f?`\r +`:` +`,c=d+1}return u}function iye(e,t){if(!e||!t.length)return e;const n=new Set(t.map(f=>String(f??"").toLowerCase()));if(!n.size)return e;const i=f=>f===" "||f===" ",o=f=>{let h=0,m=!1,g=0;for(;h=f.length||f[h]!==">")break;for(m=!0,h++;h{let h=0;for(;hnew RegExp(String.raw`(<\s*\/\s*${f}\s*>)${"(?=[\\t ]*(?:#{1,6}[\\t ]+|>|(?:[*+-]|\\d+[.)])[\\t ]+|(?:`{3,}|~{3,})|\\||\\$\\$|:{3,}|\\[\\^[^\\]]+\\]:|(?:-{3,}|\\*{3,}|_{3,})))"}`,"gi"));let l=!1,a="",u=0,c="",d=0;for(;dd&&e[f-1]==="\r",g=h?m?f-1:f:e.length,y=e.slice(d,g),k=h?m?`\r +`:` +`:"",v=o(y),C=v?.prefix??"",w=v?.content??y,M=s(w);M&&(l?M.markerChar===a&&M.markerLen>=u&&/^\s*$/.test(M.rest)&&(l=!1,a="",u=0):(l=!0,a=M.markerChar,u=M.markerLen));let L=w;if(!l&&L.includes("{if(T.replace(/^[\t ]+/,"").startsWith("|"))return S;const I=T.slice(0,A).replace(/^[\t ]+/,"");if(I.length>0){const O=x.match(/^<\s*\/\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"",H=I.match(/^<\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"";if(!O||!H||O!==H)return S}return`${x} + +`});if(C){const E=C+L.split(` +`).join(` +${C}`);c+=E}else c+=L;c+=k,d=h?f+1:e.length}return c}function oye(e,t){if(!e||!t.length)return e;const n=new Set(t.map(I=>String(I??"").toLowerCase()));if(!n.size)return e;const i=I=>I===" "||I===" ",o=I=>{if(!I)return!1;if(I[0]===" ")return!0;let O=0;for(let H=0;H=4)return!0;continue}if(R===" ")return!0;break}return!1},s=I=>{const O=I.charCodeAt(0);return O>=65&&O<=90||O>=97&&O<=122||O>=48&&O<=57||I==="_"||I==="-"||I===":"},r=I=>{let O=0;for(;O{let O=0,H=!1,R=0;for(;O=I.length||I[O]!==">")break;for(H=!0,O++;Or(I).startsWith("<"),u=I=>{for(let O=0;O{if(o(I))return"";const O=r(I);if(!O.startsWith("<"))return"";let H=1;for(;H=O.length||O[H]==="/"||O[H]==="!"||O[H]==="?")return"";const R=H;for(;H"&&P!=="/"?"":F},d=I=>{if(o(I))return null;const O=r(I);if(!O.startsWith("<"))return null;let H=1;for(;H=O.length)return null;const R=O[H]==="/";if(R)for(H++;H"&&W!=="/")return null;if(R)return{type:"close",name:z};if(/\/\s*>\s*$/.test(O))return{type:"open",name:z,complete:!0};const $=O.indexOf(">",H);if($!==-1){const K=O.slice($+1);if(new RegExp(`<\\s*\\/\\s*${z}\\s*>`,"i").test(K))return{type:"open",name:z,complete:!0}}return{type:"open",name:z,complete:!1}},f=I=>{if(o(I))return null;const O=r(I).replace(/[ \t]+$/,"");if(!O.startsWith("<")||/^<\s*(?:!--|!doctype\b|\?)/i.test(O))return null;const H=O.match(/^<\s*([A-Z][\w:-]*)\b[^>]*\/\s*>\s*$/i);if(H?.[1])return H[1].toLowerCase();const R=O.match(/^<\s*([A-Z][\w:-]*)\b[^>]*>[\s\S]*<\s*\/\s*([A-Z][\w:-]*)\s*>\s*$/i);if(!R?.[1]||!R[2])return null;const F=R[1].toLowerCase();return F===R[2].toLowerCase()?F:null};let h=!1,m="",g=0;const y=I=>{let O=0;for(;Oy(I),v=I=>{const O=r(I);return O?o(I)?!0:/^(?:#{1,6}[ \t]+|>|[*+-][ \t]+|\d+[.)][ \t]+|`{3,}|~{3,}|\||\$\$|:{3,}|\[\^[^\]]+\]:|-{3,}|\*{3,}|_{3,})/.test(O):!1},C=(I,O,H)=>{let R=I,F=0;for(;RR&&e[P-1]==="\r",$=z?W?P-1:P:e.length,K=e.slice(R,$),ne=l(K),G=ne?.key??"";if(F>0&&O&&G!==O)break;const te=ne?.content??K,le=d(te);if(le?.name===H){if(le.type==="open")le.complete||F++;else if(F>0&&(F--,F===0))return!1}else if(F>0&&(u(te)||v(te)))return!0;if(z)R=P+1;else break}return!1};let w="",M=0,L=!0,E=!1,S=!1,x=` +`;const A=[];let T="";for(;MM&&e[I-1]==="\r",R=O?H?I-1:I:e.length,F=e.slice(M,R),P=O?H?`\r +`:` +`:"",z=l(F),W=z?.key??"",$=z?.content??F,K=k($);K&&(h?K.markerChar===m&&K.markerLen>=g&&/^\s*$/.test(K.rest)&&(h=!1,m="",g=0):(h=!0,m=K.markerChar,g=K.markerLen));const ne=A.length>0;if(!h&&!ne){const te=c($),le=!!te&&!L&&E&&S&&C(M,W,te);te&&!L&&(!E||le)&&(W&&T&&W===T?w+=`${W}${x}`:W||(w+=x))}if(w+=F,w+=P,P&&(x=P),!h){const te=d($);if(te){if(te.type==="open")te.complete||A.push(te.name);else for(let le=A.length-1;le>=0;le--)if(A[le]===te.name){A.length=le;break}}}const G=u($);L=G,E=!G&&a($),S=!G&&!!f($),T=W,M=O?I+1:e.length}return w}function sye(e){let t=!1,n="",i=0,o=!1,s=!1,r=!1,l=0;const a=(c,d)=>{const f=Nx(c);if(f){t?f.markerChar===n&&f.markerLen>=i&&/^\s*$/.test(f.rest)&&(t=!1,n="",i=0):(t=!0,n=f.markerChar,i=f.markerLen);return}if(t)return;let h=0;for(;h{for(;l=c?c:d,h=f>l&&e[f-1]==="\r"?f-1:f;if(a(e.slice(l,h)),d===-1||d>=c){l=c;break}r=!1,l=d+1}},inMath:()=>o||s||r}}function c8(e,t,n,i){let o=e.replace(/([^\\])\r(ight|ho)/g,"$1\\r$2");const s=sye(o);if(o=o.replace(/([^\\])\r?\n(abla|eq|ot|exists)/g,(r,l,a,u)=>{s.scanTo(u+1);const c=s.inMath();return s.scanTo(u+r.length),c?`${l}\\n${a}`:r}),t||(o.endsWith("- *")&&(o=o.replace(/- \*$/,"- \\*")),/(?:^|\n)\s*-\s*$/.test(o)?o=o.replace(/(?:^|\n)\s*-\s*$/,r=>r.startsWith(` +`)?` +`:""):/(?:^|\n)\s*--\s*$/.test(o)?o=o.replace(/(?:^|\n)\s*--\s*$/,r=>r.startsWith(` +`)?` +`:""):/(?:^|\n)\s*>\s*$/.test(o)?o=o.replace(/(?:^|\n)\s*>\s*$/,r=>r.startsWith(` +`)?` +`:""):/\n\s*[*+]\s*$/.test(o)?o=o.replace(/\n\s*[*+]\s*$/,` +`):/(?:^|\n)\s*\d+\s*$/.test(o)?/^\d+$/.test(o.trim())||(o=o.replace(/(?:^|\n)\s*\d+\s*$/,r=>r.startsWith(` +`)?` +`:"")):/(?:^|\n)\s*\d+[.)]\s+\*{1,3}\s*$/.test(o)?o=o.replace(/((?:^|\n)\s*\d+[.)]\s+)(\*{1,3})\s*$/,(r,l,a)=>`${l}${a.split("").map(()=>"\\*").join("")}`):/(?:^|\n)\s*\d+[.)]\s*$/.test(o)?o=o.replace(/(?:^|\n)\s*\d+[.)]\s*$/,r=>r.startsWith(` +`)?` +`:""):/\n[[(]\n*$/.test(o)&&(o=o.replace(/(\n\[|\n\()+\n*$/g,` +`)),o=S2e(o,i.customHtmlTags)??o),i.customHtmlTags?.length&&o.includes("<")){const r=Np(i.customHtmlTags);if(r.length&&(o=tye(o,r),o=nye(o,r),o=oye(o,r),o=iye(o,r),o.includes("[\t ]*)(\r?\n)(?![\t ]*\r?\n|$)`,"gim");o=o.replace(a,"$1$2$2")}}return t||(o=eye(o)),o}function rye(e,t,n,i){const o=e,s=`${n?"final":"stream"}:${(i.customHtmlTags??[]).join(",")}`,r=_A.get(o);let l;if(!n&&!i.customHtmlTags?.length&&r&&r.mode===s&&t.length>=r.source.length&&t.startsWith(r.source)){const a=Math.max(0,r.source.length-n2e-i2e),u=c8(t.slice(a),n,e,i),c=r.source.length-a;l=u.length>=c&&u.slice(0,c)===r.safeMarkdown.slice(-c)?r.safeMarkdown.slice(0,r.safeMarkdown.length-c)+u:c8(t,n,e,i)}else l=c8(t,n,e,i);return n||(l=_2e(l,e)),_A.set(o,{source:t,safeMarkdown:l,mode:s}),l}function GW(e,t,n={}){const i=OW(n),o=i?au():0,s=!!n.final,r=(e??"").toString();g2e(t,n)&&(t.stream.reset(),v2e(t),_A.delete(t));const l=rye(t,r,s,n);i&&cf(i,"safeMarkdownMs",au()-o);const a=R2e(l);if(a){if(n.includeSourceMap){const M={...n,__sourceLineMapper:CN(r,l)};a[0].sourceMap=Rv(l,0,l.length,M)}const C=n.preTransformTokens,w=n.postTransformTokens;if(Mx(t,n)||typeof C=="function"||typeof w=="function"){const M=gN(t,l,{__markstreamFinal:s},n),L=typeof C=="function"&&C(M)||M;typeof w=="function"&&w(L)}return cN(a,n,i,o)}const u=i?au():0,c=gN(t,l,{__markstreamFinal:s},n);if(i&&cf(i,"tokenizeMs",au()-u),!c||!Array.isArray(c))return cN([],n,i,o);const d=n.preTransformTokens,f=n.postTransformTokens;let h=c;d&&typeof d=="function"&&(h=d(h)||h);const m=t,g=typeof m.validateLink=="function"&&m.__markstreamOriginalValidateLink&&m.validateLink!==m.__markstreamOriginalValidateLink?m.validateLink:void 0,y=n.validateLink??g??m.options?.validateLink??(typeof m.validateLink=="function"?m.validateLink:void 0),k={...n,validateLink:y,__markdownIt:t,__sourceLineMapper:n.includeSourceMap===!0?CN(r,l):void 0,__sourceMarkdown:l,__customHtmlBlockCursor:0};let v=f2e(t,l,h,k,i);if(f&&typeof f=="function"){const C=f(h);if(Array.isArray(C)){const w=C[0],M=w?.type;w&&typeof M=="string"?v=S1(C,{...k,__customHtmlBlockCursor:0},i):v=C}}if(G2e(v)){const C=i?au():0;v=X2e(v,s,l,k),v=ZW(v,l,t,k,s)[0],v=Z2e(v,t,k,s),i&&cf(i,"htmlBlockPassesMs",au()-C)}if(s){const C=new WeakSet,w=M=>{if(!M||typeof M!="object"||C.has(M))return;if(C.add(M),Array.isArray(M)){for(const E of M)w(E);return}const L=M;L.type==="html_block"&&L.loading===!0&&(L.loading=!1);for(const E of Object.values(L))w(E)};w(v)}return v=BW(v,n),n.debug&&console.log("Parsed Markdown Tree Structure:",v),PW(v,i,o)}function AN(e,t){if(!e||!Array.isArray(e))return[];const n=[],i=qf(t),o=t?.__linkifyDemotionSeed;if(Array.isArray(o)&&o.length)for(const l of o)i.remember(String(l??""));const s=t?.includeSourceMap===!0;let r=0;for(;rd.type==="html_block")){if(s)for(const d of c)bi(d,a,t);for(const d of c)Bu(d,a,t);n.push(...c)}else{const d={type:"paragraph",raw:u,children:c};s&&bi(d,a,t);const f=kN(d,t);if(f){s&&yN(f,d);for(const h of f)Bu(h,a,t);n.push(...f)}else Bu(d,a,t),n.push(d)}i.remember(u)}r+=1;break;default:r+=1;break}}return n}const lye=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g,H0=/\d/u,aye=/[,.!?;:,。;、!?:]/u,uye=/\d\p{Script=Han}{1,3}$/u;function cye(e){return e.pos>0&&e.pos+1{const u=l,c=u.posMax,d=u.pos;if(u.src.charCodeAt(d)!==r||a||s.refuseDigitRange&&cye(u))return!1;u.pos=d+1;let f=!1;for(;u.pos]|$)/i,pye=new Set([...f2,"base","button","datalist","dialog","embed","fieldset","form","iframe","input","legend","link","meta","object","optgroup","option","output","param","select","style","template","textarea","title"]),mye=new Set(["a","abbr","b","blockquote","br","caption","code","col","colgroup","dd","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","li","mark","ol","p","picture","pre","s","small","source","span","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","ul"]);function xN(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function gye(e){return typeof e=="string"?e:e==null?"":String(e)}function QW(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function Yd(e){return gye(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function YW(e){return Yd(e).replace(/`/g,"`")}function q4(e){return String(e??"").trim().toLowerCase()}function Dx(e,t="safe"){const n=q4(e);return n?t==="escape"?!0:t==="trusted"?f2.has(n):!mye.has(n):!1}function JW(e,t="safe"){const n=q4(e);return n?t==="escape"?!0:t==="trusted"?f2.has(n):pye.has(n):!1}function SN(e){const t=Object.entries(e);return t.length===0?"":t.map(([n,i])=>i===""?` ${n}`:` ${n}="${YW(i)}"`).join("")}function XW(e){const t=e.startsWith("/"),n=t?e.slice(1):e,i=n.match(hye);return i?{attrsStr:t?"":n.slice(i[0].length).trimStart(),isClosing:t,isSelfClosing:!t&&e.trimEnd().endsWith("/"),tagName:i[1]}:null}function vye(e,t){const n=e.split(",").map(i=>i.trim()).filter(Boolean);return n.length===0?!1:n.some(i=>{const o=i.split(/\s+/,1)[0]??"";return!o||ip(o,{tagName:t,attrName:"srcset"})})}function eq(e,t,n,i){return X1e.has(e)||n==="safe"&&e==="style"?!0:e==="srcset"?vye(t,i):!!(eme.has(e)&&t&&ip(t,{tagName:i,attrName:e}))}function Fh(e,t){const n=t.toLowerCase();return Object.keys(e).find(i=>i.toLowerCase()===n)}function tq(e,t,n,i=!1){if(t!=="safe"||q4(n)!=="a")return e;const o=Fh(e,"href");if(i&&(!o||!e[o])){const a=Fh(e,"target"),u=Fh(e,"rel");return a&&delete e[a],u&&delete e[u],e}const s=Fh(e,"target");if((s?String(e[s]).trim():"").toLowerCase()!=="_blank")return e;const r=Fh(e,"rel"),l=new Set(String(r?e[r]:"").split(/\s+/).map(a=>a.trim()).filter(Boolean).filter(a=>a.toLowerCase()!=="opener"));return l.add("noopener"),l.add("noreferrer"),r&&r!=="rel"&&delete e[r],e.rel=Array.from(l).join(" "),e}function _N(e,t="safe",n){const i={};for(const[o,s]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!QW(r)||eq(l,s,t,n)||(i[r]=s)}return tq(i,t,n,!!Fh(e,"href"))}function nq(e,t){const n=e.toLowerCase();return UH.has(n)?!1:xN(t,n)||xN(t,e)}function Rx(e,t="safe",n){const i={};for(const[o,s]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!QW(r)||eq(l,s,t,n)||(i[r]=s)}return tq(i,t,n,!!Fh(e,"href"))}function W0(e){const t={};if(!Array.isArray(e)||e.length===0)return t;for(const[n,i]of e)n&&(t[String(n)]=i==null?"":String(i));return t}function P9(e,t="safe",n){const i=Rx(W0(e),t,n),o=Object.entries(i).map(([s,r])=>[s,r]);return o.length>0?o:void 0}function yye(e,t){const n=t.toLowerCase();if(["checked","disabled","readonly","required","autofocus","multiple","hidden"].includes(n))return e==="true"||e===""||e===t;if(["value","min","max","step","width","height","size","maxlength"].includes(n)){const i=Number(e);if(e!==""&&!Number.isNaN(i))return i}return e}function kye(e){const t={};for(const[n,i]of Object.entries(e))t[n]=yye(i,n);return t}function d8(e){return e.trim().length>0}function iq(e){const t=[];let n=0;for(;n",n);if(r!==-1){n=r+3;continue}break}const i=e.indexOf("<",n);if(i===-1){if(nn){const r=e.slice(n,i);d8(r)&&t.push({type:"text",content:r})}if(e.startsWith("![CDATA[",i+1)){const r=e.indexOf("]]>",i);if(r!==-1){t.push({type:"text",content:e.slice(i,r+3)}),n=r+3;continue}break}if(e.startsWith("!",i+1)){const r=e.indexOf(">",i);if(r!==-1){n=r+1;continue}break}const o=e.indexOf(">",i);if(o===-1)break;const s=XW(e.slice(i+1,o));if(!s){const r=e.slice(i,o+1);d8(r)&&t.push({type:"text",content:r}),n=o+1;continue}if(s.isClosing)t.push({type:"tag_close",tagName:s.tagName});else{const r={};if(s.attrsStr){const l=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let a;for(;(a=l.exec(s.attrsStr))!==null;){const u=a[1],c=a[2]??a[3]??a[4]??"";u&&!u.endsWith("/")&&(r[u]=c)}}t.push({type:s.isSelfClosing||Sf.has(s.tagName.toLowerCase())?"self_closing":"tag_open",tagName:s.tagName,attrs:r})}n=o+1}return t}function bye(e){const t=[];let n=0;for(;n",n);if(l!==-1){n=l+3;continue}break}const i=e.indexOf("<",n);if(i===-1){nn&&t.push({type:"text",content:e.slice(n,i)}),e.startsWith("![CDATA[",i+1)){const l=e.indexOf("]]>",i);if(l!==-1){t.push({type:"text",content:e.slice(i,l+3)}),n=l+3;continue}break}if(e.startsWith("!",i+1)){const l=e.indexOf(">",i);if(l!==-1){n=l+1;continue}break}const o=e.indexOf(">",i);if(o===-1)break;const s=XW(e.slice(i+1,o));if(!s){t.push({type:"text",content:e.slice(i,o+1)}),n=o+1;continue}if(s.isClosing){t.push({type:"tag_close",tagName:s.tagName}),n=o+1;continue}const r={};if(s.attrsStr){const l=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let a;for(;(a=l.exec(s.attrsStr))!==null;){const u=a[1],c=a[2]??a[3]??a[4]??"";u&&!u.endsWith("/")&&(r[u]=c)}}t.push({type:s.isSelfClosing||Sf.has(s.tagName.toLowerCase())?"self_closing":"tag_open",tagName:s.tagName,attrs:r}),n=o+1}return t}function wye(e){const t=String(e.tagName??"").trim();if(!t)return"";if(e.type==="tag_close")return`</${Yd(t)}>`;const n=Object.entries(e.attrs??{}).map(([i,o])=>o===""?` ${Yd(i)}`:` ${Yd(i)}="${YW(o)}"`).join("");return e.type==="self_closing"?`<${Yd(t)}${n} />`:`<${Yd(t)}${n}>`}function Cye(e,t){if(!e||!e.includes("<")||!t||Object.keys(t).length===0)return!1;for(const n of iq(e))if((n.type==="tag_open"||n.type==="self_closing")&&nq(n.tagName??"",t))return!0;return!1}function lm(e,t="safe"){if(!e)return"";if(t==="escape")return Yd(e);const n=bye(e),i=[],o=[],s=[];for(const r of n){if(r.type==="text"){s.length===0&&o.push(Yd(r.content??""));continue}const l=q4(r.tagName);if(!l)continue;if(JW(l,t)){r.type==="tag_open"?s.push(l):r.type==="tag_close"&&s[s.length-1]===l&&s.pop();continue}if(s.length>0)continue;if(t==="safe"&&Dx(l,t)){o.push(wye(r));continue}if(r.type==="self_closing"){o.push(`<${l}${SN(_N(r.attrs??{},t,l))}>`);continue}if(r.type==="tag_open"){o.push(`<${l}${SN(_N(r.attrs??{},t,l))}>`),Sf.has(l)||i.push(l);continue}const a=i.lastIndexOf(l);if(a===-1)continue;for(;i.length>a+1;){const c=i.pop();c&&o.push(``)}const u=i.pop();u&&o.push(``)}for(;i.length>0;){const r=i.pop();r&&o.push(``)}return o.join("")}const Aye=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],IN="http://www.w3.org/2000/svg",xye=new Set(["script","style","iframe","object","embed","link","meta"]),Sye=new Set(["svg","style","g","a","defs","marker","path","rect","circle","ellipse","line","polyline","polygon","text","tspan","title","desc","use","image","lineargradient","radialgradient","stop","clippath","mask","pattern"]),_ye=new Set(["href","xlink:href","src","srcdoc","action","data","formaction","poster"]),Iye=new Set(["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),Mye=new Set(["circle","ellipse","image","line","path","polygon","polyline","rect","text","tspan","use"]);function Tye(e){return(e.getAttribute("href")||e.getAttribute("xlink:href"))?.startsWith("#")===!0}function Eye(e){return!!(e.getAttribute("href")||e.getAttribute("xlink:href")||e.getAttribute("src"))}function Lye(e){const t=e.nodeName.toLowerCase();return t==="use"?Tye(e):t==="image"?Eye(e):t==="text"||t==="tspan"?!!e.textContent?.trim():Mye.has(t)}function Nye(e){return e.replace(/(["'])\s*javascript:/gi,"$1#").replace(/\bjavascript:/gi,"#").replace(/(["'])\s*vbscript:/gi,"$1#").replace(/\bvbscript:/gi,"#").replace(/\bdata:text\/html/gi,"#")}function Fye(e,t,n){const i=e.toLowerCase(),o=t.toLowerCase(),s=String(n??"").trim();return s?(i==="use"||i==="marker"||i==="clippath"||i==="mask")&&(o==="href"||o==="xlink:href")?s.startsWith("#")?s:"":i==="a"&&(o==="href"||o==="xlink:href")?ip(s,{tagName:"a",attrName:"href"})?"":s:i==="image"&&(o==="href"||o==="xlink:href"||o==="src")?ip(s,{tagName:"img",attrName:"src"})?"":s:o==="href"||o==="xlink:href"?s.startsWith("#")?s:"":ip(s,{tagName:i,attrName:o})?"":s:""}function Dye(e,t){let n=t+4;for(;n{const i=n.trim();if(/^[0-9a-f]+$/i.test(i)){const o=Number.parseInt(i,16);try{return Number.isFinite(o)?String.fromCodePoint(o):""}catch{return""}}return String(n).trim()})}function sq(e){const t=oq(e),n=t.toLowerCase();let i=0;for(;in.test(t))||sq(t)}function Rye(e){if(e.tagName.toLowerCase()!=="a"||e.getAttribute("target")?.trim().toLowerCase()!=="_blank")return;const t=new Set(String(e.getAttribute("rel")??"").split(/\s+/).map(n=>n.trim()).filter(Boolean).filter(n=>n.toLowerCase()!=="opener"));t.add("noopener"),t.add("noreferrer"),e.setAttribute("rel",Array.from(t).join(" "))}function Ly(e){const t=Number.parseFloat(String(e??""));return Number.isFinite(t)?t:0}function rq(e,t){if(e.nodeType===Node.TEXT_NODE){const o=e.textContent??"";o&&t.push(o);return}if(e.nodeType!==Node.ELEMENT_NODE)return;const n=e,i=n.tagName.toLowerCase();if(!xye.has(i)){if(i==="br"){t.push(` +`);return}for(const o of Array.from(n.childNodes))rq(o,t)}}function Oye(e){for(const t of Array.from(e.querySelectorAll("foreignObject"))){const n=[];rq(t,n);const i=n.join("").split(/\r?\n/).map(c=>c.trim()).filter(Boolean);if(!i.length){t.remove();continue}const o=Ly(t.getAttribute("width")),s=Ly(t.getAttribute("height")),r=Ly(t.getAttribute("x")),l=Ly(t.getAttribute("y")),a=e.ownerDocument.createElementNS(IN,"text");a.setAttribute("x",String(r+o/2)),a.setAttribute("y",String(l+s/2)),a.setAttribute("text-anchor","middle"),a.setAttribute("dominant-baseline","central");const u=t.querySelector(".nodeLabel");if(u?.getAttribute("class")&&a.setAttribute("class",u.getAttribute("class")),i.length===1)a.textContent=i[0];else{const c=-.6*(i.length-1);for(const[d,f]of i.entries()){const h=e.ownerDocument.createElementNS(IN,"tspan");h.setAttribute("x",String(r+o/2)),h.setAttribute("dy",d===0?`${c}em`:"1.2em"),h.textContent=f,a.appendChild(h)}}t.parentNode?.replaceChild(a,t)}}function Pye(e){Oye(e);const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){const i=n.tagName.toLowerCase();if(!Sye.has(i)){n.remove();continue}if(i==="style"&&MN(n.textContent??"")){n.remove();continue}const o=Array.from(n.attributes);for(const s of o){const r=s.name.toLowerCase();if(/^on/i.test(r)){n.removeAttribute(s.name);continue}if(r==="style"&&s.value&&MN(s.value)){n.removeAttribute(s.name);continue}if(r==="srcdoc"){n.removeAttribute(s.name);continue}if(_ye.has(r)&&s.value){const l=Fye(i,r,s.value);if(!l){n.removeAttribute(s.name);continue}l!==s.value&&n.setAttribute(s.name,l);continue}if(Iye.has(r)&&s.value&&sq(s.value)){n.removeAttribute(s.name);continue}if(s.value){const l=Nye(s.value);l!==s.value&&n.setAttribute(s.name,l)}}Rye(n)}}function R8t(e){if(typeof DOMParser>"u"||!e)return null;try{const t=new DOMParser().parseFromString(e,"image/svg+xml").documentElement;if(!t||t.nodeName.toLowerCase()!=="svg")return null;const n=t;return Pye(n),Bye(n)?null:n}catch{return null}}function Bye(e){const t=e.getAttribute("viewBox");if(t){const o=t.trim().split(/[\s,]+/);if(o.length===4){const s=Number.parseFloat(o[2]||""),r=Number.parseFloat(o[3]||"");if(!Number.isFinite(s)||!Number.isFinite(r)||s<=0||r<=0)return!0}}const n=[e,...Array.from(e.querySelectorAll("*"))];let i=!1;for(const o of n){Lye(o)&&(i=!0);for(const s of Array.from(o.attributes))if(/\bNaN\b/i.test(s.value)||s.name==="style"&&/max-width:\s*0(?:px)?/i.test(s.value))return!0}return!i}const Ny=[];function f8(e){return String(e??"").replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function $ye(e){return(String(e||"text").trim().split(/\s+/)[0]||"text").replace(/[^\w+.#:-]/g,"-").replace(/-+/g,"-")||"text"}function zye(e){return e.replace(/[^\w:.+-]/g,"-").replace(/-+/g,"-")}function TN(e=`editor-${Date.now()}`,t={}){const n=y0e(t),i=n;i.__markstreamRegisteredPluginCount=Ny.length,i.__markstreamHasCustomParserExtensions=!!(t.plugin?.length||t.apply?.length||Ny.length);const o={"common.copy":"Copy"};let s;if(typeof t.i18n=="function")s=t.i18n;else if(t.i18n&&typeof t.i18n=="object"){const h=t.i18n;s=m=>h[m]??o[m]??m}else s=h=>o[h]??h;if(Array.isArray(t.plugin))for(const h of t.plugin){const m=h;if(Array.isArray(m)){const[g,...y]=m;typeof g=="function"&&n.use(g,...y)}else typeof m=="function"&&n.use(m)}if(Array.isArray(t.apply))for(const h of t.apply)try{h(n)}catch(m){console.error("[getMarkdown] apply function threw an error",m)}if(Ny.length)for(const h of Ny)if(Array.isArray(h)){const[m,...g]=h;typeof m=="function"&&n.use(m,...g)}else typeof h=="function"&&n.use(h);n.use(fye),n.use(Bde),n.use(Rde);const r=Yde,l=r.default??r;n.use(l),n.use(Dde),n.use(Fde),n.core.ruler.after("block","mark_fence_closed",h=>{const m=h,g=m.src,y=!!m.env?.__markstreamFinal,k=g.split(/\r?\n/);for(const v of m.tokens){if(v.type!=="fence"||!v.map||!v.markup)continue;const C=v.map[0],w=v.map[1],M=v.markup,L=M[0],E=M.length,S=k[Math.max(0,w-1)]??"";let x=0;for(;xC+1&&A>=E&&T===S.length,O=v;O.meta=O.meta??{},O.meta.unclosed=!I,O.meta.closed=!!I}}),n.renderer.rules.fence=(h,m)=>{const g=h[m],y=String(g.info??"").trim(),k=String(g.content??""),v=btoa(unescape(encodeURIComponent(k))),C=$ye(y),w=f8(C),M=zye(`editor-${e}-${m}-${C}`),L=f8(s("common.copy"));return`
        +
        + ${f8(C.toUpperCase())} + +
        +
        +
        `};const a=/^\[(\d+)\]/,u=/^\[([^\]\n]+)\]/,c=h=>{if(!h.startsWith("["))return!1;const m=u.exec(h);if(!m)return h!=="["&&!/^\[\d+$/.test(h);const g=String(m[1]??"");return h.slice(m[0].length).startsWith("(")?!1:!/^\d+$/.test(g)},d=(h,m)=>{const g=h;if(g.src[g.pos]!=="[")return!1;const y=a.exec(g.src.slice(g.pos));if(!y)return!1;const k=g.src.slice(Math.max(0,g.pos-120),g.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(k))return!1;const v=g.src.slice(g.pos+y[0].length);if(v.startsWith("](")||v.startsWith("(")||c(v))return!1;if(!m){const C=y[1],w=g.push("reference","span",0);w.content=C,w.markup=y[0],w.raw=y[0]}return g.pos+=y[0].length,!0};n.inline.ruler.before("escape","reference",d),n.renderer.rules.reference=(h,m)=>{const y=String(h[m].content??"");return`${y}`};const f=n.use.bind(n);return n.use=((...h)=>(i.__markstreamHasCustomParserExtensions=!0,f(...h))),n}const jye="modulepreload",Hye=function(e){return"/"+e},EN={},qo=function(t,n,i){let o=Promise.resolve();if(n&&n.length>0){let r=function(u){return Promise.all(u.map(c=>Promise.resolve(c).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(u=>{if(u=Hye(u),u in EN)return;EN[u]=!0;const c=u.endsWith(".css"),d=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${d}`))return;const f=document.createElement("link");if(f.rel=c?"stylesheet":jye,c||(f.as="script"),f.crossOrigin="",f.href=u,a&&f.setAttribute("nonce",a),document.head.appendChild(f),c)return new Promise((h,m)=>{f.addEventListener("load",h),f.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(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"&&s(l.reason);return t().catch(s)})};function Wye({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 lq({nextContent:e,persistedContent:t,currentState:n,typewriterEnabled:i,streamRenderVersionChanged:o=!1}){const s=`${n.settledContent}${n.streamedDelta}`;return i?n.streamedDelta&&s===e?o?{settledContent:s,streamedDelta:"",appended:!1}:{settledContent:n.settledContent,streamedDelta:n.streamedDelta,appended:!1}:Wye({nextContent:e,previousContent:t??s,typewriterEnabled:i}):{settledContent:e,streamedDelta:"",appended:!1}}const qye={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 Uye(e){const t=String(e??"").trim();if(!t)return"";const[n=""]=t.split(/\s+/);return n.split(":")[0]?.trim().toLowerCase()??""}function aq(e){const t=Uye(e);return qye[t]??t}function Vye(e){if(!Array.isArray(e))return;const t=e.filter(i=>typeof i=="string").map(i=>aq(i)).filter(Boolean),n=Array.from(new Set(t)).sort();return n.length>0?n:void 0}function Kye(e){if(!Array.isArray(e))return;const t=[],n=new Set;for(const i of e){if(typeof i!="string")continue;const o=i.trim();!o||n.has(o)||(n.add(o),t.push(o))}return t.length>0?t:void 0}function Zye(e){return Kye(e)?.join("\0")??""}function Gye(e,t){return`${Zye(e)}\0\0${Vye(t)?.join("\0")??""}`}function a1(e,t,n=1){const i=Number(e);return Number.isFinite(i)?Math.max(n,i):t}function LN(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var Qye=class{constructor(e={},t){this.source="",this.visible="",this.done=!1,this.paused=!1,this.listeners=new Set,this.rafId=0,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.hasStarted=!1,this.destroyed=!1,this.getSnapshot=()=>({source:this.source,visible:this.visible,done:this.done,paused:this.paused,pendingChars:this.pendingChars,caughtUp:this.caughtUp,final:this.final}),this.subscribe=d=>this.destroyed?()=>{}:(this.listeners.add(d),()=>{this.listeners.delete(d)}),this.enqueue=d=>{if(this.destroyed||!d)return;this.done&&(this.done=!1);const f=this.source.length>0,h=this.pendingChars<=0;if(this.source+=d,h){const m=NN();this.startedAt=f&&this.hasStarted?m-this.normalizedStartDelayMs:m,this.lastTick=m,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=NN();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.startedAtthis.normalizedCatchUpThreshold?this.normalizedCatchUpLatencyMs:this.normalizedTargetLatencyMs,y=e9e(m/Math.max(.001,g/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(y-this.currentCps)*.2,this.charBudget+=this.currentCps*(h/1e3),this.charBudget<1){this.ensureLoop();return}const k=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),v=Xye(this.source.slice(this.visible.length),k,this.segmenter);v.text&&(this.visible+=v.text,this.charBudget=Math.max(0,this.charBudget-v.graphemeCount),this.emit()),this.ensureLoop()};const{minCharsPerSecond:n=40,maxCharsPerSecond:i=1e3,targetLatencyMs:o=900,catchUpLatencyMs:s=350,catchUpThreshold:r=600,maxCommitFps:l=30,startDelayMs:a=80,maxCharsPerCommit:u=80,flushOnFinish:c=!1}=e;this.minCharsPerSecond=a1(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,a1(i,1e3,1)),this.normalizedTargetLatencyMs=a1(o,900,1),this.normalizedCatchUpLatencyMs=a1(s,350,1),this.normalizedCatchUpThreshold=LN(r,600),this.normalizedStartDelayMs=LN(a,80),this.maxCommitFps=Math.trunc(a1(l,30,1)),this.maxCharsPerCommit=Math.trunc(a1(u,80,1)),this.flushOnFinish=c,this.segmenter=Jye(),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 Yye(e={},t){const n=new Qye(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 Jye(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function Xye(e,t,n){if(!e||t<=0)return{text:"",graphemeCount:0};if(!n){const s=Array.from(e).slice(0,t);return{text:s.join(""),graphemeCount:s.length}}let i="",o=0;for(const s of n.segment(e)){if(o>=t)break;i+=s.segment,o++}return{text:i,graphemeCount:o}}function NN(){return typeof performance<"u"?performance.now():Date.now()}function e9e(e,t,n){return Math.min(n,Math.max(t,e))}var t9e=(e,t,n)=>new Promise((i,o)=>{var s=a=>{try{l(n.next(a))}catch(u){o(u)}},r=a=>{try{l(n.throw(a))}catch(u){o(u)}},l=a=>a.done?i(a.value):Promise.resolve(a.value).then(s,r);l((n=n.apply(e,t)).next())});const MA=Symbol.for("markstream-vue:node-lifecycle");function O8t(){}const Ox=new Map;let uq="material";const R1=new Map,FN=new Map;let TA=null;function n9e(e){Ox.set(e.id,e)}function i9e(e){const t=Ox.get(uq);if(!t)return;const n=t.core[e];if(n)return n;const i=R1.get(t.id);if(i){const o=i[e];if(o)return o}t.loadExtended&&!R1.has(t.id)&&s9e(t)}function o9e(){var e,t;return(t=(e=Ox.get(uq))==null?void 0:e.fallback)!=null?t:""}function s9e(e){return t9e(this,null,function*(){var t,n,i;if(R1.has(e.id))return(t=R1.get(e.id))!=null?t:null;let o=FN.get(e.id);return o||(o=((i=(n=e.loadExtended)==null?void 0:n.call(e))!=null?i:Promise.resolve(null)).then(s=>(R1.set(e.id,s),TA?.(),s)).catch(()=>(R1.set(e.id,null),null)),FN.set(e.id,o)),o})}const DN='',RN='',r9e={id:"material",core:{"":RN,plain:'',text:RN,javascript:'',typescript:'',jsx:'',tsx:'',html:'',css:'',scss:'',json:'',python:'',ruby:'',go:'',java:'',kotlin:'',c:'',cpp:'',cs:DN,csharp:DN,php:'',shell:'',powershell:'',sql:'',yaml:'',markdown:'',xml:'',rust:'',vue:'',mermaid:''},fallback:'',loadExtended:()=>qo(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},l9e=_u(0);TA=()=>{l9e.value++},n9e(r9e);const a9e={"":"",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 U4(e){var t;const n=(function(i){if(!i)return"";const o=i.trim();if(!o)return"";const[s]=o.split(/\s+/),[r]=s.split(":");return r.toLowerCase()})(e);return(t=a9e[n])!=null?t:n}function P8t(e){const t=U4(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";case"objectivec":return"objective-c";case"objectivecpp":return"objective-cpp";default:return t}}function B8t(e){return i9e(U4(e))||o9e()}const ON={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"};var V4=(e,t,n)=>new Promise((i,o)=>{var s=a=>{try{l(n.next(a))}catch(u){o(u)}},r=a=>{try{l(n.throw(a))}catch(u){o(u)}},l=a=>a.done?i(a.value):Promise.resolve(a.value).then(s,r);l((n=n.apply(e,t)).next())});let Zr=null,Hh=!1,Wh=null,K4=Bx;function g2(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function Px(){try{const e=globalThis;return g2(e?.katex)}catch{return null}}function Bx(){return V4(null,null,function*(){const e=Px();if(e)return e;const t=yield qo(()=>import("./katex-DnlPpQZa.js"),[]);try{yield qo(()=>import("./mhchem-DtR62fUK.js"),__vite__mapDeps([0,1]))}catch{}return g2(t)})}function cq(e){const t=Promise.resolve(e).then(n=>{var i;return Wh===t&&n?(Zr=(i=g2(n))!=null?i:n,Zr):null}).catch(()=>null).finally(()=>{Wh===t&&(Wh=null)});return Wh=t,Hh=!0,t}function u9e(e){K4=e,Zr=null,Hh=!1,Wh=null}function c9e(e){u9e(Bx)}function dq(){return typeof K4=="function"}function $8t(){var e;const t=K4;if(!t||t===Bx)return null;if(Zr)return Zr;const n=Px();if(n)return Zr=n,Zr;if(Hh)return null;try{const i=t();return i?typeof i?.then=="function"?(cq(i),null):(Zr=(e=g2(i))!=null?e:i,Zr):null}catch{return null}}function fq(){return V4(this,null,function*(){var e;const t=Px();if(t)return Zr=t,Zr;if(Zr)return Zr;if(Wh)return Wh;if(Hh)return null;const n=K4;if(!n)return Hh=!0,null;try{const i=n();if(typeof i?.then=="function")return cq(i);if(i)return Zr=(e=g2(i))!=null?e:i,Hh=!0,Zr}catch{}return Hh=!0,null})}function hq(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let B9=null,Ch=null;const Vr=new Map,Zc=new Map;let Ov=5;const sp=new Set;function q0(){if(Vr.size{const{id:n,html:i,error:o}=t.data,s=Vr.get(n);if(s)if(Vr.delete(n),clearTimeout(s.timeoutId),s.cleanup(),q0(),o)s.aborted||s.reject(new Error(o));else{const{content:r,displayMode:l}=t.data;if(r){const a=`${l?"d":"i"}:${r}`;if(Zc.set(a,i),Zc.size>200){const u=Zc.keys().next().value;Zc.delete(u)}}s.aborted||s.resolve(i)}},B9.onerror=t=>{console.error("[katexWorkerClient] Worker error:",t);for(const[n,i]of Vr.entries())clearTimeout(i.timeoutId),i.cleanup(),i.aborted||i.reject(new Error(`Worker error: ${t.message}`));Vr.clear(),d9e()}}function h9e(e,t=!0,n=2e3,i){return V4(this,null,function*(){performance.now();const o=hq(e);if(!dq()){const a=new Error("KaTeX rendering disabled");return a.name="KaTeXDisabled",a.code="KATEX_DISABLED",Promise.reject(a)}if(Ch)return Promise.reject(Ch);const s=`${t?"d":"i"}:${o}`,r=Zc.get(s);if(r)return q0(),Promise.resolve(r);const l=B9||(Ch=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),Ch.name="WorkerInitError",Ch.code="WORKER_INIT_ERROR",null);if(!l)return Promise.reject(Ch);if(Vr.size>=Ov){const a=new Error("Worker busy");return a.name="WorkerBusy",a.code="WORKER_BUSY",a.busy=!0,a.inFlight=Vr.size,a.max=Ov,Promise.reject(a)}return new Promise((a,u)=>{if(i?.aborted){const g=new Error("Aborted");return g.name="AbortError",void u(g)}const c=Math.random().toString(36).slice(2);let d=null;const f=globalThis.setTimeout(()=>{const g=Vr.get(c);if(!g)return;Vr.delete(c),g.cleanup();const y=new Error("Worker render timed out");y.name="WorkerTimeout",y.code="WORKER_TIMEOUT",g.aborted||g.reject(y),q0()},n);d=()=>{const g=Vr.get(c);if(!g||g.aborted)return;g.aborted=!0,g.cleanup();const y=new Error("Aborted");y.name="AbortError",u(y)},i&&i.addEventListener("abort",d,{once:!0});const h=a,m=u;Vr.set(c,{resolve:g=>{h(g)},reject:g=>{m(g)},timeoutId:f,aborted:!1,cleanup:()=>{i&&d&&i.removeEventListener("abort",d),d=null}});try{l.postMessage({id:c,content:o,displayMode:t})}catch(g){const y=Vr.get(c);Vr.delete(c),clearTimeout(f),y?.cleanup(),y?.reject(g),q0()}})})}function z8t(e,t=!0,n){const i=`${t?"d":"i"}:${hq(e)}`;if(Zc.set(i,n),Zc.size>200){const o=Zc.keys().next().value;Zc.delete(o)}}const p9e="WORKER_BUSY";function m9e(e=2e3,t){return Vr.size{let o,s=!1,r=null,l=()=>{};const a=()=>{o&&globalThis.clearTimeout(o),sp.delete(l),t&&r&&t.removeEventListener("abort",r),r=null};l=()=>{s||(s=!0,a(),n())},sp.add(l),o=globalThis.setTimeout(()=>{if(s)return;s=!0,a();const u=new Error("Wait for worker slot timed out");u.name="WorkerBusyTimeout",u.code="WORKER_BUSY_TIMEOUT",i(u)},e),queueMicrotask(()=>q0()),t&&(r=()=>{if(s)return;s=!0,a();const u=new Error("Aborted");u.name="AbortError",i(u)},t.aborted?r():t.addEventListener("abort",r,{once:!0}))})}const Og={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function j8t(e){return V4(this,arguments,function*(t,n=!0,i={}){var o,s,r,l;if(!dq()){const g=new Error("KaTeX rendering disabled");throw g.name="KaTeXDisabled",g.code="KATEX_DISABLED",g}const a=(o=i.timeout)!=null?o:Og.timeout,u=(s=i.waitTimeout)!=null?s:Og.waitTimeout,c=(r=i.backoffMs)!=null?r:Og.backoffMs,d=(l=i.maxRetries)!=null?l:Og.maxRetries,f=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):Og.maxRetries,h=i.signal;let m=0;for(;;){if(h?.aborted){const g=new Error("Aborted");throw g.name="AbortError",g}try{return yield h9e(t,n,a,h)}catch(g){if(g?.code!==p9e||m>=f)throw g;if(m++,yield m9e(u,h).catch(()=>{}),h?.aborted){const y=new Error("Aborted");throw y.name="AbortError",y}c>0&&(yield new Promise(y=>globalThis.setTimeout(y,c*m)))}}})}function O1(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function g9e(e){var t;for(const n of e.split(/\r?\n/)){const i=n.trim();if(!i||i.startsWith("%%"))continue;const o=i.match(/^([A-Z][\w-]*)\b/i);return((t=o?.[1])==null?void 0:t.toLowerCase())||""}return""}function cb(e){const t=e.split(/\r?\n/).map(o=>o.trim()).filter(o=>o&&!o.startsWith("%%")),n=Math.max(1,t.length),i=g9e(e);return i==="gantt"?220+28*n:i==="sequencediagram"?180+26*n:i==="classdiagram"||i==="statediagram"||i==="erdiagram"?180+24*n:i==="flowchart"||i==="graph"?170+28*n:200+22*n}function db(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 pq(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function fb(e,t=360,n=500){return pq(e,t,n)}function hb(e,t=360,n=500){return pq(e,t,n)}var v9e=Object.defineProperty,y9e=Object.defineProperties,k9e=Object.getOwnPropertyDescriptors,PN=Object.getOwnPropertySymbols,b9e=Object.prototype.hasOwnProperty,w9e=Object.prototype.propertyIsEnumerable,BN=(e,t,n)=>t in e?v9e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mq=(e,t)=>{for(var n in t||(t={}))b9e.call(t,n)&&BN(e,n,t[n]);if(PN)for(var n of PN(t))w9e.call(t,n)&&BN(e,n,t[n]);return e},$N=(e,t,n)=>new Promise((i,o)=>{var s=a=>{try{l(n.next(a))}catch(u){o(u)}},r=a=>{try{l(n.throw(a))}catch(u){o(u)}},l=a=>a.done?i(a.value):Promise.resolve(a.value).then(s,r);l((n=n.apply(e,t)).next())});const pb=()=>qo(()=>import("./mermaid.core-WW7RuneT.js").then(e=>e.bp),__vite__mapDeps([2,3]));let Fc=null,P1=pb,u0=null,EA=!1,LA=!1,c0=0;function C9e(e){P1=e,c0++,Fc=null,u0=null,EA=!1,LA=!1}function A9e(e){C9e(pb)}function zN(){return typeof P1=="function"}function jN(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=mq({},t),i={render:o.render.bind(o),parse:o.parse?o.parse.bind(o):void 0,initialize:s=>typeof t.initialize=="function"?t.initialize(s):o.initialize?o.initialize(s):void 0},y9e(n,k9e(i))}var n,i;return e.mermaid&&typeof e.mermaid.render=="function"?e.mermaid:t}function HN(e){if(e)try{const t=e?.initialize;e.initialize=n=>{const i=mq({suppressErrorRendering:!0},n||{});return typeof t=="function"?t.call(e,i):e?.mermaidAPI&&typeof e.mermaidAPI.initialize=="function"?e.mermaidAPI.initialize(i):void 0}}catch{}}function H8t(){return $N(this,null,function*(){if(Fc)return Fc;const e=(function(){try{const i=globalThis;return jN(i?.mermaid)}catch{return null}})();if(e)return Fc=e,HN(Fc),Fc;const t=P1,n=c0;return t?t===pb&&EA?null:u0||(u0=$N(null,null,function*(){let i;try{i=yield t()}catch(o){if(t===pb)return n===c0&&t===P1&&(EA=!0,(function(s){LA||(LA=!0,console.warn('[markstream-vue] Optional dependency "mermaid" is not installed. Mermaid blocks will render as source.',s))})(o)),null;throw o}finally{n===c0&&t===P1&&(u0=null)}return n!==c0||t!==P1?null:i?(Fc=jN(i),HN(Fc),Fc):null}),u0):null})}let ju=null,Ah=null;const uu=new Map,xh=new Map;function h8(e){for(const t of uu.values())t.reject(e);uu.clear(),xh.clear()}let WN=5,qN=!1;const x9e="WORKER_BUSY",UN="MERMAID_DISABLED";function S9e(e){if(ju&&ju!==e){const n=new Error("Worker replaced");n.code="WORKER_REPLACED",h8(n)}ju=e,Ah=null;const t=e;ju.onmessage=n=>{if(ju!==t)return;const{id:i,ok:o,result:s,error:r}=n.data,l=uu.get(i);l&&(o===!1||r?l.reject(new Error(r||"Unknown error")):l.resolve(s))},ju.onerror=n=>{var i,o;if(ju===t)if(uu.size!==0){try{qN?console.error("[mermaidWorkerClient] Worker error:",n?.message||n):(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker error:",n?.message||n)}catch{}h8(new Error(`Worker error: ${n.message}`))}else(i=console.debug)==null||i.call(console,"[mermaidWorkerClient] Worker error (no pending):",n?.message||n)},ju.onmessageerror=n=>{var i,o;if(ju===t)if(uu.size!==0){try{qN?console.error("[mermaidWorkerClient] Worker messageerror:",n):(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker messageerror:",n)}catch{}h8(new Error("Worker messageerror"))}else(i=console.debug)==null||i.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",n)}}function gq(e,t,n,i){if(!zN()){const r=new Error("Mermaid rendering disabled");return r.name="MermaidDisabled",r.code=UN,Promise.reject(r)}const o=`${e}\0${t.theme}\0${n}\0${t.code}`;let s=xh.get(o);return s||(s=(function(r,l,a=1400){if(!zN()){const c=new Error("Mermaid rendering disabled");return c.name="MermaidDisabled",c.code=UN,Promise.reject(c)}if(Ah)return Promise.reject(Ah);const u=ju||(Ah=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),Ah.name="WorkerInitError",Ah.code="WORKER_INIT_ERROR",null);if(!u)return Promise.reject(Ah);if(uu.size>=WN){const c=new Error("Worker busy");return c.name="WorkerBusy",c.code=x9e,c.inFlight=uu.size,c.max=WN,Promise.reject(c)}return new Promise((c,d)=>{const f=Math.random().toString(36).slice(2);let h,m=!1;const g=()=>{m||(m=!0,h!=null&&globalThis.clearTimeout(h),uu.delete(f))},y={resolve:k=>{g(),c(k)},reject:k=>{g(),d(k)}};uu.set(f,y);try{u.postMessage({id:f,action:r,payload:l})}catch(k){return uu.delete(f),void d(k)}h=globalThis.setTimeout(()=>{const k=new Error("Worker call timed out");k.name="WorkerTimeout",k.code="WORKER_TIMEOUT";const v=uu.get(f);v&&v.reject(k)},a)})})(e,t,n),xh.set(o,s),s.then(()=>{xh.get(o)===s&&xh.delete(o)},()=>{xh.get(o)===s&&xh.delete(o)})),(function(r,l){if(!l)return r;if(l.aborted){const a=new Error("Aborted");return a.name="AbortError",Promise.reject(a)}return new Promise((a,u)=>{let c=()=>{};const d=()=>l.removeEventListener("abort",c);c=()=>{d();const f=new Error("Aborted");f.name="AbortError",u(f)},l.addEventListener("abort",c,{once:!0}),r.then(f=>{d(),a(f)},f=>{d(),u(f)})})})(s,i)}function W8t(e,t,n=1400,i){return gq("canParse",{code:e,theme:t},n,i)}function q8t(e,t,n=1400,i){return gq("findPrefix",{code:e,theme:t},n,i)}var _9e=Object.defineProperty,I9e=Object.defineProperties,M9e=Object.getOwnPropertyDescriptors,VN=Object.getOwnPropertySymbols,T9e=Object.prototype.hasOwnProperty,E9e=Object.prototype.propertyIsEnumerable,KN=(e,t,n)=>t in e?_9e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Bt=(e,t)=>{for(var n in t||(t={}))T9e.call(t,n)&&KN(e,n,t[n]);if(VN)for(var n of VN(t))E9e.call(t,n)&&KN(e,n,t[n]);return e},Dn=(e,t)=>I9e(e,M9e(t)),io=(e,t,n)=>new Promise((i,o)=>{var s=a=>{try{l(n.next(a))}catch(u){o(u)}},r=a=>{try{l(n.throw(a))}catch(u){o(u)}},l=a=>a.done?i(a.value):Promise.resolve(a.value).then(s,r);l((n=n.apply(e,t)).next())});const L9e="__global__",p8="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",NA=(()=>{const e=globalThis;if(e[p8])return e[p8];const t={scopedCustomComponents:{},revision:_u(0)};return e[p8]=t,t})(),ZN=NA.revision,N9e=Symbol("markstreamCustomComponents"),F9e=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 v2(e){return F9e.has(String(e).trim().toLowerCase())}function D9e(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function m8(e={}){const t={};for(const[n,i]of Object.entries(e))if(i!=null){t[n]=i;for(const o of new Set([Va(n),Va(D9e(n))]))!o||v2(o)||Object.prototype.hasOwnProperty.call(t,o)||(t[o]=i)}return t}function vs(e){const t=en(N9e,null);return D(()=>{var n;return ZN.value,(function(i,o={}){return ZN.value,Bt(Bt(Bt({},m8(NA.scopedCustomComponents[L9e]||{})),m8(o)),m8((function(s){return s&&NA.scopedCustomComponents[s]||{}})(i)))})(e?.(),(n=t?.value)!=null?n:{})})}const R9e=["aria-label"],O9e={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"},P9e={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"},Ei=(e,t)=>{const n=e.__vccOpts||e;for(const[i,o]of t)n[i]=o;return n},ra=Ei(ot({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(b(),N("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(b(),N("svg",P9e,[...n[1]||(n[1]=[_("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",fill:"currentColor"},null,-1),_("path",{d:"M9 12l2 2 4-4",stroke:"hsl(var(--ms-background))","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(b(),N("svg",O9e,[...n[0]||(n[0]=[_("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,R9e))}),[["__scopeId","data-v-be21ab83"]]);ra.install=e=>{e.component(ra.__name,ra)};const B9e={class:"emoji-node"},Il=Ei(ot({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(b(),N("span",B9e,B(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);Il.install=e=>{e.component(Il.__name,Il)};const $9e=["id"],z9e=["title"],la=Ei(ot({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const t=`#fnref--${e.node.id}`;function n(){if(typeof document>"u")return;const i=document.querySelector(t);i?i.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${t} not found`)}return(i,o)=>(b(),N("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[_("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+B(e.node.id)+"]",9,z9e)],8,$9e))}}),[["__scopeId","data-v-c1463a29"]]);la.install=e=>{e.component(la.__name,la)};const vq=(()=>{try{return!1}catch{}return!1})();function g8(e){vq&&console.warn(e)}function GN(e,t="safe",n){return Rx(e,t,n)}function yq(e){return kye(e)}function v8(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function $x(e,t="safe"){const n=String(e.tag||e.type||"").trim(),i=P9((o=e.attrs)?Array.isArray(o)?o.every(Array.isArray)?o.map(([r,l])=>[String(r),v8(l)]):o.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),v8(r.value)]):Object.entries(o).map(([r,l])=>[r,v8(l)]):null,t,n);var o;if(!i)return;const s=yq(W0(i));return Object.keys(s).length>0?s:void 0}function QN(e,t,n=!1){const i=Object.entries(t??{}),o=i.length>0?i.map(([s,r])=>r===""?` ${s}`:` ${s}="${r}"`).join(""):"";return n?`<${e}${o} />`:`<${e}${o}>`}function Pg(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function y8(e,t,n,i,o,s,r=!1){const l=(function(d,f){return nq(d,f)})(e,i);if(f2.has(e.toLowerCase())||!l&&JW(e,s))return null;if(!l&&Dx(e,s))return r?[QN(e,t,!0)]:[QN(e,t),...n,``];const a=Rx(t,s,e),u=a.key,c=u!=null&&u!==""?u:o;if(l){const d=i[e]||i[e.toLowerCase()],f=yq(a);return Fn(d,Dn(Bt({},f),{key:c}),n.length>0?n:void 0)}return Fn(e,Dn(Bt({},a),{innerHTML:void 0,key:c}),n.length>0?n:void 0)}function kq(e,t){return Cye(e,t)}function mb(e,t,n="safe"){if(!e)return[];try{return(function(s,r,l="safe"){let a=0;const u=[],c=[];for(const d of s)if(d.type==="text")(u.length>0?u[u.length-1].children:c).push(d.content);else if(d.type==="self_closing"){const f=y8(d.tagName,d.attrs||{},[],r,"ms-html-"+a++,l,!0);Pg(u.length>0?u[u.length-1].children:c,f)}else if(d.type==="tag_open")u.push({tagName:d.tagName,children:[],attrs:d.attrs,autoKey:"ms-html-"+a++});else if(d.type==="tag_close"){const f=d.tagName.toLowerCase();let h=-1;for(let m=u.length-1;m>=0;m--)if(u[m].tagName.toLowerCase()===f){h=m;break}if(h!==-1)for(;u.length>h;){const m=u.pop(),g=y8(m.tagName,m.attrs||{},m.children,r,m.autoKey,l);u.length>0?Pg(u[u.length-1].children,g):Pg(c,g),m.tagName.toLowerCase()!==f&&u.length>h&&g8(`Auto-closing unclosed tag: <${m.tagName}>`)}else g8(`Ignoring closing tag with no matching opening tag: `)}for(;u.length>0;){const d=u.pop(),f=y8(d.tagName,d.attrs||{},d.children,r,d.autoKey,l);u.length>0?Pg(u[u.length-1].children,f):Pg(c,f),g8(`Auto-closing unclosed tag: <${d.tagName}>`)}return c})(iq(e),t,n)}catch(o){return i=o,vq&&console.error("Failed to parse HTML to VNodes:",i),null}var i}const j9e=["innerHTML"],aa=Ei(ot({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=en("markstreamHtmlPolicy",void 0),i=D(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),o=vs(()=>t.customId),s=ot({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=D(()=>{const l=t.node.content;if(!l)return{mode:"html",content:""};if(i.value==="escape")return{mode:"html",content:lm(l,i.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const u=mb(l,o.value,i.value);if(u!==null)return{mode:"dynamic",nodes:u}}if(!kq(l,o.value))return{mode:"html",content:lm(l,i.value)};const a=mb(l,o.value,i.value);return a===null?{mode:"html",content:lm(l,i.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>r.value.mode==="dynamic"?(b(),N("span",{key:0,class:De(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[V(p(s),{nodes:r.value.nodes},null,8,["nodes"])],2)):r.value.mode==="text"?(b(),N("span",{key:1,class:De(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},B(r.value.content),3)):(b(),N("span",{key:2,class:De(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,j9e))}}),[["__scopeId","data-v-d17f12b0"]]);aa.install=e=>{e.component(aa.__name,aa)};const H9e={class:"inline-code"},W9e={key:0},Er=Ei(ot({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=qm(),i=en("markstreamFade",void 0),o=en("markstreamTextStreamState",void 0),s=en("markstreamStreamVersion",void 0),r=D(()=>{const v=n.fade;return v===""||v===!0||v==="true"||v!==!1&&v!=="false"&&void 0}),l=D(()=>typeof r.value=="boolean"?r.value:typeof i?.value!="boolean"||i.value),a=D(()=>{var v;return String((v=t.node.code)!=null?v:"")}),u=D(()=>!l.value),c=D(()=>{var v;const C=(v=n["index-key"])!=null?v:n.indexKey;return C==null||C===""?"":String(C)}),d=q(t.node.code),f=q(""),h=q(0);let m;function g(){m?.(),m=void 0}function y(){g(),f.value&&(d.value=d.value+f.value,f.value="")}ze([()=>t.node.code,c,l],([v])=>{const C=String(v??""),w=c.value,M=lq({nextContent:C,persistedContent:w?o?.get(w):void 0,currentState:{settledContent:d.value,streamedDelta:f.value},typewriterEnabled:l.value});d.value=M.settledContent,f.value=M.streamedDelta,M.appended?(h.value+=1,(function(){if(!f.value||m||!s)return;const L=s.value;m=ze(()=>s.value,E=>{E!==L&&y()},{flush:"sync"})})()):f.value||g(),w&&o?.set(w,C)},{immediate:!0}),cd(g);const k=D(()=>h.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(v,C)=>(b(),N("code",H9e,[u.value?(b(),N(Le,{key:0},[Be(B(a.value),1)],64)):(b(),N(Le,{key:1},[d.value?(b(),N("span",W9e,B(d.value),1)):X("",!0),f.value?(b(),N("span",{key:1,class:De(["inline-code-stream-delta",[k.value]]),onAnimationend:y},B(f.value),35)):X("",!0)],64))]))}}),[["__scopeId","data-v-4e331c97"]]);Er.install=e=>{e.component(Er.__name,Er)};const FA=q(!1),YN=q(""),JN=q("top"),U0=q(null),V0=q(null),DA=q(null),RA=q(null),XN=q(null);let $9=null,z9=null,OA=0;function bq(){$9&&(clearTimeout($9),$9=null),z9&&(clearTimeout(z9),z9=null)}let Fy=!1,Dy=null,eF=!1;function q9e(e,t,n="top",i=!1,o,s){if(!e)return;const r=++OA;bq();const l=()=>io(null,null,function*(){var a,u;if(yield(function(){return io(this,null,function*(){if(!Fy&&!eF&&typeof document<"u"){Dy!=null||(Dy=io(null,null,function*(){const[{createApp:c,h:d},{default:f}]=yield Promise.all([qo(()=>import("./vue.runtime.esm-bundler-Dz1HMlA6.js"),[]),qo(()=>import("./Tooltip-Da35cfam.js"),[])]),h=document.createElement("div");h.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(h),c({setup:()=>()=>{var m;return d(f,{visible:FA.value,"anchor-el":U0.value,content:YN.value,placement:JN.value,id:V0.value,originX:DA.value,originY:RA.value,isDark:(m=XN.value)!=null?m:void 0})}}).mount(h),Fy=!0}));try{yield Dy}catch(c){Fy=!1,Dy=null,eF=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",c)}}})})(),Fy&&r===OA){V0.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,U0.value=e,YN.value=t,JN.value=n,DA.value=(a=o?.x)!=null?a:null,RA.value=(u=o?.y)!=null?u:null,XN.value=typeof s=="boolean"?s:null,FA.value=!0;try{e.setAttribute("aria-describedby",V0.value)}catch{}}});i?l():$9=setTimeout(l,80)}function U9e(e=!1){OA+=1,bq();const t=()=>{if(U0.value&&V0.value)try{U0.value.removeAttribute("aria-describedby")}catch{}FA.value=!1,U0.value=null,V0.value=null,DA.value=null,RA.value=null};e?t():z9=setTimeout(t,120)}const V9e={"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..."},K9e=Symbol("markstreamI18nFallback");function wq(e,t){var n;return(n=t?.[e])!=null?n:V9e[e]}const PA=(e,t)=>{var n;return(n=wq(e,t))!=null?n:(function(i){return(i.split(".").pop()||i).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,o=>o.toUpperCase()).trim()})(e)};function tF(e,t){return{t(n){const i=wq(n,t);if(e.te&&i!=null&&!e.te(n))return PA(n,t);const o=e.t(n);return o===n&&i!=null?PA(n,t):o}}}function Z9e(){const e=(function(){var n,i,o;try{const s=gs(),r=K9e,l=s?.provides,a=(n=s?.appContext)==null?void 0:n.provides;return(o=(i=l?.[r])!=null?i:a?.[r])!=null?o:null}catch{}return null})(),t=(function(){var n,i;try{const o=gs(),s=o?.proxy,r=s?.$t;if(typeof r=="function"){const u=s?.$te;return{t:r.bind(s),te:typeof u=="function"?u.bind(s):void 0}}const l=(i=(n=o?.appContext)==null?void 0:n.config)==null?void 0:i.globalProperties,a=l?.$t;if(typeof a=="function"){const u=l?.$te;return{t:a.bind(l),te:typeof u=="function"?u.bind(l):void 0}}}catch{}return null})();if(t)return tF(t,e);try{const n=globalThis.$vueI18nUse||null;if(n&&typeof n=="function")try{const i=n();if(i&&typeof i.t=="function")return tF({t:i.t.bind(i),te:typeof i.te=="function"?i.te.bind(i):void 0},e)}catch{}}catch{}return{t:n=>PA(n,e)}}const Cq=Symbol("ViewportPriority"),Aq=Symbol("ViewportPriorityOptions"),xq=Symbol("OffscreenHeavyNodeDeferral"),G9e=D(()=>!1),gp="400px";function zx(){return en(Aq,void 0)}function jx(){return en(xq,G9e)}function Q9e(e,t){var n,i;const o=typeof window<"u"&&typeof document<"u",s=typeof t=="boolean"?q(t):t,r=o?(n=window.requestIdleCallback)!=null?n:E=>window.setTimeout(()=>E({didTimeout:!0,timeRemaining:()=>0}),16):null,l=o?(i=window.cancelIdleCallback)!=null?i:E=>window.clearTimeout(E):null,a=new WeakMap;let u=1;const c=new Map,d=new Map,f=new Set;let h=null,m=null;function g(E){if(!E)return"viewport";let S=a.get(E);return S||(S=u++,a.set(E,S)),String(S)}function y(){if(h!=null){try{l?.(h)}catch{}h=null}}function k(E){if(E){const S=c.get(E);if(S&&!S.targets.size){try{S.io.disconnect()}catch{}c.delete(E)}}d.size||f.size||y()}function v(E){const S=d.get(E);if(!S)return;const x=c.get(S.bucketKey);if(!S.visible.value){S.visible.value=!0;try{S.resolve()}catch{}}try{x?.io.unobserve(E)}catch{}x?.targets.delete(E),d.delete(E),f.delete(E),k(S.bucketKey)}function C(){window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&r&&h==null&&f.size&&(h=r(()=>{h=null;const E=f.values().next().value;E&&(f.delete(E),v(E),f.size&&C())},{timeout:1200}))}function w(E,S){if(!o||typeof IntersectionObserver>"u")return null;const x=(function(R,F){var P,z,W;return{root:(P=e?.(R??null))!=null?P:null,rootMargin:(z=F?.rootMargin)!=null?z:gp,threshold:(W=F?.threshold)!=null?W:0}})(E,S),A=[g((T=x).root),T.rootMargin,T.threshold].join("\0");var T;const I=c.get(A);if(I)return{key:A,bucket:I};let O;try{O=new IntersectionObserver(R=>{for(const F of R)(F.isIntersecting||F.intersectionRatio>0)&&v(F.target)},{root:x.root,rootMargin:x.rootMargin,threshold:x.threshold})}catch{return null}const H={io:O,targets:new Map};return c.set(A,H),{key:A,bucket:H}}function M(){if(o&&s.value)for(const[E,S]of Array.from(d.entries())){const x=w(E,S.opts);if(!x){v(E);continue}if(x.key===S.bucketKey)continue;const A=S.bucketKey,T=c.get(A);try{T?.io.unobserve(E)}catch{}T?.targets.delete(E),S.bucketKey=x.key,x.bucket.targets.set(E,S),x.bucket.io.observe(E),k(A)}}ze(s,E=>{if(!E){for(const S of Array.from(d.keys()))v(S);y()}},{flush:"sync"});const L=(E,S)=>{const x=q(!1);let A,T=!1;const I=new Promise(F=>{A=()=>{T||(T=!0,F())}}),O=()=>{const F=d.get(E);if(!F)return f.delete(E),void k();const P=c.get(F.bucketKey);try{P?.io.unobserve(E)}catch{}P?.targets.delete(E),d.delete(E),f.delete(E),k(F.bucketKey)};if(!o||!s.value)return x.value=!0,A(),{isVisible:x,whenVisible:I,destroy:O};const H=w(E,S);if(!H)return x.value=!0,A(),{isVisible:x,whenVisible:I,destroy:O};const R={resolve:A,visible:x,bucketKey:H.key,opts:S};return d.set(E,R),H.bucket.targets.set(E,R),H.bucket.io.observe(E),o&&m==null&&(m=window.requestAnimationFrame(()=>{m=null,M()})),S?.allowIdle!==!1&&(f.add(E),C()),{isVisible:x,whenVisible:I,destroy:O}};return L.refresh=M,Gn(Cq,L),L}function Hx(){var e,t;const n=en(Cq,void 0);if(n)return n;const i=new WeakMap,o=new Map,s=new Set;let r=null;const l=typeof window<"u"?(e=window.requestIdleCallback)!=null?e:h=>window.setTimeout(()=>h({didTimeout:!0,timeRemaining:()=>0}),16):null,a=typeof window<"u"?(t=window.cancelIdleCallback)!=null?t:h=>window.clearTimeout(h):null,u=()=>{if(r!=null){try{a?.(r)}catch{}r=null}},c=h=>{if(!h)return;const m=o.get(h);if(m&&!m.targets.size){try{m.io.disconnect()}catch{}o.delete(h)}},d=h=>{const m=i.get(h);if(!m)return;const g=o.get(m.bucketKey);if(!m.visible.value){m.visible.value=!0;try{m.resolve()}catch{}}try{g?.io.unobserve(h)}catch{}i.delete(h),g?.targets.delete(h),s.delete(h),c(m.bucketKey),s.size||u()},f=()=>{window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&l&&r==null&&s.size&&(r=l(()=>{r=null;const h=s.values().next().value;h&&(s.delete(h),d(h),s.size&&f())},{timeout:1200}))};return(h,m)=>{const g=q(!1);let y,k=!1;const v=new Promise(M=>{y=()=>{k||(k=!0,M())}}),C=()=>{const M=i.get(h);if(!M)return s.delete(h),void(s.size||u());const L=o.get(M.bucketKey);try{L?.io.unobserve(h)}catch{}i.delete(h),L?.targets.delete(h),s.delete(h),c(M.bucketKey),s.size||u()},w=(M=>{var L,E;if(typeof window>"u"||typeof IntersectionObserver>"u")return null;const S=(O=>{var H,R;return[(H=O?.rootMargin)!=null?H:gp,(R=O?.threshold)!=null?R:0].join("\0")})(M),x=o.get(S);if(x)return{key:S,bucket:x};const A=(L=M?.rootMargin)!=null?L:gp;let T;try{T=new IntersectionObserver(O=>{for(const H of O)(H.isIntersecting||H.intersectionRatio>0)&&d(H.target)},{root:null,rootMargin:A,threshold:(E=M?.threshold)!=null?E:0})}catch{return null}const I={io:T,targets:new Set};return o.set(S,I),{key:S,bucket:I}})(m);return w?(i.set(h,{resolve:y,visible:g,bucketKey:w.key}),w.bucket.targets.add(h),w.bucket.io.observe(h),m?.allowIdle!==!1&&(s.add(h),f()),{isVisible:g,whenVisible:v,destroy:C}):(g.value=!0,y(),{isVisible:g,whenVisible:v,destroy:C})}}function Y9e(e,t){var n,i;const o=(i=(n=e.indexKey)!=null?n:t["index-key"])!=null?i:t.indexKey;return o==null||o===""?"":String(o)}const J9e=["data-markstream-viewport-pending"],X9e=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],eke={key:1,class:"image-placeholder"},tke={key:1,class:"image-node__raw-text"},nke={key:2,class:"image-shimmer-overlay"},ike={key:1,class:"image-node__raw-text"},oke={key:3,class:"image-error"},df=Ei(ot({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},lazy:{type:Boolean,default:!1},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:t}){var n,i,o;const s=e,r=t,l=q(!1),a=q(!1),u=q(""),c=q("primary"),d=q(null),f=qm(),h=en(MA,null),m=Hx(),g=zx(),y=jx(),k=D(()=>AL(s.node.src)),v=D(()=>AL(s.fallbackSrc)),C=(o=(i=(n=gs())==null?void 0:n.vnode.el)==null?void 0:i.querySelector)==null?void 0:o.call(i,"img"),w=typeof window<"u"&&C?.getAttribute("src")===(k.value||v.value),M=q(typeof window>"u"||w||!y.value),L=_u(null);let E="",S=null;const x=D(()=>u.value),A=D(()=>!s.lazy),T=D(()=>typeof window<"u"&&y.value&&!w),I=D(()=>!T.value||M.value),O=D(()=>I.value?x.value:""),H=D(()=>{var Z,se;return(se=(Z=g?.value.heavyBlockMargin)!=null?Z:g?.value.rootMargin)!=null?se:gp}),R=D(()=>!s.node.loading&&c.value!=="failed"&&u.value.length>0),F=D(()=>c.value==="failed"),P=D(()=>(!A.value||T.value&&!M.value)&&!l.value&&!a.value&&c.value!=="failed"&&u.value.length>0),z=D(()=>Y9e(s,f));function W(Z=z.value){Z&&d.value&&h?.reportHeight(Z,d.value.offsetHeight)}function $(Z=z.value){Z&&ft(()=>{W(Z)})}function K(){S&&(clearTimeout(S),S=null)}function ne(){const Z=z.value;Z&&E!==Z&&(E&&h?.markSettled(E),K(),E=Z,h?.markPending(Z),typeof window<"u"&&(S=window.setTimeout(()=>{E===Z&&($(Z),G())},8e3)))}function G(){return io(this,null,function*(){const Z=E;Z&&(K(),E="",yield ft(),W(Z),h?.markSettled(Z))})}function te(){if(c.value==="primary"&&v.value&&v.value!==u.value)return c.value="fallback",u.value=v.value,l.value=!1,a.value=!1,void $();c.value="failed",a.value=!0,r("error",u.value),$()}function le(){l.value=!0,a.value=!1,r("load",x.value),$()}function ie(Z){Z.preventDefault(),l.value&&!a.value&&r("click",[Z,x.value])}const{t:_e}=Z9e();return ze([k,v,()=>s.node.loading],()=>(l.value=!1,a.value=!1,s.node.loading||k.value?(u.value=k.value,void(c.value="primary")):v.value?(u.value=v.value,void(c.value="fallback")):(u.value="",c.value="failed",void(a.value=!0))),{immediate:!0}),typeof window<"u"&&ze([d,T],([Z,se],he,Y)=>{var J;if((J=L.value)==null||J.destroy(),L.value=null,!se||M.value)return void(M.value=!0);if(!Z)return void(M.value=!1);let U=!0;const Q=m(Z,{rootMargin:H.value,allowIdle:!1});L.value=Q,M.value=Q.isVisible.value,Q.whenVisible.then(()=>{U&&L.value===Q&&(M.value=!0)}),Y(()=>{U=!1,Q.destroy(),L.value===Q&&(L.value=null)})},{immediate:!0}),ze([R,l,a,x,()=>s.lazy,I],([Z,se,he,Y,J,U])=>Z&&Y&&!he&&U?se?(G(),void $()):J?(ne(),void $()):void(se||he||ne()):(G(),void $()),{flush:"post",immediate:!0}),ii(()=>{var Z;(Z=L.value)==null||Z.destroy(),L.value=null,(function(){const se=E;se&&(K(),E="",h?.markSettled(se))})()}),(Z,se)=>{var he,Y,J,U,Q;return b(),N("span",{ref_key:"rootRef",ref:d,class:"image-node-container","data-markstream-viewport-pending":T.value&&!M.value?"true":void 0},[R.value?(b(),N("img",{key:0,src:O.value||void 0,alt:String((Y=(he=s.node.alt)!=null?he:s.node.title)!=null?Y:""),title:String((U=(J=s.node.title)!=null?J:s.node.alt)!=null?U:""),class:De(["image-node__img",{"is-loading":!A.value&&!l.value,"is-loaded":A.value||l.value,"has-natural-size":l.value,"cursor-pointer":l.value}]),loading:s.lazy?"lazy":void 0,fetchpriority:A.value?"high":void 0,decoding:A.value?"sync":"async",tabindex:l.value?0:-1,"aria-label":(Q=s.node.alt)!=null?Q:p(_e)("image.preview"),onError:te,onLoad:le,onClick:ie},null,42,X9e)):X("",!0),e.node.loading&&!a.value?(b(),N("span",eke,[s.usePlaceholder?Hn(Z.$slots,"placeholder",{key:0,node:s.node,displaySrc:x.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:s.fallbackSrc,lazy:s.lazy},()=>[se[0]||(se[0]=_("span",{class:"image-shimmer"},null,-1))],!0):(b(),N("span",tke,B(e.node.raw),1))])):X("",!0),P.value&&!e.node.loading?(b(),N("span",nke,[s.usePlaceholder?Hn(Z.$slots,"placeholder",{key:0,node:s.node,displaySrc:x.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:s.fallbackSrc,lazy:s.lazy},()=>[se[1]||(se[1]=_("span",{class:"image-shimmer"},null,-1))],!0):(b(),N("span",ike,B(e.node.raw),1))])):X("",!0),F.value?(b(),N("span",oke,[Hn(Z.$slots,"error",{node:s.node,displaySrc:x.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:s.fallbackSrc,lazy:s.lazy},()=>[se[2]||(se[2]=_("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[_("path",{fill:"currentColor",d:"M2 2h20v10h-2V4H4v9.586l5-5L14.414 14L13 15.414l-4-4l-5 5V20h8v2H2zm13.547 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-3 1a3 3 0 1 1 6 0a3 3 0 0 1-6 0m3.625 6.757L19 17.586l2.828-2.829l1.415 1.415L20.414 19l2.829 2.828l-1.415 1.415L19 20.414l-2.828 2.829l-1.415-1.415L17.586 19l-2.829-2.828z"})],-1)),_("span",null,B(p(_e)("image.loadError")),1)],!0)])):X("",!0)],8,J9e)}}}),[["__scopeId","data-v-046e82ac"]]);df.install=e=>{e.component(df.__name,df)};const ske={key:2},yc=ot({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=vs(()=>t.customId),i=en("markstreamHtmlPolicy",void 0),o=en("markstreamNestedRendererProps",void 0),s=D(()=>{var m;return(m=i?.value)!=null?m:"safe"}),r=D(()=>{var m,g;const y=(m=o?.value)!=null?m:{};return Dn(Bt({},y),{customId:(g=t.customId)!=null?g:y.customId,htmlPolicy:s.value})}),l=Xu({loader:()=>Promise.resolve().then(()=>Xx),suspensible:!1}),a=D(()=>t.components[String(t.node.type)]),u=D(()=>!!(a.value&&n.value[t.node.type]&&!v2(String(t.node.type)))),c=D(()=>u.value?$x(t.node,s.value):void 0),d=D(()=>Array.isArray(t.node.children)&&t.node.children.length>0),f=D(()=>{var m;return String((m=t.node.content)!=null?m:"")}),h=D(()=>{var m,g;return String((g=(m=t.node.content)!=null?m:t.node.raw)!=null?g:"")});return(m,g)=>a.value&&u.value?(b(),fe(To(a.value),ci({key:0},c.value,{node:e.node,loading:e.node.loading,"index-key":e.indexKey,"custom-id":e.customId,"is-dark":r.value.isDark}),{default:de(()=>[d.value?(b(),fe(p(l),ci({key:0},r.value,{nodes:e.node.children,"index-key":e.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):f.value?(b(),fe(p(l),ci({key:1},r.value,{content:f.value,final:!e.node.loading,"index-key":`${e.indexKey||"child"}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):X("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):a.value?(b(),fe(To(a.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey},null,8,["node","custom-id","index-key"])):e.fallbackToText?(b(),N("span",ske,B(h.value),1)):X("",!0)}}),nF=Object.freeze({enabled:!0,contextLineCount:2,minimumLineCount:4,revealLineCount:5});function rke(e){var t;if(typeof e=="boolean")return e;if(e&&typeof e=="object"){const n=e;return Dn(Bt(Bt({},nF),n),{enabled:(t=n.enabled)==null||t})}return Bt({},nF)}function Wx(e,t){if(e.renderSideBySide===!1)return!0;if(e.useInlineViewWhenSpaceIsLimited!==!0)return!1;const n=e.renderSideBySideInlineBreakpoint,i=typeof n=="number"&&Number.isFinite(n)?n:900;return t>0&&t<=i}function Sq(e){var t,n;const i=(n=(t=String(e??"").split(/\r?\n/,1)[0])==null?void 0:t.trim())!=null?n:"";if(i.length<3)return"";const o=i[0];if(o!=="`"&&o!=="~"||i[1]!==o||i[2]!==o)return"";let s=3;for(;i[s]===o;)s+=1;return i.slice(s).trim()}function iF(e){var t;return((t=String(e??"").trim().split(/\s+/,1)[0])!=null?t:"")==="diff"}function lke(e){var t;return e.diff===!0||iF(e.language)||iF(Sq(String((t=e.raw)!=null?t:"")))}function ake(e,t,n){const i=(function(o){const s=Sq(o);if(!s)return"";const r=s.split(/\s+/).filter(Boolean);if(!r.length)return"";const l=r[0]==="diff"?r.slice(1):r;for(const a of l){const u=a.includes(":")?a.slice(a.indexOf(":")+1):a;if(u&&/[./\\-]/.test(u))return u}return""})(e);return{title:i||t,caption:i?n?`Diff / ${t}`:t:""}}const uke=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],cke={key:0,translate:"no",class:"markstream-pre__diff-code"},dke={class:"markstream-pre__diff-pane-content"},fke={class:"markstream-pre__diff-number","aria-hidden":"true"},hke={class:"markstream-pre__diff-content"},pke={class:"markstream-pre__diff-content-inner"},mke={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},gke=["textContent"],vke=["textContent"],bl=ot({__name:"PreCodeNode",props:{node:{},loading:{type:Boolean},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},diffHideUnchangedRegions:{type:[Boolean,Object]},reservedHeightPx:{}},setup(e){const t=e;function n(ie,_e){const Z=String(ie??"");return _e?Z:Z.replace(/\r\n$|\n$|\r$/,"")}const i=D(()=>{var ie,_e,Z;const se=String((_e=(ie=t.node)==null?void 0:ie.language)!=null?_e:"");return String((Z=String(se).split(/\s+/g)[0])!=null?Z:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),o=D(()=>`language-${i.value}`),s=D(()=>{var ie;return t.loading===!0||((ie=t.node)==null?void 0:ie.loading)===!0}),r=D(()=>{var ie;return n((ie=t.node)==null?void 0:ie.code,s.value)});let l="",a=1;const u=D(()=>(function(ie){let _e=0,Z=1;ie.startsWith(l)&&(_e=l.length,Z=a,_e>0&&ie[_e-1]==="\r"&&ie[_e]===` +`&&_e++);for(let se=_e;ser.value.split(/\r\n|\n|\r/));let d=0,f="";const h=D(()=>{const ie=u.value;ie{var ie;return t.showLineNumbers===!0&&((ie=t.node)==null?void 0:ie.diff)===!0}),g=D(()=>m.value&&t.diffInline===!0),y=D(()=>{const ie=Number(t.reservedHeightPx);if(!Number.isFinite(ie)||ie<=0)return;const _e=`${Math.ceil(ie)}px`;return s.value?{maxHeight:_e,overflow:"auto"}:{height:_e,minHeight:_e,maxHeight:_e,overflow:"auto"}}),k=["diff ","index ","--- ","+++ ","@@ "];function v(ie){return String(ie??"").trim().length===0}function C(ie,_e="context",Z={}){const se=v(ie);return{code:ie,kind:se&&_e!=="hunk"&&_e!=="spacer"&&!Z.preserveBlankKind?"context":_e,empty:se}}function w(ie){const _e=n(ie,s.value);return _e?_e.split(/\r\n|\n|\r/):[]}function M(ie,_e){return!v(ie[_e])||_ek.some(Z=>_e.startsWith(Z)))}function x(ie,_e){return _e||!ie.startsWith(" ")||ie.startsWith(" ")?ie:` ${ie}`}function A(ie,_e){const Z=ie.length,se=_e.length,he=[];let Y=0;for(;Y=Y&&Q>=Y&&ie[U]===_e[Q];)J.unshift({originalIndex:U,modifiedIndex:Q}),U--,Q--;const ue=U-Y+1,me=Q-Y+1;if(ue<=0||me<=0||s.value||(ue+1)*(me+1)>15e5)return he.concat(J);const pe=me+1,ee=new Uint32Array((ue+1)*(me+1));for(let Ce=ue-1;Ce>=0;Ce--)for(let ve=me-1;ve>=0;ve--){const ce=Ce*pe+ve;if(ie[Y+Ce]===_e[Y+ve])ee[ce]=ee[(Ce+1)*pe+ve+1]+1;else{const Te=ee[(Ce+1)*pe+ve],ke=ee[Ce*pe+ve+1];ee[ce]=Te>=ke?Te:ke}}const re=[];let ge=0,ae=0;for(;ge=ee[ge*pe+ae+1]?ge++:ae++;return he.concat(re,J)}function T(ie){var _e;const Z=(function(){var Q,ue;const me=t.diffHideUnchangedRegions;if(me==null||me===!1)return null;const pe=me===!0?{}:me;return pe.enabled===!1?null:{contextLineCount:Math.max(0,Math.floor((Q=pe.contextLineCount)!=null?Q:2)),minimumLineCount:Math.max(1,Math.floor((ue=pe.minimumLineCount)!=null?ue:4))}})();if(!Z||ie.length<1||ie.length>2||ie.length===2&&ie[0].lines.length!==ie[1].lines.length)return ie;const se=ie[0].lines,he=(_e=ie[1])==null?void 0:_e.lines,Y=Q=>se[Q].kind==="context"&&(he===void 0||he[Q].kind==="context"&&se[Q].code===he[Q].code),J=[];let U=0;for(;U=Z.minimumLineCount){const me=Q+(Q===0?0:Z.contextLineCount),pe=ue-(ue===se.length?0:Z.contextLineCount);pe-me>=Z.minimumLineCount&&J.push({start:me,end:pe})}U===Q&&U++}return J.length?ie.map((Q,ue)=>{const me=[];let pe=0;for(const ee of J)me.push(...Q.lines.slice(pe,ee.start)),me.push({code:ue===0?"Unmodified lines":"",kind:"collapsed",empty:!1,key:`${Q.key}-collapsed-${ee.start}-${ee.end}`,number:""}),pe=ee.end;return me.push(...Q.lines.slice(pe)),Dn(Bt({},Q),{lines:me})}):ie}const I=D(()=>{var ie,_e,Z,se;if(!m.value)return[];const he=(function(ue){const me=ue.some(ee=>L(ee)),pe=ue.some(ee=>E(ee));return me&&pe||(function(){var ee,re,ge,ae;if(i.value==="diff")return!0;const Ce=(ae=(ge=String((re=(ee=t.node)==null?void 0:ee.raw)!=null?re:"").split(/\r?\n/,1)[0])==null?void 0:ge.trim())!=null?ae:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(Ce)})()&&(me||pe)})(c.value),Y=(function(){var ue,me;return((ue=t.node)==null?void 0:ue.originalCode)!=null||((me=t.node)==null?void 0:me.updatedCode)!=null})();if(g.value){const ue=Y?(function(me,pe){const ee=w(me),re=w(pe),ge=A(ee,re);if(ge.length>0){const ke=[];let Ae=0,Ne=0;for(const Ze of ge){for(;Ae=Ce&&ce>=Ce&&ee[ve]===re[ce];)Te.unshift(Dn(Bt({},C(re[ce])),{key:`inline-suffix-${ce}`,number:ce+1})),ve--,ce--;for(let ke=Ce;ke<=ve;ke++)ae.push(Dn(Bt({},C(ee[ke],"removed",{preserveBlankKind:M(ee,ke)})),{key:`inline-removed-source-${ke}`,number:ke+1}));for(let ke=Ce;ke<=ce;ke++)ae.push(Dn(Bt({},C(re[ke],"added",{preserveBlankKind:M(re,ke)})),{key:`inline-added-source-${ke}`,number:ke+1}));return ae.concat(Te)})((ie=t.node)==null?void 0:ie.originalCode,(_e=t.node)==null?void 0:_e.updatedCode):(function(me){const pe=[];let ee=1,re=1;const ge=S(me);for(const[ae,Ce]of me.entries())if(Ce.startsWith("@@")){const ve=Ce.match(/^@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/);ve&&(ee=Number(ve[1]),re=Number(ve[2])),pe.push(Dn(Bt({},C(Ce,"hunk")),{key:`inline-hunk-${ae}`,number:""}))}else if(L(Ce))pe.push(Dn(Bt({},C(x(Ce.slice(1),ge),"removed",{preserveBlankKind:!0})),{key:`inline-removed-${ae}`,number:ee++}));else if(E(Ce))pe.push(Dn(Bt({},C(x(Ce.slice(1),ge),"added",{preserveBlankKind:!0})),{key:`inline-added-${ae}`,number:re++}));else{const ve=ge&&Ce.startsWith(" ")?Ce.slice(1):Ce;pe.push(Dn(Bt({},C(ve)),{key:`inline-context-${ae}`,number:re})),ee++,re++}return pe})(c.value);return T([{key:"inline",className:"markstream-pre__diff-pane--inline",lines:ue}])}if(!he&&Y)return(function(ue,me){const pe=w(ue),ee=w(me),re=A(pe,ee),ge=[],ae=[];let Ce=0,ve=0,ce=0;const Te=(ke,Ae)=>{const Ne=Math.max(ke-Ce,Ae-ve);for(let Ze=0;ZeDn(Bt({},ue),{key:`original-${me}`,number:me+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:U.map((ue,me)=>Dn(Bt({},ue),{key:`modified-${me}`,number:me+1}))}])}),O=D(()=>{var ie,_e;if(t.showLineNumbers!==!0)return;let Z=m.value?1:u.value;if(m.value){Z=Math.max(Z,w((ie=t.node)==null?void 0:ie.originalCode).length,w((_e=t.node)==null?void 0:_e.updatedCode).length);for(const he of I.value)for(const Y of he.lines)typeof Y.number=="number"&&(Z=Math.max(Z,Y.number))}const se=`${Math.max(2,String(Z).length)}ch`;return{"--markstream-pre-line-number-width":se,"--markstream-pre-diff-line-number-width":se,"--markstream-code-padding-left":"calc(var(--markstream-pre-line-number-padding-left, 2ch) + var(--markstream-pre-line-number-width, 2ch) + var(--markstream-pre-line-number-padding-right, 1ch) + var(--markstream-pre-line-number-separator-width, 2px) + var(--markstream-pre-line-number-gap-to-code, 1ch))"}}),H=D(()=>I.value.some(ie=>ie.lines.some(_e=>_e.kind==="collapsed"))),R=D(()=>{const ie=i.value;return ie?`Code block: ${ie}`:"Code block"}),F=q(null),P=q([]);let z=null,W=!1,$=null;function K(ie){const _e=Number.parseFloat(String(ie??""));return Number.isFinite(_e)&&_e>0?_e:0}function ne(ie,_e){var Z;if(!ie)return _e;if(ie.classList.contains("markstream-pre__diff-line--collapsed"))return 32;const se=ie.querySelector(".markstream-pre__diff-content"),he=se?.getBoundingClientRect(),Y=(Z=he?.height)!=null?Z:0;return Math.max(_e,Math.ceil(Y))}function G(){W||typeof window>"u"||(z!=null&&window.cancelAnimationFrame(z),z=window.requestAnimationFrame(()=>{z=null,W||(function(){var ie,_e;z=null;const Z=F.value;if(!Z||!m.value||g.value||!Z.classList.contains("is-wrap"))return void(P.value.length&&(P.value=[]));const se=(function(me){const pe=window.getComputedStyle(me),ee=K(pe.getPropertyValue("--markstream-pre-diff-line-height"));if(ee>0)return ee;const re=K(pe.lineHeight);return re>0?re:18})(Z),he=Array.from(Z.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),Y=Array.from(Z.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),J=Math.max(he.length,Y.length),U=[];for(let me=0;me{const ee=ue[pe];return ee&&Math.abs(me.rowHeight-ee.rowHeight)<=.5&&Math.abs(me.originalHeight-ee.originalHeight)<=.5&&Math.abs(me.modifiedHeight-ee.modifiedHeight)<=.5})||(P.value=U)})()}))}function te(ie){$?.disconnect(),$=null,ie&&m.value&&!g.value&&typeof ResizeObserver<"u"&&($=new ResizeObserver(()=>{G()}),$.observe(ie))}function le(ie,_e){const Z=P.value[ie];if(!Z)return;const se=_e==="original"?Z.originalHeight:Z.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(Z.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(se)}px`}}return ze(F,ie=>{te(ie),ft(()=>G())},{flush:"post"}),ze([m,g,I],()=>{te(F.value),ft(()=>G())},{flush:"post",immediate:!0}),ii(()=>{W=!0,z!=null&&(window.cancelAnimationFrame(z),z=null),$?.disconnect(),$=null}),(ie,_e)=>(b(),N("pre",{ref_key:"preRef",ref:F,style:on([y.value,O.value]),class:De([o.value,{"markstream-pre--line-numbers":t.showLineNumbers,"markstream-pre--diff-preview":m.value,"markstream-pre--diff-inline":g.value,"markstream-pre--diff-collapsed":H.value}]),"aria-busy":s.value,"aria-label":R.value,"data-language":i.value,"data-markstream-line-numbers":t.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"},[m.value?(b(),N("code",cke,[(b(!0),N(Le,null,Ct(I.value,Z=>(b(),N("span",{key:Z.key,class:De(["markstream-pre__diff-pane",Z.className])},[_("span",dke,[(b(!0),N(Le,null,Ct(Z.lines,(se,he)=>(b(),N("span",{key:se.key,class:De(["markstream-pre__diff-line",[`markstream-pre__diff-line--${se.kind}`,{"markstream-pre__diff-line--empty":se.empty}]]),style:on(le(he,Z.key))},[_e[0]||(_e[0]=_("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),_("span",fke,B(se.number),1),_("span",hke,[_("span",pke,B(se.code),1)])],6))),128))])],2))),128))])):(b(),N(Le,{key:1},[t.showLineNumbers?(b(),N("span",mke,[_("span",{class:"markstream-pre__line-numbers-text",textContent:B(h.value)},null,8,gke)])):X("",!0),_("code",{translate:"no",class:"markstream-pre__code",textContent:B(r.value)},null,8,vke)],64))],14,uke))}});bl.install=e=>{e.component(bl.__name,bl)};const Fo=Ei(ot({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=qm(),i=en("markstreamFade",void 0),o=en("markstreamTextStreamState",void 0),s=en("markstreamStreamVersion",void 0),r=D(()=>{const M=n.fade;return M===""||M===!0||M==="true"||M!==!1&&M!=="false"&&void 0}),l=D(()=>typeof r.value=="boolean"?r.value:typeof i?.value!="boolean"||i.value),a=D(()=>{var M;const L=(M=n["index-key"])!=null?M:n.indexKey;return L==null||L===""?"":String(L)}),u=q(t.node.content),c=q(""),d=q(0),f=q(t.node.content);let h;const m=q(null),g=q(null);let y="",k=null;function v(){h?.(),h=void 0}function C(){v(),c.value&&(u.value=u.value+c.value,c.value="")}ze([u,m,g],function(){var M,L;const E=m.value;if(!E)return;const S=String((M=u.value)!=null?M:""),x=g.value;return k||(k=E.firstChild,y=(L=k?.data)!=null?L:""),S.startsWith(y)?!k&&S?(E.textContent=S,k=E.firstChild,void(y=S)):void(S.length>y.length&&x&&(x.appendChild(document.createTextNode(S.slice(y.length))),y=S)):(E.textContent=S,k=E.firstChild,x&&(x.textContent=""),void(y=S))},{immediate:!0}),ze([()=>t.node.content,a,l],([M])=>{const L=String(M??""),E=a.value,S=lq({nextContent:L,persistedContent:E?o?.get(E):void 0,currentState:{settledContent:u.value,streamedDelta:c.value},typewriterEnabled:l.value});u.value=S.settledContent,c.value=S.streamedDelta,S.appended?(d.value+=1,(function(){if(!c.value||h||!s)return;const x=s.value;h=ze(()=>s.value,A=>{A!==x&&C()},{flush:"sync"})})()):c.value||v(),E&&o?.set(E,L)},{immediate:!0}),cd(v);const w=D(()=>d.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(M,L)=>(b(),N("span",{class:De([[e.node.center?"text-node-center":""],"text-node"])},[si(_("span",{ref_key:"settledTextEl",ref:m},B(f.value),513),[[Eo,u.value!==""]]),si(_("span",{ref_key:"settledAppendsEl",ref:g},null,512),[[Eo,u.value!==""]]),c.value?(b(),N("span",{key:0,class:De(["text-node-stream-delta",[w.value]]),onAnimationend:C},B(c.value),35)):X("",!0)],2))}}),[["__scopeId","data-v-fd79037c"]]);function d0(e,t,n){return ot({name:e,inheritAttrs:!1,setup(i,{attrs:o,slots:s}){var r,l;const a=Hx(),u=zx(),c=jx(),d=typeof window<"u"&&((l=(r=gs())==null?void 0:r.vnode.el)==null?void 0:l.nodeType)===1,f=q(typeof window>"u"||d||!c.value),h=_u(null);let m=null;function g(y){const k=y&&"$el"in y?y.$el:y;h.value=k instanceof HTMLElement?k:null}return typeof window<"u"&&ze([h,c],([y,k],v,C)=>{if(m?.destroy(),m=null,!k||f.value)return void(f.value=!0);if(!y)return;let w=!0;const M=a(y,{rootMargin:u?.value.heavyBlockMargin,allowIdle:!1});m=M,f.value=M.isVisible.value,M.whenVisible.then(()=>{w&&m===M&&(f.value=!0)}),C(()=>{w=!1,M.destroy(),m===M&&(m=null)})},{immediate:!0}),ii(()=>{m?.destroy(),m=null}),()=>Fn(f.value?t:n,Dn(Bt({},o),{ref:g}),s)}})}Fo.install=e=>{e.component(Fo.__name,Fo)};const gb=ot({name:"CodeBlockNodeLoading",inheritAttrs:!1,props:["node","isDark","loading","stream","theme","darkTheme","lightTheme","isShowPreview","monacoOptions","enableFontSizeControl","minWidth","maxWidth","themes","showHeader","showCopyButton","showExpandButton","showPreviewButton","showCollapseButton","showFontSizeButtons","showTooltips","htmlPreviewAllowScripts","htmlPreviewSandbox","customId","estimatedHeightPx","estimatedContentHeightPx","estimatedDiffInline"],emits:["previewCode","copy"],setup(e,{attrs:t}){const n=e;return()=>{var i,o,s,r,l,a,u;const c=U4(String((o=(i=n.node)==null?void 0:i.language)!=null?o:"")),d=ON[c]||(c?c.charAt(0).toUpperCase()+c.slice(1):ON[""]),f=lke(n.node),h=ake(String((r=(s=n.node)==null?void 0:s.raw)!=null?r:""),d,f),m=n.monacoOptions,g=f&&((l=n.estimatedDiffInline)!=null?l:Wx(m??{},typeof window>"u"?0:window.innerWidth)),y=m?.diffAppearance,k=y==="dark"||y!=="light"&&n.isDark===!0,v=typeof m?.fontSize=="number"&&Number.isFinite(m.fontSize)&&m.fontSize>0?m.fontSize:12,C=typeof m?.lineHeight=="number"&&Number.isFinite(m.lineHeight)&&m.lineHeight>0?m.lineHeight:v===12?18:Math.max(12,Math.round(1.5*v)),w=typeof m?.tabSize=="number"&&Number.isFinite(m.tabSize)&&m.tabSize>0?m.tabSize:4,M=f?0:8,L=typeof((a=m?.padding)==null?void 0:a.top)=="number"&&Number.isFinite(m.padding.top)&&m.padding.top>=0?m.padding.top:M,E=typeof((u=m?.padding)==null?void 0:u.bottom)=="number"&&Number.isFinite(m.padding.bottom)&&m.padding.bottom>=0?m.padding.bottom:M,S=typeof m?.fontFamily=="string"?m.fontFamily.trim():"",x=Bt(Bt({fontSize:`${v}px`,lineHeight:`${C}px`,tabSize:w,paddingTop:`${L}px`,paddingBottom:`${E}px`,"--markstream-pre-line-number-top":`${L}px`},f?{"--markstream-pre-diff-line-height":`${C}px`}:{}),S?{"--markstream-code-font-family":S}:{}),A=()=>Fn("button",{class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0","aria-hidden":"true",disabled:!0,tabindex:-1,type:"button"},[Fn("svg",{class:"action-icon",width:"14",height:"14"})]),T=n.isShowPreview!==!1&&(c==="html"||c==="svg"),I=n.showFontSizeButtons!==!1&&n.enableFontSizeControl!==!1||n.showExpandButton!==!1||T&&n.showPreviewButton!==!1,O=R=>{if(R!=null)return typeof R=="number"?`${R}px`:String(R)},H=Bt(Bt(Bt({"--markstream-code-layout-character-width":"1ch"},O(n.minWidth)?{minWidth:O(n.minWidth)}:{}),O(n.maxWidth)?{maxWidth:O(n.maxWidth)}:{}),f?{}:{color:"var(--vscode-editor-foreground, var(--markstream-code-fallback-fg, var(--code-fg)))",backgroundColor:"var(--markstream-code-fallback-bg, var(--code-bg, #fff))",borderColor:"var(--markstream-code-border-color, var(--code-border))"});return Fn("div",Dn(Bt({},t),{class:["code-block-container","rounded-lg","border",{dark:n.isDark===!0,"is-rendering":n.loading!==!1,"is-dark":k,"is-diff":f,"is-plain-text":c===""||c==="plaintext"||c==="text"},t.class],style:[H,t.style],"data-markstream-code-block":"1","data-markstream-enhanced":"false","data-markstream-code-block-state":n.loading?"streaming":"settled","data-markstream-code-loading":"1"}),[n.showHeader===!1?null:Fn("div",{class:"code-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)] border-[var(--code-border)] bg-[var(--code-header-bg)] text-[var(--code-fg)]"},[Fn("div",{class:"code-header-main",style:{minWidth:0,flex:"1 1 auto",display:"flex",alignItems:"center",gap:"var(--ms-gap-header-main, 0.625rem)",overflow:"hidden"}},[Fn("span",{class:"icon-slot h-4 w-4 flex-shrink-0","aria-hidden":"true",style:{display:"inline-flex",width:"1rem",height:"1rem",flex:"0 0 auto"}}),Fn("div",{class:"code-header-copy",style:{minWidth:0,display:"grid",gap:"2px"}},[Fn("div",{class:"code-header-title",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"var(--ms-text-label, 0.75rem)",fontWeight:"500",color:"var(--code-action-fg)"}},h.title),h.caption?Fn("div",{class:"code-header-caption",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"0.75rem",color:"var(--code-line-number)"}},h.caption):null])]),Fn("div",{class:"flex items-center gap-0.5",style:{visibility:"hidden"}},[f?Fn("div",{class:"code-diff-stats","aria-hidden":"true"},[Fn("span",{class:"code-diff-stat removed"},"-0"),Fn("span",{class:"code-diff-stat added"},"+0")]):null,n.showCopyButton===!1?null:A(),n.showCollapseButton===!1?null:A(),I?Fn("div",{class:"relative"},[A()]):null])]),Fn("div",{class:"code-block-shell-content",style:n.stream!==!1||n.loading===!1?void 0:{display:"none"}},[Fn(bl,{node:n.node,loading:n.loading,showLineNumbers:!0,reservedHeightPx:f?void 0:n.estimatedContentHeightPx,diffInline:g,diffHideUnchangedRegions:f?rke(m?.diffHideUnchangedRegions):void 0,class:"code-pre-fallback",style:x,"data-markstream-code-loading":"1"})]),Fn("div",{class:"code-loading-placeholder",style:n.stream===!1&&n.loading!==!1?void 0:{display:"none"}},[Fn("div",{class:"loading-skeleton"},[Fn("div",{class:"skeleton-line"}),Fn("div",{class:"skeleton-line"}),Fn("div",{class:"skeleton-line short"})])]),Fn("span",{class:"sr-only","aria-live":"polite",role:"status"})])}}}),k8=d0("ViewportDeferredCodeBlockNode",Xu({loader:()=>io(null,null,function*(){try{return(yield qo(()=>import("./CodeBlockNode-Dh6YGbd1.js"),__vite__mapDeps([4,5]))).default}catch(e){return console.warn('[markstream-vue] Failed to load the enhanced CodeBlockNode chunk; falling back to preformatted code rendering. Enhanced code blocks require the optional "stream-diffs" peer (or "stream-monaco" as a fallback).',e),bl}}),loadingComponent:gb,delay:0,suspensible:!1}),gb),Iu=Xu(()=>io(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,i,o,s;return Fn(Fo,Dn(Bt({},t),{node:{type:"text",content:(i=t.node.raw)!=null?i:`$${(n=t.node.content)!=null?n:""}$`,raw:(s=t.node.raw)!=null?s:`$${(o=t.node.content)!=null?o:""}$`}}))};try{return yield fq(),(yield qo(()=>import("./index7-CreDRl0J.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,i,o,s;return Fn(Fo,Dn(Bt({},t),{node:{type:"text",content:(i=t.node.raw)!=null?i:`$${(n=t.node.content)!=null?n:""}$`,raw:(s=t.node.raw)!=null?s:`$${(o=t.node.content)!=null?o:""}$`}}))}})),_q=Xu(()=>io(null,null,function*(){try{return yield fq(),(yield qo(()=>import("./index6-BTRYPHWD.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,i,o;return Fn(Fo,Dn(Bt({},e),{node:{type:"text",content:(n=e.node.raw)!=null?n:`$$${(t=e.node.content)!=null?t:""}$$`,raw:(o=e.node.raw)!=null?o:`$$${(i=e.node.content)!=null?i:""}$$`}}))}})),Qr=Ei(ot({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(b(),N("span",{class:"reference-node cursor-pointer text-xs rounded-md px-1.5 mx-0.5",role:"button",tabindex:"0",onClick:n[0]||(n[0]=i=>t.$emit("click",i,e.node.id,e.messageId,e.threadId)),onMouseenter:n[1]||(n[1]=i=>t.$emit("mouseEnter",i,e.node.id,e.messageId,e.threadId)),onMouseleave:n[2]||(n[2]=i=>t.$emit("mouseLeave",i,e.node.id,e.messageId,e.threadId))},B(e.node.id),33))}),[["__scopeId","data-v-775c65e4"]]);Qr.install=e=>{e.component(Qr.__name,Qr)};const yke={class:"superscript-node"},Ml=Ei(ot({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=vs(()=>t.customId),i=D(()=>Bt({text:Fo,inline_code:Er,link:Xr,html_inline:aa,strong:Yr,emphasis:el,footnote_reference:la,strikethrough:Jr,highlight:ua,insert:El,subscript:Tl,emoji:Il,math_inline:Iu,reference:Qr},n.value));return(o,s)=>(b(),N("sup",yke,[(b(!0),N(Le,null,Ct(e.node.children,(r,l)=>(b(),fe(p(yc),{key:`${e.indexKey||"superscript"}-${l}`,components:i.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"]]);Ml.install=e=>{e.component(Ml.__name,Ml)};const kke={class:"subscript-node"},Tl=Ei(ot({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=vs(()=>t.customId),i=D(()=>Bt({text:Fo,inline_code:Er,link:Xr,html_inline:aa,strong:Yr,emphasis:el,footnote_reference:la,strikethrough:Jr,highlight:ua,insert:El,superscript:Ml,emoji:Il,math_inline:Iu,reference:Qr},n.value));return(o,s)=>(b(),N("sub",kke,[(b(!0),N(Le,null,Ct(e.node.children,(r,l)=>(b(),fe(p(yc),{key:`${e.indexKey||"subscript"}-${l}`,components:i.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"]]);Tl.install=e=>{e.component(Tl.__name,Tl)};const bke={class:"strong-node"},Yr=Ei(ot({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=vs(()=>t.customId),i=D(()=>Bt({text:Fo,inline_code:Er,link:Xr,html_inline:aa,emphasis:el,strikethrough:Jr,highlight:ua,insert:El,subscript:Tl,superscript:Ml,emoji:Il,footnote_reference:la,math_inline:Iu,reference:Qr},n.value));return(o,s)=>(b(),N("strong",bke,[(b(!0),N(Le,null,Ct(e.node.children,(r,l)=>(b(),fe(p(yc),{key:`${e.indexKey||"strong"}-${l}`,components:i.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"]]);Yr.install=e=>{e.component(Yr.__name,Yr)};const wke={class:"strikethrough-node"},Jr=Ei(ot({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=vs(()=>t.customId),i=D(()=>Bt({text:Fo,inline_code:Er,link:Xr,html_inline:aa,strong:Yr,emphasis:el,highlight:ua,insert:El,subscript:Tl,superscript:Ml,emoji:Il,footnote_reference:la,math_inline:Iu,reference:Qr},n.value));return(o,s)=>(b(),N("del",wke,[(b(!0),N(Le,null,Ct(e.node.children,(r,l)=>(b(),fe(p(yc),{key:`${e.indexKey||"strikethrough"}-${l}`,components:i.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"]]);Jr.install=e=>{e.component(Jr.__name,Jr)};const Cke=["href","title","aria-label","aria-hidden","target","rel"],Ake=["aria-hidden"],xke={class:"link-text-wrapper relative inline-flex"},Ske={class:"leading-[normal] link-text"},Xr=Ei(ot({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=en("markstreamShowTooltips",void 0),i=D(()=>{const k=n?.value;return typeof k=="boolean"?k:t.showTooltip}),o=D(()=>{var k,v,C,w,M;const L=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",E=(k=t.animationOpacity)!=null?k:.35,S=Math.max(.12,Math.min(.5*E,E)),x={"--underline-height":`${(v=t.underlineHeight)!=null?v:2}px`,"--underline-bottom":L,"--underline-opacity":String(E),"--underline-rest-opacity":String(S),"--underline-duration":`${(C=t.animationDuration)!=null?C:1.6}s`,"--underline-timing":(w=t.animationTiming)!=null?w:"ease-in-out","--underline-iteration":typeof t.animationIteration=="number"?String(t.animationIteration):(M=t.animationIteration)!=null?M:"infinite"};return t.color&&(x["--link-color"]=t.color),x}),s=vs(()=>t.customId),r=D(()=>Bt({text:Fo,strong:Yr,strikethrough:Jr,emphasis:el,image:df,html_inline:aa,inline_code:Er},s.value)),l=qm(),a=D(()=>{var k,v;const C=(k=t.node)==null?void 0:k.attrs;if(!C||typeof C!="object")return{};const w={};if(Array.isArray(C))for(const M of C)Array.isArray(M)&&M[0]&&(w[String(M[0])]=String((v=M[1])!=null?v:""));else for(const[M,L]of Object.entries(C))M&&L!=null&&L!==!1&&(w[M]=L===!0?"":String(L));return GN(w,"safe","a")}),u=D(()=>Bt(Bt({},l),a.value)),c=D(()=>{var k,v;return GN({href:String((v=(k=t.node)==null?void 0:k.href)!=null?v:"")},"safe","a").href}),d=D(()=>{if(!c.value)return;const k=u.value.target;return(typeof k=="string"?k.trim():String(k??"").trim())||(lme(c.value)?"_blank":void 0)}),f=D(()=>{var k;return String((k=d.value)!=null?k:"").trim().toLowerCase()==="_blank"}),h=D(()=>{if(!c.value)return;const k=u.value.rel,v=new Set((typeof k=="string"?k:String(k??"")).split(/\s+/).filter(Boolean)),C=new Set(Array.from(v).filter(w=>w.toLowerCase()!=="opener"));return f.value&&(C.add("noopener"),C.add("noreferrer")),C.size>0?Array.from(C).join(" "):void 0}),m=D(()=>{const k=Bt({},u.value);return delete k.title,delete k.href,delete k.target,delete k.rel,k});function g(){i.value&&U9e()}const y=D(()=>{var k,v;const C=(k=t.node)==null?void 0:k.title;return typeof C=="string"&&C.trim().length>0?C:String((v=c.value)!=null?v:"")});return(k,v)=>{var C,w;return e.node.loading?(b(),N("span",ci({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},p(l),{style:o.value}),[_("span",xke,[_("span",Ske,[V(p(Fo),{class:"leading-[normal] link-text",node:{type:"text",content:String((C=e.node.text)!=null?C:""),raw:String((w=e.node.text)!=null?w:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),v[1]||(v[1]=_("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,Ake)):(b(),N("a",ci({key:0,class:"link-node",href:c.value,title:i.value?"":y.value,"aria-label":`Link: ${y.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:h.value},m.value,{style:o.value,onMouseenter:v[0]||(v[0]=M=>(function(L){var E,S,x,A;if(!i.value)return;const T=L,I=T?.clientX!=null&&T?.clientY!=null?{x:T.clientX,y:T.clientY}:void 0,O=((E=t.node)==null?void 0:E.title)||((S=c.value)!=null&&S.includes("xn--")&&((A=(x=t.node)==null?void 0:x.text)!=null&&A.includes("://"))?t.node.text:c.value)||"";q9e(L.currentTarget,O,"top",!1,I)})(M)),onMouseleave:g}),[(b(!0),N(Le,null,Ct(e.node.children,(M,L)=>(b(),fe(p(yc),{key:`${e.indexKey||"emphasis"}-${L}`,components:r.value,node:M,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${L}`},null,8,["components","node","custom-id","index-key"]))),128))],16,Cke))}}}),[["__scopeId","data-v-367e6ca4"]]);Xr.install=e=>{e.component(Xr.__name,Xr)};const _ke={class:"insert-node"},El=Ei(ot({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=vs(()=>t.customId),i=D(()=>Bt({text:Fo,inline_code:Er,link:Xr,html_inline:aa,strong:Yr,emphasis:el,strikethrough:Jr,highlight:ua,subscript:Tl,superscript:Ml,emoji:Il,footnote_reference:la,math_inline:Iu,reference:Qr},n.value));return(o,s)=>(b(),N("ins",_ke,[(b(!0),N(Le,null,Ct(e.node.children,(r,l)=>(b(),fe(p(yc),{key:`${e.indexKey||"insert"}-${l}`,components:i.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"]]);El.install=e=>{e.component(El.__name,El)};const Ike={class:"highlight-node"},ua=Ei(ot({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=vs(()=>t.customId),i=D(()=>Bt({text:Fo,inline_code:Er,link:Xr,html_inline:aa,strong:Yr,emphasis:el,strikethrough:Jr,insert:El,subscript:Tl,superscript:Ml,emoji:Il,footnote_reference:la,math_inline:Iu,reference:Qr},n.value));return(o,s)=>(b(),N("mark",Ike,[(b(!0),N(Le,null,Ct(e.node.children,(r,l)=>(b(),fe(p(yc),{key:`${e.indexKey||"highlight"}-${l}`,components:i.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"]]);ua.install=e=>{e.component(ua.__name,ua)};const Mke={class:"emphasis-node"},el=Ei(ot({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=vs(()=>t.customId),i=D(()=>Bt({text:Fo,inline_code:Er,link:Xr,html_inline:aa,strong:Yr,strikethrough:Jr,highlight:ua,insert:El,subscript:Tl,superscript:Ml,emoji:Il,footnote_reference:la,math_inline:Iu,reference:Qr},n.value));return(o,s)=>(b(),N("em",Mke,[(b(!0),N(Le,null,Ct(e.node.children,(r,l)=>(b(),fe(p(yc),{key:`${e.indexKey||"emphasis"}-${l}`,components:i.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"]]);el.install=e=>{e.component(el.__name,el)};const Tke={class:"hard-break"},ff=Ei(ot({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(b(),N("br",Tke))}),[["__scopeId","data-v-50c58f70"]]);ff.install=e=>{e.component(ff.__name,ff)};const Pv=ot({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=Lt({checkbox:ra,checkbox_input:ra,emoji:Il,emphasis:el,hardbreak:ff,highlight:ua,inline_code:Er,insert:El,link:Xr,reference:Qr,strikethrough:Jr,strong:Yr,subscript:Tl,superscript:Ml,text:Fo}),i=vs(()=>t.customId),o=D(()=>{const s=i.value;return Object.keys(s).length>0?Bt(Bt({},n),s):n});return(s,r)=>(b(!0),N(Le,null,Ct(e.nodes,(l,a)=>(b(),fe(p(yc),{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 BA(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(BA)}function vb(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(BA))return e;if(!t||e.length!==1)return null;const i=e[0];if(i?.type!=="paragraph"||!Array.isArray(i.children))return null;const o=i.children;return(n||o.length>0)&&o.every(BA)?o:null}function vp(e){var t,n;if(!e?.length)return null;let i="";for(const o of e){if(o?.type!=="text"||o.center===!0)return null;i+=String((n=(t=o.content)!=null?t:o.raw)!=null?n:"")}return i}const Eke=["cite"],Lke={key:0,dir:"auto",class:"paragraph-node"},Nke=["custom-id"],j9=Ei(ot({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=vs(()=>t.customId),i=D(()=>!!n.value.paragraph),o=D(()=>!!n.value.text),s=D(()=>vb(t.node.children,!i.value)),r=D(()=>t.fade!==!1||o.value?null:vp(s.value));return Gn("markstreamShowTooltips",D(()=>t.showTooltips)),Gn("markstreamFade",D(()=>t.fade)),(l,a)=>(b(),N("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[s.value?(b(),N("p",Lke,[r.value!==null?(b(),N("span",{key:0,class:"text-node","custom-id":t.customId},B(r.value),9,Nke)):(b(),fe(p(Pv),{key:1,nodes:s.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(b(),fe(p(Ll),{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]=u=>l.$emit("copy",u))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade"]))],8,Eke))}}),[["__scopeId","data-v-abfecebc"]]);j9.install=e=>{e.component(j9.__name,j9)};const Fke={class:"definition-list"},Dke={class:"definition-term"},Rke={class:"definition-desc"},H9=Ei(ot({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,i)=>(b(),N("dl",Fke,[(b(!0),N(Le,null,Ct(t.node.items,(o,s)=>(b(),N(Le,{key:s},[_("dt",Dke,[V(p(Ll),{"index-key":`definition-term-${t.indexKey}-${s}`,nodes:o.term,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:i[0]||(i[0]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])]),_("dd",Rke,[V(p(Ll),{"index-key":`definition-desc-${t.indexKey}-${s}`,nodes:o.definition,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:i[1]||(i[1]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],64))),128))]))}}),[["__scopeId","data-v-4e103b30"]]);H9.install=e=>{e.component(H9.__name,H9)};const Oke=["href","title"],K0=Ei(ot({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const t=e;function n(i){var o;if(i.preventDefault(),typeof document>"u")return;const s=`fnref-${String((o=t.node.id)!=null?o:"")}`,r=document.getElementById(s);r&&r.scrollIntoView({behavior:"smooth",block:"center"})}return(i,o)=>(b(),N("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,Oke))}}),[["__scopeId","data-v-e1eb37b6"]]);K0.install=e=>{e.component(K0.__name,K0)};const Pke=["id"],Bke={class:"flex-1"},W9=ot({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,i)=>(b(),N("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[_("div",Bke,[V(p(Ll),{"index-key":`footnote-${t.indexKey}`,nodes:t.node.children,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:i[0]||(i[0]=o=>n.$emit("copy",o))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],8,Pke))}});W9.install=e=>{e.component(W9.__name,W9)};const $ke=["custom-id"],$A=Ei(ot({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=vs(()=>t.customId),i=en("markstreamFade",void 0),o=D(()=>i?.value!==!1||n.value.text?null:vp(t.node.children)),s=D(()=>Bt({text:Fo,inline_code:Er,link:Xr,image:df,strong:Yr,emphasis:el,strikethrough:Jr,highlight:ua,insert:El,subscript:Tl,superscript:Ml,emoji:Il,checkbox:ra,checkbox_input:ra,footnote_reference:la,hardbreak:ff,math_inline:Iu,reference:Qr},n.value));return(r,l)=>(b(),fe(To(`h${e.node.level}`),ci({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:de(()=>[o.value!==null?(b(),N("span",{key:0,class:"text-node","custom-id":t.customId},B(o.value),9,$ke)):(b(!0),N(Le,{key:1},Ct(e.node.children,(a,u)=>(b(),fe(p(yc),{key:u,components:s.value,"custom-id":t.customId,node:a,"index-key":`${e.indexKey||"heading"}-${u}`},null,8,["components","custom-id","node","index-key"]))),128))]),_:1},16,["class"]))}}),[["__scopeId","data-v-7122dbe1"]]),Z4=$A;Z4.install=e=>{e.component($A.__name,$A)};const zke={key:0,dir:"auto",class:"paragraph-node"},jke=["custom-id"],Hke={dir:"auto",class:"paragraph-node"},Wke=["custom-id"],am=Ei(ot({__name:"ListItemNode",props:{node:{},item:{},indexKey:{},customId:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},value:{},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=D(()=>{var h;return(h=t.node)!=null?h:t.item}),i=vs(()=>t.customId),o=D(()=>!!i.value.paragraph),s=D(()=>!!i.value.text),r=D(()=>{var h;return vb((h=n.value)==null?void 0:h.children,!o.value)}),l=D(()=>{var h;if(o.value)return null;const m=(h=n.value)==null?void 0:h.children;if(!Array.isArray(m)||m.length<2)return null;const g=m[0];if(g?.type!=="paragraph"||!Array.isArray(g.children))return null;const y=m.slice(1);if(!y.every(v=>v?.type==="list"))return null;const k=vb([g]);return k?{paragraphChildren:k,nestedLists:y}:null});function a(){return t.fade===!1&&!s.value}const u=D(()=>a()?vp(r.value):null),c=D(()=>{var h;return a()?vp((h=l.value)==null?void 0:h.paragraphChildren):null}),d=Object.freeze({}),f=D(()=>{const{value:h}=t;return typeof h=="number"&&Number.isFinite(h)?{value:h}:d});return Gn("markstreamShowTooltips",D(()=>t.showTooltips)),Gn("markstreamFade",D(()=>t.fade)),(h,m)=>{var g,y;return b(),N("li",ci({class:"list-item",dir:"auto"},f.value),[r.value?(b(),N("p",zke,[u.value!==null?(b(),N("span",{key:0,class:"text-node","custom-id":t.customId},B(u.value),9,jke)):(b(),fe(p(Pv),{key:1,nodes:r.value,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):l.value?(b(),N(Le,{key:1},[_("p",Hke,[c.value!==null?(b(),N("span",{key:0,class:"text-node","custom-id":t.customId},B(c.value),9,Wke)):(b(),fe(p(Pv),{key:1,nodes:l.value.paragraphChildren,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))]),(b(!0),N(Le,null,Ct(l.value.nestedLists,(k,v)=>(b(),fe(p(Ll),{key:v,nodes:[k],"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-nested-${v}`,"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:m[0]||(m[0]=C=>h.$emit("copy",C))},null,8,["nodes","custom-id","index-key","show-tooltips","typewriter","fade","is-dark"]))),128))],64)):(b(),fe(p(Ll),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(y=(g=n.value)==null?void 0:g.children)!=null?y:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,onCopy:m[1]||(m[1]=k=>h.$emit("copy",k))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade","is-dark"]))],16)}}}),[["__scopeId","data-v-617214f9"]]);am.install=e=>{e.component(am.__name,am)};const um=Ei(ot({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=vs(()=>e.customId),n=D(()=>t.value.list_item||am);return(i,o)=>(b(),fe(To(e.node.ordered?"ol":"ul"),{class:De(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:de(()=>[(b(!0),N(Le,null,Ct(e.node.items,(s,r)=>{var l;return b(),fe(To(n.value),ci({key:`${e.indexKey||"list"}-${r}`},{ref_for:!0},{showTooltips:e.showTooltips},{node:s,"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=>i.$emit("copy",a))}),null,16,["node","custom-id","index-key","typewriter","fade","is-dark","value"])}),128))]),_:1},8,["class"]))}}),[["__scopeId","data-v-99cb95e0"]]);um.install=e=>{e.component(um.__name,um)};const qke={key:2,class:"html-block-node__raw"},Uke=["innerHTML"],Vke={key:1,class:"html-block-node__placeholder"},Z0=Ei(ot({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=en("markstreamHtmlPolicy",void 0),i=en("markstreamNestedRendererProps",void 0),o=D(()=>{var I,O;return(O=(I=t.htmlPolicy)!=null?I:n?.value)!=null?O:"safe"}),s=D(()=>{var I,O;const H=(I=i?.value)!=null?I:{};return Dn(Bt({},H),{customId:(O=t.customId)!=null?O:H.customId,htmlPolicy:o.value})}),r=Xu({loader:()=>Promise.resolve().then(()=>Xx),suspensible:!1}),l=D(()=>{const I=P9(t.node.attrs,o.value);if(!I)return;const O=W0(I);return Object.keys(O).length>0?O:void 0}),a=D(()=>{const I=String(t.node.tag||"").trim(),O=P9(t.node.attrs,o.value,I);if(!O)return;const H=W0(O);return Object.keys(H).length>0?H:void 0}),u=vs(()=>t.customId),c=ot({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=q(null),f=q(typeof window>"u"),h=q(t.node.content),m=D(()=>Array.isArray(t.node.children)?t.node.children:[]),g=D(()=>String(t.node.tag||"div")),y=D(()=>{var I;if(g.value.trim().toLowerCase()!=="details"||(I=t.node.attrs)!=null&&I.some(([H])=>String(H).toLowerCase()==="open"))return null;const O=m.value[0];return O?.type==="html_block"&&String(O.tag||"").toLowerCase()==="summary"?O:null}),k=D(()=>{var I;return vp((I=y.value)==null?void 0:I.children)}),v=D(()=>{const I=y.value;if(!I)return;const O=P9(I.attrs,o.value,"summary");if(!O)return;const H=W0(O);return Object.keys(H).length>0?H:void 0}),C=D(()=>k.value==null?m.value:m.value.slice(1)),w=D(()=>{const I=g.value.trim().toLowerCase();return VH.has(I)||Dx(I,o.value)}),M=D(()=>m.value.length>0&&!!t.node.tag&&!w.value),L=D(()=>{var I,O,H;if(M.value)return{mode:"structured"};if(!f.value)return{mode:"html",content:(I=h.value)!=null?I:""};const R=(O=h.value)!=null?O:t.node.content;if(!R)return{mode:"html",content:""};if(o.value==="escape")return{mode:"html",content:lm(R,o.value)};if(t.node.loading){const P=mb(R,u.value,o.value);return P===null?{mode:"text",content:(H=t.node.raw)!=null?H:R}:{mode:"dynamic",nodes:P}}if(!kq(R,u.value))return{mode:"html",content:lm(R,o.value)};const F=mb(R,u.value,o.value);return F===null?{mode:"html",content:lm(R,o.value)}:{mode:"dynamic",nodes:F}}),E=Hx(),S=zx(),x=jx(),A=_u(null),T=!!t.node.loading;return typeof window<"u"?(ze([()=>d.value,()=>S?.value.heavyBlockMargin,()=>S?.value.rootMargin],([I],O,H)=>{var R,F,P,z;if((F=(R=A.value)==null?void 0:R.destroy)==null||F.call(R),A.value=null,!T)return f.value=!0,void(h.value=t.node.content);if(!I)return void(f.value=!1);let W=!0;const $=(z=(P=S?.value.heavyBlockMargin)!=null?P:S?.value.rootMargin)!=null?z:gp,K=E(I,{rootMargin:$,allowIdle:!x.value});A.value=K,f.value=f.value||K.isVisible.value,K.whenVisible.then(()=>{W&&A.value===K&&(f.value=!0)}),H(()=>{W=!1,K.destroy(),A.value===K&&(A.value=null)})},{immediate:!0}),ze(()=>t.node.content,I=>{T&&!f.value||(h.value=I)})):f.value=!0,ii(()=>{var I,O;(O=(I=A.value)==null?void 0:I.destroy)==null||O.call(I),A.value=null}),(I,O)=>(b(),fe(To(M.value?g.value:"div"),ci({ref_key:"htmlRef",ref:d,class:"html-block-node","data-markstream-viewport-pending":p(x)&&!f.value?"true":void 0},M.value?a.value:void 0),{default:de(()=>[f.value?(b(),N(Le,{key:0},[L.value.mode==="structured"?(b(),N(Le,{key:0},[k.value!==null?(b(),N(Le,{key:0},[_("summary",iJ(C$(v.value)),B(k.value),17),C.value.length?(b(),fe(p(r),ci({key:0},s.value,{nodes:C.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):X("",!0)],64)):(b(),fe(p(r),ci({key:1},s.value,{nodes:m.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"]))],64)):L.value.mode==="dynamic"?(b(),fe(p(c),{key:1,nodes:L.value.nodes},null,8,["nodes"])):L.value.mode==="text"?(b(),N("pre",qke,B(L.value.content),1)):(b(),N("div",ci({key:3},l.value,{innerHTML:L.value.content}),null,16,Uke))],64)):(b(),N("div",Vke,[Hn(I.$slots,"placeholder",{node:e.node},()=>[O[0]||(O[0]=_("span",{class:"html-block-node__placeholder-bar"},null,-1)),O[1]||(O[1]=_("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),O[2]||(O[2]=_("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16,["data-markstream-viewport-pending"]))}}),[["__scopeId","data-v-e140a874"]]);Z0.install=e=>{e.component(Z0.__name,Z0)};const Kke={dir:"auto",class:"paragraph-node"},Zke=["custom-id"],rp=Ei(ot({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=vs(()=>t.customId),i=en("markstreamHtmlPolicy",void 0),o=en("markstreamFade",void 0),s=en("markstreamParseOptions",void 0),r=en("markstreamCustomMarkdownIt",void 0),l=en("markstreamNestedRendererProps",void 0),a=D(()=>{var S;return(S=i?.value)!=null?S:"safe"}),u=D(()=>{var S;return(S=t.parseOptions)!=null?S:s?.value}),c=D(()=>{var S;return(S=t.customMarkdownIt)!=null?S:r?.value}),d=D(()=>{var S,x;return(x=t.customHtmlTags)!=null?x:(S=l?.value)==null?void 0:S.customHtmlTags}),f=D(()=>{var S,x;const A=(S=l?.value)!=null?S:{};return Dn(Bt({},A),{customId:(x=t.customId)!=null?x:A.customId,customHtmlTags:d.value,parseOptions:u.value,customMarkdownIt:c.value,htmlPolicy:a.value})}),h=Xu({loader:()=>Promise.resolve().then(()=>Xx),suspensible:!1});function m(S){var x;return S.type==="text"&&String((x=S.content)!=null?x:"").trim()===""}const g=D(()=>t.node.children.filter(S=>!m(S))),y=D(()=>g.value.length>0&&g.value.every(S=>S.type==="image"||(function(x){var A;const T=(function(I){return I.type==="link"&&Array.isArray(I.children)?I.children.filter(O=>!m(O)):[]})(x);return T.length===1&&((A=T[0])==null?void 0:A.type)==="image"})(S))),k=D(()=>new Set(Np(d.value))),v=D(()=>{if(!y.value||g.value.length<=1)return t.node.children;const S=[];for(let x=0;x0,I=t.node.children.slice(x+1).some(O=>!m(O));T&&I&&S.push(Dn(Bt({},A),{content:" ",raw:" "}))}return S}),C=D(()=>o?.value===!1&&!n.value.text),w=D(()=>C.value?vp(v.value):null);function M(S,x){return{node:S,"index-key":`${t.indexKey}-${x}`,"custom-id":t.customId,"custom-html-tags":d.value}}const L=D(()=>Bt({inline_code:Er,image:df,link:Xr,hardbreak:ff,emphasis:el,strong:Yr,strikethrough:Jr,highlight:ua,insert:El,subscript:Tl,superscript:Ml,html_inline:aa,html_block:Z0,emoji:Il,checkbox:ra,math_inline:Iu,checkbox_input:ra,reference:Qr,footnote_anchor:K0,footnote_reference:la,text:Fo},n.value)),E=D(()=>v.value.map((S,x)=>{var A;const T=(function(I){var O,H,R,F;if(I.type==="html_block"||I.type==="html_inline"){const P=String((O=I.tag)!=null?O:"").trim().toLowerCase()||YH(I.content);if(P&&!k.value.has(P)&&JH((H=I.content)!=null?H:I.raw,P)){const z=String((F=(R=I.content)!=null?R:I.raw)!=null?F:"");return{child:{type:"text",content:z,raw:z},component:Fo,isCustomComponent:!1}}}return{child:I,component:L.value[I.type],isCustomComponent:!!(n.value[I.type]&&!v2(String(I.type)))}})(S);return Dn(Bt({},T),{index:x,key:`${t.indexKey||"paragraph"}-${x}`,customAttrs:T.isCustomComponent?$x(T.child,a.value):void 0,hasSlotChildren:Array.isArray(T.child.children)&&T.child.children.length>0,slotContent:String((A=T.child.content)!=null?A:""),originalChild:S})}));return(S,x)=>(b(),N("p",Kke,[w.value!==null?(b(),N("span",{key:0,class:"text-node","custom-id":t.customId},B(w.value),9,Zke)):(b(!0),N(Le,{key:1},Ct(E.value,A=>{return b(),N(Le,{key:A.key},[y.value&&m(A.originalChild)?(b(),N(Le,{key:0},[Be(B((T=A.originalChild,String((I=T.content)!=null?I:""))),1)],64)):A.isCustomComponent?(b(),fe(To(A.component),ci({key:1,ref_for:!0},A.customAttrs,{node:A.child,loading:A.child.loading,"index-key":A.key,"custom-id":t.customId,"custom-html-tags":d.value,"is-dark":f.value.isDark}),{default:de(()=>[A.hasSlotChildren?(b(),fe(p(h),ci({key:0,ref_for:!0},f.value,{nodes:A.child.children,"index-key":A.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):A.slotContent?(b(),fe(p(h),ci({key:1,ref_for:!0},f.value,{content:A.slotContent,final:!A.child.loading,"index-key":`${A.key}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):X("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(b(),fe(To(A.component),ci({key:2,ref_for:!0},M(A.child,A.index)),null,16))],64);var T,I}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);rp.install=e=>{e.component(rp.__name,rp)};const Gke={class:"table-node-wrapper"},Qke=["aria-busy"],Yke={key:0},Jke=["custom-id"],Xke=["aria-label","onPointerdown"],ebe=["custom-id"],tbe={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},G0=Ei(ot({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=D(()=>{var k;return(k=t.node.loading)!=null&&k}),i=D(()=>{var k;return(k=t.node.rows)!=null?k:[]}),o=q(null),s=q([]);let r=null;const l=D(()=>t.node.header.cells.length),a=D(()=>s.value.some(k=>Number.isFinite(k)&&k>0)),u=D(()=>a.value?s.value.map(k=>k>0?{width:`${k}px`}:void 0):[]);Gn("markstreamShowTooltips",D(()=>t.showTooltips)),Gn("markstreamFade",D(()=>t.fade));const c=vs(()=>t.customId),d=D(()=>!!c.value.text),f=D(()=>!!c.value.paragraph),h=new WeakMap;function m(k){const v=t.fade===!1&&!d.value,C=!f.value,w=h.get(k);if(w?.children===k.children&&w.textFastPath===v&&w.paragraphFastPath===C)return w.info;const M=vb(k.children,C,!0),L={simpleChildren:M,plainText:M&&v?vp(M):null};return h.set(k,{children:k.children,textFastPath:v,paragraphFastPath:C,info:L}),L}function g(k){if(!r)return;k.preventDefault();const v=r.startWidth+r.nextStartWidth,C=Math.min(48,Math.floor(v/2)),w=Math.max(C,Math.min(v-C,Math.round(r.startWidth+k.clientX-r.startX))),M=[...r.widths];M[r.index]=w,M[r.index+1]=v-w,s.value=M}function y(){r&&(window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",y),r=null)}return ze(l,()=>{y(),s.value=[]}),ii(y),(k,v)=>(b(),N("div",Gke,[_("table",{ref_key:"tableRef",ref:o,class:De(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(b(),N("colgroup",Yke,[(b(!0),N(Le,null,Ct(e.node.header.cells,(C,w)=>(b(),N("col",{key:w,style:on(u.value[w])},null,4))),128))])):X("",!0),_("thead",null,[_("tr",null,[(b(!0),N(Le,null,Ct(e.node.header.cells,(C,w)=>(b(),N("th",{key:w,dir:"auto",class:De([C.align==="right"?"text-right":C.align==="center"?"text-center":"text-left"])},[m(C).plainText!==null?(b(),N("span",{key:0,class:"text-node","custom-id":t.customId},B(m(C).plainText),9,Jke)):m(C).simpleChildren?(b(),fe(p(Pv),{key:1,nodes:m(C).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${w}`},null,8,["nodes","custom-id","index-key"])):(b(),fe(p(Ll),{key:2,nodes:C.children,"index-key":`table-th-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:v[0]||(v[0]=M=>k.$emit("copy",M))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),w(function(L,E){if(E.button!==0)return;const S=(function(){var T;const I=(T=o.value)==null?void 0:T.querySelectorAll("thead th");return Array.from(I??[],O=>Math.round(O.getBoundingClientRect().width))})(),x=S[L],A=S[L+1];x&&A&&(E.preventDefault(),r={index:L,startX:E.clientX,startWidth:x,nextStartWidth:A,widths:S},s.value=S,window.addEventListener("pointermove",g),window.addEventListener("pointerup",y),window.addEventListener("pointercancel",y))})(w,M)},null,40,Xke)):X("",!0)],2))),128))])]),_("tbody",null,[(b(!0),N(Le,null,Ct(i.value,(C,w)=>(b(),N("tr",{key:w},[(b(!0),N(Le,null,Ct(C.cells,(M,L)=>(b(),N("td",{key:L,class:De([M.align==="right"?"text-right":M.align==="center"?"text-center":"text-left"]),dir:"auto"},[m(M).plainText!==null?(b(),N("span",{key:0,class:"text-node","custom-id":t.customId},B(m(M).plainText),9,ebe)):m(M).simpleChildren?(b(),fe(p(Pv),{key:1,nodes:m(M).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${w}-${L}`},null,8,["nodes","custom-id","index-key"])):(b(),fe(p(Ll),{key:2,nodes:M.children,"index-key":`table-td-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:v[1]||(v[1]=E=>k.$emit("copy",E))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,Qke),V(mo,{name:"table-node-fade"},{default:de(()=>[n.value?(b(),N("div",tbe,[Hn(k.$slots,"loading",{isLoading:n.value},()=>[v[2]||(v[2]=_("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),v[3]||(v[3]=_("span",{class:"sr-only"},"Loading",-1))],!0)])):X("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);G0.install=e=>{e.component(G0.__name,G0)};const nbe={class:"hr-node"},q9=Ei({},[["render",function(e,t){return b(),N("hr",nbe)}],["__scopeId","data-v-39b2349c"]]);q9.install=e=>{e.component(q9.__name,q9)};const ibe={class:"unknown-node"},zA=ot({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(b(),N("div",ibe,B(e.node.raw),1))}),U9=Ei(ot({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){const t=e,n=D(()=>`vmr-container vmr-container-${t.node.name}`),i=vs(()=>t.customId),o=D(()=>Bt({text:Fo,paragraph:rp,heading:Z4,inline_code:Er,link:Xr,image:df,strong:Yr,emphasis:el,strikethrough:Jr,insert:El,subscript:Tl,superscript:Ml,checkbox:ra,checkbox_input:ra,hardbreak:ff,math_inline:Iu,reference:Qr,list:um,math_block:_q,table:G0},i.value));return(s,r)=>(b(),N("div",ci({class:n.value},e.node.attrs),[(b(!0),N(Le,null,Ct(e.node.children,(l,a)=>{return b(),fe(To((u=l.type,o.value[u]||zA)),{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 u}),128))],16))}}),[["__scopeId","data-v-911e41c4"]]);U9.install=e=>{e.component(U9.__name,U9)};const obe=["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"],oF=[[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 sbe(e){if(e<=255)return obe[e];let t=0,n=oF.length-1;for(;t<=n;){const i=t+n>>1,o=oF[i];if(eo[1]))return o[2];t=i+1}}return"L"}const rbe=/[ \t\n\r\f]+/g,lbe=/[\t\n\r\f]| {2,}|^ | $/;let b8=null;const abe=new RegExp("\\p{Script=Arabic}","u"),Mf=new RegExp("\\p{M}","u"),qx=new RegExp("\\p{Nd}","u");function sF(e){return abe.test(e)}function rF(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=183984&&e<=191471||e>=191472&&e<=192093||e>=194560&&e<=195103||e>=196608&&e<=201551||e>=201552&&e<=205743||e>=205744&&e<=210041||e>=63744&&e<=64255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=12592&&e<=12687||e>=44032&&e<=55215||e>=65280&&e<=65519}function tc(e){for(let t=0;t=55296&&n<=56319&&t+1=56320&&i<=57343){if(rF(i-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(rF(n))return!0}}return!1}const ube=new Set([" "," ","⁠","\uFEFF"]),cbe=new Set(["-","‐","–","—"]);function Iq(e,t){return!((function(n){const i=Q0(n);return i!==null&&ube.has(i)})(e)||t&&((function(n){const i=Q0(n);return i!==null&&(Ux.has(i)||yp.has(i))})(e)||(function(n){const i=Q0(n);return i!==null&&cbe.has(i)})(e)))}const Ux=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),G4=new Set(['"',"(","[","{","¡","¿","“","‘","‚","„","«","‹","⸘","(","〔","〈","《","「","『","【","〖","〘","〚"]),Vx=new Set(["'","’"]),yp=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),dbe=new Set([":",".","،","؛"]),fbe=new Set(["၏"]),hbe=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function pbe(e){if(Kx(e))return!0;let t=!1;for(const n of e)if(yp.has(n)||kb(n))t=!0;else if(!t||!Mf.test(n))return!1;return t}function mbe(e){for(const t of e)if(!Ux.has(t)&&!yp.has(t))return!1;return e.length>0}function gbe(e){if(Kx(e))return!0;for(const t of e)if(!(G4.has(t)||Vx.has(t)||Mf.test(t)||kb(t)))return!1;return e.length>0}function Kx(e){let t=!1;for(const n of e)if(n!=="\\"&&!Mf.test(n)){if(!(G4.has(n)||yp.has(n)||Vx.has(n)))return!1;t=!0}return t}function yb(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const i=e.charCodeAt(n);if(i<56320||i>57343)return n;const o=n-1;if(o<0)return n;const s=e.charCodeAt(o);return s>=55296&&s<=56319?o:n}function Q0(e){if(e.length===0)return null;const t=yb(e,e.length);return e.slice(t)}const vbe=[36,37,43,43,92,92,162,165,176,177,1423,1423,1545,1547,1642,1642,2046,2047,2546,2547,2553,2555,2801,2801,3065,3065,3449,3449,3647,3647,6107,6107,8240,8247,8279,8279,8352,8399,8451,8451,8457,8457,8470,8470,8722,8723,43064,43064,65020,65020,65129,65130,65284,65285,65504,65505,65509,65510,73693,73696,123647,123647,126124,126124,126128,126128];function kb(e){const t=e.codePointAt(0);return t!==void 0&&(function(n,i){for(let o=0;o=i[o]&&n<=i[o+1])return!0;return!1})(t,vbe)}function ybe(e){const t=(function(n){for(const i of n)if(!Mf.test(i))return i;return null})(e);return t!==null&&qx.test(t)}function kbe(e){const t=Array.from(e);let n=t.length;for(;n>0;){const i=t[n-1];if(Mf.test(i))n--;else{if(!G4.has(i)&&!Vx.has(i))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function bbe(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function lF(e,t,n,i){const o=t[i],s=e[i];if(o==null)return s;const r=n[i];if(s.length===r)return s;const l=o.repeat(r);return e[i]=l,l}function aF(e,t){return e&&t!==null&&dbe.has(t)}function wbe(e){const t=Q0(e);return t!==null&&fbe.has(t)}function Cbe(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 jA(e){let t=e.length;for(;t>0;){const n=yb(e,t),i=e.slice(n,t);if(hbe.has(i))return!0;if(!yp.has(i))return!1;t=n}return!1}function Abe(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===` +`)return"hard-break"}return e===" "?"space":e===" "||e===" "||e==="⁠"||e==="\uFEFF"?"glue":e==="​"?"zero-width-break":e==="­"?"soft-hyphen":"text"}const xbe=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function ru(e){return e.length===1?e[0]:e.join("")}function Sbe(e,t){const n=[];for(let i=e.length-1;i>=0;i--)n.push(e[i]);return n.push(t),ru(n)}function _be(e,t,n,i){if(!xbe.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const o=[];let s=null,r=[],l=n,a=!1,u=0;for(const c of e){const d=Abe(c,i),f=d==="text"&&t;s===null||d!==s||f!==a?(s!==null&&o.push({text:ru(r),isWordLike:a,kind:s,start:l}),s=d,r=[c],l=n+u,a=f,u+=c.length):(r.push(c),u+=c.length)}return s!==null&&o.push({text:ru(r),isWordLike:a,kind:s,start:l}),o}function w8(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const Ibe=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function Mbe(e,t){const n=e.texts[t];return!!n.startsWith("www.")||Ibe.test(n)&&t+1=33&&n<=47&&n!==45||n>=58&&n<=64&&n!==63||n>=91&&n<=96||n>=123&&n<=126})(t):!Fbe.has(e)&&!Nbe.test(e)&&Lbe.test(e)}function uF(e){let t=!1;for(const n of e)if(!Mf.test(n)){if(!Mq(n))return!1;t=!0}return t}function Dbe(e,t,n,i){const o=!t&&uF(e),s=!i&&uF(n),r=(function(a){const u=(function(c){for(let d=c.length;d>0;){const f=yb(c,d),h=c.slice(f,d);if(!Mf.test(h))return h;d=f}return null})(a);return u!==null&&kb(u)})(e),l=(t||r)&&(function(a){for(let u=a.length;u>0;){const c=yb(a,u),d=a.slice(c,u);if(!Mf.test(d))return Mq(d)||kb(d);u=c}return!1})(e);return!!(o||s||l)&&!tc(e)&&!tc(n)&&(t||o||r)&&(i||s)}function cF(e){for(const t of e)if(qx.test(t))return!0;return!1}function V9(e){if(e.length===0)return!1;for(const t of e)if(!qx.test(t)&&!Ebe.has(t))return!1;return!0}function Rbe(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const n=[];let i=0;for(let o=0;o0&&u.charCodeAt(u.length-1)===32&&(u=u.slice(0,-1)),u})(e);if(s.length===0)return{normalized:s,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const r=(function(a,u,c){var d,f,h;const m=(b8===null&&(b8=new Intl.Segmenter(void 0,{granularity:"word"})),b8);let g=0;const y=[],k=[],v=[],C=[],w=[],M=[],L=[],E=[],S=[],x=[],A=[],T=[];for(const F of m.segment(a))for(const P of _be(F.segment,(d=F.isWordLike)!=null&&d,F.index,c)){let z=function(){M[ie]!==null&&(k[ie]=[lF(y,M,L,ie)],M[ie]=null),k[ie].push(P.text),v[ie]=v[ie]||P.isWordLike,E[ie]=E[ie]||K,S[ie]=S[ie]||ne,x[ie]=te,A[ie]=le,T[ie]=aF(S[ie],G)};const W=P.kind==="text",$=bbe(P.text,P.isWordLike,P.kind),K=tc(P.text),ne=sF(P.text),G=Q0(P.text),te=jA(P.text),le=wbe(P.text),ie=g-1;u.carryCJKAfterClosingQuote&&W&&g>0&&C[ie]==="text"&&K&&E[ie]&&x[ie]||W&&g>0&&C[ie]==="text"&&mbe(P.text)&&E[ie]||W&&g>0&&C[ie]==="text"&&A[ie]?z():W&&g>0&&C[ie]==="text"&&P.isWordLike&&ne&&T[ie]?(z(),v[ie]=!0):$!==null&&g>0&&C[ie]==="text"&&M[ie]===$?L[ie]=((f=L[ie])!=null?f:1)+1:W&&!P.isWordLike&&g>0&&C[ie]==="text"&&!E[ie]&&(pbe(P.text)||P.text==="-"&&v[ie])?z():(y[g]=P.text,k[g]=[P.text],v[g]=P.isWordLike,C[g]=P.kind,w[g]=P.start,M[g]=$,L[g]=$===null?0:1,E[g]=K,S[g]=ne,x[g]=te,A[g]=le,T[g]=aF(ne,G),g++)}for(let F=0;Fnull);let O=-1;for(let F=g-1;F>=0;F--){const P=y[F];if(P.length!==0){if(C[F]==="text"&&!v[F]&&O>=0&&C[O]==="text"&&(gbe(P)||P==="-"&&ybe(y[O]))){const z=(h=I[O])!=null?h:[];z.push(P),I[O]=z,w[O]=w[F],y[F]="";continue}O=F}}for(let F=0;FK+1){P.push(ru(le)),z.push(_e),W.push("text"),$.push(F.starts[K]),K=ie;continue}}P.push(ne),z.push(te),W.push(G),$.push(F.starts[K]),K++}return{len:P.length,texts:P,isWordLike:z,kinds:W,starts:$}})((function(F){const P=[],z=[],W=[],$=[];for(let K=0;K1;for(let le=0;le=F.len||w8(F.kinds[G]))continue;const te=[],le=F.starts[G];let ie=G;for(;ie0&&(P.push(ru(te)),z.push(!0),W.push("text"),$.push(le),K=ie-1)}return{len:P.length,texts:P,isWordLike:z,kinds:W,starts:$}})((function(F){const P=F.texts.slice(),z=F.isWordLike.slice(),W=F.kinds.slice(),$=F.starts.slice();for(let ne=0;ne=0&&!Iq(u.texts[C-1],c)&&v(C),g<0&&(g=C),y=y||tc(w))}return v(u.len),{len:d.length,texts:d,isWordLike:f,kinds:h,starts:m}})(s,r,t.breakKeepAllAfterPunctuation):r;return Bt({normalized:s,chunks:Rbe(l,o)},l)}let u1=null;const dF=new Map;let c1=null;const Pbe=new RegExp("\\p{Emoji_Presentation}","u"),Bbe=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let C8=null;const fF=new Map;function HA(){if(u1!==null)return u1;if(typeof OffscreenCanvas<"u")return u1=new OffscreenCanvas(1,1).getContext("2d"),u1;if(typeof document<"u")return u1=document.createElement("canvas").getContext("2d"),u1;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function Nd(e,t){let n=t.get(e);return n===void 0&&(n={width:HA().measureText(e).width,containsCJK:tc(e)},t.set(e,n)),n}function bb(){if(c1!==null)return c1;if(typeof navigator>"u")return c1={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,breakKeepAllAfterPunctuation:!0,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},c1;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 c1={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,breakKeepAllAfterPunctuation:!t,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},c1}function Tq(){return C8===null&&(C8=new Intl.Segmenter(void 0,{granularity:"grapheme"})),C8}function $be(e){return Pbe.test(e)||e.includes("️")}function mh(e,t,n){return n===0?t.width:t.width-(function(i,o){return o.emojiCount===void 0&&(o.emojiCount=(function(s){let r=0;const l=Tq();for(const a of l.segment(s))$be(a.segment)&&r++;return r})(i)),o.emojiCount})(e,t)*n}function zbe(e){return e==="space"||e==="zero-width-break"||e==="soft-hyphen"}function hF(e){return e==="space"||e==="preserved-space"||e==="tab"||e==="zero-width-break"||e==="soft-hyphen"}function pF(e,t,n=e.widths.length){for(;t0?e.letterSpacing:0}function Zx(e,t){return t===0?0:e+t}function Wbe(e,t,n,i,o){return Zx(i,t==="tab"?o+(function(s,r){return s.letterSpacing!==0&&s.spacingGraphemeCounts[r]>0?s.letterSpacing:0})(e,n):e.lineEndFitAdvances[n])}function mF(e,t,n,i){return Zx(i,t==="tab"?0:e.lineEndFitAdvances[n])}function gF(e,t,n,i,o){return Zx(i,t==="tab"?o:e.lineEndPaintAdvances[n])}function qbe(e,t,n){return e.letterSpacing!==0&&t?n+e.letterSpacing:n}function Ube(e,t){return e.letterSpacing===0?t:t+e.letterSpacing}function Ry(e,t,n){let i=t;for(;iz){if(me!==null&&ee>U){ie(J,ee,re),ge=ee,pe=Ry(me,pe,ge+1),ee=-1,re=0;continue}ie(),Z(J,ge,ae)}else $+=ae,ne=J,G=ge+1;else Z(J,ge,ae);const Ce=ge+1;me!==null&&me[pe]===Ce&&(ee=Ce,re=$,pe++),ge++}K&&ne===J&&G===ue.length&&(ne=J+1,G=0)}let Y=0;for(;Y=H.length)));){const J=H[Y],U=hF(R[Y]);if(K)if($+J>z){if(U){se(Y,J),ie(Y+1,0,$-J),Y++;continue}if(te>=0){if(ne>te||ne===te&&G>0){ie();continue}ie(te,0,le);continue}if(J>z&&F[Y]!==null){ie(),he(Y,0),Y++;continue}ie()}else se(Y,J),U&&(te=Y+1,le=$-J),Y++;else J>z&&F[Y]!==null?he(Y,0):_e(Y,J),U&&(te=Y+1,le=$-J),Y++}return K&&ie(),W})(n,i);const{widths:o,kinds:s,breakableFitAdvances:r,breakablePreferredBreaks:l,discretionaryHyphenWidth:a,chunks:u}=n;if(o.length===0||u.length===0)return 0;const c=bb(),d=i+c.lineFitEpsilon;let f=0,h=0,m=!1,g=0,y=0,k=-1,v=0,C=null;function w(){k=-1,v=0,C=null}function M(I=g,O=y,H){f++,h=0,m=!1,w()}function L(I,O){m=!0,g=I+1,y=0,h=O}function E(I,O,H){m=!0,g=I,y=O+1,h=H}function S(I,O){m?(h+=O,g=I+1,y=0):L(I,O)}function x(I,O,H,R,F,P){if(!O)return;const z=mF(n,I,H,F);gF(n,I,H,F,R),k=H+1,v=h-P+z,C=I}function A(I,O){var H;const R=r[I],F=(H=l[I])!=null?H:null;let P=F===null?-1:Ry(F,0,O+1),z=-1,W=O;for(;Wd){if(F!==null&&z>O){M(I,z),W=z,P=Ry(F,P,W+1),z=-1;continue}M(),E(I,W,$)}else h=G,g=I,y=W+1}else E(I,W,$);const K=W+1;F!==null&&F[P]===K&&(z=K,P++),W++}m&&g===I&&y===R.length&&(g=I+1,y=0)}function T(I){f++,w()}for(let I=0;I=O.endSegmentIndex)));){const R=s[H],F=hF(R),P=Hbe(n,m,H),z=R==="tab"?jbe(h+P,n.tabStopAdvance):o[H],W=P+z,$=Wbe(n,R,H,P,z);if(R!=="soft-hyphen")if(m){if(h+$>d){const K=h+mF(n,R,H,P);if(gF(n,R,H,P,z),C==="soft-hyphen"&&c.preferEarlySoftHyphenBreak&&v<=d){M(k,0);continue}if(F&&K<=d){S(H,W),M(H+1,0),H++;continue}if(k>=0&&v<=d){if(g>k||g===k&&y>0){M();continue}const ne=k;M(ne,0),H=ne;continue}if($>d&&r[H]!==null){M(),A(H,0),H++;continue}M();continue}S(H,W),x(R,F,H,z,P,W),H++}else $>d&&r[H]!==null?A(H,0):L(H,z),x(R,F,H,z,P,W),H++;else m&&(g=H+1,y=0,k=H+1,v=h+a,C=R),H++}m&&(O.consumedEndSegmentIndex,M(O.consumedEndSegmentIndex,0))}return f})(e,t)}let A8=null;function Gx(){return A8===null&&(A8=new Intl.Segmenter(void 0,{granularity:"grapheme"})),A8}function Kbe(e,t){const n=[];let i=[],o=0,s=!1,r=!1,l=!1;function a(){i.length!==0&&(n.push({text:i.length===1?i[0]:i.join(""),start:o}),i=[],s=!1,r=!1,l=!1)}function u(d,f,h){i=[d],o=f,s=h,r=jA(d),l=G4.has(d)}function c(d,f){i.push(d),s=s||f;const h=jA(d);r=d.length===1&&yp.has(d)&&r||h,l=!1}for(const d of Gx().segment(e)){const f=d.segment,h=tc(f);i.length!==0?l||Ux.has(f)||yp.has(f)||t.carryCJKAfterClosingQuote&&h&&r?c(f,h):s||h?(a(),u(f,d.index,h)):c(f,h):u(f,d.index,h)}return a(),n}function Zbe(e,t,n){if(t.length<=1)return t;const i=[];let o=-1,s=!1;function r(l){if(!(o<0)){if(s)o+1===l?i.push(t[o]):(function(a,u){const c=t[a].start,d=u=0&&!Iq(t[l-1].text,n)&&r(l),o<0&&(o=l),s=s||tc(a.text)}return r(t.length),i}function vF(e,t){if(t==="zero-width-break"||t==="soft-hyphen"||t==="hard-break")return 0;if(t==="tab")return 1;let n=0;const i=Gx();for(const o of i.segment(e))n++;return n}function Gbe(e){return e==="-"||e==="֊"||e==="‐"||e==="‒"||e==="–"||e==="—"}function Qbe(e,t,n,i,o){const s=bb(),{cache:r,emojiCorrection:l}=(function(T,I){HA().font=T;const O=(function(F){let P=dF.get(F);return P||(P=new Map,dF.set(F,P)),P})(T),H=(function(F){const P=F.match(/(\d+(?:\.\d+)?)\s*px/);return P?parseFloat(P[1]):16})(T),R=I?(function(F,P){let z=fF.get(F);if(z!==void 0)return z;const W=HA();W.font=F;const $=W.measureText("😀").width;if(z=0,$>P+.5&&typeof document<"u"&&document.body!==null){const K=document.createElement("span");K.style.font=F,K.style.display="inline-block",K.style.visibility="hidden",K.style.position="absolute",K.textContent="😀",document.body.appendChild(K);const ne=K.getBoundingClientRect().width;document.body.removeChild(K),$-ne>.5&&(z=$-ne)}return fF.set(F,z),z})(T,H):0;return{cache:O,fontSize:H,emojiCorrection:R}})(t,(a=e.normalized,Bbe.test(a)));var a;const u=mh("-",Nd("-",r),l)+(o===0?0:2*o),c=8*mh(" ",Nd(" ",r),l),d=o!==0;if(e.len===0)return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],breakablePreferredBreaks:[],letterSpacing:0,spacingGraphemeCounts:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]};const f=[],h=[],m=[],g=[];let y=e.chunks.length<=1&&!d;const k=null,v=[],C=[],w=[],M=null,L=Array.from({length:e.len});function E(T,I,O,H,R,F,P,z,W){R!=="text"&&R!=="space"&&R!=="zero-width-break"&&(y=!1),f.push(I),h.push(O),m.push(H),g.push(R),v.push(P),C.push(z),d&&w.push(W)}function S(T,I,O,H,R){const F=Nd(T,r),P=d?vF(T,I):0,z=(function(ne,G,te){return G>1?ne+(G-1)*te:ne})(mh(T,F,l),P,o),W=I==="space"||I==="preserved-space"||I==="zero-width-break"?0:z,$=W===0?0:W+(P>0?o:0),K=I==="space"||I==="zero-width-break"?0:z;if(R&&H&&T.length>1){let ne="sum-graphemes";o!==0?ne="segment-prefixes":V9(T)?ne="pair-context":s.preferPrefixWidthsForBreakableRuns&&(ne="segment-prefixes");const G=(function(le,ie,_e,Z,se){if(ie.breakableFitAdvances!==void 0&&ie.breakableFitMode===se)return ie.breakableFitAdvances;ie.breakableFitMode=se;const he=Tq(),Y=[];for(const ue of he.segment(le))Y.push(ue.segment);if(Y.length<=1)return ie.breakableFitAdvances=null,ie.breakableFitAdvances;if(se==="sum-graphemes"){const ue=[];for(const me of Y){const pe=Nd(me,_e);ue.push(mh(me,pe,Z))}return ie.breakableFitAdvances=ue,ie.breakableFitAdvances}if(se==="pair-context"||Y.length>96){const ue=[];let me=null,pe=0;for(const ee of Y){const re=mh(ee,Nd(ee,_e),Z);if(me===null)ue.push(re);else{const ge=me+ee,ae=Nd(ge,_e);ue.push(mh(ge,ae,Z)-pe)}me=ee,pe=re}return ie.breakableFitAdvances=ue,ie.breakableFitAdvances}const J=[];let U="",Q=0;for(const ue of Y){U+=ue;const me=mh(U,Nd(U,_e),Z);J.push(me-Q),Q=me}return ie.breakableFitAdvances=J,ie.breakableFitAdvances})(T,F,r,l,ne),te=G===null||i==="keep-all"?null:(function(le){if(!/[-\u058A\u2010\u2012\u2013\u2014]/u.test(le))return null;const ie=[];let _e=0;for(const Z of Gx().segment(le))_e++,Gbe(Z.segment)&&ie.push(_e);return ie.length===0?null:ie})(T);return void E(T,z,$,K,I,O,G,te,P)}E(T,z,$,K,I,O,null,null,P)}for(let T=0;T=55296&&le<=56319&&te+1=56320&&se<=57343&&(ie=se-56320+(le-55296<<10)+65536,_e=2)}const Z=sbe(ie);Z!=="R"&&Z!=="AL"&&Z!=="AN"||(z=!0);for(let se=0;se<_e;se++)P[te+se]=Z;te+=_e}if(!z)return null;let W=0;for(let te=0;te=0&&P[le]==="ET";le--)P[le]="EN";for(le=te+1;le0?P[te-1]:ne)!=="L"?"R":"L";if(ie===((le{const e=globalThis;if(e[x8])return e[x8];const t={configs:{},controllers:{},revision:_u(0),preparedCache:new Map,blockEstimateCache:new Map};return e[x8]=t,t})();let Bg=null;const S8=_s.revision;function yF(e){var t;return e&&(t=_s.configs[e])!=null?t:null}function kF(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function Jbe(e){return e?.type==="text"||e?.type==="emoji"||e?.type==="hardbreak"}function _8(e){var t,n,i;if(!Array.isArray(e)||e.length===0)return null;let o="";for(const s of e){if(!Jbe(s))return null;s.type==="text"?o+=String((t=s.content)!=null?t:""):s.type==="emoji"?o+=String((i=(n=s.name)!=null?n:s.raw)!=null?i:""):s.type==="hardbreak"&&(o+=` +`)}return o.length>0?o:null}function I8(e,t,n){var i,o;if(!e||!Number.isFinite(t)||t<=0||!(function(){var s;if(Bg!=null)return Bg;if(typeof document>"u")return!1;try{const r=document.createElement("canvas");return Bg=!!((s=r.getContext)!=null&&s.call(r,"2d")),Bg}catch{return Bg=!1,!1}})())return null;try{const s=Math.round(100*t)/100,r=[(i=n.whiteSpace)!=null?i:"pre-wrap",n.font,n.lineHeight,n.wrapperOverhead,n.widthAdjustment,s,e].join("\0"),l=_s.blockEstimateCache.get(r);if(l)return _s.blockEstimateCache.delete(r),_s.blockEstimateCache.set(r,l),{kind:"simple-text",height:l.height,contentHeight:l.contentHeight};const a=(o=n.whiteSpace)!=null?o:"pre-wrap",u=(function(h,m,g){const y=`${g}\0${m}\0${h}`,k=_s.preparedCache.get(y);if(k)return _s.preparedCache.delete(y),_s.preparedCache.set(y,k),k.prepared;const v=(function(C,w,M){return(function(L,E,S,x){var A,T;const I=(A=x?.wordBreak)!=null?A:"normal",O=(T=x?.letterSpacing)!=null?T:0;return Qbe(Obe(L,bb(),x?.whiteSpace,I),E,!1,I,O)})(C,w,0,M)})(h,m,{whiteSpace:g});for(_s.preparedCache.set(y,{prepared:v});_s.preparedCache.size>240;){const C=_s.preparedCache.keys().next().value;if(!C)break;_s.preparedCache.delete(C)}return v})(e,n.font,a),c=(function(h,m,g){const y=Vbe(h,m);return{lineCount:y,height:y*g}})(u,Math.max(24,s-n.widthAdjustment),n.lineHeight),d=Math.max(n.lineHeight,c.height),f=Math.max(n.lineHeight,Math.round(d+n.wrapperOverhead));for(_s.blockEstimateCache.set(r,{height:f,contentHeight:Math.round(d)});_s.blockEstimateCache.size>4e3;){const h=_s.blockEstimateCache.keys().next().value;if(!h)break;_s.blockEstimateCache.delete(h)}return{kind:"simple-text",height:f,contentHeight:Math.round(d)}}catch{return null}}function Eq(e,t,n){var i,o;if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type==="paragraph"){const s=_8(e.children);return s&&n.paragraph?I8(s,t,n.paragraph):null}if(e.type==="heading"){const s=Number(e.level||0),r=_8(e.children),l=n.headings[s];return r&&l?I8(r,t,l):null}if(e.type==="list_item"){const s=Array.isArray(e.children)?e.children:[];if(s.length!==1||((i=s[0])==null?void 0:i.type)!=="paragraph"||!n.listItem)return null;const r=_8((o=s[0])==null?void 0:o.children);return r?I8(r,t,n.listItem):null}if(e.type==="list"){const s=Array.isArray(e.items)?e.items:[];if(!s.length)return null;let r=Math.max(0,n.listWrapperOverhead);for(const l of s){const a=Eq(l,t,n);if(!a)return null;r+=a.height}return{kind:"simple-text",height:Math.max(1,Math.round(r)),contentHeight:Math.max(1,Math.round(r))}}return null}function $g(e){if(!e)return 1;const t=String(e).split(/\r?\n/);return Math.max(1,t.length)}function gh(e,t){const n=String(e??"");return t?n:n.replace(/\r\n$|\n$|\r$/,"")}function M8(e,t,n=0){return e.diff?Wx(t??{},n)?(function(i){const o=gh(i.raw);if(o){const s=o.split(/\r?\n/);return i.originalCode!=null||i.updatedCode!=null?Math.max(1,s.filter(r=>!Ybe.some(l=>r.startsWith(l))).length):Math.max(1,s.length)}return $g(gh(i.originalCode))+$g(gh(i.updatedCode))})(e):(function(i){const o=i.originalCode,s=i.updatedCode;if(o!=null||s!=null)return Math.max($g(gh(o)),$g(gh(s)));const r=gh(i.code).split(/\r?\n/);let l=0,a=0;for(const u of r)u.startsWith("+")&&!u.startsWith("+++")?a++:u.startsWith("-")&&!u.startsWith("---")?l++:(l++,a++);return Math.max(1,l,a)})(e):$g(gh(e.code,e.loading===!0))}function Xbe(e){return e?`${e.fontStyle||"normal"} ${e.fontWeight||"400"} ${e.fontSize||"16px"} ${e.fontFamily||"sans-serif"}`:""}function T8(e,t,n="pre-wrap"){if(!e||!t||typeof window>"u")return null;const i=window.getComputedStyle(t),o=e.offsetHeight,s=kF(i.lineHeight,1.5*kF(i.fontSize,16)),r=e.getBoundingClientRect().width,l=t.getBoundingClientRect().width;return{font:Xbe(i),lineHeight:s,wrapperOverhead:Math.max(0,o-s),widthAdjustment:Math.max(0,r-l),whiteSpace:n}}const e4e=new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function bF(e,t={}){var n;const i={},o=new Set((n=t.omit)!=null?n:[]);if(!e||typeof e!="object")return i;const s=Object.getOwnPropertyDescriptors(e);for(const[r,l]of Object.entries(s))e4e.has(r)||o.has(r)||l.enumerable&&"value"in l&&(i[r]=l.value);return i}function wF(e,t,n,i){var o;const s=(function(f){return Math.max(0,Math.ceil(f.scrollHeight||0)-Math.ceil(f.clientHeight||0))})(e),r=(function(f,h){return Number.isFinite(f)?Math.min(Math.max(0,f),h):0})(n,s);if(!i.isReverseFlexScrollRoot(e))return void(e.scrollTop=r);const l=Math.max(0,s-r),a=[-l,l];let u=a[0],c=Number.POSITIVE_INFINITY;for(const f of a){e.scrollTop=f;const h=i.getNormalizedScrollTop(e,t,!1),m=Math.abs(h-r);md&&(e.scrollTop=u)}function CF(e,t){let n=0,i=null,o=null;const s=()=>{const r=o;o=null,i=null,r&&(n=Date.now(),e(...r))};return function(...r){const l=Date.now(),a=t-(l-n);o=r,a<=0?(i&&(clearTimeout(i),i=null),n=l,o=null,e(...r)):i||(i=setTimeout(s,a))}}function AF(e){return e==="simple"?"simple":e===!0||e==="true"||e==="precise"?"precise":"off"}const Lq=Symbol("MarkstreamMathBlockMinHeightCache");function U8t(){return en(Lq,null)}const t4e=new Set(["text","inline_code","emoji","footnote_reference"]),n4e=new Set(["strong","emphasis","strikethrough","highlight","insert","subscript","superscript","link"]);function zg(e){const t=Number(e);return!Number.isFinite(t)||t<=0?-1:Math.round(t/32)}function vh(e,t,n,i=22){const o=String(e??"");if(!o)return n;const s=Math.max(18,Math.floor(Math.max(320,t)/8)),r=o.split(/\r?\n/).length,l=Math.ceil(o.length/s),a=Math.max(1,r,l);return Math.max(n,Math.ceil(a*i+12))}function Nq(e){var t;if(!e||typeof e!="object")return!1;const n=e,i=String((t=n.type)!=null?t:"");if(t4e.has(i))return!0;if(!n4e.has(i))return!1;const o=n.children;return!Array.isArray(o)||!o.length||o.every(Nq)}function WA(e){var t,n,i,o,s,r,l,a;if(!e||typeof e!="object")return"";const u=e,c=String((t=u.type)!=null?t:"");if(c==="text")return String((i=(n=u.content)!=null?n:u.raw)!=null?i:"");if(c==="inline_code")return String((r=(s=(o=u.code)!=null?o:u.content)!=null?s:u.raw)!=null?r:"");if(c==="emoji")return String((a=(l=u.name)!=null?l:u.raw)!=null?a:"");if(typeof u.text=="string")return u.text;const d=[];for(const f of["children","items","cells","rows"]){const h=u[f];if(Array.isArray(h)){const m=h.map(WA).filter(Boolean).join(" ");m&&d.push(m)}}return d.join(" ").replace(/\s+/g," ").trim()}function Fq(e){if(!e||typeof e!="object")return!1;const t=e;return t.type==="inline_code"||["children","items","cells","rows"].some(n=>{const i=t[n];return Array.isArray(i)&&i.some(Fq)})}function i4e(e,t){if(!e)return 30;const n=Math.max(18,Math.floor(Math.max(320,t)/8)),i=e.split(/\r?\n/).length,o=Math.ceil(e.length/n),s=Math.max(1,i,o);return 30+26*Math.max(0,s-1)}function o4e(e,t){var n,i,o,s,r,l,a,u,c,d,f,h,m,g;if(!e||typeof e!="object")return 32;const y=e,k=String((n=y.type)!=null?n:""),v=Number.isFinite(t)&&t>0?t:640;switch(k){case"heading":return(function(C){var w;const M=Number((w=C.level)!=null?w:C.depth);return M>=4?20:M===3?30:M===2?32:44})(y);case"paragraph":return(function(C,w){const M=String(C??"");if(!M)return 28;const L=Math.max(18,Math.floor(Math.max(320,w)/8)),E=M.split(/\r?\n/).length,S=Math.ceil(M.length/L);return Math.max(1,E,S)<=1?28:vh(M,w,34)})(String((o=(i=y.raw)!=null?i:y.content)!=null?o:""),v);case"list":return(function(C,w){var M;const L=Array.isArray(C.items)?C.items:[];if(!L.length)return 48;const E=Math.max(48,30*L.length+12);let S=12;for(const T of L)S+=i4e(WA(T)||String((M=T.raw)!=null?M:""),w);const x=Math.max(0,S-E);if(L.length>20){const T=Math.round(2.4*L.length);return Math.round(E+Math.max(T,Math.min(x,3*L.length)))}if(x<=0)return E;const A=L.length>8?8*L.length:x;return Math.round(E+Math.min(x,A))})(y,v);case"list_item":return vh(String((r=(s=y.raw)!=null?s:y.content)!=null?r:""),v,34);case"blockquote":return vh(String((a=(l=y.raw)!=null?l:y.content)!=null?a:""),v,56);case"table":return(function(C,w){const M=[...C.header?[C.header]:[],...Array.isArray(C.rows)?C.rows:[]];if(!M.length){const L=Array.isArray(C.children)?C.children.length:3;return Math.max(120,38*L+48)}return Math.max(120,Math.round(4+M.reduce((L,E)=>L+(function(S,x){const A=Math.max(1,S.length),T=Math.max(80,(x-32)/A),I=Math.max(10,Math.floor(T/8)),O=Math.max(1,...S.map(H=>{var R;const F=WA(H)||String((R=H?.raw)!=null?R:"");return Math.ceil(F.length/I)||1}));return 54+34*Math.max(0,O-1)+(A<=3&&S.some(Fq)?14:0)})((function(S){var x;return Array.isArray(S?.cells)&&(x=S.cells)!=null?x:[]})(E),w),0)))})(y,v);case"code_block":{const C=String((u=y.language)!=null?u:"").trim().toLowerCase(),w=String((d=(c=y.code)!=null?c:y.raw)!=null?d:"");return C==="mermaid"?fb(cb(w)):C==="infographic"?hb(db(w)):vh(w,v,96,20)}case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return(function(C,w){var M,L,E;const S=C.match(/^\s*]*)>/i);return S&&!/(?:^|\s)open(?:\s|=|$)/i.test((M=S[1])!=null?M:"")?vh(((E=(L=C.match(/]*>([\s\S]*?)<\/summary>/i))==null?void 0:L[1])==null?void 0:E.replace(/<[^>]*>/g,"").trim())||"Details",w,28,28):vh(C,w,96)})(String((h=(f=y.raw)!=null?f:y.content)!=null?h:""),v);case"thematic_break":return 24;default:return vh(String((g=(m=y.raw)!=null?m:y.content)!=null?g:""),v,40)}}function xF(e,t,n){return Math.min(Math.max(e,t),n)}const s4e=["total","cacheHits","appendHits","tailHits","fullParses","chunkedParses"],r4e=["tokenCloneMs","processTokensInputTokens","processTokensReusedTopLevelNodes","processTokensMs","safeMarkdownMs","tokenizeMs","htmlBlockPassesMs","parseMarkdownToStructureTotalMs"],l4e=new Set(["attrs","data","items","header","payload","props","rows","cells","term","definition","sourceMap"]),Dq=["raw","content","code","originalCode","updatedCode"],SF=new WeakMap,_F=new WeakMap;let a4e=1;function ou(){return typeof performance<"u"?performance.now():Date.now()}function IF(e){const t=e.stream;return t&&typeof t.stats=="function"?t.stats():null}function na(e){if(typeof e!="object"&&typeof e!="function"||e===null)return"";const t=e;let n=SF.get(t);return n||(n=a4e++,SF.set(t,n)),String(n)}function MF(e,t,n,i={}){var o,s;const r=i.includeFinal!==!1,l={md:na(t),customMarkdownIt:na(n),requireClosingStrong:e.requireClosingStrong===!0,customHtmlTags:(o=e.customHtmlTags)!=null?o:[],includeSourceMap:e.includeSourceMap===!0,streamParse:(s=e.streamParse)!=null?s:"auto",validateLink:na(e.validateLink),preTransformTokens:na(e.preTransformTokens),postTransformTokens:na(e.postTransformTokens),postTransformNodes:na(e.postTransformNodes)};return r&&(l.final=e.final===!0),JSON.stringify(l)}function TF(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===10;)t-=1;const n=e.lastIndexOf(` +`,t-1)+1;return e.slice(n,t).trim()}function EF(e){const t=Rq(e);return t.length>=2&&t.every(n=>{const i=n.trim();return i.length>=1&&i.replace(/^:/,"").replace(/:$/,"").split("").every(o=>o==="-")})}function Rq(e){return e.includes("|")?e.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]}function Oq(e){let t=2166136261;for(let n=0;n>>0).toString(36)}function Qx(e){const t=String(e??"");return`${t.length}:${Oq(t)}`}function qA(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?Qx(r):`${r.length}:${Oq(r.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${na(e)}`;if(typeof e!="object")return typeof e;const i=e,o=t.get(i);if(o)return`cycle:${o}`;if(n>=6)return`object:${na(i)}`;const s=na(i);if(t.set(i,s),Array.isArray(e)){const r=e.slice(0,200);return`a:${e.length}:${r.map(l=>qA(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(u=>`${u}:${qA(r[u],t,n+1)}`).join(";")}`}return typeof e}function wb(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function Pq(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(i=>wb(i)?Tf(i,t,n+1):Pq(i,t,n+1)).join(",")}`:wb(e)?Tf(e,t,n):qA(e,t,n)}function u4e(e,t,n){return Object.keys(e).sort().filter(i=>i!=="children"&&!Dq.includes(i)).map(i=>{const o=e[i];return typeof o=="string"?`${i}=s:${Qx(o)}`:typeof o=="number"||typeof o=="boolean"||o==null?`${i}=${String(o)}`:typeof o=="function"?`${i}=fn:${na(o)}`:l4e.has(i)&&(Array.isArray(o)||typeof o=="object")?`${i}=${Pq(o,t,n+1)}`:o&&typeof o=="object"?`${i}=object:${na(o)}`:""}).filter(Boolean).join(";")}function c4e(e){return Dq.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${Qx(n)}`:""}).filter(Boolean).join(";")}function Tf(e,t=new WeakMap,n=0){const i=_F.get(e);if(i)return i;const o=e,s=t.get(o);if(s)return`node-cycle:${s}`;if(n>=6)return`node:${e.type}:${na(o)}`;const r=na(o);t.set(o,r);const l=(function(a,u,c){const d=a,f=Array.isArray(d.children)?d.children:[],h=f.length?f.slice(0,200).map(m=>Tf(m,u,c+1)).join("|"):"";return[a.type,c4e(d),u4e(d,u,c),f.length,h].join(":")})(e,t,n);return _F.set(o,l),l}function Bq(e,t){return Tf(e)===Tf(t)}function Yx(e,t,n){const i=ou(),o=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=ou()-i,e[o]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function LF(e,t,n){return Yx(t,n,()=>Tf(e))}function $q(e,t,n){return LF(e,n,"stabilizeSignatureMs")===LF(t,n,"stabilizeSignatureMs")}function Oy(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function NF(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function FF(e){return e.__markstreamHasCustomParserExtensions===!0||(function(t){var n;return Number((n=t.__markstreamRegisteredPluginCount)!=null?n:0)>0})(e)}function d4e(e,t){return e.length===t.length&&e===t}function Jx(e,t,n=0){if(n>=4)return null;if(e.type!==t.type)return!1;const i=e,o=t,s=Object.keys(i).filter(c=>c!=="type"&&c!=="children").sort(),r=Object.keys(o).filter(c=>c!=="type"&&c!=="children").sort();if(s.length!==r.length)return!1;for(let c=0;c{i=Jx(e,t)}),i??$q(e,t,n)}function p4e(e,t){const n={};for(const i of s4e){const o=e[i],s=t?.[i];typeof o=="number"&&(n[i]=o-(typeof s=="number"?s:0))}return n}function m4e(e,t){var n;const i=TN(t.instanceMsgId),o=new Map,s=(n=t.smoothStreamingEnabled)!=null?n:D(()=>!1),r=q(t.renderContent.value);let l=[],a="",u="",c="",d=!1;const f=(function(){let H="",R=0,F=!1,P=!1,z=!1,W=!1;function $(){H="",R=0,F=!1,P=!1,z=!1,W=!1}function K(ne){let G=!1;for(let te=0;te{if(!ne||!G.startsWith(ne)||G.length<=ne.length)return $(),[!0,0];let te=0;H!==ne&&($(),K(ne),te=ne.length);const le=G.slice(ne.length),ie=K(le);return H=G,[ie,te+le.length]}})();let h,m=0,g=0,y=ou(),k=-1,v=0;function C(H){k=Number.isInteger(H)?H:0,v+=1}function w(){h&&(clearTimeout(h),h=void 0)}function M(){w();const H=t.renderContent.value;r.value!==H&&(r.value=H),y=ou()}ze([t.renderContent,t.effectiveFinal,s],([H,R,F])=>{r.value!==H&&(!F||R||(function(P,z){if(!P&&z||z.length<=80||z.length\s*|`{3,}|~{3,})/.test(W))||W.endsWith(` +`)&&!(function($){const K=TF($);if(EF(K))return!1;const ne=Rq(K);return ne.length>=2&&ne.some(G=>G.trim())})(z))})(r.value,H)?M():(function(){if(g+=1,h)return;const P=Math.max(0,(function(z){const W=z.parseCoalesceMs;return typeof W=="number"&&Number.isFinite(W)&&W>=0?W:80})(e)-(ou()-y));P<=0?M():h=setTimeout(M,P)})())},{flush:"sync",immediate:!0}),cd(w);const L=D(()=>{var H,R,F,P;return hme(e.customHtmlTags,(H=e.parseOptions)==null?void 0:H.customHtmlTags,(P=(F=(R=t.customComponentsMap)==null?void 0:R.value)!=null?F:{},Object.entries(P).map(([z,W])=>{const $=Va(z);return W==null||!$||v2($)||UH.has($)||f2.has($)?"":$}).filter(Boolean)))}),E=D(()=>{const{key:H,tags:R}=pme(L.value);if(!H)return i;const F=o.get(H);if(F)return F;const P=TN(t.instanceMsgId,{customHtmlTags:R});return o.set(H,P),P}),S=D(()=>{const H=E.value;if(!e.customMarkdownIt)return H;const R=e.customMarkdownIt(H);return H.__markstreamHasCustomParserExtensions=!0,R.__markstreamHasCustomParserExtensions=!0,R}),x=D(()=>{var H,R;const F=(H=e.parseOptions)!=null?H:{},P=t.effectiveFinal.value,z=L.value,W=P!=null,$=z.length>0;return W||$||F.streamParse==null?Bt(Bt(Dn(Bt({},F),{streamParse:(R=F.streamParse)==null||R}),W?{final:P}:{}),$?{customHtmlTags:z}:{}):F}),A=D(()=>{var H;return new Set(((H=x.value.customHtmlTags)!=null?H:[]).map(R=>String(R).trim().toLowerCase()).filter(Boolean))}),T=D(()=>MF(x.value,S.value,e.customMarkdownIt,{includeFinal:!0})),I=D(()=>MF(x.value,S.value,e.customMarkdownIt,{includeFinal:!1}));ze([T,I],([H,R],[F,P])=>{F&&(H===F&&R===P||(M(),R!==P&&(l=[],c="")))},{flush:"sync"});const O=D(()=>{var H,R,F,P,z,W,$,K,ne,G,te;if((H=e.nodes)!=null&&H.length)return l=[],c="",C(0),Lt(e.nodes.slice());const le=r.value;if(!le)return l=[],c="",C(-1),[];const ie=t.debugPerformanceEnabled.value,_e=ie?ou():0,Z=S.value,se=T.value,he=I.value;a&&se!==a&&(function(Ae){var Ne,Ze;(Ze=(Ne=Ae.stream)==null?void 0:Ne.reset)==null||Ze.call(Ne)})(Z),u&&he!==u&&(l=[],c="");const Y=Object.keys((F=(R=t.customComponentsMap)==null?void 0:R.value)!=null?F:{}).length>0||typeof x.value.postTransformNodes=="function";Y!==d&&(l=[],c="");const J=!Y&&l.length>0&&le.startsWith(c)&&he===u,U=ie?IF(Z):null,Q=ie?{}:void 0,ue=FF(Z),me=!ue&&!Y,pe=Bt(Bt(Dn(Bt({},x.value),{__reuseStableTopLevelNodes:me}),ue?{__disableStreamParse:!0}:{}),Q?{__timing:Q}:{}),ee=GW(le,Z,pe),re=ie?ou():0,ge=ie?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let ae,Ce=ie?Oy(ee.length):void 0,ve=0,ce=0,Te=0;if(J){const Ae=ie?ou():0,[Ne,Ze]=(function(pt){var Rt,Ot;const[Fe,Pe]=pt.scanGlobalReferenceAppend(pt.previousContent,pt.content),be=pt.parseOptions;return[pt.previousDirtyStartIndex>0&&be.final!==!0&&!pt.customMarkdownIt&&!FF(pt.md)&&!Fe&&typeof be.preTransformTokens!="function"&&typeof be.postTransformTokens!="function"&&typeof be.postTransformNodes!="function"&&((Ot=(Rt=be.customHtmlTags)==null?void 0:Rt.length)!=null?Ot:0)===0?pt.previousDirtyStartIndex:0,Pe]})({content:le,previousContent:c,previousDirtyStartIndex:k,parseOptions:x.value,customMarkdownIt:e.customMarkdownIt,md:Z,scanGlobalReferenceAppend:f});Te=Ze;const rt=Ne<=0;if(ge){const pt=(function(Rt,Ot,Fe,Pe={}){var be;if(!Ot.length)return{nodes:Rt,metrics:Oy(Rt.length)};const Oe=(be=Pe.scanStartIndex)!=null?be:0,Ke=Pe.reuseDirtyTail!==!1,Qe=(function(Se,We,ut,Tt=0){const tt=Math.min(Se.length,We.length);for(let Ve=Math.min(tt,Math.max(0,Tt));VeTf(Ae[rt]))})(ae,ge,ce):(function(Ae,Ne=0){for(let Ze=Math.max(0,Ne);Ze((z=U?.total)!=null?z:0);t.logPerf(Ne?"parse(stream)":"parse(sync)",Bt(Bt(Bt({rendererId:t.instanceMsgId,ms:Math.round(ou()-_e),nodes:ae.length,contentLength:le.length,parseCommitCount:m,parseCoalescedCount:g,nodeReuseMs:ke,referenceDefinitionScanChars:Te,signatureMs:(W=ge?.signatureMs)!=null?W:0,stabilizeSignatureMs:($=ge?.stabilizeSignatureMs)!=null?$:0,primeSignatureMs:(K=ge?.primeSignatureMs)!=null?K:0,signatureCallCount:(ne=ge?.signatureCallCount)!=null?ne:0,stabilizeSignatureCallCount:(G=ge?.stabilizeSignatureCallCount)!=null?G:0,primeSignatureCallCount:(te=ge?.primeSignatureCallCount)!=null?te:0,stabilizeMs:ve},Ce??{}),Q?Object.fromEntries(r4e.map(Ze=>{var rt;return[Ze,(rt=Q[Ze])!=null?rt:0]})):{}),Ae?{streamMode:Ae.lastMode,streamDelta:p4e(Ae,U),streamStats:Ae}:{}))}return Lt(ae)});return{effectiveCustomHtmlTags:L,effectiveCustomHtmlTagsSet:A,mdBase:E,mdInstance:S,mergedParseOptions:x,getParsedNodesDirtyStartIndex:()=>k,getParsedNodesRevision:()=>v,parsedNodes:O}}function g4e(e){const{isClient:t}=e,n=q(new Set),i=new Map,o=new Map,s=new Map;function r(u){if(!t)return;const c=s.get(u);c!=null&&(window.clearTimeout(c),s.delete(u))}function l(){if(t)for(const u of s.values())window.clearTimeout(u);s.clear()}function a(){n.value=new Set}return{visibleNodeIndices:n,nodeVisibilityHandles:i,nodeVisibilityWatchStops:o,nodeVisibilityFallbackTimers:s,clearVisibilityFallback:r,clearAllVisibilityFallbacks:l,markNodeVisible:function(u,c=!0){var d;c&&r(u),(function(f,h){if((g=(m=e.shouldTrackVisibleNodeIndices)==null?void 0:m.call(e))!=null&&!g)return;var m,g;const y=n.value,k=y.has(f);if(h){if(k)return;const C=new Set(y);return C.add(f),void(n.value=C)}if(!k)return;const v=new Set(y);v.delete(f),n.value=v})(u,c),c&&((d=e.onNodeMarkedVisible)==null||d.call(e,u))},resetNodeVisibleState:a,cleanupNodeVisibility:function(u){var c;if(e.shouldCleanupNodeVisibility&&!e.shouldCleanupNodeVisibility())return;for(const[f,h]of o.entries())f{const c=o.getSnapshot();t.value=c.source,n.value=c.visible,i.value=c.done},r=o.subscribe(s);s();const l=D(()=>Math.max(0,t.value.length-n.value.length)),a=D(()=>l.value===0),u=D(()=>i.value&&a.value);return jm()&&cd(()=>{r(),o.destroy()}),{source:t,visible:n,done:i,final:u,caughtUp:a,pendingChars:l,enqueue:c=>o.enqueue(c),finish:c=>o.finish(c),flush:()=>o.flush(),reset:c=>o.reset(c),pause:()=>o.pause(),resume:()=>o.resume()}}const y4e={maxCharsPerSecond:3e3,maxCommitFps:20,maxCharsPerCommit:160,catchUpLatencyMs:220,catchUpThreshold:400},DF=/auto|scroll|overlay/i;function k4e(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return DF.test(t)||DF.test(n)}function b4e(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 w4e={class:"m-0 p-0"},C4e=["data-probe"],A4e=Ei(ot(Dn(Bt({},{name:"HeightEstimationProbes"}),{__name:"HeightEstimationProbes",props:{width:{},flowRoot:{type:Boolean},paragraphNode:{},listItemNode:{},listNode:{},headingNodes:{},setParagraphWrapper:{type:Function},setListItemWrapper:{type:Function},setListWrapper:{type:Function},setHeadingWrapper:{type:Function}},setup(e){const t=e;function n(i){var o,s;return(s=(o=t.headingNodes)==null?void 0:o[i])!=null?s:null}return(i,o)=>(b(),N("div",{class:"height-estimation-probes",style:on({width:`${e.width}px`}),"aria-hidden":"true"},[_("div",{ref:s=>e.setParagraphWrapper(s),class:De(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"paragraph"},[V(p(rp),{node:e.paragraphNode,"index-key":"probe-paragraph"},null,8,["node"])],2),_("div",{ref:s=>e.setListItemWrapper(s),class:De(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"list-item"},[_("ul",w4e,[V(p(am),{node:e.listItemNode,"index-key":"probe-list-item"},null,8,["node"])])],2),_("div",{ref:s=>e.setListWrapper(s),class:De(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"list"},[V(p(um),{node:e.listNode,"index-key":"probe-list"},null,8,["node"])],2),(b(),N(Le,null,Ct(6,s=>_("div",{key:`probe-heading-${s}`,ref_for:!0,ref:r=>e.setHeadingWrapper(s,r),class:De(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":`heading-${s}`},[V(p(Z4),{node:n(s),"index-key":`probe-heading-${s}`},null,8,["node","index-key"])],10,C4e)),64))],4))}})),[["__scopeId","data-v-3e0766e2"]]),RF=ot({name:"InfographicBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=D(()=>{var n,i;return hb((i=O1(e.estimatedPreviewHeightPx))!=null?i:db(String((n=e.node.code)!=null?n:"")))});return()=>{var n;return Fn("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?Fn("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)"}},[Fn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[Fn("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),Fn("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),Fn("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},()=>Fn("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,Fn("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[Fn("pre",{class:"infographic-pending-source text-sm font-mono whitespace-pre-wrap",style:{position:"absolute",inset:"0",zIndex:"1",margin:"0",padding:"var(--ms-inset-panel-body)",overflow:"auto",textAlign:"left"}},String((n=e.node.code)!=null?n:"")),Fn("div",{class:"absolute inset-0"},[Fn("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}}),OF=ot({name:"MermaidBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=D(()=>{var n,i;return fb((i=O1(e.estimatedPreviewHeightPx))!=null?i:cb(String((n=e.node.code)!=null?n:"")))});return()=>{var n;return Fn("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?Fn("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)"}},[Fn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[Fn("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),Fn("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},()=>Fn("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[Fn("span",{class:"action-icon block"})])))]):null,Fn("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)"}},[Fn("pre",{class:"mermaid-source-code text-sm font-mono whitespace-pre-wrap",style:{position:"absolute",inset:"0",margin:"0",padding:"var(--ms-inset-panel-body)",overflow:"auto",textAlign:"left"}},String((n=e.node.code)!=null?n:"")),Fn("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"}})])])}}}),x4e={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:32,renderBatchSize:48,renderBatchDelay:6,renderBatchBudgetMs:8,renderBatchIdleTimeoutMs:60,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"},minimal:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:32,renderBatchSize:48,renderBatchDelay:6,renderBatchBudgetMs:8,renderBatchIdleTimeoutMs:60,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"}};function Vs(e){if(e==null)return"";if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}const S4e=["data-custom-id"],_4e=["data-node-index","data-node-type"],PF="typewriter-simple-cursor-target",zq=Ei(ot(Dn(Bt({},{name:"NodeRenderer"}),{__name:"NodeRenderer",props:{content:{},nodes:{},final:{type:Boolean},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},mode:{},domMode:{},htmlPolicy:{},viewportPriority:{type:Boolean,default:void 0},viewportPriorityOptions:{},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,String],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","copy-code","handleArtifactClick","click","mouseover","mouseout","virtual-state-change","height-change","render-settled","render-final","anchor-change"],setup(e,{expose:t,emit:n}){const i=e,o=n;function s(j){if(!(typeof Event<"u"&&j instanceof Event))return typeof j=="string"&&o("copy-code",j),void o("copy",j)}const r=gs(),l=en("markstreamNestedRendererProps",void 0);function a(j){const oe=r?.vnode.props;return!!oe&&(Object.prototype.hasOwnProperty.call(oe,j)||Object.prototype.hasOwnProperty.call(oe,String(j).replace(/[A-Z]/g,ye=>`-${ye.toLowerCase()}`)))}function u(j){var oe,ye;const we=i[j];return a(j)?we:(ye=(oe=l?.value)==null?void 0:oe[j])!=null?ye:we}const c=D(()=>{return(j=u("mode"))==="chat"||j==="minimal"||j==="docs"?j:"docs";var j}),d=D(()=>AF(u("typewriter"))),f=D(()=>d.value!=="off"),h=D(()=>u("domMode")==="minimal"?"minimal":"full"),m=D(()=>{return(j={mode:c.value,codeRenderer:u("codeRenderer"),renderCodeBlocksAsPre:u("renderCodeBlocksAsPre")}).renderCodeBlocksAsPre===!0?"pre":j.codeRenderer==="pre"||j.codeRenderer==="shiki"||j.codeRenderer==="monaco"?j.codeRenderer:j.renderCodeBlocksAsPre===!1||j.mode==="docs"?"monaco":"pre";var j}),g=D(()=>x4e[c.value]),y=D(()=>{var j;return(j=u("showTooltips"))!=null?j:g.value.showTooltips}),k=D(()=>{var j;return(j=u("fade"))!=null?j:g.value.fade}),v=D(()=>{var j;return(j=u("batchRendering"))!=null?j:g.value.batchRendering}),C=D(()=>{var j;return(j=u("initialRenderBatchSize"))!=null?j:g.value.initialRenderBatchSize}),w=D(()=>{var j;return(j=u("renderBatchSize"))!=null?j:g.value.renderBatchSize}),M=D(()=>{var j;return(j=u("renderBatchDelay"))!=null?j:g.value.renderBatchDelay}),L=D(()=>{var j;return(j=u("renderBatchBudgetMs"))!=null?j:g.value.renderBatchBudgetMs}),E=D(()=>{var j;return(j=u("renderBatchIdleTimeoutMs"))!=null?j:g.value.renderBatchIdleTimeoutMs}),S=D(()=>{var j;return(j=u("deferNodesUntilVisible"))!=null?j:g.value.deferNodesUntilVisible}),x=D(()=>{var j;return(j=u("maxLiveNodes"))!=null?j:g.value.maxLiveNodes}),A=D(()=>{var j;return(j=u("liveNodeBuffer"))!=null?j:g.value.liveNodeBuffer}),T=D(()=>{var j;return(j=u("nodeVirtual"))!=null?j:g.value.nodeVirtual}),I={get content(){return i.content},get nodes(){return i.nodes},get final(){return i.final},get parseOptions(){return u("parseOptions")},get customMarkdownIt(){return u("customMarkdownIt")},get debugPerformance(){return i.debugPerformance},get customHtmlTags(){return u("customHtmlTags")},get mode(){return u("mode")},get domMode(){return h.value},get htmlPolicy(){return u("htmlPolicy")},get viewportPriority(){return u("viewportPriority")},get viewportPriorityOptions(){return u("viewportPriorityOptions")},get codeBlockStream(){return u("codeBlockStream")},get codeBlockDarkTheme(){return u("codeBlockDarkTheme")},get codeBlockLightTheme(){return u("codeBlockLightTheme")},get codeBlockMonacoOptions(){return u("codeBlockMonacoOptions")},get codeRenderer(){return u("codeRenderer")},get renderCodeBlocksAsPre(){return u("renderCodeBlocksAsPre")},get codeBlockMinWidth(){return u("codeBlockMinWidth")},get codeBlockMaxWidth(){return u("codeBlockMaxWidth")},get codeBlockProps(){return u("codeBlockProps")},get mermaidProps(){return u("mermaidProps")},get d2Props(){return u("d2Props")},get infographicProps(){return u("infographicProps")},get showTooltips(){return y.value},get themes(){return u("themes")},get langs(){return u("langs")},get isDark(){return u("isDark")},get customId(){return u("customId")},get indexKey(){return i.indexKey},get typewriter(){return u("typewriter")},get smoothStreaming(){return i.smoothStreaming},get smoothStreamingOptions(){return u("smoothStreamingOptions")},get parseCoalesceMs(){return u("parseCoalesceMs")},get fade(){return k.value},get batchRendering(){return v.value},get initialRenderBatchSize(){return C.value},get renderBatchSize(){return w.value},get renderBatchDelay(){return M.value},get renderBatchBudgetMs(){return L.value},get renderBatchIdleTimeoutMs(){return E.value},get deferNodesUntilVisible(){return S.value},get maxLiveNodes(){return x.value},get liveNodeBuffer(){return A.value},get nodeVirtual(){return T.value},get virtualScroll(){return i.virtualScroll},get renderAsFragment(){return i.renderAsFragment}};function O(j){o("height-change",j)}function H(j){o("virtual-state-change",j)}function R(j){o("anchor-change",j)}const F=q(),P=q(null),z=q(null),W=q(null),$=po({1:null,2:null,3:null,4:null,5:null,6:null}),K=q(!1),ne=new Map,G=q(0),te=q(0),le=q({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function ie(j,oe){return typeof j!="string"?oe:j.trim()||oe}function _e(j){const oe=Number(j);return Number.isFinite(oe)&&oe>0?Math.max(1,Math.trunc(oe)):640}const Z=D(()=>{var j;const oe=(j=I.viewportPriorityOptions)!=null?j:{},ye=ie(oe.rootMargin,gp);return{rootMargin:ye,heavyBlockMargin:ie(oe.heavyBlockMargin,ye),maxTargets:_e(oe.maxTargets)}}),se=D(()=>{var j;return(j=Z.value.rootMargin)!=null?j:gp}),he=D(()=>{var j;return(j=Z.value.maxTargets)!=null?j:640});function Y(){var j,oe;if(((j=i.virtualScroll)==null?void 0:j.enabled)!==!0)return null;const ye=(oe=i.virtualScroll)==null?void 0:oe.scrollRoot;return J(typeof ye=="function"?ye():ye)}function J(j){return j?typeof HTMLElement<"u"&&j instanceof HTMLElement?j:typeof j=="object"&&"value"in j?J(j.value):typeof j=="object"&&"$el"in j?J(j.$el):null:null}Gn(Aq,Z);const{isClient:U,renderAsFragment:Q,debugPerformanceEnabled:ue,resolvedShowTooltips:me,resolvedHtmlPolicy:pe,inheritedSmoothStreaming:ee,ownsTypewriterCursor:re}=(function(j){const oe=typeof window<"u",ye=qm(),we=en("markstreamHtmlPolicy",void 0),Ee=en("markstreamTypewriterCursor",void 0),He=en("markstreamSmoothStreaming",void 0),Je=D(()=>j.renderAsFragment===!0),nt=D(()=>!!(j.debugPerformance&&oe&&typeof console<"u")),vt=D(()=>{var gt;if(typeof j.showTooltips=="boolean")return j.showTooltips;const Xe=(gt=ye.showTooltips)!=null?gt:ye["show-tooltips"];return Xe===""||Xe===!0||Xe==="true"||Xe!==!1&&Xe!=="false"&&void 0}),it=D(()=>{var gt,Xe;return(Xe=(gt=j.htmlPolicy)!=null?gt:we?.value)!=null?Xe:"safe"}),lt=D(()=>Ee?.value!==!0);return{isClient:oe,renderAsFragment:Je,debugPerformanceEnabled:nt,resolvedShowTooltips:vt,resolvedHtmlPolicy:it,inheritedSmoothStreaming:He,inheritedTypewriterCursor:Ee,ownsTypewriterCursor:lt}})(I),{resolveViewportRoot:ge,resolveScrollContainer:ae,isReverseFlexScrollRoot:Ce,getNormalizedScrollTop:ve,getOffsetTopWithinRoot:ce}=(function(j,oe){function ye(){var nt,vt;return(vt=(nt=oe.scrollRoot)==null?void 0:nt.call(oe))!=null?vt:null}function we(nt){if(typeof window>"u")return null;const vt=ye();if(vt)return vt;const it=nt??j.value;if(!it)return null;const lt=it.ownerDocument||document,gt=lt.scrollingElement||lt.documentElement;let Xe=it;for(;Xe&&Xe!==lt.body&&Xe!==gt;){if(k4e(window.getComputedStyle(Xe))&&b4e(Xe))return Xe;Xe=Xe.parentElement}return null}function Ee(nt){if(!oe.isClient)return!1;try{const vt=window.getComputedStyle(nt);return!!(vt.display||"").toLowerCase().includes("flex")&&(vt.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function He(nt,vt,it){var lt,gt;if(it)return Je(vt);const Xe=nt.scrollTop;if(!Ee(nt))return Xe;const at=Xe<0?-Xe:Xe;return Math.max(0,((lt=nt.scrollHeight)!=null?lt:0)-((gt=nt.clientHeight)!=null?gt:0))-at}function Je(nt){var vt,it,lt,gt,Xe;const at=Number((vt=nt.scrollingElement)==null?void 0:vt.scrollTop),It=Number((lt=(it=nt.documentElement)==null?void 0:it.scrollTop)!=null?lt:0),At=Number((Xe=(gt=nt.body)==null?void 0:gt.scrollTop)!=null?Xe:0);return Math.max(0,Number.isFinite(at)?at:0,Number.isFinite(It)?It:0,Number.isFinite(At)?At:0)}return{resolveViewportRoot:we,resolveScrollContainer:function(nt){var vt,it,lt,gt;const Xe=ye();if(Xe)return Xe;const at=we((vt=nt??j.value)!=null?vt:null);if(at)return at;const It=(gt=(lt=nt?.ownerDocument)!=null?lt:(it=j.value)==null?void 0:it.ownerDocument)!=null?gt:typeof document<"u"?document:null;return It?.scrollingElement||It?.documentElement||null},isReverseFlexScrollRoot:Ee,getNormalizedScrollTop:He,getOffsetTopWithinRoot:function(nt,vt){const it=vt.ownerDocument||nt.ownerDocument||document;if((function(at,It){return at===It.documentElement||at===It.body||at===It.scrollingElement})(vt,it))return nt.getBoundingClientRect().top+Je(it);const lt=vt.getBoundingClientRect(),gt=nt.getBoundingClientRect(),Xe=He(vt,it,!1);return gt.top-lt.top+Xe}}})(F,{isClient:U,scrollRoot:Y});Gn("markstreamShowTooltips",me),Gn("markstreamHtmlPolicy",pe),Gn("markstreamTypewriter",f),Gn("markstreamFade",D(()=>I.fade!==!1)),Gn("markstreamTypewriterCursor",D(()=>!0)),Gn("markstreamTextStreamState",ne),Gn("markstreamStreamVersion",G),Gn("markstreamParseOptions",D(()=>I.parseOptions)),Gn("markstreamCustomMarkdownIt",D(()=>I.customMarkdownIt));const{smoothStreamingEnabled:Te,renderContent:ke,requestedFinal:Ae,effectiveFinal:Ne}=(function(j,oe){const ye=v4e(Bt(Bt({},y4e),j.smoothStreamingOptions)),we=D(()=>{var Xe,at,It;return j.smoothStreaming!==!1&&!((Xe=j.nodes)!=null&&Xe.length)&&(j.smoothStreaming===!0||!((at=oe.inheritedSmoothStreaming)!=null&&at.value))&&(j.smoothStreaming===!0||AF(j.typewriter)!=="off"||((It=j.maxLiveNodes)!=null?It:0)<=0)}),Ee=q(!oe.isClient||j.smoothStreaming===!0);gn(()=>{Ee.value=!0});const He=D(()=>Ee.value&&we.value),Je=D(()=>{var Xe;return He.value?ye.visible.value:(Xe=j.content)!=null?Xe:""}),nt=D(()=>{var Xe,at;const It=(Xe=j.parseOptions)!=null?Xe:{};return(at=j.final)!=null?at:It.final}),vt=D(()=>{const Xe=nt.value;return He.value&&Xe!=null?!!Xe&&ye.caughtUp.value:Xe});let it=0,lt=!1;function gt(){it=0,lt=!1}return ze([()=>j.content,()=>j.nodes,He,nt],([Xe,at,It,At])=>{if(at?.length)return gt(),void ye.reset("");const Ut=Xe??"";if(!It)return gt(),ye.reset(Ut),void(At&&ye.finish({flush:!0}));const Dt=ye.source.value;if(Ut){if(Ut!==Dt)if(Ut.startsWith(Dt)){const rn=Ut.slice(Dt.length),cn=ye.pendingChars.value;rn.length<=8?(it++,lt||it>=2&&cn<=8?(lt=!0,ye.reset(Ut)):ye.enqueue(rn)):(gt(),ye.enqueue(rn))}else gt(),ye.reset(Ut)}else gt(),ye.reset("");At&&ye.finish()},{immediate:!0}),{smoothStream:ye,smoothStreamingEligible:we,smoothStreamingEnabled:He,renderContent:Je,requestedFinal:nt,effectiveFinal:vt}})(I,{isClient:U,inheritedSmoothStreaming:ee}),Ze=Ae.value===!0;Gn("markstreamSmoothStreaming",Te);const rt=q(!1),pt=q(!1),Rt=q(!1);let Ot="",Fe=!1,Pe=null;function be(){U&&Pe!=null&&(window.clearTimeout(Pe),Pe=null)}function Oe(){rt.value=!1,be()}function Ke(j,oe){if(!ue.value)return;const ye=(function(){if(!ue.value)return null;const we=We(Qe),Ee=We(mt),He=Math.max(Se,Ee);if(we<=0&&He<=0)return null;const Je={total:we,maxPerFrame:He,byLabel:(nt=Qe,Object.fromEntries(Array.from(nt.entries()).sort((vt,it)=>it[1]-vt[1]||vt[0].localeCompare(it[0]))))};var nt;return Qe.clear(),mt.clear(),Se=0,Je})();console.info(`[markstream-vue][perf] ${j}`,ye?Dn(Bt({},oe),{layoutReads:ye}):oe)}ze([()=>I.indexKey,()=>I.customId],()=>{var j,oe;Oe(),pt.value=!1,Rt.value=!((j=i.nodes)!=null&&j.length)&&Ae.value!==!0&&!!i.content,Ot=(oe=ke.value)!=null?oe:"",Fe=Ot.length>0},{flush:"sync"}),ze([()=>i.content,()=>i.nodes,Ae],([j,oe,ye])=>{!oe?.length&&ye!==!0&&j&&(Rt.value=!0)},{flush:"sync",immediate:!0}),ze([ke,()=>i.nodes,Ae],([j,oe,ye])=>{const we=j??"";return oe?.length||ye===!0?(Oe(),pt.value=!1,Ot=we,void(Fe=!0)):(we.length>0&&(Rt.value=!0),Fe?(Ot&&we.length>Ot.length&&we.startsWith(Ot)?(rt.value=!0,pt.value=!0,U&&(be(),Pe=window.setTimeout(()=>{var Ee;Pe=null,Ne.value===!0||(Ee=i.nodes)!=null&&Ee.length||(Gp(),rt.value=!1,_c())},1200))):(we.length"u")return null;const He=window;if(He.__markstreamLayoutReadPerformance)return He.__markstreamLayoutReadPerformance;const Je={total:0,maxPerFrame:0,byLabel:{}};return He.__markstreamLayoutReadPerformance=Je,Je})();Ee&&(Ee.total=Number(Ee.total||0)+1,Ee.byLabel[we]=Number(Ee.byLabel[we]||0)+1,Ee.currentFrameTotal=Number(Ee.currentFrameTotal||0)+1,Ee.frameScheduled||(Ee.frameScheduled=!0,typeof window.requestAnimationFrame!="function"?typeof queueMicrotask!="function"?setTimeout(()=>Tt(Ee),0):queueMicrotask(()=>Tt(Ee)):window.requestAnimationFrame(()=>Tt(Ee))))})(j),dt||(dt=!0,U&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(ut):typeof queueMicrotask!="function"?setTimeout(ut,0):queueMicrotask(ut)))}function Ve(j,oe){return tt(j),oe()}const kt=I.customId?`renderer-${I.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,Wt=(function(j){const oe=new Map;return{scope:j,cache:oe,clear:()=>oe.clear()}})(kt),Nn=kt;Gn(Lq,Wt);const Sn=vs(()=>I.customId),{effectiveCustomHtmlTagsSet:Yi,mergedParseOptions:Ji,parsedNodes:Zt,getParsedNodesDirtyStartIndex:Ro,getParsedNodesRevision:Js}=m4e(I,{instanceMsgId:kt,renderContent:ke,effectiveFinal:Ne,smoothStreamingEnabled:Te,debugPerformanceEnabled:ue,customComponentsMap:Sn,logPerf:Ke});ze(Zt,()=>{rt.value||Wt.clear(),G.value+=1},{immediate:!0});const ji=D(()=>({customId:I.customId,customHtmlTags:Ji.value.customHtmlTags,parseOptions:I.parseOptions,customMarkdownIt:I.customMarkdownIt,htmlPolicy:pe.value,viewportPriority:I.viewportPriority,viewportPriorityOptions:Z.value,mode:c.value,domMode:I.domMode,codeRenderer:m.value,codeBlockStream:I.codeBlockStream,codeBlockDarkTheme:I.codeBlockDarkTheme,codeBlockLightTheme:I.codeBlockLightTheme,codeBlockMonacoOptions:I.codeBlockMonacoOptions,renderCodeBlocksAsPre:I.renderCodeBlocksAsPre,codeBlockMinWidth:I.codeBlockMinWidth,codeBlockMaxWidth:I.codeBlockMaxWidth,codeBlockProps:I.codeBlockProps,mermaidProps:I.mermaidProps,d2Props:I.d2Props,infographicProps:I.infographicProps,showTooltips:me.value,themes:I.themes,langs:I.langs,isDark:I.isDark,typewriter:f.value,smoothStreamingOptions:I.smoothStreamingOptions,parseCoalesceMs:I.parseCoalesceMs,fade:I.fade}));Gn("markstreamNestedRendererProps",ji);const Fr=D(()=>Zt.value),Oo=D(()=>Zt.value.length),pr=q(null),Zo=q(null),Po=q(null),fo=q(null),Ps=i.indexKey!=null&&String(i.indexKey).startsWith("list-item-"),$l=!Ps&&I.customId?yF(I.customId):null,mr=D(()=>$l?(S8.value,yF(I.customId)):null),Ue=D(()=>{var j;return!!(!Q.value&&I.customId&&!Ps&&((j=mr.value)!=null&&j.enabled))}),Ge=D(()=>!!(U&&Ue.value)),Ye=D(()=>{var j;return!!(!Q.value&&((j=i.virtualScroll)!=null&&j.enabled))}),fn=D(()=>Ye.value),xt=q(!1);gn(()=>{xt.value=!0});const hn=D(()=>!!(U&&Ye.value));Gn("markstreamHostScrollManaged",hn);const So=D(()=>!!(xt.value&&hn.value)),ei=D(()=>Ge.value||hn.value),Li=D(()=>Ge.value||So.value),Mt=D(()=>{var j;return ei.value&&((j=mr.value)==null?void 0:j.textEstimation)!==!1});function ht(){const j=te.value||Ve("getMeasuredContainerWidth.clientWidth",()=>{var oe;return((oe=F.value)==null?void 0:oe.clientWidth)||0});return Number.isFinite(j)&&j>0?j:0}const $t=D(()=>{const j=ht();return j>0?Math.max(1,Math.round(j)):640}),Vt=D(()=>{var j,oe;return!(Ne.value!==!0||Ye.value||c.value!=="chat"&&c.value!=="minimal"||a("maxLiveNodes")||a("liveNodeBuffer")||(j=i.nodes)!=null&&j.length||Rt.value||!(((oe=I.maxLiveNodes)!=null?oe:0)<=0))}),Un=D(()=>{var j;return Vt.value?50:Math.max(1,(j=I.maxLiveNodes)!=null?j:320)}),Ri=D(()=>{var j;return Vt.value?16:Math.max(0,(j=I.liveNodeBuffer)!=null?j:60)}),An=D(()=>{var j;return!Q.value&&I.nodeVirtual!==!1&&!(((j=I.maxLiveNodes)!=null?j:0)<=0&&!Vt.value)&&(I.nodeVirtual===!0?Zt.value.length>0:Zt.value.length>Un.value)}),Ga=D(()=>An.value||Ge.value||hn.value),va=D(()=>I.viewportPriority!==!1),Xf=D(()=>!!va.value&&!K.value);var Dr;Dr=D(()=>va.value),Gn(xq,Dr);const zl=D(()=>{var j;return!(Q.value||I.deferNodesUntilVisible===!1||((j=I.maxLiveNodes)!=null?j:0)<=0||An.value||Zt.value.length>900||I.viewportPriority===!1)}),gr=Q9e(j=>{var oe;return ge((oe=j??F.value)!=null?oe:null)},va),{requestFrame:Go,cancelFrame:Xi,hasIdleCallback:vr,isTestEnv:yr}=(function(j){const oe=j.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,ye=j.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,we=j.isClient&&typeof window.requestIdleCallback=="function",Ee=(function(){var He;if(typeof globalThis>"u"||!("process"in globalThis))return;const Je=(He=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:He.value;return Je?.env})();return{requestFrame:oe,cancelFrame:ye,hasIdleCallback:we,isTestEnv:Ee?.NODE_ENV==="test"}})({isClient:U}),Qa=D(()=>Ne.value===!0&&!Ye.value),{resolvedBatchSize:jl,resolvedInitialBatch:ol,batchingEnabled:Eu,incrementalRenderingActive:ya,renderedCount:Bs,previousRenderContext:Bo,adaptiveBatchSize:ks,previousBatchConfig:Hl}=(function(j,oe){var ye;const we=D(()=>{var gt;const Xe=Math.trunc((gt=j.renderBatchSize)!=null?gt:80);return Number.isFinite(Xe)?Math.max(0,Xe):0}),Ee=D(()=>{var gt;const Xe=Math.trunc((gt=j.initialRenderBatchSize)!=null?gt:we.value);return Number.isFinite(Xe)?Math.max(0,Xe):we.value}),He=D(()=>!oe.renderAsFragment.value&&j.batchRendering!==!1&&we.value>0&&oe.isClient&&!oe.isTestEnv),Je=q(0),nt=q({key:j.indexKey,total:0}),vt=q(Math.max(1,we.value||1)),it=D(()=>{var gt,Xe,at;return He.value&&!((gt=oe.continuousStreaming)!=null&>.value)&&!((Xe=oe.forceFullRenderFinalContent)!=null&&Xe.value)&&((at=j.maxLiveNodes)!=null?at:0)<=0}),lt=q({batchSize:we.value,initial:Ee.value,delay:(ye=j.renderBatchDelay)!=null?ye:16,enabled:it.value});return{resolvedBatchSize:we,resolvedInitialBatch:Ee,batchingEnabled:He,incrementalRenderingActive:it,renderedCount:Je,previousRenderContext:nt,adaptiveBatchSize:vt,previousBatchConfig:lt}})(I,{isClient:U,isTestEnv:yr,renderAsFragment:Q,forceFullRenderFinalContent:Qa,continuousStreaming:D(()=>pt.value&&Ne.value!==!0)}),bs=D(()=>{var j;return!Q.value&&I.batchRendering!==!1&&jl.value>0&&!yr&&((j=I.maxLiveNodes)!=null?j:0)<=0&&!Qa.value}),Ai=D(()=>bs.value),$o=D(()=>ei.value||Ai.value),Hi=D(()=>{var j;return $o.value&&((j=mr.value)==null?void 0:j.codeBlockEstimation)!==!1}),xi=new Map,Rr=new Map,Ya=new WeakMap;let zo=null;const Ja=new WeakMap,_o=new Map,sl=[];let Qo=[],vo=[],ai=-1;const ws=_u(sl),Xs=new Set,Or=q(0);let kr=0;const bc=q(0),wc=D(()=>(bc.value,Array.from(xi.entries()).sort((j,oe)=>j[0]-oe[0]))),Xa=q(null),jo=q(null);let Cs,Pr=null,br=0,Io=null;function ui(){Cs.markFallbackHeightPrefixDirty()}function Br(j){return Cs.getFallbackNodeHeight(j)}function $s(j,oe){return Cs.estimateHeightRange(j,oe)}function Wl(j){return Cs.estimateIndexForOffset(j)}const{activeRestoreAnchor:lo,getRelativeScrollTopWithinContainer:Lu,setRelativeScrollTopWithinContainer:ka,resolveAnchorOffset:md,clearRestoreReconcile:ql,scheduleRestoreReconcile:ba,captureRestoreAnchor:wr,restoreAnchor:wa,getAnchorDrift:As}=(function(j){const{isClient:oe,containerRef:ye,parsedNodeCount:we,requestFrame:Ee,cancelFrame:He,resolveScrollContainer:Je,getNormalizedScrollTop:nt,getOffsetTopWithinRoot:vt,isReverseFlexScrollRoot:it,estimateIndexForOffset:lt,estimateHeightRange:gt,getFallbackNodeHeight:Xe,clamp:at}=j,It=q(null);let At=null,Ut=[];function Dt(){const Cn=Je(),Wn=ye.value;if(!Cn||!Wn)return null;const Jn=Cn.ownerDocument||Wn.ownerDocument||document;if(Cn===Jn.documentElement||Cn===Jn.body||Cn===Jn.scrollingElement){const Oi=Wn.getBoundingClientRect();return Math.max(0,-Oi.top)}return Math.max(0,nt(Cn,Jn,!1)-vt(Wn,Cn))}function rn(Cn){var Wn;const Jn=Je(),Oi=ye.value;if(!Jn||!Oi)return;const er=Math.max(0,Cn),Us=Jn.ownerDocument||Oi.ownerDocument||document,nu=Us.defaultView||(typeof window<"u"?window:null);if(Jn===Us.documentElement||Jn===Us.body||Jn===Us.scrollingElement){const Ru=nt(Jn,Us,!0)+Oi.getBoundingClientRect().top;return void((Wn=nu?.scrollTo)==null||Wn.call(nu,0,Math.max(0,Ru+er)))}wF(Jn,Us,vt(Oi,Jn)+er,{isReverseFlexScrollRoot:Ru=>{var _g;return(_g=it?.(Ru))!=null&&_g},getNormalizedScrollTop:nt})}function cn(Cn){const Wn=we.value,Jn=at(Cn.nodeIndex,0,Math.max(0,Wn-1));return gt(0,Jn)+Math.max(0,Cn.offsetWithinNodePx)}function wn(){if(At!=null&&(He?.(At),At=null),oe)for(const Cn of Ut)window.clearTimeout(Cn);Ut=[]}function yn(Cn){const Wn=cn(Cn),Jn=Dt();Jn!=null&&Math.abs(Jn-Wn)<=.5||rn(Wn)}return{activeRestoreAnchor:It,getRelativeScrollTopWithinContainer:Dt,setRelativeScrollTopWithinContainer:rn,resolveAnchorOffset:cn,clearRestoreReconcile:wn,applyRestoreAnchor:yn,scheduleRestoreReconcile:function(){It.value&&oe&&At==null&&(At=Ee?Ee(()=>{At=null,It.value&&yn(It.value)}):null,At==null&&It.value&&yn(It.value))},captureRestoreAnchor:function(){const Cn=Dt(),Wn=we.value;if(Cn==null||Wn<=0)return null;const Jn=at(lt(Cn+1),0,Wn-1),Oi=gt(0,Jn),er=Xe(Jn);return{nodeIndex:Jn,offsetWithinNodePx:at(Cn-Oi,0,Math.max(0,er-1))}},restoreAnchor:function(Cn){const Wn=we.value;if(It.value={nodeIndex:at(Cn.nodeIndex,0,Math.max(0,Wn-1)),offsetWithinNodePx:Math.max(0,Cn.offsetWithinNodePx)},wn(),yn(It.value),oe)for(const Jn of[0,120,280,480])Ut.push(window.setTimeout(()=>{It.value&&yn(It.value)},Jn))},getAnchorDrift:function(Cn){const Wn=Dt();return Wn==null?null:Wn-cn(Cn)}}})({isClient:U,containerRef:F,parsedNodeCount:Oo,requestFrame:Go,cancelFrame:Xi,resolveScrollContainer:()=>Xa.value||ae(),getNormalizedScrollTop:ve,getOffsetTopWithinRoot:ce,isReverseFlexScrollRoot:Ce,estimateIndexForOffset:Wl,estimateHeightRange:$s,getFallbackNodeHeight:Br,clamp:Xo}),{nodeHeights:rl,heightStats:ao,heightTreeSize:eo,heightSumTree:Ul,heightKnownTree:gd,averageNodeHeight:Vl,resetHeightMeasurements:Kl,pruneHeightMeasurements:Zl,rebuildHeightTrees:ll,recordNodeHeight:vd,removeNodeHeights:Ca,exportHeightCache:eu,importHeightCache:Cc,fenwickRangeSum:zs}=(function(j={}){const oe=po({}),ye=po({total:0,count:0}),we=q(0),Ee=q([]),He=q([]);function Je(){for(const Xe of Object.keys(oe))delete oe[Number(Xe)];ye.total=0,ye.count=0,we.value=0,Ee.value=[],He.value=[]}function nt(Xe,at,It){for(let At=at+1;At0;At-=At&-At)It+=Xe[At];return It}function it(Xe){we.value=Xe;const at=new Array(Xe+1).fill(0),It=new Array(Xe+1).fill(0);for(const[At,Ut]of Object.entries(oe)){const Dt=Number(At),rn=Number(Ut);!Number.isFinite(Dt)||Dt<0||Dt>=Xe||!Number.isFinite(rn)||rn<=0||(nt(at,Dt,rn),nt(It,Dt,1))}Ee.value=at,He.value=It}function lt(Xe){if(!Number.isInteger(Xe)||Xe<0)return!1;const at=oe[Xe];if(!Number.isFinite(at)||at<=0)return!1;if(delete oe[Xe],ye.total=Math.max(0,ye.total-at),ye.count=Math.max(0,ye.count-1),we.value>Xe){const It=Ee.value,At=He.value;It.length&&At.length&&(nt(It,Xe,-at),nt(At,Xe,-1))}return!0}const gt=D(()=>ye.count>0?Math.max(12,ye.total/ye.count):32);return{nodeHeights:oe,heightStats:ye,heightTreeSize:we,heightSumTree:Ee,heightKnownTree:He,averageNodeHeight:gt,resetHeightMeasurements:Je,pruneHeightMeasurements:function(Xe){if(Xe<=0)return void Je();let at=0,It=0;for(const[At,Ut]of Object.entries(oe)){const Dt=Number(At),rn=Number(Ut);!Number.isFinite(Dt)||Dt<0||Dt>=Xe||!Number.isFinite(rn)||rn<=0?delete oe[Dt]:(at+=rn,It++)}ye.total=at,ye.count=It},rebuildHeightTrees:it,recordNodeHeight:function(Xe,at,It={}){(function(At,Ut,Dt={}){var rn;if(!Number.isFinite(Ut)||Ut<=0)return!1;const cn=oe[At];if(cn&&(Dt.allowShrink===!1&&UtAt){const wn=Ee.value,yn=He.value;if(wn.length&&yn.length)if(cn){const Cn=Ut-cn;Cn!==0&&nt(wn,At,Cn)}else nt(wn,At,Ut),nt(yn,At,1)}Dt.notify!==!1&&((rn=j.onHeightRecorded)==null||rn.call(j))})(Xe,at,Dn(Bt({},It),{notify:!0}))},removeNodeHeight:function(Xe,at={}){var It;const At=lt(Xe);return At&&at.notify!==!1&&((It=j.onHeightRecorded)==null||It.call(j)),At},removeNodeHeights:function(Xe,at={}){var It;let At=0;for(const Ut of Xe)lt(Number(Ut))&&At++;return At>0&&at.notify!==!1&&((It=j.onHeightRecorded)==null||It.call(j)),At},exportHeightCache:function(){return Object.entries(oe).map(([Xe,at])=>({index:Number(Xe),height:Number(at)})).filter(Xe=>Number.isFinite(Xe.index)&&Xe.index>=0&&Number.isFinite(Xe.height)&&Xe.height>0).sort((Xe,at)=>Xe.index-at.index)},importHeightCache:function(Xe,at={}){var It;if(!Array.isArray(Xe))return;const At=we.value;let Ut=!1;if(at.mode!=="merge"){const Dt=Object.keys(oe);if(Dt.length>0){for(const rn of Dt)delete oe[Number(rn)];Ut=!0}}for(const Dt of Xe){const rn=Number(Dt.index),cn=Number(Dt.height);if(!Number.isInteger(rn)||rn<0||At>0&&rn>=At||!Number.isFinite(cn)||cn<=0)continue;const wn=oe[rn];wn&&Math.abs(wn-cn)<=1||(oe[rn]=cn,Ut=!0)}Ut&&((function(){let Dt=0,rn=0;const cn=we.value;for(const[wn,yn]of Object.entries(oe)){const Cn=Number(wn),Wn=Number(yn);!Number.isFinite(Cn)||Cn<0||cn>0&&Cn>=cn||!Number.isFinite(Wn)||Wn<=0?delete oe[Cn]:(Dt+=Wn,rn++)}ye.total=Dt,ye.count=rn})(),At>0&&it(At),(It=j.onHeightRecorded)==null||It.call(j))},fenwickRangeSum:function(Xe,at,It){if(It<=at)return 0;const At=vt(Xe,It-1);return at<=0?At:At-vt(Xe,at-1)}}})({onHeightRecorded:()=>{ui(),hn.value&&bg(),lo.value&&ba(),jo.value&&Vp(),to("node-resize")}});function Yo(j){Number.isInteger(j)&&j>=0&&Xs.add(j)}function js(j){for(const oe of j)Yo(Number(oe))}function Hs(j){kr++;let oe=!0;try{const ye=j();return oe=ye!==!1,ye}finally{kr--,kr===0&&oe&&Or.value++}}function qe(){Qo=[],vo=[],ai=-1,Xs.clear(),ws.value=sl}function Re(){qe(),Hs(()=>Kl()),_o.clear()}function ct(j){!Number.isInteger(j)||j<0||j>=Zt.value.length||_o.set(j,ug(j))}function un(j,oe,ye={}){const we=rl[j];Yo(j),vd(j,oe,ye);const Ee=rl[j];return Object.is(we,Ee)?(Xs.delete(j),!1):(Ee&&Ee>0?ct(j):we&&_o.delete(j),!0)}function Rn(j,oe){const ye=Ve("getNodeLayoutHeight.slot.offsetHeight",()=>{var we,Ee;return(Ee=(we=xi.get(j))==null?void 0:we.offsetHeight)!=null?Ee:0});return ye>0?ye:Ve("getNodeLayoutHeight.content.offsetHeight",()=>oe.offsetHeight)}function In(j,oe={}){oe.mode!=="merge"?qe():js(j.map(ye=>ye.index)),Hs(()=>Cc(j,oe)),Hw()}const oi=D(()=>zl.value&&Xf.value),Si=D(()=>{var j;return!Q.value&&I.batchRendering!==!1&&jl.value>0&&((j=I.maxLiveNodes)!=null?j:0)<=0}),xs=D(()=>!Q.value&&Ze&&Ne.value===!0&&!An.value&&!Ye.value&&!Ue.value&&!oi.value&&!Si.value),al=D(()=>!!gr&&oi.value),ul=D(()=>An.value||hn.value),{focusIndex:Ho,liveRange:uo,updateLiveRange:tu}=(function(j,oe){const{parsedNodeCount:ye,virtualizationEnabled:we,maxLiveNodesResolved:Ee,liveNodeBufferResolved:He,clamp:Je}=oe,nt=He??D(()=>{var lt;return Math.max(0,(lt=j.liveNodeBuffer)!=null?lt:60)}),vt=q(0),it=po({start:0,end:0});return{liveNodeBufferResolved:nt,focusIndex:vt,liveRange:it,updateLiveRange:function(){const lt=ye.value;if(!we.value||lt===0)return it.start=0,void(it.end=lt);const gt=Math.min(Ee.value,lt),Xe=nt.value,at=Je(vt.value-Xe,0,Math.max(0,lt-gt));it.start=at,it.end=Math.min(lt,at+gt)}}})(I,{parsedNodeCount:Oo,virtualizationEnabled:An,maxLiveNodesResolved:Un,liveNodeBufferResolved:Ri,clamp:Xo}),$r=new Map,Aa=new Map,Gl=new Map,Nu=[],cl=new Map,zr=new Set,Fu=q(0);let yd=!1;const dl=D(()=>(Fu.value,zr.size)),Yn=new Map,Ss=new Map,Cr=q(0),fl=D(()=>{Cr.value;let j=0;for(const oe of Yn.values())j+=Math.max(0,oe);return j});let Ws=null;const Ac=D(()=>{if(!An.value)return Zt.value.length;const j=Ri.value,oe=Math.max(uo.end+j,ol.value),ye=Math.min(Zt.value.length,oe);return Math.max(Bs.value,ye)});function xc(){yd||(yd=!0,queueMicrotask(()=>{yd=!1,Fu.value+=1}))}function Ie(j,oe,ye="node-resize"){if(!U||typeof window>"u")return null;const we=window.setTimeout(()=>{zr.delete(we)&&xc();try{oe()}finally{to(ye)}},Math.max(0,j));return zr.add(we),xc(),we}function $e(j){U&&j!=null&&(zr.delete(j)&&xc(),window.clearTimeout(j))}function yt(){if(U&&typeof window<"u")for(const j of zr)window.clearTimeout(j);zr.size&&(zr.clear(),xc()),Nu.length=0,Gl.clear()}function Ht(j){P.value=j}function vn(j){z.value=j}function Bn(j){W.value=j}const{cancelScheduledFocusSync:Vn,scheduleFocusSync:ti}=(function(j){const{isClient:oe,containerRef:ye,virtualizationEnabled:we,requestFrame:Ee,cancelFrame:He,syncFocusToScroll:Je}=j;let nt=null;function vt(){var lt,gt,Xe;return(Xe=(gt=(lt=ye.value)==null?void 0:lt.ownerDocument)==null?void 0:gt.defaultView)!=null?Xe:typeof window<"u"?window:null}function it(){if(!nt)return;const lt=vt();nt.viaTimeout?lt?lt.clearTimeout(nt.id):clearTimeout(nt.id):He?.(nt.id),nt=null}return{cancelScheduledFocusSync:it,scheduleFocusSync:function(lt={}){if(!we.value)return;if(!oe)return void Je(!0);if(lt.immediate)return it(),void Je(!0);if(nt)return;const gt=()=>{nt=null,Je()};if(Ee)return void(nt={id:Ee(gt),viaTimeout:!1});const Xe=vt();nt={id:Xe?Xe.setTimeout(gt,16):setTimeout(gt,16),viaTimeout:!0}}}})({isClient:U,containerRef:F,virtualizationEnabled:An,requestFrame:Go,cancelFrame:Xi,syncFocusToScroll:function(j=!1){var oe;if(!An.value)return;const ye=Xa.value||ae();if(!ye)return;const we=ye.ownerDocument||((oe=F.value)==null?void 0:oe.ownerDocument)||document,Ee=we?.defaultView||(typeof window<"u"?window:null),He=ye===we?.documentElement||ye===we?.body,Je=Zt.value.length;if(Je<=0)return;if(!He&&Je>0&&Ce(ye)){const At=Ve("syncFocusToScroll.clientHeight",()=>ye.clientHeight||0),Ut=Ve("syncFocusToScroll.scrollTop",()=>ye.scrollTop),Dt=Ut<0?-Ut:Ut;return void kd(Xo((nt=Math.max(0,Dt)+.5*Math.max(0,At),Cs.estimateIndexForOffsetFromEnd(nt)),0,Math.max(0,Je-1)),j)}var nt;const vt=(function(At,Ut,Dt,rn){const cn=F.value;if(!cn)return null;const wn=rn?0:Ve("syncFocusToScroll.model.root.getBoundingClientRect",()=>At.getBoundingClientRect().top),yn=Ve("syncFocusToScroll.model.container.getBoundingClientRect",()=>cn.getBoundingClientRect().top),Cn=Math.max(0,wn-yn),Wn=rn?Ve("syncFocusToScroll.model.viewport.clientHeight",()=>{var Jn,Oi,er,Us;return(Us=(er=(Oi=Dt?.innerHeight)!=null?Oi:(Jn=Ut.documentElement)==null?void 0:Jn.clientHeight)!=null?er:At.clientHeight)!=null?Us:0}):Ve("syncFocusToScroll.model.root.clientHeight",()=>At.clientHeight);return Xo(Wl(Cn+.5*Math.max(0,Wn)),0,Math.max(0,Zt.value.length-1))})(ye,we,Ee,He);if(vt!=null)return void kd(vt,j);const it=He?null:Ve("syncFocusToScroll.root.getBoundingClientRect",()=>ye.getBoundingClientRect()),lt=He?0:it.top,gt=He?Ve("syncFocusToScroll.viewport.clientHeight",()=>{var At,Ut;return(Ut=(At=Ee?.innerHeight)!=null?At:ye.clientHeight)!=null?Ut:0}):it.bottom,Xe=wc.value;let at=null,It=null;for(const[At,Ut]of Xe){if(!Ut)continue;const Dt=Ve("syncFocusToScroll.slot.getBoundingClientRect",()=>Ut.getBoundingClientRect());Dt.bottom<=lt||Dt.top>=gt||(at==null&&(at=At),It=At)}if(at==null||It==null){const At=F.value;if(!At)return;const Ut=He?{top:0}:Ve("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>ye.getBoundingClientRect()),Dt=Ve("syncFocusToScroll.fallback.scrollTop",()=>ve(ye,we,He)),rn=He?(()=>{const wn=Ve("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>At.getBoundingClientRect()),yn=(He?0:Ut.top)-wn.top;return Math.max(0,yn)})():(()=>{const wn=ce(At,ye);return Math.max(0,Dt-wn)})(),cn=He?Ve("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var wn,yn,Cn,Wn;return(Wn=(Cn=(yn=Ee?.innerHeight)!=null?yn:(wn=we?.documentElement)==null?void 0:wn.clientHeight)!=null?Cn:ye.clientHeight)!=null?Wn:0}):Ve("syncFocusToScroll.fallback.root.clientHeight",()=>ye.clientHeight);return void kd(Xo(Wl(rn+.5*Math.max(0,cn)),0,Math.max(0,Zt.value.length-1)),!0)}kd(Math.round((at+It)/2),j)}}),{visibleNodeIndices:Jo,nodeVisibilityHandles:hl,nodeVisibilityWatchStops:Ql,nodeVisibilityFallbackTimers:Pp,clearVisibilityFallback:Bp,markNodeVisible:Du,cleanupNodeVisibility:D2,destroyNodeVisibilityState:rg}=g4e({isClient:U,shouldTrackVisibleNodeIndices:()=>oi.value,shouldCleanupNodeVisibility:()=>An.value,onNodeMarkedVisible:j=>{An.value?ti():Ho.value=Xo(j,0,Math.max(0,Zt.value.length-1))},onNodeVisibilityCleaned:j=>{xi.delete(j)&&gI()}}),{cleanupScrollListener:R2,setupScrollListener:O2}=(function(j){const{isClient:oe,virtualizationEnabled:ye,listenerEnabled:we,scrollRootElement:Ee,resolveScrollContainer:He,scheduleFocusSync:Je,onScroll:nt}=j;let vt=null,it=null;function lt(){vt&&(vt(),vt=null),it=null,Ee.value=null}function gt(Xe){const at=j.getScrollTop?j.getScrollTop(Xe):Xe.scrollTop;return Math.max(0,Number.isFinite(at)?Math.abs(at):0)}return{cleanupScrollListener:lt,setupScrollListener:function(){if(!oe)return;if(!((Xe=we?.value)!=null?Xe:ye.value))return void lt();var Xe;const at=He();if(!at)return void lt();if(Ee.value===at&&vt)return;lt(),it=gt(at);const It=()=>{if(nt?.(),ye.value){const At=(function(Ut){const Dt=gt(Ut),rn=it;it=Dt;const cn=Math.max(480,.75*(Ut.clientHeight||0));return rn==null?Dt>cn?{immediate:!0}:void 0:Math.abs(Dt-rn)>cn?{immediate:!0}:void 0})(at);At?Je(At):Je()}};at.addEventListener("scroll",It,{passive:!0}),Ee.value=at,vt=()=>{at.removeEventListener("scroll",It)}}}})({isClient:U,virtualizationEnabled:An,listenerEnabled:ul,scrollRootElement:Xa,resolveScrollContainer:ae,scheduleFocusSync:ti,onScroll:function(){const j=jo.value;if(!j)return;const oe=ag();if(!oe||(function(we){if(pg()>=br)return Io=null,!1;const Ee=Io;if(Ee==null)return!0;const He=Math.abs(we.scrollTop-Ee)<=2;return He||(Io=null),He})(oe))return;const ye=oI(oe);ye!=null?(ye<-32||Math.abs(Math.max(0,ye)-Math.max(0,j.distanceFromBottomPx))>32)&&Up("restore"):Up("restore")},getScrollTop:j=>{var oe;const ye=j.ownerDocument||((oe=F.value)==null?void 0:oe.ownerDocument)||document,we=j===ye.documentElement||j===ye.body||j===ye.scrollingElement;return Ve("scrollListener.getScrollTop",()=>ve(j,ye,we))}});function kd(j,oe=!1){const ye=Xo(j,0,Math.max(0,Zt.value.length-1));!oe&&Math.abs(ye-Ho.value)<=1||(Ho.value=ye,tu())}function Xo(j,oe,ye){return Math.min(Math.max(j,oe),ye)}function $p(j=Zt.value.length){const oe=Ro();return!Number.isInteger(oe)||oe<0?j:Xo(oe,0,j)}function bd(j){return j?.firstElementChild}function P2(j,oe){var ye;return j?(ye=j.matches)!=null&&ye.call(j,oe)?j:j.querySelector(oe):null}function wd(j,oe){j<1||j>6||($[j]=oe)}function B2(){if(!ei.value)return void(te.value=0);const j=Ve("updateExperimentContainerWidth.clientWidth",()=>{var oe,ye;return(ye=(oe=F.value)==null?void 0:oe.clientWidth)!=null?ye:0});te.value=j>0?j:0}let Cd=null;function lg(){Cd?.disconnect(),Cd=null}const zp=d0("ViewportDeferredMarkdownCodeBlockNode",Xu({loader:()=>io(null,null,function*(){return(yield qo(()=>import("./index5-CI5HVqyi.js"),__vite__mapDeps([6,4,5]))).default}),loadingComponent:gb,delay:0,suspensible:!1}),gb);function Me(j){return j===zp}const st=D(()=>m.value==="pre"?bl:m.value==="shiki"?zp:k8);function et(){var j;return((j=I.codeBlockProps)==null?void 0:j.showHeader)!==!1}function _t(j,oe,ye){const we=rl[oe],Ee=typeof we=="number"&&we>0;if(Mt.value&&!Ee&&!(function(He){return!!Sn.value.paragraph&&(He.type==="paragraph"||He.type==="list_item"||He.type==="list")})(j)){const He=Eq(j,ye,le.value);if(He)return He}if(Hi.value&&j.type==="code_block"){const He=(function(Je){if(Je.type!=="code_block")return null;const nt=MI(Je,Z2(Je));return Me(nt)?"markdown":nt===bl?"pre":nt===st.value||nt===k8?"monaco":null})(j);if(He==="monaco"||He==="markdown"||He==="pre")return(function(Je,nt){var vt,it,lt;if(!Je||Je.type!=="code_block")return null;const gt=nt.rendererKind,Xe=gt!=="pre"&&nt.showHeader!==!1,at=!!Je.diff;let It=0,At=500;if(gt==="monaco"){const Dt=(vt=nt.monacoOptions)!=null?vt:{},rn=M8(Je,Dt,nt.width),cn=(function(yn){const Cn=typeof yn?.fontSize=="number"&&yn.fontSize>0?yn.fontSize:12;return typeof yn?.lineHeight=="number"&&yn.lineHeight>0?yn.lineHeight:Math.round(1.5*Cn)})(Dt),wn=(function(yn,Cn){var Wn,Jn;const Oi=typeof((Wn=yn?.padding)==null?void 0:Wn.top)=="number"?yn.padding.top:Cn?0:8,er=typeof((Jn=yn?.padding)==null?void 0:Jn.bottom)=="number"?yn.padding.bottom:Cn?0:8;return Math.max(0,Oi)+Math.max(0,er)})(Dt,at);At=typeof Dt.MAX_HEIGHT=="number"&&Dt.MAX_HEIGHT>0?Dt.MAX_HEIGHT:500,It=Math.round(rn*cn+wn)}else if(gt==="markdown"){const Dt=M8(Je);It=Math.round(21*Dt+32)}else{const Dt=M8(Je);It=Math.round(28*Dt),At=Number.POSITIVE_INFINITY}const Ut=Math.max(1,Math.min(It,At));return Bt({kind:"code-block",height:Math.round(Ut+(Xe?40:0)),contentHeight:Ut,rendererKind:gt},at&>==="monaco"?{diffInline:Wx((it=nt.monacoOptions)!=null?it:{},(lt=nt.width)!=null?lt:0)}:{})})(j,{rendererKind:He,monacoOptions:I.codeBlockMonacoOptions,showHeader:et(),width:ye})}return null}Y1(()=>{if(Or.value,kr>0)return;const j=Zt.value,oe=Js();if(!j.length||!$o.value)return Qo=[],vo=[],ai=-1,Xs.clear(),void(ws.value=sl);const ye=te.value||Ve("estimatedNodeHeights.clientWidth",()=>{var it;return((it=F.value)==null?void 0:it.clientWidth)||0});if(!Number.isFinite(ye)||ye<=0)return Qo=[],vo=[],ai=-1,Xs.clear(),void(ws.value=sl);const we=(function(it){return[Math.round(it),Mt.value,Hi.value,le.value,I.codeBlockMonacoOptions,et(),m.value,Sn.value,S8.value]})(ye),Ee=Qo.length<=j.length&&(Je=we,(He=vo).length===Je.length&&He.every((it,lt)=>Object.is(it,Je[lt])));var He,Je;const nt=Ee&&ai===oe?j.length:Ee?$p(j.length):0,vt=Ee?Array.from(Xs):[];Qo.length=j.length;for(let it=nt;it=0&&itws.value);Cs=(function(j){let oe=!0,ye=[0],we="";function Ee(lt){var gt;const Xe=j.nodeHeights[lt];if(Number.isFinite(Xe)&&Xe>0)return Xe;const at=j.parsedNodes.value[lt],It=at?.type,At=!!((gt=j.hasCustomParagraphComponent)!=null&>.call(j)),Ut=j.estimatedNodeHeights.value[lt],Dt=Ut?.height;if(!(function(cn,wn,yn){return!!(yn&&wn?.kind==="simple-text"&&(cn==="paragraph"||cn==="list_item"||cn==="list"))})(It,Ut,At)&&Number.isFinite(Dt)&&Dt>0)return Dt;const rn=o4e(at,j.getContainerWidth()||640);return It==="heading"||It==="paragraph"&&rn<=28&&(function(cn,wn){if(wn)return!1;const yn=cn.children;return!Array.isArray(yn)||!yn.length||yn.every(Nq)})(at,At)?rn:Math.max(j.averageNodeHeight.value,rn)}function He(){var lt;const gt=j.parsedNodes.value.length,Xe=j.getPrefixCacheKeyParts().join(":");if(!oe&&we===Xe)return ye;const at=new Array(gt+1);at[0]=0;for(let It=0;It=((gt=It[at])!=null?gt:0))return at-1;let At=0,Ut=at-1,Dt=at-1;for(;At<=Ut;){const rn=At+Ut>>1;((Xe=It[rn+1])!=null?Xe:0)>=lt?(Dt=rn,Ut=rn-1):At=rn+1}return Dt}function nt(lt,gt){var Xe,at;if(lt>=gt)return 0;if(j.heightEstimationActive.value)return(function(Ut,Dt){var rn,cn;const wn=j.parsedNodes.value.length,yn=xF(Math.trunc(Ut),0,wn),Cn=xF(Math.trunc(Dt),yn,wn);if(yn>=Cn)return 0;const Wn=He();return((rn=Wn[Cn])!=null?rn:0)-((cn=Wn[yn])!=null?cn:0)})(lt,gt);if(j.heightTreeSize.value!==j.parsedNodes.value.length){let Ut=0;for(let Dt=lt;Dtyn<=0?0:j.fenwickRangeSum(At,0,yn)+(yn-j.fenwickRangeSum(Ut,0,yn))*It;let rn=0,cn=Xe.length-1,wn=Xe.length-1;for(;rn<=cn;){const yn=rn+cn>>1;Dt(yn+1)>=lt?(wn=yn,cn=yn-1):rn=yn+1}return wn}let at=lt;for(let It=0;It0||lt++}return lt}return{markFallbackHeightPrefixDirty:function(){oe=!0},getFallbackNodeHeight:Ee,estimateHeightRange:nt,estimateIndexForOffset:vt,estimateIndexForOffsetFromEnd:function(lt){var gt,Xe;const at=j.parsedNodes.value;if(!at.length)return 0;if(lt<=0)return Math.max(0,at.length-1);if(j.heightEstimationActive.value){const At=(gt=He()[at.length])!=null?gt:0;return Je(Math.max(0,At-lt))}if(j.heightTreeSize.value===at.length){const At=nt(0,at.length);return vt(Math.max(0,At-lt))}let It=lt;for(let At=at.length-1;At>=0;At--){const Ut=(Xe=j.nodeHeights[At])!=null?Xe:j.averageNodeHeight.value;if(It<=Ut)return At;It-=Ut}return 0},getEstimatedNodeHeightCount:it,buildVirtualHeightSummary:function(lt){var gt;const Xe=j.parsedNodes.value.length;return{totalNodes:Xe,measuredCount:j.heightStats.count,estimatedCount:it(),averageNodeHeight:j.averageNodeHeight.value,topSpacerHeight:lt.topSpacerHeight,bottomSpacerHeight:lt.bottomSpacerHeight,estimatedTotalHeight:nt(0,Xe),width:(gt=lt.width)!=null?gt:j.getContainerWidth()}}}})({parsedNodes:Zt,nodeHeights:rl,heightStats:ao,heightTreeSize:eo,heightSumTree:Ul,heightKnownTree:gd,averageNodeHeight:Vl,heightEstimationActive:ei,estimatedNodeHeights:an,getContainerWidth:ht,hasCustomParagraphComponent:()=>!!Sn.value.paragraph,getPrefixCacheKeyParts:()=>{var j;const oe=zg(te.value||Ve("getFallbackHeightPrefix.clientWidth",()=>{var we;return((we=F.value)==null?void 0:we.clientWidth)||0})),ye=((j=i.virtualScroll)==null?void 0:j.measurementKey)==null?"":String(i.virtualScroll.measurementKey);return[Zt.value.length,ao.count,Math.round(ao.total),Math.round(100*Vl.value),ye,oe,ei.value?1:0,S8.value,G.value,Sn.value.paragraph?1:0]},fenwickRangeSum:zs}),ze(()=>Zt.value.length,j=>{var oe;ui(),j<=0?Re():(jZl(oe))),j!==eo.value&&ll(j))},{immediate:!0});const On=D(()=>{if(!An.value)return Zt.value.map((we,Ee)=>({node:we,index:Ee}));const j=Zt.value.length,oe=Xo(uo.start,0,j),ye=Xo(uo.end,oe,j);return Zt.value.slice(oe,ye).map((we,Ee)=>({node:we,index:oe+Ee}))}),xn=D(()=>An.value?$s(0,Math.min(uo.start,Zt.value.length)):0),En=D(()=>{if(!An.value)return 0;const j=Zt.value.length;return $s(Math.min(uo.end,j),j)});function Mn(){return Cs.buildVirtualHeightSummary({topSpacerHeight:xn.value,bottomSpacerHeight:En.value,width:th()})}function Wi(){const j=Zt.value,oe=Mn();return Dn(Bt({},oe),{probe:{paragraphReady:!!le.value.paragraph,listItemReady:!!le.value.listItem,listWrapperOverhead:le.value.listWrapperOverhead,headingReadyLevels:Object.entries(le.value.headings).filter(([,ye])=>!!ye).map(([ye])=>Number(ye))},nodes:j.map((ye,we)=>{var Ee,He,Je,nt,vt,it,lt,gt,Xe;return{index:we,type:ye.type,estimateKind:(He=(Ee=an.value[we])==null?void 0:Ee.kind)!=null?He:null,rendererKind:(nt=(Je=an.value[we])==null?void 0:Je.rendererKind)!=null?nt:null,estimatedHeight:(it=(vt=an.value[we])==null?void 0:vt.height)!=null?it:null,estimatedContentHeight:(gt=(lt=an.value[we])==null?void 0:lt.contentHeight)!=null?gt:null,measuredHeight:(Xe=rl[we])!=null?Xe:null}})})}function qs(){return i.indexKey!=null?String(i.indexKey):Ye.value?`virtual-${vi()}`:"markdown-renderer"}function Yl(j){const oe=String(j),ye=`${qs()}-`;if(!oe.startsWith(ye))return null;const we=oe.slice(ye.length).match(/^(\d+)(?:$|-)/);if(!we)return null;const Ee=Number(we[1]);return!Number.isInteger(Ee)||Ee<0||Ee>=Zt.value.length?null:Ee}function vi(){var j,oe,ye;const we=(j=i.virtualScroll)==null?void 0:j.sessionKey;return String(we!=null&&we!==""?we:(ye=(oe=i.indexKey)!=null?oe:I.customId)!=null?ye:kt)}function qi(){var j;const oe=(j=i.virtualScroll)==null?void 0:j.threadKey;return oe==null||oe===""?void 0:String(oe)}const eh=D(()=>{var j,oe,ye;return(ye=qi())!=null?ye:String((oe=(j=i.indexKey)!=null?j:I.customId)!=null?oe:kt)});function _w(j){var oe;return(j??"")===((oe=qi())!=null?oe:"")}function Sc(){var j,oe,ye;return oe=(j=i.virtualScroll)==null?void 0:j.measurementKey,ye=(function(){const we=m.value;return(function(Ee){var He,Je;const nt=Ee.renderer,vt=nt==="monaco"?Ee.codeBlockMonacoOptions:void 0,it=Ee.codeBlockProps,lt=nt==="shiki";return[Ee.isDark?"dark":"light",nt==="monaco"?"code-rich":nt==="pre"?"code-pre":"code-shiki",Ee.codeBlockStream===!1?"code-static":"code-stream",Vs(Ee.codeBlockMinWidth),Vs(Ee.codeBlockMaxWidth),...lt?[Gye((He=it?.themes)!=null?He:Ee.themes,(Je=it?.langs)!=null?Je:Ee.langs)]:[],Vs(vt?.fontSize),Vs(vt?.lineHeight),Vs(vt?.fontFamily),Vs(vt?.tabSize),Vs(vt?.MAX_HEIGHT),Vs(vt?.wordWrap),Vs(vt?.wrappingIndent),Vs(vt?.padding),Vs(it?.showHeader),Vs(it?.showCopyButton),Vs(it?.showExpandButton),Vs(it?.showPreviewButton),Vs(it?.showCollapseButton),Vs(it?.showFontSizeButtons)].join("\0")})({renderer:we,isDark:I.isDark,codeBlockStream:I.codeBlockStream,codeBlockMinWidth:I.codeBlockMinWidth,codeBlockMaxWidth:I.codeBlockMaxWidth,codeBlockMonacoOptions:we==="monaco"?I.codeBlockMonacoOptions:void 0,codeBlockProps:I.codeBlockProps,themes:we==="shiki"?I.themes:void 0,langs:we==="shiki"?I.langs:void 0})})(),[oe==null?"":String(oe),ye].join("\0")}function th(){return ht()}const $2=D(()=>zg(th())),Jl=D(()=>[Sc(),$2.value].join("\0")),fY=D(()=>{var j;return Ye.value?["virtual",(j=qi())!=null?j:"",vi(),Jl.value].join("\0"):i.indexKey});function jp(){Cr.value+=1}function Iw(j){return!(!j||!Number.isInteger(j.index)||j.index<0||j.index>=Zt.value.length||j.sessionKey!==vi()||j.threadKey!==qi()||j.layoutEpochKey!==Jl.value)}function X_(j){const oe=String(j),ye=Ss.get(oe);return ye?Iw(ye)?ye.index:null:Yl(oe)}function eI(j="async-node"){(Yn.size||Ss.size)&&(Yn.clear(),Ss.clear(),jp(),to(j))}const Hp=en(MA,null),Mw={reportHeight(j,oe){if(!hn.value)return;const ye=X_(j);if(ye==null)return;const we=$r.get(ye);if(!we)return;const Ee=Number(oe),He=Rn(ye,we);(function(Je,nt,vt={}){Hs(()=>un(Je,nt,vt))})(ye,Number.isFinite(Ee)&&Ee>0?Math.max(Ee,He||0):He)},markPending(j){if(!hn.value)return;const oe=Yl(j);oe!=null&&(function(ye,we){var Ee;const He=Ss.get(ye);if(He&&Iw(He))return Yn.set(ye,Math.max(0,(Ee=Yn.get(ye))!=null?Ee:0)+1),jp(),void to("async-node");Yn.set(ye,1),Ss.set(ye,(function(Je){return{index:Je,sessionKey:vi(),threadKey:qi(),layoutEpochKey:Jl.value}})(we)),jp(),to("async-node")})(String(j),oe)},markSettled(j){if(!hn.value)return;const oe=String(j),ye=X_(j);(ye!=null||(function(we){return Yn.has(String(we))})(oe))&&(function(we){var Ee;const He=(Ee=Yn.get(we))!=null?Ee:0;return!(He<=0||(He<=1?(Yn.delete(we),Ss.delete(we)):Yn.set(we,He-1),jp(),He===1&&to("async-node"),0))})(oe)&&ye!=null&&_c()}};function hY(){let j=0;for(const oe of $r.values())j+=Ve("getVisibleDomHeight.offsetHeight",()=>{var ye;return(ye=oe?.offsetHeight)!=null?ye:0});return Math.ceil(Math.max(0,j))}Gn(MA,{reportHeight(j,oe){Mw.reportHeight(j,oe),Hp?.reportHeight(j,oe)},markPending(j){Mw.markPending(j),Hp?.markPending(j)},markSettled(j){Mw.markSettled(j),Hp?.markSettled(j)}});let Tw,Ew=null,Wp=null;function z2(j){return j!==!1&&j!=null&&j!==""}function tI(){return An.value?(function(){if(!An.value)return!0;const j=Zt.value.length,oe=Xo(uo.start,0,j),ye=Xo(uo.end,oe,j);if(oe>=ye)return!0;for(let we=oe;we=Ac.value}function Lw(){return Ne.value===!0&&!rt.value&&fl.value===0&&zr.size===0&&cl.size===0&&Ws==null&&tI()}function nI(){var j,oe;if(((j=i.virtualScroll)==null?void 0:j.settleMode)!=="manual"||Ew===vi()&&Tw===qi())return!0;const ye=(oe=i.virtualScroll)==null?void 0:oe.settledToken;return!!z2(ye)&&Wp===wg(ye)}function Nw(){return Lw()&&nI()}function pY(j,oe){return oe.totalNodes<=0?j==="final"?"final":"estimate":oe.measuredCount>=oe.totalNodes?j==="final"?"final":"measured":oe.measuredCount>0||oe.estimatedCount>0?"mixed":"estimate"}function nh(j="manual",oe){const ye=Mn(),we=(function(Ee){return Ee||(Ne.value!==!0?Zt.value.length>0?"streaming":"estimating":!tI()||cl.size>0||Ws!=null?"measuring":Nw()?"settled":"settling")})(oe);return{sessionKey:vi(),threadKey:qi(),phase:we,nodeCount:ye.totalNodes,liveRange:{start:uo.start,end:uo.end},renderedCount:Bs.value,measuredCount:ye.measuredCount,estimatedCount:ye.estimatedCount,averageNodeHeight:ye.averageNodeHeight,topSpacerHeight:ye.topSpacerHeight,bottomSpacerHeight:ye.bottomSpacerHeight,visibleDomHeight:hY(),totalHeight:iI(),width:ye.width,final:Ne.value===!0,stable:Nw(),confidence:pY(we,ye),reason:j}}function ag(){const j=Xa.value||ae(),oe=F.value;if(!j||!oe)return null;const ye=j.ownerDocument||oe.ownerDocument||document,we=j===ye.documentElement||j===ye.body||j===ye.scrollingElement,Ee=Ve("getScrollBox.scrollTop",()=>ve(j,ye,we)),He=Ve("getScrollBox.scrollHeight",()=>{var nt,vt,it,lt,gt;return we?Math.max((vt=(nt=ye.documentElement)==null?void 0:nt.scrollHeight)!=null?vt:0,(lt=(it=ye.body)==null?void 0:it.scrollHeight)!=null?lt:0,(gt=j.scrollHeight)!=null?gt:0):j.scrollHeight}),Je=Ve("getScrollBox.clientHeight",()=>{var nt;return we?((nt=ye.documentElement)==null?void 0:nt.clientHeight)||j.clientHeight||0:j.clientHeight});return{root:j,doc:ye,isViewportRoot:we,scrollTop:Ee,scrollHeight:He,clientHeight:Je}}function iI(){const j=Zt.value.length,oe=Math.max(0,$s(0,j)),ye=Ve("getRendererLogicalHeight.offsetHeight",()=>{var Ee,He;return(He=(Ee=F.value)==null?void 0:Ee.offsetHeight)!=null?He:0}),we=Math.max(0,ye>0?ye:Ve("getRendererLogicalHeight.scrollHeight",()=>{var Ee,He;return(He=(Ee=F.value)==null?void 0:Ee.scrollHeight)!=null?He:0}));return j<=0?Math.ceil(ye):An.value?oe>0?Math.max(1,Math.ceil(oe),(function(){let Ee=xn.value+En.value;for(const He of xi.values())He&&(Ee+=Math.max(0,Ve("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})(oe,we)):Math.max(1,Math.ceil(we)):hn.value?oe>0||ao.count>0||Cs.getEstimatedNodeHeightCount()>0?(ya.value&&Bs.value,Math.max(1,Math.ceil(we),Math.ceil(oe))):Math.ceil(we):Math.max(1,Math.ceil(we),Math.ceil(oe))}function oI(j){const oe=F.value;if(!oe)return null;const ye=Ve("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>oe.getBoundingClientRect());return(function(Ee){return Ee.isViewportRoot?Ee.clientHeight:Ve("getViewportBottomInRoot.getBoundingClientRect",()=>Ee.root.getBoundingClientRect().bottom)})(j)-ye.bottom}function mY(j={}){const oe=j.requireViewport!==!1,ye=(function(He=64){const Je=ag(),nt=F.value;if(!Je||!nt)return!1;const vt=(function(lt){if(lt.isViewportRoot)return{top:0,bottom:lt.clientHeight};const gt=Ve("getVirtualViewportRect.getBoundingClientRect",()=>lt.root.getBoundingClientRect());return{top:gt.top,bottom:gt.bottom}})(Je),it=Ve("isRendererNearVirtualViewport.getBoundingClientRect",()=>nt.getBoundingClientRect());return it.bottom>=vt.top-He&&it.top<=vt.bottom+He})();if(oe&&!ye)return null;const we=(function(){const He=ag(),Je=F.value;if(!He||!Je||Math.max(0,He.scrollHeight-He.scrollTop-He.clientHeight)>64)return null;const nt=oI(He);return nt==null?null:nt>=-8&&nt<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,nt)}:null})();if(we)return{anchor:we,captured:!0};const Ee=wr();if(Ee)return{anchor:{type:"node",nodeIndex:Ee.nodeIndex,offsetWithinNodePx:Ee.offsetWithinNodePx},captured:ye};if(j.allowFallback===!0){const He=(function(){const Je=Zt.value.length;return Je<=0?null:{type:"node",nodeIndex:Xo(Ho.value,0,Math.max(0,Je-1)),offsetWithinNodePx:0}})();return He?{anchor:He,captured:!1}:null}return null}function Fw(j){let oe=2166136261;for(let ye=0;ye>>0).toString(36)}function gY(j,oe){let ye=j;for(let we=0;we8192?`${we.slice(0,8192)}...${we.length}`:we;return`${we.length}:${Fw(Ee)}`})(j)}`;if(typeof j=="function")return"fn";if(typeof j!="object")return typeof j;if(oe.has(j))return"cycle";if(ye>=6)return"max-depth";oe.add(j);try{if(Array.isArray(j)){if(j.length<=160){const it=[];for(let lt=0;lt=nt&&Je.push(lt)}return[`a:${j.length}`,`h=${He.join(",")}`,`t=${Je.join(",")}`,`all=${(vt>>>0).toString(36)}`].join(":")}const we=j,Ee=Object.keys(we).filter(He=>{const Je=we[He];return He!=="parent"&&He!=="el"&&He!=="component"&&(Je==null||typeof Je=="string"||typeof Je=="number"||typeof Je=="boolean"||vY.has(He))}).sort();return`o:${Ee.length}:${Ee.map(He=>`${He}=${j2(we[He],oe,ye+1)}`).join(";")}`}finally{oe.delete(j)}}let Dw=-1,Rw="",ih=[2166136261];function ug(j){const oe=Zt.value[j];return oe?Fw(j2(oe)):""}function yY(j,oe){let ye=j;for(let we=0;we>>0}function Ow(){var j,oe;const ye=G.value;if(Dw===ye)return Rw;const we=Zt.value.length;let Ee=$p(we);(Dw!==ye-1||Ee>we||ih.length>>0).toString(36),Dw=ye,Rw}function qp(j,oe={}){var ye;const we=oe.includeHeightCache===!0,Ee=(ye=oe.includeContentHash)!=null?ye:we,He=we?(function(nt){const vt=(function(){var At,Ut;const Dt=Number((Ut=(At=i.virtualScroll)==null?void 0:At.heightCacheLimit)!=null?Ut:5e3);return!Number.isFinite(Dt)||Dt<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(Dt))})();if(!Number.isFinite(vt)||nt.length<=vt)return nt;const it=new Map,lt=At=>{!At||it.size>=vt||it.set(At.index,At)},gt=Zt.value.length,Xe=Xo(uo.start-2*Ri.value,0,gt),at=Xo(uo.end+2*Ri.value,Xe,gt);for(const At of nt)At.index>=Xe&&At.index=0&&it.sizeAt.index-Ut.index).slice(0,vt)})(eu().map(nt=>{var vt;const it=Zt.value[nt.index];return it?Dn(Bt({},nt),{nodeType:String((vt=it.type)!=null?vt:""),signature:ug(nt.index)}):null}).filter(nt=>!!nt)):[],Je=mY({allowFallback:oe.allowAnchorFallback===!0,requireViewport:oe.requireViewport});return Je||He.length||oe.includeEmptyState===!0?Dn(Bt({sessionKey:j.sessionKey,threadKey:j.threadKey},Je?{anchor:Je.anchor,anchorCaptured:Je.captured}:{anchorCaptured:!1}),{metrics:j,width:j.width,contentHash:Ee?Ow():void 0,measurementKey:Sc()||void 0,heightCache:He.length?He:void 0}):null}function Pw(j){var oe,ye;const we=ag();if(!we)return;const Ee=(function(nt){const vt=F.value;if(!vt)return null;const it=ce(vt,nt.root),lt=Zt.value.length,gt=Ve("getRendererBottomOffsetWithinRoot.offsetHeight",()=>vt.offsetHeight||0),Xe=Math.max(0,gt>0?gt:lt>0?Ve("getRendererBottomOffsetWithinRoot.scrollHeight",()=>vt.scrollHeight||0):0),at=iI();return it+Math.max(Xe,at)})(we);if(Ee==null)return;const He=Math.max(0,j.distanceFromBottomPx),Je=Math.max(0,Ee-we.clientHeight-He);(function(nt){br=pg()+120,Io=nt})(Je),we.isViewportRoot?(ye=(oe=we.doc.defaultView)==null?void 0:oe.scrollTo)==null||ye.call(oe,0,Je):wF(we.root,we.doc,Je,{isReverseFlexScrollRoot:Ce,getNormalizedScrollTop:ve})}const Bw=[];function sI(){if(U)for(Pr!=null&&(Xi?.(Pr),Pr=null);Bw.length;){const j=Bw.pop();j!=null&&window.clearTimeout(j)}}function Up(j){const oe=!!jo.value;jo.value=null,br=0,Io=null,sI(),oe&&j&&to(j)}function Vp(){if(!jo.value||!U||Pr!=null)return;const j=()=>{Pr=null;const oe=jo.value;oe&&Pw(oe)};Pr=Go?Go(j):null,Pr==null&&j()}function rI(j,oe={}){const ye=Zt.value.length;return ye<=0?[]:j.filter(we=>!(!Number.isInteger(we.index)||we.index<0||we.index>=ye)&&!(!Number.isFinite(we.height)||we.height<=0)&&!(oe.requireSignature&&!we.signature)&&!(oe.requireCompatibilityMetadata&&!we.nodeType&&!we.signature)&&(function(Ee){var He;const Je=Zt.value[Ee.index];return!(!Je||Ee.nodeType&&Ee.nodeType!==String((He=Je.type)!=null?He:"")||Ee.signature&&Ee.signature!==ug(Ee.index))})(we))}function lI(j){const oe=zg(th()),ye=zg(j);return oe!==-1&&ye!==-1&&oe===ye}function $w(j){var oe;const ye=Number(j?.width);if(Number.isFinite(ye)&&ye>0)return ye;const we=Number((oe=j?.metrics)==null?void 0:oe.width);return Number.isFinite(we)&&we>0?we:null}function aI(j){var oe;return j.sessionKey===vi()&&!!_w(j.threadKey)&&((oe=j.measurementKey)!=null?oe:"")===Sc()&&!!lI($w(j))&&!!(function(ye){const we=ye.heightCache;return!!we?.length&&(uI(ye)?we.some(Ee=>!!(Ee.nodeType||Ee.signature)):we.some(Ee=>!!Ee.signature))})(j)}function uI(j){return!!(j.contentHash&&j.contentHash===Ow())}function kY(j){return!uI(j)}let oh=null,sh=null,H2=null,cg=null,dg=null;function zw(j){var oe;const ye=j.map(Ee=>{var He,Je;return[Ee.index,Math.round(10*Ee.height),(He=Ee.nodeType)!=null?He:"",(Je=Ee.signature)!=null?Je:""].join("")}).join(""),we=zg(th());return[(oe=qi())!=null?oe:"",vi(),Sc(),Zt.value.length,we,j.length,Fw(ye)].join(":")}function cI(j=(oe=>(oe=i.virtualScroll)==null?void 0:oe.heightCache)()){if(!hn.value||!j?.length||Zt.value.length<=0||!lI((oe=i.virtualScroll)==null?void 0:oe.heightCacheWidth))return!1;var oe;const ye=rI(j,{requireSignature:!0});if(!ye.length)return!1;const we=zw(ye);return we===oh?(sh="standalone",!0):(In(ye,{mode:"merge"}),ui(),oh=we,sh="standalone",gg(),to("restore"),!0)}function jw(j,oe={}){var ye,we,Ee;if(!hn.value||!j||j.sessionKey!==vi()||!_w(j.threadKey)||Zt.value.length<=0)return!1;const He=!!((ye=j.heightCache)!=null&&ye.length)&&!W2(),Je=!j.anchor||j.anchorCaptured===!1&&oe.allowUncapturedAnchor!==!0?null:j.anchor,nt=oe.restoreAnchor===!0&&!!Je&&!W2()&&Number($w(j))>0;let vt=!1;if((we=j.heightCache)!=null&&we.length&&aI(j)){const lt=rI(j.heightCache,{requireCompatibilityMetadata:!j.contentHash,requireSignature:kY(j)});lt.length&&(In(lt,{mode:"merge"}),ui(),oh=zw(lt),sh="restore",gg(),vt=!0)}if(He||nt)return!1;if(!oe.restoreAnchor||!Je)return vt&&to("restore"),!0;const it=(function(lt,gt){var Xe;const at=lt.anchor,It=at?at.type==="bottom"?`bottom:${Math.round(at.distanceFromBottomPx)}`:`node:${at.nodeIndex}:${Math.round(at.offsetWithinNodePx)}`:"none";return[(Xe=qi())!=null?Xe:"",vi(),Sc(),$2.value,gt,It].join(":")})(j,(Ee=oe.restoreToken)!=null?Ee:"imperative");return H2===it?(vt&&to("restore"),!0):(H2=it,(function(lt){const gt=()=>{if(lt.type==="node")return Up(),void wa({nodeIndex:lt.nodeIndex,offsetWithinNodePx:lt.offsetWithinNodePx});if(ql(),lo.value=null,jo.value=lt,sI(),Pw(lt),U)for(const Xe of[0,120,280,480])Bw.push(window.setTimeout(()=>{const at=jo.value;at&&Pw(at)},Xe))};(function(Xe){if(!An.value)return!1;const at=Zt.value.length;return!(at<=0||(Ho.value=Xe.type==="node"?Xo(Xe.nodeIndex,0,at-1):at-1,tu(),0))})(lt)?ft(gt):gt()})(Je),to("restore"),!0)}function W2(){const j=th();return Number.isFinite(j)&&j>0}function dI(j){var oe;return j.sessionKey===vi()&&!!_w(j.threadKey)&&(Zt.value.length<=0||!(!((oe=j.heightCache)!=null&&oe.length)||W2())||!(!(j.anchor&&Number($w(j))>0)||W2()))}function Hw(){_o.clear();for(const j of Object.keys(rl)){const oe=Number(j);Number.isInteger(oe)&&oe>=0&&oe{let oe=!1,ye=null;const we=()=>{oe||(oe=!0,ye!=null&&window.clearTimeout(ye),j())};if(Go)return Go(we),void(ye=window.setTimeout(we,50));ye=window.setTimeout(we,0)})}function Ww(j,oe=qi(),ye=Jl.value){return vi()===j&&qi()===oe&&Jl.value===ye}function qw(){return io(this,arguments,function*(j={}){var oe,ye,we,Ee,He;const Je=vi(),nt=qi(),vt=Jl.value,it=(oe=j.frames)!=null?oe:2,lt=(ye=j.timeoutMs)!=null?ye:120,gt=(we=j.reason)!=null?we:"manual",Xe=j.expectedSettledTokenKey,at=j.flushPendingTimers===!0,It=nh(gt),At=()=>Dn(Bt({},It),{phase:It.final?"settling":It.phase,stable:!1,confidence:It.confidence==="final"?"mixed":It.confidence,reason:gt}),Ut=()=>Ww(Je,nt,vt)&&(Xe==null||mg()===Xe);for(let wn=0;wnwindow.setTimeout(yn,wn))})(lt),!Ut()||(at&&yt(),_c(),fg(),!Ut()))return At();const Dt=Lw();Dt&&(Ew=Je,Tw=nt,((Ee=i.virtualScroll)==null?void 0:Ee.settleMode)==="manual"&&Xe!=null&&z2((He=i.virtualScroll)==null?void 0:He.settledToken)&&mg()===Xe&&(Wp=wg(i.virtualScroll.settledToken)));const rn=Ut()&&Dt&&nI(),cn=nh(gt,rn?"final":void 0);return Gw(cn,!0),cn})}let Uw="content",rh=null,lh=null,Vw=0,hg=null,Kp=null,Kw=null,Zw=null;function pg(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function hI(j){var oe,ye;const we=hg;if(!we)return!0;const Ee=(ye=(oe=i.virtualScroll)==null?void 0:oe.heightDiffThresholdPx)!=null?ye:1;return Math.abs(j.totalHeight-we.totalHeight)>Ee||j.sessionKey!==we.sessionKey||j.phase!==we.phase||j.stable!==we.stable||j.final!==we.final||j.threadKey!==we.threadKey||j.nodeCount!==we.nodeCount||j.measuredCount!==we.measuredCount||j.width!==we.width}function mg(j=(oe=>(oe=i.virtualScroll)==null?void 0:oe.settledToken)()){return Vs(j)}function pI(j,oe){var ye,we;return[j,oe.sessionKey,(ye=oe.threadKey)!=null?ye:"",Sc(),Ow(),Vs((we=i.virtualScroll)==null?void 0:we.settledToken),Math.round(oe.totalHeight),Math.round(oe.width)].join("\0")}function gg(){Kw=null,Zw=null,Kp=null}function bY(j){const oe=j.heightCache;return oe?.length?zw(oe):""}function vg(j){var oe,ye,we;const Ee=j.metrics,He=j.anchor?(Je=j.anchor).type==="bottom"?`bottom:${Math.round(Je.distanceFromBottomPx)}`:`node:${Je.nodeIndex}:${Math.round(Je.offsetWithinNodePx)}`:"none";var Je;return[j.sessionKey,(oe=j.threadKey)!=null?oe:"",(ye=j.measurementKey)!=null?ye:Sc(),(we=j.contentHash)!=null?we:"",bY(j),He,j.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 Gw(j,oe=!1){if(!hn.value||(function(Je=!1){return!Je&&Ye.value&&!So.value})(oe))return;const ye=oe||hI(j),we=(function(Je,nt=!1){return nt||Je.stable||Je.phase==="final"?{state:qp(Je,{includeHeightCache:!0})}:{state:qp(Je)}})(j,oe),Ee=we.state,He=!!(Ee&&(ye||(function(Je,nt=!1){return!!nt||vg(Je)!==Kp})(Ee,oe)));if(ye&&(O(j),hg=j,Vw=pg()),Ee&&He&&(H(Ee),Ee.anchor&&R(Ee.anchor),Kp=vg(Ee)),j.stable){const Je=pI("settled",j);if(Je!==Kw){Kw=Je;const nt=qp(j,{includeHeightCache:!0});nt&&(H(nt),Kp=vg(nt)),(function(vt){o("render-settled",vt)})(j)}}if(j.phase==="final"){const Je=pI("final",j);if(Je!==Zw){Zw=Je;const nt=qp(j,{includeHeightCache:!0});nt&&(H(nt),Kp=vg(nt)),(function(vt){o("render-final",vt)})(j)}}}function Qw(){rh!=null&&(Xi?.(rh),rh=null),lh!=null&&U&&(window.clearTimeout(lh),lh=null)}function mI(){rh=null,lh=null,(function(j){if(cl.size>0||Ws!=null)return!0;switch(j){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(Uw)&&(_c(),fg()),Gw(nh(Uw))}function to(j){var oe,ye;if(!hn.value||(Uw=j,rh!=null||lh!=null))return;const we=Math.max(0,(ye=(oe=i.virtualScroll)==null?void 0:oe.emitIntervalMs)!=null?ye:32),Ee=Math.max(0,we-(pg()-Vw)),He=()=>{lh=null,rh=Go?Go(mI):null,rh==null&&mI()};U&&Ee>0?lh=window.setTimeout(He,Ee):He()}function gI(){bc.value+=1}function q2(j){if(ya.value&&j>=Bs.value){const oe=Zt.value[j],ye=Ae.value===!0&&Ne.value!==!0&&j>=Zt.value.length-2,we=oe?.type==="code_block"||oe?.type==="image"||oe?.type==="mermaid"||oe?.type==="infographic";if(!ye||we)return!1}return!oi.value||j=he.value&&(K.value||(K.value=!0,rg()),!al.value||!gr))return Zp(j),void(oe&&Du(j,!0));if(j{if(Pp.delete(He),!oi.value||Jo.value.has(He))return;const vt=xi.get(He);if(!vt)return;const it=ae(vt),lt=vt.ownerDocument||document,gt=lt.defaultView||window,Xe=!it||it===lt.documentElement||it===lt.body,at=!Xe&&it?Ve("nodeVisibilityFallback.root.getBoundingClientRect",()=>it.getBoundingClientRect()):null,It=Xe?0:at.top,At=Xe?Ve("nodeVisibilityFallback.clientHeight",()=>{var Dt,rn;return(rn=(Dt=gt.innerHeight)!=null?Dt:it?.clientHeight)!=null?rn:0}):at.bottom,Ut=Ve("nodeVisibilityFallback.node.getBoundingClientRect",()=>vt.getBoundingClientRect());Ut.bottom>=It-500&&Ut.top<=At+500&&Du(He,!0)},1800+Je);Pp.set(He,nt)})(j);let Ee=null;Ee=ze(()=>we.isVisible.value,He=>{if(He){Bp(j),Du(j,!0),Ee?.(),Ql.delete(j),hl.get(j)===we&&hl.delete(j);try{we.destroy()}catch{}}},{immediate:!0}),Ql.set(j,Ee),An.value&&ti()}function Yw(){Ws=null,Hs(()=>{let j=!1;for(const[oe,ye]of cl)cl.delete(oe),$r.get(oe)===ye.el&&Aa.get(oe)===ye.version&&(j=un(oe,ye.height,{allowShrink:ye.allowShrink})||j);return j})}function Gp(){Ws!=null&&(Xi?.(Ws),Ws=null),cl.clear()}function V2(j,oe){(function(ye,we,Ee){var He;if(!Number.isFinite(Ee)||Ee<=0||$r.get(ye)!==we)return;const Je=Aa.get(ye);if(Je==null)return;const nt=Zt.value[ye],vt=rt.value&&Ne.value!==!0&&!((He=i.nodes)!=null&&He.length)&&ye>=Zt.value.length-2,it=!(nt?.loading===!0||vt),lt=cl.get(ye),gt=lt?lt.allowShrink&&it:it,Xe=lt&&!gt?Math.max(lt.height,Ee):Ee;cl.set(ye,{height:Xe,allowShrink:gt,version:Je,el:we}),Ws==null&&(Ws=Go?Go(Yw):null,Ws==null&&Yw())})(j,oe,Rn(j,oe))}function _c(){for(const[j,oe]of $r)oe&&V2(j,oe)}function vI(){zo?.disconnect(),zo=null,Rr.clear()}function Jw(){for(;Nu.length;)$e(Nu.pop())}ze(So,j=>{j&&to("content")},{flush:"post"}),t({getVirtualMetrics:nh,captureVirtualState:function(j={}){var oe;return qp(nh("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:j.allowFallbackAnchor===!0,requireViewport:j.requireViewport===!0,includeEmptyState:(oe=j.includeEmptyState)==null||oe})},restoreVirtualState:function(j,oe={}){const ye=oe.restoreAnchor===!0,we=oe.restoreToken==null?"imperative":String(oe.restoreToken);cg=j,dg={restoreAnchor:ye,restoreToken:we,allowUncapturedAnchor:oe.allowUncapturedAnchor===!0},!jw(j,{restoreAnchor:ye,restoreToken:we,allowUncapturedAnchor:oe.allowUncapturedAnchor===!0})&&dI(j)||(cg=null,dg=null)},forceMeasure:function(j="manual"){return io(this,null,function*(){yield ft(),yield fI(),_c(),fg(),yield ft();const oe=nh(j);return Gw(oe,!0),oe})},settle:qw,scrollToNode:function(j,oe="start"){Up(),ql();const ye=Zt.value.length;if(ye<=0)return;const we=Xo(j,0,ye-1),Ee=()=>{var He;const Je=md({nodeIndex:we,offsetWithinNodePx:0}),nt=Br(we),vt=ag(),it=(He=vt?.clientHeight)!=null?He:0,lt=Lu();let gt=Je;if(oe==="center")gt=Je-it/2+nt/2;else if(oe==="end")gt=Je-it+nt;else if(oe==="nearest"&<!=null){if(Je>=lt&&Je+nt<=lt+it)return;gt=JeGa.value,j=>{if(!j){vI();for(const oe of Gl.values())for(const ye of oe)$e(ye);Gl.clear(),Aa.clear(),Jw(),Gp()}},{immediate:!0}),ze(Ne,j=>{j&&(function(){if(U&&Ne.value&&$r.size){Jw();for(const oe of[80,240,640]){const ye=Ie(oe,()=>{for(const[we,Ee]of $r)Ee&&V2(we,Ee)},"final");ye!=null&&Nu.push(ye)}}})(),to(j?"final":"content")});const wY=CF(()=>to("content"),16),CY=CF(()=>to("batch"),16);ze([()=>Zt.value.length,()=>Bs.value],()=>{jo.value&&Vp(),wY()},{flush:"post",immediate:!0}),ze([()=>uo.start,()=>uo.end],()=>{CY()},{flush:"post"});const{cleanupBatchScheduler:AY}=(function(j){const{props:oe,isClient:ye,isTestEnv:we,parsedNodesIdentity:Ee,parsedNodeCount:He,desiredRenderedCount:Je,datasetKey:nt,batchingEnabled:vt,incrementalRenderingActive:it,resolvedBatchSize:lt,resolvedInitialBatch:gt,renderedCount:Xe,adaptiveBatchSize:at,previousRenderContext:It,previousBatchConfig:At,requestFrame:Ut,cancelFrame:Dt,hasIdleCallback:rn,cleanupNodeVisibility:cn,onDatasetKeyChanged:wn,onDatasetChanged:yn}=j;let Cn=null,Wn="raf",Jn=null,Oi=0,er=!1,Us=!1;const nu=new Set,Ru=new Set;function _g(){if(ye){Cn!=null&&(Wn==="raf"&&Dt?Dt(Cn):Wn==="idle"&&typeof window.cancelIdleCallback=="function"?window.cancelIdleCallback(Cn):Wn==="timeout"&&window.clearTimeout(Cn),Cn=null),Oi+=1;for(const Ar of nu)Dt&&Dt(Ar);for(const Ar of Ru)window.clearTimeout(Ar);nu.clear(),Ru.clear(),Jn=null,er=!1,Us=!1}}function ty(){return typeof performance<"u"?performance.now():Date.now()}function RI(Ar){(function(Ic){var xd;if(!it.value)return;const Mc=Math.max(2,(xd=oe.renderBatchBudgetMs)!=null?xd:6),Tc=Math.max(1,lt.value||1),iu=Math.max(1,Math.floor(Tc/4));Ic>1.5*Mc?at.value=Math.max(iu,Math.floor(.8*at.value)):Ic<.6*Mc&&at.value=Mc)return;const Tc=Math.max(1,Ar),iu=()=>{const Jp=ty();Cn=null;const Ig=Jn??Tc;Jn=null;const Xp=ty();Xe.value=Math.min(Mc,Xe.value+Ig),cn(Xe.value),(function(s3,ny){if(!ye)return void RI(ny);er=!0;const $I=++Oi;ft().then(()=>{var zI;if($I!==Oi)return;const qY=ty(),UY=Math.max(ny,qY-s3),jI=()=>{$I===Oi&&RI(UY)};if(Ut){let uh=null,e1=null,WI=!1;const qI=()=>{WI||(WI=!0,uh!==null&&(nu.delete(uh),uh=null),e1!==null&&(Ru.delete(e1),window.clearTimeout(e1),e1=null),jI())};return uh=Ut(()=>{qI()}),nu.add(uh),e1=window.setTimeout(()=>{uh!==null&&Dt&&Dt(uh),qI()},Math.max(32,(zI=oe.renderBatchIdleTimeoutMs)!=null?zI:120)),void Ru.add(e1)}const HI=window.setTimeout(()=>{Ru.delete(HI),jI()},0);Ru.add(HI)})})(Jp,ty()-Xp)};if(!ye||ml.immediate)return void iu();const Sd=Math.max(0,(Ic=oe.renderBatchDelay)!=null?Ic:16);if(Jn=Jn!=null?Math.max(Jn,Tc):Tc,Cn==null){if(!we&&rn&&window.requestIdleCallback){const Jp=Math.max(0,(xd=oe.renderBatchIdleTimeoutMs)!=null?xd:120);return Wn="idle",void(Cn=window.requestIdleCallback(()=>iu(),{timeout:Jp}))}if(Ut&&!we)return Wn="raf",void(Cn=Ut(()=>{Sd===0?iu():(Wn="timeout",Cn=window.setTimeout(()=>iu(),Sd))}));Wn="timeout",Cn=window.setTimeout(()=>iu(),Sd)}}function PI(Ar,ml={}){er?Us=!0:Ar==null?BI():OI(Ar,ml)}function BI(){it.value&&OI(vt.value?Math.max(1,Math.round(at.value)):Math.max(1,lt.value))}return ze([Ee,He,nt,it,lt,gt,()=>oe.renderBatchDelay],()=>{var Ar;const ml=He.value,Ic=It.value,xd=nt.value,Mc=!Object.is(xd,Ic.key),Tc=ml!==Ic.total,iu=Mc||Tc;It.value={key:xd,total:ml};const Sd=At.value,Jp=(Ar=oe.renderBatchDelay)!=null?Ar:16,Ig=Sd.batchSize!==lt.value||Sd.initial!==gt.value||Sd.delay!==Jp||Sd.enabled!==it.value;At.value={batchSize:lt.value,initial:gt.value,delay:Jp,enabled:it.value},Mc&&wn(ml),(iu||Ig||!it.value)&&_g(),(iu||Ig)&&(at.value=Math.max(1,lt.value||1)),iu&&yn();const Xp=Je.value;if(!ml)return Xe.value=0,void cn(0);if(!it.value)return Xe.value=Xp,void cn(Xe.value);const s3=Mc||Ic.total===0;Xe.value=s3||Ig?Math.min(Xp,gt.value):Math.min(Xe.value,Xp);const ny=Math.max(1,gt.value||lt.value||ml);Xe.value{it.value&&(typeof ml=="number"&&Ar<=ml||Ar>Xe.value&&PI())}),{cleanupBatchScheduler:_g}})({props:I,isClient:U,isTestEnv:yr,parsedNodesIdentity:Fr,parsedNodeCount:Oo,desiredRenderedCount:Ac,datasetKey:fY,batchingEnabled:Eu,incrementalRenderingActive:ya,resolvedBatchSize:jl,resolvedInitialBatch:ol,renderedCount:Bs,adaptiveBatchSize:ks,previousRenderContext:Bo,previousBatchConfig:Hl,requestFrame:Go,cancelFrame:Xi,hasIdleCallback:vr,cleanupNodeVisibility:D2,onDatasetKeyChanged:j=>{Gp(),Re(),ui(),gg(),j>0&&ll(j)},onDatasetChanged:()=>{An.value&&ti({immediate:!0})}});ze([ul,An,()=>F.value,()=>Y()],([j,oe])=>{if(!j)return R2(),void Vn();O2(),oe?ti({immediate:!0}):Vn()},{flush:"post",immediate:!0}),ze([()=>Zt.value.length,()=>An.value],j=>io(null,[j],function*([oe,ye]){ye&&oe&&U&&(yield ft(),ti({immediate:!0}))}),{flush:"post"}),ze(ei,j=>{j&&(function(){var oe;if(pr.value&&Zo.value&&Po.value&&((oe=fo.value)!=null&&oe[1]))return;const ye=Lt({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),we=Lt({type:"list_item",children:[ye],raw:"- Probe paragraph text"}),Ee=Lt({type:"list",ordered:!1,items:[we],raw:"- Probe paragraph text"});pr.value=ye,Zo.value=we,Po.value=Ee;const He={1:null,2:null,3:null,4:null,5:null,6:null};for(let Je=1;Je<=6;Je++)He[Je]=Lt({type:"heading",level:Je,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(Je)} Probe heading`});fo.value=He})()},{immediate:!0}),ze([()=>F.value,ei],()=>{if(!ei.value)return lg(),void(te.value=0);B2(),lg(),ei.value&&F.value&&typeof ResizeObserver<"u"&&(Cd=new ResizeObserver(()=>{B2(),lo.value&&ba(),jo.value&&Vp(),to("resize")}),Cd.observe(F.value))},{immediate:!0}),ze([ei,$t,Jl],()=>io(null,null,function*(){if(!ei.value)return le.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void ui();yield ft(),(function(){if(!ei.value||typeof window>"u")return le.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void ui();const j={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},oe=P2(bd(P.value),".paragraph-node");j.paragraph=T8(P.value,oe,"pre-wrap");const ye=bd(z.value),we=ye?.querySelector(".paragraph-node");j.listItem=T8(z.value,we,"pre-wrap");const Ee=Ve("readSimpleTextProbeProfile.list.offsetHeight",()=>{var Je,nt;return(nt=(Je=W.value)==null?void 0:Je.offsetHeight)!=null?nt:0}),He=Ve("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var Je,nt;return(nt=(Je=z.value)==null?void 0:Je.offsetHeight)!=null?nt:0});j.listWrapperOverhead=Math.max(0,Ee-He);for(let Je=1;Je<=6;Je++){const nt=P2(bd($[Je]),`h${Je}`);j.headings[Je]=T8($[Je],nt,"pre-wrap")}le.value=j,ui()})()}),{flush:"post",immediate:!0}),ze(()=>Zt.value.length,()=>{An.value&&ti({immediate:!0})}),ze([ei,te],()=>{ui(),An.value&&ti({immediate:!0}),lo.value&&ba(),jo.value&&Vp(),to("resize")},{immediate:!1}),ze(()=>oi.value,j=>{if(j)for(const[oe,ye]of xi)U2(oe,ye);else if(rg(),An.value)ti({immediate:!0});else for(const[oe,ye]of xi)ye&&Du(oe,!0)},{immediate:!1}),ze([se,he,()=>Y()],()=>{var j;(j=gr.refresh)==null||j.call(gr);for(const[oe,ye]of xi)U2(oe,ye)},{immediate:!1}),ze([()=>I.viewportPriority,()=>Zt.value.length,he],([j,oe,ye])=>{if(j!==!1){if(K.value&&(oe<=200||oe<=ye)){K.value=!1;for(const[we,Ee]of xi)U2(we,Ee)}}else K.value=!1}),ze(()=>Bs.value,()=>{An.value&&ti({immediate:!0})}),ze([Ho,Un,Ri,()=>Zt.value.length,An],()=>{tu()},{immediate:!0});let yg=null,kg=!1,Qp=null;function bg(){yg=null,Ew=null,Tw=void 0,Wp=null,gg()}function Xw(){Gp(),Re(),ui(),_o.clear();const j=Zt.value.length;j>0&&ll(j),Hw()}function e3(){Qw(),yt(),hg=null,oh=null,sh=null,H2=null,cg=null,dg=null,kg=!1,bg(),eI("restore"),ql(),Up()}function wg(j){var oe;return[(oe=qi())!=null?oe:"",vi(),Sc(),$2.value,mg(j),Zt.value.length,Math.round($s(0,Zt.value.length)),Math.round(th()),ao.count,Math.round(ao.total)].join(":")}function yI(){return io(this,null,function*(){var j,oe,ye,we;const Ee=(j=i.virtualScroll)==null?void 0:j.settledToken,He=mg(Ee),Je=vi(),nt=qi(),vt=Jl.value;if(hn.value&&((oe=i.virtualScroll)==null?void 0:oe.settleMode)==="manual"&&z2(Ee))if(Lw()){if(wg(Ee)!==Wp&&!kg){kg=!0;try{const it=yield qw({reason:"manual",expectedSettledTokenKey:He}),lt=mg()===He;Ww(Je,nt,vt)&&it.sessionKey===Je&&it.threadKey===nt&<&&it.stable&&it.phase==="final"&&(Wp=wg((ye=i.virtualScroll)==null?void 0:ye.settledToken))}finally{kg=!1,yield ft();const it=(we=i.virtualScroll)==null?void 0:we.settledToken,lt=z2(it)?wg(it):"";Ww(Je,nt,vt)&<&&Wp!==lt&&yI()}}}else to("manual")})}ze(hn,(j,oe)=>{if(j!==oe){if(!j)return e3(),void Qw();e3(),Xw(),Qp=Jl.value,to("content")}},{flush:"post"}),ze([hn,Jl],([j,oe])=>{j?Qp!=null?Qp!==oe&&(Qp=oe,(function(ye="resize"){Gp(),Re(),ui(),_o.clear();const we=Zt.value.length;we>0&&ll(we),Hw(),oh=null,sh=null,H2=null,hg=null,kg=!1,bg(),cI(),ft(()=>{_c(),lo.value&&ba(),jo.value&&Vp(),to(ye)})})("resize")):Qp=oe:Qp=null},{flush:"post",immediate:!0}),ze([hn,()=>vi(),()=>qi()],([j])=>{j&&(e3(),Xw(),eI("content"),to("content"))}),ze([hn,()=>vi(),()=>qi(),Jl,()=>Zt.value.length],([j])=>{j&&(function(oe="async-node"){let ye=!1;for(const[we,Ee]of Array.from(Ss.entries()))Iw(Ee)||(Ss.delete(we),Yn.delete(we),ye=!0);ye&&(jp(),to(oe))})("async-node")},{flush:"post"}),ze([hn,()=>{var j;return(j=i.virtualScroll)==null?void 0:j.sessionKey},()=>{var j;return(j=i.virtualScroll)==null?void 0:j.measurementKey},()=>i.indexKey,()=>G.value],([j])=>{j&&(gg(),(function(oe="content"){if(!hn.value)return;const ye=[],we=Zt.value.length,Ee=$p(we);for(const He of Array.from(_o.keys())){if(He>=we){ye.push(He);continue}if(He=we&&_o.delete(He);ye.length&&((function(He,Je={}){const nt=Array.from(He,Number);js(nt);let vt=0;if(Hs(()=>(vt=Ca(nt,Je),vt>0)),vt>0)(function(it){for(const lt of it)_o.delete(lt)})(nt);else for(const it of nt)Xs.delete(it)})(ye,{notify:!1}),ui(),bg(),lo.value&&ba(),jo.value&&Vp(),to(oe))})("content"))},{flush:"post",immediate:!0}),ze([hn,()=>Zt.value.length,()=>vi(),()=>qi()],([j,oe,ye,we],[Ee,He,Je,nt])=>{j&&Ee&&ye===Je&&we===nt&&oe!==He&&bg()},{flush:"post"}),ze([hn,()=>{var j;return(j=i.virtualScroll)==null?void 0:j.heightCache},()=>{var j;return(j=i.virtualScroll)==null?void 0:j.heightCacheWidth},()=>{var j;return(j=i.virtualScroll)==null?void 0:j.restoreState},()=>{var j;return(j=i.virtualScroll)==null?void 0:j.measurementKey},()=>Zt.value.length,()=>vi(),te],()=>{cI()},{flush:"post",immediate:!0}),ze([hn,()=>{var j;return(j=i.virtualScroll)==null?void 0:j.restoreState},()=>{var j;return(j=i.virtualScroll)==null?void 0:j.restoreAnchor},()=>{var j;return(j=i.virtualScroll)==null?void 0:j.measurementKey},()=>Zt.value.length,()=>vi(),te],j=>io(null,[j],function*([oe,ye]){if(!oe||!ye)return;yield ft();const we=(function(){var Ee;const He=(Ee=i.virtualScroll)==null?void 0:Ee.restoreAnchor;return He==null||He===!1?null:He===!0?"true":String(He)})();jw(ye,{restoreAnchor:we!=null,restoreToken:we??void 0})}),{flush:"post",immediate:!0}),ze([hn,te,()=>{var j;return(j=i.virtualScroll)==null?void 0:j.restoreState},()=>{var j;return(j=i.virtualScroll)==null?void 0:j.measurementKey}],([j])=>{var oe;if(!j)return;const ye=(oe=i.virtualScroll)==null?void 0:oe.restoreState;ye&&oh&&sh==="restore"&&(aI(ye)||(Xw(),oh=null,sh=null,to("resize")))},{flush:"post"}),ze([hn,()=>Zt.value.length,()=>vi(),te],j=>io(null,[j],function*([oe]){var ye;const we=cg,Ee=dg;oe&&we&&(yield ft(),!jw(we,{restoreAnchor:Ee?.restoreAnchor===!0,restoreToken:(ye=Ee?.restoreToken)!=null?ye:"imperative",allowUncapturedAnchor:Ee?.allowUncapturedAnchor===!0})&&dI(we)||(cg=null,dg=null))}),{flush:"post",immediate:!0}),ze([hn,Ne,()=>{var j;return(j=i.virtualScroll)==null?void 0:j.settleMode},()=>vi(),()=>qi(),Jl,fl,dl,()=>Bs.value,Ac,()=>ao.count,()=>ao.total],([j,oe,ye])=>{if(!j||oe!==!0||ye==="manual"||!Nw())return;const we=(function(){var Ee;const He=Zt.value.length;return[(Ee=qi())!=null?Ee:"",vi(),Sc(),$2.value,He,Math.round($s(0,He)),Math.round(th()),ao.count,Math.round(ao.total)].join(":")})();yg!==we&&(yg=we,qw({reason:"final"}).then(Ee=>{Ee.stable||yg!==we||(yg=null)}))},{flush:"post",immediate:!0}),ze([hn,Ne,()=>{var j;return(j=i.virtualScroll)==null?void 0:j.settleMode},()=>{var j;return(j=i.virtualScroll)==null?void 0:j.settledToken},()=>vi(),()=>qi(),Jl,fl,dl,()=>Bs.value,Ac,()=>Zt.value.length,()=>ao.count,()=>ao.total],()=>{yI()},{flush:"post",immediate:!0}),ze([()=>Zt.value.length,An,Un,Ri,()=>uo.start,()=>uo.end],([j,oe,ye,we,Ee,He])=>{ue.value&&Ke("virtualization",{nodes:j,virtualization:oe,maxLiveNodes:ye,buffer:we,focusIndex:Ho.value,scroll:oe?(()=>{const Je=Xa.value||ae();return Je?{reverse:Ce(Je),scrollTop:Math.round(Je.scrollTop),scrollTopAbs:Math.round(Math.abs(Je.scrollTop)),scrollHeight:Math.round(Je.scrollHeight),clientHeight:Math.round(Je.clientHeight)}:null})():null,liveRange:{start:Ee,end:He},rendered:Bs.value})}),ze([()=>I.customId],([j],oe,ye)=>{if(!j||Ps)return;const we=(function(Ee,He){return Ee?(_s.controllers[Ee]=He,()=>{_s.controllers[Ee]===He&&delete _s.controllers[Ee]}):()=>{}})(j,{captureRestoreAnchor:wr,restoreAnchor:wa,getAnchorDrift:As,getReport:Wi});ye(()=>{we()})},{immediate:!0}),ii(()=>{(function(){if(hn.value)try{_c(),fg();const j=nh("manual");hI(j)&&(O(j),hg=j,Vw=pg());const oe=qp(j,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});oe&&(H(oe),oe.anchor&&R(oe.anchor),Kp=vg(oe))}catch{}})(),AY(),rg(),be(),vI();for(const j of Gl.values())for(const oe of j)$e(oe);Gl.clear(),Aa.clear(),_o.clear(),Jw(),Gp(),lg(),ql(),Up(),Qw(),R2(),Vn()});const xY=d0("ViewportDeferredMermaidBlockNode",Xu({loader:()=>io(null,null,function*(){try{return(yield qo(()=>import("./index11-oTpPg1Iy.js"),__vite__mapDeps([7,5]))).default}catch(j){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".',j),bl}}),loadingComponent:OF,delay:0}),OF),SY=d0("ViewportDeferredInfographicBlockNode",Xu({loader:()=>io(null,null,function*(){try{return(yield qo(()=>import("./index10-DPt9V4bc.js"),[])).default}catch(j){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.',j),bl}}),loadingComponent:RF,delay:0}),RF),_Y=d0("ViewportDeferredD2BlockNode",Xu(()=>io(null,null,function*(){try{return(yield qo(()=>import("./index8-MiLy1Wbt.js"),[])).default}catch(j){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".',j),bl}})),bl),kI={text:Fo,paragraph:rp,heading:Z4,code_block:k8,list:um,list_item:am,blockquote:j9,table:G0,definition_list:H9,footnote:W9,footnote_reference:la,footnote_anchor:K0,admonition:K9,vmr_container:U9,hardbreak:ff,link:Xr,image:df,thematic_break:q9,math_inline:Iu,math_block:_q,strong:Yr,emphasis:el,strikethrough:Jr,highlight:ua,insert:El,subscript:Tl,superscript:Ml,emoji:Il,checkbox:ra,checkbox_input:ra,inline_code:Er,html_inline:aa,reference:Qr,html_block:Z0},IY=D(()=>qs()),bI=D(()=>bF(I.codeBlockProps)),MY=D(()=>bF(I.codeBlockProps,{omit:["langs"]})),wI=D(()=>Bt(Bt({stream:I.codeBlockStream,darkTheme:I.codeBlockDarkTheme,lightTheme:I.codeBlockLightTheme,monacoOptions:I.codeBlockMonacoOptions,themes:I.themes,langs:m.value==="shiki"?I.langs:void 0,minWidth:I.codeBlockMinWidth,maxWidth:I.codeBlockMaxWidth},typeof me.value=="boolean"?{showTooltips:me.value}:{}),MY.value)),CI=D(()=>Bt(Dn(Bt({},wI.value),{langs:I.langs}),bI.value));function AI(j){return typeof j=="boolean"?j:void 0}const TY=D(()=>{const j=I.codeBlockProps||{},oe={},ye=AI(j.showLineNumbers);ye!==void 0&&(oe.showLineNumbers=ye);const we=AI(j.diffInline);we!==void 0&&(oe.diffInline=we);const Ee=(function(He){const Je=Number(He);return Number.isFinite(Je)&&Je>0?Je:void 0})(j.reservedHeightPx);return Ee!==void 0&&(oe.reservedHeightPx=Ee),oe}),EY=D(()=>Bt(Bt({stream:I.codeBlockStream,darkTheme:I.codeBlockDarkTheme,lightTheme:I.codeBlockLightTheme,themes:I.themes,langs:I.langs,minWidth:I.codeBlockMinWidth,maxWidth:I.codeBlockMaxWidth},typeof me.value=="boolean"?{showTooltips:me.value}:{}),bI.value)),LY=D(()=>Bt({},I.mermaidProps||{})),xI=D(()=>Bt({},I.d2Props||{})),NY=D(()=>Bt({},I.infographicProps||{})),Cg=D(()=>({typewriter:f.value,fade:I.fade,customHtmlTags:Ji.value.customHtmlTags})),FY=D(()=>Bt(Bt({},Cg.value),typeof me.value=="boolean"?{showTooltip:me.value}:{})),DY=D(()=>Bt(Bt({},Cg.value),typeof me.value=="boolean"?{showTooltips:me.value}:{})),RY=D(()=>Bt(Bt({},Cg.value),typeof me.value=="boolean"?{showTooltips:me.value}:{})),OY=D(()=>Bt(Bt({},Cg.value),typeof me.value=="boolean"?{showTooltips:me.value}:{}));function PY(j){return Array.isArray(j.children)&&j.children.length>0}const K2=D(()=>On.value.map(j=>{var oe,ye,we,Ee,He,Je,nt,vt;let it=(function(Dt){var rn,cn,wn,yn,Cn,Wn,Jn;if(Dt.type!=="code_block")return Dt;const Oi=Dt,er=[String((rn=Oi.language)!=null?rn:""),String((cn=Oi.loading)!=null?cn:""),String((wn=Oi.diff)!=null?wn:""),String((yn=Oi.code)!=null?yn:""),String((Cn=Oi.originalCode)!=null?Cn:""),String((Wn=Oi.updatedCode)!=null?Wn:""),String((Jn=Oi.raw)!=null?Jn:"")].join("\0"),Us=Ja.get(Oi);if(Us&&Us.signature===er)return Us.node;const nu=Bt({},Oi);return Ja.set(Oi,{signature:er,node:nu}),nu})(j.node);const lt=Z2(it);let gt=MI(it,lt);if((it.type==="html_block"||it.type==="html_inline")&>===kI[it.type]){const Dt=it,rn=String((oe=Dt.tag)!=null?oe:"").trim().toLowerCase()||YH(Dt.content);if(rn){const cn=Sn.value[rn];if(Yi.value.has(rn)&&cn)gt=cn,it=Dn(Bt({},Dt),{type:rn,tag:rn,content:gme(Dt.content,rn)});else if(JH((ye=Dt.content)!=null?ye:Dt.raw,rn)){const wn=String((Ee=(we=Dt.content)!=null?we:Dt.raw)!=null?Ee:"");it.type==="html_inline"?(gt=Fo,it={type:"text",content:wn,raw:wn}):(gt=rp,it={type:"paragraph",children:[{type:"text",content:wn,raw:wn}],raw:wn})}}}const Xe=it.type==="code_block"&&m.value==="pre"&>===bl&&!t3(Sn.value,lt);let at=Bt({},(function(Dt,rn,cn){const wn=rn??Z2(Dt);if(Dt.type==="code_block"){const yn=wn?t3(Sn.value,wn):void 0;if(cn&&m.value==="pre"&&!yn&&cn===bl)return TY.value;if(cn&&wn&&cn===yn)return wn==="mermaid"?_I(Dt):wn==="infographic"?II(Dt):wn==="d2"||wn==="d2lang"?xI.value:CI.value;if(cn&&cn===Sn.value.code_block)return CI.value;if(Me(cn))return EY.value}return wn==="mermaid"?_I(Dt):wn==="infographic"?II(Dt):wn==="d2"||wn==="d2lang"?xI.value:Dt.type==="link"?FY.value:Dt.type==="list"?DY.value:Dt.type==="blockquote"?RY.value:Dt.type==="table"?OY.value:Dt.type==="code_block"?wI.value:Cg.value})(it,lt,gt));const It=ei.value?an.value[j.index]:null;it.type==="code_block"&&It?.kind==="code-block"&&(at=Dn(Bt({},at),Xe?{reservedHeightPx:(He=It.height)!=null?He:It.contentHeight}:{estimatedHeightPx:It.height,estimatedContentHeightPx:It.contentHeight,estimatedDiffInline:It.diffInline})),Xe||it.type!=="code_block"||lt!=="mermaid"||O1(at.estimatedPreviewHeightPx)!=null||(at=Dn(Bt({},at),{estimatedPreviewHeightPx:fb(cb(String((Je=it.code)!=null?Je:"")))})),Xe||it.type!=="code_block"||lt!=="infographic"||O1(at.estimatedPreviewHeightPx)!=null||(at=Dn(Bt({},at),{estimatedPreviewHeightPx:hb(db(String((nt=it.code)!=null?nt:"")))})),it.type==="math_block"&&(at=Dn(Bt({},at),{cacheScope:Nn}));const At=(function(Dt,rn){const cn=String(Dt.type);return!v2(cn)&&Sn.value[cn]===rn})(it,gt),Ut=At?$x(it,pe.value):void 0;return Dn(Bt({},j),{node:it,component:gt,bindings:at,customBindings:Bt(Bt({},Ut??{}),at),rendersCustomNode:At,hasSlotChildren:PY(it),slotContent:String((vt=it.content)!=null?vt:""),isCodeBlock:it.type==="code_block",indexKey:`${IY.value}-${j.index}`,vnodeKey:`${eh.value}\0${j.index}\0${it.type}`})}));function Z2(j){var oe;return j?.type==="code_block"?String((oe=j.language)!=null?oe:"").trim().toLowerCase():""}function t3(j,oe){const ye=oe.trim().toLowerCase();if(ye)for(const we of[ye,U4(ye),aq(ye)]){const Ee=we&&j[we];if(Ee)return Ee}}function SI(j,oe,ye,we){var Ee,He;const Je=Bt({},j.value);return O1(Je.estimatedPreviewHeightPx)==null&&(Je.estimatedPreviewHeightPx=we(ye(String((Ee=oe?.code)!=null?Ee:"")),void 0,Je.maxHeight==="none"?null:(He=O1(Je.maxHeight))!=null?He:void 0)),Je}function _I(j){return SI(LY,j,cb,fb)}function II(j){return SI(NY,j,db,hb)}function MI(j,oe){if(!j)return zA;const ye=Sn.value,we=ye[String(j.type)];if(j.type==="code_block"){const Ee=oe??Z2(j),He=Ee?t3(ye,Ee):void 0;return He||(m.value==="pre"?ye.code_block||bl:Ee==="mermaid"?ye.mermaid||xY:Ee==="infographic"?ye.infographic||SY:Ee==="d2"||Ee==="d2lang"?ye.d2||_Y:we||ye.code_block||st.value)}return we||kI[String(j.type)]||zA}function n3(j){o("click",j)}function BY(j){var oe;(oe=j.target)!=null&&oe.closest("[data-node-index]")&&o("mouseover",j)}function $Y(j){var oe;(oe=j.target)!=null&&oe.closest("[data-node-index]")&&o("mouseout",j)}function TI(j){o("mouseover",j)}function EI(j){o("mouseout",j)}const ah=q(null),pl=q(!1),Ag=q(null),zY=D(()=>!(I.domMode!=="minimal"||Q.value||I.fade!==!1||f.value||pl.value||bs.value||An.value||fn.value||Ue.value||zl.value||Object.keys(Sn.value).length!==0));let xg,Yp=null,i3=0,G2=0,Q2=0;const LI=["code_block","admonition","table","math_block","html_block","image","thematic_break"],jY=new Set(LI),NI=[".typewriter-cursor",".height-estimation-probes",...LI.map(j=>`[data-node-type="${j}"]`),"script","style"].join(",");function FI(j){if(!j||typeof j!="object")return!1;const oe=j.type;return typeof oe=="string"&&jY.has(oe)}function Y2(j){var oe,ye;if(!j||typeof j!="object")return 0;const we=j,Ee=(ye=(oe=we.raw)!=null?oe:we.content)!=null?ye:we.code;if(typeof Ee=="string")return Ee.length;const He=we.children;if(Array.isArray(He))return He.reduce((nt,vt)=>nt+Y2(vt),0);const Je=we.items;return Array.isArray(Je)?Je.reduce((nt,vt)=>nt+Y2(vt),0):0}function J2(){xg&&(clearTimeout(xg),xg=void 0)}function o3(){i3+=1,Yp!=null&&(Xi?.(Yp),Yp=null)}function Sg(){o3(),Ad(),ah.value&&(ah.value.style.visibility="hidden")}function HY(j){var oe;if(j.nodeType!==Node.TEXT_NODE||!((oe=j.textContent)!=null?oe:"").trim())return!1;const ye=j.parentElement;return!!ye&&!ye.closest(NI)}function WY(j){let oe=j.lastChild;for(;oe;){if(HY(oe))return oe;if(oe.nodeType===Node.ELEMENT_NODE){const ye=oe;if(!ye.matches(NI)&&ye.lastChild){oe=ye.lastChild;continue}}for(;oe&&oe!==j&&!oe.previousSibling;)oe=oe.parentNode;if(!oe||oe===j)break;oe=oe.previousSibling}return null}function DI(){const j=K2.value;for(let oe=j.length-1;oe>=0;oe--){const ye=j[oe];if(!ye||FI(ye.node)||!q2(ye.index))continue;const we=xi.get(ye.index);if(!we)continue;const Ee=WY(we);if(Ee)return Ee}return null}function Ad(){Ag.value&&(Ag.value.classList.remove(PF),Ag.value=null)}function X2(){if(d.value!=="simple"||!U||!pl.value||!F.value)return void Ad();const j=DI(),oe=j?(function(ye){var we;const Ee=(we=ye.parentElement)==null?void 0:we.closest(".text-node");return Ee instanceof HTMLElement?Ee:ye.parentElement})(j):null;oe!==Ag.value&&(Ad(),oe&&(oe.classList.add(PF),Ag.value=oe))}function ey(){if(d.value!=="precise"||!U||!pl.value||Yp!=null)return;const j=i3,oe=()=>{Yp=null,j===i3&&(function(){var ye,we;if(d.value!=="precise"||!(U&&pl.value&&F.value&&ah.value))return;const Ee=F.value,He=ah.value;He.style.visibility="hidden";const Je=DI();if(!Je)return;let nt=0,vt=0,it=20,lt=!1;if(Je?.textContent){const gt=Je.textContent.length,Xe=document.createRange();Xe.setStart(Je,Math.max(0,gt-1)),Xe.setEnd(Je,gt);const at=typeof Xe.getClientRects=="function"?Xe.getClientRects():void 0,It=(we=at?.[at.length-1])!=null?we:(ye=Je.parentElement)==null?void 0:ye.getBoundingClientRect();if(It){const At=Ve("typewriterCursor.root.getBoundingClientRect",()=>Ee.getBoundingClientRect());nt=It.right-At.left+Ee.scrollLeft,vt=It.top-At.top+Ee.scrollTop,it=It.height||it,lt=!0}Xe.detach()}lt&&(He.style.transform=`translate(${Math.max(0,nt)}px, ${Math.max(0,vt)}px)`,He.style.height=`${it}px`,He.style.visibility="visible")})()};Go?Yp=Go(oe):oe()}return ze([ke,()=>i.content,()=>i.nodes,()=>I.typewriter,Ne],()=>io(null,null,function*(){var j,oe;if(!U||Q.value||!re.value)return;if(Ne.value)return pl.value=!1,J2(),void Sg();if((j=i.nodes)!=null&&j.length)return pl.value=!1,J2(),Sg(),G2=((oe=i.content)!=null?oe:"").length,void(Q2=ke.value.length);const ye=(function(){var nt,vt;return(nt=i.nodes)!=null&&nt.length?i.nodes.reduce((it,lt)=>it+Y2(lt),0):((vt=i.content)!=null?vt:"").length})(),we=(function(){var nt;return(nt=i.nodes)!=null&&nt.length?i.nodes.reduce((vt,it)=>vt+Y2(it),0):ke.value.length})(),Ee=!FI(Zt.value[Zt.value.length-1]),He=ye>G2,Je=we>Q2;if(!f.value||!Ee||!He&&!Je)return f.value&&Ee||(pl.value=!1,Sg()),G2=ye,void(Q2=we);G2=ye,Q2=we,pl.value=!0,d.value==="precise"&&ah.value&&(ah.value.style.visibility="hidden"),J2(),yield ft(),d.value==="simple"?X2():(Ad(),ey()),xg=setTimeout(()=>{xg=void 0,pl.value=!1},3e3)}),{flush:"post",immediate:!0}),ze(pl,j=>io(null,null,function*(){j?(yield ft(),d.value!=="simple"?(Ad(),d.value==="precise"&&ey()):X2()):Sg()}),{flush:"post"}),ze(d,()=>io(null,null,function*(){if(U&&!Q.value&&re.value&&pl.value){if(yield ft(),d.value==="simple")return o3(),void X2();Ad(),d.value!=="precise"?Sg():ey()}}),{flush:"post"}),ze([()=>Bs.value,()=>uo.start,()=>uo.end],()=>io(null,null,function*(){U&&!Q.value&&re.value&&pl.value&&(yield ft(),d.value!=="simple"?(Ad(),d.value==="precise"&&ey()):X2())}),{flush:"post"}),ii(()=>{J2(),o3(),Ad(),Wt.clear()}),(j,oe)=>{const ye=QB("NodeRenderer",!0);return p(Q)?(b(!0),N(Le,{key:0},Ct(K2.value,we=>(b(),N(Le,{key:we.vnodeKey},[we.rendersCustomNode?(b(),fe(To(we.component),ci({key:0,ref_for:!0},we.customBindings,{node:we.node,loading:we.node.loading,"index-key":we.indexKey,"custom-id":I.customId,"is-dark":I.isDark,onClick:n3,onMouseover:TI,onMouseout:EI,onCopy:oe[0]||(oe[0]=Ee=>s(Ee)),onHandleArtifactClick:oe[1]||(oe[1]=Ee=>o("handleArtifactClick",Ee))}),{default:de(()=>[we.hasSlotChildren?(b(),fe(ye,ci({key:0,ref_for:!0},ji.value,{nodes:we.node.children,"index-key":we.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):we.slotContent?(b(),fe(ye,ci({key:1,ref_for:!0},ji.value,{content:we.slotContent,final:!we.node.loading,"index-key":`${we.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):X("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(b(),fe(To(we.component),ci({key:1,node:we.node,loading:we.node.loading,"index-key":we.indexKey},{ref_for:!0},we.bindings,{"custom-id":I.customId,"is-dark":I.isDark,onClick:n3,onMouseover:TI,onMouseout:EI,onCopy:oe[2]||(oe[2]=Ee=>s(Ee)),onHandleArtifactClick:oe[3]||(oe[3]=Ee=>o("handleArtifactClick",Ee))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(b(),N("div",{key:1,ref_key:"containerRef",ref:F,class:De(["markstream-vue markdown-renderer",[{dark:I.isDark},{virtualized:An.value},{"virtual-scroll-coordinated":So.value},{"stable-layout":xs.value},{"typewriter-simple-cursor":pl.value&&d.value==="simple"}]]),"data-custom-id":I.customId,onClick:n3,onMouseover:BY,onMouseout:$Y},[Li.value||An.value?(b(),N(Le,{key:0},[Li.value?(b(),fe(A4e,{key:0,width:$t.value,"flow-root":An.value||So.value,"paragraph-node":pr.value,"list-item-node":Zo.value,"list-node":Po.value,"heading-nodes":fo.value,"set-paragraph-wrapper":Ht,"set-list-item-wrapper":vn,"set-list-wrapper":Bn,"set-heading-wrapper":wd},null,8,["width","flow-root","paragraph-node","list-item-node","list-node","heading-nodes"])):X("",!0),An.value?(b(),N("div",{key:1,class:"node-spacer",style:on({height:`${xn.value}px`}),"aria-hidden":"true"},null,4)):X("",!0)],64)):X("",!0),zY.value?(b(!0),N(Le,{key:1},Ct(K2.value,we=>(b(),N(Le,{key:we.vnodeKey},[q2(we.index)?(b(),fe(To(we.component),ci({key:0,node:we.node,loading:we.node.loading,"index-key":we.indexKey},{ref_for:!0},we.bindings,{"custom-id":I.customId,"is-dark":I.isDark,onMouseover:oe[4]||(oe[4]=Ee=>o("mouseover",Ee)),onMouseout:oe[5]||(oe[5]=Ee=>o("mouseout",Ee)),onCopy:oe[6]||(oe[6]=Ee=>s(Ee)),onHandleArtifactClick:oe[7]||(oe[7]=Ee=>o("handleArtifactClick",Ee))}),null,16,["node","loading","index-key","custom-id","is-dark"])):X("",!0)],64))),128)):(b(!0),N(Le,{key:2},Ct(K2.value,we=>(b(),N("div",{key:we.vnodeKey,ref_for:!0,ref:Ee=>U2(we.index,Ee),class:"node-slot","data-node-index":we.index,"data-node-type":we.node.type},[q2(we.index)?(b(),N("div",{key:0,ref_for:!0,ref:Ee=>(function(He,Je){var nt;Je||(function(gt){const Xe=`${qs()}-${gt}`;let at=!1;for(const It of Array.from(Yn.keys())){const At=Ss.get(It);(At?.index===gt||It===Xe||It.startsWith(`${Xe}-`))&&(Yn.delete(It),Ss.delete(It),at=!0)}at&&(jp(),to("async-node"))})(He),cl.delete(He),(function(gt){var Xe;const at=((Xe=Aa.get(gt))!=null?Xe:0)+1;Aa.set(gt,at)})(He);const vt=Gl.get(He);if(vt){for(const gt of vt)$e(gt);Gl.delete(He)}if((function(gt){const Xe=Rr.get(gt);Xe&&(zo?.unobserve(Xe),Ya.delete(Xe),Rr.delete(gt))})(He),!Je||!Ga.value)return $r.delete(He),void Aa.delete(He);$r.set(He,Je);const it=()=>{V2(He,Je)};queueMicrotask(it);const lt=(zo||typeof ResizeObserver>"u"||(zo=new ResizeObserver(gt=>{if(gt.length)for(const Xe of gt){const at=Ya.get(Xe.target),It=Rr.get(at??-1);at!=null&&It&&V2(at,It)}else _c()})),zo);if(lt&&(Rr.set(He,Je),Ya.set(Je,He),lt.observe(Je)),typeof window<"u"){const gt=((nt=Zt.value[He])==null?void 0:nt.type)==="code_block"?[16,80,240,800]:Ne.value?[80]:[];if(gt.length){const Xe=gt.map(at=>Ie(at,it,"node-resize")).filter(at=>at!=null);Xe.length&&Gl.set(He,Xe)}}})(we.index,Ee),class:"node-content"},[we.isCodeBlock?we.rendersCustomNode?(b(),fe(To(we.component),ci({key:1,ref_for:!0},we.customBindings,{node:we.node,loading:we.node.loading,"index-key":we.indexKey,"custom-id":I.customId,"is-dark":I.isDark,onCopy:oe[12]||(oe[12]=Ee=>s(Ee)),onHandleArtifactClick:oe[13]||(oe[13]=Ee=>o("handleArtifactClick",Ee))}),{default:de(()=>[we.hasSlotChildren?(b(),fe(ye,ci({key:0,ref_for:!0},ji.value,{nodes:we.node.children,"index-key":we.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):we.slotContent?(b(),fe(ye,ci({key:1,ref_for:!0},ji.value,{content:we.slotContent,final:!we.node.loading,"index-key":`${we.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):X("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(b(),fe(To(we.component),ci({key:2,node:we.node,loading:we.node.loading,"index-key":we.indexKey},{ref_for:!0},we.bindings,{"custom-id":I.customId,"is-dark":I.isDark,onCopy:oe[14]||(oe[14]=Ee=>s(Ee)),onHandleArtifactClick:oe[15]||(oe[15]=Ee=>o("handleArtifactClick",Ee))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(b(),fe(mo,{key:0,name:"fade",css:I.fade!==!1,appear:I.fade!==!1},{default:de(()=>[we.rendersCustomNode?(b(),fe(To(we.component),ci({key:0,ref_for:!0},we.customBindings,{node:we.node,loading:we.node.loading,"index-key":we.indexKey,"custom-id":I.customId,"is-dark":I.isDark,onCopy:oe[8]||(oe[8]=Ee=>s(Ee)),onHandleArtifactClick:oe[9]||(oe[9]=Ee=>o("handleArtifactClick",Ee))}),{default:de(()=>[we.hasSlotChildren?(b(),fe(ye,ci({key:0,ref_for:!0},ji.value,{nodes:we.node.children,"index-key":we.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):we.slotContent?(b(),fe(ye,ci({key:1,ref_for:!0},ji.value,{content:we.slotContent,final:!we.node.loading,"index-key":`${we.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):X("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(b(),fe(To(we.component),ci({key:1,node:we.node,loading:we.node.loading,"index-key":we.indexKey},{ref_for:!0},we.bindings,{"custom-id":I.customId,"is-dark":I.isDark,onCopy:oe[10]||(oe[10]=Ee=>s(Ee)),onHandleArtifactClick:oe[11]||(oe[11]=Ee=>o("handleArtifactClick",Ee))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(b(),N("div",{key:1,class:"node-placeholder",style:on({height:`${Br(we.index)}px`})},null,4))],8,_4e))),128)),pl.value&&d.value==="precise"?(b(),N("span",{key:3,ref_key:"typewriterCursorRef",ref:ah,class:"typewriter-cursor","aria-hidden":"true"},null,512)):X("",!0),An.value?(b(),N("div",{key:4,class:"node-spacer",style:on({height:`${En.value}px`}),"aria-hidden":"true"},null,4)):X("",!0)],42,S4e))}}})),[["__scopeId","data-v-a9489508"]]),Ll=zq;Ll.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",Ll.__name,Ll.name].filter(n=>!!n));for(const n of t)e.component(n,zq)};const Xx=Object.freeze(Object.defineProperty({__proto__:null,default:Ll},Symbol.toStringTag,{value:"Module"})),I4e={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"},M4e={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"},T4e={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"},E4e={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"},L4e={class:"admonition-title"},N4e=["aria-expanded","aria-controls"],F4e=["id"],K9=Ei(ot({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:t}){var n;const i=e,o=t,s=D(()=>{if(i.node.title&&i.node.title.trim().length)return i.node.title;const u=i.node.kind||"note";return u.charAt(0).toUpperCase()+u.slice(1)}),r=q(!!i.node.collapsible&&!((n=i.node.open)==null||n));function l(){i.node.collapsible&&(r.value=!r.value)}const a=`admonition-${Math.random().toString(36).slice(2,9)}`;return(u,c)=>(b(),N("div",{class:De(["admonition",[`admonition-${i.node.kind}`]])},[_("div",{id:a,class:"admonition-legend"},[i.node.kind==="note"||i.node.kind==="info"?(b(),N("svg",I4e,[...c[1]||(c[1]=[_("circle",{cx:"12",cy:"12",r:"10"},null,-1),_("path",{d:"M12 16v-4"},null,-1),_("path",{d:"M12 8h.01"},null,-1)])])):i.node.kind==="tip"?(b(),N("svg",M4e,[...c[2]||(c[2]=[_("path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5"},null,-1),_("path",{d:"M9 18h6"},null,-1),_("path",{d:"M10 22h4"},null,-1)])])):i.node.kind==="warning"||i.node.kind==="caution"?(b(),N("svg",T4e,[...c[3]||(c[3]=[_("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"},null,-1),_("path",{d:"M12 9v4"},null,-1),_("path",{d:"M12 17h.01"},null,-1)])])):i.node.kind==="danger"||i.node.kind==="error"?(b(),N("svg",E4e,[...c[4]||(c[4]=[_("polygon",{points:"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"},null,-1),_("path",{d:"M12 8v4"},null,-1),_("path",{d:"M12 16h.01"},null,-1)])])):X("",!0),_("span",L4e,B(s.value),1),i.node.collapsible?(b(),N("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${a}-content`,onClick:l},[(b(),N("svg",{style:on({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"},[...c[5]||(c[5]=[_("path",{d:"m9 18 6-6-6-6"},null,-1)])],4))],8,N4e)):X("",!0)]),si(_("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[V(p(Ll),{"index-key":`admonition-${e.indexKey}`,nodes:i.node.children,"custom-id":i.customId,typewriter:i.typewriter,fade:i.fade,onCopy:c[0]||(c[0]=d=>o("copy",d))},null,8,["index-key","nodes","custom-id","typewriter","fade"])],8,F4e),[[Eo,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);K9.install=e=>{e.component(K9.__name,K9)};const UA=()=>qo(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let Py=null,By=UA,$y=null,BF=!1,$F=!1;function V8t(){return io(this,null,function*(){if(Py)return Py;const e=By;return e?e===UA&&BF?null:$y||($y=io(null,null,function*(){let t;try{t=yield e()}catch(n){if(e===UA)return e===By&&(BF=!0,(function(i){$F||($F=!0,console.warn('[markstream-vue] Optional dependency "@terrastruct/d2" is not installed. D2 blocks will render as source.',i))})(n)),null;throw n}finally{e===By&&($y=null)}return e!==By?null:t?(Py=(function(n){var i;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=(i=n.default)!=null?i:n;return typeof o=="function"?o:o?.D2&&typeof o.D2=="function"?o.D2:o})(t),Py):null}),$y):null})}let zy=null,jq=null,jy=null;function K8t(){return typeof jq=="function"}function Z8t(){return io(this,null,function*(){if(zy)return zy;const e=jq;return e?jy||(jy=io(null,null,function*(){const t=yield e(),n=(function(i){var o,s,r;if(!i)return null;const l=(o=i.default)!=null?o:i,a=typeof l=="function"&&typeof((s=l.prototype)==null?void 0:s.render)=="function"?l:(r=i.Infographic)!=null?r:l?.Infographic;return typeof a=="function"?a:null})(t);return n?(zy=n,zy):null}).finally(()=>{jy=null}),jy):null})}const G8t=Symbol("markstreamLanguageIconResolver");function D4e(e){return new Worker("/assets/katexRenderer.worker-CO_gEm4q.js",{type:"module",name:e?.name})}function R4e(e){return new Worker("/assets/mermaidParser.worker-BFSlSHEW.js",{type:"module",name:e?.name})}let zF=!1;function Hq(){zF||typeof Worker>"u"||(zF=!0,f9e(new D4e),S9e(new R4e))}Hq();function Jd(e,t,n="/api/v1"){return`${e}${n}${t.startsWith("/")?t:`/${t}`}`}function jF(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()}const eS={},Cb=Symbol("resolveImage"),Dc=3e4,Hy=5*6e4,HF=5*6e4,Wq="0123456789ABCDEFGHJKMNPQRSTVWXYZ",VA=500,qq=40101;function WF(e,t){for(const[n,i]of Object.entries(t))if(i!==void 0)if(Array.isArray(i))for(const o of i)o!==void 0&&e.append(n,String(o));else e.set(n,String(i))}function f0(e=Dc){try{return AbortSignal.timeout(e)}catch{return}}function O4e(e,t){const n=f0(e);if(n===void 0)return t;try{return AbortSignal.any([n,t])}catch{return t}}function P4e(e,t){let n="",i=e;for(let o=0;oWq[n%32]).join("")}function jg(){return`${P4e(Date.now(),10)}${B4e(16)}`}function qF(e){try{const t=[];return e.forEach((n,i)=>{typeof n=="string"?t.push({field:i,value:n}):t.push({field:i,file:n.name,size:n.size,type:n.type})}),{formData:t}}catch{return"[FormData]"}}async function E8(e){try{const t=await e.text();return t?t.length>VA?`${t.slice(0,VA)}...`:t:void 0}catch{return}}class UF{constructor(t){this.opts=t,this.tracer=t.tracer??eS}tracer;async get(t,n){return this.request("GET",t,void 0,n)}async getBlob(t,n,i){let o=Jd(this.opts.origin,t,this.opts.restBasePath);if(n){const c=new URLSearchParams;WF(c,n);const d=c.toString();d&&(o=`${o}?${d}`)}const s=jg(),r={"X-Request-Id":s};this.addClientHeaders(r);const l=Date.now();this.tracer.restRequest?.({method:"GET",path:t,url:o,requestId:s});let a;try{a=await fetch(o,{method:"GET",headers:r,signal:f0()})}catch(c){throw this.tracer.restFailure?.({method:"GET",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-l,error:c}),new Xl({message:`Network error calling GET ${t}`,cause:c,method:"GET",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:Dc,timestamp:Date.now(),durationMs:Date.now()-l})}if(a.ok){this.tracer.restResponse?.({method:"GET",path:t,requestId:s,status:a.status,durationMs:Date.now()-l,code:0,msg:""});const c=Number(a.headers.get("content-length")??0);if(i?.maxBytes!==void 0&&c>i.maxBytes)throw a.body?.cancel(),new z7({size:c,limit:i.maxBytes});return a.blob()}let u;try{u=await a.clone().json()}catch{}throw this.checkAuthRequired(a,u?.code??0),this.tracer.restResponse?.({method:"GET",path:t,requestId:s,status:a.status,durationMs:Date.now()-l,code:u?.code??a.status,msg:u?.msg??a.statusText,envelopeRequestId:u?.request_id}),new Zu({code:u?.code??a.status,msg:u?.msg??a.statusText,requestId:u?.request_id??s,details:u?.details,timestamp:Date.now(),durationMs:Date.now()-l})}async post(t,n,i){return this.request("POST",t,n,void 0,i)}async postZip(t,n,i){const o="POST",s=Jd(this.opts.origin,t,this.opts.restBasePath),r=jg(),l={"X-Request-Id":r,"Content-Type":"application/json; charset=utf-8"};this.addClientHeaders(l);const a=Date.now();this.tracer.restRequest?.({method:o,path:t,url:s,requestId:r,body:i});let u;try{u=await fetch(s,{method:o,headers:l,body:JSON.stringify(n),signal:f0(Hy)})}catch(h){throw this.tracer.restFailure?.({method:o,path:t,requestId:r,phase:"fetch",durationMs:Date.now()-a,error:h}),new Xl({message:`Network error calling ${o} ${t}`,cause:h,method:o,path:t,url:s,requestId:r,phase:"fetch",timeoutMs:Hy,timestamp:Date.now(),durationMs:Date.now()-a})}const c=u.headers.get("content-type")??void 0,d=c?.split(";",1)[0]?.trim().toLowerCase();if(!u.ok||d!=="application/zip"){let h;try{h=await u.clone().json()}catch{}if(this.checkAuthRequired(u,h?.code??0),!u.ok||h!==void 0&&h.code!==0){const y=h?.code??u.status,k=h?.msg??u.statusText;throw this.tracer.restResponse?.({method:o,path:t,requestId:r,status:u.status,durationMs:Date.now()-a,code:y,msg:k,envelopeRequestId:h?.request_id}),new Zu({code:y,msg:k,requestId:h?.request_id??r,details:h?.details,timestamp:Date.now(),durationMs:Date.now()-a})}const m=u.clone(),g=new TypeError(`Expected application/zip, received ${c??"no content type"}`);throw this.tracer.restFailure?.({method:o,path:t,requestId:r,phase:"parse",durationMs:Date.now()-a,status:u.status,error:g}),new Xl({message:`Invalid ZIP response from ${o} ${t}`,cause:g,method:o,path:t,url:s,requestId:r,phase:"parse",timeoutMs:Hy,status:u.status,statusText:u.statusText,contentType:c,bodyPreview:await E8(m),timestamp:Date.now(),durationMs:Date.now()-a})}let f;try{f=await u.blob()}catch(h){throw this.tracer.restFailure?.({method:o,path:t,requestId:r,phase:"parse",durationMs:Date.now()-a,status:u.status,error:h}),new Xl({message:`Failed to read ZIP response from ${o} ${t}`,cause:h,method:o,path:t,url:s,requestId:r,phase:"parse",timeoutMs:Hy,status:u.status,statusText:u.statusText,contentType:c,timestamp:Date.now(),durationMs:Date.now()-a})}return this.tracer.restResponse?.({method:o,path:t,requestId:r,status:u.status,durationMs:Date.now()-a,code:0,msg:""}),{blob:f,contentDisposition:u.headers.get("content-disposition")??void 0}}async postForm(t,n,i){if(i?.onUploadProgress!==void 0)return this.postFormXhr(t,n,i.onUploadProgress);const o=Jd(this.opts.origin,t,this.opts.restBasePath),s=jg(),r={"X-Request-Id":s};this.addClientHeaders(r);const l=Date.now();this.tracer.restRequest?.({method:"POST",path:t,url:o,requestId:s,body:qF(n)});let a;try{a=await fetch(o,{method:"POST",headers:r,body:n,signal:f0()})}catch(d){throw this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-l,error:d}),new Xl({message:`Network error calling POST ${t}`,cause:d,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:Dc,timestamp:Date.now(),durationMs:Date.now()-l})}let u;const c=a.clone();try{u=await a.json()}catch(d){throw this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"parse",durationMs:Date.now()-l,status:a.status,error:d}),new Xl({message:`Failed to parse JSON response from POST ${t}`,cause:d,method:"POST",path:t,url:o,requestId:s,phase:"parse",timeoutMs:Dc,status:a.status,statusText:a.statusText,contentType:a.headers.get("content-type")??void 0,bodyPreview:await E8(c),timestamp:Date.now(),durationMs:Date.now()-l})}if(this.tracer.restResponse?.({method:"POST",path:t,requestId:s,status:a.status,durationMs:Date.now()-l,code:u.code,msg:u.msg,envelopeRequestId:u.request_id,data:u.data}),this.checkAuthRequired(a,u.code),u.code!==0){const d=u.code??a.status;throw new Zu({code:d,msg:u.msg??a.statusText,requestId:u.request_id??s,details:u.details,timestamp:Date.now(),durationMs:Date.now()-l})}return u.data}postFormXhr(t,n,i){const o=Jd(this.opts.origin,t,this.opts.restBasePath),s=jg(),r={"X-Request-Id":s};this.addClientHeaders(r);const l=Date.now();return this.tracer.restRequest?.({method:"POST",path:t,url:o,requestId:s,body:qF(n)}),new Promise((a,u)=>{const c=new XMLHttpRequest;c.open("POST",o),c.timeout=Dc;for(const[d,f]of Object.entries(r))c.setRequestHeader(d,f);c.upload.onprogress=d=>{d.lengthComputable&&i(d.loaded,d.total)},c.onerror=()=>{this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-l,error:c.statusText||"network error"}),u(new Xl({message:`Network error calling POST ${t}`,cause:null,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:Dc,timestamp:Date.now(),durationMs:Date.now()-l}))},c.ontimeout=()=>{this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-l,error:"timeout"}),u(new Xl({message:`Timeout calling POST ${t}`,cause:null,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:Dc,timestamp:Date.now(),durationMs:Date.now()-l}))},c.onload=()=>{let d;try{d=JSON.parse(c.responseText)}catch(f){this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"parse",durationMs:Date.now()-l,status:c.status,error:f}),u(new Xl({message:`Failed to parse JSON response from POST ${t}`,cause:f,method:"POST",path:t,url:o,requestId:s,phase:"parse",timeoutMs:Dc,status:c.status,statusText:c.statusText,bodyPreview:c.responseText.slice(0,VA),timestamp:Date.now(),durationMs:Date.now()-l}));return}if(this.tracer.restResponse?.({method:"POST",path:t,requestId:s,status:c.status,durationMs:Date.now()-l,code:d.code,msg:d.msg,envelopeRequestId:d.request_id,data:d.data}),this.checkAuthStatus(c.status,d.code),d.code!==0){const f=d.code??c.status;u(new Zu({code:f,msg:d.msg??c.statusText,requestId:d.request_id??s,details:d.details,timestamp:Date.now(),durationMs:Date.now()-l}));return}a(d.data)},c.send(n)})}async patch(t,n){return this.request("PATCH",t,n)}async put(t,n){return this.request("PUT",t,n)}async delete(t){return this.request("DELETE",t)}async request(t,n,i,o,s={}){const r=s.allowCodes??[],l=s.timeoutMs??Dc,a=s.signal;let u=Jd(this.opts.origin,n,this.opts.restBasePath);if(o){const y=new URLSearchParams;WF(y,o);const k=y.toString();k&&(u=`${u}?${k}`)}const c=jg(),d={"X-Request-Id":c};this.addClientHeaders(d),i!==void 0&&(d["Content-Type"]="application/json; charset=utf-8");const f=Date.now();this.tracer.restRequest?.({method:t,path:n,url:u,requestId:c,body:i});let h;try{h=await fetch(u,{method:t,headers:d,body:i!==void 0?JSON.stringify(i):void 0,signal:a!==void 0?O4e(l,a):f0(l)})}catch(y){throw a?.aborted&&y instanceof Error&&y.name==="AbortError"?y:(this.tracer.restFailure?.({method:t,path:n,requestId:c,phase:"fetch",durationMs:Date.now()-f,error:y}),new Xl({message:`Network error calling ${t} ${n}`,cause:y,method:t,path:n,url:u,requestId:c,phase:"fetch",timeoutMs:l,timestamp:Date.now(),durationMs:Date.now()-f}))}let m;const g=h.clone();try{const y=await h.text();m=h.status===204&&y===""?{code:0,msg:"",data:null,request_id:c}:JSON.parse(y)}catch(y){throw a?.aborted&&y instanceof Error&&y.name==="AbortError"?y:(this.tracer.restFailure?.({method:t,path:n,requestId:c,phase:"parse",durationMs:Date.now()-f,status:h.status,error:y}),new Xl({message:`Failed to parse JSON response from ${t} ${n}`,cause:y,method:t,path:n,url:u,requestId:c,phase:"parse",timeoutMs:l,status:h.status,statusText:h.statusText,contentType:h.headers.get("content-type")??void 0,bodyPreview:await E8(g),timestamp:Date.now(),durationMs:Date.now()-f}))}if(this.tracer.restResponse?.({method:t,path:n,requestId:c,status:h.status,durationMs:Date.now()-f,code:m.code,msg:m.msg,envelopeRequestId:m.request_id,data:m.data}),this.checkAuthRequired(h,m.code),m.code!==0&&!r.includes(m.code))throw new Zu({code:typeof m.code=="number"?m.code:h.status,msg:typeof m.msg=="string"&&m.msg.length>0?m.msg:`HTTP ${h.status}${h.statusText?` ${h.statusText}`:""}`,requestId:m.request_id??c,details:m.details,timestamp:Date.now(),durationMs:Date.now()-f});return m.data}addClientHeaders(t){const n=this.opts.credentialStore?.getToken();n!==void 0&&(t.Authorization=`Bearer ${n}`);const i=this.opts.identity;i!==void 0&&(t["X-Kimi-Client-Id"]=i.clientId,t["X-Kimi-Client-Name"]=i.clientName,t["X-Kimi-Client-Version"]=i.clientVersion,t["X-Kimi-Client-Ui-Mode"]=i.clientUiMode)}checkAuthRequired(t,n){this.checkAuthStatus(t.status,n)}checkAuthStatus(t,n){(t===401||n===qq)&&this.opts.credentialStore?.markAuthRequired?.()}}function Uq(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 VF(e){return e.contextTokens===0&&e.contextLimit===0&&e.inputTokens===0&&e.outputTokens===0&&e.turnCount===0}function Wu(e){return{id:e.id,title:e.title,createdAt:e.created_at,updatedAt:e.updated_at,busy:e.busy,mainTurnActive:e.main_turn_active,pendingInteraction:e.pending_interaction,lastTurnReason:e.last_turn_reason,archived:e.archived??!1,archivedAt:e.archived_at,currentPromptId:e.current_prompt_id,lastPrompt:e.last_prompt,cwd:e.metadata.cwd,model:e.agent_config.model,usage:Uq(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 Wy(e){const t=e.activity.status;return{id:e.id,title:e.meta.title??e.meta.last_prompt??e.id.slice(0,12),createdAt:new Date(e.meta.created_at).toISOString(),updatedAt:new Date(e.meta.updated_at).toISOString(),busy:t==="running",pendingInteraction:t==="approval"?"approval":t==="question"?"question":void 0,lastTurnReason:t==="failed"?"failed":void 0,archived:e.meta.archived,archivedAt:e.meta.archived_at==null?void 0:new Date(e.meta.archived_at).toISOString(),lastPrompt:e.meta.last_prompt??void 0,cwd:e.workspace.cwd??"",model:e.activity.model??"",pullRequest:e.git===void 0?void 0:e.git.pull_request,usage:{inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheCreationTokens:0,totalCostUsd:0,contextTokens:0,contextLimit:0,turnCount:0},messageCount:0,lastSeq:0,workspaceId:e.workspace.id.length>0?e.workspace.id:void 0}}function Y0(e){return{id:e.id,root:e.root,name:e.name,lastOpenedAt:e.last_opened_at,sessionCount:e.session_count}}function KF(e){return e.kind==="base64"?{kind:"base64",mediaType:e.media_type,data:e.data}:e.kind==="file"?{kind:"file",fileId:e.file_id}:e.kind==="session_media"?{kind:"sessionMedia",fileId:e.file_id}:{kind:"url",url:e.url}}function Q4(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:KF(e.source)};case"video":return{type:"video",source:KF(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 Vq(e){return{id:e.id,sessionId:e.session_id,role:e.role,content:e.content.map(Q4),createdAt:e.created_at,promptId:e.prompt_id,parentMessageId:e.parent_message_id,metadata:e.metadata}}function Kq(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}:t.kind==="sessionMedia"?n={kind:"session_media",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 $4e(e){return{content:e.content.map(Kq),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,skills:e.skills}}function z4e(e){return{decision:e.decision,scope:e.scope,feedback:e.feedback,selected_label:e.selectedLabel}}function j4e(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 H4e(e){return{id:e.id,label:e.label,description:e.description,recommended:e.recommended===!0||e.is_recommended===!0}}function W4e(e){return{id:e.id,question:e.question,header:e.header,body:e.body,options:e.options.map(H4e),multiSelect:e.multi_select,allowOther:e.allow_other,otherLabel:e.other_label,otherDescription:e.other_description}}function q4e(e){return{questionId:e.question_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,questions:e.questions.map(W4e),createdAt:e.created_at}}function U4e(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 V4e(e){const t={};for(const[n,i]of Object.entries(e.answers))t[n]=U4e(i);return{answers:t,method:e.method,note:e.note}}function KA(e,t){if(typeof e.run_in_background!="boolean")throw new Error(`task wire missing required run_in_background (id ${e.id})`);return{id:e.id,agentId:e.agent_id??t,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,model:e.model,thinkingEffort:e.thinking_effort,parentToolCallId:e.parent_tool_call_id,suspendedReason:e.suspended_reason,swarmIndex:e.swarm_index,runInBackground:e.run_in_background}}function ZF(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 Fd(e,t){const n=e[t];return typeof n=="string"?n:void 0}function d1(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function Sa(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function Zq(e){if(!e||typeof e!="object")return null;const t=e,n=Fd(t,"status");if(n!=="active"&&n!=="paused"&&n!=="blocked"&&n!=="complete")return null;const i=t.budget,o=i&&typeof i=="object"?i:{};return{goalId:Fd(t,"goalId")??Fd(t,"goal_id")??"goal",objective:Fd(t,"objective")??"",completionCriterion:Fd(t,"completionCriterion")??Fd(t,"completion_criterion"),status:n,turnsUsed:d1(t,"turnsUsed")??d1(t,"turns_used")??0,tokensUsed:d1(t,"tokensUsed")??d1(t,"tokens_used")??0,wallClockMs:d1(t,"wallClockMs")??d1(t,"wall_clock_ms")??0,terminalReason:Fd(t,"terminalReason")??Fd(t,"terminal_reason"),budget:{tokenBudget:Sa(o,"tokenBudget")??Sa(o,"token_budget"),remainingTokens:Sa(o,"remainingTokens")??Sa(o,"remaining_tokens"),turnBudget:Sa(o,"turnBudget")??Sa(o,"turn_budget"),remainingTurns:Sa(o,"remainingTurns")??Sa(o,"remaining_turns"),wallClockBudgetMs:Sa(o,"wallClockBudgetMs")??Sa(o,"wall_clock_budget_ms"),remainingWallClockMs:Sa(o,"remainingWallClockMs")??Sa(o,"remaining_wall_clock_ms"),overBudget:o.overBudget===!0||o.over_budget===!0}}}function K4e(e){const t=e;switch(e.type){case"event.session.created":return{type:"sessionCreated",session:Wu(t.payload.session)};case"event.session.updated":return{type:"sessionUpdated",session:Wu(t.payload.session),changedFields:t.payload.changed_fields};case"event.session.deleted":return{type:"sessionDeleted",sessionId:t.session_id};case"event.session.archived":{const n=t.payload?.sessionId??t.payload?.session_id;if(typeof n!="string"||n.length===0)return{type:"unknown",raw:{_noop:!0,_wireType:t.type}};const i=t.payload?.workspace_id;return{type:"sessionArchived",sessionId:n,workspaceId:typeof i=="string"&&i.length>0?i:void 0}}case"event.workspace.created":return{type:"workspaceCreated",workspace:Y0(t.payload.workspace)};case"event.workspace.updated":return{type:"workspaceUpdated",workspace:Y0(t.payload.workspace)};case"event.workspace.deleted":return{type:"workspaceDeleted",workspaceId:t.payload.workspace_id,root:t.payload.root};case"event.session.work_changed":return{type:"sessionWorkChanged",sessionId:t.session_id,busy:t.payload.busy,mainTurnActive:t.payload.main_turn_active,pendingInteraction:t.payload.pending_interaction,lastTurnReason:t.payload.last_turn_reason};case"event.session.status_changed":return{type:"sessionWorkChanged",sessionId:t.session_id,busy:t.payload.status!=="idle"&&t.payload.status!=="aborted",mainTurnActive:t.payload.status!=="idle"&&t.payload.status!=="aborted",pendingInteraction:t.payload.status==="awaiting_approval"?"approval":t.payload.status==="awaiting_question"?"question":"none",lastTurnReason:t.payload.status==="aborted"?"cancelled":void 0};case"event.session.usage_updated":return{type:"sessionUsageUpdated",sessionId:t.session_id,usage:Uq(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=Zq(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:Vq(t.payload.message)};case"event.message.updated":return{type:"messageUpdated",sessionId:t.session_id,messageId:t.payload.message_id,content:t.payload.content.map(Q4),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:j4e(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,feedback:t.payload.feedback,selectedLabel:t.payload.selected_label};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:q4e(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:KA(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.plugin.changed":return{type:"pluginsChanged"};case"event.capability.changed":return{type:"capabilityChanged",capabilityId:t.payload.capability_id,install:t.payload.install};case"event.config.changed":return{type:"configChanged",changedFields:t.payload.changed_fields,config:ZA(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 Z4e(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 f1(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 GF(e){return{id:e.id,name:e.name,wireType:e.wire_type,guessed:e.guessed,needsBaseUrl:e.needs_base_url,rejected:e.rejected,rejectReason:e.reject_reason,envKey:e.env_key,models:e.models.map(t=>({id:t.id,name:t.name,maxContextSize:t.max_context_size,capabilities:t.capabilities,reasoning:t.reasoning}))}}function ZA(e){const t={};for(const[n,i]of Object.entries(e.providers))t[n]={type:i.type,baseUrl:i.base_url,defaultModel:i.default_model,hasApiKey:i.has_api_key};return{providers:t,defaultProvider:e.default_provider,defaultModel:e.default_model,secondaryModel:e.secondary_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 G4e(e){return e.session_id}function Q4e(e){return e.seq}function Y4e(e){const t=Number(e.slice(1));return Number.isFinite(t)?t:0}function QF(e){switch(e.kind){case"turn":return e.turnId;case"marker":return e.markerId;case"taskref":return e.refId}}const J4e={items:[],tasks:new Map,interactions:new Map,attachments:new Map,todos:new Map,prompts:new Map,meta:{},pendingInteractions:new Set,hasMoreOlder:!1};function X4e(e,t){switch(t.op){case"reset":return ewe(e,t);case"turn.upsert":return nwe(e,t.turn);case"step.upsert":return owe(e,t.turnId,t.step);case"frame.upsert":return rwe(e,t);case"append":return awe(e,t);case"marker.upsert":return JF(e,t.item,t.item.markerId,t.beforeTurn);case"taskref.upsert":return JF(e,t.item,t.item.refId,t.beforeTurn);case"task.upsert":return dwe(e,t.task);case"interaction.upsert":return fwe(e,t.interaction);case"attachment.upsert":return pwe(e,t.attachment);case"todo.upsert":return gwe(e,t.todo);case"prompt.upsert":return ywe(e,t.prompt);case"meta.merge":return wwe(e,t.meta);case"items.remove":return cwe(e,t.ids)}}function ewe(e,t){const n=new Set;for(const i of t.snapshot.interactions)i.state==="pending"&&n.add(i.interactionId);return{state:{items:t.snapshot.items,tasks:new Map(t.snapshot.tasks.map(i=>[i.taskId,i])),interactions:new Map(t.snapshot.interactions.map(i=>[i.interactionId,i])),attachments:new Map(t.snapshot.attachments.map(i=>[i.attachmentId,i])),todos:new Map(t.snapshot.todos.map(i=>[i.todoId,i])),prompts:new Map(t.snapshot.prompts.map(i=>[i.promptId,i])),meta:t.snapshot.meta,pendingInteractions:n,hasMoreOlder:t.snapshot.hasMoreOlder??!1},changed:!0}}function YF(e,t){return{...e,kind:"turn",steps:[...t]}}function Gq(e){return{kind:"turn",turnId:e,ordinal:Y4e(e),state:"running",origin:{kind:"other"},steps:[]}}function twe(e,t){const n=Number(e.slice(t.length+1))||0;return{kind:"step",stepId:e,turnId:t,ordinal:n,state:"running",frames:[]}}function Am(e,t){const n=e.items.find(i=>i.kind==="turn"&&i.turnId===t);return n?.kind==="turn"?n:void 0}function tS(e,t){const n=[...e];let i=n.length;for(let o=0;ot.ordinal){i=o;break}}return n.splice(i,0,t),n}function Y4(e,t,n){return e.map(i=>i.kind==="turn"&&i.turnId===t?n(i):i)}function nwe(e,t){const n=Am(e,t.turnId);return n?iwe(n,t)?{state:e,changed:!1}:{state:{...e,items:Y4(e.items,t.turnId,i=>YF(t,i.steps))},changed:!0}:{state:{...e,items:tS(e.items,YF(t,[]))},changed:!0}}function iwe(e,t){return e.ordinal===t.ordinal&&e.triggerPromptId===t.triggerPromptId&&e.state===t.state&&e.prompt===t.prompt&&e.attachmentIds===t.attachmentIds&&e.startedAt===t.startedAt&&e.endedAt===t.endedAt&&e.origin.kind===t.origin.kind&&e.origin.payload===t.origin.payload&&e.usage===t.usage&&e.durationMs===t.durationMs&&e.error===t.error}function owe(e,t,n){const i=Am(e,t)??Gq(t),o=i.steps.findIndex(u=>u.stepId===n.stepId);let s,r=!0;if(o>=0){const u=i.steps[o];u&&swe(u,n)?(r=!1,s=i.steps):s=i.steps.map(c=>c.stepId===n.stepId?{...n,kind:"step",frames:c.frames}:c)}else s=[...i.steps,{...n,kind:"step",frames:[]}].toSorted((u,c)=>u.ordinal-c.ordinal);if(!r)return{state:e,changed:!1};const l={...i,steps:[...s]},a=Am(e,t)?Y4(e.items,t,()=>l):tS(e.items,l);return{state:{...e,items:a},changed:!0}}function swe(e,t){return e.ordinal===t.ordinal&&e.state===t.state&&e.startedAt===t.startedAt&&e.endedAt===t.endedAt&&e.usage===t.usage&&e.finishReason===t.finishReason&&e.timing===t.timing&&e.retry===t.retry&&e.endReason===t.endReason&&e.endMessage===t.endMessage}function rwe(e,t){const n=Am(e,t.turnId)??Gq(t.turnId),i=n.steps.find(c=>c.stepId===t.stepId)??twe(t.stepId,t.turnId),o=i.frames.findIndex(c=>c.frameId===t.frame.frameId);let s;if(o>=0){const c=i.frames[o];if(c!==void 0&&lwe(c,t.frame))return{state:e,changed:!1};s=i.frames.map(d=>d.frameId===t.frame.frameId?t.frame:d)}else s=[...i.frames,t.frame];const r={...i,frames:[...s]},l=n.steps.some(c=>c.stepId===t.stepId)?n.steps.map(c=>c.stepId===t.stepId?r:c):[...n.steps,r].toSorted((c,d)=>c.ordinal-d.ordinal),a={...n,steps:l},u=Am(e,t.turnId)?Y4(e.items,t.turnId,()=>a):tS(e.items,a);return{state:{...e,items:u},changed:!0}}function lwe(e,t){return e.kind!==t.kind?!1:e.kind==="text"&&t.kind==="text"?e.text===t.text&&e.role===t.role&&e.attachmentIds===t.attachmentIds&&e.taskId===t.taskId:e.kind==="thinking"&&t.kind==="thinking"?e.text===t.text:e.kind==="tool"&&t.kind==="tool"?e.state===t.state&&e.toolCallId===t.toolCallId&&e.name===t.name&&e.view===t.view&&e.input===t.input&&e.output===t.output&&e.display===t.display&&e.error===t.error&&e.inputText===t.inputText&&e.progress===t.progress&&e.taskId===t.taskId&&e.approvalId===t.approvalId&&e.todoId===t.todoId&&e.agentRefs===t.agentRefs:e.kind==="notice"&&t.kind==="notice"?e.message===t.message&&e.level===t.level&&e.detail===t.detail:!1}function awe(e,t){if(t.target.type==="task")return uwe(e,t);const{turnId:n,stepId:i,frameId:o}=t.target,s=Am(e,n),r=s?.steps.find(f=>f.stepId===i),l=r?.frames.find(f=>f.frameId===o);if(!s||!r||!l||l.kind!=="text"&&l.kind!=="thinking")return{state:e,changed:!1,gap:{expected:0,got:t.offset}};const a=Qq(l.text,t.offset,t.text);if(a.gap)return{state:e,changed:!1,gap:a.gap};if(!a.changed)return{state:e,changed:!1};const u={...l,text:a.text},c={...r,frames:r.frames.map(f=>f.frameId===o?u:f)},d={...s,steps:s.steps.map(f=>f.stepId===i?c:f)};return{state:{...e,items:Y4(e.items,n,()=>d)},changed:!0}}function uwe(e,t){if(t.target.type!=="task")throw new Error("unreachable");const n=t.target.taskId,i=e.tasks.get(n),o=i?.outputTail??"",s=Qq(o,t.offset,t.text);if(s.gap)return{state:e,changed:!1,gap:s.gap};if(!s.changed)return{state:e,changed:!1};const r=i?{...i,outputTail:s.text}:{taskId:n,kind:"other",state:"running",detached:!1,outputTail:s.text},l=new Map(e.tasks);return l.set(n,r),{state:{...e,tasks:l},changed:!0}}function Qq(e,t,n){if(t>e.length)return{text:e,changed:!1,gap:{expected:e.length,got:t}};if(e.slice(t,t+n.length)===n)return{text:e,changed:!1};const i=e.length-t;return e.slice(t)!==n.slice(0,i)?{text:e,changed:!1,gap:{expected:e.length,got:t}}:(i>0?n.slice(i):n).length===0?{text:e,changed:!1}:{text:e.slice(0,t)+n,changed:!0}}function JF(e,t,n,i){if(e.items.some(s=>GA(s)===n)){let s=!1;const r=e.items.map(l=>GA(l)!==n||l===t?l:(s=!0,t));return s?{state:{...e,items:r},changed:!0}:{state:e,changed:!1}}if(i!==void 0){const s=[...e.items];let r=s.length;for(let l=0;l=i){r=l;break}}return s.splice(r,0,t),{state:{...e,items:s},changed:!0}}return{state:{...e,items:[...e.items,t]},changed:!0}}function GA(e){switch(e.kind){case"turn":return e.turnId;case"marker":return e.markerId;case"taskref":return e.refId}}function cwe(e,t){const n=new Set(t),i=e.items.filter(l=>l.kind==="turn"&&n.has(l.turnId)),o=e.items.filter(l=>!n.has(GA(l)));if(o.length===e.items.length)return{state:e,changed:!1};let s=e.pendingInteractions,r=e.interactions;if(i.length>0){const l=new Set,a=new Set(s),u=new Set;for(const c of i)for(const d of c.steps)for(const f of d.frames)f.kind==="tool"&&l.add(f.toolCallId);for(const c of r.values())c.toolCallId!==void 0&&l.has(c.toolCallId)&&(u.add(c.interactionId),a.delete(c.interactionId));if(u.size>0){const c=new Map(r);for(const d of u)c.delete(d);r=c}s=a}return{state:{...e,items:o,interactions:r,pendingInteractions:s},changed:!0}}function dwe(e,t){const n=e.tasks.get(t.taskId);if(n&&bwe(n,t))return{state:e,changed:!1};const i=new Map(e.tasks);return i.set(t.taskId,t),{state:{...e,tasks:i},changed:!0}}function fwe(e,t){const n=e.interactions.get(t.interactionId);if(n&&hwe(n,t))return{state:e,changed:!1};const i=new Map(e.interactions);i.set(t.interactionId,t);let o=e.pendingInteractions;if(t.state==="pending"){if(!o.has(t.interactionId)){const s=new Set(o);s.add(t.interactionId),o=s}}else if(o.has(t.interactionId)){const s=new Set(o);s.delete(t.interactionId),o=s}return{state:{...e,interactions:i,pendingInteractions:o},changed:!0}}function hwe(e,t){return e.interactionKind===t.interactionKind&&e.toolCallId===t.toolCallId&&e.state===t.state&&e.request===t.request&&e.response===t.response}function pwe(e,t){const n=e.attachments.get(t.attachmentId);if(n&&mwe(n,t))return{state:e,changed:!1};const i=new Map(e.attachments);return i.set(t.attachmentId,t),{state:{...e,attachments:i},changed:!0}}function mwe(e,t){return e.mediaType===t.mediaType&&e.name===t.name&&e.size===t.size&&e.source===t.source&&e.placeholder===t.placeholder}function gwe(e,t){const n=e.todos.get(t.todoId);if(n&&vwe(n,t))return{state:e,changed:!1};const i=new Map(e.todos);return i.set(t.todoId,t),{state:{...e,todos:i},changed:!0}}function vwe(e,t){return e.items===t.items&&e.updatedAt===t.updatedAt}function ywe(e,t){const n=e.prompts.get(t.promptId);if(n&&kwe(n,t))return{state:e,changed:!1};const i=new Map(e.prompts);return i.set(t.promptId,t),{state:{...e,prompts:i},changed:!0}}function kwe(e,t){return e.status===t.status&&e.userMessageId===t.userMessageId&&e.content===t.content&&e.createdAt===t.createdAt&&e.finishedAt===t.finishedAt&&e.steeredAt===t.steeredAt}function bwe(e,t){return e.kind===t.kind&&e.state===t.state&&e.detached===t.detached&&e.description===t.description&&e.agentId===t.agentId&&e.outputTail===t.outputTail&&e.startedAt===t.startedAt&&e.endedAt===t.endedAt&&e.resultSummary===t.resultSummary&&e.error===t.error&&e.stateReason===t.stateReason&&e.usage===t.usage}function wwe(e,t){const n=t.modes!==void 0?{plan:t.modes.plan===null?void 0:t.modes.plan??e.meta.modes?.plan,swarm:t.modes.swarm===null?void 0:t.modes.swarm??e.meta.modes?.swarm,tower:t.modes.tower===null?void 0:t.modes.tower??e.meta.modes?.tower}:e.meta.modes,i=t.agent!==void 0?{...e.meta.agent,...t.agent}:e.meta.agent,o={goal:t.goal===null?void 0:t.goal??e.meta.goal,activity:t.activity??e.meta.activity,modes:n!==void 0&&n.plan===void 0&&n.swarm===void 0&&n.tower===void 0?void 0:n,agent:i};return o.goal===e.meta.goal&&o.activity===e.meta.activity&&o.modes===e.meta.modes&&o.agent===e.meta.agent?{state:e,changed:!1}:{state:{...e,meta:o},changed:!0}}class Cwe{constructor(t){this.agentId=t}#e=J4e;#t=new Set;receive(t){return this.apply(t)}apply(t){const n=[];let i,o=this.#e;for(const s of t){const r=X4e(o,s);if(r.gap){i={target:s.target,...r.gap};continue}r.changed&&(o=r.state,n.push(s))}if(this.#e=o,n.length>0){const s={agentId:this.agentId,ops:n};for(const r of this.#t)r(s)}return{accepted:n,gap:i}}onChange(t){return this.#t.add(t),{dispose:()=>void this.#t.delete(t)}}getItems(){return this.#e.items}getTurn(t){const n=this.#e.items.find(i=>i.kind==="turn"&&i.turnId===t);return n?.kind==="turn"?n:void 0}getTasks(){return this.#e.tasks}getTask(t){return this.#e.tasks.get(t)}getInteractions(){return this.#e.interactions}getInteraction(t){return this.#e.interactions.get(t)}getAttachments(){return this.#e.attachments}getAttachment(t){return this.#e.attachments.get(t)}getTodos(){return this.#e.todos}getTodo(t){return this.#e.todos.get(t)}getPrompts(){return this.#e.prompts}getPrompt(t){return this.#e.prompts.get(t)}getMeta(){return this.#e.meta}listPendingInteractions(){return[...this.#e.pendingInteractions]}get hasMoreOlder(){return this.#e.hasMoreOlder}snapshot(t){let n=this.#e.items,i=this.#e.hasMoreOlder;if(t!==void 0){const o=n.reduce((s,r)=>r.kind==="turn"?s+1:s,0);if(o>t.tailTurns){const s=o-t.tailTurns,r=[];let l=0;for(const a of n)if(a.kind==="turn"){if(l+=1,l<=s)continue;r.push(a)}else l>s&&r.push(a);n=r,i=!0}}return{items:n,tasks:[...this.#e.tasks.values()],interactions:[...this.#e.interactions.values()],attachments:[...this.#e.attachments.values()],todos:[...this.#e.todos.values()],prompts:[...this.#e.prompts.values()],meta:this.#e.meta,hasMoreOlder:i}}}function Ft(e,t,n){function i(l,a){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:a,constr:r,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,a);const u=r.prototype,c=Object.keys(u);for(let d=0;dn?.Parent&&l instanceof n.Parent?!0:l?._zod?.traits?.has(e)}),Object.defineProperty(r,"name",{value:e}),r}class cm extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Yq extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Jq={};function Ef(e){return Jq}function Xq(e){const t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,o])=>t.indexOf(+i)===-1).map(([i,o])=>o)}function QA(e,t){return typeof t=="bigint"?t.toString():t}function J4(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function nS(e){return e==null}function iS(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Awe(e,t){const n=(e.toString().split(".")[1]||"").length,i=t.toString();let o=(i.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(i)){const a=i.match(/\d?e-(\d?)/);a?.[1]&&(o=Number.parseInt(a[1]))}const s=n>o?n:o,r=Number.parseInt(e.toFixed(s).replace(".","")),l=Number.parseInt(t.toFixed(s).replace(".",""));return r%l/10**s}const XF=Symbol("evaluating");function Di(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==XF)return i===void 0&&(i=XF,i=n()),i},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Fp(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Uf(...e){const t={};for(const n of e){const i=Object.getOwnPropertyDescriptors(n);Object.assign(t,i)}return Object.defineProperties({},t)}function eD(e){return JSON.stringify(e)}function xwe(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const eU="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Bv(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Swe=J4(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function xm(e){if(Bv(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Bv(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function tU(e){return xm(e)?{...e}:Array.isArray(e)?[...e]:e}const _we=new Set(["string","number","symbol"]);function Sm(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Vf(e,t,n){const i=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(i._zod.parent=e),i}function _n(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Iwe(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Mwe={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Twe(e,t){const n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=Uf(e._zod.def,{get shape(){const r={};for(const l in t){if(!(l in n.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&(r[l]=n.shape[l])}return Fp(this,"shape",r),r},checks:[]});return Vf(e,s)}function Ewe(e,t){const n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=Uf(e._zod.def,{get shape(){const r={...e._zod.def.shape};for(const l in t){if(!(l in n.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&delete r[l]}return Fp(this,"shape",r),r},checks:[]});return Vf(e,s)}function Lwe(e,t){if(!xm(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const s=e._zod.def.shape;for(const r in t)if(Object.getOwnPropertyDescriptor(s,r)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=Uf(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return Fp(this,"shape",s),s}});return Vf(e,o)}function Nwe(e,t){if(!xm(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Uf(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return Fp(this,"shape",i),i}});return Vf(e,n)}function Fwe(e,t){const n=Uf(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t._zod.def.shape};return Fp(this,"shape",i),i},get catchall(){return t._zod.def.catchall},checks:[]});return Vf(e,n)}function Dwe(e,t,n){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const r=Uf(t._zod.def,{get shape(){const l=t._zod.def.shape,a={...l};if(n)for(const u in n){if(!(u in l))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(a[u]=e?new e({type:"optional",innerType:l[u]}):l[u])}else for(const u in l)a[u]=e?new e({type:"optional",innerType:l[u]}):l[u];return Fp(this,"shape",a),a},checks:[]});return Vf(t,r)}function Rwe(e,t,n){const i=Uf(t._zod.def,{get shape(){const o=t._zod.def.shape,s={...o};if(n)for(const r in n){if(!(r in s))throw new Error(`Unrecognized key: "${r}"`);n[r]&&(s[r]=new e({type:"nonoptional",innerType:o[r]}))}else for(const r in o)s[r]=new e({type:"nonoptional",innerType:o[r]});return Fp(this,"shape",s),s}});return Vf(t,i)}function B1(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n{var i;return(i=n).path??(i.path=[]),n.path.unshift(e),n})}function qy(e){return typeof e=="string"?e:e?.message}function Lf(e,t,n){const i={...e,path:e.path??[]};if(!e.message){const o=qy(e.inst?._zod.def?.error?.(e))??qy(t?.error?.(e))??qy(n.customError?.(e))??qy(n.localeError?.(e))??"Invalid input";i.message=o}return delete i.inst,delete i.continue,t?.reportInput||delete i.input,i}function oS(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function $v(...e){const[t,n,i]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:i}:{...t}}const nU=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,QA,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},iU=Ft("$ZodError",nU),oU=Ft("$ZodError",nU,{Parent:Error});function Owe(e,t=n=>n.message){const n={},i=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):i.push(t(o));return{formErrors:i,fieldErrors:n}}function Pwe(e,t=n=>n.message){const n={_errors:[]},i=o=>{for(const s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(r=>i({issues:r}));else if(s.code==="invalid_key")i({issues:s.issues});else if(s.code==="invalid_element")i({issues:s.issues});else if(s.path.length===0)n._errors.push(t(s));else{let r=n,l=0;for(;l(t,n,i,o)=>{const s=i?Object.assign(i,{async:!1}):{async:!1},r=t._zod.run({value:n,issues:[]},s);if(r instanceof Promise)throw new cm;if(r.issues.length){const l=new(o?.Err??e)(r.issues.map(a=>Lf(a,s,Ef())));throw eU(l,o?.callee),l}return r.value},rS=e=>async(t,n,i,o)=>{const s=i?Object.assign(i,{async:!0}):{async:!0};let r=t._zod.run({value:n,issues:[]},s);if(r instanceof Promise&&(r=await r),r.issues.length){const l=new(o?.Err??e)(r.issues.map(a=>Lf(a,s,Ef())));throw eU(l,o?.callee),l}return r.value},X4=e=>(t,n,i)=>{const o=i?{...i,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new cm;return s.issues.length?{success:!1,error:new(e??iU)(s.issues.map(r=>Lf(r,o,Ef())))}:{success:!0,data:s.value}},Bwe=X4(oU),ew=e=>async(t,n,i)=>{const o=i?Object.assign(i,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(r=>Lf(r,o,Ef())))}:{success:!0,data:s.value}},$we=ew(oU),zwe=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return sS(e)(t,n,o)},jwe=e=>(t,n,i)=>sS(e)(t,n,i),Hwe=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return rS(e)(t,n,o)},Wwe=e=>async(t,n,i)=>rS(e)(t,n,i),qwe=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return X4(e)(t,n,o)},Uwe=e=>(t,n,i)=>X4(e)(t,n,i),Vwe=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return ew(e)(t,n,o)},Kwe=e=>async(t,n,i)=>ew(e)(t,n,i),Zwe=/^[cC][^\s-]{8,}$/,Gwe=/^[0-9a-z]+$/,Qwe=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Ywe=/^[0-9a-vA-V]{20}$/,Jwe=/^[A-Za-z0-9]{27}$/,Xwe=/^[a-zA-Z0-9_-]{21}$/,e3e=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,t3e=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,tD=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,n3e=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,i3e="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function o3e(){return new RegExp(i3e,"u")}const s3e=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,r3e=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,l3e=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,a3e=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,u3e=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,sU=/^[A-Za-z0-9_-]*$/,c3e=/^\+[1-9]\d{6,14}$/,rU="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",d3e=new RegExp(`^${rU}$`);function lU(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function f3e(e){return new RegExp(`^${lU(e)}$`)}function h3e(e){const t=lU({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const i=`${t}(?:${n.join("|")})`;return new RegExp(`^${rU}T(?:${i})$`)}const p3e=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},m3e=/^-?\d+$/,aU=/^-?\d+(?:\.\d+)?$/,g3e=/^(?:true|false)$/i,v3e=/^[^A-Z]*$/,y3e=/^[^a-z]*$/,Pl=Ft("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),uU={number:"number",bigint:"bigint",object:"date"},cU=Ft("$ZodCheckLessThan",(e,t)=>{Pl.init(e,t);const n=uU[typeof t.value];e._zod.onattach.push(i=>{const o=i._zod.bag,s=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value{(t.inclusive?i.value<=t.value:i.value{Pl.init(e,t);const n=uU[typeof t.value];e._zod.onattach.push(i=>{const o=i._zod.bag,s=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),k3e=Ft("$ZodCheckMultipleOf",(e,t)=>{Pl.init(e,t),e._zod.onattach.push(n=>{var i;(i=n._zod.bag).multipleOf??(i.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):Awe(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),b3e=Ft("$ZodCheckNumberFormat",(e,t)=>{Pl.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),i=n?"int":"number",[o,s]=Mwe[t.format];e._zod.onattach.push(r=>{const l=r._zod.bag;l.format=t.format,l.minimum=o,l.maximum=s,n&&(l.pattern=m3e)}),e._zod.check=r=>{const l=r.value;if(n){if(!Number.isInteger(l)){r.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?r.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort}):r.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort});return}}ls&&r.issues.push({origin:"number",input:l,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),w3e=Ft("$ZodCheckMaxLength",(e,t)=>{var n;Pl.init(e,t),(n=e._zod.def).when??(n.when=i=>{const o=i.value;return!nS(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum{const o=i.value;if(o.length<=t.maximum)return;const r=oS(o);i.issues.push({origin:r,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),C3e=Ft("$ZodCheckMinLength",(e,t)=>{var n;Pl.init(e,t),(n=e._zod.def).when??(n.when=i=>{const o=i.value;return!nS(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{const o=i.value;if(o.length>=t.minimum)return;const r=oS(o);i.issues.push({origin:r,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),A3e=Ft("$ZodCheckLengthEquals",(e,t)=>{var n;Pl.init(e,t),(n=e._zod.def).when??(n.when=i=>{const o=i.value;return!nS(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=i=>{const o=i.value,s=o.length;if(s===t.length)return;const r=oS(o),l=s>t.length;i.issues.push({origin:r,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),tw=Ft("$ZodCheckStringFormat",(e,t)=>{var n,i;Pl.init(e,t),e._zod.onattach.push(o=>{const s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})}),x3e=Ft("$ZodCheckRegex",(e,t)=>{tw.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),S3e=Ft("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=v3e),tw.init(e,t)}),_3e=Ft("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=y3e),tw.init(e,t)}),I3e=Ft("$ZodCheckIncludes",(e,t)=>{Pl.init(e,t);const n=Sm(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=i,e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(i)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),M3e=Ft("$ZodCheckStartsWith",(e,t)=>{Pl.init(e,t);const n=new RegExp(`^${Sm(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(i=>{const o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),T3e=Ft("$ZodCheckEndsWith",(e,t)=>{Pl.init(e,t);const n=new RegExp(`.*${Sm(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(i=>{const o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}}),E3e=Ft("$ZodCheckOverwrite",(e,t)=>{Pl.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class L3e{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const i=t.split(` +`).filter(r=>r),o=Math.min(...i.map(r=>r.length-r.trimStart().length)),s=i.map(r=>r.slice(o)).map(r=>" ".repeat(this.indent*2)+r);for(const r of s)this.content.push(r)}compile(){const t=Function,n=this?.args,o=[...(this?.content??[""]).map(s=>` ${s}`)];return new t(...n,o.join(` +`))}}const N3e={major:4,minor:3,patch:6},Co=Ft("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=N3e;const i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(const o of i)for(const s of o._zod.onattach)s(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(r,l,a)=>{let u=B1(r),c;for(const d of l){if(d._zod.def.when){if(!d._zod.def.when(r))continue}else if(u)continue;const f=r.issues.length,h=d._zod.check(r);if(h instanceof Promise&&a?.async===!1)throw new cm;if(c||h instanceof Promise)c=(c??Promise.resolve()).then(async()=>{await h,r.issues.length!==f&&(u||(u=B1(r,f)))});else{if(r.issues.length===f)continue;u||(u=B1(r,f))}}return c?c.then(()=>r):r},s=(r,l,a)=>{if(B1(r))return r.aborted=!0,r;const u=o(l,i,a);if(u instanceof Promise){if(a.async===!1)throw new cm;return u.then(c=>e._zod.parse(c,a))}return e._zod.parse(u,a)};e._zod.run=(r,l)=>{if(l.skipChecks)return e._zod.parse(r,l);if(l.direction==="backward"){const u=e._zod.parse({value:r.value,issues:[]},{...l,skipChecks:!0});return u instanceof Promise?u.then(c=>s(c,r,l)):s(u,r,l)}const a=e._zod.parse(r,l);if(a instanceof Promise){if(l.async===!1)throw new cm;return a.then(u=>o(u,i,l))}return o(a,i,l)}}Di(e,"~standard",()=>({validate:o=>{try{const s=Bwe(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return $we(e,o).then(r=>r.success?{value:r.data}:{issues:r.error?.issues})}},vendor:"zod",version:1}))}),lS=Ft("$ZodString",(e,t)=>{Co.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??p3e(e._zod.bag),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),go=Ft("$ZodStringFormat",(e,t)=>{tw.init(e,t),lS.init(e,t)}),F3e=Ft("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=t3e),go.init(e,t)}),D3e=Ft("$ZodUUID",(e,t)=>{if(t.version){const i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(i===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=tD(i))}else t.pattern??(t.pattern=tD());go.init(e,t)}),R3e=Ft("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=n3e),go.init(e,t)}),O3e=Ft("$ZodURL",(e,t)=>{go.init(e,t),e._zod.check=n=>{try{const i=n.value.trim(),o=new URL(i);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=o.href:n.value=i;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),P3e=Ft("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=o3e()),go.init(e,t)}),B3e=Ft("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Xwe),go.init(e,t)}),$3e=Ft("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Zwe),go.init(e,t)}),z3e=Ft("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Gwe),go.init(e,t)}),j3e=Ft("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Qwe),go.init(e,t)}),H3e=Ft("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Ywe),go.init(e,t)}),W3e=Ft("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Jwe),go.init(e,t)}),q3e=Ft("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=h3e(t)),go.init(e,t)}),U3e=Ft("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=d3e),go.init(e,t)}),V3e=Ft("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=f3e(t)),go.init(e,t)}),K3e=Ft("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=e3e),go.init(e,t)}),Z3e=Ft("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=s3e),go.init(e,t),e._zod.bag.format="ipv4"}),G3e=Ft("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=r3e),go.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),Q3e=Ft("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=l3e),go.init(e,t)}),Y3e=Ft("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=a3e),go.init(e,t),e._zod.check=n=>{const i=n.value.split("/");try{if(i.length!==2)throw new Error;const[o,s]=i;if(!s)throw new Error;const r=Number(s);if(`${r}`!==s)throw new Error;if(r<0||r>128)throw new Error;new URL(`http://[${o}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function fU(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const J3e=Ft("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=u3e),go.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{fU(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function X3e(e){if(!sU.test(e))return!1;const t=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return fU(n)}const e8e=Ft("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=sU),go.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{X3e(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),t8e=Ft("$ZodE164",(e,t)=>{t.pattern??(t.pattern=c3e),go.init(e,t)});function n8e(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[i]=n;if(!i)return!1;const o=JSON.parse(atob(i));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const i8e=Ft("$ZodJWT",(e,t)=>{go.init(e,t),e._zod.check=n=>{n8e(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),hU=Ft("$ZodNumber",(e,t)=>{Co.init(e,t),e._zod.pattern=e._zod.bag.pattern??aU,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const o=n.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return n;const s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),n}}),o8e=Ft("$ZodNumberFormat",(e,t)=>{b3e.init(e,t),hU.init(e,t)}),s8e=Ft("$ZodBoolean",(e,t)=>{Co.init(e,t),e._zod.pattern=g3e,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=!!n.value}catch{}const o=n.value;return typeof o=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),r8e=Ft("$ZodUnknown",(e,t)=>{Co.init(e,t),e._zod.parse=n=>n}),l8e=Ft("$ZodNever",(e,t)=>{Co.init(e,t),e._zod.parse=(n,i)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function nD(e,t,n){e.issues.length&&t.issues.push(...$1(n,e.issues)),t.value[n]=e.value}const a8e=Ft("$ZodArray",(e,t)=>{Co.init(e,t),e._zod.parse=(n,i)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const s=[];for(let r=0;rnD(u,n,r))):nD(a,n,r)}return s.length?Promise.all(s).then(()=>n):n}});function Ab(e,t,n,i,o){if(e.issues.length){if(o&&!(n in i))return;t.issues.push(...$1(n,e.issues))}e.value===void 0?n in i&&(t.value[n]=void 0):t.value[n]=e.value}function pU(e){const t=Object.keys(e.shape);for(const i of t)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);const n=Iwe(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function mU(e,t,n,i,o,s){const r=[],l=o.keySet,a=o.catchall._zod,u=a.def.type,c=a.optout==="optional";for(const d in t){if(l.has(d))continue;if(u==="never"){r.push(d);continue}const f=a.run({value:t[d],issues:[]},i);f instanceof Promise?e.push(f.then(h=>Ab(h,n,d,t,c))):Ab(f,n,d,t,c)}return r.length&&n.issues.push({code:"unrecognized_keys",keys:r,input:t,inst:s}),e.length?Promise.all(e).then(()=>n):n}const u8e=Ft("$ZodObject",(e,t)=>{if(Co.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const l=t.shape;Object.defineProperty(t,"shape",{get:()=>{const a={...l};return Object.defineProperty(t,"shape",{value:a}),a}})}const i=J4(()=>pU(t));Di(e._zod,"propValues",()=>{const l=t.shape,a={};for(const u in l){const c=l[u]._zod;if(c.values){a[u]??(a[u]=new Set);for(const d of c.values)a[u].add(d)}}return a});const o=Bv,s=t.catchall;let r;e._zod.parse=(l,a)=>{r??(r=i.value);const u=l.value;if(!o(u))return l.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),l;l.value={};const c=[],d=r.shape;for(const f of r.keys){const h=d[f],m=h._zod.optout==="optional",g=h._zod.run({value:u[f],issues:[]},a);g instanceof Promise?c.push(g.then(y=>Ab(y,l,f,u,m))):Ab(g,l,f,u,m)}return s?mU(c,u,l,a,i.value,e):c.length?Promise.all(c).then(()=>l):l}}),c8e=Ft("$ZodObjectJIT",(e,t)=>{u8e.init(e,t);const n=e._zod.parse,i=J4(()=>pU(t)),o=f=>{const h=new L3e(["shape","payload","ctx"]),m=i.value,g=C=>{const w=eD(C);return`shape[${w}]._zod.run({ value: input[${w}], issues: [] }, ctx)`};h.write("const input = payload.value;");const y=Object.create(null);let k=0;for(const C of m.keys)y[C]=`key_${k++}`;h.write("const newResult = {};");for(const C of m.keys){const w=y[C],M=eD(C),E=f[C]?._zod?.optout==="optional";h.write(`const ${w} = ${g(C)};`),E?h.write(` + if (${w}.issues.length) { + if (${M} in input) { + payload.issues = payload.issues.concat(${w}.issues.map(iss => ({ + ...iss, + path: iss.path ? [${M}, ...iss.path] : [${M}] + }))); + } + } + + if (${w}.value === undefined) { + if (${M} in input) { + newResult[${M}] = undefined; + } + } else { + newResult[${M}] = ${w}.value; + } + + `):h.write(` + if (${w}.issues.length) { + payload.issues = payload.issues.concat(${w}.issues.map(iss => ({ + ...iss, + path: iss.path ? [${M}, ...iss.path] : [${M}] + }))); + } + + if (${w}.value === undefined) { + if (${M} in input) { + newResult[${M}] = undefined; + } + } else { + newResult[${M}] = ${w}.value; + } + + `)}h.write("payload.value = newResult;"),h.write("return payload;");const v=h.compile();return(C,w)=>v(f,C,w)};let s;const r=Bv,l=!Jq.jitless,u=l&&Swe.value,c=t.catchall;let d;e._zod.parse=(f,h)=>{d??(d=i.value);const m=f.value;return r(m)?l&&u&&h?.async===!1&&h.jitless!==!0?(s||(s=o(t.shape)),f=s(f,h),c?mU([],m,f,h,d,e):f):n(f,h):(f.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),f)}});function iD(e,t,n,i){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const o=e.filter(s=>!B1(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(s=>s.issues.map(r=>Lf(r,i,Ef())))}),t)}const gU=Ft("$ZodUnion",(e,t)=>{Co.init(e,t),Di(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),Di(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),Di(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),Di(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>iS(s.source)).join("|")})$`)}});const n=t.options.length===1,i=t.options[0]._zod.run;e._zod.parse=(o,s)=>{if(n)return i(o,s);let r=!1;const l=[];for(const a of t.options){const u=a._zod.run({value:o.value,issues:[]},s);if(u instanceof Promise)l.push(u),r=!0;else{if(u.issues.length===0)return u;l.push(u)}}return r?Promise.all(l).then(a=>iD(a,o,e,s)):iD(l,o,e,s)}}),d8e=Ft("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,gU.init(e,t);const n=e._zod.parse;Di(e._zod,"propValues",()=>{const o={};for(const s of t.options){const r=s._zod.propValues;if(!r||Object.keys(r).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(const[l,a]of Object.entries(r)){o[l]||(o[l]=new Set);for(const u of a)o[l].add(u)}}return o});const i=J4(()=>{const o=t.options,s=new Map;for(const r of o){const l=r._zod.propValues?.[t.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(const a of l){if(s.has(a))throw new Error(`Duplicate discriminator value "${String(a)}"`);s.set(a,r)}}return s});e._zod.parse=(o,s)=>{const r=o.value;if(!Bv(r))return o.issues.push({code:"invalid_type",expected:"object",input:r,inst:e}),o;const l=i.value.get(r?.[t.discriminator]);return l?l._zod.run(o,s):t.unionFallback?n(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:r,path:[t.discriminator],inst:e}),o)}}),f8e=Ft("$ZodIntersection",(e,t)=>{Co.init(e,t),e._zod.parse=(n,i)=>{const o=n.value,s=t.left._zod.run({value:o,issues:[]},i),r=t.right._zod.run({value:o,issues:[]},i);return s instanceof Promise||r instanceof Promise?Promise.all([s,r]).then(([a,u])=>oD(n,a,u)):oD(n,s,r)}});function YA(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(xm(e)&&xm(t)){const n=Object.keys(t),i=Object.keys(e).filter(s=>n.indexOf(s)!==-1),o={...e,...t};for(const s of i){const r=YA(e[s],t[s]);if(!r.valid)return{valid:!1,mergeErrorPath:[s,...r.mergeErrorPath]};o[s]=r.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let i=0;il.l&&l.r).map(([l])=>l);if(s.length&&o&&e.issues.push({...o,keys:s}),B1(e))return e;const r=YA(t.value,n.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const h8e=Ft("$ZodRecord",(e,t)=>{Co.init(e,t),e._zod.parse=(n,i)=>{const o=n.value;if(!xm(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;const s=[],r=t.keyType._zod.values;if(r){n.value={};const l=new Set;for(const u of r)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){l.add(typeof u=="number"?u.toString():u);const c=t.valueType._zod.run({value:o[u],issues:[]},i);c instanceof Promise?s.push(c.then(d=>{d.issues.length&&n.issues.push(...$1(u,d.issues)),n.value[u]=d.value})):(c.issues.length&&n.issues.push(...$1(u,c.issues)),n.value[u]=c.value)}let a;for(const u in o)l.has(u)||(a=a??[],a.push(u));a&&a.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:a})}else{n.value={};for(const l of Reflect.ownKeys(o)){if(l==="__proto__")continue;let a=t.keyType._zod.run({value:l,issues:[]},i);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&aU.test(l)&&a.issues.length){const d=t.keyType._zod.run({value:Number(l),issues:[]},i);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(a=d)}if(a.issues.length){t.mode==="loose"?n.value[l]=o[l]:n.issues.push({code:"invalid_key",origin:"record",issues:a.issues.map(d=>Lf(d,i,Ef())),input:l,path:[l],inst:e});continue}const c=t.valueType._zod.run({value:o[l],issues:[]},i);c instanceof Promise?s.push(c.then(d=>{d.issues.length&&n.issues.push(...$1(l,d.issues)),n.value[a.value]=d.value})):(c.issues.length&&n.issues.push(...$1(l,c.issues)),n.value[a.value]=c.value)}}return s.length?Promise.all(s).then(()=>n):n}}),p8e=Ft("$ZodEnum",(e,t)=>{Co.init(e,t);const n=Xq(t.entries),i=new Set(n);e._zod.values=i,e._zod.pattern=new RegExp(`^(${n.filter(o=>_we.has(typeof o)).map(o=>typeof o=="string"?Sm(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{const r=o.value;return i.has(r)||o.issues.push({code:"invalid_value",values:n,input:r,inst:e}),o}}),m8e=Ft("$ZodLiteral",(e,t)=>{if(Co.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(i=>typeof i=="string"?Sm(i):i?Sm(i.toString()):String(i)).join("|")})$`),e._zod.parse=(i,o)=>{const s=i.value;return n.has(s)||i.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),i}}),g8e=Ft("$ZodTransform",(e,t)=>{Co.init(e,t),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new Yq(e.constructor.name);const o=t.transform(n.value,n);if(i.async)return(o instanceof Promise?o:Promise.resolve(o)).then(r=>(n.value=r,n));if(o instanceof Promise)throw new cm;return n.value=o,n}});function sD(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const vU=Ft("$ZodOptional",(e,t)=>{Co.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Di(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Di(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${iS(n.source)})?$`):void 0}),e._zod.parse=(n,i)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(s=>sD(s,n.value)):sD(o,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,i)}}),v8e=Ft("$ZodExactOptional",(e,t)=>{vU.init(e,t),Di(e._zod,"values",()=>t.innerType._zod.values),Di(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,i)=>t.innerType._zod.run(n,i)}),y8e=Ft("$ZodNullable",(e,t)=>{Co.init(e,t),Di(e._zod,"optin",()=>t.innerType._zod.optin),Di(e._zod,"optout",()=>t.innerType._zod.optout),Di(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${iS(n.source)}|null)$`):void 0}),Di(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,i)=>n.value===null?n:t.innerType._zod.run(n,i)}),k8e=Ft("$ZodDefault",(e,t)=>{Co.init(e,t),e._zod.optin="optional",Di(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(s=>rD(s,t)):rD(o,t)}});function rD(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const b8e=Ft("$ZodPrefault",(e,t)=>{Co.init(e,t),e._zod.optin="optional",Di(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>(i.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,i))}),w8e=Ft("$ZodNonOptional",(e,t)=>{Co.init(e,t),Di(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(i=>i!==void 0)):void 0}),e._zod.parse=(n,i)=>{const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(s=>lD(s,e)):lD(o,e)}});function lD(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const C8e=Ft("$ZodCatch",(e,t)=>{Co.init(e,t),Di(e._zod,"optin",()=>t.innerType._zod.optin),Di(e._zod,"optout",()=>t.innerType._zod.optout),Di(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(s=>(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(r=>Lf(r,i,Ef()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(s=>Lf(s,i,Ef()))},input:n.value}),n.issues=[]),n)}}),A8e=Ft("$ZodPipe",(e,t)=>{Co.init(e,t),Di(e._zod,"values",()=>t.in._zod.values),Di(e._zod,"optin",()=>t.in._zod.optin),Di(e._zod,"optout",()=>t.out._zod.optout),Di(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,i)=>{if(i.direction==="backward"){const s=t.out._zod.run(n,i);return s instanceof Promise?s.then(r=>Uy(r,t.in,i)):Uy(s,t.in,i)}const o=t.in._zod.run(n,i);return o instanceof Promise?o.then(s=>Uy(s,t.out,i)):Uy(o,t.out,i)}});function Uy(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const x8e=Ft("$ZodReadonly",(e,t)=>{Co.init(e,t),Di(e._zod,"propValues",()=>t.innerType._zod.propValues),Di(e._zod,"values",()=>t.innerType._zod.values),Di(e._zod,"optin",()=>t.innerType?._zod?.optin),Di(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(aD):aD(o)}});function aD(e){return e.value=Object.freeze(e.value),e}const S8e=Ft("$ZodCustom",(e,t)=>{Pl.init(e,t),Co.init(e,t),e._zod.parse=(n,i)=>n,e._zod.check=n=>{const i=n.value,o=t.fn(i);if(o instanceof Promise)return o.then(s=>uD(s,n,i,e));uD(o,n,i,e)}});function uD(e,t,n,i){if(!e){const o={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(o.params=i._zod.def.params),t.issues.push($v(o))}}var cD;class _8e{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const i=n[0];return this._map.set(t,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const i={...this.get(n)??{}};delete i.id;const o={...i,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function I8e(){return new _8e}(cD=globalThis).__zod_globalRegistry??(cD.__zod_globalRegistry=I8e());const h0=globalThis.__zod_globalRegistry;function M8e(e,t){return new e({type:"string",..._n(t)})}function T8e(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,..._n(t)})}function dD(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,..._n(t)})}function E8e(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,..._n(t)})}function L8e(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",..._n(t)})}function N8e(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",..._n(t)})}function F8e(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",..._n(t)})}function D8e(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,..._n(t)})}function R8e(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,..._n(t)})}function O8e(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,..._n(t)})}function P8e(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,..._n(t)})}function B8e(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,..._n(t)})}function $8e(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,..._n(t)})}function z8e(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,..._n(t)})}function j8e(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,..._n(t)})}function H8e(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,..._n(t)})}function W8e(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,..._n(t)})}function q8e(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,..._n(t)})}function U8e(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,..._n(t)})}function V8e(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,..._n(t)})}function K8e(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,..._n(t)})}function Z8e(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,..._n(t)})}function G8e(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,..._n(t)})}function Q8e(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,..._n(t)})}function Y8e(e,t){return new e({type:"string",format:"date",check:"string_format",..._n(t)})}function J8e(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,..._n(t)})}function X8e(e,t){return new e({type:"string",format:"duration",check:"string_format",..._n(t)})}function e5e(e,t){return new e({type:"number",checks:[],..._n(t)})}function t5e(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",..._n(t)})}function n5e(e,t){return new e({type:"boolean",..._n(t)})}function i5e(e){return new e({type:"unknown"})}function o5e(e,t){return new e({type:"never",..._n(t)})}function fD(e,t){return new cU({check:"less_than",..._n(t),value:e,inclusive:!1})}function L8(e,t){return new cU({check:"less_than",..._n(t),value:e,inclusive:!0})}function hD(e,t){return new dU({check:"greater_than",..._n(t),value:e,inclusive:!1})}function N8(e,t){return new dU({check:"greater_than",..._n(t),value:e,inclusive:!0})}function pD(e,t){return new k3e({check:"multiple_of",..._n(t),value:e})}function yU(e,t){return new w3e({check:"max_length",..._n(t),maximum:e})}function xb(e,t){return new C3e({check:"min_length",..._n(t),minimum:e})}function kU(e,t){return new A3e({check:"length_equals",..._n(t),length:e})}function s5e(e,t){return new x3e({check:"string_format",format:"regex",..._n(t),pattern:e})}function r5e(e){return new S3e({check:"string_format",format:"lowercase",..._n(e)})}function l5e(e){return new _3e({check:"string_format",format:"uppercase",..._n(e)})}function a5e(e,t){return new I3e({check:"string_format",format:"includes",..._n(t),includes:e})}function u5e(e,t){return new M3e({check:"string_format",format:"starts_with",..._n(t),prefix:e})}function c5e(e,t){return new T3e({check:"string_format",format:"ends_with",..._n(t),suffix:e})}function Jm(e){return new E3e({check:"overwrite",tx:e})}function d5e(e){return Jm(t=>t.normalize(e))}function f5e(){return Jm(e=>e.trim())}function h5e(){return Jm(e=>e.toLowerCase())}function p5e(){return Jm(e=>e.toUpperCase())}function m5e(){return Jm(e=>xwe(e))}function g5e(e,t,n){return new e({type:"array",element:t,..._n(n)})}function v5e(e,t,n){return new e({type:"custom",check:"custom",fn:t,..._n(n)})}function y5e(e){const t=k5e(n=>(n.addIssue=i=>{if(typeof i=="string")n.issues.push($v(i,n.value,t._zod.def));else{const o=i;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),n.issues.push($v(o))}},e(n.value,n)));return t}function k5e(e,t){const n=new Pl({check:"custom",..._n(t)});return n._zod.check=e,n}function bU(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??h0,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function ps(e,t,n={path:[],schemaPath:[]}){var i;const o=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;const r={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,r);const l=e._zod.toJSONSchema?.();if(l)r.schema=l;else{const c={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,r.schema,c);else{const f=r.schema,h=t.processors[o.type];if(!h)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);h(e,t,f,c)}const d=e._zod.parent;d&&(r.ref||(r.ref=d),ps(d,t,c),t.seen.get(d).isParent=!0)}const a=t.metadataRegistry.get(e);return a&&Object.assign(r.schema,a),t.io==="input"&&Hr(e)&&(delete r.schema.examples,delete r.schema.default),t.io==="input"&&r.schema._prefault&&((i=r.schema).default??(i.default=r.schema._prefault)),delete r.schema._prefault,t.seen.get(e).schema}function wU(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=new Map;for(const r of e.seen.entries()){const l=e.metadataRegistry.get(r[0])?.id;if(l){const a=i.get(l);if(a&&a!==r[0])throw new Error(`Duplicate schema id "${l}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(l,r[0])}}const o=r=>{const l=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const d=e.external.registry.get(r[0])?.id,f=e.external.uri??(m=>m);if(d)return{ref:f(d)};const h=r[1].defId??r[1].schema.id??`schema${e.counter++}`;return r[1].defId=h,{defId:h,ref:`${f("__shared")}#/${l}/${h}`}}if(r[1]===n)return{ref:"#"};const u=`#/${l}/`,c=r[1].schema.id??`__schema${e.counter++}`;return{defId:c,ref:u+c}},s=r=>{if(r[1].schema.$ref)return;const l=r[1],{ref:a,defId:u}=o(r);l.def={...l.schema},u&&(l.defId=u);const c=l.schema;for(const d in c)delete c[d];c.$ref=a};if(e.cycles==="throw")for(const r of e.seen.entries()){const l=r[1];if(l.cycle)throw new Error(`Cycle detected: #/${l.cycle?.join("/")}/ + +Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const r of e.seen.entries()){const l=r[1];if(t===r[0]){s(r);continue}if(e.external){const u=e.external.registry.get(r[0])?.id;if(t!==r[0]&&u){s(r);continue}}if(e.metadataRegistry.get(r[0])?.id){s(r);continue}if(l.cycle){s(r);continue}if(l.count>1&&e.reused==="ref"){s(r);continue}}}function CU(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=r=>{const l=e.seen.get(r);if(l.ref===null)return;const a=l.def??l.schema,u={...a},c=l.ref;if(l.ref=null,c){i(c);const f=e.seen.get(c),h=f.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(a.allOf=a.allOf??[],a.allOf.push(h)):Object.assign(a,h),Object.assign(a,u),r._zod.parent===c)for(const g in a)g==="$ref"||g==="allOf"||g in u||delete a[g];if(h.$ref&&f.def)for(const g in a)g==="$ref"||g==="allOf"||g in f.def&&JSON.stringify(a[g])===JSON.stringify(f.def[g])&&delete a[g]}const d=r._zod.parent;if(d&&d!==c){i(d);const f=e.seen.get(d);if(f?.schema.$ref&&(a.$ref=f.schema.$ref,f.def))for(const h in a)h==="$ref"||h==="allOf"||h in f.def&&JSON.stringify(a[h])===JSON.stringify(f.def[h])&&delete a[h]}e.override({zodSchema:r,jsonSchema:a,path:l.path??[]})};for(const r of[...e.seen.entries()].reverse())i(r[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const r=e.external.registry.get(t)?.id;if(!r)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(r)}Object.assign(o,n.def??n.schema);const s=e.external?.defs??{};for(const r of e.seen.entries()){const l=r[1];l.def&&l.defId&&(s[l.defId]=l.def)}e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?o.$defs=s:o.definitions=s);try{const r=JSON.parse(JSON.stringify(o));return Object.defineProperty(r,"~standard",{value:{...t["~standard"],jsonSchema:{input:Sb(t,"input",e.processors),output:Sb(t,"output",e.processors)}},enumerable:!1,writable:!1}),r}catch{throw new Error("Error converting schema to JSON.")}}function Hr(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const i=e._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return Hr(i.element,n);if(i.type==="set")return Hr(i.valueType,n);if(i.type==="lazy")return Hr(i.getter(),n);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return Hr(i.innerType,n);if(i.type==="intersection")return Hr(i.left,n)||Hr(i.right,n);if(i.type==="record"||i.type==="map")return Hr(i.keyType,n)||Hr(i.valueType,n);if(i.type==="pipe")return Hr(i.in,n)||Hr(i.out,n);if(i.type==="object"){for(const o in i.shape)if(Hr(i.shape[o],n))return!0;return!1}if(i.type==="union"){for(const o of i.options)if(Hr(o,n))return!0;return!1}if(i.type==="tuple"){for(const o of i.items)if(Hr(o,n))return!0;return!!(i.rest&&Hr(i.rest,n))}return!1}const b5e=(e,t={})=>n=>{const i=bU({...n,processors:t});return ps(e,i),wU(i,e),CU(i,e)},Sb=(e,t,n={})=>i=>{const{libraryOptions:o,target:s}=i??{},r=bU({...o??{},target:s,io:t,processors:n});return ps(e,r),wU(r,e),CU(r,e)},w5e={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},C5e=(e,t,n,i)=>{const o=n;o.type="string";const{minimum:s,maximum:r,format:l,patterns:a,contentEncoding:u}=e._zod.bag;if(typeof s=="number"&&(o.minLength=s),typeof r=="number"&&(o.maxLength=r),l&&(o.format=w5e[l]??l,o.format===""&&delete o.format,l==="time"&&delete o.format),u&&(o.contentEncoding=u),a&&a.size>0){const c=[...a];c.length===1?o.pattern=c[0].source:c.length>1&&(o.allOf=[...c.map(d=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},A5e=(e,t,n,i)=>{const o=n,{minimum:s,maximum:r,format:l,multipleOf:a,exclusiveMaximum:u,exclusiveMinimum:c}=e._zod.bag;typeof l=="string"&&l.includes("int")?o.type="integer":o.type="number",typeof c=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.minimum=c,o.exclusiveMinimum=!0):o.exclusiveMinimum=c),typeof s=="number"&&(o.minimum=s,typeof c=="number"&&t.target!=="draft-04"&&(c>=s?delete o.minimum:delete o.exclusiveMinimum)),typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.maximum=u,o.exclusiveMaximum=!0):o.exclusiveMaximum=u),typeof r=="number"&&(o.maximum=r,typeof u=="number"&&t.target!=="draft-04"&&(u<=r?delete o.maximum:delete o.exclusiveMaximum)),typeof a=="number"&&(o.multipleOf=a)},x5e=(e,t,n,i)=>{n.type="boolean"},S5e=(e,t,n,i)=>{n.not={}},_5e=(e,t,n,i)=>{},I5e=(e,t,n,i)=>{const o=e._zod.def,s=Xq(o.entries);s.every(r=>typeof r=="number")&&(n.type="number"),s.every(r=>typeof r=="string")&&(n.type="string"),n.enum=s},M5e=(e,t,n,i)=>{const o=e._zod.def,s=[];for(const r of o.values)if(r===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof r=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(r))}else s.push(r);if(s.length!==0)if(s.length===1){const r=s[0];n.type=r===null?"null":typeof r,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[r]:n.const=r}else s.every(r=>typeof r=="number")&&(n.type="number"),s.every(r=>typeof r=="string")&&(n.type="string"),s.every(r=>typeof r=="boolean")&&(n.type="boolean"),s.every(r=>r===null)&&(n.type="null"),n.enum=s},T5e=(e,t,n,i)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},E5e=(e,t,n,i)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},L5e=(e,t,n,i)=>{const o=n,s=e._zod.def,{minimum:r,maximum:l}=e._zod.bag;typeof r=="number"&&(o.minItems=r),typeof l=="number"&&(o.maxItems=l),o.type="array",o.items=ps(s.element,t,{...i,path:[...i.path,"items"]})},N5e=(e,t,n,i)=>{const o=n,s=e._zod.def;o.type="object",o.properties={};const r=s.shape;for(const u in r)o.properties[u]=ps(r[u],t,{...i,path:[...i.path,"properties",u]});const l=new Set(Object.keys(r)),a=new Set([...l].filter(u=>{const c=s.shape[u]._zod;return t.io==="input"?c.optin===void 0:c.optout===void 0}));a.size>0&&(o.required=Array.from(a)),s.catchall?._zod.def.type==="never"?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=ps(s.catchall,t,{...i,path:[...i.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},F5e=(e,t,n,i)=>{const o=e._zod.def,s=o.inclusive===!1,r=o.options.map((l,a)=>ps(l,t,{...i,path:[...i.path,s?"oneOf":"anyOf",a]}));s?n.oneOf=r:n.anyOf=r},D5e=(e,t,n,i)=>{const o=e._zod.def,s=ps(o.left,t,{...i,path:[...i.path,"allOf",0]}),r=ps(o.right,t,{...i,path:[...i.path,"allOf",1]}),l=u=>"allOf"in u&&Object.keys(u).length===1,a=[...l(s)?s.allOf:[s],...l(r)?r.allOf:[r]];n.allOf=a},R5e=(e,t,n,i)=>{const o=n,s=e._zod.def;o.type="object";const r=s.keyType,a=r._zod.bag?.patterns;if(s.mode==="loose"&&a&&a.size>0){const c=ps(s.valueType,t,{...i,path:[...i.path,"patternProperties","*"]});o.patternProperties={};for(const d of a)o.patternProperties[d.source]=c}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(o.propertyNames=ps(s.keyType,t,{...i,path:[...i.path,"propertyNames"]})),o.additionalProperties=ps(s.valueType,t,{...i,path:[...i.path,"additionalProperties"]});const u=r._zod.values;if(u){const c=[...u].filter(d=>typeof d=="string"||typeof d=="number");c.length>0&&(o.required=c)}},O5e=(e,t,n,i)=>{const o=e._zod.def,s=ps(o.innerType,t,i),r=t.seen.get(e);t.target==="openapi-3.0"?(r.ref=o.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]},P5e=(e,t,n,i)=>{const o=e._zod.def;ps(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType},B5e=(e,t,n,i)=>{const o=e._zod.def;ps(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},$5e=(e,t,n,i)=>{const o=e._zod.def;ps(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},z5e=(e,t,n,i)=>{const o=e._zod.def;ps(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType;let r;try{r=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=r},j5e=(e,t,n,i)=>{const o=e._zod.def,s=t.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;ps(s,t,i);const r=t.seen.get(e);r.ref=s},H5e=(e,t,n,i)=>{const o=e._zod.def;ps(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType,n.readOnly=!0},AU=(e,t,n,i)=>{const o=e._zod.def;ps(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType},W5e=Ft("ZodISODateTime",(e,t)=>{q3e.init(e,t),xo.init(e,t)});function q5e(e){return Q8e(W5e,e)}const U5e=Ft("ZodISODate",(e,t)=>{U3e.init(e,t),xo.init(e,t)});function V5e(e){return Y8e(U5e,e)}const K5e=Ft("ZodISOTime",(e,t)=>{V3e.init(e,t),xo.init(e,t)});function Z5e(e){return J8e(K5e,e)}const G5e=Ft("ZodISODuration",(e,t)=>{K3e.init(e,t),xo.init(e,t)});function Q5e(e){return X8e(G5e,e)}const Y5e=(e,t)=>{iU.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>Pwe(e,n)},flatten:{value:n=>Owe(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,QA,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,QA,2)}},isEmpty:{get(){return e.issues.length===0}}})},Ka=Ft("ZodError",Y5e,{Parent:Error}),J5e=sS(Ka),X5e=rS(Ka),eCe=X4(Ka),tCe=ew(Ka),nCe=zwe(Ka),iCe=jwe(Ka),oCe=Hwe(Ka),sCe=Wwe(Ka),rCe=qwe(Ka),lCe=Uwe(Ka),aCe=Vwe(Ka),uCe=Kwe(Ka),Ao=Ft("ZodType",(e,t)=>(Co.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Sb(e,"input"),output:Sb(e,"output")}}),e.toJSONSchema=b5e(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Uf(t,{checks:[...t.checks??[],...n.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0}),e.with=e.check,e.clone=(n,i)=>Vf(e,n,i),e.brand=()=>e,e.register=((n,i)=>(n.add(e,i),e)),e.parse=(n,i)=>J5e(e,n,i,{callee:e.parse}),e.safeParse=(n,i)=>eCe(e,n,i),e.parseAsync=async(n,i)=>X5e(e,n,i,{callee:e.parseAsync}),e.safeParseAsync=async(n,i)=>tCe(e,n,i),e.spa=e.safeParseAsync,e.encode=(n,i)=>nCe(e,n,i),e.decode=(n,i)=>iCe(e,n,i),e.encodeAsync=async(n,i)=>oCe(e,n,i),e.decodeAsync=async(n,i)=>sCe(e,n,i),e.safeEncode=(n,i)=>rCe(e,n,i),e.safeDecode=(n,i)=>lCe(e,n,i),e.safeEncodeAsync=async(n,i)=>aCe(e,n,i),e.safeDecodeAsync=async(n,i)=>uCe(e,n,i),e.refine=(n,i)=>e.check(nAe(n,i)),e.superRefine=n=>e.check(iAe(n)),e.overwrite=n=>e.check(Jm(n)),e.optional=()=>vD(e),e.exactOptional=()=>WCe(e),e.nullable=()=>yD(e),e.nullish=()=>vD(yD(e)),e.nonoptional=n=>GCe(e,n),e.array=()=>pi(e),e.or=n=>DCe([e,n]),e.and=n=>PCe(e,n),e.transform=n=>kD(e,jCe(n)),e.default=n=>VCe(e,n),e.prefault=n=>ZCe(e,n),e.catch=n=>YCe(e,n),e.pipe=n=>kD(e,n),e.readonly=()=>eAe(e),e.describe=n=>{const i=e.clone();return h0.add(i,{description:n}),i},Object.defineProperty(e,"description",{get(){return h0.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return h0.get(e);const i=e.clone();return h0.add(i,n[0]),i},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),xU=Ft("_ZodString",(e,t)=>{lS.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(i,o,s)=>C5e(e,i,o);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...i)=>e.check(s5e(...i)),e.includes=(...i)=>e.check(a5e(...i)),e.startsWith=(...i)=>e.check(u5e(...i)),e.endsWith=(...i)=>e.check(c5e(...i)),e.min=(...i)=>e.check(xb(...i)),e.max=(...i)=>e.check(yU(...i)),e.length=(...i)=>e.check(kU(...i)),e.nonempty=(...i)=>e.check(xb(1,...i)),e.lowercase=i=>e.check(r5e(i)),e.uppercase=i=>e.check(l5e(i)),e.trim=()=>e.check(f5e()),e.normalize=(...i)=>e.check(d5e(...i)),e.toLowerCase=()=>e.check(h5e()),e.toUpperCase=()=>e.check(p5e()),e.slugify=()=>e.check(m5e())}),cCe=Ft("ZodString",(e,t)=>{lS.init(e,t),xU.init(e,t),e.email=n=>e.check(T8e(dCe,n)),e.url=n=>e.check(D8e(fCe,n)),e.jwt=n=>e.check(G8e(ICe,n)),e.emoji=n=>e.check(R8e(hCe,n)),e.guid=n=>e.check(dD(mD,n)),e.uuid=n=>e.check(E8e(Vy,n)),e.uuidv4=n=>e.check(L8e(Vy,n)),e.uuidv6=n=>e.check(N8e(Vy,n)),e.uuidv7=n=>e.check(F8e(Vy,n)),e.nanoid=n=>e.check(O8e(pCe,n)),e.guid=n=>e.check(dD(mD,n)),e.cuid=n=>e.check(P8e(mCe,n)),e.cuid2=n=>e.check(B8e(gCe,n)),e.ulid=n=>e.check($8e(vCe,n)),e.base64=n=>e.check(V8e(xCe,n)),e.base64url=n=>e.check(K8e(SCe,n)),e.xid=n=>e.check(z8e(yCe,n)),e.ksuid=n=>e.check(j8e(kCe,n)),e.ipv4=n=>e.check(H8e(bCe,n)),e.ipv6=n=>e.check(W8e(wCe,n)),e.cidrv4=n=>e.check(q8e(CCe,n)),e.cidrv6=n=>e.check(U8e(ACe,n)),e.e164=n=>e.check(Z8e(_Ce,n)),e.datetime=n=>e.check(q5e(n)),e.date=n=>e.check(V5e(n)),e.time=n=>e.check(Z5e(n)),e.duration=n=>e.check(Q5e(n))});function zt(e){return M8e(cCe,e)}const xo=Ft("ZodStringFormat",(e,t)=>{go.init(e,t),xU.init(e,t)}),dCe=Ft("ZodEmail",(e,t)=>{R3e.init(e,t),xo.init(e,t)}),mD=Ft("ZodGUID",(e,t)=>{F3e.init(e,t),xo.init(e,t)}),Vy=Ft("ZodUUID",(e,t)=>{D3e.init(e,t),xo.init(e,t)}),fCe=Ft("ZodURL",(e,t)=>{O3e.init(e,t),xo.init(e,t)}),hCe=Ft("ZodEmoji",(e,t)=>{P3e.init(e,t),xo.init(e,t)}),pCe=Ft("ZodNanoID",(e,t)=>{B3e.init(e,t),xo.init(e,t)}),mCe=Ft("ZodCUID",(e,t)=>{$3e.init(e,t),xo.init(e,t)}),gCe=Ft("ZodCUID2",(e,t)=>{z3e.init(e,t),xo.init(e,t)}),vCe=Ft("ZodULID",(e,t)=>{j3e.init(e,t),xo.init(e,t)}),yCe=Ft("ZodXID",(e,t)=>{H3e.init(e,t),xo.init(e,t)}),kCe=Ft("ZodKSUID",(e,t)=>{W3e.init(e,t),xo.init(e,t)}),bCe=Ft("ZodIPv4",(e,t)=>{Z3e.init(e,t),xo.init(e,t)}),wCe=Ft("ZodIPv6",(e,t)=>{G3e.init(e,t),xo.init(e,t)}),CCe=Ft("ZodCIDRv4",(e,t)=>{Q3e.init(e,t),xo.init(e,t)}),ACe=Ft("ZodCIDRv6",(e,t)=>{Y3e.init(e,t),xo.init(e,t)}),xCe=Ft("ZodBase64",(e,t)=>{J3e.init(e,t),xo.init(e,t)}),SCe=Ft("ZodBase64URL",(e,t)=>{e8e.init(e,t),xo.init(e,t)}),_Ce=Ft("ZodE164",(e,t)=>{t8e.init(e,t),xo.init(e,t)}),ICe=Ft("ZodJWT",(e,t)=>{i8e.init(e,t),xo.init(e,t)}),SU=Ft("ZodNumber",(e,t)=>{hU.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(i,o,s)=>A5e(e,i,o),e.gt=(i,o)=>e.check(hD(i,o)),e.gte=(i,o)=>e.check(N8(i,o)),e.min=(i,o)=>e.check(N8(i,o)),e.lt=(i,o)=>e.check(fD(i,o)),e.lte=(i,o)=>e.check(L8(i,o)),e.max=(i,o)=>e.check(L8(i,o)),e.int=i=>e.check(gD(i)),e.safe=i=>e.check(gD(i)),e.positive=i=>e.check(hD(0,i)),e.nonnegative=i=>e.check(N8(0,i)),e.negative=i=>e.check(fD(0,i)),e.nonpositive=i=>e.check(L8(0,i)),e.multipleOf=(i,o)=>e.check(pD(i,o)),e.step=(i,o)=>e.check(pD(i,o)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function kn(e){return e5e(SU,e)}const MCe=Ft("ZodNumberFormat",(e,t)=>{o8e.init(e,t),SU.init(e,t)});function gD(e){return t5e(MCe,e)}const TCe=Ft("ZodBoolean",(e,t)=>{s8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>x5e(e,n,i)});function y2(e){return n5e(TCe,e)}const ECe=Ft("ZodUnknown",(e,t)=>{r8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>_5e()});function Ts(){return i5e(ECe)}const LCe=Ft("ZodNever",(e,t)=>{l8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>S5e(e,n,i)});function _U(e){return o5e(LCe,e)}const NCe=Ft("ZodArray",(e,t)=>{a8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>L5e(e,n,i,o),e.element=t.element,e.min=(n,i)=>e.check(xb(n,i)),e.nonempty=n=>e.check(xb(1,n)),e.max=(n,i)=>e.check(yU(n,i)),e.length=(n,i)=>e.check(kU(n,i)),e.unwrap=()=>e.element});function pi(e,t){return g5e(NCe,e,t)}const FCe=Ft("ZodObject",(e,t)=>{c8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>N5e(e,n,i,o),Di(e,"shape",()=>t.shape),e.keyof=()=>wo(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Ts()}),e.loose=()=>e.clone({...e._zod.def,catchall:Ts()}),e.strict=()=>e.clone({...e._zod.def,catchall:_U()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>Lwe(e,n),e.safeExtend=n=>Nwe(e,n),e.merge=n=>Fwe(e,n),e.pick=n=>Twe(e,n),e.omit=n=>Ewe(e,n),e.partial=(...n)=>Dwe(MU,e,n[0]),e.required=(...n)=>Rwe(TU,e,n[0])});function Gt(e,t){const n={type:"object",shape:e??{},..._n(t)};return new FCe(n)}const IU=Ft("ZodUnion",(e,t)=>{gU.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>F5e(e,n,i,o),e.options=t.options});function DCe(e,t){return new IU({type:"union",options:e,..._n(t)})}const RCe=Ft("ZodDiscriminatedUnion",(e,t)=>{IU.init(e,t),d8e.init(e,t)});function fd(e,t,n){return new RCe({type:"union",options:t,discriminator:e,..._n(n)})}const OCe=Ft("ZodIntersection",(e,t)=>{f8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>D5e(e,n,i,o)});function PCe(e,t){return new OCe({type:"intersection",left:e,right:t})}const BCe=Ft("ZodRecord",(e,t)=>{h8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>R5e(e,n,i,o),e.keyType=t.keyType,e.valueType=t.valueType});function aS(e,t,n){return new BCe({type:"record",keyType:e,valueType:t,..._n(n)})}const JA=Ft("ZodEnum",(e,t)=>{p8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(i,o,s)=>I5e(e,i,o),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(i,o)=>{const s={};for(const r of i)if(n.has(r))s[r]=t.entries[r];else throw new Error(`Key ${r} not found in enum`);return new JA({...t,checks:[],..._n(o),entries:s})},e.exclude=(i,o)=>{const s={...t.entries};for(const r of i)if(n.has(r))delete s[r];else throw new Error(`Key ${r} not found in enum`);return new JA({...t,checks:[],..._n(o),entries:s})}});function wo(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new JA({type:"enum",entries:n,..._n(t)})}const $Ce=Ft("ZodLiteral",(e,t)=>{m8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>M5e(e,n,i),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function zn(e,t){return new $Ce({type:"literal",values:Array.isArray(e)?e:[e],..._n(t)})}const zCe=Ft("ZodTransform",(e,t)=>{g8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>E5e(e,n),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new Yq(e.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push($v(s,n.value,t));else{const r=s;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=e),n.issues.push($v(r))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(s=>(n.value=s,n)):(n.value=o,n)}});function jCe(e){return new zCe({type:"transform",transform:e})}const MU=Ft("ZodOptional",(e,t)=>{vU.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>AU(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function vD(e){return new MU({type:"optional",innerType:e})}const HCe=Ft("ZodExactOptional",(e,t)=>{v8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>AU(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function WCe(e){return new HCe({type:"optional",innerType:e})}const qCe=Ft("ZodNullable",(e,t)=>{y8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>O5e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function yD(e){return new qCe({type:"nullable",innerType:e})}const UCe=Ft("ZodDefault",(e,t)=>{k8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>B5e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function VCe(e,t){return new UCe({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():tU(t)}})}const KCe=Ft("ZodPrefault",(e,t)=>{b8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>$5e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function ZCe(e,t){return new KCe({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():tU(t)}})}const TU=Ft("ZodNonOptional",(e,t)=>{w8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>P5e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function GCe(e,t){return new TU({type:"nonoptional",innerType:e,..._n(t)})}const QCe=Ft("ZodCatch",(e,t)=>{C8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>z5e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function YCe(e,t){return new QCe({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const JCe=Ft("ZodPipe",(e,t)=>{A8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>j5e(e,n,i,o),e.in=t.in,e.out=t.out});function kD(e,t){return new JCe({type:"pipe",in:e,out:t})}const XCe=Ft("ZodReadonly",(e,t)=>{x8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>H5e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function eAe(e){return new XCe({type:"readonly",innerType:e})}const tAe=Ft("ZodCustom",(e,t)=>{S8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>T5e(e,n)});function nAe(e,t={}){return v5e(tAe,e,t)}function iAe(e){return y5e(e)}const kp=zt().min(1),uS=zt().min(1),k2=zt().min(1),bp=zt().min(1),ga=zt().min(1),oAe=/^[A-Za-z0-9._-]{1,128}$/;function sAe(e){return oAe.test(e)&&e!=="."&&e!==".."}const EU=fd("kind",[Gt({kind:zn("user"),payload:Ts().optional()}),Gt({kind:zn("cron"),taskId:bp.optional(),payload:Ts().optional()}),Gt({kind:zn("task"),taskId:bp,payload:Ts().optional()}),Gt({kind:zn("hook"),payload:Ts().optional()}),Gt({kind:zn("compaction"),payload:Ts().optional()}),Gt({kind:zn("side"),payload:Ts().optional()}),Gt({kind:zn("other"),payload:Ts().optional()})]),rAe=Gt({inputTokens:kn().optional(),outputTokens:kn().optional(),cachedTokens:kn().optional(),cost:kn().optional()}),J0=Gt({inputOther:kn(),output:kn(),inputCacheRead:kn(),inputCacheCreation:kn()}),lAe=Gt({llmFirstTokenLatencyMs:kn().optional(),llmStreamDurationMs:kn().optional(),llmRequestBuildMs:kn().optional(),llmServerFirstTokenMs:kn().optional(),llmServerDecodeMs:kn().optional(),llmClientConsumeMs:kn().optional()}),aAe=Gt({failedAttempt:kn(),nextAttempt:kn(),maxAttempts:kn(),delayMs:kn(),errorName:zt(),errorMessage:zt(),statusCode:kn().optional()}),LU=wo(["queued","running","completed","failed","cancelled"]),uAe=wo(["running","completed","interrupted","failed"]),cAe=Gt({skillName:zt(),skillArgs:zt().optional()}),dAe=Gt({kind:zn("user"),skillActivations:pi(cAe).optional()}),bD={kind:zn("text"),frameId:k2,text:zt(),attachmentIds:pi(zt()).optional(),taskId:bp.optional(),promptIds:pi(zt()).optional()},fAe=fd("role",[Gt({...bD,role:zn("assistant"),origin:_U().optional()}),Gt({...bD,role:zn("user"),origin:dAe.optional()})]),hAe=Gt({kind:zn("thinking"),frameId:k2,text:zt()}),pAe=Gt({agentId:ga,role:wo(["child","member"]).optional()}),mAe=Gt({kind:wo(["stdout","stderr","progress","status","custom"]),text:zt().optional(),percent:kn().optional(),customKind:zt().optional(),customData:Ts().optional()}),gAe=Gt({kind:zn("tool"),frameId:k2,toolCallId:zt(),name:zt(),view:zt().optional(),state:wo(["running","done","error"]),input:Ts().optional(),output:Ts().optional(),display:Ts().optional(),error:zt().optional(),inputText:zt().optional(),progress:mAe.optional(),taskId:bp.optional(),approvalId:zt().optional(),todoId:zt().optional(),agentRefs:pi(pAe).optional()}),cS=Gt({interactionId:zt(),interactionKind:wo(["approval","question"]),toolCallId:zt().optional(),state:wo(["pending","approved","rejected","cancelled","answered","dismissed"]),request:Ts().optional(),response:Ts().optional()}),vAe=Gt({kind:zn("notice"),frameId:k2,level:wo(["error","warning","info"]),source:zt().optional(),message:zt(),detail:Ts().optional()}),NU=fd("kind",[fAe,hAe,gAe,vAe]),FU=Gt({kind:zn("step"),stepId:uS,turnId:kp,ordinal:kn().int(),state:uAe,frames:pi(NU),startedAt:zt().optional(),endedAt:zt().optional(),usage:J0.optional(),finishReason:zt().optional(),timing:lAe.optional(),retry:aAe.optional(),endReason:zt().optional(),endMessage:zt().optional()}),DU=Gt({kind:zn("turn"),turnId:kp,triggerPromptId:zt().min(1).optional(),ordinal:kn().int(),state:LU,origin:EU,prompt:zt().optional(),attachmentIds:pi(zt()).optional(),steps:pi(FU),startedAt:zt().optional(),endedAt:zt().optional(),usage:rAe.optional(),durationMs:kn().optional(),error:zt().optional()}),RU=Gt({kind:zn("marker"),markerId:zt(),marker:zt(),payload:Ts().optional(),at:zt().optional()}),OU=Gt({kind:zn("taskref"),refId:zt(),taskId:bp,at:zt().optional()}),PU=fd("kind",[DU,RU,OU]),dS=Gt({taskId:bp,kind:wo(["shell","subagent","tool","other"]),state:wo(["running","completed","failed","timed_out","killed","lost"]),detached:y2(),description:zt().optional(),agentId:ga.optional(),outputTail:zt(),startedAt:zt().optional(),endedAt:zt().optional(),resultSummary:zt().optional(),error:zt().optional(),stateReason:zt().optional(),usage:J0.optional(),model:zt().optional(),thinkingEffort:zt().optional()}),BU=Gt({objective:zt(),status:wo(["active","paused","blocked","complete"]),completionCriterion:zt().optional(),budgetUsed:kn().optional(),budgetLimit:kn().optional()}),yAe=Gt({plan:Gt({reviewPath:zt().optional(),version:kn().optional()}).optional(),swarm:Gt({trigger:zt().optional()}).optional(),tower:Gt({}).optional()}),kAe=Gt({plan:Gt({reviewPath:zt().optional(),version:kn().optional()}).nullable().optional(),swarm:Gt({trigger:zt().optional()}).nullable().optional(),tower:Gt({}).nullable().optional()}),bAe=fd("kind",[Gt({kind:zn("idle")}),Gt({kind:zn("running"),turnId:kn(),step:kn(),stepId:zt(),since:kn()}),Gt({kind:zn("streaming"),turnId:kn(),step:kn(),stepId:zt(),stream:wo(["assistant","thinking","tool_call"]),toolCallId:zt().optional(),toolName:zt().optional(),since:kn()}),Gt({kind:zn("tool_call"),turnId:kn(),step:kn(),toolCallId:zt(),name:zt(),since:kn()}),Gt({kind:zn("retrying"),turnId:kn(),step:kn(),stepId:zt(),failedAttempt:kn(),nextAttempt:kn(),maxAttempts:kn(),delayMs:kn(),errorName:zt().optional(),statusCode:kn().optional(),since:kn()}),Gt({kind:zn("awaiting_approval"),turnId:kn(),step:kn().optional(),approval:Ts().optional(),since:kn()}),Gt({kind:zn("interrupted"),turnId:kn(),step:kn().optional(),reason:wo(["aborted","max_steps","error"]),message:zt().optional(),at:kn()}),Gt({kind:zn("ended"),turnId:kn(),reason:wo(["completed","cancelled","failed","blocked"]),durationMs:kn().optional(),at:kn()})]),wAe=Gt({byModel:aS(zt(),J0).optional(),currentTurn:J0.optional(),total:J0.optional()}),CAe=Gt({model:zt().optional(),thinkingEffort:zt().optional(),usage:wAe.optional(),contextTokens:kn().optional(),maxContextTokens:kn().optional(),contextUsage:kn().optional(),permission:wo(["manual","yolo","auto"]).optional(),phase:bAe.optional()}),fS=Gt({goal:BU.optional(),modes:yAe.optional(),activity:wo(["idle","turn","disposing","unknown"]).optional(),agent:CAe.optional()}),AAe=fS.extend({goal:BU.nullable().optional(),modes:kAe.optional()}),nw=Gt({attachmentId:zt(),mediaType:zt(),name:zt().optional(),size:kn().optional(),source:fd("kind",[Gt({kind:zn("url"),url:zt()}),Gt({kind:zn("file"),fileId:zt()}),Gt({kind:zn("session_media"),fileId:zt()})]).optional(),placeholder:zt().optional()}),xAe=Gt({title:zt(),status:wo(["pending","in_progress","done"])}),hS=Gt({todoId:zt(),items:pi(xAe),updatedAt:zt().optional()}),pS=Gt({promptId:zt(),status:wo(["running","queued","blocked","completed","failed","aborted"]),userMessageId:zt().optional(),content:Ts().optional(),createdAt:zt(),finishedAt:zt().optional(),steeredAt:zt().optional()}),$U=Gt({items:pi(PU),tasks:pi(dS),interactions:pi(cS).default([]),attachments:pi(nw).default([]),todos:pi(hS).default([]),prompts:pi(pS).default([]),meta:fS,hasMoreOlder:y2().optional()}),SAe=DU.omit({steps:!0}),_Ae=FU.omit({frames:!0}),IAe=fd("type",[Gt({type:zn("frame"),turnId:kp,stepId:uS,frameId:k2}),Gt({type:zn("task"),taskId:bp})]),mS=fd("op",[Gt({op:zn("reset"),agentId:ga,snapshot:$U}),Gt({op:zn("turn.upsert"),turn:SAe}),Gt({op:zn("step.upsert"),turnId:kp,step:_Ae}),Gt({op:zn("frame.upsert"),turnId:kp,stepId:uS,frame:NU}),Gt({op:zn("append"),target:IAe,offset:kn().int().nonnegative(),text:zt()}),Gt({op:zn("marker.upsert"),item:RU,beforeTurn:kn().int().optional()}),Gt({op:zn("taskref.upsert"),item:OU,beforeTurn:kn().int().optional()}),Gt({op:zn("task.upsert"),task:dS}),Gt({op:zn("interaction.upsert"),interaction:cS}),Gt({op:zn("attachment.upsert"),attachment:nw}),Gt({op:zn("todo.upsert"),todo:hS}),Gt({op:zn("prompt.upsert"),prompt:pS}),Gt({op:zn("meta.merge"),meta:AAe}),Gt({op:zn("items.remove"),ids:pi(zt())})]);Gt({agentId:ga,ops:pi(mS)});const MAe=wo(["off","turn","block","delta"]),_m=kn().int().nonnegative(),TAe=aS(zt(),MAe);Gt({session_id:zt().min(1),transcript:TAe,transcript_since:aS(zt(),_m).optional()});Gt({agent_id:ga,before_turn:zt().min(1).optional(),after_turn:zt().min(1).optional(),page_size:kn().int().min(1).max(100).optional()}).superRefine((e,t)=>{e.before_turn!==void 0&&e.after_turn!==void 0&&t.addIssue({code:"custom",message:"before_turn and after_turn are mutually exclusive",path:["before_turn"]}),sAe(e.agent_id)||t.addIssue({code:"custom",message:"agent_id must be a plain agent id (no path separators)",path:["agent_id"]})});const EAe=Gt({agentId:ga,type:wo(["main","sub","independent"]).optional(),parentAgentId:ga.optional(),label:zt().optional(),createdAt:zt().optional(),disposedAt:zt().optional()}),LAe=Gt({agent_id:ga,items:pi(PU),has_more:y2(),tasks:pi(dS),interactions:pi(cS).default([]),attachments:pi(nw).default([]),todos:pi(hS).default([]),prompts:pi(pS).default([]),meta:fS,agents:pi(EAe),pending_interactions:pi(zt()),seq:_m.optional()});Gt({agent_id:ga,batches:pi(Gt({seq:_m,ops:pi(mS)})),latest_seq:_m,complete:y2()});const NAe=Gt({turn_id:kp,ordinal:kn().int(),state:LU,origin:EU,prompt:zt(),attachment_ids:pi(zt()).optional(),started_at:zt().optional()});Gt({agents:pi(Gt({agent_id:ga,messages:pi(NAe),attachments:pi(nw).default([])}))});const FAe=Gt({state:wo(["pending","approved","rejected","cancelled"]),selected_option:zt().optional(),feedback:zt().optional()}),DAe=Gt({tool_call_id:zt(),turn_id:kp,source:wo(["interaction","display","output"]),plan:zt(),path:zt().optional(),options:pi(Gt({label:zt(),description:zt().optional()})).optional(),review:FAe.optional()});Gt({agent_id:ga,plans:pi(DAe)});const RAe=Gt({agent_id:ga,snapshot:$U,has_more_older:y2(),seq:_m.optional()}),OAe=Gt({agent_id:ga,ops:pi(mS),seq:_m.optional()}),zU=RAe.extend({type:zn("transcript.reset")}),jU=OAe.extend({type:zn("transcript.ops")});fd("type",[zU,jU]);const wD=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.call.started","tool.use","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.submitted","prompt.completed","prompt.aborted","session.meta.updated","compaction.started","compaction.completed","compaction.cancelled","goal.updated","error","warning","subagent.spawned","subagent.started","subagent.suspended","subagent.completed","subagent.failed","task.started","task.terminated","background.task.started","background.task.terminated","cron.fired"]),PAe=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"]),BAe=new Set(["server_hello","ack","ping","resync_required","error","pong"]),$Ae=new Set(["assistant.delta","thinking.delta"]);function zAe(e,t){if(BAe.has(e))return{route:"ignore"};const n=e.startsWith("event."),i=n?e.slice(6):e;return $Ae.has(i)?jAe(t)?{route:"agent",agentType:i}:{route:"protocol"}:n?PAe.has(i)?{route:"protocol"}:wD.has(i)?{route:"agent",agentType:i}:{route:"protocol"}:wD.has(i)?{route:"agent",agentType:i}:{route:"agent",agentType:i}}function jAe(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"}const HAe="kimi-code.bearer.",WAe=3e4;class CD{constructor(t){this.opts=t,this.tracer=t.tracer??eS}ws=null;connected=!1;closed=!1;subscriptions=new Map;transcriptSubscriptions=new Map;sideChannelAgents=new Map;pendingSubscriptions=[];terminalAttachments=new Map;msgSeq=0;clientHelloId=null;reconnectAttempts=0;reconnectTimer=null;heartbeatMs=3e4;lastActivityAt=0;tracer;connect(){if(this.ws!==null||this.closed)return;this.lastActivityAt=Date.now(),this.tracer.wsEvent?.({kind:"lifecycle",event:"connect",detail:{url:this.opts.wsUrl,attempt:this.reconnectAttempts}});const t=this.opts.credentialStore?.getToken(),n=t!==void 0?[`${HAe}${t}`]:void 0,i=new WebSocket(this.opts.wsUrl,n);this.ws=i,i.onopen=()=>{this.tracer.wsEvent?.({kind:"lifecycle",event:"open"})},i.onmessage=o=>{this.lastActivityAt=Date.now();try{const s=JSON.parse(String(o.data));this.tracer.wsEvent?.({kind:"in",frame:s}),this.handleFrame(s)}catch(s){this.tracer.wsEvent?.({kind:"lifecycle",event:"parse-error",detail:{error:String(s)}}),this.opts.handlers.onError(0,`Failed to parse WS frame: ${String(s)}`,!1)}},i.onerror=()=>{this.tracer.wsEvent?.({kind:"lifecycle",event:"error"}),this.opts.handlers.onError(0,"WebSocket error",!1)},i.onclose=o=>{this.tracer.wsEvent?.({kind:"lifecycle",event:"close",detail:o?{code:o.code,reason:o.reason,wasClean:o.wasClean}:void 0}),this.connected=!1,this.ws=null,this.opts.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,this.tracer.wsEvent?.({kind:"lifecycle",event:"reconnect-scheduled",detail:{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 i=this.pendingSubscriptions.findIndex(o=>o.sessionId===t);i!==-1&&this.pendingSubscriptions.splice(i,1),this.pendingSubscriptions.push({sessionId:t,cursor:{...n}})}}unsubscribe(t){this.subscriptions.delete(t);const n=this.pendingSubscriptions.findIndex(i=>i.sessionId===t);n!==-1&&this.pendingSubscriptions.splice(n,1),this.connected&&this.ws&&this.send({type:"unsubscribe",id:this.nextId(),payload:{session_ids:[t]}})}subscribeTranscript(t,n,i){let o=this.transcriptSubscriptions.get(t);o===void 0&&(o=new Map,this.transcriptSubscriptions.set(t,o)),o.set(n,i!==void 0?{sinceSeq:i}:{}),this.connected&&this.sendTranscriptSubscribe(t,n)}unsubscribeTranscript(t,n){const i=this.transcriptSubscriptions.get(t);if(i!==void 0)if(n===void 0)this.transcriptSubscriptions.delete(t);else{for(const o of n)i.delete(o);i.size===0&&this.transcriptSubscriptions.delete(t)}!this.connected||!this.ws||this.send({type:"unsubscribe_v2",id:this.nextId(),payload:{session_id:t,...n!==void 0?{agent_ids:n}:{}}})}markSideChannelAgent(t,n){if(!this.opts.mainAgentOnly)return;let i=this.sideChannelAgents.get(t);if(i===void 0&&(i=new Set,this.sideChannelAgents.set(t,i)),i.has(n))return;i.add(n);const o=this.subscriptions.get(t);this.connected&&o!==void 0&&this.sendSubscribe([t],{[t]:o})}abort(t,n){!this.connected||!this.ws||this.send({type:"abort",id:this.nextId(),payload:{session_id:t,prompt_id:n}})}terminalAttach(t,n,i){const o=Ky(t,n),s=this.terminalAttachments.get(o),r=i??s?.lastSeq??0;this.terminalAttachments.set(o,{sessionId:t,terminalId:n,lastSeq:r}),!(!this.connected||!this.ws)&&this.sendTerminalAttach(t,n,r)}terminalInput(t,n,i){!this.connected||!this.ws||this.send({type:"terminal_input",id:this.nextId(),payload:{session_id:t,terminal_id:n,data:i}})}terminalResize(t,n,i,o){!this.connected||!this.ws||this.send({type:"terminal_resize",id:this.nextId(),payload:{session_id:t,terminal_id:n,cols:i,rows:o}})}terminalDetach(t,n){this.terminalAttachments.delete(Ky(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(Ky(t,n)),!(!this.connected||!this.ws)&&this.send({type:"terminal_close",id:this.nextId(),payload:{session_id:t,terminal_id:n}})}close(){this.closed=!0,this.connected=!1,this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.ws&&(this.ws.close(1e3),this.ws=null)}health(){const t=this.ws!==null&&this.ws.readyState===WebSocket.OPEN,n=Math.max(this.heartbeatMs*2,WAe),i=this.lastActivityAt>0&&Date.now()-this.lastActivityAt>n;return{connected:this.connected,open:t,stale:i}}reconnect(){if(this.closed)return;this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null);const t=this.ws;if(t!==null){t.onopen=null,t.onmessage=null,t.onerror=null,t.onclose=null;try{t.close(1e3,"reconnect")}catch{}}const n=this.connected;this.ws=null,this.connected=!1,n&&this.opts.handlers.onConnectionState(!1),this.connect()}handleFrame(t){const n=t,i=t.type;if(i==="transcript.reset"){const o=zU.safeParse({type:i,...n.payload}),s=n.session_id;if(!o.success||typeof s!="string"){this.opts.handlers.onError(0,"Invalid transcript.reset frame",!1);return}const r=o.data;this.opts.handlers.onTranscriptReset?.(s,r.agent_id,{...r.snapshot,hasMoreOlder:r.has_more_older},r.seq);const l=this.transcriptSubscriptions.get(s)?.get(r.agent_id);l!==void 0&&r.seq!==void 0&&(l.sinceSeq=r.seq);return}if(i==="transcript.ops"){const o=jU.safeParse({type:i,...n.payload}),s=n.session_id;if(!o.success||typeof s!="string"){this.opts.handlers.onError(0,"Invalid transcript.ops frame",!1);return}const r=o.data,l=this.opts.handlers.onTranscriptOps?.(s,r.agent_id,r.ops,r.seq),a=this.transcriptSubscriptions.get(s)?.get(r.agent_id);l!==!1&&a!==void 0&&r.seq!==void 0&&(a.sinceSeq=r.seq);return}switch(i){case"server_hello":{const o=n.payload?.heartbeat_ms;typeof o=="number"&&o>0&&(this.heartbeatMs=o),this.onServerHello();break}case"ping":this.send({type:"pong",payload:{nonce:n.payload.nonce}});break;case"resync_required":{const o=n.payload.session_id,s=n.payload.epoch;this.subscriptions.set(o,{seq:n.payload.current_seq,epoch:s}),this.opts.handlers.onResync(o,n.payload.current_seq,s);break}case"error":{const o=n.session_id;typeof o=="string"&&this.opts.handlers.onRawAgentEvent?this.opts.handlers.onRawAgentEvent({type:"error",seq:n.seq,session_id:o,timestamp:n.timestamp,payload:n.payload}):this.opts.handlers.onError(n.payload.code,n.payload.msg,n.payload.fatal);break}case"ack":n.id===this.clientHelloId&&(this.clientHelloId=null,n.code===0&&this.opts.handlers.onReplayComplete?.());break;case"terminal_output":{const o=n.session_id,s=n.terminal_id,r=n.seq,l=Ky(o,s),a=this.terminalAttachments.get(l);a&&this.terminalAttachments.set(l,{...a,lastSeq:Math.max(a.lastSeq,r)});const u=typeof n.payload?.data=="string"?n.payload.data:"";this.opts.handlers.onTerminalOutput?.(o,s,u,r);break}case"terminal_exit":{const o=n.session_id,s=n.terminal_id,r=n.payload?.exit_code,l=typeof r=="number"?r:null;this.opts.handlers.onTerminalExit?.(o,s,l);break}default:{this.trackCursor(n);const o=n.type,s=zAe(o,n.payload);if(s.route==="protocol"){this.opts.handlers.onWireEvent(n);break}if(s.route==="agent"){if(this.opts.handlers.onRawAgentEvent&&typeof n.session_id=="string"){const r=n,l=n;this.opts.handlers.onRawAgentEvent({type:s.agentType,seq:r.seq,session_id:r.session_id,timestamp:r.timestamp,payload:r.payload,...l.volatile!==void 0?{volatile:l.volatile}:{},...l.offset!==void 0?{offset:l.offset}:{}})}break}break}}}onServerHello(){this.connected=!0,this.reconnectAttempts=0,this.opts.handlers.onConnectionState(!0);const t=Array.from(this.subscriptions.keys());for(const o of this.pendingSubscriptions)this.subscriptions.set(o.sessionId,o.cursor),t.includes(o.sessionId)||t.push(o.sessionId);this.pendingSubscriptions.length=0;const n={};for(const[o,s]of this.subscriptions.entries())n[o]=s;const i=this.nextId();this.clientHelloId=i,this.send({type:"client_hello",id:i,payload:{client_id:this.opts.clientId,subscriptions:t,cursors:n,...this.opts.mainAgentOnly?{agent_filter:this.rawAgentFilter(t)}:{}}});for(const o of this.transcriptSubscriptions.keys())this.sendTranscriptSubscribe(o);for(const o of this.terminalAttachments.values())this.sendTerminalAttach(o.sessionId,o.terminalId,o.lastSeq)}sendSubscribe(t,n){this.send({type:"subscribe",id:this.nextId(),payload:{session_ids:t,cursors:n,...this.opts.mainAgentOnly?{agent_filter:this.rawAgentFilter(t)}:{}}})}rawAgentFilter(t){return Object.fromEntries(t.map(n=>[n,["main",...this.sideChannelAgents.get(n)??[]]]))}sendTranscriptSubscribe(t,n){const i=this.transcriptSubscriptions.get(t);if(i===void 0||i.size===0)return;const o={},s={};for(const[r,l]of i)o[r]="delta",l.sinceSeq!==void 0&&(n===void 0||n===r)&&(s[r]=l.sinceSeq);this.send({type:"subscribe_v2",id:this.nextId(),payload:{session_id:t,transcript:o,...Object.keys(s).length>0?{transcript_since:s}:{}}})}sendTerminalAttach(t,n,i){this.send({type:"terminal_attach",id:this.nextId(),payload:{session_id:t,terminal_id:n,since_seq:i>0?i:void 0}})}trackCursor(t){if(t.volatile===!0)return;const n=t.session_id,i=t.seq;if(typeof n!="string"||typeof i!="number")return;const o=this.subscriptions.get(n);if(!o||i<=o.seq&&o.epoch!==void 0)return;const s=typeof t.epoch=="string"?t.epoch:o.epoch;this.subscriptions.set(n,{seq:Math.max(i,o.seq),epoch:s})}send(t){if(!(!this.ws||this.ws.readyState!==WebSocket.OPEN))try{this.ws.send(JSON.stringify(t)),this.tracer.wsEvent?.({kind:"out",frame:t})}catch{}}nextId(){return`c_${++this.msgSeq}`}}function Ky(e,t){return`${e}\0${t}`}async function qAe(e,t,n){const i=await e.get(`/sessions/${encodeURIComponent(t)}/transcript`,{agent_id:n.agentId,before_turn:n.beforeTurn,after_turn:n.afterTurn,page_size:n.pageSize}),o=LAe.parse(i),s={items:o.items,tasks:o.tasks,interactions:o.interactions,attachments:o.attachments,todos:o.todos,prompts:o.prompts,meta:o.meta,hasMoreOlder:o.has_more};return{agentId:o.agent_id,...s,agents:o.agents,pendingInteractions:o.pending_interactions,...o.seq!==void 0?{seq:o.seq}:{}}}const F8=10485760,UAe=5e3,AD=40001;function VAe(e,t){if(e===void 0)return t;let n;const i=/filename\*\s*=\s*UTF-8''([^;]+)/i.exec(e)?.[1]?.trim();if(i!==void 0)try{n=decodeURIComponent(i.replaceAll(/^"|"$/g,""))}catch{return t}else n=/filename\s*=\s*"([^"]*)"/i.exec(e)?.[1]??/filename\s*=\s*([^;]+)/i.exec(e)?.[1]?.trim();return n===void 0||n.length===0||n.length>200||n==="."||n===".."||/[\u0000-\u001F\u007F/\\]/.test(n)||!n.toLowerCase().endsWith(".zip")?t:n}function KAe(e){if(typeof e!="object"||e===null)return{errorName:typeof e};const t=e;return{errorName:typeof t.name=="string"?t.name:"Error",errorCode:typeof t.code=="number"?t.code:void 0,requestId:typeof t.requestId=="string"?t.requestId:void 0,phase:typeof t.phase=="string"?t.phase:void 0,httpStatus:typeof t.status=="number"?t.status:void 0}}function D8(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 xD(e){return e==="auto_compact"||e==="manual_compact"}class ZAe{constructor(t){this.opts=t,this.tracer=t.tracer??eS,this.http=new UF({origin:t.origin,identity:t.identity,tracer:this.tracer,credentialStore:t.credentialStore}),this.httpV2=new UF({origin:t.origin,identity:t.identity,tracer:this.tracer,credentialStore:t.credentialStore,restBasePath:"/api/v2"})}http;httpV2;tracer;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,experimentalFlags:t.experimental_flags??{},backend:t.backend==="v2"?"v2":"v1",webTitle:t.web_title??""}}async listSessions(t){const n={before_id:t?.beforeId,after_id:t?.afterId,page_size:t?.pageSize,busy:t?.busy,include_archive:t?.includeArchive,archived_only:t?.archivedOnly,exclude_empty:t?.excludeEmpty,workspace_id:t?.workspaceId},i=await this.http.get("/sessions",n);return{items:i.items.map(Wu),hasMore:i.has_more}}async listSessionsV2(t){const n={sort:t?.sort,page_size:t?.pageSize,page_token:t?.pageToken,page:t?.page,"meta.updated_after":t?.updatedAfter,"meta.updated_before":t?.updatedBefore,"meta.archived":t?.archived===void 0?void 0:String(t.archived),include:t?.include,"workspace.id":t?.workspaceIds,"activity.status":t?.statuses},i=await this.httpV2.get("/sessions",n);return{items:i.items,hasMore:i.has_more,nextPageToken:i.next_page_token,total:i.total}}async listSessionIdsV2(t){const n={sort:t?.sort,page_size:t?.pageSize,page_token:t?.pageToken,page:t?.page,"meta.updated_after":t?.updatedAfter,"meta.updated_before":t?.updatedBefore,"meta.archived":t?.archived===void 0?void 0:String(t.archived),fields:"id,archived","workspace.id":t?.workspaceIds,"activity.status":t?.statuses},i=await this.httpV2.get("/sessions",n);return{items:i.items,hasMore:i.has_more,nextPageToken:i.next_page_token,total:i.total}}async listSessionGroupsV2(t){const n={view:"by_workspace","group.page_size":t?.groupPageSize,"meta.has_prompt":t?.hasPrompt===void 0?void 0:String(t.hasPrompt),sort:t?.sort,page_size:t?.pageSize,page_token:t?.pageToken,"meta.archived":t?.archived===void 0?void 0:String(t.archived),"workspace.id":t?.workspaceIds,"activity.status":t?.statuses},i=await this.httpV2.get("/sessions",n);return{groups:i.groups,hasMore:i.has_more,nextPageToken:i.next_page_token,total:i.total}}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 i=await this.http.post("/sessions",n);return Wu(i)}async getSession(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}`);return Wu(n)}async updateSession(t,n){const i={};n.title!==void 0&&(i.title=n.title),n.cwd!==void 0&&(i.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.towerMode!==void 0&&(o.tower_mode=n.towerMode),n.towerBase!==void 0&&(o.tower_base=n.towerBase),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&&(i.agent_config=o);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/profile`,i);return Wu(s)}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,towerMode:n.tower_mode===!0,contextTokens:n.context_tokens??0,maxContextTokens:n.max_context_tokens??0,contextUsage:n.context_usage??0}}async getSessionGoal(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/goal`);return Zq(n)}async getSessionPlans(t,n){const i=await this.http.get(`/sessions/${encodeURIComponent(t)}/transcript/plan`,{agent_id:n.agentId,tool_call_id:n.toolCallId});return i.plans.map(o=>({agentId:i.agent_id,toolCallId:o.tool_call_id,turnId:o.turn_id,source:o.source,plan:o.plan,...o.path!==void 0?{path:o.path}:{},...o.options!==void 0?{options:o.options.map(s=>({label:s.label,...s.description!==void 0?{description:s.description}:{}}))}:{},...o.review!==void 0?{review:{state:o.review.state,...o.review.selected_option!==void 0?{selectedOption:o.review.selected_option}:{},...o.review.feedback!==void 0?{feedback:o.review.feedback}:{}}}:{}}))}async getTurnFileChanges(t,n){const i=await this.http.get(`/sessions/${encodeURIComponent(t)}/file-history/changes`,{turn_id:n});return i.recorded===!1?"unrecorded":i.changes??[]}async getTurnFileContent(t,n,i,o){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/file-history/content`,{turn_id:n,path:i,phase:o})).content??null}async getSessionWarnings(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/warnings`)).warnings??[]}async archiveSession(t){return await this.http.post(`/sessions/${encodeURIComponent(t)}:archive`,{})}async restoreSession(t){const n=await this.http.post(`/sessions/${encodeURIComponent(t)}:restore`,{});return Wu(n)}async archiveSessions(t){return this.httpV2.post("/sessions:archive",{ids:t})}async restoreSessions(t){return this.httpV2.post("/sessions:restore",{ids:t})}async listMessages(t,n){const i={before_id:n?.beforeId,after_id:n?.afterId,page_size:n?.pageSize,role:n?.role},o=await this.http.get(`/sessions/${encodeURIComponent(t)}/messages`,i);return{items:o.items.map(Vq),hasMore:o.has_more}}async getSessionTranscript(t,n){return qAe(this.http,t,n)}async exportSession(t,n,i){const o=n===void 0?0:new TextEncoder().encode(n).byteLength,s=n===void 0||n.length===0?0:n.split(` +`).length,r=`/sessions/${encodeURIComponent(t)}/export`,l={web_log_bytes:o,web_log_entries:s},a=i?.desktop===!0;let u;try{u=await this.http.postZip(r,{web_log:n,...a?{desktop:!0}:{}},l)}catch(d){if(a&&li(d)&&d.code===AD)u=await this.http.postZip(r,{web_log:n},l);else throw d}const c=`${t}.zip`;return{blob:u.blob,fileName:VAe(u.contentDisposition,c)}}async submitPrompt(t,n){const i=Date.now();this.tracer.traceKeyEvent?.("prompt:start",{sessionId:t,contentCount:n.content.length,mediaCount:n.content.filter(o=>o.type==="image"||o.type==="video"||o.type==="file").length});try{const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts`,$4e(n));return this.tracer.traceKeyEvent?.("prompt:accepted",{sessionId:t,promptId:o.prompt_id,status:o.status,durationMs:Date.now()-i}),{promptId:o.prompt_id,userMessageId:o.user_message_id,origin:o.origin,status:o.status}}catch(o){throw this.tracer.traceKeyEvent?.("prompt:failed",{sessionId:t,status:"failed",durationMs:Date.now()-i,...KAe(o)}),o}}async steerPrompts(t,n){const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts:steer`,{prompt_ids:n});return{steered:i.steered,promptIds:i.prompt_ids}}async abortPrompt(t,n){const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts/${encodeURIComponent(n)}:abort`,void 0,{allowCodes:[40903]});return{aborted:i.aborted,atSeq:i.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 generateSessionTitle(t,n){try{const i={};n?.force===!0&&(i.force=!0),n?.source!==void 0&&(i.source=n.source);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/title/generate`,i);return typeof o?.title=="string"&&o.title.length>0?o.title:null}catch{return null}}async forkSession(t,n){const i={};n?.title!==void 0&&(i.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}:fork`,i,{timeoutMs:HF});return Wu(o)}async createChildSession(t,n){const i={};n?.title!==void 0&&(i.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/children`,i,{timeoutMs:HF});return Wu(o)}async listChildSessions(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/children`)).items.map(Wu)}async startBtw(t){return{agentId:(await this.http.post(`/sessions/${encodeURIComponent(t)}:btw`,{})).agent_id}}async respondApproval(t,n,i){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/approvals/${encodeURIComponent(n)}`,z4e(i));return{resolved:o.resolved,resolvedAt:o.resolved_at}}async respondQuestion(t,n,i){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}`,V4e(i));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 i={status:n};return(await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks`,i)).items.map(s=>KA(s))}async getTask(t,n,i){const o={with_output:i?.withOutput,output_bytes:i?.outputBytes},s=await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}`,o);return KA(s)}async cancelTask(t,n){return await this.http.post(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}:cancel`)}async detachTask(t,n){return await this.http.post(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}:detach`)}async listTerminals(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals`)).items.map(D8)}async createTerminal(t,n={}){const i={cwd:n.cwd,shell:n.shell,cols:n.cols,rows:n.rows},o=await this.http.post(`/sessions/${encodeURIComponent(t)}/terminals`,i);return D8(o)}async getTerminal(t,n){const i=await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}`);return D8(i)}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(i=>({name:i.name,description:i.description,path:i.path,source:i.source}))}async listSkillsForWorkspace(t){return((await this.http.get(`/workspaces/${encodeURIComponent(t)}/skills`)).skills??[]).map(i=>({name:i.name,description:i.description,path:i.path,source:i.source}))}async activateSkill(t,n,i,o){const s={};i!==void 0&&i.length>0&&(s.args=i),o!==void 0&&o.length>0&&(s.attachments=o.map(Kq));const r=await this.http.post(`/sessions/${encodeURIComponent(t)}/skills/${encodeURIComponent(n)}:activate`,s);return{activated:r.activated,skillName:r.skill_name}}async listCapabilities(){return(await this.http.get("/capabilities")).capabilities??[]}async getCapability(t){return this.http.get(`/capabilities/${encodeURIComponent(t)}`)}async installCapability(t){return this.http.post(`/capabilities/${encodeURIComponent(t)}:install`,{})}async listPlugins(){return(await this.http.get("/plugins")).plugins??[]}async listPluginMarketplace(){return(await this.http.get("/plugins/marketplace")).entries??[]}async installPlugin(t){return this.http.post("/plugins",{source:t})}async setPluginEnabled(t,n){return this.http.post(`/plugins/${encodeURIComponent(t)}:${n?"enable":"disable"}`,{})}async removePlugin(t){return this.http.post(`/plugins/${encodeURIComponent(t)}:remove`,{})}async listDirectory(t,n){const i={};n.path!==void 0&&(i.path=n.path),n.depth!==void 0&&(i.depth=n.depth),n.includeGitStatus!==void 0&&(i.include_git_status=n.includeGitStatus);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:list`,i),s=o.children_by_path?Object.fromEntries(Object.entries(o.children_by_path).map(([r,l])=>[r,l.map(ZF)])):void 0;return{items:o.items.map(ZF),childrenByPath:s,truncated:o.truncated}}async readFile(t,n){const i={path:n.path};n.offset!==void 0&&(i.offset=n.offset),n.length!==void 0&&(i.length=n.length);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:read`,i);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,i){const o={workspace:t,query:n.query};n.limit!==void 0&&(o.limit=n.limit);const s=await this.http.post("/workspace/fs:search",o,{signal:i?.signal});return{items:s.items.map(r=>({path:r.path,name:r.name,kind:r.kind,score:r.score,matchPositions:r.match_positions})),truncated:s.truncated}}async suggestFiles(t,n,i){const o={workspace:t,query:n.query};n.limit!==void 0&&(o.limit=n.limit);const s=await this.http.post("/workspace/fs:suggest",o,{signal:i?.signal});return{items:s.items.map(r=>({path:r.path,name:r.name,kind:r.kind,score:r.score,matchPositions:r.match_positions})),truncated:s.truncated}}async grepFiles(t,n){const i={pattern:n.pattern};n.regex!==void 0&&(i.regex=n.regex),n.caseSensitive!==void 0&&(i.case_sensitive=n.caseSensitive);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:grep`,i);return{files:o.files,filesScanned:o.files_scanned,truncated:o.truncated,elapsedMs:o.elapsed_ms}}async getGitStatus(t,n){const i={};n!==void 0&&(i.paths=n);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:git_status`,i);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 i=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:diff`,{path:n});return{path:i.path,diff:i.diff,truncated:i.truncated??!1}}getFileDownloadUrl(t,n){const i=n.split("/").map(o=>encodeURIComponent(o)).join("/");return Jd(this.opts.origin,`/sessions/${encodeURIComponent(t)}/fs/${i}:download`)}async openFile(t,n){const i={path:n.path};return n.line!==void 0&&(i.line=n.line),this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open`,i)}async revealFile(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/fs:reveal`,{path:n.path})}async openInApp(t,n,i,o){const s={app_id:n,path:i};o!==void 0&&(s.line=o),await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open-in`,s)}async listWorkspaces(){try{return((await this.http.get("/workspaces")).items??[]).map(Y0)}catch{return[]}}async addWorkspace(t){const n={root:t.root};t.name!==void 0&&(n.name=t.name);const i=await this.http.post("/workspaces",n);return Y0(i)}async deleteWorkspace(t){await this.http.delete(`/workspaces/${encodeURIComponent(t)}`)}async updateWorkspace(t,n){const i=await this.http.patch(`/workspaces/${encodeURIComponent(t)}`,{name:n.name});return Y0(i)}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(i=>({name:i.name,path:i.path,isDir:i.is_dir}))}}catch{return{path:"",parent:null,entries:[]}}}async getFsHome(){try{const t=await this.http.get("/fs:home");return{home:t.home,recentRoots:t.recent_roots??[]}}catch{return{home:"",recentRoots:[]}}}async listModels(){return(await this.http.get("/models")).items.map(Z4e)}async listProviders(){return(await this.http.get("/providers")).items.map(f1)}async getProvider(t){const n=await this.http.get(`/providers/${encodeURIComponent(t)}`),i=f1(n);return n.api_key!==void 0?{...i,apiKey:n.api_key}:i}async addProvider(t){const n={id:t.id??"",type:t.type,models:(t.models??[]).map(o=>{const s={model:o.model,max_context_size:o.maxContextSize};return o.displayName!==void 0&&(s.display_name=o.displayName),o.capabilities!==void 0&&(s.capabilities=o.capabilities),o.maxOutputSize!==void 0&&(s.max_output_size=o.maxOutputSize),o.supportEfforts!==void 0&&(s.support_efforts=o.supportEfforts),o.adaptiveThinking!==void 0&&(s.adaptive_thinking=o.adaptiveThinking),s})};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 i=await this.http.post("/providers",n);return f1(i)}async updateProvider(t,n){const i={type:n.type,models:(n.models??[]).map(s=>{const r={model:s.model,max_context_size:s.maxContextSize};return s.displayName!==void 0&&(r.display_name=s.displayName),s.capabilities!==void 0&&(r.capabilities=s.capabilities),s.maxOutputSize!==void 0&&(r.max_output_size=s.maxOutputSize),s.supportEfforts!==void 0&&(r.support_efforts=s.supportEfforts),s.adaptiveThinking!==void 0&&(r.adaptive_thinking=s.adaptiveThinking),r})};n.newId!==void 0&&(i.new_id=n.newId),n.apiKey!==void 0&&(i.api_key=n.apiKey),n.baseUrl!==void 0&&(i.base_url=n.baseUrl),n.defaultModel!==void 0&&(i.default_model=n.defaultModel);const o=await this.http.put(`/providers/${encodeURIComponent(t)}`,i);return{provider:f1(o.provider)}}async deleteProvider(t){return await this.http.delete(`/providers/${encodeURIComponent(t)}`),{deleted:t}}async listCatalogProviders(){return(await this.http.get("/catalog/providers")).items.map(GF)}async getCatalogProvider(t){const n=await this.http.get(`/catalog/providers/${encodeURIComponent(t)}`);return GF(n)}async importCatalogProvider(t){const n={catalog_id:t.catalogId};t.apiKey!==void 0&&(n.api_key=t.apiKey),t.baseUrl!==void 0&&(n.base_url=t.baseUrl),t.id!==void 0&&(n.id=t.id);const i=await this.http.post("/providers:import_catalog",n);return{provider:f1(i.provider),modelsImported:i.models_imported}}async importCustomRegistry(t){const n={url:t.url};t.apiKey!==void 0&&(n.api_key=t.apiKey);const i=await this.http.post("/providers:import_registry",n);return{providers:i.providers.map(f1),modelsImported:i.models_imported}}async refreshProvider(t){const n=await this.http.post(`/providers/${encodeURIComponent(t)}:refresh`);return R8(n)}async refreshAllProviders(){const t=await this.http.post("/providers:refresh");return R8(t)}async refreshOAuthProviderModels(){const t=await this.http.post("/providers:refresh_oauth");return R8(t)}async getConfig(){const t=await this.http.get("/config");return ZA(t)}async setConfig(t){const n={},i={providers:"providers",defaultProvider:"default_provider",defaultModel:"default_model",secondaryModel:"secondary_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[s,r]of Object.entries(t)){const l=i[s];l!==void 0&&(n[l]=r)}const o=await this.http.post("/config",n);return ZA(o)}async getAuth(){const t=await this.http.get("/auth");return{modelsReady:t.models_ready,providersCount:t.providers_count,managedProvider:t.managed_provider?{status:t.managed_provider.status}:null}}async startOAuthLogin(t){let n;try{n=await this.http.post("/oauth/login",t===void 0?{}:{region:t})}catch(i){if(t!==void 0&&li(i)&&i.code===AD)n=await this.http.post("/oauth/login",{});else throw i}return n.status==="authenticated"?{flowId:n.flow_id,provider:n.provider,status:"authenticated"}:{flowId:n.flow_id,provider:n.provider,status:"pending",verificationUri:n.verification_uri,verificationUriComplete:n.verification_uri_complete,userCode:n.user_code,expiresIn:n.expires_in,interval:n.interval,expiresAt:n.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,errorMessage:t.error_message}: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 getUsage(){const t=await this.http.get("/oauth/usage");if(t.kind==="error")return{kind:"error",message:t.message,status:t.status};const n=i=>({name:i.name,window:i.window,used:i.used,limit:i.limit,resetAt:i.reset_at});return{kind:"ok",summary:t.summary===null?null:n(t.summary),limits:t.limits.map(n),extraUsage:t.extra_usage===null?null:{balanceCents:t.extra_usage.balance_cents,totalCents:t.extra_usage.total_cents,monthlyChargeLimitEnabled:t.extra_usage.monthly_charge_limit_enabled,monthlyChargeLimitCents:t.extra_usage.monthly_charge_limit_cents,monthlyUsedCents:t.extra_usage.monthly_used_cents,currency:t.extra_usage.currency}}}async getUserInfo(){return this.http.get("/oauth/userinfo")}async getOAuthRegion(){try{const t=await Promise.race([this.http.get("/oauth/region"),new Promise((n,i)=>{setTimeout(()=>i(new Error("oauth region probe timed out")),UAe)})]);return t.region==="mainland-cn"||t.region==="global"?t.region:null}catch{return null}}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 i=await this.http.postForm("/files",n,t.onProgress===void 0?void 0:{onUploadProgress:t.onProgress});return{id:i.id,name:i.name,mediaType:i.media_type,size:i.size}}getFileUrl(t){return Jd(this.opts.origin,`/files/${encodeURIComponent(t)}`)}async getFileBlob(t){return this.http.getBlob(`/files/${encodeURIComponent(t)}`)}getSessionMediaUrl(t,n){return Jd(this.opts.origin,`/sessions/${encodeURIComponent(t)}/media/${encodeURIComponent(n)}`)}async getSessionMediaBlob(t,n){return this.http.getBlob(`/sessions/${encodeURIComponent(t)}/media/${encodeURIComponent(n)}`)}async readHostFileContent(t){const n=await this.http.getBlob("/fs:content",{path:t},{maxBytes:F8});if(n.size>F8)throw new z7({size:n.size,limit:F8});const i=n.type,o=!GAe(i),s=i||(o?"application/octet-stream":"text/plain");if(o){const l=await QAe(n);return{path:t,content:l,encoding:"base64",mime:s,isBinary:!0,size:n.size}}const r=await n.text();return{path:t,content:r,encoding:"utf-8",mime:s,isBinary:!1,size:n.size}}connectEvents(t){const n=jF(this.opts.origin,this.opts.identity.clientId),i=this.opts.projectorFactory(),o=new CD({wsUrl:n,clientId:this.opts.identity.clientId,tracer:this.tracer,credentialStore:this.opts.credentialStore,mainAgentOnly:this.opts.mainAgentOnly,handlers:{onWireEvent:s=>{const r=G4e(s),l=Q4e(s),a=K4e(s);a.type==="historyCompacted"&&!xD(a.reason)&&t.onResync(a.sessionId,a.beforeSeq),t.onEvent(a,{sessionId:r,seq:l})},onRawAgentEvent:s=>{const{type:r,seq:l,session_id:a,payload:u,offset:c}=s,d=i.project(r,u,a,{offset:c});for(const f of d){const h=u?.turnId,m=f.type==="assistantDelta"&&typeof h=="number"&&typeof c=="number"&&(r==="assistant.delta"||r==="thinking.delta")?{turnId:h,offset:c,kind:r==="assistant.delta"?"text":"thinking"}:void 0;f.type==="historyCompacted"&&!xD(f.reason)&&t.onResync(a,l),t.onEvent(f,{sessionId:a,seq:l,stream:m})}},onResync:(s,r,l)=>{i.reset(s),t.onResync(s,r,l)},onConnectionState:s=>{t.onConnectionChange(s)},onReplayComplete:()=>{t.onReplayComplete?.()},onError:(s,r,l)=>{t.onError(s,r,l)},onTerminalOutput:(s,r,l,a)=>{t.onTerminalOutput?.(s,r,l,a)},onTerminalExit:(s,r,l)=>{t.onTerminalExit?.(s,r,l)},onTranscriptReset:(s,r,l,a)=>{t.onTranscriptReset?.(s,r,l,a)},onTranscriptOps:(s,r,l,a)=>t.onTranscriptOps?.(s,r,l,a)??!0}});return o.connect(),{subscribe(s,r){o.subscribe(s,r??{seq:0})},unsubscribe(s){o.unsubscribe(s),i.forgetSession(s)},subscribeTranscript(s,r,l){o.subscribeTranscript(s,r,l)},unsubscribeTranscript(s,r){o.unsubscribeTranscript(s,r)},bindNextPromptId(s,r){i.bindNextPromptId(s,r)},abort(s,r){o.abort(s,r)},terminalAttach(s,r,l){o.terminalAttach(s,r,l)},terminalInput(s,r,l){o.terminalInput(s,r,l)},terminalResize(s,r,l,a){o.terminalResize(s,r,l,a)},terminalDetach(s,r){o.terminalDetach(s,r)},terminalClose(s,r){o.terminalClose(s,r)},markSideChannelAgent(s,r){o.markSideChannelAgent(s,r),i.markSideChannelAgent(r)},health(){return o.health()},reconnect(){o.reconnect()},close(){o.close()}}}connectTranscriptChannel(t){const n=`${this.opts.identity.clientId}-transcript`,i=new CD({wsUrl:jF(this.opts.origin,n),clientId:n,tracer:this.tracer,credentialStore:this.opts.credentialStore,handlers:{onWireEvent:()=>{},onResync:()=>{},onConnectionState:o=>t.onConnectionState?.(o),onError:(o,s,r)=>t.onError?.(o,s,r),onTranscriptReset:t.onTranscriptReset,onTranscriptOps:t.onTranscriptOps}});return i.connect(),{subscribe:()=>{},unsubscribe:()=>{},subscribeTranscript:(o,s,r)=>i.subscribeTranscript(o,s,r),unsubscribeTranscript:(o,s)=>i.unsubscribeTranscript(o,s),bindNextPromptId:()=>{},abort:()=>{},terminalAttach:()=>{},terminalInput:()=>{},terminalResize:()=>{},terminalDetach:()=>{},terminalClose:()=>{},markSideChannelAgent:()=>{},health:()=>i.health(),reconnect:()=>i.reconnect(),close:()=>i.close()}}}function R8(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}}function GAe(e){const t=e.toLowerCase().split(";")[0].trim();return t===""||t==="text/plain"||t.startsWith("text/")?!0:/(json|xml|javascript|typescript|x-yaml|yaml|svg|x-sh|x-python|markdown|csv|html|css)$/.test(t)}function QAe(e){return new Promise((t,n)=>{const i=new FileReader;i.onload=()=>{const o=typeof i.result=="string"?i.result:"";t(o.slice(o.indexOf(",")+1))},i.onerror=()=>n(i.error),i.readAsDataURL(e)})}const YAe="main",JAe=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.use","tool.call.started","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.completed","prompt.aborted","error"]);function O8(e="msg_"){const t=Date.now().toString(36).padStart(10,"0"),n=Math.random().toString(36).slice(2,12).padEnd(10,"0");return`${e}${t}${n}`}function XAe(e){if(!e||typeof e!="object")return{input:0,output:0,cacheRead:0,cacheCreate:0};const t=e;return{input:t.inputOther??t.input_tokens??0,output:t.output??t.output_tokens??0,cacheRead:t.inputCacheRead??t.cache_read_input_tokens??0,cacheCreate:t.inputCacheCreation??t.cache_creation_input_tokens??0}}function SD(){return{turnPromptId:new Map,currentPromptId:void 0,totalInput:0,totalOutput:0,totalCacheRead:0,totalCacheCreate:0,contextTokens:0,contextLimit:0,turnCount:0,model:"",subagentMeta:new Map,restartedThisRun:new Set,settledByKernel:new Set,retiredBindings:new Set,registrationSeq:0,registrationOrderByKey:new Map,retryActive:!1}}function _r(e,t){const n=e[t];return typeof n=="string"?n:void 0}function nr(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function _a(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function e6e(e){if(!e||typeof e!="object")return null;const t=e,n=t.budget,i=n&&typeof n=="object"?n:{},o=_r(t,"status");if(o!=="active"&&o!=="paused"&&o!=="blocked"&&o!=="complete")return null;const s=_r(t,"goalId")??_r(t,"goal_id")??"goal",r=_r(t,"objective")??"";return{goalId:s,objective:r,completionCriterion:_r(t,"completionCriterion")??_r(t,"completion_criterion"),status:o,turnsUsed:nr(t,"turnsUsed")??nr(t,"turns_used")??0,tokensUsed:nr(t,"tokensUsed")??nr(t,"tokens_used")??0,wallClockMs:nr(t,"wallClockMs")??nr(t,"wall_clock_ms")??0,terminalReason:_r(t,"terminalReason")??_r(t,"terminal_reason"),budget:{tokenBudget:_a(i,"tokenBudget")??_a(i,"token_budget"),remainingTokens:_a(i,"remainingTokens")??_a(i,"remaining_tokens"),turnBudget:_a(i,"turnBudget")??_a(i,"turn_budget"),remainingTurns:_a(i,"remainingTurns")??_a(i,"remaining_turns"),wallClockBudgetMs:_a(i,"wallClockBudgetMs")??_a(i,"wall_clock_budget_ms"),remainingWallClockMs:_a(i,"remainingWallClockMs")??_a(i,"remaining_wall_clock_ms"),overBudget:i.overBudget===!0||i.over_budget===!0}}}function Wd(e,t,n,i,o){if(typeof i!="string"||i.length===0)return null;const r={...t.subagentMeta.get(i)??{id:i,agentId:i,sessionId:n,kind:"subagent",description:e("tasks.dockSubagent"),status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued"},...o,id:i,sessionId:n,kind:"subagent"};return t.subagentMeta.set(i,r),r}function t6e(e,t,n){if(t==="turn.step.started")return null;if(t==="tool.use"||t==="tool.call.started"){const i=_r(n,"name")??_r(n,"toolName")??"tool",o=Ez(e,n6e(i)),s=i6e(e,i,n.args??n.input);return s?`Calling ${o}: ${s}`:`Calling ${o}`}if(t==="tool.progress"){const i=n.update;if(i&&typeof i=="object"){const s=_r(i,"text");if(s)return P8(s);const r=_r(i,"message");if(r)return P8(r)}const o=_r(n,"message");if(o)return P8(o)}return null}function n6e(e){return e.replace(/_\d+$/,"")}const _D=2e3;function P8(e){return e.length>_D?`${e.slice(0,_D)}…`:e}function i6e(e,t,n){if(n==null)return"";const i=typeof n=="string"?n:JSON.stringify(n);return $7(e,t,i)}function o6e(e,t,n,i,o,s,r){if(r.has(i)&&o==="turn.step.started")return[];if(o==="assistant.delta"){const h=_r(s,"delta");if(!h)return[];const m=t.subagentMeta.get(i),g=Wd(e,t,n,i,{status:"running",subagentPhase:"working",startedAt:m?.startedAt??new Date().toISOString()}),y=[];return g&&y.push({type:"taskCreated",sessionId:n,task:g}),y.push({type:"taskProgress",sessionId:n,taskId:i,outputChunk:h,stream:"stdout",kind:"text"}),y}const l=t6e(e,o,s);if(l===null||l.length===0)return[];const a=o==="tool.progress"?s.update:void 0,u=a!=null&&typeof a=="object"?a.replace===!0:!1,c=t.subagentMeta.get(i),d=Wd(e,t,n,i,{status:"running",subagentPhase:"working",startedAt:c?.startedAt??new Date().toISOString()}),f=[];return d&&f.push({type:"taskCreated",sessionId:n,task:d}),f.push({type:"taskProgress",sessionId:n,taskId:i,outputChunk:l,stream:"stdout",replace:u}),f}function s6e(e){return Array.isArray(e)?e.map(t=>Q4(t)):[]}function r6e(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}}const l6e=new Set(["session.meta.updated","goal.updated","compaction.completed","compaction.started","compaction.cancelled","compaction.blocked","hook.result","mcp.server.status","skill.activated","tool.list.updated"]);function a6e(e,t,n){switch(e){case"session.meta.updated":{const i=t?.patch?.title??t?.title,o=t?.patch?.lastPrompt,s={};return typeof i=="string"&&i.length>0&&(s.title=i),typeof o=="string"&&(s.lastPrompt=o),s.title!==void 0||s.lastPrompt!==void 0?[{type:"sessionMetaUpdated",sessionId:n,...s}]:[]}case"goal.updated":{const i=e6e(t?.snapshot??null);return[{type:"goalUpdated",sessionId:n,goal:i?.status==="complete"?null:i}]}case"compaction.completed":{const i=t?.result??{};return[{type:"compactionCompleted",sessionId:n,tokensBefore:typeof i.tokensBefore=="number"?i.tokensBefore:void 0,tokensAfter:typeof i.tokensAfter=="number"?i.tokensAfter:void 0,summary:typeof i.summary=="string"?i.summary:void 0},{type:"historyCompacted",sessionId:n,beforeSeq:0,reason:"auto_compact"}]}case"compaction.started":return[{type:"compactionStarted",sessionId:n,trigger:t?.trigger==="manual"?"manual":"auto",instruction:typeof t?.instruction=="string"?t.instruction:void 0}];case"compaction.cancelled":return[{type:"compactionCancelled",sessionId:n}];default:return[]}}function u6e(e){const{t}=e,n=new Map,i=new Set;function o(f){let h=n.get(f);return h||(h=SD(),n.set(f,h)),h}function s(f){n.set(f,SD())}function r(f){n.delete(f)}function l(f){return n.has(f)}function a(f){i.add(f)}function u(f,h){const m=o(f);m.currentPromptId=h}function c(f,h,m,g){try{return d(f,h,m,g)}catch(y){return Gu("[agentProjector] Error projecting event:",f,y instanceof Error?y.message:y),[]}}function d(f,h,m,g){if(l6e.has(f))return a6e(f,h,m);const y=o(m),k=h,v=[],C=k?.agentId;if(typeof C=="string"&&C!==YAe){const w=i.has(C);if(f==="prompt.submitted"){if(!w)return[];const M=k?.promptId,L=k?.userMessageId;if(!M||!L)return[];const E=s6e(k?.content);return E.length===0?[]:[{type:"messageCreated",agentId:C,message:{id:L,sessionId:m,role:"user",content:E,createdAt:typeof k?.createdAt=="string"?k.createdAt:new Date().toISOString(),promptId:M}}]}if(w&&(f==="thinking.delta"||f==="assistant.delta")){const M=k?.delta??"";return M?[{type:"agentDelta",sessionId:m,agentId:C,delta:{[f==="thinking.delta"?"thinking":"text"]:M}}]:[]}if(w&&f==="turn.ended")return[{type:"agentTurnEnded",sessionId:m,agentId:C,reason:k?.reason}];if(JAe.has(f))return o6e(t,y,m,C,f,k??{},i)}switch(f){case"turn.started":{const w=k?.turnId,M=y.currentPromptId??O8("pr_");y.currentPromptId=M,w!==void 0&&y.turnPromptId.set(w,M),v.push({type:"turnActiveChanged",sessionId:m,active:!0});break}case"turn.step.started":case"thinking.delta":case"assistant.delta":case"tool.use":case"tool.call.started":case"tool.call.delta":case"tool.progress":case"tool.result":break;case"turn.step.completed":{const w=XAe(k?.usage);y.totalInput+=w.input,y.totalOutput+=w.output,y.totalCacheRead+=w.cacheRead,y.totalCacheCreate+=w.cacheCreate;break}case"agent.status.updated":{k?.model&&(y.model=k.model),k?.contextTokens!==void 0&&(y.contextTokens=k.contextTokens),k?.maxContextTokens!==void 0&&(y.contextLimit=k.maxContextTokens);const w=k?.phase;w!=null&&w.kind==="retrying"?(y.retryActive=!0,v.push({type:"turnRetry",sessionId:m,retry:{failedAttempt:nr(w,"failedAttempt")??0,nextAttempt:nr(w,"nextAttempt")??0,maxAttempts:nr(w,"maxAttempts")??0,delayMs:nr(w,"delayMs")??0,errorName:_r(w,"errorName"),statusCode:nr(w,"statusCode"),turnId:nr(w,"turnId")}})):y.retryActive&&w!==void 0&&w!==null&&typeof w.kind=="string"&&(y.retryActive=!1,v.push({type:"turnRetry",sessionId:m,retry:void 0})),v.push({type:"sessionUsageUpdated",sessionId:m,usage:r6e(y),model:y.model||void 0,swarmMode:k?.swarmMode===!0?!0:k?.swarmMode===!1?!1:void 0,towerMode:k?.towerMode===!0?!0:k?.towerMode===!1?!1:void 0,planMode:k?.planMode===!0?!0:k?.planMode===!1?!1:void 0,thinking:typeof k?.thinkingEffort=="string"&&k.thinkingEffort.length>0?k.thinkingEffort:void 0});break}case"turn.ended":{const w=k?.turnId,M=(w!==void 0?y.turnPromptId.get(w):void 0)??y.currentPromptId;v.push({type:"turnActiveChanged",sessionId:m,active:!1,reason:k?.reason,promptId:M}),y.turnCount++,y.currentPromptId=void 0;break}case"prompt.completed":{const w=k?.promptId;typeof w=="string"&&w.length>0&&v.push({type:"promptCompleted",sessionId:m,promptId:w,reason:k?.reason??"completed"});break}case"prompt.aborted":{const w=k?.promptId;typeof w=="string"&&w.length>0&&v.push({type:"promptAborted",sessionId:m,promptId:w});break}case"turn.step.retrying":{y.retryActive=!0,v.push({type:"turnRetry",sessionId:m,retry:{failedAttempt:nr(k??{},"failedAttempt")??0,nextAttempt:nr(k??{},"nextAttempt")??0,maxAttempts:nr(k??{},"maxAttempts")??0,delayMs:nr(k??{},"delayMs")??0,errorName:_r(k??{},"errorName"),statusCode:nr(k??{},"statusCode"),turnId:typeof k?.turnId=="number"?k.turnId:void 0}});break}case"turn.step.interrupted":break;case"subagent.spawned":{const w=typeof k?.subagentId=="string"&&k.subagentId.length>0?k.subagentId:O8("task_"),M=typeof k?.taskId=="string"&&k.taskId.length>0?k.taskId:void 0,L=M!==void 0&&M!==w?y.subagentMeta.get(M):void 0,E=y.subagentMeta.get(w);L!==void 0&&y.subagentMeta.delete(M),M!==void 0&&!y.registrationOrderByKey.has(M)&&y.registrationOrderByKey.set(M,++y.registrationSeq);const S=E===void 0||L===void 0?E??L:{...E,createdAt:L.createdAt,startedAt:L.startedAt??E.startedAt,runInBackground:!0,backgroundTaskId:E.backgroundTaskId??M},x=S?.backgroundTaskId??(S!==void 0&&M!==void 0&&S.id===M?M:void 0),A=M!==void 0?y.registrationOrderByKey.get(M):void 0,T=x!==void 0?y.registrationOrderByKey.get(x):void 0,I=y.retiredBindings.has(M??"")||A!==void 0&&T!==void 0&&A0?k.model:S?.model,thinkingEffort:typeof k?.thinkingEffort=="string"&&k.thinkingEffort.length>0?k.thinkingEffort:S?.thinkingEffort,parentToolCallId:typeof k?.parentToolCallId=="string"?k.parentToolCallId:S?.parentToolCallId,swarmIndex:typeof k?.swarmIndex=="number"?k.swarmIndex:S?.swarmIndex,runInBackground:O?k?.runInBackground===!0||k?.runInBackground===void 0&&S?.runInBackground===!0:k?.runInBackground===!0||S?.runInBackground===!0,outputPreview:O?void 0:S?.outputPreview,outputBytes:O?void 0:S?.outputBytes,outputLines:O?void 0:S?.outputLines,suspendedReason:O?void 0:S?.suspendedReason,text:O?void 0:S?.text,backgroundTaskId:I?S?.backgroundTaskId:O?M:M??S?.backgroundTaskId};y.subagentMeta.set(R.id,R),v.push({type:"taskCreated",sessionId:m,task:R});break}case"subagent.started":{const w=typeof k?.subagentId=="string"?k.subagentId:void 0,M=w!==void 0&&(y.subagentMeta.get(w)?.status!==void 0&&y.subagentMeta.get(w).status!=="running"||y.settledByKernel.has(w));M&&y.settledByKernel.delete(w);const L=Wd(t,y,m,k?.subagentId,{subagentPhase:"working",status:"running",startedAt:new Date().toISOString(),suspendedReason:void 0,...M?{createdAt:new Date().toISOString(),completedAt:void 0,completedAtEstimated:void 0,outputPreview:void 0,outputBytes:void 0,outputLines:void 0,text:void 0}:{}});M&&w!==void 0&&y.restartedThisRun.add(w),L&&v.push({type:"taskCreated",sessionId:m,task:L});break}case"subagent.suspended":{const w=Wd(t,y,m,k?.subagentId,{subagentPhase:"suspended",status:"running",suspendedReason:typeof k?.reason=="string"?k.reason:void 0});w&&v.push({type:"taskCreated",sessionId:m,task:w});break}case"subagent.completed":{const w=typeof k?.resultSummary=="string"?k.resultSummary:void 0,M=Wd(t,y,m,k?.subagentId,{subagentPhase:"completed",status:"completed",completedAt:new Date().toISOString(),completedAtEstimated:!0,outputPreview:w});M&&v.push({type:"taskCreated",sessionId:m,task:M}),M!==null&&y.restartedThisRun.delete(M.id),v.push({type:"taskCompleted",sessionId:m,taskId:k?.subagentId??"",status:"completed",outputPreview:w});break}case"subagent.failed":{const w=typeof k?.error=="string"?k.error:void 0,M=Wd(t,y,m,k?.subagentId,{subagentPhase:"failed",status:"failed",completedAt:new Date().toISOString(),completedAtEstimated:!0,outputPreview:w});M&&v.push({type:"taskCreated",sessionId:m,task:M}),M!==null&&y.restartedThisRun.delete(M.id),v.push({type:"taskCompleted",sessionId:m,taskId:k?.subagentId??"",status:"failed",outputPreview:w});break}case"error":{v.push({type:"unknown",raw:{_agentError:!0,code:k?.code,message:k?.message,name:k?.name,details:k?.details,retryable:k?.retryable}});break}case"warning":{v.push({type:"unknown",raw:{_agentWarning:!0,message:k?.message}});break}case"task.started":case"background.task.started":{const w=k?.info??{},M=typeof w.startedAt=="number"?new Date(w.startedAt).toISOString():void 0,L=typeof w.taskId=="string"?w.taskId:typeof w.taskId=="number"?String(w.taskId):O8("task_"),E=typeof w.description=="string"?w.description:typeof w.command=="string"?w.command:t("tasks.defaultDescription");if(w.kind==="agent"){const x=typeof w.agentId=="string"&&w.agentId.length>0?w.agentId:void 0;if(x!==void 0){const A=y.subagentMeta.get(x),T=y.registrationOrderByKey.get(L),I=A?.backgroundTaskId!==void 0?y.registrationOrderByKey.get(A.backgroundTaskId):void 0;if(y.retiredBindings.has(L)||T!==void 0&&I!==void 0&&TI.backgroundTaskId===L);if(A===void 0&&(y.retiredBindings.has(L)||y.registrationOrderByKey.has(L)&&y.registrationOrderByKey.get(L)0&&y.settledByKernel.add(w.agentId),v.push({type:"taskCompleted",sessionId:m,taskId:typeof w.taskId=="string"?w.taskId:typeof w.taskId=="number"?String(w.taskId):"",status:w.status==="killed"?"cancelled":M?"failed":"completed"});break}}return v}return{project:c,bindNextPromptId:u,reset:s,forgetSession:r,markSideChannelAgent:a,hasSessionState:l}}function c6e(e){return new ZAe({origin:e.origin,identity:e.identity,tracer:e.tracer,credentialStore:e.credentialStore,projectorFactory:()=>u6e({t:e.t}),mainAgentOnly:e.mainAgentOnly})}const d6e={t:e=>e},ID="Sub Agent";function f6e(){return{sessions:[],activeSessionId:void 0,approvalsBySession:{},planReviewByToolCallId:{},questionsBySession:{},tasksBySession:{},goalBySession:{},goalVersionBySession:{},lastSeqBySession:{},turnActiveBySession:{},turnErrorBySession:{},turnRetryBySession:{},compactionBySession:{},warnings:[]}}function h6e(e){return{...e,sessions:e.sessions,approvalsBySession:{...e.approvalsBySession},planReviewByToolCallId:{...e.planReviewByToolCallId},questionsBySession:{...e.questionsBySession},tasksBySession:{...e.tasksBySession},goalBySession:{...e.goalBySession},goalVersionBySession:{...e.goalVersionBySession},lastSeqBySession:{...e.lastSeqBySession},turnActiveBySession:{...e.turnActiveBySession},turnErrorBySession:{...e.turnErrorBySession},turnRetryBySession:{...e.turnRetryBySession},compactionBySession:{...e.compactionBySession},warnings:[...e.warnings]}}function p6e(e,t,n){if(t!==void 0&&n!==void 0&&n>0){const i=e.lastSeqBySession[t]??0;n>i&&(e.lastSeqBySession[t]=n)}}function Zy(e,t){const n=e.sessions.find(i=>i.id===t.sessionId)?.lastSeq??0;return t.seq>Math.max(e.lastSeqBySession[t.sessionId]??0,n)}const m6e={"provider.connection_error":"connection","provider.auth_error":"auth","provider.rate_limit":"rateLimit","provider.overloaded":"overloaded","provider.filtered":"filtered","provider.api_error":"api","context.overflow":"contextOverflow"};function XA(e,t){const n=[],i=(r,l)=>{typeof l=="number"||typeof l=="boolean"?n.push({label:r,value:String(l)}):typeof l=="string"&&l.length>0&&n.push({label:r,value:l})};i(t("warnings.details.code"),e.code);const o=e.details??{};i(t("warnings.details.status"),o.statusCode),i(t("warnings.details.requestId"),o.requestId),i(t("warnings.details.errorName"),e.name);for(const[r,l]of Object.entries(o))r==="statusCode"||r==="requestId"||i(r,l);const s=(e.code!==void 0?m6e[e.code]:void 0)??"title";return{severity:"error",title:t(`warnings.agentError.${s}`),message:e.message,details:n.length>0?n:void 0}}function g6e(e,t,n,i=d6e){const o=h6e(e);switch(p6e(o,n.sessionId,n.seq),t.type){case"sessionCreated":{o.sessions.some(r=>r.id===t.session.id)||(o.sessions=[t.session,...o.sessions]);break}case"sessionUpdated":{o.sessions=o.sessions.map(s=>s.id===t.session.id?{...t.session,pullRequest:s.pullRequest}:s);break}case"sessionDeleted":{const s=t.sessionId;o.sessions=o.sessions.filter(r=>r.id!==s),delete o.tasksBySession[s],delete o.goalBySession[s],delete o.goalVersionBySession[s],delete o.approvalsBySession[s],delete o.questionsBySession[s],delete o.lastSeqBySession[s],delete o.turnActiveBySession[s],delete o.turnErrorBySession[s],delete o.turnRetryBySession[s],o.activeSessionId===s&&(o.activeSessionId=void 0);break}case"sessionWorkChanged":{if(!Zy(e,n))break;let s;o.sessions=o.sessions.map(r=>r.id!==t.sessionId?r:(s=t.pendingInteraction??(t.busy?r.pendingInteraction:"none"),{...r,busy:t.busy,mainTurnActive:t.mainTurnActive??(t.busy?r.mainTurnActive:!1),pendingInteraction:s,lastTurnReason:t.lastTurnReason})),s==="none"?(delete o.approvalsBySession[t.sessionId],delete o.questionsBySession[t.sessionId]):s==="question"&&delete o.approvalsBySession[t.sessionId],t.mainTurnActive===!0?o.turnActiveBySession[t.sessionId]=!0:(t.mainTurnActive===!1||!t.busy)&&(delete o.turnActiveBySession[t.sessionId],delete o.turnRetryBySession[t.sessionId]);break}case"sessionMetaUpdated":{o.sessions=o.sessions.map(s=>s.id===t.sessionId?{...s,title:t.title??s.title,lastPrompt:t.lastPrompt??s.lastPrompt}:s);break}case"sessionUsageUpdated":{o.sessions=o.sessions.map(s=>{if(s.id!==t.sessionId)return s;const r=t.model&&t.model.length>0?t.model:s.model;return{...s,usage:t.usage,model:r}});break}case"historyCompacted":break;case"compactionStarted":{o.compactionBySession={...o.compactionBySession,[t.sessionId]:{status:"running",trigger:t.trigger}};break}case"compactionCompleted":{const s=t.sessionId,{[s]:r,...l}=o.compactionBySession;o.compactionBySession=l;break}case"compactionCancelled":{const{[t.sessionId]:s,...r}=o.compactionBySession;o.compactionBySession=r;break}case"messageCreated":case"messageUpdated":case"assistantDelta":case"toolOutput":break;case"approvalRequested":{const s=t.sessionId,r=o.approvalsBySession[s]??[];r.some(u=>u.approvalId===t.approval.approvalId)||(o.approvalsBySession[s]=[...r,t.approval]);const a=t.approval.display;a?.kind==="plan_review"&&typeof a.plan=="string"&&a.plan.length>0&&(o.planReviewByToolCallId={...o.planReviewByToolCallId,[t.approval.toolCallId]:{plan:a.plan,path:typeof a.path=="string"?a.path:void 0}});break}case"approvalResolved":case"approvalExpired":{const s=t.sessionId,r=t.approvalId,l=o.approvalsBySession[s]??[];o.approvalsBySession[s]=l.filter(a=>a.approvalId!==r);break}case"questionRequested":{const s=t.sessionId,r=o.questionsBySession[s]??[];r.some(a=>a.questionId===t.question.questionId)||(o.questionsBySession[s]=[...r,t.question]);break}case"questionAnswered":case"questionDismissed":{const s=t.sessionId,r=t.questionId,l=o.questionsBySession[s]??[];o.questionsBySession[s]=l.filter(a=>a.questionId!==r);break}case"taskCreated":{const s=t.sessionId,r=o.tasksBySession[s]??[],l=r.findIndex(f=>f.id===t.task.id),a=t.task.backgroundTaskId===void 0?-1:r.findIndex(f=>f.id===t.task.backgroundTaskId),u=a!==-1&&l!==-1&&a!==l?r[a]:void 0,c=u!==void 0?r.filter((f,h)=>h!==a):r,d=c.findIndex(f=>f.id===t.task.id||t.task.backgroundTaskId!==void 0&&f.id===t.task.backgroundTaskId);if(d===-1)o.tasksBySession[s]=[...c,t.task];else{const f=[...c],h=c[d],m=t.task.backgroundTaskId!==void 0&&(t.task.backgroundTaskId===h.backgroundTaskId||h.id===t.task.backgroundTaskId)||h.id===t.task.id&&(h.kind!=="subagent"||h.agentId===void 0),g=(m&&h.status!=="running"?h:void 0)??(u!==void 0&&u.status!=="running"?u:void 0),y=g!==void 0&&(t.task.status==="running"||t.task.status!==g.status),k=!m&&h.status!=="running"||t.task.backgroundTaskId!==void 0&&h.backgroundTaskId!==void 0&&t.task.backgroundTaskId!==h.backgroundTaskId,v=m&&h.completedAt!==void 0&&h.completedAtEstimated!==!0;f[d]={...t.task,status:y?g.status:t.task.status,subagentPhase:y?g.subagentPhase:t.task.subagentPhase,completedAt:y?g.completedAt:v?h.completedAt:t.task.completedAt,completedAtEstimated:y?g.completedAtEstimated:v?h.completedAtEstimated:t.task.completedAtEstimated,outputLines:y?g.outputLines:k?u?.outputLines??t.task.outputLines:h.outputLines??u?.outputLines??t.task.outputLines,text:y?g.text:k?u?.text??t.task.text:h.text??u?.text??t.task.text,outputPreview:y?g.outputPreview:t.task.outputPreview??(k?u?.outputPreview:h.outputPreview??u?.outputPreview),outputBytes:y?g.outputBytes:t.task.outputBytes??(k?u?.outputBytes:h.outputBytes??u?.outputBytes),description:t.task.description===ID&&h.description!==ID?h.description:t.task.description,swarmIndex:t.task.swarmIndex??h.swarmIndex,parentToolCallId:t.task.parentToolCallId??h.parentToolCallId,subagentType:t.task.subagentType??h.subagentType,model:t.task.model??h.model,thinkingEffort:t.task.thinkingEffort??h.thinkingEffort,runInBackground:k?t.task.runInBackground:t.task.runInBackground??h.runInBackground,backgroundTaskId:k?t.task.backgroundTaskId:t.task.backgroundTaskId??h.backgroundTaskId,agentId:t.task.agentId??h.agentId},o.tasksBySession[s]=f}break}case"taskProgress":{const s=t.sessionId,r=o.tasksBySession[s]??[];o.tasksBySession[s]=r.map(l=>{if(l.id!==t.taskId)return l;if(l.kind==="subagent"&&t.kind==="text")return{...l,text:(l.text??"")+t.outputChunk};const a=l.outputLines??[];if(t.replace===!0){const c=a.length>0?[...a.slice(0,-1),t.outputChunk]:[t.outputChunk];return{...l,outputLines:c}}if(a.at(-1)===t.outputChunk)return l;const u=[...a,t.outputChunk];return{...l,outputLines:l.kind==="subagent"?u:u.slice(-40)}});break}case"taskCompleted":{const s=t.sessionId,r=o.tasksBySession[s]??[];o.tasksBySession[s]=r.map(l=>l.id!==t.taskId&&l.backgroundTaskId!==t.taskId||t.status==="completed"&&(l.status==="cancelled"||l.status==="failed")||t.status==="failed"&&l.status==="cancelled"?l:{...l,status:t.status,completedAt:l.completedAt??new Date().toISOString(),completedAtEstimated:l.completedAt===void 0?!0:l.completedAtEstimated,outputPreview:t.outputPreview??l.outputPreview,outputBytes:t.outputBytes??l.outputBytes});break}case"goalUpdated":{const s=t.sessionId;o.goalVersionBySession[s]=(o.goalVersionBySession[s]??0)+1,t.goal===null||t.goal.status==="complete"?delete o.goalBySession[s]:o.goalBySession[s]=t.goal;break}case"configChanged":{o.config=t.config;break}case"modelCatalogChanged":break;case"agentDelta":case"agentTurnEnded":break;case"promptCompleted":case"promptAborted":break;case"turnActiveChanged":{if(!Zy(e,n))break;if(o.sessions=o.sessions.map(s=>s.id===t.sessionId?{...s,mainTurnActive:t.active}:s),t.active)o.turnActiveBySession[t.sessionId]=!0,delete o.turnErrorBySession[t.sessionId],delete o.turnRetryBySession[t.sessionId];else{delete o.turnActiveBySession[t.sessionId],delete o.turnRetryBySession[t.sessionId];const s=t.reason===void 0||t.reason==="completed"?"completed":"failed",r=o.tasksBySession[t.sessionId];r!==void 0&&(o.tasksBySession[t.sessionId]=r.map(l=>l.kind!=="subagent"||l.status!=="running"||l.runInBackground===!0?l:{...l,status:s,subagentPhase:s,completedAt:l.completedAt??new Date().toISOString(),completedAtEstimated:l.completedAt===void 0?!0:l.completedAtEstimated,suspendedReason:void 0}))}break}case"turnRetry":{if(!Zy(e,n))break;t.retry===void 0?delete o.turnRetryBySession[t.sessionId]:o.turnRetryBySession[t.sessionId]=t.retry;break}case"unknown":{const s=t.raw;if(!(s&&s._noop===!0))if(s&&s._agentError){if(Zy(e,n)){if(n.sessionId!==void 0){const r=s.details??{};o.turnErrorBySession[n.sessionId]={code:s.code,message:s.message,name:s.name,retryable:s.retryable,statusCode:typeof r.statusCode=="number"?r.statusCode:void 0,requestId:typeof r.requestId=="string"?r.requestId:void 0}}(n.sessionId===void 0||n.sessionId!==e.activeSessionId)&&(o.warnings=[...o.warnings,XA(s,i.t)])}}else if(s&&s._agentWarning){const r=s.message??s.code??i.t("warnings.agentWarningFallback");o.warnings=[...o.warnings,`${i.t("warnings.noteLabel")}: ${r}`]}else{const r=s?.type??"(unknown)";o.warnings=[...o.warnings,i.t("warnings.unhandledEvent",{type:r})]}break}}return o}function v6e(e,t){if(e===t)return!0;const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(const o of n)if(e[o]!==t[o])return!1;return!0}function y6e(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n]*)>([\s\S]*?)<\/notification>/g,b6e=/([\w-]+)="([^"]*)"/g,w6e=/]*)>[\s\S]*?<\/output-file>/,C6e=/]*)>([\s\S]*?)<\/output-preview>/,A6e=/^Title: (.*)$/m,x6e=/^Severity: (.*)$/m;function Z9(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function B8(e){const t={};for(const n of e.matchAll(b6e))n[1]!==void 0&&n[2]!==void 0&&(t[n[1]]=Z9(n[2]));return t}function S6e(e,t,n){const i=B8(e),o=A6e.exec(t)?.[1]?.trim()??"",s=x6e.exec(t)?.[1]?.trim()??"";let r=t.split(` +`).filter(f=>!f.startsWith("Title: ")&&!f.startsWith("Severity: ")).join(` +`);const l=r.search(/^<\w/m);l!==-1&&(r=r.slice(0,l)),r=r.trim();const a=w6e.exec(t),u=a?(()=>{const f=B8(a[1]??""),h=Number(f.bytes);return f.path!==void 0&&f.path!==""?{path:f.path,bytes:Number.isFinite(h)?h:void 0}:void 0})():void 0,c=C6e.exec(t),d=c?(()=>{const f=B8(c[1]??""),h=(c[2]??"").replace(/^\n/,""),m=h.indexOf(` +`),g=Z9(m===-1?"":h.slice(m+1)).replace(/\n$/,""),y=Number(f.bytes),k=Number(f.total_bytes);return{text:g,bytes:Number.isFinite(y)?y:void 0,totalBytes:Number.isFinite(k)?k:void 0,truncated:f.truncated==="true"?!0:f.truncated==="false"?!1:void 0}})():void 0;return{id:i.id??"",category:i.category??"",type:i.type??"",sourceKind:i.source_kind??"",sourceId:i.source_id??"",agentId:i.agent_id,title:Z9(o),severity:s,body:Z9(r),outputFile:u,outputPreview:d,raw:n}}function _6e(e){if(!e.includes("(/^Background (process|agent)$/.test(u.description)&&(u={...u,description:""}),u),r=E6e.exec(n);if(r?.[1]!==void 0&&r[2]!==void 0)return s({status:r[2]==="timed out"?"timed_out":r[2],description:r[1],reason:r[3],rest:o});const l=L6e.exec(n);if(l?.[1]!==void 0)return s({status:"killed",description:l[1],userStopped:l[2]!==void 0,reason:l[3],rest:o});const a=N6e.exec(n);if(a?.[1]!==void 0&&a[2]!==void 0)return s({status:a[2]==="was killed"?"killed":a[2]==="timed out"?"timed_out":a[2],description:a[1],reason:a[3],rest:o})}function D6e(e){if(!WU(e.title))return;const t=F6e(e.body);if(!(t===void 0||t.status!==_b(e)))return t}const R6e=1e6,MD=5e3;function hc(e){return e===""?[]:e.endsWith(` +`)?e.slice(0,-1).split(` +`):e.split(` +`)}const qU="\0";function TD(e){return e===""||e.endsWith(` +`)?e:`${e}${qU}`}function UU(e,t){const n=Ib(TD(e),TD(t));return n===null?null:n.map(i=>i.text.endsWith(qU)?{...i,text:i.text.slice(0,-1)}:i)}function Ib(e,t){const n=hc(e),i=hc(t),o=n.length,s=i.length;if(o===0&&s===0)return[];if(o>MD||s>MD||(o+1)*(s+1)>R6e)return null;const r=Array.from({length:o+1},()=>Array.from({length:s+1},()=>0));for(let h=1;h<=o;h++)for(let m=1;m<=s;m++)r[h][m]=n[h-1]===i[m-1]?r[h-1][m-1]+1:Math.max(r[h-1][m],r[h][m-1]);const l=[];let a=o,u=s;for(;a>0||u>0;)a>0&&u>0&&n[a-1]===i[u-1]?(l.push({type:"context",text:n[a-1]}),a--,u--):u>0&&(a===0||r[a][u-1]>=r[a-1][u])?(l.push({type:"add",text:i[u-1]}),u--):(l.push({type:"del",text:n[a-1]}),a--);l.reverse();const c=[];let d=1,f=1;for(const h of l)h.type==="context"?(c.push({type:"context",text:h.text,oldNo:d,newNo:f}),d++,f++):h.type==="add"?(c.push({type:"add",text:h.text,newNo:f}),f++):(c.push({type:"del",text:h.text,oldNo:d}),d++);return c}const ED=500;function LD(e,t){const n=[],i=hc(e),o=hc(t),s=Math.min(i.length,ED),r=Math.min(o.length,ED);for(let l=1;l<=s;l++)n.push({type:"del",text:i[l-1],oldNo:l});i.length>s&&n.push({type:"context",text:`… ${i.length-s} more lines …`});for(let l=1;l<=r;l++)n.push({type:"add",text:o[l-1],newNo:l});return o.length>r&&n.push({type:"context",text:`… ${o.length-r} more lines …`}),n}function O6e(e){let t=0,n=0;for(const i of e)i.type==="add"?t++:i.type==="del"&&n++;return{added:t,removed:n}}function td(e){const t=e;return t?.kind!=="user"||!Array.isArray(t.skillActivations)?[]:t.skillActivations.flatMap(n=>{if(typeof n!="object"||n===null)return[];const i=n;return typeof i.skillName!="string"?[]:[{name:i.skillName,...typeof i.skillArgs=="string"?{args:i.skillArgs}:{}}]})}function P6e(e){return{content:e.content,skillActivations:td(e.metadata?.origin)}}function X0(e,t){return e.length===t.length&&e.every((n,i)=>{const o=t[i];return o!==void 0&&n.name===o.name&&n.args===o.args})}const B6e=/^read[_-]?media(?:file)?$/i,$6e=/^data:([^;]+);base64,(.*)$/s,z6e=/^<(image|video|audio)\s+path="([^"]+)">$/,j6e=/^<(image|video|audio)\s+path="([^"]+)">(?:<\/\1>)?$/,H6e=/Mime type:\s*([^.\s]+)/i,W6e=/Size:\s*(\d+)\s*bytes/i,q6e=/Original dimensions:\s*(\d+)x(\d+)\s*pixels/i,U6e="Image compressed to fit model limits:",V6e=/Image compressed to fit model limits:[\s\S]*?<\/system>/g;function ND(e){return e.includes(U6e)?e.replace(V6e,""):e}function K6e(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function FD(e){const t=j6e.exec(e.trim());return t?{kind:t[1],path:K6e(t[2])}:null}const VU=/^f_(?:[0-9A-Za-z]{26}|[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})$/,Z6e=/f_(?:[0-9A-Za-z]{26}|[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})$/;function e6(e){const t=e.split(/[\\/]/).at(-1)??"",n=t.lastIndexOf("."),i=n>0?t.slice(0,n):t;return VU.test(i)?i:void 0}const Gc='Attached file "',KU=" — open it with the Read tool";function G6e(e,t,n,i){const o=`-${e}`,s=i.endsWith(o)?i.slice(0,-o.length):i,r=Z6e.exec(s)?.[0];return{name:e,mediaType:t,size:Number(n),fileId:r!==void 0&&VU.test(r)?r:void 0}}const ZU="attachmentRecords",Q6e=65536;function Y6e(e,t,n){const i=t+Gc.length,o=e.slice(i,n),s=o.indexOf('" (');if(s<=0)return!1;const r=o.indexOf(", ",s+3);if(r<=s+3)return!1;let l=i+r+2;if(l>=n||e.charCodeAt(l)<48||e.charCodeAt(l)>57)return!1;for(;l=48&&e.charCodeAt(l)<=57;)l++;return e.startsWith(" bytes): ",l)}function J6e(e,t,n){let i=e.indexOf(Gc,t);for(;i>=0&&i=n?n:s;if(Y6e(e,i,r))return i;if(s<0||s>=n)return-1;i=s}return-1}function X6e(e,t){const n=t+Gc.length,i=Math.min(e.length,n+Q6e),o=e.slice(n,i),s=o.indexOf('" (');if(s<=0)return null;const r=n+s,l=o.indexOf(", ",s+3);if(l<=s+3)return null;const a=n+l+2;let u=a;for(;u=48&&e.charCodeAt(u)<=57;)u++;if(u===a||!e.startsWith(" bytes): ",u))return null;const c=e.slice(a,u),d=u+9,f=J6e(e,r,i),h=f>=0?Math.min(f,i):i,m=e.slice(d,h),g=o.slice(0,s),y=`-${g}${KU}`;let k=m.lastIndexOf(y);for(;k>=0;){const C=m.slice(0,k),w=Math.max(C.lastIndexOf("/"),C.lastIndexOf("\\"));if(!/\s/.test(C.slice(w+1)))break;k=m.lastIndexOf(y,k-1)}if(k<0)return null;const v=m.slice(0,k+1+g.length);return{start:t,end:d+k+y.length,info:G6e(g,o.slice(s+3,l),c,v)}}function gS(e){if(!e.includes(KU))return[];const t=[];let n=e.indexOf(Gc);for(;n>=0;){const i=X6e(e,n);n=i?e.indexOf(Gc,i.end):e.indexOf(Gc,n+Gc.length),i&&t.push(i)}return t}function DD(e){const t=gS(e);if(t.length===0)return e;let n="",i=0;for(const o of t)n+=e.slice(i,o.start),i=o.end;return n+e.slice(i)}function e7e(e){const t=[];for(const o of e.content)o.type==="file"&&t.push({fileId:o.fileId,name:o.name});const n=[...t],i=e.metadata?.[ZU];if(Array.isArray(i))for(const o of i){if(typeof o!="object"||o===null)continue;const s=o.fileId,r=o.name,l={fileId:typeof s=="string"&&s.length>0?s:void 0,name:typeof r=="string"&&r.length>0?r:void 0},a=n.findIndex(u=>l.fileId!==void 0?u.fileId===l.fileId:u.fileId===void 0&&u.name===l.name);a>=0?n.splice(a,1):t.push(l)}return t.length>0?t:null}function t7e(e){const t=e7e(e);if(t)return{kind:"paired",records:t};let n=0;for(const s of e.content)if(s.type==="text")for(const r of t6(s.text))n=Math.max(n,r);const i=e.metadata?.origin;for(const s of[i?.skillArgs,i?.commandArgs])if(typeof s=="string")for(const r of t6(s))n=Math.max(n,r);if(n===0)return{kind:"legacy"};let o=0;for(const s of e.content)s.type==="text"&&(o+=gS(s.text).length);return{kind:"pill",keepLast:n,total:o}}function n7e(e){let t=0;const n=e.kind==="pill"?Math.max(0,e.total-e.keepLast):0;return i=>{const o=gS(i);if(o.length===0)return{notices:[],text:i};const s=[];for(const a of o){const u=t++;if(e.kind==="legacy")s.push(a);else if(e.kind==="pill")u>=n&&s.push(a);else{const c=a.info.fileId,d=e.records.findIndex(f=>c!==void 0?f.fileId===c:f.fileId===void 0&&f.name===a.info.name);d>=0&&(e.records.splice(d,1),s.push(a))}}if(s.length===0)return{notices:[],text:i};let r="",l=0;for(const a of s)r+=i.slice(l,a.start),l=a.end;return{notices:s.map(a=>a.info),text:r+i.slice(l)}}}const i7e=/(?=0&&e[i]==="\\";)n+=1,i-=1;return n%2===1}function GU(e){let t="",n=0,i=0;for(;i0?t:void 0}return[JSON.stringify(e)]}}function d7e(e,t){if(hr(e)==="task")for(const n of t??[]){const i=/^agent_id:\s*(\S+)\s*$/.exec(n);if(i?.[1])return i[1]}}function f7e(e,t){return{id:e.agentId??e.id,toolCallId:e.parentToolCallId,name:e.description,kind:e.kind,subagentType:e.subagentType,prompt:e.command??t,model:e.model,thinkingEffort:e.thinkingEffort,phase:e.status==="completed"?"completed":e.status==="failed"?"failed":e.status==="cancelled"?"cancelled":e.subagentPhase??"working",status:e.status,summary:e.outputPreview,outputLines:e.outputLines,text:e.text,suspendedReason:e.suspendedReason,swarmIndex:e.swarmIndex}}function QU(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const i=typeof t.path=="string"?t.path:"";if(Array.isArray(t.diff))return{kind:"diff",path:i,diff:t.diff};const o=typeof t.old_text=="string"?t.old_text:typeof t.before=="string"?t.before:void 0,s=typeof t.new_text=="string"?t.new_text:typeof t.after=="string"?t.after:void 0;if(o!==void 0&&s!==void 0){const r=UU(o,s)??LD(o,s);return{kind:"diff",path:i,diff:r}}return{kind:"diff",path:i,diff:[]}}if(n==="file_io"){const i=typeof t.path=="string"?t.path:"",o=typeof t.operation=="string"?t.operation:"";if(o==="write"&&typeof t.content=="string")return{kind:"file",path:i,content:t.content};if(o==="edit"&&typeof t.before=="string"&&typeof t.after=="string"){const r=Ib(t.before,t.after)??LD(t.before,t.after);return{kind:"diff",path:i,diff:r}}const s=typeof t.detail=="string"?t.detail:void 0;return{kind:"fileop",op:o||n,path:i,detail:s}}if(n==="shell"||n==="command"){const i=typeof t.command=="string"?t.command:e.action;return{kind:"shell",command:i,cwd:typeof t.cwd=="string"?t.cwd:void 0,danger:typeof t.danger=="string"?t.danger:Uae(i)}}if(n==="file_content"||n==="file")return{kind:"file",path:typeof t.path=="string"?t.path:"",content:typeof t.content=="string"?t.content:"",language:typeof t.language=="string"?t.language:void 0};if(n==="file_op"||n==="fileop")return{kind:"fileop",op:typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,path:typeof t.path=="string"?t.path:"",detail:typeof t.detail=="string"?t.detail:void 0};if(n==="url_fetch"||n==="url")return{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:typeof t.url=="string"?t.url:e.action};if(n==="search")return{kind:"search",query:typeof t.query=="string"?t.query:e.action,scope:typeof t.scope=="string"?t.scope:void 0};if(n==="invocation"||n==="agent_call"||n==="skill_call")return{kind:"invocation",kind2:typeof t.kind=="string"?t.kind:n,name:typeof t.name=="string"?t.name:e.toolName,description:typeof t.description=="string"?t.description:void 0};if(n==="todo"||n==="todo_list")return{kind:"todo",items:(Array.isArray(t.items)?t.items:[]).map(s=>{const r=s??{};return{title:typeof r.title=="string"?r.title:"",status:typeof r.status=="string"?r.status:"pending"}})};if(n==="plan_review"){const i=typeof t.plan=="string"?t.plan:"",o=typeof t.path=="string"?t.path:void 0,r=(Array.isArray(t.options)?t.options:[]).map(l=>{const a=l??{},u=typeof a.label=="string"?a.label:"";if(!u)return null;const c=typeof a.description=="string"?a.description:void 0;return{label:u,description:c}}).filter(l=>l!==null);return{kind:"plan_review",plan:i,path:o,options:r.length>0?r:void 0}}return{kind:"generic",summary:e.action}}function YU(e){const t=` +`,n=` +`,i=e.indexOf(t),o=e.lastIndexOf(n);return i>=0&&o>=i+t.length?e.slice(i+t.length,o):h7e(e)}function h7e(e){const t=e.split(` +`);return t.length>=2&&t[0]?.startsWith(""?t.slice(1,-1).join(` +`):e}function p7e(e){const t=e.metadata?.origin;if(t?.kind==="cron_job"||t?.kind==="cron_missed")return t.kind}function m7e(e){const t=e.content.filter(n=>n.type==="text").map(n=>n.text).join(` +`);return YU(t)}function g7e(e,t){const n=e.metadata?.origin??{},i=m7e(e);return t==="cron_missed"?{text:i,cron:{missedCount:typeof n.count=="number"?n.count:void 0}}:{text:i,cron:{jobId:typeof n.jobId=="string"?n.jobId:void 0,cron:typeof n.cron=="string"?n.cron:void 0,recurring:typeof n.recurring=="boolean"?n.recurring:void 0,coalescedCount:typeof n.coalescedCount=="number"?n.coalescedCount:void 0,stale:typeof n.stale=="boolean"?n.stale:void 0}}}function v7e(e,t,n){const{text:i,cron:o}=g7e(e,n);return{id:e.id,role:"cron",no:t,text:i,createdAt:e.createdAt,cron:o}}function y7e(e){const t=e.metadata?.origin,n=t?.kind;return n===void 0||n==="user"?!0:n==="skill_activation"||n==="plugin_command"?t?.trigger==="user-slash":!1}function k7e(e){const t=e.metadata?.["kimiWeb.steeredPromptIds"];if(Array.isArray(t)){const i=t.filter(o=>typeof o=="string"&&o.length>0);if(i.length>0)return i}if(e.promptId!==void 0&&e.promptId.length>0)return[e.promptId];const n=e.metadata?.["kimiWeb.promptId"];if(typeof n=="string"&&n.length>0)return[n]}function b7e(e){return e.metadata?.origin?.kind==="compaction_summary"}function w7e(e,t){return e===null?!1:e.promptId===void 0||t===void 0||e.promptId===t}function C7e(e){if(!e||e.length===0)return;const t="Plan saved to: ";for(const n of e)if(n.startsWith(t))return n.slice(t.length).trim()}function A7e(e){const t=[];for(const n of e){const i=t.at(-1);n.type==="text"&&i?.type==="text"?i.text+=n.text:n.type==="thinking"&&i?.type==="thinking"?i.thinking+=n.thinking:n.type==="thinking"?t.push({type:"thinking",thinking:n.thinking}):t.push({...n})}return JSON.stringify(t)}function iw(e,t,n,i=!0,o={},s={},r){const l=[];let a=r?.startNo??1;const u=r?.collect,c=new Map;for(const g of t)c.set(g.toolCallId,g);let d=null;function f(g=!1){if(!d)return;const y=d;if(d=null,!g&&y.blocks.length===0&&y.textParts.length===0&&y.thinkingParts.length===0&&y.tools.length===0)return;if(!g||!i)for(let C=0;CE.kind==="tool"&&E.tool.id===M.id);L&&L.kind==="tool"&&(L.tool=M)}const k=y.sources.find(C=>C.daemonTurnId!==void 0),v={id:y.id,sessionId:y.sources.find(C=>C.sessionId)?.sessionId||void 0,role:"assistant",no:a++,text:y.textParts.join(` +`),thinking:y.thinkingParts.length>0?y.thinkingParts.join(` +`):void 0,tools:y.tools.length>0?y.tools:void 0,blocks:y.blocks.length>0?y.blocks:void 0,approval:y.approval,approvalId:y.approvalId,durationMs:y.durationMs,createdAt:y.createdAt,endedAt:y.endedAt,goalContinuation:y.goalContinuation,daemonTurnId:k?.daemonTurnId,daemonTurnState:k?.daemonTurnState};l.push(v),u?.(v,y.sources)}function h(g,y){let k=null;for(const v of y)if(v.type==="text"){if(v.text){k==="text"?g.textParts[g.textParts.length-1]+=v.text:g.textParts.push(v.text);const C=g.blocks.at(-1);C&&C.kind==="text"?C.text+=(k==="text"?"":` +`)+v.text:g.blocks.push({kind:"text",text:v.text}),k="text"}}else if(v.type==="thinking"){if(v.thinking){k==="thinking"?g.thinkingParts[g.thinkingParts.length-1]+=v.thinking:g.thinkingParts.push(v.thinking);const C=g.blocks.at(-1);if(C&&C.kind==="thinking"){C.thinking+=(k==="thinking"?"":` +`)+v.thinking;const w=[C.startedAt,v.startedAt].filter(E=>E!==void 0).sort()[0],M=C.startedAt!==void 0&&C.durationMs===void 0||v.startedAt!==void 0&&v.durationMs===void 0,L=[C,v].flatMap(E=>E.startedAt!==void 0&&E.durationMs!==void 0?[Date.parse(E.startedAt)+E.durationMs]:[]);C.startedAt=w,C.durationMs=!M&&w!==void 0&&L.length>0?Math.max(...L)-Date.parse(w):void 0}else g.blocks.push({kind:"thinking",thinking:v.thinking,startedAt:v.startedAt,durationMs:v.durationMs});k="thinking"}}else if(v.type==="toolUse"){k=null;const C=c.get(v.toolCallId),w=v.toolName==="ExitPlanMode"?s[v.toolCallId]:void 0,M={id:v.toolCallId,name:v.toolName,arg:typeof v.input=="string"?v.input:JSON.stringify(v.input),agentId:hr(v.toolName)==="task"?v.agentRefs?.find(L=>L.role!=="member")?.agentId??v.agentRefs?.[0]?.agentId:void 0,status:"running",output:v.outputLines,plan:w,planPath:v.toolName==="ExitPlanMode"?w?.path??o[v.toolCallId]?.path:void 0};g.tools.push(M),g.blocks.push({kind:"tool",tool:M}),C&&(g.approval=QU(C),g.approvalId=C.approvalId)}else if(v.type==="toolResult"){k=null;const C=g.tools.findIndex(w=>w.id===v.toolCallId);if(C!==-1){const w=g.tools[C],M=vS(v.output),L={...w,status:v.isError?"error":"ok",output:M,media:v.isError?void 0:c7e(w.name,v.output),agentId:w.agentId??d7e(w.name,M)};L.name==="ExitPlanMode"&&!L.planPath&&(L.planPath=C7e(L.output)),g.tools[C]=L;const E=g.blocks.find(S=>S.kind==="tool"&&S.tool.id===v.toolCallId);E&&E.kind==="tool"&&(E.tool=L)}}else k=null}function m(g,y){if(g.type==="image"||g.type==="video"){const k=g.type,v=g.source;if(v.kind==="url")return{url:v.url,kind:k};if(v.kind==="base64")return{url:`data:${v.mediaType};base64,${v.data}`,kind:k};if(v.kind==="file"&&n)return{url:n(v.fileId),kind:k,fileId:v.fileId};if(v.kind==="sessionMedia")return{url:r?.getSessionMediaUrl?.(y,v.fileId)??"",kind:k,fileId:v.fileId,sessionId:y}}if(g.type==="file"&&n){if(g.mediaType.startsWith("image/"))return{url:n(g.fileId),kind:"image",fileId:g.fileId};if(g.mediaType.startsWith("video/"))return{url:n(g.fileId),kind:"video",fileId:g.fileId}}}for(const g of e){if(g.role==="system")continue;if(b7e(g)){f();const w=g.metadata?.[tj],M={id:g.id,role:"compaction",no:a,text:g.content.filter(L=>L.type==="text").map(L=>L.text).join(` +`),compaction:{trigger:w?.trigger,tokensBefore:w?.tokensBefore,tokensAfter:w?.tokensAfter}};l.push(M),u?.(M,[g]);continue}if(g.role==="user"){const w=p7e(g),M=g.metadata?.origin?.kind,L=M==="skill_activation"&&g.metadata?.origin?.trigger!=="user-slash";if(w===void 0&&(M==="injection"||L))continue;if(w===void 0&&(M==="task"||M==="background_task"||M==="task_notification")){const J=g.content.filter(ue=>ue.type==="text").map(ue=>ue.text).join(` +`),U=I6e(g.metadata),Q=U!==void 0?[U]:_6e(J);if(Q.length>0){d??={id:g.id,promptId:void 0,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,sources:[g],createdAt:g.createdAt};for(const ue of Q)d.blocks.push({kind:"notification",notification:{...ue,createdAt:g.createdAt}})}continue}if(f(),w!==void 0){const J=v7e(g,a++,w);l.push(J),u?.(J,[g]);continue}if(M==="system_trigger"&&g.metadata?.origin?.name==="goal_continuation"){d={id:g.id,promptId:void 0,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,sources:[g],createdAt:g.createdAt,goalContinuation:!0};continue}if(!y7e(g))continue;const E=g.metadata?.origin,S=E?.kind==="skill_activation"&&E?.trigger==="user-slash",x=E?.kind==="plugin_command"&&E?.trigger==="user-slash",A=P6e(g),T=A.skillActivations,I=A.content,O=[];let H=[];const R=n7e(t7e(g)),F=new Set,P=J=>{const U={kind:"file",url:J.fileId&&n?n(J.fileId):"",fileId:J.fileId,name:J.name,mediaType:J.mediaType,size:J.size};H.push(U),F.add(U)};for(const J of I){if(J.type==="text")if(S){const Q=FD(J.text);if(Q&&(Q.kind==="video"||Q.kind==="image")&&n){const ue=e6(Q.path);if(ue){H.push({url:n(ue),kind:Q.kind,fileId:ue});continue}}for(const ue of R(J.text).notices)P(ue)}else if(x)O.push(E.commandArgs??"");else{const Q=FD(J.text);if(Q&&(Q.kind==="video"||Q.kind==="image")&&n){const pe=e6(Q.path);if(pe){H.push({url:n(pe),kind:Q.kind,fileId:pe});continue}}const ue=R(J.text);if(ue.notices.length>0){for(const ee of ue.notices)P(ee);if(ue.text.trim().length===0)continue;const pe=ND(ue.text);if(pe!==ue.text&&pe.trim().length===0)continue;O.push(pe);continue}const me=ND(J.text);if(me!==J.text&&me.trim().length===0)continue;O.push(me)}const U=m(J,g.sessionId);if(U){H.push({url:U.url,kind:U.kind,name:J.type==="file"?J.name:void 0,fileId:U.fileId,sessionId:U.sessionId});continue}J.type==="file"&&n&&H.push({kind:"file",url:n(J.fileId),fileId:J.fileId,name:J.name,mediaType:J.mediaType||void 0,size:J.size})}const z=new Map;for(const J of F){if(J.fileId===void 0)continue;const U=`${J.kind}|${J.fileId}`;z.set(U,(z.get(U)??0)+1)}H=H.filter(J=>{if(F.has(J)||J.fileId===void 0)return!0;const U=`${J.kind}|${J.fileId}`,Q=z.get(U)??0;return Q>0?(z.set(U,Q-1),!1):!0});const W=S?E?.skillArgs??"":O.join(` +`),$=t6(W),K=r7e(W),ne=H.filter(J=>J.kind==="file"),G=H.filter(J=>J.kind==="image"||J.kind==="video"),te=[...$].some(J=>J<=ne.length),le=[...K].some(J=>J<=G.length),ie=te||le?H:[];let _e=0,Z=0;const se=H.filter(J=>J.kind==="file"?(_e+=1,!(te&&$.has(_e))):J.kind==="image"||J.kind==="video"?(Z+=1,!(le&&K.has(Z))):!0),he=g.metadata?.["kimiWeb.steeredPromptIds"],Y={id:g.id,role:"user",no:a++,text:W,hasUndoAnchor:g.metadata?.["kimiWeb.settledWithoutEcho"]===!0||g.metadata?.["kimiWeb.steered"]===!0?!1:void 0,steered:g.metadata?.["kimiWeb.steered"]===!0||Array.isArray(he)&&he.length>0?!0:void 0,promptIds:k7e(g),attachments:se.length>0?se:void 0,inlineAttachments:ie.length>0?ie:void 0,skillActivation:S?{name:E.skillName,args:E.skillArgs}:void 0,skillActivations:T.length>0?T.map(J=>({name:J.name,args:J.args})):void 0,pluginCommand:x?{pluginId:E.pluginId,commandName:E.commandName,args:E.commandArgs}:void 0,createdAt:g.createdAt};l.push(Y),u?.(Y,[g]);continue}if(g.role==="tool"){d&&(d.sources.push(g),h(d,g.content),d.endedAt=g.createdAt);continue}const y=g.promptId;w7e(d,y)?d!==null&&d.promptId===void 0&&y!==void 0&&(d.promptId=y):(f(),d={id:g.id,promptId:y,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,sources:[],durationMs:g.durationMs,createdAt:g.createdAt});const v=d;if(v===null)continue;const C=A7e(g.content);v.promptId!==void 0&&v.seenSigs.has(C)||(v.seenSigs.add(C),v.sources.push(g),g.durationMs!==void 0&&(v.durationMs=g.durationMs),h(v,g.content),g.endedAt!==void 0?v.endedAt=g.endedAt:g.id!==v.id&&(v.endedAt=g.createdAt))}return f(!0),l}function JU(e,t,n){return e.state==="running"&&e.frames.at(-1)===t&&!n}function x7e(e,t){if(t.size===0)return;let n=!1;for(const l of t.values())if(l.settledAt===void 0){n=!0;break}if(!n)return;const i=new Date().toISOString(),o=e.items.findLast(l=>l.kind==="turn"&&l.state==="running"),s=o?.kind==="turn"?o.steps.findLast(l=>l.state==="running"):void 0,r=e.interactions.some(l=>l.state==="pending");for(const l of e.items)if(l.kind==="turn")for(const a of l.steps){const u=r&&a===s;for(const c of a.frames){if(c.kind!=="thinking")continue;const d=t.get(c.frameId);d===void 0||d.settledAt!==void 0||JU(a,c,u)||(d.settledAt=i)}}}function S7e(e,t){if(t.size===0)return;const n=new Set;for(const i of e.items)if(i.kind==="turn")for(const o of i.steps)for(const s of o.frames)s.kind==="thinking"&&n.add(s.frameId);for(const i of[...t.keys()])n.has(i)||t.delete(i)}function _7e(e,t,n,i){const o=e.items.filter(f=>f.kind==="turn"),s=o[0]?.turnId,r=o.length===1?s:void 0,l=new Map(e.tasks.map(f=>[f.taskId,f])),a=new Map(e.prompts.map(f=>[f.promptId,f])),u=eV(e.prompts,XU(e.items)),c=e.items.flatMap(f=>f.kind==="turn"?yS(f,e.attachments,l,f.turnId===s?n?.createdAt:void 0,f.turnId===r?n?.disposedAt:void 0,i?.sessionId,{promptById:a,promptForTurn:u}):[]),d=e.meta.activity==="turn";return iw(c,[],t,d,{},{},{getSessionMediaUrl:i?.getSessionMediaUrl}).map(L7e)}function RD(e){if(!Array.isArray(e))return[];const t=[];for(const n of e){if(typeof n!="object"||n===null)continue;const i=n;if(i.type!=="file")continue;const o=typeof i.fileId=="string"?i.fileId:i.file_id;t.push({fileId:typeof o=="string"?o:void 0,name:typeof i.name=="string"?i.name:void 0})}return t}function OD(e,t){return t.length===0?e:{...e,[ZU]:t}}const I7e=new Set(["user","skill_activation","plugin_command"]);function M7e(e){return(e.origin.payload??e.origin)?.kind}function T7e(e){const t=e.content;if(!Array.isArray(t))return;const n=[];for(const i of t)if(typeof i=="object"&&i!==null&&i.type==="text"){const o=i.text;typeof o=="string"&&n.push(o)}return n.join("")}function XU(e){const t=new Set;for(const n of e)if(n.kind==="turn"){for(const i of n.steps)for(const o of i.frames)if(o.kind==="text")for(const s of o.promptIds??[])t.add(s)}return t}function eV(e,t){const n=new Set(t??[]);return i=>{const o=M7e(i);if(o!==void 0&&!I7e.has(o)||i.prompt===void 0&&(i.attachmentIds??[]).length===0)return;const s=DD(i.prompt??"");for(const r of e){if(n.has(r.promptId))continue;const l=T7e(r);if(l!==void 0&&DD(l)===s)return n.add(r.promptId),r}}}function yS(e,t,n,i,o,s="",r){const l=[],a=new Map(t.map(k=>[k.attachmentId,k])),u=n6([e.startedAt,...e.steps.map(k=>k.startedAt),i])??"",c=PD(e.endedAt)??PD(o),d=e.triggerPromptId??e.turnId,f=e.origin.payload??e.origin,h=(e.attachmentIds??[]).length>0,m=r?.includeOrigin===!0&&td(f).length>0;if(e.prompt!==void 0&&e.prompt.length>0||h||m){const k=e.prompt!==void 0&&e.prompt.length>0?[{type:"text",text:e.prompt}]:[];for(const v of e.attachmentIds??[]){const C=BD(a.get(v));C!==void 0&&k.push(C)}l.push({id:`${e.turnId}:input`,sessionId:s,role:"user",content:k,createdAt:u,promptId:d,metadata:OD(r?.includeOrigin===!0||e.origin.kind==="task"&&(e.prompt??"").includes("0;if(v.role==="user"){if(v.taskId!==void 0){if(v.text.length===0&&!C)continue;const A=E7e(v.taskId,v.text,n.get(v.taskId));l.push({id:v.frameId,sessionId:s,role:"user",content:[{type:"text",text:v.text}],createdAt:k.startedAt??u,promptId:d,metadata:{origin:{kind:"task",taskId:v.taskId},[HU]:A}});continue}const w=v.text.length>0?[{type:"text",text:v.text}]:[];for(const A of v.attachmentIds??[]){const T=BD(a.get(A));T!==void 0&&w.push(T)}const M=v.promptIds?.map(A=>r?.promptById?.get(A)).find(A=>A!==void 0),L=[];for(const A of v.promptIds??[])L.push(...RD(r?.promptById?.get(A)?.content));const E=v.origin,S=td(E);if(v.text.length===0&&!C&&S.length===0)continue;const x={...S.length>0?{origin:E}:{},...(v.promptIds?.length??0)>0?{"kimiWeb.steeredPromptIds":v.promptIds}:{}};l.push({id:v.frameId,sessionId:s,role:"user",content:w,createdAt:M?.createdAt??k.startedAt??u,promptId:d,metadata:OD(Object.keys(x).length>0?x:void 0,L)});continue}if(v.text.length===0&&!C)continue;l.push({id:v.frameId,sessionId:s,role:"assistant",content:[{type:"text",text:v.text}],createdAt:k.startedAt??u,promptId:d})}else if(v.kind==="thinking"){if(v.text.length===0)continue;const C=r?.pendingInteractionAtByStepId?.get(k.stepId),w=JU(k,v,C!==void 0),M=r?.thinkingTiming,L=M?.get(v.frameId);let E,S;if(L!==void 0)L.settledAt===void 0&&!w&&(L.settledAt=new Date().toISOString()),E=L.startedAt,S=$8(L.startedAt,L.settledAt);else if(M!==void 0&&w){const x=new Date().toISOString();M.set(v.frameId,{startedAt:x}),E=x}else E=k.startedAt,S=$8(k.startedAt,n6([k.endedAt,C]));l.push({id:v.frameId,sessionId:s,role:"assistant",content:[{type:"thinking",thinking:v.text,startedAt:E,durationMs:S}],createdAt:k.startedAt??u,promptId:d})}else v.kind==="tool"&&(l.push({id:`${v.frameId}:call`,sessionId:s,role:"assistant",content:[{type:"toolUse",toolCallId:v.toolCallId,toolName:v.name,input:v.input??v.display??{},outputLines:v.state==="running"?vS(v.output):void 0,agentRefs:v.agentRefs}],createdAt:k.startedAt??u,promptId:d}),v.state!=="running"&&l.push({id:`${v.frameId}:result`,sessionId:s,role:"tool",content:[{type:"toolResult",toolCallId:v.toolCallId,output:v.output??v.error??"",isError:v.state==="error"}],createdAt:k.endedAt??k.startedAt??u,promptId:d}));const g=e.durationMs??$8(u||void 0,c),y=l.findLastIndex(k=>k.role==="assistant");y>=0&&(g!==void 0||c!==void 0)&&(l[y]={...l[y],durationMs:g,endedAt:c??l[y].endedAt});for(const k of l)k.daemonTurnId=e.ordinal,k.daemonTurnState=e.state;return l}function E7e(e,t,n){const[i="",...o]=t.split(` +`),s=n?.state??"info";return{id:`task:${e}:${s}`,category:"task",type:`task.${s}`,sourceKind:n?.kind==="subagent"?"subagent":"background_task",sourceId:e,agentId:n?.agentId,title:i.trim(),severity:s==="completed"?"info":"warning",body:o.join(` +`).trim(),raw:t}}function L7e(e){if(e.createdAt!==""&&e.endedAt!=="")return e;const t={...e};return t.createdAt===""&&delete t.createdAt,t.endedAt===""&&delete t.endedAt,t}function n6(e){let t;for(const n of e){if(n===void 0)continue;const i=Date.parse(n);Number.isFinite(i)&&(t===void 0||i=0?n:void 0}const $D=6e3,Im=256*1024,N7e=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/;function zD(e,t){return t===0?e:e-1}function F7e(e,t){const n=hc(t),i=[];let o=0;for(const s of e){if(s.type==="hunk"){const r=N7e.exec(s.text);if(!r)return null;const l=zD(Number(r[1]),r[2]===void 0?1:Number(r[2])),a=zD(Number(r[3]),r[4]===void 0?1:Number(r[4]));if(an.length)return null;for(;o=n.length||n[o]!==s.text)return null;o++,s.type==="context"&&i.push(s.text)}for(;oIm||hc(n).length>$D)return null;const i=F7e(e,n);return i===null||i.length>Im||hc(i).length>$D?null:{before:i,after:n}}const R7e=new Set(["assistantDelta","agentDelta","toolOutput","taskProgress"]);function O7e(e){return R7e.has(e.type)}const P7e=50,B7e=100,i6=32*1024,$7e={requestFrame(e){return typeof requestAnimationFrame=="function"?requestAnimationFrame(e):null},cancelFrame(e){typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(e)},requestTask(e){return setTimeout(e,P7e)},cancelTask(e){clearTimeout(e)}};function z7e(e,t,n={}){const i=n.scheduler??$7e,o=Math.max(1,Math.floor(n.maxItemsPerSlice??B7e)),s=[];let r=0,l=null,a=null,u=0,c=!1;const d=()=>s.length-r,f=()=>{u+=1,l!==null&&(i.cancelFrame(l),l=null),a!==null&&(i.cancelTask(a),a=null)},h=()=>{r===s.length?(s.length=0,r=0):r>=1024&&(s.splice(0,r),r=0)};let m;const g=()=>{if(c||l!==null||a!==null||d()===0)return;const k=++u,v=()=>{k===u&&m()};l=i.requestFrame(v),a=i.requestTask(v)};m=()=>{f();let k=0;for(;!c&&k{if(!c){if(t(k)){const v=s.length>r?s.at(-1):void 0,C=v===void 0?void 0:n.coalesce?.(v,k);C===void 0?s.push(k):s[s.length-1]=C,g();return}if(d()===0){e(k);return}s.push(k),m()}});return y.flush=()=>{if(!c){for(f();!c&&r{if(c||d()===0)return;let v=r;for(let C=r;C{c||(c=!0,f(),s.length=0,r=0)},y}function o6(e){if(e.type==="assistantDelta"){if(e.delta.text!==void 0&&e.delta.thinking===void 0)return{kind:"text",value:e.delta.text};if(e.delta.thinking!==void 0&&e.delta.text===void 0)return{kind:"thinking",value:e.delta.thinking}}}function j7e(e){if(e.appEvent.type!=="assistantDelta")return[e];const t=e.appEvent,n=e.meta.stream,i=o6(t);if(n===void 0||i===void 0||n.kind!==i.kind||i.value.length<=i6)return[e];const o=[];let s=0;for(;ss&&/[\uD800-\uDBFF]/u.test(i.value[r-1])&&/[\uDC00-\uDFFF]/u.test(i.value[r])&&(r-=1);const l=i.value.slice(s,r);o.push({appEvent:{...t,delta:i.kind==="text"?{text:l}:{thinking:l}},meta:{...e.meta,stream:{...n,offset:n.offset+s}}}),s=r}return o}function H7e(e,t){if(e.appEvent.type!=="assistantDelta"||t.appEvent.type!=="assistantDelta")return;const n=e.meta.stream,i=t.meta.stream,o=o6(e.appEvent),s=o6(t.appEvent);if(n===void 0||i===void 0||o===void 0||s===void 0||e.meta.sessionId!==t.meta.sessionId||e.appEvent.sessionId!==t.appEvent.sessionId||e.appEvent.messageId!==t.appEvent.messageId||e.appEvent.contentIndex!==t.appEvent.contentIndex||n.turnId!==i.turnId||n.kind!==i.kind||o.kind!==s.kind||n.kind!==o.kind||i.kind!==s.kind||i.offset!==n.offset+o.value.length||o.value.length+s.value.length>i6)return;const r=o.value+s.value;return{appEvent:{...e.appEvent,delta:o.kind==="text"?{text:r}:{thinking:r}},meta:{...t.meta,stream:{...n}}}}function tV(e){return Array.isArray(e)?e.filter(t=>typeof t=="object"&&t!==null&&t.type==="text").map(t=>t.text).join(""):""}function W7e(e){for(let t=e.items.length-1;t>=0;t--){const n=e.items[t];if(n.kind==="marker"){const i=n.at;if(typeof i=="string")return i;continue}if(n.kind==="turn"){let i;const o=s=>{typeof s=="string"&&(i===void 0||s>i)&&(i=s)};o(n.endedAt),o(n.startedAt);for(const s of n.steps)o(s.endedAt),o(s.startedAt);if(i!==void 0)return i}}}function q7e(e,t){if(t===void 0)return;const n=e.find(i=>i.kind==="turn"&&i.turnId===t);return n?.kind==="turn"?n.startedAt:void 0}function wp(e,t){const n=q7e(e,t?.["kimiWeb.anchorTurnId"]),i=t?.["kimiWeb.anchorPromptCreatedAt"];return typeof i=="string"&&(n===void 0||i>=n)?{at:i,exclusive:!0}:n!==void 0?{at:n,exclusive:!1}:void 0}function kS(e,t,n){const i=new Map,o=new Set(n??[]);for(const s of e){if(s.skills.length>0)continue;const r=t.find(l=>!o.has(l.promptId)&&l.status!=="queued"&&(s.floor===void 0||(s.floor.exclusive?l.createdAt>s.floor.at:l.createdAt>=s.floor.at))&&tV(l.content)===s.text);r!==void 0&&(o.add(r.promptId),i.set(s.id,r.promptId))}return i}function bS(e,t,n){const i=[];for(const r of t.items){if(r.kind!=="turn")continue;const l=td(r.origin.payload);l.length>0&&i.push({id:`turn:${r.turnId}`,text:r.prompt??"",attachmentCount:r.attachmentIds?.length??0,at:r.startedAt,skills:l})}const o=new Map,s=new Set(n??[]);for(const r of e){const l=i.find(a=>s.has(a.id)||r.floor!==void 0&&(a.at===void 0||(r.floor.exclusive?a.at<=r.floor.at:a.atr.kind==="turn"&&r.turnId===t);return t!==void 0&&s===-1?!1:e.slice(s+1).some(r=>{if(r.kind!=="marker"||r.marker!=="skill")return!1;if(o!==void 0){const a=r.at;if(typeof a!="string"||a<=o)return!1}const l=r.payload?.origin;return l?.kind==="skill_activation"&&l.skillName===n&&l.skillArgs===i})}function nV(e,t,n,i,o){const s=t===void 0?-1:e.findIndex(r=>r.kind==="turn"&&r.turnId===t);return t!==void 0&&s===-1?!1:e.slice(s+1).some(r=>{if(r.kind!=="turn"||o?.terminalOnly===!0&&r.state==="running")return!1;const l=r.origin.payload??r.origin;return l.kind==="skill_activation"&&l.skillName===n&&l.skillArgs===i})}function wS(e,t,n){const i=new Map,o=new Set(n??[]);for(const s of e){const r=s.anchorTurnId===void 0?-1:t.findIndex(a=>a.kind==="turn"&&a.turnId===s.anchorTurnId);if(s.anchorTurnId!==void 0&&r===-1)continue;const l=t.slice(r+1).find(a=>{if(a.kind==="turn"){if(o.has(a.turnId))return!1;const u=a.origin.payload??a.origin;return u.kind==="skill_activation"&&u.skillName===s.skillName&&u.skillArgs===s.skillArgs}if(a.kind==="marker"&&a.marker==="skill"){if(o.has(a.markerId))return!1;if(s.promptFloor!==void 0){const c=a.at;if(typeof c!="string"||c<=s.promptFloor)return!1}const u=a.payload?.origin;return u?.kind==="skill_activation"&&u.skillName===s.skillName&&u.skillArgs===s.skillArgs}return!1});if(l!==void 0){const a=l.kind==="turn"?l.turnId:l.markerId;o.add(a),i.set(s.id,a)}}return i}function Qs(e){return td(e?.origin)}function s6(e,t){const n=Qs(e.metadata);if(n.length===0)return!1;const i=e.content.filter(u=>u.type==="text").map(u=>"text"in u?u.text:"").join(""),o=e.content.filter(u=>u.type!=="text").length,s=e.metadata?.["kimiWeb.promptId"];if(s!==void 0)return t.items.some(c=>c.kind==="turn"&&c.steps.some(d=>d.frames.some(f=>f.kind==="text"&&f.role==="user"&&(f.promptIds?.includes(s)??!1)&&X0(td(f.origin),n))))?!0:t.items.some(c=>c.kind==="turn"&&c.triggerPromptId===s&&(c.prompt??"")===i&&(c.attachmentIds?.length??0)===o&&X0(td(c.origin.payload),n));const r=e.metadata?.["kimiWeb.anchorTurnId"],l=r===void 0?-1:t.items.findIndex(u=>u.kind==="turn"&&u.turnId===r);return r!==void 0&&l===-1?!1:(l===-1?t.items:t.items.slice(l+1)).some(u=>u.kind==="turn"&&(u.prompt??"")===i&&(u.attachmentIds?.length??0)===o&&X0(td(u.origin.payload),n))}function V7e(e,t){const i=e.items.filter(h=>h.kind==="turn")[0]?.turnId,o=new Map(e.tasks.map(h=>[h.taskId,h])),s=new Map(e.prompts.map(h=>[h.promptId,h])),r=eV(e.prompts,XU(e.items)),l=h=>h.kind==="turn"?h.origin.payload??h.origin:void 0,a=new Set,u=K7e(e.items),c=e.items.flatMap((h,m)=>{if(h.kind==="turn"){const g=u.turnPart.get(m)??h,y=g.startedAt!==void 0||g.steps.some(k=>k.startedAt!==void 0);return jD(g,e.attachments,o,h.turnId===i&&!y&&e.hasMoreOlder!==!0?t.agentCreatedAt:void 0,void 0,t.sessionId,t.pendingInteractionAtByStepId,t.thinkingTiming,s,r)}if(h.kind==="marker"&&h.marker==="compaction"){const g=Z7e(h.payload,h.at,t.sessionId,h.markerId,Q7e(e.items,m));if(g===void 0)return[];const y=u.continuation.get(h.markerId);return y===void 0?[g]:[g,...jD(y,e.attachments,o,void 0,void 0,t.sessionId,t.pendingInteractionAtByStepId,t.thinkingTiming,s,r,!0,`:${h.markerId}`)]}if(h.kind==="marker"&&h.marker==="cron.fired"){const g=h.payload,y=g?.origin?.jobId,k=typeof g?.prompt=="string"?g.prompt:void 0,v=e.items.slice(m+1).find(w=>{if(w.kind!=="turn"||a.has(w.turnId))return!1;const M=l(w);return M?.kind==="cron_job"&&(y===void 0||M.jobId===y)&&(k===void 0||w.kind==="turn"&&YU(w.prompt??"")===k)});if(v!==void 0&&v.kind==="turn")return a.add(v.turnId),[];const C=G7e(h.payload,h.at,t.sessionId,h.markerId);return C===void 0?[]:[C]}return[]}),d=e.interactions.map(h=>_1(h,t.sessionId)).filter(h=>h!==void 0),f=e.meta.activity==="turn";return iw(c,d,t.getFileUrl,f,t.planReviewByToolCallId??{},t.plansByToolCallId??{},{getSessionMediaUrl:t.getSessionMediaUrl}).map(X7e)}function K7e(e){const t=new Map,n=new Map;for(let i=0;i[]);let a=-1;for(const u of o.steps){for(;a+1=s[a+1].at;)a+=1;a<0?r.push(u):l[a].push(u)}if(r.length!==o.steps.length){t.set(i,{...o,steps:r,endedAt:r.at(-1)?.endedAt,durationMs:void 0});for(let u=0;ug.startedAt),i])??"",promptId:e.turnId,daemonTurnId:e.ordinal,daemonTurnState:e.state,metadata:{origin:f}}]:[],...yS(e,t,n,i,o,s,{includeOrigin:c!==!0,pendingInteractionAtByStepId:r,thinkingTiming:l,promptById:a,promptForTurn:u})]}function Z7e(e,t,n,i,o){const s=e;if(s?.phase!=="completed")return;const r=s.result??{},l={trigger:o,tokensBefore:typeof r.tokensBefore=="number"?r.tokensBefore:void 0,tokensAfter:typeof r.tokensAfter=="number"?r.tokensAfter:void 0};return{id:i,sessionId:n,role:"assistant",content:typeof r.summary=="string"?[{type:"text",text:r.summary}]:[],createdAt:t??"",metadata:{origin:{kind:"compaction_summary"},[tj]:l}}}function G7e(e,t,n,i){const o=e,s=o?.origin;if(!(s?.kind!=="cron_job"||typeof o?.prompt!="string"))return{id:i,sessionId:n,role:"user",content:[{type:"text",text:o.prompt}],createdAt:t??"",metadata:{origin:s}}}function Q7e(e,t){for(let n=t-1;n>=0;n--){const i=e[n];if(i?.kind!=="marker"||i.marker!=="compaction")continue;const o=i.payload;if(o?.phase==="started")return o.trigger==="manual"?"manual":"auto"}return"auto"}function _1(e,t){if(e.interactionKind!=="approval"||e.state!=="pending")return;const n=e.request??{};if(typeof n.toolName!="string"||typeof n.action!="string")return;const i=typeof e.toolCallId=="string"?e.toolCallId:typeof n.toolCallId=="string"?n.toolCallId:void 0;if(i!==void 0)return{approvalId:e.interactionId,sessionId:t,turnId:typeof n.turnId=="number"?n.turnId:void 0,toolCallId:i,toolName:n.toolName,action:n.action,display:n.display,expiresAt:"",createdAt:""}}function Hg(e,t){if(e.interactionKind!=="question"||e.state!=="pending")return;const n=e.request??{};if(!Array.isArray(n.questions))return;const i=typeof e.toolCallId=="string"?e.toolCallId:typeof n.toolCallId=="string"?n.toolCallId:typeof n.tool_call_id=="string"?n.tool_call_id:void 0;return{questionId:e.interactionId,sessionId:t,turnId:typeof n.turnId=="number"?n.turnId:typeof n.turn_id=="number"?n.turn_id:void 0,toolCallId:i,questions:n.questions.map(Y7e),createdAt:""}}function Y7e(e){const t=Array.isArray(e.options)?e.options:[];return{id:typeof e.id=="string"?e.id:"",question:typeof e.question=="string"?e.question:"",header:typeof e.header=="string"?e.header:void 0,body:typeof e.body=="string"?e.body:void 0,options:t.map(J7e),multiSelect:e.multi_select===!0,allowOther:e.allow_other===!0,otherLabel:typeof e.other_label=="string"?e.other_label:void 0,otherDescription:typeof e.other_description=="string"?e.other_description:void 0}}function J7e(e){const t=e??{};return{id:typeof t.id=="string"?t.id:"",label:typeof t.label=="string"?t.label:"",description:typeof t.description=="string"?t.description:void 0,recommended:t.recommended===!0||t.is_recommended===!0}}function X7e(e){if(e.createdAt!==""&&e.endedAt!=="")return e;const t={...e};return t.createdAt===""&&delete t.createdAt,t.endedAt===""&&delete t.endedAt,t}function exe(){let e=[];const t=(n,i)=>{const s=V7e(n,i).map((r,l)=>{const a=JSON.stringify(r),u=e[l],c=u!==void 0&&u.fingerprint===a?u.turn:r;return e[l]={turn:c,fingerprint:a},c});return e.length=s.length,s};return t.reset=()=>{e=[]},t}function iV(e){if(e instanceof Error)return typeof e.stack=="string"&&e.stack?e.stack:e.message?`${e.name}: ${e.message}`:e.name;if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean"||typeof e=="bigint")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function txe(e){if(e instanceof Error)return{name:e.name,message:e.message};const t=e;return{name:typeof t?.name=="string"?t.name:void 0,message:typeof t?.message=="string"?t.message:void 0}}function nxe(e){return e instanceof Error&&typeof e.stack=="string"&&e.stack?e.stack:void 0}function ixe(e){if(!(typeof e!="number"||!Number.isFinite(e)))return new Date(e).toISOString()}function HD(e){if(!(typeof e!="number"||!Number.isFinite(e)))return`${Math.round(e)}ms`}function oxe(e,t,n){const i=lxe(e),o=rxe(e),s=new Map(e.prompts.map(d=>[d.promptId,d])),r=n.filter(d=>{const f=d.metadata?.["kimiWeb.promptId"];if(f===void 0||o===void 0)return!0;const h=s.get(f)?.steeredAt;return h===void 0||h>=o}),l=e.prompts.filter(sxe).filter(d=>!i.has(d.promptId)).filter(d=>o===void 0||d.steeredAt>=o);if(l.length===0)return[...r];l.sort((d,f)=>d.steeredAtt)&&(t=n.startedAt);return t}function lxe(e){const t=new Set;for(const n of e.items)if(n.kind==="turn"){for(const i of n.steps)for(const o of i.frames)if(!(o.kind!=="text"||o.role!=="user"))for(const s of o.promptIds??[])t.add(s)}return t}function axe(e){return Array.isArray(e)?e.map(t=>Q4(t)).filter(t=>t.type!=="text"||t.text.length>0):[]}function uxe(e){return e.startsWith("diff --git")||e.startsWith("index ")||e.startsWith("--- ")||e.startsWith("+++ ")||e.startsWith("new file mode")||e.startsWith("deleted file mode")||e.startsWith("old mode")||e.startsWith("new mode")||e.startsWith("similarity index")||e.startsWith("dissimilarity index")||e.startsWith("rename from")||e.startsWith("rename to")||e.startsWith("copy from")||e.startsWith("copy to")||e.startsWith("Binary files")}function cxe(e){const t=[];if(!e)return t;let n=0,i=0,o=!1;for(const s of e.split(` +`)){if(s.startsWith("diff --git")){o=!1;continue}if(!o&&uxe(s))continue;if(s.startsWith("@@")){const a=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(s);a&&(n=Number.parseInt(a[1],10),i=Number.parseInt(a[2],10)),o=!0,t.push({type:"hunk",text:s});continue}if(!o||s.startsWith("\\"))continue;const r=s.charAt(0),l=s.slice(1);r==="+"?(t.push({type:"add",text:l,newNo:i}),i+=1):r==="-"?(t.push({type:"del",text:l,oldNo:n}),n+=1):r===" "&&(t.push({type:"context",text:l,oldNo:n,newNo:i}),n+=1,i+=1)}return t}function WD(e){return e?e.split(` +`).map(t=>t.trimEnd()).filter(Boolean).at(-1)??"":""}function dxe(e){return e.suspendedReason||WD(e.text)||WD(e.outputLines?.join(` +`))||e.summary||""}function fxe(e){return e.suspendedReason?e.suspendedReason:e.text?e.text:e.outputLines&&e.outputLines.length>0?e.outputLines.join(` +`):e.summary??""}function hxe(e){return e==="completed"?"completed":e==="failed"?"failed":e==="aborted"?"cancelled":"working"}function qD(e,t){return{id:e.agentId??e.item??`result-${t}`,agentId:e.agentId,name:e.item??`subagent ${t+1}`,activity:e.body.split(` +`)[0]??"",phase:hxe(e.outcome),body:e.body}}function pxe(e,t){return!!(t.agentId&&e.agentId===t.agentId||t.item&&e.name.includes(t.item))}function mxe(e,t){const n=e.map(o=>({id:o.id,agentId:o.agentId,name:o.name,activity:dxe(o),phase:o.phase,body:fxe(o)}));if(!t)return n;const i=t.subagents.filter(o=>(o.outcome==="aborted"||o.state==="not_started")&&!e.some(s=>pxe(s,o))).map((o,s)=>qD(o,s));return n.length>0?[...n,...i]:t.subagents.map((o,s)=>qD(o,s))}const gxe=["queued","working","suspended","completed","failed","cancelled"];function oV(e){return e.status==="completed"?"completed":e.status==="failed"?"failed":e.status==="cancelled"?"cancelled":e.subagentPhase?e.subagentPhase:"working"}function vxe(){return{queued:0,working:0,suspended:0,completed:0,failed:0,cancelled:0}}function yxe(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||n.swarmIndex===void 0)continue;const i=n.parentToolCallId??"swarm",o=t.get(i)??[];o.push({id:n.id,agentId:n.agentId,name:n.description,subagentType:n.subagentType,model:n.model,thinkingEffort:n.thinkingEffort,phase:oV(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex}),t.set(i,o)}return[...t.entries()].map(([n,i])=>{const o=i.toSorted((r,l)=>r.swarmIndex-l.swarmIndex||r.id.localeCompare(l.id)),s=vxe();for(const r of o)s[r.phase]++;return{id:n,members:o,counts:s}}).filter(n=>n.members.length>1).toSorted((n,i)=>{const o=n.members.at(0)?.swarmIndex??0,s=i.members.at(0)?.swarmIndex??0;return o!==s?o-s:n.id.localeCompare(i.id)})}function kxe(e){let t=0,n=0;for(const i of e){n+=i.members.length;for(const o of gxe)(o==="completed"||o==="failed"||o==="cancelled")&&(t+=i.counts[o])}return{done:t,total:n}}function bxe(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||!n.parentToolCallId)continue;const i=t.get(n.parentToolCallId)??[];i.push({id:n.id,agentId:n.agentId,name:n.description,subagentType:n.subagentType,model:n.model,thinkingEffort:n.thinkingEffort,phase:oV(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex??Number.MAX_SAFE_INTEGER}),t.set(n.parentToolCallId,i)}for(const[n,i]of t)t.set(n,i.toSorted((o,s)=>o.swarmIndex-s.swarmIndex||o.id.localeCompare(s.id)));return t}function CS(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 sV(e){for(const t of["path","file_path","filePath","filename"]){const n=e[t];if(typeof n=="string"&&n.length>0)return n}}const p0=100*1024;function wxe(e){const t=hr(e.name);if(t!=="edit"&&t!=="multi_edit")return null;const n=CS(e.arg);if(!n)return null;if(t==="edit"){if(n.replace_all===!0)return null;const l=typeof n.old_string=="string"?n.old_string:void 0,a=typeof n.new_string=="string"?n.new_string:void 0;return l===void 0||a===void 0||l.length>p0||a.length>p0?null:Ib(l,a)}const i=Array.isArray(n.edits)?n.edits:void 0;if(!i||i.length===0)return null;const o=[];let s=0,r=0;for(const l of i){if(!l||typeof l!="object")return null;const a=l;if(a.replace_all===!0)return null;const u=typeof a.old_string=="string"?a.old_string:void 0,c=typeof a.new_string=="string"?a.new_string:void 0;if(u===void 0||c===void 0||u.length>p0||c.length>p0)return null;const d=Ib(u,c);if(d===null)return null;o.length>0&&o.push({type:"hunk",text:"···"});for(const f of d)o.push({...f,oldNo:f.oldNo!==void 0?f.oldNo+s:void 0,newNo:f.newNo!==void 0?f.newNo+r:void 0});s+=hc(u).length,r+=hc(c).length}return o}const Cxe=5e3;function Axe(e){if(hr(e.name)!=="write")return null;const t=CS(e.arg);return!t||typeof t.content!="string"||t.content.length>p0||t.content.split(` +`).length>Cxe?null:{content:t.content,path:sV(t)}}function xxe(e){const t=CS(e.arg);return t?sV(t):void 0}function Sxe(e){switch(e){case"running":return"running";case"completed":return"completed";case"killed":return"cancelled";default:return"failed"}}function _xe(e,t){return t==="running"?e.stateReason!==void 0?"suspended":"working":t}function Ixe(e){return e==="subagent"?"subagent":e==="shell"?"bash":"tool"}function Mxe(e){return rV(e).parents}function rV(e){const t=new Map,n=new Map;for(const i of e.items)if(i.kind==="turn")for(const o of i.steps)for(const s of o.frames)s.kind!=="tool"||s.agentRefs===void 0||s.agentRefs.forEach((r,l)=>{t.set(r.agentId,s.toolCallId),n.set(r.agentId,l)});return{parents:t,swarmIndexes:n}}function Txe(e,t,n){const i=rV(e);let o=i.parents,s=i.swarmIndexes;if(n!==void 0){for(const[u,c]of i.parents)n.parents.set(u,c);for(const[u,c]of i.swarmIndexes)n.swarmIndexes.set(u,c);o=n.parents,s=n.swarmIndexes}const r=e.tasks.map(u=>{const c=Sxe(u.state);return{id:u.taskId,agentId:u.agentId,sessionId:t,kind:Ixe(u.kind),description:u.description??"",status:c,createdAt:u.startedAt??"",startedAt:u.startedAt,completedAt:u.endedAt,outputPreview:u.outputTail.length>0?u.outputTail:void 0,text:u.resultSummary,subagentPhase:u.kind==="subagent"?_xe(u,c):void 0,suspendedReason:c==="running"?u.stateReason:void 0,model:u.model,thinkingEffort:u.thinkingEffort,runInBackground:u.detached,parentToolCallId:u.agentId!==void 0?o.get(u.agentId):void 0,swarmIndex:u.agentId!==void 0?s.get(u.agentId):void 0}}),l=new Map;r.forEach((u,c)=>{u.agentId!==void 0&&u.id===u.agentId&&l.set(u.agentId,c)});const a=new Set;return r.forEach((u,c)=>{if(u.agentId===void 0||u.id===u.agentId)return;const d=l.get(u.agentId);if(d===void 0)return;const f=r[d],h=u.completedAt!==void 0&&f.startedAt!==void 0&&u.completedAt>=f.startedAt,m=f.status==="running"&&u.status!=="running"&&h;r[d]={...f,backgroundTaskId:u.status==="running"||h?u.id:void 0,status:m?u.status:f.status,subagentPhase:m?u.status==="completed"?"completed":u.status==="cancelled"?"cancelled":"failed":f.subagentPhase,description:f.description.length>0?f.description:u.description,model:f.model??u.model,thinkingEffort:f.thinkingEffort??u.thinkingEffort,completedAt:h?u.completedAt??f.completedAt:f.completedAt,outputPreview:h?f.outputPreview??u.outputPreview:f.outputPreview,text:h?f.text??u.text:f.text},a.add(c)}),r.filter((u,c)=>!a.has(c))}function Exe(){let e=[],t=null,n=null,i=null,o,s,r=!0;const l=new WeakMap,a=u=>{const{messages:c,approvals:d}=u,f=u.sessionActive??!0,h=u.planReviewByToolCallId??{},m=u.plansByToolCallId??{},g=(S,x)=>l.set(S,x);let y=n!==null;if(y){const S=n,x=Object.keys(h);y=x.length===Object.keys(S).length&&x.every(A=>h[A]===S[A])}let k=i!==null;if(k){const S=i,x=Object.keys(m);k=x.length===Object.keys(S).length&&x.every(A=>m[A]===S[A])}const v=e.length>0&&d===t&&y&&k&&u.getFileUrl===o&&u.getSessionMediaUrl===s;let C=0,w=0,M=1;if(v){let S=-1;for(let x=e.length-1;x>=0;x--)if(e[x].role==="assistant"){S=x;break}for(let x=0;x0?[...e.slice(0,C),...L]:L;return e=E,t=d,n={...h},i={...m},o=u.getFileUrl,s=u.getSessionMediaUrl,r=f,E};return a.reset=()=>{e=[],t=null,n=null,i=null,o=void 0,r=!0},a}function Lxe(e){const t=new Map;let n=0;for(let i=e.length-1;i>=0;i--){const o=e[i];if(o.role==="compaction"||o.goalContinuation===!0)break;o.role==="user"&&o.hasUndoAnchor!==!1&&(n++,t.set(o.id,n))}return t}const lV=["light","dark","system"],Nxe=["small","medium","large","xlarge"],z8="medium",aV="kimi-web.color-scheme",r6="kimi-web.font-scale",UD="kimi-web.ui-font-size";function l6(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function AS(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function Fxe(e){try{globalThis.localStorage.removeItem(e)}catch{}}function Dxe(){const e=l6(aV);return e&&lV.includes(e)?e:"system"}const Gy={light:"#ffffff",dark:"#121212"};function Rxe(e){if(typeof document>"u"||!document.documentElement)return;document.documentElement.dataset.colorScheme=e;const t=document.querySelectorAll('meta[name="theme-color"]');if(t.length===0)return;const n=e==="dark"?Gy.dark:e==="light"?Gy.light:null;t.forEach(i=>{const s=(i.getAttribute("media")??"").includes("dark")?Gy.dark:Gy.light;i.setAttribute("content",n??s)})}function uV(e){return Nxe.includes(e)}function Oxe(e){return e<=13?"small":e<=15?"medium":e<=17?"large":"xlarge"}function Pxe(){const e=l6(r6);if(e==="xxlarge")return"xlarge";if(e!==null)return uV(e)?e:z8;const t=l6(UD);if(t===null)return z8;const n=Number(t),i=Number.isFinite(n)?Oxe(n):z8;return AS(r6,i),Fxe(UD),i}function Bxe(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.fontScale=e)}const xS=q(Dxe()),SS=q(Pxe());let VD=!1;function $xe(){VD||(VD=!0,ze(xS,Rxe,{immediate:!0}),ze(SS,Bxe,{immediate:!0}))}function zxe(e){lV.includes(e)&&(xS.value=e,AS(aV,e))}function jxe(e){uV(e)&&(SS.value=e,AS(r6,e))}function Xm(){return $xe(),{colorScheme:xS,fontScale:SS,setColorScheme:zxe,setFontScale:jxe}}const Qy=q(!1);let KD=!1;function j8(){const e=document.documentElement.dataset.colorScheme;return e==="dark"?!0:e==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function ow(){return!KD&&typeof window<"u"&&typeof document<"u"&&(KD=!0,Qy.value=j8(),new MutationObserver(()=>{Qy.value=j8()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{Qy.value=j8()})),Qy}const cV="kimi-web.sidebar-multi-tab";function Hxe(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function Wxe(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function qxe(){return Hxe(cV)==="1"}const dV=q(qxe());function Uxe(e){dV.value=e,Wxe(cV,e?"1":"0")}function Dp(){return{sidebarTabs:dV,setSidebarTabs:Uxe}}function ev(e){let t="";for(const n of e)n.codePointAt(0)>127||/[A-Za-z0-9\-._~]/.test(n)?t+=n:t+=`%${n.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0")}`;return t}function Vxe(e){const t=e.split("/").map(ev).join("/");return t.startsWith("//")?`/%2F${t.slice(2)}`:t}function _S(e){return e.replace(/%/g,"%25").replace(/&/g,"%26").replace(//g,"%3E").replace(/([\\[\]])/g,"\\$1").replace(/\n/g,"%0A").replace(/\r/g,"%0D")}function ZD(e){return e.replace(/\\([\\[\]])/g,"$1").replace(/%0A/g,` +`).replace(/%0D/g,"\r").replace(/%26/g,"&").replace(/%3C/g,"<").replace(/%3E/g,">").replace(/%25/g,"%")}function Kxe(e){return e.replace(/%0A/g,` +`).replace(/%0D/g,"\r").replace(/%26/g,"&").replace(/%3C/g,"<").replace(/%3E/g,">").replace(/%25/g,"%")}function Zxe(e,t){const n=t?e.replace(/\\([\\<>])/g,"$1"):e.replace(/\\([\\()])/g,"$1");return tv(n)}function tv(e){try{return decodeURIComponent(e)}catch{return e}}let GD;function a6(e){return GD??=new Intl.Segmenter("und",{granularity:"grapheme"}),[...GD.segment(e)].map(t=>t.segment)}function fV(e,t){const n=a6(e);return n.length<=t?e:`${n.slice(0,t-1).join("")}…`}const Mb="kimi-code://skill/";function IS(e){return e?e.startsWith(Mb)&&e.length>Mb.length?"skill":e.startsWith("#")||e.startsWith("?")||e.startsWith("//")||/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(e)&&!/^[a-zA-Z]:(?:[\\/]|%5c)/i.test(e)?null:e.endsWith("/")||e.endsWith("\\")||/%5c$/i.test(e)?"folder":"file":null}function z1(e){const t=e.search(/[#?]/);return t>0?e.slice(0,t):e}function hV(e){const t=e.slice(Mb.length);return tv(t)}function Rp(e){const t=_S(e.name);if(e.kind==="skill")return`[${t}](${Mb}${ev(e.name)})`;const n=e.kind==="folder"&&!e.path.endsWith("/")&&!e.path.endsWith("\\")?`${e.path}/`:e.path;return`[${t}](${Vxe(n)})`}const G9="kimi-code-composer://attachments/";function Nf(e){return`[${_S(e.name)}](${G9}${e.attId})`}const qh="kimi-code-composer://quote/",Gxe=12;function Mm(e){const t=e.split(` +`).map(i=>i.trim()).find(i=>i.length>0)??"",n=fV(t,Gxe);return n.length>0?n:"…"}function sw(e){const t=e.source!==void 0&&e.source.length>0?`?source=${ev(e.source)}`:"",n=e.comment!==void 0&&e.comment.length>0?`?comment=${ev(e.comment)}`:"";return`[${_S(Mm(e.text))}](${qh}${ev(e.text)}${t}${n})`}function pV(e){const t=e.indexOf("?source="),n=e.indexOf("?comment="),i=[t,n].filter(s=>s>=0).sort((s,r)=>s-r)[0]??-1,o={text:tv(i===-1?e:e.slice(0,i))};if(t>=0){const s=n>t?n:e.length;o.source=tv(e.slice(t+8,s))}if(n>=0){const s=t>n?t:e.length;o.comment=tv(e.slice(n+9,s))}return o}const QD=document.createElement("i");function Qxe(e){const t="&"+e+";";QD.innerHTML=t;const n=QD.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function pc(e,t,n,i){const o=e.length;let s=0,r;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,n=n>0?n:0,i.length<1e4)r=Array.from(i),r.unshift(t,n),e.splice(...r);else for(n&&e.splice(t,n);s0?(pc(e,e.length,0,t),e):t}const YD={}.hasOwnProperty;function Yxe(e){const t={};let n=-1;for(;++n-1&&e.test(String.fromCharCode(n))}}function oo(e,t,n,i){const o=i?i-1:Number.POSITIVE_INFINITY;let s=0;return r;function r(a){return Ii(a)?(e.enter(n),l(a)):t(a)}function l(a){return Ii(a)&&s++r))return;const E=t.events.length;let S=E,x,A;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){if(x){A=t.events[S][1].end;break}x=!0}for(k(i),L=E;LC;){const M=n[w];t.containerState=M[1],M[0].exit.call(t,e)}n.length=C}function v(){o.write([null]),s=void 0,o=void 0,t.containerState._closeFlow=void 0}}function uSe(e,t,n){return oo(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function XD(e){if(e===null||Nl(e)||oSe(e))return 1;if(iSe(e))return 2}function TS(e,t,n){const i=[];let o=-1;for(;++o1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[i][1].end},f={...e[n][1].start};eR(d,-a),eR(f,a),r={type:a>1?"strongSequence":"emphasisSequence",start:d,end:{...e[i][1].end}},l={type:a>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:f},s={type:a>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},o={type:a>1?"strong":"emphasis",start:{...r.start},end:{...l.end}},e[i][1].end={...r.start},e[n][1].start={...l.end},u=[],e[i][1].end.offset-e[i][1].start.offset&&(u=Da(u,[["enter",e[i][1],t],["exit",e[i][1],t]])),u=Da(u,[["enter",o,t],["enter",r,t],["exit",r,t],["enter",s,t]]),u=Da(u,TS(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),u=Da(u,[["exit",s,t],["enter",l,t],["exit",l,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,u=Da(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,pc(e,i-1,n-i+3,u),n=i+u.length-c-2;break}}for(n=-1;++n0&&Ii(L)?oo(e,v,"linePrefix",s+1)(L):v(L)}function v(L){return L===null||jn(L)?e.check(tR,g,w)(L):(e.enter("codeFlowValue"),C(L))}function C(L){return L===null||jn(L)?(e.exit("codeFlowValue"),v(L)):(e.consume(L),C)}function w(L){return e.exit("codeFenced"),t(L)}function M(L,E,S){let x=0;return A;function A(R){return L.enter("lineEnding"),L.consume(R),L.exit("lineEnding"),T}function T(R){return L.enter("codeFencedFence"),Ii(R)?oo(L,I,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):I(R)}function I(R){return R===l?(L.enter("codeFencedFenceSequence"),O(R)):S(R)}function O(R){return R===l?(x++,L.consume(R),O):x>=r?(L.exit("codeFencedFenceSequence"),Ii(R)?oo(L,H,"whitespace")(R):H(R)):S(R)}function H(R){return R===null||jn(R)?(L.exit("codeFencedFence"),E(R)):S(R)}}}function wSe(e,t,n){const i=this;return o;function o(r){return r===null?n(r):(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),s)}function s(r){return i.parser.lazy[i.now().line]?n(r):t(r)}}const H8={name:"codeIndented",tokenize:ASe},CSe={partial:!0,tokenize:xSe};function ASe(e,t,n){const i=this;return o;function o(u){return e.enter("codeIndented"),oo(e,s,"linePrefix",5)(u)}function s(u){const c=i.events[i.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?r(u):n(u)}function r(u){return u===null?a(u):jn(u)?e.attempt(CSe,r,a)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||jn(u)?(e.exit("codeFlowValue"),r(u)):(e.consume(u),l)}function a(u){return e.exit("codeIndented"),t(u)}}function xSe(e,t,n){const i=this;return o;function o(r){return i.parser.lazy[i.now().line]?n(r):jn(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),o):oo(e,s,"linePrefix",5)(r)}function s(r){const l=i.events[i.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(r):jn(r)?o(r):n(r)}}const SSe={name:"codeText",previous:ISe,resolve:_Se,tokenize:MSe};function _Se(e){let t=e.length-4,n=3,i,o;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=n;++i=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,n,i){const o=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return i&&Wg(this.left,i),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Wg(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Wg(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(r):e.interrupt(i.parser.constructs.flow,n,t)(r)}}function kV(e,t,n,i,o,s,r,l,a){const u=a||Number.POSITIVE_INFINITY;let c=0;return d;function d(k){return k===60?(e.enter(i),e.enter(o),e.enter(s),e.consume(k),e.exit(s),f):k===null||k===32||k===41||u6(k)?n(k):(e.enter(i),e.enter(r),e.enter(l),e.enter("chunkString",{contentType:"string"}),g(k))}function f(k){return k===62?(e.enter(s),e.consume(k),e.exit(s),e.exit(o),e.exit(i),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),h(k))}function h(k){return k===62?(e.exit("chunkString"),e.exit(l),f(k)):k===null||k===60||jn(k)?n(k):(e.consume(k),k===92?m:h)}function m(k){return k===60||k===62||k===92?(e.consume(k),h):h(k)}function g(k){return!c&&(k===null||k===41||Nl(k))?(e.exit("chunkString"),e.exit(l),e.exit(r),e.exit(i),t(k)):c999||h===null||h===91||h===93&&!a||h===94&&!l&&"_hiddenFootnoteSupport"in r.parser.constructs?n(h):h===93?(e.exit(s),e.enter(o),e.consume(h),e.exit(o),e.exit(i),t):jn(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===null||h===91||h===93||jn(h)||l++>999?(e.exit("chunkString"),c(h)):(e.consume(h),a||(a=!Ii(h)),h===92?f:d)}function f(h){return h===91||h===92||h===93?(e.consume(h),l++,d):d(h)}}function wV(e,t,n,i,o,s){let r;return l;function l(f){return f===34||f===39||f===40?(e.enter(i),e.enter(o),e.consume(f),e.exit(o),r=f===40?41:f,a):n(f)}function a(f){return f===r?(e.enter(o),e.consume(f),e.exit(o),e.exit(i),t):(e.enter(s),u(f))}function u(f){return f===r?(e.exit(s),a(r)):f===null?n(f):jn(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),oo(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(f))}function c(f){return f===r||f===null||jn(f)?(e.exit("chunkString"),u(f)):(e.consume(f),f===92?d:c)}function d(f){return f===r||f===92?(e.consume(f),c):c(f)}}function nv(e,t){let n;return i;function i(o){return jn(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,i):Ii(o)?oo(e,i,n?"linePrefix":"lineSuffix")(o):t(o)}}const OSe={name:"definition",tokenize:BSe},PSe={partial:!0,tokenize:$Se};function BSe(e,t,n){const i=this;let o;return s;function s(h){return e.enter("definition"),r(h)}function r(h){return bV.call(i,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function l(h){return o=MS(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),a):n(h)}function a(h){return Nl(h)?nv(e,u)(h):u(h)}function u(h){return kV(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function c(h){return e.attempt(PSe,d,d)(h)}function d(h){return Ii(h)?oo(e,f,"whitespace")(h):f(h)}function f(h){return h===null||jn(h)?(e.exit("definition"),i.parser.defined.push(o),t(h)):n(h)}}function $Se(e,t,n){return i;function i(l){return Nl(l)?nv(e,o)(l):n(l)}function o(l){return wV(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function s(l){return Ii(l)?oo(e,r,"whitespace")(l):r(l)}function r(l){return l===null||jn(l)?t(l):n(l)}}const zSe={name:"hardBreakEscape",tokenize:jSe};function jSe(e,t,n){return i;function i(s){return e.enter("hardBreakEscape"),e.consume(s),o}function o(s){return jn(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const HSe={name:"headingAtx",resolve:WSe,tokenize:qSe};function WSe(e,t){let n=e.length-2,i=3,o,s;return e[i][1].type==="whitespace"&&(i+=2),n-2>i&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&e[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(o={type:"atxHeadingText",start:e[i][1].start,end:e[n][1].end},s={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},pc(e,i,n-i+1,[["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t]])),e}function qSe(e,t,n){let i=0;return o;function o(c){return e.enter("atxHeading"),s(c)}function s(c){return e.enter("atxHeadingSequence"),r(c)}function r(c){return c===35&&i++<6?(e.consume(c),r):c===null||Nl(c)?(e.exit("atxHeadingSequence"),l(c)):n(c)}function l(c){return c===35?(e.enter("atxHeadingSequence"),a(c)):c===null||jn(c)?(e.exit("atxHeading"),t(c)):Ii(c)?oo(e,l,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function a(c){return c===35?(e.consume(c),a):(e.exit("atxHeadingSequence"),l(c))}function u(c){return c===null||c===35||Nl(c)?(e.exit("atxHeadingText"),l(c)):(e.consume(c),u)}}const USe=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],iR=["pre","script","style","textarea"],VSe={concrete:!0,name:"htmlFlow",resolveTo:GSe,tokenize:QSe},KSe={partial:!0,tokenize:JSe},ZSe={partial:!0,tokenize:YSe};function GSe(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function QSe(e,t,n){const i=this;let o,s,r,l,a;return u;function u(G){return c(G)}function c(G){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(G),d}function d(G){return G===33?(e.consume(G),f):G===47?(e.consume(G),s=!0,g):G===63?(e.consume(G),o=3,i.interrupt?t:$):Yu(G)?(e.consume(G),r=String.fromCharCode(G),y):n(G)}function f(G){return G===45?(e.consume(G),o=2,h):G===91?(e.consume(G),o=5,l=0,m):Yu(G)?(e.consume(G),o=4,i.interrupt?t:$):n(G)}function h(G){return G===45?(e.consume(G),i.interrupt?t:$):n(G)}function m(G){const te="CDATA[";return G===te.charCodeAt(l++)?(e.consume(G),l===te.length?i.interrupt?t:I:m):n(G)}function g(G){return Yu(G)?(e.consume(G),r=String.fromCharCode(G),y):n(G)}function y(G){if(G===null||G===47||G===62||Nl(G)){const te=G===47,le=r.toLowerCase();return!te&&!s&&iR.includes(le)?(o=1,i.interrupt?t(G):I(G)):USe.includes(r.toLowerCase())?(o=6,te?(e.consume(G),k):i.interrupt?t(G):I(G)):(o=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(G):s?v(G):C(G))}return G===45||mu(G)?(e.consume(G),r+=String.fromCharCode(G),y):n(G)}function k(G){return G===62?(e.consume(G),i.interrupt?t:I):n(G)}function v(G){return Ii(G)?(e.consume(G),v):A(G)}function C(G){return G===47?(e.consume(G),A):G===58||G===95||Yu(G)?(e.consume(G),w):Ii(G)?(e.consume(G),C):A(G)}function w(G){return G===45||G===46||G===58||G===95||mu(G)?(e.consume(G),w):M(G)}function M(G){return G===61?(e.consume(G),L):Ii(G)?(e.consume(G),M):C(G)}function L(G){return G===null||G===60||G===61||G===62||G===96?n(G):G===34||G===39?(e.consume(G),a=G,E):Ii(G)?(e.consume(G),L):S(G)}function E(G){return G===a?(e.consume(G),a=null,x):G===null||jn(G)?n(G):(e.consume(G),E)}function S(G){return G===null||G===34||G===39||G===47||G===60||G===61||G===62||G===96||Nl(G)?M(G):(e.consume(G),S)}function x(G){return G===47||G===62||Ii(G)?C(G):n(G)}function A(G){return G===62?(e.consume(G),T):n(G)}function T(G){return G===null||jn(G)?I(G):Ii(G)?(e.consume(G),T):n(G)}function I(G){return G===45&&o===2?(e.consume(G),F):G===60&&o===1?(e.consume(G),P):G===62&&o===4?(e.consume(G),K):G===63&&o===3?(e.consume(G),$):G===93&&o===5?(e.consume(G),W):jn(G)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(KSe,ne,O)(G)):G===null||jn(G)?(e.exit("htmlFlowData"),O(G)):(e.consume(G),I)}function O(G){return e.check(ZSe,H,ne)(G)}function H(G){return e.enter("lineEnding"),e.consume(G),e.exit("lineEnding"),R}function R(G){return G===null||jn(G)?O(G):(e.enter("htmlFlowData"),I(G))}function F(G){return G===45?(e.consume(G),$):I(G)}function P(G){return G===47?(e.consume(G),r="",z):I(G)}function z(G){if(G===62){const te=r.toLowerCase();return iR.includes(te)?(e.consume(G),K):I(G)}return Yu(G)&&r.length<8?(e.consume(G),r+=String.fromCharCode(G),z):I(G)}function W(G){return G===93?(e.consume(G),$):I(G)}function $(G){return G===62?(e.consume(G),K):G===45&&o===2?(e.consume(G),$):I(G)}function K(G){return G===null||jn(G)?(e.exit("htmlFlowData"),ne(G)):(e.consume(G),K)}function ne(G){return e.exit("htmlFlow"),t(G)}}function YSe(e,t,n){const i=this;return o;function o(r){return jn(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),s):n(r)}function s(r){return i.parser.lazy[i.now().line]?n(r):t(r)}}function JSe(e,t,n){return i;function i(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(rw,t,n)}}const XSe={name:"htmlText",tokenize:e_e};function e_e(e,t,n){const i=this;let o,s,r;return l;function l($){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume($),a}function a($){return $===33?(e.consume($),u):$===47?(e.consume($),M):$===63?(e.consume($),C):Yu($)?(e.consume($),S):n($)}function u($){return $===45?(e.consume($),c):$===91?(e.consume($),s=0,m):Yu($)?(e.consume($),v):n($)}function c($){return $===45?(e.consume($),h):n($)}function d($){return $===null?n($):$===45?(e.consume($),f):jn($)?(r=d,P($)):(e.consume($),d)}function f($){return $===45?(e.consume($),h):d($)}function h($){return $===62?F($):$===45?f($):d($)}function m($){const K="CDATA[";return $===K.charCodeAt(s++)?(e.consume($),s===K.length?g:m):n($)}function g($){return $===null?n($):$===93?(e.consume($),y):jn($)?(r=g,P($)):(e.consume($),g)}function y($){return $===93?(e.consume($),k):g($)}function k($){return $===62?F($):$===93?(e.consume($),k):g($)}function v($){return $===null||$===62?F($):jn($)?(r=v,P($)):(e.consume($),v)}function C($){return $===null?n($):$===63?(e.consume($),w):jn($)?(r=C,P($)):(e.consume($),C)}function w($){return $===62?F($):C($)}function M($){return Yu($)?(e.consume($),L):n($)}function L($){return $===45||mu($)?(e.consume($),L):E($)}function E($){return jn($)?(r=E,P($)):Ii($)?(e.consume($),E):F($)}function S($){return $===45||mu($)?(e.consume($),S):$===47||$===62||Nl($)?x($):n($)}function x($){return $===47?(e.consume($),F):$===58||$===95||Yu($)?(e.consume($),A):jn($)?(r=x,P($)):Ii($)?(e.consume($),x):F($)}function A($){return $===45||$===46||$===58||$===95||mu($)?(e.consume($),A):T($)}function T($){return $===61?(e.consume($),I):jn($)?(r=T,P($)):Ii($)?(e.consume($),T):x($)}function I($){return $===null||$===60||$===61||$===62||$===96?n($):$===34||$===39?(e.consume($),o=$,O):jn($)?(r=I,P($)):Ii($)?(e.consume($),I):(e.consume($),H)}function O($){return $===o?(e.consume($),o=void 0,R):$===null?n($):jn($)?(r=O,P($)):(e.consume($),O)}function H($){return $===null||$===34||$===39||$===60||$===61||$===96?n($):$===47||$===62||Nl($)?x($):(e.consume($),H)}function R($){return $===47||$===62||Nl($)?x($):n($)}function F($){return $===62?(e.consume($),e.exit("htmlTextData"),e.exit("htmlText"),t):n($)}function P($){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume($),e.exit("lineEnding"),z}function z($){return Ii($)?oo(e,W,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):W($)}function W($){return e.enter("htmlTextData"),r($)}}const ES={name:"labelEnd",resolveAll:o_e,resolveTo:s_e,tokenize:r_e},t_e={tokenize:l_e},n_e={tokenize:a_e},i_e={tokenize:u_e};function o_e(e){let t=-1;const n=[];for(;++t=3&&(u===null||jn(u))?(e.exit("thematicBreak"),t(u)):n(u)}function a(u){return u===o?(e.consume(u),i++,a):(e.exit("thematicBreakSequence"),Ii(u)?oo(e,l,"whitespace")(u):l(u))}}const vl={continuation:{tokenize:k_e},exit:w_e,name:"list",tokenize:y_e},g_e={partial:!0,tokenize:C_e},v_e={partial:!0,tokenize:b_e};function y_e(e,t,n){const i=this,o=i.events[i.events.length-1];let s=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,r=0;return l;function l(h){const m=i.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!i.containerState.marker||h===i.containerState.marker:c6(h)){if(i.containerState.type||(i.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(Q9,n,u)(h):u(h);if(!i.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),a(h)}return n(h)}function a(h){return c6(h)&&++r<10?(e.consume(h),a):(!i.interrupt||r<2)&&(i.containerState.marker?h===i.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),u(h)):n(h)}function u(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||h,e.check(rw,i.interrupt?n:c,e.attempt(g_e,f,d))}function c(h){return i.containerState.initialBlankLine=!0,s++,f(h)}function d(h){return Ii(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),f):n(h)}function f(h){return i.containerState.size=s+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function k_e(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(rw,o,s);function o(l){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,oo(e,t,"listItemIndent",i.containerState.size+1)(l)}function s(l){return i.containerState.furtherBlankLines||!Ii(l)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,r(l)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(v_e,t,r)(l))}function r(l){return i.containerState._closeFlow=!0,i.interrupt=void 0,oo(e,e.attempt(vl,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function b_e(e,t,n){const i=this;return oo(e,o,"listItemIndent",i.containerState.size+1);function o(s){const r=i.events[i.events.length-1];return r&&r[1].type==="listItemIndent"&&r[2].sliceSerialize(r[1],!0).length===i.containerState.size?t(s):n(s)}}function w_e(e){e.exit(this.containerState.type)}function C_e(e,t,n){const i=this;return oo(e,o,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(s){const r=i.events[i.events.length-1];return!Ii(s)&&r&&r[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const oR={name:"setextUnderline",resolveTo:A_e,tokenize:x_e};function A_e(e,t){let n=e.length,i,o,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){i=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const r={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",s?(e.splice(o,0,["enter",r,t]),e.splice(s+1,0,["exit",e[i][1],t]),e[i][1].end={...e[s][1].end}):e[i][1]=r,e.push(["exit",r,t]),e}function x_e(e,t,n){const i=this;let o;return s;function s(u){let c=i.events.length,d;for(;c--;)if(i.events[c][1].type!=="lineEnding"&&i.events[c][1].type!=="linePrefix"&&i.events[c][1].type!=="content"){d=i.events[c][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||d)?(e.enter("setextHeadingLine"),o=u,r(u)):n(u)}function r(u){return e.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===o?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),Ii(u)?oo(e,a,"lineSuffix")(u):a(u))}function a(u){return u===null||jn(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const S_e={tokenize:__e};function __e(e){const t=this,n=e.attempt(rw,i,e.attempt(this.parser.constructs.flowInitial,o,oo(e,e.attempt(this.parser.constructs.flow,o,e.attempt(LSe,o)),"linePrefix")));return n;function i(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const I_e={resolveAll:AV()},M_e=CV("string"),T_e=CV("text");function CV(e){return{resolveAll:AV(e==="text"?E_e:void 0),tokenize:t};function t(n){const i=this,o=this.parser.constructs[e],s=n.attempt(o,r,l);return r;function r(c){return u(c)?s(c):l(c)}function l(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),a}function a(c){return u(c)?(n.exit("data"),s(c)):(n.consume(c),a)}function u(c){if(c===null)return!0;const d=o[c];let f=-1;if(d)for(;++f-1){const l=r[0];typeof l=="string"?r[0]=l.slice(i):r.shift()}s>0&&r.push(e[o].slice(0,s))}return r}function W_e(e,t){let n=-1;const i=[];let o;for(;++n0;if(s||e[c]!==(h?"!":"[")||r===null)continue;const m=e.slice(c+(h?2:1),d-1);let g=e.slice(r.start,r.end),y=!1;g.startsWith("<")&&(y=!0,g=g.slice(1,-1)),!(!m||!g)&&n.push({start:c,end:f,rawText:m,rawDest:g,angle:y,image:h})}return n}function Z_e(e,t){const{start:n,end:i,rawText:o,rawDest:s,angle:r,image:l}=e;if(l&&!s.startsWith(qh))return null;if(s.startsWith(G9)&&s.length>G9.length){const u=ZD(o),c=s.slice(G9.length);return{type:"attachment",start:n,end:i,attrs:{attId:c,name:u,kind:t?.(c)??(u.endsWith("/")?"folder":"file")},rawDest:s}}if(s.startsWith(qh)&&s.length>qh.length)return{type:"quote",start:n,end:i,attrs:pV(s.slice(qh.length)),rawDest:s};const a=IS(s);return a===null?null:a==="skill"?{type:"mention",start:n,end:i,attrs:{kind:a,name:hV(s),path:""},rawDest:s}:{type:"mention",start:n,end:i,attrs:{kind:a,name:ZD(o),path:Zxe(s,r)},rawDest:s}}const rR=/\[(?:\\.|[^\\[\]\n])*\]\((kimi-code-composer:\/\/quote\/[^\s)]+)\)/g;function G_e(e){const t=[];rR.lastIndex=0;let n;for(;(n=rR.exec(e))!==null;){let i=0;for(let s=n.index-1;s>=0&&e[s]==="\\";s-=1)i+=1;if(i%2===0)continue;const o=n[1];o===void 0||o.length<=qh.length||t.push({type:"quote",start:n.index-1,end:n.index+n[0].length,attrs:pV(o.slice(qh.length)),rawDest:o})}return t}function lw(e,t){const n=[];for(const i of xV(e)){const o=Z_e(i,t);o&&n.push(o)}return n.push(...G_e(e)),n.sort((i,o)=>i.start-o.start),n}function Ff(e){return lw(e).filter(t=>t.type==="mention").map(({start:t,end:n,attrs:i,rawDest:o})=>({start:t,end:n,attrs:i,rawDest:o}))}function Al(e){return lw(e).filter(t=>t.type==="attachment").map(({start:t,end:n,attrs:i,rawDest:o})=>({start:t,end:n,attrs:i,rawDest:o}))}function SV(e){return lw(e).filter(t=>t.type==="quote").map(({start:t,end:n,attrs:i,rawDest:o})=>({start:t,end:n,attrs:i,rawDest:o}))}function _V(e,t){const n=lw(e,t);if(n.length===0)return[{type:"text",value:e}];const i=[];let o=0;for(const s of n)s.start>o&&i.push({type:"text",value:e.slice(o,s.start)}),s.type==="mention"?i.push({type:"mention",attrs:s.attrs,rawDest:s.rawDest}):s.type==="attachment"?i.push({type:"attachment",attrs:s.attrs,rawDest:s.rawDest}):i.push({type:"quote",attrs:s.attrs,rawDest:s.rawDest}),o=s.end;return o[a,u+1])),s=new Map(t.mediaAttIds.map((a,u)=>[a,u+1]));let r="",l=0;for(const a of i){r+=e.slice(l,a.start),l=a.end;const{attId:u,name:c,kind:d}=a.attrs,f=d==="folder"?n?.resolveFolder?.(u):void 0;if(f!==void 0){const y=f==="/"||/^[a-zA-Z]:\/$/.test(f)?f.slice(0,-1)||"/":c.endsWith("/")?c.slice(0,-1):c;r+=Rp({kind:"folder",name:y,path:f});continue}const h=o.get(u);if(h!==void 0){r+=Nf({attId:String(h),name:c});continue}const m=s.get(u);if(m!==void 0){r+=Nf({attId:`m${m}`,name:c});continue}r+=c}return r+=e.slice(l),r}function lR(e,t,n=0){if(t<=0&&n<=0)return e;const i=Al(e);if(i.length===0)return e;let o="",s=0;for(const r of i){const{attId:l,name:a,kind:u}=r.attrs;let c;t>0&&/^[1-9]\d*$/.test(l)?c=String(Number(l)+t):n>0&&/^m[1-9]\d*$/.test(l)&&(c=`m${Number(l.slice(1))+n}`),c!==void 0&&(o+=e.slice(s,r.start),s=r.end,o+=Nf({attId:c,name:a}))}return o+=e.slice(s),o}function tf(e,t){const n=Al(e);if(n.length===0)return e;let i="",o=0;for(const s of n)i+=e.slice(o,s.start)+(t?.(s.attrs.name)??s.attrs.name),o=s.end;return i+=e.slice(o),i}function aR(e,t){const n=Al(e);if(n.length===0)return e;let i="",o=0;for(const s of n)t.has(s.attrs.attId)||(i+=e.slice(o,s.start)+s.attrs.name,o=s.end);return i+=e.slice(o),i}function f6(e){const t=Al(e);if(t.length===0)return e;let n="",i=0;for(const o of t)n+=e.slice(i,o.start),i=o.end;return n+=e.slice(i),n}let Y_e=!0;const J_e=/^> (.*)$/,X_e=/^>$/;function LS(e){return e.replaceAll("%","%25").replaceAll(` +`,"%0A").replaceAll("\r","%0D")}function eIe(e){return e.replaceAll("%0A",` +`).replaceAll("%0D","\r").replaceAll("%25","%")}const tIe=/^from: (.+)$/;function IV(e){let t=e,n;const i=e.indexOf(` +`),o=tIe.exec(i===-1?e:e.slice(0,i));o!==null&&(n=eIe(o[1]),t=i===-1?"":e.slice(i+1));const s=[];for(const r of t.split(` +`)){const l=J_e.exec(r);if(l!==null){s.push(l[1]??"");continue}if(X_e.test(r)){s.push("");continue}return null}return{text:s.join(` +`),...n!==void 0?{source:n}:{}}}function NS(e){const t=[];for(const i of e.split(/(\n{2,})/)){if(i==="")continue;if(/^\n{2,}$/.test(i)){t.push({type:"sep",text:i});continue}const o=IV(i);t.push(o===null?{type:"inline",text:i}:{type:"quote",text:o.text,...o.source!==void 0?{source:o.source}:{}})}const n=[];for(let i=0;i`> ${t}`).join(` +`)}function iIe(e){const t=e.split(/(\n{2,})/),n=new Array(t.length).fill(!1);let i=!1;for(let s=t.length-1;s>=0;s-=1){n[s]=i;const r=t[s];r!==""&&!/^\n{2,}$/.test(r)&&(i=!0)}let o="";for(let s=0;s{i.type==="sep"&&i.text===` + +`&&t[o-1]?.type==="quote"&&t[o+1]?.type==="quote"&&n.add(o)}),t.map((i,o)=>{if(n.has(o))return" ";if(i.type!=="quote")return i.text;const s={text:i.text};return i.source!==void 0&&(s.source=i.source),i.comment!==void 0&&(s.comment=i.comment),sw(s)}).join("")}function tr(e){this.content=e}tr.prototype={constructor:tr,find:function(e){for(var t=0;t>1}};tr.from=function(e){if(e instanceof tr)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new tr(t)};function EV(e,t,n){for(let i=0;;i++){if(i==e.childCount||i==t.childCount)return e.childCount==t.childCount?null:n;let o=e.child(i),s=t.child(i);if(o==s){n+=o.nodeSize;continue}if(!o.sameMarkup(s))return n;if(o.isText&&o.text!=s.text){let r=o.text,l=s.text,a=0;for(;r[a]==l[a];a++)n++;return a&&a0&&f>0&&u[d-1]==c[f-1];)d--,f--,n--,i--;return d&&f&&d=56320&&e<57344}function FV(e){return e>=55296&&e<56320}class sn{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let i=0;it&&i(a,o+l,s||null,r)!==!1&&a.content.size){let c=l+1;a.nodesBetween(Math.max(0,t-c),Math.min(a.content.size,n-c),i,o+c)}l=u}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,i,o){let s="",r=!0;return this.nodesBetween(t,n,(l,a)=>{let u=l.isText?l.text.slice(Math.max(t,a)-a,n-a):l.isLeaf?o?typeof o=="function"?o(l):o:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&u||l.isTextblock)&&i&&(r?r=!1:s+=i),s+=u},0),s}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,i=t.firstChild,o=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(i)&&(o[o.length-1]=n.withText(n.text+i.text),s=1);st)for(let s=0,r=0;rt&&((rn)&&(l.isText?l=l.cut(Math.max(0,t-r),Math.min(l.text.length,n-r)):l=l.cut(Math.max(0,t-r-1),Math.min(l.content.size,n-r-1))),i.push(l),o+=l.nodeSize),r=a}return new sn(i,o)}cutByIndex(t,n){return t==n?sn.empty:t==0&&n==this.content.length?this:new sn(this.content.slice(t,n))}replaceChild(t,n){let i=this.content[t];if(i==n)return this;let o=this.content.slice(),s=this.size+n.nodeSize-i.nodeSize;return o[t]=n,new sn(o,s)}addToStart(t){return new sn([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new sn(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;nthis.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,i=0;;n++){let o=this.child(n),s=i+o.nodeSize;if(s>=t)return s==t?Yy(n+1,s):Yy(n,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return sn.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return sn.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return sn.empty;let n,i=0;for(let o=0;othis.type.rank&&(n||(n=t.slice(0,o)),n.push(this),i=!0),n&&n.push(s)}}return n||(n=t.slice()),i||n.push(this),n}removeFromSet(t){for(let n=0;ni.type.rank-o.type.rank),n}}Fi.none=[];class zv extends Error{}class mn{constructor(t,n,i){this.content=t,this.openStart=n,this.openEnd=i}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let i=RV(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return i&&new mn(i,this.openStart,this.openEnd)}removeBetween(t,n){return new mn(DV(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return mn.empty;let i=n.openStart||0,o=n.openEnd||0;if(typeof i!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new mn(sn.fromJSON(t,n.content),i,o)}static maxOpen(t,n=!0){let i=0,o=0;for(let s=t.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)i++;for(let s=t.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)o++;return new mn(t,i,o)}}mn.empty=new mn(sn.empty,0,0);function DV(e,t,n){let{index:i,offset:o}=e.findIndex(t),s=e.maybeChild(i),{index:r,offset:l}=e.findIndex(n);if(o==t||s.isText){if(l!=n&&!e.child(r).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(i!=r)throw new RangeError("Removing non-flat range");return e.replaceChild(i,s.copy(DV(s.content,t-o-1,n-o-1)))}function RV(e,t,n,i,o,s){let{index:r,offset:l}=e.findIndex(t),a=e.maybeChild(r);if(l==t||a.isText)return s&&i<=0&&o<=0&&!s.canReplace(r,r,n)?null:e.cut(0,t).append(n).append(e.cut(t));let u=RV(a.content,t-l-1,n,r==0?i-1:0,r==e.childCount-1?o-1:0,a);return u&&e.replaceChild(r,a.copy(u))}function oIe(e,t,n){if(n.openStart>e.depth)throw new zv("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new zv("Inconsistent open depths");return OV(e,t,n,0)}function OV(e,t,n,i){let o=e.index(i),s=e.node(i);if(o==t.index(i)&&i=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function iv(e,t,n,i){let o=(t||e).node(n),s=0,r=t?t.index(n):o.childCount;e&&(s=e.index(n),e.depth>n?s++:e.textOffset&&(lp(e.nodeAfter,i),s++));for(let l=s;lo&&h6(e,t,o+1),r=i.depth>o&&h6(n,i,o+1),l=[];return iv(null,e,o,l),s&&r&&t.index(o)==n.index(o)?(PV(s,r),lp(ap(s,BV(e,t,n,i,o+1)),l)):(s&&lp(ap(s,Eb(e,t,o+1)),l),iv(t,n,o,l),r&&lp(ap(r,Eb(n,i,o+1)),l)),iv(i,null,o,l),new sn(l)}function Eb(e,t,n){let i=[];if(iv(null,e,n,i),e.depth>n){let o=h6(e,t,n+1);lp(ap(o,Eb(e,t,n+1)),i)}return iv(t,null,n,i),new sn(i)}function sIe(e,t){let n=t.depth-e.openStart,o=t.node(n).copy(e.content);for(let s=n-1;s>=0;s--)o=t.node(s).copy(sn.from(o));return{start:o.resolveNoCache(e.openStart+n),end:o.resolveNoCache(o.content.size-e.openEnd-n)}}class jv{constructor(t,n,i){this.pos=t,this.path=n,this.parentOffset=i,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let i=this.pos-this.path[this.path.length-1],o=t.child(n);return i?t.child(n).cut(i):o}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let i=this.path[n*3],o=n==0?0:this.path[n*3-1]+1;for(let s=0;s0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos=0;i--)if(t.pos<=this.end(i)&&(!n||n(this.node(i))))return new aIe(this,t,i);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let i=[],o=0,s=n;for(let r=t;;){let{index:l,offset:a}=r.content.findIndex(s),u=s-a;if(i.push(r,l,o+a),!u||(r=r.child(l),r.isText))break;s=u-1,o+=a+1}return new jv(n,i,s)}static resolveCached(t,n){let i=uR.get(t);if(i)for(let s=0;st&&this.nodesBetween(t,n,s=>(i.isInSet(s.marks)&&(o=!0),!o)),o}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),$V(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,i=sn.empty,o=0,s=i.childCount){let r=this.contentMatchAt(t).matchFragment(i,o,s),l=r&&r.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let a=o;an.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let i;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");i=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,i)}let o=sn.fromJSON(t,n.content),s=t.nodeType(n.type).create(n.attrs,o,i);return s.type.checkAttrs(s.attrs),s}};up.prototype.text=void 0;class Lb extends up{constructor(t,n,i,o){if(super(t,n,null,o),!i)throw new RangeError("Empty text nodes are not allowed");this.text=i}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):$V(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new Lb(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new Lb(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function $V(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class Cp{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let i=new cIe(t,n);if(i.next==null)return Cp.empty;let o=zV(i);i.next&&i.err("Unexpected trailing text");let s=vIe(gIe(o));return yIe(s,i),s}matchType(t){for(let n=0;nu.createAndFill()));for(let u=0;u=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(i){t.push(i);for(let o=0;o{let s=o+(i.validEnd?"*":" ")+" ";for(let r=0;r"+t.indexOf(i.next[r].next);return s}).join(` +`)}}Cp.empty=new Cp(!0);class cIe{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function zV(e){let t=[];do t.push(dIe(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function dIe(e){let t=[];do t.push(fIe(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function fIe(e){let t=mIe(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=hIe(e,t);else break;return t}function cR(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function hIe(e,t){let n=cR(e),i=n;return e.eat(",")&&(e.next!="}"?i=cR(e):i=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:i,expr:t}}function pIe(e,t){let n=e.nodeTypes,i=n[t];if(i)return[i];let o=[];for(let s in n){let r=n[s];r.isInGroup(t)&&o.push(r)}return o.length==0&&e.err("No node type or group '"+t+"' found"),o}function mIe(e){if(e.eat("(")){let t=zV(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=pIe(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function gIe(e){let t=[[]];return o(s(e,0),n()),t;function n(){return t.push([])-1}function i(r,l,a){let u={term:a,to:l};return t[r].push(u),u}function o(r,l){r.forEach(a=>a.to=l)}function s(r,l){if(r.type=="choice")return r.exprs.reduce((a,u)=>a.concat(s(u,l)),[]);if(r.type=="seq")for(let a=0;;a++){let u=s(r.exprs[a],l);if(a==r.exprs.length-1)return u;o(u,l=n())}else if(r.type=="star"){let a=n();return i(l,a),o(s(r.expr,a),a),[i(a)]}else if(r.type=="plus"){let a=n();return o(s(r.expr,l),a),o(s(r.expr,a),a),[i(a)]}else{if(r.type=="opt")return[i(l)].concat(s(r.expr,l));if(r.type=="range"){let a=l;for(let u=0;u{e[r].forEach(({term:l,to:a})=>{if(!l)return;let u;for(let c=0;c{u||o.push([l,u=[]]),u.indexOf(c)==-1&&u.push(c)})})});let s=t[i.join(",")]=new Cp(i.indexOf(e.length-1)>-1);for(let r=0;r-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:WV(this.attrs,t)}create(t=null,n,i){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new up(this,this.computeAttrs(t),sn.from(n),Fi.setFrom(i))}createChecked(t=null,n,i){return n=sn.from(n),this.checkContent(n),new up(this,this.computeAttrs(t),n,Fi.setFrom(i))}createAndFill(t=null,n,i){if(t=this.computeAttrs(t),n=sn.from(n),n.size){let r=this.contentMatch.fillBefore(n);if(!r)return null;n=r.append(n)}let o=this.contentMatch.matchFragment(n),s=o&&o.fillBefore(sn.empty,!0);return s?new up(this,t,n.append(s),Fi.setFrom(i)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let i=0;i-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;ni[s]=new VV(s,n,r));let o=n.spec.topNode||"doc";if(!i[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!i.text)throw new RangeError("Every schema needs a 'text' type");for(let s in i.text.attrs)throw new RangeError("The text node type should not have attributes");return i}};function kIe(e,t,n){let i=n.split("|");return o=>{let s=o===null?"null":typeof o;if(i.indexOf(s)<0)throw new RangeError(`Expected value of type ${i} for attribute ${t} on type ${e}, got ${s}`)}}class bIe{constructor(t,n,i){this.hasDefault=Object.prototype.hasOwnProperty.call(i,"default"),this.default=i.default,this.validate=typeof i.validate=="string"?kIe(t,n,i.validate):i.validate}get isRequired(){return!this.hasDefault}}class aw{constructor(t,n,i,o){this.name=t,this.rank=n,this.schema=i,this.spec=o,this.attrs=UV(t,o.attrs),this.excluded=null;let s=HV(this.attrs);this.instance=s?new Fi(this,s):null}create(t=null){return!t&&this.instance?this.instance:new Fi(this,WV(this.attrs,t))}static compile(t,n){let i=Object.create(null),o=0;return t.forEach((s,r)=>i[s]=new aw(s,o++,n,r)),i}removeFromSet(t){for(var n=0;n-1}}class wIe{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let o in t)n[o]=t[o];n.nodes=tr.from(t.nodes),n.marks=tr.from(t.marks||{}),this.nodes=fR.compile(this.spec.nodes,this),this.marks=aw.compile(this.spec.marks,this);let i=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let s=this.nodes[o],r=s.spec.content||"",l=s.spec.marks;if(s.contentMatch=i[r]||(i[r]=Cp.parse(r,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=l=="_"?null:l?hR(this,l.split(" ")):l==""||!s.inlineContent?[]:null}for(let o in this.marks){let s=this.marks[o],r=s.spec.excludes;s.excluded=r==null?[s]:r==""?[]:hR(this,r.split(" "))}this.nodeFromJSON=o=>up.fromJSON(this,o),this.markFromJSON=o=>Fi.fromJSON(this,o),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,i,o){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof fR){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,i,o)}text(t,n){let i=this.nodes.text;return new Lb(i,i.defaultAttrs,t,Fi.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}}function hR(e,t){let n=[];for(let i=0;i-1)&&n.push(r=a)}if(!r)throw new SyntaxError("Unknown mark type: '"+t[i]+"'")}return n}function CIe(e){return e.tag!=null}function AIe(e){return e.style!=null}let KV=class m6{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[];let i=this.matchedStyles=[];n.forEach(o=>{if(CIe(o))this.tags.push(o);else if(AIe(o)){let s=/[^=]*/.exec(o.style)[0];i.indexOf(s)<0&&i.push(s),this.styles.push(o)}}),this.normalizeLists=!this.tags.some(o=>{if(!/^(ul|ol)\b/.test(o.tag)||!o.node)return!1;let s=t.nodes[o.node];return s.contentMatch.matchType(s)})}parse(t,n={}){let i=new mR(this,n,!1);return i.addAll(t,Fi.none,n.from,n.to),i.finish()}parseSlice(t,n={}){let i=new mR(this,n,!0);return i.addAll(t,Fi.none,n.from,n.to),mn.maxOpen(i.finish())}matchTag(t,n,i){for(let o=i?this.tags.indexOf(i)+1:0;ot.length&&(l.charCodeAt(t.length)!=61||l.slice(t.length+1)!=n))){if(r.getAttrs){let a=r.getAttrs(n);if(a===!1)continue;r.attrs=a||void 0}return r}}}static schemaRules(t){let n=[];function i(o){let s=o.priority==null?50:o.priority,r=0;for(;r{i(r=gR(r)),r.mark||r.ignore||r.clearMark||(r.mark=o)})}for(let o in t.nodes){let s=t.nodes[o].spec.parseDOM;s&&s.forEach(r=>{i(r=gR(r)),r.node||r.ignore||r.mark||(r.node=o)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new m6(t,m6.schemaRules(t)))}};const ZV={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},xIe={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},GV={ol:!0,ul:!0},Hv=1,g6=2,ov=4;function pR(e,t,n){return t!=null?(t?Hv:0)|(t==="full"?g6:0):e&&e.whitespace=="pre"?Hv|g6:n&~ov}class Jy{constructor(t,n,i,o,s,r){this.type=t,this.attrs=n,this.marks=i,this.solid=o,this.options=r,this.content=[],this.activeMarks=Fi.none,this.match=s||(r&ov?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(sn.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let i=this.type.contentMatch,o;return(o=i.findWrapping(t.type))?(this.match=i,o):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&Hv)){let i=this.content[this.content.length-1],o;if(i&&i.isText&&(o=/[ \t\r\n\u000c]+$/.exec(i.text))){let s=i;i.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-o[0].length))}}let n=sn.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(sn.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!ZV.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class mR{constructor(t,n,i){this.parser=t,this.options=n,this.isOpen=i,this.open=0,this.localPreserveWS=!1;let o=n.topNode,s,r=pR(null,n.preserveWhitespace,0)|(i?ov:0);o?s=new Jy(o.type,o.attrs,Fi.none,!0,n.topMatch||o.type.contentMatch,r):i?s=new Jy(null,null,Fi.none,!0,null,r):s=new Jy(t.schema.topNodeType,null,Fi.none,!0,null,r),this.nodes=[s],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,n){t.nodeType==3?this.addTextNode(t,n):t.nodeType==1&&this.addElement(t,n)}addTextNode(t,n){let i=t.nodeValue,o=this.top,s=o.options&g6?"full":this.localPreserveWS||(o.options&Hv)>0,{schema:r}=this.parser;if(s==="full"||o.inlineContext(t)||/[^ \t\r\n\u000c]/.test(i)){if(s)if(s==="full")i=i.replace(/\r\n?/g,` +`);else if(r.linebreakReplacement&&/[\r\n]/.test(i)&&this.top.findWrapping(r.linebreakReplacement.create())){let l=i.split(/\r?\n|\r/);for(let a=0;a!a.clearMark(u)):n=n.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return n}addElementByRule(t,n,i,o){let s,r;if(n.node)if(r=this.parser.schema.nodes[n.node],r.isLeaf)this.insertNode(r.create(n.attrs),i,t.nodeName=="BR")||this.leafFallback(t,i);else{let a=this.enter(r,n.attrs||null,i,n.preserveWhitespace);a&&(s=!0,i=a)}else{let a=this.parser.schema.marks[n.mark];i=i.concat(a.create(n.attrs))}let l=this.top;if(r&&r.isLeaf)this.findInside(t);else if(o)this.addElement(t,i,o);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(a=>this.insertNode(a,i,!1));else{let a=t;typeof n.contentElement=="string"?a=t.querySelector(n.contentElement):typeof n.contentElement=="function"?a=n.contentElement(t):n.contentElement&&(a=n.contentElement),this.findAround(t,a,!0),this.addAll(a,i),this.findAround(t,a,!1)}s&&this.sync(l)&&this.open--}addAll(t,n,i,o){let s=i||0;for(let r=i?t.childNodes[i]:t.firstChild,l=o==null?null:t.childNodes[o];r!=l;r=r.nextSibling,++s)this.findAtPoint(t,s),this.addDOM(r,n);this.findAtPoint(t,s)}findPlace(t,n,i){let o,s;for(let r=this.open,l=0;r>=0;r--){let a=this.nodes[r],u=a.findWrapping(t);if(u&&(!o||o.length>u.length+l)&&(o=u,s=a,!u.length))break;if(a.solid){if(i)break;l+=2}}if(!o)return null;this.sync(s);for(let r=0;r(r.type?r.type.allowsMarkType(u.type):vR(u.type,t))?(a=u.addToSet(a),!1):!0),this.nodes.push(new Jy(t,n,a,o,null,l)),this.open++,i}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(t){for(let n=this.open;n>=0;n--){if(this.nodes[n]==t)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=Hv)}return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let i=this.nodes[n].content;for(let o=i.length-1;o>=0;o--)t+=i[o].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let i=0;i-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),i=this.options.context,o=!this.isOpen&&(!i||i.parent.type==this.nodes[0].type),s=-(i?i.depth+1:0)+(o?0:1),r=(l,a)=>{for(;l>=0;l--){let u=n[l];if(u==""){if(l==n.length-1||l==0)continue;for(;a>=s;a--)if(r(l-1,a))return!0;return!1}else{let c=a>0||a==0&&o?this.nodes[a].type:i&&a>=s?i.node(a-s).type:null;if(!c||c.name!=u&&!c.isInGroup(u))return!1;a--}}return!0};return r(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let i=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(i&&i.isTextblock&&i.defaultAttrs)return i}for(let n in this.parser.schema.nodes){let i=this.parser.schema.nodes[n];if(i.isTextblock&&i.defaultAttrs)return i}}}function SIe(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let i=t.nodeType==1?t.nodeName.toLowerCase():null;i&&GV.hasOwnProperty(i)&&n?(n.appendChild(t),t=n):i=="li"?n=t:i&&(n=null)}}function _Ie(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function gR(e){let t={};for(let n in e)t[n]=e[n];return t}function vR(e,t){let n=t.schema.nodes;for(let i in n){let o=n[i];if(!o.allowsMarkType(e))continue;let s=[],r=l=>{s.push(l);for(let a=0;a{if(s.length||r.marks.length){let l=0,a=0;for(;l=0;o--){let s=this.serializeMark(t.marks[o],t.isInline,n);s&&((s.contentDOM||s.dom).appendChild(i),i=s.dom)}return i}serializeMark(t,n,i={}){let o=this.marks[t.type.name];return o&&Y9(Xy(i),o(t,n),null,t.attrs)}static renderSpec(t,n,i=null,o){return typeof n=="string"?{dom:t.createTextNode(n)}:Y9(t,n,i,o)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new uc(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=yR(t.nodes);return n.text||(n.text=i=>i.text),n}static marksFromSchema(t){return yR(t.marks)}}function yR(e){let t={};for(let n in e){let i=e[n].spec.toDOM;i&&(t[n]=i)}return t}function Xy(e){return e.document||window.document}const kR=new WeakMap;function IIe(e){let t=kR.get(e);return t===void 0&&kR.set(e,t=MIe(e)),t}function MIe(e){let t=null;function n(i){if(i&&typeof i=="object")if(Array.isArray(i))if(typeof i[0]=="string")t||(t=[]),t.push(i);else for(let o=0;o-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let r=o.indexOf(" ");r>0&&(n=o.slice(0,r),o=o.slice(r+1));let l,a=n?e.createElementNS(n,o):e.createElement(o),u=t[1],c=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){c=2;for(let d in u)if(u[d]!=null){let f=d.indexOf(" ");f>0?a.setAttributeNS(d.slice(0,f),d.slice(f+1),u[d]):d=="style"&&a.style?a.style.cssText=u[d]:a.setAttribute(d,u[d])}}for(let d=c;dc)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else if(typeof f=="string")a.appendChild(e.createTextNode(f));else{let{dom:h,contentDOM:m}=Y9(e,f,n,i);if(a.appendChild(h),m){if(l)throw new RangeError("Multiple content holes");l=m}}}return{dom:a,contentDOM:l}}const ri=new wIe({nodes:{doc:{content:"block+"},paragraph:{group:"block",content:"inline*",toDOM:()=>["p",0],parseDOM:[{tag:"p"}]},text:{group:"inline"},mention:{group:"inline",inline:!0,atom:!0,selectable:!0,attrs:{kind:{},name:{},path:{default:""}},leafText:e=>Rp(e.attrs),toDOM:e=>{const t=e.attrs;return["span",{class:`mention-pill mention-${t.kind}`,"data-mention-path":t.path},t.name]}},attachment:{group:"inline",inline:!0,atom:!0,selectable:!0,attrs:{attId:{},name:{},kind:{}},leafText:e=>Nf(e.attrs),toDOM:e=>{const t=e.attrs;return["span",{class:`attachment-pill attachment-${t.kind}`,"data-attachment-id":t.attId,"data-attachment-kind":t.kind,"data-attachment-name":t.name},t.name]}},quote:{group:"inline",inline:!0,atom:!0,selectable:!0,attrs:{text:{},comment:{default:""},source:{default:""}},leafText:e=>sw(e.attrs),toDOM:e=>{const t=e.attrs,n={class:"quote-pill","data-quote-text":t.text};return typeof t.comment=="string"&&t.comment.length>0&&(n["data-quote-comment"]=t.comment),typeof t.source=="string"&&t.source.length>0&&(n["data-quote-source"]=t.source),["span",n,Mm(t.text)]}}}});function QV(e){return ri.nodes.mention.create(e)}function YV(e){return ri.nodes.attachment.create(e)}function JV(e){return ri.nodes.quote.create(e)}function TIe(e,t){return e?_V(e,t).map(n=>n.type==="mention"?QV(n.attrs):n.type==="attachment"?YV(n.attrs):n.type==="quote"?JV(n.attrs):ri.text(n.value)):[]}function Wv(e,t){const n=e.split(` +`);return ri.node("doc",null,n.map(i=>i?ri.node("paragraph",null,t?.reviveMentions?TIe(i,t?.attachmentKindFor):ri.text(i)):ri.node("paragraph")))}function qv(e){return e.textBetween(0,e.content.size,` +`)}const XV=65535,eK=Math.pow(2,16);function EIe(e,t){return e+t*eK}function bR(e){return e&XV}function LIe(e){return(e-(e&XV))/eK}const tK=1,nK=2,J9=4,iK=8;class v6{constructor(t,n,i){this.pos=t,this.delInfo=n,this.recover=i}get deleted(){return(this.delInfo&iK)>0}get deletedBefore(){return(this.delInfo&(tK|J9))>0}get deletedAfter(){return(this.delInfo&(nK|J9))>0}get deletedAcross(){return(this.delInfo&J9)>0}}class ia{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&ia.empty)return ia.empty}recover(t){let n=0,i=bR(t);if(!this.inverted)for(let o=0;ot)break;let u=this.ranges[l+s],c=this.ranges[l+r],d=a+u;if(t<=d){let f=u?t==a?-1:t==d?1:n:n,h=a+o+(f<0?0:c);if(i)return h;let m=t==(n<0?a:d)?null:EIe(l/3,t-a),g=t==a?nK:t==d?tK:J9;return(n<0?t!=a:t!=d)&&(g|=iK),new v6(h,g,m)}o+=c-u}return i?t+o:new v6(t+o,0,null)}touches(t,n){let i=0,o=bR(n),s=this.inverted?2:1,r=this.inverted?1:2;for(let l=0;lt)break;let u=this.ranges[l+s],c=a+u;if(t<=c&&l==o*3)return!0;i+=this.ranges[l+r]-u}return!1}forEach(t){let n=this.inverted?2:1,i=this.inverted?1:2;for(let o=0,s=0;o=0;n--){let o=t.getMirror(n);this.appendMap(t._maps[n].invert(),o!=null&&o>n?i-o-1:void 0)}}invert(){let t=new Uv;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let i=this.from;is&&a!r.isAtom||!l.type.allowsMarkType(this.mark.type)?r:r.mark(this.mark.addToSet(r.marks)),o),n.openStart,n.openEnd);return fs.fromReplace(t,this.from,this.to,s)}invert(){return new nc(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),i=t.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new nf(n.pos,i.pos,this.mark)}merge(t){return t instanceof nf&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new nf(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new nf(n.from,n.to,t.markFromJSON(n.mark))}}Nr.jsonID("addMark",nf);class nc extends Nr{constructor(t,n,i){super(),this.from=t,this.to=n,this.mark=i}apply(t){let n=t.slice(this.from,this.to),i=new mn(FS(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),t),n.openStart,n.openEnd);return fs.fromReplace(t,this.from,this.to,i)}invert(){return new nf(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),i=t.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new nc(n.pos,i.pos,this.mark)}merge(t){return t instanceof nc&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new nc(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new nc(n.from,n.to,t.markFromJSON(n.mark))}}Nr.jsonID("removeMark",nc);class of extends Nr{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return fs.fail("No node at mark step's position");let i=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return fs.fromReplace(t,this.pos,this.pos+1,new mn(sn.from(i),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let i=this.mark.addToSet(n.marks);if(i.length==n.marks.length){for(let o=0;oi.pos?null:new ca(n.pos,i.pos,o,s,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new ca(n.from,n.to,n.gapFrom,n.gapTo,mn.fromJSON(t,n.slice),n.insert,!!n.structure)}}Nr.jsonID("replaceAround",ca);function y6(e,t,n){let i=e.resolve(t),o=n-t,s=i.depth;for(;o>0&&s>0&&i.indexAfter(s)==i.node(s).childCount;)s--,o--;if(o>0){let r=i.node(s).maybeChild(i.indexAfter(s));for(;o>0;){if(!r||r.isLeaf)return!0;r=r.firstChild,o--}}return!1}function NIe(e,t,n,i){let o=[],s=[],r,l;e.doc.nodesBetween(t,n,(a,u,c)=>{if(!a.isInline)return;let d=a.marks;if(!i.isInSet(d)&&c.type.allowsMarkType(i.type)){let f=Math.max(u,t),h=Math.min(u+a.nodeSize,n),m=i.addToSet(d);for(let g=0;ge.step(a)),s.forEach(a=>e.step(a))}function FIe(e,t,n,i){let o=[],s=0;e.doc.nodesBetween(t,n,(r,l)=>{if(!r.isInline)return;s++;let a=null;if(i instanceof aw){let u=r.marks,c;for(;c=i.isInSet(u);)(a||(a=[])).push(c),u=c.removeFromSet(u)}else i?i.isInSet(r.marks)&&(a=[i]):a=r.marks;if(a&&a.length){let u=Math.min(l+r.nodeSize,n);for(let c=0;ce.step(new nc(r.from,r.to,r.style)))}function DS(e,t,n,i=n.contentMatch,o=!0){let s=e.doc.nodeAt(t),r=[],l=t+1;for(let a=0;a=0;a--)e.step(r[a])}function DIe(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function RS(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let i=e.depth,o=0,s=0;;--i){let r=e.$from.node(i),l=e.$from.index(i)+o,a=e.$to.indexAfter(i)-s;if(in;m--)g||i.index(m)>0?(g=!0,c=sn.from(i.node(m).copy(c)),d++):a--;let f=sn.empty,h=0;for(let m=s,g=!1;m>n;m--)g||o.after(m+1)=0;r--){if(i.size){let l=n[r].type.contentMatch.matchFragment(i);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=sn.from(n[r].type.create(n[r].attrs,i))}let o=t.start,s=t.end;e.step(new ca(o,s,o,s,new mn(i,0,0),n.length,!0))}function PIe(e,t,n,i,o){if(!i.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=e.steps.length;e.doc.nodesBetween(t,n,(r,l)=>{let a=typeof o=="function"?o(r):o;if(r.isTextblock&&!r.hasMarkup(i,a)&&BIe(e.doc,e.mapping.slice(s).map(l),i)){let u=null;if(i.schema.linebreakReplacement){let h=i.whitespace=="pre",m=!!i.contentMatch.matchType(i.schema.linebreakReplacement);h&&!m?u=!1:!h&&m&&(u=!0)}u===!1&&sK(e,r,l,s),DS(e,e.mapping.slice(s).map(l,1),i,void 0,u===null);let c=e.mapping.slice(s),d=c.map(l,1),f=c.map(l+r.nodeSize,1);return e.step(new ca(d,f,d+1,f-1,new mn(sn.from(i.create(a,null,r.marks)),0,0),1,!0)),u===!0&&oK(e,r,l,s),!1}})}function oK(e,t,n,i){t.forEach((o,s)=>{if(o.isText){let r,l=/\r?\n|\r/g;for(;r=l.exec(o.text);){let a=e.mapping.slice(i).map(n+1+s+r.index);e.replaceWith(a,a+1,t.type.schema.linebreakReplacement.create())}}})}function sK(e,t,n,i){t.forEach((o,s)=>{if(o.type==o.type.schema.linebreakReplacement){let r=e.mapping.slice(i).map(n+1+s);e.replaceWith(r,r+1,t.type.schema.text(` +`))}})}function BIe(e,t,n){let i=e.resolve(t),o=i.index();return i.parent.canReplaceWith(o,o+1,n)}function $Ie(e,t,n,i,o){let s=e.doc.nodeAt(t);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let r=n.create(i,null,o||s.marks);if(s.isLeaf)return e.replaceWith(t,t+s.nodeSize,r);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new ca(t,t+s.nodeSize,t+1,t+s.nodeSize-1,new mn(sn.from(r),0,0),1,!0))}function X9(e,t,n=1,i){let o=e.resolve(t),s=o.depth-n,r=i&&i[i.length-1]||o.parent;if(s<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!r.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let u=o.depth-1,c=n-2;u>s;u--,c--){let d=o.node(u),f=o.index(u);if(d.type.spec.isolating)return!1;let h=d.content.cutByIndex(f,d.childCount),m=i&&i[c+1];m&&(h=h.replaceChild(0,m.type.create(m.attrs)));let g=i&&i[c]||d;if(!d.canReplace(f+1,d.childCount)||!g.type.validContent(h))return!1}let l=o.indexAfter(s),a=i&&i[0];return o.node(s).canReplaceWith(l,l,a?a.type:o.node(s+1).type)}function zIe(e,t,n=1,i){let o=e.doc.resolve(t),s=sn.empty,r=sn.empty;for(let l=o.depth,a=o.depth-n,u=n-1;l>a;l--,u--){s=sn.from(o.node(l).copy(s));let c=i&&i[u];r=sn.from(c?c.type.create(c.attrs,r):o.node(l).copy(r))}e.step(new Gs(t,t,new mn(s.append(r),n,n),!0))}function rK(e,t){let n=e.resolve(t),i=n.index();return HIe(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(i,i+1)}function jIe(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:i}=e.type.schema;for(let o=0;o=0;o--){let s=i.index(o);if(i.node(o).canReplaceWith(s,s,n))return i.before(o+1);if(s>0)return null}if(i.parentOffset==i.parent.content.size)for(let o=i.depth-1;o>=0;o--){let s=i.indexAfter(o);if(i.node(o).canReplaceWith(s,s,n))return i.after(o+1);if(s=0;r--){let l=r==i.depth?0:i.pos<=(i.start(r+1)+i.end(r+1))/2?-1:1,a=i.index(r)+(l>0?1:0),u=i.node(r),c=!1;if(s==1)c=u.canReplace(a,a,o);else{let d=u.contentMatchAt(a).findWrapping(o.firstChild.type);c=d&&u.canReplaceWith(a,a,d[0])}if(c)return l==0?i.pos:l<0?i.before(r+1):i.after(r+1)}return null}function OS(e,t,n=t,i=mn.empty){if(t==n&&!i.size)return null;let o=e.resolve(t),s=e.resolve(n);return lK(o,s,i)?new Gs(t,n,i):new VIe(o,s,i).fit()}function lK(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class VIe{constructor(t,n,i){this.$from=t,this.$to=n,this.unplaced=i,this.frontier=[],this.placed=sn.empty;for(let o=0;o<=t.depth;o++){let s=t.node(o);this.frontier.push({type:s.type,match:s.contentMatchAt(t.indexAfter(o))})}for(let o=t.depth;o>0;o--)this.placed=sn.from(t.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,i=this.$from,o=this.close(t<0?this.$to:i.doc.resolve(t));if(!o)return null;let s=this.placed,r=i.depth,l=o.depth;for(;r&&l&&s.childCount==1;)s=s.firstChild.content,r--,l--;let a=new mn(s,r,l);return t>-1?new ca(i.pos,t,this.$to.pos,this.$to.end(),a,n):a.size||i.pos!=this.$to.pos?new Gs(i.pos,o.pos,a):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,i=0,o=this.unplaced.openEnd;i1&&(o=0),s.type.spec.isolating&&o<=i){t=i;break}n=s.content}for(let n=1;n<=2;n++)for(let i=n==1?t:this.unplaced.openStart;i>=0;i--){let o,s=null;i?(s=V8(this.unplaced.content,i-1).firstChild,o=s.content):o=this.unplaced.content;let r=o.firstChild;for(let l=this.depth;l>=0;l--){let{type:a,match:u}=this.frontier[l],c,d=null;if(n==1&&(r?u.matchType(r.type)||(d=u.fillBefore(sn.from(r),!1)):s&&a.compatibleContent(s.type)))return{sliceDepth:i,frontierDepth:l,parent:s,inject:d};if(n==2&&r&&(c=u.findWrapping(r.type)))return{sliceDepth:i,frontierDepth:l,parent:s,wrap:c};if(s&&u.matchType(s.type))break}}}openMore(){let{content:t,openStart:n,openEnd:i}=this.unplaced,o=V8(t,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new mn(t,n+1,Math.max(i,o.size+n>=t.size-i?n+1:0)),!0)}dropNode(){let{content:t,openStart:n,openEnd:i}=this.unplaced,o=V8(t,n);if(o.childCount<=1&&n>0){let s=t.size-n<=n+o.size;this.unplaced=new mn(m0(t,n-1,1),n-1,s?n-1:i)}else this.unplaced=new mn(m0(t,n,1),n,i)}placeNodes({sliceDepth:t,frontierDepth:n,parent:i,inject:o,wrap:s}){for(;this.depth>n;)this.closeFrontierNode();if(s)for(let g=0;g1||a==0||g.content.size)&&(d=y,c.push(aK(g.mark(f.allowedMarks(g.marks)),u==1?a:0,u==l.childCount?h:-1)))}let m=u==l.childCount;m||(h=-1),this.placed=g0(this.placed,n,sn.from(c)),this.frontier[n].match=d,m&&h<0&&i&&i.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,y=l;g1&&o==this.$to.end(--i);)++o;return o}findCloseLevel(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:i,type:o}=this.frontier[n],s=n=0;l--){let{match:a,type:u}=this.frontier[l],c=K8(t,l,u,a,!0);if(!c||c.childCount)continue e}return{depth:n,fit:r,move:s?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=g0(this.placed,n.depth,n.fit)),t=n.move;for(let i=n.depth+1;i<=t.depth;i++){let o=t.node(i),s=o.type.contentMatch.fillBefore(o.content,!0,t.index(i));this.openFrontierNode(o.type,o.attrs,s)}return t}openFrontierNode(t,n=null,i){let o=this.frontier[this.depth];o.match=o.match.matchType(t),this.placed=g0(this.placed,this.depth,sn.from(t.create(n,i))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(sn.empty,!0);n.childCount&&(this.placed=g0(this.placed,this.frontier.length,n))}}function m0(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(m0(e.firstChild.content,t-1,n)))}function g0(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(g0(e.lastChild.content,t-1,n)))}function V8(e,t){for(let n=0;n1&&(i=i.replaceChild(0,aK(i.firstChild,t-1,i.childCount==1?n-1:0))),t>0&&(i=e.type.contentMatch.fillBefore(i).append(i),n<=0&&(i=i.append(e.type.contentMatch.matchFragment(i).fillBefore(sn.empty,!0)))),e.copy(i)}function K8(e,t,n,i,o){let s=e.node(t),r=o?e.indexAfter(t):e.index(t);if(r==s.childCount&&!n.compatibleContent(s.type))return null;let l=i.fillBefore(s.content,!0,r);return l&&!KIe(n,s.content,r)?l:null}function KIe(e,t,n){for(let i=n;i0;f--,h--){let m=o.node(f).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;r.indexOf(f)>-1?l=f:o.before(f)==h&&r.splice(1,0,-f)}let a=r.indexOf(l),u=[],c=i.openStart;for(let f=i.content,h=0;;h++){let m=f.firstChild;if(u.push(m),h==i.openStart)break;f=m.content}for(let f=c-1;f>=0;f--){let h=u[f],m=ZIe(h.type);if(m&&!h.sameMarkup(o.node(Math.abs(l)-1)))c=f;else if(m||!h.type.isTextblock)break}for(let f=i.openStart;f>=0;f--){let h=(f+c+1)%(i.openStart+1),m=u[h];if(m)for(let g=0;g=0&&(e.replace(t,n,i),!(e.steps.length>d));f--){let h=r[f];h<0||(t=o.before(h),n=s.after(h))}}function uK(e,t,n,i,o){if(ti){let s=o.contentMatchAt(0),r=s.fillBefore(e).append(e);e=r.append(s.matchFragment(r).fillBefore(sn.empty,!0))}return e}function QIe(e,t,n,i){if(!i.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let o=qIe(e.doc,t,i.type);o!=null&&(t=n=o)}e.replaceRange(t,n,new mn(sn.from(i),0,0))}function YIe(e,t,n){let i=e.doc.resolve(t),o=e.doc.resolve(n);if(i.parent.isTextblock&&o.parent.isTextblock&&i.start()!=o.start()&&i.parentOffset==0&&o.parentOffset==0){let r=i.sharedDepth(n),l=!1;for(let a=i.depth;a>r;a--)i.node(a).type.spec.isolating&&(l=!0);for(let a=o.depth;a>r;a--)o.node(a).type.spec.isolating&&(l=!0);if(!l){for(let a=i.depth;a>0&&t==i.start(a);a--)t=i.before(a);for(let a=o.depth;a>0&&n==o.start(a);a--)n=o.before(a);i=e.doc.resolve(t),o=e.doc.resolve(n)}}let s=cK(i,o);for(let r=0;r0&&(a||i.node(l-1).canReplace(i.index(l-1),o.indexAfter(l-1))))return e.delete(i.before(l),o.after(l))}for(let r=1;r<=i.depth&&r<=o.depth;r++)if(t-i.start(r)==i.depth-r&&n>i.end(r)&&o.end(r)-n!=o.depth-r&&i.start(r-1)==o.start(r-1)&&i.node(r-1).canReplace(i.index(r-1),o.index(r-1)))return e.delete(i.before(r),n);e.delete(t,n)}function cK(e,t){let n=[],i=Math.min(e.depth,t.depth);for(let o=i;o>=0;o--){let s=e.start(o);if(st.pos+(t.depth-o)||e.node(o).type.spec.isolating||t.node(o).type.spec.isolating)break;(s==t.start(o)||o==e.depth&&o==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&o&&t.start(o-1)==s-1)&&n.push(o)}return n}class dm extends Nr{constructor(t,n,i){super(),this.pos=t,this.attr=n,this.value=i}apply(t){let n=t.nodeAt(this.pos);if(!n)return fs.fail("No node at attribute step's position");let i=Object.create(null);for(let s in n.attrs)i[s]=n.attrs[s];i[this.attr]=this.value;let o=n.type.create(i,null,n.marks);return fs.fromReplace(t,this.pos,this.pos+1,new mn(sn.from(o),0,n.isLeaf?0:1))}getMap(){return ia.empty}invert(t){return new dm(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new dm(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new dm(n.pos,n.attr,n.value)}}Nr.jsonID("attr",dm);class Vv extends Nr{constructor(t,n){super(),this.attr=t,this.value=n}apply(t){let n=Object.create(null);for(let o in t.attrs)n[o]=t.attrs[o];n[this.attr]=this.value;let i=t.type.create(n,t.content,t.marks);return fs.ok(i)}getMap(){return ia.empty}invert(t){return new Vv(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Vv(n.attr,n.value)}}Nr.jsonID("docAttr",Vv);let Tm=class extends Error{};Tm=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};Tm.prototype=Object.create(Error.prototype);Tm.prototype.constructor=Tm;Tm.prototype.name="TransformError";class JIe{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new Uv}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new Tm(n.failed);return this}maybeStep(t){let n=t.apply(this.doc);return n.failed||this.addStep(t,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let t=1e9,n=-1e9;for(let i=0;i{t=Math.min(t,l),n=Math.max(n,a)})}return t==1e9?null:{from:t,to:n}}addStep(t,n){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=n}replace(t,n=t,i=mn.empty){let o=OS(this.doc,t,n,i);return o&&this.step(o),this}replaceWith(t,n,i){return this.replace(t,n,new mn(sn.from(i),0,0))}delete(t,n){return this.replace(t,n,mn.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,i){return GIe(this,t,n,i),this}replaceRangeWith(t,n,i){return QIe(this,t,n,i),this}deleteRange(t,n){return YIe(this,t,n),this}lift(t,n){return RIe(this,t,n),this}join(t,n=1){return WIe(this,t,n),this}wrap(t,n){return OIe(this,t,n),this}setBlockType(t,n=t,i,o=null){return PIe(this,t,n,i,o),this}setNodeMarkup(t,n,i=null,o){return $Ie(this,t,n,i,o),this}setNodeAttribute(t,n,i){return this.step(new dm(t,n,i)),this}setDocAttribute(t,n){return this.step(new Vv(t,n)),this}addNodeMark(t,n){return this.step(new of(t,n)),this}removeNodeMark(t,n){let i=this.doc.nodeAt(t);if(!i)throw new RangeError("No node at position "+t);if(n instanceof Fi)n.isInSet(i.marks)&&this.step(new Ap(t,n));else{let o=i.marks,s,r=[];for(;s=n.isInSet(o);)r.push(new Ap(t,s)),o=s.removeFromSet(o);for(let l=r.length-1;l>=0;l--)this.step(r[l])}return this}split(t,n=1,i){return zIe(this,t,n,i),this}addMark(t,n,i){return NIe(this,t,n,i),this}removeMark(t,n,i){return FIe(this,t,n,i),this}clearIncompatible(t,n,i){return DS(this,t,n,i),this}}const Z8=Object.create(null);class Bi{constructor(t,n,i){this.$anchor=t,this.$head=n,this.ranges=i||[new XIe(t.min(n),t.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let n=0;n=0;s--){let r=n<0?I1(t.node(0),t.node(s),t.before(s+1),t.index(s),n,i):I1(t.node(0),t.node(s),t.after(s+1),t.index(s)+1,n,i);if(r)return r}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new da(t.node(0))}static atStart(t){return I1(t,t,0,0,1)||new da(t)}static atEnd(t){return I1(t,t,t.content.size,t.childCount,-1)||new da(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let i=Z8[n.type];if(!i)throw new RangeError(`No selection type ${n.type} defined`);return i.fromJSON(t,n)}static jsonID(t,n){if(t in Z8)throw new RangeError("Duplicate use of selection JSON ID "+t);return Z8[t]=n,n.prototype.jsonID=t,n}getBookmark(){return Xn.between(this.$anchor,this.$head).getBookmark()}}Bi.prototype.visible=!0;class XIe{constructor(t,n){this.$from=t,this.$to=n}}let wR=!1;function CR(e){!wR&&!e.parent.inlineContent&&(wR=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class Xn extends Bi{constructor(t,n=t){CR(t),CR(n),super(t,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let i=t.resolve(n.map(this.head));if(!i.parent.inlineContent)return Bi.near(i);let o=t.resolve(n.map(this.anchor));return new Xn(o.parent.inlineContent?o:i,i)}replace(t,n=mn.empty){if(super.replace(t,n),n==mn.empty){let i=this.$from.marksAcross(this.$to);i&&t.ensureMarks(i)}}eq(t){return t instanceof Xn&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new uw(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Xn(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,i=n){let o=t.resolve(n);return new this(o,i==n?o:t.resolve(i))}static between(t,n,i){let o=t.pos-n.pos;if((!i||o)&&(i=o>=0?1:-1),!n.parent.inlineContent){let s=Bi.findFrom(n,i,!0)||Bi.findFrom(n,-i,!0);if(s)n=s.$head;else return Bi.near(n,i)}return t.parent.inlineContent||(o==0?t=n:(t=(Bi.findFrom(t,-i,!0)||Bi.findFrom(t,i,!0)).$anchor,t.pos0?0:1);o>0?r=0;r+=o){let l=t.child(r);if(l.isAtom){if(!s&&Kn.isSelectable(l))return Kn.create(e,n-(o<0?l.nodeSize:0))}else{let a=I1(e,l,n+o,o<0?l.childCount:0,o,s);if(a)return a}n+=l.nodeSize*o}return null}function AR(e,t,n){let i=e.steps.length-1;if(i{r==null&&(r=c)}),e.setSelection(Bi.near(e.doc.resolve(r),n))}const xR=1,e9=2,SR=4;class tMe extends JIe{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(t){return this.storedMarks=t,this.updated|=e9,this}ensureMarks(t){return Fi.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&e9)>0}addStep(t,n){super.addStep(t,n),this.updated=this.updated&~e9,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,n=!0){let i=this.selection;return n&&(t=t.mark(this.storedMarks||(i.empty?i.$from.marks():i.$from.marksAcross(i.$to)||Fi.none))),i.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,n,i){let o=this.doc.type.schema;if(n==null)return t?this.replaceSelectionWith(o.text(t),!0):this.deleteSelection();{if(i==null&&(i=n),!t)return this.deleteRange(n,i);let s=this.storedMarks;if(!s){let r=this.doc.resolve(n);s=i==n?r.marks():r.marksAcross(this.doc.resolve(i))}return this.replaceRangeWith(n,i,o.text(t,s)),!this.selection.empty&&this.selection.to==n+t.length&&this.setSelection(Bi.near(this.selection.$to)),this}}setMeta(t,n){return this.meta[typeof t=="string"?t:t.key]=n,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=SR,this}get scrolledIntoView(){return(this.updated&SR)>0}}function _R(e,t){return!t||!e?e:e.bind(t)}class v0{constructor(t,n,i){this.name=t,this.init=_R(n.init,i),this.apply=_R(n.apply,i)}}const nMe=[new v0("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new v0("selection",{init(e,t){return e.selection||Bi.atStart(t.doc)},apply(e){return e.selection}}),new v0("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,i){return i.selection.$cursor?e.storedMarks:null}}),new v0("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class G8{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=nMe.slice(),n&&n.forEach(i=>{if(this.pluginsByKey[i.key])throw new RangeError("Adding different instances of a keyed plugin ("+i.key+")");this.plugins.push(i),this.pluginsByKey[i.key]=i,i.spec.state&&this.fields.push(new v0(i.key,i.spec.state,i))})}}class Uh{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,n=-1){for(let i=0;ii.toJSON())),t&&typeof t=="object")for(let i in t){if(i=="doc"||i=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=t[i],s=o.spec.state;s&&s.toJSON&&(n[i]=s.toJSON.call(o,this[o.key]))}return n}static fromJSON(t,n,i){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let o=new G8(t.schema,t.plugins),s=new Uh(o);return o.fields.forEach(r=>{if(r.name=="doc")s.doc=up.fromJSON(t.schema,n.doc);else if(r.name=="selection")s.selection=Bi.fromJSON(s.doc,n.selection);else if(r.name=="storedMarks")n.storedMarks&&(s.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(i)for(let l in i){let a=i[l],u=a.spec.state;if(a.key==r.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(n,l)){s[r.name]=u.fromJSON.call(a,t,n[l],s);return}}s[r.name]=r.init(t,s)}}),s}}function dK(e,t,n){for(let i in e){let o=e[i];o instanceof Function?o=o.bind(t):i=="handleDOMEvents"&&(o=dK(o,t,{})),n[i]=o}return n}class b2{constructor(t){this.spec=t,this.props={},t.props&&dK(t.props,this,this.props),this.key=t.key?t.key.key:fK("plugin")}getState(t){return t[this.key]}}const Q8=Object.create(null);function fK(e){return e in Q8?e+"$"+ ++Q8[e]:(Q8[e]=0,e+"$")}class BS{constructor(t="key"){this.key=fK(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}function sv(e){return e.isText?e.text.length:e.type===ri.nodes.attachment?Nf(e.attrs).length:e.type===ri.nodes.quote?sw(e.attrs).length:Rp(e.attrs).length}function iMe(e,t){if(!t.parent.isTextblock)return ic(e,t.pos);if(t.textOffset>0)return ic(e,t.pos-t.textOffset);const n=t.nodeBefore;return n&&n.isText?ic(e,t.pos-n.nodeSize):ic(e,t.pos)}function nd(e,t){let n=Math.max(0,t),i=-1;return e.forEach((o,s)=>{if(i!==-1)return;let r=0;if(o.forEach(l=>{r+=sv(l)}),n>r){n-=r+1;return}o.forEach((l,a)=>{if(i!==-1)return;const u=s+1+a,c=sv(l);if(n<=c){l.isText?i=u+n:i=n===0?u:u+1;return}n-=c}),i===-1&&(i=s+1+o.content.size)}),i===-1?e.content.size-1:i}function ic(e,t){let n=0,i=-1;return e.forEach((o,s)=>{if(i!==-1)return;const r=s+o.nodeSize;if(t>r){o.forEach(a=>{n+=sv(a)}),n+=1;return}let l=0;o.forEach((a,u)=>{if(i!==-1)return;const c=s+1+u;if(a.isText){const d=c+a.nodeSize;if(t<=d){i=n+l+Math.max(0,t-c);return}l+=a.text.length}else{const d=c+1;if(t<=d){i=n+l+(t<=c?0:sv(a));return}l+=sv(a)}}),i===-1&&(i=n+l)}),i===-1?n:i}function oMe(e){const t=[];return e.forEach(n=>{n.forEach(i=>{!i.isText&&i.type===ri.nodes.mention&&i.attrs.kind==="skill"&&t.push({name:i.attrs.name})})}),t}function IR(e){return(t,n)=>{const i=t.selection.$head,o=e?i.start():i.end();return n&&n(t.tr.setSelection(Xn.create(t.doc,t.selection.$anchor.pos,o)).scrollIntoView()),!0}}var Nb=200,Ys=function(){};Ys.prototype.append=function(t){return t.length?(t=Ys.from(t),!this.length&&t||t.length=n?Ys.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))};Ys.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};Ys.prototype.forEach=function(t,n,i){n===void 0&&(n=0),i===void 0&&(i=this.length),n<=i?this.forEachInner(t,n,i,0):this.forEachInvertedInner(t,n,i,0)};Ys.prototype.map=function(t,n,i){n===void 0&&(n=0),i===void 0&&(i=this.length);var o=[];return this.forEach(function(s,r){return o.push(t(s,r))},n,i),o};Ys.from=function(t){return t instanceof Ys?t:t&&t.length?new hK(t):Ys.empty};var hK=(function(e){function t(i){e.call(this),this.values=i}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(o,s){return o==0&&s==this.length?this:new t(this.values.slice(o,s))},t.prototype.getInner=function(o){return this.values[o]},t.prototype.forEachInner=function(o,s,r,l){for(var a=s;a=r;a--)if(o(this.values[a],l+a)===!1)return!1},t.prototype.leafAppend=function(o){if(this.length+o.length<=Nb)return new t(this.values.concat(o.flatten()))},t.prototype.leafPrepend=function(o){if(this.length+o.length<=Nb)return new t(o.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t})(Ys);Ys.empty=new hK([]);var sMe=(function(e){function t(n,i){e.call(this),this.left=n,this.right=i,this.length=n.length+i.length,this.depth=Math.max(n.depth,i.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(i){return il&&this.right.forEachInner(i,Math.max(o-l,0),Math.min(this.length,s)-l,r+l)===!1)return!1},t.prototype.forEachInvertedInner=function(i,o,s,r){var l=this.left.length;if(o>l&&this.right.forEachInvertedInner(i,o-l,Math.max(s,l)-l,r+l)===!1||s=s?this.right.slice(i-s,o-s):this.left.slice(i,s).append(this.right.slice(0,o-s))},t.prototype.leafAppend=function(i){var o=this.right.leafAppend(i);if(o)return new t(this.left,o)},t.prototype.leafPrepend=function(i){var o=this.left.leafPrepend(i);if(o)return new t(o,this.right)},t.prototype.appendInner=function(i){return this.left.depth>=Math.max(this.right.depth,i.depth)+1?new t(this.left,new t(this.right,i)):new t(this,i)},t})(Ys);const rMe=500;class fu{constructor(t,n){this.items=t,this.eventCount=n}popEvent(t,n){if(this.eventCount==0)return null;let i=this.items.length;for(;;i--)if(this.items.get(i-1).selection){--i;break}let o,s;n&&(o=this.remapping(i,this.items.length),s=o.maps.length);let r=t.tr,l,a,u=[],c=[];return this.items.forEach((d,f)=>{if(!d.step){o||(o=this.remapping(i,f+1),s=o.maps.length),s--,c.push(d);return}if(o){c.push(new qu(d.map));let h=d.step.map(o.slice(s)),m;h&&r.maybeStep(h).doc&&(m=r.mapping.maps[r.mapping.maps.length-1],u.push(new qu(m,void 0,void 0,u.length+c.length))),s--,m&&o.appendMap(m,s)}else r.maybeStep(d.step);if(d.selection)return l=o?d.selection.map(o.slice(s)):d.selection,a=new fu(this.items.slice(0,i).append(c.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:a,transform:r,selection:l}}addTransform(t,n,i,o){let s=[],r=this.eventCount,l=this.items,a=!o&&l.length?l.get(l.length-1):null;for(let c=0;caMe&&(l=lMe(l,u),r-=u),new fu(l.append(s),r)}remapping(t,n){let i=new Uv;return this.items.forEach((o,s)=>{let r=o.mirrorOffset!=null&&s-o.mirrorOffset>=t?i.maps.length-o.mirrorOffset:void 0;i.appendMap(o.map,r)},t,n),i}addMaps(t){return this.eventCount==0?this:new fu(this.items.append(t.map(n=>new qu(n))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let i=[],o=Math.max(0,this.items.length-n),s=t.mapping,r=t.steps.length,l=this.eventCount;this.items.forEach(f=>{f.selection&&l--},o);let a=n;this.items.forEach(f=>{let h=s.getMirror(--a);if(h==null)return;r=Math.min(r,h);let m=s.maps[h];if(f.step){let g=t.steps[h].invert(t.docs[h]),y=f.selection&&f.selection.map(s.slice(a+1,h));y&&l++,i.push(new qu(m,g,y))}else i.push(new qu(m))},o);let u=[];for(let f=n;frMe&&(d=d.compress(this.items.length-i.length)),d}emptyItemCount(){let t=0;return this.items.forEach(n=>{n.step||t++}),t}compress(t=this.items.length){let n=this.remapping(0,t),i=n.maps.length,o=[],s=0;return this.items.forEach((r,l)=>{if(l>=t)o.push(r),r.selection&&s++;else if(r.step){let a=r.step.map(n.slice(i)),u=a&&a.getMap();if(i--,u&&n.appendMap(u,i),a){let c=r.selection&&r.selection.map(n.slice(i));c&&s++;let d=new qu(u.invert(),a,c),f,h=o.length-1;(f=o.length&&o[h].merge(d))?o[h]=f:o.push(d)}}else r.map&&i--},this.items.length,0),new fu(Ys.from(o.reverse()),s)}}fu.empty=new fu(Ys.empty,0);function lMe(e,t){let n;return e.forEach((i,o)=>{if(i.selection&&t--==0)return n=o,!1}),e.slice(n)}class qu{constructor(t,n,i,o){this.map=t,this.step=n,this.selection=i,this.mirrorOffset=o}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new qu(n.getMap().invert(),n,this.selection)}}}class qd{constructor(t,n,i,o,s){this.done=t,this.undone=n,this.prevRanges=i,this.prevTime=o,this.prevComposition=s}}const aMe=20;function uMe(e,t,n,i){let o=n.getMeta(cp),s;if(o)return o.historyState;n.getMeta(mK)&&(e=new qd(e.done,e.undone,null,0,-1));let r=n.getMeta("appendedTransaction");if(n.steps.length==0)return e;if(r&&r.getMeta(cp))return r.getMeta(cp).redo?new qd(e.done.addTransform(n,void 0,i,ek(t)),e.undone,MR(n.mapping.maps),e.prevTime,e.prevComposition):new qd(e.done,e.undone.addTransform(n,void 0,i,ek(t)),null,e.prevTime,e.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(r&&r.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),a=e.prevTime==0||!r&&e.prevComposition!=l&&(e.prevTime<(n.time||0)-i.newGroupDelay||!cMe(n,e.prevRanges)),u=r?Y8(e.prevRanges,n.mapping):MR(n.mapping.maps);return new qd(e.done.addTransform(n,a?t.selection.getBookmark():void 0,i,ek(t)),fu.empty,u,n.time,l??e.prevComposition)}else return(s=n.getMeta("rebased"))?new qd(e.done.rebased(n,s),e.undone.rebased(n,s),Y8(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new qd(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),Y8(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function cMe(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((i,o)=>{for(let s=0;s=t[s]&&(n=!0)}),n}function MR(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((i,o,s,r)=>t.push(s,r));return t}function Y8(e,t){if(!e)return null;let n=[];for(let i=0;i{let o=cp.getState(n);if(!o||(e?o.undone:o.done).eventCount==0)return!1;if(i){let s=dMe(o,n,e);s&&i(t?s.scrollIntoView():s)}return!0}}const vK=gK(!1,!0),k6=gK(!0,!0);function hMe(e,t,n){const i=nd(e.doc,n.start),o=nd(e.doc,n.end),s=qv(e.doc),r=n.start>0?s.charAt(n.start-1):"",l=s.charAt(n.end),a=[];(r==="!"||r==="\\")&&a.push(ri.text(" ")),a.push(QV(t)),(l===""||!/\s/.test(l))&&a.push(ri.text(" "));const u=e.tr.replaceWith(i,o,a);return u.setSelection(Xn.create(u.doc,i+a.reduce((c,d)=>c+d.nodeSize,0))),u.scrollIntoView()}function pMe(e,t,n){const i=nd(e.doc,n.start),o=nd(e.doc,n.end),s=e.tr.insertText(t,i,o);return s.setSelection(Xn.create(s.doc,i+t.length)),pK(s.scrollIntoView())}function mMe(e,t,n){const i=n?n.start:ic(e.doc,e.selection.from),o=n?n.end:ic(e.doc,e.selection.to),s=nd(e.doc,i),r=nd(e.doc,o),l=qv(e.doc),a=i>0?l.charAt(i-1):"",u=l.charAt(o),c=[];(a==="!"||a==="\\")&&c.push(ri.text(" ")),c.push(YV(t)),(u===""||!/\s/.test(u))&&c.push(ri.text(" "));const d=e.tr.replaceWith(s,r,c);return d.setSelection(Xn.create(d.doc,s+c.reduce((f,h)=>f+h.nodeSize,0))),d.scrollIntoView()}function gMe(e,t,n){const i=e.selection.to,o=qv(e.doc),s=ic(e.doc,i),r=s>0?o.charAt(s-1):"",l=o.charAt(s),a=[];r!==""&&!/\s/.test(r)&&a.push(ri.text(" ")),a.push(JV(n!==void 0&&n.length>0?{...t,comment:n}:t)),(l===""||!/\s/.test(l))&&a.push(ri.text(" "));const u=e.tr.replaceWith(i,i,a);return u.setSelection(Xn.create(u.doc,i+a.reduce((c,d)=>c+d.nodeSize,0))),u.scrollIntoView()}function t9(e,t){return mn.maxOpen(Wv(e.replace(/\r\n?/g,` +`),t).content)}function ER(e){const t=typeof e.source=="string"&&e.source.length>0?`from: ${LS(e.source)} +`:"",n=typeof e.comment=="string"&&e.comment.length>0?` + +${e.comment}`:"";return`${t}${MV(e.text)}${n}`}function yK(e){const t=i=>i.isText?i.text??"":i.type===ri.nodes.mention?Rp(i.attrs):i.type===ri.nodes.attachment?i.attrs.name:i.type===ri.nodes.quote?ER(i.attrs):i.textBetween(0,i.content.size,""),n=[];return e.content.forEach(i=>{if(i.type===ri.nodes.mention||i.type===ri.nodes.attachment||i.type===ri.nodes.quote)n.push(t(i));else{let o="",s=!1;i.forEach(r=>{if(r.type===ri.nodes.quote){const a=ER(r.attrs);o=o.length>0?`${o.replace(/ +$/,"")} + +${a}`:a,s=!0;return}let l=t(r);s&&(l=l.replace(/^ /,""),o+=` + +`,s=!1),o+=l}),n.push(o)}}),n.join(` +`)}const b6=` + + + + +`,kK=` + + + + +`,bK='',wK=` + + + +`,CK=` + + +`,AK='',xK=` + + +`,SK=` + + +`,_K=` + + +`,vMe='',yMe='',kMe='',bMe='',wMe='',CMe={sm:14,md:16,lg:20},AMe={file:b6,folder:kK,skill:bK,copy:wK,check:CK,"external-link":AK,target:xK,"file-edit":SK,close:_K,attachment:vMe,image:yMe,video:kMe,fullscreen:bMe,quote:wMe};function tl(e,t="md"){const n=CMe[t];return AMe[e].replace(/]*>/,i=>i.replace(/\s(?:width|height)="[^"]*"/g,"")).replace(/^