@inkeep/open-knowledge 0.46.1 → 0.47.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (315) hide show
  1. package/dist/{acp-harness-probe-B8KBrE_r.mjs → acp-harness-probe-OOqhJYkA.mjs} +2 -2
  2. package/dist/cli.mjs +6 -6
  3. package/dist/constants-DoQnHGhM.mjs +2 -0
  4. package/dist/index.mjs +1 -1
  5. package/dist/{init-BcKhJRly.mjs → init-XQge-Dye.mjs} +3 -3
  6. package/dist/init-Y3Ee4Qri.mjs +1 -0
  7. package/dist/{launch-json-removal-hqrWgXgC.mjs → launch-json-removal-BHGCiUUm.mjs} +2 -2
  8. package/dist/{loader-Bs8gfRHb.mjs → loader-DNLU_zDg.mjs} +2 -2
  9. package/dist/loader-wZnCFuTj.mjs +1 -0
  10. package/dist/{preview-ChgpIO-Q.mjs → preview-CeEfl5CC.mjs} +2 -2
  11. package/dist/preview-DodRhg2O.mjs +1 -0
  12. package/dist/public/assets/{ActivityModeContent-P4Zf22Bs.js → ActivityModeContent-BsjKj2Dp.js} +1 -1
  13. package/dist/public/assets/{AgentDiffPane-DgyWl0LY.js → AgentDiffPane-8FeMlxNc.js} +2 -2
  14. package/dist/public/assets/{AgentThreadClientBinder-Ckvlex2J.js → AgentThreadClientBinder-DGuLR7_T.js} +1 -1
  15. package/dist/public/assets/{ChangedOutsideBadge-D93fNuY2.js → ChangedOutsideBadge-iFQrYC_j.js} +1 -1
  16. package/dist/public/assets/CodeMirrorPropInput-B6FJjE4p.js +3 -0
  17. package/dist/public/assets/{ConsentDialogBody-DMbx6HaH.js → ConsentDialogBody-CB447Y2k.js} +1 -1
  18. package/dist/public/assets/{DiffView-CiVa7sAS.js → DiffView-BBC1fcoF.js} +1 -1
  19. package/dist/public/assets/DocumentContext-DtWKWc6V.js +38 -0
  20. package/dist/public/assets/EditorModeToggle-B9w1EcVW.js +1 -0
  21. package/dist/public/assets/{EnableSyncConfirmDialog-Y6eOtuA3.js → EnableSyncConfirmDialog-C9Zj2o5B.js} +1 -1
  22. package/dist/public/assets/FeedbackForm-MjJfwT3F.js +1 -0
  23. package/dist/public/assets/{GraphPanel-B86tFg1O.js → GraphPanel-WAn3iep6.js} +1 -1
  24. package/dist/public/assets/{ImportSkillDialog-B9pptBBF.js → ImportSkillDialog-BT12LF7o.js} +1 -1
  25. package/dist/public/assets/{LintConfigEditor-szKF5akG.js → LintConfigEditor-fuqihOSh.js} +1 -1
  26. package/dist/public/assets/ManagedArtifactProperties-TvpPVnSJ.js +1 -0
  27. package/dist/public/assets/{ManagedArtifactProperties-CQnVDYPq.js → ManagedArtifactProperties-aEllvXPH.js} +4 -4
  28. package/dist/public/assets/{McpConsentDialogBody-BBhAuTgG.js → McpConsentDialogBody-D399lgb6.js} +1 -1
  29. package/dist/public/assets/{Mermaid-C8gHr0W4.js → Mermaid-BePjlqwg.js} +2 -2
  30. package/dist/public/assets/{MermaidDocEditor-DGoGFr6Q.js → MermaidDocEditor-Btncic6F.js} +1 -1
  31. package/dist/public/assets/{RegisteredAgentIcon-DGE6x9DL.js → RegisteredAgentIcon-H3tp7x07.js} +1 -1
  32. package/dist/public/assets/{ReportBugDialogBody-B6j0kF-R.js → ReportBugDialogBody-DMJRqZYG.js} +1 -1
  33. package/dist/public/assets/{SchemaConfigEditor-Bnk4NtZu.js → SchemaConfigEditor-CJxPYFfH.js} +1 -1
  34. package/dist/public/assets/{SessionsHost-nrZvn3uC.js → SessionsHost-DjUsH4OV.js} +2 -2
  35. package/dist/public/assets/SettingsDialogBody-BlqFfFZF.js +12 -0
  36. package/dist/public/assets/{ShareBranchSwitchDialog-BiIfLaYp.js → ShareBranchSwitchDialog-CqdCfvTW.js} +1 -1
  37. package/dist/public/assets/{ShareReceiveDialog-B-mxBzuJ.js → ShareReceiveDialog-C07-MMeb.js} +1 -1
  38. package/dist/public/assets/{ShareReceiveMissDialog-D9FD0Tp2.js → ShareReceiveMissDialog-B28LUAEG.js} +1 -1
  39. package/dist/public/assets/{SkillEditBanner-C8rnPcWM.js → SkillEditBanner-D54IcYm9.js} +1 -1
  40. package/dist/public/assets/{SkillOriginInline-Dvm4Mn15.js → SkillOriginInline-CaPLAC2_.js} +1 -1
  41. package/dist/public/assets/{SkillToolbarControls-DHRQ4dll.js → SkillToolbarControls-np0Ok_xI.js} +1 -1
  42. package/dist/public/assets/{SourceEditor-aduzr_jn.js → SourceEditor-CGoHkzWL.js} +1 -1
  43. package/dist/public/assets/{TerminalPanel-CEFylp9e.js → TerminalPanel-BShIp-v4.js} +1 -1
  44. package/dist/public/assets/{TerminalWindowApp-bYE3Rjzk.js → TerminalWindowApp-BxdCV4WQ.js} +1 -1
  45. package/dist/public/assets/{TextDocEditor-DVdcvFG6.js → TextDocEditor-N4-T0dws.js} +1 -1
  46. package/dist/public/assets/{ThreadView-C_yxiTQA.js → ThreadView-vuv4OflF.js} +1 -1
  47. package/dist/public/assets/{TimelineDiffPane-DxGmoF4_.js → TimelineDiffPane-CoNZWl8n.js} +2 -2
  48. package/dist/public/assets/{abnfDiagram-VRR7QNED-B-Hsu2U8.js → abnfDiagram-VRR7QNED-CR4UO3a9.js} +1 -1
  49. package/dist/public/assets/{agent-diff-store-Dm4Wpsrw.js → agent-diff-store-D8_4Cfah.js} +1 -1
  50. package/dist/public/assets/{agent-visibility-DvaU093e.js → agent-visibility-k-CBEP62.js} +1 -1
  51. package/dist/public/assets/{arc-CcVRsw3e.js → arc-BLA1oiJE.js} +1 -1
  52. package/dist/public/assets/architecture-TIHT7OUA-4xbw6BHT.js +1 -0
  53. package/dist/public/assets/{architectureDiagram-ZJ3FMSHR-C6jROBtt.js → architectureDiagram-ZJ3FMSHR-BzyE8ILE.js} +1 -1
  54. package/dist/public/assets/asset-dispatch-BOfThpQD.js +1 -0
  55. package/dist/public/assets/{auth-state-cache-CIkP8Gql.js → auth-state-cache-C4QFsqNn.js} +5 -5
  56. package/dist/public/assets/{blockDiagram-677ZJIJ3-yyYBekRI.js → blockDiagram-677ZJIJ3-BWKj-1q6.js} +1 -1
  57. package/dist/public/assets/{c4Diagram-LMCZKHZV-DO0A_X13.js → c4Diagram-LMCZKHZV-DrEdH4Bj.js} +1 -1
  58. package/dist/public/assets/{calendar-DWQCtEOX.js → calendar-DLNiQf9e.js} +1 -1
  59. package/dist/public/assets/channel-W8Wrr3Pm.js +1 -0
  60. package/dist/public/assets/chunk-2Q5K7J3B-CTVQtWlX.js +1 -0
  61. package/dist/public/assets/{chunk-32BRIVSS-Ck3g8u7E.js → chunk-32BRIVSS-BYVl5jAx.js} +1 -1
  62. package/dist/public/assets/{chunk-52WLFC77-DVv6iplK.js → chunk-52WLFC77-DaoBlZDo.js} +1 -1
  63. package/dist/public/assets/{chunk-5FCAYU7R-Bxw_oikr.js → chunk-5FCAYU7R-CVOgng3o.js} +1 -1
  64. package/dist/public/assets/{chunk-5HE753X5-DKXmxfLW.js → chunk-5HE753X5-CD6gRM54.js} +1 -1
  65. package/dist/public/assets/{chunk-5JV3BV7I-DvmJcvTR.js → chunk-5JV3BV7I-C7ouju6I.js} +1 -1
  66. package/dist/public/assets/{chunk-5TONJI2A-DzotvxWN.js → chunk-5TONJI2A-BKisaZuR.js} +1 -1
  67. package/dist/public/assets/{chunk-5VM5RSS4-BhXaeUUw.js → chunk-5VM5RSS4-DldpLG4q.js} +1 -1
  68. package/dist/public/assets/{chunk-7BUUIJ7U-nkQ2KUUq.js → chunk-7BUUIJ7U-B8p2bGIc.js} +1 -1
  69. package/dist/public/assets/{chunk-BIQX33UG-dgZifYB8.js → chunk-BIQX33UG-B-IlaACl.js} +1 -1
  70. package/dist/public/assets/{chunk-BO2N2NFS-B0J40ekd.js → chunk-BO2N2NFS-ic3Vmg5d.js} +3 -3
  71. package/dist/public/assets/{chunk-C7G6YPKG-C40XIv2l.js → chunk-C7G6YPKG-P_jPwciU.js} +1 -1
  72. package/dist/public/assets/{chunk-CQNSW5MT-WJU8lHxD.js → chunk-CQNSW5MT-BoHYZDmN.js} +1 -1
  73. package/dist/public/assets/{chunk-CYSBUYHQ-5BxfdOgL.js → chunk-CYSBUYHQ-BtnyZlJv.js} +1 -1
  74. package/dist/public/assets/{chunk-EMLP6XTP-mSjYkSCS.js → chunk-EMLP6XTP-D_CFM3mi.js} +1 -1
  75. package/dist/public/assets/{chunk-EX3LRPZG-Cv2nD836.js → chunk-EX3LRPZG-ClnlXkCf.js} +1 -1
  76. package/dist/public/assets/{chunk-FWX5IMBZ-0vkTsm8B.js → chunk-FWX5IMBZ-FFK1ngmB.js} +2 -2
  77. package/dist/public/assets/{chunk-HOUHSVGY-CrcWOmF4.js → chunk-HOUHSVGY-BWwdD6sU.js} +1 -1
  78. package/dist/public/assets/{chunk-ICXQ74PX-cYUXxotj.js → chunk-ICXQ74PX-MYNcPnbp.js} +1 -1
  79. package/dist/public/assets/{chunk-JG7HCLWE-ClAPLVoN.js → chunk-JG7HCLWE-jpq6rFyK.js} +1 -1
  80. package/dist/public/assets/{chunk-JWPE2WC7-D00QuO4l.js → chunk-JWPE2WC7-BUo8MoXj.js} +1 -1
  81. package/dist/public/assets/{chunk-MOJQB5TN-FM9WIXNu.js → chunk-MOJQB5TN-CWrsqiJp.js} +1 -1
  82. package/dist/public/assets/{chunk-MOZMSUNE-B2zrwpvW.js → chunk-MOZMSUNE-bwYn0Kww.js} +1 -1
  83. package/dist/public/assets/{chunk-OGEWGWER-DJJJDryE.js → chunk-OGEWGWER-CPRvTjbs.js} +1 -1
  84. package/dist/public/assets/{chunk-OSBZ3O6U-pMDQqwwa.js → chunk-OSBZ3O6U-CUc7n3PO.js} +1 -1
  85. package/dist/public/assets/{chunk-PUDLZKDR-Bx2tvOGW.js → chunk-PUDLZKDR-DYRvIzSN.js} +1 -1
  86. package/dist/public/assets/{chunk-Q4XR5HBZ-CG_19xFl.js → chunk-Q4XR5HBZ-C1-YIhba.js} +1 -1
  87. package/dist/public/assets/{chunk-QBLGF6JB-gQMNwA9k.js → chunk-QBLGF6JB-DOtavLb0.js} +1 -1
  88. package/dist/public/assets/{chunk-R7FJI6CG-4qEQ9dBZ.js → chunk-R7FJI6CG-CWhtEDe1.js} +1 -1
  89. package/dist/public/assets/{chunk-RYQCIY6F-BV0ikdQB.js → chunk-RYQCIY6F-D8KQw2wV.js} +1 -1
  90. package/dist/public/assets/{chunk-U6XO7XAA-CaNmcaAV.js → chunk-U6XO7XAA-CMfN73K7.js} +1 -1
  91. package/dist/public/assets/{chunk-V7JOEXUC-DkADS7wC.js → chunk-V7JOEXUC-pOJltdgR.js} +1 -1
  92. package/dist/public/assets/chunk-VAUOI2AC-DXm68bP_.js +1 -0
  93. package/dist/public/assets/{chunk-VR4S4FIN-Bv419WM_.js → chunk-VR4S4FIN-DZW_5hST.js} +1 -1
  94. package/dist/public/assets/{chunk-WYO6CB5R-wjTAft84.js → chunk-WYO6CB5R-CALegXxo.js} +1 -1
  95. package/dist/public/assets/chunk-XXDRQBXY-AFNsmOQr.js +1 -0
  96. package/dist/public/assets/{chunk-YOTPTUD7-NNZ-Yv3s.js → chunk-YOTPTUD7-DzE2J0ru.js} +1 -1
  97. package/dist/public/assets/{chunk-ZGVPDNZ5-Cf5jCsqQ.js → chunk-ZGVPDNZ5-gA_FvYeM.js} +1 -1
  98. package/dist/public/assets/{chunk-ZIRB5QZD-BUzL4gtl.js → chunk-ZIRB5QZD-DTzEX6O5.js} +1 -1
  99. package/dist/public/assets/classDiagram-OUVF2IWQ-Cw2xj9dC.js +1 -0
  100. package/dist/public/assets/classDiagram-v2-EOCWNBFH-BizmfFXw.js +1 -0
  101. package/dist/public/assets/client-version-CwCARyxk.js +1 -0
  102. package/dist/public/assets/{config-context-CYNq8R6z.js → config-context-BzGTI1i6.js} +1 -1
  103. package/dist/public/assets/{config-provider-CswKxDa9.js → config-provider-DAkovZnw.js} +2 -2
  104. package/dist/public/assets/{cose-bilkent-JH36ORCC-C3tuxXMJ.js → cose-bilkent-JH36ORCC-Dfdgm0c_.js} +1 -1
  105. package/dist/public/assets/cynefin-VYW2F7L2-PIqjqGI8.js +1 -0
  106. package/dist/public/assets/{cynefinDiagram-TSTJHNR4-CMg45ySU.js → cynefinDiagram-TSTJHNR4-Cw46kgPb.js} +1 -1
  107. package/dist/public/assets/{dagre-DqpVUR-3.js → dagre-Bx2kZZfx.js} +1 -1
  108. package/dist/public/assets/{dagre-VKFMJZFB-CkNYafd4.js → dagre-VKFMJZFB-BZXSt5WP.js} +1 -1
  109. package/dist/public/assets/{diagram-FQU43EPY-B2SsGWrj.js → diagram-FQU43EPY-d7V3h8SU.js} +1 -1
  110. package/dist/public/assets/{diagram-G47NLZAW-142J0nHM.js → diagram-G47NLZAW-UEIcjgnl.js} +1 -1
  111. package/dist/public/assets/{diagram-NH7WQ7WH-hfvzJwgi.js → diagram-NH7WQ7WH-VelQiPV8.js} +1 -1
  112. package/dist/public/assets/{diagram-OA4YK3LP-Cv_wiwAo.js → diagram-OA4YK3LP-DSOrpt5z.js} +1 -1
  113. package/dist/public/assets/{diagram-WEI45ONY-BQWeZ_gs.js → diagram-WEI45ONY-C2KGJAjs.js} +1 -1
  114. package/dist/public/assets/{dist-DmGGmoBk.js → dist-2Zg1mqwY.js} +1 -1
  115. package/dist/public/assets/{dist-OxboORfH2.js → dist-BqtkiFoE2.js} +1 -1
  116. package/dist/public/assets/{dist-DZPs1bpg.js → dist-CZG2zXVq.js} +1 -1
  117. package/dist/public/assets/{doc-paths-lZOQ-mhw.js → doc-paths-DoYUYB8x.js} +1 -1
  118. package/dist/public/assets/{documents-events-5TI0rZAg.js → documents-events-D-wbjalg.js} +1 -1
  119. package/dist/public/assets/{ebnfDiagram-CCIWWBDH-DS27r0Ib.js → ebnfDiagram-CCIWWBDH-ZrmzNbWG.js} +1 -1
  120. package/dist/public/assets/{erDiagram-Q63AITRT-BLzlnkkh.js → erDiagram-Q63AITRT-BBTP0qHZ.js} +1 -1
  121. package/dist/public/assets/eventmodeling-45OFAUF4-BXfoXwmF.js +1 -0
  122. package/dist/public/assets/{file-tree-adapter-CS4JuYT3.js → file-tree-adapter-BnupHYtj.js} +1 -1
  123. package/dist/public/assets/{file-tree-utils-BuCXRlpH.js → file-tree-utils-B1hGkjTf.js} +1 -1
  124. package/dist/public/assets/flowDiagram-23GEKE2U-BmjC2t41.js +1 -0
  125. package/dist/public/assets/{folder-config-api-BSMImK4t.js → folder-config-api-CMh_Htev.js} +1 -1
  126. package/dist/public/assets/{ganttDiagram-NO4QXBWP-BD2OT58K.js → ganttDiagram-NO4QXBWP-BNFd_PNq.js} +1 -1
  127. package/dist/public/assets/gitGraph-TEB2WS4Q-CO_Nyook.js +1 -0
  128. package/dist/public/assets/{gitGraphDiagram-IHSO6WYX-zFu0tjCE.js → gitGraphDiagram-IHSO6WYX-Bh6zKfrc.js} +1 -1
  129. package/dist/public/assets/globals-BhZJ5T7E.css +1 -0
  130. package/dist/public/assets/{globals-BJVupD3F.js → globals-DAQcZTzX.js} +1 -1
  131. package/dist/public/assets/{graphlib-2mbBufU8.js → graphlib-BIjbwrWA.js} +1 -1
  132. package/dist/public/assets/{highlighted-body-OFNGDK62-BeWSMKRO.js → highlighted-body-OFNGDK62-Bk6-lgsP.js} +1 -1
  133. package/dist/public/assets/index-DPYFSa8u.js +2092 -0
  134. package/dist/public/assets/info-DKCQHKI2-Qu4WNhHa.js +1 -0
  135. package/dist/public/assets/{infoDiagram-FWYZ7A6U-CTQvtDdc.js → infoDiagram-FWYZ7A6U-BEVnShNr.js} +1 -1
  136. package/dist/public/assets/{input-group-DY7bardr.js → input-group-cP5PCk_d.js} +1 -1
  137. package/dist/public/assets/{ishikawaDiagram-FXEZZL3T-BxidjLGu.js → ishikawaDiagram-FXEZZL3T-3BFj-gt2.js} +1 -1
  138. package/dist/public/assets/{journeyDiagram-5HDEW3XC-f837Id0b.js → journeyDiagram-5HDEW3XC-DZXVJa-m.js} +1 -1
  139. package/dist/public/assets/{kanban-definition-HUTT4EX6-pZrNLngz.js → kanban-definition-HUTT4EX6-ZEJY2PY6.js} +1 -1
  140. package/dist/public/assets/{line-4tSH7O72.js → line-CBrFSVI1.js} +1 -1
  141. package/dist/public/assets/{linear-dbIThZWJ.js → linear-HAqJanW2.js} +1 -1
  142. package/dist/public/assets/{lint-config-client-CGN8hOQ_.js → lint-config-client-CKUe53Ux.js} +1 -1
  143. package/dist/public/assets/{map-DCuMc749.js → map-CUyVBcsz.js} +1 -1
  144. package/dist/public/assets/{markdownlint-rule-browser-e3ebEcXi.js → markdownlint-rule-browser-B-cbNggE.js} +1 -1
  145. package/dist/public/assets/mermaid-GHXKKRXX-D5iPyEgH.js +1 -0
  146. package/dist/public/assets/{mermaid-parser.core-B2uYfibA.js → mermaid-parser.core-CAIoUhyF.js} +2 -2
  147. package/dist/public/assets/{mermaid.core-CZq7brUh.js → mermaid.core-BSPhkPvD.js} +3 -3
  148. package/dist/public/assets/{mindmap-definition-LN4V7U3C-Bhch18ge.js → mindmap-definition-LN4V7U3C-d7Yar9sd.js} +1 -1
  149. package/dist/public/assets/{navigation-targets-GzXvLoSC.js → navigation-targets-WVfDNB_X.js} +1 -1
  150. package/dist/public/assets/{now-D9M3Ys6o.js → now-DrceMm81.js} +1 -1
  151. package/dist/public/assets/{open-managed-artifact-tab-DPgcfh47.js → open-managed-artifact-tab-LHp8L5oX.js} +1 -1
  152. package/dist/public/assets/{ordinal-DdrNAXbu.js → ordinal-DOdOZcEj.js} +1 -1
  153. package/dist/public/assets/packet-7NZHBO7P-DYoxmend.js +1 -0
  154. package/dist/public/assets/{pegDiagram-2B236MQR-DbrH4tbY.js → pegDiagram-2B236MQR-CEUK_J9s.js} +1 -1
  155. package/dist/public/assets/{pending-receive-nav-store-i-NLrIMI.js → pending-receive-nav-store-B23Cw9B-.js} +1 -1
  156. package/dist/public/assets/pie-RZYD4A2V-C5oywqmk.js +1 -0
  157. package/dist/public/assets/{pieDiagram-ENE6RG2P-CmHGL3M_.js → pieDiagram-ENE6RG2P-BKd67Ppo.js} +1 -1
  158. package/dist/public/assets/{prop-types-ZLa1Cj_J.js → prop-types-CoFeckWu.js} +1 -1
  159. package/dist/public/assets/{quadrantDiagram-ABIIQ3AL-DPOe3nov.js → quadrantDiagram-ABIIQ3AL-GOJ4Ru_Z.js} +1 -1
  160. package/dist/public/assets/radar-I7S5WNFK-adGffv9k.js +1 -0
  161. package/dist/public/assets/railroad-3IZDKUUU-D4AY10Mc.js +1 -0
  162. package/dist/public/assets/railroad-abnf-AHOZXSZD-CSShZExy.js +1 -0
  163. package/dist/public/assets/railroad-ebnf-EBAXGLYW-Dl_rhwOm.js +1 -0
  164. package/dist/public/assets/railroad-peg-LSFZ7HO6-B2JvE7nW.js +1 -0
  165. package/dist/public/assets/{railroadDiagram-RFXS5EU6-gxbbqbuA.js → railroadDiagram-RFXS5EU6-hbmjTFrg.js} +1 -1
  166. package/dist/public/assets/{receive-store-Cb5HQu8u.js → receive-store-DioA0dZX.js} +1 -1
  167. package/dist/public/assets/{requirementDiagram-TGXJPOKE-CME9iG8Q.js → requirementDiagram-TGXJPOKE-BiEasTaW.js} +1 -1
  168. package/dist/public/assets/{sankeyDiagram-HTMAVEWB-C5P95jl4.js → sankeyDiagram-HTMAVEWB-DgAnFftC.js} +1 -1
  169. package/dist/public/assets/{selection-context-FnWC5AlG.js → selection-context-Dof8jCKa.js} +1 -1
  170. package/dist/public/assets/{sequenceDiagram-DBY2YBRQ-ClP7hUv6.js → sequenceDiagram-DBY2YBRQ-CTQ250gM.js} +1 -1
  171. package/dist/public/assets/{sizeCapture-X5ZJPWSS-CyNe-U3Z.js → sizeCapture-X5ZJPWSS-CdOK33Lp.js} +1 -1
  172. package/dist/public/assets/{skill-actions-WkDFXDFg.js → skill-actions-BGPeKm35.js} +1 -1
  173. package/dist/public/assets/{skill-scope-CmujX5gW.js → skill-scope-mciGgli7.js} +1 -1
  174. package/dist/public/assets/{skills-api-BeHeMfn9.js → skills-api-BCwis81Y.js} +1 -1
  175. package/dist/public/assets/{src-DFZupjZD.js → src-CprZUkQE.js} +1 -1
  176. package/dist/public/assets/{src-1YTF45Kf.js → src-otYw9bF5.js} +1 -1
  177. package/dist/public/assets/{stateDiagram-2N3HPSRC-H7xlP5BG.js → stateDiagram-2N3HPSRC-XnGXamTb.js} +1 -1
  178. package/dist/public/assets/stateDiagram-v2-6OUMAXLB-DSmEVntN.js +1 -0
  179. package/dist/public/assets/{swimlanes-5IMT3BWC-CFvQZ9jo.js → swimlanes-5IMT3BWC-DoENgZhK.js} +2 -2
  180. package/dist/public/assets/swimlanesDiagram-G3AALYLV-BDr_w1kf.js +8 -0
  181. package/dist/public/assets/{tag-pill-input-BxhZvyYn.js → tag-pill-input-BG-0qGDI.js} +1 -1
  182. package/dist/public/assets/{target-navigation-intent-DlmK2vet.js → target-navigation-intent-Dsxw_-u4.js} +1 -1
  183. package/dist/public/assets/{telemetry-impl-BpDC6QhK.js → telemetry-impl-DbCWmxd-.js} +2 -2
  184. package/dist/public/assets/{telemetry-startup-dyyrcPJo.js → telemetry-startup-CwzbE1L1.js} +1 -1
  185. package/dist/public/assets/{terminal-launch-events-ZIBZgD5h.js → terminal-launch-events-CVi1Y914.js} +1 -1
  186. package/dist/public/assets/{terminal-telemetry-DMiIrvfF.js → terminal-telemetry-Co-_es1q.js} +1 -1
  187. package/dist/public/assets/{text-viewer-languages-Dz-aerrJ.js → text-viewer-languages-BZtGVaBl.js} +2 -2
  188. package/dist/public/assets/{timeline-definition-FHXFAJF6-DuxF9bK8.js → timeline-definition-FHXFAJF6-Dz7EyUrw.js} +1 -1
  189. package/dist/public/assets/treeView-QDETBFTQ-qMpkjbKi.js +1 -0
  190. package/dist/public/assets/treemap-6X3UGDF4-BW1Uc-Dj.js +1 -0
  191. package/dist/public/assets/{typing-burst-detector-BmD9Pa7E.js → typing-burst-detector-QhbUz0KI.js} +3 -3
  192. package/dist/public/assets/{uninstall-D5OFbWn8.js → uninstall-D8EeYjNd.js} +1 -1
  193. package/dist/public/assets/{use-activity-panel-GOEuTVxn.js → use-activity-panel-BP2jMJSo.js} +1 -1
  194. package/dist/public/assets/{use-collab-url-DbL0dgXV.js → use-collab-url-CPBFUo6-.js} +1 -1
  195. package/dist/public/assets/{use-live-xterm-theme-CU7K2653.js → use-live-xterm-theme-C0oqpg5T.js} +1 -1
  196. package/dist/public/assets/{use-open-skill-HTbCYiG5.js → use-open-skill-s-eClkKp.js} +1 -1
  197. package/dist/public/assets/{use-settings-route-CIJMHLaP.js → use-settings-route-B0zt3SsC.js} +1 -1
  198. package/dist/public/assets/{use-skill-directory-GoiBc97k.js → use-skill-directory-B26V0_k7.js} +1 -1
  199. package/dist/public/assets/{use-skill-origin-CtNcPG-J.js → use-skill-origin-BvDx434L.js} +1 -1
  200. package/dist/public/assets/{use-skills-C2EtCeGb.js → use-skills-CJcOuHij.js} +1 -1
  201. package/dist/public/assets/{use-terminal-enabled-DjQLaUqK.js → use-terminal-enabled-Cfo3YlOk.js} +1 -1
  202. package/dist/public/assets/{use-timeline-entry-diff-DxzRyFwn.js → use-timeline-entry-diff-Bj1P5iQG.js} +2 -2
  203. package/dist/public/assets/{use-workspace-C_kPbTuK.js → use-workspace-DTXZHJjI.js} +1 -1
  204. package/dist/public/assets/{vennDiagram-L72KCM5P-kBkboAg8.js → vennDiagram-L72KCM5P-CSiYKx1Y.js} +1 -1
  205. package/dist/public/assets/wardley-OPB4EBWU-BBZU6-hF.js +1 -0
  206. package/dist/public/assets/{wardleyDiagram-EHGQE667-C34xhxMT.js → wardleyDiagram-EHGQE667-CGZiBV3f.js} +1 -1
  207. package/dist/public/assets/{xychartDiagram-FW5EYKEG-BnoU9iP7.js → xychartDiagram-FW5EYKEG-CQtMPqdH.js} +1 -1
  208. package/dist/public/index.html +69 -68
  209. package/dist/public/uninstall.html +5 -5
  210. package/dist/{repair-launch-json-DFkLlCcn.mjs → repair-launch-json-D6l8aL_D.mjs} +2 -2
  211. package/dist/{repair-mcp-configs-1Gs_T5uk.mjs → repair-mcp-configs-ichif-Bk.mjs} +2 -2
  212. package/dist/{src-kAp1dMlE.mjs → src-CQgwa7f6.mjs} +2 -2
  213. package/dist/start-CN-_ICe7.mjs +1 -0
  214. package/dist/{start-BaTt0PpQ.mjs → start-DAjONYhR.mjs} +2 -2
  215. package/package.json +4 -4
  216. package/dist/constants-COXG0KEe.mjs +0 -2
  217. package/dist/init-uDmNV6NB.mjs +0 -1
  218. package/dist/loader-DSabN0_5.mjs +0 -1
  219. package/dist/preview-UpyQLH_S.mjs +0 -1
  220. package/dist/public/assets/CodeMirrorPropInput-DTaNg1-M.js +0 -3
  221. package/dist/public/assets/DocumentContext-UuXLA8HR.js +0 -38
  222. package/dist/public/assets/EditorModeToggle-D2R5Cpw-.js +0 -1
  223. package/dist/public/assets/FeedbackForm-CLVnd8qb.js +0 -1
  224. package/dist/public/assets/ManagedArtifactProperties-yxP1OknU.js +0 -1
  225. package/dist/public/assets/SettingsDialogBody-DHPy1zCt.js +0 -12
  226. package/dist/public/assets/architecture-TIHT7OUA-B22-UzyM.js +0 -1
  227. package/dist/public/assets/channel-DVr-pv9-.js +0 -1
  228. package/dist/public/assets/chunk-2Q5K7J3B-BSFIGC1j.js +0 -1
  229. package/dist/public/assets/chunk-VAUOI2AC-C99Jiie0.js +0 -1
  230. package/dist/public/assets/chunk-XXDRQBXY-BW_2kVvu.js +0 -1
  231. package/dist/public/assets/classDiagram-OUVF2IWQ-BKc7UjOx.js +0 -1
  232. package/dist/public/assets/classDiagram-v2-EOCWNBFH-qSxpk71z.js +0 -1
  233. package/dist/public/assets/client-version-BvwEFzN3.js +0 -1
  234. package/dist/public/assets/cynefin-VYW2F7L2-g7Kr3o9e.js +0 -1
  235. package/dist/public/assets/eventmodeling-45OFAUF4-DdR7ha8I.js +0 -1
  236. package/dist/public/assets/flowDiagram-23GEKE2U-DCmKk_7R.js +0 -1
  237. package/dist/public/assets/gitGraph-TEB2WS4Q-B9_Hbzw_.js +0 -1
  238. package/dist/public/assets/globals-D2Eeh2Jk.css +0 -1
  239. package/dist/public/assets/index-BG8TFON5.js +0 -2092
  240. package/dist/public/assets/info-DKCQHKI2-BQeDe2mR.js +0 -1
  241. package/dist/public/assets/mermaid-GHXKKRXX-BkgsygpQ.js +0 -1
  242. package/dist/public/assets/packet-7NZHBO7P-BW9abikZ.js +0 -1
  243. package/dist/public/assets/pie-RZYD4A2V-D86NaVqt.js +0 -1
  244. package/dist/public/assets/radar-I7S5WNFK-DQAd0dLq.js +0 -1
  245. package/dist/public/assets/railroad-3IZDKUUU-BpjxCYYP.js +0 -1
  246. package/dist/public/assets/railroad-abnf-AHOZXSZD-BVzINhcN.js +0 -1
  247. package/dist/public/assets/railroad-ebnf-EBAXGLYW-FAz3aWnD.js +0 -1
  248. package/dist/public/assets/railroad-peg-LSFZ7HO6-Smtu6BYl.js +0 -1
  249. package/dist/public/assets/stateDiagram-v2-6OUMAXLB-dPabCaIp.js +0 -1
  250. package/dist/public/assets/swimlanesDiagram-G3AALYLV-DKX_e8Tg.js +0 -8
  251. package/dist/public/assets/treeView-QDETBFTQ-BgORrhQ0.js +0 -1
  252. package/dist/public/assets/treemap-6X3UGDF4-Zr5ZEdj0.js +0 -1
  253. package/dist/public/assets/wardley-OPB4EBWU-WeTAUrVk.js +0 -1
  254. package/dist/start-CyDzFb-o.mjs +0 -1
  255. /package/dist/public/assets/{ActivityPanelDiffView-DzcGG-3T.js → ActivityPanelDiffView-BXFg3amj.js} +0 -0
  256. /package/dist/public/assets/{AppMenubar-DNxr0ep-.js → AppMenubar-ORka9Zwj.js} +0 -0
  257. /package/dist/public/assets/{BugReportHistoryDialog-CGfQFtoC.js → BugReportHistoryDialog-BdXwvet_.js} +0 -0
  258. /package/dist/public/assets/{SkillModeBanner-BGvDA8_3.js → SkillModeBanner-BPmqGiVe.js} +0 -0
  259. /package/dist/public/assets/{__vite-browser-external-DRftbq1J.js → __vite-browser-external-CVGzy5OC.js} +0 -0
  260. /package/dist/public/assets/{agent-presence-DspgbUIJ.js → agent-presence-Dn2bQ2Pn.js} +0 -0
  261. /package/dist/public/assets/{array-BlR6RSqS.js → array-CxykTcx8.js} +0 -0
  262. /package/dist/public/assets/{auth-prompt-store-QZM88i3o.js → auth-prompt-store-CeUwLE3s.js} +0 -0
  263. /package/dist/public/assets/{chunk-KEIR6QF5-Cvu_RfZc.js → chunk-KEIR6QF5-DQW1nIEN.js} +0 -0
  264. /package/dist/public/assets/{chunk-Y2CYZVJY-BavonG01.js → chunk-Y2CYZVJY-Dp_m2dHs.js} +0 -0
  265. /package/dist/public/assets/{clike-BTKURkAr.js → clike-D2Qtyj0W.js} +0 -0
  266. /package/dist/public/assets/{clipboard-adapter-DdkYoUY3.js → clipboard-adapter-Brbch5VX.js} +0 -0
  267. /package/dist/public/assets/{colors-DThYSuj1.js → colors-DxV0gzKw.js} +0 -0
  268. /package/dist/public/assets/{copilot-CYbxld_I.js → copilot-_tsUyzgD.js} +0 -0
  269. /package/dist/public/assets/{cursor-CVuYJhcM.js → cursor-D_UKSHL6.js} +0 -0
  270. /package/dist/public/assets/{cytoscape.esm-CcKBPOPz.js → cytoscape.esm-Yabh0yK_.js} +0 -0
  271. /package/dist/public/assets/{defaultLocale-Bj1aksfd.js → defaultLocale-BwEiHuJD.js} +0 -0
  272. /package/dist/public/assets/{diff-CC9Zbhye.js → diff-Dke_3Gcp.js} +0 -0
  273. /package/dist/public/assets/{dist-EGYq-imk.js → dist-BSFcbUmR.js} +0 -0
  274. /package/dist/public/assets/{dist-CRdXWGYm.js → dist-BpT9gASx.js} +0 -0
  275. /package/dist/public/assets/{dist-DXP0VKAj.js → dist-ButMY3R3.js} +0 -0
  276. /package/dist/public/assets/{dist-CublDHOR.js → dist-CPBLOoKm.js} +0 -0
  277. /package/dist/public/assets/{dist-BKO-SihH.js → dist-yoZDDKeY.js} +0 -0
  278. /package/dist/public/assets/{follow-file-gtzc5aQE.js → follow-file-B9Rl63vu.js} +0 -0
  279. /package/dist/public/assets/{form-bYI7kbg1.js → form-DJq6IJkN.js} +0 -0
  280. /package/dist/public/assets/{format-B72MB8qy.js → format-DAPkd5Gj.js} +0 -0
  281. /package/dist/public/assets/{go-BOoSlAXr.js → go-CcjpRIwm.js} +0 -0
  282. /package/dist/public/assets/{init-tTyHApSS.js → init-c3-Nu4HJ.js} +0 -0
  283. /package/dist/public/assets/{isObject-CS6pZNNk.js → isObject-cN229uXS.js} +0 -0
  284. /package/dist/public/assets/{libesm-COuF-Ycc.js → libesm-DXt8eMZu.js} +0 -0
  285. /package/dist/public/assets/{lint-plugin-meta-7A6ZrPoH.js → lint-plugin-meta-BxfSlkph.js} +0 -0
  286. /package/dist/public/assets/{lru-string-cache-DXyh0UqD.js → lru-string-cache-Dvzy2WTu.js} +0 -0
  287. /package/dist/public/assets/{lua-Dxo01oIG.js → lua-DxmBbMX2.js} +0 -0
  288. /package/dist/public/assets/{mcp-consent-store-BivjPpLe.js → mcp-consent-store-BcrhbRwc.js} +0 -0
  289. /package/dist/public/assets/{min-B52VabRz.js → min-BZE3RIbd.js} +0 -0
  290. /package/dist/public/assets/{overlay-layers-B39mutdg.js → overlay-layers-Bzzqy8A3.js} +0 -0
  291. /package/dist/public/assets/{panel-Boo96yEj.js → panel-Bjv8raTx.js} +0 -0
  292. /package/dist/public/assets/{panzoom.es-JQqfaE6_.js → panzoom.es-BG-eqGqR.js} +0 -0
  293. /package/dist/public/assets/{path-BTSnI4V0.js → path-C0vgPxDI.js} +0 -0
  294. /package/dist/public/assets/{pdf-DDNlrbvd.js → pdf-Cvbt6FaY.js} +0 -0
  295. /package/dist/public/assets/{pdf.worker-MgQT7Lb-.js → pdf.worker-D0hSc7ZI.js} +0 -0
  296. /package/dist/public/assets/{perl-L_d0-K7D.js → perl-CTbv8SzR.js} +0 -0
  297. /package/dist/public/assets/{properties-B1mL7FEj.js → properties-CJVfsSwL.js} +0 -0
  298. /package/dist/public/assets/{r-D1HJ6WJD.js → r-DePwCFla.js} +0 -0
  299. /package/dist/public/assets/{rough.esm-FREjYXwx.js → rough.esm-jZQkcmER.js} +0 -0
  300. /package/dist/public/assets/{ruby-BWJ7ZkjF.js → ruby-CbNmqTQ7.js} +0 -0
  301. /package/dist/public/assets/{schema-fields-view-intent-BICJc1NC.js → schema-fields-view-intent-D5lrn_hr.js} +0 -0
  302. /package/dist/public/assets/{share-metadata-rows-c17l05D6.js → share-metadata-rows-CuFlpaJB.js} +0 -0
  303. /package/dist/public/assets/{shell-ul8ysUs1.js → shell-PtNEZQbu.js} +0 -0
  304. /package/dist/public/assets/{skeleton-CD1oYYfF.js → skeleton-Zj40UZU5.js} +0 -0
  305. /package/dist/public/assets/{sortable.esm-Dngr9VJ1.js → sortable.esm-BuA5-2It.js} +0 -0
  306. /package/dist/public/assets/{sql-BJVFbIWu.js → sql-DLytrKWQ.js} +0 -0
  307. /package/dist/public/assets/{src-CIOeKeVw.js → src-D9TuoXKa.js} +0 -0
  308. /package/dist/public/assets/{swift-BmJYIPlb.js → swift-BqNeJfD7.js} +0 -0
  309. /package/dist/public/assets/{textarea-BzPGvj03.js → textarea-Cl4IJ1LU.js} +0 -0
  310. /package/dist/public/assets/{thread-client-VmTuW12V.js → thread-client-Boy5ZhFJ.js} +0 -0
  311. /package/dist/public/assets/{thread-draft-staging-Df0IT4FR.js → thread-draft-staging-XfhEE_6X.js} +0 -0
  312. /package/dist/public/assets/{timeline-diff-store-BYDskbwd.js → timeline-diff-store-B-Ea84Rl.js} +0 -0
  313. /package/dist/public/assets/{toml-BOOm8Wvq.js → toml-Cboq-aWW.js} +0 -0
  314. /package/dist/public/assets/{use-installed-clis-a0f5-upA.js → use-installed-clis-BpdGnrVu.js} +0 -0
  315. /package/dist/public/assets/{useLintConfigViewMode-15VleUG7.js → useLintConfigViewMode-DHyC74de.js} +0 -0
