@lunora/studio 1.0.0-alpha.14 → 1.0.0-alpha.141
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 +1515 -0
- package/dist/index.d.ts +910 -802
- package/dist/index.mjs +1 -0
- package/dist/mount.d.mts +21 -0
- package/dist/mount.d.ts +10 -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 +9 -0
- package/dist/packem_chunks/TableEditor.mjs +1 -0
- package/dist/packem_chunks/agents-panel.mjs +1 -0
- package/dist/packem_chunks/analytics-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/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-B6z7VLYt.mjs +1 -0
- package/dist/packem_shared/ApiDocsPanel-BOxViKDM.mjs +2 -0
- package/dist/packem_shared/ApiReferencePanel--YThTzHb.mjs +1 -0
- package/dist/packem_shared/CommandPalette-C4UrhLxv.mjs +1 -0
- package/dist/packem_shared/ConfirmButton-DU4p72Er.mjs +1 -0
- package/dist/packem_shared/ConnectionBadge-B_8fcft2.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-rqpuEiuQ.mjs +4 -0
- package/dist/packem_shared/DataFilters-3nbW0uax.mjs +1 -0
- package/dist/packem_shared/ErrorBoundary-BWNF98VF.mjs +1 -0
- package/dist/packem_shared/GlobalDataBrowser-BKm77TNC.mjs +1 -0
- package/dist/packem_shared/HomePanel-YG8qu2Nb.mjs +1 -0
- package/dist/packem_shared/MigrationsPanel-CYe0ygT8.mjs +1 -0
- package/dist/packem_shared/OpenRpcReferencePanel-Bn5UVD7s.mjs +1 -0
- package/dist/packem_shared/STUDIO_ROOT_CLASS-C6MccdVk.mjs +1 -0
- package/dist/packem_shared/ScheduledJobs-DN0yQoo6.mjs +1 -0
- package/dist/packem_shared/ShardInput-C6mjgAh4.mjs +1 -0
- package/dist/packem_shared/Studio-D8OZ5P-V.mjs +1 -0
- package/dist/packem_shared/StudioApp-VZ3I91QA.mjs +1 -0
- package/dist/packem_shared/StudioI18nProvider-fVsCSs5L.mjs +1 -0
- package/dist/packem_shared/advisor-view-5mZH6453.mjs +1 -0
- package/dist/packem_shared/aggregateMetrics-A-Y7OH6R.mjs +1 -0
- package/dist/packem_shared/alert-PB5W11MM.mjs +1 -0
- package/dist/packem_shared/app.d-D1bPR8FO.d.mts +252 -0
- package/dist/packem_shared/app.d-D1bPR8FO.d.ts +252 -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--2hKx4L2.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-BqNXJ9PF.mjs +1 -0
- package/dist/packem_shared/data-view-params-qoSTqjAj.mjs +1 -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-CczbAfst.mjs +1 -0
- package/dist/packem_shared/grid-features-D8w5isjt.mjs +6 -0
- package/dist/packem_shared/home-panel-BID7w6j3.mjs +3 -0
- package/dist/packem_shared/input-CXhxesPC.mjs +1 -0
- package/dist/packem_shared/internal-CwaF9YNk.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-SBxKyBug.mjs +1 -0
- package/dist/packem_shared/log-line-Dzg4YZ-K.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/quote-identifier-CGiYFBvY.mjs +1 -0
- package/dist/packem_shared/recording-client-BEZ6tVgo.mjs +1 -0
- package/dist/packem_shared/reference-view-CZxBZSRo.mjs +13 -0
- package/dist/packem_shared/schema-diagram-DU83ObYH.mjs +2 -0
- package/dist/packem_shared/scroll-area-CXCQH7VT.mjs +2 -0
- package/dist/packem_shared/select-Cx8-CokP.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-DysT8h5P.mjs +1 -0
- package/dist/packem_shared/stat-card-D0Fe04cX.mjs +1 -0
- package/dist/packem_shared/storage-tier-C2mKwYRj.mjs +1 -0
- package/dist/packem_shared/studio-ByaR_3g9.mjs +2 -0
- package/dist/packem_shared/table-D0SBiDu-.mjs +2 -0
- package/dist/packem_shared/table-list-sidebar-BxZm3sBJ.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-Cbj2GuHu.mjs +1 -0
- package/dist/packem_shared/use-async-submit-DAKymxcP.mjs +1 -0
- package/dist/packem_shared/use-auth-config-gxJL0E1r.mjs +1 -0
- package/dist/packem_shared/use-open-trace-B5LJ96_0.mjs +1 -0
- package/dist/packem_shared/use-shard-key-BsP3o5wT.mjs +1 -0
- package/dist/packem_shared/use-sql-assistant-CFRzdA9E.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/packem_shared/wire-codec-Dl3VeNrd.mjs +1 -0
- package/dist/standalone/chunk-25NFR6EB.js +1 -0
- package/dist/standalone/chunk-2AFIMJPZ.js +1 -0
- package/dist/standalone/chunk-2DO5EQCU.js +1 -0
- package/dist/standalone/chunk-2L64LHIR.js +1 -0
- package/dist/standalone/chunk-2QSOSRNW.js +1 -0
- package/dist/standalone/chunk-35DM4JJG.js +1 -0
- package/dist/standalone/chunk-3ILVYCWG.js +4 -0
- package/dist/standalone/chunk-3PKWDMXA.js +1 -0
- package/dist/standalone/chunk-3ZKYTFKY.js +1 -0
- package/dist/standalone/chunk-43Y54D7O.js +1 -0
- package/dist/standalone/chunk-46ZJ3TM4.js +2 -0
- package/dist/standalone/chunk-4GTO7FL5.js +1 -0
- package/dist/standalone/chunk-4L4WTGN5.js +1 -0
- package/dist/standalone/chunk-56AFJWER.js +1 -0
- package/dist/standalone/chunk-5AUOM7FK.js +1 -0
- package/dist/standalone/chunk-5GFSKIB2.js +1 -0
- package/dist/standalone/chunk-5JDWLCSH.js +1 -0
- package/dist/standalone/chunk-5PCGB55O.js +1 -0
- package/dist/standalone/chunk-5WJXVZMZ.js +1 -0
- package/dist/standalone/chunk-66UGPQVC.js +1 -0
- package/dist/standalone/chunk-7QMV55PO.js +1 -0
- package/dist/standalone/chunk-7QRRR3K6.js +1 -0
- package/dist/standalone/chunk-7RIRJD2P.js +1 -0
- package/dist/standalone/chunk-B5FXTB7H.js +1 -0
- package/dist/standalone/chunk-BX3F7MXP.js +1 -0
- package/dist/standalone/chunk-C3TOZ4LG.js +1 -0
- package/dist/standalone/chunk-C5L4BSYY.js +1 -0
- package/dist/standalone/chunk-CKZQXAZE.js +1 -0
- package/dist/standalone/chunk-CSUROWL2.js +1 -0
- package/dist/standalone/chunk-CXNZVJ3S.js +1 -0
- package/dist/standalone/chunk-D27D4UUI.js +1 -0
- package/dist/standalone/chunk-DEJLINCJ.js +1 -0
- package/dist/standalone/chunk-DQHYNFE4.js +9 -0
- package/dist/standalone/chunk-EA2JKR5D.js +1 -0
- package/dist/standalone/chunk-EBWXFG4H.js +1 -0
- package/dist/standalone/chunk-ECQTVV2J.js +1 -0
- package/dist/standalone/chunk-EG6XHY7N.js +1 -0
- package/dist/standalone/chunk-EIKBBMM4.js +1 -0
- package/dist/standalone/chunk-EILTQDXX.js +1 -0
- package/dist/standalone/chunk-ERWZGAOA.js +1 -0
- package/dist/standalone/chunk-F7UC63UN.js +1 -0
- package/dist/standalone/chunk-FKVZRPV5.js +1 -0
- package/dist/standalone/chunk-FNGY5SUZ.js +3 -0
- package/dist/standalone/chunk-FO26ZU7E.js +1 -0
- package/dist/standalone/chunk-FSRSK4LY.js +1 -0
- package/dist/standalone/chunk-G63MGXPG.js +1 -0
- package/dist/standalone/chunk-HEAQVSNS.js +1 -0
- package/dist/standalone/chunk-HODZXHVK.js +1 -0
- package/dist/standalone/chunk-I52I2DJG.js +1 -0
- package/dist/standalone/chunk-I5OKDKON.js +1 -0
- package/dist/standalone/chunk-IFLTA2OD.js +1 -0
- package/dist/standalone/chunk-IMOHEGMV.js +1 -0
- package/dist/standalone/chunk-JAZCU2PP.js +1 -0
- package/dist/standalone/chunk-JBIN7W2B.js +11 -0
- package/dist/standalone/chunk-JHEUUNXM.js +2 -0
- package/dist/standalone/chunk-JJA7KHJK.js +1 -0
- package/dist/standalone/chunk-JVUZEYKQ.js +1 -0
- package/dist/standalone/chunk-JYMXJUJ2.js +1 -0
- package/dist/standalone/chunk-K7AJEMKE.js +1 -0
- package/dist/standalone/chunk-KDWJAKFX.js +1 -0
- package/dist/standalone/chunk-KEZZGUYY.js +3 -0
- package/dist/standalone/chunk-LC3XGRNU.js +14 -0
- package/dist/standalone/chunk-LJC5BM3X.js +1 -0
- package/dist/standalone/chunk-M6MCQSPI.js +1 -0
- package/dist/standalone/chunk-MIVYBFY3.js +1 -0
- package/dist/standalone/chunk-MNAASONZ.js +1 -0
- package/dist/standalone/chunk-MRJNT4OH.js +1 -0
- package/dist/standalone/chunk-MVKXAIW3.js +7 -0
- package/dist/standalone/chunk-N6KHKQJH.js +1 -0
- package/dist/standalone/chunk-NBC6NJFJ.js +1 -0
- package/dist/standalone/chunk-NCCAMFB6.js +1 -0
- package/dist/standalone/chunk-NE7AR3N3.js +1 -0
- package/dist/standalone/chunk-NPERN4YF.js +1 -0
- package/dist/standalone/chunk-O2FV34ZD.js +1 -0
- package/dist/standalone/chunk-OGUKYRFM.js +1 -0
- package/dist/standalone/chunk-OKG3HWSJ.js +1 -0
- package/dist/standalone/chunk-OOESPRIZ.js +1 -0
- package/dist/standalone/chunk-OOKV3V3X.js +6 -0
- package/dist/standalone/chunk-PAUQAU23.js +1 -0
- package/dist/standalone/chunk-PKCC4J5W.js +1 -0
- package/dist/standalone/chunk-PYT4RZJH.js +1 -0
- package/dist/standalone/chunk-Q3HF6P2M.js +1 -0
- package/dist/standalone/chunk-Q4CAKBWN.js +1 -0
- package/dist/standalone/chunk-QKEJLVC5.js +1 -0
- package/dist/standalone/chunk-QSOJFV42.js +1 -0
- package/dist/standalone/chunk-RK3WWWTT.js +1 -0
- package/dist/standalone/chunk-RLLKECZT.js +1 -0
- package/dist/standalone/chunk-RPQL45FL.js +1 -0
- package/dist/standalone/chunk-S3CRZLGS.js +1 -0
- package/dist/standalone/chunk-S63ID2FC.js +1 -0
- package/dist/standalone/chunk-SB35BJ7A.js +1 -0
- package/dist/standalone/chunk-SSNHCN4D.js +1 -0
- package/dist/standalone/chunk-T2IE5GKA.js +15 -0
- package/dist/standalone/chunk-TGHH7ZFA.js +1 -0
- package/dist/standalone/chunk-TJRQUJFS.js +1 -0
- package/dist/standalone/chunk-TQCXJX4I.js +1 -0
- package/dist/standalone/chunk-TRL7AHZK.js +4 -0
- package/dist/standalone/chunk-TWTNWOJU.js +1 -0
- package/dist/standalone/chunk-TZI3JW3Q.js +1 -0
- package/dist/standalone/chunk-UBVWMMQG.js +1 -0
- package/dist/standalone/chunk-UDCVU3Z5.js +1 -0
- package/dist/standalone/chunk-UKL4FSKP.js +1 -0
- package/dist/standalone/chunk-ULIQFBZU.js +1 -0
- package/dist/standalone/chunk-USC5APTS.js +1 -0
- package/dist/standalone/chunk-UWDFH35E.js +1 -0
- package/dist/standalone/chunk-UYEZR3BI.js +1 -0
- package/dist/standalone/chunk-V36AL47B.js +1 -0
- package/dist/standalone/chunk-VPPKG2IW.js +1 -0
- package/dist/standalone/chunk-VVOVVU53.js +1 -0
- package/dist/standalone/chunk-WQYWA7U6.js +1 -0
- package/dist/standalone/chunk-WR675JUF.js +1 -0
- package/dist/standalone/chunk-WUWBZPUK.js +1 -0
- package/dist/standalone/chunk-X43AA6RX.js +8 -0
- package/dist/standalone/chunk-XSLMHPP2.js +59 -0
- package/dist/standalone/chunk-XZMOZFE6.js +1 -0
- package/dist/standalone/chunk-Y4Q25F6X.js +19 -0
- package/dist/standalone/chunk-Y6CXU7T4.js +1 -0
- package/dist/standalone/chunk-YEBHHIAY.js +1 -0
- package/dist/standalone/chunk-YFLOZILV.js +1 -0
- package/dist/standalone/chunk-YFPU55K4.js +1 -0
- package/dist/standalone/chunk-YKXDMIHQ.js +1 -0
- package/dist/standalone/chunk-Z5APSEW7.js +1 -0
- package/dist/standalone/chunk-ZB74UWVA.js +1 -0
- package/dist/standalone/chunk-ZE2Q22OK.js +1 -0
- package/dist/standalone/chunk-ZOWSTFP5.js +1 -0
- package/dist/standalone/studio.js +9 -378
- package/dist/styles.css +2 -2
- package/package.json +21 -18
- package/dist/index.js +0 -41
- package/dist/mount.js +0 -26
- package/dist/packem_shared/ADMIN_FUNCTIONS-CZJCZ4c7.js +0 -47
- package/dist/packem_shared/ApiDocsPanel-yEz0fiof.js +0 -842
- package/dist/packem_shared/ApiReferencePanel-1vubqG5s.js +0 -229
- package/dist/packem_shared/ApiTab-DdubReQI.js +0 -251
- package/dist/packem_shared/AuditPanel-CE5ofjCc.js +0 -200
- package/dist/packem_shared/CommandPalette-BtgkBzZI.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-DpL8U-Nf.js +0 -4475
- package/dist/packem_shared/DataFilters-FNquMaiu.js +0 -249
- package/dist/packem_shared/ErrorBoundary-BzAApI7J.js +0 -66
- package/dist/packem_shared/ExportImportPanel-ChsSUCYZ.js +0 -197
- package/dist/packem_shared/FileBrowser-DsRBnVhZ.js +0 -2932
- package/dist/packem_shared/FunctionRunner-D4cZ6fuA.js +0 -343
- package/dist/packem_shared/FunctionStatsPanel-BVelWgNv.js +0 -375
- package/dist/packem_shared/GlobalDataBrowser-3X9uRfdO.js +0 -289
- package/dist/packem_shared/HealthPanel-CxUVKfvo.js +0 -648
- package/dist/packem_shared/HomePanel-tfqpZxuu.js +0 -1334
- package/dist/packem_shared/InsightsPanel-DNg3K9XN.js +0 -461
- package/dist/packem_shared/LogsPanel-B4LoSRj0.js +0 -827
- package/dist/packem_shared/MailPanel-CcpdyWYs.js +0 -440
- package/dist/packem_shared/MetricsPanel-CxoyWbNb.js +0 -1611
- package/dist/packem_shared/MigrationsPanel-DGwJGWDA.js +0 -239
- package/dist/packem_shared/OpenRpcReferencePanel-vbcYbv3V.js +0 -191
- package/dist/packem_shared/PitrPanel-CKUzyyHi.js +0 -252
- package/dist/packem_shared/STUDIO_ROOT_CLASS-D12gX2dV.js +0 -3
- package/dist/packem_shared/ScheduledJobs-BWNwIN3I.js +0 -262
- package/dist/packem_shared/SchemaViewer-RclXFo9Q.js +0 -2512
- package/dist/packem_shared/SecurityAdvisorPanel-Dqql1Z5O.js +0 -92
- package/dist/packem_shared/SettingsPanel-D5iTY0YE.js +0 -390
- package/dist/packem_shared/ShardInput-gx_DZXXn.js +0 -107
- package/dist/packem_shared/SqlEditorPanel-Dj-In-B3.js +0 -13
- package/dist/packem_shared/Studio-VWvKNOw4.js +0 -33
- package/dist/packem_shared/StudioApp-BhQ6T2pn.js +0 -657
- package/dist/packem_shared/StudioI18nProvider-B-tDCZIi.js +0 -48
- package/dist/packem_shared/TableEditor-BY8bTpCl.js +0 -11
- package/dist/packem_shared/advisor-view-CGcfMiPq.js +0 -159
- package/dist/packem_shared/aggregateMetrics-D4nUHEKU.js +0 -108
- package/dist/packem_shared/app.d-BVJFkXyj.d.ts +0 -300
- package/dist/packem_shared/badge-B2PKA1-5.js +0 -49
- package/dist/packem_shared/bar-chart-CzJAgqkp.js +0 -3245
- package/dist/packem_shared/button-BhsN2uZH.js +0 -49
- package/dist/packem_shared/card-DURq3ElK.js +0 -175
- package/dist/packem_shared/cf-links-2cktDedA.js +0 -8
- package/dist/packem_shared/checkbox-UNkzAxl-.js +0 -63
- package/dist/packem_shared/data-grid-B5CaV3wS.js +0 -183
- 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/grid-features-CzUfqgsM.js +0 -840
- package/dist/packem_shared/input-XH4r1Pt1.js +0 -53
- package/dist/packem_shared/internal-rXJEAhXS.js +0 -68
- package/dist/packem_shared/label-D8ykjn5J.js +0 -46
- package/dist/packem_shared/live-status-FZ0psC1z.js +0 -44
- package/dist/packem_shared/reference-view-B4E49Lip.js +0 -2180
- package/dist/packem_shared/shard-history-DyebH1R5.js +0 -38
- package/dist/packem_shared/sparkline-10dG-_f0.js +0 -93
- package/dist/packem_shared/sql-editor-panel-CMdxstu5.js +0 -2562
- package/dist/packem_shared/storage-tier-CL98eOvn.js +0 -85
- package/dist/packem_shared/studio-D8ry3tJR.js +0 -11043
- package/dist/packem_shared/table-_RzNvy3R.js +0 -246
- package/dist/packem_shared/table-editor-CWx68ZCg.js +0 -407
- package/dist/packem_shared/table-list-sidebar-Bg7uzbvC.js +0 -832
- package/dist/packem_shared/textarea-D3gaCU_-.js +0 -46
- package/dist/packem_shared/use-admin-query-BkbdNFNz.js +0 -105
- 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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as Nr}from"./chunk-Y6CXU7T4.js";import{a as Or}from"./chunk-4L4WTGN5.js";import{a,d as k,e as B,g as Z}from"./chunk-YKXDMIHQ.js";var zo=k(B(),1),ae=zo.createContext(null);var Ho=k(B(),1);function N(t){return Ho.useContext(ae)}a(N,"useRouter");var Ue=k(B(),1),bt=Ue.createContext(void 0),jo=Ue.createContext(void 0);function dt(t){return t[t.length-1]}a(dt,"last");function Dr(t){return typeof t=="function"}a(Dr,"isFunction");function J(t,e){return Dr(t)?t(e):t}a(J,"functionalUpdate");var Jo=Object.prototype.hasOwnProperty,Fr=Object.prototype.propertyIsEnumerable;function ht(t){for(let e in t)if(Jo.call(t,e))return!0;return!1}a(ht,"hasKeys");var Ar=a(()=>Object.create(null),"createNull"),pt=a((t,e)=>st(t,e,Ar),"nullReplaceEqualDeep");function st(t,e,o=()=>({}),r=0){if(!1)return e;if(t===e)return t;if(r>500)return e;let n=e,s=Ve(t)&&Ve(n);if(!s&&!(jt(t)&&jt(n)))return n;let u=s?t:Ko(t);if(!u)return n;let i=s?n:Ko(n);if(!i)return n;let l=u.length,c=i.length,f=s?new Array(c):o(),d=0;for(let h=0;h<c;h++){let m=s?h:i[h],g=t[m],p=n[m];if(g===p){f[m]=g,(s?h<l:Jo.call(t,m))&&d++;continue}if(g===null||p===null||typeof g!="object"||typeof p!="object"){f[m]=p;continue}let v=st(g,p,o,r+1);f[m]=v,v===g&&d++}return l===c&&d===l?t:f}a(st,"replaceEqualDeep");function Ko(t){let e=Object.keys(t);if(e.length!==Object.getOwnPropertyNames(t).length)return!1;let o=Object.getOwnPropertySymbols(t);if(o.length===0)return e;for(let r of o){if(!Fr.call(t,r))return!1;e.push(r)}return e}a(Ko,"getEnumerableOwnKeys");function jt(t){if(!qo(t))return!1;let e=t.constructor;if(typeof e>"u")return!0;let o=e.prototype;return!(!qo(o)||!o.hasOwnProperty("isPrototypeOf"))}a(jt,"isPlainObject");function qo(t){return Object.prototype.toString.call(t)==="[object Object]"}a(qo,"hasObjectPrototype");function Ve(t){return Array.isArray(t)&&t.length===Object.keys(t).length}a(Ve,"isPlainArray");function Q(t,e,o){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(let r=0,n=t.length;r<n;r++)if(!Q(t[r],e[r],o))return!1;return!0}if(jt(t)&&jt(e)){let r=o?.ignoreUndefined??!0;if(o?.partial){for(let u in e)if((!r||e[u]!==void 0)&&!Q(t[u],e[u],o))return!1;return!0}let n=0;if(!r)n=Object.keys(t).length;else for(let u in t)t[u]!==void 0&&n++;let s=0;for(let u in e)if((!r||e[u]!==void 0)&&(s++,s>n||!Q(t[u],e[u],o)))return!1;return n===s}return!1}a(Q,"deepEqual");var $r=/[\x00-\x1f\x7f"<>`{}]/g;function Br(t){return t.replace($r,e=>"%"+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0"))}a(Br,"sanitizePathSegment");function Go(t){let e;try{e=decodeURI(t)}catch{e=t.replaceAll(/%[0-9A-F]{2}/gi,o=>{try{return decodeURI(o)}catch{return o}})}return Br(e)}a(Go,"decodeSegment");var We=["http:","https:","mailto:","tel:"];function it(t,e){if(!t)return!1;try{let o=new URL(t);return!e.has(o.protocol)}catch{return!1}}a(it,"isDangerousProtocol");function Nt(t){if(!t)return{path:t,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(t)&&!t.startsWith("//"))return{path:t,handledProtocolRelativeURL:!1};let e=/%25|%5C/gi,o=0,r="",n;for(;(n=e.exec(t))!==null;)r+=Go(t.slice(o,n.index))+n[0],o=e.lastIndex;r=r+Go(o?t.slice(o):t);let s=!1;return r.startsWith("//")&&(s=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:s}}a(Nt,"decodePath");function Yo(t){return/\s|[^\u0000-\u007F]/.test(t)?t.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):t}a(Yo,"encodePathLikeUrl");function Xo(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let o=0;o<t.length;o++)if(t[o]!==e[o])return!1;return!0}a(Xo,"arraysEqual");function mt(){throw new Error("Invariant failed")}a(mt,"invariant");function Dt(t){let e=new Map,o,r,n=a(s=>{s.next&&(s.prev?(s.prev.next=s.next,s.next.prev=s.prev,s.next=void 0,r&&(r.next=s,s.prev=r)):(s.next.prev=void 0,o=s.next,s.next=void 0,r&&(s.prev=r,r.next=s)),r=s)},"touch");return{get(s){let u=e.get(s);if(u)return n(u),u.value},set(s,u){if(e.size>=t&&o){let l=o;e.delete(l.key),l.next&&(o=l.next,l.next.prev=void 0),l===r&&(r=void 0)}let i=e.get(s);if(i)i.value=u,n(i);else{let l={key:s,value:u,prev:r};r&&(r.next=l),r=l,o||(o=l),e.set(s,l)}},clear(){e.clear(),o=void 0,r=void 0}}}a(Dt,"createLRUCache");var gt=4,Qo=5;function Ur(t){let e=t.indexOf("{");if(e===-1)return null;let o=t.indexOf("}",e);return o===-1||e+1>=t.length?null:[e,o]}a(Ur,"getOpenAndCloseBraces");function ze(t,e,o=new Uint16Array(6)){let r=t.indexOf("/",e),n=r===-1?t.length:r,s=t.substring(e,n);if(!s||!s.includes("$"))return o[0]=0,o[1]=e,o[2]=e,o[3]=n,o[4]=n,o[5]=n,o;if(s==="$"){let i=t.length;return o[0]=2,o[1]=e,o[2]=e,o[3]=i,o[4]=i,o[5]=i,o}if(s.charCodeAt(0)===36)return o[0]=1,o[1]=e,o[2]=e+1,o[3]=n,o[4]=n,o[5]=n,o;let u=Ur(s);if(u){let[i,l]=u,c=s.charCodeAt(i+1);if(c===45){if(i+2<s.length&&s.charCodeAt(i+2)===36){let f=i+3,d=l;if(f<d)return o[0]=3,o[1]=e+i,o[2]=e+f,o[3]=e+d,o[4]=e+l+1,o[5]=n,o}}else if(c===36){let f=i+1,d=i+2;return d===l?(o[0]=2,o[1]=e+i,o[2]=e+f,o[3]=e+d,o[4]=e+l+1,o[5]=t.length,o):(o[0]=1,o[1]=e+i,o[2]=e+d,o[3]=e+l,o[4]=e+l+1,o[5]=n,o)}}return o[0]=0,o[1]=e,o[2]=e,o[3]=n,o[4]=n,o[5]=n,o}a(ze,"parseSegment");function ue(t,e,o,r,n,s,u,i){i?.(o);let l=r;{let c=o.fullPath??o.from,f=o.options,d=c.length,h=f?.caseSensitive??t,m=f?.params?.parse??f?.parseParams;for(;l<d;){let p=ze(c,l,e),v,S=l,y=p[5];l=y+1,s++;let w=p[0];switch(w){case 0:{let R=c.substring(p[2],p[3]),L=R,x;h?x=n.static??=new Map:(L=R.toLowerCase(),x=n.staticInsensitive??=new Map);let _=x.get(L);if(_)v=_;else{let b=Ft(c);b.parent=n,b.depth=s,v=b,x.set(L,b)}break}case 1:case 3:case 2:{let R=c.substring(S,p[1]),L=c.substring(p[4],y),x=h&&!!(R||L),_=R?x?R:R.toLowerCase():void 0,b=L?x?L:L.toLowerCase():void 0,P=w===1?n.dynamic:w===3?n.optional:n.wildcard,E=w!==2&&!m&&P?.find(C=>!C.parse&&C.caseSensitive===x&&C.prefix===_&&C.suffix===b);if(E)v=E;else{let C=Vr(w,c,x,_,b);v=C,C.parent=n,C.depth=s;let T;w===1?T=n.dynamic??=[]:w===3?T=n.optional??=[]:T=n.wildcard??=[],T.push(C),T.length===2&&u?.push(T)}break}}n=v}if(m&&o.children&&!o.isRoot&&o.id&&o.id.charCodeAt(o.id.lastIndexOf("/")+1)===95){let p=Ft(c);p.kind=Qo,p.parent=n,s++,p.depth=s,n.pathless??=[],n.pathless.push(p),n=p}let g=(o.path||!o.children)&&!o.isRoot;if(g&&c.endsWith("/")){let p=Ft(c);p.kind=gt,p.parent=n,s++,p.depth=s,n.index=p,n=p}n.parse=m??null,n.priority=f?.params?.priority??0,g&&!n.route&&(n.route=o,n.fullPath=c)}if(o.children)for(let c of o.children)ue(t,e,c,l,n,s,u,i)}a(ue,"parseSegments");function tn(t,e){if(t.parse&&!e.parse)return-1;if(!t.parse&&e.parse)return 1;if(t.parse&&e.parse&&(t.priority||e.priority))return e.priority-t.priority;if(t.prefix&&e.prefix&&t.prefix!==e.prefix){if(t.prefix.startsWith(e.prefix))return-1;if(e.prefix.startsWith(t.prefix))return 1}if(t.suffix&&e.suffix&&t.suffix!==e.suffix){if(t.suffix.endsWith(e.suffix))return-1;if(e.suffix.endsWith(t.suffix))return 1}return t.prefix&&!e.prefix?-1:!t.prefix&&e.prefix?1:t.suffix&&!e.suffix?-1:!t.suffix&&e.suffix?1:t.caseSensitive&&!e.caseSensitive?-1:!t.caseSensitive&&e.caseSensitive?1:0}a(tn,"sortDynamic");function Ft(t){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0}}a(Ft,"createStaticNode");function Vr(t,e,o,r,n){return{kind:t,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0,caseSensitive:o,prefix:r,suffix:n}}a(Vr,"createDynamicNode");function en(t,e){let o=Ft("/"),r=new Uint16Array(6),n=[];for(let s of t)ue(!1,r,s,1,o,0,n);for(let s of n)s.sort(tn);e.masksTree=o,e.flatCache=Dt(1e3)}a(en,"processRouteMasks");function on(t,e){t||="/";let o=e.flatCache.get(t);if(o)return o;let r=He(t,e.masksTree);return e.flatCache.set(t,r),r}a(on,"findFlatMatch");function nn(t,e,o,r,n){t||="/",r||="/";let s=e?`case\0${t}`:t,u=n.singleCache.get(s);return u||(u=Ft("/"),ue(e,new Uint16Array(6),{from:t},1,u,0),n.singleCache.set(s,u)),He(r,u,o)}a(nn,"findSingleMatch");function rn(t,e,o=!1){let r=o?t:`nofuzz\0${t}`,n=e.matchCache.get(r);if(n!==void 0)return n;t||="/";let s;try{s=He(t,e.segmentTree,o)}catch(u){if(u instanceof URIError)s=null;else throw u}return s&&(s.branch=je(s.route)),e.matchCache.set(r,s),s}a(rn,"findRouteMatch");function Wr(t){return t==="/"?t:t.replace(/\/{1,}$/,"")}a(Wr,"trimPathRight");function sn(t,e=!1,o){let r=Ft(t.fullPath),n=new Uint16Array(6),s=[],u={},i={},l=0;ue(e,n,t,1,r,0,s,c=>{if(o?.(c,l),c.id in u&&mt(),u[c.id]=c,l!==0&&c.path){let f=Wr(c.fullPath);(!i[f]||c.fullPath.endsWith("/"))&&(i[f]=c)}l++});for(let c of s)c.sort(tn);return{processedTree:{segmentTree:r,singleCache:Dt(1e3),matchCache:Dt(1e3),flatCache:null,masksTree:null},routesById:u,routesByPath:i}}a(sn,"processRouteTree");function He(t,e,o=!1){let r=t.split("/"),n=Hr(t,r,e,o);if(!n)return null;let[s]=an(t,r,n);return{route:n.node.route,rawParams:s}}a(He,"findMatch");function an(t,e,o){let r=zr(o.node),n=null,s=Object.create(null),u=o.extract?.part??0,i=o.extract?.node??0,l=o.extract?.path??0,c=o.extract?.segment??0;for(;i<r.length;u++,i++,l++,c++){let f=r[i];if(f.kind===gt)break;if(f.kind===Qo){c--,u--,l--;continue}let d=e[u],h=l;if(d&&(l+=d.length),f.kind===1){n??=o.node.fullPath.split("/");let m=n[c],g=f.prefix?.length??0;if(m.charCodeAt(g)===123){let p=f.suffix?.length??0,v=m.substring(g+2,m.length-p-1),S=d.substring(g,d.length-p);s[v]=decodeURIComponent(S)}else{let p=m.substring(1);s[p]=decodeURIComponent(d)}}else if(f.kind===3){if(o.skipped&1<<i){u--,l=h-1;continue}n??=o.node.fullPath.split("/");let m=n[c],g=f.prefix?.length??0,p=f.suffix?.length??0,v=m.substring(g+3,m.length-p-1),S=f.suffix||f.prefix?d.substring(g,d.length-p):d;S&&(s[v]=decodeURIComponent(S))}else if(f.kind===2){let m=f,g=t.substring(h+(m.prefix?.length??0),t.length-(m.suffix?.length??0)),p=decodeURIComponent(g);s["*"]=p,s._splat=p;break}}return o.rawParams&&Object.assign(s,o.rawParams),[s,{part:u,node:i,path:l,segment:c}]}a(an,"extractParams");function je(t){let e=[t];for(;t.parentRoute;)t=t.parentRoute,e.push(t);return e.reverse(),e}a(je,"buildRouteBranch");function zr(t){let e=Array(t.depth+1);do e[t.depth]=t,t=t.parent;while(t);return e}a(zr,"buildBranch");function Hr(t,e,o,r){if(t==="/"&&o.index)return{node:o.index,skipped:0};let n=!dt(e),s=n&&t!=="/",u=e.length-(n?1:0),i=[{node:o,index:1,skipped:0,statics:0,dynamics:0,optionals:0}],l=null,c=null;for(;i.length;){let f=i.pop(),{node:d,index:h,skipped:m,statics:g,dynamics:p,optionals:v}=f,{extract:S,rawParams:y}=f;if(d.kind===2&&d.route&&!le(c,f))continue;if(d.parse){if(!Zo(t,e,f))continue;y=f.rawParams,S=f.extract}r&&d.route&&d.kind!==gt&&le(l,f)&&(l=f);let w=h===u;if(w&&(d.route&&(!s||d.kind===gt||d.kind===2)&&le(c,f)&&(c=f),!d.optional&&!d.wildcard&&!d.index&&!d.pathless))continue;let R=w?void 0:e[h],L;if(w&&d.index){let x={node:d.index,index:h,skipped:m,statics:g,dynamics:p,optionals:v,extract:S,rawParams:y},_=!0;if(d.index.parse&&(Zo(t,e,x)||(_=!1)),_){if(!p&&!v&&!m&&jr(g,u))return x;le(c,x)&&(c=x)}}if(d.wildcard)for(let x=d.wildcard.length-1;x>=0;x--){let _=d.wildcard[x],{prefix:b,suffix:P}=_;if(!(b&&(w||!(_.caseSensitive?R:L??=R.toLowerCase()).startsWith(b)))){if(P){if(w)continue;let E=e.slice(h).join("/").slice(-P.length);if((_.caseSensitive?E:E.toLowerCase())!==P)continue}i.push({node:_,index:u,skipped:m,statics:g,dynamics:p,optionals:v,extract:S,rawParams:y})}}if(d.optional){let x=m|1<<d.depth+1;for(let _=d.optional.length-1;_>=0;_--){let b=d.optional[_];i.push({node:b,index:h,skipped:x,statics:g,dynamics:p,optionals:v,extract:S,rawParams:y})}if(!w)for(let _=d.optional.length-1;_>=0;_--){let b=d.optional[_],{prefix:P,suffix:E}=b;if(P||E){let C=b.caseSensitive?R:L??=R.toLowerCase();if(P&&!C.startsWith(P)||E&&!C.endsWith(E))continue}i.push({node:b,index:h+1,skipped:m,statics:g,dynamics:p,optionals:v+ce(u,h),extract:S,rawParams:y})}}if(!w&&d.dynamic&&R)for(let x=d.dynamic.length-1;x>=0;x--){let _=d.dynamic[x],{prefix:b,suffix:P}=_;if(b||P){let E=_.caseSensitive?R:L??=R.toLowerCase();if(b&&!E.startsWith(b)||P&&!E.endsWith(P))continue}i.push({node:_,index:h+1,skipped:m,statics:g,dynamics:p+ce(u,h),optionals:v,extract:S,rawParams:y})}if(!w&&d.staticInsensitive){let x=d.staticInsensitive.get(L??=R.toLowerCase());x&&i.push({node:x,index:h+1,skipped:m,statics:g+ce(u,h),dynamics:p,optionals:v,extract:S,rawParams:y})}if(!w&&d.static){let x=d.static.get(R);x&&i.push({node:x,index:h+1,skipped:m,statics:g+ce(u,h),dynamics:p,optionals:v,extract:S,rawParams:y})}if(d.pathless)for(let x=d.pathless.length-1;x>=0;x--){let _=d.pathless[x];i.push({node:_,index:h,skipped:m,statics:g,dynamics:p,optionals:v,extract:S,rawParams:y})}}if(c)return c;if(r&&l){let f=l.index;for(let h=0;h<l.index;h++)f+=e[h].length;let d=f===t.length?"/":t.slice(f);return l.rawParams??=Object.create(null),l.rawParams["**"]=decodeURIComponent(d),l}return null}a(Hr,"getNodeMatch");function ce(t,e){return 2**(t-e-1)}a(ce,"segmentScore");function jr(t,e){return t===2**(e-1)-1}a(jr,"isPerfectStaticMatch");function Zo(t,e,o){let r,n;try{[r,n]=an(t,e,o)}catch{return null}if(o.rawParams=r,o.extract=n,!o.node.parse)return!0;try{if(o.node.parse(r)===!1)return null}catch{}return!0}a(Zo,"validateParseParams");function le(t,e){return t?e.statics>t.statics||e.statics===t.statics&&(e.dynamics>t.dynamics||e.dynamics===t.dynamics&&(e.optionals>t.optionals||e.optionals===t.optionals&&((e.node.kind===gt)>(t.node.kind===gt)||e.node.kind===gt==(t.node.kind===gt)&&e.node.depth>t.node.depth))):!0}a(le,"isFrameMoreSpecific");function Pt(t){return qt(t.filter(e=>e!==void 0).join("/"))}a(Pt,"joinPaths");function qt(t){return t.replace(/\/{2,}/g,"/")}a(qt,"cleanPath");function fe(t){return t==="/"?t:t.replace(/^\/{1,}/,"")}a(fe,"trimPathLeft");function Y(t){let e=t.length;return e>1&&t[e-1]==="/"?t.replace(/\/{1,}$/,""):t}a(Y,"trimPathRight");function Gt(t){return Y(fe(t))}a(Gt,"trimPath");function vt(t,e){return t?.endsWith("/")&&t!=="/"&&t!==`${e}/`?t.slice(0,-1):t}a(vt,"removeTrailingSlash");function de(t,e,o){return vt(t,o)===vt(e,o)}a(de,"exactPathTest");function Ke({base:t,to:e,trailingSlash:o="never",cache:r}){let n=e===".",s=e.startsWith("/"),u;if(r){u=s?e:n?t:t+"\0"+e;let c=r.get(u);if(c)return c}let i;if(n)i=t.split("/");else if(s)i=e.split("/");else{for(i=t.split("/");i.length>1&&dt(i)==="";)i.pop();let c=e.split("/");for(let f=0,d=c.length;f<d;f++){let h=c[f];h===""?f?f===d-1&&i.push(h):i=[h]:h===".."?i.length>1?i.pop():i=[""]:h==="."||i.push(h)}}i.length>1&&(dt(i)===""?o==="never"&&i.pop():o==="always"&&i.push(""));let l=qt(i.join("/"))||"/";return u&&r&&r.set(u,l),l}a(Ke,"resolvePath");function ln(t){let e=new Map(t.map(n=>[encodeURIComponent(n),n])),o=Array.from(e.keys()).map(n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(o,"g");return n=>n.replace(r,s=>e.get(s)??s)}a(ln,"compileDecodeCharMap");function Kt(t,e,o){let r=e[t];return typeof r!="string"?r:t==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(n=>cn(n,o)).join("/"):cn(r,o)}a(Kt,"encodeParam");function he({path:t,params:e,decoder:o,...r}){let n=!1,s=Object.create(null);if(!t||t==="/")return{interpolatedPath:"/",usedParams:s,isMissingParams:n};if(!t.includes("$"))return{interpolatedPath:t,usedParams:s,isMissingParams:n};if(!1){let f=t.length,d=0,h="";for(;d<f;){for(;d<f&&t.charCodeAt(d)===47;)d++;if(d>=f)break;let m=d,g=t.indexOf("/",d);g===-1&&(g=f),d=g;let p=t.substring(m,g);if(p)if(p.charCodeAt(0)===36)if(p.length===1){let v=e._splat;if(s._splat=v,s["*"]=v,!v){n=!0;continue}let S=Kt("_splat",e,o);h+="/"+S}else{let v=p.substring(1);!n&&!(v in e)&&(n=!0),s[v]=e[v];let S=Kt(v,e,o)??"undefined";h+="/"+S}else h+="/"+p}return t.endsWith("/")&&(h+="/"),{usedParams:s,interpolatedPath:h||"/",isMissingParams:n}}let u=t.length,i=0,l,c="";for(;i<u;){let f=i;l=ze(t,f,l);let d=l[5];if(i=d+1,f===d)continue;let h=l[0];if(h===0){c+="/"+t.substring(f,d);continue}if(h===2){let m=e._splat;s._splat=m,s["*"]=m;let g=t.substring(f,l[1]),p=t.substring(l[4],d);if(!m){n=!0,(g||p)&&(c+="/"+g+p);continue}let v=Kt("_splat",e,o);c+="/"+g+v+p;continue}if(h===1){let m=t.substring(l[2],l[3]);!n&&!(m in e)&&(n=!0),s[m]=e[m];let g=t.substring(f,l[1]),p=t.substring(l[4],d),v=Kt(m,e,o)??"undefined";c+="/"+g+v+p;continue}if(h===3){let m=t.substring(l[2],l[3]),g=e[m];if(g==null)continue;s[m]=g;let p=t.substring(f,l[1]),v=t.substring(l[4],d),S=Kt(m,e,o)??"";c+="/"+p+S+v;continue}}return t.endsWith("/")&&(c+="/"),{usedParams:s,interpolatedPath:c||"/",isMissingParams:n}}a(he,"interpolatePath");function cn(t,e){let o=encodeURIComponent(t);return e?.(o)??o}a(cn,"encodePathParam");function K(t){return t?.isNotFound===!0}a(K,"isNotFound");function Kr(){try{return sessionStorage}catch{return}}a(Kr,"getSafeSessionStorage");var qr="tsr-scroll-restoration-v1_3",dn=Kr();function Gr(){try{return JSON.parse(dn?.getItem("tsr-scroll-restoration-v1_3")||"{}")}catch{return{}}}a(Gr,"createScrollRestorationCache");function Jr(){try{dn?.setItem(qr,JSON.stringify(At))}catch{}}a(Jr,"persistScrollRestorationCache");var At=Gr(),un="data-scroll-restoration-id",Yr=a(t=>t.state.__TSR_key||t.href,"defaultGetScrollRestorationKey");function Xr(t){let e=t.getAttribute(un);if(e)return`[${un}="${e}"]`;let o="",r=t,n;for(;n=r.parentNode;){let s=1,u=r;for(;u=u.previousElementSibling;)s++;let i=`${r.localName}:nth-child(${s})`;o=o?`${i} > ${o}`:i,r=n}return o}a(Xr,"getScrollRestorationSelector");var pe=!1,me="window";function qe(t){try{return typeof t=="function"?t():document.querySelector(t)}catch{}}a(qe,"getElement");function fn(t){let e=new Set;for(let o of t){if(o===me)continue;let r=qe(o);r&&e.add(r)}return e}a(fn,"getScrollToTopElements");function hn(t,e){let o=e??t.options.scrollRestoration,r=t._scroll;if(o&&(r.restoring=!0),!1)return;let n=t.options.getScrollRestorationKey||Yr,s=new Set,u=a(i=>{let l=At[i]||={};for(let c of s)c===document?l[me]={scrollX,scrollY}:c.isConnected&&(l[Xr(c)]={scrollX:c.scrollLeft,scrollY:c.scrollTop})},"snapshotCurrentScrollTargets");o&&!r.restoration&&(r.restoration=!0,pe=!1,history.scrollRestoration="manual",document.addEventListener("scroll",i=>{pe||s.add(i.target)},!0),t.subscribe("onBeforeLoad",i=>{i.fromLocation&&u(n(i.fromLocation)),s.clear()}),addEventListener("pagehide",()=>{u(n(t.stores.resolvedLocation.get()??t.stores.location.get())),Jr()})),!r.reset&&(r.reset=!0,t.subscribe("onRendered",i=>{let l=t.options.scrollRestorationBehavior,c=t.options.scrollToTopSelectors,f=r.next,d=r.hash,h;if(s.clear(),r.next=!0,r.hash=!1,typeof t.options.scrollRestoration=="function"&&!t.options.scrollRestoration({location:t.latestLocation}))return;let m=n(i.toLocation),g=i.fromLocation&&n(i.fromLocation);if(r.restoring&&g&&g!==m){let p=At[g];if(p){let v=At[m];for(let S in p){if(S===me){if(f)continue}else{let y=qe(S);if(!y||f&&c&&(h??=fn(c),h.has(y)))continue}v||(v=At[m]={}),v[S]??=p[S]}}}pe=!0;try{let p=i.toLocation.hash,v=i.toLocation.state.__hashScrollIntoViewOptions??!0,S=!1;if(f){!p&&c&&(h??=fn(c));let y=p&&v&&d,w=r.restoring?At[m]:void 0;if(w)for(let R in w){let{scrollX:L,scrollY:x}=w[R];if(R===me){if(y)continue;scrollTo({top:x,left:L,behavior:l}),S=!0}else{let _=qe(R);_&&(_.scrollLeft=L,_.scrollTop=x,h?.delete(_))}}if(!p){let R={top:0,left:0,behavior:l};if(S||scrollTo(R),h)for(let L of h)L.scrollTo(R)}}!S&&p&&v&&document.getElementById(p)?.scrollIntoView(v)}finally{pe=!1}}))}a(hn,"setupScrollRestoration");function pn(t,e=String){let o=new URLSearchParams;for(let r in t){let n=t[r];n!==void 0&&o.set(r,e(n))}return o.toString()}a(pn,"encode");function Ge(t){return t?t==="false"?!1:t==="true"?!0:+t*0===0&&+t+""===t?+t:t:""}a(Ge,"toValue");function mn(t){let e=new URLSearchParams(t),o=Object.create(null);for(let[r,n]of e.entries()){let s=o[r];s==null?o[r]=Ge(n):Array.isArray(s)?s.push(Ge(n)):o[r]=[s,Ge(n)]}return o}a(mn,"decode");var Zr=/^(?:\s|["[{\d-]|fa|nu|tr)/,gn=Qr(JSON.parse),vn=ts(JSON.stringify,JSON.parse);function Qr(t){return e=>{e[0]==="?"&&(e=e.substring(1));let o=mn(e);for(let r in o){let n=o[r];if(typeof n=="string")try{o[r]=t(n)}catch{}}return o}}a(Qr,"parseSearchWith");function ts(t,e){let o=e===JSON.parse;function r(n){if(n&&typeof n=="object")try{return t(n)}catch{}else if(e&&typeof n=="string"){if(o&&!Zr.test(n))return n;try{return e(n),t(n)}catch{}}return n}return a(r,"stringifyValue"),n=>{let s=pn(n,r);return s?`?${s}`:""}}a(ts,"stringifySearchWith");var tt="__root__";function yn(t){if(t.statusCode=t.statusCode||t.code||307,!t._builtLocation&&!t.reloadDocument&&typeof t.href=="string")try{new URL(t.href),t.reloadDocument=!0}catch{}let e=new Headers(t.headers);t.href&&e.get("Location")===null&&e.set("Location",t.href);let o=new Response(null,{status:t.statusCode,headers:e});if(o.options=t,t.throw)throw o;return o}a(yn,"redirect");function Jt(t){return t instanceof Response&&!!t.options}a(Jt,"isRedirect");function _n(t){return{input:a(({url:e})=>{for(let o of t)e=ge(o,e);return e},"input"),output:a(({url:e})=>{for(let o=t.length-1;o>=0;o--)e=Je(t[o],e);return e},"output")}}a(_n,"composeRewrites");function Sn(t){let e=Gt(t.basepath),o=`/${e}`,r=t.caseSensitive?o:o.toLowerCase(),n=`${r}/`;return{input:a(({url:s})=>{let u=t.caseSensitive?s.pathname:s.pathname.toLowerCase();return u===r?s.pathname="/":u.startsWith(n)&&(s.pathname=s.pathname.slice(o.length)),s},"input"),output:a(({url:s})=>(s.pathname=Pt(["/",e,s.pathname]),s),"output")}}a(Sn,"rewriteBasepath");function ge(t,e){let o=t?.input?.({url:e});if(o){if(typeof o=="string")return new URL(o);if(o instanceof URL)return o}return e}a(ge,"executeRewriteInput");function Je(t,e){let o=t?.output?.({url:e});if(o){if(typeof o=="string")return new URL(o);if(o instanceof URL)return o}return e}a(Je,"executeRewriteOutput");function Ye(t){let e=t;return{get(){return e},set(o){e=J(o,e)}}}a(Ye,"createNonReactiveMutableStore");function Xe(t){return{get(){return t()}}}a(Xe,"createNonReactiveReadonlyStore");function Rn(t,e){let{createMutableStore:o,createReadonlyStore:r,batch:n}=e,s=new Map,u=o("idle"),i=o(t),l=o(void 0),c=o([]),f=r(()=>c.get().map(p=>s.get(p).get())),d=r(()=>({status:u.get(),isLoading:u.get()==="pending",matches:f.get(),location:i.get(),resolvedLocation:l.get()}));function h(p){let v=s.get(p);return v||(v=o(void 0),s.set(p,v)),v}a(h,"getMatchStore");let m={status:u,location:i,resolvedLocation:l,ids:c,matches:f,byRoute:s,__store:d,getMatchStore:h,setMatches:g};function g(p){let v=c.get(),S=p.map(y=>y.routeId);n(()=>{Xo(v,S)||c.set(S);for(let y of v)S.includes(y)||s.get(y).set(()=>{});for(let y of p){let w=h(y.routeId);w.get()!==y&&w.set(y)}})}return a(g,"setMatches"),m}a(Rn,"createRouterStores");var yt="__TSR_index",wn="popstate",xn="beforeunload";function Qe(t){let e=t.getLocation(),o=new Set,r=a(u=>{e=t.getLocation(),o.forEach(i=>i({location:e,action:u}))},"notify"),n=a(u=>{t.notifyOnIndexChange??!0?r(u):e=t.getLocation()},"handleIndexChange"),s=a(async({task:u,navigateOpts:i,...l})=>{if(i?.ignoreBlocker??!1){u();return}let c=t.getBlockers?.()??[],f=l.type==="PUSH"||l.type==="REPLACE";if(typeof document<"u"&&c.length&&f)for(let d of c){let h=$t(l.path,l.state);if(await d.blockerFn({currentLocation:e,nextLocation:h,action:l.type})){t.onBlocked?.();return}}u()},"tryNavigation");return{get location(){return e},get length(){return t.getLength()},subscribers:o,subscribe:a(u=>(o.add(u),()=>{o.delete(u)}),"subscribe"),push:a((u,i,l)=>{let c=e.state[yt];i=Ze(c+1,i),s({task:a(()=>{t.pushState(u,i),r({type:"PUSH"})},"task"),navigateOpts:l,type:"PUSH",path:u,state:i})},"push"),replace:a((u,i,l)=>{let c=e.state[yt];i=Ze(c,i),s({task:a(()=>{t.replaceState(u,i),r({type:"REPLACE"})},"task"),navigateOpts:l,type:"REPLACE",path:u,state:i})},"replace"),go:a((u,i)=>{s({task:a(()=>{t.go(u),n({type:"GO",index:u})},"task"),navigateOpts:i,type:"GO"})},"go"),back:a(u=>{s({task:a(()=>{t.back(u?.ignoreBlocker??!1),n({type:"BACK"})},"task"),navigateOpts:u,type:"BACK"})},"back"),forward:a(u=>{s({task:a(()=>{t.forward(u?.ignoreBlocker??!1),n({type:"FORWARD"})},"task"),navigateOpts:u,type:"FORWARD"})},"forward"),canGoBack:a(()=>e.state[yt]!==0,"canGoBack"),createHref:a(u=>t.createHref(u),"createHref"),block:a(u=>{if(!t.setBlockers)return()=>{};let i=t.getBlockers?.()??[];return t.setBlockers([...i,u]),()=>{let l=t.getBlockers?.()??[];t.setBlockers?.(l.filter(c=>c!==u))}},"block"),flush:a(()=>t.flush?.(),"flush"),destroy:a(()=>t.destroy?.(),"destroy"),notify:r}}a(Qe,"createHistory");function Ze(t,e){e||(e={});let o=eo();return{...e,key:o,__TSR_key:o,[yt]:t}}a(Ze,"assignKeyAndIndex");function to(t){let e=t?.window??(typeof document<"u"?window:void 0),o=e.history.pushState,r=e.history.replaceState,n=[],s=a(()=>n,"_getBlockers"),u=a(_=>n=_,"_setBlockers"),i=t?.createHref??(_=>_),l=t?.parseLocation??(()=>$t(`${e.location.pathname}${e.location.search}${e.location.hash}`,e.history.state));if(!e.history.state?.__TSR_key&&!e.history.state?.key){let _=eo();e.history.replaceState({[yt]:0,key:_,__TSR_key:_},"")}let c=l(),f,d=!1,h=!1,m=!1,g=!1,p=a(()=>c,"getLocation"),v,S=a(()=>{v&&(x._ignoreSubscribers=!0,(v[2]?e.history.pushState:e.history.replaceState)(v[1],"",v[0]),x._ignoreSubscribers=!1,v=void 0,f=void 0)},"flush"),y=a((_,b,P)=>{let E=i(b),C=!!v;C||(f=c),c=$t(b,P),v=[E,P,v?.[2]||_],C||queueMicrotask(()=>S())},"queueHistoryAction"),w=a(_=>{c=l(),x.notify({type:_})},"onPushPop"),R=a(async()=>{if(h){h=!1;return}let _=l(),b=_.state[yt]-c.state[yt],P=b===1,E=b===-1,C=!P&&!E||d;d=!1;let T=C?"GO":E?"BACK":"FORWARD",D=C?{type:"GO",index:b}:{type:E?"BACK":"FORWARD"};if(m)m=!1;else{let wt=s();if(typeof document<"u"&&wt.length){for(let rt of wt)if(await rt.blockerFn({currentLocation:c,nextLocation:_,action:T})){h=!0,e.history.go(1),x.notify(D);return}}}c=l(),x.notify(D)},"onPushPopEvent"),L=a(_=>{if(g){g=!1;return}let b=!1,P=s();if(typeof document<"u"&&P.length)for(let E of P){let C=E.enableBeforeUnload??!0;if(C===!0){b=!0;break}if(typeof C=="function"&&C()===!0){b=!0;break}}if(b)return _.preventDefault(),_.returnValue=""},"onBeforeUnload"),x=Qe({getLocation:p,getLength:a(()=>e.history.length,"getLength"),pushState:a((_,b)=>y(!0,_,b),"pushState"),replaceState:a((_,b)=>y(!1,_,b),"replaceState"),back:a(_=>(_&&(m=!0),g=!0,e.history.back()),"back"),forward:a(_=>{_&&(m=!0),g=!0,e.history.forward()},"forward"),go:a(_=>{d=!0,e.history.go(_)},"go"),createHref:a(_=>i(_),"createHref"),flush:S,destroy:a(()=>{e.history.pushState=o,e.history.replaceState=r,e.removeEventListener(xn,L,{capture:!0}),e.removeEventListener(wn,R)},"destroy"),onBlocked:a(()=>{f&&c!==f&&(c=f)},"onBlocked"),getBlockers:s,setBlockers:u,notifyOnIndexChange:!1});return e.addEventListener(xn,L,{capture:!0}),e.addEventListener(wn,R),e.history.pushState=function(..._){let b=o.apply(e.history,_);return x._ignoreSubscribers||w("PUSH"),b},e.history.replaceState=function(..._){let b=r.apply(e.history,_);return x._ignoreSubscribers||w("REPLACE"),b},x}a(to,"createBrowserHistory");function es(t={initialEntries:["/"]}){let e=t.initialEntries,o=t.initialIndex?Math.min(Math.max(t.initialIndex,0),e.length-1):e.length-1,r=e.map((l,c)=>Ze(c,void 0)),n=a(()=>$t(e[o],r[o]),"getLocation"),s=[];return Qe({getLocation:n,getLength:a(()=>e.length,"getLength"),pushState:a((l,c)=>{o<e.length-1&&(e.splice(o+1),r.splice(o+1)),r.push(c),e.push(l),o=Math.max(e.length-1,0)},"pushState"),replaceState:a((l,c)=>{r[o]=c,e[o]=l},"replaceState"),back:a(()=>{o=Math.max(o-1,0)},"back"),forward:a(()=>{o=Math.min(o+1,e.length-1)},"forward"),go:a(l=>{o=Math.min(Math.max(o+l,0),e.length-1)},"go"),createHref:a(l=>l,"createHref"),getBlockers:a(()=>s,"_getBlockers"),setBlockers:a(l=>s=l,"_setBlockers")})}a(es,"createMemoryHistory");function os(t){let e=t.replace(/[\x00-\x1f\x7f]/g,"");return e.startsWith("//")&&(e="/"+e.replace(/^\/+/,"")),e}a(os,"sanitizePath");function $t(t,e){let o=os(t),r=o.indexOf("#"),n=o.indexOf("?"),s=eo();return{href:o,pathname:o.substring(0,r>0?n>0?Math.min(r,n):r:n>0?n:o.length),hash:r>-1?o.substring(r):"",search:n>-1?o.slice(n,r===-1?void 0:r):"",state:e||{[yt]:0,key:s,__TSR_key:s}}}a($t,"parseHref");function eo(){return(Math.random()+1).toString(36).substring(7)}a(eo,"createRandomKey");function bn(t){return t.options.loader||t.options.beforeLoad||t.lazyFn||t.options.component?.preload||t.options.pendingComponent?.preload}a(bn,"routeNeedsLoad");function Ct(t,e){return{fromLocation:e,toLocation:t,pathChanged:e?.pathname!==t.pathname,hrefChanged:e?.href!==t.href,hashChanged:e?.hash!==t.hash}}a(Ct,"getLocationChangeInfo");function Pn({key:t,__TSR_key:e,__TSR_index:o,__hashScrollIntoViewOptions:r,...n}){return n}a(Pn,"_getUserHistoryState");function En(t,e,o,r){for(let n of e){if(r?.()===!1)return;o.some(s=>s.routeId===n.routeId)||t.routesById[n.routeId].options.onLeave?.(n)}for(let n of o){if(r?.()===!1)return;t.routesById[n.routeId].options[e.some(s=>s.routeId===n.routeId)?"onStay":"onEnter"]?.(n)}}a(En,"runRouteLifecycle");var oo=class{static{a(this,"RouterCore")}constructor(t,e){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=async o=>(o(),!1),this.update=o=>{let r=this.options,n=this.basepath??r?.basepath??"/",s=this.basepath===void 0,u=r?.rewrite;if(this.options={...r,...o},this.isServer=this.options.isServer??!1??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=ln(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=to()),this.origin=this.options.origin,this.origin||(!!1&&window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let c;if(!1){let f=globalThis.__TSR_CACHE__;this.resolvePathCache=f.resolvePathCache,c=f.processRouteTreeResult}else this.resolvePathCache=Dt(1e3),c=this.buildRouteTree(),!1;this.setRoutes(c)}if(!this.stores&&this.latestLocation){let c=this.getStoreConfig(this);this.batch=c.batch,this.stores=Rn(this.latestLocation,c),hn(this)}let i=this.options.basepath??"/",l=this.options.rewrite;if(s||n!==i||u!==l){this.basepath=i;let c=[],f=Gt(i);f&&f!=="/"&&c.push(Sn({basepath:i})),l&&c.push(l),this.rewrite=c.length===0?void 0:c.length===1?c[0]:_n(c),this.history&&this.updateLatestLocation(),this.stores&&this.stores.location.set(this.latestLocation)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let o=sn(this.routeTree,this.options.caseSensitive,(r,n)=>{r.init({originalIndex:n})});return this.options.routeMasks&&en(this.options.routeMasks,o.processedTree),o},this.subscribe=(o,r)=>{let n={eventType:o,fn:r};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=o=>{for(let r of this.subscribers)if(r.eventType===o.type)try{r.fn(o)}catch(n){console.error(n)}},this.parseLocation=(o,r)=>{let n=a(({pathname:l,search:c,hash:f,href:d,state:h})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(l)){let S=this.options.parseSearch(c),y=this.options.stringifySearch(S);return{href:l+y+f,publicHref:l+y+f,pathname:Nt(l).path,external:!1,searchStr:y,search:pt(r?.search,S),hash:Nt(f.slice(1)).path,state:st(r?.state,h)}}let m=new URL(d,this.origin),g=ge(this.rewrite,m),p=this.options.parseSearch(g.search),v=this.options.stringifySearch(p);return g.search=v,{href:g.href.replace(g.origin,""),publicHref:d,pathname:Nt(g.pathname).path,external:!!this.rewrite&&g.origin!==this.origin,searchStr:v,search:pt(r?.search,p),hash:Nt(g.hash.slice(1)).path,state:st(r?.state,h)}},"parse"),s=n(o),{__tempLocation:u,__tempKey:i}=s.state;if(u&&(!i||i===this.tempLocationKey)){let l=n(u);return l.state.key=s.state.key,l.state.__TSR_key=s.state.__TSR_key,delete l.state.__tempLocation,{...l,maskedLocation:s}}return s},this.resolvePathWithBase=(o,r)=>Ke({base:o,to:r.includes("//")?qt(r):r,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(o,r,n)=>typeof o=="string"?this.matchRoutesInternal({pathname:o,search:r},n):this.matchRoutesInternal(o,r),this.getMatchedRoutes=o=>{let r=Object.create(null),n=rn(Y(o),this.processedTree,!0);return n&&Object.assign(r,n.rawParams),[n?.branch||[this.routesById.__root__],r,n?.route]},this.buildLocation=o=>{let r=a((s={})=>{let u=s._fromLocation||this._pendingLocation||this.latestLocation,i=this.matchRoutesLightweight(u);s.from;let l=s.unsafeRelative==="path"?u.pathname:s.from??i[1],c=s.to?`${s.to}`:void 0,f=i[2],d=Object.assign(Object.create(null),i[3]),h=c?.charCodeAt(0)===47?"/":this.resolvePathWithBase(l,"."),m=c?this.resolvePathWithBase(h,c):h,g=Cn(s.params,d),p=this.routesByPath[Y(m)],v;if(p)v=this.getRouteBranch(p);else if(m.includes("$"))v=[];else{let[C,T,D]=this.getMatchedRoutes(m);v=C,this.options.notFoundRoute&&(!D||D.path!=="/"&&T["**"])&&(v=[...v,this.options.notFoundRoute])}if(v.length&&ht(g))for(let C of v){let T=C.options.params?.stringify??C.options.stringifyParams;if(T)try{Object.assign(g,T(g))}catch{}}let S=o.leaveParams?m:Nt(he({path:m,params:g,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,y=f;if(o._includeValidateSearch&&this.options.search?.strict){let C={};v.forEach(T=>{if(T.options.validateSearch)try{Object.assign(C,ve(T.options.validateSearch,{...C,...y}))}catch{}}),y=C}y=ns(y,s,v,o._includeValidateSearch),y=pt(f,y);let w=this.options.stringifySearch(y),R=s.hash===!0?u.hash:s.hash?J(s.hash,u.hash):void 0,L=R?`#${R}`:"",x=s.state===!0?u.state:s.state?J(s.state,u.state):{};x=st(u.state,x);let _=`${S}${w}${L}`,b,P,E=!1;if(this.rewrite){let C=new URL(_,this.origin),T=Je(this.rewrite,C);b=C.href.replace(C.origin,""),T.origin!==this.origin?(P=T.href,E=!0):P=T.pathname+T.search+T.hash}else b=Yo(_),P=b;return{publicHref:P,href:b,pathname:S,search:y,searchStr:w,state:x,hash:R??"",external:E,unmaskOnReload:s.unmaskOnReload}},"build"),n=a((s={},u)=>{let i=r(s),l=u?r(u):void 0;if(!l){let c=Object.create(null);if(this.options.routeMasks){let f=on(i.pathname,this.processedTree);if(f){Object.assign(c,f.rawParams);let{from:d,params:h,...m}=f.route,g=Cn(h,c);u={from:o.from,...m,params:g},l=r(u)}}}return l&&(i.maskedLocation=l),i},"buildWithMatches");return o.mask?n(o,{from:o.from,...o.mask}):n(o)},this.commitLocation=async({viewTransition:o,ignoreBlocker:r,...n})=>{let s,u=Y(this.latestLocation.href)===Y(n.href)&&Q(Pn(n.state),Pn(this.latestLocation.state)),i=this._commitPromise,l,c=new Promise(f=>{l=f});if(c.resolve=()=>{l(),i?.resolve()},this._commitPromise=c,u)this.load();else{let{maskedLocation:f,hashScrollIntoView:d,...h}=n;f&&(h={...f,state:{...f.state,__tempKey:void 0,__tempLocation:{...h,search:h.searchStr,state:{...h.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(h.unmaskOnReload??this.options.unmaskOnReload??!1)&&(h.state.__tempKey=this.tempLocationKey)),h.state.__hashScrollIntoViewOptions=d??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=o,s=n.replace?"REPLACE":"PUSH",this.history[s==="REPLACE"?"replace":"push"](h.publicHref,h.state,{ignoreBlocker:r}),this.history.subscribers.size||this.load({action:{type:s}})}return this._scroll.next=n.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:o,resetScroll:r,hashScrollIntoView:n,viewTransition:s,ignoreBlocker:u,_redirects:i,href:l,...c}={})=>{if(l){let h=this.history.location.state.__TSR_index,m=$t(l,{__TSR_index:o?h:h+1}),g=new URL(m.pathname,this.origin);c.to=ge(this.rewrite,g).pathname,c.search=this.options.parseSearch(m.search),c.hash=m.hash.slice(1)}let f=this.buildLocation({...c,_includeValidateSearch:!0});i&&(f._redirects=i),this._pendingLocation=f;let d=this.commitLocation({...f,viewTransition:s,replace:o,resetScroll:r,hashScrollIntoView:n,ignoreBlocker:u});return queueMicrotask(()=>{this._pendingLocation===f&&(this._pendingLocation=void 0)}),d},this.navigate=async({to:o,reloadDocument:r,href:n,publicHref:s,...u})=>{let i=!1;if(n)try{new URL(`${n}`),i=!0}catch{}if(i&&!r&&(r=!0),r){if(o!==void 0||!n){let c=this.buildLocation({to:o,...u});n=n??c.publicHref,s=s??c.publicHref}let l=!i&&s?s:n;if(it(l,this.protocolAllowlist))return;if(!u.ignoreBlocker){let c=this.history.getBlockers?.()??[];for(let f of c)if(f?.blockerFn&&await f.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return}u.replace?window.location.replace(l):window.location.href=l;return}return this.buildAndCommitLocation({...u,href:n,to:o,_isNavigate:!0})},this.load=async o=>{if(!1)return(void 0)(this,o);this.updateLatestLocation(),o?.action&&(this._scroll.hash=o.action.type==="PUSH"||o.action.type==="REPLACE"),await In(this,o)},this.startViewTransition=o=>{let r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&!!1&&typeof document.startViewTransition=="function"){let n;if(typeof r=="object"&&window.CSS?.supports?.("selector(:active-view-transition-type(a))")){let s=this.latestLocation,u=this.stores.resolvedLocation.get(),i=typeof r.types=="function"?r.types(Ct(s,u)):r.types;if(i===!1)return o();n={update:o,types:i}}else n=o;return document.startViewTransition(n).updateCallbackDone}return o()},this.invalidate=o=>{let r=this._committed,n=o?.filter,s=this._preloads,u=new Set([...r,...this._cache.values(),...[...s?.values()??[]].flat(),...this._tx?.[3]??[]].filter(c=>!n||n(c)).map(c=>c.id)),i=[];for(let[c,f]of s??[])f.some(d=>u.has(d.id))&&(s.delete(c),i.push(c));let l=a(c=>{if(u.has(c.id)){let f=this.routesById[c.routeId],d={...c,invalid:!0,...(o?.forcePending||c.status==="error"||c.status==="notFound")&&bn(f)?{status:"pending",error:void 0}:void 0};return c._flight=void 0,d}return c},"invalidate");this._committed=r.map(l);for(let[c,f]of this._cache)u.has(c)&&(f.invalid=!0,o?.forcePending&&(f.status="pending"));for(let c of u)this._flights?.delete(c);for(let c of i)c.abort();return this.shouldViewTransition=!1,this.load({sync:o?.sync})},this.resolveRedirect=o=>{let r=o.headers.get("Location");if(!o.options.href||o.options._builtLocation){let n=(o.options._builtLocation??this.buildLocation(o.options)).publicHref||"/";o.options.href=n,o.headers.set("Location",n)}else if(r)try{let n=new URL(r);if(this.origin&&n.origin===this.origin){let s=n.pathname+n.search+n.hash;o.options.href=s,o.headers.set("Location",s)}}catch{}if(o.options.href&&!o.options._builtLocation&&it(o.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return o.headers.get("Location")||o.headers.set("Location",o.options.href),o},this.clearCache=o=>{let r=this._cache,n=this._preloads,s=o?.filter,u=[],i=[];for(let[c,f]of r)(!s||s(f))&&(i.push(c),u.push(f));let l=[];for(let[c,f]of n??[])(!s||f.some(s))&&(l.push(c),u.push(...f));for(let c of i)r.delete(c);for(let c of l)n.delete(c);for(let c of u){let f=c._flight;c._flight=void 0,f&&!--f[2]&&(this._flights?.get(c.id)===f&&this._flights.delete(c.id),l.push(f[1]))}for(let c of l)c.abort()},this.loadRouteChunk=Lt,this.preloadRoute=o=>no(this,o),this.matchRoute=(o,r)=>{let n={...o,to:o.to?this.resolvePathWithBase(o.from||"",o.to):void 0,params:o.params||{},leaveParams:!0},s=this.buildLocation(n),u=this.stores.status.get()==="pending";if(r?.pending&&!u)return!1;let i=r?.pending??!u?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),l=nn(s.pathname,r?.caseSensitive??!1,r?.fuzzy??!1,i.pathname,this.processedTree);return!l||o.params&&!Q(l.rawParams,o.params,{partial:!0})?!1:r?.includeSearch??!0?Q(i.search,s.search,{partial:!0})?l.rawParams:!1:l.rawParams},this.getStoreConfig=e,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??vn,parseSearch:t.parseSearch??gn,protocolAllowlist:t.protocolAllowlist??We}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes({routesById:t,routesByPath:e,processedTree:o}){this.routesById=t,this.routesByPath=e,this.processedTree=o;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(t){let e=this.routeBranchCache.get(t);return e||(e=je(t),this.routeBranchCache.set(t,e)),e}matchRoutesInternal(t,e){let[o,r,n]=this.getMatchedRoutes(t.pathname),s=o,u=!1;(n?n.path!=="/"&&r["**"]:Y(t.pathname))&&(this.options.notFoundRoute?s=[...s,this.options.notFoundRoute]:u=!0);let i=u?rs(this.options.notFoundMode,s):void 0,l=new Array(s.length),c=this._committed,f=a((h,m)=>{let g=c[m];return g?.routeId===h.id?g:h===this.options.notFoundRoute?c.find(p=>p.routeId===h.id):void 0},"previousAt"),d;for(let h=0;h<s.length;h++){let m=s[h],g=l[h-1],p,v,S;{let D=g?.search??t.search,wt=g?._strictSearch??void 0;try{let rt=ve(m.options.validateSearch,{...D})??void 0;p={...D,...rt},v={...wt,...rt}}catch(rt){let re=rt;if(rt instanceof Yt||(re=new Yt(rt.message,{cause:rt})),e?.throwOnError)throw re;p=D,v={},S=re}}let y="",w="";try{y=m.options.loaderDeps?.({search:p})??"",w=y&&JSON.stringify(y)||""}catch(D){if(e?.throwOnError)throw D;S??=D}let{interpolatedPath:R,usedParams:L}=he({path:m.fullPath,params:r,decoder:this.pathParamsDecoder,server:this.isServer}),x=m.id+R+w,_=f(m,h),b=this._cache.get(x)??(_?.id===x?_:void 0);d=b?._strictParams??Object.assign(L,d);let P;if(!b)try{Ln(m,d)}catch(D){if(K(D)||Jt(D)?P=D:P=new kn(D.message,{cause:D}),e?.throwOnError)throw P}let E=_?"stay":"enter",C;if(b)C={...b,cause:E,search:_?pt(_.search,p):pt(b.search,p),_strictSearch:v,searchError:S};else{let D=bn(m)?"pending":"success";C={id:x,ssr:m.options.ssr,index:h,routeId:m.id,params:_?.params??d,_strictParams:d,pathname:R,updatedAt:Date.now(),search:_?pt(_.search,p):p,_strictSearch:v,searchError:S,status:D,isFetching:!1,error:void 0,paramsError:P,context:{},abortController:e?._controller??new AbortController,cause:E,loaderDeps:_?st(_.loaderDeps,y):y,invalid:!1,preload:!1,staticData:m.options.staticData||{},fullPath:m.fullPath}}let T=i===m.id;C._notFound&&!T&&(C.error=void 0),C._notFound=T,l[h]=C}for(let h=0;h<l.length;h++){let m=l[h];m.params=m.cause==="stay"?pt(m.params,d):d,e?._controller&&(m.context={})}return l}matchRoutesLightweight(t){let e=dt(this.stores.ids.get()),o=e?this.stores.byRoute.get(e).get():void 0,r=o?.id,n=this.lightweightCache.get(t);if(n&&n[0]===r)return n[1];let[s,u]=this.getMatchedRoutes(t.pathname),i=dt(s),l={...t.search};for(let h of s)try{Object.assign(l,ve(h.options.validateSearch,l))}catch{}let c=o&&o.routeId===i.id&&o.pathname===t.pathname,f;if(c)f=o.params;else{let h=Object.assign(Object.create(null),u);for(let m of s)try{Ln(m,h)}catch{}f=h}let d=[s,i.fullPath,l,f];return this.lightweightCache.set(t,[r,d]),d}},Yt=class extends Error{static{a(this,"SearchParamError")}},kn=class extends Error{static{a(this,"PathParamError")}};function ve(t,e){if(t==null)return{};if("~standard"in t){let o=t["~standard"].validate(e);if(o instanceof Promise)throw new Yt("Async validation not supported");if(o.issues)throw new Yt(JSON.stringify(o.issues,void 0,2),{cause:o});return o.value}return"parse"in t?t.parse(e):typeof t=="function"?t(e):{}}a(ve,"validateSearch");function ns(t,e,o,r){let n=[];for(let u of o){let i=u.options;if("search"in i)i.search?.middlewares&&n.push(...i.search.middlewares);else if(i.preSearchFilters||i.postSearchFilters){let c=a(({search:f,next:d})=>{let h=d(i.preSearchFilters?i.preSearchFilters.reduce((m,g)=>g(m),f):f);return i.postSearchFilters?i.postSearchFilters.reduce((m,g)=>g(m),h):h},"legacyMiddleware");n.push(c)}let l=i.validateSearch;if(l){let c=a(({search:f,next:d,meta:h})=>{let m=d(f);if(r)try{let g=ve(l,m);if(h&&g)for(let p in g)p in m||(h.defaulted||=new Map).set(p,g[p]);return{...m,...g}}catch{}return m},"validate");n.push(c)}}let s=a((u,i,l)=>{if(u>=n.length){if(!e.search)return{};if(e.search===!0)return i;let f=J(e.search,i);return l&&(l.explicit=f),f}let c=a((f,d)=>{if(d){let h=l||{};return{search:s(u+1,f,h),meta:h}}return s(u+1,f,l)},"next");return n[u]({search:i,next:c,meta:l})},"applyNext");return s(0,t)}a(ns,"applySearchMiddleware");function rs(t,e){if(t!=="root"){let o;for(let r=e.length-1;r>=0;r--){let n=e[r];if(n.options.notFoundComponent)return n.id;o||=n.children&&n.id}if(o)return o}return tt}a(rs,"findGlobalNotFoundRouteId");function Cn(t,e){return t===!1||t===null?Object.create(null):(t??!0)===!0?e:Object.assign(e,J(t,e))}a(Cn,"resolveNextParams");function Ln(t,e){let o=t.options.params?.parse??t.options.parseParams;o&&Object.assign(e,o(e))}a(Ln,"extractStrictParams");function ro(t,e){return t.options[e]?.preload?.()}a(ro,"preloadComponent");function ss(t,e){let o=ro(t,"component"),r=ro(t,"pendingComponent"),n=e&&r?r.then(e):r;return e&&!r&&e(),o&&n?Promise.all([o,n]).then(()=>{}):o??n}a(ss,"loadComponents");function Lt(t,e,o){let r=a(()=>e===!1?void 0:e?ro(t,e):ss(t,o),"afterLazy"),n=t._lazy;if(n)return n===!0?r():n.then(r);if(!t.lazyFn)return r();let s=t.lazyFn().then(u=>{{let{id:i,...l}=u.options;Object.assign(t.options,l),t._lazy=!0}},u=>{throw t._lazy=void 0,u});return t._lazy=s,s.then(r)}a(Lt,"loadRouteChunk");function Fn(t){let e=t.findIndex(o=>o.status!=="success"||o._notFound)+1;return e&&e<t.length?t.slice(0,e):t}a(Fn,"_getRenderedMatches");var at=0,_t=1,_e=2,et=3,kt=4;function Zt(t){return typeof t[0]=="number"}a(Zt,"isControl");function St(t,e){return e.aborted?Promise.race([Promise.reject(e),t]):new Promise((o,r)=>{let n=a(()=>r(e),"abort");e.addEventListener("abort",n,{once:!0}),Promise.resolve(t).then(o,r).finally(()=>e.removeEventListener("abort",n))})}a(St,"waitFor");function It(t,e){return t.routesById[e.routeId]}a(It,"getRoute");function Qt(t,e,o){return Jt(t)?[et,t]:K(t)?(t.routeId||=o,[_e,t]):(e&&typeof t?.then=="function"&&(t=new Error("A Promise was thrown",{cause:t})),e?[_t,t]:[at,t])}a(Qt,"normalize");function An(t,e){let o=Qt(e,!0,t.id);if(o[0]!==_t)return o;try{t.options.onError?.(o[1])}catch(r){o=Qt(r,!0,t.id)}return o}a(An,"normalizeError");function Xt(t,e,o){return o[0].signal.aborted||!o[2]()?(o[0].abort(),[kt]):An(t,e)}a(Xt,"normalizeLaneError");function $n(t,e){return o=>t.navigate({...o,_fromLocation:e})}a($n,"navigateFrom");async function is(t,e,o,r,n,s){let[u,i]=e,l=o[0].signal,c=!!o[4];for(let f=o[7]??0;f<r;f++){let d=i[f],h=It(t,d);d.abortController=o[0];let m=i[f-1]?.context??t.options.context??{},g={params:d.params,location:u,navigate:$n(t,u),buildLocation:t.buildLocation,cause:c?"preload":d.cause,abortController:o[0],preload:c,matches:i,routeId:h.id},p=m;try{let R=d._ctx;!R&&h.options.context&&(R=d._ctx=h.options.context({...g,deps:d.loaderDeps,context:m})||{}),p={...m,...R},d.context=p}catch(R){return ut(t,d),[f,Xt(h,R,o)]}if(l.aborted||!o[2]())return o[0].abort(),[f,[kt]];let v=d.paramsError??d.searchError;if(v!==void 0)return ut(t,d),[f,Xt(h,v,o)];let S=h.options.beforeLoad;if(!S)continue;let y={...g,search:d.search,context:p,...t.options.additionalContext},w=d.status;w==="success"&&f>=s&&(d.status="pending"),o[8]?.();try{te(t,d,"beforeLoad",o[0]);let R=await St(S(y),l);if(!o[2]())return o[0].abort(),[f,[kt]];let L=Qt(R,!1,h.id);if(L[0]!==at)return ut(t,d),[f,L];d.context={...p,...R}}catch(R){return ut(t,d),[f,Xt(h,R,o)]}finally{w==="success"&&d.status==="pending"&&(d.status="success"),te(t,d,!1,o[0])}}n()}a(is,"contextualize");function ao(t,e,o){if(!(!o||--o[2])){if(t._flights?.get(e.id)===o){let r=t._tx;if(r&&!r[0].signal.aborted&&!r[3].includes(e)&&r[3].some(n=>n.id===e.id)&&r[3].some(n=>n.isFetching==="beforeLoad"))return;t._flights.delete(e.id)}return o[1]}}a(ao,"releaseOwnedFlight");function ut(t,e){let o=e._flight;e._flight=void 0,ao(t,e,o)?.abort()}a(ut,"releaseFlight");function q(t,e,o,r){let n=[];for(let s of e)if(!o?.includes(s)){let u=s._flight;if(s._flight=void 0,r&&u?.[2]===1&&t._flights?.get(s.id)===u&&o?.some(i=>i.id===s.id))u[2]=0;else{let i=ao(t,s,u);i&&n.push(i)}}for(let s of n)s.abort()}a(q,"transferMatchResources");function co(t){for(let e of t){let o=e._flight;o&&o[2]++}}a(co,"acquireMatchResources");function te(t,e,o,r){if(e.isFetching=o,r&&t._tx?.[0]!==r)return;let n=t.stores.byRoute.get(e.routeId),s=n?.get();s?.id===e.id&&n.set({...s,isFetching:o})}a(te,"setFetching");function Bn(t,e,o,r,n,s,u){let i=e[0];return{params:o.params,location:i,navigate:$n(t,i),cause:u?"preload":o.cause,abortController:n,preload:u,deps:o.loaderDeps,parentMatchPromise:s,context:o.context,route:r,...t.options.additionalContext}}a(Bn,"getLoaderContext");async function Tn(t,e,o,r,n,s,u,i){let l=i.signal;if(l.aborted)return[kt];if(!n)return[at,void 0];let c=o._flight;te(t,o,"loader",i);try{if(!c){let f=new AbortController;c=[Promise.resolve().then(()=>n(Bn(t,e,o,r,f,s,u))).then(d=>Qt(d,!1,r.id),d=>Qt(d,!0,r.id)).then(d=>(d[0]!==at&&t._flights?.get(o.id)===c&&(t._flights.delete(o.id),c[2]||f.abort()),d[0]===_t&&c[2]?An(r,d[1]):d)),f,1],(t._flights??=new Map).set(o.id,c)}return o._flight=c,o.abortController=c[1],await St(c[0],l)}catch(f){if(f!==l)throw f;return ut(t,o),[kt]}finally{te(t,o,!1,i)}}a(Tn,"loadResource");function Mn(t,e,o){e[0]===at?(t.loaderData=e[1],t.error=void 0,t.status="success",t.invalid=!1,t.updatedAt=Date.now(),t.preload=o):e[0]!==et&&(t.status="success",t.error=void 0,t.invalid=!0)}a(Mn,"settleInto");function as(t,e,o){let r=t._cache.get(e.id);if(r!==o||t._committed.some(s=>s.id===e.id&&s._flight===e._flight))return;let n={...e,_notFound:void 0,context:{}};n._flight&&n._flight[2]++,t._cache.set(e.id,n),r&&ut(t,r)}a(as,"cacheLoaderMatch");function On(t,e){return e[0]===_t||e[0]===_e?{...t,status:e[0]===_t?"error":"notFound",error:e[1],_flight:void 0}:t}a(On,"getParentSnapshot");function cs(t,e,o,r,n,s,u){let i=e[1][o],l=It(t,i),c=!!s[4],f=c?t._cache.get(i.id):void 0,d,h=!1,m;try{if(i.status==="success"&&(d=l.options.shouldReload,typeof d=="function"&&(d=d(Bn(t,e,i,l,s[0],n,c))),s[2]()||(s[0].abort(),m=[kt])),!m)if(i.status!=="success")h=!0;else{let P=s[4]||i.preload?l.options.preloadStaleTime??t.options.defaultPreloadStaleTime??3e4:l.options.staleTime??t.options.defaultStaleTime??0;h=!!(i.invalid||d||d===void 0&&Date.now()-i.updatedAt>=P&&(s[6]||i.cause==="enter"||s[3].some(E=>E.routeId===i.routeId&&E.id!==i.id)))}}catch(P){i.invalid=!0,ut(t,i),m=Xt(l,P,s)}let g=l.options.loader,p=typeof g=="function"?g:g?.handler,v=(!c||l.options.preload!==!1)&&g?t._flights?.get(i.id):void 0;v===i._flight||m?v=void 0:v&&!h&&!c&&d===void 0?h=!0:h||(v=void 0);let S=!!(g&&h&&i.status==="success"&&!c&&!s[5]&&((typeof g=="function"?void 0:g?.staleReloadMode)??t.options.defaultStaleReloadMode)!=="blocking"),y=h&&(!c||l.options.preload!==!1),w=y&&!S&&(i.status!=="success"||!!g),R=l.lazyFn&&l._lazy!==!0?s[8]:void 0;if(y&&!g&&(i.invalid=!1,i.updatedAt=Date.now()),v&&v[2]++,w){let P=i._flight;i._flight=v,ao(t,i,P)?.abort(),i.status==="success"&&o>=u&&(i.status="pending"),s[8]?.()}y||(i.isFetching=!1);let L=(m?Promise.resolve(m):w?Tn(t,e,i,l,p,n,c,s[0]):Promise.resolve([at,i.loaderData])).then(P=>(w&&(Mn(i,P,c),P[0]===at&&(c&&g&&!s[0].signal.aborted&&as(t,i,f),i.status="pending")),P)),x=St(Promise.resolve().then(()=>Lt(l,void 0,R)),s[0].signal).then(()=>{},P=>[o,Xt(l,P,s)]).then(P=>L.then(E=>(w&&!P&&E[0]===at&&i.status==="pending"&&s[2]()&&(i.status="success",s[8]?.()),P)));if(r.push([o,L,x]),!S)return L.then(P=>On(i,P));let _={...i,status:"pending",preload:!1,_flight:v};i.invalid=!1,i.isFetching="loader";let b=Tn(t,e,_,l,p,n,!1,s[0]).then(P=>(i.isFetching=!1,Mn(_,P,!1),P));return(e[2]??=[]).push([o,b,x,_]),b.then(P=>On(_,P))}a(cs,"createLoaderTask");async function so(t,e,o,r,n=0){let s=o?.[1][1],u=s?.routeId?e.findIndex(i=>i.routeId===s.routeId):o?.[0]??e.length-1;u<0&&(u=0);for(let i=u;i>=0;i--){let l=It(t,e[i]),c=Lt(l,!1);if(c)try{await St(c,r)}catch(f){if(f===r)throw f}if(l.options.notFoundComponent)return i}return s?.routeId?u:n}a(so,"getNotFoundBoundary");function Bt(t,e){e[2]&&(q(t,e[2].map(o=>o[3])),e[2]=void 0)}a(Bt,"discardBackground");async function Nn(t,e,o,r){let n;try{await Promise.all(t.map(s=>s[1].then(async u=>{let i=s[0];if(!(r&&i>=await r)){if(u[0]>=et)throw[i,u];!n&&u[0]!==at&&(n=[i,u],await Promise.all((o??[]).map(l=>{if(!(l[0]<=i))return l[1].then(c=>{if(c[0]===et)throw[l[0],c]})})))}})))}catch(s){return s}return e??n}a(Nn,"settleTasks");async function Un(t,e,o,r,n,s,u){let i=e[1],l=await s,c=!1,f=i.findIndex(g=>g._notFound),d=a(g=>g[1][0]===_e?so(t,i,g,r.signal):g[0],"boundaryOf"),h=f<0?i.length:f;if((l?.[1][0]??0)>=et)h=0;else if(l){h=l[2]??=await d(l);for(let g of o){if(g[0]>=h)break;let p=await g[1];if(p[0]!==at&&p[0]<et&&!("loaderData"in i[g[0]])){l=[g[0],p],h=l[2]=await d(l);break}}}for(let g of o){if(g[0]>=h)break;let p=await g[2];if(p){l=p;break}}if((l?.[1][0]??0)>=et){let g=l[1];if(g[0]!==et||g[1].options.reloadDocument||n<20)return Bt(t,e),g;c=!0,l=[0,[_t,new Error("Too many redirects")]]}let m=l?l[2]??await d(l):f;if(m>=0){let g=l?.[1],p=g?.[0],v=i[m],S=g?.[1],y=a(()=>{g&&(v._notFound=void 0,p===_t?v.status="error":(S.routeId=v.routeId,v.routeId===t.routeTree.id?(v.status="success",v._notFound=!0):v.status="notFound"),v.error=S,v.isFetching=!1)},"install");y();let w=It(t,v);try{await St(g?Promise.resolve().then(()=>Lt(w,p===_t?"errorComponent":"notFoundComponent")):Promise.all([Lt(w),Lt(w,"notFoundComponent")]),r.signal)}catch(R){if(R===r.signal)return Bt(t,e),[kt]}g?c&&(r.abort(),await Promise.all([...o.map(R=>R[1]),...o.map(R=>R[2]),...(e[2]??[]).map(R=>R[1])]),Bt(t,e),q(t,i),y()):(v.status="success",u?.())}return e}a(Un,"reduceLane");async function Vn(t,e,o,r=0,n=e[1].length){let s=e[1];for(let u=r;u<n;u++){let i=s[u],l=It(t,i).options;if(l.head||l.scripts)try{let c={ssr:t.options.ssr,matches:s,match:i,params:i.params,loaderData:i.loaderData},[f,d]=await St(Promise.all([l.head?.(c),l.scripts?.(c)]),o);i.meta=f?.meta,i.links=f?.links,i.headScripts=f?.scripts,i.styles=f?.styles,i.scripts=d}catch(c){if(c===o)break;console.error(c)}if(i.status!=="success"||i._notFound)break}return e}a(Vn,"projectLane");async function Wn(t,e,o,r){let n=[e,o],s=t.stores.matches.get(),u=o.findIndex(p=>p._notFound);if(t.options.notFoundMode!=="root"&&u>=0){let p=await so(t,n[1],void 0,r[0].signal,u);p!==u&&(o[u]._notFound=void 0,o[p]._notFound=!0),u=p}let i=u<0?o.length:u+1,l=0;for(;l<i&&l!==u;){let p=o[l],v=r[3][l],S=s[l];if(v?.id!==p.id||v.status!=="success"||v._notFound||p.preload||S?.id!==p.id||S.status!=="success"||S._notFound)break;l++}let c=[],f=r[7]??0,d=f?Promise.resolve(n[1][f-1]):void 0,h=a(()=>{for(let p=f;p<i&&!r[0].signal.aborted;p++)d=cs(t,n,p,c,d,r,l)},"planSuccessfulLane"),m=await is(t,n,r,i,h,l);if(m&&(r[5]=!0,i=m[0],m[1][0]===_e?(m[2]=await so(t,n[1],m,r[0].signal),i=Math.min(i,m[2]+1)):m[1][0]>=et&&(i=0),h()),r[2]()&&!r[4]){let p=[];for(let[v,S]of t._flights??[])S[2]||(t._flights.delete(v),p.push(S[1]));for(let v of p)v.abort()}let g;try{let p=Un(t,n,c,r[0],r[1],Nn(c,m,n[2]),r[8]);n[2]?.length&&(n[3]=Nn(n[2],void 0,void 0,p.then(v=>Zt(v)?0:Fn(v[1]).length,()=>0))),g=await p}catch(p){throw Bt(t,n),p}return Zt(g)?g:Vn(t,g,r[0].signal,r[7]===g[1].length?r[7]:0)}a(Wn,"executeClientLane");function io(t,e){if(t._tx!==e)return;let o=t._pending,r=!1,n=o?.[0][3][o[1]]?.id;o?.[0]!==e&&(o&&e[3][o[1]]?.id===n?(o[0]=e,r=!0):(clearTimeout(o?.[3]),t._pending=o=void 0));let s=e[3],u=t.stores.matches.get(),i=-1,l,c,f,d=!1;for(let p=0;p<s.length;p++){let v=s[p],S=v.status==="success";if(d=u[p]?.id===v.id&&u[p]?.status==="pending",S&&!d)continue;let y=It(t,v);if(l=S&&d||v.invalid?0:y.options.pendingMs??t.options.defaultPendingMs,f=y.options.pendingComponent??t.options.defaultPendingComponent,!f||typeof l!="number"||l===1/0)return;i=p,c=y.options.pendingMinMs??t.options.defaultPendingMinMs??0;break}if(i<0)return;let h=s[i].id;if((!o||o[1]!==i||n!==h)&&(clearTimeout(o?.[3]),t._pending=o=[e,i,d?Date.now()+c:e[4]+l,void 0,d?Promise.resolve(!0):void 0,f]),o[4]&&!r&&o[5]===f)return;if(o[5]=f,!o[4]){clearTimeout(o[3]);let p=o[2]-Date.now();if(p>0){o[3]=setTimeout(()=>io(t,e),p);return}o[2]=0}let m=s.map(p=>({...p,_flight:void 0}));m[i].status="pending";let g=t.startTransition(()=>t.stores.setMatches(m),m).then(p=>(p&&t._pending===o&&o[4]===g&&!o[2]&&(o[2]=Date.now()+c),p));o[4]=g}a(io,"offerPending");function ye(t,e){let o=t._pending;o?.[0]===e&&(clearTimeout(o[3]),t._pending=void 0)}a(ye,"finishPending");function zn(t,e){t._committed=e,t.stores.setMatches(e)}a(zn,"publishMatches");function Dn(t,e){q(t,e[1]),Bt(t,e)}a(Dn,"discardLane");function ls(t,e,o,r){let n=t._committed,s=t._cache;for(let c of o)c.preload=!1,r&&(c._assetEnd=void 0);let u=Fn(o).length,i=new Map,l=Date.now();for(let c of[...n,...s.values()]){if(c.status!=="success"||o.some((d,h)=>d.id===c.id&&(h<u||d.status==="success")))continue;let f=It(t,c);!f.options.loader||l-c.updatedAt>=(c.preload?f.options.preloadGcTime??t.options.defaultPreloadGcTime??3e5:f.options.gcTime??t.options.defaultGcTime??3e5)||i.set(c.id,s.get(c.id)===c?c:{...c,_flight:void 0,isFetching:!1,context:{}})}e[3]=[],t._cache=i,zn(t,o),q(t,[...s.values(),...n],[...o,...i.values()]),En(t,n,o,()=>t._tx===e)}a(ls,"commitMatches");async function Et(t,e){let o=t._tx;for(;o&&o!==e;){if(await o[5],t._tx===o)return;o=t._tx}}a(Et,"awaitCurrent");async function Hn(t,e,o){await t.navigate({...o.options,replace:!0,ignoreBlocker:!0,_redirects:e[1]+1})}a(Hn,"followRedirect");function jn(t,e){ye(t,e),e[0].abort(),q(t,e[3]),e[3]=[],t._tx===e&&(t.batch(()=>{t.stores.status.set("idle"),t.stores.setMatches(t._committed)}),t._tx===e&&(t._commitPromise?.resolve(),t._commitPromise=void 0))}a(jn,"restoreCommitted");async function us(t,e,o,r,n){let s=o.map(c=>({...c}));co(s);for(let c of r)ut(t,s[c[0]]),s[c[0]]=c[3];let u=[e[2],s],i;try{i=await Un(t,u,r,e[0],e[1],n)}catch(c){throw q(t,s),c}if(Zt(i)){q(t,s),i[0]===et&&t._tx===e&&t._committed===o&&await Hn(t,e,i[1]);return}let l=await Vn(t,i,e[0].signal);if(t._tx!==e||t._committed!==o){q(t,l[1]);return}for(let c of l[1]){let f=t._cache.get(c.id);f?._flight&&f._flight===c._flight&&(t._cache.delete(c.id),ut(t,f))}zn(t,l[1]),q(t,o,l[1])}a(us,"runBackground");async function fs(t,e,o,r,n,s){let u=[e[0],e[1],()=>t._tx===e&&!!e[3].length,t._committed,void 0,n,o,s,r],i=await Wn(t,e[2],e[3],u);if(Zt(i)){i[0]===et&&t._tx===e?(ye(t,e),q(t,e[3]),e[3]=[],t._tx===e&&await Hn(t,e,i[1])):jn(t,e);return}let l=t._pending;if(l?.[0]===e&&(clearTimeout(l[3]),l[4])){let h=e[0].signal,m=!1;try{m=await St(l[4],h)}catch(g){if(g!==h)throw g}if(m&&t._pending===l&&l[0]===e){let g=l[2]-Date.now();if(g>0){try{await St(new Promise(p=>{l[3]=setTimeout(p,g)}),h)}catch{}clearTimeout(l[3])}}}if(t._tx!==e){ye(t,e),Dn(t,i);return}let c=e[2],f=Ct(c,t.stores.resolvedLocation.get()),d=i[2];await t.startViewTransition(async()=>{if(t._tx!==e){Dn(t,i);return}let h=a(()=>{ye(t,e),ls(t,e,i[1],s),t._tx===e&&(t.emit({type:"onLoad",...f}),t._tx===e&&t.emit({type:"onBeforeRouteMount",...f}))},"commit"),m=await t.startTransition(h,i[1]);if(t._tx!==e){Bt(t,i);return}d?.length&&us(t,e,i[1],d,i[3]).catch(console.error),t.batch(()=>{t.stores.resolvedLocation.set(c),t.stores.status.set("idle"),t._tx===e&&t.emit({type:"onResolved",...f}),m&&t._tx===e&&t.emit({type:"onRendered",...f})}),t._tx===e&&(t._commitPromise?.resolve(),t._commitPromise=void 0)})}a(fs,"runClientTransaction");async function In(t,e){let o=!1,r=o?t.stores.matches.get():void 0,n=t._tx,s=t.stores.resolvedLocation.get(),u=s??t.stores.location.get(),i=t.latestLocation,l=t._pendingLocation,c=l?.href===i.href?l._redirects??0:0,f=t._handoff,d=o?void 0:f?.[0](),h=new AbortController,m=t._preflight;if(t._preflight=h,!o&&!d&&f?.[1](),m?.abort(),h.signal.aborted){await Et(t,n);return}let g=Ct(i,s);if(t.emit({type:"onBeforeNavigate",...g}),h.signal.aborted||t.emit({type:"onBeforeLoad",...g}),h.signal.aborted){await Et(t,n);return}let p=u.href===i.href,v,S=h;try{v=t.matchRoutes(i,{_controller:h}),co(v)}catch(R){if(h.abort(),!Jt(R)){await Et(t),t._commitPromise?.resolve(),t._commitPromise=void 0;return}await t.navigate({...R.options,replace:!0,ignoreBlocker:!0}),await Et(t,n);return}let y=d?f[1](v):void 0;if(y?S=d:d?.abort(),h.signal.aborted){q(t,v),await Et(t,n);return}t._preflight=void 0;let w=[S,c,i,v,Date.now(),Promise.resolve().then(()=>fs(t,w,p,()=>io(t,w),e?.sync,y)).catch(()=>{t._tx===w&&jn(t,w)})];if(t._tx=w,n){for(let R of t.stores.matches.get()){if(t._tx!==w)break;R.isFetching&&te(t,R,!1)}n[0].abort(),q(t,n[3],w[3],!0)}if(t._tx!==w){q(t,w[3]),w[3]=[],await Et(t,w);return}t.batch(()=>{t.stores.status.set("pending"),t.stores.location.set(i)}),!s&&!v.some(R=>R._notFound)&&io(t,w);try{await w[5]}finally{await Et(t,w)}}a(In,"loadClientRoute");async function no(t,e,o=0){if(o>20)return;let r=e._builtLocation??t.buildLocation(e),n=t._committed,s=new AbortController,u;try{u=t.matchRoutes(r,{_controller:s}),co(u)}catch(l){s.abort(),K(l)||console.error(l);return}(t._preloads??=new Map).set(s,u);let i;try{let l;try{l=await Wn(t,r,u,[s,o,()=>!0,n,!0])}finally{i=t._preloads.delete(s),q(t,u),s.abort()}if(!Zt(l))return l[1];if(i&&l[0]===et&&!l[1].options.reloadDocument)return no(t,{...l[1].options,_fromLocation:r},o+1)}catch(l){K(l)||console.error(l)}}a(no,"preloadClientRoute");var lo="Error preloading route! \u261D\uFE0F";var Se=class{static{a(this,"BaseRoute")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(t){if(this.init=e=>{this.originalIndex=e.originalIndex;let o=this.options,r=!o?.path&&!o?.id;this.parentRoute=this.options.getParentRoute?.(),r?this._path=tt:this.parentRoute||mt();let n=r?tt:o?.path;n&&n!=="/"&&(n=fe(n));let s=o?.id||n,u=r?tt:Pt([this.parentRoute.id==="__root__"?"":this.parentRoute.id,s]);n==="__root__"&&(n="/"),u!=="__root__"&&(u=Pt(["/",u]));let i=u==="__root__"?"/":Pt([this.parentRoute.fullPath,n]);this._path=n,this._id=u,this._fullPath=i,this._to=Y(i)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e=="object"&&e!==null&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>yn({from:this.fullPath,...e}),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}};var uo=class extends Se{static{a(this,"BaseRootRoute")}constructor(t){super(t)}};var Pe=k(B(),1);var O=(t=>(t[t.None=0]="None",t[t.Mutable=1]="Mutable",t[t.Watching=2]="Watching",t[t.RecursedCheck=4]="RecursedCheck",t[t.Recursed=8]="Recursed",t[t.Dirty=16]="Dirty",t[t.Pending=32]="Pending",t))(O||{});function Kn({update:t,notify:e,unwatched:o}){return{link:r,unlink:n,propagate:s,checkDirty:u,shallowPropagate:i};function r(c,f,d){let h=f.depsTail;if(h!==void 0&&h.dep===c)return;let m=h!==void 0?h.nextDep:f.deps;if(m!==void 0&&m.dep===c){m.version=d,f.depsTail=m;return}let g=c.subsTail;if(g!==void 0&&g.version===d&&g.sub===f)return;let p=f.depsTail=c.subsTail={version:d,dep:c,sub:f,prevDep:h,nextDep:m,prevSub:g,nextSub:void 0};m!==void 0&&(m.prevDep=p),h!==void 0?h.nextDep=p:f.deps=p,g!==void 0?g.nextSub=p:c.subs=p}function n(c,f=c.sub){let d=c.dep,h=c.prevDep,m=c.nextDep,g=c.nextSub,p=c.prevSub;return m!==void 0?m.prevDep=h:f.depsTail=h,h!==void 0?h.nextDep=m:f.deps=m,g!==void 0?g.prevSub=p:d.subsTail=p,p!==void 0?p.nextSub=g:(d.subs=g)===void 0&&o(d),m}function s(c){let f=c.nextSub,d;t:do{let h=c.sub,m=h.flags;if(m&60?m&12?m&4?!(m&48)&&l(c,h)?(h.flags=m|40,m&=1):m=0:h.flags=m&-9|32:m=0:h.flags=m|32,m&2&&e(h),m&1){let g=h.subs;if(g!==void 0){let p=(c=g).nextSub;p!==void 0&&(d={value:f,prev:d},f=p);continue}}if((c=f)!==void 0){f=c.nextSub;continue}for(;d!==void 0;)if(c=d.value,d=d.prev,c!==void 0){f=c.nextSub;continue t}break}while(!0)}function u(c,f){let d,h=0,m=!1;t:do{let g=c.dep,p=g.flags;if(f.flags&16)m=!0;else if((p&17)===17){if(t(g)){let v=g.subs;v.nextSub!==void 0&&i(v),m=!0}}else if((p&33)===33){(c.nextSub!==void 0||c.prevSub!==void 0)&&(d={value:c,prev:d}),c=g.deps,f=g,++h;continue}if(!m){let v=c.nextDep;if(v!==void 0){c=v;continue}}for(;h--;){let v=f.subs,S=v.nextSub!==void 0;if(S?(c=d.value,d=d.prev):c=v,m){if(t(f)){S&&i(v),f=c.sub;continue}m=!1}else f.flags&=-33;f=c.sub;let y=c.nextDep;if(y!==void 0){c=y;continue t}}return m}while(!0)}function i(c){do{let f=c.sub,d=f.flags;(d&48)===32&&(f.flags=d|16,(d&6)===2&&e(f))}while((c=c.nextSub)!==void 0)}function l(c,f){let d=f.depsTail;for(;d!==void 0;){if(d===c)return!0;d=d.prevDep}return!1}}a(Kn,"createReactiveSystem");function Jn(t,e,o){let r=typeof t=="object",n=r?t:void 0;return{next:(r?t.next:t)?.bind(n),error:(r?t.error:e)?.bind(n),complete:(r?t.complete:o)?.bind(n)}}a(Jn,"toObserver");var fo=[],we=0,{link:qn,unlink:ps,propagate:ms,checkDirty:Yn,shallowPropagate:Gn}=Kn({update(t){return t._update()},notify(t){fo[ho++]=t,t.flags&=~O.Watching},unwatched(t){t.depsTail!==void 0&&(t.depsTail=void 0,t.flags=O.Mutable|O.Dirty,xe(t))}}),Re=0,ho=0,ct,po=0;function mo(t){try{++po,t()}finally{--po||go()}}a(mo,"batch");function xe(t){let e=t.depsTail,o=e!==void 0?e.nextDep:t.deps;for(;o!==void 0;)o=ps(o,t)}a(xe,"purgeDeps");function go(){if(!(po>0)){for(;Re<ho;){let t=fo[Re];fo[Re++]=void 0,t.notify()}Re=0,ho=0}}a(go,"flush");function be(t,e){let o=typeof t=="function",r=t,n={_snapshot:o?void 0:t,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:o?O.None:O.Mutable,get(){return ct!==void 0&&qn(n,ct,we),n._snapshot},subscribe(s){let u=Jn(s),i={current:!1},l=gs(()=>{n.get(),i.current?u.next?.(n._snapshot):i.current=!0});return{unsubscribe:a(()=>{l.stop()},"unsubscribe")}},_update(s){let u=ct,i=e?.compare??Object.is;if(o)ct=n,++we,n.depsTail=void 0;else if(s===void 0)return!1;o&&(n.flags=O.Mutable|O.RecursedCheck);try{let l=n._snapshot,c=typeof s=="function"?s(l):s===void 0&&o?r(l):s;return l===void 0||!i(l,c)?(n._snapshot=c,!0):!1}finally{ct=u,o&&(n.flags&=~O.RecursedCheck),xe(n)}}};return o?(n.flags=O.Mutable|O.Dirty,n.get=function(){let s=n.flags;if(s&O.Dirty||s&O.Pending&&Yn(n.deps,n)){if(n._update()){let u=n.subs;u!==void 0&&Gn(u)}}else s&O.Pending&&(n.flags=s&~O.Pending);return ct!==void 0&&qn(n,ct,we),n._snapshot}):n.set=function(s){if(n._update(s)){let u=n.subs;u!==void 0&&(ms(u),Gn(u),go())}},n}a(be,"createAtom");function gs(t){let e=a(()=>{let r=ct;ct=o,++we,o.depsTail=void 0,o.flags=O.Watching|O.RecursedCheck;try{return t()}finally{ct=r,o.flags&=~O.RecursedCheck,xe(o)}},"run"),o={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:O.Watching|O.RecursedCheck,notify(){let r=this.flags;r&O.Dirty||r&O.Pending&&Yn(this.deps,this)?e():this.flags=O.Watching},stop(){this.flags=O.None,this.depsTail=void 0,xe(this)}};return e(),o}a(gs,"effect");var vo=k(B(),1),Xn=k(Nr(),1);function vs(t,e){return t===e}a(vs,"defaultCompare");function W(t,e,o=vs){let r=(0,vo.useCallback)(u=>{if(!t)return()=>{};let{unsubscribe:i}=t.subscribe(u);return i},[t]),n=(0,vo.useCallback)(()=>t?.get(),[t]);return(0,Xn.useSyncExternalStoreWithSelector)(r,n,n,e,o)}a(W,"useStore");var Zn={};function yo(t,e){let o=Pe.useRef();return r=>{let n=t?.select?t.select(r):r;return t?.structuralSharing??e.options.defaultStructuralSharing?o.current=st(o.current,n):n}}a(yo,"useStructuralSharing");function X(t){let e=N(),o=Pe.useContext(t.from?jo:bt),r=t.from??o,n=e.stores.getMatchStore(r);if(!1){let i=n.get();if(!i){(t.shouldThrow??!0)&&mt();return}return t.select?t.select(i):i}let s=yo(t,e),u=W(n,i=>i?s(i):Zn);if(u!==Zn)return u;(t.shouldThrow??!0)&&mt()}a(X,"useMatch");function Ce(t){return X({from:t.from,strict:t.strict,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,select:a(e=>t.select?t.select(e.search):e.search,"select")})}a(Ce,"useSearch");var lt=k(B(),1);var Le=lt.useLayoutEffect;function Qn(t,e,o={},r){lt.useEffect(()=>{if(!t.current||r||typeof IntersectionObserver!="function")return;let n=new IntersectionObserver(([s])=>{e(s)},o);return n.observe(t.current),()=>{n.disconnect()}},[e,r,o,t])}a(Qn,"useIntersectionObserver");function tr(t){let e=lt.useRef(null);return lt.useImperativeHandle(t,()=>e.current,[]),e}a(tr,"useForwardedRef");var _o=k(B(),1);function Ee(t){let e=N();return _o.useCallback(o=>e.navigate({...o,from:o.from??t?.from}),[t?.from,e])}a(Ee,"useNavigate");var Ut=k(B(),1),nt=k(Z(),1);function Tt(t){return(0,nt.jsx)(ys,{...t})}a(Tt,"CatchBoundary");var ys=class extends Ut.Component{static{a(this,"CatchBoundaryImpl")}constructor(...t){super(...t),this.state={error:null},this.reset=()=>{this.setState({error:null})}}static getDerivedStateFromProps(t,e){let o=t.getResetKey();return e.error&&e.resetKey!==o?{resetKey:o,error:null}:{resetKey:o}}static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,e){this.props.onCatch?.(t,e)}render(){let t=this.state.error;return t?Ut.createElement(this.props.errorComponent??So,{error:t,reset:this.reset}):this.props.children}};function So({error:t}){let[e,o]=Ut.useState(!1);return(0,nt.jsxs)("div",{style:{padding:".5rem",maxWidth:"100%"},children:[(0,nt.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[(0,nt.jsx)("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),(0,nt.jsx)("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:a(()=>o(r=>!r),"onClick"),children:e?"Hide Error":"Show Error"})]}),(0,nt.jsx)("div",{style:{height:".25rem"}}),e?(0,nt.jsx)("div",{children:(0,nt.jsx)("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:t.message?(0,nt.jsx)("code",{children:t.message}):null})}):null]})}a(So,"ErrorComponent");var Ro=k(B(),1),er=k(Z(),1);function or({children:t,fallback:e=null}){return(0,er.jsx)(Ro.default.Fragment,{children:wo()?t:e})}a(or,"ClientOnly");function wo(){return Ro.default.useSyncExternalStore(_s,()=>!0,()=>!1)}a(wo,"useHydrated");function _s(){return()=>{}}a(_s,"subscribe");function xo(t){return X({from:t.from,strict:t.strict,structuralSharing:t.structuralSharing,select:a(e=>t.select?t.select(e.loaderData):e.loaderData,"select")})}a(xo,"useLoaderData");function bo(t){let{select:e,...o}=t;return X({...o,select:a(r=>e?e(r.loaderDeps):r.loaderDeps,"select")})}a(bo,"useLoaderDeps");function Po(t){return X({from:t.from,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,strict:t.strict,select:a(e=>{let o=t.strict===!1?e.params:e._strictParams;return t.select?t.select(o):o},"select")})}a(Po,"useParams");function Co(t){return X({...t,select:a(e=>t.select?t.select(e.context):e.context,"select")})}a(Co,"useRouteContext");var U=k(B(),1);var Ss=k(Z(),1);var ar=k(Or(),1);function Lo(t){let e=U.useRef(t);return Q(e.current,t,{ignoreUndefined:!1})||(e.current=t),e.current}a(Lo,"useValueStable");function Rs(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}a(Rs,"compareLinkState");function ws(t,e,o){if(t?.external)return it(t.href,o)?void 0:t.href;if(!cr(e)&&!(typeof e!="string"||e.indexOf(":")===-1))try{return new URL(e),it(e,o)?void 0:e}catch{}}a(ws,"resolveExternalLink");function xs(t,e,o,r,n,s){if(s)return!1;if(o?.exact){if(!de(t.pathname,e.pathname,r))return!1}else{let u=vt(t.pathname,r),i=vt(e.pathname,r);if(!(u.startsWith(i)&&(u.length===i.length||u[i.length]==="/")))return!1}return(o?.includeSearch??!0)&&!Q(t.search,e.search,{partial:!o?.exact,ignoreUndefined:!o?.explicitUndefined})?!1:o?.includeHash?n&&t.hash===e.hash:!0}a(xs,"resolveIsActive");function bs(t,e){let o=N(),r=tr(e),{activeProps:n,inactiveProps:s,activeOptions:u,to:i,preload:l,preloadDelay:c,preloadIntentProximity:f,hashScrollIntoView:d,replace:h,startTransition:m,resetScroll:g,viewTransition:p,children:v,target:S,disabled:y,style:w,className:R,onClick:L,onBlur:x,onFocus:_,onMouseEnter:b,onMouseLeave:P,onTouchStart:E,ignoreBlocker:C,params:T,search:D,hash:wt,state:rt,mask:re,reloadDocument:Ds,unsafeRelative:Fs,from:As,_fromLocation:$s,...Mt}=t;if(!1){let F=cr(i);if(typeof i=="string"&&!F&&i.indexOf(":")>-1)try{return new URL(i),it(i,o.protocolAllowlist)?{...Mt,ref:r,href:void 0,...v&&{children:v},...S&&{target:S},...y&&{disabled:y},...w&&{style:w},...R&&{className:R}}:{...Mt,ref:r,href:i,...v&&{children:v},...S&&{target:S},...y&&{disabled:y},...w&&{style:w},...R&&{className:R}}}catch{}let I=o.buildLocation({...t,from:t.from}),z=ir(I.maskedLocation?I.maskedLocation.publicHref:I.publicHref,I.maskedLocation?I.maskedLocation.external:I.external,o.history,y),ft=(()=>{if(z?.external)return it(z.href,o.protocolAllowlist)?void 0:z.href;if(!F&&typeof i=="string"&&i.indexOf(":")>-1)try{return new URL(i),it(i,o.protocolAllowlist)?void 0:i}catch{}})(),Ae=(()=>{if(ft)return!1;let $=o.stores.location.get(),H=u?.exact??!1;if(H){if(!de($.pathname,I.pathname,o.basepath))return!1}else{let V=vt($.pathname,o.basepath),j=vt(I.pathname,o.basepath);if(!(V.startsWith(j)&&(V.length===j.length||V[j.length]==="/")))return!1}if((u?.includeSearch??!0)&&$.search!==I.search){let V=!$.search||typeof $.search=="object"&&!ht($.search),j=!I.search||typeof I.search=="object"&&!ht(I.search);if(!(V&&j)&&!Q($.search,I.search,{partial:!H,ignoreUndefined:!u?.explicitUndefined}))return!1}return!u?.includeHash})();if(ft)return{...Mt,ref:r,href:ft,...v&&{children:v},...S&&{target:S},...y&&{disabled:y},...w&&{style:w},...R&&{className:R}};let $e=Ae?J(n,{})??nr:Vt,Be=Ae?Vt:J(s,{})??Vt,Vo=(()=>{let $=w,H=$e.style,V=Be.style;if(!(!$&&!H&&!V))return $&&!H&&!V?$:!$&&H&&!V?H:!$&&!H&&V?V:{...$,...H,...V}})(),Wo=(()=>{let $=R,H=$e.className,V=Be.className;if(!$&&!H&&!V)return"";let j="";return $&&(j=$),H&&(j=j?`${j} ${H}`:H),V&&(j=j?`${j} ${V}`:V),j})();return{...Mt,...$e,...Be,href:z?.href,ref:r,disabled:!!y,target:S,...Vo&&{style:Vo},...Wo&&{className:Wo},...y&&rr,...Ae&&sr}}let Oe=wo(),Cr=Lo(t.search),Lr=Lo(t.params),No=Lo(u),Ht=U.useMemo(()=>t,[o,t.from,t._fromLocation,t.hash,t.to,Cr,Lr,t.state,t.mask,t.unsafeRelative]),Er=U.useCallback(F=>{let I=o.buildLocation({_fromLocation:F,...Ht}),z=ir(I.maskedLocation?I.maskedLocation.publicHref:I.publicHref,I.maskedLocation?I.maskedLocation.external:I.external,o.history,y),ft=ws(z,i,o.protocolAllowlist);return[z?.href,ft,xs(F,I,No,o.basepath,Oe,ft!==void 0)]},[No,y,Oe,Ht,o,i]),[kr,Ne,De]=W(o.stores.location,Er,Rs),se=De?J(n,{})??nr:Vt,ie=De?Vt:J(s,{})??Vt,Do=[R,se.className,ie.className].filter(Boolean).join(" "),Fo=(w||se.style||ie.style)&&{...w,...se.style,...ie.style},[Ir,Ao]=U.useState(!1),$o=U.useRef(!1),Ot=t.reloadDocument||Ne?!1:l??o.options.defaultPreload,Fe=c??o.options.defaultPreloadDelay??0,xt=U.useCallback(()=>{o.preloadRoute(Ht).catch(F=>{console.warn(F),console.warn(lo)})},[o,Ht]);Qn(r,U.useCallback(F=>{F?.isIntersecting&&xt()},[xt]),Cs,!!y||Ot!=="viewport"),U.useEffect(()=>{$o.current||!y&&Ot==="render"&&(xt(),$o.current=!0)},[y,xt,Ot]);let Tr=a(F=>{let I=F.currentTarget.getAttribute("target"),z=S!==void 0?S:I;if(!y&&!Ls(F)&&!F.defaultPrevented&&(!z||z==="_self")&&F.button===0){F.preventDefault(),(0,ar.flushSync)(()=>{Ao(!0)});let ft=o.subscribe("onResolved",()=>{ft(),Ao(!1)});o.navigate({...Ht,replace:h,resetScroll:g,hashScrollIntoView:d,startTransition:m,viewTransition:p,ignoreBlocker:C})}},"handleClick");if(Ne)return{...Mt,ref:r,href:Ne,...v&&{children:v},...S&&{target:S},...y&&{disabled:y},...w&&{style:w},...R&&{className:R},...L&&{onClick:L},...x&&{onBlur:x},..._&&{onFocus:_},...b&&{onMouseEnter:b},...P&&{onMouseLeave:P},...E&&{onTouchStart:E}};let Bo=a(F=>{if(y||Ot!=="intent")return;if(!Fe){xt();return}let I=F.currentTarget;if(ee.has(I))return;let z=setTimeout(()=>{ee.delete(I),xt()},Fe);ee.set(I,z)},"enqueueIntentPreload"),Mr=a(F=>{y||Ot!=="intent"||xt()},"handleTouchStart"),Uo=a(F=>{if(y||!Ot||!Fe)return;let I=F.currentTarget,z=ee.get(I);z&&(clearTimeout(z),ee.delete(I))},"handleLeave");return{...Mt,...se,...ie,href:kr,ref:r,onClick:Wt([L,Tr]),onBlur:Wt([x,Uo]),onFocus:Wt([_,Bo]),onMouseEnter:Wt([b,Bo]),onMouseLeave:Wt([P,Uo]),onTouchStart:Wt([E,Mr]),disabled:!!y,target:S,...Fo&&{style:Fo},...Do&&{className:Do},...y&&rr,...De&&sr,...Oe&&Ir&&Ps}}a(bs,"useLinkProps");var Vt={},nr={className:"active"},rr={role:"link","aria-disabled":!0},sr={"data-status":"active","aria-current":"page"},Ps={"data-transitioning":"transitioning"},ee=new WeakMap,Cs={rootMargin:"100px"},Wt=a(t=>e=>{for(let o of t)if(o){if(e.defaultPrevented)return;o(e)}},"composeHandlers");function ir(t,e,o,r){if(!r)return e?{href:t,external:!0}:{href:o.createHref(t)||"/",external:!1}}a(ir,"getHrefOption");function cr(t){if(typeof t!="string")return!1;let e=t.charCodeAt(0);return e===47?t.charCodeAt(1)!==47:e===46}a(cr,"isSafeInternal");var Eo=U.forwardRef((t,e)=>{let{_asChild:o,...r}=t,{type:n,...s}=bs(r,e),u=typeof r.children=="function"?r.children({isActive:s["data-status"]==="active"}):r.children;if(!o){let{disabled:i,...l}=s;return U.createElement("a",l,u)}return U.createElement(o,s,u)});function Ls(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}a(Ls,"isCtrlEvent");var ko=k(B(),1),Io=k(Z(),1);var lr=class extends Se{static{a(this,"Route")}constructor(t){super(t),this.useMatch=e=>X({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>Co({...e,from:this.id}),this.useSearch=e=>Ce({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Po({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>bo({...e,from:this.id}),this.useLoaderData=e=>xo({...e,from:this.id}),this.useNavigate=()=>Ee({from:this.fullPath}),this.Link=ko.default.forwardRef((e,o)=>(0,Io.jsx)(Eo,{ref:o,from:this.fullPath,...e}))}};function Es(t){return new lr(t)}a(Es,"createRoute");var ur=class extends uo{static{a(this,"RootRoute")}constructor(t){super(t),this.useMatch=e=>X({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>Co({...e,from:this.id}),this.useSearch=e=>Ce({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Po({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>bo({...e,from:this.id}),this.useLoaderData=e=>xo({...e,from:this.id}),this.useNavigate=()=>Ee({from:this.fullPath}),this.Link=ko.default.forwardRef((e,o)=>(0,Io.jsx)(Eo,{ref:o,from:this.fullPath,...e}))}};function ks(t){return new ur(t)}a(ks,"createRootRoute");var Bc=k(B(),1);var ke=k(Z(),1);function fr(t){let e=N();if(!1){let r=`not-found-${e.stores.location.get().pathname}-${e.stores.status.get()}`;return(0,ke.jsx)(Tt,{getResetKey:a(()=>r,"getResetKey"),onCatch:a((n,s)=>{if(K(n))t.onCatch?.(n,s);else throw n},"onCatch"),errorComponent:a(({error:n})=>{if(K(n))return t.fallback?.(n);throw n},"errorComponent"),children:t.children})}let o=`not-found-${W(e.stores.location,r=>r.pathname)}-${W(e.stores.status,r=>r)}`;return(0,ke.jsx)(Tt,{getResetKey:a(()=>o,"getResetKey"),onCatch:a((r,n)=>{if(K(r))t.onCatch?.(r,n);else throw r},"onCatch"),errorComponent:a(({error:r})=>{if(K(r))return t.fallback?.(r);throw r},"errorComponent"),children:t.children})}a(fr,"CatchNotFound");function dr(){return(0,ke.jsx)("p",{children:"Not Found"})}a(dr,"DefaultGlobalNotFound");var hr=k(Z(),1);function pr({children:t}){let e=N();return null}a(pr,"ScriptOnce");var Kc=k(B(),1),Ie=k(Z(),1);function Rt(t){return(0,Ie.jsx)(Ie.Fragment,{children:t.children})}a(Rt,"SafeFragment");var Yc=k(B(),1),Te=k(Z(),1);function To(t,e,o){return e.options.notFoundComponent?(0,Te.jsx)(e.options.notFoundComponent,{...o}):t.options.defaultNotFoundComponent?(0,Te.jsx)(t.options.defaultNotFoundComponent,{...o}):(0,Te.jsx)(dr,{})}a(To,"renderRouteNotFound");var gr=k(Z(),1);function mr(t){return null}a(mr,"getScrollRestorationScriptForRouter");function vr(){let t=mr(N());return t?(0,gr.jsx)(pr,{children:t}):null}a(vr,"ScrollRestoration");var G=k(B(),1);var A=k(Z(),1);function oe(t,e){let o=e?.options.pendingComponent??t.options.defaultPendingComponent;return o?(0,A.jsx)(o,{}):null}a(oe,"renderPending");var Is=a((t,e)=>t[0]===e[0]&&t[1]===e[1],"outletMatchSelectionEqual"),Me=G.memo(a(function({routeId:e}){let o=N();return(0,A.jsx)(yr,{router:o,match:W(o.stores.getMatchStore(e),r=>r)})},"MatchImpl"));function yr({router:t,match:e}){let o=t.routesById[e.routeId],r=oe(t,o),n=o.options.errorComponent??t.options.defaultErrorComponent,s=o.options.onCatch??t.options.defaultOnCatch,u=o.isRoot?o.options.notFoundComponent??t.options.notFoundRoute?.options.component:o.options.notFoundComponent,i=e.ssr===!1||e.ssr==="data-only",l=o.options.wrapInSuspense??r??(o.options.errorComponent?.preload||i)?G.Suspense:Rt,c=n?Tt:Rt,f=u?fr:Rt;return(0,A.jsxs)(o.isRoot?o.options.shellComponent??Rt:Rt,{children:[(0,A.jsx)(bt.Provider,{value:e.routeId,children:(0,A.jsx)(l,{fallback:r,children:(0,A.jsx)(c,{getResetKey:a(()=>e,"getResetKey"),errorComponent:n,onCatch:a((d,h)=>{if(K(d))throw d.routeId??=e.routeId,d;s?.(d,h)},"onCatch"),children:(0,A.jsx)(f,{fallback:a(d=>{if(d.routeId??=e.routeId,d.routeId!==e.routeId)throw d;return G.createElement(u,d)},"fallback"),children:i?(0,A.jsx)(or,{fallback:r,children:(0,A.jsx)(_r,{match:e})}):(0,A.jsx)(_r,{match:e})})})})}),null]})}a(yr,"MatchView");var _r=G.memo(a(function({match:e}){let o=N(),r=e.routeId,n=o.routesById[r],s=G.useMemo(()=>{let i=(n.options.remountDeps??o.options.defaultRemountDeps)?.({routeId:r,loaderDeps:e.loaderDeps,params:e._strictParams,search:e._strictSearch});return i?JSON.stringify(i):void 0},[r,e.loaderDeps,e._strictParams,e._strictSearch,n.options.remountDeps,o.options.defaultRemountDeps]),u=G.useMemo(()=>{let i=n.options.component??o.options.defaultComponent;return i?(0,A.jsx)(i,{},s):(0,A.jsx)(Sr,{})},[s,n.options.component,o.options.defaultComponent]);if(e.status==="pending"){if(o._tx)throw o._tx[5];return oe(o,n)}if(e.status==="notFound")return To(o,n,e.error);if(e.status==="error"){if(!1)return(0,A.jsx)((n.options.errorComponent??o.options.defaultErrorComponent)||So,{error:e.error,reset:void 0,info:{componentStack:""}});throw e.error}return u},"MatchInnerImpl")),Sr=G.memo(a(function(){let e=N(),o=G.useContext(bt),r,n,s;if(!1){let i=e.stores.matches.get(),l=i.findIndex(f=>f.routeId===o),c=i[l];r=!!c._notFound,n=c.error,s=i[l+1]?.routeId}else{let i=e.stores.getMatchStore(o);[r,n]=W(i,l=>[!!l._notFound,l.error],Is),s=W(e.stores.ids,l=>l[l.indexOf(o)+1])}if(r)return To(e,e.routesById[o],n);if(!s)return null;let u=(0,A.jsx)(Me,{routeId:s});return o===tt?(0,A.jsx)(G.Suspense,{fallback:oe(e),children:u}):u},"OutletImpl"));var Mo=k(B(),1);function Oo(t,e){let o=t[1];t.length=0,o?.(e)}a(Oo,"settleOwner");function Rr({t}){let e=N(),o=e._rendered??=[],r=void 0;return e.startTransition=(n,s)=>new Promise((u,i)=>{Oo(o,!1),o.push(s,u),t(e),Mo.startTransition(()=>{try{n()}catch(l){o[1]===u&&(o.length=0),i(l)}})}),Le(()=>{let n=e.history.subscribe(e.load);if(r?.current)return n;r&&(r.current=!0),e.updateLatestLocation();let s=e.latestLocation,u=e.buildLocation({to:s.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(Y(s.publicHref)!==Y(u.publicHref))return e.commitLocation({...u,replace:!0,ignoreBlocker:!0}),n;let i=e.stores.resolvedLocation.get();return i?.href===s.href&&i.state.__TSR_key===s.state.__TSR_key?o.push(e.stores.matches.get(),l=>{l&&e.emit({type:"onRendered",...Ct(i,i)})}):e._tx||e.load().catch(console.error),n},[e,e.history]),null}a(Rr,"Transitioner");var zt=k(B(),1);var ot=k(Z(),1);function wr(){let t=N(),e=t.routesById[tt],o=oe(t,e),r=t.ssr?Rt:zt.Suspense,n=(0,ot.jsxs)(ot.Fragment,{children:[!!1&&(0,ot.jsx)(Rr,{t:zt.useState()[1]}),(0,ot.jsx)(r,{fallback:o,children:(0,ot.jsx)(Ts,{})})]});return t.options.InnerWrap?(0,ot.jsx)(t.options.InnerWrap,{children:n}):n}a(wr,"Matches");function Ts(){let t=N(),e=t._rendered,o=W(t.stores.matches,u=>e[0]??u),r=o[0],n=r?.routeId;Le(()=>{e[0]===o&&Oo(e,!0)},[e,o]);let s=n?(0,ot.jsx)(Me,{routeId:n}):null;return(0,ot.jsx)(bt.Provider,{value:n,children:t.options.disableGlobalCatchBoundary?s:(0,ot.jsx)(Tt,{getResetKey:a(()=>r,"getResetKey"),onCatch:void 0,children:s})})}a(Ts,"MatchesInner");var xr=a(t=>({createMutableStore:be,createReadonlyStore:be,batch:mo}),"getStoreFactory");var Ms=a(t=>new br(t),"createRouter"),br=class extends oo{static{a(this,"Router")}constructor(t){super(t,xr)}};var Kl=k(B(),1),ne=k(Z(),1);function Pr({router:t,children:e,...o}){ht(o)&&t.update({...t.options,...o,context:{...t.options.context,...o.context}});let r=(0,ne.jsx)(ae.Provider,{value:t,children:e});return t.options.Wrap?(0,ne.jsx)(t.options.Wrap,{children:r}):r}a(Pr,"RouterContextProvider");function Os({router:t,...e}){return(0,ne.jsx)(Pr,{router:t,...e,children:(0,ne.jsx)(wr,{})})}a(Os,"RouterProvider");function Ns(t){let e=N({warn:t?.router===void 0}),o=t?.router||e;if(!1){let r=o.stores.__store.get();return t?.select?t.select(r):r}return W(o.stores.__store,yo(t,o))}a(Ns,"useRouterState");export{to as a,es as b,N as c,Ce as d,Ee as e,Es as f,ks as g,Sr as h,Ms as i,Os as j,Ns as k};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as C}from"./chunk-NCCAMFB6.js";import"./chunk-25NFR6EB.js";import{a as J}from"./chunk-JAZCU2PP.js";import"./chunk-ULIQFBZU.js";import"./chunk-OOESPRIZ.js";import"./chunk-35DM4JJG.js";import{a as H}from"./chunk-CXNZVJ3S.js";import{c as z}from"./chunk-ECQTVV2J.js";import"./chunk-JBIN7W2B.js";import"./chunk-FSRSK4LY.js";import{a as E}from"./chunk-FKVZRPV5.js";import{a as G,b as M,c as U,d as P,e as d,f as c}from"./chunk-HEAQVSNS.js";import{a as D,e as _}from"./chunk-WUWBZPUK.js";import{d as q}from"./chunk-Y4Q25F6X.js";import"./chunk-T2IE5GKA.js";import{a as S,d as O,f as Q,g as V}from"./chunk-YKXDMIHQ.js";var L=O(Q(),1);var r=O(V(),1);var K=["read","insert","update","delete"],B=S((e,s)=>({delete:e("Delete"),insert:e("Insert"),read:e("Read"),update:e("Update")})[s],"z"),W=S(e=>{let s=new Map;for(let a of e){let t=s.get(a.table)??{operations:new Set,procedures:new Set,table:a.table};t.operations.add(a.on),t.procedures.add(a.procedure),s.set(a.table,t)}return[...s.values()].toSorted((a,t)=>a.table.localeCompare(t.table))},"J"),ie=S(()=>{let e=(0,L.c)(49),s=q(),a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={},e[0]=a):a=e[0];let{data:t,error:R,errorSource:k}=z(H.rlsPolicies,a),p=t!==void 0,m,n,h,l,f,u,x,b,o;if(e[1]!==t||e[2]!==R||e[3]!==k||e[4]!==p||e[5]!==s){let $=W(Array.isArray(t?.policies)?t.policies:[]),j;e[15]!==t?(j=Array.isArray(t?.roles)?t.roles:[],e[15]=t,e[16]=j):j=e[16],n=j,x="flex flex-col gap-6",b="lunora-rls-panel",e[17]!==R||e[18]!==k?(o=R!==null&&(0,r.jsx)(J,{error:k,testId:"rls-error"}),e[17]=R,e[18]=k,e[19]=o):o=e[19],u="flex flex-col gap-2",m=D,h="overflow-hidden py-0";let I;e[20]!==s?(I=s("Policies"),e[20]=s,e[21]=I):I=e[21],e[22]!==I?(l=(0,r.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,r.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:I})}),e[22]=I,e[23]=l):l=e[23],f=p&&$.length===0?(0,r.jsx)(E,{description:s("No `definePolicy` is wired through `.use(rls(...))` in this deployment. Add one to guard a table's rows."),testId:"rls-policies-empty",title:s("No policies defined")}):(0,r.jsx)(_,{className:"px-0",children:(0,r.jsxs)(G,{"data-testid":"rls-policies-table",children:[(0,r.jsx)(M,{children:(0,r.jsxs)(P,{children:[(0,r.jsx)(d,{children:s("Table")}),K.map(i=>(0,r.jsx)(d,{children:B(s,i)},i)),(0,r.jsx)(d,{children:s("Guarded by")})]})}),(0,r.jsx)(U,{children:$.map(i=>(0,r.jsxs)(P,{"data-testid":`rls-table-${i.table}`,children:[(0,r.jsx)(c,{className:"font-mono text-xs",children:i.table}),K.map(F=>(0,r.jsx)(c,{children:i.operations.has(F)?(0,r.jsx)(C,{variant:"secondary",children:s("Guarded")}):(0,r.jsx)("span",{"aria-hidden":"true",className:"text-muted-foreground",children:"\u2014"})},F)),(0,r.jsx)(c,{className:"font-mono text-xs text-muted-foreground",children:[...i.procedures].join(", ")})]},i.table))})]})}),e[1]=t,e[2]=R,e[3]=k,e[4]=p,e[5]=s,e[6]=m,e[7]=n,e[8]=h,e[9]=l,e[10]=f,e[11]=u,e[12]=x,e[13]=b,e[14]=o}else m=e[6],n=e[7],h=e[8],l=e[9],f=e[10],u=e[11],x=e[12],b=e[13],o=e[14];let N;e[24]!==m||e[25]!==h||e[26]!==l||e[27]!==f?(N=(0,r.jsxs)(m,{className:h,children:[l,f]}),e[24]=m,e[25]=h,e[26]=l,e[27]=f,e[28]=N):N=e[28];let g;e[29]!==u||e[30]!==N?(g=(0,r.jsx)("section",{className:u,children:N}),e[29]=u,e[30]=N,e[31]=g):g=e[31];let y;e[32]!==s?(y=s("Roles"),e[32]=s,e[33]=y):y=e[33];let w;e[34]!==y?(w=(0,r.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,r.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:y})}),e[34]=y,e[35]=w):w=e[35];let v;e[36]!==p||e[37]!==n||e[38]!==s?(v=p&&n.length===0?(0,r.jsx)(E,{description:s("No `defineRole` is registered via `rls(policies, { roles })`. Roles back `ctx.auth.can(...)` permission checks."),testId:"rls-roles-empty",title:s("No roles defined")}):(0,r.jsx)(_,{className:"px-0",children:(0,r.jsxs)(G,{"data-testid":"rls-roles-table",children:[(0,r.jsx)(M,{children:(0,r.jsxs)(P,{children:[(0,r.jsx)(d,{children:s("Role")}),(0,r.jsx)(d,{children:s("Description")}),(0,r.jsx)(d,{children:s("Permissions")})]})}),(0,r.jsx)(U,{children:n.map(Y)})]})}),e[36]=p,e[37]=n,e[38]=s,e[39]=v):v=e[39];let A;e[40]!==w||e[41]!==v?(A=(0,r.jsx)("section",{className:"flex flex-col gap-2",children:(0,r.jsxs)(D,{className:"overflow-hidden py-0",children:[w,v]})}),e[40]=w,e[41]=v,e[42]=A):A=e[42];let T;return e[43]!==A||e[44]!==x||e[45]!==b||e[46]!==o||e[47]!==g?(T=(0,r.jsxs)("div",{className:x,"data-testid":b,children:[o,g,A]}),e[43]=A,e[44]=x,e[45]=b,e[46]=o,e[47]=g,e[48]=T):T=e[48],T},"oe");function X(e){return(0,r.jsx)(C,{variant:"outline",children:e},e)}S(X,"K");function Y(e){return(0,r.jsxs)(P,{"data-testid":`rls-role-${e.name}`,children:[(0,r.jsx)(c,{className:"font-mono text-xs",children:e.name}),(0,r.jsx)(c,{className:"text-muted-foreground",children:e.description??""}),(0,r.jsx)(c,{children:e.permissions.length===0?(0,r.jsx)("span",{"aria-hidden":"true",className:"text-muted-foreground",children:"\u2014"}):(0,r.jsx)("span",{className:"flex flex-wrap gap-1",children:e.permissions.map(X)})})]},e.name)}S(Y,"V");export{ie as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./chunk-YKXDMIHQ.js";var u={highErrorRate:.05,highWriteContention:.1,lowCacheHitRate:.5,minCacheSamples:10,minConflictCalls:5,minErrorCalls:5,slowFunctionMs:1e3,storageCriticalBytes:5368709120,storageWarnBytes:1073741824},h={error:0,info:2,warning:1},g=e((a,i)=>{let s=[];if(a.maxDurationMs>=i.slowFunctionMs){let t=a.scannedTables??[];t.length>0?s.push({fn:a.path,kind:"missing-index",severity:"warning",tables:t.map(r=>r.table),value:a.maxDurationMs}):s.push({fn:a.path,kind:"slow-function",severity:"info",value:a.maxDurationMs})}a.calls>=i.minErrorCalls&&a.errors/a.calls>=i.highErrorRate&&s.push({fn:a.path,kind:"high-error-rate",message:a.lastErrorMessage??void 0,severity:"error",value:a.errors/a.calls});let n=a.conflicts??0;return n>0&&a.calls>=i.minConflictCalls&&n/a.calls>=i.highWriteContention&&s.push({fn:a.path,kind:"high-write-contention",severity:"warning",value:n/a.calls}),s},"h"),v=e((a,i,s=u)=>{let n=[];if(typeof a?.databaseSize=="number"&&a.databaseSize>=s.storageWarnBytes&&n.push({kind:"storage-headroom",severity:a.databaseSize>=s.storageCriticalBytes?"error":"warning",value:a.databaseSize}),a?.cache){let{evictions:t,hits:r,misses:c}=a.cache,o=r+c;if(o>=s.minCacheSamples){let l=r/o;l<s.lowCacheHitRate&&n.push({kind:"low-cache-hit-rate",severity:"warning",value:l})}t>0&&t>r&&n.push({kind:"high-evictions",severity:"warning",value:t})}for(let t of i??[])n.push(...g(t,s));return n.toSorted((t,r)=>h[t.severity]-h[r.severity])},"u");export{v as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as re}from"./chunk-7QRRR3K6.js";import{a as X}from"./chunk-S3CRZLGS.js";import{a as V}from"./chunk-IFLTA2OD.js";import"./chunk-OGUKYRFM.js";import"./chunk-OKG3HWSJ.js";import"./chunk-46ZJ3TM4.js";import"./chunk-4L4WTGN5.js";import{a as R}from"./chunk-EBWXFG4H.js";import"./chunk-TGHH7ZFA.js";import"./chunk-5GFSKIB2.js";import{b as O}from"./chunk-NCCAMFB6.js";import"./chunk-25NFR6EB.js";import{a as Y}from"./chunk-JAZCU2PP.js";import"./chunk-ULIQFBZU.js";import"./chunk-OOESPRIZ.js";import"./chunk-35DM4JJG.js";import{a as Q}from"./chunk-CXNZVJ3S.js";import{c as J}from"./chunk-ECQTVV2J.js";import"./chunk-JBIN7W2B.js";import"./chunk-FSRSK4LY.js";import{a as G}from"./chunk-FKVZRPV5.js";import{a as Z,b as ee,c as te,d as P,e as n,f as o}from"./chunk-HEAQVSNS.js";import{a as U,e as W}from"./chunk-WUWBZPUK.js";import{d as z,r as H}from"./chunk-Y4Q25F6X.js";import"./chunk-T2IE5GKA.js";import{a as l,d as B,e as de,f as me,g as he,i as L}from"./chunk-YKXDMIHQ.js";var se=B(me(),1),le=B(de(),1);var t=B(he(),1);var ue={action:"outline",mutation:"default",query:"secondary"},ae=l(r=>r<1e3?`${r<10?r.toFixed(1):Math.round(r).toString()}ms`:`${(r/1e3).toFixed(2)}s`,"q"),fe=l(r=>r.calls===0?"\u2014":r.errors===0?"0":`${r.errors.toString()} (${(r.errors/r.calls*100).toFixed(1)}%)`,"de"),pe=l(r=>{let e=r.conflicts??0;return r.calls===0?"\u2014":e===0?"0":`${e.toString()} (${(e/r.calls*100).toFixed(1)}%)`},"me"),xe={calls:l((r,e)=>e.calls-r.calls,"calls"),recent:l((r,e)=>e.lastCalledAt-r.lastCalledAt,"recent"),slowest:l((r,e)=>e.maxDurationMs-r.maxDurationMs,"slowest")},Ee=l(r=>{let e=(0,se.c)(47),{functions:K,initialShardKey:ne}=r,s=z(),{queryShardKey:_,setShardKey:N,shardKey:v}=X(ne),[i,oe]=(0,le.useState)("recent"),w;e[0]===Symbol.for("react.memo_cache_sentinel")?(w={},e[0]=w):w=e[0];let C;e[1]!==_?(C={live:!0,shardKey:_},e[1]=_,e[2]=C):C=e[2];let{data:ie,error:c,errorSource:S,liveError:b}=J(Q.getFunctionStats,w,C),k=ie?.functions??null,$;e[3]!==K?($=new Map((K??[]).map(ge)),e[3]=K,e[4]=$):$=e[4];let T=$,F;e[5]===Symbol.for("react.memo_cache_sentinel")?(F=l(M=>{oe(M.currentTarget.dataset.sort)},"E"),e[5]=F):F=e[5];let ce=F,I;if(e[6]!==c||e[7]!==S||e[8]!==T||e[9]!==b||e[10]!==N||e[11]!==v||e[12]!==i||e[13]!==k||e[14]!==s){let M=k===null?[]:k.toSorted(xe[i]),d;e[16]!==s?(d=s("Recent"),e[16]=s,e[17]=d):d=e[17];let m;e[18]!==d?(m={key:"recent",label:d},e[18]=d,e[19]=m):m=e[19];let h;e[20]!==s?(h=s("Most called"),e[20]=s,e[21]=h):h=e[21];let u;e[22]!==h?(u={key:"calls",label:h},e[22]=h,e[23]=u):u=e[23];let f;e[24]!==s?(f=s("Slowest"),e[24]=s,e[25]=f):f=e[25];let p;e[26]!==f?(p={key:"slowest",label:f},e[26]=f,e[27]=p):p=e[27];let A;e[28]!==p||e[29]!==m||e[30]!==u?(A=[m,u,p],e[28]=p,e[29]=m,e[30]=u,e[31]=A):A=e[31];let j=A,x;e[32]!==N||e[33]!==v?(x=(0,t.jsx)(V,{onChange:N,testId:"fs-shard-input",value:v}),e[32]=N,e[33]=v,e[34]=x):x=e[34];let g;e[35]!==b?(g=(0,t.jsx)(re,{message:b,prefix:"fs"}),e[35]=b,e[36]=g):g=e[36];let y;e[37]!==j||e[38]!==i?(y=(0,t.jsx)("div",{className:"ml-auto flex items-center gap-1",role:"group",children:j.map(a=>(0,t.jsx)(R,{"data-sort":a.key,"data-testid":`fs-sort-${a.key}`,onClick:ce,size:"sm",type:"button",variant:i===a.key?"secondary":"ghost",children:a.label},a.key))}),e[37]=j,e[38]=i,e[39]=y):y=e[39];let D;e[40]!==x||e[41]!==g||e[42]!==y?(D=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[x,g,y]}),e[40]=x,e[41]=g,e[42]=y,e[43]=D):D=e[43];let E;e[44]!==c||e[45]!==S?(E=c!==null&&(0,t.jsx)(Y,{error:S,testId:"fs-error"}),e[44]=c,e[45]=S,e[46]=E):E=e[46],I=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-function-stats",children:[D,E,k!==null&&M.length===0&&c===null&&(0,t.jsx)(G,{description:s("Per-function call counts, error rates, and latency land here after your first request."),icon:(0,t.jsxs)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,t.jsx)("path",{d:"M3 3v18h18"}),(0,t.jsx)("path",{d:"M7 14l4-4 3 3 5-6"})]}),testId:"fs-empty",title:s("No functions have run on this shard yet.")}),M.length>0&&(0,t.jsx)(U,{className:"overflow-hidden py-0",children:(0,t.jsx)(W,{className:"px-0",children:(0,t.jsxs)(Z,{"data-testid":"fs-table",children:[(0,t.jsx)(ee,{children:(0,t.jsxs)(P,{children:[(0,t.jsx)(n,{children:s("function")}),(0,t.jsx)(n,{children:s("kind")}),(0,t.jsx)(n,{className:"text-right",children:s("calls")}),(0,t.jsx)(n,{className:"text-right",children:s("errors")}),(0,t.jsx)(n,{className:"text-right",children:s("conflicts")}),(0,t.jsx)(n,{className:"text-right",children:s("avg")}),(0,t.jsx)(n,{className:"text-right",children:s("max")}),(0,t.jsx)(n,{children:s("last run")}),(0,t.jsx)(n,{children:s("last error")})]})}),(0,t.jsx)(te,{children:M.map(a=>{let q=T.get(a.path);return(0,t.jsxs)(P,{"data-testid":`fs-row-${a.path}`,children:[(0,t.jsx)(o,{className:"font-medium",children:a.path}),(0,t.jsx)(o,{children:q===void 0?(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"}):(0,t.jsx)(O,{variant:ue[q],children:q})}),(0,t.jsx)(o,{className:"text-right tabular-nums",children:a.calls}),(0,t.jsx)(o,{className:L("text-right tabular-nums",a.errors>0&&"text-destructive"),children:fe(a)}),(0,t.jsx)(o,{className:L("text-right tabular-nums",(a.conflicts??0)>0&&"text-warning"),children:pe(a)}),(0,t.jsx)(o,{className:"text-right tabular-nums",children:a.calls===0?"\u2014":ae(a.totalDurationMs/a.calls)}),(0,t.jsx)(o,{className:"text-right tabular-nums",children:a.calls===0?"\u2014":ae(a.maxDurationMs)}),(0,t.jsx)(o,{className:"text-muted-foreground",children:H(a.lastCalledAt,"\u2014")}),(0,t.jsx)(o,{className:"max-w-[24ch] truncate text-destructive",title:a.lastErrorMessage??void 0,children:a.lastErrorMessage??(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})})]},a.path)})})]})})})]}),e[6]=c,e[7]=S,e[8]=T,e[9]=b,e[10]=N,e[11]=v,e[12]=i,e[13]=k,e[14]=s,e[15]=I}else I=e[15];return I},"Ae");function ge(r){return[r.path,r.kind]}l(ge,"fe");export{Ee as FunctionStatsPanel};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as we}from"./chunk-EA2JKR5D.js";import{a as ye}from"./chunk-I5OKDKON.js";import{a as Ne}from"./chunk-IFLTA2OD.js";import{b as pe}from"./chunk-OGUKYRFM.js";import"./chunk-OKG3HWSJ.js";import"./chunk-46ZJ3TM4.js";import"./chunk-4L4WTGN5.js";import{a as he}from"./chunk-EBWXFG4H.js";import"./chunk-TGHH7ZFA.js";import"./chunk-5GFSKIB2.js";import"./chunk-25NFR6EB.js";import{a as H}from"./chunk-CXNZVJ3S.js";import{d as ge}from"./chunk-ECQTVV2J.js";import{f as xe}from"./chunk-JBIN7W2B.js";import"./chunk-FSRSK4LY.js";import{a as ne,e as ie}from"./chunk-WUWBZPUK.js";import{d as be,f as ce,g as de,h as ee,o as me}from"./chunk-Y4Q25F6X.js";import{c as se}from"./chunk-T2IE5GKA.js";import{a as s,d as ae,e as ve,f as je,g as Ce}from"./chunk-YKXDMIHQ.js";var Se=ae(je(),1);var g=ae(ve(),1);var r=ae(Ce(),1);var Ee=ce(H.exportShard),Te=ce(H.importShard),Oe=s(x=>x.map(e=>JSON.stringify(e)).join(`
|
|
2
|
+
`),"je"),Ae=s(x=>{let e=[],te=x.split(`
|
|
3
|
+
`);for(let[n,N]of te.entries()){let t=N.trim();if(t==="")continue;let o=JSON.parse(t);if(typeof o!="object"||o===null)throw new se("INTERNAL",`line ${(n+1).toString()}: expected a { table, doc } object`);let b=o;if(typeof b.table!="string"||typeof b.doc!="object"||b.doc===null||Array.isArray(b.doc))throw new se("INTERNAL",`line ${(n+1).toString()}: expected a { table, doc } object`);e.push(b)}return e},"ve"),Ue=s(x=>{let e=(0,Se.c)(94),{initialShardKey:te}=x,n=xe(),N=ge(),t=be(),[o,b]=(0,g.useState)(te??""),[l,ue]=(0,g.useState)(""),[d,M]=(0,g.useState)(!1),[Q,U]=(0,g.useState)(null),[i,re]=(0,g.useState)(null),[y,fe]=(0,g.useState)(null),V;e[0]!==n||e[1]!==o?(V=s(async()=>{M(!0),U(null),re(null);try{let c=await n.query(Ee,{},de(o));pe(o),ue(Oe(c.rows)),fe(c.rows.length)}catch(c){U(ee(c))}M(!1)},"Q"),e[0]=n,e[1]=o,e[2]=V):V=e[2];let z=V,W;e[3]!==n||e[4]!==N||e[5]!==l||e[6]!==o||e[7]!==t?(W=s(async()=>{M(!0),U(null),re(null),fe(null);let c;try{c=Ae(l)}catch(a){U(t("Invalid NDJSON: {message}",{message:ee(a)})),M(!1);return}try{let a=await n.query(Te,{rows:c},de(o));pe(o),re(a),N(H.readTablePage),N(H.listTables)}catch(a){U(ee(a))}M(!1)},"V"),e[3]=n,e[4]=N,e[5]=l,e[6]=o,e[7]=t,e[8]=W):W=e[8];let G=W,w,S,I,m,v,p,u,j,C,f,E;if(e[9]!==d||e[10]!==y||e[11]!==z||e[12]!==i||e[13]!==G||e[14]!==l||e[15]!==o||e[16]!==t){let c=i===null?0:Object.values(i.inserted).reduce(Le,0),a;e[28]!==z?(a=s(()=>{me(z())},"o"),e[28]=z,e[29]=a):a=e[29];let oe=a,Y;e[30]!==G?(Y=s(()=>{me(G())},"Y"),e[30]=G,e[31]=Y):Y=e[31];let le=Y,Z;e[32]===Symbol.for("react.memo_cache_sentinel")?(Z=s(h=>{ue(h.target.value)},"Z"),e[32]=Z):Z=e[32];let Ie=Z;E="flex flex-col gap-4",I="lunora-export-import";let L;e[33]!==t?(L=t("Export"),e[33]=t,e[34]=L):L=e[34];let J;e[35]!==L?(J=(0,r.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,r.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:L})}),e[35]=L,e[36]=J):J=e[36];let _;e[37]!==o?(_=(0,r.jsx)(Ne,{onChange:b,testId:"ei-shard-input",value:o}),e[37]=o,e[38]=_):_=e[38];let $;e[39]!==t?($=t("Export"),e[39]=t,e[40]=$):$=e[40];let k;e[41]!==d||e[42]!==oe||e[43]!==$?(k=(0,r.jsx)(he,{"data-testid":"ei-export",disabled:d,onClick:oe,type:"button",children:$}),e[41]=d,e[42]=oe,e[43]=$,e[44]=k):k=e[44];let D;e[45]!==_||e[46]!==k?(D=(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[_,k]}),e[45]=_,e[46]=k,e[47]=D):D=e[47];let q;e[48]!==y||e[49]!==t?(q=y!==null&&(0,r.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"ei-export-result",children:t("Exported {count} rows.",{count:y})}),e[48]=y,e[49]=t,e[50]=q):q=e[50];let B;e[51]!==D||e[52]!==q?(B=(0,r.jsxs)(ie,{className:"flex flex-col gap-3 p-4",children:[D,q]}),e[51]=D,e[52]=q,e[53]=B):B=e[53],e[54]!==J||e[55]!==B?(m=(0,r.jsxs)(ne,{className:"gap-0 py-0 rounded-xl border border-border bg-card shadow-xs",children:[J,B]}),e[54]=J,e[55]=B,e[56]=m):m=e[56],S=ne,C="gap-0 py-0 rounded-xl border border-border bg-card shadow-xs";let F;e[57]!==t?(F=t("Import"),e[57]=t,e[58]=F):F=e[58],e[59]!==F?(f=(0,r.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,r.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:F})}),e[59]=F,e[60]=f):f=e[60],w=ie,v="flex flex-col gap-3 p-4",e[61]!==l?(p=(0,r.jsx)(we,{"aria-label":"NDJSON",className:"font-mono text-xs min-h-40 rounded-md","data-testid":"ei-ndjson",onChange:Ie,placeholder:'{"table":"messages","doc":{\u2026}}',value:l}),e[61]=l,e[62]=p):p=e[62];let P;e[63]!==t?(P=t("Import (writes rows)?"),e[63]=t,e[64]=P):P=e[64];let R;e[65]!==d||e[66]!==l?(R=d||l.trim()==="",e[65]=d,e[66]=l,e[67]=R):R=e[67];let K;e[68]!==t?(K=t("Import"),e[68]=t,e[69]=K):K=e[69],e[70]!==le||e[71]!==P||e[72]!==R||e[73]!==K?(u=(0,r.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:(0,r.jsx)(ye,{confirmLabel:P,disabled:R,onConfirm:le,testId:"ei-import",children:K})}),e[70]=le,e[71]=P,e[72]=R,e[73]=K,e[74]=u):u=e[74],j=i!==null&&(0,r.jsxs)("div",{className:"flex flex-col gap-2","data-testid":"ei-import-result",children:[(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:t("Inserted {inserted}, {conflicts} conflicts, {errors} errors.",{conflicts:i.conflicts,errors:i.errors.length,inserted:c})}),i.errors.length>0&&(0,r.jsx)("ul",{className:"flex flex-col gap-1","data-testid":"ei-import-errors",children:i.errors.map(h=>(0,r.jsx)("li",{className:"text-xs text-destructive",children:t("line {line} ({table}): {message}",{line:h.line,message:h.message,table:h.table})},`${h.table}-${h.line.toString()}`))})]}),e[9]=d,e[10]=y,e[11]=z,e[12]=i,e[13]=G,e[14]=l,e[15]=o,e[16]=t,e[17]=w,e[18]=S,e[19]=I,e[20]=m,e[21]=v,e[22]=p,e[23]=u,e[24]=j,e[25]=C,e[26]=f,e[27]=E}else w=e[17],S=e[18],I=e[19],m=e[20],v=e[21],p=e[22],u=e[23],j=e[24],C=e[25],f=e[26],E=e[27];let T;e[75]!==w||e[76]!==v||e[77]!==p||e[78]!==u||e[79]!==j?(T=(0,r.jsxs)(w,{className:v,children:[p,u,j]}),e[75]=w,e[76]=v,e[77]=p,e[78]=u,e[79]=j,e[80]=T):T=e[80];let O;e[81]!==S||e[82]!==T||e[83]!==C||e[84]!==f?(O=(0,r.jsxs)(S,{className:C,children:[f,T]}),e[81]=S,e[82]=T,e[83]=C,e[84]=f,e[85]=O):O=e[85];let A;e[86]!==Q?(A=Q!==null&&(0,r.jsx)("p",{className:"text-sm text-destructive","data-testid":"ei-error",role:"alert",children:Q}),e[86]=Q,e[87]=A):A=e[87];let X;return e[88]!==I||e[89]!==m||e[90]!==O||e[91]!==A||e[92]!==E?(X=(0,r.jsxs)("div",{className:E,"data-testid":I,children:[m,O,A]}),e[88]=I,e[89]=m,e[90]=O,e[91]=A,e[92]=E,e[93]=X):X=e[93],X},"Fe");function Le(x,e){return x+e}s(Le,"Ce");export{Ue as ExportImportPanel};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import{a as Pe}from"./chunk-EA2JKR5D.js";import{a as he}from"./chunk-IMOHEGMV.js";import{d as Ne,f as ke,g as we,k as oe}from"./chunk-FO26ZU7E.js";import{a as V}from"./chunk-5WJXVZMZ.js";import{a as $e}from"./chunk-IFLTA2OD.js";import"./chunk-OGUKYRFM.js";import"./chunk-OKG3HWSJ.js";import{P as ye}from"./chunk-46ZJ3TM4.js";import"./chunk-4L4WTGN5.js";import{a as B}from"./chunk-EBWXFG4H.js";import"./chunk-TGHH7ZFA.js";import"./chunk-5GFSKIB2.js";import{b as ve}from"./chunk-NCCAMFB6.js";import"./chunk-25NFR6EB.js";import{a as Oe}from"./chunk-CXNZVJ3S.js";import{f as F}from"./chunk-JBIN7W2B.js";import"./chunk-FSRSK4LY.js";import{a as U}from"./chunk-FKVZRPV5.js";import{d as J,e as Se,f as se,g as ie,h as le,o as Ie,q as ae}from"./chunk-Y4Q25F6X.js";import{c as be}from"./chunk-T2IE5GKA.js";import{a as u,d as z,e as ue,f as te,g as re,i as fe}from"./chunk-YKXDMIHQ.js";var He=z(te(),1),xe=z(ue(),1);var Y=z(te(),1);var X=z(ue(),1);var C=z(re(),1);var Qe=se(Oe.listTables),Ve=["react","client","cli"],Xe={action:"action",mutation:"mutation",query:"query"},_e=u(t=>{let e=t.indexOf(":");return e===-1?{file:"",fn:t}:{file:t.slice(0,e),fn:t.slice(e+1)}},"Q"),Ye=u(({file:t,fn:e,kind:a})=>`await client.${Xe[a]}(api.${t}.${e}, { /* args */ });`,"ie"),Ze=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"),et=u(({file:t,fn:e})=>`lunora run ${t}:${e} --args '{ }'`,"oe"),tt=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"),rt=u((t,e)=>{switch(t){case"cli":return et(e);case"client":return Ye(e);default:return Ze(e)}},"re"),Te=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,d;e[2]!==r?(d=(0,C.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:r}),e[2]=r,e[3]=d):d=e[3];let m=`${n}-copy`,l;e[4]!==s?(l=s("Copy"),e[4]=s,e[5]=l):l=e[5];let c;e[6]!==i||e[7]!==m||e[8]!==l?(c=(0,C.jsx)(B,{"data-testid":m,onClick:i,size:"xs",type:"button",variant:"ghost",children:l}),e[6]=i,e[7]=m,e[8]=l,e[9]=c):c=e[9];let f;e[10]!==d||e[11]!==c?(f=(0,C.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[d,c]}),e[10]=d,e[11]=c,e[12]=f):f=e[12];let h;e[13]!==a||e[14]!==n?(h=(0,C.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,C.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"),at=u(t=>{let e=(0,Y.c)(46),{file:a,fn:r,kind:n}=t,s=J(),[o,i]=(0,X.useState)("react"),d,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 T;e[14]!==j||e[15]!==O||e[16]!==S?(T={cli:j,client:O,react:S},e[14]=j,e[15]=O,e[16]=S,e[17]=T):T=e[17],l=T;let A;e[18]===Symbol.for("react.memo_cache_sentinel")?(A=u(R=>{i(R.currentTarget.dataset.tab)},"B"),e[18]=A):A=e[18],d=A,m=rt(o,w),e[0]=a,e[1]=r,e[2]=n,e[3]=s,e[4]=o,e[5]=d,e[6]=m,e[7]=l}else d=e[5],m=e[6],l=e[7];let c=m,f=`api.${a}.${r}`,h;e[19]!==f?(h=(0,C.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,C.jsx)("p",{className:"text-xs text-muted-foreground",children:g}),e[24]=g,e[25]=x):x=e[25];let y;e[26]!==h||e[27]!==x?(y=(0,C.jsxs)("div",{children:[h,x]}),e[26]=h,e[27]=x,e[28]=y):y=e[28];let N;e[29]!==s?(N=s("Snippet flavour"),e[29]=s,e[30]=N):N=e[30];let v;e[31]!==d||e[32]!==o||e[33]!==l?(v=Ve.map(w=>(0,C.jsx)(B,{"aria-selected":o===w,"data-tab":w,"data-testid":`api-tab-${w}`,onClick:d,role:"tab",size:"xs",type:"button",variant:o===w?"default":"outline",children:l[w]},w)),e[31]=d,e[32]=o,e[33]=l,e[34]=v):v=e[34];let b;e[35]!==N||e[36]!==v?(b=(0,C.jsx)("div",{"aria-label":N,className:"flex gap-1.5","data-testid":"api-tabs",role:"tablist",children:v}),e[35]=N,e[36]=v,e[37]=b):b=e[37];let I=l[o],P=`api-snippet-${o}`,$;e[38]!==c||e[39]!==I||e[40]!==P?($=(0,C.jsx)(Te,{code:c,label:I,testId:P}),e[38]=c,e[39]=I,e[40]=P,e[41]=$):$=e[41];let k;return e[42]!==$||e[43]!==y||e[44]!==b?(k=(0,C.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"api-fn-doc",children:[y,b,$]}),e[42]=$,e[43]=y,e[44]=b,e[45]=k):k=e[45],k},"de"),nt=u(t=>{let e=(0,Y.c)(19),{name:a}=t,r=J(),n;e[0]!==a?(n=tt(a),e[0]=a,e[1]=n):n=e[1];let s=n,o;e[2]!==a?(o=(0,C.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 d;e[6]!==i?(d=(0,C.jsx)("p",{className:"text-xs text-muted-foreground",children:i}),e[6]=i,e[7]=d):d=e[7];let m;e[8]!==o||e[9]!==d?(m=(0,C.jsxs)("div",{children:[o,d]}),e[8]=o,e[9]=d,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 c;e[13]!==s||e[14]!==l?(c=(0,C.jsx)(Te,{code:s,label:l,testId:"api-snippet-table"}),e[13]=s,e[14]=l,e[15]=c):c=e[15];let f;return e[16]!==m||e[17]!==c?(f=(0,C.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"api-table-doc",children:[m,c]}),e[16]=m,e[17]=c,e[18]=f):f=e[18],f},"fe"),je=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 d=i,m=a?"page":void 0,l;return e[3]!==r||e[4]!==d||e[5]!==m||e[6]!==s?(l=(0,C.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:d,type:"button",children:r}),e[3]=r,e[4]=d,e[5]=m,e[6]=s,e[7]=l):l=e[7],l},"G"),ot=u(t=>{let e=new Map;for(let a of t){let{file:r,fn:n}=_e(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"),Ce=u(t=>{let e=(0,Y.c)(58),{functions:a,initialShardKey:r}=t,n=J(),s=F(),[o,i]=(0,X.useState)(null),[d,m]=(0,X.useState)(null),l,c;e[0]!==s||e[1]!==r?(l=u(()=>{let R=!1;return s.query(Qe,{},ie(r??"")).then(_=>(R||i(_),_)).catch(()=>{R||i([])}),()=>{R=!0}},"o"),c=[s,r],e[0]=s,e[1]=r,e[2]=l,e[3]=c):(l=e[2],c=e[3]),(0,X.useEffect)(l,c);let f,h,g,x,y,N,v,b,I,P;if(e[4]!==a||e[5]!==d||e[6]!==n||e[7]!==o){let R=a??[],_=ot(R),M=(o??[]).map(st).toSorted(it),E;e[18]===Symbol.for("react.memo_cache_sentinel")?(E=u(q=>{m({kind:"fn",path:q})},"P"),e[18]=E):E=e[18];let W=E,Q;e[19]===Symbol.for("react.memo_cache_sentinel")?(Q=u(q=>{m({kind:"table",name:q})},"j"),e[19]=Q):Q=e[19];let Ge=Q;h=d?.kind==="fn"?R.find(q=>q.path===d.path):void 0,f=R.length>0||M.length>0,g=h===void 0?void 0:_e(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],y="flex flex-col gap-4 overflow-y-auto",N="api-rail";let ne;e[22]!==d||e[23]!==n?(ne=u(q=>(0,C.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,C.jsx)("span",{className:"px-2 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:q.file||n("(root)")}),q.items.map(ee=>(0,C.jsx)(je,{active:d?.kind==="fn"&&d.path===ee.path,label:ee.fn,onSelect:W,testId:`api-rail-fn-${ee.path}`,value:ee.path},ee.path))]},q.file),"q"),e[22]=d,e[23]=n,e[24]=ne):ne=e[24],v=_.map(ne),b=M.length>0&&(0,C.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,C.jsx)("span",{className:"px-2 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:n("Tables")}),M.map(q=>(0,C.jsx)(je,{active:d?.kind==="table"&&d.name===q,label:q,onSelect:Ge,testId:`api-rail-table-${q}`,value:q},q))]}),e[4]=a,e[5]=d,e[6]=n,e[7]=o,e[8]=f,e[9]=h,e[10]=g,e[11]=x,e[12]=y,e[13]=N,e[14]=v,e[15]=b,e[16]=I,e[17]=P}else f=e[8],h=e[9],g=e[10],x=e[11],y=e[12],N=e[13],v=e[14],b=e[15],I=e[16],P=e[17];let $;e[25]!==f||e[26]!==n?($=!f&&(0,C.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]!==y||e[31]!==N||e[32]!==v||e[33]!==b?(k=(0,C.jsxs)("nav",{"aria-label":x,className:y,"data-testid":N,children:[v,b,$]}),e[28]=$,e[29]=x,e[30]=y,e[31]=N,e[32]=v,e[33]=b,e[34]=k):k=e[34];let w;e[35]!==d||e[36]!==n?(w=d===null&&(0,C.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]=d,e[36]=n,e[37]=w):w=e[37];let j;e[38]!==d?.kind||e[39]!==h||e[40]!==g?(j=d?.kind==="fn"&&h!==void 0&&g!==void 0&&(0,C.jsx)(at,{file:g.file,fn:g.fn,kind:h.kind},h.path),e[38]=d?.kind,e[39]=h,e[40]=g,e[41]=j):j=e[41];let O;e[42]!==d?.kind||e[43]!==h||e[44]!==n?(O=d?.kind==="fn"&&h===void 0&&(0,C.jsx)(U,{testId:"api-empty",title:n("API usage snippets")}),e[42]=d?.kind,e[43]=h,e[44]=n,e[45]=O):O=e[45];let S;e[46]!==d?(S=d?.kind==="table"&&(0,C.jsx)(nt,{name:d.name}),e[46]=d,e[47]=S):S=e[47];let T;e[48]!==w||e[49]!==j||e[50]!==O||e[51]!==S?(T=(0,C.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]=T):T=e[52];let A;return e[53]!==k||e[54]!==T||e[55]!==I||e[56]!==P?(A=(0,C.jsxs)("div",{className:I,"data-testid":P,children:[k,T]}),e[53]=k,e[54]=T,e[55]=I,e[56]=P,e[57]=A):A=e[57],A},"ke");function st(t){return t.name}u(st,"ue");function it(t,e){return t.localeCompare(e)}u(it,"me");var De=z(te(),1);var K=z(te(),1),L=z(ue(),1);var p=z(re(),1);var pe=u(function(t,e,a){let r=(0,K.c)(10),n;r[0]===Symbol.for("react.memo_cache_sentinel")?(n={kind:"loading"},r[0]=n):n=r[0];let[s,o]=(0,L.useState)(n),i,d;r[1]!==a||r[2]!==e||r[3]!==t?(i=u(()=>{if(t!==void 0)return;let l=!1;return e().then(c=>(l||o(a(c)),c)).catch(c=>{l||o({kind:"error",message:le(c)})}),()=>{l=!0}},"a"),d=[a,e,t],r[1]=a,r[2]=e,r[3]=t,r[4]=i,r[5]=d):(i=r[4],d=r[5]),(0,L.useEffect)(i,d);let m;return r[6]!==a||r[7]!==s||r[8]!==t?(m=t===void 0?s:a(t),r[6]=a,r[7]=s,r[8]=t,r[9]=m):m=r[9],m},"kt"),lt=u(t=>typeof t=="number"?"number":typeof t=="boolean"?"boolean":"string","ke"),Ee=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","F"),dt=u(t=>{let e=Ee(t);return e!==void 0?t.type??lt(e[0]):ce(t)},"we"),ct=u(t=>{let e=Ee(t);return e===void 0?void 0:e.map(a=>JSON.stringify(a)).join(" | ")},"Oe"),pt=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"),mt=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,K.c)(7),{label:a,value:r}=t,n;e[0]!==a?(n=(0,p.jsx)("span",{className:"text-muted-foreground",children:a}),e[0]=a,e[1]=n):n=e[1];let s;e[2]!==r?(s=(0,p.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,p.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"),ut=u(t=>{let e=(0,K.c)(40),{name:a,required:r,schema:n}=t,s=J(),o;e[0]!==n?(o=pt(n),e[0]=n,e[1]=o):o=e[1];let i=o,d;e[2]!==n?(d=ct(n),e[2]=n,e[3]=d):d=e[3];let m=d,l=n["x-lunora-table"],c=n.format!==void 0||i!==void 0||m!==void 0||l!==void 0,f;e[4]!==n?(f=mt(n),e[4]=n,e[5]=f):f=e[5];let h=f,g=r?"*":"?",x;e[6]!==g?(x=(0,p.jsx)("span",{className:"text-muted-foreground",children:g}),e[6]=g,e[7]=x):x=e[7];let y;e[8]!==a||e[9]!==x?(y=(0,p.jsxs)("span",{className:"font-mono text-foreground",children:[a,x]}),e[8]=a,e[9]=x,e[10]=y):y=e[10];let N;e[11]!==n?(N=dt(n),e[11]=n,e[12]=N):N=e[12];let v;e[13]!==N?(v=(0,p.jsx)("span",{className:"font-mono text-muted-foreground",children:N}),e[13]=N,e[14]=v):v=e[14];let b;e[15]!==y||e[16]!==v?(b=(0,p.jsxs)("div",{className:"flex items-baseline gap-2",children:[y,v]}),e[15]=y,e[16]=v,e[17]=b):b=e[17];let I;e[18]!==n.description?(I=n.description!==void 0&&(0,p.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]!==c||e[21]!==i||e[22]!==l||e[23]!==n.format||e[24]!==s||e[25]!==m?(P=c&&(0,p.jsxs)("div",{className:"flex flex-wrap gap-1",children:[n.format!==void 0&&(0,p.jsx)(de,{label:s("Format"),value:n.format}),i!==void 0&&(0,p.jsx)(de,{label:s("Range"),value:i}),m!==void 0&&(0,p.jsx)(de,{label:s("Value in"),value:m}),l!==void 0&&(0,p.jsx)(de,{label:s("relation"),value:l})]}),e[20]=c,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,p.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,p.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,p.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,p.jsx)("div",{className:"mb-2 ml-2 border-l border-border pl-3",children:(0,p.jsx)(Je,{schema:h})}),e[35]=h,e[36]=j):j=e[36];let O;return e[37]!==w||e[38]!==j?(O=(0,p.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"),Je=u(t=>{let e=(0,K.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,p.jsx)("div",{className:"flex flex-col",children:o.map(d=>{let[m,l]=d;return(0,p.jsx)(ut,{name:m,required:n.has(m),schema:l},m)})}),e[4]=n,e[5]=o,e[6]=i):i=e[6],i},"Z"),Ae=u(t=>{let e=(0,K.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,p.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,p.jsx)(Je,{schema:a}),e[5]=a,e[6]=n):n=e[6];let s;return e[7]!==n||e[8]!==r?(s=(0,p.jsx)("div",{className:"text-xs","data-testid":r,children:n}),e[7]=n,e[8]=r,e[9]=s):s=e[9],s},"V"),ft=["curl","javascript","lunora"],ht={lunora:"Lunora",curl:"cURL",javascript:"JavaScript"},gt=u(t=>`api.${t.replaceAll(/[/:]/g,".")}`,"Ie"),xt=u(t=>{let e=Z(t.argsSchema)??{};return t.functionPath===void 0?e:{args:e,functionPath:t.functionPath}},"Re"),bt=u((t,e,a)=>{let r=`${a}${e.httpPath}`,n=JSON.stringify(xt(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"}(${gt(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();`}}},"je"),vt=u(t=>{let e=(0,K.c)(24),{operation:a,server:r}=t,n=J(),[s,o]=(0,L.useState)("curl"),i;e[0]!==a||e[1]!==s||e[2]!==r?(i=bt(s,a,r),e[0]=a,e[1]=s,e[2]=r,e[3]=i):i=e[3];let d=i,m;e[4]!==d?(m=u(()=>{ae(d)},"d"),e[4]=d,e[5]=m):m=e[5];let l=m,c;e[6]===Symbol.for("react.memo_cache_sentinel")?(c=u(I=>{o(I.currentTarget.dataset.sample)},"u"),e[6]=c):c=e[6];let f=c,h;e[7]!==s?(h=ft.map(I=>(0,p.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:ht[I]},I)),e[7]=s,e[8]=h):h=e[8];let g;e[9]!==h?(g=(0,p.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 y;e[13]!==l||e[14]!==x?(y=(0,p.jsx)(B,{"data-testid":"api-sample-copy",onClick:l,size:"xs",type:"button",variant:"ghost",children:x}),e[13]=l,e[14]=x,e[15]=y):y=e[15];let N;e[16]!==g||e[17]!==y?(N=(0,p.jsxs)("div",{className:"flex items-center justify-between gap-2 border-b border-border px-3 py-2",children:[g,y]}),e[16]=g,e[17]=y,e[18]=N):N=e[18];let v;e[19]!==d?(v=(0,p.jsx)("pre",{className:"overflow-auto px-3 pb-3 font-mono text-xs","data-testid":"api-sample-source",children:d}),e[19]=d,e[20]=v):v=e[20];let b;return e[21]!==N||e[22]!==v?(b=(0,p.jsxs)("div",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card","data-testid":"api-code-samples",children:[N,v]}),e[21]=N,e[22]=v,e[23]=b):b=e[23],b},"Pe"),yt={blue:"text-info",emerald:"text-success",neutral:"text-muted-foreground",orange:"text-warning",red:"text-destructive",violet:"text-royal-amethyst"},Nt=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"),kt=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,K.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?Nt(r):kt(a),d=`${yt[i]} font-mono text-[10px] tracking-wide uppercase`,m;return e[3]!==o||e[4]!==d||e[5]!==n?(m=(0,p.jsx)(ve,{className:d,"data-testid":n,variant:"ghost",children:o}),e[3]=o,e[4]=d,e[5]=n,e[6]=m):m=e[6],m},"H"),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"),Le=u(t=>t.startsWith("2")?"bg-emerald-500":t==="default"||t.startsWith("4")||t.startsWith("5")?"bg-red-500":"bg-muted-foreground","te"),wt=new Set([" ",`
|
|
13
|
+
`,"\r"]),Re=" ",St=u(t=>{let e="";for(let n of t)wt.has(n)||(e+=n);let a=0,r=e.length;for(;a<r&&(e[a]??"")<=Re;)a+=1;for(;r>a&&(e[r-1]??"")<=Re;)r-=1;return e.slice(a,r)},"Je"),It=/^(?:[a-z][\d+.a-z-]*:)?\/\//i,Ot=u((t,e)=>{let a=globalThis.location?.origin??"",r=e===""?a:e,n=St(t);if(r===""){if(It.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"),$t=u(async(t,e,a,r)=>{let n=t.method!=="GET"&&t.method!=="HEAD",s=Ot(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}},"Fe"),Pt=u(t=>JSON.stringify(Z(t.argsSchema)??{},void 0,2),"ze"),qe=(0,L.createContext)(null),Ke=u(()=>{let t=(0,L.use)(qe);if(t===null)throw new be("INTERNAL","useOperationRun must be used within an OperationRunProvider");return t},"se"),jt=u(({children:t,operation:e})=>{let a=J(),r=F(),[n,s]=(0,L.useState)(()=>Pt(e)),[o,i]=(0,L.useState)(""),[d,m]=(0,L.useState)("idle"),[l,c]=(0,L.useState)(void 0),[f,h]=(0,L.useState)(null),[g,x]=(0,L.useState)(null),y=u(async()=>{let N;try{N=n.trim()===""?{}:JSON.parse(n)}catch(b){m("error"),c(void 0),x(null),h(a("Invalid JSON args: {message}",{message:le(b)}));return}m("running"),h(null);let v=performance.now();try{let b=await(e.functionPath===void 0?$t(e,N,r.url,r.getAuthToken()):Se(r,e.kind,se(e.functionPath),N,ie(o)));c(b),x(Math.round(performance.now()-v)),m("success")}catch(b){c(void 0),x(Math.round(performance.now()-v)),h(le(b)),m("error")}},"y");return(0,p.jsx)(qe,{value:{argsText:n,durationMs:g,error:f,operation:e,response:l,send:u(()=>{Ie(y())},"send"),setArgsText:s,setShardKey:i,shardKey:o,status:d},children:t})},"We"),_t=u(()=>{let t=(0,K.c)(48),e=J(),{argsText:a,operation:r,send:n,setArgsText:s,setShardKey:o,shardKey:i,status:d}=Ke(),m;t[0]!==s?(m=u(_=>{s(_.target.value)},"d"),t[0]=s,t[1]=m):m=t[1];let l=m,c;t[2]!==n?(c=u(_=>{_.key==="Enter"&&(_.metaKey||_.ctrlKey)&&(_.preventDefault(),n())},"u"),t[2]=n,t[3]=c):c=t[3];let f=c,h=d==="running",g;t[4]!==r.kind||t[5]!==r.method?(g=(0,p.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,y;t[7]!==x?(y=(0,p.jsx)("code",{className:"min-w-0 flex-1 truncate font-mono text-xs text-foreground",children:x}),t[7]=x,t[8]=y):y=t[8];let N=h?"animate-pulse":void 0,v;t[9]!==N?(v=(0,p.jsx)(oe,{className:N,icon:we,strokeWidth:2}),t[9]=N,t[10]=v):v=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]!==v||t[17]!==b?(I=(0,p.jsxs)(B,{"data-testid":"api-try-send",disabled:h,onClick:n,size:"sm",type:"button",children:[v,b]}),t[14]=h,t[15]=n,t[16]=v,t[17]=b,t[18]=I):I=t[18];let P;t[19]!==g||t[20]!==y||t[21]!==I?(P=(0,p.jsxs)("div",{className:"flex items-center gap-2 border-b border-border bg-muted px-3 py-2",children:[g,y,I]}),t[19]=g,t[20]=y,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,p.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,p.jsx)(Pe,{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,p.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 T;t[37]!==r.functionPath||t[38]!==o||t[39]!==i||t[40]!==e?(T=r.functionPath!==void 0&&(0,p.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,p.jsx)(he,{htmlFor:"shard-input",children:e("Shard key (optional)")}),(0,p.jsx)($e,{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]=T):T=t[41];let A;t[42]!==S||t[43]!==T?(A=(0,p.jsxs)("div",{className:"flex flex-col gap-3 p-3",children:[S,T]}),t[42]=S,t[43]=T,t[44]=A):A=t[44];let R;return t[45]!==A||t[46]!==P?(R=(0,p.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]=R):R=t[47],R},"qe"),Tt=u(t=>{let e=(0,K.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,p.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,d;e[3]!==i?(d=(0,p.jsx)("code",{className:"truncate font-mono text-xs text-muted-foreground",children:i}),e[3]=i,e[4]=d):d=e[4];let m;e[5]!==o||e[6]!==d?(m=(0,p.jsxs)("div",{className:"flex items-center gap-2",children:[o,d]}),e[5]=o,e[6]=d,e[7]=m):m=e[7];let l;e[8]!==a.title?(l=(0,p.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 c;e[10]!==a.description?(c=a.description!==void 0&&(0,p.jsx)("p",{className:"text-sm text-muted-foreground",children:a.description}),e[10]=a.description,e[11]=c):c=e[11];let f;e[12]!==m||e[13]!==l||e[14]!==c?(f=(0,p.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,c]}),e[12]=m,e[13]=l,e[14]=c,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,p.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,p.jsx)(_t,{}),e[20]=x):x=e[20];let y;e[21]!==g?(y=(0,p.jsxs)("section",{className:"flex flex-col gap-2",children:[g,x]}),e[21]=g,e[22]=y):y=e[22];let N;e[23]!==r?(N=r("Request arguments"),e[23]=r,e[24]=N):N=e[24];let v;e[25]!==N?(v=(0,p.jsx)("h2",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:N}),e[25]=N,e[26]=v):v=e[26];let b;e[27]!==a.argsSchema?(b=(0,p.jsx)(Ae,{schema:a.argsSchema,testId:"api-operation-args"}),e[27]=a.argsSchema,e[28]=b):b=e[28];let I;e[29]!==v||e[30]!==b?(I=(0,p.jsxs)("section",{className:"flex flex-col gap-2",children:[v,b]}),e[29]=v,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,p.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,p.jsxs)("div",{className:"flex flex-col gap-1.5 rounded-xl border border-border bg-card p-3",children:[(0,p.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,p.jsxs)("span",{className:`inline-flex items-center gap-1.5 font-mono text-xs font-semibold ${Me(S.status)}`,children:[(0,p.jsx)("span",{className:`size-1.5 rounded-full ${Le(S.status)}`}),S.status]}),S.schema!==void 0&&(0,p.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,p.jsx)("p",{className:"text-xs text-muted-foreground",children:S.description}),S.schema!==void 0&&(0,p.jsx)(Ae,{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,p.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]!==y||e[47]!==I||e[48]!==w||e[49]!==f?(j=(0,p.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,y,I,w]},s),e[44]=a.key,e[45]=n,e[46]=y,e[47]=I,e[48]=w,e[49]=f,e[50]=j):j=e[50],j},"He"),Ct={boolean:"text-royal-amethyst",key:"text-sky-sapphire",number:"text-warning",plain:"",string:"text-success"},At=/"(?:[^"\\]|\\.)*"|\b(?:true|false|null)\b|-?\d+(?:\.\d+)?/g,Rt=/^\s*:/,Et=u((t,e,a)=>a.startsWith('"')?Rt.test(t.slice(e))?"key":"string":a==="true"||a==="false"||a==="null"?"boolean":"number","Xe"),Jt=u(t=>{let e=[],a=0;for(let r of t.matchAll(At)){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:Et(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,K.c)(4),{code:a}=t,r;e[0]!==a?(r=Jt(a).map(Lt),e[0]=a,e[1]=r):r=e[1];let n;return e[2]!==r?(n=(0,p.jsx)(p.Fragment,{children:r}),e[2]=r,e[3]=n):n=e[3],n},"Qe");function Lt(t){return(0,p.jsx)("span",{className:Ct[t.kind],children:t.text},t.start)}u(Lt,"Ze");var ze="__live__",qt=u(t=>t.schema===void 0?"":JSON.stringify(Z(t.schema),void 0,2),"et"),Kt=u((t,e,a)=>a?t??"":e===void 0?"":JSON.stringify(e,void 0,2),"tt"),zt=u(t=>{let e=(0,K.c)(18),{active:a,running:r,showError:n}=t,s=J();if(r){let c;e[0]!==s?(c=s("Sending\u2026"),e[0]=s,e[1]=c):c=e[1];let f;return e[2]!==c?(f=(0,p.jsx)("p",{className:"px-3 py-3 text-xs text-muted-foreground","data-testid":"api-response-running",children:c}),e[2]=c,e[3]=f):f=e[3],f}if(a===void 0||a.body===""){let c;e[4]!==a?.live||e[5]!==s?(c=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]=c):c=e[6];let f;return e[7]!==c?(f=(0,p.jsx)("p",{className:"px-3 py-3 text-xs text-muted-foreground","data-testid":"api-response-idle",children:c}),e[7]=c,e[8]=f):f=e[8],f}let o=n&&"text-destructive",i;e[9]!==o?(i=fe("max-h-[28rem] overflow-auto px-3 py-3 font-mono text-xs",o),e[9]=o,e[10]=i):i=e[10];let d=n?"api-response-error":"api-response-body",m;e[11]!==a.body||e[12]!==n?(m=n?a.body:(0,p.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]!==d||e[16]!==m?(l=(0,p.jsx)("pre",{className:i,"data-testid":d,children:m}),e[14]=i,e[15]=d,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(d=>({body:qt(d),durationMs:null,id:d.status,label:d.status,live:!1,status:d.status}));return n?[{body:Kt(e,s,a),durationMs:t,id:ze,label:o("Live"),live:!0,status:a?"error":"200"},...i]:i},"st"),Wt=u(()=>{let t=(0,K.c)(19),e=J(),{durationMs:a,error:r,operation:n,response:s,status:o}=Ke(),i=o==="running",d=o==="error",m=o==="success"||d,l=Dt({durationMs:a,error:r,failed:d,operation:n,ran:m,response:s,t:e}),c=m?ze:l.find(Bt)?.id??l[0]?.id??"",[f,h]=(0,L.useState)(null),g=l.find(_=>_.id===(f??c))??l[0],x;t[0]===Symbol.for("react.memo_cache_sentinel")?(x=u(_=>{let{id:M}=_.currentTarget.dataset;M!==void 0&&h(M)},"p"),t[0]=x):x=t[0];let y=x,N=u(()=>{g!==void 0&&ae(g.body)},"k"),v=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,p.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:$}),t[3]=$,t[4]=k):k=t[4];let w=v!==null&&(0,p.jsx)("span",{className:"font-mono text-[10px] text-muted-foreground",children:e("{ms} ms",{ms:v})}),j=g!==void 0&&g.body!==""&&(0,p.jsx)(B,{"aria-label":e("Copy"),"data-testid":"api-response-copy",onClick:N,size:"icon-xs",type:"button",variant:"ghost",children:(0,p.jsx)(oe,{icon:Ne,strokeWidth:2})}),O;t[5]!==w||t[6]!==j?(O=(0,p.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,p.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 T=l.length>0&&(0,p.jsx)("div",{className:"flex gap-1 overflow-x-auto border-b border-border px-2 py-1.5",role:"tablist",children:l.map(_=>{let M=_.id===g?.id;return(0,p.jsxs)("button",{"aria-selected":M,className:fe("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",M?Me(_.status):"text-muted-foreground"),"data-id":_.id,"data-testid":_.live?"api-response-tab-live":`api-response-tab-${_.status}`,onClick:y,role:"tab",type:"button",children:[(0,p.jsx)("span",{className:`size-1.5 rounded-full ${Le(_.status)}`}),_.label]},_.id)})}),A;t[11]!==g||t[12]!==i||t[13]!==b?(A=(0,p.jsx)(zt,{active:g,running:i,showError:b}),t[11]=g,t[12]=i,t[13]=b,t[14]=A):A=t[14];let R;return t[15]!==A||t[16]!==S||t[17]!==T?(R=(0,p.jsxs)("div",{className:I,"data-testid":P,children:[S,T,A]}),t[15]=A,t[16]=S,t[17]=T,t[18]=R):R=t[18],R},"nt");function Bt(t){return t.status.startsWith("2")}u(Bt,"ot");var Ut=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"),me=u(t=>{let e=(0,K.c)(53),{model:a}=t,r=J(),n=a.groups[0]?.operations[0]?.key??"",[s,o]=(0,L.useState)(n),[i,d]=(0,L.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,c,f,h,g,x,y,N,v,b,I;if(e[4]!==i||e[5]!==a.groups||e[6]!==a.server||e[7]!==l?.key||e[8]!==r){c=Ut(a.groups,i);let O;e[19]===Symbol.for("react.memo_cache_sentinel")?(O=u(E=>{let{key:W}=E.currentTarget.dataset;W!==void 0&&o(W)},"E"),e[19]=O):O=e[19];let S=O,T;e[20]===Symbol.for("react.memo_cache_sentinel")?(T=u(E=>{d(E.target.value)},"I"),e[20]=T):T=e[20];let A=T;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],y="flex min-h-0 flex-col overflow-y-auto border-r border-border",N="api-reference-nav";let R;e[23]===Symbol.for("react.memo_cache_sentinel")?(R=(0,p.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]=R):R=e[23];let _;e[24]!==r?(_=r("Filter operations"),e[24]=r,e[25]=_):_=e[25],e[26]!==i||e[27]!==_?(v=(0,p.jsx)("div",{className:"sticky top-0 z-10 border-b border-border bg-sidebar p-2",children:(0,p.jsxs)("div",{className:"relative",children:[R,(0,p.jsx)(ye,{className:"h-7 pl-7","data-testid":"api-filter",onChange:A,placeholder:_,value:i})]})}),e[26]=i,e[27]=_,e[28]=v):v=e[28],h="flex flex-col gap-4 p-2";let M;e[29]!==l?.key||e[30]!==r?(M=u(E=>(0,p.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,p.jsxs)("div",{className:"flex items-center justify-between px-2",children:[(0,p.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:E.name||r("(root)")}),(0,p.jsx)("span",{className:"font-mono text-[10px] text-muted-foreground/70",children:E.operations.length})]}),E.operations.map(W=>{let Q=W.key===l?.key;return(0,p.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":W.key,"data-testid":`api-nav-${W.operationId}`,onClick:S,type:"button",children:[(0,p.jsx)("span",{className:"truncate",children:W.summary}),(0,p.jsx)(ge,{kind:W.kind,method:W.method})]},W.key)})]},E.name),"_"),e[29]=l?.key,e[30]=r,e[31]=M):M=e[31],g=c.map(M),e[4]=i,e[5]=a.groups,e[6]=a.server,e[7]=l?.key,e[8]=r,e[9]=c,e[10]=f,e[11]=h,e[12]=g,e[13]=x,e[14]=y,e[15]=N,e[16]=v,e[17]=b,e[18]=I}else c=e[9],f=e[10],h=e[11],g=e[12],x=e[13],y=e[14],N=e[15],v=e[16],b=e[17],I=e[18];let P;e[32]!==c.length||e[33]!==r?(P=c.length===0&&(0,p.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]=c.length,e[33]=r,e[34]=P):P=e[34];let $;e[35]!==P||e[36]!==h||e[37]!==g?($=(0,p.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]!==y||e[42]!==N||e[43]!==v?(k=(0,p.jsxs)("nav",{"aria-label":x,className:y,"data-testid":N,children:[v,$]}),e[39]=$,e[40]=x,e[41]=y,e[42]=N,e[43]=v,e[44]=k):k=e[44];let w;e[45]!==l||e[46]!==f?(w=l===void 0?(0,p.jsx)("div",{className:"lg:col-span-2"}):(0,p.jsxs)(jt,{operation:l,children:[(0,p.jsx)("div",{className:"min-w-0 overflow-y-auto p-6","data-testid":"api-reference-main",children:(0,p.jsx)(Tt,{operation:l})}),(0,p.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,p.jsx)(vt,{operation:l,server:f}),(0,p.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,p.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=z(re(),1);var Ft=["get","post","put","patch","delete","head","options","trace"],We=u(t=>t?.content?.["application/json"]?.schema,"y"),Ht=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"),Gt=u((t,e,a,r,n)=>{let s=We(r.requestBody),o=s?.properties?.functionPath?.const,i=typeof o=="string"?o:void 0,d=i===void 0?s:s?.properties?.args,m=r.operationId??`${a} ${e}`;return{argsSchema:d,description:r.description,functionPath:i,httpPath:e,key:t,kind:r["x-lunora-function-kind"],method:a.toUpperCase(),operationId:m,requestSchema:s,responses:Ht(r,n),summary:r.summary??m,tags:r.tags??[],title:r.summary??m}},"b"),Qt=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 Ft){let o=r[s];o!==void 0&&e.push(Gt(a,n,s,o,t))}}return e},"x"),Vt=u(t=>{let e=t??{},a=Qt(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 d=a.filter(m=>(m.tags[0]??"")===i);d.length>0&&s.push({description:r.get(i),name:i,operations:d})},"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"),Xt=u(t=>{let{paths:e}=t;return e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0},"R"),Yt=u(t=>{let e=t;return Xt(e)?{kind:"empty"}:{kind:"ready",spec:e}},"T"),Be=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=pe(a,s,Yt),i;e[2]!==o.kind||e[3]!==o.spec?(i=o.kind==="ready"?Vt(o.spec):void 0,e[2]=o.kind,e[3]=o.spec,e[4]=i):i=e[4];let d=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 c;e[9]!==r?(c=r("API reference unavailable"),e[9]=r,e[10]=c):c=e[10];let f;return e[11]!==l||e[12]!==c?(f=(0,H.jsx)(U,{description:l,testId:"api-reference-error",title:c}),e[11]=l,e[12]=c,e[13]=f):f=e[13],f}if(o.kind==="empty"||d===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 c;e[16]!==r?(c=r("No OpenAPI spec configured"),e[16]=r,e[17]=c):c=e[17];let f;return e[18]!==l||e[19]!==c?(f=(0,H.jsx)(U,{description:l,testId:"api-reference-empty",title:c}),e[18]=l,e[19]=c,e[20]=f):f=e[20],f}let m;return e[21]!==d?(m=(0,H.jsx)(me,{model:d}),e[21]=d,e[22]=m):m=e[22],m},"B");var Ue=z(te(),1);var G=z(re(),1);var Zt=u(t=>(t.params??[]).find(e=>e.name==="args")??(t.params??[])[0],"x"),er=u(t=>t["x-tags"]?.[0]?.name??(t.name.includes(":")?t.name.slice(0,t.name.indexOf(":")):""),"v"),tr=u(t=>{let e=Zt(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:[er(t)],title:t.summary??t.name}},"w"),rr=u(t=>{let e=t??{},a=(e.methods??[]).map(n=>tr(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"),ar=u(t=>t.methods===void 0||t.methods.length===0,"C"),nr=u(t=>{let e=t;return ar(e)?{kind:"empty"}:{kind:"ready",spec:e}},"N"),Fe=u(t=>{let e=(0,Ue.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=pe(a,s,nr),i;e[2]!==o.kind||e[3]!==o.spec?(i=o.kind==="ready"?rr(o.spec):void 0,e[2]=o.kind,e[3]=o.spec,e[4]=i):i=e[4];let d=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 c;e[9]!==r?(c=r("API reference unavailable"),e[9]=r,e[10]=c):c=e[10];let f;return e[11]!==l||e[12]!==c?(f=(0,G.jsx)(U,{description:l,testId:"openrpc-reference-error",title:c}),e[11]=l,e[12]=c,e[13]=f):f=e[13],f}if(o.kind==="empty"||d===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 c;e[16]!==r?(c=r("No OpenRPC spec configured"),e[16]=r,e[17]=c):c=e[17];let f;return e[18]!==l||e[19]!==c?(f=(0,G.jsx)(U,{description:l,testId:"openrpc-reference-empty",title:c}),e[18]=l,e[19]=c,e[20]=f):f=e[20],f}let m;return e[21]!==d?(m=(0,G.jsx)(me,{model:d}),e[21]=d,e[22]=m):m=e[22],m},"T");var D=z(re(),1);var or=["reference","snippets"],sr=["openapi","openrpc"],Qr=u(t=>{let e=(0,He.c)(51),{functions:a,initialShardKey:r,openApiSpec:n,openRpcSpec:s}=t,o=J(),[i,d]=(0,xe.useState)("reference"),[m,l]=(0,xe.useState)("openapi"),c;e[0]!==o?(c=o("Reference"),e[0]=o,e[1]=c):c=e[1];let f;e[2]!==o?(f=o("Snippets"),e[2]=o,e[3]=f):f=e[3];let h;e[4]!==c||e[5]!==f?(h={reference:c,snippets:f},e[4]=c,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 y;e[9]!==o?(y=o("OpenRPC"),e[9]=o,e[10]=y):y=e[10];let N;e[11]!==x||e[12]!==y?(N={openapi:x,openrpc:y},e[11]=x,e[12]=y,e[13]=N):N=e[13];let v=N,b;e[14]===Symbol.for("react.memo_cache_sentinel")?(b=u(E=>{d(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=or.map(E=>(0,D.jsx)(B,{"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,D.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]!==v||e[26]!==o||e[27]!==i?(O=i==="reference"&&(0,D.jsx)("div",{"aria-label":o("API spec format"),className:"flex gap-1.5","data-testid":"api-format-toggle",role:"tablist",children:sr.map(E=>(0,D.jsx)(B,{"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:v[E]},E))}),e[24]=m,e[25]=v,e[26]=o,e[27]=i,e[28]=O):O=e[28];let S;e[29]!==j||e[30]!==O?(S=(0,D.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 T;e[32]!==a||e[33]!==r||e[34]!==i?(T=i==="snippets"&&(0,D.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto p-6",children:(0,D.jsx)(Ce,{functions:a,initialShardKey:r})}),e[32]=a,e[33]=r,e[34]=i,e[35]=T):T=e[35];let A;e[36]!==m||e[37]!==n||e[38]!==i?(A=i==="reference"&&m==="openapi"&&(0,D.jsx)(Be,{spec:n}),e[36]=m,e[37]=n,e[38]=i,e[39]=A):A=e[39];let R;e[40]!==m||e[41]!==s||e[42]!==i?(R=i==="reference"&&m==="openrpc"&&(0,D.jsx)(Fe,{spec:s}),e[40]=m,e[41]=s,e[42]=i,e[43]=R):R=e[43];let _;e[44]!==T||e[45]!==A||e[46]!==R?(_=(0,D.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[T,A,R]}),e[44]=T,e[45]=A,e[46]=R,e[47]=_):_=e[47];let M;return e[48]!==S||e[49]!==_?(M=(0,D.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col","data-testid":"lunora-api-tab",children:[S,_]}),e[48]=S,e[49]=_,e[50]=M):M=e[50],M},"k");export{Qr as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as N}from"./chunk-JAZCU2PP.js";import{a as v,b as w,c as y,d,e as c,f as i}from"./chunk-HEAQVSNS.js";import{a as x,e as b}from"./chunk-WUWBZPUK.js";import{d as h}from"./chunk-Y4Q25F6X.js";import{a,d as p,e as I,g as R,i as g}from"./chunk-YKXDMIHQ.js";var $=p(I(),1);var e=p(R(),1);var A={ERROR:"error",INFO:"info",WARN:"warning"},q=a(r=>{let n=typeof r.metadata.table=="string"?r.metadata.table:void 0;return{description:`${r.detail} ${r.remediation}`,entity:n,issueType:r.title,key:r.cacheKey,level:A[r.level]}},"z"),C=["error","warning","info"],O={error:"bg-destructive",info:"bg-info",warning:"bg-warning"},S=a((r,n)=>({error:r("Errors"),info:r("Info"),warning:r("Warnings")})[n],"$"),j=a((r,n,o)=>({error:r("{count} errors",{count:o}),info:r("{count} suggestions",{count:o}),warning:r("{count} warnings",{count:o})})[n],"k"),z=a((r,n)=>({error:r("No errors detected"),info:r("No suggestions"),warning:r("No warnings detected")})[n],"V"),F=a(r=>{let n={error:0,info:0,warning:0};for(let o of r??[])n[o.level]+=1;return n},"O"),B=a(({error:r=null,errorSource:n,rows:o,testId:l,toolbar:f})=>{let s=h(),[m,k]=(0,$.useState)("error"),T=F(o),u=(o??[]).filter(t=>t.level===m),E=a(t=>{k(t.currentTarget.dataset.level)},"h");return(0,e.jsxs)("div",{className:"flex flex-col gap-3","data-testid":l,children:[(0,e.jsx)("div",{className:"flex border-b border-border",role:"tablist",children:C.map(t=>(0,e.jsxs)("button",{"aria-selected":m===t,className:"flex min-w-32 flex-col gap-0.5 border-b-2 border-transparent px-4 py-2 text-start outline-none transition-colors hover:bg-muted/40 focus-visible:bg-muted/40 aria-selected:border-foreground","data-level":t,"data-testid":`${l}-tab-${t}`,onClick:E,role:"tab",type:"button",children:[(0,e.jsxs)("span",{className:"flex items-center gap-2 text-sm font-medium text-foreground",children:[(0,e.jsx)("span",{"aria-hidden":"true",className:g("size-2 rounded-sm",O[t])}),S(s,t)]}),(0,e.jsx)("span",{className:"ps-4 text-xs text-muted-foreground",children:j(s,t,T[t])})]},t))}),f!==void 0&&(0,e.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:f}),r!==null&&(0,e.jsx)(N,{error:n??r,testId:`${l}-error`}),(0,e.jsx)(x,{className:"overflow-hidden py-0",children:(0,e.jsx)(b,{className:"px-0",children:(0,e.jsxs)(v,{children:[(0,e.jsx)(w,{children:(0,e.jsxs)(d,{children:[(0,e.jsx)(c,{children:s("Issue type")}),(0,e.jsx)(c,{children:s("Entity/item")}),(0,e.jsx)(c,{children:s("Description")})]})}),(0,e.jsx)(y,{children:u.length===0?(0,e.jsx)(d,{children:(0,e.jsxs)(i,{className:"h-40 text-center align-middle text-muted-foreground",colSpan:3,"data-testid":`${l}-empty`,children:[(0,e.jsx)("span",{className:"block text-sm font-medium text-foreground",children:z(s,m)}),(0,e.jsx)("span",{className:"block text-sm",children:s("Nothing to report for this deployment.")})]})}):u.map(t=>(0,e.jsxs)(d,{children:[(0,e.jsx)(i,{className:"font-medium text-foreground",children:t.issueType}),(0,e.jsx)(i,{className:"font-mono text-xs text-muted-foreground",children:t.entity??"\u2014"}),(0,e.jsxs)(i,{className:"text-muted-foreground",children:[(0,e.jsx)("span",{children:t.description}),t.action!==void 0&&(0,e.jsx)("span",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:t.action})]})]},t.key))})]})})})]})},"F");export{q as a,B as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as Be,b as Ue,c as We,d as De,e as we}from"./chunk-YEBHHIAY.js";import"./chunk-I52I2DJG.js";import"./chunk-TWTNWOJU.js";import{a as Ve}from"./chunk-NBC6NJFJ.js";import{a as qe}from"./chunk-7QRRR3K6.js";import"./chunk-C3TOZ4LG.js";import"./chunk-D27D4UUI.js";import"./chunk-SB35BJ7A.js";import"./chunk-FO26ZU7E.js";import{a as Le}from"./chunk-S3CRZLGS.js";import{a as _e}from"./chunk-IFLTA2OD.js";import"./chunk-OGUKYRFM.js";import"./chunk-OKG3HWSJ.js";import{P as ke}from"./chunk-46ZJ3TM4.js";import"./chunk-Y6CXU7T4.js";import"./chunk-4L4WTGN5.js";import{a as ie}from"./chunk-EBWXFG4H.js";import"./chunk-TGHH7ZFA.js";import"./chunk-5GFSKIB2.js";import{b as me}from"./chunk-NCCAMFB6.js";import"./chunk-25NFR6EB.js";import"./chunk-35DM4JJG.js";import{a as U}from"./chunk-CXNZVJ3S.js";import{c as Ee}from"./chunk-ECQTVV2J.js";import{f as Ne}from"./chunk-JBIN7W2B.js";import"./chunk-FSRSK4LY.js";import{a as Ae}from"./chunk-FKVZRPV5.js";import{a as ze,b as Re,c as je,d as pe,e as B,f as z}from"./chunk-HEAQVSNS.js";import{a as Me,e as Ce}from"./chunk-WUWBZPUK.js";import{d as ue,f as re,g as be,h as Ke,o as le,r as Te}from"./chunk-Y4Q25F6X.js";import{a as Ie,b as $e}from"./chunk-T2IE5GKA.js";import{a as d,d as ye,e as Oe,f as Ge,g as He}from"./chunk-YKXDMIHQ.js";var ge=ye(Ge(),1);var ne=ye(Oe(),1);var t=ye(He(),1);var Se="none",Je=["all","open","resolved","ignored"],Pe=["critical","high","medium","low"],Qe=re(U.resolveIssue),Xe=re(U.ignoreIssue),Fe=re(U.assignIssue),Ye=re(U.setIssueSeverity),Ze=re(U.explainIssue),es=d(n=>Array.isArray(n?.issues)?n.issues:[],"Xe"),ss=d(n=>n==="resolved"?"success":n==="ignored"?"secondary":"warning","Je"),ts=d(n=>n==="critical"?"destructive":n==="high"?"warning":n==="medium"?"info":"secondary","Ze"),as=d(n=>{let e=(0,ge.c)(44),{expanded:u,issue:s,shardKey:$}=n,i=Ne(),l=ue(),[a,o]=(0,ne.useState)(void 0),{busy:_,error:A,run:R}=Ve(),K;e[0]!==i||e[1]!==s||e[2]!==R||e[3]!==$?(K=d(()=>{o(void 0),R(async()=>{let g={culprit:s.culprit,sampleMessage:s.sampleMessage,title:s.title},I=await i.query(Ze,g,be($));o(I)})},"C"),e[0]=i,e[1]=s,e[2]=R,e[3]=$,e[4]=K):K=e[4];let L=K;if(!u)return null;let k;if(e[5]!==s.sampleMessage){let g=$e(s.sampleMessage);k=g===void 0?void 0:Ie(g.body),e[5]=s.sampleMessage,e[6]=k}else k=e[6];let T=k,E=`issues-detail-${s.hash}`,h;e[7]!==s.sampleMessage?(h=(0,t.jsx)("p",{className:"whitespace-pre-wrap font-mono text-xs text-muted-foreground",children:s.sampleMessage}),e[7]=s.sampleMessage,e[8]=h):h=e[8];let x;e[9]!==l?(x=l("Suggested fix"),e[9]=l,e[10]=x):x=e[10];let M;e[11]!==x?(M=(0,t.jsx)("div",{className:"text-xs font-medium text-muted-foreground",children:x}),e[11]=x,e[12]=M):M=e[12];let v;e[13]!==T||e[14]!==s.hash||e[15]!==l?(v=T===void 0?(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground","data-testid":`issues-hint-empty-${s.hash}`,children:l("No known fix for this error yet.")}):(0,t.jsx)("p",{className:"mt-1 whitespace-pre-wrap text-sm","data-testid":`issues-hint-${s.hash}`,children:T}),e[13]=T,e[14]=s.hash,e[15]=l,e[16]=v):v=e[16];let y;e[17]!==M||e[18]!==v?(y=(0,t.jsxs)("div",{children:[M,v]}),e[17]=M,e[18]=v,e[19]=y):y=e[19];let b=`issues-explain-${s.hash}`,w;e[20]!==_||e[21]!==l?(w=l(_?"Explaining\u2026":"Explain in plain language"),e[20]=_,e[21]=l,e[22]=w):w=e[22];let m;e[23]!==_||e[24]!==L||e[25]!==w||e[26]!==b?(m=(0,t.jsx)("div",{children:(0,t.jsx)(ie,{"data-testid":b,disabled:_,onClick:L,size:"sm",type:"button",variant:"outline",children:w})}),e[23]=_,e[24]=L,e[25]=w,e[26]=b,e[27]=m):m=e[27];let f;e[28]!==A||e[29]!==s.hash?(f=A!==null&&(0,t.jsx)("p",{className:"text-xs text-destructive","data-testid":`issues-explain-error-${s.hash}`,role:"alert",children:A}),e[28]=A,e[29]=s.hash,e[30]=f):f=e[30];let p;e[31]!==a||e[32]!==s.hash||e[33]!==l?(p=a!==void 0&&(a.degraded?(0,t.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":`issues-degraded-${s.hash}`,children:a.reason==="no-ai-binding"?l("No AI binding is configured. Wire an AI binding to enable plain-language explanations \u2014 the suggested fix above is always available."):l("The AI model could not explain this error right now. The suggested fix above still applies.")}):(0,t.jsxs)("div",{"data-testid":`issues-explanation-${s.hash}`,children:[(0,t.jsx)("div",{className:"text-xs font-medium text-muted-foreground",children:l("AI explanation")}),(0,t.jsx)("p",{className:"mt-1 whitespace-pre-wrap text-sm",children:a.explanation}),a.groundedId===void 0&&(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground","data-testid":`issues-ungrounded-${s.hash}`,children:l("No catalog fix matched this error, so this explanation is the model's own reading of the message. Verify before acting on it.")}),(0,t.jsx)("p",{className:"mt-1 text-[0.7rem] text-muted-foreground",children:l("Generated by {model}",{model:a.model})})]})),e[31]=a,e[32]=s.hash,e[33]=l,e[34]=p):p=e[34];let c;e[35]!==m||e[36]!==f||e[37]!==p||e[38]!==h||e[39]!==y?(c=(0,t.jsx)(z,{className:"bg-muted/30",colSpan:7,children:(0,t.jsxs)("div",{className:"flex flex-col gap-3 py-1",children:[h,y,m,f,p]})}),e[35]=m,e[36]=f,e[37]=p,e[38]=h,e[39]=y,e[40]=c):c=e[40];let S;return e[41]!==c||e[42]!==E?(S=(0,t.jsx)(pe,{"data-testid":E,children:c}),e[41]=c,e[42]=E,e[43]=S):S=e[43],S},"et"),is=d(n=>{let e=(0,ge.c)(119),{busy:u,issue:s,rowError:$,runTriage:i,shardKey:l}=n,a=ue(),[o,_]=(0,ne.useState)(!1),A;e[0]===Symbol.for("react.memo_cache_sentinel")?(A=d(()=>{_(rs)},"A"),e[0]=A):A=e[0];let R=A,K;e[1]!==s.hash||e[2]!==i?(K=d(ae=>{let ce=ae===null||ae===Se?null:ae;le(i(s.hash,Ye,{severity:ce}))},"C"),e[1]=s.hash,e[2]=i,e[3]=K):K=e[3];let L=K,k;e[4]!==s.hash||e[5]!==i?(k=d(ae=>{if(ae.key!=="Enter")return;let ce=ae.currentTarget.value.trim();le(i(s.hash,Fe,{assignee:ce===""?null:ce}))},"T"),e[4]=s.hash,e[5]=i,e[6]=k):k=e[6];let T=k,E=`issues-row-${s.hash}`,h;e[7]!==a?(h=a("Toggle issue details"),e[7]=a,e[8]=h):h=e[8];let x=`issues-toggle-${s.hash}`,M=`mt-1 size-3 shrink-0 text-muted-foreground transition-transform ${o?"rotate-90":""}`,v;e[9]===Symbol.for("react.memo_cache_sentinel")?(v=(0,t.jsx)("path",{d:"m9 6 6 6-6 6"}),e[9]=v):v=e[9];let y;e[10]!==M?(y=(0,t.jsx)("svg",{"aria-hidden":"true",className:M,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",children:v}),e[10]=M,e[11]=y):y=e[11];let b;e[12]!==s.title?(b=(0,t.jsx)("span",{className:"block truncate font-medium",title:s.title,children:s.title}),e[12]=s.title,e[13]=b):b=e[13];let w;e[14]!==s.culprit?(w=(0,t.jsx)("span",{className:"block truncate font-mono text-xs text-muted-foreground",title:s.culprit,children:s.culprit}),e[14]=s.culprit,e[15]=w):w=e[15];let m;e[16]!==b||e[17]!==w?(m=(0,t.jsxs)("span",{className:"min-w-0",children:[b,w]}),e[16]=b,e[17]=w,e[18]=m):m=e[18];let f;e[19]!==o||e[20]!==m||e[21]!==h||e[22]!==x||e[23]!==y?(f=(0,t.jsxs)("button",{"aria-expanded":o,"aria-label":h,className:"flex w-full items-start gap-2 text-left","data-testid":x,onClick:R,type:"button",children:[y,m]}),e[19]=o,e[20]=m,e[21]=h,e[22]=x,e[23]=y,e[24]=f):f=e[24];let p;e[25]!==s.hash||e[26]!==$?(p=$!==void 0&&(0,t.jsx)("p",{className:"mt-1 text-xs text-destructive","data-testid":`issues-action-error-${s.hash}`,role:"alert",children:$}),e[25]=s.hash,e[26]=$,e[27]=p):p=e[27];let c;e[28]!==f||e[29]!==p?(c=(0,t.jsxs)(z,{className:"max-w-80",children:[f,p]}),e[28]=f,e[29]=p,e[30]=c):c=e[30];let S=`issues-status-${s.hash}`,g;e[31]!==s.status?(g=ss(s.status),e[31]=s.status,e[32]=g):g=e[32];let I;e[33]!==s.status||e[34]!==S||e[35]!==g?(I=(0,t.jsx)(z,{children:(0,t.jsx)(me,{"data-testid":S,variant:g,children:s.status})}),e[33]=s.status,e[34]=S,e[35]=g,e[36]=I):I=e[36];let j=s.severity??Se,r;e[37]!==a?(r=a("Set severity"),e[37]=a,e[38]=r):r=e[38];let oe=`issues-severity-${s.hash}`,V;e[39]!==a?(V=a("\u2014"),e[39]=a,e[40]=V):V=e[40];let N;e[41]!==s.severity||e[42]!==a?(N=s.severity===void 0?(0,t.jsx)("span",{className:"text-muted-foreground",children:a("\u2014")}):(0,t.jsx)(me,{variant:ts(s.severity),children:s.severity}),e[41]=s.severity,e[42]=a,e[43]=N):N=e[43];let C;e[44]!==V||e[45]!==N?(C=(0,t.jsx)(Ue,{placeholder:V,children:N}),e[44]=V,e[45]=N,e[46]=C):C=e[46];let q;e[47]!==r||e[48]!==oe||e[49]!==C?(q=(0,t.jsx)(We,{"aria-label":r,className:"h-7 w-[110px]","data-testid":oe,children:C}),e[47]=r,e[48]=oe,e[49]=C,e[50]=q):q=e[50];let de;e[51]===Symbol.for("react.memo_cache_sentinel")?(de=Pe.map(ls),e[51]=de):de=e[51];let W;e[52]!==a?(W=a("Clear"),e[52]=a,e[53]=W):W=e[53];let D;e[54]!==W?(D=(0,t.jsxs)(De,{children:[de,(0,t.jsx)(we,{value:Se,children:W})]}),e[54]=W,e[55]=D):D=e[55];let F;e[56]!==u||e[57]!==L||e[58]!==j||e[59]!==q||e[60]!==D?(F=(0,t.jsx)(z,{children:(0,t.jsxs)(Be,{disabled:u,onValueChange:L,value:j,children:[q,D]})}),e[56]=u,e[57]=L,e[58]=j,e[59]=q,e[60]=D,e[61]=F):F=e[61];let O;e[62]!==a?(O=a("Assignee"),e[62]=a,e[63]=O):O=e[63];let fe=`issues-assignee-${s.hash}`,xe=s.assignee??"",ve=s.assignee??"",G;e[64]!==a?(G=a("Unassigned"),e[64]=a,e[65]=G):G=e[65];let H;e[66]!==u||e[67]!==T||e[68]!==O||e[69]!==fe||e[70]!==xe||e[71]!==ve||e[72]!==G?(H=(0,t.jsx)(z,{children:(0,t.jsx)(ke,{"aria-label":O,className:"h-7 w-32","data-testid":fe,defaultValue:xe,disabled:u,onKeyDown:T,placeholder:G},ve)}),e[66]=u,e[67]=T,e[68]=O,e[69]=fe,e[70]=xe,e[71]=ve,e[72]=G,e[73]=H):H=e[73];let J;e[74]!==s.count?(J=(0,t.jsx)(z,{className:"text-right",children:(0,t.jsx)(me,{variant:"secondary",children:s.count})}),e[74]=s.count,e[75]=J):J=e[75];let P;e[76]!==s.lastSeen?(P=Te(s.lastSeen),e[76]=s.lastSeen,e[77]=P):P=e[77];let Q;e[78]!==P?(Q=(0,t.jsx)(z,{className:"text-xs tabular-nums text-muted-foreground",children:P}),e[78]=P,e[79]=Q):Q=e[79];let X;e[80]!==u||e[81]!==s.hash||e[82]!==s.status||e[83]!==i||e[84]!==a?(X=s.status!=="resolved"&&(0,t.jsx)(ie,{"data-testid":`issues-resolve-${s.hash}`,disabled:u,onClick:d(()=>{le(i(s.hash,Qe,{}))},"onClick"),size:"xs",variant:"outline",children:a("Resolve")}),e[80]=u,e[81]=s.hash,e[82]=s.status,e[83]=i,e[84]=a,e[85]=X):X=e[85];let Y;e[86]!==u||e[87]!==s.hash||e[88]!==s.status||e[89]!==i||e[90]!==a?(Y=s.status!=="ignored"&&(0,t.jsx)(ie,{"data-testid":`issues-ignore-${s.hash}`,disabled:u,onClick:d(()=>{le(i(s.hash,Xe,{}))},"onClick"),size:"xs",variant:"ghost",children:a("Ignore")}),e[86]=u,e[87]=s.hash,e[88]=s.status,e[89]=i,e[90]=a,e[91]=Y):Y=e[91];let Z;e[92]!==u||e[93]!==s.assignee||e[94]!==s.hash||e[95]!==s.status||e[96]!==i||e[97]!==a?(Z=s.status!=="open"&&(0,t.jsx)(ie,{"data-testid":`issues-reopen-${s.hash}`,disabled:u,onClick:d(()=>{le(i(s.hash,Fe,{assignee:s.assignee??null}))},"onClick"),size:"xs",variant:"ghost",children:a("Reopen")}),e[92]=u,e[93]=s.assignee,e[94]=s.hash,e[95]=s.status,e[96]=i,e[97]=a,e[98]=Z):Z=e[98];let ee;e[99]!==X||e[100]!==Y||e[101]!==Z?(ee=(0,t.jsx)(z,{className:"text-right",children:(0,t.jsxs)("div",{className:"flex justify-end gap-1",children:[X,Y,Z]})}),e[99]=X,e[100]=Y,e[101]=Z,e[102]=ee):ee=e[102];let se;e[103]!==c||e[104]!==I||e[105]!==F||e[106]!==H||e[107]!==J||e[108]!==Q||e[109]!==E||e[110]!==ee?(se=(0,t.jsxs)(pe,{"data-testid":E,children:[c,I,F,H,J,Q,ee]}),e[103]=c,e[104]=I,e[105]=F,e[106]=H,e[107]=J,e[108]=Q,e[109]=E,e[110]=ee,e[111]=se):se=e[111];let te;e[112]!==o||e[113]!==s||e[114]!==l?(te=(0,t.jsx)(as,{expanded:o,issue:s,shardKey:l},s.sampleMessage),e[112]=o,e[113]=s,e[114]=l,e[115]=te):te=e[115];let he;return e[116]!==se||e[117]!==te?(he=(0,t.jsxs)(t.Fragment,{children:[se,te]}),e[116]=se,e[117]=te,e[118]=he):he=e[118],he},"tt"),ks=d(n=>{let e=(0,ge.c)(38),{initialShardKey:u}=n,s=ue(),$=Ne(),{queryShardKey:i,setShardKey:l,shardKey:a}=Le(u),[o,_]=(0,ne.useState)("all"),[A,R]=(0,ne.useState)(ns),[K,L]=(0,ne.useState)(os),k;e[0]!==o?(k=o==="all"?{}:{status:o},e[0]=o,e[1]=k):k=e[1];let T;e[2]!==i?(T={live:!0,shardKey:i},e[2]=i,e[3]=T):T=e[3];let{data:E,error:h,liveError:x}=Ee(U.getIssues,k,T),M=E!==void 0,v;if(e[4]!==K||e[5]!==A||e[6]!==$||e[7]!==E||e[8]!==h||e[9]!==x||e[10]!==M||e[11]!==i||e[12]!==l||e[13]!==a||e[14]!==o||e[15]!==s){let y=es(E),b;e[17]!==$||e[18]!==i?(b=d(async(r,oe,V)=>{L(N=>{if(!N.has(r))return N;let C=new Map(N);return C.delete(r),C}),R(N=>new Set(N).add(r));try{await $.query(oe,{...V,hash:r},be(i))}catch(N){let C=Ke(N);L(q=>new Map(q).set(r,C))}R(N=>{let C=new Set(N);return C.delete(r),C})},"S"),e[17]=$,e[18]=i,e[19]=b):b=e[19];let w=b,m;e[20]!==s?(m=d(r=>s(r==="all"?"All":r==="open"?"Open":r==="resolved"?"Resolved":"Ignored"),"u"),e[20]=s,e[21]=m):m=e[21];let f=m,p;e[22]!==h?(p=h!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"issues-error",role:"alert",children:h}),e[22]=h,e[23]=p):p=e[23];let c;e[24]!==l||e[25]!==a?(c=(0,t.jsx)(_e,{onChange:l,testId:"issues-shard-input",value:a}),e[24]=l,e[25]=a,e[26]=c):c=e[26];let S;e[27]!==x?(S=(0,t.jsx)(qe,{message:x,prefix:"issues"}),e[27]=x,e[28]=S):S=e[28];let g;e[29]!==o||e[30]!==f?(g=Je.map(r=>(0,t.jsx)(ie,{"data-active":o===r?"":void 0,"data-testid":`issues-filter-${r}`,onClick:d(()=>{_(r)},"onClick"),size:"xs",variant:o===r?"default":"outline",children:f(r)},r)),e[29]=o,e[30]=f,e[31]=g):g=e[31];let I;e[32]!==g?(I=(0,t.jsx)("div",{className:"ms-auto flex items-center gap-1","data-testid":"issues-status-filter",role:"group",children:g}),e[32]=g,e[33]=I):I=e[33];let j;e[34]!==I||e[35]!==c||e[36]!==S?(j=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[c,S,I]}),e[34]=I,e[35]=c,e[36]=S,e[37]=j):j=e[37],v=(0,t.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-issues-panel",children:[p,j,M&&y.length===0?(0,t.jsx)(Ae,{description:s("No grouped errors yet. When a function throws or a container crashes, matching errors fold into a single issue here."),testId:"issues-empty",title:s("No issues")}):(0,t.jsx)(Me,{className:"overflow-hidden py-0",children:(0,t.jsx)(Ce,{className:"px-0",children:(0,t.jsxs)(ze,{"data-testid":"issues-table",children:[(0,t.jsx)(Re,{children:(0,t.jsxs)(pe,{children:[(0,t.jsx)(B,{children:s("Issue")}),(0,t.jsx)(B,{children:s("Status")}),(0,t.jsx)(B,{children:s("Severity")}),(0,t.jsx)(B,{children:s("Assignee")}),(0,t.jsx)(B,{className:"text-right",children:s("Events")}),(0,t.jsx)(B,{children:s("Last seen")}),(0,t.jsx)(B,{className:"text-right",children:s("Actions")})]})}),(0,t.jsx)(je,{children:y.map(r=>(0,t.jsx)(is,{busy:A.has(r.hash),issue:r,rowError:K.get(r.hash),runTriage:w,shardKey:i},r.hash))})]})})})]}),e[4]=K,e[5]=A,e[6]=$,e[7]=E,e[8]=h,e[9]=x,e[10]=M,e[11]=i,e[12]=l,e[13]=a,e[14]=o,e[15]=s,e[16]=v}else v=e[16];return v},"Tt");function rs(n){return!n}d(rs,"st");function ls(n){return(0,t.jsx)(we,{value:n,children:n},n)}d(ls,"at");function ns(){return new Set}d(ns,"it");function os(){return new Map}d(os,"lt");export{ks as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as Qe}from"./chunk-X43AA6RX.js";import{a as Me,b as Re}from"./chunk-CSUROWL2.js";import"./chunk-TJRQUJFS.js";import"./chunk-TWTNWOJU.js";import"./chunk-WQYWA7U6.js";import{a as we}from"./chunk-IMOHEGMV.js";import"./chunk-7RIRJD2P.js";import"./chunk-C3TOZ4LG.js";import"./chunk-D27D4UUI.js";import"./chunk-SB35BJ7A.js";import"./chunk-FO26ZU7E.js";import"./chunk-5JDWLCSH.js";import{a as He}from"./chunk-S3CRZLGS.js";import{a as Xe}from"./chunk-IFLTA2OD.js";import{b as Je}from"./chunk-OGUKYRFM.js";import{e as Ue}from"./chunk-JVUZEYKQ.js";import"./chunk-OKG3HWSJ.js";import{P as Ae}from"./chunk-46ZJ3TM4.js";import"./chunk-Y6CXU7T4.js";import"./chunk-4L4WTGN5.js";import{a as me}from"./chunk-EBWXFG4H.js";import"./chunk-TGHH7ZFA.js";import"./chunk-5GFSKIB2.js";import{b as ze}from"./chunk-NCCAMFB6.js";import"./chunk-25NFR6EB.js";import{a as je}from"./chunk-CXNZVJ3S.js";import{f as Ve}from"./chunk-JBIN7W2B.js";import"./chunk-FSRSK4LY.js";import{a as We}from"./chunk-FKVZRPV5.js";import{a as qe,b as Pe,c as Ge,d as Ke,e as Le}from"./chunk-WUWBZPUK.js";import{d as Fe,f as Ee,g as $e,h as Oe,o as ue}from"./chunk-Y4Q25F6X.js";import"./chunk-T2IE5GKA.js";import{a as r,d as Be,e as at,f as nt,g as st,i as De}from"./chunk-YKXDMIHQ.js";var Ce=Be(nt(),1);var x=Be(at(),1);var t=Be(st(),1);var rt=Ee(je.listTables),ot=Ee(je.listTableIndexes),it=Ee(je.readTablePage),dt=Ee(je.describeTables),ct={},Ye=[],mt=r(s=>{let e=(0,Ce.c)(74),{initialShardKey:u,initialTable:n}=s,l=Ve(),[a,m]=(0,x.useState)("graph"),{queryShardKey:c,setShardKey:d,shardKey:g}=He(u),[o,p]=(0,x.useState)(""),[i,v]=(0,x.useState)(null),[b,P]=(0,x.useState)(null),_;e[0]===Symbol.for("react.memo_cache_sentinel")?(_={},e[0]=_):_=e[0];let[L,y]=(0,x.useState)(_),G;e[1]===Symbol.for("react.memo_cache_sentinel")?(G={},e[1]=G):G=e[1];let[E,M]=(0,x.useState)(G),[S,C]=(0,x.useState)(null),F;e[2]===Symbol.for("react.memo_cache_sentinel")?(F={},e[2]=F):F=e[2];let[$,he]=(0,x.useState)(F),Q;e[3]===Symbol.for("react.memo_cache_sentinel")?(Q={},e[3]=Q):Q=e[3];let[I,K]=(0,x.useState)(Q),[k,pe]=(0,x.useState)(null),[B,oe]=(0,x.useState)(null),Y;e[4]===Symbol.for("react.memo_cache_sentinel")?(Y={},e[4]=Y):Y=e[4];let[W,xe]=(0,x.useState)(Y),[J,ie]=(0,x.useState)(null),ve;e[5]!==l?(ve=r(async h=>{P(null);try{let w=await l.query(rt,{},$e(h));Je(h),v(w),y({}),M({}),C(null),he(N=>Object.fromEntries(Object.entries(N).filter(q=>{let[A]=q;return A!==h}))),K(N=>Object.fromEntries(Object.entries(N).filter(q=>{let[A]=q;return A!==h})))}catch(w){let N=w;v(null),P(Oe(N))}},"ve"),e[5]=l,e[6]=ve):ve=e[6];let O=ve,Z;e[7]!==l?(Z=r(async()=>{oe(null);try{pe(await l.listGlobalTables())}catch(h){let w=h;pe(null),oe(Oe(w))}},"Z"),e[7]=l,e[8]=Z):Z=e[8];let ee=Z,de,D;e[9]!==c||e[10]!==O||e[11]!==ee?(de=r(()=>{ue(O(c)),ue(ee())},"de"),D=[O,ee,c],e[9]=c,e[10]=O,e[11]=ee,e[12]=de,e[13]=D):(de=e[12],D=e[13]),(0,x.useEffect)(de,D);let te;e[14]!==l||e[15]!==L||e[16]!==S||e[17]!==c?(te=r(async h=>{if(S===h){C(null);return}C(h);let w=`${c}:${h}`;if(L[w]!==void 0)return;let[N,q]=await Promise.allSettled([l.query(it,{limit:1,offset:0,table:h},$e(c)),l.query(ot,{table:h},$e(c))]);N.status==="fulfilled"?y(A=>({...A,[w]:N.value.columns})):P(Oe(N.reason)),q.status==="fulfilled"&&M(A=>({...A,[w]:q.value.indexes}))},"te"),e[14]=l,e[15]=L,e[16]=S,e[17]=c,e[18]=te):te=e[18];let j=te,ye;e[19]!==l||e[20]!==W||e[21]!==J?(ye=r(async h=>{if(J===h){ie(null);return}if(ie(h),W[h]===void 0)try{let w=await l.readGlobalTablePage({limit:1,offset:0,table:h});xe(N=>({...N,[h]:w.columns}))}catch(w){oe(Oe(w))}},"ye"),e[19]=l,e[20]=W,e[21]=J,e[22]=ye):ye=e[22];let ce=ye,be=(0,x.useRef)(void 0),R,X;e[23]!==n||e[24]!==i||e[25]!==j?(R=r(()=>{n===void 0||i===null||be.current===n||i.some(h=>h.name===n)&&(be.current=n,ue(j(n)))},"K"),X=[n,i,j],e[23]=n,e[24]=i,e[25]=j,e[26]=R,e[27]=X):(R=e[26],X=e[27]),(0,x.useEffect)(R,X);let V;e[28]!==l?(V=r(async(h,w,N)=>{let[q,A]=await Promise.all([Promise.allSettled([l.query(dt,{tables:[...w,...N]},$e(h))]),Promise.all(N.map(async T=>{let ge=await Promise.allSettled([l.readGlobalTablePage({limit:1,offset:0,table:T})]),Ie=ge[0].status==="fulfilled"?ge[0].value:void 0;return{columns:Ie?.columns??[],refs:Ie?.refs??{},table:T}}))]),Te=q[0].status==="fulfilled"?q[0].value?.columnsByTable??{}:{},Se=q[0].status==="rejected",_e=new Map(A.map(ut)),ke=[...w,...N].map(T=>{let ge=Te[T]??[];return[T,ge.length>0?ge:_e.get(T)??[]]});he(T=>({...T,[h]:Object.fromEntries(ke)})),K(T=>({...T,[h]:Se}))},"U"),e[28]=l,e[29]=V):V=e[29];let le=V,U,ae;e[30]!==B||e[31]!==k||e[32]!==le||e[33]!==c||e[34]!==$||e[35]!==i||e[36]!==a?(U=r(()=>{a!=="graph"||i===null||k===null&&B===null||$[c]!==void 0||ue(le(c,i.map(ht),(k??[]).map(pt)))},"V"),ae=[a,i,k,B,c,$,le],e[30]=B,e[31]=k,e[32]=le,e[33]=c,e[34]=$,e[35]=i,e[36]=a,e[37]=U,e[38]=ae):(U=e[37],ae=e[38]),(0,x.useEffect)(U,ae);let z=$[c]??ct,ne;if(e[39]!==z||e[40]!==k||e[41]!==i){let h;e[43]!==z?(h=r(A=>({columns:z[A.name]??Ye,name:A.name,tier:"shard"}),"u"),e[43]=z,e[44]=h):h=e[44];let w=(i??[]).map(h),N;e[45]!==z?(N=r(A=>({columns:z[A.name]??Ye,name:A.name,tier:"global"}),"x"),e[45]=z,e[46]=N):N=e[46];let q=(k??[]).map(N);ne=[...w,...q],e[39]=z,e[40]=k,e[41]=i,e[42]=ne}else ne=e[42];let se=ne,f;if(e[47]!==o||e[48]!==i){let h=o.trim().toLowerCase();f=(i??[]).filter(w=>w.name.toLowerCase().includes(h)),e[47]=o,e[48]=i,e[49]=f}else f=e[49];let re=f,H;if(e[50]!==k||e[51]!==o){let h=o.trim().toLowerCase();H=(k??[]).filter(w=>w.name.toLowerCase().includes(h)),e[50]=k,e[51]=o,e[52]=H}else H=e[52];let Ne=H,fe;return e[53]!==L||e[54]!==se||e[55]!==b||e[56]!==S||e[57]!==Ne||e[58]!==re||e[59]!==W||e[60]!==B||e[61]!==J||e[62]!==k||e[63]!==E||e[64]!==O||e[65]!==d||e[66]!==I||e[67]!==g||e[68]!==o||e[69]!==i||e[70]!==j||e[71]!==ce||e[72]!==a?(fe={columns:L,diagramTables:se,error:b,expanded:S,filteredGlobalTables:Ne,filteredTables:re,globalColumns:W,globalError:B,globalExpanded:J,globalTables:k,indexes:E,refresh:O,setShardKey:d,setTableFilter:p,setView:m,shardColumnsError:I,shardKey:g,tableFilter:o,tables:i,toggle:j,toggleGlobal:ce,view:a},e[53]=L,e[54]=se,e[55]=b,e[56]=S,e[57]=Ne,e[58]=re,e[59]=W,e[60]=B,e[61]=J,e[62]=k,e[63]=E,e[64]=O,e[65]=d,e[66]=I,e[67]=g,e[68]=o,e[69]=i,e[70]=j,e[71]=ce,e[72]=a,e[73]=fe):fe=e[73],fe},"ct");function ut(s){let{columns:e,refs:u,table:n}=s;return[n,e.map(l=>{let a=u[l];return a===void 0?{name:l,optional:!1,type:""}:{name:l,optional:!1,ref:a,type:"id"}})]}r(ut,"mt");function ht(s){return s.name}r(ht,"ut");function pt(s){return s.name}r(pt,"ft");var bt="/__lunora/schema-edit",ft=r(async s=>{let e=await fetch(bt,{body:JSON.stringify(s),headers:{"Content-Type":"application/json","X-Lunora-Studio":"1"},method:"POST"}),u=await e.json();return u.needsMigration===!0?{kind:"needs-migration",message:u.message??"This edit needs a migration."}:e.ok&&u.tables!==void 0?{diagnostics:u.diagnostics??[],kind:"ok",tables:u.tables}:{kind:"error",message:u.error??`schema edit failed (${String(e.status)})`}},"pt"),gt=r(s=>{let e=(0,Ce.c)(32),{hasTables:u,mode:n,onAddColumn:l,onAddIndex:a,onAddTable:m,onDestructive:c}=s,d=Fe(),g=n==="addTable"?"default":"outline",o;e[0]!==d?(o=d("Add table"),e[0]=d,e[1]=o):o=e[1];let p;e[2]!==m||e[3]!==g||e[4]!==o?(p=(0,t.jsx)(me,{"data-testid":"sc-editor-add-table",onClick:m,size:"xs",type:"button",variant:g,children:o}),e[2]=m,e[3]=g,e[4]=o,e[5]=p):p=e[5];let i=!u,v=n==="addColumn"?"default":"outline",b;e[6]!==d?(b=d("Add column"),e[6]=d,e[7]=b):b=e[7];let P;e[8]!==l||e[9]!==i||e[10]!==v||e[11]!==b?(P=(0,t.jsx)(me,{"data-testid":"sc-editor-add-column",disabled:i,onClick:l,size:"xs",type:"button",variant:v,children:b}),e[8]=l,e[9]=i,e[10]=v,e[11]=b,e[12]=P):P=e[12];let _=!u,L=n==="addIndex"?"default":"outline",y;e[13]!==d?(y=d("Add index"),e[13]=d,e[14]=y):y=e[14];let G;e[15]!==a||e[16]!==y||e[17]!==_||e[18]!==L?(G=(0,t.jsx)(me,{"data-testid":"sc-editor-add-index",disabled:_,onClick:a,size:"xs",type:"button",variant:L,children:y}),e[15]=a,e[16]=y,e[17]=_,e[18]=L,e[19]=G):G=e[19];let E=!u,M=n==="destructive"?"default":"ghost",S;e[20]!==d?(S=d("Rename / drop / change type\u2026"),e[20]=d,e[21]=S):S=e[21];let C;e[22]!==c||e[23]!==E||e[24]!==M||e[25]!==S?(C=(0,t.jsx)(me,{"data-testid":"sc-editor-destructive",disabled:E,onClick:c,size:"xs",type:"button",variant:M,children:S}),e[22]=c,e[23]=E,e[24]=M,e[25]=S,e[26]=C):C=e[26];let F;return e[27]!==G||e[28]!==C||e[29]!==p||e[30]!==P?(F=(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[p,P,G,C]}),e[27]=G,e[28]=C,e[29]=p,e[30]=P,e[31]=F):F=e[31],F},"gt"),xt=r(s=>{let e=(0,Ce.c)(28),{onOpenMigrations:u,result:n}=s,l=Fe();if(n===null){let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=(0,t.jsx)(t.Fragment,{}),e[0]=o):o=e[0],o}if(n.kind==="error"){let o;return e[1]!==n.message?(o=(0,t.jsx)("p",{className:"mt-3 text-sm text-destructive","data-testid":"sc-editor-error",role:"alert",children:n.message}),e[1]=n.message,e[2]=o):o=e[2],o}if(n.kind==="needs-migration"){let o;e[3]!==n.message||e[4]!==l?(o=n.message===""?l("This edit changes stored data and must go through a migration. Review the migration before applying."):n.message,e[3]=n.message,e[4]=l,e[5]=o):o=e[5];let p;e[6]!==o?(p=(0,t.jsx)("p",{className:"text-sm text-warning",role:"alert",children:o}),e[6]=o,e[7]=p):p=e[7];let i;e[8]!==l?(i=l("Open Migrations"),e[8]=l,e[9]=i):i=e[9];let v;e[10]!==u||e[11]!==i?(v=(0,t.jsx)(me,{className:"self-start","data-testid":"sc-editor-open-migrations",onClick:u,size:"xs",type:"button",variant:"outline",children:i}),e[10]=u,e[11]=i,e[12]=v):v=e[12];let b;return e[13]!==p||e[14]!==v?(b=(0,t.jsxs)("div",{className:"mt-3 flex flex-col gap-2","data-testid":"sc-editor-needs-migration",children:[p,v]}),e[13]=p,e[14]=v,e[15]=b):b=e[15],b}if(n.diagnostics.length===0){let o;return e[16]===Symbol.for("react.memo_cache_sentinel")?(o=(0,t.jsx)(t.Fragment,{}),e[16]=o):o=e[16],o}let a;e[17]!==l?(a=l("Codegen reported diagnostics:"),e[17]=l,e[18]=a):a=e[18];let m;e[19]!==a?(m=(0,t.jsx)("p",{className:"text-sm text-destructive",role:"alert",children:a}),e[19]=a,e[20]=m):m=e[20];let c;e[21]!==n.diagnostics?(c=n.diagnostics.map(vt),e[21]=n.diagnostics,e[22]=c):c=e[22];let d;e[23]!==c?(d=(0,t.jsx)("ul",{className:"flex flex-col gap-0.5",children:c}),e[23]=c,e[24]=d):d=e[24];let g;return e[25]!==m||e[26]!==d?(g=(0,t.jsxs)("div",{className:"mt-3 flex flex-col gap-1","data-testid":"sc-editor-diagnostics",children:[m,d]}),e[25]=m,e[26]=d,e[27]=g):g=e[27],g},"bt");function vt(s){return(0,t.jsx)("li",{className:"font-mono text-[11px] text-destructive",children:s},s)}r(vt,"xt");var yt=[{label:"string",validator:"v.string()"},{label:"number",validator:"v.number()"},{label:"boolean",validator:"v.boolean()"},{label:"bigint",validator:"v.int64()"},{label:"bytes",validator:"v.bytes()"},{label:"any",validator:"v.any()"}],Nt="v.string()",Ct=r(s=>s.split(",").map(e=>e.trim()).filter(e=>e!==""),"Ct"),wt=r(s=>{let e=(0,Ce.c)(83),{onApplied:u,tableNames:n}=s,l=Fe(),a=Ue(),[m,c]=(0,x.useState)(null),[d,g]=(0,x.useState)(!1),[o,p]=(0,x.useState)(null),[i,v]=(0,x.useState)(""),[b,P]=(0,x.useState)(""),[_,L]=(0,x.useState)(Nt),[y,G]=(0,x.useState)(n[0]??""),[E,M]=(0,x.useState)(""),[S,C]=(0,x.useState)(""),[F,$]=(0,x.useState)(!1),he;e[0]===Symbol.for("react.memo_cache_sentinel")?(he=r(()=>{c(null),v(""),P(""),M(""),C(""),$(!1)},"me"),e[0]=he):he=e[0];let Q=he,I;e[1]!==u?(I=r(async T=>{g(!0),p(null);try{let ge=await ft(T);p(ge),ge.kind==="ok"&&(u(ge.tables),Q())}catch(ge){let Ie=ge;p({kind:"error",message:Ie instanceof Error?Ie.message:String(Ie)})}g(!1)},"I"),e[1]=u,e[2]=I):I=e[2];let K=I,k;e[3]!==K||e[4]!==i?(k=r(()=>{ue(K({kind:"addTable",table:i.trim()}))},"_"),e[3]=K,e[4]=i,e[5]=k):k=e[5];let pe=k,B;e[6]!==b||e[7]!==K||e[8]!==y||e[9]!==_?(B=r(()=>{ue(K({column:b.trim(),kind:"addOptionalColumn",table:y,validator:_}))},"j"),e[6]=b,e[7]=K,e[8]=y,e[9]=_,e[10]=B):B=e[10];let oe=B,Y;e[11]!==S||e[12]!==E||e[13]!==K||e[14]!==y||e[15]!==F?(Y=r(()=>{ue(K({fields:Ct(S),kind:"addIndex",name:E.trim(),table:y,unique:F}))},"Q"),e[11]=S,e[12]=E,e[13]=K,e[14]=y,e[15]=F,e[16]=Y):Y=e[16];let W=Y,xe;e[17]===Symbol.for("react.memo_cache_sentinel")?(xe=r(()=>{p(null),c("addTable")},"xe"),e[17]=xe):xe=e[17];let J=xe,ie;e[18]===Symbol.for("react.memo_cache_sentinel")?(ie=r(()=>{p(null),c("addColumn")},"re"),e[18]=ie):ie=e[18];let ve=ie,O;e[19]===Symbol.for("react.memo_cache_sentinel")?(O=r(()=>{p(null),c("addIndex")},"O"),e[19]=O):O=e[19];let Z=O,ee;e[20]!==l?(ee=r(()=>{c("destructive"),p({kind:"needs-migration",message:l("This edit changes stored data and must go through a migration. Review the migration before applying.")})},"ee"),e[20]=l,e[21]=ee):ee=e[21];let de=ee,D;e[22]===Symbol.for("react.memo_cache_sentinel")?(D=r(T=>{v(T.target.value)},"R"),e[22]=D):D=e[22];let te=D,j;e[23]===Symbol.for("react.memo_cache_sentinel")?(j=r(T=>{P(T.target.value)},"M"),e[23]=j):j=e[23];let ye=j,ce;e[24]===Symbol.for("react.memo_cache_sentinel")?(ce=r(T=>{L(T.target.value)},"ce"),e[24]=ce):ce=e[24];let be=ce,R;e[25]===Symbol.for("react.memo_cache_sentinel")?(R=r(T=>{G(T.target.value)},"K"),e[25]=R):R=e[25];let X=R,V;e[26]===Symbol.for("react.memo_cache_sentinel")?(V=r(T=>{M(T.target.value)},"U"),e[26]=V):V=e[26];let le=V,U;e[27]===Symbol.for("react.memo_cache_sentinel")?(U=r(T=>{C(T.target.value)},"V"),e[27]=U):U=e[27];let ae=U,z;e[28]===Symbol.for("react.memo_cache_sentinel")?(z=r(T=>{$(T.target.checked)},"$"),e[28]=z):z=e[28];let ne=z,se;e[29]!==a?(se=r(()=>{ue(a({to:"/migrations"}))},"ne"),e[29]=a,e[30]=se):se=e[30];let f=se,re;e[31]!==l?(re=l("Edit schema"),e[31]=l,e[32]=re):re=e[32];let H;e[33]!==re?(H=(0,t.jsx)(Ge,{children:re}),e[33]=re,e[34]=H):H=e[34];let Ne;e[35]!==l?(Ne=l("Adds a table, column, or index to lunora/schema.ts and reruns codegen."),e[35]=l,e[36]=Ne):Ne=e[36];let fe;e[37]!==Ne?(fe=(0,t.jsx)(Ke,{children:Ne}),e[37]=Ne,e[38]=fe):fe=e[38];let h;e[39]!==H||e[40]!==fe?(h=(0,t.jsxs)(Pe,{children:[H,fe]}),e[39]=H,e[40]=fe,e[41]=h):h=e[41];let w=n.length>0,N;e[42]!==m||e[43]!==de||e[44]!==w?(N=(0,t.jsx)(gt,{hasTables:w,mode:m,onAddColumn:ve,onAddIndex:Z,onAddTable:J,onDestructive:de}),e[42]=m,e[43]=de,e[44]=w,e[45]=N):N=e[45];let q;e[46]!==d||e[47]!==m||e[48]!==pe||e[49]!==l||e[50]!==i?(q=m==="addTable"&&(0,t.jsxs)("div",{className:"mt-3 flex flex-wrap items-end gap-2","data-testid":"sc-editor-table-form",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)(we,{htmlFor:"sc-editor-table-name",children:l("Table name")}),(0,t.jsx)(Ae,{"data-testid":"sc-editor-table-name",id:"sc-editor-table-name",onChange:te,value:i})]}),(0,t.jsx)(me,{"data-testid":"sc-editor-table-apply",disabled:d||i.trim()==="",onClick:pe,size:"xs",type:"button",children:l(d?"Applying\u2026":"Apply")}),(0,t.jsx)(me,{onClick:Q,size:"xs",type:"button",variant:"ghost",children:l("Cancel")})]}),e[46]=d,e[47]=m,e[48]=pe,e[49]=l,e[50]=i,e[51]=q):q=e[51];let A;e[52]!==d||e[53]!==b||e[54]!==m||e[55]!==oe||e[56]!==l||e[57]!==n||e[58]!==y||e[59]!==_?(A=m==="addColumn"&&(0,t.jsxs)("div",{className:"mt-3 flex flex-wrap items-end gap-2","data-testid":"sc-editor-column-form",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)(we,{htmlFor:"sc-editor-column-table",children:l("Table name")}),(0,t.jsx)("select",{className:"h-8 rounded-md border border-input bg-transparent px-2 text-xs","data-testid":"sc-editor-column-table",id:"sc-editor-column-table",onChange:X,value:y,children:n.map(Tt)})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)(we,{htmlFor:"sc-editor-column-name",children:l("Column name")}),(0,t.jsx)(Ae,{"data-testid":"sc-editor-column-name",id:"sc-editor-column-name",onChange:ye,value:b})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)(we,{htmlFor:"sc-editor-column-type",children:l("Column type")}),(0,t.jsx)("select",{className:"h-8 rounded-md border border-input bg-transparent px-2 text-xs","data-testid":"sc-editor-column-type",id:"sc-editor-column-type",onChange:be,value:_,children:yt.map(St)})]}),(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground",children:l("Optional")}),(0,t.jsx)(me,{"data-testid":"sc-editor-column-apply",disabled:d||b.trim()===""||y==="",onClick:oe,size:"xs",type:"button",children:l(d?"Applying\u2026":"Apply")}),(0,t.jsx)(me,{onClick:Q,size:"xs",type:"button",variant:"ghost",children:l("Cancel")})]}),e[52]=d,e[53]=b,e[54]=m,e[55]=oe,e[56]=l,e[57]=n,e[58]=y,e[59]=_,e[60]=A):A=e[60];let Te;e[61]!==d||e[62]!==S||e[63]!==E||e[64]!==m||e[65]!==W||e[66]!==l||e[67]!==n||e[68]!==y||e[69]!==F?(Te=m==="addIndex"&&(0,t.jsxs)("div",{className:"mt-3 flex flex-wrap items-end gap-2","data-testid":"sc-editor-index-form",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)(we,{htmlFor:"sc-editor-index-table",children:l("Table name")}),(0,t.jsx)("select",{className:"h-8 rounded-md border border-input bg-transparent px-2 text-xs","data-testid":"sc-editor-index-table",id:"sc-editor-index-table",onChange:X,value:y,children:n.map(_t)})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)(we,{htmlFor:"sc-editor-index-name",children:l("Index name")}),(0,t.jsx)(Ae,{"data-testid":"sc-editor-index-name",id:"sc-editor-index-name",onChange:le,value:E})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)(we,{htmlFor:"sc-editor-index-fields",children:l("Index fields (comma-separated)")}),(0,t.jsx)(Ae,{"data-testid":"sc-editor-index-fields",id:"sc-editor-index-fields",onChange:ae,value:S})]}),(0,t.jsxs)(we,{className:"flex items-center gap-1 text-xs",htmlFor:"sc-editor-index-unique",children:[(0,t.jsx)("input",{checked:F,"data-testid":"sc-editor-index-unique",id:"sc-editor-index-unique",onChange:ne,type:"checkbox"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:l("Unique")})]}),(0,t.jsx)(me,{"data-testid":"sc-editor-index-apply",disabled:d||E.trim()===""||S.trim()==="",onClick:W,size:"xs",type:"button",children:l(d?"Applying\u2026":"Apply")}),(0,t.jsx)(me,{onClick:Q,size:"xs",type:"button",variant:"ghost",children:l("Cancel")})]}),e[61]=d,e[62]=S,e[63]=E,e[64]=m,e[65]=W,e[66]=l,e[67]=n,e[68]=y,e[69]=F,e[70]=Te):Te=e[70];let Se;e[71]!==f||e[72]!==o?(Se=(0,t.jsx)(xt,{onOpenMigrations:f,result:o}),e[71]=f,e[72]=o,e[73]=Se):Se=e[73];let _e;e[74]!==N||e[75]!==q||e[76]!==A||e[77]!==Te||e[78]!==Se?(_e=(0,t.jsxs)(Le,{children:[N,q,A,Te,Se]}),e[74]=N,e[75]=q,e[76]=A,e[77]=Te,e[78]=Se,e[79]=_e):_e=e[79];let ke;return e[80]!==h||e[81]!==_e?(ke=(0,t.jsxs)(qe,{"data-testid":"sc-editor",size:"sm",children:[h,_e]}),e[80]=h,e[81]=_e,e[82]=ke):ke=e[82],ke},"Nt");function Tt(s){return(0,t.jsx)("option",{value:s,children:s},s)}r(Tt,"Tt");function St(s){return(0,t.jsx)("option",{value:s.validator,children:s.label},s.validator)}r(St,"St");function _t(s){return(0,t.jsx)("option",{value:s,children:s},s)}r(_t,"wt");var Ze=[],kt=r(s=>{let e=(0,Ce.c)(5),{open:u}=s,n=u&&"rotate-90",l;e[0]!==n?(l=De("size-3.5 shrink-0 text-muted-foreground transition-transform duration-150",n),e[0]=n,e[1]=l):l=e[1];let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=(0,t.jsx)("path",{d:"m9 6 6 6-6 6"}),e[2]=a):a=e[2];let m;return e[3]!==l?(m=(0,t.jsx)("svg",{"aria-hidden":"true",className:l,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:a}),e[3]=l,e[4]=m):m=e[4],m},"_t"),et=r(s=>{let e=(0,Ce.c)(20),{children:u,expanded:n,name:l,onToggle:a,rowCount:m,rowTestId:c,toggleTestId:d}=s,g;e[0]!==n?(g=(0,t.jsx)(kt,{open:n}),e[0]=n,e[1]=g):g=e[1];let o;e[2]!==l?(o=(0,t.jsx)("span",{className:"truncate font-mono text-xs text-foreground",title:l,children:l}),e[2]=l,e[3]=o):o=e[3];let p;e[4]!==m?(p=(0,t.jsxs)("span",{className:"ms-auto shrink-0 text-xs text-muted-foreground tabular-nums",children:["(",m,")"]}),e[4]=m,e[5]=p):p=e[5];let i;e[6]!==n||e[7]!==a||e[8]!==g||e[9]!==o||e[10]!==p||e[11]!==d?(i=(0,t.jsxs)("button",{"aria-expanded":n,className:"flex w-full items-center gap-2 px-3 py-2 text-start transition-colors hover:bg-muted/50 aria-expanded:bg-muted/40","data-testid":d,onClick:a,type:"button",children:[g,o," ",p]}),e[6]=n,e[7]=a,e[8]=g,e[9]=o,e[10]=p,e[11]=d,e[12]=i):i=e[12];let v;e[13]!==u||e[14]!==n?(v=n&&(0,t.jsx)("div",{className:"px-3 pb-3 ps-8",children:u}),e[13]=u,e[14]=n,e[15]=v):v=e[15];let b;return e[16]!==c||e[17]!==i||e[18]!==v?(b=(0,t.jsxs)("li",{className:"border-t border-border/60 first:border-t-0","data-testid":c,children:[i,v]}),e[16]=c,e[17]=i,e[18]=v,e[19]=b):b=e[19],b},"Ye"),tt=r(s=>{let e=(0,Ce.c)(5),{columns:u,testId:n}=s,l;e[0]!==u?(l=u.map(At),e[0]=u,e[1]=l):l=e[1];let a;return e[2]!==l||e[3]!==n?(a=(0,t.jsx)("ul",{className:"flex flex-wrap gap-1.5 pt-1","data-testid":n,children:l}),e[2]=l,e[3]=n,e[4]=a):a=e[4],a},"He"),It=r(s=>{let e=(0,Ce.c)(10),{heading:u,indexes:n,testId:l}=s,a;e[0]!==u?(a=(0,t.jsx)("p",{className:"mb-1.5 font-mono text-[10px] tracking-wide text-muted-foreground uppercase",children:u}),e[0]=u,e[1]=a):a=e[1];let m;e[2]!==n?(m=n.map(Ft),e[2]=n,e[3]=m):m=e[3];let c;e[4]!==m||e[5]!==l?(c=(0,t.jsx)("ul",{className:"flex flex-col gap-1","data-testid":l,children:m}),e[4]=m,e[5]=l,e[6]=c):c=e[6];let d;return e[7]!==a||e[8]!==c?(d=(0,t.jsxs)("div",{className:"pt-3",children:[a,c]}),e[7]=a,e[8]=c,e[9]=d):d=e[9],d},"Et"),lt=r(s=>De("border-b-2 px-3 py-2 font-mono text-[11px] tracking-widest uppercase outline-none transition-colors",s?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),"Xe"),Xt=r(s=>{let e=(0,Ce.c)(85),{initialShardKey:u,initialTable:n,schemaEditable:l}=s,a=Fe(),m;e[0]!==u||e[1]!==n?(m={initialShardKey:u,initialTable:n},e[0]=u,e[1]=n,e[2]=m):m=e[2];let{columns:c,diagramTables:d,error:g,expanded:o,filteredGlobalTables:p,filteredTables:i,globalColumns:v,globalError:b,globalExpanded:P,globalTables:_,indexes:L,refresh:y,setShardKey:G,setTableFilter:E,setView:M,shardColumnsError:S,shardKey:C,tableFilter:F,tables:$,toggle:he,toggleGlobal:Q,view:I}=mt(m),K;e[3]!==M?(K=r(()=>{M("list")},"q"),e[3]=M,e[4]=K):K=e[4];let k=K,pe;e[5]!==M?(pe=r(()=>{M("graph")},"ue"),e[5]=M,e[6]=pe):pe=e[6];let B=pe,oe;e[7]!==E?(oe=r(f=>{E(f.target.value)},"ie"),e[7]=E,e[8]=oe):oe=e[8];let Y=oe,W;e[9]!==y||e[10]!==C?(W=r(f=>{ue(y(C))},"Y"),e[9]=y,e[10]=C,e[11]=W):W=e[11];let xe=W,J;e[12]!==$?(J=$??[],e[12]=$,e[13]=J):J=e[13];let ie;e[14]!==J?(ie=J.map(zt),e[14]=J,e[15]=ie):ie=e[15];let ve=ie,O;e[16]!==G||e[17]!==C?(O=(0,t.jsx)(Xe,{onChange:G,testId:"sc-shard-input",value:C}),e[16]=G,e[17]=C,e[18]=O):O=e[18];let Z;e[19]!==a?(Z=a("Schema view"),e[19]=a,e[20]=Z):Z=e[20];let ee=I==="graph",de=I==="graph",D;e[21]!==de?(D=lt(de),e[21]=de,e[22]=D):D=e[22];let te;e[23]!==a?(te=a("Graph"),e[23]=a,e[24]=te):te=e[24];let j;e[25]!==B||e[26]!==ee||e[27]!==D||e[28]!==te?(j=(0,t.jsx)("button",{"aria-selected":ee,className:D,"data-testid":"sc-view-graph",onClick:B,role:"tab",type:"button",children:te}),e[25]=B,e[26]=ee,e[27]=D,e[28]=te,e[29]=j):j=e[29];let ye=I==="list",ce=I==="list",be;e[30]!==ce?(be=lt(ce),e[30]=ce,e[31]=be):be=e[31];let R;e[32]!==a?(R=a("Table list"),e[32]=a,e[33]=R):R=e[33];let X;e[34]!==k||e[35]!==ye||e[36]!==be||e[37]!==R?(X=(0,t.jsx)("button",{"aria-selected":ye,className:be,"data-testid":"sc-view-list",onClick:k,role:"tab",type:"button",children:R}),e[34]=k,e[35]=ye,e[36]=be,e[37]=R,e[38]=X):X=e[38];let V;e[39]!==j||e[40]!==X||e[41]!==Z?(V=(0,t.jsxs)("div",{"aria-label":Z,className:"flex items-center gap-1","data-testid":"sc-view-toggle",role:"tablist",children:[j,X]}),e[39]=j,e[40]=X,e[41]=Z,e[42]=V):V=e[42];let le;e[43]!==V||e[44]!==O?(le=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[O,V]}),e[43]=V,e[44]=O,e[45]=le):le=e[45];let U;e[46]!==xe||e[47]!==l||e[48]!==ve?(U=l===!0&&(0,t.jsx)(wt,{onApplied:xe,tableNames:ve}),e[46]=xe,e[47]=l,e[48]=ve,e[49]=U):U=e[49];let ae;e[50]!==Y||e[51]!==a||e[52]!==F||e[53]!==I?(ae=I==="list"&&(0,t.jsx)(Ae,{"aria-label":a("Filter tables"),className:"h-8 max-w-xs","data-testid":"sc-filter",onChange:Y,placeholder:a("Filter tables"),value:F}),e[50]=Y,e[51]=a,e[52]=F,e[53]=I,e[54]=ae):ae=e[54];let z;e[55]!==d||e[56]!==g||e[57]!==b||e[58]!==S||e[59]!==C||e[60]!==I?(z=I==="graph"&&(0,t.jsxs)("div",{className:"flex flex-col gap-2","data-testid":"sc-graph-view",children:[g!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"sc-error",role:"alert",children:g}),b!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"sc-global-error",role:"alert",children:b}),(0,t.jsx)(Qe,{columnsError:S[C]===!0,tables:d,testIdPrefix:"sc-graph"})]}),e[55]=d,e[56]=g,e[57]=b,e[58]=S,e[59]=C,e[60]=I,e[61]=z):z=e[61];let ne;e[62]!==c||e[63]!==g||e[64]!==o||e[65]!==p||e[66]!==i||e[67]!==v||e[68]!==b||e[69]!==P||e[70]!==_||e[71]!==L||e[72]!==C||e[73]!==a||e[74]!==$||e[75]!==he||e[76]!==Q||e[77]!==I?(ne=I==="list"&&(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsxs)(qe,{"data-testid":"sc-shard-section",size:"sm",children:[(0,t.jsxs)(Pe,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(Re,{tier:"shard"}),(0,t.jsx)(Ge,{children:a("Shard tables")}),$!==null&&(0,t.jsx)(ze,{className:"ms-auto tabular-nums",variant:"outline",children:i.length})]}),(0,t.jsx)(Ke,{children:Me.shard.hint})]}),(0,t.jsxs)(Le,{children:[g!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"sc-error",role:"alert",children:g}),$!==null&&$.length===0&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"sc-empty",children:a("No tables in this shard.")}),$!==null&&$.length>0&&i.length===0&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"sc-no-match",children:a("No tables match your filter.")}),i.length>0&&(0,t.jsx)("ul",{className:"-mx-3 overflow-hidden border-t border-border","data-testid":"sc-table-list",children:i.map(f=>{let re=`${C}:${f.name}`,H=L[re]??[];return(0,t.jsxs)(et,{expanded:o===f.name,name:f.name,onToggle:r(()=>{ue(he(f.name))},"onToggle"),rowCount:f.rowCount,rowTestId:`sc-table-${f.name}`,toggleTestId:`sc-toggle-${f.name}`,children:[(0,t.jsx)(tt,{columns:c[re]??Ze,testId:`sc-columns-${f.name}`}),H.length>0&&(0,t.jsx)(It,{heading:a("Indexes"),indexes:H,testId:`sc-indexes-${f.name}`})]},f.name)})})]})]}),(0,t.jsxs)(qe,{"data-testid":"sc-global-section",size:"sm",children:[(0,t.jsxs)(Pe,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(Re,{tier:"global"}),(0,t.jsx)(Ge,{children:a("Global tables (D1)")}),_!==null&&(0,t.jsx)(ze,{className:"ms-auto tabular-nums",variant:"outline",children:p.length})]}),(0,t.jsx)(Ke,{children:Me.global.hint})]}),(0,t.jsxs)(Le,{children:[b!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"sc-global-error",role:"alert",children:b}),_!==null&&_.length===0&&(0,t.jsx)(We,{description:Me.global.hint,testId:"sc-global-empty",title:a("No global tables.")}),_!==null&&_.length>0&&p.length===0&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"sc-global-no-match",children:a("No tables match your filter.")}),p.length>0&&(0,t.jsx)("ul",{className:"-mx-3 overflow-hidden border-t border-border","data-testid":"sc-global-table-list",children:p.map(f=>(0,t.jsx)(et,{expanded:P===f.name,name:f.name,onToggle:r(()=>{ue(Q(f.name))},"onToggle"),rowCount:f.rowCount,rowTestId:`sc-global-table-${f.name}`,toggleTestId:`sc-global-toggle-${f.name}`,children:(0,t.jsx)(tt,{columns:v[f.name]??Ze,testId:`sc-global-columns-${f.name}`})},f.name))})]})]})]}),e[62]=c,e[63]=g,e[64]=o,e[65]=p,e[66]=i,e[67]=v,e[68]=b,e[69]=P,e[70]=_,e[71]=L,e[72]=C,e[73]=a,e[74]=$,e[75]=he,e[76]=Q,e[77]=I,e[78]=ne):ne=e[78];let se;return e[79]!==le||e[80]!==U||e[81]!==ae||e[82]!==z||e[83]!==ne?(se=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-schema",children:[le,U,ae,z,ne]}),e[79]=le,e[80]=U,e[81]=ae,e[82]=z,e[83]=ne,e[84]=se):se=e[84],se},"Wt");function At(s){return(0,t.jsx)("li",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground",children:s},s)}r(At,"It");function Ft(s){return(0,t.jsxs)("li",{className:"flex flex-wrap items-center gap-1.5 text-xs",children:[(0,t.jsx)("span",{className:"font-mono",children:s.name}),(0,t.jsx)(ze,{variant:"outline",children:s.type}),s.unique===!0&&(0,t.jsx)(ze,{variant:"secondary",children:"unique"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:s.fields.join(", ")})]},`${s.type}:${s.name}`)}r(Ft,"kt");function zt(s){return s.name}r(zt,"At");export{Xt as SchemaViewer};
|