@lunora/studio 1.0.0-alpha.23 → 1.0.0-alpha.230

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 (339) hide show
  1. package/LICENSE.md +6 -0
  2. package/README.md +1 -1
  3. package/dist/index.d.mts +1581 -0
  4. package/dist/index.d.ts +976 -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-fhDlZGE4.mjs +2 -0
  60. package/dist/packem_shared/ApiReferencePanel-CHoHM5ME.mjs +1 -0
  61. package/dist/packem_shared/CommandPalette-D9ZY-qQd.mjs +1 -0
  62. package/dist/packem_shared/ConfirmButton-DU4p72Er.mjs +1 -0
  63. package/dist/packem_shared/ConnectionBadge-B8Hj5DaE.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-YscAF4OI.mjs +4 -0
  68. package/dist/packem_shared/DataFilters-CYZFt2EK.mjs +1 -0
  69. package/dist/packem_shared/ErrorBoundary-BWNF98VF.mjs +1 -0
  70. package/dist/packem_shared/GlobalDataBrowser-DhObcZDY.mjs +1 -0
  71. package/dist/packem_shared/HomePanel-fJZRA0b0.mjs +1 -0
  72. package/dist/packem_shared/MigrationsPanel-QjQ4Gp9s.mjs +1 -0
  73. package/dist/packem_shared/OpenRpcReferencePanel-C8ctFJVm.mjs +1 -0
  74. package/dist/packem_shared/STUDIO_ROOT_CLASS-C6MccdVk.mjs +1 -0
  75. package/dist/packem_shared/ScheduledJobs-nPx7NmOE.mjs +1 -0
  76. package/dist/packem_shared/ShardInput-C6mjgAh4.mjs +1 -0
  77. package/dist/packem_shared/Studio-DQq17PO6.mjs +1 -0
  78. package/dist/packem_shared/StudioApp-DikgPBVJ.mjs +1 -0
  79. package/dist/packem_shared/StudioI18nProvider-fVsCSs5L.mjs +1 -0
  80. package/dist/packem_shared/advisor-view-BzzJg9D_.mjs +1 -0
  81. package/dist/packem_shared/aggregateMetrics-5zEJC6Ju.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/auth-pager-DiDnXsfe.mjs +1 -0
  86. package/dist/packem_shared/badge-r_5B4LHP.mjs +1 -0
  87. package/dist/packem_shared/bar-chart-BCsEIQoQ.mjs +6 -0
  88. package/dist/packem_shared/browser-storage-BH1MxLZs.mjs +1 -0
  89. package/dist/packem_shared/button-q0UYSmrn.mjs +1 -0
  90. package/dist/packem_shared/card--2hKx4L2.mjs +1 -0
  91. package/dist/packem_shared/cf-links-CBJ5SywP.mjs +1 -0
  92. package/dist/packem_shared/checkbox-CnS9cyCz.mjs +1 -0
  93. package/dist/packem_shared/control-button-BOZ5K-FC.mjs +1 -0
  94. package/dist/packem_shared/data-grid-DIiNmDR9.mjs +1 -0
  95. package/dist/packem_shared/data-view-params-DhYmAkcj.mjs +1 -0
  96. package/dist/packem_shared/dropdown-menu-jLZenfWH.mjs +2 -0
  97. package/dist/packem_shared/empty-state-D7jEML_T.mjs +1 -0
  98. package/dist/packem_shared/error-alert-DueSEkt-.mjs +1 -0
  99. package/dist/packem_shared/grid-features-OVIMIQan.mjs +6 -0
  100. package/dist/packem_shared/grid-pagination-DgzyzfBh.mjs +1 -0
  101. package/dist/packem_shared/home-panel-DBSHjxil.mjs +3 -0
  102. package/dist/packem_shared/input-CXhxesPC.mjs +1 -0
  103. package/dist/packem_shared/internal-Df43vQI0.mjs +2 -0
  104. package/dist/packem_shared/label-DKFzyHq6.mjs +1 -0
  105. package/dist/packem_shared/live-status-BuJdUZFU.mjs +1 -0
  106. package/dist/packem_shared/log-fields-SBxKyBug.mjs +1 -0
  107. package/dist/packem_shared/log-line-BHWXobrl.mjs +1 -0
  108. package/dist/packem_shared/modal-shell-CDztwLnv.mjs +1 -0
  109. package/dist/packem_shared/operation-console-provider-DoloEvon.mjs +1 -0
  110. package/dist/packem_shared/recording-client-CyFiAE2l.mjs +1 -0
  111. package/dist/packem_shared/reference-view-DSeKRrUU.mjs +13 -0
  112. package/dist/packem_shared/schema-diagram-CQ4vn0CN.mjs +2 -0
  113. package/dist/packem_shared/scroll-area-CXCQH7VT.mjs +2 -0
  114. package/dist/packem_shared/select-DPyS18Vy.mjs +2 -0
  115. package/dist/packem_shared/shard-history-CaO3C4KQ.mjs +1 -0
  116. package/dist/packem_shared/shortcuts-B9gDaXmw.mjs +1 -0
  117. package/dist/packem_shared/skeleton-DX1gfixl.mjs +1 -0
  118. package/dist/packem_shared/sparkline-B_sPPO_8.mjs +1 -0
  119. package/dist/packem_shared/sql-result-table-DyK762_A.mjs +1 -0
  120. package/dist/packem_shared/stat-card-D0Fe04cX.mjs +1 -0
  121. package/dist/packem_shared/storage-tier-C2mKwYRj.mjs +1 -0
  122. package/dist/packem_shared/studio-ajWxPNfI.mjs +2 -0
  123. package/dist/packem_shared/table-D0SBiDu-.mjs +2 -0
  124. package/dist/packem_shared/table-list-sidebar-DkPO_Qtz.mjs +1 -0
  125. package/dist/packem_shared/textarea--40GKAyz.mjs +1 -0
  126. package/dist/packem_shared/trace-handoff-BV3EWqy_.mjs +1 -0
  127. package/dist/packem_shared/use-admin-query-tlBof8Yg.mjs +1 -0
  128. package/dist/packem_shared/use-async-submit-CZqCMTJ_.mjs +1 -0
  129. package/dist/packem_shared/use-auth-config-B9hH2tQa.mjs +1 -0
  130. package/dist/packem_shared/use-mirrored-ref-CVDf2z1M.mjs +1 -0
  131. package/dist/packem_shared/use-open-trace-DMVhpnyG.mjs +1 -0
  132. package/dist/packem_shared/use-shard-key-BsP3o5wT.mjs +1 -0
  133. package/dist/packem_shared/use-sql-assistant-pjfGp-Ol.mjs +1 -0
  134. package/dist/packem_shared/useDebounced-DVeQ5-oW.mjs +1 -0
  135. package/dist/packem_shared/utils-bhneXptQ.mjs +1 -0
  136. package/dist/packem_shared/virtual-rect-D_j7aLxX.mjs +1 -0
  137. package/dist/packem_shared/wire-codec-Bk4XZGE4.mjs +1 -0
  138. package/dist/standalone/chunk-225VJ77I.js +1 -0
  139. package/dist/standalone/chunk-23SFT2CI.js +1 -0
  140. package/dist/standalone/chunk-2QSGCPIS.js +1 -0
  141. package/dist/standalone/chunk-2URQKGWU.js +1 -0
  142. package/dist/standalone/chunk-2V35H4JV.js +3 -0
  143. package/dist/standalone/chunk-35DM4JJG.js +1 -0
  144. package/dist/standalone/chunk-3EQVJ5SQ.js +1 -0
  145. package/dist/standalone/chunk-3EYROC6C.js +4 -0
  146. package/dist/standalone/chunk-3FBLWUXD.js +1 -0
  147. package/dist/standalone/chunk-3PWB52UO.js +1 -0
  148. package/dist/standalone/chunk-3Q2P62UR.js +1 -0
  149. package/dist/standalone/chunk-4GTO7FL5.js +1 -0
  150. package/dist/standalone/chunk-4JLGLPWV.js +1 -0
  151. package/dist/standalone/chunk-4L4WTGN5.js +1 -0
  152. package/dist/standalone/chunk-4PBNO4Q3.js +1 -0
  153. package/dist/standalone/chunk-4ZEL6BYL.js +1 -0
  154. package/dist/standalone/chunk-53KDWFYV.js +1 -0
  155. package/dist/standalone/chunk-55754F6H.js +1 -0
  156. package/dist/standalone/chunk-56GQRRBV.js +1 -0
  157. package/dist/standalone/chunk-57L2DM4H.js +1 -0
  158. package/dist/standalone/chunk-57XP5MZR.js +1 -0
  159. package/dist/standalone/chunk-5JDWLCSH.js +1 -0
  160. package/dist/standalone/chunk-5WJXVZMZ.js +1 -0
  161. package/dist/standalone/chunk-66UGPQVC.js +1 -0
  162. package/dist/standalone/chunk-6D6Z2KXU.js +1 -0
  163. package/dist/standalone/chunk-6DAD3RFX.js +1 -0
  164. package/dist/standalone/chunk-7BJGFDVG.js +1 -0
  165. package/dist/standalone/chunk-A3G6E5U2.js +1 -0
  166. package/dist/standalone/chunk-AANB526D.js +6 -0
  167. package/dist/standalone/chunk-AAVLPU5Q.js +1 -0
  168. package/dist/standalone/chunk-AWHXPIXU.js +1 -0
  169. package/dist/standalone/chunk-AZ4CIFUE.js +1 -0
  170. package/dist/standalone/chunk-B2HYHTIX.js +1 -0
  171. package/dist/standalone/chunk-BSNHEJP3.js +1 -0
  172. package/dist/standalone/chunk-C2WGWVPO.js +1 -0
  173. package/dist/standalone/chunk-C5CNJIVE.js +1 -0
  174. package/dist/standalone/chunk-CBTT4FMH.js +1 -0
  175. package/dist/standalone/chunk-CMA4PTV7.js +1 -0
  176. package/dist/standalone/chunk-CSUROWL2.js +1 -0
  177. package/dist/standalone/chunk-D3GIXGIJ.js +1 -0
  178. package/dist/standalone/chunk-DAFY42M2.js +1 -0
  179. package/dist/standalone/chunk-DCDNW7DR.js +3 -0
  180. package/dist/standalone/chunk-DTTTM3CW.js +4 -0
  181. package/dist/standalone/chunk-EA2JKR5D.js +1 -0
  182. package/dist/standalone/chunk-EIISOYGA.js +1 -0
  183. package/dist/standalone/chunk-EJSI4PMU.js +1 -0
  184. package/dist/standalone/chunk-ELWVLXCM.js +1 -0
  185. package/dist/standalone/chunk-ERHFRNCL.js +1 -0
  186. package/dist/standalone/chunk-EVTM6Q43.js +1 -0
  187. package/dist/standalone/chunk-EY6WHXDO.js +1 -0
  188. package/dist/standalone/chunk-F2RMCBTB.js +1 -0
  189. package/dist/standalone/chunk-F7UC63UN.js +1 -0
  190. package/dist/standalone/chunk-FEWMAPNI.js +1 -0
  191. package/dist/standalone/chunk-FKVZRPV5.js +1 -0
  192. package/dist/standalone/chunk-FSRSK4LY.js +1 -0
  193. package/dist/standalone/chunk-FZ5SSAZU.js +8 -0
  194. package/dist/standalone/chunk-GCHHYR6O.js +1 -0
  195. package/dist/standalone/chunk-GMS77BZD.js +1 -0
  196. package/dist/standalone/chunk-GOSWKLMM.js +1 -0
  197. package/dist/standalone/chunk-HEAQVSNS.js +1 -0
  198. package/dist/standalone/chunk-HGP7GH2M.js +1 -0
  199. package/dist/standalone/chunk-ICOTONE3.js +1 -0
  200. package/dist/standalone/chunk-IGPZHAPG.js +1 -0
  201. package/dist/standalone/chunk-IHMGCHAA.js +1 -0
  202. package/dist/standalone/chunk-IMOHEGMV.js +1 -0
  203. package/dist/standalone/chunk-IS6LVJ6L.js +1 -0
  204. package/dist/standalone/chunk-JTAVWGVE.js +1 -0
  205. package/dist/standalone/chunk-K7AJEMKE.js +1 -0
  206. package/dist/standalone/chunk-KCEEZ6OU.js +1 -0
  207. package/dist/standalone/chunk-KDR232YC.js +1 -0
  208. package/dist/standalone/chunk-KNCDRWAO.js +1 -0
  209. package/dist/standalone/chunk-L5XAH44R.js +1 -0
  210. package/dist/standalone/chunk-LCRAEP3B.js +1 -0
  211. package/dist/standalone/chunk-LCXKALTS.js +15 -0
  212. package/dist/standalone/chunk-MRAMNVDG.js +1 -0
  213. package/dist/standalone/chunk-MU3P2FI7.js +1 -0
  214. package/dist/standalone/chunk-MXLAOCAN.js +1 -0
  215. package/dist/standalone/chunk-MZ3WS2FG.js +1 -0
  216. package/dist/standalone/chunk-N2WM74AE.js +1 -0
  217. package/dist/standalone/chunk-N3CF7TGX.js +5 -0
  218. package/dist/standalone/chunk-NCFRIHLB.js +1 -0
  219. package/dist/standalone/chunk-NFS7FTAR.js +1 -0
  220. package/dist/standalone/chunk-NOCFO4AL.js +1 -0
  221. package/dist/standalone/chunk-O6AGWZVF.js +1 -0
  222. package/dist/standalone/chunk-OGUKYRFM.js +1 -0
  223. package/dist/standalone/chunk-OKG3HWSJ.js +1 -0
  224. package/dist/standalone/chunk-ONIGWNXT.js +1 -0
  225. package/dist/standalone/chunk-PLHA3OWK.js +3 -0
  226. package/dist/standalone/chunk-PPKKM57M.js +1 -0
  227. package/dist/standalone/chunk-PTZD7RUZ.js +19 -0
  228. package/dist/standalone/chunk-Q4CAKBWN.js +1 -0
  229. package/dist/standalone/chunk-QKEJLVC5.js +1 -0
  230. package/dist/standalone/chunk-QKZ2JCH3.js +1 -0
  231. package/dist/standalone/chunk-QNXB7FVQ.js +1 -0
  232. package/dist/standalone/chunk-R4WRHIAN.js +9 -0
  233. package/dist/standalone/chunk-RBWXVBJ2.js +1 -0
  234. package/dist/standalone/chunk-RFNGDE33.js +1 -0
  235. package/dist/standalone/chunk-RPQL45FL.js +1 -0
  236. package/dist/standalone/chunk-RRYVQMU5.js +1 -0
  237. package/dist/standalone/chunk-S2MXXVBU.js +8 -0
  238. package/dist/standalone/chunk-S3CRZLGS.js +1 -0
  239. package/dist/standalone/chunk-SI7I47IC.js +1 -0
  240. package/dist/standalone/chunk-SSPIY6CR.js +1 -0
  241. package/dist/standalone/chunk-SXDNBAX2.js +1 -0
  242. package/dist/standalone/chunk-T6GZ5GL5.js +1 -0
  243. package/dist/standalone/chunk-T7QKUVSO.js +1 -0
  244. package/dist/standalone/chunk-TKKZSWPP.js +1 -0
  245. package/dist/standalone/chunk-TVCRAKIF.js +1 -0
  246. package/dist/standalone/chunk-U7KL6DNA.js +1 -0
  247. package/dist/standalone/chunk-ULIQFBZU.js +1 -0
  248. package/dist/standalone/chunk-USB6LW3F.js +1 -0
  249. package/dist/standalone/chunk-UXXDN6Z3.js +1 -0
  250. package/dist/standalone/chunk-UYEZR3BI.js +1 -0
  251. package/dist/standalone/chunk-V3CZW3JB.js +1 -0
  252. package/dist/standalone/chunk-V3VJAA4D.js +1 -0
  253. package/dist/standalone/chunk-VEDBBYTH.js +1 -0
  254. package/dist/standalone/chunk-WUWBZPUK.js +1 -0
  255. package/dist/standalone/chunk-WYI7FXBH.js +14 -0
  256. package/dist/standalone/chunk-X32ZF36V.js +1 -0
  257. package/dist/standalone/chunk-XKMLLTFP.js +59 -0
  258. package/dist/standalone/chunk-XZMOZFE6.js +1 -0
  259. package/dist/standalone/chunk-Y6CXU7T4.js +1 -0
  260. package/dist/standalone/chunk-YKW7BL5H.js +2 -0
  261. package/dist/standalone/chunk-YKXDMIHQ.js +1 -0
  262. package/dist/standalone/chunk-YOB2X3FZ.js +1 -0
  263. package/dist/standalone/chunk-YPRQLCKF.js +1 -0
  264. package/dist/standalone/chunk-Z5O2NQAV.js +1 -0
  265. package/dist/standalone/studio.js +9 -378
  266. package/dist/styles.css +2 -2
  267. package/package.json +23 -20
  268. package/dist/index.js +0 -41
  269. package/dist/mount.js +0 -26
  270. package/dist/packem_shared/ADMIN_FUNCTIONS-CdaxLGkE.js +0 -48
  271. package/dist/packem_shared/ApiDocsPanel-BgrN4kml.js +0 -842
  272. package/dist/packem_shared/ApiReferencePanel-1vubqG5s.js +0 -229
  273. package/dist/packem_shared/ApiTab-CHkX49o_.js +0 -251
  274. package/dist/packem_shared/AuditPanel-CP9HM9nq.js +0 -200
  275. package/dist/packem_shared/CommandPalette-BtgkBzZI.js +0 -373
  276. package/dist/packem_shared/ConfirmButton-C2eVi2Qv.js +0 -59
  277. package/dist/packem_shared/ConnectionBadge-B2DDM2Tn.js +0 -111
  278. package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js +0 -50
  279. package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-DjF0h-gA.js +0 -89
  280. package/dist/packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js +0 -27
  281. package/dist/packem_shared/DataBrowser-Bb1gTQ6c.js +0 -4475
  282. package/dist/packem_shared/DataFilters-FNquMaiu.js +0 -249
  283. package/dist/packem_shared/ErrorBoundary-BzAApI7J.js +0 -66
  284. package/dist/packem_shared/ExportImportPanel-Dj87tRa5.js +0 -197
  285. package/dist/packem_shared/FileBrowser-CWvxp_is.js +0 -2932
  286. package/dist/packem_shared/FunctionRunner-DlWApMCH.js +0 -343
  287. package/dist/packem_shared/FunctionStatsPanel-CuO2Tmw-.js +0 -375
  288. package/dist/packem_shared/GlobalDataBrowser-3X9uRfdO.js +0 -289
  289. package/dist/packem_shared/HealthPanel-Dj0GRo5P.js +0 -648
  290. package/dist/packem_shared/HomePanel-BewOCuag.js +0 -1334
  291. package/dist/packem_shared/InsightsPanel-y_Q-xdPY.js +0 -461
  292. package/dist/packem_shared/LogsPanel-C7crgYoS.js +0 -827
  293. package/dist/packem_shared/MailPanel-PILidruz.js +0 -440
  294. package/dist/packem_shared/MetricsPanel-DioILzgf.js +0 -1611
  295. package/dist/packem_shared/MigrationsPanel-DkIcRoE5.js +0 -239
  296. package/dist/packem_shared/OpenRpcReferencePanel-vbcYbv3V.js +0 -191
  297. package/dist/packem_shared/PitrPanel-yKJ1JPPk.js +0 -252
  298. package/dist/packem_shared/STUDIO_ROOT_CLASS-D12gX2dV.js +0 -3
  299. package/dist/packem_shared/ScheduledJobs-BWNwIN3I.js +0 -262
  300. package/dist/packem_shared/SchemaViewer-CNr8Wame.js +0 -2512
  301. package/dist/packem_shared/SecurityAdvisorPanel-BBzv7L3c.js +0 -92
  302. package/dist/packem_shared/SettingsPanel-BKSKl8tl.js +0 -390
  303. package/dist/packem_shared/ShardInput-gx_DZXXn.js +0 -107
  304. package/dist/packem_shared/SqlEditorPanel-CkemCQvy.js +0 -13
  305. package/dist/packem_shared/Studio-QkOjc2NS.js +0 -33
  306. package/dist/packem_shared/StudioApp-TEElspKL.js +0 -657
  307. package/dist/packem_shared/StudioI18nProvider-B-tDCZIi.js +0 -48
  308. package/dist/packem_shared/TableEditor-JS3sXYgS.js +0 -11
  309. package/dist/packem_shared/advisor-view-CGcfMiPq.js +0 -159
  310. package/dist/packem_shared/aggregateMetrics-D4nUHEKU.js +0 -108
  311. package/dist/packem_shared/app.d-Cnij4Zp5.d.ts +0 -300
  312. package/dist/packem_shared/badge-B2PKA1-5.js +0 -49
  313. package/dist/packem_shared/bar-chart-CzJAgqkp.js +0 -3245
  314. package/dist/packem_shared/button-BhsN2uZH.js +0 -49
  315. package/dist/packem_shared/card-DURq3ElK.js +0 -175
  316. package/dist/packem_shared/cf-links-2cktDedA.js +0 -8
  317. package/dist/packem_shared/checkbox-UNkzAxl-.js +0 -63
  318. package/dist/packem_shared/data-grid-B5CaV3wS.js +0 -183
  319. package/dist/packem_shared/dropdown-menu-WY4B_eJO.js +0 -280
  320. package/dist/packem_shared/empty-state-DY_oe0k6.js +0 -98
  321. package/dist/packem_shared/grid-features-CzUfqgsM.js +0 -840
  322. package/dist/packem_shared/input-XH4r1Pt1.js +0 -53
  323. package/dist/packem_shared/internal-rXJEAhXS.js +0 -68
  324. package/dist/packem_shared/label-D8ykjn5J.js +0 -46
  325. package/dist/packem_shared/live-status-FZ0psC1z.js +0 -44
  326. package/dist/packem_shared/reference-view-B4E49Lip.js +0 -2180
  327. package/dist/packem_shared/shard-history-DyebH1R5.js +0 -38
  328. package/dist/packem_shared/sparkline-10dG-_f0.js +0 -93
  329. package/dist/packem_shared/sql-editor-panel-CUJoYF1Z.js +0 -2562
  330. package/dist/packem_shared/storage-tier-CL98eOvn.js +0 -85
  331. package/dist/packem_shared/studio-c5Vf7kSh.js +0 -11532
  332. package/dist/packem_shared/table-_RzNvy3R.js +0 -246
  333. package/dist/packem_shared/table-editor-9fhJ4hMJ.js +0 -407
  334. package/dist/packem_shared/table-list-sidebar-Bg7uzbvC.js +0 -832
  335. package/dist/packem_shared/textarea-D3gaCU_-.js +0 -46
  336. package/dist/packem_shared/use-admin-query-BkbdNFNz.js +0 -105
  337. package/dist/packem_shared/useDebounced-Dxncpg6z.js +0 -32
  338. package/dist/packem_shared/utils-B05Dmz_H.js +0 -8
  339. package/dist/packem_shared/virtual-rect-CVMUskSm.js +0 -10