@@ -1,4 +1,4 @@
1
- import{n as e}from"./chunk-Y2CYZVJY-BavonG01.js";import{t}from"./src-DFZupjZD.js";import{A as n,F as r,G as i,H as a,K as o,O as s,U as c,a as l,b as u,c as d,i as f,r as p,s as m,v as h,w as g,x as _,y as v,z as y}from"./chunk-WYO6CB5R-wjTAft84.js";import{C as b}from"./src-CIOeKeVw.js";import{t as x}from"./dist-BKO-SihH.js";import{g as S,p as C}from"./chunk-ICXQ74PX-cYUXxotj.js";import{a as w,c as T,i as E,n as D,r as O,s as k}from"./chunk-32BRIVSS-Ck3g8u7E.js";import{t as A}from"./chunk-2Q5K7J3B-BSFIGC1j.js";import{n as j,t as M}from"./chunk-ZIRB5QZD-BUzL4gtl.js";var N=x(),P=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,2],r=[1,3],i=[1,4],a=[2,4],o=[1,9],s=[1,11],c=[1,12],l=[1,14],u=[1,15],d=[1,17],f=[1,18],p=[1,19],m=[1,25],h=[1,26],g=[1,27],_=[1,28],v=[1,29],y=[1,30],b=[1,31],x=[1,32],S=[1,33],C=[1,34],w=[1,35],T=[1,36],E=[1,37],D=[1,38],O=[1,39],k=[1,40],A=[1,42],j=[1,43],M=[1,44],N=[1,45],P=[1,46],F=[1,47],I=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],ee=[1,74],L=[1,80],R=[1,81],te=[1,82],ne=[1,83],z=[1,84],B=[1,85],V=[1,86],re=[1,87],H=[1,88],U=[1,89],W=[1,90],ie=[1,91],ae=[1,92],oe=[1,93],G=[1,94],se=[1,95],K=[1,96],ce=[1,97],le=[1,98],ue=[1,99],de=[1,100],fe=[1,101],pe=[1,102],me=[1,103],he=[1,104],ge=[1,105],_e=[2,78],ve=[4,5,17,51,53,54],ye=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],be=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],xe=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],Se=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],Ce=[5,52],q=[70,71,72,73],J=[1,151],we={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:`error`,4:`SPACE`,5:`NEWLINE`,6:`SD`,10:`INVALID`,14:`create`,15:`box`,16:`restOfLine`,17:`end`,19:`autonumber`,20:`NUM`,21:`off`,22:`activate`,24:`deactivate`,30:`title`,31:`legacy_title`,32:`acc_title`,33:`acc_title_value`,34:`acc_descr`,35:`acc_descr_value`,36:`acc_descr_multiline_value`,37:`loop`,38:`rect`,39:`opt`,40:`alt`,42:`par`,44:`par_over`,45:`critical`,47:`break`,48:`option`,49:`and`,50:`else`,51:`participant`,52:`AS`,53:`participant_actor`,54:`destroy`,56:`note`,59:`over`,61:`links`,62:`link`,63:`properties`,64:`details`,66:`,`,67:`left_of`,68:`right_of`,70:`+`,71:`-`,72:`()`,73:`ACTOR`,75:`CONFIG_START`,76:`CONFIG_CONTENT`,77:`CONFIG_END`,78:`SOLID_OPEN_ARROW`,79:`DOTTED_OPEN_ARROW`,80:`SOLID_ARROW`,81:`SOLID_ARROW_TOP`,82:`SOLID_ARROW_BOTTOM`,83:`STICK_ARROW_TOP`,84:`STICK_ARROW_BOTTOM`,85:`SOLID_ARROW_TOP_DOTTED`,86:`SOLID_ARROW_BOTTOM_DOTTED`,87:`STICK_ARROW_TOP_DOTTED`,88:`STICK_ARROW_BOTTOM_DOTTED`,89:`SOLID_ARROW_TOP_REVERSE`,90:`SOLID_ARROW_BOTTOM_REVERSE`,91:`STICK_ARROW_TOP_REVERSE`,92:`STICK_ARROW_BOTTOM_REVERSE`,93:`SOLID_ARROW_TOP_REVERSE_DOTTED`,94:`SOLID_ARROW_BOTTOM_REVERSE_DOTTED`,95:`STICK_ARROW_TOP_REVERSE_DOTTED`,96:`STICK_ARROW_BOTTOM_REVERSE_DOTTED`,97:`BIDIRECTIONAL_SOLID_ARROW`,98:`DOTTED_ARROW`,99:`BIDIRECTIONAL_DOTTED_ARROW`,100:`SOLID_CROSS`,101:`DOTTED_CROSS`,102:`SOLID_POINT`,103:`DOTTED_POINT`,104:`TXT`},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 3:return r.apply(a[s]),a[s];case 4:case 10:this.$=[];break;case 5:case 11:a[s-1].push(a[s]),this.$=a[s-1];break;case 6:case 7:case 12:case 13:this.$=a[s];break;case 8:case 9:case 14:this.$=[];break;case 16:a[s].type=`createParticipant`,this.$=a[s];break;case 17:a[s-1].unshift({type:`boxStart`,boxData:r.parseBoxData(a[s-2])}),a[s-1].push({type:`boxEnd`,boxText:a[s-2]}),this.$=a[s-1];break;case 19:this.$={type:`sequenceIndex`,sequenceIndex:Number(a[s-2]),sequenceIndexStep:Number(a[s-1]),sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 20:this.$={type:`sequenceIndex`,sequenceIndex:Number(a[s-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 21:this.$={type:`sequenceIndex`,sequenceVisible:!1,signalType:r.LINETYPE.AUTONUMBER};break;case 22:this.$={type:`sequenceIndex`,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 23:this.$={type:`activeStart`,signalType:r.LINETYPE.ACTIVE_START,actor:a[s-1].actor};break;case 24:this.$={type:`activeEnd`,signalType:r.LINETYPE.ACTIVE_END,actor:a[s-1].actor};break;case 30:r.setDiagramTitle(a[s].substring(6)),this.$=a[s].substring(6);break;case 31:r.setDiagramTitle(a[s].substring(7)),this.$=a[s].substring(7);break;case 32:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 33:case 34:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 35:a[s-1].unshift({type:`loopStart`,loopText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.LOOP_START}),a[s-1].push({type:`loopEnd`,loopText:a[s-2],signalType:r.LINETYPE.LOOP_END}),this.$=a[s-1];break;case 36:a[s-1].unshift({type:`rectStart`,color:r.parseMessage(a[s-2]),signalType:r.LINETYPE.RECT_START}),a[s-1].push({type:`rectEnd`,color:r.parseMessage(a[s-2]),signalType:r.LINETYPE.RECT_END}),this.$=a[s-1];break;case 37:a[s-1].unshift({type:`optStart`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.OPT_START}),a[s-1].push({type:`optEnd`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.OPT_END}),this.$=a[s-1];break;case 38:a[s-1].unshift({type:`altStart`,altText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.ALT_START}),a[s-1].push({type:`altEnd`,signalType:r.LINETYPE.ALT_END}),this.$=a[s-1];break;case 39:a[s-1].unshift({type:`parStart`,parText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.PAR_START}),a[s-1].push({type:`parEnd`,signalType:r.LINETYPE.PAR_END}),this.$=a[s-1];break;case 40:a[s-1].unshift({type:`parStart`,parText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.PAR_OVER_START}),a[s-1].push({type:`parEnd`,signalType:r.LINETYPE.PAR_END}),this.$=a[s-1];break;case 41:a[s-1].unshift({type:`criticalStart`,criticalText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.CRITICAL_START}),a[s-1].push({type:`criticalEnd`,signalType:r.LINETYPE.CRITICAL_END}),this.$=a[s-1];break;case 42:a[s-1].unshift({type:`breakStart`,breakText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.BREAK_START}),a[s-1].push({type:`breakEnd`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.BREAK_END}),this.$=a[s-1];break;case 44:this.$=a[s-3].concat([{type:`option`,optionText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.CRITICAL_OPTION},a[s]]);break;case 46:this.$=a[s-3].concat([{type:`and`,parText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.PAR_AND},a[s]]);break;case 48:this.$=a[s-3].concat([{type:`else`,altText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.ALT_ELSE},a[s]]);break;case 49:a[s-3].draw=`participant`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 50:a[s-1].draw=`participant`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 51:a[s-3].draw=`actor`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 52:case 57:a[s-1].draw=`actor`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 53:a[s-1].type=`destroyParticipant`,this.$=a[s-1];break;case 54:a[s-3].draw=`participant`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 55:a[s-1].draw=`participant`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 56:a[s-3].draw=`actor`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 58:this.$=[a[s-1],{type:`addNote`,placement:a[s-2],actor:a[s-1].actor,text:a[s]}];break;case 59:a[s-2]=[].concat(a[s-1],a[s-1]).slice(0,2),a[s-2][0]=a[s-2][0].actor,a[s-2][1]=a[s-2][1].actor,this.$=[a[s-1],{type:`addNote`,placement:r.PLACEMENT.OVER,actor:a[s-2].slice(0,2),text:a[s]}];break;case 60:this.$=[a[s-1],{type:`addLinks`,actor:a[s-1].actor,text:a[s]}];break;case 61:this.$=[a[s-1],{type:`addALink`,actor:a[s-1].actor,text:a[s]}];break;case 62:this.$=[a[s-1],{type:`addProperties`,actor:a[s-1].actor,text:a[s]}];break;case 63:this.$=[a[s-1],{type:`addDetails`,actor:a[s-1].actor,text:a[s]}];break;case 66:this.$=[a[s-2],a[s]];break;case 67:this.$=a[s];break;case 68:this.$=r.PLACEMENT.LEFTOF;break;case 69:this.$=r.PLACEMENT.RIGHTOF;break;case 70:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0},{type:`activeStart`,signalType:r.LINETYPE.ACTIVE_START,actor:a[s-1].actor}];break;case 71:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s]},{type:`activeEnd`,signalType:r.LINETYPE.ACTIVE_END,actor:a[s-4].actor}];break;case 72:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0,centralConnection:r.LINETYPE.CENTRAL_CONNECTION},{type:`centralConnection`,signalType:r.LINETYPE.CENTRAL_CONNECTION,actor:a[s-1].actor}];break;case 73:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-2],msg:a[s],activate:!1,centralConnection:r.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:`centralConnectionReverse`,signalType:r.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:a[s-4].actor}];break;case 74:this.$=[a[s-5],a[s-1],{type:`addMessage`,from:a[s-5].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0,centralConnection:r.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:`centralConnection`,signalType:r.LINETYPE.CENTRAL_CONNECTION,actor:a[s-1].actor},{type:`centralConnectionReverse`,signalType:r.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:a[s-5].actor}];break;case 75:this.$=[a[s-3],a[s-1],{type:`addMessage`,from:a[s-3].actor,to:a[s-1].actor,signalType:a[s-2],msg:a[s]}];break;case 76:this.$={type:`addParticipant`,actor:a[s-1],config:a[s]};break;case 77:this.$=a[s-1].trim();break;case 78:this.$={type:`addParticipant`,actor:a[s]};break;case 79:this.$=r.LINETYPE.SOLID_OPEN;break;case 80:this.$=r.LINETYPE.DOTTED_OPEN;break;case 81:this.$=r.LINETYPE.SOLID;break;case 82:this.$=r.LINETYPE.SOLID_TOP;break;case 83:this.$=r.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=r.LINETYPE.STICK_TOP;break;case 85:this.$=r.LINETYPE.STICK_BOTTOM;break;case 86:this.$=r.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=r.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=r.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=r.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=r.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=r.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=r.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=r.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=r.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=r.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=r.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=r.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=r.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=r.LINETYPE.DOTTED;break;case 100:this.$=r.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=r.LINETYPE.SOLID_CROSS;break;case 102:this.$=r.LINETYPE.DOTTED_CROSS;break;case 103:this.$=r.LINETYPE.SOLID_POINT;break;case 104:this.$=r.LINETYPE.DOTTED_POINT;break;case 105:this.$=r.parseMessage(a[s].trim().substring(1));break}},`anonymous`),table:[{3:1,4:n,5:r,6:i},{1:[3]},{3:5,4:n,5:r,6:i},{3:6,4:n,5:r,6:i},t([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],a,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},t(I,[2,5]),{9:48,13:13,14:l,15:u,18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},t(I,[2,7]),t(I,[2,8]),t(I,[2,9]),t(I,[2,15]),{13:49,51:D,53:O,54:k},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:F},{23:56,73:F},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},t(I,[2,30]),t(I,[2,31]),{33:[1,62]},{35:[1,63]},t(I,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:ee},{23:75,55:76,73:ee},{23:77,73:F},{69:78,72:[1,79],78:L,79:R,80:te,81:ne,82:z,83:B,84:V,85:re,86:H,87:U,88:W,89:ie,90:ae,91:oe,92:G,93:se,94:K,95:ce,96:le,97:ue,98:de,99:fe,100:pe,101:me,102:he,103:ge},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:F},{23:111,73:F},{23:112,73:F},{23:113,73:F},t([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],_e),t(I,[2,6]),t(I,[2,16]),t(ve,[2,10],{11:114}),t(I,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},t(I,[2,22]),{5:[1,118]},{5:[1,119]},t(I,[2,25]),t(I,[2,26]),t(I,[2,27]),t(I,[2,28]),t(I,[2,29]),t(I,[2,32]),t(I,[2,33]),t(ye,a,{7:120}),t(ye,a,{7:121}),t(ye,a,{7:122}),t(be,a,{41:123,7:124}),t(xe,a,{43:125,7:126}),t(xe,a,{7:126,43:127}),t(Se,a,{46:128,7:129}),t(ye,a,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},t(Ce,_e,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:F},{69:146,78:L,79:R,80:te,81:ne,82:z,83:B,84:V,85:re,86:H,87:U,88:W,89:ie,90:ae,91:oe,92:G,93:se,94:K,95:ce,96:le,97:ue,98:de,99:fe,100:pe,101:me,102:he,103:ge},t(q,[2,79]),t(q,[2,80]),t(q,[2,81]),t(q,[2,82]),t(q,[2,83]),t(q,[2,84]),t(q,[2,85]),t(q,[2,86]),t(q,[2,87]),t(q,[2,88]),t(q,[2,89]),t(q,[2,90]),t(q,[2,91]),t(q,[2,92]),t(q,[2,93]),t(q,[2,94]),t(q,[2,95]),t(q,[2,96]),t(q,[2,97]),t(q,[2,98]),t(q,[2,99]),t(q,[2,100]),t(q,[2,101]),t(q,[2,102]),t(q,[2,103]),t(q,[2,104]),{23:147,73:F},{23:149,60:148,73:F},{73:[2,68]},{73:[2,69]},{58:150,104:J},{58:152,104:J},{58:153,104:J},{58:154,104:J},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:D,53:O,54:k},{5:[1,160]},t(I,[2,20]),t(I,[2,21]),t(I,[2,23]),t(I,[2,24]),{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,161],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,162],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,163],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,164]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,47],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,50:[1,165],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,166]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,45],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,49:[1,167],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,168]},{17:[1,169]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,43],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,48:[1,170],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,171],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{16:[1,172]},t(I,[2,50]),{16:[1,173]},t(I,[2,55]),t(Ce,[2,76]),{76:[1,174]},{16:[1,175]},t(I,[2,52]),{16:[1,176]},t(I,[2,57]),t(I,[2,53]),{23:177,73:F},{23:178,73:F},{23:179,73:F},{58:180,104:J},{23:181,72:[1,182],73:F},{58:183,104:J},{58:184,104:J},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},t(I,[2,17]),t(ve,[2,11]),{13:186,51:D,53:O,54:k},t(ve,[2,13]),t(ve,[2,14]),t(I,[2,19]),t(I,[2,35]),t(I,[2,36]),t(I,[2,37]),t(I,[2,38]),{16:[1,187]},t(I,[2,39]),{16:[1,188]},t(I,[2,40]),t(I,[2,41]),{16:[1,189]},t(I,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:J},{58:196,104:J},{58:197,104:J},{5:[2,75]},{58:198,104:J},{23:199,73:F},{5:[2,58]},{5:[2,59]},{23:200,73:F},t(ve,[2,12]),t(be,a,{7:124,41:201}),t(xe,a,{7:126,43:202}),t(Se,a,{7:129,46:203}),t(I,[2,49]),t(I,[2,54]),t(Ce,[2,77]),t(I,[2,51]),t(I,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:J},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
1
+ import{n as e}from"./chunk-Y2CYZVJY-Dp_m2dHs.js";import{t}from"./src-CprZUkQE.js";import{A as n,F as r,G as i,H as a,K as o,O as s,U as c,a as l,b as u,c as d,i as f,r as p,s as m,v as h,w as g,x as _,y as v,z as y}from"./chunk-WYO6CB5R-CALegXxo.js";import{C as b}from"./src-D9TuoXKa.js";import{t as x}from"./dist-yoZDDKeY.js";import{g as S,p as C}from"./chunk-ICXQ74PX-MYNcPnbp.js";import{a as w,c as T,i as E,n as D,r as O,s as k}from"./chunk-32BRIVSS-BYVl5jAx.js";import{t as A}from"./chunk-2Q5K7J3B-CTVQtWlX.js";import{n as j,t as M}from"./chunk-ZIRB5QZD-DTzEX6O5.js";var N=x(),P=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,2],r=[1,3],i=[1,4],a=[2,4],o=[1,9],s=[1,11],c=[1,12],l=[1,14],u=[1,15],d=[1,17],f=[1,18],p=[1,19],m=[1,25],h=[1,26],g=[1,27],_=[1,28],v=[1,29],y=[1,30],b=[1,31],x=[1,32],S=[1,33],C=[1,34],w=[1,35],T=[1,36],E=[1,37],D=[1,38],O=[1,39],k=[1,40],A=[1,42],j=[1,43],M=[1,44],N=[1,45],P=[1,46],F=[1,47],I=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],ee=[1,74],L=[1,80],R=[1,81],te=[1,82],ne=[1,83],z=[1,84],B=[1,85],V=[1,86],re=[1,87],H=[1,88],U=[1,89],W=[1,90],ie=[1,91],ae=[1,92],oe=[1,93],G=[1,94],se=[1,95],K=[1,96],ce=[1,97],le=[1,98],ue=[1,99],de=[1,100],fe=[1,101],pe=[1,102],me=[1,103],he=[1,104],ge=[1,105],_e=[2,78],ve=[4,5,17,51,53,54],ye=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],be=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],xe=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],Se=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],Ce=[5,52],q=[70,71,72,73],J=[1,151],we={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:`error`,4:`SPACE`,5:`NEWLINE`,6:`SD`,10:`INVALID`,14:`create`,15:`box`,16:`restOfLine`,17:`end`,19:`autonumber`,20:`NUM`,21:`off`,22:`activate`,24:`deactivate`,30:`title`,31:`legacy_title`,32:`acc_title`,33:`acc_title_value`,34:`acc_descr`,35:`acc_descr_value`,36:`acc_descr_multiline_value`,37:`loop`,38:`rect`,39:`opt`,40:`alt`,42:`par`,44:`par_over`,45:`critical`,47:`break`,48:`option`,49:`and`,50:`else`,51:`participant`,52:`AS`,53:`participant_actor`,54:`destroy`,56:`note`,59:`over`,61:`links`,62:`link`,63:`properties`,64:`details`,66:`,`,67:`left_of`,68:`right_of`,70:`+`,71:`-`,72:`()`,73:`ACTOR`,75:`CONFIG_START`,76:`CONFIG_CONTENT`,77:`CONFIG_END`,78:`SOLID_OPEN_ARROW`,79:`DOTTED_OPEN_ARROW`,80:`SOLID_ARROW`,81:`SOLID_ARROW_TOP`,82:`SOLID_ARROW_BOTTOM`,83:`STICK_ARROW_TOP`,84:`STICK_ARROW_BOTTOM`,85:`SOLID_ARROW_TOP_DOTTED`,86:`SOLID_ARROW_BOTTOM_DOTTED`,87:`STICK_ARROW_TOP_DOTTED`,88:`STICK_ARROW_BOTTOM_DOTTED`,89:`SOLID_ARROW_TOP_REVERSE`,90:`SOLID_ARROW_BOTTOM_REVERSE`,91:`STICK_ARROW_TOP_REVERSE`,92:`STICK_ARROW_BOTTOM_REVERSE`,93:`SOLID_ARROW_TOP_REVERSE_DOTTED`,94:`SOLID_ARROW_BOTTOM_REVERSE_DOTTED`,95:`STICK_ARROW_TOP_REVERSE_DOTTED`,96:`STICK_ARROW_BOTTOM_REVERSE_DOTTED`,97:`BIDIRECTIONAL_SOLID_ARROW`,98:`DOTTED_ARROW`,99:`BIDIRECTIONAL_DOTTED_ARROW`,100:`SOLID_CROSS`,101:`DOTTED_CROSS`,102:`SOLID_POINT`,103:`DOTTED_POINT`,104:`TXT`},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 3:return r.apply(a[s]),a[s];case 4:case 10:this.$=[];break;case 5:case 11:a[s-1].push(a[s]),this.$=a[s-1];break;case 6:case 7:case 12:case 13:this.$=a[s];break;case 8:case 9:case 14:this.$=[];break;case 16:a[s].type=`createParticipant`,this.$=a[s];break;case 17:a[s-1].unshift({type:`boxStart`,boxData:r.parseBoxData(a[s-2])}),a[s-1].push({type:`boxEnd`,boxText:a[s-2]}),this.$=a[s-1];break;case 19:this.$={type:`sequenceIndex`,sequenceIndex:Number(a[s-2]),sequenceIndexStep:Number(a[s-1]),sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 20:this.$={type:`sequenceIndex`,sequenceIndex:Number(a[s-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 21:this.$={type:`sequenceIndex`,sequenceVisible:!1,signalType:r.LINETYPE.AUTONUMBER};break;case 22:this.$={type:`sequenceIndex`,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 23:this.$={type:`activeStart`,signalType:r.LINETYPE.ACTIVE_START,actor:a[s-1].actor};break;case 24:this.$={type:`activeEnd`,signalType:r.LINETYPE.ACTIVE_END,actor:a[s-1].actor};break;case 30:r.setDiagramTitle(a[s].substring(6)),this.$=a[s].substring(6);break;case 31:r.setDiagramTitle(a[s].substring(7)),this.$=a[s].substring(7);break;case 32:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 33:case 34:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 35:a[s-1].unshift({type:`loopStart`,loopText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.LOOP_START}),a[s-1].push({type:`loopEnd`,loopText:a[s-2],signalType:r.LINETYPE.LOOP_END}),this.$=a[s-1];break;case 36:a[s-1].unshift({type:`rectStart`,color:r.parseMessage(a[s-2]),signalType:r.LINETYPE.RECT_START}),a[s-1].push({type:`rectEnd`,color:r.parseMessage(a[s-2]),signalType:r.LINETYPE.RECT_END}),this.$=a[s-1];break;case 37:a[s-1].unshift({type:`optStart`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.OPT_START}),a[s-1].push({type:`optEnd`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.OPT_END}),this.$=a[s-1];break;case 38:a[s-1].unshift({type:`altStart`,altText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.ALT_START}),a[s-1].push({type:`altEnd`,signalType:r.LINETYPE.ALT_END}),this.$=a[s-1];break;case 39:a[s-1].unshift({type:`parStart`,parText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.PAR_START}),a[s-1].push({type:`parEnd`,signalType:r.LINETYPE.PAR_END}),this.$=a[s-1];break;case 40:a[s-1].unshift({type:`parStart`,parText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.PAR_OVER_START}),a[s-1].push({type:`parEnd`,signalType:r.LINETYPE.PAR_END}),this.$=a[s-1];break;case 41:a[s-1].unshift({type:`criticalStart`,criticalText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.CRITICAL_START}),a[s-1].push({type:`criticalEnd`,signalType:r.LINETYPE.CRITICAL_END}),this.$=a[s-1];break;case 42:a[s-1].unshift({type:`breakStart`,breakText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.BREAK_START}),a[s-1].push({type:`breakEnd`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.BREAK_END}),this.$=a[s-1];break;case 44:this.$=a[s-3].concat([{type:`option`,optionText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.CRITICAL_OPTION},a[s]]);break;case 46:this.$=a[s-3].concat([{type:`and`,parText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.PAR_AND},a[s]]);break;case 48:this.$=a[s-3].concat([{type:`else`,altText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.ALT_ELSE},a[s]]);break;case 49:a[s-3].draw=`participant`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 50:a[s-1].draw=`participant`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 51:a[s-3].draw=`actor`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 52:case 57:a[s-1].draw=`actor`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 53:a[s-1].type=`destroyParticipant`,this.$=a[s-1];break;case 54:a[s-3].draw=`participant`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 55:a[s-1].draw=`participant`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 56:a[s-3].draw=`actor`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 58:this.$=[a[s-1],{type:`addNote`,placement:a[s-2],actor:a[s-1].actor,text:a[s]}];break;case 59:a[s-2]=[].concat(a[s-1],a[s-1]).slice(0,2),a[s-2][0]=a[s-2][0].actor,a[s-2][1]=a[s-2][1].actor,this.$=[a[s-1],{type:`addNote`,placement:r.PLACEMENT.OVER,actor:a[s-2].slice(0,2),text:a[s]}];break;case 60:this.$=[a[s-1],{type:`addLinks`,actor:a[s-1].actor,text:a[s]}];break;case 61:this.$=[a[s-1],{type:`addALink`,actor:a[s-1].actor,text:a[s]}];break;case 62:this.$=[a[s-1],{type:`addProperties`,actor:a[s-1].actor,text:a[s]}];break;case 63:this.$=[a[s-1],{type:`addDetails`,actor:a[s-1].actor,text:a[s]}];break;case 66:this.$=[a[s-2],a[s]];break;case 67:this.$=a[s];break;case 68:this.$=r.PLACEMENT.LEFTOF;break;case 69:this.$=r.PLACEMENT.RIGHTOF;break;case 70:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0},{type:`activeStart`,signalType:r.LINETYPE.ACTIVE_START,actor:a[s-1].actor}];break;case 71:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s]},{type:`activeEnd`,signalType:r.LINETYPE.ACTIVE_END,actor:a[s-4].actor}];break;case 72:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0,centralConnection:r.LINETYPE.CENTRAL_CONNECTION},{type:`centralConnection`,signalType:r.LINETYPE.CENTRAL_CONNECTION,actor:a[s-1].actor}];break;case 73:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-2],msg:a[s],activate:!1,centralConnection:r.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:`centralConnectionReverse`,signalType:r.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:a[s-4].actor}];break;case 74:this.$=[a[s-5],a[s-1],{type:`addMessage`,from:a[s-5].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0,centralConnection:r.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:`centralConnection`,signalType:r.LINETYPE.CENTRAL_CONNECTION,actor:a[s-1].actor},{type:`centralConnectionReverse`,signalType:r.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:a[s-5].actor}];break;case 75:this.$=[a[s-3],a[s-1],{type:`addMessage`,from:a[s-3].actor,to:a[s-1].actor,signalType:a[s-2],msg:a[s]}];break;case 76:this.$={type:`addParticipant`,actor:a[s-1],config:a[s]};break;case 77:this.$=a[s-1].trim();break;case 78:this.$={type:`addParticipant`,actor:a[s]};break;case 79:this.$=r.LINETYPE.SOLID_OPEN;break;case 80:this.$=r.LINETYPE.DOTTED_OPEN;break;case 81:this.$=r.LINETYPE.SOLID;break;case 82:this.$=r.LINETYPE.SOLID_TOP;break;case 83:this.$=r.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=r.LINETYPE.STICK_TOP;break;case 85:this.$=r.LINETYPE.STICK_BOTTOM;break;case 86:this.$=r.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=r.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=r.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=r.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=r.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=r.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=r.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=r.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=r.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=r.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=r.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=r.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=r.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=r.LINETYPE.DOTTED;break;case 100:this.$=r.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=r.LINETYPE.SOLID_CROSS;break;case 102:this.$=r.LINETYPE.DOTTED_CROSS;break;case 103:this.$=r.LINETYPE.SOLID_POINT;break;case 104:this.$=r.LINETYPE.DOTTED_POINT;break;case 105:this.$=r.parseMessage(a[s].trim().substring(1));break}},`anonymous`),table:[{3:1,4:n,5:r,6:i},{1:[3]},{3:5,4:n,5:r,6:i},{3:6,4:n,5:r,6:i},t([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],a,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},t(I,[2,5]),{9:48,13:13,14:l,15:u,18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},t(I,[2,7]),t(I,[2,8]),t(I,[2,9]),t(I,[2,15]),{13:49,51:D,53:O,54:k},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:F},{23:56,73:F},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},t(I,[2,30]),t(I,[2,31]),{33:[1,62]},{35:[1,63]},t(I,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:ee},{23:75,55:76,73:ee},{23:77,73:F},{69:78,72:[1,79],78:L,79:R,80:te,81:ne,82:z,83:B,84:V,85:re,86:H,87:U,88:W,89:ie,90:ae,91:oe,92:G,93:se,94:K,95:ce,96:le,97:ue,98:de,99:fe,100:pe,101:me,102:he,103:ge},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:F},{23:111,73:F},{23:112,73:F},{23:113,73:F},t([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],_e),t(I,[2,6]),t(I,[2,16]),t(ve,[2,10],{11:114}),t(I,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},t(I,[2,22]),{5:[1,118]},{5:[1,119]},t(I,[2,25]),t(I,[2,26]),t(I,[2,27]),t(I,[2,28]),t(I,[2,29]),t(I,[2,32]),t(I,[2,33]),t(ye,a,{7:120}),t(ye,a,{7:121}),t(ye,a,{7:122}),t(be,a,{41:123,7:124}),t(xe,a,{43:125,7:126}),t(xe,a,{7:126,43:127}),t(Se,a,{46:128,7:129}),t(ye,a,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},t(Ce,_e,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:F},{69:146,78:L,79:R,80:te,81:ne,82:z,83:B,84:V,85:re,86:H,87:U,88:W,89:ie,90:ae,91:oe,92:G,93:se,94:K,95:ce,96:le,97:ue,98:de,99:fe,100:pe,101:me,102:he,103:ge},t(q,[2,79]),t(q,[2,80]),t(q,[2,81]),t(q,[2,82]),t(q,[2,83]),t(q,[2,84]),t(q,[2,85]),t(q,[2,86]),t(q,[2,87]),t(q,[2,88]),t(q,[2,89]),t(q,[2,90]),t(q,[2,91]),t(q,[2,92]),t(q,[2,93]),t(q,[2,94]),t(q,[2,95]),t(q,[2,96]),t(q,[2,97]),t(q,[2,98]),t(q,[2,99]),t(q,[2,100]),t(q,[2,101]),t(q,[2,102]),t(q,[2,103]),t(q,[2,104]),{23:147,73:F},{23:149,60:148,73:F},{73:[2,68]},{73:[2,69]},{58:150,104:J},{58:152,104:J},{58:153,104:J},{58:154,104:J},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:D,53:O,54:k},{5:[1,160]},t(I,[2,20]),t(I,[2,21]),t(I,[2,23]),t(I,[2,24]),{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,161],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,162],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,163],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,164]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,47],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,50:[1,165],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,166]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,45],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,49:[1,167],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,168]},{17:[1,169]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,43],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,48:[1,170],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,171],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{16:[1,172]},t(I,[2,50]),{16:[1,173]},t(I,[2,55]),t(Ce,[2,76]),{76:[1,174]},{16:[1,175]},t(I,[2,52]),{16:[1,176]},t(I,[2,57]),t(I,[2,53]),{23:177,73:F},{23:178,73:F},{23:179,73:F},{58:180,104:J},{23:181,72:[1,182],73:F},{58:183,104:J},{58:184,104:J},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},t(I,[2,17]),t(ve,[2,11]),{13:186,51:D,53:O,54:k},t(ve,[2,13]),t(ve,[2,14]),t(I,[2,19]),t(I,[2,35]),t(I,[2,36]),t(I,[2,37]),t(I,[2,38]),{16:[1,187]},t(I,[2,39]),{16:[1,188]},t(I,[2,40]),t(I,[2,41]),{16:[1,189]},t(I,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:J},{58:196,104:J},{58:197,104:J},{5:[2,75]},{58:198,104:J},{23:199,73:F},{5:[2,58]},{5:[2,59]},{23:200,73:F},t(ve,[2,12]),t(be,a,{7:124,41:201}),t(xe,a,{7:126,43:202}),t(Se,a,{7:129,46:203}),t(I,[2,49]),t(I,[2,54]),t(Ce,[2,77]),t(I,[2,51]),t(I,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:J},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
2
2
  `+h.showPosition()+`
