@lunora/studio 1.0.0-alpha.17 → 1.0.0-alpha.170

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 (333) hide show
  1. package/LICENSE.md +6 -0
  2. package/README.md +1 -1
  3. package/dist/index.d.mts +1527 -0
  4. package/dist/index.d.ts +923 -803
  5. package/dist/index.mjs +1 -0
  6. package/dist/mount.d.mts +22 -0
  7. package/dist/mount.d.ts +11 -10
  8. package/dist/mount.mjs +1 -0
  9. package/dist/packem_chunks/AdvisorHealthPanel.mjs +1 -0
  10. package/dist/packem_chunks/ApiTab.mjs +1 -0
  11. package/dist/packem_chunks/AuditPanel.mjs +1 -0
  12. package/dist/packem_chunks/DeploymentHealthPanel.mjs +1 -0
  13. package/dist/packem_chunks/ExportImportPanel.mjs +3 -0
  14. package/dist/packem_chunks/FileBrowser.mjs +4 -0
  15. package/dist/packem_chunks/FunctionRunner.mjs +1 -0
  16. package/dist/packem_chunks/FunctionStatsPanel.mjs +1 -0
  17. package/dist/packem_chunks/HealthPanel.mjs +1 -0
  18. package/dist/packem_chunks/InsightsPanel.mjs +1 -0
  19. package/dist/packem_chunks/LogsPanel.mjs +1 -0
  20. package/dist/packem_chunks/MailPanel.mjs +2 -0
  21. package/dist/packem_chunks/MetricsPanel.mjs +1 -0
  22. package/dist/packem_chunks/NotificationsPanel.mjs +1 -0
  23. package/dist/packem_chunks/PitrPanel.mjs +1 -0
  24. package/dist/packem_chunks/SchemaViewer.mjs +1 -0
  25. package/dist/packem_chunks/SecurityAdvisorPanel.mjs +1 -0
  26. package/dist/packem_chunks/SettingsPanel.mjs +1 -0
  27. package/dist/packem_chunks/SqlEditorPanel.mjs +8 -0
  28. package/dist/packem_chunks/TableEditor.mjs +1 -0
  29. package/dist/packem_chunks/agents-panel.mjs +1 -0
  30. package/dist/packem_chunks/analytics-panel.mjs +1 -0
  31. package/dist/packem_chunks/auth-audit-panel.mjs +1 -0
  32. package/dist/packem_chunks/auth-config-panel.mjs +1 -0
  33. package/dist/packem_chunks/auth-sessions-panel.mjs +1 -0
  34. package/dist/packem_chunks/containers-panel.mjs +1 -0
  35. package/dist/packem_chunks/dashboards-panel.mjs +1 -0
  36. package/dist/packem_chunks/evals-panel.mjs +1 -0
  37. package/dist/packem_chunks/fanout-panel.mjs +1 -0
  38. package/dist/packem_chunks/flags-panel.mjs +1 -0
  39. package/dist/packem_chunks/issues-panel.mjs +1 -0
  40. package/dist/packem_chunks/kv-browser.mjs +1 -0
  41. package/dist/packem_chunks/log-drains-panel.mjs +4 -0
  42. package/dist/packem_chunks/migrations-route.mjs +1 -0
  43. package/dist/packem_chunks/organizations-panel.mjs +1 -0
  44. package/dist/packem_chunks/payments-panel.mjs +1 -0
  45. package/dist/packem_chunks/permissions-panel.mjs +1 -0
  46. package/dist/packem_chunks/queues-panel.mjs +1 -0
  47. package/dist/packem_chunks/reactors-panel.mjs +1 -0
  48. package/dist/packem_chunks/rls-panel.mjs +1 -0
  49. package/dist/packem_chunks/schedule-panel.mjs +1 -0
  50. package/dist/packem_chunks/sparkline.mjs +1 -0
  51. package/dist/packem_chunks/storage-rules-panel.mjs +1 -0
  52. package/dist/packem_chunks/subscriptions-panel.mjs +1 -0
  53. package/dist/packem_chunks/sync-client-panel.mjs +1 -0
  54. package/dist/packem_chunks/traces-panel.mjs +1 -0
  55. package/dist/packem_chunks/users-panel.mjs +1 -0
  56. package/dist/packem_chunks/vector-browser.mjs +1 -0
  57. package/dist/packem_chunks/workflows-panel.mjs +1 -0
  58. package/dist/packem_shared/ADMIN_FUNCTIONS-B8yyk5BX.mjs +1 -0
  59. package/dist/packem_shared/ApiDocsPanel-BImfQhyJ.mjs +2 -0
  60. package/dist/packem_shared/ApiReferencePanel-CigvHhCa.mjs +1 -0
  61. package/dist/packem_shared/CommandPalette-CSdz9zax.mjs +1 -0
  62. package/dist/packem_shared/ConfirmButton-DU4p72Er.mjs +1 -0
  63. package/dist/packem_shared/ConnectionBadge-B_8fcft2.mjs +1 -0
  64. package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-DuULO4XM.mjs +1 -0
  65. package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-D5YMT0gM.mjs +1 -0
  66. package/dist/packem_shared/DEFAULT_LOCALE-A1Yg5ORA.mjs +1 -0
  67. package/dist/packem_shared/DataBrowser-B_zcf3a_.mjs +4 -0
  68. package/dist/packem_shared/DataFilters-3nbW0uax.mjs +1 -0
  69. package/dist/packem_shared/ErrorBoundary-BWNF98VF.mjs +1 -0
  70. package/dist/packem_shared/GlobalDataBrowser-BTbqR6Wc.mjs +1 -0
  71. package/dist/packem_shared/HomePanel-_BwLI4TQ.mjs +1 -0
  72. package/dist/packem_shared/MigrationsPanel-BPWzFdxC.mjs +1 -0
  73. package/dist/packem_shared/OpenRpcReferencePanel-C6CM791D.mjs +1 -0
  74. package/dist/packem_shared/STUDIO_ROOT_CLASS-C6MccdVk.mjs +1 -0
  75. package/dist/packem_shared/ScheduledJobs-B4DPADwk.mjs +1 -0
  76. package/dist/packem_shared/ShardInput-C6mjgAh4.mjs +1 -0
  77. package/dist/packem_shared/Studio-CcWQdYrV.mjs +1 -0
  78. package/dist/packem_shared/StudioApp-fYFz6zZQ.mjs +1 -0
  79. package/dist/packem_shared/StudioI18nProvider-fVsCSs5L.mjs +1 -0
  80. package/dist/packem_shared/advisor-view-CPgOok_h.mjs +1 -0
  81. package/dist/packem_shared/aggregateMetrics-CY05xrYU.mjs +1 -0
  82. package/dist/packem_shared/alert-PB5W11MM.mjs +1 -0
  83. package/dist/packem_shared/app.d-BbmO2HA2.d.mts +301 -0
  84. package/dist/packem_shared/app.d-BbmO2HA2.d.ts +301 -0
  85. package/dist/packem_shared/badge-r_5B4LHP.mjs +1 -0
  86. package/dist/packem_shared/bar-chart-BCsEIQoQ.mjs +6 -0
  87. package/dist/packem_shared/browser-storage-BH1MxLZs.mjs +1 -0
  88. package/dist/packem_shared/button-q0UYSmrn.mjs +1 -0
  89. package/dist/packem_shared/card--2hKx4L2.mjs +1 -0
  90. package/dist/packem_shared/cf-links-CBJ5SywP.mjs +1 -0
  91. package/dist/packem_shared/checkbox-CnS9cyCz.mjs +1 -0
  92. package/dist/packem_shared/control-button-BOZ5K-FC.mjs +1 -0
  93. package/dist/packem_shared/data-grid-DTBAKZlm.mjs +1 -0
  94. package/dist/packem_shared/data-view-params-qoSTqjAj.mjs +1 -0
  95. package/dist/packem_shared/dropdown-menu-jLZenfWH.mjs +2 -0
  96. package/dist/packem_shared/empty-state-D7jEML_T.mjs +1 -0
  97. package/dist/packem_shared/error-alert-tf5zvSLV.mjs +1 -0
  98. package/dist/packem_shared/grid-features-Dl7bCGRN.mjs +6 -0
  99. package/dist/packem_shared/home-panel-DCUKd8Uk.mjs +3 -0
  100. package/dist/packem_shared/input-CXhxesPC.mjs +1 -0
  101. package/dist/packem_shared/internal-B6haJbiP.mjs +2 -0
  102. package/dist/packem_shared/label-DKFzyHq6.mjs +1 -0
  103. package/dist/packem_shared/live-status-BuJdUZFU.mjs +1 -0
  104. package/dist/packem_shared/log-fields-SBxKyBug.mjs +1 -0
  105. package/dist/packem_shared/log-line-BoObzuue.mjs +1 -0
  106. package/dist/packem_shared/modal-shell-CDztwLnv.mjs +1 -0
  107. package/dist/packem_shared/operation-console-provider-DoloEvon.mjs +1 -0
  108. package/dist/packem_shared/recording-client-BXUIyBL4.mjs +1 -0
  109. package/dist/packem_shared/reference-view-DiikOols.mjs +13 -0
  110. package/dist/packem_shared/schema-diagram-CDj_69jF.mjs +2 -0
  111. package/dist/packem_shared/scroll-area-CXCQH7VT.mjs +2 -0
  112. package/dist/packem_shared/select-DPyS18Vy.mjs +2 -0
  113. package/dist/packem_shared/shard-history-CaO3C4KQ.mjs +1 -0
  114. package/dist/packem_shared/shortcuts-B9gDaXmw.mjs +1 -0
  115. package/dist/packem_shared/skeleton-DX1gfixl.mjs +1 -0
  116. package/dist/packem_shared/sparkline-B_sPPO_8.mjs +1 -0
  117. package/dist/packem_shared/sql-result-table-C5y0jwaK.mjs +1 -0
  118. package/dist/packem_shared/stat-card-D0Fe04cX.mjs +1 -0
  119. package/dist/packem_shared/storage-tier-C2mKwYRj.mjs +1 -0
  120. package/dist/packem_shared/studio-OqNyRY1N.mjs +2 -0
  121. package/dist/packem_shared/table-D0SBiDu-.mjs +2 -0
  122. package/dist/packem_shared/table-list-sidebar-DHG1UJC4.mjs +1 -0
  123. package/dist/packem_shared/textarea--40GKAyz.mjs +1 -0
  124. package/dist/packem_shared/trace-handoff-BV3EWqy_.mjs +1 -0
  125. package/dist/packem_shared/use-admin-query-BKXiqLci.mjs +1 -0
  126. package/dist/packem_shared/use-async-submit-BTr3w2-K.mjs +1 -0
  127. package/dist/packem_shared/use-auth-config-CuM3eJZz.mjs +1 -0
  128. package/dist/packem_shared/use-open-trace-BCW0c9qq.mjs +1 -0
  129. package/dist/packem_shared/use-shard-key-BsP3o5wT.mjs +1 -0
  130. package/dist/packem_shared/use-sql-assistant-BhIMDQHV.mjs +1 -0
  131. package/dist/packem_shared/useDebounced-DVeQ5-oW.mjs +1 -0
  132. package/dist/packem_shared/utils-bhneXptQ.mjs +1 -0
  133. package/dist/packem_shared/virtual-rect-D_j7aLxX.mjs +1 -0
  134. package/dist/packem_shared/wire-codec-Bk4XZGE4.mjs +1 -0
  135. package/dist/standalone/chunk-225VJ77I.js +1 -0
  136. package/dist/standalone/chunk-24MZS54G.js +1 -0
  137. package/dist/standalone/chunk-2DX5MROH.js +1 -0
  138. package/dist/standalone/chunk-2LVK7QRD.js +1 -0
  139. package/dist/standalone/chunk-2URQKGWU.js +1 -0
  140. package/dist/standalone/chunk-35DM4JJG.js +1 -0
  141. package/dist/standalone/chunk-3FBLWUXD.js +1 -0
  142. package/dist/standalone/chunk-3LGVSZ4D.js +3 -0
  143. package/dist/standalone/chunk-3Q2P62UR.js +1 -0
  144. package/dist/standalone/chunk-3UOVQ3YN.js +1 -0
  145. package/dist/standalone/chunk-4G7WDTSC.js +1 -0
  146. package/dist/standalone/chunk-4GTO7FL5.js +1 -0
  147. package/dist/standalone/chunk-4JLGLPWV.js +1 -0
  148. package/dist/standalone/chunk-4L4WTGN5.js +1 -0
  149. package/dist/standalone/chunk-4OGX6UIE.js +1 -0
  150. package/dist/standalone/chunk-4ZEL6BYL.js +1 -0
  151. package/dist/standalone/chunk-52Y5BCFW.js +8 -0
  152. package/dist/standalone/chunk-55754F6H.js +1 -0
  153. package/dist/standalone/chunk-5JDWLCSH.js +1 -0
  154. package/dist/standalone/chunk-5JHPL7FH.js +1 -0
  155. package/dist/standalone/chunk-5WJXVZMZ.js +1 -0
  156. package/dist/standalone/chunk-66UGPQVC.js +1 -0
  157. package/dist/standalone/chunk-6D6Z2KXU.js +1 -0
  158. package/dist/standalone/chunk-7PEQ4RPL.js +1 -0
  159. package/dist/standalone/chunk-AAVLPU5Q.js +1 -0
  160. package/dist/standalone/chunk-AWHXPIXU.js +1 -0
  161. package/dist/standalone/chunk-B62IS74K.js +1 -0
  162. package/dist/standalone/chunk-BOTGXX4H.js +1 -0
  163. package/dist/standalone/chunk-CMA4PTV7.js +1 -0
  164. package/dist/standalone/chunk-CO7D5QQA.js +1 -0
  165. package/dist/standalone/chunk-CQ4VSTAW.js +1 -0
  166. package/dist/standalone/chunk-CQO3Z2AB.js +1 -0
  167. package/dist/standalone/chunk-CSUROWL2.js +1 -0
  168. package/dist/standalone/chunk-D6UKRXIS.js +1 -0
  169. package/dist/standalone/chunk-DL3DYOZA.js +5 -0
  170. package/dist/standalone/chunk-DX6FAHR2.js +1 -0
  171. package/dist/standalone/chunk-E67LBUZU.js +14 -0
  172. package/dist/standalone/chunk-E7TOMONS.js +4 -0
  173. package/dist/standalone/chunk-EA2JKR5D.js +1 -0
  174. package/dist/standalone/chunk-EFMYOSXQ.js +1 -0
  175. package/dist/standalone/chunk-ERLNG3BC.js +1 -0
  176. package/dist/standalone/chunk-EVTM6Q43.js +1 -0
  177. package/dist/standalone/chunk-F4W5DVWA.js +1 -0
  178. package/dist/standalone/chunk-F7UC63UN.js +1 -0
  179. package/dist/standalone/chunk-F7UZBTKS.js +1 -0
  180. package/dist/standalone/chunk-FEWMAPNI.js +1 -0
  181. package/dist/standalone/chunk-FKVZRPV5.js +1 -0
  182. package/dist/standalone/chunk-FODLDLE2.js +19 -0
  183. package/dist/standalone/chunk-FSRSK4LY.js +1 -0
  184. package/dist/standalone/chunk-GGPSI4ZR.js +1 -0
  185. package/dist/standalone/chunk-GMS77BZD.js +1 -0
  186. package/dist/standalone/chunk-HEAQVSNS.js +1 -0
  187. package/dist/standalone/chunk-HKPAFIMB.js +1 -0
  188. package/dist/standalone/chunk-I3PD3ZML.js +1 -0
  189. package/dist/standalone/chunk-I4YTKLE7.js +1 -0
  190. package/dist/standalone/chunk-IHMGCHAA.js +1 -0
  191. package/dist/standalone/chunk-IMLGMLYE.js +1 -0
  192. package/dist/standalone/chunk-IMOHEGMV.js +1 -0
  193. package/dist/standalone/chunk-IS6LVJ6L.js +1 -0
  194. package/dist/standalone/chunk-JMXDVWZG.js +1 -0
  195. package/dist/standalone/chunk-JWJFB4ZB.js +4 -0
  196. package/dist/standalone/chunk-JXJZMINI.js +1 -0
  197. package/dist/standalone/chunk-K7AJEMKE.js +1 -0
  198. package/dist/standalone/chunk-KF2YSK5Z.js +1 -0
  199. package/dist/standalone/chunk-KMLTYAJF.js +1 -0
  200. package/dist/standalone/chunk-KPISDHKV.js +1 -0
  201. package/dist/standalone/chunk-KRXDSPZ4.js +1 -0
  202. package/dist/standalone/chunk-KSRQTLE3.js +1 -0
  203. package/dist/standalone/chunk-KSYIH3NO.js +15 -0
  204. package/dist/standalone/chunk-KY7U3EOR.js +2 -0
  205. package/dist/standalone/chunk-L6W4QXGJ.js +1 -0
  206. package/dist/standalone/chunk-LBMSRD6N.js +1 -0
  207. package/dist/standalone/chunk-MKRHFCPJ.js +1 -0
  208. package/dist/standalone/chunk-MU3P2FI7.js +1 -0
  209. package/dist/standalone/chunk-MXLAOCAN.js +1 -0
  210. package/dist/standalone/chunk-N3MMJZQW.js +1 -0
  211. package/dist/standalone/chunk-NKN7O5AR.js +1 -0
  212. package/dist/standalone/chunk-NXZGWCUN.js +1 -0
  213. package/dist/standalone/chunk-NZDNC4KZ.js +1 -0
  214. package/dist/standalone/chunk-O7D7DJVB.js +59 -0
  215. package/dist/standalone/chunk-OBSMXNVJ.js +8 -0
  216. package/dist/standalone/chunk-OGUKYRFM.js +1 -0
  217. package/dist/standalone/chunk-OKG3HWSJ.js +1 -0
  218. package/dist/standalone/chunk-OS6CZ56E.js +1 -0
  219. package/dist/standalone/chunk-PD6WIDY6.js +1 -0
  220. package/dist/standalone/chunk-PLHA3OWK.js +3 -0
  221. package/dist/standalone/chunk-Q4CAKBWN.js +1 -0
  222. package/dist/standalone/chunk-QKEJLVC5.js +1 -0
  223. package/dist/standalone/chunk-QY4V5UOY.js +6 -0
  224. package/dist/standalone/chunk-RFNGDE33.js +1 -0
  225. package/dist/standalone/chunk-RH2G72SL.js +1 -0
  226. package/dist/standalone/chunk-RLLKECZT.js +1 -0
  227. package/dist/standalone/chunk-RPQL45FL.js +1 -0
  228. package/dist/standalone/chunk-RQPSYNGU.js +1 -0
  229. package/dist/standalone/chunk-S3CRZLGS.js +1 -0
  230. package/dist/standalone/chunk-SPERI4DG.js +1 -0
  231. package/dist/standalone/chunk-SUDJTC4S.js +1 -0
  232. package/dist/standalone/chunk-SZUW2MXD.js +1 -0
  233. package/dist/standalone/chunk-T6X7NXEE.js +1 -0
  234. package/dist/standalone/chunk-TCVKSWIK.js +1 -0
  235. package/dist/standalone/chunk-TIUMFAN2.js +1 -0
  236. package/dist/standalone/chunk-TPVTZE6M.js +1 -0
  237. package/dist/standalone/chunk-TX4KHOV2.js +1 -0
  238. package/dist/standalone/chunk-ULIQFBZU.js +1 -0
  239. package/dist/standalone/chunk-UYEZR3BI.js +1 -0
  240. package/dist/standalone/chunk-V3CZW3JB.js +1 -0
  241. package/dist/standalone/chunk-V3VJAA4D.js +1 -0
  242. package/dist/standalone/chunk-V5PJJYCF.js +1 -0
  243. package/dist/standalone/chunk-VWWJIICI.js +11 -0
  244. package/dist/standalone/chunk-WDYULSDM.js +3 -0
  245. package/dist/standalone/chunk-WRNNZJ34.js +1 -0
  246. package/dist/standalone/chunk-WUWBZPUK.js +1 -0
  247. package/dist/standalone/chunk-WWHDFIP5.js +1 -0
  248. package/dist/standalone/chunk-X5AXABWH.js +1 -0
  249. package/dist/standalone/chunk-XAGNBUL3.js +1 -0
  250. package/dist/standalone/chunk-XTC4KFYF.js +1 -0
  251. package/dist/standalone/chunk-XZMOZFE6.js +1 -0
  252. package/dist/standalone/chunk-Y3G2ZPOD.js +1 -0
  253. package/dist/standalone/chunk-Y6CXU7T4.js +1 -0
  254. package/dist/standalone/chunk-YKA2P52S.js +1 -0
  255. package/dist/standalone/chunk-YKXDMIHQ.js +1 -0
  256. package/dist/standalone/chunk-YOB2X3FZ.js +1 -0
  257. package/dist/standalone/chunk-YPRQLCKF.js +1 -0
  258. package/dist/standalone/chunk-YYR4P344.js +1 -0
  259. package/dist/standalone/studio.js +9 -378
  260. package/dist/styles.css +2 -2
  261. package/package.json +23 -20
  262. package/dist/index.js +0 -41
  263. package/dist/mount.js +0 -26
  264. package/dist/packem_shared/ADMIN_FUNCTIONS-CZJCZ4c7.js +0 -47
  265. package/dist/packem_shared/ApiDocsPanel-yEz0fiof.js +0 -842
  266. package/dist/packem_shared/ApiReferencePanel-1vubqG5s.js +0 -229
  267. package/dist/packem_shared/ApiTab-DdubReQI.js +0 -251
  268. package/dist/packem_shared/AuditPanel-CE5ofjCc.js +0 -200
  269. package/dist/packem_shared/CommandPalette-BtgkBzZI.js +0 -373
  270. package/dist/packem_shared/ConfirmButton-C2eVi2Qv.js +0 -59
  271. package/dist/packem_shared/ConnectionBadge-B2DDM2Tn.js +0 -111
  272. package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js +0 -50
  273. package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-DjF0h-gA.js +0 -89
  274. package/dist/packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js +0 -27
  275. package/dist/packem_shared/DataBrowser-DpL8U-Nf.js +0 -4475
  276. package/dist/packem_shared/DataFilters-FNquMaiu.js +0 -249
  277. package/dist/packem_shared/ErrorBoundary-BzAApI7J.js +0 -66
  278. package/dist/packem_shared/ExportImportPanel-ChsSUCYZ.js +0 -197
  279. package/dist/packem_shared/FileBrowser-DsRBnVhZ.js +0 -2932
  280. package/dist/packem_shared/FunctionRunner-D4cZ6fuA.js +0 -343
  281. package/dist/packem_shared/FunctionStatsPanel-BVelWgNv.js +0 -375
  282. package/dist/packem_shared/GlobalDataBrowser-3X9uRfdO.js +0 -289
  283. package/dist/packem_shared/HealthPanel-CxUVKfvo.js +0 -648
  284. package/dist/packem_shared/HomePanel-tfqpZxuu.js +0 -1334
  285. package/dist/packem_shared/InsightsPanel-DNg3K9XN.js +0 -461
  286. package/dist/packem_shared/LogsPanel-B4LoSRj0.js +0 -827
  287. package/dist/packem_shared/MailPanel-CcpdyWYs.js +0 -440
  288. package/dist/packem_shared/MetricsPanel-CxoyWbNb.js +0 -1611
  289. package/dist/packem_shared/MigrationsPanel-DGwJGWDA.js +0 -239
  290. package/dist/packem_shared/OpenRpcReferencePanel-vbcYbv3V.js +0 -191
  291. package/dist/packem_shared/PitrPanel-CKUzyyHi.js +0 -252
  292. package/dist/packem_shared/STUDIO_ROOT_CLASS-D12gX2dV.js +0 -3
  293. package/dist/packem_shared/ScheduledJobs-BWNwIN3I.js +0 -262
  294. package/dist/packem_shared/SchemaViewer-RclXFo9Q.js +0 -2512
  295. package/dist/packem_shared/SecurityAdvisorPanel-Dqql1Z5O.js +0 -92
  296. package/dist/packem_shared/SettingsPanel-D5iTY0YE.js +0 -390
  297. package/dist/packem_shared/ShardInput-gx_DZXXn.js +0 -107
  298. package/dist/packem_shared/SqlEditorPanel-Dj-In-B3.js +0 -13
  299. package/dist/packem_shared/Studio-VWvKNOw4.js +0 -33
  300. package/dist/packem_shared/StudioApp-BhQ6T2pn.js +0 -657
  301. package/dist/packem_shared/StudioI18nProvider-B-tDCZIi.js +0 -48
  302. package/dist/packem_shared/TableEditor-BY8bTpCl.js +0 -11
  303. package/dist/packem_shared/advisor-view-CGcfMiPq.js +0 -159
  304. package/dist/packem_shared/aggregateMetrics-D4nUHEKU.js +0 -108
  305. package/dist/packem_shared/app.d-BVJFkXyj.d.ts +0 -300
  306. package/dist/packem_shared/badge-B2PKA1-5.js +0 -49
  307. package/dist/packem_shared/bar-chart-CzJAgqkp.js +0 -3245
  308. package/dist/packem_shared/button-BhsN2uZH.js +0 -49
  309. package/dist/packem_shared/card-DURq3ElK.js +0 -175
  310. package/dist/packem_shared/cf-links-2cktDedA.js +0 -8
  311. package/dist/packem_shared/checkbox-UNkzAxl-.js +0 -63
  312. package/dist/packem_shared/data-grid-B5CaV3wS.js +0 -183
  313. package/dist/packem_shared/dropdown-menu-WY4B_eJO.js +0 -280
  314. package/dist/packem_shared/empty-state-DY_oe0k6.js +0 -98
  315. package/dist/packem_shared/grid-features-CzUfqgsM.js +0 -840
  316. package/dist/packem_shared/input-XH4r1Pt1.js +0 -53
  317. package/dist/packem_shared/internal-rXJEAhXS.js +0 -68
  318. package/dist/packem_shared/label-D8ykjn5J.js +0 -46
  319. package/dist/packem_shared/live-status-FZ0psC1z.js +0 -44
  320. package/dist/packem_shared/reference-view-B4E49Lip.js +0 -2180
  321. package/dist/packem_shared/shard-history-DyebH1R5.js +0 -38
  322. package/dist/packem_shared/sparkline-10dG-_f0.js +0 -93
  323. package/dist/packem_shared/sql-editor-panel-CMdxstu5.js +0 -2562
  324. package/dist/packem_shared/storage-tier-CL98eOvn.js +0 -85
  325. package/dist/packem_shared/studio-D8ry3tJR.js +0 -11043
  326. package/dist/packem_shared/table-_RzNvy3R.js +0 -246
  327. package/dist/packem_shared/table-editor-CWx68ZCg.js +0 -407
  328. package/dist/packem_shared/table-list-sidebar-Bg7uzbvC.js +0 -832
  329. package/dist/packem_shared/textarea-D3gaCU_-.js +0 -46
  330. package/dist/packem_shared/use-admin-query-BkbdNFNz.js +0 -105
  331. package/dist/packem_shared/useDebounced-Dxncpg6z.js +0 -32
  332. package/dist/packem_shared/utils-B05Dmz_H.js +0 -8
  333. package/dist/packem_shared/virtual-rect-CVMUskSm.js +0 -10
