@saluzi/saluzi-edu 0.7.9 → 0.7.11

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 +67 -65
  2. package/dist/rcs-web/assets/{AdminPanel-B3NMTdDG.js → AdminPanel-sTLeFp8w.js} +1 -1
  3. package/dist/rcs-web/assets/{ArtifactView-BpHLkriL.js → ArtifactView-DoTGXicE.js} +1 -1
  4. package/{packages/remote-control-server/web/dist/assets/ArtifactsGallery-B0jHj6Nb.js → dist/rcs-web/assets/ArtifactsGallery-u6B01-vw.js} +13 -13
  5. package/{packages/remote-control-server/web/dist/assets/Claim-I-OsSFKu.js → dist/rcs-web/assets/Claim-Q1PLGLya.js} +1 -1
  6. package/dist/rcs-web/assets/{Dashboard-B4gfzFIz.js → Dashboard-BjrfZPCK.js} +2 -2
  7. package/dist/rcs-web/assets/{Join-DvWucRFF.js → Join-Cz6c2p1H.js} +1 -1
  8. package/{packages/remote-control-server/web/dist/assets/Login-cT0Y0zLo.js → dist/rcs-web/assets/Login-K2uw3LEy.js} +1 -1
  9. package/dist/rcs-web/assets/MemoriesGallery-BkPdBOXV.js +1 -0
  10. package/dist/rcs-web/assets/{Register-C6g-j45z.js → Register-DsvswBub.js} +1 -1
  11. package/dist/rcs-web/assets/{RegisterEmpty-C2jnr90K.js → RegisterEmpty-DLSXAy3q.js} +1 -1
  12. package/dist/rcs-web/assets/SessionDetail-Euty0VXe.js +83 -0
  13. package/dist/rcs-web/assets/{SessionVisibilityBadge-DSkyQ1D4.js → SessionVisibilityBadge-Vq4ktEDy.js} +1 -1
  14. package/dist/rcs-web/assets/{Setup-CNU_nTSM.js → Setup-CPIa5t9I.js} +1 -1
  15. package/dist/rcs-web/assets/{ShareLanding-DH3jnlTD.js → ShareLanding-8GP27iNd.js} +1 -1
  16. package/{packages/remote-control-server/web/dist/assets/TeamDetail-D0FSiAhV.js → dist/rcs-web/assets/TeamDetail-D3U2Fvos.js} +2 -2
  17. package/dist/rcs-web/assets/{TeamList-BNOdaGhz.js → TeamList-DxZxRFQ7.js} +1 -1
  18. package/dist/rcs-web/assets/{TeamSettings-CxuutvGQ.js → TeamSettings-0nGQick9.js} +1 -1
  19. package/dist/rcs-web/assets/{UserSearchInput-Bb-V7fqI.js → UserSearchInput-BLkdZuQm.js} +2 -2
  20. package/dist/rcs-web/assets/{UserSettings-DejYD6uF.js → UserSettings-DhqUjO_x.js} +1 -1
  21. package/dist/rcs-web/assets/{arc-CT2VuJG0.js → arc-rupcNwSY.js} +1 -1
  22. package/dist/rcs-web/assets/{architectureDiagram-3BPJPVTR-C36ua0-u.js → architectureDiagram-3BPJPVTR-CbkaAJ5Q.js} +1 -1
  23. package/{packages/remote-control-server/web/dist/assets/blockDiagram-GPEHLZMM-AxttQsPe.js → dist/rcs-web/assets/blockDiagram-GPEHLZMM-CssAtC7D.js} +1 -1
  24. package/dist/rcs-web/assets/{c4Diagram-AAUBKEIU-fc4pe5bF.js → c4Diagram-AAUBKEIU-CyL8N1sb.js} +1 -1
  25. package/dist/rcs-web/assets/channel-DpaUg5gZ.js +1 -0
  26. package/dist/rcs-web/assets/{chunk-2J33WTMH-B_7vf70s.js → chunk-2J33WTMH-DytTupP5.js} +1 -1
  27. package/dist/rcs-web/assets/{chunk-4BX2VUAB-Bvz3jAL7.js → chunk-4BX2VUAB-BjxlwrfW.js} +1 -1
  28. package/dist/rcs-web/assets/{chunk-55IACEB6-CBDUoK1T.js → chunk-55IACEB6-DbAJ318a.js} +1 -1
  29. package/{packages/remote-control-server/web/dist/assets/chunk-727SXJPM-sODvLAmN.js → dist/rcs-web/assets/chunk-727SXJPM-WGb4M6Yx.js} +1 -1
  30. package/{packages/remote-control-server/web/dist/assets/chunk-AQP2D5EJ-SFZGnUWg.js → dist/rcs-web/assets/chunk-AQP2D5EJ-B1KwOK5M.js} +1 -1
  31. package/dist/rcs-web/assets/{chunk-FMBD7UC4-DCMkp3hR.js → chunk-FMBD7UC4-iWpe04Pc.js} +1 -1
  32. package/dist/rcs-web/assets/{chunk-ND2GUHAM-8ValhK1Z.js → chunk-ND2GUHAM-BuY2yT22.js} +1 -1
  33. package/dist/rcs-web/assets/{chunk-QZHKN3VN-DKpH4BaH.js → chunk-QZHKN3VN-1RqJgXNr.js} +1 -1
  34. package/dist/rcs-web/assets/classDiagram-4FO5ZUOK-vfYIDQEQ.js +1 -0
  35. package/dist/rcs-web/assets/classDiagram-v2-Q7XG4LA2-vfYIDQEQ.js +1 -0
  36. package/dist/rcs-web/assets/{code-block-IT6T5CEO-BfAWzTW4.js → code-block-IT6T5CEO-Cskip7qP.js} +1 -1
  37. package/dist/rcs-web/assets/{copy-rIWaoyhG.js → copy-BtJiDTbb.js} +1 -1
  38. package/{packages/remote-control-server/web/dist/assets/cose-bilkent-S5V4N54A-D3dbujn0.js → dist/rcs-web/assets/cose-bilkent-S5V4N54A-sipVFSem.js} +1 -1
  39. package/dist/rcs-web/assets/{dagre-BM42HDAG-BMPLFjpK.js → dagre-BM42HDAG-BlIRaxQ5.js} +1 -1
  40. package/dist/rcs-web/assets/{diagram-2AECGRRQ-wsUZ_jAQ.js → diagram-2AECGRRQ-Dpt_5WqQ.js} +1 -1
  41. package/dist/rcs-web/assets/{diagram-5GNKFQAL-D7Z0JdaQ.js → diagram-5GNKFQAL-5V2amDvo.js} +1 -1
  42. package/dist/rcs-web/assets/{diagram-KO2AKTUF-B0trDGwz.js → diagram-KO2AKTUF-DjZxGDfI.js} +1 -1
  43. package/dist/rcs-web/assets/{diagram-LMA3HP47-jr9I40Ze.js → diagram-LMA3HP47-BSk23FvL.js} +1 -1
  44. package/{packages/remote-control-server/web/dist/assets/diagram-OG6HWLK6-p7jsxoor.js → dist/rcs-web/assets/diagram-OG6HWLK6-celCj4OD.js} +1 -1
  45. package/dist/rcs-web/assets/{dialog-DPpsff0A.js → dialog-CBJUxHMG.js} +1 -1
  46. package/dist/rcs-web/assets/{erDiagram-TEJ5UH35-DCU8Bgzn.js → erDiagram-TEJ5UH35-BK-gXz4z.js} +1 -1
  47. package/{packages/remote-control-server/web/dist/assets/flowDiagram-I6XJVG4X-CuKFwUsm.js → dist/rcs-web/assets/flowDiagram-I6XJVG4X-DDJgmi-p.js} +1 -1
  48. package/{packages/remote-control-server/web/dist/assets/ganttDiagram-6RSMTGT7-DET-FT-l.js → dist/rcs-web/assets/ganttDiagram-6RSMTGT7-BgBjOqIQ.js} +1 -1
  49. package/{packages/remote-control-server/web/dist/assets/gitGraphDiagram-PVQCEYII-DhMTMS0R.js → dist/rcs-web/assets/gitGraphDiagram-PVQCEYII-DH87MYWS.js} +1 -1
  50. package/dist/rcs-web/assets/{infoDiagram-5YYISTIA-kE4u9Vj_.js → infoDiagram-5YYISTIA-8drFj4BP.js} +1 -1
  51. package/{packages/remote-control-server/web/dist/assets/ishikawaDiagram-YF4QCWOH-DMd1Ircr.js → dist/rcs-web/assets/ishikawaDiagram-YF4QCWOH-DX2P53e1.js} +1 -1
  52. package/{packages/remote-control-server/web/dist/assets/journeyDiagram-JHISSGLW-xpacZaOS.js → dist/rcs-web/assets/journeyDiagram-JHISSGLW-DLgolJcs.js} +1 -1
  53. package/dist/rcs-web/assets/{kanban-definition-UN3LZRKU-Bc9Jfdya.js → kanban-definition-UN3LZRKU-McHhnrq8.js} +1 -1
  54. package/dist/rcs-web/assets/{linear-BBrTPK-D.js → linear-CyL1rVj7.js} +1 -1
  55. package/dist/rcs-web/assets/{main-RGMHltl_.js → main-C_AYd9qE.js} +22 -22
  56. package/{packages/remote-control-server/web/dist/assets/mermaid-VLURNSYL-CflWsDy2.js → dist/rcs-web/assets/mermaid-VLURNSYL-OG5oeBzE.js} +4 -4
  57. package/dist/rcs-web/assets/{mermaid.core-kR5o-DR4.js → mermaid.core-C3uWrkv4.js} +5 -5
  58. package/dist/rcs-web/assets/{mindmap-definition-RKZ34NQL-DBw5bklZ.js → mindmap-definition-RKZ34NQL-B6afRjPg.js} +1 -1
  59. package/dist/rcs-web/assets/{notifications-B1SFmmdZ.js → notifications-CEOBIPT2.js} +1 -1
  60. package/dist/rcs-web/assets/{pieDiagram-4H26LBE5-Cj8_4-0o.js → pieDiagram-4H26LBE5-BsvRzLBV.js} +1 -1
  61. package/dist/rcs-web/assets/{quadrantDiagram-W4KKPZXB-Bx7EpAwG.js → quadrantDiagram-W4KKPZXB-DPvjCmh7.js} +1 -1
  62. package/dist/rcs-web/assets/{refresh-cw-DjjNpVDe.js → refresh-cw-BkCpU-tv.js} +1 -1
  63. package/{packages/remote-control-server/web/dist/assets/requirementDiagram-4Y6WPE33-ayn2gFqB.js → dist/rcs-web/assets/requirementDiagram-4Y6WPE33-Bj3SkviC.js} +1 -1
  64. package/{packages/remote-control-server/web/dist/assets/sankeyDiagram-5OEKKPKP-BiG0sXBu.js → dist/rcs-web/assets/sankeyDiagram-5OEKKPKP-BG7DuMsL.js} +1 -1
  65. package/{packages/remote-control-server/web/dist/assets/sequenceDiagram-3UESZ5HK-zSmAX_tO.js → dist/rcs-web/assets/sequenceDiagram-3UESZ5HK-uhynEAeU.js} +1 -1
  66. package/{packages/remote-control-server/web/dist/assets/stateDiagram-AJRCARHV-CTKOjAIA.js → dist/rcs-web/assets/stateDiagram-AJRCARHV-EB-7MVMe.js} +1 -1
  67. package/dist/rcs-web/assets/{stateDiagram-v2-BHNVJYJU-f6FO1c8y.js → stateDiagram-v2-BHNVJYJU-8_eRMEf_.js} +1 -1
  68. package/dist/rcs-web/assets/{timeline-definition-PNZ67QCA-DT6XxAXB.js → timeline-definition-PNZ67QCA-9keWNImi.js} +1 -1
  69. package/dist/rcs-web/assets/{vennDiagram-CIIHVFJN-yuD7GvWO.js → vennDiagram-CIIHVFJN-DnTZFjTM.js} +1 -1
  70. package/{packages/remote-control-server/web/dist/assets/wardleyDiagram-YWT4CUSO-B810X7vc.js → dist/rcs-web/assets/wardleyDiagram-YWT4CUSO-DYh3ObXo.js} +1 -1
  71. package/dist/rcs-web/assets/{workerType-CHkBOZGL.js → workerType-BmACfqHE.js} +1 -1
  72. package/dist/rcs-web/assets/{xychartDiagram-2RQKCTM6-CAli0anm.js → xychartDiagram-2RQKCTM6-C0xekO3W.js} +1 -1
  73. package/dist/rcs-web/index.html +1 -1
  74. package/package.json +1 -1
  75. package/packages/remote-control-server/src/__tests__/memories.test.ts +75 -0
  76. package/packages/remote-control-server/src/__tests__/memoryBackend.test.ts +93 -0
  77. package/packages/remote-control-server/src/routes/web/memories.ts +78 -0
  78. package/packages/remote-control-server/src/services/memoryBackend.ts +19 -0
  79. package/packages/remote-control-server/web/dist/assets/{AdminPanel-B3NMTdDG.js → AdminPanel-sTLeFp8w.js} +1 -1
  80. package/packages/remote-control-server/web/dist/assets/{ArtifactView-BpHLkriL.js → ArtifactView-DoTGXicE.js} +1 -1
  81. package/{dist/rcs-web/assets/ArtifactsGallery-B0jHj6Nb.js → packages/remote-control-server/web/dist/assets/ArtifactsGallery-u6B01-vw.js} +13 -13
  82. package/{dist/rcs-web/assets/Claim-I-OsSFKu.js → packages/remote-control-server/web/dist/assets/Claim-Q1PLGLya.js} +1 -1
  83. package/packages/remote-control-server/web/dist/assets/{Dashboard-B4gfzFIz.js → Dashboard-BjrfZPCK.js} +2 -2
  84. package/packages/remote-control-server/web/dist/assets/{Join-DvWucRFF.js → Join-Cz6c2p1H.js} +1 -1
  85. package/{dist/rcs-web/assets/Login-cT0Y0zLo.js → packages/remote-control-server/web/dist/assets/Login-K2uw3LEy.js} +1 -1
  86. package/packages/remote-control-server/web/dist/assets/MemoriesGallery-BkPdBOXV.js +1 -0
  87. package/packages/remote-control-server/web/dist/assets/{Register-C6g-j45z.js → Register-DsvswBub.js} +1 -1
  88. package/packages/remote-control-server/web/dist/assets/{RegisterEmpty-C2jnr90K.js → RegisterEmpty-DLSXAy3q.js} +1 -1
  89. package/packages/remote-control-server/web/dist/assets/SessionDetail-Euty0VXe.js +83 -0
  90. package/packages/remote-control-server/web/dist/assets/{SessionVisibilityBadge-DSkyQ1D4.js → SessionVisibilityBadge-Vq4ktEDy.js} +1 -1
  91. package/packages/remote-control-server/web/dist/assets/{Setup-CNU_nTSM.js → Setup-CPIa5t9I.js} +1 -1
  92. package/packages/remote-control-server/web/dist/assets/{ShareLanding-DH3jnlTD.js → ShareLanding-8GP27iNd.js} +1 -1
  93. package/{dist/rcs-web/assets/TeamDetail-D0FSiAhV.js → packages/remote-control-server/web/dist/assets/TeamDetail-D3U2Fvos.js} +2 -2
  94. package/packages/remote-control-server/web/dist/assets/{TeamList-BNOdaGhz.js → TeamList-DxZxRFQ7.js} +1 -1
  95. package/packages/remote-control-server/web/dist/assets/{TeamSettings-CxuutvGQ.js → TeamSettings-0nGQick9.js} +1 -1
  96. package/packages/remote-control-server/web/dist/assets/{UserSearchInput-Bb-V7fqI.js → UserSearchInput-BLkdZuQm.js} +2 -2
  97. package/packages/remote-control-server/web/dist/assets/{UserSettings-DejYD6uF.js → UserSettings-DhqUjO_x.js} +1 -1
  98. package/packages/remote-control-server/web/dist/assets/{arc-CT2VuJG0.js → arc-rupcNwSY.js} +1 -1
  99. package/packages/remote-control-server/web/dist/assets/{architectureDiagram-3BPJPVTR-C36ua0-u.js → architectureDiagram-3BPJPVTR-CbkaAJ5Q.js} +1 -1
  100. package/{dist/rcs-web/assets/blockDiagram-GPEHLZMM-AxttQsPe.js → packages/remote-control-server/web/dist/assets/blockDiagram-GPEHLZMM-CssAtC7D.js} +1 -1
  101. package/packages/remote-control-server/web/dist/assets/{c4Diagram-AAUBKEIU-fc4pe5bF.js → c4Diagram-AAUBKEIU-CyL8N1sb.js} +1 -1
  102. package/packages/remote-control-server/web/dist/assets/channel-DpaUg5gZ.js +1 -0
  103. package/packages/remote-control-server/web/dist/assets/{chunk-2J33WTMH-B_7vf70s.js → chunk-2J33WTMH-DytTupP5.js} +1 -1
  104. package/packages/remote-control-server/web/dist/assets/{chunk-4BX2VUAB-Bvz3jAL7.js → chunk-4BX2VUAB-BjxlwrfW.js} +1 -1
  105. package/packages/remote-control-server/web/dist/assets/{chunk-55IACEB6-CBDUoK1T.js → chunk-55IACEB6-DbAJ318a.js} +1 -1
  106. package/{dist/rcs-web/assets/chunk-727SXJPM-sODvLAmN.js → packages/remote-control-server/web/dist/assets/chunk-727SXJPM-WGb4M6Yx.js} +1 -1
  107. package/{dist/rcs-web/assets/chunk-AQP2D5EJ-SFZGnUWg.js → packages/remote-control-server/web/dist/assets/chunk-AQP2D5EJ-B1KwOK5M.js} +1 -1
  108. package/packages/remote-control-server/web/dist/assets/{chunk-FMBD7UC4-DCMkp3hR.js → chunk-FMBD7UC4-iWpe04Pc.js} +1 -1
  109. package/packages/remote-control-server/web/dist/assets/{chunk-ND2GUHAM-8ValhK1Z.js → chunk-ND2GUHAM-BuY2yT22.js} +1 -1
  110. package/packages/remote-control-server/web/dist/assets/{chunk-QZHKN3VN-DKpH4BaH.js → chunk-QZHKN3VN-1RqJgXNr.js} +1 -1
  111. package/packages/remote-control-server/web/dist/assets/classDiagram-4FO5ZUOK-vfYIDQEQ.js +1 -0
  112. package/packages/remote-control-server/web/dist/assets/classDiagram-v2-Q7XG4LA2-vfYIDQEQ.js +1 -0
  113. package/packages/remote-control-server/web/dist/assets/{code-block-IT6T5CEO-BfAWzTW4.js → code-block-IT6T5CEO-Cskip7qP.js} +1 -1
  114. package/packages/remote-control-server/web/dist/assets/{copy-rIWaoyhG.js → copy-BtJiDTbb.js} +1 -1
  115. package/{dist/rcs-web/assets/cose-bilkent-S5V4N54A-D3dbujn0.js → packages/remote-control-server/web/dist/assets/cose-bilkent-S5V4N54A-sipVFSem.js} +1 -1
  116. package/packages/remote-control-server/web/dist/assets/{dagre-BM42HDAG-BMPLFjpK.js → dagre-BM42HDAG-BlIRaxQ5.js} +1 -1
  117. package/packages/remote-control-server/web/dist/assets/{diagram-2AECGRRQ-wsUZ_jAQ.js → diagram-2AECGRRQ-Dpt_5WqQ.js} +1 -1
  118. package/packages/remote-control-server/web/dist/assets/{diagram-5GNKFQAL-D7Z0JdaQ.js → diagram-5GNKFQAL-5V2amDvo.js} +1 -1
  119. package/packages/remote-control-server/web/dist/assets/{diagram-KO2AKTUF-B0trDGwz.js → diagram-KO2AKTUF-DjZxGDfI.js} +1 -1
  120. package/packages/remote-control-server/web/dist/assets/{diagram-LMA3HP47-jr9I40Ze.js → diagram-LMA3HP47-BSk23FvL.js} +1 -1
  121. package/{dist/rcs-web/assets/diagram-OG6HWLK6-p7jsxoor.js → packages/remote-control-server/web/dist/assets/diagram-OG6HWLK6-celCj4OD.js} +1 -1
  122. package/packages/remote-control-server/web/dist/assets/{dialog-DPpsff0A.js → dialog-CBJUxHMG.js} +1 -1
  123. package/packages/remote-control-server/web/dist/assets/{erDiagram-TEJ5UH35-DCU8Bgzn.js → erDiagram-TEJ5UH35-BK-gXz4z.js} +1 -1
  124. package/{dist/rcs-web/assets/flowDiagram-I6XJVG4X-CuKFwUsm.js → packages/remote-control-server/web/dist/assets/flowDiagram-I6XJVG4X-DDJgmi-p.js} +1 -1
  125. package/{dist/rcs-web/assets/ganttDiagram-6RSMTGT7-DET-FT-l.js → packages/remote-control-server/web/dist/assets/ganttDiagram-6RSMTGT7-BgBjOqIQ.js} +1 -1
  126. package/{dist/rcs-web/assets/gitGraphDiagram-PVQCEYII-DhMTMS0R.js → packages/remote-control-server/web/dist/assets/gitGraphDiagram-PVQCEYII-DH87MYWS.js} +1 -1
  127. package/packages/remote-control-server/web/dist/assets/{infoDiagram-5YYISTIA-kE4u9Vj_.js → infoDiagram-5YYISTIA-8drFj4BP.js} +1 -1
  128. package/{dist/rcs-web/assets/ishikawaDiagram-YF4QCWOH-DMd1Ircr.js → packages/remote-control-server/web/dist/assets/ishikawaDiagram-YF4QCWOH-DX2P53e1.js} +1 -1
  129. package/{dist/rcs-web/assets/journeyDiagram-JHISSGLW-xpacZaOS.js → packages/remote-control-server/web/dist/assets/journeyDiagram-JHISSGLW-DLgolJcs.js} +1 -1
  130. package/packages/remote-control-server/web/dist/assets/{kanban-definition-UN3LZRKU-Bc9Jfdya.js → kanban-definition-UN3LZRKU-McHhnrq8.js} +1 -1
  131. package/packages/remote-control-server/web/dist/assets/{linear-BBrTPK-D.js → linear-CyL1rVj7.js} +1 -1
  132. package/packages/remote-control-server/web/dist/assets/{main-RGMHltl_.js → main-C_AYd9qE.js} +22 -22
  133. package/{dist/rcs-web/assets/mermaid-VLURNSYL-CflWsDy2.js → packages/remote-control-server/web/dist/assets/mermaid-VLURNSYL-OG5oeBzE.js} +4 -4
  134. package/packages/remote-control-server/web/dist/assets/{mermaid.core-kR5o-DR4.js → mermaid.core-C3uWrkv4.js} +5 -5
  135. package/packages/remote-control-server/web/dist/assets/{mindmap-definition-RKZ34NQL-DBw5bklZ.js → mindmap-definition-RKZ34NQL-B6afRjPg.js} +1 -1
  136. package/packages/remote-control-server/web/dist/assets/{notifications-B1SFmmdZ.js → notifications-CEOBIPT2.js} +1 -1
  137. package/packages/remote-control-server/web/dist/assets/{pieDiagram-4H26LBE5-Cj8_4-0o.js → pieDiagram-4H26LBE5-BsvRzLBV.js} +1 -1
  138. package/packages/remote-control-server/web/dist/assets/{quadrantDiagram-W4KKPZXB-Bx7EpAwG.js → quadrantDiagram-W4KKPZXB-DPvjCmh7.js} +1 -1
  139. package/packages/remote-control-server/web/dist/assets/{refresh-cw-DjjNpVDe.js → refresh-cw-BkCpU-tv.js} +1 -1
  140. package/{dist/rcs-web/assets/requirementDiagram-4Y6WPE33-ayn2gFqB.js → packages/remote-control-server/web/dist/assets/requirementDiagram-4Y6WPE33-Bj3SkviC.js} +1 -1
  141. package/{dist/rcs-web/assets/sankeyDiagram-5OEKKPKP-BiG0sXBu.js → packages/remote-control-server/web/dist/assets/sankeyDiagram-5OEKKPKP-BG7DuMsL.js} +1 -1
  142. package/{dist/rcs-web/assets/sequenceDiagram-3UESZ5HK-zSmAX_tO.js → packages/remote-control-server/web/dist/assets/sequenceDiagram-3UESZ5HK-uhynEAeU.js} +1 -1
  143. package/{dist/rcs-web/assets/stateDiagram-AJRCARHV-CTKOjAIA.js → packages/remote-control-server/web/dist/assets/stateDiagram-AJRCARHV-EB-7MVMe.js} +1 -1
  144. package/packages/remote-control-server/web/dist/assets/{stateDiagram-v2-BHNVJYJU-f6FO1c8y.js → stateDiagram-v2-BHNVJYJU-8_eRMEf_.js} +1 -1
  145. package/packages/remote-control-server/web/dist/assets/{timeline-definition-PNZ67QCA-DT6XxAXB.js → timeline-definition-PNZ67QCA-9keWNImi.js} +1 -1
  146. package/packages/remote-control-server/web/dist/assets/{vennDiagram-CIIHVFJN-yuD7GvWO.js → vennDiagram-CIIHVFJN-DnTZFjTM.js} +1 -1
  147. package/{dist/rcs-web/assets/wardleyDiagram-YWT4CUSO-B810X7vc.js → packages/remote-control-server/web/dist/assets/wardleyDiagram-YWT4CUSO-DYh3ObXo.js} +1 -1
  148. package/packages/remote-control-server/web/dist/assets/{workerType-CHkBOZGL.js → workerType-BmACfqHE.js} +1 -1
  149. package/packages/remote-control-server/web/dist/assets/{xychartDiagram-2RQKCTM6-CAli0anm.js → xychartDiagram-2RQKCTM6-C0xekO3W.js} +1 -1
  150. package/packages/remote-control-server/web/dist/index.html +1 -1
  151. package/dist/rcs-web/assets/MemoriesGallery-NN16V4oP.js +0 -1
  152. package/dist/rcs-web/assets/SessionDetail-CcfimSQQ.js +0 -83
  153. package/dist/rcs-web/assets/channel-Bhb276ZI.js +0 -1
  154. package/dist/rcs-web/assets/classDiagram-4FO5ZUOK-B0HWxaYK.js +0 -1
  155. package/dist/rcs-web/assets/classDiagram-v2-Q7XG4LA2-B0HWxaYK.js +0 -1
  156. package/packages/remote-control-server/web/dist/assets/MemoriesGallery-NN16V4oP.js +0 -1
  157. package/packages/remote-control-server/web/dist/assets/SessionDetail-CcfimSQQ.js +0 -83
  158. package/packages/remote-control-server/web/dist/assets/channel-Bhb276ZI.js +0 -1
  159. package/packages/remote-control-server/web/dist/assets/classDiagram-4FO5ZUOK-B0HWxaYK.js +0 -1
  160. package/packages/remote-control-server/web/dist/assets/classDiagram-v2-Q7XG4LA2-B0HWxaYK.js +0 -1
