@myagentroam/server 0.13.4 → 0.13.6
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/dist/quick-start/node-runtime.js +21 -3
- package/dist/quick-start/run.js +11 -2
- package/node_modules/@myagentroam/protocol/package.json +1 -1
- package/node_modules/@myagentroam/server-core/dist/mcp-service.js +5 -3
- package/node_modules/@myagentroam/server-core/dist/mysql-node-identity.d.ts +5 -0
- package/node_modules/@myagentroam/server-core/dist/mysql-node-identity.js +31 -0
- package/node_modules/@myagentroam/server-core/dist/skill-source-service.js +5 -3
- package/node_modules/@myagentroam/server-core/package.json +2 -2
- package/node_modules/@myagentroam-enterprise/server-implementation/dist/cli-messages.en-US.d.ts +1 -0
- package/node_modules/@myagentroam-enterprise/server-implementation/dist/cli-messages.en-US.js +1 -0
- package/node_modules/@myagentroam-enterprise/server-implementation/dist/cli-messages.zh-CN.d.ts +1 -0
- package/node_modules/@myagentroam-enterprise/server-implementation/dist/cli-messages.zh-CN.js +1 -0
- package/node_modules/@myagentroam-enterprise/server-implementation/dist/composition/quick-start-node-bootstrap.d.ts +5 -1
- package/node_modules/@myagentroam-enterprise/server-implementation/dist/composition/quick-start-node-bootstrap.js +9 -1
- package/node_modules/@myagentroam-enterprise/server-implementation/dist/composition/server-application.js +1 -0
- package/node_modules/@myagentroam-enterprise/server-implementation/dist/license/management-gate.js +3 -2
- package/node_modules/@myagentroam-enterprise/server-implementation/dist/mysql/server-database.d.ts +4 -0
- package/node_modules/@myagentroam-enterprise/server-implementation/dist/mysql/server-database.js +3 -0
- package/node_modules/@myagentroam-enterprise/server-implementation/dist/rbac/authorization-service.js +7 -1
- package/node_modules/@myagentroam-enterprise/server-implementation/package.json +3 -3
- package/package.json +6 -6
- package/web/assets/{AuditManagementPage-DnsGADhX.js → AuditManagementPage-DdhzZJJz.js} +1 -1
- package/web/assets/{BusyIndicator-DuQN1wm-.js → BusyIndicator-DJEYrwl2.js} +1 -1
- package/web/assets/{CodeFileEditor-BIIXeX-W.js → CodeFileEditor-t-S2RxFj.js} +3 -3
- package/web/assets/{ConversationTemplateManagementPage-Bo4oyW8_.js → ConversationTemplateManagementPage-8cWdT1rl.js} +1 -1
- package/web/assets/{ConversationTemplateManagementPage-Cq610Ift.js → ConversationTemplateManagementPage-DtnCxKPr.js} +1 -1
- package/web/assets/{EnterpriseUserManagementPage-CaTrDqbs.js → EnterpriseUserManagementPage-CVpJzsVL.js} +1 -1
- package/web/assets/{EnvironmentSecretManager-BsrTY2rn.js → EnvironmentSecretManager-DaMtII6x.js} +1 -1
- package/web/assets/{FilePreviewLoading-RwWQoi6Y.js → FilePreviewLoading-CqXCVUDH.js} +1 -1
- package/web/assets/{HtmlPreviewFrame-ClcGdqP1.js → HtmlPreviewFrame-xgqXo3bD.js} +4 -4
- package/web/assets/{LicenseManagementPage-7_EsyrhF.js → LicenseManagementPage-C-25sen8.js} +1 -1
- package/web/assets/{ManagementPagination-2xmt9Zfx.js → ManagementPagination-BwZo73aV.js} +1 -1
- package/web/assets/{MarAgentModelManagementPage-CjMpM_RC.js → MarAgentModelManagementPage-B9lHTQtV.js} +1 -1
- package/web/assets/{MarAgentModelManagementPage-B5_l5kMw.js → MarAgentModelManagementPage-DkncBptD.js} +1 -1
- package/web/assets/{MarIcon-Bey6vvFS.js → MarIcon-0cJTzTai.js} +1 -1
- package/web/assets/{MarkdownFilePreview-DroSJppq.js → MarkdownFilePreview-CnWvYfKN.js} +2 -2
- package/web/assets/{McpDetailsDialog-BrklXkCL.js → McpDetailsDialog-nt3by9E1.js} +1 -1
- package/web/assets/{McpSourceManagementPage-BBw8Fnb7.js → McpSourceManagementPage-BVjVO0Tb.js} +1 -1
- package/web/assets/{McpSourceManagementPage-CCugQvg2.js → McpSourceManagementPage-Bg2wxoSB.js} +1 -1
- package/web/assets/{NodeDetailsDialogs-U0lssvGT.js → NodeDetailsDialogs-D4wBwUzA.js} +1 -1
- package/web/assets/NodeManagementPage-C1Cj7rex.js +1 -0
- package/web/assets/NodeManagementPage-DRBCipFy.js +1 -0
- package/web/assets/{OAuthManagementPage-BeiBNSsN.js → OAuthManagementPage-D9cBB-vX.js} +1 -1
- package/web/assets/{OrganizationManagementPage-CS9sBwhZ.js → OrganizationManagementPage-N8HwbTY5.js} +1 -1
- package/web/assets/{ResourceManagementPanel-Ck53eFHZ.js → ResourceManagementPanel-D80V3ZdZ.js} +1 -1
- package/web/assets/{ResourceManagementPanel.vue_vue_type_script_setup_true_lang-D1vZJR_l.js → ResourceManagementPanel.vue_vue_type_script_setup_true_lang-DfCWa6fA.js} +1 -1
- package/web/assets/SecretManagementPage-BDo50Fo5.js +1 -0
- package/web/assets/{SecretManagementPage-CkoIPpRk.js → SecretManagementPage-tsgbjSvn.js} +1 -1
- package/web/assets/{SecretManagementPage.vue_vue_type_script_setup_true_lang-Bq3JYt0N.js → SecretManagementPage.vue_vue_type_script_setup_true_lang-CmSoYQ3n.js} +1 -1
- package/web/assets/{SessionSharePage-UYao-99J.js → SessionSharePage-whJFT3cw.js} +2 -2
- package/web/assets/{SettingsContent-CxwrhDv3.js → SettingsContent-Dsw7sGr4.js} +1 -1
- package/web/assets/{SettingsContent-Cdhq2mMs.js → SettingsContent-WLH3DkgW.js} +1 -1
- package/web/assets/SkillCenterPage-Dl-aKzxp.js +1 -0
- package/web/assets/{SkillCenterPage-7USQN-DP.js → SkillCenterPage-yDU-t2cT.js} +1 -1
- package/web/assets/{SkillDetailsDialog-BsiPRfbz.js → SkillDetailsDialog-BUfNxAjf.js} +1 -1
- package/web/assets/{SkillSourceManagementPage-DFnaYnRe.js → SkillSourceManagementPage-B7yjgXR8.js} +1 -1
- package/web/assets/{SkillSourceManagementPage-BvOdElvU.js → SkillSourceManagementPage-BCHgTDXJ.js} +1 -1
- package/web/assets/{StandaloneFilePreviewPage-Cb1MpQfh.js → StandaloneFilePreviewPage-b-piNuN1.js} +1 -1
- package/web/assets/{SystemConfigurationPage-DME6cns0.js → SystemConfigurationPage-C2Ecb0Su.js} +1 -1
- package/web/assets/SystemConfigurationPage-CUI3Icws.js +1 -0
- package/web/assets/{SystemInformationPage-DGZWfrXE.js → SystemInformationPage-CBWjqG43.js} +1 -1
- package/web/assets/{TerminalTabView-CuQzSev1.js → TerminalTabView-CeX2SVcm.js} +1 -1
- package/web/assets/{WorkbenchPage-B7W9kyOw.js → WorkbenchPage-D4X4qerH.js} +4 -4
- package/web/assets/WorkspaceManagementPage-0uM3HF3o.js +1 -0
- package/web/assets/WorkspaceManagementPage-DlcAgYsx.js +1 -0
- package/web/assets/{_baseIteratee-3ynz4yPF.js → _baseIteratee-CnCgfzqY.js} +1 -1
- package/web/assets/{abnfDiagram-VCTEODGH-DupmQ6Er.js → abnfDiagram-VCTEODGH-C8MLlCYr.js} +1 -1
- package/web/assets/{advancedFormat-Bqm4Kq1b.js → advancedFormat-tqE8I04X.js} +1 -1
- package/web/assets/{arc-Fq0BJf1Q.js → arc-ChGPMlfM.js} +1 -1
- package/web/assets/{architectureDiagram-5GKGNRK7-B4EFAJN2.js → architectureDiagram-5GKGNRK7-UNKWS80q.js} +1 -1
- package/web/assets/{blockDiagram-OSKFZWR5-B75Yxltl.js → blockDiagram-OSKFZWR5-DaoKTWzi.js} +1 -1
- package/web/assets/{c4Diagram-7LVT6UL2-2IJLHGl0.js → c4Diagram-7LVT6UL2-DeJ38tJ4.js} +1 -1
- package/web/assets/{catalog-ownership-service-BMQL4KAM.js → catalog-ownership-service-ppl9SdO8.js} +1 -1
- package/web/assets/{catalog-page-service-Cnb4fp1m.js → catalog-page-service-CA6TP1Er.js} +1 -1
- package/web/assets/channel-D5Au5X55.js +1 -0
- package/web/assets/{chunk-2Q5K7J3B-BbIlpi0m.js → chunk-2Q5K7J3B-Cie4-T_4.js} +1 -1
- package/web/assets/{chunk-5VM5RSS4-Ds5gdCgX.js → chunk-5VM5RSS4-C02e2HuJ.js} +1 -1
- package/web/assets/{chunk-F27PBJKO-DBafPcM9.js → chunk-F27PBJKO-CYE4axjh.js} +1 -1
- package/web/assets/{chunk-HLEWEB6X-Ctl85JUs.js → chunk-HLEWEB6X-Qcd3DJvW.js} +1 -1
- package/web/assets/{chunk-JWPE2WC7-Df0cT3j7.js → chunk-JWPE2WC7-BIlv53mX.js} +1 -1
- package/web/assets/{chunk-POPQ4Y6H-OSXerjxo.js → chunk-POPQ4Y6H-C1FzI22y.js} +1 -1
- package/web/assets/{chunk-SVP7TREG-4azsKQ7R.js → chunk-SVP7TREG-B5A4JoXo.js} +1 -1
- package/web/assets/{chunk-XXDRQBXY-RCyyudHN.js → chunk-XXDRQBXY-FdosaHEW.js} +1 -1
- package/web/assets/{chunk-ZLD2IHE6-CE_CQEwa.js → chunk-ZLD2IHE6-BzhAoouo.js} +1 -1
- package/web/assets/classDiagram-CYGNFDIV-CplRLUOK.js +1 -0
- package/web/assets/classDiagram-v2-TLXNO2FR-CplRLUOK.js +1 -0
- package/web/assets/{conversation-history-CUVjobW9.js → conversation-history-D9993EDO.js} +1 -1
- package/web/assets/{cose-bilkent-JH36ORCC-B4UTqEAs.js → cose-bilkent-JH36ORCC-C4ZjK8dC.js} +1 -1
- package/web/assets/{cynefin-OW5HDTMX-B9U7i_AE.js → cynefin-OW5HDTMX-D-6QhPjX.js} +1 -1
- package/web/assets/{cynefinDiagram-5FMLGOSQ-DjOvM95v.js → cynefinDiagram-5FMLGOSQ-Bwsk5LdU.js} +1 -1
- package/web/assets/{dagre-OS7QT2EB-DC57hRv_.js → dagre-OS7QT2EB-DoA_-lbd.js} +1 -1
- package/web/assets/{diagram-S7CK7UJ4-D6mHX9Fx.js → diagram-S7CK7UJ4-sgObxZyi.js} +1 -1
- package/web/assets/{diagram-UQ7AKVKN-B2kIa0Jp.js → diagram-UQ7AKVKN-BdMjAaVk.js} +1 -1
- package/web/assets/{diagram-VSXAHHWV-Bxv36NlF.js → diagram-VSXAHHWV-BCH9zwo1.js} +1 -1
- package/web/assets/{diagram-VX7I27RA-xZ_Rnq6j.js → diagram-VX7I27RA-Z6LSJKeQ.js} +1 -1
- package/web/assets/{diagram-Z3DM3KII-CdSuHCfk.js → diagram-Z3DM3KII-CcbM5hsL.js} +1 -1
- package/web/assets/{ebnfDiagram-PWID7BFC-yx8cKpo-.js → ebnfDiagram-PWID7BFC-CWP32uDq.js} +1 -1
- package/web/assets/{el-alert-YwFfkzFY.js → el-alert-8VKFJYUv.js} +1 -1
- package/web/assets/{el-cascader-DLHPkFf2.js → el-cascader-CJR-DJLi.js} +1 -1
- package/web/assets/{el-checkbox-D7B8QPnv.js → el-checkbox-D7CsqiQq.js} +1 -1
- package/web/assets/{el-date-picker-3YbpvR4-.js → el-date-picker-Lb4E2Nje.js} +1 -1
- package/web/assets/{el-descriptions-pbjjg_nj.js → el-descriptions-B48GJeGA.js} +1 -1
- package/web/assets/{el-form-item-C0hI6zRh.js → el-form-item-Fjp3w344.js} +1 -1
- package/web/assets/{el-input-BBSbjFbs.js → el-input-DRF3bOe1.js} +1 -1
- package/web/assets/{el-input-number-BD9kOXXp.js → el-input-number-e6T9QIje.js} +1 -1
- package/web/assets/{el-radio-ByQM3NKI.js → el-radio-DO8joult.js} +1 -1
- package/web/assets/{el-select-BEIvaLbl.js → el-select-BSaB1c5h.js} +1 -1
- package/web/assets/{el-switch-DNSjKrx8.js → el-switch-Cpl2xxJc.js} +1 -1
- package/web/assets/{el-tab-pane-P1W8N6RB.js → el-tab-pane-CQyfpTgD.js} +1 -1
- package/web/assets/{el-table-column-BkxhVRss.js → el-table-column-BRybrdLI.js} +1 -1
- package/web/assets/{enterprise-management-service-C_5GRorU.js → enterprise-management-service-Qtmnf50C.js} +1 -1
- package/web/assets/{erDiagram-2YWLMYGG-CysMQY_a.js → erDiagram-2YWLMYGG-BOtd6Wuq.js} +1 -1
- package/web/assets/{error-presentation-CMcHjWH1.js → error-presentation-CJfLHEK_.js} +1 -1
- package/web/assets/{flowDiagram-T62WH6J4-D3EWUl6L.js → flowDiagram-T62WH6J4-DGRqBn-8.js} +1 -1
- package/web/assets/{ganttDiagram-EL5Y4UJY-D8p3UoZQ.js → ganttDiagram-EL5Y4UJY-D84r1V0Q.js} +1 -1
- package/web/assets/{gitGraphDiagram-WWUBYQGX-DOStzbFz.js → gitGraphDiagram-WWUBYQGX-FANv-qDA.js} +1 -1
- package/web/assets/{hosted-conversation-template-client-D4Wn8q89.js → hosted-conversation-template-client-CeOnupVC.js} +1 -1
- package/web/assets/{index-BLspLxxD.js → index-9ks2AQTi.js} +1 -1
- package/web/assets/{index-bl_S7WPN.js → index-B0P8j1yb.js} +1 -1
- package/web/assets/{index-DuKtBO_u.js → index-B7tnVSor.js} +1 -1
- package/web/assets/{index-ft9uuHSX.js → index-B8rWDVmR.js} +1 -1
- package/web/assets/{index-BwULrRvu.js → index-BOhe9vs1.js} +1 -1
- package/web/assets/{index-DLalpHzD.js → index-BYYx_GrI.js} +1 -1
- package/web/assets/{index-eJcmffyl.js → index-BeipYJv6.js} +1 -1
- package/web/assets/{index-CYeXhiRu.js → index-BkC7CnZA.js} +1 -1
- package/web/assets/{index-DW6tcz5Z.js → index-Bokwz5PA.js} +1 -1
- package/web/assets/{index-DswoMecP.js → index-BsG4OGs3.js} +1 -1
- package/web/assets/{index-0Qtks3Zu.js → index-C8DbmG_l.js} +1 -1
- package/web/assets/{index-m9YdF02w.js → index-C90_sIrz.js} +1 -1
- package/web/assets/{index-DkfdzgTk.js → index-CBs38naL.js} +1 -1
- package/web/assets/{index-DbuM3bO4.js → index-C_EAvnDF.js} +1 -1
- package/web/assets/{index-dMLXuty7.js → index-C_F0LgDO.js} +1 -1
- package/web/assets/{index-DrVPbxCP.js → index-D6945seh.js} +1 -1
- package/web/assets/{index-C4XljgeB.js → index-DGlioDXJ.js} +1 -1
- package/web/assets/{index-CGPHfg1G.js → index-DU209g6d.js} +1 -1
- package/web/assets/{index-BCZqekVb.js → index-DsgwAvJA.js} +3 -3
- package/web/assets/{index-D8dMhcz9.js → index-DwQqO2fH.js} +1 -1
- package/web/assets/{index-DTE-qCKl.js → index-NReuiFej.js} +1 -1
- package/web/assets/{index-CiC8263F.js → index-Tv4HGgSj.js} +1 -1
- package/web/assets/{index-Df8FjIGd.js → index-W6jp3JVA.js} +1 -1
- package/web/assets/{index-B35Hh-19.js → index-eU6FSd70.js} +1 -1
- package/web/assets/{index-CwiFFfS1.js → index-hP6Cb_NE.js} +1 -1
- package/web/assets/{index-CM_0TkoS.js → index-sctirQW0.js} +1 -1
- package/web/assets/{index-CvclBhn2.js → index-x2OEXKrc.js} +1 -1
- package/web/assets/{index-nTguJepi.js → index-x9JuBH-H.js} +1 -1
- package/web/assets/{index-B26xf70t.js → index-zG9SJlS3.js} +1 -1
- package/web/assets/infoDiagram-FKFFQAWI-ZeaWiVDx.js +2 -0
- package/web/assets/{isArrayLikeObject-DBTZh06Y.js → isArrayLikeObject-Bg1E4S9y.js} +1 -1
- package/web/assets/{ishikawaDiagram-5VMMS53U-KdtSHy0d.js → ishikawaDiagram-5VMMS53U-B0FDzCa4.js} +1 -1
- package/web/assets/{journeyDiagram-EYS64GPL-BWm62hPR.js → journeyDiagram-EYS64GPL-CIM_LxZU.js} +1 -1
- package/web/assets/{kanban-definition-UXKFOSKX-97_o1WCj.js → kanban-definition-UXKFOSKX-DKxBi_r0.js} +1 -1
- package/web/assets/{layout-6_PY2p7c.js → layout-DU0JsES_.js} +1 -1
- package/web/assets/{linear-BT7Hx9AK.js → linear-C3UCzYem.js} +1 -1
- package/web/assets/{management-url-service-B2_kg7lH.js → management-url-service-DsBUOSH4.js} +1 -1
- package/web/assets/{mcp-center-service-Cvb3tmP2.js → mcp-center-service-BluNkyx-.js} +1 -1
- package/web/assets/{merge-DaI_T8rv.js → merge-B-E3iBqN.js} +1 -1
- package/web/assets/{mermaid.core-DL0NmHpa.js → mermaid.core-CMc9IFVw.js} +5 -5
- package/web/assets/{message-box-service-Vs92kolE.js → message-box-service-CszgyilP.js} +1 -1
- package/web/assets/{mindmap-definition-THT77NOG-CAPKaXNd.js → mindmap-definition-THT77NOG-BJyPV49z.js} +1 -1
- package/web/assets/{mobile-dialog-return-service-3QafxIkr.js → mobile-dialog-return-service-Csexw-by.js} +1 -1
- package/web/assets/{oauth-callback-BlSeaEf-.js → oauth-callback-3M1eIOPT.js} +1 -1
- package/web/assets/{pegDiagram-XKGWAZYB-hJB71Znn.js → pegDiagram-XKGWAZYB-jpfn2XMn.js} +1 -1
- package/web/assets/{pieDiagram-E7YTZNPT-COeAYSnz.js → pieDiagram-E7YTZNPT-B2jQ3Egj.js} +1 -1
- package/web/assets/{quadrantDiagram-AXDQQJYC-DHTuVvw3.js → quadrantDiagram-AXDQQJYC-BXSOa8Vi.js} +1 -1
- package/web/assets/{railroadDiagram-O6MQD6OU-bKHrlAIG.js → railroadDiagram-O6MQD6OU-BTy8Z6ZL.js} +1 -1
- package/web/assets/{requirementDiagram-IS5BZ75X--2VkiRxe.js → requirementDiagram-IS5BZ75X-eqVPnJ-z.js} +1 -1
- package/web/assets/{runner-presentation-BW-vKSQP.js → runner-presentation-D66Z9p-O.js} +1 -1
- package/web/assets/{sankeyDiagram-P5KCCOFB-k5g8_UfF.js → sankeyDiagram-P5KCCOFB-BI5fAwMJ.js} +1 -1
- package/web/assets/{sequenceDiagram-WJ2MYXX4-3T1cTiKX.js → sequenceDiagram-WJ2MYXX4-CZ7Un31z.js} +1 -1
- package/web/assets/{session-share-client-service-BePcCd8T.js → session-share-client-service-W0XDwceC.js} +1 -1
- package/web/assets/{sizeCapture-INFHLROL-CAmN45ar.js → sizeCapture-INFHLROL-7gQRW3HD.js} +1 -1
- package/web/assets/{stateDiagram-XQSTLZYL-DyCNMKfm.js → stateDiagram-XQSTLZYL-D23AlrmH.js} +1 -1
- package/web/assets/stateDiagram-v2-IH3M54BS-D93lsHZ8.js +1 -0
- package/web/assets/{swimlanes-V6O3JKXN-CShGr_U7.js → swimlanes-V6O3JKXN-By9JzeNC.js} +1 -1
- package/web/assets/swimlanesDiagram-JKAHXJPX-C3UEWonA.js +8 -0
- package/web/assets/{time-presentation-DYGS-swy.js → time-presentation-BRvT6nTd.js} +1 -1
- package/web/assets/{timeline-definition-24CTP7MA-CRagiyPI.js → timeline-definition-24CTP7MA-CyydVD-f.js} +1 -1
- package/web/assets/{union-SQqiJk16.js → union-BSveQIrm.js} +1 -1
- package/web/assets/{use-form-common-props-CiMdMq_M.js → use-form-common-props-BJ2vZd_0.js} +1 -1
- package/web/assets/{use-wheel-BGpTGiSt.js → use-wheel-TWRoHAF5.js} +1 -1
- package/web/assets/{vennDiagram-4TSXK5OY-_jtB4CJn.js → vennDiagram-4TSXK5OY-3OEbunrh.js} +1 -1
- package/web/assets/{wardleyDiagram-VM6X3IG4-Blsdb7g_.js → wardleyDiagram-VM6X3IG4-BuZvJTn0.js} +1 -1
- package/web/assets/{workbench-composer-interaction-controller-BvnJG4HW.js → workbench-composer-interaction-controller-BJZsGMk-.js} +1 -1
- package/web/assets/{workbench-presentation-b_MlZ-jq.js → workbench-presentation-DblBOxzZ.js} +1 -1
- package/web/assets/{xychartDiagram-S5SC5T6Z-BTu61LZj.js → xychartDiagram-S5SC5T6Z-CQzJStra.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 +5 -5
- 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/administration_license.md.Bf1iyuKG.js +1 -0
- package/web/docs/assets/{administration_license.md.CdgtKnVd.lean.js → administration_license.md.Bf1iyuKG.lean.js} +1 -1
- package/web/docs/assets/{app.DQ73g8Ca.js → app.DFdypnML.js} +1 -1
- package/web/docs/assets/chunks/@localSearchIndexen-US.BEf68FQA.js +1 -0
- package/web/docs/assets/chunks/@localSearchIndexroot.Dw4g7XXs.js +1 -0
- package/web/docs/assets/chunks/{VPLocalSearchBox.vP8fXe46.js → VPLocalSearchBox.P9CapR4-.js} +1 -1
- package/web/docs/assets/chunks/{theme.CES2lSYr.js → theme.DLnKtfGY.js} +2 -2
- package/web/docs/assets/en-US_administration_license.md.Dmg8rNEl.js +1 -0
- package/web/docs/assets/{en-US_administration_license.md.jmAMVJjC.lean.js → en-US_administration_license.md.Dmg8rNEl.lean.js} +1 -1
- package/web/docs/assets/{en-US_getting-started_npm-quick-start.md.CLCHq7k_.js → en-US_getting-started_npm-quick-start.md.Dwsi-ffA.js} +2 -2
- package/web/docs/assets/{en-US_getting-started_npm-quick-start.md.CLCHq7k_.lean.js → en-US_getting-started_npm-quick-start.md.Dwsi-ffA.lean.js} +1 -1
- package/web/docs/assets/en-US_workbench_skills.md.xchi27R9.js +1 -0
- package/web/docs/assets/{en-US_workbench_skills.md.C4xlXyjC.lean.js → en-US_workbench_skills.md.xchi27R9.lean.js} +1 -1
- package/web/docs/assets/{getting-started_npm-quick-start.md.B9varoSe.js → getting-started_npm-quick-start.md.CcxMwUgz.js} +2 -2
- package/web/docs/assets/{getting-started_npm-quick-start.md.B9varoSe.lean.js → getting-started_npm-quick-start.md.CcxMwUgz.lean.js} +1 -1
- package/web/docs/assets/workbench_skills.md.BQw1Wuiy.js +1 -0
- package/web/docs/assets/{workbench_skills.md.rWZ_VuoB.lean.js → workbench_skills.md.BQw1Wuiy.lean.js} +1 -1
- 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 +5 -5
- 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 +6 -6
- 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/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 +6 -6
- 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/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-8rxZ_6Zt.js +0 -1
- package/web/assets/NodeManagementPage-Ccod7oYU.js +0 -1
- package/web/assets/SecretManagementPage-CdgTv3Ov.js +0 -1
- package/web/assets/SkillCenterPage-93Mc7S1A.js +0 -1
- package/web/assets/SystemConfigurationPage-Dg5txhny.js +0 -1
- package/web/assets/WorkspaceManagementPage-D_xOZ93I.js +0 -1
- package/web/assets/WorkspaceManagementPage-K7-IdW3A.js +0 -1
- package/web/assets/channel-Df00MEsi.js +0 -1
- package/web/assets/classDiagram-CYGNFDIV-BkPukKVs.js +0 -1
- package/web/assets/classDiagram-v2-TLXNO2FR-BkPukKVs.js +0 -1
- package/web/assets/infoDiagram-FKFFQAWI-DMowyzbG.js +0 -2
- package/web/assets/stateDiagram-v2-IH3M54BS-BEZ0_9G2.js +0 -1
- package/web/assets/swimlanesDiagram-JKAHXJPX-2keKlibd.js +0 -8
- package/web/docs/assets/administration_license.md.CdgtKnVd.js +0 -1
- package/web/docs/assets/chunks/@localSearchIndexen-US.BmMs0yM1.js +0 -1
- package/web/docs/assets/chunks/@localSearchIndexroot.BUqMaw8-.js +0 -1
- package/web/docs/assets/en-US_administration_license.md.jmAMVJjC.js +0 -1
- package/web/docs/assets/en-US_workbench_skills.md.C4xlXyjC.js +0 -1
- package/web/docs/assets/workbench_skills.md.rWZ_VuoB.js +0 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{c as r,s as o}from"./flowDiagram-T62WH6J4-DGRqBn-8.js";import{_ as e}from"./mermaid.core-CMc9IFVw.js";import"./index-DsgwAvJA.js";import"./chunk-5VM5RSS4-C02e2HuJ.js";import"./chunk-XXDRQBXY-FdosaHEW.js";import"./chunk-POPQ4Y6H-C1FzI22y.js";import"./chunk-F27PBJKO-CYE4axjh.js";import"./FilePreviewLoading-CqXCVUDH.js";import"./use-form-common-props-BJ2vZd_0.js";import"./mobile-dialog-return-service-Csexw-by.js";import"./el-input-DRF3bOe1.js";import"./BusyIndicator-DJEYrwl2.js";import"./channel-D5Au5X55.js";import"./isArrayLikeObject-Bg1E4S9y.js";import"./_baseIteratee-CnCgfzqY.js";import"./union-BSveQIrm.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,x=r({defaultLayout:"swimlane",styles:i});export{x as diagram};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./index-
|
|
1
|
+
import"./index-DsgwAvJA.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-CMc9IFVw.js";import{d as ot}from"./arc-ChGPMlfM.js";import"./index-DsgwAvJA.js";import"./FilePreviewLoading-CqXCVUDH.js";import"./use-form-common-props-BJ2vZd_0.js";import"./mobile-dialog-return-service-Csexw-by.js";import"./el-input-DRF3bOe1.js";import"./BusyIndicator-DJEYrwl2.js";import"./isArrayLikeObject-Bg1E4S9y.js";import"./_baseIteratee-CnCgfzqY.js";import"./union-BSveQIrm.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{b6 as u,b7 as g,b8 as I,b9 as w,ba as A}from"./index-
|
|
1
|
+
import{b6 as u,b7 as g,b8 as I,b9 as w,ba as A}from"./index-DsgwAvJA.js";import{b as p,i as x}from"./isArrayLikeObject-Bg1E4S9y.js";import{b as N}from"./_baseFindIndex-D7XfJLKM.js";function R(){}function S(n){return n!==n}function m(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?m(n,e,t):N(n,S,t)}function O(n,e){var t=n==null?0:n.length;return!!t&&F(n,e,0)>-1}var d=1/0,v=u&&1/g(new u([,-0]))[1]==d?function(n){return new u(n)}:R,C=200;function E(n,e,t){var r=-1,o=O,h=n.length,b=!0,s=[],i=s;if(h>=C){var c=v(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 _=p(function(n){return E(A(n,1,x,!0))});export{_ as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as r,x as l,y as f,z as t,B as a,C as p,u as n,a as v}from"./index-
|
|
1
|
+
import{c as r,x as l,y as f,z as t,B as a,C as p,u as n,a as v}from"./index-DsgwAvJA.js";const i=s=>{const e=l();return r(()=>e?.proxy?.$props?.[s])},b=(s,e={})=>{const o=v(void 0),m=e.prop?o:i("size"),u=e.global?o:f(),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{i as c}from"./index-
|
|
1
|
+
import{i as c}from"./index-DsgwAvJA.js";import{c as h,r as d}from"./el-input-DRF3bOe1.js";const F=({atEndEdge:s,atStartEdge:f,layout:i},u)=>{let l,r=0;const o=e=>e<0&&f.value||e>0&&s.value;return{hasReachedEdge:o,onWheel:e=>{h(l);let{deltaX:n,deltaY:t}=e;e.shiftKey&&t!==0&&(n=t,t=0);const a=i.value==="horizontal"?n: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-DL0NmHpa.js";import"./index-BCZqekVb.js";import"./FilePreviewLoading-RwWQoi6Y.js";import"./use-form-common-props-CiMdMq_M.js";import"./mobile-dialog-return-service-3QafxIkr.js";import"./el-input-BBSbjFbs.js";import"./BusyIndicator-DuQN1wm-.js";import"./isArrayLikeObject-DBTZh06Y.js";import"./_baseIteratee-3ynz4yPF.js";import"./union-SQqiJk16.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-CMc9IFVw.js";import"./index-DsgwAvJA.js";import"./FilePreviewLoading-CqXCVUDH.js";import"./use-form-common-props-BJ2vZd_0.js";import"./mobile-dialog-return-service-Csexw-by.js";import"./el-input-DRF3bOe1.js";import"./BusyIndicator-DJEYrwl2.js";import"./isArrayLikeObject-Bg1E4S9y.js";import"./_baseIteratee-CnCgfzqY.js";import"./union-BSveQIrm.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(`
|
package/web/assets/{wardleyDiagram-VM6X3IG4-Blsdb7g_.js → wardleyDiagram-VM6X3IG4-BuZvJTn0.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as Mt}from"./chunk-JWPE2WC7-
|
|
1
|
+
import{p as Mt}from"./chunk-JWPE2WC7-BIlv53mX.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-CMc9IFVw.js";import{p as Rt}from"./cynefin-OW5HDTMX-D-6QhPjX.js";import"./index-DsgwAvJA.js";import"./FilePreviewLoading-CqXCVUDH.js";import"./use-form-common-props-BJ2vZd_0.js";import"./mobile-dialog-return-service-Csexw-by.js";import"./el-input-DRF3bOe1.js";import"./BusyIndicator-DJEYrwl2.js";import"./isArrayLikeObject-Bg1E4S9y.js";import"./_baseIteratee-CnCgfzqY.js";import"./union-BSveQIrm.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{t as l,A as ot,eB as wo,a0 as Ct,e as et,a as W,eC as Eo,w as Pe,X as Ne,c as X,eD as ln,eE as Io,s as Be,cd as Hn,eF as zn,eG as So,eH as Me,eI as xo,eJ as To,eK as cn,dO as Gn,ce as Ao,d as Se,co as Vn,aw as Zt,D as vt,Y as Ke,L as Ve,o as s,b as u,S as Ie,G as S,R as dn,u as d,g as se,v as k,E as be,p as re,q as _e,O as te,I as le,H as f,f as Ge,ae as Wn,_ as xe,eL as un,z as fn,eM as Po,dM as Ro,K as Pt,dz as Do,ad as ut,P as Ee,J as Fe,dP as $o,eN as Mo,r as gn,U as Et,b_ as Lo,bk as We,aK as Oo}from"./index-BCZqekVb.js";import{l as mn,i as No,r as jo,a as Uo,C as vn,b as hn,c as pn,m as qo,d as _n,e as wt,f as ge,g as Bo,h as Fo,j as Ho,k as bn,n as Nt,o as zo,p as Go}from"./conversation-history-CUVjobW9.js";import{E as Vo}from"./message-box-service-Vs92kolE.js";import{e as Kn}from"./error-presentation-CMcHjWH1.js";import{a as st,E as Qn}from"./el-input-BBSbjFbs.js";import{M as he}from"./MarIcon-Bey6vvFS.js";import{B as at}from"./BusyIndicator-DuQN1wm-.js";import{a as Wo,E as Ko}from"./el-checkbox-D7B8QPnv.js";import{a as Qo,E as Jo}from"./el-radio-ByQM3NKI.js";/* empty css */import{f as it,p as $t}from"./time-presentation-DYGS-swy.js";import{M as Yo,H as yn,t as Xo,A as kn,p as Zo,j as It,o as kt,q as en,r as Cn,h as ea,E as ta,g as na,F as oa}from"./FilePreviewLoading-RwWQoi6Y.js";import{E as aa,b as ia,a as ra}from"./el-select-BEIvaLbl.js";import{E as Jn,u as zt,m as Gt}from"./mobile-dialog-return-service-3QafxIkr.js";/* empty css */import{l as wn,r as En}from"./runner-presentation-BW-vKSQP.js";function Vt(e){const t=e.customTitle?.trim();if(t)return t;const n=e.runnerTitle?.trim();return n===void 0||n===""||n==="Untitled session"||n.toLocaleLowerCase()==="new session"?l("generated.sessionPresentation.newSession"):n}function Yn(e){return typeof e?.externalSessionId=="string"&&e.externalSessionId.length>0}function nv(e){return!Yn(e)}function ov(e){return e.trim().replace(/\s+/g," ").slice(0,160)}function Xn(e){return e.activity!==void 0?e.activity:"IDLE"}function av(e){return{MANAGED_ACTIVE:l("generated.sessionPresentation.managed"),IDLE:l("generated.sessionPresentation.ready")}[Xn(e)]}function sa(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 la=new Set(["PREPARING","RUNNING","WAITING_INPUT","WAITING_APPROVAL","SUCCEEDED","FAILED","CANCELLED","INTERRUPTED","LOST"]);function In(e){return e==null||typeof e=="number"&&Number.isInteger(e)&&e>=0}function ca(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=e;return typeof t.id=="string"&&t.id.length>0&&typeof t.kind=="string"&&t.kind.length>0&&typeof t.status=="string"&&t.status.length>0}function tn(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=e;return typeof t.id=="string"&&t.id.length>0&&typeof t.turnId=="string"&&t.turnId.length>0&&typeof t.sessionId=="string"&&t.sessionId.length>0&&(t.runId===null||typeof t.runId=="string"&&t.runId.length>0)&&typeof t.index=="number"&&Number.isInteger(t.index)&&t.index>=0&&typeof t.status=="string"&&la.has(t.status)&&Array.isArray(t.items)&&t.items.every(ca)&&In(t.startedAt)&&In(t.completedAt)}function Zn(e,t){if(typeof e!="object"||e===null||Array.isArray(e))return;const n=e;if(!(n.unit!=="SEGMENT"||!Array.isArray(n.segments)||!n.segments.every(tn)||new Set(n.segments.map(a=>a.sessionId)).size>1))return ct({unit:"SEGMENT",segments:n.segments,nextCursor:typeof n.nextCursor=="string"?n.nextCursor:null,...typeof n.snapshotSequence=="number"?{snapshotSequence:n.snapshotSequence}:t===void 0?{}:{snapshotSequence:t},...n.source==="official"||n.source==="native"||n.source==="runtime"?{source:n.source}:{},...typeof n.readAt=="number"?{readAt:n.readAt}:{},...typeof n.latestVisibleAt=="number"?{latestVisibleAt:n.latestVisibleAt}:{},...n.deferredOlderHistory===!0?{deferredOlderHistory:!0}:{}})}function ct(e){if(!Array.isArray(e.segments))throw new Error("The conversation history response contains no segments.");const t=e;if(!t.segments.every(tn))throw new Error("The conversation Segment response contains an invalid Segment.");return{...t,turns:t.segments.map(n=>({id:n.id,turnId:n.turnId,segmentIndex:n.index,sessionId:n.sessionId,runId:n.runId,status:n.status,...n.rewind===void 0?{}:{rewind:n.rewind},items:n.items,...n.startedAt===void 0?{}:{startedAt:n.startedAt},...n.completedAt===void 0?{}:{completedAt:n.completedAt}}))}}function jt(e,t){const n=[...e];for(const[o,a]of t.entries()){const r=n.findIndex(c=>c.id===a.id);if(r>=0){n.splice(r,1,a);continue}if(a.turnId!==void 0&&a.segmentIndex!==void 0){const c=n.findIndex(v=>v.turnId===a.turnId&&v.segmentIndex!==void 0&&v.segmentIndex>a.segmentIndex),m=n.findLastIndex(v=>v.turnId===a.turnId);if(c>=0||m>=0){n.splice(c>=0?c:m+1,0,a);continue}}const i=t.slice(o+1).find(c=>n.some(m=>m.id===c.id));if(i!==void 0){n.splice(n.findIndex(c=>c.id===i.id),0,a);continue}n.push(a)}return n}function eo(e,t,n){const o=e.findLastIndex(i=>i.runId===t&&(n===void 0||(i.turnId??i.id)===n));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===t&&(c.turnId??c.id)===a&&(c.segmentIndex??-1)>(e[r].segmentIndex??-1)&&(r=i);return r}function da(e,t,n){const o=eo(e,t);return e.map((a,r)=>r===o&&a.status!==n?{...a,status:n}:a)}function ua(e){let t,n,o,a,r,i=0,c=!1,m=!1,v=0;function g(){t!==void 0&&clearTimeout(t),o?.abort(new ot("WATCH_CANCELLED","The watch was stopped or replaced.")),t=void 0,o=void 0,n=void 0,a=void 0,r=void 0,i=0,c=!1,m=!1,v=0}function h(){t!==void 0&&clearTimeout(t),t=void 0,c=!0}async function w(U,H,p){const y=setTimeout(()=>p.abort(new ot("WATCH_REQUEST_TIMEOUT","The watch request timed out.")),e.requestTimeoutMs);try{if(await e.renew(U,p.signal,H),o!==p||a!==U)return;r=Date.now(),i=0,m=!1,v=0}catch(C){if(o!==p||a!==U)return;const A=p.signal.aborted&&C instanceof Error&&C.name==="AbortError"?p.signal.reason:C;if(e.recovery!==void 0&&(H==="renew"||m)){e.recovery.onFailure(A),H==="initial"&&(v+=1),!c&&e.recovery.retryable(A)&&v<e.maxFailures?m=!0:(h(),e.onExpired());return}if(H==="initial")throw c=!0,i=0,r=void 0,A;i+=1;const N=r!==void 0&&Date.now()-r>=e.confirmationTimeoutMs;(i>=e.maxFailures||N)&&(e.onExpired(),i=0,r=void 0)}finally{clearTimeout(y)}}function x(U,H){if(c||n!==void 0||a!==U||!e.eligible(U))return n;const p=new AbortController;o=p;const y=w(U,H,p).finally(()=>{n===y&&(n=void 0,o=void 0,T(U))});return n=y,y}function T(U){t!==void 0&&clearTimeout(t),!(c||a!==U)&&(t=setTimeout(()=>{t=void 0,x(U,m?"initial":"renew")?.catch(()=>{})},e.heartbeatMs))}function E(U,H=!1){if(!e.eligible(U)){g();return}if(a===U){if(n!==void 0)return n;if(t!==void 0)return}if(g(),c=!1,a=U,!H)return x(U,"initial");T(U)}function R(U){a===U&&(r=Date.now(),i=0)}return{start:E,pause:h,stop:g,confirm:R,isWatching:U=>a===U}}function iv(e){const t=()=>e.workbenchConnectionId===void 0?"local-test-connection":e.workbenchConnectionId(),n=()=>e.position==="secondary"?e.enabled?.()===!0:e.enabled?.()!==!1;let o,a,r,i,c,m;const v=Ct();let g,h=0,w;function x(b=new ot("WATCH_CANCELLED","The watch was stopped or replaced.")){const L=w;L!==void 0&&(w=void 0,L.removeAbortListener(),L.reject(b))}function T(b,L,F){return x(),new Promise((B,ce)=>{const O=()=>{w?.watchId===L&&x(F?.reason instanceof Error?F.reason:new ot("WATCH_CANCELLED","The watch was stopped or replaced."))};F?.addEventListener("abort",O,{once:!0}),w={sessionId:b,watchId:L,resolve:B,reject:ce,removeAbortListener:()=>F?.removeEventListener("abort",O),events:[]},F?.aborted===!0&&O()})}function E(b){return n()&&e.selectedSessionId.value===b&&U(b)}function R(b){return U(b.id)}function U(b){return!b.startsWith("draft:")&&(typeof document>"u"||document.visibilityState==="visible")}async function H(b,L,F="renew"){if(!n())return;const B=e.workspaceTarget.value?.nodeId,ce=e.workspaceTarget.value?.workspaceId,O=t();if(B===void 0||ce===void 0||O===void 0||e.selectedSessionId.value!==b)return;F==="initial"?(v.value=void 0,o=crypto.randomUUID().replace(/-/g,""),m=void 0,a=b,r=B,i=ce):o??=crypto.randomUUID().replace(/-/g,"");const Y=o,ne=F==="initial"?T(b,Y,L):void 0;ne?.catch(()=>{});let oe=!1,Z;try{if(Z=await e.request(`/api/agent-sessions/${e.sessionPathId(b)}/watch`,{method:"POST",body:JSON.stringify({nodeId:B,workspaceId:ce,workbenchConnectionId:O,watchId:Y,mode:F,...e.position===void 0?{}:{position:e.position},unit:"SEGMENT"}),...L===void 0?{}:{signal:L}}),oe=!0,e.workspaceTarget.value?.nodeId!==B||e.workspaceTarget.value?.workspaceId!==ce||e.selectedSessionId.value!==b||t()!==O||o!==Y){w?.watchId===Y&&x(),await ne?.catch(()=>{});return}typeof Z?.nodeGeneration=="string"&&a===b&&(m=Z.nodeGeneration),await ne}catch(we){throw w?.watchId===Y&&x(),await ne?.catch(()=>{}),oe&&et(we)==="WATCH_REQUEST_TIMEOUT"?new ot("SESSION_WATCH_SNAPSHOT_TIMEOUT","The initial session snapshot did not arrive before the watch deadline."):we}}const p=ua({heartbeatMs:e.heartbeatMs,requestTimeoutMs:e.requestTimeoutMs,confirmationTimeoutMs:e.confirmationTimeoutMs,maxFailures:3,eligible:E,renew:(b,L,F)=>H(b,L,F),onExpired:e.refreshSnapshot});function y(b,L={}){if(!n())return;const F=t();if(a===b&&c!==F)return A(b,L.preserveFailures!==!0);a!==b&&(o=crypto.randomUUID().replace(/-/g,""),m=void 0,L.preserveFailures!==!0&&(h=0),a=b,r=e.workspaceTarget.value?.nodeId,i=e.workspaceTarget.value?.workspaceId,c=F);const B=p.start(b,L.skipImmediateRenew===!0),ce=o,O=B?.then(()=>{if(o!==ce||t()!==F)throw new ot("WATCH_CANCELLED","The watch was stopped or replaced.")});return O?.catch(()=>{}),O}function C(){v.value=void 0,x();const b=a,L=o,F=r,B=i,ce=c;a=void 0,r=void 0,i=void 0,c=void 0,o=void 0,m=void 0,h=0,g!==void 0&&clearTimeout(g),g=void 0,p.stop(),!(b===void 0||L===void 0||F===void 0||B===void 0||ce===void 0)&&e.request(`/api/agent-sessions/${e.sessionPathId(b)}/watch`,{method:"DELETE",body:JSON.stringify({nodeId:F,workspaceId:B,workbenchConnectionId:ce,watchId:L,...e.position===void 0?{}:{position:e.position}})}).catch(()=>{})}function A(b,L=!0){return v.value=void 0,g!==void 0&&clearTimeout(g),g=void 0,x(),p.stop(),a=void 0,r=void 0,i=void 0,c=void 0,o=void 0,m=void 0,L&&(h=0),y(b,{preserveFailures:!L})}function N(b){return A(b)??Promise.resolve()}function I(){g!==void 0&&clearTimeout(g),g=void 0,p.pause()}function D(b){if(typeof b!="object"||b===null)return!1;const L=b;if(L.type!=="watch.session.snapshot"&&L.type!=="watch.session.event"||L.workbenchConnectionId!==t()||L.nodeId!==e.workspaceTarget.value?.nodeId||L.workspaceId!==i||L.sessionId!==a||o===void 0||L.watchId!==o||typeof L.nodeGeneration!="string"||m!==void 0&&L.nodeGeneration!==m)return!1;m??=L.nodeGeneration,h=0;const F=a;if(F===void 0)return!1;if(L.type==="watch.session.event"){const ne=L.event;if(ne!==void 0&&typeof ne.sequence=="number"&&["node","session","conversation","run","queue","workspace"].includes(String(ne.category))&&"payload"in ne){const oe={nodeId:L.nodeId,sequence:ne.sequence,category:ne.category,payload:ne.payload};w?.sessionId===F&&w.watchId===o?w.events.push(oe):e.applyEvent?.(oe)}return!0}if(L.payload===void 0)return!1;const B=L.payload,ce=B.kind==="session-watch-snapshot"&&typeof B.sequence=="number"&&typeof B.session=="object"&&B.session!==null&&Array.isArray(B.runs)?B:void 0;if(ce!==void 0){e.applyEvent?.({nodeId:L.nodeId,sequence:ce.sequence,category:"session",payload:{session:ce.session}});const ne=ce.runs;if(e.applyRunsSnapshot!==void 0)e.applyRunsSnapshot(ne);else for(const oe of ne)e.applyEvent?.({nodeId:L.nodeId,sequence:ce.sequence,category:"run",payload:{run:oe}});typeof ce.queue=="object"&&ce.queue!==null&&e.applyEvent?.({nodeId:L.nodeId,sequence:ce.sequence,category:"queue",payload:{sessionId:F,queue:ce.queue}},"initial"),"context"in ce&&e.applyEvent?.({nodeId:L.nodeId,sequence:ce.sequence,category:"session",payload:{sessionId:F,context:ce.context}}),ce.performance!==void 0&&e.applyEvent?.({nodeId:L.nodeId,sequence:ce.sequence,category:"conversation",payload:{sessionId:F,performance:ce.performance}})}const O=ce?.conversation??L.payload,Y=Zn(O)??ct(O);if(w?.sessionId===F&&w.watchId===o){const ne=w;w=void 0,ne.removeAbortListener(),e.applySnapshot(F,Y),v.value={watchId:ne.watchId,nodeId:L.nodeId,workspaceId:L.workspaceId,sessionId:F,connectionId:L.workbenchConnectionId};const oe=typeof ce?.sequence=="number"?ce.sequence:Y.snapshotSequence;for(const Z of ne.events){const we=Z.category==="conversation"?Y.snapshotSequence??oe:oe;we!==void 0&&Z.sequence<=we||e.applyEvent?.(Z)}return ne.resolve(),!0}return Promise.resolve(e.applySnapshot(F,Y,"refresh")).then(ne=>{if(ne&&e.followConversation.value)return e.scrollAfterLayout()}),!0}function K(b){if(b.type!=="watch.failed"||b.watchType!=="session"||b.watchId!==o||b.workbenchConnectionId!==t()||b.sessionId!==a||b.nodeId!==e.workspaceTarget.value?.nodeId||b.workspaceId!==i||typeof b.nodeGeneration!="string"||m!==void 0&&b.nodeGeneration!==m)return!1;m??=b.nodeGeneration;const L=a;return L===void 0?!0:w?.sessionId===L&&w.watchId===o?(x(new ot(wo(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.")),p.pause(),!0):h>=3?(C(),e.refreshSnapshot(),!0):(h+=1,p.pause(),g=setTimeout(()=>{g=void 0,e.selectedSessionId.value===L&&A(L,!1)},Math.min(e.heartbeatMs,1e3*2**(h-1))),!0)}function Q(){document.visibilityState!=="visible"&&C()}function J(b,L){b!==void 0&&L!==void 0&&b.id===e.selectedSessionId.value&&Xn(b)==="MANAGED_ACTIVE"&&L.id===b.id&&R(L)&&y(L.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===t(),canWatchSessionHistory:b=>n()&&R(b),initializeSelectedSessionWatch:N,beginSelectedSessionWatch:y,restartSelectedSessionWatch:A,pauseSelectedSessionWatch:I,stopSelectedSessionWatch:C,reconcileWorkspaceSnapshot:J,handleEvent(b){return typeof b!="object"||b===null?!1:K(b)||D(b)},handleSessionWatchVisibility:Q}}const fa=new TextEncoder;function Sn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ga(e){const t=W([]),n=W(null),o=ma({...e,turns:t,nextCursor:n});return{turns:t,nextCursor:n,projection:o}}function ma(e){const t=new Map,n=new Map,o=new Map;let a=0,r=0;const i=new Map;let c,m=!1;const v=e.scheduleTextDeltaFlush??(q=>{if(typeof requestAnimationFrame=="function"){const G=requestAnimationFrame(q);return()=>cancelAnimationFrame(G)}return queueMicrotask(q),()=>{}}),g=q=>`${q.sessionId}:${q.id}`,h=(q,G)=>`${g(q)}:${G}`;function w(q,G){if(G.length<q.length){const ae=new Set(G.map(ie=>g(ie))),ue=new Set(G.map(ie=>ie.runId));for(const ie of q){if(ae.has(g(ie)))continue;t.delete(g(ie));const M=`${g(ie)}:`;for(const j of n.keys())j.startsWith(M)&&n.delete(j);wt(ie)&&!ue.has(ie.runId)&&o.delete(ie.runId)}}}function x(q){w(e.turns.value,q),e.turns.value=[...q]}function T(){x(e.limitHistory(e.turns.value))}function E(){return e.turns.value.length<=vn?!1:(x(hn(e.turns.value,_n)),e.nextCursor.value=null,!0)}function R(){ne(),n.clear(),t.clear(),o.clear(),r=0,a=0}function U(q){R()}function H(q,G){R(),e.turns.value=[...q],e.nextCursor.value=G}function p(q){const G=new Set(e.turns.value.map(ae=>ae.id));e.turns.value=e.limitHistory([...q.turns.filter(ae=>!G.has(ae.id)),...e.turns.value]),e.nextCursor.value=q.nextCursor}function y(q){e.turns.value=e.limitHistory(jt(e.turns.value,q.turns)),e.nextCursor.value=q.nextCursor}function C(){e.nextCursor.value=null}function A(q,G){e.turns.value=da(e.turns.value,q,G)}function N(q){let G=!1;const ae=e.turns.value.map(ue=>{if(!D(ue,q))return ue;let ie=!1;const M=ue.items.map(j=>j.id!==q||j.kind!=="user_message"||!Sn(j.payload)||j.payload.clientMessageId!==q?j:(ie=!0,G=!0,{...j,payload:{...j.payload,delivery:"ACCEPTED"}}));return ie?{...ue,items:M}:ue});return G&&(e.turns.value=ae),G}function I(q){const G=e.turns.value.filter(ae=>!D(ae,q));return G.length===e.turns.value.length?!1:(e.turns.value=G,!0)}function D(q,G){return q.id===G&&q.runId===null&&q.items.some(ae=>ae.id===G&&ae.kind==="user_message"&&Sn(ae.payload)&&ae.payload.clientMessageId===G)}function K(q,G){O();const ae=`${q}:`;for(const ue of t.keys())ue.startsWith(ae)&&t.delete(ue);for(const ue of n.keys())ue.startsWith(ae)&&n.delete(ue);for(const ue of G)o.delete(ue)}function Q(q,G){if(G===void 0)return;a=Math.max(a,G);const ae=g(q);t.set(ae,Math.max(t.get(ae)??0,G))}function J(q,G){return eo(e.turns.value,q,G)}function b(q,G){return G!==void 0&&G<=(o.get(q)??-1)}function L(q,G){const ae=typeof G.segmentId=="string"?G.segmentId:void 0,ue=typeof G.turnId=="string"?G.turnId:void 0;if(ae===void 0){if(typeof G.itemId=="string"){const pe=e.turns.value.findIndex(ve=>ve.runId===q&&(ue===void 0||(ve.turnId??ve.id)===ue)&&ve.items.some(Re=>Re.id===G.itemId));if(pe>=0)return pe}return J(q,ue)}const ie=e.turns.value.findIndex(pe=>pe.id===ae&&(pe.runId===q||pe.runId===null));if(ie>=0)return e.turns.value[ie].runId===null&&(e.turns.value=e.turns.value.map((pe,ve)=>ve===ie?{...pe,runId:q}:pe)),ie;if(ue===void 0||typeof G.segmentIndex!="number"||!Number.isInteger(G.segmentIndex)||G.segmentIndex<0)return-1;O();const M=J(q,ue),j=M>=0?M:e.turns.value.findLastIndex(pe=>pe.turnId===ue&&pe.runId===null),V=e.turns.value[j];if(V===void 0)return-1;const me=G.segmentIndex;if(me<=(V.segmentIndex??-1))return-1;const ye={...V,id:ae,turnId:ue,runId:q,segmentIndex:me,items:[],startedAt:null,completedAt:null};return e.turns.value=jt(e.turns.value,[{...V,status:"SUCCEEDED"},ye]),E()&&e.onRecentWindowOverflow(),e.turns.value.findIndex(pe=>pe.id===ae&&pe.runId===q)}function F(q,G,ae){if(b(q,ae))return;const ue=L(q,G),ie=e.turns.value[ue];if(ie===void 0||va(ie.status))return;const M=typeof G.itemId=="string"?G.itemId:void 0,j=M===void 0?void 0:ie.items.find(V=>V.id===M&&V.kind==="assistant_message");if(!(j!==void 0&&xt(j.status))&&!(M!==void 0&&ae!==void 0&&ae<=(n.get(h(ie,M))??-1)))return{turnIndex:ue,turn:ie}}function B(q,G,ae,ue=Date.now()){O();const ie=ge(G);if(ie===void 0)return!1;const{itemId:M,kind:j,status:V}=ie;if(typeof M!="string"||typeof j!="string"||typeof V!="string"||b(q,ae))return!1;const me=L(q,ie);if(me<0)return!1;const ye=e.turns.value[me],pe=ye.items.findIndex(ke=>ke.id===M),ve=pe<0?void 0:ye.items[pe],Re=h(ye,M);if(ae!==void 0&&ae<=(n.get(Re)??Number.NEGATIVE_INFINITY)||ve!==void 0&&xt(ve.status)&&!xt(V))return!1;const Le=St(ue)?ue:Date.now(),Ue=ye.items.at(-1),fe=ye.items.map(ke=>ke.id===Ue?.id&&ke.kind==="assistant_message"&&ke.status==="IN_PROGRESS"?{...ke,status:"COMPLETED",completedAt:Le}:ke),_=St(ie.startedAt)?ie.startedAt:ve?.startedAt??Le,P=ie.completedAt===null?null:St(ie.completedAt)?ie.completedAt:xt(V)?ve?.completedAt??Le:ve?.completedAt??null,ee={id:M,kind:j,status:V,...ie.processGroup===void 0?{}:{processGroup:Eo.parse(ie.processGroup)},...typeof ie.parentItemId=="string"?{parentItemId:ie.parentItemId}:{},startedAt:_,completedAt:P,payload:pn(ie.merge===!0&&ve!==void 0?qo(ve.payload,ie.payload,ie.append):ie.payload)};return pe<0?fe.push(ee):fe.splice(pe,1,ee),e.turns.value=e.turns.value.map((ke,Oe)=>Oe===me?{...ke,items:fe,startedAt:ke.startedAt??ee.startedAt}:ke),ae!==void 0&&n.set(Re,ae),Q(ye,ae),T(),!0}function ce(q,G,ae,ue=Date.now()){const ie=ge(G),M=ie?.text;if(typeof M!="string"||M.length===0||ie===void 0)return!1;const j=F(q,ie,ae);if(j===void 0)return!1;const{turnIndex:V,turn:me}=j,ye=typeof ie?.itemId=="string"?ie.itemId:void 0,pe=me.items.at(-1),ve=ye===void 0&&pe?.kind==="assistant_message"&&pe.status==="IN_PROGRESS",Re=ye===void 0?ve?me.items.length-1:-1:me.items.findIndex(Oe=>Oe.id===ye&&Oe.kind==="assistant_message"),Le=Re>=0?me.items[Re].id:ye??`${q}:assistant:${ae??"live"}`,Ue=Re<0?void 0:me.items[Re],fe=h(me,Le);if(ae!==void 0&&ae<=(n.get(fe)??Number.NEGATIVE_INFINITY))return!1;const _=ge(Ue?.payload),P=`${typeof _?.text=="string"?_.text:""}${M}`,ee={id:Le,kind:"assistant_message",status:"IN_PROGRESS",startedAt:Ue?.startedAt??(St(ue)?ue:Date.now()),completedAt:null,payload:{..._??{},...pn({text:P}),format:"markdown",model:null}},ke=[...me.items];return Re<0?ke.push(ee):ke.splice(Re,1,ee),e.turns.value=e.turns.value.map((Oe,nt)=>nt===V?{...Oe,items:ke,startedAt:Oe.startedAt??ee.startedAt}:Oe),ae!==void 0&&n.set(fe,ae),r+=fa.encode(M).byteLength,r>=64*1024?(Q(me,ae),T(),r=0,!0):(Q(me,ae),!0)}function O(){c?.(),c=void 0,m=!1,Y()}function Y(){if(i.size===0)return;const q=[...i.values()];i.clear();for(const G of q)ce(G.runId,G,G.sequence,G.createdAt)}function ne(){c?.(),c=void 0,m=!1,i.clear()}function oe(q,G,ae,ue=Date.now()){const ie=ge(G),M=ie?.text;if(typeof M!="string"||M.length===0)return!1;const j=ie!==void 0&&typeof ie.itemId=="string"?ie.itemId:void 0;if(ie===void 0)return!1;const V=F(q,ie,ae);if(V===void 0)return!1;const me=V.turn,ye=`${q}\0${me.id}\0${j??""}`,pe=i.get(ye);if(pe!==void 0&&ae!==void 0&&ae<=(pe.sequence??-1))return!1;if(pe===void 0?i.set(ye,{runId:q,...j===void 0?{}:{itemId:j},turnId:me.turnId??me.id,...me.segmentIndex===void 0?{}:{segmentId:me.id,segmentIndex:me.segmentIndex},text:M,chunks:[{text:M,sequence:ae}],...ae===void 0?{}:{sequence:ae},createdAt:ue}):(pe.text+=M,pe.chunks.push({text:M,sequence:ae}),ae!==void 0&&(pe.sequence=ae)),!m){m=!0;const ve=v(()=>{m=!1,c=void 0,Y()});m?c=ve:ve()}return!0}function Z(q,G){Q(q,G),!(!wt(q)||G===void 0)&&o.set(q.runId,Math.max(o.get(q.runId)??0,G))}function we(q){return q.snapshotSequence!==void 0&&q.snapshotSequence<a}function Ae(q){if(O(),we(q))return!1;const G=e.turns.value,ae=q.turns.map(mn),ue=ae.some(ve=>!G.some(Re=>Re.id===ve.id)),ie=ae,M=new Map(G.map(ve=>[ve.id,ve])),j=ie.map(ve=>{const Re=M.get(ve.id);if(Re===void 0)return Q(ve,q.snapshotSequence),ve;const Le=t.get(g(ve));if(Le!==void 0&&q.snapshotSequence!==void 0&&Le>q.snapshotSequence)return Re;Q(ve,q.snapshotSequence);const Ue=Re.items.filter(No);return Ue.length===0?ve:{...ve,items:jo(ve.items,Re.items,Ue)}}),V=Uo(jt(G,j)),me=ue&&V.length>vn,ye=e.limitHistory(me?hn(V,_n):V),pe=JSON.stringify(G)!==JSON.stringify(ye);return w(V,ye),me&&(e.nextCursor.value=null),!me&&e.nextCursor.value===null&&q.nextCursor!==null&&(e.nextCursor.value=q.nextCursor),pe&&(e.turns.value=ye),me&&e.onRecentWindowOverflow(),pe}function $(q){return O(),we(q)?!1:(z(q),!0)}function z(q){const G=q.turns.map(mn),ae=[...i.values()];R(),e.turns.value=e.limitHistory(G),e.nextCursor.value=q.nextCursor,a=q.snapshotSequence??0;for(const ue of e.turns.value)Z(ue,q.snapshotSequence);for(const ue of ae){const ie=q.snapshotSequence;if(ie===void 0)continue;const M=ue.chunks.filter(j=>j.sequence!==void 0&&j.sequence>ie);M.length!==0&&ce(ue.runId,{...ue,text:M.map(j=>j.text).join("")},M.at(-1).sequence,ue.createdAt)}}function Ce(q){return O(),we(q)?!1:(z(q),!0)}return{resetHistory:R,restore:U,restoreWindow:H,mergeOlderPage:p,recoverWindow:y,clearCursor:C,syncRunStatus:A,updateOptimisticUserMessage:N,removeOptimisticUserMessage:I,clearSession:K,markLive:Q,mergeItem:B,mergeTextDelta:oe,flushPendingTextDeltas:O,mergeLatest:Ae,replaceRecent:$,replaceAuthoritative:Ce}}function St(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function xt(e){return["COMPLETED","FAILED","DECLINED","CANCELLED","INTERRUPTED"].includes(e)}function va(e){return["SUCCEEDED","FAILED","CANCELLED","INTERRUPTED","LOST"].includes(e)}function to(e){const t=Wt(e);return t?.kind==="context_compaction"&&t.status==="COMPLETED"}function ha(e){const t=Wt(e),n=Wt(t?.payload);return to(e)&&n?.retainedContext===!0}function rv(e,t){return to(e)?ha(e)?null:t==null?t:{...t,usedTokens:0,percentage:0,...t.gcCount===void 0?{}:{gcCount:0},...t.gcCount===void 0&&t.gcReclaimedTokens===void 0?{}:{gcReclaimedTokens:0}}:t}function sv(e){const{turns:t,nextCursor:n,projection:o}=ga({onRecentWindowOverflow:e,limitHistory:Bo});let a=0,r;const i=W(0);function c(){r!==void 0&&(clearTimeout(r.timer),r.resolve(),r=void 0)}function m(){c(),i.value+=1;const g=i.value;return new Promise(h=>{const w=setTimeout(()=>{r?.version===g&&(r=void 0,h())},1e4);r={version:g,resolve:h,timer:w}})}function v(g){r?.version===g&&c()}return{turns:t,nextCursor:n,projection:o,loadingInitial:W(!1),initialLoadFailed:W(!1),initialFailureCause:Ct(),loadingOlder:W(!1),channelInput:W(""),channelToken:W(),contextUsage:W(),initialRenderVersion:i,beginInitialRender:m,confirmInitialRender:v,cancelInitialRender:c,nextDetailRequest:()=>++a,currentDetailRequest:()=>a}}function Wt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)?e:void 0}function pa(e){return typeof e=="object"&&e!==null&&typeof e.id=="string"&&typeof e.sessionId=="string"&&typeof e.status=="string"}function _a(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 lv(e){function t(a,r){const i=e.setNodeConnection?.(a,r);r&&i===!1&&e.onNodeConnected(a)}function n(a,r="event"){const i=ge(a.payload);if(a.category==="node"&&typeof i?.connected=="boolean"){t(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:h,queue:w}=i;if(typeof h=="string"&&a.nodeId===e.workspaceTarget.value?.nodeId&&typeof w=="object"&&w!==null){const x=e.selectedSession?.value,T=x?.id===h&&x.workspaceId===e.workspaceTarget.value?.workspaceId?x:e.sessions.value.find(E=>E.id===h&&E.workspaceId===e.workspaceTarget.value?.workspaceId);T!==void 0&&Yn(T)&&e.cacheQueue(a.nodeId,T.workspaceId,h,w,r),h===e.selectedSessionId.value&&e.mergeQueue(w,r)}return}if(a.category==="session"&&i!==void 0&&a.nodeId===e.workspaceTarget.value?.nodeId){const h=i.session;if(_a(h)){const w=h.id===e.selectedSessionId.value;w&&h.activity!==void 0&&h.activity!=="MANAGED_ACTIVE"&&e.settleSessionRuns(h.id),e.mergeSessions([h]),w&&h.activity==="MANAGED_ACTIVE"&&e.observeManagedSessionActive(h.id)}typeof i.sessionId=="string"&&"context"in i&&e.updateContext(i.sessionId,i.context??null);return}if(a.category==="run"&&i!==void 0&&pa(i.run)){const h=i.run;if(e.syncTurnStatus(h.id,h.status,h.sessionId),a.nodeId===e.workspaceTarget.value?.nodeId&&e.cacheRun(h),h.sessionId===e.selectedSessionId.value&&a.nodeId===e.workspaceTarget.value?.nodeId){const w=e.acceptRun(h);["STARTING","RUNNING","CANCELLING"].includes(w.status)&&e.openRun(h.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=ge(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 m=ge(i.delta);if(m!==void 0&&typeof m.runId=="string"&&typeof m.itemId=="string"&&typeof m.text=="string"&&a.nodeId===e.workspaceTarget.value?.nodeId&&i.sessionId===e.selectedSessionId.value){e.mergeTextDelta(m.runId,m,a.sequence,typeof m.createdAt=="number"?m.createdAt:void 0);return}const v=Zn(i.snapshot,a.sequence);if(v!==void 0&&a.nodeId===e.workspaceTarget.value?.nodeId){const h=v.turns[0]?.sessionId??(typeof i.sessionId=="string"?i.sessionId:void 0);h!==void 0&&e.applyConversationSnapshot(h,v,"refresh");return}const g=i.turn;if(Fo(g)&&a.nodeId===e.workspaceTarget.value?.nodeId){if(!Array.isArray(i.segments)||!i.segments.every(tn))return;const h=ct({segments:i.segments,nextCursor:e.conversationNextCursor.value,snapshotSequence:a.sequence}).turns;if(h.length===0)return;for(const w of h)e.markLiveTurn(w,a.sequence),e.cacheTurn(w);g.sessionId===e.selectedSessionId.value&&e.mergeTurns({turns:h,nextCursor:e.conversationNextCursor.value,snapshotSequence:a.sequence});return}}function o(a){(a.category==="node"||a.category==="workspace")&&n(a)}return{apply:n,applyBroadcast:o,updateNodeConnection:t}}function cv(e){let t=!1,n=!1,o=0;const a=W("");Pe([e.workspaceTarget,e.selectedSessionId],()=>{o+=1,t=!1,n=!1,e.loadingOlder.value=!1,a.value=""},{flush:"sync"});async function r(){await i(e.pageSize)}async function i(g){const h=e.workspaceTarget.value?.nodeId,w=e.selectedSessionId.value,x=e.nextCursor.value;if(h===void 0||w===void 0||x===null||e.loadingOlder.value||t)return;const T=o;e.loadingOlder.value=!0,a.value="";let E=x;try{let R;try{R=await c(h,w,g,E)}catch(H){if(et(H)!=="EVENT_CURSOR_INVALID")throw H;if(e.workspaceTarget.value?.nodeId!==h||e.selectedSessionId.value!==w||o!==T||e.nextCursor.value!==E)return;const p=await m(h,w,E,T);if(p===void 0||e.workspaceTarget.value?.nodeId!==h||e.selectedSessionId.value!==w||o!==T||e.nextCursor.value!==(p??E))return;if(p===null){const y=e.capturePrependAnchor();e.clearCursor(),await Ne(),o===T&&e.workspaceTarget.value?.nodeId===h&&e.selectedSessionId.value===w&&e.nextCursor.value===null&&y();return}E=p,R=await c(h,w,g,E)}if(e.workspaceTarget.value?.nodeId!==h||e.selectedSessionId.value!==w||o!==T||e.nextCursor.value!==E)return;const U=e.capturePrependAnchor();e.mergeOlderPage(R),await Ne(),o===T&&e.workspaceTarget.value?.nodeId===h&&e.selectedSessionId.value===w&&U()}catch(R){e.workspaceTarget.value?.nodeId===h&&e.selectedSessionId.value===w&&o===T&&e.nextCursor.value===E&&(a.value=l("generated.workbenchConversationPagingService.unableToLoadEarlierConversationHistory",{value0:e.errorMessage(R)}))}finally{o===T&&(e.loadingOlder.value=!1)}}async function c(g,h,w,x){const T=await e.request(`/api/agent-sessions/${e.sessionPathId(h)}/turns?nodeId=${encodeURIComponent(g)}&limit=${w}&cursor=${encodeURIComponent(x)}&unit=SEGMENT`);return ct(T)}async function m(g,h,w,x){const T=await e.request(`/api/agent-sessions/${e.sessionPathId(h)}/turns?nodeId=${encodeURIComponent(g)}&limit=${e.recentSegmentWindowSize}&unit=SEGMENT`),E=ct(T);if(e.workspaceTarget.value?.nodeId!==g||e.selectedSessionId.value!==h||o!==x||e.nextCursor.value!==w)return;const R=E.nextCursor===null?{...E,nextCursor:w}:E;if(e.recoverWindow(R),await Ne(),!(e.workspaceTarget.value?.nodeId!==g||e.selectedSessionId.value!==h||o!==x||e.nextCursor.value!==R.nextCursor))return E.nextCursor}async function v(){const g=e.workspaceTarget.value?.nodeId,h=e.selectedSessionId.value;if(g===void 0||h===void 0)return;if(t){n=!0;return}t=!0;let w=o;try{do{n=!1,w=++o,e.loadingOlder.value=!1,a.value="";const x=await e.request(`/api/agent-sessions/${e.sessionPathId(h)}/turns?nodeId=${encodeURIComponent(g)}&limit=${e.recentSegmentWindowSize}&unit=SEGMENT`),T=ct(x);if(o!==w||e.workspaceTarget.value?.nodeId!==g||e.selectedSessionId.value!==h)return;n||e.replaceRecent(T)}while(n)}catch{}finally{o===w&&(t=!1)}}return{olderHistoryError:a,loadOlderConversationTurns:r,refreshRecentConversationTurns:v}}const ba=28,xn=48;function dv(){const e=W(),t=W(!0),n=W(!1);let o,a,r,i=0,c;function m(p){e.value=p,o=p?.clientWidth,a=p?.clientHeight,r=p?.scrollHeight,i=p?.scrollTop??0,c=void 0}function v(p){const y=p.clientWidth!==o||p.clientHeight!==a||p.scrollHeight!==r;return o=p.clientWidth,a=p.clientHeight,r=p.scrollHeight,y}function g(p){const y=p.getBoundingClientRect(),C=p.ownerDocument.elementFromPoint(y.left+y.width/2,y.top+y.height/2);c=C!==null&&C!==p&&p.contains(C)?{element:C,top:C.getBoundingClientRect().top}:void 0}function h(p){const y=e.value;if(y===void 0||n.value)return;const C=v(y),A=c!==void 0&&y.contains(c.element)&&Math.abs(c.element.getBoundingClientRect().top-c.top)<1,N=!A&&y.scrollTop<i-1,I=!A&&y.scrollTop>i,D=y.scrollHeight-y.scrollTop-y.clientHeight;if(i=y.scrollTop,C&&(!N&&!I||t.value&&D<=1)){t.value?T():c===void 0&&g(y);return}t.value=!N&&(t.value||I)&&D<ba,t.value?c=void 0:(N||I||c===void 0)&&g(y),N&&y.scrollTop<xn&&y.scrollHeight>y.clientHeight+xn&&p()}function w(){const p=e.value;p===void 0||!v(p)||!t.value||H()}function x(){const p=e.value;p!==void 0&&(t.value=!1,n.value=!1,v(p),i=p.scrollTop,g(p))}function T(){const p=e.value;p!==void 0&&(p.scrollTop=p.scrollHeight,i=p.scrollTop,t.value=!0,c=void 0)}function E(p){const y=e.value;if(y===void 0)return()=>{};const C=y.scrollHeight,A=y.scrollTop,N=p&&t.value;return()=>{if(!(e.value!==y||y.scrollTop!==A)){if(N){t.value&&(T(),v(y));return}y.scrollTop=A+(y.scrollHeight-C),i=y.scrollTop,v(y),t.value||g(y)}}}function R(){return E(!0)}function U(){return E(!1)}async function H(p=()=>!0){const y=e.value;y===void 0||!p()||(T(),await Ne(),!(e.value!==y||!t.value||!p())&&(T(),await new Promise(C=>requestAnimationFrame(()=>C())),!(e.value!==y||!t.value||!p())&&(T(),await new Promise(C=>setTimeout(C,50)),!(e.value!==y||!t.value||!p())&&T())))}return{element:e,following:t,positioningInitialConversation:n,setElement:m,handleScroll:h,handleResize:w,stopFollowing:x,scrollToLatest:T,captureRenderAnchor:R,capturePrependAnchor:U,scrollToLatestAfterLayout:H}}const ya=5e3;function Kt(e){return`session:${e===void 0||e.startsWith("draft:")?"draft":e}`}function uv(){const e=ka(),t={};return{...e.bind(()=>t),transferSession:(n,o)=>e.transfer(t,t,n,o)}}function ka(){const e=new WeakMap,t=new Map,n=new WeakMap;function o(v){const g=JSON.stringify([v.nodeId,v.workspaceId,v.kind,v.kind==="session"?v.sessionId:null]);let h=t.get(g);return h===void 0&&(h={},t.set(g,h),n.set(h,g)),h}const a=W(0),r={};function i(v){let g=e.get(v);return g===void 0&&(g={slots:new Set([v]),tokens:Ct([])},e.set(v,g)),g}function c(v){const g=X(()=>(a.value,i(v()??r)));function h(w,x,T=ya){const E=g.value;if(E.tokens.value.length!==0)return;const R={group:E,context:w,active:!0};function U(){return R.active?(R.active=!1,clearTimeout(R.timeout),R.group.tokens.value=R.group.tokens.value.filter(H=>H!==R),!0):!1}return E.tokens.value=[...E.tokens.value,R],T!==null&&(R.timeout=setTimeout(()=>{U()&&x?.()},T)),U}return{pending:X(()=>g.value.tokens.value.length!==0),context:X(()=>g.value.tokens.value.find(w=>w.context!==void 0)?.context),begin:h}}function m(v,g,h,w,x=!1){const T=e.get(v);if(T===void 0)return;const E=e.get(g)??T;for(const R of T.tokens.value)R.context===Kt(h)&&(R.context=Kt(w)),R.group=E;if(E!==T){E.tokens.value=[...E.tokens.value,...T.tokens.value];for(const R of T.slots)e.set(R,E),E.slots.add(R)}else E.tokens.value=[...E.tokens.value];if(e.set(g,E),E.slots.add(g),x&&v!==g){e.delete(v),E.slots.delete(v);const R=n.get(v);R!==void 0&&t.get(R)===v&&t.delete(R)}a.value+=1}return{bind:c,transfer:m,forTarget:o}}const fv="";function gv(e,t=[]){const n=e??W(t);function o(m){if(n.value.some(g=>g.name===m.name))return!1;const v={name:m.name,source:m.source,skillFilePath:m.skillFilePath,available:!0};return n.value=[...n.value,v],!0}function a(m){n.value=n.value.filter(v=>v.name!==m)}function r(){n.value=[]}function i(m){n.value=m.filter(no)}function c(m){const v=new Map(m.map(g=>[g.name,g]));n.value=n.value.map(g=>{const h=v.get(g.name);return h===void 0?{...g,available:!1}:{name:h.name,source:h.source,skillFilePath:h.skillFilePath,available:!0}})}return{tokens:n,select:o,remove:a,clear:r,restore:i,reconcile:c}}function Ca(e,t,n=[]){return[t,e.length>0?ln("mar_skills",{action:"use",instruction:Io,skills:e.map(o=>({name:o.name,source:o.source,path:o.skillFilePath}))}):"",n.length>0?ln("mar_references",{references:[...n]}):""].filter(o=>o.length>0).join(`
|
|
1
|
+
import{t as l,A as ot,eB as wo,a0 as Ct,e as et,a as W,eC as Eo,w as Pe,X as Ne,c as X,eD as ln,eE as Io,s as Be,cd as Hn,eF as zn,eG as So,eH as Me,eI as xo,eJ as To,eK as cn,dO as Gn,ce as Ao,d as Se,co as Vn,aw as Zt,D as vt,Y as Ke,L as Ve,o as s,b as u,S as Ie,G as S,R as dn,u as d,g as se,v as k,E as be,p as re,q as _e,O as te,I as le,H as f,f as Ge,ae as Wn,_ as xe,eL as un,z as fn,eM as Po,dM as Ro,K as Pt,dz as Do,ad as ut,P as Ee,J as Fe,dP as $o,eN as Mo,r as gn,U as Et,b_ as Lo,bk as We,aK as Oo}from"./index-DsgwAvJA.js";import{l as mn,i as No,r as jo,a as Uo,C as vn,b as hn,c as pn,m as qo,d as _n,e as wt,f as ge,g as Bo,h as Fo,j as Ho,k as bn,n as Nt,o as zo,p as Go}from"./conversation-history-D9993EDO.js";import{E as Vo}from"./message-box-service-CszgyilP.js";import{e as Kn}from"./error-presentation-CJfLHEK_.js";import{a as st,E as Qn}from"./el-input-DRF3bOe1.js";import{M as he}from"./MarIcon-0cJTzTai.js";import{B as at}from"./BusyIndicator-DJEYrwl2.js";import{a as Wo,E as Ko}from"./el-checkbox-D7CsqiQq.js";import{a as Qo,E as Jo}from"./el-radio-DO8joult.js";/* empty css */import{f as it,p as $t}from"./time-presentation-BRvT6nTd.js";import{M as Yo,H as yn,t as Xo,A as kn,p as Zo,j as It,o as kt,q as en,r as Cn,h as ea,E as ta,g as na,F as oa}from"./FilePreviewLoading-CqXCVUDH.js";import{E as aa,b as ia,a as ra}from"./el-select-BSaB1c5h.js";import{E as Jn,u as zt,m as Gt}from"./mobile-dialog-return-service-Csexw-by.js";/* empty css */import{l as wn,r as En}from"./runner-presentation-D66Z9p-O.js";function Vt(e){const t=e.customTitle?.trim();if(t)return t;const n=e.runnerTitle?.trim();return n===void 0||n===""||n==="Untitled session"||n.toLocaleLowerCase()==="new session"?l("generated.sessionPresentation.newSession"):n}function Yn(e){return typeof e?.externalSessionId=="string"&&e.externalSessionId.length>0}function nv(e){return!Yn(e)}function ov(e){return e.trim().replace(/\s+/g," ").slice(0,160)}function Xn(e){return e.activity!==void 0?e.activity:"IDLE"}function av(e){return{MANAGED_ACTIVE:l("generated.sessionPresentation.managed"),IDLE:l("generated.sessionPresentation.ready")}[Xn(e)]}function sa(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 la=new Set(["PREPARING","RUNNING","WAITING_INPUT","WAITING_APPROVAL","SUCCEEDED","FAILED","CANCELLED","INTERRUPTED","LOST"]);function In(e){return e==null||typeof e=="number"&&Number.isInteger(e)&&e>=0}function ca(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=e;return typeof t.id=="string"&&t.id.length>0&&typeof t.kind=="string"&&t.kind.length>0&&typeof t.status=="string"&&t.status.length>0}function tn(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=e;return typeof t.id=="string"&&t.id.length>0&&typeof t.turnId=="string"&&t.turnId.length>0&&typeof t.sessionId=="string"&&t.sessionId.length>0&&(t.runId===null||typeof t.runId=="string"&&t.runId.length>0)&&typeof t.index=="number"&&Number.isInteger(t.index)&&t.index>=0&&typeof t.status=="string"&&la.has(t.status)&&Array.isArray(t.items)&&t.items.every(ca)&&In(t.startedAt)&&In(t.completedAt)}function Zn(e,t){if(typeof e!="object"||e===null||Array.isArray(e))return;const n=e;if(!(n.unit!=="SEGMENT"||!Array.isArray(n.segments)||!n.segments.every(tn)||new Set(n.segments.map(a=>a.sessionId)).size>1))return ct({unit:"SEGMENT",segments:n.segments,nextCursor:typeof n.nextCursor=="string"?n.nextCursor:null,...typeof n.snapshotSequence=="number"?{snapshotSequence:n.snapshotSequence}:t===void 0?{}:{snapshotSequence:t},...n.source==="official"||n.source==="native"||n.source==="runtime"?{source:n.source}:{},...typeof n.readAt=="number"?{readAt:n.readAt}:{},...typeof n.latestVisibleAt=="number"?{latestVisibleAt:n.latestVisibleAt}:{},...n.deferredOlderHistory===!0?{deferredOlderHistory:!0}:{}})}function ct(e){if(!Array.isArray(e.segments))throw new Error("The conversation history response contains no segments.");const t=e;if(!t.segments.every(tn))throw new Error("The conversation Segment response contains an invalid Segment.");return{...t,turns:t.segments.map(n=>({id:n.id,turnId:n.turnId,segmentIndex:n.index,sessionId:n.sessionId,runId:n.runId,status:n.status,...n.rewind===void 0?{}:{rewind:n.rewind},items:n.items,...n.startedAt===void 0?{}:{startedAt:n.startedAt},...n.completedAt===void 0?{}:{completedAt:n.completedAt}}))}}function jt(e,t){const n=[...e];for(const[o,a]of t.entries()){const r=n.findIndex(c=>c.id===a.id);if(r>=0){n.splice(r,1,a);continue}if(a.turnId!==void 0&&a.segmentIndex!==void 0){const c=n.findIndex(v=>v.turnId===a.turnId&&v.segmentIndex!==void 0&&v.segmentIndex>a.segmentIndex),m=n.findLastIndex(v=>v.turnId===a.turnId);if(c>=0||m>=0){n.splice(c>=0?c:m+1,0,a);continue}}const i=t.slice(o+1).find(c=>n.some(m=>m.id===c.id));if(i!==void 0){n.splice(n.findIndex(c=>c.id===i.id),0,a);continue}n.push(a)}return n}function eo(e,t,n){const o=e.findLastIndex(i=>i.runId===t&&(n===void 0||(i.turnId??i.id)===n));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===t&&(c.turnId??c.id)===a&&(c.segmentIndex??-1)>(e[r].segmentIndex??-1)&&(r=i);return r}function da(e,t,n){const o=eo(e,t);return e.map((a,r)=>r===o&&a.status!==n?{...a,status:n}:a)}function ua(e){let t,n,o,a,r,i=0,c=!1,m=!1,v=0;function g(){t!==void 0&&clearTimeout(t),o?.abort(new ot("WATCH_CANCELLED","The watch was stopped or replaced.")),t=void 0,o=void 0,n=void 0,a=void 0,r=void 0,i=0,c=!1,m=!1,v=0}function h(){t!==void 0&&clearTimeout(t),t=void 0,c=!0}async function w(U,H,p){const y=setTimeout(()=>p.abort(new ot("WATCH_REQUEST_TIMEOUT","The watch request timed out.")),e.requestTimeoutMs);try{if(await e.renew(U,p.signal,H),o!==p||a!==U)return;r=Date.now(),i=0,m=!1,v=0}catch(C){if(o!==p||a!==U)return;const A=p.signal.aborted&&C instanceof Error&&C.name==="AbortError"?p.signal.reason:C;if(e.recovery!==void 0&&(H==="renew"||m)){e.recovery.onFailure(A),H==="initial"&&(v+=1),!c&&e.recovery.retryable(A)&&v<e.maxFailures?m=!0:(h(),e.onExpired());return}if(H==="initial")throw c=!0,i=0,r=void 0,A;i+=1;const N=r!==void 0&&Date.now()-r>=e.confirmationTimeoutMs;(i>=e.maxFailures||N)&&(e.onExpired(),i=0,r=void 0)}finally{clearTimeout(y)}}function x(U,H){if(c||n!==void 0||a!==U||!e.eligible(U))return n;const p=new AbortController;o=p;const y=w(U,H,p).finally(()=>{n===y&&(n=void 0,o=void 0,T(U))});return n=y,y}function T(U){t!==void 0&&clearTimeout(t),!(c||a!==U)&&(t=setTimeout(()=>{t=void 0,x(U,m?"initial":"renew")?.catch(()=>{})},e.heartbeatMs))}function E(U,H=!1){if(!e.eligible(U)){g();return}if(a===U){if(n!==void 0)return n;if(t!==void 0)return}if(g(),c=!1,a=U,!H)return x(U,"initial");T(U)}function R(U){a===U&&(r=Date.now(),i=0)}return{start:E,pause:h,stop:g,confirm:R,isWatching:U=>a===U}}function iv(e){const t=()=>e.workbenchConnectionId===void 0?"local-test-connection":e.workbenchConnectionId(),n=()=>e.position==="secondary"?e.enabled?.()===!0:e.enabled?.()!==!1;let o,a,r,i,c,m;const v=Ct();let g,h=0,w;function x(b=new ot("WATCH_CANCELLED","The watch was stopped or replaced.")){const L=w;L!==void 0&&(w=void 0,L.removeAbortListener(),L.reject(b))}function T(b,L,F){return x(),new Promise((B,ce)=>{const O=()=>{w?.watchId===L&&x(F?.reason instanceof Error?F.reason:new ot("WATCH_CANCELLED","The watch was stopped or replaced."))};F?.addEventListener("abort",O,{once:!0}),w={sessionId:b,watchId:L,resolve:B,reject:ce,removeAbortListener:()=>F?.removeEventListener("abort",O),events:[]},F?.aborted===!0&&O()})}function E(b){return n()&&e.selectedSessionId.value===b&&U(b)}function R(b){return U(b.id)}function U(b){return!b.startsWith("draft:")&&(typeof document>"u"||document.visibilityState==="visible")}async function H(b,L,F="renew"){if(!n())return;const B=e.workspaceTarget.value?.nodeId,ce=e.workspaceTarget.value?.workspaceId,O=t();if(B===void 0||ce===void 0||O===void 0||e.selectedSessionId.value!==b)return;F==="initial"?(v.value=void 0,o=crypto.randomUUID().replace(/-/g,""),m=void 0,a=b,r=B,i=ce):o??=crypto.randomUUID().replace(/-/g,"");const Y=o,ne=F==="initial"?T(b,Y,L):void 0;ne?.catch(()=>{});let oe=!1,Z;try{if(Z=await e.request(`/api/agent-sessions/${e.sessionPathId(b)}/watch`,{method:"POST",body:JSON.stringify({nodeId:B,workspaceId:ce,workbenchConnectionId:O,watchId:Y,mode:F,...e.position===void 0?{}:{position:e.position},unit:"SEGMENT"}),...L===void 0?{}:{signal:L}}),oe=!0,e.workspaceTarget.value?.nodeId!==B||e.workspaceTarget.value?.workspaceId!==ce||e.selectedSessionId.value!==b||t()!==O||o!==Y){w?.watchId===Y&&x(),await ne?.catch(()=>{});return}typeof Z?.nodeGeneration=="string"&&a===b&&(m=Z.nodeGeneration),await ne}catch(we){throw w?.watchId===Y&&x(),await ne?.catch(()=>{}),oe&&et(we)==="WATCH_REQUEST_TIMEOUT"?new ot("SESSION_WATCH_SNAPSHOT_TIMEOUT","The initial session snapshot did not arrive before the watch deadline."):we}}const p=ua({heartbeatMs:e.heartbeatMs,requestTimeoutMs:e.requestTimeoutMs,confirmationTimeoutMs:e.confirmationTimeoutMs,maxFailures:3,eligible:E,renew:(b,L,F)=>H(b,L,F),onExpired:e.refreshSnapshot});function y(b,L={}){if(!n())return;const F=t();if(a===b&&c!==F)return A(b,L.preserveFailures!==!0);a!==b&&(o=crypto.randomUUID().replace(/-/g,""),m=void 0,L.preserveFailures!==!0&&(h=0),a=b,r=e.workspaceTarget.value?.nodeId,i=e.workspaceTarget.value?.workspaceId,c=F);const B=p.start(b,L.skipImmediateRenew===!0),ce=o,O=B?.then(()=>{if(o!==ce||t()!==F)throw new ot("WATCH_CANCELLED","The watch was stopped or replaced.")});return O?.catch(()=>{}),O}function C(){v.value=void 0,x();const b=a,L=o,F=r,B=i,ce=c;a=void 0,r=void 0,i=void 0,c=void 0,o=void 0,m=void 0,h=0,g!==void 0&&clearTimeout(g),g=void 0,p.stop(),!(b===void 0||L===void 0||F===void 0||B===void 0||ce===void 0)&&e.request(`/api/agent-sessions/${e.sessionPathId(b)}/watch`,{method:"DELETE",body:JSON.stringify({nodeId:F,workspaceId:B,workbenchConnectionId:ce,watchId:L,...e.position===void 0?{}:{position:e.position}})}).catch(()=>{})}function A(b,L=!0){return v.value=void 0,g!==void 0&&clearTimeout(g),g=void 0,x(),p.stop(),a=void 0,r=void 0,i=void 0,c=void 0,o=void 0,m=void 0,L&&(h=0),y(b,{preserveFailures:!L})}function N(b){return A(b)??Promise.resolve()}function I(){g!==void 0&&clearTimeout(g),g=void 0,p.pause()}function D(b){if(typeof b!="object"||b===null)return!1;const L=b;if(L.type!=="watch.session.snapshot"&&L.type!=="watch.session.event"||L.workbenchConnectionId!==t()||L.nodeId!==e.workspaceTarget.value?.nodeId||L.workspaceId!==i||L.sessionId!==a||o===void 0||L.watchId!==o||typeof L.nodeGeneration!="string"||m!==void 0&&L.nodeGeneration!==m)return!1;m??=L.nodeGeneration,h=0;const F=a;if(F===void 0)return!1;if(L.type==="watch.session.event"){const ne=L.event;if(ne!==void 0&&typeof ne.sequence=="number"&&["node","session","conversation","run","queue","workspace"].includes(String(ne.category))&&"payload"in ne){const oe={nodeId:L.nodeId,sequence:ne.sequence,category:ne.category,payload:ne.payload};w?.sessionId===F&&w.watchId===o?w.events.push(oe):e.applyEvent?.(oe)}return!0}if(L.payload===void 0)return!1;const B=L.payload,ce=B.kind==="session-watch-snapshot"&&typeof B.sequence=="number"&&typeof B.session=="object"&&B.session!==null&&Array.isArray(B.runs)?B:void 0;if(ce!==void 0){e.applyEvent?.({nodeId:L.nodeId,sequence:ce.sequence,category:"session",payload:{session:ce.session}});const ne=ce.runs;if(e.applyRunsSnapshot!==void 0)e.applyRunsSnapshot(ne);else for(const oe of ne)e.applyEvent?.({nodeId:L.nodeId,sequence:ce.sequence,category:"run",payload:{run:oe}});typeof ce.queue=="object"&&ce.queue!==null&&e.applyEvent?.({nodeId:L.nodeId,sequence:ce.sequence,category:"queue",payload:{sessionId:F,queue:ce.queue}},"initial"),"context"in ce&&e.applyEvent?.({nodeId:L.nodeId,sequence:ce.sequence,category:"session",payload:{sessionId:F,context:ce.context}}),ce.performance!==void 0&&e.applyEvent?.({nodeId:L.nodeId,sequence:ce.sequence,category:"conversation",payload:{sessionId:F,performance:ce.performance}})}const O=ce?.conversation??L.payload,Y=Zn(O)??ct(O);if(w?.sessionId===F&&w.watchId===o){const ne=w;w=void 0,ne.removeAbortListener(),e.applySnapshot(F,Y),v.value={watchId:ne.watchId,nodeId:L.nodeId,workspaceId:L.workspaceId,sessionId:F,connectionId:L.workbenchConnectionId};const oe=typeof ce?.sequence=="number"?ce.sequence:Y.snapshotSequence;for(const Z of ne.events){const we=Z.category==="conversation"?Y.snapshotSequence??oe:oe;we!==void 0&&Z.sequence<=we||e.applyEvent?.(Z)}return ne.resolve(),!0}return Promise.resolve(e.applySnapshot(F,Y,"refresh")).then(ne=>{if(ne&&e.followConversation.value)return e.scrollAfterLayout()}),!0}function K(b){if(b.type!=="watch.failed"||b.watchType!=="session"||b.watchId!==o||b.workbenchConnectionId!==t()||b.sessionId!==a||b.nodeId!==e.workspaceTarget.value?.nodeId||b.workspaceId!==i||typeof b.nodeGeneration!="string"||m!==void 0&&b.nodeGeneration!==m)return!1;m??=b.nodeGeneration;const L=a;return L===void 0?!0:w?.sessionId===L&&w.watchId===o?(x(new ot(wo(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.")),p.pause(),!0):h>=3?(C(),e.refreshSnapshot(),!0):(h+=1,p.pause(),g=setTimeout(()=>{g=void 0,e.selectedSessionId.value===L&&A(L,!1)},Math.min(e.heartbeatMs,1e3*2**(h-1))),!0)}function Q(){document.visibilityState!=="visible"&&C()}function J(b,L){b!==void 0&&L!==void 0&&b.id===e.selectedSessionId.value&&Xn(b)==="MANAGED_ACTIVE"&&L.id===b.id&&R(L)&&y(L.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===t(),canWatchSessionHistory:b=>n()&&R(b),initializeSelectedSessionWatch:N,beginSelectedSessionWatch:y,restartSelectedSessionWatch:A,pauseSelectedSessionWatch:I,stopSelectedSessionWatch:C,reconcileWorkspaceSnapshot:J,handleEvent(b){return typeof b!="object"||b===null?!1:K(b)||D(b)},handleSessionWatchVisibility:Q}}const fa=new TextEncoder;function Sn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ga(e){const t=W([]),n=W(null),o=ma({...e,turns:t,nextCursor:n});return{turns:t,nextCursor:n,projection:o}}function ma(e){const t=new Map,n=new Map,o=new Map;let a=0,r=0;const i=new Map;let c,m=!1;const v=e.scheduleTextDeltaFlush??(q=>{if(typeof requestAnimationFrame=="function"){const G=requestAnimationFrame(q);return()=>cancelAnimationFrame(G)}return queueMicrotask(q),()=>{}}),g=q=>`${q.sessionId}:${q.id}`,h=(q,G)=>`${g(q)}:${G}`;function w(q,G){if(G.length<q.length){const ae=new Set(G.map(ie=>g(ie))),ue=new Set(G.map(ie=>ie.runId));for(const ie of q){if(ae.has(g(ie)))continue;t.delete(g(ie));const M=`${g(ie)}:`;for(const j of n.keys())j.startsWith(M)&&n.delete(j);wt(ie)&&!ue.has(ie.runId)&&o.delete(ie.runId)}}}function x(q){w(e.turns.value,q),e.turns.value=[...q]}function T(){x(e.limitHistory(e.turns.value))}function E(){return e.turns.value.length<=vn?!1:(x(hn(e.turns.value,_n)),e.nextCursor.value=null,!0)}function R(){ne(),n.clear(),t.clear(),o.clear(),r=0,a=0}function U(q){R()}function H(q,G){R(),e.turns.value=[...q],e.nextCursor.value=G}function p(q){const G=new Set(e.turns.value.map(ae=>ae.id));e.turns.value=e.limitHistory([...q.turns.filter(ae=>!G.has(ae.id)),...e.turns.value]),e.nextCursor.value=q.nextCursor}function y(q){e.turns.value=e.limitHistory(jt(e.turns.value,q.turns)),e.nextCursor.value=q.nextCursor}function C(){e.nextCursor.value=null}function A(q,G){e.turns.value=da(e.turns.value,q,G)}function N(q){let G=!1;const ae=e.turns.value.map(ue=>{if(!D(ue,q))return ue;let ie=!1;const M=ue.items.map(j=>j.id!==q||j.kind!=="user_message"||!Sn(j.payload)||j.payload.clientMessageId!==q?j:(ie=!0,G=!0,{...j,payload:{...j.payload,delivery:"ACCEPTED"}}));return ie?{...ue,items:M}:ue});return G&&(e.turns.value=ae),G}function I(q){const G=e.turns.value.filter(ae=>!D(ae,q));return G.length===e.turns.value.length?!1:(e.turns.value=G,!0)}function D(q,G){return q.id===G&&q.runId===null&&q.items.some(ae=>ae.id===G&&ae.kind==="user_message"&&Sn(ae.payload)&&ae.payload.clientMessageId===G)}function K(q,G){O();const ae=`${q}:`;for(const ue of t.keys())ue.startsWith(ae)&&t.delete(ue);for(const ue of n.keys())ue.startsWith(ae)&&n.delete(ue);for(const ue of G)o.delete(ue)}function Q(q,G){if(G===void 0)return;a=Math.max(a,G);const ae=g(q);t.set(ae,Math.max(t.get(ae)??0,G))}function J(q,G){return eo(e.turns.value,q,G)}function b(q,G){return G!==void 0&&G<=(o.get(q)??-1)}function L(q,G){const ae=typeof G.segmentId=="string"?G.segmentId:void 0,ue=typeof G.turnId=="string"?G.turnId:void 0;if(ae===void 0){if(typeof G.itemId=="string"){const pe=e.turns.value.findIndex(ve=>ve.runId===q&&(ue===void 0||(ve.turnId??ve.id)===ue)&&ve.items.some(Re=>Re.id===G.itemId));if(pe>=0)return pe}return J(q,ue)}const ie=e.turns.value.findIndex(pe=>pe.id===ae&&(pe.runId===q||pe.runId===null));if(ie>=0)return e.turns.value[ie].runId===null&&(e.turns.value=e.turns.value.map((pe,ve)=>ve===ie?{...pe,runId:q}:pe)),ie;if(ue===void 0||typeof G.segmentIndex!="number"||!Number.isInteger(G.segmentIndex)||G.segmentIndex<0)return-1;O();const M=J(q,ue),j=M>=0?M:e.turns.value.findLastIndex(pe=>pe.turnId===ue&&pe.runId===null),V=e.turns.value[j];if(V===void 0)return-1;const me=G.segmentIndex;if(me<=(V.segmentIndex??-1))return-1;const ye={...V,id:ae,turnId:ue,runId:q,segmentIndex:me,items:[],startedAt:null,completedAt:null};return e.turns.value=jt(e.turns.value,[{...V,status:"SUCCEEDED"},ye]),E()&&e.onRecentWindowOverflow(),e.turns.value.findIndex(pe=>pe.id===ae&&pe.runId===q)}function F(q,G,ae){if(b(q,ae))return;const ue=L(q,G),ie=e.turns.value[ue];if(ie===void 0||va(ie.status))return;const M=typeof G.itemId=="string"?G.itemId:void 0,j=M===void 0?void 0:ie.items.find(V=>V.id===M&&V.kind==="assistant_message");if(!(j!==void 0&&xt(j.status))&&!(M!==void 0&&ae!==void 0&&ae<=(n.get(h(ie,M))??-1)))return{turnIndex:ue,turn:ie}}function B(q,G,ae,ue=Date.now()){O();const ie=ge(G);if(ie===void 0)return!1;const{itemId:M,kind:j,status:V}=ie;if(typeof M!="string"||typeof j!="string"||typeof V!="string"||b(q,ae))return!1;const me=L(q,ie);if(me<0)return!1;const ye=e.turns.value[me],pe=ye.items.findIndex(ke=>ke.id===M),ve=pe<0?void 0:ye.items[pe],Re=h(ye,M);if(ae!==void 0&&ae<=(n.get(Re)??Number.NEGATIVE_INFINITY)||ve!==void 0&&xt(ve.status)&&!xt(V))return!1;const Le=St(ue)?ue:Date.now(),Ue=ye.items.at(-1),fe=ye.items.map(ke=>ke.id===Ue?.id&&ke.kind==="assistant_message"&&ke.status==="IN_PROGRESS"?{...ke,status:"COMPLETED",completedAt:Le}:ke),_=St(ie.startedAt)?ie.startedAt:ve?.startedAt??Le,P=ie.completedAt===null?null:St(ie.completedAt)?ie.completedAt:xt(V)?ve?.completedAt??Le:ve?.completedAt??null,ee={id:M,kind:j,status:V,...ie.processGroup===void 0?{}:{processGroup:Eo.parse(ie.processGroup)},...typeof ie.parentItemId=="string"?{parentItemId:ie.parentItemId}:{},startedAt:_,completedAt:P,payload:pn(ie.merge===!0&&ve!==void 0?qo(ve.payload,ie.payload,ie.append):ie.payload)};return pe<0?fe.push(ee):fe.splice(pe,1,ee),e.turns.value=e.turns.value.map((ke,Oe)=>Oe===me?{...ke,items:fe,startedAt:ke.startedAt??ee.startedAt}:ke),ae!==void 0&&n.set(Re,ae),Q(ye,ae),T(),!0}function ce(q,G,ae,ue=Date.now()){const ie=ge(G),M=ie?.text;if(typeof M!="string"||M.length===0||ie===void 0)return!1;const j=F(q,ie,ae);if(j===void 0)return!1;const{turnIndex:V,turn:me}=j,ye=typeof ie?.itemId=="string"?ie.itemId:void 0,pe=me.items.at(-1),ve=ye===void 0&&pe?.kind==="assistant_message"&&pe.status==="IN_PROGRESS",Re=ye===void 0?ve?me.items.length-1:-1:me.items.findIndex(Oe=>Oe.id===ye&&Oe.kind==="assistant_message"),Le=Re>=0?me.items[Re].id:ye??`${q}:assistant:${ae??"live"}`,Ue=Re<0?void 0:me.items[Re],fe=h(me,Le);if(ae!==void 0&&ae<=(n.get(fe)??Number.NEGATIVE_INFINITY))return!1;const _=ge(Ue?.payload),P=`${typeof _?.text=="string"?_.text:""}${M}`,ee={id:Le,kind:"assistant_message",status:"IN_PROGRESS",startedAt:Ue?.startedAt??(St(ue)?ue:Date.now()),completedAt:null,payload:{..._??{},...pn({text:P}),format:"markdown",model:null}},ke=[...me.items];return Re<0?ke.push(ee):ke.splice(Re,1,ee),e.turns.value=e.turns.value.map((Oe,nt)=>nt===V?{...Oe,items:ke,startedAt:Oe.startedAt??ee.startedAt}:Oe),ae!==void 0&&n.set(fe,ae),r+=fa.encode(M).byteLength,r>=64*1024?(Q(me,ae),T(),r=0,!0):(Q(me,ae),!0)}function O(){c?.(),c=void 0,m=!1,Y()}function Y(){if(i.size===0)return;const q=[...i.values()];i.clear();for(const G of q)ce(G.runId,G,G.sequence,G.createdAt)}function ne(){c?.(),c=void 0,m=!1,i.clear()}function oe(q,G,ae,ue=Date.now()){const ie=ge(G),M=ie?.text;if(typeof M!="string"||M.length===0)return!1;const j=ie!==void 0&&typeof ie.itemId=="string"?ie.itemId:void 0;if(ie===void 0)return!1;const V=F(q,ie,ae);if(V===void 0)return!1;const me=V.turn,ye=`${q}\0${me.id}\0${j??""}`,pe=i.get(ye);if(pe!==void 0&&ae!==void 0&&ae<=(pe.sequence??-1))return!1;if(pe===void 0?i.set(ye,{runId:q,...j===void 0?{}:{itemId:j},turnId:me.turnId??me.id,...me.segmentIndex===void 0?{}:{segmentId:me.id,segmentIndex:me.segmentIndex},text:M,chunks:[{text:M,sequence:ae}],...ae===void 0?{}:{sequence:ae},createdAt:ue}):(pe.text+=M,pe.chunks.push({text:M,sequence:ae}),ae!==void 0&&(pe.sequence=ae)),!m){m=!0;const ve=v(()=>{m=!1,c=void 0,Y()});m?c=ve:ve()}return!0}function Z(q,G){Q(q,G),!(!wt(q)||G===void 0)&&o.set(q.runId,Math.max(o.get(q.runId)??0,G))}function we(q){return q.snapshotSequence!==void 0&&q.snapshotSequence<a}function Ae(q){if(O(),we(q))return!1;const G=e.turns.value,ae=q.turns.map(mn),ue=ae.some(ve=>!G.some(Re=>Re.id===ve.id)),ie=ae,M=new Map(G.map(ve=>[ve.id,ve])),j=ie.map(ve=>{const Re=M.get(ve.id);if(Re===void 0)return Q(ve,q.snapshotSequence),ve;const Le=t.get(g(ve));if(Le!==void 0&&q.snapshotSequence!==void 0&&Le>q.snapshotSequence)return Re;Q(ve,q.snapshotSequence);const Ue=Re.items.filter(No);return Ue.length===0?ve:{...ve,items:jo(ve.items,Re.items,Ue)}}),V=Uo(jt(G,j)),me=ue&&V.length>vn,ye=e.limitHistory(me?hn(V,_n):V),pe=JSON.stringify(G)!==JSON.stringify(ye);return w(V,ye),me&&(e.nextCursor.value=null),!me&&e.nextCursor.value===null&&q.nextCursor!==null&&(e.nextCursor.value=q.nextCursor),pe&&(e.turns.value=ye),me&&e.onRecentWindowOverflow(),pe}function $(q){return O(),we(q)?!1:(z(q),!0)}function z(q){const G=q.turns.map(mn),ae=[...i.values()];R(),e.turns.value=e.limitHistory(G),e.nextCursor.value=q.nextCursor,a=q.snapshotSequence??0;for(const ue of e.turns.value)Z(ue,q.snapshotSequence);for(const ue of ae){const ie=q.snapshotSequence;if(ie===void 0)continue;const M=ue.chunks.filter(j=>j.sequence!==void 0&&j.sequence>ie);M.length!==0&&ce(ue.runId,{...ue,text:M.map(j=>j.text).join("")},M.at(-1).sequence,ue.createdAt)}}function Ce(q){return O(),we(q)?!1:(z(q),!0)}return{resetHistory:R,restore:U,restoreWindow:H,mergeOlderPage:p,recoverWindow:y,clearCursor:C,syncRunStatus:A,updateOptimisticUserMessage:N,removeOptimisticUserMessage:I,clearSession:K,markLive:Q,mergeItem:B,mergeTextDelta:oe,flushPendingTextDeltas:O,mergeLatest:Ae,replaceRecent:$,replaceAuthoritative:Ce}}function St(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function xt(e){return["COMPLETED","FAILED","DECLINED","CANCELLED","INTERRUPTED"].includes(e)}function va(e){return["SUCCEEDED","FAILED","CANCELLED","INTERRUPTED","LOST"].includes(e)}function to(e){const t=Wt(e);return t?.kind==="context_compaction"&&t.status==="COMPLETED"}function ha(e){const t=Wt(e),n=Wt(t?.payload);return to(e)&&n?.retainedContext===!0}function rv(e,t){return to(e)?ha(e)?null:t==null?t:{...t,usedTokens:0,percentage:0,...t.gcCount===void 0?{}:{gcCount:0},...t.gcCount===void 0&&t.gcReclaimedTokens===void 0?{}:{gcReclaimedTokens:0}}:t}function sv(e){const{turns:t,nextCursor:n,projection:o}=ga({onRecentWindowOverflow:e,limitHistory:Bo});let a=0,r;const i=W(0);function c(){r!==void 0&&(clearTimeout(r.timer),r.resolve(),r=void 0)}function m(){c(),i.value+=1;const g=i.value;return new Promise(h=>{const w=setTimeout(()=>{r?.version===g&&(r=void 0,h())},1e4);r={version:g,resolve:h,timer:w}})}function v(g){r?.version===g&&c()}return{turns:t,nextCursor:n,projection:o,loadingInitial:W(!1),initialLoadFailed:W(!1),initialFailureCause:Ct(),loadingOlder:W(!1),channelInput:W(""),channelToken:W(),contextUsage:W(),initialRenderVersion:i,beginInitialRender:m,confirmInitialRender:v,cancelInitialRender:c,nextDetailRequest:()=>++a,currentDetailRequest:()=>a}}function Wt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)?e:void 0}function pa(e){return typeof e=="object"&&e!==null&&typeof e.id=="string"&&typeof e.sessionId=="string"&&typeof e.status=="string"}function _a(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 lv(e){function t(a,r){const i=e.setNodeConnection?.(a,r);r&&i===!1&&e.onNodeConnected(a)}function n(a,r="event"){const i=ge(a.payload);if(a.category==="node"&&typeof i?.connected=="boolean"){t(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:h,queue:w}=i;if(typeof h=="string"&&a.nodeId===e.workspaceTarget.value?.nodeId&&typeof w=="object"&&w!==null){const x=e.selectedSession?.value,T=x?.id===h&&x.workspaceId===e.workspaceTarget.value?.workspaceId?x:e.sessions.value.find(E=>E.id===h&&E.workspaceId===e.workspaceTarget.value?.workspaceId);T!==void 0&&Yn(T)&&e.cacheQueue(a.nodeId,T.workspaceId,h,w,r),h===e.selectedSessionId.value&&e.mergeQueue(w,r)}return}if(a.category==="session"&&i!==void 0&&a.nodeId===e.workspaceTarget.value?.nodeId){const h=i.session;if(_a(h)){const w=h.id===e.selectedSessionId.value;w&&h.activity!==void 0&&h.activity!=="MANAGED_ACTIVE"&&e.settleSessionRuns(h.id),e.mergeSessions([h]),w&&h.activity==="MANAGED_ACTIVE"&&e.observeManagedSessionActive(h.id)}typeof i.sessionId=="string"&&"context"in i&&e.updateContext(i.sessionId,i.context??null);return}if(a.category==="run"&&i!==void 0&&pa(i.run)){const h=i.run;if(e.syncTurnStatus(h.id,h.status,h.sessionId),a.nodeId===e.workspaceTarget.value?.nodeId&&e.cacheRun(h),h.sessionId===e.selectedSessionId.value&&a.nodeId===e.workspaceTarget.value?.nodeId){const w=e.acceptRun(h);["STARTING","RUNNING","CANCELLING"].includes(w.status)&&e.openRun(h.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=ge(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 m=ge(i.delta);if(m!==void 0&&typeof m.runId=="string"&&typeof m.itemId=="string"&&typeof m.text=="string"&&a.nodeId===e.workspaceTarget.value?.nodeId&&i.sessionId===e.selectedSessionId.value){e.mergeTextDelta(m.runId,m,a.sequence,typeof m.createdAt=="number"?m.createdAt:void 0);return}const v=Zn(i.snapshot,a.sequence);if(v!==void 0&&a.nodeId===e.workspaceTarget.value?.nodeId){const h=v.turns[0]?.sessionId??(typeof i.sessionId=="string"?i.sessionId:void 0);h!==void 0&&e.applyConversationSnapshot(h,v,"refresh");return}const g=i.turn;if(Fo(g)&&a.nodeId===e.workspaceTarget.value?.nodeId){if(!Array.isArray(i.segments)||!i.segments.every(tn))return;const h=ct({segments:i.segments,nextCursor:e.conversationNextCursor.value,snapshotSequence:a.sequence}).turns;if(h.length===0)return;for(const w of h)e.markLiveTurn(w,a.sequence),e.cacheTurn(w);g.sessionId===e.selectedSessionId.value&&e.mergeTurns({turns:h,nextCursor:e.conversationNextCursor.value,snapshotSequence:a.sequence});return}}function o(a){(a.category==="node"||a.category==="workspace")&&n(a)}return{apply:n,applyBroadcast:o,updateNodeConnection:t}}function cv(e){let t=!1,n=!1,o=0;const a=W("");Pe([e.workspaceTarget,e.selectedSessionId],()=>{o+=1,t=!1,n=!1,e.loadingOlder.value=!1,a.value=""},{flush:"sync"});async function r(){await i(e.pageSize)}async function i(g){const h=e.workspaceTarget.value?.nodeId,w=e.selectedSessionId.value,x=e.nextCursor.value;if(h===void 0||w===void 0||x===null||e.loadingOlder.value||t)return;const T=o;e.loadingOlder.value=!0,a.value="";let E=x;try{let R;try{R=await c(h,w,g,E)}catch(H){if(et(H)!=="EVENT_CURSOR_INVALID")throw H;if(e.workspaceTarget.value?.nodeId!==h||e.selectedSessionId.value!==w||o!==T||e.nextCursor.value!==E)return;const p=await m(h,w,E,T);if(p===void 0||e.workspaceTarget.value?.nodeId!==h||e.selectedSessionId.value!==w||o!==T||e.nextCursor.value!==(p??E))return;if(p===null){const y=e.capturePrependAnchor();e.clearCursor(),await Ne(),o===T&&e.workspaceTarget.value?.nodeId===h&&e.selectedSessionId.value===w&&e.nextCursor.value===null&&y();return}E=p,R=await c(h,w,g,E)}if(e.workspaceTarget.value?.nodeId!==h||e.selectedSessionId.value!==w||o!==T||e.nextCursor.value!==E)return;const U=e.capturePrependAnchor();e.mergeOlderPage(R),await Ne(),o===T&&e.workspaceTarget.value?.nodeId===h&&e.selectedSessionId.value===w&&U()}catch(R){e.workspaceTarget.value?.nodeId===h&&e.selectedSessionId.value===w&&o===T&&e.nextCursor.value===E&&(a.value=l("generated.workbenchConversationPagingService.unableToLoadEarlierConversationHistory",{value0:e.errorMessage(R)}))}finally{o===T&&(e.loadingOlder.value=!1)}}async function c(g,h,w,x){const T=await e.request(`/api/agent-sessions/${e.sessionPathId(h)}/turns?nodeId=${encodeURIComponent(g)}&limit=${w}&cursor=${encodeURIComponent(x)}&unit=SEGMENT`);return ct(T)}async function m(g,h,w,x){const T=await e.request(`/api/agent-sessions/${e.sessionPathId(h)}/turns?nodeId=${encodeURIComponent(g)}&limit=${e.recentSegmentWindowSize}&unit=SEGMENT`),E=ct(T);if(e.workspaceTarget.value?.nodeId!==g||e.selectedSessionId.value!==h||o!==x||e.nextCursor.value!==w)return;const R=E.nextCursor===null?{...E,nextCursor:w}:E;if(e.recoverWindow(R),await Ne(),!(e.workspaceTarget.value?.nodeId!==g||e.selectedSessionId.value!==h||o!==x||e.nextCursor.value!==R.nextCursor))return E.nextCursor}async function v(){const g=e.workspaceTarget.value?.nodeId,h=e.selectedSessionId.value;if(g===void 0||h===void 0)return;if(t){n=!0;return}t=!0;let w=o;try{do{n=!1,w=++o,e.loadingOlder.value=!1,a.value="";const x=await e.request(`/api/agent-sessions/${e.sessionPathId(h)}/turns?nodeId=${encodeURIComponent(g)}&limit=${e.recentSegmentWindowSize}&unit=SEGMENT`),T=ct(x);if(o!==w||e.workspaceTarget.value?.nodeId!==g||e.selectedSessionId.value!==h)return;n||e.replaceRecent(T)}while(n)}catch{}finally{o===w&&(t=!1)}}return{olderHistoryError:a,loadOlderConversationTurns:r,refreshRecentConversationTurns:v}}const ba=28,xn=48;function dv(){const e=W(),t=W(!0),n=W(!1);let o,a,r,i=0,c;function m(p){e.value=p,o=p?.clientWidth,a=p?.clientHeight,r=p?.scrollHeight,i=p?.scrollTop??0,c=void 0}function v(p){const y=p.clientWidth!==o||p.clientHeight!==a||p.scrollHeight!==r;return o=p.clientWidth,a=p.clientHeight,r=p.scrollHeight,y}function g(p){const y=p.getBoundingClientRect(),C=p.ownerDocument.elementFromPoint(y.left+y.width/2,y.top+y.height/2);c=C!==null&&C!==p&&p.contains(C)?{element:C,top:C.getBoundingClientRect().top}:void 0}function h(p){const y=e.value;if(y===void 0||n.value)return;const C=v(y),A=c!==void 0&&y.contains(c.element)&&Math.abs(c.element.getBoundingClientRect().top-c.top)<1,N=!A&&y.scrollTop<i-1,I=!A&&y.scrollTop>i,D=y.scrollHeight-y.scrollTop-y.clientHeight;if(i=y.scrollTop,C&&(!N&&!I||t.value&&D<=1)){t.value?T():c===void 0&&g(y);return}t.value=!N&&(t.value||I)&&D<ba,t.value?c=void 0:(N||I||c===void 0)&&g(y),N&&y.scrollTop<xn&&y.scrollHeight>y.clientHeight+xn&&p()}function w(){const p=e.value;p===void 0||!v(p)||!t.value||H()}function x(){const p=e.value;p!==void 0&&(t.value=!1,n.value=!1,v(p),i=p.scrollTop,g(p))}function T(){const p=e.value;p!==void 0&&(p.scrollTop=p.scrollHeight,i=p.scrollTop,t.value=!0,c=void 0)}function E(p){const y=e.value;if(y===void 0)return()=>{};const C=y.scrollHeight,A=y.scrollTop,N=p&&t.value;return()=>{if(!(e.value!==y||y.scrollTop!==A)){if(N){t.value&&(T(),v(y));return}y.scrollTop=A+(y.scrollHeight-C),i=y.scrollTop,v(y),t.value||g(y)}}}function R(){return E(!0)}function U(){return E(!1)}async function H(p=()=>!0){const y=e.value;y===void 0||!p()||(T(),await Ne(),!(e.value!==y||!t.value||!p())&&(T(),await new Promise(C=>requestAnimationFrame(()=>C())),!(e.value!==y||!t.value||!p())&&(T(),await new Promise(C=>setTimeout(C,50)),!(e.value!==y||!t.value||!p())&&T())))}return{element:e,following:t,positioningInitialConversation:n,setElement:m,handleScroll:h,handleResize:w,stopFollowing:x,scrollToLatest:T,captureRenderAnchor:R,capturePrependAnchor:U,scrollToLatestAfterLayout:H}}const ya=5e3;function Kt(e){return`session:${e===void 0||e.startsWith("draft:")?"draft":e}`}function uv(){const e=ka(),t={};return{...e.bind(()=>t),transferSession:(n,o)=>e.transfer(t,t,n,o)}}function ka(){const e=new WeakMap,t=new Map,n=new WeakMap;function o(v){const g=JSON.stringify([v.nodeId,v.workspaceId,v.kind,v.kind==="session"?v.sessionId:null]);let h=t.get(g);return h===void 0&&(h={},t.set(g,h),n.set(h,g)),h}const a=W(0),r={};function i(v){let g=e.get(v);return g===void 0&&(g={slots:new Set([v]),tokens:Ct([])},e.set(v,g)),g}function c(v){const g=X(()=>(a.value,i(v()??r)));function h(w,x,T=ya){const E=g.value;if(E.tokens.value.length!==0)return;const R={group:E,context:w,active:!0};function U(){return R.active?(R.active=!1,clearTimeout(R.timeout),R.group.tokens.value=R.group.tokens.value.filter(H=>H!==R),!0):!1}return E.tokens.value=[...E.tokens.value,R],T!==null&&(R.timeout=setTimeout(()=>{U()&&x?.()},T)),U}return{pending:X(()=>g.value.tokens.value.length!==0),context:X(()=>g.value.tokens.value.find(w=>w.context!==void 0)?.context),begin:h}}function m(v,g,h,w,x=!1){const T=e.get(v);if(T===void 0)return;const E=e.get(g)??T;for(const R of T.tokens.value)R.context===Kt(h)&&(R.context=Kt(w)),R.group=E;if(E!==T){E.tokens.value=[...E.tokens.value,...T.tokens.value];for(const R of T.slots)e.set(R,E),E.slots.add(R)}else E.tokens.value=[...E.tokens.value];if(e.set(g,E),E.slots.add(g),x&&v!==g){e.delete(v),E.slots.delete(v);const R=n.get(v);R!==void 0&&t.get(R)===v&&t.delete(R)}a.value+=1}return{bind:c,transfer:m,forTarget:o}}const fv="";function gv(e,t=[]){const n=e??W(t);function o(m){if(n.value.some(g=>g.name===m.name))return!1;const v={name:m.name,source:m.source,skillFilePath:m.skillFilePath,available:!0};return n.value=[...n.value,v],!0}function a(m){n.value=n.value.filter(v=>v.name!==m)}function r(){n.value=[]}function i(m){n.value=m.filter(no)}function c(m){const v=new Map(m.map(g=>[g.name,g]));n.value=n.value.map(g=>{const h=v.get(g.name);return h===void 0?{...g,available:!1}:{name:h.name,source:h.source,skillFilePath:h.skillFilePath,available:!0}})}return{tokens:n,select:o,remove:a,clear:r,restore:i,reconcile:c}}function Ca(e,t,n=[]){return[t,e.length>0?ln("mar_skills",{action:"use",instruction:Io,skills:e.map(o=>({name:o.name,source:o.source,path:o.skillFilePath}))}):"",n.length>0?ln("mar_references",{references:[...n]}):""].filter(o=>o.length>0).join(`
|
|
2
2
|
`).trim()}function wa(e){return e.some(t=>!t.available)}function mv(e){return Array.isArray(e)?e.filter(no):[]}function no(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 oo=new Set(["SUCCEEDED","FAILED","CANCELLED","INTERRUPTED","LOST"]);function Tn(e){return e==="STARTING"?1:e==="RUNNING"?2:e==="CANCELLING"?3:oo.has(e)?4:-1}function He(e){return oo.has(e)}function Ut(e,t){return e===void 0?t:e.version!==void 0&&t.version!==void 0&&e.version!==t.version?e.version>t.version?e:t:Tn(e.status)>Tn(t.status)?e:t}function Ea(e,t){return e?.id??t.workspaceId}function Ia(e,t){return e??(t?"QUEUE":"SEND")}function vv(e){const t=Hn(),n=()=>t?.active!==!1;let o;const a=(i,c,m,v,g,h)=>JSON.stringify([i,c,m,v,g,h.map(w=>w.id)]);async function r(i,c=!1,m,v){if(!n()||e.workspaceTarget.value?.nodeId===void 0||!e.composerOpen.value||e.submissionAvailable?.()===!1)return;const g=e.workspaceTarget.value?.nodeId,h=e.workspaceTarget.value?.workspaceId,w=()=>e.workspaceTarget.value?.nodeId===g&&e.workspaceTarget.value?.workspaceId===h,x=e.captureDraft();if(x===void 0)return;const T=x.input,E=x.skillTokens,R=x.references,U=T.value,p=U.trim();if(v===void 0&&m===void 0&&wa(E.value)){e.notice(l("composer.skillUnavailable"),"warning");return}let y;try{y=v?.input??m??Ca(E.value,T.value,R?.value)}catch(oe){e.notice(l("generated.workbenchSessionMessageService.unableToSendTheMessage",{value0:e.errorMessage(oe)}),"error",oe);return}const C=v?.command??(m===void 0?e.selectedCommand.value:void 0);if(C!==void 0&&e.commandAvailable?.(C)===!1||C===void 0&&y.length===0&&e.attachments.value.length===0)return;if(e.attachmentsPending.value&&C===void 0&&m===void 0){e.notice(l("generated.workbenchSessionMessageService.attachmentsAreStillUploadingOrFailedWait"),"warning");return}const A=Ia(i,e.composerBusy.value),N=e.draftOpen.value||e.selectedSessionId.value?.startsWith("draft:")===!0,I=v?.input??(c&&C!==void 0?`/${C.id}`:y);if(N&&C!==void 0&&!(C.id==="fast"&&C.runner==="codex")){if(C.interaction==="IMMEDIATE_ACTION"||C.interaction==="DESTRUCTIVE_ACTION"){e.notice(l("generated.workbenchSessionMessageService.sendARegularMessageToCreateThe"),"warning");return}e.stageDraftCommand(C,I),c||(T.value="",x.persist()),v===void 0&&(e.selectedCommand.value=void 0,e.commandPickerOpen.value=!1);return}if(C?.interaction==="DESTRUCTIVE_ACTION"){const oe=e.selectedSessionId.value;try{await Vo.confirm(l("generated.workbenchSessionMessageService.clearSessionConfirmation"),l("generated.workbenchSessionMessageService.clearSession"),{closeIcon:Be("close"),icon:Be("warning"),type:"warning",confirmButtonText:l("generated.workbenchSessionMessageService.confirmClearSession"),cancelButtonText:l("generated.workbenchSessionMessageService.cancelClearSession"),confirmButtonClass:"el-button--danger"})}catch{return}if(oe===void 0||!w()||e.selectedSessionId.value!==oe||e.submissionAvailable?.()===!1||e.commandAvailable?.(C)===!1)return}const D=m===void 0?[...e.attachments.value]:[],K=E.value,Q=R?.value,J=e.selectedWorkspace.value;let b=!1,L,F,B;const ce=e.selectedSessionId.value,O=e.beginSubmission(Kt(ce),()=>{n()&&e.workspaceTarget.value?.nodeId===g&&e.workspaceTarget.value?.workspaceId===h&&e.selectedSessionId.value===(L?.id??ce)&&e.notice(l("workbench.submissionTimedOut"),"warning")});if(O===void 0)return;const Y=e.retainAttachments(C===void 0?D:[]);let ne=!1;try{if(C?.id==="fast"&&C.runner==="codex"){const ue=await e.request("/api/runner-commands",{method:"POST",body:JSON.stringify({nodeId:g,runner:"codex",commandId:"fast",input:`/fast ${e.fastEnabled.value?"off":"on"}`})});O()&&w()&&e.selectedSessionId.value===ce&&(e.fastEnabled.value=ue.enabled,!c&&T.value===U&&U.trim()===y&&(T.value="",x.persist()),v===void 0&&(e.selectedCommand.value=void 0,e.commandPickerOpen.value=!1));return}const oe=N;b=oe;const Z=e.draftOpen.value?await e.draft?.create(e.temporaryTitle(p)):e.selectedSession.value;if(!n())return;if(Z===void 0)throw new Error("SESSION_NOT_FOUND");if(L=Z,oe&&Z.id.startsWith("draft:")&&(F=e.sessions.value.find(ue=>ue.id===Z.id&&ue.workspaceId===Z.workspaceId)),C!==void 0){await e.executeCommand(Z,C,I),O()&&(!c&&T.value===U&&U.trim()===y&&(T.value="",x.persist()),v===void 0&&w()&&e.selectedSessionId.value===Z.id&&(e.selectedCommand.value=void 0,e.commandPickerOpen.value=!1));return}if(oe&&J===void 0)throw new Error(l("generated.workbenchSessionMessageService.selectAWorkspaceBeforeSendingAMessage"));const we=Ea(J,Z),Ae=a(g,we,Z.id,y,A,D);o?.signature!==Ae&&(o=void 0);const $=o?.clientMessageId??crypto.randomUUID();B={signature:Ae,clientMessageId:$},o=B,e.scrollToLatest();const z=await e.request(oe?"/api/agent-sessions/start":`/api/agent-sessions/${e.sessionPathId(Z.id)}/messages`,{method:"POST",body:JSON.stringify({nodeId:g,...oe?{workspaceId:we,runner:Z.runner,cwd:J.path,modelId:Z.modelId,effort:Z.effort,access:Z.access,...Z.runnerTitle?{title:Z.runnerTitle}:{},deferredCommands:e.deferredCommands.value.map(ue=>({commandId:ue.command.id,input:ue.input}))}:{workspaceId:we,...Z.runner==="mar-agent"?{modelId:Z.modelId}:{}},clientMessageId:$,content:y,deliveryIntent:A,computerUse:Z.runner==="mar-agent",attachmentIds:D.map(ue=>ue.id)})});if(!n())return;e.consumeAttachments(D),oe&&x.createdSession?.(z.session),o===B&&(o=void 0),oe&&w()&&e.selectedSessionId.value===Z.id&&(e.deferredCommands.value=[]);const Ce=e.selectedSessionId.value,q=w(),G=q&&Ce===Z.id;if(Z.id!==z.session.id&&e.migrateSessionCache(g,Z.workspaceId,Z.id,z.session.id,z.session),q&&e.replaceSession(Z.id,z.session),oe&&q&&e.selectedSessionId.value===z.session.id&&e.beginSessionWatch(z.session.id),G||q&&Ce===z.session.id){const ue=e.acceptRun({...z.run,sessionId:z.run.sessionId??z.session.id});(z.delivery===void 0||z.delivery==="STARTED")&&!He(ue.status)&&e.openRun(z.run.id)}else e.cacheRun(g,Z.workspaceId,{...z.run,sessionId:z.run.sessionId??z.session.id,workspaceId:z.run.workspaceId??Z.workspaceId});(G||q&&(Ce===z.session.id||e.selectedSessionId.value===z.session.id))&&e.scrollToLatestAfterLayout(),ne=O(),m===void 0&&T.value===U&&E.value===K&&R?.value===Q&&(T.value="",E.value=[],R!==void 0&&(R.value=[]),x.persist())}catch(oe){if(!n())return;if(o===B&&et(oe)!==void 0&&(o=void 0),ne=O(),b&&ne){const Z=F!==void 0&&e.sessions.value.includes(F);w()&&Z&&F!==void 0&&e.removeSessionExact(F),w()&&Z&&e.selectedSessionId.value===L?.id&&e.draft?.restore()}ne&&e.notice(l("generated.workbenchSessionMessageService.unableToSendTheMessage",{value0:e.errorMessage(oe)}),"error",oe)}finally{Y(),O()}}return{send:r}}function hv(e){const t=Hn(),n=a=>et(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(),m=()=>t?.active!==!1&&e.workspaceTarget.value?.nodeId===a&&e.workspaceTarget.value.workspaceId===r&&e.selectedSessionId.value===i&&e.currentRevision()===c,v=e.activeRun.value,g=e.beginSubmission(`session:${i}`);if(g!==void 0){if(v===void 0){try{const h=await e.request(`/api/agent-sessions/${e.sessionPathId(i)}/interrupt`,{method:"POST",body:JSON.stringify({nodeId:a})});m()&&(e.runService.mergeSnapshots([h.run]),e.selectedRunId.value=h.run.id)}catch(h){const w=g();m()&&!n(h)&&w&&e.notice(l("generated.workbenchRunControlService.runOperationDenied",{value0:e.errorMessage(h)}),"error",h)}finally{g()}return}try{const h=await e.request(`/api/agent-runs/${encodeURIComponent(v.id)}/interrupt`,{method:"POST",body:JSON.stringify({nodeId:a})});m()&&h.run!==void 0&&e.runService.replaceExistingRun(h.run)}catch(h){const w=g();m()&&!n(h)&&w&&e.notice(l("generated.workbenchRunControlService.runOperationDenied2",{value0:e.errorMessage(h)}),"error",h)}finally{g()}}}return{stopActiveRun:o}}async function Sa(e){const t=await globalThis.crypto.subtle.digest("SHA-256",await e.arrayBuffer());return[...new Uint8Array(t)].map(n=>n.toString(16).padStart(2,"0")).join("")}const An=5*1024*1024,xa=16e6;function ao(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 Ta(e){if(!ao(e))return e;if(e.size===0||e.size>An)throw new Error("COMPOSER_IMAGE_LIMIT_EXCEEDED");let t;try{if(t=await createImageBitmap(e),t.width*t.height>xa)throw new Error("COMPOSER_IMAGE_LIMIT_EXCEEDED");const n=document.createElement("canvas");n.width=t.width,n.height=t.height;const o=n.getContext("2d");if(o===null)throw new Error("COMPOSER_IMAGE_CONVERSION_FAILED");o.drawImage(t,0,0);const a=await new Promise(i=>n.toBlob(i,"image/png"));if(a===null||a.size===0||a.type!=="image/png")throw new Error("COMPOSER_IMAGE_CONVERSION_FAILED");if(a.size>An)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(n){throw et(n)==="COMPOSER_IMAGE_LIMIT_EXCEEDED"?n:new Error("COMPOSER_IMAGE_CONVERSION_FAILED")}finally{t?.close()}}const Aa=5,Pa=5*1024*1024,Pn=10*1024*1024,Ra=512*1024;function pv(e){const t=W([]),n=new Map,o=(I,D)=>I!==void 0&&D!==void 0&&I.kind===D.kind&&I.nodeId===D.nodeId&&I.workspaceId===D.workspaceId&&(I.kind==="workspace"||D.kind==="session"&&I.sessionId===D.sessionId),a=new Map,r=I=>JSON.stringify([I.nodeId,I.workspaceId,I.id]);function i(I){return I===void 0?[]:t.value.filter(D=>o(n.get(D.id),I))}const c=X(()=>i(e.context())),m=W(!1),v=W(),g=W(!1),h=new Map;function w(I,D){for(const K of D){const Q=i(I);if(Q.length>=Aa)return e.notice(l("generated.composerAttachmentService.theFirstMessageCanIncludeUpTo"),"warning");if(K.size===0||K.size>Pa){e.notice(l("generated.composerAttachmentService.attachmentMustBeLargerThan0And",{value0:K.name}),"warning");continue}if(Q.reduce((L,F)=>L+F.file.size,0)+K.size>Pn)return e.notice(l("generated.composerAttachmentService.totalAttachmentSizeCannotExceed10MiB"),"warning");if(I===void 0)return e.notice(l("generated.composerAttachmentService.selectAnOnlineWorkspaceBeforeAddingAttachments"),"warning");const b={id:crypto.randomUUID(),file:K,nodeId:I.nodeId,workspaceId:I.workspaceId,previewUrl:K.type.startsWith("image/")?URL.createObjectURL(K):null,receivedBytes:0,status:"UPLOADING"};n.set(b.id,{...I}),t.value=[...t.value,b],C(b)}}function x(I){const D=t.value.find(K=>K.id===I);v.value?.id===I&&(g.value=!1),D?.previewUrl!==null&&D?.previewUrl!==void 0&&URL.revokeObjectURL(D.previewUrl),t.value=t.value.filter(K=>K.id!==I),n.delete(I),D!==void 0&&N(D)}function T(I,D=!0){if(I===void 0)return;g.value=!1;const K=i(I);for(const J of K)J.previewUrl!==null&&URL.revokeObjectURL(J.previewUrl),D&&N(J),n.delete(J.id);const Q=new Set(K.map(J=>J.id));t.value=t.value.filter(J=>!Q.has(J.id))}function E(){g.value=!1;for(const I of t.value)I.previewUrl!==null&&URL.revokeObjectURL(I.previewUrl),N(I);t.value=[],n.clear()}function R(I,D){if(I.kind!=="workspace"||D.kind!=="session"||I.nodeId!==D.nodeId||I.workspaceId!==D.workspaceId)return;let K=!1;for(const[Q,J]of n)o(J,I)&&(n.set(Q,{...D}),K=!0);K&&(t.value=[...t.value])}function U(I){const D=I.map(r);for(const Q of D)a.set(Q,(a.get(Q)??0)+1);let K=!1;return()=>{if(!K){K=!0;for(const Q of D){const J=a.get(Q)-1;J===0?a.delete(Q):a.set(Q,J)}}}}function H(I){t.value=t.value.filter(D=>I.some(K=>K.id===D.id&&K.nodeId===D.nodeId&&K.workspaceId===D.workspaceId)?(v.value?.id===D.id&&(g.value=!1),D.previewUrl!==null&&URL.revokeObjectURL(D.previewUrl),n.delete(D.id),!1):!0)}function p(I){I.previewUrl!==null&&(v.value=I,g.value=!0)}function y(I){return{attachments:X(()=>i(I())),add:D=>w(I(),D),remove:D=>{o(n.get(D),I())&&x(D)},clear:(D=!0)=>T(I(),D)}}async function C(I){try{if(ao(I.file)){const J=await Ta(I.file),b=t.value.find(F=>F.id===I.id);if(b===void 0)return;if(t.value.filter(F=>o(n.get(F.id),n.get(b.id))).reduce((F,B)=>F+(B.id===b.id?J.size:B.file.size),0)>Pn)throw new Error("COMPOSER_IMAGE_LIMIT_EXCEEDED");b.file=J,I=b}const D=e.direct?.generation(I.nodeId);if(D!==void 0){const J=new AbortController;h.set(I.id,J);try{if(!t.value.some(F=>F.id===I.id))throw new Error("UPLOAD_CANCELLED");I.transport="DIRECT";const b=await Sa(I.file);if(J.signal.aborted)throw new Error("UPLOAD_CANCELLED");await e.direct.upload({nodeId:I.nodeId,nodeGeneration:D,descriptor:{direction:"UPLOAD",resource:{kind:"WORKSPACE_FILE",workspaceId:I.workspaceId,path:I.file.name},fileName:I.file.name,size:I.file.size,sha256:b,overwrite:!1,composerAttachment:{id:I.id,mime:I.file.type||"application/octet-stream"}},file:I.file,onProgress:F=>{I.receivedBytes=F},signal:J.signal});const L=t.value.find(F=>F.id===I.id);L!==void 0&&(L.status="COMPLETED");return}catch{if(!t.value.some(b=>b.id===I.id))return;I.receivedBytes=0,I.transport="SERVER",I.directFallback=!0}finally{h.delete(I.id)}}I.transport="SERVER";const K=await e.request(`/api/workspaces/${encodeURIComponent(I.workspaceId)}/uploads`,{method:"POST",body:JSON.stringify({nodeId:I.nodeId,name:I.file.name,mime:I.file.type||"application/octet-stream",size:I.file.size,overwrite:!1,composerAttachmentId:I.id})});if(!t.value.some(J=>J.id===I.id)){await N({...I,uploadId:K.upload.uploadId});return}const Q=t.value.find(J=>J.id===I.id);if(Q===void 0)return;for(Q.uploadId=K.upload.uploadId,Q.receivedBytes=K.upload.receivedBytes;Q.receivedBytes<Q.file.size;){const J=Q.receivedBytes,b=Q.file.slice(J,Math.min(Q.file.size,J+Ra)),L=await A(Q,J,b);Q.receivedBytes=L.receivedBytes}if(Q.uploadId===void 0)throw new Error("COMPOSER_ATTACHMENT_UPLOAD_FAILED");await e.request(`/api/workspaces/${encodeURIComponent(I.workspaceId)}/uploads/${encodeURIComponent(Q.uploadId)}/complete`,{method:"POST",body:JSON.stringify({nodeId:I.nodeId})}),Q.status="COMPLETED"}catch(D){const K=t.value.find(Q=>Q.id===I.id);if(K===void 0)return;K.status="FAILED",K.error=Kn(D),window.setTimeout(()=>x(I.id),1e3)}}async function A(I,D,K){let Q,J=!1;for(let b=0;b<3;b+=1)try{return await new Promise((L,F)=>{const B=new XMLHttpRequest,ce=`/api/workspaces/${encodeURIComponent(I.workspaceId)}/uploads/${encodeURIComponent(I.uploadId??"")}/chunks?nodeId=${encodeURIComponent(I.nodeId)}&offset=${D}`;B.open("POST",e.resourceUrl?.(ce)??ce),B.withCredentials=!0,B.setRequestHeader("content-type","application/octet-stream"),B.setRequestHeader("x-csrf-token",e.csrfToken.value),B.upload.onprogress=O=>{O.lengthComputable&&(I.receivedBytes=Math.min(I.file.size,D+O.loaded))},B.onerror=()=>F(new Error("UPLOAD_NETWORK_FAILED")),B.onabort=()=>F(new Error("UPLOAD_CANCELLED")),B.onload=()=>{if(B.status<200||B.status>=300){let O;try{O=JSON.parse(B.responseText).error?.code}catch{O=void 0}O==="UNAUTHENTICATED"&&e.onUnauthenticated(),F(new Error(O??`REQUEST_FAILED_${B.status}`));return}try{const O=JSON.parse(B.responseText);if(!Number.isSafeInteger(O.upload?.receivedBytes))throw new Error("NODE_RESPONSE_INVALID");L({receivedBytes:O.upload?.receivedBytes})}catch(O){F(O)}},B.send(K)})}catch(L){if(Q=L,et(L)==="UNAUTHENTICATED")throw L;if(et(L)==="CSRF_INVALID"){if(J)throw L;J=!0,await e.renewCsrfToken()}I.receivedBytes=D}throw Q instanceof Error?Q:new Error("COMPOSER_ATTACHMENT_UPLOAD_FAILED")}async function N(I){if(a.has(r(I)))return;h.get(I.id)?.abort(),h.delete(I.id);const D=I.status==="COMPLETED"?I.id:I.uploadId;D!==void 0&&await e.request(`/api/workspaces/${encodeURIComponent(I.workspaceId)}/uploads/${encodeURIComponent(D)}/cancel`,{method:"POST",body:JSON.stringify({nodeId:I.nodeId})}).catch(()=>{})}return{attachments:c,dragging:m,preview:v,previewOpen:g,add:I=>w(e.context(),I),remove:x,clear:(I=!0)=>T(e.context(),I),clearAll:E,moveDraft:R,forTarget:y,retainForSubmission:U,consume:H,openPreview:p}}const Je=new Set(["STARTING","RUNNING","CANCELLING"]);function _v(e){const t=W([]),n=W(),o=new Set,a=new Set,r=new Set,i=new Map;function c(p){const y=t.value.find(A=>A.id===p.id),C=Ut(y,p);return t.value=[C,...t.value.filter(A=>A.id!==p.id)],C}function m(p){t.value=[...p]}function v(p){t.value=t.value.map(y=>y.id===p.id?p:y)}function g(p){const y=new Map(t.value.map(D=>[D.id,D])),C=new Set(p.map(D=>D.id));for(const D of p)He(D.status)&&i.delete(D.id);const N=p.filter(D=>!Je.has(D.status)||!a.has(D.sessionId??"")&&!i.has(D.id)).map(D=>Ut(y.get(D.id),D)),I=t.value.filter(D=>D.sessionId===e.value&&!C.has(D.id)&&Je.has(D.status));t.value=[...I,...N];for(const D of t.value)D.sessionId!==void 0&&Je.has(D.status)&&o.delete(D.sessionId)}function h(p,y){for(const b of p){const L=i.get(b.id);L!==void 0&&!L.requested&&L.sessionId===b.sessionId&&Je.has(b.status)&&!r.has(L.sessionId)&&!a.has(L.sessionId)&&i.delete(b.id)}const C=new Map(y.map(b=>[b.id,b])),A=new Map(t.value.map(b=>[b.id,b])),N=new Set(p.map(b=>b.id)),I=t.value.filter(b=>{if(N.has(b.id))return!1;const L=C.get(b.id);return L===void 0||b.sessionId!==L.sessionId||b.workspaceId!==L.workspaceId||b.version!==L.version||b.status!==L.status||b.recoveryState!==L.recoveryState||b.clientMessageId!==L.clientMessageId||b.createdAt!==L.createdAt}),K=p.filter(b=>!Je.has(b.status)||!a.has(b.sessionId??"")&&!i.has(b.id)).map(b=>Ut(A.get(b.id),b)),Q=new Set(I.map(b=>b.id)),J=y.filter(b=>!N.has(b.id)&&!Q.has(b.id));t.value=[...I,...K],n.value!==void 0&&!t.value.some(b=>b.id===n.value&&Je.has(b.status))&&(n.value=void 0);for(const b of p)He(b.status)&&i.delete(b.id);for(const b of J)i.delete(b.id);for(const b of t.value)b.sessionId!==void 0&&Je.has(b.status)&&o.delete(b.sessionId)}function w(p,y){y!==void 0&&!o.has(p)||(o.add(p),y!==void 0&&(a.delete(p),i.set(y,{sessionId:p,requested:!0})))}function x(p){o.add(p),a.add(p),r.add(p);for(const y of i.values())y.sessionId===p&&(y.requested=!0)}function T(p,y=!1){const C=new Set(t.value.filter(A=>A.sessionId===p&&Je.has(A.status)).map(A=>A.id));C.size>0&&(t.value=t.value.filter(A=>!C.has(A.id))),n.value!==void 0&&C.has(n.value)&&(n.value=void 0),C.size>0&&o.add(p),y&&x(p);for(const A of C)i.set(A,{sessionId:p,requested:r.has(p)||i.get(A)?.requested===!0});return C.size>0}function E(p){r.has(p)||o.delete(p)}function R(p){o.delete(p),a.delete(p),r.delete(p);for(const[y,C]of i)C.sessionId===p&&i.delete(y)}function U(p){o.delete(p),a.delete(p),r.delete(p)}function H(p){return p!==void 0&&o.has(p)}return{runs:t,selectedRunId:n,acceptRun:c,replaceRuns:m,replaceExistingRun:v,mergeSnapshots:g,mergeAuthoritativeSnapshot:h,markSessionInterrupted:w,markSessionInterruptionPending:x,settleSessionRuns:T,observeManagedSessionActive:E,clearSessionInterruption:R,resumeSessionAfterInterruption:U,sessionInterruptionSettled:H}}function bv(e){const t=W(),n=W(),o=e?.draft??W(),a=X({get:()=>o.value?.content??"",set:m=>{o.value!==void 0&&(o.value={...o.value,content:m},e?.persist())}});function r(m){if(n.value=m.queueItemId,o.value?.queueItemId===m.queueItemId)return;const v=zn(m.content),g=v.flatMap(x=>x.kind==="text"?[x.text]:x.kind==="mar_steer"?[x.payload.message]:[]).join("").trim(),h=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
|
`),w=v.filter(x=>x.kind==="mar_session_origin"||x.kind==="mar_channel").map(x=>x.raw).join(`
|
|
4
4
|
`);o.value={queueItemId:m.queueItemId,content:g,tags:h,origin:w},e?.persist()}function i(){o.value?.queueItemId===n.value&&(o.value=void 0,e?.persist()),n.value=void 0}function c(){t.value=void 0,n.value=o.value?.queueItemId}return{draggingQueueItemId:t,editingQueueItemId:n,editingContent:a,startEditing:r,finishEditing:i,rebind:c,serializeEditedContent:m=>[o.value?.origin,m.trim(),o.value?.tags].filter(Boolean).join(`
|
package/web/assets/{workbench-presentation-b_MlZ-jq.js → workbench-presentation-DblBOxzZ.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a7 as M,al as $,d as T,bh as w,c as p,ai as k,aa as N,o as g,b as S,p as b,q as F,M as P,u as U,ac as O,v as h,S as C,f as D,af as B,t as s,a as c,ah as _}from"./index-
|
|
1
|
+
import{a7 as M,al as $,d as T,bh as w,c as p,ai as k,aa as N,o as g,b as S,p as b,q as F,M as P,u as U,ac as O,v as h,S as C,f as D,af as B,t as s,a as c,ah as _}from"./index-DsgwAvJA.js";import{d as x}from"./el-input-DRF3bOe1.js";import{f as G}from"./time-presentation-BRvT6nTd.js";import"./conversation-history-D9993EDO.js";const K=M({type:{type:String,values:["primary","success","warning","info","danger","default"],default:void 0},underline:{type:[Boolean,String],values:[!0,!1,"always","never","hover"],default:void 0},disabled:Boolean,href:{type:String,default:""},target:{type:String,default:"_self"},icon:{type:$}}),W={click:e=>e instanceof MouseEvent},q=["href","target"];var H=T({name:"ElLink",__name:"link",props:K,emits:W,setup(e,{emit:t}){const n=e,o=t,a=w("link");x({scope:"el-link",from:"The underline option (boolean)",replacement:"'always' | 'hover' | 'never'",version:"3.0.0",ref:"https://element-plus.org/en-US/component/link.html#underline"},p(()=>k(n.underline)));const i=N("link"),m=p(()=>[i.b(),i.m(n.type??a.value?.type??"default"),i.is("disabled",n.disabled),i.is("underline",f.value==="always"),i.is("hover-underline",f.value==="hover"&&!n.disabled)]),f=p(()=>k(n.underline)?n.underline?"hover":"never":n.underline??a.value?.underline??"hover");function y(l){n.disabled||o("click",l)}return(l,A)=>(g(),S("a",{class:C(m.value),href:e.disabled||!e.href?void 0:e.href,target:e.disabled||!e.href?void 0:e.target,onClick:y},[e.icon?(g(),b(U(O),{key:0},{default:F(()=>[(g(),b(P(e.icon)))]),_:1})):h("v-if",!0),l.$slots.default?(g(),S("span",{key:1,class:C(U(i).e("inner"))},[D(l.$slots,"default")],2)):h("v-if",!0),l.$slots.icon?D(l.$slots,"icon",{key:2}):h("v-if",!0)],10,q))}}),Q=H;const ee=B(Q),z={"en-US":{divisor:1e6,minimumFractionDigits:0},"zh-CN":{divisor:1e8,minimumFractionDigits:1}};function te(e){return{five_hour:s("nodeMessages.fiveHourLimit"),seven_day:s("nodeMessages.sevenDayLimit"),seven_day_sonnet:s("nodeMessages.sevenDaySonnetLimit")}[e.id]??e.label}function V(e){return e==="claude-code"?s("nodeMessages.claudeUsage"):s("nodeMessages.codexUsage")}function ne(e){const t=c(),n=c(!1),o=c(),a=c(!1),i=c(),m=c(),f=c(!1);function y(r){t.value=r,n.value=!0,o.value=void 0,a.value=!1,l(r.id)}async function l(r){try{const u=await e.request(`/api/runner-usage/status?nodeId=${encodeURIComponent(r)}`);t.value?.id===r&&(o.value=u.statuses,a.value=!1)}catch{t.value?.id===r&&(o.value=[],a.value=!0)}}function A(r){if(a.value)return s("generated.runnerUsageService.usageCapabilityDetectionFailedCloseAndReopen");const u=o.value?.find(d=>d.runner===r);return u===void 0?s("generated.runnerUsageService.detectingUsageCapability"):u.available?"":u.reasonCode==="OFFICIAL_OAUTH_REQUIRED"?s("generated.runnerUsageService.usageQueriesRequireAnOfficialOAuthAccount"):u.reasonCode==="RUNNER_UNAVAILABLE"?s("generated.runnerUsageService.thisRunnerIsUnavailableSoUsageCannot"):s("generated.runnerUsageService.thisRunnerDoesNotCurrentlySupportUsage")}async function I(r){const u=t.value;if(!(u===void 0||i.value!==void 0)){i.value=r;try{const d=await e.request(`/api/runner-usage?nodeId=${encodeURIComponent(u.id)}&runner=${encodeURIComponent(r)}`);m.value=d.usage,f.value=!0}catch(d){e.error(s("generated.runnerUsageService.unableToQueryUsage",{value0:e.errorMessage(d)}),d),l(u.id)}finally{i.value=void 0}}}function R(r){return V(r?.runner)}function E(r){return r===null?s("generated.runnerUsageService.notProvided"):G(r)}function L(){n.value=!1,t.value=void 0,o.value=void 0,a.value=!1}return{nodeDetails:t,detailsOpen:n,statuses:o,loading:i,details:m,usageOpen:f,openNode:y,loadStatuses:l,disabledReason:A,show:I,title:R,formatTimestamp:E,clearNode:L}}const ae=30;function v(e){return e!==void 0&&Number.isFinite(e)&&e>0}function ie(e,t){if(!e?.ready||!t.ready||e.context!==t.context||e.items.length!==t.items.length||e.items.every((a,i)=>a.key===t.items[i]?.key))return!1;const n=new Map(e.items.map(a=>[a.key,a]));let o=!1;for(const a of t.items){const i=n.get(a.key);if(!i||i.pin!==a.pin)return!1;v(i.lastActivityAt)&&v(a.lastActivityAt)&&a.lastActivityAt>i.lastActivityAt&&(o=!0)}return o}function re(e,t=Date.now()){if(!v(e))return"—";const n=Math.max(0,t-e);return n<6e4?"<1m":n<60*6e4?`>${Math.floor(n/6e4)}m`:n<1440*6e4?`>${Math.floor(n/(60*6e4))}h`:`>${Math.floor(n/(1440*6e4))}d`}function se(e){return encodeURIComponent(e).replace(/%3A/gi,":")}function oe(e,t){return`${e}:${t}`}function le(e){return e.displayName?.trim()?e.displayName.trim():e.path.split(/[\\/]/).filter(Boolean).at(-1)||e.path}function ue(e){return e.kind==="GIT_WORKSPACE"?"Git":s("workspace.directory")}function ce(e){if(e.kind==="GIT_WORKSPACE")return e.gitSummary?.branch??"HEAD"}function j(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${Math.round(e/1e3)}k`:String(e)}function de(e){if(e===null)return"—";if(e<1e8)return j(e);const t=_(),n=z[t];return s("marAgentModels.codexUsageLargeTokens",{value:new Intl.NumberFormat(t,{useGrouping:!1,minimumFractionDigits:n.minimumFractionDigits,maximumFractionDigits:1}).format(e/n.divisor)})}function fe(e){return`${Math.max(0,Math.round(e*10)/10)}%`}function ve(e){return e.length===0?e:`${e[0]?.toUpperCase()}${e.slice(1)}`}function me(e){return e.displayName?.trim()||e.registeredAddress||e.id}function ge(e,t){return e.externalDiscovered===!1||!v(e.lastActivityAt)?void 0:s("presentation.lastActivity",{value:t(e.lastActivityAt)})}function ye(e){return e.externalDiscovered===!1||!v(e.lastActivityAt)?void 0:new Date(e.lastActivityAt).toISOString()}export{ee as E,ae as W,fe as a,se as b,de as c,le as d,ve as e,re as f,oe as g,ce as h,ye as i,ne as j,ie as k,v as l,me as n,te as r,ge as s,j as t,ue as w};
|