@saluzi/saluzi-edu 0.2.71 → 0.2.73

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 (160) hide show
  1. package/dist/cli.js +52 -52
  2. package/dist/guide/guide-data.json +4 -0
  3. package/dist/rcs-web/assets/{AdminPanel-8HNxSZw0.js → AdminPanel-DMClbUbi.js} +1 -1
  4. package/dist/rcs-web/assets/ArtifactView-CUDKNi6z.js +6 -0
  5. package/dist/rcs-web/assets/{ArtifactsGallery-DQj98ptl.js → ArtifactsGallery-B3OCFJ7T.js} +17 -12
  6. package/{packages/remote-control-server/web/dist/assets/Claim-Dfdhnggp.js → dist/rcs-web/assets/Claim-BOkou3Kj.js} +1 -1
  7. package/dist/rcs-web/assets/{Dashboard-DnLE2gtW.js → Dashboard-DxcBkyhD.js} +1 -1
  8. package/dist/rcs-web/assets/{Join-Cgq7v-Sb.js → Join-DZ_EUsnw.js} +1 -1
  9. package/dist/rcs-web/assets/{Login-CpRVSamw.js → Login-Ct6Z1ih0.js} +1 -1
  10. package/dist/rcs-web/assets/{Register-CvCuP-ww.js → Register-D3Sub3V4.js} +1 -1
  11. package/dist/rcs-web/assets/SessionDetail-CC1Y-JXz.js +60 -0
  12. package/dist/rcs-web/assets/{SessionVisibilityBadge-7ElYQ4hP.js → SessionVisibilityBadge-B33i8RLj.js} +1 -1
  13. package/dist/rcs-web/assets/{Setup-DH5NCalW.js → Setup-COecVpRC.js} +1 -1
  14. package/dist/rcs-web/assets/{ShareLanding-B48Z1tak.js → ShareLanding-B7ZdGScC.js} +1 -1
  15. package/dist/rcs-web/assets/{TeamCreate-tXM5yKmq.js → TeamCreate-BKeJj9CV.js} +1 -1
  16. package/dist/rcs-web/assets/{TeamDetail-3jPhrX5z.js → TeamDetail-BAG50yxf.js} +1 -1
  17. package/dist/rcs-web/assets/{TeamList-DylGNt59.js → TeamList-B2kk8eh4.js} +1 -1
  18. package/dist/rcs-web/assets/{TeamSettings-CoBx_q55.js → TeamSettings-h8JWw1pp.js} +1 -1
  19. package/dist/rcs-web/assets/{UserSearchInput-DM6V0r1B.js → UserSearchInput-DSeymf7O.js} +1 -1
  20. package/dist/rcs-web/assets/{UserSettings-CxuLje2z.js → UserSettings-9wOVTete.js} +1 -1
  21. package/dist/rcs-web/assets/{arc-BrQup1CU.js → arc-DBopY3EY.js} +1 -1
  22. package/dist/rcs-web/assets/{architectureDiagram-3BPJPVTR-l1NuwJAC.js → architectureDiagram-3BPJPVTR-BTnFS82c.js} +1 -1
  23. package/{packages/remote-control-server/web/dist/assets/blockDiagram-GPEHLZMM-CVNyoBQm.js → dist/rcs-web/assets/blockDiagram-GPEHLZMM-B8Sve1cP.js} +1 -1
  24. package/dist/rcs-web/assets/{c4Diagram-AAUBKEIU-C8IgW5pQ.js → c4Diagram-AAUBKEIU-BIOzYRjo.js} +1 -1
  25. package/dist/rcs-web/assets/channel-CbznqW4C.js +1 -0
  26. package/dist/rcs-web/assets/{chunk-2J33WTMH-Cz-fnX8Q.js → chunk-2J33WTMH-Bs-8U7DE.js} +1 -1
  27. package/dist/rcs-web/assets/{chunk-4BX2VUAB-s0k1FsPS.js → chunk-4BX2VUAB-BnQJ0pbh.js} +1 -1
  28. package/dist/rcs-web/assets/{chunk-55IACEB6-k7MztSxj.js → chunk-55IACEB6-Cxuu3aYy.js} +1 -1
  29. package/{packages/remote-control-server/web/dist/assets/chunk-727SXJPM-DCD6b_gA.js → dist/rcs-web/assets/chunk-727SXJPM-CcLR90xa.js} +1 -1
  30. package/{packages/remote-control-server/web/dist/assets/chunk-AQP2D5EJ-ByLnKNaa.js → dist/rcs-web/assets/chunk-AQP2D5EJ-BwA_vlbi.js} +1 -1
  31. package/dist/rcs-web/assets/{chunk-FMBD7UC4-DnoA9fQr.js → chunk-FMBD7UC4-Clf6X7Ml.js} +1 -1
  32. package/dist/rcs-web/assets/{chunk-ND2GUHAM-BsbvPHC6.js → chunk-ND2GUHAM-DUVg4YJL.js} +1 -1
  33. package/dist/rcs-web/assets/{chunk-QZHKN3VN-DnHGOmkn.js → chunk-QZHKN3VN-mPQkR0NB.js} +1 -1
  34. package/dist/rcs-web/assets/classDiagram-4FO5ZUOK-rJ7tuSw-.js +1 -0
  35. package/dist/rcs-web/assets/classDiagram-v2-Q7XG4LA2-rJ7tuSw-.js +1 -0
  36. package/dist/rcs-web/assets/{code-block-IT6T5CEO-Br6udBTB.js → code-block-IT6T5CEO-BAgpDt13.js} +1 -1
  37. package/dist/rcs-web/assets/{copy-BFkM6GS4.js → copy-BdcZVl_u.js} +1 -1
  38. package/{packages/remote-control-server/web/dist/assets/cose-bilkent-S5V4N54A-ChN-rm-T.js → dist/rcs-web/assets/cose-bilkent-S5V4N54A-B6DjpMte.js} +1 -1
  39. package/{packages/remote-control-server/web/dist/assets/dagre-BM42HDAG-Dy0qgRIV.js → dist/rcs-web/assets/dagre-BM42HDAG-D_NsO2qH.js} +1 -1
  40. package/dist/rcs-web/assets/{diagram-2AECGRRQ-ByiBm-x4.js → diagram-2AECGRRQ-B0NVIr-5.js} +1 -1
  41. package/dist/rcs-web/assets/{diagram-5GNKFQAL-rGbxhf-H.js → diagram-5GNKFQAL-C21xttLi.js} +1 -1
  42. package/dist/rcs-web/assets/{diagram-KO2AKTUF-COdwodvi.js → diagram-KO2AKTUF-D6TKZ2qP.js} +1 -1
  43. package/dist/rcs-web/assets/{diagram-LMA3HP47-EjqjzeZY.js → diagram-LMA3HP47-DJQYNR0l.js} +1 -1
  44. package/dist/rcs-web/assets/{diagram-OG6HWLK6-DSPVSdmJ.js → diagram-OG6HWLK6-DBgsUCQK.js} +1 -1
  45. package/{packages/remote-control-server/web/dist/assets/dialog-aHICCHyK.js → dist/rcs-web/assets/dialog-niHgO9y4.js} +1 -1
  46. package/{packages/remote-control-server/web/dist/assets/erDiagram-TEJ5UH35-DZBAaLMb.js → dist/rcs-web/assets/erDiagram-TEJ5UH35-B3MCOL04.js} +1 -1
  47. package/dist/rcs-web/assets/{flowDiagram-I6XJVG4X-DJHAIGo5.js → flowDiagram-I6XJVG4X-Ct5UrMg4.js} +1 -1
  48. package/{packages/remote-control-server/web/dist/assets/ganttDiagram-6RSMTGT7-DEXe0aC6.js → dist/rcs-web/assets/ganttDiagram-6RSMTGT7-CETj1zUQ.js} +1 -1
  49. package/{packages/remote-control-server/web/dist/assets/gitGraphDiagram-PVQCEYII-D35WJeQv.js → dist/rcs-web/assets/gitGraphDiagram-PVQCEYII-CTYvU4m1.js} +1 -1
  50. package/dist/rcs-web/assets/{infoDiagram-5YYISTIA-n-NVaNrp.js → infoDiagram-5YYISTIA-iVIf58oN.js} +1 -1
  51. package/dist/rcs-web/assets/{ishikawaDiagram-YF4QCWOH-D7nU29iu.js → ishikawaDiagram-YF4QCWOH-C8rLSSN0.js} +1 -1
  52. package/dist/rcs-web/assets/{journeyDiagram-JHISSGLW-De0htrHG.js → journeyDiagram-JHISSGLW-CCCe44Y_.js} +1 -1
  53. package/{packages/remote-control-server/web/dist/assets/kanban-definition-UN3LZRKU-C5rnfLlw.js → dist/rcs-web/assets/kanban-definition-UN3LZRKU-D-2jpn6m.js} +1 -1
  54. package/dist/rcs-web/assets/{linear-BkfmaOFV.js → linear-jT5e6iMk.js} +1 -1
  55. package/dist/rcs-web/assets/{main-2FF76CHO.js → main-49JlcYCi.js} +4 -4
  56. package/dist/rcs-web/assets/main-C1pGF5LM.css +1 -0
  57. package/dist/rcs-web/assets/{mermaid-VLURNSYL-CAb8MsJr.js → mermaid-VLURNSYL-DLOgnkPH.js} +4 -4
  58. package/dist/rcs-web/assets/{mermaid.core-dT6jK4cB.js → mermaid.core-DfoO5KWy.js} +5 -5
  59. package/{packages/remote-control-server/web/dist/assets/mindmap-definition-RKZ34NQL-KBR776rc.js → dist/rcs-web/assets/mindmap-definition-RKZ34NQL-COp3rAIF.js} +1 -1
  60. package/dist/rcs-web/assets/{pieDiagram-4H26LBE5-aGUqFGVT.js → pieDiagram-4H26LBE5-CzxhXChG.js} +1 -1
  61. package/dist/rcs-web/assets/{quadrantDiagram-W4KKPZXB-DbWbBGjW.js → quadrantDiagram-W4KKPZXB-BSF1quon.js} +1 -1
  62. package/dist/rcs-web/assets/{requirementDiagram-4Y6WPE33-CRIIsSnh.js → requirementDiagram-4Y6WPE33-GGLkdBIg.js} +1 -1
  63. package/{packages/remote-control-server/web/dist/assets/sankeyDiagram-5OEKKPKP-C1fZEOgo.js → dist/rcs-web/assets/sankeyDiagram-5OEKKPKP-ClAqJ5Dt.js} +1 -1
  64. package/dist/rcs-web/assets/{sequenceDiagram-3UESZ5HK-DpwCRJwm.js → sequenceDiagram-3UESZ5HK-CTMkKLqv.js} +1 -1
  65. package/dist/rcs-web/assets/{stateDiagram-AJRCARHV-Dx-tpSSo.js → stateDiagram-AJRCARHV-CsKOZlpT.js} +1 -1
  66. package/dist/rcs-web/assets/{stateDiagram-v2-BHNVJYJU-DTEk3-eZ.js → stateDiagram-v2-BHNVJYJU-DDEvqYzH.js} +1 -1
  67. package/dist/rcs-web/assets/{timeline-definition-PNZ67QCA-CUVrbUF6.js → timeline-definition-PNZ67QCA-Ce-IRZf_.js} +1 -1
  68. package/dist/rcs-web/assets/{vennDiagram-CIIHVFJN-Bjoy1hva.js → vennDiagram-CIIHVFJN-BumbI6qO.js} +1 -1
  69. package/dist/rcs-web/assets/{wardleyDiagram-YWT4CUSO-Xv7_ml_a.js → wardleyDiagram-YWT4CUSO-B5A3bkUP.js} +1 -1
  70. package/{packages/remote-control-server/web/dist/assets/xychartDiagram-2RQKCTM6-CMv6nVsy.js → dist/rcs-web/assets/xychartDiagram-2RQKCTM6-CNudFFGs.js} +1 -1
  71. package/dist/rcs-web/index.html +2 -2
  72. package/package.json +3 -2
  73. package/packages/remote-control-server/src/__tests__/artifacts.test.ts +211 -0
  74. package/packages/remote-control-server/src/routes/web/artifacts.ts +57 -5
  75. package/packages/remote-control-server/src/services/artifacts.ts +51 -4
  76. package/packages/remote-control-server/src/services/event-persistence.ts +13 -4
  77. package/packages/remote-control-server/src/services/transport.ts +10 -0
  78. package/packages/remote-control-server/web/dist/assets/{AdminPanel-8HNxSZw0.js → AdminPanel-DMClbUbi.js} +1 -1
  79. package/packages/remote-control-server/web/dist/assets/ArtifactView-CUDKNi6z.js +6 -0
  80. package/packages/remote-control-server/web/dist/assets/{ArtifactsGallery-DQj98ptl.js → ArtifactsGallery-B3OCFJ7T.js} +17 -12
  81. package/{dist/rcs-web/assets/Claim-Dfdhnggp.js → packages/remote-control-server/web/dist/assets/Claim-BOkou3Kj.js} +1 -1
  82. package/packages/remote-control-server/web/dist/assets/{Dashboard-DnLE2gtW.js → Dashboard-DxcBkyhD.js} +1 -1
  83. package/packages/remote-control-server/web/dist/assets/{Join-Cgq7v-Sb.js → Join-DZ_EUsnw.js} +1 -1
  84. package/packages/remote-control-server/web/dist/assets/{Login-CpRVSamw.js → Login-Ct6Z1ih0.js} +1 -1
  85. package/packages/remote-control-server/web/dist/assets/{Register-CvCuP-ww.js → Register-D3Sub3V4.js} +1 -1
  86. package/packages/remote-control-server/web/dist/assets/SessionDetail-CC1Y-JXz.js +60 -0
  87. package/packages/remote-control-server/web/dist/assets/{SessionVisibilityBadge-7ElYQ4hP.js → SessionVisibilityBadge-B33i8RLj.js} +1 -1
  88. package/packages/remote-control-server/web/dist/assets/{Setup-DH5NCalW.js → Setup-COecVpRC.js} +1 -1
  89. package/packages/remote-control-server/web/dist/assets/{ShareLanding-B48Z1tak.js → ShareLanding-B7ZdGScC.js} +1 -1
  90. package/packages/remote-control-server/web/dist/assets/{TeamCreate-tXM5yKmq.js → TeamCreate-BKeJj9CV.js} +1 -1
  91. package/packages/remote-control-server/web/dist/assets/{TeamDetail-3jPhrX5z.js → TeamDetail-BAG50yxf.js} +1 -1
  92. package/packages/remote-control-server/web/dist/assets/{TeamList-DylGNt59.js → TeamList-B2kk8eh4.js} +1 -1
  93. package/packages/remote-control-server/web/dist/assets/{TeamSettings-CoBx_q55.js → TeamSettings-h8JWw1pp.js} +1 -1
  94. package/packages/remote-control-server/web/dist/assets/{UserSearchInput-DM6V0r1B.js → UserSearchInput-DSeymf7O.js} +1 -1
  95. package/packages/remote-control-server/web/dist/assets/{UserSettings-CxuLje2z.js → UserSettings-9wOVTete.js} +1 -1
  96. package/packages/remote-control-server/web/dist/assets/{arc-BrQup1CU.js → arc-DBopY3EY.js} +1 -1
  97. package/packages/remote-control-server/web/dist/assets/{architectureDiagram-3BPJPVTR-l1NuwJAC.js → architectureDiagram-3BPJPVTR-BTnFS82c.js} +1 -1
  98. package/{dist/rcs-web/assets/blockDiagram-GPEHLZMM-CVNyoBQm.js → packages/remote-control-server/web/dist/assets/blockDiagram-GPEHLZMM-B8Sve1cP.js} +1 -1
  99. package/packages/remote-control-server/web/dist/assets/{c4Diagram-AAUBKEIU-C8IgW5pQ.js → c4Diagram-AAUBKEIU-BIOzYRjo.js} +1 -1
  100. package/packages/remote-control-server/web/dist/assets/channel-CbznqW4C.js +1 -0
  101. package/packages/remote-control-server/web/dist/assets/{chunk-2J33WTMH-Cz-fnX8Q.js → chunk-2J33WTMH-Bs-8U7DE.js} +1 -1
  102. package/packages/remote-control-server/web/dist/assets/{chunk-4BX2VUAB-s0k1FsPS.js → chunk-4BX2VUAB-BnQJ0pbh.js} +1 -1
  103. package/packages/remote-control-server/web/dist/assets/{chunk-55IACEB6-k7MztSxj.js → chunk-55IACEB6-Cxuu3aYy.js} +1 -1
  104. package/{dist/rcs-web/assets/chunk-727SXJPM-DCD6b_gA.js → packages/remote-control-server/web/dist/assets/chunk-727SXJPM-CcLR90xa.js} +1 -1
  105. package/{dist/rcs-web/assets/chunk-AQP2D5EJ-ByLnKNaa.js → packages/remote-control-server/web/dist/assets/chunk-AQP2D5EJ-BwA_vlbi.js} +1 -1
  106. package/packages/remote-control-server/web/dist/assets/{chunk-FMBD7UC4-DnoA9fQr.js → chunk-FMBD7UC4-Clf6X7Ml.js} +1 -1
  107. package/packages/remote-control-server/web/dist/assets/{chunk-ND2GUHAM-BsbvPHC6.js → chunk-ND2GUHAM-DUVg4YJL.js} +1 -1
  108. package/packages/remote-control-server/web/dist/assets/{chunk-QZHKN3VN-DnHGOmkn.js → chunk-QZHKN3VN-mPQkR0NB.js} +1 -1
  109. package/packages/remote-control-server/web/dist/assets/classDiagram-4FO5ZUOK-rJ7tuSw-.js +1 -0
  110. package/packages/remote-control-server/web/dist/assets/classDiagram-v2-Q7XG4LA2-rJ7tuSw-.js +1 -0
  111. package/packages/remote-control-server/web/dist/assets/{code-block-IT6T5CEO-Br6udBTB.js → code-block-IT6T5CEO-BAgpDt13.js} +1 -1
  112. package/packages/remote-control-server/web/dist/assets/{copy-BFkM6GS4.js → copy-BdcZVl_u.js} +1 -1
  113. package/{dist/rcs-web/assets/cose-bilkent-S5V4N54A-ChN-rm-T.js → packages/remote-control-server/web/dist/assets/cose-bilkent-S5V4N54A-B6DjpMte.js} +1 -1
  114. package/{dist/rcs-web/assets/dagre-BM42HDAG-Dy0qgRIV.js → packages/remote-control-server/web/dist/assets/dagre-BM42HDAG-D_NsO2qH.js} +1 -1
  115. package/packages/remote-control-server/web/dist/assets/{diagram-2AECGRRQ-ByiBm-x4.js → diagram-2AECGRRQ-B0NVIr-5.js} +1 -1
  116. package/packages/remote-control-server/web/dist/assets/{diagram-5GNKFQAL-rGbxhf-H.js → diagram-5GNKFQAL-C21xttLi.js} +1 -1
  117. package/packages/remote-control-server/web/dist/assets/{diagram-KO2AKTUF-COdwodvi.js → diagram-KO2AKTUF-D6TKZ2qP.js} +1 -1
  118. package/packages/remote-control-server/web/dist/assets/{diagram-LMA3HP47-EjqjzeZY.js → diagram-LMA3HP47-DJQYNR0l.js} +1 -1
  119. package/packages/remote-control-server/web/dist/assets/{diagram-OG6HWLK6-DSPVSdmJ.js → diagram-OG6HWLK6-DBgsUCQK.js} +1 -1
  120. package/{dist/rcs-web/assets/dialog-aHICCHyK.js → packages/remote-control-server/web/dist/assets/dialog-niHgO9y4.js} +1 -1
  121. package/{dist/rcs-web/assets/erDiagram-TEJ5UH35-DZBAaLMb.js → packages/remote-control-server/web/dist/assets/erDiagram-TEJ5UH35-B3MCOL04.js} +1 -1
  122. package/packages/remote-control-server/web/dist/assets/{flowDiagram-I6XJVG4X-DJHAIGo5.js → flowDiagram-I6XJVG4X-Ct5UrMg4.js} +1 -1
  123. package/{dist/rcs-web/assets/ganttDiagram-6RSMTGT7-DEXe0aC6.js → packages/remote-control-server/web/dist/assets/ganttDiagram-6RSMTGT7-CETj1zUQ.js} +1 -1
  124. package/{dist/rcs-web/assets/gitGraphDiagram-PVQCEYII-D35WJeQv.js → packages/remote-control-server/web/dist/assets/gitGraphDiagram-PVQCEYII-CTYvU4m1.js} +1 -1
  125. package/packages/remote-control-server/web/dist/assets/{infoDiagram-5YYISTIA-n-NVaNrp.js → infoDiagram-5YYISTIA-iVIf58oN.js} +1 -1
  126. package/packages/remote-control-server/web/dist/assets/{ishikawaDiagram-YF4QCWOH-D7nU29iu.js → ishikawaDiagram-YF4QCWOH-C8rLSSN0.js} +1 -1
  127. package/packages/remote-control-server/web/dist/assets/{journeyDiagram-JHISSGLW-De0htrHG.js → journeyDiagram-JHISSGLW-CCCe44Y_.js} +1 -1
  128. package/{dist/rcs-web/assets/kanban-definition-UN3LZRKU-C5rnfLlw.js → packages/remote-control-server/web/dist/assets/kanban-definition-UN3LZRKU-D-2jpn6m.js} +1 -1
  129. package/packages/remote-control-server/web/dist/assets/{linear-BkfmaOFV.js → linear-jT5e6iMk.js} +1 -1
  130. package/packages/remote-control-server/web/dist/assets/{main-2FF76CHO.js → main-49JlcYCi.js} +4 -4
  131. package/packages/remote-control-server/web/dist/assets/main-C1pGF5LM.css +1 -0
  132. package/packages/remote-control-server/web/dist/assets/{mermaid-VLURNSYL-CAb8MsJr.js → mermaid-VLURNSYL-DLOgnkPH.js} +4 -4
  133. package/packages/remote-control-server/web/dist/assets/{mermaid.core-dT6jK4cB.js → mermaid.core-DfoO5KWy.js} +5 -5
  134. package/{dist/rcs-web/assets/mindmap-definition-RKZ34NQL-KBR776rc.js → packages/remote-control-server/web/dist/assets/mindmap-definition-RKZ34NQL-COp3rAIF.js} +1 -1
  135. package/packages/remote-control-server/web/dist/assets/{pieDiagram-4H26LBE5-aGUqFGVT.js → pieDiagram-4H26LBE5-CzxhXChG.js} +1 -1
  136. package/packages/remote-control-server/web/dist/assets/{quadrantDiagram-W4KKPZXB-DbWbBGjW.js → quadrantDiagram-W4KKPZXB-BSF1quon.js} +1 -1
  137. package/packages/remote-control-server/web/dist/assets/{requirementDiagram-4Y6WPE33-CRIIsSnh.js → requirementDiagram-4Y6WPE33-GGLkdBIg.js} +1 -1
  138. package/{dist/rcs-web/assets/sankeyDiagram-5OEKKPKP-C1fZEOgo.js → packages/remote-control-server/web/dist/assets/sankeyDiagram-5OEKKPKP-ClAqJ5Dt.js} +1 -1
  139. package/packages/remote-control-server/web/dist/assets/{sequenceDiagram-3UESZ5HK-DpwCRJwm.js → sequenceDiagram-3UESZ5HK-CTMkKLqv.js} +1 -1
  140. package/packages/remote-control-server/web/dist/assets/{stateDiagram-AJRCARHV-Dx-tpSSo.js → stateDiagram-AJRCARHV-CsKOZlpT.js} +1 -1
  141. package/packages/remote-control-server/web/dist/assets/{stateDiagram-v2-BHNVJYJU-DTEk3-eZ.js → stateDiagram-v2-BHNVJYJU-DDEvqYzH.js} +1 -1
  142. package/packages/remote-control-server/web/dist/assets/{timeline-definition-PNZ67QCA-CUVrbUF6.js → timeline-definition-PNZ67QCA-Ce-IRZf_.js} +1 -1
  143. package/packages/remote-control-server/web/dist/assets/{vennDiagram-CIIHVFJN-Bjoy1hva.js → vennDiagram-CIIHVFJN-BumbI6qO.js} +1 -1
  144. package/packages/remote-control-server/web/dist/assets/{wardleyDiagram-YWT4CUSO-Xv7_ml_a.js → wardleyDiagram-YWT4CUSO-B5A3bkUP.js} +1 -1
  145. package/{dist/rcs-web/assets/xychartDiagram-2RQKCTM6-CMv6nVsy.js → packages/remote-control-server/web/dist/assets/xychartDiagram-2RQKCTM6-CNudFFGs.js} +1 -1
  146. package/packages/remote-control-server/web/dist/index.html +2 -2
  147. package/dist/rcs-web/assets/ArtifactView-2di4r0Cr.js +0 -6
  148. package/dist/rcs-web/assets/SessionDetail-CTa4JN6V.js +0 -60
  149. package/dist/rcs-web/assets/channel-DqfyWDcz.js +0 -1
  150. package/dist/rcs-web/assets/classDiagram-4FO5ZUOK-BC1-yHO5.js +0 -1
  151. package/dist/rcs-web/assets/classDiagram-v2-Q7XG4LA2-BC1-yHO5.js +0 -1
  152. package/dist/rcs-web/assets/external-link-Cb0Qh2uy.js +0 -6
  153. package/dist/rcs-web/assets/main-C2O-g177.css +0 -1
  154. package/packages/remote-control-server/web/dist/assets/ArtifactView-2di4r0Cr.js +0 -6
  155. package/packages/remote-control-server/web/dist/assets/SessionDetail-CTa4JN6V.js +0 -60
  156. package/packages/remote-control-server/web/dist/assets/channel-DqfyWDcz.js +0 -1
  157. package/packages/remote-control-server/web/dist/assets/classDiagram-4FO5ZUOK-BC1-yHO5.js +0 -1
  158. package/packages/remote-control-server/web/dist/assets/classDiagram-v2-Q7XG4LA2-BC1-yHO5.js +0 -1
  159. package/packages/remote-control-server/web/dist/assets/external-link-Cb0Qh2uy.js +0 -6
  160. package/packages/remote-control-server/web/dist/assets/main-C2O-g177.css +0 -1
