@myagentroam/server 0.14.18 → 0.14.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (336) hide show
  1. package/node_modules/@myagentroam/protocol/package.json +1 -1
  2. package/node_modules/@myagentroam/server-core/package.json +2 -2
  3. package/node_modules/@myagentroam-enterprise/server-implementation/package.json +3 -3
  4. package/package.json +5 -5
  5. package/web/assets/{AuditManagementPage-DR6KbuCY.js → AuditManagementPage-D8Q7cxaX.js} +1 -1
  6. package/web/assets/{AuthEntryPanel-BsdDHBXI.js → AuthEntryPanel-CjAnXljt.js} +4 -4
  7. package/web/assets/AuthEntryPanel-nAy2hccs.css +1 -0
  8. package/web/assets/{BusyIndicator-D1dlXnIa.js → BusyIndicator-PRFERntc.js} +1 -1
  9. package/web/assets/{CodeFileEditor-DlC5beIi.js → CodeFileEditor-CWBvpEMx.js} +3 -3
  10. package/web/assets/{ConversationTemplateManagementPage-DHzIm6QC.js → ConversationTemplateManagementPage-B6kLJg_4.js} +1 -1
  11. package/web/assets/{ConversationTemplateManagementPage-Do6FoNYR.js → ConversationTemplateManagementPage-C1_Nx9yq.js} +1 -1
  12. package/web/assets/{EnterpriseUserManagementPage-WkAcrrAT.js → EnterpriseUserManagementPage-D_RLnink.js} +1 -1
  13. package/web/assets/{EnvironmentSecretManager-BoAKY3wG.js → EnvironmentSecretManager-5mGJzBx-.js} +1 -1
  14. package/web/assets/{FilePreviewLoading-DAPNzTFU.js → FilePreviewLoading-BF7eGwwx.js} +1 -1
  15. package/web/assets/HtmlPreviewFrame-BSKmXInH.js +6 -0
  16. package/web/assets/{HtmlPreviewFrame-DgODUBJD.css → HtmlPreviewFrame-BhCslGD5.css} +1 -1
  17. package/web/assets/{LicenseManagementPage-CCjPx1Ho.js → LicenseManagementPage-vkkFBoiI.js} +1 -1
  18. package/web/assets/{ManagementPagination-BvsRjE74.js → ManagementPagination-nDliwf8V.js} +1 -1
  19. package/web/assets/{MarAgentModelManagementPage-hyGmglzA.js → MarAgentModelManagementPage-B0RWxItK.js} +1 -1
  20. package/web/assets/{MarAgentModelManagementPage-a02_jgQ5.js → MarAgentModelManagementPage-DjbgVMQL.js} +1 -1
  21. package/web/assets/{MarAlert-DSmQryuu.js → MarAlert-BRDdHNjI.js} +1 -1
  22. package/web/assets/{MarCascader-CWpOhKd2.js → MarCascader-BycquR4M.js} +1 -1
  23. package/web/assets/{MarCheckboxGroup-C4uNCipw.js → MarCheckboxGroup-BHCu0L3N.js} +1 -1
  24. package/web/assets/{MarCheckboxGroup.vue_vue_type_style_index_0_scoped_3769668f_lang-DlSCkqLi.js → MarCheckboxGroup.vue_vue_type_style_index_0_scoped_3769668f_lang-Dbdx7XmP.js} +1 -1
  25. package/web/assets/{MarDatePicker-D6PeHzfi.js → MarDatePicker-fEx6Uc2H.js} +1 -1
  26. package/web/assets/{MarDescriptionsItem-BlnGyiqR.js → MarDescriptionsItem-DXs8T6y2.js} +1 -1
  27. package/web/assets/{MarFormItem.vue_vue_type_script_setup_true_lang-Cb0xjbkz.js → MarFormItem.vue_vue_type_script_setup_true_lang-C5687WPW.js} +1 -1
  28. package/web/assets/{MarInputNumber-Cgd2zn2w.js → MarInputNumber-BrdLKVcG.js} +1 -1
  29. package/web/assets/{MarOptionGroup.vue_vue_type_style_index_0_scoped_0cdd846e_lang-Bnk1CfAu.js → MarOptionGroup.vue_vue_type_style_index_0_scoped_0cdd846e_lang-C5U0ej6_.js} +1 -1
  30. package/web/assets/{MarSwitch-BARfoj2O.js → MarSwitch-D7P0NJJ8.js} +1 -1
  31. package/web/assets/{MarTableColumn.vue_vue_type_script_setup_true_lang-Du6vjSSf.js → MarTableColumn.vue_vue_type_script_setup_true_lang-Cl79Jlsp.js} +1 -1
  32. package/web/assets/MarTabs-B_xA91f_.css +1 -0
  33. package/web/assets/MarTabs-DtoaIrb2.js +1 -0
  34. package/web/assets/{MarTag-CvK9DDWY.js → MarTag-C1JDYeU5.js} +1 -1
  35. package/web/assets/{MarkdownFilePreview-gH2gPTGH.js → MarkdownFilePreview-BuqlQ4wk.js} +2 -2
  36. package/web/assets/{McpDetailsDialog-DJ5qgEZM.js → McpDetailsDialog-CyttUIa8.js} +1 -1
  37. package/web/assets/{McpSourceManagementPage-BKpfVZkM.js → McpSourceManagementPage-CnCBX9XE.js} +1 -1
  38. package/web/assets/{McpSourceManagementPage-C4CvZBw-.js → McpSourceManagementPage-iURV3pJR.js} +1 -1
  39. package/web/assets/{NodeDetailsDialogs-BM_7Yb_X.js → NodeDetailsDialogs-CoIqd6Qm.js} +1 -1
  40. package/web/assets/NodeManagementPage-C7MqqksL.js +1 -0
  41. package/web/assets/NodeManagementPage-cza60-S9.js +1 -0
  42. package/web/assets/{OAuthManagementPage-BnfUYRMa.js → OAuthManagementPage-C7GipA7r.js} +1 -1
  43. package/web/assets/{OrganizationManagementPage-GlIJCCgN.js → OrganizationManagementPage-CFJ7EQyJ.js} +1 -1
  44. package/web/assets/{RemoteDesktopPage-DCbe0k6o.js → RemoteDesktopPage-CAar7qrT.js} +1 -1
  45. package/web/assets/{ResourceManagementPanel-Btr9c5B5.js → ResourceManagementPanel-DSqdOnKV.js} +1 -1
  46. package/web/assets/{ResourceManagementPanel.vue_vue_type_script_setup_true_lang-jxX7qHw8.js → ResourceManagementPanel.vue_vue_type_script_setup_true_lang-Csf9fvNy.js} +1 -1
  47. package/web/assets/SecretManagementPage-B4M3tTN4.js +1 -0
  48. package/web/assets/{SecretManagementPage-DzIJ5b9q.js → SecretManagementPage-DWQ1wEf-.js} +1 -1
  49. package/web/assets/{SecretManagementPage.vue_vue_type_script_setup_true_lang-DeJX9HIT.js → SecretManagementPage.vue_vue_type_script_setup_true_lang-Yk0vhrjR.js} +1 -1
  50. package/web/assets/{SessionSharePage-BzgtytrQ.js → SessionSharePage-DDEXTFGf.js} +2 -2
  51. package/web/assets/SettingsContent-DL239aWg.js +1 -0
  52. package/web/assets/SettingsContent-DSsfkTXs.js +1 -0
  53. package/web/assets/{SkillCenterPage-DoXH3nps.js → SkillCenterPage-Cmt6Wfth.js} +1 -1
  54. package/web/assets/SkillCenterPage-ReuPF60A.js +1 -0
  55. package/web/assets/{SkillDetailsDialog-uETiO9F5.js → SkillDetailsDialog-DqOTzyHx.js} +1 -1
  56. package/web/assets/{SkillSourceManagementPage-BfMMgzia.js → SkillSourceManagementPage-D2vZi6TW.js} +1 -1
  57. package/web/assets/{SkillSourceManagementPage-C9N4SHPk.js → SkillSourceManagementPage-DcxhJHDk.js} +1 -1
  58. package/web/assets/StandaloneFilePreviewPage-DG5oF2lR.js +1 -0
  59. package/web/assets/{SystemConfigurationPage-DVcEY-HL.js → SystemConfigurationPage-CAhiJk6g.js} +1 -1
  60. package/web/assets/{SystemConfigurationPage-DvLS7Zwy.js → SystemConfigurationPage-KRcK6uZr.js} +1 -1
  61. package/web/assets/{SystemInformationPage-NP7J6EBP.js → SystemInformationPage-BDUiJFY9.js} +1 -1
  62. package/web/assets/{TerminalTabView-XleyJ15o.js → TerminalTabView-D4J9uBd0.js} +2 -2
  63. package/web/assets/WorkbenchPage-CQyzAqKq.css +1 -0
  64. package/web/assets/WorkbenchPage-DiwxggiB.js +22 -0
  65. package/web/assets/WorkspaceManagementPage-0ooGQ2np.js +1 -0
  66. package/web/assets/WorkspaceManagementPage-CexUd_WV.js +1 -0
  67. package/web/assets/{abnfDiagram-VCTEODGH-BbkIWkPr.js → abnfDiagram-VCTEODGH-0aFxksNC.js} +1 -1
  68. package/web/assets/{arc-D2sw7xO4.js → arc-BOwSnHfg.js} +1 -1
  69. package/web/assets/{architectureDiagram-5GKGNRK7-BHpYkEkW.js → architectureDiagram-5GKGNRK7-B1g061AY.js} +1 -1
  70. package/web/assets/{blockDiagram-OSKFZWR5-BbOed06q.js → blockDiagram-OSKFZWR5-BWaPwG7t.js} +1 -1
  71. package/web/assets/{c4Diagram-7LVT6UL2-Dbg2ezNr.js → c4Diagram-7LVT6UL2-B4zrtI2-.js} +1 -1
  72. package/web/assets/{catalog-ownership-service-B43V-RZj.js → catalog-ownership-service-CrR4hcHW.js} +1 -1
  73. package/web/assets/{catalog-page-service-CR4iDEEe.js → catalog-page-service-BKeMbafQ.js} +1 -1
  74. package/web/assets/channel-CWLaO10J.js +1 -0
  75. package/web/assets/{chunk-2Q5K7J3B-4I2F07E9.js → chunk-2Q5K7J3B-DPJaQmVu.js} +1 -1
  76. package/web/assets/{chunk-5VM5RSS4-B3t6Oj30.js → chunk-5VM5RSS4-DFdLokzD.js} +1 -1
  77. package/web/assets/{chunk-F27PBJKO-BuTAQLsu.js → chunk-F27PBJKO-D969XBiE.js} +1 -1
  78. package/web/assets/{chunk-HLEWEB6X-ClfcNoz0.js → chunk-HLEWEB6X-DeNCISiL.js} +1 -1
  79. package/web/assets/{chunk-JWPE2WC7-bIyZ3068.js → chunk-JWPE2WC7-KS_LsJEd.js} +1 -1
  80. package/web/assets/{chunk-POPQ4Y6H-BN6a2ey5.js → chunk-POPQ4Y6H-CvgdXu9Z.js} +1 -1
  81. package/web/assets/{chunk-SVP7TREG-BkrRtfA-.js → chunk-SVP7TREG-BGJDfbw7.js} +1 -1
  82. package/web/assets/{chunk-XXDRQBXY-AFVWMXkP.js → chunk-XXDRQBXY-WW5coW3q.js} +1 -1
  83. package/web/assets/{chunk-ZLD2IHE6-fq7pA_GZ.js → chunk-ZLD2IHE6-DIgWugRM.js} +1 -1
  84. package/web/assets/classDiagram-CYGNFDIV-DPduIqtu.js +1 -0
  85. package/web/assets/classDiagram-v2-TLXNO2FR-DPduIqtu.js +1 -0
  86. package/web/assets/{conversation-history-5Whey-Nw.js → conversation-history-BmbSoNKL.js} +1 -1
  87. package/web/assets/{cose-bilkent-JH36ORCC-CspatMAN.js → cose-bilkent-JH36ORCC-DEE_H9oX.js} +1 -1
  88. package/web/assets/{cynefin-OW5HDTMX-DQYYk5JB.js → cynefin-OW5HDTMX-CXepQwH9.js} +1 -1
  89. package/web/assets/{cynefinDiagram-5FMLGOSQ-CnyV7dxQ.js → cynefinDiagram-5FMLGOSQ-CEo17he9.js} +1 -1
  90. package/web/assets/{dagre-OS7QT2EB-wdCSgSpF.js → dagre-OS7QT2EB-trDkAgFo.js} +1 -1
  91. package/web/assets/{diagram-S7CK7UJ4-DVgKZs4r.js → diagram-S7CK7UJ4-bx5LOOt1.js} +1 -1
  92. package/web/assets/{diagram-UQ7AKVKN-D0mkaxik.js → diagram-UQ7AKVKN-D8C2iVxl.js} +1 -1
  93. package/web/assets/{diagram-VSXAHHWV-CXRlwh72.js → diagram-VSXAHHWV-FDeO9evO.js} +1 -1
  94. package/web/assets/{diagram-VX7I27RA-mMX8lo0H.js → diagram-VX7I27RA-B91GSTL3.js} +1 -1
  95. package/web/assets/{diagram-Z3DM3KII-CFVYKECZ.js → diagram-Z3DM3KII-D-bU-cEe.js} +1 -1
  96. package/web/assets/{ebnfDiagram-PWID7BFC-fpjuUVgo.js → ebnfDiagram-PWID7BFC-EWWFhEcm.js} +1 -1
  97. package/web/assets/{enterprise-management-service-C3wTQakl.js → enterprise-management-service-BMnR8EHP.js} +1 -1
  98. package/web/assets/{erDiagram-2YWLMYGG-C2cH8eSD.js → erDiagram-2YWLMYGG-Cz5JQZU9.js} +1 -1
  99. package/web/assets/{error-presentation-Bsw9jRIX.js → error-presentation-C9lF2Dka.js} +1 -1
  100. package/web/assets/{flowDiagram-T62WH6J4-0z00JBX5.js → flowDiagram-T62WH6J4-BHhZFeVH.js} +1 -1
  101. package/web/assets/{ganttDiagram-EL5Y4UJY-DKNS8qy7.js → ganttDiagram-EL5Y4UJY-6lvkz5J4.js} +1 -1
  102. package/web/assets/{gitGraphDiagram-WWUBYQGX-91ulJFWk.js → gitGraphDiagram-WWUBYQGX-D1iLdQId.js} +1 -1
  103. package/web/assets/{hosted-conversation-template-client-CVDyJLe_.js → hosted-conversation-template-client-76fGpTl2.js} +1 -1
  104. package/web/assets/{illustrations-DaClmMPg.svg → illustrations-C1sf3HdH.svg} +7 -4
  105. package/web/assets/{index-BTClWCKU.js → index-2GGNZhr2.js} +5 -5
  106. package/web/assets/{index--o7Keb7v.js → index-3jg9O3Do.js} +1 -1
  107. package/web/assets/{index-0bLpATgL.js → index-B6_jhgB2.js} +1 -1
  108. package/web/assets/{index-D2ckJREB.js → index-B8vN3ZPK.js} +1 -1
  109. package/web/assets/{index-B4CXrXhI.js → index-BAF_vQZ-.js} +9 -9
  110. package/web/assets/{index-DFCnppo2.js → index-BDXbZjaI.js} +1 -1
  111. package/web/assets/{index-BGjwLofa.js → index-BRcZgkvc.js} +1 -1
  112. package/web/assets/{index-DUe6POiN.js → index-BWpJ1fiw.js} +1 -1
  113. package/web/assets/{index-DCzPnN9-.js → index-BZNrE8KA.js} +1 -1
  114. package/web/assets/{index-BAmZJpQq.js → index-BuyZ-o3r.js} +1 -1
  115. package/web/assets/{index-2En9W4yL.js → index-CC3UkBt-.js} +1 -1
  116. package/web/assets/{index-CHqSYJAm.js → index-CLyAlFnA.js} +1 -1
  117. package/web/assets/{index-AtmW616Q.js → index-CR_QIVQX.js} +1 -1
  118. package/web/assets/{index-QUPHfBwn.js → index-CThZ369F.js} +1 -1
  119. package/web/assets/{index-BCYHRLwU.js → index-CVqBakyv.js} +1 -1
  120. package/web/assets/{index-DnttSYuV.js → index-Ciu4cxq5.js} +1 -1
  121. package/web/assets/{index-DdcRhHzo.js → index-D92GIerC.js} +1 -1
  122. package/web/assets/{index-7_P5DEIT.js → index-DDdB2fMm.js} +1 -1
  123. package/web/assets/index-DXeGBa7p.css +1 -0
  124. package/web/assets/{index-Daej4G__.js → index-DYNt4sul.js} +1 -1
  125. package/web/assets/{index-BfaGjcnf.js → index-Db_YCuiX.js} +1 -1
  126. package/web/assets/{index-BfUFqjLh.js → index-Dqvo7t8A.js} +1 -1
  127. package/web/assets/{index-BRks84of.js → index-DuZh7U9v.js} +1 -1
  128. package/web/assets/{index-DCccnMx1.js → index-Dzjhw1r6.js} +1 -1
  129. package/web/assets/{index-P2IyYarJ.js → index-MKav2A8p.js} +1 -1
  130. package/web/assets/{index-B9y5h9Lm.js → index-d4cb8CKI.js} +1 -1
  131. package/web/assets/{index-XuRp8wQx.js → index-uEEGu0Ka.js} +1 -1
  132. package/web/assets/{index-Bd-ZYQWm.js → index-wreLiQ_K.js} +1 -1
  133. package/web/assets/{infoDiagram-FKFFQAWI-Y3Ncdasb.js → infoDiagram-FKFFQAWI-BT1ZLFnC.js} +1 -1
  134. package/web/assets/{ishikawaDiagram-5VMMS53U-D1DU66cV.js → ishikawaDiagram-5VMMS53U-DZR4I0QY.js} +1 -1
  135. package/web/assets/{journeyDiagram-EYS64GPL-DHenZQu-.js → journeyDiagram-EYS64GPL-MLqTu18P.js} +1 -1
  136. package/web/assets/{kanban-definition-UXKFOSKX-Dm8V8tR5.js → kanban-definition-UXKFOSKX-0jRhDtJc.js} +1 -1
  137. package/web/assets/{layout-IhVfdWpO.js → layout-CPzLn4Oq.js} +1 -1
  138. package/web/assets/{linear-OX43dcj-.js → linear-BUw0JtBB.js} +1 -1
  139. package/web/assets/{management-url-service-BuGA1tHR.js → management-url-service-sRmoAxle.js} +1 -1
  140. package/web/assets/{mcp-center-service-Dh09PYq1.js → mcp-center-service-D-gh5DCu.js} +1 -1
  141. package/web/assets/{mermaid.core-CVWJkR59.js → mermaid.core-BkB-WP1h.js} +5 -5
  142. package/web/assets/{mindmap-definition-THT77NOG-DTLvX8Jr.js → mindmap-definition-THT77NOG-DLxrZNUB.js} +1 -1
  143. package/web/assets/{mobile-dialog-return-service-Cvt9WsqK.js → mobile-dialog-return-service-G00_zLGC.js} +1 -1
  144. package/web/assets/{oauth-callback-B8_Tpisc.js → oauth-callback-B0UzPGFp.js} +1 -1
  145. package/web/assets/{pegDiagram-XKGWAZYB-DHaJYpM-.js → pegDiagram-XKGWAZYB-D6G6Cvkm.js} +1 -1
  146. package/web/assets/{pieDiagram-E7YTZNPT-DzcjETvg.js → pieDiagram-E7YTZNPT-CcsbJ2af.js} +1 -1
  147. package/web/assets/{quadrantDiagram-AXDQQJYC-DnX5gl_6.js → quadrantDiagram-AXDQQJYC-DHRqaYWg.js} +1 -1
  148. package/web/assets/{railroadDiagram-O6MQD6OU-CdWndGze.js → railroadDiagram-O6MQD6OU-BdyliDFy.js} +1 -1
  149. package/web/assets/{requirementDiagram-IS5BZ75X-Cd9l1eqL.js → requirementDiagram-IS5BZ75X-aos9xD9c.js} +1 -1
  150. package/web/assets/{runner-presentation-Cm3jAKir.js → runner-presentation-_yMutYy4.js} +1 -1
  151. package/web/assets/{sankeyDiagram-P5KCCOFB-CJ6ofBC4.js → sankeyDiagram-P5KCCOFB-CZJ7uFcd.js} +1 -1
  152. package/web/assets/{sequenceDiagram-WJ2MYXX4-CnYf7Y_J.js → sequenceDiagram-WJ2MYXX4-W1cIeVP7.js} +1 -1
  153. package/web/assets/{session-share-client-service-DA2bHkVA.js → session-share-client-service-CmFy07bc.js} +1 -1
  154. package/web/assets/{sizeCapture-INFHLROL-WNe-4gCm.js → sizeCapture-INFHLROL-DlscNemm.js} +1 -1
  155. package/web/assets/{stateDiagram-XQSTLZYL-B1pL8akf.js → stateDiagram-XQSTLZYL-CXJkGNuI.js} +1 -1
  156. package/web/assets/stateDiagram-v2-IH3M54BS-DdsmnNoL.js +1 -0
  157. package/web/assets/{swimlanes-V6O3JKXN-B_5lpZRn.js → swimlanes-V6O3JKXN-CwlxIp9_.js} +1 -1
  158. package/web/assets/swimlanesDiagram-JKAHXJPX-C1I-LFmb.js +8 -0
  159. package/web/assets/{time-presentation-f56rqpcy.js → time-presentation-BsKzQVfX.js} +1 -1
  160. package/web/assets/{timeline-definition-24CTP7MA-BJY4iFQf.js → timeline-definition-24CTP7MA-JIc019-X.js} +1 -1
  161. package/web/assets/{vennDiagram-4TSXK5OY-6Cm5Q-nq.js → vennDiagram-4TSXK5OY-jgzhVFUC.js} +1 -1
  162. package/web/assets/{wardleyDiagram-VM6X3IG4-CnOYuWNa.js → wardleyDiagram-VM6X3IG4-kSenvDsN.js} +1 -1
  163. package/web/assets/{workbench-live-service-0ogIcbLV.js → workbench-live-service-a0t7gSnZ.js} +1 -1
  164. package/web/assets/{workbench-presentation-6AMUsb5y.js → workbench-presentation-B9YUi6tS.js} +1 -1
  165. package/web/assets/{xychartDiagram-S5SC5T6Z-CBUDSbYO.js → xychartDiagram-S5SC5T6Z-CibCo8Q8.js} +1 -1
  166. package/web/docs/404.html +2 -2
  167. package/web/docs/administration/account.html +3 -3
  168. package/web/docs/administration/audit.html +3 -3
  169. package/web/docs/administration/conversation-templates.html +3 -3
  170. package/web/docs/administration/email-notifications.html +3 -3
  171. package/web/docs/administration/license.html +3 -3
  172. package/web/docs/administration/nodes-workspaces.html +3 -3
  173. package/web/docs/administration/oauth.html +3 -3
  174. package/web/docs/administration/secrets.html +3 -3
  175. package/web/docs/administration/template-workspace-maintenance.html +3 -3
  176. package/web/docs/administration/users-organizations.html +3 -3
  177. package/web/docs/assets/{app.CIyOeKUy.js → app.AjQyNv1J.js} +1 -1
  178. package/web/docs/assets/chunks/@localSearchIndexen-US.B4el0rPo.js +1 -0
  179. package/web/docs/assets/chunks/@localSearchIndexroot.Dm2BK7_u.js +1 -0
  180. package/web/docs/assets/chunks/{VPLocalSearchBox.BhP5Pa3c.js → VPLocalSearchBox.DkGLSTiY.js} +1 -1
  181. package/web/docs/assets/chunks/{theme.CkQL4xr3.js → theme.D3e95zUH.js} +2 -2
  182. package/web/docs/assets/{en-US_runners_mar-agent.md.DCyjIcs1.js → en-US_runners_mar-agent.md.fovIiNmR.js} +2 -2
  183. package/web/docs/assets/{en-US_runners_mar-agent.md.DCyjIcs1.lean.js → en-US_runners_mar-agent.md.fovIiNmR.lean.js} +1 -1
  184. package/web/docs/assets/{runners_mar-agent.md.CCL6GaYQ.js → runners_mar-agent.md.BHJ05LUH.js} +2 -2
  185. package/web/docs/assets/{runners_mar-agent.md.CCL6GaYQ.lean.js → runners_mar-agent.md.BHJ05LUH.lean.js} +1 -1
  186. package/web/docs/concepts/architecture.html +3 -3
  187. package/web/docs/concepts/data-and-security.html +3 -3
  188. package/web/docs/concepts/files-git-terminal.html +3 -3
  189. package/web/docs/concepts/node-and-workspace.html +3 -3
  190. package/web/docs/concepts/permissions-and-sharing.html +3 -3
  191. package/web/docs/concepts/runner-control.html +3 -3
  192. package/web/docs/concepts/secrets.html +3 -3
  193. package/web/docs/concepts/session-run-turn.html +3 -3
  194. package/web/docs/deployment/backup-restore.html +3 -3
  195. package/web/docs/deployment/network.html +3 -3
  196. package/web/docs/deployment/node-installation.html +3 -3
  197. package/web/docs/deployment/node-linux.html +3 -3
  198. package/web/docs/deployment/node-macos.html +3 -3
  199. package/web/docs/deployment/node-windows.html +3 -3
  200. package/web/docs/deployment/production.html +3 -3
  201. package/web/docs/deployment/security-checklist.html +3 -3
  202. package/web/docs/deployment/upgrade.html +3 -3
  203. package/web/docs/en-US/administration/account.html +3 -3
  204. package/web/docs/en-US/administration/audit.html +3 -3
  205. package/web/docs/en-US/administration/conversation-templates.html +3 -3
  206. package/web/docs/en-US/administration/email-notifications.html +3 -3
  207. package/web/docs/en-US/administration/license.html +3 -3
  208. package/web/docs/en-US/administration/nodes-workspaces.html +3 -3
  209. package/web/docs/en-US/administration/oauth.html +3 -3
  210. package/web/docs/en-US/administration/secrets.html +3 -3
  211. package/web/docs/en-US/administration/template-workspace-maintenance.html +3 -3
  212. package/web/docs/en-US/administration/users-organizations.html +3 -3
  213. package/web/docs/en-US/concepts/architecture.html +3 -3
  214. package/web/docs/en-US/concepts/data-and-security.html +3 -3
  215. package/web/docs/en-US/concepts/files-git-terminal.html +3 -3
  216. package/web/docs/en-US/concepts/node-and-workspace.html +3 -3
  217. package/web/docs/en-US/concepts/permissions-and-sharing.html +3 -3
  218. package/web/docs/en-US/concepts/runner-control.html +3 -3
  219. package/web/docs/en-US/concepts/secrets.html +3 -3
  220. package/web/docs/en-US/concepts/session-run-turn.html +3 -3
  221. package/web/docs/en-US/deployment/backup-restore.html +3 -3
  222. package/web/docs/en-US/deployment/network.html +3 -3
  223. package/web/docs/en-US/deployment/node-installation.html +3 -3
  224. package/web/docs/en-US/deployment/node-linux.html +3 -3
  225. package/web/docs/en-US/deployment/node-macos.html +3 -3
  226. package/web/docs/en-US/deployment/node-windows.html +3 -3
  227. package/web/docs/en-US/deployment/production.html +3 -3
  228. package/web/docs/en-US/deployment/security-checklist.html +3 -3
  229. package/web/docs/en-US/deployment/upgrade.html +3 -3
  230. package/web/docs/en-US/getting-started/connect-node.html +3 -3
  231. package/web/docs/en-US/getting-started/first-agent-session.html +3 -3
  232. package/web/docs/en-US/getting-started/first-login.html +3 -3
  233. package/web/docs/en-US/getting-started/next-steps.html +3 -3
  234. package/web/docs/en-US/getting-started/npm-quick-start.html +3 -3
  235. package/web/docs/en-US/getting-started/overview.html +3 -3
  236. package/web/docs/en-US/getting-started/prerequisites.html +3 -3
  237. package/web/docs/en-US/getting-started/register-workspace.html +3 -3
  238. package/web/docs/en-US/getting-started/server-installation.html +3 -3
  239. package/web/docs/en-US/operations/marctl.html +3 -3
  240. package/web/docs/en-US/reference/configuration.html +3 -3
  241. package/web/docs/en-US/reference/keyboard-shortcuts.html +3 -3
  242. package/web/docs/en-US/reference/limits.html +3 -3
  243. package/web/docs/en-US/reference/ports-paths-data.html +3 -3
  244. package/web/docs/en-US/reference/status-and-errors.html +3 -3
  245. package/web/docs/en-US/runners/claude-code.html +3 -3
  246. package/web/docs/en-US/runners/codex.html +3 -3
  247. package/web/docs/en-US/runners/mar-agent.html +5 -5
  248. package/web/docs/en-US/runners/opencode.html +3 -3
  249. package/web/docs/en-US/runners/overview.html +3 -3
  250. package/web/docs/en-US/runners/runner-troubleshooting.html +3 -3
  251. package/web/docs/en-US/troubleshooting/node-offline.html +3 -3
  252. package/web/docs/en-US/troubleshooting/quick-diagnosis.html +3 -3
  253. package/web/docs/en-US/troubleshooting/session-run.html +3 -3
  254. package/web/docs/en-US/troubleshooting/terminal.html +3 -3
  255. package/web/docs/en-US/troubleshooting/workspace-files.html +3 -3
  256. package/web/docs/en-US/workbench/composer.html +3 -3
  257. package/web/docs/en-US/workbench/context-and-plan.html +3 -3
  258. package/web/docs/en-US/workbench/conversation.html +3 -3
  259. package/web/docs/en-US/workbench/file-reference-and-attachment.html +3 -3
  260. package/web/docs/en-US/workbench/files.html +3 -3
  261. package/web/docs/en-US/workbench/git-changes.html +3 -3
  262. package/web/docs/en-US/workbench/git-history.html +3 -3
  263. package/web/docs/en-US/workbench/hosted-conversations.html +3 -3
  264. package/web/docs/en-US/workbench/mobile.html +3 -3
  265. package/web/docs/en-US/workbench/navigation.html +3 -3
  266. package/web/docs/en-US/workbench/remote-desktop.html +3 -3
  267. package/web/docs/en-US/workbench/sessions.html +3 -3
  268. package/web/docs/en-US/workbench/skills.html +3 -3
  269. package/web/docs/en-US/workbench/terminal.html +3 -3
  270. package/web/docs/getting-started/connect-node.html +3 -3
  271. package/web/docs/getting-started/first-agent-session.html +3 -3
  272. package/web/docs/getting-started/first-login.html +3 -3
  273. package/web/docs/getting-started/next-steps.html +3 -3
  274. package/web/docs/getting-started/npm-quick-start.html +3 -3
  275. package/web/docs/getting-started/overview.html +3 -3
  276. package/web/docs/getting-started/prerequisites.html +3 -3
  277. package/web/docs/getting-started/register-workspace.html +3 -3
  278. package/web/docs/getting-started/server-installation.html +3 -3
  279. package/web/docs/hashmap.json +1 -1
  280. package/web/docs/operations/marctl.html +3 -3
  281. package/web/docs/reference/configuration.html +3 -3
  282. package/web/docs/reference/keyboard-shortcuts.html +3 -3
  283. package/web/docs/reference/limits.html +3 -3
  284. package/web/docs/reference/ports-paths-data.html +3 -3
  285. package/web/docs/reference/status-and-errors.html +3 -3
  286. package/web/docs/runners/claude-code.html +3 -3
  287. package/web/docs/runners/codex.html +3 -3
  288. package/web/docs/runners/mar-agent.html +5 -5
  289. package/web/docs/runners/opencode.html +3 -3
  290. package/web/docs/runners/overview.html +3 -3
  291. package/web/docs/runners/runner-troubleshooting.html +3 -3
  292. package/web/docs/troubleshooting/node-offline.html +3 -3
  293. package/web/docs/troubleshooting/quick-diagnosis.html +3 -3
  294. package/web/docs/troubleshooting/session-run.html +3 -3
  295. package/web/docs/troubleshooting/terminal.html +3 -3
  296. package/web/docs/troubleshooting/workspace-files.html +3 -3
  297. package/web/docs/workbench/composer.html +3 -3
  298. package/web/docs/workbench/context-and-plan.html +3 -3
  299. package/web/docs/workbench/conversation.html +3 -3
  300. package/web/docs/workbench/file-reference-and-attachment.html +3 -3
  301. package/web/docs/workbench/files.html +3 -3
  302. package/web/docs/workbench/git-changes.html +3 -3
  303. package/web/docs/workbench/git-history.html +3 -3
  304. package/web/docs/workbench/hosted-conversations.html +3 -3
  305. package/web/docs/workbench/mobile.html +3 -3
  306. package/web/docs/workbench/navigation.html +3 -3
  307. package/web/docs/workbench/remote-desktop.html +3 -3
  308. package/web/docs/workbench/sessions.html +3 -3
  309. package/web/docs/workbench/skills.html +3 -3
  310. package/web/docs/workbench/terminal.html +3 -3
  311. package/web/index.html +3 -3
  312. package/web/service-worker.js +1 -1
  313. package/web/web-version.json +1 -1
  314. package/web/assets/AuthEntryPanel-BWudPCQ5.css +0 -1
  315. package/web/assets/HtmlPreviewFrame-DJvvy8cY.js +0 -6
  316. package/web/assets/MarTabs-CHsN2VcQ.js +0 -1
  317. package/web/assets/MarTabs-TDDMuNev.css +0 -1
  318. package/web/assets/NodeManagementPage-BsSyVzVX.js +0 -1
  319. package/web/assets/NodeManagementPage-Dnci-7Lt.js +0 -1
  320. package/web/assets/SecretManagementPage-BnwZxYfi.js +0 -1
  321. package/web/assets/SettingsContent-B8X-hLrA.js +0 -1
  322. package/web/assets/SettingsContent-CogePUHw.js +0 -1
  323. package/web/assets/SkillCenterPage-CumTiRgQ.js +0 -1
  324. package/web/assets/StandaloneFilePreviewPage-Tq8fqD2w.js +0 -1
  325. package/web/assets/WorkbenchPage-B0VYo24i.css +0 -1
  326. package/web/assets/WorkbenchPage-BwMBLemU.js +0 -22
  327. package/web/assets/WorkspaceManagementPage-CsN6x17r.js +0 -1
  328. package/web/assets/WorkspaceManagementPage-L9IbVI0s.js +0 -1
  329. package/web/assets/channel-DVxzNgNr.js +0 -1
  330. package/web/assets/classDiagram-CYGNFDIV-BkLgH6Xs.js +0 -1
  331. package/web/assets/classDiagram-v2-TLXNO2FR-BkLgH6Xs.js +0 -1
  332. package/web/assets/index-DuY_vMDw.css +0 -1
  333. package/web/assets/stateDiagram-v2-IH3M54BS-QZwo3_Cg.js +0 -1
  334. package/web/assets/swimlanesDiagram-JKAHXJPX-xHTVtlH1.js +0 -8
  335. package/web/docs/assets/chunks/@localSearchIndexen-US.CzWbZXsp.js +0 -1
  336. package/web/docs/assets/chunks/@localSearchIndexroot.B1nGhxQQ.js +0 -1