3
3
  Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};we.lexer=(function(){return{EOF:1,parseError:e(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:e(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:e(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:e(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:e(function(){return this._more=!0,this},`more`),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:e(function(e){this.unput(this.match.slice(e))},`less`),pastInput:e(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:e(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:e(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
@@ -1 +1 @@
1
- import{n as e}from"./chunk-Y2CYZVJY-BavonG01.js";var t=1;function n(){if(!(typeof globalThis>`u`))return globalThis}e(n,`getCaptureGlobal`);function r(){return!!n()?.mermaidCaptureSizes}e(r,`shouldCaptureSizes`);function i(){return typeof location>`u`?`browser-dev`:`${location.pathname}${location.search}`}e(i,`capturedFromLocation`);function a(e,t){let r=n();if(!r)return;let i=t.node(),a=((i&&`ownerSVGElement`in i?i.ownerSVGElement:null)??i)?.id??`(unknown)`;r.mermaidCapturedSizes??=[];let o={svgId:a,sizes:e};r.mermaidCapturedSizes.push(o),r.mermaidLastCapturedSizes=o}e(a,`emitCapturedSizes`);function o(e,n){let r=[];for(let e of n.nodes)e.isGroup||r.push({id:e.id,width:e.width??0,height:e.height??0});r.length!==0&&a({metadata:{captureVersion:t,capturedAt:new Date().toISOString(),capturedFrom:i()},nodes:r},e)}e(o,`captureNodeSizes`);export{o as captureNodeSizes};
1
+ import{n as e}from"./chunk-Y2CYZVJY-Dp_m2dHs.js";var t=1;function n(){if(!(typeof globalThis>`u`))return globalThis}e(n,`getCaptureGlobal`);function r(){return!!n()?.mermaidCaptureSizes}e(r,`shouldCaptureSizes`);function i(){return typeof location>`u`?`browser-dev`:`${location.pathname}${location.search}`}e(i,`capturedFromLocation`);function a(e,t){let r=n();if(!r)return;let i=t.node(),a=((i&&`ownerSVGElement`in i?i.ownerSVGElement:null)??i)?.id??`(unknown)`;r.mermaidCapturedSizes??=[];let o={svgId:a,sizes:e};r.mermaidCapturedSizes.push(o),r.mermaidLastCapturedSizes=o}e(a,`emitCapturedSizes`);function o(e,n){let r=[];for(let e of n.nodes)e.isGroup||r.push({id:e.id,width:e.width??0,height:e.height??0});r.length!==0&&a({metadata:{captureVersion:t,capturedAt:new Date().toISOString(),capturedFrom:i()},nodes:r},e)}e(o,`captureNodeSizes`);export{o as captureNodeSizes};
@@ -1,2 +1,2 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{F as n,I as r,P as i,Pn as a,_n as o,i as s}from"./DocumentContext-UuXLA8HR.js";import{t as c}from"./react-f2sANaYj.js";import{n as l,r as u}from"./dist-Nvb76hAm.js";import{t as d}from"./compiler-runtime-BfE3aGVn.js";import{l as f}from"./terminal-input-events-BGPQuYMh.js";import{t as p}from"./use-workspace-C_kPbTuK.js";import{c as m,i as h,n as g,o as _,s as v,t as y}from"./ChangedOutsideBadge-D93fNuY2.js";import{t as b}from"./button-RQ5o7P7w.js";import{i as x,n as S,t as C}from"./tooltip-x7BNUa3s.js";import{a as w,c as T,i as E,n as D,o as O,r as k,s as ee,t as A}from"./dialog-FGMqkFjm.js";import{a as j,d as M,f as N,i as P,n as F,o as I,p as L,u as R}from"./dropdown-menu-AlVJ7dJz.js";import{t as te}from"./label-G0lbYOgL.js";import{C as z,a as B,f as V,h as H,m as U,n as W,o as G,p as K,r as q,s as J,t as Y}from"./agent-visibility-DvaU093e.js";import{$t as ne,Dt as X,Ia as re,Kt as ie,Mt as ae,Ra as oe,Sn as se,Va as ce,Zt as le,_n as ue,bn as de,en as fe,fn as pe,hn as me,jt as he,mn as ge,nt as _e,pa as ve,pn as ye,ri as be,tt as xe,xn as Se,xt as Ce,yn as we,yr as Te}from"./dist-OxboORfH2.js";import{t as Ee}from"./createLucideIcon-DihYAFEK.js";import{t as De}from"./RegisteredAgentIcon-DGE6x9DL.js";import{n as Oe,r as ke}from"./ManagedArtifactProperties-CQnVDYPq.js";import{n as Ae}from"./CopyButton-D6N3opvE.js";import{t as je}from"./folder-open-Ceue91os.js";import{t as Me}from"./folder-DcWlgZbb.js";import{t as Ne}from"./trash-2-WxyktwvM.js";import{n as Z}from"./dist-uN7pEWl0.js";import{t as Pe}from"./input-Cm94Cun3.js";import{t as Fe}from"./dist-CzC3AWOn.js";import{i as Ie}from"./use-settings-route-CIJMHLaP.js";import{t as Le}from"./parse-api-error-Dmlzsw8v.js";import{G as Re,O as ze,W as Be}from"./navigation-targets-GzXvLoSC.js";import{c as Ve,n as He,o as Ue}from"./documents-events-5TI0rZAg.js";import{d as We,n as Ge,r as Ke,s as qe}from"./skill-scope-CmujX5gW.js";import{A as Je,D as Ye,O as Xe,S as Ze,_ as Qe,c as $e,f as et,i as tt,n as nt,t as rt,v as it,x as at,y as ot}from"./skills-api-BeHeMfn9.js";import{n as st}from"./config-context-CYNq8R6z.js";import{t as ct}from"./use-skills-C2EtCeGb.js";import{t as lt}from"./use-open-skill-HTbCYiG5.js";import{n as ut}from"./clipboard-adapter-DdkYoUY3.js";import{t as dt}from"./DiffView-CiVa7sAS.js";var ft=Ee(`arrow-left-right`,[[`path`,{d:`M8 3 4 7l4 4`,key:`9rb6wj`}],[`path`,{d:`M4 7h16`,key:`6tx8e3`}],[`path`,{d:`m16 21 4-4-4-4`,key:`siv7j2`}],[`path`,{d:`M20 17H4`,key:`h6l3hr`}]]),pt=Ee(`cloud-download`,[[`path`,{d:`M12 13v8l-4-4`,key:`1f5nwf`}],[`path`,{d:`m12 21 4-4`,key:`1lfcce`}],[`path`,{d:`M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284`,key:`ui1hmy`}]]),mt=Ee(`list-plus`,[[`path`,{d:`M16 5H3`,key:`m91uny`}],[`path`,{d:`M11 12H3`,key:`51ecnj`}],[`path`,{d:`M16 19H3`,key:`zzsher`}],[`path`,{d:`M18 9v6`,key:`1twb98`}],[`path`,{d:`M21 12h-6`,key:`bt1uis`}]]),ht=Ee(`pencil-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),gt=Ee(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Q=t(),$=e(c(),1),_t=d();function vt(e){return{async install(t){let n;try{n=await e.buildAndOpen(t?.force?{force:!0}:void 0)}catch(e){return{ok:!1,reason:`bridge-error`,message:e instanceof Error?e.message:String(e)}}return n.ok?{ok:!0,path:n.path}:{ok:!1,reason:n.reason,message:n.message}}}}function yt(e={}){let t=e.fetch??globalThis.fetch,n=`${e.apiOrigin??``}/api/install-skill`;return{async install(e){let r;try{r=await t(n,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e?.force?{force:!0}:{})})}catch(e){return{ok:!1,reason:`network-error`,message:e instanceof Error?e.message:String(e)}}if(!r.ok){let e=`HTTP ${r.status}`;try{let t=Le(await r.json());t&&(e=t)}catch{}return{ok:!1,reason:`http-error`,message:e}}let i;try{i=await r.json()}catch(e){return{ok:!1,reason:`parse-error`,message:e instanceof Error?e.message:`Invalid server response`}}return!i||typeof i.status!=`string`?{ok:!1,reason:`parse-error`,message:`Invalid server response shape`}:i.status===`failed`?{ok:!1,reason:`build-failed`,message:i.buildError??`unknown build failure`}:{ok:!0,path:i.outputPath,handoffWarning:i.handoffError?.message}}}}function bt(){if(typeof window>`u`)return null;let e=window.okDesktop?.skill;return e?vt(e):yt()}var xt=`ok:skill:cowork:installed`,St=`1`,Ct=250,wt=`/api/skill/install-state`;function Tt(e){return`${xt}:v${e}`}var Et=new Map;async function Dt(e={},t={}){let n=t.force?`__force__`:`__default__`,r=Et.get(n);if(r)return r;let i=Ot(e,t);return Et.set(n,i),i.finally(()=>{Et.get(n)===i&&Et.delete(n)}),i}async function Ot(e,t){let n=e.installer===void 0?bt():e.installer,r=kt(e.storage),i=e.fetchSnapshot??jt,a=e.serverTimeoutMs??Ct,o=null;if(!t.force){try{o=await Mt(i(),a)}catch(e){console.warn(`[cowork-skill] server install-state check failed; falling through:`,e)}if(o){let e=o.targets[`claude-cowork`]??null;if(e&&e.version===o.currentVersion)return{kind:`already-installed`,source:`server`}}}let s=Tt(o?.currentVersion??e.fallbackSkillVersion??At());if(!t.force&&r?.getItem(s)===St)return{kind:`already-installed`,source:`local`};if(!n)return{kind:`host-unsupported`};let c=await n.install({force:t.force??!1});if(!c.ok)return{kind:`install-failed`,reason:c.reason,message:c.message};try{r?.setItem(s,St)}catch(e){console.warn(`[cowork-skill] storage.setItem failed (guard will not persist):`,e)}return{kind:`installed-now`,path:c.path,handoffWarning:c.handoffWarning}}function kt(e){if(e!==void 0)return e;if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function At(){return typeof window>`u`?`unknown`:window.okDesktop?.appVersion??`unknown`}async function jt(){let e;try{e=await fetch(wt,{method:`GET`,cache:`no-store`})}catch{return null}if(!e.ok)return null;try{let t=await e.json();return typeof t?.currentVersion==`string`?t:null}catch{return null}}async function Mt(e,t){return Promise.race([e,new Promise(e=>{setTimeout(()=>e(null),t)})])}function Nt(e){return Dt({},e)}function Pt(){return Dt({},{force:!0})}async function Ft(e,t){let n;try{n=await t(`/api/handoff`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})}catch(e){return{ok:!1,reason:`dispatch-error`,detail:e instanceof Error?e.message:String(e)}}return n.status===200?{ok:!0}:n.status===404?{ok:!1,reason:`not-installed`,detail:`POST /api/handoff returned 404`}:n.status===422?{ok:!1,reason:`not-installed`,detail:`POST /api/handoff returned ${n.status}`}:{ok:!1,reason:`dispatch-error`,detail:`POST /api/handoff returned ${n.status}`}}async function It(e,t={}){let n=t.fetch??globalThis.fetch.bind(globalThis);switch(e.target){case`claude-cowork`:return Ft({target:`claude-cowork`,url:le({mode:`cowork`},e)},n);case`claude-code`:return Ft({target:`claude-code`,url:le({mode:`code`},e)},n);case`codex`:return Ft({target:`codex`,url:ne(e)},n);case`cursor`:return Ft({target:`cursor`,url:fe(e),workspacePath:e.projectDir},n);case`copilot`:return{ok:!1,reason:`invalid-payload`,detail:`copilot is terminal-only; launch via requestTerminalLaunch`};case`opencode`:return{ok:!1,reason:`invalid-payload`,detail:`opencode is terminal-only; launch via requestTerminalLaunch`};case`pi`:return{ok:!1,reason:`invalid-payload`,detail:`pi is terminal-only; launch via requestTerminalLaunch`};case`antigravity`:return{ok:!1,reason:`invalid-payload`,detail:`antigravity is terminal-only; launch via requestTerminalLaunch`};case`openclaw`:return{ok:!1,reason:`invalid-payload`,detail:`openclaw is terminal-only; launch via requestTerminalLaunch`};case`hermes`:return{ok:!1,reason:`invalid-payload`,detail:`hermes is terminal-only; launch via requestTerminalLaunch`};default:{let t=e.target;return{ok:!1,reason:`invalid-payload`,detail:`unknown target: ${String(t)}`}}}}async function Lt(e,t={}){let n=t.okDesktop??(typeof window<`u`?window.okDesktop:void 0);if(n?.shell?.recordHandoff)try{await n.shell.recordHandoff(e)}catch(e){(t.warn??(e=>console.warn(e)))(`[handoff] recordHandoff IPC rejected (telemetry skipped): ${e instanceof Error?e.message:String(e)}`)}}var Rt=`open-knowledge:agent-thread-launch`;function zt(e,t=typeof window>`u`?new EventTarget:window){t.dispatchEvent(new CustomEvent(Rt,{detail:e}))}function Bt(e,t=typeof window>`u`?new EventTarget:window){let n=t=>{let n=t instanceof CustomEvent?t.detail:void 0;n&&typeof n.agentId==`string`&&e(n)};return t.addEventListener(Rt,n),()=>t.removeEventListener(Rt,n)}function Vt(e){if(!e.docName||!e.workspace)return null;let t=i(e.docName),{contentDir:r,pathSeparator:a}=e.workspace;return{docContext:{relativePath:t},projectDir:r,docPath:n(r,t,a)}}function Ht(e){return e.workspace?.contentDir?{docContext:null,projectDir:e.workspace.contentDir,docPath:``}:null}function Ut(e){return e.workspace?.contentDir?{docContext:null,createDescription:e.description,createScenario:e.scenario,createMentions:e.mentions,projectDir:e.workspace.contentDir,docPath:``}:null}function Wt(e){return K(e.installUrl).then(()=>void 0)}function Gt(e){return!e.workspace?.contentDir||!e.folderRelativePath?null:{docContext:null,folderRelativePath:e.folderRelativePath,projectDir:e.workspace.contentDir,docPath:``}}function Kt(e){return!e.workspace?.contentDir||!e.skillName?null:{docContext:null,skill:{name:e.skillName,scope:e.scope},projectDir:e.workspace.contentDir,docPath:``}}function qt(e){if(!e.workspace?.contentDir)return null;let{contentDir:t,pathSeparator:r}=e.workspace;if(e.docName){let a=e.docRelativePath??i(e.docName),o={scope:`doc`,docRelativePath:a,instruction:e.instruction,mentions:e.mentions};return{docContext:null,compose:e.selection===void 0?o:{...o,selection:e.selection},projectDir:t,docPath:n(t,a,r)}}return e.folderRelativePath?{docContext:null,compose:{scope:`folder`,folderRelativePath:e.folderRelativePath,instruction:e.instruction,mentions:e.mentions},projectDir:t,docPath:``}:{docContext:null,compose:{scope:`project`,instruction:e.instruction,mentions:e.mentions},projectDir:t,docPath:``}}function Jt(e){return`Opened in ${e}.`}function Yt(e,t=1){return t>=3?`Couldn't reach ${e} — please try again later.`:t===2?`Still couldn't reach ${e} — try one more time?`:`Couldn't reach ${e} — try again?`}function Xt(e){return e>=3?null:e===2?`Try one more time`:`Retry`}function Zt(e,t,n,r,i){let a=i===void 0?{}:{scope:i};return t.ok?{target:e,host:n,outcome:`ok`,ts:r,...a}:{target:e,host:n,outcome:`error`,ts:r,reason:t.reason,...a}}function Qt(e,t,n,r){if(e.scope===`doc`){let i={scope:`doc`,docRelativePath:e.docRelativePath,instruction:e.instruction,mentions:e.mentions,target:t,autoOpen:n,transport:r};return e.selection===void 0?i:{...i,selection:e.selection}}return e.scope===`folder`?{scope:`folder`,folderRelativePath:e.folderRelativePath,instruction:e.instruction,mentions:e.mentions,target:t,autoOpen:n,transport:r}:{scope:`project`,instruction:e.instruction,mentions:e.mentions,target:t,autoOpen:n,transport:r}}function $t(e,t,n,r){return e.compose?ie(Qt(e.compose,t,n,r)):e.selection?we({...e.selection,target:t,transport:r}):e.skill?de(e.skill.name,e.skill.scope,n):e.ask?pe(e.ask.relativePath,e.ask.instruction,n,t,r):be(e.docContext===null?e.folderRelativePath?ue(e.folderRelativePath,n,e.instruction,r):e.createDescription===void 0?ge(n,e.instruction,r):ye(e.createDescription,n,e.createScenario??`new-project`,e.createMentions??[],r):me(e.docContext.relativePath,n,e.instruction,r))}function en(e,t){let n=typeof e.instruction==`string`&&e.instruction.trim()!==``;return e.compose!==void 0||e.createDescription!==void 0||n?`${xe} ${$t(e,he[t].handoffTarget,!1,`terminal`)}`:Se(e.docContext?.relativePath??null)}function tn(e){let t=typeof e.instruction==`string`&&e.instruction.trim()!==``;return e.compose!==void 0||e.createDescription!==void 0||t?`${_e} ${$t(e,`claude-code`,!1,`terminal`)}`:se(e.docContext?.relativePath??null)}function nn(e){let t=e.docContext?.relativePath;return typeof t!=`string`||t===``?null:t.replace(/\.(md|mdx)$/,``)}function rn(e){let t=[e.compose?.instruction,e.selection?.instruction,e.ask?.instruction,e.createDescription,e.instruction];for(let e of t)if(typeof e==`string`&&e.trim()!==``)return e;return null}function an(e,t){zt({agentSource:t?.agent?.source??`registry`,agentId:t?.agent?.id??``,prompt:tn(e),docName:nn(e),titleHint:rn(e)})}async function on(e,t,n,r=1){if(e===`claude-cowork`&&r===1){let e;try{e=await n.ensureCoworkSkillInstalled()}catch(e){let t=e instanceof Error?e.message:String(e);return n.toast.error(`Couldn't install OpenKnowledge skill — ${t}`),{ok:!1,reason:`dispatch-error`,detail:`install-error: ${t}`}}if(e.kind===`installed-now`)return n.toast.success(`OpenKnowledge skill saved. Upload it in Claude Desktop, then click Cowork again.`),{ok:!0};if(e.kind===`install-failed`){let t=e.message??e.reason;return n.toast.error(`Couldn't install OpenKnowledge skill — ${t}`),{ok:!1,reason:`dispatch-error`,detail:`install-failed: ${t}`}}}let i={target:e,projectDir:t.projectDir,docPath:t.docPath,prompt:$t(t,e,n.autoOpen,`url`)},a=await n.dispatchHandoff(i),o=n.isElectronHost()?`electron`:`web`,s=n.now().toISOString(),c=t.compose,l=Zt(e,a,o,s,t.selection!=null||c?.scope===`doc`&&c.selection!==void 0?`selection`:void 0);await n.recordHandoff(l);let u=n.getDisplayName(e);if(a.ok)n.toast.success(Jt(u));else{let i=Xt(r),a=Yt(u,r);i===null?n.toast.error(a):n.toast.error(a,{action:{label:i,onClick:()=>{on(e,t,n,r+1)}}})}return a}function sn(e){return U.find(t=>t.id===e)?.displayName??e}function cn(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function ln(){return{dispatchHandoff:It,recordHandoff:Lt,toast:{success:e=>{Z.success(e)},error:(e,t)=>{Z.error(e,t?{action:t.action}:void 0)}},now:()=>new Date,isElectronHost:()=>cn(),getDisplayName:sn,ensureCoworkSkillInstalled:Nt,autoOpen:!0}}function un(){let e=(0,_t.c)(2),{merged:t}=st(),n=t?.appearance?.preview?.autoOpen??!0,r;return e[0]===n?r=e[1]:(r={dispatch:(e,t)=>on(e,t,{...ln(),autoOpen:n}),reinstallCoworkSkill:Pt},e[0]=n,e[1]=r),r}var dn=Object.freeze({hosts:null,source:null}),fn=new Map,pn=new Map;function mn(e,t){return`${e}:${t}`}function hn(e){return fn.get(e)??dn}function gn(e,t){let n=pn.get(e)??new Set;return pn.set(e,n),n.add(t),()=>{n.delete(t),n.size===0&&pn.delete(e)}}function _n(e,t){let n=hn(e),r={...n,...t};if(!(r.hosts===n.hosts&&r.source===n.source)){r.hosts===null&&r.source===null?fn.delete(e):fn.set(e,r);for(let t of pn.get(e)??[])t()}}var vn=X.options,yn=`min-w-[24rem]`;function bn(e,t){let n=(0,_t.c)(45),r=t.installingName===e.name,i=(0,$.useRef)(e),[a,o]=(0,$.useState)(!1),s=(0,$.useRef)(!1),c,l;n[0]===r?(c=n[1],l=n[2]):(c=()=>{s.current&&!r&&o(!0),s.current=r},l=[r],n[0]=r,n[1]=c,n[2]=l),(0,$.useEffect)(c,l);let u,d;n[3]===e?(u=n[4],d=n[5]):(u=()=>{e!==i.current&&(i.current=e,o(!1))},d=[e],n[3]=e,n[4]=u,n[5]=d),(0,$.useEffect)(u,d);let f=r||a,p;n[6]!==e.name||n[7]!==e.scope?(p=mn(e.scope,e.name),n[6]=e.name,n[7]=e.scope,n[8]=p):p=n[8];let m=p,h,g;n[9]===m?(h=n[10],g=n[11]):(h=e=>gn(m,e),g=()=>hn(m),n[9]=m,n[10]=h,n[11]=g);let _=(0,$.useSyncExternalStore)(h,g),v=_.hosts,y=_.source,b,x;n[12]!==y||n[13]!==m||n[14]!==e.hosts?(b=()=>{y!==null&&e.hosts[0]===y&&_n(m,{source:null})},x=[e.hosts,y,m],n[12]=y,n[13]=m,n[14]=e.hosts,n[15]=b,n[16]=x):(b=n[15],x=n[16]),(0,$.useEffect)(b,x);let S=e.linkMode===!0,C=v??e.hosts,w;n[17]===C?w=n[18]:(w=new Set(C),n[17]=C,n[18]=w);let T=w,E=v?v.length>0:e.installed,D=(0,$.useRef)(e.hosts),O,k;n[19]!==v||n[20]!==e.hosts?(O=()=>{v===null&&(D.current=e.hosts)},k=[v,e.hosts],n[19]=v,n[20]=e.hosts,n[21]=O,n[22]=k):(O=n[21],k=n[22]),(0,$.useEffect)(O,k);let ee;n[23]===e.hosts?ee=n[24]:(ee=[...e.hosts].sort().join(`,`),n[23]=e.hosts,n[24]=ee);let A=ee,j,M;n[25]!==m||n[26]!==A?(j=()=>{let e=hn(m).hosts;e&&[...e].sort().join(`,`)===A&&_n(m,{hosts:null})},M=[A,m],n[25]=m,n[26]=A,n[27]=j,n[28]=M):(j=n[27],M=n[28]),(0,$.useEffect)(j,M);let N=(0,$.useRef)(null),P=(0,$.useRef)(null),F,I;n[29]===Symbol.for(`react.memo_cache_sentinel`)?(F=()=>()=>{N.current&&clearTimeout(N.current),P.current?.(),P.current=null},I=[],n[29]=F,n[30]=I):(F=n[29],I=n[30]),(0,$.useEffect)(F,I);let L;n[31]!==t||n[32]!==m||n[33]!==e?(L=function(n,r){D.current=n,_n(m,{hosts:n}),N.current&&clearTimeout(N.current);let i=async()=>{P.current=null,N.current=null;let r=await t.install(e,n.filter(Te));if(!r.ok){_n(m,{hosts:null});return}D.current=[...r.hosts],_n(m,{hosts:[...r.hosts]})};r?(P.current=()=>void i(),N.current=setTimeout(()=>void i(),350)):(P.current=null,i())},n[31]=t,n[32]=m,n[33]=e,n[34]=L):L=n[34];let R=L,te;return n[35]!==t||n[36]!==R||n[37]!==T||n[38]!==E||n[39]!==f||n[40]!==y||n[41]!==m||n[42]!==S||n[43]!==e?(te={hostSet:T,installed:E,installing:f,toggleEditor(e,t){let n=new Set(D.current);t?n.add(e):n.delete(e),R([...n],!0)},installAll(){let t=D.current.filter(Cn),n=e.installableEditors??vn,r=vn.filter(e=>n.includes(e)||D.current.includes(e));R([...t,...r],!1)},linkMode:S,sourceHost:y??e.hosts[0],placeAt(n,r){t.runLocationWrite(e,()=>it({scope:e.scope,name:e.name,dir:n,mode:r})).then(Sn)},unplaceAt(n){t.runLocationWrite(e,()=>Xe({scope:e.scope,name:e.name,path:n})).then(xn)},setSource(n){_n(m,{source:n}),t.runLocationWrite(e,()=>Ye({scope:e.scope,name:e.name,target:n})).then(e=>{e.ok||(_n(m,{source:null}),Z.error(e.error))})},convertLocation(n,r){t.convertLocations(e,[{target:n,mode:r}])},convertLocations(n){t.convertLocations(e,n)}},n[35]=t,n[36]=R,n[37]=T,n[38]=E,n[39]=f,n[40]=y,n[41]=m,n[42]=S,n[43]=e,n[44]=te):te=n[44],te}function xn(e){e.ok||Z.error(e.error)}function Sn(e){e.ok||Z.error(e.error)}function Cn(e){return!vn.includes(e)}function wn(e){let t=(0,_t.c)(7),{hint:n,children:r}=e,i;t[0]===r?i=t[1]:(i=(0,Q.jsx)(x,{asChild:!0,children:r}),t[0]=r,t[1]=i);let a;t[2]===n?a=t[3]:(a=(0,Q.jsx)(S,{side:`right`,className:`max-w-xs`,children:n}),t[2]=n,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,Q.jsxs)(C,{children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function Tn(e){let t=(0,_t.c)(155),{toggles:n,skill:r,onResolveFork:i,onRunStart:a}=e,{_:o}=u(),{hostSet:s,toggleEditor:c,installAll:d}=n,f;t[0]===r?f=t[1]:(f=e=>r?`${qe(e,r.scope)}/${r.name}`:null,t[0]=r,t[1]=f);let p=f,m=ct(),h;t[2]!==m.data||t[3]!==m.status||t[4]!==r?(h=r!==void 0&&((r.hosts??[]).includes(`agents`)||m.status===`ready`&&m.data.some(Ln)),t[2]=m.data,t[3]=m.status,t[4]=r,t[5]=h):h=t[5];let _=h,v;t[6]!==m.data||t[7]!==m.status||t[8]!==r?(v=r?.hostAliases??(r&&m.status===`ready`?Object.assign({},...m.data.filter(e=>e.scope===r.scope).map(In)):{}),t[6]=m.data,t[7]=m.status,t[8]=r,t[9]=v):v=t[9];let x=v,S;t[10]!==m.data||t[11]!==m.status||t[12]!==r?(S=r?.installableEditors??(r&&m.status===`ready`?m.data.find(e=>e.scope===r.scope)?.installableEditors:void 0),t[10]=m.data,t[11]=m.status,t[12]=r,t[13]=S):S=t[13];let C=S,w,T,E,D,O,k,ee;if(t[14]!==o||t[15]!==x||t[16]!==m.data||t[17]!==m.status||t[18]!==s||t[19]!==_||t[20]!==d||t[21]!==C||t[22]!==i||t[23]!==a||t[24]!==p||t[25]!==r||t[26]!==c||t[27]!==n){let e=C?new Set(C):null,u;t[35]===x?u=t[36]:(u=e=>!(e in x),t[35]=x,t[36]=u);let f=(_?[`agents`,...vn]:vn).filter(u).filter(t=>t===`agents`||e===null||e.has(t)||s.has(t)),h;t[37]===p?h=t[38]:(h=e=>p(e),t[37]=p,t[38]=h);let v=new Set(f.map(h)),S=r?.scope===`global`?`~/`:``,A;t[39]!==S||t[40]!==r?(A=r?.path?.includes(`/`)?`${S}${r.path.replace(/\/SKILL\.mdx?$/i,``)}`:null,t[39]=S,t[40]=r,t[41]=A):A=t[41];let j=A,M=j!==null&&!v.has(j)?j:null,N=M===null?n.sourceHost??r?.hosts?.[0]:void 0,P;t[42]===x?P=t[43]:(P=e=>Ge(x,e),t[42]=x,t[43]=P);let L=P,R=Fn,te;t[44]!==o||t[45]!==L?(te=e=>{let t=L(e);return t.length===0?!0:window.confirm(o({id:`Uobeu9`,values:{0:t.map(R).join(`, `),rootRel:e}}))},t[44]=o,t[45]=L,t[46]=te):te=t[46];let z=te,B;t[47]!==o||t[48]!==r?(B=(e,t)=>{let n=e.includes(`/`)?e:qe(e,r?.scope??`project`);return(0,Q.jsx)(wn,{hint:o({id:`0dslv8`,values:{0:R(e),1:R(e),2:r?.name??``,poolRootRel:t,subRoot:n}}),children:(0,Q.jsx)(b,{variant:`ghost`,size:`sm`,className:`h-4 shrink-0 px-0`,"aria-label":o({id:`G6Lrs_`,values:{0:R(e)}}),onClick:i=>{i.preventDefault(),i.stopPropagation(),window.confirm(o({id:`iiqOKM`,values:{0:R(e),1:r.name,2:R(e),subRoot:n,poolRootRel:t}}))&&ot({scope:r.scope,root:n,action:`unlink`,exclude:[r.name]}).then(e=>{e.ok?Ue():Z.error(o({id:`PRgIJh`,values:{0:e.error,subRoot:n}}))})},"data-testid":`skill-audience-unfollow-${e}`,children:(0,Q.jsx)(g,{host:e,"aria-hidden":!0,className:`size-3.5`})})},e)},t[47]=o,t[48]=r,t[49]=B):B=t[49];let V=B,H;t[50]===r?.conflictHosts?H=t[51]:(H=r?.conflictHosts??[],t[50]=r?.conflictHosts,t[51]=H);let U;t[52]===H?U=t[53]:(U=new Set(H),t[52]=H,t[53]=U);let W=U,G;t[54]===r?.driftPaths?G=t[55]:(G=r?.driftPaths??[],t[54]=r?.driftPaths,t[55]=G);let K;t[56]===G?K=t[57]:(K=new Set(G),t[56]=G,t[57]=K);let q=K;w=n.installing;let J=Pn,Y;t[58]===r?.symlinkedHosts?Y=t[59]:(Y=r?.symlinkedHosts??[],t[58]=r?.symlinkedHosts,t[59]=Y);let ne;t[60]===Y?ne=t[61]:(ne=new Set(Y),t[60]=Y,t[61]=ne);let X=ne,re=[...[...s].filter(e=>e!==N&&!(e in x)&&!W.has(e)&&!e.includes(`/`)).map(e=>X.has(e)?`link`:`copy`),...(r?.customPlacements??[]).map(Nn)],ie=re.filter(Mn).length;E=re.length===0?n.linkMode?`link`:`copy`:ie*2>=re.length?`link`:`copy`;let ae;t[62]!==x||t[63]!==W||t[64]!==s||t[65]!==X||t[66]!==p||t[67]!==N?(ae=[...s].filter(e=>e!==N&&!(e in x)&&!W.has(e)&&!e.includes(`/`)).map(e=>({target:e,display:p(e)??R(e),mode:X.has(e)?`link`:`copy`})),t[62]=x,t[63]=W,t[64]=s,t[65]=X,t[66]=p,t[67]=N,t[68]=ae):ae=t[68];let oe;t[69]===r?.customPlacements?oe=t[70]:(oe=r?.customPlacements??[],t[69]=r?.customPlacements,t[70]=oe);let se;if(t[71]!==S||t[72]!==ae||t[73]!==oe){let e;t[75]===S?e=t[76]:(e=e=>({target:Ke(e),display:`${S}${e.path}`,mode:e.mode}),t[75]=S,t[76]=e),se=[...ae,...oe.map(e)],t[71]=S,t[72]=ae,t[73]=oe,t[74]=se}else se=t[74];T=se;let ce;t[77]!==o||t[78]!==a||t[79]!==n?(ce=(e,t,r)=>{let i=r===`link`?`copy`:`link`;return(0,Q.jsx)(wn,{hint:o(r===`link`?{id:`FeXcUS`,values:{display:t}}:{id:`ugQcJX`,values:{display:t}}),children:(0,Q.jsx)(b,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-yellow-500/40 bg-yellow-500/10 px-1 font-normal text-[10px] text-yellow-600 uppercase tracking-wide hover:bg-yellow-500/20`,onClick:r=>{r.preventDefault(),r.stopPropagation(),window.confirm(o(i===`link`?{id:`m0eHej`,values:{display:t}}:{id:`HbcQYf`,values:{display:t}}))&&(a?.(),n.convertLocation?.(e,i))},"data-testid":`skill-convert-${e}`,children:r===`link`?(0,Q.jsx)(l,{id:`uUCrBv`}):(0,Q.jsx)(l,{id:`iaPtht`})})})},t[77]=o,t[78]=a,t[79]=n,t[80]=ce):ce=t[80];let le=ce,ue;t[81]===r?.customPlacements?ue=t[82]:(ue=r?.customPlacements??[],t[81]=r?.customPlacements,t[82]=ue);let de=new Map(ue.map(jn)),fe=new Set(de.keys());if(m.status===`ready`&&r){for(let e of m.data)if(e.scope===r.scope)for(let t of e.customPlacements??[]){let e=Ke(t);e!==``&&fe.add(e)}}let pe=r===void 0?[]:[...fe].sort().map(e=>({root:e,display:`${S}${e}/${r.name}`,placed:de.get(e)??null})).filter(e=>!v.has(e.display)&&e.display!==j&&!(e.root in x)),me;t[83]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,Q.jsx)(l,{id:`npcziF`}),t[83]=me):me=t[83];let he;t[84]===o?he=t[85]:(he=o({id:`6f_UX4`}),t[84]=o,t[85]=he);let ge;t[86]===d?ge=t[87]:(ge=()=>d(),t[86]=d,t[87]=ge);let _e;t[88]===Symbol.for(`react.memo_cache_sentinel`)?(_e=(0,Q.jsx)(l,{id:`N40H-G`}),t[88]=_e):_e=t[88];let ye;t[89]!==w||t[90]!==ge?(ye=(0,Q.jsx)(b,{variant:`ghost`,size:`sm`,className:`h-5 px-1.5 font-normal text-[11px] text-muted-foreground hover:text-foreground`,disabled:w,onClick:ge,"data-testid":`skill-install-all`,children:_e}),t[89]=w,t[90]=ge,t[91]=ye):ye=t[91],t[92]!==he||t[93]!==ye?(D=(0,Q.jsxs)(I,{className:`flex items-center justify-between gap-2`,children:[me,(0,Q.jsx)(wn,{hint:he,children:ye})]}),t[92]=he,t[93]=ye,t[94]=D):D=t[94],t[95]!==o||t[96]!==V||t[97]!==w||t[98]!==M||t[99]!==L?(O=M===null?null:(0,Q.jsx)(wn,{hint:o({id:`pXB6SL`}),children:(0,Q.jsxs)(F,{disabled:w,checked:!0,onSelect:An,"data-testid":`skill-source-row`,children:[(0,Q.jsx)(Me,{"aria-hidden":!0,className:`size-4 text-muted-foreground`}),(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:M}),(()=>{let e=J(M).split(`/`).slice(0,-1).join(`/`),t=L(e);return t.length>0?(0,Q.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-source`,children:t.map(t=>V(t,e))}):null})(),(0,Q.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-border/60 px-1 text-[10px] uppercase tracking-wide text-muted-foreground`,children:(0,Q.jsx)(l,{id:`tiFPjk`})})]})]})}),t[95]=o,t[96]=V,t[97]=w,t[98]=M,t[99]=L,t[100]=O):O=t[100];let be;t[101]!==o||t[102]!==V||t[103]!==w||t[104]!==z||t[105]!==W||t[106]!==le||t[107]!==q||t[108]!==E||t[109]!==s||t[110]!==X||t[111]!==i||t[112]!==p||t[113]!==r?.hosts||t[114]!==N||t[115]!==L||t[116]!==c||t[117]!==n?(be=e=>{let t=p(e),a=e===`agents`?`.agents`:ve[e],u=J(t).split(`/`).slice(0,-1).join(`/`),d=L(u);return(0,Q.jsx)(wn,{hint:W.has(e)?o({id:`8HvJlU`,values:{0:t??a}}):e===N?t?o({id:`ssk6rl`,values:{path:t}}):a:s.has(e)?o(t?{id:`9ieZhu`,values:{path:t}}:{id:`n3T3EE`,values:{label:a}}):o(t?E===`link`?{id:`1LtA5r`,values:{path:t}}:{id:`opPbzN`,values:{path:t}}:{id:`Pp0Vgd`,values:{label:a}}),children:(0,Q.jsxs)(F,{disabled:w,checked:s.has(e),onCheckedChange:t=>{W.has(e)||t===!0&&!z(u)||c(e,t===!0)},onSelect:kn,className:`group`,"data-testid":`skill-install-editor-${e}`,children:[(0,Q.jsx)(g,{host:e,"aria-hidden":!0,className:`size-4`}),(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:t??a}),d.length>0?(0,Q.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-${e}`,children:d.map(e=>V(e,u))}):null,W.has(e)?(0,Q.jsx)(wn,{hint:o({id:`_O7dJS`}),children:(0,Q.jsx)(b,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-yellow-500/40 bg-yellow-500/10 px-1 text-[10px] text-yellow-600 uppercase tracking-wide hover:bg-yellow-500/20`,onClick:t=>{t.preventDefault(),i?.(e)},"data-testid":`skill-fork-chip-${e}`,children:(0,Q.jsx)(l,{id:`jng7Ko`})})}):e===N?(0,Q.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-border/60 px-1 text-[10px] uppercase tracking-wide text-muted-foreground`,children:(0,Q.jsx)(l,{id:`tiFPjk`})}):s.has(e)&&r?.hosts?(0,Q.jsxs)(Q.Fragment,{children:[!w&&(X.has(e)?`link`:`copy`)!==E?le(e,t??a,X.has(e)?`link`:`copy`):null,(0,Q.jsx)(wn,{hint:o({id:`nBgzKO`}),children:(0,Q.jsx)(b,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-border/60 px-1 font-normal text-[10px] text-muted-foreground uppercase tracking-wide opacity-0 focus-visible:opacity-100 group-hover:opacity-100 hover:border-foreground/40 hover:text-foreground`,onClick:t=>{t.preventDefault(),t.stopPropagation(),n.setSource?.(e)},"data-testid":`skill-set-source-${e}`,children:(0,Q.jsx)(l,{id:`VNNRfN`})})})]}):null,!w&&q.has(J(t))?(0,Q.jsx)(wn,{hint:o({id:`iz1LdD`}),children:(0,Q.jsx)(y,{testId:`skill-drift-${e}`})}):null]})]})},e)},t[101]=o,t[102]=V,t[103]=w,t[104]=z,t[105]=W,t[106]=le,t[107]=q,t[108]=E,t[109]=s,t[110]=X,t[111]=i,t[112]=p,t[113]=r?.hosts,t[114]=N,t[115]=L,t[116]=c,t[117]=n,t[118]=be):be=t[118],k=f.map(be);let xe;t[119]!==o||t[120]!==V||t[121]!==w||t[122]!==z||t[123]!==le||t[124]!==q||t[125]!==E||t[126]!==L||t[127]!==n?(xe=e=>(0,Q.jsx)(wn,{hint:e.placed===null?o(E===`link`?{id:`ybWWR2`,values:{0:e.display}}:{id:`fDjZxw`,values:{0:e.display}}):o({id:`C0cll5`,values:{0:e.display}}),children:(0,Q.jsxs)(F,{disabled:w,checked:e.placed!==null,onCheckedChange:t=>{if(t===!0&&e.placed===null){if(!z(e.root))return;n.placeAt(e.root,E)}else e.placed!==null&&n.unplaceAt?.(e.placed.path)},onSelect:On,className:`group`,"data-testid":`skill-custom-root-${e.root}`,children:[e.root===`.agents/skills`?(0,Q.jsx)(g,{host:`agents`,"aria-hidden":!0,className:`size-4`}):(0,Q.jsx)(Me,{"aria-hidden":!0,className:`size-4 text-muted-foreground`}),(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:e.display}),L(e.root).length>0?(0,Q.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-custom-${e.root}`,children:L(e.root).map(t=>V(t,e.root))}):null,!w&&e.placed!==null&&q.has(e.placed.path)?(0,Q.jsx)(wn,{hint:o({id:`iz1LdD`}),children:(0,Q.jsx)(y,{testId:`skill-drift-custom-${e.root}`})}):e.placed===null?null:(0,Q.jsxs)(Q.Fragment,{children:[!w&&e.placed.mode!==E?le(e.root,e.display,e.placed.mode):null,(0,Q.jsx)(wn,{hint:o({id:`nBgzKO`}),children:(0,Q.jsx)(b,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-border/60 px-1 font-normal text-[10px] text-muted-foreground uppercase tracking-wide opacity-0 focus-visible:opacity-100 group-hover:opacity-100 hover:border-foreground/40 hover:text-foreground`,onClick:t=>{t.preventDefault(),t.stopPropagation(),n.setSource?.(e.root)},"data-testid":`skill-set-source-custom-${e.root}`,children:(0,Q.jsx)(l,{id:`VNNRfN`})})})]})]})]})},e.root),t[119]=o,t[120]=V,t[121]=w,t[122]=z,t[123]=le,t[124]=q,t[125]=E,t[126]=L,t[127]=n,t[128]=xe):xe=t[128],ee=pe.map(xe),t[14]=o,t[15]=x,t[16]=m.data,t[17]=m.status,t[18]=s,t[19]=_,t[20]=d,t[21]=C,t[22]=i,t[23]=a,t[24]=p,t[25]=r,t[26]=c,t[27]=n,t[28]=w,t[29]=T,t[30]=E,t[31]=D,t[32]=O,t[33]=k,t[34]=ee}else w=t[28],T=t[29],E=t[30],D=t[31],O=t[32],k=t[33],ee=t[34];let A;t[129]!==o||t[130]!==w||t[131]!==T||t[132]!==E||t[133]!==a||t[134]!==n?(A=T.length>0&&n.convertLocations?(0,Q.jsxs)(`div`,{className:`flex items-center gap-1 px-2 pt-1 pb-1.5`,children:[(0,Q.jsx)(b,{variant:`ghost`,size:`sm`,className:`h-auto whitespace-normal p-0 text-left font-normal text-[11px] text-muted-foreground leading-snug hover:bg-transparent hover:text-foreground`,onClick:e=>{e.preventDefault();let t=E===`link`?`copy`:`link`,r=T.filter(e=>e.mode!==t);if(r.length===0)return;let i=o(t===`copy`?{id:`iOAsF1`}:{id:`MS8lMS`}),s=o(t===`copy`?{id:`gZiT5e`}:{id:`PhIa-X`}),c=r.map(Dn).join(`
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{F as n,I as r,P as i,Pn as a,_n as o,i as s}from"./DocumentContext-DtWKWc6V.js";import{t as c}from"./react-f2sANaYj.js";import{n as l,r as u}from"./dist-Nvb76hAm.js";import{t as d}from"./compiler-runtime-BfE3aGVn.js";import{l as f}from"./terminal-input-events-BGPQuYMh.js";import{t as p}from"./use-workspace-DTXZHJjI.js";import{c as m,i as h,n as g,o as _,s as v,t as y}from"./ChangedOutsideBadge-iFQrYC_j.js";import{t as b}from"./button-RQ5o7P7w.js";import{i as x,n as S,t as C}from"./tooltip-x7BNUa3s.js";import{a as w,c as T,i as E,n as D,o as O,r as k,s as ee,t as A}from"./dialog-FGMqkFjm.js";import{a as j,d as M,f as N,i as P,n as F,o as I,p as L,u as R}from"./dropdown-menu-AlVJ7dJz.js";import{t as te}from"./label-G0lbYOgL.js";import{C as z,a as B,f as V,h as H,m as U,n as W,o as G,p as K,r as q,s as J,t as Y}from"./agent-visibility-k-CBEP62.js";import{$t as ne,Dt as X,Ia as re,Kt as ie,Mt as ae,Ra as oe,Sn as se,Va as ce,Zt as le,_n as ue,bn as de,en as fe,fn as pe,hn as me,jt as he,mn as ge,nt as _e,pa as ve,pn as ye,ri as be,tt as xe,xn as Se,xt as Ce,yn as we,yr as Te}from"./dist-BqtkiFoE2.js";import{t as Ee}from"./createLucideIcon-DihYAFEK.js";import{t as De}from"./RegisteredAgentIcon-H3tp7x07.js";import{n as Oe,r as ke}from"./ManagedArtifactProperties-aEllvXPH.js";import{n as Ae}from"./CopyButton-D6N3opvE.js";import{t as je}from"./folder-open-Ceue91os.js";import{t as Me}from"./folder-DcWlgZbb.js";import{t as Ne}from"./trash-2-WxyktwvM.js";import{n as Z}from"./dist-uN7pEWl0.js";import{t as Pe}from"./input-Cm94Cun3.js";import{t as Fe}from"./dist-CzC3AWOn.js";import{i as Ie}from"./use-settings-route-B0zt3SsC.js";import{t as Le}from"./parse-api-error-Dmlzsw8v.js";import{G as Re,O as ze,W as Be}from"./navigation-targets-WVfDNB_X.js";import{c as Ve,n as He,o as Ue}from"./documents-events-D-wbjalg.js";import{d as We,n as Ge,r as Ke,s as qe}from"./skill-scope-mciGgli7.js";import{A as Je,D as Ye,O as Xe,S as Ze,_ as Qe,c as $e,f as et,i as tt,n as nt,t as rt,v as it,x as at,y as ot}from"./skills-api-BCwis81Y.js";import{n as st}from"./config-context-BzGTI1i6.js";import{t as ct}from"./use-skills-CJcOuHij.js";import{t as lt}from"./use-open-skill-s-eClkKp.js";import{n as ut}from"./clipboard-adapter-Brbch5VX.js";import{t as dt}from"./DiffView-BBC1fcoF.js";var ft=Ee(`arrow-left-right`,[[`path`,{d:`M8 3 4 7l4 4`,key:`9rb6wj`}],[`path`,{d:`M4 7h16`,key:`6tx8e3`}],[`path`,{d:`m16 21 4-4-4-4`,key:`siv7j2`}],[`path`,{d:`M20 17H4`,key:`h6l3hr`}]]),pt=Ee(`cloud-download`,[[`path`,{d:`M12 13v8l-4-4`,key:`1f5nwf`}],[`path`,{d:`m12 21 4-4`,key:`1lfcce`}],[`path`,{d:`M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284`,key:`ui1hmy`}]]),mt=Ee(`list-plus`,[[`path`,{d:`M16 5H3`,key:`m91uny`}],[`path`,{d:`M11 12H3`,key:`51ecnj`}],[`path`,{d:`M16 19H3`,key:`zzsher`}],[`path`,{d:`M18 9v6`,key:`1twb98`}],[`path`,{d:`M21 12h-6`,key:`bt1uis`}]]),ht=Ee(`pencil-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),gt=Ee(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Q=t(),$=e(c(),1),_t=d();function vt(e){return{async install(t){let n;try{n=await e.buildAndOpen(t?.force?{force:!0}:void 0)}catch(e){return{ok:!1,reason:`bridge-error`,message:e instanceof Error?e.message:String(e)}}return n.ok?{ok:!0,path:n.path}:{ok:!1,reason:n.reason,message:n.message}}}}function yt(e={}){let t=e.fetch??globalThis.fetch,n=`${e.apiOrigin??``}/api/install-skill`;return{async install(e){let r;try{r=await t(n,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e?.force?{force:!0}:{})})}catch(e){return{ok:!1,reason:`network-error`,message:e instanceof Error?e.message:String(e)}}if(!r.ok){let e=`HTTP ${r.status}`;try{let t=Le(await r.json());t&&(e=t)}catch{}return{ok:!1,reason:`http-error`,message:e}}let i;try{i=await r.json()}catch(e){return{ok:!1,reason:`parse-error`,message:e instanceof Error?e.message:`Invalid server response`}}return!i||typeof i.status!=`string`?{ok:!1,reason:`parse-error`,message:`Invalid server response shape`}:i.status===`failed`?{ok:!1,reason:`build-failed`,message:i.buildError??`unknown build failure`}:{ok:!0,path:i.outputPath,handoffWarning:i.handoffError?.message}}}}function bt(){if(typeof window>`u`)return null;let e=window.okDesktop?.skill;return e?vt(e):yt()}var xt=`ok:skill:cowork:installed`,St=`1`,Ct=250,wt=`/api/skill/install-state`;function Tt(e){return`${xt}:v${e}`}var Et=new Map;async function Dt(e={},t={}){let n=t.force?`__force__`:`__default__`,r=Et.get(n);if(r)return r;let i=Ot(e,t);return Et.set(n,i),i.finally(()=>{Et.get(n)===i&&Et.delete(n)}),i}async function Ot(e,t){let n=e.installer===void 0?bt():e.installer,r=kt(e.storage),i=e.fetchSnapshot??jt,a=e.serverTimeoutMs??Ct,o=null;if(!t.force){try{o=await Mt(i(),a)}catch(e){console.warn(`[cowork-skill] server install-state check failed; falling through:`,e)}if(o){let e=o.targets[`claude-cowork`]??null;if(e&&e.version===o.currentVersion)return{kind:`already-installed`,source:`server`}}}let s=Tt(o?.currentVersion??e.fallbackSkillVersion??At());if(!t.force&&r?.getItem(s)===St)return{kind:`already-installed`,source:`local`};if(!n)return{kind:`host-unsupported`};let c=await n.install({force:t.force??!1});if(!c.ok)return{kind:`install-failed`,reason:c.reason,message:c.message};try{r?.setItem(s,St)}catch(e){console.warn(`[cowork-skill] storage.setItem failed (guard will not persist):`,e)}return{kind:`installed-now`,path:c.path,handoffWarning:c.handoffWarning}}function kt(e){if(e!==void 0)return e;if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function At(){return typeof window>`u`?`unknown`:window.okDesktop?.appVersion??`unknown`}async function jt(){let e;try{e=await fetch(wt,{method:`GET`,cache:`no-store`})}catch{return null}if(!e.ok)return null;try{let t=await e.json();return typeof t?.currentVersion==`string`?t:null}catch{return null}}async function Mt(e,t){return Promise.race([e,new Promise(e=>{setTimeout(()=>e(null),t)})])}function Nt(e){return Dt({},e)}function Pt(){return Dt({},{force:!0})}async function Ft(e,t){let n;try{n=await t(`/api/handoff`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})}catch(e){return{ok:!1,reason:`dispatch-error`,detail:e instanceof Error?e.message:String(e)}}return n.status===200?{ok:!0}:n.status===404?{ok:!1,reason:`not-installed`,detail:`POST /api/handoff returned 404`}:n.status===422?{ok:!1,reason:`not-installed`,detail:`POST /api/handoff returned ${n.status}`}:{ok:!1,reason:`dispatch-error`,detail:`POST /api/handoff returned ${n.status}`}}async function It(e,t={}){let n=t.fetch??globalThis.fetch.bind(globalThis);switch(e.target){case`claude-cowork`:return Ft({target:`claude-cowork`,url:le({mode:`cowork`},e)},n);case`claude-code`:return Ft({target:`claude-code`,url:le({mode:`code`},e)},n);case`codex`:return Ft({target:`codex`,url:ne(e)},n);case`cursor`:return Ft({target:`cursor`,url:fe(e),workspacePath:e.projectDir},n);case`copilot`:return{ok:!1,reason:`invalid-payload`,detail:`copilot is terminal-only; launch via requestTerminalLaunch`};case`opencode`:return{ok:!1,reason:`invalid-payload`,detail:`opencode is terminal-only; launch via requestTerminalLaunch`};case`pi`:return{ok:!1,reason:`invalid-payload`,detail:`pi is terminal-only; launch via requestTerminalLaunch`};case`antigravity`:return{ok:!1,reason:`invalid-payload`,detail:`antigravity is terminal-only; launch via requestTerminalLaunch`};case`openclaw`:return{ok:!1,reason:`invalid-payload`,detail:`openclaw is terminal-only; launch via requestTerminalLaunch`};case`hermes`:return{ok:!1,reason:`invalid-payload`,detail:`hermes is terminal-only; launch via requestTerminalLaunch`};default:{let t=e.target;return{ok:!1,reason:`invalid-payload`,detail:`unknown target: ${String(t)}`}}}}async function Lt(e,t={}){let n=t.okDesktop??(typeof window<`u`?window.okDesktop:void 0);if(n?.shell?.recordHandoff)try{await n.shell.recordHandoff(e)}catch(e){(t.warn??(e=>console.warn(e)))(`[handoff] recordHandoff IPC rejected (telemetry skipped): ${e instanceof Error?e.message:String(e)}`)}}var Rt=`open-knowledge:agent-thread-launch`;function zt(e,t=typeof window>`u`?new EventTarget:window){t.dispatchEvent(new CustomEvent(Rt,{detail:e}))}function Bt(e,t=typeof window>`u`?new EventTarget:window){let n=t=>{let n=t instanceof CustomEvent?t.detail:void 0;n&&typeof n.agentId==`string`&&e(n)};return t.addEventListener(Rt,n),()=>t.removeEventListener(Rt,n)}function Vt(e){if(!e.docName||!e.workspace)return null;let t=i(e.docName),{contentDir:r,pathSeparator:a}=e.workspace;return{docContext:{relativePath:t},projectDir:r,docPath:n(r,t,a)}}function Ht(e){return e.workspace?.contentDir?{docContext:null,projectDir:e.workspace.contentDir,docPath:``}:null}function Ut(e){return e.workspace?.contentDir?{docContext:null,createDescription:e.description,createScenario:e.scenario,createMentions:e.mentions,projectDir:e.workspace.contentDir,docPath:``}:null}function Wt(e){return K(e.installUrl).then(()=>void 0)}function Gt(e){return!e.workspace?.contentDir||!e.folderRelativePath?null:{docContext:null,folderRelativePath:e.folderRelativePath,projectDir:e.workspace.contentDir,docPath:``}}function Kt(e){return!e.workspace?.contentDir||!e.skillName?null:{docContext:null,skill:{name:e.skillName,scope:e.scope},projectDir:e.workspace.contentDir,docPath:``}}function qt(e){if(!e.workspace?.contentDir)return null;let{contentDir:t,pathSeparator:r}=e.workspace;if(e.docName){let a=e.docRelativePath??i(e.docName),o={scope:`doc`,docRelativePath:a,instruction:e.instruction,mentions:e.mentions};return{docContext:null,compose:e.selection===void 0?o:{...o,selection:e.selection},projectDir:t,docPath:n(t,a,r)}}return e.folderRelativePath?{docContext:null,compose:{scope:`folder`,folderRelativePath:e.folderRelativePath,instruction:e.instruction,mentions:e.mentions},projectDir:t,docPath:``}:{docContext:null,compose:{scope:`project`,instruction:e.instruction,mentions:e.mentions},projectDir:t,docPath:``}}function Jt(e){return`Opened in ${e}.`}function Yt(e,t=1){return t>=3?`Couldn't reach ${e} — please try again later.`:t===2?`Still couldn't reach ${e} — try one more time?`:`Couldn't reach ${e} — try again?`}function Xt(e){return e>=3?null:e===2?`Try one more time`:`Retry`}function Zt(e,t,n,r,i){let a=i===void 0?{}:{scope:i};return t.ok?{target:e,host:n,outcome:`ok`,ts:r,...a}:{target:e,host:n,outcome:`error`,ts:r,reason:t.reason,...a}}function Qt(e,t,n,r){if(e.scope===`doc`){let i={scope:`doc`,docRelativePath:e.docRelativePath,instruction:e.instruction,mentions:e.mentions,target:t,autoOpen:n,transport:r};return e.selection===void 0?i:{...i,selection:e.selection}}return e.scope===`folder`?{scope:`folder`,folderRelativePath:e.folderRelativePath,instruction:e.instruction,mentions:e.mentions,target:t,autoOpen:n,transport:r}:{scope:`project`,instruction:e.instruction,mentions:e.mentions,target:t,autoOpen:n,transport:r}}function $t(e,t,n,r){return e.compose?ie(Qt(e.compose,t,n,r)):e.selection?we({...e.selection,target:t,transport:r}):e.skill?de(e.skill.name,e.skill.scope,n):e.ask?pe(e.ask.relativePath,e.ask.instruction,n,t,r):be(e.docContext===null?e.folderRelativePath?ue(e.folderRelativePath,n,e.instruction,r):e.createDescription===void 0?ge(n,e.instruction,r):ye(e.createDescription,n,e.createScenario??`new-project`,e.createMentions??[],r):me(e.docContext.relativePath,n,e.instruction,r))}function en(e,t){let n=typeof e.instruction==`string`&&e.instruction.trim()!==``;return e.compose!==void 0||e.createDescription!==void 0||n?`${xe} ${$t(e,he[t].handoffTarget,!1,`terminal`)}`:Se(e.docContext?.relativePath??null)}function tn(e){let t=typeof e.instruction==`string`&&e.instruction.trim()!==``;return e.compose!==void 0||e.createDescription!==void 0||t?`${_e} ${$t(e,`claude-code`,!1,`terminal`)}`:se(e.docContext?.relativePath??null)}function nn(e){let t=e.docContext?.relativePath;return typeof t!=`string`||t===``?null:t.replace(/\.(md|mdx)$/,``)}function rn(e){let t=[e.compose?.instruction,e.selection?.instruction,e.ask?.instruction,e.createDescription,e.instruction];for(let e of t)if(typeof e==`string`&&e.trim()!==``)return e;return null}function an(e,t){zt({agentSource:t?.agent?.source??`registry`,agentId:t?.agent?.id??``,prompt:tn(e),docName:nn(e),titleHint:rn(e)})}async function on(e,t,n,r=1){if(e===`claude-cowork`&&r===1){let e;try{e=await n.ensureCoworkSkillInstalled()}catch(e){let t=e instanceof Error?e.message:String(e);return n.toast.error(`Couldn't install OpenKnowledge skill — ${t}`),{ok:!1,reason:`dispatch-error`,detail:`install-error: ${t}`}}if(e.kind===`installed-now`)return n.toast.success(`OpenKnowledge skill saved. Upload it in Claude Desktop, then click Cowork again.`),{ok:!0};if(e.kind===`install-failed`){let t=e.message??e.reason;return n.toast.error(`Couldn't install OpenKnowledge skill — ${t}`),{ok:!1,reason:`dispatch-error`,detail:`install-failed: ${t}`}}}let i={target:e,projectDir:t.projectDir,docPath:t.docPath,prompt:$t(t,e,n.autoOpen,`url`)},a=await n.dispatchHandoff(i),o=n.isElectronHost()?`electron`:`web`,s=n.now().toISOString(),c=t.compose,l=Zt(e,a,o,s,t.selection!=null||c?.scope===`doc`&&c.selection!==void 0?`selection`:void 0);await n.recordHandoff(l);let u=n.getDisplayName(e);if(a.ok)n.toast.success(Jt(u));else{let i=Xt(r),a=Yt(u,r);i===null?n.toast.error(a):n.toast.error(a,{action:{label:i,onClick:()=>{on(e,t,n,r+1)}}})}return a}function sn(e){return U.find(t=>t.id===e)?.displayName??e}function cn(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function ln(){return{dispatchHandoff:It,recordHandoff:Lt,toast:{success:e=>{Z.success(e)},error:(e,t)=>{Z.error(e,t?{action:t.action}:void 0)}},now:()=>new Date,isElectronHost:()=>cn(),getDisplayName:sn,ensureCoworkSkillInstalled:Nt,autoOpen:!0}}function un(){let e=(0,_t.c)(2),{merged:t}=st(),n=t?.appearance?.preview?.autoOpen??!0,r;return e[0]===n?r=e[1]:(r={dispatch:(e,t)=>on(e,t,{...ln(),autoOpen:n}),reinstallCoworkSkill:Pt},e[0]=n,e[1]=r),r}var dn=Object.freeze({hosts:null,source:null}),fn=new Map,pn=new Map;function mn(e,t){return`${e}:${t}`}function hn(e){return fn.get(e)??dn}function gn(e,t){let n=pn.get(e)??new Set;return pn.set(e,n),n.add(t),()=>{n.delete(t),n.size===0&&pn.delete(e)}}function _n(e,t){let n=hn(e),r={...n,...t};if(!(r.hosts===n.hosts&&r.source===n.source)){r.hosts===null&&r.source===null?fn.delete(e):fn.set(e,r);for(let t of pn.get(e)??[])t()}}var vn=X.options,yn=`min-w-[24rem]`;function bn(e,t){let n=(0,_t.c)(45),r=t.installingName===e.name,i=(0,$.useRef)(e),[a,o]=(0,$.useState)(!1),s=(0,$.useRef)(!1),c,l;n[0]===r?(c=n[1],l=n[2]):(c=()=>{s.current&&!r&&o(!0),s.current=r},l=[r],n[0]=r,n[1]=c,n[2]=l),(0,$.useEffect)(c,l);let u,d;n[3]===e?(u=n[4],d=n[5]):(u=()=>{e!==i.current&&(i.current=e,o(!1))},d=[e],n[3]=e,n[4]=u,n[5]=d),(0,$.useEffect)(u,d);let f=r||a,p;n[6]!==e.name||n[7]!==e.scope?(p=mn(e.scope,e.name),n[6]=e.name,n[7]=e.scope,n[8]=p):p=n[8];let m=p,h,g;n[9]===m?(h=n[10],g=n[11]):(h=e=>gn(m,e),g=()=>hn(m),n[9]=m,n[10]=h,n[11]=g);let _=(0,$.useSyncExternalStore)(h,g),v=_.hosts,y=_.source,b,x;n[12]!==y||n[13]!==m||n[14]!==e.hosts?(b=()=>{y!==null&&e.hosts[0]===y&&_n(m,{source:null})},x=[e.hosts,y,m],n[12]=y,n[13]=m,n[14]=e.hosts,n[15]=b,n[16]=x):(b=n[15],x=n[16]),(0,$.useEffect)(b,x);let S=e.linkMode===!0,C=v??e.hosts,w;n[17]===C?w=n[18]:(w=new Set(C),n[17]=C,n[18]=w);let T=w,E=v?v.length>0:e.installed,D=(0,$.useRef)(e.hosts),O,k;n[19]!==v||n[20]!==e.hosts?(O=()=>{v===null&&(D.current=e.hosts)},k=[v,e.hosts],n[19]=v,n[20]=e.hosts,n[21]=O,n[22]=k):(O=n[21],k=n[22]),(0,$.useEffect)(O,k);let ee;n[23]===e.hosts?ee=n[24]:(ee=[...e.hosts].sort().join(`,`),n[23]=e.hosts,n[24]=ee);let A=ee,j,M;n[25]!==m||n[26]!==A?(j=()=>{let e=hn(m).hosts;e&&[...e].sort().join(`,`)===A&&_n(m,{hosts:null})},M=[A,m],n[25]=m,n[26]=A,n[27]=j,n[28]=M):(j=n[27],M=n[28]),(0,$.useEffect)(j,M);let N=(0,$.useRef)(null),P=(0,$.useRef)(null),F,I;n[29]===Symbol.for(`react.memo_cache_sentinel`)?(F=()=>()=>{N.current&&clearTimeout(N.current),P.current?.(),P.current=null},I=[],n[29]=F,n[30]=I):(F=n[29],I=n[30]),(0,$.useEffect)(F,I);let L;n[31]!==t||n[32]!==m||n[33]!==e?(L=function(n,r){D.current=n,_n(m,{hosts:n}),N.current&&clearTimeout(N.current);let i=async()=>{P.current=null,N.current=null;let r=await t.install(e,n.filter(Te));if(!r.ok){_n(m,{hosts:null});return}D.current=[...r.hosts],_n(m,{hosts:[...r.hosts]})};r?(P.current=()=>void i(),N.current=setTimeout(()=>void i(),350)):(P.current=null,i())},n[31]=t,n[32]=m,n[33]=e,n[34]=L):L=n[34];let R=L,te;return n[35]!==t||n[36]!==R||n[37]!==T||n[38]!==E||n[39]!==f||n[40]!==y||n[41]!==m||n[42]!==S||n[43]!==e?(te={hostSet:T,installed:E,installing:f,toggleEditor(e,t){let n=new Set(D.current);t?n.add(e):n.delete(e),R([...n],!0)},installAll(){let t=D.current.filter(Cn),n=e.installableEditors??vn,r=vn.filter(e=>n.includes(e)||D.current.includes(e));R([...t,...r],!1)},linkMode:S,sourceHost:y??e.hosts[0],placeAt(n,r){t.runLocationWrite(e,()=>it({scope:e.scope,name:e.name,dir:n,mode:r})).then(Sn)},unplaceAt(n){t.runLocationWrite(e,()=>Xe({scope:e.scope,name:e.name,path:n})).then(xn)},setSource(n){_n(m,{source:n}),t.runLocationWrite(e,()=>Ye({scope:e.scope,name:e.name,target:n})).then(e=>{e.ok||(_n(m,{source:null}),Z.error(e.error))})},convertLocation(n,r){t.convertLocations(e,[{target:n,mode:r}])},convertLocations(n){t.convertLocations(e,n)}},n[35]=t,n[36]=R,n[37]=T,n[38]=E,n[39]=f,n[40]=y,n[41]=m,n[42]=S,n[43]=e,n[44]=te):te=n[44],te}function xn(e){e.ok||Z.error(e.error)}function Sn(e){e.ok||Z.error(e.error)}function Cn(e){return!vn.includes(e)}function wn(e){let t=(0,_t.c)(7),{hint:n,children:r}=e,i;t[0]===r?i=t[1]:(i=(0,Q.jsx)(x,{asChild:!0,children:r}),t[0]=r,t[1]=i);let a;t[2]===n?a=t[3]:(a=(0,Q.jsx)(S,{side:`right`,className:`max-w-xs`,children:n}),t[2]=n,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,Q.jsxs)(C,{children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function Tn(e){let t=(0,_t.c)(155),{toggles:n,skill:r,onResolveFork:i,onRunStart:a}=e,{_:o}=u(),{hostSet:s,toggleEditor:c,installAll:d}=n,f;t[0]===r?f=t[1]:(f=e=>r?`${qe(e,r.scope)}/${r.name}`:null,t[0]=r,t[1]=f);let p=f,m=ct(),h;t[2]!==m.data||t[3]!==m.status||t[4]!==r?(h=r!==void 0&&((r.hosts??[]).includes(`agents`)||m.status===`ready`&&m.data.some(Ln)),t[2]=m.data,t[3]=m.status,t[4]=r,t[5]=h):h=t[5];let _=h,v;t[6]!==m.data||t[7]!==m.status||t[8]!==r?(v=r?.hostAliases??(r&&m.status===`ready`?Object.assign({},...m.data.filter(e=>e.scope===r.scope).map(In)):{}),t[6]=m.data,t[7]=m.status,t[8]=r,t[9]=v):v=t[9];let x=v,S;t[10]!==m.data||t[11]!==m.status||t[12]!==r?(S=r?.installableEditors??(r&&m.status===`ready`?m.data.find(e=>e.scope===r.scope)?.installableEditors:void 0),t[10]=m.data,t[11]=m.status,t[12]=r,t[13]=S):S=t[13];let C=S,w,T,E,D,O,k,ee;if(t[14]!==o||t[15]!==x||t[16]!==m.data||t[17]!==m.status||t[18]!==s||t[19]!==_||t[20]!==d||t[21]!==C||t[22]!==i||t[23]!==a||t[24]!==p||t[25]!==r||t[26]!==c||t[27]!==n){let e=C?new Set(C):null,u;t[35]===x?u=t[36]:(u=e=>!(e in x),t[35]=x,t[36]=u);let f=(_?[`agents`,...vn]:vn).filter(u).filter(t=>t===`agents`||e===null||e.has(t)||s.has(t)),h;t[37]===p?h=t[38]:(h=e=>p(e),t[37]=p,t[38]=h);let v=new Set(f.map(h)),S=r?.scope===`global`?`~/`:``,A;t[39]!==S||t[40]!==r?(A=r?.path?.includes(`/`)?`${S}${r.path.replace(/\/SKILL\.mdx?$/i,``)}`:null,t[39]=S,t[40]=r,t[41]=A):A=t[41];let j=A,M=j!==null&&!v.has(j)?j:null,N=M===null?n.sourceHost??r?.hosts?.[0]:void 0,P;t[42]===x?P=t[43]:(P=e=>Ge(x,e),t[42]=x,t[43]=P);let L=P,R=Fn,te;t[44]!==o||t[45]!==L?(te=e=>{let t=L(e);return t.length===0?!0:window.confirm(o({id:`Uobeu9`,values:{0:t.map(R).join(`, `),rootRel:e}}))},t[44]=o,t[45]=L,t[46]=te):te=t[46];let z=te,B;t[47]!==o||t[48]!==r?(B=(e,t)=>{let n=e.includes(`/`)?e:qe(e,r?.scope??`project`);return(0,Q.jsx)(wn,{hint:o({id:`0dslv8`,values:{0:R(e),1:R(e),2:r?.name??``,poolRootRel:t,subRoot:n}}),children:(0,Q.jsx)(b,{variant:`ghost`,size:`sm`,className:`h-4 shrink-0 px-0`,"aria-label":o({id:`G6Lrs_`,values:{0:R(e)}}),onClick:i=>{i.preventDefault(),i.stopPropagation(),window.confirm(o({id:`iiqOKM`,values:{0:R(e),1:r.name,2:R(e),subRoot:n,poolRootRel:t}}))&&ot({scope:r.scope,root:n,action:`unlink`,exclude:[r.name]}).then(e=>{e.ok?Ue():Z.error(o({id:`PRgIJh`,values:{0:e.error,subRoot:n}}))})},"data-testid":`skill-audience-unfollow-${e}`,children:(0,Q.jsx)(g,{host:e,"aria-hidden":!0,className:`size-3.5`})})},e)},t[47]=o,t[48]=r,t[49]=B):B=t[49];let V=B,H;t[50]===r?.conflictHosts?H=t[51]:(H=r?.conflictHosts??[],t[50]=r?.conflictHosts,t[51]=H);let U;t[52]===H?U=t[53]:(U=new Set(H),t[52]=H,t[53]=U);let W=U,G;t[54]===r?.driftPaths?G=t[55]:(G=r?.driftPaths??[],t[54]=r?.driftPaths,t[55]=G);let K;t[56]===G?K=t[57]:(K=new Set(G),t[56]=G,t[57]=K);let q=K;w=n.installing;let J=Pn,Y;t[58]===r?.symlinkedHosts?Y=t[59]:(Y=r?.symlinkedHosts??[],t[58]=r?.symlinkedHosts,t[59]=Y);let ne;t[60]===Y?ne=t[61]:(ne=new Set(Y),t[60]=Y,t[61]=ne);let X=ne,re=[...[...s].filter(e=>e!==N&&!(e in x)&&!W.has(e)&&!e.includes(`/`)).map(e=>X.has(e)?`link`:`copy`),...(r?.customPlacements??[]).map(Nn)],ie=re.filter(Mn).length;E=re.length===0?n.linkMode?`link`:`copy`:ie*2>=re.length?`link`:`copy`;let ae;t[62]!==x||t[63]!==W||t[64]!==s||t[65]!==X||t[66]!==p||t[67]!==N?(ae=[...s].filter(e=>e!==N&&!(e in x)&&!W.has(e)&&!e.includes(`/`)).map(e=>({target:e,display:p(e)??R(e),mode:X.has(e)?`link`:`copy`})),t[62]=x,t[63]=W,t[64]=s,t[65]=X,t[66]=p,t[67]=N,t[68]=ae):ae=t[68];let oe;t[69]===r?.customPlacements?oe=t[70]:(oe=r?.customPlacements??[],t[69]=r?.customPlacements,t[70]=oe);let se;if(t[71]!==S||t[72]!==ae||t[73]!==oe){let e;t[75]===S?e=t[76]:(e=e=>({target:Ke(e),display:`${S}${e.path}`,mode:e.mode}),t[75]=S,t[76]=e),se=[...ae,...oe.map(e)],t[71]=S,t[72]=ae,t[73]=oe,t[74]=se}else se=t[74];T=se;let ce;t[77]!==o||t[78]!==a||t[79]!==n?(ce=(e,t,r)=>{let i=r===`link`?`copy`:`link`;return(0,Q.jsx)(wn,{hint:o(r===`link`?{id:`FeXcUS`,values:{display:t}}:{id:`ugQcJX`,values:{display:t}}),children:(0,Q.jsx)(b,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-yellow-500/40 bg-yellow-500/10 px-1 font-normal text-[10px] text-yellow-600 uppercase tracking-wide hover:bg-yellow-500/20`,onClick:r=>{r.preventDefault(),r.stopPropagation(),window.confirm(o(i===`link`?{id:`m0eHej`,values:{display:t}}:{id:`HbcQYf`,values:{display:t}}))&&(a?.(),n.convertLocation?.(e,i))},"data-testid":`skill-convert-${e}`,children:r===`link`?(0,Q.jsx)(l,{id:`uUCrBv`}):(0,Q.jsx)(l,{id:`iaPtht`})})})},t[77]=o,t[78]=a,t[79]=n,t[80]=ce):ce=t[80];let le=ce,ue;t[81]===r?.customPlacements?ue=t[82]:(ue=r?.customPlacements??[],t[81]=r?.customPlacements,t[82]=ue);let de=new Map(ue.map(jn)),fe=new Set(de.keys());if(m.status===`ready`&&r){for(let e of m.data)if(e.scope===r.scope)for(let t of e.customPlacements??[]){let e=Ke(t);e!==``&&fe.add(e)}}let pe=r===void 0?[]:[...fe].sort().map(e=>({root:e,display:`${S}${e}/${r.name}`,placed:de.get(e)??null})).filter(e=>!v.has(e.display)&&e.display!==j&&!(e.root in x)),me;t[83]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,Q.jsx)(l,{id:`npcziF`}),t[83]=me):me=t[83];let he;t[84]===o?he=t[85]:(he=o({id:`6f_UX4`}),t[84]=o,t[85]=he);let ge;t[86]===d?ge=t[87]:(ge=()=>d(),t[86]=d,t[87]=ge);let _e;t[88]===Symbol.for(`react.memo_cache_sentinel`)?(_e=(0,Q.jsx)(l,{id:`N40H-G`}),t[88]=_e):_e=t[88];let ye;t[89]!==w||t[90]!==ge?(ye=(0,Q.jsx)(b,{variant:`ghost`,size:`sm`,className:`h-5 px-1.5 font-normal text-[11px] text-muted-foreground hover:text-foreground`,disabled:w,onClick:ge,"data-testid":`skill-install-all`,children:_e}),t[89]=w,t[90]=ge,t[91]=ye):ye=t[91],t[92]!==he||t[93]!==ye?(D=(0,Q.jsxs)(I,{className:`flex items-center justify-between gap-2`,children:[me,(0,Q.jsx)(wn,{hint:he,children:ye})]}),t[92]=he,t[93]=ye,t[94]=D):D=t[94],t[95]!==o||t[96]!==V||t[97]!==w||t[98]!==M||t[99]!==L?(O=M===null?null:(0,Q.jsx)(wn,{hint:o({id:`pXB6SL`}),children:(0,Q.jsxs)(F,{disabled:w,checked:!0,onSelect:An,"data-testid":`skill-source-row`,children:[(0,Q.jsx)(Me,{"aria-hidden":!0,className:`size-4 text-muted-foreground`}),(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:M}),(()=>{let e=J(M).split(`/`).slice(0,-1).join(`/`),t=L(e);return t.length>0?(0,Q.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-source`,children:t.map(t=>V(t,e))}):null})(),(0,Q.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-border/60 px-1 text-[10px] uppercase tracking-wide text-muted-foreground`,children:(0,Q.jsx)(l,{id:`tiFPjk`})})]})]})}),t[95]=o,t[96]=V,t[97]=w,t[98]=M,t[99]=L,t[100]=O):O=t[100];let be;t[101]!==o||t[102]!==V||t[103]!==w||t[104]!==z||t[105]!==W||t[106]!==le||t[107]!==q||t[108]!==E||t[109]!==s||t[110]!==X||t[111]!==i||t[112]!==p||t[113]!==r?.hosts||t[114]!==N||t[115]!==L||t[116]!==c||t[117]!==n?(be=e=>{let t=p(e),a=e===`agents`?`.agents`:ve[e],u=J(t).split(`/`).slice(0,-1).join(`/`),d=L(u);return(0,Q.jsx)(wn,{hint:W.has(e)?o({id:`8HvJlU`,values:{0:t??a}}):e===N?t?o({id:`ssk6rl`,values:{path:t}}):a:s.has(e)?o(t?{id:`9ieZhu`,values:{path:t}}:{id:`n3T3EE`,values:{label:a}}):o(t?E===`link`?{id:`1LtA5r`,values:{path:t}}:{id:`opPbzN`,values:{path:t}}:{id:`Pp0Vgd`,values:{label:a}}),children:(0,Q.jsxs)(F,{disabled:w,checked:s.has(e),onCheckedChange:t=>{W.has(e)||t===!0&&!z(u)||c(e,t===!0)},onSelect:kn,className:`group`,"data-testid":`skill-install-editor-${e}`,children:[(0,Q.jsx)(g,{host:e,"aria-hidden":!0,className:`size-4`}),(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:t??a}),d.length>0?(0,Q.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-${e}`,children:d.map(e=>V(e,u))}):null,W.has(e)?(0,Q.jsx)(wn,{hint:o({id:`_O7dJS`}),children:(0,Q.jsx)(b,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-yellow-500/40 bg-yellow-500/10 px-1 text-[10px] text-yellow-600 uppercase tracking-wide hover:bg-yellow-500/20`,onClick:t=>{t.preventDefault(),i?.(e)},"data-testid":`skill-fork-chip-${e}`,children:(0,Q.jsx)(l,{id:`jng7Ko`})})}):e===N?(0,Q.jsx)(`span`,{className:`inline-flex h-5 shrink-0 items-center rounded border border-border/60 px-1 text-[10px] uppercase tracking-wide text-muted-foreground`,children:(0,Q.jsx)(l,{id:`tiFPjk`})}):s.has(e)&&r?.hosts?(0,Q.jsxs)(Q.Fragment,{children:[!w&&(X.has(e)?`link`:`copy`)!==E?le(e,t??a,X.has(e)?`link`:`copy`):null,(0,Q.jsx)(wn,{hint:o({id:`nBgzKO`}),children:(0,Q.jsx)(b,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-border/60 px-1 font-normal text-[10px] text-muted-foreground uppercase tracking-wide opacity-0 focus-visible:opacity-100 group-hover:opacity-100 hover:border-foreground/40 hover:text-foreground`,onClick:t=>{t.preventDefault(),t.stopPropagation(),n.setSource?.(e)},"data-testid":`skill-set-source-${e}`,children:(0,Q.jsx)(l,{id:`VNNRfN`})})})]}):null,!w&&q.has(J(t))?(0,Q.jsx)(wn,{hint:o({id:`iz1LdD`}),children:(0,Q.jsx)(y,{testId:`skill-drift-${e}`})}):null]})]})},e)},t[101]=o,t[102]=V,t[103]=w,t[104]=z,t[105]=W,t[106]=le,t[107]=q,t[108]=E,t[109]=s,t[110]=X,t[111]=i,t[112]=p,t[113]=r?.hosts,t[114]=N,t[115]=L,t[116]=c,t[117]=n,t[118]=be):be=t[118],k=f.map(be);let xe;t[119]!==o||t[120]!==V||t[121]!==w||t[122]!==z||t[123]!==le||t[124]!==q||t[125]!==E||t[126]!==L||t[127]!==n?(xe=e=>(0,Q.jsx)(wn,{hint:e.placed===null?o(E===`link`?{id:`ybWWR2`,values:{0:e.display}}:{id:`fDjZxw`,values:{0:e.display}}):o({id:`C0cll5`,values:{0:e.display}}),children:(0,Q.jsxs)(F,{disabled:w,checked:e.placed!==null,onCheckedChange:t=>{if(t===!0&&e.placed===null){if(!z(e.root))return;n.placeAt(e.root,E)}else e.placed!==null&&n.unplaceAt?.(e.placed.path)},onSelect:On,className:`group`,"data-testid":`skill-custom-root-${e.root}`,children:[e.root===`.agents/skills`?(0,Q.jsx)(g,{host:`agents`,"aria-hidden":!0,className:`size-4`}):(0,Q.jsx)(Me,{"aria-hidden":!0,className:`size-4 text-muted-foreground`}),(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:e.display}),L(e.root).length>0?(0,Q.jsx)(`span`,{className:`flex shrink-0 items-center gap-0.5`,"data-testid":`skill-row-audience-custom-${e.root}`,children:L(e.root).map(t=>V(t,e.root))}):null,!w&&e.placed!==null&&q.has(e.placed.path)?(0,Q.jsx)(wn,{hint:o({id:`iz1LdD`}),children:(0,Q.jsx)(y,{testId:`skill-drift-custom-${e.root}`})}):e.placed===null?null:(0,Q.jsxs)(Q.Fragment,{children:[!w&&e.placed.mode!==E?le(e.root,e.display,e.placed.mode):null,(0,Q.jsx)(wn,{hint:o({id:`nBgzKO`}),children:(0,Q.jsx)(b,{variant:`ghost`,size:`sm`,className:`h-5 shrink-0 rounded border border-border/60 px-1 font-normal text-[10px] text-muted-foreground uppercase tracking-wide opacity-0 focus-visible:opacity-100 group-hover:opacity-100 hover:border-foreground/40 hover:text-foreground`,onClick:t=>{t.preventDefault(),t.stopPropagation(),n.setSource?.(e.root)},"data-testid":`skill-set-source-custom-${e.root}`,children:(0,Q.jsx)(l,{id:`VNNRfN`})})})]})]})]})},e.root),t[119]=o,t[120]=V,t[121]=w,t[122]=z,t[123]=le,t[124]=q,t[125]=E,t[126]=L,t[127]=n,t[128]=xe):xe=t[128],ee=pe.map(xe),t[14]=o,t[15]=x,t[16]=m.data,t[17]=m.status,t[18]=s,t[19]=_,t[20]=d,t[21]=C,t[22]=i,t[23]=a,t[24]=p,t[25]=r,t[26]=c,t[27]=n,t[28]=w,t[29]=T,t[30]=E,t[31]=D,t[32]=O,t[33]=k,t[34]=ee}else w=t[28],T=t[29],E=t[30],D=t[31],O=t[32],k=t[33],ee=t[34];let A;t[129]!==o||t[130]!==w||t[131]!==T||t[132]!==E||t[133]!==a||t[134]!==n?(A=T.length>0&&n.convertLocations?(0,Q.jsxs)(`div`,{className:`flex items-center gap-1 px-2 pt-1 pb-1.5`,children:[(0,Q.jsx)(b,{variant:`ghost`,size:`sm`,className:`h-auto whitespace-normal p-0 text-left font-normal text-[11px] text-muted-foreground leading-snug hover:bg-transparent hover:text-foreground`,onClick:e=>{e.preventDefault();let t=E===`link`?`copy`:`link`,r=T.filter(e=>e.mode!==t);if(r.length===0)return;let i=o(t===`copy`?{id:`iOAsF1`}:{id:`MS8lMS`}),s=o(t===`copy`?{id:`gZiT5e`}:{id:`PhIa-X`}),c=r.map(Dn).join(`
2
2
  `);window.confirm(`${i}\n\n${s}\n\n${c}\n\n${o({id:`Cu6GXQ`})}`)&&(a?.(),n.convertLocations?.(r.map(e=>({target:e.target,mode:t}))))},disabled:w,"data-testid":`skill-convert-all`,children:E===`link`?(0,Q.jsx)(l,{id:`rcJmK8`}):(0,Q.jsx)(l,{id:`LBv_TR`})}),(0,Q.jsx)(wn,{hint:o({id:`0J6nhG`}),children:(0,Q.jsx)(b,{variant:`ghost`,size:`sm`,"aria-label":o({id:`qJSo0_`}),className:`size-4 shrink-0 rounded-full border border-border/60 p-0 font-normal text-[9px] text-muted-foreground hover:border-foreground/40 hover:bg-transparent hover:text-foreground`,onClick:En,"data-testid":`skill-convert-all-help`,children:`?`})})]}):null,t[129]=o,t[130]=w,t[131]=T,t[132]=E,t[133]=a,t[134]=n,t[135]=A):A=t[135];let M;t[136]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,Q.jsx)(R,{}),t[136]=M):M=t[136];let N;t[137]===o?N=t[138]:(N=o({id:`jqe7Yq`}),t[137]=o,t[138]=N);let P;t[139]===r?.scope?P=t[140]:(P=()=>{window.location.hash=r?.scope===`global`?`#settings/user-skills`:`#settings/skills`},t[139]=r?.scope,t[140]=P);let L,te;t[141]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Q.jsx)(gt,{"aria-hidden":!0}),te=(0,Q.jsx)(l,{id:`ZBF9fn`}),t[141]=L,t[142]=te):(L=t[141],te=t[142]);let z;t[143]===P?z=t[144]:(z=(0,Q.jsxs)(j,{onSelect:P,children:[L,te]}),t[143]=P,t[144]=z);let B;t[145]!==N||t[146]!==z?(B=(0,Q.jsx)(wn,{hint:N,children:z}),t[145]=N,t[146]=z,t[147]=B):B=t[147];let V;return t[148]!==B||t[149]!==D||t[150]!==O||t[151]!==k||t[152]!==ee||t[153]!==A?(V=(0,Q.jsxs)(Q.Fragment,{children:[D,O,k,ee,A,M,B]}),t[148]=B,t[149]=D,t[150]=O,t[151]=k,t[152]=ee,t[153]=A,t[154]=V):V=t[154],V}function En(e){return e.preventDefault()}function Dn(e){return e.display}function On(e){return e.preventDefault()}function kn(e){return e.preventDefault()}function An(e){return e.preventDefault()}function jn(e){return[Ke(e),e]}function Mn(e){return e===`link`}function Nn(e){return e.mode}function Pn(e){return(e??``).replace(/^~\//,``)}function Fn(e){return e===`agents`?`.agents`:ve[e]??e}function In(e){return e.hostAliases??{}}function Ln(e){return e.hosts.includes(`agents`)||e.path.startsWith(`.agents/`)}function Rn(e){let t=(0,_t.c)(10),{onAddProperty:n,className:r}=e,{_:i}=u(),a;t[0]===i?a=t[1]:(a=i({id:`81H_23`}),t[0]=i,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Q.jsx)(x,{children:(0,Q.jsx)(mt,{})}),t[2]=o):o=t[2];let s;t[3]!==r||t[4]!==n||t[5]!==a?(s=(0,Q.jsx)(b,{variant:`ghost`,size:`icon`,"aria-label":a,onClick:n,"data-testid":`add-properties-button`,className:r,asChild:!0,children:o}),t[3]=r,t[4]=n,t[5]=a,t[6]=s):s=t[6];let c;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Q.jsx)(S,{side:`bottom`,children:(0,Q.jsx)(l,{id:`81H_23`})}),t[7]=c):c=t[7];let d;return t[8]===s?d=t[9]:(d=(0,Q.jsxs)(C,{children:[s,c]}),t[8]=s,t[9]=d),d}function zn(e){return e?Fe._({id:`wTcjov`}):null}function Bn(e){let t=(0,_t.c)(47),{_:n}=u(),i=r(),a=_(),s=z(),c=V();if(i)return null;let{input:d,installStates:p,dispatch:m,onBeforeLaunch:h}=e,g=d===null,v,y,b,x,S,C,w,T,E,D,O;if(t[0]!==n||t[1]!==m||t[2]!==d||t[3]!==g||t[4]!==p||t[5]!==h||t[6]!==c||t[7]!==s||t[8]!==a){let e=zn(g),r;t[20]===c?r=t[21]:(r=e=>Y(c,e.id),t[20]=c,t[21]=r);let i=H.filter(r),u;t[22]===c?u=t[23]:(u=e=>W(c,e.source,e.id,!0,e.supported),t[22]=c,t[23]=u);let f=s.filter(u),_=a?ae.filter(e=>q(c,e,a.installedClis)):[];b=i.length>0,x=a!==null&&_.length>0,S=f.length>0,y=M,t[24]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Q.jsxs)(L,{children:[(0,Q.jsx)(o,{"aria-hidden":`true`}),(0,Q.jsx)(l,{id:`O7_W_a`})]}),t[24]=O):O=t[24],v=N,C=`max-h-80`,w=S?(0,Q.jsxs)(P,{"aria-label":n({id:`vPKX2i`}),children:[(0,Q.jsxs)(I,{className:`flex items-center gap-1.5`,children:[(0,Q.jsx)(l,{id:`RXEbZy`}),(0,Q.jsx)(J,{})]}),f.map(t=>{let r=t.name;return(0,Q.jsxs)(j,{onSelect:()=>{d!==null&&(h?.(),an(d,{agent:{source:t.source,id:t.id}}))},disabled:g,"data-testid":`file-tree-open-in-thread-${t.id}`,"aria-label":e?n({id:`gtGQ9S`,values:{agentName:r,hint:e}}):void 0,children:[(0,Q.jsx)(De,{agentId:t.id,iconUrl:t.iconUrl,className:`size-4`}),(0,Q.jsx)(`span`,{className:`flex-1`,children:(0,Q.jsx)(l,{id:`5PrrYw`,values:{agentName:r}})}),e?(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},`${t.source}:${t.id}`)})]}):null,t[25]!==b||t[26]!==x||t[27]!==S?(T=S&&(x||b)?(0,Q.jsx)(R,{}):null,t[25]=b,t[26]=x,t[27]=S,t[28]=T):T=t[28],E=x?(0,Q.jsxs)(P,{"aria-label":n({id:`ALhMYW`}),children:[(0,Q.jsx)(I,{children:(0,Q.jsx)(l,{id:`ALhMYW`})}),_.map(t=>{let{displayName:r}=he[t];return(0,Q.jsxs)(j,{onSelect:()=>{d!==null&&(h?.(),a.launchInTerminal(d,t))},disabled:g,"data-testid":`file-tree-open-in-terminal-${t}`,"aria-label":n(e?{id:`AIn2Yv`,values:{displayName:r,hint:e}}:{id:`QYfQdv`,values:{displayName:r}}),children:[(0,Q.jsx)(G,{id:B(t),"aria-hidden":`true`}),(0,Q.jsx)(`span`,{className:`flex-1`,children:r}),e?(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t)})]}):null,D=b?(0,Q.jsxs)(Q.Fragment,{children:[x?(0,Q.jsx)(R,{}):null,(0,Q.jsxs)(P,{"aria-label":n({id:`BBqGS9`}),children:[(0,Q.jsx)(I,{children:(0,Q.jsx)(l,{id:`BBqGS9`})}),i.map(t=>{let r=!g,{displayName:i}=t,a=n(e?{id:`1ZpfyB`,values:{displayName:i,hint:e}}:{id:`WqLq6M`,values:{displayName:i}});return(0,Q.jsxs)(j,{disabled:!r,onSelect:()=>{if(d){if(h?.(),p[t.id]?.installed!==!0){Wt(t);return}m(t.id,d)}},"data-testid":`file-tree-open-in-${t.id}`,"aria-label":a,children:[(0,Q.jsx)(G,{id:t.id,"aria-hidden":`true`}),(0,Q.jsx)(`span`,{className:`flex-1`,children:t.displayName}),e?(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t.id)})]})]}):null,t[0]=n,t[1]=m,t[2]=d,t[3]=g,t[4]=p,t[5]=h,t[6]=c,t[7]=s,t[8]=a,t[9]=v,t[10]=y,t[11]=b,t[12]=x,t[13]=S,t[14]=C,t[15]=w,t[16]=T,t[17]=E,t[18]=D,t[19]=O}else v=t[9],y=t[10],b=t[11],x=t[12],S=t[13],C=t[14],w=t[15],T=t[16],E=t[17],D=t[18],O=t[19];let k;t[29]!==b||t[30]!==x||t[31]!==S?(k=S||x||b?(0,Q.jsx)(R,{}):null,t[29]=b,t[30]=x,t[31]=S,t[32]=k):k=t[32];let ee;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,Q.jsx)(f,{"aria-hidden":`true`}),t[33]=ee):ee=t[33];let A;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Q.jsxs)(j,{onSelect:Ie,"data-testid":`file-tree-open-in-settings`,children:[ee,(0,Q.jsx)(`span`,{className:`flex-1`,children:(0,Q.jsx)(l,{id:`jRAGrQ`})})]}),t[34]=A):A=t[34];let F;t[35]!==v||t[36]!==C||t[37]!==w||t[38]!==T||t[39]!==E||t[40]!==D||t[41]!==k?(F=(0,Q.jsxs)(v,{className:C,children:[w,T,E,D,k,A]}),t[35]=v,t[36]=C,t[37]=w,t[38]=T,t[39]=E,t[40]=D,t[41]=k,t[42]=F):F=t[42];let te;return t[43]!==y||t[44]!==O||t[45]!==F?(te=(0,Q.jsxs)(y,{children:[O,F]}),t[43]=y,t[44]=O,t[45]=F,t[46]=te):te=t[46],te}function Vn(e){let t=oe(e);if(t)return{scope:`project`,name:t.name,rel:t.rel};let n=re(e);return n?{scope:`global`,name:n.name,rel:n.rel}:null}function Hn(e,t,n){return e.filter(e=>{let r=ze(e);if(r.kind===`skill-file`)return r.scope===t&&r.name===n;if(r.kind!==`doc`)return!1;let i=Vn(r.docName);return i?.scope===t&&i.name===n})}function Un(e,t){let n=new Map(t.map(e=>[`${e.scope}\u0000${e.name}`,e])),r=[];for(let t of e){let e=Vn(t);if(!e||n.has(`${e.scope}\u0000${e.name}`))continue;let i=e.scope===`project`?`global`:`project`,a=n.get(`${i}\u0000${e.name}`);e.rel===null&&a!==void 0?r.push({kind:`retarget`,fromDocName:t,toDocName:Re(a)}):r.push({kind:`close`,docName:t})}return r}function Wn(){let e=(0,_t.c)(15),{openTabs:t,closeDocument:n}=s(),r=Oe(),i;e[0]===t?i=e[1]:(i=t.some(Kn),e[0]=t,e[1]=i);let a=i,o;e[2]===a?o=e[3]:(o={enabled:a},e[2]=a,e[3]=o);let c=ct(o),l=(0,$.useRef)(null),u;e[4]!==n||e[5]!==t||e[6]!==r||e[7]!==c.data||e[8]!==c.status?(u=()=>{if(c.status!==`ready`)return;let e=c.data,i=`${t.join(``)}\u0002${e.map(Gn).sort().join(``)}`;if(l.current===i)return;l.current=i;let a=Un(t,e);for(let e of a)e.kind===`retarget`?r(e.fromDocName,e.toDocName):n(e.docName)},e[4]=n,e[5]=t,e[6]=r,e[7]=c.data,e[8]=c.status,e[9]=u):u=e[9];let d;e[10]!==n||e[11]!==t||e[12]!==r||e[13]!==c?(d=[c,t,r,n],e[10]=n,e[11]=t,e[12]=r,e[13]=c,e[14]=d):d=e[14],(0,$.useEffect)(u,d)}function Gn(e){return`${e.scope}\u0000${e.name}`}function Kn(e){return Vn(e)!==null}function qn(e){let t=(0,_t.c)(19),{skill:n,onOpenChange:r,onDeleted:i}=e,{_:a}=u(),{setSkillsSidebar:o,closeTabs:c,openTabs:l}=s(),[d,f]=(0,$.useState)(!1),p;t[0]!==a||t[1]!==c||t[2]!==i||t[3]!==r||t[4]!==l||t[5]!==o?(p=async function(e){o(!0),f(!0);let t=await nt(e.scope,e.name);if(f(!1),!t.ok){let{error:e}=t;Z.error(a({id:`AtBdnD`,values:{error:e}}));return}Z.success(a({id:`h9QFb9`,values:{0:e.name}})),c(Hn(l,e.scope,e.name),{force:!0}),i(),r(!1)},t[0]=a,t[1]=c,t[2]=i,t[3]=r,t[4]=l,t[5]=o,t[6]=p):p=t[6];let m=p,g=n!==null,_;t[7]!==d||t[8]!==r?(_=e=>{!e&&!d&&r(!1)},t[7]=d,t[8]=r,t[9]=_):_=t[9];let v;t[10]!==a||t[11]!==d||t[12]!==m||t[13]!==n?(v=n?(0,Q.jsx)(h,{itemName:a({id:`ExUzM4`,values:{0:n.name}}),isSubmitting:d,onDelete:()=>m(n),customDescription:n.origin?.source&&/\/plugins\/(?:cache|marketplaces)\//.test(n.origin.source)?a({id:`WnsbUT`,values:{0:n.path}}):a({id:`E1Da_b`,values:{0:n.path}})}):null,t[10]=a,t[11]=d,t[12]=m,t[13]=n,t[14]=v):v=t[14];let y;return t[15]!==g||t[16]!==_||t[17]!==v?(y=(0,Q.jsx)(A,{open:g,onOpenChange:_,children:v}),t[15]=g,t[16]=_,t[17]=v,t[18]=y):y=t[18],y}function Jn(e){let t=e.split(`/`);return t.some(e=>e===``||e===`.`||e===`..`)||t.length===0||t.length===1&&t[0].toLowerCase()===`skill.md`?!1:!/\s/.test(e)}function Yn(e){let t=(0,_t.c)(66),{target:n,onOpenChange:r}=e,{_:i}=u(),{openTarget:a}=s(),o=(0,$.useId)(),[c,d]=(0,$.useState)(``),[f,p]=(0,$.useState)(!1),m;t[0]===n?m=t[1]:(m=()=>{n&&d(n.prefix??`references/`)},t[0]=n,t[1]=m);let h=n?.skill.scope,g=n?.skill.name,_=n?.prefix,v;if(t[2]!==h||t[3]!==g||t[4]!==_?(v=[h,g,_],t[2]=h,t[3]=g,t[4]=_,t[5]=v):v=t[5],(0,$.useEffect)(m,v),!n)return null;let y,x,S,C;t[6]!==c||t[7]!==f?(C=c.trim(),x=C===``||!Jn(C),y=!x&&!f,S=C.includes(`/`)?C.split(`/`).slice(0,-1).join(`/`):null,t[6]=c,t[7]=f,t[8]=y,t[9]=x,t[10]=S,t[11]=C):(y=t[8],x=t[9],S=t[10],C=t[11]);let D=S,k;t[12]!==i||t[13]!==y||t[14]!==r||t[15]!==a||t[16]!==n||t[17]!==C?(k=async function(){if(!n||!y)return;p(!0);let e=/\.mdx?$/i.test(C),t=await Je({scope:n.skill.scope,name:n.skill.name,path:C,content:e?`# ${C.split(`/`).pop()?.replace(/\.mdx?$/i,``)??``}\n`:``});if(p(!1),!t.ok){Z.error(i({id:`a_2_uB`,values:{0:t.error,trimmed:C}}));return}if(Z.success(i({id:`MXSt4t`,values:{0:t.path}})),e){let e=Be(n.skill,C);a({kind:`doc`,target:e,docName:e})}r(!1)},t[12]=i,t[13]=y,t[14]=r,t[15]=a,t[16]=n,t[17]=C,t[18]=k):k=t[18];let j=k,M;t[19]!==r||t[20]!==f?(M=e=>{!e&&!f&&r(!1)},t[19]=r,t[20]=f,t[21]=M):M=t[21];let N;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,Q.jsx)(T,{children:(0,Q.jsx)(l,{id:`wQvvZY`})}),t[22]=N):N=t[22];let P;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,Q.jsxs)(ee,{children:[N,(0,Q.jsx)(w,{children:(0,Q.jsx)(l,{id:`lM4c-I`})})]}),t[23]=P):P=t[23];let F;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Q.jsx)(l,{id:`I6gXOa`}),t[24]=F):F=t[24];let I;t[25]===o?I=t[26]:(I=(0,Q.jsx)(te,{htmlFor:o,children:F}),t[25]=o,t[26]=I);let L;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(L=e=>d(e.target.value),t[27]=L):L=t[27];let R=x&&C!==``,z;t[28]===j?z=t[29]:(z=e=>{e.key===`Enter`&&j()},t[28]=j,t[29]=z);let B;t[30]!==o||t[31]!==c||t[32]!==R||t[33]!==z?(B=(0,Q.jsx)(Pe,{id:o,value:c,onChange:L,placeholder:`references/notes.md`,"aria-invalid":R,onKeyDown:z}),t[30]=o,t[31]=c,t[32]=R,t[33]=z,t[34]=B):B=t[34];let V;t[35]!==D||t[36]!==x||t[37]!==C?(V=x&&C!==``?(0,Q.jsx)(`p`,{className:`text-destructive text-xs`,children:(0,Q.jsx)(l,{id:`fVzizW`})}):D?(0,Q.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:(0,Q.jsx)(l,{id:`9lso1Y`,values:{folderPart:D},components:{0:(0,Q.jsx)(`span`,{className:`font-mono text-foreground/80`})}})}):null,t[35]=D,t[36]=x,t[37]=C,t[38]=V):V=t[38];let H;t[39]!==I||t[40]!==B||t[41]!==V?(H=(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[I,B,V]}),t[39]=I,t[40]=B,t[41]=V,t[42]=H):H=t[42];let U;t[43]===r?U=t[44]:(U=()=>r(!1),t[43]=r,t[44]=U);let W;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,Q.jsx)(l,{id:`dEgA5A`}),t[45]=W):W=t[45];let G;t[46]!==f||t[47]!==U?(G=(0,Q.jsx)(b,{variant:`outline`,onClick:U,disabled:f,children:W}),t[46]=f,t[47]=U,t[48]=G):G=t[48];let K;t[49]===j?K=t[50]:(K=()=>void j(),t[49]=j,t[50]=K);let q=!y,J;t[51]===f?J=t[52]:(J=f?(0,Q.jsx)(l,{id:`E9bKSA`}):(0,Q.jsx)(l,{id:`hYgDIe`}),t[51]=f,t[52]=J);let Y;t[53]!==K||t[54]!==q||t[55]!==J?(Y=(0,Q.jsx)(b,{onClick:K,disabled:q,children:J}),t[53]=K,t[54]=q,t[55]=J,t[56]=Y):Y=t[56];let ne;t[57]!==G||t[58]!==Y?(ne=(0,Q.jsxs)(O,{children:[G,Y]}),t[57]=G,t[58]=Y,t[59]=ne):ne=t[59];let X;t[60]!==H||t[61]!==ne?(X=(0,Q.jsxs)(E,{className:`sm:max-w-md`,children:[P,H,ne]}),t[60]=H,t[61]=ne,t[62]=X):X=t[62];let re;return t[63]!==X||t[64]!==M?(re=(0,Q.jsx)(A,{open:!0,onOpenChange:M,children:X}),t[63]=X,t[64]=M,t[65]=re):re=t[65],re}function Xn(e){let t=(0,_t.c)(64),{target:n,onOpenChange:r}=e,{_:i}=u(),a=Oe(),o=(0,$.useId)(),[s,c]=(0,$.useState)(``),[d,f]=(0,$.useState)(!1),p;t[0]===n?p=t[1]:(p=()=>{n&&c(n.filePath)},t[0]=n,t[1]=p);let m=n?.skill.scope,h=n?.skill.name,g=n?.filePath,_;if(t[2]!==m||t[3]!==h||t[4]!==g?(_=[m,h,g],t[2]=m,t[3]=h,t[4]=g,t[5]=_):_=t[5],(0,$.useEffect)(p,_),!n)return null;let v,y,x;t[6]!==s||t[7]!==n.filePath?(y=s.trim(),x=y===n.filePath,v=y===``||!Jn(y),t[6]=s,t[7]=n.filePath,t[8]=v,t[9]=y,t[10]=x):(v=t[8],y=t[9],x=t[10]);let S=v,C=!S&&!x&&!d,D;t[11]!==i||t[12]!==C||t[13]!==r||t[14]!==a||t[15]!==n||t[16]!==y?(D=async function(){if(!n||!C)return;f(!0);let e=await at({scope:n.skill.scope,name:n.skill.name,from:n.filePath,to:y});if(f(!1),!e.ok){Z.error(i({id:`11ukmX`,values:{0:e.error}}));return}e.fromDocName!==void 0&&e.toDocName!==void 0&&a(e.fromDocName,e.toDocName),Z.success(i({id:`XszXjc`,values:{0:e.to}})),r(!1)},t[11]=i,t[12]=C,t[13]=r,t[14]=a,t[15]=n,t[16]=y,t[17]=D):D=t[17];let k=D,j;t[18]!==r||t[19]!==d?(j=e=>{!e&&!d&&r(!1)},t[18]=r,t[19]=d,t[20]=j):j=t[20];let M;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,Q.jsx)(T,{children:(0,Q.jsx)(l,{id:`yckias`})}),t[21]=M):M=t[21];let N;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,Q.jsxs)(ee,{children:[M,(0,Q.jsx)(w,{children:(0,Q.jsx)(l,{id:`HzVAoz`})})]}),t[22]=N):N=t[22];let P;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,Q.jsx)(l,{id:`I6gXOa`}),t[23]=P):P=t[23];let F;t[24]===o?F=t[25]:(F=(0,Q.jsx)(te,{htmlFor:o,children:P}),t[24]=o,t[25]=F);let I;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(I=e=>c(e.target.value),t[26]=I):I=t[26];let L=S&&y!==``,R;t[27]===k?R=t[28]:(R=e=>{e.key===`Enter`&&k()},t[27]=k,t[28]=R);let z;t[29]!==o||t[30]!==s||t[31]!==L||t[32]!==R?(z=(0,Q.jsx)(Pe,{id:o,value:s,onChange:I,"aria-invalid":L,onKeyDown:R}),t[29]=o,t[30]=s,t[31]=L,t[32]=R,t[33]=z):z=t[33];let B;t[34]!==S||t[35]!==y?(B=S&&y!==``?(0,Q.jsx)(`p`,{className:`text-destructive text-xs`,children:(0,Q.jsx)(l,{id:`fVzizW`})}):null,t[34]=S,t[35]=y,t[36]=B):B=t[36];let V;t[37]!==F||t[38]!==z||t[39]!==B?(V=(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[F,z,B]}),t[37]=F,t[38]=z,t[39]=B,t[40]=V):V=t[40];let H;t[41]===r?H=t[42]:(H=()=>r(!1),t[41]=r,t[42]=H);let U;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,Q.jsx)(l,{id:`dEgA5A`}),t[43]=U):U=t[43];let W;t[44]!==d||t[45]!==H?(W=(0,Q.jsx)(b,{variant:`outline`,onClick:H,disabled:d,children:U}),t[44]=d,t[45]=H,t[46]=W):W=t[46];let G;t[47]===k?G=t[48]:(G=()=>void k(),t[47]=k,t[48]=G);let K=!C,q;t[49]===d?q=t[50]:(q=d?(0,Q.jsx)(l,{id:`tHKQ6j`}):(0,Q.jsx)(l,{id:`2wxgft`}),t[49]=d,t[50]=q);let J;t[51]!==G||t[52]!==K||t[53]!==q?(J=(0,Q.jsx)(b,{onClick:G,disabled:K,children:q}),t[51]=G,t[52]=K,t[53]=q,t[54]=J):J=t[54];let Y;t[55]!==W||t[56]!==J?(Y=(0,Q.jsxs)(O,{children:[W,J]}),t[55]=W,t[56]=J,t[57]=Y):Y=t[57];let ne;t[58]!==V||t[59]!==Y?(ne=(0,Q.jsxs)(E,{className:`sm:max-w-md`,children:[N,V,Y]}),t[58]=V,t[59]=Y,t[60]=ne):ne=t[60];let X;return t[61]!==ne||t[62]!==j?(X=(0,Q.jsx)(A,{open:!0,onOpenChange:j,children:ne}),t[61]=ne,t[62]=j,t[63]=X):X=t[63],X}function Zn(e){let t=(0,_t.c)(59),{target:n,onOpenChange:r}=e,{_:i}=u(),a=(0,$.useId)(),[o,s]=(0,$.useState)(null),[c,d]=(0,$.useState)(null),[f,p]=(0,$.useState)(!1),[m,h]=(0,$.useState)(!1),[g,_]=(0,$.useState)(``),[v,y]=(0,$.useState)(!1),x;t[0]===n?x=t[1]:(x=()=>{if(s(null),d(null),p(!1),h(!1),!n)return;let{skill:e,editor:t}=n,r=e.absolutePath?.slice(0,-`/${e.path}`.length)??null;if(r===null){p(!0);return}let i=`${r}/${e.path.replace(/\/SKILL\.mdx?$/i,``)}`,a=`${r}/${qe(t,e.scope)}/${e.name}`,o=new AbortController;for(let[t,n]of[[i,d],[a,s]])$e({source:t,name:e.name},o.signal).then(e=>{o.signal.aborted||(e.ok?n(e.skillMd):p(!0))}).catch(()=>{o.signal.aborted||p(!0)});return()=>o.abort()},t[0]=n,t[1]=x);let S=n?.skill.scope,C=n?.skill.name,k=n?.editor,j;if(t[2]!==S||t[3]!==C||t[4]!==k?(j=[S,C,k],t[2]=S,t[3]=C,t[4]=k,t[5]=j):j=t[5],(0,$.useEffect)(x,j),!n)return null;let{skill:M,editor:N}=n,P;t[6]!==i||t[7]!==N||t[8]!==r||t[9]!==M.name||t[10]!==M.scope||t[11]!==n||t[12]!==g?(P=async function(e){if(!n)return;y(!0);let t=await Ze({scope:M.scope,name:M.name,editor:N,action:e,...e===`rename`?{toName:g.trim()}:{}});if(y(!1),!t.ok){Z.error(i({id:`MIF36T`,values:{0:t.error}}));return}Z.success(i(e===`align`?{id:`QKgePK`,values:{editor:N}}:e===`make-source`?{id:`It9oAP`,values:{editor:N}}:{id:`b2ezG_`,values:{0:g.trim()}})),r(!1)},t[6]=i,t[7]=N,t[8]=r,t[9]=M.name,t[10]=M.scope,t[11]=n,t[12]=g,t[13]=P):P=t[13];let F=P,I,L;t[14]!==M.name||t[15]!==g?(L=g.trim(),I=L===``||!Ce.test(L)||L===M.name,t[14]=M.name,t[15]=g,t[16]=I,t[17]=L):(I=t[16],L=t[17]);let R=I,z;t[18]!==v||t[19]!==r?(z=e=>{!e&&!v&&r(!1)},t[18]=v,t[19]=r,t[20]=z):z=t[20];let B;t[21]!==N||t[22]!==M.name?(B=(0,Q.jsx)(T,{children:(0,Q.jsx)(l,{id:`q8aCbb`,values:{0:M.name,editor:N}})}),t[21]=N,t[22]=M.name,t[23]=B):B=t[23];let V;t[24]===N?V=t[25]:(V=(0,Q.jsx)(w,{children:(0,Q.jsx)(l,{id:`QASTNu`,values:{editor:N}})}),t[24]=N,t[25]=V);let H;t[26]!==V||t[27]!==B?(H=(0,Q.jsxs)(ee,{children:[B,V]}),t[26]=V,t[27]=B,t[28]=H):H=t[28];let U;t[29]!==c||t[30]!==o||t[31]!==f?(U=c!==null&&o!==null?(0,Q.jsx)(dt,{oldContent:c,newContent:o,layout:`unified`}):f?(0,Q.jsx)(`div`,{className:`flex min-h-56 items-center justify-center px-6 text-center text-muted-foreground text-sm`,children:(0,Q.jsx)(l,{id:`5BlXTD`})}):(0,Q.jsx)(`div`,{className:`flex min-h-56 items-center justify-center text-muted-foreground text-sm`,children:(0,Q.jsx)(l,{id:`1V17kO`})}),t[29]=c,t[30]=o,t[31]=f,t[32]=U):U=t[32];let W;t[33]!==F||t[34]!==N||t[35]!==a||t[36]!==R||t[37]!==m||t[38]!==M.name||t[39]!==g||t[40]!==L?(W=m?(0,Q.jsxs)(`div`,{className:`mt-3 space-y-1.5`,children:[(0,Q.jsx)(te,{htmlFor:a,children:(0,Q.jsx)(l,{id:`pSimwP`,values:{editor:N}})}),(0,Q.jsx)(Pe,{id:a,value:g,onChange:e=>_(e.target.value),placeholder:`${M.name}-${N}`,"aria-invalid":R&&L!==``,onKeyDown:e=>{e.key===`Enter`&&!R&&F(`rename`)}})]}):null,t[33]=F,t[34]=N,t[35]=a,t[36]=R,t[37]=m,t[38]=M.name,t[39]=g,t[40]=L,t[41]=W):W=t[41];let G;t[42]!==U||t[43]!==W?(G=(0,Q.jsxs)(D,{className:`min-h-0 flex-1 overflow-auto`,children:[U,W]}),t[42]=U,t[43]=W,t[44]=G):G=t[44];let K;t[45]!==F||t[46]!==v||t[47]!==N||t[48]!==R||t[49]!==m||t[50]!==M.name?(K=(0,Q.jsx)(O,{children:m?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(b,{variant:`outline`,onClick:()=>h(!1),disabled:v,children:(0,Q.jsx)(l,{id:`iH8pgl`})}),(0,Q.jsx)(b,{onClick:()=>void F(`rename`),disabled:v||R,children:(0,Q.jsx)(l,{id:`AT0e50`})})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(b,{variant:`outline`,onClick:()=>{_(`${M.name}-${N}`),h(!0)},disabled:v,children:(0,Q.jsx)(l,{id:`AT0e50`})}),(0,Q.jsx)(b,{variant:`outline`,onClick:()=>void F(`make-source`),disabled:v,children:(0,Q.jsx)(l,{id:`xWomUD`,values:{editor:N}})}),(0,Q.jsx)(b,{onClick:()=>void F(`align`),disabled:v,children:(0,Q.jsx)(l,{id:`PZn2LP`})})]})}),t[45]=F,t[46]=v,t[47]=N,t[48]=R,t[49]=m,t[50]=M.name,t[51]=K):K=t[51];let q;t[52]!==H||t[53]!==G||t[54]!==K?(q=(0,Q.jsxs)(E,{className:`flex max-h-[85vh] w-full max-w-3xl flex-col`,children:[H,G,K]}),t[52]=H,t[53]=G,t[54]=K,t[55]=q):q=t[55];let J;return t[56]!==q||t[57]!==z?(J=(0,Q.jsx)(A,{open:!0,onOpenChange:z,children:q}),t[56]=q,t[57]=z,t[58]=J):J=t[58],J}function Qn(e){let t=(0,_t.c)(75),{skill:n,existingNames:r,onOpenChange:i,onRenamed:a}=e,o=ke(),s=n!==null,c=(0,$.useId)(),[u,d]=(0,$.useState)(``),[f,p]=(0,$.useState)(!1),m;t[0]===n?m=t[1]:(m=()=>{n&&d(n.name)},t[0]=n,t[1]=m);let h=n?.scope,g=n?.name,_;if(t[2]!==h||t[3]!==g?(_=[h,g],t[2]=h,t[3]=g,t[4]=_):_=t[4],(0,$.useEffect)(m,_),!n)return null;let v,y,x,S,C,D;if(t[5]!==r||t[6]!==u||t[7]!==n.name){C=u.trim(),D=C===n.name;let e;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(e=/\s/,t[14]=e):e=t[14];let i;t[15]===u?i=t[16]:(i=e.test(u),t[15]=u,t[16]=i),v=i,S=C.length>64,y=C===``||!Ce.test(C)||S,x=!y&&!D&&r.has(C),t[5]=r,t[6]=u,t[7]=n.name,t[8]=v,t[9]=y,t[10]=x,t[11]=S,t[12]=C,t[13]=D}else v=t[8],y=t[9],x=t[10],S=t[11],C=t[12],D=t[13];let k=x,j=!y&&!k&&!D&&!f,M;t[17]!==j||t[18]!==i||t[19]!==a||t[20]!==o||t[21]!==n||t[22]!==C?(M=async function(){if(!n||!j)return;p(!0);let e=await o({scope:n.scope,name:n.name},C);p(!1),e.ok&&(a?.(C),i(!1))},t[17]=j,t[18]=i,t[19]=a,t[20]=o,t[21]=n,t[22]=C,t[23]=M):M=t[23];let N=M,P;t[24]===i?P=t[25]:(P=e=>e?null:i(!1),t[24]=i,t[25]=P);let F;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Q.jsx)(T,{children:(0,Q.jsx)(l,{id:`dw_3cv`})}),t[26]=F):F=t[26];let I;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,Q.jsxs)(ee,{children:[F,(0,Q.jsx)(w,{children:(0,Q.jsx)(l,{id:`R9IDFz`})})]}),t[27]=I):I=t[27];let L;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Q.jsx)(l,{id:`6YtxFj`}),t[28]=L):L=t[28];let R;t[29]===c?R=t[30]:(R=(0,Q.jsx)(te,{htmlFor:c,children:L}),t[29]=c,t[30]=R);let z;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(z=e=>d(e.target.value),t[31]=z):z=t[31];let B;t[32]===N?B=t[33]:(B=e=>{e.key===`Enter`&&N()},t[32]=N,t[33]=B);let V=y||k,H=y&&C!==``||k?`${c}-error`:void 0,U;t[34]!==c||t[35]!==u||t[36]!==B||t[37]!==V||t[38]!==H?(U=(0,Q.jsx)(Pe,{id:c,value:u,onChange:z,onKeyDown:B,spellCheck:!1,autoCapitalize:`off`,autoCorrect:`off`,maxLength:64,"aria-invalid":V,"aria-describedby":H,className:`font-mono`}),t[34]=c,t[35]=u,t[36]=B,t[37]=V,t[38]=H,t[39]=U):U=t[39];let W;t[40]!==k||t[41]!==v||t[42]!==c||t[43]!==y||t[44]!==S||t[45]!==C?(W=y&&C!==``?(0,Q.jsx)(`p`,{id:`${c}-error`,className:`text-xs text-destructive`,children:v?(0,Q.jsx)(l,{id:`iUwpZI`,components:{0:(0,Q.jsx)(`code`,{className:`font-mono`})}}):S?(0,Q.jsx)(l,{id:`lK9c4T`}):(0,Q.jsx)(l,{id:`A50vr3`,components:{0:(0,Q.jsx)(`code`,{className:`font-mono`})}})}):k?(0,Q.jsx)(`p`,{id:`${c}-error`,className:`text-xs text-destructive`,children:(0,Q.jsx)(l,{id:`YJ1BTp`})}):null,t[40]=k,t[41]=v,t[42]=c,t[43]=y,t[44]=S,t[45]=C,t[46]=W):W=t[46];let G;t[47]!==R||t[48]!==U||t[49]!==W?(G=(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[R,U,W]}),t[47]=R,t[48]=U,t[49]=W,t[50]=G):G=t[50];let K;t[51]===i?K=t[52]:(K=()=>i(!1),t[51]=i,t[52]=K);let q;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,Q.jsx)(l,{id:`dEgA5A`}),t[53]=q):q=t[53];let J;t[54]!==f||t[55]!==K?(J=(0,Q.jsx)(b,{variant:`outline`,className:`font-mono uppercase`,onClick:K,disabled:f,children:q}),t[54]=f,t[55]=K,t[56]=J):J=t[56];let Y;t[57]===N?Y=t[58]:(Y=()=>void N(),t[57]=N,t[58]=Y);let ne=!j,X;t[59]===f?X=t[60]:(X=f?(0,Q.jsx)(l,{id:`tHKQ6j`}):(0,Q.jsx)(l,{id:`2wxgft`}),t[59]=f,t[60]=X);let re;t[61]!==Y||t[62]!==ne||t[63]!==X?(re=(0,Q.jsx)(b,{onClick:Y,disabled:ne,children:X}),t[61]=Y,t[62]=ne,t[63]=X,t[64]=re):re=t[64];let ie;t[65]!==J||t[66]!==re?(ie=(0,Q.jsxs)(O,{children:[J,re]}),t[65]=J,t[66]=re,t[67]=ie):ie=t[67];let ae;t[68]!==G||t[69]!==ie?(ae=(0,Q.jsxs)(E,{children:[I,G,ie]}),t[68]=G,t[69]=ie,t[70]=ae):ae=t[70];let oe;return t[71]!==s||t[72]!==ae||t[73]!==P?(oe=(0,Q.jsx)(A,{open:s,onOpenChange:P,children:ae}),t[71]=s,t[72]=ae,t[73]=P,t[74]=oe):oe=t[74],oe}function $n(){let e=(0,_t.c)(5),{_:t}=u(),n=We(),r=Oe(),i=ct(),a;return e[0]!==t||e[1]!==r||e[2]!==n||e[3]!==i?(a=async(e,a)=>{if(a===e.scope)return!1;He(e.scope,e.name);let o=await Qe({name:e.name,fromScope:e.scope,toScope:a});if(Ve(e.scope,e.name),!o.ok)return Z.error(t({id:`07eGJB`,values:{0:o.error}})),!1;Z.success(t({id:`yhI6P0`,values:{0:e.name,1:n[a]}}));let s=i.status===`ready`?i.data.find(t=>t.scope===e.scope&&t.name===e.name):void 0;return r(s?Re(s):ce(e.scope,e.name),a===`project`&&o.path!==void 0?`${o.path.replace(/\/+$/,``)}/SKILL`:ce(a,e.name)),!0},e[0]=t,e[1]=r,e[2]=n,e[3]=i,e[4]=a):a=e[4],a}function er(e){let t=(0,_t.c)(38),{target:n,onOpenChange:r}=e,i=We(),a=$n(),[o,s]=(0,$.useState)(!1);if(!n)return null;let{scope:c,name:u,toScope:d}=n,f;t[0]!==o||t[1]!==r?(f=e=>!e&&!o&&r(!1),t[0]=o,t[1]=r,t[2]=f):f=t[2];let p=i[d],m;t[3]===p?m=t[4]:(m=(0,Q.jsx)(T,{children:(0,Q.jsx)(l,{id:`SXEdCq`,values:{0:p}})}),t[3]=p,t[4]=m);let h=i[c],g=i[d],_=i[d],v;t[5]!==u||t[6]!==h||t[7]!==g||t[8]!==_?(v={0:h,1:g,2:_,name:u},t[5]=u,t[6]=h,t[7]=g,t[8]=_,t[9]=v):v=t[9];let y;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(y={0:(0,Q.jsx)(`code`,{className:`font-mono`})},t[10]=y):y=t[10];let x;t[11]===v?x=t[12]:(x=(0,Q.jsx)(w,{children:(0,Q.jsx)(l,{id:`7bIiJ7`,values:v,components:y})}),t[11]=v,t[12]=x);let S;t[13]!==m||t[14]!==x?(S=(0,Q.jsxs)(ee,{children:[m,x]}),t[13]=m,t[14]=x,t[15]=S):S=t[15];let C;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Q.jsx)(l,{id:`dEgA5A`}),t[16]=C):C=t[16];let D;t[17]===o?D=t[18]:(D=(0,Q.jsx)(k,{asChild:!0,children:(0,Q.jsx)(b,{variant:`outline`,disabled:o,children:C})}),t[17]=o,t[18]=D);let j;t[19]!==a||t[20]!==u||t[21]!==r||t[22]!==c||t[23]!==d?(j=async()=>{s(!0),await a({scope:c,name:u},d),s(!1),r(!1)},t[19]=a,t[20]=u,t[21]=r,t[22]=c,t[23]=d,t[24]=j):j=t[24];let M;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,Q.jsx)(l,{id:`QWdKwH`}),t[25]=M):M=t[25];let N;t[26]!==o||t[27]!==j?(N=(0,Q.jsx)(b,{"data-testid":`skill-scope-move-confirm`,disabled:o,onClick:j,children:M}),t[26]=o,t[27]=j,t[28]=N):N=t[28];let P;t[29]!==D||t[30]!==N?(P=(0,Q.jsxs)(O,{children:[D,N]}),t[29]=D,t[30]=N,t[31]=P):P=t[31];let F;t[32]!==S||t[33]!==P?(F=(0,Q.jsxs)(E,{className:`sm:max-w-md`,children:[S,P]}),t[32]=S,t[33]=P,t[34]=F):F=t[34];let I;return t[35]!==f||t[36]!==F?(I=(0,Q.jsx)(A,{open:!0,onOpenChange:f,children:F}),t[35]=f,t[36]=F,t[37]=I):I=t[37],I}function tr(){let e=(0,_t.c)(45),{_:t}=u(),n=lt(),[r,i]=(0,$.useState)(null),[a,o]=(0,$.useState)(null),[s,c]=(0,$.useState)(null),[l,d]=(0,$.useState)(null),[f,p]=(0,$.useState)(null),[m,h]=(0,$.useState)(null),[g,_]=(0,$.useState)(null),v;e[0]===t?v=e[1]:(v=async function(e,n,r){_(e.name);let i=await et({scope:e.scope,name:e.name,...n?{targets:[...n]}:{},...r?.linkMode===void 0?{}:{linkMode:r.linkMode}});if(_(null),!i.ok)return Z.error(t({id:`Mj8R8K`,values:{0:i.error}})),i;let a=nr,o=new Set(i.hosts),s=i.hosts.filter(t=>!e.hosts.includes(t)),c=e.hosts.filter(e=>!o.has(e)),l=e=>{let t=i.warningCodes.indexOf(e);return t>=0?i.warnings[t]:void 0},u=l(`no-targets`);if(u)return Z.warning(u),i;if(s.length>0){let e=l(`scripts-present`);e&&Z.warning(e);let t=l(`no-description`);t&&Z.warning(t)}return i.hosts.length===0?Z.success(t({id:`4pDZ2N`,values:{0:e.name}})):s.length>0&&c.length===0?Z.success(t({id:`PPFQ3o`,values:{0:e.name,1:a(s)}})):c.length>0&&s.length===0?Z.success(t({id:`OOIVJo`,values:{0:e.name,1:a(c)}})):s.length>0&&c.length>0?Z.success(t({id:`OxplNM`,values:{0:e.name,1:a(s),2:a(c)}})):Z.success(t({id:`wDgmsr`,values:{0:e.name,1:a(i.hosts)}})),i},e[0]=t,e[1]=v);let y=v,b;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(b=async function(e,t){if(t.length!==0){_(e.name);for(let{target:n,mode:r}of t){let t=await rt({scope:e.scope,name:e.name,target:n,mode:r});if(!t.ok){Z.error(t.error);break}}_(null)}},e[2]=b):b=e[2];let x=b,S;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(S=async function(e,t){_(e.name);let n=await t();return _(null),n},e[3]=S):S=e[3];let C=S,w;e[4]!==t||e[5]!==n?(w=async function(e,r){let i=await tt({scope:e.scope,name:e.name,existingNames:r});if(!i.ok){Z.error(t({id:`UPjaXD`,values:{0:e.name,1:i.error}}));return}Z.success(t({id:`0g7rCZ`,values:{0:i.name}})),n(e.scope,i.name)},e[4]=t,e[5]=n,e[6]=w):w=e[6];let T=w,E,D;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(E=e=>{e||i(null)},D=()=>i(null),e[7]=E,e[8]=D):(E=e[7],D=e[8]);let O;e[9]===r?O=e[10]:(O=(0,Q.jsx)(qn,{skill:r,onOpenChange:E,onDeleted:D}),e[9]=r,e[10]=O);let k=a?.skill??null,ee=a?.existingNames??ir,A,j;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(j=e=>{e||o(null)},A=()=>o(null),e[11]=A,e[12]=j):(A=e[11],j=e[12]);let M;e[13]!==k||e[14]!==ee?(M=(0,Q.jsx)(Qn,{skill:k,existingNames:ee,onOpenChange:j,onRenamed:A}),e[13]=k,e[14]=ee,e[15]=M):M=e[15];let N;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(N=e=>{e||c(null)},e[16]=N):N=e[16];let P;e[17]===s?P=e[18]:(P=(0,Q.jsx)(er,{target:s,onOpenChange:N}),e[17]=s,e[18]=P);let F;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(F=e=>{e||d(null)},e[19]=F):F=e[19];let I;e[20]===l?I=e[21]:(I=(0,Q.jsx)(Xn,{target:l,onOpenChange:F}),e[20]=l,e[21]=I);let L;e[22]===Symbol.for(`react.memo_cache_sentinel`)?(L=e=>{e||p(null)},e[22]=L):L=e[22];let R;e[23]===f?R=e[24]:(R=(0,Q.jsx)(Yn,{target:f,onOpenChange:L}),e[23]=f,e[24]=R);let te;e[25]===Symbol.for(`react.memo_cache_sentinel`)?(te=e=>{e||h(null)},e[25]=te):te=e[25];let z;e[26]===m?z=e[27]:(z=(0,Q.jsx)(Zn,{target:m,onOpenChange:te}),e[26]=m,e[27]=z);let B;e[28]!==M||e[29]!==P||e[30]!==I||e[31]!==R||e[32]!==z||e[33]!==O?(B=(0,Q.jsxs)(Q.Fragment,{children:[O,M,P,I,R,z]}),e[28]=M,e[29]=P,e[30]=I,e[31]=R,e[32]=z,e[33]=O,e[34]=B):B=e[34];let V=B,H,U,W,G,K;e[35]===Symbol.for(`react.memo_cache_sentinel`)?(H=(e,t)=>o({skill:e,existingNames:t}),U=(e,t)=>c({scope:e.scope,name:e.name,toScope:t}),W=(e,t)=>d({skill:e,filePath:t}),G=(e,t)=>p(t===void 0?{skill:e}:{skill:e,prefix:t}),K=(e,t)=>h({skill:e,editor:t}),e[35]=H,e[36]=U,e[37]=W,e[38]=G,e[39]=K):(H=e[35],U=e[36],W=e[37],G=e[38],K=e[39]);let q;return e[40]!==V||e[41]!==T||e[42]!==y||e[43]!==g?(q={installingName:g,install:y,convertLocations:x,runLocationWrite:C,duplicate:T,requestDelete:i,requestRename:H,requestScopeMove:U,requestFileRename:W,requestFileCreate:G,requestForkResolve:K,dialogs:V},e[40]=V,e[41]=T,e[42]=y,e[43]=g,e[44]=q):q=e[44],q}function nr(e){return e.map(rr).join(`, `)}function rr(e){return ve[e]??e}var ir=new Set;function ar(e){let t=(0,_t.c)(29),{skill:n,filePath:r,actions:i}=e,{_:a}=u(),o=typeof window<`u`?window.okDesktop:void 0,s=n.absolutePath?`${n.absolutePath}/${r}`:void 0,c=`${n.path}/${r}`,d;t[0]===a?d=t[1]:(d=async function(e){try{await ut(e),Z.success(a({id:`SXCSQd`}))}catch{Z.error(a({id:`cRHuuI`}))}},t[0]=a,t[1]=d);let f=d,p;t[2]!==i||t[3]!==r||t[4]!==n?(p=()=>i.requestFileRename(n,r),t[2]=i,t[3]=r,t[4]=n,t[5]=p):p=t[5];let m,h;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Q.jsx)(ht,{"aria-hidden":!0}),h=(0,Q.jsx)(l,{id:`2wxgft`}),t[6]=m,t[7]=h):(m=t[6],h=t[7]);let g;t[8]===p?g=t[9]:(g=(0,Q.jsxs)(j,{onSelect:p,children:[m,h]}),t[8]=p,t[9]=g);let _;t[10]===s?_=t[11]:(_=o&&s?(0,Q.jsxs)(j,{onSelect:()=>void o.shell.showItemInFolder(s),children:[(0,Q.jsx)(je,{"aria-hidden":!0}),(0,Q.jsx)(l,{id:`LtSYdi`})]}):null,t[10]=s,t[11]=_);let v;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Q.jsxs)(L,{children:[(0,Q.jsx)(Ae,{"aria-hidden":!0}),(0,Q.jsx)(l,{id:`zd00pH`})]}),t[12]=v):v=t[12];let y;t[13]!==s||t[14]!==f?(y=s?(0,Q.jsx)(j,{onSelect:()=>void f(s),children:(0,Q.jsx)(l,{id:`z2funE`})}):null,t[13]=s,t[14]=f,t[15]=y):y=t[15];let b;t[16]!==f||t[17]!==c?(b=()=>void f(c),t[16]=f,t[17]=c,t[18]=b):b=t[18];let x;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Q.jsx)(l,{id:`xloBjn`}),t[19]=x):x=t[19];let S;t[20]===b?S=t[21]:(S=(0,Q.jsx)(j,{onSelect:b,children:x}),t[20]=b,t[21]=S);let C;t[22]!==S||t[23]!==y?(C=(0,Q.jsxs)(M,{children:[v,(0,Q.jsxs)(N,{children:[y,S]})]}),t[22]=S,t[23]=y,t[24]=C):C=t[24];let w;return t[25]!==C||t[26]!==g||t[27]!==_?(w=(0,Q.jsxs)(Q.Fragment,{children:[g,_,C]}),t[25]=C,t[26]=g,t[27]=_,t[28]=w):w=t[28],w}function or(e){let t=(0,_t.c)(86),{skill:n,actions:r,existingNames:i}=e,{_:o}=u(),s=p(),c=We(),d=v().states,{dispatch:f}=un(),h=bn(n,r),g=typeof window<`u`?window.okDesktop:void 0,_=n.absolutePath,y;t[0]===o?y=t[1]:(y=async function(e){try{await ut(e),Z.success(o({id:`SXCSQd`}))}catch{Z.error(o({id:`cRHuuI`}))}},t[0]=o,t[1]=y);let b=y,x;t[2]===_?x=t[3]:(x=g&&_?(0,Q.jsxs)(j,{onSelect:()=>void g.shell.showItemInFolder(_),children:[(0,Q.jsx)(je,{"aria-hidden":!0}),(0,Q.jsx)(l,{id:`LtSYdi`})]}):null,t[2]=_,t[3]=x);let S;t[4]!==n.name||t[5]!==n.scope||t[6]!==s?(S=Kt({skillName:n.name,scope:n.scope,workspace:s}),t[4]=n.name,t[5]=n.scope,t[6]=s,t[7]=S):S=t[7];let C;t[8]!==f||t[9]!==d||t[10]!==S?(C=(0,Q.jsx)(Bn,{input:S,installStates:d,isElectronHost:g!=null,dispatch:f}),t[8]=f,t[9]=d,t[10]=S,t[11]=C):C=t[11];let w;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Q.jsxs)(L,{children:[(0,Q.jsx)(Ae,{"aria-hidden":!0}),(0,Q.jsx)(l,{id:`zd00pH`})]}),t[12]=w):w=t[12];let T;t[13]!==_||t[14]!==b?(T=_?(0,Q.jsx)(j,{onSelect:()=>void b(_),children:(0,Q.jsx)(l,{id:`z2funE`})}):null,t[13]=_,t[14]=b,t[15]=T):T=t[15];let E;t[16]!==b||t[17]!==n.path?(E=()=>void b(n.path),t[16]=b,t[17]=n.path,t[18]=E):E=t[18];let D;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Q.jsx)(l,{id:`xloBjn`}),t[19]=D):D=t[19];let O;t[20]===E?O=t[21]:(O=(0,Q.jsx)(j,{onSelect:E,children:D}),t[20]=E,t[21]=O);let k;t[22]!==T||t[23]!==O?(k=(0,Q.jsxs)(M,{children:[w,(0,Q.jsxs)(N,{children:[T,O]})]}),t[22]=T,t[23]=O,t[24]=k):k=t[24];let ee;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,Q.jsx)(R,{}),t[25]=ee):ee=t[25];let A;t[26]!==r||t[27]!==i||t[28]!==n?(A=()=>void r.duplicate(n,i),t[26]=r,t[27]=i,t[28]=n,t[29]=A):A=t[29];let P,F;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,Q.jsx)(a,{"aria-hidden":!0}),F=(0,Q.jsx)(l,{id:`euc6Ns`}),t[30]=P,t[31]=F):(P=t[30],F=t[31]);let I;t[32]===A?I=t[33]:(I=(0,Q.jsxs)(j,{onSelect:A,children:[P,F]}),t[32]=A,t[33]=I);let te;t[34]!==r||t[35]!==i||t[36]!==n?(te=()=>r.requestRename(n,i),t[34]=r,t[35]=i,t[36]=n,t[37]=te):te=t[37];let z,B;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,Q.jsx)(ht,{"aria-hidden":!0}),B=(0,Q.jsx)(l,{id:`2wxgft`}),t[38]=z,t[39]=B):(z=t[38],B=t[39]);let V;t[40]===te?V=t[41]:(V=(0,Q.jsxs)(j,{onSelect:te,children:[z,B]}),t[40]=te,t[41]=V);let H;t[42]!==r||t[43]!==n?(H=()=>r.requestFileCreate(n),t[42]=r,t[43]=n,t[44]=H):H=t[44];let U,W;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,Q.jsx)(m,{"aria-hidden":!0}),W=(0,Q.jsx)(l,{id:`HdkSiO`}),t[45]=U,t[46]=W):(U=t[45],W=t[46]);let G;t[47]===H?G=t[48]:(G=(0,Q.jsxs)(j,{onSelect:H,children:[U,W]}),t[47]=H,t[48]=G);let K;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,Q.jsxs)(L,{children:[(0,Q.jsx)(pt,{"aria-hidden":!0}),(0,Q.jsx)(l,{id:`TKQ7K-`})]}),t[49]=K):K=t[49];let q;t[50]!==r||t[51]!==n?(q=e=>r.requestForkResolve(n,e),t[50]=r,t[51]=n,t[52]=q):q=t[52];let J;t[53]!==h||t[54]!==n||t[55]!==q?(J=(0,Q.jsxs)(M,{children:[K,(0,Q.jsx)(N,{className:yn,children:(0,Q.jsx)(Tn,{toggles:h,skill:n,onResolveFork:q})})]}),t[53]=h,t[54]=n,t[55]=q,t[56]=J):J=t[56];let Y;t[57]!==r||t[58]!==n?(Y=()=>r.requestScopeMove(n,n.scope===`project`?`global`:`project`),t[57]=r,t[58]=n,t[59]=Y):Y=t[59];let ne;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,Q.jsx)(ft,{"aria-hidden":!0}),t[60]=ne):ne=t[60];let X;t[61]!==c.global||t[62]!==c.project||t[63]!==n.scope?(X=n.scope===`project`?(0,Q.jsx)(l,{id:`bpytj4`,values:{0:c.global}}):(0,Q.jsx)(l,{id:`bpytj4`,values:{0:c.project}}),t[61]=c.global,t[62]=c.project,t[63]=n.scope,t[64]=X):X=t[64];let re;t[65]!==Y||t[66]!==X?(re=(0,Q.jsxs)(j,{onSelect:Y,children:[ne,X]}),t[65]=Y,t[66]=X,t[67]=re):re=t[67];let ie;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,Q.jsx)(R,{}),t[68]=ie):ie=t[68];let ae;t[69]!==r||t[70]!==n?(ae=()=>r.requestDelete(n),t[69]=r,t[70]=n,t[71]=ae):ae=t[71];let oe,se;t[72]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,Q.jsx)(Ne,{"aria-hidden":!0}),se=(0,Q.jsx)(l,{id:`cnGeoo`}),t[72]=oe,t[73]=se):(oe=t[72],se=t[73]);let ce;t[74]===ae?ce=t[75]:(ce=(0,Q.jsxs)(j,{variant:`destructive`,onSelect:ae,children:[oe,se]}),t[74]=ae,t[75]=ce);let le;return t[76]!==k||t[77]!==I||t[78]!==V||t[79]!==x||t[80]!==G||t[81]!==J||t[82]!==re||t[83]!==ce||t[84]!==C?(le=(0,Q.jsxs)(Q.Fragment,{children:[x,C,k,ee,I,V,G,J,re,ie,ce]}),t[76]=k,t[77]=I,t[78]=V,t[79]=x,t[80]=G,t[81]=J,t[82]=re,t[83]=ce,t[84]=C,t[85]=le):le=t[85],le}export{gt as C,Bt as S,ft as T,en as _,Wn as a,an as b,vn as c,bn as d,qt as f,Ht as g,Vt as h,er as i,yn as l,Gt as m,ar as n,Bn as o,Ut as p,tr as r,Rn as s,or as t,Tn as u,sn as v,mt as w,un as x,Wt as y};
@@ -1 +1 @@
1
- import{r as e}from"./dist-Nvb76hAm.js";import{Dt as t,ba as n,ga as r,ma as i}from"./dist-OxboORfH2.js";function a(e){return e.path.split(`/`).slice(0,-1).join(`/`)}var o=[`project`,`global`];function s(e){return{project:new Set(e.filter(e=>e.scope===`project`).map(e=>e.name)),global:new Set(e.filter(e=>e.scope===`global`).map(e=>e.name))}}function c(e){return e.startsWith(`open-knowledge-pack-`)?e.slice(n.length):e}function l(e){let t=e.path.replace(/\/SKILL\.mdx?$/i,``);return e.scope===`global`?`~/${t}`:t}function u(e){return e.replace(/^\/(?:Users|home)\/[^/]+/,`~`).replace(/^\/root/,`~`)}function d(){let{_:t}=e();return{project:t({id:`e0NrBM`}),global:t({id:`2GT3Hf`})}}function f(){let{_:t}=e();return{project:t({id:`Es3G-g`}),global:t({id:`fvrHin`})}}function p(e,t){if(e.includes(`/`))return t===`global`?`~/${e}`:e;let n=e===`agents`?`.agents/skills`:(t===`global`?r:i)[e]??`.${e}/skills`;return t===`global`?`~/${n}`:n}function m(e,t){return!e||t===``?[]:Object.keys(e).filter(n=>e[n]===t)}function h(e){let t=e.hostAliases??{},n=e=>e.split(`/`).slice(0,-1).join(`/`),r=new Set(e.hosts),i=new Set([...e.hosts.filter(e=>!e.includes(`/`)).map(t=>p(t,e.scope).replace(/^~\//,``)),...(e.customPlacements??[]).map(e=>n(e.path)),...e.path.includes(`/`)?[n(e.path.replace(/\/SKILL\.mdx?$/i,``))]:[]]);return Object.entries(t).filter(([e,t])=>!r.has(e)&&i.has(t)).map(([e])=>e)}function g(e){let t=new Set(e.symlinkedHosts??[]),n=[],r=new Set,i=(e,t)=>{r.has(e)||(r.add(e),n.push({dir:e,symlink:t}))};i(l(e),t.has(e.hosts[0]??``));for(let n of e.hosts)i(`${p(n,e.scope)}/${e.name}`,t.has(n));for(let t of e.customPlacements??[])i(t.path,t.mode===`link`);return n}function _(e,n=e.hosts){let r=t.options,i=h(e);return[...n.includes(`agents`)?[`agents`]:[],...r.filter(e=>n.includes(e)||i.includes(e)),...(e.customPlacements??[]).map(e=>a(e))]}export{c as a,s as c,d,_ as i,u as l,m as n,g as o,a as r,p as s,o as t,f as u};
1
+ import{r as e}from"./dist-Nvb76hAm.js";import{Dt as t,ba as n,ga as r,ma as i}from"./dist-BqtkiFoE2.js";function a(e){return e.path.split(`/`).slice(0,-1).join(`/`)}var o=[`project`,`global`];function s(e){return{project:new Set(e.filter(e=>e.scope===`project`).map(e=>e.name)),global:new Set(e.filter(e=>e.scope===`global`).map(e=>e.name))}}function c(e){return e.startsWith(`open-knowledge-pack-`)?e.slice(n.length):e}function l(e){let t=e.path.replace(/\/SKILL\.mdx?$/i,``);return e.scope===`global`?`~/${t}`:t}function u(e){return e.replace(/^\/(?:Users|home)\/[^/]+/,`~`).replace(/^\/root/,`~`)}function d(){let{_:t}=e();return{project:t({id:`e0NrBM`}),global:t({id:`2GT3Hf`})}}function f(){let{_:t}=e();return{project:t({id:`Es3G-g`}),global:t({id:`fvrHin`})}}function p(e,t){if(e.includes(`/`))return t===`global`?`~/${e}`:e;let n=e===`agents`?`.agents/skills`:(t===`global`?r:i)[e]??`.${e}/skills`;return t===`global`?`~/${n}`:n}function m(e,t){return!e||t===``?[]:Object.keys(e).filter(n=>e[n]===t)}function h(e){let t=e.hostAliases??{},n=e=>e.split(`/`).slice(0,-1).join(`/`),r=new Set(e.hosts),i=new Set([...e.hosts.filter(e=>!e.includes(`/`)).map(t=>p(t,e.scope).replace(/^~\//,``)),...(e.customPlacements??[]).map(e=>n(e.path)),...e.path.includes(`/`)?[n(e.path.replace(/\/SKILL\.mdx?$/i,``))]:[]]);return Object.entries(t).filter(([e,t])=>!r.has(e)&&i.has(t)).map(([e])=>e)}function g(e){let t=new Set(e.symlinkedHosts??[]),n=[],r=new Set,i=(e,t)=>{r.has(e)||(r.add(e),n.push({dir:e,symlink:t}))};i(l(e),t.has(e.hosts[0]??``));for(let n of e.hosts)i(`${p(n,e.scope)}/${e.name}`,t.has(n));for(let t of e.customPlacements??[])i(t.path,t.mode===`link`);return n}function _(e,n=e.hosts){let r=t.options,i=h(e);return[...n.includes(`agents`)?[`agents`]:[],...r.filter(e=>n.includes(e)||i.includes(e)),...(e.customPlacements??[]).map(e=>a(e))]}export{c as a,s as c,d,_ as i,u as l,m as n,g as o,a as r,p as s,o as t,f as u};
@@ -1 +1 @@
1
- import{kt as e}from"./dist-OxboORfH2.js";import{t}from"./parse-api-error-Dmlzsw8v.js";import{o as n}from"./documents-events-5TI0rZAg.js";async function r(e){return t(await e.json().catch(()=>null))??`HTTP ${e.status}`}async function i(e,t){try{let n=await fetch(e,t?{signal:t}:void 0);return n.ok?{ok:!0,...await n.json()}:{ok:!1,error:await r(n)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function a(e,t,n){try{let i=await fetch(e,{method:t,...n===void 0?{}:{headers:{"Content-Type":`application/json`},body:JSON.stringify(n)}});return i.ok?{ok:!0,...await i.json().catch(()=>null)??{}}:{ok:!1,error:await r(i)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function o(e){let t=e.trim();return t.length<2?{ok:!0,results:[],backend:`skills.sh`,degraded:!1}:i(`/api/skills/search?q=${encodeURIComponent(t)}`)}async function s(){return i(`/api/skills/popular?limit=24`)}async function c(t,n){let r=await i(t?`/api/skills?scope=${t}`:`/api/skills`,n);if(!r.ok)return r;let{ok:a,...o}=r,s=e.safeParse(o);return s.success?{ok:!0,skills:s.data.skills}:{ok:!1,error:`The skills list did not match its schema.`}}async function l(e){return i(`/api/skills/detail?${new URLSearchParams({source:e.source,name:e.name}).toString()}`)}async function u(e,t){return i(`/api/skills/preview?${new URLSearchParams({source:e.source,name:e.name}).toString()}`,t)}async function d(e,t){return i(`/api/skills/resolve-ref?${new URLSearchParams({ref:e.ref,scope:e.scope,from:e.from}).toString()}`,t)}async function f(e,t){return i(`/api/skills/discover?source=${encodeURIComponent(e)}`,t)}async function p(){return i(`/api/skills/installed`)}async function m(e){try{let t=await fetch(`/api/skill/edit-external`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await r(t)};let n=await t.json().catch(()=>null);return!n||typeof n.docName!=`string`?{ok:!1,error:`Server returned a malformed response.`}:{ok:!0,docName:n.docName}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function h(e){try{let t=await fetch(`/api/skill`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await r(t)};let i=await t.json().catch(()=>null);return n(),{ok:!0,created:i?.created??!1,warnings:i?.warnings??[],...typeof i?.path==`string`?{path:i.path}:{}}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function g(e){try{let r=await fetch(`/api/skill/import`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!r.ok){let e=await r.json().catch(()=>null),n=t(e)??`HTTP ${r.status}`,i=typeof e?.detail==`string`&&/multiple skills/i.test(String(e?.title??``))?String(e.detail).split(`, `).map(e=>e.trim()).filter(Boolean):void 0;return i?{ok:!1,error:n,skills:i}:{ok:!1,error:n}}let i=await r.json().catch(()=>null);return!i||typeof i.name!=`string`?{ok:!1,error:`Server returned a malformed import response.`}:(n(),{ok:!0,name:i.name,alreadyImported:i?.alreadyImported??!1,collisionRenamedFrom:i?.collisionRenamedFrom,warnings:i?.warnings??[]})}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function _(e){try{let t=await fetch(`/api/skills/import-bulk`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await r(t)};let i=await t.json().catch(()=>null);return!i||!Array.isArray(i.results)?{ok:!1,error:`Server returned a malformed import response.`}:(n(),{ok:!0,...i})}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function v(e,t){try{let i=await fetch(`/api/skill-upload?scope=${encodeURIComponent(t)}`,{method:`POST`,body:e});if(!i.ok)return{ok:!1,error:await r(i)};let a=await i.json().catch(()=>null);return!a||typeof a.name!=`string`?{ok:!1,error:`Server returned a malformed upload response.`}:(n(),{ok:!0,name:a.name,alreadyImported:a?.alreadyImported??!1,collisionRenamedFrom:a?.collisionRenamedFrom,warnings:a?.warnings??[]})}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}function y(e,t){let n=`${e}-copy`;if(!t.has(n))return n;for(let n=2;n<1e3;n+=1){let r=`${e}-copy-${n}`;if(!t.has(r))return r}return`${e}-copy-${t.size+1}`}async function b(e){try{let t=y(e.name,e.existingNames),i=await fetch(`/api/skill/duplicate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({scope:e.scope,name:e.name,toName:t})});if(!i.ok)return{ok:!1,error:await r(i)};let a=await i.json().catch(()=>null);return typeof a?.name==`string`?(n(),{ok:!0,name:a.name}):{ok:!1,error:`Server returned a malformed duplicate response.`}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function x(e){let{name:t,fromScope:i,toScope:a}=e;if(i===a)return{ok:!0,scope:a};try{let e=await fetch(`/api/skill/move-scope`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({name:t,fromScope:i,toScope:a})});if(!e.ok)return{ok:!1,error:await r(e)};let o=await e.json().catch(()=>null);return n(),{ok:!0,scope:a,...typeof o?.path==`string`?{path:o.path}:{}}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function S(e){try{let t=await fetch(`/api/skill`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await r(t)};let i=await t.json().catch(()=>null);return n(),{ok:!0,committed:i?.committed??!1,...typeof i?.to==`string`?{to:i.to}:{}}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function C(e,t){try{let i=`?name=${encodeURIComponent(t)}&scope=${encodeURIComponent(e)}`,a=await fetch(`/api/skill${i}`,{method:`DELETE`});if(!a.ok)return{ok:!1,error:await r(a)};let o=await a.json().catch(()=>null);return n(),{ok:!0,existed:o?.existed??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function w(e){let t=await a(`/api/skill/install`,`POST`,{scope:e.scope,name:e.name,fork:{editor:e.editor,action:e.action,...e.toName===void 0?{}:{toName:e.toName}}});return t.ok?(n(),{ok:!0}):t}async function T(e){try{let t=await fetch(`/api/skill-file`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await r(t)};let i=await t.json().catch(()=>null);return n(),{ok:!0,path:i?.path??e.path}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function E(e){try{let t=await fetch(`/api/skill-file/rename`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await r(t)};let i=await t.json().catch(()=>null);return n(),{ok:!0,from:i?.from??e.from,to:i?.to??e.to,...i?.fromDocName===void 0?{}:{fromDocName:i.fromDocName},...i?.toDocName===void 0?{}:{toDocName:i.toDocName}}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function D(e,t,n){try{let i=new URLSearchParams({name:t,scope:e,...n?{host:n}:{}}),a=await fetch(`/api/skill?${i.toString()}`);return a.ok?{ok:!0,files:(await a.json().catch(()=>null))?.skill?.files??[]}:{ok:!1,error:await r(a)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function O(e){try{let t=new URLSearchParams({name:e.name,scope:e.scope,path:e.path,...e.host?{host:e.host}:{}}),n=await fetch(`/api/skill-file?${t.toString()}`,{signal:e.signal});if(!n.ok)return{ok:!1,status:n.status,error:await r(n)};let i=await n.json().catch(()=>null);return typeof i?.text==`string`?{ok:!0,text:i.text}:{ok:!1,status:n.status,error:`HTTP ${n.status}`}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}function k(e,t){return O({...e,signal:t}).then(e=>e.ok?{ok:!0,text:e.text}:{ok:!1,status:e.status})}async function A(e){try{let t=await fetch(`/api/skill/install`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await r(t)};let i=await t.json().catch(()=>null);return n(),{ok:!0,hosts:i?.hosts??[],scripts:i?.scripts??!1,warnings:i?.warnings??[],warningCodes:i?.warningCodes??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function j(e){try{let t=await fetch(`/api/skill/install`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({scope:e.scope,name:e.name,place:{dir:e.dir,mode:e.mode}})});if(!t.ok)return{ok:!1,error:await r(t)};let i=await t.json().catch(()=>null);return n(),{ok:!0,placedAt:i?.placedAt??e.dir}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function M(e){let t=await a(`/api/skill/install`,`POST`,{scope:e.scope,name:e.name,unplace:{path:e.path}});return t.ok?(n(),{ok:!0}):t}async function N(e){let t=await a(`/api/skill/install`,`POST`,{scope:e.scope,name:e.name,setSource:e.target});return t.ok?(n(),{ok:!0}):t}async function P(e){let t=await a(`/api/skill/install`,`POST`,{scope:e.scope,name:e.name,convert:{target:e.target,mode:e.mode}});return t.ok?(n(),{ok:!0}):t}async function F(e){try{let t=await fetch(`/api/skill-targets`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({folderAction:e})});return t.ok?{ok:!0}:{ok:!1,error:await r(t)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function I(e){try{let t=await fetch(`/api/skill/reimport`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await r(t)};let i=await t.json().catch(()=>null);return e.dryRun||n(),{ok:!0,updated:i?.updated??!1,source:i?.source??``,localBody:i?.localBody,upstreamBody:i?.upstreamBody,...i?.gitTracked===void 0?{}:{gitTracked:i.gitTracked},warnings:i?.warnings??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function L(e){try{let t=await fetch(`/api/skill/revert`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await r(t)};let i=await t.json().catch(()=>null);return n(),{ok:!0,warnings:i?.warnings??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}export{T as A,d as C,N as D,o as E,M as O,w as S,h as T,x as _,m as a,I as b,u as c,_ as d,A as f,S as g,k as h,b as i,v as k,D as l,c as m,C as n,s as o,p,f as r,l as s,P as t,g as u,j as v,L as w,E as x,F as y};
1
+ import{kt as e}from"./dist-BqtkiFoE2.js";import{t}from"./parse-api-error-Dmlzsw8v.js";import{o as n}from"./documents-events-D-wbjalg.js";async function r(e){return t(await e.json().catch(()=>null))??`HTTP ${e.status}`}async function i(e,t){try{let n=await fetch(e,t?{signal:t}:void 0);return n.ok?{ok:!0,...await n.json()}:{ok:!1,error:await r(n)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function a(e,t,n){try{let i=await fetch(e,{method:t,...n===void 0?{}:{headers:{"Content-Type":`application/json`},body:JSON.stringify(n)}});return i.ok?{ok:!0,...await i.json().catch(()=>null)??{}}:{ok:!1,error:await r(i)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function o(e){let t=e.trim();return t.length<2?{ok:!0,results:[],backend:`skills.sh`,degraded:!1}:i(`/api/skills/search?q=${encodeURIComponent(t)}`)}async function s(){return i(`/api/skills/popular?limit=24`)}async function c(t,n){let r=await i(t?`/api/skills?scope=${t}`:`/api/skills`,n);if(!r.ok)return r;let{ok:a,...o}=r,s=e.safeParse(o);return s.success?{ok:!0,skills:s.data.skills}:{ok:!1,error:`The skills list did not match its schema.`}}async function l(e){return i(`/api/skills/detail?${new URLSearchParams({source:e.source,name:e.name}).toString()}`)}async function u(e,t){return i(`/api/skills/preview?${new URLSearchParams({source:e.source,name:e.name}).toString()}`,t)}async function d(e,t){return i(`/api/skills/resolve-ref?${new URLSearchParams({ref:e.ref,scope:e.scope,from:e.from}).toString()}`,t)}async function f(e,t){return i(`/api/skills/discover?source=${encodeURIComponent(e)}`,t)}async function p(){return i(`/api/skills/installed`)}async function m(e){try{let t=await fetch(`/api/skill/edit-external`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await r(t)};let n=await t.json().catch(()=>null);return!n||typeof n.docName!=`string`?{ok:!1,error:`Server returned a malformed response.`}:{ok:!0,docName:n.docName}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function h(e){try{let t=await fetch(`/api/skill`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await r(t)};let i=await t.json().catch(()=>null);return n(),{ok:!0,created:i?.created??!1,warnings:i?.warnings??[],...typeof i?.path==`string`?{path:i.path}:{}}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function g(e){try{let r=await fetch(`/api/skill/import`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!r.ok){let e=await r.json().catch(()=>null),n=t(e)??`HTTP ${r.status}`,i=typeof e?.detail==`string`&&/multiple skills/i.test(String(e?.title??``))?String(e.detail).split(`, `).map(e=>e.trim()).filter(Boolean):void 0;return i?{ok:!1,error:n,skills:i}:{ok:!1,error:n}}let i=await r.json().catch(()=>null);return!i||typeof i.name!=`string`?{ok:!1,error:`Server returned a malformed import response.`}:(n(),{ok:!0,name:i.name,alreadyImported:i?.alreadyImported??!1,collisionRenamedFrom:i?.collisionRenamedFrom,warnings:i?.warnings??[]})}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function _(e){try{let t=await fetch(`/api/skills/import-bulk`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await r(t)};let i=await t.json().catch(()=>null);return!i||!Array.isArray(i.results)?{ok:!1,error:`Server returned a malformed import response.`}:(n(),{ok:!0,...i})}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function v(e,t){try{let i=await fetch(`/api/skill-upload?scope=${encodeURIComponent(t)}`,{method:`POST`,body:e});if(!i.ok)return{ok:!1,error:await r(i)};let a=await i.json().catch(()=>null);return!a||typeof a.name!=`string`?{ok:!1,error:`Server returned a malformed upload response.`}:(n(),{ok:!0,name:a.name,alreadyImported:a?.alreadyImported??!1,collisionRenamedFrom:a?.collisionRenamedFrom,warnings:a?.warnings??[]})}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}function y(e,t){let n=`${e}-copy`;if(!t.has(n))return n;for(let n=2;n<1e3;n+=1){let r=`${e}-copy-${n}`;if(!t.has(r))return r}return`${e}-copy-${t.size+1}`}async function b(e){try{let t=y(e.name,e.existingNames),i=await fetch(`/api/skill/duplicate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({scope:e.scope,name:e.name,toName:t})});if(!i.ok)return{ok:!1,error:await r(i)};let a=await i.json().catch(()=>null);return typeof a?.name==`string`?(n(),{ok:!0,name:a.name}):{ok:!1,error:`Server returned a malformed duplicate response.`}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function x(e){let{name:t,fromScope:i,toScope:a}=e;if(i===a)return{ok:!0,scope:a};try{let e=await fetch(`/api/skill/move-scope`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({name:t,fromScope:i,toScope:a})});if(!e.ok)return{ok:!1,error:await r(e)};let o=await e.json().catch(()=>null);return n(),{ok:!0,scope:a,...typeof o?.path==`string`?{path:o.path}:{}}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function S(e){try{let t=await fetch(`/api/skill`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await r(t)};let i=await t.json().catch(()=>null);return n(),{ok:!0,committed:i?.committed??!1,...typeof i?.to==`string`?{to:i.to}:{}}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function C(e,t){try{let i=`?name=${encodeURIComponent(t)}&scope=${encodeURIComponent(e)}`,a=await fetch(`/api/skill${i}`,{method:`DELETE`});if(!a.ok)return{ok:!1,error:await r(a)};let o=await a.json().catch(()=>null);return n(),{ok:!0,existed:o?.existed??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function w(e){let t=await a(`/api/skill/install`,`POST`,{scope:e.scope,name:e.name,fork:{editor:e.editor,action:e.action,...e.toName===void 0?{}:{toName:e.toName}}});return t.ok?(n(),{ok:!0}):t}async function T(e){try{let t=await fetch(`/api/skill-file`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await r(t)};let i=await t.json().catch(()=>null);return n(),{ok:!0,path:i?.path??e.path}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function E(e){try{let t=await fetch(`/api/skill-file/rename`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await r(t)};let i=await t.json().catch(()=>null);return n(),{ok:!0,from:i?.from??e.from,to:i?.to??e.to,...i?.fromDocName===void 0?{}:{fromDocName:i.fromDocName},...i?.toDocName===void 0?{}:{toDocName:i.toDocName}}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function D(e,t,n){try{let i=new URLSearchParams({name:t,scope:e,...n?{host:n}:{}}),a=await fetch(`/api/skill?${i.toString()}`);return a.ok?{ok:!0,files:(await a.json().catch(()=>null))?.skill?.files??[]}:{ok:!1,error:await r(a)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function O(e){try{let t=new URLSearchParams({name:e.name,scope:e.scope,path:e.path,...e.host?{host:e.host}:{}}),n=await fetch(`/api/skill-file?${t.toString()}`,{signal:e.signal});if(!n.ok)return{ok:!1,status:n.status,error:await r(n)};let i=await n.json().catch(()=>null);return typeof i?.text==`string`?{ok:!0,text:i.text}:{ok:!1,status:n.status,error:`HTTP ${n.status}`}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}function k(e,t){return O({...e,signal:t}).then(e=>e.ok?{ok:!0,text:e.text}:{ok:!1,status:e.status})}async function A(e){try{let t=await fetch(`/api/skill/install`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await r(t)};let i=await t.json().catch(()=>null);return n(),{ok:!0,hosts:i?.hosts??[],scripts:i?.scripts??!1,warnings:i?.warnings??[],warningCodes:i?.warningCodes??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function j(e){try{let t=await fetch(`/api/skill/install`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({scope:e.scope,name:e.name,place:{dir:e.dir,mode:e.mode}})});if(!t.ok)return{ok:!1,error:await r(t)};let i=await t.json().catch(()=>null);return n(),{ok:!0,placedAt:i?.placedAt??e.dir}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function M(e){let t=await a(`/api/skill/install`,`POST`,{scope:e.scope,name:e.name,unplace:{path:e.path}});return t.ok?(n(),{ok:!0}):t}async function N(e){let t=await a(`/api/skill/install`,`POST`,{scope:e.scope,name:e.name,setSource:e.target});return t.ok?(n(),{ok:!0}):t}async function P(e){let t=await a(`/api/skill/install`,`POST`,{scope:e.scope,name:e.name,convert:{target:e.target,mode:e.mode}});return t.ok?(n(),{ok:!0}):t}async function F(e){try{let t=await fetch(`/api/skill-targets`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({folderAction:e})});return t.ok?{ok:!0}:{ok:!1,error:await r(t)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function I(e){try{let t=await fetch(`/api/skill/reimport`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await r(t)};let i=await t.json().catch(()=>null);return e.dryRun||n(),{ok:!0,updated:i?.updated??!1,source:i?.source??``,localBody:i?.localBody,upstreamBody:i?.upstreamBody,...i?.gitTracked===void 0?{}:{gitTracked:i.gitTracked},warnings:i?.warnings??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function L(e){try{let t=await fetch(`/api/skill/revert`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await r(t)};let i=await t.json().catch(()=>null);return n(),{ok:!0,warnings:i?.warnings??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}export{T as A,d as C,N as D,o as E,M as O,w as S,h as T,x as _,m as a,I as b,u as c,_ as d,A as f,S as g,k as h,b as i,v as k,D as l,c as m,C as n,s as o,p,f as r,l as s,P as t,g as u,j as v,L as w,E as x,F as y};
@@ -1 +1 @@
1
- import{o as e,t}from"./chunk-CYidjpOJ.js";import{n}from"./chunk-Y2CYZVJY-BavonG01.js";import"./src-CIOeKeVw.js";var r=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=r()})(e,(function(){var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`year`,f=`date`,p=`Invalid Date`,m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),a=n-i<0,o=t.clone().add(r+(a?-1:1),l);return+(-(r+(n-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:c,d:s,D:f,h:o,m:a,s:i,ms:r,Q:u}[e]||String(e||``).toLowerCase().replace(/s$/,``)},u:function(e){return e===void 0}},y=`en`,b={};b[y]=g;var x=`$isDayjsObject`,S=function(e){return e instanceof E||!(!e||!e[x])},C=function e(t,n,r){var i;if(!t)return y;if(typeof t==`string`){var a=t.toLowerCase();b[a]&&(i=a),n&&(b[a]=n,i=a);var o=t.split(`-`);if(!i&&o.length>1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},w=function(e,t){if(S(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new E(n)},T=v;T.l=C,T.i=S,T.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return w(e)<this.startOf(t)},_.isBefore=function(e,t){return this.endOf(t)<w(e)},_.$g=function(e,t,n){return T.u(e)?this[t]:this.set(n,e)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(e,t){var n=this,r=!!T.u(t)||t,u=T.p(e),p=function(e,t){var i=T.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(s)},m=function(e,t){return T.w(n.toDate()[e].apply(n.toDate(`s`),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},h=this.$W,g=this.$M,_=this.$D,v=`set`+(this.$u?`UTC`:``);switch(u){case d:return r?p(1,0):p(31,11);case l:return r?p(1,g):p(0,g+1);case c:var y=this.$locale().weekStart||0,b=(h<y?h+7:h)-y;return p(r?_-b:_+(6-b),g);case s:case f:return m(v+`Hours`,0);case o:return m(v+`Minutes`,1);case a:return m(v+`Seconds`,2);case i:return m(v+`Milliseconds`,3);default:return this.clone()}},_.endOf=function(e){return this.startOf(e,!1)},_.$set=function(e,t){var n,c=T.p(e),u=`set`+(this.$u?`UTC`:``),p=(n={},n[s]=u+`Date`,n[f]=u+`Date`,n[l]=u+`Month`,n[d]=u+`FullYear`,n[o]=u+`Hours`,n[a]=u+`Minutes`,n[i]=u+`Seconds`,n[r]=u+`Milliseconds`,n)[c],m=c===s?this.$D+(t-this.$W):t;if(c===l||c===d){var h=this.clone().set(f,1);h.$d[p](m),h.init(),this.$d=h.set(f,Math.min(this.$D,h.daysInMonth())).$d}else p&&this.$d[p](m);return this.init(),this},_.set=function(e,t){return this.clone().$set(e,t)},_.get=function(e){return this[T.p(e)]()},_.add=function(r,u){var f,p=this;r=Number(r);var m=T.p(u),h=function(e){var t=w(p);return T.w(t.date(t.date()+Math.round(e*r)),p)};if(m===l)return this.set(l,this.$M+r);if(m===d)return this.set(d,this.$y+r);if(m===s)return h(1);if(m===c)return h(7);var g=(f={},f[a]=t,f[o]=n,f[i]=e,f)[m]||1,_=this.$d.getTime()+r*g;return T.w(_,this)},_.subtract=function(e,t){return this.add(-1*e,t)},_.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var r=e||`YYYY-MM-DDTHH:mm:ssZ`,i=T.z(this),a=this.$H,o=this.$m,s=this.$M,c=n.weekdays,l=n.months,u=n.meridiem,d=function(e,n,i,a){return e&&(e[n]||e(t,r))||i[n].slice(0,a)},f=function(e){return T.s(a%12||12,e,`0`)},m=u||function(e,t,n){var r=e<12?`AM`:`PM`;return n?r.toLowerCase():r};return r.replace(h,(function(e,r){return r||function(e){switch(e){case`YY`:return String(t.$y).slice(-2);case`YYYY`:return T.s(t.$y,4,`0`);case`M`:return s+1;case`MM`:return T.s(s+1,2,`0`);case`MMM`:return d(n.monthsShort,s,l,3);case`MMMM`:return d(l,s);case`D`:return t.$D;case`DD`:return T.s(t.$D,2,`0`);case`d`:return String(t.$W);case`dd`:return d(n.weekdaysMin,t.$W,c,2);case`ddd`:return d(n.weekdaysShort,t.$W,c,3);case`dddd`:return c[t.$W];case`H`:return String(a);case`HH`:return T.s(a,2,`0`);case`h`:return f(1);case`hh`:return f(2);case`a`:return m(a,o,!0);case`A`:return m(a,o,!1);case`m`:return String(o);case`mm`:return T.s(o,2,`0`);case`s`:return String(t.$s);case`ss`:return T.s(t.$s,2,`0`);case`SSS`:return T.s(t.$ms,3,`0`);case`Z`:return i}return null}(e)||i.replace(`:`,``)}))},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(r,f,p){var m,h=this,g=T.p(f),_=w(r),v=(_.utcOffset()-this.utcOffset())*t,y=this-_,b=function(){return T.m(h,_)};switch(g){case d:m=b()/12;break;case l:m=b();break;case u:m=b()/3;break;case c:m=(y-v)/6048e5;break;case s:m=(y-v)/864e5;break;case o:m=y/n;break;case a:m=y/t;break;case i:m=y/e;break;default:m=y}return p?m:T.a(m)},_.daysInMonth=function(){return this.endOf(l).$D},_.$locale=function(){return b[this.$L]},_.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=C(e,t,!0);return r&&(n.$L=r),n},_.clone=function(){return T.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},g}(),D=E.prototype;return w.prototype=D,[[`$ms`,r],[`$s`,i],[`$m`,a],[`$H`,o],[`$W`,s],[`$M`,l],[`$y`,d],[`$D`,f]].forEach((function(e){D[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),w.extend=function(e,t){return e.$i||=(e(t,E,w),!0),w},w.locale=C,w.isDayjs=S,w.unix=function(e){return w(1e3*e)},w.en=b[y],w.Ls=b,w.p={},w}))})),i=e(r(),1),a={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},o={trace:n((...e)=>{},`trace`),debug:n((...e)=>{},`debug`),info:n((...e)=>{},`info`),warn:n((...e)=>{},`warn`),error:n((...e)=>{},`error`),fatal:n((...e)=>{},`fatal`)},s=n(function(e=`fatal`){let t=a.fatal;typeof e==`string`?e.toLowerCase()in a&&(t=a[e]):typeof e==`number`&&(t=e),o.trace=()=>{},o.debug=()=>{},o.info=()=>{},o.warn=()=>{},o.error=()=>{},o.fatal=()=>{},t<=a.fatal&&(o.fatal=console.error?console.error.bind(console,c(`FATAL`),`color: orange`):console.log.bind(console,`\x1B[35m`,c(`FATAL`))),t<=a.error&&(o.error=console.error?console.error.bind(console,c(`ERROR`),`color: orange`):console.log.bind(console,`\x1B[31m`,c(`ERROR`))),t<=a.warn&&(o.warn=console.warn?console.warn.bind(console,c(`WARN`),`color: orange`):console.log.bind(console,`\x1B[33m`,c(`WARN`))),t<=a.info&&(o.info=console.info?console.info.bind(console,c(`INFO`),`color: lightblue`):console.log.bind(console,`\x1B[34m`,c(`INFO`))),t<=a.debug&&(o.debug=console.debug?console.debug.bind(console,c(`DEBUG`),`color: lightgreen`):console.log.bind(console,`\x1B[32m`,c(`DEBUG`))),t<=a.trace&&(o.trace=console.debug?console.debug.bind(console,c(`TRACE`),`color: lightgreen`):console.log.bind(console,`\x1B[32m`,c(`TRACE`)))},`setLogLevel`),c=n(e=>`%c${(0,i.default)().format(`ss.SSS`)} : ${e} : `,`format`),{abs:l,max:u,min:d}=Math;[`w`,`e`].map(f),[`n`,`s`].map(f),[`n`,`w`,`e`,`s`,`nw`,`ne`,`sw`,`se`].map(f);function f(e){return{type:e}}export{s as n,r,o as t};
1
+ import{o as e,t}from"./chunk-CYidjpOJ.js";import{n}from"./chunk-Y2CYZVJY-Dp_m2dHs.js";import"./src-D9TuoXKa.js";var r=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=r()})(e,(function(){var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`year`,f=`date`,p=`Invalid Date`,m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),a=n-i<0,o=t.clone().add(r+(a?-1:1),l);return+(-(r+(n-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:c,d:s,D:f,h:o,m:a,s:i,ms:r,Q:u}[e]||String(e||``).toLowerCase().replace(/s$/,``)},u:function(e){return e===void 0}},y=`en`,b={};b[y]=g;var x=`$isDayjsObject`,S=function(e){return e instanceof E||!(!e||!e[x])},C=function e(t,n,r){var i;if(!t)return y;if(typeof t==`string`){var a=t.toLowerCase();b[a]&&(i=a),n&&(b[a]=n,i=a);var o=t.split(`-`);if(!i&&o.length>1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},w=function(e,t){if(S(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new E(n)},T=v;T.l=C,T.i=S,T.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return w(e)<this.startOf(t)},_.isBefore=function(e,t){return this.endOf(t)<w(e)},_.$g=function(e,t,n){return T.u(e)?this[t]:this.set(n,e)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(e,t){var n=this,r=!!T.u(t)||t,u=T.p(e),p=function(e,t){var i=T.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(s)},m=function(e,t){return T.w(n.toDate()[e].apply(n.toDate(`s`),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},h=this.$W,g=this.$M,_=this.$D,v=`set`+(this.$u?`UTC`:``);switch(u){case d:return r?p(1,0):p(31,11);case l:return r?p(1,g):p(0,g+1);case c:var y=this.$locale().weekStart||0,b=(h<y?h+7:h)-y;return p(r?_-b:_+(6-b),g);case s:case f:return m(v+`Hours`,0);case o:return m(v+`Minutes`,1);case a:return m(v+`Seconds`,2);case i:return m(v+`Milliseconds`,3);default:return this.clone()}},_.endOf=function(e){return this.startOf(e,!1)},_.$set=function(e,t){var n,c=T.p(e),u=`set`+(this.$u?`UTC`:``),p=(n={},n[s]=u+`Date`,n[f]=u+`Date`,n[l]=u+`Month`,n[d]=u+`FullYear`,n[o]=u+`Hours`,n[a]=u+`Minutes`,n[i]=u+`Seconds`,n[r]=u+`Milliseconds`,n)[c],m=c===s?this.$D+(t-this.$W):t;if(c===l||c===d){var h=this.clone().set(f,1);h.$d[p](m),h.init(),this.$d=h.set(f,Math.min(this.$D,h.daysInMonth())).$d}else p&&this.$d[p](m);return this.init(),this},_.set=function(e,t){return this.clone().$set(e,t)},_.get=function(e){return this[T.p(e)]()},_.add=function(r,u){var f,p=this;r=Number(r);var m=T.p(u),h=function(e){var t=w(p);return T.w(t.date(t.date()+Math.round(e*r)),p)};if(m===l)return this.set(l,this.$M+r);if(m===d)return this.set(d,this.$y+r);if(m===s)return h(1);if(m===c)return h(7);var g=(f={},f[a]=t,f[o]=n,f[i]=e,f)[m]||1,_=this.$d.getTime()+r*g;return T.w(_,this)},_.subtract=function(e,t){return this.add(-1*e,t)},_.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var r=e||`YYYY-MM-DDTHH:mm:ssZ`,i=T.z(this),a=this.$H,o=this.$m,s=this.$M,c=n.weekdays,l=n.months,u=n.meridiem,d=function(e,n,i,a){return e&&(e[n]||e(t,r))||i[n].slice(0,a)},f=function(e){return T.s(a%12||12,e,`0`)},m=u||function(e,t,n){var r=e<12?`AM`:`PM`;return n?r.toLowerCase():r};return r.replace(h,(function(e,r){return r||function(e){switch(e){case`YY`:return String(t.$y).slice(-2);case`YYYY`:return T.s(t.$y,4,`0`);case`M`:return s+1;case`MM`:return T.s(s+1,2,`0`);case`MMM`:return d(n.monthsShort,s,l,3);case`MMMM`:return d(l,s);case`D`:return t.$D;case`DD`:return T.s(t.$D,2,`0`);case`d`:return String(t.$W);case`dd`:return d(n.weekdaysMin,t.$W,c,2);case`ddd`:return d(n.weekdaysShort,t.$W,c,3);case`dddd`:return c[t.$W];case`H`:return String(a);case`HH`:return T.s(a,2,`0`);case`h`:return f(1);case`hh`:return f(2);case`a`:return m(a,o,!0);case`A`:return m(a,o,!1);case`m`:return String(o);case`mm`:return T.s(o,2,`0`);case`s`:return String(t.$s);case`ss`:return T.s(t.$s,2,`0`);case`SSS`:return T.s(t.$ms,3,`0`);case`Z`:return i}return null}(e)||i.replace(`:`,``)}))},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(r,f,p){var m,h=this,g=T.p(f),_=w(r),v=(_.utcOffset()-this.utcOffset())*t,y=this-_,b=function(){return T.m(h,_)};switch(g){case d:m=b()/12;break;case l:m=b();break;case u:m=b()/3;break;case c:m=(y-v)/6048e5;break;case s:m=(y-v)/864e5;break;case o:m=y/n;break;case a:m=y/t;break;case i:m=y/e;break;default:m=y}return p?m:T.a(m)},_.daysInMonth=function(){return this.endOf(l).$D},_.$locale=function(){return b[this.$L]},_.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=C(e,t,!0);return r&&(n.$L=r),n},_.clone=function(){return T.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},g}(),D=E.prototype;return w.prototype=D,[[`$ms`,r],[`$s`,i],[`$m`,a],[`$H`,o],[`$W`,s],[`$M`,l],[`$y`,d],[`$D`,f]].forEach((function(e){D[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),w.extend=function(e,t){return e.$i||=(e(t,E,w),!0),w},w.locale=C,w.isDayjs=S,w.unix=function(e){return w(1e3*e)},w.en=b[y],w.Ls=b,w.p={},w}))})),i=e(r(),1),a={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},o={trace:n((...e)=>{},`trace`),debug:n((...e)=>{},`debug`),info:n((...e)=>{},`info`),warn:n((...e)=>{},`warn`),error:n((...e)=>{},`error`),fatal:n((...e)=>{},`fatal`)},s=n(function(e=`fatal`){let t=a.fatal;typeof e==`string`?e.toLowerCase()in a&&(t=a[e]):typeof e==`number`&&(t=e),o.trace=()=>{},o.debug=()=>{},o.info=()=>{},o.warn=()=>{},o.error=()=>{},o.fatal=()=>{},t<=a.fatal&&(o.fatal=console.error?console.error.bind(console,c(`FATAL`),`color: orange`):console.log.bind(console,`\x1B[35m`,c(`FATAL`))),t<=a.error&&(o.error=console.error?console.error.bind(console,c(`ERROR`),`color: orange`):console.log.bind(console,`\x1B[31m`,c(`ERROR`))),t<=a.warn&&(o.warn=console.warn?console.warn.bind(console,c(`WARN`),`color: orange`):console.log.bind(console,`\x1B[33m`,c(`WARN`))),t<=a.info&&(o.info=console.info?console.info.bind(console,c(`INFO`),`color: lightblue`):console.log.bind(console,`\x1B[34m`,c(`INFO`))),t<=a.debug&&(o.debug=console.debug?console.debug.bind(console,c(`DEBUG`),`color: lightgreen`):console.log.bind(console,`\x1B[32m`,c(`DEBUG`))),t<=a.trace&&(o.trace=console.debug?console.debug.bind(console,c(`TRACE`),`color: lightgreen`):console.log.bind(console,`\x1B[32m`,c(`TRACE`)))},`setLogLevel`),c=n(e=>`%c${(0,i.default)().format(`ss.SSS`)} : ${e} : `,`format`),{abs:l,max:u,min:d}=Math;[`w`,`e`].map(f),[`n`,`s`].map(f),[`n`,`w`,`e`,`s`,`nw`,`ne`,`sw`,`se`].map(f);function f(e){return{type:e}}export{s as n,r,o as t};
@@ -1,2 +1,2 @@
1
- import{z as e}from"./CodeMirrorPropInput-DTaNg1-M.js";import{$ as t,B as n,C as r,N as i,S as a,V as o,et as s,f as c,v as l,y as u,z as d}from"./config-provider-CswKxDa9.js";import{$ as f,Dt as p,J as m,Mt as h,Q as g,St as _,X as v,kt as y}from"./dist-BNDNcytQ.js";var b=class e{constructor(e,t){this.yanchor=e,this.yhead=t}toJSON(){return{yanchor:i(this.yanchor),yhead:i(this.yhead)}}static fromJSON(t){return new e(a(t.yanchor),a(t.yhead))}},x=class{constructor(e,t){this.ytext=e,this.awareness=t,this.undoManager=new c(e)}toYPos(e,t=0){return r(this.ytext,e,t)}fromYPos(e){let t=u(a(e),this.ytext.doc);if(t==null||t.type!==this.ytext)throw Error(`[y-codemirror] The position you want to retrieve was created by a different document`);return{pos:t.index,assoc:t.assoc}}toYRange(e){let t=e.assoc;return new b(this.toYPos(e.anchor,t),this.toYPos(e.head,t))}fromYRange(e){let t=this.fromYPos(e.yanchor),n=this.fromYPos(e.yhead);return t.pos===n.pos?p.cursor(n.pos,n.assoc):p.range(t.pos,n.pos)}},S=y.define({combine(e){return e[e.length-1]}}),C=_.define(),w=class{constructor(e){this.view=e,this.conf=e.state.facet(S),this._observer=(t,n)=>{if(n.origin!==this.conf){let n=t.delta,r=[],i=0;for(let e=0;e<n.length;e++){let t=n[e];t.insert==null?t.delete==null?i+=t.retain:(r.push({from:i,to:i+t.delete,insert:``}),i+=t.delete):r.push({from:i,to:i,insert:t.insert})}e.dispatch({changes:r,annotations:[C.of(this.conf)]})}},this._ytext=this.conf.ytext,this._ytext.observe(this._observer)}update(e){if(!e.docChanged||e.transactions.length>0&&e.transactions[0].annotation(C)===this.conf)return;let t=this.conf.ytext;t.doc.transact(()=>{let n=0;e.changes.iterChanges((e,r,i,a,o)=>{let s=o.sliceString(0,o.length,`
1
+ import{R as e}from"./CodeMirrorPropInput-B6FJjE4p.js";import{$ as t,B as n,C as r,N as i,S as a,V as o,et as s,f as c,v as l,y as u,z as d}from"./config-provider-DAkovZnw.js";import{$ as f,Dt as p,J as m,Mt as h,Q as g,St as _,X as v,kt as y}from"./dist-BNDNcytQ.js";var b=class e{constructor(e,t){this.yanchor=e,this.yhead=t}toJSON(){return{yanchor:i(this.yanchor),yhead:i(this.yhead)}}static fromJSON(t){return new e(a(t.yanchor),a(t.yhead))}},x=class{constructor(e,t){this.ytext=e,this.awareness=t,this.undoManager=new c(e)}toYPos(e,t=0){return r(this.ytext,e,t)}fromYPos(e){let t=u(a(e),this.ytext.doc);if(t==null||t.type!==this.ytext)throw Error(`[y-codemirror] The position you want to retrieve was created by a different document`);return{pos:t.index,assoc:t.assoc}}toYRange(e){let t=e.assoc;return new b(this.toYPos(e.anchor,t),this.toYPos(e.head,t))}fromYRange(e){let t=this.fromYPos(e.yanchor),n=this.fromYPos(e.yhead);return t.pos===n.pos?p.cursor(n.pos,n.assoc):p.range(t.pos,n.pos)}},S=y.define({combine(e){return e[e.length-1]}}),C=_.define(),w=class{constructor(e){this.view=e,this.conf=e.state.facet(S),this._observer=(t,n)=>{if(n.origin!==this.conf){let n=t.delta,r=[],i=0;for(let e=0;e<n.length;e++){let t=n[e];t.insert==null?t.delete==null?i+=t.retain:(r.push({from:i,to:i+t.delete,insert:``}),i+=t.delete):r.push({from:i,to:i,insert:t.insert})}e.dispatch({changes:r,annotations:[C.of(this.conf)]})}},this._ytext=this.conf.ytext,this._ytext.observe(this._observer)}update(e){if(!e.docChanged||e.transactions.length>0&&e.transactions[0].annotation(C)===this.conf)return;let t=this.conf.ytext;t.doc.transact(()=>{let n=0;e.changes.iterChanges((e,r,i,a,o)=>{let s=o.sliceString(0,o.length,`
2
2
  `);e!==r&&t.delete(e+n,r-e),s.length>0&&t.insert(e+n,s),n+=s.length-(r-e)})},this.conf)}destroy(){this._ytext.unobserve(this._observer)}},T=g.fromClass(w),E=v.baseTheme({".cm-ySelection":{},".cm-yLineSelection":{padding:0,margin:`0px 2px 0px 4px`},".cm-ySelectionCaret":{position:`relative`,borderLeft:`1px solid black`,borderRight:`1px solid black`,marginLeft:`-1px`,marginRight:`-1px`,boxSizing:`border-box`,display:`inline`},".cm-ySelectionCaretDot":{borderRadius:`50%`,position:`absolute`,width:`.4em`,height:`.4em`,top:`-.2em`,left:`-.2em`,backgroundColor:`inherit`,transition:`transform .3s ease-in-out`,boxSizing:`border-box`},".cm-ySelectionCaret:hover > .cm-ySelectionCaretDot":{transformOrigin:`bottom center`,transform:`scale(0)`},".cm-ySelectionInfo":{position:`absolute`,top:`-1.05em`,left:`-1px`,fontSize:`.75em`,fontFamily:`serif`,fontStyle:`normal`,fontWeight:`normal`,lineHeight:`normal`,userSelect:`none`,color:`white`,paddingLeft:`2px`,paddingRight:`2px`,zIndex:101,transition:`opacity .3s ease-in-out`,backgroundColor:`inherit`,opacity:0,transitionDelay:`0s`,whiteSpace:`nowrap`},".cm-ySelectionCaret:hover > .cm-ySelectionInfo":{opacity:1,transitionDelay:`0s`}}),D=_.define(),O=class extends f{constructor(e,t){super(),this.color=e,this.name=t}toDOM(){return d(`span`,[o(`class`,`cm-ySelectionCaret`),o(`style`,`background-color: ${this.color}; border-color: ${this.color}`)],[n(`⁠`),d(`div`,[o(`class`,`cm-ySelectionCaretDot`)]),n(`⁠`),d(`div`,[o(`class`,`cm-ySelectionInfo`)],[n(this.name)]),n(`⁠`)])}eq(e){return e.color===this.color}compare(e){return e.color===this.color}updateDOM(){return!1}get estimatedHeight(){return-1}ignoreEvent(){return!0}},k=class{constructor(e){this.conf=e.state.facet(S),this._listener=({added:t,updated:n,removed:r},i,a)=>{t.concat(n).concat(r).findIndex(e=>e!==this.conf.awareness.doc.clientID)>=0&&e.dispatch({annotations:[D.of([])]})},this._awareness=this.conf.awareness,this._awareness.on(`change`,this._listener),this.decorations=h.of([])}destroy(){this._awareness.off(`change`,this._listener)}update(e){let n=this.conf.ytext,i=n.doc,o=this.conf.awareness,c=[],d=this.conf.awareness.getLocalState();if(d!=null){let t=e.view.hasFocus&&e.view.dom.ownerDocument.hasFocus(),i=t?e.state.selection.main:null,s=d.cursor==null?null:a(d.cursor.anchor),c=d.cursor==null?null:a(d.cursor.head);if(i!=null){let e=r(n,i.anchor),t=r(n,i.head);(d.cursor==null||!l(s,e)||!l(c,t))&&o.setLocalStateField(`cursor`,{anchor:e,head:t})}else d.cursor!=null&&t&&o.setLocalStateField(`cursor`,null)}o.getStates().forEach((r,a)=>{if(a===o.doc.clientID)return;let l=r.cursor;if(l==null||l.anchor==null||l.head==null)return;let d=u(l.anchor,i),f=u(l.head,i);if(d==null||f==null||d.type!==n||f.type!==n)return;let{color:p=`#30bced`,name:h=`Anonymous`}=r.user||{},g=r.user&&r.user.colorLight||p+`33`,_=s(d.index,f.index),v=t(d.index,f.index),y=e.view.state.doc.lineAt(_),b=e.view.state.doc.lineAt(v);if(y.number===b.number)c.push({from:_,to:v,value:m.mark({attributes:{style:`background-color: ${g}`},class:`cm-ySelection`})});else{c.push({from:_,to:y.from+y.length,value:m.mark({attributes:{style:`background-color: ${g}`},class:`cm-ySelection`})}),c.push({from:b.from,to:v,value:m.mark({attributes:{style:`background-color: ${g}`},class:`cm-ySelection`})});for(let t=y.number+1;t<b.number;t++){let n=e.view.state.doc.line(t).from;c.push({from:n,to:n,value:m.line({attributes:{style:`background-color: ${g}`,class:`cm-yLineSelection`}})})}}c.push({from:f.index,to:f.index,value:m.widget({side:f.index-d.index>0?-1:1,block:!1,widget:new O(p,h)})})}),this.decorations=m.set(c,!0)}},A=g.fromClass(k,{decorations:e=>e.decorations}),j=class{constructor(e){this.undoManager=e}addTrackedOrigin(e){this.undoManager.addTrackedOrigin(e)}removeTrackedOrigin(e){this.undoManager.removeTrackedOrigin(e)}undo(){return this.undoManager.undo()!=null}redo(){return this.undoManager.redo()!=null}},M=y.define({combine(e){return e[e.length-1]}});_.define();var N=class{constructor(t){this.view=t,this.conf=t.state.facet(M),this._undoManager=this.conf.undoManager,this.syncConf=t.state.facet(S),this._beforeChangeSelection=null,this._mux=e(),this._onStackItemAdded=({stackItem:e,changedParentTypes:t})=>{t.has(this.syncConf.ytext)&&this._beforeChangeSelection&&!e.meta.has(this)&&e.meta.set(this,this._beforeChangeSelection)},this._onStackItemPopped=({stackItem:e})=>{let n=e.meta.get(this);if(n){let e=this.syncConf.fromYRange(n);t.dispatch(t.state.update({selection:e,effects:[v.scrollIntoView(e)]})),this._storeSelection()}},this._storeSelection=()=>{this._beforeChangeSelection=this.syncConf.toYRange(this.view.state.selection.main)},this._undoManager.on(`stack-item-added`,this._onStackItemAdded),this._undoManager.on(`stack-item-popped`,this._onStackItemPopped),this._undoManager.addTrackedOrigin(this.syncConf)}update(e){e.selectionSet&&(e.transactions.length===0||e.transactions[0].annotation(C)!==this.syncConf)&&this._storeSelection()}destroy(){this._undoManager.off(`stack-item-added`,this._onStackItemAdded),this._undoManager.off(`stack-item-popped`,this._onStackItemPopped),this._undoManager.removeTrackedOrigin(this.syncConf)}},P=g.fromClass(N),F=({state:e,dispatch:t})=>e.facet(M).undo()||!0,I=({state:e,dispatch:t})=>e.facet(M).redo()||!0,L=[{key:`Mod-z`,run:F,preventDefault:!0},{key:`Mod-y`,mac:`Mod-Shift-z`,run:I,preventDefault:!0},{key:`Mod-Shift-z`,run:I,preventDefault:!0}],R=(e,t,{undoManager:n=new c(e)}={})=>{let r=new x(e,t),i=[S.of(r),T];return t&&i.push(E,A),n!==!1&&i.push(M.of(new j(n)),P,v.domEventHandlers({beforeinput(e,t){return e.inputType===`historyUndo`?F(t):e.inputType===`historyRedo`?I(t):!1}})),i};export{L as n,R as t};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-Y2CYZVJY-BavonG01.js";import{t}from"./src-DFZupjZD.js";import{O as n,c as r,s as i,x as a}from"./chunk-WYO6CB5R-wjTAft84.js";import{C as o}from"./src-CIOeKeVw.js";import{et as s,g as c}from"./chunk-ICXQ74PX-cYUXxotj.js";import{t as l}from"./line-4tSH7O72.js";import"./chunk-HOUHSVGY-CrcWOmF4.js";import"./chunk-Q4XR5HBZ-CG_19xFl.js";import"./chunk-7BUUIJ7U-nkQ2KUUq.js";import"./chunk-OGEWGWER-DJJJDryE.js";import{t as u}from"./graphlib-2mbBufU8.js";import{t as d}from"./dagre-DqpVUR-3.js";import"./chunk-32BRIVSS-Ck3g8u7E.js";import"./chunk-XXDRQBXY-BW_2kVvu.js";import"./chunk-VR4S4FIN-Bv419WM_.js";import"./chunk-C7G6YPKG-C40XIv2l.js";import"./chunk-ZGVPDNZ5-Cf5jCsqQ.js";import"./chunk-52WLFC77-DVv6iplK.js";import"./chunk-FWX5IMBZ-0vkTsm8B.js";import{i as f,n as p,t as m}from"./chunk-EX3LRPZG-Cv2nD836.js";var h=e(e=>e.append(`circle`).attr(`class`,`start-state`).attr(`r`,a().state.sizeUnit).attr(`cx`,a().state.padding+a().state.sizeUnit).attr(`cy`,a().state.padding+a().state.sizeUnit),`drawStartState`),g=e(e=>e.append(`line`).style(`stroke`,`grey`).style(`stroke-dasharray`,`3`).attr(`x1`,a().state.textHeight).attr(`class`,`divider`).attr(`x2`,a().state.textHeight*2).attr(`y1`,0).attr(`y2`,0),`drawDivider`),_=e((e,t)=>{let n=e.append(`text`).attr(`x`,2*a().state.padding).attr(`y`,a().state.textHeight+2*a().state.padding).attr(`font-size`,a().state.fontSize).attr(`class`,`state-title`).text(t.id),r=n.node().getBBox();return e.insert(`rect`,`:first-child`).attr(`x`,a().state.padding).attr(`y`,a().state.padding).attr(`width`,r.width+2*a().state.padding).attr(`height`,r.height+2*a().state.padding).attr(`rx`,a().state.radius),n},`drawSimpleState`),v=e((t,n)=>{let r=e(function(e,t,n){let r=e.append(`tspan`).attr(`x`,2*a().state.padding).text(t);n||r.attr(`dy`,a().state.textHeight)},`addTspan`),i=t.append(`text`).attr(`x`,2*a().state.padding).attr(`y`,a().state.textHeight+1.3*a().state.padding).attr(`font-size`,a().state.fontSize).attr(`class`,`state-title`).text(n.descriptions[0]).node().getBBox(),o=i.height,s=t.append(`text`).attr(`x`,a().state.padding).attr(`y`,o+a().state.padding*.4+a().state.dividerMargin+a().state.textHeight).attr(`class`,`state-description`),c=!0,l=!0;n.descriptions.forEach(function(e){c||(r(s,e,l),l=!1),c=!1});let u=t.append(`line`).attr(`x1`,a().state.padding).attr(`y1`,a().state.padding+o+a().state.dividerMargin/2).attr(`y2`,a().state.padding+o+a().state.dividerMargin/2).attr(`class`,`descr-divider`),d=s.node().getBBox(),f=Math.max(d.width,i.width);return u.attr(`x2`,f+3*a().state.padding),t.insert(`rect`,`:first-child`).attr(`x`,a().state.padding).attr(`y`,a().state.padding).attr(`width`,f+2*a().state.padding).attr(`height`,d.height+o+2*a().state.padding).attr(`rx`,a().state.radius),t},`drawDescrState`),y=e((e,t,n)=>{let r=a().state.padding,i=2*a().state.padding,o=e.node().getBBox(),s=o.width,c=o.x,l=e.append(`text`).attr(`x`,0).attr(`y`,a().state.titleShift).attr(`font-size`,a().state.fontSize).attr(`class`,`state-title`).text(t.id),u=l.node().getBBox().width+i,d=Math.max(u,s);d===s&&(d+=i);let f,p=e.node().getBBox();t.doc,f=c-r,u>s&&(f=(s-d)/2+r),Math.abs(c-p.x)<r&&u>s&&(f=c-(u-s)/2);let m=1-a().state.textHeight;return e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,m).attr(`class`,n?`alt-composit`:`composit`).attr(`width`,d).attr(`height`,p.height+a().state.textHeight+a().state.titleShift+1).attr(`rx`,`0`),l.attr(`x`,f+r),u<=s&&l.attr(`x`,c+(d-i)/2-u/2+r),e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,a().state.titleShift-a().state.textHeight-a().state.padding).attr(`width`,d).attr(`height`,a().state.textHeight*3).attr(`rx`,a().state.radius),e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,a().state.titleShift-a().state.textHeight-a().state.padding).attr(`width`,d).attr(`height`,p.height+3+2*a().state.textHeight).attr(`rx`,a().state.radius),e},`addTitleAndBox`),b=e(e=>(e.append(`circle`).attr(`class`,`end-state-outer`).attr(`r`,a().state.sizeUnit+a().state.miniPadding).attr(`cx`,a().state.padding+a().state.sizeUnit+a().state.miniPadding).attr(`cy`,a().state.padding+a().state.sizeUnit+a().state.miniPadding),e.append(`circle`).attr(`class`,`end-state-inner`).attr(`r`,a().state.sizeUnit).attr(`cx`,a().state.padding+a().state.sizeUnit+2).attr(`cy`,a().state.padding+a().state.sizeUnit+2)),`drawEndState`),x=e((e,t)=>{let n=a().state.forkWidth,r=a().state.forkHeight;if(t.parentId){let e=n;n=r,r=e}return e.append(`rect`).style(`stroke`,`black`).style(`fill`,`black`).attr(`width`,n).attr(`height`,r).attr(`x`,a().state.padding).attr(`y`,a().state.padding)},`drawForkJoinState`),S=e((e,t,n,r)=>{let o=0,s=r.append(`text`);s.style(`text-anchor`,`start`),s.attr(`class`,`noteText`);let c=e.replace(/\r\n/g,`<br/>`);c=c.replace(/\n/g,`<br/>`);let l=c.split(i.lineBreakRegex),u=1.25*a().state.noteMargin;for(let e of l){let r=e.trim();if(r.length>0){let e=s.append(`tspan`);if(e.text(r),u===0){let t=e.node().getBBox();u+=t.height}o+=u,e.attr(`x`,t+a().state.noteMargin),e.attr(`y`,n+o+1.25*a().state.noteMargin)}}return{textWidth:s.node().getBBox().width,textHeight:o}},`_drawLongText`),C=e((e,t)=>{t.attr(`class`,`state-note`);let n=t.append(`rect`).attr(`x`,0).attr(`y`,a().state.padding),{textWidth:r,textHeight:i}=S(e,0,0,t.append(`g`));return n.attr(`height`,i+2*a().state.noteMargin),n.attr(`width`,r+a().state.noteMargin*2),n},`drawNote`),w=e(function(e,t){let n=t.id,r={id:n,label:t.id,width:0,height:0},i=e.append(`g`).attr(`id`,n).attr(`class`,`stateGroup`);t.type===`start`&&h(i),t.type===`end`&&b(i),(t.type===`fork`||t.type===`join`)&&x(i,t),t.type===`note`&&C(t.note.text,i),t.type===`divider`&&g(i),t.type===`default`&&t.descriptions.length===0&&_(i,t),t.type===`default`&&t.descriptions.length>0&&v(i,t);let o=i.node().getBBox();return r.width=o.width+2*a().state.padding,r.height=o.height+2*a().state.padding,r},`drawState`),T=0,E=e(function(r,o,u){let d=e(function(e){switch(e){case m.relationType.AGGREGATION:return`aggregation`;case m.relationType.EXTENSION:return`extension`;case m.relationType.COMPOSITION:return`composition`;case m.relationType.DEPENDENCY:return`dependency`}},`getRelationType`);o.points=o.points.filter(e=>!Number.isNaN(e.y));let f=o.points,p=l().x(function(e){return e.x}).y(function(e){return e.y}).curve(s),h=r.append(`path`).attr(`d`,p(f)).attr(`id`,`edge`+T).attr(`class`,`transition`),g=``;if(a().state.arrowMarkerAbsolute&&(g=n(!0)),h.attr(`marker-end`,`url(`+g+`#`+d(m.relationType.DEPENDENCY)+`End)`),u.title!==void 0){let e=r.append(`g`).attr(`class`,`stateLabel`),{x:n,y:s}=c.calcLabelPosition(o.points),l=i.getRows(u.title),d=0,f=[],p=0,m=0;for(let r=0;r<=l.length;r++){let i=e.append(`text`).attr(`text-anchor`,`middle`).text(l[r]).attr(`x`,n).attr(`y`,s+d),a=i.node().getBBox();p=Math.max(p,a.width),m=Math.min(m,a.x),t.info(a.x,n,s+d),d===0&&(d=i.node().getBBox().height,t.info(`Title height`,d,s)),f.push(i)}let h=d*l.length;if(l.length>1){let e=(l.length-1)*d*.5;f.forEach((t,n)=>t.attr(`y`,s+n*d-e)),h=d*l.length}let g=e.node().getBBox();e.insert(`rect`,`:first-child`).attr(`class`,`box`).attr(`x`,n-p/2-a().state.padding/2).attr(`y`,s-h/2-a().state.padding/2-3.5).attr(`width`,p+a().state.padding).attr(`height`,h+a().state.padding),t.info(g)}T++},`drawEdge`),D,O={},k=e(function(){},`setConf`),A=e(function(e){e.append(`defs`).append(`marker`).attr(`id`,`dependencyEnd`).attr(`refX`,19).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 19,7 L9,13 L14,7 L9,1 Z`)},`insertMarkers`),j=e(function(e,n,i,s){D=a().state;let c=a().securityLevel,l;c===`sandbox`&&(l=o(`#i`+n));let u=o(c===`sandbox`?l.nodes()[0].contentDocument.body:`body`),d=c===`sandbox`?l.nodes()[0].contentDocument:document;t.debug(`Rendering diagram `+e);let f=u.select(`[id='${n}']`);A(f),N(s.db.getRootDoc(),f.append(`g`).attr(`id`,n+`-root`),void 0,!1,u,d,s);let p=D.padding,m=f.node().getBBox(),h=m.width+p*2,g=m.height+p*2;r(f,g,h*1.75,D.useMaxWidth),f.attr(`viewBox`,`${m.x-D.padding} ${m.y-D.padding} `+h+` `+g)},`draw`),M=e(e=>e?e.length*D.fontSizeFactor:1,`getLabelWidth`),N=e((e,n,r,a,o,s,c)=>{let l=new u({compound:!0,multigraph:!0}),f,p=!0;for(f=0;f<e.length;f++)if(e[f].stmt===`relation`){p=!1;break}r?l.setGraph({rankdir:`LR`,multigraph:!0,compound:!0,ranker:`tight-tree`,ranksep:p?1:D.edgeLengthFactor,nodeSep:p?1:50,isMultiGraph:!0}):l.setGraph({rankdir:`TB`,multigraph:!0,compound:!0,ranksep:p?1:D.edgeLengthFactor,nodeSep:p?1:50,ranker:`tight-tree`,isMultiGraph:!0}),l.setDefaultEdgeLabel(function(){return{}});let m=c.db.getStates(),h=c.db.getRelations(),g=Object.keys(m);for(let e of g){let t=m[e];r&&(t.parentId=r);let i;if(t.doc){let e=n.append(`g`).attr(`id`,t.id).attr(`class`,`stateGroup`);i=N(t.doc,e,t.id,!a,o,s,c);{e=y(e,t,a);let n=e.node().getBBox();i.width=n.width,i.height=n.height+D.padding/2,O[t.id]={y:D.compositTitleSize}}}else i=w(n,t,l);if(t.note){let e=w(n,{descriptions:[],id:t.id+`-note`,note:t.note,type:`note`},l);t.note.position===`left of`?(l.setNode(i.id+`-note`,e),l.setNode(i.id,i)):(l.setNode(i.id,i),l.setNode(i.id+`-note`,e)),l.setParent(i.id,i.id+`-group`),l.setParent(i.id+`-note`,i.id+`-group`)}else l.setNode(i.id,i)}t.debug(`Count=`,l.nodeCount(),l);let _=0;h.forEach(function(e){_++,t.debug(`Setting edge`,e),l.setEdge(e.id1,e.id2,{relation:e,width:M(e.title),height:D.labelHeight*i.getRows(e.title).length,labelpos:`c`},`id`+_)}),d(l),t.debug(`Graph after layout`,l.nodes());let v=n.node();l.nodes().forEach(function(e){e!==void 0&&l.node(e)!==void 0?(t.warn(`Node `+e+`: `+JSON.stringify(l.node(e))),o.select(`#`+v.id+` #`+e).attr(`transform`,`translate(`+(l.node(e).x-l.node(e).width/2)+`,`+(l.node(e).y+(O[e]?O[e].y:0)-l.node(e).height/2)+` )`),o.select(`#`+v.id+` #`+e).attr(`data-x-shift`,l.node(e).x-l.node(e).width/2),s.querySelectorAll(`#`+v.id+` #`+e+` .divider`).forEach(e=>{let t=e.parentElement,n=0,r=0;t&&(t.parentElement&&(n=t.parentElement.getBBox().width),r=parseInt(t.getAttribute(`data-x-shift`),10),Number.isNaN(r)&&(r=0)),e.setAttribute(`x1`,0-r+8),e.setAttribute(`x2`,n-r-8)})):t.debug(`No Node `+e+`: `+JSON.stringify(l.node(e)))});let b=v.getBBox();l.edges().forEach(function(e){e!==void 0&&l.edge(e)!==void 0&&(t.debug(`Edge `+e.v+` -> `+e.w+`: `+JSON.stringify(l.edge(e))),E(n,l.edge(e),l.edge(e).relation))}),b=v.getBBox();let x={id:r||`root`,label:r||`root`,width:0,height:0};return x.width=b.width+2*D.padding,x.height=b.height+2*D.padding,t.debug(`Doc rendered`,x,l),x},`renderDoc`),P={parser:p,get db(){return new m(1)},renderer:{setConf:k,draw:j},styles:f,init:e(e=>{e.state||={},e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{P as diagram};
1
+ import{n as e}from"./chunk-Y2CYZVJY-Dp_m2dHs.js";import{t}from"./src-CprZUkQE.js";import{O as n,c as r,s as i,x as a}from"./chunk-WYO6CB5R-CALegXxo.js";import{C as o}from"./src-D9TuoXKa.js";import{et as s,g as c}from"./chunk-ICXQ74PX-MYNcPnbp.js";import{t as l}from"./line-CBrFSVI1.js";import"./chunk-HOUHSVGY-BWwdD6sU.js";import"./chunk-Q4XR5HBZ-C1-YIhba.js";import"./chunk-7BUUIJ7U-B8p2bGIc.js";import"./chunk-OGEWGWER-CPRvTjbs.js";import{t as u}from"./graphlib-BIjbwrWA.js";import{t as d}from"./dagre-Bx2kZZfx.js";import"./chunk-32BRIVSS-BYVl5jAx.js";import"./chunk-XXDRQBXY-AFNsmOQr.js";import"./chunk-VR4S4FIN-DZW_5hST.js";import"./chunk-C7G6YPKG-P_jPwciU.js";import"./chunk-ZGVPDNZ5-gA_FvYeM.js";import"./chunk-52WLFC77-DaoBlZDo.js";import"./chunk-FWX5IMBZ-FFK1ngmB.js";import{i as f,n as p,t as m}from"./chunk-EX3LRPZG-ClnlXkCf.js";var h=e(e=>e.append(`circle`).attr(`class`,`start-state`).attr(`r`,a().state.sizeUnit).attr(`cx`,a().state.padding+a().state.sizeUnit).attr(`cy`,a().state.padding+a().state.sizeUnit),`drawStartState`),g=e(e=>e.append(`line`).style(`stroke`,`grey`).style(`stroke-dasharray`,`3`).attr(`x1`,a().state.textHeight).attr(`class`,`divider`).attr(`x2`,a().state.textHeight*2).attr(`y1`,0).attr(`y2`,0),`drawDivider`),_=e((e,t)=>{let n=e.append(`text`).attr(`x`,2*a().state.padding).attr(`y`,a().state.textHeight+2*a().state.padding).attr(`font-size`,a().state.fontSize).attr(`class`,`state-title`).text(t.id),r=n.node().getBBox();return e.insert(`rect`,`:first-child`).attr(`x`,a().state.padding).attr(`y`,a().state.padding).attr(`width`,r.width+2*a().state.padding).attr(`height`,r.height+2*a().state.padding).attr(`rx`,a().state.radius),n},`drawSimpleState`),v=e((t,n)=>{let r=e(function(e,t,n){let r=e.append(`tspan`).attr(`x`,2*a().state.padding).text(t);n||r.attr(`dy`,a().state.textHeight)},`addTspan`),i=t.append(`text`).attr(`x`,2*a().state.padding).attr(`y`,a().state.textHeight+1.3*a().state.padding).attr(`font-size`,a().state.fontSize).attr(`class`,`state-title`).text(n.descriptions[0]).node().getBBox(),o=i.height,s=t.append(`text`).attr(`x`,a().state.padding).attr(`y`,o+a().state.padding*.4+a().state.dividerMargin+a().state.textHeight).attr(`class`,`state-description`),c=!0,l=!0;n.descriptions.forEach(function(e){c||(r(s,e,l),l=!1),c=!1});let u=t.append(`line`).attr(`x1`,a().state.padding).attr(`y1`,a().state.padding+o+a().state.dividerMargin/2).attr(`y2`,a().state.padding+o+a().state.dividerMargin/2).attr(`class`,`descr-divider`),d=s.node().getBBox(),f=Math.max(d.width,i.width);return u.attr(`x2`,f+3*a().state.padding),t.insert(`rect`,`:first-child`).attr(`x`,a().state.padding).attr(`y`,a().state.padding).attr(`width`,f+2*a().state.padding).attr(`height`,d.height+o+2*a().state.padding).attr(`rx`,a().state.radius),t},`drawDescrState`),y=e((e,t,n)=>{let r=a().state.padding,i=2*a().state.padding,o=e.node().getBBox(),s=o.width,c=o.x,l=e.append(`text`).attr(`x`,0).attr(`y`,a().state.titleShift).attr(`font-size`,a().state.fontSize).attr(`class`,`state-title`).text(t.id),u=l.node().getBBox().width+i,d=Math.max(u,s);d===s&&(d+=i);let f,p=e.node().getBBox();t.doc,f=c-r,u>s&&(f=(s-d)/2+r),Math.abs(c-p.x)<r&&u>s&&(f=c-(u-s)/2);let m=1-a().state.textHeight;return e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,m).attr(`class`,n?`alt-composit`:`composit`).attr(`width`,d).attr(`height`,p.height+a().state.textHeight+a().state.titleShift+1).attr(`rx`,`0`),l.attr(`x`,f+r),u<=s&&l.attr(`x`,c+(d-i)/2-u/2+r),e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,a().state.titleShift-a().state.textHeight-a().state.padding).attr(`width`,d).attr(`height`,a().state.textHeight*3).attr(`rx`,a().state.radius),e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,a().state.titleShift-a().state.textHeight-a().state.padding).attr(`width`,d).attr(`height`,p.height+3+2*a().state.textHeight).attr(`rx`,a().state.radius),e},`addTitleAndBox`),b=e(e=>(e.append(`circle`).attr(`class`,`end-state-outer`).attr(`r`,a().state.sizeUnit+a().state.miniPadding).attr(`cx`,a().state.padding+a().state.sizeUnit+a().state.miniPadding).attr(`cy`,a().state.padding+a().state.sizeUnit+a().state.miniPadding),e.append(`circle`).attr(`class`,`end-state-inner`).attr(`r`,a().state.sizeUnit).attr(`cx`,a().state.padding+a().state.sizeUnit+2).attr(`cy`,a().state.padding+a().state.sizeUnit+2)),`drawEndState`),x=e((e,t)=>{let n=a().state.forkWidth,r=a().state.forkHeight;if(t.parentId){let e=n;n=r,r=e}return e.append(`rect`).style(`stroke`,`black`).style(`fill`,`black`).attr(`width`,n).attr(`height`,r).attr(`x`,a().state.padding).attr(`y`,a().state.padding)},`drawForkJoinState`),S=e((e,t,n,r)=>{let o=0,s=r.append(`text`);s.style(`text-anchor`,`start`),s.attr(`class`,`noteText`);let c=e.replace(/\r\n/g,`<br/>`);c=c.replace(/\n/g,`<br/>`);let l=c.split(i.lineBreakRegex),u=1.25*a().state.noteMargin;for(let e of l){let r=e.trim();if(r.length>0){let e=s.append(`tspan`);if(e.text(r),u===0){let t=e.node().getBBox();u+=t.height}o+=u,e.attr(`x`,t+a().state.noteMargin),e.attr(`y`,n+o+1.25*a().state.noteMargin)}}return{textWidth:s.node().getBBox().width,textHeight:o}},`_drawLongText`),C=e((e,t)=>{t.attr(`class`,`state-note`);let n=t.append(`rect`).attr(`x`,0).attr(`y`,a().state.padding),{textWidth:r,textHeight:i}=S(e,0,0,t.append(`g`));return n.attr(`height`,i+2*a().state.noteMargin),n.attr(`width`,r+a().state.noteMargin*2),n},`drawNote`),w=e(function(e,t){let n=t.id,r={id:n,label:t.id,width:0,height:0},i=e.append(`g`).attr(`id`,n).attr(`class`,`stateGroup`);t.type===`start`&&h(i),t.type===`end`&&b(i),(t.type===`fork`||t.type===`join`)&&x(i,t),t.type===`note`&&C(t.note.text,i),t.type===`divider`&&g(i),t.type===`default`&&t.descriptions.length===0&&_(i,t),t.type===`default`&&t.descriptions.length>0&&v(i,t);let o=i.node().getBBox();return r.width=o.width+2*a().state.padding,r.height=o.height+2*a().state.padding,r},`drawState`),T=0,E=e(function(r,o,u){let d=e(function(e){switch(e){case m.relationType.AGGREGATION:return`aggregation`;case m.relationType.EXTENSION:return`extension`;case m.relationType.COMPOSITION:return`composition`;case m.relationType.DEPENDENCY:return`dependency`}},`getRelationType`);o.points=o.points.filter(e=>!Number.isNaN(e.y));let f=o.points,p=l().x(function(e){return e.x}).y(function(e){return e.y}).curve(s),h=r.append(`path`).attr(`d`,p(f)).attr(`id`,`edge`+T).attr(`class`,`transition`),g=``;if(a().state.arrowMarkerAbsolute&&(g=n(!0)),h.attr(`marker-end`,`url(`+g+`#`+d(m.relationType.DEPENDENCY)+`End)`),u.title!==void 0){let e=r.append(`g`).attr(`class`,`stateLabel`),{x:n,y:s}=c.calcLabelPosition(o.points),l=i.getRows(u.title),d=0,f=[],p=0,m=0;for(let r=0;r<=l.length;r++){let i=e.append(`text`).attr(`text-anchor`,`middle`).text(l[r]).attr(`x`,n).attr(`y`,s+d),a=i.node().getBBox();p=Math.max(p,a.width),m=Math.min(m,a.x),t.info(a.x,n,s+d),d===0&&(d=i.node().getBBox().height,t.info(`Title height`,d,s)),f.push(i)}let h=d*l.length;if(l.length>1){let e=(l.length-1)*d*.5;f.forEach((t,n)=>t.attr(`y`,s+n*d-e)),h=d*l.length}let g=e.node().getBBox();e.insert(`rect`,`:first-child`).attr(`class`,`box`).attr(`x`,n-p/2-a().state.padding/2).attr(`y`,s-h/2-a().state.padding/2-3.5).attr(`width`,p+a().state.padding).attr(`height`,h+a().state.padding),t.info(g)}T++},`drawEdge`),D,O={},k=e(function(){},`setConf`),A=e(function(e){e.append(`defs`).append(`marker`).attr(`id`,`dependencyEnd`).attr(`refX`,19).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 19,7 L9,13 L14,7 L9,1 Z`)},`insertMarkers`),j=e(function(e,n,i,s){D=a().state;let c=a().securityLevel,l;c===`sandbox`&&(l=o(`#i`+n));let u=o(c===`sandbox`?l.nodes()[0].contentDocument.body:`body`),d=c===`sandbox`?l.nodes()[0].contentDocument:document;t.debug(`Rendering diagram `+e);let f=u.select(`[id='${n}']`);A(f),N(s.db.getRootDoc(),f.append(`g`).attr(`id`,n+`-root`),void 0,!1,u,d,s);let p=D.padding,m=f.node().getBBox(),h=m.width+p*2,g=m.height+p*2;r(f,g,h*1.75,D.useMaxWidth),f.attr(`viewBox`,`${m.x-D.padding} ${m.y-D.padding} `+h+` `+g)},`draw`),M=e(e=>e?e.length*D.fontSizeFactor:1,`getLabelWidth`),N=e((e,n,r,a,o,s,c)=>{let l=new u({compound:!0,multigraph:!0}),f,p=!0;for(f=0;f<e.length;f++)if(e[f].stmt===`relation`){p=!1;break}r?l.setGraph({rankdir:`LR`,multigraph:!0,compound:!0,ranker:`tight-tree`,ranksep:p?1:D.edgeLengthFactor,nodeSep:p?1:50,isMultiGraph:!0}):l.setGraph({rankdir:`TB`,multigraph:!0,compound:!0,ranksep:p?1:D.edgeLengthFactor,nodeSep:p?1:50,ranker:`tight-tree`,isMultiGraph:!0}),l.setDefaultEdgeLabel(function(){return{}});let m=c.db.getStates(),h=c.db.getRelations(),g=Object.keys(m);for(let e of g){let t=m[e];r&&(t.parentId=r);let i;if(t.doc){let e=n.append(`g`).attr(`id`,t.id).attr(`class`,`stateGroup`);i=N(t.doc,e,t.id,!a,o,s,c);{e=y(e,t,a);let n=e.node().getBBox();i.width=n.width,i.height=n.height+D.padding/2,O[t.id]={y:D.compositTitleSize}}}else i=w(n,t,l);if(t.note){let e=w(n,{descriptions:[],id:t.id+`-note`,note:t.note,type:`note`},l);t.note.position===`left of`?(l.setNode(i.id+`-note`,e),l.setNode(i.id,i)):(l.setNode(i.id,i),l.setNode(i.id+`-note`,e)),l.setParent(i.id,i.id+`-group`),l.setParent(i.id+`-note`,i.id+`-group`)}else l.setNode(i.id,i)}t.debug(`Count=`,l.nodeCount(),l);let _=0;h.forEach(function(e){_++,t.debug(`Setting edge`,e),l.setEdge(e.id1,e.id2,{relation:e,width:M(e.title),height:D.labelHeight*i.getRows(e.title).length,labelpos:`c`},`id`+_)}),d(l),t.debug(`Graph after layout`,l.nodes());let v=n.node();l.nodes().forEach(function(e){e!==void 0&&l.node(e)!==void 0?(t.warn(`Node `+e+`: `+JSON.stringify(l.node(e))),o.select(`#`+v.id+` #`+e).attr(`transform`,`translate(`+(l.node(e).x-l.node(e).width/2)+`,`+(l.node(e).y+(O[e]?O[e].y:0)-l.node(e).height/2)+` )`),o.select(`#`+v.id+` #`+e).attr(`data-x-shift`,l.node(e).x-l.node(e).width/2),s.querySelectorAll(`#`+v.id+` #`+e+` .divider`).forEach(e=>{let t=e.parentElement,n=0,r=0;t&&(t.parentElement&&(n=t.parentElement.getBBox().width),r=parseInt(t.getAttribute(`data-x-shift`),10),Number.isNaN(r)&&(r=0)),e.setAttribute(`x1`,0-r+8),e.setAttribute(`x2`,n-r-8)})):t.debug(`No Node `+e+`: `+JSON.stringify(l.node(e)))});let b=v.getBBox();l.edges().forEach(function(e){e!==void 0&&l.edge(e)!==void 0&&(t.debug(`Edge `+e.v+` -> `+e.w+`: `+JSON.stringify(l.edge(e))),E(n,l.edge(e),l.edge(e).relation))}),b=v.getBBox();let x={id:r||`root`,label:r||`root`,width:0,height:0};return x.width=b.width+2*D.padding,x.height=b.height+2*D.padding,t.debug(`Doc rendered`,x,l),x},`renderDoc`),P={parser:p,get db(){return new m(1)},renderer:{setConf:k,draw:j},styles:f,init:e(e=>{e.state||={},e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{P as diagram};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-Y2CYZVJY-Dp_m2dHs.js";import"./src-CprZUkQE.js";import"./chunk-WYO6CB5R-CALegXxo.js";import"./chunk-ICXQ74PX-MYNcPnbp.js";import"./chunk-HOUHSVGY-BWwdD6sU.js";import"./chunk-Q4XR5HBZ-C1-YIhba.js";import"./chunk-7BUUIJ7U-B8p2bGIc.js";import"./chunk-OGEWGWER-CPRvTjbs.js";import"./chunk-32BRIVSS-BYVl5jAx.js";import"./chunk-XXDRQBXY-AFNsmOQr.js";import"./chunk-VR4S4FIN-DZW_5hST.js";import"./chunk-C7G6YPKG-P_jPwciU.js";import"./chunk-ZGVPDNZ5-gA_FvYeM.js";import"./chunk-52WLFC77-DaoBlZDo.js";import"./chunk-FWX5IMBZ-FFK1ngmB.js";import{i as t,n,r,t as i}from"./chunk-EX3LRPZG-ClnlXkCf.js";var a={parser:n,get db(){return new i(2)},renderer:r,styles:t,init:e(e=>{e.state||={},e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{a as diagram};