@@ -0,0 +1 @@
1
+ import{a as yt}from"./chunk-EA2JKR5D.js";import{b as Nt}from"./chunk-TX4KHOV2.js";import{a as ne}from"./chunk-TIUMFAN2.js";import{a as St}from"./chunk-XZMOZFE6.js";import{a as zt}from"./chunk-IMOHEGMV.js";import{a as Ct}from"./chunk-66UGPQVC.js";import{W as Z}from"./chunk-PLHA3OWK.js";import"./chunk-4L4WTGN5.js";import{a as L}from"./chunk-55754F6H.js";import"./chunk-IS6LVJ6L.js";import"./chunk-AAVLPU5Q.js";import"./chunk-225VJ77I.js";import{b as ue}from"./chunk-D6UKRXIS.js";import{f as re}from"./chunk-VWWJIICI.js";import"./chunk-FSRSK4LY.js";import"./chunk-KSYIH3NO.js";import{a as ce}from"./chunk-FKVZRPV5.js";import{a as ft,b as pt,c as vt,d as Ze,e as se,f as me}from"./chunk-HEAQVSNS.js";import{a as ht,e as bt}from"./chunk-WUWBZPUK.js";import{d as q,h as xt,n as S,o as wt,r as kt}from"./chunk-FODLDLE2.js";import{a as c,d as gt,e as Rt,f as $t,g as Ft}from"./chunk-YKXDMIHQ.js";var U=gt($t(),1);var j=gt(Rt(),1);var a=gt(Ft(),1);var Ot=c(t=>{let e=JSON.parse(t);if(typeof e!="object"||e===null||Array.isArray(e))throw new TypeError("Expected a JSON object");return e},"Dt"),Et=c(t=>{let e=Ot(t),r={};for(let[d,h]of Object.entries(e)){if(!Array.isArray(h)||h.some(i=>typeof i!="string"))throw new TypeError(`"${d}" must map to an array of action strings`);r[d]=h}return r},"Mt"),Tt=c(t=>t==null||t===""?"":typeof t=="string"?t:JSON.stringify(t,null,2),"St"),X=c(t=>{let e=(0,U.c)(6),{children:r,htmlFor:d,label:h}=t,i;e[0]!==d||e[1]!==h?(i=(0,a.jsx)(zt,{htmlFor:d,children:h}),e[0]=d,e[1]=h,e[2]=i):i=e[2];let o;return e[3]!==r||e[4]!==i?(o=(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[i,r]}),e[3]=r,e[4]=i,e[5]=o):o=e[5],o},"G"),de=c(({busy:t,canSubmit:e,children:r,destructive:d=!1,error:h,onClose:i,onSubmit:o,submitLabel:l,testId:n,title:s})=>{let m=q();return(0,a.jsxs)(St,{label:s,onClose:i,panelTestId:`${n}-panel`,testId:`${n}-overlay`,variant:"dialog",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-foreground",children:s}),r,h!==null&&(0,a.jsx)("p",{className:"text-sm text-destructive","data-testid":`${n}-error`,role:"alert",children:h}),(0,a.jsxs)("div",{className:"flex justify-end gap-2 pt-1",children:[(0,a.jsx)(L,{"data-testid":`${n}-cancel`,onClick:i,size:"sm",type:"button",variant:"outline",children:m("Cancel")}),(0,a.jsx)(L,{"data-testid":`${n}-submit`,disabled:t||!e,onClick:o,size:"sm",type:"button",variant:d?"destructive":"default",children:t?m("Saving\u2026"):l})]})]})},"ae"),Dt=c(t=>{let e=(0,U.c)(79),{mode:r,onClose:d,onDone:h,org:i}=t,o=re(),l=q(),{busy:n,error:s,run:m}=ne(),b;e[0]!==i?(b=i?S(i.name):"",e[0]=i,e[1]=b):b=e[1];let[u,g]=(0,j.useState)(b),p;e[2]!==i?(p=i?S(i.slug):"",e[2]=i,e[3]=p):p=e[3];let[f,y]=(0,j.useState)(p),k;e[4]!==i?(k=i?S(i.logo):"",e[4]=i,e[5]=k):k=e[5];let[v,I]=(0,j.useState)(k),[C,z]=(0,j.useState)(""),x;e[6]!==r||e[7]!==i?.metadata?(x=r==="edit"?Tt(i?.metadata):"",e[6]=r,e[7]=i?.metadata,e[8]=x):x=e[8];let[w,N]=(0,j.useState)(x),O;e[9]!==o||e[10]!==v||e[11]!==w||e[12]!==r||e[13]!==u||e[14]!==d||e[15]!==h||e[16]!==i?.id||e[17]!==C||e[18]!==m||e[19]!==f?(O=c(()=>{m(async()=>{let F=w.trim()===""?void 0:Ot(w);r==="create"?await o.createAuthOrganization({logo:v.trim()===""?void 0:v.trim(),metadata:F,name:u.trim(),ownerId:C.trim()===""?void 0:C.trim(),slug:f.trim()===""?void 0:f.trim()}):await o.updateAuthOrganization({logo:v.trim()===""?void 0:v.trim(),metadata:F,name:u.trim()===""?void 0:u.trim(),organizationId:S(i?.id),slug:f.trim()===""?void 0:f.trim()}),h(),d()})},"_"),e[9]=o,e[10]=v,e[11]=w,e[12]=r,e[13]=u,e[14]=d,e[15]=h,e[16]=i?.id,e[17]=C,e[18]=m,e[19]=f,e[20]=O):O=e[20];let A=O,D;e[21]!==r||e[22]!==u?(D=u.trim()!==""||r==="edit",e[21]=r,e[22]=u,e[23]=D):D=e[23];let T;e[24]!==r||e[25]!==l?(T=l(r==="create"?"Create":"Save"),e[24]=r,e[25]=l,e[26]=T):T=e[26];let M;e[27]!==r||e[28]!==l?(M=l(r==="create"?"New organization":"Edit organization"),e[27]=r,e[28]=l,e[29]=M):M=e[29];let P;e[30]!==l?(P=l("name"),e[30]=l,e[31]=P):P=e[31];let Q;e[32]===Symbol.for("react.memo_cache_sentinel")?(Q=c(F=>{g(F.target.value)},"q"),e[32]=Q):Q=e[32];let B;e[33]!==u?(B=(0,a.jsx)(Z,{"data-testid":"org-form-name",id:"org-form-name",onChange:Q,value:u}),e[33]=u,e[34]=B):B=e[34];let E;e[35]!==B||e[36]!==P?(E=(0,a.jsx)(X,{htmlFor:"org-form-name",label:P,children:B}),e[35]=B,e[36]=P,e[37]=E):E=e[37];let J;e[38]!==l?(J=l("Slug (optional \u2014 derived from name)"),e[38]=l,e[39]=J):J=e[39];let Y;e[40]===Symbol.for("react.memo_cache_sentinel")?(Y=c(F=>{y(F.target.value)},"K"),e[40]=Y):Y=e[40];let R;e[41]!==f?(R=(0,a.jsx)(Z,{"data-testid":"org-form-slug",id:"org-form-slug",onChange:Y,value:f}),e[41]=f,e[42]=R):R=e[42];let $;e[43]!==J||e[44]!==R?($=(0,a.jsx)(X,{htmlFor:"org-form-slug",label:J,children:R}),e[43]=J,e[44]=R,e[45]=$):$=e[45];let K;e[46]!==l?(K=l("Logo URL (optional)"),e[46]=l,e[47]=K):K=e[47];let ie;e[48]===Symbol.for("react.memo_cache_sentinel")?(ie=c(F=>{I(F.target.value)},"ne"),e[48]=ie):ie=e[48];let H;e[49]!==v?(H=(0,a.jsx)(Z,{"data-testid":"org-form-logo",id:"org-form-logo",onChange:ie,value:v}),e[49]=v,e[50]=H):H=e[50];let ee;e[51]!==K||e[52]!==H?(ee=(0,a.jsx)(X,{htmlFor:"org-form-logo",label:K,children:H}),e[51]=K,e[52]=H,e[53]=ee):ee=e[53];let W;e[54]!==r||e[55]!==C||e[56]!==l?(W=r==="create"&&(0,a.jsx)(X,{htmlFor:"org-form-owner",label:l("Owner user id (optional)"),children:(0,a.jsx)(Z,{"data-testid":"org-form-owner",id:"org-form-owner",onChange:c(F=>{z(F.target.value)},"onChange"),value:C})}),e[54]=r,e[55]=C,e[56]=l,e[57]=W):W=e[57];let te;e[58]!==l?(te=l("Metadata (JSON, optional)"),e[58]=l,e[59]=te):te=e[59];let oe;e[60]===Symbol.for("react.memo_cache_sentinel")?(oe=c(F=>{N(F.target.value)},"le"),e[60]=oe):oe=e[60];let V;e[61]!==w?(V=(0,a.jsx)(yt,{"data-testid":"org-form-metadata",id:"org-form-metadata",onChange:oe,value:w}),e[61]=w,e[62]=V):V=e[62];let _;e[63]!==te||e[64]!==V?(_=(0,a.jsx)(X,{htmlFor:"org-form-metadata",label:te,children:V}),e[63]=te,e[64]=V,e[65]=_):_=e[65];let ae;return e[66]!==n||e[67]!==s||e[68]!==d||e[69]!==A||e[70]!==E||e[71]!==$||e[72]!==ee||e[73]!==W||e[74]!==_||e[75]!==D||e[76]!==T||e[77]!==M?(ae=(0,a.jsxs)(de,{busy:n,canSubmit:D,error:s,onClose:d,onSubmit:A,submitLabel:T,testId:"org-form",title:M,children:[E,$,ee,W,_]}),e[66]=n,e[67]=s,e[68]=d,e[69]=A,e[70]=E,e[71]=$,e[72]=ee,e[73]=W,e[74]=_,e[75]=D,e[76]=T,e[77]=M,e[78]=ae):ae=e[78],ae},"ht"),Lt=c(t=>{let e=(0,U.c)(40),{onClose:r,onDone:d,organizationId:h}=t,i=re(),o=q(),{busy:l,error:n,run:s}=ne(),[m,b]=(0,j.useState)(""),[u,g]=(0,j.useState)(""),p;e[0]!==i||e[1]!==r||e[2]!==d||e[3]!==h||e[4]!==u||e[5]!==s||e[6]!==m?(p=c(()=>{s(async()=>{await i.addAuthOrgMember({organizationId:h,role:u.trim()===""?void 0:u.trim(),userId:m.trim()}),d(),r()})},"b"),e[0]=i,e[1]=r,e[2]=d,e[3]=h,e[4]=u,e[5]=s,e[6]=m,e[7]=p):p=e[7];let f=p,y;e[8]!==m?(y=m.trim(),e[8]=m,e[9]=y):y=e[9];let k=y!=="",v;e[10]!==o?(v=o("Add member"),e[10]=o,e[11]=v):v=e[11];let I;e[12]!==o?(I=o("Add member"),e[12]=o,e[13]=I):I=e[13];let C;e[14]!==o?(C=o("User id"),e[14]=o,e[15]=C):C=e[15];let z;e[16]===Symbol.for("react.memo_cache_sentinel")?(z=c(M=>{b(M.target.value)},"w"),e[16]=z):z=e[16];let x;e[17]!==m?(x=(0,a.jsx)(Z,{"data-testid":"org-add-member-user",id:"org-add-member-user",onChange:z,value:m}),e[17]=m,e[18]=x):x=e[18];let w;e[19]!==C||e[20]!==x?(w=(0,a.jsx)(X,{htmlFor:"org-add-member-user",label:C,children:x}),e[19]=C,e[20]=x,e[21]=w):w=e[21];let N;e[22]!==o?(N=o("Role (optional)"),e[22]=o,e[23]=N):N=e[23];let O;e[24]===Symbol.for("react.memo_cache_sentinel")?(O=c(M=>{g(M.target.value)},"_"),e[24]=O):O=e[24];let A;e[25]!==u?(A=(0,a.jsx)(Z,{"data-testid":"org-add-member-role",id:"org-add-member-role",onChange:O,value:u}),e[25]=u,e[26]=A):A=e[26];let D;e[27]!==N||e[28]!==A?(D=(0,a.jsx)(X,{htmlFor:"org-add-member-role",label:N,children:A}),e[27]=N,e[28]=A,e[29]=D):D=e[29];let T;return e[30]!==l||e[31]!==n||e[32]!==r||e[33]!==f||e[34]!==D||e[35]!==k||e[36]!==v||e[37]!==I||e[38]!==w?(T=(0,a.jsxs)(de,{busy:l,canSubmit:k,error:n,onClose:r,onSubmit:f,submitLabel:v,testId:"org-add-member",title:I,children:[w,D]}),e[30]=l,e[31]=n,e[32]=r,e[33]=f,e[34]=D,e[35]=k,e[36]=v,e[37]=I,e[38]=w,e[39]=T):T=e[39],T},"Rt"),jt=c(t=>{let e=(0,U.c)(40),{onClose:r,onDone:d,organizationId:h}=t,i=re(),o=q(),{busy:l,error:n,run:s}=ne(),[m,b]=(0,j.useState)(""),[u,g]=(0,j.useState)(""),p;e[0]!==i||e[1]!==m||e[2]!==r||e[3]!==d||e[4]!==h||e[5]!==u||e[6]!==s?(p=c(()=>{s(async()=>{await i.inviteAuthOrgMember({email:m.trim(),organizationId:h,role:u.trim()===""?void 0:u.trim()}),d(),r()})},"b"),e[0]=i,e[1]=m,e[2]=r,e[3]=d,e[4]=h,e[5]=u,e[6]=s,e[7]=p):p=e[7];let f=p,y;e[8]!==m?(y=m.trim(),e[8]=m,e[9]=y):y=e[9];let k=y!=="",v;e[10]!==o?(v=o("Send invitation"),e[10]=o,e[11]=v):v=e[11];let I;e[12]!==o?(I=o("Invite member"),e[12]=o,e[13]=I):I=e[13];let C;e[14]!==o?(C=o("email"),e[14]=o,e[15]=C):C=e[15];let z;e[16]===Symbol.for("react.memo_cache_sentinel")?(z=c(M=>{b(M.target.value)},"w"),e[16]=z):z=e[16];let x;e[17]!==m?(x=(0,a.jsx)(Z,{"data-testid":"org-invite-member-email",id:"org-invite-member-email",onChange:z,type:"email",value:m}),e[17]=m,e[18]=x):x=e[18];let w;e[19]!==C||e[20]!==x?(w=(0,a.jsx)(X,{htmlFor:"org-invite-member-email",label:C,children:x}),e[19]=C,e[20]=x,e[21]=w):w=e[21];let N;e[22]!==o?(N=o("Role (optional)"),e[22]=o,e[23]=N):N=e[23];let O;e[24]===Symbol.for("react.memo_cache_sentinel")?(O=c(M=>{g(M.target.value)},"_"),e[24]=O):O=e[24];let A;e[25]!==u?(A=(0,a.jsx)(Z,{"data-testid":"org-invite-member-role",id:"org-invite-member-role",onChange:O,value:u}),e[25]=u,e[26]=A):A=e[26];let D;e[27]!==N||e[28]!==A?(D=(0,a.jsx)(X,{htmlFor:"org-invite-member-role",label:N,children:A}),e[27]=N,e[28]=A,e[29]=D):D=e[29];let T;return e[30]!==l||e[31]!==n||e[32]!==r||e[33]!==f||e[34]!==D||e[35]!==k||e[36]!==v||e[37]!==I||e[38]!==w?(T=(0,a.jsxs)(de,{busy:l,canSubmit:k,error:n,onClose:r,onSubmit:f,submitLabel:v,testId:"org-invite-member",title:I,children:[w,D]}),e[30]=l,e[31]=n,e[32]=r,e[33]=f,e[34]=D,e[35]=k,e[36]=v,e[37]=I,e[38]=w,e[39]=T):T=e[39],T},"Ft"),Pt=c(t=>{let e=(0,U.c)(32),{member:r,onClose:d,onDone:h}=t,i=re(),o=q(),{busy:l,error:n,run:s}=ne(),m;e[0]!==r.role?(m=c(()=>S(r.role),"m"),e[0]=r.role,e[1]=m):m=e[1];let[b,u]=(0,j.useState)(m),g;e[2]!==i||e[3]!==r.id||e[4]!==d||e[5]!==h||e[6]!==b||e[7]!==s?(g=c(()=>{s(async()=>{await i.setAuthOrgMemberRole({memberId:S(r.id),role:b.trim()}),h(),d()})},"f"),e[2]=i,e[3]=r.id,e[4]=d,e[5]=h,e[6]=b,e[7]=s,e[8]=g):g=e[8];let p=g,f;e[9]!==b?(f=b.trim(),e[9]=b,e[10]=f):f=e[10];let y=f!=="",k;e[11]!==o?(k=o("Save"),e[11]=o,e[12]=k):k=e[12];let v;e[13]!==o?(v=o("Change member role"),e[13]=o,e[14]=v):v=e[14];let I;e[15]!==o?(I=o("Role"),e[15]=o,e[16]=I):I=e[16];let C;e[17]===Symbol.for("react.memo_cache_sentinel")?(C=c(N=>{u(N.target.value)},"y"),e[17]=C):C=e[17];let z;e[18]!==b?(z=(0,a.jsx)(Z,{"data-testid":"org-member-role-value",id:"org-member-role-value",onChange:C,value:b}),e[18]=b,e[19]=z):z=e[19];let x;e[20]!==I||e[21]!==z?(x=(0,a.jsx)(X,{htmlFor:"org-member-role-value",label:I,children:z}),e[20]=I,e[21]=z,e[22]=x):x=e[22];let w;return e[23]!==l||e[24]!==n||e[25]!==d||e[26]!==p||e[27]!==x||e[28]!==y||e[29]!==k||e[30]!==v?(w=(0,a.jsx)(de,{busy:l,canSubmit:y,error:n,onClose:d,onSubmit:p,submitLabel:k,testId:"org-member-role",title:v,children:x}),e[23]=l,e[24]=n,e[25]=d,e[26]=p,e[27]=x,e[28]=y,e[29]=k,e[30]=v,e[31]=w):w=e[31],w},"Et"),At=c(t=>{let e=(0,U.c)(36),{mode:r,onClose:d,onDone:h,organizationId:i,team:o}=t,l=re(),n=q(),{busy:s,error:m,run:b}=ne(),u;e[0]!==o?(u=o?S(o.name):"",e[0]=o,e[1]=u):u=e[1];let[g,p]=(0,j.useState)(u),f;e[2]!==l||e[3]!==r||e[4]!==g||e[5]!==d||e[6]!==h||e[7]!==i||e[8]!==b||e[9]!==o?.id?(f=c(()=>{b(async()=>{await(r==="create"?l.createAuthOrgTeam({name:g.trim(),organizationId:i}):l.updateAuthOrgTeam({name:g.trim(),teamId:S(o?.id)})),h(),d()})},"h"),e[2]=l,e[3]=r,e[4]=g,e[5]=d,e[6]=h,e[7]=i,e[8]=b,e[9]=o?.id,e[10]=f):f=e[10];let y=f,k;e[11]!==g?(k=g.trim(),e[11]=g,e[12]=k):k=e[12];let v=k!=="",I;e[13]!==r||e[14]!==n?(I=n(r==="create"?"Create":"Save"),e[13]=r,e[14]=n,e[15]=I):I=e[15];let C;e[16]!==r||e[17]!==n?(C=n(r==="create"?"New team":"Rename team"),e[16]=r,e[17]=n,e[18]=C):C=e[18];let z;e[19]!==n?(z=n("name"),e[19]=n,e[20]=z):z=e[20];let x;e[21]===Symbol.for("react.memo_cache_sentinel")?(x=c(A=>{p(A.target.value)},"x"),e[21]=x):x=e[21];let w;e[22]!==g?(w=(0,a.jsx)(Z,{"data-testid":"org-team-form-name",id:"org-team-form-name",onChange:x,value:g}),e[22]=g,e[23]=w):w=e[23];let N;e[24]!==z||e[25]!==w?(N=(0,a.jsx)(X,{htmlFor:"org-team-form-name",label:z,children:w}),e[24]=z,e[25]=w,e[26]=N):N=e[26];let O;return e[27]!==s||e[28]!==m||e[29]!==d||e[30]!==y||e[31]!==N||e[32]!==v||e[33]!==I||e[34]!==C?(O=(0,a.jsx)(de,{busy:s,canSubmit:v,error:m,onClose:d,onSubmit:y,submitLabel:I,testId:"org-team-form",title:C,children:N}),e[27]=s,e[28]=m,e[29]=d,e[30]=y,e[31]=N,e[32]=v,e[33]=I,e[34]=C,e[35]=O):O=e[35],O},"bt"),Bt=c(t=>{let e=(0,U.c)(30),{onClose:r,onDone:d,teamId:h}=t,i=re(),o=q(),{busy:l,error:n,run:s}=ne(),[m,b]=(0,j.useState)(""),u;e[0]!==i||e[1]!==r||e[2]!==d||e[3]!==s||e[4]!==h||e[5]!==m?(u=c(()=>{s(async()=>{await i.addAuthOrgTeamMember({teamId:h,userId:m.trim()}),d(),r()})},"c"),e[0]=i,e[1]=r,e[2]=d,e[3]=s,e[4]=h,e[5]=m,e[6]=u):u=e[6];let g=u,p;e[7]!==m?(p=m.trim(),e[7]=m,e[8]=p):p=e[8];let f=p!=="",y;e[9]!==o?(y=o("Add member"),e[9]=o,e[10]=y):y=e[10];let k;e[11]!==o?(k=o("Add team member"),e[11]=o,e[12]=k):k=e[12];let v;e[13]!==o?(v=o("User id"),e[13]=o,e[14]=v):v=e[14];let I;e[15]===Symbol.for("react.memo_cache_sentinel")?(I=c(w=>{b(w.target.value)},"C"),e[15]=I):I=e[15];let C;e[16]!==m?(C=(0,a.jsx)(Z,{"data-testid":"org-team-add-member-user",id:"org-team-add-member-user",onChange:I,value:m}),e[16]=m,e[17]=C):C=e[17];let z;e[18]!==v||e[19]!==C?(z=(0,a.jsx)(X,{htmlFor:"org-team-add-member-user",label:v,children:C}),e[18]=v,e[19]=C,e[20]=z):z=e[20];let x;return e[21]!==l||e[22]!==n||e[23]!==r||e[24]!==g||e[25]!==f||e[26]!==y||e[27]!==k||e[28]!==z?(x=(0,a.jsx)(de,{busy:l,canSubmit:f,error:n,onClose:r,onSubmit:g,submitLabel:y,testId:"org-team-add-member",title:k,children:z}),e[21]=l,e[22]=n,e[23]=r,e[24]=g,e[25]=f,e[26]=y,e[27]=k,e[28]=z,e[29]=x):x=e[29],x},"jt"),_t=c(t=>{let e=(0,U.c)(47),{mode:r,onClose:d,onDone:h,organizationId:i,role:o}=t,l=re(),n=q(),{busy:s,error:m,run:b}=ne(),u;e[0]!==o?(u=o?S(o.role):"",e[0]=o,e[1]=u):u=e[1];let[g,p]=(0,j.useState)(u),f;e[2]!==r||e[3]!==o?.permission?(f=r==="edit"?Tt(o?.permission):"",e[2]=r,e[3]=o?.permission,e[4]=f):f=e[4];let[y,k]=(0,j.useState)(f),v;e[5]!==l||e[6]!==r||e[7]!==g||e[8]!==d||e[9]!==h||e[10]!==i||e[11]!==y||e[12]!==o?.id||e[13]!==b?(v=c(()=>{b(async()=>{let M=Et(y);await(r==="create"?l.createAuthOrgRole({organizationId:i,permission:M,role:g.trim()}):l.updateAuthOrgRole({permission:M,roleId:S(o?.id)})),h(),d()})},"p"),e[5]=l,e[6]=r,e[7]=g,e[8]=d,e[9]=h,e[10]=i,e[11]=y,e[12]=o?.id,e[13]=b,e[14]=v):v=e[14];let I=v,C;e[15]!==r||e[16]!==g||e[17]!==y?(C=y.trim()!==""&&(r==="edit"||g.trim()!==""),e[15]=r,e[16]=g,e[17]=y,e[18]=C):C=e[18];let z;e[19]!==r||e[20]!==n?(z=n(r==="create"?"Create":"Save"),e[19]=r,e[20]=n,e[21]=z):z=e[21];let x;e[22]!==r||e[23]!==n?(x=n(r==="create"?"New role":"Edit role"),e[22]=r,e[23]=n,e[24]=x):x=e[24];let w;e[25]!==r||e[26]!==g||e[27]!==n?(w=r==="create"&&(0,a.jsx)(X,{htmlFor:"org-role-form-name",label:n("Role name"),children:(0,a.jsx)(Z,{"data-testid":"org-role-form-name",id:"org-role-form-name",onChange:c(M=>{p(M.target.value)},"onChange"),value:g})}),e[25]=r,e[26]=g,e[27]=n,e[28]=w):w=e[28];let N;e[29]!==n?(N=n('Permission (JSON, e.g. {"project":["create","update"]})'),e[29]=n,e[30]=N):N=e[30];let O;e[31]===Symbol.for("react.memo_cache_sentinel")?(O=c(M=>{k(M.target.value)},"_"),e[31]=O):O=e[31];let A;e[32]!==y?(A=(0,a.jsx)(yt,{"data-testid":"org-role-form-permission",id:"org-role-form-permission",onChange:O,value:y}),e[32]=y,e[33]=A):A=e[33];let D;e[34]!==A||e[35]!==N?(D=(0,a.jsx)(X,{htmlFor:"org-role-form-permission",label:N,children:A}),e[34]=A,e[35]=N,e[36]=D):D=e[36];let T;return e[37]!==s||e[38]!==m||e[39]!==d||e[40]!==I||e[41]!==D||e[42]!==C||e[43]!==z||e[44]!==x||e[45]!==w?(T=(0,a.jsxs)(de,{busy:s,canSubmit:C,error:m,onClose:d,onSubmit:I,submitLabel:z,testId:"org-role-form",title:x,children:[w,D]}),e[37]=s,e[38]=m,e[39]=d,e[40]=I,e[41]=D,e[42]=C,e[43]=z,e[44]=x,e[45]=w,e[46]=T):T=e[46],T},"pt"),Mt=c(t=>{let e=(0,U.c)(18),{action:r,message:d,onClose:h,onDone:i,testId:o,title:l}=t,n=q(),{busy:s,error:m,run:b}=ne(),u;e[0]!==r||e[1]!==h||e[2]!==i||e[3]!==b?(u=c(()=>{b(async()=>{await r(),i(),h()})},"c"),e[0]=r,e[1]=h,e[2]=i,e[3]=b,e[4]=u):u=e[4];let g=u,p;e[5]!==n?(p=n("Delete"),e[5]=n,e[6]=p):p=e[6];let f;e[7]!==d?(f=(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:d}),e[7]=d,e[8]=f):f=e[8];let y;return e[9]!==s||e[10]!==m||e[11]!==h||e[12]!==g||e[13]!==p||e[14]!==f||e[15]!==o||e[16]!==l?(y=(0,a.jsx)(de,{busy:s,canSubmit:!0,destructive:!0,error:m,onClose:h,onSubmit:g,submitLabel:p,testId:o,title:l,children:f}),e[9]=s,e[10]=m,e[11]=h,e[12]=g,e[13]=p,e[14]=f,e[15]=o,e[16]=l,e[17]=y):y=e[17],y},"zt"),Ge=c(t=>{let e=(0,U.c)(13),{action:r,children:d,heading:h,testId:i}=t,o;e[0]!==h?(o=(0,a.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:h}),e[0]=h,e[1]=o):o=e[1];let l;e[2]!==r?(l=r!==void 0&&(0,a.jsx)("div",{className:"flex items-center gap-2",children:r}),e[2]=r,e[3]=l):l=e[3];let n;e[4]!==o||e[5]!==l?(n=(0,a.jsxs)("header",{className:"flex items-center justify-between gap-2 border-b border-border px-4 py-3",children:[o,l]}),e[4]=o,e[5]=l,e[6]=n):n=e[6];let s;e[7]!==d?(s=(0,a.jsx)(bt,{className:"px-0",children:d}),e[7]=d,e[8]=s):s=e[8];let m;return e[9]!==n||e[10]!==s||e[11]!==i?(m=(0,a.jsxs)(ht,{className:"overflow-hidden py-0","data-testid":i,children:[n,s]}),e[9]=n,e[10]=s,e[11]=i,e[12]=m):m=e[12],m},"Ve"),He=c(t=>{let e=(0,U.c)(23),{columns:r,rowActions:d,rowPrefix:h,rows:i}=t,o=q(),l;e[0]!==r?(l=r.map(Jt),e[0]=r,e[1]=l):l=e[1];let n;e[2]!==o?(n=o("Actions"),e[2]=o,e[3]=n):n=e[3];let s;e[4]!==n?(s=(0,a.jsx)(se,{"aria-label":n}),e[4]=n,e[5]=s):s=e[5];let m;e[6]!==l||e[7]!==s?(m=(0,a.jsx)(pt,{children:(0,a.jsxs)(Ze,{children:[l,s]})}),e[6]=l,e[7]=s,e[8]=m):m=e[8];let b;if(e[9]!==r||e[10]!==d||e[11]!==h||e[12]!==i){let p;e[14]!==r||e[15]!==d||e[16]!==h?(p=c((f,y)=>{let k=S(f.id),v=k===""?`index-${y.toString()}`:k;return(0,a.jsxs)(Ze,{"data-testid":`${h}-${v}`,children:[r.map(I=>(0,a.jsx)(me,{className:I.className,children:I.render(f)},I.head)),(0,a.jsx)(me,{children:(0,a.jsx)("div",{className:"flex justify-end gap-1",children:d(f)})})]},v)},"b"),e[14]=r,e[15]=d,e[16]=h,e[17]=p):p=e[17],b=i.map(p),e[9]=r,e[10]=d,e[11]=h,e[12]=i,e[13]=b}else b=e[13];let u;e[18]!==b?(u=(0,a.jsx)(vt,{children:b}),e[18]=b,e[19]=u):u=e[19];let g;return e[20]!==m||e[21]!==u?(g=(0,a.jsxs)(ft,{children:[m,u]}),e[20]=m,e[21]=u,e[22]=g):g=e[22],g},"We");function Jt(t){return(0,a.jsx)(se,{children:t.head},t.head)}c(Jt,"Lt");var Ut=c(t=>{let e=(0,U.c)(30),{actionBusy:r,onRemoveMember:d,memberColumns:h,members:i,onDialog:o}=t,l=q(),n;e[0]!==o?(n=c(()=>{o({kind:"add-member"})},"r"),e[0]=o,e[1]=n):n=e[1];let s;e[2]!==l?(s=l("Add member"),e[2]=l,e[3]=s):s=e[3];let m;e[4]!==n||e[5]!==s?(m=(0,a.jsx)(L,{"data-testid":"org-open-add-member",onClick:n,size:"xs",type:"button",variant:"outline",children:s}),e[4]=n,e[5]=s,e[6]=m):m=e[6];let b;e[7]!==o?(b=c(()=>{o({kind:"invite-member"})},"g"),e[7]=o,e[8]=b):b=e[8];let u;e[9]!==l?(u=l("Invite member"),e[9]=l,e[10]=u):u=e[10];let g;e[11]!==b||e[12]!==u?(g=(0,a.jsx)(L,{"data-testid":"org-open-invite-member",onClick:b,size:"xs",type:"button",variant:"outline",children:u}),e[11]=b,e[12]=u,e[13]=g):g=e[13];let p;e[14]!==m||e[15]!==g?(p=(0,a.jsxs)(a.Fragment,{children:[m,g]}),e[14]=m,e[15]=g,e[16]=p):p=e[16];let f;e[17]!==l?(f=l("Members"),e[17]=l,e[18]=f):f=e[18];let y;e[19]!==r||e[20]!==h||e[21]!==i||e[22]!==o||e[23]!==d||e[24]!==l?(y=i.length===0?(0,a.jsx)("div",{className:"p-3",children:(0,a.jsx)(ce,{testId:"org-members-empty",title:l("No members.")})}):(0,a.jsx)(He,{columns:h,rowActions:c(v=>(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(L,{"data-testid":`org-member-role-${S(v.id)}`,onClick:c(()=>{o({kind:"member-role",member:v})},"onClick"),size:"xs",type:"button",variant:"ghost",children:l("Change role")}),(0,a.jsx)(L,{"data-testid":`org-remove-member-${S(v.id)}`,disabled:r,onClick:c(()=>{d(S(v.id))},"onClick"),size:"xs",type:"button",variant:"ghost",children:l("Remove")})]}),"rowActions"),rowPrefix:"org-member",rows:i}),e[19]=r,e[20]=h,e[21]=i,e[22]=o,e[23]=d,e[24]=l,e[25]=y):y=e[25];let k;return e[26]!==p||e[27]!==f||e[28]!==y?(k=(0,a.jsx)(Ge,{action:p,heading:f,testId:"org-members",children:y}),e[26]=p,e[27]=f,e[28]=y,e[29]=k):k=e[29],k},"Pt"),qt=c(t=>{let e=(0,U.c)(21),{onConfirmDeleteTeam:r,onDialog:d,onSelectTeam:h,selectedTeam:i,teamColumns:o,teams:l}=t,n=q(),s;e[0]!==d?(s=c(()=>{d({kind:"team-create"})},"a"),e[0]=d,e[1]=s):s=e[1];let m;e[2]!==n?(m=n("New team"),e[2]=n,e[3]=m):m=e[3];let b;e[4]!==s||e[5]!==m?(b=(0,a.jsx)(L,{"data-testid":"org-open-create-team",onClick:s,size:"xs",type:"button",variant:"outline",children:m}),e[4]=s,e[5]=m,e[6]=b):b=e[6];let u;e[7]!==n?(u=n("Teams"),e[7]=n,e[8]=u):u=e[8];let g;e[9]!==r||e[10]!==d||e[11]!==h||e[12]!==i||e[13]!==n||e[14]!==o||e[15]!==l?(g=l.length===0?(0,a.jsx)("div",{className:"p-3",children:(0,a.jsx)(ce,{testId:"org-teams-empty",title:n("No teams.")})}):(0,a.jsx)(He,{columns:o,rowActions:c(f=>(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(L,{"aria-pressed":i===S(f.id),"data-testid":`org-team-select-${S(f.id)}`,onClick:c(()=>{h(S(f.id))},"onClick"),size:"xs",type:"button",variant:"ghost",children:n("Members")}),(0,a.jsx)(L,{"data-testid":`org-team-rename-${S(f.id)}`,onClick:c(()=>{d({kind:"team-rename",team:f})},"onClick"),size:"xs",type:"button",variant:"ghost",children:n("Rename")}),(0,a.jsx)(L,{"data-testid":`org-team-delete-${S(f.id)}`,onClick:c(()=>{r(f)},"onClick"),size:"xs",type:"button",variant:"ghost",children:n("Delete")})]}),"rowActions"),rowPrefix:"org-team",rows:l}),e[9]=r,e[10]=d,e[11]=h,e[12]=i,e[13]=n,e[14]=o,e[15]=l,e[16]=g):g=e[16];let p;return e[17]!==b||e[18]!==u||e[19]!==g?(p=(0,a.jsx)(Ge,{action:b,heading:u,testId:"org-teams",children:g}),e[17]=b,e[18]=u,e[19]=g,e[20]=p):p=e[20],p},"Bt"),Kt=c(t=>{let e=(0,U.c)(20),{actionBusy:r,onRemoveTeamMember:d,onDialog:h,selectedTeam:i,teamMemberColumns:o,teamMembers:l}=t,n=q(),s;e[0]!==h||e[1]!==i?(s=c(()=>{h({kind:"team-add-member",teamId:i})},"a"),e[0]=h,e[1]=i,e[2]=s):s=e[2];let m;e[3]!==n?(m=n("Add member"),e[3]=n,e[4]=m):m=e[4];let b;e[5]!==s||e[6]!==m?(b=(0,a.jsx)(L,{"data-testid":"org-open-add-team-member",onClick:s,size:"xs",type:"button",variant:"outline",children:m}),e[5]=s,e[6]=m,e[7]=b):b=e[7];let u;e[8]!==n?(u=n("Team members"),e[8]=n,e[9]=u):u=e[9];let g;e[10]!==r||e[11]!==d||e[12]!==n||e[13]!==o||e[14]!==l?(g=l.length===0?(0,a.jsx)("div",{className:"p-3",children:(0,a.jsx)(ce,{testId:"org-team-members-empty",title:n("No team members.")})}):(0,a.jsx)(He,{columns:o,rowActions:c(f=>(0,a.jsx)(L,{"data-testid":`org-team-remove-member-${S(f.id)}`,disabled:r,onClick:c(()=>{d(S(f.id))},"onClick"),size:"xs",type:"button",variant:"ghost",children:n("Remove")}),"rowActions"),rowPrefix:"org-team-member",rows:l}),e[10]=r,e[11]=d,e[12]=n,e[13]=o,e[14]=l,e[15]=g):g=e[15];let p;return e[16]!==b||e[17]!==u||e[18]!==g?(p=(0,a.jsx)(Ge,{action:b,heading:u,testId:"org-team-members",children:g}),e[16]=b,e[17]=u,e[18]=g,e[19]=p):p=e[19],p},"Qt"),Qt=c(t=>{let e=(0,U.c)(19),{onConfirmDeleteRole:r,onDialog:d,roleColumns:h,roles:i}=t,o=q(),l;e[0]!==d?(l=c(()=>{d({kind:"role-create"})},"o"),e[0]=d,e[1]=l):l=e[1];let n;e[2]!==o?(n=o("New role"),e[2]=o,e[3]=n):n=e[3];let s;e[4]!==l||e[5]!==n?(s=(0,a.jsx)(L,{"data-testid":"org-open-create-role",onClick:l,size:"xs",type:"button",variant:"outline",children:n}),e[4]=l,e[5]=n,e[6]=s):s=e[6];let m;e[7]!==o?(m=o("Roles"),e[7]=o,e[8]=m):m=e[8];let b;e[9]!==r||e[10]!==d||e[11]!==h||e[12]!==i||e[13]!==o?(b=i.length===0?(0,a.jsx)("div",{className:"p-3",children:(0,a.jsx)(ce,{testId:"org-roles-empty",title:o("No custom roles.")})}):(0,a.jsx)(He,{columns:h,rowActions:c(g=>(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(L,{"data-testid":`org-role-edit-${S(g.id)}`,onClick:c(()=>{d({kind:"role-edit",role:g})},"onClick"),size:"xs",type:"button",variant:"ghost",children:o("Edit")}),(0,a.jsx)(L,{"data-testid":`org-role-delete-${S(g.id)}`,onClick:c(()=>{r(S(g.id))},"onClick"),size:"xs",type:"button",variant:"ghost",children:o("Delete")})]}),"rowActions"),rowPrefix:"org-role",rows:i}),e[9]=r,e[10]=d,e[11]=h,e[12]=i,e[13]=o,e[14]=b):b=e[14];let u;return e[15]!==s||e[16]!==m||e[17]!==b?(u=(0,a.jsx)(Ge,{action:s,heading:m,testId:"org-roles",children:b}),e[15]=s,e[16]=m,e[17]=b,e[18]=u):u=e[18],u},"Jt"),Xt=c(t=>{let e=(0,U.c)(199),{organizationId:r,rolesEnabled:d,teamsEnabled:h}=t,i=re(),o=q(),[l,n]=(0,j.useState)(null),[s,m]=(0,j.useState)(null),[b,u]=(0,j.useState)(!1),[g,p]=(0,j.useState)(null),f;e[0]!==r?(f=["lunora-auth-org-members",r],e[0]=r,e[1]=f):f=e[1];let y;e[2]!==i||e[3]!==r?(y=c(()=>i.listAuthOrgMembers({limit:200,organizationId:r}),"v"),e[2]=i,e[3]=r,e[4]=y):y=e[4];let k=ue(f,y),v;e[5]!==r?(v=["lunora-auth-org-invitations",r],e[5]=r,e[6]=v):v=e[6];let I;e[7]!==i||e[8]!==r?(I=c(()=>i.listAuthOrgInvitations({limit:200,organizationId:r}),"C"),e[7]=i,e[8]=r,e[9]=I):I=e[9];let C=ue(v,I),z;e[10]!==r?(z=["lunora-auth-org-teams",r],e[10]=r,e[11]=z):z=e[11];let x;e[12]!==i||e[13]!==r?(x=c(()=>i.listAuthOrgTeams({limit:200,organizationId:r}),"x"),e[12]=i,e[13]=r,e[14]=x):x=e[14];let w;e[15]!==h?(w={enabled:h},e[15]=h,e[16]=w):w=e[16];let N=ue(z,x,w),O;e[17]!==r?(O=["lunora-auth-org-roles",r],e[17]=r,e[18]=O):O=e[18];let A;e[19]!==i||e[20]!==r?(A=c(()=>i.listAuthOrgRoles({limit:200,organizationId:r}),"N"),e[19]=i,e[20]=r,e[21]=A):A=e[21];let D;e[22]!==d?(D={enabled:d},e[22]=d,e[23]=D):D=e[23];let T=ue(O,A,D),M;e[24]!==s?(M=["lunora-auth-org-team-members",s],e[24]=s,e[25]=M):M=e[25];let P;e[26]!==i||e[27]!==s?(P=c(()=>i.listAuthOrgTeamMembers({limit:200,teamId:s??""}),"P"),e[26]=i,e[27]=s,e[28]=P):P=e[28];let Q=s!==null,B;e[29]!==Q?(B={enabled:Q},e[29]=Q,e[30]=B):B=e[30];let E=ue(M,P,B),J;e[31]!==k.data?.rows?(J=k.data?.rows??[],e[31]=k.data?.rows,e[32]=J):J=e[32];let Y=J,R;e[33]!==C.data?.rows?(R=C.data?.rows??[],e[33]=C.data?.rows,e[34]=R):R=e[34];let $=R,K;e[35]!==N.data?.rows?(K=N.data?.rows??[],e[35]=N.data?.rows,e[36]=K):K=e[36];let ie=K,H;e[37]!==T.data?.rows?(H=T.data?.rows??[],e[37]=T.data?.rows,e[38]=H):H=e[38];let ee=H,W;e[39]!==s||e[40]!==E?(W=s===null?[]:E.data?.rows??[],e[39]=s,e[40]=E,e[41]=W):W=e[41];let te=W,oe=k.error??C.error??N.error??T.error??E.error,V;e[42]!==C||e[43]!==k||e[44]!==d||e[45]!==T||e[46]!==s||e[47]!==E||e[48]!==h||e[49]!==N?(V=c(()=>{k.refetch(),C.refetch(),h&&N.refetch(),d&&T.refetch(),s!==null&&E.refetch()},"Z"),e[42]=C,e[43]=k,e[44]=d,e[45]=T,e[46]=s,e[47]=E,e[48]=h,e[49]=N,e[50]=V):V=e[50];let _=V;Ct(_,!0);let ae;e[51]===Symbol.for("react.memo_cache_sentinel")?(ae=c(()=>{n(null)},"ie"),e[51]=ae):ae=e[51];let F=ae,We;e[52]!==_?(We=c(G=>{wt((async()=>{u(!0),p(null);try{await G(),_(),u(!1)}catch(nt){p(xt(nt)),u(!1)}})())},"Xe"),e[52]=_,e[53]=We):We=e[53];let le=We,Ve;e[54]!==i||e[55]!==o?(Ve=c(G=>{let nt=S(G.id);n({action:c(async()=>{await i.removeAuthOrgTeam({teamId:nt}),m(It=>It===nt?null:It)},"action"),kind:"confirm",message:o("Delete this team and its memberships? This cannot be undone."),testId:"org-team-delete",title:o("Delete team")})},"Ye"),e[54]=i,e[55]=o,e[56]=Ve):Ve=e[56];let it=Ve,ge;e[57]!==o?(ge=o("userId"),e[57]=o,e[58]=ge):ge=e[58];let he;e[59]!==ge?(he={head:ge,render:Yt},e[59]=ge,e[60]=he):he=e[60];let be;e[61]!==o?(be=o("role"),e[61]=o,e[62]=be):be=e[62];let fe;e[63]!==be?(fe={head:be,render:Zt},e[63]=be,e[64]=fe):fe=e[64];let et;e[65]!==he||e[66]!==fe?(et=[he,fe],e[65]=he,e[66]=fe,e[67]=et):et=e[67];let st=et,pe;e[68]!==o?(pe=o("email"),e[68]=o,e[69]=pe):pe=e[69];let ve;e[70]!==pe?(ve={head:pe,render:Gt},e[70]=pe,e[71]=ve):ve=e[71];let ye;e[72]!==o?(ye=o("role"),e[72]=o,e[73]=ye):ye=e[73];let Ce;e[74]!==ye?(Ce={head:ye,render:Ht},e[74]=ye,e[75]=Ce):Ce=e[75];let Ie;e[76]!==o?(Ie=o("status"),e[76]=o,e[77]=Ie):Ie=e[77];let xe;e[78]!==Ie?(xe={head:Ie,render:Wt},e[78]=Ie,e[79]=xe):xe=e[79];let tt;e[80]!==ve||e[81]!==Ce||e[82]!==xe?(tt=[ve,Ce,xe],e[80]=ve,e[81]=Ce,e[82]=xe,e[83]=tt):tt=e[83];let mt=tt,we;e[84]!==o?(we=o("id"),e[84]=o,e[85]=we):we=e[85];let ke;e[86]!==we?(ke={className:"font-mono text-xs",head:we,render:Vt},e[86]=we,e[87]=ke):ke=e[87];let ze;e[88]!==o?(ze=o("name"),e[88]=o,e[89]=ze):ze=e[89];let Ne;e[90]!==ze?(Ne={head:ze,render:er},e[90]=ze,e[91]=Ne):Ne=e[91];let rt;e[92]!==ke||e[93]!==Ne?(rt=[ke,Ne],e[92]=ke,e[93]=Ne,e[94]=rt):rt=e[94];let dt=rt,Se;e[95]!==o?(Se=o("userId"),e[95]=o,e[96]=Se):Se=e[96];let ot;e[97]!==Se?(ot=[{head:Se,render:tr}],e[97]=Se,e[98]=ot):ot=e[98];let ct=ot,De;e[99]!==o?(De=o("role"),e[99]=o,e[100]=De):De=e[100];let Ae;e[101]!==De?(Ae={head:De,render:rr},e[101]=De,e[102]=Ae):Ae=e[102];let _e;e[103]!==o?(_e=o("Permission"),e[103]=o,e[104]=_e):_e=e[104];let Oe;e[105]!==_e?(Oe={className:"font-mono text-xs whitespace-pre-wrap",head:_e,render:or},e[105]=_e,e[106]=Oe):Oe=e[106];let at;e[107]!==Ae||e[108]!==Oe?(at=[Ae,Oe],e[107]=Ae,e[108]=Oe,e[109]=at):at=e[109];let ut=at,Te;e[110]!==oe?(Te=oe!==null&&(0,a.jsx)("p",{className:"text-sm text-destructive","data-testid":"org-detail-error",role:"alert",children:oe}),e[110]=oe,e[111]=Te):Te=e[111];let Me;e[112]!==g?(Me=g!==null&&(0,a.jsx)("p",{className:"text-sm text-destructive","data-testid":"org-action-error",role:"alert",children:g}),e[112]=g,e[113]=Me):Me=e[113];let Re;e[114]!==i||e[115]!==le?(Re=c(G=>{le(()=>i.removeAuthOrgMember({memberId:G}))},"Te"),e[114]=i,e[115]=le,e[116]=Re):Re=e[116];let $e;e[117]!==b||e[118]!==st||e[119]!==Y||e[120]!==Re?($e=(0,a.jsx)(Ut,{actionBusy:b,memberColumns:st,members:Y,onDialog:n,onRemoveMember:Re}),e[117]=b,e[118]=st,e[119]=Y,e[120]=Re,e[121]=$e):$e=e[121];let Fe;e[122]!==b||e[123]!==i||e[124]!==mt||e[125]!==$||e[126]!==le||e[127]!==o?(Fe=$.length>0&&(0,a.jsx)(Ge,{heading:o("Invitations"),testId:"org-invitations",children:(0,a.jsx)(He,{columns:mt,rowActions:c(G=>(0,a.jsx)(L,{"data-testid":`org-cancel-invitation-${S(G.id)}`,disabled:b,onClick:c(()=>{le(()=>i.cancelAuthOrgInvitation({invitationId:S(G.id)}))},"onClick"),size:"xs",type:"button",variant:"ghost",children:o("Cancel")}),"rowActions"),rowPrefix:"org-invitation",rows:$})}),e[122]=b,e[123]=i,e[124]=mt,e[125]=$,e[126]=le,e[127]=o,e[128]=Fe):Fe=e[128];let Ee;e[129]!==it||e[130]!==s||e[131]!==dt||e[132]!==ie||e[133]!==h?(Ee=h&&(0,a.jsx)(qt,{onConfirmDeleteTeam:it,onDialog:n,onSelectTeam:m,selectedTeam:s,teamColumns:dt,teams:ie}),e[129]=it,e[130]=s,e[131]=dt,e[132]=ie,e[133]=h,e[134]=Ee):Ee=e[134];let Le;e[135]!==b||e[136]!==i||e[137]!==le||e[138]!==s||e[139]!==ct||e[140]!==te||e[141]!==h?(Le=h&&s!==null&&(0,a.jsx)(Kt,{actionBusy:b,onDialog:n,onRemoveTeamMember:c(G=>{le(()=>i.removeAuthOrgTeamMember({teamMemberId:G}))},"onRemoveTeamMember"),selectedTeam:s,teamMemberColumns:ct,teamMembers:te}),e[135]=b,e[136]=i,e[137]=le,e[138]=s,e[139]=ct,e[140]=te,e[141]=h,e[142]=Le):Le=e[142];let je;e[143]!==i||e[144]!==ut||e[145]!==ee||e[146]!==d||e[147]!==o?(je=d&&(0,a.jsx)(Qt,{onConfirmDeleteRole:c(G=>{n({action:c(()=>i.deleteAuthOrgRole({roleId:G}),"action"),kind:"confirm",message:o("Delete this custom role? Members keeping it will lose its grants."),testId:"org-role-delete",title:o("Delete role")})},"onConfirmDeleteRole"),onDialog:n,roleColumns:ut,roles:ee}),e[143]=i,e[144]=ut,e[145]=ee,e[146]=d,e[147]=o,e[148]=je):je=e[148];let Pe;e[149]!==l?.kind||e[150]!==r||e[151]!==_?(Pe=l?.kind==="add-member"&&(0,a.jsx)(Lt,{onClose:F,onDone:_,organizationId:r}),e[149]=l?.kind,e[150]=r,e[151]=_,e[152]=Pe):Pe=e[152];let Be;e[153]!==l?.kind||e[154]!==r||e[155]!==_?(Be=l?.kind==="invite-member"&&(0,a.jsx)(jt,{onClose:F,onDone:_,organizationId:r}),e[153]=l?.kind,e[154]=r,e[155]=_,e[156]=Be):Be=e[156];let Je;e[157]!==l||e[158]!==_?(Je=l?.kind==="member-role"&&(0,a.jsx)(Pt,{member:l.member,onClose:F,onDone:_}),e[157]=l,e[158]=_,e[159]=Je):Je=e[159];let Ue;e[160]!==l?.kind||e[161]!==r||e[162]!==_?(Ue=l?.kind==="team-create"&&(0,a.jsx)(At,{mode:"create",onClose:F,onDone:_,organizationId:r}),e[160]=l?.kind,e[161]=r,e[162]=_,e[163]=Ue):Ue=e[163];let qe;e[164]!==l||e[165]!==r||e[166]!==_?(qe=l?.kind==="team-rename"&&(0,a.jsx)(At,{mode:"edit",onClose:F,onDone:_,organizationId:r,team:l.team}),e[164]=l,e[165]=r,e[166]=_,e[167]=qe):qe=e[167];let Ke;e[168]!==l||e[169]!==_?(Ke=l?.kind==="team-add-member"&&(0,a.jsx)(Bt,{onClose:F,onDone:_,teamId:l.teamId}),e[168]=l,e[169]=_,e[170]=Ke):Ke=e[170];let Qe;e[171]!==l?.kind||e[172]!==r||e[173]!==_?(Qe=l?.kind==="role-create"&&(0,a.jsx)(_t,{mode:"create",onClose:F,onDone:_,organizationId:r}),e[171]=l?.kind,e[172]=r,e[173]=_,e[174]=Qe):Qe=e[174];let Xe;e[175]!==l||e[176]!==r||e[177]!==_?(Xe=l?.kind==="role-edit"&&(0,a.jsx)(_t,{mode:"edit",onClose:F,onDone:_,organizationId:r,role:l.role}),e[175]=l,e[176]=r,e[177]=_,e[178]=Xe):Xe=e[178];let Ye;e[179]!==l||e[180]!==_?(Ye=l?.kind==="confirm"&&(0,a.jsx)(Mt,{action:l.action,message:l.message,onClose:F,onDone:_,testId:l.testId,title:l.title}),e[179]=l,e[180]=_,e[181]=Ye):Ye=e[181];let lt;return e[182]!==Te||e[183]!==Me||e[184]!==$e||e[185]!==Fe||e[186]!==Ee||e[187]!==Le||e[188]!==je||e[189]!==Pe||e[190]!==Be||e[191]!==Je||e[192]!==Ue||e[193]!==qe||e[194]!==Ke||e[195]!==Qe||e[196]!==Xe||e[197]!==Ye?(lt=(0,a.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"org-detail",children:[Te,Me,$e,Fe,Ee,Le,je,Pe,Be,Je,Ue,qe,Ke,Qe,Xe,Ye]}),e[182]=Te,e[183]=Me,e[184]=$e,e[185]=Fe,e[186]=Ee,e[187]=Le,e[188]=je,e[189]=Pe,e[190]=Be,e[191]=Je,e[192]=Ue,e[193]=qe,e[194]=Ke,e[195]=Qe,e[196]=Xe,e[197]=Ye,e[198]=lt):lt=e[198],lt},"Ut");function Yt(t){return(0,a.jsx)("span",{className:"font-mono text-xs",children:S(t.userId)})}c(Yt,"Ht");function Zt(t){return S(t.role)}c(Zt,"qt");function Gt(t){return S(t.email)}c(Gt,"Gt");function Ht(t){return S(t.role)}c(Ht,"Kt");function Wt(t){return S(t.status)}c(Wt,"Vt");function Vt(t){return S(t.id)}c(Vt,"Wt");function er(t){return S(t.name)}c(er,"Xt");function tr(t){return(0,a.jsx)("span",{className:"font-mono text-xs",children:S(t.userId)})}c(tr,"Yt");function rr(t){return S(t.role)}c(rr,"Zt");function or(t){return S(t.permission)}c(or,"el");var yr=c(()=>{let t=(0,U.c)(62),e=re(),r=q(),{config:d,ready:h}=Nt(),i=d.capabilities.organization,[o,l]=(0,j.useState)(null),[n,s]=(0,j.useState)(null),m;t[0]===Symbol.for("react.memo_cache_sentinel")?(m=["lunora-auth-orgs"],t[0]=m):m=t[0];let b;t[1]!==e?(b=c(()=>e.listAuthOrganizations({limit:100}),"g"),t[1]=e,t[2]=b):b=t[2];let u;t[3]!==i?(u={enabled:i},t[3]=i,t[4]=u):u=t[4];let g=ue(m,b,u),p=g.data?.rows??null,f;t[5]!==g?(f=c(()=>{g.refetch()},"h"),t[5]=g,t[6]=f):f=t[6],Ct(f,i);let y;t[7]===Symbol.for("react.memo_cache_sentinel")?(y=c(()=>{s(null)},"v"),t[7]=y):y=t[7];let k=y,v;t[8]!==g?(v=c(()=>{g.refetch()},"p"),t[8]=g,t[9]=v):v=t[9];let I=v,C;t[10]===Symbol.for("react.memo_cache_sentinel")?(C=c(R=>{l(R)},"y"),t[10]=C):C=t[10];let z=C;if(h&&!i){let R;t[11]!==r?(R=r("Enable the organization() plugin in your auth config to manage organizations here."),t[11]=r,t[12]=R):R=t[12];let $;t[13]!==r?($=r("Organizations are not enabled."),t[13]=r,t[14]=$):$=t[14];let K;return t[15]!==R||t[16]!==$?(K=(0,a.jsx)(ce,{description:R,testId:"org-disabled",title:$}),t[15]=R,t[16]=$,t[17]=K):K=t[17],K}let x;t[18]!==r?(x=r("Organizations"),t[18]=r,t[19]=x):x=t[19];let w;t[20]!==x?(w=(0,a.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:x}),t[20]=x,t[21]=w):w=t[21];let N;t[22]===Symbol.for("react.memo_cache_sentinel")?(N=c(()=>{s({kind:"create"})},"D"),t[22]=N):N=t[22];let O;t[23]!==r?(O=r("New organization"),t[23]=r,t[24]=O):O=t[24];let A;t[25]!==O?(A=(0,a.jsx)(L,{"data-testid":"org-new",onClick:N,size:"sm",type:"button",children:O}),t[25]=O,t[26]=A):A=t[26];let D;t[27]!==A||t[28]!==w?(D=(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[w,A]}),t[27]=A,t[28]=w,t[29]=D):D=t[29];let T;t[30]!==g.error?(T=g.error!==null&&(0,a.jsx)("p",{className:"text-sm text-destructive","data-testid":"org-error",role:"alert",children:g.error}),t[30]=g.error,t[31]=T):T=t[31];let M;t[32]!==p||t[33]!==r?(M=p!==null&&p.length===0&&(0,a.jsx)(ce,{testId:"org-empty",title:r("No organizations.")}),t[32]=p,t[33]=r,t[34]=M):M=t[34];let P;t[35]!==p||t[36]!==o||t[37]!==r?(P=p!==null&&p.length>0&&(0,a.jsx)(ht,{className:"overflow-hidden py-0",children:(0,a.jsx)(bt,{className:"px-0",children:(0,a.jsxs)(ft,{"data-testid":"org-table",children:[(0,a.jsx)(pt,{children:(0,a.jsxs)(Ze,{children:[(0,a.jsx)(se,{children:r("id")}),(0,a.jsx)(se,{children:r("name")}),(0,a.jsx)(se,{children:r("slug")}),(0,a.jsx)(se,{children:r("created")}),(0,a.jsx)(se,{"aria-label":r("Actions")})]})}),(0,a.jsx)(vt,{children:p.map(R=>{let $=S(R.id);return(0,a.jsxs)(Ze,{"data-testid":`org-row-${$}`,children:[(0,a.jsx)(me,{className:"font-mono text-xs",children:$}),(0,a.jsx)(me,{children:S(R.name)}),(0,a.jsx)(me,{children:S(R.slug)}),(0,a.jsx)(me,{className:"text-muted-foreground tabular-nums",children:kt(R.createdAt)}),(0,a.jsx)(me,{children:(0,a.jsxs)("div",{className:"flex justify-end gap-1",children:[(0,a.jsx)(L,{"aria-pressed":o===$,"data-testid":`org-select-${$}`,onClick:c(()=>{z($)},"onClick"),size:"xs",type:"button",variant:"ghost",children:r("Manage")}),(0,a.jsx)(L,{"data-testid":`org-edit-${$}`,onClick:c(()=>{s({kind:"edit",org:R})},"onClick"),size:"xs",type:"button",variant:"ghost",children:r("Edit")}),(0,a.jsx)(L,{"data-testid":`org-delete-${$}`,onClick:c(()=>{s({kind:"delete",org:R})},"onClick"),size:"xs",type:"button",variant:"ghost",children:r("Delete")})]})})]},$)})})]})})}),t[35]=p,t[36]=o,t[37]=r,t[38]=P):P=t[38];let Q;t[39]!==d.organization||t[40]!==o?(Q=o!==null&&(0,a.jsx)(Xt,{organizationId:o,rolesEnabled:d.organization.roles,teamsEnabled:d.organization.teams}),t[39]=d.organization,t[40]=o,t[41]=Q):Q=t[41];let B;t[42]!==n?.kind||t[43]!==I?(B=n?.kind==="create"&&(0,a.jsx)(Dt,{mode:"create",onClose:k,onDone:I}),t[42]=n?.kind,t[43]=I,t[44]=B):B=t[44];let E;t[45]!==n||t[46]!==I?(E=n?.kind==="edit"&&(0,a.jsx)(Dt,{mode:"edit",onClose:k,onDone:I,org:n.org}),t[45]=n,t[46]=I,t[47]=E):E=t[47];let J;t[48]!==e||t[49]!==n||t[50]!==I||t[51]!==r?(J=n?.kind==="delete"&&(0,a.jsx)(Mt,{action:c(async()=>{let R=S(n.org.id);await e.deleteAuthOrganization({organizationId:R}),l($=>$===R?null:$)},"action"),message:r("Delete this organization? Its members, invitations, teams, and custom roles are removed. This cannot be undone."),onClose:k,onDone:I,testId:"org-delete",title:r("Delete organization")}),t[48]=e,t[49]=n,t[50]=I,t[51]=r,t[52]=J):J=t[52];let Y;return t[53]!==D||t[54]!==T||t[55]!==M||t[56]!==P||t[57]!==Q||t[58]!==B||t[59]!==E||t[60]!==J?(Y=(0,a.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-organizations",children:[D,T,M,P,Q,B,E,J]}),t[53]=D,t[54]=T,t[55]=M,t[56]=P,t[57]=Q,t[58]=B,t[59]=E,t[60]=J,t[61]=Y):Y=t[61],Y},"yl");export{yr as default};
@@ -0,0 +1 @@
1
+ import{a as e}from"./chunk-YKXDMIHQ.js";var u={highErrorRate:.05,highWriteContention:.1,lowCacheHitRate:.5,minCacheSamples:10,minConflictCalls:5,minErrorCalls:5,slowFunctionMs:1e3,storageCriticalBytes:5368709120,storageWarnBytes:1073741824},h={error:0,info:2,warning:1},g=e((a,i)=>{let s=[];if(a.maxDurationMs>=i.slowFunctionMs){let t=a.scannedTables??[];t.length>0?s.push({fn:a.path,kind:"missing-index",severity:"warning",tables:t.map(r=>r.table),value:a.maxDurationMs}):s.push({fn:a.path,kind:"slow-function",severity:"info",value:a.maxDurationMs})}a.calls>=i.minErrorCalls&&a.errors/a.calls>=i.highErrorRate&&s.push({fn:a.path,kind:"high-error-rate",message:a.lastErrorMessage??void 0,severity:"error",value:a.errors/a.calls});let n=a.conflicts??0;return n>0&&a.calls>=i.minConflictCalls&&n/a.calls>=i.highWriteContention&&s.push({fn:a.path,kind:"high-write-contention",severity:"warning",value:n/a.calls}),s},"h"),v=e((a,i,s=u)=>{let n=[];if(typeof a?.databaseSize=="number"&&a.databaseSize>=s.storageWarnBytes&&n.push({kind:"storage-headroom",severity:a.databaseSize>=s.storageCriticalBytes?"error":"warning",value:a.databaseSize}),a?.cache){let{evictions:t,hits:r,misses:c}=a.cache,o=r+c;if(o>=s.minCacheSamples){let l=r/o;l<s.lowCacheHitRate&&n.push({kind:"low-cache-hit-rate",severity:"warning",value:l})}t>0&&t>r&&n.push({kind:"high-evictions",severity:"warning",value:t})}for(let t of i??[])n.push(...g(t,s));return n.toSorted((t,r)=>h[t.severity]-h[r.severity])},"u");export{v as a};
@@ -0,0 +1 @@
1
+ import{a as f}from"./chunk-IMOHEGMV.js";import{a as j}from"./chunk-66UGPQVC.js";import{a as C}from"./chunk-PD6WIDY6.js";import{W as v}from"./chunk-PLHA3OWK.js";import"./chunk-4L4WTGN5.js";import{a as U}from"./chunk-55754F6H.js";import"./chunk-IS6LVJ6L.js";import"./chunk-AAVLPU5Q.js";import{b as q}from"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import{a as w}from"./chunk-4ZEL6BYL.js";import{f as L}from"./chunk-VWWJIICI.js";import"./chunk-FSRSK4LY.js";import"./chunk-KSYIH3NO.js";import{d as P,f as y,g as p,h,o as u}from"./chunk-FODLDLE2.js";import{a as s,d as S,e as W,g as X}from"./chunk-YKXDMIHQ.js";var a=S(W(),1);var e=S(X(),1);var B=y(w.getPitrBookmark),Y=y(w.pitrRestore),de=s(({initialShardKey:z})=>{let m=L(),t=P(),o=z??"",[A,x]=(0,a.useState)(null),[l,O]=(0,a.useState)(""),[R,I]=(0,a.useState)(null),[c,D]=(0,a.useState)(""),[k,E]=(0,a.useState)(!1),[i,K]=(0,a.useState)(null),[T,n]=(0,a.useState)(null),[b,d]=(0,a.useState)(!1),g=(0,a.useCallback)(async()=>{d(!0),n(null);try{let r=await m.query(B,{},p(o));x(r.current)}catch(r){n(h(r))}d(!1)},[m,o]);(0,a.useEffect)(()=>{u(g())},[g]),j(()=>{u((async()=>{try{let r=await m.query(B,{},p(o));x(r.current)}catch{}})())},!0);let M=s(r=>{O(r.target.value)},"A"),Z=s(r=>{D(r.target.value)},"U"),_=s(r=>{E(r.target.checked)},"q"),G=s(()=>{l.trim()!==""&&u((async()=>{d(!0),n(null);try{let r=await m.query(B,{time:l.trim()},p(o));I(r.forTime??null),x(r.current)}catch(r){I(null),n(h(r))}d(!1)})())},"K"),F=s(r=>{u((async()=>{d(!0),n(null);try{let N=await m.mutation(Y,r,p(o));K(N),await g()}catch(N){n(h(N))}d(!1)})())},"C"),H=c.trim()!==""||l.trim()!=="",J=t("Restore {shard} to {target}?",{shard:o===""?t("root"):o,target:c.trim()===""?l.trim():t("the given bookmark")}),Q=s(()=>{let r=k?{restart:!0}:{};c.trim()===""?r.time=l.trim():r.bookmark=c.trim(),F(r)},"z"),V=s(()=>{i!==null&&F(k?{bookmark:i.undoBookmark,restart:!0}:{bookmark:i.undoBookmark})},"D");return(0,e.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-pitr",children:[(0,e.jsx)("div",{className:"flex flex-wrap items-center gap-3",children:(0,e.jsxs)("span",{className:"text-xs text-muted-foreground",children:[t("Shard"),": ",(0,e.jsx)("span",{className:"font-mono",children:o===""?t("root"):o})]})}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"pitr-note",children:t("In-place recovery to any moment in the last 30 days. For older or portable recovery, use the snapshot backup tier.")}),T!==null&&(0,e.jsx)("p",{className:"text-sm text-destructive","data-testid":"pitr-error",role:"alert",children:T}),(0,e.jsxs)("section",{className:"rounded-xl border border-border bg-card p-3 shadow-xs",children:[(0,e.jsx)("h3",{className:"mb-2 text-sm font-semibold",children:t("Current bookmark")}),(0,e.jsx)("p",{className:"font-mono text-xs break-all text-muted-foreground","data-testid":"pitr-current",children:A??(0,e.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})})]}),(0,e.jsxs)("section",{className:"flex flex-col gap-3 rounded-xl border border-border bg-card p-3 shadow-xs",children:[(0,e.jsx)("h3",{className:"text-sm font-semibold",children:t("Restore")}),(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsx)(f,{htmlFor:"pitr-time",children:t("Time (ISO or epoch-ms, last 30 days)")}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(v,{"data-testid":"pitr-time",id:"pitr-time",onChange:M,placeholder:"2026-06-01T00:00:00.000Z",value:l}),(0,e.jsx)(U,{"data-testid":"pitr-preview",disabled:b||l.trim()==="",onClick:G,size:"sm",type:"button",variant:"outline",children:t("Preview")})]}),R!==null&&(0,e.jsxs)("p",{className:"font-mono text-xs break-all text-muted-foreground","data-testid":"pitr-preview-bookmark",children:[t("Bookmark for that time"),": ",R]})]}),(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsx)(f,{htmlFor:"pitr-bookmark",children:t("Or an explicit bookmark (wins over time)")}),(0,e.jsx)(v,{"data-testid":"pitr-bookmark",id:"pitr-bookmark",onChange:Z,placeholder:t("bookmark string"),value:c})]}),(0,e.jsxs)(f,{className:"flex items-center gap-2 text-xs font-normal text-muted-foreground",htmlFor:"pitr-restart",children:[(0,e.jsx)("input",{checked:k,className:"size-4 accent-primary","data-testid":"pitr-restart",id:"pitr-restart",onChange:_,type:"checkbox"}),t("Restart the shard now so recovery applies immediately")]}),(0,e.jsx)("div",{children:(0,e.jsx)(C,{confirmLabel:J,disabled:b||!H,onConfirm:Q,testId:"pitr-restore",children:t("Restore")})})]}),i!==null&&(0,e.jsxs)("section",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card p-3 shadow-xs","data-testid":"pitr-result",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("h3",{className:"text-sm font-semibold",children:t("Restore armed")}),(0,e.jsx)(q,{variant:i.restarted?"destructive":"secondary",children:i.restarted?t("restarted now"):t("on next restart")})]}),(0,e.jsxs)("p",{className:"font-mono text-xs break-all text-muted-foreground",children:[t("Restored to"),": ",i.restoredTo]}),(0,e.jsxs)("p",{className:"font-mono text-xs break-all text-muted-foreground","data-testid":"pitr-undo-bookmark",children:[t("Undo bookmark"),": ",i.undoBookmark]}),(0,e.jsx)("div",{children:(0,e.jsx)(C,{confirmLabel:t("Confirm undo"),disabled:b,onConfirm:V,testId:"pitr-undo",children:t("Undo restore")})})]})]})},"ce");export{de as PitrPanel};
@@ -0,0 +1 @@
1
+ import{a as O}from"./chunk-EA2JKR5D.js";import{a as C}from"./chunk-IMOHEGMV.js";import{b as v}from"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import{a as k}from"./chunk-F7UZBTKS.js";import"./chunk-ULIQFBZU.js";import"./chunk-Y3G2ZPOD.js";import"./chunk-35DM4JJG.js";import{a as S}from"./chunk-4ZEL6BYL.js";import{c as b}from"./chunk-D6UKRXIS.js";import"./chunk-VWWJIICI.js";import"./chunk-FSRSK4LY.js";import"./chunk-KSYIH3NO.js";import{a as c}from"./chunk-FKVZRPV5.js";import{a as w,b as T,c as A,d as f,e as s,f as l}from"./chunk-HEAQVSNS.js";import{a as y,e as N}from"./chunk-WUWBZPUK.js";import{d as p}from"./chunk-FODLDLE2.js";import{a as n,d as x,e as R,g as V}from"./chunk-YKXDMIHQ.js";var F=x(R(),1);var e=x(V(),1);var $=n(a=>{let t=a.trim();if(t.length===0)return{context:void 0,error:null};try{let o=JSON.parse(t);return o===null||typeof o!="object"||Array.isArray(o)?{context:void 0,error:"Targeting context must be a JSON object."}:{context:o,error:null}}catch{return{context:void 0,error:"Targeting context is not valid JSON."}}},"H"),q='{ "targetingKey": "user-123", "plan": "premium" }',D=n(a=>a.type==="object"?JSON.stringify(a.value):String(a.value),"R"),Y=n(({initialShardKey:a=""})=>{let t=p(),[o,j]=(0,F.useState)(""),{context:g,error:m}=$(o),I=g===void 0?{}:{context:g},{data:i,error:J,errorSource:K,liveError:E}=b(S.listFlags,I,{live:!0,shardKey:a}),u=i!==void 0,L=i?.configured??!1,h=Array.isArray(i?.flags)?[...i.flags].toSorted((r,B)=>r.key.localeCompare(B.key)):[],d;return u&&!L?d=(0,e.jsx)(c,{description:t("No @lunora/flags provider is wired in this deployment. Add lunora/flags.ts with defineFlags({ provider }) to gate code paths on feature flags."),testId:"flags-unconfigured",title:t("No flags provider configured")}):u&&h.length===0?d=(0,e.jsx)(c,{description:t('A flags provider is configured, but no handler reads a flag yet. Call ctx.flags.boolean("key", false) in a query, mutation, or action.'),testId:"flags-empty",title:t("No flags read")}):d=(0,e.jsx)(y,{className:"overflow-hidden py-0",children:(0,e.jsx)(N,{className:"px-0",children:(0,e.jsxs)(w,{"data-testid":"flags-table",children:[(0,e.jsx)(T,{children:(0,e.jsxs)(f,{children:[(0,e.jsx)(s,{children:t("Key")}),(0,e.jsx)(s,{children:t("Type")}),(0,e.jsx)(s,{children:t("Value")}),(0,e.jsx)(s,{children:t("Reason")}),(0,e.jsx)(s,{children:t("Variant")})]})}),(0,e.jsx)(A,{children:h.map(r=>(0,e.jsxs)(f,{"data-testid":`flags-row-${r.key}`,children:[(0,e.jsx)(l,{className:"font-mono text-xs",children:r.key}),(0,e.jsx)(l,{className:"font-mono text-xs text-muted-foreground",children:r.type}),(0,e.jsx)(l,{className:"font-mono text-xs",children:D(r)}),(0,e.jsx)(l,{children:r.errorCode===void 0?(0,e.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:r.reason??"\u2014"}):(0,e.jsx)(v,{"data-testid":`flags-error-${r.key}`,variant:"destructive",children:r.errorCode})}),(0,e.jsx)(l,{className:"font-mono text-xs text-muted-foreground",children:r.variant??"\u2014"})]},r.key))})]})})}),(0,e.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-flags-panel",children:[J!==null&&(0,e.jsx)(k,{error:K,testId:"flags-error"}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:t('Feature flags are read in code with ctx.flags.<type>("key", default). They evaluate through the OpenFeature provider configured in lunora/flags.ts; edit the targeting context below to see how each flag resolves for a given audience.')}),(0,e.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,e.jsx)(C,{htmlFor:"flags-targeting-context",children:t("Targeting context (JSON)")}),(0,e.jsx)(O,{className:"font-mono text-xs","data-testid":"flags-context-input",id:"flags-targeting-context",onChange:n(r=>{j(r.target.value)},"onChange"),placeholder:q,rows:3,value:o}),m!==null&&(0,e.jsx)("p",{className:"text-xs text-destructive","data-testid":"flags-context-error",role:"alert",children:t(m)}),E!==void 0&&(0,e.jsx)("p",{className:"text-xs text-amber-600 dark:text-amber-500","data-testid":"flags-live-error",role:"alert",children:t("Live updates unavailable; showing the last evaluation.")})]}),d]})},"W");export{Y as default};
@@ -0,0 +1 @@
1
+ import{a as ke}from"./chunk-EA2JKR5D.js";import{a as A}from"./chunk-IMOHEGMV.js";import{a as Pe}from"./chunk-BOTGXX4H.js";import{a as be}from"./chunk-2DX5MROH.js";import"./chunk-OGUKYRFM.js";import"./chunk-OKG3HWSJ.js";import{W as M}from"./chunk-PLHA3OWK.js";import"./chunk-4L4WTGN5.js";import{a as T}from"./chunk-55754F6H.js";import"./chunk-IS6LVJ6L.js";import"./chunk-AAVLPU5Q.js";import{b as O}from"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import{a as ge}from"./chunk-F7UZBTKS.js";import"./chunk-ULIQFBZU.js";import"./chunk-Y3G2ZPOD.js";import"./chunk-35DM4JJG.js";import{a as Z}from"./chunk-4ZEL6BYL.js";import{c as ae}from"./chunk-D6UKRXIS.js";import{f as oe}from"./chunk-VWWJIICI.js";import"./chunk-FSRSK4LY.js";import"./chunk-KSYIH3NO.js";import{a as de}from"./chunk-FKVZRPV5.js";import{a as Ne,b as ve,c as we,d as ce,e as le,f as re}from"./chunk-HEAQVSNS.js";import{a as se,b as pe,c as fe,d as ue,e as ne}from"./chunk-WUWBZPUK.js";import{d as V,f as he,g as xe,h as ye,o as te}from"./chunk-FODLDLE2.js";import{a as d,d as ie,e as _e,f as Fe,g as Te}from"./chunk-YKXDMIHQ.js";var p=ie(_e(),1);var me=ie(Fe(),1);var t=ie(Te(),1);var Ce=["read","insert","update","delete"],Ae=d((e,a)=>({delete:e("Delete"),insert:e("Insert"),read:e("Read"),update:e("Update")})[a],"_e"),Ee=d(e=>{let a=new Set;for(let i of e?.advisories??[])if(i.name==="rls_uncovered_table"){let{table:s}=i.metadata;typeof s=="string"&&s!==""&&a.add(s)}return a},"Ie"),Re=d((e,a,i)=>{let s=new Map,l=d(n=>{let o=s.get(n);if(o!==void 0)return o;let f={cells:{delete:{},insert:{},read:{},update:{}},maskedColumns:new Set,table:n,uncovered:i.has(n)};return s.set(n,f),f},"l");for(let n of e)l(n.table).cells[n.on]={procedure:n.procedure};for(let n of a)l(n.table).maskedColumns.add(n.column);for(let n of i)l(n);return[...s.values()].toSorted((n,o)=>n.table.localeCompare(o.table))},"Ee"),$e=d(e=>{let a=(0,me.c)(17),i;a[0]!==e?(i=e===void 0?{}:e,a[0]=e,a[1]=i):i=a[1];let{onProbe:s}=i,l=V(),n,o;a[2]===Symbol.for("react.memo_cache_sentinel")?(n={},o={live:!0},a[2]=n,a[3]=o):(n=a[2],o=a[3]);let f=ae(Z.rlsPolicies,n,o),r;a[4]===Symbol.for("react.memo_cache_sentinel")?(r={},a[4]=r):r=a[4];let b=ae(Z.maskPolicies,r),x;a[5]===Symbol.for("react.memo_cache_sentinel")?(x={},a[5]=x):x=a[5];let g=ae(Z.getAdvisories,x),N;if(a[6]!==g.data||a[7]!==b.data||a[8]!==s||a[9]!==f||a[10]!==l){let v=null;f.data!==void 0&&(v=Array.isArray(f.data.policies)?f.data.policies:[]);let E=Array.isArray(b.data?.columns)?b.data.columns:[],j=g.data??null,{error:C,errorSource:w,liveError:S}=f,_=v===null?[]:Re(v,E,Ee(j)),k;a[12]!==S?(k=(0,t.jsx)("div",{className:"flex items-center justify-end",children:(0,t.jsx)(Pe,{message:S,prefix:"pm"})}),a[12]=S,a[13]=k):k=a[13];let u;a[14]!==C||a[15]!==w?(u=C!==null&&(0,t.jsx)(ge,{error:w,testId:"pm-error"}),a[14]=C,a[15]=w,a[16]=u):u=a[16],N=(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-permissions-matrix",children:[k,u,v!==null&&_.length===0?(0,t.jsx)(de,{description:l("Add a `definePolicy` and wire it through `.use(rls(...))` to populate this matrix."),testId:"pm-empty",title:l("No policy")}):(0,t.jsxs)(Ne,{"data-testid":"pm-table",children:[(0,t.jsx)(ve,{children:(0,t.jsxs)(ce,{children:[(0,t.jsx)(le,{children:l("Table")}),Ce.map(c=>(0,t.jsx)(le,{children:Ae(l,c)},c)),(0,t.jsx)(le,{children:l("Masked columns")})]})}),(0,t.jsx)(we,{children:_.map(c=>(0,t.jsxs)(ce,{"data-testid":`pm-row-${c.table}`,children:[(0,t.jsx)(re,{className:"font-mono text-xs",children:(0,t.jsxs)("span",{className:"flex items-center gap-1.5",children:[c.table,c.uncovered&&(0,t.jsx)(O,{"data-testid":`pm-uncovered-${c.table}`,title:l("Uncovered \u2014 reachable without a policy"),variant:"destructive",children:l("Uncovered \u2014 reachable without a policy")})]})}),Ce.map(I=>{let y=c.cells[I];return(0,t.jsx)(re,{"data-testid":`pm-cell-${c.table}-${I}`,children:y.procedure===void 0?(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:l("No policy")}):(0,t.jsxs)("span",{className:"flex flex-col gap-1",children:[(0,t.jsx)(O,{variant:"secondary",children:l("Covered by {procedure}",{procedure:y.procedure})}),s!==void 0&&(0,t.jsx)(T,{className:"h-auto justify-start p-0 text-[11px]","data-testid":`pm-probe-${c.table}-${I}`,onClick:d(()=>{s(c.table,I,y.procedure??"")},"onClick"),size:"xs",type:"button",variant:"ghost",children:l("Probe this")})]})},I)}),(0,t.jsx)(re,{children:c.maskedColumns.size===0?(0,t.jsx)("span",{"aria-hidden":"true",className:"text-muted-foreground",children:"\u2014"}):(0,t.jsx)("span",{className:"flex flex-wrap gap-1",children:[...c.maskedColumns].map(ze)})})]},c.table))})]})]}),a[6]=g.data,a[7]=b.data,a[8]=s,a[9]=f,a[10]=l,a[11]=N}else N=a[11];return N},"Fe");function ze(e){return(0,t.jsx)(O,{variant:"outline",children:e},e)}d(ze,"Re");var Le=he(Z.runAs),Oe=d(()=>{let e=oe();return async({args:a,functionPath:i,shardKey:s="",userId:l})=>{if(l.trim()==="")return{kind:"invalid",message:"No identity to probe: enter the userId whose access you want to test."};let n=Le;try{return{kind:"allowed",value:await e.query(n,{args:a,functionPath:i,userId:l},xe(s))}}catch(o){return{kind:"denied",message:o instanceof Error?o.message:String(o)}}}},"Le"),je=d(e=>e===void 0?"undefined":JSON.stringify(e,null,2),"Me"),Me=d(({functions:e,prefill:a,runAsIdentity:i=!1}={})=>{let s=oe(),l=V(),n=Oe(),[o,f]=(0,p.useState)(null),[r,b]=(0,p.useState)(null),x=e??o??[],[g,N]=(0,p.useState)(""),[v,E]=(0,p.useState)("{}"),[j,C]=(0,p.useState)(""),[w,S]=(0,p.useState)(""),[_,k]=(0,p.useState)(!1),[u,c]=(0,p.useState)(null),[I,y]=(0,p.useState)(null),F=(0,p.useRef)(-1);(0,p.useEffect)(()=>{if(e!==void 0)return;let m=!1;return s.listFunctions().then(h=>(m||f(h),h)).catch(h=>{m||b(ye(h))}),()=>{m=!0}},[s,e]),(0,p.useEffect)(()=>{if(a===void 0||F.current===a.nonce)return;F.current=a.nonce;let m=a.functionPath;queueMicrotask(()=>{N(m),c(null)})},[a]);let P=g===""?x[0]?.path??"":g,R=d(async()=>{if(P==="")return;let m;try{m=v.trim()===""?{}:JSON.parse(v)}catch(h){y(l("Invalid JSON args: {message}",{message:h.message})),c(null);return}y(null),k(!0);try{let h=await n({args:m,functionPath:P,shardKey:j.trim(),userId:w.trim()});c(h)}finally{k(!1)}},"E"),$=d(()=>{te(R())},"F"),Y=d(m=>{N(m.target.value)},"Y"),z=d(m=>{E(m.target.value)},"R"),L=d(m=>{S(m.target.value)},"O");return(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-permissions-playground",children:[r!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"pp-discover-error",role:"alert",children:r}),!i&&(0,t.jsx)(de,{description:l("Dev only: runs the selected function as this user over the admin gate so you can test auth and RLS."),testId:"pp-gate",title:l("Set `runAsIdentity` to forge an identity and probe access.")}),(0,t.jsxs)("div",{className:"flex flex-col gap-3 rounded-md border border-border p-3",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(A,{htmlFor:"pp-function",children:l("Function")}),(0,t.jsx)("select",{"aria-label":l("Function"),className:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","data-testid":"pp-function",id:"pp-function",onChange:Y,value:P,children:x.map(m=>(0,t.jsxs)("option",{value:m.path,children:[m.path," (",m.kind,")"]},m.path))})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(A,{htmlFor:"pp-args",children:l("Arguments")}),(0,t.jsx)(ke,{"aria-label":l("Arguments"),className:"font-mono text-xs","data-testid":"pp-args",id:"pp-args",onChange:z,value:v})]}),(0,t.jsx)(be,{onChange:C,testId:"pp-shard",value:j}),(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(A,{htmlFor:"pp-user",children:l("Run as (userId)")}),(0,t.jsx)(M,{"aria-label":l("Identity (userId) to run as"),className:"font-mono text-xs","data-testid":"pp-user",id:"pp-user",onChange:L,placeholder:l("Required \u2014 the identity to probe as"),value:w})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(T,{"data-testid":"pp-run",disabled:!i||_||P==="",onClick:$,type:"button",children:l(_?"Probing\u2026":"Run probe")}),w.trim()!==""&&(0,t.jsx)(O,{"data-testid":"pp-as-badge",variant:"secondary",children:l("as {userId}",{userId:w.trim()})})]})]}),I!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"pp-args-error",role:"alert",children:I}),u!==null&&u.kind==="allowed"&&(0,t.jsxs)("div",{className:"flex flex-col gap-2","data-testid":"pp-outcome-allowed",children:[(0,t.jsx)(O,{variant:"secondary",children:l("Allowed")}),(0,t.jsx)("pre",{className:"overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-xs","data-testid":"pp-result",children:je(u.value)})]}),u!==null&&u.kind==="invalid"&&(0,t.jsxs)("div",{className:"flex flex-col gap-2","data-testid":"pp-outcome-invalid",children:[(0,t.jsx)(O,{variant:"outline",children:l("Not run")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"pp-invalid",role:"status",children:u.message})]}),u!==null&&u.kind==="denied"&&(0,t.jsxs)("div",{className:"flex flex-col gap-2","data-testid":"pp-outcome-denied",children:[(0,t.jsx)(O,{variant:"destructive",children:l("Denied")}),(0,t.jsx)("pre",{className:"overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-xs text-destructive","data-testid":"pp-denied",role:"alert",children:u.message})]})]})},"$e"),qe="/__lunora/policy-scaffold",De={"already-wired":"That procedure already has an rls(...) policy wired in.","file-exists":"A policy file with that name already exists \u2014 pick another name or edit it by hand.","invalid-identifier":"Name, table, and policy-set must be plain identifiers (letters, digits, _ or $).","unknown-procedure":"No exported procedure was found at that file path.","unsupported-procedure-shape":"That procedure uses the bare query({\u2026}) form \u2014 convert it to the builder form (c.use(\u2026).query(\u2026)) before wiring RLS."},Ue=d(async e=>{let a=await fetch(qe,{body:JSON.stringify(e),headers:{"Content-Type":"application/json"},method:"POST"}),i=await a.json();if(i.needsManualEdit===!0)return{kind:"needs-manual-edit",message:i.message??"This change must be made by hand."};if(a.ok)return{diagnostics:i.diagnostics??[],kind:"ok",label:i.fileName??i.exportName??""};let s=i.error;return{kind:"error",message:s===void 0?`policy scaffold failed (${String(a.status)})`:De[s]??s}},"Ue"),Se={exportName:"",filePath:"",policyName:"",policies:"",tableName:""},Je=d(()=>{let e=(0,me.c)(69),a=V(),[i,s]=(0,p.useState)(null),[l,n]=(0,p.useState)(!1),[o,f]=(0,p.useState)(null),[r,b]=(0,p.useState)(Se),x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=d(ee=>{let G=ee.target.name,{value:Q}=ee.target;b(Ie=>({...Ie,[G]:Q}))},"h"),e[0]=x):x=e[0];let g=x,N;e[1]===Symbol.for("react.memo_cache_sentinel")?(N=d(()=>{s(null),b(Se)},"v"),e[1]=N):N=e[1];let v=N,E;e[2]===Symbol.for("react.memo_cache_sentinel")?(E=d(async ee=>{n(!0),f(null);try{let G=await Ue(ee);f(G),G.kind==="ok"&&v()}catch(G){let Q=G;f({kind:"error",message:Q instanceof Error?Q.message:String(Q)})}n(!1)},"I"),e[2]=E):E=e[2];let j=E,C;e[3]!==r.policyName||e[4]!==r.tableName?(C=d(()=>{te(j({kind:"scaffoldPolicy",name:r.policyName.trim(),table:r.tableName.trim()}))},"P"),e[3]=r.policyName,e[4]=r.tableName,e[5]=C):C=e[5];let w=C,S;e[6]!==r.exportName||e[7]!==r.filePath||e[8]!==r.policies?(S=d(()=>{te(j({exportName:r.exportName.trim(),filePath:r.filePath.trim(),kind:"wireRls",policies:r.policies.trim()}))},"w"),e[6]=r.exportName,e[7]=r.filePath,e[8]=r.policies,e[9]=S):S=e[9];let _=S,k;e[10]===Symbol.for("react.memo_cache_sentinel")?(k=d(()=>{f(null),s("scaffold")},"S"),e[10]=k):k=e[10];let u=k,c;e[11]===Symbol.for("react.memo_cache_sentinel")?(c=d(()=>{f(null),s("wire")},"d"),e[11]=c):c=e[11];let I=c,y;e[12]!==a?(y=a("Scaffold access rules"),e[12]=a,e[13]=y):y=e[13];let F;e[14]!==y?(F=(0,t.jsx)(fe,{children:y}),e[14]=y,e[15]=F):F=e[15];let P;e[16]!==a?(P=a("Writes a new deny-by-default policy file under lunora/, or wires one into a procedure, then reruns codegen. Local dev only."),e[16]=a,e[17]=P):P=e[17];let R;e[18]!==P?(R=(0,t.jsx)(ue,{children:P}),e[18]=P,e[19]=R):R=e[19];let $;e[20]!==R||e[21]!==F?($=(0,t.jsxs)(pe,{children:[F,R]}),e[20]=R,e[21]=F,e[22]=$):$=e[22];let Y=i==="scaffold"?"default":"outline",z;e[23]!==a?(z=a("New policy file"),e[23]=a,e[24]=z):z=e[24];let L;e[25]!==Y||e[26]!==z?(L=(0,t.jsx)(T,{"data-testid":"policy-scaffolder-new",onClick:u,size:"xs",type:"button",variant:Y,children:z}),e[25]=Y,e[26]=z,e[27]=L):L=e[27];let m=i==="wire"?"default":"outline",h;e[28]!==a?(h=a("Wire into a procedure"),e[28]=a,e[29]=h):h=e[29];let q;e[30]!==m||e[31]!==h?(q=(0,t.jsx)(T,{"data-testid":"policy-scaffolder-wire",onClick:I,size:"xs",type:"button",variant:m,children:h}),e[30]=m,e[31]=h,e[32]=q):q=e[32];let D;e[33]!==L||e[34]!==q?(D=(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[L,q]}),e[33]=L,e[34]=q,e[35]=D):D=e[35];let U;e[36]!==l||e[37]!==r.policyName||e[38]!==r.tableName||e[39]!==i||e[40]!==w||e[41]!==a?(U=i==="scaffold"&&(0,t.jsxs)("div",{className:"mt-3 flex flex-wrap items-end gap-2","data-testid":"policy-scaffolder-new-form",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)(A,{htmlFor:"policy-scaffolder-name",children:a("Policy name")}),(0,t.jsx)(M,{"data-testid":"policy-scaffolder-name",id:"policy-scaffolder-name",name:"policyName",onChange:g,value:r.policyName})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)(A,{htmlFor:"policy-scaffolder-table",children:a("Table name")}),(0,t.jsx)(M,{"data-testid":"policy-scaffolder-table",id:"policy-scaffolder-table",name:"tableName",onChange:g,value:r.tableName})]}),(0,t.jsx)(T,{"data-testid":"policy-scaffolder-create",disabled:l||r.policyName.trim()===""||r.tableName.trim()==="",onClick:w,size:"xs",type:"button",children:a(l?"Creating\u2026":"Create policy file")}),(0,t.jsx)(T,{onClick:v,size:"xs",type:"button",variant:"ghost",children:a("Cancel")})]}),e[36]=l,e[37]=r.policyName,e[38]=r.tableName,e[39]=i,e[40]=w,e[41]=a,e[42]=U):U=e[42];let J;e[43]!==l||e[44]!==r.exportName||e[45]!==r.filePath||e[46]!==r.policies||e[47]!==i||e[48]!==_||e[49]!==a?(J=i==="wire"&&(0,t.jsxs)("div",{className:"mt-3 flex flex-wrap items-end gap-2","data-testid":"policy-scaffolder-wire-form",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)(A,{htmlFor:"policy-scaffolder-file",children:a("Procedure file path")}),(0,t.jsx)(M,{"data-testid":"policy-scaffolder-file",id:"policy-scaffolder-file",name:"filePath",onChange:g,value:r.filePath})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)(A,{htmlFor:"policy-scaffolder-export",children:a("Exported procedure")}),(0,t.jsx)(M,{"data-testid":"policy-scaffolder-export",id:"policy-scaffolder-export",name:"exportName",onChange:g,value:r.exportName})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)(A,{htmlFor:"policy-scaffolder-policies",children:a("Policy set identifier")}),(0,t.jsx)(M,{"data-testid":"policy-scaffolder-policies",id:"policy-scaffolder-policies",name:"policies",onChange:g,value:r.policies})]}),(0,t.jsx)(T,{"data-testid":"policy-scaffolder-apply",disabled:l||r.filePath.trim()===""||r.exportName.trim()===""||r.policies.trim()==="",onClick:_,size:"xs",type:"button",children:a(l?"Wiring\u2026":"Wire RLS")}),(0,t.jsx)(T,{onClick:v,size:"xs",type:"button",variant:"ghost",children:a("Cancel")})]}),e[43]=l,e[44]=r.exportName,e[45]=r.filePath,e[46]=r.policies,e[47]=i,e[48]=_,e[49]=a,e[50]=J):J=e[50];let W;e[51]!==o?(W=o?.kind==="error"&&(0,t.jsx)("p",{className:"mt-3 text-sm text-destructive","data-testid":"policy-scaffolder-error",role:"alert",children:o.message}),e[51]=o,e[52]=W):W=e[52];let B;e[53]!==o?.kind||e[54]!==a?(B=o?.kind==="needs-manual-edit"&&(0,t.jsx)("p",{className:"mt-3 text-sm text-amber-600 dark:text-amber-500","data-testid":"policy-scaffolder-manual",role:"alert",children:a("This change must be made by hand \u2014 the scaffolder only adds new, deny-by-default rules.")}),e[53]=o?.kind,e[54]=a,e[55]=B):B=e[55];let H;e[56]!==o||e[57]!==a?(H=o?.kind==="ok"&&(0,t.jsxs)("div",{className:"mt-3 flex flex-col gap-1","data-testid":"policy-scaffolder-ok",children:[(0,t.jsx)("p",{className:"text-sm text-emerald-600 dark:text-emerald-500",children:a("Scaffolded {label} and reran codegen. Fill in the `when` predicates before relying on it.",{label:o.label})}),o.diagnostics.length>0&&(0,t.jsx)("ul",{className:"flex flex-col gap-0.5","data-testid":"policy-scaffolder-diagnostics",children:o.diagnostics.map(We)})]}),e[56]=o,e[57]=a,e[58]=H):H=e[58];let K;e[59]!==D||e[60]!==U||e[61]!==J||e[62]!==W||e[63]!==B||e[64]!==H?(K=(0,t.jsxs)(ne,{children:[D,U,J,W,B,H]}),e[59]=D,e[60]=U,e[61]=J,e[62]=W,e[63]=B,e[64]=H,e[65]=K):K=e[65];let X;return e[66]!==$||e[67]!==K?(X=(0,t.jsxs)(se,{"data-testid":"policy-scaffolder",size:"sm",children:[$,K]}),e[66]=$,e[67]=K,e[68]=X):X=e[68],X},"je");function We(e){return(0,t.jsx)("li",{className:"font-mono text-[11px] text-destructive",children:e},e)}d(We,"Be");var st=d(({functions:e,runAsIdentity:a=!1,schemaEditable:i=!1}={})=>{let s=V(),[l,n]=(0,p.useState)(void 0),o=d((f,r,b)=>{b!==""&&n(x=>({functionPath:b,nonce:(x?.nonce??0)+1}))},"o");return(0,t.jsxs)("div",{className:"flex flex-col gap-8","data-testid":"lunora-permissions",children:[(0,t.jsxs)("section",{className:"flex flex-col gap-3",children:[(0,t.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,t.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:s("Permissions")})}),(0,t.jsx)($e,{onProbe:o})]}),(0,t.jsx)("section",{className:"flex flex-col gap-3",children:(0,t.jsxs)(se,{className:"gap-0 py-0",children:[(0,t.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,t.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:s("Probe")})}),(0,t.jsxs)(ne,{className:"px-4 py-4",children:[(0,t.jsx)("p",{className:"mb-3 text-sm text-muted-foreground",children:s("Pick a function and an identity, then run it to see the access outcome.")}),(0,t.jsx)(Me,{functions:e,prefill:l,runAsIdentity:a})]})]})}),i&&(0,t.jsx)("section",{className:"flex flex-col gap-2",children:(0,t.jsx)(Je,{})})]})},"nt");export{st as PermissionsPanel};
@@ -0,0 +1 @@
1
+ import{a as O}from"./chunk-66UGPQVC.js";import{a as H}from"./chunk-PD6WIDY6.js";import{a as ee}from"./chunk-55754F6H.js";import"./chunk-IS6LVJ6L.js";import"./chunk-AAVLPU5Q.js";import{b as Z}from"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import{b as E}from"./chunk-D6UKRXIS.js";import{f as R}from"./chunk-VWWJIICI.js";import"./chunk-FSRSK4LY.js";import"./chunk-KSYIH3NO.js";import{a as _}from"./chunk-FKVZRPV5.js";import{a as K,b as V,c as z,d as F,e as u,f as p}from"./chunk-HEAQVSNS.js";import{a as A,e as T}from"./chunk-WUWBZPUK.js";import{d as M,h as G,o as W,r as X}from"./chunk-FODLDLE2.js";import{a as c,d as P,e as oe,f as re,g as ae}from"./chunk-YKXDMIHQ.js";var U=P(re(),1),Y=P(oe(),1);var t=P(ae(),1);var se=P(re(),1);var Q=P(oe(),1);var h=P(ae(),1);var ie=c(a=>Number.isFinite(a)?X(a,"\u2014"):"\u2014","X"),le=c(a=>a.toSorted((e,i)=>e.scheduledFor-i.scheduledFor),"F"),ce=c((a,e,i)=>e!==void 0?e:i===void 0?d=>a.cancelScheduledJob(d):void 0,"Y"),de=c(a=>{let e=(0,se.c)(16),{cancelJob:i,loadJobs:d}=a===void 0?{}:a,f=R(),r=M(),l=d===void 0,o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=["lunora-scheduled-jobs"],e[0]=o):o=e[0];let N=E(o,async()=>{let v=await(d??(()=>f.listScheduledJobs()))();return le(v)}),[x,n]=(0,Q.useState)(void 0),[s,m]=(0,Q.useState)(void 0),y,k;e[1]!==f||e[2]!==l?(y=c(()=>{if(l)return f.subscribeScheduledJobs(v=>{m(void 0),n(le(v))})},"v"),k=[l,f],e[1]=f,e[2]=l,e[3]=y,e[4]=k):(y=e[3],k=e[4]),(0,Q.useEffect)(y,k);let g;e[5]!==N?(g=c(()=>{N.refetch()},"y"),e[5]=N,e[6]=g):g=e[6],O(g,!l);let J=ce(f,i,d),b=x??N.data,j=s??N.error,I=c(async v=>{if(J!==void 0){m(void 0);try{await J(v),l||N.refetch()}catch(D){m(G(D))}}},"A"),q="flex flex-col gap-3",B="lunora-scheduled-jobs",S;e[7]!==j?(S=j!==null&&(0,h.jsx)("p",{className:"text-sm text-destructive","data-testid":"sj-error",role:"alert",children:j}),e[7]=j,e[8]=S):S=e[8];let L;e[9]!==b?.length||e[10]!==r?(L=b?.length===0&&(0,h.jsx)(_,{description:r("Jobs queued with runAfter / runAt will appear here."),icon:(0,h.jsxs)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,h.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,h.jsx)("path",{d:"M12 7.5V12l4 2"})]}),testId:"sj-empty",title:r("No scheduled jobs.")}),e[9]=b?.length,e[10]=r,e[11]=L):L=e[11];let $=b!==void 0&&b.length>0&&(0,h.jsx)(A,{className:"overflow-hidden py-0",children:(0,h.jsx)(T,{className:"px-0",children:(0,h.jsxs)(K,{"data-testid":"sj-table",children:[(0,h.jsx)(V,{children:(0,h.jsxs)(F,{children:[(0,h.jsx)(u,{children:r("function")}),(0,h.jsx)(u,{children:r("scheduled for")}),(0,h.jsx)(u,{children:r("pool")}),(0,h.jsx)(u,{children:r("attempts")}),(0,h.jsx)(u,{children:r("shard")}),(0,h.jsx)(u,{children:r("id")}),J!==void 0&&(0,h.jsx)(u,{"aria-label":r("Actions")})]})}),(0,h.jsx)(z,{children:b.map(v=>(0,h.jsxs)(F,{"data-testid":`sj-row-${v.id}`,children:[(0,h.jsx)(p,{className:"font-mono text-xs",children:v.workflow??v.functionPath}),(0,h.jsx)(p,{className:"text-muted-foreground tabular-nums",children:ie(v.scheduledFor)}),(0,h.jsx)(p,{className:"font-mono text-xs",children:v.pool??""}),(0,h.jsx)(p,{className:"tabular-nums",children:v.attempts??0}),(0,h.jsx)(p,{children:v.shardKey??""}),(0,h.jsx)(p,{className:"font-mono text-xs",children:v.id}),J!==void 0&&(0,h.jsx)(p,{className:"text-right",children:(0,h.jsx)(H,{confirmLabel:r("Cancel job?"),onConfirm:c(()=>{W(I(v.id))},"onConfirm"),testId:`sj-cancel-${v.id}`,children:r("Cancel")})})]},v.id))})]})})}),w;return e[12]!==$||e[13]!==S||e[14]!==L?(w=(0,h.jsxs)("div",{className:q,"data-testid":B,children:[S,L,$]}),e[12]=$,e[13]=S,e[14]=L,e[15]=w):w=e[15],w},"he");var he={kind:"idle"},me=c((a,e,i)=>i!==void 0?i:e===void 0?d=>a.runCronJob(d):void 0,"re"),ue=c(({loadCronJobs:a,runCronJob:e}={})=>{let i=R(),d=M(),[f,r]=(0,Y.useState)({}),l=E(["lunora-cron-jobs",a?"custom":"default"],()=>(a??(()=>i.getCronJobs()))()),{data:o,error:N}=l,x=me(i,a,e),n=c(async s=>{if(x!==void 0){r(m=>({...m,[s]:{kind:"running"}}));try{await x(s),r(m=>({...m,[s]:{kind:"ok"}})),l.refetch()}catch(m){r(y=>({...y,[s]:{kind:"error",message:G(m)}}))}}},"i");return(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-cron-triggers",children:[N!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"cron-error",role:"alert",children:N}),o?.length===0&&(0,t.jsx)(_,{description:d("Triggers declared with the cronJobs() builder appear here."),icon:(0,t.jsxs)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,t.jsx)("path",{d:"M12 7.5V12l4 2"})]}),testId:"cron-empty",title:d("No cron triggers.")}),o!==void 0&&o.length>0&&(0,t.jsx)(A,{className:"overflow-hidden py-0",children:(0,t.jsx)(T,{className:"px-0",children:(0,t.jsxs)(K,{"data-testid":"cron-table",children:[(0,t.jsx)(V,{children:(0,t.jsxs)(F,{children:[(0,t.jsx)(u,{children:d("name")}),(0,t.jsx)(u,{children:d("schedule")}),(0,t.jsx)(u,{children:d("target")}),(0,t.jsx)(u,{children:d("shard")}),x!==void 0&&(0,t.jsx)(u,{"aria-label":d("Actions")})]})}),(0,t.jsx)(z,{children:o.map(s=>{let m=f[s.name]??he;return(0,t.jsxs)(F,{"data-testid":`cron-row-${s.name}`,children:[(0,t.jsx)(p,{children:s.name}),(0,t.jsx)(p,{className:"font-mono text-xs tabular-nums",children:s.cron}),(0,t.jsx)(p,{children:(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[s.workflow===void 0?(0,t.jsx)(Z,{variant:"outline",children:d("function")}):(0,t.jsx)(Z,{variant:"secondary",children:d("workflow")}),(0,t.jsx)("span",{className:"font-mono text-xs",children:s.workflow??s.functionPath})]})}),(0,t.jsx)(p,{children:s.shardKey??""}),x!==void 0&&(0,t.jsx)(p,{className:"text-right",children:(0,t.jsxs)("span",{className:"flex items-center justify-end gap-2",children:[m.kind==="ok"&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground","data-testid":`cron-ran-${s.name}`,children:d("ran")}),m.kind==="error"&&(0,t.jsx)("span",{className:"text-xs text-destructive","data-testid":`cron-run-error-${s.name}`,role:"alert",children:m.message}),(0,t.jsx)(H,{confirmLabel:d("Run now?"),disabled:m.kind==="running",onConfirm:c(()=>{W(n(s.name))},"onConfirm"),testId:`cron-run-${s.name}`,children:m.kind==="running"?d("Running\u2026"):d("Run now")})]})})]},`${s.cron}:${s.name}`)})})]})})})]})},"le"),pe=c(a=>Number.isFinite(a)?X(a,"\u2014"):"\u2014","se"),fe=c(a=>{let e=(0,U.c)(34),i;e[0]!==a?(i=a===void 0?{}:a,e[0]=a,e[1]=i):i=e[1];let{loadJobs:d,removeJob:f,retryJob:r}=i,l=R(),o=M(),N;e[2]===Symbol.for("react.memo_cache_sentinel")?(N=["lunora-dead-jobs"],e[2]=N):N=e[2];let x;e[3]!==l||e[4]!==d?(x=c(async()=>(await(d??(()=>l.listDeadJobs()))()).toSorted(be),"h"),e[3]=l,e[4]=d,e[5]=x):x=e[5];let n=E(N,x),s=n.data,[m,y]=(0,Y.useState)(void 0),k=n.error??m,g=d===void 0,J;e[6]!==l||e[7]!==g||e[8]!==r?(J=r??(g?C=>l.retryDeadJob(C):void 0),e[6]=l,e[7]=g,e[8]=r,e[9]=J):J=e[9];let b=J,j;e[10]!==l||e[11]!==g||e[12]!==f?(j=f??(g?C=>l.removeDeadJob(C):void 0),e[10]=l,e[11]=g,e[12]=f,e[13]=j):j=e[13];let I=j,q;e[14]!==n?(q=c(()=>{n.refetch()},"$"),e[14]=n,e[15]=q):q=e[15],O(q,!0);let B;e[16]!==n?(B=c(async C=>{y(void 0);try{await C,n.refetch()}catch(ne){y(G(ne))}},"I"),e[16]=n,e[17]=B):B=e[17];let S=B,L=b!==void 0||I!==void 0,$;e[18]!==k?($=k!==void 0&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"dlq-error",role:"alert",children:k}),e[18]=k,e[19]=$):$=e[19];let w;e[20]!==s?.length||e[21]!==o?(w=s?.length===0&&(0,t.jsx)(_,{description:o("Jobs that exhaust their retry budget are parked here instead of being dropped."),icon:(0,t.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M3 6h18M8 6V4h8v2M6 6l1 14h10l1-14"})}),testId:"dlq-empty",title:o("No dead-letter jobs.")}),e[20]=s?.length,e[21]=o,e[22]=w):w=e[22];let v;e[23]!==S||e[24]!==L||e[25]!==s||e[26]!==I||e[27]!==b||e[28]!==o?(v=s!==void 0&&s.length>0&&(0,t.jsx)(A,{className:"overflow-hidden py-0",children:(0,t.jsx)(T,{className:"px-0",children:(0,t.jsxs)(K,{"data-testid":"dlq-table",children:[(0,t.jsx)(V,{children:(0,t.jsxs)(F,{children:[(0,t.jsx)(u,{children:o("function")}),(0,t.jsx)(u,{children:o("attempts")}),(0,t.jsx)(u,{children:o("last tried")}),(0,t.jsx)(u,{children:o("pool")}),(0,t.jsx)(u,{children:o("shard")}),(0,t.jsx)(u,{children:o("id")}),L&&(0,t.jsx)(u,{"aria-label":o("Actions")})]})}),(0,t.jsx)(z,{children:s.map(C=>(0,t.jsxs)(F,{"data-testid":`dlq-row-${C.id}`,children:[(0,t.jsx)(p,{className:"font-mono text-xs",children:C.workflow??C.functionPath}),(0,t.jsx)(p,{className:"tabular-nums",children:C.attempts??0}),(0,t.jsx)(p,{className:"text-muted-foreground tabular-nums",children:pe(C.scheduledFor)}),(0,t.jsx)(p,{className:"font-mono text-xs",children:C.pool??""}),(0,t.jsx)(p,{children:C.shardKey??""}),(0,t.jsx)(p,{className:"font-mono text-xs",children:C.id}),L&&(0,t.jsx)(p,{className:"text-right",children:(0,t.jsxs)("div",{className:"flex justify-end gap-1.5",children:[b!==void 0&&(0,t.jsx)(ee,{"data-testid":`dlq-retry-${C.id}`,onClick:c(()=>{W(S(b(C.id)))},"onClick"),size:"sm",type:"button",variant:"outline",children:o("Retry")}),I!==void 0&&(0,t.jsx)(H,{confirmLabel:o("Drop job?"),onConfirm:c(()=>{W(S(I(C.id)))},"onConfirm"),testId:`dlq-remove-${C.id}`,children:o("Drop")})]})})]},C.id))})]})})}),e[23]=S,e[24]=L,e[25]=s,e[26]=I,e[27]=b,e[28]=o,e[29]=v):v=e[29];let D;return e[30]!==v||e[31]!==$||e[32]!==w?(D=(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-dead-letter",children:[$,w,v]}),e[30]=v,e[31]=$,e[32]=w,e[33]=D):D=e[33],D},"ne");function be(a,e){return(e.attempts??0)-(a.attempts??0)}c(be,"oe");var te=c(a=>{let e=(0,U.c)(8),{label:i,testId:d,value:f}=a,r;e[0]!==i?(r=(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:i}),e[0]=i,e[1]=r):r=e[1];let l;e[2]!==d||e[3]!==f?(l=(0,t.jsx)("span",{className:"text-2xl font-semibold tabular-nums","data-testid":d,children:f}),e[2]=d,e[3]=f,e[4]=l):l=e[4];let o;return e[5]!==r||e[6]!==l?(o=(0,t.jsx)(A,{className:"flex-1 py-0",children:(0,t.jsxs)(T,{className:"flex flex-col gap-1 p-4",children:[r,l]})}),e[5]=r,e[6]=l,e[7]=o):o=e[7],o},"E"),ve=c(a=>{let e=(0,U.c)(25),i;e[0]!==a?(i=a===void 0?{}:a,e[0]=a,e[1]=i):i=e[1];let{loadStatus:d}=i,f=R(),r=M(),l=d===void 0,o;e[2]!==l?(o=["lunora-scheduler-status",l],e[2]=l,e[3]=o):o=e[3];let N;e[4]!==f||e[5]!==d?(N=c(async()=>{let j=await(d??(()=>f.schedulerStatus()))();return{...j,pools:j.pools.toSorted(xe)}},"y"),e[4]=f,e[5]=d,e[6]=N):N=e[6];let x=E(o,N),{data:n,error:s}=x,m;e[7]!==x?(m=c(()=>{x.refetch()},"d"),e[7]=x,e[8]=m):m=e[8],O(m,!0);let y;e[9]!==s?(y=s!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"pools-error",role:"alert",children:s}),e[9]=s,e[10]=y):y=e[10];let k;e[11]!==n||e[12]!==r?(k=n!==void 0&&(0,t.jsxs)("div",{className:"flex gap-3","data-testid":"pools-totals",children:[(0,t.jsx)(te,{label:r("backlog"),testId:"pools-backlog",value:n.backlog}),(0,t.jsx)(te,{label:r("in flight"),testId:"pools-inflight",value:n.inFlight}),(0,t.jsx)(te,{label:r("pools"),testId:"pools-count",value:n.pools.length})]}),e[11]=n,e[12]=r,e[13]=k):k=e[13];let g;e[14]!==n?.pools.length||e[15]!==r?(g=n?.pools.length===0&&(0,t.jsx)(_,{description:r("Pools created with createWorkpool appear here once they have activity."),icon:(0,t.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M4 7h16M4 12h16M4 17h16"})}),testId:"pools-empty",title:r("No workpools.")}),e[14]=n?.pools.length,e[15]=r,e[16]=g):g=e[16];let J;e[17]!==n||e[18]!==r?(J=n!==void 0&&n.pools.length>0&&(0,t.jsx)(A,{className:"overflow-hidden py-0",children:(0,t.jsx)(T,{className:"px-0",children:(0,t.jsxs)(K,{"data-testid":"pools-table",children:[(0,t.jsx)(V,{children:(0,t.jsxs)(F,{children:[(0,t.jsx)(u,{children:r("pool")}),(0,t.jsx)(u,{children:r("queued")}),(0,t.jsx)(u,{children:r("in flight")}),(0,t.jsx)(u,{children:r("max concurrency")})]})}),(0,t.jsx)(z,{children:n.pools.map(ge)})]})})}),e[17]=n,e[18]=r,e[19]=J):J=e[19];let b;return e[20]!==y||e[21]!==k||e[22]!==g||e[23]!==J?(b=(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-scheduler-pools",children:[y,k,g,J]}),e[20]=y,e[21]=k,e[22]=g,e[23]=J,e[24]=b):b=e[24],b},"ae");function xe(a,e){return e.queued-a.queued}c(xe,"ie");function ge(a){return(0,t.jsxs)(F,{"data-testid":`pools-row-${a.name}`,children:[(0,t.jsx)(p,{className:"font-mono text-xs",children:a.name}),(0,t.jsx)(p,{className:"tabular-nums",children:a.queued}),(0,t.jsxs)(p,{className:"tabular-nums",children:[a.inFlight," / ",a.maxConcurrency]}),(0,t.jsx)(p,{className:"tabular-nums",children:a.maxConcurrency})]},a.name)}c(ge,"de");var Ne=["jobs","dead","pools","cron"],Ve=c(a=>{let e=(0,U.c)(41),i;e[0]!==a?(i=a===void 0?{}:a,e[0]=a,e[1]=i):i=e[1];let{loadCronJobs:d,scheduledCancel:f,scheduledLoad:r}=i,l=M(),[o,N]=(0,Y.useState)("jobs"),x;e[2]!==l?(x=l("Cron triggers"),e[2]=l,e[3]=x):x=e[3];let n;e[4]!==l?(n=l("Dead letter"),e[4]=l,e[5]=n):n=e[5];let s;e[6]!==l?(s=l("Scheduled jobs"),e[6]=l,e[7]=s):s=e[7];let m;e[8]!==l?(m=l("Pools"),e[8]=l,e[9]=m):m=e[9];let y;e[10]!==x||e[11]!==n||e[12]!==s||e[13]!==m?(y={cron:x,dead:n,jobs:s,pools:m},e[10]=x,e[11]=n,e[12]=s,e[13]=m,e[14]=y):y=e[14];let k=y,g;e[15]===Symbol.for("react.memo_cache_sentinel")?(g=c(w=>{N(w.currentTarget.dataset.view)},"f"),e[15]=g):g=e[15];let J=g,b;e[16]!==l?(b=l("Schedule view"),e[16]=l,e[17]=b):b=e[17];let j;e[18]!==o||e[19]!==k?(j=Ne.map(w=>(0,t.jsx)(ee,{"aria-selected":o===w,"data-testid":`schedule-view-${w}`,"data-view":w,onClick:J,role:"tab",size:"sm",type:"button",variant:o===w?"default":"outline",children:k[w]},w)),e[18]=o,e[19]=k,e[20]=j):j=e[20];let I;e[21]!==b||e[22]!==j?(I=(0,t.jsx)("div",{"aria-label":b,className:"flex gap-1.5","data-testid":"schedule-view-toggle",role:"tablist",children:j}),e[21]=b,e[22]=j,e[23]=I):I=e[23];let q;e[24]!==f||e[25]!==r||e[26]!==o?(q=o==="jobs"&&(0,t.jsx)(de,{cancelJob:f,loadJobs:r}),e[24]=f,e[25]=r,e[26]=o,e[27]=q):q=e[27];let B;e[28]!==o?(B=o==="dead"&&(0,t.jsx)(fe,{}),e[28]=o,e[29]=B):B=e[29];let S;e[30]!==o?(S=o==="pools"&&(0,t.jsx)(ve,{}),e[30]=o,e[31]=S):S=e[31];let L;e[32]!==d||e[33]!==o?(L=o==="cron"&&(0,t.jsx)(ue,{loadCronJobs:d}),e[32]=d,e[33]=o,e[34]=L):L=e[34];let $;return e[35]!==I||e[36]!==q||e[37]!==B||e[38]!==S||e[39]!==L?($=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-schedule",children:[I,q,B,S,L]}),e[35]=I,e[36]=q,e[37]=B,e[38]=S,e[39]=L,e[40]=$):$=e[40],$},"Ie");export{Ve as SchedulePanel};
@@ -0,0 +1 @@
1
+ import{a as w}from"./chunk-55754F6H.js";import"./chunk-IS6LVJ6L.js";import"./chunk-AAVLPU5Q.js";import{b as y}from"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import{a as C}from"./chunk-F7UZBTKS.js";import"./chunk-ULIQFBZU.js";import"./chunk-Y3G2ZPOD.js";import"./chunk-35DM4JJG.js";import{a as h}from"./chunk-4ZEL6BYL.js";import{c as u}from"./chunk-D6UKRXIS.js";import"./chunk-VWWJIICI.js";import"./chunk-FSRSK4LY.js";import"./chunk-KSYIH3NO.js";import{a as T}from"./chunk-FKVZRPV5.js";import{a as S,b as K,c as $,d as g,e as o,f as i}from"./chunk-HEAQVSNS.js";import{a as A,e as k}from"./chunk-WUWBZPUK.js";import{d as M,r as D}from"./chunk-FODLDLE2.js";import{a as d,d as z,e as ae,g as re}from"./chunk-YKXDMIHQ.js";var O=z(ae(),1);var e=z(re(),1);var Q="agent_threads",se="agent_messages",F="agent_run_queue",R=100,ne=250,oe={},ie={filters:[],limit:R,offset:0,orderBy:{column:"updatedAt",direction:"desc"},skipCount:!0,table:Q},l=d((s,t)=>{let r=s[t];return typeof r=="string"?r:void 0},"i"),j=d((s,t)=>{let r=s[t];return typeof r=="number"?r:void 0},"A"),L=d(s=>{let{usage:t}=s;if(t===null||typeof t!="object")return;let{totalTokens:r}=t;return typeof r=="number"?r:void 0},"U"),de=d(s=>{let{toolCalls:t}=s;return Array.isArray(t)?t.map(r=>r!==null&&typeof r=="object"?r.name:void 0).filter(r=>typeof r=="string"):[]},"ne"),le=d(s=>{switch(s){case"awaiting_input":return"warning";case"cancelled":return"warning";case"error":return"destructive";case"running":return"info";default:return"outline"}},"oe"),ce=d(s=>{switch(s){case"approved":return"success";case"rejected":return"destructive";default:return"warning"}},"de"),Ne=d(({initialShardKey:s=""})=>{let t=M(),[r,I]=(0,O.useState)(void 0),{data:c}=u(h.listTables,oe,{live:!0,shardKey:s}),G=c!==void 0,p=Array.isArray(c)&&c.some(a=>a.name===Q),H=Array.isArray(c)&&c.some(a=>a.name===F),{data:_,error:J,errorSource:V,liveError:W}=u(h.readTablePage,ie,{enabled:p,live:!0,shardKey:s}),X={filters:[{column:"threadKey",operator:"eq",value:r??""}],limit:ne,offset:0,orderBy:{column:"seq",direction:"asc"},skipCount:!0,table:se},{data:q}=u(h.readTablePage,{limit:R,offset:0,orderBy:{column:"position",direction:"asc"},skipCount:!0,table:F},{enabled:H,live:!0,shardKey:s}),{data:B,error:Y,errorSource:Z}=u(h.readTablePage,X,{enabled:p&&r!==void 0,live:!0,shardKey:s}),v=Array.isArray(_?.rows)?_.rows:[],ee=Array.isArray(q?.rows)?q.rows:[],E=d(a=>ee.filter(n=>l(n,"threadKey")===a).length,"w"),P=Array.isArray(B?.rows)?B.rows:[],U=v.find(a=>l(a,"key")===r),f;return G&&!p?f=(0,e.jsx)(T,{description:t("No @lunora/agent tables found in this deployment. Add lunora/agents.ts with defineAgent(...) and merge the agent schema extension to run durable AI agents."),testId:"agents-unconfigured",title:t("No agents configured")}):p&&v.length===0?f=(0,e.jsx)(T,{description:t("No agent has run yet. Start a run with ctx.agents.<name>.run(...) and its thread appears here."),testId:"agents-empty",title:t("No agent threads yet")}):f=(0,e.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,e.jsx)(A,{className:"overflow-hidden py-0",children:(0,e.jsx)(k,{className:"px-0",children:(0,e.jsxs)(S,{"data-testid":"agents-threads-table",children:[(0,e.jsx)(K,{children:(0,e.jsxs)(g,{children:[(0,e.jsx)(o,{children:t("Agent")}),(0,e.jsx)(o,{children:t("Key")}),(0,e.jsx)(o,{children:t("Status")}),(0,e.jsx)(o,{children:t("Queued")}),(0,e.jsx)(o,{children:t("Messages")}),(0,e.jsx)(o,{children:t("Tokens")}),(0,e.jsx)(o,{children:t("Updated")}),(0,e.jsx)(o,{"aria-label":t("Actions")})]})}),(0,e.jsx)($,{children:v.map(a=>{let n=l(a,"key")??"",m=l(a,"status"),x=L(a);return(0,e.jsxs)(g,{"data-active":n===r?"":void 0,"data-testid":`agents-thread-${n}`,children:[(0,e.jsx)(i,{className:"font-mono text-xs",children:l(a,"agent")??"\u2014"}),(0,e.jsx)(i,{className:"font-mono text-xs text-muted-foreground",children:n}),(0,e.jsx)(i,{children:(0,e.jsx)(y,{"data-testid":`agents-thread-status-${n}`,variant:le(m),children:m??"\u2014"})}),(0,e.jsx)(i,{className:"tabular-nums",children:E(n)===0?(0,e.jsx)("span",{className:"text-muted-foreground",children:"\u2014"}):(0,e.jsx)(y,{"data-testid":`agents-thread-queued-${n}`,variant:"warning",children:E(n)})}),(0,e.jsx)(i,{className:"tabular-nums",children:j(a,"messageCount")??"\u2014"}),(0,e.jsx)(i,{className:"tabular-nums text-muted-foreground",children:x??"\u2014"}),(0,e.jsx)(i,{className:"text-muted-foreground tabular-nums",children:D(j(a,"updatedAt"),"\u2014")}),(0,e.jsx)(i,{className:"text-right",children:(0,e.jsx)(w,{"data-testid":`agents-thread-open-${n}`,onClick:d(()=>{I(n)},"onClick"),size:"sm",type:"button",variant:"outline",children:t("Timeline")})})]},n)})})]})})}),Y!==null&&(0,e.jsx)(C,{error:Z,testId:"agents-messages-error"}),r!==void 0&&(0,e.jsx)(A,{className:"overflow-hidden py-0","data-testid":"agents-thread-detail",children:(0,e.jsxs)(k,{className:"flex flex-col gap-3 px-4 py-3",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,e.jsxs)("span",{className:"font-mono text-xs",children:[t("Timeline")," \xB7 ",r,U!==void 0&&(0,e.jsxs)("span",{className:"text-muted-foreground",children:[" \xB7 ",t("Usage"),": ",L(U)??0," ",t("Tokens")]})]}),(0,e.jsx)(w,{"data-testid":"agents-thread-detail-close",onClick:d(()=>{I(void 0)},"onClick"),size:"xs",type:"button",variant:"ghost",children:t("Close")})]}),P.length===0?(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:t("This thread has no messages yet.")}):(0,e.jsxs)(S,{"data-testid":"agents-messages-table",children:[(0,e.jsx)(K,{children:(0,e.jsxs)(g,{children:[(0,e.jsx)(o,{children:t("Role")}),(0,e.jsx)(o,{children:t("Content")}),(0,e.jsx)(o,{children:t("Tool")}),(0,e.jsx)(o,{children:t("Approval")})]})}),(0,e.jsx)($,{children:P.map((a,n)=>{let m=l(a,"role")??"\u2014",x=de(a),te=l(a,"toolName"),b=l(a,"status"),N=j(a,"seq")??n;return(0,e.jsxs)(g,{"data-testid":`agents-message-${String(N)}`,children:[(0,e.jsx)(i,{className:"font-mono text-xs align-top text-muted-foreground",children:m}),(0,e.jsx)(i,{className:"max-w-md font-mono text-xs whitespace-pre-wrap break-words",children:l(a,"content")??"\u2014"}),(0,e.jsx)(i,{className:"font-mono text-xs align-top text-muted-foreground",children:te??(x.length>0?x.join(", "):"\u2014")}),(0,e.jsx)(i,{className:"align-top",children:b===void 0?(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:"\u2014"}):(0,e.jsx)(y,{"data-testid":`agents-message-approval-${String(N)}`,variant:ce(b),children:b})})]},l(a,"messageKey")??`${m}:${String(N)}`)})})]})]})})]}),(0,e.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-agents-panel",children:[J!==null&&(0,e.jsx)(C,{error:V,testId:"agents-error"}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:t("Agents run as durable workflows. Each run persists a thread of assistant and tool messages; select a thread to inspect its timeline, tool calls, approvals, and token usage.")}),W!==void 0&&(0,e.jsx)("p",{className:"text-xs text-amber-600 dark:text-amber-500","data-testid":"agents-live-error",role:"alert",children:t("Live updates unavailable; showing the last evaluation.")}),f]})},"be");export{Ne as default};
@@ -0,0 +1,15 @@
1
+ import{a}from"./chunk-YKXDMIHQ.js";var r="https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-5xx-errors/",n="https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-1xxx-errors/",_=/string or blob too big/iu,l={BAD_REQUEST:{status:400,title:"Bad request"},UNAUTHORIZED:{status:401,title:"Unauthorized"},FORBIDDEN:{status:403,title:"Forbidden"},NOT_FOUND:{status:404,title:"Not found"},CONFLICT:{hint:["Another write changed this row while your mutation was running (optimistic concurrency conflict).","","Re-read the row and retry the mutation with the fresh value. Lunora serializes a DO's mutations, so a persistent conflict usually means the handler conflicts **with itself** (e.g. a trigger or cascade touching the same row) \u2014 split that work rather than adding a retry loop."],status:409,title:"Conflict"},NOT_UNIQUE:{hint:["`.unique()` matched more than one document \u2014 it expects the query to identify at most one row.","","- If several matches are legitimate, use `.first()` (take one) or `.collect()` (take all) instead.","- Otherwise tighten the query (e.g. filter on a unique/indexed field) so it can only match one row."],status:400,title:"Query matched more than one document"},VALIDATION_ERROR:{status:400,title:"Validation failed"},TOO_MANY_REQUESTS:{status:429,title:"Too many requests"},UNPROCESSABLE:{status:422,title:"Unprocessable"},NOT_IMPLEMENTED:{status:501,title:"Not implemented"},FUNCTION_NOT_FOUND:{status:404,title:"Function not found"},METHOD_NOT_ALLOWED:{status:405,title:"Method not allowed"},PAYLOAD_TOO_LARGE:{status:413,title:"Payload too large"},INTERNAL:{internal:!0,status:500,title:"Internal error"},INTERNAL_SERVER_ERROR:{internal:!0,status:500,title:"Internal error"},RPC_FAILED:{internal:!0,status:500,title:"Internal error"},COUNT_RLS_UNSUPPORTED:{status:422,title:"count() is unsupported under an RLS policy"},MASK_UNSUPPORTED:{status:422,title:"Aggregation over a masked column is unsupported"},RELATION_PREDICATE_UNSUPPORTED:{status:422,title:"Relation predicate is unsupported in a write policy"},RLS_REQUIRED:{hint:["This table is secure-by-default: it has no `.public()` marker and no RLS policy resolved for the caller, so the read fails closed.","","Add a read policy with `.rls(...)`, or mark the table `.public()` if it is intentionally world-readable."],status:403,title:"RLS policy required"},RUN_DEPTH_EXCEEDED:{internal:!0,status:500,title:"Run depth exceeded"},RUN_KIND_FORBIDDEN:{status:500,title:"Function kind may not be composed from a query"},TRANSACTION_LIMIT_EXCEEDED:{hint:["A single mutation may only read and write a bounded amount before it is stopped.","","Narrow the read with an index (`.withIndex(...)`) instead of scanning the table, or split the write across several mutations \u2014 for a large backfill use `defineMigration` + `lunora migrate up`, which batches and checkpoints for you.","","The ceilings are deliberately conservative \u2014 they exist to stop one request taking down the whole shard. A deployment that genuinely needs bigger transactions can raise them by overriding the `transactionLimits()` seam on its generated shard class."],status:413,title:"Transaction limit exceeded"},MIGRATION_NOT_FOUND:{status:404,title:"Data migration not found"},UNKNOWN_TABLE:{status:404,title:"Unknown table"},GLOBAL_TABLE_NOT_EDITABLE:{status:400,title:"Global table is not editable"},SHARD_ERROR:{status:503,title:"Shard error"},SHARD_UNAVAILABLE:{status:503,title:"Shard unavailable"},SHARD_TIMEOUT:{status:504,title:"Shard timeout"},SHARD_HTTP_ERROR:{status:502,title:"Shard HTTP error"},SUBSCRIPTION_PERSIST_FAILED:{status:500,title:"Subscription persist failed"},TOO_MANY_SUBSCRIPTIONS:{status:429,title:"Too many subscriptions"},OFFLINE_IDENTITY_CHANGED:{status:409,title:"Offline identity changed"},CODEGEN_DIAGNOSTIC:{status:500,title:"Codegen diagnostic"},SCHEMA_SNAPSHOT_PARSE:{status:500,title:"Schema snapshot parse error"},ENV_INVALID:{internal:!0,status:500,title:"Invalid environment"},AUTH_HEADERS_MISSING:{internal:!0,status:500,title:"Auth headers missing"},EMAIL_DOMAIN_BLOCKED:{hint:["This address's domain is on the disposable/throwaway blocklist (or your configured deny-list).","","Sign up with a permanent mailbox. To tune the policy, pass `blockDisposable` / `allowDomains` / `denyDomains` to `emailGate(...)` (`@lunora/auth/email-guard`)."],status:400,title:"Email domain not allowed"},EMAIL_UNDELIVERABLE:{hint:["The address's domain publishes no MX (or fallback A/AAAA) records, so it can't receive mail.","","Check for a typo in the domain. MX verification is opt-in (`mx: true`) and needs DNS \u2014 leave it off on the edge path if DNS is unavailable."],status:400,title:"Email domain cannot receive mail"},ANALYTICS_SQL_ERROR:{status:502,title:"Analytics Engine SQL API error"},R2_SQL_ERROR:{status:502,title:"R2 SQL API error"},WORKFLOWS_REST_ERROR:{status:502,title:"Cloudflare Workflows REST API error"},CONFIG_INVALID:{internal:!0,status:500,title:"Payment configuration invalid"},CURRENCY_MISMATCH:{status:400,title:"Currency mismatch"},PROVIDER_ERROR:{status:502,title:"Payment provider error"},WEBHOOK_EVENT_ID_MISSING:{status:400,title:"Webhook event id missing"},WEBHOOK_SIGNATURE_INVALID:{status:400,title:"Webhook signature invalid"},WEBHOOK_TIMESTAMP_INVALID:{status:400,title:"Webhook timestamp outside tolerance"},ADMIN_FORBIDDEN:{status:403,title:"Admin access forbidden"},ADMIN_TOKEN_NOT_CONFIGURED:{status:400,title:"Admin token not configured"},AUTH_MIGRATOR_UNSUPPORTED:{hint:["better-auth migrates only through its Kysely adapter, so `ensureMigrated` / `compileMigrationsSql` need the raw D1 binding as `database` \u2014 a custom adapter (`lunoraD1Adapter`, `lunoraAuthAdapter`, `lunoraDoAdapter`) cannot be migrated through, and neither can an absent `database`.","","Build a SECOND, migration-only instance over the raw binding \u2014 `createAuth({ ...options, database: env.DB })` \u2014 and hand that one to `ensureMigrated`. Keep the adapter on the instance that serves requests: the adapter exists to dodge a dev-runner hang in `$context`, which the migration instance never resolves.","","To compile the SQL off-platform (`compileMigrationsSql`), diff against an empty local database \u2014 `new DatabaseSync(':memory:')` from `node:sqlite` \u2014 rather than passing no `database` at all."],status:500,title:"Auth migrator cannot drive the configured database"},AUTH_NOT_CONFIGURED:{status:400,title:"Auth admin not configured"},AUTH_OP_NOT_SUPPORTED:{status:400,title:"Auth admin operation not supported"},BACKUP_NOT_CONFIGURED:{status:500,title:"Scheduled backup not configured"},BACKUP_RETENTION_NOT_CONFIGURED:{hint:["`lunora backup prune` removes snapshots past the retention window, and this worker has no window: set `backupRetain` (how many to keep) and `backupCron` (which decides whose snapshots retention owns) on `createWorker`.","","Nothing was deleted. A default is deliberately not invented here \u2014 retention deleting on its own is exactly what this command exists to replace."],status:400,title:"Backup retention window not configured"},BACKUP_TOO_LARGE:{hint:["The scheduled backup is assembled inside the Worker isolate, so it caps the snapshot it will build. Nothing was written.","","The cap is on the NDJSON, not on peak memory: the export fan-out resolves every shard's rows before the first row is encoded, so a snapshot under the cap can still exhaust the isolate. It is set well below the isolate's limit for that reason.","","Narrow the snapshot with `backupTables`, or take this backup off-platform with `lunora backup create --bucket`, which runs on a machine rather than in an isolate. Backing up more often does not help \u2014 every run is a full snapshot."],status:507,title:"Backup too large to assemble in a Worker"},CRON_JOBS_NOT_CONFIGURED:{status:400,title:"Cron jobs not configured"},CRON_JOB_NOT_FOUND:{status:404,title:"Cron job not found"},EXPORT_TAP_NOT_CONFIGURED:{status:400,title:"Export tap not configured"},FUNCTIONS_NOT_CONFIGURED:{status:400,title:"Functions registry not configured"},GLOBALS_NOT_CONFIGURED:{status:400,title:"Global-table introspector not configured"},KV_NOT_CONFIGURED:{status:400,title:"KV introspector not configured"},MIGRATION_ID_REQUIRED:{status:400,title:"Migration id required"},PITR_UNAVAILABLE:{status:409,title:"Point-in-time recovery unavailable"},SCHEDULER_NOT_CONFIGURED:{status:400,title:"Scheduler not configured"},STORAGE_CHECKSUM_MISMATCH:{hint:["The upload body did not match the declared `expectedSize` or `expectedSha256`, so nothing was written \u2014 this check fails closed.","","Re-read the bytes from the source export and retry the transfer. A persistent mismatch means the source blob is corrupt or truncated; fix the export rather than bypassing the check."],status:400,title:"Storage checksum mismatch"},STORAGE_DELETE_NOT_CONFIGURED:{status:400,title:"Storage delete not configured"},STORAGE_DOWNLOAD_NOT_CONFIGURED:{hint:["`GET /_lunora/admin/storage/object` needs a `storageDownload` function on the worker. The generated app worker wires it up; a hand-written `createWorker({ ... })` has to pass `(key, opts) => pick(opts?.bucket).download(key)` \u2014 forwarding `opts.bucket` to the right bucket, and wrapping rather than passing `createStorage(...).download` itself, whose second parameter is a byte range.","","Without it a bucket-backed `lunora backup restore --bucket` cannot read the snapshot. The object is still readable out of band with `wrangler r2 object get`."],status:400,title:"Storage download not configured"},STORAGE_NOT_CONFIGURED:{status:400,title:"Storage not configured"},STORAGE_OBJECT_NOT_FOUND:{status:404,title:"Storage object not found"},STORAGE_UPLOAD_NOT_CONFIGURED:{status:400,title:"Storage upload not configured"},STORAGE_URL_NOT_CONFIGURED:{status:400,title:"Storage signed URL not configured"},RAG_DIMENSION_MISMATCH:{hint:["A stored vector and the query embedding have different widths, so they cannot be compared.","","This is what changing a RAG index's `embeddingModel` (or a provider's `dimensions` option) without reindexing looks like. Either put the previous model back, or reindex the namespace under the new one \u2014 bump `embeddingModelVersion` so the index rebuilds instead of mixing widths."],status:409,title:"Embedding dimension mismatch"},VECTORS_NOT_CONFIGURED:{status:400,title:"Vector index introspector not configured"},VECTOR_QUERY_UNSUPPORTED:{status:400,title:"Vector index querying not enabled"},WORKFLOWS_NOT_CONFIGURED:{status:501,title:"Workflows not configured"},AUTH_AUDIT_NOT_CONFIGURED:{status:400,title:"Auth audit reader not configured"},AUTH_AUDIT_READ_FAILED:{internal:!0,status:500,title:"Auth audit read failed"},CRON_EXPR_INVALID:{status:500,title:"Invalid cron expression"},CRON_EXPR_NOT_STATIC:{status:500,title:"Cron expression is not statically analyzable"},CRON_JOB_FAILED:{internal:!0,status:500,title:"Cron job failed"},CRON_NAME_NOT_STATIC:{status:500,title:"Cron job name is not statically analyzable"},CRON_NON_STATIC_FN:{status:500,title:"Cron function reference is not statically analyzable"},CRON_NON_STATIC_VALUE:{status:500,title:"Cron value is not statically analyzable"},CRON_SCHEDULE_INVALID:{status:500,title:"Invalid cron schedule"},CRON_SCHEDULE_NOT_STATIC:{status:500,title:"Cron schedule is not statically analyzable"},DUPLICATE_CRON_NAME:{status:500,title:"Duplicate cron job name"},DUPLICATE_AGENT_BINDING:{status:500,title:"Duplicate agent binding"},DUPLICATE_AGENT_CLASS:{status:500,title:"Duplicate agent generated class name"},DUPLICATE_AGENT_NAME:{status:500,title:"Duplicate agent name"},DUPLICATE_MIGRATION_ID:{status:500,title:"Duplicate migration id"},DUPLICATE_QUEUE_BINDING:{status:500,title:"Duplicate queue binding"},DUPLICATE_QUEUE_NAME:{status:500,title:"Duplicate queue name"},DUPLICATE_WORKFLOW_CLASS:{status:500,title:"Duplicate workflow generated class name"},MIGRATION_ID_NOT_STATIC:{status:500,title:"Migration id is not statically analyzable"},NAMESPACE_COLLISION:{status:500,title:"Function namespace collision"},BAD_ROW:{status:400,title:"Malformed import row"},BAD_SUBSCRIPTION_ARGS:{status:400,title:"Invalid subscription arguments"},BATCH_LIMIT_EXCEEDED:{status:400,title:"Batch limit exceeded"},CROSS_SHARD_RANK_UNSUPPORTED:{status:400,title:"Cross-shard rank() is unsupported"},DISPATCH_UNAUTHENTICATED:{hint:"The scheduler could not authenticate to the worker. Check that `LUNORA_SCHEDULER_SECRET` matches on both sides, or that `LUNORA_ADMIN_TOKEN` is set and current.",status:403,title:"Dispatch caller not authenticated"},FORBIDDEN_FANOUT:{status:403,title:"Fan-out forbidden"},GLOBAL_SEARCH_SCORES_UNSUPPORTED:{status:400,title:"collectWithScores() is unsupported on a global table"},FORBIDDEN_ORIGIN:{status:403,title:"Origin forbidden"},FORBIDDEN_SHARD:{status:403,title:"Shard access forbidden"},GLOBAL_NOT_CONFIGURED:{status:400,title:"Global table import not configured"},INVALID_INPUT:{status:400,title:"Invalid input"},INVALID_SCHEDULE_ID:{status:400,title:"Invalid schedule id"},RATE_LIMITED:{status:429,title:"Rate limited"},REPLICA_NOT_READY:{status:421,title:"Replica not caught up"},REPLICA_READ_ONLY:{status:421,title:"Replica is read-only"},SEARCH_INDEX_BUILDING:{status:503,title:"Search index is still building"},SERVICE_UNAVAILABLE:{status:503,title:"Service unavailable"},SHAPE_MEMORY_TABLE:{status:400,title:"Shape over a memory table is unsupported"},SHAPE_CROSS_SHARD_JOIN:{status:400,title:"Shape cross-shard join is unsupported"},UNAUTHENTICATED:{status:401,title:"Unauthenticated"},WIRE_DECODE_FAILED:{status:502,title:"Could not decode a server frame"},WIRE_ENCODE_FAILED:{status:500,title:"Could not encode a return value"},UNKNOWN_COLUMN:{status:404,title:"Unknown column"},CDC_LOG_TRIMMED:{status:409,title:"CDC log trimmed"},CDC_PAYLOAD_COMPACTED:{status:409,title:"CDC payloads compacted"},EXPIRED:{status:404,title:"Session expired"},NESTED_TRANSACTION:{internal:!0,status:500,title:"Nested transaction"},OUT_OF_ORDER:{status:409,title:"Out-of-order mutation"},SHAPE_GLOBAL_TOO_LARGE:{status:413,title:"Global shape too large"},SHAPE_NOT_FOUND:{status:404,title:"Shape not found"},SHAPE_REQUIRES_CDC:{status:409,title:"Shape requires change-data-capture"},SQL_UNAVAILABLE:{internal:!0,status:500,title:"SQL storage unavailable"},STREAM_ID_IN_USE:{status:409,title:"Stream id already in use"},STREAM_INTERRUPTED:{status:503,title:"Durable stream interrupted"},STREAM_TOO_LONG:{status:507,title:"Durable stream exceeded its chunk ceiling"},TOKEN_EXPIRED:{status:401,title:"Authentication token expired"},TOO_MANY_STREAMS:{status:429,title:"Too many streams"},UNKNOWN_ADMIN_OP:{status:404,title:"Unknown admin operation"},SOCKET_TAG_BUDGET_EXCEEDED:{status:400,title:"Socket tag budget exceeded"},RELAY_CANNOT_SEED:{status:500,title:"Relay cannot seed"},RELAY_MISCONFIGURED:{status:500,title:"Relay misconfigured"},RELAY_SEED_FAILED:{status:502,title:"Relay seed failed"},RELAY_SHAPE_UNROUTABLE:{status:500,title:"Relay shape unroutable"},MISCONFIGURED:{internal:!0,status:500,title:"Worker misconfigured"},LUNORA_RUNTIME_UNAVAILABLE:{status:500,title:"Lunora runtime unavailable"},INTERNAL_ERROR:{internal:!0,status:500,title:"Internal error"},BROWSER_TIMEOUT:{status:504,title:"Browser operation timed out"},CLIENT_CLOSED:{status:400,title:"Client is closed"},HTTP_STREAM_BAD_CHUNK:{status:502,title:"Malformed HTTP stream chunk"},HTTP_STREAM_INTERRUPTED:{status:502,title:"HTTP stream interrupted"},HTTP_STREAM_MISSING_PARAM:{status:400,title:"HTTP stream missing path parameter"},HTTP_STREAM_NO_BODY:{status:502,title:"HTTP stream response has no body"},HTTP_STREAM_STATUS:{status:502,title:"HTTP stream request failed"},HTTP_STREAM_TRANSPORT:{status:502,title:"HTTP stream transport error"},STREAM_BACKPRESSURE:{status:429,title:"Stream backpressure"},STREAM_DISCONNECTED:{status:503,title:"Stream disconnected"},STREAM_QUEUE_OVERFLOW:{status:429,title:"Stream queue overflow"},UNKNOWN_MUTATION_FN:{status:404,title:"Unknown mutation function"}},m=a(t=>Object.hasOwn(l,t)?l[t]:void 0,"h");var E=[{body:["A single row exceeded the storage engine's per-row ceiling \u2014 2 MB on a Durable Object's SQLite, and 2,000,000 bytes on D1.","","The limit is on the STORED bytes, which are UTF-8: a document of multi-byte text (CJK, emoji) costs up to 3x its character count. `v.bytes()` and `v.bigint()` columns cost more again on a shard-local table, where the row stores both a SQL-comparable projection and the original.","","Keep the large payload out of the row and store a reference to it:","","```ts","const key = `uploads/${crypto.randomUUID()}`;","await ctx.storage.uploads.put(key, bytes);",'await ctx.db.insert("documents", { storageKey: key, title });',"```","","R2 has no practical object-size ceiling, and the row stays small enough to read, index, and replicate."].join(`
2
+ `),header:"Row too large for the storage engine",id:"lunora-row-too-big",test:a(t=>_.test(t),"test")},{body:["Lunora codegen couldn't find a schema to generate from.","","Create `lunora/schema.ts` exporting a `defineSchema(...)` call:","","```ts",'import { defineSchema, defineTable, v } from "@lunora/server";',"","export default defineSchema({"," messages: defineTable({ body: v.string() }),","});","```","","Or run `lunora init` to scaffold Lunora (a sample `lunora/schema.ts` included) into your app."].join(`
3
+ `),header:"No Lunora schema found",id:"lunora-schema-missing",test:a(t=>t.includes("defineSchema() not found")||t.includes("schema.ts not found at"),"test")},{body:["`defineSchema(...)` must be called with an **inline object literal** mapping table names to `defineTable(...)`:","","```ts","export default defineSchema({"," todos: defineTable({ title: v.string(), done: v.boolean() }),","});","```","","Codegen reads the schema statically, so it can't follow a variable or a spread \u2014 pass the object literal directly."].join(`
4
+ `),header:"`defineSchema()` needs an inline object literal",id:"lunora-schema-not-object-literal",test:a(t=>t.includes("defineSchema() expects an object literal"),"test")},{body:["This table name collides with a built-in `ctx.db` member, so the generated client can't expose it.","","Rename the table to anything that isn't a reserved name (the error lists them) \u2014 e.g. `userAccounts` instead of `insert`."].join(`
5
+ `),header:"Table name is reserved",id:"lunora-table-reserved",test:a(t=>t.includes("is reserved")&&t.includes("ctx.db"),"test")},{body:["Two tables resolve to the same name \u2014 usually a base table and a schema **extension** both defining it.","","Rename one of them, or drop the duplicate from the extension. Each table name must be unique across `defineSchema(...)` and every `.extend(...)`."].join(`
6
+ `),header:"Duplicate table name",id:"lunora-table-duplicate",test:a(t=>t.includes("already exists")&&t.includes(".extend("),"test")},{body:['`.jurisdiction(...)` accepts only a **string literal** of `"eu"`, `"us"`, or `"fedramp"`:',"","```ts",'defineSchema({ /* \u2026 */ }).jurisdiction("eu");',"```"].join(`
7
+ `),header:"Invalid `.jurisdiction(...)` value",id:"lunora-jurisdiction",test:a(t=>t.includes("unknown jurisdiction")||t.includes("jurisdiction")&&t.includes('"eu", "us", or "fedramp"'),"test")},{body:["The `unique` flag on an index must be a **literal** `true` or `false`, not a computed value \u2014 codegen needs to read it statically:","","```ts",'defineTable({ email: v.string() }).index("by_email", ["email"], { unique: true });',"```"].join(`
8
+ `),header:"`unique` must be a literal",id:"lunora-unique-literal",test:a(t=>t.includes("must be a literal")&&t.includes("unique"),"test")},{body:["A declared container/workflow class isn't re-exported by your worker entry, so `wrangler deploy` would reject it.","","Add the generated re-export shown in the error to your worker entry (e.g. `src/index.ts`):","","```ts",'export * from "./lunora/_generated/containers";',"```"].join(`
9
+ `),header:"Binding not exported by your worker entry",id:"lunora-worker-entry-export-gap",test:a(t=>t.includes("not exported by your worker entry"),"test")},{body:["A row with the same value already exists in a `unique` index.","","- If you meant to upsert, use `ctx.db.<table>().upsert(...)` (or `.patch(...)` an existing row) instead of `.insert(...)`.",`- Otherwise pick a value that isn't already taken, and consider surfacing a friendly "already exists" message to the user.`].join(`
10
+ `),header:"Unique constraint violation",id:"lunora-runtime-unique",test:a(t=>t.includes("unique constraint violation on"),"test")},{body:l.CONFLICT.hint.join(`
11
+ `),header:"Optimistic concurrency conflict",id:"lunora-runtime-occ",test:a(t=>t.includes("optimistic concurrency conflict"),"test")}],d=[{causes:"the origin returned an empty, unknown, or malformed response Cloudflare couldn't interpret (often an origin crash or an oversized response header)",code:"520",docsUrl:r,family:"5xx",fix:"check your origin's logs for a crash, ensure it returns a valid HTTP response, and keep response headers under the size limit",summary:"Cloudflare got an unknown/empty response from your origin web server.",title:"Web server returns an unknown error"},{causes:"the origin refused the connection \u2014 the web server is down, or a firewall is blocking Cloudflare's IP ranges",code:"521",docsUrl:r,family:"5xx",fix:"confirm the origin process is running and allowlist Cloudflare's published IP ranges in your firewall/security groups",summary:"Cloudflare could not connect to your origin because it refused the connection.",title:"Web server is down"},{causes:"Cloudflare could not establish a TCP connection to the origin in time \u2014 the origin is overloaded, a firewall is dropping packets, or the origin IP is wrong",code:"522",docsUrl:r,family:"5xx",fix:"verify the origin is reachable and not overloaded, and that the DNS record points at the correct origin IP",summary:"The connection to your origin timed out before it was established.",title:"Connection timed out"},{causes:"Cloudflare cannot route to the origin at all \u2014 a bad DNS record, an origin IP that changed, or invalid routing",code:"523",docsUrl:r,family:"5xx",fix:"verify the DNS A/AAAA record points at a reachable origin IP and that no upstream network is blocking Cloudflare",summary:"Cloudflare could not reach your origin server.",title:"Origin is unreachable"},{causes:"Cloudflare made a TCP connection but the origin did not return an HTTP response within 100 seconds \u2014 a slow handler or long-running request",code:"524",docsUrl:r,family:"5xx",fix:"speed up the slow origin handler, or move long work off the request path into a background job (a Durable Object, Queue, or Workflow)",summary:"Cloudflare connected to your origin but it did not respond in time.",title:"A timeout occurred"},{causes:"the TLS handshake between Cloudflare and the origin failed \u2014 a missing/invalid origin certificate, or a cipher/SNI mismatch under Full (Strict) SSL",code:"525",docsUrl:r,family:"5xx",fix:"install a valid certificate on the origin and align your Cloudflare SSL/TLS mode with the origin's certificate setup",summary:"The SSL handshake with your origin failed.",title:"SSL handshake failed"},{causes:"Cloudflare could not validate the origin's certificate under Full (Strict) SSL \u2014 it is expired, self-signed, or issued for the wrong hostname",code:"526",docsUrl:r,family:"5xx",fix:"install a valid, publicly-trusted certificate on the origin (or use a Cloudflare Origin CA cert), matching the request hostname",summary:"Cloudflare could not validate your origin's SSL certificate.",title:"Invalid SSL certificate"},{causes:"a DNS record points at a Cloudflare IP or another prohibited address instead of your real origin",code:"1000",docsUrl:n,family:"1xxx",fix:"point the DNS record at your real origin IP, not a Cloudflare-owned or loopback address",summary:"DNS points to a prohibited IP.",title:"DNS points to prohibited IP"},{causes:"Cloudflare could not resolve the requested hostname \u2014 a Worker fetched an unresolvable host, or a DNS record is misconfigured",code:"1001",docsUrl:n,family:"1xxx",fix:"check the hostname you're requesting and the DNS records for the zone resolve to a valid origin",summary:"Cloudflare could not resolve the origin DNS.",title:"DNS resolution error"},{causes:"a Worker or DNS record targets a restricted IP (for example a Cloudflare-owned or loopback address)",code:"1002",docsUrl:n,family:"1xxx",fix:"change the Worker fetch target or DNS record to a valid, non-restricted origin address",summary:"DNS points to a prohibited IP (Worker/restricted).",title:"DNS points to a prohibited IP"},{causes:"the visitor's IP was blocked by an IP Access Rule, WAF rule, or security configuration on the zone",code:"1006",docsUrl:n,family:"1xxx",fix:"review the zone's Firewall/WAF and IP Access Rules to see why the address was banned, and adjust if it was blocked in error",summary:"Access denied: the visitor's IP has been banned.",title:"Access denied: your IP has been banned"},{causes:"your Worker threw an unhandled JavaScript exception during the request",code:"1101",docsUrl:n,family:"1xxx",fix:"reproduce with `wrangler tail` (or the Workers Logs / Studio Logs panel) to get the stack trace, then handle the throwing code path",summary:"A Worker threw a JavaScript exception.",title:"Worker threw a JavaScript exception"},{causes:"the Worker used more CPU time than a single invocation is allowed \u2014 usually a hot loop or heavy synchronous work",code:"1102",docsUrl:n,family:"1xxx",fix:"reduce per-request CPU (optimize hot loops, avoid heavy synchronous work) or offload the heavy work to a Durable Object, Queue, or Workflow",summary:"A Worker exceeded its CPU-time resource limit.",title:"Worker exceeded resource limits"}],u=a(t=>t!==void 0&&t>="0"&&t<="9","l"),T=a((t,e)=>{for(let o=t.indexOf(e);o!==-1;o=t.indexOf(e,o+e.length))if(!u(t[o-1])&&!u(t[o+e.length]))return!0;return!1},"E"),A=a((t,e)=>{for(let o of[`error ${e}`,`error: ${e}`])for(let i=t.indexOf(o);i!==-1;i=t.indexOf(o,i+o.length))if(!u(t[i+o.length]))return!0;return!1},"f"),g=/error|cloudflare/iu,h=a(t=>({body:[t.summary,"",`**Likely cause:** ${t.causes}.`,"",`**Fix:** ${t.fix}.`,"",`See [Cloudflare's ${t.family} error docs](${t.docsUrl}).`].join(`
12
+ `),header:`Cloudflare Error ${t.code}: ${t.title}`,id:`cloudflare-error-${t.code}`}),"c"),f=a(t=>{if(!g.test(t))return;let e=t.toLowerCase(),o=e.includes("error"),i=e.includes("cloudflare");if(o){for(let s of d)if(A(e,s.code))return h(s)}if(i){for(let s of d)if(T(e,s.code))return h(s)}},"T"),O=a(t=>(typeof t=="string"?t:t.join(`
13
+ `)).split(`
14
+ `).filter(e=>!e.startsWith("```")).join(`
15
+ `).replaceAll(/\*\*(.+?)\*\*/gu,"$1").replaceAll(/`([^`]+)`/gu,"$1"),"O"),p=a(t=>{for(let e of E)if(e.test(t))return{body:e.body,header:e.header,id:e.id}},"d"),N=a(t=>p(t)??f(t),"N");var c=class extends Error{static{a(this,"l")}type="VisulimaError";hint;title;loc;code;status;docsUrl;data;constructor(e,o,i={}){let s=m(e);super(o??e,i.cause===void 0?void 0:{cause:i.cause}),this.name=i.name??"LunoraError",this.hint=i.hint??s?.hint,this.title=i.title??s?.title,this.loc=i.location,this.code=e,this.status=i.status??s?.status??500,this.docsUrl=i.docsUrl??s?.docsUrl,this.data=i.data}};export{l as a,O as b,N as c,c as d};
@@ -0,0 +1,2 @@
1
+ import{a as fe}from"./chunk-2URQKGWU.js";import"./chunk-4JLGLPWV.js";import{a as ie}from"./chunk-MU3P2FI7.js";import{a as pe}from"./chunk-66UGPQVC.js";import"./chunk-3Q2P62UR.js";import{W as de}from"./chunk-PLHA3OWK.js";import"./chunk-4L4WTGN5.js";import{a as x}from"./chunk-55754F6H.js";import"./chunk-IS6LVJ6L.js";import"./chunk-AAVLPU5Q.js";import{b as ne}from"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import{a as he}from"./chunk-F7UZBTKS.js";import"./chunk-ULIQFBZU.js";import"./chunk-Y3G2ZPOD.js";import"./chunk-35DM4JJG.js";import{a as H}from"./chunk-4ZEL6BYL.js";import{c as ue}from"./chunk-D6UKRXIS.js";import{f as le}from"./chunk-VWWJIICI.js";import"./chunk-FSRSK4LY.js";import"./chunk-KSYIH3NO.js";import{a as ce}from"./chunk-FKVZRPV5.js";import{d as oe,f as Z,g as ee,h as te,o as ae,q as me,r as re}from"./chunk-FODLDLE2.js";import{a as i,d as Y,e as ge,f as ve,g as Ne,i as se}from"./chunk-YKXDMIHQ.js";var t=Y(Ne(),1);var xe=Y(ve(),1);var N=Y(ge(),1);function ye({className:a,orientation:e="horizontal",...s}){return(0,t.jsx)(ie,{"data-slot":"separator",orientation:e,className:se("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",a),...s})}i(ye,"ge");var we=/https?:\/\/[^\s"'<>)]+/i,be=i(a=>a===void 0?void 0:we.exec(a)?.[0],"re"),y=i(a=>a===void 0?"":Array.isArray(a)?a.join(", "):a,"N"),Ce=i(a=>{if(a!==void 0)return be(a.html)??be(a.text)},"Ne"),ke=i((a,e)=>{let s=e.trim().toLowerCase();return s===""?a:a.filter(o=>`${o.subject} ${y(o.to)} ${y(o.cc)}`.toLowerCase().includes(s))},"we"),Se=i((a,e)=>{if(a.length!==0)return a.find(s=>s.id===e)??a[0]},"ye"),Te=Z(H.clearCapturedMail),Le=Z(H.sendTestMail),je=i(a=>{let e=(0,xe.c)(38),{limit:s}=a,o=le(),p;e[0]!==s?(p={limit:s},e[0]=s,e[1]=p):p=e[1];let{data:q,error:w,errorSource:C,isLoading:g,refetch:n}=ue(H.getCapturedMail,p),[k,f]=(0,N.useState)(null),[D,S]=(0,N.useState)(null),[v,l]=(0,N.useState)("html"),[c,P]=(0,N.useState)(""),b=q?.entries??[],r=w??k,u=w===null?k:C,T;e[2]!==o||e[3]!==n?(T=i(async()=>{f(null);try{await o.query(Te,{},ee("")),S(null),n()}catch(m){f(te(m))}},"T"),e[2]=o,e[3]=n,e[4]=T):T=e[4];let R=T,L;e[5]!==o||e[6]!==n?(L=i(async()=>{f(null);try{await o.query(Le,{},ee("")),n()}catch(m){f(te(m))}},"k"),e[5]=o,e[6]=n,e[7]=L):L=e[7];let W=L,j;e[8]!==n?(j=i(()=>{n()},"L"),e[8]=n,e[9]=j):j=e[9],pe(j,!0);let M;e[10]!==R?(M=i(()=>{ae(R())},"A"),e[10]=R,e[11]=M):M=e[11];let U=M,_;e[12]!==W?(_=i(()=>{ae(W())},"E"),e[12]=W,e[13]=_):_=e[13];let G=_,z;e[14]===Symbol.for("react.memo_cache_sentinel")?(z=i(m=>{P(m.currentTarget.value)},"_"),e[14]=z):z=e[14];let J=z,$;e[15]===Symbol.for("react.memo_cache_sentinel")?($=i(m=>{let{id:h}=m.currentTarget.dataset;h!==void 0&&S(h)},"M"),e[15]=$):$=e[15];let K=$,A;e[16]===Symbol.for("react.memo_cache_sentinel")?(A=i(m=>{let h=m.currentTarget.dataset.tab;(h==="headers"||h==="html"||h==="text")&&l(h)},"j"),e[16]=A):A=e[16];let Q=A,F=ke(b,c),O=Se(F,D),d=Ce(O),I;e[17]!==d?(I=i(()=>{d!==void 0&&me(d)},"z"),e[17]=d,e[18]=I):I=e[18];let V=I,B;e[19]!==d?(B=i(()=>{d!==void 0&&"window"in globalThis&&globalThis.window.open(d,"_blank","noopener")},"F"),e[19]=d,e[20]=B):B=e[20];let X=B,E;return e[21]!==b||e[22]!==r||e[23]!==u||e[24]!==c||e[25]!==g||e[26]!==d||e[27]!==U||e[28]!==V||e[29]!==J||e[30]!==X||e[31]!==K||e[32]!==Q||e[33]!==G||e[34]!==O||e[35]!==v||e[36]!==F?(E={entries:b,error:r,errorSource:u,filter:c,isLoading:g,link:d,onClear:U,onCopyLink:V,onFilterChange:J,onOpenLink:X,onSelectMessage:K,onSelectTab:Q,onSendTest:G,selected:O,tab:v,visible:F},e[21]=b,e[22]=r,e[23]=u,e[24]=c,e[25]=g,e[26]=d,e[27]=U,e[28]=V,e[29]=J,e[30]=X,e[31]=K,e[32]=Q,e[33]=G,e[34]=O,e[35]=v,e[36]=F,e[37]=E):E=e[37],E},"Te"),Me=`<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src data:; style-src 'unsafe-inline'; font-src data:">`,_e=i(a=>`${Me}${a}`,"Le"),Je=i(({limit:a=100})=>{let e=oe(),{entries:s,error:o,errorSource:p,filter:q,isLoading:w,link:C,onClear:g,onCopyLink:n,onFilterChange:k,onOpenLink:f,onSelectMessage:D,onSelectTab:S,onSendTest:v,selected:l,tab:c,visible:P}=je({limit:a}),b=i(r=>e(r==="html"?"HTML":r==="text"?"Plain text":"Headers"),"b");return(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"mail-panel",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(x,{"data-testid":"mail-send-test",onClick:v,size:"sm",type:"button",variant:"outline",children:e("Send test")}),(0,t.jsx)(x,{"data-testid":"mail-clear",disabled:s.length===0,onClick:g,size:"sm",type:"button",variant:"outline",children:e("Clear inbox")}),s.length>0&&(0,t.jsx)(ne,{className:"ml-auto","data-testid":"mail-count",variant:"secondary",children:e("{count} messages",{count:s.length})})]}),o!==null&&(0,t.jsx)(he,{error:p,testId:"mail-error"}),o===null&&!w&&s.length===0&&(0,t.jsx)(ce,{description:e("Email your app sends in dev is captured here \u2014 nothing is delivered."),icon:(0,t.jsxs)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,t.jsx)("path",{d:"M4 5h16v14H4z"}),(0,t.jsx)("path",{d:"m4 6 8 6 8-6"})]}),testId:"mail-empty",title:e("No captured email.")}),s.length>0&&(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-[minmax(0,22rem)_1fr]","data-testid":"mail-reader",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)(de,{"aria-label":e("Search messages"),"data-testid":"mail-search",onChange:k,placeholder:e("Filter messages"),type:"search",value:q}),(0,t.jsx)(fe,{className:"max-h-[32rem] rounded-xl border border-border bg-card shadow-xs","data-testid":"mail-list",children:(0,t.jsx)("ul",{className:"divide-y",children:P.map(r=>{let u=r.id===l?.id;return(0,t.jsx)("li",{children:(0,t.jsxs)("button",{className:`flex w-full flex-col items-start gap-0.5 px-3 py-2 text-left text-sm hover:bg-muted/60 ${u?"bg-muted":""}`,"data-active":u,"data-id":r.id,"data-testid":"mail-list-item",onClick:D,type:"button",children:[(0,t.jsx)("span",{className:"w-full truncate font-medium",children:r.subject||e("(no subject)")}),(0,t.jsx)("span",{className:"w-full truncate text-xs text-muted-foreground",children:y(r.to)}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground tabular-nums",children:re(r.capturedAt,"\u2014")})]})},r.id)})})})]}),l!==void 0&&(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-3 rounded-xl border border-border bg-card p-4 shadow-xs","data-testid":"mail-detail",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("h2",{className:"truncate text-base font-semibold","data-testid":"mail-subject",children:l.subject||e("(no subject)")}),(0,t.jsxs)("dl",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5 text-xs text-muted-foreground",children:[(0,t.jsx)("dt",{children:e("From")}),(0,t.jsx)("dd",{className:"truncate font-mono",children:l.from??"\u2014"}),(0,t.jsx)("dt",{children:e("To")}),(0,t.jsx)("dd",{className:"truncate font-mono",children:y(l.to)}),l.cc!==void 0&&l.cc.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("dt",{children:e("Cc")}),(0,t.jsx)("dd",{className:"truncate font-mono",children:y(l.cc)})]}),(0,t.jsx)("dt",{children:e("Sent")}),(0,t.jsx)("dd",{className:"tabular-nums",children:re(l.capturedAt,"\u2014")})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2","data-testid":"mail-actions",children:[(0,t.jsx)(x,{"data-testid":"mail-copy-link",disabled:C===void 0,onClick:n,size:"sm",type:"button",variant:"outline",children:e("Copy link")}),(0,t.jsx)(x,{"data-testid":"mail-open-link",disabled:C===void 0,onClick:f,size:"sm",type:"button",variant:"outline",children:e("Open in new tab")})]}),(0,t.jsx)(ye,{}),(0,t.jsx)("div",{className:"flex items-center gap-1","data-testid":"mail-tabs",role:"tablist",children:["html","text","headers"].map(r=>(0,t.jsx)(x,{"aria-selected":c===r,"data-tab":r,"data-testid":`mail-tab-${r}`,onClick:S,role:"tab",size:"sm",type:"button",variant:c===r?"secondary":"ghost",children:b(r)},r))}),(0,t.jsxs)("div",{className:"min-h-[12rem]",children:[c==="html"&&(l.html===void 0?(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("No HTML body.")}):(0,t.jsx)("iframe",{className:"h-[24rem] w-full rounded-md border bg-white","data-testid":"mail-preview-html",sandbox:"",srcDoc:_e(l.html),title:e("Email preview")})),c==="text"&&(l.text===void 0?(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("No text body.")}):(0,t.jsx)("pre",{className:"overflow-auto whitespace-pre-wrap rounded-md border bg-muted/30 p-3 text-xs","data-testid":"mail-preview-text",children:l.text})),c==="headers"&&(l.headers===void 0||Object.keys(l.headers).length===0?(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("No headers.")}):(0,t.jsx)("pre",{className:"overflow-auto whitespace-pre-wrap rounded-md border bg-muted/30 p-3 text-xs","data-testid":"mail-preview-headers",children:Object.entries(l.headers).map(([r,u])=>`${r}: ${u}`).join(`
2
+ `)}))]})]})]})]})},"We");export{Je as MailPanel};
@@ -0,0 +1 @@
1
+ import{a as q}from"./chunk-CO7D5QQA.js";import{a as k}from"./chunk-GGPSI4ZR.js";import"./chunk-4GTO7FL5.js";import"./chunk-O7D7DJVB.js";import"./chunk-5JDWLCSH.js";import"./chunk-EVTM6Q43.js";import{a as A}from"./chunk-S3CRZLGS.js";import{a as $}from"./chunk-2DX5MROH.js";import"./chunk-OGUKYRFM.js";import"./chunk-6D6Z2KXU.js";import"./chunk-OKG3HWSJ.js";import"./chunk-PLHA3OWK.js";import"./chunk-Y6CXU7T4.js";import"./chunk-4L4WTGN5.js";import"./chunk-AAVLPU5Q.js";import{b as K}from"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import{a as F}from"./chunk-F7UZBTKS.js";import"./chunk-ULIQFBZU.js";import"./chunk-Y3G2ZPOD.js";import"./chunk-35DM4JJG.js";import{a as T}from"./chunk-4ZEL6BYL.js";import{c as S}from"./chunk-D6UKRXIS.js";import"./chunk-VWWJIICI.js";import"./chunk-FSRSK4LY.js";import"./chunk-KSYIH3NO.js";import{a as O}from"./chunk-FKVZRPV5.js";import{a as j,e as w}from"./chunk-WUWBZPUK.js";import{d as I,r as E}from"./chunk-FODLDLE2.js";import{a as p,d as C,f as D,g as H}from"./chunk-YKXDMIHQ.js";var M=C(D(),1);var m=C(H(),1);var L=p(s=>s.length===0?void 0:{max:Math.max(...s),mean:s.reduce((e,t)=>e+t,0)/s.length,min:Math.min(...s)},"F"),B=/^gen_ai\.evaluation\.(.+)\.score$/u,P=p(s=>{let e=[];for(let t of s)for(let n of t.spans)for(let[a,l]of Object.entries(n.attributes??{})){let o=B.exec(a);if(!o||typeof l!="number")continue;let i=o[1],c=n.attributes?.[`gen_ai.evaluation.${i}.label`];e.push({...typeof c=="string"?{label:c}:{},name:i,score:l,spanName:n.name,startTs:t.startTs+n.offsetMs,traceId:t.traceId})}return e.toSorted((t,n)=>n.startTs-t.startTs)},"q"),Q=p(s=>{let e=[];for(let t of s?.series??[]){let n=B.exec(t.name);n&&e.push({name:n[1],points:t.points})}return e},"D"),R=p((s,e)=>{let t=new Set([...s.map(a=>a.name),...e.map(a=>a.name)]),n=[];for(let a of t){let l=s.filter(r=>r.name===a),o=e.find(r=>r.name===a)?.points??[],i=o.at(-1)?.last??l[0]?.score,c=o.length>0?{max:Math.max(...o.map(r=>r.max)),mean:o.reduce((r,d)=>r+d.sum,0)/o.reduce((r,d)=>r+d.count,0),min:Math.min(...o.map(r=>r.min))}:L(l.map(r=>r.score));n.push({...i===void 0?{}:{latest:i},...c,name:a,points:o,runs:l})}return n.toSorted((a,l)=>a.name.localeCompare(l.name))},"H"),U=p(s=>Array.isArray(s?.traces)?s.traces:[],"L"),N=p(s=>s===void 0?"\u2014":s.toFixed(2),"y"),z=p(s=>{let e=(0,M.c)(34),{card:t,onOpenTrace:n}=s,a=I(),l;e[0]!==t.name?(l=(0,m.jsx)("h3",{className:"font-mono text-sm font-semibold text-foreground","data-testid":"ev-name",children:t.name}),e[0]=t.name,e[1]=l):l=e[1];let o;e[2]!==t.latest?(o=N(t.latest),e[2]=t.latest,e[3]=o):o=e[3];let i;e[4]!==o?(i=(0,m.jsx)("span",{className:"font-mono text-lg text-foreground","data-testid":"ev-latest",children:o}),e[4]=o,e[5]=i):i=e[5];let c;e[6]!==l||e[7]!==i?(c=(0,m.jsxs)("div",{className:"flex items-baseline justify-between gap-3",children:[l,i]}),e[6]=l,e[7]=i,e[8]=c):c=e[8];let r;e[9]!==t.max||e[10]!==t.mean||e[11]!==t.min||e[12]!==a?(r=a("min {min} \xB7 mean {mean} \xB7 max {max}",{max:N(t.max),mean:N(t.mean),min:N(t.min)}),e[9]=t.max,e[10]=t.mean,e[11]=t.min,e[12]=a,e[13]=r):r=e[13];let d;e[14]!==r?(d=(0,m.jsx)("p",{className:"font-mono text-xs text-muted-foreground","data-testid":"ev-summary",children:r}),e[14]=r,e[15]=d):d=e[15];let u;e[16]!==t.name||e[17]!==t.points||e[18]!==a?(u=t.points.length>1?(0,m.jsx)(q,{ariaLabel:a("Score trend for {name}",{name:t.name}),className:"h-10 w-full",series:t.points.map(G),testId:"ev-trend"}):(0,m.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"ev-no-trend",children:a("No durable history yet \u2014 pass ctx.metrics to recordEvaluation to chart a trend.")}),e[16]=t.name,e[17]=t.points,e[18]=a,e[19]=u):u=e[19];let h;if(e[20]!==t.runs||e[21]!==n||e[22]!==a){let v;e[24]!==n||e[25]!==a?(v=p(f=>(0,m.jsxs)("div",{className:"flex items-center justify-between gap-2 font-mono text-xs","data-testid":"ev-run",children:[(0,m.jsxs)("span",{className:"truncate text-muted-foreground",children:[E(f.startTs)," \xB7 ",f.spanName]}),(0,m.jsxs)("span",{className:"flex items-center gap-2",children:[f.label===void 0?null:(0,m.jsx)(K,{variant:"outline",children:f.label}),(0,m.jsx)("span",{className:"text-foreground",children:N(f.score)}),n===void 0?null:(0,m.jsx)("button",{className:"text-muted-foreground underline-offset-2 hover:underline",onClick:p(()=>{n(f.traceId)},"onClick"),title:a("Open the trace {trace}",{trace:f.traceId}),type:"button",children:f.traceId.slice(0,8)})]})]},`${f.traceId}:${f.spanName}`),"x"),e[24]=n,e[25]=a,e[26]=v):v=e[26],h=t.runs.slice(0,5).map(v),e[20]=t.runs,e[21]=n,e[22]=a,e[23]=h}else h=e[23];let x;e[27]!==h?(x=(0,m.jsx)("div",{className:"flex flex-col gap-1",children:h}),e[27]=h,e[28]=x):x=e[28];let g;return e[29]!==c||e[30]!==d||e[31]!==u||e[32]!==x?(g=(0,m.jsx)(j,{"data-testid":"ev-card",children:(0,m.jsxs)(w,{className:"flex flex-col gap-3 p-4",children:[c,d,u,x]})}),e[29]=c,e[30]=d,e[31]=u,e[32]=x,e[33]=g):g=e[33],g},"P"),oe=p(s=>{let e=(0,M.c)(19),{initialShardKey:t}=s,n=I(),{queryShardKey:a,setShardKey:l,shardKey:o}=A(t),i=k(a),c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={},e[0]=c):c=e[0];let r;e[1]!==a?(r={live:!0,shardKey:a},e[1]=a,e[2]=r):r=e[2];let{data:d,error:u}=S(T.getTraces,c,r),h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h={},e[3]=h):h=e[3];let x;e[4]!==a?(x={live:!0,shardKey:a},e[4]=a,e[5]=x):x=e[5];let{data:g}=S(T.getMetricHistory,h,x),v;if(e[6]!==d||e[7]!==u||e[8]!==g||e[9]!==i||e[10]!==l||e[11]!==o||e[12]!==n){let f=R(P(U(d)),Q(g)),y;e[14]!==l||e[15]!==o?(y=(0,m.jsx)($,{onChange:l,testId:"ev-shard-input",value:o}),e[14]=l,e[15]=o,e[16]=y):y=e[16];let b;e[17]!==u?(b=u===null?null:(0,m.jsx)(F,{error:u,testId:"ev-error"}),e[17]=u,e[18]=b):b=e[18],v=(0,m.jsxs)("section",{className:"flex flex-col gap-4","data-testid":"ev-panel",children:[y,b,f.length===0?(0,m.jsx)(O,{description:n("Call recordEvaluation from a graded run and its score shows up here."),testId:"ev-empty",title:n("No evals recorded")}):(0,m.jsx)("div",{className:"grid gap-3 md:grid-cols-2",children:f.map(_=>(0,m.jsx)(z,{card:_,onOpenTrace:i},_.name))})]}),e[6]=d,e[7]=u,e[8]=g,e[9]=i,e[10]=l,e[11]=o,e[12]=n,e[13]=v}else v=e[13];return v},"re");function G(s){return s.last}p(G,"Q");export{oe as default};
@@ -0,0 +1 @@
1
+ import{a as x}from"./chunk-RPQL45FL.js";import{b as h}from"./chunk-FEWMAPNI.js";import{r as v}from"./chunk-FODLDLE2.js";import{a as g,d as p,f as k,g as y}from"./chunk-YKXDMIHQ.js";var N=p(k(),1);var l=p(y(),1);var b={debug:"secondary",error:"destructive",fatal:"destructive",info:"outline",log:"outline",trace:"outline",warn:"secondary"},F=g(w=>{let e=(0,N.c)(21),{entry:t}=w,c;e[0]!==t.fields?(c=x(t.fields),e[0]=t.fields,e[1]=c):c=e[1];let m=c,s;e[2]!==t.timestamp?(s=v(t.timestamp),e[2]=t.timestamp,e[3]=s):s=e[3];let r;e[4]!==s?(r=(0,l.jsx)("span",{className:"w-44 shrink-0 tabular-nums text-muted-foreground",role:"gridcell",children:s}),e[4]=s,e[5]=r):r=e[5];let u=b[t.level],a;e[6]!==t.level||e[7]!==u?(a=(0,l.jsx)("span",{className:"w-20 shrink-0",role:"gridcell",children:(0,l.jsx)(h,{variant:u,children:t.level})}),e[6]=t.level,e[7]=u,e[8]=a):a=e[8];let f=t.functionPath??"\u2014",n;e[9]!==f?(n=(0,l.jsx)("span",{className:"w-48 shrink-0 truncate text-muted-foreground",role:"gridcell",children:f}),e[9]=f,e[10]=n):n=e[10];let i;e[11]!==m?(i=m===""?null:(0,l.jsx)("span",{className:"ml-2 text-muted-foreground","data-testid":"lg-fields",children:m}),e[11]=m,e[12]=i):i=e[12];let o;e[13]!==t.message||e[14]!==i?(o=(0,l.jsxs)("span",{className:"flex-1 truncate",role:"gridcell",children:[t.message,i]}),e[13]=t.message,e[14]=i,e[15]=o):o=e[15];let d;return e[16]!==r||e[17]!==a||e[18]!==n||e[19]!==o?(d=(0,l.jsxs)(l.Fragment,{children:[r,a,n,o]}),e[16]=r,e[17]=a,e[18]=n,e[19]=o,e[20]=d):d=e[20],d},"B");export{b as a,F as b};
@@ -0,0 +1 @@
1
+ import{a as Be,b as Ue,c as We,d as De,e as we}from"./chunk-IHMGCHAA.js";import"./chunk-4JLGLPWV.js";import"./chunk-V3CZW3JB.js";import{a as Ve}from"./chunk-TIUMFAN2.js";import{a as qe}from"./chunk-BOTGXX4H.js";import"./chunk-GMS77BZD.js";import"./chunk-3Q2P62UR.js";import"./chunk-AWHXPIXU.js";import"./chunk-V3VJAA4D.js";import{a as Le}from"./chunk-S3CRZLGS.js";import{a as _e}from"./chunk-2DX5MROH.js";import"./chunk-OGUKYRFM.js";import"./chunk-OKG3HWSJ.js";import{W as ke}from"./chunk-PLHA3OWK.js";import"./chunk-Y6CXU7T4.js";import"./chunk-4L4WTGN5.js";import{a as ie}from"./chunk-55754F6H.js";import"./chunk-IS6LVJ6L.js";import"./chunk-AAVLPU5Q.js";import{b as me}from"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import"./chunk-35DM4JJG.js";import{a as U}from"./chunk-4ZEL6BYL.js";import{c as Ee}from"./chunk-D6UKRXIS.js";import{f as Ne}from"./chunk-VWWJIICI.js";import"./chunk-FSRSK4LY.js";import{b as Ie,c as $e}from"./chunk-KSYIH3NO.js";import{a as Ae}from"./chunk-FKVZRPV5.js";import{a as ze,b as Re,c as je,d as pe,e as B,f as z}from"./chunk-HEAQVSNS.js";import{a as Me,e as Ce}from"./chunk-WUWBZPUK.js";import{d as ue,f as re,g as be,h as Ke,o as le,r as Te}from"./chunk-FODLDLE2.js";import{a as d,d as ye,e as Oe,f as Ge,g as He}from"./chunk-YKXDMIHQ.js";var ge=ye(Ge(),1);var ne=ye(Oe(),1);var t=ye(He(),1);var Se="none",Je=["all","open","resolved","ignored"],Pe=["critical","high","medium","low"],Qe=re(U.resolveIssue),Xe=re(U.ignoreIssue),Fe=re(U.assignIssue),Ye=re(U.setIssueSeverity),Ze=re(U.explainIssue),es=d(n=>Array.isArray(n?.issues)?n.issues:[],"Xe"),ss=d(n=>n==="resolved"?"success":n==="ignored"?"secondary":"warning","Je"),ts=d(n=>n==="critical"?"destructive":n==="high"?"warning":n==="medium"?"info":"secondary","Ze"),as=d(n=>{let e=(0,ge.c)(44),{expanded:u,issue:s,shardKey:$}=n,i=Ne(),l=ue(),[a,o]=(0,ne.useState)(void 0),{busy:_,error:A,run:R}=Ve(),K;e[0]!==i||e[1]!==s||e[2]!==R||e[3]!==$?(K=d(()=>{o(void 0),R(async()=>{let g={culprit:s.culprit,sampleMessage:s.sampleMessage,title:s.title},I=await i.query(Ze,g,be($));o(I)})},"C"),e[0]=i,e[1]=s,e[2]=R,e[3]=$,e[4]=K):K=e[4];let L=K;if(!u)return null;let k;if(e[5]!==s.sampleMessage){let g=$e(s.sampleMessage);k=g===void 0?void 0:Ie(g.body),e[5]=s.sampleMessage,e[6]=k}else k=e[6];let T=k,E=`issues-detail-${s.hash}`,h;e[7]!==s.sampleMessage?(h=(0,t.jsx)("p",{className:"whitespace-pre-wrap font-mono text-xs text-muted-foreground",children:s.sampleMessage}),e[7]=s.sampleMessage,e[8]=h):h=e[8];let x;e[9]!==l?(x=l("Suggested fix"),e[9]=l,e[10]=x):x=e[10];let M;e[11]!==x?(M=(0,t.jsx)("div",{className:"text-xs font-medium text-muted-foreground",children:x}),e[11]=x,e[12]=M):M=e[12];let v;e[13]!==T||e[14]!==s.hash||e[15]!==l?(v=T===void 0?(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground","data-testid":`issues-hint-empty-${s.hash}`,children:l("No known fix for this error yet.")}):(0,t.jsx)("p",{className:"mt-1 whitespace-pre-wrap text-sm","data-testid":`issues-hint-${s.hash}`,children:T}),e[13]=T,e[14]=s.hash,e[15]=l,e[16]=v):v=e[16];let y;e[17]!==M||e[18]!==v?(y=(0,t.jsxs)("div",{children:[M,v]}),e[17]=M,e[18]=v,e[19]=y):y=e[19];let b=`issues-explain-${s.hash}`,w;e[20]!==_||e[21]!==l?(w=l(_?"Explaining\u2026":"Explain in plain language"),e[20]=_,e[21]=l,e[22]=w):w=e[22];let m;e[23]!==_||e[24]!==L||e[25]!==w||e[26]!==b?(m=(0,t.jsx)("div",{children:(0,t.jsx)(ie,{"data-testid":b,disabled:_,onClick:L,size:"sm",type:"button",variant:"outline",children:w})}),e[23]=_,e[24]=L,e[25]=w,e[26]=b,e[27]=m):m=e[27];let f;e[28]!==A||e[29]!==s.hash?(f=A!==null&&(0,t.jsx)("p",{className:"text-xs text-destructive","data-testid":`issues-explain-error-${s.hash}`,role:"alert",children:A}),e[28]=A,e[29]=s.hash,e[30]=f):f=e[30];let p;e[31]!==a||e[32]!==s.hash||e[33]!==l?(p=a!==void 0&&(a.degraded?(0,t.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":`issues-degraded-${s.hash}`,children:a.reason==="no-ai-binding"?l("No AI binding is configured. Wire an AI binding to enable plain-language explanations \u2014 the suggested fix above is always available."):l("The AI model could not explain this error right now. The suggested fix above still applies.")}):(0,t.jsxs)("div",{"data-testid":`issues-explanation-${s.hash}`,children:[(0,t.jsx)("div",{className:"text-xs font-medium text-muted-foreground",children:l("AI explanation")}),(0,t.jsx)("p",{className:"mt-1 whitespace-pre-wrap text-sm",children:a.explanation}),a.groundedId===void 0&&(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground","data-testid":`issues-ungrounded-${s.hash}`,children:l("No catalog fix matched this error, so this explanation is the model's own reading of the message. Verify before acting on it.")}),(0,t.jsx)("p",{className:"mt-1 text-[0.7rem] text-muted-foreground",children:l("Generated by {model}",{model:a.model})})]})),e[31]=a,e[32]=s.hash,e[33]=l,e[34]=p):p=e[34];let c;e[35]!==m||e[36]!==f||e[37]!==p||e[38]!==h||e[39]!==y?(c=(0,t.jsx)(z,{className:"bg-muted/30",colSpan:7,children:(0,t.jsxs)("div",{className:"flex flex-col gap-3 py-1",children:[h,y,m,f,p]})}),e[35]=m,e[36]=f,e[37]=p,e[38]=h,e[39]=y,e[40]=c):c=e[40];let S;return e[41]!==c||e[42]!==E?(S=(0,t.jsx)(pe,{"data-testid":E,children:c}),e[41]=c,e[42]=E,e[43]=S):S=e[43],S},"et"),is=d(n=>{let e=(0,ge.c)(119),{busy:u,issue:s,rowError:$,runTriage:i,shardKey:l}=n,a=ue(),[o,_]=(0,ne.useState)(!1),A;e[0]===Symbol.for("react.memo_cache_sentinel")?(A=d(()=>{_(rs)},"A"),e[0]=A):A=e[0];let R=A,K;e[1]!==s.hash||e[2]!==i?(K=d(ae=>{let ce=ae===null||ae===Se?null:ae;le(i(s.hash,Ye,{severity:ce}))},"C"),e[1]=s.hash,e[2]=i,e[3]=K):K=e[3];let L=K,k;e[4]!==s.hash||e[5]!==i?(k=d(ae=>{if(ae.key!=="Enter")return;let ce=ae.currentTarget.value.trim();le(i(s.hash,Fe,{assignee:ce===""?null:ce}))},"T"),e[4]=s.hash,e[5]=i,e[6]=k):k=e[6];let T=k,E=`issues-row-${s.hash}`,h;e[7]!==a?(h=a("Toggle issue details"),e[7]=a,e[8]=h):h=e[8];let x=`issues-toggle-${s.hash}`,M=`mt-1 size-3 shrink-0 text-muted-foreground transition-transform ${o?"rotate-90":""}`,v;e[9]===Symbol.for("react.memo_cache_sentinel")?(v=(0,t.jsx)("path",{d:"m9 6 6 6-6 6"}),e[9]=v):v=e[9];let y;e[10]!==M?(y=(0,t.jsx)("svg",{"aria-hidden":"true",className:M,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",children:v}),e[10]=M,e[11]=y):y=e[11];let b;e[12]!==s.title?(b=(0,t.jsx)("span",{className:"block truncate font-medium",title:s.title,children:s.title}),e[12]=s.title,e[13]=b):b=e[13];let w;e[14]!==s.culprit?(w=(0,t.jsx)("span",{className:"block truncate font-mono text-xs text-muted-foreground",title:s.culprit,children:s.culprit}),e[14]=s.culprit,e[15]=w):w=e[15];let m;e[16]!==b||e[17]!==w?(m=(0,t.jsxs)("span",{className:"min-w-0",children:[b,w]}),e[16]=b,e[17]=w,e[18]=m):m=e[18];let f;e[19]!==o||e[20]!==m||e[21]!==h||e[22]!==x||e[23]!==y?(f=(0,t.jsxs)("button",{"aria-expanded":o,"aria-label":h,className:"flex w-full items-start gap-2 text-left","data-testid":x,onClick:R,type:"button",children:[y,m]}),e[19]=o,e[20]=m,e[21]=h,e[22]=x,e[23]=y,e[24]=f):f=e[24];let p;e[25]!==s.hash||e[26]!==$?(p=$!==void 0&&(0,t.jsx)("p",{className:"mt-1 text-xs text-destructive","data-testid":`issues-action-error-${s.hash}`,role:"alert",children:$}),e[25]=s.hash,e[26]=$,e[27]=p):p=e[27];let c;e[28]!==f||e[29]!==p?(c=(0,t.jsxs)(z,{className:"max-w-80",children:[f,p]}),e[28]=f,e[29]=p,e[30]=c):c=e[30];let S=`issues-status-${s.hash}`,g;e[31]!==s.status?(g=ss(s.status),e[31]=s.status,e[32]=g):g=e[32];let I;e[33]!==s.status||e[34]!==S||e[35]!==g?(I=(0,t.jsx)(z,{children:(0,t.jsx)(me,{"data-testid":S,variant:g,children:s.status})}),e[33]=s.status,e[34]=S,e[35]=g,e[36]=I):I=e[36];let j=s.severity??Se,r;e[37]!==a?(r=a("Set severity"),e[37]=a,e[38]=r):r=e[38];let oe=`issues-severity-${s.hash}`,V;e[39]!==a?(V=a("\u2014"),e[39]=a,e[40]=V):V=e[40];let N;e[41]!==s.severity||e[42]!==a?(N=s.severity===void 0?(0,t.jsx)("span",{className:"text-muted-foreground",children:a("\u2014")}):(0,t.jsx)(me,{variant:ts(s.severity),children:s.severity}),e[41]=s.severity,e[42]=a,e[43]=N):N=e[43];let C;e[44]!==V||e[45]!==N?(C=(0,t.jsx)(Ue,{placeholder:V,children:N}),e[44]=V,e[45]=N,e[46]=C):C=e[46];let q;e[47]!==r||e[48]!==oe||e[49]!==C?(q=(0,t.jsx)(We,{"aria-label":r,className:"h-7 w-[110px]","data-testid":oe,children:C}),e[47]=r,e[48]=oe,e[49]=C,e[50]=q):q=e[50];let de;e[51]===Symbol.for("react.memo_cache_sentinel")?(de=Pe.map(ls),e[51]=de):de=e[51];let W;e[52]!==a?(W=a("Clear"),e[52]=a,e[53]=W):W=e[53];let D;e[54]!==W?(D=(0,t.jsxs)(De,{children:[de,(0,t.jsx)(we,{value:Se,children:W})]}),e[54]=W,e[55]=D):D=e[55];let F;e[56]!==u||e[57]!==L||e[58]!==j||e[59]!==q||e[60]!==D?(F=(0,t.jsx)(z,{children:(0,t.jsxs)(Be,{disabled:u,onValueChange:L,value:j,children:[q,D]})}),e[56]=u,e[57]=L,e[58]=j,e[59]=q,e[60]=D,e[61]=F):F=e[61];let O;e[62]!==a?(O=a("Assignee"),e[62]=a,e[63]=O):O=e[63];let fe=`issues-assignee-${s.hash}`,xe=s.assignee??"",ve=s.assignee??"",G;e[64]!==a?(G=a("Unassigned"),e[64]=a,e[65]=G):G=e[65];let H;e[66]!==u||e[67]!==T||e[68]!==O||e[69]!==fe||e[70]!==xe||e[71]!==ve||e[72]!==G?(H=(0,t.jsx)(z,{children:(0,t.jsx)(ke,{"aria-label":O,className:"h-7 w-32","data-testid":fe,defaultValue:xe,disabled:u,onKeyDown:T,placeholder:G},ve)}),e[66]=u,e[67]=T,e[68]=O,e[69]=fe,e[70]=xe,e[71]=ve,e[72]=G,e[73]=H):H=e[73];let J;e[74]!==s.count?(J=(0,t.jsx)(z,{className:"text-right",children:(0,t.jsx)(me,{variant:"secondary",children:s.count})}),e[74]=s.count,e[75]=J):J=e[75];let P;e[76]!==s.lastSeen?(P=Te(s.lastSeen),e[76]=s.lastSeen,e[77]=P):P=e[77];let Q;e[78]!==P?(Q=(0,t.jsx)(z,{className:"text-xs tabular-nums text-muted-foreground",children:P}),e[78]=P,e[79]=Q):Q=e[79];let X;e[80]!==u||e[81]!==s.hash||e[82]!==s.status||e[83]!==i||e[84]!==a?(X=s.status!=="resolved"&&(0,t.jsx)(ie,{"data-testid":`issues-resolve-${s.hash}`,disabled:u,onClick:d(()=>{le(i(s.hash,Qe,{}))},"onClick"),size:"xs",variant:"outline",children:a("Resolve")}),e[80]=u,e[81]=s.hash,e[82]=s.status,e[83]=i,e[84]=a,e[85]=X):X=e[85];let Y;e[86]!==u||e[87]!==s.hash||e[88]!==s.status||e[89]!==i||e[90]!==a?(Y=s.status!=="ignored"&&(0,t.jsx)(ie,{"data-testid":`issues-ignore-${s.hash}`,disabled:u,onClick:d(()=>{le(i(s.hash,Xe,{}))},"onClick"),size:"xs",variant:"ghost",children:a("Ignore")}),e[86]=u,e[87]=s.hash,e[88]=s.status,e[89]=i,e[90]=a,e[91]=Y):Y=e[91];let Z;e[92]!==u||e[93]!==s.assignee||e[94]!==s.hash||e[95]!==s.status||e[96]!==i||e[97]!==a?(Z=s.status!=="open"&&(0,t.jsx)(ie,{"data-testid":`issues-reopen-${s.hash}`,disabled:u,onClick:d(()=>{le(i(s.hash,Fe,{assignee:s.assignee??null}))},"onClick"),size:"xs",variant:"ghost",children:a("Reopen")}),e[92]=u,e[93]=s.assignee,e[94]=s.hash,e[95]=s.status,e[96]=i,e[97]=a,e[98]=Z):Z=e[98];let ee;e[99]!==X||e[100]!==Y||e[101]!==Z?(ee=(0,t.jsx)(z,{className:"text-right",children:(0,t.jsxs)("div",{className:"flex justify-end gap-1",children:[X,Y,Z]})}),e[99]=X,e[100]=Y,e[101]=Z,e[102]=ee):ee=e[102];let se;e[103]!==c||e[104]!==I||e[105]!==F||e[106]!==H||e[107]!==J||e[108]!==Q||e[109]!==E||e[110]!==ee?(se=(0,t.jsxs)(pe,{"data-testid":E,children:[c,I,F,H,J,Q,ee]}),e[103]=c,e[104]=I,e[105]=F,e[106]=H,e[107]=J,e[108]=Q,e[109]=E,e[110]=ee,e[111]=se):se=e[111];let te;e[112]!==o||e[113]!==s||e[114]!==l?(te=(0,t.jsx)(as,{expanded:o,issue:s,shardKey:l},s.sampleMessage),e[112]=o,e[113]=s,e[114]=l,e[115]=te):te=e[115];let he;return e[116]!==se||e[117]!==te?(he=(0,t.jsxs)(t.Fragment,{children:[se,te]}),e[116]=se,e[117]=te,e[118]=he):he=e[118],he},"tt"),ks=d(n=>{let e=(0,ge.c)(38),{initialShardKey:u}=n,s=ue(),$=Ne(),{queryShardKey:i,setShardKey:l,shardKey:a}=Le(u),[o,_]=(0,ne.useState)("all"),[A,R]=(0,ne.useState)(ns),[K,L]=(0,ne.useState)(os),k;e[0]!==o?(k=o==="all"?{}:{status:o},e[0]=o,e[1]=k):k=e[1];let T;e[2]!==i?(T={live:!0,shardKey:i},e[2]=i,e[3]=T):T=e[3];let{data:E,error:h,liveError:x}=Ee(U.getIssues,k,T),M=E!==void 0,v;if(e[4]!==K||e[5]!==A||e[6]!==$||e[7]!==E||e[8]!==h||e[9]!==x||e[10]!==M||e[11]!==i||e[12]!==l||e[13]!==a||e[14]!==o||e[15]!==s){let y=es(E),b;e[17]!==$||e[18]!==i?(b=d(async(r,oe,V)=>{L(N=>{if(!N.has(r))return N;let C=new Map(N);return C.delete(r),C}),R(N=>new Set(N).add(r));try{await $.query(oe,{...V,hash:r},be(i))}catch(N){let C=Ke(N);L(q=>new Map(q).set(r,C))}R(N=>{let C=new Set(N);return C.delete(r),C})},"S"),e[17]=$,e[18]=i,e[19]=b):b=e[19];let w=b,m;e[20]!==s?(m=d(r=>s(r==="all"?"All":r==="open"?"Open":r==="resolved"?"Resolved":"Ignored"),"u"),e[20]=s,e[21]=m):m=e[21];let f=m,p;e[22]!==h?(p=h!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"issues-error",role:"alert",children:h}),e[22]=h,e[23]=p):p=e[23];let c;e[24]!==l||e[25]!==a?(c=(0,t.jsx)(_e,{onChange:l,testId:"issues-shard-input",value:a}),e[24]=l,e[25]=a,e[26]=c):c=e[26];let S;e[27]!==x?(S=(0,t.jsx)(qe,{message:x,prefix:"issues"}),e[27]=x,e[28]=S):S=e[28];let g;e[29]!==o||e[30]!==f?(g=Je.map(r=>(0,t.jsx)(ie,{"data-active":o===r?"":void 0,"data-testid":`issues-filter-${r}`,onClick:d(()=>{_(r)},"onClick"),size:"xs",variant:o===r?"default":"outline",children:f(r)},r)),e[29]=o,e[30]=f,e[31]=g):g=e[31];let I;e[32]!==g?(I=(0,t.jsx)("div",{className:"ms-auto flex items-center gap-1","data-testid":"issues-status-filter",role:"group",children:g}),e[32]=g,e[33]=I):I=e[33];let j;e[34]!==I||e[35]!==c||e[36]!==S?(j=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[c,S,I]}),e[34]=I,e[35]=c,e[36]=S,e[37]=j):j=e[37],v=(0,t.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-issues-panel",children:[p,j,M&&y.length===0?(0,t.jsx)(Ae,{description:s("No grouped errors yet. When a function throws or a container crashes, matching errors fold into a single issue here."),testId:"issues-empty",title:s("No issues")}):(0,t.jsx)(Me,{className:"overflow-hidden py-0",children:(0,t.jsx)(Ce,{className:"px-0",children:(0,t.jsxs)(ze,{"data-testid":"issues-table",children:[(0,t.jsx)(Re,{children:(0,t.jsxs)(pe,{children:[(0,t.jsx)(B,{children:s("Issue")}),(0,t.jsx)(B,{children:s("Status")}),(0,t.jsx)(B,{children:s("Severity")}),(0,t.jsx)(B,{children:s("Assignee")}),(0,t.jsx)(B,{className:"text-right",children:s("Events")}),(0,t.jsx)(B,{children:s("Last seen")}),(0,t.jsx)(B,{className:"text-right",children:s("Actions")})]})}),(0,t.jsx)(je,{children:y.map(r=>(0,t.jsx)(is,{busy:A.has(r.hash),issue:r,rowError:K.get(r.hash),runTriage:w,shardKey:i},r.hash))})]})})})]}),e[4]=K,e[5]=A,e[6]=$,e[7]=E,e[8]=h,e[9]=x,e[10]=M,e[11]=i,e[12]=l,e[13]=a,e[14]=o,e[15]=s,e[16]=v}else v=e[16];return v},"Tt");function rs(n){return!n}d(rs,"st");function ls(n){return(0,t.jsx)(we,{value:n,children:n},n)}d(ls,"at");function ns(){return new Set}d(ns,"it");function os(){return new Map}d(os,"lt");export{ks as default};
@@ -0,0 +1 @@
1
+ import{j as o}from"./chunk-225VJ77I.js";import{a as r,d as i,e as p}from"./chunk-YKXDMIHQ.js";var a=i(p(),1);var R=a.forwardRef(r(function(e,n){let{className:l,render:m,orientation:t="horizontal",style:f,...s}=e;return o("div",e,{state:{orientation:t},ref:n,props:[{role:"separator","aria-orientation":t},s]})},"SeparatorComponent"));export{R as a};
@@ -0,0 +1 @@
1
+ import{a as h}from"./chunk-CMA4PTV7.js";import{a as e}from"./chunk-YKXDMIHQ.js";var m=e((i,o,s)=>h(i,t=>{o(t.height>0?t:{height:s,width:t.width})}),"s");export{m as a};
@@ -0,0 +1 @@
1
+ import{b as de}from"./chunk-UYEZR3BI.js";import{a as te,b as re,c as ne}from"./chunk-Q4CAKBWN.js";import"./chunk-OKG3HWSJ.js";import{b as Y}from"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import{a as ae}from"./chunk-F7UZBTKS.js";import"./chunk-ULIQFBZU.js";import"./chunk-Y3G2ZPOD.js";import"./chunk-35DM4JJG.js";import{a as ee}from"./chunk-4ZEL6BYL.js";import{c as Z}from"./chunk-D6UKRXIS.js";import"./chunk-VWWJIICI.js";import"./chunk-FSRSK4LY.js";import"./chunk-KSYIH3NO.js";import{a as le,b as oe,c as se,d as H,e as z,f as G}from"./chunk-HEAQVSNS.js";import{a as P,e as q}from"./chunk-WUWBZPUK.js";import{d as X}from"./chunk-FODLDLE2.js";import{a as g,d as W,f as ce,g as me}from"./chunk-YKXDMIHQ.js";var J=W(ce(),1);var t=W(me(),1);var ue={binding:"outline",secret:"destructive",var:"secondary"},pe=g((n,e)=>{if(n===void 0)return[];let u=[];return n.workerUrl!==void 0&&u.push({label:e("URL"),value:n.workerUrl}),n.environment!==void 0&&u.push({label:e("Environment"),value:n.environment}),n.deploymentId!==void 0&&u.push({label:e("Deployment"),value:n.deploymentId}),n.versionTag!==void 0&&u.push({label:e("Version"),value:n.versionTag}),u},"ce"),ie=g(n=>{let e=(0,J.c)(18),{modifier:u,name:r,label:p}=n,A=te(),x;e[0]!==r?(x=g(o=>{if(!["Escape","Tab"].includes(o.key)){if(o.shiftKey){o.preventDefault();return}o.preventDefault(),re(r,o.key)}},"b"),e[0]=r,e[1]=x):x=e[1];let i=x,c=`set-shortcut-${r}`,m;e[2]!==p?(m=(0,t.jsx)("dt",{className:"text-muted-foreground",children:p}),e[2]=p,e[3]=m):m=e[3];let h;e[4]!==u?(h=(0,t.jsx)("kbd",{className:"rounded border border-border px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground",children:u}),e[4]=u,e[5]=h):h=e[5];let l=`set-shortcut-input-${r}`,f=A[r],s;e[6]!==p||e[7]!==i||e[8]!==l||e[9]!==f?(s=(0,t.jsx)("input",{"aria-label":p,className:"h-7 w-12 rounded-md border border-border bg-background text-center font-mono text-xs uppercase outline-none focus-visible:border-ring","data-testid":l,onKeyDown:i,readOnly:!0,value:f}),e[6]=p,e[7]=i,e[8]=l,e[9]=f,e[10]=s):s=e[10];let a;e[11]!==h||e[12]!==s?(a=(0,t.jsxs)("dd",{className:"flex items-center gap-1.5",children:[h,s]}),e[11]=h,e[12]=s,e[13]=a):a=e[13];let d;return e[14]!==c||e[15]!==m||e[16]!==a?(d=(0,t.jsxs)("div",{className:"contents","data-testid":c,children:[m,a]}),e[14]=c,e[15]=m,e[16]=a,e[17]=d):d=e[17],d},"z"),Se=g(n=>{let e=(0,J.c)(85),{initialShardKey:u}=n,r=X(),p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={},e[0]=p):p=e[0];let A=u??"",x;e[1]!==A?(x={shardKey:A},e[1]=A,e[2]=x):x=e[2];let{data:i,error:c,errorSource:m,isLoading:h}=Z(ee.getSettings,p,x),l,f,s,a,d,o,b;if(e[3]!==c||e[4]!==m||e[5]!==i?.deploy||e[6]!==i?.settings||e[7]!==r){let Q=pe(i?.deploy,r),M;e[15]!==i?.settings?(M=i?.settings??[],e[15]=i?.settings,e[16]=M):M=e[16],l=M,f="flex flex-col gap-4",s="lunora-settings";let V;e[17]!==r?(V=r("Open in Cloudflare"),e[17]=r,e[18]=V):V=e[18],e[19]!==V?(a=(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-3",children:(0,t.jsx)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"set-cf-link",href:de,rel:"noreferrer",target:"_blank",children:V})}),e[19]=V,e[20]=a):a=e[20];let $;e[21]!==r?($=r("View-only \u2014 values are masked. Edit vars, secrets, and bindings in wrangler or the Cloudflare dashboard."),e[21]=r,e[22]=$):$=e[22],e[23]!==$?(d=(0,t.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"set-readonly-note",children:$}),e[23]=$,e[24]=d):d=e[24],e[25]!==c||e[26]!==m?(o=c!==null&&(0,t.jsx)(ae,{error:m,testId:"set-error"}),e[25]=c,e[26]=m,e[27]=o):o=e[27],b=Q.length>0&&(0,t.jsxs)(P,{className:"py-0","data-testid":"set-deploy",children:[(0,t.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,t.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:r("Deployment")})}),(0,t.jsx)(q,{className:"py-3",children:(0,t.jsx)("dl",{className:"grid grid-cols-[8rem_minmax(0,1fr)] gap-x-4 gap-y-1 text-sm",children:Q.map(he)})})]}),e[3]=c,e[4]=m,e[5]=i?.deploy,e[6]=i?.settings,e[7]=r,e[8]=l,e[9]=f,e[10]=s,e[11]=a,e[12]=d,e[13]=o,e[14]=b}else l=e[8],f=e[9],s=e[10],a=e[11],d=e[12],o=e[13],b=e[14];let y;e[28]!==r?(y=r("Keyboard shortcuts"),e[28]=r,e[29]=y):y=e[29];let v;e[30]!==y?(v=(0,t.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:y}),e[30]=y,e[31]=v):v=e[31];let N;e[32]!==r?(N=r("Reset"),e[32]=r,e[33]=N):N=e[33];let k;e[34]!==N?(k=(0,t.jsx)("button",{className:"rounded px-1 text-[11px] text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:text-foreground","data-testid":"set-shortcut-reset",onClick:ne,type:"button",children:N}),e[34]=N,e[35]=k):k=e[35];let w;e[36]!==v||e[37]!==k?(w=(0,t.jsxs)("header",{className:"flex items-center justify-between border-b border-border px-4 py-3",children:[v,k]}),e[36]=v,e[37]=k,e[38]=w):w=e[38];let C;e[39]!==r?(C=r("Command palette"),e[39]=r,e[40]=C):C=e[40];let S;e[41]!==C?(S=(0,t.jsx)(ie,{label:C,modifier:"\u2318/Ctrl",name:"palette"}),e[41]=C,e[42]=S):S=e[42];let T;e[43]!==r?(T=r("Operation console"),e[43]=r,e[44]=T):T=e[44];let D;e[45]!==T?(D=(0,t.jsx)(ie,{label:T,modifier:"Ctrl",name:"console"}),e[45]=T,e[46]=D):D=e[46];let _;e[47]!==S||e[48]!==D?(_=(0,t.jsxs)("dl",{className:"grid grid-cols-[10rem_minmax(0,1fr)] items-center gap-x-4 gap-y-2 text-sm",children:[S,D]}),e[47]=S,e[48]=D,e[49]=_):_=e[49];let E;e[50]!==r?(E=r("Stored in this browser. Focus a box and press a key to rebind it."),e[50]=r,e[51]=E):E=e[51];let I;e[52]!==E?(I=(0,t.jsx)("p",{className:"pt-3 text-xs text-muted-foreground",children:E}),e[52]=E,e[53]=I):I=e[53];let K;e[54]!==_||e[55]!==I?(K=(0,t.jsxs)(q,{className:"py-3",children:[_,I]}),e[54]=_,e[55]=I,e[56]=K):K=e[56];let O;e[57]!==w||e[58]!==K?(O=(0,t.jsxs)(P,{className:"py-0","data-testid":"set-preferences",children:[w,K]}),e[57]=w,e[58]=K,e[59]=O):O=e[59];let U;e[60]!==r?(U=r("Environment & bindings"),e[60]=r,e[61]=U):U=e[61];let j;e[62]!==U?(j=(0,t.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,t.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:U})}),e[62]=U,e[63]=j):j=e[63];let F;e[64]!==c||e[65]!==h||e[66]!==l.length||e[67]!==r?(F=c===null&&!h&&l.length===0&&(0,t.jsx)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"set-empty",children:r("No environment variables or bindings.")}),e[64]=c,e[65]=h,e[66]=l.length,e[67]=r,e[68]=F):F=e[68];let L;e[69]!==l||e[70]!==r?(L=l.length>0&&(0,t.jsx)(q,{className:"px-0 py-0",children:(0,t.jsxs)(le,{"data-testid":"set-table",children:[(0,t.jsx)(oe,{children:(0,t.jsxs)(H,{children:[(0,t.jsx)(z,{children:r("name")}),(0,t.jsx)(z,{children:r("kind")}),(0,t.jsx)(z,{children:r("value")})]})}),(0,t.jsx)(se,{children:l.map(fe)})]})}),e[69]=l,e[70]=r,e[71]=L):L=e[71];let R;e[72]!==j||e[73]!==F||e[74]!==L?(R=(0,t.jsxs)(P,{className:"py-0",children:[j,F,L]}),e[72]=j,e[73]=F,e[74]=L,e[75]=R):R=e[75];let B;return e[76]!==O||e[77]!==R||e[78]!==f||e[79]!==s||e[80]!==a||e[81]!==d||e[82]!==o||e[83]!==b?(B=(0,t.jsxs)("div",{className:f,"data-testid":s,children:[a,d,o,b,O,R]}),e[76]=O,e[77]=R,e[78]=f,e[79]=s,e[80]=a,e[81]=d,e[82]=o,e[83]=b,e[84]=B):B=e[84],B},"Ce");function he(n){return(0,t.jsxs)("div",{className:"contents","data-testid":"set-deploy-row",children:[(0,t.jsx)("dt",{className:"text-muted-foreground",children:n.label}),(0,t.jsx)("dd",{className:"truncate font-mono text-xs",title:n.value,children:n.value})]},n.label)}g(he,"me");function fe(n){return(0,t.jsxs)(H,{"data-testid":"set-row",children:[(0,t.jsx)(G,{className:"font-mono text-xs font-medium",children:n.name}),(0,t.jsx)(G,{children:(0,t.jsx)(Y,{variant:ue[n.kind],children:n.bindingType??n.kind})}),(0,t.jsx)(G,{className:"max-w-[28ch] truncate font-mono text-xs text-muted-foreground",children:n.value??(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})})]},n.name)}g(fe,"fe");export{Se as SettingsPanel};