@lunora/studio 1.0.0-alpha.361 → 1.0.0-alpha.362

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 (327) hide show
  1. package/dist/index.d.mts +4 -1
  2. package/dist/index.d.ts +4 -1
  3. package/dist/index.mjs +1 -1
  4. package/dist/mount.mjs +1 -1
  5. package/dist/packem_chunks/AdvisorHealthPanel.mjs +1 -1
  6. package/dist/packem_chunks/ApiTab.mjs +1 -1
  7. package/dist/packem_chunks/AuditPanel.mjs +1 -1
  8. package/dist/packem_chunks/ExportImportPanel.mjs +1 -1
  9. package/dist/packem_chunks/FileBrowser.mjs +1 -1
  10. package/dist/packem_chunks/FunctionRunner.mjs +1 -1
  11. package/dist/packem_chunks/FunctionStatsPanel.mjs +1 -1
  12. package/dist/packem_chunks/HealthPanel.mjs +1 -1
  13. package/dist/packem_chunks/InsightsPanel.mjs +1 -1
  14. package/dist/packem_chunks/LogsPanel.mjs +1 -1
  15. package/dist/packem_chunks/MailPanel.mjs +1 -1
  16. package/dist/packem_chunks/MetricsPanel.mjs +1 -1
  17. package/dist/packem_chunks/NotificationsPanel.mjs +1 -1
  18. package/dist/packem_chunks/PitrPanel.mjs +1 -1
  19. package/dist/packem_chunks/SchemaViewer.mjs +1 -1
  20. package/dist/packem_chunks/SecurityAdvisorPanel.mjs +1 -1
  21. package/dist/packem_chunks/SettingsPanel.mjs +1 -1
  22. package/dist/packem_chunks/SqlEditorPanel.mjs +24 -9
  23. package/dist/packem_chunks/TableEditor.mjs +1 -1
  24. package/dist/packem_chunks/agents-panel.mjs +1 -1
  25. package/dist/packem_chunks/ai-knowledge.mjs +1 -0
  26. package/dist/packem_chunks/ai-usage-panel.mjs +1 -1
  27. package/dist/packem_chunks/assistant-panel.mjs +3 -0
  28. package/dist/packem_chunks/auth-audit-panel.mjs +1 -1
  29. package/dist/packem_chunks/containers-panel.mjs +1 -1
  30. package/dist/packem_chunks/dashboards-panel.mjs +1 -1
  31. package/dist/packem_chunks/evals-panel.mjs +1 -1
  32. package/dist/packem_chunks/fanout-panel.mjs +1 -1
  33. package/dist/packem_chunks/flags-panel.mjs +1 -1
  34. package/dist/packem_chunks/issues-panel.mjs +1 -1
  35. package/dist/packem_chunks/kv-browser.mjs +1 -1
  36. package/dist/packem_chunks/log-drains-panel.mjs +1 -1
  37. package/dist/packem_chunks/migrations-route.mjs +1 -1
  38. package/dist/packem_chunks/payments-panel.mjs +1 -1
  39. package/dist/packem_chunks/permissions-panel.mjs +1 -1
  40. package/dist/packem_chunks/privacy-requests-panel.mjs +1 -1
  41. package/dist/packem_chunks/queues-panel.mjs +1 -1
  42. package/dist/packem_chunks/reactors-panel.mjs +1 -1
  43. package/dist/packem_chunks/rls-panel.mjs +1 -1
  44. package/dist/packem_chunks/schedule-panel.mjs +1 -1
  45. package/dist/packem_chunks/storage-rules-panel.mjs +1 -1
  46. package/dist/packem_chunks/subscriptions-panel.mjs +1 -1
  47. package/dist/packem_chunks/traces-panel.mjs +1 -1
  48. package/dist/packem_chunks/workflows-panel.mjs +1 -1
  49. package/dist/packem_shared/ADMIN_FUNCTIONS-DUXsXId1.mjs +1 -0
  50. package/dist/packem_shared/{ApiDocsPanel-DD2Uns6b.mjs → ApiDocsPanel-B9S9l1Ce.mjs} +1 -1
  51. package/dist/packem_shared/{DataBrowser-CVRWnNWu.mjs → DataBrowser-Dm-jhIUP.mjs} +2 -2
  52. package/dist/packem_shared/{GlobalDataBrowser-DC47T6Zl.mjs → GlobalDataBrowser-C1Y8GUhe.mjs} +1 -1
  53. package/dist/packem_shared/{HomePanel-D12HxHQo.mjs → HomePanel-B5ytwPIo.mjs} +1 -1
  54. package/dist/packem_shared/{MigrationsPanel-DMkxSXNl.mjs → MigrationsPanel-CwLikxDT.mjs} +1 -1
  55. package/dist/packem_shared/Studio-B89ZNMOD.mjs +1 -0
  56. package/dist/packem_shared/{StudioApp-isdWpF9P.mjs → StudioApp-C9l1a3A8.mjs} +1 -1
  57. package/dist/packem_shared/advisor-view-CzieqKMe.mjs +5 -0
  58. package/dist/packem_shared/assistant-provider-Bp72uWsq.mjs +1 -0
  59. package/dist/packem_shared/assistant-reason-D6EwMCxT.mjs +1 -0
  60. package/dist/packem_shared/{cf-links-CBJ5SywP.mjs → cf-links-C4DVTr8A.mjs} +1 -1
  61. package/dist/packem_shared/error-alert-DKXm5h19.mjs +6 -0
  62. package/dist/packem_shared/{home-panel-CDVTuTF8.mjs → home-panel-5fGktYeD.mjs} +1 -1
  63. package/dist/packem_shared/recording-client-z4CBi0y8.mjs +1 -0
  64. package/dist/packem_shared/studio-gZfpz1wC.mjs +2 -0
  65. package/dist/packem_shared/{table-list-sidebar-CNadcIgG.mjs → table-list-sidebar-kpHaDWjy.mjs} +1 -1
  66. package/dist/packem_shared/use-assistant-rpc-GCUK2zPa.mjs +1 -0
  67. package/dist/standalone/chunk-2DT3QG6Q.js +1 -0
  68. package/dist/standalone/chunk-2EB7FN5S.js +1 -0
  69. package/dist/standalone/chunk-2FTGLXYA.js +1 -0
  70. package/dist/standalone/chunk-2H6VLY2M.js +1 -0
  71. package/dist/standalone/chunk-2NGKUO32.js +1 -0
  72. package/dist/standalone/chunk-2SNHKJXK.js +1 -0
  73. package/dist/standalone/chunk-2W4UO5BC.js +1 -0
  74. package/dist/standalone/{chunk-SLIDAWNX.js → chunk-3D67ZJRW.js} +1 -1
  75. package/dist/standalone/chunk-3RZD6VJ7.js +1 -0
  76. package/dist/standalone/chunk-3X3NXJBR.js +1 -0
  77. package/dist/standalone/chunk-4EPW63HS.js +1 -0
  78. package/dist/standalone/{chunk-WS36BO4R.js → chunk-4NKJV7YX.js} +1 -1
  79. package/dist/standalone/chunk-4PI2OSSP.js +1 -0
  80. package/dist/standalone/chunk-53CGUTRT.js +1 -0
  81. package/dist/standalone/chunk-5EWIOOBI.js +1 -0
  82. package/dist/standalone/chunk-5GYHGDIF.js +8 -0
  83. package/dist/standalone/chunk-5NIQHOPN.js +1 -0
  84. package/dist/standalone/chunk-5O7ICPWV.js +1 -0
  85. package/dist/standalone/chunk-5PEAXTYQ.js +1 -0
  86. package/dist/standalone/{chunk-O2NMPIV2.js → chunk-5WNGRT7N.js} +1 -1
  87. package/dist/standalone/chunk-66BMMNUR.js +1 -0
  88. package/dist/standalone/chunk-66LYVBXB.js +1 -0
  89. package/dist/standalone/chunk-6FPV3EK2.js +1 -0
  90. package/dist/standalone/chunk-6G3E4PJ2.js +1 -0
  91. package/dist/standalone/chunk-6KE7ILEZ.js +1 -0
  92. package/dist/standalone/chunk-7KJCRT4B.js +1 -0
  93. package/dist/standalone/chunk-7O5SGABV.js +1 -0
  94. package/dist/standalone/chunk-7QEZ2SFW.js +1 -0
  95. package/dist/standalone/chunk-7WV3EPE6.js +1 -0
  96. package/dist/standalone/chunk-A2Q3TGIQ.js +1 -0
  97. package/dist/standalone/chunk-ABMHWBYA.js +1 -0
  98. package/dist/standalone/chunk-AEU3EF4T.js +1 -0
  99. package/dist/standalone/chunk-ALQHMFOC.js +1 -0
  100. package/dist/standalone/chunk-AZIKM5BA.js +1 -0
  101. package/dist/standalone/chunk-BCUOQNI2.js +1 -0
  102. package/dist/standalone/chunk-BG2CJOVS.js +1 -0
  103. package/dist/standalone/chunk-BKI3JMXQ.js +1 -0
  104. package/dist/standalone/chunk-BO5NNWMO.js +1 -0
  105. package/dist/standalone/chunk-BX7TFVCC.js +1 -0
  106. package/dist/standalone/chunk-CKEQX655.js +1 -0
  107. package/dist/standalone/{chunk-DX55P3KZ.js → chunk-CL3JOU6F.js} +1 -1
  108. package/dist/standalone/chunk-COLSZPCE.js +1 -0
  109. package/dist/standalone/chunk-CVSIFPI5.js +1 -0
  110. package/dist/standalone/chunk-D65UVZIA.js +1 -0
  111. package/dist/standalone/{chunk-DBVJ5VLI.js → chunk-DA2CAFXI.js} +1 -1
  112. package/dist/standalone/chunk-DB6QX4X6.js +1 -0
  113. package/dist/standalone/{chunk-7ZIYHKLX.js → chunk-E2FFHKGI.js} +3 -3
  114. package/dist/standalone/chunk-EE2COWFF.js +1 -0
  115. package/dist/standalone/chunk-ELSQ4FVH.js +1 -0
  116. package/dist/standalone/chunk-EXFERMUT.js +1 -0
  117. package/dist/standalone/chunk-FACXM2UB.js +7 -0
  118. package/dist/standalone/chunk-FBDIQ67D.js +1 -0
  119. package/dist/standalone/chunk-FHLODLBC.js +1 -0
  120. package/dist/standalone/chunk-FQEZUQ36.js +1 -0
  121. package/dist/standalone/{chunk-VEWQWS3J.js → chunk-FWM5Z6CH.js} +1 -1
  122. package/dist/standalone/chunk-GC3GKGWD.js +1 -0
  123. package/dist/standalone/chunk-GJXCPZDN.js +1 -0
  124. package/dist/standalone/chunk-GNI37YCV.js +33 -0
  125. package/dist/standalone/chunk-GVZ3VFGG.js +1 -0
  126. package/dist/standalone/chunk-GWNGVKLG.js +1 -0
  127. package/dist/standalone/chunk-GXTSE66Z.js +1 -0
  128. package/dist/standalone/chunk-H7BQUL7D.js +1 -0
  129. package/dist/standalone/chunk-HCCQTUHS.js +1 -0
  130. package/dist/standalone/chunk-HCOF7HOM.js +1 -0
  131. package/dist/standalone/chunk-HZDLUAWS.js +1 -0
  132. package/dist/standalone/chunk-IDZLHZIA.js +1 -0
  133. package/dist/standalone/{chunk-SU5DTRGK.js → chunk-IHGRWY3Y.js} +1 -1
  134. package/dist/standalone/chunk-IUGNIG6L.js +6 -0
  135. package/dist/standalone/chunk-J3BZWYJQ.js +1 -0
  136. package/dist/standalone/chunk-J45HAKBU.js +1 -0
  137. package/dist/standalone/chunk-J4PQAVOF.js +1 -0
  138. package/dist/standalone/chunk-J6FR2B77.js +1 -0
  139. package/dist/standalone/chunk-J6XQKD2F.js +1 -0
  140. package/dist/standalone/chunk-JCRFMCNP.js +1 -0
  141. package/dist/standalone/chunk-JD6PRRFO.js +1 -0
  142. package/dist/standalone/chunk-JENPPZFV.js +1 -0
  143. package/dist/standalone/chunk-JHTL3QHW.js +1 -0
  144. package/dist/standalone/chunk-JOPNP4EO.js +1 -0
  145. package/dist/standalone/chunk-JVP3TR3A.js +1 -0
  146. package/dist/standalone/chunk-KGLIQIZU.js +1 -0
  147. package/dist/standalone/{chunk-ONWGX5Y4.js → chunk-KH6OXCG3.js} +1 -1
  148. package/dist/standalone/{chunk-3FS22LNI.js → chunk-L26RMC2W.js} +3 -3
  149. package/dist/standalone/chunk-L2FYX4FN.js +1 -0
  150. package/dist/standalone/{chunk-XIRKBJPD.js → chunk-LPFUEJZ4.js} +5 -5
  151. package/dist/standalone/chunk-LSEUUZN4.js +1 -0
  152. package/dist/standalone/{chunk-BYOGQ2IV.js → chunk-MJTVTUNI.js} +2 -2
  153. package/dist/standalone/chunk-MQTI3STP.js +1 -0
  154. package/dist/standalone/chunk-N7WQJPOM.js +1 -0
  155. package/dist/standalone/chunk-NF2Q75WM.js +1 -0
  156. package/dist/standalone/chunk-NGZNXNRD.js +1 -0
  157. package/dist/standalone/chunk-O3AZ7JKE.js +1 -0
  158. package/dist/standalone/chunk-OK2QU2EV.js +1 -0
  159. package/dist/standalone/{chunk-IH2CJZF2.js → chunk-ONTGYVAN.js} +1 -1
  160. package/dist/standalone/chunk-OP4QEV27.js +1 -0
  161. package/dist/standalone/chunk-OPIMGKWU.js +1 -0
  162. package/dist/standalone/chunk-OWRKSQPE.js +1 -0
  163. package/dist/standalone/chunk-P5EVJEGC.js +1 -0
  164. package/dist/standalone/chunk-PAZKX7I6.js +1 -0
  165. package/dist/standalone/chunk-PDBW6GTJ.js +1 -0
  166. package/dist/standalone/chunk-PJUVJTDR.js +1 -0
  167. package/dist/standalone/chunk-Q2J73V2C.js +2 -0
  168. package/dist/standalone/chunk-Q2KL457J.js +1 -0
  169. package/dist/standalone/chunk-QAOZXPLU.js +1 -0
  170. package/dist/standalone/{chunk-3PAYDWHN.js → chunk-QEFLZBT7.js} +2 -2
  171. package/dist/standalone/chunk-QKUVJIRX.js +1 -0
  172. package/dist/standalone/chunk-QNM2J7MG.js +1 -0
  173. package/dist/standalone/chunk-QRA7AKYO.js +1 -0
  174. package/dist/standalone/chunk-RCXNYW7P.js +1 -0
  175. package/dist/standalone/chunk-RE7GRXBM.js +1 -0
  176. package/dist/standalone/{chunk-TDVDZ7XQ.js → chunk-RIAOZECW.js} +1 -1
  177. package/dist/standalone/{chunk-LUHXNZI4.js → chunk-RTS5G3ET.js} +1 -1
  178. package/dist/standalone/chunk-S36FVTKK.js +1 -0
  179. package/dist/standalone/chunk-SR6CPTRT.js +1 -0
  180. package/dist/standalone/chunk-T3ZCW3RG.js +1 -0
  181. package/dist/standalone/chunk-TKBTZX4K.js +1 -0
  182. package/dist/standalone/chunk-TMWKF4XM.js +5 -0
  183. package/dist/standalone/chunk-TW4O2BA5.js +159 -0
  184. package/dist/standalone/chunk-UD5REVU2.js +1 -0
  185. package/dist/standalone/{chunk-PQH2LSJX.js → chunk-UQA2AJGI.js} +1 -1
  186. package/dist/standalone/chunk-UW6QNC74.js +3 -0
  187. package/dist/standalone/chunk-UXBNXITB.js +1 -0
  188. package/dist/standalone/chunk-UZ2ZXB74.js +1 -0
  189. package/dist/standalone/chunk-V3BE427M.js +1 -0
  190. package/dist/standalone/chunk-VHPTPEZ4.js +1 -0
  191. package/dist/standalone/chunk-W4LJQYCI.js +1 -0
  192. package/dist/standalone/chunk-WADY55J2.js +30 -0
  193. package/dist/standalone/chunk-WCWP4EAW.js +1 -0
  194. package/dist/standalone/chunk-X54WR7FF.js +1 -0
  195. package/dist/standalone/chunk-XWWQIAF6.js +1 -0
  196. package/dist/standalone/{chunk-SYGCASPT.js → chunk-Y2YLTUMD.js} +1 -1
  197. package/dist/standalone/chunk-YEVTA35E.js +1 -0
  198. package/dist/standalone/{chunk-R36QXQZX.js → chunk-YORPLSI5.js} +1 -1
  199. package/dist/standalone/chunk-YX2N5PJW.js +1 -0
  200. package/dist/standalone/chunk-Z57KMMOK.js +1 -0
  201. package/dist/standalone/chunk-ZFQ253FX.js +1 -0
  202. package/dist/standalone/chunk-ZG3IUVQ2.js +1 -0
  203. package/dist/standalone/chunk-ZKEYRU5C.js +1 -0
  204. package/dist/standalone/{chunk-5R2YO7HF.js → chunk-ZOKSVUID.js} +4 -4
  205. package/dist/standalone/{chunk-H7HZ42JY.js → chunk-ZPQBVYNN.js} +1 -1
  206. package/dist/standalone/chunk-ZSLKFLWE.js +1 -0
  207. package/dist/standalone/chunk-ZSWW2UGP.js +1 -0
  208. package/dist/standalone/studio.js +2 -2
  209. package/dist/styles.css +1 -1
  210. package/package.json +7 -6
  211. package/dist/packem_shared/ADMIN_FUNCTIONS-4aGsMs95.mjs +0 -1
  212. package/dist/packem_shared/Studio-MA8kKZLu.mjs +0 -1
  213. package/dist/packem_shared/advisor-view-tBumWci_.mjs +0 -1
  214. package/dist/packem_shared/error-alert-C0R39DO1.mjs +0 -1
  215. package/dist/packem_shared/recording-client-DAipTA_n.mjs +0 -1
  216. package/dist/packem_shared/studio-UhUrPz5J.mjs +0 -2
  217. package/dist/packem_shared/use-sql-assistant-rZPs3LC3.mjs +0 -1
  218. package/dist/standalone/chunk-2AH4ABE5.js +0 -1
  219. package/dist/standalone/chunk-2G57ENH5.js +0 -1
  220. package/dist/standalone/chunk-3GXPALXG.js +0 -1
  221. package/dist/standalone/chunk-3GYLOE4V.js +0 -1
  222. package/dist/standalone/chunk-473JK2PQ.js +0 -1
  223. package/dist/standalone/chunk-4C4THJUD.js +0 -1
  224. package/dist/standalone/chunk-4DAKKAK7.js +0 -1
  225. package/dist/standalone/chunk-4M57OYFX.js +0 -1
  226. package/dist/standalone/chunk-4SQBAPY6.js +0 -1
  227. package/dist/standalone/chunk-5DNGK3NT.js +0 -1
  228. package/dist/standalone/chunk-5GIQ6C5N.js +0 -1
  229. package/dist/standalone/chunk-5WJG7FMH.js +0 -1
  230. package/dist/standalone/chunk-63KDHS3H.js +0 -1
  231. package/dist/standalone/chunk-6B6ARRMI.js +0 -1
  232. package/dist/standalone/chunk-6LMO2D54.js +0 -1
  233. package/dist/standalone/chunk-6M7FLLMT.js +0 -1
  234. package/dist/standalone/chunk-6QEXGYWH.js +0 -1
  235. package/dist/standalone/chunk-6UTZXEW3.js +0 -1
  236. package/dist/standalone/chunk-6VAY6L4J.js +0 -1
  237. package/dist/standalone/chunk-7PADVGQX.js +0 -1
  238. package/dist/standalone/chunk-7RGYCU6F.js +0 -1
  239. package/dist/standalone/chunk-7UM5ROG6.js +0 -1
  240. package/dist/standalone/chunk-A566HCBX.js +0 -1
  241. package/dist/standalone/chunk-A5JISKHE.js +0 -1
  242. package/dist/standalone/chunk-ADNRFCMZ.js +0 -1
  243. package/dist/standalone/chunk-AP4PC2M4.js +0 -1
  244. package/dist/standalone/chunk-BFE2DRP6.js +0 -33
  245. package/dist/standalone/chunk-BPEB4KFE.js +0 -1
  246. package/dist/standalone/chunk-BVX45MU5.js +0 -7
  247. package/dist/standalone/chunk-C6GN7ZXJ.js +0 -1
  248. package/dist/standalone/chunk-CL2VZNDI.js +0 -1
  249. package/dist/standalone/chunk-CNA3TVUK.js +0 -1
  250. package/dist/standalone/chunk-CZ6HBDIL.js +0 -1
  251. package/dist/standalone/chunk-D6S7MXW4.js +0 -1
  252. package/dist/standalone/chunk-E26OT26O.js +0 -1
  253. package/dist/standalone/chunk-FCAXVYAX.js +0 -1
  254. package/dist/standalone/chunk-FXPAJDES.js +0 -1
  255. package/dist/standalone/chunk-HHRYM6UW.js +0 -1
  256. package/dist/standalone/chunk-HPRF5LMA.js +0 -1
  257. package/dist/standalone/chunk-IB22LETR.js +0 -1
  258. package/dist/standalone/chunk-IBJVVHV5.js +0 -1
  259. package/dist/standalone/chunk-IENQRRQT.js +0 -1
  260. package/dist/standalone/chunk-IQ4TTHQT.js +0 -1
  261. package/dist/standalone/chunk-ITH5LRWM.js +0 -1
  262. package/dist/standalone/chunk-J6VFG6M5.js +0 -1
  263. package/dist/standalone/chunk-JSDKOE4U.js +0 -1
  264. package/dist/standalone/chunk-JTGGWF7R.js +0 -1
  265. package/dist/standalone/chunk-JZD7ZN3F.js +0 -1
  266. package/dist/standalone/chunk-K3CWB3AM.js +0 -1
  267. package/dist/standalone/chunk-KNFB3FGW.js +0 -1
  268. package/dist/standalone/chunk-KNXWDE4N.js +0 -1
  269. package/dist/standalone/chunk-KRPXOSBL.js +0 -1
  270. package/dist/standalone/chunk-KRY7BYHT.js +0 -1
  271. package/dist/standalone/chunk-KYAG2YMF.js +0 -1
  272. package/dist/standalone/chunk-KZCEJFZF.js +0 -1
  273. package/dist/standalone/chunk-KZILJQX3.js +0 -8
  274. package/dist/standalone/chunk-LEYUH5TS.js +0 -1
  275. package/dist/standalone/chunk-LFM672WN.js +0 -1
  276. package/dist/standalone/chunk-LIGOLZND.js +0 -1
  277. package/dist/standalone/chunk-LPU6YTSU.js +0 -1
  278. package/dist/standalone/chunk-MWJC3S62.js +0 -1
  279. package/dist/standalone/chunk-NP2AQOLE.js +0 -1
  280. package/dist/standalone/chunk-NVKLYDOH.js +0 -1
  281. package/dist/standalone/chunk-O2X2XYCM.js +0 -1
  282. package/dist/standalone/chunk-O3MDWYXF.js +0 -1
  283. package/dist/standalone/chunk-ONG4JEZD.js +0 -1
  284. package/dist/standalone/chunk-OS26JXYA.js +0 -1
  285. package/dist/standalone/chunk-OXFKZ4BM.js +0 -1
  286. package/dist/standalone/chunk-PGTEGUAB.js +0 -1
  287. package/dist/standalone/chunk-PTBUWRBY.js +0 -1
  288. package/dist/standalone/chunk-Q6HA3L2H.js +0 -1
  289. package/dist/standalone/chunk-QGV5ARD2.js +0 -1
  290. package/dist/standalone/chunk-QWRK4ESB.js +0 -1
  291. package/dist/standalone/chunk-RL2ITK2N.js +0 -1
  292. package/dist/standalone/chunk-RTJO3AR4.js +0 -1
  293. package/dist/standalone/chunk-SFY646MC.js +0 -1
  294. package/dist/standalone/chunk-T5UMHPAB.js +0 -1
  295. package/dist/standalone/chunk-T6HV2FQP.js +0 -2
  296. package/dist/standalone/chunk-T7ZKNNGX.js +0 -1
  297. package/dist/standalone/chunk-TCYPNSTV.js +0 -1
  298. package/dist/standalone/chunk-TQM6XHBA.js +0 -1
  299. package/dist/standalone/chunk-TRMWBRRU.js +0 -1
  300. package/dist/standalone/chunk-TW7KJSMR.js +0 -15
  301. package/dist/standalone/chunk-TYD3V4NB.js +0 -1
  302. package/dist/standalone/chunk-TZKLK52W.js +0 -1
  303. package/dist/standalone/chunk-U4RXQSQ7.js +0 -1
  304. package/dist/standalone/chunk-UNZ2UBVL.js +0 -1
  305. package/dist/standalone/chunk-VJRNOSRY.js +0 -1
  306. package/dist/standalone/chunk-W2BCSK5S.js +0 -1
  307. package/dist/standalone/chunk-W7MRISE3.js +0 -1
  308. package/dist/standalone/chunk-WM72PRE3.js +0 -1
  309. package/dist/standalone/chunk-X4WHMCOZ.js +0 -1
  310. package/dist/standalone/chunk-X74GEPSG.js +0 -1
  311. package/dist/standalone/chunk-XKPD4SFN.js +0 -1
  312. package/dist/standalone/chunk-XMSNLMWU.js +0 -1
  313. package/dist/standalone/chunk-XOPFDWXX.js +0 -1
  314. package/dist/standalone/chunk-XQLOVFPP.js +0 -1
  315. package/dist/standalone/chunk-XSHYZPGF.js +0 -1
  316. package/dist/standalone/chunk-XST3UEHU.js +0 -1
  317. package/dist/standalone/chunk-XYR5NST4.js +0 -1
  318. package/dist/standalone/chunk-Y74LIFSL.js +0 -1
  319. package/dist/standalone/chunk-YHTHRYP5.js +0 -1
  320. package/dist/standalone/chunk-YMEKCV27.js +0 -1
  321. package/dist/standalone/chunk-Z5EV64KS.js +0 -1
  322. package/dist/standalone/chunk-ZBON5T5A.js +0 -1
  323. package/dist/standalone/chunk-ZGSL4DPP.js +0 -1
  324. package/dist/standalone/chunk-ZOQTXWPK.js +0 -1
  325. package/dist/standalone/chunk-ZTOREMGH.js +0 -1
  326. package/dist/standalone/chunk-ZZ5GICTF.js +0 -1
  327. /package/dist/standalone/{chunk-UYEZR3BI.js → chunk-P6VNMPWR.js} +0 -0