@@ -3,6 +3,7 @@ import type { Database } from 'bun:sqlite'
3
3
  import { error as logError, log } from '../logger'
4
4
  import { getDb } from '../db/sqlite'
5
5
  import { isSessionVisibleToUser } from './session'
6
+ import { publishSessionEvent } from './transport'
6
7
 
7
8
  /**
8
9
  * Artifacts — self-hosted HTML pages uploaded by the CLI `artifact` tool or
@@ -20,7 +21,7 @@ export type ArtifactTtl = (typeof ARTIFACT_ALLOWED_TTLS)[number]
20
21
  export const ARTIFACT_MAX_BYTES = 10 * 1024 * 1024
21
22
 
22
23
  /** Same charset contract as the upstream service. */
23
- const HASH_PATTERN = /^[A-Za-z0-9_-]{1,128}$/
24
+ export const ARTIFACT_HASH_PATTERN = /^[A-Za-z0-9_-]{1,128}$/
24
25
 
25
26
  export interface ArtifactRow {
26
27
  id: string
@@ -61,6 +62,35 @@ function toMeta(row: ArtifactRow): ArtifactMeta {
61
62
  return meta
62
63
  }
63
64
 
65
+ /**
66
+ * Publish a lifecycle event to the owning session's bus so the RCS web UI
67
+ * shows the artifacts badge immediately (agent uploads land asynchronously).
68
+ * Meta-only payload — the HTML content never travels on the event bus.
69
+ * Best-effort: notification must never break the create/update path.
70
+ */
71
+ function notifyArtifactEvent(
72
+ sessionId: string | null,
73
+ action: 'created' | 'updated',
74
+ meta: { id: string; title: string | null; version: number },
75
+ ): void {
76
+ if (!sessionId) return
77
+ try {
78
+ publishSessionEvent(
79
+ sessionId,
80
+ `artifact_${action}`,
81
+ {
82
+ id: meta.id,
83
+ title: meta.title,
84
+ version: meta.version,
85
+ url: `/v1/artifacts/${meta.id}/content`,
86
+ },
87
+ 'outbound',
88
+ )
89
+ } catch (err) {
90
+ logError(`[artifacts] notify event failed id=${meta.id}:`, err)
91
+ }
92
+ }
93
+
64
94
  function nowIso(): string {
65
95
  return new Date().toISOString()
66
96
  }
@@ -132,7 +162,7 @@ export function createArtifact(
132
162
  if (!ARTIFACT_ALLOWED_TTLS.includes(ttl)) {
133
163
  throw new ArtifactError('invalid_ttl', `ttl must be 7 or 30 (got ${ttl}).`)
134
164
  }
135
- if (params.hash !== undefined && !HASH_PATTERN.test(params.hash)) {
165
+ if (params.hash !== undefined && !ARTIFACT_HASH_PATTERN.test(params.hash)) {
136
166
  throw new ArtifactError(
137
167
  'invalid_hash',
138
168
  'hash must match ^[A-Za-z0-9_-]{1,128}$',
@@ -149,8 +179,15 @@ export function createArtifact(
149
179
  // Overwrite path — keep the URL stable, bump version, refresh TTL.
150
180
  if (params.hash) {
151
181
  const existing = db
152
- .query('SELECT id FROM artifacts WHERE id = $id')
153
- .get({ $id: params.hash }) as { id: string } | null
182
+ .query(
183
+ 'SELECT id, session_id, version, title FROM artifacts WHERE id = $id',
184
+ )
185
+ .get({ $id: params.hash }) as {
186
+ id: string
187
+ session_id: string | null
188
+ version: number
189
+ title: string | null
190
+ } | null
154
191
  if (existing) {
155
192
  db.query(
156
193
  `UPDATE artifacts
@@ -169,6 +206,14 @@ export function createArtifact(
169
206
  $session_id: sessionId,
170
207
  $team_id: teamId,
171
208
  })
209
+ // Notify the session that ends up owning the row (new binding wins,
210
+ // otherwise the original owner) — e.g. a CLI overwrite of an artifact
211
+ // created from the web gallery still notifies the gallery session.
212
+ notifyArtifactEvent(sessionId ?? existing.session_id, 'updated', {
213
+ id: params.hash,
214
+ title: params.title ?? existing.title,
215
+ version: existing.version + 1,
216
+ })
172
217
  return { id: params.hash, expiresAt, created: false }
173
218
  }
174
219
  }
@@ -195,6 +240,8 @@ export function createArtifact(
195
240
  $expires: expiresAt,
196
241
  })
197
242
 
243
+ notifyArtifactEvent(sessionId, 'created', { id, title, version: 1 })
244
+
198
245
  return { id, expiresAt, created: true }
199
246
  }
200
247
 
@@ -17,14 +17,23 @@ const INSERT_SQL =
17
17
  'INSERT OR REPLACE INTO session_events (id, session_id, seq_num, type, payload, direction, created_at) VALUES ($id, $session_id, $seq_num, $type, $payload, $direction, $created_at)'
18
18
 
19
19
  type RunQuery = { run(...params: unknown[]): unknown }
20
- let insertStmt: RunQuery | null = null
20
+ // Cache the prepared statement bound to the Database instance it was created
21
+ // from — `getDb()` is a singleton in production (never swaps), but test
22
+ // suites call freshDb() per file to get a brand-new Database; without the
23
+ // binding the stale statement would keep writing into the previous temp file.
24
+ let stmtCache: { db: unknown; stmt: RunQuery } | null = null
21
25
 
22
26
  function getInsertStmt(): RunQuery | null {
23
- if (insertStmt) return insertStmt
27
+ const db = getDb() as unknown
28
+ if (stmtCache && stmtCache.db === db) return stmtCache.stmt
24
29
  try {
25
- insertStmt = getDb().query(INSERT_SQL) as unknown as RunQuery
26
- return insertStmt
30
+ const stmt = (db as ReturnType<typeof getDb>).query(
31
+ INSERT_SQL,
32
+ ) as unknown as RunQuery
33
+ stmtCache = { db, stmt }
34
+ return stmt
27
35
  } catch (err) {
36
+ stmtCache = null
28
37
  logError('[event-persistence] prepare insert failed:', err)
29
38
  return null
30
39
  }
@@ -104,6 +104,16 @@ export function normalizePayload(
104
104
  if (Array.isArray(p.tasks)) normalized.tasks = p.tasks
105
105
  }
106
106
 
107
+ // Artifact lifecycle events (CLI upload / web edit) — meta-only fields
108
+ // surfaced for the web UI's session artifacts badge. The HTML content is
109
+ // intentionally NOT preserved: events go to every live SSE subscriber.
110
+ if (type === 'artifact_created' || type === 'artifact_updated') {
111
+ if (typeof p.id === 'string') normalized.id = p.id
112
+ if (typeof p.title === 'string') normalized.title = p.title
113
+ if (typeof p.version === 'number') normalized.version = p.version
114
+ if (typeof p.url === 'string') normalized.url = p.url
115
+ }
116
+
107
117
  // Preserve result usage/cost so the web UI can render cumulative session
108
118
  // totals (mirrors the CLI StatusLine).
109
119
  if (type === 'result' || type === 'result_success') {
@@ -1 +1 @@
1
- import{e as d,j as e}from"./vendor-DE_-CLIE.js";import{ar as c,as as o,Q as m,am as s,ae as l,x as u}from"./main-2FF76CHO.js";import"./shiki-mEP5vQQu.js";import"./motion-BILbV7YQ.js";function j(){c();const[a,i]=d.useState([]),{myTeams:r,isLoading:x}=o(),n=d.useCallback(async()=>{try{const t=await m();i(t||[])}catch(t){console.error("Admin: failed to load sessions",t)}},[]);return d.useEffect(()=>{n()},[n]),e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsxs("div",{className:"mx-auto max-w-5xl px-4 py-8",children:[e.jsx("h1",{className:"mb-6 font-display text-2xl font-semibold text-text-primary",children:s("admin.title")}),e.jsxs("section",{className:"mb-10",children:[e.jsxs("h2",{className:"mb-4 font-display text-lg font-semibold text-text-primary",children:[s("admin.teams")," (",r.length,")"]}),x?e.jsx("div",{className:"rounded-xl border border-border bg-surface-1 p-4 text-center text-text-muted",children:s("common.loading")}):r.length===0?e.jsx("div",{className:"rounded-xl border border-border bg-surface-1 p-4 text-center text-text-muted",children:s("admin.noTeams")}):e.jsx("div",{className:"space-y-2",children:r.map(t=>e.jsxs("a",{href:`/teams/${t.slug}`,className:"flex items-center justify-between rounded-xl border border-border bg-surface-1 px-4 py-3 no-underline transition-colors hover:border-border-light hover:bg-surface-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("span",{className:"font-medium text-text-primary",children:t.name}),e.jsx("span",{className:"ml-2 text-xs text-text-muted",children:t.slug})]}),e.jsx("span",{className:"text-xs text-text-muted",children:l(new Date(t.created_at).getTime()/1e3)})]},t.id))})]}),e.jsxs("section",{children:[e.jsxs("h2",{className:"mb-4 font-display text-lg font-semibold text-text-primary",children:[s("admin.sessions")," (",a.length,")"]}),a.length===0?e.jsx("div",{className:"rounded-xl border border-border bg-surface-1 p-4 text-center text-text-muted",children:s("admin.noSessions")}):e.jsx("div",{className:"space-y-2",children:a.map(t=>e.jsxs("a",{href:`/code/${t.id}`,className:"flex items-center justify-between rounded-xl border border-border bg-surface-1 px-4 py-3 no-underline transition-colors hover:border-border-light hover:bg-surface-2",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"truncate font-medium text-text-primary",children:t.title||t.id}),e.jsx("span",{className:"rounded-full bg-surface-2 px-2 py-0.5 text-xs text-text-muted",children:t.source||"unknown"})]}),e.jsx("div",{className:"truncate text-xs text-text-muted",children:t.id})]}),e.jsxs("div",{className:"ml-4 flex items-center gap-3",children:[e.jsx(u,{status:t.status}),e.jsx("span",{className:"text-xs text-text-muted",children:l(t.updated_at||t.created_at)})]})]},t.id))})]})]})})}export{j as AdminPanel};
1
+ import{e as d,j as e}from"./vendor-DE_-CLIE.js";import{ar as c,as as o,Q as m,am as s,ae as l,x as u}from"./main-49JlcYCi.js";import"./shiki-mEP5vQQu.js";import"./motion-BILbV7YQ.js";function j(){c();const[a,i]=d.useState([]),{myTeams:r,isLoading:x}=o(),n=d.useCallback(async()=>{try{const t=await m();i(t||[])}catch(t){console.error("Admin: failed to load sessions",t)}},[]);return d.useEffect(()=>{n()},[n]),e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsxs("div",{className:"mx-auto max-w-5xl px-4 py-8",children:[e.jsx("h1",{className:"mb-6 font-display text-2xl font-semibold text-text-primary",children:s("admin.title")}),e.jsxs("section",{className:"mb-10",children:[e.jsxs("h2",{className:"mb-4 font-display text-lg font-semibold text-text-primary",children:[s("admin.teams")," (",r.length,")"]}),x?e.jsx("div",{className:"rounded-xl border border-border bg-surface-1 p-4 text-center text-text-muted",children:s("common.loading")}):r.length===0?e.jsx("div",{className:"rounded-xl border border-border bg-surface-1 p-4 text-center text-text-muted",children:s("admin.noTeams")}):e.jsx("div",{className:"space-y-2",children:r.map(t=>e.jsxs("a",{href:`/teams/${t.slug}`,className:"flex items-center justify-between rounded-xl border border-border bg-surface-1 px-4 py-3 no-underline transition-colors hover:border-border-light hover:bg-surface-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("span",{className:"font-medium text-text-primary",children:t.name}),e.jsx("span",{className:"ml-2 text-xs text-text-muted",children:t.slug})]}),e.jsx("span",{className:"text-xs text-text-muted",children:l(new Date(t.created_at).getTime()/1e3)})]},t.id))})]}),e.jsxs("section",{children:[e.jsxs("h2",{className:"mb-4 font-display text-lg font-semibold text-text-primary",children:[s("admin.sessions")," (",a.length,")"]}),a.length===0?e.jsx("div",{className:"rounded-xl border border-border bg-surface-1 p-4 text-center text-text-muted",children:s("admin.noSessions")}):e.jsx("div",{className:"space-y-2",children:a.map(t=>e.jsxs("a",{href:`/code/${t.id}`,className:"flex items-center justify-between rounded-xl border border-border bg-surface-1 px-4 py-3 no-underline transition-colors hover:border-border-light hover:bg-surface-2",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"truncate font-medium text-text-primary",children:t.title||t.id}),e.jsx("span",{className:"rounded-full bg-surface-2 px-2 py-0.5 text-xs text-text-muted",children:t.source||"unknown"})]}),e.jsx("div",{className:"truncate text-xs text-text-muted",children:t.id})]}),e.jsxs("div",{className:"ml-4 flex items-center gap-3",children:[e.jsx(u,{status:t.status}),e.jsx("span",{className:"text-xs text-text-muted",children:l(t.updated_at||t.created_at)})]})]},t.id))})]})]})})}export{j as AdminPanel};
@@ -0,0 +1,6 @@
1
+ import{e as i,j as e}from"./vendor-DE_-CLIE.js";import{ab as N,ar as v,V as g,am as s,K as w,aa as C,P as k,z as _}from"./main-49JlcYCi.js";import{E,C as $}from"./ArtifactsGallery-B3OCFJ7T.js";import{C as L}from"./copy-BdcZVl_u.js";import"./shiki-mEP5vQQu.js";import"./motion-BILbV7YQ.js";import"./dialog-niHgO9y4.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 T=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],A=N("refresh-cw",T);function P({artifactId:c,onBack:n}){v();const[t,o]=i.useState(null),[x,p]=i.useState(""),[f,d]=i.useState(!1),[u,m]=i.useState(0),[h,l]=i.useState(!1);i.useEffect(()=>{let a=!1;return g(c).then(r=>{a||o(r)}).catch(r=>{a||p(r instanceof Error?r.message:s("artifacts.viewNotFound"))}),()=>{a=!0}},[c]);const y=i.useCallback(a=>{l(!1),o(r=>r?{...r,...a}:a),m(r=>r+1)},[]),b=i.useCallback(async()=>{if(window.confirm(s("artifacts.delete")+" — "+c.slice(0,8)+"…?"))try{await w(c),n()}catch(a){alert(a instanceof Error?a.message:s("artifacts.deleteFailed"))}},[c,n]),j=i.useCallback(async()=>{if(!t)return;await C(`${window.location.origin}${t.url}`)&&(d(!0),setTimeout(()=>d(!1),1500))},[t]);return x?e.jsx("div",{className:"flex flex-1 items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-status-error",children:s("artifacts.viewNotFound")}),e.jsx("p",{className:"mt-1 text-xs text-text-muted",children:x}),e.jsx("button",{type:"button",onClick:n,className:"mt-4 rounded-md border border-border px-4 py-2 text-sm text-text-secondary hover:bg-surface-2",children:s("artifacts.backToGallery")})]})}):t?e.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 border-b border-border bg-surface-1 px-4 py-2.5",children:[e.jsx("button",{type:"button",onClick:n,className:"text-sm text-text-muted hover:text-text-primary",children:s("artifacts.backToGallery")}),e.jsx("span",{className:"text-text-muted/40",children:"/"}),e.jsx("span",{className:"truncate font-medium text-text-primary",children:t.title||t.id.slice(0,12)}),e.jsxs("span",{className:"rounded-full bg-surface-3 px-2 py-0.5 text-[11px] text-text-muted",children:["v",t.version]}),t.session_id&&e.jsxs("a",{href:`/code/${t.session_id}`,className:"truncate font-mono text-[11px] text-text-muted hover:text-accent",title:t.session_id,children:[s("artifacts.session"),": ",t.session_id.slice(0,14),"…"]}),t.expires_at&&e.jsxs("span",{className:"text-[11px] text-text-muted",title:t.expires_at,children:[s("artifacts.expires"),": ",new Date(t.expires_at).toLocaleDateString()]}),e.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[e.jsx("button",{type:"button",onClick:()=>m(a=>a+1),className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-surface-2 hover:text-text-primary",title:s("common.loading"),children:e.jsx(A,{className:"h-3.5 w-3.5"})}),t.can_manage&&e.jsx("button",{type:"button",onClick:()=>l(!0),className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-surface-2 hover:text-text-primary",title:s("artifacts.edit"),children:e.jsx(k,{className:"h-3.5 w-3.5"})}),e.jsxs("button",{type:"button",onClick:j,className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-surface-2 hover:text-text-primary",title:`${s("artifacts.copyLink")} · ${s("artifacts.linkNotice")}`,children:[e.jsx(L,{className:"h-3.5 w-3.5"}),f&&e.jsx("span",{className:"text-status-active",children:s("artifacts.copied")})]}),e.jsx("a",{href:t.url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-surface-2 hover:text-text-primary",title:s("artifacts.openInNewTab"),children:e.jsx(E,{className:"h-3.5 w-3.5"})}),e.jsx("button",{type:"button",onClick:b,className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-status-error/10 hover:text-status-error",title:s("artifacts.delete"),children:e.jsx(_,{className:"h-3.5 w-3.5"})})]})]}),e.jsx("iframe",{src:`${t.url}${t.url.includes("?")?"&":"?"}_=${Date.now()}`,title:t.title||t.id,className:"min-h-0 w-full flex-1 border-0 bg-white",sandbox:"allow-scripts allow-popups allow-forms"},u),e.jsx($,{open:h,onClose:()=>l(!1),onCreated:y,editArtifact:t})]}):e.jsx("div",{className:"flex flex-1 items-center justify-center text-text-muted",children:s("common.loading")})}export{P as ArtifactView};
@@ -1,4 +1,9 @@
1
- import{e as i,j as e}from"./vendor-DE_-CLIE.js";import{ar as D,W as L,am as a,K as R,aa as B,F as M,g as K,z as A,p as S,H as P}from"./main-2FF76CHO.js";import{D as H,a as F,c as O,d as _,b as z}from"./dialog-aHICCHyK.js";import{E as $}from"./external-link-Cb0Qh2uy.js";import{C as q}from"./copy-BFkM6GS4.js";import"./shiki-mEP5vQQu.js";import"./motion-BILbV7YQ.js";const v=`body { font: 14px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; max-width: 860px; margin: 2rem auto; padding: 0 1rem; color: #1a1a1a; }
1
+ import{e as r,j as e}from"./vendor-DE_-CLIE.js";import{ab as _,ar as K,W as O,am as a,K as $,aa as q,F as z,g as G,P as V,z as W,p as P,V as U,H as Y,b as J}from"./main-49JlcYCi.js";import{D as Q,a as X,c as Z,d as ee,b as te}from"./dialog-niHgO9y4.js";import{C as ae}from"./copy-BdcZVl_u.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 se=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],re=_("external-link",se),T=`body { font: 14px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; max-width: 860px; margin: 2rem auto; padding: 0 1rem; color: #1a1a1a; }
2
7
  h1 { font-size: 22px; } h1, h2 { color: #1a1a1a; }
3
8
  .badge { display: inline-block; border-radius: 999px; padding: 1px 10px; font-size: 12px; font-weight: 500; }
4
9
  .badge.ok { background: #dcfce7; color: #166534; }
@@ -6,14 +11,14 @@ h1 { font-size: 22px; } h1, h2 { color: #1a1a1a; }
6
11
  .badge.err { background: #fee2e2; color: #991b1b; }
7
12
  .badge.info { background: #e0e7ff; color: #3730a3; }
8
13
  .muted { color: #6b7280; font-size: 12px; }
9
- .meta { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin: 8px 0 20px; }`,G=`<!DOCTYPE html>
14
+ .meta { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin: 8px 0 20px; }`,ne=`<!DOCTYPE html>
10
15
  <html lang="en">
11
16
  <head>
12
17
  <meta charset="utf-8">
13
18
  <meta name="viewport" content="width=device-width, initial-scale=1">
14
19
  <title>Untitled Artifact</title>
15
20
  <style>
16
- ${v}
21
+ ${T}
17
22
  </style>
18
23
  </head>
19
24
  <body>
@@ -21,14 +26,14 @@ ${v}
21
26
  <div class="meta"><span class="muted">Created from the RCS artifacts gallery</span></div>
22
27
  <!-- content here -->
23
28
  </body>
24
- </html>`,V=`<!DOCTYPE html>
29
+ </html>`,ie=`<!DOCTYPE html>
25
30
  <html lang="en">
26
31
  <head>
27
32
  <meta charset="utf-8">
28
33
  <meta name="viewport" content="width=device-width, initial-scale=1">
29
34
  <title>PR Review</title>
30
35
  <style>
31
- ${v}
36
+ ${T}
32
37
  .file { border: 1px solid #e5e7eb; border-radius: 8px; margin: 12px 0; overflow: hidden; }
33
38
  .file-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #f9fafb; cursor: pointer; }
34
39
  .file-head .name { font-family: ui-monospace, Menlo, monospace; font-size: 13px; flex: 1; }
@@ -103,14 +108,14 @@ function render() {
103
108
  render();
104
109
  <\/script>
105
110
  </body>
106
- </html>`,W=`<!DOCTYPE html>
111
+ </html>`,le=`<!DOCTYPE html>
107
112
  <html lang="en">
108
113
  <head>
109
114
  <meta charset="utf-8">
110
115
  <meta name="viewport" content="width=device-width, initial-scale=1">
111
116
  <title>Incident Timeline</title>
112
117
  <style>
113
- ${v}
118
+ ${T}
114
119
  #status-banner { border-radius: 8px; padding: 12px 16px; margin: 12px 0; font-weight: 500; }
115
120
  #status-banner.investigating { background: #fef3c7; color: #92400e; }
116
121
  #status-banner.mitigated { background: #dcfce7; color: #166534; }
@@ -169,14 +174,14 @@ document.getElementById('toggle').addEventListener('click', function () {
169
174
  render();
170
175
  <\/script>
171
176
  </body>
172
- </html>`,U=`<!DOCTYPE html>
177
+ </html>`,oe=`<!DOCTYPE html>
173
178
  <html lang="en">
174
179
  <head>
175
180
  <meta charset="utf-8">
176
181
  <meta name="viewport" content="width=device-width, initial-scale=1">
177
182
  <title>Data Dashboard</title>
178
183
  <style>
179
- ${v}
184
+ ${T}
180
185
  .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 16px 0; }
181
186
  .kpi { border: 1px solid #e5e7eb; border-radius: 10px; padding: 14px 16px; }
182
187
  .kpi .label { font-size: 12px; color: #6b7280; }
@@ -259,14 +264,14 @@ function renderTable() {
259
264
  renderKpis(); renderChart(); renderTable();
260
265
  <\/script>
261
266
  </body>
262
- </html>`,Y=`<!DOCTYPE html>
267
+ </html>`,de=`<!DOCTYPE html>
263
268
  <html lang="en">
264
269
  <head>
265
270
  <meta charset="utf-8">
266
271
  <meta name="viewport" content="width=device-width, initial-scale=1">
267
272
  <title>Release Checklist</title>
268
273
  <style>
269
- ${v}
274
+ ${T}
270
275
  .progress { height: 8px; background: #e5e7eb; border-radius: 999px; overflow: hidden; margin: 14px 0 22px; }
271
276
  .progress > div { height: 100%; background: #D77757; width: 0; transition: width .3s; }
272
277
  .stage { margin: 18px 0; }
@@ -336,4 +341,4 @@ function render() {
336
341
  render();
337
342
  <\/script>
338
343
  </body>
339
- </html>`,N=[{id:"blank",titleKey:"artifacts.create.templateBlank",descKey:"",defaultTitle:"Untitled Artifact",html:G},{id:"pr-review",titleKey:"artifacts.create.templatePrReview",descKey:"artifacts.templateDesc.prReview",defaultTitle:"PR Review",html:V},{id:"incident",titleKey:"artifacts.create.templateIncident",descKey:"artifacts.templateDesc.incident",defaultTitle:"Incident Timeline",html:W},{id:"dashboard",titleKey:"artifacts.create.templateDashboard",descKey:"artifacts.templateDesc.dashboard",defaultTitle:"Data Dashboard",html:U},{id:"checklist",titleKey:"artifacts.create.templateChecklist",descKey:"artifacts.templateDesc.checklist",defaultTitle:"Release Checklist",html:Y}];function b(s){return N.find(o=>o.id===s)??N[0]}function I(s){return s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(1)} KB`:`${(s/(1024*1024)).toFixed(1)} MB`}function J(s){if(!s)return"—";try{return new Date(s).toLocaleString()}catch{return s}}function Q(s){if(!s)return null;const o=new Date(s).getTime();return Number.isNaN(o)?null:Math.ceil((o-Date.now())/(1440*60*1e3))}function ie({sessionId:s,embedded:o=!1}){D();const[y,u]=i.useState([]),[m,w]=i.useState(!0),[x,f]=i.useState(""),[p,d]=i.useState(!1),[k,h]=i.useState(null),c=i.useCallback(async()=>{try{const t=await L(s?{session_id:s}:void 0);u(t||[]),f("")}catch(t){f(t instanceof Error?t.message:a("artifacts.loadFailed"))}finally{w(!1)}},[s]);i.useEffect(()=>{c();const t=setInterval(c,15e3);return window.addEventListener("focus",c),()=>{clearInterval(t),window.removeEventListener("focus",c)}},[c]);const g=i.useCallback(t=>{d(!1),u(n=>[t,...n.filter(C=>C.id!==t.id)])},[]),E=i.useCallback(async t=>{if(window.confirm(a("artifacts.delete")+" — "+t.slice(0,8)+"…?"))try{await R(t),u(n=>n.filter(C=>C.id!==t))}catch(n){alert(n instanceof Error?n.message:a("artifacts.deleteFailed"))}},[]),j=i.useCallback(async t=>{await B(`${window.location.origin}${t.url}`)&&(h(t.id),setTimeout(()=>h(null),1500))},[]),r=i.useMemo(()=>y,[y]),l=e.jsxs(e.Fragment,{children:[x&&e.jsx("p",{className:"text-status-error text-sm",children:x}),m?e.jsx("div",{className:"space-y-3",children:[0,1,2].map(t=>e.jsx("div",{className:"h-20 animate-pulse rounded-lg bg-surface-2"},t))}):r.length===0?e.jsxs("div",{className:"rounded-lg border border-dashed border-border py-12 text-center",children:[e.jsx(M,{className:"mx-auto h-8 w-8 text-text-muted/40"}),e.jsx("p",{className:"mt-3 text-sm text-text-muted",children:a("artifacts.empty")})]}):e.jsx("ul",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-3",children:r.map(t=>{const n=Q(t.expires_at);return e.jsxs("li",{className:"group rounded-lg border border-border bg-surface-1 p-4 transition-colors hover:border-brand/50",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("a",{href:`/code/a/${t.id}`,className:"min-w-0 flex-1 no-underline",children:[e.jsx("h3",{className:"truncate font-medium text-text-primary group-hover:text-accent",children:t.title||t.id.slice(0,12)}),e.jsxs("p",{className:"mt-1 font-mono text-xs text-text-muted",children:[t.id.slice(0,10),"… · v",t.version," · ",I(t.size)]})]}),e.jsx("span",{className:`flex-shrink-0 rounded-full px-2 py-0.5 text-[11px] font-medium ${n!==null&&n<=0?"bg-status-error/15 text-status-error":n!==null&&n<=2?"bg-status-warning/15 text-status-warning":"bg-surface-3 text-text-muted"}`,children:n===null?"∞":`${n}d`})]}),e.jsxs("div",{className:"mt-2 flex items-center gap-3 text-xs text-text-muted",children:[t.session_id&&e.jsxs("a",{href:`/code/${t.session_id}`,className:"truncate text-text-muted hover:text-accent",title:t.session_id,children:[a("artifacts.session"),": ",t.session_id.slice(0,14),"…"]}),e.jsxs("span",{className:"flex items-center gap-1",title:a("artifacts.updatedAt"),children:[e.jsx(K,{className:"h-3 w-3"}),J(t.updated_at)]})]}),e.jsxs("div",{className:"mt-3 flex items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100",children:[e.jsx("a",{href:t.url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-surface-2 hover:text-text-primary",title:a("artifacts.openInNewTab"),children:e.jsx($,{className:"h-3.5 w-3.5"})}),e.jsxs("button",{type:"button",onClick:()=>j(t),className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-surface-2 hover:text-text-primary",title:a("artifacts.copyLink"),children:[e.jsx(q,{className:"h-3.5 w-3.5"}),k===t.id&&e.jsx("span",{className:"text-status-active",children:a("artifacts.copied")})]}),e.jsx("button",{type:"button",onClick:()=>E(t.id),className:"ml-auto inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-status-error/10 hover:text-status-error",title:a("artifacts.delete"),children:e.jsx(A,{className:"h-3.5 w-3.5"})})]})]},t.id)})})]});return o?e.jsxs("div",{children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("h2",{className:"text-sm font-medium text-text-primary",children:a("artifacts.title")}),e.jsxs("button",{type:"button",onClick:()=>d(!0),className:"inline-flex items-center gap-1 rounded-md bg-accent px-3 py-1.5 text-sm font-medium text-white hover:bg-accent/90",children:[e.jsx(S,{className:"h-4 w-4"}),a("artifacts.new")]})]}),l,e.jsx(T,{open:p,onClose:()=>d(!1),onCreated:g,sessionId:s})]}):e.jsxs("div",{className:"px-6 py-16 sm:px-10 sm:py-20",children:[e.jsxs("header",{className:"mb-10 flex items-start justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"font-display text-3xl font-semibold tracking-tight text-text-primary sm:text-4xl",children:a("artifacts.title")}),e.jsx("p",{className:"mt-3 text-sm text-text-muted",children:a("artifacts.subtitle")})]}),e.jsxs("button",{type:"button",onClick:()=>d(!0),className:"inline-flex items-center gap-2 rounded-md bg-accent px-4 py-2 text-sm font-medium text-white transition-all hover:bg-accent/90 active:translate-y-px",children:[e.jsx(S,{className:"h-4 w-4"}),a("artifacts.new")]})]}),l,e.jsx(T,{open:p,onClose:()=>d(!1),onCreated:g,sessionId:s})]})}function T({open:s,onClose:o,onCreated:y,sessionId:u}){D();const[m,w]=i.useState("pr-review"),[x,f]=i.useState(""),[p,d]=i.useState(""),[k,h]=i.useState(!1),[c,g]=i.useState("");i.useEffect(()=>{s&&(w("pr-review"),f(""),d(""),h(!1),g(""))},[s]);const E=r=>{w(r);const l=b(r);d(l.html),x.trim()||f(l.defaultTitle)},j=async()=>{const r=p.trim()||b(m).html;if(r){h(!0),g("");try{const l={html:r,title:x.trim()||b(m).defaultTitle,ttl:30};u&&(l.session_id=u);const t=await P(l);y(t)}catch(l){g(l instanceof Error?l.message:a("artifacts.create.failed"))}finally{h(!1)}}};return e.jsx(H,{open:s,onOpenChange:r=>r?void 0:o(),children:e.jsxs(F,{className:"max-h-[85vh] overflow-y-auto sm:max-w-2xl",children:[e.jsx(O,{children:e.jsx(_,{children:a("artifacts.create.title")})}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-2 block text-sm font-medium text-text-primary",children:a("artifacts.create.template")}),e.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3",children:N.map(r=>e.jsxs("button",{type:"button",onClick:()=>E(r.id),className:`rounded-lg border p-3 text-left transition-colors ${m===r.id?"border-accent bg-accent/10":"border-border hover:border-accent/50"}`,children:[e.jsx("div",{className:"text-sm font-medium text-text-primary",children:a(r.titleKey)}),r.descKey&&e.jsx("div",{className:"mt-1 text-xs text-text-muted",children:a(r.descKey)})]},r.id))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"artifact-title",children:a("artifacts.create.title.label")}),e.jsx("input",{id:"artifact-title",type:"text",value:x,onChange:r=>f(r.target.value),placeholder:b(m).defaultTitle,className:"w-full rounded-md border border-border bg-surface-1 px-3 py-2 text-sm text-text-primary focus:border-accent focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"artifact-content",children:a("artifacts.create.content")}),e.jsx("textarea",{id:"artifact-content",value:p,onChange:r=>d(r.target.value),placeholder:b(m).html.slice(0,120)+"…",rows:10,spellCheck:!1,className:"w-full rounded-md border border-border bg-surface-1 px-3 py-2 font-mono text-xs text-text-primary focus:border-accent focus:outline-none"}),e.jsx("p",{className:"mt-1 text-xs text-text-muted",children:p.trim()?`${I(new Blob([p]).size)}`:a("artifacts.create.content")})]}),c&&e.jsx("p",{className:"text-sm text-status-error",children:c})]}),e.jsxs(z,{children:[e.jsx("button",{type:"button",onClick:o,className:"rounded-md border border-border px-4 py-2 text-sm text-text-secondary hover:bg-surface-2",children:a("common.cancel")}),e.jsx("button",{type:"button",onClick:j,disabled:k,className:"rounded-md bg-accent px-4 py-2 text-sm font-medium text-white hover:bg-accent/90 disabled:opacity-50",children:k?a("common.creating"):a("artifacts.create.submit")})]})]})})}export{ie as ArtifactsGallery};
344
+ </html>`,M=[{id:"blank",titleKey:"artifacts.create.templateBlank",descKey:"",defaultTitle:"Untitled Artifact",html:ne},{id:"pr-review",titleKey:"artifacts.create.templatePrReview",descKey:"artifacts.templateDesc.prReview",defaultTitle:"PR Review",html:ie},{id:"incident",titleKey:"artifacts.create.templateIncident",descKey:"artifacts.templateDesc.incident",defaultTitle:"Incident Timeline",html:le},{id:"dashboard",titleKey:"artifacts.create.templateDashboard",descKey:"artifacts.templateDesc.dashboard",defaultTitle:"Data Dashboard",html:oe},{id:"checklist",titleKey:"artifacts.create.templateChecklist",descKey:"artifacts.templateDesc.checklist",defaultTitle:"Release Checklist",html:de}];function S(n){return M.find(p=>p.id===n)??M[0]}function A(n){return n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`}function ce(n){if(!n)return"—";try{return new Date(n).toLocaleString()}catch{return n}}function me(n){if(!n)return null;const p=new Date(n).getTime();return Number.isNaN(p)?null:Math.ceil((p-Date.now())/(1440*60*1e3))}function pe({sessionId:n,embedded:p=!1,refreshTick:L}){K();const[y,l]=r.useState([]),[d,g]=r.useState(!0),[w,b]=r.useState(""),[u,o]=r.useState(!1),[x,f]=r.useState(null),[D,k]=r.useState(null),c=r.useCallback(async()=>{try{const t=await O(n?{session_id:n}:void 0);l(t||[]),b("")}catch(t){b(t instanceof Error?t.message:a("artifacts.loadFailed"))}finally{g(!1)}},[n]);r.useEffect(()=>{c();const t=setInterval(c,15e3);return window.addEventListener("focus",c),()=>{clearInterval(t),window.removeEventListener("focus",c)}},[c]);const E=r.useRef(!1);r.useEffect(()=>{if(!E.current){E.current=!0;return}c()},[L,c]);const h=r.useCallback(t=>{o(!1),f(null),l(i=>[t,...i.filter(C=>C.id!==t.id)])},[]),I=r.useCallback(async t=>{if(window.confirm(a("artifacts.delete")+" — "+t.slice(0,8)+"…?"))try{await $(t),l(i=>i.filter(C=>C.id!==t))}catch(i){alert(i instanceof Error?i.message:a("artifacts.deleteFailed"))}},[]),j=r.useCallback(async t=>{await q(`${window.location.origin}${t.url}`)&&(k(t.id),setTimeout(()=>k(null),1500))},[]),N=r.useMemo(()=>y,[y]),v=e.jsxs(e.Fragment,{children:[w&&e.jsx("p",{className:"text-status-error text-sm",children:w}),d?e.jsx("div",{className:"space-y-3",children:[0,1,2].map(t=>e.jsx("div",{className:"h-20 animate-pulse rounded-lg bg-surface-2"},t))}):N.length===0?e.jsxs("div",{className:"rounded-lg border border-dashed border-border py-12 text-center",children:[e.jsx(z,{className:"mx-auto h-8 w-8 text-text-muted/40"}),e.jsx("p",{className:"mt-3 text-sm text-text-muted",children:a("artifacts.empty")})]}):e.jsx("ul",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-3",children:N.map(t=>{const i=me(t.expires_at);return e.jsxs("li",{className:"group rounded-lg border border-border bg-surface-1 p-4 transition-colors hover:border-brand/50",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("a",{href:`/code/a/${t.id}`,className:"min-w-0 flex-1 no-underline",children:[e.jsx("h3",{className:"truncate font-medium text-text-primary group-hover:text-accent",children:t.title||t.id.slice(0,12)}),e.jsxs("p",{className:"mt-1 font-mono text-xs text-text-muted",children:[t.id.slice(0,10),"… · v",t.version," · ",A(t.size)]})]}),e.jsx("span",{className:`flex-shrink-0 rounded-full px-2 py-0.5 text-[11px] font-medium ${i!==null&&i<=0?"bg-status-error/15 text-status-error":i!==null&&i<=2?"bg-status-warning/15 text-status-warning":"bg-surface-3 text-text-muted"}`,children:i===null?"∞":`${i}d`})]}),e.jsxs("div",{className:"mt-2 flex items-center gap-3 text-xs text-text-muted",children:[t.session_id&&e.jsxs("a",{href:`/code/${t.session_id}`,className:"truncate text-text-muted hover:text-accent",title:t.session_id,children:[a("artifacts.session"),": ",t.session_id.slice(0,14),"…"]}),e.jsxs("span",{className:"flex items-center gap-1",title:a("artifacts.updatedAt"),children:[e.jsx(G,{className:"h-3 w-3"}),ce(t.updated_at)]})]}),e.jsxs("div",{className:"mt-3 flex items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100",children:[e.jsx("a",{href:t.url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-surface-2 hover:text-text-primary",title:a("artifacts.openInNewTab"),children:e.jsx(re,{className:"h-3.5 w-3.5"})}),e.jsxs("button",{type:"button",onClick:()=>j(t),className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-surface-2 hover:text-text-primary",title:`${a("artifacts.copyLink")} · ${a("artifacts.linkNotice")}`,children:[e.jsx(ae,{className:"h-3.5 w-3.5"}),D===t.id&&e.jsx("span",{className:"text-status-active",children:a("artifacts.copied")})]}),t.can_manage&&e.jsx("button",{type:"button",onClick:()=>f(t),className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-surface-2 hover:text-text-primary",title:a("artifacts.edit"),children:e.jsx(V,{className:"h-3.5 w-3.5"})}),e.jsx("button",{type:"button",onClick:()=>I(t.id),className:"ml-auto inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-status-error/10 hover:text-status-error",title:a("artifacts.delete"),children:e.jsx(W,{className:"h-3.5 w-3.5"})})]})]},t.id)})})]});return p?e.jsxs("div",{children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("h2",{className:"text-sm font-medium text-text-primary",children:a("artifacts.title")}),e.jsxs("button",{type:"button",onClick:()=>{f(null),o(!0)},className:"inline-flex items-center gap-1 rounded-md bg-accent px-3 py-1.5 text-sm font-medium text-white hover:bg-accent/90",children:[e.jsx(P,{className:"h-4 w-4"}),a("artifacts.new")]})]}),v,e.jsx(B,{open:u,onClose:()=>o(!1),onCreated:h,sessionId:n,editArtifact:x})]}):e.jsxs("div",{className:"px-6 py-16 sm:px-10 sm:py-20",children:[e.jsxs("header",{className:"mb-10 flex items-start justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"font-display text-3xl font-semibold tracking-tight text-text-primary sm:text-4xl",children:a("artifacts.title")}),e.jsx("p",{className:"mt-3 text-sm text-text-muted",children:a("artifacts.subtitle")})]}),e.jsxs("button",{type:"button",onClick:()=>{f(null),o(!0)},className:"inline-flex items-center gap-2 rounded-md bg-accent px-4 py-2 text-sm font-medium text-white transition-all hover:bg-accent/90 active:translate-y-px",children:[e.jsx(P,{className:"h-4 w-4"}),a("artifacts.new")]})]}),v,e.jsx(B,{open:u,onClose:()=>o(!1),onCreated:h,sessionId:n,editArtifact:x})]})}function B({open:n,onClose:p,onCreated:L,sessionId:y,editArtifact:l}){K();const d=!!l,[g,w]=r.useState("pr-review"),[b,u]=r.useState(""),[o,x]=r.useState(""),[f,D]=r.useState(30),[k,c]=r.useState(!1),[E,h]=r.useState(""),[I,j]=r.useState(!1),[N,v]=r.useState(!1);r.useEffect(()=>{n&&(w("pr-review"),D(30),c(!1),h(""),v(!1),l?(j(!0),u(l.title??""),x(""),U(l.id).then(s=>{u(s.title??""),x(s.content??""),s.can_manage===!1&&v(!0)}).catch(()=>v(!0)).finally(()=>j(!1))):(j(!1),u(""),x(S("pr-review").html)))},[n,l]);const t=s=>{w(s);const m=S(s);x(m.html),b.trim()||u(m.defaultTitle)},[i,C]=r.useState("");r.useEffect(()=>{const s=setTimeout(()=>C(o),300);return()=>clearTimeout(s)},[o]);const F=o.trim().length>0&&!k&&!I&&!N,H=async()=>{const s=o.trim();if(s){c(!0),h("");try{const m={html:s,ttl:f,title:b.trim()||(d?void 0:S(g).defaultTitle)};d?l&&(m.hash=l.id):y&&(m.session_id=y);const R=await Y(m);L(R)}catch(m){const R=m instanceof Error?m.message:"";m instanceof J&&m.status===404?h(a("artifacts.viewNotFound")):h(R||a(d?"artifacts.updateFailed":"artifacts.create.failed"))}finally{c(!1)}}};return e.jsx(Q,{open:n,onOpenChange:s=>s?void 0:p(),children:e.jsxs(X,{className:"max-h-[85vh] overflow-y-auto sm:max-w-4xl",children:[e.jsx(Z,{children:e.jsx(ee,{children:d?a("artifacts.editArtifact"):a("artifacts.create.title")})}),e.jsxs("div",{className:"space-y-4",children:[!d&&e.jsxs("div",{children:[e.jsx("label",{className:"mb-2 block text-sm font-medium text-text-primary",children:a("artifacts.create.template")}),e.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3",children:M.map(s=>e.jsxs("button",{type:"button",onClick:()=>t(s.id),className:`rounded-lg border p-3 text-left transition-colors ${g===s.id?"border-accent bg-accent/10":"border-border hover:border-accent/50"}`,children:[e.jsx("div",{className:"text-sm font-medium text-text-primary",children:a(s.titleKey)}),s.descKey&&e.jsx("div",{className:"mt-1 text-xs text-text-muted",children:a(s.descKey)})]},s.id))})]}),d&&l&&e.jsxs("p",{className:"text-xs text-text-muted",children:[e.jsxs("span",{className:"font-mono",children:[l.id.slice(0,10),"…"]})," · v",l.version]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-[1fr_auto] sm:items-end",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"artifact-title",children:a("artifacts.create.title.label")}),e.jsx("input",{id:"artifact-title",type:"text",value:b,onChange:s=>u(s.target.value),placeholder:d?"":S(g).defaultTitle,className:"w-full rounded-md border border-border bg-surface-1 px-3 py-2 text-sm text-text-primary focus:border-accent focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"artifact-ttl",children:a("artifacts.create.ttl")}),e.jsx("div",{className:"flex items-center gap-2",children:[7,30].map(s=>e.jsxs("button",{type:"button",onClick:()=>D(s),className:`rounded-md border px-3 py-2 text-sm transition-colors ${f===s?"border-accent bg-accent/10 font-medium text-text-primary":"border-border text-text-secondary hover:border-accent/50"}`,children:[s,"d"]},s))})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"artifact-content",children:a("artifacts.create.content")}),e.jsx("textarea",{id:"artifact-content",value:o,onChange:s=>x(s.target.value),placeholder:d?"":S(g).html.slice(0,120)+"…",rows:12,spellCheck:!1,disabled:I,className:"w-full rounded-md border border-border bg-surface-1 px-3 py-2 font-mono text-xs text-text-primary focus:border-accent focus:outline-none disabled:opacity-50"}),e.jsxs("div",{className:"mt-1 flex items-center justify-between text-xs text-text-muted",children:[e.jsx("span",{children:o.trim()?A(new Blob([o]).size):a("artifacts.create.contentRequired")}),e.jsx("span",{children:a("artifacts.create.ttlResetNote")})]})]}),i.trim()&&e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs font-medium text-text-muted",children:a("artifacts.create.preview")}),e.jsx("iframe",{srcDoc:i,title:"preview",className:"h-56 w-full rounded-md border border-border bg-white",sandbox:"allow-scripts allow-popups allow-forms"})]}),N&&e.jsx("p",{className:"text-sm text-status-error",children:a("artifacts.viewNotFound")}),E&&e.jsx("p",{className:"text-sm text-status-error",children:E})]}),e.jsxs(te,{children:[e.jsx("button",{type:"button",onClick:p,className:"rounded-md border border-border px-4 py-2 text-sm text-text-secondary hover:bg-surface-2",children:a("common.cancel")}),e.jsx("button",{type:"button",onClick:H,disabled:!F,className:"rounded-md bg-accent px-4 py-2 text-sm font-medium text-white hover:bg-accent/90 disabled:opacity-50",children:k?a("common.creating"):d?a("artifacts.update"):a("artifacts.create.submit")})]})]})})}const ge=Object.freeze(Object.defineProperty({__proto__:null,ArtifactsGallery:pe,CreateArtifactDialog:B},Symbol.toStringTag,{value:"Module"}));export{pe as A,B as C,re as E,ge as a};
@@ -1 +1 @@
1
- import{e as r,j as e}from"./vendor-DE_-CLIE.js";import{E as u,Q as f}from"./main-2FF76CHO.js";import"./shiki-mEP5vQQu.js";import"./motion-BILbV7YQ.js";const v=2e3,N=3e4;function E(){const c=window.location.pathname.split("/"),i=c[c.length-1]||"",[s,n]=r.useState("idle"),[m,l]=r.useState(null),[a,d]=r.useState(null);return r.useEffect(()=>{if(!i||!i.startsWith("clm_")){l("Invalid claim token"),n("error");return}n("claiming"),u(i).then(t=>{d(t.environment_id),n("waiting")}).catch(t=>{l(t instanceof Error?t.message:"Claim failed"),n("error")})},[i]),r.useEffect(()=>{if(s!=="waiting"||!a)return;let t=!1;const x=Date.now(),o=setInterval(()=>{if(Date.now()-x>N){clearInterval(o),t||n("timeout");return}f().then(h=>{t||(h||[]).some(p=>p.environment_id===a)&&(clearInterval(o),window.location.href="/code/")}).catch(()=>{})},v);return()=>{t=!0,clearInterval(o)}},[s,a]),s==="claiming"?e.jsx("div",{className:"px-6 py-16 sm:px-10 sm:py-20",children:e.jsx("p",{className:"text-sm text-text-muted",children:"Claiming environment..."})}):s==="error"?e.jsxs("div",{className:"px-6 py-16 sm:px-10 sm:py-20",children:[e.jsx("p",{className:"text-sm text-destructive",children:m}),e.jsx("a",{href:"/code",className:"mt-4 inline-block text-accent hover:underline",children:"Back to dashboard"})]}):s==="waiting"||s==="timeout"?e.jsxs("div",{className:"px-6 py-16 sm:px-10 sm:py-20",children:[e.jsxs("header",{className:"mb-10",children:[e.jsx("h1",{className:"font-display text-2xl font-semibold tracking-tight text-text-primary",children:"Environment claimed"}),e.jsx("p",{className:"mt-2 text-sm text-text-muted",children:"You are now the owner of this environment."})]}),e.jsxs("div",{className:"space-y-4",children:[a&&e.jsx("p",{className:"font-mono text-xs text-text-muted",children:a}),s==="waiting"?e.jsxs("p",{className:"text-sm text-text-muted",children:["Waiting for the worker to create a session",e.jsx("span",{className:"animate-pulse",children:"…"})]}):e.jsx("p",{className:"text-sm text-text-muted",children:"The worker has not created a session yet — it may be offline or stopped. The session will appear on the dashboard once the worker connects."}),e.jsx("a",{href:"/code",className:"inline-block rounded-md bg-accent px-4 py-2 text-sm font-medium text-white hover:bg-accent/90 transition-colors",children:"Go to dashboard"})]})]}):e.jsx("div",{className:"px-6 py-16 sm:px-10 sm:py-20",children:e.jsx("p",{className:"text-sm text-text-muted",children:"Claiming environment..."})})}export{E as Claim};
1
+ import{e as r,j as e}from"./vendor-DE_-CLIE.js";import{E as u,Q as f}from"./main-49JlcYCi.js";import"./shiki-mEP5vQQu.js";import"./motion-BILbV7YQ.js";const v=2e3,N=3e4;function E(){const c=window.location.pathname.split("/"),i=c[c.length-1]||"",[s,n]=r.useState("idle"),[m,l]=r.useState(null),[a,d]=r.useState(null);return r.useEffect(()=>{if(!i||!i.startsWith("clm_")){l("Invalid claim token"),n("error");return}n("claiming"),u(i).then(t=>{d(t.environment_id),n("waiting")}).catch(t=>{l(t instanceof Error?t.message:"Claim failed"),n("error")})},[i]),r.useEffect(()=>{if(s!=="waiting"||!a)return;let t=!1;const x=Date.now(),o=setInterval(()=>{if(Date.now()-x>N){clearInterval(o),t||n("timeout");return}f().then(h=>{t||(h||[]).some(p=>p.environment_id===a)&&(clearInterval(o),window.location.href="/code/")}).catch(()=>{})},v);return()=>{t=!0,clearInterval(o)}},[s,a]),s==="claiming"?e.jsx("div",{className:"px-6 py-16 sm:px-10 sm:py-20",children:e.jsx("p",{className:"text-sm text-text-muted",children:"Claiming environment..."})}):s==="error"?e.jsxs("div",{className:"px-6 py-16 sm:px-10 sm:py-20",children:[e.jsx("p",{className:"text-sm text-destructive",children:m}),e.jsx("a",{href:"/code",className:"mt-4 inline-block text-accent hover:underline",children:"Back to dashboard"})]}):s==="waiting"||s==="timeout"?e.jsxs("div",{className:"px-6 py-16 sm:px-10 sm:py-20",children:[e.jsxs("header",{className:"mb-10",children:[e.jsx("h1",{className:"font-display text-2xl font-semibold tracking-tight text-text-primary",children:"Environment claimed"}),e.jsx("p",{className:"mt-2 text-sm text-text-muted",children:"You are now the owner of this environment."})]}),e.jsxs("div",{className:"space-y-4",children:[a&&e.jsx("p",{className:"font-mono text-xs text-text-muted",children:a}),s==="waiting"?e.jsxs("p",{className:"text-sm text-text-muted",children:["Waiting for the worker to create a session",e.jsx("span",{className:"animate-pulse",children:"…"})]}):e.jsx("p",{className:"text-sm text-text-muted",children:"The worker has not created a session yet — it may be offline or stopped. The session will appear on the dashboard once the worker connects."}),e.jsx("a",{href:"/code",className:"inline-block rounded-md bg-accent px-4 py-2 text-sm font-medium text-white hover:bg-accent/90 transition-colors",children:"Go to dashboard"})]})]}):e.jsx("div",{className:"px-6 py-16 sm:px-10 sm:py-20",children:e.jsx("p",{className:"text-sm text-text-muted",children:"Claiming environment..."})})}export{E as Claim};
@@ -1,4 +1,4 @@
1
- import{j as e,e as l}from"./vendor-DE_-CLIE.js";import{ab as O,a9 as _,as as E,aq as T,x as F,ar as L,am as a,ae as A,q as $,s as W,e as q,r as H,d as P,ah as V,I as Q,Q as R,Y as U,N as Y}from"./main-2FF76CHO.js";import{g as D}from"./workerType-Bd-zteMi.js";import{S as Z}from"./SessionVisibilityBadge-7ElYQ4hP.js";import{D as z,a as G,c as J,d as K,b as X}from"./dialog-aHICCHyK.js";import"./shiki-mEP5vQQu.js";import"./motion-BILbV7YQ.js";/**
1
+ import{j as e,e as l}from"./vendor-DE_-CLIE.js";import{ab as O,a9 as _,as as E,aq as T,x as F,ar as L,am as a,ae as A,q as $,s as W,e as q,r as H,d as P,ah as V,I as Q,Q as R,Y as U,N as Y}from"./main-49JlcYCi.js";import{g as D}from"./workerType-Bd-zteMi.js";import{S as Z}from"./SessionVisibilityBadge-B33i8RLj.js";import{D as z,a as G,c as J,d as K,b as X}from"./dialog-niHgO9y4.js";import"./shiki-mEP5vQQu.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.
@@ -1 +1 @@
1
- import{e as r,j as e}from"./vendor-DE_-CLIE.js";import{aq as v,am as t}from"./main-2FF76CHO.js";import"./shiki-mEP5vQQu.js";import"./motion-BILbV7YQ.js";function E({onSuccess:b,onInvalidInvite:l}){const{join:h}=v(),[u,f]=r.useState(""),[d,j]=r.useState(""),[o,w]=r.useState(""),[c,g]=r.useState(""),[m,n]=r.useState(""),[x,p]=r.useState(!1);r.useEffect(()=>{const a=new URLSearchParams(window.location.search).get("invite");a?f(a):l()},[l]);const y=async s=>{if(s.preventDefault(),n(""),o.length<8){n(t("auth.setup.passwordTooShort"));return}if(o!==c){n(t("auth.setup.passwordMismatch"));return}p(!0);try{await h(u,d,o),b()}catch(a){const i=a instanceof Error?a.message:"Join failed";if(i.includes("Invalid invitation")||i.includes("expired")||i.includes("already used")){l();return}n(i)}finally{p(!1)}};return e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface-0 px-4",children:e.jsxs("div",{className:"w-full max-w-sm space-y-6",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"font-display text-2xl font-semibold text-text-primary",children:t("auth.join.title")}),e.jsx("p",{className:"mt-2 text-sm text-text-muted",children:t("auth.join.welcome")}),e.jsx("p",{className:"mt-1 text-sm text-text-muted",children:t("auth.join.description")})]}),e.jsxs("form",{onSubmit:y,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.join.username")}),e.jsx("input",{type:"text",value:d,onChange:s=>j(s.target.value),required:!0,autoComplete:"username",autoFocus:!0,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.join.password")}),e.jsx("input",{type:"password",value:o,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"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.join.confirmPassword")}),e.jsx("input",{type:"password",value:c,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"})]}),m&&e.jsx("p",{className:"text-sm text-status-error",children:m}),e.jsx("button",{type:"submit",disabled:x||!u,className:"w-full rounded-lg bg-brand px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-brand-light disabled:cursor-not-allowed disabled:opacity-50",children:x?t("common.loading"):t("auth.join.submit")})]})]})})}export{E as Join};
1
+ import{e as r,j as e}from"./vendor-DE_-CLIE.js";import{aq as v,am as t}from"./main-49JlcYCi.js";import"./shiki-mEP5vQQu.js";import"./motion-BILbV7YQ.js";function E({onSuccess:b,onInvalidInvite:l}){const{join:h}=v(),[u,f]=r.useState(""),[d,j]=r.useState(""),[o,w]=r.useState(""),[c,g]=r.useState(""),[m,n]=r.useState(""),[x,p]=r.useState(!1);r.useEffect(()=>{const a=new URLSearchParams(window.location.search).get("invite");a?f(a):l()},[l]);const y=async s=>{if(s.preventDefault(),n(""),o.length<8){n(t("auth.setup.passwordTooShort"));return}if(o!==c){n(t("auth.setup.passwordMismatch"));return}p(!0);try{await h(u,d,o),b()}catch(a){const i=a instanceof Error?a.message:"Join failed";if(i.includes("Invalid invitation")||i.includes("expired")||i.includes("already used")){l();return}n(i)}finally{p(!1)}};return e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface-0 px-4",children:e.jsxs("div",{className:"w-full max-w-sm space-y-6",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"font-display text-2xl font-semibold text-text-primary",children:t("auth.join.title")}),e.jsx("p",{className:"mt-2 text-sm text-text-muted",children:t("auth.join.welcome")}),e.jsx("p",{className:"mt-1 text-sm text-text-muted",children:t("auth.join.description")})]}),e.jsxs("form",{onSubmit:y,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.join.username")}),e.jsx("input",{type:"text",value:d,onChange:s=>j(s.target.value),required:!0,autoComplete:"username",autoFocus:!0,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.join.password")}),e.jsx("input",{type:"password",value:o,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"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.join.confirmPassword")}),e.jsx("input",{type:"password",value:c,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"})]}),m&&e.jsx("p",{className:"text-sm text-status-error",children:m}),e.jsx("button",{type:"submit",disabled:x||!u,className:"w-full rounded-lg bg-brand px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-brand-light disabled:cursor-not-allowed disabled:opacity-50",children:x?t("common.loading"):t("auth.join.submit")})]})]})})}export{E as Join};
@@ -1 +1 @@
1
- import{e as r,j as e}from"./vendor-DE_-CLIE.js";import{aq as f,am as t}from"./main-2FF76CHO.js";import"./shiki-mEP5vQQu.js";import"./motion-BILbV7YQ.js";function N({onSuccess:d,onNavigateRegister:c}){const{login:m,registrationAllowed:x}=f(),[a,p]=r.useState(""),[o,b]=r.useState(""),[l,n]=r.useState(""),[i,u]=r.useState(!1),h=async s=>{s.preventDefault(),n(""),u(!0);try{await m(a,o),d()}catch{n(t("auth.login.failed"))}finally{u(!1)}};return e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface-0 px-4",children:e.jsxs("div",{className:"w-full max-w-sm space-y-6",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"font-display text-2xl font-semibold text-text-primary",children:t("auth.login.title")}),e.jsx("p",{className:"mt-2 text-sm text-text-muted",children:t("auth.login.description")})]}),e.jsxs("form",{onSubmit:h,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.login.username")}),e.jsx("input",{type:"text",value:a,onChange:s=>p(s.target.value),required:!0,autoComplete:"username",autoFocus:!0,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.login.password")}),e.jsx("input",{type:"password",value:o,onChange:s=>b(s.target.value),required:!0,autoComplete:"current-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"})]}),l&&e.jsx("p",{className:"text-sm text-status-error",children:l}),e.jsx("button",{type:"submit",disabled:i,className:"w-full rounded-lg bg-brand px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-brand-light disabled:cursor-not-allowed disabled:opacity-50",children:i?t("common.loading"):t("auth.login.submit")})]}),x&&e.jsx("button",{type:"button",onClick:c,className:"w-full text-center text-sm text-text-muted hover:text-text-primary transition-colors",children:t("auth.login.register")})]})})}export{N as Login};
1
+ import{e as r,j as e}from"./vendor-DE_-CLIE.js";import{aq as f,am as t}from"./main-49JlcYCi.js";import"./shiki-mEP5vQQu.js";import"./motion-BILbV7YQ.js";function N({onSuccess:d,onNavigateRegister:c}){const{login:m,registrationAllowed:x}=f(),[a,p]=r.useState(""),[o,b]=r.useState(""),[l,n]=r.useState(""),[i,u]=r.useState(!1),h=async s=>{s.preventDefault(),n(""),u(!0);try{await m(a,o),d()}catch{n(t("auth.login.failed"))}finally{u(!1)}};return e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface-0 px-4",children:e.jsxs("div",{className:"w-full max-w-sm space-y-6",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"font-display text-2xl font-semibold text-text-primary",children:t("auth.login.title")}),e.jsx("p",{className:"mt-2 text-sm text-text-muted",children:t("auth.login.description")})]}),e.jsxs("form",{onSubmit:h,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.login.username")}),e.jsx("input",{type:"text",value:a,onChange:s=>p(s.target.value),required:!0,autoComplete:"username",autoFocus:!0,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.login.password")}),e.jsx("input",{type:"password",value:o,onChange:s=>b(s.target.value),required:!0,autoComplete:"current-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"})]}),l&&e.jsx("p",{className:"text-sm text-status-error",children:l}),e.jsx("button",{type:"submit",disabled:i,className:"w-full rounded-lg bg-brand px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-brand-light disabled:cursor-not-allowed disabled:opacity-50",children:i?t("common.loading"):t("auth.login.submit")})]}),x&&e.jsx("button",{type:"button",onClick:c,className:"w-full text-center text-sm text-text-muted hover:text-text-primary transition-colors",children:t("auth.login.register")})]})})}export{N as Login};
@@ -1 +1 @@
1
- import{e as r,j as e}from"./vendor-DE_-CLIE.js";import{aq as y,am as t}from"./main-2FF76CHO.js";import"./shiki-mEP5vQQu.js";import"./motion-BILbV7YQ.js";function S({onSuccess:m,onBack:x}){const{register:p}=y(),[n,b]=r.useState(""),[a,h]=r.useState(""),[l,f]=r.useState(""),[i,o]=r.useState(""),[u,d]=r.useState(!1),g=async s=>{if(s.preventDefault(),o(""),a.length<8){o(t("auth.setup.passwordTooShort"));return}if(a!==l){o(t("auth.setup.passwordMismatch"));return}d(!0);try{await p(n,a),m()}catch(c){o(c instanceof Error?c.message:t("auth.register.failed"))}finally{d(!1)}};return e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface-0 px-4",children:e.jsxs("div",{className:"w-full max-w-sm space-y-6",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"font-display text-2xl font-semibold text-text-primary",children:t("auth.register.title")}),e.jsx("p",{className:"mt-2 text-sm text-text-muted",children:t("auth.register.description")})]}),e.jsxs("form",{onSubmit:g,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.login.username")}),e.jsx("input",{type:"text",value:n,onChange:s=>b(s.target.value),required:!0,autoComplete:"username",autoFocus:!0,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.login.password")}),e.jsx("input",{type:"password",value:a,onChange:s=>h(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.join.confirmPassword")}),e.jsx("input",{type:"password",value:l,onChange:s=>f(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:u,className:"w-full rounded-lg bg-brand px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-brand-light disabled:cursor-not-allowed disabled:opacity-50",children:u?t("common.loading"):t("auth.register.submit")})]}),e.jsx("button",{type:"button",onClick:x,className:"w-full text-center text-sm text-text-muted hover:text-text-primary transition-colors",children:t("auth.register.backToLogin")})]})})}export{S as Register};
1
+ import{e as r,j as e}from"./vendor-DE_-CLIE.js";import{aq as y,am as t}from"./main-49JlcYCi.js";import"./shiki-mEP5vQQu.js";import"./motion-BILbV7YQ.js";function S({onSuccess:m,onBack:x}){const{register:p}=y(),[n,b]=r.useState(""),[a,h]=r.useState(""),[l,f]=r.useState(""),[i,o]=r.useState(""),[u,d]=r.useState(!1),g=async s=>{if(s.preventDefault(),o(""),a.length<8){o(t("auth.setup.passwordTooShort"));return}if(a!==l){o(t("auth.setup.passwordMismatch"));return}d(!0);try{await p(n,a),m()}catch(c){o(c instanceof Error?c.message:t("auth.register.failed"))}finally{d(!1)}};return e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface-0 px-4",children:e.jsxs("div",{className:"w-full max-w-sm space-y-6",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"font-display text-2xl font-semibold text-text-primary",children:t("auth.register.title")}),e.jsx("p",{className:"mt-2 text-sm text-text-muted",children:t("auth.register.description")})]}),e.jsxs("form",{onSubmit:g,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.login.username")}),e.jsx("input",{type:"text",value:n,onChange:s=>b(s.target.value),required:!0,autoComplete:"username",autoFocus:!0,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.login.password")}),e.jsx("input",{type:"password",value:a,onChange:s=>h(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.join.confirmPassword")}),e.jsx("input",{type:"password",value:l,onChange:s=>f(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:u,className:"w-full rounded-lg bg-brand px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-brand-light disabled:cursor-not-allowed disabled:opacity-50",children:u?t("common.loading"):t("auth.register.submit")})]}),e.jsx("button",{type:"button",onClick:x,className:"w-full text-center text-sm text-text-muted hover:text-text-primary transition-colors",children:t("auth.register.backToLogin")})]})})}export{S as Register};