@@ -1 +1 @@
1
- import{m as Ge,K as He,L as Ze,W as F,t as l,N as le,E as e,O as te,o as d,n as M,P,q as o,D as i,S as c,Q as s,F as g,T as v,U as ne,C as S,G as C,a6 as $,a7 as N,R as G,a8 as je,ac as Qe,a2 as ye,p as we,V as oe,f,l as ie,k as he,X as re,_ as We}from"./index-B4CXrXhI.js";import{M as Ce,a as Xe}from"./MarTabs-CHsN2VcQ.js";import{M as se}from"./MarTag-CvK9DDWY.js";import{_ as p,M as ue}from"./MarTableColumn.vue_vue_type_script_setup_true_lang-Du6vjSSf.js";import{a as de,_ as V}from"./MarFormItem.vue_vue_type_script_setup_true_lang-Cb0xjbkz.js";import{M as O,a as q}from"./MarOptionGroup.vue_vue_type_style_index_0_scoped_0cdd846e_lang-Bnk1CfAu.js";import{M as Ve}from"./MarSwitch-BARfoj2O.js";import{u as ce,m as ge}from"./mobile-dialog-return-service-Cvt9WsqK.js";import{w as Je,M as Ye}from"./ManagementPagination-BvsRjE74.js";import{f as ea}from"./time-presentation-f56rqpcy.js";import{c as aa,s as H,S as la}from"./SkillDetailsDialog-uETiO9F5.js";import"./error-presentation-Bsw9jRIX.js";import"./BusyIndicator-D1dlXnIa.js";import"./catalog-page-service-CR4iDEEe.js";import"./MarDescriptionsItem-BlnGyiqR.js";const ta={class:"mar-management-page"},na={class:"mar-table-actions"},oa={class:"source-search-bar"},ia={class:"toolbar"},ra={class:"skill-table-section"},sa={key:1,class:"skill-empty"},ua={class:"catalog-filter-bar"},da=["aria-label"],ca=["onClick"],ga={class:"skill-table-section"},ma={class:"table-meta"},fa={key:0,class:"skill-tags"},pa={key:1,class:"skill-empty"},va={class:"form-hint"},ka=Ge({__name:"SkillSourceManagementPage",props:{request:{type:Function},writable:{type:Boolean},scopeLabel:{type:Function},loadExtension:{type:Function},sourceContext:{},catalogContext:{},ownershipRules:{},submitSource:{type:Function},submitFavorite:{type:Function}},emits:["openSource","openCatalog"],setup(k,{emit:De}){const D=k,me=De,r=aa(D.request,{...D.submitSource===void 0?{}:{submitSource:D.submitSource},...D.submitFavorite===void 0?{}:{submitFavorite:D.submitFavorite}}),Te=r.sources,u=r.catalogPage;Je(u);const T=f(!1),_=f(!1),A=f(!1),L=f(!1),I=f(!0),B=f(!1),E=f(new Set),Z=f(),fe=f(),pe=f(),ve=f(),j=f(),Q=f(),z=f(),U=f({}),W=u.keyword,K=u.category,ke=f("source"),w=ie({name:"",locator:""}),h=ie({featured:!1,tags:[]}),y=ie({featured:!1,tags:[]}),X=he(()=>({name:[{required:!0,message:l("generated.skillSourceManagementPage.enterASourceName"),trigger:"blur"}],locator:[{required:!0,message:l("generated.skillSourceManagementPage.enterARepositoryURL"),trigger:"blur"},{validator:(n,t,a)=>{const m=typeof t=="string"?t.trim():"";/^https:\/\//u.test(m)||/^git@[A-Za-z0-9.-]+:[A-Za-z0-9_.-]+(?:\/[A-Za-z0-9_.-]+)+(?:\.git)?$/u.test(m)?a():a(new Error(l("generated.skillSourceManagementPage.enterAnHTTPSOrGitSSHRepository")))},trigger:"blur"}],tags:[{validator:(n,t,a)=>{const m=Array.isArray(t)?t.map(R=>String(R).trim()):[];m.some(R=>R.length===0||R.length>32)?a(new Error(l("generated.skillSourceManagementPage.eachTagMustContain132Characters"))):new Set(m.map(R=>R.toLocaleLowerCase())).size!==m.length?a(new Error(l("generated.skillSourceManagementPage.duplicateTagsAreNotAllowed"))):a()},trigger:"change"}]})),J=he(()=>r.sources.value.find(n=>n.id===r.selectedSourceId.value)),Y=u.tags,Se=r.favorites;He(()=>{u.start(),_e()}),Ze(()=>u.dispose());async function _e(){I.value=!0;try{await b(async()=>{await Promise.all([r.loadSources(),r.loadCatalog()]),r.selectedSourceId.value!==""&&await ee(),await D.loadExtension?.()})}finally{I.value=!1}}async function b(n,t){try{await n(),t!==void 0&&F(t,"success")}catch(a){if(a===u.error.value)return;F(H(a,l("generated.skillSourceManagementPage.theSkillSourceOperationDidNotComplete")),"error",a)}}function Ae(){Object.assign(w,{name:"",locator:""}),me("openSource"),T.value=!0}async function Ue(){await fe.value?.validate().catch(()=>!1)&&await b(async()=>{await r.addSource({name:w.name.trim(),locator:w.locator.trim()}),T.value=!1},l("generated.skillSourceManagementPage.skillSourceAdded"))}function xe(n){j.value=n,Object.assign(h,{featured:!1,tags:[]}),me("openCatalog"),_.value=!0}function Re(n){z.value={name:n.name,description:n.description,source:n.source,...n.skillPath===null?{}:{path:n.skillPath},...n.installs===null?{}:{installs:n.installs}},L.value=!0}function Fe(n){z.value={name:n.name,description:"",source:n.locator,scope:x(n.scope),status:n.enabled?l("generated.skillSourceManagementPage.enabled"):l("generated.skillSourceManagementPage.disabled")},L.value=!0}function Le(n){z.value={name:n.normalizedName,description:n.description,source:n.repositoryIdentity,scope:x(n.scope),path:n.skillPath,version:n.commitSha.slice(0,8),updatedAt:Pe(n.updatedAt),featured:n.featured,tags:n.tags},L.value=!0}function Ie(n){Q.value=n,y.featured=n.featured,y.tags=[...n.tags],A.value=!0}async function Be(){if(!await ve.value?.validate().catch(()=>!1)||Q.value===void 0)return;const n=y.tags.map(t=>t.trim());await b(async()=>{await r.updatePresentation(Q.value.id,{featured:y.featured,tags:n}),A.value=!1},l("generated.skillSourceManagementPage.skillInformationUpdated"))}async function Ee(n){r.selectedSourceId.value=n,r.candidates.value=[],r.query.value="",await b(ee)}async function ee(){B.value=!0;try{await r.loadCandidates()}finally{B.value=!1}}async function be(){B.value=!0;try{await r.search()}finally{B.value=!1}}async function Me(n){const t=r.selectedSourceId.value;await n(),r.selectedSourceId.value!==""&&r.selectedSourceId.value!==t&&await ee()}async function $e(n){try{await re.confirm(n.enabled?l("generated.skillSourceManagementPage.confirmDisableSkillSource",{value0:n.name}):l("generated.skillSourceManagementPage.confirmEnableSkillSource",{value0:n.name}),l("generated.skillSourceManagementPage.updateSkillSourceStatus"),{icon:g("warning"),type:"warning",confirmButtonText:n.enabled?l("generated.skillSourceManagementPage.disable"):l("generated.skillSourceManagementPage.enable"),cancelButtonText:l("generated.skillSourceManagementPage.cancel2")})}catch(t){if(ae(t))return;F(H(t,l("generated.skillSourceManagementPage.unableToConfirmSourceStatusChange")),"error",t);return}await b(()=>Me(()=>r.setSourceEnabled(n.id,!n.enabled)),l("generated.skillSourceManagementPage.skillSourceStatusUpdated"))}async function Ne(){if(!await pe.value?.validate().catch(()=>!1)||j.value===void 0)return;const n=h.tags.map(t=>t.trim());await b(async()=>{await r.favorite(j.value,{featured:h.featured,tags:n}),_.value=!1},l("generated.skillSourceManagementPage.skillAddedToTheCatalog"))}async function Oe(n){E.value=new Set([...E.value,n.id]);try{await b(async()=>{const t=await r.checkUpdate(n.id);U.value={...U.value,[n.id]:t},F(t.updateAvailable?l("generated.skillSourceManagementPage.updateAvailable"):l("generated.skillSourceManagementPage.alreadyUpToDate"),"info")})}finally{const t=new Set(E.value);t.delete(n.id),E.value=t}}async function qe(n){Z.value=n.id;try{await b(async()=>{await r.upgrade(n.id);const t={...U.value};delete t[n.id],U.value=t},l("generated.skillSourceManagementPage.catalogSkillUpdated"))}finally{Z.value=void 0}}function Pe(n){return ea(n)}async function ze(n){try{await re.confirm(l("generated.skillSourceManagementPage.deleteSkillSource",{value0:n.name}),l("generated.skillSourceManagementPage.deleteSkillSource2"),{icon:g("warning"),type:"warning",confirmButtonText:l("generated.skillSourceManagementPage.delete"),cancelButtonText:l("generated.skillSourceManagementPage.cancel")})}catch(t){if(ae(t))return;F(H(t,l("generated.skillSourceManagementPage.unableToConfirmDeletionTryAgainLater")),"error",t);return}await b(()=>Me(()=>r.removeSource(n.id)),l("generated.skillSourceManagementPage.skillSourceDeleted"))}async function Ke(n,t){try{await re.confirm(l("generated.skillSourceManagementPage.removeFromTheSkillCatalogInstalledCopies",{value0:t}),l("generated.skillSourceManagementPage.removeSkill"),{icon:g("warning"),type:"warning",confirmButtonText:l("generated.skillSourceManagementPage.remove"),cancelButtonText:l("generated.skillSourceManagementPage.cancel2")})}catch(a){if(ae(a))return;F(H(a,l("generated.skillSourceManagementPage.unableToConfirmRemovalTryAgainLater")),"error",a);return}await b(()=>r.remove(n),l("generated.skillSourceManagementPage.skillRemoved"))}function ae(n){return n==="cancel"||n==="close"}function x(n){return D.scopeLabel?.(n)??l("generated.skillSourceManagementPage.personal")}return(n,t)=>le((d(),M("section",ta,[P("div",na,[o(e(v),{type:"primary",icon:e(g)("plus"),disabled:!k.writable||e(r).loading.value,onClick:Ae},{default:i(()=>[c(s(e(l)("generated.skillSourceManagementPage.addSkillSource")),1)]),_:1},8,["icon","disabled"])]),o(e(ue),{class:"clickable-rows skill-source-table",data:e(Te),"row-key":"id",onRowClick:Fe},{default:i(()=>[o(e(p),{prop:"name",label:e(l)("generated.skillSourceManagementPage.name"),sortable:"","min-width":"180"},null,8,["label"]),o(e(p),{label:e(l)("generated.skillSourceManagementPage.scope"),width:"144","show-overflow-tooltip":"",sortable:"","sort-method":(a,m)=>x(a.scope).localeCompare(x(m.scope))},{default:i(({row:a})=>[c(s(x(a.scope)),1)]),_:1},8,["label","sort-method"]),o(e(p),{prop:"locator",label:e(l)("generated.skillSourceManagementPage.uRL"),"min-width":"280","show-overflow-tooltip":""},null,8,["label"]),o(e(p),{label:e(l)("generated.skillSourceManagementPage.status"),width:"110"},{default:i(({row:a})=>[o(e(se),{type:a.enabled?"success":"info",effect:"plain"},{default:i(()=>[c(s(a.enabled?e(l)("generated.skillSourceManagementPage.enabled"):e(l)("generated.skillSourceManagementPage.disabled")),1)]),_:2},1032,["type"])]),_:1},8,["label"]),o(e(p),{label:e(l)("generated.skillSourceManagementPage.actions"),width:180},{default:i(({row:a})=>[P("div",{class:"mar-row-actions",onClick:t[0]||(t[0]=ne(()=>{},["stop"]))},[o(e(v),{link:"",icon:e(g)("power"),disabled:!k.writable||!a.manageable||e(r).loading.value,onClick:m=>$e(a)},{default:i(()=>[c(s(a.enabled?e(l)("generated.skillSourceManagementPage.disable"):e(l)("generated.skillSourceManagementPage.enable")),1)]),_:2},1032,["icon","disabled","onClick"]),a.builtIn?C("",!0):(d(),S(e(v),{key:0,link:"",type:"danger",icon:e(g)("delete"),disabled:!k.writable||!a.manageable||e(r).loading.value,onClick:m=>ze(a)},{default:i(()=>[c(s(e(l)("generated.skillSourceManagementPage.delete2")),1)]),_:1},8,["icon","disabled","onClick"]))])]),_:1},8,["label"])]),_:1},8,["data"]),o(e(Xe),{modelValue:ke.value,"onUpdate:modelValue":t[8]||(t[8]=a=>ke.value=a),class:"skill-management-tabs"},{default:i(()=>[o(e(Ce),{label:e(l)("generated.skillSourceManagementPage.sourceSkills"),name:"source"},{default:i(()=>[P("div",oa,[o(e(O),{"model-value":e(r).selectedSourceId.value,"aria-label":e(l)("generated.skillSourceManagementPage.selectASkillSource"),placeholder:e(l)("generated.skillSourceManagementPage.selectAnEnabledSkillSource"),disabled:e(r).loading.value,onChange:Ee},{default:i(()=>[(d(!0),M($,null,N(e(r).sources.value.filter(a=>a.enabled),a=>(d(),S(e(q),{key:a.id,label:a.name,value:a.id},null,8,["label","value"]))),128))]),_:1},8,["model-value","aria-label","placeholder","disabled"]),P("div",ia,[o(e(G),{modelValue:e(r).query.value,"onUpdate:modelValue":t[2]||(t[2]=a=>e(r).query.value=a),clearable:"",placeholder:e(l)("generated.skillSourceManagementPage.enterASkillNameOrDescription"),onKeyup:t[3]||(t[3]=je(a=>b(be),["enter"])),"clear-icon":e(g)("clear-input")},{append:i(()=>[o(e(v),{icon:e(g)("search"),disabled:!J.value?.enabled||e(r).loading.value,onClick:t[1]||(t[1]=a=>b(be))},{default:i(()=>[c(s(e(l)("generated.skillSourceManagementPage.search")),1)]),_:1},8,["icon","disabled"])]),_:1},8,["modelValue","placeholder","clear-icon"])])]),le((d(),M("div",ra,[e(r).candidates.value.length>0?(d(),S(e(ue),{key:0,class:"clickable-rows source-skill-table",data:e(r).candidates.value,"row-key":"id",onRowClick:Re},{default:i(()=>[o(e(p),{prop:"name",label:e(l)("generated.skillSourceManagementPage.name"),sortable:"","min-width":"180"},null,8,["label"]),o(e(p),{prop:"source",label:e(l)("generated.skillDetailsDialog.source"),"min-width":"180","show-overflow-tooltip":""},null,8,["label"]),o(e(p),{prop:"description",label:e(l)("conversationTemplates.description"),"min-width":"280","show-overflow-tooltip":""},{default:i(({row:a})=>[c(s(a.description||e(l)("generated.skillSourceManagementPage.noDescriptionWasProvidedByThisSource")),1)]),_:1},8,["label"]),o(e(p),{label:e(l)("generated.skillSourceManagementPage.actions"),width:180},{default:i(({row:a})=>[P("div",{class:"mar-row-actions",onClick:t[4]||(t[4]=ne(()=>{},["stop"]))},[o(e(v),{link:"",icon:e(g)("plus"),disabled:!k.writable||e(r).loading.value,onClick:m=>xe(a)},{default:i(()=>[c(s(e(l)("generated.skillSourceManagementPage.addToCatalog")),1)]),_:1},8,["icon","disabled","onClick"])])]),_:1},8,["label"])]),_:1},8,["data"])):e(r).loading.value?C("",!0):(d(),M("div",sa,s(J.value?.kind==="SKILLS_SH"?e(l)("generated.skillSourceManagementPage.noPopularSkillsAreAvailableEnterA"):J.value?e(l)("generated.skillSourceManagementPage.thisSourceHasNoAvailableSkills"):e(l)("generated.skillSourceManagementPage.selectAnEnabledSkillSource2")),1))])),[[e(te),B.value&&!I.value,"region"]])]),_:1},8,["label"]),o(e(Ce),{label:e(l)("generated.skillSourceManagementPage.catalogSkills"),name:"catalog"},{default:i(()=>[P("div",ua,[o(e(G),{modelValue:e(W),"onUpdate:modelValue":t[5]||(t[5]=a=>Qe(W)?W.value=a:null),clearable:"",placeholder:e(l)("generated.skillSourceManagementPage.searchSkillNamesOrDescriptions"),"clear-icon":e(g)("clear-input")},null,8,["modelValue","placeholder","clear-icon"]),P("div",{class:"skill-category-strip","aria-label":e(l)("generated.skillSourceManagementPage.catalogSkillCategories")},[P("button",{class:ye({selected:e(K)===""}),onClick:t[6]||(t[6]=a=>K.value="")},s(e(l)("generated.skillSourceManagementPage.all")),3),(d(!0),M($,null,N(e(Y),a=>(d(),M("button",{key:a,class:ye({selected:e(K)===a}),onClick:m=>K.value=a},s(a),11,ca))),128))],8,da)]),le((d(),M("div",ga,[e(Se).length>0?(d(),S(e(ue),{key:0,class:"clickable-rows catalog-skill-table",onSortChange:e(u).sort,data:e(Se),"row-key":"id",onRowClick:Le},{default:i(()=>[o(e(p),{prop:"normalizedName",label:e(l)("generated.skillSourceManagementPage.name"),sortable:"custom","min-width":"170"},null,8,["label"]),o(e(p),{prop:"repositoryIdentity",label:e(l)("generated.skillDetailsDialog.source"),"min-width":"180","show-overflow-tooltip":""},null,8,["label"]),o(e(p),{label:e(l)("generated.skillSourceManagementPage.scope"),width:"144","show-overflow-tooltip":""},{default:i(({row:a})=>[c(s(x(a.scope)),1)]),_:1},8,["label"]),o(e(p),{prop:"description",label:e(l)("conversationTemplates.description"),"min-width":"260","show-overflow-tooltip":""},{default:i(({row:a})=>[c(s(a.description||e(l)("generated.skillSourceManagementPage.noDescriptionIsAvailableForThisSkill")),1)]),_:1},8,["label"]),o(e(p),{label:e(l)("generated.skillDetailsDialog.version"),"min-width":"170"},{default:i(({row:a})=>[P("span",null,s(a.commitSha.slice(0,8)),1),P("span",ma,s(e(l)("generated.skillSourceManagementPage.updated"))+" "+s(Pe(a.updatedAt)),1)]),_:1},8,["label"]),o(e(p),{label:e(l)("generated.skillDetailsDialog.tags"),"min-width":"150"},{default:i(({row:a})=>[a.featured||a.tags.length>0?(d(),M("div",fa,[a.featured?(d(),S(e(se),{key:0,type:"warning",effect:"plain"},{default:i(()=>[c("★ "+s(e(l)("generated.skillSourceManagementPage.featured")),1)]),_:1})):C("",!0),(d(!0),M($,null,N(a.tags,m=>(d(),S(e(se),{key:m,type:"info",effect:"plain"},{default:i(()=>[c(s(m),1)]),_:2},1024))),128))])):C("",!0)]),_:1},8,["label"]),o(e(p),{label:e(l)("generated.skillSourceManagementPage.actions"),"min-width":"360"},{default:i(({row:a})=>[P("div",{class:"mar-row-actions",onClick:t[7]||(t[7]=ne(()=>{},["stop"]))},[o(e(v),{link:"",icon:e(g)("edit"),disabled:!k.writable||!a.manageable||e(r).loading.value,onClick:m=>Ie(a)},{default:i(()=>[c(s(e(l)("generated.skillSourceManagementPage.edit")),1)]),_:1},8,["icon","disabled","onClick"]),U.value[a.id]?.updateAvailable?(d(),S(e(v),{key:1,link:"",icon:e(g)("retry"),loading:Z.value===a.id,disabled:!k.writable||!a.manageable||e(r).loading.value,onClick:m=>qe(a)},{default:i(()=>[c(s(e(l)("generated.skillSourceManagementPage.updateTo"))+" "+s(U.value[a.id].latestCommitSha.slice(0,8)),1)]),_:2},1032,["icon","loading","disabled","onClick"])):(d(),S(e(v),{key:0,link:"",icon:e(g)("refresh"),loading:E.value.has(a.id),disabled:!k.writable||!a.manageable||e(r).loading.value,onClick:m=>Oe(a)},{default:i(()=>[c(s(e(l)("generated.skillSourceManagementPage.checkForUpdates")),1)]),_:1},8,["icon","loading","disabled","onClick"])),o(e(v),{link:"",type:"danger",icon:e(g)("delete"),disabled:!k.writable||!a.manageable||e(r).loading.value,onClick:m=>Ke(a.id,a.normalizedName)},{default:i(()=>[c(s(e(l)("generated.skillSourceManagementPage.remove2")),1)]),_:1},8,["icon","disabled","onClick"])])]),_:1},8,["label"])]),_:1},8,["onSortChange","data"])):e(r).loading.value?C("",!0):(d(),M("div",pa,s(e(r).favorites.value.length===0?e(l)("generated.skillSourceManagementPage.noCatalogSkills"):e(l)("generated.skillSourceManagementPage.noMatchingSkills")),1)),o(Ye,{total:e(u).total.value,page:e(u).page.value,mobile:e(u).mobileViewport.value,"mobile-visible-count":e(u).mobileVisibleCount.value,loading:e(u).loading.value,"loading-more":e(u).loadingMore.value,"has-more":e(u).hasMore.value,onPage:e(u).setPage,failed:e(u).failure.value!==void 0,"incremental-failed":e(u).failure.value?.incremental===!0,error:e(u).failure.value?.error,"context-key":e(u).contextKey.value,onRetry:e(u).retry,onLoadMore:e(u).loadMore},null,8,["total","page","mobile","mobile-visible-count","loading","loading-more","has-more","onPage","failed","incremental-failed","error","context-key","onRetry","onLoadMore"])])),[[e(te),e(u).loading.value&&!I.value&&!e(u).loadingMore.value&&!e(u).failure.value,"region"]])]),_:1},8,["label"])]),_:1},8,["modelValue"]),T.value?(d(),S(e(oe),{key:0,onVnodeMounted:e(ge),onVnodeBeforeUnmount:e(ce),modelValue:T.value,"onUpdate:modelValue":t[12]||(t[12]=a=>T.value=a),title:e(l)("generated.skillSourceManagementPage.addSkillSource2"),width:"min(520px, calc(100vw - 32px))"},{footer:i(()=>[o(e(v),{onClick:t[11]||(t[11]=a=>T.value=!1)},{default:i(()=>[c(s(e(l)("generated.skillSourceManagementPage.cancel3")),1)]),_:1}),o(e(v),{type:"primary",loading:e(r).loading.value,onClick:Ue},{default:i(()=>[c(s(e(l)("generated.skillSourceManagementPage.add")),1)]),_:1},8,["loading"])]),default:i(()=>[o(e(de),{ref_key:"sourceForm",ref:fe,model:{...k.sourceContext,...w},rules:{...k.ownershipRules,...X.value},"label-position":"top"},{default:i(()=>[o(e(V),{label:e(l)("generated.skillSourceManagementPage.name2"),prop:"name"},{default:i(()=>[o(e(G),{modelValue:w.name,"onUpdate:modelValue":t[9]||(t[9]=a=>w.name=a),maxlength:"128"},null,8,["modelValue"])]),_:1},8,["label"]),o(e(V),{label:e(l)("generated.skillSourceManagementPage.repositoryURL"),prop:"locator"},{default:i(()=>[o(e(G),{modelValue:w.locator,"onUpdate:modelValue":t[10]||(t[10]=a=>w.locator=a),placeholder:e(l)("generated.skillSourceManagementPage.httpsGithubComOrgRepoOrGit")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),P("p",va,s(e(l)("generated.skillSourceManagementPage.gitRepositoriesUseTheServerProcessUser")),1),we(n.$slots,"source-ownership",{},()=>[o(e(V),{label:e(l)("generated.skillSourceManagementPage.scope2")},{default:i(()=>[o(e(O),{"model-value":"PERSONAL","clear-icon":e(g)("clear-input"),"suffix-icon":e(g)("chevron-down")},{default:i(()=>[o(e(q),{value:"PERSONAL",label:e(l)("generated.skillSourceManagementPage.personal2")},null,8,["label"])]),_:1},8,["clear-icon","suffix-icon"])]),_:1},8,["label"])],!0)]),_:3},8,["model","rules"])]),_:3},8,["onVnodeMounted","onVnodeBeforeUnmount","modelValue","title"])):C("",!0),_.value?(d(),S(e(oe),{key:1,onVnodeMounted:e(ge),onVnodeBeforeUnmount:e(ce),modelValue:_.value,"onUpdate:modelValue":t[16]||(t[16]=a=>_.value=a),title:e(l)("generated.skillSourceManagementPage.addToCatalog2"),width:"min(460px, calc(100vw - 32px))"},{footer:i(()=>[o(e(v),{onClick:t[15]||(t[15]=a=>_.value=!1)},{default:i(()=>[c(s(e(l)("generated.skillSourceManagementPage.cancel4")),1)]),_:1}),o(e(v),{type:"primary",loading:e(r).loading.value,onClick:Ne},{default:i(()=>[c(s(e(l)("generated.skillSourceManagementPage.add2")),1)]),_:1},8,["loading"])]),default:i(()=>[o(e(de),{ref_key:"catalogForm",ref:pe,model:{...k.catalogContext,...h},rules:{...k.ownershipRules,...X.value},"label-position":"top"},{default:i(()=>[we(n.$slots,"catalog-ownership",{},()=>[o(e(V),{label:e(l)("generated.skillSourceManagementPage.availability")},{default:i(()=>[o(e(O),{"model-value":"PERSONAL","clear-icon":e(g)("clear-input"),"suffix-icon":e(g)("chevron-down")},{default:i(()=>[o(e(q),{value:"PERSONAL",label:e(l)("generated.skillSourceManagementPage.personal3")},null,8,["label"])]),_:1},8,["clear-icon","suffix-icon"])]),_:1},8,["label"])],!0),o(e(V),{label:e(l)("generated.skillSourceManagementPage.featured2")},{default:i(()=>[o(e(Ve),{modelValue:h.featured,"onUpdate:modelValue":t[13]||(t[13]=a=>h.featured=a)},null,8,["modelValue"])]),_:1},8,["label"]),o(e(V),{label:e(l)("generated.skillSourceManagementPage.tags"),prop:"tags"},{default:i(()=>[o(e(O),{modelValue:h.tags,"onUpdate:modelValue":t[14]||(t[14]=a=>h.tags=a),multiple:"",filterable:"","allow-create":"","default-first-option":"","multiple-limit":10,placeholder:e(l)("generated.skillSourceManagementPage.enterATagAndPressEnterUp"),"clear-icon":e(g)("clear-input"),"suffix-icon":e(g)("chevron-down")},{default:i(()=>[(d(!0),M($,null,N(e(Y),a=>(d(),S(e(q),{key:a,label:a,value:a},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","clear-icon","suffix-icon"])]),_:1},8,["label"])]),_:3},8,["model","rules"])]),_:3},8,["onVnodeMounted","onVnodeBeforeUnmount","modelValue","title"])):C("",!0),A.value?(d(),S(e(oe),{key:2,onVnodeMounted:e(ge),onVnodeBeforeUnmount:e(ce),modelValue:A.value,"onUpdate:modelValue":t[20]||(t[20]=a=>A.value=a),title:e(l)("generated.skillSourceManagementPage.editSkillInformation"),width:"min(460px, calc(100vw - 32px))","destroy-on-close":""},{footer:i(()=>[o(e(v),{onClick:t[19]||(t[19]=a=>A.value=!1)},{default:i(()=>[c(s(e(l)("generated.skillSourceManagementPage.cancel5")),1)]),_:1}),o(e(v),{type:"primary",loading:e(r).loading.value,onClick:Be},{default:i(()=>[c(s(e(l)("generated.skillSourceManagementPage.save")),1)]),_:1},8,["loading"])]),default:i(()=>[o(e(de),{ref_key:"editForm",ref:ve,model:y,rules:X.value,"label-position":"top"},{default:i(()=>[o(e(V),{label:e(l)("generated.skillSourceManagementPage.featured3")},{default:i(()=>[o(e(Ve),{modelValue:y.featured,"onUpdate:modelValue":t[17]||(t[17]=a=>y.featured=a)},null,8,["modelValue"])]),_:1},8,["label"]),o(e(V),{label:e(l)("generated.skillSourceManagementPage.tags2"),prop:"tags"},{default:i(()=>[o(e(O),{modelValue:y.tags,"onUpdate:modelValue":t[18]||(t[18]=a=>y.tags=a),multiple:"",filterable:"","allow-create":"","default-first-option":"","multiple-limit":10,placeholder:e(l)("generated.skillSourceManagementPage.enterATagAndPressEnterUp2"),"clear-icon":e(g)("clear-input"),"suffix-icon":e(g)("chevron-down")},{default:i(()=>[(d(!0),M($,null,N(e(Y),a=>(d(),S(e(q),{key:a,label:a,value:a},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","clear-icon","suffix-icon"])]),_:1},8,["label"])]),_:1},8,["model","rules"])]),_:1},8,["onVnodeMounted","onVnodeBeforeUnmount","modelValue","title"])):C("",!0),o(la,{modelValue:L.value,"onUpdate:modelValue":t[21]||(t[21]=a=>L.value=a),details:z.value},null,8,["modelValue","details"])])),[[e(te),I.value,"page"]])}}),Ra=We(ka,[["__scopeId","data-v-105ef225"]]);export{Ra as default};
1
+ import{m as Ge,K as He,L as Ze,W as F,t as l,N as le,E as e,O as te,o as d,n as M,P,q as o,D as i,S as c,Q as s,F as g,T as v,U as ne,C as S,G as C,a6 as $,a7 as N,R as G,a8 as je,ac as Qe,a2 as ye,p as we,V as oe,f,l as ie,k as he,X as re,_ as We}from"./index-BAF_vQZ-.js";import{M as Ce,a as Xe}from"./MarTabs-DtoaIrb2.js";import{M as se}from"./MarTag-C1JDYeU5.js";import{_ as p,M as ue}from"./MarTableColumn.vue_vue_type_script_setup_true_lang-Cl79Jlsp.js";import{a as de,_ as V}from"./MarFormItem.vue_vue_type_script_setup_true_lang-C5687WPW.js";import{M as O,a as q}from"./MarOptionGroup.vue_vue_type_style_index_0_scoped_0cdd846e_lang-C5U0ej6_.js";import{M as Ve}from"./MarSwitch-D7P0NJJ8.js";import{u as ce,m as ge}from"./mobile-dialog-return-service-G00_zLGC.js";import{w as Je,M as Ye}from"./ManagementPagination-nDliwf8V.js";import{f as ea}from"./time-presentation-BsKzQVfX.js";import{c as aa,s as H,S as la}from"./SkillDetailsDialog-DqOTzyHx.js";import"./error-presentation-C9lF2Dka.js";import"./BusyIndicator-PRFERntc.js";import"./catalog-page-service-BKeMbafQ.js";import"./MarDescriptionsItem-DXs8T6y2.js";const ta={class:"mar-management-page"},na={class:"mar-table-actions"},oa={class:"source-search-bar"},ia={class:"toolbar"},ra={class:"skill-table-section"},sa={key:1,class:"skill-empty"},ua={class:"catalog-filter-bar"},da=["aria-label"],ca=["onClick"],ga={class:"skill-table-section"},ma={class:"table-meta"},fa={key:0,class:"skill-tags"},pa={key:1,class:"skill-empty"},va={class:"form-hint"},ka=Ge({__name:"SkillSourceManagementPage",props:{request:{type:Function},writable:{type:Boolean},scopeLabel:{type:Function},loadExtension:{type:Function},sourceContext:{},catalogContext:{},ownershipRules:{},submitSource:{type:Function},submitFavorite:{type:Function}},emits:["openSource","openCatalog"],setup(k,{emit:De}){const D=k,me=De,r=aa(D.request,{...D.submitSource===void 0?{}:{submitSource:D.submitSource},...D.submitFavorite===void 0?{}:{submitFavorite:D.submitFavorite}}),Te=r.sources,u=r.catalogPage;Je(u);const T=f(!1),_=f(!1),A=f(!1),L=f(!1),I=f(!0),B=f(!1),E=f(new Set),Z=f(),fe=f(),pe=f(),ve=f(),j=f(),Q=f(),z=f(),U=f({}),W=u.keyword,K=u.category,ke=f("source"),w=ie({name:"",locator:""}),h=ie({featured:!1,tags:[]}),y=ie({featured:!1,tags:[]}),X=he(()=>({name:[{required:!0,message:l("generated.skillSourceManagementPage.enterASourceName"),trigger:"blur"}],locator:[{required:!0,message:l("generated.skillSourceManagementPage.enterARepositoryURL"),trigger:"blur"},{validator:(n,t,a)=>{const m=typeof t=="string"?t.trim():"";/^https:\/\//u.test(m)||/^git@[A-Za-z0-9.-]+:[A-Za-z0-9_.-]+(?:\/[A-Za-z0-9_.-]+)+(?:\.git)?$/u.test(m)?a():a(new Error(l("generated.skillSourceManagementPage.enterAnHTTPSOrGitSSHRepository")))},trigger:"blur"}],tags:[{validator:(n,t,a)=>{const m=Array.isArray(t)?t.map(R=>String(R).trim()):[];m.some(R=>R.length===0||R.length>32)?a(new Error(l("generated.skillSourceManagementPage.eachTagMustContain132Characters"))):new Set(m.map(R=>R.toLocaleLowerCase())).size!==m.length?a(new Error(l("generated.skillSourceManagementPage.duplicateTagsAreNotAllowed"))):a()},trigger:"change"}]})),J=he(()=>r.sources.value.find(n=>n.id===r.selectedSourceId.value)),Y=u.tags,Se=r.favorites;He(()=>{u.start(),_e()}),Ze(()=>u.dispose());async function _e(){I.value=!0;try{await b(async()=>{await Promise.all([r.loadSources(),r.loadCatalog()]),r.selectedSourceId.value!==""&&await ee(),await D.loadExtension?.()})}finally{I.value=!1}}async function b(n,t){try{await n(),t!==void 0&&F(t,"success")}catch(a){if(a===u.error.value)return;F(H(a,l("generated.skillSourceManagementPage.theSkillSourceOperationDidNotComplete")),"error",a)}}function Ae(){Object.assign(w,{name:"",locator:""}),me("openSource"),T.value=!0}async function Ue(){await fe.value?.validate().catch(()=>!1)&&await b(async()=>{await r.addSource({name:w.name.trim(),locator:w.locator.trim()}),T.value=!1},l("generated.skillSourceManagementPage.skillSourceAdded"))}function xe(n){j.value=n,Object.assign(h,{featured:!1,tags:[]}),me("openCatalog"),_.value=!0}function Re(n){z.value={name:n.name,description:n.description,source:n.source,...n.skillPath===null?{}:{path:n.skillPath},...n.installs===null?{}:{installs:n.installs}},L.value=!0}function Fe(n){z.value={name:n.name,description:"",source:n.locator,scope:x(n.scope),status:n.enabled?l("generated.skillSourceManagementPage.enabled"):l("generated.skillSourceManagementPage.disabled")},L.value=!0}function Le(n){z.value={name:n.normalizedName,description:n.description,source:n.repositoryIdentity,scope:x(n.scope),path:n.skillPath,version:n.commitSha.slice(0,8),updatedAt:Pe(n.updatedAt),featured:n.featured,tags:n.tags},L.value=!0}function Ie(n){Q.value=n,y.featured=n.featured,y.tags=[...n.tags],A.value=!0}async function Be(){if(!await ve.value?.validate().catch(()=>!1)||Q.value===void 0)return;const n=y.tags.map(t=>t.trim());await b(async()=>{await r.updatePresentation(Q.value.id,{featured:y.featured,tags:n}),A.value=!1},l("generated.skillSourceManagementPage.skillInformationUpdated"))}async function Ee(n){r.selectedSourceId.value=n,r.candidates.value=[],r.query.value="",await b(ee)}async function ee(){B.value=!0;try{await r.loadCandidates()}finally{B.value=!1}}async function be(){B.value=!0;try{await r.search()}finally{B.value=!1}}async function Me(n){const t=r.selectedSourceId.value;await n(),r.selectedSourceId.value!==""&&r.selectedSourceId.value!==t&&await ee()}async function $e(n){try{await re.confirm(n.enabled?l("generated.skillSourceManagementPage.confirmDisableSkillSource",{value0:n.name}):l("generated.skillSourceManagementPage.confirmEnableSkillSource",{value0:n.name}),l("generated.skillSourceManagementPage.updateSkillSourceStatus"),{icon:g("warning"),type:"warning",confirmButtonText:n.enabled?l("generated.skillSourceManagementPage.disable"):l("generated.skillSourceManagementPage.enable"),cancelButtonText:l("generated.skillSourceManagementPage.cancel2")})}catch(t){if(ae(t))return;F(H(t,l("generated.skillSourceManagementPage.unableToConfirmSourceStatusChange")),"error",t);return}await b(()=>Me(()=>r.setSourceEnabled(n.id,!n.enabled)),l("generated.skillSourceManagementPage.skillSourceStatusUpdated"))}async function Ne(){if(!await pe.value?.validate().catch(()=>!1)||j.value===void 0)return;const n=h.tags.map(t=>t.trim());await b(async()=>{await r.favorite(j.value,{featured:h.featured,tags:n}),_.value=!1},l("generated.skillSourceManagementPage.skillAddedToTheCatalog"))}async function Oe(n){E.value=new Set([...E.value,n.id]);try{await b(async()=>{const t=await r.checkUpdate(n.id);U.value={...U.value,[n.id]:t},F(t.updateAvailable?l("generated.skillSourceManagementPage.updateAvailable"):l("generated.skillSourceManagementPage.alreadyUpToDate"),"info")})}finally{const t=new Set(E.value);t.delete(n.id),E.value=t}}async function qe(n){Z.value=n.id;try{await b(async()=>{await r.upgrade(n.id);const t={...U.value};delete t[n.id],U.value=t},l("generated.skillSourceManagementPage.catalogSkillUpdated"))}finally{Z.value=void 0}}function Pe(n){return ea(n)}async function ze(n){try{await re.confirm(l("generated.skillSourceManagementPage.deleteSkillSource",{value0:n.name}),l("generated.skillSourceManagementPage.deleteSkillSource2"),{icon:g("warning"),type:"warning",confirmButtonText:l("generated.skillSourceManagementPage.delete"),cancelButtonText:l("generated.skillSourceManagementPage.cancel")})}catch(t){if(ae(t))return;F(H(t,l("generated.skillSourceManagementPage.unableToConfirmDeletionTryAgainLater")),"error",t);return}await b(()=>Me(()=>r.removeSource(n.id)),l("generated.skillSourceManagementPage.skillSourceDeleted"))}async function Ke(n,t){try{await re.confirm(l("generated.skillSourceManagementPage.removeFromTheSkillCatalogInstalledCopies",{value0:t}),l("generated.skillSourceManagementPage.removeSkill"),{icon:g("warning"),type:"warning",confirmButtonText:l("generated.skillSourceManagementPage.remove"),cancelButtonText:l("generated.skillSourceManagementPage.cancel2")})}catch(a){if(ae(a))return;F(H(a,l("generated.skillSourceManagementPage.unableToConfirmRemovalTryAgainLater")),"error",a);return}await b(()=>r.remove(n),l("generated.skillSourceManagementPage.skillRemoved"))}function ae(n){return n==="cancel"||n==="close"}function x(n){return D.scopeLabel?.(n)??l("generated.skillSourceManagementPage.personal")}return(n,t)=>le((d(),M("section",ta,[P("div",na,[o(e(v),{type:"primary",icon:e(g)("plus"),disabled:!k.writable||e(r).loading.value,onClick:Ae},{default:i(()=>[c(s(e(l)("generated.skillSourceManagementPage.addSkillSource")),1)]),_:1},8,["icon","disabled"])]),o(e(ue),{class:"clickable-rows skill-source-table",data:e(Te),"row-key":"id",onRowClick:Fe},{default:i(()=>[o(e(p),{prop:"name",label:e(l)("generated.skillSourceManagementPage.name"),sortable:"","min-width":"180"},null,8,["label"]),o(e(p),{label:e(l)("generated.skillSourceManagementPage.scope"),width:"144","show-overflow-tooltip":"",sortable:"","sort-method":(a,m)=>x(a.scope).localeCompare(x(m.scope))},{default:i(({row:a})=>[c(s(x(a.scope)),1)]),_:1},8,["label","sort-method"]),o(e(p),{prop:"locator",label:e(l)("generated.skillSourceManagementPage.uRL"),"min-width":"280","show-overflow-tooltip":""},null,8,["label"]),o(e(p),{label:e(l)("generated.skillSourceManagementPage.status"),width:"110"},{default:i(({row:a})=>[o(e(se),{type:a.enabled?"success":"info",effect:"plain"},{default:i(()=>[c(s(a.enabled?e(l)("generated.skillSourceManagementPage.enabled"):e(l)("generated.skillSourceManagementPage.disabled")),1)]),_:2},1032,["type"])]),_:1},8,["label"]),o(e(p),{label:e(l)("generated.skillSourceManagementPage.actions"),width:180},{default:i(({row:a})=>[P("div",{class:"mar-row-actions",onClick:t[0]||(t[0]=ne(()=>{},["stop"]))},[o(e(v),{link:"",icon:e(g)("power"),disabled:!k.writable||!a.manageable||e(r).loading.value,onClick:m=>$e(a)},{default:i(()=>[c(s(a.enabled?e(l)("generated.skillSourceManagementPage.disable"):e(l)("generated.skillSourceManagementPage.enable")),1)]),_:2},1032,["icon","disabled","onClick"]),a.builtIn?C("",!0):(d(),S(e(v),{key:0,link:"",type:"danger",icon:e(g)("delete"),disabled:!k.writable||!a.manageable||e(r).loading.value,onClick:m=>ze(a)},{default:i(()=>[c(s(e(l)("generated.skillSourceManagementPage.delete2")),1)]),_:1},8,["icon","disabled","onClick"]))])]),_:1},8,["label"])]),_:1},8,["data"]),o(e(Xe),{modelValue:ke.value,"onUpdate:modelValue":t[8]||(t[8]=a=>ke.value=a),class:"skill-management-tabs"},{default:i(()=>[o(e(Ce),{label:e(l)("generated.skillSourceManagementPage.sourceSkills"),name:"source"},{default:i(()=>[P("div",oa,[o(e(O),{"model-value":e(r).selectedSourceId.value,"aria-label":e(l)("generated.skillSourceManagementPage.selectASkillSource"),placeholder:e(l)("generated.skillSourceManagementPage.selectAnEnabledSkillSource"),disabled:e(r).loading.value,onChange:Ee},{default:i(()=>[(d(!0),M($,null,N(e(r).sources.value.filter(a=>a.enabled),a=>(d(),S(e(q),{key:a.id,label:a.name,value:a.id},null,8,["label","value"]))),128))]),_:1},8,["model-value","aria-label","placeholder","disabled"]),P("div",ia,[o(e(G),{modelValue:e(r).query.value,"onUpdate:modelValue":t[2]||(t[2]=a=>e(r).query.value=a),clearable:"",placeholder:e(l)("generated.skillSourceManagementPage.enterASkillNameOrDescription"),onKeyup:t[3]||(t[3]=je(a=>b(be),["enter"])),"clear-icon":e(g)("clear-input")},{append:i(()=>[o(e(v),{icon:e(g)("search"),disabled:!J.value?.enabled||e(r).loading.value,onClick:t[1]||(t[1]=a=>b(be))},{default:i(()=>[c(s(e(l)("generated.skillSourceManagementPage.search")),1)]),_:1},8,["icon","disabled"])]),_:1},8,["modelValue","placeholder","clear-icon"])])]),le((d(),M("div",ra,[e(r).candidates.value.length>0?(d(),S(e(ue),{key:0,class:"clickable-rows source-skill-table",data:e(r).candidates.value,"row-key":"id",onRowClick:Re},{default:i(()=>[o(e(p),{prop:"name",label:e(l)("generated.skillSourceManagementPage.name"),sortable:"","min-width":"180"},null,8,["label"]),o(e(p),{prop:"source",label:e(l)("generated.skillDetailsDialog.source"),"min-width":"180","show-overflow-tooltip":""},null,8,["label"]),o(e(p),{prop:"description",label:e(l)("conversationTemplates.description"),"min-width":"280","show-overflow-tooltip":""},{default:i(({row:a})=>[c(s(a.description||e(l)("generated.skillSourceManagementPage.noDescriptionWasProvidedByThisSource")),1)]),_:1},8,["label"]),o(e(p),{label:e(l)("generated.skillSourceManagementPage.actions"),width:180},{default:i(({row:a})=>[P("div",{class:"mar-row-actions",onClick:t[4]||(t[4]=ne(()=>{},["stop"]))},[o(e(v),{link:"",icon:e(g)("plus"),disabled:!k.writable||e(r).loading.value,onClick:m=>xe(a)},{default:i(()=>[c(s(e(l)("generated.skillSourceManagementPage.addToCatalog")),1)]),_:1},8,["icon","disabled","onClick"])])]),_:1},8,["label"])]),_:1},8,["data"])):e(r).loading.value?C("",!0):(d(),M("div",sa,s(J.value?.kind==="SKILLS_SH"?e(l)("generated.skillSourceManagementPage.noPopularSkillsAreAvailableEnterA"):J.value?e(l)("generated.skillSourceManagementPage.thisSourceHasNoAvailableSkills"):e(l)("generated.skillSourceManagementPage.selectAnEnabledSkillSource2")),1))])),[[e(te),B.value&&!I.value,"region"]])]),_:1},8,["label"]),o(e(Ce),{label:e(l)("generated.skillSourceManagementPage.catalogSkills"),name:"catalog"},{default:i(()=>[P("div",ua,[o(e(G),{modelValue:e(W),"onUpdate:modelValue":t[5]||(t[5]=a=>Qe(W)?W.value=a:null),clearable:"",placeholder:e(l)("generated.skillSourceManagementPage.searchSkillNamesOrDescriptions"),"clear-icon":e(g)("clear-input")},null,8,["modelValue","placeholder","clear-icon"]),P("div",{class:"skill-category-strip","aria-label":e(l)("generated.skillSourceManagementPage.catalogSkillCategories")},[P("button",{class:ye({selected:e(K)===""}),onClick:t[6]||(t[6]=a=>K.value="")},s(e(l)("generated.skillSourceManagementPage.all")),3),(d(!0),M($,null,N(e(Y),a=>(d(),M("button",{key:a,class:ye({selected:e(K)===a}),onClick:m=>K.value=a},s(a),11,ca))),128))],8,da)]),le((d(),M("div",ga,[e(Se).length>0?(d(),S(e(ue),{key:0,class:"clickable-rows catalog-skill-table",onSortChange:e(u).sort,data:e(Se),"row-key":"id",onRowClick:Le},{default:i(()=>[o(e(p),{prop:"normalizedName",label:e(l)("generated.skillSourceManagementPage.name"),sortable:"custom","min-width":"170"},null,8,["label"]),o(e(p),{prop:"repositoryIdentity",label:e(l)("generated.skillDetailsDialog.source"),"min-width":"180","show-overflow-tooltip":""},null,8,["label"]),o(e(p),{label:e(l)("generated.skillSourceManagementPage.scope"),width:"144","show-overflow-tooltip":""},{default:i(({row:a})=>[c(s(x(a.scope)),1)]),_:1},8,["label"]),o(e(p),{prop:"description",label:e(l)("conversationTemplates.description"),"min-width":"260","show-overflow-tooltip":""},{default:i(({row:a})=>[c(s(a.description||e(l)("generated.skillSourceManagementPage.noDescriptionIsAvailableForThisSkill")),1)]),_:1},8,["label"]),o(e(p),{label:e(l)("generated.skillDetailsDialog.version"),"min-width":"170"},{default:i(({row:a})=>[P("span",null,s(a.commitSha.slice(0,8)),1),P("span",ma,s(e(l)("generated.skillSourceManagementPage.updated"))+" "+s(Pe(a.updatedAt)),1)]),_:1},8,["label"]),o(e(p),{label:e(l)("generated.skillDetailsDialog.tags"),"min-width":"150"},{default:i(({row:a})=>[a.featured||a.tags.length>0?(d(),M("div",fa,[a.featured?(d(),S(e(se),{key:0,type:"warning",effect:"plain"},{default:i(()=>[c("★ "+s(e(l)("generated.skillSourceManagementPage.featured")),1)]),_:1})):C("",!0),(d(!0),M($,null,N(a.tags,m=>(d(),S(e(se),{key:m,type:"info",effect:"plain"},{default:i(()=>[c(s(m),1)]),_:2},1024))),128))])):C("",!0)]),_:1},8,["label"]),o(e(p),{label:e(l)("generated.skillSourceManagementPage.actions"),"min-width":"360"},{default:i(({row:a})=>[P("div",{class:"mar-row-actions",onClick:t[7]||(t[7]=ne(()=>{},["stop"]))},[o(e(v),{link:"",icon:e(g)("edit"),disabled:!k.writable||!a.manageable||e(r).loading.value,onClick:m=>Ie(a)},{default:i(()=>[c(s(e(l)("generated.skillSourceManagementPage.edit")),1)]),_:1},8,["icon","disabled","onClick"]),U.value[a.id]?.updateAvailable?(d(),S(e(v),{key:1,link:"",icon:e(g)("retry"),loading:Z.value===a.id,disabled:!k.writable||!a.manageable||e(r).loading.value,onClick:m=>qe(a)},{default:i(()=>[c(s(e(l)("generated.skillSourceManagementPage.updateTo"))+" "+s(U.value[a.id].latestCommitSha.slice(0,8)),1)]),_:2},1032,["icon","loading","disabled","onClick"])):(d(),S(e(v),{key:0,link:"",icon:e(g)("refresh"),loading:E.value.has(a.id),disabled:!k.writable||!a.manageable||e(r).loading.value,onClick:m=>Oe(a)},{default:i(()=>[c(s(e(l)("generated.skillSourceManagementPage.checkForUpdates")),1)]),_:1},8,["icon","loading","disabled","onClick"])),o(e(v),{link:"",type:"danger",icon:e(g)("delete"),disabled:!k.writable||!a.manageable||e(r).loading.value,onClick:m=>Ke(a.id,a.normalizedName)},{default:i(()=>[c(s(e(l)("generated.skillSourceManagementPage.remove2")),1)]),_:1},8,["icon","disabled","onClick"])])]),_:1},8,["label"])]),_:1},8,["onSortChange","data"])):e(r).loading.value?C("",!0):(d(),M("div",pa,s(e(r).favorites.value.length===0?e(l)("generated.skillSourceManagementPage.noCatalogSkills"):e(l)("generated.skillSourceManagementPage.noMatchingSkills")),1)),o(Ye,{total:e(u).total.value,page:e(u).page.value,mobile:e(u).mobileViewport.value,"mobile-visible-count":e(u).mobileVisibleCount.value,loading:e(u).loading.value,"loading-more":e(u).loadingMore.value,"has-more":e(u).hasMore.value,onPage:e(u).setPage,failed:e(u).failure.value!==void 0,"incremental-failed":e(u).failure.value?.incremental===!0,error:e(u).failure.value?.error,"context-key":e(u).contextKey.value,onRetry:e(u).retry,onLoadMore:e(u).loadMore},null,8,["total","page","mobile","mobile-visible-count","loading","loading-more","has-more","onPage","failed","incremental-failed","error","context-key","onRetry","onLoadMore"])])),[[e(te),e(u).loading.value&&!I.value&&!e(u).loadingMore.value&&!e(u).failure.value,"region"]])]),_:1},8,["label"])]),_:1},8,["modelValue"]),T.value?(d(),S(e(oe),{key:0,onVnodeMounted:e(ge),onVnodeBeforeUnmount:e(ce),modelValue:T.value,"onUpdate:modelValue":t[12]||(t[12]=a=>T.value=a),title:e(l)("generated.skillSourceManagementPage.addSkillSource2"),width:"min(520px, calc(100vw - 32px))"},{footer:i(()=>[o(e(v),{onClick:t[11]||(t[11]=a=>T.value=!1)},{default:i(()=>[c(s(e(l)("generated.skillSourceManagementPage.cancel3")),1)]),_:1}),o(e(v),{type:"primary",loading:e(r).loading.value,onClick:Ue},{default:i(()=>[c(s(e(l)("generated.skillSourceManagementPage.add")),1)]),_:1},8,["loading"])]),default:i(()=>[o(e(de),{ref_key:"sourceForm",ref:fe,model:{...k.sourceContext,...w},rules:{...k.ownershipRules,...X.value},"label-position":"top"},{default:i(()=>[o(e(V),{label:e(l)("generated.skillSourceManagementPage.name2"),prop:"name"},{default:i(()=>[o(e(G),{modelValue:w.name,"onUpdate:modelValue":t[9]||(t[9]=a=>w.name=a),maxlength:"128"},null,8,["modelValue"])]),_:1},8,["label"]),o(e(V),{label:e(l)("generated.skillSourceManagementPage.repositoryURL"),prop:"locator"},{default:i(()=>[o(e(G),{modelValue:w.locator,"onUpdate:modelValue":t[10]||(t[10]=a=>w.locator=a),placeholder:e(l)("generated.skillSourceManagementPage.httpsGithubComOrgRepoOrGit")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),P("p",va,s(e(l)("generated.skillSourceManagementPage.gitRepositoriesUseTheServerProcessUser")),1),we(n.$slots,"source-ownership",{},()=>[o(e(V),{label:e(l)("generated.skillSourceManagementPage.scope2")},{default:i(()=>[o(e(O),{"model-value":"PERSONAL","clear-icon":e(g)("clear-input"),"suffix-icon":e(g)("chevron-down")},{default:i(()=>[o(e(q),{value:"PERSONAL",label:e(l)("generated.skillSourceManagementPage.personal2")},null,8,["label"])]),_:1},8,["clear-icon","suffix-icon"])]),_:1},8,["label"])],!0)]),_:3},8,["model","rules"])]),_:3},8,["onVnodeMounted","onVnodeBeforeUnmount","modelValue","title"])):C("",!0),_.value?(d(),S(e(oe),{key:1,onVnodeMounted:e(ge),onVnodeBeforeUnmount:e(ce),modelValue:_.value,"onUpdate:modelValue":t[16]||(t[16]=a=>_.value=a),title:e(l)("generated.skillSourceManagementPage.addToCatalog2"),width:"min(460px, calc(100vw - 32px))"},{footer:i(()=>[o(e(v),{onClick:t[15]||(t[15]=a=>_.value=!1)},{default:i(()=>[c(s(e(l)("generated.skillSourceManagementPage.cancel4")),1)]),_:1}),o(e(v),{type:"primary",loading:e(r).loading.value,onClick:Ne},{default:i(()=>[c(s(e(l)("generated.skillSourceManagementPage.add2")),1)]),_:1},8,["loading"])]),default:i(()=>[o(e(de),{ref_key:"catalogForm",ref:pe,model:{...k.catalogContext,...h},rules:{...k.ownershipRules,...X.value},"label-position":"top"},{default:i(()=>[we(n.$slots,"catalog-ownership",{},()=>[o(e(V),{label:e(l)("generated.skillSourceManagementPage.availability")},{default:i(()=>[o(e(O),{"model-value":"PERSONAL","clear-icon":e(g)("clear-input"),"suffix-icon":e(g)("chevron-down")},{default:i(()=>[o(e(q),{value:"PERSONAL",label:e(l)("generated.skillSourceManagementPage.personal3")},null,8,["label"])]),_:1},8,["clear-icon","suffix-icon"])]),_:1},8,["label"])],!0),o(e(V),{label:e(l)("generated.skillSourceManagementPage.featured2")},{default:i(()=>[o(e(Ve),{modelValue:h.featured,"onUpdate:modelValue":t[13]||(t[13]=a=>h.featured=a)},null,8,["modelValue"])]),_:1},8,["label"]),o(e(V),{label:e(l)("generated.skillSourceManagementPage.tags"),prop:"tags"},{default:i(()=>[o(e(O),{modelValue:h.tags,"onUpdate:modelValue":t[14]||(t[14]=a=>h.tags=a),multiple:"",filterable:"","allow-create":"","default-first-option":"","multiple-limit":10,placeholder:e(l)("generated.skillSourceManagementPage.enterATagAndPressEnterUp"),"clear-icon":e(g)("clear-input"),"suffix-icon":e(g)("chevron-down")},{default:i(()=>[(d(!0),M($,null,N(e(Y),a=>(d(),S(e(q),{key:a,label:a,value:a},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","clear-icon","suffix-icon"])]),_:1},8,["label"])]),_:3},8,["model","rules"])]),_:3},8,["onVnodeMounted","onVnodeBeforeUnmount","modelValue","title"])):C("",!0),A.value?(d(),S(e(oe),{key:2,onVnodeMounted:e(ge),onVnodeBeforeUnmount:e(ce),modelValue:A.value,"onUpdate:modelValue":t[20]||(t[20]=a=>A.value=a),title:e(l)("generated.skillSourceManagementPage.editSkillInformation"),width:"min(460px, calc(100vw - 32px))","destroy-on-close":""},{footer:i(()=>[o(e(v),{onClick:t[19]||(t[19]=a=>A.value=!1)},{default:i(()=>[c(s(e(l)("generated.skillSourceManagementPage.cancel5")),1)]),_:1}),o(e(v),{type:"primary",loading:e(r).loading.value,onClick:Be},{default:i(()=>[c(s(e(l)("generated.skillSourceManagementPage.save")),1)]),_:1},8,["loading"])]),default:i(()=>[o(e(de),{ref_key:"editForm",ref:ve,model:y,rules:X.value,"label-position":"top"},{default:i(()=>[o(e(V),{label:e(l)("generated.skillSourceManagementPage.featured3")},{default:i(()=>[o(e(Ve),{modelValue:y.featured,"onUpdate:modelValue":t[17]||(t[17]=a=>y.featured=a)},null,8,["modelValue"])]),_:1},8,["label"]),o(e(V),{label:e(l)("generated.skillSourceManagementPage.tags2"),prop:"tags"},{default:i(()=>[o(e(O),{modelValue:y.tags,"onUpdate:modelValue":t[18]||(t[18]=a=>y.tags=a),multiple:"",filterable:"","allow-create":"","default-first-option":"","multiple-limit":10,placeholder:e(l)("generated.skillSourceManagementPage.enterATagAndPressEnterUp2"),"clear-icon":e(g)("clear-input"),"suffix-icon":e(g)("chevron-down")},{default:i(()=>[(d(!0),M($,null,N(e(Y),a=>(d(),S(e(q),{key:a,label:a,value:a},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","clear-icon","suffix-icon"])]),_:1},8,["label"])]),_:1},8,["model","rules"])]),_:1},8,["onVnodeMounted","onVnodeBeforeUnmount","modelValue","title"])):C("",!0),o(la,{modelValue:L.value,"onUpdate:modelValue":t[21]||(t[21]=a=>L.value=a),details:z.value},null,8,["modelValue","details"])])),[[e(te),I.value,"page"]])}}),Ra=We(ka,[["__scopeId","data-v-105ef225"]]);export{Ra as default};
@@ -0,0 +1 @@
1
+ import{B as Xe,m as Ze,aw as et,f as P,K as tt,ad as nt,Y as at,o as m,n as S,E as u,C as B,P as X,ax as ot,G as x,Q as M,a6 as ue,N as Te,S as Re,t as Z,q as _e,a1 as rt,D as it,k as ee,X as st,F as lt,_ as dt}from"./index-BAF_vQZ-.js";import{d as ct,r as ut,a as ft,b as vt,m as wt,c as fe,e as Ne,f as Fe,g as gt,h as mt,i as pt,H as ht,W as yt,j as kt,k as It,l as bt,w as Pt,n as St,t as Et,o as Tt}from"./HtmlPreviewFrame-BSKmXInH.js";import{c as Rt}from"./session-share-client-service-CmFy07bc.js";import{a as _t,i as De,s as ve,u as Nt,f as Ce,d as Le,F as Ft,b as we}from"./FilePreviewLoading-BF7eGwwx.js";import{f as Dt}from"./error-presentation-C9lF2Dka.js";import Ct from"./MarkdownFilePreview-BuqlQ4wk.js";import{c as Lt}from"./workbench-live-service-a0t7gSnZ.js";import{c as Ot}from"./workspace-direct-transfer-service-H0f55kLn.js";import{f as Ut}from"./file-presentation-Cm7tx53N.js";import"./uuid-BmNSYLtZ.js";import"./MarFormItem.vue_vue_type_script_setup_true_lang-C5687WPW.js";import"./MarSwitch-D7P0NJJ8.js";import"./mobile-dialog-return-service-G00_zLGC.js";import"./MarTabs-DtoaIrb2.js";import"./BusyIndicator-PRFERntc.js";const At="/assets/github-markdown-light-DWnTz46N.css",xt=800;function Wt(p){function te(){return{...p.repositoryPath===void 0?{}:{repositoryPath:p.repositoryPath},...p.worktreePath===void 0?{}:{worktreePath:p.worktreePath}}}let _=!0,k,L=0,n;const w=new Promise(l=>{n=l}),D=setTimeout(()=>n?.(!1),xt),y=Ot({send:l=>W.sendDirect(l),shouldRetryProbe:(l,v)=>_&&l===p.nodeId&&v===k}),W=Lt({canConnect:()=>_,onEvent:()=>{},onResyncRequired:()=>{},onNodeConnection:(l,v)=>{l===p.nodeId&&!v&&y.invalidateNode(l)},onNodeReplaced:l=>y.invalidateNode(l),onReconnect:()=>{},onDisconnected:()=>y.invalidateControlConnection(),onReady:(l,v)=>{v||y.invalidateNetwork(),V()},onDirectMessage:l=>y.handle(l),onUnauthenticated:()=>F(!1),onInvalidMessage:()=>{}});async function V(){const l=++L;try{const v=await fetch(`/api/nodes/${encodeURIComponent(p.nodeId)}/workbench-capabilities`,{credentials:"same-origin"});if(!v.ok)throw new Error("DIRECT_UNAVAILABLE");const o=(await v.json()).manifest;if(!_||l!==L)return;if(o?.directTransfer?.apiVersion!==3||o.directTransfer.transport!==!0||o.directTransfer.download!==!0||typeof o.nodeGeneration!="string"){F(!1);return}k=o.nodeGeneration;const C=await y.ensureTransport(p.nodeId,k);_&&l===L&&F(C==="DIRECT_AVAILABLE")}catch{_&&l===L&&F(!1)}}function F(l){clearTimeout(D),n?.(l),n=void 0}async function N(l,v=!0){if(Xe(l)||v&&!await w)return;const h=k;if(!_||h===void 0||!y.isConnected(p.nodeId,h))return;const o={kind:"WORKSPACE_FILE",workspaceId:p.workspaceId,path:l,...te()};return{direct:y,nodeId:p.nodeId,nodeGeneration:h,resource:o,metadata:async()=>{const C=await vt({nodeId:p.nodeId,resource:o,request:async E=>{const T=await fetch(E,{credentials:"same-origin"});return T.ok?T.json():{}}});return _?C:void 0}}}async function $(l,v,h,o){const C=await N(l);if(C!==void 0)return ut({...C,fileName:l.split("/").at(-1)??"file",offset:v,length:h,...o===void 0?{}:{identity:o}}).catch(()=>{})}async function K(l){const v=await N(l);return v===void 0?void 0:ft(v)}async function q(l){const v=await N(l,!1);return v===void 0||p.activeDownloadWorker===void 0?"UNAVAILABLE":ct({...v,activeWorker:p.activeDownloadWorker})}function z(){y.invalidateNetwork()}function I(){_=!1,L+=1,F(!1),y.invalidateNetwork(),W.close()}return W.connect(),{objectUrl:K,readRange:$,download:q,networkChanged:z,close:I}}const $t=["href"],zt={key:0,class:"standalone-error"},jt={class:"standalone-markdown-header html-preview-header"},Mt={key:0},Vt={class:"standalone-markdown-header"},Bt={key:0},Kt={class:"standalone-preview-body"},qt={key:1,class:"markdown-preview-page"},Ht={key:0,class:"standalone-error"},Jt=Ze({__name:"StandaloneFilePreviewPage",props:{quoteTarget:{},share:{}},emits:["close"],setup(p,{emit:te}){const _=et(),k=p,L=te,n=new URLSearchParams(k.share?.intent??location.search),w=k.share?.access;if(w!==void 0){const t=w.session.value.share;n.set("nodeId",t.nodeId),n.set("workspaceId",t.workspaceId),n.delete("write"),n.delete("source"),n.delete("worktreePath"),n.delete("repositoryPath")}const D={...n.has("repositoryPath")?{repositoryPath:n.get("repositoryPath")}:{},...n.has("worktreePath")?{worktreePath:n.get("worktreePath")}:{}},y=w===void 0?void 0:Rt(w,w.session.value.share),W=_t(void 0,w===void 0?"workbench":`share:${w.session.value.share.id}`),V=!n.has("repositoryPath")&&n.get("markdownPreview")==="1",F=!n.has("repositoryPath")&&n.get("htmlPreview")==="1",N=V||F,$=n.get("source")==="hosted",K=w===void 0?"":`:share:${w.session.value.share.id}`,q="mar.standalone-file-tabs.v1"+K,z="mar.standalone-file-drafts.v1"+K,I=P([]),l=P(),v=P(),h=P(ze()),o=P(),C=P(),E=P(""),T=P(),b=P(),R=P(!0),H=P(!1),ge=P(w===void 0?sessionStorage.getItem("mar.user.csrf-token")??"":""),Oe=w===void 0&&n.get("write")==="1"&&Object.keys(D).length===0,me=y??Tt({csrfToken:()=>ge.value,renewCsrfToken:He}),ne=bt(me),O=ne.state,J=ee(()=>O.value.error!==void 0?Dt(O.value.error,n.get("path")??""):E.value===""?"":Z(E.value)),Ue=ee(()=>O.value.url!==void 0&&new URL(O.value.url).hostname===location.hostname),ae=wt().preference,Ae=ee(()=>({backgroundImage:`url("data:image/svg+xml,${encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" width="360" height="240"><defs><pattern id="watermark" width="360" height="240" patternUnits="userSpaceOnUse" patternTransform="rotate(-30)"><text x="0" y="120" fill="#000" fill-opacity=".12" font-family="serif" font-size="22">${Qe(ae.value.watermarkText)}</text></pattern></defs><rect width="100%" height="100%" fill="url(#watermark)"/></svg>`)}")`})),xe=Number(n.get("line"))||void 0,We=Number(n.get("column"))||void 0,oe=ee(()=>o.value===void 0?"unsupported":Ce(o.value.path,o.value.encoding));let U,re,Q=!1;function $e(){if(N)return;const t=n.get("nodeId"),e=n.get("workspaceId"),a=n.get("path");if(t===null||e===null||a===null)return;let r=[];try{const c=k.share?.embedded?[]:JSON.parse(sessionStorage.getItem(q)??"[]");Array.isArray(c)&&(r=c.filter(je))}catch{r=[]}const i={kind:ve(a,n.get("mimeType")??"")?"WORKTREE_TEXT":"WORKTREE_PREVIEW",nodeId:t,workspaceId:e,path:a,repositoryPath:n.get("repositoryPath")??"",worktreePath:n.get("worktreePath")??"",...n.has("repositoryPath")?{gitFile:!0}:{},...Number(n.get("line"))>0?{targetLine:Number(n.get("line"))}:{},...Number(n.get("column"))>0?{targetColumn:Number(n.get("column"))}:{}},s=Pt(i),g=r.find(c=>c.identity===s),f=g===void 0?{...i,id:Math.max(0,...r.map(c=>c.id))+1,identity:s,fileName:St(a),url:location.href}:{...g,...i,url:location.href};I.value=[...r.filter(c=>c.identity!==s),f].slice(-20),l.value=f.id,ie()}function ze(){try{const t=JSON.parse(sessionStorage.getItem(z)??"[]");return Array.isArray(t)?t.filter(pe):[]}catch{return[]}}function je(t){if(typeof t!="object"||t===null)return!1;const e=t;if(!Number.isSafeInteger(e.id)||e.kind!=="WORKTREE_TEXT"&&e.kind!=="WORKTREE_PREVIEW"||typeof e.identity!="string"||typeof e.nodeId!="string"||typeof e.workspaceId!="string"||typeof e.path!="string"||typeof e.fileName!="string"||typeof e.url!="string")return!1;try{const a=new URL(e.url,location.href);return a.origin===location.origin&&a.pathname===location.pathname&&a.searchParams.get("standaloneFile")==="1"&&a.searchParams.get("markdownPreview")!=="1"}catch{return!1}}function pe(t){if(typeof t!="object"||t===null)return!1;const e=t;return typeof e.tabIdentity=="string"&&typeof e.path=="string"&&typeof e.content=="string"&&typeof e.expectedRevision=="string"}function ie(){!N&&!k.share?.embedded&&sessionStorage.setItem(q,JSON.stringify(I.value))}function Me(t){const e=I.value.find(a=>a.id===t);e===void 0||t===l.value||(se(),location.replace(e.url))}function Ve(t){const e=I.value.findIndex(i=>i.id===t);if(e<0)return;const a=I.value.filter(i=>i.id!==t),r=I.value[e];if(I.value=a,he(r.identity),ie(),a.length===0){le();return}if(t!==l.value)return;const d=a[Math.min(e,a.length-1)];d!==void 0&&location.replace(d.url)}function se(){const t=v.value?.captureDirtyDrafts().filter(pe)??[];if(t.length===0)return;const e=new Set(t.map(a=>a.tabIdentity));h.value=[...h.value.filter(a=>!e.has(a.tabIdentity)),...t],sessionStorage.setItem(z,JSON.stringify(h.value))}async function Be(t){const e=I.value.find(a=>a.id===t);if(e===void 0||!h.value.some(a=>a.tabIdentity===e.identity))return!0;try{return await st.confirm(Z("fileEditor.unsavedMessage"),Z("fileEditor.unsavedTitle"),{icon:lt("warning"),type:"warning"}),!0}catch{return!1}}function Ke(){I.value=[],h.value=[],ie(),sessionStorage.removeItem(z),le()}function he(t){h.value=h.value.filter(e=>e.tabIdentity!==t),sessionStorage.setItem(z,JSON.stringify(h.value))}$e(),tt(async()=>{N?de.mount():window.addEventListener("mar-before-standalone-navigation",se),window.addEventListener("online",Y),window.addEventListener("offline",Y);const t=n.get("nodeId"),e=n.get("workspaceId"),a=n.get("path");if(t===null||e===null||a===null){E.value="generated.standaloneFilePreviewPage.theFilePreviewURLIsInvalid";return}if(!$&&w===void 0&&(U=Wt({nodeId:t,workspaceId:e,activeDownloadWorker:_.activeWorker,...D})),F){R.value=!0,!$&&De(a)&&Object.keys(D).length===0?await ne.open({nodeId:t,workspaceId:e,path:a}):E.value="htmlPreview.unavailable",R.value=!1;return}await ye()});async function ye(t=!1){const e=n.get("nodeId"),a=n.get("workspaceId"),r=n.get("path");if(e===null||a===null||r===null)return;R.value=!0,E.value="",re=void 0,Q=!1,b.value!==void 0&&fe(b.value),b.value=void 0;const d=ve(r);if(o.value={path:r,encoding:d?"utf-8":"base64",content:"",truncated:!1,nextOffset:null},T.value=void 0,$){await qe(e,r);return}try{if(Nt(r)&&n.get("rawContent")==="1"){const s=t?void 0:await Ne(r,async()=>U?.objectUrl(r));if(s!==void 0){b.value=s.url,o.value={path:r,size:s.size,encoding:"base64",content:"",truncated:!1,nextOffset:null,revision:s.revision},T.value=s.url;return}const g=await Ie(e,a,r,0,!1,1);o.value={path:r,...g.size===void 0?{}:{size:g.size},encoding:"base64",content:"",truncated:!1,nextOffset:null},T.value=G(e,a,r);return}const i=await Fe(s=>Ie(e,a,r,0,!t,s));if(i.encoding==="base64"){if(b.value!==void 0&&fe(b.value),o.value={...i,content:"",truncated:!1,nextOffset:null},Ce(r,"base64")==="unsupported")return;const s=t?void 0:await Ne(r,async()=>U?.objectUrl(r));if(b.value=s?.url,s!==void 0){T.value=b.value;return}T.value=G(e,a,r)}else o.value={...i,truncated:i.nextOffset!==null,nextOffset:i.nextOffset}}catch{if(!t&&Q){await ye(!0);return}E.value="generated.standaloneFilePreviewPage.unableToReadTheFileCheckYour"}finally{R.value=!1}}async function qe(t,e){const a=n.get("conversationId"),r=n.get("fileId"),d=n.get("mimeType")??"";let i=Number(n.get("size"));if(a===null||n.get("workspaceId")!==a||r===null||!Number.isSafeInteger(i)||i<0){E.value="generated.standaloneFilePreviewPage.theFilePreviewURLIsInvalid",R.value=!1;return}const s=`/api/nodes/${encodeURIComponent(t)}/hosted-conversations/${encodeURIComponent(a)}/files/${encodeURIComponent(r)}/content`,g=ve(e,d);if(o.value={path:e,size:i,encoding:g?"utf-8":"base64",content:"",truncated:!1,nextOffset:null},!g){T.value=s,R.value=!1;return}try{if(i===0){const f=await fetch(s,{credentials:"same-origin",method:"HEAD"});if(!f.ok)throw new Error(`REQUEST_FAILED_${f.status}`);const c=f.headers.get("content-length");if(c===null||!Number.isSafeInteger(Number(c))||Number(c)<0)throw new Error("NODE_RESPONSE_INVALID");if(i=Number(c),i===0){o.value={path:e,size:i,encoding:"utf-8",content:"",truncated:!1,nextOffset:null};return}}o.value=await Fe(async f=>{const c=await fetch(s,{credentials:"same-origin",headers:{Range:`bytes=0-${f-1}`}});if(!c.ok)throw new Error(`REQUEST_FAILED_${c.status}`);const A=new Uint8Array(await c.arrayBuffer()),Ee=c.headers.get("content-range")?.match(/\/(\d+)$/u)?.[1],j=Ee===void 0?i:Number(Ee);if(!Number.isSafeInteger(j)||j<0)throw new Error("NODE_RESPONSE_INVALID");const ce=Le(A,e,A.byteLength>=j,d);return{path:e,size:j,...ce,truncated:ce.encoding==="utf-8"&&A.byteLength<j,nextOffset:ce.encoding==="utf-8"&&A.byteLength<j?A.byteLength:null}}),o.value.encoding==="base64"&&(T.value=s)}catch{E.value="generated.standaloneFilePreviewPage.unableToReadTheFileCheckYour"}finally{R.value=!1}}async function He(){const t=await fetch("/api/auth/csrf",{method:"POST",credentials:"same-origin",headers:{"content-type":"application/json"},body:"{}"});if(!t.ok)throw new Error("CSRF_INVALID");const e=await t.json();if(typeof e.csrfToken!="string")throw new Error("CSRF_TOKEN_INVALID");return ge.value=e.csrfToken,sessionStorage.setItem("mar.user.csrf-token",e.csrfToken),e.csrfToken}async function Je(t,e){const a=n.get("nodeId"),r=n.get("workspaceId"),d=n.get("path");if(a===null||r===null||d===null||o.value?.previewEncoding!==void 0)throw new Error("FILE_WRITE_INVALID");const i=await me.request(`/api/workspaces/${encodeURIComponent(r)}/files/write`,{method:"PUT",body:JSON.stringify({nodeId:a,path:d,content:t,expectedRevision:e})});if(typeof i.file?.revision!="string"||typeof i.file.size!="number"||!Number.isSafeInteger(i.file.size)||i.file.size<0)throw new Error("NODE_RESPONSE_INVALID");return o.value!==void 0&&(o.value={...o.value,content:t,revision:i.file.revision,size:i.file.size}),i.file.revision}nt(()=>{ne.release(),N?de.dispose():window.removeEventListener("mar-before-standalone-navigation",se),window.removeEventListener("online",Y),window.removeEventListener("offline",Y),U?.close(),b.value!==void 0&&fe(b.value)});async function ke(){if(o.value!==void 0){H.value=!0;try{const t=n.get("nodeId"),e=n.get("workspaceId"),a=n.get("path");if(t===null||e===null||a===null)return;if($){const i=n.get("conversationId"),s=n.get("fileId");if(i===null||s===null)return;const g=document.createElement("a");g.href=`/api/nodes/${encodeURIComponent(t)}/hosted-conversations/${encodeURIComponent(i)}/files/${encodeURIComponent(s)}/content?download=1`,g.download=a.split("/").at(-1)??"download",g.click();return}if(b.value?.startsWith("blob:")){Et(b.value,a.split("/").at(-1)??"download");return}const r=await U?.download(a);if(r!==void 0&&r!=="UNAVAILABLE")return;const d=document.createElement("a");d.href=G(t,e,a,!0),d.download=o.value.path.split("/").at(-1)??"download",d.click()}finally{H.value=!1}}}function Y(){U?.networkChanged()}async function Ie(t,e,a,r,d=!0,i=512*1024){const s=d?await U?.readRange(a,r,i,re):void 0;if(s!==void 0){Q=!0,re={revision:s.revision,size:s.size};const c=await gt(s),A=Le(s.bytes,a,s.nextOffset===null);return{path:a,size:s.size,...A,truncated:s.nextOffset!==null,nextOffset:s.nextOffset,...c===void 0?{}:{revision:c}}}if(d&&Q)throw new Error("DIRECT_FILE_READ_FAILED");const g=new URLSearchParams({nodeId:t,path:a,offset:String(r),limit:String(i),...D});let f;if(y!==void 0)f=await y.request(`/api/workspaces/${encodeURIComponent(e)}/files/read?${g.toString()}`);else{const c=await fetch(`/api/workspaces/${encodeURIComponent(e)}/files/read?${g.toString()}`,{credentials:"same-origin"});if(!c.ok)throw new Error(`REQUEST_FAILED_${c.status}`);f=await c.json()}if(f.file===void 0||f.file.encoding!=="utf-8"&&f.file.encoding!=="base64"||f.file.nextOffset!==null&&!Number.isSafeInteger(f.file.nextOffset))throw new Error("NODE_RESPONSE_INVALID");return mt(f.file,a)}function Qe(t){return t.replace(/[&<>]/g,e=>e==="&"?"&amp;":e==="<"?"&lt;":"&gt;")}function le(){if(k.share?.embedded){L("close");return}window.close()}function be(){return le(),!0}const de=pt({isOpen:()=>N,closeWindow:be,closeTab:be});function Ye(t){de.bindFrame(t)}function Pe(t){const e=n.get("nodeId"),a=n.get("workspaceId");return e===null||a===null?"":G(e,a,t)}function Se(t){const e=n.get("nodeId"),a=n.get("workspaceId");if(e===null||a===null)return;const r=new URLSearchParams({standaloneFile:"1",...we(t)?{markdownPreview:"1"}:{rawContent:"1"},nodeId:e,workspaceId:a,path:t}),d=`${w===void 0?"/console":"/share/"+encodeURIComponent(w.session.value.share.id)}?${r.toString()}`;w!==void 0?W.open(d):location.assign(d)}function Ge(t){const e=n.get("nodeId"),a=n.get("workspaceId");if(e===null||a===null)return;const r=new URLSearchParams({standaloneFile:"1",htmlPreview:"1",nodeId:e,workspaceId:a,path:t});W.open(`${w===void 0?"/console":"/share/"+encodeURIComponent(w.session.value.share.id)}?${r.toString()}`)===void 0&&(E.value="htmlPreview.unavailable")}function G(t,e,a,r=!1){const d=new URLSearchParams({nodeId:t,path:a,...r?{download:"1"}:{},...D}),i=`/api/workspaces/${encodeURIComponent(e)}/files/content?${d.toString()}`;return y?.resourceUrl(i)??i}return(t,e)=>{const a=at("tooltip");return m(),S(ue,null,[u(V)?(m(),B(ot,{key:0,to:"head"},[X("link",{rel:"stylesheet",href:u(At)},null,8,$t)])):x("",!0),u(N)?(m(),S("main",{key:1,ref_key:"standaloneRoot",ref:C,class:"standalone-file-preview"},[J.value?(m(),S("p",zt,M(J.value),1)):u(F)?(m(),S(ue,{key:1},[X("header",jt,[Te((m(),S("code",null,[Re(M(u(n).get("path")),1)])),[[a,u(n).get("path")??""]]),u(O).url?(m(),S("small",Mt,M(u(Z)(Ue.value?"htmlPreview.trustedWarning":"htmlPreview.isolatedWarning")),1)):x("",!0)]),_e(ht,{url:u(O).url,loading:R.value||u(O).loading,title:u(n).get("path")??"",onLoad:Ye},null,8,["url","loading","title"])],64)):u(V)?(m(),S(ue,{key:2},[X("header",Vt,[Te((m(),S("code",null,[Re(M(u(n).get("path")??o.value?.path),1)])),[[a,u(n).get("path")??o.value?.path??""]]),o.value?.size!==void 0?(m(),S("small",Bt,M(u(Ut)(o.value.size??0)),1)):x("",!0)]),X("div",Kt,[R.value?(m(),B(Ft,{key:0,variant:"page",overlay:""})):o.value&&u(we)(o.value.path)?(m(),S("main",qt,[_e(Ct,{content:o.value.content,path:o.value.path,"resource-url":Pe,"standard-style":"",onOpenFile:Se},null,8,["content","path"]),u(ae).watermarkEnabled&&u(ae).watermarkText?(m(),S("div",{key:0,class:"markdown-watermark",style:rt(Ae.value),"aria-hidden":"true"},null,4)):x("",!0)])):x("",!0)])],64)):x("",!0)],512)):(m(),B(It,{key:2,ref_key:"standaloneFileTabs",ref:v,presentation:k.share?.embedded?"overlay":"window",tabs:I.value,"active-tab-id":l.value,"can-close-unmounted-tab":Be,onActivate:Me,onClose:Ve,onCloseAll:Ke},{default:it(({tab:r,active:d,registerPageHandle:i,requestClose:s,requestCloseAll:g})=>[d&&J.value?(m(),S("p",Ht,M(J.value),1)):d&&o.value&&oe.value==="text"?(m(),B(yt,{key:1,"quote-target":k.quoteTarget,ref:i,active:d,file:o.value,kind:oe.value,loading:R.value,downloading:H.value,"target-line":u(xe),"target-column":u(We),"write-enabled":u(Oe),html:u(De)(o.value.path)&&Object.keys(D).length===0,markdown:!u(n).has("repositoryPath")&&u(we)(o.value.path),"markdown-resource-url":Pe,"save-file":Je,"tab-identity":r.identity,"initial-dirty-draft":h.value.find(f=>f.tabIdentity===r.identity&&f.path===r.path),onClose:s,onQuoted:g,onDownload:ke,onOpenHtmlPreview:e[0]||(e[0]=f=>Ge(o.value.path)),onOpenMarkdownPreview:e[1]||(e[1]=f=>Se(o.value.path)),onDirtyDraftApplied:he},null,8,["quote-target","active","file","kind","loading","downloading","target-line","target-column","write-enabled","html","markdown","tab-identity","initial-dirty-draft","onClose","onQuoted"])):d&&o.value?(m(),B(kt,{key:2,ref:i,active:d,file:o.value,"content-url":T.value,kind:oe.value,loading:R.value,downloading:H.value,onClose:s,onDownload:ke},null,8,["active","file","content-url","kind","loading","downloading","onClose"])):x("",!0)]),_:1},8,["presentation","tabs","active-tab-id"]))],64)}}}),un=dt(Jt,[["__scopeId","data-v-618c2c49"]]);export{un as default};
@@ -1 +1 @@
1
- import i from"./SystemConfigurationPage-DvLS7Zwy.js";import{m as r,o as n,C as o}from"./index-B4CXrXhI.js";import"./MarAlert-DSmQryuu.js";import"./MarInputNumber-Cgd2zn2w.js";import"./MarTableColumn.vue_vue_type_script_setup_true_lang-Du6vjSSf.js";import"./MarFormItem.vue_vue_type_script_setup_true_lang-Cb0xjbkz.js";import"./MarOptionGroup.vue_vue_type_style_index_0_scoped_0cdd846e_lang-Bnk1CfAu.js";import"./MarSwitch-BARfoj2O.js";import"./mobile-dialog-return-service-Cvt9WsqK.js";import"./conversation-history-5Whey-Nw.js";import"./error-presentation-Bsw9jRIX.js";const P=r({__name:"SystemConfigurationPage",props:{request:{type:Function},writable:{type:Boolean}},setup(e){const t=[{key:"audit-retention",field:"auditRetentionDays",payloadField:"days",initialValue:180,nameKey:"generated.systemConfigurationPage.auditRetentionDays",descriptionKey:"generated.systemConfigurationPage.theServerRemovesExpiredEventsInBatches",type:"number",min:1,max:3650,placeholderKey:"generated.systemConfigurationPage.enterRetentionDays"}];return(a,s)=>(n(),o(i,{request:e.request,writable:e.writable,settings:t},null,8,["request","writable"]))}});export{P as default};
1
+ import i from"./SystemConfigurationPage-KRcK6uZr.js";import{m as r,o as n,C as o}from"./index-BAF_vQZ-.js";import"./MarAlert-BRDdHNjI.js";import"./MarInputNumber-BrdLKVcG.js";import"./MarTableColumn.vue_vue_type_script_setup_true_lang-Cl79Jlsp.js";import"./MarFormItem.vue_vue_type_script_setup_true_lang-C5687WPW.js";import"./MarOptionGroup.vue_vue_type_style_index_0_scoped_0cdd846e_lang-C5U0ej6_.js";import"./MarSwitch-D7P0NJJ8.js";import"./mobile-dialog-return-service-G00_zLGC.js";import"./conversation-history-BmbSoNKL.js";import"./error-presentation-C9lF2Dka.js";const P=r({__name:"SystemConfigurationPage",props:{request:{type:Function},writable:{type:Boolean}},setup(e){const t=[{key:"audit-retention",field:"auditRetentionDays",payloadField:"days",initialValue:180,nameKey:"generated.systemConfigurationPage.auditRetentionDays",descriptionKey:"generated.systemConfigurationPage.theServerRemovesExpiredEventsInBatches",type:"number",min:1,max:3650,placeholderKey:"generated.systemConfigurationPage.enterRetentionDays"}];return(a,s)=>(n(),o(i,{request:e.request,writable:e.writable,settings:t},null,8,["request","writable"]))}});export{P as default};
@@ -1 +1 @@
1
- import{f as C,m as de,t as a,o as f,n as T,a6 as Z,q as o,D as r,S,Q as p,E as e,F as $,T as U,C as D,V as W,N as Q,P,a7 as ie,a2 as fe,O as X,G as R,R as j,k as z,W as A,_ as me,w as ce,K as ye,a5 as se,l as ve,X as be}from"./index-B4CXrXhI.js";import{M as Ce}from"./MarAlert-DSmQryuu.js";import{M as re}from"./MarInputNumber-Cgd2zn2w.js";import{_ as H,M as he}from"./MarTableColumn.vue_vue_type_script_setup_true_lang-Du6vjSSf.js";import{_ as E,a as Y}from"./MarFormItem.vue_vue_type_script_setup_true_lang-Cb0xjbkz.js";import{M as ge,a as ee}from"./MarOptionGroup.vue_vue_type_style_index_0_scoped_0cdd846e_lang-Bnk1CfAu.js";import{M as ue}from"./MarSwitch-BARfoj2O.js";import{u as ae,m as te}from"./mobile-dialog-return-service-Cvt9WsqK.js";import"./conversation-history-5Whey-Nw.js";import{e as G}from"./error-presentation-Bsw9jRIX.js";const Pe={key:"skill-tls",field:"skillTlsVerificationDisabled",payloadField:"verificationDisabled",nameKey:"generated.systemConfigurationPage.disableSkillSourceTLSVerification",descriptionKey:"generated.systemConfigurationPage.keepThisOffByDefaultUseIt",type:"boolean",initialValue:!1},_e={key:"html-preview-origin",field:"htmlPreviewOrigin",payloadField:"origin",nameKey:"generated.systemConfigurationPage.htmlPreviewOrigin",descriptionKey:"generated.systemConfigurationPage.htmlPreviewOriginDescription",placeholderKey:"generated.systemConfigurationPage.htmlPreviewOriginPlaceholder",type:"origin",initialValue:""},we={key:"mail-smtp",field:"smtpConfiguration",payloadField:"config",nameKey:"generated.systemConfigurationPage.smtp",descriptionKey:"generated.systemConfigurationPage.smtpDescription",placeholderKey:"generated.systemConfigurationPage.smtpPlaceholder",type:"json",initialValue:"{}"},Ve={key:"web-push",field:"webPushEnabled",payloadField:"enabled",nameKey:"workbenchNotificationCenter.webPushConfiguration.title",descriptionKey:"workbenchNotificationCenter.webPushConfiguration.description",type:"boolean",initialValue:!1};function ke(k,M=[]){const u=[...M,{key:"mar-agent-resource-input",field:"useResourceUrl",payloadField:"useResourceUrl",nameKey:"marAgentModels.useResourceUrl",descriptionKey:"marAgentModels.globalResourceUrlDescription",type:"boolean",initialValue:!0},we,Ve,_e,Pe],_=new Map(u.map(i=>[i.key,i]));if(_.size!==u.length)throw new Error("WEB_SYSTEM_SETTING_DUPLICATE");const w=C(Object.fromEntries(u.map(i=>[i.field,i.initialValue]))),c=C({...w.value}),g=C(null),V=C(null),y=C(!1);function d(i){w.value=i,c.value={...i}}async function x(){if(!(y.value||V.value!==null)){y.value=!0;try{d(await k("/api/system-settings")),g.value=null}finally{y.value=!1}}}function I(i){!_.has(i)||y.value||V.value!==null||g.value!==null||(c.value={...w.value},g.value=i)}function K(i){g.value!==i||V.value!==null||(c.value={...w.value},g.value=null)}function N(i,n){if(i.type==="json"){if(typeof n!="string"||n.length>4096)return!1;try{const v=JSON.parse(n);return v!==null&&typeof v=="object"&&!Array.isArray(v)}catch{return!1}}if(i.type==="origin"){if(n==="")return!0;if(typeof n!="string"||n.length>253)return!1;try{const v=new URL(n);return v.origin===n&&(v.protocol==="https:"||v.protocol==="http:")}catch{return!1}}return i.type==="boolean"?typeof n=="boolean":typeof n=="number"&&Number.isFinite(n)&&n>=i.min&&n<=i.max}function O(i,n){const v=_.get(i);v===void 0||g.value!==i||V.value!==null||!(v.type==="origin"||v.type==="json"?typeof n=="string"&&n.length<=(v.type==="json"?4096:253):N(v,n))||(c.value[v.field]=n)}async function F(i){const n=_.get(i);if(n===void 0||g.value!==i||V.value!==null||y.value)return!1;const v=c.value[n.field];if(!N(n,v))return!1;V.value=i;try{return d(await k(`/api/system-settings/${encodeURIComponent(i)}`,{method:"PATCH",body:JSON.stringify({[n.payloadField]:v})})),g.value=null,!0}finally{V.value=null}}return{settings:u,snapshot:w,drafts:c,editingKey:g,savingKey:V,loading:y,load:x,beginEdit:I,cancelEdit:K,validValue:N,setDraft:O,save:F}}function Te(k){const M=C([]),u=C(!1),_=C(!1);async function w(){if(!u.value){u.value=!0;try{M.value=await k("/api/mail/templates")}finally{u.value=!1}}}async function c(V,y){return k("/api/mail/templates/preview",{method:"POST",body:JSON.stringify({templateId:V.id,message:y})})}async function g(V,y){_.value=!0;try{await k("/api/mail/test",{method:"POST",body:JSON.stringify({email:V,templateId:y})})}finally{_.value=!1}}return{templates:M,loading:u,busy:_,load:w,preview:c,test:g}}const Se={class:"template-viewer"},Me={class:"template-description"},Ue={key:0,class:"template-layout"},xe=["aria-label"],Ee=["aria-pressed","onClick"],$e={class:"template-choice__meta"},De={class:"template-choice__name"},Ie={class:"template-choice__subject"},Ke={key:0,class:"template-preview"},Ne={class:"template-preview__header"},Oe={class:"template-preview__locale"},Fe=["srcdoc","title"],Be={key:1,class:"template-preview__fallback"},Ae={key:1,class:"template-empty"},je=de({__name:"MailTemplateManagement",props:{request:{type:Function},writable:{type:Boolean}},setup(k){const M=k,u=Te(M.request),_=C(!1),w=C(""),c=z(()=>u.templates.value.find(b=>b.id===w.value)),g=C(),V=C(!1);let y=0;const d=C(!1),x=C(),I=C(""),K=C(""),N=z(()=>u.templates.value.filter(b=>b.kind==="TEST")),O=z(()=>({email:I.value,templateId:K.value})),F={email:[{required:!0,pattern:/^[^\s@]+@[^\s@]+\.[^\s@]+$/u,message:a("generated.systemConfigurationPage.mailAddressInvalid"),trigger:"blur"}],templateId:[{required:!0,trigger:"change"}]};function i(b){return b instanceof Error?G(b):a("generated.systemConfigurationPage.mailOperationFailed")}async function n(){_.value=!0,y+=1,w.value="",g.value=void 0;try{await u.load(),w.value=u.templates.value[0]?.id??"",w.value!==""&&await q()}catch(b){A(i(b),"error",b)}}function v(b){w.value=b.id,g.value=void 0,q()}async function q(){const b=c.value;if(b===void 0||!_.value)return;const h=++y;V.value=!0;try{const m=await u.preview(b,a("generated.systemConfigurationPage.mailPreviewMessage"));_.value&&h===y&&w.value===b.id&&(g.value=m)}catch(m){h===y&&A(i(m),"error",m)}finally{h===y&&(V.value=!1)}}function J(){I.value="",K.value=(c.value?.kind==="TEST"?c.value.id:N.value[0]?.id)??"",d.value=!0}async function L(){if(M.writable)try{await x.value?.validate(),await u.test(I.value,K.value),d.value=!1,A(a("generated.systemConfigurationPage.mailTestAccepted"),"success")}catch(b){b instanceof Error&&A(i(b),"error",b)}}return(b,h)=>(f(),T(Z,null,[o(e(U),{icon:e($)("mail"),onClick:n},{default:r(()=>[S(p(e(a)("generated.systemConfigurationPage.mailTemplateView")),1)]),_:1},8,["icon"]),_.value?(f(),D(e(W),{key:0,onVnodeMounted:e(te),onVnodeBeforeUnmount:e(ae),modelValue:_.value,"onUpdate:modelValue":h[1]||(h[1]=m=>_.value=m),"append-to-body":"",title:e(a)("generated.systemConfigurationPage.mailTemplates"),width:"min(780px, calc(100vw - 32px))"},{footer:r(()=>[o(e(U),{disabled:!k.writable||N.value.length===0||e(u).busy.value,onClick:J},{default:r(()=>[S(p(e(a)("generated.systemConfigurationPage.mailTest")),1)]),_:1},8,["disabled"]),o(e(U),{onClick:h[0]||(h[0]=m=>_.value=!1)},{default:r(()=>[S(p(e(a)("common.close")),1)]),_:1})]),default:r(()=>[Q((f(),T("div",Se,[P("p",Me,p(e(a)("generated.systemConfigurationPage.mailTemplateBuiltIn")),1),e(u).templates.value.length>0?(f(),T("div",Ue,[P("div",{class:"template-choices",role:"group","aria-label":e(a)("generated.systemConfigurationPage.mailTemplates")},[(f(!0),T(Z,null,ie(e(u).templates.value,m=>(f(),T("button",{key:m.id,type:"button",class:fe(["template-choice",{"is-selected":w.value===m.id}]),"aria-pressed":w.value===m.id,onClick:le=>v(m)},[P("span",$e,[S(p(e(a)(m.kind==="TEST"?"generated.systemConfigurationPage.mailKindTest":"generated.systemConfigurationPage.mailKindNotification"))+" ",1),h[6]||(h[6]=P("span",{"aria-hidden":"true"},"·",-1)),S(" "+p(m.locale),1)]),P("span",De,p(m.name),1),P("span",Ie,p(m.subject),1)],10,Ee))),128))],8,xe),c.value?Q((f(),T("div",Ke,[P("div",Ne,[P("span",null,p(e(a)("generated.systemConfigurationPage.mailPreviewSample")),1),P("span",Oe,p(c.value.locale),1)]),g.value?.html?(f(),T("iframe",{key:0,class:"template-preview__document",srcdoc:g.value.html,sandbox:"",referrerpolicy:"no-referrer",title:e(a)("generated.systemConfigurationPage.mailPreviewSample")},null,8,Fe)):(f(),T("div",Be,[P("span",null,p(e(a)("generated.systemConfigurationPage.mailSubject")),1),P("strong",null,p(g.value?.subject??c.value.subject),1),P("span",null,p(e(a)("generated.systemConfigurationPage.mailBody")),1),P("p",null,p(g.value?.text??c.value.body),1)]))])),[[e(X),V.value,"region"]]):R("",!0)])):e(u).loading.value?R("",!0):(f(),T("p",Ae,p(e(a)("generated.systemConfigurationPage.mailTemplateEmpty")),1))])),[[e(X),e(u).loading.value,"region"]])]),_:1},8,["onVnodeMounted","onVnodeBeforeUnmount","modelValue","title"])):R("",!0),d.value?(f(),D(e(W),{key:1,onVnodeMounted:e(te),onVnodeBeforeUnmount:e(ae),modelValue:d.value,"onUpdate:modelValue":h[5]||(h[5]=m=>d.value=m),"append-to-body":"",title:e(a)("generated.systemConfigurationPage.mailTest"),width:"min(480px, calc(100vw - 32px))"},{footer:r(()=>[o(e(U),{onClick:h[4]||(h[4]=m=>d.value=!1)},{default:r(()=>[S(p(e(a)("common.cancel")),1)]),_:1}),o(e(U),{type:"primary",loading:e(u).busy.value,onClick:L},{default:r(()=>[S(p(e(a)("generated.systemConfigurationPage.mailTestSend")),1)]),_:1},8,["loading"])]),default:r(()=>[o(e(Y),{ref_key:"testForm",ref:x,model:O.value,rules:F,"label-position":"top"},{default:r(()=>[o(e(E),{label:e(a)("generated.systemConfigurationPage.mailAddress"),prop:"email"},{default:r(()=>[o(e(j),{modelValue:I.value,"onUpdate:modelValue":h[2]||(h[2]=m=>I.value=m),type:"email"},null,8,["modelValue"])]),_:1},8,["label"]),o(e(E),{label:e(a)("generated.systemConfigurationPage.mailTemplate"),prop:"templateId"},{default:r(()=>[o(e(ge),{modelValue:K.value,"onUpdate:modelValue":h[3]||(h[3]=m=>K.value=m),class:"template-test-select","clear-icon":e($)("clear-input"),"suffix-icon":e($)("chevron-down")},{default:r(()=>[(f(!0),T(Z,null,ie(N.value,m=>(f(),D(e(ee),{key:m.id,value:m.id,label:m.name},null,8,["value","label"]))),128))]),_:1},8,["modelValue","clear-icon","suffix-icon"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["onVnodeMounted","onVnodeBeforeUnmount","modelValue","title"])):R("",!0)],64))}}),Re=me(je,[["__scopeId","data-v-f6468a3d"]]),qe={class:"mar-management-page"},Le={class:"mar-table-actions"},ze={key:1},Je={key:3},He={key:4},Ze={class:"smtp-toggle"},Ge={class:"smtp-form__pair"},We={class:"smtp-template-row"},Qe={class:"smtp-dialog-hint"},Xe={class:"smtp-dialog-footer"},Ye=de({__name:"SystemConfigurationPage",props:{request:{type:Function},writable:{type:Boolean},settings:{}},setup(k){const M=k,u=ke(M.request,M.settings),_=C(),w=C(),c=C(""),g=C(!1),V=u.settings.find(s=>s.key==="mail-smtp"),y=C(!1),d=ve({host:"",port:587,tls:"STARTTLS",from:"",fromName:"",username:"",password:""});let x="";const I={host:[{required:!0,pattern:/^[A-Za-z0-9](?:[A-Za-z0-9.-]{0,251}[A-Za-z0-9])?$/u,message:a("generated.systemConfigurationPage.smtpHostInvalid"),trigger:"blur"}],port:[{type:"integer",min:1,max:65535,required:!0,message:a("generated.systemConfigurationPage.smtpPortInvalid"),trigger:"change"}],tls:[{required:!0,trigger:"change"}],from:[{required:!0,pattern:/^[^\s@]+@[^\s@]+\.[^\s@]+$/u,message:a("generated.systemConfigurationPage.smtpFromInvalid"),trigger:"blur"}],fromName:[{max:128,pattern:/^[^\r\n]*$/u,message:a("generated.systemConfigurationPage.smtpFromNameInvalid"),trigger:"blur"}],username:[{max:320,pattern:/^[^\r\n]*$/u,message:a("generated.systemConfigurationPage.smtpUsernameInvalid"),trigger:"blur"}],password:[{validator:(s,l,t)=>t(typeof l=="string"&&l.length<=1024&&(d.username===""?l==="":l!==""||d.username===x)?void 0:new Error(a("generated.systemConfigurationPage.smtpPasswordInvalid"))),trigger:"blur"}]},K=u.settings.find(s=>s.key==="html-preview-origin"),N={origin:[{validator:(s,l,t)=>t(u.validValue(K,l)?void 0:new Error(a("generated.systemConfigurationPage.htmlPreviewOriginInvalid"))),trigger:"change"}]},{snapshot:O,drafts:F,editingKey:i,savingKey:n,loading:v,beginEdit:q,cancelEdit:J}=u,L=C(!1),b=z(()=>({origin:F.value.htmlPreviewOrigin})),h=z(()=>u.settings.map(s=>({...s,name:a(s.nameKey),description:a(s.descriptionKey)})));ce(g,s=>{c.value="",s||(d.password="",x="",J("mail-smtp"))});function m(s){const l=F.value[s];return typeof l=="number"?l:void 0}function le(s){const l=F.value[s];return typeof l=="string"?l:""}function pe(){if(!M.writable||(q("mail-smtp"),i.value!=="mail-smtp"))return;const s=JSON.parse(String(O.value.smtpConfiguration));y.value=Object.keys(s).length>0,Object.assign(d,{host:s.host??"",port:s.port??587,tls:s.tls??"STARTTLS",from:s.from??"",fromName:s.fromName??"",username:s.username??"",password:""}),x=s.username??"",g.value=i.value==="mail-smtp"}async function ne(){try{await u.load(),L.value=!0}catch(s){A(s instanceof Error?G(s):a("generated.systemConfigurationPage.unableToLoadSystemConfiguration"),"error",s)}}async function oe(s){if(M.writable){if(c.value="",s==="html-preview-origin")try{await _.value?.validate()}catch{return}if(s==="mail-smtp")if(y.value){try{await w.value?.validate()}catch{return}const l=JSON.stringify({...d});if(!u.validValue(V,l)){c.value=a("generated.systemConfigurationPage.smtpInvalid");return}u.setDraft(s,l)}else{if(O.value.smtpConfiguration!=="{}")try{await be.confirm(a("generated.systemConfigurationPage.smtpDisableConfirmation"),a("generated.systemConfigurationPage.smtpDisableTitle"),{icon:$("warning"),type:"warning",confirmButtonText:a("generated.systemConfigurationPage.smtpDisableTitle"),cancelButtonText:a("common.cancel")})}catch(l){if(l==="cancel"||l==="close")return;A(l instanceof Error?G(l):a("generated.systemConfigurationPage.unableToSaveSystemConfiguration"),"error",l);return}if(!g.value||i.value!==s)return;u.setDraft(s,"{}")}try{await u.save(s)&&(s==="mail-smtp"&&(g.value=!1),A(a("generated.systemConfigurationPage.systemConfigurationSaved"),"success"))}catch(l){A(l instanceof Error?G(l):a("generated.systemConfigurationPage.unableToSaveSystemConfiguration"),"error",l)}}}return ye(()=>{ne()}),(s,l)=>Q((f(),T("section",qe,[P("div",Le,[o(e(U),{icon:e($)("refresh"),loading:e(v)&&L.value,onClick:ne},{default:r(()=>[S(p(e(a)("generated.systemConfigurationPage.refresh")),1)]),_:1},8,["icon","loading"])]),o(e(he),{data:h.value,"row-key":"key"},{default:r(()=>[o(e(H),{prop:"name",label:e(a)("generated.systemConfigurationPage.setting"),"min-width":"180"},null,8,["label"]),o(e(H),{prop:"description",label:e(a)("generated.systemConfigurationPage.description"),"min-width":"320"},null,8,["label"]),o(e(H),{label:e(a)("generated.systemConfigurationPage.value"),"min-width":"180"},{default:r(({row:t})=>[t.type==="number"&&e(i)===t.key?(f(),D(e(re),{key:0,"model-value":m(t.field),placeholder:t.placeholderKey===void 0?void 0:e(a)(t.placeholderKey),min:t.min,max:t.max,disabled:e(n)!==null,"onUpdate:modelValue":B=>e(u).setDraft(t.key,B)},{"decrease-icon":r(()=>[o(se,{name:"subtract"})]),"increase-icon":r(()=>[o(se,{name:"plus"})]),_:1},8,["model-value","placeholder","min","max","disabled","onUpdate:modelValue"])):t.type==="number"?(f(),T("span",ze,p(e(O)[t.field]),1)):t.type==="origin"&&e(i)===t.key?(f(),D(e(Y),{key:2,ref_key:"originForm",ref:_,model:b.value,rules:N},{default:r(()=>[o(e(E),{prop:"origin",class:"origin-setting-form"},{default:r(()=>[o(e(j),{"model-value":le(t.field),placeholder:e(a)(t.placeholderKey),disabled:e(n)!==null,"onUpdate:modelValue":B=>e(u).setDraft(t.key,B)},null,8,["model-value","placeholder","disabled","onUpdate:modelValue"])]),_:2},1024)]),_:2},1032,["model"])):t.type==="origin"?(f(),T("span",Je,p(e(O)[t.field]||e(a)("generated.systemConfigurationPage.htmlPreviewCurrentOrigin")),1)):t.type==="json"?(f(),T("span",He,"-")):(f(),D(e(ue),{key:5,"model-value":e(F)[t.field]===!0,disabled:e(i)!==t.key||!k.writable||e(n)!==null,"onUpdate:modelValue":B=>e(u).setDraft(t.key,B)},null,8,["model-value","disabled","onUpdate:modelValue"]))]),_:1},8,["label"]),o(e(H),{label:e(a)("generated.systemConfigurationPage.actions"),"min-width":"220"},{default:r(({row:t})=>[e(i)!==t.key||t.type==="json"?(f(),D(e(U),{key:0,link:"",icon:e($)("edit"),disabled:!k.writable||e(i)!==null,onClick:B=>t.type==="json"?pe():e(q)(t.key)},{default:r(()=>[S(p(e(a)("generated.systemConfigurationPage.edit")),1)]),_:1},8,["icon","disabled","onClick"])):(f(),T(Z,{key:1},[o(e(U),{link:"",type:"primary",icon:e($)("check"),loading:e(n)===t.key,disabled:!k.writable||e(n)!==null,onClick:B=>oe(t.key)},{default:r(()=>[S(p(e(a)("generated.systemConfigurationPage.save")),1)]),_:1},8,["icon","loading","disabled","onClick"]),o(e(U),{link:"",icon:e($)("close"),disabled:e(n)!==null,onClick:B=>e(J)(t.key)},{default:r(()=>[S(p(e(a)("common.cancel")),1)]),_:1},8,["icon","disabled","onClick"])],64))]),_:1},8,["label"])]),_:1},8,["data"]),g.value?(f(),D(e(W),{key:0,onVnodeMounted:e(te),onVnodeBeforeUnmount:e(ae),modelValue:g.value,"onUpdate:modelValue":l[10]||(l[10]=t=>g.value=t),title:e(a)("generated.systemConfigurationPage.smtp"),width:"min(620px, calc(100vw - 32px))","close-on-click-modal":e(n)===null,"close-on-press-escape":e(n)===null,"show-close":e(n)===null,"append-to-body":""},{footer:r(()=>[P("div",Xe,[o(e(U),{disabled:e(n)!==null,onClick:l[8]||(l[8]=t=>g.value=!1)},{default:r(()=>[S(p(e(a)("common.cancel")),1)]),_:1},8,["disabled"]),o(e(U),{type:"primary",loading:e(n)==="mail-smtp",onClick:l[9]||(l[9]=t=>oe("mail-smtp"))},{default:r(()=>[S(p(e(a)("generated.systemConfigurationPage.save")),1)]),_:1},8,["loading"])])]),default:r(()=>[P("div",Ze,[P("span",null,p(e(a)("generated.systemConfigurationPage.smtpEnable")),1),o(e(ue),{modelValue:y.value,"onUpdate:modelValue":l[0]||(l[0]=t=>y.value=t),disabled:e(n)!==null,"aria-label":e(a)("generated.systemConfigurationPage.smtpEnable")},null,8,["modelValue","disabled","aria-label"])]),y.value?(f(),D(e(Y),{key:0,ref_key:"smtpForm",ref:w,model:d,rules:I,"label-position":"top",class:"smtp-form"},{default:r(()=>[c.value?(f(),D(e(Ce),{key:0,title:c.value,type:"error",closable:!1},null,8,["title"])):R("",!0),o(e(E),{label:e(a)("generated.systemConfigurationPage.smtpHost"),prop:"host"},{default:r(()=>[o(e(j),{modelValue:d.host,"onUpdate:modelValue":l[1]||(l[1]=t=>d.host=t),maxlength:"253",autocomplete:"off",disabled:e(n)!==null},null,8,["modelValue","disabled"])]),_:1},8,["label"]),P("div",Ge,[o(e(E),{label:e(a)("generated.systemConfigurationPage.smtpPort"),prop:"port"},{default:r(()=>[o(e(re),{modelValue:d.port,"onUpdate:modelValue":l[2]||(l[2]=t=>d.port=t),"aria-label":e(a)("generated.systemConfigurationPage.smtpPort"),min:1,max:65535,controls:!1,disabled:e(n)!==null},null,8,["modelValue","aria-label","disabled"])]),_:1},8,["label"]),o(e(E),{label:e(a)("generated.systemConfigurationPage.smtpTls"),prop:"tls"},{default:r(()=>[o(e(ge),{modelValue:d.tls,"onUpdate:modelValue":l[3]||(l[3]=t=>d.tls=t),disabled:e(n)!==null,"clear-icon":e($)("clear-input"),"suffix-icon":e($)("chevron-down")},{default:r(()=>[o(e(ee),{label:"STARTTLS",value:"STARTTLS"}),o(e(ee),{label:"TLS",value:"TLS"})]),_:1},8,["modelValue","disabled","clear-icon","suffix-icon"])]),_:1},8,["label"])]),o(e(E),{label:e(a)("generated.systemConfigurationPage.smtpFrom"),prop:"from"},{default:r(()=>[o(e(j),{modelValue:d.from,"onUpdate:modelValue":l[4]||(l[4]=t=>d.from=t),maxlength:"320",autocomplete:"off",disabled:e(n)!==null},null,8,["modelValue","disabled"])]),_:1},8,["label"]),o(e(E),{label:e(a)("generated.systemConfigurationPage.smtpFromName"),prop:"fromName"},{default:r(()=>[o(e(j),{modelValue:d.fromName,"onUpdate:modelValue":l[5]||(l[5]=t=>d.fromName=t),maxlength:"128",autocomplete:"off",disabled:e(n)!==null},null,8,["modelValue","disabled"])]),_:1},8,["label"]),o(e(E),{label:e(a)("generated.systemConfigurationPage.smtpUsername"),prop:"username"},{default:r(()=>[o(e(j),{modelValue:d.username,"onUpdate:modelValue":l[6]||(l[6]=t=>d.username=t),maxlength:"320",autocomplete:"off",disabled:e(n)!==null},null,8,["modelValue","disabled"])]),_:1},8,["label"]),o(e(E),{label:e(a)("generated.systemConfigurationPage.smtpPassword"),prop:"password"},{default:r(()=>[o(e(j),{modelValue:d.password,"onUpdate:modelValue":l[7]||(l[7]=t=>d.password=t),type:"password",maxlength:"1024",autocomplete:"new-password",placeholder:e(x)===d.username&&e(x)?e(a)("generated.systemConfigurationPage.smtpPasswordKeep"):void 0,disabled:e(n)!==null},null,8,["modelValue","placeholder","disabled"])]),_:1},8,["label"])]),_:1},8,["model"])):R("",!0),P("div",We,[o(Re,{request:k.request,writable:k.writable},null,8,["request","writable"])]),P("p",Qe,p(e(a)("generated.systemConfigurationPage.smtpDialogHint")),1)]),_:1},8,["onVnodeMounted","onVnodeBeforeUnmount","modelValue","title","close-on-click-modal","close-on-press-escape","show-close"])):R("",!0)])),[[e(X),e(v)&&!L.value,"page"]])}}),da=me(Ye,[["__scopeId","data-v-58c8d259"]]);export{da as default};
1
+ import{f as C,m as de,t as a,o as f,n as T,a6 as Z,q as o,D as r,S,Q as p,E as e,F as $,T as U,C as D,V as W,N as Q,P,a7 as ie,a2 as fe,O as X,G as R,R as j,k as z,W as A,_ as me,w as ce,K as ye,a5 as se,l as ve,X as be}from"./index-BAF_vQZ-.js";import{M as Ce}from"./MarAlert-BRDdHNjI.js";import{M as re}from"./MarInputNumber-BrdLKVcG.js";import{_ as H,M as he}from"./MarTableColumn.vue_vue_type_script_setup_true_lang-Cl79Jlsp.js";import{_ as E,a as Y}from"./MarFormItem.vue_vue_type_script_setup_true_lang-C5687WPW.js";import{M as ge,a as ee}from"./MarOptionGroup.vue_vue_type_style_index_0_scoped_0cdd846e_lang-C5U0ej6_.js";import{M as ue}from"./MarSwitch-D7P0NJJ8.js";import{u as ae,m as te}from"./mobile-dialog-return-service-G00_zLGC.js";import"./conversation-history-BmbSoNKL.js";import{e as G}from"./error-presentation-C9lF2Dka.js";const Pe={key:"skill-tls",field:"skillTlsVerificationDisabled",payloadField:"verificationDisabled",nameKey:"generated.systemConfigurationPage.disableSkillSourceTLSVerification",descriptionKey:"generated.systemConfigurationPage.keepThisOffByDefaultUseIt",type:"boolean",initialValue:!1},_e={key:"html-preview-origin",field:"htmlPreviewOrigin",payloadField:"origin",nameKey:"generated.systemConfigurationPage.htmlPreviewOrigin",descriptionKey:"generated.systemConfigurationPage.htmlPreviewOriginDescription",placeholderKey:"generated.systemConfigurationPage.htmlPreviewOriginPlaceholder",type:"origin",initialValue:""},we={key:"mail-smtp",field:"smtpConfiguration",payloadField:"config",nameKey:"generated.systemConfigurationPage.smtp",descriptionKey:"generated.systemConfigurationPage.smtpDescription",placeholderKey:"generated.systemConfigurationPage.smtpPlaceholder",type:"json",initialValue:"{}"},Ve={key:"web-push",field:"webPushEnabled",payloadField:"enabled",nameKey:"workbenchNotificationCenter.webPushConfiguration.title",descriptionKey:"workbenchNotificationCenter.webPushConfiguration.description",type:"boolean",initialValue:!1};function ke(k,M=[]){const u=[...M,{key:"mar-agent-resource-input",field:"useResourceUrl",payloadField:"useResourceUrl",nameKey:"marAgentModels.useResourceUrl",descriptionKey:"marAgentModels.globalResourceUrlDescription",type:"boolean",initialValue:!0},we,Ve,_e,Pe],_=new Map(u.map(i=>[i.key,i]));if(_.size!==u.length)throw new Error("WEB_SYSTEM_SETTING_DUPLICATE");const w=C(Object.fromEntries(u.map(i=>[i.field,i.initialValue]))),c=C({...w.value}),g=C(null),V=C(null),y=C(!1);function d(i){w.value=i,c.value={...i}}async function x(){if(!(y.value||V.value!==null)){y.value=!0;try{d(await k("/api/system-settings")),g.value=null}finally{y.value=!1}}}function I(i){!_.has(i)||y.value||V.value!==null||g.value!==null||(c.value={...w.value},g.value=i)}function K(i){g.value!==i||V.value!==null||(c.value={...w.value},g.value=null)}function N(i,n){if(i.type==="json"){if(typeof n!="string"||n.length>4096)return!1;try{const v=JSON.parse(n);return v!==null&&typeof v=="object"&&!Array.isArray(v)}catch{return!1}}if(i.type==="origin"){if(n==="")return!0;if(typeof n!="string"||n.length>253)return!1;try{const v=new URL(n);return v.origin===n&&(v.protocol==="https:"||v.protocol==="http:")}catch{return!1}}return i.type==="boolean"?typeof n=="boolean":typeof n=="number"&&Number.isFinite(n)&&n>=i.min&&n<=i.max}function O(i,n){const v=_.get(i);v===void 0||g.value!==i||V.value!==null||!(v.type==="origin"||v.type==="json"?typeof n=="string"&&n.length<=(v.type==="json"?4096:253):N(v,n))||(c.value[v.field]=n)}async function F(i){const n=_.get(i);if(n===void 0||g.value!==i||V.value!==null||y.value)return!1;const v=c.value[n.field];if(!N(n,v))return!1;V.value=i;try{return d(await k(`/api/system-settings/${encodeURIComponent(i)}`,{method:"PATCH",body:JSON.stringify({[n.payloadField]:v})})),g.value=null,!0}finally{V.value=null}}return{settings:u,snapshot:w,drafts:c,editingKey:g,savingKey:V,loading:y,load:x,beginEdit:I,cancelEdit:K,validValue:N,setDraft:O,save:F}}function Te(k){const M=C([]),u=C(!1),_=C(!1);async function w(){if(!u.value){u.value=!0;try{M.value=await k("/api/mail/templates")}finally{u.value=!1}}}async function c(V,y){return k("/api/mail/templates/preview",{method:"POST",body:JSON.stringify({templateId:V.id,message:y})})}async function g(V,y){_.value=!0;try{await k("/api/mail/test",{method:"POST",body:JSON.stringify({email:V,templateId:y})})}finally{_.value=!1}}return{templates:M,loading:u,busy:_,load:w,preview:c,test:g}}const Se={class:"template-viewer"},Me={class:"template-description"},Ue={key:0,class:"template-layout"},xe=["aria-label"],Ee=["aria-pressed","onClick"],$e={class:"template-choice__meta"},De={class:"template-choice__name"},Ie={class:"template-choice__subject"},Ke={key:0,class:"template-preview"},Ne={class:"template-preview__header"},Oe={class:"template-preview__locale"},Fe=["srcdoc","title"],Be={key:1,class:"template-preview__fallback"},Ae={key:1,class:"template-empty"},je=de({__name:"MailTemplateManagement",props:{request:{type:Function},writable:{type:Boolean}},setup(k){const M=k,u=Te(M.request),_=C(!1),w=C(""),c=z(()=>u.templates.value.find(b=>b.id===w.value)),g=C(),V=C(!1);let y=0;const d=C(!1),x=C(),I=C(""),K=C(""),N=z(()=>u.templates.value.filter(b=>b.kind==="TEST")),O=z(()=>({email:I.value,templateId:K.value})),F={email:[{required:!0,pattern:/^[^\s@]+@[^\s@]+\.[^\s@]+$/u,message:a("generated.systemConfigurationPage.mailAddressInvalid"),trigger:"blur"}],templateId:[{required:!0,trigger:"change"}]};function i(b){return b instanceof Error?G(b):a("generated.systemConfigurationPage.mailOperationFailed")}async function n(){_.value=!0,y+=1,w.value="",g.value=void 0;try{await u.load(),w.value=u.templates.value[0]?.id??"",w.value!==""&&await q()}catch(b){A(i(b),"error",b)}}function v(b){w.value=b.id,g.value=void 0,q()}async function q(){const b=c.value;if(b===void 0||!_.value)return;const h=++y;V.value=!0;try{const m=await u.preview(b,a("generated.systemConfigurationPage.mailPreviewMessage"));_.value&&h===y&&w.value===b.id&&(g.value=m)}catch(m){h===y&&A(i(m),"error",m)}finally{h===y&&(V.value=!1)}}function J(){I.value="",K.value=(c.value?.kind==="TEST"?c.value.id:N.value[0]?.id)??"",d.value=!0}async function L(){if(M.writable)try{await x.value?.validate(),await u.test(I.value,K.value),d.value=!1,A(a("generated.systemConfigurationPage.mailTestAccepted"),"success")}catch(b){b instanceof Error&&A(i(b),"error",b)}}return(b,h)=>(f(),T(Z,null,[o(e(U),{icon:e($)("mail"),onClick:n},{default:r(()=>[S(p(e(a)("generated.systemConfigurationPage.mailTemplateView")),1)]),_:1},8,["icon"]),_.value?(f(),D(e(W),{key:0,onVnodeMounted:e(te),onVnodeBeforeUnmount:e(ae),modelValue:_.value,"onUpdate:modelValue":h[1]||(h[1]=m=>_.value=m),"append-to-body":"",title:e(a)("generated.systemConfigurationPage.mailTemplates"),width:"min(780px, calc(100vw - 32px))"},{footer:r(()=>[o(e(U),{disabled:!k.writable||N.value.length===0||e(u).busy.value,onClick:J},{default:r(()=>[S(p(e(a)("generated.systemConfigurationPage.mailTest")),1)]),_:1},8,["disabled"]),o(e(U),{onClick:h[0]||(h[0]=m=>_.value=!1)},{default:r(()=>[S(p(e(a)("common.close")),1)]),_:1})]),default:r(()=>[Q((f(),T("div",Se,[P("p",Me,p(e(a)("generated.systemConfigurationPage.mailTemplateBuiltIn")),1),e(u).templates.value.length>0?(f(),T("div",Ue,[P("div",{class:"template-choices",role:"group","aria-label":e(a)("generated.systemConfigurationPage.mailTemplates")},[(f(!0),T(Z,null,ie(e(u).templates.value,m=>(f(),T("button",{key:m.id,type:"button",class:fe(["template-choice",{"is-selected":w.value===m.id}]),"aria-pressed":w.value===m.id,onClick:le=>v(m)},[P("span",$e,[S(p(e(a)(m.kind==="TEST"?"generated.systemConfigurationPage.mailKindTest":"generated.systemConfigurationPage.mailKindNotification"))+" ",1),h[6]||(h[6]=P("span",{"aria-hidden":"true"},"·",-1)),S(" "+p(m.locale),1)]),P("span",De,p(m.name),1),P("span",Ie,p(m.subject),1)],10,Ee))),128))],8,xe),c.value?Q((f(),T("div",Ke,[P("div",Ne,[P("span",null,p(e(a)("generated.systemConfigurationPage.mailPreviewSample")),1),P("span",Oe,p(c.value.locale),1)]),g.value?.html?(f(),T("iframe",{key:0,class:"template-preview__document",srcdoc:g.value.html,sandbox:"",referrerpolicy:"no-referrer",title:e(a)("generated.systemConfigurationPage.mailPreviewSample")},null,8,Fe)):(f(),T("div",Be,[P("span",null,p(e(a)("generated.systemConfigurationPage.mailSubject")),1),P("strong",null,p(g.value?.subject??c.value.subject),1),P("span",null,p(e(a)("generated.systemConfigurationPage.mailBody")),1),P("p",null,p(g.value?.text??c.value.body),1)]))])),[[e(X),V.value,"region"]]):R("",!0)])):e(u).loading.value?R("",!0):(f(),T("p",Ae,p(e(a)("generated.systemConfigurationPage.mailTemplateEmpty")),1))])),[[e(X),e(u).loading.value,"region"]])]),_:1},8,["onVnodeMounted","onVnodeBeforeUnmount","modelValue","title"])):R("",!0),d.value?(f(),D(e(W),{key:1,onVnodeMounted:e(te),onVnodeBeforeUnmount:e(ae),modelValue:d.value,"onUpdate:modelValue":h[5]||(h[5]=m=>d.value=m),"append-to-body":"",title:e(a)("generated.systemConfigurationPage.mailTest"),width:"min(480px, calc(100vw - 32px))"},{footer:r(()=>[o(e(U),{onClick:h[4]||(h[4]=m=>d.value=!1)},{default:r(()=>[S(p(e(a)("common.cancel")),1)]),_:1}),o(e(U),{type:"primary",loading:e(u).busy.value,onClick:L},{default:r(()=>[S(p(e(a)("generated.systemConfigurationPage.mailTestSend")),1)]),_:1},8,["loading"])]),default:r(()=>[o(e(Y),{ref_key:"testForm",ref:x,model:O.value,rules:F,"label-position":"top"},{default:r(()=>[o(e(E),{label:e(a)("generated.systemConfigurationPage.mailAddress"),prop:"email"},{default:r(()=>[o(e(j),{modelValue:I.value,"onUpdate:modelValue":h[2]||(h[2]=m=>I.value=m),type:"email"},null,8,["modelValue"])]),_:1},8,["label"]),o(e(E),{label:e(a)("generated.systemConfigurationPage.mailTemplate"),prop:"templateId"},{default:r(()=>[o(e(ge),{modelValue:K.value,"onUpdate:modelValue":h[3]||(h[3]=m=>K.value=m),class:"template-test-select","clear-icon":e($)("clear-input"),"suffix-icon":e($)("chevron-down")},{default:r(()=>[(f(!0),T(Z,null,ie(N.value,m=>(f(),D(e(ee),{key:m.id,value:m.id,label:m.name},null,8,["value","label"]))),128))]),_:1},8,["modelValue","clear-icon","suffix-icon"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["onVnodeMounted","onVnodeBeforeUnmount","modelValue","title"])):R("",!0)],64))}}),Re=me(je,[["__scopeId","data-v-f6468a3d"]]),qe={class:"mar-management-page"},Le={class:"mar-table-actions"},ze={key:1},Je={key:3},He={key:4},Ze={class:"smtp-toggle"},Ge={class:"smtp-form__pair"},We={class:"smtp-template-row"},Qe={class:"smtp-dialog-hint"},Xe={class:"smtp-dialog-footer"},Ye=de({__name:"SystemConfigurationPage",props:{request:{type:Function},writable:{type:Boolean},settings:{}},setup(k){const M=k,u=ke(M.request,M.settings),_=C(),w=C(),c=C(""),g=C(!1),V=u.settings.find(s=>s.key==="mail-smtp"),y=C(!1),d=ve({host:"",port:587,tls:"STARTTLS",from:"",fromName:"",username:"",password:""});let x="";const I={host:[{required:!0,pattern:/^[A-Za-z0-9](?:[A-Za-z0-9.-]{0,251}[A-Za-z0-9])?$/u,message:a("generated.systemConfigurationPage.smtpHostInvalid"),trigger:"blur"}],port:[{type:"integer",min:1,max:65535,required:!0,message:a("generated.systemConfigurationPage.smtpPortInvalid"),trigger:"change"}],tls:[{required:!0,trigger:"change"}],from:[{required:!0,pattern:/^[^\s@]+@[^\s@]+\.[^\s@]+$/u,message:a("generated.systemConfigurationPage.smtpFromInvalid"),trigger:"blur"}],fromName:[{max:128,pattern:/^[^\r\n]*$/u,message:a("generated.systemConfigurationPage.smtpFromNameInvalid"),trigger:"blur"}],username:[{max:320,pattern:/^[^\r\n]*$/u,message:a("generated.systemConfigurationPage.smtpUsernameInvalid"),trigger:"blur"}],password:[{validator:(s,l,t)=>t(typeof l=="string"&&l.length<=1024&&(d.username===""?l==="":l!==""||d.username===x)?void 0:new Error(a("generated.systemConfigurationPage.smtpPasswordInvalid"))),trigger:"blur"}]},K=u.settings.find(s=>s.key==="html-preview-origin"),N={origin:[{validator:(s,l,t)=>t(u.validValue(K,l)?void 0:new Error(a("generated.systemConfigurationPage.htmlPreviewOriginInvalid"))),trigger:"change"}]},{snapshot:O,drafts:F,editingKey:i,savingKey:n,loading:v,beginEdit:q,cancelEdit:J}=u,L=C(!1),b=z(()=>({origin:F.value.htmlPreviewOrigin})),h=z(()=>u.settings.map(s=>({...s,name:a(s.nameKey),description:a(s.descriptionKey)})));ce(g,s=>{c.value="",s||(d.password="",x="",J("mail-smtp"))});function m(s){const l=F.value[s];return typeof l=="number"?l:void 0}function le(s){const l=F.value[s];return typeof l=="string"?l:""}function pe(){if(!M.writable||(q("mail-smtp"),i.value!=="mail-smtp"))return;const s=JSON.parse(String(O.value.smtpConfiguration));y.value=Object.keys(s).length>0,Object.assign(d,{host:s.host??"",port:s.port??587,tls:s.tls??"STARTTLS",from:s.from??"",fromName:s.fromName??"",username:s.username??"",password:""}),x=s.username??"",g.value=i.value==="mail-smtp"}async function ne(){try{await u.load(),L.value=!0}catch(s){A(s instanceof Error?G(s):a("generated.systemConfigurationPage.unableToLoadSystemConfiguration"),"error",s)}}async function oe(s){if(M.writable){if(c.value="",s==="html-preview-origin")try{await _.value?.validate()}catch{return}if(s==="mail-smtp")if(y.value){try{await w.value?.validate()}catch{return}const l=JSON.stringify({...d});if(!u.validValue(V,l)){c.value=a("generated.systemConfigurationPage.smtpInvalid");return}u.setDraft(s,l)}else{if(O.value.smtpConfiguration!=="{}")try{await be.confirm(a("generated.systemConfigurationPage.smtpDisableConfirmation"),a("generated.systemConfigurationPage.smtpDisableTitle"),{icon:$("warning"),type:"warning",confirmButtonText:a("generated.systemConfigurationPage.smtpDisableTitle"),cancelButtonText:a("common.cancel")})}catch(l){if(l==="cancel"||l==="close")return;A(l instanceof Error?G(l):a("generated.systemConfigurationPage.unableToSaveSystemConfiguration"),"error",l);return}if(!g.value||i.value!==s)return;u.setDraft(s,"{}")}try{await u.save(s)&&(s==="mail-smtp"&&(g.value=!1),A(a("generated.systemConfigurationPage.systemConfigurationSaved"),"success"))}catch(l){A(l instanceof Error?G(l):a("generated.systemConfigurationPage.unableToSaveSystemConfiguration"),"error",l)}}}return ye(()=>{ne()}),(s,l)=>Q((f(),T("section",qe,[P("div",Le,[o(e(U),{icon:e($)("refresh"),loading:e(v)&&L.value,onClick:ne},{default:r(()=>[S(p(e(a)("generated.systemConfigurationPage.refresh")),1)]),_:1},8,["icon","loading"])]),o(e(he),{data:h.value,"row-key":"key"},{default:r(()=>[o(e(H),{prop:"name",label:e(a)("generated.systemConfigurationPage.setting"),"min-width":"180"},null,8,["label"]),o(e(H),{prop:"description",label:e(a)("generated.systemConfigurationPage.description"),"min-width":"320"},null,8,["label"]),o(e(H),{label:e(a)("generated.systemConfigurationPage.value"),"min-width":"180"},{default:r(({row:t})=>[t.type==="number"&&e(i)===t.key?(f(),D(e(re),{key:0,"model-value":m(t.field),placeholder:t.placeholderKey===void 0?void 0:e(a)(t.placeholderKey),min:t.min,max:t.max,disabled:e(n)!==null,"onUpdate:modelValue":B=>e(u).setDraft(t.key,B)},{"decrease-icon":r(()=>[o(se,{name:"subtract"})]),"increase-icon":r(()=>[o(se,{name:"plus"})]),_:1},8,["model-value","placeholder","min","max","disabled","onUpdate:modelValue"])):t.type==="number"?(f(),T("span",ze,p(e(O)[t.field]),1)):t.type==="origin"&&e(i)===t.key?(f(),D(e(Y),{key:2,ref_key:"originForm",ref:_,model:b.value,rules:N},{default:r(()=>[o(e(E),{prop:"origin",class:"origin-setting-form"},{default:r(()=>[o(e(j),{"model-value":le(t.field),placeholder:e(a)(t.placeholderKey),disabled:e(n)!==null,"onUpdate:modelValue":B=>e(u).setDraft(t.key,B)},null,8,["model-value","placeholder","disabled","onUpdate:modelValue"])]),_:2},1024)]),_:2},1032,["model"])):t.type==="origin"?(f(),T("span",Je,p(e(O)[t.field]||e(a)("generated.systemConfigurationPage.htmlPreviewCurrentOrigin")),1)):t.type==="json"?(f(),T("span",He,"-")):(f(),D(e(ue),{key:5,"model-value":e(F)[t.field]===!0,disabled:e(i)!==t.key||!k.writable||e(n)!==null,"onUpdate:modelValue":B=>e(u).setDraft(t.key,B)},null,8,["model-value","disabled","onUpdate:modelValue"]))]),_:1},8,["label"]),o(e(H),{label:e(a)("generated.systemConfigurationPage.actions"),"min-width":"220"},{default:r(({row:t})=>[e(i)!==t.key||t.type==="json"?(f(),D(e(U),{key:0,link:"",icon:e($)("edit"),disabled:!k.writable||e(i)!==null,onClick:B=>t.type==="json"?pe():e(q)(t.key)},{default:r(()=>[S(p(e(a)("generated.systemConfigurationPage.edit")),1)]),_:1},8,["icon","disabled","onClick"])):(f(),T(Z,{key:1},[o(e(U),{link:"",type:"primary",icon:e($)("check"),loading:e(n)===t.key,disabled:!k.writable||e(n)!==null,onClick:B=>oe(t.key)},{default:r(()=>[S(p(e(a)("generated.systemConfigurationPage.save")),1)]),_:1},8,["icon","loading","disabled","onClick"]),o(e(U),{link:"",icon:e($)("close"),disabled:e(n)!==null,onClick:B=>e(J)(t.key)},{default:r(()=>[S(p(e(a)("common.cancel")),1)]),_:1},8,["icon","disabled","onClick"])],64))]),_:1},8,["label"])]),_:1},8,["data"]),g.value?(f(),D(e(W),{key:0,onVnodeMounted:e(te),onVnodeBeforeUnmount:e(ae),modelValue:g.value,"onUpdate:modelValue":l[10]||(l[10]=t=>g.value=t),title:e(a)("generated.systemConfigurationPage.smtp"),width:"min(620px, calc(100vw - 32px))","close-on-click-modal":e(n)===null,"close-on-press-escape":e(n)===null,"show-close":e(n)===null,"append-to-body":""},{footer:r(()=>[P("div",Xe,[o(e(U),{disabled:e(n)!==null,onClick:l[8]||(l[8]=t=>g.value=!1)},{default:r(()=>[S(p(e(a)("common.cancel")),1)]),_:1},8,["disabled"]),o(e(U),{type:"primary",loading:e(n)==="mail-smtp",onClick:l[9]||(l[9]=t=>oe("mail-smtp"))},{default:r(()=>[S(p(e(a)("generated.systemConfigurationPage.save")),1)]),_:1},8,["loading"])])]),default:r(()=>[P("div",Ze,[P("span",null,p(e(a)("generated.systemConfigurationPage.smtpEnable")),1),o(e(ue),{modelValue:y.value,"onUpdate:modelValue":l[0]||(l[0]=t=>y.value=t),disabled:e(n)!==null,"aria-label":e(a)("generated.systemConfigurationPage.smtpEnable")},null,8,["modelValue","disabled","aria-label"])]),y.value?(f(),D(e(Y),{key:0,ref_key:"smtpForm",ref:w,model:d,rules:I,"label-position":"top",class:"smtp-form"},{default:r(()=>[c.value?(f(),D(e(Ce),{key:0,title:c.value,type:"error",closable:!1},null,8,["title"])):R("",!0),o(e(E),{label:e(a)("generated.systemConfigurationPage.smtpHost"),prop:"host"},{default:r(()=>[o(e(j),{modelValue:d.host,"onUpdate:modelValue":l[1]||(l[1]=t=>d.host=t),maxlength:"253",autocomplete:"off",disabled:e(n)!==null},null,8,["modelValue","disabled"])]),_:1},8,["label"]),P("div",Ge,[o(e(E),{label:e(a)("generated.systemConfigurationPage.smtpPort"),prop:"port"},{default:r(()=>[o(e(re),{modelValue:d.port,"onUpdate:modelValue":l[2]||(l[2]=t=>d.port=t),"aria-label":e(a)("generated.systemConfigurationPage.smtpPort"),min:1,max:65535,controls:!1,disabled:e(n)!==null},null,8,["modelValue","aria-label","disabled"])]),_:1},8,["label"]),o(e(E),{label:e(a)("generated.systemConfigurationPage.smtpTls"),prop:"tls"},{default:r(()=>[o(e(ge),{modelValue:d.tls,"onUpdate:modelValue":l[3]||(l[3]=t=>d.tls=t),disabled:e(n)!==null,"clear-icon":e($)("clear-input"),"suffix-icon":e($)("chevron-down")},{default:r(()=>[o(e(ee),{label:"STARTTLS",value:"STARTTLS"}),o(e(ee),{label:"TLS",value:"TLS"})]),_:1},8,["modelValue","disabled","clear-icon","suffix-icon"])]),_:1},8,["label"])]),o(e(E),{label:e(a)("generated.systemConfigurationPage.smtpFrom"),prop:"from"},{default:r(()=>[o(e(j),{modelValue:d.from,"onUpdate:modelValue":l[4]||(l[4]=t=>d.from=t),maxlength:"320",autocomplete:"off",disabled:e(n)!==null},null,8,["modelValue","disabled"])]),_:1},8,["label"]),o(e(E),{label:e(a)("generated.systemConfigurationPage.smtpFromName"),prop:"fromName"},{default:r(()=>[o(e(j),{modelValue:d.fromName,"onUpdate:modelValue":l[5]||(l[5]=t=>d.fromName=t),maxlength:"128",autocomplete:"off",disabled:e(n)!==null},null,8,["modelValue","disabled"])]),_:1},8,["label"]),o(e(E),{label:e(a)("generated.systemConfigurationPage.smtpUsername"),prop:"username"},{default:r(()=>[o(e(j),{modelValue:d.username,"onUpdate:modelValue":l[6]||(l[6]=t=>d.username=t),maxlength:"320",autocomplete:"off",disabled:e(n)!==null},null,8,["modelValue","disabled"])]),_:1},8,["label"]),o(e(E),{label:e(a)("generated.systemConfigurationPage.smtpPassword"),prop:"password"},{default:r(()=>[o(e(j),{modelValue:d.password,"onUpdate:modelValue":l[7]||(l[7]=t=>d.password=t),type:"password",maxlength:"1024",autocomplete:"new-password",placeholder:e(x)===d.username&&e(x)?e(a)("generated.systemConfigurationPage.smtpPasswordKeep"):void 0,disabled:e(n)!==null},null,8,["modelValue","placeholder","disabled"])]),_:1},8,["label"])]),_:1},8,["model"])):R("",!0),P("div",We,[o(Re,{request:k.request,writable:k.writable},null,8,["request","writable"])]),P("p",Qe,p(e(a)("generated.systemConfigurationPage.smtpDialogHint")),1)]),_:1},8,["onVnodeMounted","onVnodeBeforeUnmount","modelValue","title","close-on-click-modal","close-on-press-escape","show-close"])):R("",!0)])),[[e(X),e(v)&&!L.value,"page"]])}}),da=me(Ye,[["__scopeId","data-v-58c8d259"]]);export{da as default};
@@ -1 +1 @@
1
- import{M as a}from"./MarTag-CvK9DDWY.js";import{m as g,o as c,n as C,P as e,Q as o,E as t,t as s,q as l,D as i,S as d,C as f,a4 as y,G as h,_ as v}from"./index-B4CXrXhI.js";const x={class:"system-information"},b=["aria-label"],N=["src"],V=["aria-label"],B=g({__name:"SystemInformationPage",props:{authenticated:{type:Boolean},logoUrl:{},onlineNodeCount:{},nodeCount:{},request:{type:Function},isAdmin:{type:Boolean},serverVersion:{},extension:{}},emits:["extensionChanged"],setup(n,{emit:u}){const m=u;return(S,r)=>(c(),C("section",x,[e("div",{class:"system-brand","aria-label":t(s)("generated.settingsContent.myAgentRoamVersion")},[e("img",{src:n.logoUrl,alt:""},null,8,N),e("div",null,[e("strong",null,o(t(s)("common.productName")),1),e("code",null,o(n.serverVersion??t(s)("generated.settingsContent.unknown")),1)])],8,b),e("section",{class:"system-status","aria-label":t(s)("generated.settingsContent.systemStatus")},[e("h2",null,o(t(s)("generated.settingsContent.systemStatus2")),1),e("dl",null,[e("div",null,[e("dt",null,o(t(s)("common.webConsole")),1),e("dd",null,[l(t(a),{effect:"light",type:"success"},{default:i(()=>[d(o(t(s)("generated.settingsContent.running")),1)]),_:1})])]),e("div",null,[e("dt",null,o(t(s)("generated.settingsContent.serverConnection")),1),e("dd",null,[l(t(a),{type:n.authenticated?"success":"info",effect:"light"},{default:i(()=>[d(o(n.authenticated?t(s)("generated.settingsContent.connected"):t(s)("generated.settingsContent.disconnected")),1)]),_:1},8,["type"])])]),e("div",null,[e("dt",null,o(t(s)("generated.settingsContent.nodeConnections")),1),e("dd",null,[l(t(a),{type:n.onlineNodeCount>0?"success":"info",effect:"light"},{default:i(()=>[d(o(n.onlineNodeCount)+"/"+o(n.nodeCount),1)]),_:1},8,["type"])])])])],8,V),n.isAdmin&&n.extension?(c(),f(y(n.extension),{key:0,embedded:"",request:n.request,onImported:r[0]||(r[0]=k=>m("extensionChanged"))},null,40,["request"])):h("",!0)]))}}),w=v(B,[["__scopeId","data-v-c554b4ed"]]);export{w as default};
1
+ import{M as a}from"./MarTag-C1JDYeU5.js";import{m as g,o as c,n as C,P as e,Q as o,E as t,t as s,q as l,D as i,S as d,C as f,a4 as y,G as h,_ as v}from"./index-BAF_vQZ-.js";const x={class:"system-information"},b=["aria-label"],N=["src"],V=["aria-label"],B=g({__name:"SystemInformationPage",props:{authenticated:{type:Boolean},logoUrl:{},onlineNodeCount:{},nodeCount:{},request:{type:Function},isAdmin:{type:Boolean},serverVersion:{},extension:{}},emits:["extensionChanged"],setup(n,{emit:u}){const m=u;return(S,r)=>(c(),C("section",x,[e("div",{class:"system-brand","aria-label":t(s)("generated.settingsContent.myAgentRoamVersion")},[e("img",{src:n.logoUrl,alt:""},null,8,N),e("div",null,[e("strong",null,o(t(s)("common.productName")),1),e("code",null,o(n.serverVersion??t(s)("generated.settingsContent.unknown")),1)])],8,b),e("section",{class:"system-status","aria-label":t(s)("generated.settingsContent.systemStatus")},[e("h2",null,o(t(s)("generated.settingsContent.systemStatus2")),1),e("dl",null,[e("div",null,[e("dt",null,o(t(s)("common.webConsole")),1),e("dd",null,[l(t(a),{effect:"light",type:"success"},{default:i(()=>[d(o(t(s)("generated.settingsContent.running")),1)]),_:1})])]),e("div",null,[e("dt",null,o(t(s)("generated.settingsContent.serverConnection")),1),e("dd",null,[l(t(a),{type:n.authenticated?"success":"info",effect:"light"},{default:i(()=>[d(o(n.authenticated?t(s)("generated.settingsContent.connected"):t(s)("generated.settingsContent.disconnected")),1)]),_:1},8,["type"])])]),e("div",null,[e("dt",null,o(t(s)("generated.settingsContent.nodeConnections")),1),e("dd",null,[l(t(a),{type:n.onlineNodeCount>0?"success":"info",effect:"light"},{default:i(()=>[d(o(n.onlineNodeCount)+"/"+o(n.nodeCount),1)]),_:1},8,["type"])])])])],8,V),n.isAdmin&&n.extension?(c(),f(y(n.extension),{key:0,embedded:"",request:n.request,onImported:r[0]||(r[0]=k=>m("extensionChanged"))},null,40,["request"])):h("",!0)]))}}),w=v(B,[["__scopeId","data-v-c554b4ed"]]);export{w as default};
@@ -1,4 +1,4 @@
1
- import{t as ke,m as Mn,aq as Tn,aQ as Pn,K as An,w as On,ab as di,ad as In,N as Nn,aR as Hn,o as ui,n as Ms,P as Wn,E as Be,Q as At,G as Ts,C as zn,D as _t,q as Ot,S as _i,a2 as Fn,f as It,aS as $n,_ as Kn}from"./index-B4CXrXhI.js";import{h as Un,j as fi,k as qn}from"./FilePreviewLoading-DAPNzTFU.js";import{o as Vn}from"./HtmlPreviewFrame-DJvvy8cY.js";import{T as Yn}from"./WorkbenchPage-BwMBLemU.js";import"./BusyIndicator-D1dlXnIa.js";import"./uuid-BmNSYLtZ.js";import"./MarFormItem.vue_vue_type_script_setup_true_lang-Cb0xjbkz.js";import"./MarSwitch-BARfoj2O.js";import"./mobile-dialog-return-service-Cvt9WsqK.js";import"./error-presentation-Bsw9jRIX.js";import"./file-presentation-Cm7tx53N.js";import"./time-presentation-f56rqpcy.js";import"./conversation-history-5Whey-Nw.js";import"./workbench-presentation-6AMUsb5y.js";import"./AuthEntryPanel-BsdDHBXI.js";import"./MarCheckboxGroup.vue_vue_type_style_index_0_scoped_3769668f_lang-DlSCkqLi.js";import"./MarCheckboxGroup-C4uNCipw.js";/* empty css */import"./MarOptionGroup.vue_vue_type_style_index_0_scoped_0cdd846e_lang-Bnk1CfAu.js";import"./runner-presentation-Cm3jAKir.js";import"./workbench-live-service-0ogIcbLV.js";import"./workspace-direct-transfer-service-H0f55kLn.js";import"./hosted-conversation-template-client-CVDyJLe_.js";import"./oauth-callback-B8_Tpisc.js";import"./MarAlert-DSmQryuu.js";import"./code-navigation-target-BlnRe0-a.js";import"./MarTag-CvK9DDWY.js";import"./mcp-center-service-Dh09PYq1.js";import"./catalog-page-service-CR4iDEEe.js";import"./ManagementPagination-BvsRjE74.js";import"./MarDatePicker-D6PeHzfi.js";import"./MarTableColumn.vue_vue_type_script_setup_true_lang-Du6vjSSf.js";import"./MarInputNumber-Cgd2zn2w.js";import"./MarCascader-CWpOhKd2.js";import"./enterprise-management-service-C3wTQakl.js";import"./NodeDetailsDialogs-BM_7Yb_X.js";import"./MarDescriptionsItem-BlnGyiqR.js";import"./EnvironmentSecretManager-BoAKY3wG.js";import"./management-url-service-BuGA1tHR.js";var Xn=2,jn=1,Gn=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,i=window.getComputedStyle(this._terminal.element.parentElement),s=parseInt(i.getPropertyValue("height")),r=Math.max(0,parseInt(i.getPropertyValue("width"))),n=window.getComputedStyle(this._terminal.element),o={top:parseInt(n.getPropertyValue("padding-top")),bottom:parseInt(n.getPropertyValue("padding-bottom")),right:parseInt(n.getPropertyValue("padding-right")),left:parseInt(n.getPropertyValue("padding-left"))},l=o.top+o.bottom,h=o.right+o.left,a=s-l,d=r-h-t;return{cols:Math.max(Xn,Math.floor(d/e.css.cell.width)),rows:Math.max(jn,Math.floor(a/e.css.cell.height))}}};var pi=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],Jn=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],Q;function Zn(e,t){let i=0,s=t.length-1,r;if(e<t[0][0]||e>t[s][1])return!1;for(;s>=i;)if(r=i+s>>1,e>t[r][1])i=r+1;else if(e<t[r][0])s=r-1;else return!0;return!1}var Qn=class{constructor(){if(this.version="6",!Q){Q=new Uint8Array(65536),Q.fill(1),Q[0]=0,Q.fill(0,1,32),Q.fill(0,127,160),Q.fill(2,4352,4448),Q[9001]=2,Q[9002]=2,Q.fill(2,11904,42192),Q[12351]=1,Q.fill(2,44032,55204),Q.fill(2,63744,64256),Q.fill(2,65040,65050),Q.fill(2,65072,65136),Q.fill(2,65280,65377),Q.fill(2,65504,65511);for(let t=0;t<pi.length;++t)Q.fill(0,pi[t][0],pi[t][1]+1)}}wcwidth(t){return t<32?0:t<127?1:t<65536?Q[t]:Zn(t,Jn)?0:t>=131072&&t<=196605||t>=196608&&t<=262141?2:1}charProperties(t,i){let s=this.wcwidth(t),r=s===0&&i!==0;if(r){let n=Zt.extractWidth(i);n===0?r=!1:n>s&&(s=n)}return Zt.createPropertyValue(0,s,r)}},eo=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(t){setTimeout(()=>{throw t.stack?Ps.isErrorNoTelemetry(t)?new Ps(t.message+`
1
+ import{t as ke,m as Mn,aq as Tn,aQ as Pn,K as An,w as On,ab as di,ad as In,N as Nn,aR as Hn,o as ui,n as Ms,P as Wn,E as Be,Q as At,G as Ts,C as zn,D as _t,q as Ot,S as _i,a2 as Fn,f as It,aS as $n,_ as Kn}from"./index-BAF_vQZ-.js";import{h as Un,j as fi,k as qn}from"./FilePreviewLoading-BF7eGwwx.js";import{o as Vn}from"./HtmlPreviewFrame-BSKmXInH.js";import{T as Yn}from"./WorkbenchPage-DiwxggiB.js";import"./BusyIndicator-PRFERntc.js";import"./uuid-BmNSYLtZ.js";import"./MarFormItem.vue_vue_type_script_setup_true_lang-C5687WPW.js";import"./MarSwitch-D7P0NJJ8.js";import"./mobile-dialog-return-service-G00_zLGC.js";import"./error-presentation-C9lF2Dka.js";import"./file-presentation-Cm7tx53N.js";import"./MarTabs-DtoaIrb2.js";import"./time-presentation-BsKzQVfX.js";import"./conversation-history-BmbSoNKL.js";import"./workbench-presentation-B9YUi6tS.js";import"./AuthEntryPanel-CjAnXljt.js";import"./MarCheckboxGroup.vue_vue_type_style_index_0_scoped_3769668f_lang-Dbdx7XmP.js";import"./MarCheckboxGroup-BHCu0L3N.js";/* empty css */import"./MarOptionGroup.vue_vue_type_style_index_0_scoped_0cdd846e_lang-C5U0ej6_.js";import"./runner-presentation-_yMutYy4.js";import"./workbench-live-service-a0t7gSnZ.js";import"./workspace-direct-transfer-service-H0f55kLn.js";import"./hosted-conversation-template-client-76fGpTl2.js";import"./oauth-callback-B0UzPGFp.js";import"./MarAlert-BRDdHNjI.js";import"./code-navigation-target-BlnRe0-a.js";import"./MarTag-C1JDYeU5.js";import"./mcp-center-service-D-gh5DCu.js";import"./catalog-page-service-BKeMbafQ.js";import"./ManagementPagination-nDliwf8V.js";import"./MarDatePicker-fEx6Uc2H.js";import"./MarTableColumn.vue_vue_type_script_setup_true_lang-Cl79Jlsp.js";import"./MarInputNumber-BrdLKVcG.js";import"./MarCascader-BycquR4M.js";import"./enterprise-management-service-BMnR8EHP.js";import"./NodeDetailsDialogs-CoIqd6Qm.js";import"./MarDescriptionsItem-DXs8T6y2.js";import"./EnvironmentSecretManager-5mGJzBx-.js";import"./management-url-service-sRmoAxle.js";var Xn=2,jn=1,Gn=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,i=window.getComputedStyle(this._terminal.element.parentElement),s=parseInt(i.getPropertyValue("height")),r=Math.max(0,parseInt(i.getPropertyValue("width"))),n=window.getComputedStyle(this._terminal.element),o={top:parseInt(n.getPropertyValue("padding-top")),bottom:parseInt(n.getPropertyValue("padding-bottom")),right:parseInt(n.getPropertyValue("padding-right")),left:parseInt(n.getPropertyValue("padding-left"))},l=o.top+o.bottom,h=o.right+o.left,a=s-l,d=r-h-t;return{cols:Math.max(Xn,Math.floor(d/e.css.cell.width)),rows:Math.max(jn,Math.floor(a/e.css.cell.height))}}};var pi=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],Jn=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],Q;function Zn(e,t){let i=0,s=t.length-1,r;if(e<t[0][0]||e>t[s][1])return!1;for(;s>=i;)if(r=i+s>>1,e>t[r][1])i=r+1;else if(e<t[r][0])s=r-1;else return!0;return!1}var Qn=class{constructor(){if(this.version="6",!Q){Q=new Uint8Array(65536),Q.fill(1),Q[0]=0,Q.fill(0,1,32),Q.fill(0,127,160),Q.fill(2,4352,4448),Q[9001]=2,Q[9002]=2,Q.fill(2,11904,42192),Q[12351]=1,Q.fill(2,44032,55204),Q.fill(2,63744,64256),Q.fill(2,65040,65050),Q.fill(2,65072,65136),Q.fill(2,65280,65377),Q.fill(2,65504,65511);for(let t=0;t<pi.length;++t)Q.fill(0,pi[t][0],pi[t][1]+1)}}wcwidth(t){return t<32?0:t<127?1:t<65536?Q[t]:Zn(t,Jn)?0:t>=131072&&t<=196605||t>=196608&&t<=262141?2:1}charProperties(t,i){let s=this.wcwidth(t),r=s===0&&i!==0;if(r){let n=Zt.extractWidth(i);n===0?r=!1:n>s&&(s=n)}return Zt.createPropertyValue(0,s,r)}},eo=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(t){setTimeout(()=>{throw t.stack?Ps.isErrorNoTelemetry(t)?new Ps(t.message+`
2
2
 
3
3
  `+t.stack):new Error(t.message+`
4
4
 
@@ -20,4 +20,4 @@ WARNING: This link could potentially be dangerous`)){let i=window.open();if(i){t
20
20
  `))),this._register(this._terminal.onA11yTab(n=>this._handleTab(n))),this._register(this._terminal.onKey(n=>this._handleKey(n.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(I(r,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(q(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<Dr+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
21
21
  `&&(this._liveRegionLineCount++,this._liveRegionLineCount===Dr+1&&(this._liveRegion.textContent+=Hi.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let i=this._terminal.buffer,s=i.lines.length.toString();for(let r=e;r<=t;r++){let n=i.lines.get(i.ydisp+r),o=[],l=n?.translateToString(!0,void 0,void 0,o)||"",h=(i.ydisp+r+1).toString(),a=this._rowElements[r];a&&(l.length===0?(a.textContent=" ",this._rowColumns.set(a,[0,1])):(a.textContent=l,this._rowColumns.set(a,o)),a.setAttribute("aria-posinset",h),a.setAttribute("aria-setsize",s),this._alignRowWidth(a))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){let i=e.target,s=this._rowElements[t===0?1:this._rowElements.length-2],r=i.getAttribute("aria-posinset"),n=t===0?"1":`${this._terminal.buffer.lines.length}`;if(r===n||e.relatedTarget!==s)return;let o,l;if(t===0?(o=i,l=this._rowElements.pop(),this._rowContainer.removeChild(l)):(o=this._rowElements.shift(),l=i,this._rowContainer.removeChild(o)),o.removeEventListener("focus",this._topBoundaryFocusListener),l.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){let h=this._createAccessibilityTreeNode();this._rowElements.unshift(h),this._rowContainer.insertAdjacentElement("afterbegin",h)}else{let h=this._createAccessibilityTreeNode();this._rowElements.push(h),this._rowContainer.appendChild(h)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error("anchorNode and/or focusNode are null");return}let t={node:e.anchorNode,offset:e.anchorOffset},i={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(i.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===i.node&&t.offset>i.offset)&&([t,i]=[i,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let s=this._rowElements.slice(-1)[0];if(i.node.compareDocumentPosition(s)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(i={node:s,offset:s.textContent?.length??0}),!this._rowContainer.contains(i.node))return;let r=({node:l,offset:h})=>{let a=l instanceof Text?l.parentNode:l,d=parseInt(a?.getAttribute("aria-posinset"),10)-1;if(isNaN(d))return console.warn("row is invalid. Race condition?"),null;let c=this._rowColumns.get(a);if(!c)return console.warn("columns is null. Race condition?"),null;let p=h<c.length?c[h]:c.slice(-1)[0]+1;return p>=this._terminal.cols&&(++d,p=0),{row:d,column:p}},n=r(t),o=r(i);if(!(!n||!o)){if(n.row>o.row||n.row===o.row&&n.column>=o.column)throw new Error("invalid range");this._terminal.select(n.column,n.row,(o.row-n.row)*this._terminal.cols-n.column+o.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){e.style.transform="";let t=e.getBoundingClientRect().width,i=this._rowColumns.get(e)?.slice(-1)?.[0];if(!i)return;let s=i*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${s/t})`}};ri=j([L(1,bs),L(2,Fe),L(3,$e)],ri);var Ss=class extends H{constructor(e,t,i,s,r){super(),this._element=e,this._mouseService=t,this._renderService=i,this._bufferService=s,this._linkProviderService=r,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new E),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new E),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(q(()=>{st(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(I(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(I(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(I(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(I(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let i=e.composedPath();for(let s=0;s<i.length;s++){let r=i[s];if(r.classList.contains("xterm"))break;if(r.classList.contains("xterm-hover"))return}(!this._lastBufferCell||t.x!==this._lastBufferCell.x||t.y!==this._lastBufferCell.y)&&(this._handleHover(t),this._lastBufferCell=t)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized){this._clearCurrentLink(),this._askForLink(e,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){(!this._activeProviderReplies||!t)&&(this._activeProviderReplies?.forEach(s=>{s?.forEach(r=>{r.link.dispose&&r.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let i=!1;for(let[s,r]of this._linkProviderService.linkProviders.entries())t?this._activeProviderReplies?.get(s)&&(i=this._checkLinkProviderResult(s,e,i)):r.provideLinks(e.y,n=>{if(this._isMouseOut)return;let o=n?.map(l=>({link:l}));this._activeProviderReplies?.set(s,o),i=this._checkLinkProviderResult(s,e,i),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let i=new Set;for(let s=0;s<t.size;s++){let r=t.get(s);if(r)for(let n=0;n<r.length;n++){let o=r[n],l=o.link.range.start.y<e?0:o.link.range.start.x,h=o.link.range.end.y>e?this._bufferService.cols:o.link.range.end.x;for(let a=l;a<=h;a++){if(i.has(a)){r.splice(n--,1);break}i.add(a)}}}}_checkLinkProviderResult(e,t,i){if(!this._activeProviderReplies)return i;let s=this._activeProviderReplies.get(e),r=!1;for(let n=0;n<e;n++)(!this._activeProviderReplies.has(n)||this._activeProviderReplies.get(n))&&(r=!0);if(!r&&s){let n=s.find(o=>this._linkAtPosition(o.link,t));n&&(i=!0,this._handleNewLink(n))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!i)for(let n=0;n<this._activeProviderReplies.size;n++){let o=this._activeProviderReplies.get(n)?.find(l=>this._linkAtPosition(l.link,t));if(o){i=!0,this._handleNewLink(o);break}}return i}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&Lh(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){!this._currentLink||!this._lastMouseEvent||(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,st(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0?!0:e.link.decorations.underline,pointerCursor:e.link.decorations===void 0?!0:e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:i=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==i&&(this._currentLink.state.decorations.pointerCursor=i,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",i))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:i=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==i&&(this._currentLink.state.decorations.underline=i,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,i))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(i=>{if(!this._currentLink)return;let s=i.start===0?0:i.start+1+this._bufferService.buffer.ydisp,r=this._bufferService.buffer.ydisp+1+i.end;if(this._currentLink.link.range.start.y>=s&&this._currentLink.link.range.end.y<=r&&(this._clearCurrentLink(s,r),this._lastMouseEvent)){let n=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);n&&this._askForLink(n,!1)}})))}_linkHover(e,t,i){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(i,t.text)}_fireUnderlineEvent(e,t){let i=e.range,s=this._bufferService.buffer.ydisp,r=this._createLinkUnderlineEvent(i.start.x-1,i.start.y-s-1,i.end.x,i.end.y-s-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(r)}_linkLeave(e,t,i){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(i,t.text)}_linkAtPosition(e,t){let i=e.range.start.y*this._bufferService.cols+e.range.start.x,s=e.range.end.y*this._bufferService.cols+e.range.end.x,r=t.y*this._bufferService.cols+t.x;return i<=r&&r<=s}_positionFromMouseEvent(e,t,i){let s=i.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(s)return{x:s[0],y:s[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,i,s,r){return{x1:e,y1:t,x2:i,y2:s,cols:this._bufferService.cols,fg:r}}};Ss=j([L(1,ys),L(2,$e),L(3,pe),L(4,Jr)],Ss);function Lh(e,t){return e.text===t.text&&e.range.start.x===t.range.start.x&&e.range.start.y===t.range.start.y&&e.range.end.x===t.range.end.x&&e.range.end.y===t.range.end.y}var Mh=class extends yh{constructor(e={}){super(e),this._linkifier=this._register(new ht),this.browser=vn,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new ht),this._onCursorMove=this._register(new E),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new E),this.onKey=this._onKey.event,this._onRender=this._register(new E),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new E),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new E),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new E),this.onBell=this._onBell.event,this._onFocus=this._register(new E),this._onBlur=this._register(new E),this._onA11yCharEmitter=this._register(new E),this._onA11yTabEmitter=this._register(new E),this._onWillOpen=this._register(new E),this._setup(),this._decorationService=this._instantiationService.createInstance(Eh),this._instantiationService.setService(Lt,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(wl),this._instantiationService.setService(Jr,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(zi)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(t=>this.refresh(t?.start??0,t?.end??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(t=>this._reportWindowsOptions(t))),this._register(this._inputHandler.onColor(t=>this._handleColorEvent(t))),this._register(he.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(he.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(he.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(he.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register(q(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}_handleColorEvent(e){if(this._themeService)for(let t of e){let i,s="";switch(t.index){case 256:i="foreground",s="10";break;case 257:i="background",s="11";break;case 258:i="cursor",s="12";break;default:i="ansi",s="4;"+t.index}switch(t.type){case 0:let r=U.toColorRGB(i==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[i]);this.coreService.triggerDataEvent(`${b.ESC}]${s};${gh(r)}${pn.ST}`);break;case 1:if(i==="ansi")this._themeService.modifyColors(n=>n.ansi[t.index]=Z.toColor(...t.color));else{let n=i;this._themeService.modifyColors(o=>o[n]=Z.toColor(...t.color))}break;case 2:this._themeService.restoreColor(t.index);break}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(ri,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(b.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(b.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;let i=Math.min(this.buffer.x,this.cols-1),s=this._renderService.dimensions.css.cell.height,r=t.getWidth(i),n=this._renderService.dimensions.css.cell.width*r,o=this.buffer.y*this._renderService.dimensions.css.cell.height,l=i*this._renderService.dimensions.css.cell.width;this.textarea.style.left=l+"px",this.textarea.style.top=o+"px",this.textarea.style.width=n+"px",this.textarea.style.height=s+"px",this.textarea.style.lineHeight=s+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(I(this.element,"copy",t=>{this.hasSelection()&&Oo(t,this._selectionService)}));let e=t=>Io(t,this.textarea,this.coreService,this.optionsService);this._register(I(this.textarea,"paste",e)),this._register(I(this.element,"paste",e)),mn?this._register(I(this.element,"mousedown",t=>{t.button===2&&Ns(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(I(this.element,"contextmenu",t=>{Ns(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),Ls&&this._register(I(this.element,"auxclick",t=>{t.button===1&&$r(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(I(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(I(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(I(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(I(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(I(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(I(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(I(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){if(!e)throw new Error("Terminal requires a parent element.");if(e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),e.appendChild(this.element);let t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),t.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(I(this.screenElement,"mousemove",r=>this.updateCursorStyle(r))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let i=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",Ni.get()),bn||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._register(this.optionsService.onSpecificOptionChange("disableStdin",()=>i.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(ml,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(Fe,this._coreBrowserService),this._register(I(this.textarea,"focus",r=>this._handleTextAreaFocus(r))),this._register(I(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(as,this._document,this._helperContainer),this._instantiationService.setService(oi,this._charSizeService),this._themeService=this._instantiationService.createInstance(ds),this._instantiationService.setService(ct,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(ti),this._instantiationService.setService(Gr,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(hs,this.rows,this.screenElement)),this._instantiationService.setService($e,this._renderService),this._register(this._renderService.onRenderedViewportChange(r=>this._onRender.fire(r))),this.onResize(r=>this._renderService.resize(r.cols,r.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(rs,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(ls),this._instantiationService.setService(ys,this._mouseService);let s=this._linkifier.value=this._register(this._instantiationService.createInstance(Ss,this.screenElement));this.element.appendChild(t);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this._register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this._register(this.onBlur(()=>this._renderService.handleBlur())),this._register(this.onFocus(()=>this._renderService.handleFocus())),this._viewport=this._register(this._instantiationService.createInstance(is,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(r=>{super.scrollLines(r,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(cs,this.element,this.screenElement,s)),this._instantiationService.setService(Uo,this._selectionService),this._register(this._selectionService.onRequestScrollLines(r=>this.scrollLines(r.amount,r.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(r=>this._renderService.handleSelectionChanged(r.start,r.end,r.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(r=>{this.textarea.value=r,this.textarea.focus(),this.textarea.select()})),this._register(he.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{this._selectionService.refresh(),this._viewport?.queueSync()})),this._register(this._instantiationService.createInstance(ss,this.screenElement)),this._register(I(this.element,"mousedown",r=>this._selectionService.handleMouseDown(r))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(ri,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",r=>this._handleScreenReaderModeOptionChange(r))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(ei,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",r=>{!this._overviewRulerRenderer&&r&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(ei,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(os,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function i(n){let o=e._mouseService.getMouseReportCoords(n,e.screenElement);if(!o)return!1;let l,h;switch(n.overrideType||n.type){case"mousemove":h=32,n.buttons===void 0?(l=3,n.button!==void 0&&(l=n.button<3?n.button:3)):l=n.buttons&1?0:n.buttons&4?1:n.buttons&2?2:3;break;case"mouseup":h=0,l=n.button<3?n.button:3;break;case"mousedown":h=1,l=n.button<3?n.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(n)===!1)return!1;let a=n.deltaY;if(a===0||e.coreMouseService.consumeWheelEvent(n,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return!1;h=a<0?0:1,l=4;break;default:return!1}return h===void 0||l===void 0||l>4?!1:e.coreMouseService.triggerMouseEvent({col:o.col,row:o.row,x:o.x,y:o.y,button:l,action:h,ctrl:n.ctrlKey,alt:n.altKey,shift:n.shiftKey})}let s={mouseup:null,wheel:null,mousedrag:null,mousemove:null},r={mouseup:n=>(i(n),n.buttons||(this._document.removeEventListener("mouseup",s.mouseup),s.mousedrag&&this._document.removeEventListener("mousemove",s.mousedrag)),this.cancel(n)),wheel:n=>(i(n),this.cancel(n,!0)),mousedrag:n=>{n.buttons&&i(n)},mousemove:n=>{n.buttons||i(n)}};this._register(this.coreMouseService.onProtocolChange(n=>{n?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(n)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),n&8?s.mousemove||(t.addEventListener("mousemove",r.mousemove),s.mousemove=r.mousemove):(t.removeEventListener("mousemove",s.mousemove),s.mousemove=null),n&16?s.wheel||(t.addEventListener("wheel",r.wheel,{passive:!1}),s.wheel=r.wheel):(t.removeEventListener("wheel",s.wheel),s.wheel=null),n&2?s.mouseup||(s.mouseup=r.mouseup):(this._document.removeEventListener("mouseup",s.mouseup),s.mouseup=null),n&4?s.mousedrag||(s.mousedrag=r.mousedrag):(this._document.removeEventListener("mousemove",s.mousedrag),s.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(I(t,"mousedown",n=>{if(n.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(n)))return i(n),s.mouseup&&this._document.addEventListener("mouseup",s.mouseup),s.mousedrag&&this._document.addEventListener("mousemove",s.mousedrag),this.cancel(n)})),this._register(I(t,"wheel",n=>{if(!s.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(n)===!1)return!1;if(!this.buffer.hasScrollback){if(n.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(n,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return this.cancel(n,!0);let o=b.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(n.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(o,!0),this.cancel(n,!0)}}},{passive:!1}))}refresh(e,t){this._renderService?.refreshRows(e,t)}updateCursorStyle(e){this._selectionService?.shouldColumnSelect(e)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,t){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,t),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}paste(e){Fr(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,t,i){this._selectionService.setSelection(e,t,i)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(!(!this._selectionService||!this._selectionService.hasSelection))return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(e,t){this._selectionService?.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!t&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let i=kh(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),i.type===3||i.type===2){let s=this.rows-1;return this.scrollLines(i.type===2?-s:s),this.cancel(e,!0)}if(i.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(i.cancel&&this.cancel(e,!0),!i.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((i.key===b.ETX||i.key===b.CR)&&(this.textarea.value=""),this._onKey.fire({key:i.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(i.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let i=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState("AltGraph");return t.type==="keypress"?i:i&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(Th(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else if(e.which!==0&&e.charCode!==0)t=e.which;else return!1;return!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType==="insertText"&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){if(e===this.cols&&t===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,t)}_afterResize(e,t){this._charSizeService?.measure()}clear(){if(!(this.buffer.ybase===0&&this.buffer.y===0)){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(J));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(b.ESC+"[I"):this.coreService.triggerDataEvent(b.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let t=this._renderService.dimensions.css.canvas.width.toFixed(0),i=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${b.ESC}[4;${i};${t}t`);break;case 1:let s=this._renderService.dimensions.css.cell.width.toFixed(0),r=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${b.ESC}[6;${r};${s}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};function Th(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var Ph=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let i={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(i),t.dispose=()=>this._wrappedAddonDispose(i),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let i=0;i<this._addons.length;i++)if(this._addons[i]===e){t=i;break}if(t===-1)throw new Error("Could not dispose an addon that has not been loaded");e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(t,1)}},Ah=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new Re)}translateToString(e,t,i){return this._line.translateToString(e,t,i)}},Rr=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(e){let t=this._buffer.lines.get(e);if(t)return new Ah(t)}getNullCell(){return new Re}},Oh=class extends H{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new E),this.onBufferChange=this._onBufferChange.event,this._normal=new Rr(this._core.buffers.normal,"normal"),this._alternate=new Rr(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}},Ih=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,i=>t(i.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(i,s)=>t(i,s.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}},Nh=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},Hh=["cols","rows"],Me=0,Wh=class extends H{constructor(e){super(),this._core=this._register(new Mh(e)),this._addonManager=this._register(new Ph),this._publicOptions={...this._core.options};let t=s=>this._core.options[s],i=(s,r)=>{this._checkReadonlyOptions(s),this._core.options[s]=r};for(let s in this._core.options){let r={get:t.bind(this,s),set:i.bind(this,s)};Object.defineProperty(this._publicOptions,s,r)}}_checkReadonlyOptions(e){if(Hh.includes(e))throw new Error(`Option "${e}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new Ih(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new Nh(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this._register(new Oh(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any";break}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,i){this._verifyIntegers(e,t,i),this._core.select(e,t,i)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r
22
22
  `,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return Ni.get()},set promptLabel(e){Ni.set(e)},get tooMuchOutput(){return Hi.get()},set tooMuchOutput(e){Hi.set(e)}}}_verifyIntegers(...e){for(Me of e)if(Me===1/0||isNaN(Me)||Me%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(Me of e)if(Me&&(Me===1/0||isNaN(Me)||Me%1!==0||Me<0))throw new Error("This API only accepts positive integers")}};const Br=1e3,zh=1e4,Lr=2e4;function Fh(e){let t,i=0,s,r,n,o,l=Br,h=!1,a=!1,d=!1,c=!1,p=!1;function g(x){const O=new URL(`/api/terminals/${encodeURIComponent(e.terminalId)}/connect`,window.location.origin);return O.protocol=O.protocol==="https:"?"wss:":"ws:",O.searchParams.set("ticket",x),O.toString()}function _(x){a&&t?.readyState===WebSocket.OPEN&&t.send(JSON.stringify(x))}function S(){s!==void 0&&window.clearTimeout(s),r!==void 0&&window.clearInterval(r),s=void 0,r=void 0}function D(){n!==void 0&&window.clearTimeout(n),n=void 0}function M(){if(e.managed){!c&&!d&&!p&&(p=!0,e.onDisconnected?.("TERMINAL_RELAY_CLOSED"));return}if(c||d||s!==void 0)return;const x=l,O=Date.now()+x,B=()=>e.onReconnectStatus(ke("generated.terminalRelayService.terminalConnectionLostReconnectingInSeconds",{value0:Math.max(1,Math.ceil((O-Date.now())/1e3))}));B(),r=window.setInterval(B,250),s=window.setTimeout(()=>{S(),e.onReconnectStatus(ke("generated.terminalRelayService.reconnectingTerminal")),W()},x),l=Math.min(l*2,zh)}async function W(){if(c||t!==void 0||h)return;h=!0;const x=new AbortController;o=x;const O=window.setTimeout(()=>x.abort(),Lr);try{const B=await e.http.request(`/api/terminals/${encodeURIComponent(e.terminalId)}/attach-ticket`,{method:"POST",body:JSON.stringify({nodeId:e.nodeId,...e.workspaceId===void 0?{}:{workspaceId:e.workspaceId},afterSequence:e.afterSequence?.()??i}),signal:x.signal});if(c)return;const T=new WebSocket(g(B.ticket));t=T,a=!1,n=window.setTimeout(()=>{t===T&&!a&&T.close(4e3,"TERMINAL_ATTACH_TIMEOUT")},Lr),T.addEventListener("message",ve=>P(T,ve)),T.addEventListener("close",()=>{t===T&&(D(),t=void 0,a=!1,!d&&M())}),T.addEventListener("error",()=>{})}catch(B){if(e.managed&&B!==null&&typeof B=="object"&&"code"in B){const T=B.code;if(typeof T=="string"&&["SESSION_UNAUTHENTICATED","RESOURCE_ACCESS_DENIED","WORKSPACE_ACCESS_DENIED"].includes(T)){d=!0,e.onDisconnected?.(T);return}}M()}finally{window.clearTimeout(O),o===x&&(o=void 0),h=!1}}function P(x,O){if(t!==x)return;let B;try{B=JSON.parse(String(O.data))}catch{x.close();return}if(B.terminalId===e.terminalId){if(B.type==="attach")a=!0,p=!1,D(),S(),l=Br,e.onReconnectStatus(void 0),e.onAttached();else if(B.type==="output"&&typeof B.data=="string"){if(typeof B.sequence=="number"&&(i=Math.max(i,B.sequence)),typeof B.sequence=="number"){if(e.afterSequence!==void 0&&B.sequence<=e.afterSequence())return;e.onSequence?.(B.sequence)}e.onOutput(B.data)}else if(B.type==="exit")e.onExited();else if(B.type==="error"){const T=B.code??"TERMINAL_ERROR";T==="TERMINAL_CLOSED"||T==="TERMINAL_NOT_FOUND"?(d=!0,e.onTerminalUnavailable(T),x.close(1e3,T)):e.onErrorFrame(T)}}}function y(){if(c)return;const x=t;t=void 0,a=!1,D(),x?.close(1e3,"TERMINAL_RELAY_RECONNECT"),M()}function R(){c=!0,S(),D(),o?.abort(),o=void 0,e.onReconnectStatus(void 0),t?.close(),t=void 0,a=!1}return{attach:W,send:_,reconnect:y,dispose:R}}const $h=new Set(["TERMINAL_CLOSED","TERMINAL_NOT_FOUND"]),Kh=new Set(["TERMINAL_NOT_AUTHORIZED","RESOURCE_ACCESS_DENIED","WORKSPACE_ACCESS_DENIED","SESSION_UNAUTHENTICATED","USER_AUTHORIZATION_REQUIRED","TERMINAL_WORKSPACE_MISMATCH","TERMINAL_GIT_OWNER_REQUIRED","NODE_ACCESS_DENIED"]);function Uh(e){let t,i,s,r,n,o=0,l=1e3,h=0,a=!1,d=!1,c=!1,p=0;function g(){r!==void 0&&clearTimeout(r),n!==void 0&&clearInterval(n),r=void 0,n=void 0}function _(){d=!1,s?.abort(),s=void 0,t?.dispose(),t=void 0,i?.dispose(),i=void 0}function S(B){return B==="TERMINAL_ATTACH_CONFLICT"?(p+=1,h+=1,_(),D(),!0):$h.has(B)?(c=!0,e.onTerminalUnavailable(B),!0):Kh.has(B)?(c=!0,e.onErrorFrame(B),!0):!1}function D(){if(a||c||r!==void 0)return;const B=Date.now()+l,T=()=>e.onReconnectStatus(p>=3?ke("generated.terminalRelayService.terminalOccupiedRetrying"):ke("generated.terminalRelayService.terminalConnectionLostReconnectingInSeconds",{value0:Math.max(1,Math.ceil((B-Date.now())/1e3))}));T(),n=setInterval(T,250),r=setTimeout(()=>{g(),e.onReconnectStatus(p>=3?ke("generated.terminalRelayService.terminalOccupiedRetrying"):ke("generated.terminalRelayService.reconnectingTerminal")),y()},l),l=Math.min(l*2,1e4)}function M(){d=!0,p=0,l=1e3,g(),e.onReconnectStatus(void 0),e.onAttached()}function W(B,T){if(T!==void 0){if(T<=o)return;o=T}e.onOutput(B)}function P(B){a||c||B!==h||(t?.dispose(),t=Fh({...e,managed:!0,afterSequence:()=>o,onSequence:T=>{o=T},onOutput:T=>W(T),onAttached:()=>{B===h&&M()},onDisconnected:T=>{B!==h||a||c||S(T)||(_(),D())},onErrorFrame:T=>{B===h&&!S(T)&&e.onErrorFrame(T)},onReconnectStatus:()=>{},onTerminalUnavailable:T=>{B===h&&(c=!0,e.onTerminalUnavailable(T))}}),t.attach())}async function y(B=!1){if(a||c)return;h+=1;const T=h;_();const ve=new AbortController;if(s=ve,B||e.direct===void 0){P(T);return}try{const z=await e.direct.attach({nodeId:e.nodeId,terminalId:e.terminalId,...e.workspaceId===void 0?{}:{workspaceId:e.workspaceId},afterSequence:o,readonly:!1,onFrame:m=>{if(!(T!==h||a)){if(m.type==="output")W(m.data,m.sequence);else if(m.type==="exit")e.onExited();else if(m.type==="error"){if(S(m.code))return;e.onErrorFrame(m.code)}}},onAttached:()=>{T===h&&M()},onDisconnected:m=>{T!==h||a||c||S(m)||y(!0)},signal:ve.signal});if(T!==h||a){z?.dispose();return}z===void 0?P(T):i=z}catch(z){if(T!==h||a)return;const m=z instanceof Yn?z.code:"TERMINAL_DIRECT_UNAVAILABLE";S(m)||P(T)}}function R(B){!d||a||(i!==void 0?i.send(B):t?.send(B))}function x(){a||c||y()}function O(){a=!0,h+=1,g(),_(),e.onReconnectStatus(void 0)}return{attach:y,send:R,reconnect:x,dispose:O}}const qh=["aria-label"],Vh={key:0,class:"admin-terminal-status",role:"status"},Yh=Mn({__name:"TerminalTabView",props:{terminalId:{},nodeId:{},direct:{},workspaceId:{},csrfToken:{},renewCsrfToken:{type:Function},windowsConPty:{type:Boolean},windowsBuildNumber:{},active:{type:Boolean},visible:{type:Boolean},fillAvailable:{type:Boolean}},emits:["exited","notice"],setup(e,{expose:t,emit:i}){const s=e,r=i,n=It(),o=It(),l=It(),h=It(),a={getBoundingClientRect:()=>new DOMRect(l.value?.x,l.value?.y)};let d,c,p,g,_,S=!1,D=!1;const M=Tn(Pn,void 0)??Vn({csrfToken:()=>s.csrfToken,renewCsrfToken:s.renewCsrfToken});let W;const P=Uh({terminalId:s.terminalId,nodeId:s.nodeId,...s.workspaceId===void 0?{}:{workspaceId:s.workspaceId},...s.direct===void 0?{}:{direct:s.direct},http:M,onAttached:()=>x(!0),onOutput:f=>c?.write(f),onExited:()=>r("exited",s.terminalId),onTerminalUnavailable:()=>r("exited",s.terminalId),onErrorFrame:f=>{f==="TERMINAL_FRAME_REJECTED"?W?.():c?.writeln(`\r
23
- [MyAgentRoam] ${f}`)},onReconnectStatus:f=>o.value=f});W=P.reconnect;function y(f){P.send(f)}function R(){const f=c,C=p;if(!s.active||!s.visible||f===void 0||C===void 0)return;const k={cols:f.cols,rows:f.rows};C.fit();const A={cols:f.cols,rows:f.rows};!D&&k.cols===A.cols&&k.rows===A.rows||(y({type:"resize",terminalId:s.terminalId,...A}),D=!1)}function x(f=!1){f&&(D=!0),_===void 0&&(_=window.requestAnimationFrame(()=>{_=void 0,R()}))}function O(){S=!0,di(()=>{c===void 0||!s.active||!s.visible||(c.focus(),S=!1)})}function B(){l.value=void 0,d?.(),d=void 0}function T(f){f.button===2&&f.stopPropagation()}function ve(f){const C=f.pointerType;f.button!==2||C!==void 0&&C!=="mouse"||(f.preventDefault(),f.stopPropagation(),c!==void 0&&(B(),l.value={x:f.clientX,y:f.clientY,selection:c.getSelection()},di(()=>{h.value&&(c?.focus(),h.value.handleOpen())}),d=$n.register({command:"terminal.dismissMenu",priority:150,scope:"terminal",keys:[{key:"Escape"}],when:()=>l.value!==void 0,execute:()=>(B(),c?.focus(),"HANDLED")})))}async function z(){const f=l.value?.selection;if(B(),c?.focus(),!!f)try{await navigator.clipboard.writeText(f)}catch{r("notice",ke("generated.terminalTabView.terminalCopyFailedCheckBrowserClipboardPermissions"),"error")}}async function m(){B();const f=c;if(f!==void 0){f.focus();try{const C=await navigator.clipboard.readText();c===f&&C!==""&&f.paste(C)}catch{r("notice",ke("generated.terminalTabView.terminalPasteFailedCheckClipboardPermissions"),"error")}}}function u(){B(),c?.clear(),c?.focus()}function w(){const f=Number(getComputedStyle(document.documentElement).getPropertyValue("--mar-terminal-font-size").trim());return Number.isFinite(f)&&f>0?f:12}function v(f,C){return getComputedStyle(document.documentElement).getPropertyValue(f).trim()||C}return An(()=>{n.value!==void 0&&(c=new Wh({allowProposedApi:!0,cursorBlink:!0,macOptionClickForcesSelection:!0,fontFamily:"SFMono-Regular, Consolas, monospace",fontSize:w(),cols:100,rows:18,...s.windowsConPty?{windowsPty:{backend:"conpty",...s.windowsBuildNumber===void 0?{}:{buildNumber:s.windowsBuildNumber}}}:{},theme:{background:v("--mar-terminal-background","#0e1116"),foreground:v("--mar-terminal-foreground","#e8eef8"),cursor:v("--mar-terminal-cursor","#37c8ff")}}),c.loadAddon(new ko),c.unicode.activeVersion="11",c.loadAddon(new Lo((f,C)=>{!f.ctrlKey&&!f.metaKey||window.open(C,"_blank","noopener,noreferrer")})),p=new Gn,c.loadAddon(p),c.open(n.value),S&&s.active&&s.visible&&(c.focus(),S=!1),c.onData(f=>y({type:"input",terminalId:s.terminalId,data:f})),n.value.addEventListener("mousedown",T,!0),n.value.addEventListener("contextmenu",ve,!0),g=new ResizeObserver(()=>x()),g.observe(n.value),R(),x(),P.attach())}),On(()=>[s.active,s.visible],([f,C])=>{(!f||!C)&&B(),f&&C&&di().then(()=>{x(),S&&O()})}),t({focus:O}),In(()=>{B(),P.dispose(),g?.disconnect(),_!==void 0&&window.cancelAnimationFrame(_),n.value!==void 0&&(n.value.removeEventListener("mousedown",T,!0),n.value.removeEventListener("contextmenu",ve,!0));const f=c;c=void 0,p=void 0,f?.dispose()}),(f,C)=>Nn((ui(),Ms("div",{class:Fn(["admin-terminal-body",{"fills-available":e.fillAvailable}])},[Wn("div",{ref_key:"host",ref:n,class:"xterm-host","aria-label":Be(ke)("generated.terminalTabView.terminalOutput"),tabindex:"0"},null,8,qh),o.value?(ui(),Ms("div",Vh,At(o.value),1)):Ts("",!0),l.value!==void 0?(ui(),zn(Be(qn),{key:1,ref_key:"menu",ref:h,"virtual-triggering":"","virtual-ref":a,trigger:"contextmenu",placement:"bottom-start",onVisibleChange:C[0]||(C[0]=k=>!k&&B())},{dropdown:_t(()=>[Ot(Be(Un),{"aria-label":Be(ke)("generated.terminalTabView.terminalOutput")},{default:_t(()=>[Ot(Be(fi),{disabled:!l.value.selection,icon:"copy",onClick:z},{default:_t(()=>[_i(At(Be(ke)("generated.terminalTabView.copy")),1)]),_:1},8,["disabled"]),Ot(Be(fi),{icon:"paste",onClick:m},{default:_t(()=>[_i(At(Be(ke)("generated.terminalTabView.paste")),1)]),_:1}),Ot(Be(fi),{divided:"",icon:"clear",onClick:u},{default:_t(()=>[_i(At(Be(ke)("generated.terminalTabView.clear")),1)]),_:1})]),_:1},8,["aria-label"])]),_:1},512)):Ts("",!0)],2)),[[Hn,e.active]])}}),Vc=Kn(Yh,[["__scopeId","data-v-ff804391"]]);export{Vc as default};
23
+ [MyAgentRoam] ${f}`)},onReconnectStatus:f=>o.value=f});W=P.reconnect;function y(f){P.send(f)}function R(){const f=c,C=p;if(!s.active||!s.visible||f===void 0||C===void 0)return;const k={cols:f.cols,rows:f.rows};C.fit();const A={cols:f.cols,rows:f.rows};!D&&k.cols===A.cols&&k.rows===A.rows||(y({type:"resize",terminalId:s.terminalId,...A}),D=!1)}function x(f=!1){f&&(D=!0),_===void 0&&(_=window.requestAnimationFrame(()=>{_=void 0,R()}))}function O(){S=!0,di(()=>{c===void 0||!s.active||!s.visible||(c.focus(),S=!1)})}function B(){l.value=void 0,d?.(),d=void 0}function T(f){f.button===2&&f.stopPropagation()}function ve(f){const C=f.pointerType;f.button!==2||C!==void 0&&C!=="mouse"||(f.preventDefault(),f.stopPropagation(),c!==void 0&&(B(),l.value={x:f.clientX,y:f.clientY,selection:c.getSelection()},di(()=>{h.value&&(c?.focus(),h.value.handleOpen())}),d=$n.register({command:"terminal.dismissMenu",priority:150,scope:"terminal",keys:[{key:"Escape"}],when:()=>l.value!==void 0,execute:()=>(B(),c?.focus(),"HANDLED")})))}async function z(){const f=l.value?.selection;if(B(),c?.focus(),!!f)try{await navigator.clipboard.writeText(f)}catch{r("notice",ke("generated.terminalTabView.terminalCopyFailedCheckBrowserClipboardPermissions"),"error")}}async function m(){B();const f=c;if(f!==void 0){f.focus();try{const C=await navigator.clipboard.readText();c===f&&C!==""&&f.paste(C)}catch{r("notice",ke("generated.terminalTabView.terminalPasteFailedCheckClipboardPermissions"),"error")}}}function u(){B(),c?.clear(),c?.focus()}function w(){const f=Number(getComputedStyle(document.documentElement).getPropertyValue("--mar-terminal-font-size").trim());return Number.isFinite(f)&&f>0?f:12}function v(f,C){return getComputedStyle(document.documentElement).getPropertyValue(f).trim()||C}return An(()=>{n.value!==void 0&&(c=new Wh({allowProposedApi:!0,cursorBlink:!0,macOptionClickForcesSelection:!0,fontFamily:"SFMono-Regular, Consolas, monospace",fontSize:w(),cols:100,rows:18,...s.windowsConPty?{windowsPty:{backend:"conpty",...s.windowsBuildNumber===void 0?{}:{buildNumber:s.windowsBuildNumber}}}:{},theme:{background:v("--mar-terminal-background","#0e1116"),foreground:v("--mar-terminal-foreground","#e8eef8"),cursor:v("--mar-terminal-cursor","#37c8ff")}}),c.loadAddon(new ko),c.unicode.activeVersion="11",c.loadAddon(new Lo((f,C)=>{!f.ctrlKey&&!f.metaKey||window.open(C,"_blank","noopener,noreferrer")})),p=new Gn,c.loadAddon(p),c.open(n.value),S&&s.active&&s.visible&&(c.focus(),S=!1),c.onData(f=>y({type:"input",terminalId:s.terminalId,data:f})),n.value.addEventListener("mousedown",T,!0),n.value.addEventListener("contextmenu",ve,!0),g=new ResizeObserver(()=>x()),g.observe(n.value),R(),x(),P.attach())}),On(()=>[s.active,s.visible],([f,C])=>{(!f||!C)&&B(),f&&C&&di().then(()=>{x(),S&&O()})}),t({focus:O}),In(()=>{B(),P.dispose(),g?.disconnect(),_!==void 0&&window.cancelAnimationFrame(_),n.value!==void 0&&(n.value.removeEventListener("mousedown",T,!0),n.value.removeEventListener("contextmenu",ve,!0));const f=c;c=void 0,p=void 0,f?.dispose()}),(f,C)=>Nn((ui(),Ms("div",{class:Fn(["admin-terminal-body",{"fills-available":e.fillAvailable}])},[Wn("div",{ref_key:"host",ref:n,class:"xterm-host","aria-label":Be(ke)("generated.terminalTabView.terminalOutput"),tabindex:"0"},null,8,qh),o.value?(ui(),Ms("div",Vh,At(o.value),1)):Ts("",!0),l.value!==void 0?(ui(),zn(Be(qn),{key:1,ref_key:"menu",ref:h,"virtual-triggering":"","virtual-ref":a,trigger:"contextmenu",placement:"bottom-start",onVisibleChange:C[0]||(C[0]=k=>!k&&B())},{dropdown:_t(()=>[Ot(Be(Un),{"aria-label":Be(ke)("generated.terminalTabView.terminalOutput")},{default:_t(()=>[Ot(Be(fi),{disabled:!l.value.selection,icon:"copy",onClick:z},{default:_t(()=>[_i(At(Be(ke)("generated.terminalTabView.copy")),1)]),_:1},8,["disabled"]),Ot(Be(fi),{icon:"paste",onClick:m},{default:_t(()=>[_i(At(Be(ke)("generated.terminalTabView.paste")),1)]),_:1}),Ot(Be(fi),{divided:"",icon:"clear",onClick:u},{default:_t(()=>[_i(At(Be(ke)("generated.terminalTabView.clear")),1)]),_:1})]),_:1},8,["aria-label"])]),_:1},512)):Ts("",!0)],2)),[[Hn,e.active]])}}),Yc=Kn(Yh,[["__scopeId","data-v-ff804391"]]);export{Yc as default};