@selvajs/selva 4.21.0-beta.12 → 4.21.0-beta.14

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 (267) hide show
  1. package/build/adapter-node.js +2 -2
  2. package/build/client/_app/immutable/assets/0.DOeouCe4.css +2 -0
  3. package/build/client/_app/immutable/assets/0.DOeouCe4.css.br +0 -0
  4. package/build/client/_app/immutable/assets/0.DOeouCe4.css.gz +0 -0
  5. package/build/client/_app/immutable/assets/rhino3dm.CWOyICcB.wasm +0 -0
  6. package/build/client/_app/immutable/assets/rhino3dm.CWOyICcB.wasm.br +0 -0
  7. package/build/client/_app/immutable/assets/rhino3dm.CWOyICcB.wasm.gz +0 -0
  8. package/build/client/_app/immutable/chunks/71J-lVIC.js +7 -0
  9. package/build/client/_app/immutable/chunks/71J-lVIC.js.br +0 -0
  10. package/build/client/_app/immutable/chunks/71J-lVIC.js.gz +0 -0
  11. package/build/client/_app/immutable/chunks/{BRA_lgsI.js → B3e8ZKjr.js} +1 -1
  12. package/build/client/_app/immutable/chunks/B3e8ZKjr.js.br +0 -0
  13. package/build/client/_app/immutable/chunks/{BRA_lgsI.js.gz → B3e8ZKjr.js.gz} +0 -0
  14. package/build/client/_app/immutable/chunks/{C3KJF0qD.js → B7agp_uZ.js} +1 -1
  15. package/build/client/_app/immutable/chunks/B7agp_uZ.js.br +0 -0
  16. package/build/client/_app/immutable/chunks/B7agp_uZ.js.gz +0 -0
  17. package/build/client/_app/immutable/chunks/BEzPIk5e.js +1 -0
  18. package/build/client/_app/immutable/chunks/BEzPIk5e.js.br +0 -0
  19. package/build/client/_app/immutable/chunks/BEzPIk5e.js.gz +0 -0
  20. package/build/client/_app/immutable/chunks/BUENW6k7.js +1 -0
  21. package/build/client/_app/immutable/chunks/BUENW6k7.js.br +0 -0
  22. package/build/client/_app/immutable/chunks/BUENW6k7.js.gz +0 -0
  23. package/build/client/_app/immutable/chunks/B_4x1b7P.js +1 -0
  24. package/build/client/_app/immutable/chunks/B_4x1b7P.js.br +0 -0
  25. package/build/client/_app/immutable/chunks/B_4x1b7P.js.gz +0 -0
  26. package/build/client/_app/immutable/chunks/{D-7q85bk.js → Bs2bQTgl.js} +1 -1
  27. package/build/client/_app/immutable/chunks/Bs2bQTgl.js.br +0 -0
  28. package/build/client/_app/immutable/chunks/Bs2bQTgl.js.gz +0 -0
  29. package/build/client/_app/immutable/chunks/CCHz3Pcq.js +1 -0
  30. package/build/client/_app/immutable/chunks/CCHz3Pcq.js.br +1 -0
  31. package/build/client/_app/immutable/chunks/CCHz3Pcq.js.gz +0 -0
  32. package/build/client/_app/immutable/chunks/CVA0v6Z8.js +6085 -0
  33. package/build/client/_app/immutable/chunks/CVA0v6Z8.js.br +0 -0
  34. package/build/client/_app/immutable/chunks/CVA0v6Z8.js.gz +0 -0
  35. package/build/client/_app/immutable/chunks/Ch_UJBk-.js +1 -0
  36. package/build/client/_app/immutable/chunks/Ch_UJBk-.js.br +1 -0
  37. package/build/client/_app/immutable/chunks/Ch_UJBk-.js.gz +0 -0
  38. package/build/client/_app/immutable/chunks/{BFXrROAz.js → DEthS42j.js} +1 -1
  39. package/build/client/_app/immutable/chunks/DEthS42j.js.br +0 -0
  40. package/build/client/_app/immutable/chunks/DEthS42j.js.gz +0 -0
  41. package/build/client/_app/immutable/chunks/Db9exncB.js +1 -0
  42. package/build/client/_app/immutable/chunks/Db9exncB.js.br +0 -0
  43. package/build/client/_app/immutable/chunks/Db9exncB.js.gz +0 -0
  44. package/build/client/_app/immutable/chunks/{BfaVYyF5.js → Nv1S5RTq.js} +1 -1
  45. package/build/client/_app/immutable/chunks/Nv1S5RTq.js.br +0 -0
  46. package/build/client/_app/immutable/chunks/Nv1S5RTq.js.gz +0 -0
  47. package/build/client/_app/immutable/chunks/{D1Hh95EK.js → aBYenH6-.js} +1 -1
  48. package/build/client/_app/immutable/chunks/aBYenH6-.js.br +0 -0
  49. package/build/client/_app/immutable/chunks/aBYenH6-.js.gz +0 -0
  50. package/build/client/_app/immutable/entry/{app.DkBodfd-.js → app.CTLPmTNX.js} +2 -2
  51. package/build/client/_app/immutable/entry/app.CTLPmTNX.js.br +0 -0
  52. package/build/client/_app/immutable/entry/app.CTLPmTNX.js.gz +0 -0
  53. package/build/client/_app/immutable/entry/{start.BW9gOvFV.js → start.B312GghS.js} +2 -2
  54. package/build/client/_app/immutable/entry/start.B312GghS.js.br +1 -0
  55. package/build/client/_app/immutable/entry/start.B312GghS.js.gz +0 -0
  56. package/build/client/_app/immutable/nodes/{1.rWI13pjK.js → 1.DmBjtFLw.js} +1 -1
  57. package/build/client/_app/immutable/nodes/1.DmBjtFLw.js.br +0 -0
  58. package/build/client/_app/immutable/nodes/1.DmBjtFLw.js.gz +0 -0
  59. package/build/client/_app/immutable/nodes/{11.NPUXRN3p.js → 11.CnQVPSaL.js} +1 -1
  60. package/build/client/_app/immutable/nodes/11.CnQVPSaL.js.br +0 -0
  61. package/build/client/_app/immutable/nodes/11.CnQVPSaL.js.gz +0 -0
  62. package/build/client/_app/immutable/nodes/{13.BQ0cOim-.js → 13.TEbI6lFx.js} +2 -2
  63. package/build/client/_app/immutable/nodes/13.TEbI6lFx.js.br +0 -0
  64. package/build/client/_app/immutable/nodes/13.TEbI6lFx.js.gz +0 -0
  65. package/build/client/_app/immutable/nodes/{14.BsbXlPTK.js → 14.Dx84-S7G.js} +1 -1
  66. package/build/client/_app/immutable/nodes/14.Dx84-S7G.js.br +0 -0
  67. package/build/client/_app/immutable/nodes/14.Dx84-S7G.js.gz +0 -0
  68. package/build/client/_app/immutable/nodes/{15.C0vWxAsK.js → 15.CKO0EYPJ.js} +1 -1
  69. package/build/client/_app/immutable/nodes/15.CKO0EYPJ.js.br +0 -0
  70. package/build/client/_app/immutable/nodes/15.CKO0EYPJ.js.gz +0 -0
  71. package/build/client/_app/immutable/nodes/{16.BE4OfH4C.js → 16.C7nA7TCy.js} +1 -1
  72. package/build/client/_app/immutable/nodes/16.C7nA7TCy.js.br +0 -0
  73. package/build/client/_app/immutable/nodes/16.C7nA7TCy.js.gz +0 -0
  74. package/build/client/_app/immutable/nodes/{2.BC_cXN9D.js → 2.Dstc2B2E.js} +1 -1
  75. package/build/client/_app/immutable/nodes/2.Dstc2B2E.js.br +0 -0
  76. package/build/client/_app/immutable/nodes/2.Dstc2B2E.js.gz +0 -0
  77. package/build/client/_app/immutable/nodes/{20.BcDEIVaI.js → 20.B2EnikH5.js} +2 -2
  78. package/build/client/_app/immutable/nodes/20.B2EnikH5.js.br +0 -0
  79. package/build/client/_app/immutable/nodes/20.B2EnikH5.js.gz +0 -0
  80. package/build/client/_app/immutable/nodes/21.CFGMFbJt.js +1 -0
  81. package/build/client/_app/immutable/nodes/21.CFGMFbJt.js.br +1 -0
  82. package/build/client/_app/immutable/nodes/21.CFGMFbJt.js.gz +0 -0
  83. package/build/client/_app/immutable/nodes/{25.BhiThFEd.js → 25.DCzT_X3a.js} +6 -6
  84. package/build/client/_app/immutable/nodes/25.DCzT_X3a.js.br +0 -0
  85. package/build/client/_app/immutable/nodes/25.DCzT_X3a.js.gz +0 -0
  86. package/build/client/_app/immutable/nodes/{29.PsrL6xdd.js → 29.DWokJWH0.js} +1 -1
  87. package/build/client/_app/immutable/nodes/29.DWokJWH0.js.br +0 -0
  88. package/build/client/_app/immutable/nodes/29.DWokJWH0.js.gz +0 -0
  89. package/build/client/_app/immutable/nodes/{3.BVyOvlCQ.js → 3.GtVSkcEP.js} +1 -1
  90. package/build/client/_app/immutable/nodes/3.GtVSkcEP.js.br +0 -0
  91. package/build/client/_app/immutable/nodes/3.GtVSkcEP.js.gz +0 -0
  92. package/build/client/_app/immutable/nodes/{30.B6pd-F-z.js → 30.ForK2knd.js} +5 -6
  93. package/build/client/_app/immutable/nodes/30.ForK2knd.js.br +0 -0
  94. package/build/client/_app/immutable/nodes/30.ForK2knd.js.gz +0 -0
  95. package/build/client/_app/immutable/nodes/{31.CFCkC-P2.js → 31.DEYw8Upz.js} +1 -1
  96. package/build/client/_app/immutable/nodes/31.DEYw8Upz.js.br +0 -0
  97. package/build/client/_app/immutable/nodes/31.DEYw8Upz.js.gz +0 -0
  98. package/build/client/_app/immutable/nodes/{32.DWY9hRHg.js → 32.Bi8d2lf7.js} +1 -1
  99. package/build/client/_app/immutable/nodes/32.Bi8d2lf7.js.br +0 -0
  100. package/build/client/_app/immutable/nodes/32.Bi8d2lf7.js.gz +0 -0
  101. package/build/client/_app/immutable/nodes/{34.ZQaLUUXZ.js → 34.DUW5te4K.js} +1 -1
  102. package/build/client/_app/immutable/nodes/34.DUW5te4K.js.br +0 -0
  103. package/build/client/_app/immutable/nodes/34.DUW5te4K.js.gz +0 -0
  104. package/build/client/_app/immutable/nodes/{35.BPmyLjFW.js → 35.Dpj9Kp45.js} +2 -2
  105. package/build/client/_app/immutable/nodes/35.Dpj9Kp45.js.br +0 -0
  106. package/build/client/_app/immutable/nodes/35.Dpj9Kp45.js.gz +0 -0
  107. package/build/client/_app/immutable/nodes/{5.Cf8uTJgI.js → 5.CA3-Q2Yj.js} +1 -1
  108. package/build/client/_app/immutable/nodes/5.CA3-Q2Yj.js.br +1 -0
  109. package/build/client/_app/immutable/nodes/5.CA3-Q2Yj.js.gz +0 -0
  110. package/build/client/_app/immutable/nodes/{6.DMoGaSJA.js → 6.DXhDcOvi.js} +1 -1
  111. package/build/client/_app/immutable/nodes/6.DXhDcOvi.js.br +0 -0
  112. package/build/client/_app/immutable/nodes/6.DXhDcOvi.js.gz +0 -0
  113. package/build/client/_app/immutable/nodes/{7.DTPvNOH_.js → 7.B-g8F3Ul.js} +1 -1
  114. package/build/client/_app/immutable/nodes/7.B-g8F3Ul.js.br +0 -0
  115. package/build/client/_app/immutable/nodes/7.B-g8F3Ul.js.gz +0 -0
  116. package/build/client/_app/immutable/nodes/{9.Bxpo8jgd.js → 9.Bk5Lntvs.js} +1 -1
  117. package/build/client/_app/immutable/nodes/9.Bk5Lntvs.js.br +0 -0
  118. package/build/client/_app/immutable/nodes/9.Bk5Lntvs.js.gz +0 -0
  119. package/build/client/_app/version.json +1 -1
  120. package/build/client/_app/version.json.br +0 -0
  121. package/build/client/_app/version.json.gz +0 -0
  122. package/build/server/.vite/manifest.json +19 -2
  123. package/build/server/_app/immutable/assets/_layout.DOeouCe4.css +2 -0
  124. package/build/server/_app/immutable/assets/rhino3dm.CWOyICcB.wasm +0 -0
  125. package/build/server/chunks/grasshopper.js +17 -10
  126. package/build/server/chunks/grasshopper.js.map +1 -1
  127. package/build/server/chunks/instance.js +3 -3
  128. package/build/server/chunks/internal.js +1 -1
  129. package/build/server/chunks/localeContext.svelte.js +70 -0
  130. package/build/server/chunks/localeContext.svelte.js.map +1 -1
  131. package/build/server/chunks/package.js +1 -1
  132. package/build/server/chunks/package.js.map +1 -1
  133. package/build/server/chunks/providers.server.js +46 -0
  134. package/build/server/chunks/providers.server.js.map +1 -1
  135. package/build/server/chunks/rhino3dm.js +5 -0
  136. package/build/server/chunks/rhino3dm.js.map +1 -0
  137. package/build/server/chunks/schema.js +1 -1
  138. package/build/server/chunks/schema.js.map +1 -1
  139. package/build/server/entries/endpoints/api/v1/compute/_server.ts.js +17 -7
  140. package/build/server/entries/endpoints/api/v1/compute/_server.ts.js.map +1 -1
  141. package/build/server/entries/hooks.server.js +29 -1
  142. package/build/server/entries/hooks.server.js.map +1 -1
  143. package/build/server/entries/pages/admin/organizations/_page.server.ts.js +4 -9
  144. package/build/server/entries/pages/admin/organizations/_page.server.ts.js.map +1 -1
  145. package/build/server/entries/pages/library/_guid_/_page.server.ts.js +27 -14
  146. package/build/server/entries/pages/library/_guid_/_page.server.ts.js.map +1 -1
  147. package/build/server/entries/pages/library/_guid_/_page.svelte.js +8780 -2751
  148. package/build/server/entries/pages/library/_guid_/_page.svelte.js.map +1 -1
  149. package/build/server/entries/pages/projects/_page.svelte.js +1 -0
  150. package/build/server/entries/pages/projects/_page.svelte.js.map +1 -1
  151. package/build/server/entries/pages/team/_page.server.ts.js +1 -1
  152. package/build/server/entries/pages/team/_page.server.ts.js.map +1 -1
  153. package/build/server/entries/pages/team/members/_page.server.ts.js +4 -2
  154. package/build/server/entries/pages/team/members/_page.server.ts.js.map +1 -1
  155. package/build/server/entries/pages/team/members/_page.svelte.js +6 -5
  156. package/build/server/entries/pages/team/members/_page.svelte.js.map +1 -1
  157. package/build/server/entries/pages/team/projects/_page.server.ts.js +4 -10
  158. package/build/server/entries/pages/team/projects/_page.server.ts.js.map +1 -1
  159. package/build/server/entries/pages/team/reclaim/_page.server.ts.js +6 -13
  160. package/build/server/entries/pages/team/reclaim/_page.server.ts.js.map +1 -1
  161. package/build/server/manifest-full.js +1 -1
  162. package/build/server/manifest.js +1 -1
  163. package/build/server/nodes/0.js +2 -2
  164. package/build/server/nodes/1.js +1 -1
  165. package/build/server/nodes/11.js +1 -1
  166. package/build/server/nodes/13.js +1 -1
  167. package/build/server/nodes/14.js +1 -1
  168. package/build/server/nodes/15.js +1 -1
  169. package/build/server/nodes/16.js +1 -1
  170. package/build/server/nodes/2.js +1 -1
  171. package/build/server/nodes/20.js +1 -1
  172. package/build/server/nodes/21.js +1 -1
  173. package/build/server/nodes/25.js +1 -1
  174. package/build/server/nodes/29.js +1 -1
  175. package/build/server/nodes/3.js +1 -1
  176. package/build/server/nodes/30.js +1 -1
  177. package/build/server/nodes/31.js +1 -1
  178. package/build/server/nodes/32.js +1 -1
  179. package/build/server/nodes/34.js +1 -1
  180. package/build/server/nodes/35.js +1 -1
  181. package/build/server/nodes/5.js +1 -1
  182. package/build/server/nodes/6.js +1 -1
  183. package/build/server/nodes/7.js +1 -1
  184. package/build/server/nodes/9.js +1 -1
  185. package/build/server/server.js +1 -1
  186. package/package.json +10 -10
  187. package/templates/.env.example +4 -1
  188. package/build/client/_app/immutable/assets/0.BNUTD3F8.css +0 -2
  189. package/build/client/_app/immutable/assets/0.BNUTD3F8.css.br +0 -0
  190. package/build/client/_app/immutable/assets/0.BNUTD3F8.css.gz +0 -0
  191. package/build/client/_app/immutable/chunks/BFXrROAz.js.br +0 -0
  192. package/build/client/_app/immutable/chunks/BFXrROAz.js.gz +0 -0
  193. package/build/client/_app/immutable/chunks/BRA_lgsI.js.br +0 -0
  194. package/build/client/_app/immutable/chunks/BfaVYyF5.js.br +0 -0
  195. package/build/client/_app/immutable/chunks/BfaVYyF5.js.gz +0 -0
  196. package/build/client/_app/immutable/chunks/BgqLT1eu.js +0 -6084
  197. package/build/client/_app/immutable/chunks/BgqLT1eu.js.br +0 -0
  198. package/build/client/_app/immutable/chunks/BgqLT1eu.js.gz +0 -0
  199. package/build/client/_app/immutable/chunks/C3KJF0qD.js.br +0 -0
  200. package/build/client/_app/immutable/chunks/C3KJF0qD.js.gz +0 -0
  201. package/build/client/_app/immutable/chunks/CUlE4Eja.js +0 -1
  202. package/build/client/_app/immutable/chunks/CUlE4Eja.js.br +0 -0
  203. package/build/client/_app/immutable/chunks/CUlE4Eja.js.gz +0 -0
  204. package/build/client/_app/immutable/chunks/D-7q85bk.js.br +0 -0
  205. package/build/client/_app/immutable/chunks/D-7q85bk.js.gz +0 -0
  206. package/build/client/_app/immutable/chunks/D1Hh95EK.js.br +0 -0
  207. package/build/client/_app/immutable/chunks/D1Hh95EK.js.gz +0 -0
  208. package/build/client/_app/immutable/chunks/DUooINX6.js +0 -1
  209. package/build/client/_app/immutable/chunks/DUooINX6.js.br +0 -1
  210. package/build/client/_app/immutable/chunks/DUooINX6.js.gz +0 -0
  211. package/build/client/_app/immutable/chunks/HozuTQAd.js +0 -1
  212. package/build/client/_app/immutable/chunks/HozuTQAd.js.br +0 -1
  213. package/build/client/_app/immutable/chunks/HozuTQAd.js.gz +0 -0
  214. package/build/client/_app/immutable/chunks/LbAo7oFZ.js +0 -1
  215. package/build/client/_app/immutable/chunks/LbAo7oFZ.js.br +0 -0
  216. package/build/client/_app/immutable/chunks/LbAo7oFZ.js.gz +0 -0
  217. package/build/client/_app/immutable/entry/app.DkBodfd-.js.br +0 -0
  218. package/build/client/_app/immutable/entry/app.DkBodfd-.js.gz +0 -0
  219. package/build/client/_app/immutable/entry/start.BW9gOvFV.js.br +0 -0
  220. package/build/client/_app/immutable/entry/start.BW9gOvFV.js.gz +0 -0
  221. package/build/client/_app/immutable/nodes/1.rWI13pjK.js.br +0 -0
  222. package/build/client/_app/immutable/nodes/1.rWI13pjK.js.gz +0 -0
  223. package/build/client/_app/immutable/nodes/11.NPUXRN3p.js.br +0 -0
  224. package/build/client/_app/immutable/nodes/11.NPUXRN3p.js.gz +0 -0
  225. package/build/client/_app/immutable/nodes/13.BQ0cOim-.js.br +0 -0
  226. package/build/client/_app/immutable/nodes/13.BQ0cOim-.js.gz +0 -0
  227. package/build/client/_app/immutable/nodes/14.BsbXlPTK.js.br +0 -0
  228. package/build/client/_app/immutable/nodes/14.BsbXlPTK.js.gz +0 -0
  229. package/build/client/_app/immutable/nodes/15.C0vWxAsK.js.br +0 -0
  230. package/build/client/_app/immutable/nodes/15.C0vWxAsK.js.gz +0 -0
  231. package/build/client/_app/immutable/nodes/16.BE4OfH4C.js.br +0 -0
  232. package/build/client/_app/immutable/nodes/16.BE4OfH4C.js.gz +0 -0
  233. package/build/client/_app/immutable/nodes/2.BC_cXN9D.js.br +0 -0
  234. package/build/client/_app/immutable/nodes/2.BC_cXN9D.js.gz +0 -0
  235. package/build/client/_app/immutable/nodes/20.BcDEIVaI.js.br +0 -0
  236. package/build/client/_app/immutable/nodes/20.BcDEIVaI.js.gz +0 -0
  237. package/build/client/_app/immutable/nodes/21.BVYhZ3RX.js +0 -1
  238. package/build/client/_app/immutable/nodes/21.BVYhZ3RX.js.br +0 -0
  239. package/build/client/_app/immutable/nodes/21.BVYhZ3RX.js.gz +0 -0
  240. package/build/client/_app/immutable/nodes/25.BhiThFEd.js.br +0 -0
  241. package/build/client/_app/immutable/nodes/25.BhiThFEd.js.gz +0 -0
  242. package/build/client/_app/immutable/nodes/29.PsrL6xdd.js.br +0 -0
  243. package/build/client/_app/immutable/nodes/29.PsrL6xdd.js.gz +0 -0
  244. package/build/client/_app/immutable/nodes/3.BVyOvlCQ.js.br +0 -0
  245. package/build/client/_app/immutable/nodes/3.BVyOvlCQ.js.gz +0 -0
  246. package/build/client/_app/immutable/nodes/30.B6pd-F-z.js.br +0 -0
  247. package/build/client/_app/immutable/nodes/30.B6pd-F-z.js.gz +0 -0
  248. package/build/client/_app/immutable/nodes/31.CFCkC-P2.js.br +0 -0
  249. package/build/client/_app/immutable/nodes/31.CFCkC-P2.js.gz +0 -0
  250. package/build/client/_app/immutable/nodes/32.DWY9hRHg.js.br +0 -0
  251. package/build/client/_app/immutable/nodes/32.DWY9hRHg.js.gz +0 -0
  252. package/build/client/_app/immutable/nodes/34.ZQaLUUXZ.js.br +0 -0
  253. package/build/client/_app/immutable/nodes/34.ZQaLUUXZ.js.gz +0 -0
  254. package/build/client/_app/immutable/nodes/35.BPmyLjFW.js.br +0 -0
  255. package/build/client/_app/immutable/nodes/35.BPmyLjFW.js.gz +0 -0
  256. package/build/client/_app/immutable/nodes/5.Cf8uTJgI.js.br +0 -2
  257. package/build/client/_app/immutable/nodes/5.Cf8uTJgI.js.gz +0 -0
  258. package/build/client/_app/immutable/nodes/6.DMoGaSJA.js.br +0 -0
  259. package/build/client/_app/immutable/nodes/6.DMoGaSJA.js.gz +0 -0
  260. package/build/client/_app/immutable/nodes/7.DTPvNOH_.js.br +0 -0
  261. package/build/client/_app/immutable/nodes/7.DTPvNOH_.js.gz +0 -0
  262. package/build/client/_app/immutable/nodes/9.Bxpo8jgd.js.br +0 -0
  263. package/build/client/_app/immutable/nodes/9.Bxpo8jgd.js.gz +0 -0
  264. package/build/server/_app/immutable/assets/_layout.BNUTD3F8.css +0 -2
  265. /package/build/client/_app/immutable/nodes/{0.BQwy8qtV.js → 0.BQ4J6cqX.js} +0 -0
  266. /package/build/client/_app/immutable/nodes/{0.BQwy8qtV.js.br → 0.BQ4J6cqX.js.br} +0 -0
  267. /package/build/client/_app/immutable/nodes/{0.BQwy8qtV.js.gz → 0.BQ4J6cqX.js.gz} +0 -0