@@ -0,0 +1 @@
1
+ import{a as zo}from"./chunk-Q4CAKBWN.js";import{a as Bn,b as Fn}from"./chunk-DCDNW7DR.js";import{a as jn,d as zn}from"./chunk-6DAD3RFX.js";import{a as Lt,b as Wt,c as qt,d as $t,e as Gt,f as On,g as Bo,h as Fo}from"./chunk-YPRQLCKF.js";import{$ as Oo,A as Rn,B as Ro,C as No,D as Nn,E as Vt,G as Ht,J as Bt,K as To,L as Ft,M as jt,O as wo,P as Tn,Q as wn,R as zt,S as Kt,T as Ut,U as Zt,V as Eo,W as Ne,Y as En,Z as kn,_ as ko,b as mn,ca as Do,da as Mo,fa as Io,j as _t,k as At,l as vn,la as _o,m as bn,ma as Ao,n as xn,na as Vo,o as yn,oa as Lo,p as xr,pa as Dn,q as Po,qa as Mn,ra as Ho,s as Co,sa as In,t as Pn,u as So,y as Cn,z as Sn}from"./chunk-GMS77BZD.js";import{c as _n,h as An,k as yr}from"./chunk-V3VJAA4D.js";import{a as jo}from"./chunk-5WJXVZMZ.js";import{b as Hn}from"./chunk-EVTM6Q43.js";import{a as Zr,b as Wr,d as qr,e as to,f as hr,g as $r,h as Gr,i as Qr,j as Yr,k as Jr}from"./chunk-6D6Z2KXU.js";import{I as fn,J as gn,O as hn,P as It,U as K,V as re,W as br,e as me,j as no,k as cn,q as dn,r as ao,t as Dt,u as pn,v as Mt,w as Ee,x as un}from"./chunk-PLHA3OWK.js";import{a as Ur}from"./chunk-4L4WTGN5.js";import{a as Pr}from"./chunk-55754F6H.js";import{c as ke}from"./chunk-IS6LVJ6L.js";import{a as ye,c as sn,h as yo,i as ln}from"./chunk-AAVLPU5Q.js";import{a as vr,b as Ot}from"./chunk-FEWMAPNI.js";import{a as oo,c as Q,g as ro,i as nn,j as B}from"./chunk-225VJ77I.js";import{a as Xr,b as en}from"./chunk-35DM4JJG.js";import{a as so}from"./chunk-ERHFRNCL.js";import{a as an}from"./chunk-FSRSK4LY.js";import{d as fr}from"./chunk-LCXKALTS.js";import{a as Vn}from"./chunk-FKVZRPV5.js";import{a as tn,b as on,c as rn,d as ge,p as Qt,s as Ln}from"./chunk-PTZD7RUZ.js";import{a as s,c as mr,d as N,e as A,f as gr,g as se,i as U}from"./chunk-YKXDMIHQ.js";var I=N(gr(),1);var xe=N(A(),1),O=N(A(),1);var a=N(se(),1);var Kn=N(A(),1),Te=N(se(),1);var Us={border:"1px solid var(--destructive)",color:"var(--destructive)",padding:12},Zs={overflow:"auto",whiteSpace:"pre-wrap"},Ko=class extends Kn.Component{static{s(this,"g")}static getDerivedStateFromError(e){return{error:e}}state={error:null};componentDidCatch(e,o){console.error("[lunora-studio] panel error",e,o.componentStack)}reset=s(()=>{this.setState({error:null})},"reset");render(){let{children:e,fallbackTitle:o,label:r,retryLabel:n}=this.props,{error:i}=this.state;if(i===null)return(0,Te.jsx)(Te.Fragment,{children:e});let l=o??(r===void 0?"Something went wrong":`${r} failed`);return(0,Te.jsxs)("div",{"data-testid":"dash-error-boundary",role:"alert",style:Us,children:[(0,Te.jsx)("strong",{children:l}),(0,Te.jsx)("pre",{"data-testid":"dash-error-message",style:Zs,children:i.message}),(0,Te.jsx)("button",{"data-testid":"dash-error-retry",onClick:this.reset,type:"button",children:n??"Try again"})]})}};var Me={};mr(Me,{Arrow:()=>ia,Backdrop:()=>ca,Close:()=>ga,Description:()=>ma,Handle:()=>po,Popup:()=>aa,Portal:()=>ea,Positioner:()=>ta,Root:()=>Qn,Title:()=>pa,Trigger:()=>Yn,Viewport:()=>va,createHandle:()=>ba});var io=N(A(),1);var Uo=N(A(),1);var Cr=Uo.createContext(void 0);function Y(t){let e=Uo.useContext(Cr);if(e===void 0&&!t)throw new Error(Q(47));return e}s(Y,"usePopoverRootContext");var Zo=N(A(),1),Un=N(Ur(),1);var Zn={...qt,disabled:s(t=>t.disabled,"disabled"),instantType:s(t=>t.instantType,"instantType"),openMethod:s(t=>t.openMethod,"openMethod"),openChangeReason:s(t=>t.openChangeReason,"openChangeReason"),modal:s(t=>t.modal,"modal"),focusManagerModal:s(t=>t.focusManagerModal,"focusManagerModal"),stickIfOpen:s(t=>t.stickIfOpen,"stickIfOpen"),titleElementId:s(t=>t.titleElementId,"titleElementId"),descriptionElementId:s(t=>t.descriptionElementId,"descriptionElementId"),openOnHover:s(t=>t.openOnHover,"openOnHover"),closeDelay:s(t=>t.closeDelay,"closeDelay"),adaptiveOrigin:s(t=>t.adaptiveOrigin,"adaptiveOrigin")},Wo=class extends Ht{static{s(this,"PopoverStore")}constructor(e,o,r){let n=new Ne;super(qn(e,n,o,r),$n(n),Zn)}setOpen=s((e,o)=>{let r=o.reason===K.triggerHover,n=o.reason===K.triggerPress&&o.event.detail===0,i=!e&&(o.reason===K.escapeKey||o.reason==null),l=Tn(o),c=this.select("activeTriggerId");if(!e&&o.reason===K.closePress&&o.trigger==null&&c!=null&&(o.trigger=this.context.triggerElements.getById(c)??this.select("activeTriggerElement")??void 0),this.context.onOpenChange?.(e,o),o.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,o);let p=s(()=>{let u=wo(this.state,e,o.trigger,l());u.openChangeReason=o.reason,this.update(u)},"changeState");r?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(500,()=>{this.set("stickIfOpen",!1)}),Un.flushSync(p)):p();let d;n?d="click":i?d="dismiss":o.reason===K.focusOut&&(d="focus"),this.set("instantType",d)},"setOpen")};function Wn(){let t=new Ne,e=new Gt(Object.freeze(qn(void 0,t)),Object.freeze($n(t)),Zn);return Object.assign(e,{setOpen:ro})}s(Wn,"createNullPopoverStore");function qn(t,e,o,r=!1){let n={...Wt(e,o,r),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...t};return n.open&&t?.mounted===void 0&&(n.mounted=!0),n}s(qn,"createInitialState");function $n(t){return{popupRef:Zo.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:Zo.createRef(),beforeContentFocusGuardRef:Zo.createRef(),stickIfOpenTimeout:new fn,triggerElements:t}}s($n,"createInitialContext");var Oe=N(se(),1);var Gn=_t(s(function({props:e}){let{children:o,open:r,defaultOpen:n=!1,onOpenChange:i,onOpenChangeComplete:l,modal:c=!1,handle:p,triggerId:d,defaultTriggerId:u=null}=e,f=Ws(p,{modal:c,open:n,openProp:r,activeTriggerId:u,triggerIdProp:d});f.useControlledProp("openProp",r),f.useControlledProp("triggerIdProp",d);let h=f.useState("open"),g=f.useState("mounted"),m=f.useState("payload");f.useContextCallback("onOpenChange",i),f.useContextCallback("onOpenChangeComplete",l),Eo(f,h),Kt(f);let{forceUnmount:x}=Ut(h,f,()=>{f.update({stickIfOpen:!0,openChangeReason:null})});f.useSyncedValues({modal:c}),io.useEffect(()=>{h||f.context.stickIfOpenTimeout.clear()},[f,h]),io.useImperativeHandle(e.actionsRef,()=>({unmount:x,close:s(()=>f.setOpen(!1,re(K.imperativeAction)),"close")}),[x,f]);let v=h||g;return(0,Oe.jsxs)(Cr.Provider,{value:f,children:[p&&(0,Oe.jsx)(jt,{handle:p,store:f}),v&&(0,Oe.jsx)(qs,{store:f,modal:c}),typeof o=="function"?o({payload:m}):o]})},"PopoverRootComponent"));function Qn(t){return Y(!0)?(0,Oe.jsx)(Gn,{props:t}):(0,Oe.jsx)(Rn,{children:(0,Oe.jsx)(Gn,{props:t})})}s(Qn,"PopoverRoot");function Ws(t,e){let o=Ft((r,n)=>new Wo(e,r,n));return io.useEffect(()=>o.context.stickIfOpenTimeout.disposeEffect(),[o]),o}s(Ws,"usePopoverRootStore");function qs({store:t,modal:e}){let o=t.useState("floatingRootContext"),r=Vt(o,{outsidePressEvent:{mouse:e==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),n=r.reference,i=r.floating;return Zt(t,{activeTriggerProps:n,inactiveTriggerProps:n,popupProps:i}),null}s(qs,"PopoverInteractions");var lo=N(A(),1);var Yt=N(se(),1);var Yn=At(s(function(e,o){let{render:r,className:n,style:i,disabled:l=!1,nativeButton:c=!0,handle:p,payload:d,openOnHover:u=!1,delay:f=300,closeDelay:h=0,id:g,...m}=e,x=Y(!0),b=$t(p)??x;if(!b)throw new Error(Q(74));let P=me(g),y=b.useState("isTriggerActive",P),S=b.useState("floatingRootContext"),C=b.useState("isOpenedByTrigger",P),w=b.useState("triggerPopupId",P),R=lo.useRef(null),{registerTrigger:T,isMountedByThisTrigger:E}=zt(P,R,b,{payload:d,disabled:l,openOnHover:u,closeDelay:h}),k=b.useState("openChangeReason"),M=b.useState("stickIfOpen"),L=b.useState("openMethod"),_=b.useState("focusManagerModal"),j=Oo(S,{enabled:!l&&u&&(L!=="touch"||k!==K.triggerPress),mouseOnly:!0,move:!1,handleClose:Do(),restMs:f,delay:{close:h},triggerElementRef:R,isActiveTrigger:y,isClosing:s(()=>b.select("transitionStatus")==="ending","isClosing")}),z=No(S,{stickIfOpen:M}),H=Mo(()=>b.select("open"),$=>{b.set("openMethod",$)}),F=b.useState("triggerProps",E),{getButtonProps:Z,buttonRef:D}=ke({disabled:l,native:c}),V={open($){return $&&k===K.triggerPress?pn.open($):Dt.open($)}},{preFocusGuardRef:q,handlePreFocusGuardFocus:G,handleFocusTargetFocus:ee}=On(b,R),te=B("button",e,{state:{disabled:l,open:C},ref:[D,o,T,R],props:[z.reference,j,F,H,{[Po]:"",id:P,"aria-haspopup":"dialog","aria-expanded":C,"aria-controls":w},m,Z],stateAttributesMapping:V}),X=(0,Yt.jsx)(lo.Fragment,{children:te},P);return E&&!_?(0,Yt.jsxs)(lo.Fragment,{children:[(0,Yt.jsx)(xr,{ref:q,onFocus:G}),X,(0,Yt.jsx)(xr,{ref:b.context.triggerFocusTargetRef,onFocus:ee})]}):X},"PopoverTrigger"));var Xn=N(A(),1);var qo=N(A(),1);var Sr=qo.createContext(void 0);function Jn(){let t=qo.useContext(Sr);if(t===void 0)throw new Error(Q(45));return t}s(Jn,"usePopoverPortalContext");var Rr=N(se(),1);var ea=Xn.forwardRef(s(function(e,o){let{keepMounted:r=!1,...n}=e;return Y().useState("mounted")||r?(0,Rr.jsx)(Sr.Provider,{value:r,children:(0,Rr.jsx)(So,{ref:o,...n})}):null},"PopoverPortal"));var Go=N(A(),1);var $o=N(A(),1);var Nr=$o.createContext(void 0);function Jt(){let t=$o.useContext(Nr);if(!t)throw new Error(Q(46));return t}s(Jt,"usePopoverPositionerContext");var co=N(se(),1);var ta=Go.forwardRef(s(function(e,o){let{render:r,className:n,style:i,anchor:l,positionMethod:c,side:p,align:d,sideOffset:u,alignOffset:f,collisionBoundary:h="clipping-ancestors",collisionPadding:g,arrowPadding:m,sticky:x,disableAnchorTracking:v=!1,collisionAvoidance:b=Co,...P}=e,y=Y(),S=Jn(),C=Cn(),w=y.useState("floatingRootContext"),R=y.useState("mounted"),T=y.useState("open"),E=y.useState("openChangeReason"),k=y.useState("activeTriggerElement"),M=y.useState("modal"),L=y.useState("openMethod"),_=y.useState("positionerElement"),j=y.useState("instantType"),z=y.useState("transitionStatus"),H=y.useState("adaptiveOrigin"),F=Go.useRef(null),Z=hn(_),D=_o({anchor:l,floatingRootContext:w,positionMethod:c,mounted:R,side:p,sideOffset:u,align:d,alignOffset:f,arrowPadding:m,collisionBoundary:h,collisionPadding:g,sticky:x,disableAnchorTracking:v,keepMounted:S,nodeId:C,collisionAvoidance:b,adaptiveOrigin:H}),V=w.useState("domReferenceElement");ye(()=>{let te=V,X=F.current;if(te&&(F.current=te),X&&te&&te!==X){y.set("instantType",void 0);let $=new AbortController;return Z(()=>{y.set("instantType","trigger-change")},$.signal),()=>{$.abort()}}},[V,Z,y]);let q=M===!0&&E!==K.triggerHover;Mn(T&&q,L==="touch",_,k);let G=y.useStateSetter("positionerElement"),ee={open:T,side:D.side,align:D.align,anchorHidden:D.anchorHidden,instant:j},ae=Lo(e,ee,{styles:D.positionerStyles,transitionStatus:z,props:P,refs:[o,G],hidden:!R,inert:!T});return(0,co.jsxs)(Nr.Provider,{value:D,children:[R&&q&&(0,co.jsx)(Ao,{inert:Io(!T),cutout:k}),(0,co.jsx)(Sn,{id:C,children:ae})]})},"PopoverPositioner"));var na=N(A(),1);var De=N(A(),1);var Tr=De.createContext(void 0);function oa(){let[t,e]=De.useState(0),o=sn(()=>(e(n=>n+1),()=>{e(n=>Math.max(0,n-1))}));return{context:De.useMemo(()=>({register:o}),[o]),hasClosePart:t>0}}s(oa,"useClosePartCount");function ra(){let t=De.useContext(Tr);ye(()=>t?.register(),[t])}s(ra,"useClosePartRegistration");var wr=N(se(),1);var aa=na.forwardRef(s(function(e,o){let{render:r,className:n,style:i,initialFocus:l,finalFocus:c,...p}=e,d=Y(),u=Jt(),f=In(!0)!=null,{context:h,hasClosePart:g}=oa(),m=d.useState("open"),x=d.useState("openMethod"),v=d.useState("instantType"),b=d.useState("transitionStatus"),P=d.useState("popupProps"),y=d.useState("titleElementId"),S=d.useState("descriptionElementId"),C=d.useState("modal"),w=d.useState("mounted"),R=d.useState("openChangeReason"),T=d.useState("activeTriggerElement"),E=d.useState("floatingRootContext"),k=E.useState("floatingId"),M=d.useState("disabled"),L=d.useState("openOnHover"),_=d.useState("closeDelay");It({open:m,ref:d.context.popupRef,onComplete(){m&&d.context.onOpenChangeComplete?.(!0)}}),ko(E,{enabled:L&&!M,closeDelay:_});let j=l===void 0?To(d.context.popupRef):l,z=C!==!1&&g;d.useSyncedValue("focusManagerModal",z);let H=d.useStateSetter("popupElement"),F={open:m,side:u.side,align:u.align,instant:v,transitionStatus:b},Z=B("div",e,{state:F,ref:[o,d.context.popupRef,H],props:[P,{id:k,role:"dialog",...Bt,"aria-labelledby":y,"aria-describedby":S,onKeyDown(D){f&&Ho.has(D.key)&&D.stopPropagation()}},Vo(b),p],stateAttributesMapping:Ee});return(0,wr.jsx)(Ro,{context:E,openInteractionType:x,modal:z,disabled:!w||R===K.triggerHover,initialFocus:j,returnFocus:c,restoreFocus:"popup",previousFocusableElement:ln(T)?T:void 0,nextFocusableElement:d.context.triggerFocusTargetRef,beforeContentFocusGuardRef:d.context.beforeContentFocusGuardRef,children:(0,wr.jsx)(Tr.Provider,{value:h,children:Z})})},"PopoverPopup"));var sa=N(A(),1);var ia=sa.forwardRef(s(function(e,o){let{render:r,className:n,style:i,...l}=e,p=Y().useState("open"),{arrowRef:d,side:u,align:f,arrowUncentered:h,arrowStyles:g}=Jt();return B("div",e,{state:{open:p,side:u,align:f,uncentered:h},ref:[o,d],props:[{style:g,"aria-hidden":!0},l],stateAttributesMapping:Mt})},"PopoverArrow"));var la=N(A(),1);var ca=la.forwardRef(s(function(e,o){let{render:r,className:n,style:i,...l}=e,c=Y(),p=c.useState("open"),d=c.useState("mounted"),u=c.useState("transitionStatus"),f=c.useState("openChangeReason");return B("div",e,{state:{open:p,transitionStatus:u},ref:o,props:[{role:"presentation",hidden:!d,style:{pointerEvents:f===K.triggerHover?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},l],stateAttributesMapping:Ee})},"PopoverBackdrop"));var da=N(A(),1);var pa=da.forwardRef(s(function(e,o){let{render:r,className:n,style:i,...l}=e,c=Y(),p=me(l.id);return c.useSyncedValueWithCleanup("titleElementId",p),B("h2",e,{ref:o,props:[{id:p},l]})},"PopoverTitle"));var ua=N(A(),1);var ma=ua.forwardRef(s(function(e,o){let{render:r,className:n,style:i,...l}=e,c=Y(),p=me(l.id);return c.useSyncedValueWithCleanup("descriptionElementId",p),B("p",e,{ref:o,props:[{id:p},l]})},"PopoverDescription"));var fa=N(A(),1);var ga=fa.forwardRef(s(function(e,o){let{render:r,className:n,style:i,disabled:l=!1,nativeButton:c=!0,...p}=e,{buttonRef:d,getButtonProps:u}=ke({disabled:l,focusableWhenDisabled:!1,native:c}),f=Y();return ra(),B("button",e,{ref:[o,d],props:[{onClick(g){f.setOpen(!1,re(K.closePress,g.nativeEvent))}},p,u]})},"PopoverClose"));var ha=N(A(),1);var va=ha.forwardRef(s(function(e,o){let{render:r,className:n,style:i,children:l,...c}=e,p=Y(),{side:d}=Jt(),u=p.useState("instantType"),{children:f,state:h}=Fo({store:p,side:d,children:l}),g={activationDirection:h.activationDirection,transitioning:h.transitioning,instant:u};return B("div",e,{state:g,ref:o,props:[c,{children:f}],stateAttributesMapping:Bo})},"PopoverViewport"));var po=class extends Lt{static{s(this,"PopoverHandle")}constructor(){super(Wn(),"Popover")}open(e){this.openByTrigger(e)}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}};function ba(){return new po}s(ba,"createPopoverHandle");var ie={};mr(ie,{Backdrop:()=>ya,Close:()=>Ca,Description:()=>Ra,Handle:()=>fo,Popup:()=>ka,Portal:()=>Da,Root:()=>Ba,Title:()=>Ka,Trigger:()=>Za,Viewport:()=>ja,createHandle:()=>Wa});var xa=N(A(),1);var Qo=N(A(),1);var Er=Qo.createContext(void 0);function ne(t){let e=Qo.useContext(Er);if(!t&&e===void 0)throw new Error(Q(27));return e}s(ne,"useDialogRootContext");var ya=xa.forwardRef(s(function(e,o){let{render:r,className:n,style:i,forceRender:l=!1,...c}=e,p=ne(),d=p.useState("open"),u=p.useState("nested"),f=p.useState("mounted"),h=p.useState("transitionStatus");return B("div",e,{state:{open:d,transitionStatus:h},ref:[p.context.backdropRef,o],stateAttributesMapping:Ee,props:[{role:"presentation",hidden:!f,style:{userSelect:"none",WebkitUserSelect:"none"}},c],enabled:l||!u})},"DialogBackdrop"));var Pa=N(A(),1);var Ca=Pa.forwardRef(s(function(e,o){let{render:r,className:n,style:i,disabled:l=!1,nativeButton:c=!0,...p}=e,d=ne(),u=d.useState("open"),{getButtonProps:f,buttonRef:h}=ke({disabled:l,native:c}),g={disabled:l};function m(x){u&&d.setOpen(!1,re(K.closePress,x.nativeEvent))}return s(m,"handleClick"),B("button",e,{state:g,ref:[o,h],props:[{onClick:m},p,f]})},"DialogClose"));var Sa=N(A(),1);var Ra=Sa.forwardRef(s(function(e,o){let{render:r,className:n,style:i,id:l,...c}=e,p=ne(),d=me(l);return p.useSyncedValueWithCleanup("descriptionElementId",d),B("p",e,{ref:o,props:[{id:d},c]})},"DialogDescription"));var wa=N(A(),1);var Yo=N(A(),1);var kr=Yo.createContext(void 0);function Jo(){let t=Yo.useContext(kr);if(t===void 0)throw new Error(Q(26));return t}s(Jo,"useDialogPortalContext");var Na="--nested-dialogs";var yu=ao.open,Pu=ao.closed,Cu=ao.startingStyle,Su=ao.endingStyle;var Ta="data-nested-dialog-open";var Xo={...Mt,...dn,nestedDialogOpen(t){return t?{[Ta]:""}:null}};var Ea=N(se(),1);var ka=wa.forwardRef(s(function(e,o){let{render:r,className:n,style:i,finalFocus:l,initialFocus:c,...p}=e,d=ne(),u=d.useState("descriptionElementId"),f=d.useState("disablePointerDismissal"),h=d.useState("floatingRootContext"),g=d.useState("popupProps"),m=d.useState("modal"),x=d.useState("mounted"),v=d.useState("nested"),b=d.useState("nestedOpenDialogCount"),P=d.useState("open"),y=d.useState("openMethod"),S=d.useState("titleElementId"),C=d.useState("transitionStatus"),w=d.useState("role"),R=h.useState("floatingId");Jo(),It({open:P,ref:d.context.popupRef,onComplete(){P&&d.context.onOpenChangeComplete?.(!0)}});let T=c===void 0?To(d.context.popupRef):c,E=b>0,k=d.useStateSetter("popupElement"),L=B("div",e,{state:{open:P,nested:v,transitionStatus:C,nestedDialogOpen:E},props:[g,{id:R,"aria-labelledby":S,"aria-describedby":u,role:w,...Bt,hidden:!x,onKeyDown(_){Ho.has(_.key)&&_.stopPropagation()},style:{[Na]:b}},p],ref:[o,d.context.popupRef,k],stateAttributesMapping:Xo});return(0,Ea.jsx)(Ro,{context:h,openInteractionType:y,disabled:!x,closeOnFocusOut:!f,initialFocus:T,returnFocus:l,modal:m!==!1,restoreFocus:"popup",children:L})},"DialogPopup"));var Oa=N(A(),1);var uo=N(se(),1);var Da=Oa.forwardRef(s(function(e,o){let{keepMounted:r=!1,...n}=e,i=ne(),l=i.useState("mounted"),c=i.useState("modal"),p=i.useState("open");return l||r?(0,uo.jsx)(kr.Provider,{value:r,children:(0,uo.jsxs)(So,{ref:o,...n,children:[l&&c===!0&&(0,uo.jsx)(Ao,{ref:i.context.internalBackdropRef,inert:Io(!p)}),e.children]})}):null},"DialogPortal"));var La=N(A(),1);var Or=N(A(),1);function Ma({store:t,parentContext:e,isDrawer:o}){let r=t.useState("open"),n=t.useState("disablePointerDismissal"),i=t.useState("modal"),l=t.useState("popupElement"),c=t.useState("floatingRootContext"),[p,d]=Or.useState(0),[u,f]=Or.useState(0),h=p===0,g=Vt(c,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:i==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(m){if(!t.context.outsidePressEnabledRef.current||"button"in m&&m.button!==0)return!1;if("touches"in m){if(m.type==="touchend"){if(m.changedTouches.length!==1||m.touches.length!==0)return!1}else if(m.touches.length!==1)return!1}let x=cn(m);if(h&&!n){if(i){let v=t.context.internalBackdropRef.current,b=t.context.backdropRef.current;return v||b?v===x||b===x||no(x,l)&&!x?.hasAttribute("data-base-ui-portal"):!0}return!0}return!1},escapeKey:h});return Dn(r&&i===!0,l),t.useContextCallback("onNestedDialogOpen",(m,x)=>{d(m),f(x)}),ye(()=>(e?.onNestedDialogOpen&&(r?e.onNestedDialogOpen(p+1,u+(o?1:0)):e.onNestedDialogOpen(0,0)),()=>{e?.onNestedDialogOpen&&r&&e.onNestedDialogOpen(0,0)}),[o,r,p,u,e]),Zt(t,{activeTriggerProps:g.reference,inactiveTriggerProps:g.trigger,popupProps:g.floating,nestedOpenDialogCount:p,nestedOpenDrawerCount:u}),null}s(Ma,"DialogInteractions");var er=N(A(),1);var Ia={...qt,modal:s(t=>t.modal,"modal"),nested:s(t=>t.nested,"nested"),nestedOpenDialogCount:s(t=>t.nestedOpenDialogCount,"nestedOpenDialogCount"),nestedOpenDrawerCount:s(t=>t.nestedOpenDrawerCount,"nestedOpenDrawerCount"),disablePointerDismissal:s(t=>t.disablePointerDismissal,"disablePointerDismissal"),openMethod:s(t=>t.openMethod,"openMethod"),descriptionElementId:s(t=>t.descriptionElementId,"descriptionElementId"),titleElementId:s(t=>t.titleElementId,"titleElementId"),viewportElement:s(t=>t.viewportElement,"viewportElement"),role:s(t=>t.role,"role")},tr=class extends Ht{static{s(this,"DialogStore")}constructor(e,o,r){let n=new Ne,i=Aa(e,n,o,r);super(i,Va(n),Ia)}setOpen=s((e,o)=>{o.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!e&&o.trigger==null&&this.state.activeTriggerId!=null&&(o.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,o),!o.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(e,o),this.update(wo(this.state,e,o.trigger)))},"setOpen")};function _a(){let t=new Ne;return new Gt(Object.freeze(Aa(void 0,t)),Object.freeze(Va(t)),Ia)}s(_a,"createNullDialogStore");function Aa(t,e,o,r=!1){return{...Wt(e,o,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...t}}s(Aa,"createInitialState");function Va(t){return{popupRef:er.createRef(),backdropRef:er.createRef(),internalBackdropRef:er.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:t,onOpenChange:void 0,onOpenChangeComplete:void 0}}s(Va,"createInitialContext");var mo=N(se(),1);function Ha(t,e){let{children:o,open:r,defaultOpen:n=!1,onOpenChange:i,onOpenChangeComplete:l,disablePointerDismissal:c=!1,modal:p=!0,actionsRef:d,handle:u,triggerId:f,defaultTriggerId:h=null}=e,g=t==="drawer",m=t==="alert-dialog",x=m?!0:p,v=m||c,b=m?"alertdialog":"dialog",P=ne(!0),y=P!=null,S={modal:x,disablePointerDismissal:v,nested:y,role:b},C=Ft((M,L)=>new tr({open:n,openProp:r,activeTriggerId:h,triggerIdProp:f,...S},M,L),!0);C.useControlledProp("openProp",r),C.useControlledProp("triggerIdProp",f),C.useSyncedValues(S),C.useContextCallback("onOpenChange",i),C.useContextCallback("onOpenChangeComplete",l);let w=C.useState("open"),R=C.useState("mounted"),T=C.useState("payload");Eo(C,w),Kt(C);let{forceUnmount:E}=Ut(w,C);La.useImperativeHandle(d,()=>({unmount:E,close:s(()=>C.setOpen(!1,re(K.imperativeAction)),"close")}),[E,C]);let k=w||R;return(0,mo.jsxs)(Er.Provider,{value:C,children:[u&&(0,mo.jsx)(jt,{handle:u,store:C}),k&&(0,mo.jsx)(Ma,{store:C,parentContext:P?.context,isDrawer:g}),typeof o=="function"?o({payload:T}):o]})}s(Ha,"useRenderDialogRoot");var Ba=_t(s(function(e){return Ha("dialog",e)},"DialogRoot"));var Fa=N(A(),1);var ja=Fa.forwardRef(s(function(e,o){let{render:r,className:n,style:i,children:l,...c}=e,p=Jo(),d=ne(),u=d.useState("open"),f=d.useState("nested"),h=d.useState("transitionStatus"),g=d.useState("nestedOpenDialogCount"),m=d.useState("mounted"),x=d.useStateSetter("viewportElement"),v=g>0;return B("div",e,{enabled:p||m,state:{open:u,nested:f,transitionStatus:h,nestedDialogOpen:v},ref:[o,x],stateAttributesMapping:Xo,props:[{role:"presentation",hidden:!m,style:{pointerEvents:u?void 0:"none"},children:l},c]})},"DialogViewport"));var za=N(A(),1);var Ka=za.forwardRef(s(function(e,o){let{render:r,className:n,style:i,id:l,...c}=e,p=ne(),d=me(l);return p.useSyncedValueWithCleanup("titleElementId",d),B("h2",e,{ref:o,props:[{id:d},c]})},"DialogTitle"));var Ua=N(A(),1);var Za=At(s(function(e,o){let{render:r,className:n,style:i,disabled:l=!1,nativeButton:c=!0,id:p,payload:d,handle:u,...f}=e,h=ne(!0),m=$t(u)??h;if(!m)throw new Error(Q(79));let x=me(p),v=m.useState("floatingRootContext"),b=m.useState("isOpenedByTrigger",x),P=m.useState("triggerPopupId",x),y=Ua.useRef(null),{registerTrigger:S,isMountedByThisTrigger:C}=zt(x,y,m,{payload:d}),{getButtonProps:w,buttonRef:R}=ke({disabled:l,native:c}),T=No(v),E=Mo(()=>m.select("open"),L=>{m.set("openMethod",L)}),k={disabled:l,open:b},M=m.useState("triggerProps",C);return B("button",e,{state:k,ref:[R,o,S,y],props:[T.reference,M,E,{[Po]:"",id:x,"aria-haspopup":"dialog","aria-expanded":b,"aria-controls":P},f,w],stateAttributesMapping:Dt})},"DialogTrigger"));var fo=class extends Lt{static{s(this,"DialogHandle")}constructor(){super(_a(),"Dialog",!1)}open(e){this.openByTrigger(e)}openWithPayload(e){let o=this.attachedStore;o!==null&&(o.set("payload",e),o.setOpen(!0,re(K.imperativeAction)))}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}};function Wa(){return new fo}s(Wa,"createDialogHandle");var Pe={};mr(Pe,{Arrow:()=>fs,Handle:()=>ho,Popup:()=>us,Portal:()=>ls,Positioner:()=>ds,Provider:()=>hs,Root:()=>Ja,Trigger:()=>os,Viewport:()=>bs,createHandle:()=>xs});var Xt=N(A(),1);var or=N(A(),1);var Dr=or.createContext(void 0);function ve(t){let e=or.useContext(Dr);if(e===void 0&&!t)throw new Error(Q(72));return e}s(ve,"useTooltipRootContext");var qa=N(A(),1);var $a={...qt,disabled:s(t=>t.disabled,"disabled"),instantType:s(t=>t.instantType,"instantType"),isInstantPhase:s(t=>t.isInstantPhase,"isInstantPhase"),trackCursorAxis:s(t=>t.trackCursorAxis,"trackCursorAxis"),disableHoverablePopup:s(t=>t.disableHoverablePopup,"disableHoverablePopup"),lastOpenChangeReason:s(t=>t.openChangeReason,"lastOpenChangeReason"),closeOnClick:s(t=>t.closeOnClick,"closeOnClick"),closeDelay:s(t=>t.closeDelay,"closeDelay"),adaptiveOrigin:s(t=>t.adaptiveOrigin,"adaptiveOrigin")},rr=class extends Ht{static{s(this,"TooltipStore")}constructor(e,o,r){let n=new Ne;super(Qa(e,n,o,r),Ya(n),$a)}setOpen=s((e,o)=>{wn(this,e,o,{extraState:{openChangeReason:o.reason}})},"setOpen");cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,re(K.triggerPress,e))}};function Ga(){let t=new Ne,e=new Gt(Object.freeze(Qa(void 0,t)),Object.freeze(Ya(t)),$a);return Object.assign(e,{setOpen:ro,cancelPendingOpen:ro})}s(Ga,"createNullTooltipStore");function Qa(t,e,o,r=!1){return{...Wt(e,o,r),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...t}}s(Qa,"createInitialState");function Ya(t){return{popupRef:qa.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:t}}s(Ya,"createInitialContext");var go=N(se(),1);var Ja=_t(s(function(e){let{disabled:o=!1,defaultOpen:r=!1,open:n,disableHoverablePopup:i=!1,trackCursorAxis:l="none",actionsRef:c,onOpenChange:p,onOpenChangeComplete:d,handle:u,triggerId:f,defaultTriggerId:h=null,children:g}=e,m=Ft((M,L)=>new rr({open:r,openProp:n,activeTriggerId:h,triggerIdProp:f},M,L));m.useControlledProp("openProp",n),m.useControlledProp("triggerIdProp",f),m.useContextCallback("onOpenChange",p),m.useContextCallback("onOpenChangeComplete",d);let x=m.useState("open"),v=!o&&x,b=m.useState("activeTriggerId"),P=m.useState("mounted"),y=m.useState("payload");m.useSyncedValues({trackCursorAxis:l,disableHoverablePopup:i,disabled:o}),Kt(m,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:S,transitionStatus:C}=Ut(v,m),w=m.useState("isInstantPhase"),R=m.useState("instantType"),T=m.useState("lastOpenChangeReason"),E=Xt.useRef(null);ye(()=>{x&&o&&m.setOpen(!1,re(K.disabled))},[x,o,m]),ye(()=>{C==="ending"&&T===K.none||C!=="ending"&&w?(R!=="delay"&&(E.current=R),m.set("instantType","delay")):E.current!==null&&(m.set("instantType",E.current),E.current=null)},[C,w,T,R,m]),ye(()=>{v&&b==null&&m.set("payload",void 0)},[m,b,v]),Xt.useImperativeHandle(c,()=>({unmount:S,close:s(()=>m.setOpen(!1,re(K.imperativeAction)),"close")}),[S,m]);let k=v||P||!o&&l!=="none";return(0,go.jsxs)(Dr.Provider,{value:m,children:[u&&(0,go.jsx)(jt,{handle:u,store:m}),k&&(0,go.jsx)(Qs,{store:m,disabled:o,trackCursorAxis:l}),typeof g=="function"?g({payload:y}):g]})},"TooltipRoot"));function Qs({store:t,disabled:e,trackCursorAxis:o}){let r=t.useState("floatingRootContext"),n=Vt(r,{enabled:!e,referencePress:s(()=>t.select("closeOnClick"),"referencePress")}),i=Nn(r,{enabled:!e&&o!=="none",axis:o==="none"?void 0:o}),l=Xt.useMemo(()=>oo(i.reference,n.reference),[i.reference,n.reference]);return Zt(t,{activeTriggerProps:l,inactiveTriggerProps:l,popupProps:n.floating??nn}),null}s(Qs,"TooltipInteractions");var ar=N(A(),1);var nr=N(A(),1);var Mr=nr.createContext(void 0);function Xa(){return nr.useContext(Mr)}s(Xa,"useTooltipProviderContext");var ts="data-base-ui-tooltip-trigger";function es(t){if("composedPath"in t){let o=t.composedPath();for(let r=0;r<o.length;r+=1){let n=o[r];if(yo(n))return n}}let e=t.target;return yo(e)?e:null}s(es,"getTargetElement");function Ys(t){let e=t;for(;e;){let o=e.closest(`[${ts}]`);if(o)return o;let r=e.getRootNode();e="host"in r&&yo(r.host)?r.host:null}return null}s(Ys,"closestEnabledTooltipTrigger");var os=At(s(function(e,o){let{render:r,className:n,style:i,handle:l,payload:c,disabled:p,delay:d,closeOnClick:u=!0,closeDelay:f,id:h,...g}=e,m=ve(!0),v=$t(l)??m;if(!v)throw new Error(Q(82));let b=me(h),P=v.useState("isTriggerActive",b),y=v.useState("isOpenedByTrigger",b),S=v.useState("floatingRootContext"),C=ar.useRef(null),w=f??0,{registerTrigger:R,isMountedByThisTrigger:T}=zt(b,C,v,{payload:c,closeOnClick:u,closeDelay:w}),E=Xa(),{activeIdRef:k,delayRef:M,isInstantPhase:L,hasProvider:_}=xn(S,{open:y}),j=kn(S);v.useSyncedValue("isInstantPhase",L);let z=v.useState("disabled"),H=p??z,F=yn(H),Z=v.useState("trackCursorAxis"),D=v.useState("disableHoverablePopup"),V=ar.useRef(!1),q=gn(),G=ar.useRef(void 0);function ee(){return _&&k.current!=null?0:d??E??600}s(ee,"getOpenDelay");function ae(W){let fe=C.current;if(!fe||!W)return!1;let ue=Ys(W);return ue!==null&&ue!==fe&&no(fe,ue)}s(ae,"isEnabledNestedTriggerTarget");function te(W){let fe=ae(W);return V.current=fe,fe&&(j.openChangeTimeout.clear(),j.restTimeout.clear(),j.restTimeoutPending=!1,q.clear()),fe}s(te,"detectNestedTriggerHover");let X=Oo(S,{enabled:!H,mouseOnly:!0,move:!1,handleClose:!D&&Z!=="both"?Do():null,restMs:ee,delay(){return f==null&&_?{close:vn(M.current,"close")}:{close:w}},triggerElementRef:C,isActiveTrigger:P,isClosing:s(()=>v.select("transitionStatus")==="ending","isClosing"),shouldOpen(){return!V.current}}),$=En(S,{enabled:!H}).reference,le=s(W=>{let fe=V.current,ue=es(W),Ce=te(ue),be=C.current,we=be&&ue&&no(be,ue);if(Ce&&v.select("open")&&v.select("lastOpenChangeReason")===K.triggerHover){v.setOpen(!1,re(K.triggerHover,W));return}if(fe&&!Ce&&we&&!F.current&&!v.select("open")&&be&&mn(G.current)){let Se=s(()=>{!V.current&&!F.current&&!v.select("open")&&v.setOpen(!0,re(K.triggerHover,W,be))},"open"),Re=ee();Re===0?(q.clear(),Se()):q.start(Re,Se)}},"handleNestedTriggerHover"),ce=v.useState("triggerProps",T);return B("button",e,{state:{open:y},ref:[o,R,C],props:[X,$,T||Z!=="none"?ce:void 0,{onMouseOver(W){le(W.nativeEvent)},onFocus(W){ae(es(W.nativeEvent))&&W.preventBaseUIHandler()},onMouseLeave(){V.current=!1,q.clear(),G.current=void 0},onPointerEnter(W){G.current=W.pointerType},onPointerDown(W){G.current=W.pointerType,v.set("closeOnClick",u),u&&!v.select("open")&&v.cancelPendingOpen(W.nativeEvent)},onClick(W){u&&!v.select("open")&&v.cancelPendingOpen(W.nativeEvent)},id:b,[un]:H?"":void 0,[ts]:H?void 0:""},g],stateAttributesMapping:Dt})},"TooltipTrigger"));var is=N(A(),1);var sr=N(A(),1);var Ir=sr.createContext(void 0);function rs(){let t=sr.useContext(Ir);if(t===void 0)throw new Error(Q(70));return t}s(rs,"useTooltipPortalContext");var ir=N(A(),1),ns=N(Ur(),1);var as=N(se(),1);var ss=ir.forwardRef(s(function(e,o){let{children:r,container:n,className:i,render:l,style:c,...p}=e,{node:d,subtree:u}=Pn({container:n,ref:o,componentProps:e,elementProps:p});return!u&&!d?null:(0,as.jsxs)(ir.Fragment,{children:[u,d&&ns.createPortal(r,d)]})},"FloatingPortalLite"));var _r=N(se(),1);var ls=is.forwardRef(s(function(e,o){let{keepMounted:r=!1,...n}=e;return ve().useState("mounted")||r?(0,_r.jsx)(Ir.Provider,{value:r,children:(0,_r.jsx)(ss,{ref:o,...n})}):null},"TooltipPortal"));var cr=N(A(),1);var lr=N(A(),1);var Ar=lr.createContext(void 0);function eo(){let t=lr.useContext(Ar);if(t===void 0)throw new Error(Q(71));return t}s(eo,"useTooltipPositionerContext");var cs=N(se(),1);var ds=cr.forwardRef(s(function(e,o){let{render:r,className:n,anchor:i,positionMethod:l="absolute",side:c="top",align:p="center",sideOffset:d=0,alignOffset:u=0,collisionBoundary:f="clipping-ancestors",collisionPadding:h=5,arrowPadding:g=5,sticky:m=!1,disableAnchorTracking:x=!1,collisionAvoidance:v=Co,style:b,...P}=e,y=ve(),S=rs(),C=y.useState("open"),w=y.useState("mounted"),R=y.useState("trackCursorAxis"),T=y.useState("disableHoverablePopup"),E=y.useState("floatingRootContext"),k=y.useState("instantType"),M=y.useState("transitionStatus"),L=y.useState("adaptiveOrigin"),_=_o({anchor:i,positionMethod:l,floatingRootContext:E,mounted:w,side:c,sideOffset:d,align:p,alignOffset:u,collisionBoundary:f,collisionPadding:h,sticky:m,arrowPadding:g,disableAnchorTracking:x,keepMounted:S,collisionAvoidance:v,adaptiveOrigin:L}),j=cr.useMemo(()=>({open:C,side:_.side,align:_.align,anchorHidden:_.anchorHidden,instant:R!=="none"?"tracking-cursor":k}),[C,_.side,_.align,_.anchorHidden,R,k]),z=Lo(e,j,{styles:_.positionerStyles,transitionStatus:M,props:P,refs:[o,y.useStateSetter("positionerElement")],hidden:!w,inert:!C||R==="both"||T});return(0,cs.jsx)(Ar.Provider,{value:_,children:z})},"TooltipPositioner"));var ps=N(A(),1);var us=ps.forwardRef(s(function(e,o){let{render:r,className:n,style:i,...l}=e,c=ve(),{side:p,align:d}=eo(),u=c.useState("open"),f=c.useState("instantType"),h=c.useState("transitionStatus"),g=c.useState("popupProps"),m=c.useState("floatingRootContext"),x=c.useState("disabled"),v=c.useState("closeDelay");It({open:u,ref:c.context.popupRef,onComplete(){u&&c.context.onOpenChangeComplete?.(!0)}}),ko(m,{enabled:!x,closeDelay:v});let b=c.useStateSetter("popupElement");return B("div",e,{state:{open:u,side:p,align:d,instant:f,transitionStatus:h},ref:[o,c.context.popupRef,b],props:[Bt,g,Vo(h),l],stateAttributesMapping:Ee})},"TooltipPopup"));var ms=N(A(),1);var fs=ms.forwardRef(s(function(e,o){let{render:r,className:n,style:i,...l}=e,c=ve(),{arrowRef:p,side:d,align:u,arrowUncentered:f,arrowStyles:h}=eo(),g=c.useState("open"),m=c.useState("instantType");return B("div",e,{state:{open:g,side:d,align:u,uncentered:f,instant:m},ref:[o,p],props:[{style:h,"aria-hidden":!0},l],stateAttributesMapping:Mt})},"TooltipArrow"));var gs=N(A(),1);var Vr=N(se(),1);var hs=s(function(e){let{delay:o,closeDelay:r,timeout:n=400}=e,i=gs.useMemo(()=>({open:o,close:r}),[o,r]);return(0,Vr.jsx)(Mr.Provider,{value:o,children:(0,Vr.jsx)(bn,{delay:i,timeoutMs:n,children:e.children})})},"TooltipProvider");var vs=N(A(),1);var bs=vs.forwardRef(s(function(e,o){let{render:r,className:n,style:i,children:l,...c}=e,p=ve(),d=eo(),u=p.useState("instantType"),{children:f,state:h}=Fo({store:p,side:d.side,children:l}),g={activationDirection:h.activationDirection,transitioning:h.transitioning,instant:u};return B("div",e,{state:g,ref:o,props:[c,{children:f}],stateAttributesMapping:Bo})},"TooltipViewport"));var ho=class extends Lt{static{s(this,"TooltipHandle")}constructor(){super(Ga(),"Tooltip")}open(e){this.openByTrigger(e)}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}};function xs(){return new ho}s(xs,"createTooltipHandle");var ys=N(gr(),1);var Ps=N(se(),1);var Js=s((t,e,o)=>t!==void 0?t:e===void 0&&o===void 0?on:tn(e,o),"I"),Cs=s(t=>{let e=(0,ys.c)(7),{catalogs:o,children:r,i18n:n,locale:i}=t,l;e[0]!==o||e[1]!==n||e[2]!==i?(l=Js(n,i,o),e[0]=o,e[1]=n,e[2]=i,e[3]=l):l=e[3];let c=l,p;return e[4]!==r||e[5]!==c?(p=(0,Ps.jsx)(rn,{value:c,children:r}),e[4]=r,e[5]=c,e[6]=p):p=e[6],p},"S");var Hr=N(gr(),1);var Ie=N(A(),1);var oe=N(se(),1);var Lr="lunora:command-palette",Ss=s(()=>{"window"in globalThis&&globalThis.dispatchEvent(new Event(Lr))},"ce"),Xs=s(t=>{let e=(0,Hr.c)(18),{active:o,index:r,item:n,onActivate:i,onSelect:l}=t,c;e[0]!==n||e[1]!==l?(c=s(()=>{l(n)},"g"),e[0]=n,e[1]=l,e[2]=c):c=e[2];let p=c,d;e[3]!==r||e[4]!==i?(d=s(()=>{i(r)},"x"),e[3]=r,e[4]=i,e[5]=d):d=e[5];let u=d,f=o?"bg-accent text-accent-foreground":"text-foreground",h;e[6]!==f?(h=U("flex w-full items-center justify-between gap-3 rounded-md px-3 py-2 text-start text-sm outline-none transition-colors hover:bg-accent hover:text-accent-foreground",f),e[6]=f,e[7]=h):h=e[7];let g;e[8]!==n.label?(g=(0,oe.jsx)("span",{children:n.label}),e[8]=n.label,e[9]=g):g=e[9];let m;e[10]!==n.group?(m=(0,oe.jsx)("span",{className:"text-xs text-muted-foreground",children:n.group}),e[10]=n.group,e[11]=m):m=e[11];let x;return e[12]!==p||e[13]!==u||e[14]!==h||e[15]!==g||e[16]!==m?(x=(0,oe.jsx)("li",{children:(0,oe.jsxs)("button",{className:h,onClick:p,onMouseEnter:u,type:"button",children:[g,m]})}),e[12]=p,e[13]=u,e[14]=h,e[15]=g,e[16]=m,e[17]=x):x=e[17],x},"Y"),ei=s((t,e)=>{let o=e.trim().toLowerCase();return o===""?t:t.filter(r=>r.label.toLowerCase().includes(o)||r.group.toLowerCase().includes(o))},"Z"),Rs=s(t=>{let e=(0,Hr.c)(40),{items:o}=t,r=ge(),n=to(),{palette:i}=zo(),[l,c]=(0,Ie.useState)(!1),[p,d]=(0,Ie.useState)(""),[u,f]=(0,Ie.useState)(0),h=(0,Ie.useRef)(null),g,m;e[0]!==i?(g=s(()=>{let D=s(q=>{if(!(q.metaKey||q.ctrlKey)||q.key.toLowerCase()!==i)return;let{target:G}=q;G instanceof HTMLElement&&(G.isContentEditable||["INPUT","SELECT","TEXTAREA"].includes(G.tagName))||(q.preventDefault(),c(!0))},"t"),V=s(()=>{c(!0)},"l");return globalThis.addEventListener("keydown",D),globalThis.addEventListener(Lr,V),()=>{globalThis.removeEventListener("keydown",D),globalThis.removeEventListener(Lr,V)}},"s"),m=[i],e[0]=i,e[1]=g,e[2]=m):(g=e[1],m=e[2]),(0,Ie.useEffect)(g,m);let x;e[3]!==o||e[4]!==p?(x=ei(o,p),e[3]=o,e[4]=p,e[5]=x):x=e[5];let v=x,b;e[6]===Symbol.for("react.memo_cache_sentinel")?(b=s(D=>{c(D),D||(d(""),f(0))},"I"),e[6]=b):b=e[6];let P=b,y;e[7]!==n?(y=s(D=>{if(P(!1),D.run!==void 0){D.run();return}D.to!==void 0&&Qt(n({to:D.to}))},"K"),e[7]=n,e[8]=y):y=e[8];let S=y,C;e[9]===Symbol.for("react.memo_cache_sentinel")?(C=s(D=>{d(D.target.value),f(0)},"P"),e[9]=C):C=e[9];let w=C,R;e[10]!==u||e[11]!==v||e[12]!==S?(R=s(D=>{e:switch(D.key){case"ArrowDown":{D.preventDefault(),f(V=>v.length===0?0:(V+1)%v.length);break e}case"ArrowUp":{D.preventDefault(),f(V=>v.length===0?0:(V-1+v.length)%v.length);break e}case"Enter":{D.preventDefault();let V=v[u];V!==void 0&&S(V);break e}}},"z"),e[10]=u,e[11]=v,e[12]=S,e[13]=R):R=e[13];let T=R,E;e[14]===Symbol.for("react.memo_cache_sentinel")?(E=(0,oe.jsx)(ie.Backdrop,{className:"fixed inset-0 z-50 bg-black/40 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0"}),e[14]=E):E=e[14];let k;e[15]!==r?(k=r("Command palette"),e[15]=r,e[16]=k):k=e[16];let M;e[17]!==k?(M=(0,oe.jsx)(ie.Title,{className:"sr-only",children:k}),e[17]=k,e[18]=M):M=e[18];let L;e[19]===Symbol.for("react.memo_cache_sentinel")?(L=(0,oe.jsxs)("svg",{"aria-hidden":"true",className:"size-4 text-muted-foreground",fill:"none",stroke:"currentColor",strokeWidth:1.8,viewBox:"0 0 24 24",children:[(0,oe.jsx)("circle",{cx:"11",cy:"11",r:"7"}),(0,oe.jsx)("path",{d:"m21 21-4.3-4.3",strokeLinecap:"round"})]}),e[19]=L):L=e[19];let _;e[20]!==r?(_=r("Search\u2026"),e[20]=r,e[21]=_):_=e[21];let j;e[22]!==T||e[23]!==p||e[24]!==_?(j=(0,oe.jsxs)("div",{className:"flex items-center gap-2 border-b border-border px-3",children:[L,(0,oe.jsx)("input",{className:"h-11 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground","data-testid":"dash-command-input",onChange:w,onKeyDown:T,placeholder:_,ref:h,type:"text",value:p})]}),e[22]=T,e[23]=p,e[24]=_,e[25]=j):j=e[25];let z;e[26]!==u||e[27]!==v||e[28]!==S||e[29]!==r?(z=v.length===0?(0,oe.jsx)("li",{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:r("No results.")}):v.map((D,V)=>(0,oe.jsx)(Xs,{active:V===u,index:V,item:D,onActivate:f,onSelect:S},D.to??`${D.group}:${D.label}`)),e[26]=u,e[27]=v,e[28]=S,e[29]=r,e[30]=z):z=e[30];let H;e[31]!==z?(H=(0,oe.jsx)("ul",{className:"max-h-80 overflow-y-auto p-1.5","data-testid":"dash-command-list",children:z}),e[31]=z,e[32]=H):H=e[32];let F;e[33]!==M||e[34]!==j||e[35]!==H?(F=(0,oe.jsxs)(ie.Portal,{children:[E,(0,oe.jsxs)(ie.Popup,{className:"fixed start-1/2 top-24 z-50 w-[36rem] max-w-[90vw] -translate-x-1/2 overflow-hidden rounded-lg border border-border bg-popover text-popover-foreground shadow-lg outline-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95","data-testid":"dash-command-palette",initialFocus:h,children:[M,j,H]})]}),e[33]=M,e[34]=j,e[35]=H,e[36]=F):F=e[36];let Z;return e[37]!==l||e[38]!==F?(Z=(0,oe.jsx)(ie.Root,{onOpenChange:P,open:l,children:F}),e[37]=l,e[38]=F,e[39]=Z):Z=e[39],Z},"de");var Os="(prefers-color-scheme: dark)",Ds=s(()=>{try{return globalThis.localStorage}catch{return}},"qt"),ti=s(t=>t==="system"||t==="light"||t==="dark","Ls"),Ms=s(()=>globalThis.matchMedia,"Wt"),Is="lunora-studio-theme",Br=["system","light","dark"],oi=s((t="system")=>{try{let e=Ds()?.getItem(Is);return ti(e)?e:t}catch{return t}},"As"),Ns=s(t=>{let e=Ds();if(e!==void 0)try{e.setItem(Is,t)}catch{}},"Tt"),ri=s(()=>{try{return Ms()?.(Os).matches?"dark":"light"}catch{return"light"}},"Is"),ni=s((t,e)=>t==="system"?e:t,"Rs"),ai=s(t=>{let e;try{e=Ms()?.(Os)}catch{e=void 0}if(e===void 0)return()=>{};let o=s(r=>{t(r.matches?"dark":"light")},"s");return e.addEventListener("change",o),()=>{e.removeEventListener("change",o)}},"Es"),zr=(0,O.createContext)(null),si=s(({children:t,defaultTheme:e="system"})=>{let[o,r]=(0,O.useState)(()=>oi(e)),[n,i]=(0,O.useState)(()=>ri());(0,O.useEffect)(()=>ai(i),[]);let l=s(p=>{Ns(p),r(p)},"i"),c={cycleTheme:s(()=>{r(p=>{let d=Br[(Br.indexOf(p)+1)%Br.length]??p;return Ns(d),d})},"cycleTheme"),resolvedTheme:ni(o,n),setTheme:l,systemTheme:n,theme:o};return(0,a.jsx)(zr,{value:c,children:t})},"$s"),ii=s(t=>{let e=(0,I.c)(3),{children:o}=t,r=(0,O.use)(zr),n;return e[0]!==o||e[1]!==r?(n=r===null?(0,a.jsx)(si,{children:o}):o,e[0]=o,e[1]=r,e[2]=n):n=e[2],n},"Hs"),li=s(()=>{let t=(0,O.use)(zr);if(t===null)throw new fr("INTERNAL","useTheme must be used within a <ThemeProvider>");return t},"Bs");function jg({delay:t=0,...e}){return(0,a.jsx)(Pe.Provider,{"data-slot":"tooltip-provider",delay:t,...e})}s(jg,"Pn");function ci(t){let e=(0,I.c)(4),o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=(0,a.jsx)(Pe.Root,{"data-slot":"tooltip",...o}),e[2]=o,e[3]=r):r=e[3],r}s(ci,"Vs");function di(t){let e=(0,I.c)(4),o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=(0,a.jsx)(Pe.Trigger,{"data-slot":"tooltip-trigger",...o}),e[2]=o,e[3]=r):r=e[3],r}s(di,"zs");function pi({className:t,side:e="top",sideOffset:o=4,align:r="center",alignOffset:n=0,children:i,...l}){return(0,a.jsx)(Pe.Portal,{children:(0,a.jsx)(Pe.Positioner,{align:r,alignOffset:n,side:e,sideOffset:o,className:"isolate z-50",children:(0,a.jsxs)(Pe.Popup,{"data-slot":"tooltip-content",className:U("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pe-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-start-2 data-[side=inline-start]:slide-in-from-end-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-md data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",t),...l,children:[i,(0,a.jsx)(Pe.Arrow,{className:"z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-md bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-start-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-end-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"})]})})})}s(pi,"Ds");var ui=s(t=>{let e=(0,I.c)(5),{className:o}=t,r;e[0]!==o?(r=U("h-full w-full text-foreground",o),e[0]=o,e[1]=r):r=e[1];let n;e[2]===Symbol.for("react.memo_cache_sentinel")?(n=(0,a.jsx)("path",{d:"M 259.500 10.552 C 220.080 15.859, 182.424 32.566, 152.500 58.025 C 110.179 94.031, 85.380 137.183, 77.518 188.500 C 75.410 202.255, 74.569 225.677, 75.796 236.466 C 76.757 244.917, 76.683 245.692, 74.518 249.966 C 63.118 272.466, 53.141 303.876, 51.382 322.799 L 50.718 329.943 71.960 320.471 C 83.643 315.262, 93.326 311, 93.478 311 C 93.630 311, 96.547 316.063, 99.959 322.250 C 103.371 328.438, 107.249 334.850, 108.577 336.500 L 110.990 339.500 110.981 336 C 110.977 334.075, 111.499 324.991, 112.143 315.813 L 113.312 299.127 121.406 293.336 C 132.495 285.403, 149.593 271.554, 161 261.268 C 171.556 251.748, 189.116 235, 188.540 235 C 188.337 235, 183.069 238.648, 176.835 243.106 C 142.318 267.789, 68.537 314, 63.646 314 C 61.843 314, 72.791 281.179, 80.905 262.259 C 92.233 235.845, 107.473 212.389, 132.106 183.453 L 138.451 176 148.268 176 C 176.192 176, 197.512 187.154, 212.868 209.797 C 216.470 215.108, 217.035 216.595, 216.477 219.297 C 211.386 243.968, 202.359 274.496, 193.797 296 C 183.898 320.861, 167.147 352.101, 152.395 373.215 L 147.004 380.930 152.891 385.830 C 161.400 392.911, 165.563 396, 166.594 395.998 C 167.092 395.998, 168.772 391.641, 170.327 386.317 C 176.279 365.934, 188.422 338.749, 200.942 317.778 C 223.060 280.731, 256.432 244.369, 294.500 215.836 C 309.956 204.252, 313.937 201.603, 314.719 202.385 C 315.116 202.783, 315.449 213.096, 315.460 225.304 C 315.474 241.855, 315.021 250.405, 313.680 258.924 C 307.009 301.272, 291.175 336.677, 263.112 372 C 255.259 381.883, 227.182 410.673, 218.516 417.727 L 213.532 421.783 223.439 424.880 C 281.705 443.093, 349.165 436.018, 398.616 406.508 C 446.728 377.797, 483.322 331.466, 497.366 281.481 C 503.381 260.075, 504.480 250.741, 504.491 221 C 504.501 191.997, 503.598 184.047, 497.987 163.732 C 484.768 115.871, 452.505 72.708, 407.718 42.964 C 381.051 25.254, 352.818 14.828, 319.695 10.460 C 305.932 8.645, 273.298 8.695, 259.500 10.552",fillRule:"evenodd"}),e[2]=n):n=e[2];let i;return e[3]!==r?(i=(0,a.jsx)("svg",{"aria-hidden":"true",className:r,fill:"currentColor",viewBox:"0 0 543 446",children:n}),e[3]=r,e[4]=i):i=e[4],i},"Os"),_s="lunora.studio.rulesBannerDismissed",mi=s(()=>{try{return globalThis.localStorage.getItem(_s)==="1"}catch{return!1}},"Zs"),fi=s(()=>{try{globalThis.localStorage.setItem(_s,"1")}catch{}},"Fs"),gi=s(()=>{let t=(0,I.c)(18),e=ge(),[o,r]=(0,O.useState)(hi),n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s(()=>{r(!0),fi()},"o"),t[0]=n):n=t[0];let i=n;if(o)return null;let l;t[1]===Symbol.for("react.memo_cache_sentinel")?(l=(0,a.jsx)("span",{"aria-hidden":"true",className:"text-warning",children:"\u26A0"}),t[1]=l):l=t[1];let c;t[2]!==e?(c=e("Lunora AI rules aren't installed."),t[2]=e,t[3]=c):c=t[3];let p;t[4]===Symbol.for("react.memo_cache_sentinel")?(p=(0,a.jsx)("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-[11px]",children:"lunora rules install"}),t[4]=p):p=t[4];let d;t[5]!==e?(d=e("lets your coding agent use Lunora correctly."),t[5]=e,t[6]=d):d=t[6];let u;t[7]!==c||t[8]!==d?(u=(0,a.jsxs)("span",{children:[c," ",p," ",d]}),t[7]=c,t[8]=d,t[9]=u):u=t[9];let f;t[10]!==e?(f=e("Dismiss"),t[10]=e,t[11]=f):f=t[11];let h;t[12]===Symbol.for("react.memo_cache_sentinel")?(h=(0,a.jsx)("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:(0,a.jsx)("path",{d:"M18 6 6 18M6 6l12 12"})}),t[12]=h):h=t[12];let g;t[13]!==f?(g=(0,a.jsx)("button",{"aria-label":f,className:"ms-auto flex size-5 items-center justify-center rounded text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:bg-accent","data-testid":"dash-app-rules-banner-dismiss",onClick:i,type:"button",children:h}),t[13]=f,t[14]=g):g=t[14];let m;return t[15]!==u||t[16]!==g?(m=(0,a.jsxs)("div",{className:"flex shrink-0 items-center gap-2 border-b border-warning/30 bg-warning/10 px-6 py-2 text-[12px] text-foreground","data-testid":"dash-app-rules-banner",role:"note",children:[l,u,g]}),t[15]=u,t[16]=g,t[17]=m):m=t[17],m},"qs");function hi(){return mi()}s(hi,"Ws");function As(t){let e=(0,I.c)(4),o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=(0,a.jsx)(Me.Root,{"data-slot":"popover",...o}),e[2]=o,e[3]=r):r=e[3],r}s(As,"Ut");function Vs(t){let e=(0,I.c)(4),o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=(0,a.jsx)(Me.Trigger,{"data-slot":"popover-trigger",...o}),e[2]=o,e[3]=r):r=e[3],r}s(Vs,"Kt");function Ls({align:t="end",alignOffset:e=0,className:o,keepMounted:r=!1,side:n="bottom",sideOffset:i=6,...l}){return(0,a.jsx)(Me.Portal,{keepMounted:r,children:(0,a.jsx)(Me.Positioner,{align:t,alignOffset:e,className:"isolate z-50 outline-none",side:n,sideOffset:i,children:(0,a.jsx)(Me.Popup,{className:U("z-50 w-72 origin-(--transform-origin) rounded-lg border border-border bg-popover p-3 text-popover-foreground shadow-md outline-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",o),"data-slot":"popover-content",...l})})})}s(Ls,"Qt");var Fr=768;function vi(){let t=(0,I.c)(2),[e,o]=(0,O.useState)(void 0),r,n;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s(()=>{let i=globalThis.matchMedia(`(max-width: ${Fr-1}px)`),l=s(()=>{o(globalThis.innerWidth<Fr)},"i");return i.addEventListener("change",l),o(globalThis.innerWidth<Fr),()=>{i.removeEventListener("change",l)}},"a"),n=[],t[0]=r,t[1]=n):(r=t[0],n=t[1]),(0,O.useEffect)(r,n),!!e}s(vi,"js");function bi(t){let e=(0,I.c)(4),o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=(0,a.jsx)(ie.Root,{"data-slot":"sheet",...o}),e[2]=o,e[3]=r):r=e[3],r}s(bi,"Gs");function xi(t){let e=(0,I.c)(4),o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=(0,a.jsx)(ie.Portal,{"data-slot":"sheet-portal",...o}),e[2]=o,e[3]=r):r=e[3],r}s(xi,"Us");function yi(t){let e=(0,I.c)(8),o,r;e[0]!==t?({className:o,...r}=t,e[0]=t,e[1]=o,e[2]=r):(o=e[1],r=e[2]);let n;e[3]!==o?(n=U("fixed inset-0 z-50 bg-black/10 text-xs/relaxed transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:",o),e[3]=o,e[4]=n):n=e[4];let i;return e[5]!==r||e[6]!==n?(i=(0,a.jsx)(ie.Backdrop,{"data-slot":"sheet-overlay",className:n,...r}),e[5]=r,e[6]=n,e[7]=i):i=e[7],i}s(yi,"Ks");function Pi({className:t,children:e,side:o="right",showCloseButton:r=!0,...n}){return(0,a.jsxs)(xi,{children:[(0,a.jsx)(yi,{}),(0,a.jsxs)(ie.Popup,{"data-slot":"sheet-content","data-side":o,className:U("fixed z-50 flex flex-col bg-popover bg-clip-padding text-xs/relaxed text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-e data-[side=left]:data-ending-style:translate-x-[-2.5rem] rtl:data-[side=left]:data-ending-style:-translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] rtl:data-[side=left]:data-starting-style:-translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-s data-[side=right]:data-ending-style:translate-x-[2.5rem] rtl:data-[side=right]:data-ending-style:-translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] rtl:data-[side=right]:data-starting-style:-translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",t),...n,children:[e,r&&(0,a.jsxs)(ie.Close,{"data-slot":"sheet-close",render:(0,a.jsx)(Pr,{variant:"ghost",className:"absolute top-3 end-3",size:"icon-sm"}),children:[(0,a.jsx)(yr,{icon:_n,strokeWidth:2}),(0,a.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}s(Pi,"Qs");function Ci(t){let e=(0,I.c)(8),o,r;e[0]!==t?({className:o,...r}=t,e[0]=t,e[1]=o,e[2]=r):(o=e[1],r=e[2]);let n;e[3]!==o?(n=U("flex flex-col gap-0.5 p-4",o),e[3]=o,e[4]=n):n=e[4];let i;return e[5]!==r||e[6]!==n?(i=(0,a.jsx)("div",{"data-slot":"sheet-header",className:n,...r}),e[5]=r,e[6]=n,e[7]=i):i=e[7],i}s(Ci,"Ys");function Si(t){let e=(0,I.c)(8),o,r;e[0]!==t?({className:o,...r}=t,e[0]=t,e[1]=o,e[2]=r):(o=e[1],r=e[2]);let n;e[3]!==o?(n=U("text-sm font-medium text-foreground",o),e[3]=o,e[4]=n):n=e[4];let i;return e[5]!==r||e[6]!==n?(i=(0,a.jsx)(ie.Title,{"data-slot":"sheet-title",className:n,...r}),e[5]=r,e[6]=n,e[7]=i):i=e[7],i}s(Si,"Js");function Ri(t){let e=(0,I.c)(8),o,r;e[0]!==t?({className:o,...r}=t,e[0]=t,e[1]=o,e[2]=r):(o=e[1],r=e[2]);let n;e[3]!==o?(n=U("text-xs/relaxed text-muted-foreground",o),e[3]=o,e[4]=n):n=e[4];let i;return e[5]!==r||e[6]!==n?(i=(0,a.jsx)(ie.Description,{"data-slot":"sheet-description",className:n,...r}),e[5]=r,e[6]=n,e[7]=i):i=e[7],i}s(Ri,"Xs");var Ni="sidebar_state",Ti=3600*24*7,wi="16rem",Ei="18rem",ki="3rem",Oi="b",Hs=xe.createContext(null);function dr(){let t=xe.useContext(Hs);if(!t)throw new fr("INTERNAL","useSidebar must be used within a SidebarProvider.");return t}s(dr,"gt");function Di({defaultOpen:t=!0,open:e,onOpenChange:o,className:r,style:n,children:i,...l}){let c=vi(),[p,d]=xe.useState(!1),[u,f]=xe.useState(t),h=e??u,g=s(b=>{let P=typeof b=="function"?b(h):b;o?o(P):f(P),document.cookie=`${Ni}=${P}; path=/; max-age=${Ti}`},"f"),m=s(()=>c?d(b=>!b):g(b=>!b),"g"),x=xe.useEffectEvent(()=>{m()});xe.useEffect(()=>{let b=s(P=>{P.key===Oi&&(P.metaKey||P.ctrlKey)&&(P.preventDefault(),x())},"p");return globalThis.addEventListener("keydown",b),()=>globalThis.removeEventListener("keydown",b)},[]);let v={state:h?"expanded":"collapsed",open:h,setOpen:g,isMobile:c,openMobile:p,setOpenMobile:d,toggleSidebar:m};return(0,a.jsx)(Hs.Provider,{value:v,children:(0,a.jsx)("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":wi,"--sidebar-width-icon":ki,...n},className:U("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",r),...l,children:i})})}s(Di,"ra");function Mi({side:t="left",variant:e="sidebar",collapsible:o="offcanvas",className:r,children:n,dir:i,...l}){let{isMobile:c,state:p,openMobile:d,setOpenMobile:u}=dr();return o==="none"?(0,a.jsx)("div",{"data-slot":"sidebar",className:U("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",r),...l,children:n}):c?(0,a.jsx)(bi,{open:d,onOpenChange:u,...l,children:(0,a.jsxs)(Pi,{dir:i,"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":Ei},side:t,children:[(0,a.jsxs)(Ci,{className:"sr-only",children:[(0,a.jsx)(Si,{children:"Sidebar"}),(0,a.jsx)(Ri,{children:"Displays the mobile sidebar."})]}),(0,a.jsx)("div",{className:"flex h-full w-full flex-col",children:n})]})}):(0,a.jsxs)("div",{className:"group peer hidden text-sidebar-foreground md:block","data-state":p,"data-collapsible":p==="collapsed"?o:"","data-variant":e,"data-side":t,"data-slot":"sidebar",children:[(0,a.jsx)("div",{"data-slot":"sidebar-gap",className:U("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",e==="floating"||e==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),(0,a.jsx)("div",{"data-slot":"sidebar-container","data-side":t,className:U("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex",e==="floating"||e==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-e group-data-[side=right]:border-s",r),...l,children:(0,a.jsx)("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-none group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border",children:n})})]})}s(Mi,"ia");function Ii(t){let e=(0,I.c)(15),o,r,n;e[0]!==t?({className:o,onClick:r,...n}=t,e[0]=t,e[1]=o,e[2]=r,e[3]=n):(o=e[1],r=e[2],n=e[3]);let{toggleSidebar:i}=dr(),l;e[4]!==o?(l=U(o),e[4]=o,e[5]=l):l=e[5];let c;e[6]!==r||e[7]!==i?(c=s(f=>{r?.(f),i()},"l"),e[6]=r,e[7]=i,e[8]=c):c=e[8];let p,d;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=(0,a.jsx)(yr,{icon:An,strokeWidth:2,className:"rtl:rotate-180"}),d=(0,a.jsx)("span",{className:"sr-only",children:"Toggle Sidebar"}),e[9]=p,e[10]=d):(p=e[9],d=e[10]);let u;return e[11]!==n||e[12]!==l||e[13]!==c?(u=(0,a.jsxs)(Pr,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon-sm",className:l,onClick:c,...n,children:[p,d]}),e[11]=n,e[12]=l,e[13]=c,e[14]=u):u=e[14],u}s(Ii,"la");function _i(t){let e=(0,I.c)(8),o,r;e[0]!==t?({className:o,...r}=t,e[0]=t,e[1]=o,e[2]=r):(o=e[1],r=e[2]);let n;e[3]!==o?(n=U("relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ms-0 md:peer-data-[variant=inset]:rounded-none md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ms-2",o),e[3]=o,e[4]=n):n=e[4];let i;return e[5]!==r||e[6]!==n?(i=(0,a.jsx)("main",{"data-slot":"sidebar-inset",className:n,...r}),e[5]=r,e[6]=n,e[7]=i):i=e[7],i}s(_i,"da");function Ai(t){let e=(0,I.c)(8),o,r;e[0]!==t?({className:o,...r}=t,e[0]=t,e[1]=o,e[2]=r):(o=e[1],r=e[2]);let n;e[3]!==o?(n=U("flex flex-col gap-2 p-2",o),e[3]=o,e[4]=n):n=e[4];let i;return e[5]!==r||e[6]!==n?(i=(0,a.jsx)("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:n,...r}),e[5]=r,e[6]=n,e[7]=i):i=e[7],i}s(Ai,"ca");function Vi(t){let e=(0,I.c)(8),o,r;e[0]!==t?({className:o,...r}=t,e[0]=t,e[1]=o,e[2]=r):(o=e[1],r=e[2]);let n;e[3]!==o?(n=U("flex flex-col gap-2 p-2",o),e[3]=o,e[4]=n):n=e[4];let i;return e[5]!==r||e[6]!==n?(i=(0,a.jsx)("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:n,...r}),e[5]=r,e[6]=n,e[7]=i):i=e[7],i}s(Vi,"ua");function Li(t){let e=(0,I.c)(8),o,r;e[0]!==t?({className:o,...r}=t,e[0]=t,e[1]=o,e[2]=r):(o=e[1],r=e[2]);let n;e[3]!==o?(n=U("flex min-h-0 flex-1 flex-col gap-0 overflow-x-hidden overflow-y-auto [scrollbar-color:color-mix(in_oklch,var(--muted-foreground)_25%,transparent)_transparent] [scrollbar-width:thin] [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-muted-foreground/25 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar]:w-1.5 hover:[scrollbar-color:color-mix(in_oklch,var(--muted-foreground)_50%,transparent)_transparent] hover:[&::-webkit-scrollbar-thumb]:bg-muted-foreground/50",o),e[3]=o,e[4]=n):n=e[4];let i;return e[5]!==r||e[6]!==n?(i=(0,a.jsx)("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:n,...r}),e[5]=r,e[6]=n,e[7]=i):i=e[7],i}s(Li,"fa");function Hi(t){let e=(0,I.c)(8),o,r;e[0]!==t?({className:o,...r}=t,e[0]=t,e[1]=o,e[2]=r):(o=e[1],r=e[2]);let n;e[3]!==o?(n=U("relative flex w-full min-w-0 flex-col p-2",o),e[3]=o,e[4]=n):n=e[4];let i;return e[5]!==r||e[6]!==n?(i=(0,a.jsx)("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:n,...r}),e[5]=r,e[6]=n,e[7]=i):i=e[7],i}s(Hi,"ma");function Bi(t){let e=(0,I.c)(10),o,r,n,i;if(e[0]!==t){let{className:p,render:d,...u}=t;o=d,i=vr,r="div",n=oo({className:U("flex h-8 shrink-0 items-center rounded-none px-2 text-xs text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",p)},u),e[0]=t,e[1]=o,e[2]=r,e[3]=n,e[4]=i}else o=e[1],r=e[2],n=e[3],i=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l={slot:"sidebar-group-label",sidebar:"group-label"},e[5]=l):l=e[5];let c;return e[6]!==o||e[7]!==r||e[8]!==n?(c={defaultTagName:r,props:n,render:o,state:l},e[6]=o,e[7]=r,e[8]=n,e[9]=c):c=e[9],i(c)}s(Bi,"ha");function Fi(t){let e=(0,I.c)(8),o,r;e[0]!==t?({className:o,...r}=t,e[0]=t,e[1]=o,e[2]=r):(o=e[1],r=e[2]);let n;e[3]!==o?(n=U("w-full text-xs",o),e[3]=o,e[4]=n):n=e[4];let i;return e[5]!==r||e[6]!==n?(i=(0,a.jsx)("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:n,...r}),e[5]=r,e[6]=n,e[7]=i):i=e[7],i}s(Fi,"pa");function Ts(t){let e=(0,I.c)(8),o,r;e[0]!==t?({className:o,...r}=t,e[0]=t,e[1]=o,e[2]=r):(o=e[1],r=e[2]);let n;e[3]!==o?(n=U("flex w-full min-w-0 flex-col gap-0",o),e[3]=o,e[4]=n):n=e[4];let i;return e[5]!==r||e[6]!==n?(i=(0,a.jsx)("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:n,...r}),e[5]=r,e[6]=n,e[7]=i):i=e[7],i}s(Ts,"Lt");function ws(t){let e=(0,I.c)(8),o,r;e[0]!==t?({className:o,...r}=t,e[0]=t,e[1]=o,e[2]=r):(o=e[1],r=e[2]);let n;e[3]!==o?(n=U("group/menu-item relative",o),e[3]=o,e[4]=n):n=e[4];let i;return e[5]!==r||e[6]!==n?(i=(0,a.jsx)("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:n,...r}),e[5]=r,e[6]=n,e[7]=i):i=e[7],i}s(ws,"At");var ji=an("peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-none p-2 text-start text-xs ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pe-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]"},size:{default:"h-8 text-xs",sm:"h-7 text-xs",lg:"h-12 text-xs group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Bs({render:t,isActive:e=!1,variant:o="default",size:r="default",tooltip:n,className:i,...l}){let{isMobile:c,state:p}=dr(),d=vr({defaultTagName:"button",props:oo({className:U(ji({variant:o,size:r}),i)},l),render:n?(0,a.jsx)(di,{render:t}):t,state:{slot:"sidebar-menu-button",sidebar:"menu-button",size:r,active:e}});return n?(typeof n=="string"&&(n={children:n}),(0,a.jsxs)(ci,{children:[d,(0,a.jsx)(pi,{side:"right",align:"center",hidden:p!=="collapsed"||c,...n})]})):d}s(Bs,"Jt");var zi=s(t=>t.replace("__lunora_admin__:",""),"ba"),Ki=s(()=>(0,O.useSyncExternalStore)(so.subscribe,so.getSnapshot,so.getSnapshot),"va"),Ui=s(t=>t==="error"?"destructive":t==="pending"?"secondary":"default","xa"),Zi=s(t=>{let e=(0,I.c)(56),{entry:o,focused:r}=t,n=ge(),i;e[0]!==r?(i=s(L=>{L!==null&&r&&L.scrollIntoView({block:"nearest"})},"r"),e[0]=r,e[1]=i):i=e[1];let l=i,c;e[2]!==o.functionPath||e[3]!==o.shardKey||e[4]!==o.summary?(c=s(()=>{Ln(`${o.functionPath} ${o.summary}${o.shardKey===""?"":` (shard ${o.shardKey})`}`)},"l"),e[2]=o.functionPath,e[3]=o.shardKey,e[4]=o.summary,e[5]=c):c=e[5];let p=c,d=r&&"bg-accent ring-1 ring-inset ring-primary/40",u;e[6]!==d?(u=U("border-b border-border/60 last:border-b-0",d),e[6]=d,e[7]=u):u=e[7];let f;e[8]!==o.status?(f=Ui(o.status),e[8]=o.status,e[9]=f):f=e[9];let h=o.status==="pending"?"\u2026":o.status,g;e[10]!==f||e[11]!==h?(g=(0,a.jsx)(Ot,{className:"mt-px shrink-0",variant:f,children:h}),e[10]=f,e[11]=h,e[12]=g):g=e[12];let m;e[13]!==o.functionPath?(m=zi(o.functionPath),e[13]=o.functionPath,e[14]=m):m=e[14];let x;e[15]!==m?(x=(0,a.jsx)("span",{className:"shrink-0 font-mono text-[11px] text-foreground",children:m}),e[15]=m,e[16]=x):x=e[16];let v;e[17]!==o.kind||e[18]!==n?(v=o.kind==="subscription"&&(0,a.jsx)(Ot,{className:"shrink-0",variant:"outline",children:n("live")}),e[17]=o.kind,e[18]=n,e[19]=v):v=e[19];let b;e[20]!==o.summary?(b=o.summary!==""&&(0,a.jsx)("span",{className:"min-w-0 truncate text-muted-foreground",children:o.summary}),e[20]=o.summary,e[21]=b):b=e[21];let P;e[22]!==o.shardKey?(P=o.shardKey!==""&&(0,a.jsx)("span",{className:"font-mono",children:o.shardKey}),e[22]=o.shardKey,e[23]=P):P=e[23];let y;e[24]!==o.resultCount||e[25]!==n?(y=o.resultCount!==void 0&&(0,a.jsx)("span",{children:n("{count} rows",{count:o.resultCount})}),e[24]=o.resultCount,e[25]=n,e[26]=y):y=e[26];let S;e[27]!==o.pushes||e[28]!==n?(S=o.pushes!==void 0&&o.pushes>0&&(0,a.jsx)("span",{children:n("{count} pushes",{count:o.pushes})}),e[27]=o.pushes,e[28]=n,e[29]=S):S=e[29];let C;e[30]!==o.durationMs?(C=o.durationMs!==void 0&&(0,a.jsxs)("span",{children:[o.durationMs,"ms"]}),e[30]=o.durationMs,e[31]=C):C=e[31];let w;e[32]!==n?(w=n("Copy"),e[32]=n,e[33]=w):w=e[33];let R;e[34]!==p||e[35]!==w?(R=(0,a.jsx)("button",{"aria-label":w,className:"rounded px-1 outline-none hover:bg-accent focus-visible:bg-accent","data-testid":"oc-copy",onClick:p,type:"button",children:"\u29C9"}),e[34]=p,e[35]=w,e[36]=R):R=e[36];let T;e[37]!==P||e[38]!==y||e[39]!==S||e[40]!==C||e[41]!==R?(T=(0,a.jsxs)("span",{className:"ms-auto flex shrink-0 items-center gap-2 text-[11px] text-muted-foreground",children:[P,y,S,C,R]}),e[37]=P,e[38]=y,e[39]=S,e[40]=C,e[41]=R,e[42]=T):T=e[42];let E;e[43]!==v||e[44]!==b||e[45]!==T||e[46]!==g||e[47]!==x?(E=(0,a.jsxs)("div",{className:"flex items-start gap-2 px-3 py-1.5 text-xs",children:[g,x,v,b,T]}),e[43]=v,e[44]=b,e[45]=T,e[46]=g,e[47]=x,e[48]=E):E=e[48];let k;e[49]!==o.error?(k=o.error!==void 0&&(0,a.jsx)("p",{className:"px-3 pb-1.5 font-mono text-[11px] text-destructive","data-testid":"oc-error",children:o.error}),e[49]=o.error,e[50]=k):k=e[50];let M;return e[51]!==l||e[52]!==E||e[53]!==k||e[54]!==u?(M=(0,a.jsxs)("li",{className:u,"data-testid":"oc-row",ref:l,children:[E,k]}),e[51]=l,e[52]=E,e[53]=k,e[54]=u,e[55]=M):M=e[55],M},"ya"),Wi=s(t=>{let e=(0,I.c)(62),{focusSeq:o,onClose:r,onShownChange:n,shown:i}=t,l=ge(),c=Ki(),[p,d]=(0,O.useState)(""),u;if(e[0]!==c||e[1]!==o||e[2]!==p||e[3]!==r||e[4]!==n||e[5]!==i||e[6]!==l){let f=p.trim().toLowerCase(),h=c.filter(V=>(i==="errors"?V.status==="error":!0)&&(f===""||`${V.functionPath} ${V.summary} ${V.shardKey}`.toLowerCase().includes(f))).toReversed(),g;e[8]!==c?(g=c.filter(qi),e[8]=c,e[9]=g):g=e[9];let m=g.length,x;e[10]!==l?(x=l("Operation console"),e[10]=l,e[11]=x):x=e[11];let v;e[12]!==l?(v=l("Operation console"),e[12]=l,e[13]=v):v=e[13];let b;e[14]!==v?(b=(0,a.jsx)("span",{className:"text-xs font-medium",children:v}),e[14]=v,e[15]=b):b=e[15];let P;e[16]!==c.length||e[17]!==l?(P=l("{count} calls",{count:c.length}),e[16]=c.length,e[17]=l,e[18]=P):P=e[18];let y;e[19]!==P?(y=(0,a.jsx)(Ot,{variant:"secondary",children:P}),e[19]=P,e[20]=y):y=e[20];let S;e[21]!==m||e[22]!==l?(S=m>0&&(0,a.jsx)(Ot,{variant:"destructive",children:l("{count} failed",{count:m})}),e[21]=m,e[22]=l,e[23]=S):S=e[23];let C=i==="errors",w=i==="errors"&&"bg-accent",R;e[24]!==w?(R=U("rounded px-2 py-0.5 text-xs outline-none hover:bg-accent focus-visible:bg-accent",w),e[24]=w,e[25]=R):R=e[25];let T;e[26]!==n||e[27]!==i?(T=s(()=>{n(i==="errors"?"all":"errors")},"M"),e[26]=n,e[27]=i,e[28]=T):T=e[28];let E;e[29]!==l?(E=l("Errors"),e[29]=l,e[30]=E):E=e[30];let k;e[31]!==R||e[32]!==T||e[33]!==E||e[34]!==C?(k=(0,a.jsx)("button",{"aria-pressed":C,className:R,"data-testid":"oc-filter-errors",onClick:T,type:"button",children:E}),e[31]=R,e[32]=T,e[33]=E,e[34]=C,e[35]=k):k=e[35];let M;e[36]!==l?(M=l("Filter"),e[36]=l,e[37]=M):M=e[37];let L;e[38]===Symbol.for("react.memo_cache_sentinel")?(L=s(V=>{d(V.target.value)},"O"),e[38]=L):L=e[38];let _;e[39]!==l?(_=l("Filter"),e[39]=l,e[40]=_):_=e[40];let j;e[41]!==p||e[42]!==M||e[43]!==_?(j=(0,a.jsx)(br,{"aria-label":M,className:"h-7 w-40 text-xs","data-testid":"oc-search",onChange:L,placeholder:_,value:p}),e[41]=p,e[42]=M,e[43]=_,e[44]=j):j=e[44];let z;e[45]!==l?(z=l("Clear"),e[45]=l,e[46]=z):z=e[46];let H;e[47]!==z?(H=(0,a.jsx)("button",{className:"ms-auto rounded px-2 py-0.5 text-xs text-muted-foreground outline-none hover:bg-accent focus-visible:bg-accent","data-testid":"oc-clear",onClick:$i,type:"button",children:z}),e[47]=z,e[48]=H):H=e[48];let F;e[49]!==l?(F=l("Hide"),e[49]=l,e[50]=F):F=e[50];let Z;e[51]!==r||e[52]!==F?(Z=(0,a.jsx)("button",{"aria-label":F,className:"rounded px-2 py-0.5 text-xs text-muted-foreground outline-none hover:bg-accent focus-visible:bg-accent","data-testid":"oc-close",onClick:r,type:"button",children:"\u2715"}),e[51]=r,e[52]=F,e[53]=Z):Z=e[53];let D;e[54]!==k||e[55]!==j||e[56]!==H||e[57]!==Z||e[58]!==b||e[59]!==y||e[60]!==S?(D=(0,a.jsxs)("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-3 py-1.5",children:[b,y,S,k,j,H,Z]}),e[54]=k,e[55]=j,e[56]=H,e[57]=Z,e[58]=b,e[59]=y,e[60]=S,e[61]=D):D=e[61],u=(0,a.jsxs)("section",{"aria-label":x,className:"flex max-h-80 flex-col border-t border-border bg-card","data-testid":"lunora-operation-console",children:[D,h.length===0?(0,a.jsx)("p",{className:"p-3 text-xs text-muted-foreground","data-testid":"oc-empty",children:l("Every admin call this studio makes is recorded here.")}):(0,a.jsx)("ul",{className:"min-h-0 flex-1 overflow-y-auto","data-testid":"oc-rows",children:h.map(V=>(0,a.jsx)(Zi,{entry:V,focused:V.seq===o},V.seq))})]}),e[0]=c,e[1]=o,e[2]=p,e[3]=r,e[4]=n,e[5]=i,e[6]=l,e[7]=u}else u=e[7];return u},"wa");function qi(t){return t.status==="error"}s(qi,"ka");function $i(){so.clear()}s($i,"Na");var Gi=s(()=>{let t=(0,I.c)(316),e=ge(),o;t[0]!==e?(o=e("Health score"),t[0]=e,t[1]=o):o=t[1];let r;t[2]!==e?(r=e("Agents"),t[2]=e,t[3]=r):r=t[3];let n;t[4]!==e?(n=e("Evals"),t[4]=e,t[5]=n):n=t[5];let i;t[6]!==e?(i=e("Analytics"),t[6]=e,t[7]=i):i=t[7];let l;t[8]!==e?(l=e("API"),t[8]=e,t[9]=l):l=t[9];let c;t[10]!==e?(c=e("Audit"),t[10]=e,t[11]=c):c=t[11];let p;t[12]!==e?(p=e("Auth audit"),t[12]=e,t[13]=p):p=t[13];let d;t[14]!==e?(d=e("Configuration"),t[14]=e,t[15]=d):d=t[15];let u;t[16]!==e?(u=e("Sessions"),t[16]=e,t[17]=u):u=t[17];let f;t[18]!==e?(f=e("Containers"),t[18]=e,t[19]=f):f=t[19];let h;t[20]!==e?(h=e("Dashboards"),t[20]=e,t[21]=h):h=t[21];let g;t[22]!==e?(g=e("Data"),t[22]=e,t[23]=g):g=t[23];let m;t[24]!==e?(m=e("Deployment health"),t[24]=e,t[25]=m):m=t[25];let x;t[26]!==e?(x=e("Log drains"),t[26]=e,t[27]=x):x=t[27];let v;t[28]!==e?(v=e("Export / Import"),t[28]=e,t[29]=v):v=t[29];let b;t[30]!==e?(b=e("Fan-out"),t[30]=e,t[31]=b):b=t[31];let P;t[32]!==e?(P=e("Files"),t[32]=e,t[33]=P):P=t[33];let y;t[34]!==e?(y=e("Flags"),t[34]=e,t[35]=y):y=t[35];let S;t[36]!==e?(S=e("Functions"),t[36]=e,t[37]=S):S=t[37];let C;t[38]!==e?(C=e("Health"),t[38]=e,t[39]=C):C=t[39];let w;t[40]!==e?(w=e("Home"),t[40]=e,t[41]=w):w=t[41];let R;t[42]!==e?(R=e("Performance"),t[42]=e,t[43]=R):R=t[43];let T;t[44]!==e?(T=e("Issues"),t[44]=e,t[45]=T):T=t[45];let E;t[46]!==e?(E=e("KV"),t[46]=e,t[47]=E):E=t[47];let k;t[48]!==e?(k=e("Logs"),t[48]=e,t[49]=k):k=t[49];let M;t[50]!==e?(M=e("Metrics"),t[50]=e,t[51]=M):M=t[51];let L;t[52]!==e?(L=e("Migrations"),t[52]=e,t[53]=L):L=t[53];let _;t[54]!==e?(_=e("Notifications"),t[54]=e,t[55]=_):_=t[55];let j;t[56]!==e?(j=e("Organizations"),t[56]=e,t[57]=j):j=t[57];let z;t[58]!==e?(z=e("Time Travel"),t[58]=e,t[59]=z):z=t[59];let H;t[60]!==e?(H=e("Mail"),t[60]=e,t[61]=H):H=t[61];let F;t[62]!==e?(F=e("Payments"),t[62]=e,t[63]=F):F=t[63];let Z;t[64]!==e?(Z=e("Permissions"),t[64]=e,t[65]=Z):Z=t[65];let D;t[66]!==e?(D=e("Queues"),t[66]=e,t[67]=D):D=t[67];let V;t[68]!==e?(V=e("Reactors"),t[68]=e,t[69]=V):V=t[69];let q;t[70]!==e?(q=e("Realtime"),t[70]=e,t[71]=q):q=t[71];let G;t[72]!==e?(G=e("RLS Policies"),t[72]=e,t[73]=G):G=t[73];let ee;t[74]!==e?(ee=e("Scheduled"),t[74]=e,t[75]=ee):ee=t[75];let ae;t[76]!==e?(ae=e("Schema"),t[76]=e,t[77]=ae):ae=t[77];let te;t[78]!==e?(te=e("Security"),t[78]=e,t[79]=te):te=t[79];let X;t[80]!==e?(X=e("Settings"),t[80]=e,t[81]=X):X=t[81];let $;t[82]!==e?($=e("SQL editor"),t[82]=e,t[83]=$):$=t[83];let le;t[84]!==e?(le=e("Traces"),t[84]=e,t[85]=le):le=t[85];let ce;t[86]!==e?(ce=e("Access Rules"),t[86]=e,t[87]=ce):ce=t[87];let de;t[88]!==e?(de=e("Users"),t[88]=e,t[89]=de):de=t[89];let he;t[90]!==e?(he=e("Vectors"),t[90]=e,t[91]=he):he=t[91];let pe;t[92]!==e?(pe=e("Workflows"),t[92]=e,t[93]=pe):pe=t[93];let W;t[94]!==o||t[95]!==r||t[96]!==h||t[97]!==g||t[98]!==m||t[99]!==x||t[100]!==v||t[101]!==b||t[102]!==P||t[103]!==y||t[104]!==S||t[105]!==C||t[106]!==n||t[107]!==w||t[108]!==R||t[109]!==T||t[110]!==E||t[111]!==k||t[112]!==M||t[113]!==L||t[114]!==_||t[115]!==j||t[116]!==z||t[117]!==i||t[118]!==H||t[119]!==F||t[120]!==Z||t[121]!==D||t[122]!==V||t[123]!==q||t[124]!==G||t[125]!==ee||t[126]!==ae||t[127]!==te||t[128]!==l||t[129]!==X||t[130]!==$||t[131]!==le||t[132]!==ce||t[133]!==de||t[134]!==he||t[135]!==pe||t[136]!==c||t[137]!==p||t[138]!==d||t[139]!==u||t[140]!==f?(W={advisorHealth:o,agents:r,evals:n,analytics:i,api:l,audit:c,authAudit:p,authConfig:d,authSessions:u,containers:f,dashboards:h,data:g,deploymentHealth:m,drains:x,export:v,fanout:b,files:P,flags:y,functions:S,health:C,home:w,insights:R,issues:T,kv:E,logs:k,metrics:M,migrations:L,notifications:_,organizations:j,pitr:z,mail:H,payments:F,permissions:Z,queues:D,reactors:V,realtime:q,rls:G,schedule:ee,schema:ae,security:te,settings:X,sql:$,traces:le,storageRules:ce,users:de,vectors:he,workflows:pe},t[94]=o,t[95]=r,t[96]=h,t[97]=g,t[98]=m,t[99]=x,t[100]=v,t[101]=b,t[102]=P,t[103]=y,t[104]=S,t[105]=C,t[106]=n,t[107]=w,t[108]=R,t[109]=T,t[110]=E,t[111]=k,t[112]=M,t[113]=L,t[114]=_,t[115]=j,t[116]=z,t[117]=i,t[118]=H,t[119]=F,t[120]=Z,t[121]=D,t[122]=V,t[123]=q,t[124]=G,t[125]=ee,t[126]=ae,t[127]=te,t[128]=l,t[129]=X,t[130]=$,t[131]=le,t[132]=ce,t[133]=de,t[134]=he,t[135]=pe,t[136]=c,t[137]=p,t[138]=d,t[139]=u,t[140]=f,t[141]=W):W=t[141];let fe=W,ue;t[142]!==e?(ue=e("Advisors"),t[142]=e,t[143]=ue):ue=t[143];let Ce;t[144]!==e?(Ce=e("Auth"),t[144]=e,t[145]=Ce):Ce=t[145];let be;t[146]!==e?(be=e("Database"),t[146]=e,t[147]=be):be=t[147];let we;t[148]!==e?(we=e("Functions"),t[148]=e,t[149]=we):we=t[149];let Se;t[150]!==e?(Se=e("Observability"),t[150]=e,t[151]=Se):Se=t[151];let Re;t[152]!==e?(Re=e("Operations"),t[152]=e,t[153]=Re):Re=t[153];let _e;t[154]!==e?(_e=e("Overview"),t[154]=e,t[155]=_e):_e=t[155];let Ae;t[156]!==e?(Ae=e("Settings"),t[156]=e,t[157]=Ae):Ae=t[157];let Ve;t[158]!==e?(Ve=e("Storage"),t[158]=e,t[159]=Ve):Ve=t[159];let vo;t[160]!==ue||t[161]!==Ce||t[162]!==be||t[163]!==we||t[164]!==Se||t[165]!==Re||t[166]!==_e||t[167]!==Ae||t[168]!==Ve?(vo={advisors:ue,auth:Ce,database:be,functions:we,observability:Se,operations:Re,overview:_e,settings:Ae,storage:Ve},t[160]=ue,t[161]=Ce,t[162]=be,t[163]=we,t[164]=Se,t[165]=Re,t[166]=_e,t[167]=Ae,t[168]=Ve,t[169]=vo):vo=t[169];let pr=vo,Le;t[170]!==e?(Le=e("Score your app's advisor findings: a grade, the coverage split, and every procedure ranked worst-first."),t[170]=e,t[171]=Le):Le=t[171];let He;t[172]!==e?(He=e("Inspect agent threads, message timelines, tool calls, and token usage."),t[172]=e,t[173]=He):He=t[173];let Be;t[174]!==e?(Be=e("Scores recorded by recordEvaluation \u2014 the latest verdict per eval, its trend, and the graded runs behind it."),t[174]=e,t[175]=Be):Be=t[175];let Fe;t[176]!==e?(Fe=e("Usage and latency from Analytics Engine \u2014 request volume, p50/p95, and hot shards."),t[176]=e,t[177]=Fe):Fe=t[177];let je;t[178]!==e?(je=e("Interactive OpenAPI reference and copy-paste snippets for your functions."),t[178]=e,t[179]=je):je=t[179];let ze;t[180]!==e?(ze=e("A durable log of admin state-changing operations."),t[180]=e,t[181]=ze):ze=t[181];let Ke;t[182]!==e?(Ke=e("Authentication and security events \u2014 sign-ins, MFA, and session changes."),t[182]=e,t[183]=Ke):Ke=t[183];let Ue;t[184]!==e?(Ue=e("Enabled plugins and session config (read-only)."),t[184]=e,t[185]=Ue):Ue=t[185];let Ze;t[186]!==e?(Ze=e("Browse and revoke active sessions across all users."),t[186]=e,t[187]=Ze):Ze=t[187];let We;t[188]!==e?(We=e("Live Cloudflare Containers \u2014 current lifecycle state per instance from the log stream."),t[188]=e,t[189]=We):We=t[189];let qe;t[190]!==e?(qe=e("Chart widgets backed by saved read-only SQL queries."),t[190]=e,t[191]=qe):qe=t[191];let $e;t[192]!==e?($e=e("Browse and edit rows across your shard and global tables."),t[192]=e,t[193]=$e):$e=t[193];let Ge;t[194]!==e?(Ge=e("Live liveness, readiness, and per-binding health from the deployment's /_lunora/health endpoint."),t[194]=e,t[195]=Ge):Ge=t[195];let Qe;t[196]!==e?(Qe=e("Forward logs to Logpush, Tail Workers, or a webhook collector."),t[196]=e,t[197]=Qe):Qe=t[197];let Ye;t[198]!==e?(Ye=e("Export a shard to NDJSON, or import rows from it."),t[198]=e,t[199]=Ye):Ye=t[199];let Je;t[200]!==e?(Je=e("Realtime fan-out cost and per-topic subscriber counts for this shard."),t[200]=e,t[201]=Je):Je=t[201];let Xe;t[202]!==e?(Xe=e("Browse objects in your R2 storage buckets."),t[202]=e,t[203]=Xe):Xe=t[203];let et;t[204]!==e?(et=e("Inspect feature flags and their live evaluation under a targeting context."),t[204]=e,t[205]=et):et=t[205];let tt;t[206]!==e?(tt=e("Run registered queries, mutations, and actions."),t[206]=e,t[207]=tt):tt=t[207];let ot;t[208]!==e?(ot=e("At-a-glance connection, error, and shard signals."),t[208]=e,t[209]=ot):ot=t[209];let rt;t[210]!==e?(rt=e("Connection, health, and advisor summary for your deployment."),t[210]=e,t[211]=rt):rt=t[211];let nt;t[212]!==e?(nt=e("Surface slow functions, error spikes, and cache problems."),t[212]=e,t[213]=nt):nt=t[213];let at;t[214]!==e?(at=e("Grouped error triage \u2014 Worker throws and container crashes folded by fingerprint."),t[214]=e,t[215]=at):at=t[215];let st;t[216]!==e?(st=e("A live stream of recent function logs."),t[216]=e,t[217]=st):st=t[217];let it;t[218]!==e?(it=e("Per-shard health and aggregate metrics."),t[218]=e,t[219]=it):it=t[219];let lt;t[220]!==e?(lt=e("Review migration status and run them."),t[220]=e,t[221]=lt):lt=t[221];let ct;t[222]!==e?(ct=e("Registered push devices \u2014 endpoint, kind, last-send status, and delivery errors."),t[222]=e,t[223]=ct):ct=t[223];let dt;t[224]!==e?(dt=e("Browse and manage organizations, members, and invitations."),t[224]=e,t[225]=dt):dt=t[225];let pt;t[226]!==e?(pt=e("Restore a shard to a point in the last 30 days."),t[226]=e,t[227]=pt):pt=t[227];let ut;t[228]!==e?(ut=e("Email your app sent, captured in dev."),t[228]=e,t[229]=ut):ut=t[229];let mt;t[230]!==e?(mt=e("Synced customers, subscriptions, and webhook events."),t[230]=e,t[231]=mt):mt=t[231];let ft;t[232]!==e?(ft=e("Inspect access policies per table, and probe a function as any identity."),t[232]=e,t[233]=ft):ft=t[233];let gt;t[234]!==e?(gt=e("Inspect declared Cloudflare Queues \u2014 their producer bindings, consumer mode, and dead-letter queue."),t[234]=e,t[235]=gt):gt=t[235];let ht;t[236]!==e?(ht=e("Server-side onQueryChange reactors: what has run, what was suppressed, and what is failing."),t[236]=e,t[237]=ht):ht=t[237];let vt;t[238]!==e?(vt=e("Active WebSocket subscriptions on this shard."),t[238]=e,t[239]=vt):vt=t[239];let bt;t[240]!==e?(bt=e("Inspect row-level-security policies and roles, per table."),t[240]=e,t[241]=bt):bt=t[241];let xt;t[242]!==e?(xt=e("Inspect and cancel scheduled jobs."),t[242]=e,t[243]=xt):xt=t[243];let yt;t[244]!==e?(yt=e("Inspect each table and its columns."),t[244]=e,t[245]=yt):yt=t[245];let Pt;t[246]!==e?(Pt=e("Review admin gates, credentials, and log redaction."),t[246]=e,t[247]=Pt):Pt=t[247];let Ct;t[248]!==e?(Ct=e("Read-only deployment config \u2014 vars, secrets, and bindings."),t[248]=e,t[249]=Ct):Ct=t[249];let St;t[250]!==e?(St=e("Run read-only SQL against a shard."),t[250]=e,t[251]=St):St=t[251];let Rt;t[252]!==e?(Rt=e("Browse and edit key-value pairs in your Workers KV namespaces."),t[252]=e,t[253]=Rt):Rt=t[253];let Nt;t[254]!==e?(Nt=e("Inspect storage access rules \u2014 per bucket, operation, and key prefix."),t[254]=e,t[255]=Nt):Nt=t[255];let Tt;t[256]!==e?(Tt=e("Recent ctx.trace waterfalls for this shard \u2014 the drill-down from a log line."),t[256]=e,t[257]=Tt):Tt=t[257];let wt;t[258]!==e?(wt=e("Manage auth users \u2014 roles, bans, sessions, and identity."),t[258]=e,t[259]=wt):wt=t[259];let Et;t[260]!==e?(Et=e("Browse Vectorize indexes and run similarity searches."),t[260]=e,t[261]=Et):Et=t[261];let kt;t[262]!==e?(kt=e("Inspect declared Cloudflare Workflows and their bindings."),t[262]=e,t[263]=kt):kt=t[263];let bo;t[264]!==Nt||t[265]!==Tt||t[266]!==wt||t[267]!==Et||t[268]!==kt||t[269]!==Le||t[270]!==He||t[271]!==Be||t[272]!==Fe||t[273]!==je||t[274]!==ze||t[275]!==Ke||t[276]!==Ue||t[277]!==Ze||t[278]!==We||t[279]!==qe||t[280]!==$e||t[281]!==Ge||t[282]!==Qe||t[283]!==Ye||t[284]!==Je||t[285]!==Xe||t[286]!==et||t[287]!==tt||t[288]!==ot||t[289]!==rt||t[290]!==nt||t[291]!==at||t[292]!==st||t[293]!==it||t[294]!==lt||t[295]!==ct||t[296]!==dt||t[297]!==pt||t[298]!==ut||t[299]!==mt||t[300]!==ft||t[301]!==gt||t[302]!==ht||t[303]!==vt||t[304]!==bt||t[305]!==xt||t[306]!==yt||t[307]!==Pt||t[308]!==Ct||t[309]!==St||t[310]!==Rt?(bo={advisorHealth:Le,agents:He,evals:Be,analytics:Fe,api:je,audit:ze,authAudit:Ke,authConfig:Ue,authSessions:Ze,containers:We,dashboards:qe,data:$e,deploymentHealth:Ge,drains:Qe,export:Ye,fanout:Je,files:Xe,flags:et,functions:tt,health:ot,home:rt,insights:nt,issues:at,logs:st,metrics:it,migrations:lt,notifications:ct,organizations:dt,pitr:pt,mail:ut,payments:mt,permissions:ft,queues:gt,reactors:ht,realtime:vt,rls:bt,schedule:xt,schema:yt,security:Pt,settings:Ct,sql:St,kv:Rt,storageRules:Nt,traces:Tt,users:wt,vectors:Et,workflows:kt},t[264]=Nt,t[265]=Tt,t[266]=wt,t[267]=Et,t[268]=kt,t[269]=Le,t[270]=He,t[271]=Be,t[272]=Fe,t[273]=je,t[274]=ze,t[275]=Ke,t[276]=Ue,t[277]=Ze,t[278]=We,t[279]=qe,t[280]=$e,t[281]=Ge,t[282]=Qe,t[283]=Ye,t[284]=Je,t[285]=Xe,t[286]=et,t[287]=tt,t[288]=ot,t[289]=rt,t[290]=nt,t[291]=at,t[292]=st,t[293]=it,t[294]=lt,t[295]=ct,t[296]=dt,t[297]=pt,t[298]=ut,t[299]=mt,t[300]=ft,t[301]=gt,t[302]=ht,t[303]=vt,t[304]=bt,t[305]=xt,t[306]=yt,t[307]=Pt,t[308]=Ct,t[309]=St,t[310]=Rt,t[311]=bo):bo=t[311];let ur=bo,xo;return t[312]!==pr||t[313]!==ur||t[314]!==fe?(xo={groupLabel:pr,tabDescription:ur,tabLabel:fe},t[312]=pr,t[313]=ur,t[314]=fe,t[315]=xo):xo=t[315],xo},"Ma"),Qi=s(()=>{let t=(0,I.c)(1),e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsxs)("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:[(0,a.jsx)("rect",{height:"14",rx:"2",width:"20",x:"2",y:"3"}),(0,a.jsx)("path",{d:"M8 21h8M12 17v4"})]}),t[0]=e):e=t[0],e},"Sa"),Yi=s(()=>{let t=(0,I.c)(1),e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsxs)("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:[(0,a.jsx)("circle",{cx:"12",cy:"12",r:"4"}),(0,a.jsx)("path",{d:"M12 2v2m0 16v2M4.9 4.9l1.4 1.4m11.4 11.4 1.4 1.4M2 12h2m16 0h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"})]}),t[0]=e):e=t[0],e},"Ca"),Ji=s(()=>{let t=(0,I.c)(1),e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:(0,a.jsx)("path",{d:"M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8Z"})}),t[0]=e):e=t[0],e},"Pa"),Xi=[{Icon:Qi,value:"system"},{Icon:Yi,value:"light"},{Icon:Ji,value:"dark"}],el=s(()=>{let t=(0,I.c)(19),{theme:e,setTheme:o}=li(),r=ge(),n;t[0]!==r?(n=r("Dark theme"),t[0]=r,t[1]=n):n=t[1];let i;t[2]!==r?(i=r("Light theme"),t[2]=r,t[3]=i):i=t[3];let l;t[4]!==r?(l=r("System theme"),t[4]=r,t[5]=l):l=t[5];let c;t[6]!==n||t[7]!==i||t[8]!==l?(c={dark:n,light:i,system:l},t[6]=n,t[7]=i,t[8]=l,t[9]=c):c=t[9];let p=c,d;t[10]!==r?(d=r("Theme"),t[10]=r,t[11]=d):d=t[11];let u;t[12]!==p||t[13]!==o||t[14]!==e?(u=Xi.map(h=>{let{Icon:g,value:m}=h,x=e===m;return(0,a.jsxs)("button",{"aria-checked":x,"aria-label":p[m],className:U("relative flex size-7 cursor-pointer items-center justify-center rounded-md outline-none transition-colors focus-visible:bg-accent",x?"text-foreground":"text-muted-foreground hover:text-foreground"),"data-testid":`dash-app-theme-${m}`,onClick:s(()=>{o(m)},"onClick"),role:"radio",title:p[m],type:"button",children:[x&&(0,a.jsx)(Hn.span,{className:"absolute inset-0 rounded-md border border-muted-foreground/40 bg-background/40",layoutId:"studio-theme-active",transition:{bounce:.1,duration:.45,type:"spring"}}),(0,a.jsx)("span",{className:"relative",children:(0,a.jsx)(g,{})})]},m)}),t[12]=p,t[13]=o,t[14]=e,t[15]=u):u=t[15];let f;return t[16]!==d||t[17]!==u?(f=(0,a.jsx)("div",{"aria-label":d,className:"inline-flex items-center gap-0.5 overflow-hidden rounded-md border border-border bg-muted/60 p-0.5","data-testid":"dash-app-theme",role:"radiogroup",children:u}),t[16]=d,t[17]=u,t[18]=f):f=t[18],f},"Ta"),tl=s(t=>{let e=(0,I.c)(23),{domain:o,onOpenCommandPalette:r,page:n}=t,i=ge(),l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=(0,a.jsx)(Ii,{className:"-ms-1"}),e[0]=l):l=e[0];let c;e[1]!==i?(c=i("Breadcrumb"),e[1]=i,e[2]=c):c=e[2];let p;e[3]!==o?(p=(0,a.jsx)("span",{className:"text-muted-foreground",children:o}),e[3]=o,e[4]=p):p=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=(0,a.jsx)("svg",{"aria-hidden":"true",className:"size-3.5 text-muted-foreground/60",fill:"none",stroke:"currentColor",strokeWidth:1.7,viewBox:"0 0 24 24",children:(0,a.jsx)("path",{d:"m9 6 6 6-6 6",strokeLinecap:"round",strokeLinejoin:"round"})}),e[5]=d):d=e[5];let u;e[6]!==n?(u=(0,a.jsx)("span",{className:"font-medium text-foreground",children:n}),e[6]=n,e[7]=u):u=e[7];let f;e[8]!==c||e[9]!==p||e[10]!==u?(f=(0,a.jsxs)("nav",{"aria-label":c,className:"flex items-center gap-1.5 text-[13px]",children:[p,d,u]}),e[8]=c,e[9]=p,e[10]=u,e[11]=f):f=e[11];let h;e[12]===Symbol.for("react.memo_cache_sentinel")?(h=(0,a.jsxs)("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeWidth:1.8,viewBox:"0 0 24 24",children:[(0,a.jsx)("circle",{cx:"11",cy:"11",r:"7"}),(0,a.jsx)("path",{d:"m21 21-4.3-4.3",strokeLinecap:"round"})]}),e[12]=h):h=e[12];let g;e[13]!==i?(g=i("Search\u2026"),e[13]=i,e[14]=g):g=e[14];let m;e[15]===Symbol.for("react.memo_cache_sentinel")?(m=(0,a.jsx)("kbd",{className:"ms-auto rounded border border-border bg-background px-1 font-sans text-[10px] text-muted-foreground",children:"\u2318K"}),e[15]=m):m=e[15];let x;e[16]!==r||e[17]!==g?(x=(0,a.jsxs)("button",{className:"mx-auto hidden h-8 w-72 items-center gap-2 rounded-lg border border-border bg-muted/40 px-3 text-xs text-muted-foreground transition-colors hover:bg-muted md:flex","data-testid":"dash-app-search",onClick:r,type:"button",children:[h,g,m]}),e[16]=r,e[17]=g,e[18]=x):x=e[18];let v;e[19]===Symbol.for("react.memo_cache_sentinel")?(v=(0,a.jsx)("div",{className:"ms-auto flex items-center gap-1.5 md:ms-0",children:(0,a.jsx)(el,{})}),e[19]=v):v=e[19];let b;return e[20]!==x||e[21]!==f?(b=(0,a.jsxs)("header",{className:"flex h-11 shrink-0 items-center gap-2 border-b border-border px-4","data-testid":"dash-app-header",children:[l,f,x,v]}),e[20]=x,e[21]=f,e[22]=b):b=e[22],b},"La"),ol={agents:{capability:"agents"},analytics:{capability:"analytics",feature:"analytics"},authAudit:{feature:"auth"},authConfig:{feature:"auth"},authSessions:{feature:"auth"},containers:{capability:"containers",feature:"containers"},fanout:{capability:"crossShardFanout"},files:{capability:"objectStorage",feature:"storage"},flags:{feature:"flags"},kv:{capability:"keyValueStore",feature:"kv"},mail:{capability:"mail",feature:"mail"},notifications:{feature:"notifications"},organizations:{feature:"auth"},payments:{feature:"payments"},pitr:{capability:"pointInTimeRecovery"},queues:{capability:"queues",feature:"queues"},reactors:{capability:"serverReactors"},schedule:{capability:"scheduler",feature:"scheduler"},storageRules:{feature:"storage"},users:{feature:"auth"},vectors:{capability:"vectorStore",feature:"vectors"},workflows:{capability:"workflows",feature:"workflows"}},rl={agents:"Durable agents",analytics:"Analytics",containers:"Containers",crossShardFanout:"Cross-shard fan-out",keyValueStore:"Key-value storage",mail:"Mail delivery",objectStorage:"Object storage",pointInTimeRecovery:"Point-in-time recovery",queues:"Queues",scheduler:"Scheduling",serverReactors:"Server reactors",vectorStore:"Vector search",workflows:"Workflows"},nl={kind:"hidden"},Es={kind:"ok"},al={kind:"pending"},Fs=s((t,e,o)=>{let r=ol[t];return r?.feature!==void 0&&!e[r.feature]?nl:r?.capability===void 0?Es:e.settled?e.platform?.unsupported.includes(r.capability)===!0?{kind:"unavailable",reason:o("{capability} is not supported on {platform}.",{capability:o(rl[r.capability]),platform:e.platform.name})}:Es:al},"Xt"),sl=s((t,e,o)=>{let r={},n=[];for(let i of t){let l=[];for(let c of i.tabs){let p=Fs(c,e,o);p.kind!=="hidden"&&l.push(c),p.kind==="unavailable"&&(r[c]=p.reason)}l.length>0&&n.push({...i,tabs:l})}return{unavailable:r,visibleGroups:n}},"$a"),il=s(t=>{let e=(0,I.c)(3),{reason:o,title:r}=t,n;return e[0]!==o||e[1]!==r?(n=(0,a.jsx)(Vn,{description:o,testId:"dash-unsupported",title:r}),e[0]=o,e[1]=r,e[2]=n):n=e[2],n},"Ha"),ll=s(t=>{let e=(0,I.c)(4),{console:o}=zo(),r,n;e[0]!==o||e[1]!==t?(r=s(()=>{if(t===void 0)return;let i=s(l=>{if(!l.ctrlKey||l.metaKey||l.altKey||l.shiftKey||l.repeat||l.key.toLowerCase()!==o)return;let{target:c}=l;c instanceof HTMLElement&&(c.isContentEditable||["INPUT","SELECT","TEXTAREA"].includes(c.tagName))||(l.preventDefault(),t())},"r");return globalThis.addEventListener("keydown",i),()=>{globalThis.removeEventListener("keydown",i)}},"a"),n=[o,t],e[0]=o,e[1]=t,e[2]=r,e[3]=n):(r=e[2],n=e[3]),(0,O.useEffect)(r,n)},"Ba"),J=s((t,e)=>(0,O.lazy)(()=>t().then(o=>({default:o[e]}))),"R"),cl=J(()=>import("./chunk-ELWVLXCM.js"),"InsightsPanel"),dl=(0,O.lazy)(()=>import("./chunk-23SFT2CI.js")),pl=(0,O.lazy)(()=>import("./chunk-A3G6E5U2.js")),ul=(0,O.lazy)(()=>import("./chunk-7BJGFDVG.js")),ml=(0,O.lazy)(()=>import("./chunk-O6AGWZVF.js")),fl=J(()=>import("./chunk-2QSGCPIS.js"),"AnalyticsPanel"),gl=(0,O.lazy)(()=>import("./chunk-WYI7FXBH.js")),hl=(0,O.lazy)(()=>import("./chunk-HGP7GH2M.js")),vl=(0,O.lazy)(()=>import("./chunk-56GQRRBV.js")),bl=(0,O.lazy)(()=>import("./chunk-JTAVWGVE.js")),xl=(0,O.lazy)(()=>import("./chunk-57XP5MZR.js")),yl=J(()=>import("./chunk-L5XAH44R.js"),"UsersPanel"),Pl=(0,O.lazy)(()=>import("./chunk-IGPZHAPG.js")),Cl=J(()=>import("./chunk-57L2DM4H.js"),"DeploymentHealthPanel"),Sl=J(()=>import("./chunk-N3CF7TGX.js"),"TableEditor"),Rl=J(()=>import("./chunk-2V35H4JV.js"),"ExportImportPanel"),Nl=(0,O.lazy)(()=>import("./chunk-T7QKUVSO.js")),Tl={data:jn,migrations:zn},wl=J(()=>import("./chunk-RRYVQMU5.js"),"PitrPanel"),El=(0,O.lazy)(()=>import("./chunk-X32ZF36V.js")),kl=(0,O.lazy)(()=>import("./chunk-NOCFO4AL.js")),Ol=J(()=>import("./chunk-SSPIY6CR.js"),"FunctionRunner"),Dl=J(()=>import("./chunk-DAFY42M2.js"),"FunctionStatsPanel"),Ml=(0,O.lazy)(()=>import("./chunk-SI7I47IC.js")),Il=J(()=>import("./chunk-RBWXVBJ2.js"),"AuditPanel"),_l=(0,O.lazy)(()=>import("./chunk-3EYROC6C.js")),Al=(0,O.lazy)(()=>import("./chunk-VEDBBYTH.js").then(t=>({default:t.LogsPanel}))),Vl=J(()=>import("./chunk-YKW7BL5H.js"),"MailPanel"),Ll=J(()=>import("./chunk-SXDNBAX2.js"),"SchedulePanel"),Hl=(0,O.lazy)(()=>import("./chunk-CBTT4FMH.js")),Bl=(0,O.lazy)(()=>import("./chunk-PPKKM57M.js")),Fl=J(()=>import("./chunk-C2WGWVPO.js"),"KvBrowser"),jl=(0,O.lazy)(()=>import("./chunk-USB6LW3F.js")),zl=J(()=>import("./chunk-AZ4CIFUE.js"),"PaymentsPanel"),Kl=J(()=>import("./chunk-MZ3WS2FG.js"),"PermissionsPanel"),Ul=(0,O.lazy)(()=>import("./chunk-TVCRAKIF.js")),Zl=(0,O.lazy)(()=>import("./chunk-T6GZ5GL5.js")),Wl=(0,O.lazy)(()=>import("./chunk-GCHHYR6O.js")),ql=J(()=>import("./chunk-D3GIXGIJ.js"),"HealthPanel"),$l=J(()=>import("./chunk-N2WM74AE.js"),"MetricsPanel"),Gl=J(()=>import("./chunk-U7KL6DNA.js"),"SchemaViewer"),Ql=J(()=>import("./chunk-4PBNO4Q3.js"),"SettingsPanel"),Yl=J(()=>import("./chunk-S2MXXVBU.js"),"SqlEditorPanel"),Jl=J(()=>import("./chunk-DTTTM3CW.js"),"FileBrowser"),Xl=(0,O.lazy)(()=>import("./chunk-53KDWFYV.js")),ec=(0,O.lazy)(()=>import("./chunk-KCEEZ6OU.js")),tc=(0,O.lazy)(()=>import("./chunk-KDR232YC.js")),oc=J(()=>import("./chunk-F2RMCBTB.js"),"VectorBrowser"),rc=(0,O.lazy)(()=>import("./chunk-TKKZSWPP.js")),js=(0,O.createContext)(null),nc={analytics:(0,a.jsx)("path",{d:"M5 20V10m6.5 10V4M18 20v-7M3 20h18"}),api:(0,a.jsx)("path",{d:"m9 8-4 4 4 4m6-8 4 4-4 4M13 5l-2 14"}),audit:(0,a.jsx)("path",{d:"M7 4h7l4 4v11a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1Zm6 0v5h5M9 13h6M9 16h6M9 10h2"}),authAudit:(0,a.jsx)("path",{d:"M12 3 5 6v5c0 4.5 3 7.8 7 9 4-1.2 7-4.5 7-9V6l-7-3Zm-3 8h6m-6 3h6"}),authConfig:(0,a.jsx)("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm7.4-3a7.4 7.4 0 0 0-.1-1.2l2-1.6-2-3.4-2.4 1a7.3 7.3 0 0 0-2-1.2l-.4-2.6h-3.6l-.4 2.6a7.3 7.3 0 0 0-2 1.2l-2.4-1-2 3.4 2 1.6a7.4 7.4 0 0 0 0 2.4l-2 1.6 2 3.4 2.4-1a7.3 7.3 0 0 0 2 1.2l.4 2.6h3.6l.4-2.6a7.3 7.3 0 0 0 2-1.2l2.4 1 2-3.4-2-1.6a7.4 7.4 0 0 0 .1-1.2Z"}),agents:(0,a.jsx)("path",{d:"M12 8V5m0 0a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM6 8h12a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-6a2 2 0 0 1 2-2Zm3 5h.01M15 13h.01M9 21h6"}),authSessions:(0,a.jsx)("path",{d:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm0-13.5V12l4 2"}),containers:(0,a.jsx)("path",{d:"M3 7.5 12 3l9 4.5v9L12 21l-9-4.5v-9Zm0 0 9 4.5m0 0 9-4.5m-9 4.5V21"}),dashboards:(0,a.jsx)("path",{d:"M4 5h7v6H4V5Zm9 0h7v4h-7V5ZM4 14h7v5H4v-5Zm9-1h7v6h-7v-6Z"}),deploymentHealth:(0,a.jsx)("path",{d:"M12 3 5 6v5c0 4.5 3 7.8 7 9 4-1.2 7-4.5 7-9V6l-7-3Zm-3 8 2 3 4-5"}),drains:(0,a.jsx)("path",{d:"M5 5h14M7 5v6a5 5 0 0 0 10 0V5M10 16h4v3h-4zM12 19v2"}),data:(0,a.jsx)("path",{d:"M5 6c0-1.4 3.1-2.5 7-2.5s7 1.1 7 2.5-3.1 2.5-7 2.5S5 7.4 5 6Zm0 0v12c0 1.4 3.1 2.5 7 2.5s7-1.1 7-2.5V6M5 12c0 1.4 3.1 2.5 7 2.5s7-1.1 7-2.5"}),export:(0,a.jsx)("path",{d:"M12 3v11m0 0 4-4m-4 4-4-4M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2"}),fanout:(0,a.jsx)("path",{d:"M12 5a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm-7 16a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm14 0a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM12 7v3.5M12 10.5 6 17m6-6.5 6 6.5"}),files:(0,a.jsx)("path",{d:"M4 7a2 2 0 0 1 2-2h3l2 2.5h7a2 2 0 0 1 2 2V18a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V7Z"}),flags:(0,a.jsx)("path",{d:"M6 21V4m0 0h11l-2 3 2 3H6"}),functions:(0,a.jsx)("path",{d:"m9 8-4 4 4 4m6-8 4 4-4 4"}),evals:(0,a.jsx)("path",{d:"M4 19V5m0 14h16M8 15l3-4 3 3 4-6M8 15v.01"}),health:(0,a.jsx)("path",{d:"M3 12h4l2 6 4-14 2 8h6"}),home:(0,a.jsx)("path",{d:"M3 11.5 12 4l9 7.5M5 10v9a1 1 0 0 0 1 1h4v-6h4v6h4a1 1 0 0 0 1-1v-9"}),insights:(0,a.jsx)("path",{d:"M12 3a6 6 0 0 0-3.6 10.8c.5.4.8.9.9 1.5l.2 1.2h5l.2-1.2c.1-.6.4-1.1.9-1.5A6 6 0 0 0 12 3ZM9.5 20.5h5M10 18h4"}),issues:(0,a.jsx)("path",{d:"M10.3 4.3 2.5 18a2 2 0 0 0 1.7 3h15.6a2 2 0 0 0 1.7-3L13.7 4.3a2 2 0 0 0-3.4 0ZM12 9v4m0 3v.01"}),kv:(0,a.jsx)("path",{d:"M5 5h14v4H5V5Zm0 5h14v4H5v-4Zm0 5h14v4H5v-4Z"}),logs:(0,a.jsx)("path",{d:"M5 6h14M5 10h14M5 14h9M5 18h11"}),mail:(0,a.jsx)("path",{d:"M4 5h16v14H4V5Zm0 1.5 8 6 8-6"}),payments:(0,a.jsx)("path",{d:"M3 7h18v10H3V7Zm0 3h18M7 14h4"}),metrics:(0,a.jsx)("path",{d:"M5 20V10m6.5 10V4M18 20v-7M3 20h18"}),migrations:(0,a.jsx)("path",{d:"M4 12a8 8 0 0 1 13.7-5.6L20 8M20 4v4h-4M20 12a8 8 0 0 1-13.7 5.6L4 16m0 4v-4h4"}),notifications:(0,a.jsx)("path",{d:"M15 17h5l-1.4-1.4A2 2 0 0 1 18 14.2V11a6 6 0 0 0-4-5.7V5a2 2 0 1 0-4 0v.3A6 6 0 0 0 6 11v3.2a2 2 0 0 1-.6 1.4L4 17h5m6 0v1a3 3 0 1 1-6 0v-1m6 0H9"}),organizations:(0,a.jsx)("path",{d:"M3 21V8l6-4 6 4v13M9 21v-5h2v5M15 11h6v10M18 14v.01M18 17v.01M6 9v.01M6 12v.01M6 15v.01"}),permissions:(0,a.jsx)("path",{d:"M12 3 5 6v5c0 4.5 3 7.8 7 9 4-1.2 7-4.5 7-9V6l-7-3Zm-3 8 2.2 2.2L15 9.5M8.5 16h7"}),pitr:(0,a.jsx)("path",{d:"M12 21a9 9 0 1 0-9-9M12 7.5V12l3 2M3 12l-2-2m2 2 2-2"}),queues:(0,a.jsx)("path",{d:"M4 6h16M4 10h16M4 14h10M4 18h10m4-2 3 2-3 2v-4Z"}),reactors:(0,a.jsx)("path",{d:"M4 4v6h6M20 20v-6h-6M20 9a8 8 0 0 0-14.7-3M4 15a8 8 0 0 0 14.7 3"}),realtime:(0,a.jsx)("path",{d:"M5 12a7 7 0 0 1 14 0M8 12a4 4 0 0 1 8 0M12 12v8m0-8a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"}),rls:(0,a.jsx)("path",{d:"M12 3 5 6v5c0 4.5 3 7.8 7 9 4-1.2 7-4.5 7-9V6l-7-3ZM8.5 10h7M8.5 13h7"}),schedule:(0,a.jsx)("path",{d:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm0-13.5V12l4 2"}),schema:(0,a.jsx)("path",{d:"M4 5h16v14H4V5Zm0 5h16M10 10v9M4 14.5h16"}),sql:(0,a.jsx)("path",{d:"M4 5h16v14H4V5Zm3 4 3 3-3 3m6 0h4"}),storageRules:(0,a.jsx)("path",{d:"M7 10V7a5 5 0 0 1 10 0v3m-11 0h12a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1v-8a1 1 0 0 1 1-1Zm6 4v2"}),advisorHealth:(0,a.jsx)("path",{d:"M3 12h4l2-5 3 10 2-5h5"}),security:(0,a.jsx)("path",{d:"M12 3 5 6v5c0 4.5 3 7.8 7 9 4-1.2 7-4.5 7-9V6l-7-3Zm-2.5 8.5 2 2 4-4"}),traces:(0,a.jsx)("path",{d:"M3 6h9M6 12h12M10 18h7"}),settings:(0,a.jsx)("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm7.4-3a7.4 7.4 0 0 0-.1-1.2l2-1.6-2-3.4-2.4 1a7.3 7.3 0 0 0-2-1.2l-.4-2.6H10.5l-.4 2.6a7.3 7.3 0 0 0-2 1.2l-2.4-1-2 3.4 2 1.6a7.4 7.4 0 0 0 0 2.4l-2 1.6 2 3.4 2.4-1a7.3 7.3 0 0 0 2 1.2l.4 2.6h3.6l.4-2.6a7.3 7.3 0 0 0 2-1.2l2.4 1 2-3.4-2-1.6a7.4 7.4 0 0 0 .1-1.2Z"}),users:(0,a.jsx)("path",{d:"M16 20v-2a4 4 0 0 0-4-4H7a4 4 0 0 0-4 4v2M9.5 10a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Zm11.5 10v-2a4 4 0 0 0-3-3.85M16 3.13A4 4 0 0 1 16 11"}),vectors:(0,a.jsx)("path",{d:"M4 7l8-4 8 4-8 4-8-4Zm0 5 8 4 8-4M4 17l8 4 8-4"}),workflows:(0,a.jsx)("path",{d:"M5 5h5v5H5V5Zm9 9h5v5h-5v-5ZM7.5 10v2a2 2 0 0 0 2 2H14m2.5-4V8a2 2 0 0 0-2-2H10"})},ks=[{key:"overview",tabs:["home","dashboards"]},{key:"database",tabs:["data","sql","schema","migrations","vectors","pitr","export"]},{key:"functions",tabs:["functions","api","workflows","agents","queues"]},{key:"auth",tabs:["users","organizations","authSessions","authAudit","authConfig"]},{key:"storage",tabs:["files","storageRules","kv"]},{key:"observability",tabs:["issues","logs","traces","evals","audit","realtime","reactors","fanout","containers","metrics","analytics","health","deploymentHealth"]},{key:"advisors",tabs:["advisorHealth","security","rls","permissions","insights"]},{key:"operations",tabs:["schedule","mail","drains","notifications","payments","flags"]},{key:"settings",tabs:["settings"]}],jr=s(t=>{let e=(0,I.c)(2),{tab:o}=t,r=nc[o],n;return e[0]!==r?(n=(0,a.jsx)("svg",{"aria-hidden":"true",className:"size-4 shrink-0",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:r}),e[0]=r,e[1]=n):n=e[1],n},"Mt"),ac=s(t=>t,"$o"),zs=ac(["home","data","sql","functions","api","workflows","agents","queues","containers","schema","migrations","vectors","export","pitr","users","organizations","authSessions","authAudit","authConfig","files","storageRules","kv","dashboards","metrics","analytics","health","deploymentHealth","advisorHealth","security","rls","permissions","insights","issues","logs","traces","evals","reactors","realtime","fanout","mail","notifications","payments","audit","schedule","drains","flags","settings"]),sc=new Set(["api","data","migrations","sql"]),ic=s(t=>{let e=t.split("/").findLast(Boolean)??"";return zs.includes(e)?e:"home"},"Bo"),lc=s(t=>{let e=(0,I.c)(19),{chrome:o,connected:r}=t,n=ge(),i;e[0]!==n?(i=n("admin token"),e[0]=n,e[1]=i):i=e[1];let l;e[2]!==i?(l=(0,a.jsx)("label",{className:"text-xs font-medium text-foreground",htmlFor:"dash-app-token",children:i}),e[2]=i,e[3]=l):l=e[3];let c;e[4]!==o.onTokenChange||e[5]!==o.token?(c=(0,a.jsx)(br,{className:"h-8","data-testid":"dash-app-token",id:"dash-app-token",onChange:o.onTokenChange,placeholder:"LUNORA_ADMIN_TOKEN",type:"password",value:o.token}),e[4]=o.onTokenChange,e[5]=o.token,e[6]=c):c=e[6];let p;e[7]!==r||e[8]!==n?(p=r&&(0,a.jsxs)("p",{className:"flex items-start gap-1.5 text-[11px] text-muted-foreground","data-testid":"dash-app-token-warning",role:"note",children:[(0,a.jsx)("span",{"aria-hidden":"true",className:"text-warning",children:"\u26A0"}),n("Token rides the WebSocket URL \u2014 it can surface in browser DevTools and server logs. Use a dev-only token.")]}),e[7]=r,e[8]=n,e[9]=p):p=e[9];let d;e[10]!==o.clearToken||e[11]!==r||e[12]!==n?(d=r&&(0,a.jsx)("button",{className:"self-start rounded-md border border-border px-2.5 py-1 text-xs font-medium outline-none transition-colors hover:bg-accent focus-visible:bg-accent","data-testid":"dash-app-clear-token",onClick:o.clearToken,type:"button",children:n("Clear")}),e[10]=o.clearToken,e[11]=r,e[12]=n,e[13]=d):d=e[13];let u;return e[14]!==l||e[15]!==c||e[16]!==p||e[17]!==d?(u=(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[l,c,p,d]}),e[14]=l,e[15]=c,e[16]=p,e[17]=d,e[18]=u):u=e[18],u},"Vo"),Ks="opacity-50",cc=s(t=>{let e=(0,I.c)(27),{current:o,group:r,groupLabel:n,selectTab:i,tabDescription:l,tabLabel:c,unavailable:p}=t,d=r.tabs.includes(o)?"page":void 0,u=n[r.key],f=r.tabs[0],h;e[0]!==f?(h=(0,a.jsx)(jr,{tab:f}),e[0]=f,e[1]=h):h=e[1];let g;e[2]!==d||e[3]!==u||e[4]!==h?(g=(0,a.jsx)(Vs,{"aria-current":d,"aria-label":u,className:"mx-auto flex size-8 items-center justify-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:bg-sidebar-accent data-[popup-open]:bg-sidebar-accent data-[popup-open]:text-sidebar-accent-foreground data-[popup-open]:shadow-xs aria-[current=page]:bg-sidebar-accent aria-[current=page]:text-sidebar-accent-foreground aria-[current=page]:shadow-xs",delay:120,openOnHover:!0,children:h}),e[2]=d,e[3]=u,e[4]=h,e[5]=g):g=e[5];let m=n[r.key],x;e[6]!==m?(x=(0,a.jsx)("div",{className:"px-2 py-1.5 text-[11px] font-medium tracking-wider text-muted-foreground uppercase",children:m}),e[6]=m,e[7]=x):x=e[7];let v;if(e[8]!==o||e[9]!==r.tabs||e[10]!==i||e[11]!==l||e[12]!==c||e[13]!==p){let y;e[15]!==o||e[16]!==i||e[17]!==l||e[18]!==c||e[19]!==p?(y=s(S=>(0,a.jsxs)("button",{"aria-current":o===S?"page":void 0,className:U("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-start text-[13px] text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent aria-[current=page]:bg-accent aria-[current=page]:font-medium [&_svg]:opacity-70 aria-[current=page]:[&_svg]:opacity-100",p[S]!==void 0&&Ks),"data-tab":S,"data-testid":`dash-tab-${S}`,"data-unsupported":p[S]===void 0?void 0:"true",onClick:i,title:l[S],type:"button",children:[(0,a.jsx)(jr,{tab:S}),(0,a.jsx)("span",{children:c[S]})]},S),"x"),e[15]=o,e[16]=i,e[17]=l,e[18]=c,e[19]=p,e[20]=y):y=e[20],v=r.tabs.map(y),e[8]=o,e[9]=r.tabs,e[10]=i,e[11]=l,e[12]=c,e[13]=p,e[14]=v}else v=e[14];let b;e[21]!==x||e[22]!==v?(b=(0,a.jsxs)(Ls,{align:"start",className:"w-56 p-1",side:"right",sideOffset:8,children:[x,v]}),e[21]=x,e[22]=v,e[23]=b):b=e[23];let P;return e[24]!==g||e[25]!==b?(P=(0,a.jsxs)(As,{children:[g,b]}),e[24]=g,e[25]=b,e[26]=P):P=e[26],P},"zo"),dc=s(t=>{let e=(0,I.c)(45),{chrome:o,collapsed:r,connected:n}=t,i=ge();if(o===null){let y;e[0]!==i?(y=i("Admin"),e[0]=i,e[1]=y):y=e[1];let S;e[2]===Symbol.for("react.memo_cache_sentinel")?(S=(0,a.jsx)("span",{className:"flex size-8 items-center justify-center rounded-full bg-sidebar-accent text-[11px] font-medium",children:"C"}),e[2]=S):S=e[2];let C;e[3]!==i?(C=i("Admin"),e[3]=i,e[4]=C):C=e[4];let w;e[5]!==C?(w=(0,a.jsx)("span",{className:"truncate text-[13px] font-medium",children:C}),e[5]=C,e[6]=w):w=e[6];let R;e[7]!==i?(R=i("Studio"),e[7]=i,e[8]=R):R=e[8];let T;e[9]!==R?(T=(0,a.jsx)("span",{className:"truncate text-[11px] text-muted-foreground",children:R}),e[9]=R,e[10]=T):T=e[10];let E;e[11]!==w||e[12]!==T?(E=(0,a.jsxs)("span",{className:"grid flex-1 text-start leading-tight",children:[w,T]}),e[11]=w,e[12]=T,e[13]=E):E=e[13];let k;return e[14]!==y||e[15]!==E?(k=(0,a.jsxs)(Bs,{className:"data-active:bg-transparent",size:"lg",tooltip:y,children:[S,E]}),e[14]=y,e[15]=E,e[16]=k):k=e[16],k}let l=r?"mx-auto size-8 justify-center":"w-full p-2",c;e[17]!==l?(c=U("flex items-center gap-2 rounded-md text-start outline-none transition-colors hover:bg-sidebar-accent focus-visible:bg-sidebar-accent",l),e[17]=l,e[18]=c):c=e[18];let p;e[19]!==n||e[20]!==i?(p=i(n?"Connected":"Not connected"),e[19]=n,e[20]=i,e[21]=p):p=e[21];let d=n?"bg-success":"bg-muted-foreground/50",u;e[22]!==d?(u=U("absolute -end-0.5 -bottom-0.5 size-2.5 rounded-full border-2 border-sidebar",d),e[22]=d,e[23]=u):u=e[23];let f;e[24]!==u?(f=(0,a.jsxs)("span",{className:"relative flex size-8 shrink-0 items-center justify-center rounded-full bg-sidebar-accent text-[11px] font-medium",children:["C",(0,a.jsx)("span",{"aria-hidden":"true",className:u})]}),e[24]=u,e[25]=f):f=e[25];let h;e[26]!==r||e[27]!==n||e[28]!==i?(h=!r&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("span",{className:"grid flex-1 text-start leading-tight",children:[(0,a.jsx)("span",{className:"truncate text-[13px] font-medium",children:i("Admin")}),(0,a.jsx)("span",{className:"truncate text-[11px] text-muted-foreground",children:i(n?"Connected":"Not connected")})]}),(0,a.jsx)("svg",{"aria-hidden":"true",className:"size-4 text-muted-foreground",fill:"none",stroke:"currentColor",strokeWidth:1.7,viewBox:"0 0 24 24",children:(0,a.jsx)("path",{d:"m8 9 4-4 4 4M8 15l4 4 4-4",strokeLinecap:"round",strokeLinejoin:"round"})})]}),e[26]=r,e[27]=n,e[28]=i,e[29]=h):h=e[29];let g;e[30]!==c||e[31]!==p||e[32]!==f||e[33]!==h?(g=(0,a.jsxs)(Vs,{className:c,"data-testid":"dash-app-connect",title:p,children:[f,h]}),e[30]=c,e[31]=p,e[32]=f,e[33]=h,e[34]=g):g=e[34];let m=r?"end":"start",x=r?"right":"top",v;e[35]!==o||e[36]!==n?(v=(0,a.jsx)(lc,{chrome:o,connected:n}),e[35]=o,e[36]=n,e[37]=v):v=e[37];let b;e[38]!==x||e[39]!==v||e[40]!==m?(b=(0,a.jsx)(Ls,{align:m,keepMounted:!0,side:x,children:v}),e[38]=x,e[39]=v,e[40]=m,e[41]=b):b=e[41];let P;return e[42]!==b||e[43]!==g?(P=(0,a.jsxs)(As,{children:[g,b]}),e[42]=b,e[43]=g,e[44]=P):P=e[44],P},"Do"),pc=s(t=>{let e=(0,I.c)(29),{chrome:o,connected:r,current:n,groupLabel:i,groups:l,selectTab:c,tabDescription:p,tabLabel:d,unavailable:u}=t,f=ge(),{state:h}=dr(),g=h==="collapsed",m=g&&"justify-center px-0",x;e[0]!==m?(x=U("flex items-center gap-2.5 px-1.5 py-1",m),e[0]=m,e[1]=x):x=e[1];let v;e[2]===Symbol.for("react.memo_cache_sentinel")?(v=(0,a.jsx)(ui,{className:"size-9 shrink-0 text-foreground"}),e[2]=v):v=e[2];let b;e[3]!==g||e[4]!==r||e[5]!==f?(b=!g&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("span",{className:"grid flex-1 leading-tight",children:[(0,a.jsx)("span",{className:"truncate text-sm font-semibold text-foreground",children:"lunora"}),(0,a.jsx)("span",{className:"truncate text-[11px] text-muted-foreground",children:f("Studio")})]}),(0,a.jsx)(Ot,{className:"px-1.5 text-[10px] tracking-wider uppercase",variant:"secondary",children:f(r?"Live":"Local")})]}),e[3]=g,e[4]=r,e[5]=f,e[6]=b):b=e[6];let P;e[7]!==x||e[8]!==b?(P=(0,a.jsx)(Ai,{children:(0,a.jsxs)("div",{className:x,children:[v,b]})}),e[7]=x,e[8]=b,e[9]=P):P=e[9];let y;e[10]!==g||e[11]!==n||e[12]!==i||e[13]!==l||e[14]!==c||e[15]!==p||e[16]!==d||e[17]!==u?(y=g?l.map(R=>(0,a.jsx)(cc,{current:n,group:R,groupLabel:i,selectTab:c,tabDescription:p,tabLabel:d,unavailable:u},R.key)):l.map(R=>(0,a.jsxs)(Hi,{children:[(0,a.jsx)(Bi,{className:"text-[11px] font-medium tracking-wider uppercase",children:i[R.key]}),(0,a.jsx)(Fi,{children:(0,a.jsx)(Ts,{children:R.tabs.map(T=>(0,a.jsx)(ws,{children:(0,a.jsxs)(Bs,{className:U("data-active:text-foreground dark:data-active:text-royal-amethyst data-active:shadow-[inset_2px_0_0_0_var(--royal-amethyst)]",u[T]!==void 0&&Ks),"data-tab":T,"data-testid":`dash-tab-${T}`,"data-unsupported":u[T]===void 0?void 0:"true",isActive:n===T,onClick:c,title:p[T],tooltip:p[T],children:[(0,a.jsx)(jr,{tab:T}),(0,a.jsx)("span",{children:d[T]})]})},T))})})]},R.key)),e[10]=g,e[11]=n,e[12]=i,e[13]=l,e[14]=c,e[15]=p,e[16]=d,e[17]=u,e[18]=y):y=e[18];let S;e[19]!==y?(S=(0,a.jsx)(Li,{children:y}),e[19]=y,e[20]=S):S=e[20];let C;e[21]!==o||e[22]!==g||e[23]!==r?(C=(0,a.jsx)(Vi,{children:(0,a.jsx)(Ts,{children:(0,a.jsx)(ws,{children:(0,a.jsx)(dc,{chrome:o,collapsed:g,connected:r})})})}),e[21]=o,e[22]=g,e[23]=r,e[24]=C):C=e[24];let w;return e[25]!==P||e[26]!==S||e[27]!==C?(w=(0,a.jsxs)(Mi,{collapsible:"icon",variant:"inset",children:[P,S,C]}),e[25]=P,e[26]=S,e[27]=C,e[28]=w):w=e[28],w},"Oo"),Kr=s(()=>{let t=(0,I.c)(1),e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"dash-pending",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(jo,{className:"h-8 w-40"}),(0,a.jsx)(jo,{className:"h-8 w-24"})]}),(0,a.jsx)(jo,{className:"h-72 w-full"})]}),t[0]=e):e=t[0],e},"Pt"),uc=s(t=>{let e=(0,I.c)(5),{title:o,verdict:r}=t;if(r.kind==="pending"){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=(0,a.jsx)(Kr,{}),e[0]=i):i=e[0],i}if(r.kind==="unavailable"){let i;return e[1]!==o||e[2]!==r.reason?(i=(0,a.jsx)(il,{reason:r.reason,title:o}),e[1]=o,e[2]=r.reason,e[3]=i):i=e[3],i}let n;return e[4]===Symbol.for("react.memo_cache_sentinel")?(n=(0,a.jsx)(Gr,{}),e[4]=n):n=e[4],n},"Zo"),mc=s(()=>{let t=(0,I.c)(46),e=ge(),o=to(),r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={select:xc},t[0]=r):r=t[0];let n=Jr(r),i=ic(n),l=sc.has(i),c=en(),p=c?.toggle;ll(p);let d=Bn(),{groupLabel:u,tabDescription:f,tabLabel:h}=Gi(),{unavailable:g,visibleGroups:m}=sl(ks,d,e),x={...f,...g},v=Fs(i,d,e),b=v.kind==="hidden",P,y;t[1]!==b||t[2]!==o?(P=s(()=>{b&&Qt(o({replace:!0,to:"/home"}))},"p"),y=[b,o],t[1]=b,t[2]=o,t[3]=P,t[4]=y):(P=t[3],y=t[4]),(0,O.useEffect)(P,y);let S;t[5]!==o?(S=s(pe=>{Qt(o({to:`/${pe.currentTarget.dataset.tab??""}`}))},"k"),t[5]=o,t[6]=S):S=t[6];let C=S,w,R;t[7]!==i||t[8]!==h?(w=s(()=>{typeof document<"u"&&(document.title=`${h[i]} \xB7 lunora`)},"C"),R=[i,h],t[7]=i,t[8]=h,t[9]=w,t[10]=R):(w=t[9],R=t[10]),(0,O.useEffect)(w,R);let T=m.find(pe=>pe.tabs.includes(i))??ks[0],E=m.flatMap(pe=>pe.tabs.filter(W=>g[W]===void 0).map(W=>({group:u[pe.key],label:h[W],to:`/${W}`}))),k=p===void 0?E:[...E,{group:e("Operations"),label:e("Toggle operation console"),run:p}],M=(0,O.use)(js),L=M!==null&&M.token!=="",_;t[11]!==k?(_=(0,a.jsx)(Rs,{items:k}),t[11]=k,t[12]=_):_=t[12];let j=u[T.key],z=h[i],H;t[13]!==j||t[14]!==z?(H=(0,a.jsx)(tl,{domain:j,onOpenCommandPalette:Ss,page:z}),t[13]=j,t[14]=z,t[15]=H):H=t[15];let F;t[16]!==M?.rulesInstalled?(F=M?.rulesInstalled===!1&&(0,a.jsx)(gi,{}),t[16]=M?.rulesInstalled,t[17]=F):F=t[17];let Z=`dash-tab-${i}`,D=l?"flex min-w-0 flex-1 flex-col overflow-hidden":"min-w-0 flex-1 overflow-auto p-6",V=h[i],q;t[18]!==e||t[19]!==V?(q=e("{title} failed",{title:V}),t[18]=e,t[19]=V,t[20]=q):q=t[20];let G=h[i],ee;t[21]!==e?(ee=e("Try again"),t[21]=e,t[22]=ee):ee=t[22];let ae;t[23]===Symbol.for("react.memo_cache_sentinel")?(ae=(0,a.jsx)(Kr,{}),t[23]=ae):ae=t[23];let te=h[i],X;t[24]!==te||t[25]!==v?(X=(0,a.jsx)(O.Suspense,{fallback:ae,children:(0,a.jsx)(uc,{title:te,verdict:v})}),t[24]=te,t[25]=v,t[26]=X):X=t[26];let $;t[27]!==i||t[28]!==q||t[29]!==G||t[30]!==ee||t[31]!==X?($=(0,a.jsx)(Ko,{fallbackTitle:q,label:G,retryLabel:ee,children:X},i),t[27]=i,t[28]=q,t[29]=G,t[30]=ee,t[31]=X,t[32]=$):$=t[32];let le;t[33]!==D||t[34]!==$?(le=(0,a.jsx)("div",{className:D,children:$}),t[33]=D,t[34]=$,t[35]=le):le=t[35];let ce;t[36]!==c?(ce=c?.open===!0&&(0,a.jsx)(Wi,{focusSeq:c.focusSeq,onClose:c.close,onShownChange:c.setShown,shown:c.shown}),t[36]=c,t[37]=ce):ce=t[37];let de;t[38]!==Z||t[39]!==le||t[40]!==ce?(de=(0,a.jsxs)("div",{"aria-labelledby":Z,className:"flex min-w-0 flex-1 flex-col overflow-hidden","data-testid":"dash-panel",id:"dash-panel",role:"tabpanel",children:[le,ce]}),t[38]=Z,t[39]=le,t[40]=ce,t[41]=de):de=t[41];let he;return t[42]!==F||t[43]!==de||t[44]!==H?(he=(0,a.jsxs)(_i,{className:"overflow-hidden md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm",children:[H,F,de]}),t[42]=F,t[43]=de,t[44]=H,t[45]=he):he=t[45],(0,a.jsxs)(Di,{className:"min-h-0 flex-1","data-platform":d.platform?.id,"data-testid":"lunora-studio",children:[_,(0,a.jsx)(pc,{chrome:M,connected:L,current:i,groupLabel:u,groups:m,selectTab:C,tabDescription:x,tabLabel:h,unavailable:g}),he]})},"Fo"),fc=s(()=>{let t=(0,I.c)(1),e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)(Xr,{children:(0,a.jsx)(mc,{})}),t[0]=e):e=t[0],e},"qo"),gc=s(t=>{let e=(0,I.c)(5),{initialShardKey:o,schemaEditable:r}=t,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},e[0]=n):n=e[0];let i=qr(n),{table:l}=i,c=typeof l=="string"?l:void 0,p;return e[1]!==o||e[2]!==c||e[3]!==r?(p=(0,a.jsx)(Gl,{initialShardKey:o,initialTable:c,schemaEditable:r}),e[1]=o,e[2]=c,e[3]=r,e[4]=p):p=e[4],p},"Wo"),hc=s(()=>{let t=(0,I.c)(3),e=to(),o,r;return t[0]!==e?(o=s(()=>{Qt(e({replace:!0,to:"/home"}))},"s"),r=[e],t[0]=e,t[1]=o,t[2]=r):(o=t[1],r=t[2]),(0,O.useEffect)(o,r),null},"jo"),vc=s(({analyticsQuery:t,basePath:e,dataEditable:o=!1,functions:r,initialShardKey:n,openApiSpec:i,openRpcSpec:l,runAsIdentity:c=!1,schemaEditable:p=!1,scheduledCancel:d,scheduledCron:u,scheduledLoad:f})=>{let h=$r({component:fc}),g={agents:(0,a.jsx)(ml,{initialShardKey:n}),analytics:(0,a.jsx)(fl,{runQuery:t}),api:(0,a.jsx)(gl,{functions:r,initialShardKey:n,openApiSpec:i,openRpcSpec:l}),audit:(0,a.jsx)(Il,{initialShardKey:n}),authAudit:(0,a.jsx)(hl,{}),authConfig:(0,a.jsx)(vl,{}),authSessions:(0,a.jsx)(bl,{}),containers:(0,a.jsx)(Pl,{}),dashboards:(0,a.jsx)(Zl,{initialShardKey:n}),data:(0,a.jsx)(Sl,{canGenerateRows:o&&p,editable:o,initialShardKey:n}),deploymentHealth:(0,a.jsx)(Cl,{}),drains:(0,a.jsx)(_l,{}),export:(0,a.jsx)(Rl,{initialShardKey:n}),fanout:(0,a.jsx)(Wl,{initialShardKey:n}),files:(0,a.jsx)(Jl,{}),kv:(0,a.jsx)(Fl,{}),flags:(0,a.jsx)(El,{initialShardKey:n}),reactors:(0,a.jsx)(kl,{initialShardKey:n}),functions:(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsx)(Dl,{functions:r,initialShardKey:n}),(0,a.jsx)(Ol,{functions:r,runAsIdentity:c})]}),health:(0,a.jsx)(ql,{initialShardKey:n}),home:(0,a.jsx)(Fn,{initialShardKey:n}),insights:(0,a.jsx)(cl,{initialShardKey:n}),issues:(0,a.jsx)(Ml,{initialShardKey:n}),logs:(0,a.jsx)(Al,{initialShardKey:n}),traces:(0,a.jsx)(ec,{initialShardKey:n}),evals:(0,a.jsx)(tc,{initialShardKey:n}),metrics:(0,a.jsx)($l,{initialShardKey:n}),migrations:(0,a.jsx)(Nl,{initialShardKey:n}),notifications:(0,a.jsx)(jl,{}),organizations:(0,a.jsx)(xl,{}),permissions:(0,a.jsx)(Kl,{functions:r,runAsIdentity:c,schemaEditable:p}),pitr:(0,a.jsx)(wl,{initialShardKey:n}),mail:(0,a.jsx)(Vl,{}),payments:(0,a.jsx)(zl,{}),queues:(0,a.jsx)(Ul,{}),realtime:(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsx)(Hl,{initialShardKey:n}),(0,a.jsx)(Bl,{})]}),rls:(0,a.jsx)(dl,{}),schedule:(0,a.jsx)(Ll,{loadCronJobs:u,scheduledCancel:d,scheduledLoad:f}),schema:(0,a.jsx)(gc,{initialShardKey:n,schemaEditable:p}),advisorHealth:(0,a.jsx)(pl,{}),security:(0,a.jsx)(ul,{}),settings:(0,a.jsx)(Ql,{initialShardKey:n}),sql:(0,a.jsx)(Yl,{initialShardKey:n}),storageRules:(0,a.jsx)(Xl,{}),users:(0,a.jsx)(yl,{}),vectors:(0,a.jsx)(oc,{}),workflows:(0,a.jsx)(rc,{})},m=hr({component:s(()=>g.home,"component"),getParentRoute:s(()=>h,"getParentRoute"),path:"/"}),x=zs.map(P=>hr({component:s(()=>g[P],"component"),getParentRoute:s(()=>h,"getParentRoute"),path:`/${P}`,validateSearch:Tl[P]})),v=h.addChildren([m,...x]),b="window"in globalThis?Zr():Wr({initialEntries:["/home"]});return Qr({...e===void 0||e==="/"?{}:{basepath:e},defaultNotFoundComponent:hc,defaultPendingComponent:Kr,defaultPendingMinMs:0,defaultPendingMs:0,history:b,routeTree:v})},"Go"),bc=s(t=>{let e=(0,I.c)(18),{analyticsQuery:o,basePath:r,chrome:n,dataEditable:i,functions:l,initialShardKey:c,openApiSpec:p,openRpcSpec:d,runAsIdentity:u,schemaEditable:f,scheduledCancel:h,scheduledCron:g,scheduledLoad:m}=t,x;e[0]!==o||e[1]!==r||e[2]!==i||e[3]!==l||e[4]!==c||e[5]!==p||e[6]!==d||e[7]!==u||e[8]!==h||e[9]!==g||e[10]!==m||e[11]!==f?(x=vc({analyticsQuery:o,basePath:r,dataEditable:i,functions:l,initialShardKey:c,openApiSpec:p,openRpcSpec:d,runAsIdentity:u,schemaEditable:f,scheduledCancel:h,scheduledCron:g,scheduledLoad:m}),e[0]=o,e[1]=r,e[2]=i,e[3]=l,e[4]=c,e[5]=p,e[6]=d,e[7]=u,e[8]=h,e[9]=g,e[10]=m,e[11]=f,e[12]=x):x=e[12];let v=x,b=n??null,P;e[13]!==v?(P=(0,a.jsx)(Yr,{router:v}),e[13]=v,e[14]=P):P=e[14];let y;return e[15]!==b||e[16]!==P?(y=(0,a.jsx)(js,{value:b,children:P}),e[15]=b,e[16]=P,e[17]=y):y=e[17],y},"Uo"),zg=s(t=>{let e=(0,I.c)(10),o,r,n;e[0]!==t?({i18n:o,locale:r,...n}=t,e[0]=t,e[1]=o,e[2]=r,e[3]=n):(o=e[1],r=e[2],n=e[3]);let i;e[4]!==n?(i=(0,a.jsx)(ii,{children:(0,a.jsx)(bc,{...n})}),e[4]=n,e[5]=i):i=e[5];let l=i;if(o===void 0&&r===void 0)return l;let c;return e[6]!==o||e[7]!==r||e[8]!==l?(c=(0,a.jsx)(Cs,{i18n:o,locale:r,children:l}),e[6]=o,e[7]=r,e[8]=l,e[9]=c):c=e[9],c},"_n");function xc(t){return t.location.pathname}s(xc,"Ko");export{Ko as a,Cs as b,si as c,li as d,jg as e,ui as f,bi as g,Pi as h,Ci as i,Si as j,zg as k};
@@ -0,0 +1 @@
1
+ import{a as et}from"./chunk-3FBLWUXD.js";import{a as Ke,b as Ve}from"./chunk-BSNHEJP3.js";import{a as We}from"./chunk-MRAMNVDG.js";import{a as qe}from"./chunk-XZMOZFE6.js";import{a as O}from"./chunk-IMOHEGMV.js";import{a as Je}from"./chunk-LCRAEP3B.js";import"./chunk-UXXDN6Z3.js";import{a as Ge}from"./chunk-66UGPQVC.js";import{a as Xe}from"./chunk-QKEJLVC5.js";import"./chunk-AWHXPIXU.js";import"./chunk-V3VJAA4D.js";import{W as T}from"./chunk-PLHA3OWK.js";import"./chunk-4L4WTGN5.js";import{a as _}from"./chunk-55754F6H.js";import"./chunk-IS6LVJ6L.js";import"./chunk-AAVLPU5Q.js";import{b as H}from"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import{b as He}from"./chunk-ERHFRNCL.js";import{f as J}from"./chunk-R4WRHIAN.js";import"./chunk-FSRSK4LY.js";import"./chunk-LCXKALTS.js";import{a as Me}from"./chunk-FKVZRPV5.js";import{a as ze,b as _e,c as Pe,d as V,e as U,f as z}from"./chunk-HEAQVSNS.js";import{a as K,e as W}from"./chunk-WUWBZPUK.js";import{d as Q,h as Ee,o as Ue,p as X,r as Qe,t as te}from"./chunk-PTZD7RUZ.js";import{a as s,d as De,e as lt,f as it,g as nt}from"./chunk-YKXDMIHQ.js";var C=De(lt(),1);var G=De(it(),1);var t=De(nt(),1);Ke.capabilities;var st=s(()=>{let h=(0,G.c)(3),{config:e,ready:i}=Ve(),l;return h[0]!==e.capabilities||h[1]!==i?(l={capabilities:e.capabilities,ready:i},h[0]=e.capabilities,h[1]=i,h[2]=l):l=h[2],l},"lt"),rt=s((h,e)=>typeof h.acceptedAt=="number"?"spent":typeof h.expiresAt=="number"&&h.expiresAt<=e?"expired":"pending","at"),tt=500,dt=s((h,e)=>{if(!URL.canParse(h.trim()))return null;let i=new URL(h.trim());return i.searchParams.set("email",e.email),i.searchParams.set("invite",e.token),i.toString()},"it"),ot=s(h=>{let e=(0,G.c)(34),{issued:i,onSignUpPageChange:l,signUpPage:o}=h,a=Q(),[p,n]=(0,C.useState)(null),u;e[0]!==i||e[1]!==o?(u=dt(o,i),e[0]=i,e[1]=o,e[2]=u):u=e[2];let c=u,y;e[3]!==c?(y=s(()=>{let $="navigator"in globalThis?globalThis.navigator.clipboard:void 0;c===null||$===void 0||X($.writeText(c).then(()=>(n(c),!0)))},"y"),e[3]=c,e[4]=y):y=e[4];let w=y,g;e[5]!==a?(g=a("Send this link to the invitee. It is shown once and cannot be recovered."),e[5]=a,e[6]=g):g=e[6];let I;e[7]!==g?(I=(0,t.jsx)("p",{className:"text-sm",children:g}),e[7]=g,e[8]=I):I=e[8];let k=c===null,v;e[9]!==a?(v=a("Your app's sign-up page"),e[9]=a,e[10]=v):v=e[10];let d;e[11]!==l?(d=s($=>{l($.target.value)},"r"),e[11]=l,e[12]=d):d=e[12];let m;e[13]!==o||e[14]!==k||e[15]!==v||e[16]!==d?(m=(0,t.jsx)(T,{"aria-invalid":k,"aria-label":v,"data-testid":"sign-up-invitation-page",onChange:d,value:o}),e[13]=o,e[14]=k,e[15]=v,e[16]=d,e[17]=m):m=e[17];let b=c??"",x;e[18]!==b?(x=(0,t.jsx)(T,{"data-testid":"sign-up-invitation-link",readOnly:!0,value:b}),e[18]=b,e[19]=x):x=e[19];let N;e[20]!==p||e[21]!==c||e[22]!==a?(N=a(p!==null&&p===c?"Copied":"Copy"),e[20]=p,e[21]=c,e[22]=a,e[23]=N):N=e[23];let f;e[24]!==w||e[25]!==N?(f=(0,t.jsx)(_,{"data-testid":"sign-up-invitation-copy",onClick:w,type:"button",children:N}),e[24]=w,e[25]=N,e[26]=f):f=e[26];let r;e[27]!==x||e[28]!==f?(r=(0,t.jsxs)("div",{className:"flex gap-2",children:[x,f]}),e[27]=x,e[28]=f,e[29]=r):r=e[29];let S;return e[30]!==r||e[31]!==I||e[32]!==m?(S=(0,t.jsx)(K,{children:(0,t.jsxs)(W,{className:"flex flex-col gap-2 p-4",children:[I,m,r]})}),e[30]=r,e[31]=I,e[32]=m,e[33]=S):S=e[33],S},"rt"),ct=s(()=>{let h=J(),e=Q(),[i,l]=(0,C.useState)(""),[o,a]=(0,C.useState)(null),[p,n]=(0,C.useState)(null),[u,c]=(0,C.useState)(()=>`${Qe(h.url)}/sign-up`),y=He(["lunora-auth-sign-up-invitations",tt],()=>h.listAuthSignUpInvitations({limit:tt})),w=y.data?.rows??null,g=y.data?.total??0,I=s(()=>{let v=i.trim();v!==""&&(a(null),X((async()=>{try{let d=await h.createAuthSignUpInvitation({email:v}),m=typeof d.token=="string"?d.token:void 0;n(m===void 0?null:{email:v,token:m}),l(""),y.refetch()}catch(d){a(d instanceof Error?d.message:String(d))}})()))},"w"),k=s(v=>{a(null),X((async()=>{try{await h.revokeAuthSignUpInvitation({email:v}),y.refetch()}catch(d){a(d instanceof Error?d.message:String(d))}})())},"k");return(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"sign-up-invitations",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-base font-medium",children:e("Sign-up invitations")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("Only invited addresses can create an account. Nothing is emailed \u2014 send the invitee the one-time link yourself.")})]}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(T,{"aria-label":e("Email address to invite"),"data-testid":"sign-up-invitation-email",onChange:s(v=>{l(v.target.value)},"onChange"),placeholder:e("ada@example.com"),type:"email",value:i}),(0,t.jsx)(_,{"data-testid":"sign-up-invitation-submit",onClick:I,type:"button",children:e("Invite")})]}),p!==null&&(0,t.jsx)(ot,{issued:p,onSignUpPageChange:c,signUpPage:u},p.token),(o??y.error)!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"sign-up-invitations-error",role:"alert",children:o??y.error}),w!==null&&w.length===0&&(0,t.jsx)(Me,{testId:"sign-up-invitations-empty",title:e("Nobody has been invited yet.")}),w!==null&&g>w.length&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"sign-up-invitations-truncated",children:e("Showing the most recent invitations. Query the signUpInvitation table directly to see the rest.")}),w!==null&&w.length>0&&(0,t.jsx)(K,{children:(0,t.jsx)(W,{className:"p-0",children:(0,t.jsxs)(ze,{children:[(0,t.jsx)(_e,{children:(0,t.jsxs)(V,{children:[(0,t.jsx)(U,{children:e("Email")}),(0,t.jsx)(U,{children:e("Status")}),(0,t.jsx)(U,{children:e("Expires")}),(0,t.jsx)(U,{children:e("Invited by")}),(0,t.jsx)(U,{})]})}),(0,t.jsx)(Pe,{children:w.map(v=>{let d=rt(v,Date.now()),m=v.email??"";return(0,t.jsxs)(V,{"data-testid":`sign-up-invitation-${m}`,children:[(0,t.jsx)(z,{children:m}),(0,t.jsxs)(z,{"data-testid":`sign-up-invitation-status-${m}`,children:[d==="spent"&&e("Accepted"),d==="expired"&&e("Expired"),d==="pending"&&e("Pending")]}),(0,t.jsx)(z,{children:typeof v.expiresAt=="number"?te(v.expiresAt):"\u2014"}),(0,t.jsx)(z,{children:v.invitedBy??"\u2014"}),(0,t.jsx)(z,{className:"text-right",children:(0,t.jsx)(_,{onClick:s(()=>{k(m)},"onClick"),type:"button",variant:"ghost",children:e("Revoke")})})]},v.id)})})]})})})]})},"ot"),ut={boolean:"checkbox",date:"datetime-local",number:"number",string:"text"},mt=s((h,e)=>h.type==="boolean"?!0:typeof e!="string"||e.trim()===""?!1:h.type!=="number"||!Number.isNaN(Number(e.trim())),"ct"),ht=s((h,e)=>{if(h.type==="boolean")return e===!0?{value:!0}:h.required?{value:!1}:void 0;let i=typeof e=="string"?e.trim():"";if(i!==""){if(h.type==="number"){let l=Number(i);return Number.isNaN(l)?void 0:{value:l}}return{value:i}}},"ut"),pt=s(h=>{let e=(0,G.c)(105),{onClose:i,onCreated:l}=h,o=J(),a=Q(),{config:p}=Ve(),{busy:n,error:u,run:c}=We(),[y,w]=(0,C.useState)(""),[g,I]=(0,C.useState)(""),[k,v]=(0,C.useState)(""),[d,m]=(0,C.useState)(""),b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={},e[0]=b):b=e[0];let[x,N]=(0,C.useState)(b),f;e[1]===Symbol.for("react.memo_cache_sentinel")?(f=s(A=>{w(A.target.value)},"p"),e[1]=f):f=e[1];let r=f,S;e[2]===Symbol.for("react.memo_cache_sentinel")?(S=s(A=>{I(A.target.value)},"I"),e[2]=S):S=e[2];let $=S,B;e[3]===Symbol.for("react.memo_cache_sentinel")?(B=s(A=>{v(A.target.value)},"L"),e[3]=B):B=e[3];let q=B,D;e[4]===Symbol.for("react.memo_cache_sentinel")?(D=s(A=>{m(A.target.value)},"_"),e[4]=D):D=e[4];let Y=D,j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=s((A,R)=>{N(ee=>({...ee,[A]:R}))},"z"),e[5]=j):j=e[5];let M=j,Z;e[6]!==x?(Z=s(A=>x[A.name]??(A.type==="boolean"?!1:""),"Y"),e[6]=x,e[7]=Z):Z=e[7];let P=Z,L;if(e[8]!==p.userFields||e[9]!==P){let A;e[11]!==P?(A=s(R=>!R.required||mt(R,P(R)),"A"),e[11]=P,e[12]=A):A=e[12],L=p.userFields.every(A),e[8]=p.userFields,e[9]=P,e[10]=L}else L=e[10];let F=L,E;e[13]!==n||e[14]!==y||e[15]!==g||e[16]!==F?(E=!n&&y.trim()!==""&&g.trim()!==""&&F,e[13]=n,e[14]=y,e[15]=g,e[16]=F,e[17]=E):E=e[17];let $e=E,ae;e[18]!==p.userFields||e[19]!==P?(ae=s(()=>{let A={};for(let R of p.userFields){let ee=ht(R,P(R));ee!==void 0&&(A[R.name]=ee.value)}return Object.keys(A).length===0?void 0:A},"te"),e[18]=p.userFields,e[19]=P,e[20]=ae):ae=e[20];let Be=ae,Re;e[21]!==Be||e[22]!==o||e[23]!==y||e[24]!==g||e[25]!==i||e[26]!==l||e[27]!==k||e[28]!==d||e[29]!==c?(Re=s(()=>{c(async()=>{await o.createAuthUser({data:Be(),email:y.trim(),name:g.trim(),password:k===""?void 0:k,role:d.trim()===""?void 0:d.trim()}),l(),i()})},"De"),e[21]=Be,e[22]=o,e[23]=y,e[24]=g,e[25]=i,e[26]=l,e[27]=k,e[28]=d,e[29]=c,e[30]=Re):Re=e[30];let je=Re,le;e[31]!==a?(le=a("Create user"),e[31]=a,e[32]=le):le=e[32];let ie;e[33]!==a?(ie=a("Create user"),e[33]=a,e[34]=ie):ie=e[34];let ne;e[35]!==ie?(ne=(0,t.jsx)("h2",{className:"text-sm font-semibold text-foreground",children:ie}),e[35]=ie,e[36]=ne):ne=e[36];let se;e[37]!==a?(se=a("email"),e[37]=a,e[38]=se):se=e[38];let re;e[39]!==se?(re=(0,t.jsx)(O,{htmlFor:"uc-email",children:se}),e[39]=se,e[40]=re):re=e[40];let de;e[41]!==y?(de=(0,t.jsx)(T,{"data-testid":"uc-email",id:"uc-email",onChange:r,type:"email",value:y}),e[41]=y,e[42]=de):de=e[42];let oe;e[43]!==re||e[44]!==de?(oe=(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[re,de]}),e[43]=re,e[44]=de,e[45]=oe):oe=e[45];let ce;e[46]!==a?(ce=a("name"),e[46]=a,e[47]=ce):ce=e[47];let ue;e[48]!==ce?(ue=(0,t.jsx)(O,{htmlFor:"uc-name",children:ce}),e[48]=ce,e[49]=ue):ue=e[49];let me;e[50]!==g?(me=(0,t.jsx)(T,{"data-testid":"uc-name",id:"uc-name",onChange:$,value:g}),e[50]=g,e[51]=me):me=e[51];let he;e[52]!==ue||e[53]!==me?(he=(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[ue,me]}),e[52]=ue,e[53]=me,e[54]=he):he=e[54];let pe;e[55]!==a?(pe=a("Password (optional)"),e[55]=a,e[56]=pe):pe=e[56];let fe;e[57]!==pe?(fe=(0,t.jsx)(O,{htmlFor:"uc-password",children:pe}),e[57]=pe,e[58]=fe):fe=e[58];let ve;e[59]!==k?(ve=(0,t.jsx)(T,{"data-testid":"uc-password",id:"uc-password",onChange:q,type:"password",value:k}),e[59]=k,e[60]=ve):ve=e[60];let ge;e[61]!==fe||e[62]!==ve?(ge=(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[fe,ve]}),e[61]=fe,e[62]=ve,e[63]=ge):ge=e[63];let be;e[64]!==a?(be=a("Role (optional)"),e[64]=a,e[65]=be):be=e[65];let xe;e[66]!==be?(xe=(0,t.jsx)(O,{htmlFor:"uc-role",children:be}),e[66]=be,e[67]=xe):xe=e[67];let ye;e[68]!==d?(ye=(0,t.jsx)(T,{"data-testid":"uc-role",id:"uc-role",onChange:Y,value:d}),e[68]=d,e[69]=ye):ye=e[69];let Ne;e[70]!==xe||e[71]!==ye?(Ne=(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[xe,ye]}),e[70]=xe,e[71]=ye,e[72]=Ne):Ne=e[72];let ke;e[73]!==p.userFields||e[74]!==P||e[75]!==a?(ke=p.userFields.length>0&&(0,t.jsxs)("div",{className:"flex flex-col gap-3 border-t border-border pt-3","data-testid":"uc-plugin-fields",children:[(0,t.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:a("Plugin fields")}),p.userFields.map(A=>{let R=`uc-field-${A.name}`,ee=A.required?"":` (${a("optional")})`;if(A.type==="boolean"){let Oe=P(A)===!0;return(0,t.jsxs)("label",{className:"flex items-center gap-2",htmlFor:R,children:[(0,t.jsx)(et,{checked:Oe,"data-testid":R,id:R,onCheckedChange:s(at=>{M(A.name,at)},"onCheckedChange")}),(0,t.jsxs)("span",{className:"text-sm",children:[A.name,ee]})]},A.name)}let Ze=P(A);return(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsxs)(O,{htmlFor:R,children:[A.name,ee]}),(0,t.jsx)(T,{"data-testid":R,id:R,onChange:s(Oe=>{M(A.name,Oe.target.value)},"onChange"),type:ut[A.type],value:typeof Ze=="string"?Ze:""})]},A.name)})]}),e[73]=p.userFields,e[74]=P,e[75]=a,e[76]=ke):ke=e[76];let we;e[77]!==u?(we=u!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"uc-error",role:"alert",children:u}),e[77]=u,e[78]=we):we=e[78];let Ce;e[79]!==a?(Ce=a("Cancel"),e[79]=a,e[80]=Ce):Ce=e[80];let Ie;e[81]!==i||e[82]!==Ce?(Ie=(0,t.jsx)(_,{"data-testid":"uc-cancel",onClick:i,size:"sm",type:"button",variant:"outline",children:Ce}),e[81]=i,e[82]=Ce,e[83]=Ie):Ie=e[83];let Le=!$e,Ae;e[84]!==n||e[85]!==a?(Ae=a(n?"Creating\u2026":"Create"),e[84]=n,e[85]=a,e[86]=Ae):Ae=e[86];let Se;e[87]!==je||e[88]!==Le||e[89]!==Ae?(Se=(0,t.jsx)(_,{"data-testid":"uc-submit",disabled:Le,onClick:je,size:"sm",type:"button",children:Ae}),e[87]=je,e[88]=Le,e[89]=Ae,e[90]=Se):Se=e[90];let Fe;e[91]!==Ie||e[92]!==Se?(Fe=(0,t.jsxs)("div",{className:"flex justify-end gap-2 pt-1",children:[Ie,Se]}),e[91]=Ie,e[92]=Se,e[93]=Fe):Fe=e[93];let Te;return e[94]!==i||e[95]!==le||e[96]!==ne||e[97]!==oe||e[98]!==he||e[99]!==ge||e[100]!==Ne||e[101]!==ke||e[102]!==we||e[103]!==Fe?(Te=(0,t.jsxs)(qe,{label:le,onClose:i,panelTestId:"uc-dialog",testId:"uc-overlay",variant:"dialog",children:[ne,oe,he,ge,Ne,ke,we,Fe]}),e[94]=i,e[95]=le,e[96]=ne,e[97]=oe,e[98]=he,e[99]=ge,e[100]=Ne,e[101]=ke,e[102]=we,e[103]=Fe,e[104]=Te):Te=e[104],Te},"mt"),Ye=s(h=>{let e=(0,G.c)(2),{children:i}=h,l;return e[0]!==i?(l=(0,t.jsx)("h3",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:i}),e[0]=i,e[1]=l):l=e[1],l},"Ve"),ft=s(h=>{let e=(0,G.c)(29),{busy:i,runAction:l,userId:o,version:a}=h,p=J(),n=Q(),[u,c]=(0,C.useState)(null),[y,w]=(0,C.useState)(null),g;e[0]!==p||e[1]!==o?(g=s(()=>{X((async()=>{w(null);try{let r=await p.listAuthSessions({limit:50,userId:o});c(r.rows)}catch(r){let S=r;c(null),w(Ee(S))}})())},"g"),e[0]=p,e[1]=o,e[2]=g):g=e[2];let I;e[3]!==p||e[4]!==o||e[5]!==a?(I=[p,o,a],e[3]=p,e[4]=o,e[5]=a,e[6]=I):I=e[6],(0,C.useEffect)(g,I);let k;e[7]!==p||e[8]!==l?(k=s(r=>{l(()=>p.revokeAuthSession({sessionId:r}))},"k"),e[7]=p,e[8]=l,e[9]=k):k=e[9];let v=k,d;e[10]!==n?(d=n("Sessions"),e[10]=n,e[11]=d):d=e[11];let m;e[12]!==d?(m=(0,t.jsx)(Ye,{children:d}),e[12]=d,e[13]=m):m=e[13];let b;e[14]!==y?(b=y!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"ud-sessions-error",role:"alert",children:y}),e[14]=y,e[15]=b):b=e[15];let x;e[16]!==u||e[17]!==n?(x=u!==null&&u.length===0&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"ud-sessions-empty",children:n("No active sessions.")}),e[16]=u,e[17]=n,e[18]=x):x=e[18];let N;e[19]!==i||e[20]!==v||e[21]!==u||e[22]!==n?(N=u!==null&&u.length>0&&(0,t.jsx)(K,{className:"overflow-hidden py-0",children:(0,t.jsx)(W,{className:"px-0",children:(0,t.jsxs)(ze,{"data-testid":"ud-sessions-table",children:[(0,t.jsx)(_e,{children:(0,t.jsxs)(V,{children:[(0,t.jsx)(U,{children:n("expires")}),(0,t.jsx)(U,{children:n("ip")}),(0,t.jsx)(U,{children:n("user agent")}),(0,t.jsx)(U,{"aria-label":n("Actions")})]})}),(0,t.jsx)(Pe,{children:u.map(r=>(0,t.jsxs)(V,{"data-testid":`ud-session-${r.id}`,children:[(0,t.jsx)(z,{className:"text-muted-foreground tabular-nums",children:te(r.expiresAt)}),(0,t.jsx)(z,{children:r.ipAddress??""}),(0,t.jsx)(z,{className:"max-w-40 truncate",children:r.userAgent??""}),(0,t.jsx)(z,{children:(0,t.jsx)(_,{"data-testid":`ud-revoke-${r.id}`,disabled:i,onClick:s(()=>{v(r.id)},"onClick"),size:"xs",type:"button",variant:"ghost",children:n("Revoke")})})]},r.id))})]})})}),e[19]=i,e[20]=v,e[21]=u,e[22]=n,e[23]=N):N=e[23];let f;return e[24]!==m||e[25]!==b||e[26]!==x||e[27]!==N?(f=(0,t.jsxs)("div",{className:"flex flex-col gap-2","data-testid":"ud-sessions",children:[m,b,x,N]}),e[24]=m,e[25]=b,e[26]=x,e[27]=N,e[28]=f):f=e[28],f},"ht"),vt=s(h=>{let e=(0,G.c)(30),{busy:i,runAction:l,userId:o,version:a}=h,p=J(),n=Q(),[u,c]=(0,C.useState)(null),[y,w]=(0,C.useState)(null),g;e[0]!==p||e[1]!==o?(g=s(()=>{X((async()=>{w(null);try{c(await p.listAuthAccounts({userId:o}))}catch(r){let S=r;c(null),w(Ee(S))}})())},"g"),e[0]=p,e[1]=o,e[2]=g):g=e[2];let I;e[3]!==p||e[4]!==o||e[5]!==a?(I=[p,o,a],e[3]=p,e[4]=o,e[5]=a,e[6]=I):I=e[6],(0,C.useEffect)(g,I);let k;e[7]!==p||e[8]!==l||e[9]!==o?(k=s(r=>{l(()=>p.unlinkAuthAccount({accountId:r,userId:o}))},"k"),e[7]=p,e[8]=l,e[9]=o,e[10]=k):k=e[10];let v=k,d;e[11]!==n?(d=n("Linked accounts"),e[11]=n,e[12]=d):d=e[12];let m;e[13]!==d?(m=(0,t.jsx)(Ye,{children:d}),e[13]=d,e[14]=m):m=e[14];let b;e[15]!==y?(b=y!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive",role:"alert",children:y}),e[15]=y,e[16]=b):b=e[16];let x;e[17]!==u||e[18]!==n?(x=u!==null&&u.length===0&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:n("No linked accounts.")}),e[17]=u,e[18]=n,e[19]=x):x=e[19];let N;e[20]!==u||e[21]!==i||e[22]!==v||e[23]!==n?(N=u!==null&&u.length>0&&(0,t.jsx)(K,{className:"overflow-hidden py-0",children:(0,t.jsx)(W,{className:"px-0",children:(0,t.jsxs)(ze,{"data-testid":"ud-accounts-table",children:[(0,t.jsx)(_e,{children:(0,t.jsxs)(V,{children:[(0,t.jsx)(U,{children:n("provider")}),(0,t.jsx)(U,{children:n("created")}),(0,t.jsx)(U,{"aria-label":n("Actions")})]})}),(0,t.jsx)(Pe,{children:u.map(r=>{let S=Ue(r.id);return(0,t.jsxs)(V,{"data-testid":`ud-account-${S}`,children:[(0,t.jsx)(z,{children:Ue(r.providerId)}),(0,t.jsx)(z,{className:"text-muted-foreground tabular-nums",children:te(r.createdAt)}),(0,t.jsx)(z,{children:(0,t.jsx)(_,{"data-testid":`ud-unlink-${S}`,disabled:i,onClick:s(()=>{v(S)},"onClick"),size:"xs",type:"button",variant:"ghost",children:n("Unlink")})})]},S)})})]})})}),e[20]=u,e[21]=i,e[22]=v,e[23]=n,e[24]=N):N=e[24];let f;return e[25]!==m||e[26]!==b||e[27]!==x||e[28]!==N?(f=(0,t.jsxs)("div",{className:"flex flex-col gap-2","data-testid":"ud-accounts",children:[m,b,x,N]}),e[25]=m,e[26]=b,e[27]=x,e[28]=N,e[29]=f):f=e[29],f},"ft"),gt=s(h=>{let e=(0,G.c)(40),{busy:i,capabilities:l,runAction:o,userId:a,version:p}=h,n=J(),u=Q(),[c,y]=(0,C.useState)(null),w;e[0]!==l.passkey||e[1]!==n||e[2]!==a?(w=s(()=>{l.passkey&&X((async()=>{try{y(await n.listAuthPasskeys({userId:a}))}catch{y(null)}})())},"C"),e[0]=l.passkey,e[1]=n,e[2]=a,e[3]=w):w=e[3];let g;e[4]!==l.passkey||e[5]!==n||e[6]!==a||e[7]!==p?(g=[l.passkey,n,a,p],e[4]=l.passkey,e[5]=n,e[6]=a,e[7]=p,e[8]=g):g=e[8],(0,C.useEffect)(w,g);let I;e[9]!==n||e[10]!==o||e[11]!==a?(I=s(()=>{o(()=>n.disableAuthTwoFactor({userId:a}))},"w"),e[9]=n,e[10]=o,e[11]=a,e[12]=I):I=e[12];let k=I,v;e[13]!==n||e[14]!==o?(v=s(S=>{o(()=>n.deleteAuthPasskey({passkeyId:S}))},"v"),e[13]=n,e[14]=o,e[15]=v):v=e[15];let d=v,m;e[16]!==u?(m=u("Security"),e[16]=u,e[17]=m):m=e[17];let b;e[18]!==m?(b=(0,t.jsx)(Ye,{children:m}),e[18]=m,e[19]=b):b=e[19];let x;e[20]!==i||e[21]!==l.twoFactor||e[22]!==k||e[23]!==u?(x=l.twoFactor&&(0,t.jsx)(_,{"data-testid":"ud-disable-2fa",disabled:i,onClick:k,size:"sm",type:"button",variant:"outline",children:u("Disable two-factor")}),e[20]=i,e[21]=l.twoFactor,e[22]=k,e[23]=u,e[24]=x):x=e[24];let N;e[25]!==l.passkey||e[26]!==c||e[27]!==u?(N=l.passkey&&c!==null&&c.length===0&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:u("No passkeys.")}),e[25]=l.passkey,e[26]=c,e[27]=u,e[28]=N):N=e[28];let f;e[29]!==i||e[30]!==l.passkey||e[31]!==d||e[32]!==c||e[33]!==u?(f=l.passkey&&c!==null&&c.length>0&&(0,t.jsx)(K,{className:"overflow-hidden py-0",children:(0,t.jsx)(W,{className:"px-0",children:(0,t.jsxs)(ze,{"data-testid":"ud-passkeys-table",children:[(0,t.jsx)(_e,{children:(0,t.jsxs)(V,{children:[(0,t.jsx)(U,{children:u("name")}),(0,t.jsx)(U,{children:u("created")}),(0,t.jsx)(U,{"aria-label":u("Actions")})]})}),(0,t.jsx)(Pe,{children:c.map(S=>{let $=Ue(S.id);return(0,t.jsxs)(V,{"data-testid":`ud-passkey-${$}`,children:[(0,t.jsx)(z,{children:Ue(S.name)||$}),(0,t.jsx)(z,{className:"text-muted-foreground tabular-nums",children:te(S.createdAt)}),(0,t.jsx)(z,{children:(0,t.jsx)(_,{"data-testid":`ud-delete-passkey-${$}`,disabled:i,onClick:s(()=>{d($)},"onClick"),size:"xs",type:"button",variant:"ghost",children:u("Delete")})})]},$)})})]})})}),e[29]=i,e[30]=l.passkey,e[31]=d,e[32]=c,e[33]=u,e[34]=f):f=e[34];let r;return e[35]!==b||e[36]!==x||e[37]!==N||e[38]!==f?(r=(0,t.jsxs)("div",{className:"flex flex-col gap-2","data-testid":"ud-security",children:[b,x,N,f]}),e[35]=b,e[36]=x,e[37]=N,e[38]=f,e[39]=r):r=e[39],r},"pt"),bt=/(?:at|expires)$/iu,xt=/^[1-9]\d*$/u,yt=new Set(["banExpires","banned","banReason","email","emailVerified","id","name","role"]),Nt=s(h=>{let e=(0,G.c)(51),{busy:i,onBan:l}=h,o=Q(),[a,p]=(0,C.useState)(""),[n,u]=(0,C.useState)(""),[c,y]=(0,C.useState)(!1),w;e[0]!==n?(w=xt.test(n.trim())&&Number.isSafeInteger(Number(n.trim())*86400)?Number(n.trim()):void 0,e[0]=n,e[1]=w):w=e[1];let g=w,I=c||g!==void 0,k;e[2]!==l||e[3]!==c||e[4]!==a||e[5]!==g?(k=s(()=>{l({expiresInSeconds:c||g===void 0?void 0:g*86400,reason:a.trim()===""?void 0:a.trim()})},"k"),e[2]=l,e[3]=c,e[4]=a,e[5]=g,e[6]=k):k=e[6];let v=k,d;e[7]!==o?(d=o("Ban reason (optional)"),e[7]=o,e[8]=d):d=e[8];let m;e[9]!==d?(m=(0,t.jsx)(O,{htmlFor:"ud-ban-reason",children:d}),e[9]=d,e[10]=m):m=e[10];let b;e[11]===Symbol.for("react.memo_cache_sentinel")?(b=s(E=>{p(E.target.value)},"b"),e[11]=b):b=e[11];let x;e[12]!==a?(x=(0,t.jsx)(T,{"data-testid":"ud-ban-reason",id:"ud-ban-reason",onChange:b,value:a}),e[12]=a,e[13]=x):x=e[13];let N;e[14]!==m||e[15]!==x?(N=(0,t.jsxs)("div",{className:"flex flex-1 flex-col gap-1",children:[m,x]}),e[14]=m,e[15]=x,e[16]=N):N=e[16];let f;e[17]!==o?(f=o("Days"),e[17]=o,e[18]=f):f=e[18];let r;e[19]!==f?(r=(0,t.jsx)(O,{htmlFor:"ud-ban-days",children:f}),e[19]=f,e[20]=r):r=e[20];let S;e[21]!==n||e[22]!==g?(S=n.trim()!==""&&g===void 0,e[21]=n,e[22]=g,e[23]=S):S=e[23];let $;e[24]===Symbol.for("react.memo_cache_sentinel")?($=s(E=>{u(E.target.value)},"T"),e[24]=$):$=e[24];let B;e[25]!==n||e[26]!==c||e[27]!==S?(B=(0,t.jsx)(T,{"aria-invalid":S,"data-testid":"ud-ban-days",disabled:c,id:"ud-ban-days",min:1,onChange:$,step:1,type:"number",value:n}),e[25]=n,e[26]=c,e[27]=S,e[28]=B):B=e[28];let q;e[29]!==B||e[30]!==r?(q=(0,t.jsxs)("div",{className:"flex w-24 flex-col gap-1",children:[r,B]}),e[29]=B,e[30]=r,e[31]=q):q=e[31];let D;e[32]===Symbol.for("react.memo_cache_sentinel")?(D=s(E=>{y(E.target.checked)},"_"),e[32]=D):D=e[32];let Y;e[33]!==c?(Y=(0,t.jsx)("input",{checked:c,className:"size-4 accent-destructive","data-testid":"ud-ban-permanent",id:"ud-ban-permanent",onChange:D,type:"checkbox"}),e[33]=c,e[34]=Y):Y=e[34];let j;e[35]!==o?(j=o("Permanent"),e[35]=o,e[36]=j):j=e[36];let M;e[37]!==Y||e[38]!==j?(M=(0,t.jsxs)(O,{className:"flex items-center gap-1.5 pb-2 text-xs font-normal",htmlFor:"ud-ban-permanent",children:[Y,j]}),e[37]=Y,e[38]=j,e[39]=M):M=e[39];let Z=i||!I,P;e[40]!==o?(P=o("Ban user"),e[40]=o,e[41]=P):P=e[41];let L;e[42]!==v||e[43]!==Z||e[44]!==P?(L=(0,t.jsx)(_,{"data-testid":"ud-ban",disabled:Z,onClick:v,size:"sm",type:"button",variant:"destructive",children:P}),e[42]=v,e[43]=Z,e[44]=P,e[45]=L):L=e[45];let F;return e[46]!==q||e[47]!==M||e[48]!==L||e[49]!==N?(F=(0,t.jsxs)("div",{className:"flex items-end gap-2",children:[N,q,M,L]}),e[46]=q,e[47]=M,e[48]=L,e[49]=N,e[50]=F):F=e[50],F},"xt"),kt=s((h,e)=>typeof e=="number"&&bt.test(h)?te(e):Ue(e),"yt"),wt=s(({capabilities:h,onChanged:e,onClose:i,user:l})=>{let o=J(),a=Q(),p=l.banned===!0,[n,u]=(0,C.useState)(null),[c,y]=(0,C.useState)(!1),[w,g]=(0,C.useState)(0),[I,k]=(0,C.useState)(typeof l.role=="string"?l.role:""),[v,d]=(0,C.useState)(""),[m,b]=(0,C.useState)(null),[x,N]=(0,C.useState)(!1),f=s((F,E)=>{X((async()=>{y(!0),u(null);try{let $e=await F();E?.refresh!==!1&&(g(ae=>ae+1),e()),E?.onResult?.($e)}catch($e){u(Ee($e))}y(!1)})())},"p"),r=s(F=>{k(F.target.value)},"i"),S=s(F=>{d(F.target.value)},"I"),$=s(()=>{let F=I.trim();F!==""&&f(async()=>{await o.setAuthUserRole({role:F,userId:l.id})})},"T"),B=s(F=>{f(async()=>{await o.banAuthUser({...F,userId:l.id})})},"L"),q=s(()=>{f(async()=>{await o.unbanAuthUser({userId:l.id})})},"j"),D=s(()=>{f(async()=>{await o.setAuthUserPassword({newPassword:v,userId:l.id}),d("")})},"_"),Y=s(()=>{f(()=>o.impersonateAuthUser({userId:l.id}),{onResult:s(F=>{b(F.token)},"onResult"),refresh:!1})},"H"),j=s(()=>{f(async()=>{await o.revokeAuthUserSessions({userId:l.id})})},"z"),M=s(()=>{f(async()=>{await o.removeAuthUser({userId:l.id}),i()})},"M"),Z=s(()=>{N(!0)},"Y"),P=s(()=>{N(!1)},"E"),L=Object.entries(l).filter(([F])=>!yt.has(F));return(0,t.jsxs)(qe,{label:a("User details"),onClose:i,panelTestId:"ud-panel",testId:"ud-overlay",variant:"drawer",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("h2",{className:"text-sm font-semibold text-foreground",children:l.name??l.email??l.id}),(0,t.jsx)("p",{className:"font-mono text-xs text-muted-foreground",children:l.id}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5 pt-1",children:[typeof l.role=="string"&&l.role!==""&&(0,t.jsx)(H,{variant:"secondary",children:l.role}),p?(0,t.jsx)(H,{variant:"destructive",children:a("Banned")}):(0,t.jsx)(H,{variant:"outline",children:a("Active")}),l.emailVerified===!0?(0,t.jsx)(H,{variant:"secondary",children:a("verified")}):(0,t.jsx)(H,{variant:"outline",children:a("unverified")})]})]}),(0,t.jsx)(_,{"data-testid":"ud-close",onClick:i,size:"sm",type:"button",variant:"ghost",children:a("Close")})]}),n!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"ud-action-error",role:"alert",children:n}),h.admin&&(0,t.jsxs)(K,{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:a("Actions")})}),(0,t.jsxs)(W,{className:"flex flex-col gap-3 p-3",children:[(0,t.jsxs)("div",{className:"flex items-end gap-2",children:[(0,t.jsxs)("div",{className:"flex flex-1 flex-col gap-1",children:[(0,t.jsx)(O,{htmlFor:"ud-role",children:a("Role")}),(0,t.jsx)(T,{"data-testid":"ud-role-input",id:"ud-role",onChange:r,value:I})]}),(0,t.jsx)(_,{"data-testid":"ud-set-role",disabled:c||I.trim()==="",onClick:$,size:"sm",type:"button",variant:"outline",children:a("Set role")})]}),p?(0,t.jsx)(_,{"data-testid":"ud-unban",disabled:c,onClick:q,size:"sm",type:"button",variant:"outline",children:a("Unban")}):(0,t.jsx)(Nt,{busy:c,onBan:B}),(0,t.jsxs)("div",{className:"flex items-end gap-2",children:[(0,t.jsxs)("div",{className:"flex flex-1 flex-col gap-1",children:[(0,t.jsx)(O,{htmlFor:"ud-password",children:a("New password")}),(0,t.jsx)(T,{"data-testid":"ud-password",id:"ud-password",onChange:S,type:"password",value:v})]}),(0,t.jsx)(_,{"data-testid":"ud-set-password",disabled:c||v==="",onClick:D,size:"sm",type:"button",variant:"outline",children:a("Set password")})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(_,{"data-testid":"ud-impersonate",disabled:c,onClick:Y,size:"sm",type:"button",variant:"outline",children:a("Impersonate")}),(0,t.jsx)(_,{"data-testid":"ud-revoke-all",disabled:c,onClick:j,size:"sm",type:"button",variant:"outline",children:a("Revoke all sessions")}),x?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(_,{"data-testid":"ud-delete-confirm",disabled:c,onClick:M,size:"sm",type:"button",variant:"destructive",children:a("Confirm delete")}),(0,t.jsx)(_,{"data-testid":"ud-delete-cancel",onClick:P,size:"sm",type:"button",variant:"ghost",children:a("Cancel")})]}):(0,t.jsx)(_,{"data-testid":"ud-delete",disabled:c,onClick:Z,size:"sm",type:"button",variant:"destructive",children:a("Delete user")})]}),m!==null&&(0,t.jsxs)("div",{className:"flex flex-col gap-1","data-testid":"ud-impersonation",children:[(0,t.jsx)(O,{htmlFor:"ud-token",children:a("Impersonation token")}),(0,t.jsx)(T,{"data-testid":"ud-token",id:"ud-token",readOnly:!0,value:m})]})]})]}),(0,t.jsx)(ft,{busy:c,runAction:f,userId:l.id,version:w}),h.accounts&&(0,t.jsx)(vt,{busy:c,runAction:f,userId:l.id,version:w}),(h.twoFactor||h.passkey)&&(0,t.jsx)(gt,{busy:c,capabilities:h,runAction:f,userId:l.id,version:w}),(0,t.jsxs)("div",{className:"flex flex-col gap-1","data-testid":"ud-fields",children:[(0,t.jsx)("h3",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:a("Fields")}),(0,t.jsx)("dl",{className:"flex flex-col",children:L.map(([F,E])=>(0,t.jsxs)("div",{className:"flex flex-col border-t border-border py-1.5",children:[(0,t.jsx)("dt",{className:"text-xs font-semibold text-muted-foreground",children:F}),(0,t.jsx)("dd",{className:"m-0 font-mono text-xs break-words",children:kt(F,E)})]},F))})]})]})},"Nt"),Ct=50,Ht=s(({pageSize:h=Ct}={})=>{let e=J(),i=Q(),[l,o]=(0,C.useState)(""),[a,p]=(0,C.useState)(""),[n,u]=(0,C.useState)(0),c=Xe(l),[y,w]=(0,C.useState)(null),[g,I]=(0,C.useState)(!1),{capabilities:k}=st(),v=c.trim(),d=a.trim(),m=He(["lunora-auth-users",v,d,h,n],()=>e.listAuthUsers({filterField:d===""?void 0:"role",filterValue:d===""?void 0:d,limit:h,offset:n,search:v===""?void 0:v}).then(r=>({...r,offset:n})),{keepPreviousData:!0}),b=m.data?.rows??null,x=m.error,N=s(()=>{m.refetch()},"N");Ge(()=>{m.refetch()},!0);let f=y===null?null:b?.find(r=>r.id===y)??null;return(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-users",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(T,{"aria-label":i("Search users"),className:"w-56","data-testid":"us-search",onChange:s(r=>{o(r.target.value),u(0)},"onChange"),placeholder:i("Search by email or name\u2026"),value:l}),(0,t.jsx)(T,{"aria-label":i("Filter by role"),className:"w-40","data-testid":"us-role-filter",onChange:s(r=>{p(r.target.value),u(0)},"onChange"),placeholder:i("Filter by role"),value:a}),(0,t.jsx)(_,{"data-testid":"us-new",onClick:s(()=>{I(!0)},"onClick"),size:"sm",type:"button",children:i("New user")})]}),x!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"us-users-error",role:"alert",children:x}),b!==null&&b.length===0&&(0,t.jsx)(Me,{description:i("Users who sign up to your app will appear here."),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:"M16 20v-2a4 4 0 0 0-4-4H7a4 4 0 0 0-4 4v2M9.5 10a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Zm11.5 10v-2a4 4 0 0 0-3-3.85"})}),testId:"us-empty",title:i("No users.")}),b!==null&&b.length>0&&(0,t.jsx)(K,{className:"overflow-hidden py-0",children:(0,t.jsx)(W,{className:"px-0",children:(0,t.jsxs)(ze,{"data-testid":"us-table",children:[(0,t.jsx)(_e,{children:(0,t.jsxs)(V,{children:[(0,t.jsx)(U,{children:i("id")}),(0,t.jsx)(U,{children:i("email")}),(0,t.jsx)(U,{children:i("name")}),(0,t.jsx)(U,{children:i("role")}),(0,t.jsx)(U,{children:i("status")}),(0,t.jsx)(U,{children:i("verified")}),(0,t.jsx)(U,{children:i("created")}),(0,t.jsx)(U,{"aria-label":i("Actions")})]})}),(0,t.jsx)(Pe,{children:b.map(r=>(0,t.jsxs)(V,{"data-testid":`us-row-${r.id}`,children:[(0,t.jsx)(z,{className:"font-mono text-xs",children:r.id}),(0,t.jsx)(z,{children:r.email??""}),(0,t.jsx)(z,{children:r.name??""}),(0,t.jsx)(z,{children:typeof r.role=="string"&&r.role!==""?(0,t.jsx)(H,{variant:"secondary",children:r.role}):""}),(0,t.jsx)(z,{children:r.banned===!0?(0,t.jsx)(H,{variant:"destructive",children:i("Banned")}):(0,t.jsx)(H,{variant:"success",children:i("Active")})}),(0,t.jsx)(z,{children:r.emailVerified===!0?(0,t.jsx)(H,{variant:"success",children:i("yes")}):(0,t.jsx)(H,{variant:"outline",children:i("no")})}),(0,t.jsx)(z,{className:"text-muted-foreground tabular-nums",children:te(r.createdAt)}),(0,t.jsx)(z,{children:(0,t.jsx)(_,{"data-testid":`us-manage-${r.id}`,onClick:s(()=>{w(r.id)},"onClick"),size:"xs",type:"button",variant:"ghost",children:i("Manage")})})]},r.id))})]})})}),b!==null&&(0,t.jsx)(Je,{count:b.length,offset:m.data?.offset??0,onOffsetChange:u,pageSize:h,prefix:"us",total:m.data?.total}),f!==null&&(0,t.jsx)(wt,{capabilities:k,onChanged:N,onClose:s(()=>{w(null)},"onClose"),user:f}),g&&(0,t.jsx)(pt,{onClose:s(()=>{I(!1)},"onClose"),onCreated:N}),k.inviteOnly&&(0,t.jsx)(ct,{})]})},"Ht");export{Ht as UsersPanel};
@@ -0,0 +1 @@
1
+ import{a as d}from"./chunk-UXXDN6Z3.js";import{a as m,d as w,e as P,f as S,g as G}from"./chunk-YKXDMIHQ.js";var M=w(S(),1),v=w(P(),1);var N=w(G(),1);var z=m(r=>{let t=(0,M.c)(18),{count:a,offset:e,onOffsetChange:f,pageSize:o,prefix:s,total:n}=r;if(n===void 0)return null;let c=Math.max(0,Math.floor((n-1)/o)*o),p=e+a<n,x=e>0,i;t[0]!==e||t[1]!==f||t[2]!==o?(i=m(()=>{f(e+o)},"r"),t[0]=e,t[1]=f,t[2]=o,t[3]=i):i=t[3];let l;t[4]!==c||t[5]!==e||t[6]!==f||t[7]!==o?(l=m(()=>{f(Math.max(0,Math.min(e-o,c)))},"l"),t[4]=c,t[5]=e,t[6]=f,t[7]=o,t[8]=l):l=t[8];let h=a===0?0:e+a,g=a===0?0:e+1,u;return t[9]!==s||t[10]!==p||t[11]!==x||t[12]!==i||t[13]!==l||t[14]!==h||t[15]!==g||t[16]!==n?(u=(0,N.jsx)(d,{hasNext:p,hasPrevious:x,onNext:i,onPrevious:l,prefix:s,rangeEnd:h,rangeStart:g,total:n}),t[9]=s,t[10]=p,t[11]=x,t[12]=i,t[13]=l,t[14]=h,t[15]=g,t[16]=n,t[17]=u):u=t[17],u},"G"),A=m(r=>{let t=(0,M.c)(7),a;t[0]!==r?(a={offset:0,owner:r},t[0]=r,t[1]=a):a=t[1];let[e,f]=(0,v.useState)(a);e.owner!==r&&f({offset:0,owner:r});let o=e.owner===r?e.offset:0,s;t[2]!==r?(s=m(c=>{f({offset:c,owner:r})},"a"),t[2]=r,t[3]=s):s=t[3];let n;return t[4]!==o||t[5]!==s?(n=[o,s],t[4]=o,t[5]=s,t[6]=n):n=t[6],n},"N");export{z as a,A as b};
@@ -0,0 +1,15 @@
1
+ import{a}from"./chunk-YKXDMIHQ.js";var n="https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-5xx-errors/",r="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"},IDENTITY_MISMATCH:{hint:["A write queued offline was replayed on a session that now belongs to someone else (a sign-out, or another user's sign-in, while it waited), so the worker refused it rather than commit it as them.","","`@lunora/client` re-resolves the session on this refusal and settles the write itself. If every replay is refused while the same user stays signed in, your worker's `resolveIdentity` returns a different `userId` than better-auth's `user.id`, or the RPC request carries no session cookie."],status:409,title:"Session changed since the write was queued"},CODEGEN_DIAGNOSTIC:{status:500,title:"Codegen diagnostic"},JURISDICTION_MOVE:{hint:["The schema declares `.jurisdiction(...)` and the project has DO-backed auth (`.auth({ namespace })`). Pinning the auth object to the jurisdiction resolves it to a new, empty one: every user, account and session stays in the unpinned object until copied across. Voice sessions are pinned without an acknowledgement: they store nothing, and their transcripts are rows in the already-pinned shards.","",'Acknowledge with `.jurisdiction("eu", { pinAuth: true })` and deploy, then copy the auth tables across with the `__lunora_admin__:copyAuthToJurisdiction` admin op and, once the counts check out, purge the unpinned copy with `__lunora_admin__:purgeUnpinnedAuth` (see [Pinning auth and voice](/docs/concepts/data-residency#pinning-auth-and-voice)). For D1-mode auth the acknowledgement changes nothing.'],status:422,title:"Unacknowledged jurisdiction move"},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` in the `EmailGateConfig` you hand `assertEmailAllowed` / `classifyEmail` / `emailGateMiddleware` (`@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_SHARD_FAILED:{hint:["One or more shards failed to export, so the snapshot would have been short. Nothing is written when this fires \u2014 a partial export must never be mistaken for a complete one.","","The message names each failed shard key and its error. Re-run the export once those shards are reachable; a shard that fails repeatedly is usually over the per-request memory budget, which `backupTables` narrows."],status:502,title:"Export failed on one or more shards"},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"},ID_COLLISION:{hint:["The imported row carries an `_id` that is already held by a DIFFERENT table in this shard. Ids are per-table, so inserting it would leave two tables claiming one id and make a later lookup resolve to whichever one it reached first.","","This is reported per row rather than aborting the import: the remaining rows still apply. Re-mint the id on the source side, or import that table into a shard that does not already hold it."],status:409,title:"Document id already belongs to another table"},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"},AUTH_MOVE_NOT_CONFIGURED:{hint:"The copy needs DO-backed auth (`.auth({ namespace })`) pinned with `.jurisdiction(\u2026, { pinAuth: true })`, and the auth object's `internalSecret` set.",status:400,title:"Auth jurisdiction move not configured"},AUTH_MOVE_TARGET_NOT_EMPTY:{hint:"The pinned auth object holds users the copy did not write (someone signed up there), so copying into it would merge two user bases. Pass `force: true` to copy anyway: a copied row that collides with one of the pinned object's rows is left out and counted under `conflicts`.",status:409,title:"Pinned auth object is not empty"},AUTH_MOVE_CONFLICT:{hint:"A copied row has the same key or unique value (such as an email) as a row the pinned auth object holds on its own, or the pinned object changed a row the source changed too. Nothing from that page was written. Pass `force: true` to keep the pinned object's rows and count the collisions under `conflicts`.",status:409,title:"Auth copy conflict"},AUTH_MOVE_SOURCE_CHANGED:{hint:"The un-pinned auth object changed after the copy read it (an update, a delete, or a new row), for example during a gradual rollout or a rollback. Run the copy again: it reconciles the changed tables. Then purge.",status:409,title:"Un-pinned auth object changed since the copy"},AUTH_MOVE_SOURCE_PURGED:{hint:"The un-pinned auth object was already purged. Its tables may exist again (a rollback served requests there), but they hold only rows written since, so the copy refuses rather than read them as deletions and remove the pinned object's users. Nothing is left to copy.",status:409,title:"Un-pinned auth object already purged"},AUTH_MOVE_INCOMPLETE:{hint:"Run `__lunora_admin__:copyAuthToJurisdiction` until it answers `done: true`, check the per-table counts, then purge.",status:409,title:"Auth copy not finished"},AUTH_MOVE_FAILED:{hint:"The message names the step, the table and the class of the SQLite error; the auth object's log has the full error. The copy resumes where it stopped once the cause is fixed.",status:500,title:"Auth jurisdiction move 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"},DISPATCH_IN_PROGRESS:{hint:"A dispatch with this idempotency id is still running on the shard. Retry it; once the first attempt settles the same id is served from the replay cache.",status:409,title:"Dispatch already in progress"},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_TIMELINE_FORKED:{status:409,title:"CDC timeline forked"},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:{hint:["The caller's credential verified but its expiry has passed. The worker refuses an HTTP call with this code before it runs; a shard drops a socket with close code `4001` and the same code.","","It is a refusal of the credential, not of the call: `@lunora/client` holds a queued write, fires `onTokenExpired`, and re-sends it after `setAuthToken`. The worker can only tell expired from anonymous if your `resolveIdentity` returns the identity with its past `exp` (or `expiresAtMs`), or throws a `LunoraError` with this code. Returning `null` runs the call anonymous."],status:401,title:"Authentication token expired"},TOO_MANY_STREAMS:{status:429,title:"Too many streams"},TOO_MANY_WHISPER_TOPICS:{hint:"Reuse a stable set of whisper topic names, or reconnect \u2014 the per-socket verdict memo is in-memory, so a new connection starts empty. Leaving a topic does not free its entry.",status:429,title:"Too many whisper topics"},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"},LOCAL_DEPENDENCY_MISSING:{hint:["The command Lunora tried to run is not on your PATH, so nothing ran.","","Install it (or put it on PATH) and retry \u2014 `wrangler` ships as a dependency of a Lunora app, so `pnpm install` usually fixes that one; `git` and `docker` are installed separately."],status:500,title:"Required local tool not found"}},c=a(e=>Object.hasOwn(l,e)?l[e]:void 0,"h");var m=[{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(e=>_.test(e),"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(e=>e.includes("defineSchema() not found")||e.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(e=>e.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 `ctx.db` member (the error names the one it hit) \u2014 e.g. `userAccounts` instead of `insert`, or `pageViews` instead of `count`."].join(`
5
+ `),header:"Table name is reserved",id:"lunora-table-reserved",test:a(e=>e.includes("is reserved")&&e.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(e=>e.includes("already exists")&&e.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(e=>e.includes("unknown jurisdiction")||e.includes("jurisdiction")&&e.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(e=>e.includes("must be a literal")&&e.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(e=>e.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(e=>e.includes("unique constraint violation on"),"test")},{body:l.CONFLICT.hint.join(`
11
+ `),header:"Optimistic concurrency conflict",id:"lunora-runtime-occ",test:a(e=>e.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:n,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:n,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:n,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:n,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:n,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:n,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:n,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:r,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:r,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:r,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:r,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:r,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:r,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(e=>e!==void 0&&e>="0"&&e<="9","l"),g=a((e,t)=>{for(let o=e.indexOf(t);o!==-1;o=e.indexOf(t,o+t.length))if(!u(e[o-1])&&!u(e[o+t.length]))return!0;return!1},"_"),T=a((e,t)=>{for(let o of[`error ${t}`,`error: ${t}`])for(let i=e.indexOf(o);i!==-1;i=e.indexOf(o,i+o.length))if(!u(e[i+o.length]))return!0;return!1},"f"),A=/error|cloudflare/iu,p=a(e=>({body:[e.summary,"",`**Likely cause:** ${e.causes}.`,"",`**Fix:** ${e.fix}.`,"",`See [Cloudflare's ${e.family} error docs](${e.docsUrl}).`].join(`
12
+ `),header:`Cloudflare Error ${e.code}: ${e.title}`,id:`cloudflare-error-${e.code}`}),"c"),f=a(e=>{if(!A.test(e))return;let t=e.toLowerCase(),o=t.includes("error"),i=t.includes("cloudflare");if(o){for(let s of d)if(T(t,s.code))return p(s)}if(i){for(let s of d)if(g(t,s.code))return p(s)}},"T"),O=a(e=>(typeof e=="string"?e:e.join(`
13
+ `)).split(`
14
+ `).filter(t=>!t.startsWith("```")).join(`
15
+ `).replaceAll(/\*\*(.+?)\*\*/gu,"$1").replaceAll(/`([^`]+)`/gu,"$1"),"A"),E=a(e=>{for(let t of m)if(t.test(e))return{body:t.body,header:t.header,id:t.id}},"d"),b=a(e=>E(e)??f(e),"b");var h=class extends Error{static{a(this,"l")}type="VisulimaError";hint;title;loc;code;status;docsUrl;data;constructor(t,o,i={}){let s=c(t);super(o??t,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=t,this.status=i.status??s?.status??500,this.docsUrl=i.docsUrl??s?.docsUrl,this.data=i.data}};export{l as a,O as b,b as c,h as d};
@@ -0,0 +1 @@
1
+ import{h as u,p as f}from"./chunk-PTZD7RUZ.js";import{a as s,d as l,e as h,f as S}from"./chunk-YKXDMIHQ.js";var i=l(S(),1),c=l(h(),1);var g=s(()=>{let t=(0,i.c)(4),[a,n]=(0,c.useState)(!1),[e,m]=(0,c.useState)(null),r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s(p=>{f((async()=>{n(!0),m(null);try{await p()}catch(b){m(u(b))}n(!1)})())},"e"),t[0]=r):r=t[0];let y=r,o;return t[1]!==a||t[2]!==e?(o={busy:a,error:e,run:y},t[1]=a,t[2]=e,t[3]=o):o=t[3],o},"g");export{g as a};
@@ -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{c as Ce}from"./chunk-YOB2X3FZ.js";import{a as Pe}from"./chunk-EA2JKR5D.js";import{a as $}from"./chunk-IMOHEGMV.js";import{a as Se}from"./chunk-Z5O2NQAV.js";import{a as be}from"./chunk-EJSI4PMU.js";import"./chunk-OGUKYRFM.js";import"./chunk-OKG3HWSJ.js";import{W as M}from"./chunk-PLHA3OWK.js";import"./chunk-4L4WTGN5.js";import{a as E}from"./chunk-55754F6H.js";import"./chunk-IS6LVJ6L.js";import"./chunk-AAVLPU5Q.js";import{b as F}from"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import{a as ve}from"./chunk-GOSWKLMM.js";import"./chunk-ULIQFBZU.js";import"./chunk-3PWB52UO.js";import"./chunk-35DM4JJG.js";import{a as X}from"./chunk-4ZEL6BYL.js";import{c as ae}from"./chunk-ERHFRNCL.js";import{f as oe}from"./chunk-R4WRHIAN.js";import"./chunk-FSRSK4LY.js";import"./chunk-LCXKALTS.js";import{a as de}from"./chunk-FKVZRPV5.js";import{a as Ne,b as ke,c as we,d as ce,e as re,f as le}from"./chunk-HEAQVSNS.js";import{a as se,b as me,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,m as ge,p as te}from"./chunk-PTZD7RUZ.js";import{a as n,d as ie,e as Re,f as Te,g as Fe}from"./chunk-YKXDMIHQ.js";var f=ie(Re(),1);var pe=ie(Te(),1);var t=ie(Fe(),1);var Ie=["read","insert","update","delete"],Ee=n((e,a)=>({delete:e("Delete"),insert:e("Insert"),read:e("Read"),update:e("Update")})[a],"Ie"),$e=n(e=>e.file===""?e.procedure:`${e.file}:${e.procedure}`,"Re"),ze=n(e=>{let a=new Set;for(let i of e?.advisories??[])if(i.name==="rls_uncovered_table"){let{table:d}=i.metadata;typeof d=="string"&&d!==""&&a.add(d)}return a},"Fe"),De=n((e,a,i)=>{let d=new Map,r=n(s=>{let o=d.get(s);if(o!==void 0)return o;let m={cells:{delete:{},insert:{},read:{},update:{}},maskedColumns:new Set,table:s,uncovered:i.has(s)};return d.set(s,m),m},"r");for(let s of e)r(s.table).cells[s.on]={path:$e(s),procedure:s.procedure};for(let s of a)r(s.table).maskedColumns.add(s.column);for(let s of i)r(s);return[...d.values()].toSorted((s,o)=>s.table.localeCompare(o.table))},"Oe"),Oe=n(e=>{let a=(0,pe.c)(17),i;a[0]!==e?(i=e===void 0?{}:e,a[0]=e,a[1]=i):i=a[1];let{onProbe:d}=i,r=V(),s,o;a[2]===Symbol.for("react.memo_cache_sentinel")?(s={},o={live:!0},a[2]=s,a[3]=o):(s=a[2],o=a[3]);let m=ae(X.rlsPolicies,s,o),l;a[4]===Symbol.for("react.memo_cache_sentinel")?(l={},a[4]=l):l=a[4];let g=ae(X.maskPolicies,l),h;a[5]===Symbol.for("react.memo_cache_sentinel")?(h={},a[5]=h):h=a[5];let b=ae(X.getAdvisories,h),v;if(a[6]!==b.data||a[7]!==g.data||a[8]!==d||a[9]!==m||a[10]!==r){let N=null;m.data!==void 0&&(N=Array.isArray(m.data.policies)?m.data.policies:[]);let z=Array.isArray(g.data?.columns)?g.data.columns:[],j=b.data??null,{error:C,errorSource:k,liveError:I}=m,R=N===null?[]:De(N,z,ze(j)),w;a[12]!==I?(w=(0,t.jsx)("div",{className:"flex items-center justify-end",children:(0,t.jsx)(Se,{message:I,prefix:"pm"})}),a[12]=I,a[13]=w):w=a[13];let u;a[14]!==C||a[15]!==k?(u=C!==null&&(0,t.jsx)(ve,{error:k,testId:"pm-error"}),a[14]=C,a[15]=k,a[16]=u):u=a[16],v=(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-permissions-matrix",children:[w,u,N!==null&&R.length===0?(0,t.jsx)(de,{description:r("Add a `definePolicy` and wire it through `.use(rls(...))` to populate this matrix."),testId:"pm-empty",title:r("No policy")}):(0,t.jsxs)(Ne,{"data-testid":"pm-table",children:[(0,t.jsx)(ke,{children:(0,t.jsxs)(ce,{children:[(0,t.jsx)(re,{children:r("Table")}),Ie.map(p=>(0,t.jsx)(re,{children:Ee(r,p)},p)),(0,t.jsx)(re,{children:r("Masked columns")})]})}),(0,t.jsx)(we,{children:R.map(p=>(0,t.jsxs)(ce,{"data-testid":`pm-row-${p.table}`,children:[(0,t.jsx)(le,{className:"font-mono text-xs",children:(0,t.jsxs)("span",{className:"flex items-center gap-1.5",children:[p.table,p.uncovered&&(0,t.jsx)(F,{"data-testid":`pm-uncovered-${p.table}`,title:r("Uncovered \u2014 reachable without a policy"),variant:"destructive",children:r("Uncovered \u2014 reachable without a policy")})]})}),Ie.map(_=>{let x=p.cells[_];return(0,t.jsx)(le,{"data-testid":`pm-cell-${p.table}-${_}`,children:x.procedure===void 0?(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:r("No policy")}):(0,t.jsxs)("span",{className:"flex flex-col gap-1",children:[(0,t.jsx)(F,{variant:"secondary",children:r("Covered by {procedure}",{procedure:x.procedure})}),d!==void 0&&(0,t.jsx)(E,{className:"h-auto justify-start p-0 text-[11px]","data-testid":`pm-probe-${p.table}-${_}`,onClick:n(()=>{d(p.table,_,x.path??"")},"onClick"),size:"xs",type:"button",variant:"ghost",children:r("Probe this")})]})},_)}),(0,t.jsx)(le,{children:p.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:[...p.maskedColumns].map(Le)})})]},p.table))})]})]}),a[6]=b.data,a[7]=g.data,a[8]=d,a[9]=m,a[10]=r,a[11]=v}else v=a[11];return v},"De");function Le(e){return(0,t.jsx)(F,{variant:"outline",children:e},e)}n(Le,"Le");var je=he(X.runAs),Me=new Set(["FORBIDDEN","RLS_REQUIRED","UNAUTHORIZED"]),Ue=n(e=>{let a=e?.code;return typeof a=="string"?a:void 0},"Me"),qe=n(()=>{let e=oe();return async({args:a,functionPath:i,shardKey:d="",userId:r})=>{if(r.trim()==="")return{kind:"invalid",message:"No identity to probe: enter the userId whose access you want to test."};let s=je;try{return{kind:"allowed",value:await e.query(s,{args:a,functionPath:i,userId:r},xe(d))}}catch(o){let m=o instanceof Error?o.message:String(o),l=Ue(o);return l!==void 0&&Me.has(l)?{kind:"denied",message:m}:{kind:"errored",message:m}}}},"ze"),Je=n(e=>e===void 0?"undefined":JSON.stringify(e,ge,2),"je"),We=n(({functions:e,prefill:a,runAsIdentity:i=!1}={})=>{let d=oe(),r=V(),s=qe(),[o,m]=(0,f.useState)(null),[l,g]=(0,f.useState)(null),h=e??o??[],[b,v]=(0,f.useState)(""),[N,z]=(0,f.useState)("{}"),[j,C]=(0,f.useState)(""),[k,I]=(0,f.useState)(""),[R,w]=(0,f.useState)(!1),[u,p]=(0,f.useState)(null),[_,x]=(0,f.useState)(null),T=(0,f.useRef)(-1),P=(0,f.useRef)(0);(0,f.useEffect)(()=>{if(e!==void 0)return;let c=!1;return d.listFunctions().then(y=>(c||m(y),y)).catch(y=>{c||g(ye(y))}),()=>{c=!0}},[d,e]),(0,f.useEffect)(()=>{if(a===void 0||T.current===a.nonce)return;T.current=a.nonce,P.current+=1;let c=a.functionPath;queueMicrotask(()=>{v(c),p(null)})},[a]);let S=b===""?h[0]?.path??"":b,D=n(async()=>{if(S==="")return;let c;try{c=N.trim()===""?{}:Ce(JSON.parse(N))}catch(A){x(r("Invalid JSON args: {message}",{message:A.message})),p(null);return}P.current+=1;let y=P.current;x(null),w(!0);try{let A=await s({args:c,functionPath:S,shardKey:j.trim(),userId:k.trim()});y===P.current&&p(A)}finally{w(!1)}},"F"),Q=n(()=>{te(D())},"K"),O=n(c=>{v(c.target.value)},"O"),L=n(c=>{z(c.target.value)},"D"),G=n(c=>{I(c.target.value)},"Y");return(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-permissions-playground",children:[l!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"pp-discover-error",role:"alert",children:l}),!i&&(0,t.jsx)(de,{description:r("Dev only: runs the selected function as this user over the admin gate so you can test auth and RLS."),testId:"pp-gate",title:r("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)($,{htmlFor:"pp-function",children:r("Function")}),(0,t.jsx)("select",{"aria-label":r("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:O,value:S,children:h.map(c=>(0,t.jsxs)("option",{value:c.path,children:[c.path," (",c.kind,")"]},c.path))})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)($,{htmlFor:"pp-args",children:r("Arguments")}),(0,t.jsx)(Pe,{"aria-label":r("Arguments"),className:"font-mono text-xs","data-testid":"pp-args",id:"pp-args",onChange:L,value:N})]}),(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)($,{htmlFor:"pp-user",children:r("Run as (userId)")}),(0,t.jsx)(M,{"aria-label":r("Identity (userId) to run as"),className:"font-mono text-xs","data-testid":"pp-user",id:"pp-user",onChange:G,placeholder:r("Required \u2014 the identity to probe as"),value:k})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(E,{"data-testid":"pp-run",disabled:!i||R||S==="",onClick:Q,type:"button",children:r(R?"Probing\u2026":"Run probe")}),k.trim()!==""&&(0,t.jsx)(F,{"data-testid":"pp-as-badge",variant:"secondary",children:r("as {userId}",{userId:k.trim()})})]})]}),_!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"pp-args-error",role:"alert",children:_}),u!==null&&u.kind==="allowed"&&(0,t.jsxs)("div",{className:"flex flex-col gap-2","data-testid":"pp-outcome-allowed",children:[(0,t.jsx)(F,{variant:"secondary",children:r("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)(F,{variant:"outline",children:r("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==="errored"&&(0,t.jsxs)("div",{className:"flex flex-col gap-2","data-testid":"pp-outcome-errored",children:[(0,t.jsx)(F,{variant:"outline",children:r("Errored")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:r("The call failed for a reason that is not an access verdict, so it says nothing about the policy.")}),(0,t.jsx)("pre",{className:"overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-xs","data-testid":"pp-errored",role:"alert",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)(F,{variant:"destructive",children:r("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})]})]})},"qe"),Be="/__lunora/policy-scaffold",He={"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."},Ke=n(async e=>{let a=await fetch(Be,{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 d=i.error;return{kind:"error",message:d===void 0?`policy scaffold failed (${String(a.status)})`:He[d]??d}},"Qe"),_e={exportName:"",filePath:"",policyName:"",policies:"",tableName:""},Qe=n(()=>{let e=(0,pe.c)(69),a=V(),[i,d]=(0,f.useState)(null),[r,s]=(0,f.useState)(!1),[o,m]=(0,f.useState)(null),[l,g]=(0,f.useState)(_e),h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=n(ee=>{let K=ee.target.name,{value:Y}=ee.target;g(Ae=>({...Ae,[K]:Y}))},"u"),e[0]=h):h=e[0];let b=h,v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v=n(()=>{d(null),g(_e)},"v"),e[1]=v):v=e[1];let N=v,z;e[2]===Symbol.for("react.memo_cache_sentinel")?(z=n(async ee=>{s(!0),m(null);try{let K=await Ke(ee);m(K),K.kind==="ok"&&N()}catch(K){let Y=K;m({kind:"error",message:Y instanceof Error?Y.message:String(Y)})}s(!1)},"R"),e[2]=z):z=e[2];let j=z,C;e[3]!==l.policyName||e[4]!==l.tableName?(C=n(()=>{te(j({kind:"scaffoldPolicy",name:l.policyName.trim(),table:l.tableName.trim()}))},"P"),e[3]=l.policyName,e[4]=l.tableName,e[5]=C):C=e[5];let k=C,I;e[6]!==l.exportName||e[7]!==l.filePath||e[8]!==l.policies?(I=n(()=>{te(j({exportName:l.exportName.trim(),filePath:l.filePath.trim(),kind:"wireRls",policies:l.policies.trim()}))},"A"),e[6]=l.exportName,e[7]=l.filePath,e[8]=l.policies,e[9]=I):I=e[9];let R=I,w;e[10]===Symbol.for("react.memo_cache_sentinel")?(w=n(()=>{m(null),d("scaffold")},"S"),e[10]=w):w=e[10];let u=w,p;e[11]===Symbol.for("react.memo_cache_sentinel")?(p=n(()=>{m(null),d("wire")},"m"),e[11]=p):p=e[11];let _=p,x;e[12]!==a?(x=a("Scaffold access rules"),e[12]=a,e[13]=x):x=e[13];let T;e[14]!==x?(T=(0,t.jsx)(fe,{children:x}),e[14]=x,e[15]=T):T=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 S;e[18]!==P?(S=(0,t.jsx)(ue,{children:P}),e[18]=P,e[19]=S):S=e[19];let D;e[20]!==S||e[21]!==T?(D=(0,t.jsxs)(me,{children:[T,S]}),e[20]=S,e[21]=T,e[22]=D):D=e[22];let Q=i==="scaffold"?"default":"outline",O;e[23]!==a?(O=a("New policy file"),e[23]=a,e[24]=O):O=e[24];let L;e[25]!==Q||e[26]!==O?(L=(0,t.jsx)(E,{"data-testid":"policy-scaffolder-new",onClick:u,size:"xs",type:"button",variant:Q,children:O}),e[25]=Q,e[26]=O,e[27]=L):L=e[27];let G=i==="wire"?"default":"outline",c;e[28]!==a?(c=a("Wire into a procedure"),e[28]=a,e[29]=c):c=e[29];let y;e[30]!==G||e[31]!==c?(y=(0,t.jsx)(E,{"data-testid":"policy-scaffolder-wire",onClick:_,size:"xs",type:"button",variant:G,children:c}),e[30]=G,e[31]=c,e[32]=y):y=e[32];let A;e[33]!==L||e[34]!==y?(A=(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[L,y]}),e[33]=L,e[34]=y,e[35]=A):A=e[35];let U;e[36]!==r||e[37]!==l.policyName||e[38]!==l.tableName||e[39]!==i||e[40]!==k||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)($,{htmlFor:"policy-scaffolder-name",children:a("Policy name")}),(0,t.jsx)(M,{"data-testid":"policy-scaffolder-name",id:"policy-scaffolder-name",name:"policyName",onChange:b,value:l.policyName})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)($,{htmlFor:"policy-scaffolder-table",children:a("Table name")}),(0,t.jsx)(M,{"data-testid":"policy-scaffolder-table",id:"policy-scaffolder-table",name:"tableName",onChange:b,value:l.tableName})]}),(0,t.jsx)(E,{"data-testid":"policy-scaffolder-create",disabled:r||l.policyName.trim()===""||l.tableName.trim()==="",onClick:k,size:"xs",type:"button",children:a(r?"Creating\u2026":"Create policy file")}),(0,t.jsx)(E,{onClick:N,size:"xs",type:"button",variant:"ghost",children:a("Cancel")})]}),e[36]=r,e[37]=l.policyName,e[38]=l.tableName,e[39]=i,e[40]=k,e[41]=a,e[42]=U):U=e[42];let q;e[43]!==r||e[44]!==l.exportName||e[45]!==l.filePath||e[46]!==l.policies||e[47]!==i||e[48]!==R||e[49]!==a?(q=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)($,{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:b,value:l.filePath})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)($,{htmlFor:"policy-scaffolder-export",children:a("Exported procedure")}),(0,t.jsx)(M,{"data-testid":"policy-scaffolder-export",id:"policy-scaffolder-export",name:"exportName",onChange:b,value:l.exportName})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)($,{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:b,value:l.policies})]}),(0,t.jsx)(E,{"data-testid":"policy-scaffolder-apply",disabled:r||l.filePath.trim()===""||l.exportName.trim()===""||l.policies.trim()==="",onClick:R,size:"xs",type:"button",children:a(r?"Wiring\u2026":"Wire RLS")}),(0,t.jsx)(E,{onClick:N,size:"xs",type:"button",variant:"ghost",children:a("Cancel")})]}),e[43]=r,e[44]=l.exportName,e[45]=l.filePath,e[46]=l.policies,e[47]=i,e[48]=R,e[49]=a,e[50]=q):q=e[50];let J;e[51]!==o?(J=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]=J):J=e[52];let W;e[53]!==o?.kind||e[54]!==a?(W=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]=W):W=e[55];let B;e[56]!==o||e[57]!==a?(B=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(Ge)})]}),e[56]=o,e[57]=a,e[58]=B):B=e[58];let H;e[59]!==A||e[60]!==U||e[61]!==q||e[62]!==J||e[63]!==W||e[64]!==B?(H=(0,t.jsxs)(ne,{children:[A,U,q,J,W,B]}),e[59]=A,e[60]=U,e[61]=q,e[62]=J,e[63]=W,e[64]=B,e[65]=H):H=e[65];let Z;return e[66]!==D||e[67]!==H?(Z=(0,t.jsxs)(se,{"data-testid":"policy-scaffolder",size:"sm",children:[D,H]}),e[66]=D,e[67]=H,e[68]=Z):Z=e[68],Z},"He");function Ge(e){return(0,t.jsx)("li",{className:"font-mono text-[11px] text-destructive",children:e},e)}n(Ge,"Je");var ft=n(({functions:e,runAsIdentity:a=!1,schemaEditable:i=!1}={})=>{let d=V(),[r,s]=(0,f.useState)(void 0),o=n((m,l,g)=>{g!==""&&s(h=>({functionPath:g,nonce:(h?.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:d("Permissions")})}),(0,t.jsx)(Oe,{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:d("Probe")})}),(0,t.jsxs)(ne,{className:"px-4 py-4",children:[(0,t.jsx)("p",{className:"mb-3 text-sm text-muted-foreground",children:d("Pick a function and an identity, then run it to see the access outcome.")}),(0,t.jsx)(We,{functions:e,prefill:r,runAsIdentity:a})]})]})}),i&&(0,t.jsx)("section",{className:"flex flex-col gap-2",children:(0,t.jsx)(Qe,{})})]})},"ut");export{ft as PermissionsPanel};