@@ -1 +0,0 @@
1
- import{a as Pe,b as Re}from"./chunk-IQ4TTHQT.js";import{a as ce}from"./chunk-R36QXQZX.js";import{a as Te}from"./chunk-MWJC3S62.js";import"./chunk-IH2CJZF2.js";import{a as Se}from"./chunk-X74GEPSG.js";import{c as Le}from"./chunk-4SQBAPY6.js";import{a as de}from"./chunk-UYEZR3BI.js";import{a as ke}from"./chunk-KYAG2YMF.js";import{a as ie}from"./chunk-6QEXGYWH.js";import{a as xe}from"./chunk-5DNGK3NT.js";import{a as be}from"./chunk-XST3UEHU.js";import{b as ve}from"./chunk-SLIDAWNX.js";import"./chunk-6M7FLLMT.js";import"./chunk-LUHXNZI4.js";import"./chunk-ZTOREMGH.js";import{i as D}from"./chunk-SU5DTRGK.js";import"./chunk-W7MRISE3.js";import"./chunk-IBJVVHV5.js";import{a as ge}from"./chunk-6VAY6L4J.js";import"./chunk-JTGGWF7R.js";import"./chunk-ZBON5T5A.js";import{b as re}from"./chunk-PQH2LSJX.js";import"./chunk-4C4THJUD.js";import{a as ye}from"./chunk-CZ6HBDIL.js";import"./chunk-T5UMHPAB.js";import"./chunk-NVKLYDOH.js";import"./chunk-E26OT26O.js";import{a as ne}from"./chunk-6UTZXEW3.js";import{c as oe}from"./chunk-4DAKKAK7.js";import{m as fe}from"./chunk-BVX45MU5.js";import"./chunk-H7HZ42JY.js";import{a as J}from"./chunk-XMSNLMWU.js";import{a as we,b as Ne,c as Ce,d as se,e as j,f as B}from"./chunk-HHRYM6UW.js";import{h as W,l as z,p as ae,q as pe,y as le}from"./chunk-BFE2DRP6.js";import{a as v,d as te,e as _e,f as Ae,g as Ue}from"./chunk-OXFKZ4BM.js";var K=te(Ae(),1);var I=te(_e(),1);var r=te(Ue(),1);var me=["trace","debug","log","info","warn","error","fatal"],$e="LOG_ARCHIVE_NOT_CONFIGURED",ze={cursor:void 0,error:null,loading:!1,notConfigured:!1,rows:null},De=v((i,e)=>{switch(e.type){case"append":return{...i,cursor:e.cursor,error:null,loading:!1,rows:[...i.rows??[],...e.rows]};case"failed":return{cursor:void 0,error:e.message,loading:!1,notConfigured:!1,rows:null};case"loaded":return{cursor:e.cursor,error:null,loading:!1,notConfigured:!1,rows:e.rows};case"loading":return{...i,error:null,loading:!0,notConfigured:!1};case"notConfigured":return{cursor:void 0,error:null,loading:!1,notConfigured:!0,rows:null};case"pageFailed":return{...i,error:e.message,loading:!1};default:return i}},"De"),je=v(i=>{let e=(0,K.c)(33),{row:t}=i,n;e[0]!==t.fields?(n=ce(t.fields),e[0]=t.fields,e[1]=n):n=e[1];let s=n,o=`lg-archive-row-${String(t.ts)}`,c;e[2]!==t.ts?(c=new Date(t.ts).toLocaleString(),e[2]=t.ts,e[3]=c):c=e[3];let f;e[4]!==c?(f=(0,r.jsx)(B,{className:"tabular-nums whitespace-nowrap text-xs text-muted-foreground",children:c}),e[4]=c,e[5]=f):f=e[5];let m=Pe[t.level],d;e[6]!==t.level||e[7]!==m?(d=(0,r.jsx)(B,{children:(0,r.jsx)(re,{variant:m,children:t.level})}),e[6]=t.level,e[7]=m,e[8]=d):d=e[8];let a;e[9]!==t.functionPath?(a=(0,r.jsx)(B,{className:"font-mono text-xs",children:t.functionPath}),e[9]=t.functionPath,e[10]=a):a=e[10];let h;e[11]!==t.message?(h=(0,r.jsx)("div",{className:"truncate",title:t.message,children:t.message}),e[11]=t.message,e[12]=h):h=e[12];let l;e[13]!==s?(l=s!==""&&(0,r.jsx)("div",{className:"truncate font-mono text-[11px] text-muted-foreground",title:s,children:s}),e[13]=s,e[14]=l):l=e[14];let u;e[15]!==h||e[16]!==l?(u=(0,r.jsxs)(B,{className:"max-w-md",children:[h,l]}),e[15]=h,e[16]=l,e[17]=u):u=e[17];let g=t.traceId??"\u2014",b;e[18]!==g?(b=(0,r.jsx)(B,{className:"font-mono text-[11px] text-muted-foreground",children:g}),e[18]=g,e[19]=b):b=e[19];let x=t.shardKey??"\u2014",w;e[20]!==x?(w=(0,r.jsx)(B,{className:"font-mono text-[11px] text-muted-foreground",children:x}),e[20]=x,e[21]=w):w=e[21];let N=t.userId??"\u2014",y;e[22]!==N?(y=(0,r.jsx)(B,{className:"font-mono text-[11px] text-muted-foreground",children:N}),e[22]=N,e[23]=y):y=e[23];let T;return e[24]!==u||e[25]!==b||e[26]!==w||e[27]!==y||e[28]!==o||e[29]!==f||e[30]!==d||e[31]!==a?(T=(0,r.jsxs)(se,{"data-testid":o,children:[f,d,a,u,b,w,y]}),e[24]=u,e[25]=b,e[26]=w,e[27]=y,e[28]=o,e[29]=f,e[30]=d,e[31]=a,e[32]=T):T=e[32],T},"Qe"),Be=v(({shardKey:i})=>{let e=fe(),t=z(),[n,s]=(0,I.useState)(""),[o,c]=(0,I.useState)(""),[f,m]=(0,I.useState)(""),[{cursor:d,error:a,loading:h,notConfigured:l,rows:u},g]=(0,I.useReducer)(De,ze),b=ie(n.trim(),400),x=ie(o.trim(),400),w={...b===""?{}:{functionPathPrefix:b},...f===""?{}:{minLevel:f},...i===""?{}:{shardKey:i},...x===""?{}:{userId:x}},N=JSON.stringify(w),y=(0,I.useRef)(N);(0,I.useEffect)(()=>{let p={cancelled:!1};return y.current=N,le((async()=>{g({type:"loading"});try{let C=await e.queryLogArchive(w);p.cancelled||g({cursor:C.nextCursor,rows:C.rows,type:"loaded"})}catch(C){p.cancelled||g(pe(C)===$e?{type:"notConfigured"}:{message:ae(C),type:"failed"})}})()),()=>{p.cancelled=!0}},[e,N]);let T=v(async()=>{if(d===void 0)return;let p=N;g({type:"loading"});try{let C=await e.queryLogArchive({...w,cursor:d});y.current===p&&g({cursor:C.nextCursor,rows:C.rows,type:"append"})}catch(C){y.current===p&&g({message:ae(C),type:"pageFailed"})}},"T"),R=v(p=>{s(p.target.value)},"R"),L=v(p=>{c(p.target.value)},"N"),k=v(p=>{m(p.target.value)},"L"),S=v(()=>{le(T())},"S");return l?(0,r.jsx)(J,{action:(0,r.jsx)("a",{className:"text-sm text-primary underline-offset-4 hover:underline",href:de,rel:"noreferrer",target:"_blank",children:t("Open in Cloudflare")}),description:t("Wire pipelineLogSink to a Cloudflare Pipeline \u2192 R2 Data Catalog table and set R2_SQL_ACCOUNT_ID, R2_SQL_TOKEN, R2_SQL_BUCKET to browse the durable log archive here."),testId:"lg-archive-not-configured",title:t("Log archive not configured")}):(0,r.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lg-archive",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,r.jsx)(D,{"aria-label":t("Function path prefix"),className:"h-8 w-48","data-testid":"lg-archive-path",onChange:R,placeholder:t("function path\u2026"),value:n}),(0,r.jsx)(D,{"aria-label":t("User id"),className:"h-8 w-40","data-testid":"lg-archive-user",onChange:L,placeholder:t("user id\u2026"),value:o}),(0,r.jsxs)("select",{"aria-label":t("Minimum level"),className:"h-8 rounded-md border border-border bg-background px-2 text-sm","data-testid":"lg-archive-min-level",onChange:k,value:f,children:[(0,r.jsx)("option",{value:"",children:t("min level")}),me.map(p=>(0,r.jsx)("option",{value:p,children:p},p))]})]}),a!==null&&(0,r.jsx)("p",{className:"text-sm text-destructive","data-testid":"lg-archive-error",role:"alert",children:a}),h&&u===null&&a===null&&(0,r.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"lg-archive-loading",children:t("Loading\u2026")}),u!==null&&u.length===0&&(0,r.jsx)(J,{description:t("No archived logs match these filters. The durable archive fills as pipelineLogSink flushes records to R2."),testId:"lg-archive-empty",title:t("No archived logs.")}),u!==null&&u.length>0&&(0,r.jsx)("div",{className:"overflow-hidden rounded-xl border border-border shadow-xs",children:(0,r.jsxs)(we,{"data-testid":"lg-archive-table",children:[(0,r.jsx)(Ne,{children:(0,r.jsxs)(se,{children:[(0,r.jsx)(j,{children:t("Time")}),(0,r.jsx)(j,{children:t("Level")}),(0,r.jsx)(j,{children:t("Function")}),(0,r.jsx)(j,{children:t("Message")}),(0,r.jsx)(j,{children:t("Trace")}),(0,r.jsx)(j,{children:t("Shard")}),(0,r.jsx)(j,{children:t("User")})]})}),(0,r.jsx)(Ce,{children:u.map((p,C)=>(0,r.jsx)(je,{row:p},`${String(p.ts)}-${String(C)}`))})]})}),d!==void 0&&(0,r.jsx)("div",{children:(0,r.jsx)(ge,{"data-testid":"lg-archive-more",disabled:h,onClick:S,size:"sm",variant:"outline",children:t(h?"Loading\u2026":"Load more")})})]})},"ze"),We=v(i=>{let e=(0,K.c)(11),{level:t,onToggle:n,selected:s}=i,o;e[0]!==t||e[1]!==n?(o=v(()=>{n(t)},"o"),e[0]=t,e[1]=n,e[2]=o):o=e[2];let c=o,f=s?"border-border bg-muted font-medium":"border-input text-muted-foreground",m;e[3]!==f?(m=W("rounded-md border px-2 py-1 text-xs",f),e[3]=f,e[4]=m):m=e[4];let d=`logs-level-${t}`,a;return e[5]!==t||e[6]!==c||e[7]!==s||e[8]!==m||e[9]!==d?(a=(0,r.jsx)("button",{"aria-pressed":s,className:m,"data-testid":d,onClick:c,type:"button",children:t}),e[5]=t,e[6]=c,e[7]=s,e[8]=m,e[9]=d,e[10]=a):a=e[10],a},"Ge"),Ve=v(i=>{let e=(0,K.c)(68),{levelFilter:t,onLogPathChange:n,onSearchChange:s,onTimeRangeChange:o,onToggleLevel:c,onToggleSummary:f,pathFilter:m,search:d,showSummary:a,timeRange:h}=i,l=z(),u;e[0]!==l?(u=l("Search messages"),e[0]=l,e[1]=u):u=e[1];let g;e[2]!==l?(g=l("search message"),e[2]=l,e[3]=g):g=e[3];let b;e[4]!==s||e[5]!==d||e[6]!==u||e[7]!==g?(b=(0,r.jsx)(D,{"aria-label":u,className:"h-8 w-48","data-testid":"lg-search",onChange:s,placeholder:g,value:d}),e[4]=s,e[5]=d,e[6]=u,e[7]=g,e[8]=b):b=e[8];let x;e[9]!==l?(x=l("Function path"),e[9]=l,e[10]=x):x=e[10];let w;e[11]!==l?(w=l("filter path"),e[11]=l,e[12]=w):w=e[12];let N;e[13]!==n||e[14]!==m||e[15]!==x||e[16]!==w?(N=(0,r.jsx)(D,{"aria-label":x,className:"h-8 w-40","data-testid":"logs-path-filter",onChange:n,placeholder:w,value:m}),e[13]=n,e[14]=m,e[15]=x,e[16]=w,e[17]=N):N=e[17];let y;e[18]!==l?(y=l("Level filter"),e[18]=l,e[19]=y):y=e[19];let T;e[20]!==t||e[21]!==c?(T=me.map(Q=>(0,r.jsx)(We,{level:Q,onToggle:c,selected:t.has(Q)},Q)),e[20]=t,e[21]=c,e[22]=T):T=e[22];let R;e[23]!==y||e[24]!==T?(R=(0,r.jsx)("div",{"aria-label":y,className:"inline-flex items-center gap-1","data-testid":"logs-level-filter",role:"group",children:T}),e[23]=y,e[24]=T,e[25]=R):R=e[25];let L;e[26]!==l?(L=l("Time range"),e[26]=l,e[27]=L):L=e[27];let k;e[28]!==l?(k=l("All time"),e[28]=l,e[29]=k):k=e[29];let S;e[30]!==k?(S=(0,r.jsx)("option",{value:"all",children:k}),e[30]=k,e[31]=S):S=e[31];let p;e[32]!==l?(p=l("Last 5m"),e[32]=l,e[33]=p):p=e[33];let C;e[34]!==p?(C=(0,r.jsx)("option",{value:"5m",children:p}),e[34]=p,e[35]=C):C=e[35];let q;e[36]!==l?(q=l("Last 15m"),e[36]=l,e[37]=q):q=e[37];let F;e[38]!==q?(F=(0,r.jsx)("option",{value:"15m",children:q}),e[38]=q,e[39]=F):F=e[39];let O;e[40]!==l?(O=l("Last hour"),e[40]=l,e[41]=O):O=e[41];let E;e[42]!==O?(E=(0,r.jsx)("option",{value:"1h",children:O}),e[42]=O,e[43]=E):E=e[43];let M;e[44]!==o||e[45]!==L||e[46]!==S||e[47]!==C||e[48]!==F||e[49]!==E||e[50]!==h?(M=(0,r.jsxs)("select",{"aria-label":L,className:"h-8 rounded-md border border-input bg-transparent px-2 text-sm shadow-xs focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none","data-testid":"logs-time-range",onChange:o,value:h,children:[S,C,F,E]}),e[44]=o,e[45]=L,e[46]=S,e[47]=C,e[48]=F,e[49]=E,e[50]=h,e[51]=M):M=e[51];let V=a?"border-border bg-muted font-medium":"border-input text-muted-foreground",_;e[52]!==V?(_=W("h-8 rounded-md border px-3 text-sm",V),e[52]=V,e[53]=_):_=e[53];let U;e[54]!==a||e[55]!==l?(U=l(a?"List":"Summary"),e[54]=a,e[55]=l,e[56]=U):U=e[56];let A;e[57]!==f||e[58]!==a||e[59]!==_||e[60]!==U?(A=(0,r.jsx)("button",{"aria-pressed":a,className:_,"data-testid":"logs-summary-toggle",onClick:f,type:"button",children:U}),e[57]=f,e[58]=a,e[59]=_,e[60]=U,e[61]=A):A=e[61];let $;return e[62]!==M||e[63]!==A||e[64]!==b||e[65]!==N||e[66]!==R?($=(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[b,N,R,M,A]}),e[62]=M,e[63]=A,e[64]=b,e[65]=N,e[66]=R,e[67]=$):$=e[67],$},"He"),Qe=v(i=>{let e=(0,K.c)(53),{onOutcomeChange:t,onPathChange:n,onTableChange:s,onUserChange:o,outcomeFilter:c,pathPrefix:f,tableFilter:m,userIdFilter:d}=i,a=z(),h;e[0]!==a?(h=a("Function path"),e[0]=a,e[1]=h):h=e[1];let l;e[2]!==a?(l=a("file:function"),e[2]=a,e[3]=l):l=e[3];let u;e[4]!==n||e[5]!==f||e[6]!==h||e[7]!==l?(u=(0,r.jsx)(D,{"aria-label":h,className:"h-8 w-44","data-testid":"lg-req-path",onChange:n,placeholder:l,value:f}),e[4]=n,e[5]=f,e[6]=h,e[7]=l,e[8]=u):u=e[8];let g;e[9]!==a?(g=a("User id"),e[9]=a,e[10]=g):g=e[10];let b;e[11]!==a?(b=a("userId"),e[11]=a,e[12]=b):b=e[12];let x;e[13]!==o||e[14]!==g||e[15]!==b||e[16]!==d?(x=(0,r.jsx)(D,{"aria-label":g,className:"h-8 w-32","data-testid":"lg-req-user",onChange:o,placeholder:b,value:d}),e[13]=o,e[14]=g,e[15]=b,e[16]=d,e[17]=x):x=e[17];let w;e[18]!==a?(w=a("Table touched"),e[18]=a,e[19]=w):w=e[19];let N;e[20]!==a?(N=a("table"),e[20]=a,e[21]=N):N=e[21];let y;e[22]!==s||e[23]!==w||e[24]!==N||e[25]!==m?(y=(0,r.jsx)(D,{"aria-label":w,className:"h-8 w-32","data-testid":"lg-req-table",onChange:s,placeholder:N,value:m}),e[22]=s,e[23]=w,e[24]=N,e[25]=m,e[26]=y):y=e[26];let T;e[27]!==a?(T=a("Outcome filter"),e[27]=a,e[28]=T):T=e[28];let R;e[29]!==a?(R=a("all"),e[29]=a,e[30]=R):R=e[30];let L;e[31]!==R?(L=(0,r.jsx)("option",{value:"all",children:R}),e[31]=R,e[32]=L):L=e[32];let k;e[33]!==a?(k=a("ok"),e[33]=a,e[34]=k):k=e[34];let S;e[35]!==k?(S=(0,r.jsx)("option",{value:"ok",children:k}),e[35]=k,e[36]=S):S=e[36];let p;e[37]!==a?(p=a("error"),e[37]=a,e[38]=p):p=e[38];let C;e[39]!==p?(C=(0,r.jsx)("option",{value:"error",children:p}),e[39]=p,e[40]=C):C=e[40];let q;e[41]!==t||e[42]!==c||e[43]!==T||e[44]!==L||e[45]!==S||e[46]!==C?(q=(0,r.jsxs)("select",{"aria-label":T,className:"h-8 rounded-md border border-input bg-transparent px-2 text-sm shadow-xs focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none","data-testid":"lg-req-outcome",onChange:t,value:c,children:[L,S,C]}),e[41]=t,e[42]=c,e[43]=T,e[44]=L,e[45]=S,e[46]=C,e[47]=q):q=e[47];let F;return e[48]!==q||e[49]!==u||e[50]!==x||e[51]!==y?(F=(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[u,x,y,q]}),e[48]=q,e[49]=u,e[50]=x,e[51]=y,e[52]=F):F=e[52],F},"We"),Fe=v(i=>{let e=(0,K.c)(7),{bucket:t}=i,n;e[0]!==t.key?(n=(0,r.jsx)("span",{className:"truncate text-muted-foreground",role:"gridcell",children:t.key}),e[0]=t.key,e[1]=n):n=e[1];let s;e[2]!==t.count?(s=(0,r.jsx)("span",{className:"shrink-0 tabular-nums",role:"gridcell",children:t.count}),e[2]=t.count,e[3]=s):s=e[3];let o;return e[4]!==n||e[5]!==s?(o=(0,r.jsxs)("div",{className:"flex items-center justify-between gap-4 px-3 py-1 font-mono text-xs","data-testid":"logs-summary-row",role:"row",children:[n,s]}),e[4]=n,e[5]=s,e[6]=o):o=e[6],o},"ve"),Ye=v(i=>{let e=(0,K.c)(31),{summary:t}=i,n=z(),s;e[0]!==t.total||e[1]!==n?(s=n("{count} entries",{count:t.total}),e[0]=t.total,e[1]=n,e[2]=s):s=e[2];let o;e[3]!==s?(o=(0,r.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"logs-summary-total",children:s}),e[3]=s,e[4]=o):o=e[4];let c;e[5]!==n?(c=n("By level"),e[5]=n,e[6]=c):c=e[6];let f;e[7]!==c?(f=(0,r.jsx)("h4",{className:"mb-1 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:c}),e[7]=c,e[8]=f):f=e[8];let m;e[9]!==t.byLevel?(m=t.byLevel.map(Ge),e[9]=t.byLevel,e[10]=m):m=e[10];let d;e[11]!==m?(d=(0,r.jsx)("div",{className:"overflow-hidden rounded-lg border border-border","data-testid":"logs-summary-levels",role:"grid",children:m}),e[11]=m,e[12]=d):d=e[12];let a;e[13]!==f||e[14]!==d?(a=(0,r.jsxs)("div",{children:[f,d]}),e[13]=f,e[14]=d,e[15]=a):a=e[15];let h;e[16]!==n?(h=n("By function"),e[16]=n,e[17]=h):h=e[17];let l;e[18]!==h?(l=(0,r.jsx)("h4",{className:"mb-1 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:h}),e[18]=h,e[19]=l):l=e[19];let u;e[20]!==t.byPath?(u=t.byPath.map(He),e[20]=t.byPath,e[21]=u):u=e[21];let g;e[22]!==u?(g=(0,r.jsx)("div",{className:"overflow-hidden rounded-lg border border-border","data-testid":"logs-summary-paths",role:"grid",children:u}),e[22]=u,e[23]=g):g=e[23];let b;e[24]!==g||e[25]!==l?(b=(0,r.jsxs)("div",{children:[l,g]}),e[24]=g,e[25]=l,e[26]=b):b=e[26];let x;return e[27]!==b||e[28]!==o||e[29]!==a?(x=(0,r.jsxs)("div",{className:"flex flex-col gap-4 rounded-xl border border-border bg-card p-4 shadow-xs","data-testid":"logs-summary",children:[o,a,b]}),e[27]=b,e[28]=o,e[29]=a,e[30]=x):x=e[30],x},"Ye");function Ge(i){return(0,r.jsx)(Fe,{bucket:i},i.key)}v(Ge,"je");function He(i){return(0,r.jsx)(Fe,{bucket:i},i.key)}v(He,"Je");var Je=v(i=>{let e=(0,K.c)(46),{liveError:t,onShardKeyChange:n,onShowArchive:s,onShowErrors:o,onShowRequests:c,shardKey:f,view:m}=i,d=z(),a=m==="requests",h=m==="requests"?"bg-muted font-medium":"text-muted-foreground",l;e[0]!==h?(l=W("px-3 py-1 text-sm",h),e[0]=h,e[1]=l):l=e[1];let u;e[2]!==d?(u=d("Requests"),e[2]=d,e[3]=u):u=e[3];let g;e[4]!==c||e[5]!==a||e[6]!==l||e[7]!==u?(g=(0,r.jsx)("button",{"aria-selected":a,className:l,"data-testid":"lg-view-requests",onClick:c,role:"tab",type:"button",children:u}),e[4]=c,e[5]=a,e[6]=l,e[7]=u,e[8]=g):g=e[8];let b=m==="errors",x=m==="errors"?"bg-muted font-medium":"text-muted-foreground",w;e[9]!==x?(w=W("px-3 py-1 text-sm",x),e[9]=x,e[10]=w):w=e[10];let N;e[11]!==d?(N=d("Errors"),e[11]=d,e[12]=N):N=e[12];let y;e[13]!==o||e[14]!==b||e[15]!==w||e[16]!==N?(y=(0,r.jsx)("button",{"aria-selected":b,className:w,"data-testid":"lg-view-errors",onClick:o,role:"tab",type:"button",children:N}),e[13]=o,e[14]=b,e[15]=w,e[16]=N,e[17]=y):y=e[17];let T=m==="archive",R=m==="archive"?"bg-muted font-medium":"text-muted-foreground",L;e[18]!==R?(L=W("px-3 py-1 text-sm",R),e[18]=R,e[19]=L):L=e[19];let k;e[20]!==d?(k=d("Archive"),e[20]=d,e[21]=k):k=e[21];let S;e[22]!==s||e[23]!==T||e[24]!==L||e[25]!==k?(S=(0,r.jsx)("button",{"aria-selected":T,className:L,"data-testid":"lg-view-archive",onClick:s,role:"tab",type:"button",children:k}),e[22]=s,e[23]=T,e[24]=L,e[25]=k,e[26]=S):S=e[26];let p;e[27]!==y||e[28]!==S||e[29]!==g?(p=(0,r.jsxs)("div",{className:"inline-flex overflow-hidden rounded-lg border border-border",role:"tablist",children:[g,y,S]}),e[27]=y,e[28]=S,e[29]=g,e[30]=p):p=e[30];let C;e[31]!==n||e[32]!==f?(C=(0,r.jsx)(be,{onChange:n,testId:"lg-shard-input",value:f}),e[31]=n,e[32]=f,e[33]=C):C=e[33];let q;e[34]!==t||e[35]!==m?(q=m!=="archive"&&(0,r.jsx)(ke,{message:t,prefix:"lg"}),e[34]=t,e[35]=m,e[36]=q):q=e[36];let F;e[37]!==d?(F=d("Open in Cloudflare"),e[37]=d,e[38]=F):F=e[38];let O;e[39]!==F?(O=(0,r.jsx)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"lg-cf-link",href:de,rel:"noreferrer",target:"_blank",children:F}),e[39]=F,e[40]=O):O=e[40];let E;return e[41]!==p||e[42]!==C||e[43]!==q||e[44]!==O?(E=(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[p,C,q,O]}),e[41]=p,e[42]=C,e[43]=q,e[44]=O,e[45]=E):E=e[45],E},"Xe"),ue=400,Xe=36,Ze={height:ue,overflow:"auto"},Oe={left:0,position:"absolute",top:0,width:"100%"},et={error:"destructive",ok:"secondary"},Ee=v(i=>{let e=(0,K.c)(6),{onOpenTrace:t,traceId:n}=i,s=z(),o;e[0]!==t||e[1]!==s||e[2]!==n?(o=n===void 0?null:(0,r.jsx)("button",{className:"text-primary underline-offset-2 hover:underline","data-testid":"lg-trace-link",onClick:v(()=>{t(n)},"onClick"),type:"button",children:s("Trace")}),e[0]=t,e[1]=s,e[2]=n,e[3]=o):o=e[3];let c;return e[4]!==o?(c=(0,r.jsx)("span",{className:"w-16 shrink-0 text-right",role:"gridcell",children:o}),e[4]=o,e[5]=c):c=e[5],c},"xe"),tt=v(i=>{let e=(0,K.c)(13),{entry:t,index:n,measureRef:s,onOpenTrace:o,start:c}=i,f=`translateY(${String(c)}px)`,m;e[0]!==f?(m={...Oe,transform:f},e[0]=f,e[1]=m):m=e[1];let d=m,a;e[2]!==t?(a=(0,r.jsx)(Re,{entry:t}),e[2]=t,e[3]=a):a=e[3];let h;e[4]!==t.traceId||e[5]!==o?(h=(0,r.jsx)(Ee,{onOpenTrace:o,traceId:t.traceId}),e[4]=t.traceId,e[5]=o,e[6]=h):h=e[6];let l;return e[7]!==n||e[8]!==s||e[9]!==d||e[10]!==a||e[11]!==h?(l=(0,r.jsxs)("div",{className:"flex items-center border-b border-border px-3 py-1.5 font-mono text-xs hover:bg-muted/50","data-index":n,"data-testid":"lg-row",ref:s,role:"row",style:d,children:[a,h]}),e[7]=n,e[8]=s,e[9]=d,e[10]=a,e[11]=h,e[12]=l):l=e[12],l},"rt"),Ie=v(i=>i.length===0?"\u2014":i.join(", "),"ce"),rt=v(i=>{let e=(0,K.c)(41),{entry:t,index:n,measureRef:s,onOpenTrace:o,start:c}=i,f=`translateY(${String(c)}px)`,m;e[0]!==f?(m={...Oe,transform:f},e[0]=f,e[1]=m):m=e[1];let d=m,a;e[2]!==t.ts?(a=new Date(t.ts).toLocaleString(),e[2]=t.ts,e[3]=a):a=e[3];let h;e[4]!==a?(h=(0,r.jsx)("span",{className:"w-40 shrink-0 tabular-nums text-muted-foreground",role:"gridcell",children:a}),e[4]=a,e[5]=h):h=e[5];let l=et[t.outcome],u;e[6]!==t.outcome||e[7]!==l?(u=(0,r.jsx)("span",{className:"w-16 shrink-0",role:"gridcell",children:(0,r.jsx)(re,{variant:l,children:t.outcome})}),e[6]=t.outcome,e[7]=l,e[8]=u):u=e[8];let g;e[9]!==t.functionPath?(g=(0,r.jsx)("span",{className:"w-44 shrink-0 truncate",role:"gridcell",title:t.functionPath,children:t.functionPath}),e[9]=t.functionPath,e[10]=g):g=e[10];let b=t.shardKey??"\u2014",x;e[11]!==b?(x=(0,r.jsx)("span",{className:"w-24 shrink-0 truncate text-muted-foreground",role:"gridcell",children:b}),e[11]=b,e[12]=x):x=e[12];let w=t.userId??"\u2014",N;e[13]!==w?(N=(0,r.jsx)("span",{className:"w-24 shrink-0 truncate text-muted-foreground",role:"gridcell",children:w}),e[13]=w,e[14]=N):N=e[14];let y;e[15]!==t.durationMs?(y=Math.round(t.durationMs),e[15]=t.durationMs,e[16]=y):y=e[16];let T=`${String(y)}ms`,R;e[17]!==T?(R=(0,r.jsx)("span",{className:"w-16 shrink-0 tabular-nums text-muted-foreground",role:"gridcell",children:T}),e[17]=T,e[18]=R):R=e[18];let L;e[19]!==t.errorMessage||e[20]!==t.outcome||e[21]!==t.tablesRead||e[22]!==t.tablesWritten?(L=t.outcome==="error"&&t.errorMessage!==void 0?t.errorMessage:`r:${Ie(t.tablesRead)} \xB7 w:${Ie(t.tablesWritten)}`,e[19]=t.errorMessage,e[20]=t.outcome,e[21]=t.tablesRead,e[22]=t.tablesWritten,e[23]=L):L=e[23];let k;e[24]!==L?(k=(0,r.jsx)("span",{className:"flex-1 truncate text-muted-foreground",role:"gridcell",children:L}),e[24]=L,e[25]=k):k=e[25];let S;e[26]!==t.traceId||e[27]!==o?(S=(0,r.jsx)(Ee,{onOpenTrace:o,traceId:t.traceId}),e[26]=t.traceId,e[27]=o,e[28]=S):S=e[28];let p;return e[29]!==n||e[30]!==s||e[31]!==d||e[32]!==N||e[33]!==R||e[34]!==k||e[35]!==S||e[36]!==h||e[37]!==u||e[38]!==g||e[39]!==x?(p=(0,r.jsxs)("div",{className:"flex items-center border-b border-border px-3 py-1.5 font-mono text-xs hover:bg-muted/50","data-index":n,"data-testid":"lg-req-row",ref:s,role:"row",style:d,children:[h,u,g,x,N,R,k,S]}),e[29]=n,e[30]=s,e[31]=d,e[32]=N,e[33]=R,e[34]=k,e[35]=S,e[36]=h,e[37]=u,e[38]=g,e[39]=x,e[40]=p):p=e[40],p},"st"),qe=v(i=>{let{entries:e}=i??{};return Array.isArray(e)?e:[]},"de"),at=v(i=>{let e={};return i.functionPathPrefix.trim()!==""&&(e.functionPathPrefix=i.functionPathPrefix.trim()),i.userId.trim()!==""&&(e.userId=i.userId.trim()),i.tableTouched.trim()!==""&&(e.tableTouched=i.tableTouched.trim()),(i.outcome==="ok"||i.outcome==="error")&&(e.outcome=i.outcome),e},"lt"),lt={"5m":300*1e3,"15m":900*1e3,"1h":3600*1e3},ot=v((i,e)=>{let t=e.search.trim().toLowerCase(),n=e.path.trim().toLowerCase(),s=e.range==="all"?Number.NEGATIVE_INFINITY:e.now-lt[e.range];return i.filter(o=>e.levels.size>0&&!e.levels.has(o.level)||o.timestamp<s||n!==""&&!(o.functionPath??"").toLowerCase().includes(n)?!1:t===""||o.message.toLowerCase().includes(t)||ce(o.fields).toLowerCase().includes(t))},"at"),nt="\u2014",st=v(i=>{let e=new Map,t=new Map;for(let o of i){e.set(o.level,(e.get(o.level)??0)+1);let c=o.functionPath??nt;t.set(c,(t.get(c)??0)+1)}let n=me.filter(o=>e.has(o)).map(o=>({count:e.get(o)??0,key:o})),s=[...t.entries()].map(([o,c])=>({count:c,key:o})).toSorted((o,c)=>c.count===o.count?o.key.localeCompare(c.key):c.count-o.count);return{byLevel:n,byPath:s,total:i.length}},"it"),qt=v(({initialShardKey:i})=>{let e=z(),[t,n]=(0,I.useState)("requests"),{queryShardKey:s,setShardKey:o,shardKey:c}=xe(i),[f,m]=(0,I.useState)(""),[d,a]=(0,I.useState)(()=>new Set),[h,l]=(0,I.useState)(""),[u,g]=(0,I.useState)("all"),[b,x]=(0,I.useState)(!1),[w,N]=(0,I.useState)(""),[y,T]=(0,I.useState)(""),[R,L]=(0,I.useState)(""),[k,S]=(0,I.useState)("all"),p=at({functionPathPrefix:w,outcome:k,tableTouched:R,userId:y}),C=oe(ne.getRequestLog,p,{enabled:t==="requests",live:!0,shardKey:s}),q=oe(ne.getLogs,{},{enabled:t==="errors",live:!0,shardKey:s}),F=t==="requests"?C:q,{error:O,errorSource:E,isLoading:M,liveError:V}=F,_=Te(s),U=qe(q.data),A=qe(C.data);(0,I.useEffect)(()=>{F.data!==void 0&&ve(s)},[F.data,s]);let $=ot(U,{levels:d,now:Date.now(),path:h,range:u,search:f}),Q=st($),X=t==="requests"?A.length:$.length,Z=t==="errors"&&b,Y=(0,I.useMemo)(()=>O!==null?"error":X===0?M?Z?"summary":"list":"empty":Z?"summary":"list",[X,M,O,Z]),he=(0,I.useRef)(null),G=Le({count:X,estimateSize:v(()=>Xe,"estimateSize"),getScrollElement:v(()=>he.current,"getScrollElement"),initialRect:{height:ue,width:800},observeElementRect:v((P,ee)=>Se(P,ee,ue),"observeElementRect"),overscan:8}),Ke=G.getVirtualItems(),Me={height:G.getTotalSize(),position:"relative",width:"100%"};return(0,r.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-logs",children:[(0,r.jsx)(Je,{liveError:V,onShardKeyChange:o,onShowArchive:v(()=>{n("archive"),x(!1)},"onShowArchive"),onShowErrors:v(()=>{n("errors"),x(!1)},"onShowErrors"),onShowRequests:v(()=>{n("requests"),x(!1)},"onShowRequests"),shardKey:c,view:t}),t==="errors"&&(0,r.jsx)(Ve,{levelFilter:d,onLogPathChange:v(P=>{l(P.target.value)},"onLogPathChange"),onSearchChange:v(P=>{m(P.target.value)},"onSearchChange"),onTimeRangeChange:v(P=>{g(P.target.value)},"onTimeRangeChange"),onToggleLevel:v(P=>{a(ee=>{let H=new Set(ee);return H.has(P)?H.delete(P):H.add(P),H})},"onToggleLevel"),onToggleSummary:v(()=>{x(P=>!P)},"onToggleSummary"),pathFilter:h,search:f,showSummary:b,timeRange:u}),t==="requests"&&(0,r.jsx)(Qe,{onOutcomeChange:v(P=>{S(P.target.value)},"onOutcomeChange"),onPathChange:v(P=>{N(P.target.value)},"onPathChange"),onTableChange:v(P=>{L(P.target.value)},"onTableChange"),onUserChange:v(P=>{T(P.target.value)},"onUserChange"),outcomeFilter:k,pathPrefix:w,tableFilter:R,userIdFilter:y}),t==="archive"?(0,r.jsx)(Be,{shardKey:s}):(0,r.jsxs)(r.Fragment,{children:[Y==="error"&&(0,r.jsx)(ye,{error:E,testId:"lg-error"}),Y==="empty"&&(0,r.jsx)(J,{description:e("Function and request logs for this shard show up here as your app handles traffic."),icon:(0,r.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M4 5h16M4 12h16M4 19h10"})}),testId:"lg-empty",title:e("No logs.")}),Y==="summary"&&(0,r.jsx)(Ye,{summary:Q}),Y==="list"&&(0,r.jsx)("div",{className:"rounded-xl border border-border shadow-xs","data-testid":"lg-scroll",ref:he,style:Ze,children:(0,r.jsx)("div",{"aria-label":e("Recent logs"),"data-testid":"lg-table",role:"grid",style:Me,children:Ke.map(P=>t==="requests"?(0,r.jsx)(rt,{entry:A[P.index],index:P.index,measureRef:G.measureElement,onOpenTrace:_,start:P.start},P.key):(0,r.jsx)(tt,{entry:$[P.index],index:P.index,measureRef:G.measureElement,onOpenTrace:_,start:P.start},P.key))})})]})]})},"Wt");export{qt as LogsPanel,ot as filterLogs,st as summarizeLogs};
@@ -1 +0,0 @@
1
- import{h as s}from"./chunk-BFE2DRP6.js";import{a as d,d as o,f as c,g as b}from"./chunk-OXFKZ4BM.js";var l=o(c(),1);var u=o(b(),1);function p(n){let i=(0,l.c)(8),r,e;i[0]!==n?({className:r,...e}=n,i[0]=n,i[1]=r,i[2]=e):(r=i[1],e=i[2]);let t;i[3]!==r?(t=s("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-2.5 py-2 text-xs transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 md:text-xs dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",r),i[3]=r,i[4]=t):t=i[4];let a;return i[5]!==e||i[6]!==t?(a=(0,u.jsx)("textarea",{"data-slot":"textarea",className:t,...e}),i[5]=e,i[6]=t,i[7]=a):a=i[7],a}d(p,"b");export{p as a};
@@ -1 +0,0 @@
1
- import{a as D}from"./chunk-T5UMHPAB.js";import{a as T}from"./chunk-NVKLYDOH.js";import{b as E}from"./chunk-E26OT26O.js";import{e as A,l as H,p as I,s as O,t as S}from"./chunk-BFE2DRP6.js";import{a as C,d as q,f as _,g as z}from"./chunk-OXFKZ4BM.js";var K=q(_(),1);var l=q(z(),1);var P=C(U=>{let e=(0,K.c)(42),{className:y,error:t,testId:g}=U,k=H(),r=E(),n,i,a,c,m,p,o,s,d;if(e[0]!==y||e[1]!==t||e[2]!==r||e[3]!==g){let V=O(t),b;e[13]!==t?(b=S(t),e[13]=t,e[14]=b):b=e[14],i=b;let v;e[15]!==t?(v=T(t),e[15]=t,e[16]=v):v=e[16];let j=v,w=t?.why,N;e[17]!==r||e[18]!==j?(N=C(()=>{r?.openConsole({errorsOnly:!0,seq:j})},"y"),e[17]=r,e[18]=j,e[19]=N):N=e[19],a=N,n=D,c=y,m=g,p="destructive";let h;e[20]!==t?(h=I(t),e[20]=t,e[21]=h):h=e[21],e[22]!==h?(o=(0,l.jsx)("p",{className:"font-medium",children:h}),e[22]=h,e[23]=o):o=e[23],e[24]!==w?(s=typeof w=="string"?(0,l.jsx)("p",{className:"mt-1 text-xs opacity-90",children:w}):null,e[24]=w,e[25]=s):s=e[25],d=V===void 0?null:(0,l.jsx)("p",{className:"mt-1 whitespace-pre-wrap text-xs opacity-90",children:A(V)}),e[0]=y,e[1]=t,e[2]=r,e[3]=g,e[4]=n,e[5]=i,e[6]=a,e[7]=c,e[8]=m,e[9]=p,e[10]=o,e[11]=s,e[12]=d}else n=e[4],i=e[5],a=e[6],c=e[7],m=e[8],p=e[9],o=e[10],s=e[11],d=e[12];let f;e[26]!==i?(f=i===void 0?null:(0,l.jsx)("a",{"aria-label":"View documentation for this error",className:"mt-1 inline-block text-xs underline",href:i,rel:"noreferrer",target:"_blank",children:"View error docs"}),e[26]=i,e[27]=f):f=e[27];let u;e[28]!==r||e[29]!==a||e[30]!==k?(u=r===void 0?null:(0,l.jsx)("button",{className:"mt-1 block text-xs underline outline-none focus-visible:ring-1 focus-visible:ring-ring","data-testid":"error-show-in-console",onClick:a,type:"button",children:k("Show in console")}),e[28]=r,e[29]=a,e[30]=k,e[31]=u):u=e[31];let x;return e[32]!==n||e[33]!==c||e[34]!==m||e[35]!==p||e[36]!==o||e[37]!==s||e[38]!==d||e[39]!==f||e[40]!==u?(x=(0,l.jsxs)(n,{className:c,testId:m,variant:p,children:[o,s,d,f,u]}),e[32]=n,e[33]=c,e[34]=m,e[35]=p,e[36]=o,e[37]=s,e[38]=d,e[39]=f,e[40]=u,e[41]=x):x=e[41],x},"K");export{P as a};
@@ -1 +0,0 @@
1
- import{a as q}from"./chunk-473JK2PQ.js";import{a as F}from"./chunk-5DNGK3NT.js";import{a as D}from"./chunk-XST3UEHU.js";import"./chunk-SLIDAWNX.js";import"./chunk-6M7FLLMT.js";import"./chunk-SU5DTRGK.js";import"./chunk-W7MRISE3.js";import"./chunk-IBJVVHV5.js";import"./chunk-ZBON5T5A.js";import{b as S}from"./chunk-PQH2LSJX.js";import"./chunk-4C4THJUD.js";import{a as L}from"./chunk-CZ6HBDIL.js";import"./chunk-T5UMHPAB.js";import"./chunk-NVKLYDOH.js";import"./chunk-E26OT26O.js";import{a as B}from"./chunk-6UTZXEW3.js";import{c as _}from"./chunk-4DAKKAK7.js";import"./chunk-BVX45MU5.js";import"./chunk-H7HZ42JY.js";import{a as j}from"./chunk-XMSNLMWU.js";import{a as O,b as P,c as W,d as C,e as h,f as p}from"./chunk-HHRYM6UW.js";import{a as T,e as $}from"./chunk-JSDKOE4U.js";import{l as M,v as E}from"./chunk-BFE2DRP6.js";import{a as N,d as A,f as H,g as U}from"./chunk-OXFKZ4BM.js";var R=A(H(),1);var t=A(U(),1);var J=80,Z=N(a=>{if(a===void 0)return"";let e=JSON.stringify(a,E);return e.length>J?`${e.slice(0,J)}\u2026`:e},"G"),z=N(a=>{let e=[];for(let r of a){let n=r.id.toString();if(r.subscriptions.length===0){e.push({admin:r.admin,connectionId:r.id,key:`c${n}`,subscription:null});continue}r.subscriptions.forEach((d,o)=>{e.push({admin:r.admin,connectionId:r.id,key:`c${n}-s${o.toString()}`,subscription:d})})}return e},"J"),w=(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"}),ce=N(a=>{let e=(0,R.c)(22),{initialShardKey:r}=a,n=M(),{queryShardKey:d,setShardKey:o,shardKey:m}=F(r),f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f={},e[0]=f):f=e[0];let b;e[1]!==d?(b={keepPreviousData:!0,shardKey:d},e[1]=d,e[2]=b):b=e[2];let{data:s,error:i,errorSource:u,poll:G}=_(B.listSubscriptions,f,b);q(G,!0);let x;if(e[3]!==i||e[4]!==u||e[5]!==s||e[6]!==o||e[7]!==m||e[8]!==n){let k=s===void 0?[]:z(s.connections),c;e[10]!==o||e[11]!==m?(c=(0,t.jsx)(D,{onChange:o,testId:"subs-shard-input",value:m}),e[10]=o,e[11]=m,e[12]=c):c=e[12];let l;e[13]!==s||e[14]!==n?(l=s!==void 0&&(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-2 text-sm text-muted-foreground","data-testid":"subs-count",children:[(0,t.jsx)(S,{variant:"secondary",children:n("{count} connections",{count:s.totalConnections})}),(0,t.jsx)(S,{variant:"secondary",children:n("{count} subscriptions",{count:s.totalSubscriptions})})]}),e[13]=s,e[14]=n,e[15]=l):l=e[15];let g;e[16]!==c||e[17]!==l?(g=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[c,l]}),e[16]=c,e[17]=l,e[18]=g):g=e[18];let v;e[19]!==i||e[20]!==u?(v=i!==null&&(0,t.jsx)(L,{error:u,testId:"subs-error"}),e[19]=i,e[20]=u,e[21]=v):v=e[21],x=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"subs-panel",children:[g,v,i===null&&s!==void 0&&k.length===0&&(0,t.jsx)(j,{description:n("Active WebSocket subscriptions on this shard."),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:"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"})}),testId:"subs-empty",title:n("No active subscriptions.")}),i===null&&k.length>0&&(0,t.jsx)(T,{className:"overflow-hidden py-0",children:(0,t.jsx)($,{className:"px-0",children:(0,t.jsxs)(O,{"data-testid":"subs-table",children:[(0,t.jsx)(P,{children:(0,t.jsxs)(C,{children:[(0,t.jsx)(h,{children:n("Connection")}),(0,t.jsx)(h,{children:n("Function path")}),(0,t.jsx)(h,{children:n("Table")}),(0,t.jsx)(h,{children:n("Arguments")})]})}),(0,t.jsx)(W,{children:k.map(y=>{let{subscription:I}=y,K=Z(I?.args);return(0,t.jsxs)(C,{"data-testid":"subs-row",children:[(0,t.jsx)(p,{className:"font-medium tabular-nums",children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:["#",y.connectionId,y.admin&&(0,t.jsx)(S,{variant:"outline",children:n("admin")})]})}),(0,t.jsx)(p,{className:"font-mono text-xs",children:I?.functionPath??w}),(0,t.jsx)(p,{children:I?.table??w}),(0,t.jsx)(p,{className:"max-w-[32ch] truncate font-mono text-xs text-muted-foreground",title:K||void 0,children:K||w})]},y.key)})})]})})})]}),e[3]=i,e[4]=u,e[5]=s,e[6]=o,e[7]=m,e[8]=n,e[9]=x}else x=e[9];return x},"ae");export{ce as default};
@@ -1 +0,0 @@
1
- import{a as e,d as m,e as _,f as v,g as y}from"./chunk-OXFKZ4BM.js";var S=m(v(),1),s=m(_(),1),w=m(y(),1);var q=(0,s.createContext)(void 0),C=e(t=>{let o=(0,S.c)(10),{children:p}=t,r;o[0]===Symbol.for("react.memo_cache_sentinel")?(r={focusSeq:void 0,open:!1,shown:"all"},o[0]=r):r=o[0];let[n,c]=(0,s.useState)(r),l;o[1]===Symbol.for("react.memo_cache_sentinel")?(l=e(()=>({close:e(()=>{c(b)},"close"),openConsole:e(f=>{c({focusSeq:f?.seq,open:!0,shown:f?.errorsOnly===!0?"errors":"all"})},"openConsole"),setShown:e(f=>{c(d=>({...d,shown:f}))},"setShown"),toggle:e(()=>{c(x)},"toggle")}),"r"),o[1]=l):l=o[1];let[h]=(0,s.useState)(l),u;o[2]!==h||o[3]!==n.focusSeq||o[4]!==n.open||o[5]!==n.shown?(u={...h,focusSeq:n.focusSeq,open:n.open,shown:n.shown},o[2]=h,o[3]=n.focusSeq,o[4]=n.open,o[5]=n.shown,o[6]=u):u=o[6];let i=u,a;return o[7]!==p||o[8]!==i?(a=(0,w.jsx)(q,{value:i,children:p}),o[7]=p,o[8]=i,o[9]=a):a=o[9],a},"y"),g=e(()=>(0,s.use)(q),"b");function b(t){return{...t,open:!1}}e(b,"_");function x(t){return{focusSeq:void 0,open:!t.open,shown:"all"}}e(x,"d");export{C as a,g as b};
@@ -1 +0,0 @@
1
- import{a as d}from"./chunk-WM72PRE3.js";import{a as m,d as w,e as P,f as S,g as G}from"./chunk-OXFKZ4BM.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};
@@ -1 +0,0 @@
1
- import{a as s}from"./chunk-6VAY6L4J.js";import{l as d}from"./chunk-BFE2DRP6.js";import{a as e,d as r,e as h,g as k}from"./chunk-OXFKZ4BM.js";var l=r(h(),1);var t=r(k(),1);var g=e(({children:m,confirmLabel:c,disabled:a=!1,onConfirm:p,testId:i})=>{let o=d(),[f,n]=(0,l.useState)(!1),u=e(()=>{n(!0)},"f"),C=e(()=>{n(!1)},"l"),b=e(()=>{n(!1),p()},"p");return f?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1","data-testid":`${i}-prompt`,role:"group",children:[(0,t.jsx)(s,{"data-testid":`${i}-confirm`,disabled:a,onClick:b,size:"sm",type:"button",variant:"destructive",children:c??o("Confirm")}),(0,t.jsx)(s,{"data-testid":`${i}-cancel`,onClick:C,size:"sm",type:"button",variant:"ghost",children:o("Cancel")})]}):(0,t.jsx)(s,{"data-testid":i,disabled:a,onClick:u,size:"sm",type:"button",variant:"outline",children:m})},"k");export{g as a};
@@ -1 +0,0 @@
1
- import{h as d}from"./chunk-BFE2DRP6.js";import{a as c,d as b,f as m,g as i}from"./chunk-OXFKZ4BM.js";var n=b(m(),1);var o=b(i(),1);function p(r){let e=(0,n.c)(8),t,a;e[0]!==r?({className:t,...a}=r,e[0]=r,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let l;e[3]!==t?(l=d("w-full caption-bottom text-xs",t),e[3]=t,e[4]=l):l=e[4];let s;return e[5]!==a||e[6]!==l?(s=(0,o.jsx)("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto overflow-y-clip",children:(0,o.jsx)("table",{"data-slot":"table",className:l,...a})}),e[5]=a,e[6]=l,e[7]=s):s=e[7],s}c(p,"f");function f(r){let e=(0,n.c)(8),t,a;e[0]!==r?({className:t,...a}=r,e[0]=r,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let l;e[3]!==t?(l=d("bg-muted/50 [&_tr]:border-b",t),e[3]=t,e[4]=l):l=e[4];let s;return e[5]!==a||e[6]!==l?(s=(0,o.jsx)("thead",{"data-slot":"table-header",className:l,...a}),e[5]=a,e[6]=l,e[7]=s):s=e[7],s}c(f,"p");function h(r){let e=(0,n.c)(8),t,a;e[0]!==r?({className:t,...a}=r,e[0]=r,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let l;e[3]!==t?(l=d("[&_tr:last-child]:border-0",t),e[3]=t,e[4]=l):l=e[4];let s;return e[5]!==a||e[6]!==l?(s=(0,o.jsx)("tbody",{"data-slot":"table-body",className:l,...a}),e[5]=a,e[6]=l,e[7]=s):s=e[7],s}c(h,"m");function x(r){let e=(0,n.c)(8),t,a;e[0]!==r?({className:t,...a}=r,e[0]=r,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let l;e[3]!==t?(l=d("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",t),e[3]=t,e[4]=l):l=e[4];let s;return e[5]!==a||e[6]!==l?(s=(0,o.jsx)("tr",{"data-slot":"table-row",className:l,...a}),e[5]=a,e[6]=l,e[7]=s):s=e[7],s}c(x,"u");function N(r){let e=(0,n.c)(8),t,a;e[0]!==r?({className:t,...a}=r,e[0]=r,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let l;e[3]!==t?(l=d("h-9 border-e border-border px-3 text-start align-middle font-mono text-[11px] font-medium tracking-wide whitespace-nowrap text-muted-foreground uppercase last:border-e-0 [&:has([role=checkbox])]:pe-0",t),e[3]=t,e[4]=l):l=e[4];let s;return e[5]!==a||e[6]!==l?(s=(0,o.jsx)("th",{"data-slot":"table-head",className:l,...a}),e[5]=a,e[6]=l,e[7]=s):s=e[7],s}c(N,"h");function w(r){let e=(0,n.c)(8),t,a;e[0]!==r?({className:t,...a}=r,e[0]=r,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let l;e[3]!==t?(l=d("border-e border-border px-3 py-1.5 align-middle whitespace-nowrap last:border-e-0 [&:has([role=checkbox])]:pe-0",t),e[3]=t,e[4]=l):l=e[4];let s;return e[5]!==a||e[6]!==l?(s=(0,o.jsx)("td",{"data-slot":"table-cell",className:l,...a}),e[5]=a,e[6]=l,e[7]=s):s=e[7],s}c(w,"x");export{p as a,f as b,h as c,x as d,N as e,w as f};
@@ -1 +0,0 @@
1
- import{a as we}from"./chunk-X74GEPSG.js";import{b as xe,c as Ne}from"./chunk-4SQBAPY6.js";import{a as Se,b as Ce,c as Ee,d as Ke,e as Fe}from"./chunk-TCYPNSTV.js";import"./chunk-A566HCBX.js";import"./chunk-LIGOLZND.js";import{a as ue}from"./chunk-CNA3TVUK.js";import{a as me}from"./chunk-QWRK4ESB.js";import{a as Y}from"./chunk-KZCEJFZF.js";import{g as ve,h as pe,i as ye,j as he}from"./chunk-K3CWB3AM.js";import"./chunk-YHTHRYP5.js";import"./chunk-BYOGQ2IV.js";import"./chunk-DX55P3KZ.js";import"./chunk-AP4PC2M4.js";import"./chunk-KRPXOSBL.js";import"./chunk-W2BCSK5S.js";import"./chunk-7PADVGQX.js";import"./chunk-NGVP66OH.js";import"./chunk-XYR5NST4.js";import"./chunk-DBVJ5VLI.js";import"./chunk-6M7FLLMT.js";import"./chunk-LUHXNZI4.js";import"./chunk-ZTOREMGH.js";import{i as ae}from"./chunk-SU5DTRGK.js";import"./chunk-W7MRISE3.js";import"./chunk-IBJVVHV5.js";import{a as R}from"./chunk-6VAY6L4J.js";import"./chunk-JTGGWF7R.js";import"./chunk-ZBON5T5A.js";import{b as ge}from"./chunk-PQH2LSJX.js";import"./chunk-4C4THJUD.js";import"./chunk-E26OT26O.js";import"./chunk-6UTZXEW3.js";import"./chunk-4DAKKAK7.js";import{m as G}from"./chunk-BVX45MU5.js";import"./chunk-H7HZ42JY.js";import{a as be}from"./chunk-XMSNLMWU.js";import{a as ie,b as oe,c as ce,d as Q,e as U,f as X}from"./chunk-HHRYM6UW.js";import{a as ne,e as de}from"./chunk-JSDKOE4U.js";import{B as se,l as W,p as H,u as fe,y as P}from"./chunk-BFE2DRP6.js";import{a as d,d as re,e as Re,f as $e,g as Ae}from"./chunk-OXFKZ4BM.js";var _=re(Re(),1);var ee=re($e(),1);var a=re(Ae(),1);var Pe=d(l=>{let e=l.trim();if(e==="")return;let n=Number(e);return Number.isFinite(n)&&n>0?Math.floor(n):void 0},"Je"),je=d(l=>l===void 0?"\u2014":new Date(l*1e3).toISOString(),"He"),We=d(l=>new TextEncoder().encode(l).length,"We"),Oe=d(l=>{if(l.trim()!=="")try{return JSON.stringify(JSON.parse(l),void 0,2)}catch{return}},"Ce"),Ie=d(l=>{if(l.trim()==="")return!0;try{return JSON.parse(l),!0}catch{return!1}},"Ee"),Be=[{key:"seconds",seconds:1},{key:"minutes",seconds:60},{key:"hours",seconds:3600},{key:"days",seconds:86400}],Te=d((l,e)=>{let n=l.trim();if(n==="")return"";let s=Number(n),i=Be.find(y=>y.key===e)?.seconds??1;return Number.isFinite(s)&&s>0?String(Math.round(s*i)):n},"ve"),_e=d(l=>{let e=l.trim();if(e==="")return!0;let n=Number(e);return Number.isInteger(n)&&n>=60},"Te"),Le=d((l,e,n,s)=>{let i=Pe(l.ttl);return{expiration:i===void 0?s:void 0,expirationTtl:i,key:e,metadata:l.metadata.trim()===""?void 0:JSON.parse(l.metadata),namespace:n,value:l.value}},"Ke"),De=d(l=>{let e=(0,ee.c)(60),{helper:n,id:s,invalid:i,onChange:y,testId:o}=l,t=W(),[r,h]=(0,_.useState)(""),[m,x]=(0,_.useState)("seconds"),N;e[0]!==y||e[1]!==m?(N=d(C=>{h(C.target.value),y(Te(C.target.value,m))},"x"),e[0]=y,e[1]=m,e[2]=N):N=e[2];let T=N,V;e[3]!==r||e[4]!==y?(V=d(C=>{C!==null&&(x(C),y(Te(r,C)))},"F"),e[3]=r,e[4]=y,e[5]=V):V=e[5];let E=V,c;e[6]!==t?(c=t("days"),e[6]=t,e[7]=c):c=e[7];let u;e[8]!==t?(u=t("hours"),e[8]=t,e[9]=u):u=e[9];let p;e[10]!==t?(p=t("minutes"),e[10]=t,e[11]=p):p=e[11];let b;e[12]!==t?(b=t("seconds"),e[12]=t,e[13]=b):b=e[13];let f;e[14]!==c||e[15]!==u||e[16]!==p||e[17]!==b?(f={days:c,hours:u,minutes:p,seconds:b},e[14]=c,e[15]=u,e[16]=p,e[17]=b,e[18]=f):f=e[18];let w=f,g;e[19]!==t?(g=t("Expires after"),e[19]=t,e[20]=g):g=e[20];let S;e[21]!==s||e[22]!==g?(S=(0,a.jsx)(Y,{className:"text-xs",htmlFor:s,children:g}),e[21]=s,e[22]=g,e[23]=S):S=e[23];let M;e[24]!==t?(M=t("No expiration"),e[24]=t,e[25]=M):M=e[25];let D;e[26]!==r||e[27]!==s||e[28]!==i||e[29]!==T||e[30]!==M||e[31]!==o?(D=(0,a.jsx)(ae,{"aria-invalid":i,className:"flex-1","data-testid":o,id:s,inputMode:"numeric",onChange:T,placeholder:M,value:r}),e[26]=r,e[27]=s,e[28]=i,e[29]=T,e[30]=M,e[31]=o,e[32]=D):D=e[32];let O;e[33]!==t?(O=t("TTL unit"),e[33]=t,e[34]=O):O=e[34];let J=`${o}-unit`,z;e[35]===Symbol.for("react.memo_cache_sentinel")?(z=(0,a.jsx)(Ce,{}),e[35]=z):z=e[35];let I;e[36]!==O||e[37]!==J?(I=(0,a.jsx)(Ee,{"aria-label":O,className:"w-[7.5rem]","data-testid":J,children:z}),e[36]=O,e[37]=J,e[38]=I):I=e[38];let v;e[39]!==w?(v=Be.map(C=>(0,a.jsx)(Fe,{value:C.key,children:w[C.key]},C.key)),e[39]=w,e[40]=v):v=e[40];let k;e[41]!==v?(k=(0,a.jsx)(Ke,{children:v}),e[41]=v,e[42]=k):k=e[42];let K;e[43]!==E||e[44]!==I||e[45]!==k||e[46]!==m?(K=(0,a.jsxs)(Se,{onValueChange:E,value:m,children:[I,k]}),e[43]=E,e[44]=I,e[45]=k,e[46]=m,e[47]=K):K=e[47];let B;e[48]!==D||e[49]!==K?(B=(0,a.jsxs)("div",{className:"flex gap-2",children:[D,K]}),e[48]=D,e[49]=K,e[50]=B):B=e[50];let F;e[51]!==n||e[52]!==i||e[53]!==t||e[54]!==o?(F=i?(0,a.jsx)("p",{className:"text-xs text-destructive","data-testid":`${o}-invalid`,children:t("TTL must be at least 60 seconds.")}):n!==void 0&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:n}),e[51]=n,e[52]=i,e[53]=t,e[54]=o,e[55]=F):F=e[55];let L;return e[56]!==B||e[57]!==F||e[58]!==S?(L=(0,a.jsxs)("div",{className:"mb-3 grid gap-1",children:[S,B,F]}),e[56]=B,e[57]=F,e[58]=S,e[59]=L):L=e[59],L},"_e"),ze=d(l=>{let e=(0,ee.c)(36),{id:n,invalidTestId:s,onChange:i,testId:y,valid:o,value:t}=l,r=W(),h;e[0]!==t?(h=Oe(t),e[0]=t,e[1]=h):h=e[1];let m=h,x;e[2]!==r?(x=r("Metadata (JSON)"),e[2]=r,e[3]=x):x=e[3];let N;e[4]!==n||e[5]!==x?(N=(0,a.jsx)(Y,{className:"text-xs",htmlFor:n,children:x}),e[4]=n,e[5]=x,e[6]=N):N=e[6];let T=`${y}-format`,V=m===void 0,E;e[7]!==m||e[8]!==i?(E=d(()=>{m!==void 0&&i(m)},"w"),e[7]=m,e[8]=i,e[9]=E):E=e[9];let c;e[10]!==r?(c=r("Format JSON"),e[10]=r,e[11]=c):c=e[11];let u;e[12]!==T||e[13]!==V||e[14]!==E||e[15]!==c?(u=(0,a.jsx)(R,{"data-testid":T,disabled:V,onClick:E,size:"sm",variant:"outline",children:c}),e[12]=T,e[13]=V,e[14]=E,e[15]=c,e[16]=u):u=e[16];let p;e[17]!==N||e[18]!==u?(p=(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[N,u]}),e[17]=N,e[18]=u,e[19]=p):p=e[19];let b=!o,f;e[20]!==i?(f=d(M=>{i(M.target.value)},"b"),e[20]=i,e[21]=f):f=e[21];let w;e[22]!==n||e[23]!==b||e[24]!==f||e[25]!==y||e[26]!==t?(w=(0,a.jsx)(ue,{"aria-invalid":b,className:"min-h-[4rem] font-mono text-xs","data-testid":y,id:n,onChange:f,value:t}),e[22]=n,e[23]=b,e[24]=f,e[25]=y,e[26]=t,e[27]=w):w=e[27];let g;e[28]!==s||e[29]!==r||e[30]!==o?(g=!o&&(0,a.jsx)("p",{className:"text-xs text-destructive","data-testid":s,children:r("Metadata must be valid JSON.")}),e[28]=s,e[29]=r,e[30]=o,e[31]=g):g=e[31];let S;return e[32]!==w||e[33]!==g||e[34]!==p?(S=(0,a.jsxs)("div",{className:"mb-3 grid gap-1",children:[p,w,g]}),e[32]=w,e[33]=g,e[34]=p,e[35]=S):S=e[35],S},"Fe"),He={busy:!1,error:null,metadata:"",name:"",ttl:"",value:""},qe=d((l,e)=>{switch(e.type){case"setField":return{...l,[e.field]:e.value};case"submitFailed":return{...l,busy:!1,error:e.error};case"submitStart":return{...l,busy:!0,error:null};default:return l}},"Ue"),Ze=d(l=>{let e=(0,ee.c)(73),{namespace:n,onCancel:s,onCreated:i}=l,y=G(),o=W(),[t,r]=(0,_.useReducer)(qe,He),h;e[0]!==t.metadata?(h=Ie(t.metadata),e[0]=t.metadata,e[1]=h):h=e[1];let m=h,x;e[2]!==t.ttl?(x=_e(t.ttl),e[2]=t.ttl,e[3]=x):x=e[3];let N=x,T;e[4]!==m||e[5]!==t.busy||e[6]!==t.name||e[7]!==N?(T=t.name.trim()!==""&&m&&N&&!t.busy,e[4]=m,e[5]=t.busy,e[6]=t.name,e[7]=N,e[8]=T):T=e[8];let V=T,E;e[9]!==V||e[10]!==y||e[11]!==n||e[12]!==i||e[13]!==t.metadata||e[14]!==t.name||e[15]!==t.ttl||e[16]!==t.value?(E=d(()=>{V&&(r({type:"submitStart"}),P((async()=>{try{await y.putKvValue(Le({metadata:t.metadata,ttl:t.ttl,value:t.value},t.name,n)),i()}catch(A){r({error:H(A),type:"submitFailed"})}})()))},"w"),e[9]=V,e[10]=y,e[11]=n,e[12]=i,e[13]=t.metadata,e[14]=t.name,e[15]=t.ttl,e[16]=t.value,e[17]=E):E=e[17];let c=E,u;e[18]!==o?(u=o("Key name"),e[18]=o,e[19]=u):u=e[19];let p;e[20]!==u?(p=(0,a.jsx)(Y,{className:"text-xs",htmlFor:"kv-create-name",children:u}),e[20]=u,e[21]=p):p=e[21];let b;e[22]===Symbol.for("react.memo_cache_sentinel")?(b=d(A=>{r({field:"name",type:"setField",value:A.target.value})},"y"),e[22]=b):b=e[22];let f;e[23]!==o?(f=o("Key name"),e[23]=o,e[24]=f):f=e[24];let w;e[25]!==t.name||e[26]!==f?(w=(0,a.jsx)(ae,{autoFocus:!0,"data-testid":"kv-create-name",id:"kv-create-name",onChange:b,placeholder:f,value:t.name}),e[25]=t.name,e[26]=f,e[27]=w):w=e[27];let g;e[28]!==p||e[29]!==w?(g=(0,a.jsxs)("div",{className:"grid gap-1",children:[p,w]}),e[28]=p,e[29]=w,e[30]=g):g=e[30];let S;e[31]!==o?(S=o("Value"),e[31]=o,e[32]=S):S=e[32];let M;e[33]!==S?(M=(0,a.jsx)(Y,{className:"text-xs",htmlFor:"kv-create-value",children:S}),e[33]=S,e[34]=M):M=e[34];let D;e[35]===Symbol.for("react.memo_cache_sentinel")?(D=d(A=>{r({field:"value",type:"setField",value:A.target.value})},"B"),e[35]=D):D=e[35];let O;e[36]!==t.value?(O=(0,a.jsx)(ue,{className:"min-h-[6rem] font-mono text-xs","data-testid":"kv-create-value",id:"kv-create-value",onChange:D,value:t.value}),e[36]=t.value,e[37]=O):O=e[37];let J;e[38]!==M||e[39]!==O?(J=(0,a.jsxs)("div",{className:"grid gap-1",children:[M,O]}),e[38]=M,e[39]=O,e[40]=J):J=e[40];let z=!N,I;e[41]===Symbol.for("react.memo_cache_sentinel")?(I=d(A=>{r({field:"ttl",type:"setField",value:A})},"L"),e[41]=I):I=e[41];let v;e[42]!==z?(v=(0,a.jsx)(De,{id:"kv-create-ttl",invalid:z,onChange:I,testId:"kv-create-ttl"}),e[42]=z,e[43]=v):v=e[43];let k;e[44]===Symbol.for("react.memo_cache_sentinel")?(k=d(A=>{r({field:"metadata",type:"setField",value:A})},"h"),e[44]=k):k=e[44];let K;e[45]!==m||e[46]!==t.metadata?(K=(0,a.jsx)(ze,{id:"kv-create-metadata",invalidTestId:"kv-create-metadata-invalid",onChange:k,testId:"kv-create-metadata",valid:m,value:t.metadata}),e[45]=m,e[46]=t.metadata,e[47]=K):K=e[47];let B=!V,F;e[48]!==t.busy||e[49]!==o?(F=t.busy?o("Creating\u2026"):o("Create key"),e[48]=t.busy,e[49]=o,e[50]=F):F=e[50];let L;e[51]!==c||e[52]!==B||e[53]!==F?(L=(0,a.jsx)(R,{"data-testid":"kv-create-submit",disabled:B,onClick:c,children:F}),e[51]=c,e[52]=B,e[53]=F,e[54]=L):L=e[54];let C=t.busy,$;e[55]!==o?($=o("Cancel"),e[55]=o,e[56]=$):$=e[56];let j;e[57]!==s||e[58]!==t.busy||e[59]!==$?(j=(0,a.jsx)(R,{"data-testid":"kv-create-cancel",disabled:C,onClick:s,variant:"outline",children:$}),e[57]=s,e[58]=t.busy,e[59]=$,e[60]=j):j=e[60];let q;e[61]!==L||e[62]!==j?(q=(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[L,j]}),e[61]=L,e[62]=j,e[63]=q):q=e[63];let Z;e[64]!==t.error?(Z=t.error!==null&&(0,a.jsx)("p",{className:"text-sm text-destructive","data-testid":"kv-create-error",role:"alert",children:t.error}),e[64]=t.error,e[65]=Z):Z=e[65];let te;return e[66]!==g||e[67]!==J||e[68]!==v||e[69]!==K||e[70]!==q||e[71]!==Z?(te=(0,a.jsxs)("div",{className:"grid gap-3 px-4 pb-4","data-testid":"kv-create-form",children:[g,J,v,K,q,Z]}),e[66]=g,e[67]=J,e[68]=v,e[69]=K,e[70]=q,e[71]=Z,e[72]=te):te=e[72],te},"Ze"),le=33,Ve=600,Ye=d(l=>{for(let e=l?.parentElement??null;e!==null;e=e.parentElement){let{overflowY:n}=getComputedStyle(e);if(n==="auto"||n==="scroll")return e}return document.scrollingElement},"qe"),Je=d((l,e,n)=>{if(l===null||typeof ResizeObserver>"u")return;let s=new ResizeObserver(n),i=[];for(let t=l;t!==null&&t!==e;t=t.parentElement)i.push(t);let y=d(()=>{s.disconnect();for(let t of i)for(let r=t.previousElementSibling;r!==null;r=r.previousElementSibling)s.observe(r)},"v");y();let o=typeof MutationObserver>"u"?void 0:new MutationObserver(()=>{y(),n()});for(let t of i)t.parentElement!==null&&o?.observe(t.parentElement,{childList:!0});return()=>{o?.disconnect(),s.disconnect()}},"Ve"),ke=d(l=>l.scrollElement===document.scrollingElement,"ae"),Ge=d((l,e,n)=>{let s=l.targetWindow;if(!s)return;let i=d(r=>{e(Math.max(0,-(n()?.getBoundingClientRect().top??0)),r)},"i"),y=d(()=>{i(!0)},"v"),o=d(()=>{i(!1)},"d");i(!1),s.addEventListener("scroll",y,{passive:!0}),s.addEventListener("scrollend",o);let t=Je(n(),null,o);return()=>{t?.(),s.removeEventListener("scroll",y),s.removeEventListener("scrollend",o)}},"Ge"),Qe=d((l,e)=>{let n=l.targetWindow;if(!n)return;let s=d(()=>{e({height:n.innerHeight,width:n.innerWidth})},"s");return s(),n.addEventListener("resize",s),()=>{n.removeEventListener("resize",s)}},"Ye"),Ue=d(({allSelected:l,bulkSelected:e,keys:n,onSelectKey:s,onToggleAll:i,onToggleBulk:y,selectedKey:o})=>{let t=W(),r=(0,_.useRef)(null),h=(0,_.useRef)(null),m=Ne({count:n.length,estimateSize:d(()=>le,"estimateSize"),getItemKey:d(c=>n[c]?.name??c,"getItemKey"),getScrollElement:d(()=>Ye(r.current),"getScrollElement"),initialRect:{height:Ve,width:800},observeElementOffset:d((c,u)=>{if(ke(c))return Ge(c,u,()=>r.current);let p=d(w=>{let g=c.scrollElement,S=r.current;u(g&&S?Math.max(0,g.getBoundingClientRect().top-S.getBoundingClientRect().top):0,w)},"f"),b=xe(c,(w,g)=>{p(g)}),f=Je(r.current,c.scrollElement,()=>{p(!1)});return()=>{f?.(),b?.()}},"observeElementOffset"),observeElementRect:d((c,u)=>ke(c)?Qe(c,u):we(c,u,Ve),"observeElementRect"),overscan:12}),x=m.getVirtualItems(),N=x[0]?.start??0,T=m.getTotalSize()-(x.at(-1)?.end??0),V=d(c=>{let u=c.key==="Tab"&&c.target instanceof Element?c.target.closest("[data-index]"):null;if(u===null)return;let p=c.shiftKey?-1:1,b=(h.current?.index??Number(u.dataset.index))+p,f=n[b];f===void 0||h.current===null&&u.parentElement?.querySelector(`[data-index="${String(b)}"]`)||(c.preventDefault(),h.current={index:b,name:f.name},ke(m)?m.targetWindow?.scrollBy(0,p*le):m.scrollElement?.scrollBy(0,p*le))},"F");(0,_.useEffect)(()=>{let c=h.current?.name,u=(c===void 0?void 0:[...r.current?.querySelectorAll("[data-key]")??[]].find(p=>p.dataset.key===c))?.querySelector('[data-testid^="kv-select-"]');u&&(h.current=null,u.focus())});let E=0;for(let c of n)E=Math.max(E,c.name.length);return(0,a.jsxs)(ie,{"data-testid":"kv-key-table",children:[(0,a.jsx)(oe,{children:(0,a.jsxs)(Q,{children:[(0,a.jsx)(U,{className:"w-10",children:(0,a.jsx)(me,{"aria-label":t("Select all"),checked:l,"data-testid":"kv-select-all",onCheckedChange:i})}),(0,a.jsx)(U,{children:t("Key")}),(0,a.jsx)(U,{children:t("Expiration")})]})}),(0,a.jsxs)(ce,{onKeyDown:V,ref:r,children:[N>0&&(0,a.jsx)("tr",{"aria-hidden":"true",style:{height:N}}),x.map(c=>{let u=n[c.index];return u===void 0?null:(0,a.jsxs)(Q,{className:u.name===o?"border-l-2 border-l-royal-amethyst bg-muted/50":"cursor-pointer","data-index":c.index,"data-key":u.name,"data-testid":`kv-key-row-${u.name}`,onClick:s,style:{height:le},children:[(0,a.jsx)(X,{onClick:d(p=>{p.stopPropagation()},"onClick"),children:(0,a.jsx)(me,{"aria-label":t("Select {name}",{name:u.name}),checked:e.has(u.name),"data-testid":`kv-select-${u.name}`,onCheckedChange:d(()=>{y(u.name)},"onCheckedChange")})}),(0,a.jsx)(X,{className:"font-mono text-xs",style:{width:`${String(E)}ch`},children:u.name}),(0,a.jsx)(X,{className:"tabular-nums text-xs",children:je(u.expiration)})]},u.name)}),T>0&&(0,a.jsx)("tr",{"aria-hidden":"true",style:{height:T}})]})]})},"Qe"),Xe={busy:"",editedMetadata:"",editedTtl:"",editedValue:"",loadError:null,loading:!0,value:null,writeError:null},et=d((l,e)=>{switch(e.type){case"deleteStart":return{...l,busy:"deleting",writeError:null};case"editMetadata":return{...l,editedMetadata:e.value};case"editTtl":return{...l,editedTtl:e.value};case"editValue":return{...l,editedValue:e.value};case"loaded":return{...l,editedMetadata:e.metadata===null||e.metadata===void 0?"":JSON.stringify(e.metadata,null,2),editedValue:e.value??"",loading:!1,value:e.value};case"loadFailed":return{...l,loadError:e.error,loading:!1};case"saveOk":return{...l,busy:"",value:l.editedValue};case"saveStart":return{...l,busy:"saving",writeError:null};case"writeFailed":return{...l,busy:"",writeError:e.error};default:return l}},"et"),tt=d(l=>{let e=(0,ee.c)(67),{expiration:n,keyName:s,namespace:i,onDeleted:y}=l,o=G(),t=W(),[r,h]=(0,_.useReducer)(et,Xe),m,x;e[0]!==o||e[1]!==s||e[2]!==i?(m=d(()=>{let C={cancelled:!1};return P((async()=>{try{let $=await o.getKvValue({key:s,namespace:i});C.cancelled||h({metadata:$.metadata,type:"loaded",value:$.value})}catch($){let j=$;C.cancelled||h({error:H(j),type:"loadFailed"})}})()),()=>{C.cancelled=!0}},"c"),x=[o,i,s],e[0]=o,e[1]=s,e[2]=i,e[3]=m,e[4]=x):(m=e[3],x=e[4]),(0,_.useEffect)(m,x);let N;e[5]===Symbol.for("react.memo_cache_sentinel")?(N=d(C=>{h({type:"editValue",value:C.target.value})},"x"),e[5]=N):N=e[5];let T=N,V;e[6]===Symbol.for("react.memo_cache_sentinel")?(V=d(C=>{h({type:"editMetadata",value:C})},"F"),e[6]=V):V=e[6];let E=V,c;e[7]!==r.editedValue?(c=Oe(r.editedValue),e[7]=r.editedValue,e[8]=c):c=e[8];let u=c,p;e[9]!==r.editedMetadata?(p=Ie(r.editedMetadata),e[9]=r.editedMetadata,e[10]=p):p=e[10];let b=p,f;e[11]!==r.editedTtl?(f=_e(r.editedTtl),e[11]=r.editedTtl,e[12]=f):f=e[12];let w=f,g;e[13]!==u?(g=d(()=>{u!==void 0&&h({type:"editValue",value:u})},"g"),e[13]=u,e[14]=g):g=e[14];let S=g,M;e[15]!==o||e[16]!==n||e[17]!==s||e[18]!==b||e[19]!==i||e[20]!==r.editedMetadata||e[21]!==r.editedTtl||e[22]!==r.editedValue||e[23]!==t?(M=d(()=>{if(!b){h({error:t("Metadata must be valid JSON."),type:"writeFailed"});return}h({type:"saveStart"}),P((async()=>{try{await o.putKvValue(Le({metadata:r.editedMetadata,ttl:r.editedTtl,value:r.editedValue},s,i,n)),h({type:"saveOk"})}catch(C){h({error:H(C),type:"writeFailed"})}})())},"V"),e[15]=o,e[16]=n,e[17]=s,e[18]=b,e[19]=i,e[20]=r.editedMetadata,e[21]=r.editedTtl,e[22]=r.editedValue,e[23]=t,e[24]=M):M=e[24];let D=M,O;e[25]!==o||e[26]!==s||e[27]!==i||e[28]!==y?(O=d(()=>{h({type:"deleteStart"}),P((async()=>{try{await o.deleteKvKey({key:s,namespace:i}),y(s)}catch(C){h({error:H(C),type:"writeFailed"})}})())},"I"),e[25]=o,e[26]=s,e[27]=i,e[28]=y,e[29]=O):O=e[29];let J=O,z;e[30]!==s?(z=d(()=>{se(s)},"D"),e[30]=s,e[31]=z):z=e[31];let I;e[32]!==t?(I=t("Copy key"),e[32]=t,e[33]=I):I=e[33];let v;e[34]!==z||e[35]!==I?(v=(0,a.jsx)("div",{className:"mb-2 flex justify-end",children:(0,a.jsx)(R,{"data-testid":"kv-copy-key-btn",onClick:z,size:"sm",variant:"outline",children:I})}),e[34]=z,e[35]=I,e[36]=v):v=e[36];let k;e[37]!==r.loadError?(k=r.loadError!==null&&(0,a.jsx)("p",{className:"mb-2 text-sm text-destructive","data-testid":"kv-value-error",role:"alert",children:r.loadError}),e[37]=r.loadError,e[38]=k):k=e[38];let K;e[39]!==r.loading||e[40]!==t?(K=r.loading&&(0,a.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"kv-value-loading",children:t("Loading\u2026")}),e[39]=r.loading,e[40]=t,e[41]=K):K=e[41];let B;e[42]!==u||e[43]!==b||e[44]!==J||e[45]!==S||e[46]!==D||e[47]!==r.busy||e[48]!==r.editedMetadata||e[49]!==r.editedValue||e[50]!==r.loading||e[51]!==r.value||e[52]!==r.writeError||e[53]!==t||e[54]!==w?(B=!r.loading&&r.value!==null&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"mb-1 flex flex-wrap items-center gap-2",children:[(0,a.jsx)(Y,{className:"text-xs",htmlFor:"kv-value-editor",children:t("Value")}),u!==void 0&&(0,a.jsx)(ge,{variant:"secondary",children:t("JSON")}),(0,a.jsx)("span",{className:"ml-auto text-xs tabular-nums text-muted-foreground","data-testid":"kv-value-size",children:fe(We(r.editedValue))})]}),(0,a.jsx)("textarea",{"aria-label":t("KV value"),className:"mb-2 min-h-[8rem] w-full rounded border border-border bg-muted/30 p-2 font-mono text-xs","data-testid":"kv-value-editor",id:"kv-value-editor",onChange:T,value:r.editedValue}),(0,a.jsxs)("div",{className:"mb-3 flex flex-wrap gap-2",children:[(0,a.jsx)(R,{"data-testid":"kv-format-btn",disabled:u===void 0,onClick:S,size:"sm",variant:"outline",children:t("Format JSON")}),(0,a.jsx)(R,{"data-testid":"kv-copy-value-btn",onClick:d(()=>{se(r.editedValue)},"onClick"),size:"sm",variant:"outline",children:t("Copy value")})]}),(0,a.jsx)(De,{helper:t("Leave blank to keep the current expiration."),id:"kv-ttl-input",invalid:!w,onChange:d(C=>{h({type:"editTtl",value:C})},"onChange"),testId:"kv-ttl-input"}),(0,a.jsx)(ze,{id:"kv-metadata-editor",invalidTestId:"kv-metadata-invalid",onChange:E,testId:"kv-metadata-editor",valid:b,value:r.editedMetadata}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,a.jsx)(R,{"data-testid":"kv-save-btn",disabled:r.busy!==""||!b||!w,onClick:D,children:r.busy==="saving"?t("Saving\u2026"):t("Save")}),(0,a.jsx)(R,{"data-testid":"kv-delete-btn",disabled:r.busy!=="",onClick:J,variant:"destructive",children:r.busy==="deleting"?t("Deleting\u2026"):t("Delete")})]}),r.writeError!==null&&(0,a.jsx)("p",{className:"mt-2 text-sm text-destructive","data-testid":"kv-save-error",role:"alert",children:r.writeError})]}),e[42]=u,e[43]=b,e[44]=J,e[45]=S,e[46]=D,e[47]=r.busy,e[48]=r.editedMetadata,e[49]=r.editedValue,e[50]=r.loading,e[51]=r.value,e[52]=r.writeError,e[53]=t,e[54]=w,e[55]=B):B=e[55];let F;e[56]!==r.loadError||e[57]!==r.loading||e[58]!==r.value||e[59]!==t?(F=!r.loading&&r.value===null&&r.loadError===null&&(0,a.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"kv-absent",children:t("Key is absent or has no value.")}),e[56]=r.loadError,e[57]=r.loading,e[58]=r.value,e[59]=t,e[60]=F):F=e[60];let L;return e[61]!==v||e[62]!==k||e[63]!==K||e[64]!==B||e[65]!==F?(L=(0,a.jsxs)("div",{className:"px-4 pb-4","data-testid":"kv-value-section",children:[v,k,K,B,F]}),e[61]=v,e[62]=k,e[63]=K,e[64]=B,e[65]=F,e[66]=L):L=e[66],L},"tt"),Me=100,at={appliedPrefix:"",bulk:[],bulkBusy:!1,bulkError:null,cursor:null,keys:null,listComplete:!1,loadError:null,loading:!1,prefixInput:"",reloadNonce:0,selectedKey:null},lt=d((l,e)=>{switch(e.type){case"appendPage":return e.generation!==l.reloadNonce?l:{...l,cursor:e.cursor,keys:[...l.keys??[],...e.keys],listComplete:e.listComplete,loading:!1};case"applyFilter":return{...l,appliedPrefix:l.prefixInput,bulk:[],bulkError:null,cursor:null,keys:null,listComplete:!1,reloadNonce:l.reloadNonce+1,selectedKey:null};case"bulkDeleted":{let n=new Set(e.deleted);return{...l,bulk:l.bulk.filter(s=>!n.has(s)),bulkBusy:!1,bulkError:e.error,keys:l.keys===null?null:l.keys.filter(s=>!n.has(s.name)),selectedKey:l.selectedKey!==null&&n.has(l.selectedKey)?null:l.selectedKey}}case"bulkDeleteStart":return{...l,bulkBusy:!0,bulkError:null};case"firstPage":return{...l,cursor:e.cursor,keys:e.keys,listComplete:e.listComplete,loading:!1};case"keyDeleted":return{...l,bulk:l.bulk.filter(n=>n!==e.name),keys:l.keys===null?null:l.keys.filter(n=>n.name!==e.name),selectedKey:null};case"loadFailed":return e.generation!==void 0&&e.generation!==l.reloadNonce?l:{...l,loadError:e.error,loading:!1};case"loadStart":return{...l,loadError:null,loading:!0};case"prefixInput":return{...l,prefixInput:e.value};case"reload":return{...l,bulk:[],bulkError:null,reloadNonce:l.reloadNonce+1,selectedKey:null};case"selectKey":return{...l,selectedKey:e.name};case"toggleAllBulk":return{...l,bulk:e.names};case"toggleBulk":return{...l,bulk:l.bulk.includes(e.name)?l.bulk.filter(n=>n!==e.name):[...l.bulk,e.name]};default:return l}},"rt"),rt=d(({namespace:l})=>{let e=G(),n=W(),[s,i]=(0,_.useReducer)(lt,at),{appliedPrefix:y,bulk:o,bulkBusy:t,bulkError:r,cursor:h,keys:m,listComplete:x,loadError:N,loading:T,prefixInput:V,reloadNonce:E,selectedKey:c}=s,[u,p]=(0,_.useState)(!1);(0,_.useEffect)(()=>{let v={cancelled:!1};return P((async()=>{i({type:"loadStart"});try{let k=await e.listKvKeys({limit:Me,namespace:l,prefix:y===""?void 0:y});v.cancelled||i({cursor:k.cursor??null,keys:k.keys,listComplete:k.listComplete,type:"firstPage"})}catch(k){v.cancelled||i({error:H(k),type:"loadFailed"})}})()),()=>{v.cancelled=!0}},[e,l,y,E]);let b=d(v=>{i({type:"prefixInput",value:v.target.value})},"y"),f=d(()=>{i({type:"applyFilter"})},"b"),w=d(v=>{i({name:v.currentTarget.dataset.key??null,type:"selectKey"})},"N"),g=d(()=>{if(h===null)return;i({type:"loadStart"});let v=E;P((async()=>{try{let k=await e.listKvKeys({cursor:h,limit:Me,namespace:l,prefix:y===""?void 0:y});i({cursor:k.cursor??null,generation:v,keys:k.keys,listComplete:k.listComplete,type:"appendPage"})}catch(k){i({error:H(k),generation:v,type:"loadFailed"})}})())},"g"),S=d(v=>{i({name:v,type:"keyDeleted"})},"S"),M=d(v=>{i({name:v,type:"toggleBulk"})},"V"),D=d(v=>{i({names:v&&m!==null?m.map(k=>k.name):[],type:"toggleAllBulk"})},"B"),O=d(()=>{if(o.length===0)return;let v=[...o];i({type:"bulkDeleteStart"}),P((async()=>{let k=await Promise.allSettled(v.map(F=>e.deleteKvKey({key:F,namespace:l}))),K=v.filter((F,L)=>k[L]?.status==="fulfilled"),B=v.length-K.length;i({deleted:K,error:B>0?n("Failed to delete {count} keys.",{count:B}):null,type:"bulkDeleted"})})())},"I"),J=d(()=>{p(!1),i({type:"reload"})},"A"),z=m!==null&&m.length>0&&o.length===m.length,I=new Set(o);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("section",{className:"border border-border bg-card p-3","data-testid":"kv-keys-section",children:[(0,a.jsxs)("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[(0,a.jsx)(ae,{"aria-label":n("Filter keys by prefix"),className:"min-w-[16rem] flex-1","data-testid":"kv-prefix-input",onChange:b,placeholder:n("Filter by prefix\u2026"),value:V}),(0,a.jsx)(R,{"data-testid":"kv-filter-btn",disabled:T,onClick:f,children:n("Filter")}),(0,a.jsx)(R,{"data-testid":"kv-new-key-btn",onClick:d(()=>{p(v=>!v)},"onClick"),variant:"outline",children:n("New key")}),o.length>0&&(0,a.jsx)(R,{"data-testid":"kv-bulk-delete-btn",disabled:t,onClick:O,variant:"destructive",children:t?n("Deleting\u2026"):n("Delete {count}",{count:o.length})})]}),r!==null&&(0,a.jsx)("p",{className:"mb-2 text-sm text-destructive","data-testid":"kv-bulk-error",role:"alert",children:r}),N!==null&&(0,a.jsx)("p",{className:"text-sm text-destructive","data-testid":"kv-keys-error",role:"alert",children:N}),m!==null&&m.length===0&&!T&&(0,a.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"kv-no-keys",children:n("No keys.")}),m!==null&&m.length>0&&(0,a.jsx)(ne,{className:"overflow-hidden py-0",children:(0,a.jsx)(de,{className:"px-0",children:(0,a.jsx)(Ue,{allSelected:z,bulkSelected:I,keys:m,onSelectKey:w,onToggleAll:D,onToggleBulk:M,selectedKey:c})})}),!x&&h!==null&&(0,a.jsx)("div",{className:"mt-2",children:(0,a.jsx)(R,{"data-testid":"kv-load-more",disabled:T,onClick:g,variant:"outline",children:n(T?"Loading\u2026":"Load more")})})]}),(0,a.jsx)(ve,{onOpenChange:d(v=>{v||p(!1)},"onOpenChange"),open:u,children:(0,a.jsxs)(pe,{className:"w-full gap-0 overflow-y-auto sm:max-w-md","data-testid":"kv-create-sheet",side:"right",children:[(0,a.jsx)(ye,{children:(0,a.jsx)(he,{children:n("New key")})}),(0,a.jsx)(Ze,{namespace:l,onCancel:d(()=>{p(!1)},"onCancel"),onCreated:J})]})}),(0,a.jsx)(ve,{onOpenChange:d(v=>{v||i({name:null,type:"selectKey"})},"onOpenChange"),open:c!==null,children:(0,a.jsxs)(pe,{className:"w-full gap-0 overflow-y-auto sm:max-w-md","data-testid":"kv-editor-sheet",side:"right",children:[(0,a.jsx)(ye,{children:(0,a.jsx)(he,{className:"truncate font-mono text-xs",children:c})}),c!==null&&(0,a.jsx)(tt,{expiration:m?.find(v=>v.name===c)?.expiration,keyName:c,namespace:l,onDeleted:S},`${l}:${c}`)]})})]})},"at"),xt=d(({loadNamespaces:l}={})=>{let e=G(),n=W(),[s,i]=(0,_.useState)(null),[y,o]=(0,_.useState)(null),[t,r]=(0,_.useState)(null);(0,_.useEffect)(()=>{let m={cancelled:!1};return P((async()=>{try{let x=await(l??(()=>e.listKvNamespaces()))();m.cancelled||(i(x),o(null),r(N=>N??x[0]?.binding??null))}catch(x){m.cancelled||(i(null),o(H(x)))}})()),()=>{m.cancelled=!0}},[e,l]);let h=d(m=>{r(m.currentTarget.dataset.ns??null)},"p");return(0,a.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-kv-browser",children:[y!==null&&(0,a.jsx)("p",{className:"text-sm text-destructive","data-testid":"kv-ns-error",role:"alert",children:y}),s!==null&&s.length===0&&(0,a.jsx)(be,{description:n("Add a kv_namespaces binding to wrangler.jsonc \u2014 it appears here automatically, no wiring needed."),icon:(0,a.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,a.jsx)("path",{d:"M5 5h14v4H5V5Zm0 5h14v4H5v-4Zm0 5h14v4H5v-4Z"})}),testId:"kv-empty",title:n("No KV namespaces.")}),s!==null&&s.length>0&&(0,a.jsx)(ne,{className:"overflow-hidden py-0",children:(0,a.jsx)(de,{className:"px-0",children:(0,a.jsxs)(ie,{"data-testid":"kv-namespace-table",children:[(0,a.jsx)(oe,{children:(0,a.jsx)(Q,{children:(0,a.jsx)(U,{children:n("Namespace")})})}),(0,a.jsx)(ce,{children:s.map(m=>(0,a.jsx)(Q,{className:m.binding===t?"border-l-2 border-l-royal-amethyst bg-muted/50":"cursor-pointer","data-ns":m.binding,"data-testid":`kv-ns-row-${m.binding}`,onClick:h,children:(0,a.jsx)(X,{className:"font-mono text-xs",children:m.binding})},m.binding))})]})})}),t!==null&&(0,a.jsx)(rt,{namespace:t},t)]})},"Et");export{xt as KvBrowser};
@@ -1 +0,0 @@
1
- import{a as H}from"./chunk-473JK2PQ.js";import{b as x}from"./chunk-PQH2LSJX.js";import"./chunk-4C4THJUD.js";import{b as z}from"./chunk-4DAKKAK7.js";import{m as W}from"./chunk-BVX45MU5.js";import"./chunk-H7HZ42JY.js";import{a as _}from"./chunk-XMSNLMWU.js";import{a as B,b as E,c as L,d as S,e as i,f as s}from"./chunk-HHRYM6UW.js";import{a as A,e as q}from"./chunk-JSDKOE4U.js";import{l as O}from"./chunk-BFE2DRP6.js";import{a as R,d as M,f as $,g as D}from"./chunk-OXFKZ4BM.js";var I=M($(),1);var n=M(D(),1);var F=2e3,G=new Set(["open"]),ie=R(Q=>{let e=(0,I.c)(41),{read:y}=Q,t=O(),j=W(),v;e[0]!==j||e[1]!==y?(v=R(()=>Promise.resolve(y?y():j.debug()),"T"),e[0]=j,e[1]=y,e[2]=v):v=e[2];let V=v,K=y?"injected":"live",b;e[3]!==K?(b=["lunora-studio","sync-client-debug",K],e[3]=K,e[4]=b):b=e[4];let{data:c,poll:Y}=z(b,V);if(H(Y,!0,F),!c){let r;e[5]!==t?(r=t("Reading the sync client's state\u2026"),e[5]=t,e[6]=r):r=e[6];let g;e[7]!==t?(g=t("Sync client"),e[7]=t,e[8]=g):g=e[8];let T;return e[9]!==r||e[10]!==g?(T=(0,n.jsx)(A,{children:(0,n.jsx)(q,{children:(0,n.jsx)(_,{description:r,title:g})})}),e[9]=r,e[10]=g,e[11]=T):T=e[11],T}let{pendingWrites:k,shards:N,subscriptions:w}=c,l;e[12]!==t?(l=t("This Studio session's sync client"),e[12]=t,e[13]=l):l=e[13];let a;e[14]!==l?(a=(0,n.jsx)("span",{className:"text-sm font-medium",children:l}),e[14]=l,e[15]=a):a=e[15];let P=c.connectionStatus==="connected"?"default":"secondary",o;e[16]!==c.connectionStatus||e[17]!==P?(o=(0,n.jsx)(x,{variant:P,children:c.connectionStatus}),e[16]=c.connectionStatus,e[17]=P,e[18]=o):o=e[18];let d;e[19]!==k||e[20]!==t?(d=k>0?(0,n.jsx)(x,{variant:"secondary",children:t("{count} pending writes",{count:k})}):null,e[19]=k,e[20]=t,e[21]=d):d=e[21];let h;e[22]!==a||e[23]!==o||e[24]!==d?(h=(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[a,o,d]}),e[22]=a,e[23]=o,e[24]=d,e[25]=h):h=e[25];let u;e[26]!==t?(u=t("Reads client.debug() for the client running in this page \u2014 not your application's client. Call client.debug() in your app to diagnose a specific stuck overlay there."),e[26]=t,e[27]=u):u=e[27];let m;e[28]!==u?(m=(0,n.jsx)("p",{className:"text-muted-foreground text-xs",children:u}),e[28]=u,e[29]=m):m=e[29];let p;e[30]!==N||e[31]!==t?(p=N.length===0?(0,n.jsx)(_,{description:t("No shard connection has been opened yet."),title:t("No shards")}):(0,n.jsxs)(B,{children:[(0,n.jsx)(E,{children:(0,n.jsxs)(S,{children:[(0,n.jsx)(i,{children:t("Shard")}),(0,n.jsx)(i,{children:t("Socket")}),(0,n.jsx)(i,{children:t("Confirmed watermark")})]})}),(0,n.jsx)(L,{children:N.map(r=>(0,n.jsxs)(S,{children:[(0,n.jsx)(s,{children:r.shardKey??t("(default)")}),(0,n.jsx)(s,{children:(0,n.jsx)(x,{variant:G.has(r.wsState)?"default":"secondary",children:r.wsState})}),(0,n.jsx)(s,{children:r.confirmedMutationWatermark})]},r.shardKey??"__default__"))})]}),e[30]=N,e[31]=t,e[32]=p):p=e[32];let f;e[33]!==w||e[34]!==t?(f=w.length===0?(0,n.jsx)(_,{description:t("This client holds no live queries or shapes."),title:t("No subscriptions")}):(0,n.jsxs)(B,{children:[(0,n.jsx)(E,{children:(0,n.jsxs)(S,{children:[(0,n.jsx)(i,{children:t("Subscription")}),(0,n.jsx)(i,{children:t("Kind")}),(0,n.jsx)(i,{children:t("Acked")}),(0,n.jsx)(i,{children:t("Cursor")}),(0,n.jsx)(i,{children:t("Pending overlays")})]})}),(0,n.jsx)(L,{children:w.map(r=>(0,n.jsxs)(S,{children:[(0,n.jsx)(s,{className:"font-mono text-xs",children:r.functionPath}),(0,n.jsx)(s,{children:r.kind}),(0,n.jsx)(s,{children:(0,n.jsx)(x,{variant:r.acked?"default":"secondary",children:r.acked?t("yes"):t("no")})}),(0,n.jsx)(s,{children:r.serverCursor??"\u2014"}),(0,n.jsx)(s,{children:r.pendingOptimisticLayers})]},r.id))})]}),e[33]=w,e[34]=t,e[35]=f):f=e[35];let C;return e[36]!==m||e[37]!==p||e[38]!==f||e[39]!==h?(C=(0,n.jsx)(A,{children:(0,n.jsxs)(q,{className:"flex flex-col gap-4",children:[h,m,p,f]})}),e[36]=m,e[37]=p,e[38]=f,e[39]=h,e[40]=C):C=e[40],C},"ie");export{ie as default};
@@ -1 +0,0 @@
1
- import{a as f,b as s,e as O}from"./chunk-OXFKZ4BM.js";var _=s(i=>{"use strict";var E=O();function o(r){var e="https://react.dev/errors/"+r;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var t=2;t<arguments.length;t++)e+="&args[]="+encodeURIComponent(arguments[t])}return"Minified React error #"+r+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}f(o,"formatProdErrorMessage");function a(){}f(a,"noop");var n={d:{f:a,r:f(function(){throw Error(o(522))},"r"),D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},S=Symbol.for("react.portal"),T=Symbol.for("react.recoverable"),l=Symbol.for("react.optimistic_key");function P(r,e,t){var c=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:S,key:c==null?null:c===l?l:""+c,children:r,containerInfo:e,implementation:t}}f(P,"createPortal$1");var y=E.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(r,e){if(r==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}f(u,"getCrossOriginStringAs");i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n;i.browser=function(r){return{$$typeof:T,_reason:r}};i.createPortal=function(r,e){var t=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(o(299));return P(r,e,null,t)};i.flushSync=function(r){var e=y.T,t=n.p;try{if(y.T=null,n.p=2,r)return r()}finally{y.T=e,n.p=t,n.d.f()}};i.preconnect=function(r,e){typeof r=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,n.d.C(r,e))};i.prefetchDNS=function(r){typeof r=="string"&&n.d.D(r)};i.preinit=function(r,e){if(typeof r=="string"&&e&&typeof e.as=="string"){var t=e.as,c=u(t,e.crossOrigin),g=typeof e.integrity=="string"?e.integrity:void 0,d=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;t==="style"?n.d.S(r,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:c,integrity:g,fetchPriority:d}):t==="script"&&n.d.X(r,{crossOrigin:c,integrity:g,fetchPriority:d,nonce:typeof e.nonce=="string"?e.nonce:void 0})}};i.preinitModule=function(r,e){if(typeof r=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var t=u(e.as,e.crossOrigin);n.d.M(r,{crossOrigin:t,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0})}}else e==null&&n.d.M(r)};i.preload=function(r,e){if(typeof r=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var t=e.as,c=u(t,e.crossOrigin);n.d.L(r,t,{crossOrigin:c,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,type:typeof e.type=="string"?e.type:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy=="string"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet=="string"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes=="string"?e.imageSizes:void 0,media:typeof e.media=="string"?e.media:void 0})}};i.preloadModule=function(r,e){if(typeof r=="string")if(e){var t=u(e.as,e.crossOrigin);n.d.m(r,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:t,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0})}else n.d.m(r)};i.requestFormReset=function(r){n.d.r(r)};i.unstable_batchedUpdates=function(r,e){return r(e)};i.useFormState=function(r,e,t){return y.H.useFormState(r,e,t)};i.useFormStatus=function(){return y.H.useHostTransitionStatus()};i.version="19.3.0"});var R=s((C,m)=>{"use strict";function v(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(v)}catch(r){console.error(r)}}f(v,"checkDCE");v(),m.exports=_()});export{R as a};
@@ -1 +0,0 @@
1
- import{a as N}from"./chunk-XMSNLMWU.js";import{a as q,b as M,c as A,d as w,e as C,f as E}from"./chunk-HHRYM6UW.js";import{a as v}from"./chunk-JSDKOE4U.js";import{l as g,p as j,x as L,y as S}from"./chunk-BFE2DRP6.js";import{a as u,d as x,e as H,f as I,g as R}from"./chunk-OXFKZ4BM.js";var Q=x(I(),1),d=x(H(),1);var a=x(R(),1);var T={volume:"Request volume per function",latency:"Latency p50 / p95 per function",hotShards:"Hot shards"},O=Object.keys(T),P={error:null,loading:!0,rows:null},$=u(s=>Object.keys(s[0]??{}),"B"),U=u(s=>{let e=(0,Q.c)(22),{state:y,title:o}=s,l=g(),{error:t,loading:r,rows:n}=y,c;if(e[0]!==t||e[1]!==r||e[2]!==n||e[3]!==l||e[4]!==o){let b=n===null?[]:$(n),i;e[6]!==l||e[7]!==o?(i=l(o),e[6]=l,e[7]=o,e[8]=i):i=e[8];let p;e[9]!==i?(p=(0,a.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,a.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:i})}),e[9]=i,e[10]=p):p=e[10];let m;e[11]!==r||e[12]!==l?(m=r&&(0,a.jsx)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"analytics-loading",children:l("Loading\u2026")}),e[11]=r,e[12]=l,e[13]=m):m=e[13];let h;e[14]!==t||e[15]!==r?(h=!r&&t!==null&&(0,a.jsx)("p",{className:"px-4 py-8 text-center text-sm text-destructive","data-testid":"analytics-error",role:"alert",children:t}),e[14]=t,e[15]=r,e[16]=h):h=e[16];let f;e[17]!==t||e[18]!==r||e[19]!==n||e[20]!==l?(f=!r&&t===null&&n!==null&&n.length===0&&(0,a.jsx)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"analytics-empty-rows",children:l("No data points yet.")}),e[17]=t,e[18]=r,e[19]=n,e[20]=l,e[21]=f):f=e[21],c=(0,a.jsxs)(v,{className:"gap-0 py-0","data-testid":`analytics-panel-${o}`,children:[p,m,h,f,!r&&t===null&&n!==null&&n.length>0&&(0,a.jsxs)(q,{children:[(0,a.jsx)(M,{children:(0,a.jsx)(w,{children:b.map(W)})}),(0,a.jsx)(A,{children:n.map((V,B)=>(0,a.jsx)(w,{children:b.map(k=>(0,a.jsx)(E,{className:"font-mono text-xs",children:L(V[k])},k))},B))})]})]}),e[0]=t,e[1]=r,e[2]=n,e[3]=l,e[4]=o,e[5]=c}else c=e[5];return c},"V"),G=u(({runQuery:s}={})=>{let e=g(),[y,o]=(0,d.useState)({}),l=(0,d.useCallback)(async t=>{if(s!==void 0)for(let r of O){if(t.cancelled)return;o(n=>({...n,[r]:P}));try{let{rows:n}=await s(r);t.cancelled||o(c=>({...c,[r]:{error:null,loading:!1,rows:n}}))}catch(n){t.cancelled||o(c=>({...c,[r]:{error:j(n),loading:!1,rows:null}}))}}},[s]);return(0,d.useEffect)(()=>{let t={cancelled:!1};return S(l(t)),()=>{t.cancelled=!0}},[l]),s===void 0?(0,a.jsx)(N,{description:e("Analytics usage panels read through your worker, never from the browser. Pass studio.analyticsSqlQuery, a runner that calls an admin-only action running functionUsageQuery(panel) through ctx.analyticsSql, to enable these panels."),icon:(0,a.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,a.jsx)("path",{d:"M5 20V10m6.5 10V4M18 20v-7M3 20h18"})}),testId:"analytics-not-configured",title:e("Analytics usage panels are not wired up.")}):(0,a.jsx)("div",{className:"flex flex-col gap-4","data-testid":"lunora-analytics-panel",children:O.map(t=>(0,a.jsx)(U,{state:y[t]??P,title:T[t]},t))})},"X");function W(s){return(0,a.jsx)(C,{children:s},s)}u(W,"$");export{G as AnalyticsPanel};
@@ -1 +0,0 @@
1
- import{a as x}from"./chunk-R36QXQZX.js";import{b as h}from"./chunk-PQH2LSJX.js";import{C as v}from"./chunk-BFE2DRP6.js";import{a as g,d as p,f as k,g as y}from"./chunk-OXFKZ4BM.js";var N=p(k(),1);var l=p(y(),1);var b={debug:"secondary",error:"destructive",fatal:"destructive",info:"outline",log:"outline",trace:"outline",warn:"secondary"},F=g(w=>{let e=(0,N.c)(21),{entry:t}=w,c;e[0]!==t.fields?(c=x(t.fields),e[0]=t.fields,e[1]=c):c=e[1];let m=c,s;e[2]!==t.timestamp?(s=v(t.timestamp),e[2]=t.timestamp,e[3]=s):s=e[3];let r;e[4]!==s?(r=(0,l.jsx)("span",{className:"w-44 shrink-0 tabular-nums text-muted-foreground",role:"gridcell",children:s}),e[4]=s,e[5]=r):r=e[5];let u=b[t.level],a;e[6]!==t.level||e[7]!==u?(a=(0,l.jsx)("span",{className:"w-20 shrink-0",role:"gridcell",children:(0,l.jsx)(h,{variant:u,children:t.level})}),e[6]=t.level,e[7]=u,e[8]=a):a=e[8];let f=t.functionPath??"\u2014",n;e[9]!==f?(n=(0,l.jsx)("span",{className:"w-48 shrink-0 truncate text-muted-foreground",role:"gridcell",children:f}),e[9]=f,e[10]=n):n=e[10];let i;e[11]!==m?(i=m===""?null:(0,l.jsx)("span",{className:"ml-2 text-muted-foreground","data-testid":"lg-fields",children:m}),e[11]=m,e[12]=i):i=e[12];let o;e[13]!==t.message||e[14]!==i?(o=(0,l.jsxs)("span",{className:"flex-1 truncate",role:"gridcell",children:[t.message,i]}),e[13]=t.message,e[14]=i,e[15]=o):o=e[15];let d;return e[16]!==r||e[17]!==a||e[18]!==n||e[19]!==o?(d=(0,l.jsxs)(l.Fragment,{children:[r,a,n,o]}),e[16]=r,e[17]=a,e[18]=n,e[19]=o,e[20]=d):d=e[20],d},"B");export{b as a,F as b};
@@ -1 +0,0 @@
1
- import{b as c}from"./chunk-4DAKKAK7.js";import{m as l}from"./chunk-BVX45MU5.js";import{a as r,d as f,f as g}from"./chunk-OXFKZ4BM.js";var m=f(g(),1);var p={capabilities:{accounts:!0,admin:!0,inviteOnly:!1,organization:!1,passkey:!1,twoFactor:!1},emailAndPassword:!1,organization:{enabled:!1,roles:!1,teams:!1},plugins:[],rateLimit:{enabled:!1},session:{},socialProviders:[],userFields:[]},h=r(()=>{let o=(0,m.c)(6),t=l(),a;o[0]===Symbol.for("react.memo_cache_sentinel")?(a=["lunora-auth-config"],o[0]=a):a=o[0];let e;o[1]!==t?(e=r(()=>t.getAuthConfig(),"t"),o[1]=t,o[2]=e):e=o[2];let{data:d,isLoading:u}=c(a,e),n=d??p,s=!u,i;return o[3]!==n||o[4]!==s?(i={config:n,ready:s},o[3]=n,o[4]=s,o[5]=i):i=o[5],i},"y");export{h as a};
@@ -1 +0,0 @@
1
- import{b as y}from"./chunk-PQH2LSJX.js";import"./chunk-4C4THJUD.js";import{a as R}from"./chunk-CZ6HBDIL.js";import"./chunk-T5UMHPAB.js";import"./chunk-NVKLYDOH.js";import"./chunk-E26OT26O.js";import{a as v}from"./chunk-6UTZXEW3.js";import{c as $}from"./chunk-4DAKKAK7.js";import"./chunk-BVX45MU5.js";import"./chunk-H7HZ42JY.js";import{a as S}from"./chunk-XMSNLMWU.js";import{a as A,b as C,c as I,d as x,e as c,f as n}from"./chunk-HHRYM6UW.js";import{a as k,e as w}from"./chunk-JSDKOE4U.js";import{l as N}from"./chunk-BFE2DRP6.js";import{a as f,d as b,f as E,g as O}from"./chunk-OXFKZ4BM.js";var j=b(E(),1);var r=b(O(),1);var _=f((e,t)=>({delete:e("Delete"),list:e("List"),read:e("Read"),write:e("Write")})[t],"I"),T={delete:2,list:3,read:0,write:1},B=f(e=>[...e].toSorted((t,a)=>t.bucket.localeCompare(a.bucket)||T[t.on]-T[a.on]||(t.prefix??"").localeCompare(a.prefix??"")),"O"),q=f(()=>{let e=(0,j.c)(14),t=N(),a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={},e[0]=a):a=e[0];let{data:l,error:i,errorSource:d}=$(v.storageRules,a),h=l!==void 0,m;if(e[1]!==l||e[2]!==i||e[3]!==d||e[4]!==h||e[5]!==t){let g=B(Array.isArray(l?.rules)?l.rules:[]),u;e[7]!==i||e[8]!==d?(u=i!==null&&(0,r.jsx)(R,{error:d,testId:"storage-rules-error"}),e[7]=i,e[8]=d,e[9]=u):u=e[9];let o;e[10]!==t?(o=t("Storage rules are declared in code with defineStorageRule and gate ctx.storage access per bucket. This view is read-only."),e[10]=t,e[11]=o):o=e[11];let p;e[12]!==o?(p=(0,r.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"storage-rules-note",children:o}),e[12]=o,e[13]=p):p=e[13],m=(0,r.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-storage-rules-panel",children:[u,p,h&&g.length===0?(0,r.jsx)(S,{description:t("No defineStorageRule is wired through .use(storageRules(...)) in this deployment. Add one to gate object access by key prefix."),testId:"storage-rules-empty",title:t("No storage rules defined")}):(0,r.jsx)(k,{className:"overflow-hidden py-0",children:(0,r.jsx)(w,{className:"px-0",children:(0,r.jsxs)(A,{"data-testid":"storage-rules-table",children:[(0,r.jsx)(C,{children:(0,r.jsxs)(x,{children:[(0,r.jsx)(c,{children:t("Bucket")}),(0,r.jsx)(c,{children:t("Operation")}),(0,r.jsx)(c,{children:t("Key prefix")}),(0,r.jsx)(c,{children:t("Guarded by")})]})}),(0,r.jsx)(I,{children:g.map(s=>(0,r.jsxs)(x,{"data-testid":`storage-rule-${s.bucket}-${s.on}-${s.prefix??""}`,children:[(0,r.jsx)(n,{className:"font-mono text-xs",children:s.bucket}),(0,r.jsx)(n,{children:(0,r.jsx)(y,{variant:"secondary",children:_(t,s.on)})}),(0,r.jsx)(n,{className:"font-mono text-xs",children:s.prefix??(0,r.jsx)("span",{className:"text-muted-foreground",children:t("(whole bucket)")})}),(0,r.jsx)(n,{className:"font-mono text-xs text-muted-foreground",children:s.procedure})]},`${s.bucket}:${s.on}:${s.prefix??""}:${s.procedure}`))})]})})})]}),e[1]=l,e[2]=i,e[3]=d,e[4]=h,e[5]=t,e[6]=m}else m=e[6];return m},"M");export{q as default};
@@ -1 +0,0 @@
1
- import{h as c}from"./chunk-BFE2DRP6.js";import{a as o,d as n,f as m,g as u}from"./chunk-OXFKZ4BM.js";var l=n(m(),1);var i=n(u(),1);function f({className:d,size:a="default",...t}){return(0,i.jsx)("div",{"data-slot":"card","data-size":a,className:c("group/card flex flex-col gap-4 overflow-hidden rounded-xl border border-border bg-card py-4 text-xs/relaxed text-card-foreground shadow-xs has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-2 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-md *:[img:last-child]:rounded-md",d),...t})}o(f,"p");function x(d){let a=(0,l.c)(8),t,e;a[0]!==d?({className:t,...e}=d,a[0]=d,a[1]=t,a[2]=e):(t=a[1],e=a[2]);let r;a[3]!==t?(r=c("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-md px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3",t),a[3]=t,a[4]=r):r=a[4];let s;return a[5]!==e||a[6]!==r?(s=(0,i.jsx)("div",{"data-slot":"card-header",className:r,...e}),a[5]=e,a[6]=r,a[7]=s):s=a[7],s}o(x,"f");function g(d){let a=(0,l.c)(8),t,e;a[0]!==d?({className:t,...e}=d,a[0]=d,a[1]=t,a[2]=e):(t=a[1],e=a[2]);let r;a[3]!==t?(r=c("font-heading text-sm font-medium group-data-[size=sm]/card:text-sm",t),a[3]=t,a[4]=r):r=a[4];let s;return a[5]!==e||a[6]!==r?(s=(0,i.jsx)("div",{"data-slot":"card-title",className:r,...e}),a[5]=e,a[6]=r,a[7]=s):s=a[7],s}o(g,"u");function h(d){let a=(0,l.c)(8),t,e;a[0]!==d?({className:t,...e}=d,a[0]=d,a[1]=t,a[2]=e):(t=a[1],e=a[2]);let r;a[3]!==t?(r=c("text-xs/relaxed text-muted-foreground",t),a[3]=t,a[4]=r):r=a[4];let s;return a[5]!==e||a[6]!==r?(s=(0,i.jsx)("div",{"data-slot":"card-description",className:r,...e}),a[5]=e,a[6]=r,a[7]=s):s=a[7],s}o(h,"x");function b(d){let a=(0,l.c)(8),t,e;a[0]!==d?({className:t,...e}=d,a[0]=d,a[1]=t,a[2]=e):(t=a[1],e=a[2]);let r;a[3]!==t?(r=c("px-4 group-data-[size=sm]/card:px-3",t),a[3]=t,a[4]=r):r=a[4];let s;return a[5]!==e||a[6]!==r?(s=(0,i.jsx)("div",{"data-slot":"card-content",className:r,...e}),a[5]=e,a[6]=r,a[7]=s):s=a[7],s}o(b,"g");export{f as a,x as b,g as c,h as d,b as e};
@@ -1 +0,0 @@
1
- import{a as M,c as O,e as S,i as E}from"./chunk-ZBON5T5A.js";import{a as I,b as B,c as U}from"./chunk-4C4THJUD.js";import{a as s,d as k,e as w}from"./chunk-OXFKZ4BM.js";var f=k(w(),1);var g=k(w(),1);var z=g.createContext(void 0);function W(o=!1){let t=g.useContext(z);if(t===void 0&&!o)throw new Error(U(16));return t}s(W,"useCompositeRootContext");var H=k(w(),1);function A(o){let{focusableWhenDisabled:t,disabled:r,composite:l=!1,tabIndex:n=0,isNativeButton:u}=o,d=l&&t!==!1,b=l&&t===!1;return{props:H.useMemo(()=>{let a={onKeyDown(p){r&&t&&p.key!=="Tab"&&p.preventDefault()}};return l||(a.tabIndex=n,!u&&r&&(a.tabIndex=t?n:-1)),(u&&(t||d)||!u&&r)&&(a["aria-disabled"]=r),u&&(!t||b)&&(a.disabled=r),a},[l,r,t,d,b,u,n])}}s(A,"useFocusableWhenDisabled");function h(o,t,{detail:r=0}={}){o.dispatchEvent(new(S(o)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:r,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}s(h,"dispatchClickWithModifiers");function le(o={}){let{disabled:t=!1,focusableWhenDisabled:r,tabIndex:l=0,native:n=!0,composite:u}=o,d=f.useRef(null),b=W(!0),i=u??b!==void 0,{props:a}=A({focusableWhenDisabled:r,disabled:t,composite:i,tabIndex:l,isNativeButton:n}),p=f.useCallback(()=>{let c=d.current;K(c)&&i&&t&&a.disabled===void 0&&c.disabled&&(c.disabled=!1)},[t,a.disabled,i]);M(p,[p]);let F=f.useCallback((c={})=>{let{onClick:x,onMouseDown:C,onKeyUp:V,onKeyDown:_,onPointerDown:$,...v}=c;return I({onClick(e){if(t){e.preventDefault();return}x?.(e)},onMouseDown(e){t||C?.(e)},onKeyDown(e){if(t||(B(e),_?.(e),e.baseUIHandlerPrevented))return;let R=e.target===e.currentTarget,m=e.currentTarget,P=K(m),N=!n&&G(m),j=R&&(n?P:!N),T=e.key==="Enter",y=e.key===" ",D=m.getAttribute("role"),q=D?.startsWith("menuitem")||D==="option"||D==="gridcell";if(R&&i&&y){if(e.defaultPrevented&&q)return;e.preventDefault(),(!n||P)&&(e.preventBaseUIHandler(),h(m,e));return}if(!j||n||!y&&!T){R&&N&&y&&e.preventDefault();return}e.defaultPrevented||(e.preventDefault(),T&&(e.preventBaseUIHandler(),h(m,e)))},onKeyUp(e){if(!t){if(B(e),V?.(e),e.target===e.currentTarget&&n&&i&&K(e.currentTarget)&&e.key===" "){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!n&&!i&&!e.defaultPrevented&&e.key===" "&&(e.preventBaseUIHandler(),h(e.currentTarget,e))}},onPointerDown(e){if(t){e.preventDefault();return}$?.(e)}},n?{type:"button"}:{role:"button"},a,v)},[t,a,i,n]),L=O(c=>{d.current=c,p()});return{getButtonProps:F,buttonRef:L}}s(le,"useButton");function K(o){return E(o)&&o.tagName==="BUTTON"}s(K,"isButtonElement");function G(o){return E(o)&&o.tagName==="A"&&!!o.href}s(G,"isValidLinkElement");export{W as a,h as b,le as c};
@@ -1 +0,0 @@
1
- import{a as g}from"./chunk-6UTZXEW3.js";import{c as k}from"./chunk-4DAKKAK7.js";import{m as C}from"./chunk-BVX45MU5.js";import{l as S,n as y,o as v,x as _}from"./chunk-BFE2DRP6.js";import{a as i,d as N,e as T,f as F,g as L}from"./chunk-OXFKZ4BM.js";var w=N(T(),1);var j={},A=y(g.aiGenerateSql),I=y(g.aiTableFilter),O=y(g.aiChartConfig),Q=i(s=>{let e=C(),[l,d]=(0,w.useState)({}),[n,t]=(0,w.useState)({}),a=k(g.aiAvailable,j,{shardKey:s}),[f,c]=(0,w.useState)(!1),x=f||a.data?.available===!1,p=i(o=>{d(r=>({...r,[o]:!0})),t(r=>({...r,[o]:void 0}))},"i"),h=i((o,r)=>{d(b=>({...b,[o]:!1})),r!==void 0&&t(b=>({...b,[o]:r})),r==="no-ai-binding"&&c(!0)},"a"),u=i(async o=>{p("sql");try{let{result:r}=await e.query(A,o,v(s));return h("sql",r.degraded?r.reason:void 0),r.degraded?void 0:r.sql}catch{h("sql","ai-error");return}},"f");return{generate:i(async(o,r)=>u({failedError:r?.error,failedSql:r?.sql,prompt:o}),"generate"),inferChart:i(async o=>{p("chart");try{let{result:r}=await e.query(O,o,v(s));return h("chart",r.degraded?r.reason:void 0),r.degraded?void 0:r.chart}catch{h("chart","ai-error");return}},"inferChart"),pending:i(o=>l[o]===!0,"pending"),reason:i(o=>n[o],"reason"),rewrite:i(async(o,r)=>u({editSql:r,prompt:o}),"rewrite"),suggestFilter:i(async(o,r)=>{p("filter");try{let{result:b}=await e.query(I,{prompt:o,table:r},v(s));return h("filter",b.degraded?b.reason:void 0),b.degraded?void 0:b.clauses}catch{h("filter","ai-error");return}},"suggestFilter"),unavailable:x}},"Q");var q=N(F(),1);var m=N(L(),1);var G=i((s,e)=>{if(e==="")return[{match:!1,offset:0,text:s}];let l=[],d=s.toLowerCase(),n=e.toLowerCase(),t=0;for(let a=d.indexOf(n);a!==-1;a=d.indexOf(n,t))a>t&&l.push({match:!1,offset:t,text:s.slice(t,a)}),l.push({match:!0,offset:a,text:s.slice(a,a+e.length)}),t=a+e.length;return t<s.length&&l.push({match:!1,offset:t,text:s.slice(t)}),l},"N"),U=i(s=>{let e=(0,q.c)(9),{highlight:l,value:d}=s;if(d==null){let c;return e[0]===Symbol.for("react.memo_cache_sentinel")?(c=(0,m.jsx)("span",{className:"text-muted-foreground/50 italic",children:"NULL"}),e[0]=c):c=e[0],c}let n,t,a;if(e[1]!==l||e[2]!==d){a=Symbol.for("react.early_return_sentinel");e:{let c=_(d);if(l===void 0||l===""){a=(0,m.jsx)("span",{title:c,children:c});break e}n=c,t=G(c,l).map(z)}e[1]=l,e[2]=d,e[3]=n,e[4]=t,e[5]=a}else n=e[3],t=e[4],a=e[5];if(a!==Symbol.for("react.early_return_sentinel"))return a;let f;return e[6]!==n||e[7]!==t?(f=(0,m.jsx)("span",{title:n,children:t}),e[6]=n,e[7]=t,e[8]=f):f=e[8],f},"v"),P=i(s=>{let e=(0,q.c)(22),{columns:l,rows:d}=s,n=S(),t;e[0]!==n?(t=n("Field"),e[0]=n,e[1]=t):t=e[1];let a;e[2]!==t?(a=(0,m.jsx)("th",{className:"border-b border-e border-border px-3 py-1.5 text-start font-mono text-[11px] tracking-wide uppercase text-muted-foreground",children:t}),e[2]=t,e[3]=a):a=e[3];let f;if(e[4]!==d||e[5]!==n){let u;e[7]!==n?(u=i((o,r)=>(0,m.jsx)("th",{className:"border-b border-border px-3 py-1.5 text-start font-mono text-[11px] tracking-wide uppercase tabular-nums text-muted-foreground",children:n("Row {n}",{n:r+1})},r),"c"),e[7]=n,e[8]=u):u=e[8],f=d.map(u),e[4]=d,e[5]=n,e[6]=f}else f=e[6];let c;e[9]!==a||e[10]!==f?(c=(0,m.jsx)("thead",{className:"sticky top-0 z-10 bg-muted",children:(0,m.jsxs)("tr",{children:[a,f]})}),e[9]=a,e[10]=f,e[11]=c):c=e[11];let x;if(e[12]!==l||e[13]!==d){let u;e[15]!==d?(u=i(o=>(0,m.jsxs)("tr",{className:"hover:bg-muted/40",children:[(0,m.jsx)("th",{className:"border-b border-e border-border px-3 py-1.5 text-start font-mono font-medium whitespace-nowrap",scope:"row",children:o}),d.map((r,b)=>(0,m.jsx)("td",{className:"max-w-md truncate border-b border-border px-3 py-1.5 font-mono",children:(0,m.jsx)(U,{value:r[o]})},b))]},o),"c"),e[15]=d,e[16]=u):u=e[16],x=l.map(u),e[12]=l,e[13]=d,e[14]=x}else x=e[14];let p;e[17]!==x?(p=(0,m.jsx)("tbody",{children:x}),e[17]=x,e[18]=p):p=e[18];let h;return e[19]!==c||e[20]!==p?(h=(0,m.jsx)("div",{className:"min-h-0 flex-1 overflow-auto","data-testid":"db-transposed",children:(0,m.jsxs)("table",{className:"border-collapse text-xs",children:[c,p]})}),e[19]=c,e[20]=p,e[21]=h):h=e[21],h},"T"),V=i(({children:s,layout:e="card",testId:l})=>(0,m.jsx)("div",{className:e==="fill"?"flex min-h-0 flex-1 flex-col overflow-hidden border-t border-border":"overflow-x-auto border border-border bg-card","data-testid":l,children:s}),"j");function z(s){return(0,m.jsx)("mark",{className:s.match?"rounded-sm bg-warning/40 text-foreground":"bg-transparent text-inherit",children:s.text},s.offset)}i(z,"_");export{Q as a,U as b,P as c,V as d};