@saluzi/saluzi-edu 0.7.35 → 0.7.37

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 (200) hide show
  1. package/dist/cli.js +111 -102
  2. package/dist/rcs-schema.sql +13 -1
  3. package/dist/rcs-web/assets/{AdminPanel-BHFN9LNJ.js → AdminPanel-CCkH7iJv.js} +1 -1
  4. package/dist/rcs-web/assets/ArtifactView-v2hQNqJZ.js +1 -0
  5. package/{packages/remote-control-server/web/dist/assets/ArtifactsGallery-CLQlrMUD.js → dist/rcs-web/assets/ArtifactsGallery-BSdlASB3.js} +8 -8
  6. package/{packages/remote-control-server/web/dist/assets/Claim-OHl3vi3x.js → dist/rcs-web/assets/Claim-BK0aslcx.js} +1 -1
  7. package/dist/rcs-web/assets/Dashboard-Cr-2Grcq.js +12 -0
  8. package/dist/rcs-web/assets/Join-CSQz-8kg.js +1 -0
  9. package/dist/rcs-web/assets/Login-CIblWx47.js +1 -0
  10. package/dist/rcs-web/assets/MemoriesPage-D2Qadc7N.js +1 -0
  11. package/dist/rcs-web/assets/{MemoryTypeChips-BkrR3x2j.js → MemoryTypeChips-BFl2a9Tv.js} +2 -2
  12. package/dist/rcs-web/assets/Register-nFyACJRk.js +1 -0
  13. package/dist/rcs-web/assets/{RegisterEmpty-CQLw7nxd.js → RegisterEmpty-FxupE-t-.js} +1 -1
  14. package/dist/rcs-web/assets/SessionDetail-BpmjKpR1.js +78 -0
  15. package/dist/rcs-web/assets/SessionVisibilityBadge-D6XUIJa4.js +21 -0
  16. package/dist/rcs-web/assets/Setup-DGBcwRTD.js +1 -0
  17. package/dist/rcs-web/assets/{ShareLanding-DgCCzzY3.js → ShareLanding-CyNQfq4N.js} +1 -1
  18. package/dist/rcs-web/assets/{TeamDetail-TuVJeCR1.js → TeamDetail-4aZd9y8I.js} +3 -3
  19. package/dist/rcs-web/assets/TeamList-Cs6JQa7m.js +1 -0
  20. package/dist/rcs-web/assets/{TeamSettings-CHEQR0jb.js → TeamSettings-DX0MfIJy.js} +1 -1
  21. package/{packages/remote-control-server/web/dist/assets/UserSearchInput-C4wv1O_6.js → dist/rcs-web/assets/UserSearchInput-CyhqVZCc.js} +2 -2
  22. package/dist/rcs-web/assets/{UserSettings-BCg9Hx1x.js → UserSettings-CsFYao6k.js} +1 -1
  23. package/dist/rcs-web/assets/{arc-C-_TIerE.js → arc-BbFYStVr.js} +1 -1
  24. package/{packages/remote-control-server/web/dist/assets/architectureDiagram-3BPJPVTR-beAA8z-g.js → dist/rcs-web/assets/architectureDiagram-3BPJPVTR-BrraS5HV.js} +1 -1
  25. package/dist/rcs-web/assets/{blockDiagram-GPEHLZMM-BNR3gwO7.js → blockDiagram-GPEHLZMM-BSrrZzGd.js} +1 -1
  26. package/dist/rcs-web/assets/{c4Diagram-AAUBKEIU-B4JhY8vU.js → c4Diagram-AAUBKEIU-BwIi-MY-.js} +1 -1
  27. package/dist/rcs-web/assets/channel-D9MN_Xoy.js +1 -0
  28. package/dist/rcs-web/assets/{chunk-2J33WTMH-C-PijTjw.js → chunk-2J33WTMH-RF5WXSdc.js} +1 -1
  29. package/dist/rcs-web/assets/{chunk-4BX2VUAB-Cf9gkdhc.js → chunk-4BX2VUAB-HD-9lc81.js} +1 -1
  30. package/dist/rcs-web/assets/{chunk-55IACEB6-CU8wR03K.js → chunk-55IACEB6-DORDCTWG.js} +1 -1
  31. package/{packages/remote-control-server/web/dist/assets/chunk-727SXJPM-zxNGjQ_A.js → dist/rcs-web/assets/chunk-727SXJPM-BgEvck_h.js} +1 -1
  32. package/{packages/remote-control-server/web/dist/assets/chunk-AQP2D5EJ-GzIqC820.js → dist/rcs-web/assets/chunk-AQP2D5EJ-CYDKpO5q.js} +1 -1
  33. package/dist/rcs-web/assets/{chunk-FMBD7UC4-C0Gozh4X.js → chunk-FMBD7UC4-HTfaOp-P.js} +1 -1
  34. package/dist/rcs-web/assets/{chunk-ND2GUHAM-Vd4uKkwn.js → chunk-ND2GUHAM-C7j1dy_M.js} +1 -1
  35. package/dist/rcs-web/assets/{chunk-QZHKN3VN-CcmoHM31.js → chunk-QZHKN3VN-DrNt3GZ4.js} +1 -1
  36. package/dist/rcs-web/assets/classDiagram-4FO5ZUOK-C7FZfsl-.js +1 -0
  37. package/dist/rcs-web/assets/classDiagram-v2-Q7XG4LA2-C7FZfsl-.js +1 -0
  38. package/dist/rcs-web/assets/{code-block-IT6T5CEO-CeTiJ_5U.js → code-block-IT6T5CEO-qOs_ie5D.js} +1 -1
  39. package/dist/rcs-web/assets/{copy-CZDxZlFG.js → copy-LeFUX09K.js} +1 -1
  40. package/{packages/remote-control-server/web/dist/assets/cose-bilkent-S5V4N54A-Drz-N1FU.js → dist/rcs-web/assets/cose-bilkent-S5V4N54A-CNYjbdwx.js} +1 -1
  41. package/{packages/remote-control-server/web/dist/assets/dagre-BM42HDAG-Bii1VCPk.js → dist/rcs-web/assets/dagre-BM42HDAG-CzF1zU8o.js} +1 -1
  42. package/dist/rcs-web/assets/{diagram-2AECGRRQ-BXzs0Inz.js → diagram-2AECGRRQ-BOYW474q.js} +1 -1
  43. package/dist/rcs-web/assets/{diagram-5GNKFQAL-CytXTMI4.js → diagram-5GNKFQAL-CP-yWCBy.js} +1 -1
  44. package/{packages/remote-control-server/web/dist/assets/diagram-KO2AKTUF-R6DT6E64.js → dist/rcs-web/assets/diagram-KO2AKTUF-DdqQ4pAJ.js} +1 -1
  45. package/dist/rcs-web/assets/{diagram-LMA3HP47-B6S2xHIS.js → diagram-LMA3HP47-CE2gGIRy.js} +1 -1
  46. package/dist/rcs-web/assets/{diagram-OG6HWLK6-AHaTYJVB.js → diagram-OG6HWLK6-BNA49_sd.js} +1 -1
  47. package/dist/rcs-web/assets/dialog-DnbWz68R.js +1 -0
  48. package/dist/rcs-web/assets/{erDiagram-TEJ5UH35-D5JbEkq8.js → erDiagram-TEJ5UH35-DVflh1jg.js} +1 -1
  49. package/{packages/remote-control-server/web/dist/assets/flowDiagram-I6XJVG4X-CY0aHTCu.js → dist/rcs-web/assets/flowDiagram-I6XJVG4X-B8b91Tm9.js} +1 -1
  50. package/{packages/remote-control-server/web/dist/assets/ganttDiagram-6RSMTGT7-CSyAl3z-.js → dist/rcs-web/assets/ganttDiagram-6RSMTGT7-7fEdykwc.js} +1 -1
  51. package/{packages/remote-control-server/web/dist/assets/gitGraphDiagram-PVQCEYII-e5YIgxoR.js → dist/rcs-web/assets/gitGraphDiagram-PVQCEYII-B_17h1CU.js} +1 -1
  52. package/dist/rcs-web/assets/{infoDiagram-5YYISTIA-DVDPyLBc.js → infoDiagram-5YYISTIA-DWa7j6Zg.js} +1 -1
  53. package/dist/rcs-web/assets/{ishikawaDiagram-YF4QCWOH-0gxGyjL6.js → ishikawaDiagram-YF4QCWOH-b11b1c8I.js} +1 -1
  54. package/{packages/remote-control-server/web/dist/assets/journeyDiagram-JHISSGLW-CM83fuK_.js → dist/rcs-web/assets/journeyDiagram-JHISSGLW-CsvW9Ud9.js} +1 -1
  55. package/{packages/remote-control-server/web/dist/assets/kanban-definition-UN3LZRKU-id_FkJ5L.js → dist/rcs-web/assets/kanban-definition-UN3LZRKU-B97kXWdO.js} +1 -1
  56. package/dist/rcs-web/assets/{linear-4qBKmb1P.js → linear-CrAR73-K.js} +1 -1
  57. package/dist/rcs-web/assets/main-BOI1Ucfk.css +1 -0
  58. package/dist/rcs-web/assets/{main-BAO6US1o.js → main-CDaRKeiT.js} +30 -30
  59. package/{packages/remote-control-server/web/dist/assets/mermaid-VLURNSYL-BUDhzZZx.js → dist/rcs-web/assets/mermaid-VLURNSYL-gQdmHkjr.js} +4 -4
  60. package/dist/rcs-web/assets/{mermaid.core-n5f_df_C.js → mermaid.core-DTuGObIu.js} +5 -5
  61. package/{packages/remote-control-server/web/dist/assets/mindmap-definition-RKZ34NQL-Cn5ESsTL.js → dist/rcs-web/assets/mindmap-definition-RKZ34NQL-wGG267Yb.js} +1 -1
  62. package/dist/rcs-web/assets/{notifications-D0Ro2M4C.js → notifications-Ms9MI-nO.js} +1 -1
  63. package/dist/rcs-web/assets/{pieDiagram-4H26LBE5-CfNaOQwR.js → pieDiagram-4H26LBE5-DgayJQKV.js} +1 -1
  64. package/dist/rcs-web/assets/{quadrantDiagram-W4KKPZXB-9EH7YWIg.js → quadrantDiagram-W4KKPZXB-BOtyjbOc.js} +1 -1
  65. package/dist/rcs-web/assets/{refresh-cw-Cj9UC6vN.js → refresh-cw-Dc5tn8Z_.js} +1 -1
  66. package/dist/rcs-web/assets/{requirementDiagram-4Y6WPE33-Cw-qvChc.js → requirementDiagram-4Y6WPE33-Ck-a8POo.js} +1 -1
  67. package/dist/rcs-web/assets/{sankeyDiagram-5OEKKPKP-grgk3897.js → sankeyDiagram-5OEKKPKP-DR0OBykc.js} +1 -1
  68. package/dist/rcs-web/assets/{sequenceDiagram-3UESZ5HK-DEiAVVrz.js → sequenceDiagram-3UESZ5HK-DFOP0Bxr.js} +1 -1
  69. package/{packages/remote-control-server/web/dist/assets/stateDiagram-AJRCARHV-vYQ7RnEF.js → dist/rcs-web/assets/stateDiagram-AJRCARHV-DF9rQs3c.js} +1 -1
  70. package/dist/rcs-web/assets/{stateDiagram-v2-BHNVJYJU-BQI838MX.js → stateDiagram-v2-BHNVJYJU-Zl4Zj4zN.js} +1 -1
  71. package/dist/rcs-web/assets/{timeline-definition-PNZ67QCA-Bd21eOrF.js → timeline-definition-PNZ67QCA-C3MtsV-F.js} +1 -1
  72. package/dist/rcs-web/assets/{vennDiagram-CIIHVFJN-g8Wh80Ut.js → vennDiagram-CIIHVFJN-DP7wVqlq.js} +1 -1
  73. package/dist/rcs-web/assets/{wardleyDiagram-YWT4CUSO-CW-frP4D.js → wardleyDiagram-YWT4CUSO-DxAqIThI.js} +1 -1
  74. package/{packages/remote-control-server/web/dist/assets/workerType-QC9nrox4.js → dist/rcs-web/assets/workerType-CR0nPOQn.js} +1 -1
  75. package/dist/rcs-web/assets/{xychartDiagram-2RQKCTM6-DsyfoONu.js → xychartDiagram-2RQKCTM6-n7XBFulh.js} +1 -1
  76. package/dist/rcs-web/index.html +2 -2
  77. package/dist/rcs-web/saluzi-icon.png +0 -0
  78. package/package.json +1 -1
  79. package/packages/remote-control-server/src/__tests__/environment-rpc.test.ts +142 -0
  80. package/packages/remote-control-server/src/__tests__/low-priority-fixes.test.ts +3 -0
  81. package/packages/remote-control-server/src/__tests__/routes.test.ts +4 -4
  82. package/packages/remote-control-server/src/__tests__/session-cwd.test.ts +226 -0
  83. package/packages/remote-control-server/src/__tests__/stuck-turn-watchdog.test.ts +3 -1
  84. package/packages/remote-control-server/src/db/rcs-schema.sql +13 -1
  85. package/packages/remote-control-server/src/db/sqlite.ts +27 -0
  86. package/packages/remote-control-server/src/routes/v1/environments.work.ts +13 -0
  87. package/packages/remote-control-server/src/routes/web/environments.ts +133 -5
  88. package/packages/remote-control-server/src/routes/web/sessions.ts +113 -9
  89. package/packages/remote-control-server/src/services/environment-rpc.ts +188 -0
  90. package/packages/remote-control-server/src/services/environment.ts +83 -2
  91. package/packages/remote-control-server/src/services/paths.ts +115 -0
  92. package/packages/remote-control-server/src/services/session.ts +21 -0
  93. package/packages/remote-control-server/src/services/work-dispatch.ts +76 -6
  94. package/packages/remote-control-server/src/store.ts +67 -6
  95. package/packages/remote-control-server/src/types/api.ts +38 -4
  96. package/packages/remote-control-server/web/dist/assets/{AdminPanel-BHFN9LNJ.js → AdminPanel-CCkH7iJv.js} +1 -1
  97. package/packages/remote-control-server/web/dist/assets/ArtifactView-v2hQNqJZ.js +1 -0
  98. package/{dist/rcs-web/assets/ArtifactsGallery-CLQlrMUD.js → packages/remote-control-server/web/dist/assets/ArtifactsGallery-BSdlASB3.js} +8 -8
  99. package/{dist/rcs-web/assets/Claim-OHl3vi3x.js → packages/remote-control-server/web/dist/assets/Claim-BK0aslcx.js} +1 -1
  100. package/packages/remote-control-server/web/dist/assets/Dashboard-Cr-2Grcq.js +12 -0
  101. package/packages/remote-control-server/web/dist/assets/Join-CSQz-8kg.js +1 -0
  102. package/packages/remote-control-server/web/dist/assets/Login-CIblWx47.js +1 -0
  103. package/packages/remote-control-server/web/dist/assets/MemoriesPage-D2Qadc7N.js +1 -0
  104. package/packages/remote-control-server/web/dist/assets/{MemoryTypeChips-BkrR3x2j.js → MemoryTypeChips-BFl2a9Tv.js} +2 -2
  105. package/packages/remote-control-server/web/dist/assets/Register-nFyACJRk.js +1 -0
  106. package/packages/remote-control-server/web/dist/assets/{RegisterEmpty-CQLw7nxd.js → RegisterEmpty-FxupE-t-.js} +1 -1
  107. package/packages/remote-control-server/web/dist/assets/SessionDetail-BpmjKpR1.js +78 -0
  108. package/packages/remote-control-server/web/dist/assets/SessionVisibilityBadge-D6XUIJa4.js +21 -0
  109. package/packages/remote-control-server/web/dist/assets/Setup-DGBcwRTD.js +1 -0
  110. package/packages/remote-control-server/web/dist/assets/{ShareLanding-DgCCzzY3.js → ShareLanding-CyNQfq4N.js} +1 -1
  111. package/packages/remote-control-server/web/dist/assets/{TeamDetail-TuVJeCR1.js → TeamDetail-4aZd9y8I.js} +3 -3
  112. package/packages/remote-control-server/web/dist/assets/TeamList-Cs6JQa7m.js +1 -0
  113. package/packages/remote-control-server/web/dist/assets/{TeamSettings-CHEQR0jb.js → TeamSettings-DX0MfIJy.js} +1 -1
  114. package/{dist/rcs-web/assets/UserSearchInput-C4wv1O_6.js → packages/remote-control-server/web/dist/assets/UserSearchInput-CyhqVZCc.js} +2 -2
  115. package/packages/remote-control-server/web/dist/assets/{UserSettings-BCg9Hx1x.js → UserSettings-CsFYao6k.js} +1 -1
  116. package/packages/remote-control-server/web/dist/assets/{arc-C-_TIerE.js → arc-BbFYStVr.js} +1 -1
  117. package/{dist/rcs-web/assets/architectureDiagram-3BPJPVTR-beAA8z-g.js → packages/remote-control-server/web/dist/assets/architectureDiagram-3BPJPVTR-BrraS5HV.js} +1 -1
  118. package/packages/remote-control-server/web/dist/assets/{blockDiagram-GPEHLZMM-BNR3gwO7.js → blockDiagram-GPEHLZMM-BSrrZzGd.js} +1 -1
  119. package/packages/remote-control-server/web/dist/assets/{c4Diagram-AAUBKEIU-B4JhY8vU.js → c4Diagram-AAUBKEIU-BwIi-MY-.js} +1 -1
  120. package/packages/remote-control-server/web/dist/assets/channel-D9MN_Xoy.js +1 -0
  121. package/packages/remote-control-server/web/dist/assets/{chunk-2J33WTMH-C-PijTjw.js → chunk-2J33WTMH-RF5WXSdc.js} +1 -1
  122. package/packages/remote-control-server/web/dist/assets/{chunk-4BX2VUAB-Cf9gkdhc.js → chunk-4BX2VUAB-HD-9lc81.js} +1 -1
  123. package/packages/remote-control-server/web/dist/assets/{chunk-55IACEB6-CU8wR03K.js → chunk-55IACEB6-DORDCTWG.js} +1 -1
  124. package/{dist/rcs-web/assets/chunk-727SXJPM-zxNGjQ_A.js → packages/remote-control-server/web/dist/assets/chunk-727SXJPM-BgEvck_h.js} +1 -1
  125. package/{dist/rcs-web/assets/chunk-AQP2D5EJ-GzIqC820.js → packages/remote-control-server/web/dist/assets/chunk-AQP2D5EJ-CYDKpO5q.js} +1 -1
  126. package/packages/remote-control-server/web/dist/assets/{chunk-FMBD7UC4-C0Gozh4X.js → chunk-FMBD7UC4-HTfaOp-P.js} +1 -1
  127. package/packages/remote-control-server/web/dist/assets/{chunk-ND2GUHAM-Vd4uKkwn.js → chunk-ND2GUHAM-C7j1dy_M.js} +1 -1
  128. package/packages/remote-control-server/web/dist/assets/{chunk-QZHKN3VN-CcmoHM31.js → chunk-QZHKN3VN-DrNt3GZ4.js} +1 -1
  129. package/packages/remote-control-server/web/dist/assets/classDiagram-4FO5ZUOK-C7FZfsl-.js +1 -0
  130. package/packages/remote-control-server/web/dist/assets/classDiagram-v2-Q7XG4LA2-C7FZfsl-.js +1 -0
  131. package/packages/remote-control-server/web/dist/assets/{code-block-IT6T5CEO-CeTiJ_5U.js → code-block-IT6T5CEO-qOs_ie5D.js} +1 -1
  132. package/packages/remote-control-server/web/dist/assets/{copy-CZDxZlFG.js → copy-LeFUX09K.js} +1 -1
  133. package/{dist/rcs-web/assets/cose-bilkent-S5V4N54A-Drz-N1FU.js → packages/remote-control-server/web/dist/assets/cose-bilkent-S5V4N54A-CNYjbdwx.js} +1 -1
  134. package/{dist/rcs-web/assets/dagre-BM42HDAG-Bii1VCPk.js → packages/remote-control-server/web/dist/assets/dagre-BM42HDAG-CzF1zU8o.js} +1 -1
  135. package/packages/remote-control-server/web/dist/assets/{diagram-2AECGRRQ-BXzs0Inz.js → diagram-2AECGRRQ-BOYW474q.js} +1 -1
  136. package/packages/remote-control-server/web/dist/assets/{diagram-5GNKFQAL-CytXTMI4.js → diagram-5GNKFQAL-CP-yWCBy.js} +1 -1
  137. package/{dist/rcs-web/assets/diagram-KO2AKTUF-R6DT6E64.js → packages/remote-control-server/web/dist/assets/diagram-KO2AKTUF-DdqQ4pAJ.js} +1 -1
  138. package/packages/remote-control-server/web/dist/assets/{diagram-LMA3HP47-B6S2xHIS.js → diagram-LMA3HP47-CE2gGIRy.js} +1 -1
  139. package/packages/remote-control-server/web/dist/assets/{diagram-OG6HWLK6-AHaTYJVB.js → diagram-OG6HWLK6-BNA49_sd.js} +1 -1
  140. package/packages/remote-control-server/web/dist/assets/dialog-DnbWz68R.js +1 -0
  141. package/packages/remote-control-server/web/dist/assets/{erDiagram-TEJ5UH35-D5JbEkq8.js → erDiagram-TEJ5UH35-DVflh1jg.js} +1 -1
  142. package/{dist/rcs-web/assets/flowDiagram-I6XJVG4X-CY0aHTCu.js → packages/remote-control-server/web/dist/assets/flowDiagram-I6XJVG4X-B8b91Tm9.js} +1 -1
  143. package/{dist/rcs-web/assets/ganttDiagram-6RSMTGT7-CSyAl3z-.js → packages/remote-control-server/web/dist/assets/ganttDiagram-6RSMTGT7-7fEdykwc.js} +1 -1
  144. package/{dist/rcs-web/assets/gitGraphDiagram-PVQCEYII-e5YIgxoR.js → packages/remote-control-server/web/dist/assets/gitGraphDiagram-PVQCEYII-B_17h1CU.js} +1 -1
  145. package/packages/remote-control-server/web/dist/assets/{infoDiagram-5YYISTIA-DVDPyLBc.js → infoDiagram-5YYISTIA-DWa7j6Zg.js} +1 -1
  146. package/packages/remote-control-server/web/dist/assets/{ishikawaDiagram-YF4QCWOH-0gxGyjL6.js → ishikawaDiagram-YF4QCWOH-b11b1c8I.js} +1 -1
  147. package/{dist/rcs-web/assets/journeyDiagram-JHISSGLW-CM83fuK_.js → packages/remote-control-server/web/dist/assets/journeyDiagram-JHISSGLW-CsvW9Ud9.js} +1 -1
  148. package/{dist/rcs-web/assets/kanban-definition-UN3LZRKU-id_FkJ5L.js → packages/remote-control-server/web/dist/assets/kanban-definition-UN3LZRKU-B97kXWdO.js} +1 -1
  149. package/packages/remote-control-server/web/dist/assets/{linear-4qBKmb1P.js → linear-CrAR73-K.js} +1 -1
  150. package/packages/remote-control-server/web/dist/assets/main-BOI1Ucfk.css +1 -0
  151. package/packages/remote-control-server/web/dist/assets/{main-BAO6US1o.js → main-CDaRKeiT.js} +30 -30
  152. package/{dist/rcs-web/assets/mermaid-VLURNSYL-BUDhzZZx.js → packages/remote-control-server/web/dist/assets/mermaid-VLURNSYL-gQdmHkjr.js} +4 -4
  153. package/packages/remote-control-server/web/dist/assets/{mermaid.core-n5f_df_C.js → mermaid.core-DTuGObIu.js} +5 -5
  154. package/{dist/rcs-web/assets/mindmap-definition-RKZ34NQL-Cn5ESsTL.js → packages/remote-control-server/web/dist/assets/mindmap-definition-RKZ34NQL-wGG267Yb.js} +1 -1
  155. package/packages/remote-control-server/web/dist/assets/{notifications-D0Ro2M4C.js → notifications-Ms9MI-nO.js} +1 -1
  156. package/packages/remote-control-server/web/dist/assets/{pieDiagram-4H26LBE5-CfNaOQwR.js → pieDiagram-4H26LBE5-DgayJQKV.js} +1 -1
  157. package/packages/remote-control-server/web/dist/assets/{quadrantDiagram-W4KKPZXB-9EH7YWIg.js → quadrantDiagram-W4KKPZXB-BOtyjbOc.js} +1 -1
  158. package/packages/remote-control-server/web/dist/assets/{refresh-cw-Cj9UC6vN.js → refresh-cw-Dc5tn8Z_.js} +1 -1
  159. package/packages/remote-control-server/web/dist/assets/{requirementDiagram-4Y6WPE33-Cw-qvChc.js → requirementDiagram-4Y6WPE33-Ck-a8POo.js} +1 -1
  160. package/packages/remote-control-server/web/dist/assets/{sankeyDiagram-5OEKKPKP-grgk3897.js → sankeyDiagram-5OEKKPKP-DR0OBykc.js} +1 -1
  161. package/packages/remote-control-server/web/dist/assets/{sequenceDiagram-3UESZ5HK-DEiAVVrz.js → sequenceDiagram-3UESZ5HK-DFOP0Bxr.js} +1 -1
  162. package/{dist/rcs-web/assets/stateDiagram-AJRCARHV-vYQ7RnEF.js → packages/remote-control-server/web/dist/assets/stateDiagram-AJRCARHV-DF9rQs3c.js} +1 -1
  163. package/packages/remote-control-server/web/dist/assets/{stateDiagram-v2-BHNVJYJU-BQI838MX.js → stateDiagram-v2-BHNVJYJU-Zl4Zj4zN.js} +1 -1
  164. package/packages/remote-control-server/web/dist/assets/{timeline-definition-PNZ67QCA-Bd21eOrF.js → timeline-definition-PNZ67QCA-C3MtsV-F.js} +1 -1
  165. package/packages/remote-control-server/web/dist/assets/{vennDiagram-CIIHVFJN-g8Wh80Ut.js → vennDiagram-CIIHVFJN-DP7wVqlq.js} +1 -1
  166. package/packages/remote-control-server/web/dist/assets/{wardleyDiagram-YWT4CUSO-CW-frP4D.js → wardleyDiagram-YWT4CUSO-DxAqIThI.js} +1 -1
  167. package/{dist/rcs-web/assets/workerType-QC9nrox4.js → packages/remote-control-server/web/dist/assets/workerType-CR0nPOQn.js} +1 -1
  168. package/packages/remote-control-server/web/dist/assets/{xychartDiagram-2RQKCTM6-DsyfoONu.js → xychartDiagram-2RQKCTM6-n7XBFulh.js} +1 -1
  169. package/packages/remote-control-server/web/dist/index.html +2 -2
  170. package/packages/remote-control-server/web/dist/saluzi-icon.png +0 -0
  171. package/dist/rcs-web/assets/ArtifactView-D597eE0B.js +0 -1
  172. package/dist/rcs-web/assets/Dashboard-C11LLxyp.js +0 -6
  173. package/dist/rcs-web/assets/Join-r5JcPEJU.js +0 -1
  174. package/dist/rcs-web/assets/Login-BV-VFXc8.js +0 -1
  175. package/dist/rcs-web/assets/MemoriesPage-CnvVE7y9.js +0 -1
  176. package/dist/rcs-web/assets/Register-BKegRZln.js +0 -1
  177. package/dist/rcs-web/assets/SessionDetail-qQ_yYMXP.js +0 -83
  178. package/dist/rcs-web/assets/SessionVisibilityBadge-CHpMKXvY.js +0 -11
  179. package/dist/rcs-web/assets/Setup-4TRbUKxr.js +0 -1
  180. package/dist/rcs-web/assets/TeamList-DhoruPq3.js +0 -1
  181. package/dist/rcs-web/assets/channel-BO-JIGHa.js +0 -1
  182. package/dist/rcs-web/assets/classDiagram-4FO5ZUOK-CQNKs2Q1.js +0 -1
  183. package/dist/rcs-web/assets/classDiagram-v2-Q7XG4LA2-CQNKs2Q1.js +0 -1
  184. package/dist/rcs-web/assets/dialog-Bts_qkki.js +0 -1
  185. package/dist/rcs-web/assets/main-DNorjD-j.css +0 -1
  186. package/packages/remote-control-server/web/dist/assets/ArtifactView-D597eE0B.js +0 -1
  187. package/packages/remote-control-server/web/dist/assets/Dashboard-C11LLxyp.js +0 -6
  188. package/packages/remote-control-server/web/dist/assets/Join-r5JcPEJU.js +0 -1
  189. package/packages/remote-control-server/web/dist/assets/Login-BV-VFXc8.js +0 -1
  190. package/packages/remote-control-server/web/dist/assets/MemoriesPage-CnvVE7y9.js +0 -1
  191. package/packages/remote-control-server/web/dist/assets/Register-BKegRZln.js +0 -1
  192. package/packages/remote-control-server/web/dist/assets/SessionDetail-qQ_yYMXP.js +0 -83
  193. package/packages/remote-control-server/web/dist/assets/SessionVisibilityBadge-CHpMKXvY.js +0 -11
  194. package/packages/remote-control-server/web/dist/assets/Setup-4TRbUKxr.js +0 -1
  195. package/packages/remote-control-server/web/dist/assets/TeamList-DhoruPq3.js +0 -1
  196. package/packages/remote-control-server/web/dist/assets/channel-BO-JIGHa.js +0 -1
  197. package/packages/remote-control-server/web/dist/assets/classDiagram-4FO5ZUOK-CQNKs2Q1.js +0 -1
  198. package/packages/remote-control-server/web/dist/assets/classDiagram-v2-Q7XG4LA2-CQNKs2Q1.js +0 -1
  199. package/packages/remote-control-server/web/dist/assets/dialog-Bts_qkki.js +0 -1
  200. package/packages/remote-control-server/web/dist/assets/main-DNorjD-j.css +0 -1
