@lunora/studio 1.0.0-alpha.32 → 1.0.0-alpha.320
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 +1581 -0
- package/dist/index.d.ts +974 -806
- 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 +3 -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-fhDlZGE4.mjs +2 -0
- package/dist/packem_shared/ApiReferencePanel-nAf8tNRr.mjs +1 -0
- package/dist/packem_shared/CommandPalette-D9ZY-qQd.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-DuULO4XM.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-E68QfaST.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-DhObcZDY.mjs +1 -0
- package/dist/packem_shared/HomePanel-CUuYsApa.mjs +1 -0
- package/dist/packem_shared/MigrationsPanel-CkVIwAbK.mjs +1 -0
- package/dist/packem_shared/OpenRpcReferencePanel-BxEr49D9.mjs +1 -0
- package/dist/packem_shared/STUDIO_ROOT_CLASS-C6MccdVk.mjs +1 -0
- package/dist/packem_shared/ScheduledJobs-BZNcYWBP.mjs +1 -0
- package/dist/packem_shared/ShardInput-C6mjgAh4.mjs +1 -0
- package/dist/packem_shared/Studio-CZjQXFHC.mjs +1 -0
- package/dist/packem_shared/StudioApp-C9ENwcOH.mjs +1 -0
- package/dist/packem_shared/StudioI18nProvider-fVsCSs5L.mjs +1 -0
- package/dist/packem_shared/advisor-view-DzI2RQhY.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-D7vL0y8y.d.mts +349 -0
- package/dist/packem_shared/app.d-D7vL0y8y.d.ts +349 -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-DIiNmDR9.mjs +1 -0
- package/dist/packem_shared/data-view-params-DhYmAkcj.mjs +1 -0
- package/dist/packem_shared/diagram-export-panel-D5CVNJkp.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-DueSEkt-.mjs +1 -0
- package/dist/packem_shared/grid-features-OVIMIQan.mjs +6 -0
- package/dist/packem_shared/grid-pagination-DgzyzfBh.mjs +1 -0
- package/dist/packem_shared/home-panel-BcE8S2Nn.mjs +3 -0
- package/dist/packem_shared/input-CXhxesPC.mjs +1 -0
- package/dist/packem_shared/internal-Df43vQI0.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-CICyJ_kc.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-CyFiAE2l.mjs +1 -0
- package/dist/packem_shared/reference-view-CIHyURU6.mjs +13 -0
- package/dist/packem_shared/schema-diagram-C5oilX7l.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-DyK762_A.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-fK2DTLde.mjs +2 -0
- package/dist/packem_shared/table-D0SBiDu-.mjs +2 -0
- package/dist/packem_shared/table-list-sidebar-DkPO_Qtz.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-tlBof8Yg.mjs +1 -0
- package/dist/packem_shared/use-admin-spec-Bir7V68L.mjs +1 -0
- package/dist/packem_shared/use-async-submit-CZqCMTJ_.mjs +1 -0
- package/dist/packem_shared/use-auth-config-Z_n4ABCI.mjs +1 -0
- package/dist/packem_shared/use-mirrored-ref-CVDf2z1M.mjs +1 -0
- package/dist/packem_shared/use-open-trace-DMVhpnyG.mjs +1 -0
- package/dist/packem_shared/use-shard-key-BsP3o5wT.mjs +1 -0
- package/dist/packem_shared/use-sql-assistant-CZydTzd5.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-253UHWDX.js +1 -0
- package/dist/standalone/chunk-2I4NHEKA.js +1 -0
- package/dist/standalone/chunk-2IKDEUCX.js +1 -0
- package/dist/standalone/chunk-2VA5S3IA.js +1 -0
- package/dist/standalone/chunk-37WYCOQ2.js +1 -0
- package/dist/standalone/chunk-3J42UGFU.js +1 -0
- package/dist/standalone/chunk-3PGRJ3V6.js +1 -0
- package/dist/standalone/chunk-3V25YSWQ.js +1 -0
- package/dist/standalone/chunk-3YXASVTP.js +1 -0
- package/dist/standalone/chunk-4OXIU2KT.js +1 -0
- package/dist/standalone/chunk-4TH2NPLW.js +1 -0
- package/dist/standalone/chunk-4WD4XGC3.js +1 -0
- package/dist/standalone/chunk-4ZEL6BYL.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-6HLARDYO.js +1 -0
- package/dist/standalone/chunk-6NTTNUVH.js +1 -0
- package/dist/standalone/chunk-6OHCSDVS.js +15 -0
- package/dist/standalone/chunk-6QTAHSDD.js +1 -0
- package/dist/standalone/chunk-7G4Z6Q7X.js +1 -0
- package/dist/standalone/chunk-7RKB5KS7.js +1 -0
- package/dist/standalone/chunk-7U2CDNFA.js +1 -0
- package/dist/standalone/chunk-7Y3SY37W.js +1 -0
- package/dist/standalone/chunk-A43P35OS.js +1 -0
- package/dist/standalone/chunk-AJV3ZKEY.js +3 -0
- package/dist/standalone/chunk-AN5MJC2Z.js +1 -0
- package/dist/standalone/chunk-ARWJGYXL.js +1 -0
- package/dist/standalone/chunk-ASEMAFEH.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-BIF3IS4H.js +1 -0
- package/dist/standalone/chunk-BOMPSVRC.js +1 -0
- package/dist/standalone/chunk-BRE5MCZN.js +1 -0
- package/dist/standalone/chunk-CAWYFUK6.js +1 -0
- package/dist/standalone/chunk-CCDX5RYT.js +1 -0
- package/dist/standalone/chunk-CGQMJYCW.js +1 -0
- package/dist/standalone/chunk-CVXNHIQW.js +1 -0
- package/dist/standalone/chunk-CYVAA5G2.js +1 -0
- package/dist/standalone/chunk-DMPS3Z6Z.js +1 -0
- package/dist/standalone/chunk-E4PXACVL.js +3 -0
- package/dist/standalone/chunk-ECY2JC5F.js +1 -0
- package/dist/standalone/chunk-FPI7AMQJ.js +1 -0
- package/dist/standalone/chunk-FQPBYMII.js +15 -0
- package/dist/standalone/chunk-FUYEZFBP.js +1 -0
- package/dist/standalone/chunk-GHQ2VDI2.js +1 -0
- package/dist/standalone/chunk-GS35QQEF.js +1 -0
- package/dist/standalone/chunk-GTN6NHUL.js +1 -0
- package/dist/standalone/chunk-GWOHQJIL.js +1 -0
- package/dist/standalone/chunk-H6AITPPC.js +1 -0
- package/dist/standalone/chunk-HCMDAFTX.js +1 -0
- package/dist/standalone/chunk-HCTJKP5J.js +1 -0
- package/dist/standalone/chunk-HELZ4ROC.js +1 -0
- package/dist/standalone/chunk-HJHSQPHW.js +19 -0
- package/dist/standalone/chunk-HPXC7ZFN.js +1 -0
- package/dist/standalone/chunk-HRVRCCML.js +3 -0
- package/dist/standalone/chunk-HXF32KMX.js +1 -0
- package/dist/standalone/chunk-I26MS5PJ.js +1 -0
- package/dist/standalone/chunk-I5ETS5CZ.js +1 -0
- package/dist/standalone/chunk-ICDMV4MP.js +9 -0
- package/dist/standalone/chunk-IWZ7GVQO.js +1 -0
- package/dist/standalone/chunk-JBWGM4O5.js +1 -0
- package/dist/standalone/chunk-JQXA2OYK.js +1 -0
- package/dist/standalone/chunk-JSKSPTUJ.js +1 -0
- package/dist/standalone/chunk-JWOD73TN.js +1 -0
- package/dist/standalone/chunk-JZGTSH2C.js +4 -0
- package/dist/standalone/chunk-KWTRRYMT.js +1 -0
- package/dist/standalone/chunk-LR4Y6CQF.js +14 -0
- package/dist/standalone/chunk-LY625VRG.js +1 -0
- package/dist/standalone/chunk-MQCDUPD3.js +1 -0
- package/dist/standalone/chunk-MVWZMWPD.js +1 -0
- package/dist/standalone/chunk-MXYGUIAL.js +1 -0
- package/dist/standalone/chunk-MYDSSTIL.js +1 -0
- package/dist/standalone/chunk-MZNJ4SBH.js +1 -0
- package/dist/standalone/chunk-N2SJOHD6.js +1 -0
- package/dist/standalone/chunk-NBFGB6LQ.js +1 -0
- package/dist/standalone/chunk-NCPW7WHO.js +1 -0
- package/dist/standalone/chunk-NDTQTKDX.js +6 -0
- package/dist/standalone/chunk-NGVP66OH.js +1 -0
- package/dist/standalone/chunk-NQZALRU3.js +1 -0
- package/dist/standalone/chunk-NRP22GKC.js +1 -0
- package/dist/standalone/chunk-NXQW5E6W.js +1 -0
- package/dist/standalone/chunk-ODMIUMAO.js +1 -0
- package/dist/standalone/chunk-ODQ6AVXD.js +1 -0
- package/dist/standalone/chunk-OPM7ESDV.js +1 -0
- package/dist/standalone/chunk-OQ6I6OXT.js +2 -0
- package/dist/standalone/chunk-OSGXNEFA.js +1 -0
- package/dist/standalone/chunk-OWVKR6J4.js +1 -0
- package/dist/standalone/chunk-OYCUPD3Q.js +1 -0
- package/dist/standalone/chunk-P5QHD7XI.js +1 -0
- package/dist/standalone/chunk-PFP4ELTQ.js +1 -0
- package/dist/standalone/chunk-PIMTWCRD.js +1 -0
- package/dist/standalone/chunk-PNI5SACT.js +1 -0
- package/dist/standalone/chunk-PUEVXAMZ.js +1 -0
- package/dist/standalone/chunk-Q2KHDNYH.js +8 -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-QHXHYD2D.js +1 -0
- package/dist/standalone/chunk-QJLHH3ET.js +1 -0
- package/dist/standalone/chunk-R5P53FO2.js +2 -0
- package/dist/standalone/chunk-R6U22RSY.js +1 -0
- package/dist/standalone/chunk-RGMVGZV4.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-SJQERRSZ.js +1 -0
- package/dist/standalone/chunk-SJUYCXDY.js +1 -0
- package/dist/standalone/chunk-SV764LKQ.js +1 -0
- package/dist/standalone/chunk-SYMULPR4.js +4 -0
- package/dist/standalone/chunk-TTZZ7DNO.js +1 -0
- package/dist/standalone/chunk-TVCVRQUC.js +59 -0
- package/dist/standalone/chunk-TY5DCOTU.js +5 -0
- package/dist/standalone/chunk-UC7MNI2F.js +1 -0
- package/dist/standalone/chunk-UG2MMHTH.js +1 -0
- package/dist/standalone/chunk-UYEZR3BI.js +1 -0
- package/dist/standalone/chunk-VCFEO3RI.js +1 -0
- package/dist/standalone/chunk-VESGIGMQ.js +1 -0
- package/dist/standalone/chunk-VQPCNZNW.js +1 -0
- package/dist/standalone/chunk-VRWHCG2V.js +1 -0
- package/dist/standalone/chunk-VY4D6ROH.js +1 -0
- package/dist/standalone/chunk-WJRYEML4.js +1 -0
- package/dist/standalone/chunk-X2C3EX3E.js +1 -0
- package/dist/standalone/chunk-XGCIDUJF.js +1 -0
- package/dist/standalone/chunk-XGYH6FFM.js +1 -0
- package/dist/standalone/chunk-XHRKNCCI.js +1 -0
- package/dist/standalone/chunk-XZTOX6TC.js +1 -0
- package/dist/standalone/chunk-Y3AYVFTK.js +1 -0
- package/dist/standalone/chunk-YVR4SEPU.js +1 -0
- package/dist/standalone/chunk-Z22BDS6N.js +1 -0
- package/dist/standalone/chunk-ZKJS6EBE.js +1 -0
- package/dist/standalone/chunk-ZRJQQLAF.js +1 -0
- package/dist/standalone/chunk-ZTPG3TFT.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-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-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-OV2WFAJX.js +0 -1
- package/dist/standalone/chunk-PA3LN4XJ.js +0 -1
- package/dist/standalone/chunk-PD6WPVYU.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-SFJ5F4DX.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 @@
|
|
|
1
|
+
import{b as Me}from"./chunk-2VA5S3IA.js";import{a as ve}from"./chunk-VCFEO3RI.js";import{b as ye,c as we}from"./chunk-VESGIGMQ.js";import{a as xe}from"./chunk-7RKB5KS7.js";import{a as Ne}from"./chunk-SV764LKQ.js";import"./chunk-NGVP66OH.js";import"./chunk-GHQ2VDI2.js";import{a as be}from"./chunk-R6U22RSY.js";import{a as fe}from"./chunk-YVR4SEPU.js";import{b as he}from"./chunk-ZKJS6EBE.js";import"./chunk-RGMVGZV4.js";import{i as me}from"./chunk-E4PXACVL.js";import"./chunk-MVWZMWPD.js";import"./chunk-7Y3SY37W.js";import"./chunk-3YXASVTP.js";import"./chunk-AUAECCXB.js";import{b as oe}from"./chunk-Q6ED4KUL.js";import"./chunk-BOMPSVRC.js";import{a as ge}from"./chunk-SJUYCXDY.js";import"./chunk-NCPW7WHO.js";import"./chunk-3V25YSWQ.js";import"./chunk-55UGUCQ6.js";import{a as ce}from"./chunk-4ZEL6BYL.js";import{c as ie}from"./chunk-VRWHCG2V.js";import"./chunk-ICDMV4MP.js";import"./chunk-QAQDMS6R.js";import"./chunk-FQPBYMII.js";import{a as ue}from"./chunk-RWVIV3U7.js";import{d as U,m as pe,t as de}from"./chunk-HJHSQPHW.js";import{a as m,d as le,e as Ce,f as Le,g as Te,i as te}from"./chunk-I26MS5PJ.js";var O=le(Le(),1),A=le(Ce(),1);var s=le(Te(),1);var Pe=.5,Ie=4,Se=m(n=>Math.min(100,Math.max(0,n)),"ce"),Ke=m((n,e)=>{if(!Number.isFinite(e)||e<=0)return{leftPercent:0,widthPercent:100};let t=Se(n.offsetMs/e*100),a=n.durationMs/e*100,l=Math.max(Pe,Math.min(Se(a),100-t));return{leftPercent:t,widthPercent:l}},"Ce"),De=m((n,e,t=!1)=>{let a=e.trim().toLowerCase(),l=t?n.filter(r=>!r.ok):n;return a===""?[...l]:l.filter(r=>r.rootName.toLowerCase().includes(a)||r.functionPath.toLowerCase().includes(a)||r.traceId.toLowerCase().includes(a)||r.spans.some(o=>o.name.toLowerCase().includes(a)||o.spanId.toLowerCase().includes(a)))},"Ee"),G=m(n=>Number.isFinite(n)?n>0&&n<1?`${n.toFixed(2)}ms`:`${String(Math.round(n))}ms`:"\u2014","q"),je=m(n=>!Number.isFinite(n)||n<=0?[]:Array.from({length:Ie},(e,t)=>{let a=(t+1)/Ie;return{label:G(n*a),percent:a*100}}),"Pe"),ke=m(n=>{if(typeof n=="string")return n;try{return JSON.stringify(n,pe)}catch{return String(n)}},"ue"),ee=m(n=>{let e=(0,O.c)(7),{label:t,value:a}=n,l;e[0]!==t?(l=(0,s.jsx)("dt",{className:"w-40 shrink-0 text-muted-foreground",children:t}),e[0]=t,e[1]=l):l=e[1];let r;e[2]!==a?(r=(0,s.jsx)("dd",{className:"min-w-0 break-all",children:a}),e[2]=a,e[3]=r):r=e[3];let o;return e[4]!==l||e[5]!==r?(o=(0,s.jsxs)("div",{className:"flex gap-2",children:[l,r]}),e[4]=l,e[5]=r,e[6]=o):o=e[6],o},"Y"),Fe=m(n=>{let e=(0,O.c)(68),{span:t}=n,a=U(),l,r,o,d,i,u;if(e[0]!==t.attributes||e[1]!==t.durationMs||e[2]!==t.error||e[3]!==t.events||e[4]!==t.kind||e[5]!==t.offsetMs||e[6]!==t.parentSpanId||e[7]!==t.spanId||e[8]!==a){let $=Object.entries(t.attributes??{}),_;e[15]!==t.events?(_=t.events??[],e[15]=t.events,e[16]=_):_=e[16],l=_,r="border-t border-border bg-background/60 px-3 py-2 font-mono text-xs",o="tr-span-detail";let y;e[17]!==a?(y=a("Span ID"),e[17]=a,e[18]=y):y=e[18];let w;e[19]!==t.spanId||e[20]!==y?(w=(0,s.jsx)(ee,{label:y,value:t.spanId}),e[19]=t.spanId,e[20]=y,e[21]=w):w=e[21];let M;e[22]!==a?(M=a("Parent span ID"),e[22]=a,e[23]=M):M=e[23];let p;e[24]!==t.parentSpanId||e[25]!==a?(p=t.parentSpanId===""?a("\u2014 (trace root)"):t.parentSpanId,e[24]=t.parentSpanId,e[25]=a,e[26]=p):p=e[26];let h;e[27]!==p||e[28]!==M?(h=(0,s.jsx)(ee,{label:M,value:p}),e[27]=p,e[28]=M,e[29]=h):h=e[29];let b;e[30]!==a?(b=a("Kind"),e[30]=a,e[31]=b):b=e[31];let C=t.kind??"internal",S;e[32]!==b||e[33]!==C?(S=(0,s.jsx)(ee,{label:b,value:C}),e[32]=b,e[33]=C,e[34]=S):S=e[34];let I;e[35]!==a?(I=a("Started at"),e[35]=a,e[36]=I):I=e[36];let g;e[37]!==t.offsetMs||e[38]!==a?(g=a("+{offset}",{offset:G(t.offsetMs)}),e[37]=t.offsetMs,e[38]=a,e[39]=g):g=e[39];let x;e[40]!==I||e[41]!==g?(x=(0,s.jsx)(ee,{label:I,value:g}),e[40]=I,e[41]=g,e[42]=x):x=e[42];let k;e[43]!==a?(k=a("Duration"),e[43]=a,e[44]=k):k=e[44];let f;e[45]!==t.durationMs?(f=G(t.durationMs),e[45]=t.durationMs,e[46]=f):f=e[46];let N;e[47]!==k||e[48]!==f?(N=(0,s.jsx)(ee,{label:k,value:f}),e[47]=k,e[48]=f,e[49]=N):N=e[49],e[50]!==h||e[51]!==S||e[52]!==x||e[53]!==N||e[54]!==w?(d=(0,s.jsxs)("dl",{className:"flex flex-col gap-1",children:[w,h,S,x,N]}),e[50]=h,e[51]=S,e[52]=x,e[53]=N,e[54]=w,e[55]=d):d=e[55],e[56]!==t.error?(i=t.error!==void 0&&(0,s.jsxs)("div",{className:"mt-2 rounded-md border border-destructive/40 bg-destructive/10 px-2 py-1.5","data-testid":"tr-detail-error",children:[(0,s.jsx)("span",{className:"font-semibold text-destructive",children:t.error.type}),(0,s.jsx)("p",{className:"whitespace-pre-wrap break-all text-destructive",children:t.error.message})]}),e[56]=t.error,e[57]=i):i=e[57],u=$.length>0&&(0,s.jsxs)("div",{className:"mt-2","data-testid":"tr-detail-attributes",children:[(0,s.jsx)("p",{className:"mb-1 text-muted-foreground",children:a("Attributes")}),(0,s.jsx)("dl",{className:"flex flex-col gap-1",children:$.map(Ee)})]}),e[0]=t.attributes,e[1]=t.durationMs,e[2]=t.error,e[3]=t.events,e[4]=t.kind,e[5]=t.offsetMs,e[6]=t.parentSpanId,e[7]=t.spanId,e[8]=a,e[9]=l,e[10]=r,e[11]=o,e[12]=d,e[13]=i,e[14]=u}else l=e[9],r=e[10],o=e[11],d=e[12],i=e[13],u=e[14];let c;e[58]!==l||e[59]!==a?(c=l.length>0&&(0,s.jsxs)("div",{className:"mt-2","data-testid":"tr-detail-events",children:[(0,s.jsx)("p",{className:"mb-1 text-muted-foreground",children:a("Events")}),(0,s.jsx)("ul",{className:"flex flex-col gap-1",children:l.map(Oe)})]}),e[58]=l,e[59]=a,e[60]=c):c=e[60];let v;return e[61]!==r||e[62]!==o||e[63]!==d||e[64]!==i||e[65]!==u||e[66]!==c?(v=(0,s.jsxs)("div",{className:r,"data-testid":o,children:[d,i,u,c]}),e[61]=r,e[62]=o,e[63]=d,e[64]=i,e[65]=u,e[66]=c,e[67]=v):v=e[67],v},"Fe");function Ee(n){let[e,t]=n;return(0,s.jsx)(ee,{label:e,value:ke(t)},e)}m(Ee,"Ke");function Ae(n){let[e,t]=n;return`${e}=${ke(t)}`}m(Ae,"Re");function Oe(n){return(0,s.jsxs)("li",{className:"flex gap-2",children:[(0,s.jsx)("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:de(n.ts)}),(0,s.jsx)(oe,{variant:"secondary",children:n.name}),(0,s.jsx)("span",{className:"min-w-0 break-all text-muted-foreground",children:Object.entries(n.attributes??{}).map(Ae).join(" ")})]},`${n.name}:${String(n.ts)}`)}m(Oe,"Ae");var Be=14,_e="grid grid-cols-[14rem_1fr_4rem_16rem_16rem] items-center gap-2 px-3",We=m(n=>{let e=(0,O.c)(17),{traceDurationMs:t}=n,a,l,r,o,d,i;if(e[0]!==t){i=Symbol.for("react.early_return_sentinel");e:{let v=je(t);if(v.length===0){i=null;break e}e[7]===Symbol.for("react.memo_cache_sentinel")?(r=te(_e,"border-b border-border py-1 font-mono text-[10px] text-muted-foreground"),e[7]=r):r=e[7],o="tr-ruler",e[8]===Symbol.for("react.memo_cache_sentinel")?(d=(0,s.jsx)("span",{}),e[8]=d):d=e[8],a="relative h-3",l=v.map(Je)}e[0]=t,e[1]=a,e[2]=l,e[3]=r,e[4]=o,e[5]=d,e[6]=i}else a=e[1],l=e[2],r=e[3],o=e[4],d=e[5],i=e[6];if(i!==Symbol.for("react.early_return_sentinel"))return i;let u;e[9]!==a||e[10]!==l?(u=(0,s.jsx)("span",{className:a,children:l}),e[9]=a,e[10]=l,e[11]=u):u=e[11];let c;return e[12]!==r||e[13]!==o||e[14]!==d||e[15]!==u?(c=(0,s.jsxs)("div",{className:r,"data-testid":o,children:[d,u]}),e[12]=r,e[13]=o,e[14]=d,e[15]=u,e[16]=c):c=e[16],c},"je"),qe=m(n=>{let e=(0,O.c)(60),{span:t,traceDurationMs:a}=n,l=U(),[r,o]=(0,A.useState)(!1),d;e[0]!==t||e[1]!==a?(d=Ke(t,a),e[0]=t,e[1]=a,e[2]=d):d=e[2];let{leftPercent:i,widthPercent:u}=d,c;e[3]!==t.attributes?(c=ve(t.attributes),e[3]=t.attributes,e[4]=c):c=e[4];let v=c,$=t.depth*Be,_;e[5]!==$?(_={paddingLeft:$},e[5]=$,e[6]=_):_=e[6];let y=_,w=`${String(i)}%`,M=`${String(u)}%`,p;e[7]!==w||e[8]!==M?(p={left:w,width:M},e[7]=w,e[8]=M,e[9]=p):p=e[9];let h=p,b;e[10]===Symbol.for("react.memo_cache_sentinel")?(b=m(()=>{o(Ue)},"h"),e[10]=b):b=e[10];let C=b,S=t.depth,I=`tr-span-detail-${t.spanId}`,g;e[11]!==t.durationMs||e[12]!==t.error||e[13]!==t.name||e[14]!==t.offsetMs||e[15]!==l?(g=l("{name}, {duration}, starts {offset} in{failure}",{duration:G(t.durationMs),failure:t.error===void 0?"":l(", failed: {message}",{message:t.error.message}),name:t.name,offset:G(t.offsetMs)}),e[11]=t.durationMs,e[12]=t.error,e[13]=t.name,e[14]=t.offsetMs,e[15]=l,e[16]=g):g=e[16];let x;e[17]===Symbol.for("react.memo_cache_sentinel")?(x=te(_e,"w-full border-b border-border py-1.5 text-left font-mono text-xs hover:bg-muted/50"),e[17]=x):x=e[17];let k=`tr-span-toggle-${t.spanId}`,f;e[18]!==t.ok?(f=t.ok?null:(0,s.jsx)("span",{"aria-hidden":"true",className:"mr-1 text-destructive","data-testid":"tr-span-error",children:"\u25CF"}),e[18]=t.ok,e[19]=f):f=e[19];let N;e[20]!==y||e[21]!==t.name||e[22]!==f?(N=(0,s.jsxs)("span",{className:"truncate",style:y,title:t.name,children:[f,t.name]}),e[20]=y,e[21]=t.name,e[22]=f,e[23]=N):N=e[23];let B=t.ok?"bg-primary/70":"bg-destructive",L;e[24]!==B?(L=te("absolute inset-y-0 rounded-sm",B),e[24]=B,e[25]=L):L=e[25];let E;e[26]!==h||e[27]!==i||e[28]!==L||e[29]!==u?(E=(0,s.jsx)("span",{"aria-hidden":"true",className:"relative h-3 overflow-hidden rounded-sm bg-muted",children:(0,s.jsx)("span",{className:L,"data-left":i,"data-testid":"tr-span-bar","data-width":u,style:h})}),e[26]=h,e[27]=i,e[28]=L,e[29]=u,e[30]=E):E=e[30];let W;e[31]!==t.durationMs?(W=G(t.durationMs),e[31]=t.durationMs,e[32]=W):W=e[32];let D;e[33]!==W?(D=(0,s.jsx)("span",{className:"text-right tabular-nums text-muted-foreground",children:W}),e[33]=W,e[34]=D):D=e[34];let q;e[35]!==t.error?(q=t.error===void 0?null:(0,s.jsx)("span",{className:"text-destructive","data-testid":"tr-span-error-message",title:t.error.message,children:`${t.error.type}: ${t.error.message}`}),e[35]=t.error,e[36]=q):q=e[36];let T;e[37]!==q?(T=(0,s.jsx)("span",{className:"truncate text-muted-foreground",children:q}),e[37]=q,e[38]=T):T=e[38];let z;e[39]!==v?(z=v===""?null:(0,s.jsx)("span",{"data-testid":"tr-span-attributes",title:v,children:v}),e[39]=v,e[40]=z):z=e[40];let P;e[41]!==z?(P=(0,s.jsx)("span",{className:"truncate text-muted-foreground",children:z}),e[41]=z,e[42]=P):P=e[42];let J;e[43]!==r||e[44]!==I||e[45]!==g||e[46]!==k||e[47]!==N||e[48]!==E||e[49]!==D||e[50]!==T||e[51]!==P?(J=(0,s.jsxs)("button",{"aria-controls":I,"aria-expanded":r,"aria-label":g,className:x,"data-testid":k,onClick:C,type:"button",children:[N,E,D,T,P]}),e[43]=r,e[44]=I,e[45]=g,e[46]=k,e[47]=N,e[48]=E,e[49]=D,e[50]=T,e[51]=P,e[52]=J):J=e[52];let j;e[53]!==r||e[54]!==t?(j=r&&(0,s.jsx)("div",{id:`tr-span-detail-${t.spanId}`,children:(0,s.jsx)(Fe,{span:t})}),e[53]=r,e[54]=t,e[55]=j):j=e[55];let K;return e[56]!==t.depth||e[57]!==J||e[58]!==j?(K=(0,s.jsxs)("li",{"data-depth":S,"data-testid":"tr-span-row",children:[J,j]}),e[56]=t.depth,e[57]=J,e[58]=j,e[59]=K):K=e[59],K},"Be"),ze=m(n=>{let e=(0,O.c)(15),{durationMs:t,spans:a}=n,l=U(),r;e[0]!==t?(r=(0,s.jsx)(We,{traceDurationMs:t}),e[0]=t,e[1]=r):r=e[1];let o;e[2]!==l?(o=l("Trace waterfall"),e[2]=l,e[3]=o):o=e[3];let d;if(e[4]!==t||e[5]!==a){let c;e[7]!==t?(c=m(v=>(0,s.jsx)(qe,{span:v,traceDurationMs:t},v.spanId),"c"),e[7]=t,e[8]=c):c=e[8],d=a.map(c),e[4]=t,e[5]=a,e[6]=d}else d=e[6];let i;e[9]!==o||e[10]!==d?(i=(0,s.jsx)("ul",{"aria-label":o,children:d}),e[9]=o,e[10]=d,e[11]=i):i=e[11];let u;return e[12]!==r||e[13]!==i?(u=(0,s.jsxs)(s.Fragment,{children:[r,i]}),e[12]=r,e[13]=i,e[14]=u):u=e[14],u},"Oe");function Je(n){return(0,s.jsx)("span",{className:te("absolute inset-y-0 border-l border-border/70",n.percent===100?"-translate-x-full pr-1":"pl-1"),style:{left:`${String(n.percent)}%`},children:n.label},n.percent)}m(Je,"We");function Ue(n){return!n}m(Ue,"Ue");var Ge=m(n=>Array.isArray(n?.traces)?n.traces:[],"qe"),He=m(n=>{let e=(0,O.c)(12),{entries:t}=n,a=U(),l;e[0]!==t.length||e[1]!==a?(l=a("Logs ({count})",{count:t.length}),e[0]=t.length,e[1]=a,e[2]=l):l=e[2];let r;e[3]!==l?(r=(0,s.jsx)("p",{className:"mb-1 font-mono text-xs text-muted-foreground",children:l}),e[3]=l,e[4]=r):r=e[4];let o;e[5]!==t?(o=t.map(Ve),e[5]=t,e[6]=o):o=e[6];let d;e[7]!==o?(d=(0,s.jsx)("div",{role:"grid",children:o}),e[7]=o,e[8]=d):d=e[8];let i;return e[9]!==r||e[10]!==d?(i=(0,s.jsxs)("div",{className:"border-t border-border px-3 py-2","data-testid":"tr-logs",children:[r,d]}),e[9]=r,e[10]=d,e[11]=i):i=e[11],i},"ze"),Qe=m(n=>{let e=(0,O.c)(50),{expanded:t,logs:a,onToggle:l,trace:r}=n,o=U(),d;e[0]!==l||e[1]!==r.traceId?(d=m(()=>{l(r.traceId)},"i"),e[0]=l,e[1]=r.traceId,e[2]=d):d=e[2];let i=d,u=`tr-row-${r.traceId}`,c=`tr-waterfall-${r.traceId}`,v=`tr-toggle-${r.traceId}`,$=t?"\u25BE":"\u25B8",_;e[3]!==$?(_=(0,s.jsx)("span",{"aria-hidden":"true",className:"w-3 shrink-0 text-xs text-muted-foreground",children:$}),e[3]=$,e[4]=_):_=e[4];let y;e[5]!==r.rootName?(y=(0,s.jsx)("span",{className:"w-56 shrink-0 truncate text-sm font-medium",title:r.rootName,children:r.rootName}),e[5]=r.rootName,e[6]=y):y=e[6];let w;e[7]!==r.functionPath?(w=(0,s.jsx)("span",{className:"w-48 shrink-0 truncate font-mono text-xs text-muted-foreground",title:r.functionPath,children:r.functionPath}),e[7]=r.functionPath,e[8]=w):w=e[8];let M;e[9]!==r.durationMs?(M=G(r.durationMs),e[9]=r.durationMs,e[10]=M):M=e[10];let p;e[11]!==M?(p=(0,s.jsx)("span",{className:"w-20 shrink-0 text-right font-mono text-xs tabular-nums text-muted-foreground",children:M}),e[11]=M,e[12]=p):p=e[12];let h;e[13]!==o||e[14]!==r.spans.length?(h=o("{count} spans",{count:r.spans.length}),e[13]=o,e[14]=r.spans.length,e[15]=h):h=e[15];let b;e[16]!==h?(b=(0,s.jsx)("span",{className:"w-20 shrink-0 text-right font-mono text-xs tabular-nums text-muted-foreground",children:h}),e[16]=h,e[17]=b):b=e[17];let C=r.ok?"secondary":"destructive",S;e[18]!==o||e[19]!==r.ok?(S=r.ok?o("ok"):o("error"),e[18]=o,e[19]=r.ok,e[20]=S):S=e[20];let I;e[21]!==C||e[22]!==S?(I=(0,s.jsx)("span",{className:"shrink-0",children:(0,s.jsx)(oe,{variant:C,children:S})}),e[21]=C,e[22]=S,e[23]=I):I=e[23];let g;e[24]!==r.startTs?(g=de(r.startTs),e[24]=r.startTs,e[25]=g):g=e[25];let x;e[26]!==g?(x=(0,s.jsx)("span",{className:"flex-1 truncate text-right font-mono text-xs tabular-nums text-muted-foreground",children:g}),e[26]=g,e[27]=x):x=e[27];let k;e[28]!==t||e[29]!==i||e[30]!==p||e[31]!==b||e[32]!==I||e[33]!==x||e[34]!==c||e[35]!==v||e[36]!==_||e[37]!==y||e[38]!==w?(k=(0,s.jsxs)("button",{"aria-controls":c,"aria-expanded":t,className:"flex w-full items-center gap-3 px-3 py-2 text-left hover:bg-muted/50","data-testid":v,onClick:i,type:"button",children:[_,y,w,p,b,I,x]}),e[28]=t,e[29]=i,e[30]=p,e[31]=b,e[32]=I,e[33]=x,e[34]=c,e[35]=v,e[36]=_,e[37]=y,e[38]=w,e[39]=k):k=e[39];let f;e[40]!==t||e[41]!==a||e[42]!==r.durationMs||e[43]!==r.spans||e[44]!==r.traceId?(f=t&&(0,s.jsxs)("div",{className:"bg-muted/20","data-testid":`tr-waterfall-${r.traceId}`,id:`tr-waterfall-${r.traceId}`,children:[(0,s.jsx)(ze,{durationMs:r.durationMs,spans:r.spans}),a.length>0&&(0,s.jsx)(He,{entries:a})]}),e[40]=t,e[41]=a,e[42]=r.durationMs,e[43]=r.spans,e[44]=r.traceId,e[45]=f):f=e[45];let N;return e[46]!==k||e[47]!==f||e[48]!==u?(N=(0,s.jsxs)("div",{className:"border-b border-border last:border-b-0","data-testid":u,children:[k,f]}),e[46]=k,e[47]=f,e[48]=u,e[49]=N):N=e[49],N},"Ge"),bt=m(n=>{let e=(0,O.c)(58),{initialShardKey:t}=n,a=U(),[l]=(0,A.useState)(ye),{queryShardKey:r,setShardKey:o,shardKey:d}=be(l?.shardKey!==void 0&&l.shardKey!==""?l.shardKey:t??""),[i,u]=(0,A.useState)(l?.traceId??""),[c,v]=(0,A.useState)(!1),[$,_]=(0,A.useState)(Xe),y;e[0]===Symbol.for("react.memo_cache_sentinel")?(y=[],e[0]=y):y=e[0],(0,A.useEffect)(Ye,y);let w;e[1]===Symbol.for("react.memo_cache_sentinel")?(w={},e[1]=w):w=e[1];let M;e[2]!==r?(M={live:!0,shardKey:r},e[2]=r,e[3]=M):M=e[3];let{data:p,error:h,errorSource:b,isLoading:C,liveError:S}=ie(ce.getTraces,w,M),I;e[4]===Symbol.for("react.memo_cache_sentinel")?(I={},e[4]=I):I=e[4];let g=$.size>0,x;e[5]!==r||e[6]!==g?(x={enabled:g,live:!0,shardKey:r},e[5]=r,e[6]=g,e[7]=x):x=e[7];let{data:k}=ie(ce.getLogs,I,x),f,N;e[8]!==p||e[9]!==r?(f=m(()=>{p!==void 0&&he(r)},"p"),N=[p,r],e[8]=p,e[9]=r,e[10]=f,e[11]=N):(f=e[10],N=e[11]),(0,A.useEffect)(f,N);let B;if(e[12]!==p||e[13]!==h||e[14]!==b||e[15]!==$||e[16]!==C||e[17]!==S||e[18]!==k?.entries||e[19]!==c||e[20]!==i||e[21]!==o||e[22]!==d||e[23]!==a){let L=Ge(p),E=p?.total??L.length,W=E>L.length,D=De(L,i,c),q=Map.groupBy((k?.entries??[]).toReversed(),Ze),T;e[25]===Symbol.for("react.memo_cache_sentinel")?(T=m(F=>{u(F.target.value)},"C"),e[25]=T):T=e[25];let z=T,P;e[26]===Symbol.for("react.memo_cache_sentinel")?(P=m(F=>{_($e=>{let ne=new Set($e);return ne.has(F)?ne.delete(F):ne.add(F),ne})},"E"),e[26]=P):P=e[26];let J=P,j=h===null&&D.length===0&&!C,K;e[27]!==o||e[28]!==d?(K=(0,s.jsx)(fe,{onChange:o,testId:"tr-shard-input",value:d}),e[27]=o,e[28]=d,e[29]=K):K=e[29];let H;e[30]!==a?(H=a("Search traces"),e[30]=a,e[31]=H):H=e[31];let Q;e[32]!==a?(Q=a("search trace, span, or function"),e[32]=a,e[33]=Q):Q=e[33];let V;e[34]!==i||e[35]!==H||e[36]!==Q?(V=(0,s.jsx)(me,{"aria-label":H,className:"h-8 w-56","data-testid":"tr-search",onChange:z,placeholder:Q,value:i}),e[34]=i,e[35]=H,e[36]=Q,e[37]=V):V=e[37];let X;e[38]!==c?(X=(0,s.jsx)(xe,{checked:c,"data-testid":"tr-only-errors",id:"tr-only-errors",onCheckedChange:v}),e[38]=c,e[39]=X):X=e[39];let Y;e[40]!==a?(Y=a("Errors only"),e[40]=a,e[41]=Y):Y=e[41];let Z;e[42]!==X||e[43]!==Y?(Z=(0,s.jsxs)("label",{className:"flex items-center gap-2 text-xs text-muted-foreground",htmlFor:"tr-only-errors",children:[X,Y]}),e[42]=X,e[43]=Y,e[44]=Z):Z=e[44];let R;e[45]!==S?(R=(0,s.jsx)(Ne,{message:S,prefix:"tr"}),e[45]=S,e[46]=R):R=e[46];let re;e[47]!==K||e[48]!==V||e[49]!==Z||e[50]!==R?(re=(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[K,V,Z,R]}),e[47]=K,e[48]=V,e[49]=Z,e[50]=R,e[51]=re):re=e[51];let ae;e[52]!==h||e[53]!==b?(ae=h!==null&&(0,s.jsx)(ge,{error:b,testId:"tr-error"}),e[52]=h,e[53]=b,e[54]=ae):ae=e[54];let se;e[55]!==j||e[56]!==a?(se=j&&(0,s.jsx)(ue,{description:a("Traces recorded with ctx.trace show up here as your app handles traffic. The span buffer resets when the shard hibernates."),icon:(0,s.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,s.jsx)("path",{d:"M4 6h10M7 12h13M10 18h7"})}),testId:"tr-empty",title:a("No traces")}),e[55]=j,e[56]=a,e[57]=se):se=e[57],B=(0,s.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-traces-panel",children:[re,ae,se,h===null&&W&&(0,s.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"tr-truncated",children:a("Showing the {shown} most recent of {total} traces in the buffer.",{shown:L.length,total:E})}),h===null&&D.length>0&&(0,s.jsx)("div",{"aria-label":a("Recent traces"),className:"overflow-hidden rounded-xl border border-border shadow-xs","data-testid":"tr-list",children:D.map(F=>(0,s.jsx)(Qe,{expanded:$.has(F.traceId),logs:q.get(F.traceId)??[],onToggle:J,trace:F},F.traceId))})]}),e[12]=p,e[13]=h,e[14]=b,e[15]=$,e[16]=C,e[17]=S,e[18]=k?.entries,e[19]=c,e[20]=i,e[21]=o,e[22]=d,e[23]=a,e[24]=B}else B=e[24];return B},"bt");function Ve(n,e){return(0,s.jsx)("div",{className:"flex items-center border-b border-border py-1 font-mono text-xs last:border-b-0","data-testid":"tr-log-row",role:"row",children:(0,s.jsx)(Me,{entry:n})},`${String(e)}:${String(n.timestamp)}`)}m(Ve,"He");function Xe(){return new Set}m(Xe,"Je");function Ye(){we()}m(Ye,"Qe");function Ze(n){return n.traceId}m(Ze,"Ve");export{bt as default};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import{a as le}from"./chunk-6HLARDYO.js";import{a as je}from"./chunk-FPI7AMQJ.js";import{a as he}from"./chunk-37WYCOQ2.js";import{a as V}from"./chunk-SA2OGF3F.js";import{d as Ne,f as ke,g as we,k as oe}from"./chunk-GHQ2VDI2.js";import{a as Pe}from"./chunk-YVR4SEPU.js";import"./chunk-ZKJS6EBE.js";import"./chunk-RGMVGZV4.js";import{i as ve}from"./chunk-E4PXACVL.js";import"./chunk-MVWZMWPD.js";import"./chunk-7Y3SY37W.js";import{a as W}from"./chunk-7G4Z6Q7X.js";import"./chunk-3YXASVTP.js";import"./chunk-AUAECCXB.js";import{b as ye}from"./chunk-Q6ED4KUL.js";import"./chunk-BOMPSVRC.js";import{a as $e}from"./chunk-4ZEL6BYL.js";import{l as F}from"./chunk-ICDMV4MP.js";import"./chunk-QAQDMS6R.js";import{d as be}from"./chunk-FQPBYMII.js";import{a as U}from"./chunk-RWVIV3U7.js";import{d as J,e as Se,f as se,g as ie,h as fe,m as Ie,p as Oe,s as ae}from"./chunk-HJHSQPHW.js";import{a as u,d as K,e as me,f as te,g as re,i as ue}from"./chunk-I26MS5PJ.js";var Ge=K(te(),1),xe=K(me(),1);var Y=K(te(),1);var X=K(me(),1);var R=K(re(),1);var Ve=se($e.listTables),Xe=["react","client","cli"],Ye={action:"action",mutation:"mutation",query:"query"},Ce=u(t=>{let e=t.indexOf(":");return e===-1?{file:"",fn:t}:{file:t.slice(0,e),fn:t.slice(e+1)}},"Q"),Ze=u(({file:t,fn:e,kind:a})=>`await client.${Ye[a]}(api.${t}.${e}, { /* args */ });`,"ie"),et=u(t=>{let e=`api.${t.file}.${t.fn}`;switch(t.kind){case"action":return`const { call: ${t.fn} } = useAction(${e});`;case"mutation":return`const ${t.fn} = useMutation(${e});`;default:return`const data = useQuery(${e}, { /* args */ });`}},"se"),tt=u(({file:t,fn:e})=>`lunora run ${t}:${e} --args '{ }'`,"oe"),rt=u(t=>["// Read rows",`const rows = await ctx.db.query("${t}").collect();`,"","// Insert a row",`const id = await ctx.db.insert("${t}", { /* fields */ });`,"","// Generated types",`type Row = Doc<"${t}">;`,`type RowId = Id<"${t}">;`].join(`
|
|
2
|
+
`),"ce"),at=u((t,e)=>{switch(t){case"cli":return tt(e);case"client":return Ze(e);default:return et(e)}},"re"),Re=u(t=>{let e=(0,Y.c)(19),{code:a,label:r,testId:n}=t,s=J(),o;e[0]!==a?(o=u(()=>{ae(a)},"c"),e[0]=a,e[1]=o):o=e[1];let i=o,c;e[2]!==r?(c=(0,R.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:r}),e[2]=r,e[3]=c):c=e[3];let m=`${n}-copy`,l;e[4]!==s?(l=s("Copy"),e[4]=s,e[5]=l):l=e[5];let p;e[6]!==i||e[7]!==m||e[8]!==l?(p=(0,R.jsx)(W,{"data-testid":m,onClick:i,size:"xs",type:"button",variant:"ghost",children:l}),e[6]=i,e[7]=m,e[8]=l,e[9]=p):p=e[9];let f;e[10]!==c||e[11]!==p?(f=(0,R.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[c,p]}),e[10]=c,e[11]=p,e[12]=f):f=e[12];let h;e[13]!==a||e[14]!==n?(h=(0,R.jsx)("pre",{className:"overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-xs","data-testid":n,children:a}),e[13]=a,e[14]=n,e[15]=h):h=e[15];let g;return e[16]!==f||e[17]!==h?(g=(0,R.jsxs)("div",{className:"flex flex-col gap-1.5",children:[f,h]}),e[16]=f,e[17]=h,e[18]=g):g=e[18],g},"U"),nt=u(t=>{let e=(0,Y.c)(46),{file:a,fn:r,kind:n}=t,s=J(),[o,i]=(0,X.useState)("react"),c,m,l;if(e[0]!==a||e[1]!==r||e[2]!==n||e[3]!==s||e[4]!==o){let w={file:a,fn:r,kind:n},j;e[8]!==s?(j=s("CLI"),e[8]=s,e[9]=j):j=e[9];let O;e[10]!==s?(O=s("Client"),e[10]=s,e[11]=O):O=e[11];let S;e[12]!==s?(S=s("React"),e[12]=s,e[13]=S):S=e[13];let C;e[14]!==j||e[15]!==O||e[16]!==S?(C={cli:j,client:O,react:S},e[14]=j,e[15]=O,e[16]=S,e[17]=C):C=e[17],l=C;let A;e[18]===Symbol.for("react.memo_cache_sentinel")?(A=u(_=>{i(_.currentTarget.dataset.tab)},"B"),e[18]=A):A=e[18],c=A,m=at(o,w),e[0]=a,e[1]=r,e[2]=n,e[3]=s,e[4]=o,e[5]=c,e[6]=m,e[7]=l}else c=e[5],m=e[6],l=e[7];let p=m,f=`api.${a}.${r}`,h;e[19]!==f?(h=(0,R.jsx)("h2",{className:"font-mono text-sm font-semibold text-foreground","data-testid":"api-fn-title",children:f}),e[19]=f,e[20]=h):h=e[20];let g;e[21]!==n||e[22]!==s?(g=s("Call this {kind} from your app.",{kind:n}),e[21]=n,e[22]=s,e[23]=g):g=e[23];let x;e[24]!==g?(x=(0,R.jsx)("p",{className:"text-xs text-muted-foreground",children:g}),e[24]=g,e[25]=x):x=e[25];let v;e[26]!==h||e[27]!==x?(v=(0,R.jsxs)("div",{children:[h,x]}),e[26]=h,e[27]=x,e[28]=v):v=e[28];let N;e[29]!==s?(N=s("Snippet flavour"),e[29]=s,e[30]=N):N=e[30];let y;e[31]!==c||e[32]!==o||e[33]!==l?(y=Xe.map(w=>(0,R.jsx)(W,{"aria-selected":o===w,"data-tab":w,"data-testid":`api-tab-${w}`,onClick:c,role:"tab",size:"xs",type:"button",variant:o===w?"default":"outline",children:l[w]},w)),e[31]=c,e[32]=o,e[33]=l,e[34]=y):y=e[34];let b;e[35]!==N||e[36]!==y?(b=(0,R.jsx)("div",{"aria-label":N,className:"flex gap-1.5","data-testid":"api-tabs",role:"tablist",children:y}),e[35]=N,e[36]=y,e[37]=b):b=e[37];let I=l[o],P=`api-snippet-${o}`,$;e[38]!==p||e[39]!==I||e[40]!==P?($=(0,R.jsx)(Re,{code:p,label:I,testId:P}),e[38]=p,e[39]=I,e[40]=P,e[41]=$):$=e[41];let k;return e[42]!==$||e[43]!==v||e[44]!==b?(k=(0,R.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"api-fn-doc",children:[v,b,$]}),e[42]=$,e[43]=v,e[44]=b,e[45]=k):k=e[45],k},"de"),ot=u(t=>{let e=(0,Y.c)(19),{name:a}=t,r=J(),n;e[0]!==a?(n=rt(a),e[0]=a,e[1]=n):n=e[1];let s=n,o;e[2]!==a?(o=(0,R.jsx)("h2",{className:"font-mono text-sm font-semibold text-foreground","data-testid":"api-table-title",children:a}),e[2]=a,e[3]=o):o=e[3];let i;e[4]!==r?(i=r("Read and write this table through the typed data model."),e[4]=r,e[5]=i):i=e[5];let c;e[6]!==i?(c=(0,R.jsx)("p",{className:"text-xs text-muted-foreground",children:i}),e[6]=i,e[7]=c):c=e[7];let m;e[8]!==o||e[9]!==c?(m=(0,R.jsxs)("div",{children:[o,c]}),e[8]=o,e[9]=c,e[10]=m):m=e[10];let l;e[11]!==r?(l=r("Data model"),e[11]=r,e[12]=l):l=e[12];let p;e[13]!==s||e[14]!==l?(p=(0,R.jsx)(Re,{code:s,label:l,testId:"api-snippet-table"}),e[13]=s,e[14]=l,e[15]=p):p=e[15];let f;return e[16]!==m||e[17]!==p?(f=(0,R.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"api-table-doc",children:[m,p]}),e[16]=m,e[17]=p,e[18]=f):f=e[18],f},"fe"),Te=u(t=>{let e=(0,Y.c)(8),{active:a,label:r,onSelect:n,testId:s,value:o}=t,i;e[0]!==n||e[1]!==o?(i=u(()=>{n(o)},"m"),e[0]=n,e[1]=o,e[2]=i):i=e[2];let c=i,m=a?"page":void 0,l;return e[3]!==r||e[4]!==c||e[5]!==m||e[6]!==s?(l=(0,R.jsx)("button",{"aria-current":m,className:"w-full truncate rounded-md px-2 py-1 text-start font-mono text-xs text-muted-foreground outline-none transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:bg-sidebar-accent aria-[current=page]:bg-sidebar-accent aria-[current=page]:font-medium aria-[current=page]:text-foreground","data-testid":s,onClick:c,type:"button",children:r}),e[3]=r,e[4]=c,e[5]=m,e[6]=s,e[7]=l):l=e[7],l},"G"),st=u(t=>{let e=new Map;for(let a of t){let{file:r,fn:n}=Ce(a.path),s=e.get(r)??[];s.push({fn:n,kind:a.kind,path:a.path}),e.set(r,s)}return[...e.entries()].map(([a,r])=>({file:a,items:r.toSorted((n,s)=>n.fn.localeCompare(s.fn))})).toSorted((a,r)=>a.file.localeCompare(r.file))},"pe"),Ae=u(t=>{let e=(0,Y.c)(58),{functions:a,initialShardKey:r}=t,n=J(),s=F(),[o,i]=(0,X.useState)(null),[c,m]=(0,X.useState)(null),l,p;e[0]!==s||e[1]!==r?(l=u(()=>{let _=!1;return s.query(Ve,{},ie(r??"")).then(T=>(_||i(T),T)).catch(()=>{_||i([])}),()=>{_=!0}},"o"),p=[s,r],e[0]=s,e[1]=r,e[2]=l,e[3]=p):(l=e[2],p=e[3]),(0,X.useEffect)(l,p);let f,h,g,x,v,N,y,b,I,P;if(e[4]!==a||e[5]!==c||e[6]!==n||e[7]!==o){let _=a??[],T=st(_),L=(o??[]).map(it).toSorted(lt),E;e[18]===Symbol.for("react.memo_cache_sentinel")?(E=u(M=>{m({kind:"fn",path:M})},"P"),e[18]=E):E=e[18];let D=E,Q;e[19]===Symbol.for("react.memo_cache_sentinel")?(Q=u(M=>{m({kind:"table",name:M})},"j"),e[19]=Q):Q=e[19];let Qe=Q;h=c?.kind==="fn"?_.find(M=>M.path===c.path):void 0,f=_.length>0||L.length>0,g=h===void 0?void 0:Ce(h.path),I="grid min-h-0 gap-6 md:grid-cols-[16rem_minmax(0,1fr)]",P="lunora-api-docs",e[20]!==n?(x=n("API resources"),e[20]=n,e[21]=x):x=e[21],v="flex flex-col gap-4 overflow-y-auto",N="api-rail";let ne;e[22]!==c||e[23]!==n?(ne=u(M=>(0,R.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,R.jsx)("span",{className:"px-2 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:M.file||n("(root)")}),M.items.map(ee=>(0,R.jsx)(Te,{active:c?.kind==="fn"&&c.path===ee.path,label:ee.fn,onSelect:D,testId:`api-rail-fn-${ee.path}`,value:ee.path},ee.path))]},M.file),"q"),e[22]=c,e[23]=n,e[24]=ne):ne=e[24],y=T.map(ne),b=L.length>0&&(0,R.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,R.jsx)("span",{className:"px-2 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:n("Tables")}),L.map(M=>(0,R.jsx)(Te,{active:c?.kind==="table"&&c.name===M,label:M,onSelect:Qe,testId:`api-rail-table-${M}`,value:M},M))]}),e[4]=a,e[5]=c,e[6]=n,e[7]=o,e[8]=f,e[9]=h,e[10]=g,e[11]=x,e[12]=v,e[13]=N,e[14]=y,e[15]=b,e[16]=I,e[17]=P}else f=e[8],h=e[9],g=e[10],x=e[11],v=e[12],N=e[13],y=e[14],b=e[15],I=e[16],P=e[17];let $;e[25]!==f||e[26]!==n?($=!f&&(0,R.jsx)("p",{className:"px-2 text-xs text-muted-foreground","data-testid":"api-rail-empty",children:n("No functions or tables to document yet.")}),e[25]=f,e[26]=n,e[27]=$):$=e[27];let k;e[28]!==$||e[29]!==x||e[30]!==v||e[31]!==N||e[32]!==y||e[33]!==b?(k=(0,R.jsxs)("nav",{"aria-label":x,className:v,"data-testid":N,children:[y,b,$]}),e[28]=$,e[29]=x,e[30]=v,e[31]=N,e[32]=y,e[33]=b,e[34]=k):k=e[34];let w;e[35]!==c||e[36]!==n?(w=c===null&&(0,R.jsx)(U,{description:n("Select a function or table to see how to call it from your app."),testId:"api-empty",title:n("API usage snippets")}),e[35]=c,e[36]=n,e[37]=w):w=e[37];let j;e[38]!==c?.kind||e[39]!==h||e[40]!==g?(j=c?.kind==="fn"&&h!==void 0&&g!==void 0&&(0,R.jsx)(nt,{file:g.file,fn:g.fn,kind:h.kind},h.path),e[38]=c?.kind,e[39]=h,e[40]=g,e[41]=j):j=e[41];let O;e[42]!==c?.kind||e[43]!==h||e[44]!==n?(O=c?.kind==="fn"&&h===void 0&&(0,R.jsx)(U,{testId:"api-empty",title:n("API usage snippets")}),e[42]=c?.kind,e[43]=h,e[44]=n,e[45]=O):O=e[45];let S;e[46]!==c?(S=c?.kind==="table"&&(0,R.jsx)(ot,{name:c.name}),e[46]=c,e[47]=S):S=e[47];let C;e[48]!==w||e[49]!==j||e[50]!==O||e[51]!==S?(C=(0,R.jsxs)("div",{className:"min-w-0",children:[w,j,O,S]}),e[48]=w,e[49]=j,e[50]=O,e[51]=S,e[52]=C):C=e[52];let A;return e[53]!==k||e[54]!==C||e[55]!==I||e[56]!==P?(A=(0,R.jsxs)("div",{className:I,"data-testid":P,children:[k,C]}),e[53]=k,e[54]=C,e[55]=I,e[56]=P,e[57]=A):A=e[57],A},"ke");function it(t){return t.name}u(it,"ue");function lt(t,e){return t.localeCompare(e)}u(lt,"me");var De=K(te(),1);var z=K(te(),1);var q=K(me(),1);var d=K(re(),1);var dt=u(t=>typeof t=="number"?"number":typeof t=="boolean"?"boolean":"string","we"),Je=u(t=>{if(t.enum!==void 0&&t.enum.length>0)return t.enum;if(t.anyOf!==void 0&&t.anyOf.length>0&&t.anyOf.every(e=>e.const!==void 0))return t.anyOf.map(e=>e.const)},"Q"),ce=u(t=>t===void 0?"any":t.const!==void 0?JSON.stringify(t.const):t.enum!==void 0&&t.enum.length>0?t.enum.map(e=>JSON.stringify(e)).join(" | "):t.anyOf!==void 0&&t.anyOf.length>0?t.anyOf.map(e=>ce(e)).join(" | "):t.type==="array"?`array<${ce(t.items)}>`:t.type??"any","z"),ct=u(t=>{let e=Je(t);return e!==void 0?t.type??dt(e[0]):ce(t)},"ke"),pt=u(t=>{let e=Je(t);return e===void 0?void 0:e.map(a=>JSON.stringify(a)).join(" | ")},"Oe"),mt=u(t=>{let e=[];t.minimum!==void 0?e.push(`${String(t.minimum)} \u2264`):t.exclusiveMinimum!==void 0&&e.push(`${String(t.exclusiveMinimum)} <`);let a=e.length>0;e.push("value"),t.maximum!==void 0?e.push(`\u2264 ${String(t.maximum)}`):t.exclusiveMaximum!==void 0&&e.push(`< ${String(t.exclusiveMaximum)}`);let r=e.length>(a?2:1);return a||r?e.join(" "):void 0},"$e"),ut=u(t=>{if(t.type==="object"&&t.properties!==void 0)return t;if(t.type==="array"&&t.items?.type==="object"&&t.items.properties!==void 0)return t.items},"Te"),Z=u(t=>{if(t===void 0)return null;if(t.const!==void 0)return t.const;if(t.enum!==void 0&&t.enum.length>0)return t.enum[0];if(t.anyOf!==void 0&&t.anyOf.length>0)return Z(t.anyOf[0]);switch(t.type){case"array":return[];case"boolean":return!1;case"number":return 0;case"object":{let e={};for(let[a,r]of Object.entries(t.properties??{}))e[a]=Z(r);return e}case"string":return"";default:return null}},"D"),de=u(t=>{let e=(0,z.c)(7),{label:a,value:r}=t,n;e[0]!==a?(n=(0,d.jsx)("span",{className:"text-muted-foreground",children:a}),e[0]=a,e[1]=n):n=e[1];let s;e[2]!==r?(s=(0,d.jsx)("span",{className:"text-foreground",children:r}),e[2]=r,e[3]=s):s=e[3];let o;return e[4]!==n||e[5]!==s?(o=(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 rounded border border-border px-1.5 py-0.5 font-mono text-[10px]",children:[n,s]}),e[4]=n,e[5]=s,e[6]=o):o=e[6],o},"K"),ft=u(t=>{let e=(0,z.c)(40),{name:a,required:r,schema:n}=t,s=J(),o;e[0]!==n?(o=mt(n),e[0]=n,e[1]=o):o=e[1];let i=o,c;e[2]!==n?(c=pt(n),e[2]=n,e[3]=c):c=e[3];let m=c,l=n["x-lunora-table"],p=n.format!==void 0||i!==void 0||m!==void 0||l!==void 0,f;e[4]!==n?(f=ut(n),e[4]=n,e[5]=f):f=e[5];let h=f,g=r?"*":"?",x;e[6]!==g?(x=(0,d.jsx)("span",{className:"text-muted-foreground",children:g}),e[6]=g,e[7]=x):x=e[7];let v;e[8]!==a||e[9]!==x?(v=(0,d.jsxs)("span",{className:"font-mono text-foreground",children:[a,x]}),e[8]=a,e[9]=x,e[10]=v):v=e[10];let N;e[11]!==n?(N=ct(n),e[11]=n,e[12]=N):N=e[12];let y;e[13]!==N?(y=(0,d.jsx)("span",{className:"font-mono text-muted-foreground",children:N}),e[13]=N,e[14]=y):y=e[14];let b;e[15]!==v||e[16]!==y?(b=(0,d.jsxs)("div",{className:"flex items-baseline gap-2",children:[v,y]}),e[15]=v,e[16]=y,e[17]=b):b=e[17];let I;e[18]!==n.description?(I=n.description!==void 0&&(0,d.jsx)("p",{className:"max-w-prose text-muted-foreground",children:n.description}),e[18]=n.description,e[19]=I):I=e[19];let P;e[20]!==p||e[21]!==i||e[22]!==l||e[23]!==n.format||e[24]!==s||e[25]!==m?(P=p&&(0,d.jsxs)("div",{className:"flex flex-wrap gap-1",children:[n.format!==void 0&&(0,d.jsx)(de,{label:s("Format"),value:n.format}),i!==void 0&&(0,d.jsx)(de,{label:s("Range"),value:i}),m!==void 0&&(0,d.jsx)(de,{label:s("Value in"),value:m}),l!==void 0&&(0,d.jsx)(de,{label:s("relation"),value:l})]}),e[20]=p,e[21]=i,e[22]=l,e[23]=n.format,e[24]=s,e[25]=m,e[26]=P):P=e[26];let $;e[27]!==I||e[28]!==P||e[29]!==b?($=(0,d.jsxs)("div",{className:"flex flex-col gap-1 py-2",children:[b,I,P]}),e[27]=I,e[28]=P,e[29]=b,e[30]=$):$=e[30];let k=$;if(h===void 0){let S;return e[31]!==k?(S=(0,d.jsx)("div",{className:"border-b border-border/50 last:border-b-0",children:k}),e[31]=k,e[32]=S):S=e[32],S}let w;e[33]!==k?(w=(0,d.jsx)("summary",{className:"cursor-pointer marker:text-muted-foreground",children:k}),e[33]=k,e[34]=w):w=e[34];let j;e[35]!==h?(j=(0,d.jsx)("div",{className:"mb-2 ml-2 border-l border-border pl-3",children:(0,d.jsx)(Le,{schema:h})}),e[35]=h,e[36]=j):j=e[36];let O;return e[37]!==w||e[38]!==j?(O=(0,d.jsxs)("details",{className:"border-b border-border/50 last:border-b-0",children:[w,j]}),e[37]=w,e[38]=j,e[39]=O):O=e[39],O},"Ee"),Le=u(t=>{let e=(0,z.c)(7),{schema:a}=t,r;e[0]!==a.required?(r=new Set(a.required),e[0]=a.required,e[1]=r):r=e[1];let n=r,s;e[2]!==a.properties?(s=Object.entries(a.properties??{}),e[2]=a.properties,e[3]=s):s=e[3];let o=s,i;return e[4]!==n||e[5]!==o?(i=(0,d.jsx)("div",{className:"flex flex-col",children:o.map(c=>{let[m,l]=c;return(0,d.jsx)(ft,{name:m,required:n.has(m),schema:l},m)})}),e[4]=n,e[5]=o,e[6]=i):i=e[6],i},"Z"),_e=u(t=>{let e=(0,z.c)(10),{schema:a,testId:r}=t;if(a?.type!=="object"||Object.keys(a.properties??{}).length===0){let o;e[0]!==a?(o=ce(a),e[0]=a,e[1]=o):o=e[1];let i;return e[2]!==o||e[3]!==r?(i=(0,d.jsx)("p",{className:"font-mono text-xs text-muted-foreground","data-testid":r,children:o}),e[2]=o,e[3]=r,e[4]=i):i=e[4],i}let n;e[5]!==a?(n=(0,d.jsx)(Le,{schema:a}),e[5]=a,e[6]=n):n=e[6];let s;return e[7]!==n||e[8]!==r?(s=(0,d.jsx)("div",{className:"text-xs","data-testid":r,children:n}),e[7]=n,e[8]=r,e[9]=s):s=e[9],s},"V"),ht=["curl","javascript","lunora"],gt={lunora:"Lunora",curl:"cURL",javascript:"JavaScript"},xt=u(t=>`api.${t.replaceAll(/[/:]/g,".")}`,"je"),bt=u(t=>{let e=Z(t.argsSchema)??{};return t.functionPath===void 0?e:{args:e,functionPath:t.functionPath}},"Ae"),yt=u((t,e,a)=>{let r=`${a}${e.httpPath}`,n=JSON.stringify(bt(e),void 0,2),s=JSON.stringify(Z(e.argsSchema)??{},void 0,2);switch(t){case"curl":{let o=e.method!=="GET"&&e.method!=="HEAD",i=[`curl -X ${e.method} ${JSON.stringify(r)}`];return o&&i.push(' -H "Content-Type: application/json"',` -d '${n}'`),i.join(` \\
|
|
3
|
+
`)}case"lunora":return e.functionPath===void 0?`await fetch(${JSON.stringify(e.httpPath)}, { method: ${JSON.stringify(e.method)} });`:`import { useLunora } from "@lunora/react";
|
|
4
|
+
import { api } from "./_generated/api";
|
|
5
|
+
|
|
6
|
+
const client = useLunora();
|
|
7
|
+
await client.${e.kind??"query"}(${xt(e.functionPath)}, ${s});`;default:{let o=e.method!=="GET"&&e.method!=="HEAD"?`{
|
|
8
|
+
method: ${JSON.stringify(e.method)},
|
|
9
|
+
headers: { "Content-Type": "application/json" },
|
|
10
|
+
body: JSON.stringify(${n}),
|
|
11
|
+
}`:`{ method: ${JSON.stringify(e.method)} }`;return`const response = await fetch(${JSON.stringify(r)}, ${o});
|
|
12
|
+
const data = await response.json();`}}},"Ie"),vt=u(t=>{let e=(0,z.c)(24),{operation:a,server:r}=t,n=J(),[s,o]=(0,q.useState)("curl"),i;e[0]!==a||e[1]!==s||e[2]!==r?(i=yt(s,a,r),e[0]=a,e[1]=s,e[2]=r,e[3]=i):i=e[3];let c=i,m;e[4]!==c?(m=u(()=>{ae(c)},"d"),e[4]=c,e[5]=m):m=e[5];let l=m,p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=u(I=>{o(I.currentTarget.dataset.sample)},"u"),e[6]=p):p=e[6];let f=p,h;e[7]!==s?(h=ht.map(I=>(0,d.jsx)("button",{"aria-selected":s===I,className:"rounded px-2 py-0.5 text-xs text-muted-foreground transition-colors hover:text-foreground aria-selected:bg-muted aria-selected:font-medium aria-selected:text-foreground","data-sample":I,"data-testid":`api-sample-${I}`,onClick:f,role:"tab",type:"button",children:gt[I]},I)),e[7]=s,e[8]=h):h=e[8];let g;e[9]!==h?(g=(0,d.jsx)("div",{className:"flex gap-1",role:"tablist",children:h}),e[9]=h,e[10]=g):g=e[10];let x;e[11]!==n?(x=n("Copy"),e[11]=n,e[12]=x):x=e[12];let v;e[13]!==l||e[14]!==x?(v=(0,d.jsx)(W,{"data-testid":"api-sample-copy",onClick:l,size:"xs",type:"button",variant:"ghost",children:x}),e[13]=l,e[14]=x,e[15]=v):v=e[15];let N;e[16]!==g||e[17]!==v?(N=(0,d.jsxs)("div",{className:"flex items-center justify-between gap-2 border-b border-border px-3 py-2",children:[g,v]}),e[16]=g,e[17]=v,e[18]=N):N=e[18];let y;e[19]!==c?(y=(0,d.jsx)("pre",{className:"overflow-auto px-3 pb-3 font-mono text-xs","data-testid":"api-sample-source",children:c}),e[19]=c,e[20]=y):y=e[20];let b;return e[21]!==N||e[22]!==y?(b=(0,d.jsxs)("div",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card","data-testid":"api-code-samples",children:[N,y]}),e[21]=N,e[22]=y,e[23]=b):b=e[23],b},"Pe"),Nt={blue:"text-info",emerald:"text-success",neutral:"text-muted-foreground",orange:"text-warning",red:"text-destructive",violet:"text-royal-amethyst"},kt=u(t=>{switch(t.toUpperCase()){case"DELETE":return"red";case"GET":return"emerald";case"PATCH":return"orange";case"POST":return"blue";case"PUT":return"orange";default:return"neutral"}},"_e"),wt=u(t=>{switch(t){case"action":return"violet";case"mutation":return"orange";case"query":return"emerald";default:return"neutral"}},"Be"),ge=u(t=>{let e=(0,z.c)(7),{kind:a,method:r,testId:n}=t,s;e[0]!==a||e[1]!==r?(s=a??r.toUpperCase(),e[0]=a,e[1]=r,e[2]=s):s=e[2];let o=s,i=a===void 0?kt(r):wt(a),c=`${Nt[i]} font-mono text-[10px] tracking-wide uppercase`,m;return e[3]!==o||e[4]!==c||e[5]!==n?(m=(0,d.jsx)(ye,{className:c,"data-testid":n,variant:"ghost",children:o}),e[3]=o,e[4]=c,e[5]=n,e[6]=m):m=e[6],m},"q"),Me=u(t=>t.startsWith("2")?"text-emerald-600 dark:text-emerald-400":t==="default"||t.startsWith("4")||t.startsWith("5")?"text-red-600 dark:text-red-400":"text-muted-foreground","ee"),qe=u(t=>t.startsWith("2")?"bg-emerald-500":t==="default"||t.startsWith("4")||t.startsWith("5")?"bg-red-500":"bg-muted-foreground","te"),St=new Set([" ",`
|
|
13
|
+
`,"\r"]),Ee=" ",It=u(t=>{let e="";for(let n of t)St.has(n)||(e+=n);let a=0,r=e.length;for(;a<r&&(e[a]??"")<=Ee;)a+=1;for(;r>a&&(e[r-1]??"")<=Ee;)r-=1;return e.slice(a,r)},"Je"),Ot=/^(?:[a-z][\d+.a-z-]*:)?\/\//i,$t=u((t,e)=>{let a=globalThis.location?.origin??"",r=e===""?a:e,n=It(t);if(r===""){if(Ot.test(n))throw new Error(`restDispatch: refusing to send the admin token off-origin (${n} names its own host and there is no origin to check it against)`);return n}let s=new URL(n,r);if(s.origin!==new URL(r).origin)throw new Error(`restDispatch: refusing to send the admin token off-origin (${s.origin} is not ${r})`);return s.toString()},"Ke"),Pt=u(async(t,e,a,r)=>{let n=t.method!=="GET"&&t.method!=="HEAD",s=$t(t.httpPath,a),o=await(await fetch(s,{body:n?JSON.stringify(e):void 0,headers:{...n?{"content-type":"application/json"}:{},...r===null||r===""?{}:{authorization:`Bearer ${r}`}},method:t.method})).text();try{return JSON.parse(o)}catch{return o}},"ze"),jt=u(t=>JSON.stringify(Z(t.argsSchema)??{},void 0,2),"Fe"),Ke=(0,q.createContext)(null),ze=u(()=>{let t=(0,q.use)(Ke);if(t===null)throw new be("INTERNAL","useOperationRun must be used within an OperationRunProvider");return t},"se"),Tt=u(({children:t,operation:e})=>{let a=J(),r=F(),[n,s]=(0,q.useState)(()=>jt(e)),[o,i]=(0,q.useState)(""),[c,m]=(0,q.useState)("idle"),[l,p]=(0,q.useState)(void 0),[f,h]=(0,q.useState)(null),[g,x]=(0,q.useState)(null),v=u(async()=>{let N;try{N=n.trim()===""?{}:JSON.parse(n)}catch(b){m("error"),p(void 0),x(null),h(a("Invalid JSON args: {message}",{message:fe(b)}));return}m("running"),h(null);let y=performance.now();try{let b=await(e.functionPath===void 0?Pt(e,N,r.url,r.getAuthToken()):Se(r,e.kind,se(e.functionPath),N,ie(o)));p(b),x(Math.round(performance.now()-y)),m("success")}catch(b){p(void 0),x(Math.round(performance.now()-y)),h(fe(b)),m("error")}},"v");return(0,d.jsx)(Ke,{value:{argsText:n,durationMs:g,error:f,operation:e,response:l,send:u(()=>{Oe(v())},"send"),setArgsText:s,setShardKey:i,shardKey:o,status:c},children:t})},"We"),Ct=u(()=>{let t=(0,z.c)(48),e=J(),{argsText:a,operation:r,send:n,setArgsText:s,setShardKey:o,shardKey:i,status:c}=ze(),m;t[0]!==s?(m=u(T=>{s(T.target.value)},"d"),t[0]=s,t[1]=m):m=t[1];let l=m,p;t[2]!==n?(p=u(T=>{T.key==="Enter"&&(T.metaKey||T.ctrlKey)&&(T.preventDefault(),n())},"u"),t[2]=n,t[3]=p):p=t[3];let f=p,h=c==="running",g;t[4]!==r.kind||t[5]!==r.method?(g=(0,d.jsx)(ge,{kind:r.kind,method:r.method,testId:"api-try-method"}),t[4]=r.kind,t[5]=r.method,t[6]=g):g=t[6];let x=r.functionPath??r.httpPath,v;t[7]!==x?(v=(0,d.jsx)("code",{className:"min-w-0 flex-1 truncate font-mono text-xs text-foreground",children:x}),t[7]=x,t[8]=v):v=t[8];let N=h?"animate-pulse":void 0,y;t[9]!==N?(y=(0,d.jsx)(oe,{className:N,icon:we,strokeWidth:2}),t[9]=N,t[10]=y):y=t[10];let b;t[11]!==h||t[12]!==e?(b=e(h?"Sending\u2026":"Send"),t[11]=h,t[12]=e,t[13]=b):b=t[13];let I;t[14]!==h||t[15]!==n||t[16]!==y||t[17]!==b?(I=(0,d.jsxs)(W,{"data-testid":"api-try-send",disabled:h,onClick:n,size:"sm",type:"button",children:[y,b]}),t[14]=h,t[15]=n,t[16]=y,t[17]=b,t[18]=I):I=t[18];let P;t[19]!==g||t[20]!==v||t[21]!==I?(P=(0,d.jsxs)("div",{className:"flex items-center gap-2 border-b border-border bg-muted px-3 py-2",children:[g,v,I]}),t[19]=g,t[20]=v,t[21]=I,t[22]=P):P=t[22];let $;t[23]!==e?($=e("Arguments (JSON)"),t[23]=e,t[24]=$):$=t[24];let k;t[25]!==$?(k=(0,d.jsx)(he,{htmlFor:"api-try-args",children:$}),t[25]=$,t[26]=k):k=t[26];let w;t[27]!==a?(w=a.split(`
|
|
14
|
+
`),t[27]=a,t[28]=w):w=t[28];let j=Math.min(12,Math.max(3,w.length)),O;t[29]!==a||t[30]!==l||t[31]!==f||t[32]!==j?(O=(0,d.jsx)(je,{className:"font-mono text-xs","data-testid":"api-try-args",id:"api-try-args",onChange:l,onKeyDown:f,rows:j,spellCheck:!1,value:a}),t[29]=a,t[30]=l,t[31]=f,t[32]=j,t[33]=O):O=t[33];let S;t[34]!==k||t[35]!==O?(S=(0,d.jsxs)("div",{className:"flex flex-col gap-1.5",children:[k,O]}),t[34]=k,t[35]=O,t[36]=S):S=t[36];let C;t[37]!==r.functionPath||t[38]!==o||t[39]!==i||t[40]!==e?(C=r.functionPath!==void 0&&(0,d.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,d.jsx)(he,{htmlFor:"shard-input",children:e("Shard key (optional)")}),(0,d.jsx)(Pe,{id:"shard-input",onChange:o,testId:"shard-input",value:i})]}),t[37]=r.functionPath,t[38]=o,t[39]=i,t[40]=e,t[41]=C):C=t[41];let A;t[42]!==S||t[43]!==C?(A=(0,d.jsxs)("div",{className:"flex flex-col gap-3 p-3",children:[S,C]}),t[42]=S,t[43]=C,t[44]=A):A=t[44];let _;return t[45]!==A||t[46]!==P?(_=(0,d.jsxs)("div",{className:"overflow-hidden rounded-xl border border-border bg-card","data-testid":"api-try-it",children:[P,A]}),t[45]=A,t[46]=P,t[47]=_):_=t[47],_},"qe"),Rt=u(t=>{let e=(0,z.c)(51),{operation:a}=t,r=J(),n=`api-operation-${a.operationId}`,s=a.key,o;e[0]!==a.kind||e[1]!==a.method?(o=(0,d.jsx)(ge,{kind:a.kind,method:a.method,testId:"api-operation-method"}),e[0]=a.kind,e[1]=a.method,e[2]=o):o=e[2];let i=a.functionPath??a.httpPath,c;e[3]!==i?(c=(0,d.jsx)("code",{className:"truncate font-mono text-xs text-muted-foreground",children:i}),e[3]=i,e[4]=c):c=e[4];let m;e[5]!==o||e[6]!==c?(m=(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[o,c]}),e[5]=o,e[6]=c,e[7]=m):m=e[7];let l;e[8]!==a.title?(l=(0,d.jsx)("h1",{className:"text-lg font-semibold text-foreground","data-testid":"api-operation-title",children:a.title}),e[8]=a.title,e[9]=l):l=e[9];let p;e[10]!==a.description?(p=a.description!==void 0&&(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:a.description}),e[10]=a.description,e[11]=p):p=e[11];let f;e[12]!==m||e[13]!==l||e[14]!==p?(f=(0,d.jsxs)("header",{className:"sticky top-0 z-10 -mx-6 -mt-6 flex flex-col gap-2 border-b border-border bg-background px-6 pt-6 pb-3",children:[m,l,p]}),e[12]=m,e[13]=l,e[14]=p,e[15]=f):f=e[15];let h;e[16]!==r?(h=r("Try it"),e[16]=r,e[17]=h):h=e[17];let g;e[18]!==h?(g=(0,d.jsx)("h2",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:h}),e[18]=h,e[19]=g):g=e[19];let x;e[20]===Symbol.for("react.memo_cache_sentinel")?(x=(0,d.jsx)(Ct,{}),e[20]=x):x=e[20];let v;e[21]!==g?(v=(0,d.jsxs)("section",{className:"flex flex-col gap-2",children:[g,x]}),e[21]=g,e[22]=v):v=e[22];let N;e[23]!==r?(N=r("Request arguments"),e[23]=r,e[24]=N):N=e[24];let y;e[25]!==N?(y=(0,d.jsx)("h2",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:N}),e[25]=N,e[26]=y):y=e[26];let b;e[27]!==a.argsSchema?(b=(0,d.jsx)(_e,{schema:a.argsSchema,testId:"api-operation-args"}),e[27]=a.argsSchema,e[28]=b):b=e[28];let I;e[29]!==y||e[30]!==b?(I=(0,d.jsxs)("section",{className:"flex flex-col gap-2",children:[y,b]}),e[29]=y,e[30]=b,e[31]=I):I=e[31];let P;e[32]!==r?(P=r("Response body"),e[32]=r,e[33]=P):P=e[33];let $;e[34]!==P?($=(0,d.jsx)("h2",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:P}),e[34]=P,e[35]=$):$=e[35];let k;if(e[36]!==a.responses||e[37]!==r){let O;e[39]!==r?(O=u(S=>(0,d.jsxs)("div",{className:"flex flex-col gap-1.5 rounded-xl border border-border bg-card p-3",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,d.jsxs)("span",{className:`inline-flex items-center gap-1.5 font-mono text-xs font-semibold ${Me(S.status)}`,children:[(0,d.jsx)("span",{className:`size-1.5 rounded-full ${qe(S.status)}`}),S.status]}),S.schema!==void 0&&(0,d.jsx)("span",{className:"rounded border border-border px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:r("application/json")})]}),S.description!==void 0&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:S.description}),S.schema!==void 0&&(0,d.jsx)(_e,{schema:S.schema,testId:`api-response-${S.status}`})]},S.status),"E"),e[39]=r,e[40]=O):O=e[40],k=a.responses.map(O),e[36]=a.responses,e[37]=r,e[38]=k}else k=e[38];let w;e[41]!==$||e[42]!==k?(w=(0,d.jsxs)("section",{className:"flex flex-col gap-3",children:[$,k]}),e[41]=$,e[42]=k,e[43]=w):w=e[43];let j;return e[44]!==a.key||e[45]!==n||e[46]!==v||e[47]!==I||e[48]!==w||e[49]!==f?(j=(0,d.jsxs)("div",{className:"flex flex-col gap-6 duration-200 animate-in fade-in-0 slide-in-from-bottom-1","data-testid":n,children:[f,v,I,w]},s),e[44]=a.key,e[45]=n,e[46]=v,e[47]=I,e[48]=w,e[49]=f,e[50]=j):j=e[50],j},"He"),At={boolean:"text-royal-amethyst",key:"text-sky-sapphire",number:"text-warning",plain:"",string:"text-success"},_t=/"(?:[^"\\]|\\.)*"|\b(?:true|false|null)\b|-?\d+(?:\.\d+)?/g,Et=/^\s*:/,Jt=u((t,e,a)=>a.startsWith('"')?Et.test(t.slice(e))?"key":"string":a==="true"||a==="false"||a==="null"?"boolean":"number","Xe"),Lt=u(t=>{let e=[],a=0;for(let r of t.matchAll(_t)){let{index:n}=r,s=r[0],o=n+s.length;n>a&&e.push({kind:"plain",start:a,text:t.slice(a,n)}),e.push({kind:Jt(t,o,s),start:n,text:s}),a=o}return a<t.length&&e.push({kind:"plain",start:a,text:t.slice(a)}),e},"Ye"),Mt=u(t=>{let e=(0,z.c)(4),{code:a}=t,r;e[0]!==a?(r=Lt(a).map(qt),e[0]=a,e[1]=r):r=e[1];let n;return e[2]!==r?(n=(0,d.jsx)(d.Fragment,{children:r}),e[2]=r,e[3]=n):n=e[3],n},"Qe");function qt(t){return(0,d.jsx)("span",{className:At[t.kind],children:t.text},t.start)}u(qt,"Ze");var Be="__live__",Kt=u(t=>t.schema===void 0?"":JSON.stringify(Z(t.schema),void 0,2),"et"),zt=u((t,e,a)=>a?t??"":e===void 0?"":JSON.stringify(e,Ie,2),"tt"),Bt=u(t=>{let e=(0,z.c)(18),{active:a,running:r,showError:n}=t,s=J();if(r){let p;e[0]!==s?(p=s("Sending\u2026"),e[0]=s,e[1]=p):p=e[1];let f;return e[2]!==p?(f=(0,d.jsx)("p",{className:"px-3 py-3 text-xs text-muted-foreground","data-testid":"api-response-running",children:p}),e[2]=p,e[3]=f):f=e[3],f}if(a===void 0||a.body===""){let p;e[4]!==a?.live||e[5]!==s?(p=a?.live===!0?s("Send a request to see the response."):s("No example for this response."),e[4]=a?.live,e[5]=s,e[6]=p):p=e[6];let f;return e[7]!==p?(f=(0,d.jsx)("p",{className:"px-3 py-3 text-xs text-muted-foreground","data-testid":"api-response-idle",children:p}),e[7]=p,e[8]=f):f=e[8],f}let o=n&&"text-destructive",i;e[9]!==o?(i=ue("max-h-[28rem] overflow-auto px-3 py-3 font-mono text-xs",o),e[9]=o,e[10]=i):i=e[10];let c=n?"api-response-error":"api-response-body",m;e[11]!==a.body||e[12]!==n?(m=n?a.body:(0,d.jsx)(Mt,{code:a.body}),e[11]=a.body,e[12]=n,e[13]=m):m=e[13];let l;return e[14]!==i||e[15]!==c||e[16]!==m?(l=(0,d.jsx)("pre",{className:i,"data-testid":c,children:m}),e[14]=i,e[15]=c,e[16]=m,e[17]=l):l=e[17],l},"rt"),Dt=u(({durationMs:t,error:e,failed:a,operation:r,ran:n,response:s,t:o})=>{let i=r.responses.map(c=>({body:Kt(c),durationMs:null,id:c.status,label:c.status,live:!1,status:c.status}));return n?[{body:zt(e,s,a),durationMs:t,id:Be,label:o("Live"),live:!0,status:a?"error":"200"},...i]:i},"st"),Wt=u(()=>{let t=(0,z.c)(19),e=J(),{durationMs:a,error:r,operation:n,response:s,status:o}=ze(),i=o==="running",c=o==="error",m=o==="success"||c,l=Dt({durationMs:a,error:r,failed:c,operation:n,ran:m,response:s,t:e}),p=m?Be:l.find(Ut)?.id??l[0]?.id??"",[f,h]=(0,q.useState)(null),g=l.find(T=>T.id===(f??p))??l[0],x;t[0]===Symbol.for("react.memo_cache_sentinel")?(x=u(T=>{let{id:L}=T.currentTarget.dataset;L!==void 0&&h(L)},"m"),t[0]=x):x=t[0];let v=x,N=u(()=>{g!==void 0&&ae(g.body)},"w"),y=g?.live===!0?g.durationMs:null,b=g?.live===!0&&g.status==="error",I="flex min-h-0 flex-col rounded-xl border border-border bg-card",P="api-response-panel",$;t[1]!==e?($=e("Response"),t[1]=e,t[2]=$):$=t[2];let k;t[3]!==$?(k=(0,d.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:$}),t[3]=$,t[4]=k):k=t[4];let w=y!==null&&(0,d.jsx)("span",{className:"font-mono text-[10px] text-muted-foreground",children:e("{ms} ms",{ms:y})}),j=g!==void 0&&g.body!==""&&(0,d.jsx)(W,{"aria-label":e("Copy"),"data-testid":"api-response-copy",onClick:N,size:"icon-xs",type:"button",variant:"ghost",children:(0,d.jsx)(oe,{icon:Ne,strokeWidth:2})}),O;t[5]!==w||t[6]!==j?(O=(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[w,j]}),t[5]=w,t[6]=j,t[7]=O):O=t[7];let S;t[8]!==k||t[9]!==O?(S=(0,d.jsxs)("div",{className:"flex items-center justify-between gap-2 border-b border-border px-3 py-2",children:[k,O]}),t[8]=k,t[9]=O,t[10]=S):S=t[10];let C=l.length>0&&(0,d.jsx)("div",{className:"flex gap-1 overflow-x-auto border-b border-border px-2 py-1.5",role:"tablist",children:l.map(T=>{let L=T.id===g?.id;return(0,d.jsxs)("button",{"aria-selected":L,className:ue("inline-flex items-center gap-1.5 rounded px-2 py-0.5 font-mono text-xs transition-colors hover:text-foreground aria-selected:bg-muted aria-selected:font-medium",L?Me(T.status):"text-muted-foreground"),"data-id":T.id,"data-testid":T.live?"api-response-tab-live":`api-response-tab-${T.status}`,onClick:v,role:"tab",type:"button",children:[(0,d.jsx)("span",{className:`size-1.5 rounded-full ${qe(T.status)}`}),T.label]},T.id)})}),A;t[11]!==g||t[12]!==i||t[13]!==b?(A=(0,d.jsx)(Bt,{active:g,running:i,showError:b}),t[11]=g,t[12]=i,t[13]=b,t[14]=A):A=t[14];let _;return t[15]!==A||t[16]!==S||t[17]!==C?(_=(0,d.jsxs)("div",{className:I,"data-testid":P,children:[S,C,A]}),t[15]=A,t[16]=S,t[17]=C,t[18]=_):_=t[18],_},"nt");function Ut(t){return t.status.startsWith("2")}u(Ut,"ot");var Ft=u((t,e)=>{let a=e.trim().toLowerCase();return a===""?t:t.map(r=>({...r,operations:r.operations.filter(n=>`${n.summary} ${n.operationId}`.toLowerCase().includes(a))})).filter(r=>r.operations.length>0)},"it"),pe=u(t=>{let e=(0,z.c)(53),{model:a}=t,r=J(),n=a.groups[0]?.operations[0]?.key??"",[s,o]=(0,q.useState)(n),[i,c]=(0,q.useState)(""),m;e[0]!==n||e[1]!==a.operationByKey||e[2]!==s?(m=a.operationByKey.get(s)??a.operationByKey.get(n),e[0]=n,e[1]=a.operationByKey,e[2]=s,e[3]=m):m=e[3];let l=m,p,f,h,g,x,v,N,y,b,I;if(e[4]!==i||e[5]!==a.groups||e[6]!==a.server||e[7]!==l?.key||e[8]!==r){p=Ft(a.groups,i);let O;e[19]===Symbol.for("react.memo_cache_sentinel")?(O=u(E=>{let{key:D}=E.currentTarget.dataset;D!==void 0&&o(D)},"E"),e[19]=O):O=e[19];let S=O,C;e[20]===Symbol.for("react.memo_cache_sentinel")?(C=u(E=>{c(E.target.value)},"j"),e[20]=C):C=e[20];let A=C;f=a.server??"",b="grid min-h-0 flex-1 grid-cols-1 overflow-hidden lg:grid-cols-[16rem_minmax(0,1fr)_22rem]",I="api-reference",e[21]!==r?(x=r("API operations"),e[21]=r,e[22]=x):x=e[22],v="flex min-h-0 flex-col overflow-y-auto border-r border-border",N="api-reference-nav";let _;e[23]===Symbol.for("react.memo_cache_sentinel")?(_=(0,d.jsx)(oe,{className:"pointer-events-none absolute top-1/2 left-2 size-3.5 -translate-y-1/2 text-muted-foreground",icon:ke,strokeWidth:2}),e[23]=_):_=e[23];let T;e[24]!==r?(T=r("Filter operations"),e[24]=r,e[25]=T):T=e[25],e[26]!==i||e[27]!==T?(y=(0,d.jsx)("div",{className:"sticky top-0 z-10 border-b border-border bg-sidebar p-2",children:(0,d.jsxs)("div",{className:"relative",children:[_,(0,d.jsx)(ve,{className:"h-7 pl-7","data-testid":"api-filter",onChange:A,placeholder:T,value:i})]})}),e[26]=i,e[27]=T,e[28]=y):y=e[28],h="flex flex-col gap-4 p-2";let L;e[29]!==l?.key||e[30]!==r?(L=u(E=>(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-2",children:[(0,d.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:E.name||r("(root)")}),(0,d.jsx)("span",{className:"font-mono text-[10px] text-muted-foreground/70",children:E.operations.length})]}),E.operations.map(D=>{let Q=D.key===l?.key;return(0,d.jsxs)("button",{"aria-current":Q?"page":void 0,className:"flex items-center justify-between gap-2 rounded-md border-l-2 border-transparent px-2 py-1 text-start text-xs text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground aria-[current=page]:border-primary aria-[current=page]:bg-sidebar-accent aria-[current=page]:font-medium aria-[current=page]:text-foreground","data-key":D.key,"data-testid":`api-nav-${D.operationId}`,onClick:S,type:"button",children:[(0,d.jsx)("span",{className:"truncate",children:D.summary}),(0,d.jsx)(ge,{kind:D.kind,method:D.method})]},D.key)})]},E.name),"L"),e[29]=l?.key,e[30]=r,e[31]=L):L=e[31],g=p.map(L),e[4]=i,e[5]=a.groups,e[6]=a.server,e[7]=l?.key,e[8]=r,e[9]=p,e[10]=f,e[11]=h,e[12]=g,e[13]=x,e[14]=v,e[15]=N,e[16]=y,e[17]=b,e[18]=I}else p=e[9],f=e[10],h=e[11],g=e[12],x=e[13],v=e[14],N=e[15],y=e[16],b=e[17],I=e[18];let P;e[32]!==p.length||e[33]!==r?(P=p.length===0&&(0,d.jsx)("p",{className:"px-2 py-1 text-xs text-muted-foreground","data-testid":"api-nav-empty",children:r("No operations match your filter.")}),e[32]=p.length,e[33]=r,e[34]=P):P=e[34];let $;e[35]!==P||e[36]!==h||e[37]!==g?($=(0,d.jsxs)("div",{className:h,children:[g,P]}),e[35]=P,e[36]=h,e[37]=g,e[38]=$):$=e[38];let k;e[39]!==$||e[40]!==x||e[41]!==v||e[42]!==N||e[43]!==y?(k=(0,d.jsxs)("nav",{"aria-label":x,className:v,"data-testid":N,children:[y,$]}),e[39]=$,e[40]=x,e[41]=v,e[42]=N,e[43]=y,e[44]=k):k=e[44];let w;e[45]!==l||e[46]!==f?(w=l===void 0?(0,d.jsx)("div",{className:"lg:col-span-2"}):(0,d.jsxs)(Tt,{operation:l,children:[(0,d.jsx)("div",{className:"min-w-0 overflow-y-auto p-6","data-testid":"api-reference-main",children:(0,d.jsx)(Rt,{operation:l})}),(0,d.jsxs)("aside",{className:"flex min-w-0 flex-col gap-4 overflow-y-auto border-border p-4 lg:border-l","data-testid":"api-reference-aside",children:[(0,d.jsx)(vt,{operation:l,server:f}),(0,d.jsx)(Wt,{})]})]},l.key),e[45]=l,e[46]=f,e[47]=w):w=e[47];let j;return e[48]!==k||e[49]!==w||e[50]!==b||e[51]!==I?(j=(0,d.jsxs)("div",{className:b,"data-testid":I,children:[k,w]}),e[48]=k,e[49]=w,e[50]=b,e[51]=I,e[52]=j):j=e[52],j},"wt");var H=K(re(),1);var Ht=["get","post","put","patch","delete","head","options","trace"],We=u(t=>t?.content?.["application/json"]?.schema,"y"),Gt=u((t,e)=>Object.entries(t.responses??{}).map(([a,r])=>{let n=r.$ref?.replace("#/components/responses/",""),s=n===void 0?r:e.components?.responses?.[n]??r;return{description:s.description,schema:We(s),status:a}}),"j"),Qt=u((t,e,a,r,n)=>{let s=We(r.requestBody),o=s?.properties?.functionPath?.const,i=typeof o=="string"?o:void 0,c=i===void 0?s:s?.properties?.args,m=r.operationId??`${a} ${e}`;return{argsSchema:c,description:r.description,functionPath:i,httpPath:e,key:t,kind:r["x-lunora-function-kind"],method:a.toUpperCase(),operationId:m,requestSchema:s,responses:Gt(r,n),summary:r.summary??m,tags:r.tags??[],title:r.summary??m}},"b"),Vt=u(t=>{let e=[];for(let[a,r]of Object.entries(t.paths??{})){let n=a.includes("#")?a.slice(0,a.indexOf("#")):a;for(let s of Ht){let o=r[s];o!==void 0&&e.push(Qt(a,n,s,o,t))}}return e},"x"),Xt=u(t=>{let e=t??{},a=Vt(e),r=new Map((e.tags??[]).map(i=>[i.name,i.description])),n=new Set,s=[],o=u(i=>{if(n.has(i))return;n.add(i);let c=a.filter(m=>(m.tags[0]??"")===i);c.length>0&&s.push({description:r.get(i),name:i,operations:c})},"l");for(let i of e.tags??[])o(i.name);for(let i of a)o(i.tags[0]??"");return{groups:s,operationByKey:new Map(a.map(i=>[i.key,i])),server:e.servers?.[0]?.url,title:e.info?.title??"API reference",version:e.info?.version}},"w"),Yt=u(t=>{let{paths:e}=t;return e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0},"R"),Zt=u(t=>{let e=t;return Yt(e)?{kind:"empty"}:{kind:"ready",spec:e}},"T"),Ue=u(t=>{let e=(0,De.c)(23),{spec:a}=t,r=J(),n=F(),s;e[0]!==n?(s=u(()=>n.fetchOpenApi(),"n"),e[0]=n,e[1]=s):s=e[1];let o=le(a,s,Zt),i;e[2]!==o.kind||e[3]!==o.spec?(i=o.kind==="ready"?Xt(o.spec):void 0,e[2]=o.kind,e[3]=o.spec,e[4]=i):i=e[4];let c=i;if(o.kind==="loading"){let l;return e[5]===Symbol.for("react.memo_cache_sentinel")?(l=(0,H.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"api-reference-loading",children:[(0,H.jsx)(V,{className:"h-8 w-48"}),(0,H.jsx)(V,{className:"h-64 w-full"})]}),e[5]=l):l=e[5],l}if(o.kind==="error"){let l;e[6]!==o.message||e[7]!==r?(l=r("Couldn't load the OpenAPI spec: {message}",{message:o.message}),e[6]=o.message,e[7]=r,e[8]=l):l=e[8];let p;e[9]!==r?(p=r("API reference unavailable"),e[9]=r,e[10]=p):p=e[10];let f;return e[11]!==l||e[12]!==p?(f=(0,H.jsx)(U,{description:l,testId:"api-reference-error",title:p}),e[11]=l,e[12]=p,e[13]=f):f=e[13],f}if(o.kind==="empty"||c===void 0){let l;e[14]!==r?(l=r("Run `lunora codegen` and wire `_generated/openapi.json` to the worker to render the API reference here."),e[14]=r,e[15]=l):l=e[15];let p;e[16]!==r?(p=r("No OpenAPI spec configured"),e[16]=r,e[17]=p):p=e[17];let f;return e[18]!==l||e[19]!==p?(f=(0,H.jsx)(U,{description:l,testId:"api-reference-empty",title:p}),e[18]=l,e[19]=p,e[20]=f):f=e[20],f}let m;return e[21]!==c?(m=(0,H.jsx)(pe,{model:c}),e[21]=c,e[22]=m):m=e[22],m},"H");var Fe=K(te(),1);var G=K(re(),1);var er=u(t=>(t.params??[]).find(e=>e.name==="args")??(t.params??[])[0],"x"),tr=u(t=>t["x-tags"]?.[0]?.name??(t.name.includes(":")?t.name.slice(0,t.name.indexOf(":")):""),"v"),rr=u(t=>{let e=er(t)?.schema;return{argsSchema:e,description:t.description,functionPath:t.name,httpPath:"/_lunora/rpc",key:t.name,kind:t["x-lunora-function-kind"],method:"POST",operationId:t.name,requestSchema:e,responses:[{description:t.result?.name,schema:t.result?.schema,status:"200"}],summary:t.summary??t.name,tags:[tr(t)],title:t.summary??t.name}},"w"),ar=u(t=>{let e=t??{},a=(e.methods??[]).map(n=>rr(n)),r=new Map;for(let n of a){let s=n.tags[0]??"",o=r.get(s)??[];o.push(n),r.set(s,o)}return{groups:[...r.entries()].map(([n,s])=>({name:n,operations:s.toSorted((o,i)=>o.operationId.localeCompare(i.operationId))})).toSorted((n,s)=>n.name.localeCompare(s.name)),operationByKey:new Map(a.map(n=>[n.key,n])),title:e.info?.title??"API reference",version:e.info?.version}},"I"),nr=u(t=>t.methods===void 0||t.methods.length===0,"C"),or=u(t=>{let e=t;return nr(e)?{kind:"empty"}:{kind:"ready",spec:e}},"N"),He=u(t=>{let e=(0,Fe.c)(23),{spec:a}=t,r=J(),n=F(),s;e[0]!==n?(s=u(()=>n.fetchOpenRpc(),"a"),e[0]=n,e[1]=s):s=e[1];let o=le(a,s,or),i;e[2]!==o.kind||e[3]!==o.spec?(i=o.kind==="ready"?ar(o.spec):void 0,e[2]=o.kind,e[3]=o.spec,e[4]=i):i=e[4];let c=i;if(o.kind==="loading"){let l;return e[5]===Symbol.for("react.memo_cache_sentinel")?(l=(0,G.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"openrpc-reference-loading",children:[(0,G.jsx)(V,{className:"h-8 w-48"}),(0,G.jsx)(V,{className:"h-64 w-full"})]}),e[5]=l):l=e[5],l}if(o.kind==="error"){let l;e[6]!==o.message||e[7]!==r?(l=r("Couldn't load the OpenRPC spec: {message}",{message:o.message}),e[6]=o.message,e[7]=r,e[8]=l):l=e[8];let p;e[9]!==r?(p=r("API reference unavailable"),e[9]=r,e[10]=p):p=e[10];let f;return e[11]!==l||e[12]!==p?(f=(0,G.jsx)(U,{description:l,testId:"openrpc-reference-error",title:p}),e[11]=l,e[12]=p,e[13]=f):f=e[13],f}if(o.kind==="empty"||c===void 0){let l;e[14]!==r?(l=r("Run `lunora codegen --api-spec openrpc` and wire `_generated/openrpc.json` to the worker to render the OpenRPC reference here."),e[14]=r,e[15]=l):l=e[15];let p;e[16]!==r?(p=r("No OpenRPC spec configured"),e[16]=r,e[17]=p):p=e[17];let f;return e[18]!==l||e[19]!==p?(f=(0,G.jsx)(U,{description:l,testId:"openrpc-reference-empty",title:p}),e[18]=l,e[19]=p,e[20]=f):f=e[20],f}let m;return e[21]!==c?(m=(0,G.jsx)(pe,{model:c}),e[21]=c,e[22]=m):m=e[22],m},"q");var B=K(re(),1);var sr=["reference","snippets"],ir=["openapi","openrpc"],Yr=u(t=>{let e=(0,Ge.c)(51),{functions:a,initialShardKey:r,openApiSpec:n,openRpcSpec:s}=t,o=J(),[i,c]=(0,xe.useState)("reference"),[m,l]=(0,xe.useState)("openapi"),p;e[0]!==o?(p=o("Reference"),e[0]=o,e[1]=p):p=e[1];let f;e[2]!==o?(f=o("Snippets"),e[2]=o,e[3]=f):f=e[3];let h;e[4]!==p||e[5]!==f?(h={reference:p,snippets:f},e[4]=p,e[5]=f,e[6]=h):h=e[6];let g=h,x;e[7]!==o?(x=o("OpenAPI"),e[7]=o,e[8]=x):x=e[8];let v;e[9]!==o?(v=o("OpenRPC"),e[9]=o,e[10]=v):v=e[10];let N;e[11]!==x||e[12]!==v?(N={openapi:x,openrpc:v},e[11]=x,e[12]=v,e[13]=N):N=e[13];let y=N,b;e[14]===Symbol.for("react.memo_cache_sentinel")?(b=u(E=>{c(E.currentTarget.dataset.view)},"S"),e[14]=b):b=e[14];let I=b,P;e[15]===Symbol.for("react.memo_cache_sentinel")?(P=u(E=>{l(E.currentTarget.dataset.format)},"A"),e[15]=P):P=e[15];let $=P,k;e[16]!==o?(k=o("API view"),e[16]=o,e[17]=k):k=e[17];let w;e[18]!==i||e[19]!==g?(w=sr.map(E=>(0,B.jsx)(W,{"aria-selected":i===E,"data-testid":`api-view-${E}`,"data-view":E,onClick:I,role:"tab",size:"sm",type:"button",variant:i===E?"default":"outline",children:g[E]},E)),e[18]=i,e[19]=g,e[20]=w):w=e[20];let j;e[21]!==w||e[22]!==k?(j=(0,B.jsx)("div",{"aria-label":k,className:"flex gap-1.5","data-testid":"api-view-toggle",role:"tablist",children:w}),e[21]=w,e[22]=k,e[23]=j):j=e[23];let O;e[24]!==m||e[25]!==y||e[26]!==o||e[27]!==i?(O=i==="reference"&&(0,B.jsx)("div",{"aria-label":o("API spec format"),className:"flex gap-1.5","data-testid":"api-format-toggle",role:"tablist",children:ir.map(E=>(0,B.jsx)(W,{"aria-selected":m===E,"data-format":E,"data-testid":`api-format-${E}`,onClick:$,role:"tab",size:"sm",type:"button",variant:m===E?"default":"outline",children:y[E]},E))}),e[24]=m,e[25]=y,e[26]=o,e[27]=i,e[28]=O):O=e[28];let S;e[29]!==j||e[30]!==O?(S=(0,B.jsxs)("div",{className:"flex shrink-0 flex-wrap items-center gap-3 border-b border-border px-6 py-3",children:[j,O]}),e[29]=j,e[30]=O,e[31]=S):S=e[31];let C;e[32]!==a||e[33]!==r||e[34]!==i?(C=i==="snippets"&&(0,B.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto p-6",children:(0,B.jsx)(Ae,{functions:a,initialShardKey:r})}),e[32]=a,e[33]=r,e[34]=i,e[35]=C):C=e[35];let A;e[36]!==m||e[37]!==n||e[38]!==i?(A=i==="reference"&&m==="openapi"&&(0,B.jsx)(Ue,{spec:n}),e[36]=m,e[37]=n,e[38]=i,e[39]=A):A=e[39];let _;e[40]!==m||e[41]!==s||e[42]!==i?(_=i==="reference"&&m==="openrpc"&&(0,B.jsx)(He,{spec:s}),e[40]=m,e[41]=s,e[42]=i,e[43]=_):_=e[43];let T;e[44]!==C||e[45]!==A||e[46]!==_?(T=(0,B.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[C,A,_]}),e[44]=C,e[45]=A,e[46]=_,e[47]=T):T=e[47];let L;return e[48]!==S||e[49]!==T?(L=(0,B.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col","data-testid":"lunora-api-tab",children:[S,T]}),e[48]=S,e[49]=T,e[50]=L):L=e[50],L},"k");export{Yr as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as Z}from"./chunk-R6U22RSY.js";import{a as te}from"./chunk-XHRKNCCI.js";import{a as Y}from"./chunk-YVR4SEPU.js";import{b as X}from"./chunk-ZKJS6EBE.js";import{a as W}from"./chunk-FUYEZFBP.js";import"./chunk-RGMVGZV4.js";import{i as G}from"./chunk-OQ6I6OXT.js";import"./chunk-E4PXACVL.js";import"./chunk-MVWZMWPD.js";import"./chunk-SJQERRSZ.js";import"./chunk-7Y3SY37W.js";import{b as ae,c as ne}from"./chunk-4TH2NPLW.js";import{a as q,b as ee}from"./chunk-GWOHQJIL.js";import{a as Q}from"./chunk-7G4Z6Q7X.js";import"./chunk-3YXASVTP.js";import"./chunk-AUAECCXB.js";import"./chunk-BOMPSVRC.js";import"./chunk-SJUYCXDY.js";import"./chunk-NCPW7WHO.js";import"./chunk-3V25YSWQ.js";import"./chunk-55UGUCQ6.js";import{a as I}from"./chunk-4ZEL6BYL.js";import{c as _}from"./chunk-VRWHCG2V.js";import{l as D}from"./chunk-ICDMV4MP.js";import"./chunk-QAQDMS6R.js";import"./chunk-FQPBYMII.js";import"./chunk-HCTJKP5J.js";import"./chunk-2IKDEUCX.js";import{d as M,f as C,g as A,l as V,p as N}from"./chunk-HJHSQPHW.js";import{a as l,d as j,e as he,f as me,g as pe}from"./chunk-I26MS5PJ.js";var E=j(me(),1);var c=j(he(),1);var S=j(pe(),1);var ge=l(t=>{let{suggestedIndex:e,table:i}=t;if(typeof i!="string"||i.length===0||typeof e!="object"||e===null)return!1;let{fields:a,name:n}=e;return!Array.isArray(a)||a.length===0||a.some(s=>typeof s!="string"||s.length===0)?!1:typeof n=="string"&&n.length>0},"ye"),be=l((t,e)=>`.index(${JSON.stringify(t)}, [${e.map(i=>JSON.stringify(i)).join(", ")}])`,"ge"),ye=l(t=>{let e=(0,E.c)(19),{fields:i,indexName:a,table:n,testId:s}=t,u=M(),[h,f]=(0,c.useState)(null),m;e[0]!==i||e[1]!==a?(m=l(()=>{let b=be(a,i),$="navigator"in globalThis?globalThis.navigator.clipboard:void 0;if($===void 0){f({copied:!1,declaration:b});return}N($.writeText(b).then(()=>(f({copied:!0,declaration:b}),!0)),()=>{f({copied:!1,declaration:b})})},"m"),e[0]=i,e[1]=a,e[2]=m):m=e[2];let x=m;if(h!==null){let b;return e[3]!==h.copied||e[4]!==h.declaration||e[5]!==u||e[6]!==n||e[7]!==s?(b=h.copied?(0,S.jsx)("span",{className:"text-xs text-muted-foreground","data-testid":`${s}-applied`,children:u("Index declaration copied \u2014 add it to {table} in lunora/schema.ts.",{table:n})}):(0,S.jsxs)("span",{className:"flex flex-col gap-1 text-xs text-muted-foreground","data-testid":`${s}-manual`,children:[u("Could not reach the clipboard \u2014 add this to {table} in lunora/schema.ts:",{table:n}),(0,S.jsx)("code",{className:"font-mono break-all select-all",children:h.declaration})]}),e[3]=h.copied,e[4]=h.declaration,e[5]=u,e[6]=n,e[7]=s,e[8]=b):b=e[8],b}let T;e[9]!==u?(T=u("Copy?"),e[9]=u,e[10]=T):T=e[10];let p;e[11]!==u||e[12]!==n?(p=u("Copy index declaration for {table}",{table:n}),e[11]=u,e[12]=n,e[13]=p):p=e[13];let w;return e[14]!==x||e[15]!==T||e[16]!==p||e[17]!==s?(w=(0,S.jsx)(te,{confirmLabel:T,onConfirm:x,testId:s,children:p}),e[14]=x,e[15]=T,e[16]=p,e[17]=s,e[18]=w):w=e[18],w},"ve"),xe=l((t,e)=>{let i=new Map;for(let a of e){let n=`${a.table} ${a.index}`;i.set(n,(i.get(n)??0)+a.reads)}return t.map(a=>({index:a.index,reads:i.get(`${a.table} ${a.index}`)??0,table:a.table}))},"Se"),ve=l(t=>{let e=new Map;for(let i of t)for(let a of i.scannedTables??[])e.set(a.table,(e.get(a.table)??0)+a.scans);return[...e].map(([i,a])=>({scans:a,table:i}))},"Te"),ie=l((t,e)=>e.map(i=>({index:i.name,table:t})),"P"),we=l(t=>{let e=xe(t.declaredIndexes??[],t.indexHits??[]),i=ve(t.functions??[]),a=t.shardTraffic??[],n=t.analyticsMetrics,s=n&&n.indexHits.length>0?n.indexHits:e,u=n&&n.tableScans.length>0?n.tableScans:i,h=n&&n.shardTraffic.length>0?n.shardTraffic:a,f=ne({indexHits:s,schema:{tables:[]},shardTraffic:h,tableScans:u},{lints:ae,source:"runtime"}),m=t.suppressHotScanTables;return(m===void 0?f:f.filter(x=>!(x.metadata.kind==="hot_scan"&&typeof x.metadata.table=="string"&&m.has(x.metadata.table)))).map(x=>q(x))},"we"),Se=C(I.listTables),Te=C(I.listTableIndexes),Ie=C(I.listTablesIndexes),B=l(t=>`${(t*100).toFixed(1)}%`,"L"),re=l(t=>`${(t/1e3).toFixed(2)}s`,"V"),$e=l(t=>{if(t.length<=1)return t[0]??"";let e=t[t.length-1]??"";return`${t.slice(0,-1).join(", ")} and ${e}`},"Ne"),ke=l((t,e)=>({"high-error-rate":t("High error rate"),"high-evictions":t("High cache eviction rate"),"high-write-contention":t("High write contention"),"low-cache-hit-rate":t("Low cache hit rate"),"missing-index":t("Missing index"),"slow-function":t("Slow function"),"storage-headroom":t("Storage headroom")})[e.kind],"ke"),se=l((t,e)=>({"high-error-rate":t("{rate} of calls failed.",{rate:B(e.value)}),"high-evictions":t("{count} entries evicted recently.",{count:e.value}),"high-write-contention":t("{rate} of calls hit a write conflict \u2014 consider sharding to cut contention.",{rate:B(e.value)}),"low-cache-hit-rate":t("{rate} hit rate over recent traffic.",{rate:B(e.value)}),"missing-index":t("Slowest call took {duration} \u2014 it full-scanned {tables} with no index.",{duration:re(e.value),tables:$e(e.tables??[])}),"slow-function":t("Slowest call took {duration}.",{duration:re(e.value)}),"storage-headroom":t("{size} of the 10 GiB per-shard ceiling \u2014 plan a .shardBy() migration while it still has runway.",{size:V(e.value)})})[e.kind],"U"),Ne=l(t=>{let e=(0,E.c)(10),{onJump:i,table:a}=t,n=M(),s;e[0]!==i||e[1]!==a?(s=l(()=>{i(a)},"i"),e[0]=i,e[1]=a,e[2]=s):s=e[2];let u=s,h=`in-add-index-${a}`,f;e[3]!==n||e[4]!==a?(f=n("Add index on {table}",{table:a}),e[3]=n,e[4]=a,e[5]=f):f=e[5];let m;return e[6]!==u||e[7]!==h||e[8]!==f?(m=(0,S.jsx)(Q,{"data-testid":h,onClick:u,size:"sm",type:"button",variant:"outline",children:f}),e[6]=u,e[7]=h,e[8]=f,e[9]=m):m=e[9],m},"Be"),ze=l(({initialShardKey:t,loadShardTraffic:e})=>{let i=D(),a=G(),n=M(),{queryShardKey:s,setShardKey:u,shardKey:h}=Z(t),[f,m]=(0,c.useState)(null),[x,T]=(0,c.useState)(null),p=(0,c.useRef)(""),w=_(I.getMetrics,{},{live:!0,shardKey:s}),b=_(I.getFunctionStats,{},{live:!0,shardKey:s}),$=_(I.getAdvisories,{},{live:!0,shardKey:s}),L=w.data??null,H=b.data?.functions??null,F=$.data?.advisories??null,J=w.data?.indexHits??null,O=w.error!==null&&b.error!==null?w.error:null,oe=e??(r=>i.shardTraffic(r)),le=l(async(r,y)=>{let o=r[0];if(o===void 0||o===""){p.current===y&&T(null);return}try{let g=await oe(o);if(p.current!==y)return;let d=new Map;for(let v of g.shards)d.has(v.shardKey)||d.set(v.shardKey,{requests:v.requests,shardKey:v.shardKey});T([...d.values()])}catch{p.current===y&&T(null)}},"Y"),de=l(async(r,y)=>{let o=await Promise.allSettled(r.map(async d=>[d,await i.query(Te,{table:d},A(y))])),g=[];for(let d of o)if(d.status==="fulfilled"){let[v,k]=d.value;g.push(...ie(v,k.indexes))}return g},"Z"),z=(0,c.useEffectEvent)(async r=>{p.current=r;let y=[];try{let o=await i.query(Se,{},A(r));if(p.current!==r)return;X(r),y=o.map(d=>d.name);let g=[];if(y.length>0)try{let d=await i.query(Ie,{tables:y},A(r));if(p.current!==r)return;for(let[v,k]of Object.entries(d.indexesByTable))g.push(...ie(v,k))}catch{if(g=await de(y,r),p.current!==r)return}m(g)}catch{p.current===r&&m(null)}await le(y,r)});(0,c.useEffect)(()=>{N(z(s))},[s]);let ce=(0,c.useEffectEvent)(()=>{w.refetch(),b.refetch(),$.refetch(),N(z(s))});(0,c.useEffect)(()=>{let r=l(()=>{document.visibilityState==="visible"&&ce()},"r");return document.addEventListener("visibilitychange",r),()=>{document.removeEventListener("visibilitychange",r)}},[]);let U=(0,c.useCallback)(r=>{N(a({search:{table:r},to:"/schema"}))},[a]),K=(0,c.useMemo)(()=>W(L,H),[H,L]),P=(0,c.useMemo)(()=>new Set(K.filter(r=>r.kind==="missing-index").flatMap(r=>r.tables??[])),[K]),R=(0,c.useMemo)(()=>we({declaredIndexes:f??[],functions:H,indexHits:J,shardTraffic:x,suppressHotScanTables:P}),[f,H,J,P,x]),ue=(0,c.useMemo)(()=>{let r=K.map(o=>{let g=o.kind==="missing-index"?o.tables??[]:[];return{action:g.length>0?g.map(d=>(0,S.jsx)(Ne,{onJump:U,table:d},d)):void 0,description:o.message===void 0?se(n,o):`${se(n,o)} \u2014 ${o.message}`,entity:o.fn,issueType:ke(n,o),key:`${o.kind}:${o.fn??""}`,level:o.severity}}),y=new Set(["unindexed_foreign_key","unindexed_relation_target"]);return[...(F??[]).map(o=>{let g=q(o);if(y.has(o.name)&&ge(o.metadata)){let{table:d,suggestedIndex:v}=o.metadata,k=`in-apply-index-${d}-${v.name}`;return{...g,action:(0,S.jsx)(ye,{fields:v.fields,indexName:v.name,table:d,testId:k})}}return g}),...R,...r]},[F,K,U,R,n]),fe=(0,S.jsx)(Y,{onChange:u,testId:"in-shard-input",value:h});return(0,S.jsx)(ee,{error:O,errorSource:O===null?void 0:w.errorSource,rows:ue,testId:"lunora-insights",toolbar:fe})},"Ue");export{ze as InsightsPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as Se}from"./chunk-FPI7AMQJ.js";import{a as $}from"./chunk-37WYCOQ2.js";import{a as Ce}from"./chunk-SV764LKQ.js";import{a as ve}from"./chunk-YVR4SEPU.js";import"./chunk-ZKJS6EBE.js";import"./chunk-RGMVGZV4.js";import{i as M}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 F}from"./chunk-Q6ED4KUL.js";import"./chunk-BOMPSVRC.js";import{a as Ne}from"./chunk-SJUYCXDY.js";import"./chunk-NCPW7WHO.js";import"./chunk-3V25YSWQ.js";import"./chunk-55UGUCQ6.js";import{a as X}from"./chunk-4ZEL6BYL.js";import{c as ae}from"./chunk-VRWHCG2V.js";import{d as me,l as oe}from"./chunk-ICDMV4MP.js";import"./chunk-QAQDMS6R.js";import"./chunk-FQPBYMII.js";import{a as de}from"./chunk-RWVIV3U7.js";import{a as ke,b as we,c as Pe,d as ce,e as re,f as le}from"./chunk-HCTJKP5J.js";import{a as se,b as fe,c as ue,d as he,e as ne}from"./chunk-2IKDEUCX.js";import{d as V,f as xe,g as ye,h as ge,m as be,p as te}from"./chunk-HJHSQPHW.js";import{a as n,d as ie,e as Re,f as Te,g as Fe}from"./chunk-I26MS5PJ.js";var f=ie(Re(),1);var pe=ie(Te(),1);var t=ie(Fe(),1);var Ie=["read","insert","update","delete"],Ee=n((e,a)=>({delete:e("Delete"),insert:e("Insert"),read:e("Read"),update:e("Update")})[a],"Ie"),$e=n(e=>e.file===""?e.procedure:`${e.file}:${e.procedure}`,"Re"),ze=n(e=>{let a=new Set;for(let i of e?.advisories??[])if(i.name==="rls_uncovered_table"){let{table:d}=i.metadata;typeof d=="string"&&d!==""&&a.add(d)}return a},"Fe"),De=n((e,a,i)=>{let d=new Map,r=n(s=>{let o=d.get(s);if(o!==void 0)return o;let m={cells:{delete:{},insert:{},read:{},update:{}},maskedColumns:new Set,table:s,uncovered:i.has(s)};return d.set(s,m),m},"r");for(let s of e)r(s.table).cells[s.on]={path:$e(s),procedure:s.procedure};for(let s of a)r(s.table).maskedColumns.add(s.column);for(let s of i)r(s);return[...d.values()].toSorted((s,o)=>s.table.localeCompare(o.table))},"Oe"),Oe=n(e=>{let a=(0,pe.c)(17),i;a[0]!==e?(i=e===void 0?{}:e,a[0]=e,a[1]=i):i=a[1];let{onProbe:d}=i,r=V(),s,o;a[2]===Symbol.for("react.memo_cache_sentinel")?(s={},o={live:!0},a[2]=s,a[3]=o):(s=a[2],o=a[3]);let m=ae(X.rlsPolicies,s,o),l;a[4]===Symbol.for("react.memo_cache_sentinel")?(l={},a[4]=l):l=a[4];let g=ae(X.maskPolicies,l),h;a[5]===Symbol.for("react.memo_cache_sentinel")?(h={},a[5]=h):h=a[5];let b=ae(X.getAdvisories,h),v;if(a[6]!==b.data||a[7]!==g.data||a[8]!==d||a[9]!==m||a[10]!==r){let N=null;m.data!==void 0&&(N=Array.isArray(m.data.policies)?m.data.policies:[]);let z=Array.isArray(g.data?.columns)?g.data.columns:[],j=b.data??null,{error:C,errorSource:k,liveError:I}=m,R=N===null?[]:De(N,z,ze(j)),w;a[12]!==I?(w=(0,t.jsx)("div",{className:"flex items-center justify-end",children:(0,t.jsx)(Ce,{message:I,prefix:"pm"})}),a[12]=I,a[13]=w):w=a[13];let u;a[14]!==C||a[15]!==k?(u=C!==null&&(0,t.jsx)(Ne,{error:k,testId:"pm-error"}),a[14]=C,a[15]=k,a[16]=u):u=a[16],v=(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-permissions-matrix",children:[w,u,N!==null&&R.length===0?(0,t.jsx)(de,{description:r("Add a `definePolicy` and wire it through `.use(rls(...))` to populate this matrix."),testId:"pm-empty",title:r("No policy")}):(0,t.jsxs)(ke,{"data-testid":"pm-table",children:[(0,t.jsx)(we,{children:(0,t.jsxs)(ce,{children:[(0,t.jsx)(re,{children:r("Table")}),Ie.map(p=>(0,t.jsx)(re,{children:Ee(r,p)},p)),(0,t.jsx)(re,{children:r("Masked columns")})]})}),(0,t.jsx)(Pe,{children:R.map(p=>(0,t.jsxs)(ce,{"data-testid":`pm-row-${p.table}`,children:[(0,t.jsx)(le,{className:"font-mono text-xs",children:(0,t.jsxs)("span",{className:"flex items-center gap-1.5",children:[p.table,p.uncovered&&(0,t.jsx)(F,{"data-testid":`pm-uncovered-${p.table}`,title:r("Uncovered \u2014 reachable without a policy"),variant:"destructive",children:r("Uncovered \u2014 reachable without a policy")})]})}),Ie.map(_=>{let x=p.cells[_];return(0,t.jsx)(le,{"data-testid":`pm-cell-${p.table}-${_}`,children:x.procedure===void 0?(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:r("No policy")}):(0,t.jsxs)("span",{className:"flex flex-col gap-1",children:[(0,t.jsx)(F,{variant:"secondary",children:r("Covered by {procedure}",{procedure:x.procedure})}),d!==void 0&&(0,t.jsx)(E,{className:"h-auto justify-start p-0 text-[11px]","data-testid":`pm-probe-${p.table}-${_}`,onClick:n(()=>{d(p.table,_,x.path??"")},"onClick"),size:"xs",type:"button",variant:"ghost",children:r("Probe this")})]})},_)}),(0,t.jsx)(le,{children:p.maskedColumns.size===0?(0,t.jsx)("span",{"aria-hidden":"true",className:"text-muted-foreground",children:"\u2014"}):(0,t.jsx)("span",{className:"flex flex-wrap gap-1",children:[...p.maskedColumns].map(Le)})})]},p.table))})]})]}),a[6]=b.data,a[7]=g.data,a[8]=d,a[9]=m,a[10]=r,a[11]=v}else v=a[11];return v},"De");function Le(e){return(0,t.jsx)(F,{variant:"outline",children:e},e)}n(Le,"Le");var je=xe(X.runAs),Me=new Set(["FORBIDDEN","RLS_REQUIRED","UNAUTHORIZED"]),Ue=n(e=>{let a=e?.code;return typeof a=="string"?a:void 0},"Me"),qe=n(()=>{let e=oe();return async({args:a,functionPath:i,shardKey:d="",userId:r})=>{if(r.trim()==="")return{kind:"invalid",message:"No identity to probe: enter the userId whose access you want to test."};let s=je;try{return{kind:"allowed",value:await e.query(s,{args:a,functionPath:i,userId:r},ye(d))}}catch(o){let m=o instanceof Error?o.message:String(o),l=Ue(o);return l!==void 0&&Me.has(l)?{kind:"denied",message:m}:{kind:"errored",message:m}}}},"ze"),We=n(e=>e===void 0?"undefined":JSON.stringify(e,be,2),"je"),Je=n(({functions:e,prefill:a,runAsIdentity:i=!1}={})=>{let d=oe(),r=V(),s=qe(),[o,m]=(0,f.useState)(null),[l,g]=(0,f.useState)(null),h=e??o??[],[b,v]=(0,f.useState)(""),[N,z]=(0,f.useState)("{}"),[j,C]=(0,f.useState)(""),[k,I]=(0,f.useState)(""),[R,w]=(0,f.useState)(!1),[u,p]=(0,f.useState)(null),[_,x]=(0,f.useState)(null),T=(0,f.useRef)(-1),P=(0,f.useRef)(0);(0,f.useEffect)(()=>{if(e!==void 0)return;let c=!1;return d.listFunctions().then(y=>(c||m(y),y)).catch(y=>{c||g(ge(y))}),()=>{c=!0}},[d,e]),(0,f.useEffect)(()=>{if(a===void 0||T.current===a.nonce)return;T.current=a.nonce,P.current+=1;let c=a.functionPath;queueMicrotask(()=>{v(c),p(null)})},[a]);let S=b===""?h[0]?.path??"":b,D=n(async()=>{if(S==="")return;let c;try{c=N.trim()===""?{}:me(JSON.parse(N))}catch(A){x(r("Invalid JSON args: {message}",{message:A.message})),p(null);return}P.current+=1;let y=P.current;x(null),w(!0);try{let A=await s({args:c,functionPath:S,shardKey:j.trim(),userId:k.trim()});y===P.current&&p(A)}finally{w(!1)}},"F"),Q=n(()=>{te(D())},"K"),O=n(c=>{v(c.target.value)},"O"),L=n(c=>{z(c.target.value)},"D"),G=n(c=>{I(c.target.value)},"Y");return(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-permissions-playground",children:[l!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"pp-discover-error",role:"alert",children:l}),!i&&(0,t.jsx)(de,{description:r("Dev only: runs the selected function as this user over the admin gate so you can test auth and RLS."),testId:"pp-gate",title:r("Set `runAsIdentity` to forge an identity and probe access.")}),(0,t.jsxs)("div",{className:"flex flex-col gap-3 rounded-md border border-border p-3",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)($,{htmlFor:"pp-function",children:r("Function")}),(0,t.jsx)("select",{"aria-label":r("Function"),className:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","data-testid":"pp-function",id:"pp-function",onChange:O,value:S,children:h.map(c=>(0,t.jsxs)("option",{value:c.path,children:[c.path," (",c.kind,")"]},c.path))})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)($,{htmlFor:"pp-args",children:r("Arguments")}),(0,t.jsx)(Se,{"aria-label":r("Arguments"),className:"font-mono text-xs","data-testid":"pp-args",id:"pp-args",onChange:L,value:N})]}),(0,t.jsx)(ve,{onChange:C,testId:"pp-shard",value:j}),(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)($,{htmlFor:"pp-user",children:r("Run as (userId)")}),(0,t.jsx)(M,{"aria-label":r("Identity (userId) to run as"),className:"font-mono text-xs","data-testid":"pp-user",id:"pp-user",onChange:G,placeholder:r("Required \u2014 the identity to probe as"),value:k})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(E,{"data-testid":"pp-run",disabled:!i||R||S==="",onClick:Q,type:"button",children:r(R?"Probing\u2026":"Run probe")}),k.trim()!==""&&(0,t.jsx)(F,{"data-testid":"pp-as-badge",variant:"secondary",children:r("as {userId}",{userId:k.trim()})})]})]}),_!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"pp-args-error",role:"alert",children:_}),u!==null&&u.kind==="allowed"&&(0,t.jsxs)("div",{className:"flex flex-col gap-2","data-testid":"pp-outcome-allowed",children:[(0,t.jsx)(F,{variant:"secondary",children:r("Allowed")}),(0,t.jsx)("pre",{className:"overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-xs","data-testid":"pp-result",children:We(u.value)})]}),u!==null&&u.kind==="invalid"&&(0,t.jsxs)("div",{className:"flex flex-col gap-2","data-testid":"pp-outcome-invalid",children:[(0,t.jsx)(F,{variant:"outline",children:r("Not run")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"pp-invalid",role:"status",children:u.message})]}),u!==null&&u.kind==="errored"&&(0,t.jsxs)("div",{className:"flex flex-col gap-2","data-testid":"pp-outcome-errored",children:[(0,t.jsx)(F,{variant:"outline",children:r("Errored")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:r("The call failed for a reason that is not an access verdict, so it says nothing about the policy.")}),(0,t.jsx)("pre",{className:"overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-xs","data-testid":"pp-errored",role:"alert",children:u.message})]}),u!==null&&u.kind==="denied"&&(0,t.jsxs)("div",{className:"flex flex-col gap-2","data-testid":"pp-outcome-denied",children:[(0,t.jsx)(F,{variant:"destructive",children:r("Denied")}),(0,t.jsx)("pre",{className:"overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-xs text-destructive","data-testid":"pp-denied",role:"alert",children:u.message})]})]})},"qe"),Be="/__lunora/policy-scaffold",He={"already-wired":"That procedure already has an rls(...) policy wired in.","file-exists":"A policy file with that name already exists \u2014 pick another name or edit it by hand.","invalid-identifier":"Name, table, and policy-set must be plain identifiers (letters, digits, _ or $).","unknown-procedure":"No exported procedure was found at that file path.","unsupported-procedure-shape":"That procedure uses the bare query({\u2026}) form \u2014 convert it to the builder form (c.use(\u2026).query(\u2026)) before wiring RLS."},Ke=n(async e=>{let a=await fetch(Be,{body:JSON.stringify(e),headers:{"Content-Type":"application/json"},method:"POST"}),i=await a.json();if(i.needsManualEdit===!0)return{kind:"needs-manual-edit",message:i.message??"This change must be made by hand."};if(a.ok)return{diagnostics:i.diagnostics??[],kind:"ok",label:i.fileName??i.exportName??""};let d=i.error;return{kind:"error",message:d===void 0?`policy scaffold failed (${String(a.status)})`:He[d]??d}},"Qe"),_e={exportName:"",filePath:"",policyName:"",policies:"",tableName:""},Qe=n(()=>{let e=(0,pe.c)(69),a=V(),[i,d]=(0,f.useState)(null),[r,s]=(0,f.useState)(!1),[o,m]=(0,f.useState)(null),[l,g]=(0,f.useState)(_e),h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=n(ee=>{let K=ee.target.name,{value:Y}=ee.target;g(Ae=>({...Ae,[K]:Y}))},"u"),e[0]=h):h=e[0];let b=h,v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v=n(()=>{d(null),g(_e)},"v"),e[1]=v):v=e[1];let N=v,z;e[2]===Symbol.for("react.memo_cache_sentinel")?(z=n(async ee=>{s(!0),m(null);try{let K=await Ke(ee);m(K),K.kind==="ok"&&N()}catch(K){let Y=K;m({kind:"error",message:Y instanceof Error?Y.message:String(Y)})}s(!1)},"R"),e[2]=z):z=e[2];let j=z,C;e[3]!==l.policyName||e[4]!==l.tableName?(C=n(()=>{te(j({kind:"scaffoldPolicy",name:l.policyName.trim(),table:l.tableName.trim()}))},"P"),e[3]=l.policyName,e[4]=l.tableName,e[5]=C):C=e[5];let k=C,I;e[6]!==l.exportName||e[7]!==l.filePath||e[8]!==l.policies?(I=n(()=>{te(j({exportName:l.exportName.trim(),filePath:l.filePath.trim(),kind:"wireRls",policies:l.policies.trim()}))},"A"),e[6]=l.exportName,e[7]=l.filePath,e[8]=l.policies,e[9]=I):I=e[9];let R=I,w;e[10]===Symbol.for("react.memo_cache_sentinel")?(w=n(()=>{m(null),d("scaffold")},"S"),e[10]=w):w=e[10];let u=w,p;e[11]===Symbol.for("react.memo_cache_sentinel")?(p=n(()=>{m(null),d("wire")},"m"),e[11]=p):p=e[11];let _=p,x;e[12]!==a?(x=a("Scaffold access rules"),e[12]=a,e[13]=x):x=e[13];let T;e[14]!==x?(T=(0,t.jsx)(ue,{children:x}),e[14]=x,e[15]=T):T=e[15];let P;e[16]!==a?(P=a("Writes a new deny-by-default policy file under lunora/, or wires one into a procedure, then reruns codegen. Local dev only."),e[16]=a,e[17]=P):P=e[17];let S;e[18]!==P?(S=(0,t.jsx)(he,{children:P}),e[18]=P,e[19]=S):S=e[19];let D;e[20]!==S||e[21]!==T?(D=(0,t.jsxs)(fe,{children:[T,S]}),e[20]=S,e[21]=T,e[22]=D):D=e[22];let Q=i==="scaffold"?"default":"outline",O;e[23]!==a?(O=a("New policy file"),e[23]=a,e[24]=O):O=e[24];let L;e[25]!==Q||e[26]!==O?(L=(0,t.jsx)(E,{"data-testid":"policy-scaffolder-new",onClick:u,size:"xs",type:"button",variant:Q,children:O}),e[25]=Q,e[26]=O,e[27]=L):L=e[27];let G=i==="wire"?"default":"outline",c;e[28]!==a?(c=a("Wire into a procedure"),e[28]=a,e[29]=c):c=e[29];let y;e[30]!==G||e[31]!==c?(y=(0,t.jsx)(E,{"data-testid":"policy-scaffolder-wire",onClick:_,size:"xs",type:"button",variant:G,children:c}),e[30]=G,e[31]=c,e[32]=y):y=e[32];let A;e[33]!==L||e[34]!==y?(A=(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[L,y]}),e[33]=L,e[34]=y,e[35]=A):A=e[35];let U;e[36]!==r||e[37]!==l.policyName||e[38]!==l.tableName||e[39]!==i||e[40]!==k||e[41]!==a?(U=i==="scaffold"&&(0,t.jsxs)("div",{className:"mt-3 flex flex-wrap items-end gap-2","data-testid":"policy-scaffolder-new-form",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)($,{htmlFor:"policy-scaffolder-name",children:a("Policy name")}),(0,t.jsx)(M,{"data-testid":"policy-scaffolder-name",id:"policy-scaffolder-name",name:"policyName",onChange:b,value:l.policyName})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)($,{htmlFor:"policy-scaffolder-table",children:a("Table name")}),(0,t.jsx)(M,{"data-testid":"policy-scaffolder-table",id:"policy-scaffolder-table",name:"tableName",onChange:b,value:l.tableName})]}),(0,t.jsx)(E,{"data-testid":"policy-scaffolder-create",disabled:r||l.policyName.trim()===""||l.tableName.trim()==="",onClick:k,size:"xs",type:"button",children:a(r?"Creating\u2026":"Create policy file")}),(0,t.jsx)(E,{onClick:N,size:"xs",type:"button",variant:"ghost",children:a("Cancel")})]}),e[36]=r,e[37]=l.policyName,e[38]=l.tableName,e[39]=i,e[40]=k,e[41]=a,e[42]=U):U=e[42];let q;e[43]!==r||e[44]!==l.exportName||e[45]!==l.filePath||e[46]!==l.policies||e[47]!==i||e[48]!==R||e[49]!==a?(q=i==="wire"&&(0,t.jsxs)("div",{className:"mt-3 flex flex-wrap items-end gap-2","data-testid":"policy-scaffolder-wire-form",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)($,{htmlFor:"policy-scaffolder-file",children:a("Procedure file path")}),(0,t.jsx)(M,{"data-testid":"policy-scaffolder-file",id:"policy-scaffolder-file",name:"filePath",onChange:b,value:l.filePath})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)($,{htmlFor:"policy-scaffolder-export",children:a("Exported procedure")}),(0,t.jsx)(M,{"data-testid":"policy-scaffolder-export",id:"policy-scaffolder-export",name:"exportName",onChange:b,value:l.exportName})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)($,{htmlFor:"policy-scaffolder-policies",children:a("Policy set identifier")}),(0,t.jsx)(M,{"data-testid":"policy-scaffolder-policies",id:"policy-scaffolder-policies",name:"policies",onChange:b,value:l.policies})]}),(0,t.jsx)(E,{"data-testid":"policy-scaffolder-apply",disabled:r||l.filePath.trim()===""||l.exportName.trim()===""||l.policies.trim()==="",onClick:R,size:"xs",type:"button",children:a(r?"Wiring\u2026":"Wire RLS")}),(0,t.jsx)(E,{onClick:N,size:"xs",type:"button",variant:"ghost",children:a("Cancel")})]}),e[43]=r,e[44]=l.exportName,e[45]=l.filePath,e[46]=l.policies,e[47]=i,e[48]=R,e[49]=a,e[50]=q):q=e[50];let W;e[51]!==o?(W=o?.kind==="error"&&(0,t.jsx)("p",{className:"mt-3 text-sm text-destructive","data-testid":"policy-scaffolder-error",role:"alert",children:o.message}),e[51]=o,e[52]=W):W=e[52];let J;e[53]!==o?.kind||e[54]!==a?(J=o?.kind==="needs-manual-edit"&&(0,t.jsx)("p",{className:"mt-3 text-sm text-amber-600 dark:text-amber-500","data-testid":"policy-scaffolder-manual",role:"alert",children:a("This change must be made by hand \u2014 the scaffolder only adds new, deny-by-default rules.")}),e[53]=o?.kind,e[54]=a,e[55]=J):J=e[55];let B;e[56]!==o||e[57]!==a?(B=o?.kind==="ok"&&(0,t.jsxs)("div",{className:"mt-3 flex flex-col gap-1","data-testid":"policy-scaffolder-ok",children:[(0,t.jsx)("p",{className:"text-sm text-emerald-600 dark:text-emerald-500",children:a("Scaffolded {label} and reran codegen. Fill in the `when` predicates before relying on it.",{label:o.label})}),o.diagnostics.length>0&&(0,t.jsx)("ul",{className:"flex flex-col gap-0.5","data-testid":"policy-scaffolder-diagnostics",children:o.diagnostics.map(Ge)})]}),e[56]=o,e[57]=a,e[58]=B):B=e[58];let H;e[59]!==A||e[60]!==U||e[61]!==q||e[62]!==W||e[63]!==J||e[64]!==B?(H=(0,t.jsxs)(ne,{children:[A,U,q,W,J,B]}),e[59]=A,e[60]=U,e[61]=q,e[62]=W,e[63]=J,e[64]=B,e[65]=H):H=e[65];let Z;return e[66]!==D||e[67]!==H?(Z=(0,t.jsxs)(se,{"data-testid":"policy-scaffolder",size:"sm",children:[D,H]}),e[66]=D,e[67]=H,e[68]=Z):Z=e[68],Z},"He");function Ge(e){return(0,t.jsx)("li",{className:"font-mono text-[11px] text-destructive",children:e},e)}n(Ge,"Je");var ft=n(({functions:e,runAsIdentity:a=!1,schemaEditable:i=!1}={})=>{let d=V(),[r,s]=(0,f.useState)(void 0),o=n((m,l,g)=>{g!==""&&s(h=>({functionPath:g,nonce:(h?.nonce??0)+1}))},"o");return(0,t.jsxs)("div",{className:"flex flex-col gap-8","data-testid":"lunora-permissions",children:[(0,t.jsxs)("section",{className:"flex flex-col gap-3",children:[(0,t.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,t.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:d("Permissions")})}),(0,t.jsx)(Oe,{onProbe:o})]}),(0,t.jsx)("section",{className:"flex flex-col gap-3",children:(0,t.jsxs)(se,{className:"gap-0 py-0",children:[(0,t.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,t.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:d("Probe")})}),(0,t.jsxs)(ne,{className:"px-4 py-4",children:[(0,t.jsx)("p",{className:"mb-3 text-sm text-muted-foreground",children:d("Pick a function and an identity, then run it to see the access outcome.")}),(0,t.jsx)(Je,{functions:e,prefill:r,runAsIdentity:a})]})]})}),i&&(0,t.jsx)("section",{className:"flex flex-col gap-2",children:(0,t.jsx)(Qe,{})})]})},"ut");export{ft as PermissionsPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as Et}from"./chunk-7Y3SY37W.js";import{a as T,b as rt,c as S,h as nt,i as ot,j as st}from"./chunk-AUAECCXB.js";import{d as C,h as tt,i as et}from"./chunk-BOMPSVRC.js";import{a as r,c as p,d,e as A}from"./chunk-I26MS5PJ.js";var O=d(A(),1);var it=0;function Ct(t,e="mui"){let[n,o]=O.useState(t),s=t||n;return O.useEffect(()=>{n==null&&(it+=1,o(`${e}-${it}`))},[n,e]),s}r(Ct,"useGlobalId");var at=rt.useId;function ct(t,e){if(at!==void 0){let n=at();return t??(e?`${e}-${n}`:n)}return Ct(t,e)}r(ct,"useId");function $e(t){return ct(t,"base-ui")}r($e,"useBaseUiId");var D={};p(D,{engine:()=>L,env:()=>U,mediaQuery:()=>H,os:()=>F,screenReader:()=>q});var F={};p(F,{android:()=>pt,apple:()=>N,ios:()=>M,linux:()=>wt,mac:()=>ft,windows:()=>Pt});function Ot(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}r(Ot,"readRawData");var{userAgent:Dt,platform:It,maxTouchPoints:ut}=Ot(),m=Dt.toLowerCase(),g=It.toLowerCase();var M=/^i(os$|p)/.test(g)||g==="macintel"&&ut>1,lt="android",pt=g===lt||m.includes(lt),ft=!M&&g.startsWith("mac"),Pt=g.startsWith("win"),wt=!pt&&/^(linux|chrome os)/.test(g),N=ft||M;var L={};p(L,{blink:()=>kt,gecko:()=>_t,webkit:()=>$});var $=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none"),_t=!$&&m.includes("firefox"),kt=!$&&m.includes("chrom");var q={};p(q,{voiceOver:()=>vt});var vt=N;var U={};p(U,{jsdom:()=>yt});var yt=/jsdom|happydom/.test(m);var H={};p(H,{iOS:()=>Mt});var Mt="@supports (-webkit-touch-callout: none)";function Nt(t){let e=t.activeElement;for(;e?.shadowRoot?.activeElement!=null;)e=e.shadowRoot.activeElement;return e}r(Nt,"activeElement");function dt(t,e){if(!t||!e)return!1;let n=e.getRootNode?.();if(t.contains(e))return!0;if(n&&st(n)){let o=e;for(;o;){if(t===o)return!0;o=o.parentNode||o.host}}return!1}r(dt,"contains");function Ft(t){return"composedPath"in t?t.composedPath()[0]??t.target:t.target}r(Ft,"getTarget");var R="data-starting-style",I="data-ending-style";var $t={[R]:""},Lt={[I]:""},mt={transitionStatus(t){return t==="starting"?$t:t==="ending"?Lt:null}};var gt={};p(gt,{align:()=>Bt,anchorHidden:()=>K,closed:()=>G,endingStyle:()=>Ut,open:()=>W,side:()=>Ht,startingStyle:()=>qt});var W="data-open",G="data-closed",qt=R,Ut=I,K="data-anchor-hidden",Ht="data-side",Bt="data-align";var w={};p(w,{popupOpen:()=>P,pressed:()=>V});var P="data-popup-open",V="data-pressed";var Wt={[P]:""},Gt={[P]:"",[V]:""},Kt={[W]:""},Vt={[G]:""},jt={[K]:""},Xe={open(t){return t?Wt:null}},Ze={open(t){return t?Gt:null}},Yt={open(t){return t?Kt:Vt},anchorHidden(t){return t?jt:null}},tr={...Yt,...mt};var nr=w.popupOpen,j="data-trigger-disabled";var Y="data-base-ui-focusable";var z="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",or="ArrowLeft",sr="ArrowRight",ir="ArrowUp",ar="ArrowDown";function dr(t,e){if(!nt(t))return!1;let n=t;if(e.hasElement(n))return!n.hasAttribute(j);for(let[,o]of e.entries())if(dt(o,n))return!o.hasAttribute(j);return!1}r(dr,"isTargetInsideEnabledTrigger");function mr(t,e){if(e==null)return!1;if("composedPath"in t)return t.composedPath().includes(e);let n=t;return n.target!=null&&e.contains(n.target)}r(mr,"isEventTargetWithin");function gr(t){return t.matches("html,body")}r(gr,"isRootElement");function Jt(t){return ot(t)&&t.matches(z)}r(Jt,"isTypeableElement");function xr(t){return t?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${z}`)!=null}r(xr,"isInteractiveElement");function hr(t){return t?t.getAttribute("role")==="combobox"&&Jt(t):!1}r(hr,"isTypeableCombobox");function br(t){if(!t||D.env.jsdom)return!0;try{return t.matches(":focus-visible")}catch{return!0}}r(br,"matchesFocusVisible");function Ar(t){return t?t.hasAttribute(Y)?t:t.querySelector(`[${Y}]`)||t:null}r(Ar,"getFloatingFocusElement");var xt=d(A(),1);function _(t){xt.useEffect(t,tt)}r(_,"useOnMount");var E=0,J=class t{static{r(this,"Timeout")}static create(){return new t}currentId=E;start(e,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=E,n()},e)}isStarted(){return this.currentId!==E}clear=r(()=>{this.currentId!==E&&(clearTimeout(this.currentId),this.currentId=E)},"clear");disposeEffect=r(()=>this.clear,"disposeEffect")};function Ir(){let t=C(J.create).current;return _(t.disposeEffect),t}r(Ir,"useTimeout");var k=null,vr=globalThis.requestAnimationFrame,Q=class{static{r(this,"Scheduler")}callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=r(e=>{this.isScheduled=!1;let n=this.callbacks,o=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,o>0)for(let s=0;s<n.length;s+=1)n[s]?.(e)},"tick");request(e){let n=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(e){let n=e-this.startId;n<0||n>=this.callbacks.length||this.callbacks[n]!==null&&(this.callbacks[n]=null,this.callbacksCount-=1)}},v=new Q;var l=class t{static{r(this,"AnimationFrame")}static create(){return new t}static request(e){return v.request(e)}static cancel(e){return v.cancel(e)}currentId=k;request(e){this.cancel(),this.currentId=v.request(()=>{this.currentId=k,e()})}cancel=r(()=>{this.currentId!==k&&(v.cancel(this.currentId),this.currentId=k)},"cancel");disposeEffect=r(()=>this.cancel,"disposeEffect")};function ht(){let t=C(l.create).current;return _(t.disposeEffect),t}r(ht,"useAnimationFrame");var X=d(Et(),1);function bt(t){return t==null?t:"current"in t?t.current:t}r(bt,"resolveRef");var y=null;function Qt(t){if(!y){let e=[];y=e,queueMicrotask(()=>{y=null,X.flushSync(()=>{for(let n of e)n()})})}y.push(t)}r(Qt,"flushBeforePaint");function At(t,e=!1,n=!1){let o=ht();return S((s,i=null)=>{o.cancel();let a=bt(t);if(a==null)return;let c=a,u=r(()=>{if(!n){X.flushSync(s);return}Qt(()=>{i?.aborted||s()})},"done");if(typeof c.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){s();return}function f(){Promise.all(c.getAnimations().map(h=>h.finished)).then(()=>{i?.aborted||u()},()=>{if(i?.aborted)return;if(c.getAnimations().some(b=>b.pending||b.playState!=="finished")){f();return}u()})}if(r(f,"exec"),e){let h=R;if(!c.hasAttribute(h)){o.request(f);return}let b=new MutationObserver(()=>{c.hasAttribute(h)||(b.disconnect(),f())});b.observe(c,{attributes:!0,attributeFilter:[h]}),i?.addEventListener("abort",()=>b.disconnect(),{once:!0});return}o.request(f)})}r(At,"useAnimationsFinished");var Tt=d(A(),1);function Gr(t){let{enabled:e=!0,open:n,ref:o,batch:s=!1,onComplete:i}=t,a=S(i),c=At(o,n,s);Tt.useEffect(()=>{if(!e)return;let u=new AbortController;return c(a,u.signal),()=>{u.abort()}},[e,n,a,c])}r(Gr,"useOpenChangeComplete");var Z=d(A(),1);function zr(t,e=!1,n=!1,o=!1){let[s,i]=Z.useState(t&&e?"idle":void 0),[a,c]=Z.useState(t&&!o);return t&&!a&&(c(!0),i("starting")),!t&&a&&s!=="ending"&&!n&&i("ending"),!t&&!a&&s==="ending"&&i(void 0),T(()=>{if(!t&&a&&s!=="ending"&&n){let u=l.request(()=>{i("ending")});return()=>{l.cancel(u)}}},[t,a,s,n]),T(()=>{if(!t||e)return;let u=l.request(()=>{i(void 0)});return()=>{l.cancel(u)}},[e,t]),T(()=>{if(!t||!e)return;t&&a&&s!=="idle"&&i("starting");let u=l.request(()=>{i("idle")});return()=>{l.cancel(u)}},[e,t,a,s]),{mounted:a,setMounted:c,transitionStatus:s}}r(zr,"useTransitionStatus");var x=d(A(),1);function Xr({controlled:t,default:e,name:n,state:o="value"}){let{current:s}=x.useRef(t!==void 0),[i,a]=x.useState(e),c=s&&t!==void 0?t:i,u=x.useCallback(f=>{s||a(f)},[]);return[c,u]}r(Xr,"useControlled");var St=d(A(),1);function nn(t,e){let n=St.useRef(t),o=S(e);T(()=>{n.current!==t&&o(n.current),n.current=t},[t,o])}r(nn,"useValueChanged");var Rt={};p(Rt,{cancelOpen:()=>Oe,chipRemovePress:()=>ae,clearPress:()=>ie,closePress:()=>oe,closeWatcher:()=>be,decrementPress:()=>le,disabled:()=>Ie,drag:()=>Re,escapeKey:()=>he,focusOut:()=>xe,imperativeAction:()=>_e,incrementPress:()=>ue,initial:()=>we,inputBlur:()=>de,inputChange:()=>pe,inputClear:()=>fe,inputPaste:()=>me,inputPress:()=>ge,itemPress:()=>ne,keyboard:()=>Te,linkPress:()=>se,listNavigation:()=>Ae,missing:()=>Pe,none:()=>Xt,outsidePress:()=>re,pointer:()=>Se,scrub:()=>Ce,siblingOpen:()=>De,swipe:()=>ke,trackPress:()=>ce,triggerFocus:()=>ee,triggerHover:()=>te,triggerPress:()=>Zt,wheel:()=>Ee,windowResize:()=>ve});var Xt="none",Zt="trigger-press",te="trigger-hover",ee="trigger-focus",re="outside-press",ne="item-press",oe="close-press",se="link-press",ie="clear-press",ae="chip-remove-press",ce="track-press",ue="increment-press",le="decrement-press",pe="input-change",fe="input-clear",de="input-blur",me="input-paste",ge="input-press",xe="focus-out",he="escape-key",be="close-watcher",Ae="list-navigation",Te="keyboard",Se="pointer",Re="drag",Ee="wheel",Ce="scrub",Oe="cancel-open",De="sibling-open",Ie="disabled",Pe="missing",we="initial",_e="imperative-action",ke="swipe",ve="window-resize";function un(t,e,n,o){let s=!1,i=!1,a=o??et;return{reason:t,event:e??new Event("base-ui"),cancel(){s=!0},allowPropagation(){i=!0},get isCanceled(){return s},get isPropagationAllowed(){return i},trigger:n,...a}}r(un,"createChangeEventDetails");export{ct as a,$e as b,D as c,Nt as d,dt as e,Ft as f,Y as g,or as h,sr as i,ir as j,ar as k,mt as l,gt as m,w as n,Xe as o,Ze as p,Yt as q,tr as r,j as s,dr as t,mr as u,gr as v,Jt as w,xr as x,hr as y,br as z,Ar as A,_ as B,J as C,Ir as D,l as E,ht as F,bt as G,At as H,Gr as I,zr as J,Xr as K,nn as L,Rt as M,un as N};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as y}from"./chunk-Q6ED4KUL.js";import"./chunk-BOMPSVRC.js";import{a as R}from"./chunk-SJUYCXDY.js";import"./chunk-NCPW7WHO.js";import"./chunk-3V25YSWQ.js";import"./chunk-55UGUCQ6.js";import{a as v}from"./chunk-4ZEL6BYL.js";import{c as $}from"./chunk-VRWHCG2V.js";import"./chunk-ICDMV4MP.js";import"./chunk-QAQDMS6R.js";import"./chunk-FQPBYMII.js";import{a as S}from"./chunk-RWVIV3U7.js";import{a as A,b as C,c as I,d as x,e as c,f as n}from"./chunk-HCTJKP5J.js";import{a as k,e as w}from"./chunk-2IKDEUCX.js";import{d as N}from"./chunk-HJHSQPHW.js";import{a as f,d as b,f as E,g as O}from"./chunk-I26MS5PJ.js";var j=b(E(),1);var r=b(O(),1);var _=f((e,t)=>({delete:e("Delete"),list:e("List"),read:e("Read"),write:e("Write")})[t],"I"),T={delete:2,list:3,read:0,write:1},B=f(e=>[...e].toSorted((t,a)=>t.bucket.localeCompare(a.bucket)||T[t.on]-T[a.on]||(t.prefix??"").localeCompare(a.prefix??"")),"O"),q=f(()=>{let e=(0,j.c)(14),t=N(),a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={},e[0]=a):a=e[0];let{data:l,error:i,errorSource:d}=$(v.storageRules,a),h=l!==void 0,m;if(e[1]!==l||e[2]!==i||e[3]!==d||e[4]!==h||e[5]!==t){let g=B(Array.isArray(l?.rules)?l.rules:[]),u;e[7]!==i||e[8]!==d?(u=i!==null&&(0,r.jsx)(R,{error:d,testId:"storage-rules-error"}),e[7]=i,e[8]=d,e[9]=u):u=e[9];let o;e[10]!==t?(o=t("Storage rules are declared in code with defineStorageRule and gate ctx.storage access per bucket. This view is read-only."),e[10]=t,e[11]=o):o=e[11];let p;e[12]!==o?(p=(0,r.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"storage-rules-note",children:o}),e[12]=o,e[13]=p):p=e[13],m=(0,r.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-storage-rules-panel",children:[u,p,h&&g.length===0?(0,r.jsx)(S,{description:t("No defineStorageRule is wired through .use(storageRules(...)) in this deployment. Add one to gate object access by key prefix."),testId:"storage-rules-empty",title:t("No storage rules defined")}):(0,r.jsx)(k,{className:"overflow-hidden py-0",children:(0,r.jsx)(w,{className:"px-0",children:(0,r.jsxs)(A,{"data-testid":"storage-rules-table",children:[(0,r.jsx)(C,{children:(0,r.jsxs)(x,{children:[(0,r.jsx)(c,{children:t("Bucket")}),(0,r.jsx)(c,{children:t("Operation")}),(0,r.jsx)(c,{children:t("Key prefix")}),(0,r.jsx)(c,{children:t("Guarded by")})]})}),(0,r.jsx)(I,{children:g.map(s=>(0,r.jsxs)(x,{"data-testid":`storage-rule-${s.bucket}-${s.on}-${s.prefix??""}`,children:[(0,r.jsx)(n,{className:"font-mono text-xs",children:s.bucket}),(0,r.jsx)(n,{children:(0,r.jsx)(y,{variant:"secondary",children:_(t,s.on)})}),(0,r.jsx)(n,{className:"font-mono text-xs",children:s.prefix??(0,r.jsx)("span",{className:"text-muted-foreground",children:t("(whole bucket)")})}),(0,r.jsx)(n,{className:"font-mono text-xs text-muted-foreground",children:s.procedure})]},`${s.bucket}:${s.on}:${s.prefix??""}:${s.procedure}`))})]})})})]}),e[1]=l,e[2]=i,e[3]=d,e[4]=h,e[5]=t,e[6]=m}else m=e[6];return m},"M");export{q as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as ae,d as le,e as ke,i as Ne,j as we,l as Se}from"./chunk-Q2KHDNYH.js";import"./chunk-NQZALRU3.js";import"./chunk-OPM7ESDV.js";import"./chunk-Y3AYVFTK.js";import{a as ye}from"./chunk-6HLARDYO.js";import"./chunk-OYCUPD3Q.js";import"./chunk-NXQW5E6W.js";import"./chunk-UC7MNI2F.js";import{a as oe}from"./chunk-SA2OGF3F.js";import"./chunk-NGVP66OH.js";import"./chunk-GHQ2VDI2.js";import"./chunk-AUGKHAMQ.js";import{i as me}from"./chunk-OQ6I6OXT.js";import"./chunk-MVWZMWPD.js";import"./chunk-SJQERRSZ.js";import"./chunk-7Y3SY37W.js";import"./chunk-3YXASVTP.js";import"./chunk-AUAECCXB.js";import{b as ne}from"./chunk-Q6ED4KUL.js";import"./chunk-BOMPSVRC.js";import{l as ue}from"./chunk-ICDMV4MP.js";import"./chunk-QAQDMS6R.js";import"./chunk-FQPBYMII.js";import{a as re}from"./chunk-RWVIV3U7.js";import{a as be,b as xe,c as ve,d as J,e as T,f as _}from"./chunk-HCTJKP5J.js";import{a as he,e as pe}from"./chunk-2IKDEUCX.js";import{d as Y,p as ge}from"./chunk-HJHSQPHW.js";import{a as c,d as te,e as Ae,f as qe,g as je,i as fe}from"./chunk-I26MS5PJ.js";var z=te(qe(),1);var E=te(Ae(),1);var n=te(je(),1);var Ie=["call","schedule","read","write","enqueue","publish","subscribe","start","trigger","invoke"],Me=new Set(["enqueue","publish","schedule","start","subscribe","trigger"]),$e={cron:1,function:2,http:0,queue:4,service:7,table:6,topic:3,workflow:5},Be={stroke:"var(--muted-foreground)"},De={fill:"var(--muted-foreground)",fontSize:10},Fe={fill:"var(--background)"},Q="",se=260,Oe=120,Ce=44,de=40,_e=12,ie=16,Re=c(r=>{if(typeof r!="object"||r===null)return;let e=r;return["edges","nodes","modules","unresolved"].every(d=>Array.isArray(e[d]))?e:void 0},"Ge"),ze={cron:c(()=>({to:"/schedule"}),"cron"),function:c(()=>({to:"/functions"}),"function"),http:c(()=>({to:"/api"}),"http"),queue:c(()=>({to:"/queues"}),"queue"),service:c(()=>({to:"/functions"}),"service"),table:c(r=>({search:{table:r.name},to:"/data"}),"table"),topic:c(()=>({to:"/queues"}),"topic"),workflow:c(()=>({to:"/workflows"}),"workflow")},Pe=c(r=>ze[r.kind](r),"Me"),H=c(r=>r.module??Q,"R"),Te=c((r,e,d)=>{let t=new Set;for(let l of r.nodes)(e===void 0||H(l)===e)&&t.add(l.id);if(e===void 0)return t;let a=new Set(t);for(let l of r.edges)d.has(l.kind)&&(t.has(l.from)&&a.add(l.to),t.has(l.to)&&a.add(l.from));return a},"Pe"),Ee=c((r,e,d,t)=>{let a=`lane:${r}`;return[{data:{label:e},id:a,position:{x:d*(se+Oe),y:0},selectable:!1,style:{height:Ce+t.length*(de+_e)+ie,width:se},type:"lane"},...t.map((l,i)=>({className:"flex cursor-pointer items-center truncate rounded-md border border-border bg-card px-2 text-xs text-foreground hover:border-ring",data:{label:`${l.detail??l.kind} \xB7 ${l.name}`,link:Pe(l)},extent:"parent",id:l.id,parentId:a,position:{x:ie,y:Ce+i*(de+_e)},style:{height:de,width:se-ie*2},type:"member"}))]},"Re"),He=c((r,e)=>{let d=Te(r,e.lane,e.kinds),t=new Map;for(let o of r.nodes)d.has(o.id)&&t.set(H(o),[...t.get(H(o))??[],o]);let a=[...r.modules.map(o=>({label:o.installed===!0?`${o.name} \xB7 ${e.componentLabel}`:o.name,lane:o.name})),{label:e.appLaneLabel,lane:Q}],l=[],i=0;for(let{label:o,lane:f}of a){let m=(t.get(f)??[]).toSorted((h,s)=>$e[h.kind]-$e[s.kind]||h.name.localeCompare(s.name));m.length>0&&(l.push(...Ee(f,o,i,m)),i+=1)}let u=[];for(let o of r.edges)e.kinds.has(o.kind)&&d.has(o.from)&&d.has(o.to)&&u.push({animated:Me.has(o.kind),id:`${o.from}|${o.kind}|${o.to}`,label:o.kind,labelBgStyle:Fe,labelStyle:De,source:o.from,style:Be,target:o.to,type:"smoothstep"});return{edges:u,nodes:l}},"Fe"),ce="*",Ve=c(r=>{let e=(0,z.c)(2),{data:d}=r,t=String(d.label),a;return e[0]!==t?(a=(0,n.jsx)("div",{className:"size-full rounded-lg border border-dashed border-border bg-background/60 px-3 py-2 text-xs font-medium text-muted-foreground",children:t}),e[0]=t,e[1]=a):a=e[1],a},"qe"),Le={opacity:0},Ze=c(r=>{let e=(0,z.c)(10),{data:d}=r,t=me(),{label:a,link:l}=d,i;e[0]!==l||e[1]!==t?(i=c(()=>{ge(t(l))},"u"),e[0]=l,e[1]=t,e[2]=i):i=e[2];let u=i,o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=(0,n.jsx)(le,{isConnectable:!1,position:ae.Left,style:Le,type:"target"}),e[3]=o):o=e[3];let f;e[4]!==a||e[5]!==u?(f=(0,n.jsx)("button",{className:"size-full cursor-pointer truncate rounded-md text-left outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1",onClick:u,type:"button",children:a}),e[4]=a,e[5]=u,e[6]=f):f=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=(0,n.jsx)(le,{isConnectable:!1,position:ae.Right,style:Le,type:"source"}),e[7]=m):m=e[7];let h;return e[8]!==f?(h=(0,n.jsxs)(n.Fragment,{children:[o,f,m]}),e[8]=f,e[9]=h):h=e[9],h},"je"),Ge={lane:Ve,member:Ze},Ke=c(r=>{let e=Re(r);return e===void 0?{kind:"error",message:"the response is not an architecture manifest"}:e.modules.length===0?{kind:"empty"}:{kind:"ready",spec:e}},"ze"),We=c(r=>{let e=(0,z.c)(54),{manifest:d}=r,t=Y(),a,l,i,u,o,f,m,h,s,p;if(e[0]!==d.modules||e[1]!==d.nodes||e[2]!==t){let P=new Map;for(let g of d.nodes)g.kind==="function"&&P.set(H(g),(P.get(H(g))??0)+1);let j=c(g=>P.get(g)??0,"I");o=j(Q),u=he,p="overflow-hidden py-0",i=pe,s="px-0",l=be,m="architecture-catalog";let L;e[13]!==t?(L=t("Module"),e[13]=t,e[14]=L):L=e[14];let I;e[15]!==L?(I=(0,n.jsx)(T,{children:L}),e[15]=L,e[16]=I):I=e[16];let A;e[17]!==t?(A=t("Description"),e[17]=t,e[18]=A):A=e[18];let q;e[19]!==A?(q=(0,n.jsx)(T,{children:A}),e[19]=A,e[20]=q):q=e[20];let v;e[21]!==t?(v=t("Owned tables"),e[21]=t,e[22]=v):v=e[22];let y;e[23]!==v?(y=(0,n.jsx)(T,{children:v}),e[23]=v,e[24]=y):y=e[24];let k;e[25]!==t?(k=t("Functions"),e[25]=t,e[26]=k):k=e[26];let N;e[27]!==k?(N=(0,n.jsx)(T,{children:k}),e[27]=k,e[28]=N):N=e[28],e[29]!==y||e[30]!==N||e[31]!==I||e[32]!==q?(h=(0,n.jsx)(xe,{children:(0,n.jsxs)(J,{children:[I,q,y,N]})}),e[29]=y,e[30]=N,e[31]=I,e[32]=q,e[33]=h):h=e[33],a=ve,f=d.modules.map(g=>(0,n.jsxs)(J,{"data-testid":`architecture-module-${g.name}`,children:[(0,n.jsxs)(_,{className:"font-mono text-xs",children:[g.name,g.installed===!0&&(0,n.jsx)(ne,{className:"ml-2","data-testid":`architecture-component-${g.name}`,variant:"outline",children:t("Component")})]}),(0,n.jsx)(_,{className:"text-xs text-muted-foreground",children:g.description??(g.installed===!0?t("Installed component"):"\u2014")}),(0,n.jsx)(_,{className:"font-mono text-xs text-muted-foreground",children:g.tables.length===0?"\u2014":g.tables.join(", ")}),(0,n.jsx)(_,{className:"text-xs",children:j(g.name)})]},g.name)),e[0]=d.modules,e[1]=d.nodes,e[2]=t,e[3]=a,e[4]=l,e[5]=i,e[6]=u,e[7]=o,e[8]=f,e[9]=m,e[10]=h,e[11]=s,e[12]=p}else a=e[3],l=e[4],i=e[5],u=e[6],o=e[7],f=e[8],m=e[9],h=e[10],s=e[11],p=e[12];let b;e[34]!==o||e[35]!==t?(b=o>0&&(0,n.jsxs)(J,{"data-testid":"architecture-module-app",children:[(0,n.jsx)(_,{className:"text-xs italic text-muted-foreground",children:t("Outside any module")}),(0,n.jsx)(_,{className:"text-xs text-muted-foreground",children:"\u2014"}),(0,n.jsx)(_,{className:"text-xs text-muted-foreground",children:"\u2014"}),(0,n.jsx)(_,{className:"text-xs",children:o})]}),e[34]=o,e[35]=t,e[36]=b):b=e[36];let x;e[37]!==a||e[38]!==f||e[39]!==b?(x=(0,n.jsxs)(a,{children:[f,b]}),e[37]=a,e[38]=f,e[39]=b,e[40]=x):x=e[40];let S;e[41]!==l||e[42]!==m||e[43]!==h||e[44]!==x?(S=(0,n.jsxs)(l,{"data-testid":m,children:[h,x]}),e[41]=l,e[42]=m,e[43]=h,e[44]=x,e[45]=S):S=e[45];let $;e[46]!==i||e[47]!==s||e[48]!==S?($=(0,n.jsx)(i,{className:s,children:S}),e[46]=i,e[47]=s,e[48]=S,e[49]=$):$=e[49];let C;return e[50]!==u||e[51]!==p||e[52]!==$?(C=(0,n.jsx)(u,{className:p,children:$}),e[50]=u,e[51]=p,e[52]=$,e[53]=C):C=e[53],C},"Ye"),Ye=c(r=>{let e=(0,z.c)(52),{manifest:d}=r,t=Y(),[a,l]=(0,E.useState)(ce),[i,u]=(0,E.useState)(Je),o;e[0]!==d.edges?(o=c(w=>d.edges.some(X=>X.kind===w),"n"),e[0]=d.edges,e[1]=o):o=e[1];let f=Ie.filter(o),m;e[2]!==t?(m=t("Outside any module"),e[2]=t,e[3]=m):m=e[3];let h=m,s;e[4]!==t?(s=t("Component"),e[4]=t,e[5]=s):s=e[5];let p=s,b;e[6]!==h||e[7]!==p||e[8]!==i||e[9]!==a||e[10]!==d?(b=He(d,{appLaneLabel:h,componentLabel:p,kinds:i,...a===ce?{}:{lane:a}}),e[6]=h,e[7]=p,e[8]=i,e[9]=a,e[10]=d,e[11]=b):b=e[11];let{edges:x,nodes:S}=b,$=(0,E.useRef)(null),C;e[12]===Symbol.for("react.memo_cache_sentinel")?(C=c(w=>{l(w.target.value)},"_"),e[12]=C):C=e[12];let P=C,j;e[13]===Symbol.for("react.memo_cache_sentinel")?(j=c(w=>{u(X=>{let ee=new Set(X);return ee.delete(w)||ee.add(w),ee})},"I"),e[13]=j):j=e[13];let L=j,I="flex flex-col gap-2",A="architecture-diagram",q="flex flex-wrap items-center gap-2",v;e[14]!==t?(v=t("Module"),e[14]=t,e[15]=v):v=e[15];let y;e[16]!==t?(y=t("All modules"),e[16]=t,e[17]=y):y=e[17];let k;e[18]!==y?(k=(0,n.jsx)("option",{value:ce,children:y}),e[18]=y,e[19]=k):k=e[19];let N;e[20]!==d.modules?(N=d.modules.map(Qe),e[20]=d.modules,e[21]=N):N=e[21];let g;e[22]!==t?(g=t("Outside any module"),e[22]=t,e[23]=g):g=e[23];let M;e[24]!==g?(M=(0,n.jsx)("option",{value:Q,children:g}),e[24]=g,e[25]=M):M=e[25];let B;e[26]!==a||e[27]!==v||e[28]!==k||e[29]!==N||e[30]!==M?(B=(0,n.jsxs)("select",{"aria-label":v,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":"architecture-module-filter",onChange:P,value:a,children:[k,N,M]}),e[26]=a,e[27]=v,e[28]=k,e[29]=N,e[30]=M,e[31]=B):B=e[31];let D;e[32]!==x.length||e[33]!==t?(D=t("{count} edges shown",{count:x.length}),e[32]=x.length,e[33]=t,e[34]=D):D=e[34];let F;e[35]!==D?(F=(0,n.jsx)("span",{className:"text-xs text-muted-foreground","data-testid":"architecture-edge-count",children:D}),e[35]=D,e[36]=F):F=e[36];let V;e[37]!==i?(V=c(w=>(0,n.jsx)("button",{"aria-pressed":i.has(w),className:fe("rounded-full border border-border px-2.5 py-0.5 text-xs",i.has(w)?"bg-muted":"text-muted-foreground line-through"),"data-testid":`architecture-kind-${w}`,onClick:c(()=>{L(w)},"onClick"),type:"button",children:w},w),"q"),e[37]=i,e[38]=V):V=e[38];let U=f.map(V),O;e[39]!==B||e[40]!==F||e[41]!==U?(O=(0,n.jsxs)("div",{className:q,children:[B,F,U]}),e[39]=B,e[40]=F,e[41]=U,e[42]=O):O=e[42];let Z,G,K;e[43]===Symbol.for("react.memo_cache_sentinel")?(Z=(0,n.jsx)(Ne,{}),G=(0,n.jsx)(we,{showInteractive:!1}),K=(0,n.jsx)(Se,{containerRef:$,filenameBase:"architecture",testIdPrefix:"architecture"}),e[43]=Z,e[44]=G,e[45]=K):(Z=e[43],G=e[44],K=e[45]);let R;e[46]!==x||e[47]!==S?(R=(0,n.jsx)("div",{className:"h-[600px] w-full overflow-hidden border border-border bg-muted/20","data-testid":"architecture-canvas",ref:$,children:(0,n.jsxs)(ke,{edges:x,edgesFocusable:!1,fitView:!0,minZoom:.1,nodes:S,nodesConnectable:!1,nodesDraggable:!1,nodeTypes:Ge,children:[Z,G,K]})}),e[46]=x,e[47]=S,e[48]=R):R=e[48];let W;return e[49]!==O||e[50]!==R?(W=(0,n.jsxs)("section",{className:I,"data-testid":A,children:[O,R]}),e[49]=O,e[50]=R,e[51]=W):W=e[51],W},"Ve"),mt=c(r=>{let e=(0,z.c)(28),{manifest:d}=r,t=Y(),a=ue(),l;e[0]!==a?(l=c(()=>a.fetchArchitecture(),"r"),e[0]=a,e[1]=l):l=e[1];let i=ye(d,l,Ke);if(i.kind==="loading"){let s;return e[2]===Symbol.for("react.memo_cache_sentinel")?(s=(0,n.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"architecture-loading",children:[(0,n.jsx)(oe,{className:"h-8 w-48"}),(0,n.jsx)(oe,{className:"h-64 w-full"})]}),e[2]=s):s=e[2],s}if(i.kind==="error"){let s;e[3]!==i.message||e[4]!==t?(s=t("Couldn't load the architecture manifest: {message}",{message:i.message}),e[3]=i.message,e[4]=t,e[5]=s):s=e[5];let p;e[6]!==t?(p=t("Architecture unavailable"),e[6]=t,e[7]=p):p=e[7];let b;return e[8]!==s||e[9]!==p?(b=(0,n.jsx)(re,{description:s,testId:"architecture-error",title:p}),e[8]=s,e[9]=p,e[10]=b):b=e[10],b}if(i.kind==="empty"){let s;e[11]!==t?(s=t("Add a lunora/<folder>/module.ts that default-exports defineModule(...) and run lunora codegen to map your modules here. Installed components join the map once you declare one."),e[11]=t,e[12]=s):s=e[12];let p;e[13]!==t?(p=t("No modules declared"),e[13]=t,e[14]=p):p=e[14];let b;return e[15]!==s||e[16]!==p?(b=(0,n.jsx)(re,{description:s,testId:"architecture-empty",title:p}),e[15]=s,e[16]=p,e[17]=b):b=e[17],b}let{spec:u}=i,o,f;e[18]!==u?(o=(0,n.jsx)(We,{manifest:u}),f=(0,n.jsx)(Ye,{manifest:u}),e[18]=u,e[19]=o,e[20]=f):(o=e[19],f=e[20]);let m;e[21]!==u.unresolved||e[22]!==t?(m=u.unresolved.length>0&&(0,n.jsxs)("details",{className:"text-sm","data-testid":"architecture-unresolved",children:[(0,n.jsxs)("summary",{className:"cursor-pointer text-muted-foreground",children:[t("{count} call sites could not be drawn",{count:u.unresolved.length})," ",(0,n.jsx)(ne,{variant:"outline",children:u.unresolved.length})]}),(0,n.jsx)("ul",{className:"mt-2 flex flex-col gap-1 font-mono text-xs",children:u.unresolved.map(Ue)})]}),e[21]=u.unresolved,e[22]=t,e[23]=m):m=e[23];let h;return e[24]!==o||e[25]!==f||e[26]!==m?(h=(0,n.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"architecture-panel",children:[o,f,m]}),e[24]=o,e[25]=f,e[26]=m,e[27]=h):h=e[27],h},"mt");function Je(){return new Set(Ie)}c(Je,"We");function Qe(r){return(0,n.jsx)("option",{value:r.name,children:r.name},r.name)}c(Qe,"Ze");function Ue(r){return(0,n.jsxs)("li",{children:[r.file,":",r.line," \xB7 ",r.kind," \xB7 ",r.reason]},`${r.file}:${String(r.line)}:${r.kind}:${r.reason}`)}c(Ue,"Je");export{mt as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as de}from"./chunk-7G4Z6Q7X.js";import"./chunk-3YXASVTP.js";import"./chunk-AUAECCXB.js";import{b as Y}from"./chunk-Q6ED4KUL.js";import"./chunk-BOMPSVRC.js";import{a as te}from"./chunk-SJUYCXDY.js";import"./chunk-NCPW7WHO.js";import"./chunk-3V25YSWQ.js";import"./chunk-55UGUCQ6.js";import"./chunk-VRWHCG2V.js";import{h as se,i as ie,j as ae}from"./chunk-ICDMV4MP.js";import"./chunk-QAQDMS6R.js";import"./chunk-FQPBYMII.js";import{a as ee}from"./chunk-RWVIV3U7.js";import{a as ne,b as ce,c as oe,d as re,e as O,f as S}from"./chunk-HCTJKP5J.js";import{d as X,t as Z}from"./chunk-HJHSQPHW.js";import{a as o,d as $,e as ve,f as me,g as pe,i as le}from"./chunk-I26MS5PJ.js";var _=$(me(),1);var ue=$(ve(),1);var s=$(pe(),1);var ye=new Set(["cancelled","completed","expired"]),he=o(i=>ye.has(i),"fe"),fe=o(i=>i.extendedDueAt??i.dueAt,"me"),xe=o(i=>!he(i)&&i!=="ready","ve"),ge=o((i,e)=>xe(i.status)&&e.getTime()>fe(i).getTime(),"pe"),qe=o((i,e)=>ge({dueAt:new Date(i.dueAt),status:i.status,...i.extendedDueAt===void 0||i.extendedDueAt===null?{}:{extendedDueAt:new Date(i.extendedDueAt)}},new Date(e)),"ye"),Ae=["studio","privacy-requests"],De={cancelled:"outline",completed:"success",expired:"outline",failed:"destructive",grace:"secondary",processing:"warning",ready:"success",received:"info"},be=o(i=>Z(i??void 0,"\u2014"),"Ae"),Pe=o(i=>{let e=(0,_.c)(55),{asOf:u,retrying:t,row:r,onRetry:b}=i,d=X(),n,c,I;e[0]!==u||e[1]!==r?(c=qe(r,u),n=re,I=le(c&&"bg-destructive/5"),e[0]=u,e[1]=r,e[2]=n,e[3]=c,e[4]=I):(n=e[2],c=e[3],I=e[4]);let N=c?"true":"false",v;e[5]!==r.id?(v=(0,s.jsx)(S,{className:"font-mono text-xs",children:r.id}),e[5]=r.id,e[6]=v):v=e[6];let m;e[7]!==r.type||e[8]!==d?(m=r.type==="export"?d("Export"):d("Erasure"),e[7]=r.type,e[8]=d,e[9]=m):m=e[9];let E;e[10]!==m?(E=(0,s.jsx)(S,{children:(0,s.jsx)(Y,{variant:"secondary",children:m})}),e[10]=m,e[11]=E):E=e[11];let l;e[12]!==r.subjectId?(l=(0,s.jsx)(S,{className:"font-mono text-xs",children:r.subjectId}),e[12]=r.subjectId,e[13]=l):l=e[13];let T=De[r.status],P;e[14]!==r.status||e[15]!==T?(P=(0,s.jsx)(S,{children:(0,s.jsx)(Y,{variant:T,children:r.status})}),e[14]=r.status,e[15]=T,e[16]=P):P=e[16];let w;e[17]!==r.receivedAt?(w=Z(r.receivedAt),e[17]=r.receivedAt,e[18]=w):w=e[18];let R;e[19]!==w?(R=(0,s.jsx)(S,{children:w}),e[19]=w,e[20]=R):R=e[20];let p;e[21]!==r.dueAt?(p=Z(r.dueAt),e[21]=r.dueAt,e[22]=p):p=e[22];let y;e[23]!==p?(y=(0,s.jsx)(S,{children:p}),e[23]=p,e[24]=y):y=e[24];let h;e[25]!==r.extendedDueAt?(h=be(r.extendedDueAt),e[25]=r.extendedDueAt,e[26]=h):h=e[26];let f;e[27]!==h?(f=(0,s.jsx)(S,{children:h}),e[27]=h,e[28]=f):f=e[28];let x;e[29]!==c||e[30]!==d?(x=c&&(0,s.jsx)(Y,{"data-testid":"privacy-overdue",variant:"destructive",children:d("Overdue")}),e[29]=c,e[30]=d,e[31]=x):x=e[31];let g;e[32]!==x?(g=(0,s.jsx)(S,{children:x}),e[32]=x,e[33]=g):g=e[33];let q;e[34]!==b||e[35]!==t||e[36]!==r.id||e[37]!==r.status||e[38]!==d?(q=r.status==="failed"&&(0,s.jsx)(de,{disabled:t,onClick:o(()=>{b(r.id)},"onClick"),size:"xs",variant:"outline",children:d("Retry")}),e[34]=b,e[35]=t,e[36]=r.id,e[37]=r.status,e[38]=d,e[39]=q):q=e[39];let A;e[40]!==q?(A=(0,s.jsx)(S,{children:q}),e[40]=q,e[41]=A):A=e[41];let j;return e[42]!==n||e[43]!==I||e[44]!==R||e[45]!==y||e[46]!==f||e[47]!==g||e[48]!==A||e[49]!==N||e[50]!==v||e[51]!==E||e[52]!==l||e[53]!==P?(j=(0,s.jsxs)(n,{className:I,"data-overdue":N,"data-testid":"privacy-request-row",children:[v,E,l,P,R,y,f,g,A]}),e[42]=n,e[43]=I,e[44]=R,e[45]=y,e[46]=f,e[47]=g,e[48]=A,e[49]=N,e[50]=v,e[51]=E,e[52]=l,e[53]=P,e[54]=j):j=e[54],j},"ge"),we=o(i=>{let e=(0,_.c)(95),{source:u}=i,t=X(),r=se(),b=(0,ue.useId)(),d;e[0]!==b?(d=[...Ae,b],e[0]=b,e[1]=d):d=e[1];let n=d,c;e[2]!==u?(c=o(async()=>({asOf:Date.now(),requests:await u.listOpenPrivacyRequests()}),"c"),e[2]=u,e[3]=c):c=e[3];let I;e[4]!==n||e[5]!==c?(I={queryKey:n,refetchInterval:6e4,queryFn:c,staleTime:0},e[4]=n,e[5]=c,e[6]=I):I=e[6];let N=ie(I),v;e[7]!==u?(v=o(a=>u.retryPrivacyRequest(a),"u"),e[7]=u,e[8]=v):v=e[8];let m;e[9]!==r||e[10]!==n?(m=o(async()=>{await r.invalidateQueries({queryKey:n})},"f"),e[9]=r,e[10]=n,e[11]=m):m=e[11];let E;e[12]!==v||e[13]!==m?(E={mutationFn:v,onSuccess:m},e[12]=v,e[13]=m,e[14]=E):E=e[14];let l=ae(E),T;e[15]!==l?(T=o(a=>{l.mutate(a)},"N"),e[15]=l,e[16]=T):T=e[16];let P=T;if(N.isPending){let a;e[17]!==t?(a=t("Loading privacy requests\u2026"),e[17]=t,e[18]=a):a=e[18];let D;return e[19]!==a?(D=(0,s.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"privacy-requests-loading",role:"status",children:a}),e[19]=a,e[20]=D):D=e[20],D}if(N.isError){let a;return e[21]!==N.error?(a=(0,s.jsx)(te,{error:N.error,testId:"privacy-requests-error"}),e[21]=N.error,e[22]=a):a=e[22],a}let{asOf:w,requests:R}=N.data;if(R.length===0){let a;e[23]!==t?(a=t("No open privacy requests."),e[23]=t,e[24]=a):a=e[24];let D;return e[25]!==a?(D=(0,s.jsx)(ee,{testId:"privacy-requests-empty",title:a}),e[25]=a,e[26]=D):D=e[26],D}let p;e[27]!==l.error||e[28]!==l.isError?(p=l.isError&&(0,s.jsx)(te,{error:l.error,testId:"privacy-retry-error"}),e[27]=l.error,e[28]=l.isError,e[29]=p):p=e[29];let y;e[30]!==t?(y=t("ID"),e[30]=t,e[31]=y):y=e[31];let h;e[32]!==y?(h=(0,s.jsx)(O,{children:y}),e[32]=y,e[33]=h):h=e[33];let f;e[34]!==t?(f=t("Type"),e[34]=t,e[35]=f):f=e[35];let x;e[36]!==f?(x=(0,s.jsx)(O,{children:f}),e[36]=f,e[37]=x):x=e[37];let g;e[38]!==t?(g=t("Subject"),e[38]=t,e[39]=g):g=e[39];let q;e[40]!==g?(q=(0,s.jsx)(O,{children:g}),e[40]=g,e[41]=q):q=e[41];let A;e[42]!==t?(A=t("Status"),e[42]=t,e[43]=A):A=e[43];let j;e[44]!==A?(j=(0,s.jsx)(O,{children:A}),e[44]=A,e[45]=j):j=e[45];let B;e[46]!==t?(B=t("Received"),e[46]=t,e[47]=B):B=e[47];let Q;e[48]!==B?(Q=(0,s.jsx)(O,{children:B}),e[48]=B,e[49]=Q):Q=e[49];let C;e[50]!==t?(C=t("Due"),e[50]=t,e[51]=C):C=e[51];let F;e[52]!==C?(F=(0,s.jsx)(O,{children:C}),e[52]=C,e[53]=F):F=e[53];let K;e[54]!==t?(K=t("Extended due"),e[54]=t,e[55]=K):K=e[55];let k;e[56]!==K?(k=(0,s.jsx)(O,{children:K}),e[56]=K,e[57]=k):k=e[57];let z;e[58]!==t?(z=t("Overdue"),e[58]=t,e[59]=z):z=e[59];let L;e[60]!==z?(L=(0,s.jsx)(O,{children:z}),e[60]=z,e[61]=L):L=e[61];let M;e[62]!==t?(M=t("Actions"),e[62]=t,e[63]=M):M=e[63];let G;e[64]!==M?(G=(0,s.jsx)(O,{children:M}),e[64]=M,e[65]=G):G=e[65];let H;e[66]!==h||e[67]!==x||e[68]!==q||e[69]!==j||e[70]!==Q||e[71]!==F||e[72]!==k||e[73]!==L||e[74]!==G?(H=(0,s.jsx)(ce,{children:(0,s.jsxs)(re,{children:[h,x,q,j,Q,F,k,L,G]})}),e[66]=h,e[67]=x,e[68]=q,e[69]=j,e[70]=Q,e[71]=F,e[72]=k,e[73]=L,e[74]=G,e[75]=H):H=e[75];let J;if(e[76]!==w||e[77]!==P||e[78]!==R||e[79]!==l.isPending||e[80]!==l.variables){let a;e[82]!==w||e[83]!==P||e[84]!==l.isPending||e[85]!==l.variables?(a=o(D=>(0,s.jsx)(Pe,{asOf:w,onRetry:P,retrying:l.isPending&&l.variables===D.id,row:D},D.id),"l"),e[82]=w,e[83]=P,e[84]=l.isPending,e[85]=l.variables,e[86]=a):a=e[86],J=R.map(a),e[76]=w,e[77]=P,e[78]=R,e[79]=l.isPending,e[80]=l.variables,e[81]=J}else J=e[81];let U;e[87]!==J?(U=(0,s.jsx)(oe,{children:J}),e[87]=J,e[88]=U):U=e[88];let V;e[89]!==H||e[90]!==U?(V=(0,s.jsxs)(ne,{children:[H,U]}),e[89]=H,e[90]=U,e[91]=V):V=e[91];let W;return e[92]!==V||e[93]!==p?(W=(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[p,V]}),e[92]=V,e[93]=p,e[94]=W):W=e[94],W},"Te"),Qe=o(i=>{let e=(0,_.c)(11),u;e[0]!==i?(u=i===void 0?{}:i,e[0]=i,e[1]=u):u=e[1];let{source:t}=u,r=X();if(t===void 0){let d;e[2]!==r?(d=r("Pass privacyRequests to the Studio to list and retry data-subject requests."),e[2]=r,e[3]=d):d=e[3];let n;e[4]!==r?(n=r("Privacy requests not configured"),e[4]=r,e[5]=n):n=e[5];let c;return e[6]!==d||e[7]!==n?(c=(0,s.jsx)(ee,{description:d,testId:"privacy-requests-not-configured",title:n}),e[6]=d,e[7]=n,e[8]=c):c=e[8],c}let b;return e[9]!==t?(b=(0,s.jsx)(we,{source:t}),e[9]=t,e[10]=b):b=e[10],b},"Be");export{Qe as PrivacyRequestsPanel};
|
|
@@ -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-SJUYCXDY.js";import"./chunk-NCPW7WHO.js";import"./chunk-3V25YSWQ.js";import"./chunk-55UGUCQ6.js";import{a as R}from"./chunk-4ZEL6BYL.js";import{c as P}from"./chunk-VRWHCG2V.js";import"./chunk-ICDMV4MP.js";import"./chunk-QAQDMS6R.js";import"./chunk-FQPBYMII.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,t as O}from"./chunk-HJHSQPHW.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as Ze}from"./chunk-ECY2JC5F.js";import"./chunk-NRP22GKC.js";import{a as Xe}from"./chunk-FPI7AMQJ.js";import{a as Ye}from"./chunk-JQXA2OYK.js";import"./chunk-UC7MNI2F.js";import{a as Ve}from"./chunk-XHRKNCCI.js";import{i as Pe}from"./chunk-E4PXACVL.js";import"./chunk-MVWZMWPD.js";import"./chunk-7Y3SY37W.js";import{a as le}from"./chunk-7G4Z6Q7X.js";import"./chunk-3YXASVTP.js";import"./chunk-AUAECCXB.js";import{b as de}from"./chunk-Q6ED4KUL.js";import"./chunk-BOMPSVRC.js";import{a as Ke}from"./chunk-SJUYCXDY.js";import{a as He}from"./chunk-NCPW7WHO.js";import"./chunk-3V25YSWQ.js";import"./chunk-55UGUCQ6.js";import{a as W}from"./chunk-4ZEL6BYL.js";import{c as Le}from"./chunk-VRWHCG2V.js";import{l as ze}from"./chunk-ICDMV4MP.js";import"./chunk-QAQDMS6R.js";import"./chunk-FQPBYMII.js";import{a as ie}from"./chunk-RWVIV3U7.js";import{a as Te,b as _e,c as Be,d as z,e as C,f as w}from"./chunk-HCTJKP5J.js";import{a as Me,e as Ae}from"./chunk-2IKDEUCX.js";import{d as F,f as ce,g as ue,h as H,m as Ue,p as me,t as Ge}from"./chunk-HJHSQPHW.js";import{a as c,d as Ee,e as ct,f as ut,g as mt}from"./chunk-I26MS5PJ.js";var D=Ee(ut(),1);var Q=Ee(ct(),1);var t=Ee(mt(),1);var pt=c((n,e)=>{let a=new Set(n.map(s=>s.deadLetterQueue).filter(s=>typeof s=="string"&&s!=="")),d=n.filter(s=>(s.deadLetterQueue===void 0||s.deadLetterQueue==="")&&!a.has(s.name)),r=e.filter(s=>s.deadLettered).length;return{deadLetteredCount:r,queuesWithoutDlq:d,showReliabilityWarning:d.length>0||r>0}},"ut"),De="topic:",$e=c(n=>{let e=[],a=new Map;for(let d of n)d.topic===void 0?e.push(d):a.set(d.topic,[...a.get(d.topic)??[],d]);return{plain:e,topics:a}},"Ae"),tt=c(n=>`${De}${n}`,"We"),ht=c((n,e)=>n.startsWith(De)?(e.get(n.slice(De.length))??[]).map(a=>a.exportName):[n],"mt"),gt=200,ft=ce(W.sendQueueMessage),xt=c(async(n,e,a)=>{let d=(await Promise.allSettled(e.map(async s=>n.query(ft,s,ue(""))))).flatMap((s,l)=>s.status==="rejected"?[{exportName:e[l]?.exportName??"",message:H(s.reason)}]:[]),[r]=d;return r===void 0?null:e.length===1?r.message:a("Not sent to {failed}",{failed:d.map(s=>`${s.exportName}: ${s.message}`).join("; ")})},"ht"),yt=ce(W.replayQueueMessage),Nt=ce(W.clearQueueMessages),et=96,bt=c(n=>{if(n===void 0)return"\u2014";try{return JSON.stringify(n,Ue)}catch{return"[unserializable]"}},"yt"),qt=c(n=>n.length>et?`${n.slice(0,et)}\u2026`:n,"bt"),vt=c(n=>n==="error"?"destructive":n==="retry"?"outline":"secondary","Nt"),St=c((n,e)=>e(n==="messages"?"Messages":n==="send"?"Send":"Declared"),"qt"),at=c(n=>{let e=(0,D.c)(17),{queue:a}=n,d=`queues-row-${a.exportName}`,r;e[0]!==a.exportName?(r=(0,t.jsx)(w,{className:"font-mono text-xs",children:a.exportName}),e[0]=a.exportName,e[1]=r):r=e[1];let s;e[2]!==a.name?(s=(0,t.jsx)(w,{className:"font-mono text-xs text-muted-foreground",children:a.name}),e[2]=a.name,e[3]=s):s=e[3];let l;e[4]!==a.mode?(l=(0,t.jsx)(w,{className:"font-mono text-xs text-muted-foreground",children:a.mode}),e[4]=a.mode,e[5]=l):l=e[5];let o;e[6]!==a.binding?(o=(0,t.jsx)(w,{className:"font-mono text-xs text-muted-foreground",children:a.binding}),e[6]=a.binding,e[7]=o):o=e[7];let m=a.deadLetterQueue??"\u2014",i;e[8]!==m?(i=(0,t.jsx)(w,{className:"font-mono text-xs text-muted-foreground",children:m}),e[8]=m,e[9]=i):i=e[9];let p;return e[10]!==d||e[11]!==r||e[12]!==s||e[13]!==l||e[14]!==o||e[15]!==i?(p=(0,t.jsxs)(z,{"data-testid":d,children:[r,s,l,o,i]}),e[10]=d,e[11]=r,e[12]=s,e[13]=l,e[14]=o,e[15]=i,e[16]=p):p=e[16],p},"Ge"),wt=c(n=>{let e=(0,D.c)(8),{loaded:a,queues:d}=n,r=F(),s;if(e[0]!==a||e[1]!==d||e[2]!==r){let{plain:l,topics:o}=$e(d),m;e[4]!==r?(m=r("Queues are declared in code with defineQueue. Enqueue from a mutation or action with ctx.queues.<name>.send(...); push consumers process batches in the worker."),e[4]=r,e[5]=m):m=e[5];let i;e[6]!==m?(i=(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:m}),e[6]=m,e[7]=i):i=e[7],s=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"queues-declared",children:[i,a&&d.length===0?(0,t.jsx)(ie,{description:r("No defineQueue is declared in lunora/queues.ts in this deployment. Add one to offload async work to a Cloudflare Queue."),testId:"queues-empty",title:r("No queues defined")}):(0,t.jsx)(Me,{className:"overflow-hidden py-0",children:(0,t.jsx)(Ae,{className:"px-0",children:(0,t.jsxs)(Te,{"data-testid":"queues-table",children:[(0,t.jsx)(_e,{children:(0,t.jsxs)(z,{children:[(0,t.jsx)(C,{children:r("Export")}),(0,t.jsx)(C,{children:r("Queue")}),(0,t.jsx)(C,{children:r("Mode")}),(0,t.jsx)(C,{children:r("Binding")}),(0,t.jsx)(C,{children:r("Dead-letter")})]})}),(0,t.jsxs)(Be,{children:[l.map(Et),[...o].map(p=>{let[f,x]=p;return(0,t.jsxs)(Q.Fragment,{children:[(0,t.jsx)(z,{className:"bg-muted/40","data-testid":`queues-topic-${f}`,children:(0,t.jsx)(w,{className:"text-xs font-medium",colSpan:5,children:r("Topic {topic} \xB7 {count} subscriptions",{count:x.length,topic:f})})}),x.map(Mt)]},f)})]})]})})})]}),e[0]=a,e[1]=d,e[2]=r,e[3]=s}else s=e[3];return s},"St"),Ct=c(n=>{let e=(0,D.c)(67),{message:a,onReplay:d,replayingId:r}=n,s=F(),l,o,m,i,p,f,x,u,h,N;if(e[0]!==a.attempts||e[1]!==a.body||e[2]!==a.deadLettered||e[3]!==a.exportName||e[4]!==a.id||e[5]!==a.messageId||e[6]!==a.outcome||e[7]!==a.queue||e[8]!==s){let P=bt(a.body);o=z,f=`queues-message-${a.id}`;let U=a.exportName??a.queue;e[19]!==U?(x=(0,t.jsx)(w,{className:"font-mono text-xs",children:U}),e[19]=U,e[20]=x):x=e[20],e[21]!==a.messageId?(u=(0,t.jsx)(w,{className:"max-w-[16ch] truncate font-mono text-xs text-muted-foreground",title:a.messageId,children:a.messageId}),e[21]=a.messageId,e[22]=u):u=e[22],e[23]!==a.attempts?(h=(0,t.jsx)(w,{className:"font-mono text-xs tabular-nums",children:a.attempts}),e[23]=a.attempts,e[24]=h):h=e[24];let L=`queues-outcome-${a.id}`,T;e[25]!==a.outcome?(T=vt(a.outcome),e[25]=a.outcome,e[26]=T):T=e[26];let I;e[27]!==a.outcome||e[28]!==L||e[29]!==T?(I=(0,t.jsx)(de,{"data-testid":L,variant:T,children:a.outcome}),e[27]=a.outcome,e[28]=L,e[29]=T,e[30]=I):I=e[30];let _;e[31]!==a.deadLettered||e[32]!==a.id||e[33]!==s?(_=a.deadLettered&&(0,t.jsx)(de,{"data-testid":`queues-dlq-${a.id}`,variant:"destructive",children:s("DLQ")}),e[31]=a.deadLettered,e[32]=a.id,e[33]=s,e[34]=_):_=e[34],e[35]!==I||e[36]!==_?(N=(0,t.jsx)(w,{children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1",children:[I,_]})}),e[35]=I,e[36]=_,e[37]=N):N=e[37],l=w,m="max-w-[32ch] truncate font-mono text-xs text-muted-foreground",i=P,p=qt(P),e[0]=a.attempts,e[1]=a.body,e[2]=a.deadLettered,e[3]=a.exportName,e[4]=a.id,e[5]=a.messageId,e[6]=a.outcome,e[7]=a.queue,e[8]=s,e[9]=l,e[10]=o,e[11]=m,e[12]=i,e[13]=p,e[14]=f,e[15]=x,e[16]=u,e[17]=h,e[18]=N}else l=e[9],o=e[10],m=e[11],i=e[12],p=e[13],f=e[14],x=e[15],u=e[16],h=e[17],N=e[18];let y;e[38]!==l||e[39]!==m||e[40]!==i||e[41]!==p?(y=(0,t.jsx)(l,{className:m,title:i,children:p}),e[38]=l,e[39]=m,e[40]=i,e[41]=p,e[42]=y):y=e[42];let q;e[43]!==a.capturedAt?(q=Ge(a.capturedAt,"\u2014"),e[43]=a.capturedAt,e[44]=q):q=e[44];let b;e[45]!==q?(b=(0,t.jsx)(w,{className:"text-xs text-muted-foreground tabular-nums",children:q}),e[45]=q,e[46]=b):b=e[46];let v=`queues-replay-${a.id}`,E=r!==null,M;e[47]!==a.id||e[48]!==r||e[49]!==s?(M=r===a.id?s("Replaying\u2026"):s("Replay"),e[47]=a.id,e[48]=r,e[49]=s,e[50]=M):M=e[50];let A;e[51]!==a.id||e[52]!==d||e[53]!==v||e[54]!==E||e[55]!==M?(A=(0,t.jsx)(w,{children:(0,t.jsx)(le,{"data-id":a.id,"data-testid":v,disabled:E,onClick:d,size:"xs",type:"button",variant:"outline",children:M})}),e[51]=a.id,e[52]=d,e[53]=v,e[54]=E,e[55]=M,e[56]=A):A=e[56];let $;return e[57]!==o||e[58]!==b||e[59]!==A||e[60]!==f||e[61]!==x||e[62]!==u||e[63]!==h||e[64]!==N||e[65]!==y?($=(0,t.jsxs)(o,{"data-testid":f,children:[x,u,h,N,y,b,A]}),e[57]=o,e[58]=b,e[59]=A,e[60]=f,e[61]=x,e[62]=u,e[63]=h,e[64]=N,e[65]=y,e[66]=$):$=e[66],$},"Et"),It=c(n=>{let e=(0,D.c)(29),{hasError:a,messages:d,onClear:r,onReplay:s,replayingId:l}=n,o=F(),m;e[0]!==o?(m=o("Cloudflare Queues have no peek API, so this is what push consumers actually processed \u2014 not pending depth."),e[0]=o,e[1]=m):m=e[1];let i;e[2]!==m?(i=(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:m}),e[2]=m,e[3]=i):i=e[3];let p;e[4]!==o?(p=o("Clear the whole message log?"),e[4]=o,e[5]=p):p=e[5];let f=d.length===0,x;e[6]!==o?(x=o("Clear log"),e[6]=o,e[7]=x):x=e[7];let u;e[8]!==r||e[9]!==p||e[10]!==f||e[11]!==x?(u=(0,t.jsx)("div",{className:"ml-auto",children:(0,t.jsx)(Ve,{confirmLabel:p,disabled:f,onConfirm:r,testId:"queues-clear",children:x})}),e[8]=r,e[9]=p,e[10]=f,e[11]=x,e[12]=u):u=e[12];let h;e[13]!==d.length||e[14]!==o?(h=d.length>0&&(0,t.jsx)(de,{"data-testid":"queues-count",variant:"secondary",children:o("{count} messages",{count:d.length})}),e[13]=d.length,e[14]=o,e[15]=h):h=e[15];let N;e[16]!==i||e[17]!==u||e[18]!==h?(N=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[i,u,h]}),e[16]=i,e[17]=u,e[18]=h,e[19]=N):N=e[19];let y;e[20]!==a||e[21]!==d||e[22]!==s||e[23]!==l||e[24]!==o?(y=!a&&d.length===0?(0,t.jsx)(ie,{description:o("Consumed messages appear here once a push consumer processes a batch in dev. Send one from the Send tab to see it captured."),testId:"queues-messages-empty",title:o("No consumed messages yet.")}):(0,t.jsx)(Me,{className:"overflow-hidden py-0",children:(0,t.jsx)(Ae,{className:"px-0",children:(0,t.jsx)(Ze,{className:"max-h-[32rem]","data-testid":"queues-messages-scroll",children:(0,t.jsxs)(Te,{"data-testid":"queues-messages-table",children:[(0,t.jsx)(_e,{children:(0,t.jsxs)(z,{children:[(0,t.jsx)(C,{children:o("Export")}),(0,t.jsx)(C,{children:o("Message")}),(0,t.jsx)(C,{children:o("Attempts")}),(0,t.jsx)(C,{children:o("Outcome")}),(0,t.jsx)(C,{children:o("Body")}),(0,t.jsx)(C,{children:o("Captured")}),(0,t.jsx)(C,{})]})}),(0,t.jsx)(Be,{children:d.map(b=>(0,t.jsx)(Ct,{message:b,onReplay:s,replayingId:l},b.id))})]})})})}),e[20]=a,e[21]=d,e[22]=s,e[23]=l,e[24]=o,e[25]=y):y=e[25];let q;return e[26]!==N||e[27]!==y?(q=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"queues-messages",children:[N,y]}),e[26]=N,e[27]=y,e[28]=q):q=e[28],q},"Tt"),Qt=c(n=>{let e=(0,D.c)(20),{batchMode:a,bodyText:d,delayText:r,onBatchModeChange:s,onBodyChange:l,onDelayChange:o,onSelectExport:m,onSend:i,queues:p,selectedExportName:f,sending:x}=n,u=F(),h;e[0]!==u?(h=u("Enqueue a JSON message to a declared producer to exercise its consumer. Nothing is captured until the consumer processes it."),e[0]=u,e[1]=h):h=e[1];let N;e[2]!==h?(N=(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:h}),e[2]=h,e[3]=N):N=e[3];let y;e[4]!==a||e[5]!==d||e[6]!==r||e[7]!==s||e[8]!==l||e[9]!==o||e[10]!==m||e[11]!==i||e[12]!==p||e[13]!==f||e[14]!==x||e[15]!==u?(y=p.length===0?(0,t.jsx)(ie,{description:u("Declare a queue with defineQueue in lunora/queues.ts to enqueue a test message."),testId:"queues-send-empty",title:u("No queues to send to")}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsxs)("select",{"aria-label":u("Queue"),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":"queues-send-select",onChange:m,value:f,children:[p.map(At),[...$e(p).topics].map(b=>{let[v,E]=b;return(0,t.jsx)("option",{value:tt(v),children:u("{topic} (topic \u2192 {count} subscriptions)",{count:E.length,topic:v})},v)})]}),(0,t.jsx)(Pe,{"aria-label":u("Delay (seconds)"),className:"max-w-36","data-testid":"queues-send-delay",min:0,onChange:o,placeholder:u("Delay (s)"),type:"number",value:r}),(0,t.jsxs)("label",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",htmlFor:"queues-send-batch",children:[(0,t.jsx)("input",{checked:a,"data-testid":"queues-send-batch",id:"queues-send-batch",onChange:s,type:"checkbox"}),u("Send as batch (JSON array)")]}),(0,t.jsx)(le,{className:"ml-auto","data-testid":"queues-send-button",disabled:x||f==="",onClick:i,type:"button",children:u(x?"Sending\u2026":"Send message")})]}),(0,t.jsx)(Xe,{"aria-label":u("Message body (JSON)"),className:"font-mono","data-testid":"queues-send-body",onChange:l,placeholder:a?'[ { "hello": "world" } ]':'{ "hello": "world" }',value:d})]}),e[4]=a,e[5]=d,e[6]=r,e[7]=s,e[8]=l,e[9]=o,e[10]=m,e[11]=i,e[12]=p,e[13]=f,e[14]=x,e[15]=u,e[16]=y):y=e[16];let q;return e[17]!==N||e[18]!==y?(q=(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"queues-send",children:[N,y]}),e[17]=N,e[18]=y,e[19]=q):q=e[19],q},"_t"),Yt=c(n=>{let e=(0,D.c)(57),{limit:a}=n,d=a??gt,r=ze(),s=F(),[l,o]=(0,Q.useState)("declared"),[m,i]=(0,Q.useState)(null),p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={},e[0]=p):p=e[0];let{data:f,error:x,errorSource:u}=Le(W.listQueues,p),h;e[1]!==d?(h={limit:d},e[1]=d,e[2]=h):h=e[2];let{data:N,error:y,errorSource:q,refetch:b}=Le(W.getQueueMessages,h),v=Array.isArray(f?.queues)?[...f.queues].toSorted(Lt):[],E=N?.entries??[],{deadLetteredCount:M,queuesWithoutDlq:A,showReliabilityWarning:$}=pt(v,E),[P,U]=(0,Q.useState)(""),[L,T]=(0,Q.useState)(""),[I,_]=(0,Q.useState)(""),[G,st]=(0,Q.useState)(!1),[pe,ke]=(0,Q.useState)(!1),[he,Oe]=(0,Q.useState)(null),{topics:Re}=$e(v),Je=[...v.map(Tt),...[...Re.keys()].map(_t)],K=Je.includes(P)?P:Je[0]??"",je=l==="messages"?y:x,nt=l==="messages"?q:u,ge=je??m,fe=je===null?m:nt,V;e[3]!==b?(V=c(()=>{b()},"V"),e[3]=b,e[4]=V):V=e[4],Ye(V,l==="messages");let rt=c(async()=>{i(null);let g=K;if(g==="")return;let S=null,Fe=L.trim();if(Fe!=="")try{S=JSON.parse(Fe)}catch{i(s("Body must be valid JSON."));return}let Qe,We=I.trim();if(We!==""){let B=Number(We);if(!Number.isFinite(B)||B<0){i(s("Delay must be a non-negative number of seconds."));return}Qe=B}if(G&&!Array.isArray(S)){i(s("Batch mode needs a JSON array body \u2014 each element is enqueued as one message."));return}ke(!0);let it=ht(g,Re).map(B=>G?{batch:S,delaySeconds:Qe,exportName:B}:{body:S,delaySeconds:Qe,exportName:B});try{i(await xt(r,it,s)),b()}catch(B){i(H(B))}ke(!1)},"Ve"),X;e[5]!==r||e[6]!==b?(X=c(async g=>{i(null),Oe(g);try{await r.query(yt,{id:g},ue("")),b()}catch(S){i(H(S))}Oe(null)},"X"),e[5]=r,e[6]=b,e[7]=X):X=e[7];let xe=X,Y;e[8]!==r||e[9]!==b?(Y=c(async()=>{i(null);try{await r.query(Nt,{},ue("")),b()}catch(g){i(H(g))}},"Y"),e[8]=r,e[9]=b,e[10]=Y):Y=e[10];let ye=Y,Z;e[11]===Symbol.for("react.memo_cache_sentinel")?(Z=c(g=>{let S=g.currentTarget.dataset.tab;(S==="declared"||S==="messages"||S==="send")&&o(S)},"K"),e[11]=Z):Z=e[11];let ot=Z,ee;e[12]===Symbol.for("react.memo_cache_sentinel")?(ee=c(g=>{U(g.currentTarget.value)},"Z"),e[12]=ee):ee=e[12];let Ne=ee,te;e[13]===Symbol.for("react.memo_cache_sentinel")?(te=c(g=>{T(g.currentTarget.value)},"ee"),e[13]=te):te=e[13];let be=te,ae;e[14]===Symbol.for("react.memo_cache_sentinel")?(ae=c(g=>{_(g.currentTarget.value)},"te"),e[14]=ae):ae=e[14];let qe=ae,se;e[15]===Symbol.for("react.memo_cache_sentinel")?(se=c(g=>{st(g.currentTarget.checked)},"se"),e[15]=se):se=e[15];let ve=se,Se=c(()=>{me(rt())},"xe"),ne;e[16]!==xe?(ne=c(g=>{let{id:S}=g.currentTarget.dataset;S!==void 0&&me(xe(S))},"ae"),e[16]=xe,e[17]=ne):ne=e[17];let we=ne,re;e[18]!==ye?(re=c(()=>{me(ye())},"re"),e[18]=ye,e[19]=re):re=e[19];let Ce=re,dt="flex flex-col gap-6",lt="lunora-queues-panel",k;e[20]!==s||e[21]!==l?(k=(0,t.jsx)("div",{className:"flex items-center gap-1","data-testid":"queues-tabs",role:"tablist",children:["declared","messages","send"].map(g=>(0,t.jsx)(le,{"aria-selected":l===g,"data-tab":g,"data-testid":`queues-tab-${g}`,onClick:ot,role:"tab",size:"sm",type:"button",variant:l===g?"secondary":"ghost",children:St(g,s)},g))}),e[20]=s,e[21]=l,e[22]=k):k=e[22];let O;e[23]!==ge||e[24]!==fe?(O=ge!==null&&(0,t.jsx)(Ke,{error:fe,testId:"queues-error"}),e[23]=ge,e[24]=fe,e[25]=O):O=e[25];let Ie=$&&(0,t.jsx)(He,{icon:(0,t.jsx)("span",{"aria-hidden":"true",className:"text-base leading-none",children:"\u26A0"}),testId:"queues-dlq-warning",variant:"warning",children:(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[A.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"font-medium",children:s("No dead-letter queue on {queues}.",{queues:A.map(Bt).join(", ")})}),(0,t.jsx)("p",{className:"text-muted-foreground",children:s("Exhausted messages are dropped after retries. Add a deadLetterQueue to capture them.")})]}),M>0&&(0,t.jsx)("p",{className:A.length>0?"text-muted-foreground":"font-medium",children:M===1?s("1 message was recently dead-lettered."):s("{count} messages were recently dead-lettered.",{count:M})})]})}),R;e[26]!==v||e[27]!==f||e[28]!==l?(R=l==="declared"&&(0,t.jsx)(wt,{loaded:f!==void 0,queues:v}),e[26]=v,e[27]=f,e[28]=l,e[29]=R):R=e[29];let J;e[30]!==E||e[31]!==y||e[32]!==Ce||e[33]!==we||e[34]!==he||e[35]!==l?(J=l==="messages"&&(0,t.jsx)(It,{hasError:y!==null,messages:E,onClear:Ce,onReplay:we,replayingId:he}),e[30]=E,e[31]=y,e[32]=Ce,e[33]=we,e[34]=he,e[35]=l,e[36]=J):J=e[36];let j;e[37]!==G||e[38]!==L||e[39]!==I||e[40]!==ve||e[41]!==be||e[42]!==qe||e[43]!==Ne||e[44]!==Se||e[45]!==v||e[46]!==K||e[47]!==pe||e[48]!==l?(j=l==="send"&&(0,t.jsx)(Qt,{batchMode:G,bodyText:L,delayText:I,onBatchModeChange:ve,onBodyChange:be,onDelayChange:qe,onSelectExport:Ne,onSend:Se,queues:v,selectedExportName:K,sending:pe}),e[37]=G,e[38]=L,e[39]=I,e[40]=ve,e[41]=be,e[42]=qe,e[43]=Ne,e[44]=Se,e[45]=v,e[46]=K,e[47]=pe,e[48]=l,e[49]=j):j=e[49];let oe;return e[50]!==k||e[51]!==O||e[52]!==Ie||e[53]!==R||e[54]!==J||e[55]!==j?(oe=(0,t.jsxs)("div",{className:dt,"data-testid":lt,children:[k,O,Ie,R,J,j]}),e[50]=k,e[51]=O,e[52]=Ie,e[53]=R,e[54]=J,e[55]=j,e[56]=oe):oe=e[56],oe},"es");function Et(n){return(0,t.jsx)(at,{queue:n},n.exportName)}c(Et,"Ct");function Mt(n){return(0,t.jsx)(at,{queue:n},n.exportName)}c(Mt,"vt");function At(n){return(0,t.jsx)("option",{value:n.exportName,children:n.exportName},n.exportName)}c(At,"wt");function Lt(n,e){return n.exportName.localeCompare(e.exportName)}c(Lt,"Qt");function Tt(n){return n.exportName}c(Tt,"At");function _t(n){return tt(n)}c(_t,"It");function Bt(n){return n.name}c(Bt,"Mt");export{Yt as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as b}from"./chunk-QAQDMS6R.js";import{a as c,d as l,f as x,g,i as v}from"./chunk-I26MS5PJ.js";var u=l(x(),1);var s=l(g(),1);var p=b("flex items-start gap-2 rounded-md border px-3 py-2 text-sm [&>svg]:mt-0.5 [&>svg]:size-4 [&>svg]:shrink-0",{defaultVariants:{variant:"default"},variants:{variant:{default:"border-border bg-muted/40 text-foreground",destructive:"border-destructive/40 bg-destructive/5 text-destructive",warning:"border-amber-500/40 bg-amber-500/5 text-amber-700 dark:text-amber-400"}}}),j=c(f=>{let t=(0,u.c)(10),{children:d,className:i,icon:m,testId:o,variant:n}=f,e;t[0]!==i||t[1]!==n?(e=v(p({variant:n}),i),t[0]=i,t[1]=n,t[2]=e):e=t[2];let r;t[3]!==d?(r=(0,s.jsx)("div",{className:"min-w-0 flex-1",children:d}),t[3]=d,t[4]=r):r=t[4];let a;return t[5]!==m||t[6]!==e||t[7]!==r||t[8]!==o?(a=(0,s.jsxs)("div",{className:e,"data-testid":o,role:"alert",children:[m,r]}),t[5]=m,t[6]=e,t[7]=r,t[8]=o,t[9]=a):a=t[9],a},"N");export{j as a};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{a as V,b as J,c as K,d as M,e as B,f as A,g as I,h as F}from"./chunk-NQZALRU3.js";import{a as P}from"./chunk-QJLHH3ET.js";import{a as z}from"./chunk-XHRKNCCI.js";import{d as L,m as D,o as U,p as Q,s as W}from"./chunk-HJHSQPHW.js";import{a as p,d as q,e as ee,f as te,g as le}from"./chunk-I26MS5PJ.js";var R=q(te(),1),E=q(ee(),1);var $="inline-flex items-center gap-1 rounded-md border border-border px-2.5 py-1 text-xs font-medium text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-50",fe=`${$} aria-pressed:bg-accent aria-pressed:text-accent-foreground`;var s=q(le(),1);var X=p(l=>`"${l.replaceAll('"','""')}"`,"F"),ne=/["\n\r,]/u,oe=/^[=+\-@\t\r]/u,Y=p(l=>{if(l==null)return"";let e;return typeof l=="string"?e=oe.test(l)?` ${l}`:l:typeof l=="number"||typeof l=="boolean"||typeof l=="bigint"?e=String(l):e=U(l),ne.test(e)?`"${e.replaceAll('"','""')}"`:e},"J"),ae=p((l,e)=>{let n=l.map(t=>Y(t)).join(","),o=e.map(t=>l.map(i=>Y(t[i])).join(","));return[n,...o].join(`
|
|
2
|
+
`)},"ne"),re=p(l=>JSON.stringify(l,D,2),"oe"),Z=500,se=p(l=>l==null?"NULL":typeof l=="number"?Number.isFinite(l)?String(l):"NULL":typeof l=="bigint"?String(l):typeof l=="boolean"?l?"1":"0":`'${(typeof l=="string"?l:U(l)).replaceAll("'","''")}'`,"K"),G="__doc__",ie=p((l,e,n,o)=>{if(e.length===0||n.length===0)return"";let t=o?.includes(G)===!0&&!e.includes(G)?e.filter(c=>!o.includes(c)):void 0,i=t===void 0?e:o,r=p((c,g)=>se(t===void 0||g!==G?c[g]:JSON.stringify(Object.fromEntries(t.map(d=>[d,c[d]])),D)),"i"),a=i.map(c=>X(c)).join(", "),u=[];for(let c=0;c<n.length;c+=Z){let g=n.slice(c,c+Z).map(d=>` (${i.map(m=>r(d,m)).join(", ")})`).join(`,
|
|
3
|
+
`);u.push(`INSERT INTO ${X(l)} (${a}) VALUES
|
|
4
|
+
${g};`)}return u.join(`
|
|
5
|
+
|
|
6
|
+
`)},"se"),H=p((l,e,n)=>{if(!("document"in globalThis))return;let o=globalThis.URL.createObjectURL(new globalThis.Blob([e],{type:n})),t=globalThis.document.createElement("a");t.href=o,t.download=l,globalThis.document.body.append(t),t.click(),t.remove(),globalThis.URL.revokeObjectURL(o)},"M"),ce=p(l=>{let e=(0,R.c)(37),{columns:n,name:o,rows:t,sqlColumns:i}=l,r=L(),a;e[0]!==n||e[1]!==o||e[2]!==t?(a=p(()=>{H(`${o}.csv`,ae(n,t),"text/csv;charset=utf-8")},"s"),e[0]=n,e[1]=o,e[2]=t,e[3]=a):a=e[3];let u=a,c;e[4]!==o||e[5]!==t?(c=p(()=>{H(`${o}.json`,re(t),"application/json")},"c"),e[4]=o,e[5]=t,e[6]=c):c=e[6];let g=c,d;e[7]!==n||e[8]!==o||e[9]!==t||e[10]!==i?(d=p(()=>{H(`${o}.sql`,ie(o,n,t,i),"application/sql;charset=utf-8")},"a"),e[7]=n,e[8]=o,e[9]=t,e[10]=i,e[11]=d):d=e[11];let m=d,j=t.length===0,b;e[12]!==j?(b=(0,s.jsx)(J,{className:$,"data-testid":"grid-export",disabled:j,title:"Exports only the rows loaded on the current page, not the whole table",children:"Export page"}),e[12]=j,e[13]=b):b=e[13];let k;e[14]===Symbol.for("react.memo_cache_sentinel")?(k=(0,s.jsx)(B,{children:"Export loaded rows"}),e[14]=k):k=e[14];let h;e[15]!==r?(h=r("CSV"),e[15]=r,e[16]=h):h=e[16];let x;e[17]!==u||e[18]!==h?(x=(0,s.jsx)(A,{"data-testid":"grid-export-csv",onClick:u,children:h}),e[17]=u,e[18]=h,e[19]=x):x=e[19];let w;e[20]!==r?(w=r("JSON"),e[20]=r,e[21]=w):w=e[21];let y;e[22]!==g||e[23]!==w?(y=(0,s.jsx)(A,{"data-testid":"grid-export-json",onClick:g,children:w}),e[22]=g,e[23]=w,e[24]=y):y=e[24];let N;e[25]!==r?(N=r("SQL"),e[25]=r,e[26]=N):N=e[26];let f;e[27]!==m||e[28]!==N?(f=(0,s.jsx)(A,{"data-testid":"grid-export-sql",onClick:m,children:N}),e[27]=m,e[28]=N,e[29]=f):f=e[29];let C;e[30]!==y||e[31]!==f||e[32]!==x?(C=(0,s.jsxs)(K,{align:"end",children:[k,x,y,f]}),e[30]=y,e[31]=f,e[32]=x,e[33]=C):C=e[33];let v;return e[34]!==C||e[35]!==b?(v=(0,s.jsxs)(V,{children:[b,C]}),e[34]=C,e[35]=b,e[36]=v):v=e[36],v},"ie"),de=p(l=>{let e=(0,R.c)(9),{column:n}=l,o;e[0]!==n?(o=p(()=>{n.toggleVisibility()},"o"),e[0]=n,e[1]=o):o=e[1];let t=o,i;e[2]!==n?(i=n.getIsVisible(),e[2]=n,e[3]=i):i=e[3];let r=`grid-column-${n.id}`,a;return e[4]!==n.id||e[5]!==t||e[6]!==i||e[7]!==r?(a=(0,s.jsx)(I,{checked:i,closeOnClick:!1,"data-testid":r,onCheckedChange:t,children:n.id}),e[4]=n.id,e[5]=t,e[6]=i,e[7]=r,e[8]=a):a=e[8],a},"re"),me=[],ue=p(({backRelations:l=me,enabledBackRelations:e,onToggleBackRelation:n,table:o})=>{let t=L(),i=o.getIsAllColumnsVisible(),r=p(()=>{o.toggleAllColumnsVisible(!i)},"i");return(0,s.jsxs)(V,{children:[(0,s.jsx)(J,{className:$,"data-testid":"grid-columns",children:t("Columns")}),(0,s.jsxs)(K,{align:"end",className:"max-h-80 overflow-y-auto",children:[(0,s.jsxs)(M,{children:[(0,s.jsx)(B,{children:t("Columns")}),(0,s.jsx)(I,{checked:i,closeOnClick:!1,"data-testid":"grid-columns-all",onCheckedChange:r,children:t(i?"Hide all":"Show all")}),(0,s.jsx)(F,{}),o.getAllLeafColumns().filter(a=>!a.id.startsWith("__back__:")).map(a=>(0,s.jsx)(de,{column:a},a.id))]}),l.length>0&&n!==void 0&&(0,s.jsxs)(M,{children:[(0,s.jsx)(F,{}),(0,s.jsx)(B,{children:t("Related")}),l.map(a=>{let u=`${a.table}.${a.column}`;return(0,s.jsx)(I,{checked:e?.has(u)===!0,closeOnClick:!1,"data-testid":`grid-back-relation-${u}`,onCheckedChange:p(()=>{n(u)},"onCheckedChange"),children:`\u2190 ${a.table}.${a.column}`},u)})]})]})]})},"ae"),ge=p(l=>{let e=(0,R.c)(19),{count:n,editable:o,onClear:t,onDelete:i}=l,r=L(),a;e[0]!==n||e[1]!==r?(a=r("{count} selected",{count:n}),e[0]=n,e[1]=r,e[2]=a):a=e[2];let u;e[3]!==a?(u=(0,s.jsx)("span",{className:"font-medium tabular-nums","data-testid":"grid-selection-count",children:a}),e[3]=a,e[4]=u):u=e[4];let c;e[5]!==r?(c=r("Clear"),e[5]=r,e[6]=c):c=e[6];let g;e[7]!==t||e[8]!==c?(g=(0,s.jsx)("button",{className:$,"data-testid":"grid-selection-clear",onClick:t,type:"button",children:c}),e[7]=t,e[8]=c,e[9]=g):g=e[9];let d;e[10]!==n||e[11]!==o||e[12]!==i||e[13]!==r?(d=o&&(0,s.jsx)(z,{confirmLabel:r("Delete {count} rows and everything that cascades?",{count:n}),onConfirm:i,testId:"grid-selection-delete",children:r("Delete {count}",{count:n})}),e[10]=n,e[11]=o,e[12]=i,e[13]=r,e[14]=d):d=e[14];let m;return e[15]!==u||e[16]!==g||e[17]!==d?(m=(0,s.jsxs)("div",{className:"flex items-center gap-2 rounded-md border border-border bg-accent/40 px-3 py-1.5 text-xs","data-testid":"grid-selection-bar",children:[u,g,d]}),e[15]=u,e[16]=g,e[17]=d,e[18]=m):m=e[18],m},"de"),pe=/\.(?:avif|bmp|gif|ico|jpe?g|png|svg|webp)$/iu,be=p(l=>{let e=(0,R.c)(9),{bucket:n,objectKey:o,resolveUrl:t}=l,[i,r]=(0,E.useState)(null),[a,u]=(0,E.useState)(!1),c,g;e[0]!==n||e[1]!==o||e[2]!==t?(c=p(()=>{let b={cancelled:!1};return Q((async()=>{try{let k=await t(o,n);b.cancelled||r(k)}catch{b.cancelled||u(!0)}})()),()=>{b.cancelled=!0}},"c"),g=[n,o,t],e[0]=n,e[1]=o,e[2]=t,e[3]=c,e[4]=g):(c=e[3],g=e[4]),(0,E.useEffect)(c,g);let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=p(()=>{u(!0)},"a"),e[5]=d):d=e[5];let m=d;if(i===null||a)return null;let j;return e[6]!==o||e[7]!==i?(j=(0,s.jsx)("div",{className:"flex max-h-64 shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-muted/30",children:(0,s.jsx)("img",{alt:o,className:"max-h-64 object-contain","data-testid":"grid-cell-image",onError:m,src:i})}),e[6]=o,e[7]=i,e[8]=j):j=e[8],j},"me"),je=p(l=>{let e=(0,R.c)(37),{bucket:n,column:o,onClose:t,resolveUrl:i,value:r}=l,a=L(),[u,c]=(0,E.useState)(!1),g;e[0]!==r?(g=U(r),e[0]=r,e[1]=g):g=e[1];let d=g,m;e[2]!==d?(m=p(()=>{W(d)&&c(!0)},"d"),e[2]=d,e[3]=m):m=e[3];let j=m,b;e[4]!==a?(b=a("Cell value"),e[4]=a,e[5]=b):b=e[5];let k;e[6]!==o?(k=(0,s.jsx)("h2",{className:"truncate font-mono text-sm font-semibold text-foreground",children:o}),e[6]=o,e[7]=k):k=e[7];let h;e[8]!==u||e[9]!==a?(h=a(u?"Copied":"Copy"),e[8]=u,e[9]=a,e[10]=h):h=e[10];let x;e[11]!==j||e[12]!==h?(x=(0,s.jsx)("button",{className:$,"data-testid":"grid-cell-copy",onClick:j,type:"button",children:h}),e[11]=j,e[12]=h,e[13]=x):x=e[13];let w;e[14]!==a?(w=a("Close"),e[14]=a,e[15]=w):w=e[15];let y;e[16]!==t||e[17]!==w?(y=(0,s.jsx)("button",{className:$,"data-testid":"grid-cell-close",onClick:t,type:"button",children:w}),e[16]=t,e[17]=w,e[18]=y):y=e[18];let N;e[19]!==x||e[20]!==y?(N=(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[x,y]}),e[19]=x,e[20]=y,e[21]=N):N=e[21];let f;e[22]!==k||e[23]!==N?(f=(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[k,N]}),e[22]=k,e[23]=N,e[24]=f):f=e[24];let C;e[25]!==n||e[26]!==i||e[27]!==r?(C=i!==void 0&&typeof r=="string"&&pe.test(r)&&(0,s.jsx)(be,{bucket:n,objectKey:r,resolveUrl:i}),e[25]=n,e[26]=i,e[27]=r,e[28]=C):C=e[28];let v;e[29]!==d?(v=(0,s.jsx)("pre",{className:"min-h-0 flex-1 overflow-auto rounded-md border border-border bg-muted/30 p-3 font-mono text-xs whitespace-pre-wrap","data-testid":"grid-cell-value",children:d}),e[29]=d,e[30]=v):v=e[30];let S;return e[31]!==t||e[32]!==f||e[33]!==C||e[34]!==v||e[35]!==b?(S=(0,s.jsxs)(P,{className:"max-h-[70vh] w-[min(40rem,90vw)]",label:b,onClose:t,panelTestId:"grid-cell-dialog",testId:"grid-cell-dialog-overlay",variant:"dialog",children:[f,C,v]}),e[31]=t,e[32]=f,e[33]=C,e[34]=v,e[35]=b,e[36]=S):S=e[36],S},"Se"),Se=p(l=>{let e=(0,R.c)(37),{backRelations:n,enabledBackRelations:o,onToggleBackRelation:t,columns:i,editable:r,name:a,onBulkDelete:u,onToggleTranspose:c,rows:g,sqlColumns:d,table:m,transposed:j}=l,b=L(),k;e[0]!==m?(k=m.getSelectedRowModel(),e[0]=m,e[1]=k):k=e[1];let h=k.rows,x;e[2]!==m?(x=p(()=>{m.resetRowSelection()},"y"),e[2]=m,e[3]=x):x=e[3];let w=x,y;e[4]!==u||e[5]!==h||e[6]!==m?(y=p(()=>{u(h.map(he)),m.resetRowSelection()},"x"),e[4]=u,e[5]=h,e[6]=m,e[7]=y):y=e[7];let N=y,f;e[8]!==i||e[9]!==a||e[10]!==g||e[11]!==d?(f=(0,s.jsx)(ce,{columns:i,name:a,rows:g,sqlColumns:d}),e[8]=i,e[9]=a,e[10]=g,e[11]=d,e[12]=f):f=e[12];let C;e[13]!==n||e[14]!==o||e[15]!==t||e[16]!==m?(C=(0,s.jsx)(ue,{backRelations:n,enabledBackRelations:o,onToggleBackRelation:t,table:m}),e[13]=n,e[14]=o,e[15]=t,e[16]=m,e[17]=C):C=e[17];let v;e[18]!==b?(v=b("Swap rows and columns"),e[18]=b,e[19]=v):v=e[19];let S;e[20]!==b?(S=b("Transpose"),e[20]=b,e[21]=S):S=e[21];let T;e[22]!==c||e[23]!==v||e[24]!==S||e[25]!==j?(T=(0,s.jsx)("button",{"aria-pressed":j,className:$,"data-testid":"grid-transpose",onClick:c,title:v,type:"button",children:S}),e[22]=c,e[23]=v,e[24]=S,e[25]=j,e[26]=T):T=e[26];let _;e[27]!==r||e[28]!==w||e[29]!==N||e[30]!==h.length?(_=h.length>0&&(0,s.jsx)(ge,{count:h.length,editable:r,onClear:w,onDelete:N}),e[27]=r,e[28]=w,e[29]=N,e[30]=h.length,e[31]=_):_=e[31];let O;return e[32]!==f||e[33]!==C||e[34]!==T||e[35]!==_?(O=(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5","data-testid":"grid-actions",children:[f,C,T,_]}),e[32]=f,e[33]=C,e[34]=T,e[35]=_,e[36]=O):O=e[36],O},"ke");function he(l){return l.id}p(he,"ue");export{$ as a,fe as b,ce as c,ge as d,je as e,Se as f};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var i={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},e={...i,position:"fixed",top:0,left:0},t={...i,position:"absolute"};export{e as a,t as b};
|