@@ -1,2 +1,2 @@
1
- import{A as e,Ft as t,H as n,K as r,L as i,Lt as a,Ot as o,Pt as s,Q as c,S as l,St as u,T as d,U as f,V as p,_t as m,dt as h,ft as g,ht as _,kt as v,lt as y,m as b,mt as x,n as S,ot as C,p as w,pt as T,r as E,rt as ee,s as te,st as D,yt as O}from"../chunks/sphvlIzg.js";import{o as k,r as ne}from"../chunks/BRA_lgsI.js";import{r as A}from"../chunks/Ca-1xMUo.js";import{t as j}from"../chunks/BbFMtSJ8.js";import{t as re}from"../chunks/D6SQx3MR.js";import{t as ie}from"../chunks/DmlEI0uK.js";import{t as ae}from"../chunks/C9yuuH4J.js";import{t as oe}from"../chunks/Jlr_WNWs.js";import{t as se}from"../chunks/BPWrsj_h.js";import{t as ce}from"../chunks/DtmJiR65.js";import{t as le}from"../chunks/TZzCN567.js";import{t as M}from"../chunks/BCgmDXNw.js";import{i as ue,n as de,r as N,t as P}from"../chunks/CK2nnbJa.js";import{t as fe}from"../chunks/1AvDtYi1.js";import{t as F}from"../chunks/D6cAtf8B.js";import{t as pe}from"../chunks/CUaHcctM.js";import{t as me}from"../chunks/Cj9-pF71.js";import{n as I,t as L}from"../chunks/B8LXiPqe.js";import{n as R}from"../chunks/BQmUk61d.js";import{t as z}from"../chunks/-MlIqmcL.js";import{t as he}from"../chunks/Uzaejkud.js";import{n as ge,t as _e}from"../chunks/BVVRTJCQ.js";var B={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`}],[`path`,{d:`M10 9H8`}],[`path`,{d:`M16 13H8`}],[`path`,{d:`M16 17H8`}]]};B.node;var V=new Set([`$$slots`,`$$events`,`$$legacy`]);function ve(e,t){let n=S(t,V);A(e,E(()=>n,{get icon(){return B}}))}var ye=f(`<!> Grants <span class="text-muted-foreground ml-1 font-mono text-[11px]"> </span>`,1),be=f(`<!> Definitions <span class="text-muted-foreground ml-1 font-mono text-[11px]"> </span>`,1),xe=f(`<!> Settings`,1),Se=f(`<!> <!> <!>`,1),Ce=f(`<!> Add grant`,1),we=f(`<div class="bg-raised shadow-raised space-y-3 rounded-lg border p-4"><div class="space-y-1.5"><!> <div class="flex gap-2"><!> <!></div></div> <div class="space-y-1.5"><!> <!></div> <label class="flex items-center gap-2 text-sm"><input type="checkbox"/> Allow solving (uncheck for view-only)</label> <div class="flex justify-end gap-2"><!> <!></div></div>`),Te=f(`<p class="text-muted-foreground truncate text-xs"> </p>`),Ee=f(`<div class="min-w-0"><p class="truncate text-sm font-medium"> </p> <!></div> <span class="text-xs capitalize"> </span> <span class="text-xs"> </span> <div class="text-right"><!></div>`,1),De=f(`<div class="flex items-center justify-between"><div><p class="text-sm font-medium">Access grants</p> <p class="text-muted-foreground text-xs">Orgs or users you've granted view/solve access. Instance admins always have full
1
+ import{A as e,Ft as t,H as n,K as r,L as i,Lt as a,Ot as o,Pt as s,Q as c,S as l,St as u,T as d,U as f,V as p,_t as m,dt as h,ft as g,ht as _,kt as v,lt as y,m as b,mt as x,n as S,ot as C,p as w,pt as T,r as E,rt as ee,s as te,st as D,yt as O}from"../chunks/sphvlIzg.js";import{r as ne,s as k}from"../chunks/B3e8ZKjr.js";import{r as A}from"../chunks/Ca-1xMUo.js";import{t as j}from"../chunks/BbFMtSJ8.js";import{t as re}from"../chunks/D6SQx3MR.js";import{t as ie}from"../chunks/DmlEI0uK.js";import{t as ae}from"../chunks/C9yuuH4J.js";import{t as oe}from"../chunks/Jlr_WNWs.js";import{t as se}from"../chunks/BPWrsj_h.js";import{t as ce}from"../chunks/DtmJiR65.js";import{t as le}from"../chunks/TZzCN567.js";import{t as M}from"../chunks/BCgmDXNw.js";import{i as ue,n as de,r as N,t as P}from"../chunks/CK2nnbJa.js";import{t as fe}from"../chunks/1AvDtYi1.js";import{t as F}from"../chunks/D6cAtf8B.js";import{t as pe}from"../chunks/CUaHcctM.js";import{t as me}from"../chunks/Cj9-pF71.js";import{n as I,t as L}from"../chunks/B8LXiPqe.js";import{n as R}from"../chunks/BQmUk61d.js";import{t as z}from"../chunks/-MlIqmcL.js";import{t as he}from"../chunks/Uzaejkud.js";import{n as ge,t as _e}from"../chunks/BVVRTJCQ.js";var B={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`}],[`path`,{d:`M10 9H8`}],[`path`,{d:`M16 13H8`}],[`path`,{d:`M16 17H8`}]]};B.node;var V=new Set([`$$slots`,`$$events`,`$$legacy`]);function ve(e,t){let n=S(t,V);A(e,E(()=>n,{get icon(){return B}}))}var ye=f(`<!> Grants <span class="text-muted-foreground ml-1 font-mono text-[11px]"> </span>`,1),be=f(`<!> Definitions <span class="text-muted-foreground ml-1 font-mono text-[11px]"> </span>`,1),xe=f(`<!> Settings`,1),Se=f(`<!> <!> <!>`,1),Ce=f(`<!> Add grant`,1),we=f(`<div class="bg-raised shadow-raised space-y-3 rounded-lg border p-4"><div class="space-y-1.5"><!> <div class="flex gap-2"><!> <!></div></div> <div class="space-y-1.5"><!> <!></div> <label class="flex items-center gap-2 text-sm"><input type="checkbox"/> Allow solving (uncheck for view-only)</label> <div class="flex justify-end gap-2"><!> <!></div></div>`),Te=f(`<p class="text-muted-foreground truncate text-xs"> </p>`),Ee=f(`<div class="min-w-0"><p class="truncate text-sm font-medium"> </p> <!></div> <span class="text-xs capitalize"> </span> <span class="text-xs"> </span> <div class="text-right"><!></div>`,1),De=f(`<div class="flex items-center justify-between"><div><p class="text-sm font-medium">Access grants</p> <p class="text-muted-foreground text-xs">Orgs or users you've granted view/solve access. Instance admins always have full
2
2
  access.</p></div> <!></div> <!> <!>`,1),Oe=f(`<a class="min-w-0 hover:underline"><p class="truncate text-sm font-medium"> </p> <p class="text-muted-foreground truncate font-mono text-xs"> </p></a> <span class="text-xs capitalize"> </span> <span class="text-muted-foreground text-right text-xs"> </span>`,1),ke=f(`<div class="flex items-center justify-between"><div><p class="text-sm font-medium">Definitions</p> <p class="text-muted-foreground text-xs">Upload and edit definitions through the standard project view.</p></div> <!></div> <!>`,1),Ae=f(`<!> `,1),je=f(`<div class="space-y-1.5"><!> <!></div> <div class="space-y-1.5"><!> <!></div> <div class="flex items-center justify-between pt-2"><!> <!></div>`,1),Me=f(`<!> <!> <!> <!>`,1),Ne=f(`<div class="space-y-6"><div><a href="/admin/projects" class="text-muted-foreground hover:text-foreground inline-flex items-center gap-1 text-xs"><!> Platform projects</a></div> <!> <!></div> <!>`,1);function H(f,S){v(S,!0);let E=O(_(S.data.project.name)),A=O(_(S.data.project.description??``)),B=O(!1),V=O(!1),H=O(!1);D(()=>{m(E,S.data.project.name,!0),m(A,S.data.project.description??``,!0)});async function Pe(){if(!c(E).trim())R.error(`Name is required`);else{m(B,!0);try{let e=await fetch(`/api/admin/projects/${S.data.project.id}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({name:c(E).trim(),description:c(A).trim()||null})});if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.message??`HTTP ${e.status}`)}R.success(`Saved`),await k()}catch(e){R.error(e.message)}finally{m(B,!1)}}}async function Fe(){m(V,!0);try{let e=await fetch(`/api/admin/projects/${S.data.project.id}`,{method:`DELETE`});if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.message??`HTTP ${e.status}`)}R.success(`Project deleted`),m(H,!1),ne(`/admin/projects`)}catch(e){R.error(e.message),m(V,!1)}}let U=O(!1),W=O(`org`),G=O(``),K=O(!0),q=O(!1),J=O(null),Y=u(()=>c(W)===`org`?S.data.orgOptions.map(e=>({id:e.id,label:e.name,sub:e.slug})):S.data.userOptions.map(e=>({id:e.id,label:ge(e,e.id),sub:_e(e)}))),X=u(()=>new Set(S.data.grants.filter(e=>e.granteeType===c(W)).map(e=>e.granteeId)));D(()=>{c(Y).find(e=>e.id===c(G))||m(G,c(Y).find(e=>!c(X).has(e.id))?.id??``,!0)});async function Ie(){if(!c(G))R.error(`Pick a grantee`);else{m(q,!0);try{let e=await fetch(`/api/admin/projects/${S.data.project.id}/grants`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({granteeType:c(W),granteeId:c(G),canSolve:c(K)})});if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.message??`HTTP ${e.status}`)}R.success(`Grant added`),m(U,!1),m(G,``),m(K,!0),await k()}catch(e){R.error(e.message)}finally{m(q,!1)}}}async function Le(e){m(J,e,!0);try{let t=await fetch(`/api/admin/projects/${S.data.project.id}/grants/${e}`,{method:`DELETE`});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.message??`HTTP ${t.status}`)}R.success(`Grant revoked`),await k()}catch(e){R.error(e.message)}finally{m(J,null)}}var Re=Ne();l(`t02vfz`,e=>{ee(()=>{y.title=`Admin · ${S.data.project.name??``}`})});var Z=g(Re),Q=h(Z),ze=h(Q),Be=h(ze);re(Be,{class:`h-3 w-3`}),s(),t(ze),t(Q);var $=x(Q,2);{let e=u(()=>S.data.project.description??void 0);fe($,{eyebrow:`Platform project`,get title(){return S.data.project.name},get description(){return c(e)}})}var Ve=x($,2);d(Ve,()=>ue,(o,l)=>{l(o,{value:`grants`,children:(o,l)=>{var f=Me(),_=g(f);d(_,()=>de,(e,t)=>{t(e,{children:(e,t)=>{var n=Se(),r=g(n);d(r,()=>P,(e,t)=>{t(e,{value:`grants`,class:`gap-1.5`,children:(e,t)=>{var n=ye(),r=g(n);oe(r,{class:`h-3.5 w-3.5`});var a=x(r,2),o=T(a,!0);C(()=>i(o,S.data.grants.length)),p(e,n)},$$slots:{default:!0}})});var a=x(r,2);d(a,()=>P,(e,t)=>{t(e,{value:`definitions`,class:`gap-1.5`,children:(e,t)=>{var n=be(),r=g(n);ve(r,{class:`h-3.5 w-3.5`});var a=x(r,2),o=T(a,!0);C(()=>i(o,S.data.definitions.length)),p(e,n)},$$slots:{default:!0}})});var o=x(a,2);d(o,()=>P,(e,t)=>{t(e,{value:`settings`,class:`gap-1.5`,children:(e,t)=>{var n=xe(),r=g(n);ae(r,{class:`h-3.5 w-3.5`}),s(),p(e,n)},$$slots:{default:!0}})}),p(e,n)},$$slots:{default:!0}})});var v=x(_,2);d(v,()=>N,(o,l)=>{l(o,{value:`grants`,class:`mt-4 space-y-4`,children:(o,l)=>{var f=n(),_=g(f);d(_,()=>I,(o,l)=>{l(o,{children:(o,l)=>{var f=n(),_=g(f);d(_,()=>L,(n,o)=>{o(n,{class:`space-y-4 pt-6`,children:(n,o)=>{var l=De(),d=g(l),f=x(h(d),2);j(f,{size:`sm`,onclick:()=>m(U,!c(U)),class:`gap-1.5`,children:(e,t)=>{var n=Ce(),r=g(n);ie(r,{class:`h-3.5 w-3.5`}),s(),p(e,n)},$$slots:{default:!0}}),t(d);var _=x(d,2),v=e=>{var n=we(),a=h(n),o=h(a);M(o,{children:(e,t)=>{s();var n=r(`Grantee type`);p(e,n)},$$slots:{default:!0}});var l=x(o,2),d=h(l);{let e=u(()=>c(W)===`org`?`default`:`outline`);j(d,{get variant(){return c(e)},size:`sm`,onclick:()=>m(W,`org`),children:(e,t)=>{s();var n=r(`Organization`);p(e,n)},$$slots:{default:!0}})}var f=x(d,2);{let e=u(()=>c(W)===`user`?`default`:`outline`);j(f,{get variant(){return c(e)},size:`sm`,onclick:()=>m(W,`user`),children:(e,t)=>{s();var n=r(`Individual user`);p(e,n)},$$slots:{default:!0}})}t(l),t(a);var g=x(a,2),_=h(g);M(_,{for:`grantee-id`,children:(e,t)=>{s();var n=r();C(()=>i(n,c(W)===`org`?`Organization`:`User`)),p(e,n)},$$slots:{default:!0}});var v=x(_,2);{let e=u(()=>c(Y).map(e=>({id:e.id,label:`${e.label}${e.sub?` — ${e.sub}`:``}${c(X).has(e.id)?` (already granted)`:``}`,disabled:c(X).has(e.id)})));le(v,{id:`grantee-id`,get items(){return c(e)},get value(){return c(G)},onChange:e=>m(G,e,!0)})}t(g);var y=x(g,2),b=h(y);w(b),s(),t(y);var S=x(y,2),T=h(S);j(T,{variant:`outline`,size:`sm`,onclick:()=>m(U,!1),children:(e,t)=>{s();var n=r(`Cancel`);p(e,n)},$$slots:{default:!0}});var E=x(T,2);{let e=u(()=>c(q)||!c(G));j(E,{size:`sm`,get disabled(){return c(e)},onclick:Ie,children:(e,t)=>{s();var n=r();C(()=>i(n,c(q)?`Adding…`:`Add grant`)),p(e,n)},$$slots:{default:!0}})}t(S),t(n),te(b,()=>c(K),e=>m(K,e)),p(e,n)};e(_,e=>{c(U)&&e(v)});var y=x(_,2),b=e=>{F(e,{size:`sm`,get icon(){return oe},title:`No grants yet`,description:`Add a grant to share this project with an org or specific user.`})},E=n=>{z(n,{get rows(){return S.data.grants},getKey:e=>e.id,columns:[{label:`Grantee`},{label:`Type`,width:`120px`,hideOnMobile:!0},{label:`Access`,width:`120px`},{label:``,width:`40px`,align:`right`}],row:(n,r=a)=>{var o=Ee(),s=g(o),l=h(s),d=T(l,!0),f=x(l,2),m=e=>{var t=Te(),n=T(t,!0);C(()=>i(n,r().granteeSubtitle)),p(e,t)};e(f,e=>{r().granteeSubtitle&&e(m)}),t(s);var _=x(s,2),v=T(_,!0),y=x(_,2),b=T(y,!0),S=x(y,2),w=h(S);{let e=u(()=>c(J)===r().id);j(w,{variant:`ghost`,size:`sm`,class:`text-destructive hover:text-destructive h-7 w-7 p-0`,get disabled(){return c(e)},onclick:()=>Le(r().id),children:(e,t)=>{ce(e,{class:`h-3.5 w-3.5`})},$$slots:{default:!0}})}t(S),C(()=>{i(d,r().granteeName),i(v,r().granteeType),i(b,r().canSolve?`View + solve`:`View only`)}),p(n,o)},$$slots:{row:!0}})};e(y,e=>{S.data.grants.length===0?e(b):e(E,-1)}),p(n,l)},$$slots:{default:!0}})}),p(o,f)},$$slots:{default:!0}})}),p(o,f)},$$slots:{default:!0}})});var y=x(v,2);d(y,()=>N,(o,c)=>{c(o,{value:`definitions`,class:`mt-4 space-y-4`,children:(o,c)=>{var l=n(),u=g(l);d(u,()=>I,(o,c)=>{c(o,{children:(o,c)=>{var l=n(),u=g(l);d(u,()=>L,(n,o)=>{o(n,{class:`space-y-4 pt-6`,children:(n,o)=>{var c=ke(),l=g(c),u=x(h(l),2);j(u,{size:`sm`,variant:`outline`,onclick:()=>ne(`/projects?project=${S.data.project.slug}`),children:(e,t)=>{s();var n=r(`Open in projects`);p(e,n)},$$slots:{default:!0}}),t(l);var d=x(l,2),f=e=>{F(e,{size:`sm`,get icon(){return ve},title:`No definitions yet`,description:`Open this project in the projects view to upload .gh files.`})},m=e=>{z(e,{get rows(){return S.data.definitions},getKey:e=>e.guid,columns:[{label:`Definition`},{label:`Status`,width:`120px`},{label:`Updated`,width:`140px`,align:`right`,hideOnMobile:!0}],row:(e,n=a)=>{var r=Oe(),o=g(r),s=h(o),c=T(s,!0),l=x(s,2),u=T(l,!0);t(o);var d=x(o,2),f=T(d,!0),m=x(d,2),_=T(m,!0);C(e=>{b(o,`href`,`/library/${n().guid}`),i(c,n().displayName),i(u,n().guid),i(f,n().status),i(_,e)},[()=>new Date(n().updatedAt).toLocaleDateString()]),p(e,r)},$$slots:{row:!0}})};e(d,e=>{S.data.definitions.length===0?e(f):e(m,-1)}),p(n,c)},$$slots:{default:!0}})}),p(o,l)},$$slots:{default:!0}})}),p(o,l)},$$slots:{default:!0}})});var ee=x(y,2);d(ee,()=>N,(e,a)=>{a(e,{value:`settings`,class:`mt-4 space-y-4`,children:(e,a)=>{var o=n(),l=g(o);d(l,()=>I,(e,a)=>{a(e,{children:(e,a)=>{var o=n(),l=g(o);d(l,()=>L,(e,n)=>{n(e,{class:`space-y-4 pt-6`,children:(e,n)=>{var a=je(),o=g(a),l=h(o);M(l,{for:`proj-name`,children:(e,t)=>{s();var n=r(`Name`);p(e,n)},$$slots:{default:!0}});var u=x(l,2);pe(u,{id:`proj-name`,get value(){return c(E)},set value(e){m(E,e,!0)}}),t(o);var d=x(o,2),f=h(d);M(f,{for:`proj-desc`,children:(e,t)=>{s();var n=r(`Description`);p(e,n)},$$slots:{default:!0}});var _=x(f,2);me(_,{id:`proj-desc`,rows:3,get value(){return c(A)},set value(e){m(A,e,!0)}}),t(d);var v=x(d,2),y=h(v);j(y,{onclick:()=>m(H,!0),variant:`ghost`,size:`sm`,get disabled(){return c(V)},class:`text-destructive hover:text-destructive gap-1.5 px-2`,children:(e,t)=>{var n=Ae(),r=g(n);se(r,{class:`h-3.5 w-3.5`});var a=x(r);C(()=>i(a,` ${c(V)?`Deleting…`:`Delete project`}`)),p(e,n)},$$slots:{default:!0}});var b=x(y,2);j(b,{size:`sm`,get disabled(){return c(B)},onclick:Pe,children:(e,t)=>{s();var n=r();C(()=>i(n,c(B)?`Saving…`:`Save`)),p(e,n)},$$slots:{default:!0}}),t(v),p(e,a)},$$slots:{default:!0}})}),p(e,o)},$$slots:{default:!0}})}),p(e,o)},$$slots:{default:!0}})}),p(o,f)},$$slots:{default:!0}})}),t(Z);var He=x(Z,2);{let e=u(()=>`Delete "${S.data.project.name}"? This cannot be undone.`);he(He,{title:`Delete project?`,get description(){return c(e)},confirmLabel:`Delete`,pendingLabel:`Deleting…`,variant:`destructive`,onConfirm:Fe,get open(){return c(H)},set open(e){m(H,e,!0)}})}p(f,Re),o()}export{H as component};