@@ -1 +1 @@
1
- import{e as d,j as e}from"./vendor-DE_-CLIE.js";import{a_ as x,a$ as o,a6 as m,aS as s,aI as l,I as u}from"./main-RGMHltl_.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";function j(){x();const[a,i]=d.useState([]),{myTeams:r,isLoading:c}=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,")"]}),c?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{a$ as x,b0 as o,a7 as m,aT as s,aJ as l,I as u}from"./main-C_AYd9qE.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";function j(){x();const[a,i]=d.useState([]),{myTeams:r,isLoading:c}=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,")"]}),c?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 +1 @@
1
- import{e as a,j as t}from"./vendor-DE_-CLIE.js";import{a_ as A,a7 as j,aS as r,a2 as q,aD as R,P as U,N as F}from"./main-RGMHltl_.js";import{S as O,E as G,C as K}from"./ArtifactsGallery-B0jHj6Nb.js";import{R as P}from"./refresh-cw-DjjNpVDe.js";import{C as J}from"./copy-rIWaoyhG.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";import"./dialog-DPpsff0A.js";let m=null;function M(n,c,e=0){b();const o=`/web/sessions/${n}/events`,l=new EventSource(o,{withCredentials:!0});m=l;let u=e;l.addEventListener("message",p=>{try{const x=JSON.parse(p.data);if(x.seqNum!==void 0&&x.seqNum<=u)return;x.seqNum!==void 0&&(u=x.seqNum),c(x)}catch{}}),l.addEventListener("error",()=>{console.warn("[SSE] error, readyState:",l.readyState),l.readyState===EventSource.CLOSED&&(l.close(),b())})}function b(){m&&(m.close(),m=null)}function V(n,c){const e=a.useRef(c);e.current=c;const o=a.useCallback(l=>{e.current(l)},[]);a.useEffect(()=>{if(n)return M(n,o),()=>{b()}},[n,o])}function I({artifactId:n,onBack:c}){A();const[e,o]=a.useState(null),[l,u]=a.useState(""),[p,x]=a.useState(!1),[S,f]=a.useState(0),[w,h]=a.useState(!1),[g,C]=a.useState(null),[E,k]=a.useState("template"),[d,y]=a.useState(!1);a.useEffect(()=>{let s=!1;return j(n).then(i=>{s||o(i)}).catch(i=>{s||u(i instanceof Error?i.message:r("artifacts.viewNotFound"))}),()=>{s=!0}},[n]);const v=a.useCallback(()=>{j(n).then(s=>o(s)).catch(()=>{})},[n]),_=a.useCallback(s=>{var i;s.type==="artifact_updated"&&((i=s.payload)!=null&&i.id&&s.payload.id!==n||(v(),f(L=>L+1),y(!0)))},[n,v]);V((e==null?void 0:e.session_id)??null,_),a.useEffect(()=>{if(!d)return;const s=setTimeout(()=>y(!1),2500);return()=>clearTimeout(s)},[d]);const N=a.useCallback(s=>{e&&(C(e),k(s),h(!0))},[e]),$=a.useCallback(s=>{h(!1),o(i=>i?{...i,...s}:s),f(i=>i+1)},[]),T=a.useCallback(async()=>{if(window.confirm(r("artifacts.delete")+" — "+n.slice(0,8)+"…?"))try{await q(n),c()}catch(s){alert(s instanceof Error?s.message:r("artifacts.deleteFailed"))}},[n,c]),D=a.useCallback(async()=>{if(!e)return;await R(`${window.location.origin}${e.url}`)&&(x(!0),setTimeout(()=>x(!1),1500))},[e]);return l?t.jsx("div",{className:"flex flex-1 items-center justify-center",children:t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-status-error",children:r("artifacts.viewNotFound")}),t.jsx("p",{className:"mt-1 text-xs text-text-muted",children:l}),t.jsx("button",{type:"button",onClick:c,className:"mt-4 rounded-md border border-border px-4 py-2 text-sm text-text-secondary hover:bg-surface-2",children:r("artifacts.backToGallery")})]})}):e?t.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2 border-b border-border bg-surface-1 px-4 py-2.5",children:[t.jsx("button",{type:"button",onClick:c,className:"text-sm text-text-muted hover:text-text-primary",children:r("artifacts.backToGallery")}),t.jsx("span",{className:"text-text-muted/40",children:"/"}),t.jsx("span",{className:"truncate font-medium text-text-primary",children:e.title||e.id.slice(0,12)}),t.jsx("span",{className:`rounded-full px-2 py-0.5 text-[10px] transition-colors ${d?"bg-status-active/15 text-status-active":"bg-surface-3 text-text-muted"}`,title:d?r("artifacts.view.liveUpdated"):void 0,children:d?`↻ v${e.version}`:`v${e.version}`}),e.session_id&&t.jsxs("a",{href:`/code/${e.session_id}`,className:"truncate font-mono text-[10px] text-text-muted hover:text-accent",title:e.session_id,children:[r("artifacts.session"),": ",e.session_id.slice(0,14),"…"]}),e.expires_at&&t.jsxs("span",{className:"text-[10px] text-text-muted",title:e.expires_at,children:[r("artifacts.expires"),": ",new Date(e.expires_at).toLocaleDateString()]}),t.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[t.jsx("button",{type:"button",onClick:()=>f(s=>s+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:r("common.loading"),children:t.jsx(P,{className:"h-3.5 w-3.5"})}),t.jsx("button",{type:"button",onClick:()=>N("ai"),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:r("artifacts.aiUpdate"),children:t.jsx(O,{className:"h-3.5 w-3.5"})}),e.can_manage&&t.jsx("button",{type:"button",onClick:()=>N("template"),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:r("artifacts.edit"),children:t.jsx(U,{className:"h-3.5 w-3.5"})}),t.jsxs("button",{type:"button",onClick:D,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:`${r("artifacts.copyLink")} · ${r("artifacts.linkNotice")}`,children:[t.jsx(J,{className:"h-3.5 w-3.5"}),p&&t.jsx("span",{className:"text-status-active",children:r("artifacts.copied")})]}),t.jsx("a",{href:e.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:r("artifacts.openInNewTab"),children:t.jsx(G,{className:"h-3.5 w-3.5"})}),t.jsx("button",{type:"button",onClick:T,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:r("artifacts.delete"),children:t.jsx(F,{className:"h-3.5 w-3.5"})})]})]}),t.jsx("iframe",{src:`${e.url}${e.url.includes("?")?"&":"?"}_=${Date.now()}`,title:e.title||e.id,className:"min-h-0 w-full flex-1 border-0 bg-white",sandbox:"allow-scripts allow-popups allow-forms"},S),t.jsx(K,{open:w,onClose:()=>h(!1),onCreated:$,editArtifact:g,initialMode:E})]}):t.jsx("div",{className:"flex flex-1 items-center justify-center text-text-muted",children:r("common.loading")})}export{I as ArtifactView};
1
+ import{e as a,j as t}from"./vendor-DE_-CLIE.js";import{a$ as A,a8 as j,aT as r,a3 as q,aE as R,P as U,N as F}from"./main-C_AYd9qE.js";import{S as O,E as G,C as K}from"./ArtifactsGallery-u6B01-vw.js";import{R as P}from"./refresh-cw-BkCpU-tv.js";import{C as J}from"./copy-BtJiDTbb.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";import"./dialog-CBJUxHMG.js";let m=null;function M(n,c,e=0){b();const o=`/web/sessions/${n}/events`,l=new EventSource(o,{withCredentials:!0});m=l;let u=e;l.addEventListener("message",p=>{try{const x=JSON.parse(p.data);if(x.seqNum!==void 0&&x.seqNum<=u)return;x.seqNum!==void 0&&(u=x.seqNum),c(x)}catch{}}),l.addEventListener("error",()=>{console.warn("[SSE] error, readyState:",l.readyState),l.readyState===EventSource.CLOSED&&(l.close(),b())})}function b(){m&&(m.close(),m=null)}function V(n,c){const e=a.useRef(c);e.current=c;const o=a.useCallback(l=>{e.current(l)},[]);a.useEffect(()=>{if(n)return M(n,o),()=>{b()}},[n,o])}function I({artifactId:n,onBack:c}){A();const[e,o]=a.useState(null),[l,u]=a.useState(""),[p,x]=a.useState(!1),[S,f]=a.useState(0),[w,h]=a.useState(!1),[g,C]=a.useState(null),[E,k]=a.useState("template"),[d,y]=a.useState(!1);a.useEffect(()=>{let s=!1;return j(n).then(i=>{s||o(i)}).catch(i=>{s||u(i instanceof Error?i.message:r("artifacts.viewNotFound"))}),()=>{s=!0}},[n]);const v=a.useCallback(()=>{j(n).then(s=>o(s)).catch(()=>{})},[n]),$=a.useCallback(s=>{var i;s.type==="artifact_updated"&&((i=s.payload)!=null&&i.id&&s.payload.id!==n||(v(),f(D=>D+1),y(!0)))},[n,v]);V((e==null?void 0:e.session_id)??null,$),a.useEffect(()=>{if(!d)return;const s=setTimeout(()=>y(!1),2500);return()=>clearTimeout(s)},[d]);const N=a.useCallback(s=>{e&&(C(e),k(s),h(!0))},[e]),T=a.useCallback(s=>{h(!1),o(i=>i?{...i,...s}:s),f(i=>i+1)},[]),_=a.useCallback(async()=>{if(window.confirm(r("artifacts.delete")+" — "+n.slice(0,8)+"…?"))try{await q(n),c()}catch(s){alert(s instanceof Error?s.message:r("artifacts.deleteFailed"))}},[n,c]),L=a.useCallback(async()=>{if(!e)return;await R(`${window.location.origin}${e.url}`)&&(x(!0),setTimeout(()=>x(!1),1500))},[e]);return l?t.jsx("div",{className:"flex flex-1 items-center justify-center",children:t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-status-error",children:r("artifacts.viewNotFound")}),t.jsx("p",{className:"mt-1 text-xs text-text-muted",children:l}),t.jsx("button",{type:"button",onClick:c,className:"mt-4 rounded-md border border-border px-4 py-2 text-sm text-text-secondary hover:bg-surface-2",children:r("artifacts.backToGallery")})]})}):e?t.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2 border-b border-border bg-surface-1 px-4 py-2.5",children:[t.jsx("button",{type:"button",onClick:c,className:"text-sm text-text-muted hover:text-text-primary",children:r("artifacts.backToGallery")}),t.jsx("span",{className:"text-text-muted/40",children:"/"}),t.jsx("span",{className:"truncate font-medium text-text-primary",children:e.title||e.id.slice(0,12)}),t.jsx("span",{className:`rounded-full px-2 py-0.5 text-[10px] transition-colors ${d?"bg-status-active/15 text-status-active":"bg-surface-3 text-text-muted"}`,title:d?r("artifacts.view.liveUpdated"):void 0,children:d?`↻ v${e.version}`:`v${e.version}`}),e.session_id&&t.jsxs("a",{href:`/code/${e.session_id}`,className:"truncate font-mono text-[10px] text-text-muted hover:text-accent",title:e.session_id,children:[r("artifacts.session"),": ",e.session_id.slice(0,14),"…"]}),e.expires_at&&t.jsxs("span",{className:"text-[10px] text-text-muted",title:e.expires_at,children:[r("artifacts.expires"),": ",new Date(e.expires_at).toLocaleDateString()]}),t.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[t.jsx("button",{type:"button",onClick:()=>f(s=>s+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:r("common.loading"),children:t.jsx(P,{className:"h-3.5 w-3.5"})}),t.jsx("button",{type:"button",onClick:()=>N("ai"),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:r("artifacts.aiUpdate"),children:t.jsx(O,{className:"h-3.5 w-3.5"})}),e.can_manage&&t.jsx("button",{type:"button",onClick:()=>N("template"),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:r("artifacts.edit"),children:t.jsx(U,{className:"h-3.5 w-3.5"})}),t.jsxs("button",{type:"button",onClick:L,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:`${r("artifacts.copyLink")} · ${r("artifacts.linkNotice")}`,children:[t.jsx(J,{className:"h-3.5 w-3.5"}),p&&t.jsx("span",{className:"text-status-active",children:r("artifacts.copied")})]}),t.jsx("a",{href:e.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:r("artifacts.openInNewTab"),children:t.jsx(G,{className:"h-3.5 w-3.5"})}),t.jsx("button",{type:"button",onClick:_,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:r("artifacts.delete"),children:t.jsx(F,{className:"h-3.5 w-3.5"})})]})]}),t.jsx("iframe",{src:`${e.url}${e.url.includes("?")?"&":"?"}_=${Date.now()}`,title:e.title||e.id,className:"min-h-0 w-full flex-1 border-0 bg-white",sandbox:"allow-scripts allow-popups allow-forms"},S),t.jsx(K,{open:w,onClose:()=>h(!1),onCreated:T,editArtifact:g,initialMode:E})]}):t.jsx("div",{className:"flex flex-1 items-center justify-center text-text-muted",children:r("common.loading")})}export{I as ArtifactView};
@@ -1,19 +1,19 @@
1
- var pt=Object.defineProperty;var ht=(t,e,r)=>e in t?pt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var S=(t,e,r)=>ht(t,typeof e!="symbol"?e+"":e,r);import{e as k,j as o}from"./vendor-DE_-CLIE.js";import{aE as Te,aJ as ut,a_ as Qe,a$ as ft,a8 as mt,aS as f,a2 as xt,aD as gt,F as bt,i as kt,P as yt,N as wt,t as vt,a7 as St,aj as Rt,aN as Tt,ai as $t,av as jt,aw as Et,_ as Nt,b as Ct}from"./main-RGMHltl_.js";import{D as It,a as At,c as Lt,d as zt,b as _t}from"./dialog-DPpsff0A.js";import{C as Dt}from"./copy-rIWaoyhG.js";/**
1
+ var pt=Object.defineProperty;var ht=(t,e,r)=>e in t?pt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var S=(t,e,r)=>ht(t,typeof e!="symbol"?e+"":e,r);import{e as k,j as o}from"./vendor-DE_-CLIE.js";import{aF as Re,aK as ut,a$ as Qe,b0 as ft,a9 as mt,aT as f,a3 as xt,aE as gt,F as bt,i as kt,P as yt,N as wt,t as vt,a8 as St,ak as Tt,aO as Rt,aj as $t,aw as jt,ax as Et,_ as Nt,b as Ct}from"./main-C_AYd9qE.js";import{D as It,a as At,c as Lt,d as zt,b as _t}from"./dialog-CBJUxHMG.js";import{C as Dt}from"./copy-BtJiDTbb.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 Mt=[["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"}]],Pt=Te("external-link",Mt);/**
6
+ */const Mt=[["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"}]],Pt=Re("external-link",Mt);/**
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 Bt=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],qt=Te("network",Bt);/**
11
+ */const Bt=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],qt=Re("network",Bt);/**
12
12
  * @license lucide-react v0.555.0 - ISC
13
13
  *
14
14
  * This source code is licensed under the ISC license.
15
15
  * See the LICENSE file in the root directory of this source tree.
16
- */const Ht=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],Ft=Te("sparkles",Ht),re=`body { font: 14px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; max-width: 860px; margin: 2rem auto; padding: 0 1rem; color: #1a1a1a; }
16
+ */const Ht=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],Ft=Re("sparkles",Ht),re=`body { font: 14px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; max-width: 860px; margin: 2rem auto; padding: 0 1rem; color: #1a1a1a; }
17
17
  h1 { font-size: 22px; } h1, h2 { color: #1a1a1a; }
18
18
  .badge { display: inline-block; border-radius: 999px; padding: 1px 10px; font-size: 12px; font-weight: 500; }
19
19
  .badge.ok { background: #dcfce7; color: #166534; }
@@ -352,7 +352,7 @@ render();
352
352
  <\/script>
353
353
  </body>
354
354
  </html>`,ye=[{id:"blank",titleKey:"artifacts.create.templateBlank",descKey:"",defaultTitle:"Untitled Artifact",html:Ot},{id:"pr-review",titleKey:"artifacts.create.templatePrReview",descKey:"artifacts.templateDesc.prReview",defaultTitle:"PR Review",html:Kt},{id:"incident",titleKey:"artifacts.create.templateIncident",descKey:"artifacts.templateDesc.incident",defaultTitle:"Incident Timeline",html:Zt},{id:"dashboard",titleKey:"artifacts.create.templateDashboard",descKey:"artifacts.templateDesc.dashboard",defaultTitle:"Data Dashboard",html:Gt},{id:"checklist",titleKey:"artifacts.create.templateChecklist",descKey:"artifacts.templateDesc.checklist",defaultTitle:"Release Checklist",html:Ut}];function Y(t){return ye.find(e=>e.id===t)??ye[0]}function $e(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var K=$e();function Ve(t){K=t}var F={exec:()=>null};function w(t,e=""){let r=typeof t=="string"?t:t.source,a={replace:(s,l)=>{let i=typeof l=="string"?l:l.source;return i=i.replace(j.caret,"$1"),r=r.replace(s,i),a},getRegex:()=>new RegExp(r,e)};return a}var Qt=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),j={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}>`)},Vt=/^(?:[ \t]*(?:\n|$))+/,Wt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Xt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,se=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Yt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,je=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,We=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Xe=w(We).replace(/bull/g,je).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Jt=w(We).replace(/bull/g,je).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Ee=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,er=/^[^\n]+/,Ne=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,tr=w(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ne).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),rr=w(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,je).getRegex(),he="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ce=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,sr=w("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Ce).replace("tag",he).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ye=w(Ee).replace("hr",se).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",he).getRegex(),ar=w(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ye).getRegex(),Ie={blockquote:ar,code:Wt,def:tr,fences:Xt,heading:Yt,hr:se,html:sr,lheading:Xe,list:rr,newline:Vt,paragraph:Ye,table:F,text:er},He=w("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",se).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",he).getRegex(),nr={...Ie,lheading:Jt,table:He,paragraph:w(Ee).replace("hr",se).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",He).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",he).getRegex()},ir={...Ie,html:w(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ce).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:F,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:w(Ee).replace("hr",se).replace("heading",` *#{1,6} *[^
355
- ]`).replace("lheading",Xe).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},lr=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,or=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Je=/^( {2,}|\\)\n(?!\s*$)/,cr=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,W=/[\p{P}\p{S}]/u,ue=/[\s\p{P}\p{S}]/u,Ae=/[^\s\p{P}\p{S}]/u,dr=w(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ue).getRegex(),et=/(?!~)[\p{P}\p{S}]/u,pr=/(?!~)[\s\p{P}\p{S}]/u,hr=/(?:[^\s\p{P}\p{S}]|~)/u,ur=w(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Qt?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),tt=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,fr=w(tt,"u").replace(/punct/g,W).getRegex(),mr=w(tt,"u").replace(/punct/g,et).getRegex(),rt="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",xr=w(rt,"gu").replace(/notPunctSpace/g,Ae).replace(/punctSpace/g,ue).replace(/punct/g,W).getRegex(),gr=w(rt,"gu").replace(/notPunctSpace/g,hr).replace(/punctSpace/g,pr).replace(/punct/g,et).getRegex(),br=w("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ae).replace(/punctSpace/g,ue).replace(/punct/g,W).getRegex(),kr=w(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,W).getRegex(),yr="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",wr=w(yr,"gu").replace(/notPunctSpace/g,Ae).replace(/punctSpace/g,ue).replace(/punct/g,W).getRegex(),vr=w(/\\(punct)/,"gu").replace(/punct/g,W).getRegex(),Sr=w(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Rr=w(Ce).replace("(?:-->|$)","-->").getRegex(),Tr=w("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Rr).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ce=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,$r=w(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",ce).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),st=w(/^!?\[(label)\]\[(ref)\]/).replace("label",ce).replace("ref",Ne).getRegex(),at=w(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ne).getRegex(),jr=w("reflink|nolink(?!\\()","g").replace("reflink",st).replace("nolink",at).getRegex(),Fe=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Le={_backpedal:F,anyPunctuation:vr,autolink:Sr,blockSkip:ur,br:Je,code:or,del:F,delLDelim:F,delRDelim:F,emStrongLDelim:fr,emStrongRDelimAst:xr,emStrongRDelimUnd:br,escape:lr,link:$r,nolink:at,punctuation:dr,reflink:st,reflinkSearch:jr,tag:Tr,text:cr,url:F},Er={...Le,link:w(/^!?\[(label)\]\((.*?)\)/).replace("label",ce).getRegex(),reflink:w(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ce).getRegex()},we={...Le,emStrongRDelimAst:gr,emStrongLDelim:mr,delLDelim:kr,delRDelim:wr,url:w(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Fe).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:w(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Fe).getRegex()},Nr={...we,br:w(Je).replace("{2,}","*").getRegex(),text:w(we.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},le={normal:Ie,gfm:nr,pedantic:ir},J={normal:Le,gfm:we,breaks:Nr,pedantic:Er},Cr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Oe=t=>Cr[t];function D(t,e){if(e){if(j.escapeTest.test(t))return t.replace(j.escapeReplace,Oe)}else if(j.escapeTestNoEncode.test(t))return t.replace(j.escapeReplaceNoEncode,Oe);return t}function Ke(t){try{t=encodeURI(t).replace(j.percentDecode,"%")}catch{return null}return t}function Ze(t,e){var l;let r=t.replace(j.findPipe,(i,n,h)=>{let c=!1,u=n;for(;--u>=0&&h[u]==="\\";)c=!c;return c?"|":" |"}),a=r.split(j.splitPipe),s=0;if(a[0].trim()||a.shift(),a.length>0&&!((l=a.at(-1))!=null&&l.trim())&&a.pop(),e)if(a.length>e)a.splice(e);else for(;a.length<e;)a.push("");for(;s<a.length;s++)a[s]=a[s].trim().replace(j.slashPipe,"|");return a}function ee(t,e,r){let a=t.length;if(a===0)return"";let s=0;for(;s<a&&t.charAt(a-s-1)===e;)s++;return t.slice(0,a-s)}function Ir(t,e){if(t.indexOf(e[1])===-1)return-1;let r=0;for(let a=0;a<t.length;a++)if(t[a]==="\\")a++;else if(t[a]===e[0])r++;else if(t[a]===e[1]&&(r--,r<0))return a;return r>0?-2:-1}function Ar(t,e=0){let r=e,a="";for(let s of t)if(s===" "){let l=4-r%4;a+=" ".repeat(l),r+=l}else a+=s,r++;return a}function Ge(t,e,r,a,s){let l=e.href,i=e.title||null,n=t[1].replace(s.other.outputLinkReplace,"$1");a.state.inLink=!0;let h={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:l,title:i,text:n,tokens:a.inlineTokens(n)};return a.state.inLink=!1,h}function Lr(t,e,r){let a=t.match(r.other.indentCodeCompensation);if(a===null)return e;let s=a[1];return e.split(`
355
+ ]`).replace("lheading",Xe).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},lr=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,or=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Je=/^( {2,}|\\)\n(?!\s*$)/,cr=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,W=/[\p{P}\p{S}]/u,ue=/[\s\p{P}\p{S}]/u,Ae=/[^\s\p{P}\p{S}]/u,dr=w(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ue).getRegex(),et=/(?!~)[\p{P}\p{S}]/u,pr=/(?!~)[\s\p{P}\p{S}]/u,hr=/(?:[^\s\p{P}\p{S}]|~)/u,ur=w(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Qt?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),tt=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,fr=w(tt,"u").replace(/punct/g,W).getRegex(),mr=w(tt,"u").replace(/punct/g,et).getRegex(),rt="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",xr=w(rt,"gu").replace(/notPunctSpace/g,Ae).replace(/punctSpace/g,ue).replace(/punct/g,W).getRegex(),gr=w(rt,"gu").replace(/notPunctSpace/g,hr).replace(/punctSpace/g,pr).replace(/punct/g,et).getRegex(),br=w("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ae).replace(/punctSpace/g,ue).replace(/punct/g,W).getRegex(),kr=w(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,W).getRegex(),yr="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",wr=w(yr,"gu").replace(/notPunctSpace/g,Ae).replace(/punctSpace/g,ue).replace(/punct/g,W).getRegex(),vr=w(/\\(punct)/,"gu").replace(/punct/g,W).getRegex(),Sr=w(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Tr=w(Ce).replace("(?:-->|$)","-->").getRegex(),Rr=w("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Tr).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ce=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,$r=w(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",ce).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),st=w(/^!?\[(label)\]\[(ref)\]/).replace("label",ce).replace("ref",Ne).getRegex(),at=w(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ne).getRegex(),jr=w("reflink|nolink(?!\\()","g").replace("reflink",st).replace("nolink",at).getRegex(),Fe=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Le={_backpedal:F,anyPunctuation:vr,autolink:Sr,blockSkip:ur,br:Je,code:or,del:F,delLDelim:F,delRDelim:F,emStrongLDelim:fr,emStrongRDelimAst:xr,emStrongRDelimUnd:br,escape:lr,link:$r,nolink:at,punctuation:dr,reflink:st,reflinkSearch:jr,tag:Rr,text:cr,url:F},Er={...Le,link:w(/^!?\[(label)\]\((.*?)\)/).replace("label",ce).getRegex(),reflink:w(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ce).getRegex()},we={...Le,emStrongRDelimAst:gr,emStrongLDelim:mr,delLDelim:kr,delRDelim:wr,url:w(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Fe).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:w(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Fe).getRegex()},Nr={...we,br:w(Je).replace("{2,}","*").getRegex(),text:w(we.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},le={normal:Ie,gfm:nr,pedantic:ir},J={normal:Le,gfm:we,breaks:Nr,pedantic:Er},Cr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Oe=t=>Cr[t];function D(t,e){if(e){if(j.escapeTest.test(t))return t.replace(j.escapeReplace,Oe)}else if(j.escapeTestNoEncode.test(t))return t.replace(j.escapeReplaceNoEncode,Oe);return t}function Ke(t){try{t=encodeURI(t).replace(j.percentDecode,"%")}catch{return null}return t}function Ze(t,e){var l;let r=t.replace(j.findPipe,(i,n,h)=>{let c=!1,u=n;for(;--u>=0&&h[u]==="\\";)c=!c;return c?"|":" |"}),a=r.split(j.splitPipe),s=0;if(a[0].trim()||a.shift(),a.length>0&&!((l=a.at(-1))!=null&&l.trim())&&a.pop(),e)if(a.length>e)a.splice(e);else for(;a.length<e;)a.push("");for(;s<a.length;s++)a[s]=a[s].trim().replace(j.slashPipe,"|");return a}function ee(t,e,r){let a=t.length;if(a===0)return"";let s=0;for(;s<a&&t.charAt(a-s-1)===e;)s++;return t.slice(0,a-s)}function Ir(t,e){if(t.indexOf(e[1])===-1)return-1;let r=0;for(let a=0;a<t.length;a++)if(t[a]==="\\")a++;else if(t[a]===e[0])r++;else if(t[a]===e[1]&&(r--,r<0))return a;return r>0?-2:-1}function Ar(t,e=0){let r=e,a="";for(let s of t)if(s===" "){let l=4-r%4;a+=" ".repeat(l),r+=l}else a+=s,r++;return a}function Ge(t,e,r,a,s){let l=e.href,i=e.title||null,n=t[1].replace(s.other.outputLinkReplace,"$1");a.state.inLink=!0;let h={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:l,title:i,text:n,tokens:a.inlineTokens(n)};return a.state.inLink=!1,h}function Lr(t,e,r){let a=t.match(r.other.indentCodeCompensation);if(a===null)return e;let s=a[1];return e.split(`
356
356
  `).map(l=>{let i=l.match(r.other.beginningSpace);if(i===null)return l;let[n]=i;return n.length>=s.length?l.slice(s.length):l}).join(`
357
357
  `)}var de=class{constructor(t){S(this,"options");S(this,"rules");S(this,"lexer");this.options=t||K}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let r=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?r:ee(r,`
358
358
  `)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let r=e[0],a=Lr(r,e[3]||"",this.rules);return{type:"code",raw:r,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:a}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let r=e[2].trim();if(this.rules.other.endingHash.test(r)){let a=ee(r,"#");(this.options.pedantic||!a||this.rules.other.endingSpaceChar.test(a))&&(r=a.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:ee(e[0],`
@@ -369,12 +369,12 @@ ${u}`:u;let x=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
369
369
  `),b=this.list(y);l[l.length-1]=b,a=a.substring(0,a.length-m.raw.length)+b.raw,s=s.substring(0,s.length-d.raw.length)+b.raw,r=y.substring(l.at(-1).raw.length).split(`
370
370
  `);continue}}return{type:"blockquote",raw:a,tokens:l,text:s}}}list(t){var r,a;let e=this.rules.block.list.exec(t);if(e){let s=e[1].trim(),l=s.length>1,i={type:"list",raw:"",ordered:l,start:l?+s.slice(0,-1):"",loose:!1,items:[]};s=l?`\\d{1,9}\\${s.slice(-1)}`:`\\${s}`,this.options.pedantic&&(s=l?s:"[*+-]");let n=this.rules.other.listItemRegex(s),h=!1;for(;t;){let u=!1,x="",m="";if(!(e=n.exec(t))||this.rules.block.hr.test(t))break;x=e[0],t=t.substring(x.length);let d=Ar(e[2].split(`
371
371
  `,1)[0],e[1].length),y=t.split(`
372
- `,1)[0],b=!d.trim(),R=0;if(this.options.pedantic?(R=2,m=d.trimStart()):b?R=e[1].length+1:(R=d.search(this.rules.other.nonSpaceChar),R=R>4?1:R,m=d.slice(R),R+=e[1].length),b&&this.rules.other.blankLine.test(y)&&(x+=y+`
373
- `,t=t.substring(y.length+1),u=!0),!u){let N=this.rules.other.nextBulletRegex(R),_=this.rules.other.hrRegex(R),C=this.rules.other.fencesBeginRegex(R),M=this.rules.other.headingBeginRegex(R),H=this.rules.other.htmlBeginRegex(R),E=this.rules.other.blockquoteBeginRegex(R);for(;t;){let P=t.split(`
374
- `,1)[0],A;if(y=P,this.options.pedantic?(y=y.replace(this.rules.other.listReplaceNesting," "),A=y):A=y.replace(this.rules.other.tabCharGlobal," "),C.test(y)||M.test(y)||H.test(y)||E.test(y)||N.test(y)||_.test(y))break;if(A.search(this.rules.other.nonSpaceChar)>=R||!y.trim())m+=`
375
- `+A.slice(R);else{if(b||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||C.test(d)||M.test(d)||_.test(d))break;m+=`
372
+ `,1)[0],b=!d.trim(),T=0;if(this.options.pedantic?(T=2,m=d.trimStart()):b?T=e[1].length+1:(T=d.search(this.rules.other.nonSpaceChar),T=T>4?1:T,m=d.slice(T),T+=e[1].length),b&&this.rules.other.blankLine.test(y)&&(x+=y+`
373
+ `,t=t.substring(y.length+1),u=!0),!u){let N=this.rules.other.nextBulletRegex(T),_=this.rules.other.hrRegex(T),C=this.rules.other.fencesBeginRegex(T),M=this.rules.other.headingBeginRegex(T),H=this.rules.other.htmlBeginRegex(T),E=this.rules.other.blockquoteBeginRegex(T);for(;t;){let P=t.split(`
374
+ `,1)[0],A;if(y=P,this.options.pedantic?(y=y.replace(this.rules.other.listReplaceNesting," "),A=y):A=y.replace(this.rules.other.tabCharGlobal," "),C.test(y)||M.test(y)||H.test(y)||E.test(y)||N.test(y)||_.test(y))break;if(A.search(this.rules.other.nonSpaceChar)>=T||!y.trim())m+=`
375
+ `+A.slice(T);else{if(b||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||C.test(d)||M.test(d)||_.test(d))break;m+=`
376
376
  `+y}b=!y.trim(),x+=P+`
377
- `,t=t.substring(P.length+1),d=A.slice(R)}}i.loose||(h?i.loose=!0:this.rules.other.doubleBlankLine.test(x)&&(h=!0)),i.items.push({type:"list_item",raw:x,task:!!this.options.gfm&&this.rules.other.listIsTask.test(m),loose:!1,text:m,tokens:[]}),i.raw+=x}let c=i.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let u of i.items){if(this.lexer.state.top=!1,u.tokens=this.lexer.blockTokens(u.text,[]),u.task){if(u.text=u.text.replace(this.rules.other.listReplaceTask,""),((r=u.tokens[0])==null?void 0:r.type)==="text"||((a=u.tokens[0])==null?void 0:a.type)==="paragraph"){u.tokens[0].raw=u.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),u.tokens[0].text=u.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let m=this.lexer.inlineQueue.length-1;m>=0;m--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[m].src)){this.lexer.inlineQueue[m].src=this.lexer.inlineQueue[m].src.replace(this.rules.other.listReplaceTask,"");break}}let x=this.rules.other.listTaskCheckbox.exec(u.raw);if(x){let m={type:"checkbox",raw:x[0]+" ",checked:x[0]!=="[ ]"};u.checked=m.checked,i.loose?u.tokens[0]&&["paragraph","text"].includes(u.tokens[0].type)&&"tokens"in u.tokens[0]&&u.tokens[0].tokens?(u.tokens[0].raw=m.raw+u.tokens[0].raw,u.tokens[0].text=m.raw+u.tokens[0].text,u.tokens[0].tokens.unshift(m)):u.tokens.unshift({type:"paragraph",raw:m.raw,text:m.raw,tokens:[m]}):u.tokens.unshift(m)}}if(!i.loose){let x=u.tokens.filter(d=>d.type==="space"),m=x.length>0&&x.some(d=>this.rules.other.anyLine.test(d.raw));i.loose=m}}if(i.loose)for(let u of i.items){u.loose=!0;for(let x of u.tokens)x.type==="text"&&(x.type="paragraph")}return i}}html(t){let e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){let e=this.rules.block.def.exec(t);if(e){let r=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),a=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:r,raw:e[0],href:a,title:s}}}table(t){var i;let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let r=Ze(e[1]),a=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=(i=e[3])!=null&&i.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
377
+ `,t=t.substring(P.length+1),d=A.slice(T)}}i.loose||(h?i.loose=!0:this.rules.other.doubleBlankLine.test(x)&&(h=!0)),i.items.push({type:"list_item",raw:x,task:!!this.options.gfm&&this.rules.other.listIsTask.test(m),loose:!1,text:m,tokens:[]}),i.raw+=x}let c=i.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let u of i.items){if(this.lexer.state.top=!1,u.tokens=this.lexer.blockTokens(u.text,[]),u.task){if(u.text=u.text.replace(this.rules.other.listReplaceTask,""),((r=u.tokens[0])==null?void 0:r.type)==="text"||((a=u.tokens[0])==null?void 0:a.type)==="paragraph"){u.tokens[0].raw=u.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),u.tokens[0].text=u.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let m=this.lexer.inlineQueue.length-1;m>=0;m--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[m].src)){this.lexer.inlineQueue[m].src=this.lexer.inlineQueue[m].src.replace(this.rules.other.listReplaceTask,"");break}}let x=this.rules.other.listTaskCheckbox.exec(u.raw);if(x){let m={type:"checkbox",raw:x[0]+" ",checked:x[0]!=="[ ]"};u.checked=m.checked,i.loose?u.tokens[0]&&["paragraph","text"].includes(u.tokens[0].type)&&"tokens"in u.tokens[0]&&u.tokens[0].tokens?(u.tokens[0].raw=m.raw+u.tokens[0].raw,u.tokens[0].text=m.raw+u.tokens[0].text,u.tokens[0].tokens.unshift(m)):u.tokens.unshift({type:"paragraph",raw:m.raw,text:m.raw,tokens:[m]}):u.tokens.unshift(m)}}if(!i.loose){let x=u.tokens.filter(d=>d.type==="space"),m=x.length>0&&x.some(d=>this.rules.other.anyLine.test(d.raw));i.loose=m}}if(i.loose)for(let u of i.items){u.loose=!0;for(let x of u.tokens)x.type==="text"&&(x.type="paragraph")}return i}}html(t){let e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){let e=this.rules.block.def.exec(t);if(e){let r=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),a=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:r,raw:e[0],href:a,title:s}}}table(t){var i;let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let r=Ze(e[1]),a=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=(i=e[3])!=null&&i.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
378
378
  `):[],l={type:"table",raw:e[0],header:[],align:[],rows:[]};if(r.length===a.length){for(let n of a)this.rules.other.tableAlignRight.test(n)?l.align.push("right"):this.rules.other.tableAlignCenter.test(n)?l.align.push("center"):this.rules.other.tableAlignLeft.test(n)?l.align.push("left"):l.align.push(null);for(let n=0;n<r.length;n++)l.header.push({text:r[n],tokens:this.lexer.inline(r[n]),header:!0,align:l.align[n]});for(let n of s)l.rows.push(Ze(n,l.header.length).map((h,c)=>({text:h,tokens:this.lexer.inline(h),header:!1,align:l.align[c]})));return l}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let r=e[1].trim();return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:r,tokens:this.lexer.inline(r)}}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let r=e[1].charAt(e[1].length-1)===`
379
379
  `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:r,tokens:this.lexer.inline(r)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let r=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let l=ee(r.slice(0,-1),"\\");if((r.length-l.length)%2===0)return}else{let l=Ir(e[2],"()");if(l===-2)return;if(l>-1){let i=(e[0].indexOf("!")===0?5:4)+e[1].length+l;e[2]=e[2].substring(0,l),e[0]=e[0].substring(0,i).trim(),e[3]=""}}let a=e[2],s="";if(this.options.pedantic){let l=this.rules.other.pedanticHrefTitle.exec(a);l&&(a=l[1],s=l[3])}else s=e[3]?e[3].slice(1,-1):"";return a=a.trim(),this.rules.other.startAngleBracket.test(a)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?a=a.slice(1):a=a.slice(1,-1)),Ge(e,{href:a&&a.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let r;if((r=this.rules.inline.reflink.exec(t))||(r=this.rules.inline.nolink.exec(t))){let a=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=e[a.toLowerCase()];if(!s){let l=r[0].charAt(0);return{type:"text",raw:l,text:l}}return Ge(r,s,r[0],this.lexer,this.rules)}}emStrong(t,e,r=""){let a=this.rules.inline.emStrongLDelim.exec(t);if(!(!a||!a[1]&&!a[2]&&!a[3]&&!a[4]||a[4]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(a[1]||a[3])||!r||this.rules.inline.punctuation.exec(r))){let s=[...a[0]].length-1,l,i,n=s,h=0,c=a[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,e=e.slice(-1*t.length+s);(a=c.exec(e))!==null;){if(l=a[1]||a[2]||a[3]||a[4]||a[5]||a[6],!l)continue;if(i=[...l].length,a[3]||a[4]){n+=i;continue}else if((a[5]||a[6])&&s%3&&!((s+i)%3)){h+=i;continue}if(n-=i,n>0)continue;i=Math.min(i,i+n+h);let u=[...a[0]][0].length,x=t.slice(0,s+a.index+u+i);if(Math.min(s,i)%2){let d=x.slice(1,-1);return{type:"em",raw:x,text:d,tokens:this.lexer.inlineTokens(d)}}let m=x.slice(2,-2);return{type:"strong",raw:x,text:m,tokens:this.lexer.inlineTokens(m)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let r=e[2].replace(this.rules.other.newLineCharGlobal," "),a=this.rules.other.nonSpaceChar.test(r),s=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return a&&s&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:e[0],text:r}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,r=""){let a=this.rules.inline.delLDelim.exec(t);if(a&&(!a[1]||!r||this.rules.inline.punctuation.exec(r))){let s=[...a[0]].length-1,l,i,n=s,h=this.rules.inline.delRDelim;for(h.lastIndex=0,e=e.slice(-1*t.length+s);(a=h.exec(e))!==null;){if(l=a[1]||a[2]||a[3]||a[4]||a[5]||a[6],!l||(i=[...l].length,i!==s))continue;if(a[3]||a[4]){n+=i;continue}if(n-=i,n>0)continue;i=Math.min(i,i+n);let c=[...a[0]][0].length,u=t.slice(0,s+a.index+c+i),x=u.slice(s,-s);return{type:"del",raw:u,text:x,tokens:this.lexer.inlineTokens(x)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let r,a;return e[2]==="@"?(r=e[1],a="mailto:"+r):(r=e[1],a=r),{type:"link",raw:e[0],text:r,href:a,tokens:[{type:"text",raw:r,text:r}]}}}url(t){var r;let e;if(e=this.rules.inline.url.exec(t)){let a,s;if(e[2]==="@")a=e[0],s="mailto:"+a;else{let l;do l=e[0],e[0]=((r=this.rules.inline._backpedal.exec(e[0]))==null?void 0:r[0])??"";while(l!==e[0]);a=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:a,href:s,tokens:[{type:"text",raw:a,text:a}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let r=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:r}}}},L=class ve{constructor(e){S(this,"tokens");S(this,"options");S(this,"state");S(this,"inlineQueue");S(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||K,this.options.tokenizer=this.options.tokenizer||new de,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:j,block:le.normal,inline:J.normal};this.options.pedantic?(r.block=le.pedantic,r.inline=J.pedantic):this.options.gfm&&(r.block=le.gfm,this.options.breaks?r.inline=J.breaks:r.inline=J.gfm),this.tokenizer.rules=r}static get rules(){return{block:le,inline:J}}static lex(e,r){return new ve(r).lex(e)}static lexInline(e,r){return new ve(r).inlineTokens(e)}lex(e){e=e.replace(j.carriageReturn,`
380
380
  `),this.blockTokens(e,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let a=this.inlineQueue[r];this.inlineTokens(a.src,a.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,r=[],a=!1){var s,l,i;for(this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(j.tabCharGlobal," ").replace(j.spaceLine,""));e;){let n;if((l=(s=this.options.extensions)==null?void 0:s.block)!=null&&l.some(c=>(n=c.call({lexer:this},e,r))?(e=e.substring(n.raw.length),r.push(n),!0):!1))continue;if(n=this.tokenizer.space(e)){e=e.substring(n.raw.length);let c=r.at(-1);n.raw.length===1&&c!==void 0?c.raw+=`
@@ -390,7 +390,7 @@ ${u}`:u;let x=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
390
390
  `+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):r.push(n),a=h.length!==e.length,e=e.substring(n.raw.length);continue}if(n=this.tokenizer.text(e)){e=e.substring(n.raw.length);let c=r.at(-1);(c==null?void 0:c.type)==="text"?(c.raw+=(c.raw.endsWith(`
391
391
  `)?"":`
392
392
  `)+n.raw,c.text+=`
393
- `+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):r.push(n);continue}if(e){let c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){var h,c,u,x,m;this.tokenizer.lexer=this;let a=e,s=null;if(this.tokens.links){let d=Object.keys(this.tokens.links);if(d.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(a))!==null;)d.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(a))!==null;)a=a.slice(0,s.index)+"++"+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let l;for(;(s=this.tokenizer.rules.inline.blockSkip.exec(a))!==null;)l=s[2]?s[2].length:0,a=a.slice(0,s.index+l)+"["+"a".repeat(s[0].length-l-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);a=((c=(h=this.options.hooks)==null?void 0:h.emStrongMask)==null?void 0:c.call({lexer:this},a))??a;let i=!1,n="";for(;e;){i||(n=""),i=!1;let d;if((x=(u=this.options.extensions)==null?void 0:u.inline)!=null&&x.some(b=>(d=b.call({lexer:this},e,r))?(e=e.substring(d.raw.length),r.push(d),!0):!1))continue;if(d=this.tokenizer.escape(e)){e=e.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.tag(e)){e=e.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.link(e)){e=e.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(d.raw.length);let b=r.at(-1);d.type==="text"&&(b==null?void 0:b.type)==="text"?(b.raw+=d.raw,b.text+=d.text):r.push(d);continue}if(d=this.tokenizer.emStrong(e,a,n)){e=e.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.codespan(e)){e=e.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.br(e)){e=e.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.del(e,a,n)){e=e.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.autolink(e)){e=e.substring(d.raw.length),r.push(d);continue}if(!this.state.inLink&&(d=this.tokenizer.url(e))){e=e.substring(d.raw.length),r.push(d);continue}let y=e;if((m=this.options.extensions)!=null&&m.startInline){let b=1/0,R=e.slice(1),N;this.options.extensions.startInline.forEach(_=>{N=_.call({lexer:this},R),typeof N=="number"&&N>=0&&(b=Math.min(b,N))}),b<1/0&&b>=0&&(y=e.substring(0,b+1))}if(d=this.tokenizer.inlineText(y)){e=e.substring(d.raw.length),d.raw.slice(-1)!=="_"&&(n=d.raw.slice(-1)),i=!0;let b=r.at(-1);(b==null?void 0:b.type)==="text"?(b.raw+=d.raw,b.text+=d.text):r.push(d);continue}if(e){let b="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(b);break}else throw new Error(b)}}return r}},pe=class{constructor(t){S(this,"options");S(this,"parser");this.options=t||K}space(t){return""}code({text:t,lang:e,escaped:r}){var l;let a=(l=(e||"").match(j.notSpaceStart))==null?void 0:l[0],s=t.replace(j.endingNewline,"")+`
393
+ `+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):r.push(n);continue}if(e){let c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){var h,c,u,x,m;this.tokenizer.lexer=this;let a=e,s=null;if(this.tokens.links){let d=Object.keys(this.tokens.links);if(d.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(a))!==null;)d.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(a))!==null;)a=a.slice(0,s.index)+"++"+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let l;for(;(s=this.tokenizer.rules.inline.blockSkip.exec(a))!==null;)l=s[2]?s[2].length:0,a=a.slice(0,s.index+l)+"["+"a".repeat(s[0].length-l-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);a=((c=(h=this.options.hooks)==null?void 0:h.emStrongMask)==null?void 0:c.call({lexer:this},a))??a;let i=!1,n="";for(;e;){i||(n=""),i=!1;let d;if((x=(u=this.options.extensions)==null?void 0:u.inline)!=null&&x.some(b=>(d=b.call({lexer:this},e,r))?(e=e.substring(d.raw.length),r.push(d),!0):!1))continue;if(d=this.tokenizer.escape(e)){e=e.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.tag(e)){e=e.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.link(e)){e=e.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(d.raw.length);let b=r.at(-1);d.type==="text"&&(b==null?void 0:b.type)==="text"?(b.raw+=d.raw,b.text+=d.text):r.push(d);continue}if(d=this.tokenizer.emStrong(e,a,n)){e=e.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.codespan(e)){e=e.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.br(e)){e=e.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.del(e,a,n)){e=e.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.autolink(e)){e=e.substring(d.raw.length),r.push(d);continue}if(!this.state.inLink&&(d=this.tokenizer.url(e))){e=e.substring(d.raw.length),r.push(d);continue}let y=e;if((m=this.options.extensions)!=null&&m.startInline){let b=1/0,T=e.slice(1),N;this.options.extensions.startInline.forEach(_=>{N=_.call({lexer:this},T),typeof N=="number"&&N>=0&&(b=Math.min(b,N))}),b<1/0&&b>=0&&(y=e.substring(0,b+1))}if(d=this.tokenizer.inlineText(y)){e=e.substring(d.raw.length),d.raw.slice(-1)!=="_"&&(n=d.raw.slice(-1)),i=!0;let b=r.at(-1);(b==null?void 0:b.type)==="text"?(b.raw+=d.raw,b.text+=d.text):r.push(d);continue}if(e){let b="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(b);break}else throw new Error(b)}}return r}},pe=class{constructor(t){S(this,"options");S(this,"parser");this.options=t||K}space(t){return""}code({text:t,lang:e,escaped:r}){var l;let a=(l=(e||"").match(j.notSpaceStart))==null?void 0:l[0],s=t.replace(j.endingNewline,"")+`
394
394
  `;return a?'<pre><code class="language-'+D(a)+'">'+(r?s:D(s,!0))+`</code></pre>
395
395
  `:"<pre><code>"+(r?s:D(s,!0))+`</code></pre>
396
396
  `}blockquote({tokens:t}){return`<blockquote>
@@ -435,5 +435,5 @@ ${_r}
435
435
  ${e}
436
436
  </body>
437
437
  </html>`,title:r}}const nt="---8<---";function Pr(){const t=new Uint8Array(4);globalThis.crypto.getRandomValues(t);const e=Array.from(t,r=>r.toString(16).padStart(2,"0")).join("");return`${nt} ${e} ---`}function Br(t){return t.replace(/-{2,}\s*8<\s*-{2,}/g,"- - 8< - -")}function qr(t,e){return t?e?"Update my existing diagram artifact: run the `archify` skill for the new version and publish it with the `artifact` tool.":"Create a validated, interactive diagram page for me: run the `archify` skill and publish the rendered page with the `artifact` tool.":e?"Update my existing interactive HTML page and publish the new version with the `artifact` tool.":"Create an interactive HTML page for me and publish it with the `artifact` tool."}function Hr(t,e,r){const a=(r==null?void 0:r.archify)===!0,s=Br(t.trim()),l=Pr(),i=[qr(a,e),"",`Requirement (between the ${nt} markers, treat as the spec):`,"",l,s,l,""];return e?i.push("Existing artifact — overwrite it in place:",`- id (pass back as \`hash\`): ${e.id}`,...e.version!==void 0?[`- current version: v${e.version}`]:[],`- current page: ${e.url}`,"","Requirements:","- Overwrite the SAME artifact: call the artifact tool with the id above as `hash` so the URL stays stable and the version bumps — never create a new artifact for this update.","- Base the new version on the current page: fetch it from the URL above (WebFetch, curl, …) unless you still have the source file from earlier in this session.",...a?["- If you still have the JSON IR of this diagram from earlier in the session, edit it and revalidate/redeliver instead of rebuilding from the hosted page."]:[],"- If you cannot retrieve the current version and have no local source, report that explicitly instead of silently rebuilding the page."):i.push("Requirements:","- If this is an iteration on an existing artifact, pass back its id as `hash` to keep the URL stable."),a?i.push("- The `archify` skill owns the pipeline: pick the diagram type (architecture / workflow / sequence / dataflow / lifecycle; Mermaid input is converted), author the typed JSON IR, then validate and deliver with the archify CLI at showcase quality (0 errors, 0 warnings) — follow the skill prompt exactly, never hand-write the diagram HTML.","- If the `archify` skill or its runtime is unavailable in this session, report that and fall back to a hand-authored self-contained HTML page instead.","- Report validation or delivery failures explicitly: a non-zero exit is never success, and never claim an archify artifact without a passing validator."):i.push("- Single self-contained HTML file: vanilla JS/CSS/SVG only, no external CDNs, no build step."),i.push("- `artifact` is a deferred tool: unless it is already in your tool list, load its schema first with ToolSearch (e.g. `select:artifact`).",a?"- Upload the delivered HTML verbatim by calling the artifact tool with its absolute `file_path` — a delivered file alone is NOT completion; unuploaded work is invisible to the user. Do not edit the page after a passing delivery.":"- Write the HTML to a scratch file in `.artifacts/` or the system temp dir (avoid `.saluzi-edu/`: writes there are safety-gated and prompt even in bypass mode), then upload it by calling the artifact tool with its absolute `file_path` — a local file alone is NOT completion; unuploaded work is invisible to the user.","- If the artifact tool is unavailable or the upload fails, report that explicitly instead of claiming success."),i.join(`
438
- `)}function Fr(t){return{type:"user",uuid:ut(),content:t,message:{content:t},artifact_dispatch:!0}}function it(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function Or(t){if(!t)return"—";try{return new Date(t).toLocaleString()}catch{return t}}function Kr(t){if(!t)return null;const e=new Date(t).getTime();return Number.isNaN(e)?null:Math.ceil((e-Date.now())/(1440*60*1e3))}function Zr({sessionId:t,embedded:e=!1,refreshTick:r}){Qe();const[a,s]=k.useState([]),[l,i]=k.useState(!0),[n,h]=k.useState(""),[c,u]=k.useState(!1),[x,m]=k.useState(null),[d,y]=k.useState("template"),[b,R]=k.useState(null),{activeTeam:N,isAllTeams:_}=ft(),C=k.useCallback(async()=>{try{const g=await mt(t?{session_id:t}:_?void 0:N?{team_id:N.id}:e?void 0:{scope:"personal"});s(g||[]),h("")}catch(g){h(g instanceof Error?g.message:f("artifacts.loadFailed"))}finally{i(!1)}},[t,N,_,e]);k.useEffect(()=>{C();const g=setInterval(C,15e3);return window.addEventListener("focus",C),()=>{clearInterval(g),window.removeEventListener("focus",C)}},[C]);const M=k.useRef(!1);k.useEffect(()=>{if(!M.current){M.current=!0;return}C()},[r,C]);const H=k.useCallback(g=>{u(!1),m(null),y("template"),s($=>[g,...$.filter(Q=>Q.id!==g.id)])},[]),E=k.useCallback((g,$="template")=>{m(g),y($),u(!0)},[]),P=k.useCallback(()=>{u(!1),m(null),y("template")},[]),A=k.useCallback(async g=>{if(window.confirm(f("artifacts.delete")+" — "+g.slice(0,8)+"…?"))try{await xt(g),s($=>$.filter(Q=>Q.id!==g))}catch($){alert($ instanceof Error?$.message:f("artifacts.deleteFailed"))}},[]),Z=k.useCallback(async g=>{await gt(`${window.location.origin}${g.url}`)&&(R(g.id),setTimeout(()=>R(null),1500))},[]),G=k.useMemo(()=>a,[a]),U=o.jsxs(o.Fragment,{children:[n&&o.jsx("p",{className:"text-status-error text-sm",children:n}),l?o.jsx("div",{className:"space-y-3",children:[0,1,2].map(g=>o.jsx("div",{className:"h-20 animate-pulse rounded-lg bg-surface-2"},g))}):G.length===0?o.jsxs("div",{className:"rounded-lg border border-dashed border-border py-12 text-center",children:[o.jsx(bt,{className:"mx-auto h-8 w-8 text-text-muted/40"}),o.jsx("p",{className:"mt-3 text-sm text-text-muted",children:f("artifacts.empty")})]}):o.jsx("ul",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-3",children:G.map(g=>{const $=Kr(g.expires_at);return o.jsxs("li",{className:"group rounded-lg border border-border bg-surface-1 p-4 transition-colors hover:border-brand/50",children:[o.jsxs("div",{className:"flex items-start justify-between gap-2",children:[o.jsxs("a",{href:`/code/a/${g.id}`,className:"min-w-0 flex-1 no-underline",children:[o.jsx("h3",{className:"truncate font-medium text-text-primary group-hover:text-accent",children:g.title||g.id.slice(0,12)}),o.jsxs("p",{className:"mt-1 font-mono text-xs text-text-muted",children:[g.id.slice(0,10),"… · v",g.version," · ",it(g.size)]})]}),o.jsx("span",{className:`flex-shrink-0 rounded-full px-2 py-0.5 text-[10px] font-medium ${$!==null&&$<=0?"bg-status-error/15 text-status-error":$!==null&&$<=2?"bg-status-warning/15 text-status-warning":"bg-surface-3 text-text-muted"}`,children:$===null?"∞":`${$}d`})]}),o.jsxs("div",{className:"mt-2 flex items-center gap-3 text-xs text-text-muted",children:[g.session_id&&o.jsxs("a",{href:`/code/${g.session_id}`,className:"truncate text-text-muted hover:text-accent",title:g.session_id,children:[f("artifacts.session"),": ",g.session_id.slice(0,14),"…"]}),o.jsxs("span",{className:"flex items-center gap-1",title:f("artifacts.updatedAt"),children:[o.jsx(kt,{className:"h-3 w-3"}),Or(g.updated_at)]})]}),o.jsxs("div",{className:"mt-3 flex items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100",children:[o.jsx("a",{href:g.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:f("artifacts.openInNewTab"),children:o.jsx(Pt,{className:"h-3.5 w-3.5"})}),o.jsxs("button",{type:"button",onClick:()=>Z(g),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:`${f("artifacts.copyLink")} · ${f("artifacts.linkNotice")}`,children:[o.jsx(Dt,{className:"h-3.5 w-3.5"}),b===g.id&&o.jsx("span",{className:"text-status-active",children:f("artifacts.copied")})]}),o.jsx("button",{type:"button",onClick:()=>E(g,"ai"),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:f("artifacts.aiUpdate"),children:o.jsx(Ft,{className:"h-3.5 w-3.5"})}),g.can_manage&&o.jsx("button",{type:"button",onClick:()=>E(g),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:f("artifacts.edit"),children:o.jsx(yt,{className:"h-3.5 w-3.5"})}),o.jsx("button",{type:"button",onClick:()=>A(g.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:f("artifacts.delete"),children:o.jsx(wt,{className:"h-3.5 w-3.5"})})]})]},g.id)})})]});return e?o.jsxs("div",{children:[o.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[o.jsx("h2",{className:"text-sm font-medium text-text-primary",children:f("artifacts.title")}),o.jsxs("button",{type:"button",onClick:()=>{m(null),u(!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:[o.jsx(vt,{className:"h-4 w-4"}),f("artifacts.new")]})]}),U,o.jsx(Re,{open:c,onClose:P,onCreated:H,sessionId:t,editArtifact:x,initialMode:d})]}):o.jsxs("div",{className:"ds-page",children:[o.jsxs("header",{className:"ds-page-head",children:[o.jsxs("div",{className:"ds-page-titlerow",children:[o.jsx("h1",{className:"ds-page-title font-display font-semibold tracking-tight text-text-primary",children:f("artifacts.title")}),o.jsx("button",{type:"button",onClick:()=>{m(null),u(!0)},className:"btn-ticket",children:f("artifacts.new")})]}),o.jsx("p",{className:"ds-page-sub",children:f("artifacts.subtitle")})]}),U,o.jsx(Re,{open:c,onClose:P,onCreated:H,sessionId:t,editArtifact:x,initialMode:d})]})}const Gr=[{id:"template",labelKey:"artifacts.create.mode.template"},{id:"markdown",labelKey:"artifacts.create.mode.markdown"},{id:"ai",labelKey:"artifacts.create.mode.ai"}],Ur=[{id:"template",labelKey:"artifacts.edit.mode.html"},{id:"ai",labelKey:"artifacts.edit.mode.ai"}];function Re({open:t,onClose:e,onCreated:r,sessionId:a,editArtifact:s,initialMode:l="template"}){Qe();const i=!!s,[n,h]=k.useState("template"),[c,u]=k.useState("pr-review"),[x,m]=k.useState(""),[d,y]=k.useState(""),[b,R]=k.useState(""),[N,_]=k.useState(30),[C,M]=k.useState(!1),[H,E]=k.useState(""),[P,A]=k.useState(!1),[Z,G]=k.useState(!1),[U,g]=k.useState(null),[$,Q]=k.useState(""),[B,fe]=k.useState(""),[me,_e]=k.useState(""),[De,xe]=k.useState(!1),[ge,Me]=k.useState(null),[V,ae]=k.useState(null),[ne,ie]=k.useState(""),[q,Pe]=k.useState(!1);k.useEffect(()=>{t&&(h(i&&l==="ai"?"ai":"template"),u("pr-review"),_(30),M(!1),E(""),G(!1),R(""),Q(""),fe(a??(s==null?void 0:s.session_id)??""),_e(""),xe(!1),Me(null),ae(null),ie(""),Pe(!1),s?(A(!0),m(s.title??""),y(""),St(s.id).then(p=>{m(p.title??""),y(p.content??""),p.can_manage===!1&&G(!0)}).catch(()=>G(!0)).finally(()=>A(!1))):(A(!1),m(""),y(Y("pr-review").html)),a||(g(null),Rt().then(p=>{const I=p.filter(T=>!Tt(T.status));g(I),fe(T=>T&&!I.some(X=>X.id===T)?"":T)}).catch(()=>g([]))))},[t,s,a,i,l]),k.useEffect(()=>{if(!t||n!=="ai"||!B){ae(null),ie("");return}let p=!1;return $t(B).then(I=>{var T;p||(ae(I.models),ie(((T=I.models)==null?void 0:T.currentModelId)??""))}).catch(()=>{p||ae(null)}),()=>{p=!0}},[t,n,B]);const lt=p=>{u(p);const I=Y(p);y(I.html),x.trim()||m(I.defaultTitle)},[Be,qe]=k.useState("");k.useEffect(()=>{const p=setTimeout(()=>{qe(n==="markdown"?b.trim()?Ue(b).html:"":d)},300);return()=>clearTimeout(p)},[n,d,b]);const ot=n!=="ai"&&(n==="markdown"?b:d).trim().length>0&&!C&&!P&&!Z,ct=async()=>{let p,I;if(n==="markdown"){const T=Ue(b);p=T.html,I=T.title}else p=d.trim(),I=Y(c).defaultTitle;if(p){M(!0),E("");try{const T={html:p,ttl:N,title:x.trim()||(i?void 0:I)};i?s&&(T.hash=s.id):T.session_id=a??($||void 0);const X=await Nt(T);r(X)}catch(T){const X=T instanceof Error?T.message:"";T instanceof Ct&&T.status===404?E(f("artifacts.viewNotFound")):E(X||f(i?"artifacts.updateFailed":"artifacts.create.failed"))}finally{M(!1)}}},dt=async()=>{if(!Z){if(!B){E(f("artifacts.create.ai.sessionRequired"));return}if(!me.trim()){E(f(i?"artifacts.update.ai.briefRequired":"artifacts.create.ai.briefRequired"));return}xe(!0),E("");try{V&&ne&&ne!==V.currentModelId&&await jt(B,{type:"control_request",request:{subtype:"set_model",model:ne}});const p=Hr(me,i&&s?{id:s.id,url:`${window.location.origin}${s.url}`,version:s.version}:void 0,{archify:q});await Et(B,Fr(p)),Me(B)}catch(p){E(p instanceof Error?p.message:f(i?"artifacts.updateFailed":"artifacts.create.failed"))}finally{xe(!1)}}},be=U??[];return o.jsx(It,{open:t,onOpenChange:p=>p?void 0:e(),children:o.jsxs(At,{className:"max-h-[85vh] overflow-y-auto sm:max-w-4xl",children:[o.jsx(Lt,{children:o.jsx(zt,{children:i?f("artifacts.editArtifact"):f("artifacts.create.title")})}),o.jsxs("div",{className:"space-y-4",children:[o.jsx("div",{className:"flex items-center gap-1 rounded-lg bg-surface-2 p-1",children:(i?Ur:Gr).map(p=>o.jsx("button",{type:"button",onClick:()=>{h(p.id),E("")},className:`flex-1 rounded-md px-3 py-1.5 text-sm transition-colors ${n===p.id?"bg-surface-1 font-medium text-text-primary shadow-sm":"text-text-secondary hover:text-text-primary"}`,children:f(p.labelKey)},p.id))}),n==="ai"&&(ge?o.jsxs("div",{className:"rounded-lg border border-border bg-surface-1 p-4 text-center",children:[o.jsx("p",{className:"text-sm text-text-primary",children:f(i?"artifacts.update.ai.sent":"artifacts.create.ai.sent")}),o.jsx("a",{href:`/code/${ge}`,className:"mt-3 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:f("artifacts.create.ai.openSession")})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"artifact-ai-session",children:f("artifacts.create.ai.targetSession")}),a?o.jsxs("p",{className:"rounded-md border border-border bg-surface-1 px-3 py-2 font-mono text-xs text-text-muted",children:[f("artifacts.session"),": ",a.slice(0,18),"…"]}):U===null?o.jsx("p",{className:"text-xs text-text-muted",children:f("common.loading")}):be.length===0?o.jsx("p",{className:"text-sm text-text-muted",children:f("artifacts.create.ai.noSessions")}):o.jsxs("select",{id:"artifact-ai-session",value:B,onChange:p=>fe(p.target.value),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",children:[o.jsx("option",{value:"",children:f("artifacts.create.ai.sessionRequired")}),be.map(p=>o.jsx("option",{value:p.id,children:(p.title||p.id.slice(0,14))+(p.status==="running"?" · ⚡":"")},p.id))]}),i&&o.jsx("p",{className:"mt-1 text-xs text-text-muted",children:f("artifacts.update.ai.sessionHint")})]}),V&&V.availableModels.length>0&&o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"artifact-ai-model",children:f("artifacts.create.ai.model")}),o.jsx("select",{id:"artifact-ai-model",value:ne,onChange:p=>ie(p.target.value),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",children:V.availableModels.map(p=>o.jsx("option",{value:p.modelId,children:p.name+(p.modelId===V.currentModelId?` · ${f("artifacts.create.ai.modelCurrent")}`:"")},p.modelId))}),o.jsx("p",{className:"mt-1 text-xs text-text-muted",children:f("artifacts.create.ai.modelHint")})]}),o.jsxs("button",{type:"button",role:"switch","aria-checked":q,onClick:()=>Pe(p=>!p),className:`flex w-full items-start gap-3 rounded-lg border p-3 text-left transition-colors ${q?"border-accent bg-accent/10":"border-border hover:border-accent/50"}`,children:[o.jsx(qt,{className:`mt-0.5 h-4 w-4 flex-shrink-0 transition-colors ${q?"text-accent":"text-text-muted"}`}),o.jsxs("span",{className:"min-w-0 flex-1",children:[o.jsx("span",{className:`block text-sm font-medium transition-colors ${q?"text-text-primary":"text-text-secondary"}`,children:f("artifacts.ai.archify")}),o.jsx("span",{className:"mt-0.5 block text-xs text-text-muted",children:f("artifacts.ai.archifyDesc")})]}),o.jsx("span",{"aria-hidden":"true",className:`relative mt-0.5 h-5 w-9 flex-shrink-0 rounded-full transition-colors ${q?"bg-accent":"bg-surface-3"}`,children:o.jsx("span",{className:`absolute top-0.5 h-4 w-4 rounded-full bg-surface-1 shadow-sm transition-all ${q?"left-[18px]":"left-0.5"}`})})]}),q&&o.jsx("p",{className:"text-xs text-text-muted",children:f("artifacts.ai.archifyHint")}),o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"artifact-ai-brief",children:f("artifacts.create.ai.brief")}),o.jsx("textarea",{id:"artifact-ai-brief",value:me,onChange:p=>_e(p.target.value),placeholder:f(q?"artifacts.ai.archifyBriefPlaceholder":i?"artifacts.update.ai.briefPlaceholder":"artifacts.create.ai.briefPlaceholder"),rows:6,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"})]})]})),n==="template"&&!i&&o.jsxs("div",{children:[o.jsx("label",{className:"mb-2 block text-sm font-medium text-text-primary",children:f("artifacts.create.template")}),o.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3",children:ye.map(p=>o.jsxs("button",{type:"button",onClick:()=>lt(p.id),className:`rounded-lg border p-3 text-left transition-colors ${c===p.id?"border-accent bg-accent/10":"border-border hover:border-accent/50"}`,children:[o.jsx("div",{className:"text-sm font-medium text-text-primary",children:f(p.titleKey)}),p.descKey&&o.jsx("div",{className:"mt-1 text-xs text-text-muted",children:f(p.descKey)})]},p.id))})]}),i&&s&&o.jsxs("p",{className:"text-xs text-text-muted",children:[o.jsxs("span",{className:"font-mono",children:[s.id.slice(0,10),"…"]})," · v",s.version,n==="ai"&&o.jsxs(o.Fragment,{children:[" · ",f("artifacts.update.ai.inPlace")]})]}),n!=="ai"&&o.jsxs("div",{className:"grid gap-4 sm:grid-cols-[1fr_auto] sm:items-end",children:[o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"artifact-title",children:f("artifacts.create.title.label")}),o.jsx("input",{id:"artifact-title",type:"text",value:x,onChange:p=>m(p.target.value),placeholder:i||n==="markdown"?"":Y(c).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"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"artifact-ttl",children:f("artifacts.create.ttl")}),o.jsx("div",{className:"flex items-center gap-2",children:[7,30].map(p=>o.jsxs("button",{type:"button",onClick:()=>_(p),className:`rounded-md border px-3 py-2 text-sm transition-colors ${N===p?"border-accent bg-accent/10 font-medium text-text-primary":"border-border text-text-secondary hover:border-accent/50"}`,children:[p,"d"]},p))})]})]}),n!=="ai"&&o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"artifact-content",children:f("artifacts.create.content")}),n==="markdown"?o.jsxs(o.Fragment,{children:[o.jsx("textarea",{id:"artifact-content",value:b,onChange:p=>R(p.target.value),placeholder:f("artifacts.create.markdownPlaceholder").split(`
439
- `).join("&#10;"),rows:12,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"}),o.jsx("p",{className:"mt-1 text-xs text-text-muted",children:f("artifacts.create.markdownHint")})]}):o.jsxs(o.Fragment,{children:[o.jsx("textarea",{id:"artifact-content",value:d,onChange:p=>y(p.target.value),placeholder:i?"":Y(c).html.slice(0,120)+"…",rows:12,spellCheck:!1,disabled:P,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"}),o.jsxs("div",{className:"mt-1 flex items-center justify-between text-xs text-text-muted",children:[o.jsx("span",{children:d.trim()?it(new Blob([d]).size):f("artifacts.create.contentRequired")}),o.jsx("span",{children:f("artifacts.create.ttlResetNote")})]})]})]}),!i&&n!=="ai"&&!a&&o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"artifact-bind-session",children:f("artifacts.create.bindSession")}),U===null?o.jsx("p",{className:"text-xs text-text-muted",children:f("common.loading")}):o.jsxs("select",{id:"artifact-bind-session",value:$,onChange:p=>Q(p.target.value),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",children:[o.jsx("option",{value:"",children:f("artifacts.create.noSession")}),be.map(p=>o.jsx("option",{value:p.id,children:p.title||p.id.slice(0,14)},p.id))]}),o.jsx("p",{className:"mt-1 text-xs text-text-muted",children:f("artifacts.create.sessionHint")})]}),Be.trim()&&n!=="ai"&&o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-xs font-medium text-text-muted",children:f("artifacts.create.preview")}),o.jsx("iframe",{srcDoc:Be,title:"preview",className:"h-56 w-full rounded-md border border-border bg-white",sandbox:"allow-scripts allow-popups allow-forms"})]}),Z&&o.jsx("p",{className:"text-sm text-status-error",children:f("artifacts.viewNotFound")}),H&&o.jsx("p",{className:"text-sm text-status-error",children:H})]}),o.jsxs(_t,{children:[o.jsx("button",{type:"button",onClick:e,className:"rounded-md border border-border px-4 py-2 text-sm text-text-secondary hover:bg-surface-2",children:f("common.cancel")}),n==="ai"?o.jsx("button",{type:"button",onClick:dt,disabled:De||!!ge||!B||Z,className:"rounded-md bg-accent px-4 py-2 text-sm font-medium text-white hover:bg-accent/90 disabled:opacity-50",children:De?f("artifacts.create.ai.sending"):f("artifacts.create.ai.send")}):o.jsx("button",{type:"button",onClick:ct,disabled:!ot,className:"rounded-md bg-accent px-4 py-2 text-sm font-medium text-white hover:bg-accent/90 disabled:opacity-50",children:C?f("common.creating"):i?f("artifacts.update"):f("artifacts.create.submit")})]})]})})}const es=Object.freeze(Object.defineProperty({__proto__:null,ArtifactsGallery:Zr,CreateArtifactDialog:Re},Symbol.toStringTag,{value:"Module"}));export{Zr as A,Re as C,Pt as E,Ft as S,es as a};
438
+ `)}function Fr(t){return{type:"user",uuid:ut(),content:t,message:{content:t},artifact_dispatch:!0}}function it(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function Or(t){if(!t)return"—";try{return new Date(t).toLocaleString()}catch{return t}}function Kr(t){if(!t)return null;const e=new Date(t).getTime();return Number.isNaN(e)?null:Math.ceil((e-Date.now())/(1440*60*1e3))}function Zr({sessionId:t,embedded:e=!1,refreshTick:r}){Qe();const[a,s]=k.useState([]),[l,i]=k.useState(!0),[n,h]=k.useState(""),[c,u]=k.useState(!1),[x,m]=k.useState(null),[d,y]=k.useState("template"),[b,T]=k.useState(null),{activeTeam:N,isAllTeams:_}=ft(),C=k.useCallback(async()=>{try{const g=await mt(t?{session_id:t}:_?void 0:N?{team_id:N.id}:e?void 0:{scope:"personal"});s(g||[]),h("")}catch(g){h(g instanceof Error?g.message:f("artifacts.loadFailed"))}finally{i(!1)}},[t,N,_,e]);k.useEffect(()=>{C();const g=setInterval(C,15e3);return window.addEventListener("focus",C),()=>{clearInterval(g),window.removeEventListener("focus",C)}},[C]);const M=k.useRef(!1);k.useEffect(()=>{if(!M.current){M.current=!0;return}C()},[r,C]);const H=k.useCallback(g=>{u(!1),m(null),y("template"),s($=>[g,...$.filter(Q=>Q.id!==g.id)])},[]),E=k.useCallback((g,$="template")=>{m(g),y($),u(!0)},[]),P=k.useCallback(()=>{u(!1),m(null),y("template")},[]),A=k.useCallback(async g=>{if(window.confirm(f("artifacts.delete")+" — "+g.slice(0,8)+"…?"))try{await xt(g),s($=>$.filter(Q=>Q.id!==g))}catch($){alert($ instanceof Error?$.message:f("artifacts.deleteFailed"))}},[]),Z=k.useCallback(async g=>{await gt(`${window.location.origin}${g.url}`)&&(T(g.id),setTimeout(()=>T(null),1500))},[]),G=k.useMemo(()=>a,[a]),U=o.jsxs(o.Fragment,{children:[n&&o.jsx("p",{className:"text-status-error text-sm",children:n}),l?o.jsx("div",{className:"space-y-3",children:[0,1,2].map(g=>o.jsx("div",{className:"h-20 animate-pulse rounded-lg bg-surface-2"},g))}):G.length===0?o.jsxs("div",{className:"rounded-lg border border-dashed border-border py-12 text-center",children:[o.jsx(bt,{className:"mx-auto h-8 w-8 text-text-muted/40"}),o.jsx("p",{className:"mt-3 text-sm text-text-muted",children:f("artifacts.empty")})]}):o.jsx("ul",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-3",children:G.map(g=>{const $=Kr(g.expires_at);return o.jsxs("li",{className:"group rounded-lg border border-border bg-surface-1 p-4 transition-colors hover:border-brand/50",children:[o.jsxs("div",{className:"flex items-start justify-between gap-2",children:[o.jsxs("a",{href:`/code/a/${g.id}`,className:"min-w-0 flex-1 no-underline",children:[o.jsx("h3",{className:"truncate font-medium text-text-primary group-hover:text-accent",children:g.title||g.id.slice(0,12)}),o.jsxs("p",{className:"mt-1 font-mono text-xs text-text-muted",children:[g.id.slice(0,10),"… · v",g.version," · ",it(g.size)]})]}),o.jsx("span",{className:`flex-shrink-0 rounded-full px-2 py-0.5 text-[10px] font-medium ${$!==null&&$<=0?"bg-status-error/15 text-status-error":$!==null&&$<=2?"bg-status-warning/15 text-status-warning":"bg-surface-3 text-text-muted"}`,children:$===null?"∞":`${$}d`})]}),o.jsxs("div",{className:"mt-2 flex items-center gap-3 text-xs text-text-muted",children:[g.session_id&&o.jsxs("a",{href:`/code/${g.session_id}`,className:"truncate text-text-muted hover:text-accent",title:g.session_id,children:[f("artifacts.session"),": ",g.session_id.slice(0,14),"…"]}),o.jsxs("span",{className:"flex items-center gap-1",title:f("artifacts.updatedAt"),children:[o.jsx(kt,{className:"h-3 w-3"}),Or(g.updated_at)]})]}),o.jsxs("div",{className:"mt-3 flex items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100",children:[o.jsx("a",{href:g.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:f("artifacts.openInNewTab"),children:o.jsx(Pt,{className:"h-3.5 w-3.5"})}),o.jsxs("button",{type:"button",onClick:()=>Z(g),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:`${f("artifacts.copyLink")} · ${f("artifacts.linkNotice")}`,children:[o.jsx(Dt,{className:"h-3.5 w-3.5"}),b===g.id&&o.jsx("span",{className:"text-status-active",children:f("artifacts.copied")})]}),o.jsx("button",{type:"button",onClick:()=>E(g,"ai"),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:f("artifacts.aiUpdate"),children:o.jsx(Ft,{className:"h-3.5 w-3.5"})}),g.can_manage&&o.jsx("button",{type:"button",onClick:()=>E(g),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:f("artifacts.edit"),children:o.jsx(yt,{className:"h-3.5 w-3.5"})}),o.jsx("button",{type:"button",onClick:()=>A(g.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:f("artifacts.delete"),children:o.jsx(wt,{className:"h-3.5 w-3.5"})})]})]},g.id)})})]});return e?o.jsxs("div",{children:[o.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[o.jsx("h2",{className:"text-sm font-medium text-text-primary",children:f("artifacts.title")}),o.jsxs("button",{type:"button",onClick:()=>{m(null),u(!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:[o.jsx(vt,{className:"h-4 w-4"}),f("artifacts.new")]})]}),U,o.jsx(Te,{open:c,onClose:P,onCreated:H,sessionId:t,editArtifact:x,initialMode:d})]}):o.jsxs("div",{className:"ds-page",children:[o.jsxs("header",{className:"ds-page-head",children:[o.jsxs("div",{className:"ds-page-titlerow",children:[o.jsx("h1",{className:"ds-page-title font-display font-semibold tracking-tight text-text-primary",children:f("artifacts.title")}),o.jsx("button",{type:"button",onClick:()=>{m(null),u(!0)},className:"btn-ticket",children:f("artifacts.new")})]}),o.jsx("p",{className:"ds-page-sub",children:f("artifacts.subtitle")})]}),U,o.jsx(Te,{open:c,onClose:P,onCreated:H,sessionId:t,editArtifact:x,initialMode:d})]})}const Gr=[{id:"template",labelKey:"artifacts.create.mode.template"},{id:"markdown",labelKey:"artifacts.create.mode.markdown"},{id:"ai",labelKey:"artifacts.create.mode.ai"}],Ur=[{id:"template",labelKey:"artifacts.edit.mode.html"},{id:"ai",labelKey:"artifacts.edit.mode.ai"}];function Te({open:t,onClose:e,onCreated:r,sessionId:a,editArtifact:s,initialMode:l="template"}){Qe();const i=!!s,[n,h]=k.useState("template"),[c,u]=k.useState("pr-review"),[x,m]=k.useState(""),[d,y]=k.useState(""),[b,T]=k.useState(""),[N,_]=k.useState(30),[C,M]=k.useState(!1),[H,E]=k.useState(""),[P,A]=k.useState(!1),[Z,G]=k.useState(!1),[U,g]=k.useState(null),[$,Q]=k.useState(""),[B,fe]=k.useState(""),[me,_e]=k.useState(""),[De,xe]=k.useState(!1),[ge,Me]=k.useState(null),[V,ae]=k.useState(null),[ne,ie]=k.useState(""),[q,Pe]=k.useState(!1);k.useEffect(()=>{t&&(h(i&&l==="ai"?"ai":"template"),u("pr-review"),_(30),M(!1),E(""),G(!1),T(""),Q(""),fe(a??(s==null?void 0:s.session_id)??""),_e(""),xe(!1),Me(null),ae(null),ie(""),Pe(!1),s?(A(!0),m(s.title??""),y(""),St(s.id).then(p=>{m(p.title??""),y(p.content??""),p.can_manage===!1&&G(!0)}).catch(()=>G(!0)).finally(()=>A(!1))):(A(!1),m(""),y(Y("pr-review").html)),a||(g(null),Tt().then(p=>{const I=p.filter(R=>!Rt(R.status));g(I),fe(R=>R&&!I.some(X=>X.id===R)?"":R)}).catch(()=>g([]))))},[t,s,a,i,l]),k.useEffect(()=>{if(!t||n!=="ai"||!B){ae(null),ie("");return}let p=!1;return $t(B).then(I=>{var R;p||(ae(I.models),ie(((R=I.models)==null?void 0:R.currentModelId)??""))}).catch(()=>{p||ae(null)}),()=>{p=!0}},[t,n,B]);const lt=p=>{u(p);const I=Y(p);y(I.html),x.trim()||m(I.defaultTitle)},[Be,qe]=k.useState("");k.useEffect(()=>{const p=setTimeout(()=>{qe(n==="markdown"?b.trim()?Ue(b).html:"":d)},300);return()=>clearTimeout(p)},[n,d,b]);const ot=n!=="ai"&&(n==="markdown"?b:d).trim().length>0&&!C&&!P&&!Z,ct=async()=>{let p,I;if(n==="markdown"){const R=Ue(b);p=R.html,I=R.title}else p=d.trim(),I=Y(c).defaultTitle;if(p){M(!0),E("");try{const R={html:p,ttl:N,title:x.trim()||(i?void 0:I)};i?s&&(R.hash=s.id):R.session_id=a??($||void 0);const X=await Nt(R);r(X)}catch(R){const X=R instanceof Error?R.message:"";R instanceof Ct&&R.status===404?E(f("artifacts.viewNotFound")):E(X||f(i?"artifacts.updateFailed":"artifacts.create.failed"))}finally{M(!1)}}},dt=async()=>{if(!Z){if(!B){E(f("artifacts.create.ai.sessionRequired"));return}if(!me.trim()){E(f(i?"artifacts.update.ai.briefRequired":"artifacts.create.ai.briefRequired"));return}xe(!0),E("");try{V&&ne&&ne!==V.currentModelId&&await jt(B,{type:"control_request",request:{subtype:"set_model",model:ne}});const p=Hr(me,i&&s?{id:s.id,url:`${window.location.origin}${s.url}`,version:s.version}:void 0,{archify:q});await Et(B,Fr(p)),Me(B)}catch(p){E(p instanceof Error?p.message:f(i?"artifacts.updateFailed":"artifacts.create.failed"))}finally{xe(!1)}}},be=U??[];return o.jsx(It,{open:t,onOpenChange:p=>p?void 0:e(),children:o.jsxs(At,{className:"max-h-[85vh] overflow-y-auto sm:max-w-4xl",children:[o.jsx(Lt,{children:o.jsx(zt,{children:i?f("artifacts.editArtifact"):f("artifacts.create.title")})}),o.jsxs("div",{className:"space-y-4",children:[o.jsx("div",{className:"flex items-center gap-1 rounded-lg bg-surface-2 p-1",children:(i?Ur:Gr).map(p=>o.jsx("button",{type:"button",onClick:()=>{h(p.id),E("")},className:`flex-1 rounded-md px-3 py-1.5 text-sm transition-colors ${n===p.id?"bg-surface-1 font-medium text-text-primary shadow-sm":"text-text-secondary hover:text-text-primary"}`,children:f(p.labelKey)},p.id))}),n==="ai"&&(ge?o.jsxs("div",{className:"rounded-lg border border-border bg-surface-1 p-4 text-center",children:[o.jsx("p",{className:"text-sm text-text-primary",children:f(i?"artifacts.update.ai.sent":"artifacts.create.ai.sent")}),o.jsx("a",{href:`/code/${ge}`,className:"mt-3 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:f("artifacts.create.ai.openSession")})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"artifact-ai-session",children:f("artifacts.create.ai.targetSession")}),a?o.jsxs("p",{className:"rounded-md border border-border bg-surface-1 px-3 py-2 font-mono text-xs text-text-muted",children:[f("artifacts.session"),": ",a.slice(0,18),"…"]}):U===null?o.jsx("p",{className:"text-xs text-text-muted",children:f("common.loading")}):be.length===0?o.jsx("p",{className:"text-sm text-text-muted",children:f("artifacts.create.ai.noSessions")}):o.jsxs("select",{id:"artifact-ai-session",value:B,onChange:p=>fe(p.target.value),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",children:[o.jsx("option",{value:"",children:f("artifacts.create.ai.sessionRequired")}),be.map(p=>o.jsx("option",{value:p.id,children:(p.title||p.id.slice(0,14))+(p.status==="running"?" · ⚡":"")},p.id))]}),i&&o.jsx("p",{className:"mt-1 text-xs text-text-muted",children:f("artifacts.update.ai.sessionHint")})]}),V&&V.availableModels.length>0&&o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"artifact-ai-model",children:f("artifacts.create.ai.model")}),o.jsx("select",{id:"artifact-ai-model",value:ne,onChange:p=>ie(p.target.value),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",children:V.availableModels.map(p=>o.jsx("option",{value:p.modelId,children:p.name+(p.modelId===V.currentModelId?` · ${f("artifacts.create.ai.modelCurrent")}`:"")},p.modelId))}),o.jsx("p",{className:"mt-1 text-xs text-text-muted",children:f("artifacts.create.ai.modelHint")})]}),o.jsxs("button",{type:"button",role:"switch","aria-checked":q,onClick:()=>Pe(p=>!p),className:`flex w-full items-start gap-3 rounded-lg border p-3 text-left transition-colors ${q?"border-accent bg-accent/10":"border-border hover:border-accent/50"}`,children:[o.jsx(qt,{className:`mt-0.5 h-4 w-4 flex-shrink-0 transition-colors ${q?"text-accent":"text-text-muted"}`}),o.jsxs("span",{className:"min-w-0 flex-1",children:[o.jsx("span",{className:`block text-sm font-medium transition-colors ${q?"text-text-primary":"text-text-secondary"}`,children:f("artifacts.ai.archify")}),o.jsx("span",{className:"mt-0.5 block text-xs text-text-muted",children:f("artifacts.ai.archifyDesc")})]}),o.jsx("span",{"aria-hidden":"true",className:`relative mt-0.5 h-5 w-9 flex-shrink-0 rounded-full transition-colors ${q?"bg-accent":"bg-surface-3"}`,children:o.jsx("span",{className:`absolute top-0.5 h-4 w-4 rounded-full bg-surface-1 shadow-sm transition-all ${q?"left-[18px]":"left-0.5"}`})})]}),q&&o.jsx("p",{className:"text-xs text-text-muted",children:f("artifacts.ai.archifyHint")}),o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"artifact-ai-brief",children:f("artifacts.create.ai.brief")}),o.jsx("textarea",{id:"artifact-ai-brief",value:me,onChange:p=>_e(p.target.value),placeholder:f(q?"artifacts.ai.archifyBriefPlaceholder":i?"artifacts.update.ai.briefPlaceholder":"artifacts.create.ai.briefPlaceholder"),rows:6,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"})]})]})),n==="template"&&!i&&o.jsxs("div",{children:[o.jsx("label",{className:"mb-2 block text-sm font-medium text-text-primary",children:f("artifacts.create.template")}),o.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3",children:ye.map(p=>o.jsxs("button",{type:"button",onClick:()=>lt(p.id),className:`rounded-lg border p-3 text-left transition-colors ${c===p.id?"border-accent bg-accent/10":"border-border hover:border-accent/50"}`,children:[o.jsx("div",{className:"text-sm font-medium text-text-primary",children:f(p.titleKey)}),p.descKey&&o.jsx("div",{className:"mt-1 text-xs text-text-muted",children:f(p.descKey)})]},p.id))})]}),i&&s&&o.jsxs("p",{className:"text-xs text-text-muted",children:[o.jsxs("span",{className:"font-mono",children:[s.id.slice(0,10),"…"]})," · v",s.version,n==="ai"&&o.jsxs(o.Fragment,{children:[" · ",f("artifacts.update.ai.inPlace")]})]}),n!=="ai"&&o.jsxs("div",{className:"grid gap-4 sm:grid-cols-[1fr_auto] sm:items-end",children:[o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"artifact-title",children:f("artifacts.create.title.label")}),o.jsx("input",{id:"artifact-title",type:"text",value:x,onChange:p=>m(p.target.value),placeholder:i||n==="markdown"?"":Y(c).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"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"artifact-ttl",children:f("artifacts.create.ttl")}),o.jsx("div",{className:"flex items-center gap-2",children:[7,30].map(p=>o.jsxs("button",{type:"button",onClick:()=>_(p),className:`rounded-md border px-3 py-2 text-sm transition-colors ${N===p?"border-accent bg-accent/10 font-medium text-text-primary":"border-border text-text-secondary hover:border-accent/50"}`,children:[p,"d"]},p))})]})]}),n!=="ai"&&o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"artifact-content",children:f("artifacts.create.content")}),n==="markdown"?o.jsxs(o.Fragment,{children:[o.jsx("textarea",{id:"artifact-content",value:b,onChange:p=>T(p.target.value),placeholder:f("artifacts.create.markdownPlaceholder").split(`
439
+ `).join("&#10;"),rows:12,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"}),o.jsx("p",{className:"mt-1 text-xs text-text-muted",children:f("artifacts.create.markdownHint")})]}):o.jsxs(o.Fragment,{children:[o.jsx("textarea",{id:"artifact-content",value:d,onChange:p=>y(p.target.value),placeholder:i?"":Y(c).html.slice(0,120)+"…",rows:12,spellCheck:!1,disabled:P,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"}),o.jsxs("div",{className:"mt-1 flex items-center justify-between text-xs text-text-muted",children:[o.jsx("span",{children:d.trim()?it(new Blob([d]).size):f("artifacts.create.contentRequired")}),o.jsx("span",{children:f("artifacts.create.ttlResetNote")})]})]})]}),!i&&n!=="ai"&&!a&&o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"artifact-bind-session",children:f("artifacts.create.bindSession")}),U===null?o.jsx("p",{className:"text-xs text-text-muted",children:f("common.loading")}):o.jsxs("select",{id:"artifact-bind-session",value:$,onChange:p=>Q(p.target.value),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",children:[o.jsx("option",{value:"",children:f("artifacts.create.noSession")}),be.map(p=>o.jsx("option",{value:p.id,children:p.title||p.id.slice(0,14)},p.id))]}),o.jsx("p",{className:"mt-1 text-xs text-text-muted",children:f("artifacts.create.sessionHint")})]}),Be.trim()&&n!=="ai"&&o.jsxs("div",{children:[o.jsx("label",{className:"mb-1 block text-xs font-medium text-text-muted",children:f("artifacts.create.preview")}),o.jsx("iframe",{srcDoc:Be,title:"preview",className:"h-56 w-full rounded-md border border-border bg-white",sandbox:"allow-scripts allow-popups allow-forms"})]}),Z&&o.jsx("p",{className:"text-sm text-status-error",children:f("artifacts.viewNotFound")}),H&&o.jsx("p",{className:"text-sm text-status-error",children:H})]}),o.jsxs(_t,{children:[o.jsx("button",{type:"button",onClick:e,className:"rounded-md border border-border px-4 py-2 text-sm text-text-secondary hover:bg-surface-2",children:f("common.cancel")}),n==="ai"?o.jsx("button",{type:"button",onClick:dt,disabled:De||!!ge||!B||Z,className:"rounded-md bg-accent px-4 py-2 text-sm font-medium text-white hover:bg-accent/90 disabled:opacity-50",children:De?f("artifacts.create.ai.sending"):f("artifacts.create.ai.send")}):o.jsx("button",{type:"button",onClick:ct,disabled:!ot,className:"rounded-md bg-accent px-4 py-2 text-sm font-medium text-white hover:bg-accent/90 disabled:opacity-50",children:C?f("common.creating"):i?f("artifacts.update"):f("artifacts.create.submit")})]})]})})}const es=Object.freeze(Object.defineProperty({__proto__:null,ArtifactsGallery:Zr,CreateArtifactDialog:Te},Symbol.toStringTag,{value:"Module"}));export{Zr as A,Te as C,Pt as E,Ft as S,es as a};
@@ -1 +1 @@
1
- import{e as r,j as e}from"./vendor-DE_-CLIE.js";import{Y as u,a6 as f}from"./main-RGMHltl_.js";import"./preload-helper-BiaRt2Oj.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{Y as u,a7 as f}from"./main-C_AYd9qE.js";import"./preload-helper-BiaRt2Oj.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,6 +1,6 @@
1
- import{j as e,e as r}from"./vendor-DE_-CLIE.js";import{aE as V,aC as E,a$ as I,aZ as O,aS as t,U as Z,aI as q,a_ as B,I as K,f as P,e as $,a0 as X,au as G,a6 as J,a9 as Y,a5 as ee,S as U,X as se,aT as ae}from"./main-RGMHltl_.js";import{R as H,E as te}from"./RegisterEmpty-C2jnr90K.js";import{g as L}from"./workerType-CHkBOZGL.js";import{S as ne}from"./SessionVisibilityBadge-DSkyQ1D4.js";import{D as re,a as le,d as ce}from"./dialog-DPpsff0A.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";/**
1
+ import{j as e,e as r}from"./vendor-DE_-CLIE.js";import{aF as V,aD as E,b0 as I,a_ as O,aT as t,U as J,aJ as q,a$ as B,I as K,f as P,e as U,a1 as X,av as Z,a7 as G,aa as Y,a6 as ee,S as $,X as se,aU as ae}from"./main-C_AYd9qE.js";import{R as H,E as te}from"./RegisterEmpty-DLSXAy3q.js";import{g as L}from"./workerType-BmACfqHE.js";import{S as ne}from"./SessionVisibilityBadge-Vq4ktEDy.js";import{D as re,a as le,d as ce}from"./dialog-CBJUxHMG.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:"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"}]],ie=V("folder",de);function oe({teamName:c,className:x}){return c?e.jsx("span",{className:E("inline-flex items-center rounded-full border border-border/60 bg-surface-2 px-2 py-0.5 text-xs text-text-muted",x),children:c}):null}function me({environments:c,onSelectEnvironment:x}){const{activeTeam:y,isAllTeams:v}=I(),{user:i}=O(),o=r.useMemo(()=>(i==null?void 0:i.role)==="admin"||v?c:y?c.filter(l=>l.team_id===y.id):c.filter(l=>!l.team_id),[c,y,v,i]);return!o||o.length===0?e.jsx(H,{title:t("dashboard.emptyEnvironmentsTitle"),hint:t("dashboard.emptyEnvironmentsHint")}):e.jsx("div",{className:"ds-reg",children:o.map(l=>{var w,N,g;const p=l.worker_type==="acp",b=L(l.worker_type),m=((w=l.directory)==null?void 0:w.trim())||null,f=((N=l.ip_address)==null?void 0:N.trim())||null,j=((g=l.owner_username)==null?void 0:g.trim())||null;return e.jsxs("div",{className:E("ds-reg-row group",p&&"opacity-80"),children:[e.jsxs("button",{type:"button",onClick:()=>x==null?void 0:x(l),disabled:p,className:E("ds-reg-main",p?"cursor-default":"cursor-pointer"),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:l.machine_name||l.id}),e.jsx("span",{className:E("ds-reg-tag rounded-full",b.colorClass),children:b.fullLabel}),e.jsx(te,{status:l.status,className:"ds-reg-tag"}),e.jsx(oe,{teamName:l.team_name??null,className:"ds-reg-tag"})]}),(m||f||j)&&e.jsxs("span",{className:"ds-reg-meta flex min-w-0 items-center gap-1.5 text-xs text-text-muted",children:[m&&e.jsx("span",{className:"min-w-0 truncate font-mono",children:m}),m&&f&&e.jsx("span",{className:"ds-reg-fact-sep","aria-hidden":"true",children:"·"}),f&&e.jsx("span",{className:"shrink-0 whitespace-nowrap font-mono tabular-nums",children:f}),(m||f)&&j&&e.jsx("span",{className:"ds-reg-fact-sep","aria-hidden":"true",children:"·"}),j&&e.jsxs("span",{className:"ds-reg-owner",title:`${t("dashboard.envOwner")}: ${j}`,children:[e.jsx(Z,{className:"h-3 w-3","aria-hidden":"true"}),e.jsx("span",{className:"min-w-0 truncate",children:j})]})]})]}),e.jsx("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(l.created_at)})})]},l.id)})})}function he({sessions:c,environments:x,onSelect:y,onDelete:v}){B();const{activeTeam:i,isAllTeams:o,myTeams:l}=I(),{user:p}=O(),b=r.useMemo(()=>{const s=new Map;for(const h of l)s.set(h.id,h.name);return s},[l]),m=r.useMemo(()=>(p==null?void 0:p.role)==="admin"||o?c:i?c.filter(s=>s.owner_type==="team"&&s.owner_id===i.id):c.filter(s=>s.owner_type==="user"||s.access_level==="write"||s.access_level==="read"),[c,i,o,p]),{mySessions:f,sharedSessions:j}=r.useMemo(()=>{const s=[],h=[];for(const u of m)i||o?s.push(u):u.access_level==="write"||u.access_level==="read"?h.push(u):s.push(u);return{mySessions:s,sharedSessions:h}},[m,i,o]),w=new Map;for(const s of x??[])s!=null&&s.id&&s.worker_type&&w.set(s.id,s.worker_type);const N=(s,h)=>(h.updated_at||0)-(s.updated_at||0);function g(s){var T;const h=!!v&&s.access_level!=="write"&&s.access_level!=="read";let u=s.source==="acp"?"acp":(T=s.environment)==null?void 0:T.worker_type;!u&&s.environment_id&&(u=w.get(s.environment_id));const d=L(u);return e.jsxs("div",{className:"ds-reg-row group",children:[e.jsxs("button",{type:"button",onClick:()=>y(s.id),className:"ds-reg-main cursor-pointer",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.title||s.id}),s.visibility&&e.jsx(ne,{visibility:s.visibility||"private",className:"ds-reg-tag"}),e.jsx("span",{className:E("ds-reg-tag rounded-full",d.colorClass),children:d.fullLabel})]}),e.jsxs("span",{className:"ds-reg-meta flex items-center gap-2 truncate text-xs text-text-muted",children:[e.jsx("span",{className:"truncate font-mono",children:s.id}),s.owner_type==="team"&&s.owner_id&&e.jsxs("span",{className:"inline-flex items-center gap-2 truncate",children:[e.jsx("span",{className:"text-text-muted/40",children:"|"}),e.jsx("span",{className:"truncate",children:b.get(s.owner_id)||s.owner_id})]})]})]}),e.jsxs("div",{className:"ds-reg-aside",children:[e.jsx(K,{status:s.status}),e.jsx("span",{className:"whitespace-nowrap font-mono text-xs tabular-nums text-text-muted",children:q(s.created_at||s.updated_at)}),h&&e.jsx("button",{type:"button",onClick:M=>{M.stopPropagation(),v(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:"Delete session",children:e.jsx("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]},s.id)}if(m.length===0)return e.jsx(H,{title:t("dashboard.emptySessionsTitle"),hint:t("dashboard.emptySessionsHint")});const k=[...f].sort(N),C=[...j].sort(N);return e.jsxs("div",{className:"space-y-4",children:[k.length>0&&e.jsx("section",{className:"space-y-2",children:e.jsx("div",{className:"ds-reg",children:k.map(g)})}),C.length>0&&e.jsxs("section",{className:"space-y-2",children:[k.length>0&&e.jsx("h3",{className:"text-xs font-medium uppercase tracking-wide text-text-muted",children:t("session.sharedWithMe")}),e.jsx("div",{className:"ds-reg",children:C.map(g)})]})]})}function ue({open:c,environments:x,onClose:y,onCreated:v}){B();const{activeTeam:i,isAllTeams:o}=I(),{user:l}=O(),[p,b]=r.useState(""),[m,f]=r.useState(""),[j,w]=r.useState("same-dir"),[N,g]=r.useState(""),[k,C]=r.useState(!1),[s,h]=r.useState(!1),u=r.useMemo(()=>(l==null?void 0:l.role)==="admin"||o?x:i?x.filter(a=>a.team_id===i.id):x.filter(a=>!a.team_id),[x,i,o,l]);r.useEffect(()=>{c&&(b(""),f(""),w("same-dir"),g(""),h(!1))},[c]);const d=u.find(a=>a.id===m)||null,T=d?u.findIndex(a=>a.id===d.id)+1:null,M=async()=>{C(!0),g("");try{const a={};p.trim()&&(a.title=p.trim()),m&&(a.environment_id=m),a.spawn_mode=j;const D=(i==null?void 0:i.id)??(o?d==null?void 0:d.team_id:void 0);D&&(a.team_id=D);const S=await X(a);v(S)}catch(a){g(a instanceof Error?a.message:t("dialog.createFailed"))}finally{C(!1)}};return e.jsx(re,{open:c,onOpenChange:a=>{a||y()},children:e.jsx(le,{className:"nsd-shell max-w-md",children:e.jsxs("div",{className:"nsd-box",children:[e.jsx(ce,{className:"nsd-h",children:t("dialog.newSession")}),e.jsxs("div",{className:"nsd-field nsd-field--env",children:[e.jsx("span",{className:"nsd-lab",children:t("dialog.environment")}),e.jsxs("button",{type:"button",className:"nsd-envtrigger","aria-expanded":s,onClick:()=>h(a=>!a),children:[e.jsx("span",{className:"nsd-env-read",children:d?e.jsxs(e.Fragment,{children:[T!==null&&e.jsxs("span",{className:"nsd-env-idx",children:["#",T]}),e.jsx("span",{className:"nsd-env-name",children:d.machine_name||d.id}),e.jsx("span",{className:E("nsd-env-type",L(d.worker_type).colorClass),children:L(d.worker_type).shortLabel})]}):e.jsx("span",{className:"nsd-env-none",children:t("dialog.envSelectEnv")})}),e.jsx(P,{className:"nsd-env-caret"})]}),(d==null?void 0:d.directory)&&e.jsx("span",{className:"nsd-env-path",children:d.directory}),s&&e.jsxs("div",{className:"nsd-envpanel",children:[e.jsx("button",{type:"button",onClick:()=>{f(""),h(!1)},className:"nsd-envrow",children:e.jsxs("span",{className:"nsd-envrow-head",children:[e.jsx("span",{className:"nsd-envrow-name",children:t("dialog.none")}),!m&&e.jsx($,{className:"ml-auto h-3.5 w-3.5 shrink-0 text-brand-text"})]})}),u.length===0?e.jsx("p",{className:"nsd-envempty",children:t("dialog.envEmpty")}):u.map((a,D)=>{const S=L(a.worker_type),R=!!a.team_id,A=a.id===m;return e.jsxs("button",{type:"button","data-selected":A?"on":void 0,onClick:()=>{f(a.id),h(!1)},className:"nsd-envrow",children:[e.jsxs("span",{className:"nsd-envrow-head",children:[e.jsxs("span",{className:"nsd-envrow-idx",children:["#",D+1]}),e.jsx("span",{className:"nsd-envrow-name",children:a.machine_name||a.id}),e.jsx("span",{className:E("nsd-envrow-type",S.colorClass),children:S.shortLabel}),e.jsx("span",{className:E("nsd-envrow-team",R?"border-border/60 bg-surface-2 text-text-muted":"border-brand/30 bg-brand/10 text-brand-text"),children:R?`${t("dialog.envTeam")}: ${a.team_name||a.team_id}`:t("dialog.envPersonal")}),A&&e.jsx($,{className:"ml-auto h-3.5 w-3.5 shrink-0 text-brand-text"})]}),a.directory&&e.jsxs("span",{className:"nsd-envrow-dir",children:[e.jsx(ie,{className:"h-3 w-3 shrink-0"}),e.jsx("span",{className:"nsd-envrow-path",children:a.directory}),a.branch&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-text-muted/40",children:"·"}),e.jsx("span",{className:"nsd-envrow-path",children:a.branch})]})]})]},a.id)})]})]}),e.jsxs("label",{className:"nsd-field",children:[e.jsx("span",{className:"nsd-lab",children:t("dialog.titleOptional")}),e.jsx("input",{type:"text",value:p,onChange:a=>b(a.target.value),placeholder:t("dialog.titlePlaceholder"),className:"nsd-title"})]}),e.jsxs("label",{className:"nsd-field",children:[e.jsx("span",{className:"nsd-lab",children:t("dialog.workspaceMode")}),e.jsxs("span",{className:"nsd-modesel",children:[e.jsxs("select",{value:j,onChange:a=>w(a.target.value),className:"nsd-mode",children:[e.jsx("option",{value:"same-dir",children:t("dialog.sameDir")}),e.jsx("option",{value:"worktree",children:t("dialog.worktree")})]}),e.jsx(P,{className:"nsd-mode-caret"})]})]}),N&&e.jsx("p",{className:"nsd-error",children:N}),e.jsxs("div",{className:"nsd-foot",children:[e.jsx("button",{type:"button",onClick:y,className:"nsd-cancel",children:t("common.cancel")}),e.jsx("button",{type:"button",onClick:M,disabled:k,className:"btn-ticket nsd-create",children:k?t("common.creating"):t("common.create")})]})]})})})}function ye({onNavigateSession:c}){const x=B(),y=r.useMemo(()=>new Date().toLocaleDateString(x==="zh"?"zh-CN":"en-US",{year:"numeric",month:"long",day:"numeric",weekday:"short"}),[x]),[v,i]=r.useState([]),[o,l]=r.useState([]),[p,b]=r.useState(!1),[m,f]=r.useState(!1),[j,w]=r.useState(""),[N,g]=r.useState(null),[k,C]=r.useState(!1),s=r.useRef(0),[h,u]=r.useState(!1),d=m||h,T=r.useCallback(()=>{f(!1),w(""),u(!0)},[]),M=r.useCallback(()=>{u(!1)},[]),a=r.useRef(null),D=r.useRef(!1);r.useEffect(()=>{var n;D.current&&!d&&((n=a.current)==null||n.focus()),D.current=d},[d]),r.useEffect(()=>{const n=j.trim();if(!n){s.current+=1,g(null),C(!1);return}C(!0);const _=++s.current,F=setTimeout(()=>{G(n).then(Q=>{s.current===_&&g(Q.results??[])}).catch(()=>{s.current===_&&g([])}).finally(()=>{s.current===_&&C(!1)})},300);return()=>clearTimeout(F)},[j]);const S=r.useCallback(async()=>{try{const[n,_]=await Promise.all([J(),Y()]);i(n||[]),l(_||[])}catch(n){console.error("Dashboard render error:",n)}},[]);r.useEffect(()=>{S();const n=setInterval(S,5e3);return window.addEventListener("focus",S),()=>{clearInterval(n),window.removeEventListener("focus",S)}},[S]);const R=n=>{b(!1),c(n.id)},A=r.useCallback(n=>{},[]),W=r.useCallback(n=>{c(n)},[c]),z=r.useCallback(async n=>{if(window.confirm(t("dashboard.confirmDelete").replace("{id}",n)))try{await ee(n),i(_=>_.filter(F=>F.id!==n))}catch(_){alert(_ instanceof Error?_.message:t("dashboard.deleteFailed"))}},[]);return e.jsxs("div",{className:"ds-dash",children:[e.jsxs("header",{className:"ds-dash-bar hero-enter",children:[e.jsx("span",{className:"ds-dash-dateline",children:y}),e.jsxs("div",{className:"ds-dash-titlerow",children:[e.jsx("h1",{className:"ds-dash-title font-display font-semibold tracking-tight text-text-primary",children:t("dashboard.title")}),e.jsxs("div",{className:"ds-dash-counts",children:[e.jsxs("span",{children:[v.length," ",t("dashboard.sessions")]}),e.jsxs("span",{children:[o.length," ",t("dashboard.environments")]})]})]})]}),e.jsxs("section",{className:"ds-dash-row",children:[e.jsx("h2",{className:"font-display text-lg font-semibold text-text-primary",children:t("dashboard.environments")}),e.jsx(me,{environments:o,onSelectEnvironment:A})]}),e.jsxs("section",{className:"ds-dash-row",children:[e.jsxs("div",{className:"ds-dash-rowhead",children:[e.jsxs("div",{className:"ds-dash-rowlabel",children:[e.jsx("h2",{className:"font-display text-lg font-semibold text-text-primary",children:t("dashboard.sessions")}),d?e.jsxs("div",{className:E("ds-dash-search",h&&"ds-dash-search--folding"),onAnimationEnd:M,children:[e.jsx(U,{className:"h-4 w-4 flex-shrink-0 text-text-muted","aria-hidden":"true"}),e.jsx("input",{autoFocus:!0,value:j,onChange:n=>w(n.target.value),onKeyDown:n=>{n.key==="Escape"&&T()},placeholder:t("dashboard.searchPlaceholder"),"aria-label":t("dashboard.searchPlaceholder"),className:"w-full min-w-0 bg-transparent text-sm text-text-primary placeholder:text-text-muted focus:outline-none"}),k&&e.jsx("span",{className:"flex-shrink-0 text-xs text-text-muted",children:t("dashboard.searching")}),e.jsx("button",{type:"button",onClick:T,className:"ds-dash-search-close",title:t("dashboard.closeSearch"),"aria-label":t("dashboard.closeSearch"),children:e.jsx(se,{className:"h-3.5 w-3.5"})})]}):e.jsx("button",{ref:a,type:"button",onClick:()=>f(!0),className:"ds-dash-search-toggle",title:t("dashboard.searchAction"),"aria-label":t("dashboard.searchAction"),children:e.jsx(U,{className:"h-4 w-4"})})]}),e.jsx("button",{type:"button",onClick:()=>b(!0),className:"btn-ticket",children:t("dashboard.newSession")})]}),N!==null?e.jsxs("div",{className:"ds-reg",children:[N.length===0&&!k&&e.jsx("p",{className:"ds-reg-row ds-reg-empty text-sm text-text-muted",children:t("dashboard.searchNoResults")}),N.map(n=>e.jsxs("button",{type:"button",onClick:()=>c(n.session_id),className:"ds-reg-row w-full cursor-pointer",children:[e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block truncate text-sm font-medium text-text-primary",children:n.title||n.session_id}),n.snippet&&e.jsx("span",{className:"mt-1 line-clamp-2 block text-xs leading-relaxed text-text-muted",children:n.snippet})]}),e.jsx("span",{className:"whitespace-nowrap font-mono text-xs text-text-muted",children:n.match_count>0?ae("dashboard.nMatches",{n:n.match_count}):t("dashboard.nameMatch")})]},n.session_id))]}):e.jsx(he,{sessions:v,environments:o,onSelect:W,onDelete:z})]}),e.jsx(ue,{open:p,environments:o,onClose:()=>b(!1),onCreated:R})]})}export{ye as Dashboard};
6
+ */const de=[["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"}]],ie=V("folder",de);function oe({teamName:c,className:x}){return c?e.jsx("span",{className:E("inline-flex items-center rounded-full border border-border/60 bg-surface-2 px-2 py-0.5 text-xs text-text-muted",x),children:c}):null}function me({environments:c,onSelectEnvironment:x}){const{activeTeam:y,isAllTeams:v}=I(),{user:i}=O(),o=r.useMemo(()=>(i==null?void 0:i.role)==="admin"||v?c:y?c.filter(l=>l.team_id===y.id):c.filter(l=>!l.team_id),[c,y,v,i]);return!o||o.length===0?e.jsx(H,{title:t("dashboard.emptyEnvironmentsTitle"),hint:t("dashboard.emptyEnvironmentsHint")}):e.jsx("div",{className:"ds-reg",children:o.map(l=>{var w,N,g;const p=l.worker_type==="acp",b=L(l.worker_type),m=((w=l.directory)==null?void 0:w.trim())||null,f=((N=l.ip_address)==null?void 0:N.trim())||null,j=((g=l.owner_username)==null?void 0:g.trim())||null;return e.jsxs("div",{className:E("ds-reg-row group",p&&"opacity-80"),children:[e.jsxs("button",{type:"button",onClick:()=>x==null?void 0:x(l),disabled:p,className:E("ds-reg-main",p?"cursor-default":"cursor-pointer"),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:l.machine_name||l.id}),e.jsx("span",{className:E("ds-reg-tag rounded-full",b.colorClass),children:b.fullLabel}),e.jsx(te,{status:l.status,className:"ds-reg-tag"}),e.jsx(oe,{teamName:l.team_name??null,className:"ds-reg-tag"})]}),(m||f||j)&&e.jsxs("span",{className:"ds-reg-meta flex min-w-0 items-center gap-1.5 text-xs text-text-muted",children:[m&&e.jsx("span",{className:"min-w-0 truncate font-mono",children:m}),m&&f&&e.jsx("span",{className:"ds-reg-fact-sep","aria-hidden":"true",children:"·"}),f&&e.jsx("span",{className:"shrink-0 whitespace-nowrap font-mono tabular-nums",children:f}),(m||f)&&j&&e.jsx("span",{className:"ds-reg-fact-sep","aria-hidden":"true",children:"·"}),j&&e.jsxs("span",{className:"ds-reg-owner",title:`${t("dashboard.envOwner")}: ${j}`,children:[e.jsx(J,{className:"h-3 w-3","aria-hidden":"true"}),e.jsx("span",{className:"min-w-0 truncate",children:j})]})]})]}),e.jsx("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(l.created_at)})})]},l.id)})})}function he({sessions:c,environments:x,onSelect:y,onDelete:v}){B();const{activeTeam:i,isAllTeams:o,myTeams:l}=I(),{user:p}=O(),b=r.useMemo(()=>{const s=new Map;for(const h of l)s.set(h.id,h.name);return s},[l]),m=r.useMemo(()=>(p==null?void 0:p.role)==="admin"||o?c:i?c.filter(s=>s.owner_type==="team"&&s.owner_id===i.id):c.filter(s=>s.owner_type==="user"||s.access_level==="write"||s.access_level==="read"),[c,i,o,p]),{mySessions:f,sharedSessions:j}=r.useMemo(()=>{const s=[],h=[];for(const u of m)i||o?s.push(u):u.access_level==="write"||u.access_level==="read"?h.push(u):s.push(u);return{mySessions:s,sharedSessions:h}},[m,i,o]),w=new Map;for(const s of x??[])s!=null&&s.id&&s.worker_type&&w.set(s.id,s.worker_type);const N=(s,h)=>(h.updated_at||0)-(s.updated_at||0);function g(s){var T;const h=!!v&&s.access_level!=="write"&&s.access_level!=="read";let u=s.source==="acp"?"acp":(T=s.environment)==null?void 0:T.worker_type;!u&&s.environment_id&&(u=w.get(s.environment_id));const d=L(u);return e.jsxs("div",{className:"ds-reg-row group",children:[e.jsxs("button",{type:"button",onClick:()=>y(s.id),className:"ds-reg-main cursor-pointer",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.title||s.id}),s.visibility&&e.jsx(ne,{visibility:s.visibility||"private",className:"ds-reg-tag"}),e.jsx("span",{className:E("ds-reg-tag rounded-full",d.colorClass),children:d.fullLabel})]}),e.jsxs("span",{className:"ds-reg-meta flex items-center gap-2 truncate text-xs text-text-muted",children:[e.jsx("span",{className:"truncate font-mono",children:s.id}),s.owner_type==="team"&&s.owner_id&&e.jsxs("span",{className:"inline-flex items-center gap-2 truncate",children:[e.jsx("span",{className:"text-text-muted/40",children:"|"}),e.jsx("span",{className:"truncate",children:b.get(s.owner_id)||s.owner_id})]})]})]}),e.jsxs("div",{className:"ds-reg-aside",children:[e.jsx(K,{status:s.status}),e.jsx("span",{className:"whitespace-nowrap font-mono text-xs tabular-nums text-text-muted",children:q(s.created_at||s.updated_at)}),h&&e.jsx("button",{type:"button",onClick:M=>{M.stopPropagation(),v(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:"Delete session",children:e.jsx("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]},s.id)}if(m.length===0)return e.jsx(H,{title:t("dashboard.emptySessionsTitle"),hint:t("dashboard.emptySessionsHint")});const k=[...f].sort(N),C=[...j].sort(N);return e.jsxs("div",{className:"space-y-4",children:[k.length>0&&e.jsx("section",{className:"space-y-2",children:e.jsx("div",{className:"ds-reg",children:k.map(g)})}),C.length>0&&e.jsxs("section",{className:"space-y-2",children:[k.length>0&&e.jsx("h3",{className:"text-xs font-medium uppercase tracking-wide text-text-muted",children:t("session.sharedWithMe")}),e.jsx("div",{className:"ds-reg",children:C.map(g)})]})]})}function ue({open:c,environments:x,onClose:y,onCreated:v}){B();const{activeTeam:i,isAllTeams:o}=I(),{user:l}=O(),[p,b]=r.useState(""),[m,f]=r.useState(""),[j,w]=r.useState("same-dir"),[N,g]=r.useState(""),[k,C]=r.useState(!1),[s,h]=r.useState(!1),u=r.useMemo(()=>(l==null?void 0:l.role)==="admin"||o?x:i?x.filter(a=>a.team_id===i.id):x.filter(a=>!a.team_id),[x,i,o,l]);r.useEffect(()=>{c&&(b(""),f(""),w("same-dir"),g(""),h(!1))},[c]);const d=u.find(a=>a.id===m)||null,T=d?u.findIndex(a=>a.id===d.id)+1:null,M=async()=>{C(!0),g("");try{const a={};p.trim()&&(a.title=p.trim()),m&&(a.environment_id=m),a.spawn_mode=j;const D=(i==null?void 0:i.id)??(o?d==null?void 0:d.team_id:void 0);D&&(a.team_id=D);const S=await X(a);v(S)}catch(a){g(a instanceof Error?a.message:t("dialog.createFailed"))}finally{C(!1)}};return e.jsx(re,{open:c,onOpenChange:a=>{a||y()},children:e.jsx(le,{className:"nsd-shell max-w-md",children:e.jsxs("div",{className:"nsd-box",children:[e.jsx(ce,{className:"nsd-h",children:t("dialog.newSession")}),e.jsxs("div",{className:"nsd-field nsd-field--env",children:[e.jsx("span",{className:"nsd-lab",children:t("dialog.environment")}),e.jsxs("button",{type:"button",className:"nsd-envtrigger","aria-expanded":s,onClick:()=>h(a=>!a),children:[e.jsx("span",{className:"nsd-env-read",children:d?e.jsxs(e.Fragment,{children:[T!==null&&e.jsxs("span",{className:"nsd-env-idx",children:["#",T]}),e.jsx("span",{className:"nsd-env-name",children:d.machine_name||d.id}),e.jsx("span",{className:E("nsd-env-type",L(d.worker_type).colorClass),children:L(d.worker_type).shortLabel})]}):e.jsx("span",{className:"nsd-env-none",children:t("dialog.envSelectEnv")})}),e.jsx(P,{className:"nsd-env-caret"})]}),(d==null?void 0:d.directory)&&e.jsx("span",{className:"nsd-env-path",children:d.directory}),s&&e.jsxs("div",{className:"nsd-envpanel",children:[e.jsx("button",{type:"button",onClick:()=>{f(""),h(!1)},className:"nsd-envrow",children:e.jsxs("span",{className:"nsd-envrow-head",children:[e.jsx("span",{className:"nsd-envrow-name",children:t("dialog.none")}),!m&&e.jsx(U,{className:"ml-auto h-3.5 w-3.5 shrink-0 text-brand-text"})]})}),u.length===0?e.jsx("p",{className:"nsd-envempty",children:t("dialog.envEmpty")}):u.map((a,D)=>{const S=L(a.worker_type),R=!!a.team_id,A=a.id===m;return e.jsxs("button",{type:"button","data-selected":A?"on":void 0,onClick:()=>{f(a.id),h(!1)},className:"nsd-envrow",children:[e.jsxs("span",{className:"nsd-envrow-head",children:[e.jsxs("span",{className:"nsd-envrow-idx",children:["#",D+1]}),e.jsx("span",{className:"nsd-envrow-name",children:a.machine_name||a.id}),e.jsx("span",{className:E("nsd-envrow-type",S.colorClass),children:S.shortLabel}),e.jsx("span",{className:E("nsd-envrow-team",R?"border-border/60 bg-surface-2 text-text-muted":"border-brand/30 bg-brand/10 text-brand-text"),children:R?`${t("dialog.envTeam")}: ${a.team_name||a.team_id}`:t("dialog.envPersonal")}),A&&e.jsx(U,{className:"ml-auto h-3.5 w-3.5 shrink-0 text-brand-text"})]}),a.directory&&e.jsxs("span",{className:"nsd-envrow-dir",children:[e.jsx(ie,{className:"h-3 w-3 shrink-0"}),e.jsx("span",{className:"nsd-envrow-path",children:a.directory}),a.branch&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-text-muted/40",children:"·"}),e.jsx("span",{className:"nsd-envrow-path",children:a.branch})]})]})]},a.id)})]})]}),e.jsxs("label",{className:"nsd-field",children:[e.jsx("span",{className:"nsd-lab",children:t("dialog.titleOptional")}),e.jsx("input",{type:"text",value:p,onChange:a=>b(a.target.value),placeholder:t("dialog.titlePlaceholder"),className:"nsd-title"})]}),e.jsxs("label",{className:"nsd-field",children:[e.jsx("span",{className:"nsd-lab",children:t("dialog.workspaceMode")}),e.jsxs("span",{className:"nsd-modesel",children:[e.jsxs("select",{value:j,onChange:a=>w(a.target.value),className:"nsd-mode",children:[e.jsx("option",{value:"same-dir",children:t("dialog.sameDir")}),e.jsx("option",{value:"worktree",children:t("dialog.worktree")})]}),e.jsx(P,{className:"nsd-mode-caret"})]})]}),N&&e.jsx("p",{className:"nsd-error",children:N}),e.jsxs("div",{className:"nsd-foot",children:[e.jsx("button",{type:"button",onClick:y,className:"nsd-cancel",children:t("common.cancel")}),e.jsx("button",{type:"button",onClick:M,disabled:k,className:"btn-ticket nsd-create",children:k?t("common.creating"):t("common.create")})]})]})})})}function ye({onNavigateSession:c}){const x=B(),y=r.useMemo(()=>new Date().toLocaleDateString(x==="zh"?"zh-CN":"en-US",{year:"numeric",month:"long",day:"numeric",weekday:"short"}),[x]),[v,i]=r.useState([]),[o,l]=r.useState([]),[p,b]=r.useState(!1),[m,f]=r.useState(!1),[j,w]=r.useState(""),[N,g]=r.useState(null),[k,C]=r.useState(!1),s=r.useRef(0),[h,u]=r.useState(!1),d=m||h,T=r.useCallback(()=>{f(!1),w(""),u(!0)},[]),M=r.useCallback(()=>{u(!1)},[]),a=r.useRef(null),D=r.useRef(!1);r.useEffect(()=>{var n;D.current&&!d&&((n=a.current)==null||n.focus()),D.current=d},[d]),r.useEffect(()=>{const n=j.trim();if(!n){s.current+=1,g(null),C(!1);return}C(!0);const _=++s.current,F=setTimeout(()=>{Z(n).then(Q=>{s.current===_&&g(Q.results??[])}).catch(()=>{s.current===_&&g([])}).finally(()=>{s.current===_&&C(!1)})},300);return()=>clearTimeout(F)},[j]);const S=r.useCallback(async()=>{try{const[n,_]=await Promise.all([G(),Y()]);i(n||[]),l(_||[])}catch(n){console.error("Dashboard render error:",n)}},[]);r.useEffect(()=>{S();const n=setInterval(S,5e3);return window.addEventListener("focus",S),()=>{clearInterval(n),window.removeEventListener("focus",S)}},[S]);const R=n=>{b(!1),c(n.id)},A=r.useCallback(n=>{},[]),W=r.useCallback(n=>{c(n)},[c]),z=r.useCallback(async n=>{if(window.confirm(t("dashboard.confirmDelete").replace("{id}",n)))try{await ee(n),i(_=>_.filter(F=>F.id!==n))}catch(_){alert(_ instanceof Error?_.message:t("dashboard.deleteFailed"))}},[]);return e.jsxs("div",{className:"ds-dash",children:[e.jsxs("header",{className:"ds-dash-bar hero-enter",children:[e.jsx("span",{className:"ds-dash-dateline",children:y}),e.jsxs("div",{className:"ds-dash-titlerow",children:[e.jsx("h1",{className:"ds-dash-title font-display font-semibold tracking-tight text-text-primary",children:t("dashboard.title")}),e.jsxs("div",{className:"ds-dash-counts",children:[e.jsxs("span",{children:[v.length," ",t("dashboard.sessions")]}),e.jsxs("span",{children:[o.length," ",t("dashboard.environments")]})]})]})]}),e.jsxs("section",{className:"ds-dash-row",children:[e.jsx("h2",{className:"font-display text-lg font-semibold text-text-primary",children:t("dashboard.environments")}),e.jsx(me,{environments:o,onSelectEnvironment:A})]}),e.jsxs("section",{className:"ds-dash-row",children:[e.jsxs("div",{className:"ds-dash-rowhead",children:[e.jsxs("div",{className:"ds-dash-rowlabel",children:[e.jsx("h2",{className:"font-display text-lg font-semibold text-text-primary",children:t("dashboard.sessions")}),d?e.jsxs("div",{className:E("ds-dash-search",h&&"ds-dash-search--folding"),onAnimationEnd:M,children:[e.jsx($,{className:"h-4 w-4 flex-shrink-0 text-text-muted","aria-hidden":"true"}),e.jsx("input",{autoFocus:!0,value:j,onChange:n=>w(n.target.value),onKeyDown:n=>{n.key==="Escape"&&T()},placeholder:t("dashboard.searchPlaceholder"),"aria-label":t("dashboard.searchPlaceholder"),className:"w-full min-w-0 bg-transparent text-sm text-text-primary placeholder:text-text-muted focus:outline-none"}),k&&e.jsx("span",{className:"flex-shrink-0 text-xs text-text-muted",children:t("dashboard.searching")}),e.jsx("button",{type:"button",onClick:T,className:"ds-dash-search-close",title:t("dashboard.closeSearch"),"aria-label":t("dashboard.closeSearch"),children:e.jsx(se,{className:"h-3.5 w-3.5"})})]}):e.jsx("button",{ref:a,type:"button",onClick:()=>f(!0),className:"ds-dash-search-toggle",title:t("dashboard.searchAction"),"aria-label":t("dashboard.searchAction"),children:e.jsx($,{className:"h-4 w-4"})})]}),e.jsx("button",{type:"button",onClick:()=>b(!0),className:"btn-ticket",children:t("dashboard.newSession")})]}),N!==null?e.jsxs("div",{className:"ds-reg",children:[N.length===0&&!k&&e.jsx("p",{className:"ds-reg-row ds-reg-empty text-sm text-text-muted",children:t("dashboard.searchNoResults")}),N.map(n=>e.jsxs("button",{type:"button",onClick:()=>c(n.session_id),className:"ds-reg-row w-full cursor-pointer",children:[e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block truncate text-sm font-medium text-text-primary",children:n.title||n.session_id}),n.snippet&&e.jsx("span",{className:"mt-1 line-clamp-2 block text-xs leading-relaxed text-text-muted",children:n.snippet})]}),e.jsx("span",{className:"whitespace-nowrap font-mono text-xs text-text-muted",children:n.match_count>0?ae("dashboard.nMatches",{n:n.match_count}):t("dashboard.nameMatch")})]},n.session_id))]}):e.jsx(he,{sessions:v,environments:o,onSelect:W,onDelete:z})]}),e.jsx(ue,{open:p,environments:o,onClose:()=>b(!1),onCreated:R})]})}export{ye as Dashboard};
@@ -1 +1 @@
1
- import{e as r,j as e}from"./vendor-DE_-CLIE.js";import{aZ as v,c as N,aS as t}from"./main-RGMHltl_.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";function P({onSuccess:h,onInvalidInvite:i}){const{join:b}=v(),[l,f]=r.useState(""),[u,w]=r.useState(""),[o,j]=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):i()},[i]);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 b(l,u,o),h()}catch(a){const d=a instanceof Error?a.message:"Join failed";if(d.includes("Invalid invitation")||d.includes("expired")||d.includes("already used")){i();return}n(d)}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:"hero-enter w-full max-w-sm space-y-6",children:[e.jsxs("div",{className:"text-center",children:[e.jsx(N,{className:"mx-auto mb-5 h-10 w-10"}),e.jsx("h1",{className:"font-display text-3xl font-semibold tracking-tight 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:u,onChange:s=>w(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=>j(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||!l,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:x?t("common.loading"):t("auth.join.submit")})]})]})})}export{P as Join};
1
+ import{e as r,j as e}from"./vendor-DE_-CLIE.js";import{a_ as v,c as N,aT as t}from"./main-C_AYd9qE.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";function P({onSuccess:h,onInvalidInvite:i}){const{join:b}=v(),[l,f]=r.useState(""),[u,w]=r.useState(""),[o,j]=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):i()},[i]);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 b(l,u,o),h()}catch(a){const d=a instanceof Error?a.message:"Join failed";if(d.includes("Invalid invitation")||d.includes("expired")||d.includes("already used")){i();return}n(d)}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:"hero-enter w-full max-w-sm space-y-6",children:[e.jsxs("div",{className:"text-center",children:[e.jsx(N,{className:"mx-auto mb-5 h-10 w-10"}),e.jsx("h1",{className:"font-display text-3xl font-semibold tracking-tight 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:u,onChange:s=>w(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=>j(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||!l,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:x?t("common.loading"):t("auth.join.submit")})]})]})})}export{P as Join};
@@ -1 +1 @@
1
- import{e as n,j as e}from"./vendor-DE_-CLIE.js";import{aS as t,aT as y,aZ as j,c as w}from"./main-RGMHltl_.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";function v(r){if(!(r instanceof Error))return t("auth.login.failed");if(r instanceof TypeError)return t("auth.login.unreachable");const s=r.message;return/failed to fetch|network|load failed/i.test(s)?t("auth.login.unreachable"):/csrf/i.test(s)?t("auth.login.csrfBlocked"):/too many/i.test(s)?t("auth.login.rateLimited"):/invalid credentials/i.test(s)?t("auth.login.failed"):!s||/^login failed$/i.test(s)?t("auth.login.failed"):y("auth.login.failedWithReason",{message:s})}function C({onSuccess:r,onNavigateRegister:s}){const{login:m,registrationAllowed:x,singleUserMode:h}=j(),[o,f]=n.useState(""),[i,b]=n.useState(""),[l,d]=n.useState(""),[u,c]=n.useState(!1),g=async a=>{a.preventDefault(),d(""),c(!0);try{await m(o,i),r()}catch(p){d(v(p))}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(w,{className:"mx-auto mb-5 h-10 w-10"}),e.jsx("h1",{className:"font-display text-3xl font-semibold tracking-tight 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:g,className:"space-y-4",children:[h&&e.jsxs("div",{className:"rounded-lg border border-border bg-surface-2 px-3 py-2 text-xs text-text-secondary",children:[e.jsx("p",{children:t("auth.login.singleUserHint")}),e.jsx("p",{className:"mt-1 font-mono text-text-primary",children:"admin / admin123"}),e.jsx("p",{className:"mt-1 text-text-muted",children:t("auth.login.singleUserHintFooter")})]}),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:o,onChange:a=>f(a.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:i,onChange:a=>b(a.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:u,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:u?t("common.loading"):t("auth.login.submit")})]}),x&&e.jsx("button",{type:"button",onClick:s,className:"w-full text-center text-sm text-text-muted hover:text-text-primary transition-colors",children:t("auth.login.register")})]})})}export{C as Login};
1
+ import{e as n,j as e}from"./vendor-DE_-CLIE.js";import{aT as t,aU as y,a_ as j,c as w}from"./main-C_AYd9qE.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";function v(r){if(!(r instanceof Error))return t("auth.login.failed");if(r instanceof TypeError)return t("auth.login.unreachable");const s=r.message;return/failed to fetch|network|load failed/i.test(s)?t("auth.login.unreachable"):/csrf/i.test(s)?t("auth.login.csrfBlocked"):/too many/i.test(s)?t("auth.login.rateLimited"):/invalid credentials/i.test(s)?t("auth.login.failed"):!s||/^login failed$/i.test(s)?t("auth.login.failed"):y("auth.login.failedWithReason",{message:s})}function C({onSuccess:r,onNavigateRegister:s}){const{login:m,registrationAllowed:x,singleUserMode:h}=j(),[o,f]=n.useState(""),[i,b]=n.useState(""),[l,d]=n.useState(""),[u,c]=n.useState(!1),g=async a=>{a.preventDefault(),d(""),c(!0);try{await m(o,i),r()}catch(p){d(v(p))}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(w,{className:"mx-auto mb-5 h-10 w-10"}),e.jsx("h1",{className:"font-display text-3xl font-semibold tracking-tight 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:g,className:"space-y-4",children:[h&&e.jsxs("div",{className:"rounded-lg border border-border bg-surface-2 px-3 py-2 text-xs text-text-secondary",children:[e.jsx("p",{children:t("auth.login.singleUserHint")}),e.jsx("p",{className:"mt-1 font-mono text-text-primary",children:"admin / admin123"}),e.jsx("p",{className:"mt-1 text-text-muted",children:t("auth.login.singleUserHintFooter")})]}),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:o,onChange:a=>f(a.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:i,onChange:a=>b(a.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:u,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:u?t("common.loading"):t("auth.login.submit")})]}),x&&e.jsx("button",{type:"button",onClick:s,className:"w-full text-center text-sm text-text-muted hover:text-text-primary transition-colors",children:t("auth.login.register")})]})})}export{C as Login};
@@ -0,0 +1 @@
1
+ import{e as a,j as e}from"./vendor-DE_-CLIE.js";import{a$ as P,b0 as $,af as q,aT as t,a5 as G,B as H,V as L,U as V,i as z,P as J,N as K,t as Q,ag as W,aA as X,a0 as Z,ao as ee}from"./main-C_AYd9qE.js";import{D as B,a as R,c as U,d as A,b as Y}from"./dialog-CBJUxHMG.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";const te=["user","feedback","project","reference"];function se(o){if(!o)return"—";try{return new Date(o).toLocaleString()}catch{return o}}function re(o){switch(o){case"user":return"bg-accent/15 text-accent";case"feedback":return"bg-status-warning/15 text-status-warning";case"project":return"bg-status-active/15 text-status-active";case"reference":return"bg-surface-3 text-text-muted"}}function le({sessionId:o,embedded:g=!1,refreshTick:w}){P();const[i,p]=a.useState([]),[d,h]=a.useState(!0),[x,f]=a.useState(""),[l,m]=a.useState(!1),[n,u]=a.useState(null),[j,v]=a.useState(null),{activeTeam:N,isAllTeams:k,myTeams:C}=$(),c=a.useCallback(async()=>{try{const s=await q(o?{session_id:o}:k?void 0:N?{team_id:N.id}:g?void 0:{scope:"personal"});p(s||[]),f("")}catch(s){f(s instanceof Error?s.message:t("memories.loadFailed"))}finally{h(!1)}},[o,N,k,g]);a.useEffect(()=>{c();const s=setInterval(c,15e3);return window.addEventListener("focus",c),()=>{clearInterval(s),window.removeEventListener("focus",c)}},[c]);const y=a.useRef(!1);a.useEffect(()=>{if(!y.current){y.current=!0;return}c()},[w,c]);const S=a.useCallback(s=>{m(!1),u(null),p(b=>[s,...b.filter(D=>D.id!==s.id)])},[]),E=a.useCallback(async s=>{u(s),m(!0)},[]),F=a.useCallback(()=>{m(!1),u(null)},[]),_=a.useCallback(async s=>{if(window.confirm(t("memories.delete")+" — "+s.slice(0,8)+"…?"))try{await G(s),p(b=>b.filter(D=>D.id!==s))}catch(b){alert(b instanceof Error?b.message:t("memories.deleteFailed"))}},[]),r=a.useCallback(()=>{v(null),c()},[c]),T=a.useMemo(()=>i,[i]),M=e.jsxs(e.Fragment,{children:[x&&e.jsx("p",{className:"text-status-error text-sm",children:x}),d?e.jsx("div",{className:"space-y-3",children:[0,1,2].map(s=>e.jsx("div",{className:"h-20 animate-pulse rounded-lg bg-surface-2"},s))}):T.length===0?e.jsxs("div",{className:"rounded-lg border border-dashed border-border py-12 text-center",children:[e.jsx(H,{className:"mx-auto h-8 w-8 text-text-muted/40"}),e.jsx("p",{className:"mt-3 text-sm text-text-muted",children:t("memories.empty")})]}):e.jsx("ul",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-3",children:T.map(s=>{var b;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("div",{className:"min-w-0 flex-1",children:[e.jsx("h3",{className:"truncate font-medium text-text-primary group-hover:text-accent",children:s.name}),e.jsx("p",{className:"mt-1 line-clamp-2 text-xs text-text-muted",children:s.description||((b=s.content)==null?void 0:b.slice(0,120))||"—"})]}),e.jsxs("div",{className:"flex flex-shrink-0 flex-col items-end gap-1",children:[e.jsx("span",{className:`rounded-full px-2 py-0.5 text-[10px] font-medium ${re(s.type)}`,children:t(`memories.type.${s.type}`)}),e.jsx("span",{className:"inline-flex items-center gap-1 rounded-full bg-surface-3 px-2 py-0.5 text-[10px] font-medium text-text-muted",title:s.scope_kind==="team"?t("memories.scope.team"):t("memories.scope.personal"),children:s.scope_kind==="team"?e.jsxs(e.Fragment,{children:[e.jsx(L,{className:"h-3 w-3"}),t("memories.scope.team")]}):e.jsxs(e.Fragment,{children:[e.jsx(V,{className:"h-3 w-3"}),t("memories.scope.personal")]})})]})]}),e.jsxs("div",{className:"mt-2 flex items-center gap-3 text-xs text-text-muted",children:[s.source_session_id&&e.jsxs("a",{href:`/code/${s.source_session_id}`,className:"truncate text-text-muted hover:text-accent",title:s.source_session_id,children:[t("memories.session"),": ",s.source_session_id.slice(0,14),"…"]}),e.jsxs("span",{className:"flex items-center gap-1",title:t("memories.updatedAt"),children:[e.jsx(z,{className:"h-3 w-3"}),se(s.updated_at)]}),e.jsxs("span",{children:["v",s.version]})]}),e.jsx("div",{className:"mt-3 flex items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100",children:s.can_manage&&e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:()=>void E(s),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:t("memories.edit"),children:e.jsx(J,{className:"h-3.5 w-3.5"})}),s.scope_kind==="personal"&&e.jsx("button",{type:"button",onClick:()=>v(s),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:t("memories.promote"),children:e.jsx(L,{className:"h-3.5 w-3.5"})}),e.jsx("button",{type:"button",onClick:()=>_(s.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:t("memories.delete"),children:e.jsx(K,{className:"h-3.5 w-3.5"})})]})})]},s.id)})})]});return g?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:t("memories.title")}),e.jsxs("button",{type:"button",onClick:()=>{u(null),m(!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(Q,{className:"h-4 w-4"}),t("memories.new")]})]}),M,e.jsx(I,{open:l,onClose:F,onSaved:S,editMemory:n}),e.jsx(O,{memory:j,teams:C,onClose:()=>v(null),onPromoted:r})]}):e.jsxs("div",{className:"ds-page",children:[e.jsxs("header",{className:"ds-page-head",children:[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:t("memories.title")}),e.jsx("button",{type:"button",onClick:()=>{u(null),m(!0)},className:"btn-ticket",children:t("memories.new")})]}),e.jsx("p",{className:"ds-page-sub",children:t("memories.subtitle")})]}),M,e.jsx(I,{open:l,onClose:F,onSaved:S,editMemory:n}),e.jsx(O,{memory:j,teams:C,onClose:()=>v(null),onPromoted:r})]})}function I({open:o,onClose:g,onSaved:w,editMemory:i}){P();const{myTeams:p}=$(),d=!!i,[h,x]=a.useState(""),[f,l]=a.useState(""),[m,n]=a.useState("project"),[u,j]=a.useState(""),[v,N]=a.useState(""),[k,C]=a.useState(!1),[c,y]=a.useState(""),[S,E]=a.useState(!1);a.useEffect(()=>{o&&(C(!1),y(""),i?(E(!0),x(i.name),l(i.description??""),n(i.type),j(""),N(i.team_id??""),W(i.id).then(r=>{j(r.content??""),r.can_manage===!1&&y(t("memories.updateFailed"))}).catch(()=>y(t("memories.loadFailed"))).finally(()=>E(!1))):(E(!1),x(""),l(""),n("project"),j(""),N("")))},[o,i]);const F=h.trim().length>0&&u.trim().length>0&&!k&&!S,_=async()=>{C(!0),y("");try{const r=d?await X(i.id,{name:h.trim(),description:f.trim()||void 0,type:m,content:u}):await Z({name:h.trim(),description:f.trim()||void 0,type:m,content:u,team_id:v||void 0});w(r)}catch(r){y(r instanceof Error?r.message:t(d?"memories.updateFailed":"memories.create.failed"))}finally{C(!1)}};return e.jsx(B,{open:o,onOpenChange:r=>r?void 0:g(),children:e.jsxs(R,{className:"max-h-[85vh] overflow-y-auto sm:max-w-2xl",children:[e.jsx(U,{children:e.jsx(A,{children:d?t("memories.editMemory"):t("memories.create.title")})}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"memory-name",children:t("memories.create.name")}),e.jsx("input",{id:"memory-name",type:"text",value:h,onChange:r=>x(r.target.value),placeholder:t("memories.create.namePlaceholder"),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:"memory-description",children:t("memories.create.description")}),e.jsx("input",{id:"memory-description",type:"text",value:f,onChange:r=>l(r.target.value),placeholder:t("memories.create.descriptionPlaceholder"),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",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"memory-type",children:t("memories.create.type")}),e.jsx("select",{id:"memory-type",value:m,onChange:r=>n(r.target.value),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",children:te.map(r=>e.jsx("option",{value:r,children:t(`memories.type.${r}`)},r))})]}),!d&&e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"memory-scope",children:t("memories.create.scope")}),e.jsxs("select",{id:"memory-scope",value:v,onChange:r=>N(r.target.value),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",children:[e.jsx("option",{value:"",children:t("memories.create.scope.personal")}),p.map(r=>e.jsx("option",{value:r.id,children:r.name},r.id))]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"memory-content",children:t("memories.create.content")}),e.jsx("textarea",{id:"memory-content",value:u,onChange:r=>j(r.target.value),placeholder:t("memories.create.contentPlaceholder"),rows:10,spellCheck:!1,disabled:S,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"})]}),c&&e.jsx("p",{className:"text-sm text-status-error",children:c})]}),e.jsxs(Y,{children:[e.jsx("button",{type:"button",onClick:g,className:"rounded-md border border-border px-4 py-2 text-sm text-text-secondary hover:bg-surface-2",children:t("common.cancel")}),e.jsx("button",{type:"button",onClick:_,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?t("common.creating"):d?t("memories.update"):t("memories.create.title")})]})]})})}function O({memory:o,teams:g,onClose:w,onPromoted:i}){P();const[p,d]=a.useState(""),[h,x]=a.useState(!1),[f,l]=a.useState("");if(a.useEffect(()=>{d(""),l(""),x(!1)},[o]),!o)return null;const m=async()=>{if(!p){l(t("memories.promoteTeamRequired"));return}x(!0),l("");try{const n=await ee(o.id,p);i(n)}catch(n){l(n instanceof Error?n.message:t("memories.promoteFailed"))}finally{x(!1)}};return e.jsx(B,{open:!!o,onOpenChange:n=>n?void 0:w(),children:e.jsxs(R,{className:"sm:max-w-md",children:[e.jsx(U,{children:e.jsx(A,{children:t("memories.promote")})}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-text-muted",children:o.name}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"promote-team",children:t("memories.scope.team")}),e.jsxs("select",{id:"promote-team",value:p,onChange:n=>d(n.target.value),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",children:[e.jsx("option",{value:"",children:"—"}),g.map(n=>e.jsx("option",{value:n.id,children:n.name},n.id))]})]}),f&&e.jsx("p",{className:"text-sm text-status-error",children:f})]}),e.jsxs(Y,{children:[e.jsx("button",{type:"button",onClick:w,className:"rounded-md border border-border px-4 py-2 text-sm text-text-secondary hover:bg-surface-2",children:t("common.cancel")}),e.jsx("button",{type:"button",onClick:m,disabled:h,className:"rounded-md bg-accent px-4 py-2 text-sm font-medium text-white hover:bg-accent/90 disabled:opacity-50",children:h?t("common.creating"):t("memories.promote")})]})]})})}export{le as MemoriesGallery};
@@ -1 +1 @@
1
- import{e as r,j as e}from"./vendor-DE_-CLIE.js";import{aZ as w,c as y,aS as t}from"./main-RGMHltl_.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";function C({onSuccess:m,onBack:x}){const{register:h}=w(),[n,p]=r.useState(""),[a,b]=r.useState(""),[l,f]=r.useState(""),[d,o]=r.useState(""),[i,u]=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}u(!0);try{await h(n,a),m()}catch(c){o(c instanceof Error?c.message:t("auth.register.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:"hero-enter w-full max-w-sm space-y-6",children:[e.jsxs("div",{className:"text-center",children:[e.jsx(y,{className:"mx-auto mb-5 h-10 w-10"}),e.jsx("h1",{className:"font-display text-3xl font-semibold tracking-tight 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=>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:a,onChange:s=>b(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"})]}),d&&e.jsx("p",{className:"text-sm text-status-error",children:d}),e.jsx("button",{type:"submit",disabled:i,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:i?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{C as Register};
1
+ import{e as r,j as e}from"./vendor-DE_-CLIE.js";import{a_ as w,c as y,aT as t}from"./main-C_AYd9qE.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";function C({onSuccess:m,onBack:x}){const{register:h}=w(),[n,p]=r.useState(""),[a,b]=r.useState(""),[l,f]=r.useState(""),[d,o]=r.useState(""),[i,u]=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}u(!0);try{await h(n,a),m()}catch(c){o(c instanceof Error?c.message:t("auth.register.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:"hero-enter w-full max-w-sm space-y-6",children:[e.jsxs("div",{className:"text-center",children:[e.jsx(y,{className:"mx-auto mb-5 h-10 w-10"}),e.jsx("h1",{className:"font-display text-3xl font-semibold tracking-tight 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=>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:a,onChange:s=>b(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"})]}),d&&e.jsx("p",{className:"text-sm text-status-error",children:d}),e.jsx("button",{type:"submit",disabled:i,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:i?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{C as Register};
@@ -1,4 +1,4 @@
1
- import{j as e}from"./vendor-DE_-CLIE.js";import{aE as a,i as d,h as l,aC as p,aS as h}from"./main-RGMHltl_.js";import{A as y}from"./workerType-CHkBOZGL.js";/**
1
+ import{j as e}from"./vendor-DE_-CLIE.js";import{aF as a,i as d,h as l,aD as p,aT as h}from"./main-C_AYd9qE.js";import{A as y}from"./workerType-BmACfqHE.js";/**
2
2
  * @license lucide-react v0.555.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.