@myagentroam/server 0.13.22 → 0.13.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/node_modules/@myagentroam/protocol/package.json +1 -1
- package/node_modules/@myagentroam/server-core/dist/skill-bundle.js +11 -8
- package/node_modules/@myagentroam/server-core/dist/skill-favorite-service.js +9 -3
- package/node_modules/@myagentroam/server-core/package.json +4 -2
- package/node_modules/@myagentroam-enterprise/server-implementation/dist/composition/server-http.js +4 -0
- package/node_modules/@myagentroam-enterprise/server-implementation/package.json +3 -3
- package/node_modules/argparse/LICENSE +254 -0
- package/node_modules/argparse/README.md +84 -0
- package/node_modules/argparse/argparse.js +3707 -0
- package/node_modules/argparse/lib/sub.js +67 -0
- package/node_modules/argparse/lib/textwrap.js +440 -0
- package/node_modules/argparse/package.json +31 -0
- package/node_modules/js-yaml/LICENSE +21 -0
- package/node_modules/js-yaml/README.md +233 -0
- package/node_modules/js-yaml/bin/js-yaml.js +117 -0
- package/node_modules/js-yaml/dist/js-yaml.js +3022 -0
- package/node_modules/js-yaml/dist/js-yaml.js.map +1 -0
- package/node_modules/js-yaml/dist/js-yaml.min.js +2 -0
- package/node_modules/js-yaml/dist/js-yaml.min.js.map +1 -0
- package/node_modules/js-yaml/dist/js-yaml.mjs +3082 -0
- package/node_modules/js-yaml/dist/js-yaml.mjs.map +1 -0
- package/node_modules/js-yaml/index.js +44 -0
- package/node_modules/js-yaml/lib/common.js +50 -0
- package/node_modules/js-yaml/lib/dumper.js +937 -0
- package/node_modules/js-yaml/lib/exception.js +51 -0
- package/node_modules/js-yaml/lib/index_vite_proxy.tmp.mjs +37 -0
- package/node_modules/js-yaml/lib/loader.js +1803 -0
- package/node_modules/js-yaml/lib/schema/core.js +9 -0
- package/node_modules/js-yaml/lib/schema/default.js +20 -0
- package/node_modules/js-yaml/lib/schema/failsafe.js +14 -0
- package/node_modules/js-yaml/lib/schema/json.js +17 -0
- package/node_modules/js-yaml/lib/schema.js +109 -0
- package/node_modules/js-yaml/lib/snippet.js +96 -0
- package/node_modules/js-yaml/lib/type/binary.js +122 -0
- package/node_modules/js-yaml/lib/type/bool.js +35 -0
- package/node_modules/js-yaml/lib/type/float.js +99 -0
- package/node_modules/js-yaml/lib/type/int.js +142 -0
- package/node_modules/js-yaml/lib/type/map.js +8 -0
- package/node_modules/js-yaml/lib/type/merge.js +12 -0
- package/node_modules/js-yaml/lib/type/null.js +35 -0
- package/node_modules/js-yaml/lib/type/omap.js +45 -0
- package/node_modules/js-yaml/lib/type/pairs.js +50 -0
- package/node_modules/js-yaml/lib/type/seq.js +8 -0
- package/node_modules/js-yaml/lib/type/set.js +29 -0
- package/node_modules/js-yaml/lib/type/str.js +8 -0
- package/node_modules/js-yaml/lib/type/timestamp.js +88 -0
- package/node_modules/js-yaml/lib/type.js +66 -0
- package/node_modules/js-yaml/package.json +83 -0
- package/package.json +10 -6
- package/web/assets/{AuditManagementPage-B5ScdRKn.js → AuditManagementPage-Bw2qCPJE.js} +1 -1
- package/web/assets/{BusyIndicator-OB15NEUK.js → BusyIndicator-1kY9qfWN.js} +1 -1
- package/web/assets/{CodeFileEditor-DxwHgE0d.js → CodeFileEditor-CTjcQ3tS.js} +3 -3
- package/web/assets/{ConversationTemplateManagementPage-CjsmfXKH.js → ConversationTemplateManagementPage-DLTbR6Yx.js} +1 -1
- package/web/assets/{ConversationTemplateManagementPage-C-l0-Ira.js → ConversationTemplateManagementPage-Dwj-d6Nn.js} +1 -1
- package/web/assets/{EnterpriseUserManagementPage-DGrRJ6bF.js → EnterpriseUserManagementPage-QcovmjTy.js} +1 -1
- package/web/assets/{EnvironmentSecretManager-B_-ylLkL.js → EnvironmentSecretManager-pWG9Ta0i.js} +1 -1
- package/web/assets/{FilePreviewLoading-CIpZdYzn.js → FilePreviewLoading-DQICPNpH.js} +1 -1
- package/web/assets/{HtmlPreviewFrame-CvFAAxKe.js → HtmlPreviewFrame-M-5_Zs5R.js} +3 -3
- package/web/assets/{LicenseManagementPage-BJGLI4UK.js → LicenseManagementPage-D48IVDDN.js} +1 -1
- package/web/assets/{ManagementPagination-CUH_L45m.js → ManagementPagination-Bz8x8Cc3.js} +1 -1
- package/web/assets/{MarAgentModelManagementPage-C2fVXijf.js → MarAgentModelManagementPage-BI5YdxJ-.js} +1 -1
- package/web/assets/{MarAgentModelManagementPage-PJTVG_dg.js → MarAgentModelManagementPage-BS80Nbaq.js} +1 -1
- package/web/assets/{MarIcon-DPR_cErX.js → MarIcon-D-R_Iqgk.js} +1 -1
- package/web/assets/{MarkdownFilePreview-DKrSTEJP.js → MarkdownFilePreview-BqgPZaJH.js} +2 -2
- package/web/assets/{McpDetailsDialog-BjTNIpX1.js → McpDetailsDialog-CEV2RaAd.js} +1 -1
- package/web/assets/{McpSourceManagementPage-DAkwixqZ.js → McpSourceManagementPage-B-DunK-k.js} +1 -1
- package/web/assets/{McpSourceManagementPage-DmgavMPK.js → McpSourceManagementPage-UAHr6Ok2.js} +1 -1
- package/web/assets/{NodeDetailsDialogs-DVZ7gOca.js → NodeDetailsDialogs-CqijTLuv.js} +1 -1
- package/web/assets/NodeManagementPage-BYaR6I4C.js +1 -0
- package/web/assets/NodeManagementPage-C03fC50W.js +1 -0
- package/web/assets/{OAuthManagementPage-BiRFI5q2.js → OAuthManagementPage-0NLfuZER.js} +1 -1
- package/web/assets/{OrganizationManagementPage-vSeGQxcP.js → OrganizationManagementPage-CdMnKAYX.js} +1 -1
- package/web/assets/{RemoteDesktopPage-xIeQAFWZ.js → RemoteDesktopPage-9ca_pT3U.js} +1 -1
- package/web/assets/{ResourceManagementPanel-D6wgOs7A.js → ResourceManagementPanel-DeUjzXb3.js} +1 -1
- package/web/assets/{ResourceManagementPanel.vue_vue_type_script_setup_true_lang-ChZiFxz-.js → ResourceManagementPanel.vue_vue_type_script_setup_true_lang-BFIdrnhO.js} +1 -1
- package/web/assets/{SecretManagementPage-Bu1N50fS.js → SecretManagementPage-B0fRviba.js} +1 -1
- package/web/assets/SecretManagementPage-wS5xi8d3.js +1 -0
- package/web/assets/{SecretManagementPage.vue_vue_type_script_setup_true_lang-CWGqtbBF.js → SecretManagementPage.vue_vue_type_script_setup_true_lang-CfKC1c5_.js} +1 -1
- package/web/assets/{SessionSharePage-Bo4XHgdT.js → SessionSharePage-BHuLnFb7.js} +2 -2
- package/web/assets/{SettingsContent-2f56AG8l.js → SettingsContent-BggGrmlo.js} +1 -1
- package/web/assets/{SettingsContent-DT42iRil.js → SettingsContent-D4kVDroA.js} +1 -1
- package/web/assets/{SkillCenterPage-BO5dTMlM.js → SkillCenterPage-Bdp4bpcM.js} +1 -1
- package/web/assets/SkillCenterPage-CYuxNkS5.js +1 -0
- package/web/assets/{SkillDetailsDialog-Bh2cMPHd.js → SkillDetailsDialog-pW-gzST7.js} +1 -1
- package/web/assets/{SkillSourceManagementPage-CjVfx8QU.js → SkillSourceManagementPage-DNBsZ6O-.js} +1 -1
- package/web/assets/{SkillSourceManagementPage-D14wdRZ7.js → SkillSourceManagementPage-DrkNyd-t.js} +1 -1
- package/web/assets/{StandaloneFilePreviewPage-BoUG1g8v.js → StandaloneFilePreviewPage-_M9U5uhK.js} +1 -1
- package/web/assets/SystemConfigurationPage-C58GrNm7.js +1 -0
- package/web/assets/{SystemConfigurationPage-BEems_aU.js → SystemConfigurationPage-CNi1usck.js} +1 -1
- package/web/assets/{SystemInformationPage-BBcFdoZ6.js → SystemInformationPage-AcLnM3_e.js} +1 -1
- package/web/assets/{TerminalTabView-CyxzxXgR.js → TerminalTabView-BSt5L7Cx.js} +1 -1
- package/web/assets/{WorkbenchPage-DwrTP3U1.js → WorkbenchPage-CN2-OtCY.js} +4 -4
- package/web/assets/WorkspaceManagementPage-D9su8n88.js +1 -0
- package/web/assets/WorkspaceManagementPage-POBkggih.js +1 -0
- package/web/assets/{_baseIteratee-DOgbwd8c.js → _baseIteratee-BvR4fgYp.js} +1 -1
- package/web/assets/{abnfDiagram-VCTEODGH-C_NR2Yup.js → abnfDiagram-VCTEODGH-XqHHyu1S.js} +1 -1
- package/web/assets/{advancedFormat-BZimik2P.js → advancedFormat-5pJd8w41.js} +1 -1
- package/web/assets/{arc-D-LDfu3K.js → arc-DSvlVvZi.js} +1 -1
- package/web/assets/{architectureDiagram-5GKGNRK7-BTTdARFu.js → architectureDiagram-5GKGNRK7-BrNH8-Zv.js} +1 -1
- package/web/assets/{blockDiagram-OSKFZWR5-BbRrP53G.js → blockDiagram-OSKFZWR5-S5Tm192_.js} +1 -1
- package/web/assets/{c4Diagram-7LVT6UL2-DnbhkPXG.js → c4Diagram-7LVT6UL2-C3rFyPvl.js} +1 -1
- package/web/assets/{catalog-ownership-service-BkhBt_hd.js → catalog-ownership-service-r8rMesAo.js} +1 -1
- package/web/assets/{catalog-page-service-X_aMFwTN.js → catalog-page-service-ImDTaYk9.js} +1 -1
- package/web/assets/channel-bKuk0yLE.js +1 -0
- package/web/assets/{chunk-2Q5K7J3B-BJ-N2_Pb.js → chunk-2Q5K7J3B-DyNrqSQN.js} +1 -1
- package/web/assets/{chunk-5VM5RSS4-n0ZHsSE-.js → chunk-5VM5RSS4-hmlRCeNP.js} +1 -1
- package/web/assets/{chunk-F27PBJKO-Ckzf5PKb.js → chunk-F27PBJKO-oXaQTdFU.js} +1 -1
- package/web/assets/{chunk-HLEWEB6X-uAs-GuZh.js → chunk-HLEWEB6X-CkDhM82l.js} +1 -1
- package/web/assets/{chunk-JWPE2WC7-CJuOumcd.js → chunk-JWPE2WC7-BYVjCscS.js} +1 -1
- package/web/assets/{chunk-POPQ4Y6H-QWtd1LPa.js → chunk-POPQ4Y6H-DV1Qeoce.js} +1 -1
- package/web/assets/{chunk-SVP7TREG-BzfnBF9t.js → chunk-SVP7TREG-BaDWc9Z6.js} +1 -1
- package/web/assets/{chunk-XXDRQBXY-Dg9X3PhP.js → chunk-XXDRQBXY-5VHfjh5_.js} +1 -1
- package/web/assets/{chunk-ZLD2IHE6-C_qtUFVo.js → chunk-ZLD2IHE6-CM_Qm9It.js} +1 -1
- package/web/assets/classDiagram-CYGNFDIV-B3_fkURU.js +1 -0
- package/web/assets/classDiagram-v2-TLXNO2FR-B3_fkURU.js +1 -0
- package/web/assets/{conversation-history-D0dYP2WF.js → conversation-history-B1iric-r.js} +1 -1
- package/web/assets/{cose-bilkent-JH36ORCC-De1ZRw7V.js → cose-bilkent-JH36ORCC-yzV8qpJT.js} +1 -1
- package/web/assets/{cynefin-OW5HDTMX-DEpOrjUh.js → cynefin-OW5HDTMX-vJHwwFfl.js} +1 -1
- package/web/assets/{cynefinDiagram-5FMLGOSQ-Hk2bpl4m.js → cynefinDiagram-5FMLGOSQ-E3dVCmUP.js} +1 -1
- package/web/assets/{dagre-OS7QT2EB-CBDDh4dO.js → dagre-OS7QT2EB-C9kNlv7S.js} +1 -1
- package/web/assets/{diagram-S7CK7UJ4-DvKG5Jrd.js → diagram-S7CK7UJ4-jiGI6C03.js} +1 -1
- package/web/assets/{diagram-UQ7AKVKN-BJwDkVDH.js → diagram-UQ7AKVKN-C0K-i8ED.js} +1 -1
- package/web/assets/{diagram-VSXAHHWV-CJBAHLiV.js → diagram-VSXAHHWV-C2Rly2XM.js} +1 -1
- package/web/assets/{diagram-VX7I27RA-eRiYvURm.js → diagram-VX7I27RA-BuALvzqD.js} +1 -1
- package/web/assets/{diagram-Z3DM3KII-HpO-eU2v.js → diagram-Z3DM3KII-DS9jZbJb.js} +1 -1
- package/web/assets/{ebnfDiagram-PWID7BFC-DpPZHcUu.js → ebnfDiagram-PWID7BFC-BJV1kfbb.js} +1 -1
- package/web/assets/{el-alert-CFbZoSjs.js → el-alert-DJpbWNhh.js} +1 -1
- package/web/assets/{el-cascader-RgF2Wauf.js → el-cascader-B5jhThMw.js} +1 -1
- package/web/assets/{el-checkbox-Ci-HorIw.js → el-checkbox-DImL2zoF.js} +1 -1
- package/web/assets/{el-date-picker-Du5bcGqn.js → el-date-picker-Dh20yzhd.js} +1 -1
- package/web/assets/{el-descriptions-CkxojY_D.js → el-descriptions-CdIUAmD2.js} +1 -1
- package/web/assets/{el-form-item-D9aJOZyh.js → el-form-item-DMdcLs15.js} +1 -1
- package/web/assets/{el-input-DRfzkDZL.js → el-input-B1Cujpyw.js} +1 -1
- package/web/assets/{el-input-number-D_kD4ZZ4.js → el-input-number-CroGg_6h.js} +1 -1
- package/web/assets/{el-radio-BKqvRBz2.js → el-radio-D1bF4tIj.js} +1 -1
- package/web/assets/{el-scrollbar-Bf_tA9ul.js → el-scrollbar-TQDjLC61.js} +1 -1
- package/web/assets/{el-select-IP0F7gdJ.js → el-select-CZpYtkGN.js} +1 -1
- package/web/assets/{el-switch-BY5z5mrW.js → el-switch-6mmUesF6.js} +1 -1
- package/web/assets/{el-tab-pane-CC-VGDOa.js → el-tab-pane-CW9ZPWiP.js} +1 -1
- package/web/assets/{el-table-column-D77vV7yn.js → el-table-column-CXO8el0X.js} +1 -1
- package/web/assets/{enterprise-management-service-DOtjj9VD.js → enterprise-management-service-D7KHJAwI.js} +1 -1
- package/web/assets/{erDiagram-2YWLMYGG-DqnFuCJk.js → erDiagram-2YWLMYGG-DdtykCQu.js} +1 -1
- package/web/assets/{error-presentation-DEEUWoo2.js → error-presentation-CHEcvm0D.js} +1 -1
- package/web/assets/{flowDiagram-T62WH6J4-DJeGF9sk.js → flowDiagram-T62WH6J4-B2nfZ2X1.js} +1 -1
- package/web/assets/{ganttDiagram-EL5Y4UJY-BHGlwJ_D.js → ganttDiagram-EL5Y4UJY-EDu-G9mJ.js} +1 -1
- package/web/assets/{gitGraphDiagram-WWUBYQGX-Nzd3BpVw.js → gitGraphDiagram-WWUBYQGX-DrnS_dnl.js} +1 -1
- package/web/assets/{hosted-conversation-template-client-H7znpJjn.js → hosted-conversation-template-client-C0TwaEFs.js} +1 -1
- package/web/assets/{index-CDoRnADC.js → index-5DADhXzG.js} +1 -1
- package/web/assets/{index-BUhxunFw.js → index-B0EMFtj6.js} +3 -3
- package/web/assets/{index-BFRgxx2f.js → index-BJzym8xR.js} +1 -1
- package/web/assets/{index-fFP_Oug0.js → index-BL_EJCN_.js} +1 -1
- package/web/assets/{index-CyDDKUBr.js → index-BVxjBNMr.js} +1 -1
- package/web/assets/{index-C195YExA.js → index-Bar4zFnf.js} +1 -1
- package/web/assets/{index-BEdGSLQH.js → index-BhBDnC2V.js} +1 -1
- package/web/assets/{index-B6MUaaOT.js → index-BhCRSlnB.js} +1 -1
- package/web/assets/{index-zWttg-Qb.js → index-BibVMcOB.js} +1 -1
- package/web/assets/{index-CK-j1Mks.js → index-Biy6YKtl.js} +1 -1
- package/web/assets/{index-B5NJz3Fl.js → index-Bnq-G9SI.js} +1 -1
- package/web/assets/{index-CENzwUc8.js → index-BuTaL5rV.js} +1 -1
- package/web/assets/{index-DgUajwdK.js → index-CJMJumBr.js} +1 -1
- package/web/assets/{index-B9VQtTOS.js → index-CQA8XN5a.js} +1 -1
- package/web/assets/{index-muZS5_2t.js → index-CS4IfVd8.js} +1 -1
- package/web/assets/{index-Buw3tvO-.js → index-CWeAg1XK.js} +1 -1
- package/web/assets/{index-DNvyN2rA.js → index-CWxNrk2U.js} +1 -1
- package/web/assets/{index-Cc2xMcoM.js → index-C_Rb4VPp.js} +1 -1
- package/web/assets/{index-DmXlxMkd.js → index-CmW6NQRF.js} +1 -1
- package/web/assets/{index-DRE9XFnK.js → index-CzN5WCes.js} +1 -1
- package/web/assets/{index-qocvSugk.js → index-D65eF4Ld.js} +1 -1
- package/web/assets/{index-4o9U9aNH.js → index-DVpfA-KI.js} +1 -1
- package/web/assets/{index-VEC4ae1d.js → index-DjPrII7n.js} +1 -1
- package/web/assets/{index-CqWuc9OH.js → index-DwONyBPF.js} +1 -1
- package/web/assets/{index-BByJNget.js → index-cSdmWR8Z.js} +1 -1
- package/web/assets/{index-D80VPqok.js → index-evmMbq8o.js} +1 -1
- package/web/assets/{index-DbbriiB5.js → index-nEGAXqRy.js} +1 -1
- package/web/assets/{index-6_YkCWVK.js → index-nkUFy56h.js} +1 -1
- package/web/assets/{index-CdOWpOFa.js → index-p5nkDOWg.js} +1 -1
- package/web/assets/infoDiagram-FKFFQAWI-CJ78Ud_D.js +2 -0
- package/web/assets/{isArrayLikeObject-nN_LaZ9G.js → isArrayLikeObject-HOg3E4xZ.js} +1 -1
- package/web/assets/{ishikawaDiagram-5VMMS53U-DT5T2wr3.js → ishikawaDiagram-5VMMS53U-C7qAaQXo.js} +1 -1
- package/web/assets/{journeyDiagram-EYS64GPL-CdrkMBVZ.js → journeyDiagram-EYS64GPL-BIuH36wR.js} +1 -1
- package/web/assets/{kanban-definition-UXKFOSKX-ClRCKdxq.js → kanban-definition-UXKFOSKX-DkaAko5P.js} +1 -1
- package/web/assets/{layout-DtCR-A5L.js → layout-BLmr0DDa.js} +1 -1
- package/web/assets/{linear-o8rY7l-q.js → linear-DoIJFyl_.js} +1 -1
- package/web/assets/{management-url-service-4DQ30pvL.js → management-url-service-BkJjl7jL.js} +1 -1
- package/web/assets/{mcp-center-service-C-2Fmm1R.js → mcp-center-service-BHTIs3L_.js} +1 -1
- package/web/assets/{merge-BAGcPj4C.js → merge-B30mfTGJ.js} +1 -1
- package/web/assets/{mermaid.core-D8BgJhh2.js → mermaid.core-CjiOH2Fd.js} +5 -5
- package/web/assets/{message-box-service-ClqgcroZ.js → message-box-service-VVXUq9x5.js} +1 -1
- package/web/assets/{mindmap-definition-THT77NOG-DOlxJ8z6.js → mindmap-definition-THT77NOG-BCKD4jTm.js} +1 -1
- package/web/assets/{mobile-dialog-return-service-BHEhZMkb.js → mobile-dialog-return-service-Dpx2MnbK.js} +1 -1
- package/web/assets/{oauth-callback-CWOcc6Bk.js → oauth-callback-C7WK0urg.js} +1 -1
- package/web/assets/{pegDiagram-XKGWAZYB-HeFJcpv7.js → pegDiagram-XKGWAZYB-BNUB3jKS.js} +1 -1
- package/web/assets/{pieDiagram-E7YTZNPT-DiR5PzMy.js → pieDiagram-E7YTZNPT-f3egJBhO.js} +1 -1
- package/web/assets/{quadrantDiagram-AXDQQJYC-Kf_h41Ob.js → quadrantDiagram-AXDQQJYC-DcgB--9n.js} +1 -1
- package/web/assets/{railroadDiagram-O6MQD6OU-Dbw507oB.js → railroadDiagram-O6MQD6OU-M-js8LMT.js} +1 -1
- package/web/assets/{requirementDiagram-IS5BZ75X-imfyG_I3.js → requirementDiagram-IS5BZ75X-DKjrGqz9.js} +1 -1
- package/web/assets/{runner-presentation-CwG4XRVy.js → runner-presentation-CVp1ISRD.js} +1 -1
- package/web/assets/{sankeyDiagram-P5KCCOFB-C_OwKXSF.js → sankeyDiagram-P5KCCOFB-E1boJLEj.js} +1 -1
- package/web/assets/{sequenceDiagram-WJ2MYXX4-B-7iiLyo.js → sequenceDiagram-WJ2MYXX4-jZ3VER2y.js} +1 -1
- package/web/assets/{session-share-client-service-DgBkAqSd.js → session-share-client-service-BpJblTIb.js} +1 -1
- package/web/assets/{sizeCapture-INFHLROL-0uGbHuC8.js → sizeCapture-INFHLROL-Bvp3b0LN.js} +1 -1
- package/web/assets/{stateDiagram-XQSTLZYL-DYQtBtqf.js → stateDiagram-XQSTLZYL-NqANU09Z.js} +1 -1
- package/web/assets/stateDiagram-v2-IH3M54BS-DIa3smzQ.js +1 -0
- package/web/assets/{swimlanes-V6O3JKXN-CW75hexf.js → swimlanes-V6O3JKXN-UYN0TjJe.js} +1 -1
- package/web/assets/swimlanesDiagram-JKAHXJPX-BxezIPn7.js +8 -0
- package/web/assets/{time-presentation-DJL3_MuB.js → time-presentation-Bb0DA3CW.js} +1 -1
- package/web/assets/{timeline-definition-24CTP7MA-rWvxpohY.js → timeline-definition-24CTP7MA-CIBPeIK6.js} +1 -1
- package/web/assets/{union-DtTfWOml.js → union-KFqNyw3w.js} +1 -1
- package/web/assets/{use-form-common-props-cAYD5XWs.js → use-form-common-props-DXtRQ91k.js} +1 -1
- package/web/assets/{use-wheel-IfLi2br5.js → use-wheel-Cj6EBCMg.js} +1 -1
- package/web/assets/{vennDiagram-4TSXK5OY-BrYXmdQC.js → vennDiagram-4TSXK5OY-DFZU0mdG.js} +1 -1
- package/web/assets/{vnode-DuL6TqlR.js → vnode-D4l2IAQa.js} +1 -1
- package/web/assets/{wardleyDiagram-VM6X3IG4-ccuZQPl5.js → wardleyDiagram-VM6X3IG4-Dv6iPeuM.js} +1 -1
- package/web/assets/{workbench-composer-interaction-controller-DWlJkeOl.js → workbench-composer-interaction-controller-BfD_4a09.js} +1 -1
- package/web/assets/{workbench-live-service-CVWDCGSd.js → workbench-live-service-DBtv0ElZ.js} +1 -1
- package/web/assets/{workbench-presentation-BqvojjMy.js → workbench-presentation-CDymUAef.js} +1 -1
- package/web/assets/{xychartDiagram-S5SC5T6Z-M8PwNJxh.js → xychartDiagram-S5SC5T6Z-BgBcmbqm.js} +1 -1
- package/web/docs/404.html +2 -2
- package/web/docs/administration/account.html +3 -3
- package/web/docs/administration/audit.html +3 -3
- package/web/docs/administration/conversation-templates.html +3 -3
- package/web/docs/administration/email-notifications.html +3 -3
- package/web/docs/administration/license.html +3 -3
- package/web/docs/administration/nodes-workspaces.html +3 -3
- package/web/docs/administration/oauth.html +3 -3
- package/web/docs/administration/secrets.html +3 -3
- package/web/docs/administration/template-workspace-maintenance.html +3 -3
- package/web/docs/administration/users-organizations.html +3 -3
- package/web/docs/assets/{app.5JJ4R4m_.js → app.B7OFA5b9.js} +1 -1
- package/web/docs/assets/chunks/@localSearchIndexen-US.CiAV9Q96.js +1 -0
- package/web/docs/assets/chunks/@localSearchIndexroot.D8V_euQE.js +1 -0
- package/web/docs/assets/chunks/{VPLocalSearchBox.CeP3DrRj.js → VPLocalSearchBox.o5NpnJAz.js} +1 -1
- package/web/docs/assets/chunks/{theme.DEeLuR9D.js → theme.IQfepYG6.js} +2 -2
- package/web/docs/assets/en-US_workbench_skills.md.DfO6vZQq.js +1 -0
- package/web/docs/assets/{en-US_workbench_skills.md.DxYC56u0.lean.js → en-US_workbench_skills.md.DfO6vZQq.lean.js} +1 -1
- package/web/docs/assets/workbench_skills.md.BckmpyzF.js +1 -0
- package/web/docs/concepts/architecture.html +3 -3
- package/web/docs/concepts/data-and-security.html +3 -3
- package/web/docs/concepts/files-git-terminal.html +3 -3
- package/web/docs/concepts/node-and-workspace.html +3 -3
- package/web/docs/concepts/permissions-and-sharing.html +3 -3
- package/web/docs/concepts/runner-control.html +3 -3
- package/web/docs/concepts/secrets.html +3 -3
- package/web/docs/concepts/session-run-turn.html +3 -3
- package/web/docs/deployment/backup-restore.html +3 -3
- package/web/docs/deployment/network.html +3 -3
- package/web/docs/deployment/node-installation.html +3 -3
- package/web/docs/deployment/node-linux.html +3 -3
- package/web/docs/deployment/node-macos.html +3 -3
- package/web/docs/deployment/node-windows.html +3 -3
- package/web/docs/deployment/production.html +3 -3
- package/web/docs/deployment/security-checklist.html +3 -3
- package/web/docs/deployment/upgrade.html +3 -3
- package/web/docs/en-US/administration/account.html +3 -3
- package/web/docs/en-US/administration/audit.html +3 -3
- package/web/docs/en-US/administration/conversation-templates.html +3 -3
- package/web/docs/en-US/administration/email-notifications.html +3 -3
- package/web/docs/en-US/administration/license.html +3 -3
- package/web/docs/en-US/administration/nodes-workspaces.html +3 -3
- package/web/docs/en-US/administration/oauth.html +3 -3
- package/web/docs/en-US/administration/secrets.html +3 -3
- package/web/docs/en-US/administration/template-workspace-maintenance.html +3 -3
- package/web/docs/en-US/administration/users-organizations.html +3 -3
- package/web/docs/en-US/concepts/architecture.html +3 -3
- package/web/docs/en-US/concepts/data-and-security.html +3 -3
- package/web/docs/en-US/concepts/files-git-terminal.html +3 -3
- package/web/docs/en-US/concepts/node-and-workspace.html +3 -3
- package/web/docs/en-US/concepts/permissions-and-sharing.html +3 -3
- package/web/docs/en-US/concepts/runner-control.html +3 -3
- package/web/docs/en-US/concepts/secrets.html +3 -3
- package/web/docs/en-US/concepts/session-run-turn.html +3 -3
- package/web/docs/en-US/deployment/backup-restore.html +3 -3
- package/web/docs/en-US/deployment/network.html +3 -3
- package/web/docs/en-US/deployment/node-installation.html +3 -3
- package/web/docs/en-US/deployment/node-linux.html +3 -3
- package/web/docs/en-US/deployment/node-macos.html +3 -3
- package/web/docs/en-US/deployment/node-windows.html +3 -3
- package/web/docs/en-US/deployment/production.html +3 -3
- package/web/docs/en-US/deployment/security-checklist.html +3 -3
- package/web/docs/en-US/deployment/upgrade.html +3 -3
- package/web/docs/en-US/getting-started/connect-node.html +3 -3
- package/web/docs/en-US/getting-started/first-agent-session.html +3 -3
- package/web/docs/en-US/getting-started/first-login.html +3 -3
- package/web/docs/en-US/getting-started/next-steps.html +3 -3
- package/web/docs/en-US/getting-started/npm-quick-start.html +3 -3
- package/web/docs/en-US/getting-started/overview.html +3 -3
- package/web/docs/en-US/getting-started/prerequisites.html +3 -3
- package/web/docs/en-US/getting-started/register-workspace.html +3 -3
- package/web/docs/en-US/getting-started/server-installation.html +3 -3
- package/web/docs/en-US/operations/marctl.html +3 -3
- package/web/docs/en-US/reference/configuration.html +3 -3
- package/web/docs/en-US/reference/keyboard-shortcuts.html +3 -3
- package/web/docs/en-US/reference/limits.html +3 -3
- package/web/docs/en-US/reference/ports-paths-data.html +3 -3
- package/web/docs/en-US/reference/status-and-errors.html +3 -3
- package/web/docs/en-US/runners/claude-code.html +3 -3
- package/web/docs/en-US/runners/codex.html +3 -3
- package/web/docs/en-US/runners/mar-agent.html +3 -3
- package/web/docs/en-US/runners/opencode.html +3 -3
- package/web/docs/en-US/runners/overview.html +3 -3
- package/web/docs/en-US/runners/runner-troubleshooting.html +3 -3
- package/web/docs/en-US/troubleshooting/node-offline.html +3 -3
- package/web/docs/en-US/troubleshooting/quick-diagnosis.html +3 -3
- package/web/docs/en-US/troubleshooting/session-run.html +3 -3
- package/web/docs/en-US/troubleshooting/terminal.html +3 -3
- package/web/docs/en-US/troubleshooting/workspace-files.html +3 -3
- package/web/docs/en-US/workbench/composer.html +3 -3
- package/web/docs/en-US/workbench/context-and-plan.html +3 -3
- package/web/docs/en-US/workbench/conversation.html +3 -3
- package/web/docs/en-US/workbench/file-reference-and-attachment.html +3 -3
- package/web/docs/en-US/workbench/files.html +3 -3
- package/web/docs/en-US/workbench/git-changes.html +3 -3
- package/web/docs/en-US/workbench/git-history.html +3 -3
- package/web/docs/en-US/workbench/hosted-conversations.html +3 -3
- package/web/docs/en-US/workbench/mobile.html +3 -3
- package/web/docs/en-US/workbench/navigation.html +3 -3
- package/web/docs/en-US/workbench/remote-desktop.html +3 -3
- package/web/docs/en-US/workbench/sessions.html +3 -3
- package/web/docs/en-US/workbench/skills.html +5 -5
- package/web/docs/en-US/workbench/terminal.html +3 -3
- package/web/docs/getting-started/connect-node.html +3 -3
- package/web/docs/getting-started/first-agent-session.html +3 -3
- package/web/docs/getting-started/first-login.html +3 -3
- package/web/docs/getting-started/next-steps.html +3 -3
- package/web/docs/getting-started/npm-quick-start.html +3 -3
- package/web/docs/getting-started/overview.html +3 -3
- package/web/docs/getting-started/prerequisites.html +3 -3
- package/web/docs/getting-started/register-workspace.html +3 -3
- package/web/docs/getting-started/server-installation.html +3 -3
- package/web/docs/hashmap.json +1 -1
- package/web/docs/operations/marctl.html +3 -3
- package/web/docs/reference/configuration.html +3 -3
- package/web/docs/reference/keyboard-shortcuts.html +3 -3
- package/web/docs/reference/limits.html +3 -3
- package/web/docs/reference/ports-paths-data.html +3 -3
- package/web/docs/reference/status-and-errors.html +3 -3
- package/web/docs/runners/claude-code.html +3 -3
- package/web/docs/runners/codex.html +3 -3
- package/web/docs/runners/mar-agent.html +3 -3
- package/web/docs/runners/opencode.html +3 -3
- package/web/docs/runners/overview.html +3 -3
- package/web/docs/runners/runner-troubleshooting.html +3 -3
- package/web/docs/troubleshooting/node-offline.html +3 -3
- package/web/docs/troubleshooting/quick-diagnosis.html +3 -3
- package/web/docs/troubleshooting/session-run.html +3 -3
- package/web/docs/troubleshooting/terminal.html +3 -3
- package/web/docs/troubleshooting/workspace-files.html +3 -3
- package/web/docs/workbench/composer.html +3 -3
- package/web/docs/workbench/context-and-plan.html +3 -3
- package/web/docs/workbench/conversation.html +3 -3
- package/web/docs/workbench/file-reference-and-attachment.html +3 -3
- package/web/docs/workbench/files.html +3 -3
- package/web/docs/workbench/git-changes.html +3 -3
- package/web/docs/workbench/git-history.html +3 -3
- package/web/docs/workbench/hosted-conversations.html +3 -3
- package/web/docs/workbench/mobile.html +3 -3
- package/web/docs/workbench/navigation.html +3 -3
- package/web/docs/workbench/remote-desktop.html +3 -3
- package/web/docs/workbench/sessions.html +3 -3
- package/web/docs/workbench/skills.html +5 -5
- package/web/docs/workbench/terminal.html +3 -3
- package/web/index.html +1 -1
- package/web/service-worker.js +1 -1
- package/web/web-version.json +1 -1
- package/web/assets/NodeManagementPage-ZiD3wFDP.js +0 -1
- package/web/assets/NodeManagementPage-gqG9glX8.js +0 -1
- package/web/assets/SecretManagementPage-CjkypU0o.js +0 -1
- package/web/assets/SkillCenterPage-PAux586E.js +0 -1
- package/web/assets/SystemConfigurationPage-C5HWOWBh.js +0 -1
- package/web/assets/WorkspaceManagementPage-Bba9RVkz.js +0 -1
- package/web/assets/WorkspaceManagementPage-BgQa4lBN.js +0 -1
- package/web/assets/channel-D66E6SJu.js +0 -1
- package/web/assets/classDiagram-CYGNFDIV-CMDPKjU-.js +0 -1
- package/web/assets/classDiagram-v2-TLXNO2FR-CMDPKjU-.js +0 -1
- package/web/assets/infoDiagram-FKFFQAWI-xQcQ4-7p.js +0 -2
- package/web/assets/stateDiagram-v2-IH3M54BS-DAVykwUA.js +0 -1
- package/web/assets/swimlanesDiagram-JKAHXJPX-BbVA-Msw.js +0 -8
- package/web/docs/assets/chunks/@localSearchIndexen-US.D6eBBP6t.js +0 -1
- package/web/docs/assets/chunks/@localSearchIndexroot.DDfLAEIK.js +0 -1
- package/web/docs/assets/en-US_workbench_skills.md.DxYC56u0.js +0 -1
- package/web/docs/assets/workbench_skills.md.DqwbzdOU.js +0 -1
- /package/web/docs/assets/{workbench_skills.md.DqwbzdOU.lean.js → workbench_skills.md.BckmpyzF.lean.js} +0 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{c as r,s as o}from"./flowDiagram-T62WH6J4-B2nfZ2X1.js";import{_ as e}from"./mermaid.core-CjiOH2Fd.js";import"./index-B0EMFtj6.js";import"./chunk-5VM5RSS4-hmlRCeNP.js";import"./chunk-XXDRQBXY-5VHfjh5_.js";import"./chunk-POPQ4Y6H-DV1Qeoce.js";import"./chunk-F27PBJKO-oXaQTdFU.js";import"./FilePreviewLoading-DQICPNpH.js";import"./use-form-common-props-DXtRQ91k.js";import"./el-scrollbar-TQDjLC61.js";import"./el-input-B1Cujpyw.js";import"./mobile-dialog-return-service-Dpx2MnbK.js";import"./BusyIndicator-1kY9qfWN.js";import"./channel-bKuk0yLE.js";import"./isArrayLikeObject-HOg3E4xZ.js";import"./_baseIteratee-BvR4fgYp.js";import"./union-KFqNyw3w.js";import"./_baseFindIndex-D7XfJLKM.js";var m=e(t=>`${o(t)}
|
|
2
|
+
.swimlane.cluster rect {
|
|
3
|
+
stroke: ${t.clusterBorder} !important;
|
|
4
|
+
}
|
|
5
|
+
[data-look="neo"].cluster rect {
|
|
6
|
+
filter: none;
|
|
7
|
+
}
|
|
8
|
+
`,"getStyles"),i=m,B=r({defaultLayout:"swimlane",styles:i});export{B as diagram};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./index-
|
|
1
|
+
import"./index-B0EMFtj6.js";function c(r,a){const t=new Date(r),e=a===void 0?{year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate(),hour:t.getHours(),minute:t.getMinutes(),second:t.getSeconds()}:Object.fromEntries(new Intl.DateTimeFormat("en-US",{timeZone:a,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hourCycle:"h23"}).formatToParts(t).map(({type:n,value:s})=>[n,s])),o=n=>String(n).padStart(2,"0");return`${String(e.year).padStart(4,"0")}-${o(e.month)}-${o(e.day)} ${o(e.hour)}:${o(e.minute)}:${o(e.second)}`}function d(r){const a=Math.max(0,Math.floor(r/1e3)),t=a%60,e=Math.floor(a/60),o=e%60,n=Math.floor(e/60);return n>0?`${n}h ${o}m ${t}s`:o>0?`${o}m ${t}s`:`${t}s`}export{c as f,d as p};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as o,A as pt,ab as Rt,ac as Ct,ad as Wt,c as gt,l as E,G as Pt,a2 as Bt,ae as ft,j as U,v as Vt,af as Ft,r as zt}from"./mermaid.core-
|
|
1
|
+
import{_ as o,A as pt,ab as Rt,ac as Ct,ad as Wt,c as gt,l as E,G as Pt,a2 as Bt,ae as ft,j as U,v as Vt,af as Ft,r as zt}from"./mermaid.core-CjiOH2Fd.js";import{d as ot}from"./arc-DSvlVvZi.js";import"./index-B0EMFtj6.js";import"./FilePreviewLoading-DQICPNpH.js";import"./use-form-common-props-DXtRQ91k.js";import"./el-scrollbar-TQDjLC61.js";import"./el-input-B1Cujpyw.js";import"./mobile-dialog-return-service-Dpx2MnbK.js";import"./BusyIndicator-1kY9qfWN.js";import"./isArrayLikeObject-HOg3E4xZ.js";import"./_baseIteratee-BvR4fgYp.js";import"./union-KFqNyw3w.js";import"./_baseFindIndex-D7XfJLKM.js";var tt=(function(){var e=o(function(k,s,d,l){for(d=d||{},l=k.length;l--;d[k[l]]=s);return d},"o"),t=[6,11,13,14,15,17,19,20,23,24],n=[1,12],i=[1,13],r=[1,14],h=[1,15],c=[1,16],a=[1,19],f=[1,20],g={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:o(function(s,d,l,p,x,u,S){var v=u.length-1;switch(x){case 1:return u[v-1];case 3:p.setDirection("LR");break;case 4:p.setDirection("TD");break;case 5:this.$=[];break;case 6:u[v-1].push(u[v]),this.$=u[v-1];break;case 7:case 8:this.$=u[v];break;case 9:case 10:this.$=[];break;case 11:p.getCommonDb().setDiagramTitle(u[v].substr(6)),this.$=u[v].substr(6);break;case 12:this.$=u[v].trim(),p.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=u[v].trim(),p.getCommonDb().setAccDescription(this.$);break;case 15:p.addSection(u[v].substr(8)),this.$=u[v].substr(8);break;case 18:p.addTask(u[v],0,""),this.$=u[v];break;case 19:p.addEvent(u[v].substr(2)),this.$=u[v];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},e(t,[2,5],{5:6}),e(t,[2,2]),e(t,[2,3]),e(t,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:n,15:i,17:r,19:h,20:c,21:17,22:18,23:a,24:f},e(t,[2,10],{1:[2,1]}),e(t,[2,6]),{12:21,14:n,15:i,17:r,19:h,20:c,21:17,22:18,23:a,24:f},e(t,[2,8]),e(t,[2,9]),e(t,[2,11]),{16:[1,22]},{18:[1,23]},e(t,[2,14]),e(t,[2,15]),e(t,[2,16]),e(t,[2,17]),e(t,[2,18]),e(t,[2,19]),e(t,[2,7]),e(t,[2,12]),e(t,[2,13])],defaultActions:{},parseError:o(function(s,d){if(d.recoverable)this.trace(s);else{var l=new Error(s);throw l.hash=d,l}},"parseError"),parse:o(function(s){var d=this,l=[0],p=[],x=[null],u=[],S=this.table,v="",I=0,R=0,W=2,O=1,L=u.slice.call(arguments,1),w=Object.create(this.lexer),H={yy:{}};for(var V in this.yy)Object.prototype.hasOwnProperty.call(this.yy,V)&&(H.yy[V]=this.yy[V]);w.setInput(s,H.yy),H.yy.lexer=w,H.yy.parser=this,typeof w.yylloc>"u"&&(w.yylloc={});var F=w.yylloc;u.push(F);var K=w.options&&w.options.ranges;typeof H.yy.parseError=="function"?this.parseError=H.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function N(A){l.length=l.length-2*A,x.length=x.length-A,u.length=u.length-A}o(N,"popStack");function b(){var A;return A=p.pop()||w.lex()||O,typeof A!="number"&&(A instanceof Array&&(p=A,A=p.pop()),A=d.symbols_[A]||A),A}o(b,"lex");for(var _,$,T,P,C={},G,B,X,Z;;){if($=l[l.length-1],this.defaultActions[$]?T=this.defaultActions[$]:((_===null||typeof _>"u")&&(_=b()),T=S[$]&&S[$][_]),typeof T>"u"||!T.length||!T[0]){var Y="";Z=[];for(G in S[$])this.terminals_[G]&&G>W&&Z.push("'"+this.terminals_[G]+"'");w.showPosition?Y="Parse error on line "+(I+1)+`:
|
|
2
2
|
`+w.showPosition()+`
|
|
3
3
|
Expecting `+Z.join(", ")+", got '"+(this.terminals_[_]||_)+"'":Y="Parse error on line "+(I+1)+": Unexpected "+(_==O?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(Y,{text:w.match,token:this.terminals_[_]||_,line:w.yylineno,loc:F,expected:Z})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+$+", token: "+_);switch(T[0]){case 1:l.push(_),x.push(w.yytext),u.push(w.yylloc),l.push(T[1]),_=null,R=w.yyleng,v=w.yytext,I=w.yylineno,F=w.yylloc;break;case 2:if(B=this.productions_[T[1]][1],C.$=x[x.length-B],C._$={first_line:u[u.length-(B||1)].first_line,last_line:u[u.length-1].last_line,first_column:u[u.length-(B||1)].first_column,last_column:u[u.length-1].last_column},K&&(C._$.range=[u[u.length-(B||1)].range[0],u[u.length-1].range[1]]),P=this.performAction.apply(C,[v,R,I,H.yy,T[1],x,u].concat(L)),typeof P<"u")return P;B&&(l=l.slice(0,-1*B*2),x=x.slice(0,-1*B),u=u.slice(0,-1*B)),l.push(this.productions_[T[1]][0]),x.push(C.$),u.push(C._$),X=S[l[l.length-2]][l[l.length-1]],l.push(X);break;case 3:return!0}}return!0},"parse")},m=(function(){var k={EOF:1,parseError:o(function(d,l){if(this.yy.parser)this.yy.parser.parseError(d,l);else throw new Error(d)},"parseError"),setInput:o(function(s,d){return this.yy=d||this.yy||{},this._input=s,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:o(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var d=s.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),s},"input"),unput:o(function(s){var d=s.length,l=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-d),this.offset-=d;var p=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),l.length-1&&(this.yylineno-=l.length-1);var x=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:l?(l.length===p.length?this.yylloc.first_column:0)+p[p.length-l.length].length-l[0].length:this.yylloc.first_column-d},this.options.ranges&&(this.yylloc.range=[x[0],x[0]+this.yyleng-d]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(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).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(s){this.unput(this.match.slice(s))},"less"),pastInput:o(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var s=this.pastInput(),d=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bi as u,bj as g,bk as I,bl as w,bm as A}from"./index-
|
|
1
|
+
import{bi as u,bj as g,bk as I,bl as w,bm as A}from"./index-B0EMFtj6.js";import{b as m,i as p}from"./isArrayLikeObject-HOg3E4xZ.js";import{b as x}from"./_baseFindIndex-D7XfJLKM.js";function N(){}function R(n){return n!==n}function S(n,e,t){for(var r=t-1,o=n.length;++r<o;)if(n[r]===e)return r;return-1}function F(n,e,t){return e===e?S(n,e,t):x(n,R,t)}function O(n,e){var t=n==null?0:n.length;return!!t&&F(n,e,0)>-1}var d=1/0,j=u&&1/g(new u([,-0]))[1]==d?function(n){return new u(n)}:N,k=200;function v(n,e,t){var r=-1,o=O,h=n.length,b=!0,s=[],i=s;if(h>=k){var c=j(n);if(c)return g(c);b=!1,o=w,i=new I}else i=s;n:for(;++r<h;){var f=n[r],a=f;if(f=f!==0?f:0,b&&a===a){for(var l=i.length;l--;)if(i[l]===a)continue n;s.push(f)}else o(i,a,t)||(i!==s&&i.push(a),s.push(f))}return s}var T=m(function(n){return v(A(n,1,p,!0))});export{T as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{k as r,O as f,P as l,Q as t,R as a,S as p,L as n,f as v}from"./index-
|
|
1
|
+
import{k as r,O as f,P as l,Q as t,R as a,S as p,L as n,f as v}from"./index-B0EMFtj6.js";const i=s=>{const e=f();return r(()=>e?.proxy?.$props?.[s])},b=(s,e={})=>{const o=v(void 0),m=e.prop?o:i("size"),u=e.global?o:l(),c=e.form?{size:void 0}:t(a,void 0),d=e.formItem?{size:void 0}:t(p,void 0);return r(()=>m.value||n(s)||d?.size||c?.size||u.value||"")},x=s=>{const e=i("disabled"),o=t(a,void 0);return r(()=>e.value??n(s)??o?.disabled??!1)};export{x as a,b as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as c}from"./index-
|
|
1
|
+
import{s as c}from"./index-B0EMFtj6.js";import{c as h,r as d}from"./el-input-B1Cujpyw.js";const F=({atEndEdge:n,atStartEdge:f,layout:i},u)=>{let l,r=0;const o=e=>e<0&&f.value||e>0&&n.value;return{hasReachedEdge:o,onWheel:e=>{h(l);let{deltaX:s,deltaY:t}=e;e.shiftKey&&t!==0&&(s=t,t=0);const a=i.value==="horizontal"?s:t;o(a)||(r+=a,!c()&&a!==0&&e.preventDefault(),l=d(()=>{u(r),r=0}))}}};export{F as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b1 as Wt,s as Kt,g as Ht,q as Yt,p as Xt,a as Zt,b as Jt,_ as w,A as wt,G as Qt,j as ot,am as $t,ab as te,ac as ee,ad as ne,d as se,r as ie,D as oe,E as re}from"./mermaid.core-D8BgJhh2.js";import"./index-BUhxunFw.js";import"./FilePreviewLoading-CIpZdYzn.js";import"./use-form-common-props-cAYD5XWs.js";import"./el-scrollbar-Bf_tA9ul.js";import"./el-input-DRfzkDZL.js";import"./mobile-dialog-return-service-BHEhZMkb.js";import"./BusyIndicator-OB15NEUK.js";import"./isArrayLikeObject-nN_LaZ9G.js";import"./_baseIteratee-DOgbwd8c.js";import"./union-DtTfWOml.js";import"./_baseFindIndex-D7XfJLKM.js";const kt=(t,n)=>Wt(t,"a",-n),_t=1e-10;function st(t,n){const s=le(t),e=s.filter(l=>ae(l,t));let i=0,o=0;const r=[];if(e.length>1){const l=Tt(e);for(let u=0;u<e.length;++u){const a=e[u];a.angle=Math.atan2(a.x-l.x,a.y-l.y)}e.sort((u,a)=>a.angle-u.angle);let f=e[e.length-1];for(let u=0;u<e.length;++u){const a=e[u];o+=(f.x+a.x)*(a.y-f.y);const y={x:(a.x+f.x)/2,y:(a.y+f.y)/2};let h=null;for(let b=0;b<a.parentIndex.length;++b)if(f.parentIndex.includes(a.parentIndex[b])){const p=t[a.parentIndex[b]],M=Math.atan2(a.x-p.x,a.y-p.y),T=Math.atan2(f.x-p.x,f.y-p.y);let _=T-M;_<0&&(_+=2*Math.PI);const S=T-_/2;let g=q(y,{x:p.x+p.radius*Math.sin(S),y:p.y+p.radius*Math.cos(S)});g>p.radius*2&&(g=p.radius*2),(h==null||h.width>g)&&(h={circle:p,width:g,p1:a,p2:f,large:g>p.radius,sweep:!0})}h!=null&&(r.push(h),i+=lt(h.circle.radius,h.width),f=a)}}else{let l=t[0];for(let u=1;u<t.length;++u)t[u].radius<l.radius&&(l=t[u]);let f=!1;for(let u=0;u<t.length;++u)if(q(t[u],l)>Math.abs(l.radius-t[u].radius)){f=!0;break}f?i=o=0:(i=l.radius*l.radius*Math.PI,r.push({circle:l,p1:{x:l.x,y:l.y+l.radius},p2:{x:l.x-_t,y:l.y+l.radius},width:l.radius*2,large:!0,sweep:!0}))}return o/=2,n&&(n.area=i+o,n.arcArea=i,n.polygonArea=o,n.arcs=r,n.innerPoints=e,n.intersectionPoints=s),i+o}function ae(t,n){return n.every(s=>q(t,s)<s.radius+_t)}function le(t){const n=[];for(let s=0;s<t.length;++s)for(let e=s+1;e<t.length;++e){const i=Et(t[s],t[e]);for(const o of i)o.parentIndex=[s,e],n.push(o)}return n}function lt(t,n){return t*t*Math.acos(1-n/t)-(t-n)*Math.sqrt(n*(2*t-n))}function q(t,n){return Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y))}function xt(t,n,s){if(s>=t+n)return 0;if(s<=Math.abs(t-n))return Math.PI*Math.min(t,n)*Math.min(t,n);const e=t-(s*s-n*n+t*t)/(2*s),i=n-(s*s-t*t+n*n)/(2*s);return lt(t,e)+lt(n,i)}function Et(t,n){const s=q(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const o=(e*e-i*i+s*s)/(2*s),r=Math.sqrt(e*e-o*o),l=t.x+o*(n.x-t.x)/s,f=t.y+o*(n.y-t.y)/s,u=-(n.y-t.y)*(r/s),a=-(n.x-t.x)*(r/s);return[{x:l+u,y:f-a},{x:l-u,y:f+a}]}function Tt(t){const n={x:0,y:0};for(const s of t)n.x+=s.x,n.y+=s.y;return n.x/=t.length,n.y/=t.length,n}function ce(t,n,s,e){e=e||{};const i=e.maxIterations||100,o=e.tolerance||1e-10,r=t(n),l=t(s);let f=s-n;if(r*l>0)throw"Initial bisect points must have opposite signs";if(r===0)return n;if(l===0)return s;for(let u=0;u<i;++u){f/=2;const a=n+f,y=t(a);if(y*r>=0&&(n=a),Math.abs(f)<o||y===0)return a}return n+f}function ct(t){const n=new Array(t);for(let s=0;s<t;++s)n[s]=0;return n}function Mt(t,n){return ct(t).map(()=>ct(n))}function $(t,n){let s=0;for(let e=0;e<t.length;++e)s+=t[e]*n[e];return s}function ut(t){return Math.sqrt($(t,t))}function ft(t,n,s){for(let e=0;e<n.length;++e)t[e]=n[e]*s}function J(t,n,s,e,i){for(let o=0;o<t.length;++o)t[o]=n*s[o]+e*i[o]}function zt(t,n,s){s=s||{};const e=s.maxIterations||n.length*200,i=s.nonZeroDelta||1.05,o=s.zeroDelta||.001,r=s.minErrorDelta||1e-6,l=s.minErrorDelta||1e-5,f=s.rho!==void 0?s.rho:1,u=s.chi!==void 0?s.chi:2,a=s.psi!==void 0?s.psi:-.5,y=s.sigma!==void 0?s.sigma:.5;let h;const b=n.length,p=new Array(b+1);p[0]=n,p[0].fx=t(n),p[0].id=0;for(let v=0;v<b;++v){const c=n.slice();c[v]=c[v]?c[v]*i:o,p[v+1]=c,p[v+1].fx=t(c),p[v+1].id=v+1}function M(v){for(let c=0;c<v.length;c++)p[b][c]=v[c];p[b].fx=v.fx}const T=(v,c)=>v.fx-c.fx,_=n.slice(),S=n.slice(),g=n.slice(),m=n.slice();for(let v=0;v<e;++v){if(p.sort(T),s.history){const x=p.map(d=>{const D=d.slice();return D.fx=d.fx,D.id=d.id,D});x.sort((d,D)=>d.id-D.id),s.history.push({x:p[0].slice(),fx:p[0].fx,simplex:x})}h=0;for(let x=0;x<b;++x)h=Math.max(h,Math.abs(p[0][x]-p[1][x]));if(Math.abs(p[0].fx-p[b].fx)<r&&h<l)break;for(let x=0;x<b;++x){_[x]=0;for(let d=0;d<b;++d)_[x]+=p[d][x];_[x]/=b}const c=p[b];if(J(S,1+f,_,-f,c),S.fx=t(S),S.fx<p[0].fx)J(m,1+u,_,-u,c),m.fx=t(m),m.fx<S.fx?M(m):M(S);else if(S.fx>=p[b-1].fx){let x=!1;if(S.fx>c.fx?(J(g,1+a,_,-a,c),g.fx=t(g),g.fx<c.fx?M(g):x=!0):(J(g,1-a*f,_,a*f,c),g.fx=t(g),g.fx<S.fx?M(g):x=!0),x){if(y>=1)break;for(let d=1;d<p.length;++d)J(p[d],1-y,p[0],y,p[d]),p[d].fx=t(p[d])}}else M(S)}return p.sort(T),{fx:p[0].fx,x:p[0]}}function ue(t,n,s,e,i,o,r){const l=s.fx,f=$(s.fxprime,n);let u=l,a=l,y=f,h=0;i=i||1,o=o||1e-6,r=r||.1;function b(p,M,T){for(let _=0;_<16;++_)if(i=(p+M)/2,J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=$(e.fxprime,n),u>l+o*i*f||u>=T)M=i;else{if(Math.abs(y)<=-r*f)return i;y*(M-p)>=0&&(M=p),p=i,T=u}return 0}for(let p=0;p<10;++p){if(J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=$(e.fxprime,n),u>l+o*i*f||p&&u>=a)return b(h,i,a);if(Math.abs(y)<=-r*f)return i;if(y>=0)return b(i,h,u);a=u,h=i,i*=2}return i}function fe(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const o=n.slice();let r,l,f=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),r=e.fxprime.slice(),ft(r,e.fxprime,-1);for(let a=0;a<u;++a){if(f=ue(t,r,e,i,f),s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:f}),!f)ft(r,e.fxprime,-1);else{J(o,1,i.fxprime,-1,e.fxprime);const y=$(e.fxprime,e.fxprime),h=Math.max(0,$(o,i.fxprime)/y);J(r,h,r,-1,i.fxprime),l=e,e=i,i=l}if(ut(e.fxprime)<=1e-5)break}return s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:f}),e}function At(t,n={}){n.maxIterations=n.maxIterations||500;const s=n.initialLayout||xe,e=n.lossFunction||tt,i=he(t,n),o=s(i,n),r=Object.keys(o),l=[];for(const a of r)l.push(o[a].x),l.push(o[a].y);const u=zt(a=>{const y={};for(let h=0;h<r.length;++h){const b=r[h];y[b]={x:a[2*h],y:a[2*h+1],radius:o[b].radius}}return e(y,i)},l,n).x;for(let a=0;a<r.length;++a){const y=r[a];o[y].x=u[2*a],o[y].y=u[2*a+1]}return o}const Rt=1e-10;function ht(t,n,s){return Math.min(t,n)*Math.min(t,n)*Math.PI<=s+Rt?Math.abs(t-n):ce(e=>xt(t,n,e)-s,0,t+n)}function he(t,n={}){const s=n.distinct,e=t.map(l=>Object.assign({},l));function i(l){return l.join(";")}if(s){const l=new Map;for(const f of e)for(let u=0;u<f.sets.length;u++){const a=String(f.sets[u]);l.set(a,f.size+(l.get(a)||0));for(let y=u+1;y<f.sets.length;y++){const h=String(f.sets[y]),b=`${a};${h}`,p=`${h};${a}`;l.set(b,f.size+(l.get(b)||0)),l.set(p,f.size+(l.get(p)||0))}}for(const f of e)f.sets.length<3&&(f.size=l.get(i(f.sets)))}const o=[],r=new Set;for(const l of e)if(l.sets.length===1)o.push(l.sets[0]);else if(l.sets.length===2){const f=l.sets[0],u=l.sets[1];r.add(i(l.sets)),r.add(i([u,f]))}o.sort((l,f)=>l===f?0:l<f?-1:1);for(let l=0;l<o.length;++l){const f=o[l];for(let u=l+1;u<o.length;++u){const a=o[u];r.has(i([f,a]))||e.push({sets:[f,a],size:0})}}return e}function de(t,n,s){const e=Mt(n.length,n.length),i=Mt(n.length,n.length);return t.filter(o=>o.sets.length===2).forEach(o=>{const r=s[o.sets[0]],l=s[o.sets[1]],f=Math.sqrt(n[r].size/Math.PI),u=Math.sqrt(n[l].size/Math.PI),a=ht(f,u,o.size);e[r][l]=e[l][r]=a;let y=0;o.size+1e-10>=Math.min(n[r].size,n[l].size)?y=1:o.size<=1e-10&&(y=-1),i[r][l]=i[l][r]=y}),{distances:e,constraints:i}}function ge(t,n,s,e){for(let o=0;o<n.length;++o)n[o]=0;let i=0;for(let o=0;o<s.length;++o){const r=t[2*o],l=t[2*o+1];for(let f=o+1;f<s.length;++f){const u=t[2*f],a=t[2*f+1],y=s[o][f],h=e[o][f],b=(u-r)*(u-r)+(a-l)*(a-l),p=Math.sqrt(b),M=b-y*y;h>0&&p<=y||h<0&&p>=y||(i+=2*M*M,n[2*o]+=4*M*(r-u),n[2*o+1]+=4*M*(l-a),n[2*f]+=4*M*(u-r),n[2*f+1]+=4*M*(a-l))}}return i}function xe(t,n={}){let s=pe(t,n);const e=n.lossFunction||tt;if(t.length>=8){const i=ye(t,n),o=e(i,t),r=e(s,t);o+1e-8<r&&(s=i)}return s}function ye(t,n={}){const s=n.restarts||10,e=[],i={};for(const h of t)h.sets.length===1&&(i[h.sets[0]]=e.length,e.push(h));let{distances:o,constraints:r}=de(t,e,i);const l=ut(o.map(ut))/o.length;o=o.map(h=>h.map(b=>b/l));const f=(h,b)=>ge(h,b,o,r);let u=null;for(let h=0;h<s;++h){const b=ct(o.length*2).map(Math.random),p=fe(f,b,n);(!u||p.fx<u.fx)&&(u=p)}const a=u.x,y={};for(let h=0;h<e.length;++h){const b=e[h];y[b.sets[0]]={x:a[2*h]*l,y:a[2*h+1]*l,radius:Math.sqrt(b.size/Math.PI)}}if(n.history)for(const h of n.history)ft(h.x,l);return y}function pe(t,n){const s=n&&n.lossFunction?n.lossFunction:tt,e={},i={};for(const y of t)if(y.sets.length===1){const h=y.sets[0];e[h]={x:1e10,y:1e10,rowid:e.length,size:y.size,radius:Math.sqrt(y.size/Math.PI)},i[h]=[]}t=t.filter(y=>y.sets.length===2);for(const y of t){let h=y.weight!=null?y.weight:1;const b=y.sets[0],p=y.sets[1];y.size+Rt>=Math.min(e[b].size,e[p].size)&&(h=0),i[b].push({set:p,size:y.size,weight:h}),i[p].push({set:b,size:y.size,weight:h})}const o=[];Object.keys(i).forEach(y=>{let h=0;for(let b=0;b<i[y].length;++b)h+=i[y][b].size*i[y][b].weight;o.push({set:y,size:h})});function r(y,h){return h.size-y.size}o.sort(r);const l={};function f(y){return y.set in l}function u(y,h){e[h].x=y.x,e[h].y=y.y,l[h]=!0}u({x:0,y:0},o[0].set);for(let y=1;y<o.length;++y){const h=o[y].set,b=i[h].filter(f),p=e[h];if(b.sort(r),b.length===0)throw"ERROR: missing pairwise overlap information";const M=[];for(var a=0;a<b.length;++a){const S=e[b[a].set],g=ht(p.radius,S.radius,b[a].size);M.push({x:S.x+g,y:S.y}),M.push({x:S.x-g,y:S.y}),M.push({y:S.y+g,x:S.x}),M.push({y:S.y-g,x:S.x});for(let m=a+1;m<b.length;++m){const v=e[b[m].set],c=ht(p.radius,v.radius,b[m].size),x=Et({x:S.x,y:S.y,radius:g},{x:v.x,y:v.y,radius:c});M.push(...x)}}let T=1e50,_=M[0];for(const S of M){e[h].x=S.x,e[h].y=S.y;const g=s(e,t);g<T&&(T=g,_=S)}u(_,h)}return e}function tt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const r=t[e.sets[0]],l=t[e.sets[1]];i=xt(r.radius,l.radius,q(r,l))}else i=st(e.sets.map(r=>t[r]));const o=e.weight!=null?e.weight:1;s+=o*(i-e.size)*(i-e.size)}return s}function Dt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const l=t[e.sets[0]],f=t[e.sets[1]];i=xt(l.radius,f.radius,q(l,f))}else i=st(e.sets.map(l=>t[l]));const o=e.weight!=null?e.weight:1,r=Math.log((i+1)/(e.size+1));s+=o*r*r}return s}function me(t,n,s){if(s==null?t.sort((i,o)=>o.radius-i.radius):t.sort(s),t.length>0){const i=t[0].x,o=t[0].y;for(const r of t)r.x-=i,r.y-=o}if(t.length===2&&q(t[0],t[1])<Math.abs(t[1].radius-t[0].radius)&&(t[1].x=t[0].x+t[0].radius-t[1].radius-1e-10,t[1].y=t[0].y),t.length>1){const i=Math.atan2(t[1].x,t[1].y)-n,o=Math.cos(i),r=Math.sin(i);for(const l of t){const f=l.x,u=l.y;l.x=o*f-r*u,l.y=r*f+o*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-n;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const o=t[1].y/(1e-10+t[1].x);for(const r of t){var e=(r.x+o*r.y)/(1+o*o);r.x=2*e-r.x,r.y=2*e*o-r.y}}}}function be(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}function s(i,o){const r=n(i),l=n(o);r.parent=l}for(let i=0;i<t.length;++i)for(let o=i+1;o<t.length;++o){const r=t[i].radius+t[o].radius;q(t[i],t[o])+1e-10<r&&s(t[o],t[i])}const e=new Map;for(let i=0;i<t.length;++i){const o=n(t[i]).parent.setid;e.has(o)||e.set(o,[]),e.get(o).push(t[i])}return t.forEach(i=>{delete i.parent}),Array.from(e.values())}function dt(t){const n=s=>{const e=t.reduce((o,r)=>Math.max(o,r[s]+r.radius),Number.NEGATIVE_INFINITY),i=t.reduce((o,r)=>Math.min(o,r[s]-r.radius),Number.POSITIVE_INFINITY);return{max:e,min:i}};return{xRange:n("x"),yRange:n("y")}}function Ct(t,n,s){n==null&&(n=Math.PI/2);let e=jt(t).map(u=>Object.assign({},u));const i=be(e);for(const u of i){me(u,n,s);const a=dt(u);u.size=(a.xRange.max-a.xRange.min)*(a.yRange.max-a.yRange.min),u.bounds=a}i.sort((u,a)=>a.size-u.size),e=i[0];let o=e.bounds;const r=(o.xRange.max-o.xRange.min)/50;function l(u,a,y){if(!u)return;const h=u.bounds;let b,p;if(a)b=o.xRange.max-h.xRange.min+r;else{b=o.xRange.max-h.xRange.max;const M=(h.xRange.max-h.xRange.min)/2-(o.xRange.max-o.xRange.min)/2;M<0&&(b+=M)}if(y)p=o.yRange.max-h.yRange.min+r;else{p=o.yRange.max-h.yRange.max;const M=(h.yRange.max-h.yRange.min)/2-(o.yRange.max-o.yRange.min)/2;M<0&&(p+=M)}for(const M of u)M.x+=b,M.y+=p,e.push(M)}let f=1;for(;f<i.length;)l(i[f],!0,!1),l(i[f+1],!1,!0),l(i[f+2],!0,!0),f+=3,o=dt(e);return Ot(e)}function Nt(t,n,s,e,i){const o=jt(t);n-=2*e,s-=2*e;const{xRange:r,yRange:l}=dt(o);if(r.max===r.min||l.max===l.min)return console.log("not scaling solution: zero size detected"),t;let f,u;if(i){const b=Math.sqrt(i/Math.PI)*2;f=n/b,u=s/b}else f=n/(r.max-r.min),u=s/(l.max-l.min);const a=Math.min(u,f),y=(n-(r.max-r.min)*a)/2,h=(s-(l.max-l.min)*a)/2;return Ot(o.map(b=>({radius:a*b.radius,x:e+y+(b.x-r.min)*a,y:e+h+(b.y-l.min)*a,setid:b.setid})))}function Ot(t){const n={};for(const s of t)n[s.setid]=s;return n}function jt(t){return Object.keys(t).map(s=>Object.assign(t[s],{setid:s}))}function ve(t={}){let n=!1,s=600,e=350,i=15,o=1e3,r=Math.PI/2,l=!0,f=null,u=!0,a=!0,y=null,h=null,b=!1,p=null,M=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,T={},_=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],S=0,g=function(x){if(x in T)return T[x];var d=T[x]=_[S];return S+=1,S>=_.length&&(S=0),d},m=At,v=tt;function c(x){let d=x.datum();const D=new Set;d.forEach(k=>{k.size==0&&k.sets.length==1&&D.add(k.sets[0])}),d=d.filter(k=>!k.sets.some(j=>D.has(j)));let I={},C={};if(d.length>0){let k=m(d,{lossFunction:v,distinct:b});l&&(k=Ct(k,r,h)),I=Nt(k,s,e,i,f),C=Lt(I,d,M)}const U={};d.forEach(k=>{k.label&&(U[k.sets]=k.label)});function V(k){if(k.sets in U)return U[k.sets];if(k.sets.length==1)return""+k.sets[0]}x.selectAll("svg").data([I]).enter().append("svg");const O=x.select("svg");n?O.attr("viewBox",`0 0 ${s} ${e}`):O.attr("width",s).attr("height",e);const R={};let E=!1;O.selectAll(".venn-area path").each(function(k){const j=this.getAttribute("d");k.sets.length==1&&j&&!b&&(E=!0,R[k.sets[0]]=Me(j))});function A(k){return j=>{const H=k.sets.map(et=>{let Y=R[et],Z=I[et];return Y||(Y={x:s/2,y:e/2,radius:1}),Z||(Z={x:s/2,y:e/2,radius:1}),{x:Y.x*(1-j)+Z.x*j,y:Y.y*(1-j)+Z.y*j,radius:Y.radius*(1-j)+Z.radius*j}});return St(H,p)}}const G=O.selectAll(".venn-area").data(d,k=>k.sets),P=G.enter().append("g").attr("class",k=>`venn-area venn-${k.sets.length==1?"circle":"intersection"}${k.colour||k.color?" venn-coloured":""}`).attr("data-venn-sets",k=>k.sets.join("_")),B=P.append("path"),L=P.append("text").attr("class","label").text(k=>V(k)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);a&&(B.style("fill-opacity","0").filter(k=>k.sets.length==1).style("fill",k=>k.colour?k.colour:k.color?k.color:g(k.sets)).style("fill-opacity",".25"),L.style("fill",k=>k.colour||k.color?"#FFF":t.textFill?t.textFill:k.sets.length==1?g(k.sets):"#444"));function K(k){return typeof k.transition=="function"?k.transition("venn").duration(o):k}let z=x;E&&typeof z.transition=="function"?(z=K(x),z.selectAll("path").attrTween("d",A)):z.selectAll("path").attr("d",k=>St(k.sets.map(j=>I[j])),p);const N=z.selectAll("text").filter(k=>k.sets in C).text(k=>V(k)).attr("x",k=>Math.floor(C[k.sets].x)).attr("y",k=>Math.floor(C[k.sets].y));u&&(E?"on"in N?N.on("end",rt(I,V)):N.each("end",rt(I,V)):N.each(rt(I,V)));const F=K(G.exit()).remove();typeof G.transition=="function"&&F.selectAll("path").attrTween("d",A);const X=F.selectAll("text").attr("x",s/2).attr("y",e/2);return y!==null&&(L.style("font-size","0px"),N.style("font-size",y),X.style("font-size","0px")),{circles:I,textCentres:C,nodes:G,enter:P,update:z,exit:F}}return c.wrap=function(x){return arguments.length?(u=x,c):u},c.useViewBox=function(){return n=!0,c},c.width=function(x){return arguments.length?(s=x,c):s},c.height=function(x){return arguments.length?(e=x,c):e},c.padding=function(x){return arguments.length?(i=x,c):i},c.distinct=function(x){return arguments.length?(b=x,c):b},c.colours=function(x){return arguments.length?(g=x,c):g},c.colors=function(x){return arguments.length?(g=x,c):g},c.fontSize=function(x){return arguments.length?(y=x,c):y},c.round=function(x){return arguments.length?(p=x,c):p},c.duration=function(x){return arguments.length?(o=x,c):o},c.layoutFunction=function(x){return arguments.length?(m=x,c):m},c.normalize=function(x){return arguments.length?(l=x,c):l},c.scaleToFit=function(x){return arguments.length?(f=x,c):f},c.styled=function(x){return arguments.length?(a=x,c):a},c.orientation=function(x){return arguments.length?(r=x,c):r},c.orientationOrder=function(x){return arguments.length?(h=x,c):h},c.lossFunction=function(x){return arguments.length?(v=x==="default"?tt:x==="logRatio"?Dt:x,c):v},c}function rt(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,o=n(s)||"",r=o.split(/\s+/).reverse(),f=(o.length+r.length)/3;let u=r.pop(),a=[u],y=0;const h=1.1;e.textContent=null;const b=[];function p(g){const m=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return m.textContent=g,b.push(m),e.append(m),m}let M=p(u);for(;u=r.pop(),!!u;){a.push(u);const g=a.join(" ");M.textContent=g,g.length>f&&M.getComputedTextLength()>i&&(a.pop(),M.textContent=a.join(" "),a=[u],M=p(u),y++)}const T=.35-y*h/2,_=e.getAttribute("x"),S=e.getAttribute("y");b.forEach((g,m)=>{g.setAttribute("x",_),g.setAttribute("y",S),g.setAttribute("dy",`${T+m*h}em`)})}}function at(t,n,s){let e=n[0].radius-q(n[0],t);for(let i=1;i<n.length;++i){const o=n[i].radius-q(n[i],t);o<=e&&(e=o)}for(let i=0;i<s.length;++i){const o=q(s[i],t)-s[i].radius;o<=e&&(e=o)}return e}function Ft(t,n,s){const e=[];for(const a of t)e.push({x:a.x,y:a.y}),e.push({x:a.x+a.radius/2,y:a.y}),e.push({x:a.x-a.radius/2,y:a.y}),e.push({x:a.x,y:a.y+a.radius/2}),e.push({x:a.x,y:a.y-a.radius/2});let i=e[0],o=at(e[0],t,n);for(let a=1;a<e.length;++a){const y=at(e[a],t,n);y>=o&&(i=e[a],o=y)}const r=zt(a=>-1*at({x:a[0],y:a[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,l={x:s?0:r[0],y:r[1]};let f=!0;for(const a of t)if(q(l,a)>a.radius){f=!1;break}for(const a of n)if(q(l,a)<a.radius){f=!1;break}if(f)return l;if(t.length==1)return{x:t[0].x,y:t[0].y};const u={};return st(t,u),u.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:u.arcs.length==1?{x:u.arcs[0].circle.x,y:u.arcs[0].circle.y}:n.length?Ft(t,[]):Tt(u.arcs.map(a=>a.p1))}function Ie(t){const n={},s=Object.keys(t);for(const e of s)n[e]=[];for(let e=0;e<s.length;e++){const i=s[e],o=t[i];for(let r=e+1;r<s.length;++r){const l=s[r],f=t[l],u=q(o,f);u+f.radius<=o.radius+1e-10?n[l].push(i):u+o.radius<=f.radius+1e-10&&n[i].push(l)}}return n}function Lt(t,n,s){const e={},i=Ie(t);for(let o=0;o<n.length;++o){const r=n[o].sets,l={},f={};for(let h=0;h<r.length;++h){l[r[h]]=!0;const b=i[r[h]];for(let p=0;p<b.length;++p)f[b[p]]=!0}const u=[],a=[];for(let h in t)h in l?u.push(t[h]):h in f||a.push(t[h]);const y=Ft(u,a,s);e[r]=y,y.disjoint&&n[o].size>0&&console.log("WARNING: area "+r+" not represented on screen")}return e}function ke(t,n,s){const e=[];return e.push(`
|
|
1
|
+
import{b1 as Wt,s as Kt,g as Ht,q as Yt,p as Xt,a as Zt,b as Jt,_ as w,A as wt,G as Qt,j as ot,am as $t,ab as te,ac as ee,ad as ne,d as se,r as ie,D as oe,E as re}from"./mermaid.core-CjiOH2Fd.js";import"./index-B0EMFtj6.js";import"./FilePreviewLoading-DQICPNpH.js";import"./use-form-common-props-DXtRQ91k.js";import"./el-scrollbar-TQDjLC61.js";import"./el-input-B1Cujpyw.js";import"./mobile-dialog-return-service-Dpx2MnbK.js";import"./BusyIndicator-1kY9qfWN.js";import"./isArrayLikeObject-HOg3E4xZ.js";import"./_baseIteratee-BvR4fgYp.js";import"./union-KFqNyw3w.js";import"./_baseFindIndex-D7XfJLKM.js";const kt=(t,n)=>Wt(t,"a",-n),_t=1e-10;function st(t,n){const s=le(t),e=s.filter(l=>ae(l,t));let i=0,o=0;const r=[];if(e.length>1){const l=Tt(e);for(let u=0;u<e.length;++u){const a=e[u];a.angle=Math.atan2(a.x-l.x,a.y-l.y)}e.sort((u,a)=>a.angle-u.angle);let f=e[e.length-1];for(let u=0;u<e.length;++u){const a=e[u];o+=(f.x+a.x)*(a.y-f.y);const y={x:(a.x+f.x)/2,y:(a.y+f.y)/2};let h=null;for(let b=0;b<a.parentIndex.length;++b)if(f.parentIndex.includes(a.parentIndex[b])){const p=t[a.parentIndex[b]],M=Math.atan2(a.x-p.x,a.y-p.y),T=Math.atan2(f.x-p.x,f.y-p.y);let _=T-M;_<0&&(_+=2*Math.PI);const S=T-_/2;let g=q(y,{x:p.x+p.radius*Math.sin(S),y:p.y+p.radius*Math.cos(S)});g>p.radius*2&&(g=p.radius*2),(h==null||h.width>g)&&(h={circle:p,width:g,p1:a,p2:f,large:g>p.radius,sweep:!0})}h!=null&&(r.push(h),i+=lt(h.circle.radius,h.width),f=a)}}else{let l=t[0];for(let u=1;u<t.length;++u)t[u].radius<l.radius&&(l=t[u]);let f=!1;for(let u=0;u<t.length;++u)if(q(t[u],l)>Math.abs(l.radius-t[u].radius)){f=!0;break}f?i=o=0:(i=l.radius*l.radius*Math.PI,r.push({circle:l,p1:{x:l.x,y:l.y+l.radius},p2:{x:l.x-_t,y:l.y+l.radius},width:l.radius*2,large:!0,sweep:!0}))}return o/=2,n&&(n.area=i+o,n.arcArea=i,n.polygonArea=o,n.arcs=r,n.innerPoints=e,n.intersectionPoints=s),i+o}function ae(t,n){return n.every(s=>q(t,s)<s.radius+_t)}function le(t){const n=[];for(let s=0;s<t.length;++s)for(let e=s+1;e<t.length;++e){const i=Et(t[s],t[e]);for(const o of i)o.parentIndex=[s,e],n.push(o)}return n}function lt(t,n){return t*t*Math.acos(1-n/t)-(t-n)*Math.sqrt(n*(2*t-n))}function q(t,n){return Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y))}function xt(t,n,s){if(s>=t+n)return 0;if(s<=Math.abs(t-n))return Math.PI*Math.min(t,n)*Math.min(t,n);const e=t-(s*s-n*n+t*t)/(2*s),i=n-(s*s-t*t+n*n)/(2*s);return lt(t,e)+lt(n,i)}function Et(t,n){const s=q(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const o=(e*e-i*i+s*s)/(2*s),r=Math.sqrt(e*e-o*o),l=t.x+o*(n.x-t.x)/s,f=t.y+o*(n.y-t.y)/s,u=-(n.y-t.y)*(r/s),a=-(n.x-t.x)*(r/s);return[{x:l+u,y:f-a},{x:l-u,y:f+a}]}function Tt(t){const n={x:0,y:0};for(const s of t)n.x+=s.x,n.y+=s.y;return n.x/=t.length,n.y/=t.length,n}function ce(t,n,s,e){e=e||{};const i=e.maxIterations||100,o=e.tolerance||1e-10,r=t(n),l=t(s);let f=s-n;if(r*l>0)throw"Initial bisect points must have opposite signs";if(r===0)return n;if(l===0)return s;for(let u=0;u<i;++u){f/=2;const a=n+f,y=t(a);if(y*r>=0&&(n=a),Math.abs(f)<o||y===0)return a}return n+f}function ct(t){const n=new Array(t);for(let s=0;s<t;++s)n[s]=0;return n}function Mt(t,n){return ct(t).map(()=>ct(n))}function $(t,n){let s=0;for(let e=0;e<t.length;++e)s+=t[e]*n[e];return s}function ut(t){return Math.sqrt($(t,t))}function ft(t,n,s){for(let e=0;e<n.length;++e)t[e]=n[e]*s}function J(t,n,s,e,i){for(let o=0;o<t.length;++o)t[o]=n*s[o]+e*i[o]}function zt(t,n,s){s=s||{};const e=s.maxIterations||n.length*200,i=s.nonZeroDelta||1.05,o=s.zeroDelta||.001,r=s.minErrorDelta||1e-6,l=s.minErrorDelta||1e-5,f=s.rho!==void 0?s.rho:1,u=s.chi!==void 0?s.chi:2,a=s.psi!==void 0?s.psi:-.5,y=s.sigma!==void 0?s.sigma:.5;let h;const b=n.length,p=new Array(b+1);p[0]=n,p[0].fx=t(n),p[0].id=0;for(let v=0;v<b;++v){const c=n.slice();c[v]=c[v]?c[v]*i:o,p[v+1]=c,p[v+1].fx=t(c),p[v+1].id=v+1}function M(v){for(let c=0;c<v.length;c++)p[b][c]=v[c];p[b].fx=v.fx}const T=(v,c)=>v.fx-c.fx,_=n.slice(),S=n.slice(),g=n.slice(),m=n.slice();for(let v=0;v<e;++v){if(p.sort(T),s.history){const x=p.map(d=>{const D=d.slice();return D.fx=d.fx,D.id=d.id,D});x.sort((d,D)=>d.id-D.id),s.history.push({x:p[0].slice(),fx:p[0].fx,simplex:x})}h=0;for(let x=0;x<b;++x)h=Math.max(h,Math.abs(p[0][x]-p[1][x]));if(Math.abs(p[0].fx-p[b].fx)<r&&h<l)break;for(let x=0;x<b;++x){_[x]=0;for(let d=0;d<b;++d)_[x]+=p[d][x];_[x]/=b}const c=p[b];if(J(S,1+f,_,-f,c),S.fx=t(S),S.fx<p[0].fx)J(m,1+u,_,-u,c),m.fx=t(m),m.fx<S.fx?M(m):M(S);else if(S.fx>=p[b-1].fx){let x=!1;if(S.fx>c.fx?(J(g,1+a,_,-a,c),g.fx=t(g),g.fx<c.fx?M(g):x=!0):(J(g,1-a*f,_,a*f,c),g.fx=t(g),g.fx<S.fx?M(g):x=!0),x){if(y>=1)break;for(let d=1;d<p.length;++d)J(p[d],1-y,p[0],y,p[d]),p[d].fx=t(p[d])}}else M(S)}return p.sort(T),{fx:p[0].fx,x:p[0]}}function ue(t,n,s,e,i,o,r){const l=s.fx,f=$(s.fxprime,n);let u=l,a=l,y=f,h=0;i=i||1,o=o||1e-6,r=r||.1;function b(p,M,T){for(let _=0;_<16;++_)if(i=(p+M)/2,J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=$(e.fxprime,n),u>l+o*i*f||u>=T)M=i;else{if(Math.abs(y)<=-r*f)return i;y*(M-p)>=0&&(M=p),p=i,T=u}return 0}for(let p=0;p<10;++p){if(J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=$(e.fxprime,n),u>l+o*i*f||p&&u>=a)return b(h,i,a);if(Math.abs(y)<=-r*f)return i;if(y>=0)return b(i,h,u);a=u,h=i,i*=2}return i}function fe(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const o=n.slice();let r,l,f=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),r=e.fxprime.slice(),ft(r,e.fxprime,-1);for(let a=0;a<u;++a){if(f=ue(t,r,e,i,f),s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:f}),!f)ft(r,e.fxprime,-1);else{J(o,1,i.fxprime,-1,e.fxprime);const y=$(e.fxprime,e.fxprime),h=Math.max(0,$(o,i.fxprime)/y);J(r,h,r,-1,i.fxprime),l=e,e=i,i=l}if(ut(e.fxprime)<=1e-5)break}return s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:f}),e}function At(t,n={}){n.maxIterations=n.maxIterations||500;const s=n.initialLayout||xe,e=n.lossFunction||tt,i=he(t,n),o=s(i,n),r=Object.keys(o),l=[];for(const a of r)l.push(o[a].x),l.push(o[a].y);const u=zt(a=>{const y={};for(let h=0;h<r.length;++h){const b=r[h];y[b]={x:a[2*h],y:a[2*h+1],radius:o[b].radius}}return e(y,i)},l,n).x;for(let a=0;a<r.length;++a){const y=r[a];o[y].x=u[2*a],o[y].y=u[2*a+1]}return o}const Rt=1e-10;function ht(t,n,s){return Math.min(t,n)*Math.min(t,n)*Math.PI<=s+Rt?Math.abs(t-n):ce(e=>xt(t,n,e)-s,0,t+n)}function he(t,n={}){const s=n.distinct,e=t.map(l=>Object.assign({},l));function i(l){return l.join(";")}if(s){const l=new Map;for(const f of e)for(let u=0;u<f.sets.length;u++){const a=String(f.sets[u]);l.set(a,f.size+(l.get(a)||0));for(let y=u+1;y<f.sets.length;y++){const h=String(f.sets[y]),b=`${a};${h}`,p=`${h};${a}`;l.set(b,f.size+(l.get(b)||0)),l.set(p,f.size+(l.get(p)||0))}}for(const f of e)f.sets.length<3&&(f.size=l.get(i(f.sets)))}const o=[],r=new Set;for(const l of e)if(l.sets.length===1)o.push(l.sets[0]);else if(l.sets.length===2){const f=l.sets[0],u=l.sets[1];r.add(i(l.sets)),r.add(i([u,f]))}o.sort((l,f)=>l===f?0:l<f?-1:1);for(let l=0;l<o.length;++l){const f=o[l];for(let u=l+1;u<o.length;++u){const a=o[u];r.has(i([f,a]))||e.push({sets:[f,a],size:0})}}return e}function de(t,n,s){const e=Mt(n.length,n.length),i=Mt(n.length,n.length);return t.filter(o=>o.sets.length===2).forEach(o=>{const r=s[o.sets[0]],l=s[o.sets[1]],f=Math.sqrt(n[r].size/Math.PI),u=Math.sqrt(n[l].size/Math.PI),a=ht(f,u,o.size);e[r][l]=e[l][r]=a;let y=0;o.size+1e-10>=Math.min(n[r].size,n[l].size)?y=1:o.size<=1e-10&&(y=-1),i[r][l]=i[l][r]=y}),{distances:e,constraints:i}}function ge(t,n,s,e){for(let o=0;o<n.length;++o)n[o]=0;let i=0;for(let o=0;o<s.length;++o){const r=t[2*o],l=t[2*o+1];for(let f=o+1;f<s.length;++f){const u=t[2*f],a=t[2*f+1],y=s[o][f],h=e[o][f],b=(u-r)*(u-r)+(a-l)*(a-l),p=Math.sqrt(b),M=b-y*y;h>0&&p<=y||h<0&&p>=y||(i+=2*M*M,n[2*o]+=4*M*(r-u),n[2*o+1]+=4*M*(l-a),n[2*f]+=4*M*(u-r),n[2*f+1]+=4*M*(a-l))}}return i}function xe(t,n={}){let s=pe(t,n);const e=n.lossFunction||tt;if(t.length>=8){const i=ye(t,n),o=e(i,t),r=e(s,t);o+1e-8<r&&(s=i)}return s}function ye(t,n={}){const s=n.restarts||10,e=[],i={};for(const h of t)h.sets.length===1&&(i[h.sets[0]]=e.length,e.push(h));let{distances:o,constraints:r}=de(t,e,i);const l=ut(o.map(ut))/o.length;o=o.map(h=>h.map(b=>b/l));const f=(h,b)=>ge(h,b,o,r);let u=null;for(let h=0;h<s;++h){const b=ct(o.length*2).map(Math.random),p=fe(f,b,n);(!u||p.fx<u.fx)&&(u=p)}const a=u.x,y={};for(let h=0;h<e.length;++h){const b=e[h];y[b.sets[0]]={x:a[2*h]*l,y:a[2*h+1]*l,radius:Math.sqrt(b.size/Math.PI)}}if(n.history)for(const h of n.history)ft(h.x,l);return y}function pe(t,n){const s=n&&n.lossFunction?n.lossFunction:tt,e={},i={};for(const y of t)if(y.sets.length===1){const h=y.sets[0];e[h]={x:1e10,y:1e10,rowid:e.length,size:y.size,radius:Math.sqrt(y.size/Math.PI)},i[h]=[]}t=t.filter(y=>y.sets.length===2);for(const y of t){let h=y.weight!=null?y.weight:1;const b=y.sets[0],p=y.sets[1];y.size+Rt>=Math.min(e[b].size,e[p].size)&&(h=0),i[b].push({set:p,size:y.size,weight:h}),i[p].push({set:b,size:y.size,weight:h})}const o=[];Object.keys(i).forEach(y=>{let h=0;for(let b=0;b<i[y].length;++b)h+=i[y][b].size*i[y][b].weight;o.push({set:y,size:h})});function r(y,h){return h.size-y.size}o.sort(r);const l={};function f(y){return y.set in l}function u(y,h){e[h].x=y.x,e[h].y=y.y,l[h]=!0}u({x:0,y:0},o[0].set);for(let y=1;y<o.length;++y){const h=o[y].set,b=i[h].filter(f),p=e[h];if(b.sort(r),b.length===0)throw"ERROR: missing pairwise overlap information";const M=[];for(var a=0;a<b.length;++a){const S=e[b[a].set],g=ht(p.radius,S.radius,b[a].size);M.push({x:S.x+g,y:S.y}),M.push({x:S.x-g,y:S.y}),M.push({y:S.y+g,x:S.x}),M.push({y:S.y-g,x:S.x});for(let m=a+1;m<b.length;++m){const v=e[b[m].set],c=ht(p.radius,v.radius,b[m].size),x=Et({x:S.x,y:S.y,radius:g},{x:v.x,y:v.y,radius:c});M.push(...x)}}let T=1e50,_=M[0];for(const S of M){e[h].x=S.x,e[h].y=S.y;const g=s(e,t);g<T&&(T=g,_=S)}u(_,h)}return e}function tt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const r=t[e.sets[0]],l=t[e.sets[1]];i=xt(r.radius,l.radius,q(r,l))}else i=st(e.sets.map(r=>t[r]));const o=e.weight!=null?e.weight:1;s+=o*(i-e.size)*(i-e.size)}return s}function Dt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const l=t[e.sets[0]],f=t[e.sets[1]];i=xt(l.radius,f.radius,q(l,f))}else i=st(e.sets.map(l=>t[l]));const o=e.weight!=null?e.weight:1,r=Math.log((i+1)/(e.size+1));s+=o*r*r}return s}function me(t,n,s){if(s==null?t.sort((i,o)=>o.radius-i.radius):t.sort(s),t.length>0){const i=t[0].x,o=t[0].y;for(const r of t)r.x-=i,r.y-=o}if(t.length===2&&q(t[0],t[1])<Math.abs(t[1].radius-t[0].radius)&&(t[1].x=t[0].x+t[0].radius-t[1].radius-1e-10,t[1].y=t[0].y),t.length>1){const i=Math.atan2(t[1].x,t[1].y)-n,o=Math.cos(i),r=Math.sin(i);for(const l of t){const f=l.x,u=l.y;l.x=o*f-r*u,l.y=r*f+o*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-n;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const o=t[1].y/(1e-10+t[1].x);for(const r of t){var e=(r.x+o*r.y)/(1+o*o);r.x=2*e-r.x,r.y=2*e*o-r.y}}}}function be(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}function s(i,o){const r=n(i),l=n(o);r.parent=l}for(let i=0;i<t.length;++i)for(let o=i+1;o<t.length;++o){const r=t[i].radius+t[o].radius;q(t[i],t[o])+1e-10<r&&s(t[o],t[i])}const e=new Map;for(let i=0;i<t.length;++i){const o=n(t[i]).parent.setid;e.has(o)||e.set(o,[]),e.get(o).push(t[i])}return t.forEach(i=>{delete i.parent}),Array.from(e.values())}function dt(t){const n=s=>{const e=t.reduce((o,r)=>Math.max(o,r[s]+r.radius),Number.NEGATIVE_INFINITY),i=t.reduce((o,r)=>Math.min(o,r[s]-r.radius),Number.POSITIVE_INFINITY);return{max:e,min:i}};return{xRange:n("x"),yRange:n("y")}}function Ct(t,n,s){n==null&&(n=Math.PI/2);let e=jt(t).map(u=>Object.assign({},u));const i=be(e);for(const u of i){me(u,n,s);const a=dt(u);u.size=(a.xRange.max-a.xRange.min)*(a.yRange.max-a.yRange.min),u.bounds=a}i.sort((u,a)=>a.size-u.size),e=i[0];let o=e.bounds;const r=(o.xRange.max-o.xRange.min)/50;function l(u,a,y){if(!u)return;const h=u.bounds;let b,p;if(a)b=o.xRange.max-h.xRange.min+r;else{b=o.xRange.max-h.xRange.max;const M=(h.xRange.max-h.xRange.min)/2-(o.xRange.max-o.xRange.min)/2;M<0&&(b+=M)}if(y)p=o.yRange.max-h.yRange.min+r;else{p=o.yRange.max-h.yRange.max;const M=(h.yRange.max-h.yRange.min)/2-(o.yRange.max-o.yRange.min)/2;M<0&&(p+=M)}for(const M of u)M.x+=b,M.y+=p,e.push(M)}let f=1;for(;f<i.length;)l(i[f],!0,!1),l(i[f+1],!1,!0),l(i[f+2],!0,!0),f+=3,o=dt(e);return Ot(e)}function Nt(t,n,s,e,i){const o=jt(t);n-=2*e,s-=2*e;const{xRange:r,yRange:l}=dt(o);if(r.max===r.min||l.max===l.min)return console.log("not scaling solution: zero size detected"),t;let f,u;if(i){const b=Math.sqrt(i/Math.PI)*2;f=n/b,u=s/b}else f=n/(r.max-r.min),u=s/(l.max-l.min);const a=Math.min(u,f),y=(n-(r.max-r.min)*a)/2,h=(s-(l.max-l.min)*a)/2;return Ot(o.map(b=>({radius:a*b.radius,x:e+y+(b.x-r.min)*a,y:e+h+(b.y-l.min)*a,setid:b.setid})))}function Ot(t){const n={};for(const s of t)n[s.setid]=s;return n}function jt(t){return Object.keys(t).map(s=>Object.assign(t[s],{setid:s}))}function ve(t={}){let n=!1,s=600,e=350,i=15,o=1e3,r=Math.PI/2,l=!0,f=null,u=!0,a=!0,y=null,h=null,b=!1,p=null,M=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,T={},_=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],S=0,g=function(x){if(x in T)return T[x];var d=T[x]=_[S];return S+=1,S>=_.length&&(S=0),d},m=At,v=tt;function c(x){let d=x.datum();const D=new Set;d.forEach(k=>{k.size==0&&k.sets.length==1&&D.add(k.sets[0])}),d=d.filter(k=>!k.sets.some(j=>D.has(j)));let I={},C={};if(d.length>0){let k=m(d,{lossFunction:v,distinct:b});l&&(k=Ct(k,r,h)),I=Nt(k,s,e,i,f),C=Lt(I,d,M)}const U={};d.forEach(k=>{k.label&&(U[k.sets]=k.label)});function V(k){if(k.sets in U)return U[k.sets];if(k.sets.length==1)return""+k.sets[0]}x.selectAll("svg").data([I]).enter().append("svg");const O=x.select("svg");n?O.attr("viewBox",`0 0 ${s} ${e}`):O.attr("width",s).attr("height",e);const R={};let E=!1;O.selectAll(".venn-area path").each(function(k){const j=this.getAttribute("d");k.sets.length==1&&j&&!b&&(E=!0,R[k.sets[0]]=Me(j))});function A(k){return j=>{const H=k.sets.map(et=>{let Y=R[et],Z=I[et];return Y||(Y={x:s/2,y:e/2,radius:1}),Z||(Z={x:s/2,y:e/2,radius:1}),{x:Y.x*(1-j)+Z.x*j,y:Y.y*(1-j)+Z.y*j,radius:Y.radius*(1-j)+Z.radius*j}});return St(H,p)}}const G=O.selectAll(".venn-area").data(d,k=>k.sets),P=G.enter().append("g").attr("class",k=>`venn-area venn-${k.sets.length==1?"circle":"intersection"}${k.colour||k.color?" venn-coloured":""}`).attr("data-venn-sets",k=>k.sets.join("_")),B=P.append("path"),L=P.append("text").attr("class","label").text(k=>V(k)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);a&&(B.style("fill-opacity","0").filter(k=>k.sets.length==1).style("fill",k=>k.colour?k.colour:k.color?k.color:g(k.sets)).style("fill-opacity",".25"),L.style("fill",k=>k.colour||k.color?"#FFF":t.textFill?t.textFill:k.sets.length==1?g(k.sets):"#444"));function K(k){return typeof k.transition=="function"?k.transition("venn").duration(o):k}let z=x;E&&typeof z.transition=="function"?(z=K(x),z.selectAll("path").attrTween("d",A)):z.selectAll("path").attr("d",k=>St(k.sets.map(j=>I[j])),p);const N=z.selectAll("text").filter(k=>k.sets in C).text(k=>V(k)).attr("x",k=>Math.floor(C[k.sets].x)).attr("y",k=>Math.floor(C[k.sets].y));u&&(E?"on"in N?N.on("end",rt(I,V)):N.each("end",rt(I,V)):N.each(rt(I,V)));const F=K(G.exit()).remove();typeof G.transition=="function"&&F.selectAll("path").attrTween("d",A);const X=F.selectAll("text").attr("x",s/2).attr("y",e/2);return y!==null&&(L.style("font-size","0px"),N.style("font-size",y),X.style("font-size","0px")),{circles:I,textCentres:C,nodes:G,enter:P,update:z,exit:F}}return c.wrap=function(x){return arguments.length?(u=x,c):u},c.useViewBox=function(){return n=!0,c},c.width=function(x){return arguments.length?(s=x,c):s},c.height=function(x){return arguments.length?(e=x,c):e},c.padding=function(x){return arguments.length?(i=x,c):i},c.distinct=function(x){return arguments.length?(b=x,c):b},c.colours=function(x){return arguments.length?(g=x,c):g},c.colors=function(x){return arguments.length?(g=x,c):g},c.fontSize=function(x){return arguments.length?(y=x,c):y},c.round=function(x){return arguments.length?(p=x,c):p},c.duration=function(x){return arguments.length?(o=x,c):o},c.layoutFunction=function(x){return arguments.length?(m=x,c):m},c.normalize=function(x){return arguments.length?(l=x,c):l},c.scaleToFit=function(x){return arguments.length?(f=x,c):f},c.styled=function(x){return arguments.length?(a=x,c):a},c.orientation=function(x){return arguments.length?(r=x,c):r},c.orientationOrder=function(x){return arguments.length?(h=x,c):h},c.lossFunction=function(x){return arguments.length?(v=x==="default"?tt:x==="logRatio"?Dt:x,c):v},c}function rt(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,o=n(s)||"",r=o.split(/\s+/).reverse(),f=(o.length+r.length)/3;let u=r.pop(),a=[u],y=0;const h=1.1;e.textContent=null;const b=[];function p(g){const m=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return m.textContent=g,b.push(m),e.append(m),m}let M=p(u);for(;u=r.pop(),!!u;){a.push(u);const g=a.join(" ");M.textContent=g,g.length>f&&M.getComputedTextLength()>i&&(a.pop(),M.textContent=a.join(" "),a=[u],M=p(u),y++)}const T=.35-y*h/2,_=e.getAttribute("x"),S=e.getAttribute("y");b.forEach((g,m)=>{g.setAttribute("x",_),g.setAttribute("y",S),g.setAttribute("dy",`${T+m*h}em`)})}}function at(t,n,s){let e=n[0].radius-q(n[0],t);for(let i=1;i<n.length;++i){const o=n[i].radius-q(n[i],t);o<=e&&(e=o)}for(let i=0;i<s.length;++i){const o=q(s[i],t)-s[i].radius;o<=e&&(e=o)}return e}function Ft(t,n,s){const e=[];for(const a of t)e.push({x:a.x,y:a.y}),e.push({x:a.x+a.radius/2,y:a.y}),e.push({x:a.x-a.radius/2,y:a.y}),e.push({x:a.x,y:a.y+a.radius/2}),e.push({x:a.x,y:a.y-a.radius/2});let i=e[0],o=at(e[0],t,n);for(let a=1;a<e.length;++a){const y=at(e[a],t,n);y>=o&&(i=e[a],o=y)}const r=zt(a=>-1*at({x:a[0],y:a[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,l={x:s?0:r[0],y:r[1]};let f=!0;for(const a of t)if(q(l,a)>a.radius){f=!1;break}for(const a of n)if(q(l,a)<a.radius){f=!1;break}if(f)return l;if(t.length==1)return{x:t[0].x,y:t[0].y};const u={};return st(t,u),u.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:u.arcs.length==1?{x:u.arcs[0].circle.x,y:u.arcs[0].circle.y}:n.length?Ft(t,[]):Tt(u.arcs.map(a=>a.p1))}function Ie(t){const n={},s=Object.keys(t);for(const e of s)n[e]=[];for(let e=0;e<s.length;e++){const i=s[e],o=t[i];for(let r=e+1;r<s.length;++r){const l=s[r],f=t[l],u=q(o,f);u+f.radius<=o.radius+1e-10?n[l].push(i):u+o.radius<=f.radius+1e-10&&n[i].push(l)}}return n}function Lt(t,n,s){const e={},i=Ie(t);for(let o=0;o<n.length;++o){const r=n[o].sets,l={},f={};for(let h=0;h<r.length;++h){l[r[h]]=!0;const b=i[r[h]];for(let p=0;p<b.length;++p)f[b[p]]=!0}const u=[],a=[];for(let h in t)h in l?u.push(t[h]):h in f||a.push(t[h]);const y=Ft(u,a,s);e[r]=y,y.disjoint&&n[o].size>0&&console.log("WARNING: area "+r+" not represented on screen")}return e}function ke(t,n,s){const e=[];return e.push(`
|
|
2
2
|
M`,t,n),e.push(`
|
|
3
3
|
m`,-s,0),e.push(`
|
|
4
4
|
a`,s,s,0,1,0,s*2,0),e.push(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as p,C as a,D as u,E as f,F as m,G as i,H as b}from"./index-
|
|
1
|
+
import{B as p,C as a,D as u,E as f,F as m,G as i,H as b}from"./index-B0EMFtj6.js";const c="utils/vue/vnode";function y(s){return a(s)&&s.type===u}const E=s=>{if(!a(s))return f(c,"[getNormalizedProps] must be a VNode"),{};const o=s.props||{},t=(a(s.type)?s.type.props:void 0)||{},e={};return Object.keys(t).forEach(r=>{m(t[r],"default")&&(e[r]=t[r].default)}),Object.keys(o).forEach(r=>{e[i(r)]=o[r]}),e},n=s=>{const o=p(s)?s:[s],t=[];return o.forEach(e=>{p(e)?t.push(...n(e)):a(e)&&e.component?.subTree?t.push(e,...n(e.component.subTree)):a(e)&&p(e.children)?t.push(...n(e.children)):a(e)&&e.shapeFlag===2?t.push(...n(e.type())):t.push(e)}),t};export{n as f,E as g,y as i};
|
package/web/assets/{wardleyDiagram-VM6X3IG4-ccuZQPl5.js → wardleyDiagram-VM6X3IG4-Dv6iPeuM.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as Mt}from"./chunk-JWPE2WC7-
|
|
1
|
+
import{p as Mt}from"./chunk-JWPE2WC7-BYVjCscS.js";import{s as Nt,g as zt,q as Lt,p as Tt,a as At,b as Xt,_ as u,X as Et,A as Yt,D as J,l as Q,G as It,d as Bt,r as Ft,c as V}from"./mermaid.core-CjiOH2Fd.js";import{p as Rt}from"./cynefin-OW5HDTMX-vJHwwFfl.js";import"./index-B0EMFtj6.js";import"./FilePreviewLoading-DQICPNpH.js";import"./use-form-common-props-DXtRQ91k.js";import"./el-scrollbar-TQDjLC61.js";import"./el-input-B1Cujpyw.js";import"./mobile-dialog-return-service-Dpx2MnbK.js";import"./BusyIndicator-1kY9qfWN.js";import"./isArrayLikeObject-HOg3E4xZ.js";import"./_baseIteratee-BvR4fgYp.js";import"./union-KFqNyw3w.js";import"./_baseFindIndex-D7XfJLKM.js";var G=u((o,r)=>{const e=o<=1?o*100:o;if(e<0||e>100)throw new Error(`${r} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${o}`);return e},"toPercent"),A=u((o,r,e)=>({x:G(r,`${e} evolution`),y:G(o,`${e} visibility`)}),"toCoordinates"),K=u(o=>{if(o){if(o==="+<>")return"bidirectional";if(o==="+<")return"backward";if(o==="+>")return"forward"}},"getFlowFromPort"),Ot=u(o=>{if(!o?.startsWith("+"))return{};const e=/^\+'([^']*)'/.exec(o)?.[1];return o.includes("<>")?{flow:"bidirectional",label:e}:o.includes("<")?{flow:"backward",label:e}:o.includes(">")?{flow:"forward",label:e}:{label:e}},"extractFlowFromArrow"),Wt=u((o,r)=>{if(Mt(o,r),o.size&&r.setSize(o.size.width,o.size.height),o.evolution){const e=o.evolution.stages.map(a=>a.secondName?`${a.name.trim()} / ${a.secondName.trim()}`:a.name.trim()),h=o.evolution.stages.filter(a=>a.boundary!==void 0).map(a=>a.boundary);r.updateAxes({stages:e,stageBoundaries:h})}if(o.anchors.forEach(e=>{const h=A(e.visibility,e.evolution,`Anchor "${e.name}"`);r.addNode(e.name,e.name,h.x,h.y,"anchor")}),o.components.forEach(e=>{const h=A(e.visibility,e.evolution,`Component "${e.name}"`),a=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,d=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,m=e.decorator?.strategy;r.addNode(e.name,e.name,h.x,h.y,"component",a,d,e.inertia,m)}),o.notes.forEach(e=>{const h=A(e.visibility,e.evolution,`Note "${e.text}"`);r.addNote(e.text,h.x,h.y)}),o.pipelines.forEach(e=>{const h=r.getNode(e.parent);if(!h||typeof h.y!="number")throw new Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);const a=h.y;r.startPipeline(e.parent),e.components.forEach(d=>{const m=`${e.parent}_${d.name}`,C=d.label?(d.label.negX?-1:1)*d.label.offsetX:void 0,g=d.label?(d.label.negY?-1:1)*d.label.offsetY:void 0,R=G(d.evolution,`Pipeline component "${d.name}" evolution`);r.addNode(m,d.name,R,a,"pipeline-component",C,g),r.addPipelineComponent(e.parent,m)})}),o.links.forEach(e=>{const h=!!e.arrow&&(e.arrow.includes("-.->")||e.arrow.includes(".-."));let a=K(e.fromPort)??K(e.toPort);const{flow:d,label:m}=Ot(e.arrow);!a&&d&&(a=d);const C=e.linkLabel,g=m??C;r.addLink(r.resolveNodeId(e.from),r.resolveNodeId(e.to),h,g,a)}),o.evolves.forEach(e=>{const h=r.getNode(e.component);if(h?.y!==void 0){const a=G(e.target,`Evolve target for "${e.component}"`);r.addTrend(e.component,a,h.y)}}),o.annotations.length>0){const e=o.annotations[0],h=A(e.x,e.y,"Annotations box");r.setAnnotationsBox(h.x,h.y)}o.annotation.forEach(e=>{const h=A(e.x,e.y,`Annotation ${e.number}`);r.addAnnotation(e.number,[{x:h.x,y:h.y}],e.text)}),o.accelerators.forEach(e=>{const h=A(e.x,e.y,`Accelerator "${e.name}"`);r.addAccelerator(e.name,h.x,h.y)}),o.deaccelerators.forEach(e=>{const h=A(e.x,e.y,`Deaccelerator "${e.name}"`);r.addDeaccelerator(e.name,h.x,h.y)})},"populateDb"),tt={parser:{yy:void 0},parse:u(async o=>{const r=await Rt("wardley",o);Q.debug(r);const e=tt.parser?.yy;if(!e||typeof e.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Wt(r,e)},"parse")},E,Dt=(E=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(r){const e=this.nodes.get(r.id)??{id:r.id,label:r.label},h={...e,...r,className:r.className??e.className,labelOffsetX:r.labelOffsetX??e.labelOffsetX,labelOffsetY:r.labelOffsetY??e.labelOffsetY};this.nodes.set(r.id,h)}addLink(r){this.links.push(r)}addTrend(r){this.trends.set(r.nodeId,r)}startPipeline(r){this.pipelines.set(r,{nodeId:r,componentIds:[]});const e=this.nodes.get(r);e&&(e.isPipelineParent=!0)}addPipelineComponent(r,e){const h=this.pipelines.get(r);h&&h.componentIds.push(e);const a=this.nodes.get(e);a&&(a.inPipeline=!0)}addAnnotation(r){this.annotations.push(r)}addNote(r){this.notes.push(r)}addAccelerator(r){this.accelerators.push(r)}addDeaccelerator(r){this.deaccelerators.push(r)}setAnnotationsBox(r,e){this.annotationsBox={x:r,y:e}}setAxes(r){this.axes={...this.axes,...r}}setSize(r,e){this.size={width:r,height:e}}getNode(r){return this.nodes.get(r)}resolveNodeId(r){if(this.nodes.has(r))return r;for(const[e,h]of this.nodes)if(h.label===r)return e;return r}build(){const r=[];for(const e of this.nodes.values()){if(typeof e.x!="number"||typeof e.y!="number")throw new Error(`Node "${e.label}" is missing coordinates`);r.push(e)}return{nodes:r,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},u(E,"WardleyBuilder"),E),k=new Dt;function et(){return V()["wardley-beta"]}u(et,"getConfig");function at(o,r,e,h,a,d,m,C,g){k.addNode({id:o,label:r,x:e,y:h,className:a,labelOffsetX:d,labelOffsetY:m,inertia:C,sourceStrategy:g})}u(at,"addNode");function rt(o,r,e=!1,h,a){k.addLink({source:o,target:r,dashed:e,label:h,flow:a})}u(rt,"addLink");function ot(o,r,e){k.addTrend({nodeId:o,targetX:r,targetY:e})}u(ot,"addTrend");function nt(o,r,e){k.addAnnotation({number:o,coordinates:r,text:e})}u(nt,"addAnnotation");function st(o,r,e){k.addNote({text:o,x:r,y:e})}u(st,"addNote");function it(o,r,e){k.addAccelerator({name:o,x:r,y:e})}u(it,"addAccelerator");function dt(o,r,e){k.addDeaccelerator({name:o,x:r,y:e})}u(dt,"addDeaccelerator");function lt(o,r){k.setAnnotationsBox(o,r)}u(lt,"setAnnotationsBox");function ct(o,r){k.setSize(o,r)}u(ct,"setSize");function pt(o){k.startPipeline(o)}u(pt,"startPipeline");function ft(o,r){k.addPipelineComponent(o,r)}u(ft,"addPipelineComponent");function ht(o){k.setAxes(o)}u(ht,"updateAxes");function xt(o){return k.getNode(o)}u(xt,"getNode");function gt(o){return k.resolveNodeId(o)}u(gt,"resolveNodeId");function yt(){return k.build()}u(yt,"getWardleyData");function ut(){k.clear(),Ft()}u(ut,"clear");var Gt={getConfig:et,addNode:at,addLink:rt,addTrend:ot,addAnnotation:nt,addNote:st,addAccelerator:it,addDeaccelerator:dt,setAnnotationsBox:lt,setSize:ct,startPipeline:pt,addPipelineComponent:ft,updateAxes:ht,getNode:xt,resolveNodeId:gt,getWardleyData:yt,clear:ut,setAccTitle:Xt,getAccTitle:At,setDiagramTitle:Tt,getDiagramTitle:Lt,getAccDescription:zt,setAccDescription:Nt},qt=["Genesis","Custom Built","Product","Commodity"],Ht=u(()=>{const{themeVariables:o}=V();return{backgroundColor:o.wardley?.backgroundColor??o.background??"#fff",axisColor:o.wardley?.axisColor??"#000",axisTextColor:o.wardley?.axisTextColor??o.primaryTextColor??"#222",gridColor:o.wardley?.gridColor??"rgba(100, 100, 100, 0.2)",componentFill:o.wardley?.componentFill??"#fff",componentStroke:o.wardley?.componentStroke??"#000",componentLabelColor:o.wardley?.componentLabelColor??o.primaryTextColor??"#222",linkStroke:o.wardley?.linkStroke??"#000",evolutionStroke:o.wardley?.evolutionStroke??"#dc3545",annotationStroke:o.wardley?.annotationStroke??"#000",annotationTextColor:o.wardley?.annotationTextColor??o.primaryTextColor??"#222",annotationFill:o.wardley?.annotationFill??o.background??"#fff"}},"getTheme"),jt=u(()=>{const o=V()["wardley-beta"];return{width:o?.width??900,height:o?.height??600,padding:o?.padding??48,nodeRadius:o?.nodeRadius??6,nodeLabelOffset:o?.nodeLabelOffset??8,axisFontSize:o?.axisFontSize??12,labelFontSize:o?.labelFontSize??10,showGrid:o?.showGrid??!1,useMaxWidth:o?.useMaxWidth??!0}},"getConfigValues"),Vt=u((o,r,e,h)=>{Q.debug(`Rendering Wardley map
|
|
2
2
|
`+o);const a=jt(),d=Ht(),m=a.nodeRadius*1.6,C=h.db,g=C.getWardleyData(),R=C.getDiagramTitle(),S=g.size?.width??a.width,b=g.size?.height??a.height,Y=It(r);Y.selectAll("*").remove(),Bt(Y,b,S,a.useMaxWidth),Y.attr("viewBox",`0 0 ${S} ${b}`);const v=Y.append("g").attr("class","wardley-map"),q=Y.append("defs");q.append("marker").attr("id",`arrow-${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("fill",d.evolutionStroke).attr("stroke","none"),q.append("marker").attr("id",`link-arrow-end-${r}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.linkStroke).attr("stroke","none"),q.append("marker").attr("id",`link-arrow-start-${r}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",d.linkStroke).attr("stroke","none"),v.append("rect").attr("class","wardley-background").attr("width",S).attr("height",b).attr("fill",d.backgroundColor);const I=S-a.padding*2,B=b-a.padding*2;R&&v.append("text").attr("class","wardley-title").attr("x",S/2).attr("y",a.padding/2).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(R);const z=u(t=>a.padding+t/100*I,"projectX"),L=u(t=>b-a.padding-t/100*B,"projectY"),O=v.append("g").attr("class","wardley-axes");O.append("line").attr("x1",a.padding).attr("x2",S-a.padding).attr("y1",b-a.padding).attr("y2",b-a.padding).attr("stroke",d.axisColor).attr("stroke-width",1),O.append("line").attr("x1",a.padding).attr("x2",a.padding).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke",d.axisColor).attr("stroke-width",1);const mt=g.axes.xLabel??"Evolution",wt=g.axes.yLabel??"Visibility";O.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",a.padding+I/2).attr("y",b-a.padding/4).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(mt),O.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",a.padding/3).attr("y",a.padding+B/2).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${a.padding/3} ${a.padding+B/2})`).text(wt);const F=g.axes.stages&&g.axes.stages.length>0?g.axes.stages:qt;if(F.length>0){const t=v.append("g").attr("class","wardley-stages"),s=g.axes.stageBoundaries,n=[];if(s&&s.length===F.length){let i=0;s.forEach(p=>{n.push({start:i,end:p}),i=p})}else{const i=1/F.length;F.forEach((p,l)=>{n.push({start:l*i,end:(l+1)*i})})}F.forEach((i,p)=>{const l=n[p],f=a.padding+l.start*I,x=a.padding+l.end*I,y=(f+x)/2;p>0&&t.append("line").attr("x1",f).attr("x2",f).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),t.append("text").attr("class","wardley-stage-label").attr("x",y).attr("y",b-a.padding/1.5).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize-2).attr("text-anchor","middle").text(i)})}if(a.showGrid){const t=v.append("g").attr("class","wardley-grid");for(let s=1;s<4;s++){const n=s/4,i=a.padding+I*n;t.append("line").attr("x1",i).attr("x2",i).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6"),t.append("line").attr("x1",a.padding).attr("x2",S-a.padding).attr("y1",b-a.padding-B*n).attr("y2",b-a.padding-B*n).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6")}}const c=new Map;if(g.nodes.forEach(t=>{c.set(t.id,{x:z(t.x),y:L(t.y),node:t})}),g.pipelines.length>0){const t=v.append("g").attr("class","wardley-pipelines"),s=v.append("g").attr("class","wardley-pipeline-links");g.pipelines.forEach(n=>{if(n.componentIds.length===0)return;const i=n.componentIds.map(x=>({id:x,pos:c.get(x),node:g.nodes.find(y=>y.id===x)})).filter(x=>x.pos&&x.node).sort((x,y)=>x.node.x-y.node.x);for(let x=0;x<i.length-1;x++){const y=i[x],w=i[x+1];s.append("line").attr("class","wardley-pipeline-evolution-link").attr("x1",y.pos.x).attr("y1",y.pos.y).attr("x2",w.pos.x).attr("y2",w.pos.y).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4")}let p=1/0,l=-1/0,f=0;if(n.componentIds.forEach(x=>{const y=c.get(x);y&&(p=Math.min(p,y.x),l=Math.max(l,y.x),f=y.y)}),p!==1/0&&l!==-1/0){const y=a.nodeRadius*4,w=f-y/2,P=c.get(n.nodeId);if(P){const N=(p+l)/2;P.x=N,P.y=w-m/6}t.append("rect").attr("class","wardley-pipeline-box").attr("x",p-15).attr("y",w).attr("width",l-p+30).attr("height",y).attr("fill","none").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const _=v.append("g").attr("class","wardley-links"),Z=new Map;g.pipelines.forEach(t=>{Z.set(t.nodeId,new Set(t.componentIds))});const U=g.links.filter(t=>!(!c.has(t.source)||!c.has(t.target)||Z.get(t.target)?.has(t.source)));_.selectAll("line").data(U).enter().append("line").attr("class",t=>`wardley-link${t.dashed?" wardley-link--dashed":""}`).attr("x1",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.source).isPipelineParent?m/Math.sqrt(2):a.nodeRadius,l=n.x-s.x,f=n.y-s.y,x=Math.sqrt(l*l+f*f);return s.x+l/x*p}).attr("y1",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.source).isPipelineParent?m/Math.sqrt(2):a.nodeRadius,l=n.x-s.x,f=n.y-s.y,x=Math.sqrt(l*l+f*f);return s.y+f/x*p}).attr("x2",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.target).isPipelineParent?m/Math.sqrt(2):a.nodeRadius,l=s.x-n.x,f=s.y-n.y,x=Math.sqrt(l*l+f*f);return n.x+l/x*p}).attr("y2",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.target).isPipelineParent?m/Math.sqrt(2):a.nodeRadius,l=s.x-n.x,f=s.y-n.y,x=Math.sqrt(l*l+f*f);return n.y+f/x*p}).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",t=>t.dashed?"6 6":null).attr("marker-end",t=>t.flow==="forward"||t.flow==="bidirectional"?`url(#link-arrow-end-${r})`:null).attr("marker-start",t=>t.flow==="backward"||t.flow==="bidirectional"?`url(#link-arrow-start-${r})`:null),_.selectAll("text").data(U.filter(t=>t.label)).enter().append("text").attr("class","wardley-link-label").attr("x",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.x+n.x)/2,p=n.y-s.y,l=n.x-s.x,f=Math.sqrt(l*l+p*p),x=8,y=p/f;return i+y*x}).attr("y",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.y+n.y)/2,p=n.x-s.x,l=n.y-s.y,f=Math.sqrt(p*p+l*l),x=8,y=-p/f;return i+y*x}).attr("fill",d.axisTextColor).attr("font-size",a.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.x+n.x)/2,p=(s.y+n.y)/2,l=n.x-s.x,f=n.y-s.y,x=Math.sqrt(l*l+f*f),y=8,w=f/x,P=-l/x,N=i+w*y,W=p+P*y;let X=Math.atan2(f,l)*180/Math.PI;return(X>90||X<-90)&&(X+=180),`rotate(${X} ${N} ${W})`}).text(t=>t.label);const kt=v.append("g").attr("class","wardley-trends"),bt=g.trends.map(t=>{const s=c.get(t.nodeId);if(!s)return null;const n=z(t.targetX),i=L(t.targetY),p=n-s.x,l=i-s.y,f=Math.sqrt(p*p+l*l),x=a.nodeRadius+2,y=f>x?n-p/f*x:n,w=f>x?i-l/f*x:i;return{origin:s,targetX:n,targetY:i,adjustedX2:y,adjustedY2:w}}).filter(t=>t!==null);kt.selectAll("line").data(bt).enter().append("line").attr("class","wardley-trend").attr("x1",t=>t.origin.x).attr("y1",t=>t.origin.y).attr("x2",t=>t.adjustedX2).attr("y2",t=>t.adjustedY2).attr("stroke",d.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${r})`);const M=v.append("g").attr("class","wardley-nodes").selectAll("g").data(g.nodes).enter().append("g").attr("class",t=>["wardley-node",t.className?`wardley-node--${t.className}`:""].filter(Boolean).join(" "));M.filter(t=>t.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#666").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#ccc").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const T=M.filter(t=>t.sourceStrategy==="market");T.append("circle").attr("class","wardley-market-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>!t.isPipelineParent&&t.sourceStrategy!=="market"&&t.className!=="anchor").append("circle").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1);const H=a.nodeRadius*.7,$=a.nodeRadius*1.2;if(T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x).attr("y1",t=>c.get(t.id).y-$).attr("x2",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x).attr("y2",t=>c.get(t.id).y-$).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y-$).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),M.filter(t=>t.isPipelineParent===!0).append("rect").attr("x",t=>c.get(t.id).x-m/2).attr("y",t=>c.get(t.id).y-m/2).attr("width",m).attr("height",m).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",t=>{const s=c.get(t.id);let n=t.isPipelineParent?m/2+15:a.nodeRadius+15;return t.sourceStrategy&&(n+=a.nodeRadius+10),s.x+n}).attr("y1",t=>{const s=c.get(t.id),n=t.isPipelineParent?m:a.nodeRadius*2;return s.y-n/2}).attr("x2",t=>{const s=c.get(t.id);let n=t.isPipelineParent?m/2+15:a.nodeRadius+15;return t.sourceStrategy&&(n+=a.nodeRadius+10),s.x+n}).attr("y2",t=>{const s=c.get(t.id),n=t.isPipelineParent?m:a.nodeRadius*2;return s.y+n/2}).attr("stroke",d.componentStroke).attr("stroke-width",6),M.append("text").attr("x",t=>{const s=c.get(t.id);if(t.className==="anchor")return t.labelOffsetX!==void 0?s.x+t.labelOffsetX:s.x;let n=a.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetX===void 0&&(n+=10);const i=t.labelOffsetX??n;return s.x+i}).attr("y",t=>{const s=c.get(t.id);if(t.className==="anchor")return t.labelOffsetY!==void 0?s.y+t.labelOffsetY:s.y-3;let n=-a.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetY===void 0&&(n-=10);const i=t.labelOffsetY??n;return s.y+i}).attr("class","wardley-node-label").attr("fill",t=>t.className==="evolved"?d.evolutionStroke:t.className==="anchor"?"#000":d.componentLabelColor).attr("font-size",a.labelFontSize).attr("font-weight",t=>t.className==="anchor"?"bold":"normal").attr("text-anchor",t=>t.className==="anchor"?"middle":"start").attr("dominant-baseline",t=>t.className==="anchor"?"middle":"auto").text(t=>t.label),g.annotations.length>0){const t=v.append("g").attr("class","wardley-annotations");if(g.annotations.forEach(s=>{const n=s.coordinates.map(i=>({x:z(i.x),y:L(i.y)}));if(n.length>1)for(let i=0;i<n.length-1;i++)t.append("line").attr("class","wardley-annotation-line").attr("x1",n[i].x).attr("y1",n[i].y).attr("x2",n[i+1].x).attr("y2",n[i+1].y).attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("stroke-dasharray","4 4");n.forEach(i=>{const p=t.append("g").attr("class","wardley-annotation");p.append("circle").attr("cx",i.x).attr("cy",i.y).attr("r",10).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5),p.append("text").attr("x",i.x).attr("y",i.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.number)})}),g.annotationsBox){let s=z(g.annotationsBox.x),n=L(g.annotationsBox.y);const i=10,p=16,l=11,f=t.append("g").attr("class","wardley-annotations-box"),x=[...g.annotations].filter(w=>w.text).sort((w,P)=>w.number-P.number),y=[];if(x.forEach((w,P)=>{const N=f.append("text").attr("x",s+i).attr("y",n+i+(P+1)*p).attr("font-size",l).attr("fill",d.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${w.number}. ${w.text}`);y.push(N)}),y.length>0){let w=0,P=0;y.forEach(j=>{const D=j.node(),Ct=D.getComputedTextLength();w=Math.max(w,Ct);const St=D.getBBox();P=Math.max(P,St.height)});const N=w+i*2+105,W=x.length*p+i*2+P/2,X=a.padding,$t=S-a.padding-N,vt=a.padding,Pt=b-a.padding-W;s=Math.max(X,Math.min(s,$t)),n=Math.max(vt,Math.min(n,Pt)),y.forEach((j,D)=>{j.attr("x",s+i).attr("y",n+i+(D+1)*p)}),f.insert("rect","text").attr("x",s).attr("y",n).attr("width",N).attr("height",W).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(g.notes.length>0){const t=v.append("g").attr("class","wardley-notes");g.notes.forEach(s=>{const n=z(s.x),i=L(s.y);t.append("text").attr("x",n).attr("y",i).attr("text-anchor","start").attr("font-size",11).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.text)})}if(g.accelerators.length>0){const t=v.append("g").attr("class","wardley-accelerators");g.accelerators.forEach(s=>{const n=z(s.x),i=L(s.y),p=60,l=30,f=20,x=`
|
|
3
3
|
M ${n} ${i-l/2}
|
|
4
4
|
L ${n+p-f} ${i-l/2}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as ct}from"./uuid-BmNSYLtZ.js";import{ax as Ho,am as zo,eM as St,eN as Go,m as we,ap as Vo,o as s,J as ee,K as _e,p as ze,N as E,n as u,a6 as Ie,L as d,X as f,Y as ie,a8 as kt,d5 as vn,k as X,cO as Wo,B as Ko,f as G,aF as Qo,au as Yo,eO as Jo,eP as Xo,eQ as Nt,eR as Zn,t as l,A as st,eS as Zo,af as Et,e as at,eT as ea,w as Re,ab as De,eU as ta,M as Fe,co as eo,eV as to,eW as na,eX as Me,eY as oa,eZ as aa,e_ as pn,r as no,cp as ia,cz as oo,aK as an,T as dt,ac as We,a0 as Ve,W as S,a5 as hn,q as te,U as ke,H as ne,at as ao,_ as xe,d0 as ra,Z as Ue,e$ as _n,Q as bn,f0 as sa,e0 as la,$ as Dt,dP as ca,as as mt,a3 as Ee,eo as da,f1 as ua,l as yn,c9 as fa,a4 as kn,bx as Ke,aY as ma}from"./index-BUhxunFw.js";import{l as Cn,i as ga,r as va,a as pa,C as wn,b as En,c as In,m as ha,d as xn,e as It,f as he,g as _a,h as ba,j as ya,k as Sn,n as Bt,o as ka,p as Ca}from"./conversation-history-D0dYP2WF.js";import{E as wa}from"./message-box-service-ClqgcroZ.js";import{A as Tn,r as Ea,g as io,E as ro,e as so,M as Ia,H as An,t as xa,B as Rn,p as Sa,h as Tt,n as wt,o as rn,q as Pn,F as Ta}from"./FilePreviewLoading-CIpZdYzn.js";import{e as lo}from"./error-presentation-DEEUWoo2.js";import{a as Je,E as co}from"./el-input-DRfzkDZL.js";import{M as be}from"./MarIcon-DPR_cErX.js";import{B as lt}from"./BusyIndicator-OB15NEUK.js";import{o as uo,a as Aa,E as Ra}from"./el-checkbox-Ci-HorIw.js";import{a as Pa,E as $a}from"./el-radio-BKqvRBz2.js";/* empty css */import{E as Da}from"./el-scrollbar-Bf_tA9ul.js";import{f as ot,p as jt}from"./time-presentation-DJL3_MuB.js";import{C as Ma,E as La,b as Oa,a as Na}from"./el-select-IP0F7gdJ.js";/* empty css */import{E as fo,u as Qt,m as Yt}from"./mobile-dialog-return-service-BHEhZMkb.js";import{l as $n,r as Dn}from"./runner-presentation-CwG4XRVy.js";const ja=zo({...uo(St,["ariaLabel","gpuAcceleration","rawContent"]),placement:Tn.placement,tabindex:Tn.tabindex,effect:{...St.effect,default:"light"},title:String,width:{type:[String,Number],default:150},offset:{...St.offset,default:void 0},persistent:{...St.persistent,default:!0}}),qa={"update:visible":e=>Ho(e),"before-enter":()=>!0,"before-leave":()=>!0,"after-enter":()=>!0,"after-leave":()=>!0};({...uo(Go,["gpuAcceleration"])});var Ua=we({name:"ElPopover",__name:"popover",props:ja,emits:qa,setup(e,{expose:n,emit:t}){const o=e,a=t,r=X(()=>{const O=vn.props;return Wo(o,Ko(O)?O:Object.keys(O))}),i=Vo("popover"),c=G(),g=X(()=>d(c)?.popperRef),v=X(()=>[{width:Qo(o.width)},o.popperStyle]),m=X(()=>[i.b(),o.popperClass,{[i.m("plain")]:!!o.content}]),p=X(()=>o.transition===`${i.namespace.value}-fade-in-linear`),C=()=>{c.value?.hide()},x=()=>{a("before-enter")},L=()=>{a("before-leave")},A=()=>{a("after-enter")},R=()=>{a("update:visible",!1),a("after-leave")};return n({popperRef:g,hide:C}),(O,q)=>(s(),ee(d(vn),kt({ref_key:"tooltipRef",ref:c},r.value,{"aria-label":e.title,"popper-class":m.value,"popper-style":v.value,"gpu-acceleration":p.value,onBeforeShow:x,onBeforeHide:L,onShow:A,onHide:R}),{content:_e(()=>[e.title?(s(),u("div",{key:0,class:Ie(d(i).e("title")),role:"title"},f(e.title),3)):E("v-if",!0),ze(O.$slots,"default",{hide:C},()=>[ie(f(e.content),1)])]),default:_e(()=>[O.$slots.reference?ze(O.$slots,"reference",{key:0}):E("v-if",!0)]),_:3},16,["aria-label","popper-class","popper-style","gpu-acceleration"]))}}),Ba=Ua;const Mn=(e,n)=>{const t=(n.arg||n.value)?.popperRef;t&&(t.triggerRef=e)};var Fa={mounted(e,n){Mn(e,n)},updated(e,n){Mn(e,n)}};const Ha="popover",za=Jo(Fa,Ha),mo=Yo(Ba,{directive:za});function ip(e,n,t,o=ct()){const a=Xo.parse({...n,id:o}),r=[...e,a],i=Nt("mar_references",{references:r});if(t.length+i.length+1>Zn)throw new Error("COMPOSER_TAG_INVALID");return r}function Jt(e){const n=e.customTitle?.trim();if(n)return n;const t=e.runnerTitle?.trim();return t===void 0||t===""||t==="Untitled session"||t.toLocaleLowerCase()==="new session"?l("generated.sessionPresentation.newSession"):t}function go(e){return typeof e?.externalSessionId=="string"&&e.externalSessionId.length>0}function rp(e){return!go(e)}function sp(e){return e.trim().replace(/\s+/g," ").slice(0,160)}function vo(e){return e.activity!==void 0?e.activity:"IDLE"}function lp(e){return{RUNNING:l("generated.sessionPresentation.running"),IDLE:l("generated.sessionPresentation.ready")}[vo(e)]}function Ga(e){return{STARTING:l("generated.sessionPresentation.starting"),RUNNING:l("generated.sessionPresentation.running2"),SUCCEEDED:l("generated.sessionPresentation.completed"),FAILED:l("generated.sessionPresentation.failed"),CANCELLED:l("generated.sessionPresentation.cancelled"),INTERRUPTED:l("generated.sessionPresentation.interrupted"),LOST:l("generated.sessionPresentation.connectionLost")}[e]??e}const Va=new Set(["PREPARING","RUNNING","WAITING_INPUT","WAITING_APPROVAL","SUCCEEDED","FAILED","CANCELLED","INTERRUPTED","LOST"]);function Ln(e){return e==null||typeof e=="number"&&Number.isInteger(e)&&e>=0}function Wa(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;const n=e;return typeof n.id=="string"&&n.id.length>0&&typeof n.kind=="string"&&n.kind.length>0&&typeof n.status=="string"&&n.status.length>0}function sn(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;const n=e;return typeof n.id=="string"&&n.id.length>0&&typeof n.turnId=="string"&&n.turnId.length>0&&typeof n.sessionId=="string"&&n.sessionId.length>0&&(n.runId===null||typeof n.runId=="string"&&n.runId.length>0)&&typeof n.index=="number"&&Number.isInteger(n.index)&&n.index>=0&&typeof n.status=="string"&&Va.has(n.status)&&Array.isArray(n.items)&&n.items.every(Wa)&&Ln(n.startedAt)&&Ln(n.completedAt)}function po(e,n){if(typeof e!="object"||e===null||Array.isArray(e))return;const t=e;if(!(t.unit!=="SEGMENT"||!Array.isArray(t.segments)||!t.segments.every(sn)||new Set(t.segments.map(a=>a.sessionId)).size>1))return ft({unit:"SEGMENT",segments:t.segments,nextCursor:typeof t.nextCursor=="string"?t.nextCursor:null,...typeof t.snapshotSequence=="number"?{snapshotSequence:t.snapshotSequence}:n===void 0?{}:{snapshotSequence:n},...t.source==="official"||t.source==="native"||t.source==="runtime"?{source:t.source}:{},...typeof t.readAt=="number"?{readAt:t.readAt}:{},...typeof t.latestVisibleAt=="number"?{latestVisibleAt:t.latestVisibleAt}:{},...t.deferredOlderHistory===!0?{deferredOlderHistory:!0}:{}})}function ft(e){if(!Array.isArray(e.segments))throw new Error("The conversation history response contains no segments.");const n=e;if(!n.segments.every(sn))throw new Error("The conversation Segment response contains an invalid Segment.");return{...n,turns:n.segments.map(t=>({id:t.id,turnId:t.turnId,segmentIndex:t.index,sessionId:t.sessionId,runId:t.runId,status:t.status,...t.rewind===void 0?{}:{rewind:t.rewind},items:t.items,...t.startedAt===void 0?{}:{startedAt:t.startedAt},...t.completedAt===void 0?{}:{completedAt:t.completedAt}}))}}function Ft(e,n){const t=[...e];for(const[o,a]of n.entries()){const r=t.findIndex(c=>c.id===a.id);if(r>=0){const c=t[r],g=a.rewind??(c.sessionId===a.sessionId?c.rewind:void 0);t.splice(r,1,g===void 0?a:{...a,rewind:g});continue}if(a.turnId!==void 0&&a.segmentIndex!==void 0){const c=t.findIndex(v=>v.turnId===a.turnId&&v.segmentIndex!==void 0&&v.segmentIndex>a.segmentIndex),g=t.findLastIndex(v=>v.turnId===a.turnId);if(c>=0||g>=0){t.splice(c>=0?c:g+1,0,a);continue}}const i=n.slice(o+1).find(c=>t.some(g=>g.id===c.id));if(i!==void 0){t.splice(t.findIndex(c=>c.id===i.id),0,a);continue}t.push(a)}return t}function ho(e,n,t){const o=e.findLastIndex(i=>i.runId===n&&(t===void 0||(i.turnId??i.id)===t));if(o<0)return-1;const a=e[o].turnId??e[o].id;let r=o;for(const[i,c]of e.entries())c.runId===n&&(c.turnId??c.id)===a&&(c.segmentIndex??-1)>(e[r].segmentIndex??-1)&&(r=i);return r}function Ka(e,n,t){const o=ho(e,n);return e.map((a,r)=>r===o&&a.status!==t?{...a,status:t}:a)}function Qa(e){let n,t,o,a,r,i=0,c=!1,g=!1,v=0;function m(){n!==void 0&&clearTimeout(n),o?.abort(new st("WATCH_CANCELLED","The watch was stopped or replaced.")),n=void 0,o=void 0,t=void 0,a=void 0,r=void 0,i=0,c=!1,g=!1,v=0}function p(){n!==void 0&&clearTimeout(n),n=void 0,c=!0}async function C(O,q,_){const y=setTimeout(()=>_.abort(new st("WATCH_REQUEST_TIMEOUT","The watch request timed out.")),e.requestTimeoutMs);try{if(await e.renew(O,_.signal,q),o!==_||a!==O)return;r=Date.now(),i=0,g=!1,v=0}catch(w){if(o!==_||a!==O)return;const T=_.signal.aborted&&w instanceof Error&&w.name==="AbortError"?_.signal.reason:w;if(e.recovery!==void 0&&(q==="renew"||g)){e.recovery.onFailure(T),q==="initial"&&(v+=1),!c&&e.recovery.retryable(T)&&v<e.maxFailures?g=!0:(p(),e.onExpired());return}if(q==="initial")throw c=!0,i=0,r=void 0,T;i+=1;const M=r!==void 0&&Date.now()-r>=e.confirmationTimeoutMs;(i>=e.maxFailures||M)&&(e.onExpired(),i=0,r=void 0)}finally{clearTimeout(y)}}function x(O,q){if(c||t!==void 0||a!==O||!e.eligible(O))return t;const _=new AbortController;o=_;const y=C(O,q,_).finally(()=>{t===y&&(t=void 0,o=void 0,L(O))});return t=y,y}function L(O){n!==void 0&&clearTimeout(n),!(c||a!==O)&&(n=setTimeout(()=>{n=void 0,x(O,g?"initial":"renew")?.catch(()=>{})},e.heartbeatMs))}function A(O,q=!1){if(!e.eligible(O)){m();return}if(a===O){if(t!==void 0)return t;if(n!==void 0)return}if(m(),c=!1,a=O,!q)return x(O,"initial");L(O)}function R(O){a===O&&(r=Date.now(),i=0)}return{start:A,pause:p,stop:m,confirm:R,isWatching:O=>a===O}}function cp(e){const n=()=>e.workbenchConnectionId===void 0?"local-test-connection":e.workbenchConnectionId(),t=()=>e.position==="secondary"?e.enabled?.()===!0:e.enabled?.()!==!1;let o,a,r,i,c,g;const v=Et();let m,p=0,C;function x(b=new st("WATCH_CANCELLED","The watch was stopped or replaced.")){const D=C;D!==void 0&&(C=void 0,D.removeAbortListener(),D.reject(b))}function L(b,D,z){return x(),new Promise((F,se)=>{const U=()=>{C?.watchId===D&&x(z?.reason instanceof Error?z.reason:new st("WATCH_CANCELLED","The watch was stopped or replaced."))};z?.addEventListener("abort",U,{once:!0}),C={sessionId:b,watchId:D,resolve:F,reject:se,removeAbortListener:()=>z?.removeEventListener("abort",U),events:[]},z?.aborted===!0&&U()})}function A(b){return t()&&e.selectedSessionId.value===b&&O(b)}function R(b){return O(b.id)}function O(b){return!b.startsWith("draft:")&&(typeof document>"u"||document.visibilityState==="visible")}async function q(b,D,z="renew"){if(!t())return;const F=e.workspaceTarget.value?.nodeId,se=e.workspaceTarget.value?.workspaceId,U=n();if(F===void 0||se===void 0||U===void 0||e.selectedSessionId.value!==b)return;z==="initial"?(v.value=void 0,o=ct().replace(/-/g,""),g=void 0,a=b,r=F,i=se):o??=ct().replace(/-/g,"");const K=o,ae=z==="initial"?L(b,K,D):void 0;ae?.catch(()=>{});let ve=!1,me;try{if(me=await e.request(`/api/agent-sessions/${e.sessionPathId(b)}/watch`,{method:"POST",body:JSON.stringify({nodeId:F,workspaceId:se,workbenchConnectionId:U,watchId:K,mode:z,...e.position===void 0?{}:{position:e.position},unit:"SEGMENT"}),...D===void 0?{}:{signal:D}}),ve=!0,e.workspaceTarget.value?.nodeId!==F||e.workspaceTarget.value?.workspaceId!==se||e.selectedSessionId.value!==b||n()!==U||o!==K){C?.watchId===K&&x(),await ae?.catch(()=>{});return}typeof me?.nodeGeneration=="string"&&a===b&&(g=me.nodeGeneration),await ae}catch(fe){throw C?.watchId===K&&x(),await ae?.catch(()=>{}),ve&&at(fe)==="WATCH_REQUEST_TIMEOUT"?new st("SESSION_WATCH_SNAPSHOT_TIMEOUT","The initial session snapshot did not arrive before the watch deadline."):fe}}const _=Qa({heartbeatMs:e.heartbeatMs,requestTimeoutMs:e.requestTimeoutMs,confirmationTimeoutMs:e.confirmationTimeoutMs,maxFailures:3,eligible:A,renew:(b,D,z)=>q(b,D,z),onExpired:e.refreshSnapshot});function y(b,D={}){if(!t())return;const z=n();if(a===b&&c!==z)return T(b,D.preserveFailures!==!0);a!==b&&(o=ct().replace(/-/g,""),g=void 0,D.preserveFailures!==!0&&(p=0),a=b,r=e.workspaceTarget.value?.nodeId,i=e.workspaceTarget.value?.workspaceId,c=z);const F=_.start(b,D.skipImmediateRenew===!0),se=o,U=F?.then(()=>{if(o!==se||n()!==z)throw new st("WATCH_CANCELLED","The watch was stopped or replaced.")});return U?.catch(()=>{}),U}function w(){v.value=void 0,x();const b=a,D=o,z=r,F=i,se=c;a=void 0,r=void 0,i=void 0,c=void 0,o=void 0,g=void 0,p=0,m!==void 0&&clearTimeout(m),m=void 0,_.stop(),!(b===void 0||D===void 0||z===void 0||F===void 0||se===void 0)&&e.request(`/api/agent-sessions/${e.sessionPathId(b)}/watch`,{method:"DELETE",body:JSON.stringify({nodeId:z,workspaceId:F,workbenchConnectionId:se,watchId:D,...e.position===void 0?{}:{position:e.position}})}).catch(()=>{})}function T(b,D=!0){return v.value=void 0,m!==void 0&&clearTimeout(m),m=void 0,x(),_.stop(),a=void 0,r=void 0,i=void 0,c=void 0,o=void 0,g=void 0,D&&(p=0),y(b,{preserveFailures:!D})}function M(b){return T(b)??Promise.resolve()}function h(){m!==void 0&&clearTimeout(m),m=void 0,_.pause()}function I(b){if(typeof b!="object"||b===null)return!1;const D=b;if(D.type!=="watch.session.snapshot"&&D.type!=="watch.session.event"||D.workbenchConnectionId!==n()||D.nodeId!==e.workspaceTarget.value?.nodeId||D.workspaceId!==i||D.sessionId!==a||o===void 0||D.watchId!==o||typeof D.nodeGeneration!="string"||g!==void 0&&D.nodeGeneration!==g)return!1;g??=D.nodeGeneration,p=0;const z=a;if(z===void 0)return!1;if(D.type==="watch.session.event"){const ae=D.event;if(ae!==void 0&&typeof ae.sequence=="number"&&["node","session","conversation","run","queue","workspace"].includes(String(ae.category))&&"payload"in ae){const ve={nodeId:D.nodeId,sequence:ae.sequence,category:ae.category,payload:ae.payload};C?.sessionId===z&&C.watchId===o?C.events.push(ve):e.applyEvent?.(ve)}return!0}if(D.payload===void 0)return!1;const F=D.payload,se=F.kind==="session-watch-snapshot"&&typeof F.sequence=="number"&&typeof F.session=="object"&&F.session!==null&&Array.isArray(F.runs)?F:void 0;if(se!==void 0){e.applyEvent?.({nodeId:D.nodeId,sequence:se.sequence,category:"session",payload:{session:se.session}});const ae=se.runs;if(e.applyRunsSnapshot!==void 0)e.applyRunsSnapshot(ae);else for(const ve of ae)e.applyEvent?.({nodeId:D.nodeId,sequence:se.sequence,category:"run",payload:{run:ve}});typeof se.queue=="object"&&se.queue!==null&&e.applyEvent?.({nodeId:D.nodeId,sequence:se.sequence,category:"queue",payload:{sessionId:z,queue:se.queue}},"initial"),"context"in se&&e.applyEvent?.({nodeId:D.nodeId,sequence:se.sequence,category:"session",payload:{sessionId:z,context:se.context}}),se.performance!==void 0&&e.applyEvent?.({nodeId:D.nodeId,sequence:se.sequence,category:"conversation",payload:{sessionId:z,performance:se.performance}})}const U=se?.conversation??D.payload,K=po(U)??ft(U);if(C?.sessionId===z&&C.watchId===o){const ae=C;C=void 0,ae.removeAbortListener(),e.applySnapshot(z,K,D.historyReset===!0?"reset":"initial"),v.value={watchId:ae.watchId,nodeId:D.nodeId,workspaceId:D.workspaceId,sessionId:z,connectionId:D.workbenchConnectionId};const ve=typeof se?.sequence=="number"?se.sequence:K.snapshotSequence;for(const me of ae.events){const fe=me.category==="conversation"?K.snapshotSequence??ve:ve;fe!==void 0&&me.sequence<=fe||e.applyEvent?.(me)}return ae.resolve(),!0}return Promise.resolve(e.applySnapshot(z,K,D.historyReset===!0?"reset":"refresh")).then(ae=>{if(ae&&e.followConversation.value)return e.scrollAfterLayout()}),!0}function H(b){if(b.type!=="watch.failed"||b.watchType!=="session"||b.watchId!==o||b.workbenchConnectionId!==n()||b.sessionId!==a||b.nodeId!==e.workspaceTarget.value?.nodeId||b.workspaceId!==i||typeof b.nodeGeneration!="string"||g!==void 0&&b.nodeGeneration!==g)return!1;g??=b.nodeGeneration;const D=a;return D===void 0?!0:C?.sessionId===D&&C.watchId===o?(x(new st(Zo(b.code)?b.code:"SESSION_HISTORY_INITIAL_FAILED",typeof b.message=="string"&&b.message.length>0&&b.message.length<=1e3?b.message:"Unable to load the initial session snapshot.")),_.pause(),!0):p>=3?(w(),e.refreshSnapshot(),!0):(p+=1,_.pause(),m=setTimeout(()=>{m=void 0,e.selectedSessionId.value===D&&T(D,!1)},Math.min(e.heartbeatMs,1e3*2**(p-1))),!0)}function Q(){document.visibilityState!=="visible"&&w()}function Y(b,D){b!==void 0&&D!==void 0&&b.id===e.selectedSessionId.value&&vo(b)==="RUNNING"&&D.id===b.id&&R(D)&&y(D.id)}return{hasInitialSessionSnapshot:b=>v.value!==void 0&&v.value.watchId===o&&v.value.nodeId===e.workspaceTarget.value?.nodeId&&v.value.workspaceId===e.workspaceTarget.value?.workspaceId&&v.value.sessionId===b&&e.selectedSessionId.value===b&&v.value.connectionId===n(),canWatchSessionHistory:b=>t()&&R(b),initializeSelectedSessionWatch:M,beginSelectedSessionWatch:y,restartSelectedSessionWatch:T,pauseSelectedSessionWatch:h,stopSelectedSessionWatch:w,reconcileWorkspaceSnapshot:Y,handleEvent(b){return typeof b!="object"||b===null?!1:H(b)||I(b)},handleSessionWatchVisibility:Q}}const Ya=new TextEncoder;function On(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Ja(e){const n=G([]),t=G(null),o=Xa({...e,turns:n,nextCursor:t});return{turns:n,nextCursor:t,projection:o}}function Xa(e){const n=new Map,t=new Map,o=new Map;let a=0,r=0;const i=new Map;let c,g=!1;const v=e.scheduleTextDeltaFlush??(j=>{if(typeof requestAnimationFrame=="function"){const W=requestAnimationFrame(j);return()=>cancelAnimationFrame(W)}return queueMicrotask(j),()=>{}}),m=j=>`${j.sessionId}:${j.id}`,p=(j,W)=>`${m(j)}:${W}`;function C(j,W){if(W.length<j.length){const Z=new Set(W.map(re=>m(re))),pe=new Set(W.map(re=>re.runId));for(const re of j){if(Z.has(m(re)))continue;n.delete(m(re));const N=`${m(re)}:`;for(const P of t.keys())P.startsWith(N)&&t.delete(P);It(re)&&!pe.has(re.runId)&&o.delete(re.runId)}}}function x(j){C(e.turns.value,j),e.turns.value=[...j]}function L(){x(e.limitHistory(e.turns.value))}function A(){return e.turns.value.length<=wn?!1:(x(En(e.turns.value,xn)),e.nextCursor.value=null,!0)}function R(){ae(),t.clear(),n.clear(),o.clear(),r=0,a=0}function O(j){R()}function q(j,W){R(),e.turns.value=[...j],e.nextCursor.value=W}function _(j){const W=new Set(e.turns.value.map(Z=>Z.id));e.turns.value=e.limitHistory([...j.turns.filter(Z=>!W.has(Z.id)),...e.turns.value]),e.nextCursor.value=j.nextCursor}function y(j){e.turns.value=e.limitHistory(Ft(e.turns.value,j.turns)),e.nextCursor.value=j.nextCursor}function w(){e.nextCursor.value=null}function T(j,W){e.turns.value=Ka(e.turns.value,j,W)}function M(j){let W=!1;const Z=e.turns.value.map(pe=>{if(!I(pe,j))return pe;let re=!1;const N=pe.items.map(P=>P.id!==j||P.kind!=="user_message"||!On(P.payload)||P.payload.clientMessageId!==j?P:(re=!0,W=!0,{...P,payload:{...P.payload,delivery:"ACCEPTED"}}));return re?{...pe,items:N}:pe});return W&&(e.turns.value=Z),W}function h(j){const W=e.turns.value.filter(Z=>!I(Z,j));return W.length===e.turns.value.length?!1:(e.turns.value=W,!0)}function I(j,W){return j.id===W&&j.runId===null&&j.items.some(Z=>Z.id===W&&Z.kind==="user_message"&&On(Z.payload)&&Z.payload.clientMessageId===W)}function H(j,W){U();const Z=`${j}:`;for(const pe of n.keys())pe.startsWith(Z)&&n.delete(pe);for(const pe of t.keys())pe.startsWith(Z)&&t.delete(pe);for(const pe of W)o.delete(pe)}function Q(j,W){if(W===void 0)return;a=Math.max(a,W);const Z=m(j);n.set(Z,Math.max(n.get(Z)??0,W))}function Y(j,W){return ho(e.turns.value,j,W)}function b(j,W){return W!==void 0&&W<=(o.get(j)??-1)}function D(j,W){const Z=typeof W.segmentId=="string"?W.segmentId:void 0,pe=typeof W.turnId=="string"?W.turnId:void 0;if(Z===void 0){if(typeof W.itemId=="string"){const ye=e.turns.value.findIndex(Ae=>Ae.runId===j&&(pe===void 0||(Ae.turnId??Ae.id)===pe)&&Ae.items.some(Le=>Le.id===W.itemId));if(ye>=0)return ye}return Y(j,pe)}const re=e.turns.value.findIndex(ye=>ye.id===Z&&(ye.runId===j||ye.runId===null));if(re>=0)return e.turns.value[re].runId===null&&(e.turns.value=e.turns.value.map((ye,Ae)=>Ae===re?{...ye,runId:j}:ye)),re;if(pe===void 0||typeof W.segmentIndex!="number"||!Number.isInteger(W.segmentIndex)||W.segmentIndex<0)return-1;U();const N=Y(j,pe),P=N>=0?N:e.turns.value.findLastIndex(ye=>ye.turnId===pe&&ye.runId===null),J=e.turns.value[P];if(J===void 0)return-1;const de=W.segmentIndex;if(de<=(J.segmentIndex??-1))return-1;const Se={...J,id:Z,turnId:pe,runId:j,segmentIndex:de,items:[],startedAt:null,completedAt:null};return e.turns.value=Ft(e.turns.value,[{...J,status:"SUCCEEDED"},Se]),A()&&e.onRecentWindowOverflow(),e.turns.value.findIndex(ye=>ye.id===Z&&ye.runId===j)}function z(j,W,Z){if(b(j,Z))return;const pe=D(j,W),re=e.turns.value[pe];if(re===void 0||Za(re.status))return;const N=typeof W.itemId=="string"?W.itemId:void 0,P=N===void 0?void 0:re.items.find(J=>J.id===N&&J.kind==="assistant_message");if(!(P!==void 0&&Rt(P.status))&&!(N!==void 0&&Z!==void 0&&Z<=(t.get(p(re,N))??-1)))return{turnIndex:pe,turn:re}}function F(j,W,Z,pe=Date.now()){U();const re=he(W);if(re===void 0)return!1;const{itemId:N,kind:P,status:J}=re;if(typeof N!="string"||typeof P!="string"||typeof J!="string"||b(j,Z))return!1;const de=D(j,re);if(de<0)return!1;const Se=e.turns.value[de],ye=Se.items.findIndex(Ce=>Ce.id===N),Ae=ye<0?void 0:Se.items[ye],Le=p(Se,N);if(Z!==void 0&&Z<=(t.get(Le)??Number.NEGATIVE_INFINITY)||Ae!==void 0&&Rt(Ae.status)&&!Rt(J))return!1;const Te=At(pe)?pe:Date.now(),je=Se.items.at(-1),ue=Se.items.map(Ce=>Ce.id===je?.id&&Ce.kind==="assistant_message"&&Ce.status==="IN_PROGRESS"?{...Ce,status:"COMPLETED",completedAt:Te}:Ce),k=At(re.startedAt)?re.startedAt:Ae?.startedAt??Te,$=re.completedAt===null?null:At(re.completedAt)?re.completedAt:Rt(J)?Ae?.completedAt??Te:Ae?.completedAt??null,oe={id:N,kind:P,status:J,...re.processGroup===void 0?{}:{processGroup:ea.parse(re.processGroup)},...typeof re.parentItemId=="string"?{parentItemId:re.parentItemId}:{},startedAt:k,completedAt:$,payload:In(re.merge===!0&&Ae!==void 0?ha(Ae.payload,re.payload,re.append):re.payload)};return ye<0?ue.push(oe):ue.splice(ye,1,oe),e.turns.value=e.turns.value.map((Ce,Oe)=>Oe===de?{...Ce,items:ue,startedAt:Ce.startedAt??oe.startedAt}:Ce),Z!==void 0&&t.set(Le,Z),Q(Se,Z),L(),!0}function se(j,W,Z,pe=Date.now()){const re=he(W),N=re?.text;if(typeof N!="string"||N.length===0||re===void 0)return!1;const P=z(j,re,Z);if(P===void 0)return!1;const{turnIndex:J,turn:de}=P,Se=typeof re?.itemId=="string"?re.itemId:void 0,ye=de.items.at(-1),Ae=Se===void 0&&ye?.kind==="assistant_message"&&ye.status==="IN_PROGRESS",Le=Se===void 0?Ae?de.items.length-1:-1:de.items.findIndex(Oe=>Oe.id===Se&&Oe.kind==="assistant_message"),Te=Le>=0?de.items[Le].id:Se??`${j}:assistant:${Z??"live"}`,je=Le<0?void 0:de.items[Le],ue=p(de,Te);if(Z!==void 0&&Z<=(t.get(ue)??Number.NEGATIVE_INFINITY))return!1;const k=he(je?.payload),$=`${typeof k?.text=="string"?k.text:""}${N}`,oe={id:Te,kind:"assistant_message",status:"IN_PROGRESS",startedAt:je?.startedAt??(At(pe)?pe:Date.now()),completedAt:null,payload:{...k??{},...In({text:$}),format:"markdown",model:null}},Ce=[...de.items];return Le<0?Ce.push(oe):Ce.splice(Le,1,oe),e.turns.value=e.turns.value.map((Oe,rt)=>rt===J?{...Oe,items:Ce,startedAt:Oe.startedAt??oe.startedAt}:Oe),Z!==void 0&&t.set(ue,Z),r+=Ya.encode(N).byteLength,r>=64*1024?(Q(de,Z),L(),r=0,!0):(Q(de,Z),!0)}function U(){c?.(),c=void 0,g=!1,K()}function K(){if(i.size===0)return;const j=[...i.values()];i.clear();for(const W of j)se(W.runId,W,W.sequence,W.createdAt)}function ae(){c?.(),c=void 0,g=!1,i.clear()}function ve(j,W,Z,pe=Date.now()){const re=he(W),N=re?.text;if(typeof N!="string"||N.length===0)return!1;const P=re!==void 0&&typeof re.itemId=="string"?re.itemId:void 0;if(re===void 0)return!1;const J=z(j,re,Z);if(J===void 0)return!1;const de=J.turn,Se=`${j}\0${de.id}\0${P??""}`,ye=i.get(Se);if(ye!==void 0&&Z!==void 0&&Z<=(ye.sequence??-1))return!1;if(ye===void 0?i.set(Se,{runId:j,...P===void 0?{}:{itemId:P},turnId:de.turnId??de.id,...de.segmentIndex===void 0?{}:{segmentId:de.id,segmentIndex:de.segmentIndex},text:N,chunks:[{text:N,sequence:Z}],...Z===void 0?{}:{sequence:Z},createdAt:pe}):(ye.text+=N,ye.chunks.push({text:N,sequence:Z}),Z!==void 0&&(ye.sequence=Z)),!g){g=!0;const Ae=v(()=>{g=!1,c=void 0,K()});g?c=Ae:Ae()}return!0}function me(j,W){Q(j,W),!(!It(j)||W===void 0)&&o.set(j.runId,Math.max(o.get(j.runId)??0,W))}function fe(j){return j.snapshotSequence!==void 0&&j.snapshotSequence<a}function ge(j){if(U(),fe(j))return!1;const W=e.turns.value,pe=j.turns.map(Cn),re=new Map(W.map(Te=>[Te.id,Te])),N=pe.map(Te=>{const je=re.get(Te.id);if(je===void 0)return Q(Te,j.snapshotSequence),Te;const ue=n.get(m(Te));if(ue!==void 0&&j.snapshotSequence!==void 0&&ue>j.snapshotSequence)return je;Q(Te,j.snapshotSequence);const k=je.items.filter(ga);return k.length===0?Te:{...Te,items:va(Te.items,je.items,k)}}),P=pa(Ft(W,N)),J=W.at(-1)?.id,de=P.findIndex(Te=>Te.id===J),ye=P.slice(de+1).some(Te=>!re.has(Te.id))&&P.length>wn,Ae=e.limitHistory(ye?En(P,xn):P),Le=JSON.stringify(W)!==JSON.stringify(Ae);return C(P,Ae),ye&&(e.nextCursor.value=null),!ye&&e.nextCursor.value===null&&j.nextCursor!==null&&(e.nextCursor.value=j.nextCursor),Le&&(e.turns.value=Ae),ye&&e.onRecentWindowOverflow(),Le}function V(j){return U(),fe(j)?!1:(B(j),!0)}function B(j){const W=j.turns.map(Cn),Z=[...i.values()];R(),e.turns.value=e.limitHistory(W),e.nextCursor.value=j.nextCursor,a=j.snapshotSequence??0;for(const pe of e.turns.value)me(pe,j.snapshotSequence);for(const pe of Z){const re=j.snapshotSequence;if(re===void 0)continue;const N=pe.chunks.filter(P=>P.sequence!==void 0&&P.sequence>re);N.length!==0&&se(pe.runId,{...pe,text:N.map(P=>P.text).join("")},N.at(-1).sequence,pe.createdAt)}}function le(j){return U(),fe(j)?!1:(B(j),!0)}return{resetHistory:R,restore:O,restoreWindow:q,mergeOlderPage:_,recoverWindow:y,clearCursor:w,syncRunStatus:T,updateOptimisticUserMessage:M,removeOptimisticUserMessage:h,clearSession:H,markLive:Q,mergeItem:F,mergeTextDelta:ve,flushPendingTextDeltas:U,mergeLatest:ge,replaceRecent:V,replaceAuthoritative:le}}function At(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function Rt(e){return["COMPLETED","FAILED","DECLINED","CANCELLED","INTERRUPTED"].includes(e)}function Za(e){return["SUCCEEDED","FAILED","CANCELLED","INTERRUPTED","LOST"].includes(e)}function _o(e){const n=Xt(e);return n?.kind==="context_compaction"&&n.status==="COMPLETED"}function ei(e){const n=Xt(e),t=Xt(n?.payload);return _o(e)&&t?.retainedContext===!0}function dp(e,n){return _o(e)?ei(e)?null:n==null?n:{...n,usedTokens:0,percentage:0,...n.gcCount===void 0?{}:{gcCount:0},...n.gcCount===void 0&&n.gcReclaimedTokens===void 0?{}:{gcReclaimedTokens:0}}:n}function up(e){const{turns:n,nextCursor:t,projection:o}=Ja({onRecentWindowOverflow:e,limitHistory:_a});let a=0,r;const i=G(0);function c(){r!==void 0&&(clearTimeout(r.timer),r.resolve(),r=void 0)}function g(){c(),i.value+=1;const m=i.value;return new Promise(p=>{const C=setTimeout(()=>{r?.version===m&&(r=void 0,p())},1e4);r={version:m,resolve:p,timer:C}})}function v(m){r?.version===m&&c()}return{turns:n,nextCursor:t,projection:o,loadingInitial:G(!1),initialLoadFailed:G(!1),initialFailureCause:Et(),loadingOlder:G(!1),channelInput:G(""),channelToken:G(),contextUsage:G(),initialRenderVersion:i,beginInitialRender:g,confirmInitialRender:v,cancelInitialRender:c,nextDetailRequest:()=>++a,currentDetailRequest:()=>a}}function Xt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)?e:void 0}function ti(e){return typeof e=="object"&&e!==null&&typeof e.id=="string"&&typeof e.sessionId=="string"&&typeof e.status=="string"}function ni(e){return typeof e=="object"&&e!==null&&typeof e.id=="string"&&typeof e.workspaceId=="string"&&(e.runner==="codex"||e.runner==="claude-code"||e.runner==="opencode"||e.runner==="mar-agent")&&!e.id.startsWith("draft:")}function fp(e){function n(a,r){const i=e.setNodeConnection?.(a,r);r&&i===!1&&e.onNodeConnected(a)}function t(a,r="event"){const i=he(a.payload);if(a.category==="node"&&typeof i?.connected=="boolean"){n(a.nodeId,i.connected);return}if(a.category==="workspace"&&i!==void 0){typeof i.workspaceId=="string"&&typeof i.topic=="string"&&e.invalidateWorkspace(a.nodeId,i.workspaceId,i.topic);return}if(a.category==="queue"&&i!==void 0){const{sessionId:p,queue:C}=i;if(typeof p=="string"&&a.nodeId===e.workspaceTarget.value?.nodeId&&typeof C=="object"&&C!==null){const x=e.selectedSession?.value,L=x?.id===p&&x.workspaceId===e.workspaceTarget.value?.workspaceId?x:e.sessions.value.find(A=>A.id===p&&A.workspaceId===e.workspaceTarget.value?.workspaceId);L!==void 0&&go(L)&&e.cacheQueue(a.nodeId,L.workspaceId,p,C,r),p===e.selectedSessionId.value&&e.mergeQueue(C,r)}return}if(a.category==="session"&&i!==void 0&&a.nodeId===e.workspaceTarget.value?.nodeId){const p=i.session;if(ni(p)){const C=p.id===e.selectedSessionId.value;C&&p.activity!==void 0&&p.activity!=="RUNNING"&&e.settleSessionRuns(p.id),e.mergeSessions([p]),C&&p.activity==="RUNNING"&&e.observeSessionRunning(p.id)}typeof i.sessionId=="string"&&"context"in i&&e.updateContext(i.sessionId,i.context??null);return}if(a.category==="run"&&i!==void 0&&ti(i.run)){const p=i.run;if(e.syncTurnStatus(p.id,p.status,p.sessionId),a.nodeId===e.workspaceTarget.value?.nodeId&&e.cacheRun(p),p.sessionId===e.selectedSessionId.value&&a.nodeId===e.workspaceTarget.value?.nodeId){const C=e.acceptRun(p);["STARTING","RUNNING","CANCELLING"].includes(C.status)&&e.openRun(p.id)}return}if(a.category!=="conversation"||i===void 0)return;if(i.performance!==void 0){a.nodeId===e.workspaceTarget.value?.nodeId&&typeof i.sessionId=="string"&&i.sessionId===e.selectedSessionId.value&&e.receivePerformance?.(i.sessionId,i.performance);return}const c=he(i.item);if(c!==void 0&&typeof i.runId=="string"&&a.nodeId===e.workspaceTarget.value?.nodeId&&i.sessionId===e.selectedSessionId.value){e.mergeItem(i.runId,c,a.sequence,typeof c.startedAt=="number"?c.startedAt:void 0);return}const g=he(i.delta);if(g!==void 0&&typeof g.runId=="string"&&typeof g.itemId=="string"&&typeof g.text=="string"&&a.nodeId===e.workspaceTarget.value?.nodeId&&i.sessionId===e.selectedSessionId.value){e.mergeTextDelta(g.runId,g,a.sequence,typeof g.createdAt=="number"?g.createdAt:void 0);return}const v=po(i.snapshot,a.sequence);if(v!==void 0&&a.nodeId===e.workspaceTarget.value?.nodeId){const p=v.turns[0]?.sessionId??(typeof i.sessionId=="string"?i.sessionId:void 0);p!==void 0&&e.applyConversationSnapshot(p,v,"refresh");return}const m=i.turn;if(ba(m)&&a.nodeId===e.workspaceTarget.value?.nodeId){if(!Array.isArray(i.segments)||!i.segments.every(sn))return;const p=ft({segments:i.segments,nextCursor:e.conversationNextCursor.value,snapshotSequence:a.sequence}).turns;if(p.length===0)return;for(const C of p)e.markLiveTurn(C,a.sequence),e.cacheTurn(C);m.sessionId===e.selectedSessionId.value&&e.mergeTurns({turns:p,nextCursor:e.conversationNextCursor.value,snapshotSequence:a.sequence});return}}function o(a){(a.category==="node"||a.category==="workspace")&&t(a)}return{apply:t,applyBroadcast:o,updateNodeConnection:n}}function mp(e){let n=!1,t=!1,o=0;const a=G("");function r(){o+=1,n=!1,t=!1,e.loadingOlder.value=!1,a.value=""}Re([e.workspaceTarget,e.selectedSessionId],r,{flush:"sync"});async function i(){await c(e.pageSize)}async function c(p){const C=e.workspaceTarget.value?.nodeId,x=e.selectedSessionId.value,L=e.nextCursor.value;if(C===void 0||x===void 0||L===null||e.loadingOlder.value||n)return;const A=o;e.loadingOlder.value=!0,a.value="";let R=L;try{let O;try{O=await g(C,x,p,R)}catch(_){if(at(_)!=="EVENT_CURSOR_INVALID")throw _;if(e.workspaceTarget.value?.nodeId!==C||e.selectedSessionId.value!==x||o!==A||e.nextCursor.value!==R)return;const y=await v(C,x,R,A);if(y===void 0||e.workspaceTarget.value?.nodeId!==C||e.selectedSessionId.value!==x||o!==A||e.nextCursor.value!==(y??R))return;if(y===null){const w=e.capturePrependAnchor();e.clearCursor(),await De(),o===A&&e.workspaceTarget.value?.nodeId===C&&e.selectedSessionId.value===x&&e.nextCursor.value===null&&w();return}R=y,O=await g(C,x,p,R)}if(e.workspaceTarget.value?.nodeId!==C||e.selectedSessionId.value!==x||o!==A||e.nextCursor.value!==R)return;const q=e.capturePrependAnchor();e.mergeOlderPage(O),await De(),o===A&&e.workspaceTarget.value?.nodeId===C&&e.selectedSessionId.value===x&&q()}catch(O){e.workspaceTarget.value?.nodeId===C&&e.selectedSessionId.value===x&&o===A&&e.nextCursor.value===R&&(a.value=l("generated.workbenchConversationPagingService.unableToLoadEarlierConversationHistory",{value0:e.errorMessage(O)}))}finally{o===A&&(e.loadingOlder.value=!1)}}async function g(p,C,x,L){const A=await e.request(`/api/agent-sessions/${e.sessionPathId(C)}/turns?nodeId=${encodeURIComponent(p)}&limit=${x}&cursor=${encodeURIComponent(L)}&unit=SEGMENT`);return ft(A)}async function v(p,C,x,L){const A=await e.request(`/api/agent-sessions/${e.sessionPathId(C)}/turns?nodeId=${encodeURIComponent(p)}&limit=${e.recentSegmentWindowSize}&unit=SEGMENT`),R=ft(A);if(e.workspaceTarget.value?.nodeId!==p||e.selectedSessionId.value!==C||o!==L||e.nextCursor.value!==x)return;const O=R.nextCursor===null?{...R,nextCursor:x}:R;if(e.recoverWindow(O),await De(),!(e.workspaceTarget.value?.nodeId!==p||e.selectedSessionId.value!==C||o!==L||e.nextCursor.value!==O.nextCursor))return R.nextCursor}async function m(){const p=e.workspaceTarget.value?.nodeId,C=e.selectedSessionId.value;if(p===void 0||C===void 0)return;if(n){t=!0;return}n=!0;let x=o;try{do{t=!1,x=++o,e.loadingOlder.value=!1,a.value="";const L=await e.request(`/api/agent-sessions/${e.sessionPathId(C)}/turns?nodeId=${encodeURIComponent(p)}&limit=${e.recentSegmentWindowSize}&unit=SEGMENT`),A=ft(L);if(o!==x||e.workspaceTarget.value?.nodeId!==p||e.selectedSessionId.value!==C)return;t||e.replaceRecent(A)}while(t)}catch{}finally{o===x&&(n=!1)}}return{resetWindow:r,olderHistoryError:a,loadOlderConversationTurns:i,refreshRecentConversationTurns:m}}const oi=28,Nn=48;function gp(){const e=G(),n=G(!0),t=G(!1);let o,a,r,i=0,c;function g(_){e.value=_,o=_?.clientWidth,a=_?.clientHeight,r=_?.scrollHeight,i=_?.scrollTop??0,c=void 0}function v(_){const y=_.clientWidth!==o||_.clientHeight!==a||_.scrollHeight!==r;return o=_.clientWidth,a=_.clientHeight,r=_.scrollHeight,y}function m(_){const y=_.getBoundingClientRect(),w=_.ownerDocument.elementFromPoint(y.left+y.width/2,y.top+y.height/2);c=w!==null&&w!==_&&_.contains(w)?{element:w,top:w.getBoundingClientRect().top}:void 0}function p(_){const y=e.value;if(y===void 0||t.value)return;const w=v(y),T=c!==void 0&&y.contains(c.element)&&Math.abs(c.element.getBoundingClientRect().top-c.top)<1,M=!T&&y.scrollTop<i-1,h=!T&&y.scrollTop>i,I=y.scrollHeight-y.scrollTop-y.clientHeight;if(i=y.scrollTop,w&&(!M&&!h||n.value&&I<=1)){n.value?L():c===void 0&&m(y);return}n.value=!M&&(n.value||h)&&I<oi,n.value?c=void 0:(M||h||c===void 0)&&m(y),M&&y.scrollTop<Nn&&y.scrollHeight>y.clientHeight+Nn&&_()}function C(){const _=e.value;_===void 0||!v(_)||!n.value||q()}function x(){const _=e.value;_!==void 0&&(n.value=!1,t.value=!1,v(_),i=_.scrollTop,m(_))}function L(){const _=e.value;_!==void 0&&(_.scrollTop=_.scrollHeight,i=_.scrollTop,n.value=!0,c=void 0)}function A(_){const y=e.value;if(y===void 0)return()=>{};const w=y.scrollHeight,T=y.scrollTop,M=_&&n.value;return()=>{if(!(e.value!==y||y.scrollTop!==T)){if(M){n.value&&(L(),v(y));return}y.scrollTop=T+(y.scrollHeight-w),i=y.scrollTop,v(y),n.value||m(y)}}}function R(){return A(!0)}function O(){return A(!1)}async function q(_=()=>!0){const y=e.value;y===void 0||!_()||(L(),await De(),!(e.value!==y||!n.value||!_())&&(L(),await new Promise(w=>requestAnimationFrame(()=>w())),!(e.value!==y||!n.value||!_())&&(L(),await new Promise(w=>setTimeout(w,50)),!(e.value!==y||!n.value||!_())&&L())))}return{element:e,following:n,positioningInitialConversation:t,setElement:g,handleScroll:p,handleResize:C,stopFollowing:x,scrollToLatest:L,captureRenderAnchor:R,capturePrependAnchor:O,scrollToLatestAfterLayout:q}}const ai=5e3;function Zt(e){return`session:${e===void 0||e.startsWith("draft:")?"draft":e}`}function vp(){const e=ii(),n={};return{...e.bind(()=>n),transferSession:(t,o)=>e.transfer(n,n,t,o)}}function ii(){const e=new WeakMap,n=new Map,t=new WeakMap;function o(v){const m=JSON.stringify([v.nodeId,v.workspaceId,v.kind,v.kind==="session"?v.sessionId:null]);let p=n.get(m);return p===void 0&&(p={},n.set(m,p),t.set(p,m)),p}const a=G(0),r={};function i(v){let m=e.get(v);return m===void 0&&(m={slots:new Set([v]),tokens:Et([])},e.set(v,m)),m}function c(v){const m=X(()=>(a.value,i(v()??r)));function p(C,x,L=ai){const A=m.value;if(A.tokens.value.length!==0)return;const R={group:A,context:C,active:!0};function O(){return R.active?(R.active=!1,clearTimeout(R.timeout),R.group.tokens.value=R.group.tokens.value.filter(q=>q!==R),!0):!1}return A.tokens.value=[...A.tokens.value,R],L!==null&&(R.timeout=setTimeout(()=>{O()&&x?.()},L)),O}return{pending:X(()=>m.value.tokens.value.length!==0),context:X(()=>m.value.tokens.value.find(C=>C.context!==void 0)?.context),begin:p}}function g(v,m,p,C,x=!1){const L=e.get(v);if(L===void 0)return;const A=e.get(m)??L;for(const R of L.tokens.value)R.context===Zt(p)&&(R.context=Zt(C)),R.group=A;if(A!==L){A.tokens.value=[...A.tokens.value,...L.tokens.value];for(const R of L.slots)e.set(R,A),A.slots.add(R)}else A.tokens.value=[...A.tokens.value];if(e.set(m,A),A.slots.add(m),x&&v!==m){e.delete(v),A.slots.delete(v);const R=t.get(v);R!==void 0&&n.get(R)===v&&n.delete(R)}a.value+=1}return{bind:c,transfer:g,forTarget:o}}const pp="";function hp(e,n=[]){const t=e??G(n);function o(g){if(t.value.some(m=>m.name===g.name))return!1;const v={name:g.name,source:g.source,skillFilePath:g.skillFilePath,available:!0};return t.value=[...t.value,v],!0}function a(g){t.value=t.value.filter(v=>v.name!==g)}function r(){t.value=[]}function i(g){t.value=g.filter(bo)}function c(g){const v=new Map(g.map(m=>[m.name,m]));t.value=t.value.map(m=>{const p=v.get(m.name);return p===void 0?{...m,available:!1}:{name:p.name,source:p.source,skillFilePath:p.skillFilePath,available:!0}})}return{tokens:t,select:o,remove:a,clear:r,restore:i,reconcile:c}}function ri(e,n,t=[]){const o=[n,e.length>0?Nt("mar_skills",{action:"use",instruction:ta,skills:e.map(a=>({name:a.name,source:a.source,path:a.skillFilePath}))}):"",t.length>0?Nt("mar_references",{references:[...t]}):""].filter(a=>a.length>0).join(`
|
|
1
|
+
import{c as ct}from"./uuid-BmNSYLtZ.js";import{ax as Ho,am as zo,eM as St,eN as Go,m as we,ap as Vo,o as s,J as ee,K as _e,p as ze,N as E,n as u,a6 as Ie,L as d,X as f,Y as ie,a8 as kt,d5 as vn,k as X,cO as Wo,B as Ko,f as G,aF as Qo,au as Yo,eO as Jo,eP as Xo,eQ as Nt,eR as Zn,t as l,A as st,eS as Zo,af as Et,e as at,eT as ea,w as Re,ab as De,eU as ta,M as Fe,co as eo,eV as to,eW as na,eX as Me,eY as oa,eZ as aa,e_ as pn,r as no,cp as ia,cz as oo,aK as an,T as dt,ac as We,a0 as Ve,W as S,a5 as hn,q as te,U as ke,H as ne,at as ao,_ as xe,d0 as ra,Z as Ue,e$ as _n,Q as bn,f0 as sa,e0 as la,$ as Dt,dP as ca,as as mt,a3 as Ee,eo as da,f1 as ua,l as yn,c9 as fa,a4 as kn,bx as Ke,aY as ma}from"./index-B0EMFtj6.js";import{l as Cn,i as ga,r as va,a as pa,C as wn,b as En,c as In,m as ha,d as xn,e as It,f as he,g as _a,h as ba,j as ya,k as Sn,n as Bt,o as ka,p as Ca}from"./conversation-history-B1iric-r.js";import{E as wa}from"./message-box-service-VVXUq9x5.js";import{A as Tn,r as Ea,g as io,E as ro,e as so,M as Ia,H as An,t as xa,B as Rn,p as Sa,h as Tt,n as wt,o as rn,q as Pn,F as Ta}from"./FilePreviewLoading-DQICPNpH.js";import{e as lo}from"./error-presentation-CHEcvm0D.js";import{a as Je,E as co}from"./el-input-B1Cujpyw.js";import{M as be}from"./MarIcon-D-R_Iqgk.js";import{B as lt}from"./BusyIndicator-1kY9qfWN.js";import{o as uo,a as Aa,E as Ra}from"./el-checkbox-DImL2zoF.js";import{a as Pa,E as $a}from"./el-radio-D1bF4tIj.js";/* empty css */import{E as Da}from"./el-scrollbar-TQDjLC61.js";import{f as ot,p as jt}from"./time-presentation-Bb0DA3CW.js";import{C as Ma,E as La,b as Oa,a as Na}from"./el-select-CZpYtkGN.js";/* empty css */import{E as fo,u as Qt,m as Yt}from"./mobile-dialog-return-service-Dpx2MnbK.js";import{l as $n,r as Dn}from"./runner-presentation-CVp1ISRD.js";const ja=zo({...uo(St,["ariaLabel","gpuAcceleration","rawContent"]),placement:Tn.placement,tabindex:Tn.tabindex,effect:{...St.effect,default:"light"},title:String,width:{type:[String,Number],default:150},offset:{...St.offset,default:void 0},persistent:{...St.persistent,default:!0}}),qa={"update:visible":e=>Ho(e),"before-enter":()=>!0,"before-leave":()=>!0,"after-enter":()=>!0,"after-leave":()=>!0};({...uo(Go,["gpuAcceleration"])});var Ua=we({name:"ElPopover",__name:"popover",props:ja,emits:qa,setup(e,{expose:n,emit:t}){const o=e,a=t,r=X(()=>{const O=vn.props;return Wo(o,Ko(O)?O:Object.keys(O))}),i=Vo("popover"),c=G(),g=X(()=>d(c)?.popperRef),v=X(()=>[{width:Qo(o.width)},o.popperStyle]),m=X(()=>[i.b(),o.popperClass,{[i.m("plain")]:!!o.content}]),p=X(()=>o.transition===`${i.namespace.value}-fade-in-linear`),C=()=>{c.value?.hide()},x=()=>{a("before-enter")},L=()=>{a("before-leave")},A=()=>{a("after-enter")},R=()=>{a("update:visible",!1),a("after-leave")};return n({popperRef:g,hide:C}),(O,q)=>(s(),ee(d(vn),kt({ref_key:"tooltipRef",ref:c},r.value,{"aria-label":e.title,"popper-class":m.value,"popper-style":v.value,"gpu-acceleration":p.value,onBeforeShow:x,onBeforeHide:L,onShow:A,onHide:R}),{content:_e(()=>[e.title?(s(),u("div",{key:0,class:Ie(d(i).e("title")),role:"title"},f(e.title),3)):E("v-if",!0),ze(O.$slots,"default",{hide:C},()=>[ie(f(e.content),1)])]),default:_e(()=>[O.$slots.reference?ze(O.$slots,"reference",{key:0}):E("v-if",!0)]),_:3},16,["aria-label","popper-class","popper-style","gpu-acceleration"]))}}),Ba=Ua;const Mn=(e,n)=>{const t=(n.arg||n.value)?.popperRef;t&&(t.triggerRef=e)};var Fa={mounted(e,n){Mn(e,n)},updated(e,n){Mn(e,n)}};const Ha="popover",za=Jo(Fa,Ha),mo=Yo(Ba,{directive:za});function ip(e,n,t,o=ct()){const a=Xo.parse({...n,id:o}),r=[...e,a],i=Nt("mar_references",{references:r});if(t.length+i.length+1>Zn)throw new Error("COMPOSER_TAG_INVALID");return r}function Jt(e){const n=e.customTitle?.trim();if(n)return n;const t=e.runnerTitle?.trim();return t===void 0||t===""||t==="Untitled session"||t.toLocaleLowerCase()==="new session"?l("generated.sessionPresentation.newSession"):t}function go(e){return typeof e?.externalSessionId=="string"&&e.externalSessionId.length>0}function rp(e){return!go(e)}function sp(e){return e.trim().replace(/\s+/g," ").slice(0,160)}function vo(e){return e.activity!==void 0?e.activity:"IDLE"}function lp(e){return{RUNNING:l("generated.sessionPresentation.running"),IDLE:l("generated.sessionPresentation.ready")}[vo(e)]}function Ga(e){return{STARTING:l("generated.sessionPresentation.starting"),RUNNING:l("generated.sessionPresentation.running2"),SUCCEEDED:l("generated.sessionPresentation.completed"),FAILED:l("generated.sessionPresentation.failed"),CANCELLED:l("generated.sessionPresentation.cancelled"),INTERRUPTED:l("generated.sessionPresentation.interrupted"),LOST:l("generated.sessionPresentation.connectionLost")}[e]??e}const Va=new Set(["PREPARING","RUNNING","WAITING_INPUT","WAITING_APPROVAL","SUCCEEDED","FAILED","CANCELLED","INTERRUPTED","LOST"]);function Ln(e){return e==null||typeof e=="number"&&Number.isInteger(e)&&e>=0}function Wa(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;const n=e;return typeof n.id=="string"&&n.id.length>0&&typeof n.kind=="string"&&n.kind.length>0&&typeof n.status=="string"&&n.status.length>0}function sn(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;const n=e;return typeof n.id=="string"&&n.id.length>0&&typeof n.turnId=="string"&&n.turnId.length>0&&typeof n.sessionId=="string"&&n.sessionId.length>0&&(n.runId===null||typeof n.runId=="string"&&n.runId.length>0)&&typeof n.index=="number"&&Number.isInteger(n.index)&&n.index>=0&&typeof n.status=="string"&&Va.has(n.status)&&Array.isArray(n.items)&&n.items.every(Wa)&&Ln(n.startedAt)&&Ln(n.completedAt)}function po(e,n){if(typeof e!="object"||e===null||Array.isArray(e))return;const t=e;if(!(t.unit!=="SEGMENT"||!Array.isArray(t.segments)||!t.segments.every(sn)||new Set(t.segments.map(a=>a.sessionId)).size>1))return ft({unit:"SEGMENT",segments:t.segments,nextCursor:typeof t.nextCursor=="string"?t.nextCursor:null,...typeof t.snapshotSequence=="number"?{snapshotSequence:t.snapshotSequence}:n===void 0?{}:{snapshotSequence:n},...t.source==="official"||t.source==="native"||t.source==="runtime"?{source:t.source}:{},...typeof t.readAt=="number"?{readAt:t.readAt}:{},...typeof t.latestVisibleAt=="number"?{latestVisibleAt:t.latestVisibleAt}:{},...t.deferredOlderHistory===!0?{deferredOlderHistory:!0}:{}})}function ft(e){if(!Array.isArray(e.segments))throw new Error("The conversation history response contains no segments.");const n=e;if(!n.segments.every(sn))throw new Error("The conversation Segment response contains an invalid Segment.");return{...n,turns:n.segments.map(t=>({id:t.id,turnId:t.turnId,segmentIndex:t.index,sessionId:t.sessionId,runId:t.runId,status:t.status,...t.rewind===void 0?{}:{rewind:t.rewind},items:t.items,...t.startedAt===void 0?{}:{startedAt:t.startedAt},...t.completedAt===void 0?{}:{completedAt:t.completedAt}}))}}function Ft(e,n){const t=[...e];for(const[o,a]of n.entries()){const r=t.findIndex(c=>c.id===a.id);if(r>=0){const c=t[r],g=a.rewind??(c.sessionId===a.sessionId?c.rewind:void 0);t.splice(r,1,g===void 0?a:{...a,rewind:g});continue}if(a.turnId!==void 0&&a.segmentIndex!==void 0){const c=t.findIndex(v=>v.turnId===a.turnId&&v.segmentIndex!==void 0&&v.segmentIndex>a.segmentIndex),g=t.findLastIndex(v=>v.turnId===a.turnId);if(c>=0||g>=0){t.splice(c>=0?c:g+1,0,a);continue}}const i=n.slice(o+1).find(c=>t.some(g=>g.id===c.id));if(i!==void 0){t.splice(t.findIndex(c=>c.id===i.id),0,a);continue}t.push(a)}return t}function ho(e,n,t){const o=e.findLastIndex(i=>i.runId===n&&(t===void 0||(i.turnId??i.id)===t));if(o<0)return-1;const a=e[o].turnId??e[o].id;let r=o;for(const[i,c]of e.entries())c.runId===n&&(c.turnId??c.id)===a&&(c.segmentIndex??-1)>(e[r].segmentIndex??-1)&&(r=i);return r}function Ka(e,n,t){const o=ho(e,n);return e.map((a,r)=>r===o&&a.status!==t?{...a,status:t}:a)}function Qa(e){let n,t,o,a,r,i=0,c=!1,g=!1,v=0;function m(){n!==void 0&&clearTimeout(n),o?.abort(new st("WATCH_CANCELLED","The watch was stopped or replaced.")),n=void 0,o=void 0,t=void 0,a=void 0,r=void 0,i=0,c=!1,g=!1,v=0}function p(){n!==void 0&&clearTimeout(n),n=void 0,c=!0}async function C(O,q,_){const y=setTimeout(()=>_.abort(new st("WATCH_REQUEST_TIMEOUT","The watch request timed out.")),e.requestTimeoutMs);try{if(await e.renew(O,_.signal,q),o!==_||a!==O)return;r=Date.now(),i=0,g=!1,v=0}catch(w){if(o!==_||a!==O)return;const T=_.signal.aborted&&w instanceof Error&&w.name==="AbortError"?_.signal.reason:w;if(e.recovery!==void 0&&(q==="renew"||g)){e.recovery.onFailure(T),q==="initial"&&(v+=1),!c&&e.recovery.retryable(T)&&v<e.maxFailures?g=!0:(p(),e.onExpired());return}if(q==="initial")throw c=!0,i=0,r=void 0,T;i+=1;const M=r!==void 0&&Date.now()-r>=e.confirmationTimeoutMs;(i>=e.maxFailures||M)&&(e.onExpired(),i=0,r=void 0)}finally{clearTimeout(y)}}function x(O,q){if(c||t!==void 0||a!==O||!e.eligible(O))return t;const _=new AbortController;o=_;const y=C(O,q,_).finally(()=>{t===y&&(t=void 0,o=void 0,L(O))});return t=y,y}function L(O){n!==void 0&&clearTimeout(n),!(c||a!==O)&&(n=setTimeout(()=>{n=void 0,x(O,g?"initial":"renew")?.catch(()=>{})},e.heartbeatMs))}function A(O,q=!1){if(!e.eligible(O)){m();return}if(a===O){if(t!==void 0)return t;if(n!==void 0)return}if(m(),c=!1,a=O,!q)return x(O,"initial");L(O)}function R(O){a===O&&(r=Date.now(),i=0)}return{start:A,pause:p,stop:m,confirm:R,isWatching:O=>a===O}}function cp(e){const n=()=>e.workbenchConnectionId===void 0?"local-test-connection":e.workbenchConnectionId(),t=()=>e.position==="secondary"?e.enabled?.()===!0:e.enabled?.()!==!1;let o,a,r,i,c,g;const v=Et();let m,p=0,C;function x(b=new st("WATCH_CANCELLED","The watch was stopped or replaced.")){const D=C;D!==void 0&&(C=void 0,D.removeAbortListener(),D.reject(b))}function L(b,D,z){return x(),new Promise((F,se)=>{const U=()=>{C?.watchId===D&&x(z?.reason instanceof Error?z.reason:new st("WATCH_CANCELLED","The watch was stopped or replaced."))};z?.addEventListener("abort",U,{once:!0}),C={sessionId:b,watchId:D,resolve:F,reject:se,removeAbortListener:()=>z?.removeEventListener("abort",U),events:[]},z?.aborted===!0&&U()})}function A(b){return t()&&e.selectedSessionId.value===b&&O(b)}function R(b){return O(b.id)}function O(b){return!b.startsWith("draft:")&&(typeof document>"u"||document.visibilityState==="visible")}async function q(b,D,z="renew"){if(!t())return;const F=e.workspaceTarget.value?.nodeId,se=e.workspaceTarget.value?.workspaceId,U=n();if(F===void 0||se===void 0||U===void 0||e.selectedSessionId.value!==b)return;z==="initial"?(v.value=void 0,o=ct().replace(/-/g,""),g=void 0,a=b,r=F,i=se):o??=ct().replace(/-/g,"");const K=o,ae=z==="initial"?L(b,K,D):void 0;ae?.catch(()=>{});let ve=!1,me;try{if(me=await e.request(`/api/agent-sessions/${e.sessionPathId(b)}/watch`,{method:"POST",body:JSON.stringify({nodeId:F,workspaceId:se,workbenchConnectionId:U,watchId:K,mode:z,...e.position===void 0?{}:{position:e.position},unit:"SEGMENT"}),...D===void 0?{}:{signal:D}}),ve=!0,e.workspaceTarget.value?.nodeId!==F||e.workspaceTarget.value?.workspaceId!==se||e.selectedSessionId.value!==b||n()!==U||o!==K){C?.watchId===K&&x(),await ae?.catch(()=>{});return}typeof me?.nodeGeneration=="string"&&a===b&&(g=me.nodeGeneration),await ae}catch(fe){throw C?.watchId===K&&x(),await ae?.catch(()=>{}),ve&&at(fe)==="WATCH_REQUEST_TIMEOUT"?new st("SESSION_WATCH_SNAPSHOT_TIMEOUT","The initial session snapshot did not arrive before the watch deadline."):fe}}const _=Qa({heartbeatMs:e.heartbeatMs,requestTimeoutMs:e.requestTimeoutMs,confirmationTimeoutMs:e.confirmationTimeoutMs,maxFailures:3,eligible:A,renew:(b,D,z)=>q(b,D,z),onExpired:e.refreshSnapshot});function y(b,D={}){if(!t())return;const z=n();if(a===b&&c!==z)return T(b,D.preserveFailures!==!0);a!==b&&(o=ct().replace(/-/g,""),g=void 0,D.preserveFailures!==!0&&(p=0),a=b,r=e.workspaceTarget.value?.nodeId,i=e.workspaceTarget.value?.workspaceId,c=z);const F=_.start(b,D.skipImmediateRenew===!0),se=o,U=F?.then(()=>{if(o!==se||n()!==z)throw new st("WATCH_CANCELLED","The watch was stopped or replaced.")});return U?.catch(()=>{}),U}function w(){v.value=void 0,x();const b=a,D=o,z=r,F=i,se=c;a=void 0,r=void 0,i=void 0,c=void 0,o=void 0,g=void 0,p=0,m!==void 0&&clearTimeout(m),m=void 0,_.stop(),!(b===void 0||D===void 0||z===void 0||F===void 0||se===void 0)&&e.request(`/api/agent-sessions/${e.sessionPathId(b)}/watch`,{method:"DELETE",body:JSON.stringify({nodeId:z,workspaceId:F,workbenchConnectionId:se,watchId:D,...e.position===void 0?{}:{position:e.position}})}).catch(()=>{})}function T(b,D=!0){return v.value=void 0,m!==void 0&&clearTimeout(m),m=void 0,x(),_.stop(),a=void 0,r=void 0,i=void 0,c=void 0,o=void 0,g=void 0,D&&(p=0),y(b,{preserveFailures:!D})}function M(b){return T(b)??Promise.resolve()}function h(){m!==void 0&&clearTimeout(m),m=void 0,_.pause()}function I(b){if(typeof b!="object"||b===null)return!1;const D=b;if(D.type!=="watch.session.snapshot"&&D.type!=="watch.session.event"||D.workbenchConnectionId!==n()||D.nodeId!==e.workspaceTarget.value?.nodeId||D.workspaceId!==i||D.sessionId!==a||o===void 0||D.watchId!==o||typeof D.nodeGeneration!="string"||g!==void 0&&D.nodeGeneration!==g)return!1;g??=D.nodeGeneration,p=0;const z=a;if(z===void 0)return!1;if(D.type==="watch.session.event"){const ae=D.event;if(ae!==void 0&&typeof ae.sequence=="number"&&["node","session","conversation","run","queue","workspace"].includes(String(ae.category))&&"payload"in ae){const ve={nodeId:D.nodeId,sequence:ae.sequence,category:ae.category,payload:ae.payload};C?.sessionId===z&&C.watchId===o?C.events.push(ve):e.applyEvent?.(ve)}return!0}if(D.payload===void 0)return!1;const F=D.payload,se=F.kind==="session-watch-snapshot"&&typeof F.sequence=="number"&&typeof F.session=="object"&&F.session!==null&&Array.isArray(F.runs)?F:void 0;if(se!==void 0){e.applyEvent?.({nodeId:D.nodeId,sequence:se.sequence,category:"session",payload:{session:se.session}});const ae=se.runs;if(e.applyRunsSnapshot!==void 0)e.applyRunsSnapshot(ae);else for(const ve of ae)e.applyEvent?.({nodeId:D.nodeId,sequence:se.sequence,category:"run",payload:{run:ve}});typeof se.queue=="object"&&se.queue!==null&&e.applyEvent?.({nodeId:D.nodeId,sequence:se.sequence,category:"queue",payload:{sessionId:z,queue:se.queue}},"initial"),"context"in se&&e.applyEvent?.({nodeId:D.nodeId,sequence:se.sequence,category:"session",payload:{sessionId:z,context:se.context}}),se.performance!==void 0&&e.applyEvent?.({nodeId:D.nodeId,sequence:se.sequence,category:"conversation",payload:{sessionId:z,performance:se.performance}})}const U=se?.conversation??D.payload,K=po(U)??ft(U);if(C?.sessionId===z&&C.watchId===o){const ae=C;C=void 0,ae.removeAbortListener(),e.applySnapshot(z,K,D.historyReset===!0?"reset":"initial"),v.value={watchId:ae.watchId,nodeId:D.nodeId,workspaceId:D.workspaceId,sessionId:z,connectionId:D.workbenchConnectionId};const ve=typeof se?.sequence=="number"?se.sequence:K.snapshotSequence;for(const me of ae.events){const fe=me.category==="conversation"?K.snapshotSequence??ve:ve;fe!==void 0&&me.sequence<=fe||e.applyEvent?.(me)}return ae.resolve(),!0}return Promise.resolve(e.applySnapshot(z,K,D.historyReset===!0?"reset":"refresh")).then(ae=>{if(ae&&e.followConversation.value)return e.scrollAfterLayout()}),!0}function H(b){if(b.type!=="watch.failed"||b.watchType!=="session"||b.watchId!==o||b.workbenchConnectionId!==n()||b.sessionId!==a||b.nodeId!==e.workspaceTarget.value?.nodeId||b.workspaceId!==i||typeof b.nodeGeneration!="string"||g!==void 0&&b.nodeGeneration!==g)return!1;g??=b.nodeGeneration;const D=a;return D===void 0?!0:C?.sessionId===D&&C.watchId===o?(x(new st(Zo(b.code)?b.code:"SESSION_HISTORY_INITIAL_FAILED",typeof b.message=="string"&&b.message.length>0&&b.message.length<=1e3?b.message:"Unable to load the initial session snapshot.")),_.pause(),!0):p>=3?(w(),e.refreshSnapshot(),!0):(p+=1,_.pause(),m=setTimeout(()=>{m=void 0,e.selectedSessionId.value===D&&T(D,!1)},Math.min(e.heartbeatMs,1e3*2**(p-1))),!0)}function Q(){document.visibilityState!=="visible"&&w()}function Y(b,D){b!==void 0&&D!==void 0&&b.id===e.selectedSessionId.value&&vo(b)==="RUNNING"&&D.id===b.id&&R(D)&&y(D.id)}return{hasInitialSessionSnapshot:b=>v.value!==void 0&&v.value.watchId===o&&v.value.nodeId===e.workspaceTarget.value?.nodeId&&v.value.workspaceId===e.workspaceTarget.value?.workspaceId&&v.value.sessionId===b&&e.selectedSessionId.value===b&&v.value.connectionId===n(),canWatchSessionHistory:b=>t()&&R(b),initializeSelectedSessionWatch:M,beginSelectedSessionWatch:y,restartSelectedSessionWatch:T,pauseSelectedSessionWatch:h,stopSelectedSessionWatch:w,reconcileWorkspaceSnapshot:Y,handleEvent(b){return typeof b!="object"||b===null?!1:H(b)||I(b)},handleSessionWatchVisibility:Q}}const Ya=new TextEncoder;function On(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Ja(e){const n=G([]),t=G(null),o=Xa({...e,turns:n,nextCursor:t});return{turns:n,nextCursor:t,projection:o}}function Xa(e){const n=new Map,t=new Map,o=new Map;let a=0,r=0;const i=new Map;let c,g=!1;const v=e.scheduleTextDeltaFlush??(j=>{if(typeof requestAnimationFrame=="function"){const W=requestAnimationFrame(j);return()=>cancelAnimationFrame(W)}return queueMicrotask(j),()=>{}}),m=j=>`${j.sessionId}:${j.id}`,p=(j,W)=>`${m(j)}:${W}`;function C(j,W){if(W.length<j.length){const Z=new Set(W.map(re=>m(re))),pe=new Set(W.map(re=>re.runId));for(const re of j){if(Z.has(m(re)))continue;n.delete(m(re));const N=`${m(re)}:`;for(const P of t.keys())P.startsWith(N)&&t.delete(P);It(re)&&!pe.has(re.runId)&&o.delete(re.runId)}}}function x(j){C(e.turns.value,j),e.turns.value=[...j]}function L(){x(e.limitHistory(e.turns.value))}function A(){return e.turns.value.length<=wn?!1:(x(En(e.turns.value,xn)),e.nextCursor.value=null,!0)}function R(){ae(),t.clear(),n.clear(),o.clear(),r=0,a=0}function O(j){R()}function q(j,W){R(),e.turns.value=[...j],e.nextCursor.value=W}function _(j){const W=new Set(e.turns.value.map(Z=>Z.id));e.turns.value=e.limitHistory([...j.turns.filter(Z=>!W.has(Z.id)),...e.turns.value]),e.nextCursor.value=j.nextCursor}function y(j){e.turns.value=e.limitHistory(Ft(e.turns.value,j.turns)),e.nextCursor.value=j.nextCursor}function w(){e.nextCursor.value=null}function T(j,W){e.turns.value=Ka(e.turns.value,j,W)}function M(j){let W=!1;const Z=e.turns.value.map(pe=>{if(!I(pe,j))return pe;let re=!1;const N=pe.items.map(P=>P.id!==j||P.kind!=="user_message"||!On(P.payload)||P.payload.clientMessageId!==j?P:(re=!0,W=!0,{...P,payload:{...P.payload,delivery:"ACCEPTED"}}));return re?{...pe,items:N}:pe});return W&&(e.turns.value=Z),W}function h(j){const W=e.turns.value.filter(Z=>!I(Z,j));return W.length===e.turns.value.length?!1:(e.turns.value=W,!0)}function I(j,W){return j.id===W&&j.runId===null&&j.items.some(Z=>Z.id===W&&Z.kind==="user_message"&&On(Z.payload)&&Z.payload.clientMessageId===W)}function H(j,W){U();const Z=`${j}:`;for(const pe of n.keys())pe.startsWith(Z)&&n.delete(pe);for(const pe of t.keys())pe.startsWith(Z)&&t.delete(pe);for(const pe of W)o.delete(pe)}function Q(j,W){if(W===void 0)return;a=Math.max(a,W);const Z=m(j);n.set(Z,Math.max(n.get(Z)??0,W))}function Y(j,W){return ho(e.turns.value,j,W)}function b(j,W){return W!==void 0&&W<=(o.get(j)??-1)}function D(j,W){const Z=typeof W.segmentId=="string"?W.segmentId:void 0,pe=typeof W.turnId=="string"?W.turnId:void 0;if(Z===void 0){if(typeof W.itemId=="string"){const ye=e.turns.value.findIndex(Ae=>Ae.runId===j&&(pe===void 0||(Ae.turnId??Ae.id)===pe)&&Ae.items.some(Le=>Le.id===W.itemId));if(ye>=0)return ye}return Y(j,pe)}const re=e.turns.value.findIndex(ye=>ye.id===Z&&(ye.runId===j||ye.runId===null));if(re>=0)return e.turns.value[re].runId===null&&(e.turns.value=e.turns.value.map((ye,Ae)=>Ae===re?{...ye,runId:j}:ye)),re;if(pe===void 0||typeof W.segmentIndex!="number"||!Number.isInteger(W.segmentIndex)||W.segmentIndex<0)return-1;U();const N=Y(j,pe),P=N>=0?N:e.turns.value.findLastIndex(ye=>ye.turnId===pe&&ye.runId===null),J=e.turns.value[P];if(J===void 0)return-1;const de=W.segmentIndex;if(de<=(J.segmentIndex??-1))return-1;const Se={...J,id:Z,turnId:pe,runId:j,segmentIndex:de,items:[],startedAt:null,completedAt:null};return e.turns.value=Ft(e.turns.value,[{...J,status:"SUCCEEDED"},Se]),A()&&e.onRecentWindowOverflow(),e.turns.value.findIndex(ye=>ye.id===Z&&ye.runId===j)}function z(j,W,Z){if(b(j,Z))return;const pe=D(j,W),re=e.turns.value[pe];if(re===void 0||Za(re.status))return;const N=typeof W.itemId=="string"?W.itemId:void 0,P=N===void 0?void 0:re.items.find(J=>J.id===N&&J.kind==="assistant_message");if(!(P!==void 0&&Rt(P.status))&&!(N!==void 0&&Z!==void 0&&Z<=(t.get(p(re,N))??-1)))return{turnIndex:pe,turn:re}}function F(j,W,Z,pe=Date.now()){U();const re=he(W);if(re===void 0)return!1;const{itemId:N,kind:P,status:J}=re;if(typeof N!="string"||typeof P!="string"||typeof J!="string"||b(j,Z))return!1;const de=D(j,re);if(de<0)return!1;const Se=e.turns.value[de],ye=Se.items.findIndex(Ce=>Ce.id===N),Ae=ye<0?void 0:Se.items[ye],Le=p(Se,N);if(Z!==void 0&&Z<=(t.get(Le)??Number.NEGATIVE_INFINITY)||Ae!==void 0&&Rt(Ae.status)&&!Rt(J))return!1;const Te=At(pe)?pe:Date.now(),je=Se.items.at(-1),ue=Se.items.map(Ce=>Ce.id===je?.id&&Ce.kind==="assistant_message"&&Ce.status==="IN_PROGRESS"?{...Ce,status:"COMPLETED",completedAt:Te}:Ce),k=At(re.startedAt)?re.startedAt:Ae?.startedAt??Te,$=re.completedAt===null?null:At(re.completedAt)?re.completedAt:Rt(J)?Ae?.completedAt??Te:Ae?.completedAt??null,oe={id:N,kind:P,status:J,...re.processGroup===void 0?{}:{processGroup:ea.parse(re.processGroup)},...typeof re.parentItemId=="string"?{parentItemId:re.parentItemId}:{},startedAt:k,completedAt:$,payload:In(re.merge===!0&&Ae!==void 0?ha(Ae.payload,re.payload,re.append):re.payload)};return ye<0?ue.push(oe):ue.splice(ye,1,oe),e.turns.value=e.turns.value.map((Ce,Oe)=>Oe===de?{...Ce,items:ue,startedAt:Ce.startedAt??oe.startedAt}:Ce),Z!==void 0&&t.set(Le,Z),Q(Se,Z),L(),!0}function se(j,W,Z,pe=Date.now()){const re=he(W),N=re?.text;if(typeof N!="string"||N.length===0||re===void 0)return!1;const P=z(j,re,Z);if(P===void 0)return!1;const{turnIndex:J,turn:de}=P,Se=typeof re?.itemId=="string"?re.itemId:void 0,ye=de.items.at(-1),Ae=Se===void 0&&ye?.kind==="assistant_message"&&ye.status==="IN_PROGRESS",Le=Se===void 0?Ae?de.items.length-1:-1:de.items.findIndex(Oe=>Oe.id===Se&&Oe.kind==="assistant_message"),Te=Le>=0?de.items[Le].id:Se??`${j}:assistant:${Z??"live"}`,je=Le<0?void 0:de.items[Le],ue=p(de,Te);if(Z!==void 0&&Z<=(t.get(ue)??Number.NEGATIVE_INFINITY))return!1;const k=he(je?.payload),$=`${typeof k?.text=="string"?k.text:""}${N}`,oe={id:Te,kind:"assistant_message",status:"IN_PROGRESS",startedAt:je?.startedAt??(At(pe)?pe:Date.now()),completedAt:null,payload:{...k??{},...In({text:$}),format:"markdown",model:null}},Ce=[...de.items];return Le<0?Ce.push(oe):Ce.splice(Le,1,oe),e.turns.value=e.turns.value.map((Oe,rt)=>rt===J?{...Oe,items:Ce,startedAt:Oe.startedAt??oe.startedAt}:Oe),Z!==void 0&&t.set(ue,Z),r+=Ya.encode(N).byteLength,r>=64*1024?(Q(de,Z),L(),r=0,!0):(Q(de,Z),!0)}function U(){c?.(),c=void 0,g=!1,K()}function K(){if(i.size===0)return;const j=[...i.values()];i.clear();for(const W of j)se(W.runId,W,W.sequence,W.createdAt)}function ae(){c?.(),c=void 0,g=!1,i.clear()}function ve(j,W,Z,pe=Date.now()){const re=he(W),N=re?.text;if(typeof N!="string"||N.length===0)return!1;const P=re!==void 0&&typeof re.itemId=="string"?re.itemId:void 0;if(re===void 0)return!1;const J=z(j,re,Z);if(J===void 0)return!1;const de=J.turn,Se=`${j}\0${de.id}\0${P??""}`,ye=i.get(Se);if(ye!==void 0&&Z!==void 0&&Z<=(ye.sequence??-1))return!1;if(ye===void 0?i.set(Se,{runId:j,...P===void 0?{}:{itemId:P},turnId:de.turnId??de.id,...de.segmentIndex===void 0?{}:{segmentId:de.id,segmentIndex:de.segmentIndex},text:N,chunks:[{text:N,sequence:Z}],...Z===void 0?{}:{sequence:Z},createdAt:pe}):(ye.text+=N,ye.chunks.push({text:N,sequence:Z}),Z!==void 0&&(ye.sequence=Z)),!g){g=!0;const Ae=v(()=>{g=!1,c=void 0,K()});g?c=Ae:Ae()}return!0}function me(j,W){Q(j,W),!(!It(j)||W===void 0)&&o.set(j.runId,Math.max(o.get(j.runId)??0,W))}function fe(j){return j.snapshotSequence!==void 0&&j.snapshotSequence<a}function ge(j){if(U(),fe(j))return!1;const W=e.turns.value,pe=j.turns.map(Cn),re=new Map(W.map(Te=>[Te.id,Te])),N=pe.map(Te=>{const je=re.get(Te.id);if(je===void 0)return Q(Te,j.snapshotSequence),Te;const ue=n.get(m(Te));if(ue!==void 0&&j.snapshotSequence!==void 0&&ue>j.snapshotSequence)return je;Q(Te,j.snapshotSequence);const k=je.items.filter(ga);return k.length===0?Te:{...Te,items:va(Te.items,je.items,k)}}),P=pa(Ft(W,N)),J=W.at(-1)?.id,de=P.findIndex(Te=>Te.id===J),ye=P.slice(de+1).some(Te=>!re.has(Te.id))&&P.length>wn,Ae=e.limitHistory(ye?En(P,xn):P),Le=JSON.stringify(W)!==JSON.stringify(Ae);return C(P,Ae),ye&&(e.nextCursor.value=null),!ye&&e.nextCursor.value===null&&j.nextCursor!==null&&(e.nextCursor.value=j.nextCursor),Le&&(e.turns.value=Ae),ye&&e.onRecentWindowOverflow(),Le}function V(j){return U(),fe(j)?!1:(B(j),!0)}function B(j){const W=j.turns.map(Cn),Z=[...i.values()];R(),e.turns.value=e.limitHistory(W),e.nextCursor.value=j.nextCursor,a=j.snapshotSequence??0;for(const pe of e.turns.value)me(pe,j.snapshotSequence);for(const pe of Z){const re=j.snapshotSequence;if(re===void 0)continue;const N=pe.chunks.filter(P=>P.sequence!==void 0&&P.sequence>re);N.length!==0&&se(pe.runId,{...pe,text:N.map(P=>P.text).join("")},N.at(-1).sequence,pe.createdAt)}}function le(j){return U(),fe(j)?!1:(B(j),!0)}return{resetHistory:R,restore:O,restoreWindow:q,mergeOlderPage:_,recoverWindow:y,clearCursor:w,syncRunStatus:T,updateOptimisticUserMessage:M,removeOptimisticUserMessage:h,clearSession:H,markLive:Q,mergeItem:F,mergeTextDelta:ve,flushPendingTextDeltas:U,mergeLatest:ge,replaceRecent:V,replaceAuthoritative:le}}function At(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function Rt(e){return["COMPLETED","FAILED","DECLINED","CANCELLED","INTERRUPTED"].includes(e)}function Za(e){return["SUCCEEDED","FAILED","CANCELLED","INTERRUPTED","LOST"].includes(e)}function _o(e){const n=Xt(e);return n?.kind==="context_compaction"&&n.status==="COMPLETED"}function ei(e){const n=Xt(e),t=Xt(n?.payload);return _o(e)&&t?.retainedContext===!0}function dp(e,n){return _o(e)?ei(e)?null:n==null?n:{...n,usedTokens:0,percentage:0,...n.gcCount===void 0?{}:{gcCount:0},...n.gcCount===void 0&&n.gcReclaimedTokens===void 0?{}:{gcReclaimedTokens:0}}:n}function up(e){const{turns:n,nextCursor:t,projection:o}=Ja({onRecentWindowOverflow:e,limitHistory:_a});let a=0,r;const i=G(0);function c(){r!==void 0&&(clearTimeout(r.timer),r.resolve(),r=void 0)}function g(){c(),i.value+=1;const m=i.value;return new Promise(p=>{const C=setTimeout(()=>{r?.version===m&&(r=void 0,p())},1e4);r={version:m,resolve:p,timer:C}})}function v(m){r?.version===m&&c()}return{turns:n,nextCursor:t,projection:o,loadingInitial:G(!1),initialLoadFailed:G(!1),initialFailureCause:Et(),loadingOlder:G(!1),channelInput:G(""),channelToken:G(),contextUsage:G(),initialRenderVersion:i,beginInitialRender:g,confirmInitialRender:v,cancelInitialRender:c,nextDetailRequest:()=>++a,currentDetailRequest:()=>a}}function Xt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)?e:void 0}function ti(e){return typeof e=="object"&&e!==null&&typeof e.id=="string"&&typeof e.sessionId=="string"&&typeof e.status=="string"}function ni(e){return typeof e=="object"&&e!==null&&typeof e.id=="string"&&typeof e.workspaceId=="string"&&(e.runner==="codex"||e.runner==="claude-code"||e.runner==="opencode"||e.runner==="mar-agent")&&!e.id.startsWith("draft:")}function fp(e){function n(a,r){const i=e.setNodeConnection?.(a,r);r&&i===!1&&e.onNodeConnected(a)}function t(a,r="event"){const i=he(a.payload);if(a.category==="node"&&typeof i?.connected=="boolean"){n(a.nodeId,i.connected);return}if(a.category==="workspace"&&i!==void 0){typeof i.workspaceId=="string"&&typeof i.topic=="string"&&e.invalidateWorkspace(a.nodeId,i.workspaceId,i.topic);return}if(a.category==="queue"&&i!==void 0){const{sessionId:p,queue:C}=i;if(typeof p=="string"&&a.nodeId===e.workspaceTarget.value?.nodeId&&typeof C=="object"&&C!==null){const x=e.selectedSession?.value,L=x?.id===p&&x.workspaceId===e.workspaceTarget.value?.workspaceId?x:e.sessions.value.find(A=>A.id===p&&A.workspaceId===e.workspaceTarget.value?.workspaceId);L!==void 0&&go(L)&&e.cacheQueue(a.nodeId,L.workspaceId,p,C,r),p===e.selectedSessionId.value&&e.mergeQueue(C,r)}return}if(a.category==="session"&&i!==void 0&&a.nodeId===e.workspaceTarget.value?.nodeId){const p=i.session;if(ni(p)){const C=p.id===e.selectedSessionId.value;C&&p.activity!==void 0&&p.activity!=="RUNNING"&&e.settleSessionRuns(p.id),e.mergeSessions([p]),C&&p.activity==="RUNNING"&&e.observeSessionRunning(p.id)}typeof i.sessionId=="string"&&"context"in i&&e.updateContext(i.sessionId,i.context??null);return}if(a.category==="run"&&i!==void 0&&ti(i.run)){const p=i.run;if(e.syncTurnStatus(p.id,p.status,p.sessionId),a.nodeId===e.workspaceTarget.value?.nodeId&&e.cacheRun(p),p.sessionId===e.selectedSessionId.value&&a.nodeId===e.workspaceTarget.value?.nodeId){const C=e.acceptRun(p);["STARTING","RUNNING","CANCELLING"].includes(C.status)&&e.openRun(p.id)}return}if(a.category!=="conversation"||i===void 0)return;if(i.performance!==void 0){a.nodeId===e.workspaceTarget.value?.nodeId&&typeof i.sessionId=="string"&&i.sessionId===e.selectedSessionId.value&&e.receivePerformance?.(i.sessionId,i.performance);return}const c=he(i.item);if(c!==void 0&&typeof i.runId=="string"&&a.nodeId===e.workspaceTarget.value?.nodeId&&i.sessionId===e.selectedSessionId.value){e.mergeItem(i.runId,c,a.sequence,typeof c.startedAt=="number"?c.startedAt:void 0);return}const g=he(i.delta);if(g!==void 0&&typeof g.runId=="string"&&typeof g.itemId=="string"&&typeof g.text=="string"&&a.nodeId===e.workspaceTarget.value?.nodeId&&i.sessionId===e.selectedSessionId.value){e.mergeTextDelta(g.runId,g,a.sequence,typeof g.createdAt=="number"?g.createdAt:void 0);return}const v=po(i.snapshot,a.sequence);if(v!==void 0&&a.nodeId===e.workspaceTarget.value?.nodeId){const p=v.turns[0]?.sessionId??(typeof i.sessionId=="string"?i.sessionId:void 0);p!==void 0&&e.applyConversationSnapshot(p,v,"refresh");return}const m=i.turn;if(ba(m)&&a.nodeId===e.workspaceTarget.value?.nodeId){if(!Array.isArray(i.segments)||!i.segments.every(sn))return;const p=ft({segments:i.segments,nextCursor:e.conversationNextCursor.value,snapshotSequence:a.sequence}).turns;if(p.length===0)return;for(const C of p)e.markLiveTurn(C,a.sequence),e.cacheTurn(C);m.sessionId===e.selectedSessionId.value&&e.mergeTurns({turns:p,nextCursor:e.conversationNextCursor.value,snapshotSequence:a.sequence});return}}function o(a){(a.category==="node"||a.category==="workspace")&&t(a)}return{apply:t,applyBroadcast:o,updateNodeConnection:n}}function mp(e){let n=!1,t=!1,o=0;const a=G("");function r(){o+=1,n=!1,t=!1,e.loadingOlder.value=!1,a.value=""}Re([e.workspaceTarget,e.selectedSessionId],r,{flush:"sync"});async function i(){await c(e.pageSize)}async function c(p){const C=e.workspaceTarget.value?.nodeId,x=e.selectedSessionId.value,L=e.nextCursor.value;if(C===void 0||x===void 0||L===null||e.loadingOlder.value||n)return;const A=o;e.loadingOlder.value=!0,a.value="";let R=L;try{let O;try{O=await g(C,x,p,R)}catch(_){if(at(_)!=="EVENT_CURSOR_INVALID")throw _;if(e.workspaceTarget.value?.nodeId!==C||e.selectedSessionId.value!==x||o!==A||e.nextCursor.value!==R)return;const y=await v(C,x,R,A);if(y===void 0||e.workspaceTarget.value?.nodeId!==C||e.selectedSessionId.value!==x||o!==A||e.nextCursor.value!==(y??R))return;if(y===null){const w=e.capturePrependAnchor();e.clearCursor(),await De(),o===A&&e.workspaceTarget.value?.nodeId===C&&e.selectedSessionId.value===x&&e.nextCursor.value===null&&w();return}R=y,O=await g(C,x,p,R)}if(e.workspaceTarget.value?.nodeId!==C||e.selectedSessionId.value!==x||o!==A||e.nextCursor.value!==R)return;const q=e.capturePrependAnchor();e.mergeOlderPage(O),await De(),o===A&&e.workspaceTarget.value?.nodeId===C&&e.selectedSessionId.value===x&&q()}catch(O){e.workspaceTarget.value?.nodeId===C&&e.selectedSessionId.value===x&&o===A&&e.nextCursor.value===R&&(a.value=l("generated.workbenchConversationPagingService.unableToLoadEarlierConversationHistory",{value0:e.errorMessage(O)}))}finally{o===A&&(e.loadingOlder.value=!1)}}async function g(p,C,x,L){const A=await e.request(`/api/agent-sessions/${e.sessionPathId(C)}/turns?nodeId=${encodeURIComponent(p)}&limit=${x}&cursor=${encodeURIComponent(L)}&unit=SEGMENT`);return ft(A)}async function v(p,C,x,L){const A=await e.request(`/api/agent-sessions/${e.sessionPathId(C)}/turns?nodeId=${encodeURIComponent(p)}&limit=${e.recentSegmentWindowSize}&unit=SEGMENT`),R=ft(A);if(e.workspaceTarget.value?.nodeId!==p||e.selectedSessionId.value!==C||o!==L||e.nextCursor.value!==x)return;const O=R.nextCursor===null?{...R,nextCursor:x}:R;if(e.recoverWindow(O),await De(),!(e.workspaceTarget.value?.nodeId!==p||e.selectedSessionId.value!==C||o!==L||e.nextCursor.value!==O.nextCursor))return R.nextCursor}async function m(){const p=e.workspaceTarget.value?.nodeId,C=e.selectedSessionId.value;if(p===void 0||C===void 0)return;if(n){t=!0;return}n=!0;let x=o;try{do{t=!1,x=++o,e.loadingOlder.value=!1,a.value="";const L=await e.request(`/api/agent-sessions/${e.sessionPathId(C)}/turns?nodeId=${encodeURIComponent(p)}&limit=${e.recentSegmentWindowSize}&unit=SEGMENT`),A=ft(L);if(o!==x||e.workspaceTarget.value?.nodeId!==p||e.selectedSessionId.value!==C)return;t||e.replaceRecent(A)}while(t)}catch{}finally{o===x&&(n=!1)}}return{resetWindow:r,olderHistoryError:a,loadOlderConversationTurns:i,refreshRecentConversationTurns:m}}const oi=28,Nn=48;function gp(){const e=G(),n=G(!0),t=G(!1);let o,a,r,i=0,c;function g(_){e.value=_,o=_?.clientWidth,a=_?.clientHeight,r=_?.scrollHeight,i=_?.scrollTop??0,c=void 0}function v(_){const y=_.clientWidth!==o||_.clientHeight!==a||_.scrollHeight!==r;return o=_.clientWidth,a=_.clientHeight,r=_.scrollHeight,y}function m(_){const y=_.getBoundingClientRect(),w=_.ownerDocument.elementFromPoint(y.left+y.width/2,y.top+y.height/2);c=w!==null&&w!==_&&_.contains(w)?{element:w,top:w.getBoundingClientRect().top}:void 0}function p(_){const y=e.value;if(y===void 0||t.value)return;const w=v(y),T=c!==void 0&&y.contains(c.element)&&Math.abs(c.element.getBoundingClientRect().top-c.top)<1,M=!T&&y.scrollTop<i-1,h=!T&&y.scrollTop>i,I=y.scrollHeight-y.scrollTop-y.clientHeight;if(i=y.scrollTop,w&&(!M&&!h||n.value&&I<=1)){n.value?L():c===void 0&&m(y);return}n.value=!M&&(n.value||h)&&I<oi,n.value?c=void 0:(M||h||c===void 0)&&m(y),M&&y.scrollTop<Nn&&y.scrollHeight>y.clientHeight+Nn&&_()}function C(){const _=e.value;_===void 0||!v(_)||!n.value||q()}function x(){const _=e.value;_!==void 0&&(n.value=!1,t.value=!1,v(_),i=_.scrollTop,m(_))}function L(){const _=e.value;_!==void 0&&(_.scrollTop=_.scrollHeight,i=_.scrollTop,n.value=!0,c=void 0)}function A(_){const y=e.value;if(y===void 0)return()=>{};const w=y.scrollHeight,T=y.scrollTop,M=_&&n.value;return()=>{if(!(e.value!==y||y.scrollTop!==T)){if(M){n.value&&(L(),v(y));return}y.scrollTop=T+(y.scrollHeight-w),i=y.scrollTop,v(y),n.value||m(y)}}}function R(){return A(!0)}function O(){return A(!1)}async function q(_=()=>!0){const y=e.value;y===void 0||!_()||(L(),await De(),!(e.value!==y||!n.value||!_())&&(L(),await new Promise(w=>requestAnimationFrame(()=>w())),!(e.value!==y||!n.value||!_())&&(L(),await new Promise(w=>setTimeout(w,50)),!(e.value!==y||!n.value||!_())&&L())))}return{element:e,following:n,positioningInitialConversation:t,setElement:g,handleScroll:p,handleResize:C,stopFollowing:x,scrollToLatest:L,captureRenderAnchor:R,capturePrependAnchor:O,scrollToLatestAfterLayout:q}}const ai=5e3;function Zt(e){return`session:${e===void 0||e.startsWith("draft:")?"draft":e}`}function vp(){const e=ii(),n={};return{...e.bind(()=>n),transferSession:(t,o)=>e.transfer(n,n,t,o)}}function ii(){const e=new WeakMap,n=new Map,t=new WeakMap;function o(v){const m=JSON.stringify([v.nodeId,v.workspaceId,v.kind,v.kind==="session"?v.sessionId:null]);let p=n.get(m);return p===void 0&&(p={},n.set(m,p),t.set(p,m)),p}const a=G(0),r={};function i(v){let m=e.get(v);return m===void 0&&(m={slots:new Set([v]),tokens:Et([])},e.set(v,m)),m}function c(v){const m=X(()=>(a.value,i(v()??r)));function p(C,x,L=ai){const A=m.value;if(A.tokens.value.length!==0)return;const R={group:A,context:C,active:!0};function O(){return R.active?(R.active=!1,clearTimeout(R.timeout),R.group.tokens.value=R.group.tokens.value.filter(q=>q!==R),!0):!1}return A.tokens.value=[...A.tokens.value,R],L!==null&&(R.timeout=setTimeout(()=>{O()&&x?.()},L)),O}return{pending:X(()=>m.value.tokens.value.length!==0),context:X(()=>m.value.tokens.value.find(C=>C.context!==void 0)?.context),begin:p}}function g(v,m,p,C,x=!1){const L=e.get(v);if(L===void 0)return;const A=e.get(m)??L;for(const R of L.tokens.value)R.context===Zt(p)&&(R.context=Zt(C)),R.group=A;if(A!==L){A.tokens.value=[...A.tokens.value,...L.tokens.value];for(const R of L.slots)e.set(R,A),A.slots.add(R)}else A.tokens.value=[...A.tokens.value];if(e.set(m,A),A.slots.add(m),x&&v!==m){e.delete(v),A.slots.delete(v);const R=t.get(v);R!==void 0&&n.get(R)===v&&n.delete(R)}a.value+=1}return{bind:c,transfer:g,forTarget:o}}const pp="";function hp(e,n=[]){const t=e??G(n);function o(g){if(t.value.some(m=>m.name===g.name))return!1;const v={name:g.name,source:g.source,skillFilePath:g.skillFilePath,available:!0};return t.value=[...t.value,v],!0}function a(g){t.value=t.value.filter(v=>v.name!==g)}function r(){t.value=[]}function i(g){t.value=g.filter(bo)}function c(g){const v=new Map(g.map(m=>[m.name,m]));t.value=t.value.map(m=>{const p=v.get(m.name);return p===void 0?{...m,available:!1}:{name:p.name,source:p.source,skillFilePath:p.skillFilePath,available:!0}})}return{tokens:t,select:o,remove:a,clear:r,restore:i,reconcile:c}}function ri(e,n,t=[]){const o=[n,e.length>0?Nt("mar_skills",{action:"use",instruction:ta,skills:e.map(a=>({name:a.name,source:a.source,path:a.skillFilePath}))}):"",t.length>0?Nt("mar_references",{references:[...t]}):""].filter(a=>a.length>0).join(`
|
|
2
2
|
`).trim();if(o.length>Zn)throw new Error("COMPOSER_MESSAGE_TOO_LARGE");return o}function si(e){return e.some(n=>!n.available)}function _p(e){return Array.isArray(e)?e.filter(bo):[]}function bo(e){return typeof e=="object"&&e!==null&&"name"in e&&typeof e.name=="string"&&e.name.length>0&&"source"in e&&(e.source==="NODE_HOME"||e.source==="WORKSPACE")&&"skillFilePath"in e&&typeof e.skillFilePath=="string"&&e.skillFilePath.length>0&&"available"in e&&typeof e.available=="boolean"}const yo=new Set(["SUCCEEDED","FAILED","CANCELLED","INTERRUPTED","LOST"]);function jn(e){return e==="STARTING"?1:e==="RUNNING"?2:e==="CANCELLING"?3:yo.has(e)?4:-1}function He(e){return yo.has(e)}function Ht(e,n){return e===void 0?n:e.version!==void 0&&n.version!==void 0&&e.version!==n.version?e.version>n.version?e:n:jn(e.status)>jn(n.status)?e:n}function li(e,n){return e?.id??n.workspaceId}function ci(e,n){return e??(n?"QUEUE":"SEND")}function bp(e){const n=eo(),t=()=>n?.active!==!1;let o;const a=(i,c,g,v,m,p)=>JSON.stringify([i,c,g,v,m,p.map(C=>C.id)]);async function r(i,c=!1,g,v){if(!t()||e.workspaceTarget.value?.nodeId===void 0||!e.composerOpen.value||e.submissionAvailable?.()===!1)return;const m=e.workspaceTarget.value?.nodeId,p=e.workspaceTarget.value?.workspaceId,C=()=>e.workspaceTarget.value?.nodeId===m&&e.workspaceTarget.value?.workspaceId===p,x=e.captureDraft();if(x===void 0)return;const L=x.input,A=x.skillTokens,R=x.references,O=L.value,_=O.trim();if(v===void 0&&g===void 0&&si(A.value)){e.notice(l("composer.skillUnavailable"),"warning");return}let y;try{y=v?.input??g??ri(A.value,L.value,R?.value)}catch(fe){e.notice(l("generated.workbenchSessionMessageService.unableToSendTheMessage",{value0:e.errorMessage(fe)}),"error",fe);return}const w=v?.command??(g===void 0?e.selectedCommand.value:void 0);if(w!==void 0&&e.commandAvailable?.(w)===!1||w===void 0&&y.length===0&&e.attachments.value.length===0)return;if(e.attachmentsPending.value&&w===void 0&&g===void 0){e.notice(l("generated.workbenchSessionMessageService.attachmentsAreStillUploadingOrFailedWait"),"warning");return}const T=ci(i,e.composerBusy.value),M=e.draftOpen.value||e.selectedSessionId.value?.startsWith("draft:")===!0,h=v?.input??(c&&w!==void 0?`/${w.id}`:y);if(M&&w!==void 0&&!(w.id==="fast"&&w.runner==="codex")){if(w.interaction==="IMMEDIATE_ACTION"||w.interaction==="DESTRUCTIVE_ACTION"){e.notice(l("generated.workbenchSessionMessageService.sendARegularMessageToCreateThe"),"warning");return}e.stageDraftCommand(w,h),c||(L.value="",x.persist()),v===void 0&&(e.selectedCommand.value=void 0,e.commandPickerOpen.value=!1);return}if(w?.interaction==="DESTRUCTIVE_ACTION"){const fe=e.selectedSessionId.value;try{await wa.confirm(l("generated.workbenchSessionMessageService.clearSessionConfirmation"),l("generated.workbenchSessionMessageService.clearSession"),{closeIcon:Fe("close"),icon:Fe("warning"),type:"warning",confirmButtonText:l("generated.workbenchSessionMessageService.confirmClearSession"),cancelButtonText:l("generated.workbenchSessionMessageService.cancelClearSession"),confirmButtonClass:"el-button--danger"})}catch{return}if(fe===void 0||!C()||e.selectedSessionId.value!==fe||e.submissionAvailable?.()===!1||e.commandAvailable?.(w)===!1)return}const I=g===void 0?[...e.attachments.value]:[],H=A.value,Q=R?.value,Y=e.selectedWorkspace.value;let b=!1,D,z,F;const se=e.selectedSessionId.value,U=e.beginSubmission(Zt(se),()=>{t()&&e.workspaceTarget.value?.nodeId===m&&e.workspaceTarget.value?.workspaceId===p&&e.selectedSessionId.value===(D?.id??se)&&e.notice(l("workbench.submissionTimedOut"),"warning")});if(U===void 0)return;const K=x.retain?.(),ae=fe=>{K!==void 0?K.settle(fe):(fe(),x.persist())},ve=e.retainAttachments(w===void 0?I:[]);let me=!1;try{if(w?.id==="fast"&&w.runner==="codex"){const N=await e.request("/api/runner-commands",{method:"POST",body:JSON.stringify({nodeId:m,runner:"codex",commandId:"fast",input:`/fast ${e.fastEnabled.value?"off":"on"}`})});U()&&C()&&e.selectedSessionId.value===se&&(e.fastEnabled.value=N.enabled,!c&&L.value===O&&O.trim()===y&&ae(()=>{L.value=""}),v===void 0&&(e.selectedCommand.value=void 0,e.commandPickerOpen.value=!1));return}const fe=M;b=fe;const ge=e.draftOpen.value?await e.draft?.create(e.temporaryTitle(_)):e.selectedSession.value;if(!t())return;if(ge===void 0)throw new Error("SESSION_NOT_FOUND");if(D=ge,fe&&ge.id.startsWith("draft:")&&(z=e.sessions.value.find(N=>N.id===ge.id&&N.workspaceId===ge.workspaceId)),w!==void 0){await e.executeCommand(ge,w,h),U()&&(!c&&L.value===O&&O.trim()===y&&ae(()=>{L.value=""}),v===void 0&&C()&&e.selectedSessionId.value===ge.id&&(e.selectedCommand.value=void 0,e.commandPickerOpen.value=!1));return}if(fe&&Y===void 0)throw new Error(l("generated.workbenchSessionMessageService.selectAWorkspaceBeforeSendingAMessage"));const V=li(Y,ge),B=a(m,V,ge.id,y,T,I);o?.signature!==B&&(o=void 0);const le=o?.clientMessageId??ct();F={signature:B,clientMessageId:le},o=F,e.scrollToLatest();const j=await e.request(fe?"/api/agent-sessions/start":`/api/agent-sessions/${e.sessionPathId(ge.id)}/messages`,{method:"POST",body:JSON.stringify({nodeId:m,...fe?{workspaceId:V,runner:ge.runner,cwd:Y.path,modelId:ge.modelId,effort:ge.effort,access:ge.access,...ge.runnerTitle?{title:ge.runnerTitle}:{},deferredCommands:e.deferredCommands.value.map(N=>({commandId:N.command.id,input:N.input}))}:{workspaceId:V,...ge.runner==="mar-agent"?{modelId:ge.modelId}:{}},clientMessageId:le,content:y,deliveryIntent:T,computerUse:ge.runner==="mar-agent",attachmentIds:I.map(N=>N.id)})});if(!t())return;e.consumeAttachments(I),fe&&x.createdSession?.(j.session),o===F&&(o=void 0),fe&&C()&&e.selectedSessionId.value===ge.id&&(e.deferredCommands.value=[]);const W=e.selectedSessionId.value,Z=C(),pe=Z&&W===ge.id;if(ge.id!==j.session.id&&e.migrateSessionCache(m,ge.workspaceId,ge.id,j.session.id,j.session),Z&&e.replaceSession(ge.id,j.session),fe&&Z&&e.selectedSessionId.value===j.session.id&&e.beginSessionWatch(j.session.id),pe||Z&&W===j.session.id){const N=e.acceptRun({...j.run,sessionId:j.run.sessionId??j.session.id});(j.delivery===void 0||j.delivery==="STARTED")&&!He(N.status)&&e.openRun(j.run.id)}else e.cacheRun(m,ge.workspaceId,{...j.run,sessionId:j.run.sessionId??j.session.id,workspaceId:j.run.workspaceId??ge.workspaceId});(pe||Z&&(W===j.session.id||e.selectedSessionId.value===j.session.id))&&e.scrollToLatestAfterLayout(),me=U(),g===void 0&&L.value===O&&A.value===H&&R?.value===Q&&ae(()=>{L.value="",A.value=[],R!==void 0&&(R.value=[])})}catch(fe){if(!t())return;if(o===F&&at(fe)!==void 0&&(o=void 0),me=U(),b&&me){const ge=z!==void 0&&e.sessions.value.includes(z);C()&&ge&&z!==void 0&&e.removeSessionExact(z),C()&&ge&&e.selectedSessionId.value===D?.id&&e.draft?.restore()}me&&e.notice(l("generated.workbenchSessionMessageService.unableToSendTheMessage",{value0:e.errorMessage(fe)}),"error",fe)}finally{K?.release(),ve(),U()}}return{send:r}}function yp(e){const n=eo(),t=a=>at(a)==="RUN_NOT_FOUND";async function o(){const a=e.workspaceTarget.value?.nodeId,r=e.workspaceTarget.value?.workspaceId,i=e.selectedSessionId.value;if(a===void 0||r===void 0||i===void 0)return;const c=e.currentRevision(),g=()=>n?.active!==!1&&e.workspaceTarget.value?.nodeId===a&&e.workspaceTarget.value.workspaceId===r&&e.selectedSessionId.value===i&&e.currentRevision()===c,v=e.activeRun.value,m=e.beginSubmission(`session:${i}`);if(m!==void 0){if(v===void 0){try{const p=await e.request(`/api/agent-sessions/${e.sessionPathId(i)}/interrupt`,{method:"POST",body:JSON.stringify({nodeId:a})});g()&&(e.runService.mergeSnapshots([p.run]),e.selectedRunId.value=p.run.id)}catch(p){const C=m();g()&&!t(p)&&C&&e.notice(l("generated.workbenchRunControlService.runOperationDenied",{value0:e.errorMessage(p)}),"error",p)}finally{m()}return}try{const p=await e.request(`/api/agent-runs/${encodeURIComponent(v.id)}/interrupt`,{method:"POST",body:JSON.stringify({nodeId:a})});g()&&p.run!==void 0&&e.runService.replaceExistingRun(p.run)}catch(p){const C=m();g()&&!t(p)&&C&&e.notice(l("generated.workbenchRunControlService.runOperationDenied2",{value0:e.errorMessage(p)}),"error",p)}finally{m()}}}return{stopActiveRun:o}}async function di(e){return Ea(new Uint8Array(await e.arrayBuffer()))}const qn=5*1024*1024,ui=16e6;function ko(e){return["image/bmp","image/x-bmp","image/x-ms-bmp","image/x-windows-bmp"].includes(e.type)||(e.type===""||e.type==="application/octet-stream")&&/\.bmp$/iu.test(e.name)}async function fi(e){if(!ko(e))return e;if(e.size===0||e.size>qn)throw new Error("COMPOSER_IMAGE_LIMIT_EXCEEDED");let n;try{if(n=await createImageBitmap(e),n.width*n.height>ui)throw new Error("COMPOSER_IMAGE_LIMIT_EXCEEDED");const t=document.createElement("canvas");t.width=n.width,t.height=n.height;const o=t.getContext("2d");if(o===null)throw new Error("COMPOSER_IMAGE_CONVERSION_FAILED");o.drawImage(n,0,0);const a=await new Promise(i=>t.toBlob(i,"image/png"));if(a===null||a.size===0||a.type!=="image/png")throw new Error("COMPOSER_IMAGE_CONVERSION_FAILED");if(a.size>qn)throw new Error("COMPOSER_IMAGE_LIMIT_EXCEEDED");const r=/\.bmp$/iu.test(e.name)?e.name.replace(/\.bmp$/iu,".png"):`${e.name}.png`;return new File([a],r,{type:"image/png",lastModified:e.lastModified})}catch(t){throw at(t)==="COMPOSER_IMAGE_LIMIT_EXCEEDED"?t:new Error("COMPOSER_IMAGE_CONVERSION_FAILED")}finally{n?.close()}}const mi=5,gi=5*1024*1024,Un=10*1024*1024,vi=512*1024;function kp(e){const n=G([]),t=new Map,o=(h,I)=>h!==void 0&&I!==void 0&&h.kind===I.kind&&h.nodeId===I.nodeId&&h.workspaceId===I.workspaceId&&(h.kind==="workspace"||I.kind==="session"&&h.sessionId===I.sessionId),a=new Map,r=h=>JSON.stringify([h.nodeId,h.workspaceId,h.id]);function i(h){return h===void 0?[]:n.value.filter(I=>o(t.get(I.id),h))}const c=X(()=>i(e.context())),g=G(!1),v=G(),m=G(!1),p=new Map;function C(h,I){for(const H of I){const Q=i(h);if(Q.length>=mi)return e.notice(l("generated.composerAttachmentService.theFirstMessageCanIncludeUpTo"),"warning");if(H.size===0||H.size>gi){e.notice(l("generated.composerAttachmentService.attachmentMustBeLargerThan0And",{value0:H.name}),"warning");continue}if(Q.reduce((D,z)=>D+z.file.size,0)+H.size>Un)return e.notice(l("generated.composerAttachmentService.totalAttachmentSizeCannotExceed10MiB"),"warning");if(h===void 0)return e.notice(l("generated.composerAttachmentService.selectAnOnlineWorkspaceBeforeAddingAttachments"),"warning");const b={id:ct(),file:H,nodeId:h.nodeId,workspaceId:h.workspaceId,previewUrl:H.type.startsWith("image/")?URL.createObjectURL(H):null,receivedBytes:0,status:"UPLOADING"};t.set(b.id,{...h}),n.value=[...n.value,b],w(b)}}function x(h){const I=n.value.find(H=>H.id===h);v.value?.id===h&&(m.value=!1),I?.previewUrl!==null&&I?.previewUrl!==void 0&&URL.revokeObjectURL(I.previewUrl),n.value=n.value.filter(H=>H.id!==h),t.delete(h),I!==void 0&&M(I)}function L(h,I=!0){if(h===void 0)return;m.value=!1;const H=i(h);for(const Y of H)Y.previewUrl!==null&&URL.revokeObjectURL(Y.previewUrl),I&&M(Y),t.delete(Y.id);const Q=new Set(H.map(Y=>Y.id));n.value=n.value.filter(Y=>!Q.has(Y.id))}function A(){m.value=!1;for(const h of n.value)h.previewUrl!==null&&URL.revokeObjectURL(h.previewUrl),M(h);n.value=[],t.clear()}function R(h,I){if(h.kind!=="workspace"||I.kind!=="session"||h.nodeId!==I.nodeId||h.workspaceId!==I.workspaceId)return;let H=!1;for(const[Q,Y]of t)o(Y,h)&&(t.set(Q,{...I}),H=!0);H&&(n.value=[...n.value])}function O(h){const I=h.map(r);for(const Q of I)a.set(Q,(a.get(Q)??0)+1);let H=!1;return()=>{if(!H){H=!0;for(const Q of I){const Y=a.get(Q)-1;Y===0?a.delete(Q):a.set(Q,Y)}}}}function q(h){n.value=n.value.filter(I=>h.some(H=>H.id===I.id&&H.nodeId===I.nodeId&&H.workspaceId===I.workspaceId)?(v.value?.id===I.id&&(m.value=!1),I.previewUrl!==null&&URL.revokeObjectURL(I.previewUrl),t.delete(I.id),!1):!0)}function _(h){h.previewUrl!==null&&(v.value=h,m.value=!0)}function y(h){return{attachments:X(()=>i(h())),add:I=>C(h(),I),remove:I=>{o(t.get(I),h())&&x(I)},clear:(I=!0)=>L(h(),I)}}async function w(h){try{if(ko(h.file)){const Y=await fi(h.file),b=n.value.find(z=>z.id===h.id);if(b===void 0)return;if(n.value.filter(z=>o(t.get(z.id),t.get(b.id))).reduce((z,F)=>z+(F.id===b.id?Y.size:F.file.size),0)>Un)throw new Error("COMPOSER_IMAGE_LIMIT_EXCEEDED");b.file=Y,h=b}const I=e.direct?.generation(h.nodeId);if(I!==void 0){const Y=new AbortController;p.set(h.id,Y);try{if(!n.value.some(z=>z.id===h.id))throw new Error("UPLOAD_CANCELLED");h.transport="DIRECT";const b=await di(h.file);if(Y.signal.aborted)throw new Error("UPLOAD_CANCELLED");await e.direct.upload({nodeId:h.nodeId,nodeGeneration:I,descriptor:{direction:"UPLOAD",resource:{kind:"WORKSPACE_FILE",workspaceId:h.workspaceId,path:h.file.name},fileName:h.file.name,size:h.file.size,sha256:b,overwrite:!1,composerAttachment:{id:h.id,mime:h.file.type||"application/octet-stream"}},file:h.file,onProgress:z=>{h.receivedBytes=z},signal:Y.signal});const D=n.value.find(z=>z.id===h.id);D!==void 0&&(D.status="COMPLETED");return}catch{if(!n.value.some(b=>b.id===h.id))return;h.receivedBytes=0,h.transport="SERVER",h.directFallback=!0}finally{p.delete(h.id)}}h.transport="SERVER";const H=await e.request(`/api/workspaces/${encodeURIComponent(h.workspaceId)}/uploads`,{method:"POST",body:JSON.stringify({nodeId:h.nodeId,name:h.file.name,mime:h.file.type||"application/octet-stream",size:h.file.size,overwrite:!1,composerAttachmentId:h.id})});if(!n.value.some(Y=>Y.id===h.id)){await M({...h,uploadId:H.upload.uploadId});return}const Q=n.value.find(Y=>Y.id===h.id);if(Q===void 0)return;for(Q.uploadId=H.upload.uploadId,Q.receivedBytes=H.upload.receivedBytes;Q.receivedBytes<Q.file.size;){const Y=Q.receivedBytes,b=Q.file.slice(Y,Math.min(Q.file.size,Y+vi)),D=await T(Q,Y,b);Q.receivedBytes=D.receivedBytes}if(Q.uploadId===void 0)throw new Error("COMPOSER_ATTACHMENT_UPLOAD_FAILED");await e.request(`/api/workspaces/${encodeURIComponent(h.workspaceId)}/uploads/${encodeURIComponent(Q.uploadId)}/complete`,{method:"POST",body:JSON.stringify({nodeId:h.nodeId})}),Q.status="COMPLETED"}catch(I){const H=n.value.find(Q=>Q.id===h.id);if(H===void 0)return;H.status="FAILED",H.error=lo(I),window.setTimeout(()=>x(h.id),1e3)}}async function T(h,I,H){let Q,Y=!1;for(let b=0;b<3;b+=1)try{return await new Promise((D,z)=>{const F=new XMLHttpRequest,se=`/api/workspaces/${encodeURIComponent(h.workspaceId)}/uploads/${encodeURIComponent(h.uploadId??"")}/chunks?nodeId=${encodeURIComponent(h.nodeId)}&offset=${I}`;F.open("POST",e.resourceUrl?.(se)??se),F.withCredentials=!0,F.setRequestHeader("content-type","application/octet-stream"),F.setRequestHeader("x-csrf-token",e.csrfToken.value),F.upload.onprogress=U=>{U.lengthComputable&&(h.receivedBytes=Math.min(h.file.size,I+U.loaded))},F.onerror=()=>z(new Error("UPLOAD_NETWORK_FAILED")),F.onabort=()=>z(new Error("UPLOAD_CANCELLED")),F.onload=()=>{if(F.status<200||F.status>=300){let U;try{U=JSON.parse(F.responseText).error?.code}catch{U=void 0}U==="UNAUTHENTICATED"&&e.onUnauthenticated(),z(new Error(U??`REQUEST_FAILED_${F.status}`));return}try{const U=JSON.parse(F.responseText);if(!Number.isSafeInteger(U.upload?.receivedBytes))throw new Error("NODE_RESPONSE_INVALID");D({receivedBytes:U.upload?.receivedBytes})}catch(U){z(U)}},F.send(H)})}catch(D){if(Q=D,at(D)==="UNAUTHENTICATED")throw D;if(at(D)==="CSRF_INVALID"){if(Y)throw D;Y=!0,await e.renewCsrfToken()}h.receivedBytes=I}throw Q instanceof Error?Q:new Error("COMPOSER_ATTACHMENT_UPLOAD_FAILED")}async function M(h){if(a.has(r(h)))return;p.get(h.id)?.abort(),p.delete(h.id);const I=h.status==="COMPLETED"?h.id:h.uploadId;I!==void 0&&await e.request(`/api/workspaces/${encodeURIComponent(h.workspaceId)}/uploads/${encodeURIComponent(I)}/cancel`,{method:"POST",body:JSON.stringify({nodeId:h.nodeId})}).catch(()=>{})}return{attachments:c,dragging:g,preview:v,previewOpen:m,add:h=>C(e.context(),h),remove:x,clear:(h=!0)=>L(e.context(),h),clearAll:A,moveDraft:R,forTarget:y,retainForSubmission:O,consume:q,openPreview:_}}const Xe=new Set(["STARTING","RUNNING","CANCELLING"]);function Cp(e){const n=G([]),t=G(),o=new Set,a=new Set,r=new Set,i=new Map;function c(_){const y=n.value.find(T=>T.id===_.id),w=Ht(y,_);return n.value=[w,...n.value.filter(T=>T.id!==_.id)],w}function g(_){n.value=[..._]}function v(_){n.value=n.value.map(y=>y.id===_.id?_:y)}function m(_){const y=new Map(n.value.map(I=>[I.id,I])),w=new Set(_.map(I=>I.id));for(const I of _)He(I.status)&&i.delete(I.id);const M=_.filter(I=>!Xe.has(I.status)||!a.has(I.sessionId??"")&&!i.has(I.id)).map(I=>Ht(y.get(I.id),I)),h=n.value.filter(I=>I.sessionId===e.value&&!w.has(I.id)&&Xe.has(I.status));n.value=[...h,...M];for(const I of n.value)I.sessionId!==void 0&&Xe.has(I.status)&&o.delete(I.sessionId)}function p(_,y){for(const b of _){const D=i.get(b.id);D!==void 0&&!D.requested&&D.sessionId===b.sessionId&&Xe.has(b.status)&&!r.has(D.sessionId)&&!a.has(D.sessionId)&&i.delete(b.id)}const w=new Map(y.map(b=>[b.id,b])),T=new Map(n.value.map(b=>[b.id,b])),M=new Set(_.map(b=>b.id)),h=n.value.filter(b=>{if(M.has(b.id))return!1;const D=w.get(b.id);return D===void 0||b.sessionId!==D.sessionId||b.workspaceId!==D.workspaceId||b.version!==D.version||b.status!==D.status||b.recoveryState!==D.recoveryState||b.clientMessageId!==D.clientMessageId||b.createdAt!==D.createdAt}),H=_.filter(b=>!Xe.has(b.status)||!a.has(b.sessionId??"")&&!i.has(b.id)).map(b=>Ht(T.get(b.id),b)),Q=new Set(h.map(b=>b.id)),Y=y.filter(b=>!M.has(b.id)&&!Q.has(b.id));n.value=[...h,...H],t.value!==void 0&&!n.value.some(b=>b.id===t.value&&Xe.has(b.status))&&(t.value=void 0);for(const b of _)He(b.status)&&i.delete(b.id);for(const b of Y)i.delete(b.id);for(const b of n.value)b.sessionId!==void 0&&Xe.has(b.status)&&o.delete(b.sessionId)}function C(_,y){y!==void 0&&!o.has(_)||(o.add(_),y!==void 0&&(a.delete(_),i.set(y,{sessionId:_,requested:!0})))}function x(_){o.add(_),a.add(_),r.add(_);for(const y of i.values())y.sessionId===_&&(y.requested=!0)}function L(_,y=!1){const w=new Set(n.value.filter(T=>T.sessionId===_&&Xe.has(T.status)).map(T=>T.id));w.size>0&&(n.value=n.value.filter(T=>!w.has(T.id))),t.value!==void 0&&w.has(t.value)&&(t.value=void 0),w.size>0&&o.add(_),y&&x(_);for(const T of w)i.set(T,{sessionId:_,requested:r.has(_)||i.get(T)?.requested===!0});return w.size>0}function A(_){r.has(_)||o.delete(_)}function R(_){o.delete(_),a.delete(_),r.delete(_);for(const[y,w]of i)w.sessionId===_&&i.delete(y)}function O(_){o.delete(_),a.delete(_),r.delete(_)}function q(_){return _!==void 0&&o.has(_)}return{runs:n,selectedRunId:t,acceptRun:c,replaceRuns:g,replaceExistingRun:v,mergeSnapshots:m,mergeAuthoritativeSnapshot:p,markSessionInterrupted:C,markSessionInterruptionPending:x,settleSessionRuns:L,observeSessionRunning:A,clearSessionInterruption:R,resumeSessionAfterInterruption:O,sessionInterruptionSettled:q}}function wp(e){const n=G(),t=G(),o=e?.draft??G(),a=X({get:()=>o.value?.content??"",set:g=>{o.value!==void 0&&(o.value={...o.value,content:g},e?.persist())}});function r(g){if(t.value=g.queueItemId,o.value?.queueItemId===g.queueItemId)return;const v=to(g.content),m=v.flatMap(x=>x.kind==="text"?[x.text]:x.kind==="mar_steer"?[x.payload.message]:[]).join("").trim(),p=v.filter(x=>x.kind!=="text"&&x.kind!=="mar_steer"&&x.kind!=="mar_session_origin"&&x.kind!=="mar_channel").map(x=>x.raw).join(`
|
|
3
3
|
`),C=v.filter(x=>x.kind==="mar_session_origin"||x.kind==="mar_channel").map(x=>x.raw).join(`
|
|
4
4
|
`);o.value={queueItemId:g.queueItemId,content:m,tags:p,origin:C},e?.persist()}function i(){o.value?.queueItemId===t.value&&(o.value=void 0,e?.persist()),t.value=void 0}function c(){n.value=void 0,t.value=o.value?.queueItemId}return{draggingQueueItemId:n,editingQueueItemId:t,editingContent:a,startEditing:r,finishEditing:i,rebind:c,serializeEditedContent:g=>[o.value?.origin,g.trim(),o.value?.tags].filter(Boolean).join(`
|
package/web/assets/{workbench-live-service-CVWDCGSd.js → workbench-live-service-DBtv0ElZ.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as J,a as q,b as U,c as _,d as B,f as x,g as j,h as G,i as V,j as F}from"./index-
|
|
1
|
+
import{r as J,a as q,b as U,c as _,d as B,f as x,g as j,h as G,i as V,j as F}from"./index-B0EMFtj6.js";const z=1e4;function K(n){const i=new Map,I=new Set;let s,o,l=500,k=!1,g,m,y=!1;const c=x(!1);let d,v,P=0;const f=new Map;function S(){v!==void 0&&clearInterval(v),v=void 0,f.clear()}function N(){if(s===void 0||s.readyState!==WebSocket.OPEN)return;if(f.size>0){w();return}const t=String(++P);f.set(t,performance.now()),s.send(JSON.stringify({type:"ping",id:t}))}function R(){S(),N(),v=setInterval(N,z)}function D(){const t=new URL(n.endpoint?.()??"/api/workbench/live",window.location.origin);return t.protocol=t.protocol==="https:"?"wss:":"ws:",t.toString()}function M(){}function b(){if(c.value)return Promise.resolve(!0);if(d===void 0){let t;d={promise:new Promise(a=>{t=a}),resolve:t}}return d.promise}function p(t){const e=d;d=void 0,e?.resolve(t)}function E(t){if(typeof t!="object"||t===null||Array.isArray(t))return;const e=t;if(e.type==="workbench.ready"&&typeof e.workbenchConnectionId=="string"&&typeof e.workbenchResumeToken=="string"){n.diagnostics?.setConnectionState("connected"),g=e.workbenchConnectionId,m=e.workbenchResumeToken;const r=e.resumed===!0;c.value=!0,n.onReady?.(g,r),p(!0),y&&n.onConnectionRestored?.(r),y&&r&&n.onReconnect(),y=!1,R();return}if(e.type==="pong"&&typeof e.id=="string"){const r=f.get(e.id);r!==void 0&&(f.delete(e.id),n.diagnostics?.setPingLatency?.(performance.now()-r));return}if(e.type==="watch.event"&&e.event!==void 0){n.onWatchEvent?.(e.event);return}if(typeof e.type=="string"&&e.type.startsWith("direct.")){const r=j.safeParse(e);if(!r.success){n.onInvalidMessage();return}n.onDirectMessage?.(r.data);return}if(typeof e.type=="string"&&e.type.startsWith("terminal.direct.")){const r=G.safeParse(e);if(!r.success){n.onInvalidMessage();return}n.onTerminalDirectMessage?.(r.data);return}if(typeof e.type=="string"&&e.type.startsWith("desktop.direct.")){const r=V.safeParse(e);r.success?n.onDesktopDirectMessage?.(r.data):n.onInvalidMessage();return}if(typeof e.type=="string"&&e.type.startsWith("desktop.relay.")){const r=F.safeParse(e);r.success?n.onDesktopRelayMessage?.(r.data):n.onInvalidMessage();return}if(n.onNotificationMessage?.(e))return;if(e.type==="resync-required"&&typeof e.nodeId=="string"){n.diagnostics?.resetActiveRuns(),i.delete(e.nodeId),n.onResyncRequired(e.nodeId);return}if(e.type==="node.upgrade"&&typeof e.nodeId=="string"){n.onNodeUpgrade?.(e.nodeId,e.snapshot);return}if(e.type==="node"&&typeof e.nodeId=="string"&&typeof e.connected=="boolean"){let r=!1;e.connected?I.delete(e.nodeId)&&(i.delete(e.nodeId),r=!0):(I.add(e.nodeId),i.delete(e.nodeId)),n.onNodeConnection(e.nodeId,e.connected),e.reason==="CONNECTION_REPLACED"&&(n.diagnostics?.resetActiveRuns(),i.delete(e.nodeId),n.onNodeReplaced(e.nodeId),r=!0),r&&n.onResyncRequired(e.nodeId);return}if(e.type!=="event"||typeof e.event!="object"||e.event===null)return;const a=e.event;if(typeof a.nodeId!="string"||!Number.isInteger(a.sequence)||typeof a.category!="string")return;const u=a.sequence;u<=(i.get(a.nodeId)??0)||(i.set(a.nodeId,u),n.onEvent(a))}function h(){if(!n.canConnect()||s!==void 0)return;n.diagnostics?.setConnectionState("connecting");const t=new WebSocket(D());s=t,t.addEventListener("open",()=>{if(s!==t)return;const e=k;k=!0,l=500,i.clear(),y=e,c.value=!1,t.send(JSON.stringify({type:"resume",...g===void 0?{}:{workbenchConnectionId:g},...m===void 0?{}:{workbenchResumeToken:m}}))}),t.addEventListener("message",e=>{if(s!==t)return;const a=performance.now(),u=String(e.data);let r;try{r=JSON.parse(u),E(r)}catch{n.onInvalidMessage()}finally{n.diagnostics?.observeFrame({bytes:u.length,durationMs:performance.now()-a,message:r})}}),t.addEventListener("close",e=>{if(s===t){if(s=void 0,c.value=!1,S(),n.diagnostics?.setConnectionState("disconnected"),e.code===4001&&e.reason==="UNAUTHENTICATED"){p(!1),n.onUnauthenticated(),n.onDisconnected?.();return}if(n.onDisconnected?.(),!n.canConnect()){p(!1);return}o=setTimeout(()=>{o=void 0,h()},l),l=Math.min(l*2,3e4)}})}function C(){o!==void 0&&clearTimeout(o),o=void 0;const t=s;s=void 0,c.value=!1,p(!1),S(),n.diagnostics?.setConnectionState("disconnected"),t?.close(1e3,"PAGE_CLOSED")}function w(){if(!n.canConnect())return;o!==void 0&&clearTimeout(o),o=void 0;const t=s;s=void 0,c.value=!1,S(),n.diagnostics?.setConnectionState("connecting"),t?.close(4e3,"PAGE_VISIBLE_RECONNECT"),h()}function O(t){const e=B.safeParse(t);return!e.success||!c.value||s===void 0||s.readyState!==WebSocket.OPEN?!1:(s.send(JSON.stringify(e.data)),!0)}function T(t){const e=_.safeParse(t);return!e.success||!c.value||s===void 0||s.readyState!==WebSocket.OPEN?!1:(s.send(JSON.stringify(e.data)),!0)}function W(t){const e=U.safeParse(t);return!e.success||!c.value||s?.readyState!==WebSocket.OPEN?!1:(s.send(JSON.stringify(e.data)),!0)}function A(t){const e=q.safeParse(t);return!e.success||!c.value||s?.readyState!==WebSocket.OPEN?!1:(s.send(JSON.stringify(e.data)),!0)}function L(t){c.value&&s?.readyState===WebSocket.OPEN&&s.send(JSON.stringify({type:"session-share.visitor",visitor:t}))}return{connected:J(c),waitForReady:b,restore:M,connect:h,reconnect:w,close:C,sendDirect:O,sendTerminalDirect:T,sendDesktopDirect:W,sendDesktopRelay:A,updateShareVisitor:L}}export{K as c};
|