@@ -1,4 +1,4 @@
1
- import{A as e,D as t,Ft as n,G as r,H as i,J as a,K as o,L as s,Lt as c,Ot as l,P as u,Pt as d,Q as f,Rt as p,S as m,St as h,T as g,U as _,V as v,_t as y,a as b,dt as x,f as S,ft as C,ht as w,i as T,it as E,k as D,kt as O,l as k,lt as A,m as j,mt as M,n as N,ot as P,p as F,pt as I,q as L,r as R,st as z,t as B,tt as ee,u as te,v as V,x as H,yt as U}from"../chunks/sphvlIzg.js";import{a as W,c as G,d as K,f as q,n as ne,o as re,r as ie,s as J,t as Y,y as X}from"../chunks/CoRMsLUN.js";import{s as ae}from"../chunks/BRA_lgsI.js";import{n as oe}from"../chunks/BFJ8iwO4.js";import"../chunks/BHnRUwtv.js";import{n as se,r as Z}from"../chunks/Ca-1xMUo.js";import{t as ce}from"../chunks/BbFMtSJ8.js";import{o as le}from"../chunks/DNFu5yLd.js";import{t as ue}from"../chunks/B187F-XR.js";import{a as de,i as fe,r as pe}from"../chunks/CivEAG-M.js";import{t as me}from"../chunks/gNgZDPHs.js";import{t as he}from"../chunks/rIQJtl5L.js";import{t as ge}from"../chunks/nJUe9gXb.js";import{t as _e}from"../chunks/CNkLk5_8.js";import{t as ve}from"../chunks/Djv8qD_2.js";import{p as ye,q as be}from"../chunks/OznVWGiS.js";import{a as xe,c as Se,i as Ce,n as we,o as Te,r as Ee,s as De,t as Oe}from"../chunks/CdTxvcQ4.js";import{t as ke}from"../chunks/DcS7V4T3.js";import{t as Ae}from"../chunks/TZzCN567.js";import{i as je,n as Me,r as Ne,t as Pe}from"../chunks/CK2nnbJa.js";import{t as Fe}from"../chunks/1AvDtYi1.js";import{t as Ie}from"../chunks/DR4HRB4w.js";import{n as Le,t as Re}from"../chunks/B8LXiPqe.js";import{t as ze}from"../chunks/ByPYmSUR.js";import{t as Be}from"../chunks/Bx2qumU5.js";import{t as Ve}from"../chunks/fJvE1weH.js";import{t as He}from"../chunks/DIYaLgLs.js";import{t as Ue}from"../chunks/LbAo7oFZ.js";var We={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`}],[`path`,{d:`m19 12-7 7-7-7`}]]};We.node;var Ge=new Set([`$$slots`,`$$events`,`$$legacy`]);function Ke(e,t){let n=N(t,Ge);Z(e,R(()=>n,{get icon(){return We}}))}var qe={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`}],[`path`,{d:`M12 19V5`}]]};qe.node;var Je=new Set([`$$slots`,`$$events`,`$$legacy`]);function Ye(e,t){let n=N(t,Je);Z(e,R(()=>n,{get icon(){return qe}}))}var Xe={name:`circle-arrow-up`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`}],[`path`,{d:`m16 12-4-4-4 4`}],[`path`,{d:`M12 16V8`}]],aliases:[`arrow-up-circle`]};Xe.node;var Ze=new Set([`$$slots`,`$$events`,`$$legacy`]);function Qe(e,t){let n=N(t,Ze);Z(e,R(()=>n,{get icon(){return Xe}}))}var $e={name:`circle-x`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`}],[`path`,{d:`m15 9-6 6`}],[`path`,{d:`m9 9 6 6`}]],aliases:[`x-circle`]};$e.node;var et=new Set([`$$slots`,`$$events`,`$$legacy`]);function tt(e,t){let n=N(t,et);Z(e,R(()=>n,{get icon(){return $e}}))}var nt={name:`flask-conical`,size:24,node:[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`}],[`path`,{d:`M6.453 15h11.094`}],[`path`,{d:`M8.5 2h7`}]]};nt.node;var rt=new Set([`$$slots`,`$$events`,`$$legacy`]);function it(e,t){let n=N(t,rt);Z(e,R(()=>n,{get icon(){return nt}}))}var at={name:`stethoscope`,size:24,node:[[`path`,{d:`M11 2v2`}],[`path`,{d:`M5 2v2`}],[`path`,{d:`M5 3H4a2 2 0 0 0-2 2v4a6 6 0 0 0 12 0V5a2 2 0 0 0-2-2h-1`}],[`path`,{d:`M8 15a6 6 0 0 0 12 0v-3`}],[`circle`,{cx:`20`,cy:`10`,r:`2`}]]};at.node;var ot=new Set([`$$slots`,`$$events`,`$$legacy`]);function st(e,t){let n=N(t,ot);Z(e,R(()=>n,{get icon(){return at}}))}var ct=re({component:`switch`,parts:[`root`,`thumb`]}),lt=new be(`Switch.Root`),ut=class e{static create(t){return lt.set(new e(t))}opts;attachment;constructor(e){this.opts=e,this.attachment=K(e.ref),this.onkeydown=this.onkeydown.bind(this),this.onclick=this.onclick.bind(this)}#e(){this.opts.checked.current=!this.opts.checked.current}onkeydown(e){e.key!==`Enter`&&e.key!==` `||this.opts.disabled.current||(e.preventDefault(),this.#e())}onclick(e){this.opts.disabled.current||this.#e()}#t=h(()=>({"data-disabled":ne(this.opts.disabled.current),"data-state":G(this.opts.checked.current),"data-required":ne(this.opts.required.current)}));get sharedProps(){return f(this.#t)}set sharedProps(e){y(this.#t,e)}#n=h(()=>({checked:this.opts.checked.current}));get snippetProps(){return f(this.#n)}set snippetProps(e){y(this.#n,e)}#r=h(()=>({...this.sharedProps,id:this.opts.id.current,role:`switch`,disabled:W(this.opts.disabled.current),"aria-checked":J(this.opts.checked.current,!1),"aria-required":ie(this.opts.required.current),[ct.root]:``,onclick:this.onclick,onkeydown:this.onkeydown,...this.attachment}));get props(){return f(this.#r)}set props(e){y(this.#r,e)}},dt=class e{static create(){return new e(lt.get())}root;#e=h(()=>this.root.opts.name.current!==void 0);get shouldRender(){return f(this.#e)}set shouldRender(e){y(this.#e,e)}constructor(e){this.root=e}#t=h(()=>({type:`checkbox`,name:this.root.opts.name.current,value:this.root.opts.value.current,checked:this.root.opts.checked.current,disabled:this.root.opts.disabled.current,required:this.root.opts.required.current}));get props(){return f(this.#t)}set props(e){y(this.#t,e)}},ft=class e{static create(t){return new e(t,lt.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=K(e.ref)}#e=h(()=>({checked:this.root.opts.checked.current}));get snippetProps(){return f(this.#e)}set snippetProps(e){y(this.#e,e)}#t=h(()=>({...this.root.sharedProps,id:this.opts.id.current,[ct.thumb]:``,...this.attachment}));get props(){return f(this.#t)}set props(e){y(this.#t,e)}};function pt(t,n){O(n,!0);let r=dt.create();var a=i(),o=C(a),s=e=>{ke(e,R(()=>r.props))};e(o,e=>{r.shouldRender&&e(s)}),v(t,a),l()}var mt=new Set([`$$slots`,`$$events`,`$$legacy`,`child`,`children`,`ref`,`id`,`disabled`,`required`,`checked`,`value`,`name`,`type`,`onCheckedChange`]),ht=_(`<button><!></button>`),gt=_(`<!> <!>`,1);function _t(t,a){let o=r();O(a,!0);let s=B(a,`ref`,15,null),d=B(a,`id`,19,()=>Y(o)),p=B(a,`disabled`,3,!1),m=B(a,`required`,3,!1),g=B(a,`checked`,15,!1),_=B(a,`value`,3,`on`),y=B(a,`name`,3,void 0),b=B(a,`type`,3,`button`),w=B(a,`onCheckedChange`,3,ye),T=N(a,mt),E=ut.create({checked:X(()=>g(),e=>{g(e),w()?.(e)}),disabled:X(()=>p()??!1),required:X(()=>m()),value:X(()=>_()),name:X(()=>y()),id:X(()=>d()),ref:X(()=>s(),e=>s(e))}),D=h(()=>q(T,E.props,{type:b()}));var k=gt(),A=C(k),j=e=>{var t=i(),n=C(t);{let e=h(()=>({props:f(D),...E.snippetProps}));u(n,()=>a.child,()=>f(e))}v(e,t)},P=e=>{var t=ht();S(t,()=>({...f(D)}));var r=x(t);u(r,()=>a.children??c,()=>E.snippetProps),n(t),v(e,t)};e(A,e=>{a.child?e(j):e(P,-1)}),pt(M(A,2),{}),v(t,k),l()}var vt=new Set([`$$slots`,`$$events`,`$$legacy`,`child`,`children`,`ref`,`id`]),yt=_(`<span><!></span>`);function bt(t,a){let o=r();O(a,!0);let s=B(a,`ref`,15,null),d=B(a,`id`,19,()=>Y(o)),p=N(a,vt),m=ft.create({id:X(()=>d()),ref:X(()=>s(),e=>s(e))}),g=h(()=>q(p,m.props));var _=i(),y=C(_),b=e=>{var t=i(),n=C(t);{let e=h(()=>({props:f(g),...m.snippetProps}));u(n,()=>a.child,()=>f(e))}v(e,t)},w=e=>{var t=yt();S(t,()=>({...f(g)}));var r=x(t);u(r,()=>a.children??c,()=>m.snippetProps),n(t),v(e,t)};e(y,e=>{a.child?e(b):e(w,-1)}),v(t,_),l()}var xt=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`checked`]);function St(e,t){O(t,!0);let n=B(t,`ref`,15,null),r=B(t,`checked`,15,!1),a=N(t,xt);var o=i(),s=C(o);{let e=h(()=>se(`peer w-8 shadow-xs h-4.5 inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input`,t.class));g(s,()=>_t,(t,o)=>{o(t,R({"data-slot":`switch`,get class(){return f(e)}},()=>a,{get ref(){return n()},set ref(e){n(e)},get checked(){return r()},set checked(e){r(e)},children:(e,t)=>{var n=i(),r=C(n);{let e=h(()=>se(`size-4 data-[state=unchecked]:translate-x-0 data-[state=checked]:translate-x-3.5 pointer-events-none block rounded-full bg-background ring-0 transition-transform dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground`));g(r,()=>bt,(t,n)=>{n(t,{"data-slot":`switch-thumb`,get class(){return f(e)}})})}v(e,n)},$$slots:{default:!0}}))})}v(e,o),l()}function Q(e,t){let n=t.exec(e);return n?n[1]:void 0}function Ct(e){let t=String.raw`\d+\.\d+\.\d+[^\s]*`,n=new RegExp(String.raw`(?:Target \([^)]*\)|Available):\s*(${t})\s*(?:→|->)\s*(${t})`).exec(e);return{from:Q(e,/Current @selvajs\/selva:\s*v?(\d+\.\d+\.\d+[^\s]*)/)??n?.[1],to:Q(e,/New @selvajs\/selva:\s*v?(\d+\.\d+\.\d+[^\s]*)/)??n?.[2]}}function $(e,t){return e.includes(t)}function wt(e,t){let{from:n,to:r}=Ct(t);if(e===null)return{severity:`pending`,title:`Update in progress…`};if(e===6||$(t,`Manual recovery required`)||$(t,`manual intervention required`))return{severity:`critical`,title:`Update failed AND rollback failed — the app may be OFFLINE`,detail:"Both the new version and the rollback failed their health check. SSH into the server and run: `pm2 logs selva-compute`, then `pm2 start ecosystem.config.cjs` from the deployment directory.",from:n,to:r};if(e===-2)return{severity:`critical`,title:`App did not come back online within 15 minutes`,detail:"The update may still be finishing in the background, or the new process is crash-looping. Check `pm2 logs selva-compute`. Do not re-run the update until you have confirmed the current state.",from:n,to:r};if(e===4)return{severity:`critical`,title:`Update failed and the rollback could not reinstall — the app may be OFFLINE`,detail:"The previous version could not be restored from npm. SSH into the server and run `pm2 logs selva-compute`; if the app is down, reinstall explicitly with `npm install --prefer-online @selvajs/cli@<version> @selvajs/selva@<version>` from the deployment directory.",from:n,to:r};if(e===3)return{severity:`critical`,title:`Update failed its health check and could not be rolled back automatically`,detail:"No prior version was recorded, so the previous build could not be restored. Check `pm2 logs selva-compute` to confirm whether the app came back online.",from:n,to:r};if(e===143||e===130||e===129||$(t,`KILLED`))return{severity:`critical`,title:`Update was killed before it finished — nothing was installed`,detail:"The runner was terminated mid-update, most often by a systemd-supervised PM2 restarting its whole control group. The version on disk is unchanged. Check `pm2 logs selva-compute` and confirm the app is online before retrying; if a global pm2 owns the daemon, reconcile that first.",from:n,to:r};if(e===9||$(t,`SYSTEMD_PM2`))return{severity:`warning`,title:`Update cancelled — PM2 needs a resync that only a shell can do safely. The app is untouched.`,detail:"This deployment's PM2 runs under systemd, where `pm2 update` restarts the unit and kills the update mid-run. Nothing was installed and the app is still serving. SSH in and run `./node_modules/.bin/pm2 update` from the deployment directory, then retry the update here.",from:n,to:r};if(e===10||$(t,`DATA_FORMAT:`)){let e=Q(t,/reads data format (\d+),/),i=Q(t,/this deployment is on format (\d+)\./);return{severity:`warning`,title:`Update cancelled — ${r??`the target version`} cannot read this deployment's data. The app is untouched.`,detail:(e&&i?`It reads data format ${e}; this deployment is on format ${i}. `:``)+`Installing it would leave stored data, such as Compute API keys, unreadable. Switch the release channel back to stay on the installed version. To go back anyway, follow "Going back to an older release" in the admin guide.`,from:n,to:r}}if(e===8||$(t,`PM2_SKEW`)){let e=Q(t,/daemon \(v(\d+\.\d+\.\d+)\)/),i=Q(t,/deployment's pm2 \(v(\d+\.\d+\.\d+)\)/);return{severity:`warning`,title:e&&i?`Update cancelled — a global PM2 (v${e}) owns the daemon, not this deployment's (v${i}). The app is untouched.`:`Update cancelled — a conflicting global PM2 owns the daemon. The app is untouched.`,detail:"Resyncing would have downgraded the daemon and dropped its process table, so the update stopped before taking the app down. On the server: `which -a pm2`, `pm2 -v`, `pm2 ping` — remove or align the global pm2, then retry.",from:n,to:r}}if($(t,`SCHEMA_SKEW`)){let e=Q(t,/expects database migration head (\S+?),/),i=Q(t,/this database is at (\S+?)\./),a=e&&i?` The database is at ${i}; ${r??`it`} needs ${e}.`:``,o=Q(t,/@selvajs\/supabase-provider@([\w.-]+)/)??($(t,`channel: beta`)?`beta`:`latest`);return{severity:`warning`,title:`Update rolled back — the database migrations for ${r??`the new version`} have not been applied.${a} The app is online${n?` on ${n}`:``}.`,detail:`Nothing is wrong with the new version. Selva does not apply migrations during an update, because they cannot be rolled back — auto-migrating and then rolling the code back would leave the app and database on different heads. Apply them on the server, then re-run this update: \`npm install --prefer-online @selvajs/supabase-provider@${o}\`, then \`npx selva-supabase\`, then \`npx supabase db push\`. The provider install is not optional — the migration SQL ships inside that package, and the update only moves @selvajs/cli and @selvajs/selva, so a sync without it copies nothing and the push reports "up to date" having done nothing. Retrying without this will fail in exactly the same way.`,from:n,to:r}}if($(t,`AT_REST_SECRETS`))return{severity:`warning`,title:`Update rolled back — stored compute server keys do not decrypt under this host's SELVA_AT_REST_KEY. The app is online${n?` on ${n}`:``}.`,detail:`This is a configuration problem on the server, not a fault in the new version, so retrying alone will fail identically. Re-enter the affected keys at /admin/compute, or restore the SELVA_AT_REST_KEY the values were encrypted with, then re-run the update.`,from:n,to:r};if(e===5||$(t,`Rolled back`))return{severity:`warning`,title:`Update failed — safely rolled back${n?` to ${n}`:``}. The app is online.`,detail:`The new version failed its health check, so the previous version was restored and is serving normally. Review the log below for why the new version failed before retrying.`,from:n,to:r};if($(t,`ENGINE_MISMATCH`)||$(t,`EBADENGINE`)){let e=Q(t,/requires Node ([^\s]+(?:\s*[<>=]+\s*[\d.]+)*)/),i=Q(t,/this host runs v?(\d+\.\d+\.\d+)/);return{severity:`warning`,title:i?`Updated${r?` to ${r}`:``}, but this release needs Node ${e??`(newer)`} — the host runs v${i}. Expect runtime failures.`:`Updated${r?` to ${r}`:``}, but this release requires a newer Node than the host provides. Expect runtime failures.`,detail:`npm installed it anyway (engine-strict is off) and the health check passed, but it does not exercise the newer APIs — routes that do will throw at request time. Upgrade Node on the server, then re-run the update.`,from:n,to:r}}return $(t,`PM2_RESYNC_NEEDED`)?{severity:`warning`,title:`Updated${r?` to ${r}`:``}, but the pm2 daemon still runs the old pm2.`,detail:"The app is online. On the server, run `npx pm2 update` in the deployment directory, let it finish, then check `npx pm2 list` shows selva-compute online.",from:n,to:r}:$(t,`PM2_PIN_FAILED`)?{severity:`warning`,title:`Updated${r?` to ${r}`:``}, but pm2 stayed on the previous version.`,detail:"The app is online on the old pm2. On the server, run `npx selva migrate` in the deployment directory to move it to the pinned version.",from:n,to:r}:$(t,`npm cache may be stale`)||$(t,`No version change`)?{severity:`warning`,title:`No version change — npm installed the same version.`,detail:"Your npm cache may be stale. On the server: `npm cache clean --force`, remove node_modules + package-lock.json, then `npm install --prefer-online`.",from:n,to:r}:e===0?$(t,`Already on the`)||$(t,`Nothing to do`)?{severity:`info`,title:`Already up to date${n?` (${n})`:``} — nothing to install.`,detail:`No changes were made and the app was not restarted.`,from:n,to:r}:n&&r&&n!==r?{severity:`success`,title:`Updated ${n} → ${r}. The app is back online.`,from:n,to:r}:r?{severity:`success`,title:`Update complete — now on ${r}. The app is back online.`,from:n,to:r}:{severity:`success`,title:`Update completed and the app is back online.`,from:n,to:r}:{severity:`critical`,title:`Update failed (exit code ${e}).`,detail:"The update did not complete cleanly. Review the log below, and check `pm2 logs selva-compute` to confirm whether the app is currently online.",from:n,to:r}}var Tt=_(`<span title="Currently installed @selvajs/selva version"> </span>`),Et=_(`Update @selvajs/* to the latest <span class="font-medium"> </span> release and restart`,1),Dt=_(`<div class="flex items-start justify-between gap-3"><!> <!></div> <!>`,1),Ot=_(`<div class="border-warning/40 bg-warning/10 text-warning flex items-center gap-2 rounded-md border px-3 py-2 text-sm" role="status"><!> <span> <span class="font-mono"> </span> → <span class="font-mono"> </span></span></div>`),kt=_(`<p class="text-muted-foreground text-sm"> <span class="font-mono"> </span>).</p>`),At=_(`<div class="border-destructive/40 bg-destructive/10 text-destructive flex items-start gap-2 rounded-md border px-3 py-3 text-sm" role="alert"><!> <div class="space-y-1"><p class="font-medium">Update blocked — <span class="font-mono"> </span> cannot read this deployment's
1
+ import{A as e,D as t,Ft as n,G as r,H as i,J as a,K as o,L as s,Lt as c,Ot as l,P as u,Pt as d,Q as f,Rt as p,S as m,St as h,T as g,U as _,V as v,_t as y,a as b,dt as x,f as S,ft as C,ht as w,i as T,it as E,k as D,kt as O,l as k,lt as A,m as j,mt as M,n as N,ot as P,p as F,pt as I,q as L,r as R,st as z,t as B,tt as ee,u as te,v as V,x as H,yt as U}from"../chunks/sphvlIzg.js";import{a as W,c as G,d as K,f as q,n as ne,o as re,r as ie,s as J,t as Y,y as X}from"../chunks/CoRMsLUN.js";import{c as ae}from"../chunks/B3e8ZKjr.js";import{n as oe}from"../chunks/BFJ8iwO4.js";import"../chunks/BHnRUwtv.js";import{n as se,r as Z}from"../chunks/Ca-1xMUo.js";import{t as ce}from"../chunks/BbFMtSJ8.js";import{o as le}from"../chunks/DNFu5yLd.js";import{t as ue}from"../chunks/B187F-XR.js";import{a as de,i as fe,r as pe}from"../chunks/CivEAG-M.js";import{t as me}from"../chunks/gNgZDPHs.js";import{t as he}from"../chunks/rIQJtl5L.js";import{t as ge}from"../chunks/nJUe9gXb.js";import{t as _e}from"../chunks/CNkLk5_8.js";import{t as ve}from"../chunks/Djv8qD_2.js";import{p as ye,q as be}from"../chunks/OznVWGiS.js";import{a as xe,c as Se,i as Ce,n as we,o as Te,r as Ee,s as De,t as Oe}from"../chunks/CdTxvcQ4.js";import{t as ke}from"../chunks/DcS7V4T3.js";import{t as Ae}from"../chunks/TZzCN567.js";import{i as je,n as Me,r as Ne,t as Pe}from"../chunks/CK2nnbJa.js";import{t as Fe}from"../chunks/1AvDtYi1.js";import{t as Ie}from"../chunks/DR4HRB4w.js";import{n as Le,t as Re}from"../chunks/B8LXiPqe.js";import{t as ze}from"../chunks/ByPYmSUR.js";import{t as Be}from"../chunks/Bx2qumU5.js";import{t as Ve}from"../chunks/fJvE1weH.js";import{t as He}from"../chunks/DIYaLgLs.js";import{t as Ue}from"../chunks/BUENW6k7.js";var We={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`}],[`path`,{d:`m19 12-7 7-7-7`}]]};We.node;var Ge=new Set([`$$slots`,`$$events`,`$$legacy`]);function Ke(e,t){let n=N(t,Ge);Z(e,R(()=>n,{get icon(){return We}}))}var qe={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`}],[`path`,{d:`M12 19V5`}]]};qe.node;var Je=new Set([`$$slots`,`$$events`,`$$legacy`]);function Ye(e,t){let n=N(t,Je);Z(e,R(()=>n,{get icon(){return qe}}))}var Xe={name:`circle-arrow-up`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`}],[`path`,{d:`m16 12-4-4-4 4`}],[`path`,{d:`M12 16V8`}]],aliases:[`arrow-up-circle`]};Xe.node;var Ze=new Set([`$$slots`,`$$events`,`$$legacy`]);function Qe(e,t){let n=N(t,Ze);Z(e,R(()=>n,{get icon(){return Xe}}))}var $e={name:`circle-x`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`}],[`path`,{d:`m15 9-6 6`}],[`path`,{d:`m9 9 6 6`}]],aliases:[`x-circle`]};$e.node;var et=new Set([`$$slots`,`$$events`,`$$legacy`]);function tt(e,t){let n=N(t,et);Z(e,R(()=>n,{get icon(){return $e}}))}var nt={name:`flask-conical`,size:24,node:[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`}],[`path`,{d:`M6.453 15h11.094`}],[`path`,{d:`M8.5 2h7`}]]};nt.node;var rt=new Set([`$$slots`,`$$events`,`$$legacy`]);function it(e,t){let n=N(t,rt);Z(e,R(()=>n,{get icon(){return nt}}))}var at={name:`stethoscope`,size:24,node:[[`path`,{d:`M11 2v2`}],[`path`,{d:`M5 2v2`}],[`path`,{d:`M5 3H4a2 2 0 0 0-2 2v4a6 6 0 0 0 12 0V5a2 2 0 0 0-2-2h-1`}],[`path`,{d:`M8 15a6 6 0 0 0 12 0v-3`}],[`circle`,{cx:`20`,cy:`10`,r:`2`}]]};at.node;var ot=new Set([`$$slots`,`$$events`,`$$legacy`]);function st(e,t){let n=N(t,ot);Z(e,R(()=>n,{get icon(){return at}}))}var ct=re({component:`switch`,parts:[`root`,`thumb`]}),lt=new be(`Switch.Root`),ut=class e{static create(t){return lt.set(new e(t))}opts;attachment;constructor(e){this.opts=e,this.attachment=K(e.ref),this.onkeydown=this.onkeydown.bind(this),this.onclick=this.onclick.bind(this)}#e(){this.opts.checked.current=!this.opts.checked.current}onkeydown(e){e.key!==`Enter`&&e.key!==` `||this.opts.disabled.current||(e.preventDefault(),this.#e())}onclick(e){this.opts.disabled.current||this.#e()}#t=h(()=>({"data-disabled":ne(this.opts.disabled.current),"data-state":G(this.opts.checked.current),"data-required":ne(this.opts.required.current)}));get sharedProps(){return f(this.#t)}set sharedProps(e){y(this.#t,e)}#n=h(()=>({checked:this.opts.checked.current}));get snippetProps(){return f(this.#n)}set snippetProps(e){y(this.#n,e)}#r=h(()=>({...this.sharedProps,id:this.opts.id.current,role:`switch`,disabled:W(this.opts.disabled.current),"aria-checked":J(this.opts.checked.current,!1),"aria-required":ie(this.opts.required.current),[ct.root]:``,onclick:this.onclick,onkeydown:this.onkeydown,...this.attachment}));get props(){return f(this.#r)}set props(e){y(this.#r,e)}},dt=class e{static create(){return new e(lt.get())}root;#e=h(()=>this.root.opts.name.current!==void 0);get shouldRender(){return f(this.#e)}set shouldRender(e){y(this.#e,e)}constructor(e){this.root=e}#t=h(()=>({type:`checkbox`,name:this.root.opts.name.current,value:this.root.opts.value.current,checked:this.root.opts.checked.current,disabled:this.root.opts.disabled.current,required:this.root.opts.required.current}));get props(){return f(this.#t)}set props(e){y(this.#t,e)}},ft=class e{static create(t){return new e(t,lt.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=K(e.ref)}#e=h(()=>({checked:this.root.opts.checked.current}));get snippetProps(){return f(this.#e)}set snippetProps(e){y(this.#e,e)}#t=h(()=>({...this.root.sharedProps,id:this.opts.id.current,[ct.thumb]:``,...this.attachment}));get props(){return f(this.#t)}set props(e){y(this.#t,e)}};function pt(t,n){O(n,!0);let r=dt.create();var a=i(),o=C(a),s=e=>{ke(e,R(()=>r.props))};e(o,e=>{r.shouldRender&&e(s)}),v(t,a),l()}var mt=new Set([`$$slots`,`$$events`,`$$legacy`,`child`,`children`,`ref`,`id`,`disabled`,`required`,`checked`,`value`,`name`,`type`,`onCheckedChange`]),ht=_(`<button><!></button>`),gt=_(`<!> <!>`,1);function _t(t,a){let o=r();O(a,!0);let s=B(a,`ref`,15,null),d=B(a,`id`,19,()=>Y(o)),p=B(a,`disabled`,3,!1),m=B(a,`required`,3,!1),g=B(a,`checked`,15,!1),_=B(a,`value`,3,`on`),y=B(a,`name`,3,void 0),b=B(a,`type`,3,`button`),w=B(a,`onCheckedChange`,3,ye),T=N(a,mt),E=ut.create({checked:X(()=>g(),e=>{g(e),w()?.(e)}),disabled:X(()=>p()??!1),required:X(()=>m()),value:X(()=>_()),name:X(()=>y()),id:X(()=>d()),ref:X(()=>s(),e=>s(e))}),D=h(()=>q(T,E.props,{type:b()}));var k=gt(),A=C(k),j=e=>{var t=i(),n=C(t);{let e=h(()=>({props:f(D),...E.snippetProps}));u(n,()=>a.child,()=>f(e))}v(e,t)},P=e=>{var t=ht();S(t,()=>({...f(D)}));var r=x(t);u(r,()=>a.children??c,()=>E.snippetProps),n(t),v(e,t)};e(A,e=>{a.child?e(j):e(P,-1)}),pt(M(A,2),{}),v(t,k),l()}var vt=new Set([`$$slots`,`$$events`,`$$legacy`,`child`,`children`,`ref`,`id`]),yt=_(`<span><!></span>`);function bt(t,a){let o=r();O(a,!0);let s=B(a,`ref`,15,null),d=B(a,`id`,19,()=>Y(o)),p=N(a,vt),m=ft.create({id:X(()=>d()),ref:X(()=>s(),e=>s(e))}),g=h(()=>q(p,m.props));var _=i(),y=C(_),b=e=>{var t=i(),n=C(t);{let e=h(()=>({props:f(g),...m.snippetProps}));u(n,()=>a.child,()=>f(e))}v(e,t)},w=e=>{var t=yt();S(t,()=>({...f(g)}));var r=x(t);u(r,()=>a.children??c,()=>m.snippetProps),n(t),v(e,t)};e(y,e=>{a.child?e(b):e(w,-1)}),v(t,_),l()}var xt=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`checked`]);function St(e,t){O(t,!0);let n=B(t,`ref`,15,null),r=B(t,`checked`,15,!1),a=N(t,xt);var o=i(),s=C(o);{let e=h(()=>se(`peer w-8 shadow-xs h-4.5 inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input`,t.class));g(s,()=>_t,(t,o)=>{o(t,R({"data-slot":`switch`,get class(){return f(e)}},()=>a,{get ref(){return n()},set ref(e){n(e)},get checked(){return r()},set checked(e){r(e)},children:(e,t)=>{var n=i(),r=C(n);{let e=h(()=>se(`size-4 data-[state=unchecked]:translate-x-0 data-[state=checked]:translate-x-3.5 pointer-events-none block rounded-full bg-background ring-0 transition-transform dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground`));g(r,()=>bt,(t,n)=>{n(t,{"data-slot":`switch-thumb`,get class(){return f(e)}})})}v(e,n)},$$slots:{default:!0}}))})}v(e,o),l()}function Q(e,t){let n=t.exec(e);return n?n[1]:void 0}function Ct(e){let t=String.raw`\d+\.\d+\.\d+[^\s]*`,n=new RegExp(String.raw`(?:Target \([^)]*\)|Available):\s*(${t})\s*(?:→|->)\s*(${t})`).exec(e);return{from:Q(e,/Current @selvajs\/selva:\s*v?(\d+\.\d+\.\d+[^\s]*)/)??n?.[1],to:Q(e,/New @selvajs\/selva:\s*v?(\d+\.\d+\.\d+[^\s]*)/)??n?.[2]}}function $(e,t){return e.includes(t)}function wt(e,t){let{from:n,to:r}=Ct(t);if(e===null)return{severity:`pending`,title:`Update in progress…`};if(e===6||$(t,`Manual recovery required`)||$(t,`manual intervention required`))return{severity:`critical`,title:`Update failed AND rollback failed — the app may be OFFLINE`,detail:"Both the new version and the rollback failed their health check. SSH into the server and run: `pm2 logs selva-compute`, then `pm2 start ecosystem.config.cjs` from the deployment directory.",from:n,to:r};if(e===-2)return{severity:`critical`,title:`App did not come back online within 15 minutes`,detail:"The update may still be finishing in the background, or the new process is crash-looping. Check `pm2 logs selva-compute`. Do not re-run the update until you have confirmed the current state.",from:n,to:r};if(e===4)return{severity:`critical`,title:`Update failed and the rollback could not reinstall — the app may be OFFLINE`,detail:"The previous version could not be restored from npm. SSH into the server and run `pm2 logs selva-compute`; if the app is down, reinstall explicitly with `npm install --prefer-online @selvajs/cli@<version> @selvajs/selva@<version>` from the deployment directory.",from:n,to:r};if(e===3)return{severity:`critical`,title:`Update failed its health check and could not be rolled back automatically`,detail:"No prior version was recorded, so the previous build could not be restored. Check `pm2 logs selva-compute` to confirm whether the app came back online.",from:n,to:r};if(e===143||e===130||e===129||$(t,`KILLED`))return{severity:`critical`,title:`Update was killed before it finished — nothing was installed`,detail:"The runner was terminated mid-update, most often by a systemd-supervised PM2 restarting its whole control group. The version on disk is unchanged. Check `pm2 logs selva-compute` and confirm the app is online before retrying; if a global pm2 owns the daemon, reconcile that first.",from:n,to:r};if(e===9||$(t,`SYSTEMD_PM2`))return{severity:`warning`,title:`Update cancelled — PM2 needs a resync that only a shell can do safely. The app is untouched.`,detail:"This deployment's PM2 runs under systemd, where `pm2 update` restarts the unit and kills the update mid-run. Nothing was installed and the app is still serving. SSH in and run `./node_modules/.bin/pm2 update` from the deployment directory, then retry the update here.",from:n,to:r};if(e===10||$(t,`DATA_FORMAT:`)){let e=Q(t,/reads data format (\d+),/),i=Q(t,/this deployment is on format (\d+)\./);return{severity:`warning`,title:`Update cancelled — ${r??`the target version`} cannot read this deployment's data. The app is untouched.`,detail:(e&&i?`It reads data format ${e}; this deployment is on format ${i}. `:``)+`Installing it would leave stored data, such as Compute API keys, unreadable. Switch the release channel back to stay on the installed version. To go back anyway, follow "Going back to an older release" in the admin guide.`,from:n,to:r}}if(e===8||$(t,`PM2_SKEW`)){let e=Q(t,/daemon \(v(\d+\.\d+\.\d+)\)/),i=Q(t,/deployment's pm2 \(v(\d+\.\d+\.\d+)\)/);return{severity:`warning`,title:e&&i?`Update cancelled — a global PM2 (v${e}) owns the daemon, not this deployment's (v${i}). The app is untouched.`:`Update cancelled — a conflicting global PM2 owns the daemon. The app is untouched.`,detail:"Resyncing would have downgraded the daemon and dropped its process table, so the update stopped before taking the app down. On the server: `which -a pm2`, `pm2 -v`, `pm2 ping` — remove or align the global pm2, then retry.",from:n,to:r}}if($(t,`SCHEMA_SKEW`)){let e=Q(t,/expects database migration head (\S+?),/),i=Q(t,/this database is at (\S+?)\./),a=e&&i?` The database is at ${i}; ${r??`it`} needs ${e}.`:``,o=Q(t,/@selvajs\/supabase-provider@([\w.-]+)/)??($(t,`channel: beta`)?`beta`:`latest`);return{severity:`warning`,title:`Update rolled back — the database migrations for ${r??`the new version`} have not been applied.${a} The app is online${n?` on ${n}`:``}.`,detail:`Nothing is wrong with the new version. Selva does not apply migrations during an update, because they cannot be rolled back — auto-migrating and then rolling the code back would leave the app and database on different heads. Apply them on the server, then re-run this update: \`npm install --prefer-online @selvajs/supabase-provider@${o}\`, then \`npx selva-supabase\`, then \`npx supabase db push\`. The provider install is not optional — the migration SQL ships inside that package, and the update only moves @selvajs/cli and @selvajs/selva, so a sync without it copies nothing and the push reports "up to date" having done nothing. Retrying without this will fail in exactly the same way.`,from:n,to:r}}if($(t,`AT_REST_SECRETS`))return{severity:`warning`,title:`Update rolled back — stored compute server keys do not decrypt under this host's SELVA_AT_REST_KEY. The app is online${n?` on ${n}`:``}.`,detail:`This is a configuration problem on the server, not a fault in the new version, so retrying alone will fail identically. Re-enter the affected keys at /admin/compute, or restore the SELVA_AT_REST_KEY the values were encrypted with, then re-run the update.`,from:n,to:r};if(e===5||$(t,`Rolled back`))return{severity:`warning`,title:`Update failed — safely rolled back${n?` to ${n}`:``}. The app is online.`,detail:`The new version failed its health check, so the previous version was restored and is serving normally. Review the log below for why the new version failed before retrying.`,from:n,to:r};if($(t,`ENGINE_MISMATCH`)||$(t,`EBADENGINE`)){let e=Q(t,/requires Node ([^\s]+(?:\s*[<>=]+\s*[\d.]+)*)/),i=Q(t,/this host runs v?(\d+\.\d+\.\d+)/);return{severity:`warning`,title:i?`Updated${r?` to ${r}`:``}, but this release needs Node ${e??`(newer)`} — the host runs v${i}. Expect runtime failures.`:`Updated${r?` to ${r}`:``}, but this release requires a newer Node than the host provides. Expect runtime failures.`,detail:`npm installed it anyway (engine-strict is off) and the health check passed, but it does not exercise the newer APIs — routes that do will throw at request time. Upgrade Node on the server, then re-run the update.`,from:n,to:r}}return $(t,`PM2_RESYNC_NEEDED`)?{severity:`warning`,title:`Updated${r?` to ${r}`:``}, but the pm2 daemon still runs the old pm2.`,detail:"The app is online. On the server, run `npx pm2 update` in the deployment directory, let it finish, then check `npx pm2 list` shows selva-compute online.",from:n,to:r}:$(t,`PM2_PIN_FAILED`)?{severity:`warning`,title:`Updated${r?` to ${r}`:``}, but pm2 stayed on the previous version.`,detail:"The app is online on the old pm2. On the server, run `npx selva migrate` in the deployment directory to move it to the pinned version.",from:n,to:r}:$(t,`npm cache may be stale`)||$(t,`No version change`)?{severity:`warning`,title:`No version change — npm installed the same version.`,detail:"Your npm cache may be stale. On the server: `npm cache clean --force`, remove node_modules + package-lock.json, then `npm install --prefer-online`.",from:n,to:r}:e===0?$(t,`Already on the`)||$(t,`Nothing to do`)?{severity:`info`,title:`Already up to date${n?` (${n})`:``} — nothing to install.`,detail:`No changes were made and the app was not restarted.`,from:n,to:r}:n&&r&&n!==r?{severity:`success`,title:`Updated ${n} → ${r}. The app is back online.`,from:n,to:r}:r?{severity:`success`,title:`Update complete — now on ${r}. The app is back online.`,from:n,to:r}:{severity:`success`,title:`Update completed and the app is back online.`,from:n,to:r}:{severity:`critical`,title:`Update failed (exit code ${e}).`,detail:"The update did not complete cleanly. Review the log below, and check `pm2 logs selva-compute` to confirm whether the app is currently online.",from:n,to:r}}var Tt=_(`<span title="Currently installed @selvajs/selva version"> </span>`),Et=_(`Update @selvajs/* to the latest <span class="font-medium"> </span> release and restart`,1),Dt=_(`<div class="flex items-start justify-between gap-3"><!> <!></div> <!>`,1),Ot=_(`<div class="border-warning/40 bg-warning/10 text-warning flex items-center gap-2 rounded-md border px-3 py-2 text-sm" role="status"><!> <span> <span class="font-mono"> </span> → <span class="font-mono"> </span></span></div>`),kt=_(`<p class="text-muted-foreground text-sm"> <span class="font-mono"> </span>).</p>`),At=_(`<div class="border-destructive/40 bg-destructive/10 text-destructive flex items-start gap-2 rounded-md border px-3 py-3 text-sm" role="alert"><!> <div class="space-y-1"><p class="font-medium">Update blocked — <span class="font-mono"> </span> cannot read this deployment's
2
2
  data</p> <p class="text-muted-foreground text-xs"> </p></div></div>`),jt=_(`<button type="button" class="text-muted-foreground hover:text-foreground text-xs underline underline-offset-2">Override anyway (advanced)</button>`),Mt=_(`<div class="space-y-2"><label class="text-muted-foreground block text-xs" for="node-override">Type <span class="text-foreground font-mono"> </span> to confirm you accept
3
3
  a deployment that may fail under real traffic:</label> <input id="node-override" class="border-input bg-background w-full rounded-md border px-2 py-1 font-mono text-xs" autocomplete="off" spellcheck="false"/></div>`),Nt=_(`<div class="border-destructive/40 bg-destructive/10 space-y-3 rounded-md border px-3 py-3 text-sm" role="alert"><div class="text-destructive flex items-start gap-2"><!> <div class="space-y-1"><p class="font-medium">Update blocked — this release needs a newer Node</p> <p class="text-muted-foreground text-xs"><span class="font-mono"> </span> requires Node <span class="font-mono"> </span>, but this host runs <span class="font-mono"> </span>. npm installs it anyway
4
4
  and the health check still passes, so a failed update would <span class="font-medium">not</span> roll back automatically. Upgrade Node on the server
@@ -1,4 +1,4 @@
1
- import{A as e,D as t,Ft as n,H as r,J as i,K as a,L as o,Ot as s,Pt as c,Q as l,S as u,St as d,T as f,U as p,V as m,_t as h,dt as g,ft as _,h as v,ht as y,it as b,kt as x,lt as S,m as C,mt as w,n as T,ot as E,p as ee,pt as D,q as O,r as k,st as A,v as j,yt as M}from"../chunks/sphvlIzg.js";import{o as N}from"../chunks/BRA_lgsI.js";import{r as P}from"../chunks/Ca-1xMUo.js";import{t as F}from"../chunks/BbFMtSJ8.js";import{t as I}from"../chunks/B9-uqzXO.js";import{t as L}from"../chunks/B187F-XR.js";import{t as te}from"../chunks/DmlEI0uK.js";import{o as ne}from"../chunks/Cms9vBTq.js";import{t as re}from"../chunks/Djv8qD_2.js";import{t as R}from"../chunks/BPWrsj_h.js";import{t as ie}from"../chunks/CXFC38jr.js";import{t as ae}from"../chunks/DtmJiR65.js";import{t as z}from"../chunks/TZzCN567.js";import{t as oe}from"../chunks/1AvDtYi1.js";import{t as B}from"../chunks/D6cAtf8B.js";import{t as se}from"../chunks/CUaHcctM.js";import{n as ce,t as le}from"../chunks/B8LXiPqe.js";import{n as V}from"../chunks/BQmUk61d.js";import{t as ue}from"../chunks/DIYaLgLs.js";import{t as de}from"../chunks/Uzaejkud.js";import{i as H,n as fe,o as pe,r as U,t as W}from"../chunks/Cv8bPnPc.js";import{t as me}from"../chunks/CBf5ToEX.js";var G={name:`ban`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`}],[`path`,{d:`M4.929 4.929 19.07 19.071`}]]};G.node;var K=new Set([`$$slots`,`$$events`,`$$legacy`]);function q(e,t){let n=T(t,K);P(e,k(()=>n,{get icon(){return G}}))}var he=p(`<span class="text-2xs rounded-full bg-amber-500/10 px-2 py-0.5 font-mono whitespace-nowrap text-amber-700 dark:text-amber-400"> </span>`),ge=p(`<span class="bg-muted text-muted-foreground text-2xs rounded-full px-2 py-0.5 font-mono whitespace-nowrap"> </span>`),_e=p(`<!> <!>`,1),J=p(`<div class="mt-1.5 hidden flex-wrap gap-1 sm:flex"><!></div>`),Y=p(`<div class="mt-2 flex flex-wrap gap-1 sm:hidden"><!></div>`),ve=p(`<label><input type="checkbox" class="mt-0.5 shrink-0"/> <div class="min-w-0"><p class="text-sm leading-tight font-medium"> </p> <p class="text-muted-foreground mt-0.5 text-xs"> </p></div></label>`),ye=p(`<p class="text-muted-foreground text-sm">Not a member of the active organization.</p>`),be=p(`<p class="text-muted-foreground text-sm"><strong class="text-foreground capitalize"> </strong> <!></p>`),xe=p(`<div class="mt-4 space-y-4 sm:ml-10"><section><h4 class="text-muted-foreground mb-2 text-xs font-medium tracking-wider uppercase">Platform</h4> <div class="grid gap-2 sm:grid-cols-2"></div></section> <section><h4 class="text-muted-foreground mb-2 text-xs font-medium tracking-wider uppercase">Organization</h4> <!></section></div>`),Se=p(`<div><div class="flex items-center gap-3"><button type="button" class="text-muted-foreground hover:text-foreground shrink-0 rounded-sm p-0.5 pointer-coarse:p-2"><!></button> <!> <!> <!></div> <!> <!></div>`);function Ce(c,u){x(u,!0);let f=e=>{var n=_e(),r=_(n);t(r,16,()=>l(y),e=>e,(e,t)=>{var n=he(),r=D(n,!0);E(()=>o(r,H[t])),m(e,n)});var i=w(r,2);t(i,16,()=>l(h),e=>e,(e,t)=>{var n=ge(),r=D(n,!0);E(()=>o(r,H[t])),m(e,n)}),m(e,n)},p=d(()=>u.user.orgRole===`owner`||u.user.orgRole===`admin`),h=d(()=>l(p)?[]:u.user.orgPermissions),y=d(()=>u.user.platformPermissions.includes(`instance_admin`)?[`instance_admin`]:u.user.platformPermissions),b=d(()=>l(y).length>0||l(h).length>0),S=d(()=>u.user.platformPermissions.includes(`instance_admin`)),T=d(()=>l(S)&&!u.isPlatformAdmin),O=d(()=>l(T)?`Only a platform admin can remove another platform admin.`:u.soleInstanceAdmin?`Cannot remove the only instance admin. Promote another user first.`:null);function k(e){let t=u.user.platformPermissions.includes(e),n=!u.isPlatformAdmin,r=e===`instance_admin`&&u.soleInstanceAdmin;return{checked:t,locked:n||r,soleAdminLock:r,platformLocked:n}}var A=Se(),M=g(A),N=g(M),P=g(N),te=e=>{I(e,{class:`h-4 w-4`})},ne=e=>{L(e,{class:`h-4 w-4`})};e(P,e=>{u.expanded?e(te):e(ne,-1)}),n(N);var re=w(N,2);W(re,{get user(){return u.user},get id(){return u.user.id},get role(){return u.user.orgRole},get disabled(){return u.user.disabled},get lastLoginAt(){return u.user.lastLoginAt},children:(t,i)=>{var a=r(),o=_(a),s=e=>{var t=J(),r=g(t);f(r),n(t),m(e,t)};e(o,e=>{!u.expanded&&l(b)&&e(s)}),m(t,a)},$$slots:{default:!0}});var ie=w(re,2),ae=e=>{{let t=d(()=>u.disabling||!!l(O)),n=d(()=>l(O)??`Disable user — they keep their history but cannot sign in`);F(e,{size:`sm`,variant:`ghost`,get disabled(){return l(t)},get onclick(){return u.onDisable},get title(){return l(n)},class:`text-muted-foreground hover:text-foreground h-8 w-8 shrink-0 p-0`,children:(e,t)=>{q(e,{class:`h-4 w-4`})},$$slots:{default:!0}})}};e(ie,e=>{u.user.disabled||e(ae)});var z=w(ie,2);{let e=d(()=>u.deleting||!!l(O)),t=d(()=>l(O)??`Delete user`);F(z,{size:`sm`,variant:`ghost`,get disabled(){return l(e)},get onclick(){return u.onDelete},get title(){return l(t)},class:`text-destructive hover:text-destructive h-8 w-8 shrink-0 p-0`,children:(e,t)=>{R(e,{class:`h-4 w-4`})},$$slots:{default:!0}})}n(M);var oe=w(M,2),B=e=>{var t=Y(),r=g(t);f(r),n(t),m(e,t)};e(oe,e=>{!u.expanded&&l(b)&&e(B)});var se=w(oe,2),ce=r=>{var s=xe(),c=g(s),f=w(g(c),2);t(f,20,()=>me,e=>e,(e,t)=>{let r=d(()=>k(t));var a=ve(),s=g(a);ee(s);var c=w(s,2),f=g(c),p=D(f,!0),h=w(f,2),_=D(h,!0);n(c),n(a),E(()=>{j(a,1,`flex items-start gap-2 rounded-md border p-2.5 ${l(r).locked?`border-border cursor-not-allowed opacity-60`:`border-border hover:bg-hover cursor-pointer`}`),C(a,`title`,l(r).soleAdminLock?`Cannot remove the only instance admin.`:void 0),v(s,l(r).checked),s.disabled=u.updating||l(r).locked,o(p,H[t]),o(_,U[t])}),i(`change`,s,e=>u.onTogglePermission(t,e.target.checked)),m(e,a)}),n(f),n(c);var h=w(c,2),_=w(g(h),2),y=e=>{var t=ye();m(e,t)},b=t=>{var r=be(),i=g(r),s=D(i,!0),c=w(i,2),d=e=>{var t=a(`— every organization permission.`);m(e,t)},f=e=>{var t=a();E(e=>o(t,`— ${e??``}.`),[()=>u.user.orgPermissions.map(e=>H[e]).join(`, `)]),m(e,t)},h=e=>{var t=a(`— no organization permissions granted.`);m(e,t)};e(c,e=>{l(p)?e(d):u.user.orgPermissions.length>0?e(f,1):e(h,-1)}),n(r),E(()=>o(s,u.user.orgRole)),m(t,r)};e(_,e=>{u.user.orgRole?e(b,-1):e(y)}),n(h),n(s),m(r,s)};e(se,e=>{u.expanded&&e(ce)}),n(A),E(()=>{j(A,1,`px-4 py-3 ${u.expanded?`bg-selected`:``}`),C(N,`aria-label`,u.expanded?`Collapse permissions`:`Expand permissions`)}),i(`click`,N,function(...e){u.onToggleExpand?.apply(this,e)}),m(c,A),s()}O([`click`,`change`]);var we=p(`<!> Allowlist user`,1),Te=p(`<!> Members &amp; roles`,1),Ee=p(`<p><strong>Instance permissions</strong> (the badges below) apply to the whole server and are what
1
+ import{A as e,D as t,Ft as n,H as r,J as i,K as a,L as o,Ot as s,Pt as c,Q as l,S as u,St as d,T as f,U as p,V as m,_t as h,dt as g,ft as _,h as v,ht as y,it as b,kt as x,lt as S,m as C,mt as w,n as T,ot as E,p as ee,pt as D,q as O,r as k,st as A,v as j,yt as M}from"../chunks/sphvlIzg.js";import{s as N}from"../chunks/B3e8ZKjr.js";import{r as P}from"../chunks/Ca-1xMUo.js";import{t as F}from"../chunks/BbFMtSJ8.js";import{t as I}from"../chunks/B9-uqzXO.js";import{t as L}from"../chunks/B187F-XR.js";import{t as te}from"../chunks/DmlEI0uK.js";import{o as ne}from"../chunks/Cms9vBTq.js";import{t as re}from"../chunks/Djv8qD_2.js";import{t as R}from"../chunks/BPWrsj_h.js";import{t as ie}from"../chunks/CXFC38jr.js";import{t as ae}from"../chunks/DtmJiR65.js";import{t as z}from"../chunks/TZzCN567.js";import{t as oe}from"../chunks/1AvDtYi1.js";import{t as B}from"../chunks/D6cAtf8B.js";import{t as se}from"../chunks/CUaHcctM.js";import{n as ce,t as le}from"../chunks/B8LXiPqe.js";import{n as V}from"../chunks/BQmUk61d.js";import{t as ue}from"../chunks/DIYaLgLs.js";import{t as de}from"../chunks/Uzaejkud.js";import{i as H,n as fe,o as pe,r as U,t as W}from"../chunks/Cv8bPnPc.js";import{t as me}from"../chunks/CBf5ToEX.js";var G={name:`ban`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`}],[`path`,{d:`M4.929 4.929 19.07 19.071`}]]};G.node;var K=new Set([`$$slots`,`$$events`,`$$legacy`]);function q(e,t){let n=T(t,K);P(e,k(()=>n,{get icon(){return G}}))}var he=p(`<span class="text-2xs rounded-full bg-amber-500/10 px-2 py-0.5 font-mono whitespace-nowrap text-amber-700 dark:text-amber-400"> </span>`),ge=p(`<span class="bg-muted text-muted-foreground text-2xs rounded-full px-2 py-0.5 font-mono whitespace-nowrap"> </span>`),_e=p(`<!> <!>`,1),J=p(`<div class="mt-1.5 hidden flex-wrap gap-1 sm:flex"><!></div>`),Y=p(`<div class="mt-2 flex flex-wrap gap-1 sm:hidden"><!></div>`),ve=p(`<label><input type="checkbox" class="mt-0.5 shrink-0"/> <div class="min-w-0"><p class="text-sm leading-tight font-medium"> </p> <p class="text-muted-foreground mt-0.5 text-xs"> </p></div></label>`),ye=p(`<p class="text-muted-foreground text-sm">Not a member of the active organization.</p>`),be=p(`<p class="text-muted-foreground text-sm"><strong class="text-foreground capitalize"> </strong> <!></p>`),xe=p(`<div class="mt-4 space-y-4 sm:ml-10"><section><h4 class="text-muted-foreground mb-2 text-xs font-medium tracking-wider uppercase">Platform</h4> <div class="grid gap-2 sm:grid-cols-2"></div></section> <section><h4 class="text-muted-foreground mb-2 text-xs font-medium tracking-wider uppercase">Organization</h4> <!></section></div>`),Se=p(`<div><div class="flex items-center gap-3"><button type="button" class="text-muted-foreground hover:text-foreground shrink-0 rounded-sm p-0.5 pointer-coarse:p-2"><!></button> <!> <!> <!></div> <!> <!></div>`);function Ce(c,u){x(u,!0);let f=e=>{var n=_e(),r=_(n);t(r,16,()=>l(y),e=>e,(e,t)=>{var n=he(),r=D(n,!0);E(()=>o(r,H[t])),m(e,n)});var i=w(r,2);t(i,16,()=>l(h),e=>e,(e,t)=>{var n=ge(),r=D(n,!0);E(()=>o(r,H[t])),m(e,n)}),m(e,n)},p=d(()=>u.user.orgRole===`owner`||u.user.orgRole===`admin`),h=d(()=>l(p)?[]:u.user.orgPermissions),y=d(()=>u.user.platformPermissions.includes(`instance_admin`)?[`instance_admin`]:u.user.platformPermissions),b=d(()=>l(y).length>0||l(h).length>0),S=d(()=>u.user.platformPermissions.includes(`instance_admin`)),T=d(()=>l(S)&&!u.isPlatformAdmin),O=d(()=>l(T)?`Only a platform admin can remove another platform admin.`:u.soleInstanceAdmin?`Cannot remove the only instance admin. Promote another user first.`:null);function k(e){let t=u.user.platformPermissions.includes(e),n=!u.isPlatformAdmin,r=e===`instance_admin`&&u.soleInstanceAdmin;return{checked:t,locked:n||r,soleAdminLock:r,platformLocked:n}}var A=Se(),M=g(A),N=g(M),P=g(N),te=e=>{I(e,{class:`h-4 w-4`})},ne=e=>{L(e,{class:`h-4 w-4`})};e(P,e=>{u.expanded?e(te):e(ne,-1)}),n(N);var re=w(N,2);W(re,{get user(){return u.user},get id(){return u.user.id},get role(){return u.user.orgRole},get disabled(){return u.user.disabled},get lastLoginAt(){return u.user.lastLoginAt},children:(t,i)=>{var a=r(),o=_(a),s=e=>{var t=J(),r=g(t);f(r),n(t),m(e,t)};e(o,e=>{!u.expanded&&l(b)&&e(s)}),m(t,a)},$$slots:{default:!0}});var ie=w(re,2),ae=e=>{{let t=d(()=>u.disabling||!!l(O)),n=d(()=>l(O)??`Disable user — they keep their history but cannot sign in`);F(e,{size:`sm`,variant:`ghost`,get disabled(){return l(t)},get onclick(){return u.onDisable},get title(){return l(n)},class:`text-muted-foreground hover:text-foreground h-8 w-8 shrink-0 p-0`,children:(e,t)=>{q(e,{class:`h-4 w-4`})},$$slots:{default:!0}})}};e(ie,e=>{u.user.disabled||e(ae)});var z=w(ie,2);{let e=d(()=>u.deleting||!!l(O)),t=d(()=>l(O)??`Delete user`);F(z,{size:`sm`,variant:`ghost`,get disabled(){return l(e)},get onclick(){return u.onDelete},get title(){return l(t)},class:`text-destructive hover:text-destructive h-8 w-8 shrink-0 p-0`,children:(e,t)=>{R(e,{class:`h-4 w-4`})},$$slots:{default:!0}})}n(M);var oe=w(M,2),B=e=>{var t=Y(),r=g(t);f(r),n(t),m(e,t)};e(oe,e=>{!u.expanded&&l(b)&&e(B)});var se=w(oe,2),ce=r=>{var s=xe(),c=g(s),f=w(g(c),2);t(f,20,()=>me,e=>e,(e,t)=>{let r=d(()=>k(t));var a=ve(),s=g(a);ee(s);var c=w(s,2),f=g(c),p=D(f,!0),h=w(f,2),_=D(h,!0);n(c),n(a),E(()=>{j(a,1,`flex items-start gap-2 rounded-md border p-2.5 ${l(r).locked?`border-border cursor-not-allowed opacity-60`:`border-border hover:bg-hover cursor-pointer`}`),C(a,`title`,l(r).soleAdminLock?`Cannot remove the only instance admin.`:void 0),v(s,l(r).checked),s.disabled=u.updating||l(r).locked,o(p,H[t]),o(_,U[t])}),i(`change`,s,e=>u.onTogglePermission(t,e.target.checked)),m(e,a)}),n(f),n(c);var h=w(c,2),_=w(g(h),2),y=e=>{var t=ye();m(e,t)},b=t=>{var r=be(),i=g(r),s=D(i,!0),c=w(i,2),d=e=>{var t=a(`— every organization permission.`);m(e,t)},f=e=>{var t=a();E(e=>o(t,`— ${e??``}.`),[()=>u.user.orgPermissions.map(e=>H[e]).join(`, `)]),m(e,t)},h=e=>{var t=a(`— no organization permissions granted.`);m(e,t)};e(c,e=>{l(p)?e(d):u.user.orgPermissions.length>0?e(f,1):e(h,-1)}),n(r),E(()=>o(s,u.user.orgRole)),m(t,r)};e(_,e=>{u.user.orgRole?e(b,-1):e(y)}),n(h),n(s),m(r,s)};e(se,e=>{u.expanded&&e(ce)}),n(A),E(()=>{j(A,1,`px-4 py-3 ${u.expanded?`bg-selected`:``}`),C(N,`aria-label`,u.expanded?`Collapse permissions`:`Expand permissions`)}),i(`click`,N,function(...e){u.onToggleExpand?.apply(this,e)}),m(c,A),s()}O([`click`,`change`]);var we=p(`<!> Allowlist user`,1),Te=p(`<!> Members &amp; roles`,1),Ee=p(`<p><strong>Instance permissions</strong> (the badges below) apply to the whole server and are what
2
2
  gets you into this admin area. Edit them here.</p> <p class="mt-1.5"><strong>Org roles</strong> apply inside one organization: owners and admins can do
3
3
  everything in theirs, members can do nothing until you grant them a permission. Edit them at <a href="/team/members">Members &amp; roles</a>.</p>`,1),De=p(`<label class="flex cursor-pointer items-center gap-1.5 text-xs"><input type="checkbox"/> </label>`),Oe=p(`<div><p class="mb-2 text-xs font-medium">Instance permissions</p> <p class="text-muted-foreground mb-2 text-xs">Apply across the whole instance. The user joins the active organization as a <span class="font-mono">member</span>; grant them access there from <a href="/team/members" class="underline">Members &amp; roles</a>.</p> <div class="flex flex-wrap gap-3"></div></div>`),ke=p(`<p class="text-muted-foreground text-xs">The user joins the active organization as a <span class="font-mono">member</span>.
4
4
  Grant them access from <a href="/team/members" class="underline">Members &amp; roles</a>.</p>`),Ae=p(`<div class="bg-raised shadow-raised space-y-3 rounded-lg border p-4"><p class="text-sm font-medium">New User</p> <!> <p class="text-muted-foreground text-xs"> </p> <!> <div class="flex gap-2"><!> <!></div></div>`),je=p(`Set <code class="text-xs">DATA_PATH</code> (local provider) or check your provider
@@ -1 +1 @@
1
- import{H as e,Lt as t,Ot as n,P as r,Q as i,St as a,V as o,ft as s,kt as c}from"../chunks/sphvlIzg.js";import{t as l}from"../chunks/85w20NVU.js";import{t as u}from"../chunks/CoLPPvYz.js";import{t as d}from"../chunks/rIQJtl5L.js";import{t as f}from"../chunks/BFXrROAz.js";import{t as p}from"../chunks/34Sd6e9o.js";import{t as m}from"../chunks/1VJx1aVI.js";import{t as h}from"../chunks/C9yuuH4J.js";import{t as g}from"../chunks/CXFC38jr.js";import{t as _}from"../chunks/BkTC9VdY.js";import{t as v}from"../chunks/C3KJF0qD.js";function y(y,b){c(b,!0);let x=e=>b.data.platformPermissions.includes(`instance_admin`)||b.data.platformPermissions.includes(e)?!0:b.data.orgPermissions.includes(e),S=a(()=>[{href:`/admin`,label:`General`,icon:d,show:!0},{href:`/admin/organizations`,label:`Organizations`,icon:l,match:`prefix`,show:x(`instance_admin`)&&b.data.tenancy!==`single`},{href:`/admin/projects`,label:`Projects`,icon:u,match:`prefix`,show:x(`instance_admin`)&&b.data.platformProjectsEnabled},{href:`/admin/users`,label:`Users`,icon:g,match:`prefix`,show:x(`manage_instance_users`)},{href:`/admin/compute`,label:`Compute`,icon:m,match:`prefix`,show:x(`manage_compute`)},{href:`/admin/system`,label:`System`,icon:h,match:`prefix`,show:x(`manage_updates`)},{href:`/admin/audit`,label:`Audit log`,icon:p,match:`prefix`,show:x(`instance_admin`)&&b.data.auditAvailable}].filter(e=>e.show));f(y,{sidenav:e=>{v(e,{get items(){return i(S)},eyebrow:`Platform`,border:!1})},children:(n,i)=>{_(n,{children:(n,i)=>{var a=e(),c=s(a);r(c,()=>b.children??t),o(n,a)},$$slots:{default:!0}})},$$slots:{sidenav:!0,default:!0}}),n()}export{y as component};
1
+ import{H as e,Lt as t,Ot as n,P as r,Q as i,St as a,V as o,ft as s,kt as c}from"../chunks/sphvlIzg.js";import{t as l}from"../chunks/85w20NVU.js";import{t as u}from"../chunks/CoLPPvYz.js";import{t as d}from"../chunks/rIQJtl5L.js";import{t as f}from"../chunks/DEthS42j.js";import{t as p}from"../chunks/34Sd6e9o.js";import{t as m}from"../chunks/1VJx1aVI.js";import{t as h}from"../chunks/C9yuuH4J.js";import{t as g}from"../chunks/CXFC38jr.js";import{t as _}from"../chunks/BkTC9VdY.js";import{t as v}from"../chunks/B7agp_uZ.js";function y(y,b){c(b,!0);let x=e=>b.data.platformPermissions.includes(`instance_admin`)||b.data.platformPermissions.includes(e)?!0:b.data.orgPermissions.includes(e),S=a(()=>[{href:`/admin`,label:`General`,icon:d,show:!0},{href:`/admin/organizations`,label:`Organizations`,icon:l,match:`prefix`,show:x(`instance_admin`)&&b.data.tenancy!==`single`},{href:`/admin/projects`,label:`Projects`,icon:u,match:`prefix`,show:x(`instance_admin`)&&b.data.platformProjectsEnabled},{href:`/admin/users`,label:`Users`,icon:g,match:`prefix`,show:x(`manage_instance_users`)},{href:`/admin/compute`,label:`Compute`,icon:m,match:`prefix`,show:x(`manage_compute`)},{href:`/admin/system`,label:`System`,icon:h,match:`prefix`,show:x(`manage_updates`)},{href:`/admin/audit`,label:`Audit log`,icon:p,match:`prefix`,show:x(`instance_admin`)&&b.data.auditAvailable}].filter(e=>e.show));f(y,{sidenav:e=>{v(e,{get items(){return i(S)},eyebrow:`Platform`,border:!1})},children:(n,i)=>{_(n,{children:(n,i)=>{var a=e(),c=s(a);r(c,()=>b.children??t),o(n,a)},$$slots:{default:!0}})},$$slots:{sidenav:!0,default:!0}}),n()}export{y as component};
@@ -1,2 +1,2 @@
1
- import{A as e,D as t,Ft as n,H as r,J as i,L as a,Ot as o,Pt as s,Q as c,St as l,U as u,V as d,_ as f,_t as p,dt as m,ft as h,kt as g,m as _,mt as v,n as y,ot as b,pt as x,q as S,r as C,t as w,v as T,y as E,yt as D}from"../chunks/sphvlIzg.js";import{o as O,r as k}from"../chunks/BRA_lgsI.js";import{r as A}from"../chunks/Ca-1xMUo.js";import{t as j}from"../chunks/lMQbJOeE.js";import{a as M,c as N,o as P,s as F,t as I}from"../chunks/Cv7GBWJh.js";import{t as L}from"../chunks/BFXrROAz.js";import{t as R}from"../chunks/CoB4qHba.js";import{t as z}from"../chunks/DtmJiR65.js";import{t as B}from"../chunks/TZzCN567.js";import{t as V}from"../chunks/BkTC9VdY.js";import{t as ee}from"../chunks/1AvDtYi1.js";import{t as H}from"../chunks/D6cAtf8B.js";import{t as te}from"../chunks/DR4HRB4w.js";import{n as ne}from"../chunks/BQmUk61d.js";var U={name:`funnel`,size:24,node:[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`}]],aliases:[`filter`]};U.node;var W=new Set([`$$slots`,`$$events`,`$$legacy`]);function re(e,t){let n=y(t,W);A(e,C(()=>n,{get icon(){return U}}))}var G=u(`<button type="button"><!></button>`);function K(e,t){g(t,!0);let r=w(t,`busy`,3,!1),a=w(t,`variant`,3,`overlay`);var s=G(),u=m(s);{let e=l(()=>t.starred?`fill-current`:``);R(u,{get class(){return`h-3.5 w-3.5 ${c(e)??``}`}})}n(s),b(()=>{_(s,`title`,t.starred?`Unstar`:`Star`),_(s,`aria-label`,t.starred?`Unstar definition`:`Star definition`),_(s,`aria-pressed`,t.starred),s.disabled=r(),T(s,1,E(a()===`overlay`?`absolute top-2 right-2 flex h-7 w-7 items-center justify-center rounded-full backdrop-blur-sm transition-all disabled:opacity-60 ${t.starred?`bg-amber-400/90 text-white`:`bg-black/40 text-white opacity-0 group-hover:opacity-100 hover:bg-black/55 pointer-coarse:opacity-100`}`:`flex h-7 w-7 items-center justify-center rounded-full transition-colors disabled:opacity-60 ${t.starred?`text-amber-500 hover:bg-amber-50`:`text-muted-foreground hover:text-foreground hover:bg-hover`}`))}),i(`click`,s,e=>{e.stopPropagation(),e.preventDefault(),t.onToggle()}),d(e,s),o()}S([`click`]);var q=u(`<div class="flex h-10 w-10 shrink-0 items-center justify-center overflow-hidden rounded-md"><img alt="" class="h-full w-full object-cover"/></div>`),J=u(`<div class="tool-cover-fallback flex h-10 w-10 shrink-0 items-center justify-center overflow-hidden rounded-md"><span class="text-faint-foreground text-base font-semibold"> </span></div>`),Y=u(`<p class="text-muted-foreground truncate text-[12px]"> </p>`),X=u(`<span class="bg-muted text-muted-foreground rounded-sm px-1.5 py-px font-mono text-[10.5px]"> </span>`),Z=u(`<button type="button"><!> <div class="min-w-0"><p class="truncate text-[13.5px] font-semibold"> </p> <!></div> <div class="hidden flex-wrap items-center gap-1 sm:flex"><!></div> <span class="text-muted-foreground hidden font-mono text-[12px] sm:inline"> </span> <div class="flex items-center justify-end gap-1"><!> <!></div></button>`),Q=u(`<div class="border-border bg-card overflow-hidden rounded-xl border"></div>`);function ie(s,u){g(u,!0);var p=Q();t(p,23,()=>u.records,e=>e.guid,(o,s,p)=>{var g=Z(),y=m(g),S=e=>{var t=q(),n=x(t);b(()=>_(n,`src`,c(s).coverImage)),d(e,t)},C=e=>{let t=l(()=>P(c(s).guid));var r=J();let i;var o=m(r),u=x(o,!0);n(r),b(e=>{i=f(r,``,i,{"--tool-h1":c(t).h1,"--tool-h2":c(t).h2}),a(u,e)},[()=>F(c(s).displayName)]),d(e,r)};e(y,e=>{c(s).coverImage?e(S):e(C,-1)});var w=v(y,2),E=m(w),D=x(E,!0),O=v(E,2),k=e=>{var t=Y(),n=x(t,!0);b(()=>a(n,c(s).description)),d(e,t)};e(O,e=>{c(s).description&&e(k)}),n(w);var A=v(w,2),M=m(A),N=e=>{var n=r(),i=h(n);t(i,16,()=>c(s).tags.slice(0,3),e=>e,(e,t)=>{var n=X(),r=x(n);b(()=>a(r,`#${t??``}`)),d(e,n)}),d(e,n)};e(M,e=>{c(s).tags?.length&&e(N)}),n(A);var I=v(A,2),L=x(I,!0),R=v(I,2),z=m(R);{let e=l(()=>u.starredIds.has(c(s).guid)),t=l(()=>u.starBusyGuid===c(s).guid);K(z,{get starred(){return c(e)},get busy(){return c(t)},variant:`chip`,onToggle:()=>u.onToggleStar(c(s).guid)})}var B=v(z,2);j(B,{class:`text-muted-foreground h-3.5 w-3.5 opacity-0 transition-opacity group-hover:opacity-100 pointer-coarse:opacity-100`}),n(R),n(g),b(e=>{g.disabled=u.loadingGuid===c(s).guid,T(g,1,`hover:bg-hover group grid w-full items-center gap-4 px-4 py-3 text-left transition-colors disabled:cursor-not-allowed disabled:opacity-60
2
- grid-cols-[40px_minmax(0,1fr)_auto] sm:grid-cols-[40px_minmax(0,1.7fr)_minmax(0,1fr)_90px_36px] ${c(p)<u.records.length-1?`border-border border-b`:``}`),a(D,c(s).displayName),a(L,e)},[()=>c(s).solveCount>0?`${c(s).solveCount.toLocaleString()} runs`:`—`]),i(`click`,g,()=>u.onOpen(c(s).guid)),d(o,g)}),n(p),d(s,p),o()}S([`click`]);var ae=u(`<span class="bg-primary text-primary-foreground rounded-full px-1.5 py-px font-mono text-[10px]"> </span>`),oe=u(`<button type="button"><!> Filters <!></button>`),se=u(`<button type="button" class="text-muted-foreground hover:text-foreground inline-flex h-9 items-center gap-1 rounded-md px-2 text-xs transition-colors"><!> Clear</button>`),ce=u(`<div class="space-y-1.5"><label class="text-muted-foreground text-xs font-medium" for="filter-project">Project</label> <!></div>`),le=u(`<div class="space-y-1.5"><label class="text-muted-foreground text-xs font-medium" for="filter-category">Category</label> <!></div>`),ue=u(`<div class="space-y-1.5"><label class="text-muted-foreground text-xs font-medium" for="filter-tag">Tag</label> <!></div>`),de=u(`<div class="border-border bg-card rounded-md border p-4"><div class="grid gap-4 sm:grid-cols-3"><!> <!> <!></div></div>`),fe=u(`<button style="grid-template-columns: minmax(0, 1fr) auto auto"><span class="truncate font-medium"> </span> <span class="text-muted-foreground font-mono text-xs"> </span> <span class="flex items-center gap-1 text-xs font-medium opacity-0 transition-opacity group-hover:opacity-100 pointer-coarse:opacity-100"><span class="hidden sm:inline">Resume</span> <!></span></button>`),pe=u(`<section><div class="mb-3 flex items-baseline justify-between"><span class="text-muted-foreground text-xs font-medium tracking-wider uppercase">Recent runs</span> <span class="text-muted-foreground text-xs">Resume where you left off</span></div> <div class="border-border bg-card overflow-hidden rounded-md border"></div></section>`),me=u(`<div class="grid gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4"></div>`),he=u(`<button class="text-muted-foreground hover:text-foreground text-xs underline underline-offset-2">Clear all filters</button>`),ge=u(`<div class="space-y-6"><!> <div class="flex flex-wrap items-center gap-2"><div class="min-w-60 flex-1"><!></div> <!> <!></div> <!> <!> <!></div>`);function $(u,f){g(f,!0);let _=D(``),y=D(null),S=D(null),C=D(null),w=D(`grid`),E=D(null),A=D(null),P=D(!1),F=l(()=>new Set(f.data.starredRecords.map(e=>e.guid))),R=l(()=>[...f.data.starredRecords,...f.data.records]),U=l(()=>new Set(c(R).map(e=>e.projectId))),W=l(()=>Object.values(f.data.projects).filter(e=>c(U).has(e.id))),G=l(()=>Array.from(new Set(c(R).map(e=>e.category).filter(e=>!!e))).sort()),K=l(()=>Array.from(new Set(c(R).flatMap(e=>e.tags??[]))).sort());function q(e){return f.data.projects[e]?.name??``}function J(e){return f.data.projectMap[e]?.visibility}function Y(e){if(c(y)&&e.projectId!==c(y)||c(S)&&e.category!==c(S)||c(C)&&!(e.tags??[]).includes(c(C)))return!1;if(c(_).trim()){let t=c(_).toLowerCase();if(![e.displayName,e.description,e.category,...e.tags??[]].filter(Boolean).join(` `).toLowerCase().includes(t))return!1}return!0}let X=l(()=>c(R).filter(Y)),Z=l(()=>[c(y),c(S),c(C)].filter(e=>e!==null).length),Q=l(()=>c(_).trim()!==``||c(Z)>0);function $(e){p(E,e,!0),k(`/library/${e}`).catch(()=>{p(E,null)})}async function _e(e){p(A,e,!0);let t=c(F).has(e);try{let n=await fetch(`/api/v1/me/starred/${e}`,{method:t?`DELETE`:`PUT`});if(!n.ok)throw Error(`${n.status}`);await O()}catch{ne.error(t?`Failed to unstar`:`Failed to star`)}finally{p(A,null)}}function ve(){p(_,``),p(y,null),p(S,null),p(C,null),p(P,!1)}L(u,{children:(o,u)=>{V(o,{children:(o,u)=>{var g=ge(),D=m(g);{let e=e=>{N(e,{get mode(){return c(w)},onChange:e=>p(w,e,!0)})},t=l(()=>`${c(X).length} tool${c(X).length===1?``:`s`}${c(W).length>0?` across ${c(W).length} project${c(W).length===1?``:`s`}`:``}.`);ee(D,{eyebrow:`Workspace`,title:`Library`,get description(){return c(t)},actions:e,$$slots:{actions:!0}})}var O=v(D,2),k=m(O),L=m(k);te(L,{placeholder:`Search tools, descriptions, tags…`,clearable:!0,class:`h-9 rounded-md text-sm`,get value(){return c(_)},set value(e){p(_,e,!0)}}),n(k);var R=v(k,2),V=t=>{var r=oe(),o=m(r);re(o,{class:`h-3.5 w-3.5`});var s=v(o,2),l=e=>{var t=ae(),n=x(t,!0);b(()=>a(n,c(Z))),d(e,t)};e(s,e=>{c(Z)>0&&e(l)}),n(r),b(()=>T(r,1,`relative inline-flex h-9 items-center gap-1.5 rounded-md border px-3 text-sm transition-colors ${c(P)||c(Z)>0?`border-border bg-selected text-foreground`:`border-input bg-background text-foreground hover:bg-hover`}`)),i(`click`,r,()=>p(P,!c(P))),d(t,r)};e(R,e=>{(c(G).length>0||c(K).length>0||c(W).length>1)&&e(V)});var ne=v(R,2),U=e=>{var t=se(),r=m(t);z(r,{class:`h-3 w-3`}),s(),n(t),i(`click`,t,ve),d(e,t)};e(ne,e=>{c(Q)&&e(U)}),n(O);var Y=v(O,2),ye=t=>{var r=de(),i=m(r),a=m(i),o=e=>{var t=ce(),r=v(m(t),2);{let e=l(()=>[{id:``,label:`All projects`},...c(W).map(e=>({id:e.id,label:e.name}))]),t=l(()=>c(y)??``);B(r,{id:`filter-project`,get items(){return c(e)},get value(){return c(t)},onChange:e=>p(y,e||null,!0),size:`sm`})}n(t),d(e,t)};e(a,e=>{c(W).length>1&&e(o)});var s=v(a,2),u=e=>{var t=le(),r=v(m(t),2);{let e=l(()=>[{id:``,label:`All categories`},...c(G).map(e=>({id:e,label:e}))]),t=l(()=>c(S)??``);B(r,{id:`filter-category`,get items(){return c(e)},get value(){return c(t)},onChange:e=>p(S,e||null,!0),size:`sm`})}n(t),d(e,t)};e(s,e=>{c(G).length>0&&e(u)});var f=v(s,2),h=e=>{var t=ue(),r=v(m(t),2);{let e=l(()=>[{id:``,label:`All tags`},...c(K).map(e=>({id:e,label:`#${e}`}))]),t=l(()=>c(C)??``);B(r,{id:`filter-tag`,get items(){return c(e)},get value(){return c(t)},onChange:e=>p(C,e||null,!0),size:`sm`})}n(t),d(e,t)};e(f,e=>{c(K).length>0&&e(h)}),n(i),n(r),d(t,r)};e(Y,e=>{c(P)&&e(ye)});var be=v(Y,2),xe=e=>{var r=pe(),o=v(m(r),2);t(o,23,()=>f.data.recentRuns.slice(0,5),e=>e.runId,(e,t,r)=>{var o=fe(),s=m(o),l=x(s,!0),u=v(s,2),p=x(u,!0),h=v(u,2),g=v(m(h),2);j(g,{class:`h-3 w-3`}),n(h),n(o),b((e,n)=>{o.disabled=c(E)===c(t).definitionId,T(o,1,e),a(l,c(t).definitionName),a(p,n)},[()=>`group hover:bg-hover grid w-full items-center gap-4 px-4 py-3 text-left text-sm transition-colors disabled:cursor-not-allowed disabled:opacity-60 ${c(r)<Math.min(f.data.recentRuns.length,5)-1?`border-border border-b`:``}`,()=>M(c(t).timestamp)]),i(`click`,o,()=>$(c(t).definitionId)),d(e,o)}),n(o),n(r),d(e,r)};e(be,e=>{f.data.recentRuns.length>0&&!c(Q)&&e(xe)});var Se=v(be,2),Ce=i=>{var a=r(),o=h(a),s=e=>{var r=me();t(r,21,()=>c(X),e=>e.guid,(e,t)=>{{let n=l(()=>c(F).has(c(t).guid)),r=l(()=>c(E)===c(t).guid),i=l(()=>c(A)===c(t).guid),a=l(()=>c(W).length>1?q(c(t).projectId):void 0),o=l(()=>c(W).length>1?J(c(t).projectId):void 0);I(e,{get record(){return c(t)},get starred(){return c(n)},get loading(){return c(r)},get starBusy(){return c(i)},get projectName(){return c(a)},get projectVisibility(){return c(o)},onOpen:e=>$(e.guid),onToggleStar:_e})}}),n(r),d(e,r)},u=e=>{ie(e,{get records(){return c(X)},get starredIds(){return c(F)},get loadingGuid(){return c(E)},get starBusyGuid(){return c(A)},onOpen:$,onToggleStar:_e})};e(o,e=>{c(w)===`grid`?e(s):e(u,-1)}),d(i,a)},we=e=>{H(e,{size:`lg`,title:`No tools match your filters`,actions:e=>{var t=he();i(`click`,t,ve),d(e,t)},$$slots:{actions:!0}})},Te=e=>{H(e,{size:`lg`,title:`No tools available yet`,description:`Ask an admin to publish a Grasshopper definition.`})};e(Se,e=>{c(X).length>0?e(Ce):c(Q)?e(we,1):e(Te,-1)}),n(g),d(o,g)},$$slots:{default:!0}})},$$slots:{default:!0}}),o()}S([`click`]);export{$ as component};
1
+ import{A as e,D as t,Ft as n,H as r,J as i,L as a,Ot as o,Pt as s,Q as c,St as l,U as u,V as d,_ as f,_t as p,dt as m,ft as h,kt as g,m as _,mt as v,n as y,ot as b,pt as x,q as S,r as C,t as w,v as T,y as E,yt as D}from"../chunks/sphvlIzg.js";import{r as O,s as k}from"../chunks/B3e8ZKjr.js";import{r as A}from"../chunks/Ca-1xMUo.js";import{t as j}from"../chunks/lMQbJOeE.js";import{a as M,c as N,o as P,s as F,t as I}from"../chunks/Cv7GBWJh.js";import{t as L}from"../chunks/DEthS42j.js";import{t as R}from"../chunks/CoB4qHba.js";import{t as z}from"../chunks/DtmJiR65.js";import{t as B}from"../chunks/TZzCN567.js";import{t as V}from"../chunks/BkTC9VdY.js";import{t as ee}from"../chunks/1AvDtYi1.js";import{t as H}from"../chunks/D6cAtf8B.js";import{t as te}from"../chunks/DR4HRB4w.js";import{n as ne}from"../chunks/BQmUk61d.js";var U={name:`funnel`,size:24,node:[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`}]],aliases:[`filter`]};U.node;var W=new Set([`$$slots`,`$$events`,`$$legacy`]);function re(e,t){let n=y(t,W);A(e,C(()=>n,{get icon(){return U}}))}var G=u(`<button type="button"><!></button>`);function K(e,t){g(t,!0);let r=w(t,`busy`,3,!1),a=w(t,`variant`,3,`overlay`);var s=G(),u=m(s);{let e=l(()=>t.starred?`fill-current`:``);R(u,{get class(){return`h-3.5 w-3.5 ${c(e)??``}`}})}n(s),b(()=>{_(s,`title`,t.starred?`Unstar`:`Star`),_(s,`aria-label`,t.starred?`Unstar definition`:`Star definition`),_(s,`aria-pressed`,t.starred),s.disabled=r(),T(s,1,E(a()===`overlay`?`absolute top-2 right-2 flex h-7 w-7 items-center justify-center rounded-full backdrop-blur-sm transition-all disabled:opacity-60 ${t.starred?`bg-amber-400/90 text-white`:`bg-black/40 text-white opacity-0 group-hover:opacity-100 hover:bg-black/55 pointer-coarse:opacity-100`}`:`flex h-7 w-7 items-center justify-center rounded-full transition-colors disabled:opacity-60 ${t.starred?`text-amber-500 hover:bg-amber-50`:`text-muted-foreground hover:text-foreground hover:bg-hover`}`))}),i(`click`,s,e=>{e.stopPropagation(),e.preventDefault(),t.onToggle()}),d(e,s),o()}S([`click`]);var q=u(`<div class="flex h-10 w-10 shrink-0 items-center justify-center overflow-hidden rounded-md"><img alt="" class="h-full w-full object-cover"/></div>`),J=u(`<div class="tool-cover-fallback flex h-10 w-10 shrink-0 items-center justify-center overflow-hidden rounded-md"><span class="text-faint-foreground text-base font-semibold"> </span></div>`),Y=u(`<p class="text-muted-foreground truncate text-[12px]"> </p>`),X=u(`<span class="bg-muted text-muted-foreground rounded-sm px-1.5 py-px font-mono text-[10.5px]"> </span>`),Z=u(`<button type="button"><!> <div class="min-w-0"><p class="truncate text-[13.5px] font-semibold"> </p> <!></div> <div class="hidden flex-wrap items-center gap-1 sm:flex"><!></div> <span class="text-muted-foreground hidden font-mono text-[12px] sm:inline"> </span> <div class="flex items-center justify-end gap-1"><!> <!></div></button>`),Q=u(`<div class="border-border bg-card overflow-hidden rounded-xl border"></div>`);function ie(s,u){g(u,!0);var p=Q();t(p,23,()=>u.records,e=>e.guid,(o,s,p)=>{var g=Z(),y=m(g),S=e=>{var t=q(),n=x(t);b(()=>_(n,`src`,c(s).coverImage)),d(e,t)},C=e=>{let t=l(()=>P(c(s).guid));var r=J();let i;var o=m(r),u=x(o,!0);n(r),b(e=>{i=f(r,``,i,{"--tool-h1":c(t).h1,"--tool-h2":c(t).h2}),a(u,e)},[()=>F(c(s).displayName)]),d(e,r)};e(y,e=>{c(s).coverImage?e(S):e(C,-1)});var w=v(y,2),E=m(w),D=x(E,!0),O=v(E,2),k=e=>{var t=Y(),n=x(t,!0);b(()=>a(n,c(s).description)),d(e,t)};e(O,e=>{c(s).description&&e(k)}),n(w);var A=v(w,2),M=m(A),N=e=>{var n=r(),i=h(n);t(i,16,()=>c(s).tags.slice(0,3),e=>e,(e,t)=>{var n=X(),r=x(n);b(()=>a(r,`#${t??``}`)),d(e,n)}),d(e,n)};e(M,e=>{c(s).tags?.length&&e(N)}),n(A);var I=v(A,2),L=x(I,!0),R=v(I,2),z=m(R);{let e=l(()=>u.starredIds.has(c(s).guid)),t=l(()=>u.starBusyGuid===c(s).guid);K(z,{get starred(){return c(e)},get busy(){return c(t)},variant:`chip`,onToggle:()=>u.onToggleStar(c(s).guid)})}var B=v(z,2);j(B,{class:`text-muted-foreground h-3.5 w-3.5 opacity-0 transition-opacity group-hover:opacity-100 pointer-coarse:opacity-100`}),n(R),n(g),b(e=>{g.disabled=u.loadingGuid===c(s).guid,T(g,1,`hover:bg-hover group grid w-full items-center gap-4 px-4 py-3 text-left transition-colors disabled:cursor-not-allowed disabled:opacity-60
2
+ grid-cols-[40px_minmax(0,1fr)_auto] sm:grid-cols-[40px_minmax(0,1.7fr)_minmax(0,1fr)_90px_36px] ${c(p)<u.records.length-1?`border-border border-b`:``}`),a(D,c(s).displayName),a(L,e)},[()=>c(s).solveCount>0?`${c(s).solveCount.toLocaleString()} runs`:`—`]),i(`click`,g,()=>u.onOpen(c(s).guid)),d(o,g)}),n(p),d(s,p),o()}S([`click`]);var ae=u(`<span class="bg-primary text-primary-foreground rounded-full px-1.5 py-px font-mono text-[10px]"> </span>`),oe=u(`<button type="button"><!> Filters <!></button>`),se=u(`<button type="button" class="text-muted-foreground hover:text-foreground inline-flex h-9 items-center gap-1 rounded-md px-2 text-xs transition-colors"><!> Clear</button>`),ce=u(`<div class="space-y-1.5"><label class="text-muted-foreground text-xs font-medium" for="filter-project">Project</label> <!></div>`),le=u(`<div class="space-y-1.5"><label class="text-muted-foreground text-xs font-medium" for="filter-category">Category</label> <!></div>`),ue=u(`<div class="space-y-1.5"><label class="text-muted-foreground text-xs font-medium" for="filter-tag">Tag</label> <!></div>`),de=u(`<div class="border-border bg-card rounded-md border p-4"><div class="grid gap-4 sm:grid-cols-3"><!> <!> <!></div></div>`),fe=u(`<button style="grid-template-columns: minmax(0, 1fr) auto auto"><span class="truncate font-medium"> </span> <span class="text-muted-foreground font-mono text-xs"> </span> <span class="flex items-center gap-1 text-xs font-medium opacity-0 transition-opacity group-hover:opacity-100 pointer-coarse:opacity-100"><span class="hidden sm:inline">Resume</span> <!></span></button>`),pe=u(`<section><div class="mb-3 flex items-baseline justify-between"><span class="text-muted-foreground text-xs font-medium tracking-wider uppercase">Recent runs</span> <span class="text-muted-foreground text-xs">Resume where you left off</span></div> <div class="border-border bg-card overflow-hidden rounded-md border"></div></section>`),me=u(`<div class="grid gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4"></div>`),he=u(`<button class="text-muted-foreground hover:text-foreground text-xs underline underline-offset-2">Clear all filters</button>`),ge=u(`<div class="space-y-6"><!> <div class="flex flex-wrap items-center gap-2"><div class="min-w-60 flex-1"><!></div> <!> <!></div> <!> <!> <!></div>`);function $(u,f){g(f,!0);let _=D(``),y=D(null),S=D(null),C=D(null),w=D(`grid`),E=D(null),A=D(null),P=D(!1),F=l(()=>new Set(f.data.starredRecords.map(e=>e.guid))),R=l(()=>[...f.data.starredRecords,...f.data.records]),U=l(()=>new Set(c(R).map(e=>e.projectId))),W=l(()=>Object.values(f.data.projects).filter(e=>c(U).has(e.id))),G=l(()=>Array.from(new Set(c(R).map(e=>e.category).filter(e=>!!e))).sort()),K=l(()=>Array.from(new Set(c(R).flatMap(e=>e.tags??[]))).sort());function q(e){return f.data.projects[e]?.name??``}function J(e){return f.data.projectMap[e]?.visibility}function Y(e){if(c(y)&&e.projectId!==c(y)||c(S)&&e.category!==c(S)||c(C)&&!(e.tags??[]).includes(c(C)))return!1;if(c(_).trim()){let t=c(_).toLowerCase();if(![e.displayName,e.description,e.category,...e.tags??[]].filter(Boolean).join(` `).toLowerCase().includes(t))return!1}return!0}let X=l(()=>c(R).filter(Y)),Z=l(()=>[c(y),c(S),c(C)].filter(e=>e!==null).length),Q=l(()=>c(_).trim()!==``||c(Z)>0);function $(e){p(E,e,!0),O(`/library/${e}`).catch(()=>{p(E,null)})}async function _e(e){p(A,e,!0);let t=c(F).has(e);try{let n=await fetch(`/api/v1/me/starred/${e}`,{method:t?`DELETE`:`PUT`});if(!n.ok)throw Error(`${n.status}`);await k()}catch{ne.error(t?`Failed to unstar`:`Failed to star`)}finally{p(A,null)}}function ve(){p(_,``),p(y,null),p(S,null),p(C,null),p(P,!1)}L(u,{children:(o,u)=>{V(o,{children:(o,u)=>{var g=ge(),D=m(g);{let e=e=>{N(e,{get mode(){return c(w)},onChange:e=>p(w,e,!0)})},t=l(()=>`${c(X).length} tool${c(X).length===1?``:`s`}${c(W).length>0?` across ${c(W).length} project${c(W).length===1?``:`s`}`:``}.`);ee(D,{eyebrow:`Workspace`,title:`Library`,get description(){return c(t)},actions:e,$$slots:{actions:!0}})}var O=v(D,2),k=m(O),L=m(k);te(L,{placeholder:`Search tools, descriptions, tags…`,clearable:!0,class:`h-9 rounded-md text-sm`,get value(){return c(_)},set value(e){p(_,e,!0)}}),n(k);var R=v(k,2),V=t=>{var r=oe(),o=m(r);re(o,{class:`h-3.5 w-3.5`});var s=v(o,2),l=e=>{var t=ae(),n=x(t,!0);b(()=>a(n,c(Z))),d(e,t)};e(s,e=>{c(Z)>0&&e(l)}),n(r),b(()=>T(r,1,`relative inline-flex h-9 items-center gap-1.5 rounded-md border px-3 text-sm transition-colors ${c(P)||c(Z)>0?`border-border bg-selected text-foreground`:`border-input bg-background text-foreground hover:bg-hover`}`)),i(`click`,r,()=>p(P,!c(P))),d(t,r)};e(R,e=>{(c(G).length>0||c(K).length>0||c(W).length>1)&&e(V)});var ne=v(R,2),U=e=>{var t=se(),r=m(t);z(r,{class:`h-3 w-3`}),s(),n(t),i(`click`,t,ve),d(e,t)};e(ne,e=>{c(Q)&&e(U)}),n(O);var Y=v(O,2),ye=t=>{var r=de(),i=m(r),a=m(i),o=e=>{var t=ce(),r=v(m(t),2);{let e=l(()=>[{id:``,label:`All projects`},...c(W).map(e=>({id:e.id,label:e.name}))]),t=l(()=>c(y)??``);B(r,{id:`filter-project`,get items(){return c(e)},get value(){return c(t)},onChange:e=>p(y,e||null,!0),size:`sm`})}n(t),d(e,t)};e(a,e=>{c(W).length>1&&e(o)});var s=v(a,2),u=e=>{var t=le(),r=v(m(t),2);{let e=l(()=>[{id:``,label:`All categories`},...c(G).map(e=>({id:e,label:e}))]),t=l(()=>c(S)??``);B(r,{id:`filter-category`,get items(){return c(e)},get value(){return c(t)},onChange:e=>p(S,e||null,!0),size:`sm`})}n(t),d(e,t)};e(s,e=>{c(G).length>0&&e(u)});var f=v(s,2),h=e=>{var t=ue(),r=v(m(t),2);{let e=l(()=>[{id:``,label:`All tags`},...c(K).map(e=>({id:e,label:`#${e}`}))]),t=l(()=>c(C)??``);B(r,{id:`filter-tag`,get items(){return c(e)},get value(){return c(t)},onChange:e=>p(C,e||null,!0),size:`sm`})}n(t),d(e,t)};e(f,e=>{c(K).length>0&&e(h)}),n(i),n(r),d(t,r)};e(Y,e=>{c(P)&&e(ye)});var be=v(Y,2),xe=e=>{var r=pe(),o=v(m(r),2);t(o,23,()=>f.data.recentRuns.slice(0,5),e=>e.runId,(e,t,r)=>{var o=fe(),s=m(o),l=x(s,!0),u=v(s,2),p=x(u,!0),h=v(u,2),g=v(m(h),2);j(g,{class:`h-3 w-3`}),n(h),n(o),b((e,n)=>{o.disabled=c(E)===c(t).definitionId,T(o,1,e),a(l,c(t).definitionName),a(p,n)},[()=>`group hover:bg-hover grid w-full items-center gap-4 px-4 py-3 text-left text-sm transition-colors disabled:cursor-not-allowed disabled:opacity-60 ${c(r)<Math.min(f.data.recentRuns.length,5)-1?`border-border border-b`:``}`,()=>M(c(t).timestamp)]),i(`click`,o,()=>$(c(t).definitionId)),d(e,o)}),n(o),n(r),d(e,r)};e(be,e=>{f.data.recentRuns.length>0&&!c(Q)&&e(xe)});var Se=v(be,2),Ce=i=>{var a=r(),o=h(a),s=e=>{var r=me();t(r,21,()=>c(X),e=>e.guid,(e,t)=>{{let n=l(()=>c(F).has(c(t).guid)),r=l(()=>c(E)===c(t).guid),i=l(()=>c(A)===c(t).guid),a=l(()=>c(W).length>1?q(c(t).projectId):void 0),o=l(()=>c(W).length>1?J(c(t).projectId):void 0);I(e,{get record(){return c(t)},get starred(){return c(n)},get loading(){return c(r)},get starBusy(){return c(i)},get projectName(){return c(a)},get projectVisibility(){return c(o)},onOpen:e=>$(e.guid),onToggleStar:_e})}}),n(r),d(e,r)},u=e=>{ie(e,{get records(){return c(X)},get starredIds(){return c(F)},get loadingGuid(){return c(E)},get starBusyGuid(){return c(A)},onOpen:$,onToggleStar:_e})};e(o,e=>{c(w)===`grid`?e(s):e(u,-1)}),d(i,a)},we=e=>{H(e,{size:`lg`,title:`No tools match your filters`,actions:e=>{var t=he();i(`click`,t,ve),d(e,t)},$$slots:{actions:!0}})},Te=e=>{H(e,{size:`lg`,title:`No tools available yet`,description:`Ask an admin to publish a Grasshopper definition.`})};e(Se,e=>{c(X).length>0?e(Ce):c(Q)?e(we,1):e(Te,-1)}),n(g),d(o,g)},$$slots:{default:!0}})},$$slots:{default:!0}}),o()}S([`click`]);export{$ as component};
@@ -0,0 +1 @@
1
+ export{t as component}from"../chunks/CVA0v6Z8.js";
@@ -0,0 +1 @@
1
+ ��export{t as component}from"../chunks/CVA0v6Z8.js";