@@ -0,0 +1,21 @@
1
+ import{aQ as e,a4 as l,aO as i}from"./main-CDaRKeiT.js";import{j as o}from"./vendor-DE_-CLIE.js";/**
2
+ * @license lucide-react v0.555.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const d=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],u=e("chevron-right",d);/**
7
+ * @license lucide-react v0.555.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const h=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],f=e("folder",h);/**
12
+ * @license lucide-react v0.555.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const m=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],p=e("globe",m);/**
17
+ * @license lucide-react v0.555.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */const x=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],b=e("lock",x);function g({visibility:t,className:c}){const a={private:{label:"Private",Icon:b,colorClass:"text-text-muted border-border/60"},team:{label:"Team",Icon:l,colorClass:"text-accent border-accent/40"},public:{label:"Public",Icon:p,colorClass:"text-accent border-accent/40"}},{label:s,Icon:r,colorClass:n}=a[t];return o.jsxs("span",{className:i("inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-xs",n,c),children:[o.jsx(r,{className:"h-3 w-3"}),s]})}export{u as C,f as F,b as L,g as S};
@@ -0,0 +1 @@
1
+ import{e as r,j as e}from"./vendor-DE_-CLIE.js";import{b9 as v,a6 as N,b4 as t}from"./main-CDaRKeiT.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";function E({onSuccess:p,onAlreadyDone:b}){const{setup:h}=v(),[d,f]=r.useState(""),[l,y]=r.useState(""),[a,g]=r.useState(""),[u,w]=r.useState(""),[i,o]=r.useState(""),[m,c]=r.useState(!1),j=async s=>{if(s.preventDefault(),o(""),a.length<8){o(t("auth.setup.passwordTooShort"));return}if(a!==u){o(t("auth.setup.passwordMismatch"));return}c(!0);try{await h(d,l,a),p()}catch(x){const n=x instanceof Error?x.message:"Setup failed";if(n.includes("already")||n.includes("409")){b();return}o(n)}finally{c(!1)}};return e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface-0 px-4",children:e.jsxs("div",{className:"hero-enter w-full max-w-sm space-y-6",children:[e.jsxs("div",{className:"text-center",children:[e.jsx(N,{className:"brand-wordmark--auth mb-5"}),e.jsx("h1",{className:"font-display text-3xl font-semibold tracking-tight text-text-primary",children:t("auth.setup.title")}),e.jsx("p",{className:"mt-2 text-sm text-text-muted",children:t("auth.setup.description")})]}),e.jsxs("form",{onSubmit:j,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.setup.apiKey")}),e.jsx("input",{type:"password",value:d,onChange:s=>f(s.target.value),required:!0,autoComplete:"off",className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.setup.username")}),e.jsx("input",{type:"text",value:l,onChange:s=>y(s.target.value),required:!0,autoComplete:"username",className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.setup.password")}),e.jsx("input",{type:"password",value:a,onChange:s=>g(s.target.value),required:!0,autoComplete:"new-password",className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.setup.confirmPassword")}),e.jsx("input",{type:"password",value:u,onChange:s=>w(s.target.value),required:!0,autoComplete:"new-password",className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),i&&e.jsx("p",{className:"text-sm text-status-error",children:i}),e.jsx("button",{type:"submit",disabled:m,className:"w-full rounded-lg bg-brand px-4 py-2.5 font-display text-sm font-medium text-white shadow-lg shadow-brand/25 transition-all hover:-translate-y-0.5 hover:bg-brand-light hover:shadow-brand/40 disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:translate-y-0 disabled:hover:shadow-none",children:m?t("common.loading"):t("auth.setup.submit")})]})]})})}export{E as Setup};
@@ -1 +1 @@
1
- import{e as o,j as e}from"./vendor-DE_-CLIE.js";import{b0 as u,aW as t,at as f,b as p}from"./main-BAO6US1o.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";function N(){u();const[r,a]=o.useState("loading"),[l,n]=o.useState(""),[x,c]=o.useState(""),m=(typeof window<"u"?window.location.pathname:"").match(/\/code\/s\/([^/?]+)/),d=m?m[1]:null;return o.useEffect(()=>{if(!d){a("invalid"),n("share.noToken");return}if(!d.startsWith("shr_")){a("invalid"),n("share.badToken");return}let i=!1;async function h(){try{const s=await f(d);if(i)return;window.location.href=`/code/${s.id}`}catch(s){if(i)return;s instanceof p?s.status===401&&s.message.toLowerCase().includes("expired")?(a("expired"),n("share.expiredBody")):s.status===404?s.message.toLowerCase().includes("session")?(a("not_found"),n("share.sessionMissing")):(a("invalid"),n("share.revoked")):s.status===403?(a("invalid"),n("share.forbidden")):(a("error"),c(s.message)):(a("error"),c(s instanceof Error?s.message:""))}}return h(),()=>{i=!0}},[d]),o.useEffect(()=>{if(r!=="loading"&&r!=="error"){const i=setTimeout(()=>{window.location.href="/code"},3e3);return()=>clearTimeout(i)}},[r]),r==="loading"?e.jsx("div",{className:"flex h-screen items-center justify-center bg-surface-0 text-text-muted",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"animate-spin h-8 w-8 border-2 border-brand border-t-transparent rounded-full mx-auto mb-3"}),e.jsx("p",{children:t("share.loading")})]})}):e.jsx("div",{className:"flex h-screen items-center justify-center bg-surface-0 text-text-primary",children:e.jsxs("div",{className:"text-center max-w-md px-4",children:[r==="expired"&&e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"font-display text-xl font-semibold mb-2",children:t("share.expiredTitle")}),e.jsx("p",{className:"text-text-muted mb-4",children:t(l||"share.expiredBody")})]}),r==="invalid"&&e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"font-display text-xl font-semibold mb-2",children:t("share.invalidTitle")}),e.jsx("p",{className:"text-text-muted mb-4",children:t(l||"share.invalidBody")})]}),r==="not_found"&&e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"font-display text-xl font-semibold mb-2",children:t("share.notFoundTitle")}),e.jsx("p",{className:"text-text-muted mb-4",children:t(l||"share.notFoundBody")})]}),r==="error"&&e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"font-display text-xl font-semibold mb-2",children:t("share.errorTitle")}),e.jsx("p",{className:"text-status-error mb-4",children:x||t("share.errorBody")})]}),e.jsx("a",{href:"/code",className:"text-brand-text hover:underline",children:t("share.back")})]})})}export{N as ShareLanding};
1
+ import{e as o,j as e}from"./vendor-DE_-CLIE.js";import{ba as u,b4 as t,aD as f,b as p}from"./main-CDaRKeiT.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";function N(){u();const[r,a]=o.useState("loading"),[l,n]=o.useState(""),[x,c]=o.useState(""),m=(typeof window<"u"?window.location.pathname:"").match(/\/code\/s\/([^/?]+)/),d=m?m[1]:null;return o.useEffect(()=>{if(!d){a("invalid"),n("share.noToken");return}if(!d.startsWith("shr_")){a("invalid"),n("share.badToken");return}let i=!1;async function h(){try{const s=await f(d);if(i)return;window.location.href=`/code/${s.id}`}catch(s){if(i)return;s instanceof p?s.status===401&&s.message.toLowerCase().includes("expired")?(a("expired"),n("share.expiredBody")):s.status===404?s.message.toLowerCase().includes("session")?(a("not_found"),n("share.sessionMissing")):(a("invalid"),n("share.revoked")):s.status===403?(a("invalid"),n("share.forbidden")):(a("error"),c(s.message)):(a("error"),c(s instanceof Error?s.message:""))}}return h(),()=>{i=!0}},[d]),o.useEffect(()=>{if(r!=="loading"&&r!=="error"){const i=setTimeout(()=>{window.location.href="/code"},3e3);return()=>clearTimeout(i)}},[r]),r==="loading"?e.jsx("div",{className:"flex h-screen items-center justify-center bg-surface-0 text-text-muted",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"animate-spin h-8 w-8 border-2 border-brand border-t-transparent rounded-full mx-auto mb-3"}),e.jsx("p",{children:t("share.loading")})]})}):e.jsx("div",{className:"flex h-screen items-center justify-center bg-surface-0 text-text-primary",children:e.jsxs("div",{className:"text-center max-w-md px-4",children:[r==="expired"&&e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"font-display text-xl font-semibold mb-2",children:t("share.expiredTitle")}),e.jsx("p",{className:"text-text-muted mb-4",children:t(l||"share.expiredBody")})]}),r==="invalid"&&e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"font-display text-xl font-semibold mb-2",children:t("share.invalidTitle")}),e.jsx("p",{className:"text-text-muted mb-4",children:t(l||"share.invalidBody")})]}),r==="not_found"&&e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"font-display text-xl font-semibold mb-2",children:t("share.notFoundTitle")}),e.jsx("p",{className:"text-text-muted mb-4",children:t(l||"share.notFoundBody")})]}),r==="error"&&e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"font-display text-xl font-semibold mb-2",children:t("share.errorTitle")}),e.jsx("p",{className:"text-status-error mb-4",children:x||t("share.errorBody")})]}),e.jsx("a",{href:"/code",className:"text-brand-text hover:underline",children:t("share.back")})]})})}export{N as ShareLanding};
@@ -1,11 +1,11 @@
1
- import{e as r,j as e}from"./vendor-DE_-CLIE.js";import{aG as q,a0 as T,b0 as M,aW as t,e as z,$ as U,aX as G,aE as W,X,aK as K,ad as Y,aB as J,aA as Q,a$ as V,H as Z,m as ee,r as te,P as ae,n as se,p as ne,o as H,q as re,W as ie}from"./main-BAO6US1o.js";import{R as D,E as oe}from"./RegisterEmpty-CQLw7nxd.js";import{U as le,A as O}from"./UserSearchInput-C4wv1O_6.js";import{C as F}from"./copy-CZDxZlFG.js";import{g as ce}from"./workerType-QC9nrox4.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";/**
1
+ import{e as r,j as e}from"./vendor-DE_-CLIE.js";import{aQ as z,a8 as T,ba as M,b4 as t,e as B,a7 as F,b5 as G,aO as I,a2 as K,aU as Q,am as X,aL as Y,aK as J,b9 as V,T as Z,n as ee,s as te,P as ae,o as se,q as ne,p as H,r as re,a0 as ie}from"./main-CDaRKeiT.js";import{R as U,E as oe}from"./RegisterEmpty-FxupE-t-.js";import{U as le,A as O}from"./UserSearchInput-CyhqVZCc.js";import{C as D}from"./copy-LeFUX09K.js";import{g as ce}from"./workerType-CR0nPOQn.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";/**
2
2
  * @license lucide-react v0.555.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const de=[["path",{d:"m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71",key:"yqzxt4"}],["path",{d:"m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71",key:"4qinb0"}],["line",{x1:"8",x2:"8",y1:"2",y2:"5",key:"1041cp"}],["line",{x1:"2",x2:"5",y1:"8",y2:"8",key:"14m1p5"}],["line",{x1:"16",x2:"16",y1:"19",y2:"22",key:"rzdirn"}],["line",{x1:"19",x2:"22",y1:"16",y2:"16",key:"ox905f"}]],me=q("unlink",de);/**
6
+ */const de=[["path",{d:"m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71",key:"yqzxt4"}],["path",{d:"m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71",key:"4qinb0"}],["line",{x1:"8",x2:"8",y1:"2",y2:"5",key:"1041cp"}],["line",{x1:"2",x2:"5",y1:"8",y2:"8",key:"14m1p5"}],["line",{x1:"16",x2:"16",y1:"19",y2:"22",key:"rzdirn"}],["line",{x1:"19",x2:"22",y1:"16",y2:"16",key:"ox905f"}]],me=z("unlink",de);/**
7
7
  * @license lucide-react v0.555.0 - ISC
8
8
  *
9
9
  * This source code is licensed under the ISC license.
10
10
  * See the LICENSE file in the root directory of this source tree.
11
- */const xe=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],ue=q("user-plus",xe);function I(n){const[x,i]=r.useState([]),[k,v]=r.useState(!1),l=r.useCallback(async()=>{if(n){v(!0);try{const p=await T("GET",`/web/teams/${n}/members`);i(p)}catch{i([])}finally{v(!1)}}},[n]);r.useEffect(()=>{l()},[l]);const b=r.useCallback(async(p,y)=>{await T("POST",`/web/teams/${n}/members`,{userId:p,role:y}),await l()},[n,l]),u=r.useCallback(async p=>{await T("DELETE",`/web/teams/${n}/members/${p}`),await l()},[n,l]),d=r.useCallback(async(p,y)=>{await T("PATCH",`/web/teams/${n}/members/${p}`,{role:y}),await l()},[n,l]);return{members:x,isLoading:k,addMember:b,removeMember:u,updateRole:d,refetch:l}}function pe(n){const[x,i]=r.useState([]),k=r.useCallback(async l=>{if(!n)return null;const b=await T("POST",`/web/teams/${n}/invitations`,l);return i(u=>[...u,b]),b},[n]),v=r.useCallback(async l=>{n&&(await T("DELETE",`/web/teams/${n}/invitations/${l}`),i(b=>b.filter(u=>u.token!==l)))},[n]);return{invitations:x,createInvitation:k,revokeInvitation:v}}function he({teamId:n,canManage:x}){M();const{invitations:i,createInvitation:k,revokeInvitation:v}=pe(n),{addMember:l}=I(n),[b,u]=r.useState(!1),[d,p]=r.useState(null),[y,C]=r.useState("member"),[m,w]=r.useState(!1),[g,f]=r.useState("member"),[j,_]=r.useState(null),[A,L]=r.useState(!1),[s,a]=r.useState(!1),[c,h]=r.useState(!1),N=async()=>{u(!0);try{const o=await k({role:y,expiresIn:86400,maxUses:5});o&&p(o.token||o.inviteToken||null)}catch{}finally{u(!1)}},$=async()=>{if(!d)return;const o=`${window.location.origin}/join?invite=${d}`;let S=!1;try{navigator.clipboard&&window.isSecureContext&&(await navigator.clipboard.writeText(o),S=!0)}catch{}if(!S){const E=document.createElement("textarea");E.value=o,E.style.position="fixed",E.style.top="0",E.style.opacity="0",document.body.appendChild(E),E.focus(),E.select(),E.setSelectionRange(0,o.length);try{S=document.execCommand("copy")}catch{S=!1}document.body.removeChild(E)}S?(h(!1),a(!0),setTimeout(()=>a(!1),2e3)):(a(!1),h(!0),setTimeout(()=>h(!1),4e3))},R=async o=>{L(!0),_(null);try{await l(o,g),w(!1)}catch(S){_(S instanceof Error?S.message:t("invitation.addFailed"))}finally{L(!1)}};return e.jsxs("section",{className:"ds-page-row",children:[e.jsx("h2",{children:t("team.detail.invitations")}),x&&e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("select",{className:"rounded-md border border-border bg-surface-2 px-2.5 py-1.5 text-xs text-text-primary focus:border-accent focus:outline-none",value:y,onChange:o=>C(o.target.value),"aria-label":t("team.member.role"),children:[e.jsx("option",{value:"member",children:t("invitation.member")}),e.jsx("option",{value:"admin",children:t("invitation.admin")})]}),e.jsx("button",{type:"button",onClick:N,disabled:b,className:"inline-flex items-center rounded-md border border-border px-3 py-1.5 text-xs font-medium text-text-primary transition-colors hover:bg-surface-2 disabled:opacity-40",children:b?t("invitation.creating"):t("invitation.create")}),e.jsxs("button",{type:"button",onClick:()=>w(o=>!o),"aria-pressed":m,className:"inline-flex items-center gap-1.5 rounded-md border border-border px-3 py-1.5 text-xs font-medium text-text-primary transition-colors hover:bg-surface-2",title:t("invitation.addExistingHint"),children:[e.jsx(ue,{className:"h-3.5 w-3.5"}),t("invitation.addExisting")]})]}),d&&e.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-border bg-surface-1 px-3 py-2",children:[e.jsx("code",{className:"min-w-0 flex-1 truncate font-mono text-xs text-text-primary",children:`${window.location.origin}/join?invite=${d}`}),e.jsx("button",{type:"button",onClick:$,className:s?"text-status-active":"text-text-muted hover:text-text-primary",title:s?t("share.copied"):t("share.copy"),children:s?e.jsx(z,{className:"h-4 w-4"}):e.jsx(F,{className:"h-4 w-4"})}),e.jsx("button",{type:"button",onClick:()=>p(null),className:"text-text-muted hover:text-text-primary","aria-label":t("common.cancel"),children:e.jsx(U,{className:"h-4 w-4"})})]}),c&&e.jsx("p",{className:"text-xs text-status-error",children:t("share.copyFailed")}),m&&x&&e.jsxs("div",{className:"space-y-3 rounded-md border border-border bg-surface-1 p-3",children:[e.jsx("p",{className:"text-xs text-text-muted",children:t("invitation.addExistingHint")}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs("select",{className:"rounded-md border border-border bg-surface-2 px-2 py-1.5 text-sm text-text-primary focus:border-accent focus:outline-none",value:g,onChange:o=>f(o.target.value),"aria-label":t("team.member.role"),children:[e.jsx("option",{value:"member",children:t("invitation.member")}),e.jsx("option",{value:"admin",children:t("invitation.admin")})]})}),j&&e.jsx("p",{className:"text-xs text-destructive",children:j}),e.jsx(le,{onSelect:R,actionDisabled:A,placeholder:t("invitation.searchUser")})]}),i.length===0?e.jsx(D,{title:t("invitation.emptyTitle"),hint:t("invitation.emptyHint")}):e.jsx("div",{className:"ds-reg",children:i.map(o=>e.jsxs("div",{className:"ds-reg-row group",children:[e.jsxs("div",{className:"ds-reg-main",children:[e.jsx("span",{className:"ds-reg-tag shrink-0 rounded-full border border-border/60 bg-surface-2 text-text-muted",children:o.role==="admin"?t("invitation.admin"):t("invitation.member")}),e.jsx("span",{className:"ds-reg-meta truncate font-mono text-xs text-text-muted",children:G("invitation.expires",{date:new Date(o.expiresAt).toLocaleDateString()})})]}),x&&e.jsx("div",{className:"ds-reg-aside",children:e.jsx("button",{type:"button",onClick:()=>v(o.token),className:"ds-reg-delete rounded p-1 text-text-muted opacity-0 transition-all hover:text-status-error group-hover:opacity-100 focus-visible:opacity-100",title:t("invitation.revoke"),"aria-label":t("invitation.revoke"),children:e.jsx(U,{className:"h-4 w-4"})})})]},o.token))})]})}function be({teamId:n,canManage:x}){M();const[i,k]=r.useState([]),[v,l]=r.useState(!0),[b,u]=r.useState(null),[d,p]=r.useState(""),[y,C]=r.useState(null),[m,w]=r.useState(!1),g=async()=>{try{const s=await Y();k(s||[])}catch(s){u(s instanceof Error?s.message:t("team.detail.loadEnvsFailed"))}finally{l(!1)}};r.useEffect(()=>{g()},[]);const f=r.useMemo(()=>i.filter(s=>s.team_id===n),[i,n]),j=r.useMemo(()=>i.filter(s=>!s.team_id),[i]),_=async()=>{if(d){C(null);try{await Q(d,n),p(""),await g()}catch(s){C(s instanceof Error?s.message:t("team.detail.linkFailed"))}}},A=async s=>{if(window.confirm(t("team.detail.unlinkConfirm"))){C(null);try{await J(n,s),await g()}catch(a){C(a instanceof Error?a.message:t("team.detail.unlinkFailed"))}}},L=async()=>{const s=`slz rc --team-id ${n}`;try{if(navigator.clipboard&&window.isSecureContext){await navigator.clipboard.writeText(s),w(!0),setTimeout(()=>w(!1),2e3);return}}catch{}const a=document.createElement("textarea");a.value=s,a.style.position="fixed",a.style.opacity="0",document.body.appendChild(a),a.select();try{document.execCommand("copy"),w(!0),setTimeout(()=>w(!1),2e3)}catch{}document.body.removeChild(a)};return e.jsxs("section",{className:"ds-page-row",children:[e.jsx("h2",{children:t("team.detail.environments")}),v?e.jsx("p",{className:"text-sm text-text-muted",children:t("common.loading")}):b?e.jsx("p",{className:"text-sm text-status-error",children:b}):e.jsxs(e.Fragment,{children:[f.length===0?e.jsx(D,{title:t("team.detail.envsEmptyTitle"),hint:t("team.detail.envsEmptyHint")}):e.jsx("div",{className:"ds-reg",children:f.map(s=>{var N,$;const a=ce(s.worker_type),c=((N=s.directory)==null?void 0:N.trim())||null,h=(($=s.owner_username)==null?void 0:$.trim())||null;return e.jsxs("div",{className:"ds-reg-row group",children:[e.jsxs("div",{className:"ds-reg-main",children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"min-w-0 truncate text-sm font-medium text-text-primary",children:s.machine_name||s.id}),e.jsx("span",{className:W("ds-reg-tag rounded-full",a.colorClass),children:a.fullLabel}),e.jsx(oe,{status:s.status,className:"ds-reg-tag"})]}),(c||h)&&e.jsxs("span",{className:"ds-reg-meta flex min-w-0 items-center gap-1.5 text-xs text-text-muted",children:[c&&e.jsx("span",{className:"min-w-0 truncate font-mono",children:c}),c&&h&&e.jsx("span",{className:"ds-reg-fact-sep","aria-hidden":"true",children:"·"}),h&&e.jsxs("span",{className:"ds-reg-owner",title:`${t("dashboard.envOwner")}: ${h}`,children:[e.jsx(X,{className:"h-3 w-3","aria-hidden":"true"}),e.jsx("span",{className:"min-w-0 truncate",children:h})]})]})]}),e.jsxs("div",{className:"ds-reg-aside",children:[e.jsx("span",{className:"col-start-2 whitespace-nowrap font-mono text-xs tabular-nums text-text-muted",children:K(s.created_at)}),x&&e.jsx("button",{type:"button",onClick:()=>A(s.id),className:"ds-reg-delete rounded p-1 text-text-muted opacity-0 transition-all hover:text-status-error group-hover:opacity-100 focus-visible:opacity-100",title:t("team.detail.unlink"),"aria-label":t("team.detail.unlink"),children:e.jsx(me,{className:"h-4 w-4"})})]})]},s.id)})}),x&&e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("span",{className:"text-xs text-text-muted",children:t("team.detail.registerHint")}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("code",{className:"rounded-md border border-border bg-surface-2 px-3 py-1.5 font-mono text-xs text-text-primary",children:["slz rc --team-id ",n]}),e.jsx("button",{type:"button",onClick:L,className:"text-text-muted transition-colors hover:text-text-primary","aria-label":t("team.detail.copyCommand"),title:t("team.detail.copyCommand"),children:e.jsx(F,{className:"h-3.5 w-3.5"})}),m&&e.jsx("span",{className:"text-xs text-status-active",children:t("share.copied")})]})]}),j.length>0&&e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{htmlFor:"team-link-env",className:"text-xs text-text-muted",children:t("team.detail.linkHint")}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("select",{id:"team-link-env",value:d,onChange:s=>p(s.target.value),className:"max-w-md rounded-md border border-border bg-surface-2 px-2.5 py-1.5 text-xs text-text-primary focus:border-accent focus:outline-none",children:[e.jsx("option",{value:"",children:t("team.detail.linkSelect")}),j.map(s=>e.jsx("option",{value:s.id,children:s.machine_name||s.id},s.id))]}),e.jsx("button",{type:"button",onClick:_,disabled:!d,className:"inline-flex items-center rounded-md border border-border px-3 py-1.5 text-xs font-medium text-text-primary transition-colors hover:bg-surface-2 disabled:opacity-40",children:t("team.detail.link")})]})]})]}),y&&e.jsx("p",{className:"text-sm text-status-error",children:y})]})]})}async function fe(n){try{const x=n.startsWith("team_")?`/web/teams/${n}`:`/web/teams/by-slug/${n}`;return await T("GET",x)}catch{return null}}const ye={owner:"team.member.roleOwner",admin:"team.member.roleAdmin",member:"team.member.roleMember"},P={owner:"border-brand/30 bg-brand/10 text-brand-text",admin:"border-accent/30 bg-accent/10 text-accent",member:"border-border/60 bg-surface-2 text-text-muted"};function B(n){return t(ye[n]||"team.member.roleMember")}function Se(){M();const n=window.location.pathname.split("/"),x=n[n.length-1]||"",[i,k]=r.useState(null),[v,l]=r.useState(!0),[b,u]=r.useState(!1),{members:d,isLoading:p,updateRole:y,removeMember:C}=I((i==null?void 0:i.id)||null),{user:m}=V(),[w,g]=r.useState("");if(r.useEffect(()=>{x&&(l(!0),fe(x).then(a=>{k(a),l(!1)}))},[x]),v)return e.jsx("div",{className:"ds-page text-sm text-text-muted",children:t("common.loading")});if(!i)return e.jsxs("div",{className:"ds-page",children:[e.jsx("div",{className:"ds-page-head",children:e.jsxs("a",{href:"/teams",className:"ds-page-back",children:[e.jsx(O,{className:"h-3.5 w-3.5"}),t("team.detail.back")]})}),e.jsx("p",{className:"text-sm text-text-muted",children:t("team.detail.notFound")})]});const f=d.find(a=>a.user_id===(m==null?void 0:m.userId)),j=(m==null?void 0:m.role)==="admin"||(f==null?void 0:f.role)==="owner"||(f==null?void 0:f.role)==="admin",_=(m==null?void 0:m.role)==="admin"||(f==null?void 0:f.role)==="owner",A=async()=>{const a=i.id;try{if(navigator.clipboard&&window.isSecureContext){await navigator.clipboard.writeText(a),u(!0),setTimeout(()=>u(!1),2e3);return}}catch{}const c=document.createElement("textarea");c.value=a,c.style.position="fixed",c.style.opacity="0",document.body.appendChild(c),c.select();try{document.execCommand("copy"),u(!0),setTimeout(()=>u(!1),2e3)}catch{}document.body.removeChild(c)},L=async(a,c)=>{if(a.role!==c){g("");try{await y(a.user_id,c)}catch(h){g(h instanceof Error?h.message:t("team.member.updateFailed"))}}},s=async a=>{const c=a.username||a.user_id;if(window.confirm(t("team.member.removeConfirm").replace("{name}",c))){g("");try{await C(a.user_id)}catch(N){g(N instanceof Error?N.message:t("team.member.updateFailed"))}}};return e.jsxs("div",{className:"ds-page",children:[e.jsxs("header",{className:"ds-page-head ds-page-head--display hero-enter",children:[e.jsx("div",{className:"ds-page-runhead",children:e.jsx("span",{className:"ds-page-runhead-label",children:t("team.list.kicker")})}),e.jsxs("div",{className:"ds-page-titlerow",children:[e.jsx("h1",{className:"ds-page-title font-display font-semibold tracking-tight text-text-primary",children:i.name}),e.jsx("span",{className:"ds-page-count",children:G("team.detail.memberCount",{n:d.length})})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("span",{className:"font-mono text-xs text-text-muted",children:["/",i.slug]}),e.jsx("span",{className:"font-mono text-xs text-text-muted","aria-hidden":"true",children:"·"}),e.jsx("code",{className:"font-mono text-xs text-text-muted",children:i.id}),e.jsx("button",{type:"button",onClick:A,className:"text-text-muted transition-colors hover:text-text-primary","aria-label":t("team.detail.copyId"),title:t("team.detail.copyId"),children:e.jsx(F,{className:"h-3.5 w-3.5"})}),b&&e.jsx("span",{className:"text-xs text-status-active",children:t("share.copied")}),j&&e.jsx("a",{href:`/teams/${i.slug}/settings`,className:"ml-1 text-text-muted transition-colors hover:text-text-primary","aria-label":t("team.settings.title"),title:t("team.settings.title"),children:e.jsx(Z,{className:"h-4 w-4"})}),e.jsx("a",{href:"/teams",className:"text-text-muted transition-colors hover:text-text-primary","aria-label":t("team.detail.back"),title:t("team.detail.back"),children:e.jsx(O,{className:"h-4 w-4"})})]}),i.description&&e.jsx("p",{className:"ds-page-lede",children:i.description})]}),e.jsxs("section",{className:"ds-page-row hero-enter-late",children:[e.jsx("h2",{children:t("team.detail.members")}),w&&e.jsx("p",{className:"text-sm text-status-error",children:w}),p?e.jsx("p",{className:"text-sm text-text-muted",children:t("common.loading")}):d.length===0?e.jsx(D,{title:t("team.detail.membersEmptyTitle"),hint:t("team.detail.membersEmptyHint")}):e.jsx("div",{className:"ds-reg",children:d.map(a=>{const c=a.user_id===(m==null?void 0:m.userId),h=a.role==="owner"||a.role==="admin",N=j&&(!h||_),$=N&&!(a.role==="owner"&&d.filter(o=>o.role==="owner").length<=1),R=["owner","admin","member"];return e.jsxs("div",{className:"ds-reg-row",children:[e.jsxs("div",{className:"ds-reg-main",children:[e.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:"min-w-0 truncate text-sm font-medium text-text-primary",children:a.username||a.user_id}),c&&e.jsx("span",{className:"shrink-0 text-xs text-text-muted",children:t("team.member.you")}),e.jsx("span",{className:W("ds-reg-tag shrink-0 rounded-full border",P[a.role]||P.member),children:B(a.role)})]}),e.jsx("span",{className:"ds-reg-meta min-w-0 truncate font-mono text-xs text-text-muted",children:a.user_id})]}),j&&e.jsx("div",{className:"ds-reg-aside",children:e.jsxs(ee,{children:[e.jsx(te,{asChild:!0,children:e.jsx("button",{type:"button",disabled:!N,className:"rounded p-1 text-text-muted transition-colors hover:bg-surface-1 hover:text-text-primary disabled:opacity-40 disabled:hover:bg-transparent","aria-label":t("team.member.changeRole"),title:t("team.member.changeRole"),children:e.jsx(ae,{className:"h-4 w-4"})})}),e.jsxs(se,{align:"end",className:"w-48",children:[e.jsx(ne,{className:"text-xs text-text-muted",children:t("team.member.changeRole")}),R.map(o=>e.jsxs(H,{onSelect:()=>L(a,o),className:"flex items-center justify-between",children:[e.jsx("span",{children:B(o)}),a.role===o&&e.jsx(z,{className:"h-3.5 w-3.5 text-brand-text"})]},o)),e.jsx(re,{}),e.jsxs(H,{variant:"destructive",disabled:!$,onSelect:()=>s(a),className:"flex items-center gap-2",children:[e.jsx(ie,{className:"h-3.5 w-3.5"}),e.jsx("span",{children:t("team.member.remove")})]})]})]})})]},a.user_id)})})]}),e.jsx(be,{teamId:i.id,canManage:j}),e.jsx(he,{teamId:i.id,canManage:j})]})}export{Se as TeamDetail};
11
+ */const xe=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],ue=z("user-plus",xe);function W(n){const[x,i]=r.useState([]),[k,v]=r.useState(!1),l=r.useCallback(async()=>{if(n){v(!0);try{const p=await T("GET",`/web/teams/${n}/members`);i(p)}catch{i([])}finally{v(!1)}}},[n]);r.useEffect(()=>{l()},[l]);const b=r.useCallback(async(p,y)=>{await T("POST",`/web/teams/${n}/members`,{userId:p,role:y}),await l()},[n,l]),u=r.useCallback(async p=>{await T("DELETE",`/web/teams/${n}/members/${p}`),await l()},[n,l]),d=r.useCallback(async(p,y)=>{await T("PATCH",`/web/teams/${n}/members/${p}`,{role:y}),await l()},[n,l]);return{members:x,isLoading:k,addMember:b,removeMember:u,updateRole:d,refetch:l}}function pe(n){const[x,i]=r.useState([]),k=r.useCallback(async l=>{if(!n)return null;const b=await T("POST",`/web/teams/${n}/invitations`,l);return i(u=>[...u,b]),b},[n]),v=r.useCallback(async l=>{n&&(await T("DELETE",`/web/teams/${n}/invitations/${l}`),i(b=>b.filter(u=>u.token!==l)))},[n]);return{invitations:x,createInvitation:k,revokeInvitation:v}}function he({teamId:n,canManage:x}){M();const{invitations:i,createInvitation:k,revokeInvitation:v}=pe(n),{addMember:l}=W(n),[b,u]=r.useState(!1),[d,p]=r.useState(null),[y,C]=r.useState("member"),[m,w]=r.useState(!1),[g,f]=r.useState("member"),[j,_]=r.useState(null),[A,L]=r.useState(!1),[s,a]=r.useState(!1),[c,h]=r.useState(!1),N=async()=>{u(!0);try{const o=await k({role:y,expiresIn:86400,maxUses:5});o&&p(o.token||o.inviteToken||null)}catch{}finally{u(!1)}},$=async()=>{if(!d)return;const o=`${window.location.origin}/join?invite=${d}`;let S=!1;try{navigator.clipboard&&window.isSecureContext&&(await navigator.clipboard.writeText(o),S=!0)}catch{}if(!S){const E=document.createElement("textarea");E.value=o,E.style.position="fixed",E.style.top="0",E.style.opacity="0",document.body.appendChild(E),E.focus(),E.select(),E.setSelectionRange(0,o.length);try{S=document.execCommand("copy")}catch{S=!1}document.body.removeChild(E)}S?(h(!1),a(!0),setTimeout(()=>a(!1),2e3)):(a(!1),h(!0),setTimeout(()=>h(!1),4e3))},R=async o=>{L(!0),_(null);try{await l(o,g),w(!1)}catch(S){_(S instanceof Error?S.message:t("invitation.addFailed"))}finally{L(!1)}};return e.jsxs("section",{className:"ds-page-row",children:[e.jsx("h2",{children:t("team.detail.invitations")}),x&&e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("select",{className:"rounded-md border border-border bg-surface-2 px-2.5 py-1.5 text-xs text-text-primary focus:border-accent focus:outline-none",value:y,onChange:o=>C(o.target.value),"aria-label":t("team.member.role"),children:[e.jsx("option",{value:"member",children:t("invitation.member")}),e.jsx("option",{value:"admin",children:t("invitation.admin")})]}),e.jsx("button",{type:"button",onClick:N,disabled:b,className:"inline-flex items-center rounded-md border border-border px-3 py-1.5 text-xs font-medium text-text-primary transition-colors hover:bg-surface-2 disabled:opacity-40",children:b?t("invitation.creating"):t("invitation.create")}),e.jsxs("button",{type:"button",onClick:()=>w(o=>!o),"aria-pressed":m,className:"inline-flex items-center gap-1.5 rounded-md border border-border px-3 py-1.5 text-xs font-medium text-text-primary transition-colors hover:bg-surface-2",title:t("invitation.addExistingHint"),children:[e.jsx(ue,{className:"h-3.5 w-3.5"}),t("invitation.addExisting")]})]}),d&&e.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-border bg-surface-1 px-3 py-2",children:[e.jsx("code",{className:"min-w-0 flex-1 truncate font-mono text-xs text-text-primary",children:`${window.location.origin}/join?invite=${d}`}),e.jsx("button",{type:"button",onClick:$,className:s?"text-status-active":"text-text-muted hover:text-text-primary",title:s?t("share.copied"):t("share.copy"),children:s?e.jsx(B,{className:"h-4 w-4"}):e.jsx(D,{className:"h-4 w-4"})}),e.jsx("button",{type:"button",onClick:()=>p(null),className:"text-text-muted hover:text-text-primary","aria-label":t("common.cancel"),children:e.jsx(F,{className:"h-4 w-4"})})]}),c&&e.jsx("p",{className:"text-xs text-status-error",children:t("share.copyFailed")}),m&&x&&e.jsxs("div",{className:"space-y-3 rounded-md border border-border bg-surface-1 p-3",children:[e.jsx("p",{className:"text-xs text-text-muted",children:t("invitation.addExistingHint")}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs("select",{className:"rounded-md border border-border bg-surface-2 px-2 py-1.5 text-sm text-text-primary focus:border-accent focus:outline-none",value:g,onChange:o=>f(o.target.value),"aria-label":t("team.member.role"),children:[e.jsx("option",{value:"member",children:t("invitation.member")}),e.jsx("option",{value:"admin",children:t("invitation.admin")})]})}),j&&e.jsx("p",{className:"text-xs text-destructive",children:j}),e.jsx(le,{onSelect:R,actionDisabled:A,placeholder:t("invitation.searchUser")})]}),i.length===0?e.jsx(U,{title:t("invitation.emptyTitle"),hint:t("invitation.emptyHint")}):e.jsx("div",{className:"ds-reg",children:i.map(o=>e.jsxs("div",{className:"ds-reg-row group",children:[e.jsxs("div",{className:"ds-reg-main",children:[e.jsx("span",{className:"ds-reg-tag shrink-0 rounded-full border border-border/60 bg-surface-2 text-text-muted",children:o.role==="admin"?t("invitation.admin"):t("invitation.member")}),e.jsx("span",{className:"ds-reg-meta truncate font-mono text-xs text-text-muted",children:G("invitation.expires",{date:new Date(o.expiresAt).toLocaleDateString()})})]}),x&&e.jsx("div",{className:"ds-reg-aside",children:e.jsx("button",{type:"button",onClick:()=>v(o.token),className:"ds-reg-delete rounded p-1 text-text-muted opacity-0 transition-all hover:text-status-error group-hover:opacity-100 focus-visible:opacity-100",title:t("invitation.revoke"),"aria-label":t("invitation.revoke"),children:e.jsx(F,{className:"h-4 w-4"})})})]},o.token))})]})}function be({teamId:n,canManage:x}){M();const[i,k]=r.useState([]),[v,l]=r.useState(!0),[b,u]=r.useState(null),[d,p]=r.useState(""),[y,C]=r.useState(null),[m,w]=r.useState(!1),g=async()=>{try{const s=await X();k(s||[])}catch(s){u(s instanceof Error?s.message:t("team.detail.loadEnvsFailed"))}finally{l(!1)}};r.useEffect(()=>{g()},[]);const f=r.useMemo(()=>i.filter(s=>s.team_id===n),[i,n]),j=r.useMemo(()=>i.filter(s=>!s.team_id),[i]),_=async()=>{if(d){C(null);try{await J(d,n),p(""),await g()}catch(s){C(s instanceof Error?s.message:t("team.detail.linkFailed"))}}},A=async s=>{if(window.confirm(t("team.detail.unlinkConfirm"))){C(null);try{await Y(n,s),await g()}catch(a){C(a instanceof Error?a.message:t("team.detail.unlinkFailed"))}}},L=async()=>{const s=`slz rc --team-id ${n}`;try{if(navigator.clipboard&&window.isSecureContext){await navigator.clipboard.writeText(s),w(!0),setTimeout(()=>w(!1),2e3);return}}catch{}const a=document.createElement("textarea");a.value=s,a.style.position="fixed",a.style.opacity="0",document.body.appendChild(a),a.select();try{document.execCommand("copy"),w(!0),setTimeout(()=>w(!1),2e3)}catch{}document.body.removeChild(a)};return e.jsxs("section",{className:"ds-page-row",children:[e.jsx("h2",{children:t("team.detail.environments")}),v?e.jsx("p",{className:"text-sm text-text-muted",children:t("common.loading")}):b?e.jsx("p",{className:"text-sm text-status-error",children:b}):e.jsxs(e.Fragment,{children:[f.length===0?e.jsx(U,{title:t("team.detail.envsEmptyTitle"),hint:t("team.detail.envsEmptyHint")}):e.jsx("div",{className:"ds-reg",children:f.map(s=>{var N,$;const a=ce(s.worker_type),c=((N=s.directory)==null?void 0:N.trim())||null,h=(($=s.owner_username)==null?void 0:$.trim())||null;return e.jsxs("div",{className:"ds-reg-row group",children:[e.jsxs("div",{className:"ds-reg-main",children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"min-w-0 truncate text-sm font-medium text-text-primary",children:s.machine_name||s.id}),e.jsx("span",{className:I("ds-reg-tag rounded-full",a.colorClass),children:a.fullLabel}),e.jsx(oe,{status:s.status,className:"ds-reg-tag"})]}),(c||h)&&e.jsxs("span",{className:"ds-reg-meta flex min-w-0 items-center gap-1.5 text-xs text-text-muted",children:[c&&e.jsx("span",{className:"min-w-0 truncate font-mono",children:c}),c&&h&&e.jsx("span",{className:"ds-reg-fact-sep","aria-hidden":"true",children:"·"}),h&&e.jsxs("span",{className:"ds-reg-owner",title:`${t("dashboard.envOwner")}: ${h}`,children:[e.jsx(K,{className:"h-3 w-3","aria-hidden":"true"}),e.jsx("span",{className:"min-w-0 truncate",children:h})]})]})]}),e.jsxs("div",{className:"ds-reg-aside",children:[e.jsx("span",{className:"col-start-2 whitespace-nowrap font-mono text-xs tabular-nums text-text-muted",children:Q(s.created_at)}),x&&e.jsx("button",{type:"button",onClick:()=>A(s.id),className:"ds-reg-delete rounded p-1 text-text-muted opacity-0 transition-all hover:text-status-error group-hover:opacity-100 focus-visible:opacity-100",title:t("team.detail.unlink"),"aria-label":t("team.detail.unlink"),children:e.jsx(me,{className:"h-4 w-4"})})]})]},s.id)})}),x&&e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("span",{className:"text-xs text-text-muted",children:t("team.detail.registerHint")}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("code",{className:"rounded-md border border-border bg-surface-2 px-3 py-1.5 font-mono text-xs text-text-primary",children:["slz rc --team-id ",n]}),e.jsx("button",{type:"button",onClick:L,className:"text-text-muted transition-colors hover:text-text-primary","aria-label":t("team.detail.copyCommand"),title:t("team.detail.copyCommand"),children:e.jsx(D,{className:"h-3.5 w-3.5"})}),m&&e.jsx("span",{className:"text-xs text-status-active",children:t("share.copied")})]})]}),j.length>0&&e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{htmlFor:"team-link-env",className:"text-xs text-text-muted",children:t("team.detail.linkHint")}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("select",{id:"team-link-env",value:d,onChange:s=>p(s.target.value),className:"max-w-md rounded-md border border-border bg-surface-2 px-2.5 py-1.5 text-xs text-text-primary focus:border-accent focus:outline-none",children:[e.jsx("option",{value:"",children:t("team.detail.linkSelect")}),j.map(s=>e.jsx("option",{value:s.id,children:s.machine_name||s.id},s.id))]}),e.jsx("button",{type:"button",onClick:_,disabled:!d,className:"inline-flex items-center rounded-md border border-border px-3 py-1.5 text-xs font-medium text-text-primary transition-colors hover:bg-surface-2 disabled:opacity-40",children:t("team.detail.link")})]})]})]}),y&&e.jsx("p",{className:"text-sm text-status-error",children:y})]})]})}async function fe(n){try{const x=n.startsWith("team_")?`/web/teams/${n}`:`/web/teams/by-slug/${n}`;return await T("GET",x)}catch{return null}}const ye={owner:"team.member.roleOwner",admin:"team.member.roleAdmin",member:"team.member.roleMember"},P={owner:"border-brand/30 bg-brand/10 text-brand-text",admin:"border-accent/30 bg-accent/10 text-accent",member:"border-border/60 bg-surface-2 text-text-muted"};function q(n){return t(ye[n]||"team.member.roleMember")}function Se(){M();const n=window.location.pathname.split("/"),x=n[n.length-1]||"",[i,k]=r.useState(null),[v,l]=r.useState(!0),[b,u]=r.useState(!1),{members:d,isLoading:p,updateRole:y,removeMember:C}=W((i==null?void 0:i.id)||null),{user:m}=V(),[w,g]=r.useState("");if(r.useEffect(()=>{x&&(l(!0),fe(x).then(a=>{k(a),l(!1)}))},[x]),v)return e.jsx("div",{className:"ds-page text-sm text-text-muted",children:t("common.loading")});if(!i)return e.jsxs("div",{className:"ds-page",children:[e.jsx("div",{className:"ds-page-head",children:e.jsxs("a",{href:"/teams",className:"ds-page-back",children:[e.jsx(O,{className:"h-3.5 w-3.5"}),t("team.detail.back")]})}),e.jsx("p",{className:"text-sm text-text-muted",children:t("team.detail.notFound")})]});const f=d.find(a=>a.user_id===(m==null?void 0:m.userId)),j=(m==null?void 0:m.role)==="admin"||(f==null?void 0:f.role)==="owner"||(f==null?void 0:f.role)==="admin",_=(m==null?void 0:m.role)==="admin"||(f==null?void 0:f.role)==="owner",A=async()=>{const a=i.id;try{if(navigator.clipboard&&window.isSecureContext){await navigator.clipboard.writeText(a),u(!0),setTimeout(()=>u(!1),2e3);return}}catch{}const c=document.createElement("textarea");c.value=a,c.style.position="fixed",c.style.opacity="0",document.body.appendChild(c),c.select();try{document.execCommand("copy"),u(!0),setTimeout(()=>u(!1),2e3)}catch{}document.body.removeChild(c)},L=async(a,c)=>{if(a.role!==c){g("");try{await y(a.user_id,c)}catch(h){g(h instanceof Error?h.message:t("team.member.updateFailed"))}}},s=async a=>{const c=a.username||a.user_id;if(window.confirm(t("team.member.removeConfirm").replace("{name}",c))){g("");try{await C(a.user_id)}catch(N){g(N instanceof Error?N.message:t("team.member.updateFailed"))}}};return e.jsxs("div",{className:"ds-page",children:[e.jsxs("header",{className:"ds-page-head ds-page-head--display hero-enter",children:[e.jsx("div",{className:"ds-page-runhead",children:e.jsx("span",{className:"ds-page-runhead-label",children:t("team.list.kicker")})}),e.jsxs("div",{className:"ds-page-titlerow",children:[e.jsx("h1",{className:"ds-page-title font-display font-semibold tracking-tight text-text-primary",children:i.name}),e.jsx("span",{className:"ds-page-count",children:G("team.detail.memberCount",{n:d.length})})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("span",{className:"font-mono text-xs text-text-muted",children:["/",i.slug]}),e.jsx("span",{className:"font-mono text-xs text-text-muted","aria-hidden":"true",children:"·"}),e.jsx("code",{className:"font-mono text-xs text-text-muted",children:i.id}),e.jsx("button",{type:"button",onClick:A,className:"text-text-muted transition-colors hover:text-text-primary","aria-label":t("team.detail.copyId"),title:t("team.detail.copyId"),children:e.jsx(D,{className:"h-3.5 w-3.5"})}),b&&e.jsx("span",{className:"text-xs text-status-active",children:t("share.copied")}),j&&e.jsx("a",{href:`/teams/${i.slug}/settings`,className:"ml-1 text-text-muted transition-colors hover:text-text-primary","aria-label":t("team.settings.title"),title:t("team.settings.title"),children:e.jsx(Z,{className:"h-4 w-4"})}),e.jsx("a",{href:"/teams",className:"text-text-muted transition-colors hover:text-text-primary","aria-label":t("team.detail.back"),title:t("team.detail.back"),children:e.jsx(O,{className:"h-4 w-4"})})]}),i.description&&e.jsx("p",{className:"ds-page-lede",children:i.description})]}),e.jsxs("section",{className:"ds-page-row hero-enter-late",children:[e.jsx("h2",{children:t("team.detail.members")}),w&&e.jsx("p",{className:"text-sm text-status-error",children:w}),p?e.jsx("p",{className:"text-sm text-text-muted",children:t("common.loading")}):d.length===0?e.jsx(U,{title:t("team.detail.membersEmptyTitle"),hint:t("team.detail.membersEmptyHint")}):e.jsx("div",{className:"ds-reg",children:d.map(a=>{const c=a.user_id===(m==null?void 0:m.userId),h=a.role==="owner"||a.role==="admin",N=j&&(!h||_),$=N&&!(a.role==="owner"&&d.filter(o=>o.role==="owner").length<=1),R=["owner","admin","member"];return e.jsxs("div",{className:"ds-reg-row",children:[e.jsxs("div",{className:"ds-reg-main",children:[e.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:"min-w-0 truncate text-sm font-medium text-text-primary",children:a.username||a.user_id}),c&&e.jsx("span",{className:"shrink-0 text-xs text-text-muted",children:t("team.member.you")}),e.jsx("span",{className:I("ds-reg-tag shrink-0 rounded-full border",P[a.role]||P.member),children:q(a.role)})]}),e.jsx("span",{className:"ds-reg-meta min-w-0 truncate font-mono text-xs text-text-muted",children:a.user_id})]}),j&&e.jsx("div",{className:"ds-reg-aside",children:e.jsxs(ee,{children:[e.jsx(te,{asChild:!0,children:e.jsx("button",{type:"button",disabled:!N,className:"rounded p-1 text-text-muted transition-colors hover:bg-surface-1 hover:text-text-primary disabled:opacity-40 disabled:hover:bg-transparent","aria-label":t("team.member.changeRole"),title:t("team.member.changeRole"),children:e.jsx(ae,{className:"h-4 w-4"})})}),e.jsxs(se,{align:"end",className:"w-48",children:[e.jsx(ne,{className:"text-xs text-text-muted",children:t("team.member.changeRole")}),R.map(o=>e.jsxs(H,{onSelect:()=>L(a,o),className:"flex items-center justify-between",children:[e.jsx("span",{children:q(o)}),a.role===o&&e.jsx(B,{className:"h-3.5 w-3.5 text-brand-text"})]},o)),e.jsx(re,{}),e.jsxs(H,{variant:"destructive",disabled:!$,onSelect:()=>s(a),className:"flex items-center gap-2",children:[e.jsx(ie,{className:"h-3.5 w-3.5"}),e.jsx("span",{children:t("team.member.remove")})]})]})]})})]},a.user_id)})})]}),e.jsx(be,{teamId:i.id,canManage:j}),e.jsx(he,{teamId:i.id,canManage:j})]})}export{Se as TeamDetail};
@@ -0,0 +1 @@
1
+ import{e as c,j as e}from"./vendor-DE_-CLIE.js";import{ba as b,bb as v,b4 as a,b9 as C,b5 as f,a0 as D,a8 as S}from"./main-CDaRKeiT.js";import{D as E,a as T,e as k}from"./dialog-DnbWz68R.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";function L({open:d,onClose:n,onCreated:m}){b();const{createTeam:N}=v(),[l,u]=c.useState(""),[i,o]=c.useState(""),[x,p]=c.useState(""),[s,r]=c.useState(""),[h,j]=c.useState(!1);c.useEffect(()=>{d&&(u(""),o(""),p(""),r(""),j(!1))},[d]);const w=t=>{u(t),i||o(t.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-"))},y=async t=>{t.preventDefault(),r(""),j(!0);try{const g=await N({name:l,slug:i,description:x||void 0});m(g)}catch(g){r(g instanceof Error?g.message:a("team.create.failed"))}finally{j(!1)}};return e.jsx(E,{open:d,onOpenChange:t=>{t||n()},children:e.jsx(T,{className:"nsd-shell max-w-md",children:e.jsxs("form",{className:"nsd-box nsd-box--single",onSubmit:y,children:[e.jsx(k,{className:"nsd-h",children:a("team.create.title")}),e.jsxs("label",{className:"nsd-field",children:[e.jsx("span",{className:"nsd-lab",children:a("team.create.name")}),e.jsx("input",{type:"text",required:!0,value:l,onChange:t=>w(t.target.value),placeholder:"Engineering",className:"nsd-title"}),e.jsx("span",{className:"text-xs text-text-muted",children:a("team.create.nameHint")})]}),e.jsxs("label",{className:"nsd-field",children:[e.jsx("span",{className:"nsd-lab",children:a("team.create.slug")}),e.jsx("input",{type:"text",required:!0,value:i,onChange:t=>o(t.target.value),pattern:"^[a-z0-9-]{3,32}$",placeholder:"engineering",className:"nsd-title"}),e.jsx("span",{className:"text-xs text-text-muted",children:a("team.create.slugHint")})]}),e.jsxs("label",{className:"nsd-field",children:[e.jsx("span",{className:"nsd-lab",children:a("team.create.description")}),e.jsx("textarea",{value:x,onChange:t=>p(t.target.value),rows:3,className:"nsd-title nsd-area"})]}),s&&e.jsx("p",{className:"nsd-error",children:s}),e.jsxs("div",{className:"nsd-foot",children:[e.jsx("button",{type:"button",onClick:n,className:"nsd-cancel",children:a("common.cancel")}),e.jsx("button",{type:"submit",disabled:h||!l||!i,className:"btn-ticket nsd-create",children:h?a("common.creating"):a("team.create.submit")})]})]})})})}function z(d,n){const m=new Date(d);return Number.isNaN(m.getTime())?"":new Intl.DateTimeFormat(n==="zh"?"zh-CN":"en-US",{year:"numeric",month:"short"}).format(m)}function I(){const d=b(),{myTeams:n,isLoading:m,refetch:N}=v(),{user:l}=C(),[u,i]=c.useState(!1),o=s=>{i(!1),window.history.pushState(null,"",`/teams/${s.slug}`),window.dispatchEvent(new PopStateEvent("popstate"))},x=s=>(l==null?void 0:l.role)==="admin"||s.created_by===(l==null?void 0:l.userId),p=async s=>{if(window.confirm(f("team.list.deleteConfirm",{name:s.name})))try{await S("DELETE",`/web/teams/${s.id}`),await N()}catch(r){alert(r instanceof Error?r.message:a("team.list.deleteFailed"))}};return m?e.jsxs("div",{className:"ds-page",children:[e.jsxs("header",{className:"ds-page-head",children:[e.jsx("div",{className:"ds-page-runhead",children:e.jsx("div",{className:"h-2.5 w-20 animate-pulse rounded bg-surface-2"})}),e.jsxs("div",{className:"ds-page-titlerow",children:[e.jsx("div",{className:"h-12 w-44 animate-pulse rounded bg-surface-2"}),e.jsxs("div",{className:"ds-page-titlerow-end",children:[e.jsx("div",{className:"h-2.5 w-14 animate-pulse rounded bg-surface-2"}),e.jsx("div",{className:"h-7 w-24 animate-pulse rounded-sm bg-surface-2"})]})]}),e.jsx("div",{className:"h-4 w-72 animate-pulse rounded bg-surface-2"})]}),e.jsx("div",{className:"space-y-10",children:[0,1,2].map(s=>e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"h-6 w-48 animate-pulse rounded bg-surface-2"}),e.jsx("div",{className:"h-4 w-32 animate-pulse rounded bg-surface-2"})]},s))})]}):e.jsxs("div",{className:"ds-page",children:[e.jsxs("header",{className:"ds-page-head ds-page-head--display hero-enter",children:[e.jsx("div",{className:"ds-page-runhead",children:e.jsx("span",{className:"ds-page-runhead-label",children:a("team.list.kicker")})}),e.jsxs("div",{className:"ds-page-titlerow",children:[e.jsx("h1",{className:"ds-page-title font-display font-semibold tracking-tight text-text-primary",children:a("team.list.title")}),e.jsxs("div",{className:"ds-page-titlerow-end",children:[n.length>0&&e.jsx("span",{className:"ds-page-count",children:f("team.list.count",{n:n.length})}),e.jsx("button",{type:"button",onClick:()=>i(!0),className:"btn-ticket",children:a("team.list.create")})]})]}),e.jsx("p",{className:"ds-page-lede",children:n.length===0?a("team.list.empty"):a("team.list.lede")})]}),n.length>0&&e.jsx("ul",{className:"space-y-10 hero-enter-late",children:n.map((s,r)=>{const h=z(s.created_at,d);return e.jsxs("li",{className:"ds-team-item group",children:[e.jsxs("a",{href:`/teams/${s.slug}`,className:"ds-team-link",children:[e.jsxs("div",{className:"ds-team-name",children:[e.jsx("span",{className:"ds-team-idx","aria-hidden":"true",children:String(r+1).padStart(2,"0")}),e.jsx("h2",{className:"font-display text-lg font-medium tracking-tight text-text-primary transition-colors group-hover:text-accent",children:s.name}),e.jsxs("span",{className:"font-mono text-xs text-text-muted",children:["/",s.slug]})]}),s.description?e.jsx("p",{className:"mt-2 max-w-2xl text-sm leading-relaxed text-text-muted",children:s.description}):e.jsx("p",{className:"mt-2 text-sm italic text-text-muted/60",children:a("team.list.noDescription")})]}),e.jsxs("div",{className:"ds-team-aside",children:[h&&e.jsxs("span",{className:"ds-team-date",children:[a("team.list.founded")," ",h]}),x(s)&&e.jsx("button",{type:"button",onClick:()=>p(s),className:"ds-team-delete rounded p-1 text-text-muted opacity-0 transition-all hover:text-status-error group-hover:opacity-100 focus-visible:opacity-100",title:a("team.list.delete"),"aria-label":a("team.list.delete"),children:e.jsx(D,{className:"h-4 w-4"})})]})]},s.id)})}),e.jsx(L,{open:u,onClose:()=>i(!1),onCreated:o})]})}export{I as TeamList};
@@ -1 +1 @@
1
- import{e as n,j as e}from"./vendor-DE_-CLIE.js";import{a0 as c}from"./main-BAO6US1o.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";async function y(s){try{const r=s.startsWith("team_")?`/web/teams/${s}`:`/web/teams/by-slug/${s}`;return await c("GET",r)}catch{return null}}async function w(s,r){await c("PATCH",`/web/teams/${s}`,r)}async function N(s){await c("DELETE",`/web/teams/${s}`)}function C(){const s=window.location.pathname.split("/"),r=s[s.length-2]||"",[a,f]=n.useState(null),[b,g]=n.useState(!0),[i,d]=n.useState(""),[l,m]=n.useState(""),[u,o]=n.useState(null),[x,h]=n.useState(!1);n.useEffect(()=>{r&&y(r).then(t=>{t&&(f(t),d(t.name),m(t.description||"")),g(!1)})},[r]);const v=async t=>{if(t.preventDefault(),!!a){o(null),h(!0);try{await w(a.id,{name:i,description:l}),window.location.href=`/teams/${a.slug}`}catch(p){o(p instanceof Error?p.message:"Failed to update")}finally{h(!1)}}},j=async()=>{if(a&&window.confirm("Delete this team? Environments must be transferred first."))try{await N(a.id),window.location.href="/teams"}catch(t){o(t instanceof Error?t.message:"Failed to delete")}};return b?e.jsx("div",{className:"ds-page text-text-muted",children:"Loading..."}):a?e.jsx("div",{className:"ds-page",children:e.jsxs("div",{children:[e.jsxs("header",{className:"ds-page-head ds-page-head--display hero-enter",children:[e.jsx("div",{className:"ds-page-titlerow",children:e.jsx("h1",{className:"ds-page-title text-text-primary",children:a.name})}),e.jsx("p",{className:"ds-page-sub",children:e.jsxs("span",{className:"font-mono text-xs",children:["/",a.slug]})})]}),e.jsxs("form",{onSubmit:v,className:"hero-enter-late mb-16 max-w-md space-y-8",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"name",className:"block text-sm font-medium text-text-primary mb-2",children:"Team Name"}),e.jsx("input",{id:"name",type:"text",required:!0,value:i,onChange:t=>d(t.target.value),className:"w-full rounded-md border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary focus:border-accent focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"description",className:"block text-sm font-medium text-text-primary mb-2",children:"Description"}),e.jsx("textarea",{id:"description",value:l,onChange:t=>m(t.target.value),className:"w-full rounded-md border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary focus:border-accent focus:outline-none",rows:3})]}),u&&e.jsx("p",{className:"text-sm text-destructive",children:u}),e.jsxs("div",{className:"flex gap-3 pt-2",children:[e.jsx("button",{type:"button",onClick:()=>window.history.back(),className:"rounded-md border border-border px-4 py-2 text-sm text-text-primary hover:bg-surface-2 transition-colors",children:"Cancel"}),e.jsx("button",{type:"submit",disabled:x||!i,className:"rounded-md bg-accent px-4 py-2 text-sm font-medium text-white hover:bg-accent/90 disabled:opacity-50 transition-colors",children:x?"Saving...":"Save Changes"})]})]}),e.jsxs("section",{className:"hero-enter-late",children:[e.jsx("h2",{className:"mb-3 text-sm font-medium text-destructive",children:"Delete team"}),e.jsx("p",{className:"mb-4 text-sm text-text-muted",children:"Deleting a team requires all environments to be transferred first."}),e.jsx("button",{type:"button",onClick:j,className:"rounded-md border border-destructive/60 px-4 py-2 text-sm font-medium text-destructive hover:bg-destructive/10 transition-colors",children:"Delete Team"})]})]})}):e.jsx("div",{className:"ds-page",children:e.jsxs("div",{className:"max-w-lg",children:[e.jsx("p",{className:"text-text-muted",children:"Team not found."}),e.jsx("a",{href:"/teams",className:"text-accent hover:underline",children:"Back to teams"})]})})}export{C as TeamSettings};
1
+ import{e as n,j as e}from"./vendor-DE_-CLIE.js";import{a8 as c}from"./main-CDaRKeiT.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";async function y(s){try{const r=s.startsWith("team_")?`/web/teams/${s}`:`/web/teams/by-slug/${s}`;return await c("GET",r)}catch{return null}}async function w(s,r){await c("PATCH",`/web/teams/${s}`,r)}async function N(s){await c("DELETE",`/web/teams/${s}`)}function C(){const s=window.location.pathname.split("/"),r=s[s.length-2]||"",[a,f]=n.useState(null),[b,g]=n.useState(!0),[i,d]=n.useState(""),[l,m]=n.useState(""),[u,o]=n.useState(null),[x,h]=n.useState(!1);n.useEffect(()=>{r&&y(r).then(t=>{t&&(f(t),d(t.name),m(t.description||"")),g(!1)})},[r]);const v=async t=>{if(t.preventDefault(),!!a){o(null),h(!0);try{await w(a.id,{name:i,description:l}),window.location.href=`/teams/${a.slug}`}catch(p){o(p instanceof Error?p.message:"Failed to update")}finally{h(!1)}}},j=async()=>{if(a&&window.confirm("Delete this team? Environments must be transferred first."))try{await N(a.id),window.location.href="/teams"}catch(t){o(t instanceof Error?t.message:"Failed to delete")}};return b?e.jsx("div",{className:"ds-page text-text-muted",children:"Loading..."}):a?e.jsx("div",{className:"ds-page",children:e.jsxs("div",{children:[e.jsxs("header",{className:"ds-page-head ds-page-head--display hero-enter",children:[e.jsx("div",{className:"ds-page-titlerow",children:e.jsx("h1",{className:"ds-page-title text-text-primary",children:a.name})}),e.jsx("p",{className:"ds-page-sub",children:e.jsxs("span",{className:"font-mono text-xs",children:["/",a.slug]})})]}),e.jsxs("form",{onSubmit:v,className:"hero-enter-late mb-16 max-w-md space-y-8",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"name",className:"block text-sm font-medium text-text-primary mb-2",children:"Team Name"}),e.jsx("input",{id:"name",type:"text",required:!0,value:i,onChange:t=>d(t.target.value),className:"w-full rounded-md border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary focus:border-accent focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"description",className:"block text-sm font-medium text-text-primary mb-2",children:"Description"}),e.jsx("textarea",{id:"description",value:l,onChange:t=>m(t.target.value),className:"w-full rounded-md border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary focus:border-accent focus:outline-none",rows:3})]}),u&&e.jsx("p",{className:"text-sm text-destructive",children:u}),e.jsxs("div",{className:"flex gap-3 pt-2",children:[e.jsx("button",{type:"button",onClick:()=>window.history.back(),className:"rounded-md border border-border px-4 py-2 text-sm text-text-primary hover:bg-surface-2 transition-colors",children:"Cancel"}),e.jsx("button",{type:"submit",disabled:x||!i,className:"rounded-md bg-accent px-4 py-2 text-sm font-medium text-white hover:bg-accent/90 disabled:opacity-50 transition-colors",children:x?"Saving...":"Save Changes"})]})]}),e.jsxs("section",{className:"hero-enter-late",children:[e.jsx("h2",{className:"mb-3 text-sm font-medium text-destructive",children:"Delete team"}),e.jsx("p",{className:"mb-4 text-sm text-text-muted",children:"Deleting a team requires all environments to be transferred first."}),e.jsx("button",{type:"button",onClick:j,className:"rounded-md border border-destructive/60 px-4 py-2 text-sm font-medium text-destructive hover:bg-destructive/10 transition-colors",children:"Delete Team"})]})]})}):e.jsx("div",{className:"ds-page",children:e.jsxs("div",{className:"max-w-lg",children:[e.jsx("p",{className:"text-text-muted",children:"Team not found."}),e.jsx("a",{href:"/teams",className:"text-accent hover:underline",children:"Back to teams"})]})})}export{C as TeamSettings};
@@ -1,6 +1,6 @@
1
- import{aG as v,b0 as w,aW as o,a0 as S}from"./main-BAO6US1o.js";import{e as a,j as t}from"./vendor-DE_-CLIE.js";/**
1
+ import{aQ as v,ba as w,b4 as o,a8 as S}from"./main-CDaRKeiT.js";import{e as a,j as t}from"./vendor-DE_-CLIE.js";/**
2
2
  * @license lucide-react v0.555.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const U=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],E=v("arrow-left",U);function I({onSelect:l,excludeUserIds:x=[],placeholder:u,actionLabel:m,actionDisabled:h=!1,className:p}){w();const[n,c]=a.useState(""),[f,s]=a.useState([]),[d,i]=a.useState(!1),b=async e=>{if(c(e),e.trim().length<2){s([]);return}i(!0);try{const N=await S("GET",`/web/users/search?q=${encodeURIComponent(e.trim())}`);s(N)}catch{s([])}finally{i(!1)}},y=e=>{l(e),c(""),s([])},r=f.filter(e=>!x.includes(e.id)),g=m??o("invitation.add"),j=u??o("invitation.searchUser");return t.jsxs("div",{className:p,children:[t.jsx("input",{type:"text",value:n,onChange:e=>b(e.target.value),placeholder:j,className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"}),d&&t.jsx("p",{className:"mt-1 text-xs text-text-muted",children:"Searching..."}),r.length>0&&t.jsx("ul",{className:"mt-2 divide-y divide-border rounded border border-border bg-surface-1",children:r.map(e=>t.jsxs("li",{className:"flex items-center justify-between px-3 py-2 text-sm",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"text-text-primary",children:e.username}),t.jsx("div",{className:"truncate font-mono text-xs text-text-muted",children:e.id})]}),t.jsx("button",{type:"button",onClick:()=>y(e.id),disabled:h,className:"rounded bg-accent px-2 py-1 text-xs text-white hover:bg-accent/90 disabled:opacity-50",children:g})]},e.id))}),n.trim().length>=2&&r.length===0&&!d&&t.jsx("p",{className:"mt-1 text-xs text-text-muted",children:"No users found."})]})}export{E as A,I as U};
6
+ */const U=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],E=v("arrow-left",U);function I({onSelect:l,excludeUserIds:x=[],placeholder:u,actionLabel:m,actionDisabled:h=!1,className:p}){w();const[n,c]=a.useState(""),[b,s]=a.useState([]),[d,i]=a.useState(!1),f=async e=>{if(c(e),e.trim().length<2){s([]);return}i(!0);try{const N=await S("GET",`/web/users/search?q=${encodeURIComponent(e.trim())}`);s(N)}catch{s([])}finally{i(!1)}},y=e=>{l(e),c(""),s([])},r=b.filter(e=>!x.includes(e.id)),g=m??o("invitation.add"),j=u??o("invitation.searchUser");return t.jsxs("div",{className:p,children:[t.jsx("input",{type:"text",value:n,onChange:e=>f(e.target.value),placeholder:j,className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"}),d&&t.jsx("p",{className:"mt-1 text-xs text-text-muted",children:"Searching..."}),r.length>0&&t.jsx("ul",{className:"mt-2 divide-y divide-border rounded border border-border bg-surface-1",children:r.map(e=>t.jsxs("li",{className:"flex items-center justify-between px-3 py-2 text-sm",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"text-text-primary",children:e.username}),t.jsx("div",{className:"truncate font-mono text-xs text-text-muted",children:e.id})]}),t.jsx("button",{type:"button",onClick:()=>y(e.id),disabled:h,className:"rounded bg-accent px-2 py-1 text-xs text-white hover:bg-accent/90 disabled:opacity-50",children:g})]},e.id))}),n.trim().length>=2&&r.length===0&&!d&&t.jsx("p",{className:"mt-1 text-xs text-text-muted",children:"No users found."})]})}export{E as A,I as U};
@@ -1 +1 @@
1
- import{e as n,j as e}from"./vendor-DE_-CLIE.js";import{a$ as U,b0 as X,aW as s,f as v,aV as W}from"./main-BAO6US1o.js";import{a as H,i as z,s as y}from"./notifications-D0Ro2M4C.js";import{C as J}from"./copy-CZDxZlFG.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";function Y(){const{user:i,logout:C}=U(),S=X(),[h,m]=n.useState(""),[o,p]=n.useState(""),[x,N]=n.useState(""),[g,f]=n.useState(""),[j,r]=n.useState(""),[P,c]=n.useState(!1),w=H(),[l,b]=n.useState(()=>z()),[E,k]=n.useState(()=>w&&Notification.permission==="denied"),[d,q]=n.useState(!1),D=async()=>{if(l){y(!1),b(!1);return}let t=!0;try{Notification.permission==="default"?t=await Notification.requestPermission()==="granted":t=Notification.permission==="granted"}catch{t=!1}k(!t),t&&(y(!0),b(!0))};if(!i)return null;const T=async()=>{const t=i.userId;try{if(navigator.clipboard&&window.isSecureContext){await navigator.clipboard.writeText(t),c(!0),setTimeout(()=>c(!1),2e3);return}}catch{}const a=document.createElement("textarea");a.value=t,a.style.position="fixed",a.style.opacity="0",document.body.appendChild(a),a.select();try{document.execCommand("copy"),c(!0),setTimeout(()=>c(!1),2e3)}catch{}document.body.removeChild(a)},O=async t=>{if(t.preventDefault(),r(""),f(""),o.length<8){r(s("auth.setup.passwordTooShort"));return}if(o!==x){r(s("auth.setup.passwordMismatch"));return}try{const a=await fetch("/web/auth/change-password",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"},body:JSON.stringify({currentPassword:h,newPassword:o})});if(!a.ok){const u=await a.json();throw new Error(u.error||s("user.settings.changeFailed"))}f(s("user.settings.passwordChanged")),m(""),p(""),N("")}catch(a){const u=a instanceof Error?a.message:s("user.settings.changeFailed");r(u)}},L=async()=>{try{if(!(await fetch("/web/auth/logout-all",{method:"POST",credentials:"include",headers:{"X-Requested-With":"XMLHttpRequest"}})).ok){r(s("common.error"));return}await C()}catch{r(s("common.error"))}},R=()=>e.jsxs(e.Fragment,{children:[e.jsx("code",{className:"uset-uid",children:i.userId}),e.jsx("button",{type:"button",onClick:T,className:"uset-ghost","aria-label":"Copy user ID",children:e.jsx(J,{className:"h-3.5 w-3.5"})}),P&&e.jsx("span",{className:"uset-copied",children:s("share.copied")})]}),F=()=>w?e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:D,className:"uset-ctl","aria-pressed":l,children:l?s("user.settings.notificationsOn"):s("user.settings.notificationsOff")}),e.jsx("p",{className:"uset-hint",children:s("user.settings.notificationsDesc")}),E&&e.jsx("p",{className:"uset-warn",children:s("user.settings.notificationsDenied")})]}):e.jsx("p",{className:"uset-hint",children:s("user.settings.notificationsUnsupported")}),I=()=>e.jsxs("span",{className:"uset-select",children:[e.jsxs("select",{value:S,onChange:t=>W(t.target.value),className:"uset-ctl uset-ctl--select",children:[e.jsx("option",{value:"zh",children:"中文"}),e.jsx("option",{value:"en",children:"English"})]}),e.jsx(v,{className:"uset-select-ico","aria-hidden":!0})]}),A=()=>e.jsxs("form",{onSubmit:O,className:"uset-form",children:[e.jsxs("label",{className:"uset-field",children:[e.jsx("span",{className:"uset-lab",children:s("user.settings.currentPassword")}),e.jsx("input",{type:"password",value:h,onChange:t=>m(t.target.value),required:!0,autoComplete:"current-password",className:"uset-in"})]}),e.jsxs("label",{className:"uset-field",children:[e.jsx("span",{className:"uset-lab",children:s("user.settings.newPassword")}),e.jsx("input",{type:"password",value:o,onChange:t=>p(t.target.value),required:!0,autoComplete:"new-password",className:"uset-in"})]}),e.jsxs("label",{className:"uset-field",children:[e.jsx("span",{className:"uset-lab",children:s("user.settings.confirmNewPassword")}),e.jsx("input",{type:"password",value:x,onChange:t=>N(t.target.value),required:!0,autoComplete:"new-password",className:"uset-in"})]}),j&&e.jsx("p",{className:"uset-err",children:j}),g&&e.jsx("p",{className:"uset-ok",children:g}),e.jsx("div",{className:"uset-actions",children:e.jsx("button",{type:"submit",className:"btn-ticket",children:s("user.settings.submit")})})]}),M=()=>e.jsx("button",{onClick:L,className:"uset-danger",children:s("user.settings.logoutAll")});return e.jsxs("div",{className:"uset",children:[e.jsxs("header",{className:"uset-head hero-enter",children:[e.jsx("h1",{className:"uset-name",children:i.username}),e.jsxs("div",{className:"uset-meta",children:[R(),e.jsx("span",{className:"uset-role",children:i.role})]})]}),e.jsxs("div",{className:"uset-body hero-enter-late",children:[e.jsxs("section",{className:"uset-sec",children:[e.jsx("div",{className:"uset-seclab",children:e.jsx("h2",{className:"uset-h",children:s("user.settings.notifications")})}),e.jsx("div",{className:"uset-secctl",children:F()})]}),e.jsxs("section",{className:"uset-sec",children:[e.jsx("div",{className:"uset-seclab",children:e.jsx("h2",{className:"uset-h",children:s("user.settings.language")})}),e.jsx("div",{className:"uset-secctl",children:I()})]}),e.jsxs("section",{className:"uset-sec uset-sec--wide",children:[e.jsx("h2",{className:"uset-h",children:e.jsxs("button",{type:"button",className:"uset-disclosure","aria-expanded":d,"aria-controls":"uset-password",onClick:()=>q(t=>!t),children:[e.jsx("span",{children:s("user.settings.changePassword")}),e.jsx(v,{className:"uset-chev","aria-hidden":!0})]})}),e.jsx("div",{id:"uset-password",className:"uset-reveal","data-open":d,children:e.jsx("div",{className:"uset-reveal-clip",inert:!d,children:e.jsx("div",{className:"uset-secctl",children:A()})})})]})]}),e.jsxs("footer",{className:"uset-foot hero-enter-late",children:[e.jsxs("div",{className:"uset-footlab",children:[e.jsx("h2",{className:"uset-dangerh",children:s("user.settings.logoutAll")}),e.jsx("p",{className:"uset-hint",children:"Revoke sessions on all devices."})]}),M()]})]})}export{Y as UserSettings};
1
+ import{e as n,j as e}from"./vendor-DE_-CLIE.js";import{b9 as U,ba as X,b4 as s,f as v,b3 as H}from"./main-CDaRKeiT.js";import{a as W,i as z,s as y}from"./notifications-Ms9MI-nO.js";import{C as J}from"./copy-LeFUX09K.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";function Z(){const{user:i,logout:C}=U(),S=X(),[h,m]=n.useState(""),[o,p]=n.useState(""),[x,N]=n.useState(""),[g,f]=n.useState(""),[j,r]=n.useState(""),[P,c]=n.useState(!1),w=W(),[l,b]=n.useState(()=>z()),[E,k]=n.useState(()=>w&&Notification.permission==="denied"),[d,q]=n.useState(!1),D=async()=>{if(l){y(!1),b(!1);return}let t=!0;try{Notification.permission==="default"?t=await Notification.requestPermission()==="granted":t=Notification.permission==="granted"}catch{t=!1}k(!t),t&&(y(!0),b(!0))};if(!i)return null;const T=async()=>{const t=i.userId;try{if(navigator.clipboard&&window.isSecureContext){await navigator.clipboard.writeText(t),c(!0),setTimeout(()=>c(!1),2e3);return}}catch{}const a=document.createElement("textarea");a.value=t,a.style.position="fixed",a.style.opacity="0",document.body.appendChild(a),a.select();try{document.execCommand("copy"),c(!0),setTimeout(()=>c(!1),2e3)}catch{}document.body.removeChild(a)},O=async t=>{if(t.preventDefault(),r(""),f(""),o.length<8){r(s("auth.setup.passwordTooShort"));return}if(o!==x){r(s("auth.setup.passwordMismatch"));return}try{const a=await fetch("/web/auth/change-password",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"},body:JSON.stringify({currentPassword:h,newPassword:o})});if(!a.ok){const u=await a.json();throw new Error(u.error||s("user.settings.changeFailed"))}f(s("user.settings.passwordChanged")),m(""),p(""),N("")}catch(a){const u=a instanceof Error?a.message:s("user.settings.changeFailed");r(u)}},L=async()=>{try{if(!(await fetch("/web/auth/logout-all",{method:"POST",credentials:"include",headers:{"X-Requested-With":"XMLHttpRequest"}})).ok){r(s("common.error"));return}await C()}catch{r(s("common.error"))}},R=()=>e.jsxs(e.Fragment,{children:[e.jsx("code",{className:"uset-uid",children:i.userId}),e.jsx("button",{type:"button",onClick:T,className:"uset-ghost","aria-label":"Copy user ID",children:e.jsx(J,{className:"h-3.5 w-3.5"})}),P&&e.jsx("span",{className:"uset-copied",children:s("share.copied")})]}),F=()=>w?e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:D,className:"uset-ctl","aria-pressed":l,children:l?s("user.settings.notificationsOn"):s("user.settings.notificationsOff")}),e.jsx("p",{className:"uset-hint",children:s("user.settings.notificationsDesc")}),E&&e.jsx("p",{className:"uset-warn",children:s("user.settings.notificationsDenied")})]}):e.jsx("p",{className:"uset-hint",children:s("user.settings.notificationsUnsupported")}),I=()=>e.jsxs("span",{className:"uset-select",children:[e.jsxs("select",{value:S,onChange:t=>H(t.target.value),className:"uset-ctl uset-ctl--select",children:[e.jsx("option",{value:"zh",children:"中文"}),e.jsx("option",{value:"en",children:"English"})]}),e.jsx(v,{className:"uset-select-ico","aria-hidden":!0})]}),A=()=>e.jsxs("form",{onSubmit:O,className:"uset-form",children:[e.jsxs("label",{className:"uset-field",children:[e.jsx("span",{className:"uset-lab",children:s("user.settings.currentPassword")}),e.jsx("input",{type:"password",value:h,onChange:t=>m(t.target.value),required:!0,autoComplete:"current-password",className:"uset-in"})]}),e.jsxs("label",{className:"uset-field",children:[e.jsx("span",{className:"uset-lab",children:s("user.settings.newPassword")}),e.jsx("input",{type:"password",value:o,onChange:t=>p(t.target.value),required:!0,autoComplete:"new-password",className:"uset-in"})]}),e.jsxs("label",{className:"uset-field",children:[e.jsx("span",{className:"uset-lab",children:s("user.settings.confirmNewPassword")}),e.jsx("input",{type:"password",value:x,onChange:t=>N(t.target.value),required:!0,autoComplete:"new-password",className:"uset-in"})]}),j&&e.jsx("p",{className:"uset-err",children:j}),g&&e.jsx("p",{className:"uset-ok",children:g}),e.jsx("div",{className:"uset-actions",children:e.jsx("button",{type:"submit",className:"btn-ticket",children:s("user.settings.submit")})})]}),M=()=>e.jsx("button",{onClick:L,className:"uset-danger",children:s("user.settings.logoutAll")});return e.jsxs("div",{className:"uset",children:[e.jsxs("header",{className:"uset-head hero-enter",children:[e.jsx("h1",{className:"uset-name",children:i.username}),e.jsxs("div",{className:"uset-meta",children:[R(),e.jsx("span",{className:"uset-role",children:i.role})]})]}),e.jsxs("div",{className:"uset-body hero-enter-late",children:[e.jsxs("section",{className:"uset-sec",children:[e.jsx("div",{className:"uset-seclab",children:e.jsx("h2",{className:"uset-h",children:s("user.settings.notifications")})}),e.jsx("div",{className:"uset-secctl",children:F()})]}),e.jsxs("section",{className:"uset-sec",children:[e.jsx("div",{className:"uset-seclab",children:e.jsx("h2",{className:"uset-h",children:s("user.settings.language")})}),e.jsx("div",{className:"uset-secctl",children:I()})]}),e.jsxs("section",{className:"uset-sec uset-sec--wide",children:[e.jsx("h2",{className:"uset-h",children:e.jsxs("button",{type:"button",className:"uset-disclosure","aria-expanded":d,"aria-controls":"uset-password",onClick:()=>q(t=>!t),children:[e.jsx("span",{children:s("user.settings.changePassword")}),e.jsx(v,{className:"uset-chev","aria-hidden":!0})]})}),e.jsx("div",{id:"uset-password",className:"uset-reveal","data-open":d,children:e.jsx("div",{className:"uset-reveal-clip",inert:!d,children:e.jsx("div",{className:"uset-secctl",children:A()})})})]})]}),e.jsxs("footer",{className:"uset-foot hero-enter-late",children:[e.jsxs("div",{className:"uset-footlab",children:[e.jsx("h2",{className:"uset-dangerh",children:s("user.settings.logoutAll")}),e.jsx("p",{className:"uset-hint",children:"Revoke sessions on all devices."})]}),M()]})]})}export{Z as UserSettings};
@@ -1 +1 @@
1
- import{bl as ln,aO as an,H as z,b8 as w,F as G,ah as un,W as y,bd as tn,b9 as J,aI as _,c as rn,m as o,aG as on,j as sn,d as fn}from"./mermaid.core-n5f_df_C.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,j,I,v,A,H,a){var q=j-l,i=I-h,n=H-v,d=a-A,u=d*q-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*q,h+u*i]}function U(l,h,j,I,v,A,H){var a=l-j,q=h-I,i=(H?A:-A)/J(a*a+q*q),n=i*q,d=-i*a,u=l+n,s=h+d,f=j+n,c=I+d,S=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,D=(g<0?-1:1)*J(on(0,T*T*R-P*P)),E=(P*g-m*D)/R,F=(-P*m-g*D)/R,b=(P*g+m*D)/R,p=(-P*m+g*D)/R,x=E-S,e=F-t,r=b-S,W=p-t;return x*x+e*e>r*r+W*W&&(E=b,F=p),{cx:E,cy:F,x01:-n,y01:-d,x11:E*(v/T-1),y11:F*(v/T-1)}}function hn(){var l=cn,h=yn,j=G(0),I=null,v=gn,A=dn,H=mn,a=null,q=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=A.apply(this,arguments)-un,S=rn(c-f),t=c>f;if(a||(a=n=q()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(S>tn-y)a.moveTo(s*z(f),s*w(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*z(c),u*w(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=S,D=S,E=H.apply(this,arguments)/2,F=E>y&&(I?+I.apply(this,arguments):J(u*u+s*s)),b=_(rn(s-u)/2,+j.apply(this,arguments)),p=b,x=b,e,r;if(F>y){var W=sn(F/u*w(E)),K=sn(F/s*w(E));(P-=W*2)>y?(W*=t?1:-1,R+=W,T-=W):(P=0,R=T=(f+c)/2),(D-=K*2)>y?(K*=t?1:-1,m+=K,g-=K):(D=0,m=g=(f+c)/2)}var B=s*z(m),C=s*w(m),L=u*z(T),M=u*w(T);if(b>y){var N=s*z(g),Q=s*w(g),V=u*z(R),X=u*w(R),O;if(S<an)if(O=pn(B,C,V,X,N,Q,L,M)){var Y=B-O[0],Z=C-O[1],$=N-O[0],k=Q-O[1],nn=1/w(fn((Y*$+Z*k)/(J(Y*Y+Z*Z)*J($*$+k*k)))/2),en=J(O[0]*O[0]+O[1]*O[1]);p=_(b,(u-en)/(nn-1)),x=_(b,(s-en)/(nn+1))}else p=x=0}D>y?x>y?(e=U(V,X,B,C,s,x,t),r=U(N,Q,L,M,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<b?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(B,C),a.arc(0,0,s,m,g,!t)):a.moveTo(B,C),!(u>y)||!(P>y)?a.lineTo(L,M):p>y?(e=U(L,M,N,Q,u,-p,t),r=U(B,C,V,X,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<b?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-an/2;return[z(d)*n,w(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:G(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:G(+n),i):h},i.cornerRadius=function(n){return arguments.length?(j=typeof n=="function"?n:G(+n),i):j},i.padRadius=function(n){return arguments.length?(I=n==null?null:typeof n=="function"?n:G(+n),i):I},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:G(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:G(+n),i):A},i.padAngle=function(n){return arguments.length?(H=typeof n=="function"?n:G(+n),i):H},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};
1
+ import{bl as ln,aO as an,H as z,b8 as w,F as G,ah as un,W as y,bd as tn,b9 as J,aI as _,c as rn,m as o,aG as on,j as sn,d as fn}from"./mermaid.core-DTuGObIu.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,j,I,v,A,H,a){var q=j-l,i=I-h,n=H-v,d=a-A,u=d*q-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*q,h+u*i]}function U(l,h,j,I,v,A,H){var a=l-j,q=h-I,i=(H?A:-A)/J(a*a+q*q),n=i*q,d=-i*a,u=l+n,s=h+d,f=j+n,c=I+d,S=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,D=(g<0?-1:1)*J(on(0,T*T*R-P*P)),E=(P*g-m*D)/R,F=(-P*m-g*D)/R,b=(P*g+m*D)/R,p=(-P*m+g*D)/R,x=E-S,e=F-t,r=b-S,W=p-t;return x*x+e*e>r*r+W*W&&(E=b,F=p),{cx:E,cy:F,x01:-n,y01:-d,x11:E*(v/T-1),y11:F*(v/T-1)}}function hn(){var l=cn,h=yn,j=G(0),I=null,v=gn,A=dn,H=mn,a=null,q=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=A.apply(this,arguments)-un,S=rn(c-f),t=c>f;if(a||(a=n=q()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(S>tn-y)a.moveTo(s*z(f),s*w(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*z(c),u*w(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=S,D=S,E=H.apply(this,arguments)/2,F=E>y&&(I?+I.apply(this,arguments):J(u*u+s*s)),b=_(rn(s-u)/2,+j.apply(this,arguments)),p=b,x=b,e,r;if(F>y){var W=sn(F/u*w(E)),K=sn(F/s*w(E));(P-=W*2)>y?(W*=t?1:-1,R+=W,T-=W):(P=0,R=T=(f+c)/2),(D-=K*2)>y?(K*=t?1:-1,m+=K,g-=K):(D=0,m=g=(f+c)/2)}var B=s*z(m),C=s*w(m),L=u*z(T),M=u*w(T);if(b>y){var N=s*z(g),Q=s*w(g),V=u*z(R),X=u*w(R),O;if(S<an)if(O=pn(B,C,V,X,N,Q,L,M)){var Y=B-O[0],Z=C-O[1],$=N-O[0],k=Q-O[1],nn=1/w(fn((Y*$+Z*k)/(J(Y*Y+Z*Z)*J($*$+k*k)))/2),en=J(O[0]*O[0]+O[1]*O[1]);p=_(b,(u-en)/(nn-1)),x=_(b,(s-en)/(nn+1))}else p=x=0}D>y?x>y?(e=U(V,X,B,C,s,x,t),r=U(N,Q,L,M,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<b?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(B,C),a.arc(0,0,s,m,g,!t)):a.moveTo(B,C),!(u>y)||!(P>y)?a.lineTo(L,M):p>y?(e=U(L,M,N,Q,u,-p,t),r=U(B,C,V,X,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<b?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-an/2;return[z(d)*n,w(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:G(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:G(+n),i):h},i.cornerRadius=function(n){return arguments.length?(j=typeof n=="function"?n:G(+n),i):j},i.padRadius=function(n){return arguments.length?(I=n==null?null:typeof n=="function"?n:G(+n),i):I},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:G(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:G(+n),i):A},i.padAngle=function(n){return arguments.length?(H=typeof n=="function"?n:G(+n),i):H},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};