@lunora/studio 1.0.0-alpha.33 → 1.0.0-alpha.331
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 +1 -1
- package/dist/index.d.mts +1595 -0
- package/dist/index.d.ts +989 -807
- package/dist/index.mjs +1 -0
- package/dist/mount.d.mts +22 -0
- package/dist/mount.d.ts +11 -10
- 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 +6 -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/sparkline.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/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-B8yyk5BX.mjs +1 -0
- package/dist/packem_shared/ApiDocsPanel-Py7C4ibM.mjs +2 -0
- package/dist/packem_shared/ApiReferencePanel-DlYVADAy.mjs +1 -0
- package/dist/packem_shared/CommandPalette-CM1hqAOD.mjs +1 -0
- package/dist/packem_shared/ConfirmButton-DU4p72Er.mjs +1 -0
- package/dist/packem_shared/ConnectionBadge-B8Hj5DaE.mjs +1 -0
- package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-DvhNw0BI.mjs +1 -0
- package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-D5YMT0gM.mjs +1 -0
- package/dist/packem_shared/DEFAULT_LOCALE-A1Yg5ORA.mjs +1 -0
- package/dist/packem_shared/DataBrowser-DxlLv5x1.mjs +4 -0
- package/dist/packem_shared/DataFilters-CYZFt2EK.mjs +1 -0
- package/dist/packem_shared/ErrorBoundary-BWNF98VF.mjs +1 -0
- package/dist/packem_shared/GlobalDataBrowser-TFTQpSVj.mjs +1 -0
- package/dist/packem_shared/HomePanel-BVz2sDQ4.mjs +1 -0
- package/dist/packem_shared/MigrationsPanel-fUyhbt0w.mjs +1 -0
- package/dist/packem_shared/OpenRpcReferencePanel-CPIr-u-J.mjs +1 -0
- package/dist/packem_shared/STUDIO_ROOT_CLASS-C6MccdVk.mjs +1 -0
- package/dist/packem_shared/ScheduledJobs-zSeU_6cN.mjs +1 -0
- package/dist/packem_shared/ShardInput-C6mjgAh4.mjs +1 -0
- package/dist/packem_shared/Studio-CNqMkRmB.mjs +1 -0
- package/dist/packem_shared/StudioApp-BG3kyQ-I.mjs +1 -0
- package/dist/packem_shared/StudioI18nProvider-fVsCSs5L.mjs +1 -0
- package/dist/packem_shared/advisor-view-CXiPdw4B.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-D45VvUTx.d.mts +351 -0
- package/dist/packem_shared/app.d-D45VvUTx.d.ts +351 -0
- package/dist/packem_shared/auth-pager-DiDnXsfe.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-BHTuvSI7.mjs +1 -0
- package/dist/packem_shared/data-view-params-DhYmAkcj.mjs +1 -0
- package/dist/packem_shared/diagram-export-panel-BMLzao0Y.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-D-ftqyo-.mjs +1 -0
- package/dist/packem_shared/grid-features-CIdZ8Dqo.mjs +6 -0
- package/dist/packem_shared/grid-pagination-DgzyzfBh.mjs +1 -0
- package/dist/packem_shared/home-panel-CF-MfsnH.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-BuJdUZFU.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-CFBkH4uZ.mjs +1 -0
- package/dist/packem_shared/reference-view-BrsL8UGn.mjs +13 -0
- package/dist/packem_shared/schema-diagram-LRfchcoA.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-COsfUSGc.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-BcHsk7mT.mjs +2 -0
- package/dist/packem_shared/table-D0SBiDu-.mjs +2 -0
- package/dist/packem_shared/table-list-sidebar-DwqtHSHU.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-I1uILsUP.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-DQ8tNyBh.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-DetnUyFf.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-22MSJQDH.js +1 -0
- package/dist/standalone/chunk-253UHWDX.js +1 -0
- package/dist/standalone/chunk-2GYGUDJS.js +2 -0
- package/dist/standalone/chunk-2I4NHEKA.js +1 -0
- package/dist/standalone/chunk-2IKDEUCX.js +1 -0
- package/dist/standalone/chunk-2KXU4RFA.js +1 -0
- package/dist/standalone/chunk-34HRTSIP.js +1 -0
- package/dist/standalone/chunk-37WYCOQ2.js +1 -0
- package/dist/standalone/chunk-3O4QTTSY.js +4 -0
- package/dist/standalone/chunk-3YXASVTP.js +1 -0
- package/dist/standalone/chunk-4CGBMYO3.js +6 -0
- package/dist/standalone/chunk-4DPZVEBK.js +1 -0
- package/dist/standalone/chunk-4NSXTCPY.js +1 -0
- package/dist/standalone/chunk-4ZEL6BYL.js +1 -0
- package/dist/standalone/chunk-4ZPDCXIA.js +1 -0
- package/dist/standalone/chunk-55UGUCQ6.js +1 -0
- package/dist/standalone/chunk-5B2RTXBS.js +1 -0
- package/dist/standalone/chunk-5QR2SQIS.js +1 -0
- package/dist/standalone/chunk-5QXC7TAH.js +1 -0
- package/dist/standalone/chunk-5XSZGYSM.js +1 -0
- package/dist/standalone/chunk-5ZCMUHYK.js +1 -0
- package/dist/standalone/chunk-6UKEJNM5.js +1 -0
- package/dist/standalone/chunk-74IYYDDI.js +19 -0
- package/dist/standalone/chunk-7FTJLXZH.js +1 -0
- package/dist/standalone/chunk-7G4Z6Q7X.js +1 -0
- package/dist/standalone/chunk-7Q256NLI.js +1 -0
- package/dist/standalone/chunk-7RKB5KS7.js +1 -0
- package/dist/standalone/chunk-7Y3SY37W.js +1 -0
- package/dist/standalone/chunk-AH56E26M.js +1 -0
- package/dist/standalone/chunk-AUAECCXB.js +1 -0
- package/dist/standalone/{chunk-BJGBHGK3.js → chunk-AUGKHAMQ.js} +1 -1
- package/dist/standalone/chunk-B3SX5SBI.js +3 -0
- package/dist/standalone/chunk-B475OGG2.js +1 -0
- package/dist/standalone/chunk-BDAZK3QX.js +1 -0
- package/dist/standalone/chunk-BOGUQHYU.js +1 -0
- package/dist/standalone/chunk-BOMPSVRC.js +1 -0
- package/dist/standalone/chunk-CCDX5RYT.js +1 -0
- package/dist/standalone/chunk-CGQMJYCW.js +1 -0
- package/dist/standalone/chunk-CHF23IX6.js +14 -0
- package/dist/standalone/chunk-CLXX5RVY.js +1 -0
- package/dist/standalone/chunk-CVXNHIQW.js +1 -0
- package/dist/standalone/chunk-E4PXACVL.js +3 -0
- package/dist/standalone/chunk-ECY2JC5F.js +1 -0
- package/dist/standalone/chunk-EFXC3EHZ.js +1 -0
- package/dist/standalone/chunk-ENRGUWYC.js +1 -0
- package/dist/standalone/chunk-EWMBX5N2.js +1 -0
- package/dist/standalone/chunk-F4HMMGVL.js +1 -0
- package/dist/standalone/chunk-FPI7AMQJ.js +1 -0
- package/dist/standalone/chunk-FUYEZFBP.js +1 -0
- package/dist/standalone/chunk-FZJY5QLO.js +1 -0
- package/dist/standalone/chunk-G3ZNPPY3.js +1 -0
- package/dist/standalone/chunk-GHQ2VDI2.js +1 -0
- package/dist/standalone/chunk-GPNP4QSZ.js +1 -0
- package/dist/standalone/chunk-GUDC24NJ.js +1 -0
- package/dist/standalone/chunk-HCTJKP5J.js +1 -0
- package/dist/standalone/chunk-HIJGQX6F.js +4 -0
- package/dist/standalone/chunk-HQPW3EZF.js +6 -0
- package/dist/standalone/chunk-HXO6YGKL.js +1 -0
- package/dist/standalone/chunk-I26MS5PJ.js +1 -0
- package/dist/standalone/chunk-IKT6EYHN.js +1 -0
- package/dist/standalone/chunk-IWZ7GVQO.js +1 -0
- package/dist/standalone/chunk-J2OLAMJR.js +1 -0
- package/dist/standalone/chunk-J4BVPEXN.js +1 -0
- package/dist/standalone/chunk-JKOBTLQU.js +15 -0
- package/dist/standalone/chunk-JYPEPARL.js +1 -0
- package/dist/standalone/chunk-K2EHRNYW.js +1 -0
- package/dist/standalone/chunk-K3ST3XOT.js +1 -0
- package/dist/standalone/chunk-K73JDHTM.js +1 -0
- package/dist/standalone/chunk-KARIZQ65.js +1 -0
- package/dist/standalone/chunk-KC67JOVJ.js +1 -0
- package/dist/standalone/chunk-KDF7XOVW.js +1 -0
- package/dist/standalone/chunk-LVCMJJQO.js +1 -0
- package/dist/standalone/chunk-LXCVA5SP.js +1 -0
- package/dist/standalone/chunk-M45NNDDU.js +1 -0
- package/dist/standalone/chunk-MC44447W.js +1 -0
- package/dist/standalone/chunk-MMCREWVL.js +1 -0
- package/dist/standalone/chunk-MVWZMWPD.js +1 -0
- package/dist/standalone/chunk-NBYAGXMZ.js +1 -0
- package/dist/standalone/chunk-NCPW7WHO.js +1 -0
- package/dist/standalone/chunk-NGVP66OH.js +1 -0
- package/dist/standalone/chunk-NQZALRU3.js +1 -0
- package/dist/standalone/chunk-NRAAYZ4C.js +15 -0
- package/dist/standalone/chunk-NRP22GKC.js +1 -0
- package/dist/standalone/chunk-NSNRU3CH.js +1 -0
- package/dist/standalone/chunk-NXQW5E6W.js +1 -0
- package/dist/standalone/chunk-OPM7ESDV.js +1 -0
- package/dist/standalone/chunk-OQ6I6OXT.js +2 -0
- package/dist/standalone/chunk-OYCUPD3Q.js +1 -0
- package/dist/standalone/chunk-PSMQQV6S.js +1 -0
- package/dist/standalone/chunk-Q6ED4KUL.js +1 -0
- package/dist/standalone/chunk-Q6IT6ZD7.js +1 -0
- package/dist/standalone/{chunk-ZHVTQ37P.js → chunk-QAQDMS6R.js} +1 -1
- package/dist/standalone/chunk-QJLHH3ET.js +1 -0
- package/dist/standalone/chunk-QMECH2OK.js +1 -0
- package/dist/standalone/chunk-QMENQICE.js +1 -0
- package/dist/standalone/chunk-R6U22RSY.js +1 -0
- package/dist/standalone/chunk-RGMVGZV4.js +1 -0
- package/dist/standalone/chunk-RNVXXJBN.js +1 -0
- package/dist/standalone/chunk-RWVIV3U7.js +1 -0
- package/dist/standalone/chunk-S4Z7K55A.js +1 -0
- package/dist/standalone/chunk-SA2OGF3F.js +1 -0
- package/dist/standalone/chunk-SHY25BCU.js +1 -0
- package/dist/standalone/chunk-SJQERRSZ.js +1 -0
- package/dist/standalone/chunk-T6XTWQC2.js +1 -0
- package/dist/standalone/chunk-TBEEPT5P.js +1 -0
- package/dist/standalone/chunk-TRUA26Q4.js +1 -0
- package/dist/standalone/chunk-U2ACS5ID.js +1 -0
- package/dist/standalone/chunk-UC7MNI2F.js +1 -0
- package/dist/standalone/chunk-UYEZR3BI.js +1 -0
- package/dist/standalone/chunk-VCFEO3RI.js +1 -0
- package/dist/standalone/chunk-VDC6JP4A.js +1 -0
- package/dist/standalone/chunk-VESGIGMQ.js +1 -0
- package/dist/standalone/chunk-VESZYIB4.js +1 -0
- package/dist/standalone/chunk-VFAP6A6G.js +1 -0
- package/dist/standalone/chunk-VNBONC2Q.js +1 -0
- package/dist/standalone/chunk-VQRCJJXS.js +1 -0
- package/dist/standalone/chunk-W4CQMJH3.js +59 -0
- package/dist/standalone/chunk-WAJZ4QKG.js +1 -0
- package/dist/standalone/chunk-WDGITBC6.js +1 -0
- package/dist/standalone/chunk-WJRYEML4.js +1 -0
- package/dist/standalone/chunk-WVWCUB4S.js +1 -0
- package/dist/standalone/chunk-X6XAMP4E.js +7 -0
- package/dist/standalone/chunk-XDWPHAV6.js +1 -0
- package/dist/standalone/chunk-XGCIDUJF.js +1 -0
- package/dist/standalone/chunk-XKISL2CG.js +1 -0
- package/dist/standalone/chunk-XVE6WFB4.js +1 -0
- package/dist/standalone/chunk-Y3AYVFTK.js +1 -0
- package/dist/standalone/chunk-YCQP3TYK.js +5 -0
- package/dist/standalone/chunk-ZBHXISOD.js +1 -0
- package/dist/standalone/chunk-ZFW3QEVE.js +8 -0
- package/dist/standalone/chunk-ZKJS6EBE.js +1 -0
- package/dist/standalone/chunk-ZVXBXVS3.js +1 -0
- package/dist/standalone/chunk-ZWLIXZWR.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 -441
- 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 -148
- 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-CdaxLGkE.js +0 -48
- package/dist/packem_shared/ApiDocsPanel-Cu6mD4u7.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-DSNK1tPg.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-DQk3P8xX.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-CFTYGEUt.js +0 -16
- package/dist/packem_shared/StudioApp-Cy9vUwVl.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-Bo-Mgrkn.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/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-Dg2e-dsR.js +0 -4014
- 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-4H2OJBXO.js +0 -1
- package/dist/standalone/chunk-4LDOOKES.js +0 -1
- package/dist/standalone/chunk-4MLAVZP4.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-5PQMXK24.js +0 -1
- package/dist/standalone/chunk-66DNF4AJ.js +0 -1
- package/dist/standalone/chunk-6GFEVKJP.js +0 -1
- package/dist/standalone/chunk-764T6X6X.js +0 -1
- package/dist/standalone/chunk-7M3F6U4L.js +0 -1
- package/dist/standalone/chunk-7TJJXVSE.js +0 -1
- package/dist/standalone/chunk-7VF3IAAW.js +0 -2
- package/dist/standalone/chunk-AHILM3ZP.js +0 -1
- package/dist/standalone/chunk-AJIUI7DD.js +0 -1
- package/dist/standalone/chunk-AQGOX5DK.js +0 -1
- package/dist/standalone/chunk-BACPICH6.js +0 -1
- package/dist/standalone/chunk-BET2625I.js +0 -1
- package/dist/standalone/chunk-BQUQS7QN.js +0 -1
- package/dist/standalone/chunk-CKSHCYGC.js +0 -2
- package/dist/standalone/chunk-DCECRP45.js +0 -1
- package/dist/standalone/chunk-DFP2DADO.js +0 -1
- package/dist/standalone/chunk-DORBUITF.js +0 -1
- package/dist/standalone/chunk-DVKPRFIJ.js +0 -1
- package/dist/standalone/chunk-DWDILV2E.js +0 -1
- package/dist/standalone/chunk-E6WUCLSI.js +0 -1
- package/dist/standalone/chunk-E7WLF6IU.js +0 -1
- package/dist/standalone/chunk-EVPLBWUT.js +0 -8
- package/dist/standalone/chunk-FCSPAJW4.js +0 -1
- package/dist/standalone/chunk-FKO3HO6I.js +0 -4
- package/dist/standalone/chunk-G2ICR3DL.js +0 -1
- package/dist/standalone/chunk-GJ6PGSES.js +0 -13
- package/dist/standalone/chunk-GMSGZDDH.js +0 -13
- package/dist/standalone/chunk-GTM65MVX.js +0 -1
- package/dist/standalone/chunk-GVRM4U6W.js +0 -2
- package/dist/standalone/chunk-GZDWDDXN.js +0 -1
- package/dist/standalone/chunk-HV7G6DFP.js +0 -5
- package/dist/standalone/chunk-ISJAJWYI.js +0 -1
- package/dist/standalone/chunk-J6J54MBP.js +0 -1
- package/dist/standalone/chunk-JIDZFLTB.js +0 -4
- package/dist/standalone/chunk-JSEXCW5Q.js +0 -1
- package/dist/standalone/chunk-K3GNLVYK.js +0 -1
- package/dist/standalone/chunk-K4ZDRTQM.js +0 -1
- package/dist/standalone/chunk-KEGAWN6Y.js +0 -1
- package/dist/standalone/chunk-KZ6INM5M.js +0 -1
- package/dist/standalone/chunk-LI43EKM6.js +0 -1
- package/dist/standalone/chunk-MFPTVCJ6.js +0 -1
- package/dist/standalone/chunk-MPYFGAOW.js +0 -1
- package/dist/standalone/chunk-O3NAGRTR.js +0 -1
- package/dist/standalone/chunk-O77VNUFD.js +0 -1
- package/dist/standalone/chunk-PA3LN4XJ.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-QHIIRFG7.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-SGDQIWAR.js +0 -4
- package/dist/standalone/chunk-SVR644RF.js +0 -1
- package/dist/standalone/chunk-SYEIXTEU.js +0 -1
- package/dist/standalone/chunk-T5HRXUSY.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-TM7CMA7X.js +0 -1
- package/dist/standalone/chunk-TQ36RWOP.js +0 -1
- package/dist/standalone/chunk-U4OAQPBT.js +0 -1
- package/dist/standalone/chunk-UDSVXA42.js +0 -1
- package/dist/standalone/chunk-UII66UVF.js +0 -1
- package/dist/standalone/chunk-UK64ZSUW.js +0 -1
- package/dist/standalone/chunk-VEZO7G5Q.js +0 -3
- package/dist/standalone/chunk-VLXV72QE.js +0 -1
- package/dist/standalone/chunk-VSHUSN6T.js +0 -1
- package/dist/standalone/chunk-VYMCCC6O.js +0 -1
- package/dist/standalone/chunk-WXPWVBIY.js +0 -1
- package/dist/standalone/chunk-X72PYOEW.js +0 -1
- package/dist/standalone/chunk-X7MMBSNW.js +0 -1
- package/dist/standalone/chunk-XIGIWZLO.js +0 -4
- package/dist/standalone/chunk-XNJNSCLM.js +0 -1
- package/dist/standalone/chunk-XUGSA2NG.js +0 -1
- package/dist/standalone/chunk-Y2ZPNDL7.js +0 -4
- package/dist/standalone/chunk-YM6BBZDN.js +0 -1
- package/dist/standalone/chunk-ZPP2KOR4.js +0 -1
- package/dist/standalone/chunk-ZPUO7FNI.js +0 -1
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{c as V}from"./chunk-4CGBMYO3.js";import"./chunk-NQZALRU3.js";import"./chunk-OPM7ESDV.js";import"./chunk-Y3AYVFTK.js";import"./chunk-QJLHH3ET.js";import"./chunk-OYCUPD3Q.js";import"./chunk-NXQW5E6W.js";import"./chunk-UC7MNI2F.js";import"./chunk-NGVP66OH.js";import"./chunk-GHQ2VDI2.js";import{a as Q}from"./chunk-LXCVA5SP.js";import{a as H}from"./chunk-7Q256NLI.js";import{b as K}from"./chunk-ZKJS6EBE.js";import"./chunk-RGMVGZV4.js";import"./chunk-E4PXACVL.js";import"./chunk-MVWZMWPD.js";import"./chunk-SJQERRSZ.js";import"./chunk-7Y3SY37W.js";import{a as A}from"./chunk-7G4Z6Q7X.js";import"./chunk-3YXASVTP.js";import"./chunk-AUAECCXB.js";import"./chunk-BOMPSVRC.js";import{a as v}from"./chunk-4ZEL6BYL.js";import{d as G}from"./chunk-ZBHXISOD.js";import{c as k,d as M,l as U}from"./chunk-X6XAMP4E.js";import"./chunk-QAQDMS6R.js";import{d as $}from"./chunk-NRAAYZ4C.js";import{a as B,e as D}from"./chunk-2IKDEUCX.js";import{d as _,f as E,g as L,h as C,q as J}from"./chunk-74IYYDDI.js";import{a as n,d as F,e as me,g as pe}from"./chunk-I26MS5PJ.js";var h=F(me(),1);var e=F(pe(),1);var ue=E(v.exportShard),fe=E(v.importShard),he=E(v.listTables),xe=n(i=>i.map(l=>JSON.stringify(k(l))).join(`
|
|
2
|
+
`),"ue"),Z=n((i,l)=>{let r=i.trim();if(r==="")return;let t=M(JSON.parse(r));if(typeof t!="object"||t===null)throw new $("INTERNAL",`line ${l.toString()}: expected a { table, doc } object`);let o=t;if(typeof o.table!="string"||typeof o.doc!="object"||o.doc===null||Array.isArray(o.doc))throw new $("INTERNAL",`line ${l.toString()}: expected a { table, doc } object`);return o},"q"),X=1024*1024,ee=n(async function*(i){let l=new TextDecoder("utf-8",{fatal:!0}),r="",t=0;for(let c=0;c<i.size;c+=X){let x=await i.slice(c,c+X).arrayBuffer(),d=`${r}${l.decode(x,{stream:!0})}`.split(`
|
|
3
|
+
`);r=d.pop()??"";for(let u of d)t+=1,yield{line:u,lineNumber:t}}let o=r+l.decode();o!==""&&(yield{line:o,lineNumber:t+1})},"U"),Y=50,ge=500,R=9e5,te=n(i=>new TextEncoder().encode(JSON.stringify(k(i))).byteLength,"z"),q="application/x-ndjson",be=n(async i=>{let l=0;for await(let{line:r,lineNumber:t}of ee(i)){let o=Z(r,t);if(o!==void 0){if(te(o)>R)throw new $("INTERNAL",`line ${t.toString()}: a single row is over the ${R.toString()}-byte import limit`);l+=1}}return l},"he"),we=n(async(i,l)=>{let r=[],t=0,o=0,c=0;for await(let{line:x,lineNumber:d}of ee(i)){let u=Z(x,d);if(u===void 0)continue;let g=te(u),S=d!==c+1;r.length>0&&(S||r.length===ge||t+g>R)&&(await l(r,o),r=[],t=0),r.length===0&&(o=d),r.push(u),t+=g,c=d}r.length>0&&await l(r,o)},"xe"),Ae=n(({initialShardKey:i})=>{let l=U(),r=G(),t=_(),[o,c]=(0,h.useState)(i??""),[x,d]=(0,h.useState)(null),[u,g]=(0,h.useState)(!1),[S,j]=(0,h.useState)(null),[b,T]=(0,h.useState)(null),[z,P]=(0,h.useState)(null),[f,O]=(0,h.useState)(null),re=n(async()=>{let s=o;g(!0),j(null),T(null),O(null);try{let a=await l.query(he,{},L(s)),m=new Blob([],{type:q}),w=0,y=[];for(let{name:p}of a){let{rows:I}=await l.query(ue,{tables:[p]},L(s));if(I.length===0)continue;let N=xe(I);m=new Blob([m,`${N}
|
|
4
|
+
`],{type:q}),w+=I.length,y.length<Y&&y.push(...N.split(`
|
|
5
|
+
`).slice(0,Y-y.length))}K(s),O({blob:m,count:w,preview:y.join(`
|
|
6
|
+
`),shardKey:s})}catch(a){j(C(a))}},"Y"),oe=n(async s=>{let a={conflicts:0,errors:[],inserted:{}},m;try{m=await be(s)}catch(p){return{failure:{message:t("Invalid NDJSON: {message}",{message:C(p)}),rows:0},total:a}}let w=0,y=n(async(p,I)=>{P(t("Importing rows {from}\u2013{to} of {total}\u2026",{from:w+1,to:w+p.length,total:m}));let N=await l.query(fe,{rows:p,startLine:I},L(o));a.conflicts+=N.conflicts,a.errors.push(...N.errors);for(let[W,de]of Object.entries(N.inserted))a.inserted[W]=(a.inserted[W]??0)+de;w+=p.length},"N");try{return await we(s,y),{failure:void 0,total:a}}catch(p){return{failure:{message:C(p),rows:w},total:a}}},"V"),se=n(async s=>{g(!0),j(null),T(null),O(null);let{failure:a,total:m}=await oe(s);a===void 0?(K(o),T(m)):a.rows>0?(T(m),j(t("Import stopped after {rows} rows: {message}. The counts below cover completed chunks only; the failed chunk may also have written rows.",{message:a.message,rows:a.rows}))):j(a.message),r(v.readTablePage),r(v.listTables)},"X"),ae=b===null?0:Object.values(b.inserted).reduce((s,a)=>s+a,0),le=n(()=>{J(re().finally(()=>{g(!1)}))},"Q"),ne=n(()=>{x!==null&&J(se(x).finally(()=>{P(null),g(!1)}))},"Z"),ie=n(()=>{f!==null&&V(`${f.shardKey.trim()===""?"shard":f.shardKey.trim()}.ndjson`,f.blob,q)},"ee"),ce=n(s=>{d(s.target.files?.[0]??null)},"te");return(0,e.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-export-import",children:[(0,e.jsxs)(B,{className:"gap-0 py-0 rounded-xl border border-border bg-card shadow-xs",children:[(0,e.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,e.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:t("Export")})}),(0,e.jsxs)(D,{className:"flex flex-col gap-3 p-4",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsx)(H,{onChange:c,testId:"ei-shard-input",value:o}),(0,e.jsx)(A,{"data-testid":"ei-export",disabled:u,onClick:le,type:"button",children:t("Export")})]}),f!==null&&(0,e.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"ei-export-result",children:t("Exported {count} rows.",{count:f.count})}),(0,e.jsx)(A,{"data-testid":"ei-download",onClick:ie,size:"sm",type:"button",variant:"outline",children:t("Download")})]}),f.preview!==""&&(0,e.jsx)("pre",{className:"max-h-60 overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-xs","data-testid":"ei-preview",children:f.preview})]})]})]}),(0,e.jsxs)(B,{className:"gap-0 py-0 rounded-xl border border-border bg-card shadow-xs",children:[(0,e.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,e.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:t("Import")})}),(0,e.jsxs)(D,{className:"flex flex-col gap-3 p-4",children:[(0,e.jsx)("input",{accept:".ndjson,.jsonl,application/x-ndjson","aria-label":"NDJSON",className:"text-sm","data-testid":"ei-file",onChange:ce,type:"file"}),(0,e.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:(0,e.jsx)(Q,{confirmLabel:t("Import (writes rows)?"),disabled:u||x===null,onConfirm:ne,testId:"ei-import",children:t("Import")})}),z!==null&&(0,e.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"ei-progress",role:"status",children:z}),b!==null&&(0,e.jsxs)("div",{className:"flex flex-col gap-2","data-testid":"ei-import-result",children:[(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:t("Inserted {inserted}, {conflicts} conflicts, {errors} errors.",{conflicts:b.conflicts,errors:b.errors.length,inserted:ae})}),b.errors.length>0&&(0,e.jsx)("ul",{className:"flex flex-col gap-1","data-testid":"ei-import-errors",children:b.errors.map(s=>(0,e.jsx)("li",{className:"text-xs text-destructive",children:t("line {line} ({table}): {message}",{line:s.line,message:s.message,table:s.table})},`${s.table}-${s.line.toString()}`))})]})]})]}),S!==null&&(0,e.jsx)("p",{className:"text-sm text-destructive","data-testid":"ei-error",role:"alert",children:S})]})},"Le");export{Ae as ExportImportPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as He}from"./chunk-CGQMJYCW.js";import{a as Se}from"./chunk-37WYCOQ2.js";import{a as Ge}from"./chunk-J2OLAMJR.js";import{a as qe}from"./chunk-LXCVA5SP.js";import{i as Ue}from"./chunk-E4PXACVL.js";import"./chunk-MVWZMWPD.js";import"./chunk-7Y3SY37W.js";import{a as $e}from"./chunk-7G4Z6Q7X.js";import"./chunk-3YXASVTP.js";import"./chunk-AUAECCXB.js";import{b as Ze}from"./chunk-Q6ED4KUL.js";import"./chunk-BOMPSVRC.js";import{a as je}from"./chunk-4ZEL6BYL.js";import{l as Ke}from"./chunk-X6XAMP4E.js";import"./chunk-QAQDMS6R.js";import"./chunk-NRAAYZ4C.js";import{d as Pe,f as Fe,g as me,h as Ce,i as Oe,q as Re}from"./chunk-74IYYDDI.js";import{a as s,d as Me,e as ot,f as at,g as lt}from"./chunk-I26MS5PJ.js";var De=Me(at(),1);var m=Me(ot(),1);var r=Me(lt(),1);var ze=Fe(je.getPitrBookmark),st=Fe(je.pitrRestore),nt=/^\d+$/u,Je=s(ie=>{let e=ie.trim(),h=nt.test(e)?Number(e):Date.parse(e),l=new Date(h);return Number.isNaN(l.getTime())?void 0:{epochMs:h,iso:l.toISOString()}},"De"),it=s(ie=>{let e=(0,De.c)(9),{text:h}=ie,l=Pe();if(h.trim()==="")return null;let t,o,p;if(e[0]!==l||e[1]!==h){let y=Je(h);t="font-mono text-xs text-muted-foreground",o="pitr-time-resolved",p=y===void 0?l("Not a time \u2014 use epoch-ms or ISO 8601."):l("Resolves to {instant} (a date-time without an offset is read in this browser's time zone; a bare date is UTC)",{instant:y.iso}),e[0]=l,e[1]=h,e[2]=t,e[3]=o,e[4]=p}else t=e[2],o=e[3],p=e[4];let N;return e[5]!==t||e[6]!==o||e[7]!==p?(N=(0,r.jsx)("p",{className:t,"data-testid":o,children:p}),e[5]=t,e[6]=o,e[7]=p,e[8]=N):N=e[8],N},"lt"),vt=s(ie=>{let e=(0,De.c)(140),{initialShardKey:h}=ie,l=Ke(),t=Pe(),o=h??"",p=He(o),[N,y]=(0,m.useState)(null),[f,Qe]=(0,m.useState)(""),[ce,Ee]=(0,m.useState)(null),[c,We]=(0,m.useState)(""),[b,Xe]=(0,m.useState)(!1),[i,Ye]=(0,m.useState)(null),[ue,w]=(0,m.useState)(null),[de,I]=(0,m.useState)(!1),[C,Ve]=(0,m.useState)(!1),pe;e[0]!==l||e[1]!==o?(pe=s(async a=>{I(!0),w(null);let d;try{d={current:(await l.query(ze,{},me(o))).current,error:null,unavailable:!1}}catch(n){let g=n;d={current:null,error:Ce(g),unavailable:Oe(g)==="PITR_UNAVAILABLE"}}a?.aborted!==!0&&(d.error===null?y(d.current):w(d.error),Ve(d.unavailable),I(!1))},"fe"),e[0]=l,e[1]=o,e[2]=pe):pe=e[2];let x=pe,he,fe;e[3]!==x?(he=s(()=>{let a=new AbortController;return Re(x(a.signal)),()=>{a.abort()}},"ue"),fe=[x],e[3]=x,e[4]=he,e[5]=fe):(he=e[4],fe=e[5]),(0,m.useEffect)(he,fe);let be;e[6]!==l||e[7]!==o?(be=s(async()=>{let a=await l.query(ze,{},me(o));y(a.current)},"he"),e[6]=l,e[7]=o,e[8]=be):be=e[8],Ge(be,!C);let xe;e[9]===Symbol.for("react.memo_cache_sentinel")?(xe=s(a=>{Qe(a.target.value)},"be"),e[9]=xe):xe=e[9];let et=xe,ke;e[10]===Symbol.for("react.memo_cache_sentinel")?(ke=s(a=>{We(a.target.value)},"xe"),e[10]=ke):ke=e[10];let tt=ke,Ne;e[11]===Symbol.for("react.memo_cache_sentinel")?(Ne=s(a=>{Xe(a.target.checked)},"ke"),e[11]=Ne):Ne=e[11];let rt=Ne,ve,R,u,k,v,ge;if(e[12]!==c||e[13]!==l||e[14]!==ce||e[15]!==x||e[16]!==o||e[17]!==p||e[18]!==t||e[19]!==f){u=Je(f),R=s(()=>{if(u===void 0)return;let d=o;Re((async()=>{I(!0),w(null);let n;try{n={result:await l.query(ze,{time:u.epochMs},me(d))}}catch(g){n={error:Ce(g)}}p.current===d&&("result"in n?(Ee(n.result.forTime===void 0?null:{bookmark:n.result.forTime,shard:d}),y(n.result.current)):(Ee(null),w(n.error)),I(!1))})())},"C"),v=ce?.shard===o?ce.bookmark:null;let a;e[26]!==l||e[27]!==x||e[28]!==o?(a=s(d=>{Re((async()=>{I(!0),w(null);try{let n=await l.mutation(st,d,me(o));Ye(n),await x()}catch(n){let g=n;w(Ce(g)),Oe(g)==="PITR_UNAVAILABLE"&&Ve(!0)}I(!1)})())},"o"),e[26]=l,e[27]=x,e[28]=o,e[29]=a):a=e[29],k=a,ve=c.trim()!==""||u!==void 0,ge=t("Restore {shard} to {target}?",{shard:o===""?t("root"):o,target:c.trim()===""?u?.iso??"":t("the given bookmark")}),e[12]=c,e[13]=l,e[14]=ce,e[15]=x,e[16]=o,e[17]=p,e[18]=t,e[19]=f,e[20]=ve,e[21]=R,e[22]=u,e[23]=k,e[24]=v,e[25]=ge}else ve=e[20],R=e[21],u=e[22],k=e[23],v=e[24],ge=e[25];let Te=ge,ye;e[30]!==c||e[31]!==u?.epochMs||e[32]!==b||e[33]!==k?(ye=s(()=>{let a=b?{restart:!0}:{};c.trim()===""?a.time=u?.epochMs:a.bookmark=c.trim(),k(a)},"Ne"),e[30]=c,e[31]=u?.epochMs,e[32]=b,e[33]=k,e[34]=ye):ye=e[34];let Be=ye,we;e[35]!==b||e[36]!==i||e[37]!==k?(we=s(()=>{i!==null&&k(b?{bookmark:i.undoBookmark,restart:!0}:{bookmark:i.undoBookmark})},"ye"),e[35]=b,e[36]=i,e[37]=k,e[38]=we):we=e[38];let Ae=we,S;e[39]!==t?(S=t("Shard"),e[39]=t,e[40]=S):S=e[40];let T;e[41]!==o||e[42]!==t?(T=o===""?t("root"):o,e[41]=o,e[42]=t,e[43]=T):T=e[43];let B;e[44]!==T?(B=(0,r.jsx)("span",{className:"font-mono",children:T}),e[44]=T,e[45]=B):B=e[45];let A;e[46]!==S||e[47]!==B?(A=(0,r.jsx)("div",{className:"flex flex-wrap items-center gap-3",children:(0,r.jsxs)("span",{className:"text-xs text-muted-foreground",children:[S,": ",B]})}),e[46]=S,e[47]=B,e[48]=A):A=e[48];let _;e[49]!==t?(_=t("In-place recovery to any moment in the last 30 days. For older or portable recovery, use the snapshot backup tier."),e[49]=t,e[50]=_):_=e[50];let L;e[51]!==_?(L=(0,r.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"pitr-note",children:_}),e[51]=_,e[52]=L):L=e[52];let M;e[53]!==ue?(M=ue!==null&&(0,r.jsx)("p",{className:"text-sm text-destructive","data-testid":"pitr-error",role:"alert",children:ue}),e[53]=ue,e[54]=M):M=e[54];let P;e[55]!==t?(P=t("Current bookmark"),e[55]=t,e[56]=P):P=e[56];let U;e[57]!==P?(U=(0,r.jsx)("h3",{className:"mb-2 text-sm font-semibold",children:P}),e[57]=P,e[58]=U):U=e[58];let F;e[59]!==N?(F=N??(0,r.jsx)("span",{className:"text-muted-foreground",children:"\u2014"}),e[59]=N,e[60]=F):F=e[60];let O;e[61]!==F?(O=(0,r.jsx)("p",{className:"font-mono text-xs break-all text-muted-foreground","data-testid":"pitr-current",children:F}),e[61]=F,e[62]=O):O=e[62];let j;e[63]!==U||e[64]!==O?(j=(0,r.jsxs)("section",{className:"rounded-xl border border-border bg-card p-3 shadow-xs",children:[U,O]}),e[63]=U,e[64]=O,e[65]=j):j=e[65];let q;e[66]!==t?(q=t("Restore"),e[66]=t,e[67]=q):q=e[67];let z;e[68]!==q?(z=(0,r.jsx)("h3",{className:"text-sm font-semibold",children:q}),e[68]=q,e[69]=z):z=e[69];let D;e[70]!==t?(D=t("Time (ISO or epoch-ms, last 30 days)"),e[70]=t,e[71]=D):D=e[71];let E;e[72]!==D?(E=(0,r.jsx)(Se,{htmlFor:"pitr-time",children:D}),e[72]=D,e[73]=E):E=e[73];let V;e[74]!==f?(V=(0,r.jsx)(Ue,{"data-testid":"pitr-time",id:"pitr-time",onChange:et,placeholder:"2026-06-01T00:00:00.000Z",value:f}),e[74]=f,e[75]=V):V=e[75];let _e=de||C||u===void 0,K;e[76]!==t?(K=t("Preview"),e[76]=t,e[77]=K):K=e[77];let Z;e[78]!==R||e[79]!==_e||e[80]!==K?(Z=(0,r.jsx)($e,{"data-testid":"pitr-preview",disabled:_e,onClick:R,size:"sm",type:"button",variant:"outline",children:K}),e[78]=R,e[79]=_e,e[80]=K,e[81]=Z):Z=e[81];let $;e[82]!==V||e[83]!==Z?($=(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[V,Z]}),e[82]=V,e[83]=Z,e[84]=$):$=e[84];let G;e[85]!==f?(G=(0,r.jsx)(it,{text:f}),e[85]=f,e[86]=G):G=e[86];let H;e[87]!==v||e[88]!==t?(H=v!==null&&(0,r.jsxs)("p",{className:"font-mono text-xs break-all text-muted-foreground","data-testid":"pitr-preview-bookmark",children:[t("Bookmark for that time"),": ",v]}),e[87]=v,e[88]=t,e[89]=H):H=e[89];let J;e[90]!==E||e[91]!==$||e[92]!==G||e[93]!==H?(J=(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[E,$,G,H]}),e[90]=E,e[91]=$,e[92]=G,e[93]=H,e[94]=J):J=e[94];let Q;e[95]!==t?(Q=t("Or an explicit bookmark (wins over time)"),e[95]=t,e[96]=Q):Q=e[96];let W;e[97]!==Q?(W=(0,r.jsx)(Se,{htmlFor:"pitr-bookmark",children:Q}),e[97]=Q,e[98]=W):W=e[98];let X;e[99]!==t?(X=t("bookmark string"),e[99]=t,e[100]=X):X=e[100];let Y;e[101]!==c||e[102]!==X?(Y=(0,r.jsx)(Ue,{"data-testid":"pitr-bookmark",id:"pitr-bookmark",onChange:tt,placeholder:X,value:c}),e[101]=c,e[102]=X,e[103]=Y):Y=e[103];let ee;e[104]!==W||e[105]!==Y?(ee=(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[W,Y]}),e[104]=W,e[105]=Y,e[106]=ee):ee=e[106];let te;e[107]!==b?(te=(0,r.jsx)("input",{checked:b,className:"size-4 accent-primary","data-testid":"pitr-restart",id:"pitr-restart",onChange:rt,type:"checkbox"}),e[107]=b,e[108]=te):te=e[108];let re;e[109]!==t?(re=t("Restart the shard now so recovery applies immediately"),e[109]=t,e[110]=re):re=e[110];let oe;e[111]!==te||e[112]!==re?(oe=(0,r.jsxs)(Se,{className:"flex items-center gap-2 text-xs font-normal text-muted-foreground",htmlFor:"pitr-restart",children:[te,re]}),e[111]=te,e[112]=re,e[113]=oe):oe=e[113];let Le=de||C||!ve,ae;e[114]!==t?(ae=t("Restore"),e[114]=t,e[115]=ae):ae=e[115];let le;e[116]!==Te||e[117]!==Be||e[118]!==Le||e[119]!==ae?(le=(0,r.jsx)("div",{children:(0,r.jsx)(qe,{confirmLabel:Te,disabled:Le,onConfirm:Be,testId:"pitr-restore",children:ae})}),e[116]=Te,e[117]=Be,e[118]=Le,e[119]=ae,e[120]=le):le=e[120];let se;e[121]!==z||e[122]!==J||e[123]!==ee||e[124]!==oe||e[125]!==le?(se=(0,r.jsxs)("section",{className:"flex flex-col gap-3 rounded-xl border border-border bg-card p-3 shadow-xs",children:[z,J,ee,oe,le]}),e[121]=z,e[122]=J,e[123]=ee,e[124]=oe,e[125]=le,e[126]=se):se=e[126];let ne;e[127]!==de||e[128]!==Ae||e[129]!==i||e[130]!==t||e[131]!==C?(ne=i!==null&&(0,r.jsxs)("section",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card p-3 shadow-xs","data-testid":"pitr-result",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold",children:t("Restore armed")}),(0,r.jsx)(Ze,{variant:i.restarted?"destructive":"secondary",children:i.restarted?t("restarted now"):t("on next restart")})]}),(0,r.jsxs)("p",{className:"font-mono text-xs break-all text-muted-foreground",children:[t("Restored to"),": ",i.restoredTo]}),(0,r.jsxs)("p",{className:"font-mono text-xs break-all text-muted-foreground","data-testid":"pitr-undo-bookmark",children:[t("Undo bookmark"),": ",i.undoBookmark]}),(0,r.jsx)("div",{children:(0,r.jsx)(qe,{confirmLabel:t("Confirm undo"),disabled:de||C,onConfirm:Ae,testId:"pitr-undo",children:t("Undo restore")})})]}),e[127]=de,e[128]=Ae,e[129]=i,e[130]=t,e[131]=C,e[132]=ne):ne=e[132];let Ie;return e[133]!==A||e[134]!==L||e[135]!==M||e[136]!==j||e[137]!==se||e[138]!==ne?(Ie=(0,r.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-pitr",children:[A,L,M,j,se,ne]}),e[133]=A,e[134]=L,e[135]=M,e[136]=j,e[137]=se,e[138]=ne,e[139]=Ie):Ie=e[139],Ie},"Nt");export{vt as PitrPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var kt=Object.create;var te=Object.defineProperty;var vt=Object.getOwnPropertyDescriptor;var _t=Object.getOwnPropertyNames;var Et=Object.getPrototypeOf,Ct=Object.prototype.hasOwnProperty;var s=(e,t)=>te(e,"name",{value:t,configurable:!0});var V=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(o){throw t=0,o}},Ho=(e,t)=>{for(var o in t)te(e,o,{get:t[o],enumerable:!0})},Tt=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of _t(t))!Ct.call(e,n)&&n!==o&&te(e,n,{get:()=>t[n],enumerable:!(r=vt(t,n))||r.enumerable});return e};var Yo=(e,t,o)=>(o=e!=null?kt(Et(e)):{},Tt(t||!e||!e.__esModule?te(o,"default",{value:e,enumerable:!0}):o,e));var Ue=V(m=>{"use strict";var me=Symbol.for("react.transitional.element"),Rt=Symbol.for("react.portal"),At=Symbol.for("react.fragment"),St=Symbol.for("react.strict_mode"),zt=Symbol.for("react.profiler"),Pt=Symbol.for("react.consumer"),Mt=Symbol.for("react.context"),It=Symbol.for("react.forward_ref"),Gt=Symbol.for("react.suspense"),Nt=Symbol.for("react.memo"),Ne=Symbol.for("react.lazy"),Ot=Symbol.for("react.activity"),jt=Symbol.for("react.view_transition"),Pe=Symbol.iterator;function Lt(e){return e===null||typeof e!="object"?null:(e=Pe&&e[Pe]||e["@@iterator"],typeof e=="function"?e:null)}s(Lt,"getIteratorFn");var Oe={isMounted:s(function(){return!1},"isMounted"),enqueueForceUpdate:s(function(){},"enqueueForceUpdate"),enqueueReplaceState:s(function(){},"enqueueReplaceState"),enqueueSetState:s(function(){},"enqueueSetState")},je=Object.assign,Le={};function q(e,t,o){this.props=e,this.context=t,this.refs=Le,this.updater=o||Oe}s(q,"Component");q.prototype.isReactComponent={};q.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};q.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function $e(){}s($e,"ComponentDummy");$e.prototype=q.prototype;function be(e,t,o){this.props=e,this.context=t,this.refs=Le,this.updater=o||Oe}s(be,"PureComponent");var ge=be.prototype=new $e;ge.constructor=be;je(ge,q.prototype);ge.isPureReactComponent=!0;var Me=Array.isArray;function fe(){}s(fe,"noop");var h={H:null,A:null,T:null,S:null},He=Object.prototype.hasOwnProperty;function he(e,t,o){var r=o.ref;return{$$typeof:me,type:e,key:t,ref:r!==void 0?r:null,props:o}}s(he,"ReactElement");function $t(e,t){return he(e.type,t,e.props)}s($t,"cloneAndReplaceKey");function ye(e){return typeof e=="object"&&e!==null&&e.$$typeof===me}s(ye,"isValidElement");function Ht(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(o){return t[o]})}s(Ht,"escape");var Ie=/\/+/g;function pe(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Ht(""+e.key):t.toString(36)}s(pe,"getElementKey");function Yt(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(fe,fe):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}s(Yt,"resolveThenable");function D(e,t,o,r,n){var l=typeof e;(l==="undefined"||l==="boolean")&&(e=null);var i=!1;if(e===null)i=!0;else switch(l){case"bigint":case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case me:case Rt:i=!0;break;case Ne:return i=e._init,D(i(e._payload),t,o,r,n)}}if(i)return n=n(e),i=r===""?"."+pe(e,0):r,Me(n)?(o="",i!=null&&(o=i.replace(Ie,"$&/")+"/"),D(n,t,o,"",function(b){return b})):n!=null&&(ye(n)&&(n=$t(n,o+(n.key==null||e&&e.key===n.key?"":(""+n.key).replace(Ie,"$&/")+"/")+i)),t.push(n)),1;i=0;var p=r===""?".":r+":";if(Me(e))for(var f=0;f<e.length;f++)r=e[f],l=p+pe(r,f),i+=D(r,t,o,l,n);else if(f=Lt(e),typeof f=="function")for(e=f.call(e),f=0;!(r=e.next()).done;)r=r.value,l=p+pe(r,f++),i+=D(r,t,o,l,n);else if(l==="object"){if(typeof e.then=="function")return D(Yt(e),t,o,r,n);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return i}s(D,"mapIntoArray");function oe(e,t,o){if(e==null)return e;var r=[],n=0;return D(e,r,"","",function(l){return t.call(o,l,n++)}),r}s(oe,"mapChildren");function Wt(e){if(e._status===-1){var t=e._result,o=t();o.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r,o.status===void 0&&(o.status="fulfilled",o.value=r))},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r,o.status===void 0&&(o.status="rejected",o.reason=r))}),e._status===-1&&(e._status=0,e._result=o)}if(e._status===1)return e._result.default;throw e._result}s(Wt,"lazyInitializer");var Ge=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function Ye(e){var t=h.T,o={};o.types=t!==null?t.types:null,h.T=o;try{var r=e(),n=h.S;n!==null&&n(o,r),typeof r=="object"&&r!==null&&typeof r.then=="function"&&r.then(fe,Ge)}catch(l){Ge(l)}finally{t!==null&&o.types!==null&&(t.types=o.types),h.T=t}}s(Ye,"startTransition");function We(e){var t=h.T;if(t!==null){var o=t.types;o===null?t.types=[e]:o.indexOf(e)===-1&&o.push(e)}else Ye(We.bind(null,e))}s(We,"addTransitionType");var Ut={map:oe,forEach:s(function(e,t,o){oe(e,function(){t.apply(this,arguments)},o)},"forEach"),count:s(function(e){var t=0;return oe(e,function(){t++}),t},"count"),toArray:s(function(e){return oe(e,function(t){return t})||[]},"toArray"),only:s(function(e){if(!ye(e))throw Error("React.Children.only expected to receive a single React element child.");return e},"only")};m.Activity=Ot;m.Children=Ut;m.Component=q;m.Fragment=At;m.Profiler=zt;m.PureComponent=be;m.StrictMode=St;m.Suspense=Gt;m.ViewTransition=jt;m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=h;m.__COMPILER_RUNTIME={__proto__:null,c:s(function(e){return h.H.useMemoCache(e)},"c")};m.addTransitionType=We;m.cache=function(e){return function(){return e.apply(null,arguments)}};m.cacheSignal=function(){return null};m.cloneElement=function(e,t,o){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var r=je({},e.props),n=e.key;if(t!=null)for(l in t.key!==void 0&&(n=""+t.key),t)!He.call(t,l)||l==="key"||l==="__self"||l==="__source"||l==="ref"&&t.ref===void 0||(r[l]=t[l]);var l=arguments.length-2;if(l===1)r.children=o;else if(1<l){for(var i=Array(l),p=0;p<l;p++)i[p]=arguments[p+2];r.children=i}return he(e.type,n,r)};m.createContext=function(e){return e={$$typeof:Mt,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:Pt,_context:e},e};m.createElement=function(e,t,o){var r,n={},l=null;if(t!=null)for(r in t.key!==void 0&&(l=""+t.key),t)He.call(t,r)&&r!=="key"&&r!=="__self"&&r!=="__source"&&(n[r]=t[r]);var i=arguments.length-2;if(i===1)n.children=o;else if(1<i){for(var p=Array(i),f=0;f<i;f++)p[f]=arguments[f+2];n.children=p}if(e&&e.defaultProps)for(r in i=e.defaultProps,i)n[r]===void 0&&(n[r]=i[r]);return he(e,l,n)};m.createRef=function(){return{current:null}};m.forwardRef=function(e){return{$$typeof:It,render:e}};m.isValidElement=ye;m.lazy=function(e){return{$$typeof:Ne,_payload:{_status:-1,_result:e},_init:Wt}};m.memo=function(e,t){return{$$typeof:Nt,type:e,compare:t===void 0?null:t}};m.startTransition=Ye;m.unstable_useCacheRefresh=function(){return h.H.useCacheRefresh()};m.use=function(e){return h.H.use(e)};m.useActionState=function(e,t,o){return h.H.useActionState(e,t,o)};m.useCallback=function(e,t){return h.H.useCallback(e,t)};m.useContext=function(e){return h.H.useContext(e)};m.useDebugValue=function(){};m.useDeferredValue=function(e,t){return h.H.useDeferredValue(e,t)};m.useEffect=function(e,t){return h.H.useEffect(e,t)};m.useEffectEvent=function(e){return h.H.useEffectEvent(e)};m.useId=function(){return h.H.useId()};m.useImperativeHandle=function(e,t,o){return h.H.useImperativeHandle(e,t,o)};m.useInsertionEffect=function(e,t){return h.H.useInsertionEffect(e,t)};m.useLayoutEffect=function(e,t){return h.H.useLayoutEffect(e,t)};m.useMemo=function(e,t){return h.H.useMemo(e,t)};m.useOptimistic=function(e,t){return h.H.useOptimistic(e,t)};m.useReducer=function(e,t,o){return h.H.useReducer(e,t,o)};m.useRef=function(e){return h.H.useRef(e)};m.useState=function(e){return h.H.useState(e)};m.useSyncExternalStore=function(e,t,o){return h.H.useSyncExternalStore(e,t,o)};m.useTransition=function(){return h.H.useTransition()};m.version="19.3.0"});var De=V((Do,Ve)=>{"use strict";Ve.exports=Ue()});var Be=V(qe=>{"use strict";var Vt=De().__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;qe.c=function(e){return Vt.H.useMemoCache(e)}});var Dt=V((Bo,Fe)=>{"use strict";Fe.exports=Be()});var Qe=V(re=>{"use strict";var qt=Symbol.for("react.transitional.element"),Bt=Symbol.for("react.fragment");function Xe(e,t,o){var r=null;if(o!==void 0&&(r=""+o),t.key!==void 0&&(r=""+t.key),"key"in t){o={};for(var n in t)n!=="key"&&(o[n]=t[n])}else o=t;return t=o.ref,{$$typeof:qt,type:e,key:r,ref:t!==void 0?t:null,props:o}}s(Xe,"jsxProd");re.Fragment=Bt;re.jsx=Xe;re.jsxs=Xe});var Ft=V((Qo,Je)=>{"use strict";Je.exports=Qe()});function Ze(e){var t,o,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(o=Ze(e[t]))&&(r&&(r+=" "),r+=o)}else for(o in e)e[o]&&(r&&(r+=" "),r+=o);return r}s(Ze,"r");function Ke(){for(var e,t,o=0,r="",n=arguments.length;o<n;o++)(e=arguments[o])&&(t=Ze(e))&&(r&&(r+=" "),r+=t);return r}s(Ke,"clsx");var Xt=s((e,t)=>{let o=new Array(e.length+t.length);for(let r=0;r<e.length;r++)o[r]=e[r];for(let r=0;r<t.length;r++)o[e.length+r]=t[r];return o},"concatArrays"),Qt=s((e,t)=>({classGroupId:e,validator:t}),"createClassValidatorObject"),it=s((e=new Map,t=null,o)=>({nextPart:e,validators:t,classGroupId:o}),"createClassPartObject"),ie="-",et=[],Jt="arbitrary..",Zt=s(e=>{let t=eo(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s(i=>{if(i.startsWith("[")&&i.endsWith("]"))return Kt(i);let p=i.split(ie),f=p[0]===""&&p.length>1?1:0;return lt(p,f,t)},"getClassGroupId"),getConflictingClassGroupIds:s((i,p)=>{if(p){let f=r[i],b=o[i];return f?b?Xt(b,f):f:b||et}return o[i]||et},"getConflictingClassGroupIds")}},"createClassGroupUtils"),lt=s((e,t,o)=>{if(e.length-t===0)return o.classGroupId;let n=e[t],l=o.nextPart.get(n);if(l){let b=lt(e,t+1,l);if(b)return b}let i=o.validators;if(i===null)return;let p=t===0?e.join(ie):e.slice(t).join(ie),f=i.length;for(let b=0;b<f;b++){let x=i[b];if(x.validator(p))return x.classGroupId}},"getGroupRecursive"),Kt=s(e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{let t=e.slice(1,-1),o=t.indexOf(":"),r=t.slice(0,o);return r?Jt+r:void 0})(),"getGroupIdForArbitraryProperty"),eo=s(e=>{let{theme:t,classGroups:o}=e;return to(o,t)},"createClassMap"),to=s((e,t)=>{let o=it();for(let r in e){let n=e[r];ke(n,o,r,t)}return o},"processClassGroups"),ke=s((e,t,o,r)=>{let n=e.length;for(let l=0;l<n;l++){let i=e[l];oo(i,t,o,r)}},"processClassesRecursively"),oo=s((e,t,o,r)=>{if(typeof e=="string"){ro(e,t,o);return}if(typeof e=="function"){so(e,t,o,r);return}no(e,t,o,r)},"processClassDefinition"),ro=s((e,t,o)=>{let r=e===""?t:at(t,e);r.classGroupId=o},"processStringDefinition"),so=s((e,t,o,r)=>{if(io(e)){ke(e(r),t,o,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Qt(o,e))},"processFunctionDefinition"),no=s((e,t,o,r)=>{let n=Object.entries(e),l=n.length;for(let i=0;i<l;i++){let[p,f]=n[i];ke(f,at(t,p),o,r)}},"processObjectDefinition"),at=s((e,t)=>{let o=e,r=t.split(ie),n=r.length;for(let l=0;l<n;l++){let i=r[l],p=o.nextPart.get(i);p||(p=it(),o.nextPart.set(i,p)),o=p}return o},"getPart"),io=s(e=>"isThemeGetter"in e&&e.isThemeGetter===!0,"isThemeGetter"),lo=s(e=>{if(e<1)return{get:s(()=>{},"get"),set:s(()=>{},"set")};let t=0,o=Object.create(null),r=Object.create(null),n=s((l,i)=>{o[l]=i,t++,t>e&&(t=0,r=o,o=Object.create(null))},"update");return{get(l){let i=o[l];if(i!==void 0)return i;if((i=r[l])!==void 0)return n(l,i),i},set(l,i){l in o?o[l]=i:n(l,i)}}},"createLruCache"),xe="!",tt=":",ao=[],ot=s((e,t,o,r,n)=>({modifiers:e,hasImportantModifier:t,baseClassName:o,maybePostfixModifierPosition:r,isExternal:n}),"createResultObject"),co=s(e=>{let{prefix:t,experimentalParseClassName:o}=e,r=s(n=>{let l=[],i=0,p=0,f=0,b,x=n.length;for(let E=0;E<x;E++){let R=n[E];if(i===0&&p===0){if(R===tt){l.push(n.slice(f,E)),f=E+1;continue}if(R==="/"){b=E;continue}}R==="["?i++:R==="]"?i--:R==="("?p++:R===")"&&p--}let k=l.length===0?n:n.slice(f),N=k,S=!1;k.endsWith(xe)?(N=k.slice(0,-1),S=!0):k.startsWith(xe)&&(N=k.slice(1),S=!0);let B=b&&b>f?b-f:void 0;return ot(l,S,N,B)},"parseClassName");if(t){let n=t+tt,l=r;r=s(i=>i.startsWith(n)?l(i.slice(n.length)):ot(ao,!1,i,void 0,!0),"parseClassName")}if(o){let n=r;r=s(l=>o({className:l,parseClassName:n}),"parseClassName")}return r},"createParseClassName"),uo=s(e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((o,r)=>{t.set(o,1e6+r)}),o=>{let r=[],n=[];for(let l=0;l<o.length;l++){let i=o[l],p=i[0]==="[",f=t.has(i);p||f?(n.length>0&&(n.sort(),r.push(...n),n=[]),r.push(i)):n.push(i)}return n.length>0&&(n.sort(),r.push(...n)),r}},"createSortModifiers"),po=s(e=>({cache:lo(e.cacheSize),parseClassName:co(e),sortModifiers:uo(e),postfixLookupClassGroupIds:fo(e),...Zt(e)}),"createConfigUtils"),fo=s(e=>{let t=Object.create(null),o=e.postfixLookupClassGroups;if(o)for(let r=0;r<o.length;r++)t[o[r]]=!0;return t},"createPostfixLookupClassGroupIds"),mo=/\s+/,bo=s((e,t)=>{let{parseClassName:o,getClassGroupId:r,getConflictingClassGroupIds:n,sortModifiers:l,postfixLookupClassGroupIds:i}=t,p=[],f=e.trim().split(mo),b="";for(let x=f.length-1;x>=0;x-=1){let k=f[x],{isExternal:N,modifiers:S,hasImportantModifier:B,baseClassName:E,maybePostfixModifierPosition:R}=o(k);if(N){b=k+(b.length>0?" "+b:b);continue}let O=!!R,C;if(O){let P=E.substring(0,R);C=r(P);let u=C&&i[C]?r(E):void 0;u&&u!==C&&(C=u,O=!1)}else C=r(E);if(!C){if(!O){b=k+(b.length>0?" "+b:b);continue}if(C=r(E),!C){b=k+(b.length>0?" "+b:b);continue}O=!1}let F=S.length===0?"":S.length===1?S[0]:l(S).join(":"),H=B?F+xe:F,Y=H+C;if(p.indexOf(Y)>-1)continue;p.push(Y);let W=n(C,O);for(let P=0;P<W.length;++P){let u=W[P];p.push(H+u)}b=k+(b.length>0?" "+b:b)}return b},"mergeClassList"),go=s((...e)=>{let t=0,o,r,n="";for(;t<e.length;)(o=e[t++])&&(r=ct(o))&&(n&&(n+=" "),n+=r);return n},"twJoin"),ct=s(e=>{if(typeof e=="string")return e;let t,o="";for(let r=0;r<e.length;r++)e[r]&&(t=ct(e[r]))&&(o&&(o+=" "),o+=t);return o},"toValue"),ho=s((e,...t)=>{let o,r,n,l,i=s(f=>{let b=t.reduce((x,k)=>k(x),e());return o=po(b),r=o.cache.get,n=o.cache.set,l=p,p(f)},"initTailwindMerge"),p=s(f=>{let b=r(f);if(b)return b;let x=bo(f,o);return n(f,x),x},"tailwindMerge");return l=i,(...f)=>l(go(...f))},"createTailwindMerge"),yo=[],y=s(e=>{let t=s(o=>o[e]||yo,"themeGetter");return t.isThemeGetter=!0,t.themeKey=e,t},"fromTheme"),ut=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,dt=/^\((?:(\w[\w-]*):)?(.+)\)$/i,wo=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,xo=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ko=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,vo=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,_o=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Eo=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,I=s(e=>wo.test(e),"isFraction"),g=s(e=>!!e&&!Number.isNaN(Number(e)),"isNumber"),z=s(e=>!!e&&Number.isInteger(Number(e)),"isInteger"),we=s(e=>e.endsWith("%")&&g(e.slice(0,-1)),"isPercent"),M=s(e=>xo.test(e),"isTshirtSize"),pt=s(()=>!0,"isAny"),Co=s(e=>ko.test(e)&&!vo.test(e),"isLengthOnly"),ve=s(()=>!1,"isNever"),To=s(e=>_o.test(e),"isShadow"),Ro=s(e=>Eo.test(e),"isImage"),Ao=s(e=>!a(e)&&!c(e),"isAnyNonArbitrary"),So=s(e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),"isNamedContainerQuery"),zo=s(e=>G(e,bt,ve),"isArbitrarySize"),a=s(e=>ut.test(e),"isArbitraryValue"),L=s(e=>G(e,gt,Co),"isArbitraryLength"),rt=s(e=>G(e,Lo,g),"isArbitraryNumber"),Po=s(e=>G(e,yt,pt),"isArbitraryWeight"),Mo=s(e=>G(e,ht,ve),"isArbitraryFamilyName"),st=s(e=>G(e,ft,ve),"isArbitraryPosition"),Io=s(e=>G(e,mt,Ro),"isArbitraryImage"),se=s(e=>G(e,wt,To),"isArbitraryShadow"),c=s(e=>dt.test(e),"isArbitraryVariable"),X=s(e=>$(e,gt),"isArbitraryVariableLength"),Go=s(e=>$(e,ht),"isArbitraryVariableFamilyName"),nt=s(e=>$(e,ft),"isArbitraryVariablePosition"),No=s(e=>$(e,bt),"isArbitraryVariableSize"),Oo=s(e=>$(e,mt),"isArbitraryVariableImage"),ne=s(e=>$(e,wt,!0),"isArbitraryVariableShadow"),jo=s(e=>$(e,yt,!0),"isArbitraryVariableWeight"),G=s((e,t,o)=>{let r=ut.exec(e);return r?r[1]?t(r[1]):o(r[2]):!1},"getIsArbitraryValue"),$=s((e,t,o=!1)=>{let r=dt.exec(e);return r?r[1]?t(r[1]):o:!1},"getIsArbitraryVariable"),ft=s(e=>e==="position"||e==="percentage","isLabelPosition"),mt=s(e=>e==="image"||e==="url","isLabelImage"),bt=s(e=>e==="length"||e==="size"||e==="bg-size","isLabelSize"),gt=s(e=>e==="length","isLabelLength"),Lo=s(e=>e==="number","isLabelNumber"),ht=s(e=>e==="family-name","isLabelFamilyName"),yt=s(e=>e==="number"||e==="weight","isLabelWeight"),wt=s(e=>e==="shadow","isLabelShadow");var $o=s(()=>{let e=y("color"),t=y("font"),o=y("text"),r=y("font-weight"),n=y("tracking"),l=y("leading"),i=y("breakpoint"),p=y("container"),f=y("spacing"),b=y("radius"),x=y("shadow"),k=y("inset-shadow"),N=y("text-shadow"),S=y("drop-shadow"),B=y("blur"),E=y("perspective"),R=y("aspect"),O=y("ease"),C=y("animate"),F=s(()=>["auto","avoid","all","avoid-page","page","left","right","column"],"scaleBreak"),H=s(()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],"scalePosition"),Y=s(()=>[...H(),c,a],"scalePositionWithArbitrary"),W=s(()=>["auto","hidden","clip","visible","scroll"],"scaleOverflow"),P=s(()=>["auto","contain","none"],"scaleOverscroll"),u=s(()=>[c,a,f],"scaleUnambiguousSpacing"),T=s(()=>[I,"full","auto",...u()],"scaleInset"),_e=s(()=>[z,"none","subgrid",c,a],"scaleGridTemplateColsRows"),Ee=s(()=>["auto",{span:["full",z,c,a]},z,c,a],"scaleGridColRowStartAndEnd"),Q=s(()=>[z,"auto",c,a],"scaleGridColRowStartOrEnd"),Ce=s(()=>["auto","min","max","fr",c,a],"scaleGridAutoColsRows"),le=s(()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],"scaleAlignPrimaryAxis"),U=s(()=>["start","end","center","stretch","center-safe","end-safe"],"scaleAlignSecondaryAxis"),A=s(()=>["auto",...u()],"scaleMargin"),j=s(()=>[I,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...u()],"scaleSizing"),ae=s(()=>[p,I,"screen","full","dvw","lvw","svw","min","max","fit",...u()],"scaleSizingInline"),ce=s(()=>[I,"screen","full","lh","dvh","lvh","svh","min","max","fit",...u()],"scaleSizingBlock"),d=s(()=>[e,c,a],"scaleColor"),Te=s(()=>[...H(),nt,st,{position:[c,a]}],"scaleBgPosition"),Re=s(()=>["no-repeat",{repeat:["","x","y","space","round"]}],"scaleBgRepeat"),Ae=s(()=>["auto","cover","contain",No,zo,{size:[c,a]}],"scaleBgSize"),ue=s(()=>[we,X,L],"scaleGradientStopPosition"),v=s(()=>["","none","full",b,c,a],"scaleRadius"),_=s(()=>["",g,X,L],"scaleBorderWidth"),J=s(()=>["solid","dashed","dotted","double"],"scaleLineStyle"),Se=s(()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],"scaleBlendMode"),w=s(()=>[g,we,nt,st],"scaleMaskImagePosition"),ze=s(()=>["","none",B,c,a],"scaleBlur"),Z=s(()=>["none",g,c,a],"scaleRotate"),K=s(()=>["none",g,c,a],"scaleScale"),de=s(()=>[g,c,a],"scaleSkew"),ee=s(()=>[I,"full",...u()],"scaleTranslate");return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[M],breakpoint:[M],color:[pt],container:[M],"drop-shadow":[M],ease:["in","out","in-out"],font:[Ao],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[M],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[M],shadow:[M],spacing:["px",g],text:[M],"text-shadow":[M],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",I,a,c,R]}],container:["container"],"container-type":[{"@container":["","normal","size",c,a]}],"container-named":[So],columns:[{columns:[g,"auto",a,c,p]}],"break-after":[{"break-after":F()}],"break-before":[{"break-before":F()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:Y()}],overflow:[{overflow:W()}],"overflow-x":[{"overflow-x":W()}],"overflow-y":[{"overflow-y":W()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:["visible","invisible","collapse"],z:[{z:[z,"auto",c,a]}],basis:[{basis:[I,"full","auto",p,...u()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[g,I,"auto","initial","none",a]}],grow:[{grow:["",g,c,a]}],shrink:[{shrink:["",g,c,a]}],order:[{order:[z,"first","last","none",c,a]}],"grid-cols":[{"grid-cols":_e()}],"col-start-end":[{col:Ee()}],"col-start":[{"col-start":Q()}],"col-end":[{"col-end":Q()}],"grid-rows":[{"grid-rows":_e()}],"row-start-end":[{row:Ee()}],"row-start":[{"row-start":Q()}],"row-end":[{"row-end":Q()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Ce()}],"auto-rows":[{"auto-rows":Ce()}],gap:[{gap:u()}],"gap-x":[{"gap-x":u()}],"gap-y":[{"gap-y":u()}],"justify-content":[{justify:[...le(),"normal"]}],"justify-items":[{"justify-items":[...U(),"normal"]}],"justify-self":[{"justify-self":["auto",...U()]}],"align-content":[{content:["normal",...le()]}],"align-items":[{items:[...U(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...U(),{baseline:["","last"]}]}],"place-content":[{"place-content":le()}],"place-items":[{"place-items":[...U(),"baseline"]}],"place-self":[{"place-self":["auto",...U()]}],p:[{p:u()}],px:[{px:u()}],py:[{py:u()}],ps:[{ps:u()}],pe:[{pe:u()}],pbs:[{pbs:u()}],pbe:[{pbe:u()}],pt:[{pt:u()}],pr:[{pr:u()}],pb:[{pb:u()}],pl:[{pl:u()}],m:[{m:A()}],mx:[{mx:A()}],my:[{my:A()}],ms:[{ms:A()}],me:[{me:A()}],mbs:[{mbs:A()}],mbe:[{mbe:A()}],mt:[{mt:A()}],mr:[{mr:A()}],mb:[{mb:A()}],ml:[{ml:A()}],"space-x":[{"space-x":u()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":u()}],"space-y-reverse":["space-y-reverse"],size:[{size:j()}],"inline-size":[{inline:["auto",...ae()]}],"min-inline-size":[{"min-inline":["auto",...ae()]}],"max-inline-size":[{"max-inline":["none",...ae()]}],"block-size":[{block:["auto",...ce()]}],"min-block-size":[{"min-block":["auto",...ce()]}],"max-block-size":[{"max-block":["none",...ce()]}],w:[{w:[p,"screen",...j()]}],"min-w":[{"min-w":[p,"screen","none",...j()]}],"max-w":[{"max-w":[p,"screen","none","prose",{screen:[i]},...j()]}],h:[{h:["screen","lh",...j()]}],"min-h":[{"min-h":["screen","lh","none",...j()]}],"max-h":[{"max-h":["screen","lh","none",...j()]}],"font-size":[{text:["base",o,X,L]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,jo,Po]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",we,a]}],"font-family":[{font:[Go,Mo,t]}],"font-features":[{"font-features":[a]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[n,c,a]}],"line-clamp":[{"line-clamp":[g,"none",c,rt]}],leading:[{leading:["none",l,...u()]}],"list-image":[{"list-image":["none",c,a]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",c,a]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:d()}],"text-color":[{text:d()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...J(),"wavy"]}],"text-decoration-thickness":[{decoration:[g,"from-font","auto",c,L]}],"text-decoration-color":[{decoration:d()}],"underline-offset":[{"underline-offset":[g,"auto",c,a]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:u()}],"tab-size":[{tab:[z,c,a]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",c,a]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",c,a]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Te()}],"bg-repeat":[{bg:Re()}],"bg-size":[{bg:Ae()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},z,c,a],radial:["",c,a],conic:["",z,c,a]},Oo,Io]}],"bg-color":[{bg:d()}],"gradient-from-pos":[{from:ue()}],"gradient-via-pos":[{via:ue()}],"gradient-to-pos":[{to:ue()}],"gradient-from":[{from:d()}],"gradient-via":[{via:d()}],"gradient-to":[{to:d()}],rounded:[{rounded:v()}],"rounded-s":[{"rounded-s":v()}],"rounded-e":[{"rounded-e":v()}],"rounded-t":[{"rounded-t":v()}],"rounded-r":[{"rounded-r":v()}],"rounded-b":[{"rounded-b":v()}],"rounded-l":[{"rounded-l":v()}],"rounded-ss":[{"rounded-ss":v()}],"rounded-se":[{"rounded-se":v()}],"rounded-ee":[{"rounded-ee":v()}],"rounded-es":[{"rounded-es":v()}],"rounded-tl":[{"rounded-tl":v()}],"rounded-tr":[{"rounded-tr":v()}],"rounded-br":[{"rounded-br":v()}],"rounded-bl":[{"rounded-bl":v()}],"border-w":[{border:_()}],"border-w-x":[{"border-x":_()}],"border-w-y":[{"border-y":_()}],"border-w-s":[{"border-s":_()}],"border-w-e":[{"border-e":_()}],"border-w-bs":[{"border-bs":_()}],"border-w-be":[{"border-be":_()}],"border-w-t":[{"border-t":_()}],"border-w-r":[{"border-r":_()}],"border-w-b":[{"border-b":_()}],"border-w-l":[{"border-l":_()}],"divide-x":[{"divide-x":_()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":_()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...J(),"hidden","none"]}],"divide-style":[{divide:[...J(),"hidden","none"]}],"border-color":[{border:d()}],"border-color-x":[{"border-x":d()}],"border-color-y":[{"border-y":d()}],"border-color-s":[{"border-s":d()}],"border-color-e":[{"border-e":d()}],"border-color-bs":[{"border-bs":d()}],"border-color-be":[{"border-be":d()}],"border-color-t":[{"border-t":d()}],"border-color-r":[{"border-r":d()}],"border-color-b":[{"border-b":d()}],"border-color-l":[{"border-l":d()}],"divide-color":[{divide:d()}],"outline-style":[{outline:[...J(),"none","hidden"]}],"outline-offset":[{"outline-offset":[g,c,a]}],"outline-w":[{outline:["",g,X,L]}],"outline-color":[{outline:d()}],shadow:[{shadow:["","inner","none",x,ne,se]}],"shadow-color":[{shadow:d()}],"inset-shadow":[{"inset-shadow":["none",k,ne,se]}],"inset-shadow-color":[{"inset-shadow":d()}],"ring-w":[{ring:_()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:d()}],"ring-offset-w":[{"ring-offset":[g,L]}],"ring-offset-color":[{"ring-offset":d()}],"inset-ring-w":[{"inset-ring":_()}],"inset-ring-color":[{"inset-ring":d()}],"text-shadow":[{"text-shadow":["none",N,ne,se]}],"text-shadow-color":[{"text-shadow":d()}],opacity:[{opacity:[g,c,a]}],"mix-blend":[{"mix-blend":[...Se(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Se()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[g]}],"mask-image-linear-from-pos":[{"mask-linear-from":w()}],"mask-image-linear-to-pos":[{"mask-linear-to":w()}],"mask-image-linear-from-color":[{"mask-linear-from":d()}],"mask-image-linear-to-color":[{"mask-linear-to":d()}],"mask-image-t-from-pos":[{"mask-t-from":w()}],"mask-image-t-to-pos":[{"mask-t-to":w()}],"mask-image-t-from-color":[{"mask-t-from":d()}],"mask-image-t-to-color":[{"mask-t-to":d()}],"mask-image-r-from-pos":[{"mask-r-from":w()}],"mask-image-r-to-pos":[{"mask-r-to":w()}],"mask-image-r-from-color":[{"mask-r-from":d()}],"mask-image-r-to-color":[{"mask-r-to":d()}],"mask-image-b-from-pos":[{"mask-b-from":w()}],"mask-image-b-to-pos":[{"mask-b-to":w()}],"mask-image-b-from-color":[{"mask-b-from":d()}],"mask-image-b-to-color":[{"mask-b-to":d()}],"mask-image-l-from-pos":[{"mask-l-from":w()}],"mask-image-l-to-pos":[{"mask-l-to":w()}],"mask-image-l-from-color":[{"mask-l-from":d()}],"mask-image-l-to-color":[{"mask-l-to":d()}],"mask-image-x-from-pos":[{"mask-x-from":w()}],"mask-image-x-to-pos":[{"mask-x-to":w()}],"mask-image-x-from-color":[{"mask-x-from":d()}],"mask-image-x-to-color":[{"mask-x-to":d()}],"mask-image-y-from-pos":[{"mask-y-from":w()}],"mask-image-y-to-pos":[{"mask-y-to":w()}],"mask-image-y-from-color":[{"mask-y-from":d()}],"mask-image-y-to-color":[{"mask-y-to":d()}],"mask-image-radial":[{"mask-radial":[c,a]}],"mask-image-radial-from-pos":[{"mask-radial-from":w()}],"mask-image-radial-to-pos":[{"mask-radial-to":w()}],"mask-image-radial-from-color":[{"mask-radial-from":d()}],"mask-image-radial-to-color":[{"mask-radial-to":d()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":H()}],"mask-image-conic-pos":[{"mask-conic":[g]}],"mask-image-conic-from-pos":[{"mask-conic-from":w()}],"mask-image-conic-to-pos":[{"mask-conic-to":w()}],"mask-image-conic-from-color":[{"mask-conic-from":d()}],"mask-image-conic-to-color":[{"mask-conic-to":d()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Te()}],"mask-repeat":[{mask:Re()}],"mask-size":[{mask:Ae()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",c,a]}],filter:[{filter:["","none",c,a]}],blur:[{blur:ze()}],brightness:[{brightness:[g,c,a]}],contrast:[{contrast:[g,c,a]}],"drop-shadow":[{"drop-shadow":["","none",S,ne,se]}],"drop-shadow-color":[{"drop-shadow":d()}],grayscale:[{grayscale:["",g,c,a]}],"hue-rotate":[{"hue-rotate":[g,c,a]}],invert:[{invert:["",g,c,a]}],saturate:[{saturate:[g,c,a]}],sepia:[{sepia:["",g,c,a]}],"backdrop-filter":[{"backdrop-filter":["","none",c,a]}],"backdrop-blur":[{"backdrop-blur":ze()}],"backdrop-brightness":[{"backdrop-brightness":[g,c,a]}],"backdrop-contrast":[{"backdrop-contrast":[g,c,a]}],"backdrop-grayscale":[{"backdrop-grayscale":["",g,c,a]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[g,c,a]}],"backdrop-invert":[{"backdrop-invert":["",g,c,a]}],"backdrop-opacity":[{"backdrop-opacity":[g,c,a]}],"backdrop-saturate":[{"backdrop-saturate":[g,c,a]}],"backdrop-sepia":[{"backdrop-sepia":["",g,c,a]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":u()}],"border-spacing-x":[{"border-spacing-x":u()}],"border-spacing-y":[{"border-spacing-y":u()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",c,a]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[g,"initial",c,a]}],ease:[{ease:["linear","initial",O,c,a]}],delay:[{delay:[g,c,a]}],animate:[{animate:["none",C,c,a]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[E,c,a]}],"perspective-origin":[{"perspective-origin":Y()}],rotate:[{rotate:Z()}],"rotate-x":[{"rotate-x":Z()}],"rotate-y":[{"rotate-y":Z()}],"rotate-z":[{"rotate-z":Z()}],scale:[{scale:K()}],"scale-x":[{"scale-x":K()}],"scale-y":[{"scale-y":K()}],"scale-z":[{"scale-z":K()}],"scale-3d":["scale-3d"],skew:[{skew:de()}],"skew-x":[{"skew-x":de()}],"skew-y":[{"skew-y":de()}],transform:[{transform:[c,a,"","none","gpu","cpu"]}],"transform-origin":[{origin:Y()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ee()}],"translate-x":[{"translate-x":ee()}],"translate-y":[{"translate-y":ee()}],"translate-z":[{"translate-z":ee()}],"translate-none":["translate-none"],zoom:[{zoom:[z,c,a]}],accent:[{accent:d()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:d()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",c,a]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":d()}],"scrollbar-track-color":[{"scrollbar-track":d()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":u()}],"scroll-mx":[{"scroll-mx":u()}],"scroll-my":[{"scroll-my":u()}],"scroll-ms":[{"scroll-ms":u()}],"scroll-me":[{"scroll-me":u()}],"scroll-mbs":[{"scroll-mbs":u()}],"scroll-mbe":[{"scroll-mbe":u()}],"scroll-mt":[{"scroll-mt":u()}],"scroll-mr":[{"scroll-mr":u()}],"scroll-mb":[{"scroll-mb":u()}],"scroll-ml":[{"scroll-ml":u()}],"scroll-p":[{"scroll-p":u()}],"scroll-px":[{"scroll-px":u()}],"scroll-py":[{"scroll-py":u()}],"scroll-ps":[{"scroll-ps":u()}],"scroll-pe":[{"scroll-pe":u()}],"scroll-pbs":[{"scroll-pbs":u()}],"scroll-pbe":[{"scroll-pbe":u()}],"scroll-pt":[{"scroll-pt":u()}],"scroll-pr":[{"scroll-pr":u()}],"scroll-pb":[{"scroll-pb":u()}],"scroll-pl":[{"scroll-pl":u()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",c,a]}],fill:[{fill:["none",...d()]}],"stroke-w":[{stroke:[g,X,L,rt]}],stroke:[{stroke:["none",...d()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["start","end","right","left"],"inset-y":["inset-bs","inset-be","top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["ps","pe","pr","pl"],py:["pbs","pbe","pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["ms","me","mr","ml"],my:["mbs","mbe","mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-s","border-w-e","border-w-r","border-w-l"],"border-w-y":["border-w-bs","border-w-be","border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-s","border-color-e","border-color-r","border-color-l"],"border-color-y":["border-color-bs","border-color-be","border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-ms","scroll-me","scroll-mr","scroll-ml"],"scroll-my":["scroll-mbs","scroll-mbe","scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-ps","scroll-pe","scroll-pr","scroll-pl"],"scroll-py":["scroll-pbs","scroll-pbe","scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},"getDefaultConfig");var xt=ho($o);function rr(...e){return xt(Ke(e))}s(rr,"m");export{s as a,V as b,Ho as c,Yo as d,De as e,Dt as f,Ft as g,Ke as h,rr as i};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as y,b as G}from"./chunk-Q6IT6ZD7.js";import{a as _,b as z,c as B,d as E,e as j,f as H,g as L,h as T,i as V,j as Z,k as q,l as D}from"./chunk-ZFW3QEVE.js";import{i as K}from"./chunk-E4PXACVL.js";import{a as k}from"./chunk-7G4Z6Q7X.js";import{b as w}from"./chunk-Q6ED4KUL.js";import{d as M,q as I}from"./chunk-74IYYDDI.js";import{a as u,d as $,e as le,f as se,g as de,i as N}from"./chunk-I26MS5PJ.js";var v=$(se(),1);var h=$(le(),1);var n=$(de(),1);function ie(a){let e=(0,v.c)(10),t,l,r;e[0]!==a?({className:t,selected:r,...l}=a,e[0]=a,e[1]=t,e[2]=l,e[3]=r):(t=e[1],l=e[2],r=e[3]);let s=r===!0?"":void 0,o;e[4]!==t?(o=N("rounded-md border border-border bg-card text-card-foreground shadow-sm transition-colors","data-[selected]:border-ring data-[selected]:ring-[3px] data-[selected]:ring-ring/30",t),e[4]=t,e[5]=o):o=e[5];let d;return e[6]!==l||e[7]!==s||e[8]!==o?(d=(0,n.jsx)("div",{"data-slot":"base-node","data-selected":s,className:o,...l}),e[6]=l,e[7]=s,e[8]=o,e[9]=d):d=e[9],d}u(ie,"ie");function ce(a){let e=(0,v.c)(8),t,l;e[0]!==a?({className:t,...l}=a,e[0]=a,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let r;e[3]!==t?(r=N("flex items-center gap-2 rounded-t-md bg-muted/50 px-3 py-1.5",t),e[3]=t,e[4]=r):r=e[4];let s;return e[5]!==l||e[6]!==r?(s=(0,n.jsx)("div",{"data-slot":"base-node-header",className:r,...l}),e[5]=l,e[6]=r,e[7]=s):s=e[7],s}u(ce,"de");function me(a){let e=(0,v.c)(8),t,l;e[0]!==a?({className:t,...l}=a,e[0]=a,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let r;e[3]!==t?(r=N("flex flex-col",t),e[3]=t,e[4]=r):r=e[4];let s;return e[5]!==l||e[6]!==r?(s=(0,n.jsx)("div",{"data-slot":"base-node-content",className:r,...l}),e[5]=l,e[6]=r,e[7]=s):s=e[7],s}u(me,"ce");var O=u(a=>{let e=a.ref===void 0?a.type:`${a.type} \u2192 ${a.ref}`;return a.optional===!0?`${e}?`:e},"A"),ue=u(a=>{let e=(0,v.c)(22),{data:t,selected:l}=a,r=M(),s;e[0]!==t.label||e[1]!==t.loadError||e[2]!==r?(s=t.loadError===!0?(0,n.jsx)("span",{className:"px-3 py-1.5 text-xs text-destructive","data-testid":`sd-node-${t.label}-error`,children:r("Columns unavailable")}):(0,n.jsx)("span",{className:"px-3 py-1.5 text-xs text-muted-foreground",children:"\u2014"}),e[0]=t.label,e[1]=t.loadError,e[2]=r,e[3]=s):s=e[3];let o=s,d=`sd-node-${t.label}`,c;e[4]!==t.label?(c=(0,n.jsx)("span",{className:"truncate font-mono text-xs font-semibold",title:t.label,children:t.label}),e[4]=t.label,e[5]=c):c=e[5];let m;e[6]!==t.tier?(m=(0,n.jsx)("span",{className:"ms-auto",children:(0,n.jsx)(G,{tier:t.tier})}),e[6]=t.tier,e[7]=m):m=e[7];let i;e[8]!==c||e[9]!==m?(i=(0,n.jsxs)(ce,{children:[c,m]}),e[8]=c,e[9]=m,e[10]=i):i=e[10];let f;e[11]!==t.columns||e[12]!==t.label||e[13]!==o?(f=t.columns.length===0?o:t.columns.map(b=>(0,n.jsxs)("div",{className:N("relative flex items-center gap-2 border-t border-border px-3 py-1.5 text-xs first:border-t-0",b.pk===!0&&"bg-muted/30"),"data-testid":`sd-col-${t.label}-${b.name}`,children:[(0,n.jsx)(E,{className:"!h-2 !w-2 !-left-1 !border-border !bg-muted-foreground/70",id:b.name,isConnectable:!1,position:_.Left,type:"target"}),(0,n.jsx)("span",{className:"truncate font-mono",title:b.name,children:b.name}),b.pk===!0&&(0,n.jsx)(w,{className:"px-1 py-0 text-[10px] leading-tight",variant:"secondary",children:"PK"}),b.ref!==void 0&&(0,n.jsx)(w,{className:"px-1 py-0 text-[10px] leading-tight",variant:"outline",children:"FK"}),(0,n.jsx)("span",{className:"ms-auto truncate text-muted-foreground",title:O(b),children:O(b)}),(0,n.jsx)(E,{className:"!h-2 !w-2 !-right-1 !border-border !bg-muted-foreground/70",id:b.name,isConnectable:!1,position:_.Right,type:"source"})]},b.name)),e[11]=t.columns,e[12]=t.label,e[13]=o,e[14]=f):f=e[14];let p;e[15]!==f?(p=(0,n.jsx)(me,{children:f}),e[15]=f,e[16]=p):p=e[16];let x;return e[17]!==l||e[18]!==d||e[19]!==i||e[20]!==p?(x=(0,n.jsxs)(ie,{className:"w-64 overflow-hidden","data-testid":d,selected:l,children:[i,p]}),e[17]=l,e[18]=d,e[19]=i,e[20]=p,e[21]=x):x=e[21],x},"me"),J=256,Q=112,W=36,C=24,fe=480,pe=1.4,be=u(a=>{let e=Math.max(1,Math.round(Math.sqrt(pe*a/(J+Q))));return Math.max(fe,a/e)},"pe"),he=38,ge=28,A=u(a=>he+Math.max(1,a)*ge,"B"),xe=u((a,e)=>{let t=new Map;for(let o of a)t.set(o,[]);for(let o of e)o.to!==o.from&&t.has(o.from)&&t.has(o.to)&&t.get(o.from)?.push(o.to);let l=new Map,r=new Set,s=u(o=>{let d=l.get(o);if(d!==void 0)return d;if(r.has(o))return 0;r.add(o);let c=0;for(let m of t.get(o)??[])c=Math.max(c,s(m)+1);return r.delete(o),l.set(o,c),c},"n");for(let o of a)s(o);return l},"be"),Ne=u((a,e,t)=>{let l=xe(a,e),r=new Map;for(let m of a){let i=l.get(m)??0,f=r.get(i);f===void 0?r.set(i,[m]):f.push(m)}let s=a.reduce((m,i)=>m+A(t.get(i)??0)+W,0),o=be(s),d=[],c=0;for(let m of[...r.keys()].toSorted((i,f)=>i-f)){let i=0,f=C;for(let p of r.get(m)??[]){let x=A(t.get(p)??0);f>C&&f+x>o&&(i+=1,f=C),d.push({name:p,x:C+(c+i)*(J+Q),y:f}),f+=x+W}c+=i+1}return d},"xe"),ye={databaseSchema:ue},U={backgroundColor:y.shard.color},X={backgroundColor:y.global.color},ve={global:!0,shard:!0},we={},Me=u(a=>{let e=a.find(t=>t.pk===!0)?.name;return e!==void 0?e:a.some(t=>t.name==="_id")?"_id":a.some(t=>t.name==="id")?"id":a[0]?.name??"_id"},"Ee"),Y=u(a=>a.flatMap(e=>e.columns.filter(t=>t.ref!==void 0).map(t=>({column:t.name,from:e.name,to:t.ref}))),"K"),Ce=u((a,e,t)=>{let l=a.map(d=>d.name),r=new Map(a.map(d=>[d.name,d.columns.length])),s=Ne(l,Y(a),r),o=new Map(a.map(d=>[d.name,d]));return s.flatMap(({name:d,x:c,y:m})=>{let i=o.get(d);return i===void 0?[]:[{className:t[d],data:{columns:i.columns,label:d,loadError:e,tier:i.tier},id:d,position:{x:c,y:m},type:"databaseSchema"}]})},"Se"),Se=u(a=>{let e=new Map(a.map(t=>[t.name,t.columns]));return Y(a).flatMap(t=>{let l=e.get(t.to)??[],r=e.get(t.from)??[],s=Me(l);return!l.some(o=>o.name===s)||!r.some(o=>o.name===t.column)?[]:[{id:`${t.from}.${t.column}->${t.to}`,source:t.to,sourceHandle:s,target:t.from,targetHandle:t.column}]})},"_e"),$e=u(()=>{let a=(0,v.c)(15),e=M(),t;a[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,n.jsxs)("span",{className:"flex items-center gap-1",children:[(0,n.jsx)("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:U}),y.shard.label]}),a[0]=t):t=a[0];let l;a[1]===Symbol.for("react.memo_cache_sentinel")?(l=(0,n.jsxs)("span",{className:"flex items-center gap-1",children:[(0,n.jsx)("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:X}),y.global.label]}),a[1]=l):l=a[1];let r;a[2]===Symbol.for("react.memo_cache_sentinel")?(r=(0,n.jsx)(w,{className:"px-1 py-0 text-[10px] leading-tight",variant:"secondary",children:"PK"}),a[2]=r):r=a[2];let s;a[3]!==e?(s=e("Primary key"),a[3]=e,a[4]=s):s=a[4];let o;a[5]!==s?(o=(0,n.jsxs)("span",{className:"flex items-center gap-1",children:[r,s]}),a[5]=s,a[6]=o):o=a[6];let d;a[7]===Symbol.for("react.memo_cache_sentinel")?(d=(0,n.jsx)(w,{className:"px-1 py-0 text-[10px] leading-tight",variant:"outline",children:"FK"}),a[7]=d):d=a[7];let c;a[8]!==e?(c=e("Foreign key"),a[8]=e,a[9]=c):c=a[9];let m;a[10]!==c?(m=(0,n.jsxs)("span",{className:"flex items-center gap-1",children:[d,c]}),a[10]=c,a[11]=m):m=a[11];let i;return a[12]!==o||a[13]!==m?(i=(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 rounded-xl border border-border bg-card/95 px-2.5 py-1.5 text-[11px] text-muted-foreground shadow-xs",children:[t,l,o,m]}),a[12]=o,a[13]=m,a[14]=i):i=a[14],i},"we"),ke=12,_e=u(a=>{let e=(0,v.c)(9),{containerRef:t,seedKey:l}=a,r=T(),{fitView:s}=B(),o;e[0]!==t||e[1]!==s||e[2]!==r?(o=u(()=>{if(!r)return;let c=u(()=>{I(s({duration:0,maxZoom:1.6,padding:.14}))},"c");c();let m=t.current;if(m===null)return;let i=new ResizeObserver(()=>{c()});return i.observe(m),()=>{i.disconnect()}},"o"),e[0]=t,e[1]=s,e[2]=r,e[3]=o):o=e[3];let d;return e[4]!==t||e[5]!==s||e[6]!==r||e[7]!==l?(d=[t,s,r,l],e[4]=t,e[5]=s,e[6]=r,e[7]=l,e[8]=d):d=e[8],(0,h.useEffect)(o,d),null},"Me"),He=u(({columnsError:a,fill:e=!1,nodeClasses:t,tables:l,testIdPrefix:r})=>{let s=M(),[o,d]=(0,h.useState)(ve),[c,m]=(0,h.useState)(""),i=(0,h.useMemo)(()=>{let g=c.trim().toLowerCase();return l.filter(P=>o[P.tier]&&P.name.toLowerCase().includes(g))},[l,o,c]),f=(0,h.useMemo)(()=>Ce(i,a??!1,t??we),[i,a,t]),p=(0,h.useMemo)(()=>Se(i),[i]),x=i.map(g=>g.name).join(","),[b,R,ee]=H(f),[te,F,ae]=L(p),S=(0,h.useRef)(null);(0,h.useEffect)(()=>{R(f)},[f,R]),(0,h.useEffect)(()=>{F(p)},[p,F]);let re=u(g=>{m(g.target.value)},"j"),oe=u(()=>{d(g=>({...g,shard:!g.shard}))},"q"),ne=u(()=>{d(g=>({...g,global:!g.global}))},"Q");return l.length===0?(0,n.jsx)("section",{className:"flex flex-col gap-2","data-testid":`${r}-section`,children:(0,n.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":`${r}-empty`,children:s("No tables to graph.")})}):(0,n.jsx)("section",{className:N("flex flex-col",e&&"min-h-0 flex-1"),"data-testid":`${r}-section`,children:(0,n.jsx)("div",{className:N("w-full overflow-hidden border border-border bg-muted/20",e?"min-h-0 flex-1":"h-[560px]"),"data-testid":`${r}-canvas`,ref:S,children:(0,n.jsxs)(j,{edges:te,elementsSelectable:!0,fitView:!0,minZoom:.2,nodes:b,nodesConnectable:!1,nodeTypes:ye,onEdgesChange:ae,onNodesChange:ee,children:[(0,n.jsx)(V,{}),(0,n.jsx)(z,{position:"top-left",children:(0,n.jsxs)("div",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card/95 p-2 shadow-xs",children:[(0,n.jsx)(K,{"aria-label":s("Find table\u2026"),className:"h-7 w-44 text-xs","data-testid":`${r}-find`,onChange:re,placeholder:s("Find table\u2026"),value:c}),(0,n.jsxs)("div",{"aria-label":s("Storage tiers"),className:"flex items-center gap-1.5",role:"group",children:[(0,n.jsxs)(k,{"aria-pressed":o.shard,className:"gap-1.5","data-testid":`${r}-tier-shard`,onClick:oe,size:"xs",type:"button",variant:o.shard?"default":"outline",children:[(0,n.jsx)("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:U}),y.shard.label]}),(0,n.jsxs)(k,{"aria-pressed":o.global,className:"gap-1.5","data-testid":`${r}-tier-global`,onClick:ne,size:"xs",type:"button",variant:o.global?"default":"outline",children:[(0,n.jsx)("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:X}),y.global.label]})]})]})}),(0,n.jsx)(z,{position:"bottom-center",children:(0,n.jsx)($e,{})}),(0,n.jsx)(Z,{showInteractive:!1}),i.length>ke&&(0,n.jsx)(q,{className:"!border !border-border !bg-card",maskColor:"var(--color-muted)",nodeColor:"var(--color-muted-foreground)",nodeStrokeWidth:0,pannable:!0,zoomable:!0}),(0,n.jsx)(D,{containerRef:S,filenameBase:`${r}-schema-diagram`,testIdPrefix:r}),(0,n.jsx)(_e,{containerRef:S,seedKey:x})]})})})},"Ge");export{He as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as i,d as m,e as v,f as b}from"./chunk-I26MS5PJ.js";var n=m(b(),1),r=m(v(),1);var x=i(function(t,a,s){let e=(0,n.c)(4),o=a===void 0?300:a,[d,f]=(0,r.useState)(t),[p,l]=(0,r.useState)(s);s!==void 0&&s!==p&&(l(s),f(t));let u,c;return e[0]!==o||e[1]!==t?(u=i(()=>{let T=setTimeout(()=>{f(t)},o);return()=>{clearTimeout(T)}},"c"),c=[t,o],e[0]=o,e[1]=t,e[2]=u,e[3]=c):(u=e[2],c=e[3]),(0,r.useEffect)(u,c),d},"T");export{x as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{l as v}from"./chunk-X6XAMP4E.js";import{j as A}from"./chunk-74IYYDDI.js";import{a as o,d as R,e as _,f as F}from"./chunk-I26MS5PJ.js";var M=R(F(),1);var a=R(_(),1);var U=6e4,b=o(e=>(typeof e=="object"||typeof e=="function")&&e!==null&&typeof e.then=="function","g"),g=5e3,x=o((e,s,i)=>{let t=(0,M.c)(9),r=i===void 0?g:i,h=v(),d=(0,a.useRef)(e),c;t[0]!==e?(c=o(()=>{d.current=e},"c"),t[0]=e,t[1]=c):c=t[1],(0,a.useEffect)(c);let u;t[2]!==s||t[3]!==r?(u=o(()=>{if(!s)return;let l=r,p=!1,T,m=o(()=>{p||(T=setTimeout(P,l))},"f"),y=o(()=>{l=r,m()},"p"),E=o(n=>{A(n)||(l=Math.max(r,Math.min(l*2,U)),m())},"_"),P=o(()=>{if(globalThis.document?.hidden===!0){m();return}let n;try{n=d.current()}catch(S){E(S);return}b(n)?Promise.resolve(n).then(y).catch(E):y()},"A");return m(),()=>{p=!0,clearTimeout(T)}},"n"),t[2]=s,t[3]=r,t[4]=u):u=t[4];let f;t[5]!==h||t[6]!==s||t[7]!==r?(f=[h,s,r],t[5]=h,t[6]=s,t[7]=r,t[8]=f):f=t[8],(0,a.useEffect)(u,f)},"U"),D=o(async e=>{let s=(await Promise.allSettled(e)).find(i=>i.status==="rejected");if(s!==void 0)throw s.reason},"v");export{x as a,D as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as oe}from"./chunk-FPI7AMQJ.js";import{a as se}from"./chunk-LXCVA5SP.js";import{i as ae}from"./chunk-E4PXACVL.js";import"./chunk-MVWZMWPD.js";import"./chunk-7Y3SY37W.js";import{a as A}from"./chunk-7G4Z6Q7X.js";import"./chunk-3YXASVTP.js";import"./chunk-AUAECCXB.js";import"./chunk-BOMPSVRC.js";import{a as M}from"./chunk-4ZEL6BYL.js";import{c as ne}from"./chunk-ZBHXISOD.js";import{l as Y}from"./chunk-X6XAMP4E.js";import"./chunk-QAQDMS6R.js";import"./chunk-NRAAYZ4C.js";import{a as G}from"./chunk-RWVIV3U7.js";import{a as L,b as _,c as J,d as y,e as i,f as d}from"./chunk-HCTJKP5J.js";import{a as E,e as F}from"./chunk-2IKDEUCX.js";import{d as K,f as Z,g as ee,h as T,n as te,q as R}from"./chunk-74IYYDDI.js";import{a as s,d as X,e as ie,f as de,g as ce}from"./chunk-I26MS5PJ.js";var l=X(ie(),1);var le=X(de(),1);var e=X(ce(),1);var me=["queued","running","rollingBack","paused","waiting","complete","errored","terminated"],ue=["pause","resume","restart","terminate"],fe=s(o=>{let r=(0,le.c)(7),{busy:w,id:k,onAct:h}=o,x=K(),n;r[0]!==w||r[1]!==k||r[2]!==h||r[3]!==x?(n=ue.map(c=>c==="restart"?(0,e.jsx)(se,{confirmLabel:x("Restart?"),disabled:w,onConfirm:s(()=>{h(c)},"onConfirm"),testId:`workflow-instance-${c}-${k}`,children:x(c)},c):(0,e.jsx)(A,{"data-testid":`workflow-instance-${c}-${k}`,disabled:w,onClick:s(()=>{h(c)},"onClick"),size:"sm",type:"button",variant:"ghost",children:x(c)},c)),r[0]=w,r[1]=k,r[2]=h,r[3]=x,r[4]=n):n=r[4];let p;return r[5]!==n?(p=(0,e.jsx)(e.Fragment,{children:n}),r[5]=n,r[6]=p):p=r[6],p},"me"),he="WORKFLOWS_NOT_CONFIGURED",pe=s(o=>typeof o=="object"&&o!==null&&o.code===he,"he"),we=s(o=>{let r=o.error??o.output;if(r===void 0)return"\u2014";try{return JSON.stringify(r,te)}catch{return"(unserializable)"}},"pe"),xe=s(({loadDetail:o,loadInstances:r,readOnly:w,runAction:k,workflowName:h})=>{let x=Y(),n=K(),[p,c]=(0,l.useState)(null),[O,$]=(0,l.useState)(null),[S,j]=(0,l.useState)(""),[C,v]=(0,l.useState)(null),[z,W]=(0,l.useState)(!1),[U,B]=(0,l.useState)(null),N=(0,l.useRef)(0),g=(0,l.useRef)(0),b=(0,l.useRef)(0),P=o??(a=>x.getWorkflowInstance(a)),D=w?void 0:k??(r===void 0?a=>x.setWorkflowInstanceStatus(a):void 0),q=s(async()=>{g.current+=1;let a=g.current;v(null),W(!1);let u=S===""?void 0:S;try{if(r===void 0){let m=await x.listWorkflowInstances({name:h,status:u});if(a!==g.current)return;if(m.configured===!1){c(null),W(!0);return}c(m.instances);return}let t=await r({name:h,status:u});a===g.current&&c(t)}catch(t){if(a!==g.current)return;c(null),pe(t)?W(!0):v(T(t))}},"L");(0,l.useEffect)(()=>{N.current+=1,b.current+=1,$(null),R(q())},[h,S]);let H=s(async a=>{b.current+=1;let u=b.current;v(null);try{let t=await P({id:a,name:h});u===b.current&&$(t)}catch(t){u===b.current&&v(T(t))}},"B"),Q=s(()=>{b.current+=1,$(null)},"J"),V=s(async(a,u)=>{if(D===void 0)return;let t=N.current;B(a),v(null);try{await D({action:u,id:a,name:h}),t===N.current&&await q()}catch(m){v(T(m))}B(null)},"K");return(0,e.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-workflow-instances",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,e.jsx)("h3",{className:"text-sm font-medium",children:n("Instance history")}),(0,e.jsxs)("select",{"aria-label":n("Filter by status"),className:"h-8 rounded-md border border-input bg-transparent px-2.5 py-1 text-xs outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50","data-testid":"workflow-instances-filter",onChange:s(a=>{j(a.target.value)},"onChange"),value:S,children:[(0,e.jsx)("option",{value:"",children:n("All statuses")}),me.map(a=>(0,e.jsx)("option",{value:a,children:a},a))]})]}),C!==null&&(0,e.jsx)("p",{className:"text-sm text-destructive","data-testid":"workflow-instances-error",role:"alert",children:C}),z&&(0,e.jsx)(G,{description:n("Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN in your .dev.vars to enable workflow instance history."),testId:"workflow-instances-unconfigured",title:n("Workflow inspection not configured")}),!z&&p!==null&&p.length===0&&(0,e.jsx)(G,{description:n("No instances match this filter for the selected workflow."),testId:"workflow-instances-empty",title:n("No instances")}),p!==null&&p.length>0&&(0,e.jsx)(E,{className:"overflow-hidden py-0",children:(0,e.jsx)(F,{className:"px-0",children:(0,e.jsxs)(L,{"data-testid":"workflow-instances-table",children:[(0,e.jsx)(_,{children:(0,e.jsxs)(y,{children:[(0,e.jsx)(i,{children:n("Instance id")}),(0,e.jsx)(i,{children:n("Status")}),(0,e.jsx)(i,{children:n("Created")}),(0,e.jsx)(i,{children:n("Ended")}),(0,e.jsx)(i,{"aria-label":n("Actions")})]})}),(0,e.jsx)(J,{children:p.map(a=>(0,e.jsxs)(y,{"data-testid":`workflow-instance-${a.id}`,children:[(0,e.jsx)(d,{className:"font-mono text-xs",children:a.id}),(0,e.jsx)(d,{className:"font-mono text-xs",children:a.status}),(0,e.jsx)(d,{className:"text-muted-foreground tabular-nums",children:a.createdOn??"\u2014"}),(0,e.jsx)(d,{className:"text-muted-foreground tabular-nums",children:a.endedOn??"\u2014"}),(0,e.jsx)(d,{className:"text-right",children:(0,e.jsxs)("div",{className:"flex justify-end gap-1.5",children:[(0,e.jsx)(A,{"data-testid":`workflow-instance-steps-${a.id}`,onClick:s(()=>{R(H(a.id))},"onClick"),size:"sm",type:"button",variant:"outline",children:n("Steps")}),D!==void 0&&(0,e.jsx)(fe,{busy:U===a.id,id:a.id,onAct:s(u=>{R(V(a.id,u))},"onAct")},h)]})})]},a.id))})]})})}),O!==null&&(0,e.jsx)(E,{className:"overflow-hidden py-0","data-testid":"workflow-instance-detail",children:(0,e.jsxs)(F,{className:"flex flex-col gap-2 px-4 py-3",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsxs)("span",{className:"font-mono text-xs",children:[n("Steps")," \xB7 ",O.id]}),(0,e.jsx)(A,{"data-testid":"workflow-instance-detail-close",onClick:Q,size:"xs",type:"button",variant:"ghost",children:n("Close")})]}),O.steps.length===0?(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:n("This instance has no recorded steps yet.")}):(0,e.jsxs)(L,{"data-testid":"workflow-instance-steps",children:[(0,e.jsx)(_,{children:(0,e.jsxs)(y,{children:[(0,e.jsx)(i,{children:n("Step")}),(0,e.jsx)(i,{children:n("Type")}),(0,e.jsx)(i,{children:n("Attempts")}),(0,e.jsx)(i,{children:n("Started")}),(0,e.jsx)(i,{children:n("Output")})]})}),(0,e.jsx)(J,{children:O.steps.map((a,u)=>(0,e.jsxs)(y,{"data-testid":`workflow-step-${String(u)}`,children:[(0,e.jsx)(d,{className:"font-mono text-xs",children:a.name}),(0,e.jsx)(d,{className:"text-xs text-muted-foreground",children:a.type??"\u2014"}),(0,e.jsx)(d,{className:"tabular-nums",children:a.attempts??"\u2014"}),(0,e.jsx)(d,{className:"text-muted-foreground tabular-nums",children:a.start??"\u2014"}),(0,e.jsx)(d,{className:"font-mono text-xs text-muted-foreground",children:we(a)})]},`${a.name}:${String(u)}`))})]})]})})]})},"xe"),Ne=Z(M.createWorkflowInstance),ge=Z(M.getWorkflowInstanceStatus),ke=s(o=>{if(o.error)return`${o.error.name}: ${o.error.message}`;if(o.output===void 0)return"\u2014";try{return JSON.stringify(o.output,te)}catch{return"(unserializable)"}},"ge"),ve=s((o,r)=>o.some(w=>w.exportName===r)?r:o[0]?.exportName??"","be"),Ee=s(()=>{let o=Y(),r=K(),{data:w,error:k}=ne(M.listWorkflows,{}),[h,x]=(0,l.useState)(""),[n,p]=(0,l.useState)(""),[c,O]=(0,l.useState)(""),[$,S]=(0,l.useState)(!1),[j,C]=(0,l.useState)(null),[v,z]=(0,l.useState)([]),[W,U]=(0,l.useState)(null),B=w!==void 0,N=Array.isArray(w?.workflows)?[...w.workflows].toSorted((t,m)=>t.exportName.localeCompare(m.exportName)):[],g=ve(N,h),b=N.find(t=>t.exportName===g),P=s(t=>{z(m=>{let f=m.filter(I=>!(I.exportName===t.exportName&&I.id===t.id));return[t,...f]})},"D"),D=s(async()=>{let t=g;if(t==="")return;let m,f=c.trim();if(f!=="")try{m=JSON.parse(f)}catch{C(r("Params must be valid JSON"));return}S(!0),C(null);try{let I=n.trim(),re=await o.query(Ne,{exportName:t,id:I===""?void 0:I,params:m},ee(""));P({exportName:t,id:re.id,status:re.status}),p("")}catch(I){C(T(I))}S(!1)},"V"),q=s(()=>{R(D())},"X"),H=s(async(t,m)=>{U(m);try{let f=await o.query(ge,{exportName:t,id:m},ee(""));P({error:f.error,exportName:t,id:f.id,output:f.output,status:f.status})}catch(f){C(T(f))}U(null)},"T"),Q=s(t=>{x(t.target.value)},"L"),V=s(t=>{p(t.target.value)},"B"),a=s(t=>{O(t.target.value)},"J"),u=s(t=>{let{export:m,id:f}=t.currentTarget.dataset;m!==void 0&&f!==void 0&&R(H(m,f))},"K");return(0,e.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-workflows-panel",children:[k!==null&&(0,e.jsx)("p",{className:"text-sm text-destructive","data-testid":"workflows-error",role:"alert",children:k}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:r("Workflows are declared in code with defineWorkflow and run as durable Cloudflare Workflows. Start an instance and observe its status below.")}),B&&N.length===0?(0,e.jsx)(G,{description:r("No defineWorkflow is declared in lunora/workflows.ts in this deployment. Add one to run a durable, multi-step workflow."),testId:"workflows-empty",title:r("No workflows defined")}):(0,e.jsx)(E,{className:"overflow-hidden py-0",children:(0,e.jsx)(F,{className:"px-0",children:(0,e.jsxs)(L,{"data-testid":"workflows-table",children:[(0,e.jsx)(_,{children:(0,e.jsxs)(y,{children:[(0,e.jsx)(i,{children:r("Export")}),(0,e.jsx)(i,{children:r("Name")}),(0,e.jsx)(i,{children:r("Class")})]})}),(0,e.jsx)(J,{children:N.map(t=>(0,e.jsxs)(y,{"data-testid":`workflows-row-${t.exportName}`,children:[(0,e.jsx)(d,{className:"font-mono text-xs",children:t.exportName}),(0,e.jsx)(d,{className:"font-mono text-xs text-muted-foreground",children:t.name}),(0,e.jsx)(d,{className:"font-mono text-xs text-muted-foreground",children:t.className})]},t.exportName))})]})})}),N.length>0&&(0,e.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"workflows-start",children:[(0,e.jsx)("h3",{className:"text-sm font-medium",children:r("Start instance")}),j!==null&&(0,e.jsx)("p",{className:"text-sm text-destructive","data-testid":"workflows-start-error",role:"alert",children:j}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsx)("select",{"aria-label":r("Workflow"),className:"h-8 rounded-md border border-input bg-transparent px-2.5 py-1 text-xs outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50","data-testid":"workflows-start-select",onChange:Q,value:g,children:N.map(t=>(0,e.jsx)("option",{value:t.exportName,children:t.exportName},t.exportName))}),(0,e.jsx)(ae,{"aria-label":r("Instance id (optional)"),className:"max-w-48","data-testid":"workflows-start-id",onChange:V,placeholder:r("Instance id (optional)"),value:n}),(0,e.jsx)(A,{"data-testid":"workflows-start-button",disabled:$||g==="",onClick:q,children:r($?"Starting\u2026":"Start instance")})]}),(0,e.jsx)(oe,{"aria-label":r("Params (JSON)"),className:"font-mono","data-testid":"workflows-start-params",onChange:a,placeholder:r("Params (JSON, optional)"),value:c})]}),v.length>0&&(0,e.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"workflows-instances",children:[(0,e.jsx)("h3",{className:"text-sm font-medium",children:r("Instances")}),(0,e.jsx)(E,{className:"overflow-hidden py-0",children:(0,e.jsx)(F,{className:"px-0",children:(0,e.jsxs)(L,{"data-testid":"workflows-instances-table",children:[(0,e.jsx)(_,{children:(0,e.jsxs)(y,{children:[(0,e.jsx)(i,{children:r("Workflow")}),(0,e.jsx)(i,{children:r("Instance id")}),(0,e.jsx)(i,{children:r("Status")}),(0,e.jsx)(i,{children:r("Output")}),(0,e.jsx)(i,{})]})}),(0,e.jsx)(J,{children:v.map(t=>(0,e.jsxs)(y,{"data-testid":`workflows-instance-${t.id}`,children:[(0,e.jsx)(d,{className:"font-mono text-xs",children:t.exportName}),(0,e.jsx)(d,{className:"font-mono text-xs text-muted-foreground",children:t.id}),(0,e.jsx)(d,{className:"font-mono text-xs",children:t.status}),(0,e.jsx)(d,{className:"font-mono text-xs text-muted-foreground",children:ke(t)}),(0,e.jsx)(d,{children:(0,e.jsx)(A,{"data-export":t.exportName,"data-id":t.id,"data-testid":`workflows-instance-refresh-${t.id}`,disabled:W===t.id,onClick:u,size:"xs",variant:"outline",children:W===t.id?r("Refreshing\u2026"):r("Refresh")})})]},`${t.exportName}:${t.id}`))})]})})})]}),b!==void 0&&(0,e.jsx)(xe,{workflowName:b.name})]})},"De");export{Ee as default};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import{a as ct,b as dt}from"./chunk-F4HMMGVL.js";import{a as it}from"./chunk-WDGITBC6.js";import{d as at}from"./chunk-4CGBMYO3.js";import"./chunk-NQZALRU3.js";import"./chunk-OPM7ESDV.js";import"./chunk-Y3AYVFTK.js";import"./chunk-QJLHH3ET.js";import"./chunk-OYCUPD3Q.js";import"./chunk-NXQW5E6W.js";import"./chunk-UC7MNI2F.js";import{a as lt}from"./chunk-IWZ7GVQO.js";import"./chunk-NGVP66OH.js";import"./chunk-GHQ2VDI2.js";import"./chunk-W4CQMJH3.js";import"./chunk-AUGKHAMQ.js";import"./chunk-WJRYEML4.js";import"./chunk-LXCVA5SP.js";import{a as rt}from"./chunk-7Q256NLI.js";import{b as ot}from"./chunk-ZKJS6EBE.js";import{c as nt,d as Ne,e as De,f as Ae,g as Ke}from"./chunk-RGMVGZV4.js";import{i as Qe}from"./chunk-E4PXACVL.js";import"./chunk-MVWZMWPD.js";import"./chunk-SJQERRSZ.js";import"./chunk-7Y3SY37W.js";import"./chunk-7G4Z6Q7X.js";import"./chunk-3YXASVTP.js";import"./chunk-AUAECCXB.js";import"./chunk-BOMPSVRC.js";import{a as st}from"./chunk-NCPW7WHO.js";import{a as ke}from"./chunk-4ZEL6BYL.js";import"./chunk-ZBHXISOD.js";import{l as _e}from"./chunk-X6XAMP4E.js";import"./chunk-QAQDMS6R.js";import"./chunk-NRAAYZ4C.js";import"./chunk-HCTJKP5J.js";import{d as ae,f as Se,g as Ce,h as tt,q as me}from"./chunk-74IYYDDI.js";import{a,d as Fe,e as Lt,f as Rt,g as _t,i as ue}from"./chunk-I26MS5PJ.js";var Z=Fe(Rt(),1);var B=Fe(Lt(),1);var u=Fe(_t(),1);var qe=class{static{a(this,"Diff")}diff(e,n,t={}){let r;typeof t=="function"?(r=t,t={}):"callback"in t&&(r=t.callback);let o=this.castInput(e,t),l=this.castInput(n,t),i=this.removeEmpty(this.tokenize(o,t)),c=this.removeEmpty(this.tokenize(l,t));return this.diffWithOptionsObj(i,c,t,r)}diffWithOptionsObj(e,n,t,r){var o;let l=a(p=>{if(p=this.postProcess(p,t),r){setTimeout(function(){r(p)},0);return}else return p},"done"),i=n.length,c=e.length,d=1,m=i+c;t.maxEditLength!=null&&(m=Math.min(m,t.maxEditLength));let x=(o=t.timeout)!==null&&o!==void 0?o:1/0,h=Date.now()+x,v=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(v[0],n,e,0,t);if(v[0].oldPos+1>=c&&f+1>=i)return l(this.buildValues(v[0].lastComponent,n,e));let N=-1/0,b=1/0,w=a(()=>{for(let p=Math.max(N,-d);p<=Math.min(b,d);p+=2){let S,y=v[p-1],g=v[p+1];y&&(v[p-1]=void 0);let C=!1;if(g){let q=g.oldPos-p;C=g&&0<=q&&q<i}let k=y&&y.oldPos+1<c;if(!C&&!k){v[p]=void 0;continue}if(!k||C&&y.oldPos<g.oldPos?S=this.addToPath(g,!0,!1,0,t):S=this.addToPath(y,!1,!0,1,t),f=this.extractCommon(S,n,e,p,t),S.oldPos+1>=c&&f+1>=i)return l(this.buildValues(S.lastComponent,n,e))||!0;v[p]=S,S.oldPos+1>=c&&(b=Math.min(b,p-1)),f+1>=i&&(N=Math.max(N,p+1))}d++},"execEditLength");if(r)a(function p(){setTimeout(function(){if(d>m||Date.now()>h)return r(void 0);w()||p()},0)},"exec")();else for(;d<=m&&Date.now()<=h;){let p=w();if(p)return p}}addToPath(e,n,t,r,o){let l=e.lastComponent;return l&&!o.oneChangePerToken&&l.added===n&&l.removed===t?{oldPos:e.oldPos+r,lastComponent:{count:l.count+1,added:n,removed:t,previousComponent:l.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:n,removed:t,previousComponent:l}}}extractCommon(e,n,t,r,o){let l=n.length,i=t.length,c=e.oldPos,d=c-r,m=0;for(;d+1<l&&c+1<i&&this.equals(t[c+1],n[d+1],o);)d++,c++,m++,o.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return m&&!o.oneChangePerToken&&(e.lastComponent={count:m,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=c,d}equals(e,n,t){return t.comparator?t.comparator(e,n):e===n||!!t.ignoreCase&&e.toLowerCase()===n.toLowerCase()}removeEmpty(e){let n=[];for(let t=0;t<e.length;t++)e[t]&&n.push(e[t]);return n}castInput(e,n){return e}tokenize(e,n){return Array.from(e)}join(e){return e.join("")}postProcess(e,n){return e}get useLongestToken(){return!1}buildValues(e,n,t){let r=[],o;for(;e;)r.push(e),o=e.previousComponent,delete e.previousComponent,e=o;r.reverse();let l=r.length,i=0,c=0,d=0;for(;i<l;i++){let m=r[i];if(m.removed)m.value=this.join(t.slice(d,d+m.count)),d+=m.count;else{if(!m.added&&this.useLongestToken){let x=n.slice(c,c+m.count);x=x.map(function(h,v){let f=t[d+v];return f.length>h.length?f:h}),m.value=this.join(x)}else m.value=this.join(n.slice(c,c+m.count));c+=m.count,m.added||(d+=m.count)}}return r}};var Ue=class extends qe{static{a(this,"LineDiff")}constructor(){super(...arguments),this.tokenize=Dt}equals(e,n,t){return t.ignoreWhitespace?((!t.newlineIsToken||!e.includes(`
|
|
2
|
+
`))&&(e=e.trim()),(!t.newlineIsToken||!n.includes(`
|
|
3
|
+
`))&&(n=n.trim())):t.ignoreNewlineAtEof&&!t.newlineIsToken&&(e.endsWith(`
|
|
4
|
+
`)&&(e=e.slice(0,-1)),n.endsWith(`
|
|
5
|
+
`)&&(n=n.slice(0,-1))),super.equals(e,n,t)}},ut=new Ue;function Ge(s,e,n){return ut.diff(s,e,n)}a(Ge,"diffLines");function Dt(s,e){e.stripTrailingCr&&(s=s.replace(/\r\n/g,`
|
|
6
|
+
`));let n=[],t=s.split(/(\n|\r\n)/);t[t.length-1]||t.pop();for(let r=0;r<t.length;r++){let o=t[r];r%2&&!e.newlineIsToken?n[n.length-1]+=o:n.push(o)}return n}a(Dt,"tokenize");var At="x",mt=" ",Mt={'"':'"',"'":"'","[":"]","`":"`"},gt=a((s,e)=>{let n=e+2;for(;n<s.length&&s[n]!==`
|
|
7
|
+
`;)n+=1;return n},"rt"),xt=a((s,e)=>{let n=s.indexOf("*/",e+2);return n===-1?-1:n+2},"it"),vt=a(s=>{let e=s.split(""),n=0;for(;n<s.length;){let t=s[n]??"",r=Mt[t];if(t==="-"&&s[n+1]==="-"){let o=gt(s,n);e.fill(mt,n,o),n=o}else if(t==="/"&&s[n+1]==="*"){let o=xt(s,n);if(o===-1)return;e.fill(mt,n,o),n=o}else if(r!==void 0){let o=n+1;for(;o<s.length;)if(s[o]!==r)o+=1;else if(r!=="]"&&s[o+1]===r)o+=2;else break;if(o>=s.length)return;e.fill(At,n,o+1),n=o+1}else n+=1}for(let t=0;t<s.length;t+=1)s[t]===`
|
|
8
|
+
`&&(e[t]=`
|
|
9
|
+
`);return e.join("")},"at"),Ot=/^(?:explain\s+(?:query\s+plan\s+)?)?(?:select|with)\b/iu,Pt=/\b(?:alter|attach|create|delete|detach|drop|insert|pragma|reindex|truncate|update|vacuum)\b|\breplace\b(?!\s*\()/iu,$t=/^\w+/u,jt=/;\s*$/u,zt=/\s/u,yt=a(s=>{let e=0;for(;e<s.length;){let n=s[e];if(n!==void 0&&zt.test(n))e+=1;else if(n==="-"&&s[e+1]==="-")e=gt(s,e);else if(n==="/"&&s[e+1]==="*"){let t=xt(s,e);if(t===-1)break;e=t}else break}return e},"ct"),Ht=a(s=>{let e=yt(s),n=s.slice(e).trimEnd();if(n==="")return{code:"SQL_EMPTY",message:"the query is empty"};let t=(vt(n)??n).replace(jt,""),r=n.slice(0,t.length),o=t.indexOf(";");if(o!==-1)return{code:"SQL_MULTIPLE_STATEMENTS",length:1,message:"only a single statement may be run",offset:e+o};let l="the SQL editor is read-only \u2014 only SELECT / WITH / EXPLAIN queries are allowed";if(!Ot.test(r))return{code:"SQL_NOT_READONLY",length:$t.exec(r)?.[0].length??1,message:l,offset:e};let i=Pt.exec(r);if(i!==null)return{code:"SQL_NOT_READONLY",length:i[0].length,message:`${l} (\`${i[0].toUpperCase()}\` is not allowed)`,offset:e+i.index}},"Ht"),Wt=/^explain\b/iu,Bt=a(s=>Wt.test(s.slice(yt(s)))?s:`EXPLAIN QUERY PLAN ${s}`,"Ft"),Ye=a((s,e)=>{let n=s.trim();if(n==="")return[];let t=e+s.indexOf(n),r=Ht(n);return r?.code==="SQL_EMPTY"?[]:[r===void 0?{offset:t,sql:n}:{offset:t,rejection:r,sql:n}]},"ze"),wt=a(s=>{let e=vt(s);if(e===void 0)return Ye(s,0);let n=[],t=0;for(let r=0;r<=e.length;r+=1)r!==e.length&&e[r]!==";"||(n.push(...Ye(s.slice(t,r),t)),t=r+1);return n},"dt"),Ft=["ORDER BY","GROUP BY","LEFT JOIN","RIGHT JOIN","INNER JOIN","OUTER JOIN","CROSS JOIN","EXPLAIN QUERY PLAN","SELECT","DISTINCT","FROM","WHERE","HAVING","LIMIT","OFFSET","JOIN","ON","AND","OR","AS","ASC","DESC","WITH","UNION","EXPLAIN"],Qt=["FROM","WHERE","ORDER BY","GROUP BY","HAVING","LIMIT","OFFSET","UNION","JOIN","LEFT JOIN","RIGHT JOIN","INNER JOIN","OUTER JOIN","CROSS JOIN"],$e=String.fromCodePoint(0),Kt=new RegExp(`${$e}${String.raw`(\d+)`}${$e}`,"gu"),Ut=Ft.map(s=>({pattern:new RegExp(String.raw`\b${s.replaceAll(" ",String.raw`\s+`)}\b`,"giu"),replacement:s})),Gt=Qt.map(s=>({pattern:new RegExp(String.raw`\s+${s.replaceAll(" ",String.raw`\s+`)}\b`,"gu"),replacement:`
|
|
10
|
+
${s}`})),Jt=a(s=>{let e=[],n=s.replaceAll(/'(?:[^']|'')*'/gu,t=>(e.push(t),`${$e}${(e.length-1).toString()}${$e}`)).replaceAll(/\s+/gu," ").trim();for(let{pattern:t,replacement:r}of Ut)n=n.replaceAll(t,r);for(let{pattern:t,replacement:r}of Gt)n=n.replaceAll(t,r);return n=n.replaceAll(Kt,(t,r)=>e[Number(r)]??""),n},"jt"),Yt=/\b(?:from|join)\s+([a-z_][\w$]*)(?:\s+(?:as\s+)?([a-z_][\w$]*))?/giu,Vt=/(?:\bwith\s+(?:recursive\s+)?|,\s*)([a-z_][\w$]*)\s+as\s*\(/giu,Xt=new Set(["cross","full","group","having","inner","join","left","limit","offset","on","order","right","union","using","where","window"]),Zt=/[^\n]/gu,en=a((s,e)=>{let n=s[e];if(n==="'"){let t=e+1;for(;t<s.length&&s[t]!=="'";)t+=1;return Math.min(t+1,s.length)}if(n==="-"&&s[e+1]==="-"){let t=s.indexOf(`
|
|
11
|
+
`,e);return t===-1?s.length:t}if(n==="/"&&s[e+1]==="*"){let t=s.indexOf("*/",e+2);return t===-1?s.length:t+2}return-1},"Xt"),tn=a(s=>{let e="",n=0;for(;n<s.length;){let t=en(s,n);t===-1?(e+=s.slice(n,n+1),n+=1):(e+=s.slice(n,t).replaceAll(Zt," "),n=t)}return e},"Zt"),nn=a(s=>{let e=new Set;for(let n of s.matchAll(Vt))e.add((n[1]??"").toLowerCase());return e},"en"),on=a((s,e)=>{let n=new Map;for(let t of s.matchAll(Yt)){let r=(t[1]??"").toLowerCase(),o=(t[2]??"").toLowerCase();e.has(r)&&(n.set(r,r),o!==""&&!Xt.has(o)&&n.set(o,r))}return n},"tn"),St=a((s,e)=>{let n=tn(s),t=new Set(e.map(r=>r.toLowerCase()));return{ctes:nn(n),masked:n,targets:on(n,t)}},"ut"),rn=/^(?:__lunora|sqlite_)/iu,sn=/\b(?:from|join)\s+([a-z_][\w$]*)/giu,ln=/\b([a-z_][\w$]*)\.([a-z_][\w$]*)/giu,an=new Set(["cross","full","group","having","inner","join","lateral","left","limit","offset","order","right","select","union","where","window"]),cn=a((s,e,n)=>{let t=[];for(let r of s.matchAll(sn)){let o=r[1]??"",l=o.toLowerCase();!e.has(l)&&!n.has(l)&&!an.has(l)&&!rn.test(o)&&t.push({length:o.length,message:`unknown table \`${o}\``,offset:r.index+r[0].length-o.length,severity:"error",source:"schema"})}return t},"rn"),dn=a((s,e,n)=>{let t=[],r=new Map;for(let[o,l]of Object.entries(e.columns))r.set(o.toLowerCase(),new Set(l.map(i=>i.toLowerCase())));for(let o of s.matchAll(ln)){let l=(o[1]??"").toLowerCase(),i=o[2]??"",c=n.get(l),d=c===void 0?void 0:r.get(c);d!==void 0&&!d.has(i.toLowerCase())&&t.push({length:i.length,message:`\`${c??""}\` has no column \`${i}\``,offset:o.index+o[0].length-i.length,severity:"error",source:"schema"})}return t},"an"),un=/(?<![\w$."])(?:"([a-z_][\w$]*)"|([a-z_][\w$]*))(?![.(])/giu,mn=/\bas\s+"?([a-z_][\w$]*)"?/giu,fn=a((s,e,n,t)=>{let r=[...new Set(n.values())],o=new Map,l=new Set;for(let d of r){for(let m of e.columns[d]??[])l.add(m.toLowerCase());for(let m of e.docFields?.[d]??[])o.set(m.toLowerCase(),m)}if(o.size===0)return[];let i=new Set([...s.matchAll(mn)].map(d=>(d[1]??"").toLowerCase())),c=[];for(let d of s.matchAll(un)){let m=d[1],x=m??d[2]??"",h=x.toLowerCase(),v=o.get(h);v===void 0||l.has(h)||i.has(h)||t.has(h)||n.has(h)||c.push({length:x.length,message:`\`${v}\` is a \`__doc__\` field, not a column \u2014 use \`json_extract(__doc__, '$.${v}')\``,offset:d.index+(m===void 0?0:1),severity:"error",source:"schema"})}return c},"un"),hn=a((s,e)=>{if(s.trim()==="")return[];let n=wt(s),t=new Set(e.tables.map(o=>o.toLowerCase())),r=[];for(let o of n){let{offset:l,rejection:i}=o;if(i!==void 0){r.push({length:i.length,message:i.message,offset:i.offset===void 0?l:l+i.offset,severity:"error",source:"gate"});continue}let{ctes:c,masked:d,targets:m}=St(o.sql,e.tables);r.push(...[...cn(d,t,c),...dn(d,e,m),...fn(d,e,m,c)].map(x=>({...x,offset:x.offset===void 0?l:l+x.offset})))}return r},"fn"),pn=Se(ke.lintSql),bn=600,gn=a((s,e,n)=>{let t=_e(),[r,o]=(0,B.useState)([]),l=(0,B.useMemo)(()=>hn(s,e),[s,e]),i=lt(s,bn),c=l.some(x=>x.source==="gate")||i.trim()==="",d=(0,B.useCallback)(async x=>{try{let h=await t.query(pn,{sql:i},Ce(n));x.cancelled||o(h.diagnostics??[])}catch{x.cancelled||o([])}},[t,i,n]);(0,B.useEffect)(()=>{if(c){o([]);return}let x={cancelled:!1};return me(d(x)),()=>{x.cancelled=!0}},[d,c]);let m=i===s;return(0,B.useMemo)(()=>m?[...l,...r]:l,[l,r,m])},"hn"),Me=8,xn=["AND","ASC","AS","BY","COUNT","DESC","DISTINCT","EXPLAIN","FROM","GROUP","HAVING","INNER","JOIN","LEFT","LIKE","LIMIT","NOT","NULL","OFFSET","ON","ORDER","OR","QUERY","SELECT","WHERE","WITH"],vn=new Set(["AND","BY","HAVING","ON","OR","SELECT","WHERE"]),yn=/[\w$]/,Ct=a(s=>s!==void 0&&yn.test(s),"ft"),kt=a(s=>{let e=s.length;for(;e>0&&Ct(s[e-1]);)e-=1;return s.slice(e)},"mt"),Nt=a((s,e)=>{let n=e;for(;n>0&&Ct(s[n-1]);)n-=1;return{end:e,start:n,text:s.slice(n,e)}},"pt"),ft=a((s,e)=>{let n=s.slice(0,e).trimEnd();return n.endsWith(".")||vn.has(kt(n).toUpperCase())},"et"),wn=a((s,e,n)=>{let t=s.slice(0,e);if(!t.endsWith("."))return;let r=kt(t.slice(0,-1));if(r!=="")return St(s,n).targets.get(r.toLowerCase())??r},"yn"),Ve=a((s,e)=>s.toLowerCase().startsWith(e.toLowerCase()),"Ye"),ht=a((s,e,n,t)=>{let r=[];for(let o of s)if(Ve(o,e)&&(r.push(t(o)),r.length>=n))break;return r},"tt"),Sn=a((s,e,n)=>{let t=new Map;for(let[r,o]of Object.entries(s.columns))for(let l of o)if(Ve(l,e)&&!t.has(l)&&(t.set(l,r),t.size>=n))return[...t].map(([i,c])=>({detail:c,kind:"column",label:i}));return[...t].map(([r,o])=>({detail:o,kind:"column",label:r}))},"vn"),Cn=a((s,e,n)=>{let t=Nt(s,e),r=wn(s,t.start,n.tables);if(r!==void 0){let c=n.columns[r]??n.columns[r.toLowerCase()]??[];return ht(c,t.text,Me,d=>({detail:r,kind:"column",label:d}))}if(t.text===""&&!ft(s,t.start))return[];let o=ht(n.tables,t.text,Me,c=>({kind:"table",label:c})),l=Sn(n,t.text,Me),i=xn.flatMap(c=>t.text!==""&&Ve(c,t.text)&&c.toLowerCase()!==t.text.toLowerCase()?[{kind:"keyword",label:c}]:[]);return(ft(s,t.start)?[...l,...o,...i]:[...o,...l,...i]).slice(0,Me)},"Sn"),kn=a((s,e,n)=>{let t=Nt(s,e),r=s.slice(0,t.start)+n.label+s.slice(t.end);return{caret:t.start+n.label.length,value:r}},"wn"),Nn=["boxSizing","borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textTransform","width","wordSpacing"],qn=a((s,e)=>{let n=globalThis.getComputedStyle(s),t=globalThis.document.createElement("div"),{style:r}=t;r.position="absolute",r.visibility="hidden",r.whiteSpace="pre-wrap",r.overflowWrap="break-word";for(let c of Nn)r[c]=n[c];t.textContent=s.value.slice(0,Math.max(0,e));let o=globalThis.document.createElement("span");o.textContent=s.value.slice(Math.max(0,e))||".",t.append(o),globalThis.document.body.append(t);let l=o.offsetLeft-s.scrollLeft,i=o.offsetTop-s.scrollTop;return t.remove(),{left:l,top:i}},"En"),En=a((s,e,n)=>{let t=(0,Z.c)(16),[r,o]=(0,B.useState)(null),l;t[0]!==s||t[1]!==e?(l=a((w,p)=>{let S=Cn(w,p,s);if(S.length===0){o(null);return}let y=e.current,{left:g,top:C}=y===null?{left:0,top:0}:qn(y,p);o(k=>k!==null&&k.active===0&&k.left===g&&k.top===C&&k.suggestions.length===S.length&&k.suggestions.every((q,E)=>{let T=S.at(E);return q.kind===T?.kind&&q.label===T.label&&q.detail===T.detail})?k:{active:0,left:g,suggestions:S,top:C})},"r"),t[0]=s,t[1]=e,t[2]=l):l=t[2];let i=l,c;t[3]===Symbol.for("react.memo_cache_sentinel")?(c=a(()=>{o(null)},"c"),t[3]=c):c=t[3];let d=c,m;t[4]===Symbol.for("react.memo_cache_sentinel")?(m=a(w=>{o(p=>{if(p===null)return p;let S=p.suggestions.length,y=(p.active+w+S)%S;return{...p,active:y}})},"f"),t[4]=m):m=t[4];let x=m,h;t[5]!==n||t[6]!==r||t[7]!==e?(h=a(w=>{let p=e.current;if(r===null||p===null)return!1;let S=r.suggestions[w??r.active];if(S===void 0)return!1;let y=kn(p.value,p.selectionStart,S);return n(y.value),o(null),requestAnimationFrame(()=>{let g=e.current;g!==null&&(g.focus(),g.setSelectionRange(y.caret,y.caret))}),!0},"u"),t[5]=n,t[6]=r,t[7]=e,t[8]=h):h=t[8];let v=h,f;t[9]!==v?(f=a(()=>v(),"d"),t[9]=v,t[10]=f):f=t[10];let N=f,b;return t[11]!==N||t[12]!==v||t[13]!==i||t[14]!==r?(b={close:d,commit:N,commitAt:v,move:x,refresh:i,state:r},t[11]=N,t[12]=v,t[13]=i,t[14]=r,t[15]=b):b=t[15],b},"Nn"),Tn={column:"column",keyword:"keyword",table:"table"},In=20,Ln=a(s=>{let e=(0,Z.c)(17),{listboxId:n,onPick:t,state:r}=s,o=ae(),l;e[0]!==r?(l=r===null?void 0:{left:r.left,top:r.top+In},e[0]=r,e[1]=l):l=e[1];let i=l;if(r===null)return null;let c;if(e[2]!==n||e[3]!==t||e[4]!==r.active||e[5]!==r.suggestions||e[6]!==o){let m;e[8]!==n||e[9]!==t||e[10]!==r.active||e[11]!==o?(m=a((x,h)=>(0,u.jsxs)("li",{"aria-selected":h===r.active,className:ue("flex cursor-pointer items-center gap-2 px-2 py-1 text-[13px]",h===r.active?"bg-accent text-accent-foreground":"text-foreground"),"data-testid":"sql-autocomplete-item",id:`${n}-opt-${h.toString()}`,onMouseDown:a(v=>{v.preventDefault(),t(h)},"onMouseDown"),role:"option",children:[(0,u.jsx)("span",{className:"truncate font-mono",children:x.label}),x.detail!==void 0&&(0,u.jsx)("span",{className:"ms-auto truncate text-xs text-muted-foreground",children:x.detail}),(0,u.jsx)("span",{className:"shrink-0 font-mono text-[10px] tracking-wide text-muted-foreground/70 uppercase",children:o(Tn[x.kind])})]},`${x.kind}:${x.label}`),"f"),e[8]=n,e[9]=t,e[10]=r.active,e[11]=o,e[12]=m):m=e[12],c=r.suggestions.map(m),e[2]=n,e[3]=t,e[4]=r.active,e[5]=r.suggestions,e[6]=o,e[7]=c}else c=e[7];let d;return e[13]!==n||e[14]!==i||e[15]!==c?(d=(0,u.jsx)("ul",{className:"absolute z-30 max-h-56 w-72 overflow-auto rounded-md border border-border bg-popover py-1 text-popover-foreground shadow-md","data-testid":"sql-autocomplete",id:n,role:"listbox",style:i,children:c}),e[13]=n,e[14]=i,e[15]=c,e[16]=d):d=e[16],d},"Rn"),Rn=Se(ke.listTables),_n=Se(ke.readTablePage),Dn=a(s=>{let e=(0,Z.c)(18),n=_e(),t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=[],e[0]=t):t=e[0];let[r,o]=(0,B.useState)(t),l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l={},e[1]=l):l=e[1];let[i,c]=(0,B.useState)(l),d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d={},e[2]=d):d=e[2];let[m,x]=(0,B.useState)(d),h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=new Set,e[3]=h):h=e[3];let v=(0,B.useRef)(h),f,N;e[4]!==n||e[5]!==s?(f=a(()=>{let g={cancelled:!1};return me((async()=>{try{let C=await n.query(Rn,{},Ce(s));g.cancelled||(o(C.map(Mn)),c({}),x({}),v.current=new Set)}catch{g.cancelled||(o([]),c({}),x({}),v.current=new Set)}})()),()=>{g.cancelled=!0}},"d"),N=[n,s],e[4]=n,e[5]=s,e[6]=f,e[7]=N):(f=e[6],N=e[7]),(0,B.useEffect)(f,N);let b;e[8]!==n||e[9]!==s?(b=a(g=>{v.current.has(g)||(v.current.add(g),me((async()=>{try{let C=await n.query(_n,{limit:1,offset:0,table:g},Ce(s)),{sqlColumns:k}=C;if(k===void 0){v.current.delete(g);return}let q=new Set(k),E=C.columns.filter(T=>!q.has(T));c(T=>({...T,[g]:k})),x(T=>({...T,[g]:E}))}catch{v.current.delete(g)}})()))},"m"),e[8]=n,e[9]=s,e[10]=b):b=e[10];let w=b,p;e[11]!==i||e[12]!==m||e[13]!==r?(p={columns:i,docFields:m,tables:r},e[11]=i,e[12]=m,e[13]=r,e[14]=p):p=e[14];let S=p,y;return e[15]!==w||e[16]!==S?(y={probe:w,schema:S},e[15]=w,e[16]=S,e[17]=y):y=e[17],y},"_n"),Je=/\b(?:from|join|update|into)\s+([a-z_][\w$]*)|\b([a-z_][\w$]*)\s*\./gi,An=a(s=>{let e=new Set;Je.lastIndex=0;let n=Je.exec(s);for(;n!==null;)e.add(n[1]??n[2]),n=Je.exec(s);return[...e]},"An");function Mn(s){return s.name}a(Mn,"qn");var On=a(s=>(s.metaKey||s.ctrlKey)&&!s.shiftKey&&!s.altKey&&s.key.toLowerCase()==="i","Dn"),Pn=a(s=>{let e=(0,Z.c)(44),{inlineEditEnabled:n,onSubmit:t,probe:r,schema:o,setDraft:l}=s,i=(0,B.useId)(),[c,d]=(0,B.useState)(null),m=(0,B.useRef)(null),x=(0,B.useRef)(null),h=(0,B.useRef)(null),v=En(o,h,l),{close:f,commit:N,commitAt:b,move:w,refresh:p,state:S}=v,y;e[0]!==b?(y=a(A=>{b(A)},"v"),e[0]=b,e[1]=y):y=e[1];let g=y,C;e[2]!==p?(C=a(()=>{let A=h.current;A!==null&&A===document.activeElement&&p(A.value,A.selectionStart)},"E"),e[2]=p,e[3]=C):C=e[3];let k;e[4]!==p||e[5]!==o?(k=[p,o],e[4]=p,e[5]=o,e[6]=k):k=e[6],(0,B.useEffect)(C,k);let q;e[7]!==r||e[8]!==p||e[9]!==l?(q=a(A=>{let{selectionStart:U,value:G}=A.target;l(G),d(null);for(let Y of An(G))r(Y);p(G,U)},"T"),e[7]=r,e[8]=p,e[9]=l,e[10]=q):q=e[10];let E=q,T;e[11]!==p?(T=a(A=>{let U=A.currentTarget;p(U.value,U.selectionStart)},"R"),e[11]=p,e[12]=T):T=e[12];let I=T,D;e[13]!==f||e[14]!==N||e[15]!==w?(D=a(A=>A.key==="ArrowDown"?(A.preventDefault(),w(1),!0):A.key==="ArrowUp"?(A.preventDefault(),w(-1),!0):A.key==="Escape"?(A.preventDefault(),f(),!0):(A.key==="Enter"||A.key==="Tab")&&!A.metaKey&&!A.ctrlKey&&N()?(A.preventDefault(),!0):!1,"_"),e[13]=f,e[14]=N,e[15]=w,e[16]=D):D=e[16];let R=D,_;e[17]!==S||e[18]!==f||e[19]!==n||e[20]!==R||e[21]!==t?(_=a(A=>{if(!(S!==null&&R(A))){if((A.metaKey||A.ctrlKey)&&A.key==="Enter"){A.preventDefault(),t();return}if(n&&On(A)){A.preventDefault(),f();let{selectionEnd:U,selectionStart:G,value:Y}=A.currentTarget,[O,oe]=G===U?[0,Y.length]:[G,U];d({end:oe,start:O,text:Y.slice(O,oe)})}}},"L"),e[17]=S,e[18]=f,e[19]=n,e[20]=R,e[21]=t,e[22]=_):_=e[22];let Q=_,j;e[23]!==f?(j=a(()=>{requestAnimationFrame(()=>{f()})},"B"),e[23]=f,e[24]=j):j=e[24];let K=j,P;e[25]===Symbol.for("react.memo_cache_sentinel")?(P=a(A=>{let{scrollLeft:U,scrollTop:G}=A.currentTarget;m.current!==null&&(m.current.scrollTop=G),x.current!==null&&(x.current.scrollTop=G,x.current.scrollLeft=U)},"M"),e[25]=P):P=e[25];let W=P,F;e[26]===Symbol.for("react.memo_cache_sentinel")?(F=a(A=>{let U=h.current;U===null||A.offset===void 0||(U.focus(),U.setSelectionRange(A.offset,A.offset+(A.length??0)))},"Q"),e[26]=F):F=e[26];let L=F,M;e[27]===Symbol.for("react.memo_cache_sentinel")?(M=a(()=>{d(null),h.current?.focus()},"D"),e[27]=M):M=e[27];let z=M,$;e[28]!==c||e[29]!==l?($=a(A=>{let U=h.current;if(c===null||U===null)return;let{end:G,start:Y,text:O}=c;if(U.value.slice(Y,G)!==O){z();return}l(U.value.slice(0,Y)+A+U.value.slice(G)),d(null),U.focus(),requestAnimationFrame(()=>{U.setSelectionRange(Y,Y+A.length)})},"$"),e[28]=c,e[29]=l,e[30]=$):$=e[30];let te=$,V;e[31]!==E||e[32]!==K||e[33]!==Q||e[34]!==I?(V={onBlur:K,onChange:E,onKeyDown:Q,onScroll:W,onSelect:I},e[31]=E,e[32]=K,e[33]=Q,e[34]=I,e[35]=V):V=e[35];let ee;return e[36]!==te||e[37]!==S||e[38]!==f||e[39]!==c||e[40]!==i||e[41]!==g||e[42]!==V?(ee={acceptInlineEdit:te,autocompleteState:S,closeAutocomplete:f,closeInlineEdit:z,inlineEdit:c,handlers:V,listboxId:i,onPickSuggestion:g,editorRef:h,gutterRef:m,overlayRef:x,revealDiagnostic:L},e[36]=te,e[37]=S,e[38]=f,e[39]=c,e[40]=i,e[41]=g,e[42]=V,e[43]=ee):ee=e[43],ee},"On"),$n="lunora-studio-sql-tabs",jn="lunora-studio-sql-active-tab",Xe=12,Ee=a((s="",e="")=>({activeId:null,id:Ke("tab"),name:e,sql:s}),"Ee"),zn=a(()=>Ae(jn,""),"Bn"),Hn=a(s=>{let e=(0,Z.c)(16),[n,t]=De($n),[r,o]=zn(),[l]=(0,B.useState)(s),i,c;e[0]!==l||e[1]!==t||e[2]!==n.length?(i=a(()=>{n.length===0&&t([l])},"i"),c=[l,t,n.length],e[0]=l,e[1]=t,e[2]=n.length,e[3]=i,e[4]=c):(i=e[3],c=e[4]),(0,B.useEffect)(i,c);let d;e[5]!==l||e[6]!==n?(d=n.length===0?[l]:n,e[5]=l,e[6]=n,e[7]=d):d=e[7];let m=d,x;e[8]!==r||e[9]!==m?(x=m.some(f=>f.id===r)?r:m[0]?.id??"",e[8]=r,e[9]=m,e[10]=x):x=e[10];let h=x,v;return e[11]!==h||e[12]!==o||e[13]!==t||e[14]!==m?(v={activeId:h,setActiveId:o,setTabs:t,tabs:m},e[11]=h,e[12]=o,e[13]=t,e[14]=m,e[15]=v):v=e[15],v},"Hn"),qt=a(s=>s.activeId===null&&s.sql.trim()!=="","ht"),Wn=a((s,e)=>[...s,e].slice(-Xe),"Pn"),Bn=a((s,e,n)=>{let t=s.findIndex(o=>o.id===e);if(t===-1)return{activeId:s[0]?.id??"",tabs:[...s]};let r=s.filter(o=>o.id!==e);if(r.length===0){let o=n();return{activeId:o.id,tabs:[o]}}return{activeId:r[Math.min(t,r.length-1)].id,tabs:r}},"Fn"),Fn=a((s,e)=>{let n=s.filter(t=>t.id===e);return n.length===0?{activeId:s[0]?.id??"",tabs:[...s]}:{activeId:e,tabs:n}},"Wn"),Qn=a((s,e,n)=>{let t=s.findIndex(o=>o.id===e);if(t===-1)return{activeId:n,tabs:[...s]};let r=s.slice(0,t+1);return{activeId:r.some(o=>o.id===n)?n:e,tabs:r}},"Kn"),Kn=a(s=>{let e=s();return{activeId:e.id,tabs:[e]}},"Qn"),Un=a((s,e,n)=>{if(s==="others")return e.filter(t=>t.id!==n);if(s==="right"){let t=e.findIndex(r=>r.id===n);return t===-1?[]:e.slice(t+1)}return[...e]},"zn"),pt={error:null,pane:"results",result:null,running:!1},Gn=a(s=>{let e=(0,Z.c)(66),{activeId:n,setActiveId:t,setTabs:r,tabs:o}=Hn(s),l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={},e[0]=l):l=e[0];let[i,c]=(0,B.useState)(l),[d,m]=(0,B.useState)(null),[x,h]=(0,B.useState)(null),v;e[1]!==n||e[2]!==o?(v=o.find(H=>H.id===n)??o[0]??Ee(),e[1]=n,e[2]=o,e[3]=v):v=e[3];let f=v,N=i[f.id]??pt,b;e[4]!==f.id||e[5]!==r?(b=a(H=>{r(J=>J.map(X=>X.id===f.id?{...X,...H}:X))},"m"),e[4]=f.id,e[5]=r,e[6]=b):b=e[6];let w=b,p;e[7]!==f.id?(p=a(H=>{c(J=>{let X=J[f.id]??pt;return{...J,[f.id]:{...X,...H}}})},"b"),e[7]=f.id,e[8]=p):p=e[8];let S=p,y;e[9]!==t||e[10]!==r||e[11]!==o.length?(y=a(()=>{if(o.length>=Xe)return;let H=Ee();r(J=>Wn(J,H)),t(H.id)},"v"),e[9]=t,e[10]=r,e[11]=o.length,e[12]=y):y=e[12];let g=y,C;e[13]!==t||e[14]!==r?(C=a(H=>{m(null),h(null),r(H.tabs),t(H.activeId);let J=new Set(H.tabs.map(Jn));c(X=>Object.fromEntries(Object.entries(X).filter(re=>{let[fe]=re;return J.has(fe)})))},"E"),e[13]=t,e[14]=r,e[15]=C):C=e[15];let k=C,q;e[16]!==k||e[17]!==o?(q=a(H=>{k(Bn(o,H,Ee))},"T"),e[16]=k,e[17]=o,e[18]=q):q=e[18];let E=q,T;e[19]!==n||e[20]!==k||e[21]!==o?(T=a((H,J)=>{k(H==="others"?Fn(o,J):H==="right"?Qn(o,J,n):Kn(Ee))},"R"),e[19]=n,e[20]=k,e[21]=o,e[22]=T):T=e[22];let I=T,D;e[23]!==I||e[24]!==d||e[25]!==o?(D=a(H=>{d!==null&&(Un(H,o,d.id).some(Yn)?h(H):I(H,d.id))},"_"),e[23]=I,e[24]=d,e[25]=o,e[26]=D):D=e[26];let R=D,_;e[27]===Symbol.for("react.memo_cache_sentinel")?(_=a((H,J)=>{J.preventDefault(),h(null),m({id:H,x:J.clientX,y:J.clientY})},"L"),e[27]=_):_=e[27];let Q=_,j;e[28]===Symbol.for("react.memo_cache_sentinel")?(j=a(()=>{m(null),h(null)},"B"),e[28]=j):j=e[28];let K=j,P;e[29]===Symbol.for("react.memo_cache_sentinel")?(P=a(H=>{H.preventDefault(),m(null),h(null)},"M"),e[29]=P):P=e[29];let W=P,F;e[30]!==R?(F=a(()=>{R("others")},"Q"),e[30]=R,e[31]=F):F=e[31];let L=F,M;e[32]!==R?(M=a(()=>{R("right")},"D"),e[32]=R,e[33]=M):M=e[33];let z=M,$;e[34]!==R?($=a(()=>{R("all")},"$"),e[34]=R,e[35]=$):$=e[35];let te=$,V;e[36]!==I||e[37]!==x||e[38]!==d?(V=a(()=>{d!==null&&x!==null&&I(x,d.id),h(null)},"J"),e[36]=I,e[37]=x,e[38]=d,e[39]=V):V=e[39];let ee=V,A;e[40]===Symbol.for("react.memo_cache_sentinel")?(A=a(()=>{h(null)},"q"),e[40]=A):A=e[40];let U=A,G;e[41]!==d?(G=d===null?void 0:{left:d.x,top:d.y},e[41]=d,e[42]=G):G=e[42];let Y=G,O;e[43]!==r?(O=a(H=>{r(J=>J.map(X=>X.activeId===H?{...X,activeId:null}:X))},"O"),e[43]=r,e[44]=O):O=e[44];let oe=O,se;e[45]!==r?(se=a((H,J)=>{r(X=>X.map(re=>re.id===H?{...re,name:J}:re))},"re"),e[45]=r,e[46]=se):se=e[46];let le=se,ie;return e[47]!==f||e[48]!==n||e[49]!==g||e[50]!==E||e[51]!==ee||e[52]!==te||e[53]!==L||e[54]!==z||e[55]!==N||e[56]!==S||e[57]!==w||e[58]!==x||e[59]!==le||e[60]!==t||e[61]!==d||e[62]!==Y||e[63]!==o||e[64]!==oe?(ie={activeTab:f,activeTabId:n,addEditorTab:g,cancelBulk:U,closeEditorTab:E,closeTabMenu:K,confirmBulk:ee,menuStyle:Y,onBackdropContextMenu:W,onCloseAll:te,onCloseOthers:L,onCloseToRight:z,openTabMenu:Q,output:N,patchActiveOutput:S,patchActiveTab:w,pendingBulk:x,renameTab:le,setActiveTabId:t,tabMenu:d,tabs:o,unlinkQuery:oe},e[47]=f,e[48]=n,e[49]=g,e[50]=E,e[51]=ee,e[52]=te,e[53]=L,e[54]=z,e[55]=N,e[56]=S,e[57]=w,e[58]=x,e[59]=le,e[60]=t,e[61]=d,e[62]=Y,e[63]=o,e[64]=oe,e[65]=ie):ie=e[65],ie},"Un");function Jn(s){return s.id}a(Jn,"jn");function Yn(s){return qt(s)}a(Yn,"Yn");var Vn="lunora-studio-sql-queries",we="lunora-studio-sql-history",Xn="lunora-studio-sql-remember-history",Zn=25,eo=a(s=>{let e=(0,Z.c)(41),{loadIntoActiveTab:n,unlinkQuery:t}=s,r=ae(),[o,l]=De(Vn),[i,c]=Ae(Xn,!1),[d,m]=De(we,i?"local":"session"),x,h;e[0]!==i?(x=a(()=>{i||Ne(we,"local")},"g"),h=[i],e[0]=i,e[1]=x,e[2]=h):(x=e[1],h=e[2]),(0,B.useEffect)(x,h);let[v,f]=(0,B.useState)(""),N=(0,B.useRef)(null),b;e[3]!==m?(b=a(L=>{m(M=>M[0]?.sql===L?M:[{at:Date.now(),sql:L},...M.filter(z=>z.sql!==L)].slice(0,Zn))},"m"),e[3]=m,e[4]=b):b=e[4];let w=b,p;e[5]!==n||e[6]!==l||e[7]!==r?(p=a(()=>{let L={id:Ke("q"),name:r("Untitled query"),sql:""};l(M=>[L,...M]),n("",L.id)},"b"),e[5]=n,e[6]=l,e[7]=r,e[8]=p):p=e[8];let S=p,y;e[9]!==n||e[10]!==o?(y=a(L=>{let M=o.find(z=>z.id===L);M!==void 0&&(n(M.sql,L),N.current?.querySelector(`[data-testid="sql-query-${L}"]`)?.scrollIntoView({block:"nearest"}))},"v"),e[9]=n,e[10]=o,e[11]=y):y=e[11];let g=y,C;e[12]!==l||e[13]!==t?(C=a(L=>{l(M=>M.filter(z=>z.id!==L)),t(L)},"E"),e[12]=l,e[13]=t,e[14]=C):C=e[14];let k=C,q;e[15]!==n?(q=a(L=>{n(L.currentTarget.dataset.sql??"",null)},"T"),e[15]=n,e[16]=q):q=e[16];let E=q,T;e[17]!==n?(T=a(L=>{n(L.currentTarget.dataset.sql??"",null)},"R"),e[17]=n,e[18]=T):T=e[18];let I=T,D;e[19]!==m?(D=a(()=>{m([]),Ne(we,"local"),Ne(we,"session")},"_"),e[19]=m,e[20]=D):D=e[20];let R=D,_;e[21]!==d||e[22]!==c?(_=a(L=>{nt(we,d,L?"local":"session"),L||Ne(we,"local"),c(L)},"L"),e[21]=d,e[22]=c,e[23]=_):_=e[23];let Q=_,j;e[24]===Symbol.for("react.memo_cache_sentinel")?(j=a(L=>{f(L.target.value)},"B"),e[24]=j):j=e[24];let K=j,P;e[25]!==l?(P=a((L,M)=>{l(z=>z.map($=>$.id===L?{...$,sql:M}:$))},"M"),e[25]=l,e[26]=P):P=e[26];let W=P,F;return e[27]!==R||e[28]!==k||e[29]!==d||e[30]!==I||e[31]!==E||e[32]!==S||e[33]!==o||e[34]!==w||e[35]!==i||e[36]!==v||e[37]!==g||e[38]!==Q||e[39]!==W?(F={clearHistory:R,deleteQuery:k,history:d,listRef:N,loadFromHistory:I,loadTemplate:E,newQuery:S,onSearchChange:K,queries:o,recordHistory:w,rememberHistory:i,search:v,selectQuery:g,setRememberHistory:Q,updateQuerySql:W},e[27]=R,e[28]=k,e[29]=d,e[30]=I,e[31]=E,e[32]=S,e[33]=o,e[34]=w,e[35]=i,e[36]=v,e[37]=g,e[38]=Q,e[39]=W,e[40]=F):F=e[40],F},"Xn"),Ze="p-3 font-mono text-xs leading-5 whitespace-pre-wrap break-words",to=a((s,e)=>{let n=[];for(let r of s){if(r.offset===void 0||r.length===void 0||r.length<=0)continue;let o=Math.max(0,Math.min(r.offset,e)),l=Math.max(o,Math.min(r.offset+r.length,e));o!==l&&n.push({end:l,severity:r.severity,start:o})}n.sort((r,o)=>r.start-o.start);let t=[];for(let r of n)r.start>=(t.at(-1)?.end??0)&&t.push(r);return t},"Zn"),Et=a((s,e)=>e(s==="unsafe-response"?"The model returned a statement that is not read-only, so it was discarded.":s==="too-long"?"The statement is too long to rewrite. Select a shorter part of it.":s==="empty-response"?"The model returned nothing usable.":"The model could not be reached."),"bt"),no=a(s=>{let e=(0,Z.c)(51),{assistant:n,failed:t,onGenerated:r}=s,o=ae(),[l,i]=(0,B.useState)("");if(n.unavailable)return null;let c;e[0]!==n?(c=n.pending("sql"),e[0]=n,e[1]=c):c=e[1];let d=c,m;if(e[2]!==n||e[3]!==t||e[4]!==r||e[5]!==d||e[6]!==l||e[7]!==o){let x=n.reason("sql"),h;e[9]!==n||e[10]!==t||e[11]!==r||e[12]!==l?(h=a(I=>{let D=l.trim();D===""&&!I||me((async()=>{let R=await n.generate(D===""?"fix the failing statement":D,I?t:void 0);R!==void 0&&r(R)})())},"u"),e[9]=n,e[10]=t,e[11]=r,e[12]=l,e[13]=h):h=e[13];let v=h,f;e[14]!==o?(f=o("Describe the query you want"),e[14]=o,e[15]=f):f=e[15];let N;e[16]===Symbol.for("react.memo_cache_sentinel")?(N=a(I=>{i(I.target.value)},"N"),e[16]=N):N=e[16];let b;e[17]!==v?(b=a(I=>{I.key==="Enter"&&(I.preventDefault(),v(!1))},"m"),e[17]=v,e[18]=b):b=e[18];let w;e[19]!==o?(w=o("Describe the query you want"),e[19]=o,e[20]=w):w=e[20];let p;e[21]!==d||e[22]!==l||e[23]!==f||e[24]!==b||e[25]!==w?(p=(0,u.jsx)(Qe,{"aria-label":f,className:"h-7 flex-1 text-xs","data-testid":"sql-assistant-prompt",disabled:d,onChange:N,onKeyDown:b,placeholder:w,value:l}),e[21]=d,e[22]=l,e[23]=f,e[24]=b,e[25]=w,e[26]=p):p=e[26];let S=d&&"opacity-60",y;e[27]!==S?(y=ue("rounded-md border border-border px-2 py-1 text-xs outline-none transition-colors hover:bg-accent focus-visible:bg-accent",S),e[27]=S,e[28]=y):y=e[28];let g;e[29]!==d||e[30]!==l?(g=d||l.trim()==="",e[29]=d,e[30]=l,e[31]=g):g=e[31];let C;e[32]!==v?(C=a(()=>{v(!1)},"E"),e[32]=v,e[33]=C):C=e[33];let k;e[34]!==d||e[35]!==o?(k=o(d?"Thinking\u2026":"Draft SQL"),e[34]=d,e[35]=o,e[36]=k):k=e[36];let q;e[37]!==y||e[38]!==g||e[39]!==C||e[40]!==k?(q=(0,u.jsx)("button",{className:y,"data-testid":"sql-assistant-generate",disabled:g,onClick:C,type:"button",children:k}),e[37]=y,e[38]=g,e[39]=C,e[40]=k,e[41]=q):q=e[41];let E;e[42]!==t||e[43]!==d||e[44]!==v||e[45]!==o?(E=t!==void 0&&(0,u.jsx)("button",{className:"rounded-md border border-border px-2 py-1 text-xs outline-none transition-colors hover:bg-accent focus-visible:bg-accent","data-testid":"sql-assistant-fix",disabled:d,onClick:a(()=>{v(!0)},"onClick"),type:"button",children:o("Fix this")}),e[42]=t,e[43]=d,e[44]=v,e[45]=o,e[46]=E):E=e[46];let T;e[47]!==q||e[48]!==E||e[49]!==p?(T=(0,u.jsxs)("div",{className:"flex items-center gap-2",children:[p,q,E]}),e[47]=q,e[48]=E,e[49]=p,e[50]=T):T=e[50],m=(0,u.jsxs)("div",{className:"flex flex-col gap-1 border-b border-border px-3 py-2","data-testid":"sql-assistant",children:[T,x!==void 0&&(0,u.jsx)("p",{className:"text-[11px] text-muted-foreground","data-testid":"sql-assistant-reason",role:"status",children:Et(x,o)})]}),e[2]=n,e[3]=t,e[4]=r,e[5]=d,e[6]=l,e[7]=o,e[8]=m}else m=e[8];return m},"es"),oo=a(s=>{let e=(0,Z.c)(8),{diagnostics:n,draft:t,scrollRef:r}=s,o,l;if(e[0]!==n||e[1]!==t){l=Symbol.for("react.early_return_sentinel");e:{let d=to(n,t.length);if(d.length===0){l=null;break e}o=[];let m=0;for(let[x,h]of d.entries())h.start>m&&o.push(t.slice(m,h.start)),o.push((0,u.jsx)("span",{className:ue("decoration-wavy underline underline-offset-4",h.severity==="error"?"decoration-destructive":"decoration-amber-500"),children:t.slice(h.start,h.end)},`${h.start.toString()}-${x.toString()}`)),m=h.end;o.push(t.slice(m))}e[0]=n,e[1]=t,e[2]=o,e[3]=l}else o=e[2],l=e[3];if(l!==Symbol.for("react.early_return_sentinel"))return l;let i;e[4]===Symbol.for("react.memo_cache_sentinel")?(i=ue("pointer-events-none absolute inset-0 overflow-hidden text-transparent",Ze),e[4]=i):i=e[4];let c;return e[5]!==o||e[6]!==r?(c=(0,u.jsx)("div",{"aria-hidden":"true",className:i,"data-testid":"sql-diagnostics-overlay",ref:r,children:o}),e[5]=o,e[6]=r,e[7]=c):c=e[7],c},"ts"),ro={gate:"read-only",plan:"plan",schema:"schema",syntax:"syntax"},so=a(s=>{let e=(0,Z.c)(10),{diagnostics:n,onSelect:t}=s,r=ae();if(n.length===0)return null;let o;e[0]!==r?(o=r("SQL problems"),e[0]=r,e[1]=o):o=e[1];let l;if(e[2]!==n||e[3]!==t){let c;e[5]!==t?(c=a((d,m)=>(0,u.jsx)("li",{children:(0,u.jsxs)("button",{className:"flex w-full items-start gap-2 px-3 py-1 text-start text-xs outline-none hover:bg-accent focus-visible:bg-accent","data-testid":"sql-problem",onClick:a(()=>{t(d)},"onClick"),type:"button",children:[(0,u.jsx)("span",{className:ue("mt-px shrink-0 rounded px-1 font-mono text-[10px] uppercase",d.severity==="error"?"bg-destructive/15 text-destructive":"bg-amber-500/15 text-amber-600"),children:ro[d.source]}),(0,u.jsx)("span",{className:"min-w-0 text-muted-foreground",children:d.message})]})},`${d.source}-${(d.offset??m).toString()}-${m.toString()}`),"c"),e[5]=t,e[6]=c):c=e[6],l=n.map(c),e[2]=n,e[3]=t,e[4]=l}else l=e[4];let i;return e[7]!==o||e[8]!==l?(i=(0,u.jsx)("ul",{"aria-label":o,className:"max-h-24 shrink-0 overflow-y-auto border-t border-border bg-muted/30","data-testid":"sql-problems",children:l}),e[7]=o,e[8]=l,e[9]=i):i=e[9],i},"ss"),lo=a(s=>(s.endsWith(`
|
|
12
|
+
`)?s.slice(0,-1):s).split(`
|
|
13
|
+
`),"os"),io=a((s,e)=>{let n=[],t=1,r=1;for(let o of Ge(s,e,{ignoreNewlineAtEof:!0}))for(let l of lo(o.value))o.added?(n.push({after:r,kind:"added",text:l}),r+=1):o.removed?(n.push({before:t,kind:"removed",text:l}),t+=1):(n.push({after:r,before:t,kind:"context",text:l}),t+=1,r+=1);return n},"ls"),ao={added:"bg-emerald-500/10 text-emerald-700 dark:text-emerald-400",context:"text-muted-foreground",removed:"bg-destructive/10 text-destructive"},co={added:"+",context:" ",removed:"-"},uo=a(s=>{let e=(0,Z.c)(11),{lines:n}=s,t=ae(),r;e[0]!==t?(r=t("Proposed edit"),e[0]=t,e[1]=r):r=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=ue("max-h-48 overflow-auto rounded-md border border-border bg-background",Ze),e[2]=o):o=e[2];let l;if(e[3]!==n||e[4]!==t){let c;e[6]!==t?(c=a(d=>(0,u.jsxs)("li",{className:ue("flex gap-2",ao[d.kind]),"data-kind":d.kind,children:[(0,u.jsx)("span",{"aria-hidden":"true",className:"shrink-0 select-none opacity-60",children:co[d.kind]}),d.kind!=="context"&&(0,u.jsx)("span",{className:"sr-only",children:d.kind==="added"?t("Added"):t("Removed")}),(0,u.jsx)("span",{className:"min-w-0",children:d.text===""?"\xA0":d.text})]},`${String(d.before)}:${String(d.after)}`),"c"),e[6]=t,e[7]=c):c=e[7],l=n.map(c),e[3]=n,e[4]=t,e[5]=l}else l=e[5];let i;return e[8]!==r||e[9]!==l?(i=(0,u.jsx)("ul",{"aria-label":r,className:o,"data-testid":"sql-inline-diff",children:l}),e[8]=r,e[9]=l,e[10]=i):i=e[10],i},"as"),Oe="rounded-md border border-border px-2 py-1 text-xs outline-none transition-colors hover:bg-accent focus-visible:bg-accent",mo=a(s=>{let e=(0,Z.c)(41),{onAccept:n,onCancel:t,rpc:r,source:o,whole:l}=s,i=ae(),c=(0,B.useRef)(null),d=(0,B.useRef)(null),[m,x]=(0,B.useState)(""),[h,v]=(0,B.useState)(null),f,N;if(e[0]!==h?(f=a(()=>{h===null?c.current?.focus():d.current?.focus()},"d"),N=[h],e[0]=h,e[1]=f,e[2]=N):(f=e[1],N=e[2]),(0,B.useEffect)(f,N),r.unavailable)return null;let b;e[3]!==r?(b=r.pending("sql"),e[3]=r,e[4]=b):b=e[4];let w=b,p;if(e[5]!==m||e[6]!==n||e[7]!==t||e[8]!==w||e[9]!==h||e[10]!==r||e[11]!==o||e[12]!==i||e[13]!==l){let S=r.reason("sql"),y;e[15]!==m||e[16]!==r||e[17]!==o?(y=a(()=>{let R=m.trim();R===""||o.trim()===""||me((async()=>{let _=await r.rewrite(R,o);_!==void 0&&v(_)})())},"v"),e[15]=m,e[16]=r,e[17]=o,e[18]=y):y=e[18];let g=y,C;e[19]!==t?(C=a(R=>{R.key==="Escape"&&(R.preventDefault(),t())},"E"),e[19]=t,e[20]=C):C=e[20];let k=C,q;e[21]!==i||e[22]!==l?(q=i(l?"Whole query":"Selection"),e[21]=i,e[22]=l,e[23]=q):q=e[23];let E;e[24]!==q?(E=(0,u.jsx)("span",{className:"shrink-0 rounded bg-muted px-1 font-mono text-[10px] uppercase text-muted-foreground","data-testid":"sql-inline-edit-scope",children:q}),e[24]=q,e[25]=E):E=e[25];let T;e[26]!==m||e[27]!==n||e[28]!==t||e[29]!==k||e[30]!==w||e[31]!==h||e[32]!==g||e[33]!==i?(T=h===null?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(Qe,{"aria-label":i("Tell the model what to change"),className:"h-7 flex-1 text-xs","data-testid":"sql-inline-edit-prompt",disabled:w,onChange:a(R=>{x(R.target.value)},"onChange"),onKeyDown:a(R=>{if(R.key==="Enter"){R.preventDefault(),g();return}k(R)},"onKeyDown"),placeholder:i("Tell the model what to change"),ref:c,value:m}),(0,u.jsx)("button",{className:ue(Oe,w&&"opacity-60"),"data-testid":"sql-inline-edit-submit",disabled:w||m.trim()==="",onClick:g,onKeyDown:k,type:"button",children:i(w?"Thinking\u2026":"Rewrite")}),(0,u.jsx)("button",{className:Oe,"data-testid":"sql-inline-edit-cancel",onClick:t,onKeyDown:k,type:"button",children:i("Cancel")})]}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("span",{className:"flex-1 text-xs text-muted-foreground",children:i("Proposed edit")}),(0,u.jsx)("button",{className:Oe,"data-testid":"sql-inline-edit-accept",onClick:a(()=>{n(h)},"onClick"),onKeyDown:k,ref:d,type:"button",children:i("Accept")}),(0,u.jsx)("button",{className:Oe,"data-testid":"sql-inline-edit-reject",onClick:a(()=>{v(null)},"onClick"),onKeyDown:k,type:"button",children:i("Reject")})]}),e[26]=m,e[27]=n,e[28]=t,e[29]=k,e[30]=w,e[31]=h,e[32]=g,e[33]=i,e[34]=T):T=e[34];let I;e[35]!==E||e[36]!==T?(I=(0,u.jsxs)("div",{className:"flex items-center gap-2",children:[E,T]}),e[35]=E,e[36]=T,e[37]=I):I=e[37];let D;e[38]!==h||e[39]!==o?(D=h!==null&&(0,u.jsx)(uo,{lines:io(o,h)}),e[38]=h,e[39]=o,e[40]=D):D=e[40],p=(0,u.jsxs)("div",{className:"flex flex-col gap-1 border-b border-border bg-muted/20 px-3 py-2","data-testid":"sql-inline-edit",children:[I,D,S!==void 0&&(0,u.jsx)("p",{className:"text-[11px] text-muted-foreground","data-testid":"sql-inline-edit-reason",role:"status",children:Et(S,i)})]}),e[5]=m,e[6]=n,e[7]=t,e[8]=w,e[9]=h,e[10]=r,e[11]=o,e[12]=i,e[13]=l,e[14]=p}else p=e[14];return p},"cs"),fo={minWidth:"2.75rem",paddingInline:"0.5rem"},ho=a(s=>{let e=(0,Z.c)(75),{assistant:n,autocomplete:t,diagnostics:r,draft:o,failed:l,handlers:i,editorRef:c,gutterRef:d,inlineEdit:m,listboxId:x,onAcceptInlineEdit:h,onCancelInlineEdit:v,onGenerated:f,onPickSuggestion:N,onRevealDiagnostic:b,overlayRef:w}=s,p=ae(),S,y,g,C,k,q,E,T,I;if(e[0]!==n||e[1]!==o||e[2]!==l||e[3]!==d||e[4]!==m||e[5]!==h||e[6]!==v||e[7]!==f){let $=o.split(`
|
|
14
|
+
`).length;E="flex min-h-0 min-w-0 flex-1 flex-col",e[17]!==n||e[18]!==l||e[19]!==f?(T=(0,u.jsx)(no,{assistant:n,failed:l,onGenerated:f}),e[17]=n,e[18]=l,e[19]=f,e[20]=T):T=e[20],e[21]!==n||e[22]!==o.length||e[23]!==m||e[24]!==h||e[25]!==v?(I=m!==null&&(0,u.jsx)(mo,{onAccept:h,onCancel:v,rpc:n,source:m.text,whole:m.start===0&&m.end===o.length},`${m.start.toString()}-${m.end.toString()}`),e[21]=n,e[22]=o.length,e[23]=m,e[24]=h,e[25]=v,e[26]=I):I=e[26],q="flex min-h-0 min-w-0 flex-1",S="true",y="shrink-0 select-none overflow-hidden border-e border-border bg-muted/30 py-3 text-end font-mono text-xs leading-5 text-muted-foreground/60",g=d,C=fo,k=Array.from({length:$},po),e[0]=n,e[1]=o,e[2]=l,e[3]=d,e[4]=m,e[5]=h,e[6]=v,e[7]=f,e[8]=S,e[9]=y,e[10]=g,e[11]=C,e[12]=k,e[13]=q,e[14]=E,e[15]=T,e[16]=I}else S=e[8],y=e[9],g=e[10],C=e[11],k=e[12],q=e[13],E=e[14],T=e[15],I=e[16];let D;e[27]!==S||e[28]!==y||e[29]!==g||e[30]!==C||e[31]!==k?(D=(0,u.jsx)("div",{"aria-hidden":S,className:y,ref:g,style:C,children:k}),e[27]=S,e[28]=y,e[29]=g,e[30]=C,e[31]=k,e[32]=D):D=e[32];let R;e[33]!==r||e[34]!==o||e[35]!==w?(R=(0,u.jsx)(oo,{diagnostics:r,draft:o,scrollRef:w}),e[33]=r,e[34]=o,e[35]=w,e[36]=R):R=e[36];let _;e[37]!==t||e[38]!==x?(_=t===null?void 0:`${x}-opt-${t.active.toString()}`,e[37]=t,e[38]=x,e[39]=_):_=e[39];let Q=t===null?void 0:x,j=t!==null,K;e[40]!==p?(K=p("SQL query"),e[40]=p,e[41]=K):K=e[41];let P;e[42]!==o||e[43]!==c||e[44]!==i.onBlur||e[45]!==i.onChange||e[46]!==i.onKeyDown||e[47]!==i.onScroll||e[48]!==i.onSelect||e[49]!==_||e[50]!==Q||e[51]!==j||e[52]!==K?(P=(0,u.jsx)("textarea",{"aria-activedescendant":_,"aria-autocomplete":"list","aria-controls":Q,"aria-expanded":j,"aria-label":K,className:`relative size-full resize-none bg-transparent outline-none ${Ze}`,"data-testid":"sql-input",onBlur:i.onBlur,onChange:i.onChange,onKeyDown:i.onKeyDown,onScroll:i.onScroll,onSelect:i.onSelect,placeholder:"SELECT * FROM \u2026",ref:c,role:"combobox",spellCheck:!1,value:o}),e[42]=o,e[43]=c,e[44]=i.onBlur,e[45]=i.onChange,e[46]=i.onKeyDown,e[47]=i.onScroll,e[48]=i.onSelect,e[49]=_,e[50]=Q,e[51]=j,e[52]=K,e[53]=P):P=e[53];let W;e[54]!==t||e[55]!==x||e[56]!==N?(W=(0,u.jsx)(Ln,{listboxId:x,onPick:N,state:t}),e[54]=t,e[55]=x,e[56]=N,e[57]=W):W=e[57];let F;e[58]!==R||e[59]!==P||e[60]!==W?(F=(0,u.jsxs)("div",{className:"relative min-w-0 flex-1 bg-background",children:[R,P,W]}),e[58]=R,e[59]=P,e[60]=W,e[61]=F):F=e[61];let L;e[62]!==D||e[63]!==F||e[64]!==q?(L=(0,u.jsxs)("div",{className:q,children:[D,F]}),e[62]=D,e[63]=F,e[64]=q,e[65]=L):L=e[65];let M;e[66]!==r||e[67]!==b?(M=(0,u.jsx)(so,{diagnostics:r,onSelect:b}),e[66]=r,e[67]=b,e[68]=M):M=e[68];let z;return e[69]!==L||e[70]!==M||e[71]!==E||e[72]!==T||e[73]!==I?(z=(0,u.jsxs)("div",{className:E,children:[T,I,L,M]}),e[69]=L,e[70]=M,e[71]=E,e[72]=T,e[73]=I,e[74]=z):z=e[74],z},"us");function po(s,e){return(0,u.jsx)("div",{children:e+1},e)}a(po,"fs");var Tt=[{label:"List tables",sql:"SELECT name FROM sqlite_master WHERE type = 'table' ORDER BY name;"},{label:"Table row count",sql:"SELECT COUNT(*) AS rows FROM messages;"},{label:"Recent rows",sql:"SELECT id, _creationTime, __doc__ FROM messages ORDER BY _creationTime DESC LIMIT 50;"},{label:"Index list",sql:"SELECT name, tbl_name FROM sqlite_master WHERE type = 'index' ORDER BY tbl_name;"}],bo=a(s=>{let e=(0,Z.c)(29),{active:n,onDelete:t,onSelect:r,query:o}=s,l=ae(),i;e[0]!==r||e[1]!==o.id?(i=a(()=>{r(o.id)},"i"),e[0]=r,e[1]=o.id,e[2]=i):i=e[2];let c=i,d;e[3]!==t||e[4]!==o.id?(d=a(C=>{C.stopPropagation(),t(o.id)},"a"),e[3]=t,e[4]=o.id,e[5]=d):d=e[5];let m=d,x=n?"bg-sidebar-accent font-medium text-foreground":"text-muted-foreground",h;e[6]!==x?(h=ue("flex min-w-0 flex-1 items-center gap-2 rounded-md px-2 py-1.5 text-start text-[13px] outline-none transition-colors hover:bg-sidebar-accent focus-visible:bg-sidebar-accent",x),e[6]=x,e[7]=h):h=e[7];let v=`sql-query-${o.id}`,f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=(0,u.jsx)("svg",{"aria-hidden":"true",className:"size-3.5 shrink-0 opacity-70",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,u.jsx)("path",{d:"M4 6h16M4 12h10M4 18h7"})}),e[8]=f):f=e[8];let N;e[9]!==o.name?(N=(0,u.jsx)("span",{className:"truncate",children:o.name}),e[9]=o.name,e[10]=N):N=e[10];let b;e[11]!==n||e[12]!==c||e[13]!==h||e[14]!==v||e[15]!==N?(b=(0,u.jsxs)("button",{"aria-pressed":n,className:h,"data-testid":v,onClick:c,type:"button",children:[f,N]}),e[11]=n,e[12]=c,e[13]=h,e[14]=v,e[15]=N,e[16]=b):b=e[16];let w;e[17]!==l?(w=l("Delete query"),e[17]=l,e[18]=w):w=e[18];let p;e[19]!==l?(p=l("Delete query"),e[19]=l,e[20]=p):p=e[20];let S;e[21]===Symbol.for("react.memo_cache_sentinel")?(S=(0,u.jsx)("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,u.jsx)("path",{d:"M5 7h14M9 7V5h6v2m-1 0v12H10V7M7 7v13h10V7"})}),e[21]=S):S=e[21];let y;e[22]!==m||e[23]!==p||e[24]!==w?(y=(0,u.jsx)("button",{"aria-label":w,className:"me-1 hidden size-6 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-destructive/10 hover:text-destructive group-hover/q:flex",onClick:m,title:p,type:"button",children:S}),e[22]=m,e[23]=p,e[24]=w,e[25]=y):y=e[25];let g;return e[26]!==y||e[27]!==b?(g=(0,u.jsxs)("li",{className:"group/q flex items-center",children:[b,y]}),e[26]=y,e[27]=b,e[28]=g):g=e[28],g},"ms"),bt="sql-history-remember",go=a((s,e)=>{let n=e.trim().toLowerCase();return n===""?[...s]:s.filter(t=>t.name.toLowerCase().includes(n))},"ps"),xo=a(s=>{let e=(0,Z.c)(66),{activeId:n,history:t,listRef:r,onClearHistory:o,onDelete:l,onLoadHistory:i,onLoadTemplate:c,onNew:d,onSearchChange:m,onSelect:x,onToggleRememberHistory:h,queries:v,rememberHistory:f,search:N}=s,b=ae(),w,p,S,y,g;if(e[0]!==n||e[1]!==r||e[2]!==l||e[3]!==d||e[4]!==m||e[5]!==x||e[6]!==h||e[7]!==v||e[8]!==N||e[9]!==b){let _=go(v,N),Q;e[15]!==h?(Q=a($=>{h($.target.checked)},"F"),e[15]=h,e[16]=Q):Q=e[16],w=Q,S="flex h-full w-64 shrink-0 flex-col border-e border-border bg-sidebar";let j;e[17]!==b?(j=b("Search queries\u2026"),e[17]=b,e[18]=j):j=e[18];let K;e[19]!==m||e[20]!==N||e[21]!==j?(K=(0,u.jsx)("input",{className:"h-8 min-w-0 flex-1 rounded-md border border-border bg-background px-2 text-xs outline-none focus-visible:border-ring","data-testid":"sql-search",onChange:m,placeholder:j,type:"text",value:N}),e[19]=m,e[20]=N,e[21]=j,e[22]=K):K=e[22];let P;e[23]!==b?(P=b("New query"),e[23]=b,e[24]=P):P=e[24];let W;e[25]!==b?(W=b("New query"),e[25]=b,e[26]=W):W=e[26];let F;e[27]===Symbol.for("react.memo_cache_sentinel")?(F=(0,u.jsx)("svg",{"aria-hidden":"true",className:"size-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.7,viewBox:"0 0 24 24",children:(0,u.jsx)("path",{d:"M12 5v14M5 12h14"})}),e[27]=F):F=e[27];let L;e[28]!==d||e[29]!==P||e[30]!==W?(L=(0,u.jsx)("button",{"aria-label":P,className:"flex size-8 shrink-0 items-center justify-center rounded-md border border-border text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent","data-testid":"sql-new",onClick:d,title:W,type:"button",children:F}),e[28]=d,e[29]=P,e[30]=W,e[31]=L):L=e[31],e[32]!==L||e[33]!==K?(y=(0,u.jsxs)("div",{className:"flex shrink-0 items-center gap-2 border-b border-border p-2",children:[K,L]}),e[32]=L,e[33]=K,e[34]=y):y=e[34],p="flex flex-1 flex-col gap-4 overflow-y-auto p-2";let M;e[35]!==b?(M=b("Private"),e[35]=b,e[36]=M):M=e[36];let z;e[37]!==M?(z=(0,u.jsx)("p",{className:"px-1 pb-1 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:M}),e[37]=M,e[38]=z):z=e[38],g=(0,u.jsxs)("div",{children:[z,_.length===0?(0,u.jsx)("p",{className:"px-1 py-2 text-xs text-muted-foreground","data-testid":"sql-private-empty",children:b("No saved queries yet \u2014 they save to this browser as you type.")}):(0,u.jsx)("ul",{className:"flex flex-col gap-px","data-testid":"sql-private",ref:r,children:_.map($=>(0,u.jsx)(bo,{active:n===$.id,onDelete:l,onSelect:x,query:$},$.id))})]}),e[0]=n,e[1]=r,e[2]=l,e[3]=d,e[4]=m,e[5]=x,e[6]=h,e[7]=v,e[8]=N,e[9]=b,e[10]=w,e[11]=p,e[12]=S,e[13]=y,e[14]=g}else w=e[10],p=e[11],S=e[12],y=e[13],g=e[14];let C;e[39]!==b?(C=b("Reference"),e[39]=b,e[40]=C):C=e[40];let k;e[41]!==C?(k=(0,u.jsx)("p",{className:"px-1 pb-1 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:C}),e[41]=C,e[42]=k):k=e[42];let q;e[43]!==c?(q=Tt.map(_=>(0,u.jsx)("li",{children:(0,u.jsxs)("button",{className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-start text-[13px] text-muted-foreground outline-none transition-colors hover:bg-sidebar-accent hover:text-foreground focus-visible:bg-sidebar-accent","data-sql":_.sql,onClick:c,type:"button",children:[(0,u.jsx)("svg",{"aria-hidden":"true",className:"size-3.5 shrink-0 opacity-70",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,u.jsx)("path",{d:"M7 4h7l4 4v12H7zM14 4v4h4"})}),_.label]})},_.label)),e[43]=c,e[44]=q):q=e[44];let E;e[45]!==q?(E=(0,u.jsx)("ul",{className:"flex flex-col gap-px",children:q}),e[45]=q,e[46]=E):E=e[46];let T;e[47]!==k||e[48]!==E?(T=(0,u.jsxs)("div",{children:[k,E]}),e[47]=k,e[48]=E,e[49]=T):T=e[49];let I;e[50]!==t||e[51]!==o||e[52]!==i||e[53]!==w||e[54]!==f||e[55]!==b?(I=t.length>0&&(0,u.jsxs)("div",{children:[(0,u.jsxs)("div",{className:"flex items-center justify-between px-1 pb-1",children:[(0,u.jsx)("p",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:b("History")}),(0,u.jsx)("button",{className:"rounded px-1 text-[11px] text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:text-foreground","data-testid":"sql-history-clear",onClick:o,type:"button",children:b("Clear history")})]}),(0,u.jsxs)("label",{className:"flex cursor-pointer items-center gap-1.5 px-1 pb-1.5 text-[11px] text-muted-foreground",htmlFor:bt,children:[(0,u.jsx)("input",{checked:f,"data-testid":"sql-history-remember",id:bt,onChange:w,type:"checkbox"}),b("Keep history on this browser")]}),(0,u.jsx)("ul",{className:"flex flex-col gap-px","data-testid":"sql-history",children:t.map(_=>(0,u.jsx)("li",{children:(0,u.jsxs)("button",{className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-start text-[13px] text-muted-foreground outline-none transition-colors hover:bg-sidebar-accent hover:text-foreground focus-visible:bg-sidebar-accent","data-sql":_.sql,"data-testid":"sql-history-item",onClick:i,title:_.sql,type:"button",children:[(0,u.jsx)("svg",{"aria-hidden":"true",className:"size-3.5 shrink-0 opacity-70",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,u.jsx)("path",{d:"M12 8v4l3 2M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18Z"})}),(0,u.jsx)("span",{className:"truncate font-mono",children:_.sql})]})},`${_.at.toString()}:${_.sql}`))})]}),e[50]=t,e[51]=o,e[52]=i,e[53]=w,e[54]=f,e[55]=b,e[56]=I):I=e[56];let D;e[57]!==p||e[58]!==I||e[59]!==g||e[60]!==T?(D=(0,u.jsxs)("div",{className:p,children:[g,T,I]}),e[57]=p,e[58]=I,e[59]=g,e[60]=T,e[61]=D):D=e[61];let R;return e[62]!==D||e[63]!==S||e[64]!==y?(R=(0,u.jsxs)("aside",{className:S,children:[y,D]}),e[62]=D,e[63]=S,e[64]=y,e[65]=R):R=e[65],R},"hs"),Pe=a(s=>`border-b-2 px-3 py-2 text-sm outline-none transition-colors ${s?"border-foreground font-medium text-foreground":"border-transparent text-muted-foreground hover:text-foreground"}`,"qe"),vo=a(s=>{let e=(0,Z.c)(96),{assistant:n,chart:t,className:r,error:o,onFormat:l,onInferChart:i,onRun:c,onSelectStatement:d,onShardKeyChange:m,onShowChart:x,onShowExplain:h,onShowResults:v,onToggleSplit:f,pane:N,result:b,running:w,script:p,shardKey:S,splitView:y}=s,g=ae(),C=N==="results",k;e[0]!==C?(k=Pe(C),e[0]=C,e[1]=k):k=e[1];let q;e[2]!==g?(q=g("Results"),e[2]=g,e[3]=q):q=e[3];let E;e[4]!==v||e[5]!==k||e[6]!==q?(E=(0,u.jsx)("button",{className:k,"data-testid":"sql-tab-results",onClick:v,type:"button",children:q}),e[4]=v,e[5]=k,e[6]=q,e[7]=E):E=e[7];let T=N==="chart",I;e[8]!==T?(I=Pe(T),e[8]=T,e[9]=I):I=e[9];let D;e[10]!==g?(D=g("Chart"),e[10]=g,e[11]=D):D=e[11];let R;e[12]!==x||e[13]!==I||e[14]!==D?(R=(0,u.jsx)("button",{className:I,"data-testid":"sql-tab-chart",onClick:x,type:"button",children:D}),e[12]=x,e[13]=I,e[14]=D,e[15]=R):R=e[15];let _;e[16]!==n||e[17]!==i||e[18]!==N||e[19]!==b||e[20]!==g?(_=!n.unavailable&&N==="chart"&&b!==null&&(0,u.jsx)("button",{className:Pe(!1),"data-testid":"sql-infer-chart",disabled:n.pending("chart"),onClick:i,type:"button",children:n.pending("chart")?g("Thinking\u2026"):g("Suggest chart")}),e[16]=n,e[17]=i,e[18]=N,e[19]=b,e[20]=g,e[21]=_):_=e[21];let Q=N==="explain",j;e[22]!==Q?(j=Pe(Q),e[22]=Q,e[23]=j):j=e[23];let K;e[24]!==g?(K=g("Explain"),e[24]=g,e[25]=K):K=e[25];let P;e[26]!==h||e[27]!==j||e[28]!==K?(P=(0,u.jsx)("button",{className:j,"data-testid":"sql-tab-explain",onClick:h,type:"button",children:K}),e[26]=h,e[27]=j,e[28]=K,e[29]=P):P=e[29];let W;e[30]!==g?(W=g("Split editor and results"),e[30]=g,e[31]=W):W=e[31];let F=`inline-flex items-center rounded-md border border-border px-2 py-1.5 outline-none transition-colors hover:bg-accent focus-visible:bg-accent ${y?"bg-accent text-foreground":"text-muted-foreground"}`,L;e[32]!==g?(L=g("Split editor and results"),e[32]=g,e[33]=L):L=e[33];let M;e[34]===Symbol.for("react.memo_cache_sentinel")?(M=(0,u.jsxs)("svg",{"aria-hidden":"true",className:"size-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.7,viewBox:"0 0 24 24",children:[(0,u.jsx)("rect",{height:"16",rx:"2",width:"18",x:"3",y:"4"}),(0,u.jsx)("path",{d:"M12 4v16"})]}),e[34]=M):M=e[34];let z;e[35]!==f||e[36]!==y||e[37]!==W||e[38]!==F||e[39]!==L?(z=(0,u.jsx)("button",{"aria-label":W,"aria-pressed":y,className:F,"data-testid":"sql-split-toggle",onClick:f,title:L,type:"button",children:M}),e[35]=f,e[36]=y,e[37]=W,e[38]=F,e[39]=L,e[40]=z):z=e[40];let $;e[41]!==b?($=b!==null&&b.columns.length>0&&(0,u.jsx)(at,{columns:b.columns,name:"query-result",rows:b.rows}),e[41]=b,e[42]=$):$=e[42];let te;e[43]!==g?(te=g("Format"),e[43]=g,e[44]=te):te=e[44];let V;e[45]!==l||e[46]!==w||e[47]!==te?(V=(0,u.jsx)("button",{className:"inline-flex items-center 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","data-testid":"sql-format",disabled:w,onClick:l,type:"button",children:te}),e[45]=l,e[46]=w,e[47]=te,e[48]=V):V=e[48];let ee;e[49]!==m||e[50]!==S?(ee=(0,u.jsx)(rt,{onChange:m,testId:"sql-shard-input",value:S}),e[49]=m,e[50]=S,e[51]=ee):ee=e[51];let A;e[52]!==w||e[53]!==g?(A=g(w?"Running\u2026":"Run"),e[52]=w,e[53]=g,e[54]=A):A=e[54];let U;e[55]===Symbol.for("react.memo_cache_sentinel")?(U=(0,u.jsx)("kbd",{className:"rounded border border-primary-foreground/30 px-1 font-sans text-[10px]",children:"\u2318\u21B5"}),e[55]=U):U=e[55];let G;e[56]!==c||e[57]!==w||e[58]!==A?(G=(0,u.jsxs)("button",{className:"inline-flex items-center gap-1.5 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","data-testid":"sql-run",disabled:w,onClick:c,type:"button",children:[A,U]}),e[56]=c,e[57]=w,e[58]=A,e[59]=G):G=e[59];let Y;e[60]!==z||e[61]!==$||e[62]!==V||e[63]!==ee||e[64]!==G?(Y=(0,u.jsxs)("div",{className:"ms-auto flex items-center gap-2",children:[z,$,V,ee,G]}),e[60]=z,e[61]=$,e[62]=V,e[63]=ee,e[64]=G,e[65]=Y):Y=e[65];let O;e[66]!==P||e[67]!==Y||e[68]!==E||e[69]!==R||e[70]!==_?(O=(0,u.jsxs)("div",{className:"flex shrink-0 items-center gap-2 border-b border-border pe-2",children:[E,R,_,P,Y]}),e[66]=P,e[67]=Y,e[68]=E,e[69]=R,e[70]=_,e[71]=O):O=e[71];let oe;e[72]!==d||e[73]!==p?(oe=p!==void 0&&(0,u.jsx)("div",{className:"flex shrink-0 flex-wrap items-center gap-1 border-b border-border px-3 py-1.5","data-testid":"sql-statements",children:p.runs.map((X,re)=>(0,u.jsx)("button",{"aria-pressed":re===p.selected,className:`rounded-md border px-2 py-0.5 font-mono text-[11px] outline-none transition-colors ${re===p.selected?"border-foreground text-foreground":"border-border text-muted-foreground hover:text-foreground"} ${X.error===null?"":"border-destructive/50 text-destructive"}`,"data-testid":`sql-statement-${re.toString()}`,onClick:a(()=>{d(re)},"onClick"),title:X.sql,type:"button",children:re+1},`${re.toString()}:${X.sql}`))}),e[72]=d,e[73]=p,e[74]=oe):oe=e[74];let se;e[75]!==o?(se=o!==null&&(0,u.jsx)(st,{className:"m-3 font-mono text-xs",testId:"sql-error",variant:"destructive",children:o}),e[75]=o,e[76]=se):se=e[76];let le;e[77]!==o||e[78]!==b||e[79]!==g?(le=o===null&&b===null&&(0,u.jsx)("p",{className:"p-4 text-sm text-muted-foreground","data-testid":"sql-empty",children:g("Click Run to execute your query.")}),e[77]=o,e[78]=b,e[79]=g,e[80]=le):le=e[80];let ie;e[81]!==t||e[82]!==o||e[83]!==N||e[84]!==b||e[85]!==g?(ie=o===null&&b!==null&&(0,u.jsxs)("div",{"data-testid":"sql-result",children:[N==="chart"?(0,u.jsx)(ct,{axes:t,result:b}):(0,u.jsx)(dt,{result:b}),(0,u.jsx)("p",{className:"border-t border-border px-3 py-1.5 text-xs text-muted-foreground","data-testid":"sql-count",children:b.truncated?g("Showing the first {max} rows.",{max:b.rows.length}):g("{count} rows",{count:b.rowCount})})]}),e[81]=t,e[82]=o,e[83]=N,e[84]=b,e[85]=g,e[86]=ie):ie=e[86];let H;e[87]!==se||e[88]!==le||e[89]!==ie?(H=(0,u.jsxs)("div",{className:"min-h-0 flex-1 overflow-auto",children:[se,le,ie]}),e[87]=se,e[88]=le,e[89]=ie,e[90]=H):H=e[90];let J;return e[91]!==r||e[92]!==O||e[93]!==oe||e[94]!==H?(J=(0,u.jsxs)("div",{className:r,children:[O,oe,H]}),e[91]=r,e[92]=O,e[93]=oe,e[94]=H,e[95]=J):J=e[95],J},"bs"),yo=a((s,e)=>s.trim()===""?e:(s.split(`
|
|
15
|
+
`)[0]??s).slice(0,24),"gs"),wo=a(s=>{s?.focus(),s?.select()},"xs"),So=a(s=>{let e=(0,Z.c)(14),{initial:n,onCancel:t,onCommit:r,placeholder:o,testId:l}=s,i=ae(),c;e[0]!==r?(c=a(f=>{r(f.currentTarget.value.trim())},"c"),e[0]=r,e[1]=c):c=e[1];let d=c,m;e[2]!==t||e[3]!==r?(m=a(f=>{f.key==="Enter"?r(f.currentTarget.value.trim()):f.key==="Escape"&&t()},"f"),e[2]=t,e[3]=r,e[4]=m):m=e[4];let x=m,h;e[5]!==i?(h=i("Tab title"),e[5]=i,e[6]=h):h=e[6];let v;return e[7]!==n||e[8]!==d||e[9]!==x||e[10]!==o||e[11]!==h||e[12]!==l?(v=(0,u.jsx)("input",{"aria-label":h,className:"w-40 rounded border border-ring bg-background px-1 py-0.5 text-xs outline-none","data-testid":l,defaultValue:n,onBlur:d,onKeyDown:x,placeholder:o,ref:wo,type:"text"}),e[7]=n,e[8]=d,e[9]=x,e[10]=o,e[11]=h,e[12]=l,e[13]=v):v=e[13],v},"ys"),Co=a(s=>{let e=(0,Z.c)(29),{idBase:n,onDiscard:t,onKeep:r}=s,o=ae(),l=`sql-tab-close-prompt-${n}`,i;e[0]!==o?(i=o("Discard?"),e[0]=o,e[1]=i):i=e[1];let c;e[2]!==i?(c=(0,u.jsx)("span",{className:"text-[11px] text-muted-foreground",children:i}),e[2]=i,e[3]=c):c=e[3];let d;e[4]!==o?(d=o("Discard changes"),e[4]=o,e[5]=d):d=e[5];let m=`sql-tab-close-confirm-${n}`,x;e[6]!==o?(x=o("Discard changes"),e[6]=o,e[7]=x):x=e[7];let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=(0,u.jsx)("svg",{"aria-hidden":"true",className:"size-3",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.4,viewBox:"0 0 24 24",children:(0,u.jsx)("path",{d:"M5 13l4 4L19 7"})}),e[8]=h):h=e[8];let v;e[9]!==t||e[10]!==d||e[11]!==m||e[12]!==x?(v=(0,u.jsx)("button",{"aria-label":d,className:"flex size-5 items-center justify-center rounded text-destructive hover:bg-destructive/10","data-testid":m,onClick:t,title:x,type:"button",children:h}),e[9]=t,e[10]=d,e[11]=m,e[12]=x,e[13]=v):v=e[13];let f;e[14]!==o?(f=o("Keep editing"),e[14]=o,e[15]=f):f=e[15];let N=`sql-tab-close-cancel-${n}`,b;e[16]!==o?(b=o("Keep editing"),e[16]=o,e[17]=b):b=e[17];let w;e[18]===Symbol.for("react.memo_cache_sentinel")?(w=(0,u.jsx)("svg",{"aria-hidden":"true",className:"size-3",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.4,viewBox:"0 0 24 24",children:(0,u.jsx)("path",{d:"M6 6l12 12M18 6 6 18"})}),e[18]=w):w=e[18];let p;e[19]!==r||e[20]!==N||e[21]!==b||e[22]!==f?(p=(0,u.jsx)("button",{"aria-label":f,className:"flex size-5 items-center justify-center rounded text-muted-foreground hover:bg-accent","data-testid":N,onClick:r,title:b,type:"button",children:w}),e[19]=r,e[20]=N,e[21]=b,e[22]=f,e[23]=p):p=e[23];let S;return e[24]!==l||e[25]!==p||e[26]!==c||e[27]!==v?(S=(0,u.jsxs)("span",{className:"flex shrink-0 items-center gap-1","data-testid":l,role:"group",children:[c,v,p]}),e[24]=l,e[25]=p,e[26]=c,e[27]=v,e[28]=S):S=e[28],S},"vs"),ko=a(s=>{let e=(0,Z.c)(47),{active:n,canClose:t,onClose:r,onMenu:o,onRename:l,onSelect:i,tab:c}=s,d=ae(),[m,x]=(0,B.useState)(!1),[h,v]=(0,B.useState)(!1),f;e[0]!==o||e[1]!==c.id?(f=a($=>{o(c.id,$)},"d"),e[0]=o,e[1]=c.id,e[2]=f):f=e[2];let N=f,b;e[3]!==i||e[4]!==c.id?(b=a(()=>{i(c.id)},"m"),e[3]=i,e[4]=c.id,e[5]=b):b=e[5];let w=b,p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=a(()=>{x(!0)},"b"),e[6]=p):p=e[6];let S=p,y;e[7]!==r||e[8]!==c?(y=a($=>{$.stopPropagation(),qt(c)?v(!0):r(c.id)},"v"),e[7]=r,e[8]=c,e[9]=y):y=e[9];let g=y,C;e[10]!==r||e[11]!==c.id?(C=a($=>{$.stopPropagation(),v(!1),r(c.id)},"E"),e[10]=r,e[11]=c.id,e[12]=C):C=e[12];let k=C,q;e[13]===Symbol.for("react.memo_cache_sentinel")?(q=a($=>{$.stopPropagation(),v(!1)},"T"),e[13]=q):q=e[13];let E=q,T;e[14]!==l||e[15]!==c.id?(T=a($=>{l(c.id,$),x(!1)},"R"),e[14]=l,e[15]=c.id,e[16]=T):T=e[16];let I=T,D;e[17]===Symbol.for("react.memo_cache_sentinel")?(D=a(()=>{x(!1)},"_"),e[17]=D):D=e[17];let R=D,_;e[18]!==c.name?(_=c.name.trim(),e[18]=c.name,e[19]=_):_=e[19];let Q=_,j;e[20]!==d||e[21]!==c.sql?(j=yo(c.sql,d("Untitled")),e[20]=d,e[21]=c.sql,e[22]=j):j=e[22];let K=j,P=n?"bg-background text-foreground":"bg-muted/40 text-muted-foreground hover:text-foreground",W;e[23]!==P?(W=ue("group/tab flex shrink-0 items-center gap-1 border-e border-border ps-3 pe-1.5 text-xs",P),e[23]=P,e[24]=W):W=e[24];let F=`sql-tab-${c.id}`,L;e[25]!==n||e[26]!==I||e[27]!==Q||e[28]!==K||e[29]!==m||e[30]!==w||e[31]!==d||e[32]!==c.id?(L=m?(0,u.jsx)(So,{initial:Q,onCancel:R,onCommit:I,placeholder:K,testId:`sql-tab-rename-${c.id}`}):(0,u.jsx)("button",{"aria-pressed":n,className:"max-w-40 truncate py-1.5 outline-none","data-testid":`sql-tab-select-${c.id}`,onClick:w,onDoubleClick:S,title:d("Double-click to rename"),type:"button",children:Q===""?K:Q}),e[25]=n,e[26]=I,e[27]=Q,e[28]=K,e[29]=m,e[30]=w,e[31]=d,e[32]=c.id,e[33]=L):L=e[33];let M;e[34]!==t||e[35]!==k||e[36]!==h||e[37]!==g||e[38]!==d||e[39]!==c.id?(M=t&&(h?(0,u.jsx)(Co,{idBase:c.id,onDiscard:k,onKeep:E}):(0,u.jsx)("button",{"aria-label":d("Close tab"),className:"flex size-5 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-destructive/10 hover:text-destructive","data-testid":`sql-tab-close-${c.id}`,onClick:g,title:d("Close tab"),type:"button",children:(0,u.jsx)("svg",{"aria-hidden":"true",className:"size-3",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",children:(0,u.jsx)("path",{d:"M6 6l12 12M18 6 6 18"})})})),e[34]=t,e[35]=k,e[36]=h,e[37]=g,e[38]=d,e[39]=c.id,e[40]=M):M=e[40];let z;return e[41]!==N||e[42]!==W||e[43]!==F||e[44]!==L||e[45]!==M?(z=(0,u.jsxs)("div",{className:W,"data-testid":F,onContextMenu:N,children:[L,M]}),e[41]=N,e[42]=W,e[43]=F,e[44]=L,e[45]=M,e[46]=z):z=e[46],z},"Ss"),No=a(s=>{let e=(0,Z.c)(43),{model:n,onSelect:t}=s,r=ae(),{activeTab:o,addEditorTab:l,cancelBulk:i,closeEditorTab:c,closeTabMenu:d,confirmBulk:m,menuStyle:x,onBackdropContextMenu:h,onCloseAll:v,onCloseOthers:f,onCloseToRight:N,openTabMenu:b,pendingBulk:w,renameTab:p,tabMenu:S,tabs:y}=n,g;if(e[0]!==o||e[1]!==c||e[2]!==t||e[3]!==b||e[4]!==p||e[5]!==y){let _;e[7]!==o||e[8]!==c||e[9]!==t||e[10]!==b||e[11]!==p||e[12]!==y.length?(_=a(Q=>(0,u.jsx)(ko,{active:Q.id===o.id,canClose:y.length>1,onClose:c,onMenu:b,onRename:p,onSelect:t,tab:Q},Q.id),"L"),e[7]=o,e[8]=c,e[9]=t,e[10]=b,e[11]=p,e[12]=y.length,e[13]=_):_=e[13],g=y.map(_),e[0]=o,e[1]=c,e[2]=t,e[3]=b,e[4]=p,e[5]=y,e[6]=g}else g=e[6];let C;e[14]!==r?(C=r("New tab"),e[14]=r,e[15]=C):C=e[15];let k=y.length>=Xe,q;e[16]!==r?(q=r("New tab"),e[16]=r,e[17]=q):q=e[17];let E;e[18]===Symbol.for("react.memo_cache_sentinel")?(E=(0,u.jsx)("svg",{"aria-hidden":"true",className:"size-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.7,viewBox:"0 0 24 24",children:(0,u.jsx)("path",{d:"M12 5v14M5 12h14"})}),e[18]=E):E=e[18];let T;e[19]!==l||e[20]!==C||e[21]!==k||e[22]!==q?(T=(0,u.jsx)("button",{"aria-label":C,className:"flex size-8 shrink-0 items-center justify-center text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-40","data-testid":"sql-tab-add",disabled:k,onClick:l,title:q,type:"button",children:E}),e[19]=l,e[20]=C,e[21]=k,e[22]=q,e[23]=T):T=e[23];let I;e[24]!==g||e[25]!==T?(I=(0,u.jsxs)("div",{className:"flex shrink-0 items-stretch overflow-x-auto border-b border-border bg-muted/30","data-testid":"sql-tab-strip",role:"tablist",children:[g,T]}),e[24]=g,e[25]=T,e[26]=I):I=e[26];let D;e[27]!==i||e[28]!==d||e[29]!==m||e[30]!==x||e[31]!==h||e[32]!==v||e[33]!==f||e[34]!==N||e[35]!==w||e[36]!==r||e[37]!==S||e[38]!==y?(D=S!==null&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("div",{className:"fixed inset-0 z-40","data-testid":"sql-tab-menu-backdrop",onClick:d,onContextMenu:h,role:"presentation"}),(0,u.jsx)("div",{className:"fixed z-50 min-w-44 rounded-md border border-border bg-popover py-1 text-popover-foreground shadow-md","data-testid":"sql-tab-menu",role:"menu",style:x,children:w===null?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("button",{className:"flex w-full items-center px-3 py-1.5 text-start text-xs outline-none hover:bg-accent focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-40","data-testid":"sql-tab-menu-close-others",disabled:y.length<=1,onClick:f,role:"menuitem",type:"button",children:r("Close other tabs")}),(0,u.jsx)("button",{className:"flex w-full items-center px-3 py-1.5 text-start text-xs outline-none hover:bg-accent focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-40","data-testid":"sql-tab-menu-close-right",disabled:y.findIndex(_=>_.id===S.id)>=y.length-1,onClick:N,role:"menuitem",type:"button",children:r("Close tabs to the right")}),(0,u.jsx)("button",{className:"flex w-full items-center px-3 py-1.5 text-start text-xs outline-none hover:bg-accent focus-visible:bg-accent","data-testid":"sql-tab-menu-close-all",onClick:v,role:"menuitem",type:"button",children:r("Close all tabs")})]}):(0,u.jsxs)("div",{className:"px-3 py-1.5","data-testid":"sql-tab-menu-confirm",children:[(0,u.jsx)("p",{className:"pb-1.5 text-xs text-muted-foreground",children:r("Discard unsaved tabs?")}),(0,u.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,u.jsx)("button",{className:"rounded px-2 py-1 text-xs font-medium text-destructive outline-none hover:bg-destructive/10 focus-visible:bg-destructive/10","data-testid":"sql-tab-menu-confirm-discard",onClick:m,type:"button",children:r("Discard")}),(0,u.jsx)("button",{className:"rounded px-2 py-1 text-xs text-muted-foreground outline-none hover:bg-accent focus-visible:bg-accent","data-testid":"sql-tab-menu-confirm-cancel",onClick:i,type:"button",children:r("Cancel")})]})]})})]}),e[27]=i,e[28]=d,e[29]=m,e[30]=x,e[31]=h,e[32]=v,e[33]=f,e[34]=N,e[35]=w,e[36]=r,e[37]=S,e[38]=y,e[39]=D):D=e[39];let R;return e[40]!==I||e[41]!==D?(R=(0,u.jsxs)(u.Fragment,{children:[I,D]}),e[40]=I,e[41]=D,e[42]=R):R=e[42],R},"ws"),qo=Se(ke.runSql),Eo="lunora-studio-sql-split-view",To=a(()=>Ee(Tt[0]?.sql??""),"Ns"),Xo=a(s=>{let e=(0,Z.c)(117),{initialShardKey:n}=s,t=_e(),r=Gn(To),{activeTab:o,output:l,patchActiveOutput:i,patchActiveTab:c,setActiveTabId:d,unlinkQuery:m}=r,x;e[0]!==i||e[1]!==c?(x=a((ne,ce)=>{c({activeId:ce,sql:ne}),i({chart:void 0,error:null,failed:void 0,result:null,script:void 0})},"g"),e[0]=i,e[1]=c,e[2]=x):x=e[2];let h=x,v;e[3]!==h||e[4]!==m?(v={loadIntoActiveTab:h,unlinkQuery:m},e[3]=h,e[4]=m,e[5]=v):v=e[5];let f=eo(v),{recordHistory:N,updateQuerySql:b}=f,w=o.sql,{activeId:p}=o,{chart:S,error:y,failed:g,result:C,running:k}=l,q=l.pane,[E,T]=(0,B.useState)(n??""),[I,D]=Ae(Eo,!1),{probe:R,schema:_}=Dn(E),Q;e[6]!==p||e[7]!==c||e[8]!==b?(Q=a(ne=>{c({sql:ne}),p!==null&&b(p,ne)},"F"),e[6]=p,e[7]=c,e[8]=b,e[9]=Q):Q=e[9];let j=Q,K=gn(w,_,E),P=it(E),W;e[10]!==P||e[11]!==i||e[12]!==C?(W=a(()=>{C!==null&&me((async()=>{let ne=await P.inferChart({columns:C.columns,rowCount:C.rowCount,types:Object.fromEntries(C.columns.map(ce=>[ce,typeof(C.rows[0]?.[ce]??"")]))});i({chart:ne})})())},"W"),e[10]=P,e[11]=i,e[12]=C,e[13]=W):W=e[13];let F=W,L;e[14]!==t||e[15]!==N||e[16]!==E?(L=a(async ne=>{try{let ce=await t.query(qo,{sql:ne},Ce(E));return N(ne),{error:null,result:ce,sql:ne}}catch(ce){return{error:tt(ce),result:null,sql:ne}}},"I"),e[14]=t,e[15]=N,e[16]=E,e[17]=L):L=e[17];let M=L,z;e[18]!==w||e[19]!==i||e[20]!==M||e[21]!==E?(z=a(async ne=>{if(w.trim()==="")return;i({running:!0});let ce=ne==="explain"?Ye(Bt(w),0):wt(w),de=[];for(let Re of ce){let It={error:Re.rejection?.message??"",result:null,sql:Re.sql};de.push(Re.rejection===void 0?await M(Re.sql):It)}ot(E);let et=Math.max(de.length-1,0),ye=de[et];i({chart:void 0,error:ye?.error??null,failed:ye?.error===null||ye===void 0?void 0:{error:ye.error,sql:ye.sql},pane:ne,result:ye?.result??null,running:!1,script:de.length>1?{runs:de,selected:et}:void 0})},"K"),e[18]=w,e[19]=i,e[20]=M,e[21]=E,e[22]=z):z=e[22];let $=z,te;e[23]!==l.script?.runs||e[24]!==i?(te=a(ne=>{let ce=l.script?.runs,de=ce?.[ne];ce===void 0||de===void 0||i({chart:void 0,error:de.error,failed:de.error===null?void 0:{error:de.error,sql:de.sql},result:de.result,script:{runs:ce,selected:ne}})},"ee"),e[23]=l.script?.runs,e[24]=i,e[25]=te):te=e[25];let V=te,ee;e[26]!==$?(ee=a(()=>{me($("results"))},"Z"),e[26]=$,e[27]=ee):ee=e[27];let A=ee,U=!P.unavailable,G;e[28]!==l.pane||e[29]!==$?(G=a(()=>{me($(l.pane))},"j"),e[28]=l.pane,e[29]=$,e[30]=G):G=e[30];let Y;e[31]!==R||e[32]!==_||e[33]!==j||e[34]!==G||e[35]!==U?(Y={inlineEditEnabled:U,onSubmit:G,probe:R,schema:_,setDraft:j},e[31]=R,e[32]=_,e[33]=j,e[34]=G,e[35]=U,e[36]=Y):Y=e[36];let O=Pn(Y),{closeAutocomplete:oe,closeInlineEdit:se}=O,le;e[37]!==w||e[38]!==j?(le=a(()=>{j(Jt(w))},"ie"),e[37]=w,e[38]=j,e[39]=le):le=e[39];let ie=le,H;e[40]!==oe||e[41]!==se||e[42]!==d?(H=a(ne=>{oe(),se(),d(ne)},"P"),e[40]=oe,e[41]=se,e[42]=d,e[43]=H):H=e[43];let J=H,X;e[44]!==i?(X=a(()=>{i({pane:"results"})},"V"),e[44]=i,e[45]=X):X=e[45];let re=X,fe;e[46]!==$?(fe=a(()=>{me($("explain"))},"pe"),e[46]=$,e[47]=fe):fe=e[47];let je=fe,Te;e[48]!==i?(Te=a(()=>{i({pane:"chart"})},"ke"),e[48]=i,e[49]=Te):Te=e[49];let ze=Te,Ie;e[50]!==D||e[51]!==I?(Ie=a(()=>{D(!I)},"Te"),e[50]=D,e[51]=I,e[52]=Ie):Ie=e[52];let He=Ie,We=I?"flex min-h-0 flex-1 flex-row":"flex min-h-0 flex-1 flex-col",Be=I?"flex w-2/5 min-h-0 min-w-0 shrink-0 flex-col border-s border-border":"flex h-2/5 min-h-0 shrink-0 flex-col border-t border-border",he;e[53]!==p||e[54]!==f.clearHistory||e[55]!==f.deleteQuery||e[56]!==f.history||e[57]!==f.listRef||e[58]!==f.loadFromHistory||e[59]!==f.loadTemplate||e[60]!==f.newQuery||e[61]!==f.onSearchChange||e[62]!==f.queries||e[63]!==f.rememberHistory||e[64]!==f.search||e[65]!==f.selectQuery||e[66]!==f.setRememberHistory?(he=(0,u.jsx)(xo,{activeId:p,history:f.history,listRef:f.listRef,onClearHistory:f.clearHistory,onDelete:f.deleteQuery,onLoadHistory:f.loadFromHistory,onLoadTemplate:f.loadTemplate,onNew:f.newQuery,onSearchChange:f.onSearchChange,onSelect:f.selectQuery,onToggleRememberHistory:f.setRememberHistory,queries:f.queries,rememberHistory:f.rememberHistory,search:f.search}),e[53]=p,e[54]=f.clearHistory,e[55]=f.deleteQuery,e[56]=f.history,e[57]=f.listRef,e[58]=f.loadFromHistory,e[59]=f.loadTemplate,e[60]=f.newQuery,e[61]=f.onSearchChange,e[62]=f.queries,e[63]=f.rememberHistory,e[64]=f.search,e[65]=f.selectQuery,e[66]=f.setRememberHistory,e[67]=he):he=e[67];let pe;e[68]!==r||e[69]!==J?(pe=(0,u.jsx)(No,{model:r,onSelect:J}),e[68]=r,e[69]=J,e[70]=pe):pe=e[70];let be;e[71]!==P||e[72]!==K||e[73]!==w||e[74]!==g||e[75]!==j||e[76]!==O.acceptInlineEdit||e[77]!==O.autocompleteState||e[78]!==O.closeInlineEdit||e[79]!==O.editorRef||e[80]!==O.gutterRef||e[81]!==O.handlers||e[82]!==O.inlineEdit||e[83]!==O.listboxId||e[84]!==O.onPickSuggestion||e[85]!==O.overlayRef||e[86]!==O.revealDiagnostic?(be=(0,u.jsx)(ho,{assistant:P,autocomplete:O.autocompleteState,diagnostics:K,draft:w,editorRef:O.editorRef,failed:g,gutterRef:O.gutterRef,handlers:O.handlers,inlineEdit:O.inlineEdit,listboxId:O.listboxId,onAcceptInlineEdit:O.acceptInlineEdit,onCancelInlineEdit:O.closeInlineEdit,onGenerated:j,onPickSuggestion:O.onPickSuggestion,onRevealDiagnostic:O.revealDiagnostic,overlayRef:O.overlayRef}),e[71]=P,e[72]=K,e[73]=w,e[74]=g,e[75]=j,e[76]=O.acceptInlineEdit,e[77]=O.autocompleteState,e[78]=O.closeInlineEdit,e[79]=O.editorRef,e[80]=O.gutterRef,e[81]=O.handlers,e[82]=O.inlineEdit,e[83]=O.listboxId,e[84]=O.onPickSuggestion,e[85]=O.overlayRef,e[86]=O.revealDiagnostic,e[87]=be):be=e[87];let ge;e[88]!==P||e[89]!==y||e[90]!==ie||e[91]!==F||e[92]!==S||e[93]!==A||e[94]!==V||e[95]!==l.script||e[96]!==C||e[97]!==Be||e[98]!==k||e[99]!==E||e[100]!==ze||e[101]!==je||e[102]!==re||e[103]!==I||e[104]!==q||e[105]!==He?(ge=(0,u.jsx)(vo,{assistant:P,chart:S,className:Be,error:y,onFormat:ie,onInferChart:F,onRun:A,onSelectStatement:V,onShardKeyChange:T,onShowChart:ze,onShowExplain:je,onShowResults:re,onToggleSplit:He,pane:q,result:C,running:k,script:l.script,shardKey:E,splitView:I}),e[88]=P,e[89]=y,e[90]=ie,e[91]=F,e[92]=S,e[93]=A,e[94]=V,e[95]=l.script,e[96]=C,e[97]=Be,e[98]=k,e[99]=E,e[100]=ze,e[101]=je,e[102]=re,e[103]=I,e[104]=q,e[105]=He,e[106]=ge):ge=e[106];let xe;e[107]!==be||e[108]!==ge||e[109]!==We?(xe=(0,u.jsxs)("div",{className:We,children:[be,ge]}),e[107]=be,e[108]=ge,e[109]=We,e[110]=xe):xe=e[110];let ve;e[111]!==pe||e[112]!==xe?(ve=(0,u.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[pe,xe]}),e[111]=pe,e[112]=xe,e[113]=ve):ve=e[113];let Le;return e[114]!==he||e[115]!==ve?(Le=(0,u.jsxs)("div",{className:"flex h-full min-w-0","data-testid":"lunora-sql-editor",children:[he,ve]}),e[114]=he,e[115]=ve,e[116]=Le):Le=e[116],Le},"Qs");export{Xo as SqlEditorPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as O,b as D}from"./chunk-5B2RTXBS.js";import{a as F}from"./chunk-EWMBX5N2.js";import{a as j}from"./chunk-R6U22RSY.js";import{a as V}from"./chunk-7Q256NLI.js";import"./chunk-ZKJS6EBE.js";import"./chunk-RGMVGZV4.js";import{i as L}from"./chunk-E4PXACVL.js";import"./chunk-MVWZMWPD.js";import"./chunk-7Y3SY37W.js";import"./chunk-AUAECCXB.js";import{b as C}from"./chunk-Q6ED4KUL.js";import"./chunk-BOMPSVRC.js";import{a as z}from"./chunk-4ZPDCXIA.js";import"./chunk-NCPW7WHO.js";import"./chunk-CLXX5RVY.js";import"./chunk-55UGUCQ6.js";import{a as T}from"./chunk-4ZEL6BYL.js";import{c as R}from"./chunk-ZBHXISOD.js";import"./chunk-X6XAMP4E.js";import"./chunk-QAQDMS6R.js";import"./chunk-NRAAYZ4C.js";import{a as k}from"./chunk-RWVIV3U7.js";import{a as A,b as q,c as B,d as p,e as d,f as n}from"./chunk-HCTJKP5J.js";import{a as I,e as E}from"./chunk-2IKDEUCX.js";import{d as b,n as K,u as M}from"./chunk-74IYYDDI.js";import{a as i,d as y,e as ee,g as te}from"./chunk-I26MS5PJ.js";var s=y(ee(),1);var e=y(te(),1);var re=i(o=>o===void 0?"":JSON.stringify(o,K),"te"),ae=41,J=480,H=5,ie=i((o,t)=>O(o,l=>{t(l.height>0?l:{height:J,width:l.width})}),"ae"),Ne=i(({initialShardKey:o})=>{let t=b(),{queryShardKey:l,setShardKey:P,shardKey:U}=j(o),[h,W]=(0,s.useState)(""),{data:f,error:g,errorSource:Z,isLoading:_,liveError:G}=R(T.getAuditLog,{},{live:!0,shardKey:l}),c=(0,s.useMemo)(()=>f?.entries??[],[f]),m=(0,s.useMemo)(()=>{let a=h.trim().toLowerCase();return a===""?c:c.filter(r=>r.op.toLowerCase().includes(a)||(r.table??"").toLowerCase().includes(a)||(r.id??"").toLowerCase().includes(a))},[c,h]),x=(0,s.useRef)(null),v=D({count:m.length,estimateSize:i(()=>ae,"estimateSize"),getScrollElement:i(()=>x.current,"getScrollElement"),initialRect:{height:J,width:800},observeElementRect:ie,overscan:8}),u=v.getVirtualItems(),Q=v.getTotalSize(),N=u[0]?.start??0,w=Q-(u.at(-1)?.end??0),X={height:N},Y={height:w},$=i(a=>{W(a.target.value)},"z");return(0,e.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-audit",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsx)(V,{onChange:P,testId:"au-shard-input",value:U}),(0,e.jsx)(F,{message:G,prefix:"au"}),(0,e.jsx)(L,{"aria-label":t("Filter audit log"),className:"h-8 w-48","data-testid":"au-search",onChange:$,placeholder:t("filter op, table, id"),value:h})]}),g!==null&&(0,e.jsx)(z,{error:Z,testId:"au-error"}),g===null&&!_&&m.length===0&&(0,e.jsx)(k,{description:t("State-changing admin operations are recorded here."),icon:(0,e.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,e.jsx)("path",{d:"M8 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2h-2M9 3a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1V3Zm-1 9h8m-8 4h5"})}),testId:"au-empty",title:t("No audit entries.")}),m.length>0&&(0,e.jsx)(I,{className:"overflow-hidden py-0",children:(0,e.jsx)(E,{className:"max-h-[30rem] overflow-auto px-0",ref:x,children:(0,e.jsxs)(A,{"data-testid":"au-table",children:[(0,e.jsx)(q,{children:(0,e.jsxs)(p,{children:[(0,e.jsx)(d,{children:t("time")}),(0,e.jsx)(d,{children:t("op")}),(0,e.jsx)(d,{children:t("table")}),(0,e.jsx)(d,{children:t("id")}),(0,e.jsx)(d,{children:t("detail")})]})}),(0,e.jsxs)(B,{children:[N>0&&(0,e.jsx)("tr",{"aria-hidden":"true",children:(0,e.jsx)("td",{colSpan:H,style:X})}),u.map(a=>{let r=m[a.index],S=re(r.detail);return(0,e.jsxs)(p,{"data-testid":"au-row",children:[(0,e.jsx)(n,{className:"text-muted-foreground tabular-nums",children:M(r.ts,"\u2014")}),(0,e.jsx)(n,{children:(0,e.jsx)(C,{variant:"secondary",children:r.op})}),(0,e.jsx)(n,{className:"font-medium",children:r.table??(0,e.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})}),(0,e.jsx)(n,{className:"max-w-[20ch] truncate font-mono text-xs",children:r.id??(0,e.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})}),(0,e.jsx)(n,{className:"max-w-[32ch] truncate font-mono text-xs text-muted-foreground",title:S||void 0,children:S||(0,e.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})})]},r.seq)}),w>0&&(0,e.jsx)("tr",{"aria-hidden":"true",children:(0,e.jsx)("td",{colSpan:H,style:Y})})]})]})})})]})},"we");export{Ne as AuditPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as c}from"./chunk-VESGIGMQ.js";import{i as e}from"./chunk-OQ6I6OXT.js";import{q as m}from"./chunk-74IYYDDI.js";import{a as s,d as p,f as n}from"./chunk-I26MS5PJ.js";var f=p(n(),1);var h=s(r=>{let t=(0,f.c)(3),a=e(),o;return t[0]!==a||t[1]!==r?(o=s(i=>{c({shardKey:r,traceId:i}),m(a({to:"/traces"}))},"e"),t[0]=a,t[1]=r,t[2]=o):o=t[2],o},"u");export{h as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as g}from"./chunk-EFXC3EHZ.js";import"./chunk-4ZPDCXIA.js";import"./chunk-NCPW7WHO.js";import"./chunk-CLXX5RVY.js";import"./chunk-55UGUCQ6.js";import{a as f}from"./chunk-4ZEL6BYL.js";import{c as m}from"./chunk-ZBHXISOD.js";import"./chunk-X6XAMP4E.js";import"./chunk-QAQDMS6R.js";import"./chunk-NRAAYZ4C.js";import"./chunk-HCTJKP5J.js";import"./chunk-2IKDEUCX.js";import{d as p}from"./chunk-74IYYDDI.js";import{a as r,d as h,f as S,g as A}from"./chunk-I26MS5PJ.js";var R=h(S(),1);var k=h(A(),1);var _=r((e,s)=>({"admin-token-weak":e("Weak admin token"),"auth-secret-weak":e("Weak auth secret"),"cookies-insecure":e("Session cookies are not Secure"),"cors-wildcard-credentials":e("Wildcard CORS with credentials"),"csrf-disabled":e("CSRF/origin guard is off"),"dev-args-unredacted":e("Request log keeps un-redacted args"),"security-headers-disabled":e("Security headers are off"),"ws-gate-open":e("User subscriptions are ungated")})[s.kind],"k"),w=r(e=>Array.isArray(e.findings)?e.findings:[],"g"),b=r(e=>({"admin-token-weak":"LUNORA_ADMIN_TOKEN","auth-secret-weak":"AUTH_SECRET","cookies-insecure":"BETTER_AUTH_URL","cors-wildcard-credentials":"LUNORA_ALLOWED_ORIGINS","csrf-disabled":"LUNORA_SECURITY_CSRF","dev-args-unredacted":"request log","security-headers-disabled":"LUNORA_SECURITY_HEADERS","ws-gate-open":"LUNORA_WS_BEARER"})[e.kind],"S"),E=r((e,s)=>({"admin-token-weak":e("Your admin token is {length} characters \u2014 use at least {min} for a brute-force-resistant secret.",{length:s.detail?.length,min:s.detail?.min}),"auth-secret-weak":e("Your auth secret is {length} characters \u2014 use at least {min} (e.g. `openssl rand -hex 32`) to sign sessions safely.",{length:s.detail?.length,min:s.detail?.min}),"cookies-insecure":e("BETTER_AUTH_URL is a plaintext http:// origin, so session cookies cannot be Secure and ride in cleartext. Serve auth over https:// in production."),"cors-wildcard-credentials":e("LUNORA_ALLOWED_ORIGINS includes a wildcard while credentials are allowed \u2014 browsers reject this and it defeats the allowlist. Name explicit origins instead of *."),"csrf-disabled":e("LUNORA_SECURITY_CSRF is off, so cross-origin state-changing cookie requests are not blocked. Re-enable it in production to keep mutations un-forgeable."),"dev-args-unredacted":e("This worker reports a development environment, so the request log stores raw args and identity. Confirm it isn't a mislabeled production deploy."),"security-headers-disabled":e("LUNORA_SECURITY_HEADERS is off, so HSTS, CSP, nosniff, and frame-options are not applied. Re-enable the baseline headers in production."),"ws-gate-open":e("LUNORA_WS_BEARER is unset, so the WebSocket upgrade gate is open: anyone who can reach the worker can open a socket and run ordinary user subscriptions. Admin subscriptions are unaffected \u2014 they need the admin token. Set it if subscribers should present a shared credential.")})[s.kind],"A"),O=r(()=>{let e=(0,R.c)(8),s=p(),i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={},e[0]=i):i=e[0];let{data:a,error:d,errorSource:c}=m(f.getSecurityAudit,i),n;if(e[1]!==a||e[2]!==s){let u=a===void 0?null:w(a);n=u===null?null:u.map(t=>({description:E(s,t),entity:b(t),issueType:_(s,t),key:t.kind,level:t.level})),e[1]=a,e[2]=s,e[3]=n}else n=e[3];let l=n,o;return e[4]!==d||e[5]!==c||e[6]!==l?(o=(0,k.jsx)(g,{error:d,errorSource:c,rows:l,testId:"lunora-security-advisor"}),e[4]=d,e[5]=c,e[6]=l,e[7]=o):o=e[7],o},"T");export{O as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as k}from"./chunk-E4PXACVL.js";import"./chunk-MVWZMWPD.js";import"./chunk-7Y3SY37W.js";import{a as q}from"./chunk-7G4Z6Q7X.js";import"./chunk-3YXASVTP.js";import"./chunk-AUAECCXB.js";import{b as j}from"./chunk-Q6ED4KUL.js";import"./chunk-BOMPSVRC.js";import{a as U}from"./chunk-4ZPDCXIA.js";import"./chunk-NCPW7WHO.js";import"./chunk-CLXX5RVY.js";import"./chunk-55UGUCQ6.js";import{a as R}from"./chunk-4ZEL6BYL.js";import{c as P}from"./chunk-ZBHXISOD.js";import"./chunk-X6XAMP4E.js";import"./chunk-QAQDMS6R.js";import"./chunk-NRAAYZ4C.js";import{a as M}from"./chunk-RWVIV3U7.js";import{a as G,b as H,c as J,d as B,e as x,f as N}from"./chunk-HCTJKP5J.js";import{a as z,e as D}from"./chunk-2IKDEUCX.js";import{d as F,u as O}from"./chunk-74IYYDDI.js";import{a as A,d as T,e as $,f as X,g as Y}from"./chunk-I26MS5PJ.js";var K=T(X(),1),Q=T($(),1);var t=T(Y(),1);var de=A(()=>{let e=(0,K.c)(39),a=F(),[s,V]=(0,Q.useState)(""),y;e[0]===Symbol.for("react.memo_cache_sentinel")?(y={},e[0]=y):y=e[0];let{data:C,error:l,errorSource:S,isLoading:E,refetch:_}=P(R.getAuthAuditLog,y),I;if(e[1]!==C?.entries||e[2]!==s){let r=C?.entries??[],v=s.trim().toLowerCase();I=v===""?r:r.filter(w=>w.event.toLowerCase().includes(v)||(w.actorId??"").toLowerCase().includes(v)||(w.actorEmail??"").toLowerCase().includes(v)||(w.ip??"").toLowerCase().includes(v)||w.outcome.toLowerCase().includes(v)),e[1]=C?.entries,e[2]=s,e[3]=I}else I=e[3];let o=I,L;e[4]===Symbol.for("react.memo_cache_sentinel")?(L=A(r=>{V(r.target.value)},"I"),e[4]=L):L=e[4];let W=L,i;e[5]!==a?(i=a("Filter security events"),e[5]=a,e[6]=i):i=e[6];let n;e[7]!==a?(n=a("filter event, actor, IP"),e[7]=a,e[8]=n):n=e[8];let c;e[9]!==s||e[10]!==i||e[11]!==n?(c=(0,t.jsx)(k,{"aria-label":i,className:"h-8 w-56","data-testid":"aa-search",onChange:W,placeholder:n,value:s}),e[9]=s,e[10]=i,e[11]=n,e[12]=c):c=e[12];let d;e[13]!==_?(d=A(()=>{_()},"m"),e[13]=_,e[14]=d):d=e[14];let m;e[15]!==a?(m=a("Refresh"),e[15]=a,e[16]=m):m=e[16];let u;e[17]!==d||e[18]!==m?(u=(0,t.jsx)(q,{"data-testid":"aa-refresh",onClick:d,size:"xs",type:"button",variant:"ghost",children:m}),e[17]=d,e[18]=m,e[19]=u):u=e[19];let h;e[20]!==c||e[21]!==u?(h=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[c,u]}),e[20]=c,e[21]=u,e[22]=h):h=e[22];let f;e[23]!==l||e[24]!==S?(f=l!==null&&(0,t.jsx)(U,{error:S,testId:"aa-error"}),e[23]=l,e[24]=S,e[25]=f):f=e[25];let p;e[26]!==l||e[27]!==o.length||e[28]!==E||e[29]!==a?(p=l===null&&!E&&o.length===0&&(0,t.jsx)(M,{description:a("Authentication and security events are recorded here."),testId:"aa-empty",title:a("No security events.")}),e[26]=l,e[27]=o.length,e[28]=E,e[29]=a,e[30]=p):p=e[30];let g;e[31]!==o||e[32]!==a?(g=o.length>0&&(0,t.jsx)(z,{className:"overflow-hidden py-0",children:(0,t.jsx)(D,{className:"max-h-[30rem] overflow-auto px-0",children:(0,t.jsxs)(G,{"data-testid":"aa-table",children:[(0,t.jsx)(H,{children:(0,t.jsxs)(B,{children:[(0,t.jsx)(x,{children:a("time")}),(0,t.jsx)(x,{children:a("event")}),(0,t.jsx)(x,{children:a("actor")}),(0,t.jsx)(x,{children:a("ip / user agent")}),(0,t.jsx)(x,{children:a("outcome")})]})}),(0,t.jsx)(J,{children:o.map(r=>(0,t.jsxs)(B,{"data-testid":"aa-row",children:[(0,t.jsx)(N,{className:"text-muted-foreground tabular-nums",children:O(r.ts,"\u2014")}),(0,t.jsx)(N,{children:(0,t.jsx)(j,{variant:"secondary",children:r.event})}),(0,t.jsx)(N,{className:"max-w-[24ch] truncate font-mono text-xs",title:r.actorId??void 0,children:r.actorEmail??r.actorId??(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})}),(0,t.jsxs)(N,{className:"max-w-[28ch] truncate text-xs text-muted-foreground",title:r.userAgent??void 0,children:[r.ip??(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"}),r.userAgent!==void 0&&(0,t.jsxs)("span",{className:"ml-1 opacity-70",children:["\xB7 ",r.userAgent]})]}),(0,t.jsx)(N,{children:(0,t.jsx)(j,{variant:r.outcome==="failure"?"destructive":"outline",children:a(r.outcome)})})]},r.seq))})]})})}),e[31]=o,e[32]=a,e[33]=g):g=e[33];let b;return e[34]!==f||e[35]!==p||e[36]!==g||e[37]!==h?(b=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-auth-audit",children:[h,f,p,g]}),e[34]=f,e[35]=p,e[36]=g,e[37]=h,e[38]=b):b=e[38],b},"ne");export{de as default};
|