@lunora/studio 1.0.0-alpha.35 → 1.0.0-alpha.351
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.
- package/LICENSE.md +6 -0
- package/README.md +4 -4
- package/dist/index.d.mts +1621 -0
- package/dist/index.d.ts +1013 -809
- package/dist/index.mjs +1 -0
- package/dist/mount.d.mts +23 -0
- package/dist/mount.d.ts +13 -11
- package/dist/mount.mjs +1 -0
- package/dist/packem_chunks/AdvisorHealthPanel.mjs +1 -0
- package/dist/packem_chunks/ApiTab.mjs +1 -0
- package/dist/packem_chunks/AuditPanel.mjs +1 -0
- package/dist/packem_chunks/DeploymentHealthPanel.mjs +1 -0
- package/dist/packem_chunks/ExportImportPanel.mjs +8 -0
- package/dist/packem_chunks/FileBrowser.mjs +4 -0
- package/dist/packem_chunks/FunctionRunner.mjs +1 -0
- package/dist/packem_chunks/FunctionStatsPanel.mjs +1 -0
- package/dist/packem_chunks/HealthPanel.mjs +1 -0
- package/dist/packem_chunks/InsightsPanel.mjs +1 -0
- package/dist/packem_chunks/LogsPanel.mjs +1 -0
- package/dist/packem_chunks/MailPanel.mjs +2 -0
- package/dist/packem_chunks/MetricsPanel.mjs +1 -0
- package/dist/packem_chunks/NotificationsPanel.mjs +1 -0
- package/dist/packem_chunks/PitrPanel.mjs +1 -0
- package/dist/packem_chunks/SchemaViewer.mjs +1 -0
- package/dist/packem_chunks/SecurityAdvisorPanel.mjs +1 -0
- package/dist/packem_chunks/SettingsPanel.mjs +1 -0
- package/dist/packem_chunks/SqlEditorPanel.mjs +10 -0
- package/dist/packem_chunks/TableEditor.mjs +1 -0
- package/dist/packem_chunks/agents-panel.mjs +1 -0
- package/dist/packem_chunks/ai-usage-panel.mjs +1 -0
- package/dist/packem_chunks/analytics-panel.mjs +1 -0
- package/dist/packem_chunks/architecture-panel.mjs +1 -0
- package/dist/packem_chunks/auth-audit-panel.mjs +1 -0
- package/dist/packem_chunks/auth-config-panel.mjs +1 -0
- package/dist/packem_chunks/auth-sessions-panel.mjs +1 -0
- package/dist/packem_chunks/containers-panel.mjs +1 -0
- package/dist/packem_chunks/dashboards-panel.mjs +1 -0
- package/dist/packem_chunks/evals-panel.mjs +1 -0
- package/dist/packem_chunks/fanout-panel.mjs +1 -0
- package/dist/packem_chunks/flags-panel.mjs +1 -0
- package/dist/packem_chunks/issues-panel.mjs +1 -0
- package/dist/packem_chunks/kv-browser.mjs +1 -0
- package/dist/packem_chunks/log-drains-panel.mjs +4 -0
- package/dist/packem_chunks/migrations-route.mjs +1 -0
- package/dist/packem_chunks/organizations-panel.mjs +1 -0
- package/dist/packem_chunks/payments-panel.mjs +1 -0
- package/dist/packem_chunks/permissions-panel.mjs +1 -0
- package/dist/packem_chunks/privacy-requests-panel.mjs +1 -0
- package/dist/packem_chunks/queues-panel.mjs +1 -0
- package/dist/packem_chunks/reactors-panel.mjs +1 -0
- package/dist/packem_chunks/rls-panel.mjs +1 -0
- package/dist/packem_chunks/schedule-panel.mjs +1 -0
- package/dist/packem_chunks/storage-rules-panel.mjs +1 -0
- package/dist/packem_chunks/subscriptions-panel.mjs +1 -0
- package/dist/packem_chunks/sync-client-panel.mjs +1 -0
- package/dist/packem_chunks/theme-indicator.mjs +1 -0
- package/dist/packem_chunks/traces-panel.mjs +1 -0
- package/dist/packem_chunks/users-panel.mjs +1 -0
- package/dist/packem_chunks/vector-browser.mjs +1 -0
- package/dist/packem_chunks/workflows-panel.mjs +1 -0
- package/dist/packem_shared/ADMIN_FUNCTIONS-4aGsMs95.mjs +1 -0
- package/dist/packem_shared/ApiDocsPanel-E4Vr-8zW.mjs +2 -0
- package/dist/packem_shared/ApiReferencePanel-u9Rrljdf.mjs +1 -0
- package/dist/packem_shared/CommandPalette-5OsK8PNe.mjs +1 -0
- package/dist/packem_shared/ConfirmButton-CIXYF6Mg.mjs +1 -0
- package/dist/packem_shared/ConnectionBadge-BfcoN-VE.mjs +1 -0
- package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-CG7Q45ZS.mjs +1 -0
- package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-D5YMT0gM.mjs +1 -0
- package/dist/packem_shared/DEFAULT_LOCALE-BQ3jRT74.mjs +1 -0
- package/dist/packem_shared/DataBrowser-C5HbI4TH.mjs +4 -0
- package/dist/packem_shared/DataFilters--ocFTVT2.mjs +1 -0
- package/dist/packem_shared/ErrorBoundary-BWNF98VF.mjs +1 -0
- package/dist/packem_shared/GlobalDataBrowser-D0H2yJSl.mjs +1 -0
- package/dist/packem_shared/HomePanel-CcYkDlR-.mjs +1 -0
- package/dist/packem_shared/MigrationsPanel-YyCO_T-3.mjs +1 -0
- package/dist/packem_shared/OpenRpcReferencePanel-E9cDfHRv.mjs +1 -0
- package/dist/packem_shared/STUDIO_ROOT_CLASS-C6MccdVk.mjs +1 -0
- package/dist/packem_shared/ScheduledJobs-D4CUj7aX.mjs +1 -0
- package/dist/packem_shared/ShardInput-CoySruKZ.mjs +1 -0
- package/dist/packem_shared/Studio-4vJzwwNa.mjs +1 -0
- package/dist/packem_shared/StudioApp-px2FMPDS.mjs +1 -0
- package/dist/packem_shared/StudioI18nProvider-CGXCPnQn.mjs +1 -0
- package/dist/packem_shared/advisor-view-fNcNYW2Q.mjs +1 -0
- package/dist/packem_shared/aggregateMetrics-DKFJc-o5.mjs +1 -0
- package/dist/packem_shared/alert-PB5W11MM.mjs +1 -0
- package/dist/packem_shared/app.d-D425h1XO.d.mts +352 -0
- package/dist/packem_shared/app.d-D425h1XO.d.ts +352 -0
- package/dist/packem_shared/auth-pager-DW77WeZw.mjs +1 -0
- package/dist/packem_shared/badge-r_5B4LHP.mjs +1 -0
- package/dist/packem_shared/bar-chart-BCsEIQoQ.mjs +6 -0
- package/dist/packem_shared/browser-storage-BH1MxLZs.mjs +1 -0
- package/dist/packem_shared/button-q0UYSmrn.mjs +1 -0
- package/dist/packem_shared/card-By2O8ULa.mjs +1 -0
- package/dist/packem_shared/cf-links-CBJ5SywP.mjs +1 -0
- package/dist/packem_shared/checkbox-CnS9cyCz.mjs +1 -0
- package/dist/packem_shared/control-button-BOZ5K-FC.mjs +1 -0
- package/dist/packem_shared/data-grid-r3isM8Nq.mjs +1 -0
- package/dist/packem_shared/data-view-params-C-_G-biH.mjs +1 -0
- package/dist/packem_shared/diagram-export-panel-aBDQdX4e.mjs +2 -0
- package/dist/packem_shared/dropdown-menu-jLZenfWH.mjs +2 -0
- package/dist/packem_shared/empty-state-D7jEML_T.mjs +1 -0
- package/dist/packem_shared/error-alert-54TiaMvZ.mjs +1 -0
- package/dist/packem_shared/grid-features-2c5SaBtH.mjs +6 -0
- package/dist/packem_shared/grid-pagination-DY2erU65.mjs +1 -0
- package/dist/packem_shared/home-panel-DPiMVQZ2.mjs +3 -0
- package/dist/packem_shared/input-CXhxesPC.mjs +1 -0
- package/dist/packem_shared/internal-BXEjuLPN.mjs +2 -0
- package/dist/packem_shared/label-DKFzyHq6.mjs +1 -0
- package/dist/packem_shared/live-status-D1GasNsH.mjs +1 -0
- package/dist/packem_shared/log-fields-BolUoZ9g.mjs +1 -0
- package/dist/packem_shared/log-line-BWDt_F56.mjs +1 -0
- package/dist/packem_shared/metrics-format-1sNGG47R.mjs +1 -0
- package/dist/packem_shared/modal-shell-CDztwLnv.mjs +1 -0
- package/dist/packem_shared/operation-console-provider-DoloEvon.mjs +1 -0
- package/dist/packem_shared/recording-client-MbGZ28I0.mjs +1 -0
- package/dist/packem_shared/reference-view-DCEC5kjY.mjs +13 -0
- package/dist/packem_shared/schema-diagram-k7cFl7Wp.mjs +2 -0
- package/dist/packem_shared/scroll-area-CXCQH7VT.mjs +2 -0
- package/dist/packem_shared/select-DPyS18Vy.mjs +2 -0
- package/dist/packem_shared/shard-history-CaO3C4KQ.mjs +1 -0
- package/dist/packem_shared/shortcuts-B9gDaXmw.mjs +1 -0
- package/dist/packem_shared/skeleton-DX1gfixl.mjs +1 -0
- package/dist/packem_shared/sparkline-B_sPPO_8.mjs +1 -0
- package/dist/packem_shared/sql-result-table-CatgdmMh.mjs +1 -0
- package/dist/packem_shared/stat-card-BAv73QtB.mjs +1 -0
- package/dist/packem_shared/storage-tier-C2mKwYRj.mjs +1 -0
- package/dist/packem_shared/studio-DIUgH7k0.mjs +2 -0
- package/dist/packem_shared/table-D0SBiDu-.mjs +2 -0
- package/dist/packem_shared/table-list-sidebar-CCRB_iYz.mjs +1 -0
- package/dist/packem_shared/textarea--40GKAyz.mjs +1 -0
- package/dist/packem_shared/trace-handoff-BV3EWqy_.mjs +1 -0
- package/dist/packem_shared/use-admin-query-BW9IuacC.mjs +1 -0
- package/dist/packem_shared/use-admin-spec-BdNLZbTO.mjs +1 -0
- package/dist/packem_shared/use-async-submit-2eBBD0-m.mjs +1 -0
- package/dist/packem_shared/use-auth-config-KO9tnI39.mjs +1 -0
- package/dist/packem_shared/use-mirrored-ref-CVDf2z1M.mjs +1 -0
- package/dist/packem_shared/use-open-trace-B_0LbTD7.mjs +1 -0
- package/dist/packem_shared/use-shard-key-BsP3o5wT.mjs +1 -0
- package/dist/packem_shared/use-sql-assistant-BMVlguKF.mjs +1 -0
- package/dist/packem_shared/use-studio-client-DCA50tF2.mjs +1 -0
- package/dist/packem_shared/useDebounced-DVeQ5-oW.mjs +1 -0
- package/dist/packem_shared/utils-bhneXptQ.mjs +1 -0
- package/dist/packem_shared/virtual-rect-D_j7aLxX.mjs +1 -0
- package/dist/standalone/chunk-22O2JDWR.js +1 -0
- package/dist/standalone/chunk-2DV455PX.js +1 -0
- package/dist/standalone/chunk-2EMNPL3B.js +1 -0
- package/dist/standalone/chunk-2O6KKVH2.js +1 -0
- package/dist/standalone/chunk-35BGGOWV.js +1 -0
- package/dist/standalone/chunk-3GXPALXG.js +1 -0
- package/dist/standalone/chunk-3MQ477EE.js +1 -0
- package/dist/standalone/chunk-3Y5K3IQO.js +1 -0
- package/dist/standalone/chunk-453GHHZ4.js +1 -0
- package/dist/standalone/chunk-4C4THJUD.js +1 -0
- package/dist/standalone/chunk-4CITH2NU.js +1 -0
- package/dist/standalone/chunk-4EDOPHLM.js +5 -0
- package/dist/standalone/chunk-4IEMXFUB.js +1 -0
- package/dist/standalone/chunk-4QRVJDM4.js +1 -0
- package/dist/standalone/chunk-4SQBAPY6.js +1 -0
- package/dist/standalone/chunk-4UWYDYM5.js +1 -0
- package/dist/standalone/chunk-57ZNR6IA.js +1 -0
- package/dist/standalone/chunk-5DNGK3NT.js +1 -0
- package/dist/standalone/chunk-6DYXTEU7.js +1 -0
- package/dist/standalone/chunk-6GPEHYCG.js +1 -0
- package/dist/standalone/chunk-6GRI2HXU.js +1 -0
- package/dist/standalone/chunk-6I42AM75.js +1 -0
- package/dist/standalone/chunk-6M7FLLMT.js +1 -0
- package/dist/standalone/chunk-6QBK3Z7A.js +1 -0
- package/dist/standalone/chunk-6QEXGYWH.js +1 -0
- package/dist/standalone/chunk-6UTZXEW3.js +1 -0
- package/dist/standalone/chunk-7EAHHRJR.js +1 -0
- package/dist/standalone/chunk-7RGYCU6F.js +1 -0
- package/dist/standalone/chunk-A566HCBX.js +1 -0
- package/dist/standalone/chunk-ACNWZIAH.js +15 -0
- package/dist/standalone/chunk-ANACHJRU.js +1 -0
- package/dist/standalone/chunk-AOHKAKKL.js +1 -0
- package/dist/standalone/chunk-AP4PC2M4.js +1 -0
- package/dist/standalone/chunk-BAGJYLSU.js +8 -0
- package/dist/standalone/chunk-BCOOULSO.js +1 -0
- package/dist/standalone/chunk-BKH2NALB.js +1 -0
- package/dist/standalone/chunk-BTOOJXUL.js +59 -0
- package/dist/standalone/chunk-C6FNBKCO.js +1 -0
- package/dist/standalone/chunk-CTE6RPXC.js +1 -0
- package/dist/standalone/chunk-CW57Q264.js +1 -0
- package/dist/standalone/chunk-DBVJ5VLI.js +1 -0
- package/dist/standalone/chunk-DS7HZKZ2.js +6 -0
- package/dist/standalone/chunk-DSTNWB4N.js +1 -0
- package/dist/standalone/chunk-DTW4E5AB.js +1 -0
- package/dist/standalone/chunk-DX55P3KZ.js +1 -0
- package/dist/standalone/chunk-E26OT26O.js +1 -0
- package/dist/standalone/chunk-FLVDICZL.js +1 -0
- package/dist/standalone/chunk-FNWRS4VQ.js +1 -0
- package/dist/standalone/chunk-FST24UXA.js +1 -0
- package/dist/standalone/chunk-FXGYX2V6.js +1 -0
- package/dist/standalone/chunk-HKLF627N.js +1 -0
- package/dist/standalone/chunk-HKPDPKXD.js +1 -0
- package/dist/standalone/chunk-HWTX54JM.js +8 -0
- package/dist/standalone/chunk-HZCLLEWP.js +1 -0
- package/dist/standalone/chunk-IBJVVHV5.js +1 -0
- package/dist/standalone/chunk-IH2CJZF2.js +1 -0
- package/dist/standalone/chunk-IRCUXARN.js +1 -0
- package/dist/standalone/chunk-IVQKQBKK.js +1 -0
- package/dist/standalone/chunk-JTGGWF7R.js +1 -0
- package/dist/standalone/chunk-K7FZTYAY.js +1 -0
- package/dist/standalone/chunk-KNX3KB7E.js +1 -0
- package/dist/standalone/chunk-KRPXOSBL.js +1 -0
- package/dist/standalone/chunk-KYONGQQ4.js +1 -0
- package/dist/standalone/chunk-LIGOLZND.js +1 -0
- package/dist/standalone/chunk-LKCO3E2B.js +1 -0
- package/dist/standalone/chunk-LPINY2IJ.js +19 -0
- package/dist/standalone/chunk-LRXCL6IA.js +1 -0
- package/dist/standalone/chunk-LUHXNZI4.js +2 -0
- package/dist/standalone/chunk-LYHEBMM6.js +1 -0
- package/dist/standalone/chunk-M2RIGPGL.js +1 -0
- package/dist/standalone/chunk-MD67S53Z.js +1 -0
- package/dist/standalone/chunk-MDAXV2XH.js +4 -0
- package/dist/standalone/chunk-MKVZXGJQ.js +1 -0
- package/dist/standalone/chunk-NGVP66OH.js +1 -0
- package/dist/standalone/chunk-NMVFSJM7.js +1 -0
- package/dist/standalone/chunk-OIDFWEJX.js +21 -0
- package/dist/standalone/chunk-OJG65AG4.js +1 -0
- package/dist/standalone/chunk-OSJ7HV7B.js +1 -0
- package/dist/standalone/chunk-OUFWXYEF.js +1 -0
- package/dist/standalone/chunk-OXFKZ4BM.js +1 -0
- package/dist/standalone/chunk-P6L6ABWO.js +1 -0
- package/dist/standalone/chunk-PZZWUL5U.js +1 -0
- package/dist/standalone/chunk-Q4N3TJPV.js +1 -0
- package/dist/standalone/chunk-QEVFVWGC.js +2 -0
- package/dist/standalone/chunk-R36QXQZX.js +1 -0
- package/dist/standalone/chunk-RHOQJNDW.js +1 -0
- package/dist/standalone/chunk-RQDSPVVH.js +1 -0
- package/dist/standalone/chunk-S5S2YICJ.js +1 -0
- package/dist/standalone/chunk-S6JFSLBK.js +1 -0
- package/dist/standalone/chunk-SDQH4HR6.js +3 -0
- package/dist/standalone/chunk-SDTHCM5H.js +1 -0
- package/dist/standalone/chunk-SFY646MC.js +1 -0
- package/dist/standalone/chunk-SJLEEYCR.js +1 -0
- package/dist/standalone/chunk-SLIDAWNX.js +1 -0
- package/dist/standalone/chunk-SM2IQWCJ.js +1 -0
- package/dist/standalone/{chunk-BJGBHGK3.js → chunk-SYGCASPT.js} +1 -1
- package/dist/standalone/chunk-T2QAOXUO.js +14 -0
- package/dist/standalone/chunk-T4VAXHRL.js +4 -0
- package/dist/standalone/chunk-TBDJVYCB.js +1 -0
- package/dist/standalone/chunk-TDVDZ7XQ.js +1 -0
- package/dist/standalone/chunk-TRZTGE4R.js +1 -0
- package/dist/standalone/chunk-TTD7BKB6.js +1 -0
- package/dist/standalone/chunk-UCK6ITED.js +1 -0
- package/dist/standalone/chunk-UKKZJRJT.js +1 -0
- package/dist/standalone/chunk-UYEZR3BI.js +1 -0
- package/dist/standalone/chunk-V74BXQXC.js +1 -0
- package/dist/standalone/chunk-VEWQWS3J.js +1 -0
- package/dist/standalone/chunk-VHMA6YPT.js +1 -0
- package/dist/standalone/chunk-W2BCSK5S.js +1 -0
- package/dist/standalone/chunk-W4X4J7BU.js +1 -0
- package/dist/standalone/chunk-W6ZKEW5M.js +1 -0
- package/dist/standalone/chunk-W7MRISE3.js +1 -0
- package/dist/standalone/chunk-WIYDA4XT.js +1 -0
- package/dist/standalone/chunk-WS36BO4R.js +1 -0
- package/dist/standalone/chunk-WZTY3ZYI.js +1 -0
- package/dist/standalone/chunk-X5KWBDTF.js +1 -0
- package/dist/standalone/chunk-X74GEPSG.js +1 -0
- package/dist/standalone/chunk-X7GSROPX.js +1 -0
- package/dist/standalone/chunk-XBZUJDHD.js +1 -0
- package/dist/standalone/chunk-XYR5NST4.js +1 -0
- package/dist/standalone/chunk-Y7SN6CTX.js +1 -0
- package/dist/standalone/chunk-YHTHRYP5.js +1 -0
- package/dist/standalone/chunk-YJWR6ZWC.js +1 -0
- package/dist/standalone/chunk-YRQHFMEY.js +1 -0
- package/dist/standalone/chunk-Z5EV64KS.js +1 -0
- package/dist/standalone/chunk-ZBON5T5A.js +1 -0
- package/dist/standalone/chunk-ZGSL4DPP.js +1 -0
- package/dist/standalone/chunk-ZKPRORLI.js +1 -0
- package/dist/standalone/chunk-ZLSNET6H.js +1 -0
- package/dist/standalone/chunk-ZM4K2ETZ.js +3 -0
- package/dist/standalone/chunk-ZTOREMGH.js +1 -0
- package/dist/standalone/chunk-ZWDORIZY.js +1 -0
- package/dist/standalone/studio.js +9 -214
- package/dist/styles.css +2 -2
- package/package.json +26 -22
- package/dist/index.js +0 -41
- package/dist/mount.js +0 -27
- package/dist/packem_chunks/ApiTab.js +0 -251
- package/dist/packem_chunks/AuditPanel.js +0 -200
- package/dist/packem_chunks/ExportImportPanel.js +0 -198
- package/dist/packem_chunks/FileBrowser.js +0 -2932
- package/dist/packem_chunks/FunctionRunner.js +0 -343
- package/dist/packem_chunks/FunctionStatsPanel.js +0 -377
- package/dist/packem_chunks/HealthPanel.js +0 -648
- package/dist/packem_chunks/InsightsPanel.js +0 -462
- package/dist/packem_chunks/LogsPanel.js +0 -827
- package/dist/packem_chunks/MailPanel.js +0 -353
- package/dist/packem_chunks/MetricsPanel.js +0 -1344
- package/dist/packem_chunks/MigrationsPanel.js +0 -239
- package/dist/packem_chunks/PitrPanel.js +0 -252
- package/dist/packem_chunks/SchemaViewer.js +0 -2513
- package/dist/packem_chunks/SecurityAdvisorPanel.js +0 -95
- package/dist/packem_chunks/SettingsPanel.js +0 -391
- package/dist/packem_chunks/SqlEditorPanel.js +0 -2323
- package/dist/packem_chunks/TableEditor.js +0 -313
- package/dist/packem_chunks/analytics-panel.js +0 -261
- package/dist/packem_chunks/auth-config-panel.js +0 -179
- package/dist/packem_chunks/auth-sessions-panel.js +0 -175
- package/dist/packem_chunks/containers-panel.js +0 -247
- package/dist/packem_chunks/dashboards-panel.js +0 -780
- package/dist/packem_chunks/fanout-panel.js +0 -482
- package/dist/packem_chunks/flags-panel.js +0 -176
- package/dist/packem_chunks/kv-browser.js +0 -1896
- package/dist/packem_chunks/log-drains-panel.js +0 -273
- package/dist/packem_chunks/organizations-panel.js +0 -670
- package/dist/packem_chunks/payments-panel.js +0 -186
- package/dist/packem_chunks/permissions-panel.js +0 -805
- package/dist/packem_chunks/queues-panel.js +0 -1052
- package/dist/packem_chunks/rls-panel.js +0 -315
- package/dist/packem_chunks/schedule-panel.js +0 -831
- package/dist/packem_chunks/sparkline.js +0 -79
- package/dist/packem_chunks/storage-rules-panel.js +0 -140
- package/dist/packem_chunks/subscriptions-panel.js +0 -238
- package/dist/packem_chunks/users-panel.js +0 -1265
- package/dist/packem_chunks/vector-browser.js +0 -281
- package/dist/packem_chunks/workflows-panel.js +0 -562
- package/dist/packem_shared/ADMIN_FUNCTIONS-BHHJi3Gb.js +0 -52
- package/dist/packem_shared/ApiDocsPanel-D4CJf2ad.js +0 -842
- package/dist/packem_shared/ApiReferencePanel-Co_wpRF2.js +0 -230
- package/dist/packem_shared/CommandPalette-BUPpbpMc.js +0 -373
- package/dist/packem_shared/ConfirmButton-C2eVi2Qv.js +0 -59
- package/dist/packem_shared/ConnectionBadge-B2DDM2Tn.js +0 -111
- package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js +0 -50
- package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-DjF0h-gA.js +0 -89
- package/dist/packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js +0 -27
- package/dist/packem_shared/DataBrowser-BeVNxSVm.js +0 -4493
- package/dist/packem_shared/DataFilters-FNquMaiu.js +0 -249
- package/dist/packem_shared/ErrorBoundary-BzAApI7J.js +0 -66
- package/dist/packem_shared/GlobalDataBrowser-ErfvIs1S.js +0 -289
- package/dist/packem_shared/HomePanel-D9MQk8I7.js +0 -14
- package/dist/packem_shared/OpenRpcReferencePanel-DLWzrIx9.js +0 -192
- package/dist/packem_shared/STUDIO_ROOT_CLASS-D12gX2dV.js +0 -3
- package/dist/packem_shared/ScheduledJobs-ClaNpZsg.js +0 -262
- package/dist/packem_shared/ShardInput-gx_DZXXn.js +0 -107
- package/dist/packem_shared/Studio-C48P1K5W.js +0 -16
- package/dist/packem_shared/StudioApp-Cqh-SYm2.js +0 -657
- package/dist/packem_shared/StudioI18nProvider-B-tDCZIi.js +0 -48
- package/dist/packem_shared/advisor-view-D3-U4kRR.js +0 -159
- package/dist/packem_shared/aggregateMetrics-D4nUHEKU.js +0 -108
- package/dist/packem_shared/alert-CdAET2K_.js +0 -68
- package/dist/packem_shared/app.d-CNLRTrWw.d.ts +0 -300
- package/dist/packem_shared/badge-B2PKA1-5.js +0 -49
- package/dist/packem_shared/bar-chart-DSwcWIRy.js +0 -3246
- package/dist/packem_shared/browser-storage-tLOxkIHd.js +0 -185
- package/dist/packem_shared/button-BhsN2uZH.js +0 -49
- package/dist/packem_shared/card-DURq3ElK.js +0 -175
- package/dist/packem_shared/cf-links-BZfRdxSE.js +0 -8
- package/dist/packem_shared/checkbox-UNkzAxl-.js +0 -63
- package/dist/packem_shared/data-grid-Jz8FqQ2C.js +0 -183
- package/dist/packem_shared/data-view-params-Cd6yRVbv.js +0 -96
- package/dist/packem_shared/dropdown-menu-WY4B_eJO.js +0 -280
- package/dist/packem_shared/empty-state-DY_oe0k6.js +0 -98
- package/dist/packem_shared/error-alert-BBT6D22d.js +0 -114
- package/dist/packem_shared/grid-features-CUr8Z1_O.js +0 -745
- package/dist/packem_shared/home-panel-CoGxi-oj.js +0 -1639
- package/dist/packem_shared/input-XH4r1Pt1.js +0 -53
- package/dist/packem_shared/internal-DTsYVn-g.js +0 -97
- package/dist/packem_shared/label-D8ykjn5J.js +0 -46
- package/dist/packem_shared/live-status-FZ0psC1z.js +0 -44
- package/dist/packem_shared/modal-shell-hyaJvIJ6.js +0 -100
- package/dist/packem_shared/reference-view-CSKyUyPl.js +0 -2141
- package/dist/packem_shared/scroll-area-DLhcy-ml.js +0 -93
- package/dist/packem_shared/select-UkNYCT3s.js +0 -273
- package/dist/packem_shared/shard-history-DyebH1R5.js +0 -38
- package/dist/packem_shared/skeleton-CGhL0p20.js +0 -45
- package/dist/packem_shared/sparkline-BnA1kC9X.js +0 -93
- package/dist/packem_shared/storage-tier-CL98eOvn.js +0 -85
- package/dist/packem_shared/studio-CPHA_-3I.js +0 -4015
- package/dist/packem_shared/table-DsCa9Qp9.js +0 -246
- package/dist/packem_shared/table-list-sidebar-B5psdSV1.js +0 -832
- package/dist/packem_shared/textarea-D3gaCU_-.js +0 -46
- package/dist/packem_shared/use-admin-query-BHPKmPuj.js +0 -106
- package/dist/packem_shared/use-auth-capabilities-C-VH0oJJ.js +0 -32
- package/dist/packem_shared/useDebounced-Dxncpg6z.js +0 -32
- package/dist/packem_shared/utils-B05Dmz_H.js +0 -8
- package/dist/packem_shared/virtual-rect-CVMUskSm.js +0 -10
- package/dist/standalone/chunk-25VHPD2I.js +0 -1
- package/dist/standalone/chunk-2GGMGPEP.js +0 -1
- package/dist/standalone/chunk-2K47A3P6.js +0 -1
- package/dist/standalone/chunk-2NGUNNGW.js +0 -1
- package/dist/standalone/chunk-3CJW6NWG.js +0 -4
- package/dist/standalone/chunk-3OA7PECS.js +0 -6
- package/dist/standalone/chunk-46K3NKPA.js +0 -1
- package/dist/standalone/chunk-474C2O7W.js +0 -1
- package/dist/standalone/chunk-4H2OJBXO.js +0 -1
- package/dist/standalone/chunk-4QHKBC77.js +0 -1
- package/dist/standalone/chunk-55YA7ZZI.js +0 -76
- package/dist/standalone/chunk-5OH3VPZF.js +0 -1
- package/dist/standalone/chunk-5OIBXYZM.js +0 -1
- package/dist/standalone/chunk-6GFEVKJP.js +0 -1
- package/dist/standalone/chunk-6UGM5IHN.js +0 -4
- package/dist/standalone/chunk-6WRZP62V.js +0 -1
- package/dist/standalone/chunk-764T6X6X.js +0 -1
- package/dist/standalone/chunk-7TJJXVSE.js +0 -1
- package/dist/standalone/chunk-7VF3IAAW.js +0 -2
- package/dist/standalone/chunk-7WNJ4Q7Z.js +0 -8
- package/dist/standalone/chunk-AHILM3ZP.js +0 -1
- package/dist/standalone/chunk-AJIUI7DD.js +0 -1
- package/dist/standalone/chunk-BACPICH6.js +0 -1
- package/dist/standalone/chunk-BI35RXKQ.js +0 -1
- package/dist/standalone/chunk-BOXSWNXZ.js +0 -1
- package/dist/standalone/chunk-BQUQS7QN.js +0 -1
- package/dist/standalone/chunk-CKSHCYGC.js +0 -2
- package/dist/standalone/chunk-DORBUITF.js +0 -1
- package/dist/standalone/chunk-DVC6YWVP.js +0 -1
- package/dist/standalone/chunk-DVKPRFIJ.js +0 -1
- package/dist/standalone/chunk-DWDILV2E.js +0 -1
- package/dist/standalone/chunk-DWTBY343.js +0 -1
- package/dist/standalone/chunk-EIQW6ACH.js +0 -1
- package/dist/standalone/chunk-EUIHTPKI.js +0 -1
- package/dist/standalone/chunk-FCSPAJW4.js +0 -1
- package/dist/standalone/chunk-FKO3HO6I.js +0 -4
- package/dist/standalone/chunk-GMSGZDDH.js +0 -13
- package/dist/standalone/chunk-GTM65MVX.js +0 -1
- package/dist/standalone/chunk-HV7G6DFP.js +0 -5
- package/dist/standalone/chunk-ILCTSAOB.js +0 -1
- package/dist/standalone/chunk-IODYGARQ.js +0 -1
- package/dist/standalone/chunk-J6J54MBP.js +0 -1
- package/dist/standalone/chunk-JE2YOAB7.js +0 -4
- package/dist/standalone/chunk-JFSZIUZT.js +0 -4
- package/dist/standalone/chunk-JSEXCW5Q.js +0 -1
- package/dist/standalone/chunk-K3GNLVYK.js +0 -1
- package/dist/standalone/chunk-KEGAWN6Y.js +0 -1
- package/dist/standalone/chunk-KZ6INM5M.js +0 -1
- package/dist/standalone/chunk-LD2R263D.js +0 -1
- package/dist/standalone/chunk-LI43EKM6.js +0 -1
- package/dist/standalone/chunk-M55U7NHO.js +0 -1
- package/dist/standalone/chunk-MPTM7ZU3.js +0 -3
- package/dist/standalone/chunk-MPYFGAOW.js +0 -1
- package/dist/standalone/chunk-NJFMWO6P.js +0 -1
- package/dist/standalone/chunk-O3NAGRTR.js +0 -1
- package/dist/standalone/chunk-O77VNUFD.js +0 -1
- package/dist/standalone/chunk-OCHNCAXJ.js +0 -1
- package/dist/standalone/chunk-PACH5AHG.js +0 -1
- package/dist/standalone/chunk-PN5NCZDX.js +0 -1
- package/dist/standalone/chunk-PVZI3CXP.js +0 -19
- package/dist/standalone/chunk-PZ7HD5T2.js +0 -1
- package/dist/standalone/chunk-QAFAJBAW.js +0 -1
- package/dist/standalone/chunk-QBAT52GB.js +0 -1
- package/dist/standalone/chunk-QLM6FYZW.js +0 -2
- package/dist/standalone/chunk-RRAFQ5G2.js +0 -1
- package/dist/standalone/chunk-RRCPZMC2.js +0 -22
- package/dist/standalone/chunk-RSEEHNFI.js +0 -1
- package/dist/standalone/chunk-SEU5V7I6.js +0 -1
- package/dist/standalone/chunk-SLKF2L74.js +0 -1
- package/dist/standalone/chunk-SVR644RF.js +0 -1
- package/dist/standalone/chunk-TAD43CG5.js +0 -1
- package/dist/standalone/chunk-TBMYIZIO.js +0 -1
- package/dist/standalone/chunk-TDL7NEWA.js +0 -1
- package/dist/standalone/chunk-TO4JQX7W.js +0 -1
- package/dist/standalone/chunk-TQ36RWOP.js +0 -1
- package/dist/standalone/chunk-U4OAQPBT.js +0 -1
- package/dist/standalone/chunk-UII66UVF.js +0 -1
- package/dist/standalone/chunk-UK64ZSUW.js +0 -1
- package/dist/standalone/chunk-VLXV72QE.js +0 -1
- package/dist/standalone/chunk-VSHUSN6T.js +0 -1
- package/dist/standalone/chunk-VTGBPW24.js +0 -1
- package/dist/standalone/chunk-WXPWVBIY.js +0 -1
- package/dist/standalone/chunk-X6F22DBL.js +0 -1
- package/dist/standalone/chunk-X7MMBSNW.js +0 -1
- package/dist/standalone/chunk-XGMIDFUK.js +0 -1
- package/dist/standalone/chunk-XNJNSCLM.js +0 -1
- package/dist/standalone/chunk-XUGSA2NG.js +0 -1
- package/dist/standalone/chunk-XZE2RNDA.js +0 -1
- package/dist/standalone/chunk-Y2ZPNDL7.js +0 -4
- package/dist/standalone/chunk-YAECF5LW.js +0 -1
- package/dist/standalone/chunk-YEVCU7TB.js +0 -13
- package/dist/standalone/chunk-YV43BOP7.js +0 -1
- package/dist/standalone/chunk-ZHVTQ37P.js +0 -1
- package/dist/standalone/chunk-ZPP2KOR4.js +0 -1
- package/dist/standalone/chunk-ZPUO7FNI.js +0 -1
- package/dist/standalone/chunk-ZU4DZ6NK.js +0 -1
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{c as B}from"react/compiler-runtime";import{useState as $,useEffect as ze,useMemo as $t,useRef as Ke,useCallback as ct}from"react";import{ShardInput as Gn}from"./ShardInput-CoySruKZ.mjs";import{u as Ze}from"./use-admin-query-BW9IuacC.mjs";import{u as Xe}from"./use-mirrored-ref-CVDf2z1M.mjs";import{u as ut}from"./use-studio-client-DCA50tF2.mjs";import{ADMIN_FUNCTIONS as he}from"./ADMIN_FUNCTIONS-4aGsMs95.mjs";import{b as nn}from"./browser-storage-BH1MxLZs.mjs";import{f as Ce,l as Me,k as on,b as zt,c as $e,d as Re,o as Jn,h as Wn}from"./internal-BXEjuLPN.mjs";import{m as Hn,b as sn,c as Nt,u as Un,a as Qn,T as Yn,D as Xn}from"./table-list-sidebar-CCRB_iYz.mjs";import{u as Zn}from"./use-sql-assistant-BMVlguKF.mjs";import{decodeWire as Pt,isPlainObject as ln,encodeWire as rn,decodeDocument as eo}from"@lunora/wire";import{B as kt}from"./button-q0UYSmrn.mjs";import{I as to}from"./input-CXhxesPC.mjs";import{L as qt}from"./label-DKFzyHq6.mjs";import{M as ft}from"./modal-shell-CDztwLnv.mjs";import{useT as ve}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{jsx as d,jsxs as E,Fragment as et}from"react/jsx-runtime";import{ConfirmButton as Kt}from"./ConfirmButton-CIXYF6Mg.mjs";import{E as no}from"./empty-state-D7jEML_T.mjs";import{C as Dt,a as Pe}from"./control-button-BOZ5K-FC.mjs";import{tableFeatures as oo,sortFn_text as so,sortFn_datetime as lo,sortFn_basic as ro,sortFn_alphanumeric as ao,rowSortingFeature as io,rowSelectionFeature as co,columnVisibilityFeature as uo,columnSizingFeature as fo,columnResizingFeature as mo,columnOrderingFeature as go,createSortedRowModel as po,useTable as bo,flexRender as ho}from"@tanstack/react-table";import{useVirtualizer as xo}from"@tanstack/react-virtual";import{C as It}from"./checkbox-CnS9cyCz.mjs";import{c as dt}from"./utils-bhneXptQ.mjs";import{f as vo}from"./virtual-rect-D_j7aLxX.mjs";import{C as Tt,G as wo,T as yo}from"./data-grid-r3isM8Nq.mjs";import{DataFilters as Co,toFilterClauses as Fe}from"./DataFilters--ocFTVT2.mjs";import{G as So,C as No}from"./grid-features-2c5SaBtH.mjs";import{G as ko}from"./grid-pagination-DY2erU65.mjs";import Gt from"./useDebounced-DVeQ5-oW.mjs";import{r as To,l as Eo}from"./shard-history-CaO3C4KQ.mjs";const _o=s=>({tables:Object.entries(s).map(([e,n])=>({fields:n.map(o=>o.name),indexes:[],name:e,relations:n.filter(o=>o.ref!==void 0).map(o=>({field:o.name,kind:"one",name:o.name,onDelete:o.onDelete,references:o.ref,table:e}))}))}),Ro=s=>{const e=new Map,n=new Set;for(const o of s.tables)for(const t of o.relations){if(t.kind!=="one"||t.onDelete==="set null")continue;const c=t.references,l=`${c}\0${o.name}\0${t.field}`;if(n.has(l))continue;n.add(l);const r=e.get(c)??[];r.push({...t,table:o.name}),e.set(c,r)}return e},$o=(s,e)=>{const n=[],o=[s];for(;o.length>0;){const t=o.shift();if(t===void 0)break;e(t)&&n.push(t);for(const c of t.children)o.push(c)}return n},Jt=(s,e)=>{const n=[];for(const[o,t]of Object.entries(e))for(const c of t)c.ref===s&&n.push({column:c.name,table:o});return n.sort((o,t)=>o.table.localeCompare(t.table)||o.column.localeCompare(t.column)),n},Ot=s=>`${s.table}.${s.column}`,Do=s=>{const e=B(111),{columns:n,onApply:o,onClose:t,shardKey:c,table:l,total:r,uniqueColumns:a}=s,i=ve(),[u,m]=$(n[0]??""),[p,b]=$("");let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=re=>{m(re.target.value)},e[0]=f):f=e[0];const g=f;let h;e[1]===Symbol.for("react.memo_cache_sentinel")?(h=re=>{b(re.target.value)},e[1]=h):h=e[1];const x=h;let v;e[2]!==p?(v=p.trim(),e[2]=p,e[3]=v):v=e[3];const y=v==="";let S,C;if(e[4]!==y||e[5]!==i||e[6]!==p){if(!y)try{C=Pt(JSON.parse(p))}catch(re){S=i("Invalid JSON: {message}",{message:re.message})}e[4]=y,e[5]=i,e[6]=p,e[7]=S,e[8]=C}else S=e[7],C=e[8];let k;e[9]!==u||e[10]!==r||e[11]!==a?(k=a.has(u)&&r>1,e[9]=u,e[10]=r,e[11]=a,e[12]=k):k=e[12];const N=k,w=u!==""&&!y&&S===void 0&&!N;let T;e[13]!==w||e[14]!==u||e[15]!==o||e[16]!==t||e[17]!==C?(T=()=>{w&&(o({[u]:C}),t())},e[13]=w,e[14]=u,e[15]=o,e[16]=t,e[17]=C,e[18]=T):T=e[18];const F=T;let R;e[19]!==i?(R=i("Set a column on matching rows"),e[19]=i,e[20]=R):R=e[20];let _;e[21]!==i?(_=i("Set a column on matching rows"),e[21]=i,e[22]=_):_=e[22];let D;e[23]!==_?(D=d("h3",{className:"text-base text-foreground","data-testid":"bulk-patch-title",children:_}),e[23]=_,e[24]=D):D=e[24];let O;e[25]!==i||e[26]!==l||e[27]!==r?(O=i("Writes {total} rows of {table} through the schema-aware writer — validators and indexes apply, exactly like a mutation.",{table:l,total:r.toString()}),e[25]=i,e[26]=l,e[27]=r,e[28]=O):O=e[28];let V;e[29]!==O?(V=d("p",{className:"text-xs text-muted-foreground","data-testid":"bulk-patch-desc",children:O}),e[29]=O,e[30]=V):V=e[30];let A;e[31]!==c||e[32]!==i?(A=c===""?i("Shard: root"):i("Shard: {shardKey} — rows in other shards are not touched.",{shardKey:c}),e[31]=c,e[32]=i,e[33]=A):A=e[33];let L;e[34]!==A?(L=d("p",{className:"text-xs text-muted-foreground","data-testid":"bulk-patch-shard",children:A}),e[34]=A,e[35]=L):L=e[35];let G;e[36]!==V||e[37]!==L||e[38]!==D?(G=E("div",{className:"flex flex-col gap-0.5",children:[D,V,L]}),e[36]=V,e[37]=L,e[38]=D,e[39]=G):G=e[39];let q;e[40]!==i?(q=i("Close"),e[40]=i,e[41]=q):q=e[41];let P;e[42]!==t||e[43]!==q?(P=d(kt,{"data-testid":"bulk-patch-close",onClick:t,size:"xs",variant:"ghost",children:q}),e[42]=t,e[43]=q,e[44]=P):P=e[44];let J;e[45]!==G||e[46]!==P?(J=E("div",{className:"flex items-start justify-between",children:[G,P]}),e[45]=G,e[46]=P,e[47]=J):J=e[47];let K;e[48]!==i?(K=i("Column"),e[48]=i,e[49]=K):K=e[49];let H;e[50]!==K?(H=d(qt,{htmlFor:"bulk-patch-column",children:K}),e[50]=K,e[51]=H):H=e[51];let Y;e[52]!==i?(Y=i("Column"),e[52]=i,e[53]=Y):Y=e[53];let U;e[54]!==n?(U=n.map(Ao),e[54]=n,e[55]=U):U=e[55];let ne;e[56]!==u||e[57]!==Y||e[58]!==U?(ne=d("select",{"aria-label":Y,className:"h-8 rounded-md border border-input bg-transparent px-2 py-1 text-xs outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 dark:bg-input/30","data-testid":"bulk-patch-column",id:"bulk-patch-column",onChange:g,value:u,children:U}),e[56]=u,e[57]=Y,e[58]=U,e[59]=ne):ne=e[59];let le;e[60]!==i?(le=i("Value"),e[60]=i,e[61]=le):le=e[61];let ae;e[62]!==le?(ae=d(qt,{htmlFor:"bulk-patch-value",children:le}),e[62]=le,e[63]=ae):ae=e[63];let ge;e[64]!==p?(ge=d(to,{className:"flex-1 font-mono","data-testid":"bulk-patch-value",id:"bulk-patch-value",onChange:x,placeholder:"true",value:p}),e[64]=p,e[65]=ge):ge=e[65];let fe;e[66]!==H||e[67]!==ne||e[68]!==ae||e[69]!==ge?(fe=E("div",{className:"flex items-center gap-2",children:[H,ne,ae,ge]}),e[66]=H,e[67]=ne,e[68]=ae,e[69]=ge,e[70]=fe):fe=e[70];let me;e[71]!==S?(me=S!==void 0&&d("p",{className:"text-xs text-destructive","data-testid":"bulk-patch-error",role:"alert",children:S}),e[71]=S,e[72]=me):me=e[72];let pe;e[73]!==u||e[74]!==i||e[75]!==r||e[76]!==N?(pe=N&&d("p",{className:"text-xs text-destructive","data-testid":"bulk-patch-unique",role:"alert",children:i("{column} has a unique index — the same value cannot be set on {total} rows.",{column:u,total:r.toString()})}),e[73]=u,e[74]=i,e[75]=r,e[76]=N,e[77]=pe):pe=e[77];let ie;e[78]!==y||e[79]!==i||e[80]!==N?(ie=y&&!N&&d("p",{className:"text-xs text-muted-foreground","data-testid":"bulk-patch-hint",children:i('Enter a JSON value — for example true, 0, null, or "done".')}),e[78]=y,e[79]=i,e[80]=N,e[81]=ie):ie=e[81];let Q;e[82]!==w||e[83]!==u||e[84]!==p?(Q=w&&d("p",{className:"font-mono text-xs text-muted-foreground","data-testid":"bulk-patch-preview",children:`${u} = ${p.trim()}`}),e[82]=w,e[83]=u,e[84]=p,e[85]=Q):Q=e[85];let be;e[86]!==i?(be=i("Cancel"),e[86]=i,e[87]=be):be=e[87];let ce;e[88]!==t||e[89]!==be?(ce=d(kt,{"data-testid":"bulk-patch-cancel",onClick:t,size:"xs",variant:"outline",children:be}),e[88]=t,e[89]=be,e[90]=ce):ce=e[90];const Se=!w;let oe;e[91]!==i||e[92]!==r?(oe=i("Set on {total} rows",{total:r.toString()}),e[91]=i,e[92]=r,e[93]=oe):oe=e[93];let se;e[94]!==F||e[95]!==Se||e[96]!==oe?(se=d(kt,{"data-testid":"bulk-patch-apply",disabled:Se,onClick:F,size:"xs",children:oe}),e[94]=F,e[95]=Se,e[96]=oe,e[97]=se):se=e[97];let W;e[98]!==ce||e[99]!==se?(W=E("div",{className:"flex justify-end gap-2",children:[ce,se]}),e[98]=ce,e[99]=se,e[100]=W):W=e[100];let j;return e[101]!==t||e[102]!==J||e[103]!==fe||e[104]!==me||e[105]!==pe||e[106]!==ie||e[107]!==Q||e[108]!==W||e[109]!==R?(j=E(ft,{label:R,onClose:t,panelTestId:"bulk-patch-panel",testId:"bulk-patch-overlay",variant:"dialog",children:[J,fe,me,pe,ie,Q,W]}),e[101]=t,e[102]=J,e[103]=fe,e[104]=me,e[105]=pe,e[106]=ie,e[107]=Q,e[108]=W,e[109]=R,e[110]=j):j=e[110],j};function Ao(s){return d("option",{value:s,children:s},s)}const Wt=6,at=100,Po=s=>({paddingLeft:s*16}),Io=s=>{const e=B(2),{table:n}=s,o=`cascade-restrict-${n}`;let t;return e[0]!==o?(t=d("span",{className:"rounded bg-destructive/10 px-1 text-destructive","data-testid":o,children:"restrict — will block delete"}),e[0]=o,e[1]=t):t=e[1],t},Oo=s=>{const e=B(2),{table:n}=s,o=`cascade-cascade-${n}`;let t;return e[0]!==o?(t=d("span",{className:"rounded bg-warning/10 px-1 text-warning","data-testid":o,children:"cascade"}),e[0]=o,e[1]=t):t=e[1],t},Fo=s=>{const e=B(2),{table:n}=s,o=`cascade-undeclared-${n}`;let t;return e[0]!==o?(t=d("span",{className:"rounded bg-muted px-1 text-muted-foreground","data-testid":o,children:"references — no delete action declared"}),e[0]=o,e[1]=t):t=e[1],t},Mo=s=>s.relation===void 0||s.relation.onDelete==="cascade"?d(Oo,{table:s.table}):s.isRestrict?d(Io,{table:s.table}):d(Fo,{table:s.table}),an=s=>{const e=B(35),{depth:n,node:o}=s,t=`cascade-row-${o.table}`;let c;e[0]!==n?(c=Po(n),e[0]=n,e[1]=c):c=e[1];let l;e[2]!==n?(l=n>0&&d("span",{"aria-hidden":"true",className:"text-muted-foreground",children:"└"}),e[2]=n,e[3]=l):l=e[3];let r;e[4]!==o.table?(r=d("span",{className:"font-medium text-foreground",children:o.table}),e[4]=o.table,e[5]=r):r=e[5];let a;e[6]!==o.relation||e[7]!==o.table?(a=o.relation!==void 0&&E("span",{className:"text-muted-foreground","data-testid":`cascade-col-${o.table}-${o.relation.field}`,children:["via ",o.relation.field]}),e[6]=o.relation,e[7]=o.table,e[8]=a):a=e[8];let i;e[9]!==o.rowCount?(i=o.rowCount.toString(),e[9]=o.rowCount,e[10]=i):i=e[10];let u;e[11]!==i?(u=E("span",{className:"text-muted-foreground",children:["(",i," rows)"]}),e[11]=i,e[12]=u):u=e[12];let m;e[13]!==o?(m=Mo(o),e[13]=o,e[14]=m):m=e[14];let p;e[15]!==o.capNote||e[16]!==o.table?(p=o.capNote!==void 0&&E("span",{className:"italic text-muted-foreground","data-testid":`cascade-cap-${o.table}`,children:["(",o.capNote,")"]}),e[15]=o.capNote,e[16]=o.table,e[17]=p):p=e[17];let b;e[18]!==t||e[19]!==c||e[20]!==l||e[21]!==r||e[22]!==a||e[23]!==u||e[24]!==m||e[25]!==p?(b=E("li",{className:"flex flex-wrap items-center gap-1.5 py-1 font-mono text-xs","data-testid":t,style:c,children:[l,r,a,u,m,p]}),e[18]=t,e[19]=c,e[20]=l,e[21]=r,e[22]=a,e[23]=u,e[24]=m,e[25]=p,e[26]=b):b=e[26];let f;if(e[27]!==n||e[28]!==o.children){let h;e[30]!==n?(h=(x,v)=>d(an,{depth:n+1,node:x},`${x.table}-${x.relation?.field??"root"}-${v.toString()}`),e[30]=n,e[31]=h):h=e[31],f=o.children.map(h),e[27]=n,e[28]=o.children,e[29]=f}else f=e[29];let g;return e[32]!==b||e[33]!==f?(g=E(et,{children:[b,f]}),e[32]=b,e[33]=f,e[34]=g):g=e[34],g},Vo=s=>{const e=s._id??s.id??s.__id__??"";return typeof e=="string"?e:typeof e=="number"?e.toString():""},Lo=async(s,e,n,o)=>{try{const t=await o(s,e,n),c=t.rows.flatMap(a=>Vo(a)||[]).slice(0,at),l=t.total??0;return{capNote:l>at?`showing first ${at.toString()} of ${l.toString()}`:void 0,rowCount:l,rowIds:c}}catch{return{capNote:"count unavailable",rowCount:0,rowIds:[]}}},cn=async(s,e,n,o,t,c,l)=>{const{capNote:r,rowCount:a,rowIds:i}=n===void 0?{capNote:void 0,rowCount:1,rowIds:[e]}:await Lo(s,n.field,e,l),u=n?.onDelete==="restrict",m=[],p=`${s}:${e}`,b=c>=Wt;if(!t.has(p)&&!b){t.add(p);const g=o.get(s)??[];for(const h of g)for(const x of i.slice(0,10)){const v=await cn(h.table,x,h,o,t,c+1,l);(v.rowCount>0||c===0)&&m.push(v)}t.delete(p)}let f=r;if(b){const g=`depth capped at ${Wt.toString()}`;f=r===void 0?g:`${r}; ${g}`}return{capNote:f,children:m,isRestrict:u,relation:n,rowCount:a,rowIds:i,table:s}},Bo=({onClose:s,onConfirm:e,readPage:n,rowId:o,schema:t,table:c})=>{const l=ve(),[r,a]=$(!0),[i,u]=$(null),[m,p]=$(null);ze(()=>{let g=!1;return Ce((async()=>{try{a(!0),p(null);const x=Ro(t);if(!((x.get(c)??[]).length>0)){g||(u({capNote:void 0,children:[],isRestrict:!1,relation:void 0,rowCount:1,rowIds:[o],table:c}),a(!1));return}const y=await cn(c,o,void 0,x,new Set,0,n);g||(u(y),a(!1))}catch(x){g||(p(x.message),a(!1))}})()),()=>{g=!0}},[o,c]);const b=i!==null&&$o(i,g=>g.isRestrict).length>0,f=()=>{e(),s()};return E(ft,{label:"Cascade impact preview",onClose:s,panelTestId:"cascade-panel",testId:"cascade-overlay",variant:"dialog",children:[E("div",{className:"flex items-start justify-between",children:[E("div",{className:"flex flex-col gap-0.5",children:[d("h3",{className:"text-base text-foreground","data-testid":"cascade-title",children:l("Cascade impact")}),d("p",{className:"text-xs text-muted-foreground","data-testid":"cascade-desc",children:l("Delete preview — rows that would cascade or be blocked")})]}),d("button",{className:"text-xs text-muted-foreground hover:text-foreground","data-testid":"cascade-close",onClick:s,type:"button",children:l("Close")})]}),r&&d("p",{className:"text-xs text-muted-foreground","data-testid":"cascade-loading",children:l("Loading…")}),m!==null&&d("p",{className:"text-xs text-destructive","data-testid":"cascade-error",role:"alert",children:m}),!r&&i!==null&&d("ul",{className:"flex flex-col","data-testid":"cascade-tree",children:d(an,{depth:0,node:i})}),!r&&i!==null&&i.children.length===0&&d("p",{className:"text-xs text-muted-foreground","data-testid":"cascade-no-impact",children:l("No related rows found.")}),b&&d("p",{className:"text-sm font-medium text-destructive","data-testid":"cascade-blocker-warning",role:"alert",children:l("Restrict relations will block this delete.")}),E("div",{className:"flex justify-end gap-2",children:[d("button",{className:"rounded-md border border-border px-3 py-1.5 text-xs font-medium text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent","data-testid":"cascade-cancel",onClick:s,type:"button",children:l("Cancel")}),d("button",{className:"rounded-md bg-destructive px-3 py-1.5 text-xs font-medium text-destructive-foreground outline-none transition-colors hover:bg-destructive/90 focus-visible:bg-destructive/90 disabled:pointer-events-none disabled:opacity-50","data-testid":"cascade-confirm",disabled:r,onClick:f,type:"button",children:l("Delete")})]})]})},jo=(s,e,n,o,t=300)=>{if(o<=0)return{ids:new Set(s.map(m=>m.id)),leadPx:0,tailPx:0};const c=n-t,l=n+o+t,r=new Set;let a=0,i=0,u=0;for(const m of s){const p=m.getSize(),b=e.has(m.id),f=a+p>c&&a<l;b||f?r.add(m.id):a<c?i+=p:u+=p,a+=p}return{ids:r,leadPx:i,tailPx:u}},zo=(s,e)=>{const n=new Map;let o=0;for(const t of s)e.has(t.id)&&(n.set(t.id,o),o+=t.getSize());return n},qo=oo({columnOrderingFeature:go,columnResizingFeature:mo,columnSizingFeature:fo,columnVisibilityFeature:uo,rowSelectionFeature:co,rowSortingFeature:io,sortedRowModel:po(),sortFns:{alphanumeric:ao,basic:ro,datetime:lo,text:so}}),Ko=()=>{const s=B(12);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={},s[0]=e):e=s[0];const[n,o]=$(e);let t;s[1]===Symbol.for("react.memo_cache_sentinel")?(t=(g,h,x)=>{o(v=>({...v,[g]:{...v[g],[h]:x}}))},s[1]=t):t=s[1];const c=t;let l;s[2]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{o({})},s[2]=l):l=s[2];const r=l;let a;s[3]===Symbol.for("react.memo_cache_sentinel")?(a=(g,h)=>{o(x=>{const v=x[g];if(v===void 0)return x;const y=Object.fromEntries(Object.entries(v).filter(S=>{const[C,k]=S;return!(C in h)||!Object.is(k,h[C])}));return Object.keys(y).length===0?Object.fromEntries(Object.entries(x).filter(S=>{const[C]=S;return C!==g})):{...x,[g]:y}})},s[3]=a):a=s[3];const i=a;let u;s[4]!==n?(u=(g,h)=>{const x=n[g];return x!==void 0&&h in x?{value:x[h]}:void 0},s[4]=n,s[5]=u):u=s[5];const m=u;let p;s[6]!==n?(p=Object.values(n).reduce(Jo,0),s[6]=n,s[7]=p):p=s[7];const b=p;let f;return s[8]!==b||s[9]!==n||s[10]!==m?(f={clear:r,count:b,drop:i,stage:c,staged:n,stagedValue:m},s[8]=b,s[9]=n,s[10]=m,s[11]=f):f=s[11],f},dn=(s,e)=>{if(typeof e=="number"){const n=Number(s);return s.trim()===""||Number.isNaN(n)?s:n}if(typeof e=="boolean"){if(s==="true")return!0;if(s==="false")return!1}return s},Go=s=>{const e=B(29),{changes:n,committing:o,onCommit:t,onDiscard:c}=s,l=ve();let r;e[0]!==n.length||e[1]!==l?(r=l("{count} pending changes",{count:n.length}),e[0]=n.length,e[1]=l,e[2]=r):r=e[2];let a;e[3]!==r?(a=d("span",{className:"font-mono text-[11px] tracking-wide uppercase text-warning","data-testid":"db-staged-count",children:r}),e[3]=r,e[4]=a):a=e[4];let i;e[5]!==o||e[6]!==l?(i=l(o?"Committing…":"Commit"),e[5]=o,e[6]=l,e[7]=i):i=e[7];let u;e[8]!==o||e[9]!==t||e[10]!==i?(u=d("button",{className:"ms-auto rounded-md bg-primary px-2.5 py-1 text-xs font-medium text-primary-foreground outline-none transition-colors hover:bg-primary/90 focus-visible:bg-primary/90 disabled:pointer-events-none disabled:opacity-50","data-testid":"db-staged-commit",disabled:o,onClick:t,type:"button",children:i}),e[8]=o,e[9]=t,e[10]=i,e[11]=u):u=e[11];let m;e[12]!==l?(m=l("Discard"),e[12]=l,e[13]=m):m=e[13];let p;e[14]!==o||e[15]!==c||e[16]!==m?(p=d("button",{className:"rounded-md border border-border px-2.5 py-1 text-xs font-medium text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-50","data-testid":"db-staged-discard",disabled:o,onClick:c,type:"button",children:m}),e[14]=o,e[15]=c,e[16]=m,e[17]=p):p=e[17];let b;e[18]!==a||e[19]!==u||e[20]!==p?(b=E("div",{className:"flex flex-wrap items-center gap-2",children:[a,u,p]}),e[18]=a,e[19]=u,e[20]=p,e[21]=b):b=e[21];let f;e[22]!==n?(f=n.map(Wo),e[22]=n,e[23]=f):f=e[23];let g;e[24]!==f?(g=d("ul",{className:"flex flex-col gap-1","data-testid":"db-staged-list",children:f}),e[24]=f,e[25]=g):g=e[25];let h;return e[26]!==b||e[27]!==g?(h=E("div",{className:"flex flex-col gap-2 border border-warning/40 bg-warning/5 p-3","data-testid":"db-staged",children:[b,g]}),e[26]=b,e[27]=g,e[28]=h):h=e[28],h};function Jo(s,e){return s+Object.keys(e).length}function Wo(s){return E("li",{className:"flex flex-wrap items-center gap-2 font-mono text-xs",children:[E("span",{className:"text-muted-foreground",children:[s.rowId,".",s.column]}),d("span",{className:"text-destructive line-through",children:Me(s.oldValue)}),d("span",{"aria-hidden":"true",className:"text-muted-foreground",children:"→"}),d("span",{className:"text-foreground",children:Me(s.newValue)})]},`${s.rowId}:${s.column}`)}const Ht=400,Ho=36,Uo={flex:"1 1 0%",minHeight:0,overflow:"auto",position:"relative"},Qo={width:"100%"},Yo=/\n$/u,Xo={alignItems:"center",display:"flex",left:0,position:"absolute",top:0,width:"100%"},Zo={display:"flex",width:"100%"},Ut={flex:"0 0 8.5rem",padding:"0.375rem 0.75rem"},es="2.5rem",un={alignItems:"center",display:"flex",flex:"0 0 2.5rem",justifyContent:"center",left:0,padding:"0.375rem 0",position:"sticky",zIndex:2},Ft=s=>({flex:"0 0 auto",overflow:"hidden",padding:"0.375rem 0.75rem",position:"relative",textOverflow:"ellipsis",whiteSpace:"nowrap",width:`${s.toString()}px`}),fn=(s,e)=>({...Ft(s),left:`calc(${es} + ${e.toString()}px)`,position:"sticky",zIndex:2}),Et="rounded-md px-2 py-0.5 text-xs font-medium text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-50",ts=(s,e,n)=>e.enabled&&e.columns.has(n)?void 0:s,At="__back__:",ns=s=>`${At}${s.table}.${s.column}`,os=s=>{const e=B(3),{counts:n,rowId:o}=s;if(n===void 0){let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=d("span",{className:"text-muted-foreground/50",children:"—"}),e[0]=l):l=e[0],l}const t=n[o]??0;let c;return e[1]!==t?(c=d("span",{className:"tabular-nums",children:t}),e[1]=t,e[2]=c):c=e[2],c},Ie=s=>{for(const e of["id","__id__","_id"]){const n=s[e];if(typeof n=="string"||typeof n=="number")return String(n)}return null},ss=(s,e)=>{if(e.enumValues!==void 0&&e.enumValues.length>0)return e.enumValues.includes(s)||s===""&&e.nullable===!0?{value:s===""?null:s}:void 0;if(e.type==="boolean")return s==="true"||s==="false"?{value:s==="true"}:void 0;if(e.type==="number"){const n=Number(s);return s.trim()===""||!Number.isFinite(n)?void 0:{value:n}}return{value:s}},ls=(s,e,n)=>{if(n!==void 0&&n.type!=="any")return ss(s,n);const o=dn(s,e);return typeof e=="number"&&typeof o!="number"?void 0:{value:o}},rs=({anchor:s,columnIds:e,columnMeta:n,editableColumn:o,rows:t,text:c})=>{const l=c.replaceAll(`\r
|
|
2
|
+
`,`
|
|
3
|
+
`).replace(Yo,"").split(`
|
|
4
|
+
`),r=[];let a=0;for(const[i,u]of l.entries()){const m=t[s.row+i],p=m===void 0?null:Ie(m),b=u.split(" ");if(m===void 0||p===null){a+=b.length;continue}for(const[f,g]of b.entries()){const h=e[s.col+f],x=h===void 0||!o(h)?void 0:ls(g,m[h],n?.[h]);h===void 0||x===void 0?a+=1:r.push({column:h,rowId:p,value:x.value})}}return{edits:r,skipped:a}},mn=(s,e)=>Ie(s)??`row-${e.toString()}`,as=8,is=s=>{const e=B(17),{anchor:n,mask:o,state:t}=s,c=ve();let l;e[0]!==n.left||e[1]!==n.top?(l={left:n.left,position:"fixed",top:n.top,zIndex:50},e[0]=n.left,e[1]=n.top,e[2]=l):l=e[2];const r=l;let a;if(t==="loading"){let u;e[3]!==c?(u=c("Loading…"),e[3]=c,e[4]=u):u=e[4];let m;e[5]!==u?(m=d("p",{className:"px-3 py-2 text-xs text-muted-foreground",children:u}),e[5]=u,e[6]=m):m=e[6],a=m}else if(t.row===null){let u;e[7]!==c?(u=c("No matching row."),e[7]=c,e[8]=u):u=e[8];let m;e[9]!==u?(m=d("p",{className:"px-3 py-2 text-xs text-muted-foreground",children:u}),e[9]=u,e[10]=m):m=e[10],a=m}else{let u;if(e[11]!==o||e[12]!==t.row){const m=Object.entries(sn(t.row,o)).slice(0,as);u=d("dl",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 px-3 py-2",children:m.map(ws)}),e[11]=o,e[12]=t.row,e[13]=u}else u=e[13];a=u}let i;return e[14]!==a||e[15]!==r?(i=d("div",{className:"pointer-events-none w-72 overflow-hidden rounded-md border border-border bg-popover text-popover-foreground","data-testid":"db-ref-preview",role:"tooltip",style:r,children:a}),e[14]=a,e[15]=r,e[16]=i):i=e[16],i},cs=s=>{const e=B(24),{column:n,id:o,maskViewFor:t,onNavigate:c,onPreview:l,target:r}=s,[a,i]=$(null),[u,m]=$("idle");let p;e[0]!==o||e[1]!==c||e[2]!==r?(p=()=>{c(r,o)},e[0]=o,e[1]=c,e[2]=r,e[3]=p):p=e[3];const b=p;let f;e[4]!==o||e[5]!==l||e[6]!==u||e[7]!==r?(f=N=>{const w=N.currentTarget.getBoundingClientRect();if(i({left:w.left,top:w.bottom+4}),u!=="idle")return;m("loading"),Ce((async()=>{try{m({row:await l(r,o)})}catch{m({row:null})}})())},e[4]=o,e[5]=l,e[6]=u,e[7]=r,e[8]=f):f=e[8];const g=f;let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=()=>{i(null)},e[9]=h):h=e[9];const x=h,v=`db-ref-${n}`,y=`Open ${r} ${o}`;let S;e[10]!==o||e[11]!==b||e[12]!==g||e[13]!==v||e[14]!==y?(S=E("button",{"data-testid":v,onBlur:x,onClick:b,onFocus:g,onMouseEnter:g,onMouseLeave:x,title:y,type:"button",children:[o," ↗"]}),e[10]=o,e[11]=b,e[12]=g,e[13]=v,e[14]=y,e[15]=S):S=e[15];let C;e[16]!==a||e[17]!==t||e[18]!==u||e[19]!==r?(C=a!==null&&u!=="idle"&&d(is,{anchor:a,mask:t(r,u==="loading"||u.row===null?[]:Object.keys(u.row)),state:u}),e[16]=a,e[17]=t,e[18]=u,e[19]=r,e[20]=C):C=e[20];let k;return e[21]!==S||e[22]!==C?(k=E(et,{children:[S,C]}),e[21]=S,e[22]=C,e[23]=k):k=e[23],k},ds=s=>s==="asc"?" ▲":s==="desc"?" ▼":"",us="absolute end-1 top-1/2 hidden -translate-y-1/2 items-center justify-center rounded text-muted-foreground outline-none group-hover/cell:flex hover:text-foreground focus-visible:flex",Qt=s=>{const e=B(9),{column:n,onExpand:o,storedValue:t,value:c}=s;let l;e[0]!==n||e[1]!==o||e[2]!==t||e[3]!==c?(l=()=>{o(n,c,t)},e[0]=n,e[1]=o,e[2]=t,e[3]=c,e[4]=l):l=e[4];const r=l,a=`db-expand-${n}`;let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=d("svg",{"aria-hidden":"true",className:"size-3",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:d("path",{d:"M9 21H5a2 2 0 0 1-2-2v-4m18 0v4a2 2 0 0 1-2 2h-4M3 9V5a2 2 0 0 1 2-2h4m6 0h4a2 2 0 0 1 2 2v4"})}),e[5]=i):i=e[5];let u;return e[6]!==r||e[7]!==a?(u=d("button",{"aria-label":"Expand cell",className:us,"data-testid":a,onClick:r,type:"button",children:i}),e[6]=r,e[7]=a,e[8]=u):u=e[8],u},fs=s=>{const e=B(15),{column:n,initial:o,onCancel:t,onCommit:c,recordId:l}=s,r=Ke(null);let a,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=()=>{r.current?.select()},i=[],e[0]=a,e[1]=i):(a=e[0],i=e[1]),ze(a,i);let u;e[2]!==t||e[3]!==c?(u=x=>{x.key==="Enter"?(x.preventDefault(),c(x.currentTarget.value)):x.key==="Escape"&&(x.preventDefault(),t())},e[2]=t,e[3]=c,e[4]=u):u=e[4];const m=u;let p;e[5]!==c?(p=x=>{c(x.currentTarget.value)},e[5]=c,e[6]=p):p=e[6];const b=p,f=`db-cell-input-${l}-${n}`;let g;e[7]!==o?(g=Me(o),e[7]=o,e[8]=g):g=e[8];let h;return e[9]!==n||e[10]!==b||e[11]!==m||e[12]!==f||e[13]!==g?(h=d("input",{"aria-label":n,className:"w-full rounded border border-ring bg-background px-1 py-0.5 font-mono text-xs outline-none","data-testid":f,defaultValue:g,onBlur:b,onKeyDown:m,ref:r}),e[9]=n,e[10]=b,e[11]=m,e[12]=f,e[13]=g,e[14]=h):h=e[14],h},ms=s=>{const e=B(71),{cell:n,edit:o,highlight:t,mask:c,refs:l}=s,r=n.column.id;let a,i,u,m;if(e[0]!==n||e[1]!==r||e[2]!==o||e[3]!==c||e[4]!==l.columns||e[5]!==l.maskViewFor||e[6]!==l.onNavigate||e[7]!==l.onPreview){m=Symbol.for("react.early_return_sentinel");e:{i=n.getValue(),a=Ie(n.row.original);const R=l.columns?.[r];if(c.enabled&&c.columns.has(r)){const _=`db-masked-${r}`,D=d(Tt,{value:Hn(i,r,c)});let O;e[12]!==_||e[13]!==D?(O=d("span",{className:"text-muted-foreground italic","data-testid":_,title:"Masked (preview)",children:D}),e[12]=_,e[13]=D,e[14]=O):O=e[14],m=O;break e}if(R!==void 0&&(typeof i=="string"||typeof i=="number")&&String(i)!==""){const _=String(i),D=`${R}:${String(i)}`;let O;e[15]!==r||e[16]!==l.maskViewFor||e[17]!==l.onNavigate||e[18]!==l.onPreview||e[19]!==_||e[20]!==D||e[21]!==R?(O=d(cs,{column:r,id:_,maskViewFor:l.maskViewFor,onNavigate:l.onNavigate,onPreview:l.onPreview,target:R},D),e[15]=r,e[16]=l.maskViewFor,e[17]=l.onNavigate,e[18]=l.onPreview,e[19]=_,e[20]=D,e[21]=R,e[22]=O):O=e[22],m=O;break e}if(a===null){let _;e[23]!==i?(_=d(Tt,{value:i}),e[23]=i,e[24]=_):_=e[24];let D;e[25]!==r||e[26]!==o.onExpandCell||e[27]!==i?(D=d(Qt,{column:r,onExpand:o.onExpandCell,storedValue:i,value:i}),e[25]=r,e[26]=o.onExpandCell,e[27]=i,e[28]=D):D=e[28];let O;e[29]!==_||e[30]!==D?(O=E(et,{children:[_,D]}),e[29]=_,e[30]=D,e[31]=O):O=e[31],m=O;break e}u=o.stagedValue(a,r)}e[0]=n,e[1]=r,e[2]=o,e[3]=c,e[4]=l.columns,e[5]=l.maskViewFor,e[6]=l.onNavigate,e[7]=l.onPreview,e[8]=a,e[9]=i,e[10]=u,e[11]=m}else a=e[8],i=e[9],u=e[10],m=e[11];if(m!==Symbol.for("react.early_return_sentinel"))return m;const p=u,b=p===void 0?i:p.value;let f;e[32]!==r||e[33]!==o?(f=o.editable&&o.editableColumn(r),e[32]=r,e[33]=o,e[34]=f):f=e[34];const g=f;if(o.editingCell!==null&&o.editingCell.rowId===a&&o.editingCell.column===r){let R;e[35]!==r||e[36]!==o||e[37]!==a||e[38]!==i?(R=D=>{o.stage(a,r,dn(D,i)),o.cancelEdit()},e[35]=r,e[36]=o,e[37]=a,e[38]=i,e[39]=R):R=e[39];let _;return e[40]!==r||e[41]!==b||e[42]!==o.cancelEdit||e[43]!==a||e[44]!==R?(_=d(fs,{column:r,initial:b,onCancel:o.cancelEdit,onCommit:R,recordId:a}),e[40]=r,e[41]=b,e[42]=o.cancelEdit,e[43]=a,e[44]=R,e[45]=_):_=e[45],_}let x;p!==void 0?x="rounded bg-warning/15 px-1":g&&(x="cursor-text");let v;e[46]!==g||e[47]!==r||e[48]!==o||e[49]!==a?(v=g?()=>{o.startEdit(a,r)}:void 0,e[46]=g,e[47]=r,e[48]=o,e[49]=a,e[50]=v):v=e[50];const y=v,S=x,C=`db-cell-${a}-${r}`;let k;e[51]!==r||e[52]!==t||e[53]!==c?(k=ts(t,c,r),e[51]=r,e[52]=t,e[53]=c,e[54]=k):k=e[54];let N;e[55]!==b||e[56]!==k?(N=d(Tt,{highlight:k,value:b}),e[55]=b,e[56]=k,e[57]=N):N=e[57];let w;e[58]!==x||e[59]!==y||e[60]!==C||e[61]!==N?(w=d("span",{className:S,"data-testid":C,onDoubleClick:y,children:N}),e[58]=x,e[59]=y,e[60]=C,e[61]=N,e[62]=w):w=e[62];let T;e[63]!==r||e[64]!==b||e[65]!==o.onExpandCell||e[66]!==i?(T=d(Qt,{column:r,onExpand:o.onExpandCell,storedValue:i,value:b}),e[63]=r,e[64]=b,e[65]=o.onExpandCell,e[66]=i,e[67]=T):T=e[67];let F;return e[68]!==T||e[69]!==w?(F=E(et,{children:[w,T]}),e[68]=T,e[69]=w,e[70]=F):F=e[70],F},gs=s=>{s.preventDefault()},Yt={any:"?",array:"[]",bigint:"#",boolean:"01",bytes:"0x",id:"→",number:"#",object:"{}",storage:"◫",string:"T",union:"|"},ps=({declaredType:s,draggedRef:e,header:n,masked:o=!1,onTogglePin:t,pinnedOffset:c,table:l})=>{const r=()=>{e.current=n.column.id},a=()=>{const i=e.current,u=n.column.id;if(e.current=null,i===null||i===u)return;const m=l.atoms.columnOrder.get(),b=(m.length>0?m:l.getAllLeafColumns().map(g=>g.id)).filter(g=>g!==i),f=b.indexOf(u);b.splice(f===-1?b.length:f,0,i),l.setColumnOrder(b)};return E("th",{className:dt("group/head text-start text-xs font-medium text-muted-foreground",c!==void 0&&"border-e border-border bg-muted"),"data-testid":`db-head-${n.column.id}`,draggable:!0,onDragOver:gs,onDragStart:r,onDrop:a,style:c===void 0?Ft(n.getSize()):fn(n.getSize(),c),children:[E("button",{className:"inline-flex max-w-full cursor-grab items-center gap-1 truncate outline-none hover:text-foreground","data-testid":`db-sort-${n.column.id}`,onClick:n.column.getToggleSortingHandler(),type:"button",children:[ho(n.column.columnDef.header,n.getContext()),ds(n.column.getIsSorted())]}),s!==void 0&&Yt[s]!==void 0&&d("span",{className:"ms-1 font-mono text-[0.625rem] text-muted-foreground/70","data-testid":`db-type-${n.column.id}`,title:s,children:Yt[s]}),o&&d("span",{className:"ms-1 inline-flex items-center rounded-sm bg-warning/15 px-1 text-[0.625rem] font-medium uppercase text-warning","data-testid":`db-mask-chip-${n.column.id}`,title:"This column is masked by a mask() policy",children:"masked"}),d("button",{"aria-label":c===void 0?`Pin ${n.column.id}`:`Unpin ${n.column.id}`,"aria-pressed":c!==void 0,className:dt("ms-1 rounded-sm px-1 text-[0.625rem] outline-none transition-opacity hover:bg-accent focus-visible:bg-accent",c===void 0?"opacity-0 group-hover/head:opacity-100 focus-visible:opacity-100":"opacity-100 text-foreground"),"data-testid":`db-pin-${n.column.id}`,onClick:()=>{t(n.column.id)},type:"button",children:"📌"}),d("span",{"aria-hidden":"true",className:"absolute inset-y-0 end-0 w-1 cursor-col-resize touch-none select-none hover:bg-ring/60 data-[resizing=true]:bg-ring","data-resizing":n.column.getIsResizing(),"data-testid":`db-resize-${n.column.id}`,onMouseDown:n.getResizeHandler(),onTouchStart:n.getResizeHandler()})]})},bs=s=>{const e=B(13),{table:n}=s,o=ve();let t;e[0]!==n?(t=u=>{n.toggleAllRowsSelected(u)},e[0]=n,e[1]=t):t=e[1];const c=t;let l;e[2]!==o?(l=o("Select all rows"),e[2]=o,e[3]=l):l=e[3];let r;e[4]!==n?(r=n.getIsAllRowsSelected(),e[4]=n,e[5]=r):r=e[5];let a;e[6]!==n?(a=n.getIsSomeRowsSelected()&&!n.getIsAllRowsSelected(),e[6]=n,e[7]=a):a=e[7];let i;return e[8]!==c||e[9]!==l||e[10]!==r||e[11]!==a?(i=d("th",{className:"bg-muted",style:un,children:d(It,{"aria-label":l,checked:r,"data-testid":"db-select-all",indeterminate:a,onCheckedChange:c})}),e[8]=c,e[9]=l,e[10]=r,e[11]=a,e[12]=i):i=e[12],i},hs=s=>{const e=B(17),{row:n}=s,o=ve();let t;e[0]!==n.original?(t=Ie(n.original),e[0]=n.original,e[1]=t):t=e[1];const c=t;let l;e[2]!==n?(l=f=>{n.toggleSelected(f)},e[2]=n,e[3]=l):l=e[3];const r=l;let a;e[4]!==o?(a=o("Select row"),e[4]=o,e[5]=a):a=e[5];let i;e[6]!==n?(i=n.getIsSelected(),e[6]=n,e[7]=i):i=e[7];let u;e[8]!==n.index||e[9]!==n.original?(u=mn(n.original,n.index),e[8]=n.index,e[9]=n.original,e[10]=u):u=e[10];const m=`db-select-${u}`,p=c===null;let b;return e[11]!==r||e[12]!==a||e[13]!==i||e[14]!==m||e[15]!==p?(b=d("td",{className:"bg-background",style:un,children:d(It,{"aria-label":a,checked:i,"data-testid":m,disabled:p,onCheckedChange:r})}),e[11]=r,e[12]=a,e[13]=i,e[14]=m,e[15]=p,e[16]=b):b=e[16],b},xs=s=>{const e=B(91),{columnMeta:n,edit:o,editable:t,mask:c,onDelete:l,onEdit:r,onInspect:a,highlight:i,backRelationCounts:u,onTogglePin:m,pinnedColumns:p,refs:b,tableModel:f}=s,g=ve(),{attachScroll:h,scrollLeft:x,scrollToIndex:v,table:y,tableRows:S,tbodyStyle:C,viewportWidth:k,virtualRows:N}=f,w=Ke(null),[T,F]=$(null);let R;e[0]===Symbol.for("react.memo_cache_sentinel")?(R={columns:"",count:0},e[0]=R):R=e[0];const[_,D]=$(R);let O;e[1]!==y?(O=y.getVisibleLeafColumns(),e[1]=y,e[2]=O):O=e[2];const V=O.length;let A;e[3]!==T||e[4]!==V||e[5]!==o||e[6]!==y||e[7]!==S?(A=re=>{if(!["ArrowDown","ArrowLeft","ArrowRight","ArrowUp","Enter"].includes(re.key))return;re.preventDefault();const X=T??{col:0,row:0};if(re.key==="Enter"){const xe=S[X.row],de=y.getVisibleLeafColumns()[X.col];if(xe!==void 0&&de!==void 0){const te=Ie(xe.original);te!==null&&o.editableColumn(de.id)&&o.startEdit(te,de.id)}F(X);return}let{col:ee,row:we}=X;e:switch(re.key){case"ArrowDown":{we=Math.min(we+1,S.length-1);break e}case"ArrowRight":{ee=Math.min(ee+1,V-1);break e}case"ArrowUp":{we=Math.max(we-1,0);break e}default:ee=Math.max(ee-1,0)}F({col:ee,row:we})},e[3]=T,e[4]=V,e[5]=o,e[6]=y,e[7]=S,e[8]=A):A=e[8];const L=A;let G;e[9]!==T||e[10]!==n||e[11]!==o||e[12]!==y||e[13]!==S?(G=re=>{const X=o.editable?re.clipboardData.getData("text/plain"):"";if(X==="")return;re.preventDefault();const ee=y.getVisibleLeafColumns().map(ys),we=rs({anchor:T??{col:0,row:0},columnIds:ee,columnMeta:n,editableColumn:o.editableColumn,rows:S.map(Cs),text:X});for(const xe of we.edits)o.stage(xe.rowId,xe.column,xe.value);D({columns:ee.join("\0"),count:we.skipped})},e[9]=T,e[10]=n,e[11]=o,e[12]=y,e[13]=S,e[14]=G):G=e[14];const q=G;let P,J;e[15]!==T||e[16]!==v?(P=()=>{T!==null&&v(T.row)},J=[T,v],e[15]=T,e[16]=v,e[17]=P,e[18]=J):(P=e[17],J=e[18]),ze(P,J);let K,H,Y,U,ne,le,ae,ge,fe,me,pe,ie,Q,be,ce,Se;if(e[19]!==T||e[20]!==h||e[21]!==u||e[22]!==n||e[23]!==o||e[24]!==t||e[25]!==i||e[26]!==c||e[27]!==l||e[28]!==r||e[29]!==L||e[30]!==q||e[31]!==a||e[32]!==m||e[33]!==_.columns||e[34]!==_.count||e[35]!==p||e[36]!==b||e[37]!==x||e[38]!==g||e[39]!==y||e[40]!==S||e[41]!==C||e[42]!==k||e[43]!==N){const re=y.getVisibleLeafColumns().map(Ss),X=jo(re,p,x,k),ee=zo(y.getVisibleLeafColumns().map(Ns),p),we=te=>{const De=S[te.index],{original:Ve}=De,Le=Ie(Ve),Ne=mn(Ve,te.index),ue={...Xo,height:`${te.size.toString()}px`,transform:`translateY(${te.start.toString()}px)`};return E("tr",{className:"border-b border-border text-xs transition-colors hover:bg-muted/50","data-testid":"db-row",style:ue,children:[d(hs,{row:De}),X.leadPx>0&&d("td",{"aria-hidden":"true",style:{flex:`0 0 ${X.leadPx.toString()}px`}}),De.getVisibleCells().map((ke,Ge)=>{if(!X.ids.has(ke.column.id))return null;const qe=ee.get(ke.column.id),He=T!==null&&T.row===te.index&&T.col===Ge?" ring-1 ring-ring ring-inset":"";return d("td",{className:dt("group/cell truncate font-mono text-muted-foreground",qe!==void 0&&"border-e border-border bg-background",He),onPointerDown:()=>{F({col:Ge,row:te.index})},style:qe===void 0?Ft(ke.column.getSize()):fn(ke.column.getSize(),qe),children:ke.column.id.startsWith(At)?d(os,{counts:u[ke.column.id.slice(At.length)],rowId:Ne}):d(ms,{cell:ke,edit:o,highlight:i,mask:c,refs:b})},ke.id)}),X.tailPx>0&&d("td",{"aria-hidden":"true",style:{flex:`0 0 ${X.tailPx.toString()}px`}}),E("td",{className:"flex items-center gap-1",style:Ut,children:[d("button",{className:Et,"data-testid":`db-inspect-${Ne}`,onClick:()=>{a(Ve)},type:"button",children:"Details"}),t&&E(et,{children:[d("button",{className:Et,"data-testid":`db-edit-${Ne}`,disabled:Le===null,onClick:()=>{r(Le,Ve)},type:"button",children:"Edit"}),d("button",{className:Et,"data-testid":`db-delete-${Ne}`,disabled:Le===null,onClick:()=>{l(Le)},type:"button",children:"Delete"})]})]})]},De.id)};K=wo,ie="fill",e[60]!==_.columns||e[61]!==_.count||e[62]!==g||e[63]!==y?(Q=_.count>0&&_.columns===y.getVisibleLeafColumns().map(ks).join("\0")&&d("p",{className:"border-b border-warning/40 bg-warning/5 px-3 py-1.5 text-xs text-warning","data-testid":"db-paste-skipped",children:g("{count} pasted cells were skipped",{count:_.count})}),e[60]=_.columns,e[61]=_.count,e[62]=g,e[63]=y,e[64]=Q):Q=e[64],ne="db-scroll",le=L,ae=q,ge=h,fe="grid",me=Uo,pe=0,Se="w-full text-xs",H="db-rows",Y=Qo;let xe;e[65]!==y?(xe=d(bs,{table:y}),e[65]=y,e[66]=xe):xe=e[66];let de;e[67]===Symbol.for("react.memo_cache_sentinel")?(de=d("th",{"aria-label":"Row actions",style:Ut}),e[67]=de):de=e[67],U=d("thead",{className:"bg-muted/50",children:E("tr",{className:"border-b border-border",style:Zo,children:[xe,X.leadPx>0&&d("th",{"aria-hidden":"true",style:{flex:`0 0 ${X.leadPx.toString()}px`}}),y.getFlatHeaders().map(te=>X.ids.has(te.column.id)?d(ps,{declaredType:n?.[te.column.id]?.type,draggedRef:w,header:te,masked:c.columns.has(te.column.id),onTogglePin:m,pinnedOffset:ee.get(te.column.id),table:y},te.id):null),X.tailPx>0&&d("th",{"aria-hidden":"true",style:{flex:`0 0 ${X.tailPx.toString()}px`}}),de]})}),be=C,ce=N.map(te=>we(te)),e[19]=T,e[20]=h,e[21]=u,e[22]=n,e[23]=o,e[24]=t,e[25]=i,e[26]=c,e[27]=l,e[28]=r,e[29]=L,e[30]=q,e[31]=a,e[32]=m,e[33]=_.columns,e[34]=_.count,e[35]=p,e[36]=b,e[37]=x,e[38]=g,e[39]=y,e[40]=S,e[41]=C,e[42]=k,e[43]=N,e[44]=K,e[45]=H,e[46]=Y,e[47]=U,e[48]=ne,e[49]=le,e[50]=ae,e[51]=ge,e[52]=fe,e[53]=me,e[54]=pe,e[55]=ie,e[56]=Q,e[57]=be,e[58]=ce,e[59]=Se}else K=e[44],H=e[45],Y=e[46],U=e[47],ne=e[48],le=e[49],ae=e[50],ge=e[51],fe=e[52],me=e[53],pe=e[54],ie=e[55],Q=e[56],be=e[57],ce=e[58],Se=e[59];let oe;e[68]!==be||e[69]!==ce?(oe=d("tbody",{style:be,children:ce}),e[68]=be,e[69]=ce,e[70]=oe):oe=e[70];let se;e[71]!==H||e[72]!==Y||e[73]!==U||e[74]!==oe||e[75]!==Se?(se=E("table",{className:Se,"data-testid":H,style:Y,children:[U,oe]}),e[71]=H,e[72]=Y,e[73]=U,e[74]=oe,e[75]=Se,e[76]=se):se=e[76];let W;e[77]!==ne||e[78]!==le||e[79]!==ae||e[80]!==ge||e[81]!==fe||e[82]!==me||e[83]!==pe||e[84]!==se?(W=d("div",{"data-testid":ne,onKeyDown:le,onPaste:ae,ref:ge,role:fe,style:me,tabIndex:pe,children:se}),e[77]=ne,e[78]=le,e[79]=ae,e[80]=ge,e[81]=fe,e[82]=me,e[83]=pe,e[84]=se,e[85]=W):W=e[85];let j;return e[86]!==K||e[87]!==ie||e[88]!==Q||e[89]!==W?(j=E(K,{layout:ie,children:[Q,W]}),e[86]=K,e[87]=ie,e[88]=Q,e[89]=W,e[90]=j):j=e[90],j},vs=(s,e,n,o=[])=>{const t=s?.columns,c=s?.rows,l=s?.refs,r=$t(()=>{if(t===void 0)return[];const w=t.map(T=>({accessorFn:F=>F[T],header:l?.[T]===void 0?T:`${T} →`,id:T}));for(const T of o)w.push({accessorFn:()=>{},enableSorting:!1,header:`← ${T.table}`,id:ns(T)});return w},[o,t,l]),a=$t(()=>c??[],[c]),[i,u]=$({}),[m,p]=$({}),b=bo({columnResizeMode:"onChange",columns:r,data:a,defaultColumn:{minSize:80,size:200},enableColumnResizing:!0,enableRowSelection:w=>Ie(w.original)!==null,features:qo,getRowId:(w,T)=>Ie(w)??`row-${T.toString()}`,manualSorting:!0,onColumnVisibilityChange:p,onRowSelectionChange:u,onSortingChange:n,state:{columnVisibility:m,rowSelection:i,sorting:e}}),f=b.getRowModel().rows,g=Ke(null),h=xo({count:f.length,estimateSize:()=>Ho,getScrollElement:()=>g.current,initialRect:{height:Ht,width:0},observeElementRect:(w,T)=>vo(w,T,Ht),overscan:8}),x=ct(w=>{h.scrollToIndex(w)},[h]),[v,y]=$({left:0,width:0}),S=ct(w=>{if(g.current=w,w===null)return;const T=()=>{y(R=>R.left===w.scrollLeft&&R.width===w.clientWidth?R:{left:w.scrollLeft,width:w.clientWidth})};w.addEventListener("scroll",T,{passive:!0});const F=new ResizeObserver(T);return F.observe(w),()=>{w.removeEventListener("scroll",T),F.disconnect(),g.current=null}},[]),C=h.getVirtualItems(),N={display:"block",height:`${h.getTotalSize().toString()}px`,position:"relative"};return{attachScroll:S,scrollLeft:v.left,scrollToIndex:x,table:b,tableRows:f,tbodyStyle:N,viewportWidth:v.width,virtualRows:C}};function ws(s){const[e,n]=s;return E("div",{className:"contents",children:[d("dt",{className:"truncate font-mono text-[11px] text-muted-foreground",children:e}),d("dd",{className:"truncate font-mono text-[11px] text-foreground",title:Me(n),children:Me(n)})]},e)}function ys(s){return s.id}function Cs(s){return s.original}function Ss(s){return{getSize:()=>s.getSize(),id:s.id}}function Ns(s){return{getSize:()=>s.getSize(),id:s.id}}function ks(s){return s.id}const Ts=s=>{const e=B(22),{onCommit:n}=s,o=ve(),[t,c]=$(""),l=Ke(null);let r,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{l.current?.focus()},a=[],e[0]=r,e[1]=a):(r=e[0],a=e[1]),ze(r,a);let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=y=>{c(y.target.value)},e[2]=i):i=e[2];const u=i;let m;e[3]!==t||e[4]!==n?(m=()=>{const y=t.trim();y!==""&&n(y)},e[3]=t,e[4]=n,e[5]=m):m=e[5];const p=m;let b;e[6]!==o?(b=o("Query name"),e[6]=o,e[7]=b):b=e[7];let f;e[8]!==o?(f=o("Query name"),e[8]=o,e[9]=f):f=e[9];let g;e[10]!==t||e[11]!==b||e[12]!==f?(g=d("input",{"aria-label":b,className:"h-7 rounded-md border border-border bg-background px-2 text-xs outline-none focus-visible:border-ring","data-testid":"db-save-query-name",onChange:u,placeholder:f,ref:l,value:t}),e[10]=t,e[11]=b,e[12]=f,e[13]=g):g=e[13];let h;e[14]!==o?(h=o("Save"),e[14]=o,e[15]=h):h=e[15];let x;e[16]!==p||e[17]!==h?(x=d("button",{className:Dt,"data-testid":"db-save-query-confirm",onClick:p,type:"button",children:h}),e[16]=p,e[17]=h,e[18]=x):x=e[18];let v;return e[19]!==g||e[20]!==x?(v=E("span",{className:"inline-flex items-center gap-1",children:[g,x]}),e[19]=g,e[20]=x,e[21]=v):v=e[21],v},Es=s=>{const e=B(27),{onApply:n,onCopyLink:o,onDelete:t,onSave:c,saved:l}=s,r=ve(),[a,i]=$(!1);let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{i(!0)},e[0]=u):u=e[0];const m=u;let p;e[1]!==c?(p=N=>{c(N),i(!1)},e[1]=c,e[2]=p):p=e[2];const b=p;let f;e[3]!==n||e[4]!==l?(f=N=>{const w=l[Number(N.currentTarget.dataset.index)];w!==void 0&&n(w)},e[3]=n,e[4]=l,e[5]=f):f=e[5];const g=f;let h;e[6]!==t||e[7]!==l?(h=N=>{const w=l[Number(N.currentTarget.dataset.index)];w!==void 0&&t(w.name)},e[6]=t,e[7]=l,e[8]=h):h=e[8];const x=h;let v;e[9]!==r?(v=r("Copy link"),e[9]=r,e[10]=v):v=e[10];let y;e[11]!==o||e[12]!==v?(y=d("button",{className:Dt,"data-testid":"db-copy-link",onClick:o,type:"button",children:v}),e[11]=o,e[12]=v,e[13]=y):y=e[13];let S;e[14]!==b||e[15]!==a||e[16]!==r?(S=a?d(Ts,{onCommit:b}):d("button",{className:Dt,"data-testid":"db-save-query",onClick:m,type:"button",children:r("Save query")}),e[14]=b,e[15]=a,e[16]=r,e[17]=S):S=e[17];let C;e[18]!==g||e[19]!==x||e[20]!==l||e[21]!==r?(C=l.length>0&&E("div",{className:"flex flex-wrap items-center gap-1","data-testid":"db-saved-queries",children:[d("span",{className:"font-mono text-[11px] tracking-wide uppercase text-muted-foreground",children:r("Saved")}),l.map((N,w)=>E("span",{className:"inline-flex items-center overflow-hidden rounded-md border border-border",children:[d("button",{className:"px-2 py-0.5 text-xs text-foreground transition-colors hover:bg-accent","data-index":w,"data-testid":`db-saved-query-${N.name}`,onClick:g,type:"button",children:N.name}),d("button",{"aria-label":r("Delete saved query {name}",{name:N.name}),className:"border-l border-border px-1 py-0.5 text-xs text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive","data-index":w,"data-testid":`db-saved-query-delete-${N.name}`,onClick:x,type:"button",children:"✕"})]},N.name))]}),e[18]=g,e[19]=x,e[20]=l,e[21]=r,e[22]=C):C=e[22];let k;return e[23]!==y||e[24]!==S||e[25]!==C?(k=E("div",{className:"flex flex-wrap items-center gap-1.5","data-testid":"db-query-bar",children:[y,S,C]}),e[23]=y,e[24]=S,e[25]=C,e[26]=k):k=e[26],k},We="w-full rounded-md border border-border bg-background px-2 py-1 font-mono text-xs outline-none focus-visible:border-ring",gn=/(?:_creationtime|(?:^|[a-z])(?:time|at))$/iu,Xt=(s,e)=>typeof e=="boolean"?"boolean":typeof e=="number"?gn.test(s)?"date":"number":e!==null&&typeof e=="object"?"json":"text",_s=(s,e,n)=>n===void 0?Xt(s,e):n.enumValues!==void 0&&n.enumValues.length>0?"enum":n.type==="boolean"?"boolean":n.type==="number"?gn.test(s)?"date":"number":Xt(s,e),Rs=s=>{try{const e=JSON.parse(s);return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}catch{return null}},$s=s=>{const e=new Date(s),n=o=>String(o).padStart(2,"0");return`${e.getFullYear().toString()}-${n(e.getMonth()+1)}-${n(e.getDate())}T${n(e.getHours())}:${n(e.getMinutes())}`},Je="\0clear",Ds=s=>{const e=B(23),{column:n,nullable:o,onChange:t,value:c}=s,l=ve();let r;e[0]!==n||e[1]!==t?(r=v=>{t(n,v)},e[0]=n,e[1]=t,e[2]=r):r=e[2];const a=r;let i;e[3]!==n||e[4]!==t?(i=v=>{t(n,v.target.value===Je?null:v.target.value==="true")},e[3]=n,e[4]=t,e[5]=i):i=e[5];const u=i;if(!o&&c!==null){const v=c===!0,y=`db-field-${n}`;let S;return e[6]!==n||e[7]!==a||e[8]!==v||e[9]!==y?(S=d(It,{"aria-label":n,checked:v,"data-testid":y,onCheckedChange:a}),e[6]=n,e[7]=a,e[8]=v,e[9]=y,e[10]=S):S=e[10],S}const m=`db-field-${n}`,p=c===!0||c===!1?String(c):Je;let b;e[11]!==l?(b=l("(none)"),e[11]=l,e[12]=b):b=e[12];let f;e[13]!==b?(f=d("option",{value:Je,children:b}),e[13]=b,e[14]=f):f=e[14];let g,h;e[15]===Symbol.for("react.memo_cache_sentinel")?(g=d("option",{value:"true",children:"true"}),h=d("option",{value:"false",children:"false"}),e[15]=g,e[16]=h):(g=e[15],h=e[16]);let x;return e[17]!==n||e[18]!==u||e[19]!==m||e[20]!==p||e[21]!==f?(x=E("select",{"aria-label":n,className:We,"data-testid":m,onChange:u,value:p,children:[f,g,h]}),e[17]=n,e[18]=u,e[19]=m,e[20]=p,e[21]=f,e[22]=x):x=e[22],x},As=s=>{const e=B(23),{column:n,nullable:o,onChange:t,options:c,value:l}=s,r=ve(),a=typeof l=="string"?l:null;let i;e[0]!==c||e[1]!==a?(i=a!==null&&!c.includes(a),e[0]=c,e[1]=a,e[2]=i):i=e[2];const u=i;let m;e[3]!==n||e[4]!==t?(m=y=>{t(n,y.target.value===Je?null:y.target.value)},e[3]=n,e[4]=t,e[5]=m):m=e[5];const p=m,b=`db-field-${n}`,f=a??Je;let g;e[6]!==o||e[7]!==a||e[8]!==r?(g=(o||a===null)&&d("option",{value:Je,children:r("(none)")}),e[6]=o,e[7]=a,e[8]=r,e[9]=g):g=e[9];let h;e[10]!==a||e[11]!==u?(h=u&&d("option",{value:a,children:a}),e[10]=a,e[11]=u,e[12]=h):h=e[12];let x;e[13]!==c?(x=c.map(Ls),e[13]=c,e[14]=x):x=e[14];let v;return e[15]!==n||e[16]!==p||e[17]!==b||e[18]!==f||e[19]!==g||e[20]!==h||e[21]!==x?(v=E("select",{"aria-label":n,className:We,"data-testid":b,onChange:p,value:f,children:[g,h,x]}),e[15]=n,e[16]=p,e[17]=b,e[18]=f,e[19]=g,e[20]=h,e[21]=x,e[22]=v):v=e[22],v},Ps=s=>{const e=B(8),{column:n,onChange:o,value:t}=s;let c;e[0]!==n||e[1]!==o?(c=u=>{const m=Number(u.target.value);u.target.value!==""&&!Number.isNaN(m)&&o(n,m)},e[0]=n,e[1]=o,e[2]=c):c=e[2];const l=c,r=`db-field-${n}`,a=typeof t=="number"?t:"";let i;return e[3]!==n||e[4]!==l||e[5]!==r||e[6]!==a?(i=d("input",{"aria-label":n,className:We,"data-testid":r,onChange:l,type:"number",value:a}),e[3]=n,e[4]=l,e[5]=r,e[6]=a,e[7]=i):i=e[7],i},Is=s=>{const e=B(10),{column:n,onChange:o,value:t}=s;let c;e[0]!==n||e[1]!==o?(c=u=>{const m=new Date(u.target.value).getTime();Number.isNaN(m)||o(n,m)},e[0]=n,e[1]=o,e[2]=c):c=e[2];const l=c,r=`db-field-${n}`;let a;e[3]!==t?(a=typeof t=="number"?$s(t):"",e[3]=t,e[4]=a):a=e[4];let i;return e[5]!==n||e[6]!==l||e[7]!==r||e[8]!==a?(i=d("input",{"aria-label":n,className:We,"data-testid":r,onChange:l,type:"datetime-local",value:a}),e[5]=n,e[6]=l,e[7]=r,e[8]=a,e[9]=i):i=e[9],i},Os=s=>{const e=B(8),{column:n,onChange:o,value:t}=s;let c;e[0]!==n||e[1]!==o?(c=u=>{o(n,u.target.value)},e[0]=n,e[1]=o,e[2]=c):c=e[2];const l=c,r=`db-field-${n}`,a=typeof t=="string"?t:"";let i;return e[3]!==n||e[4]!==l||e[5]!==r||e[6]!==a?(i=d("input",{"aria-label":n,className:We,"data-testid":r,onChange:l,type:"text",value:a}),e[3]=n,e[4]=l,e[5]=r,e[6]=a,e[7]=i):i=e[7],i},Fs=s=>{const e=B(20),{column:n,onChange:o,value:t}=s,c=ve();let l;e[0]!==t?(l=()=>JSON.stringify(t,null,2),e[0]=t,e[1]=l):l=e[1];const[r,a]=$(l),[i,u]=$(!1);let m;e[2]!==n||e[3]!==o?(m=y=>{const S=y.target.value;a(S);try{o(n,JSON.parse(S)),u(!1)}catch{u(!0)}},e[2]=n,e[3]=o,e[4]=m):m=e[4];const p=m,b=i&&"border-destructive";let f;e[5]!==b?(f=dt(We,"min-h-16",b),e[5]=b,e[6]=f):f=e[6];const g=`db-field-${n}`;let h;e[7]!==n||e[8]!==p||e[9]!==f||e[10]!==g||e[11]!==r?(h=d("textarea",{"aria-label":n,className:f,"data-testid":g,onChange:p,value:r}),e[7]=n,e[8]=p,e[9]=f,e[10]=g,e[11]=r,e[12]=h):h=e[12];let x;e[13]!==n||e[14]!==i||e[15]!==c?(x=i&&d("span",{className:"text-xs text-destructive","data-testid":`db-field-error-${n}`,children:c("Invalid JSON")}),e[13]=n,e[14]=i,e[15]=c,e[16]=x):x=e[16];let v;return e[17]!==h||e[18]!==x?(v=E("div",{className:"flex flex-col gap-1",children:[h,x]}),e[17]=h,e[18]=x,e[19]=v):v=e[19],v},Ms=s=>{const e=B(56),{column:n,meta:o,onChange:t,target:c,value:l}=s;let r;e[0]!==n||e[1]!==o||e[2]!==l?(r=_s(n,l,o),e[0]=n,e[1]=o,e[2]=l,e[3]=r):r=e[3];const a=r,i=`db-field-${n}`;let u;e[4]!==n?(u=d("span",{className:"font-mono",children:n}),e[4]=n,e[5]=u):u=e[5];let m;e[6]!==n||e[7]!==o?(m=o!==void 0&&d("span",{className:"rounded bg-muted px-1 font-mono text-[10px] tracking-wide","data-testid":`db-field-type-${n}`,children:o.type}),e[6]=n,e[7]=o,e[8]=m):m=e[8];let p;e[9]!==c?(p=c!==void 0&&E("span",{className:"rounded bg-muted px-1 font-mono text-[10px] tracking-wide uppercase",children:["→ ",c]}),e[9]=c,e[10]=p):p=e[10];let b;e[11]!==u||e[12]!==m||e[13]!==p?(b=E("span",{className:"flex items-center gap-1.5 font-medium text-muted-foreground",children:[u,m,p]}),e[11]=u,e[12]=m,e[13]=p,e[14]=b):b=e[14];let f;e[15]!==n||e[16]!==a||e[17]!==o?.nullable||e[18]!==t||e[19]!==l?(f=a==="boolean"&&d(Ds,{column:n,nullable:o?.nullable===!0,onChange:t,value:l}),e[15]=n,e[16]=a,e[17]=o?.nullable,e[18]=t,e[19]=l,e[20]=f):f=e[20];let g;e[21]!==n||e[22]!==a||e[23]!==o||e[24]!==t||e[25]!==l?(g=a==="enum"&&o?.enumValues!==void 0&&d(As,{column:n,nullable:o.nullable===!0,onChange:t,options:o.enumValues,value:l}),e[21]=n,e[22]=a,e[23]=o,e[24]=t,e[25]=l,e[26]=g):g=e[26];let h;e[27]!==n||e[28]!==a||e[29]!==t||e[30]!==l?(h=a==="number"&&d(Ps,{column:n,onChange:t,value:l}),e[27]=n,e[28]=a,e[29]=t,e[30]=l,e[31]=h):h=e[31];let x;e[32]!==n||e[33]!==a||e[34]!==t||e[35]!==l?(x=a==="date"&&d(Is,{column:n,onChange:t,value:l}),e[32]=n,e[33]=a,e[34]=t,e[35]=l,e[36]=x):x=e[36];let v;e[37]!==n||e[38]!==a||e[39]!==t||e[40]!==l?(v=a==="json"&&d(Fs,{column:n,onChange:t,value:l}),e[37]=n,e[38]=a,e[39]=t,e[40]=l,e[41]=v):v=e[41];let y;e[42]!==n||e[43]!==a||e[44]!==t||e[45]!==l?(y=a==="text"&&d(Os,{column:n,onChange:t,value:l}),e[42]=n,e[43]=a,e[44]=t,e[45]=l,e[46]=y):y=e[46];let S;return e[47]!==x||e[48]!==v||e[49]!==y||e[50]!==i||e[51]!==b||e[52]!==f||e[53]!==g||e[54]!==h?(S=E("label",{className:"flex flex-col gap-1 text-xs",htmlFor:i,children:[b,f,g,h,x,v,y]}),e[47]=x,e[48]=v,e[49]=y,e[50]=i,e[51]=b,e[52]=f,e[53]=g,e[54]=h,e[55]=S):S=e[55],S},Vs=s=>{const e=B(49),{columnMeta:n,documentText:o,onCancel:t,onDocumentTextChange:c,onSave:l,refs:r}=s,a=ve();let i;e[0]!==o?(i=Rs(o),e[0]=o,e[1]=i):i=e[1];const u=i,[m,p]=$(!1),b=!m&&u!==null;let f;e[2]!==u||e[3]!==c?(f=(P,J)=>{c(JSON.stringify({...u,[P]:J},null,2))},e[2]=u,e[3]=c,e[4]=f):f=e[4];const g=f;let h;e[5]!==c?(h=P=>{c(P.target.value)},e[5]=c,e[6]=h):h=e[6];const x=h;let v;e[7]===Symbol.for("react.memo_cache_sentinel")?(v=()=>{p(!1)},e[7]=v):v=e[7];const y=v;let S;e[8]===Symbol.for("react.memo_cache_sentinel")?(S=()=>{p(!0)},e[8]=S):S=e[8];const C=S,k=u===null;let N;e[9]!==a?(N=a("Form"),e[9]=a,e[10]=N):N=e[10];let w;e[11]!==b||e[12]!==k||e[13]!==N?(w=d("button",{"aria-pressed":b,className:Pe,"data-testid":"db-editor-form",disabled:k,onClick:y,type:"button",children:N}),e[11]=b,e[12]=k,e[13]=N,e[14]=w):w=e[14];const T=!b;let F;e[15]!==a?(F=a("JSON"),e[15]=a,e[16]=F):F=e[16];let R;e[17]!==F||e[18]!==T?(R=d("button",{"aria-pressed":T,className:Pe,"data-testid":"db-editor-json",onClick:C,type:"button",children:F}),e[17]=F,e[18]=T,e[19]=R):R=e[19];let _;e[20]!==R||e[21]!==w?(_=E("div",{className:"flex items-center gap-1.5",children:[w,R]}),e[20]=R,e[21]=w,e[22]=_):_=e[22];let D;e[23]!==n||e[24]!==o||e[25]!==u||e[26]!==g||e[27]!==x||e[28]!==r||e[29]!==b||e[30]!==a?(D=b?d("div",{className:"flex flex-col gap-3","data-testid":"db-editor-fields",children:Object.entries(u).map(P=>{const[J,K]=P;return d(Ms,{column:J,meta:n?.[J],onChange:g,target:r?.[J],value:K},J)})}):d("textarea",{"aria-label":a("Row document JSON"),className:"min-h-28 w-full rounded-md border border-border bg-background px-2 py-1.5 font-mono text-xs outline-none focus-visible:border-ring","data-testid":"db-editor-doc",onChange:x,value:o}),e[23]=n,e[24]=o,e[25]=u,e[26]=g,e[27]=x,e[28]=r,e[29]=b,e[30]=a,e[31]=D):D=e[31];let O;e[32]!==a?(O=a("Save"),e[32]=a,e[33]=O):O=e[33];let V;e[34]!==l||e[35]!==O?(V=d("button",{className:Pe,"data-testid":"db-editor-save",onClick:l,type:"button",children:O}),e[34]=l,e[35]=O,e[36]=V):V=e[36];let A;e[37]!==a?(A=a("Cancel"),e[37]=a,e[38]=A):A=e[38];let L;e[39]!==t||e[40]!==A?(L=d("button",{className:Pe,"data-testid":"db-editor-cancel",onClick:t,type:"button",children:A}),e[39]=t,e[40]=A,e[41]=L):L=e[41];let G;e[42]!==V||e[43]!==L?(G=E("div",{className:"flex items-center gap-1.5",children:[V,L]}),e[42]=V,e[43]=L,e[44]=G):G=e[44];let q;return e[45]!==_||e[46]!==D||e[47]!==G?(q=E("div",{className:"flex flex-col gap-2 border border-border bg-card p-3","data-testid":"db-editor",children:[_,D,G]}),e[45]=_,e[46]=D,e[47]=G,e[48]=q):q=e[48],q};function Ls(s){return d("option",{value:s,children:s},s)}const Bs=s=>{const e=B(71),{columns:n,editable:o,filter:t,filters:c,hasMaskedColumns:l,hasPredicate:r,liveError:a,maskOn:i,onAddRow:u,onBulkDelete:m,onBulkPatch:p,onAskAiFilter:b,onClearTable:f,onFilterChange:g,onFiltersChange:h,onGenerateRows:x,onShowJson:v,onShowTable:y,onToggleMask:S,total:C,totalKnown:k,viewMode:N}=s,w=ve(),T=N==="table";let F;e[0]!==y||e[1]!==T?(F=d("button",{"aria-pressed":T,className:Pe,"data-testid":"db-view-table",onClick:y,type:"button",children:"Table"}),e[0]=y,e[1]=T,e[2]=F):F=e[2];const R=N==="json";let _;e[3]!==v||e[4]!==R?(_=d("button",{"aria-pressed":R,className:Pe,"data-testid":"db-view-json",onClick:v,type:"button",children:"JSON"}),e[3]=v,e[4]=R,e[5]=_):_=e[5];let D;e[6]!==a||e[7]!==w?(D=a===void 0?w("Live — changes stream in automatically"):w("Live unavailable: {liveError}",{liveError:a}),e[6]=a,e[7]=w,e[8]=D):D=e[8];const O=`size-1.5 rounded-full ${a===void 0?"bg-success":"bg-muted-foreground/50"}`;let V;e[9]!==O?(V=d("span",{"aria-hidden":"true",className:O}),e[9]=O,e[10]=V):V=e[10];let A;e[11]!==a||e[12]!==w?(A=w(a===void 0?"Live":"Live unavailable"),e[11]=a,e[12]=w,e[13]=A):A=e[13];let L;e[14]!==D||e[15]!==V||e[16]!==A?(L=E("span",{className:"inline-flex items-center gap-1.5 px-1 text-xs font-medium text-muted-foreground","data-testid":"db-live-indicator",role:"status",title:D,children:[V,A]}),e[14]=D,e[15]=V,e[16]=A,e[17]=L):L=e[17];let G;e[18]!==l||e[19]!==i||e[20]!==S||e[21]!==w?(G=l&&d("button",{"aria-pressed":i,className:Pe,"data-testid":"db-mask-toggle",onClick:S,type:"button",children:w("Mask sensitive columns")}),e[18]=l,e[19]=i,e[20]=S,e[21]=w,e[22]=G):G=e[22];let q;e[23]!==o||e[24]!==u?(q=o&&d("button",{className:Pe,"data-testid":"db-add-row",onClick:u,type:"button",children:"Add row"}),e[23]=o,e[24]=u,e[25]=q):q=e[25];let P;e[26]!==o||e[27]!==x||e[28]!==w?(P=o&&x!==void 0&&d("button",{className:Pe,"data-testid":"db-generate-rows",onClick:x,type:"button",children:w("Generate rows")}),e[26]=o,e[27]=x,e[28]=w,e[29]=P):P=e[29];let J;e[30]!==o||e[31]!==r||e[32]!==m||e[33]!==w||e[34]!==C||e[35]!==k?(J=o&&C>0&&r&&d(Kt,{confirmLabel:k?w("Permanently delete {total} matching rows and everything that cascades?",{total:C.toString()}):w("Permanently delete all matching rows and everything that cascades?"),onConfirm:m,testId:"db-bulk-delete",children:k?w("Delete {total} matching",{total:C.toString()}):w("Delete matching")}),e[30]=o,e[31]=r,e[32]=m,e[33]=w,e[34]=C,e[35]=k,e[36]=J):J=e[36];let K;e[37]!==o||e[38]!==r||e[39]!==p||e[40]!==w||e[41]!==C||e[42]!==k?(K=o&&k&&C>0&&r&&d("button",{className:Pe,"data-testid":"db-bulk-patch",onClick:p,type:"button",children:w("Set column on {total} matching",{total:C.toString()})}),e[37]=o,e[38]=r,e[39]=p,e[40]=w,e[41]=C,e[42]=k,e[43]=K):K=e[43];let H;e[44]!==o||e[45]!==r||e[46]!==f||e[47]!==w||e[48]!==C||e[49]!==k?(H=o&&C>0&&!r&&d(Kt,{confirmLabel:k?w("Permanently clear all {total} rows and everything that cascades?",{total:C.toString()}):w("Permanently clear every row and everything that cascades?"),onConfirm:f,testId:"db-clear-table",children:k?w("Clear table ({total})",{total:C.toString()}):w("Clear table")}),e[44]=o,e[45]=r,e[46]=f,e[47]=w,e[48]=C,e[49]=k,e[50]=H):H=e[50];let Y;e[51]!==G||e[52]!==q||e[53]!==P||e[54]!==J||e[55]!==K||e[56]!==H||e[57]!==F||e[58]!==_||e[59]!==L?(Y=E("div",{className:"flex flex-wrap items-center gap-1.5",children:[F,_,L,G,q,P,J,K,H]}),e[51]=G,e[52]=q,e[53]=P,e[54]=J,e[55]=K,e[56]=H,e[57]=F,e[58]=_,e[59]=L,e[60]=Y):Y=e[60];let U;e[61]!==n||e[62]!==t||e[63]!==c||e[64]!==b||e[65]!==g||e[66]!==h?(U=d(Co,{columns:n,filters:c,onAskAi:b,onFiltersChange:h,onSearchChange:g,search:t}),e[61]=n,e[62]=t,e[63]=c,e[64]=b,e[65]=g,e[66]=h,e[67]=U):U=e[67];let ne;return e[68]!==Y||e[69]!==U?(ne=E("div",{className:"flex flex-col gap-2","data-testid":"db-view-toggle",children:[Y,U]}),e[68]=Y,e[69]=U,e[70]=ne):ne=e[70],ne},js=s=>{const e=B(110),{assistant:n,backRelations:o,browser:t,columnMeta:c,edit:l,editable:r,onAskAiFilter:a,onInspect:i,onOpenBulkPatch:u,onOpenGenerateRows:m,onRowDelete:p,onSaveQuery:b,page:f,preferences:g,queryBar:h,references:x}=s,v=g.maskColumns.size>0,y=n.unavailable?void 0:a;let S;e[0]!==t.addRow||e[1]!==t.bulkDelete||e[2]!==t.clearTable||e[3]!==t.columns||e[4]!==t.filter||e[5]!==t.filters||e[6]!==t.hasPredicate||e[7]!==t.liveError||e[8]!==t.onFilterChange||e[9]!==t.onFiltersChange||e[10]!==t.showJson||e[11]!==t.showTable||e[12]!==t.total||e[13]!==t.totalKnown||e[14]!==t.viewMode||e[15]!==r||e[16]!==u||e[17]!==m||e[18]!==g.maskOn||e[19]!==g.onToggleMask||e[20]!==v||e[21]!==y?(S=d(Bs,{columns:t.columns,editable:r,filter:t.filter,filters:t.filters,hasMaskedColumns:v,hasPredicate:t.hasPredicate,liveError:t.liveError,maskOn:g.maskOn,onAddRow:t.addRow,onAskAiFilter:y,onBulkDelete:t.bulkDelete,onBulkPatch:u,onClearTable:t.clearTable,onFilterChange:t.onFilterChange,onFiltersChange:t.onFiltersChange,onGenerateRows:m,onShowJson:t.showJson,onShowTable:t.showTable,onToggleMask:g.onToggleMask,total:t.total,totalKnown:t.totalKnown,viewMode:t.viewMode}),e[0]=t.addRow,e[1]=t.bulkDelete,e[2]=t.clearTable,e[3]=t.columns,e[4]=t.filter,e[5]=t.filters,e[6]=t.hasPredicate,e[7]=t.liveError,e[8]=t.onFilterChange,e[9]=t.onFiltersChange,e[10]=t.showJson,e[11]=t.showTable,e[12]=t.total,e[13]=t.totalKnown,e[14]=t.viewMode,e[15]=r,e[16]=u,e[17]=m,e[18]=g.maskOn,e[19]=g.onToggleMask,e[20]=v,e[21]=y,e[22]=S):S=e[22];let C;e[23]!==b||e[24]!==h?(C=h!==void 0&&d(Es,{onApply:h.onApplyQuery,onCopyLink:h.onCopyLink,onDelete:h.onDeleteQuery,onSave:b,saved:h.saved}),e[23]=b,e[24]=h,e[25]=C):C=e[25];let k;e[26]!==o||e[27]!==t.onBulkDeleteSelected||e[28]!==t.selectedTable||e[29]!==t.table||e[30]!==t.viewMode||e[31]!==r||e[32]!==f||e[33]!==g.maskView||e[34]!==g.onToggleTranspose||e[35]!==g.transposed?(k=t.viewMode==="table"&&f.rows.length>0&&d(So,{backRelations:o.available,columns:f.columns,editable:r,enabledBackRelations:o.enabled,name:t.selectedTable??"export",onBulkDelete:t.onBulkDeleteSelected,onToggleBackRelation:o.onToggle,onToggleTranspose:g.onToggleTranspose,rows:Nt(f.rows,g.maskView),sqlColumns:f.sqlColumns,table:t.table.table,transposed:g.transposed}),e[26]=o,e[27]=t.onBulkDeleteSelected,e[28]=t.selectedTable,e[29]=t.table,e[30]=t.viewMode,e[31]=r,e[32]=f,e[33]=g.maskView,e[34]=g.onToggleTranspose,e[35]=g.transposed,e[36]=k):k=e[36];let N;e[37]!==t.cancelEdit||e[38]!==t.editing||e[39]!==t.saveEdit||e[40]!==t.setEditorDocumentText||e[41]!==c||e[42]!==r||e[43]!==f?(N=r&&t.editing!==null&&d(Vs,{columnMeta:c,documentText:t.editing.docText,onCancel:t.cancelEdit,onDocumentTextChange:t.setEditorDocumentText,onSave:t.saveEdit,refs:f.refs}),e[37]=t.cancelEdit,e[38]=t.editing,e[39]=t.saveEdit,e[40]=t.setEditorDocumentText,e[41]=c,e[42]=r,e[43]=f,e[44]=N):N=e[44];let w;e[45]!==t.committing||e[46]!==t.discardStaged||e[47]!==t.onCommitStaged||e[48]!==t.stagedChanges||e[49]!==r?(w=r&&t.stagedChanges.length>0&&d(Go,{changes:t.stagedChanges,committing:t.committing,onCommit:t.onCommitStaged,onDiscard:t.discardStaged}),e[45]=t.committing,e[46]=t.discardStaged,e[47]=t.onCommitStaged,e[48]=t.stagedChanges,e[49]=r,e[50]=w):w=e[50];let T;e[51]!==t.writeError?(T=t.writeError!==null&&d("p",{className:"text-sm text-destructive","data-testid":"db-write-error",role:"alert",children:t.writeError}),e[51]=t.writeError,e[52]=T):T=e[52];let F;e[53]!==t.writeNotice?(F=t.writeNotice!==null&&d("p",{className:"text-sm text-muted-foreground","data-testid":"db-write-notice",role:"status",children:t.writeNotice}),e[53]=t.writeNotice,e[54]=F):F=e[54];let R;e[55]!==S||e[56]!==C||e[57]!==k||e[58]!==N||e[59]!==w||e[60]!==T||e[61]!==F?(R=E("div",{className:"flex shrink-0 flex-col gap-2 border-b border-border px-4 py-3",children:[S,C,k,N,w,T,F]}),e[55]=S,e[56]=C,e[57]=k,e[58]=N,e[59]=w,e[60]=T,e[61]=F,e[62]=R):R=e[62];let _;e[63]!==t.viewMode||e[64]!==f?(_=t.viewMode==="table"&&f.rows.length===0&&d("div",{className:"flex flex-1 items-center justify-center p-6",children:d(no,{description:"Rows you insert into this table will show up here.",icon:d("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:d("path",{d:"M4 5h16v14H4V5Zm0 5h16M10 10v9M4 14.5h16"})}),testId:"db-empty-rows",title:"This table is empty."})}),e[63]=t.viewMode,e[64]=f,e[65]=_):_=e[65];let D;e[66]!==t.viewMode||e[67]!==f||e[68]!==g.maskView||e[69]!==g.transposed?(D=t.viewMode==="table"&&f.rows.length>0&&g.transposed&&d(yo,{columns:f.columns,rows:Nt(f.rows,g.maskView)}),e[66]=t.viewMode,e[67]=f,e[68]=g.maskView,e[69]=g.transposed,e[70]=D):D=e[70];let O;e[71]!==o||e[72]!==t.filter||e[73]!==t.onRowEdit||e[74]!==t.table||e[75]!==t.viewMode||e[76]!==c||e[77]!==l||e[78]!==r||e[79]!==i||e[80]!==p||e[81]!==f||e[82]!==g.maskView||e[83]!==g.onTogglePin||e[84]!==g.pinnedColumns||e[85]!==g.transposed||e[86]!==x?(O=t.viewMode==="table"&&f.rows.length>0&&!g.transposed&&d(xs,{backRelationCounts:o.counts,columnMeta:c,edit:l,editable:r,highlight:t.filter,mask:g.maskView,onDelete:p,onEdit:t.onRowEdit,onInspect:i,onTogglePin:g.onTogglePin,pinnedColumns:g.pinnedColumns,refs:x,tableModel:t.table}),e[71]=o,e[72]=t.filter,e[73]=t.onRowEdit,e[74]=t.table,e[75]=t.viewMode,e[76]=c,e[77]=l,e[78]=r,e[79]=i,e[80]=p,e[81]=f,e[82]=g.maskView,e[83]=g.onTogglePin,e[84]=g.pinnedColumns,e[85]=g.transposed,e[86]=x,e[87]=O):O=e[87];let V;e[88]!==t.viewMode||e[89]!==f||e[90]!==g.maskView?(V=t.viewMode==="json"&&d("pre",{className:"min-h-0 flex-1 overflow-auto border-t border-border bg-muted/30 p-3 text-xs","data-testid":"db-json",children:JSON.stringify(Nt(f.rows,g.maskView),on,2)}),e[88]=t.viewMode,e[89]=f,e[90]=g.maskView,e[91]=V):V=e[91];let A;e[92]!==t.changePageSize||e[93]!==t.goNext||e[94]!==t.goPrevious||e[95]!==t.hasNext||e[96]!==t.hasPrevious||e[97]!==t.jumpToPage||e[98]!==t.pageSize||e[99]!==t.rangeEnd||e[100]!==t.rangeStart||e[101]!==t.total?(A=d("div",{className:"flex shrink-0 items-center border-t border-border px-4 py-2",children:d(ko,{hasNext:t.hasNext,hasPrevious:t.hasPrevious,onJumpToPage:t.jumpToPage,onNext:t.goNext,onPageSizeChange:t.changePageSize,onPrevious:t.goPrevious,pageSize:t.pageSize,prefix:"db",rangeEnd:t.rangeEnd,rangeStart:t.rangeStart,total:t.total})}),e[92]=t.changePageSize,e[93]=t.goNext,e[94]=t.goPrevious,e[95]=t.hasNext,e[96]=t.hasPrevious,e[97]=t.jumpToPage,e[98]=t.pageSize,e[99]=t.rangeEnd,e[100]=t.rangeStart,e[101]=t.total,e[102]=A):A=e[102];let L;return e[103]!==R||e[104]!==_||e[105]!==D||e[106]!==O||e[107]!==V||e[108]!==A?(L=E("div",{className:"flex min-h-0 flex-1 flex-col","data-testid":"db-page",children:[R,_,D,O,V,A]}),e[103]=R,e[104]=_,e[105]=D,e[106]=O,e[107]=V,e[108]=A,e[109]=L):L=e[109],L},zs="/__lunora/seed",_t=200,qs=50,Ks=(s,e)=>{const n=[];for(const o of s)o.pk!==!0&&o.ref!==void 0&&o.type==="id"&&(e[o.ref]??[]).length===0&&n.push(o.name);return n},Gs=s=>Array.isArray(s)&&s.every(e=>ln(e)),Js=async s=>{let e;try{e=await fetch(zs,{body:JSON.stringify(s),headers:{"Content-Type":"application/json"},method:"POST"})}catch(o){return{kind:"error",message:`seed request failed: ${zt(o)}`}}let n;try{n=await e.json()??{}}catch{return{kind:"error",message:`seed request failed (${String(e.status)})`}}if(e.ok&&n.rows!==void 0){let o;try{o=Pt(n.rows)}catch(t){return{kind:"error",message:`seed response could not be decoded: ${zt(t)}`}}return Gs(o)?{kind:"ok",rows:o}:{kind:"error",message:"seed response did not carry a list of row documents"}}return n.error==="fk-parents-empty"?{kind:"error",message:`no rows to reference in ${(Array.isArray(n.tables)?n.tables.filter(t=>typeof t=="string"):[]).join(", ")} — seed those tables first`}:n.error==="seed-refused"&&typeof n.message=="string"?{kind:"error",message:n.message}:{kind:"error",message:typeof n.error=="string"?n.error:`seed request failed (${String(e.status)})`}},Ws="rounded-md border border-border px-3 py-1.5 text-xs font-medium text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-50",Hs="rounded-md bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground outline-none transition-colors hover:bg-primary/90 focus-visible:bg-primary/90 disabled:pointer-events-none disabled:opacity-50",Us=({columns:s,fkPools:e,onClose:n,onInsertRows:o,table:t})=>{const c=ve(),[l,r]=$(10),[a,i]=$(!1),[u,m]=$(void 0),[p,b]=$(void 0),[f,g]=$(0),h=C=>{const k=Number(C.target.value);!Number.isNaN(k)&&k>=1&&r(Math.min(k,_t))},x=async()=>{m(void 0),b(void 0),g(0),i(!0);try{const C=await Js({count:l,existingIds:e,seed:Date.now(),table:t});if(C.kind==="error"){m(C.message);return}const{rows:k}=C;if(k.length===0){m(c("No rows generated — all columns were skipped."));return}const N=await o(k);if(N.error!==void 0){m(N.error);return}b(N.inserted),g(N.conflicts)}finally{i(!1)}},v=()=>{Ce(x())},y=s.filter(C=>C.pk!==!0),S=Ks(s,e);return E(ft,{label:c("Generate dummy rows"),onClose:n,panelTestId:"gen-rows-panel",testId:"gen-rows-overlay",variant:"dialog",children:[E("div",{className:"flex items-start justify-between",children:[E("div",{className:"flex flex-col gap-0.5",children:[d("h3",{className:"text-base text-foreground","data-testid":"gen-rows-title",children:c("Generate dummy rows")}),d("p",{className:"text-xs text-muted-foreground","data-testid":"gen-rows-desc",children:c("Seed {table} with Faker-generated rows. Existing rows are not affected.",{table:t})})]}),d("button",{className:"text-xs text-muted-foreground hover:text-foreground","data-testid":"gen-rows-close",onClick:n,type:"button",children:c("Close")})]}),E("div",{className:"flex items-center gap-2",children:[d("label",{className:"text-xs font-medium text-foreground",htmlFor:"gen-rows-count",children:c("Row count")}),d("input",{className:"w-20 rounded-md border border-border bg-background px-2 py-1 text-xs outline-none focus-visible:border-ring","data-testid":"gen-rows-count",id:"gen-rows-count",max:_t,min:1,onChange:h,type:"number",value:l}),d("span",{className:"text-xs text-muted-foreground",children:c("(max {max})",{max:_t.toString()})})]}),y.length>0&&E("div",{className:"flex flex-col gap-1",children:[d("p",{className:"font-mono text-[11px] tracking-wide uppercase text-muted-foreground",children:c("Columns to seed")}),d("ul",{className:"flex flex-col gap-0.5","data-testid":"gen-rows-columns",children:y.map(C=>{const k=C.ref!==void 0&&C.type==="id",N=k&&(e[C.ref??""]??[]).length===0,w=N?"rounded bg-destructive/10 px-1 text-destructive":"rounded bg-muted px-1 text-muted-foreground",T=N?`gen-rows-fk-empty-${C.name}`:`gen-rows-fk-ok-${C.name}`,F=N?c("FK: no rows in {ref} — seed it first",{ref:C.ref??""}):c("→ {ref}",{ref:C.ref??""});return E("li",{className:"flex items-center gap-1.5 font-mono text-xs",children:[d("span",{className:"text-foreground",children:C.name}),E("span",{className:"text-muted-foreground",children:["(",C.type,")"]}),C.optional&&d("span",{className:"rounded bg-muted px-1 font-mono text-[10px] tracking-wide uppercase",children:"optional"}),k&&d("span",{className:w,"data-testid":T,children:F})]},C.name)})})]}),S.length>0&&d("p",{className:"text-xs text-destructive","data-testid":"gen-rows-blocked",role:"alert",children:c("Cannot generate rows: these columns reference tables with no rows: {cols}. Seed those tables first.",{cols:S.join(", ")})}),u!==void 0&&d("p",{className:"text-xs text-destructive","data-testid":"gen-rows-error",role:"alert",children:u}),p!==void 0&&u===void 0&&d("p",{className:"text-xs text-success","data-testid":"gen-rows-success",children:f>0?c("Inserted {inserted} of {total} rows — {conflicts} skipped as id conflicts.",{conflicts:f.toString(),inserted:p.toString(),total:(p+f).toString()}):c("Inserted {count} rows successfully.",{count:p.toString()})}),E("div",{className:"flex justify-end gap-2",children:[d("button",{className:Ws,"data-testid":"gen-rows-cancel",onClick:n,type:"button",children:c("Cancel")}),d("button",{className:Hs,"data-testid":"gen-rows-generate",disabled:a||S.length>0,onClick:v,type:"button",children:c(a?"Inserting…":"Generate & insert")})]})]})},Qs=$e(he.backRelationCounts),Ys=(s,e,n,o)=>{const t=B(16),c=ut();let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l={},t[0]=l):l=t[0];const[r,a]=$(l);let i;if(t[1]!==s||t[2]!==e){let x;t[4]!==s?(x=v=>s.has(Ot(v)),t[4]=s,t[5]=x):x=t[5],i=e.filter(x),t[1]=s,t[2]=e,t[3]=i}else i=t[3];const u=i;let m;t[6]!==n||t[7]!==u?(m=JSON.stringify([u,n]),t[6]=n,t[7]=u,t[8]=m):m=t[8];const p=m;let b;t[9]!==c||t[10]!==o||t[11]!==p?(b=async x=>{const[v,y]=JSON.parse(p);if(v.length===0||y.length===0){x.cancelled||a({});return}try{const S=await c.query(Qs,{ids:y,relations:v},Re(o));x.cancelled||a(Object.fromEntries(S.relations.map(Xs)))}catch{}},t[9]=c,t[10]=o,t[11]=p,t[12]=b):b=t[12];const f=b;let g,h;return t[13]!==f?(g=()=>{const x={cancelled:!1};return Ce(f(x)),()=>{x.cancelled=!0}},h=[f],t[13]=f,t[14]=g,t[15]=h):(g=t[14],h=t[15]),ze(g,h),r};function Xs(s){return[Ot(s),s.counts]}const Zs=async s=>{const{args:e,maxBatches:n,openCursor:o,query:t}=s;let c=o,l=0,r="cap-hit";for(let a=0;a<n;a+=1){const i=await t({...e,after:c});if(l+=i.count,c=i.cursor,!i.hasMore){r="completed";break}}return{cursor:r==="cap-hit"?c:void 0,outcome:r,written:l}},it=s=>{const e=s[0];return e===void 0?void 0:{column:e.id,direction:e.desc?"desc":"asc"}},pn=s=>Me(s),Zt=s=>s.map(e=>({column:e.column,path:(e.path??[]).join("."),...e.path===void 0||e.path.length===0?{}:{pathSegments:e.path},...e.value===void 0?{}:{literal:[e.value]},operator:e.operator,value:e.value===void 0?"":pn(e.value)})),en=s=>s===void 0?[]:[{desc:s.direction==="desc",id:s.column}],el=s=>[s.column,s.operator,s.value,s.path??[]],rt=(s,e,n,o)=>JSON.stringify([s??"",e??"",(n??[]).map(t=>el(t)),o===void 0?null:[o.column,o.direction]]),Mt=200,tl=20,nl=$e(he.readTablePage),ol=$e(he.facetColumn),Rt=$e(he.writeRow),sl=$e(he.deleteRows),ll=$e(he.clearTable),rl=$e(he.patchRows),al={},Vt=new Set(["__doc__","__id__","_creationTime","_id","id"]),il=s=>{const e=s.__doc__;if(typeof e=="string"){const o=eo(e);if(o!==void 0)return o}const n={};for(const[o,t]of Object.entries(s))Vt.has(o)||(n[o]=t);return n},cl=(s,e,n)=>JSON.stringify([s.__lunoraRef,n,rn(e)]),dl=({filters:s,offset:e,pageSize:n,search:o,sorting:t,table:c})=>({filters:Fe(s),limit:n,offset:e,orderBy:it(t),search:o,skipCount:!0,table:c}),ul=({filters:s,search:e,table:n})=>({filters:Fe(s),limit:1,search:e,table:n}),fl=(s,e)=>{const n=new Map;for(const t of s?.rows??[]){const c=Ie(t);c!==null&&n.set(c,t)}const o=[];for(const[t,c]of Object.entries(e))for(const[l,r]of Object.entries(c))o.push({column:l,newValue:r,oldValue:n.get(t)?.[l],rowId:t});return o},ml=s=>!Vt.has(s),gl=`Stopped after ${Mt.toString()} batches — rows still match. Run it again to remove the rest.`,pl=`Stopped after ${Mt.toString()} batches — rows still match. Run it again to set the rest.`,tn={resumable:!1,truncated:gl,verb:"deleted"},bl={resumable:!0,truncated:pl,verb:"written"},hl=({initialFilters:s,initialOrderBy:e,initialSearch:n,initialShardKey:o,onSelectTable:t,onViewChange:c,pageSize:l,resolveBackRelations:r,tableParam:a})=>{const i=ut(),[u,m]=$(l),[p,b]=$(o??""),f=a===void 0||a===""?null:a,[g,h]=$(0),[x,v]=$("table"),[y,S]=$(()=>en(e)),[C,k]=$(n??""),[N,w]=$(()=>Zt(s??[])),{clearFacets:T,facets:F,refetchFacets:R,toggleFacet:_}=Un(),[D,O]=$(null),[V,A]=$(null),[L,G]=$(null),q=Ke(null),P=Ko(),[J,K]=$(null),[H,Y]=$(!1),[U,ne]=$(a),[le,ae]=$(()=>rt(o,n,s,e)),[ge,fe]=$(0),[me,pe]=$(()=>rt(o,n,s,e)),ie=a!==U,Q=rt(o,n,s,e),ce=ie||!ie&&Q!==le&&Q!==me;if(ce){ne(a),ae(Q),fe(z=>z+1),S(en(e)),k(n??"");const I=Zt(s??[]);w(I),b(o??""),T(),P.clear(),K(null),O(null),h(0),A(null),G(null),q.current=null}else Q!==le&&ae(Q);const Se=ce?n??"":C,oe=ce?o??"":p,se=`${a??""}:${ge.toString()}`,W=Gt(Se.trim(),300,se),j=Gt(oe.trim(),400,se),re=Xe(se),X=Ke(0),[ee,we]=$(j);ee!==j&&(we(j),P.clear(),K(null),O(null));const xe=rt(j,W,Fe(N),it(y));xe!==me&&pe(xe);const de=Ze(he.listTables,al,{live:!0,shardKey:j}),te=de.data??null,De=de.error,Ve=dl({filters:N,offset:g,pageSize:u,search:W,sorting:y,table:f??""}),Le=ul({filters:N,search:W,table:f??""}),Ne=Ze(he.readTablePage,Ve,{enabled:f!==null,keepPreviousData:!1,live:!0,shardKey:j}),ue=Ne.data??null,ke=Ne.error,{liveError:Ge}=Ne,qe=Ze(he.readTablePage,Le,{enabled:f!==null,live:!0,shardKey:j});ze(()=>{de.data!==void 0&&To(j)},[de.data,j]);const He=I=>{t?.(I)},mt=(I,z)=>{t?.(I,{search:z})},gt=async(I,z)=>{try{return(await i.query(nl,{filters:[],limit:tl,offset:0,search:z,table:I},Re(j))).rows.find(Ae=>Ie(Ae)===z)??null}catch{return null}},tt=(I,z,Te,Ae)=>ye=>i.query(ol,{column:ye,filters:Fe(Te),search:Ae,table:z},Re(I)),pt=I=>{_(I,f===null?null:tt(j,f,N,W))},nt=(I,z)=>{const Te={column:I,literal:[Jn(z)],operator:"eq",value:pn(z)},Ae=ye=>ye.column===I&&ye.operator!=="has"&&ye.pathSegments===void 0&&(ye.path??"").trim()==="";w(ye=>[...ye.filter(_e=>!Ae(_e)),Te]),h(0)},bt=Xe(tt),ht=Xe(R),Ue=Xe(c);ze(()=>{f!==null&&Ce(ht.current(bt.current(j,f,N,W)))},[j,f,N,W]),ze(()=>{f===null||Ue.current===void 0||U!==a||le!==Q||Ue.current({filters:Fe(N),orderBy:it(y),search:W,shard:j})},[f,a,U,le,Q,N,y,W,j]);const Qe=I=>{f!==null&&h(Math.max(0,I))},xt=(I,z)=>{K({column:z,rowId:I})},vt=()=>{K(null)},wt=async()=>{if(f!==null){A(null),Y(!0);try{for(const[I,z]of Object.entries(P.staged))await i.query(Rt,{doc:z,id:I,op:"patch",table:f},Re(j)),P.drop(I,z)}catch(I){A(I.message)}K(null),Ne.refetch(),Y(!1)}},yt=()=>{P.clear(),K(null)},Ct=I=>{X.current+=1,b(I),P.clear(),K(null),O(null),h(0),q.current=null},St=fl(ue,P.staged),M=async(I,z,Te)=>{if(f===null)return;A(null);let Ae;if(I!=="delete"){let ye;try{ye=Te===void 0||Te.trim()===""?{}:JSON.parse(Te)}catch(_e){A(`Invalid JSON: ${_e.message}`);return}try{const _e=Pt(ye);if(!ln(_e)){A("The document must be a JSON object.");return}Ae=_e}catch(_e){A(`Invalid document: ${_e.message}`);return}}try{await i.query(Rt,{doc:Ae,id:z??void 0,op:I,table:f},Re(j)),O(null),Ne.refetch()}catch(ye){A(ye.message)}},Z=async(I,z,Te)=>{if(f===null)return 0;const Ae=se,ye=X.current,_e=()=>re.current===Ae&&X.current===ye;A(null),G(null);const Bt=cl(I,z,j),zn=q.current?.key===Bt?q.current.after:void 0,qn=Te.resumable?zn??"":void 0;let je=0;try{const Ye=await Zs({args:z,maxBatches:Mt,openCursor:qn,query:async Kn=>{const jt=await i.query(I,Kn,Re(j));return je+=jt.count,jt}});return _e()&&(q.current=Ye.cursor===void 0?null:{after:Ye.cursor,key:Bt},Ye.outcome==="cap-hit"&&A(Te.truncated),G(`${je.toString()} ${je===1?"row":"rows"} ${Te.verb}.`)),je}catch(Ye){return _e()&&(A(`${Ye.message} (at least ${je.toString()} rows were already ${Te.verb})`),q.current=null),je}finally{_e()&&(h(0),Ne.refetch())}},Oe=I=>{S(I),h(0)},Be=$t(()=>f===null?[]:r?.(f)??[],[r,f]),Ee=vs(ue,y,Oe,Be),ot={filters:Fe(N),orderBy:it(y),search:W,shard:p,table:f??void 0},st=qe.data?.total,lt=st!==void 0,Lt=st??(ue===null?0:g+ue.rows.length),bn=g>0,hn=W!==""||Fe(N).length>0,xn=ue!==null&&(lt?g+ue.rows.length<Lt:ue.rows.length===u),vn=ue===null||ue.rows.length===0?0:g+1,wn=ue===null?0:g+ue.rows.length,yn=()=>{de.refetch()},Cn=()=>{v("table")},Sn=()=>{v("json")},Nn=()=>{Ce(Z(sl,{filters:Fe(N),search:W,table:f},tn))},kn=()=>{Ce(Z(ll,{table:f},tn))},Tn=I=>{Ce(Z(rl,{doc:I,filters:Fe(N),search:W,table:f},bl))},En=I=>{k(I.target.value),h(0)},_n=I=>{w(I),h(0)},Rn=()=>{A(null);const I={};for(const z of ue?.columns??[])Vt.has(z)||(I[z]="");O({docText:JSON.stringify(I,null,2),id:""})},$n=I=>{O(z=>z===null?z:{docText:I,id:z.id})},Dn=()=>{D!==null&&Ce(M(D.id===""?"insert":"patch",D.id===""?null:D.id,D.docText))},An=()=>{O(null),A(null)},Pn=()=>{Qe(g-u)},In=()=>{Qe(g+u)},On=I=>{Qe(Math.max(0,(I-1)*u))},Fn=I=>{m(I),h(0)},Mn=(I,z)=>{A(null),O({docText:JSON.stringify(rn(il(z)),null,2),id:I})},Vn=I=>{Ce(M("delete",I))},Ln=async I=>{if(!(f===null||I.length===0)){A(null);try{for(const z of I)await i.query(Rt,{id:z,op:"delete",table:f},Re(j));Ne.refetch()}catch(z){A(z.message)}}},Bn=I=>{Ce(Ln(I))},jn=()=>{Ce(wt())};return{addRow:Rn,bulkDelete:Nn,bulkPatch:Tn,cancelCellEdit:vt,cancelEdit:An,changePageSize:Fn,clearTable:kn,columns:ue?.columns??[],committing:H,currentView:ot,discardStaged:yt,editableColumn:ml,editing:D,editingCell:J,facetFilter:nt,facets:F,filter:C,filters:N,goNext:In,goPrevious:Pn,hasNext:xn,hasPredicate:hn,hasPrevious:bn,jumpToPage:On,liveError:Ge,loadTables:yn,navigateToRef:mt,onBulkDeleteSelected:Bn,onCommitStaged:jn,onFilterChange:En,onFiltersChange:_n,onRowDelete:Vn,onRowEdit:Mn,page:ue,previewRef:gt,pageError:ke,pageSize:u,rangeEnd:wn,rangeStart:vn,queryShardKey:j,saveEdit:Dn,selectedTable:f,selectTable:He,setEditorDocumentText:$n,setShardKey:Ct,shardKey:p,showJson:Sn,showTable:Cn,stage:P.stage,stagedChanges:St,stagedValue:P.stagedValue,startCellEdit:xt,table:Ee,tables:te,tablesError:De,toggleFacet:pt,total:Lt,totalKnown:lt,viewMode:x,writeError:V,writeNotice:L}},xl="lunora-studio-pinned-columns",vl=s=>{const e=B(21),{columns:n,initialPins:o,selectedTable:t}=s;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={},e[0]=c):c=e[0];const[l,r]=nn(xl,c),a=t??"",i=l[a];let u;e[1]!==o||e[2]!==i?(u=i===void 0?new Set((o??"").split(",").filter(wl)):new Set(i),e[1]=o,e[2]=i,e[3]=u):u=e[3];const m=u;let p;e[4]!==a||e[5]!==m||e[6]!==r?(p=T=>{r(F=>{const R=F[a]??[...m],_=R.includes(T)?R.filter(D=>D!==T):[...R,T];return{...F,[a]:_}})},e[4]=a,e[5]=m,e[6]=r,e[7]=p):p=e[7];const b=p,[f,g]=$(!1);let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=()=>{g(yl)},e[8]=h):h=e[8];const x=h;let v;e[9]!==n||e[10]!==t?(v={columns:n,selectedTable:t},e[9]=n,e[10]=t,e[11]=v):v=e[11];const{maskColumns:y,maskOn:S,maskView:C,maskViewFor:k,onToggleMask:N}=Qn(v);let w;return e[12]!==y||e[13]!==S||e[14]!==C||e[15]!==k||e[16]!==N||e[17]!==b||e[18]!==m||e[19]!==f?(w={maskColumns:y,maskOn:S,maskView:C,maskViewFor:k,onToggleMask:N,onTogglePin:b,onToggleTranspose:x,pinnedColumns:m,transposed:f},e[12]=y,e[13]=S,e[14]=C,e[15]=k,e[16]=N,e[17]=b,e[18]=m,e[19]=f,e[20]=w):w=e[20],w};function wl(s){return s!==""}function yl(s){return!s}const Cl=$e(he.describeTable),Sl=$e(he.readTablePage),Nl=$e(he.importShard),kl=s=>{const e=s._id??s.id??s.__id__??"";return typeof e=="string"?e:typeof e=="number"?String(e):""},Tl=s=>{const e=Object.values(s.inserted).reduce((a,i)=>a+i,0),[n]=s.errors;if(n===void 0)return{conflicts:s.conflicts,error:void 0,inserted:e};const o=s.errors.length-1,t=e+s.conflicts+s.errors.length,c=o===1?"error":"errors",l=o>0?` (+${o.toString()} more ${c})`:"",r=`Inserted ${e.toString()} of ${t.toString()} rows — row ${n.line.toString()} (${n.table}): ${n.message}${l}`;return{conflicts:s.conflicts,error:r,inserted:e}},El=s=>{const e=ut(),[n,o]=$(!1),[t,c]=$(void 0),[l,r]=$(void 0),[a,i]=$(void 0),[u,m]=$({}),[p,b]=$(!1),[f,g]=$(void 0),h=async(S,C)=>{o(!0),c(S),r(C),i(void 0),m({}),g(void 0),b(!0);try{const k=await e.query(Cl,{table:S},Re(C)),{columns:N}=k;i(N);const w={},T=N.filter(F=>F.ref!==void 0&&F.type==="id"&&F.pk!==!0);for(const F of T){if(F.ref===void 0)continue;const{ref:R}=F;if(w[R]===void 0)try{const _=await e.query(Sl,{filters:[],limit:qs,offset:0,search:"",table:R},Re(C));w[R]=_.rows.flatMap(D=>kl(D)||[])}catch{w[R]=[]}}m(w)}catch(k){g(k.message)}b(!1)};return{closeDialog:()=>{o(!1),c(void 0),r(void 0),i(void 0),m({}),g(void 0)},columnMeta:a,error:f,fkPools:u,insertBatch:async(S,C)=>{if(t===void 0||l===void 0)return{conflicts:0,error:"No table selected.",inserted:0};try{const k=await e.query(Nl,{rows:S.map(w=>({doc:w,table:t}))},Re(l)),N=Tl(k);return N.error!==void 0||(C(),s()),N}catch(k){return{conflicts:0,error:k.message,inserted:0}}},loading:p,open:n,openDialog:(S,C)=>{Ce(h(S,C))},shardKey:l,table:t}},_l=s=>{const e=B(6),[n,o]=$(null);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=()=>{o(null)},e[0]=t):t=e[0];const c=t,[l,r]=$(null);let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a=(g,h,x)=>{r({column:g,storedValue:x,value:h})},e[1]=a):a=e[1];const i=a;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{r(null)},e[2]=u):u=e[2];const m=u,[p,b]=$(s);p!==s&&(b(s),o(null),r(null));let f;return e[3]!==l||e[4]!==n?(f={closeExpandedCell:m,closeInspect:c,expandedCell:l,inspecting:n,onExpandCell:i,onInspect:o},e[3]=l,e[4]=n,e[5]=f):f=e[5],f},Rl=/(?:_creationtime|(?:^|[a-z])(?:time|at))$/iu,$l=(s,e)=>typeof e=="number"&&Rl.test(s),Dl=s=>{const e=B(36),{column:n,masked:o,onNavigate:t,target:c,value:l}=s;let r;e[0]!==t||e[1]!==c||e[2]!==l?(r=()=>{c!==void 0&&t(c,String(l))},e[0]=t,e[1]=c,e[2]=l,e[3]=r):r=e[3];const a=r;if(l==null){let m;return e[4]===Symbol.for("react.memo_cache_sentinel")?(m=d("span",{className:"italic text-muted-foreground",children:"null"}),e[4]=m):m=e[4],m}if(o){const m=`rd-masked-${n}`;let p;e[5]!==l?(p=Me(l),e[5]=l,e[6]=p):p=e[6];let b;return e[7]!==m||e[8]!==p?(b=d("span",{className:"italic text-muted-foreground","data-testid":m,title:"Masked (preview)",children:p}),e[7]=m,e[8]=p,e[9]=b):b=e[9],b}if(c!==void 0&&(typeof l=="string"||typeof l=="number")&&String(l)!==""){const m=`rd-ref-${n}`,p=`Open ${c} ${String(l)}`,b=String(l);let f;return e[10]!==a||e[11]!==m||e[12]!==p||e[13]!==b?(f=E("button",{"data-testid":m,onClick:a,title:p,type:"button",children:[b," ↗"]}),e[10]=a,e[11]=m,e[12]=p,e[13]=b,e[14]=f):f=e[14],f}if($l(n,l)){const m=`rd-ts-${n}`;let p;e[15]!==l?(p=l.toString(),e[15]=l,e[16]=p):p=e[16];let b;e[17]!==l?(b=Wn(l),e[17]=l,e[18]=b):b=e[18];let f;return e[19]!==m||e[20]!==p||e[21]!==b?(f=d("span",{"data-testid":m,title:p,children:b}),e[19]=m,e[20]=p,e[21]=b,e[22]=f):f=e[22],f}if(l instanceof ArrayBuffer||ArrayBuffer.isView(l)){const m=`rd-bytes-${n}`;let p;e[23]!==l?(p=Me(l),e[23]=l,e[24]=p):p=e[24];let b;return e[25]!==m||e[26]!==p?(b=d("span",{"data-testid":m,children:p}),e[25]=m,e[26]=p,e[27]=b):b=e[27],b}if(typeof l=="object"){let m;e[28]!==l?(m=JSON.stringify(l,on,2),e[28]=l,e[29]=m):m=e[29];let p;return e[30]!==m?(p=d("pre",{className:"m-0 overflow-auto rounded-md bg-muted/50 p-2 text-xs",children:m}),e[30]=m,e[31]=p):p=e[31],p}let i;e[32]!==l?(i=Me(l),e[32]=l,e[33]=i):i=e[33];let u;return e[34]!==i?(u=d("span",{children:i}),e[34]=i,e[35]=u):u=e[35],u},Al=s=>{const e=B(23),{columns:n,mask:o,onClose:t,onNavigate:c,refs:l,row:r}=s;let a;e[0]!==t||e[1]!==c?(a=(g,h)=>{c(g,h),t()},e[0]=t,e[1]=c,e[2]=a):a=e[2];const i=a;let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=d("h3",{className:"m-0 text-base text-foreground",children:"Row detail"}),e[3]=u):u=e[3];let m;e[4]!==t?(m=E("div",{className:"mb-3 flex items-center justify-between",children:[u,d("button",{"data-testid":"rd-close",onClick:t,type:"button",children:"Close"})]}),e[4]=t,e[5]=m):m=e[5];let p;if(e[6]!==n||e[7]!==o||e[8]!==i||e[9]!==l||e[10]!==r){let g;e[12]!==o||e[13]!==i||e[14]!==l||e[15]!==r?(g=h=>E("div",{className:"border-t border-border py-2 first:border-t-0","data-testid":`rd-field-${h}`,children:[d("dt",{className:"mb-0.5 text-xs font-semibold text-muted-foreground",children:h}),d("dd",{className:"m-0",children:d(Dl,{column:h,masked:o.enabled&&o.columns.has(h),onNavigate:i,target:l?.[h],value:r[h]})})]},h),e[12]=o,e[13]=i,e[14]=l,e[15]=r,e[16]=g):g=e[16],p=n.map(g),e[6]=n,e[7]=o,e[8]=i,e[9]=l,e[10]=r,e[11]=p}else p=e[11];let b;e[17]!==p?(b=d("dl",{"data-testid":"rd-fields",children:p}),e[17]=p,e[18]=b):b=e[18];let f;return e[19]!==t||e[20]!==m||e[21]!==b?(f=E(ft,{label:"Row detail",onClose:t,panelTestId:"rd-panel",testId:"rd-overlay",variant:"drawer",children:[m,b]}),e[19]=t,e[20]=m,e[21]=b,e[22]=f):f=e[22],f},Pl=50,Il=s=>{const e=B(8),{active:n,onPick:o,shard:t}=s;let c;e[0]!==o||e[1]!==t?(c=()=>{o(t)},e[0]=o,e[1]=t,e[2]=c):c=e[2];const l=c,r=`w-full rounded px-2 py-0.5 text-left text-xs transition-colors hover:bg-accent ${n?"bg-accent font-medium":""}`,a=`shard-explorer-item-${t}`;let i;return e[3]!==l||e[4]!==t||e[5]!==r||e[6]!==a?(i=d("button",{className:r,"data-testid":a,onClick:l,type:"button",children:t}),e[3]=l,e[4]=t,e[5]=r,e[6]=a,e[7]=i):i=e[7],i},Ol=({onFetchTables:s,onSelect:e})=>{const n=ve(),[o]=$(()=>Eo()),[t,c]=$(!1),[l,r]=$(void 0),[a,i]=$(void 0),[u,m]=$(!1),[p,b]=$(void 0),f=Ke(0),g=()=>{c(v=>!v)},h=async v=>{e(v),r(v),i(void 0),b(void 0),m(!0),f.current+=1;const y=f.current;try{const S=await s(v);f.current===y&&i(S?.slice(0,Pl))}catch(S){f.current===y&&b(S.message)}f.current===y&&m(!1)},x=v=>{Ce(h(v))};return o.length===0?null:E("div",{"data-testid":"shard-explorer",children:[E("button",{"aria-controls":"shard-explorer-panel","aria-expanded":t,className:"inline-flex items-center gap-1 rounded-md border border-border px-2 py-1 text-xs font-medium text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent","data-testid":"shard-explorer-toggle",onClick:g,type:"button",children:[n("Shards seen"),d("span",{"aria-hidden":"true",className:`ml-0.5 transition-transform ${t?"rotate-180":""}`,children:"▾"})]}),t&&E("div",{className:"mt-1 flex flex-col gap-1 rounded-md border border-border bg-popover p-2","data-testid":"shard-explorer-panel",id:"shard-explorer-panel",children:[d("p",{className:"text-xs text-muted-foreground","data-testid":"shard-explorer-hint",children:n("Recently visited shards — click to switch")}),d("ul",{className:"flex flex-col gap-0.5","data-testid":"shard-explorer-list",children:o.map(v=>d("li",{children:d(Il,{active:l===v,onPick:x,shard:v})},v))}),l!==void 0&&E("div",{className:"mt-1 border-t border-border pt-1","data-testid":"shard-explorer-summary",children:[d("p",{className:"mb-1 text-xs font-medium text-foreground","data-testid":"shard-explorer-summary-title",children:n("{shard} tables",{shard:l})}),u&&d("p",{className:"text-xs text-muted-foreground","data-testid":"shard-explorer-loading",children:n("Loading…")}),p!==void 0&&d("p",{className:"text-xs text-destructive","data-testid":"shard-explorer-error",role:"alert",children:p}),!u&&p===void 0&&a?.length===0&&d("p",{className:"text-xs text-muted-foreground","data-testid":"shard-explorer-empty",children:n("No tables in this shard.")}),!u&&p===void 0&&a!==void 0&&a.length>0&&d("ul",{className:"flex flex-col gap-0.5","data-testid":"shard-explorer-tables",children:a.map(v=>E("li",{className:"flex items-center justify-between text-xs",children:[d("span",{"data-testid":`shard-explorer-table-${v.name}`,children:v.name}),d("span",{className:"text-muted-foreground","data-testid":`shard-explorer-rowcount-${v.name}`,children:v.rowCount})]},v.name))})]})]})]})},Fl="lunora-studio-back-relations",Ml=s=>new Set((s??[]).filter(e=>e.unique===!0&&e.fields.length===1).map(e=>e.fields[0]??"")),Vl=(s,e)=>s==null||typeof s=="string"||typeof s=="number"&&Number.isFinite(s)||typeof s=="boolean"||typeof s=="bigint"&&e==="bigint",Ll=(s,e)=>e===null&&(s==="eq"||s==="ne")?{literal:[null],value:"null"}:typeof e!="string"&&typeof e!="number"&&typeof e!="boolean"?{value:""}:typeof e=="string"&&(s==="eq"||s==="ne")?{literal:[e],value:e}:s!=="has"&&typeof e!="boolean"?{value:String(e)}:{literal:[e],value:typeof e=="string"?`"${e}"`:String(e)},Bl={},jl=50,zl=[],ql=$e(he.listTables),Kl=$e(he.readTablePage),Gl=s=>{const e=B(10),{onFetchShardTables:n,onShardChange:o,schemaSwitch:t,shardKey:c}=s;let l;e[0]!==o||e[1]!==c?(l=d(Gn,{onChange:o,testId:"db-shard-input",value:c}),e[0]=o,e[1]=c,e[2]=l):l=e[2];let r;e[3]!==n||e[4]!==o?(r=d(Ol,{onFetchTables:n,onSelect:o}),e[3]=n,e[4]=o,e[5]=r):r=e[5];let a;return e[6]!==t||e[7]!==l||e[8]!==r?(a=E("div",{className:"flex shrink-0 flex-col items-stretch gap-2 border-b border-border p-3",children:[t,l,r]}),e[6]=t,e[7]=l,e[8]=r,e[9]=a):a=e[9],a},Nr=({canGenerateRows:s=!1,editable:e=!1,globalTableNames:n,initialFilters:o,initialOrderBy:t,initialPins:c,initialSearch:l,initialShardKey:r,onNavigateToGlobal:a,onSelectTable:i,onViewChange:u,pageSize:m=jl,queryBar:p,schemaSwitch:b,tableParam:f})=>{const g=Ze(he.describeTables,{},{shardKey:r??""}),h=Ze(he.listTablesIndexes,{},{shardKey:r??""}),x=g.data?.columnsByTable??Bl,[v,y]=nn(Fl,{}),S=ct(M=>{const Z=new Set(v[M]);return Jt(M,x).filter(Oe=>Z.has(Ot(Oe)))},[v,x]),C=hl({initialFilters:o,initialOrderBy:t,initialSearch:l,initialShardKey:r,onSelectTable:i,onViewChange:u,pageSize:m,resolveBackRelations:S,tableParam:f}),{cancelCellEdit:k,columns:N,currentView:w,editableColumn:T,editingCell:F,facetFilter:R,facets:_,loadTables:D,navigateToRef:O,onFiltersChange:V,page:A,pageError:L,previewRef:G,queryShardKey:q,selectedTable:P,selectTable:J,setShardKey:K,shardKey:H,stage:Y,stagedValue:U,startCellEdit:ne,tables:le,tablesError:ae,toggleFacet:ge}=C,fe=Zn(H),me=Xe(P),pe=M=>{const Z=P;Ce((async()=>{const Be=await fe.suggestFilter(M,Z??"");Be!==void 0&&me.current===Z&&V(Be.map(Ee=>{const{literal:ot,value:st}=Ll(Ee.operator,Ee.value),lt=Ee.path===void 0||Ee.path.length===0?{}:{path:Ee.path.join("."),pathSegments:Ee.path};return{column:Ee.column,operator:Ee.operator,...lt,...ot===void 0?{}:{literal:ot},value:st}}))})())},ie=P===null?[]:Jt(P,x),Q=new Set(v[P??""]),be=[];for(const M of A?.rows??[]){const Z=M._id??M.id;typeof Z=="string"&&Z!==""&&be.push(Z)}const ce=Ys(Q,ie,be,q),Se=M=>{y(Z=>{const Oe=P??"",Be=Z[Oe]??[];return{...Z,[Oe]:Be.includes(M)?Be.filter(Ee=>Ee!==M):[...Be,M]}})},oe=vl({columns:N,initialPins:c,selectedTable:P}),se=_l(JSON.stringify([P,q])),[W,j]=$(null),{closeExpandedCell:re,closeInspect:X,expandedCell:ee,inspecting:we,onExpandCell:xe}=se,de=ut(),te=Object.fromEntries((x[P??""]??[]).map(M=>[M.name,M])),De=new Map;for(const M of x[P??""]??[])M.isStorage===!0&&De.set(M.name,M.bucket);const Ve=ct(async(M,Z)=>de.signedStorageUrl(M,Z===void 0?{}:{bucket:Z}),[de]),Le=async M=>await de.query(ql,{},Re(M)),Ne=()=>{P!==null&&J(P)},{closeDialog:ue,columnMeta:ke,fkPools:Ge,insertBatch:qe,open:He,openDialog:mt}=El(Ne),gt=()=>{P!==null&&mt(P,H)},tt=M=>qe(M,ue),[pt,nt]=$(!1),bt=()=>{nt(!0)},ht=()=>{nt(!1)},Ue=(M,Z)=>{if(a!==void 0&&n?.has(M)===!0){a(M,Z);return}O(M,Z)},Qe=p?.onSaveQuery,xt=M=>{Qe?.(M,w)},vt={cancelEdit:k,editable:e,editableColumn:T,editingCell:F,onExpandCell:xe,stage:Y,stagedValue:U,startEdit:ne},wt=M=>{M!==null&&j(M)},yt=()=>{C.onRowDelete(W)},Ct=async(M,Z,Oe)=>await de.query(Kl,{filters:[{column:Z,operator:"eq",value:Oe}],limit:at,offset:0,orderBy:[],table:M},Re(q)),St={columns:A?.refs,maskViewFor:oe.maskViewFor,onNavigate:Ue,onPreview:G};return E("div",{className:"flex h-full min-w-0","data-testid":"lunora-data-browser",children:[d(Yn,{header:d(Gl,{onFetchShardTables:Le,onShardChange:K,schemaSwitch:b,shardKey:H}),onReload:D,onSelect:J,prefix:"db",selected:P,tables:le??zl}),E("div",{className:"flex min-w-0 flex-1 flex-col overflow-hidden",children:[ae!==null&&d("p",{className:"shrink-0 border-b border-border px-4 py-2 text-sm text-destructive","data-testid":"db-tables-error",role:"alert",children:ae}),A===null&&L===null&&d("div",{className:"flex flex-1 items-center justify-center p-6",children:d("p",{className:"text-sm text-muted-foreground",children:"Select a table to browse its rows."})}),L!==null&&d("p",{className:"shrink-0 border-b border-border px-4 py-2 text-sm text-destructive","data-testid":"db-page-error",role:"alert",children:L}),A!==null&&d(js,{assistant:fe,backRelations:{available:ie,counts:ce,enabled:Q,onToggle:Se},browser:C,columnMeta:te,edit:vt,editable:e,onAskAiFilter:pe,onInspect:se.onInspect,onOpenBulkPatch:bt,onOpenGenerateRows:s?gt:void 0,onRowDelete:wt,onSaveQuery:xt,page:A,preferences:oe,queryBar:p,references:St})]}),A!==null&&d(Xn,{columns:N,facets:_,mask:oe.maskView,onFacetFilter:R,onToggleFacet:ge}),we!==null&&A!==null&&d(Al,{columns:A.columns,mask:oe.maskView,onClose:X,onNavigate:Ue,refs:A.refs,row:sn(we,oe.maskView)}),W!==null&&P!==null&&d(Bo,{onClose:()=>{j(null)},onConfirm:yt,readPage:Ct,rowId:W,schema:_o(x),table:P}),ee!==null&&d(No,{bucket:De.get(ee.column),column:ee.column,onClose:re,onFilter:Vl(ee.storedValue,te[ee.column]?.type)?()=>{R(ee.column,ee.storedValue??null),re()}:void 0,resolveUrl:De.has(ee.column)?Ve:void 0,value:ee.value}),pt&&P!==null&&d(Do,{columns:C.columns.filter(M=>C.editableColumn(M)),onApply:C.bulkPatch,onClose:ht,shardKey:C.queryShardKey,table:P,total:C.total,uniqueColumns:Ml(h.data?.indexesByTable[P])}),He&&P!==null&&ke!==void 0&&d(Us,{columns:ke,fkPools:Ge,onClose:ue,onInsertRows:tt,table:P})]})};export{Nr as DataBrowser};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as H}from"react/compiler-runtime";import{useState as K}from"react";import{useT as $}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{jsxs as V,Fragment as z,jsx as c}from"react/jsx-runtime";const B=[{label:"=",value:"eq"},{label:"≠",value:"ne"},{label:"<",value:"lt"},{label:"≤",value:"lte"},{label:">",value:"gt"},{label:"≥",value:"gte"},{label:"contains",value:"contains"}],E=t=>{const e=t.trim(),n=Number(e);return e!==""&&Number.isFinite(n)&&String(n)===e?n:t},G=t=>{const e=t.trim();return(e.length>=2&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):void 0)??(e==="true"||e==="false"?e==="true":E(t))},I=t=>t.operator==="has"?G(t.value):E(t.value),J=t=>t.operator==="contains"?t.value==="":t.operator!=="eq"&&t.operator!=="ne"&&t.literal===void 0&&t.value.trim()==="",L=t=>{if(t.pathSegments!==void 0)return t.pathSegments;const e=t.path??"";return e.trim()===""?void 0:e.split(".").map(n=>n.trim())},_=t=>t.filter(e=>e.column!==""&&!J(e)).map(e=>{const n=L(e),a=n===void 0?{}:{path:n};return e.operator==="contains"?{column:e.column,operator:e.operator,...a,value:e.value}:{column:e.column,operator:e.operator,...a,value:e.literal===void 0?I(e):e.literal[0]}}),j=(t,e)=>({column:t.column,operator:t.operator,path:t.path,pathSegments:t.pathSegments,value:t.value,...e}),ee=t=>{const e=H(51),{columns:n,filters:a,onAskAi:x,onFiltersChange:l,onSearchChange:D,search:R}=t,[d,W]=K(""),u=$();let T;e[0]!==n[0]||e[1]!==a||e[2]!==l?(T=()=>{l([...a,{column:n[0]??"",operator:"eq",value:""}])},e[0]=n[0],e[1]=a,e[2]=l,e[3]=T):T=e[3];const O=T;let w;e[4]!==a||e[5]!==l?(w=r=>{const s=Number(r.currentTarget.dataset.index);l(a.filter((o,i)=>i!==s))},e[4]=a,e[5]=l,e[6]=w):w=e[6];const f=w;let y;e[7]!==a||e[8]!==l?(y=r=>{const s=Number(r.currentTarget.dataset.index),o=r.currentTarget.value;l(a.map((i,p)=>p===s?j(i,{column:o,path:void 0,pathSegments:void 0}):i))},e[7]=a,e[8]=l,e[9]=y):y=e[9];const C=y;let q;e[10]!==a||e[11]!==l?(q=r=>{const s=Number(r.currentTarget.dataset.index),o=r.currentTarget.value;l(a.map((i,p)=>p!==s?i:o==="has"?j(i,{operator:o}):{...i,operator:o}))},e[10]=a,e[11]=l,e[12]=q):q=e[12];const F=q;let k;e[13]!==a||e[14]!==l?(k=r=>{const s=Number(r.currentTarget.dataset.index),o=r.currentTarget.value;l(a.map((i,p)=>p===s?{...i,path:o,pathSegments:void 0}:i))},e[13]=a,e[14]=l,e[15]=k):k=e[15];const N=k;let A;e[16]!==a||e[17]!==l?(A=r=>{const s=Number(r.currentTarget.dataset.index),o=r.currentTarget.value;l(a.map((i,p)=>p===s?j(i,{value:o}):i))},e[16]=a,e[17]=l,e[18]=A):A=e[18];const S=A;let m;e[19]!==D||e[20]!==R?(m=c("input",{"aria-label":"Search rows","data-testid":"db-filter",onChange:D,placeholder:"search table…",value:R}),e[19]=D,e[20]=R,e[21]=m):m=e[21];let h;e[22]!==O?(h=c("button",{"data-testid":"db-add-filter",onClick:O,type:"button",children:"Add filter"}),e[22]=O,e[23]=h):h=e[23];let v;e[24]!==d||e[25]!==x?(v=x!==void 0&&V(z,{children:[c("input",{"aria-label":"Describe a filter","data-testid":"db-ai-prompt",onChange:r=>{W(r.target.value)},onKeyDown:r=>{r.key==="Enter"&&d.trim()!==""&&(r.preventDefault(),x(d.trim()))},placeholder:"describe a filter…",value:d}),c("button",{"data-testid":"db-ai-filter",disabled:d.trim()==="",onClick:()=>{x(d.trim())},type:"button",children:"Suggest"})]}),e[24]=d,e[25]=x,e[26]=v):v=e[26];let b;e[27]!==m||e[28]!==h||e[29]!==v?(b=V("div",{className:"flex flex-wrap items-center gap-1.5",children:[m,h,v]}),e[27]=m,e[28]=h,e[29]=v,e[30]=b):b=e[30];let g;if(e[31]!==C||e[32]!==F||e[33]!==N||e[34]!==S||e[35]!==n||e[36]!==a||e[37]!==f||e[38]!==u){let r;e[40]!==C||e[41]!==F||e[42]!==N||e[43]!==S||e[44]!==n||e[45]!==f||e[46]!==u?(r=(s,o)=>V("div",{className:"flex flex-wrap items-center gap-1.5","data-testid":"db-filter-row",children:[c("select",{"aria-label":"Filter column","data-index":o,"data-testid":"db-filter-column",onChange:C,value:s.column,children:n.map(M)}),c("select",{"aria-label":"Filter operator","data-index":o,"data-testid":"db-filter-operator",onChange:F,value:s.operator,children:[...B,{label:u("has"),value:"has"}].map(Q)}),c("input",{"aria-label":u("Nested field path"),"data-index":o,"data-testid":"db-filter-path",onChange:N,placeholder:u("nested path, e.g. geo.city"),value:s.path??""}),c("input",{"aria-label":"Filter value","data-index":o,"data-testid":"db-filter-value",onChange:S,placeholder:s.operator==="has"?u('value ("10" in quotes matches text)'):"value",value:s.value}),c("button",{"aria-label":"Remove filter","data-index":o,"data-testid":"db-filter-remove",onClick:f,type:"button",children:"✕"})]},o),e[40]=C,e[41]=F,e[42]=N,e[43]=S,e[44]=n,e[45]=f,e[46]=u,e[47]=r):r=e[47],g=a.map(r),e[31]=C,e[32]=F,e[33]=N,e[34]=S,e[35]=n,e[36]=a,e[37]=f,e[38]=u,e[39]=g}else g=e[39];let P;return e[48]!==b||e[49]!==g?(P=V("div",{className:"flex flex-col gap-1.5","data-testid":"db-filters",children:[b,g]}),e[48]=b,e[49]=g,e[50]=P):P=e[50],P};function M(t){return c("option",{value:t,children:t},t)}function Q(t){return c("option",{value:t.value,children:t.label},t.value)}export{ee as DataFilters,_ as toFilterClauses};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Component as i}from"react";import{jsx as e,Fragment as l,jsxs as d}from"react/jsx-runtime";const c={border:"1px solid var(--destructive)",color:"var(--destructive)",padding:12},p={overflow:"auto",whiteSpace:"pre-wrap"};class g extends i{static getDerivedStateFromError(r){return{error:r}}state={error:null};componentDidCatch(r,t){console.error("[lunora-studio] panel error",r,t.componentStack)}reset=()=>{this.setState({error:null})};render(){const{children:r,fallbackTitle:t,label:o,retryLabel:n}=this.props,{error:s}=this.state;if(s===null)return e(l,{children:r});const a=t??(o===void 0?"Something went wrong":`${o} failed`);return d("div",{"data-testid":"dash-error-boundary",role:"alert",style:c,children:[e("strong",{children:a}),e("pre",{"data-testid":"dash-error-message",style:p,children:s.message}),e("button",{"data-testid":"dash-error-retry",onClick:this.reset,type:"button",children:n??"Try again"})]})}}export{g as ErrorBoundary};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useState as A,useRef as I,useEffect as J}from"react";import{a as Q}from"./use-admin-query-BW9IuacC.mjs";import{useAutoRefresh as B}from"./DEFAULT_AUTO_REFRESH_MS-CG7Q45ZS.mjs";import{u as me}from"./use-mirrored-ref-CVDf2z1M.mjs";import{u as ue}from"./use-studio-client-DCA50tF2.mjs";import{useT as _}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{b as fe}from"./cf-links-CBJ5SywP.mjs";import{l as pe,o as ge,f as be}from"./internal-BXEjuLPN.mjs";import{m as Z,u as he,a as xe,T as ke,D as ve}from"./table-list-sidebar-CCRB_iYz.mjs";import{c as X}from"react/compiler-runtime";import{c as Ne,a as ye,b as q,e as we,d as Te,T as Se}from"./table-D0SBiDu-.mjs";import{a as Ce}from"./control-button-BOZ5K-FC.mjs";import{C as K,G as Fe}from"./data-grid-r3isM8Nq.mjs";import{G as Pe}from"./grid-pagination-DY2erU65.mjs";import{jsx as r,jsxs as P}from"react/jsx-runtime";import{E as Ee}from"./empty-state-D7jEML_T.mjs";const Me=(t,e)=>{const n=t._id;return typeof n=="string"||typeof n=="number"?String(n):`row-${e.toString()}`},Ge=t=>t==null?"∅":t===""?"(empty)":pe(t),Re=t=>{const e=X(45),{filters:n,hasMaskedColumns:f,mask:s,maskOn:u,onChangePageSize:o,onJumpToPage:O,onNext:d,onPrevious:T,onRemoveFilter:p,onToggleMask:L,page:c,pageSize:E,pagination:S}=t,C=_(),{hasNext:z,hasPrevious:D,rangeEnd:$,rangeStart:F,total:k}=S;let v;e[0]!==f||e[1]!==u||e[2]!==L||e[3]!==C?(v=f&&r("div",{className:"flex shrink-0 flex-wrap items-center gap-1.5 border-b border-border px-4 py-2",children:r("button",{"aria-pressed":u,className:Ce,"data-testid":"gdb-mask-toggle",onClick:L,type:"button",children:C("Mask sensitive columns")})}),e[0]=f,e[1]=u,e[2]=L,e[3]=C,e[4]=v):v=e[4];let g;e[5]!==n||e[6]!==s||e[7]!==p||e[8]!==C?(g=n.length>0&&r("div",{className:"flex shrink-0 flex-wrap items-center gap-1.5 border-b border-border px-4 py-2 text-xs","data-testid":"gdb-filters",children:n.map((i,m)=>{const G=Ge(Z(i.value,i.column,s));return P("span",{className:"inline-flex items-center gap-1 rounded border border-border bg-muted px-1.5 py-0.5","data-testid":"gdb-filter-chip",children:[r("span",{className:"font-medium text-foreground",children:i.column}),r("span",{className:"text-muted-foreground",children:"="}),r("span",{className:"font-mono text-foreground",children:G}),r("button",{"aria-label":C("Remove filter"),className:"ml-0.5 text-muted-foreground hover:text-foreground","data-testid":"gdb-filter-remove",onClick:()=>{p(m)},type:"button",children:"✕"})]},`${i.column}:${G}`)})}),e[5]=n,e[6]=s,e[7]=p,e[8]=C,e[9]=g):g=e[9];let a;if(e[10]!==s||e[11]!==c.columns){let i;e[13]!==s?(i=m=>P(Ne,{children:[m,s.columns.has(m)&&r("span",{className:"ms-1 inline-flex items-center rounded-sm bg-warning/15 px-1 text-[0.625rem] font-medium uppercase text-warning","data-testid":`gdb-mask-chip-${m}`,title:"This column is masked by a mask() policy",children:"masked"})]},m),e[13]=s,e[14]=i):i=e[14],a=c.columns.map(i),e[10]=s,e[11]=c.columns,e[12]=a}else a=e[12];let b;e[15]!==a?(b=r(ye,{children:r(q,{children:a})}),e[15]=a,e[16]=b):b=e[16];let N;if(e[17]!==s||e[18]!==c.columns||e[19]!==c.rows){let i;e[21]!==s||e[22]!==c.columns?(i=(m,G)=>r(q,{"data-testid":"gdb-row",children:c.columns.map(w=>r(we,{className:"max-w-xs truncate font-mono text-xs",children:s.enabled&&s.columns.has(w)?r("span",{className:"text-muted-foreground italic","data-testid":`gdb-masked-${w}`,title:"Masked (preview)",children:r(K,{value:Z(m[w],w,s)})}):r(K,{value:m[w]})},w))},Me(m,G)),e[21]=s,e[22]=c.columns,e[23]=i):i=e[23],N=c.rows.map(i),e[17]=s,e[18]=c.columns,e[19]=c.rows,e[20]=N}else N=e[20];let y;e[24]!==N?(y=r(Te,{children:N}),e[24]=N,e[25]=y):y=e[25];let h;e[26]!==b||e[27]!==y?(h=r(Fe,{layout:"fill",children:r("div",{className:"min-h-0 flex-1 overflow-auto",children:P(Se,{"data-testid":"gdb-rows",children:[b,y]})})}),e[26]=b,e[27]=y,e[28]=h):h=e[28];let x;e[29]!==z||e[30]!==D||e[31]!==o||e[32]!==O||e[33]!==d||e[34]!==T||e[35]!==E||e[36]!==$||e[37]!==F||e[38]!==k?(x=r("div",{className:"flex shrink-0 items-center border-t border-border px-4 py-2",children:r(Pe,{hasNext:z,hasPrevious:D,onJumpToPage:O,onNext:d,onPageSizeChange:o,onPrevious:T,pageSize:E,prefix:"gdb",rangeEnd:$,rangeStart:F,total:k})}),e[29]=z,e[30]=D,e[31]=o,e[32]=O,e[33]=d,e[34]=T,e[35]=E,e[36]=$,e[37]=F,e[38]=k,e[39]=x):x=e[39];let M;return e[40]!==v||e[41]!==g||e[42]!==h||e[43]!==x?(M=P("div",{className:"flex min-h-0 flex-1 flex-col","data-testid":"gdb-page",children:[v,g,h,x]}),e[40]=v,e[41]=g,e[42]=h,e[43]=x,e[44]=M):M=e[44],M},Oe=()=>{const t=X(8),e=_();let n;t[0]!==e?(n=e("Tables marked .global() (D1-backed, region-replicated) will appear here."),t[0]=e,t[1]=n):n=t[1];let f;t[2]===Symbol.for("react.memo_cache_sentinel")?(f=P("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[r("circle",{cx:"12",cy:"12",r:"9"}),r("path",{d:"M3 12h18M12 3a14 14 0 0 1 0 18 14 14 0 0 1 0-18Z"})]}),t[2]=f):f=t[2];let s;t[3]!==e?(s=e("No global tables."),t[3]=e,t[4]=s):s=t[4];let u;return t[5]!==n||t[6]!==s?(u=r("div",{className:"flex flex-1 items-center justify-center p-6",children:r(Ee,{description:n,icon:f,testId:"gdb-empty",title:s})}),t[5]=n,t[6]=s,t[7]=u):u=t[7],u},Le=50,ze=[],W=[],Xe=({initialTable:t,onSelectTable:e,pageSize:n=Le,schemaSwitch:f}={})=>{const s=ue(),u=_(),[o,O]=A(t??null),[d,T]=A(0),[p,L]=A(n),[c,E]=A([]),S=me(c),{clearFacets:C,facets:z,refetchFacets:D,toggleFacet:$}=he(),F=Q(["lunora-global-tables"],()=>s.listGlobalTables()),k=F.data??null,v=F.error,g=Q(["lunora-global-page",o??"",d,p,JSON.stringify(c)],()=>s.readGlobalTablePage({filters:c,limit:p,offset:d,table:o??""}),{enabled:o!==null,keepPreviousData:!1}),a=g.data??null,b=g.error,N=(l,R)=>j=>s.facetGlobalColumn({column:j,filters:R,table:l}),y=(l,R)=>D(N(l,R));B(()=>F.poll(),!0),B(()=>g.poll(),o!==null),B(()=>o===null?void 0:y(o,S.current),o!==null);const h=I(void 0),x=l=>{O(l),h.current=l,E([]),S.current=[],C(),T(0),e?.(l)},M=l=>{$(l,o===null?null:N(o,S.current))},i=l=>{E(l),S.current=l,T(0),o!==null&&be(y(o,l))},m=(l,R)=>{i([...S.current.filter(j=>j.column!==l),{column:l,value:ge(R)}])},G=l=>{i(S.current.filter((R,j)=>j!==l))},w=I(x);J(()=>{w.current=x}),J(()=>{if(t===void 0||t===""||h.current===t)return;h.current=t;const l=t;queueMicrotask(()=>{w.current(l)})},[t]);const V=l=>{o!==null&&T(Math.max(0,l))},{maskColumns:Y,maskOn:ee,maskView:U,onToggleMask:te}=xe({columns:a?.columns??W,selectedTable:o}),H=a?.total??0,re=d>0,se=a!==null&&d+a.rows.length<H,le=a===null||a.rows.length===0?0:d+1,ae=a===null?0:d+a.rows.length,oe=()=>{F.refetch()},ne=()=>{V(d-p)},ie=()=>{V(d+p)},ce=l=>{V(Math.max(0,(l-1)*p))},de=l=>{L(l),T(0)};return P("div",{className:"flex h-full min-w-0","data-testid":"lunora-global-data-browser",children:[r(ke,{header:P("div",{className:"flex shrink-0 flex-col items-stretch gap-2 border-b border-border p-3",children:[f,r("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"gdb-cf-link",href:fe,rel:"noreferrer",target:"_blank",children:u("Open in Cloudflare")})]}),onReload:oe,onSelect:x,prefix:"gdb",selected:o,tables:k??ze}),P("div",{className:"flex min-w-0 flex-1 flex-col overflow-hidden",children:[v!==null&&r("p",{className:"shrink-0 border-b border-border px-4 py-2 text-sm text-destructive","data-testid":"gdb-tables-error",role:"alert",children:v}),k!==null&&k.length===0&&r(Oe,{}),b!==null&&r("p",{className:"shrink-0 border-b border-border px-4 py-2 text-sm text-destructive","data-testid":"gdb-page-error",role:"alert",children:b}),k!==null&&k.length>0&&a===null&&b===null&&r("div",{className:"flex flex-1 items-center justify-center p-6",children:r("p",{className:"text-sm text-muted-foreground",children:u("Select a table to browse its rows.")})}),a!==null&&r(Re,{filters:c,hasMaskedColumns:Y.size>0,mask:U,maskOn:ee,onChangePageSize:de,onJumpToPage:ce,onNext:ie,onPrevious:ne,onRemoveFilter:G,onToggleMask:te,page:a,pageSize:p,pagination:{hasNext:se,hasPrevious:re,rangeEnd:ae,rangeStart:le,total:H}})]}),r(ve,{columns:a?.columns??W,facets:z,mask:U,onFacetFilter:m,onToggleFacet:M})]})};export{Xe as GlobalDataBrowser};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./badge-r_5B4LHP.mjs";import"./card-By2O8ULa.mjs";import"./empty-state-D7jEML_T.mjs";import"./use-admin-query-BW9IuacC.mjs";import"./DEFAULT_LOCALE-BQ3jRT74.mjs";import"./ADMIN_FUNCTIONS-4aGsMs95.mjs";import"./internal-BXEjuLPN.mjs";import"./utils-bhneXptQ.mjs";import"./DEFAULT_INSIGHT_THRESHOLDS-D5YMT0gM.mjs";import{H,c as f}from"./home-panel-DPiMVQZ2.mjs";export{H as HomePanel,f as cacheFooterText};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as Ne}from"react/compiler-runtime";import{useState as Q,useEffect as Se}from"react";import{ConfirmButton as Ie}from"./ConfirmButton-CIXYF6Mg.mjs";import{E as Ee}from"./error-alert-54TiaMvZ.mjs";import{L as Me}from"./live-status-D1GasNsH.mjs";import{ShardInput as Te}from"./ShardInput-CoySruKZ.mjs";import{B as _e}from"./badge-r_5B4LHP.mjs";import{B as ke}from"./button-q0UYSmrn.mjs";import{C as we,a as De}from"./card-By2O8ULa.mjs";import{E as Le}from"./empty-state-D7jEML_T.mjs";import{I as Be}from"./input-CXhxesPC.mjs";import{L as me}from"./label-DKFzyHq6.mjs";import{T as Ae,a as Ke,b as fe,c as m,d as je,e as f}from"./table-D0SBiDu-.mjs";import{u as Fe}from"./use-admin-query-BW9IuacC.mjs";import{u as Oe}from"./use-shard-key-BsP3o5wT.mjs";import{u as qe}from"./use-studio-client-DCA50tF2.mjs";import{useT as He}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{ADMIN_FUNCTIONS as he}from"./ADMIN_FUNCTIONS-4aGsMs95.mjs";import{h as Qe,c as Ue,f as $e,d as ze,b as Ge}from"./internal-BXEjuLPN.mjs";import{r as Pe}from"./shard-history-CaO3C4KQ.mjs";import{jsx as r,jsxs as s}from"react/jsx-runtime";const We=Ue(he.runMigration),yt=i=>{const e=Ne(98),{initialShardKey:pe}=i,re=qe(),t=He(),{queryShardKey:d,setShardKey:ie,shardKey:a}=Oe(pe),[h,ge]=Q(""),[p,ye]=Q("up"),[l,be]=Q(!0),[g,ce]=Q(!1),[c,ne]=Q(null),[U,se]=Q(null);let $;e[0]!==a?($=a.trim(),e[0]=a,e[1]=$):$=e[1];const z=$===d;let G;e[2]===Symbol.for("react.memo_cache_sentinel")?(G={},e[2]=G):G=e[2];let P;e[3]!==d?(P={live:!0,shardKey:d},e[3]=d,e[4]=P):P=e[4];const n=Fe(he.migrationStatus,G,P),o=n.data?.migrations??null,ae=n.error,{errorSource:le,liveError:oe}=n;let W,J;e[5]!==d||e[6]!==n.data?(W=()=>{n.data!==void 0&&Pe(d)},J=[n.data,d],e[5]=d,e[6]=n.data,e[7]=W,e[8]=J):(W=e[7],J=e[8]),Se(W,J);let V;if(e[9]!==re||e[10]!==p||e[11]!==l||e[12]!==h||e[13]!==a||e[14]!==n||e[15]!==t){const u=async()=>{const ue=h.trim();if(ue===""){se(t("Enter a migration id")),ne(null);return}ce(!0),se(null);try{const de=await re.query(We,{direction:p,dryRun:l,id:ue},ze(a));ne(de),n.refetch()}catch(de){const Ce=de;ne(null),se(Ge(Ce))}ce(!1)};V=()=>{$e(u())},e[9]=re,e[10]=p,e[11]=l,e[12]=h,e[13]=a,e[14]=n,e[15]=t,e[16]=V}else V=e[16];const X=V;let Y;e[17]===Symbol.for("react.memo_cache_sentinel")?(Y=u=>{ge(u.target.value)},e[17]=Y):Y=e[17];const ve=Y;let Z;e[18]===Symbol.for("react.memo_cache_sentinel")?(Z=u=>{ye(u.target.value==="down"?"down":"up")},e[18]=Z):Z=e[18];const xe=Z;let ee;e[19]===Symbol.for("react.memo_cache_sentinel")?(ee=u=>{be(u.target.checked)},e[19]=ee):ee=e[19];const Re=ee;let y;e[20]!==ie||e[21]!==a?(y=r(Te,{onChange:ie,testId:"mg-shard-input",value:a}),e[20]=ie,e[21]=a,e[22]=y):y=e[22];let b;e[23]!==oe?(b=r(Me,{message:oe,prefix:"mg"}),e[23]=oe,e[24]=b):b=e[24];let v;e[25]!==y||e[26]!==b?(v=s("div",{className:"flex flex-wrap items-center gap-2",children:[y,b]}),e[25]=y,e[26]=b,e[27]=v):v=e[27];let x;e[28]!==ae||e[29]!==le?(x=ae!==null&&r(Ee,{error:le,testId:"mg-status-error"}),e[28]=ae,e[29]=le,e[30]=x):x=e[30];let R;e[31]!==o||e[32]!==t?(R=o!==null&&o.length===0&&r(Le,{description:t("Data migrations you run against this shard will be tracked here."),icon:r("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:r("path",{d:"M4 12a8 8 0 0 1 13.7-5.6L20 8M20 4v4h-4M20 12a8 8 0 0 1-13.7 5.6L4 16m0 4v-4h4"})}),testId:"mg-empty",title:t("No migrations have run on this shard.")}),e[31]=o,e[32]=t,e[33]=R):R=e[33];let C;e[34]!==o||e[35]!==t?(C=o!==null&&o.length>0&&r(we,{className:"overflow-hidden py-0",children:r(De,{className:"px-0",children:s(Ae,{"data-testid":"mg-table",children:[r(Ke,{children:s(fe,{children:[r(m,{children:t("id")}),r(m,{children:t("direction")}),r(m,{children:t("status")}),r(m,{children:t("processed")}),r(m,{children:t("changed")}),r(m,{children:t("updated")}),r(m,{children:t("error")})]})}),r(je,{children:o.map(Je)})]})})}),e[34]=o,e[35]=t,e[36]=C):C=e[36];let N;e[37]!==t?(N=t("Run migration"),e[37]=t,e[38]=N):N=e[38];let S;e[39]!==N?(S=r(me,{children:N}),e[39]=N,e[40]=S):S=e[40];let I;e[41]!==t?(I=t("Migration id"),e[41]=t,e[42]=I):I=e[42];let E;e[43]!==t?(E=t("migration id"),e[43]=t,e[44]=E):E=e[44];let M;e[45]!==h||e[46]!==I||e[47]!==E?(M=r(Be,{"aria-label":I,className:"w-auto","data-testid":"mg-id-input",onChange:ve,placeholder:E,value:h}),e[45]=h,e[46]=I,e[47]=E,e[48]=M):M=e[48];let T;e[49]!==t?(T=t("Direction"),e[49]=t,e[50]=T):T=e[50];let _;e[51]!==t?(_=t("up"),e[51]=t,e[52]=_):_=e[52];let k;e[53]!==_?(k=r("option",{value:"up",children:_}),e[53]=_,e[54]=k):k=e[54];let w;e[55]!==t?(w=t("down"),e[55]=t,e[56]=w):w=e[56];let D;e[57]!==w?(D=r("option",{value:"down",children:w}),e[57]=w,e[58]=D):D=e[58];let L;e[59]!==p||e[60]!==T||e[61]!==k||e[62]!==D?(L=s("select",{"aria-label":T,className:"flex h-8 rounded-md border border-input bg-transparent px-2.5 py-1 text-xs transition-colors outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 dark:bg-input/30","data-testid":"mg-direction",onChange:xe,value:p,children:[k,D]}),e[59]=p,e[60]=T,e[61]=k,e[62]=D,e[63]=L):L=e[63];let B;e[64]!==l?(B=r("input",{checked:l,className:"size-4 accent-primary","data-testid":"mg-dry-run",id:"mg-dry-run",onChange:Re,type:"checkbox"}),e[64]=l,e[65]=B):B=e[65];let A;e[66]!==t?(A=t("Dry run"),e[66]=t,e[67]=A):A=e[67];let K;e[68]!==B||e[69]!==A?(K=s(me,{className:"flex items-center gap-1.5",htmlFor:"mg-dry-run",children:[B,A]}),e[68]=B,e[69]=A,e[70]=K):K=e[70];let j;e[71]!==l||e[72]!==X||e[73]!==g||e[74]!==z||e[75]!==t?(j=l?r(ke,{"data-testid":"mg-run",disabled:g||!z,onClick:X,type:"button",children:t(g?"Running…":"Run")}):r(Ie,{confirmLabel:t(g?"Running…":"Run migration?"),disabled:g||!z,onConfirm:X,testId:"mg-run",children:t("Run")}),e[71]=l,e[72]=X,e[73]=g,e[74]=z,e[75]=t,e[76]=j):j=e[76];let F;e[77]!==M||e[78]!==L||e[79]!==K||e[80]!==j?(F=s("div",{className:"flex flex-wrap items-center gap-2",children:[M,L,K,j]}),e[77]=M,e[78]=L,e[79]=K,e[80]=j,e[81]=F):F=e[81];let O;e[82]!==S||e[83]!==F?(O=s("div",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card p-3 shadow-xs",children:[S,F]}),e[82]=S,e[83]=F,e[84]=O):O=e[84];let q;e[85]!==U?(q=U!==null&&r("pre",{className:"text-sm text-destructive whitespace-pre-wrap","data-testid":"mg-run-error",role:"alert",children:U}),e[85]=U,e[86]=q):q=e[86];let H;e[87]!==c||e[88]!==t?(H=c!==null&&s("p",{className:"text-sm text-muted-foreground","data-testid":"mg-run-result",children:[c.dryRun?t("Dry run: "):"",t("{status} — processed",{status:c.status}),c.processed,t(", changed"),c.changed]}),e[87]=c,e[88]=t,e[89]=H):H=e[89];let te;return e[90]!==v||e[91]!==x||e[92]!==R||e[93]!==C||e[94]!==O||e[95]!==q||e[96]!==H?(te=s("div",{className:"flex flex-col gap-3 pt-4","data-testid":"lunora-migrations",children:[v,x,R,C,O,q,H]}),e[90]=v,e[91]=x,e[92]=R,e[93]=C,e[94]=O,e[95]=q,e[96]=H,e[97]=te):te=e[97],te};function Je(i){return s(fe,{"data-testid":`mg-row-${i.id}`,children:[r(f,{children:i.id}),r(f,{children:i.direction}),r(f,{children:r(_e,{variant:"secondary",children:i.status})}),r(f,{children:i.processed}),r(f,{children:i.changed}),r(f,{children:Qe(i.updatedAt)}),r(f,{children:i.error??""})]},i.id)}export{yt as MigrationsPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as O}from"react/compiler-runtime";import{E as g}from"./empty-state-D7jEML_T.mjs";import{S as y}from"./skeleton-DX1gfixl.mjs";import{u as R}from"./use-admin-spec-BdNLZbTO.mjs";import{u as S}from"./use-studio-client-DCA50tF2.mjs";import{useT as P}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{R as x}from"./reference-view-DCEC5kjY.mjs";import{jsxs as h,jsx as l}from"react/jsx-runtime";const k=n=>(n.methods??[]).filter(e=>e["x-lunora-function-kind"]!=="stream"),w=n=>(n.params??[]).find(e=>e.name==="args")??(n.params??[])[0],C=n=>n["x-tags"]?.[0]?.name??(n.name.includes(":")?n.name.slice(0,n.name.indexOf(":")):""),I=n=>{const e=w(n)?.schema;return{argsSchema:e,description:n.description,functionPath:n.name,httpPath:"/_lunora/rpc",key:n.name,kind:n["x-lunora-function-kind"],method:"POST",operationId:n.name,requestSchema:e,responses:[{description:n.result?.name,schema:n.result?.schema,status:"200"}],summary:n.summary??n.name,tags:[C(n)],title:n.summary??n.name}},v=n=>{const e=n??{},m=k(e).map(a=>I(a)),r=new Map;for(const a of m){const i=a.tags[0]??"",s=r.get(i)??[];s.push(a),r.set(i,s)}return{groups:[...r.entries()].map(([a,i])=>({name:a,operations:i.toSorted((s,p)=>s.operationId.localeCompare(p.operationId))})).toSorted((a,i)=>a.name.localeCompare(i.name)),operationByKey:new Map(m.map(a=>[a.key,a])),title:e.info?.title??"API reference",version:e.info?.version}},N=n=>k(n).length===0,b=n=>{const e=n;return N(e)?{kind:"empty"}:{kind:"ready",spec:e}},B=n=>{const e=O(23),{spec:m}=n,r=P(),f=S();let a;e[0]!==f?(a=()=>f.fetchOpenRpc(),e[0]=f,e[1]=a):a=e[1];const s=R(m,a,b);let p;e[2]!==s.kind||e[3]!==s.spec?(p=s.kind==="ready"?v(s.spec):void 0,e[2]=s.kind,e[3]=s.spec,e[4]=p):p=e[4];const u=p;if(s.kind==="loading"){let t;return e[5]===Symbol.for("react.memo_cache_sentinel")?(t=h("div",{className:"flex flex-col gap-4","data-testid":"openrpc-reference-loading",children:[l(y,{className:"h-8 w-48"}),l(y,{className:"h-64 w-full"})]}),e[5]=t):t=e[5],t}if(s.kind==="error"){let t;e[6]!==s.message||e[7]!==r?(t=r("Couldn't load the OpenRPC spec: {message}",{message:s.message}),e[6]=s.message,e[7]=r,e[8]=t):t=e[8];let o;e[9]!==r?(o=r("API reference unavailable"),e[9]=r,e[10]=o):o=e[10];let c;return e[11]!==t||e[12]!==o?(c=l(g,{description:t,testId:"openrpc-reference-error",title:o}),e[11]=t,e[12]=o,e[13]=c):c=e[13],c}if(s.kind==="empty"||u===void 0){let t;e[14]!==r?(t=r("Run `lunora codegen --api-spec openrpc` and wire `_generated/openrpc.json` to the worker to render the OpenRPC reference here."),e[14]=r,e[15]=t):t=e[15];let o;e[16]!==r?(o=r("No OpenRPC spec configured"),e[16]=r,e[17]=o):o=e[17];let c;return e[18]!==t||e[19]!==o?(c=l(g,{description:t,testId:"openrpc-reference-empty",title:o}),e[18]=t,e[19]=o,e[20]=c):c=e[20],c}let d;return e[21]!==u?(d=l(x,{model:u}),e[21]=u,e[22]=d):d=e[22],d};export{B as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const o="lunora-studio-root";export{o as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as I}from"react/compiler-runtime";import{useState as T,useEffect as $}from"react";import{ConfirmButton as H}from"./ConfirmButton-CIXYF6Mg.mjs";import{C as M,a as P}from"./card-By2O8ULa.mjs";import{E as Q}from"./empty-state-D7jEML_T.mjs";import{T as R,a as q,b as J,c as l,d as D,e as i}from"./table-D0SBiDu-.mjs";import{a as K}from"./use-admin-query-BW9IuacC.mjs";import{useAutoRefresh as V}from"./DEFAULT_AUTO_REFRESH_MS-CG7Q45ZS.mjs";import{u as W}from"./use-studio-client-DCA50tF2.mjs";import{useT as z}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{f as G,h as O,b as U}from"./internal-BXEjuLPN.mjs";import{jsx as t,jsxs as p}from"react/jsx-runtime";const X=s=>Number.isFinite(s)?O(s,"—"):"—",F=s=>s.toSorted((e,u)=>e.scheduledFor-u.scheduledFor),Y=(s,e,u)=>e!==void 0?e:u===void 0?f=>s.cancelScheduledJob(f):void 0,he=s=>{const e=I(16),{cancelJob:u,loadJobs:f}=s===void 0?{}:s,n=W(),o=z(),c=f===void 0;let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b=["lunora-scheduled-jobs"],e[0]=b):b=e[0];const d=K(b,async()=>{const r=await(f??(()=>n.listScheduledJobs()))();return F(r)}),[j,k]=T(void 0),[A,w]=T(void 0);let v,x;e[1]!==n||e[2]!==c?(v=()=>{if(c)return n.subscribeScheduledJobs(r=>{w(void 0),k(F(r))})},x=[c,n],e[1]=n,e[2]=c,e[3]=v,e[4]=x):(v=e[3],x=e[4]),$(v,x);let y;e[5]!==d?(y=()=>d.poll(),e[5]=d,e[6]=y):y=e[6],V(y,!c);const C=Y(n,u,f),a=j??d.data,N=A??d.error,E=async r=>{if(C!==void 0){w(void 0);try{await C(r),c||d.refetch()}catch(_){w(U(_))}}},L="flex flex-col gap-3",B="lunora-scheduled-jobs";let m;e[7]!==N?(m=N!==null&&t("p",{className:"text-sm text-destructive","data-testid":"sj-error",role:"alert",children:N}),e[7]=N,e[8]=m):m=e[8];let h;e[9]!==a?.length||e[10]!==o?(h=a?.length===0&&t(Q,{description:o("Jobs queued with runAfter / runAt will appear here."),icon:p("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[t("circle",{cx:"12",cy:"12",r:"9"}),t("path",{d:"M12 7.5V12l4 2"})]}),testId:"sj-empty",title:o("No scheduled jobs.")}),e[9]=a?.length,e[10]=o,e[11]=h):h=e[11];const S=a!==void 0&&a.length>0&&t(M,{className:"overflow-hidden py-0",children:t(P,{className:"px-0",children:p(R,{"data-testid":"sj-table",children:[t(q,{children:p(J,{children:[t(l,{children:o("function")}),t(l,{children:o("scheduled for")}),t(l,{children:o("pool")}),t(l,{children:o("attempts")}),t(l,{children:o("shard")}),t(l,{children:o("id")}),C!==void 0&&t(l,{"aria-label":o("Actions")})]})}),t(D,{children:a.map(r=>p(J,{"data-testid":`sj-row-${r.id}`,children:[t(i,{className:"font-mono text-xs",children:r.workflow??r.functionPath}),t(i,{className:"text-muted-foreground tabular-nums",children:X(r.scheduledFor)}),t(i,{className:"font-mono text-xs",children:r.pool??""}),t(i,{className:"tabular-nums",children:r.attempts??0}),t(i,{children:r.shardKey??""}),t(i,{className:"font-mono text-xs",children:r.id}),C!==void 0&&t(i,{className:"text-right",children:t(H,{confirmLabel:o("Cancel job?"),onConfirm:()=>{G(E(r.id))},testId:`sj-cancel-${r.id}`,children:o("Cancel")})})]},r.id))})]})})});let g;return e[12]!==S||e[13]!==m||e[14]!==h?(g=p("div",{className:L,"data-testid":B,children:[m,h,S]}),e[12]=S,e[13]=m,e[14]=h,e[15]=g):g=e[15],g};export{he as ScheduledJobs};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as S}from"react/compiler-runtime";import{useId as x,useState as C}from"react";import{useT as b}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{l as j}from"./shard-history-CaO3C4KQ.mjs";import{I as k}from"./input-CXhxesPC.mjs";import{jsx as I,jsxs as y,Fragment as _}from"react/jsx-runtime";const A=r=>{const t=S(21),{id:p,onChange:f,testId:e,value:u}=r,n=b(),c=x(),[i]=C($);let d;t[0]!==f?(d=v=>{f(v.target.value)},t[0]=f,t[1]=d):d=t[1];const h=d;let o;t[2]!==n?(o=n("Shard key"),t[2]=n,t[3]=o):o=t[3];const g=i.length>0?c:void 0;let l;t[4]!==n?(l=n("shard key (optional)"),t[4]=n,t[5]=l):l=t[5];let s;t[6]!==p||t[7]!==h||t[8]!==o||t[9]!==g||t[10]!==l||t[11]!==e||t[12]!==u?(s=I(k,{"aria-label":o,className:"h-8 w-48","data-testid":e,id:p,list:g,onChange:h,placeholder:l,value:u}),t[6]=p,t[7]=h,t[8]=o,t[9]=g,t[10]=l,t[11]=e,t[12]=u,t[13]=s):s=t[13];let a;t[14]!==c||t[15]!==i||t[16]!==e?(a=i.length>0&&I("datalist",{"data-testid":`${e}-recents`,id:c,children:i.map(w)}),t[14]=c,t[15]=i,t[16]=e,t[17]=a):a=t[17];let m;return t[18]!==s||t[19]!==a?(m=y(_,{children:[s,a]}),t[18]=s,t[19]=a,t[20]=m):m=t[20],m};function $(){return j()}function w(r){return I("option",{"aria-label":r,value:r},r)}export{A as ShardInput};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{S as b}from"./studio-DIUgH7k0.mjs";import"./ErrorBoundary-BWNF98VF.mjs";import"./operation-console-provider-DoloEvon.mjs";import"./badge-r_5B4LHP.mjs";import"./input-CXhxesPC.mjs";import"./skeleton-DX1gfixl.mjs";import"./home-panel-DPiMVQZ2.mjs";import"./DEFAULT_LOCALE-BQ3jRT74.mjs";import"./StudioI18nProvider-CGXCPnQn.mjs";import"./data-view-params-C-_G-biH.mjs";import"./internal-BXEjuLPN.mjs";import"./utils-bhneXptQ.mjs";import"./CommandPalette-5OsK8PNe.mjs";export{b as Studio};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as O}from"react/compiler-runtime";import{LunoraAdminClient as G}from"@lunora/client/admin";import{LunoraProvider as H}from"@lunora/react";import{useState as B,useEffect as $}from"react";import{ErrorBoundary as z}from"./ErrorBoundary-BWNF98VF.mjs";import{u as U,B as V,T as Y,a as q,S as J}from"./studio-DIUgH7k0.mjs";import Q from"./useDebounced-DVeQ5-oW.mjs";import{useT as j,createStudioI18n as X}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{StudioI18nProvider as D}from"./StudioI18nProvider-CGXCPnQn.mjs";import{r as Z}from"./internal-BXEjuLPN.mjs";import{w as R}from"./recording-client-MbGZ28I0.mjs";import F from"./STUDIO_ROOT_CLASS-C6MccdVk.mjs";import{a as K}from"./browser-storage-BH1MxLZs.mjs";import{c as W}from"./utils-bhneXptQ.mjs";import{B as ee}from"./button-q0UYSmrn.mjs";import{I as te}from"./input-CXhxesPC.mjs";import{jsx as f,jsxs as C}from"react/jsx-runtime";const M="lunora-studio-admin-token",oe=()=>{try{return K("session")?.getItem(M)??""}catch{return""}},ne=m=>{const e=K("session");if(e!==void 0)try{m===""?e.removeItem(M):e.setItem(M,m)}catch{}},ie="/_lunora/admin/ws-token",se=1e4,le=m=>{const e=m;return typeof e?.token=="string"&&e.token.length>0&&typeof e.expiresAtMs=="number"},re=m=>{const{adminToken:e,baseUrl:a}=m,o=m.fetchImpl??fetch;let l=a;for(;l.endsWith("/");)l=l.slice(0,-1);const r=`${l}${ie}`;let t,n;const i=async()=>{const s=await o(r,{headers:{authorization:`Bearer ${e}`},method:"POST"});if(!s.ok)throw new Error(`ws-token mint failed: ${String(s.status)}`);const u=await s.json().catch(()=>{});if(!le(u))throw new Error("ws-token mint failed: malformed response body");return t=u,u.token};return{getToken:async()=>t!==void 0&&t.expiresAtMs-se>Date.now()?t.token:(n??=i().finally(()=>{n=void 0}),n),invalidate:()=>{t=void 0}}},ae=m=>{const e=O(42),{onSubmit:a}=m,o=j(),[l,r]=B("");let t;e[0]!==l?(t=l.trim(),e[0]=l,e[1]=t):t=e[1];const n=t;let i;e[2]!==a||e[3]!==n?(i=_=>{_.preventDefault(),n!==""&&a(n)},e[2]=a,e[3]=n,e[4]=i):i=e[4];const s=i;let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=f("div",{className:"h-10 w-10 text-foreground",children:f(V,{})}),e[5]=u):u=e[5];let d;e[6]!==o?(d=o("Connect to Lunora Studio"),e[6]=o,e[7]=d):d=e[7];let v;e[8]!==d?(v=f("h1",{className:"text-base font-semibold text-foreground",children:d}),e[8]=d,e[9]=v):v=e[9];let k;e[10]!==o?(k=o("Enter your admin token to access the studio."),e[10]=o,e[11]=k):k=e[11];let p;e[12]!==k?(p=f("p",{className:"text-[13px] text-muted-foreground",children:k}),e[12]=k,e[13]=p):p=e[13];let h;e[14]!==v||e[15]!==p?(h=C("div",{className:"flex flex-col items-center gap-3 text-center",children:[u,C("div",{className:"flex flex-col gap-1",children:[v,p]})]}),e[14]=v,e[15]=p,e[16]=h):h=e[16];let g;e[17]!==o?(g=o("admin token"),e[17]=o,e[18]=g):g=e[18];let c;e[19]!==g?(c=f("label",{className:"text-xs font-medium text-foreground",htmlFor:"lunora-studio-login-token",children:g}),e[19]=g,e[20]=c):c=e[20];let b;e[21]===Symbol.for("react.memo_cache_sentinel")?(b=_=>{r(_.target.value)},e[21]=b):b=e[21];let x;e[22]!==l?(x=f(te,{autoComplete:"off",autoFocus:!0,"data-testid":"lunora-studio-login-token",id:"lunora-studio-login-token",onChange:b,placeholder:"LUNORA_ADMIN_TOKEN",type:"password",value:l}),e[22]=l,e[23]=x):x=e[23];let T;e[24]!==o?(T=o("From your worker's LUNORA_ADMIN_TOKEN — your project's .dev.vars in dev, or a deployment secret in production."),e[24]=o,e[25]=T):T=e[25];let I;e[26]!==T?(I=f("p",{className:"text-[11px] text-muted-foreground",children:T}),e[26]=T,e[27]=I):I=e[27];let S;e[28]!==c||e[29]!==x||e[30]!==I?(S=C("div",{className:"flex flex-col gap-1.5",children:[c,x,I]}),e[28]=c,e[29]=x,e[30]=I,e[31]=S):S=e[31];const E=n==="";let y;e[32]!==o?(y=o("Connect"),e[32]=o,e[33]=y):y=e[33];let w;e[34]!==E||e[35]!==y?(w=f(ee,{"data-testid":"lunora-studio-login-submit",disabled:E,type:"submit",children:y}),e[34]=E,e[35]=y,e[36]=w):w=e[36];let N;return e[37]!==s||e[38]!==S||e[39]!==w||e[40]!==h?(N=C("form",{className:"flex w-full max-w-sm flex-col gap-5 rounded-xl border border-border bg-card p-7 shadow-lg","data-testid":"lunora-studio-login",onSubmit:s,children:[h,S,w]}),e[37]=s,e[38]=S,e[39]=w,e[40]=h,e[41]=N):N=e[41],N},de=m=>{const e=O(10),{i18n:a,onSubmit:o}=m,{resolvedTheme:l}=U(),r=l==="dark"&&"dark";let t;e[0]!==r?(t=W(F,r,"flex h-dvh items-center justify-center bg-sidebar p-6 text-sm text-foreground"),e[0]=r,e[1]=t):t=e[1];let n;e[2]!==o?(n=f(ae,{onSubmit:o}),e[2]=o,e[3]=n):n=e[3];let i;e[4]!==a||e[5]!==n?(i=f(D,{i18n:a,children:n}),e[4]=a,e[5]=n,e[6]=i):i=e[6];let s;return e[7]!==t||e[8]!==i?(s=f("div",{className:t,"data-testid":"lunora-studio-login-root",children:i}),e[7]=t,e[8]=i,e[9]=s):s=e[9],s},ce=m=>{const e=O(15),{basePath:a,chrome:o,studio:l}=m,r=j();let t;e[0]!==r?(t=r("Studio failed"),e[0]=r,e[1]=t):t=e[1];let n;e[2]!==r?(n=r("Studio"),e[2]=r,e[3]=n):n=e[3];let i;e[4]!==r?(i=r("Try again"),e[4]=r,e[5]=i):i=e[5];let s;e[6]!==a||e[7]!==o||e[8]!==l?(s=f(J,{...l,basePath:a,chrome:o}),e[6]=a,e[7]=o,e[8]=l,e[9]=s):s=e[9];let u;return e[10]!==t||e[11]!==n||e[12]!==i||e[13]!==s?(u=f(z,{fallbackTitle:t,label:n,retryLabel:i,children:s}),e[10]=t,e[11]=n,e[12]=i,e[13]=s,e[14]=u):u=e[14],u},fe=m=>{const e=O(20),{basePath:a,clearToken:o,client:l,i18n:r,onTokenChange:t,rulesInstalled:n,studio:i,token:s}=m,{resolvedTheme:u}=U();let d;e[0]!==o||e[1]!==t||e[2]!==n||e[3]!==s?(d={clearToken:o,onTokenChange:t,rulesInstalled:n,token:s},e[0]=o,e[1]=t,e[2]=n,e[3]=s,e[4]=d):d=e[4];const v=d,k=u==="dark"&&"dark";let p;e[5]!==k?(p=W(F,k,"flex h-dvh flex-col overflow-hidden bg-sidebar text-sm text-foreground"),e[5]=k,e[6]=p):p=e[6];let h;e[7]!==a||e[8]!==v||e[9]!==i?(h=f(q,{children:f(ce,{basePath:a,chrome:v,studio:i})}),e[7]=a,e[8]=v,e[9]=i,e[10]=h):h=e[10];let g;e[11]!==r||e[12]!==h?(g=f(D,{i18n:r,children:h}),e[11]=r,e[12]=h,e[13]=g):g=e[13];let c;e[14]!==l||e[15]!==g?(c=f(H,{client:l,children:g}),e[14]=l,e[15]=g,e[16]=c):c=e[16];let b;return e[17]!==p||e[18]!==c?(b=f("div",{className:p,"data-testid":"lunora-studio-app",children:c}),e[17]=p,e[18]=c,e[19]=b):b=e[19],b},Ee=m=>{const e=O(28);let a;e[0]!==m?(a=m===void 0?{}:m,e[0]=m,e[1]=a):a=e[1];const{adminToken:o,basePath:l,baseUrl:r,client:t,rulesInstalled:n,studio:i,locale:s}=a;let u;e[2]!==o?(u=()=>o??oe(),e[2]=o,e[3]=u):u=e[3];const[d,v]=B(u);let k,p;e[4]!==d?(k=()=>{ne(d)},p=[d],e[4]=d,e[5]=k,e[6]=p):(k=e[5],p=e[6]),$(k,p);const h=Q(d,300,d==="");let g;e:{if(t!==void 0){let A;e[7]!==t?(A=R(t),e[7]=t,e[8]=A):A=e[8],g=A;break e}let _;if(e[9]!==r||e[10]!==h){const A=Z(r),P=h===""?void 0:re({adminToken:h,baseUrl:A}),L=new G({url:A,...P===void 0?{}:{wsTicket:P.getToken}});P!==void 0&&(L.setAuthToken(h),L.onTokenExpired(P.invalidate)),_=R(L),e[9]=r,e[10]=h,e[11]=_}else _=e[11];g=_}const c=g;let b,x;e[12]!==c||e[13]!==t?(b=()=>()=>{t===void 0&&c.close()},x=[c,t],e[12]=c,e[13]=t,e[14]=b,e[15]=x):(b=e[14],x=e[15]),$(b,x);let T;e[16]===Symbol.for("react.memo_cache_sentinel")?(T=_=>{v(_.target.value)},e[16]=T):T=e[16];const I=T;let S;e[17]===Symbol.for("react.memo_cache_sentinel")?(S=()=>{v("")},e[17]=S):S=e[17];const E=S;let y;e[18]!==s?(y=X(s),e[18]=s,e[19]=y):y=e[19];const w=y;let N;return e[20]!==l||e[21]!==c||e[22]!==w||e[23]!==t||e[24]!==n||e[25]!==i||e[26]!==d?(N=f(Y,{children:d===""&&t===void 0?f(de,{i18n:w,onSubmit:v}):f(fe,{basePath:l,clearToken:E,client:c,i18n:w,onTokenChange:I,rulesInstalled:n,studio:i,token:d})}),e[20]=l,e[21]=c,e[22]=w,e[23]=t,e[24]=n,e[25]=i,e[26]=d,e[27]=N):N=e[27],N};export{Ee as StudioApp};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as u}from"react/compiler-runtime";import{studioI18n as f,createStudioI18n as l,StudioI18nContext as m}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{jsx as v}from"react/jsx-runtime";const I=(e,t,o)=>e!==void 0?e:t===void 0&&o===void 0?f:l(t,o),S=e=>{const t=u(7),{catalogs:o,children:i,i18n:s,locale:c}=e;let r;t[0]!==o||t[1]!==s||t[2]!==c?(r=I(s,c,o),t[0]=o,t[1]=s,t[2]=c,t[3]=r):r=t[3];const d=r;let n;return t[4]!==i||t[5]!==d?(n=v(m,{value:d,children:i}),t[4]=i,t[5]=d,t[6]=n):n=t[6],n};export{S as StudioI18nProvider};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useState as g}from"react";import{E as x}from"./error-alert-54TiaMvZ.mjs";import{C as N,a as y}from"./card-By2O8ULa.mjs";import{T as v,a as T,b as d,c as m,d as w,e as l}from"./table-D0SBiDu-.mjs";import{useT as E}from"./DEFAULT_LOCALE-BQ3jRT74.mjs";import{c as L}from"./utils-bhneXptQ.mjs";import{jsxs as o,jsx as t}from"react/jsx-runtime";const C={ERROR:"error",INFO:"info",WARN:"warning"},z=e=>{const a=typeof e.metadata.table=="string"?e.metadata.table:void 0;return{description:`${e.detail} ${e.remediation}`,entity:a,issueType:e.title,key:e.cacheKey,level:C[e.level]}},R=["error","warning","info"],A={error:"bg-destructive",info:"bg-info",warning:"bg-warning"},$=(e,a)=>({error:e("Errors"),info:e("Info"),warning:e("Warnings")})[a],k=(e,a,n)=>({error:e("{count} errors",{count:n}),info:e("{count} suggestions",{count:n}),warning:e("{count} warnings",{count:n})})[a],V=(e,a)=>({error:e("No errors detected"),info:e("No suggestions"),warning:e("No warnings detected")})[a],O=e=>{const a={error:0,info:0,warning:0};for(const n of e??[])a[n.level]+=1;return a},F=({error:e=null,errorSource:a,rows:n,testId:i,toolbar:p})=>{const s=E(),[c,f]=g("error"),b=O(n),u=(n??[]).filter(r=>r.level===c),h=r=>{f(r.currentTarget.dataset.level)};return o("div",{className:"flex flex-col gap-3","data-testid":i,children:[t("div",{className:"flex border-b border-border",role:"tablist",children:R.map(r=>o("button",{"aria-selected":c===r,className:"flex min-w-32 flex-col gap-0.5 border-b-2 border-transparent px-4 py-2 text-start outline-none transition-colors hover:bg-muted/40 focus-visible:bg-muted/40 aria-selected:border-foreground","data-level":r,"data-testid":`${i}-tab-${r}`,onClick:h,role:"tab",type:"button",children:[o("span",{className:"flex items-center gap-2 text-sm font-medium text-foreground",children:[t("span",{"aria-hidden":"true",className:L("size-2 rounded-sm",A[r])}),$(s,r)]}),t("span",{className:"ps-4 text-xs text-muted-foreground",children:k(s,r,b[r])})]},r))}),p!==void 0&&t("div",{className:"flex flex-wrap items-center gap-2",children:p}),e!==null&&t(x,{error:a??e,testId:`${i}-error`}),t(N,{className:"overflow-hidden py-0",children:t(y,{className:"px-0",children:o(v,{children:[t(T,{children:o(d,{children:[t(m,{children:s("Issue type")}),t(m,{children:s("Entity/item")}),t(m,{children:s("Description")})]})}),t(w,{children:u.length===0?t(d,{children:o(l,{className:"h-40 text-center align-middle text-muted-foreground",colSpan:3,"data-testid":`${i}-empty`,children:[t("span",{className:"block text-sm font-medium text-foreground",children:V(s,c)}),t("span",{className:"block text-sm",children:s("Nothing to report for this deployment.")})]})}):u.map(r=>o(d,{children:[t(l,{className:"font-medium text-foreground",children:r.issueType}),t(l,{className:"font-mono text-xs text-muted-foreground",children:r.entity??"—"}),o(l,{className:"text-muted-foreground",children:[t("span",{children:r.description}),r.action!==void 0&&t("span",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:r.action})]})]},r.key))})]})})})]})};export{F as A,z as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const i=l=>{let e=0,s=0,o=0,c=0,t=0,n=0,r=0;for(const{metrics:a}of l){if(a===null){t+=1;continue}c+=1,e+=a.requests,s+=a.errors,o+=a.databaseSize??0,a.cache&&(n+=a.cache.hits,r+=a.cache.hits+a.cache.misses)}return{failed:t,hitRate:r===0?null:n/r,reachable:c,totalDatabaseSize:o,totalErrors:s,totalRequests:e}},u=(l,e)=>{const s=new Set,o=[];for(const c of["",l.trim(),...e])s.has(c)||(s.add(c),o.push(c));return o},h=l=>{const e=l,s=[];let o=0;for(const t of e.functions??[])t.calls>0&&(s.push({avg:t.totalDurationMs/t.calls,calls:t.calls}),o+=t.calls);s.sort((t,n)=>t.avg-n.avg);const c=t=>{const n=Math.ceil(t/100*o);let r=0;for(const a of s)if(r+=a.calls,r>=n)return a.avg;return s.at(-1)?.avg??0};return{p90:c(90),p95:c(95)}},f=l=>l.map(e=>({...e,avgDurationMs:e.execCount>0?e.totalDurationMs/e.execCount:0}));export{i as aggregateMetrics,h as computeLatencyPercentiles,f as enrichQueryStats,u as shardsToAggregate};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as l}from"react/compiler-runtime";import{cva as c}from"class-variance-authority";import{c as v}from"./utils-bhneXptQ.mjs";import{jsx as f,jsxs as b}from"react/jsx-runtime";const u=c("flex items-start gap-2 rounded-md border px-3 py-2 text-sm [&>svg]:mt-0.5 [&>svg]:size-4 [&>svg]:shrink-0",{defaultVariants:{variant:"default"},variants:{variant:{default:"border-border bg-muted/40 text-foreground",destructive:"border-destructive/40 bg-destructive/5 text-destructive",warning:"border-amber-500/40 bg-amber-500/5 text-amber-700 dark:text-amber-400"}}}),N=n=>{const t=l(10),{children:s,className:i,icon:d,testId:o,variant:m}=n;let e;t[0]!==i||t[1]!==m?(e=v(u({variant:m}),i),t[0]=i,t[1]=m,t[2]=e):e=t[2];let r;t[3]!==s?(r=f("div",{className:"min-w-0 flex-1",children:s}),t[3]=s,t[4]=r):r=t[4];let a;return t[5]!==d||t[6]!==e||t[7]!==r||t[8]!==o?(a=b("div",{className:e,"data-testid":o,role:"alert",children:[d,r]}),t[5]=d,t[6]=e,t[7]=r,t[8]=o,t[9]=a):a=t[9],a};export{N as A};
|