@lunora/studio 1.0.0-alpha.24 → 1.0.0-alpha.241
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +6 -0
- package/README.md +1 -1
- package/dist/index.d.mts +1581 -0
- package/dist/index.d.ts +976 -803
- package/dist/index.mjs +1 -0
- package/dist/mount.d.mts +22 -0
- package/dist/mount.d.ts +11 -10
- package/dist/mount.mjs +1 -0
- package/dist/packem_chunks/AdvisorHealthPanel.mjs +1 -0
- package/dist/packem_chunks/ApiTab.mjs +1 -0
- package/dist/packem_chunks/AuditPanel.mjs +1 -0
- package/dist/packem_chunks/DeploymentHealthPanel.mjs +1 -0
- package/dist/packem_chunks/ExportImportPanel.mjs +3 -0
- package/dist/packem_chunks/FileBrowser.mjs +4 -0
- package/dist/packem_chunks/FunctionRunner.mjs +1 -0
- package/dist/packem_chunks/FunctionStatsPanel.mjs +1 -0
- package/dist/packem_chunks/HealthPanel.mjs +1 -0
- package/dist/packem_chunks/InsightsPanel.mjs +1 -0
- package/dist/packem_chunks/LogsPanel.mjs +1 -0
- package/dist/packem_chunks/MailPanel.mjs +2 -0
- package/dist/packem_chunks/MetricsPanel.mjs +1 -0
- package/dist/packem_chunks/NotificationsPanel.mjs +1 -0
- package/dist/packem_chunks/PitrPanel.mjs +1 -0
- package/dist/packem_chunks/SchemaViewer.mjs +1 -0
- package/dist/packem_chunks/SecurityAdvisorPanel.mjs +1 -0
- package/dist/packem_chunks/SettingsPanel.mjs +1 -0
- package/dist/packem_chunks/SqlEditorPanel.mjs +10 -0
- package/dist/packem_chunks/TableEditor.mjs +1 -0
- package/dist/packem_chunks/agents-panel.mjs +1 -0
- package/dist/packem_chunks/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-B8yyk5BX.mjs +1 -0
- package/dist/packem_shared/ApiDocsPanel-fhDlZGE4.mjs +2 -0
- package/dist/packem_shared/ApiReferencePanel-CHoHM5ME.mjs +1 -0
- package/dist/packem_shared/CommandPalette-D9ZY-qQd.mjs +1 -0
- package/dist/packem_shared/ConfirmButton-DU4p72Er.mjs +1 -0
- package/dist/packem_shared/ConnectionBadge-B8Hj5DaE.mjs +1 -0
- package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-DuULO4XM.mjs +1 -0
- package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-D5YMT0gM.mjs +1 -0
- package/dist/packem_shared/DEFAULT_LOCALE-A1Yg5ORA.mjs +1 -0
- package/dist/packem_shared/DataBrowser-B-jVLGCS.mjs +4 -0
- package/dist/packem_shared/DataFilters-CYZFt2EK.mjs +1 -0
- package/dist/packem_shared/ErrorBoundary-BWNF98VF.mjs +1 -0
- package/dist/packem_shared/GlobalDataBrowser-DhObcZDY.mjs +1 -0
- package/dist/packem_shared/HomePanel-fJZRA0b0.mjs +1 -0
- package/dist/packem_shared/MigrationsPanel-QjQ4Gp9s.mjs +1 -0
- package/dist/packem_shared/OpenRpcReferencePanel-C8ctFJVm.mjs +1 -0
- package/dist/packem_shared/STUDIO_ROOT_CLASS-C6MccdVk.mjs +1 -0
- package/dist/packem_shared/ScheduledJobs-nPx7NmOE.mjs +1 -0
- package/dist/packem_shared/ShardInput-C6mjgAh4.mjs +1 -0
- package/dist/packem_shared/Studio-DQq17PO6.mjs +1 -0
- package/dist/packem_shared/StudioApp-DikgPBVJ.mjs +1 -0
- package/dist/packem_shared/StudioI18nProvider-fVsCSs5L.mjs +1 -0
- package/dist/packem_shared/advisor-view-BzzJg9D_.mjs +1 -0
- package/dist/packem_shared/aggregateMetrics-DKFJc-o5.mjs +1 -0
- package/dist/packem_shared/alert-PB5W11MM.mjs +1 -0
- package/dist/packem_shared/app.d-BbmO2HA2.d.mts +301 -0
- package/dist/packem_shared/app.d-BbmO2HA2.d.ts +301 -0
- package/dist/packem_shared/auth-pager-DiDnXsfe.mjs +1 -0
- package/dist/packem_shared/badge-r_5B4LHP.mjs +1 -0
- package/dist/packem_shared/bar-chart-BCsEIQoQ.mjs +6 -0
- package/dist/packem_shared/browser-storage-BH1MxLZs.mjs +1 -0
- package/dist/packem_shared/button-q0UYSmrn.mjs +1 -0
- package/dist/packem_shared/card--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-DIiNmDR9.mjs +1 -0
- package/dist/packem_shared/data-view-params-DhYmAkcj.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-DueSEkt-.mjs +1 -0
- package/dist/packem_shared/grid-features-OVIMIQan.mjs +6 -0
- package/dist/packem_shared/grid-pagination-DgzyzfBh.mjs +1 -0
- package/dist/packem_shared/home-panel-DBSHjxil.mjs +3 -0
- package/dist/packem_shared/input-CXhxesPC.mjs +1 -0
- package/dist/packem_shared/internal-Df43vQI0.mjs +2 -0
- package/dist/packem_shared/label-DKFzyHq6.mjs +1 -0
- package/dist/packem_shared/live-status-BuJdUZFU.mjs +1 -0
- package/dist/packem_shared/log-fields-SBxKyBug.mjs +1 -0
- package/dist/packem_shared/log-line-BHWXobrl.mjs +1 -0
- package/dist/packem_shared/modal-shell-CDztwLnv.mjs +1 -0
- package/dist/packem_shared/operation-console-provider-DoloEvon.mjs +1 -0
- package/dist/packem_shared/recording-client-CyFiAE2l.mjs +1 -0
- package/dist/packem_shared/reference-view-DSeKRrUU.mjs +13 -0
- package/dist/packem_shared/schema-diagram-CQ4vn0CN.mjs +2 -0
- package/dist/packem_shared/scroll-area-CXCQH7VT.mjs +2 -0
- package/dist/packem_shared/select-DPyS18Vy.mjs +2 -0
- package/dist/packem_shared/shard-history-CaO3C4KQ.mjs +1 -0
- package/dist/packem_shared/shortcuts-B9gDaXmw.mjs +1 -0
- package/dist/packem_shared/skeleton-DX1gfixl.mjs +1 -0
- package/dist/packem_shared/sparkline-B_sPPO_8.mjs +1 -0
- package/dist/packem_shared/sql-result-table-DyK762_A.mjs +1 -0
- package/dist/packem_shared/stat-card-D0Fe04cX.mjs +1 -0
- package/dist/packem_shared/storage-tier-C2mKwYRj.mjs +1 -0
- package/dist/packem_shared/studio-ajWxPNfI.mjs +2 -0
- package/dist/packem_shared/table-D0SBiDu-.mjs +2 -0
- package/dist/packem_shared/table-list-sidebar-DkPO_Qtz.mjs +1 -0
- package/dist/packem_shared/textarea--40GKAyz.mjs +1 -0
- package/dist/packem_shared/trace-handoff-BV3EWqy_.mjs +1 -0
- package/dist/packem_shared/use-admin-query-tlBof8Yg.mjs +1 -0
- package/dist/packem_shared/use-async-submit-CZqCMTJ_.mjs +1 -0
- package/dist/packem_shared/use-auth-config-Z_n4ABCI.mjs +1 -0
- package/dist/packem_shared/use-mirrored-ref-CVDf2z1M.mjs +1 -0
- package/dist/packem_shared/use-open-trace-DMVhpnyG.mjs +1 -0
- package/dist/packem_shared/use-shard-key-BsP3o5wT.mjs +1 -0
- package/dist/packem_shared/use-sql-assistant-CZydTzd5.mjs +1 -0
- package/dist/packem_shared/useDebounced-DVeQ5-oW.mjs +1 -0
- package/dist/packem_shared/utils-bhneXptQ.mjs +1 -0
- package/dist/packem_shared/virtual-rect-D_j7aLxX.mjs +1 -0
- package/dist/packem_shared/wire-codec-Bk4XZGE4.mjs +1 -0
- package/dist/standalone/chunk-225VJ77I.js +1 -0
- package/dist/standalone/chunk-2J55YJ2E.js +1 -0
- package/dist/standalone/chunk-2QEZHNYN.js +1 -0
- package/dist/standalone/chunk-2QSGCPIS.js +1 -0
- package/dist/standalone/chunk-2URQKGWU.js +1 -0
- package/dist/standalone/chunk-34NWQW5I.js +1 -0
- package/dist/standalone/chunk-35DM4JJG.js +1 -0
- package/dist/standalone/chunk-3CKNGJM2.js +1 -0
- package/dist/standalone/chunk-3EYROC6C.js +4 -0
- package/dist/standalone/chunk-3FBLWUXD.js +1 -0
- package/dist/standalone/chunk-3FRJI6NR.js +8 -0
- package/dist/standalone/chunk-3Q2P62UR.js +1 -0
- package/dist/standalone/chunk-44JBWMGP.js +1 -0
- package/dist/standalone/chunk-4GTO7FL5.js +1 -0
- package/dist/standalone/chunk-4JLGLPWV.js +1 -0
- package/dist/standalone/chunk-4L4WTGN5.js +1 -0
- package/dist/standalone/chunk-4MCQC7BJ.js +1 -0
- package/dist/standalone/chunk-4REGPZ4H.js +1 -0
- package/dist/standalone/chunk-4XEY3TRX.js +1 -0
- package/dist/standalone/chunk-4ZEL6BYL.js +1 -0
- package/dist/standalone/chunk-55754F6H.js +1 -0
- package/dist/standalone/chunk-57L4KVGF.js +1 -0
- package/dist/standalone/chunk-5EBY4EMG.js +1 -0
- package/dist/standalone/chunk-5EKU6J7E.js +5 -0
- package/dist/standalone/chunk-5JDWLCSH.js +1 -0
- package/dist/standalone/chunk-5NVDRSFP.js +1 -0
- package/dist/standalone/chunk-5WJXVZMZ.js +1 -0
- package/dist/standalone/chunk-5XPSGVCH.js +1 -0
- package/dist/standalone/chunk-66UGPQVC.js +1 -0
- package/dist/standalone/chunk-6D6Z2KXU.js +1 -0
- package/dist/standalone/chunk-6DAD3RFX.js +1 -0
- package/dist/standalone/chunk-6HMCWDDT.js +3 -0
- package/dist/standalone/chunk-6MQFFSKJ.js +1 -0
- package/dist/standalone/chunk-72GVG7ZA.js +1 -0
- package/dist/standalone/chunk-76QJJLPM.js +59 -0
- package/dist/standalone/chunk-7G7ISHLL.js +1 -0
- package/dist/standalone/chunk-7HAPF2LE.js +1 -0
- package/dist/standalone/chunk-7Z77NNDU.js +1 -0
- package/dist/standalone/chunk-AANB526D.js +6 -0
- package/dist/standalone/chunk-AAVLPU5Q.js +1 -0
- package/dist/standalone/chunk-AWHXPIXU.js +1 -0
- package/dist/standalone/chunk-B2HYHTIX.js +1 -0
- package/dist/standalone/chunk-BCGDH443.js +1 -0
- package/dist/standalone/chunk-BDITYO6M.js +14 -0
- package/dist/standalone/chunk-C5AOTUZH.js +1 -0
- package/dist/standalone/chunk-CMA4PTV7.js +1 -0
- package/dist/standalone/chunk-CSUROWL2.js +1 -0
- package/dist/standalone/chunk-CZ266IR3.js +1 -0
- package/dist/standalone/chunk-CZMVDPDO.js +1 -0
- package/dist/standalone/chunk-DXVAAESF.js +1 -0
- package/dist/standalone/chunk-EA2JKR5D.js +1 -0
- package/dist/standalone/chunk-EBVHCQDJ.js +1 -0
- package/dist/standalone/chunk-EIISOYGA.js +1 -0
- package/dist/standalone/chunk-EJSI4PMU.js +1 -0
- package/dist/standalone/chunk-EKI5NWS5.js +1 -0
- package/dist/standalone/chunk-ES7C5MLI.js +3 -0
- package/dist/standalone/chunk-EVTM6Q43.js +1 -0
- package/dist/standalone/chunk-F7UC63UN.js +1 -0
- package/dist/standalone/chunk-FEWMAPNI.js +1 -0
- package/dist/standalone/chunk-FHG2QEL4.js +1 -0
- package/dist/standalone/chunk-FKVZRPV5.js +1 -0
- package/dist/standalone/chunk-FSRSK4LY.js +1 -0
- package/dist/standalone/chunk-FXOLFSG4.js +1 -0
- package/dist/standalone/chunk-G7FODHE4.js +1 -0
- package/dist/standalone/chunk-GMS77BZD.js +1 -0
- package/dist/standalone/chunk-HEAQVSNS.js +1 -0
- package/dist/standalone/chunk-I7XX4RBG.js +1 -0
- package/dist/standalone/chunk-IHMGCHAA.js +1 -0
- package/dist/standalone/chunk-IMOHEGMV.js +1 -0
- package/dist/standalone/chunk-IS6LVJ6L.js +1 -0
- package/dist/standalone/chunk-IZTVQDA3.js +1 -0
- package/dist/standalone/chunk-JOVONUS6.js +1 -0
- package/dist/standalone/chunk-K7AJEMKE.js +1 -0
- package/dist/standalone/chunk-LCRAEP3B.js +1 -0
- package/dist/standalone/chunk-M5UWPXQ3.js +1 -0
- package/dist/standalone/chunk-MRAMNVDG.js +1 -0
- package/dist/standalone/chunk-MU3P2FI7.js +1 -0
- package/dist/standalone/chunk-MXLAOCAN.js +1 -0
- package/dist/standalone/chunk-N5WACH4X.js +15 -0
- package/dist/standalone/chunk-NCFRIHLB.js +1 -0
- package/dist/standalone/chunk-NFS7FTAR.js +1 -0
- package/dist/standalone/chunk-NPF3GY2E.js +15 -0
- package/dist/standalone/chunk-NT2KYUYG.js +1 -0
- package/dist/standalone/chunk-NVIFBILD.js +1 -0
- package/dist/standalone/chunk-OGUKYRFM.js +1 -0
- package/dist/standalone/chunk-OKG3HWSJ.js +1 -0
- package/dist/standalone/chunk-OOTQQBVC.js +1 -0
- package/dist/standalone/chunk-PDSH4NPA.js +1 -0
- package/dist/standalone/chunk-PLHA3OWK.js +3 -0
- package/dist/standalone/chunk-PTZD7RUZ.js +19 -0
- package/dist/standalone/chunk-PW5YXLOU.js +2 -0
- package/dist/standalone/chunk-Q3LDA6LU.js +1 -0
- package/dist/standalone/chunk-Q4CAKBWN.js +1 -0
- package/dist/standalone/chunk-QKEJLVC5.js +1 -0
- package/dist/standalone/chunk-RFNGDE33.js +1 -0
- package/dist/standalone/chunk-RPJEAHAZ.js +1 -0
- package/dist/standalone/chunk-RPQL45FL.js +1 -0
- package/dist/standalone/chunk-S3CRZLGS.js +1 -0
- package/dist/standalone/chunk-S5JZR7QX.js +1 -0
- package/dist/standalone/chunk-SJVMPGAR.js +4 -0
- package/dist/standalone/chunk-SPGA4XL7.js +1 -0
- package/dist/standalone/chunk-SS2DZEKJ.js +1 -0
- package/dist/standalone/chunk-SXGQQHMD.js +1 -0
- package/dist/standalone/chunk-TI33XMKX.js +9 -0
- package/dist/standalone/chunk-TIYNL2DI.js +1 -0
- package/dist/standalone/chunk-TNFY5M3M.js +1 -0
- package/dist/standalone/chunk-U3N3BHO4.js +1 -0
- package/dist/standalone/chunk-ULIQFBZU.js +1 -0
- package/dist/standalone/chunk-UXXDN6Z3.js +1 -0
- package/dist/standalone/chunk-UYEZR3BI.js +1 -0
- package/dist/standalone/chunk-V3CZW3JB.js +1 -0
- package/dist/standalone/chunk-V3VJAA4D.js +1 -0
- package/dist/standalone/chunk-VL2YOLHO.js +1 -0
- package/dist/standalone/chunk-WDVLOAJ4.js +1 -0
- package/dist/standalone/chunk-WUWBZPUK.js +1 -0
- package/dist/standalone/chunk-X3LPHVDL.js +1 -0
- package/dist/standalone/chunk-XZMOZFE6.js +1 -0
- package/dist/standalone/chunk-Y6CXU7T4.js +1 -0
- package/dist/standalone/chunk-YEKI5KIW.js +1 -0
- package/dist/standalone/chunk-YERR37A2.js +1 -0
- package/dist/standalone/chunk-YKXDMIHQ.js +1 -0
- package/dist/standalone/chunk-YOB2X3FZ.js +1 -0
- package/dist/standalone/chunk-YPRQLCKF.js +1 -0
- package/dist/standalone/chunk-Z5O2NQAV.js +1 -0
- package/dist/standalone/chunk-ZCBZMZ7W.js +1 -0
- package/dist/standalone/chunk-ZFC65NB2.js +1 -0
- package/dist/standalone/chunk-ZGHK6YA6.js +1 -0
- package/dist/standalone/studio.js +9 -378
- package/dist/styles.css +2 -2
- package/package.json +24 -20
- package/dist/index.js +0 -41
- package/dist/mount.js +0 -26
- package/dist/packem_shared/ADMIN_FUNCTIONS-CdaxLGkE.js +0 -48
- package/dist/packem_shared/ApiDocsPanel-BgrN4kml.js +0 -842
- package/dist/packem_shared/ApiReferencePanel-1vubqG5s.js +0 -229
- package/dist/packem_shared/ApiTab-CHkX49o_.js +0 -251
- package/dist/packem_shared/AuditPanel-CP9HM9nq.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-Bb1gTQ6c.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-Dj87tRa5.js +0 -197
- package/dist/packem_shared/FileBrowser-CWvxp_is.js +0 -2932
- package/dist/packem_shared/FunctionRunner-DlWApMCH.js +0 -343
- package/dist/packem_shared/FunctionStatsPanel-CuO2Tmw-.js +0 -375
- package/dist/packem_shared/GlobalDataBrowser-3X9uRfdO.js +0 -289
- package/dist/packem_shared/HealthPanel-Dj0GRo5P.js +0 -648
- package/dist/packem_shared/HomePanel-BewOCuag.js +0 -1334
- package/dist/packem_shared/InsightsPanel-y_Q-xdPY.js +0 -461
- package/dist/packem_shared/LogsPanel-C7crgYoS.js +0 -827
- package/dist/packem_shared/MailPanel-PILidruz.js +0 -440
- package/dist/packem_shared/MetricsPanel-DioILzgf.js +0 -1611
- package/dist/packem_shared/MigrationsPanel-DkIcRoE5.js +0 -239
- package/dist/packem_shared/OpenRpcReferencePanel-vbcYbv3V.js +0 -191
- package/dist/packem_shared/PitrPanel-yKJ1JPPk.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-CNr8Wame.js +0 -2512
- package/dist/packem_shared/SecurityAdvisorPanel-BBzv7L3c.js +0 -92
- package/dist/packem_shared/SettingsPanel-BKSKl8tl.js +0 -390
- package/dist/packem_shared/ShardInput-gx_DZXXn.js +0 -107
- package/dist/packem_shared/SqlEditorPanel-CkemCQvy.js +0 -13
- package/dist/packem_shared/Studio-QkOjc2NS.js +0 -33
- package/dist/packem_shared/StudioApp-TEElspKL.js +0 -657
- package/dist/packem_shared/StudioI18nProvider-B-tDCZIi.js +0 -48
- package/dist/packem_shared/TableEditor-JS3sXYgS.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-Cnij4Zp5.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-CUJoYF1Z.js +0 -2562
- package/dist/packem_shared/storage-tier-CL98eOvn.js +0 -85
- package/dist/packem_shared/studio-c5Vf7kSh.js +0 -11532
- package/dist/packem_shared/table-_RzNvy3R.js +0 -246
- package/dist/packem_shared/table-editor-9fhJ4hMJ.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,15 @@
|
|
|
1
|
+
import{a as ct,b as dt}from"./chunk-TIYNL2DI.js";import{c as at}from"./chunk-AANB526D.js";import{a as it}from"./chunk-OOTQQBVC.js";import"./chunk-RFNGDE33.js";import"./chunk-V3CZW3JB.js";import"./chunk-MU3P2FI7.js";import"./chunk-XZMOZFE6.js";import"./chunk-YPRQLCKF.js";import"./chunk-GMS77BZD.js";import"./chunk-3Q2P62UR.js";import{a as lt}from"./chunk-QKEJLVC5.js";import"./chunk-AWHXPIXU.js";import"./chunk-V3VJAA4D.js";import"./chunk-76QJJLPM.js";import"./chunk-5JDWLCSH.js";import"./chunk-EVTM6Q43.js";import"./chunk-NFS7FTAR.js";import{a as rt}from"./chunk-EJSI4PMU.js";import{b as ot}from"./chunk-OGUKYRFM.js";import{c as nt,d as Ne,e as De,f as Ae,g as Ke}from"./chunk-OKG3HWSJ.js";import{W as Qe}from"./chunk-PLHA3OWK.js";import"./chunk-Y6CXU7T4.js";import"./chunk-4L4WTGN5.js";import"./chunk-55754F6H.js";import"./chunk-IS6LVJ6L.js";import"./chunk-AAVLPU5Q.js";import"./chunk-225VJ77I.js";import{a as st}from"./chunk-ULIQFBZU.js";import{a as ke}from"./chunk-4ZEL6BYL.js";import"./chunk-RPJEAHAZ.js";import{f as _e}from"./chunk-TI33XMKX.js";import"./chunk-FSRSK4LY.js";import"./chunk-NPF3GY2E.js";import"./chunk-HEAQVSNS.js";import{d as ae,f as Se,g as Ce,h as tt,p as me}from"./chunk-PTZD7RUZ.js";import{a,d as Fe,e as Lt,f as Rt,g as _t,i as ue}from"./chunk-YKXDMIHQ.js";var Z=Fe(Rt(),1);var B=Fe(Lt(),1);var u=Fe(_t(),1);var qe=class{static{a(this,"Diff")}diff(e,n,t={}){let r;typeof t=="function"?(r=t,t={}):"callback"in t&&(r=t.callback);let o=this.castInput(e,t),l=this.castInput(n,t),i=this.removeEmpty(this.tokenize(o,t)),c=this.removeEmpty(this.tokenize(l,t));return this.diffWithOptionsObj(i,c,t,r)}diffWithOptionsObj(e,n,t,r){var o;let l=a(p=>{if(p=this.postProcess(p,t),r){setTimeout(function(){r(p)},0);return}else return p},"done"),i=n.length,c=e.length,d=1,m=i+c;t.maxEditLength!=null&&(m=Math.min(m,t.maxEditLength));let x=(o=t.timeout)!==null&&o!==void 0?o:1/0,h=Date.now()+x,v=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(v[0],n,e,0,t);if(v[0].oldPos+1>=c&&f+1>=i)return l(this.buildValues(v[0].lastComponent,n,e));let N=-1/0,b=1/0,w=a(()=>{for(let p=Math.max(N,-d);p<=Math.min(b,d);p+=2){let S,y=v[p-1],g=v[p+1];y&&(v[p-1]=void 0);let C=!1;if(g){let q=g.oldPos-p;C=g&&0<=q&&q<i}let k=y&&y.oldPos+1<c;if(!C&&!k){v[p]=void 0;continue}if(!k||C&&y.oldPos<g.oldPos?S=this.addToPath(g,!0,!1,0,t):S=this.addToPath(y,!1,!0,1,t),f=this.extractCommon(S,n,e,p,t),S.oldPos+1>=c&&f+1>=i)return l(this.buildValues(S.lastComponent,n,e))||!0;v[p]=S,S.oldPos+1>=c&&(b=Math.min(b,p-1)),f+1>=i&&(N=Math.max(N,p+1))}d++},"execEditLength");if(r)a(function p(){setTimeout(function(){if(d>m||Date.now()>h)return r(void 0);w()||p()},0)},"exec")();else for(;d<=m&&Date.now()<=h;){let p=w();if(p)return p}}addToPath(e,n,t,r,o){let l=e.lastComponent;return l&&!o.oneChangePerToken&&l.added===n&&l.removed===t?{oldPos:e.oldPos+r,lastComponent:{count:l.count+1,added:n,removed:t,previousComponent:l.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:n,removed:t,previousComponent:l}}}extractCommon(e,n,t,r,o){let l=n.length,i=t.length,c=e.oldPos,d=c-r,m=0;for(;d+1<l&&c+1<i&&this.equals(t[c+1],n[d+1],o);)d++,c++,m++,o.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return m&&!o.oneChangePerToken&&(e.lastComponent={count:m,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=c,d}equals(e,n,t){return t.comparator?t.comparator(e,n):e===n||!!t.ignoreCase&&e.toLowerCase()===n.toLowerCase()}removeEmpty(e){let n=[];for(let t=0;t<e.length;t++)e[t]&&n.push(e[t]);return n}castInput(e,n){return e}tokenize(e,n){return Array.from(e)}join(e){return e.join("")}postProcess(e,n){return e}get useLongestToken(){return!1}buildValues(e,n,t){let r=[],o;for(;e;)r.push(e),o=e.previousComponent,delete e.previousComponent,e=o;r.reverse();let l=r.length,i=0,c=0,d=0;for(;i<l;i++){let m=r[i];if(m.removed)m.value=this.join(t.slice(d,d+m.count)),d+=m.count;else{if(!m.added&&this.useLongestToken){let x=n.slice(c,c+m.count);x=x.map(function(h,v){let f=t[d+v];return f.length>h.length?f:h}),m.value=this.join(x)}else m.value=this.join(n.slice(c,c+m.count));c+=m.count,m.added||(d+=m.count)}}return r}};var Ue=class extends qe{static{a(this,"LineDiff")}constructor(){super(...arguments),this.tokenize=Dt}equals(e,n,t){return t.ignoreWhitespace?((!t.newlineIsToken||!e.includes(`
|
|
2
|
+
`))&&(e=e.trim()),(!t.newlineIsToken||!n.includes(`
|
|
3
|
+
`))&&(n=n.trim())):t.ignoreNewlineAtEof&&!t.newlineIsToken&&(e.endsWith(`
|
|
4
|
+
`)&&(e=e.slice(0,-1)),n.endsWith(`
|
|
5
|
+
`)&&(n=n.slice(0,-1))),super.equals(e,n,t)}},ut=new Ue;function Ge(s,e,n){return ut.diff(s,e,n)}a(Ge,"diffLines");function Dt(s,e){e.stripTrailingCr&&(s=s.replace(/\r\n/g,`
|
|
6
|
+
`));let n=[],t=s.split(/(\n|\r\n)/);t[t.length-1]||t.pop();for(let r=0;r<t.length;r++){let o=t[r];r%2&&!e.newlineIsToken?n[n.length-1]+=o:n.push(o)}return n}a(Dt,"tokenize");var At="x",mt=" ",Mt={'"':'"',"'":"'","[":"]","`":"`"},gt=a((s,e)=>{let n=e+2;for(;n<s.length&&s[n]!==`
|
|
7
|
+
`;)n+=1;return n},"rt"),xt=a((s,e)=>{let n=s.indexOf("*/",e+2);return n===-1?-1:n+2},"it"),vt=a(s=>{let e=s.split(""),n=0;for(;n<s.length;){let t=s[n]??"",r=Mt[t];if(t==="-"&&s[n+1]==="-"){let o=gt(s,n);e.fill(mt,n,o),n=o}else if(t==="/"&&s[n+1]==="*"){let o=xt(s,n);if(o===-1)return;e.fill(mt,n,o),n=o}else if(r!==void 0){let o=n+1;for(;o<s.length;)if(s[o]!==r)o+=1;else if(r!=="]"&&s[o+1]===r)o+=2;else break;if(o>=s.length)return;e.fill(At,n,o+1),n=o+1}else n+=1}for(let t=0;t<s.length;t+=1)s[t]===`
|
|
8
|
+
`&&(e[t]=`
|
|
9
|
+
`);return e.join("")},"at"),Ot=/^(?:explain\s+(?:query\s+plan\s+)?)?(?:select|with)\b/iu,Pt=/\b(?:alter|attach|create|delete|detach|drop|insert|pragma|reindex|truncate|update|vacuum)\b|\breplace\b(?!\s*\()/iu,$t=/^\w+/u,jt=/;\s*$/u,zt=/\s/u,yt=a(s=>{let e=0;for(;e<s.length;){let n=s[e];if(n!==void 0&&zt.test(n))e+=1;else if(n==="-"&&s[e+1]==="-")e=gt(s,e);else if(n==="/"&&s[e+1]==="*"){let t=xt(s,e);if(t===-1)break;e=t}else break}return e},"ct"),Ht=a(s=>{let e=yt(s),n=s.slice(e).trimEnd();if(n==="")return{code:"SQL_EMPTY",message:"the query is empty"};let t=(vt(n)??n).replace(jt,""),r=n.slice(0,t.length),o=t.indexOf(";");if(o!==-1)return{code:"SQL_MULTIPLE_STATEMENTS",length:1,message:"only a single statement may be run",offset:e+o};let l="the SQL editor is read-only \u2014 only SELECT / WITH / EXPLAIN queries are allowed";if(!Ot.test(r))return{code:"SQL_NOT_READONLY",length:$t.exec(r)?.[0].length??1,message:l,offset:e};let i=Pt.exec(r);if(i!==null)return{code:"SQL_NOT_READONLY",length:i[0].length,message:`${l} (\`${i[0].toUpperCase()}\` is not allowed)`,offset:e+i.index}},"Ht"),Wt=/^explain\b/iu,Bt=a(s=>Wt.test(s.slice(yt(s)))?s:`EXPLAIN QUERY PLAN ${s}`,"Ft"),Ye=a((s,e)=>{let n=s.trim();if(n==="")return[];let t=e+s.indexOf(n),r=Ht(n);return r?.code==="SQL_EMPTY"?[]:[r===void 0?{offset:t,sql:n}:{offset:t,rejection:r,sql:n}]},"ze"),wt=a(s=>{let e=vt(s);if(e===void 0)return Ye(s,0);let n=[],t=0;for(let r=0;r<=e.length;r+=1)r!==e.length&&e[r]!==";"||(n.push(...Ye(s.slice(t,r),t)),t=r+1);return n},"dt"),Ft=["ORDER BY","GROUP BY","LEFT JOIN","RIGHT JOIN","INNER JOIN","OUTER JOIN","CROSS JOIN","EXPLAIN QUERY PLAN","SELECT","DISTINCT","FROM","WHERE","HAVING","LIMIT","OFFSET","JOIN","ON","AND","OR","AS","ASC","DESC","WITH","UNION","EXPLAIN"],Qt=["FROM","WHERE","ORDER BY","GROUP BY","HAVING","LIMIT","OFFSET","UNION","JOIN","LEFT JOIN","RIGHT JOIN","INNER JOIN","OUTER JOIN","CROSS JOIN"],$e=String.fromCodePoint(0),Kt=new RegExp(`${$e}${String.raw`(\d+)`}${$e}`,"gu"),Ut=Ft.map(s=>({pattern:new RegExp(String.raw`\b${s.replaceAll(" ",String.raw`\s+`)}\b`,"giu"),replacement:s})),Gt=Qt.map(s=>({pattern:new RegExp(String.raw`\s+${s.replaceAll(" ",String.raw`\s+`)}\b`,"gu"),replacement:`
|
|
10
|
+
${s}`})),Jt=a(s=>{let e=[],n=s.replaceAll(/'(?:[^']|'')*'/gu,t=>(e.push(t),`${$e}${(e.length-1).toString()}${$e}`)).replaceAll(/\s+/gu," ").trim();for(let{pattern:t,replacement:r}of Ut)n=n.replaceAll(t,r);for(let{pattern:t,replacement:r}of Gt)n=n.replaceAll(t,r);return n=n.replaceAll(Kt,(t,r)=>e[Number(r)]??""),n},"jt"),Yt=/\b(?:from|join)\s+([a-z_][\w$]*)(?:\s+(?:as\s+)?([a-z_][\w$]*))?/giu,Vt=/(?:\bwith\s+(?:recursive\s+)?|,\s*)([a-z_][\w$]*)\s+as\s*\(/giu,Xt=new Set(["cross","full","group","having","inner","join","left","limit","offset","on","order","right","union","using","where","window"]),Zt=/[^\n]/gu,en=a((s,e)=>{let n=s[e];if(n==="'"){let t=e+1;for(;t<s.length&&s[t]!=="'";)t+=1;return Math.min(t+1,s.length)}if(n==="-"&&s[e+1]==="-"){let t=s.indexOf(`
|
|
11
|
+
`,e);return t===-1?s.length:t}if(n==="/"&&s[e+1]==="*"){let t=s.indexOf("*/",e+2);return t===-1?s.length:t+2}return-1},"Xt"),tn=a(s=>{let e="",n=0;for(;n<s.length;){let t=en(s,n);t===-1?(e+=s.slice(n,n+1),n+=1):(e+=s.slice(n,t).replaceAll(Zt," "),n=t)}return e},"Zt"),nn=a(s=>{let e=new Set;for(let n of s.matchAll(Vt))e.add((n[1]??"").toLowerCase());return e},"en"),on=a((s,e)=>{let n=new Map;for(let t of s.matchAll(Yt)){let r=(t[1]??"").toLowerCase(),o=(t[2]??"").toLowerCase();e.has(r)&&(n.set(r,r),o!==""&&!Xt.has(o)&&n.set(o,r))}return n},"tn"),St=a((s,e)=>{let n=tn(s),t=new Set(e.map(r=>r.toLowerCase()));return{ctes:nn(n),masked:n,targets:on(n,t)}},"ut"),rn=/^(?:__lunora|sqlite_)/iu,sn=/\b(?:from|join)\s+([a-z_][\w$]*)/giu,ln=/\b([a-z_][\w$]*)\.([a-z_][\w$]*)/giu,an=new Set(["cross","full","group","having","inner","join","lateral","left","limit","offset","order","right","select","union","where","window"]),cn=a((s,e,n)=>{let t=[];for(let r of s.matchAll(sn)){let o=r[1]??"",l=o.toLowerCase();!e.has(l)&&!n.has(l)&&!an.has(l)&&!rn.test(o)&&t.push({length:o.length,message:`unknown table \`${o}\``,offset:r.index+r[0].length-o.length,severity:"error",source:"schema"})}return t},"rn"),dn=a((s,e,n)=>{let t=[],r=new Map;for(let[o,l]of Object.entries(e.columns))r.set(o.toLowerCase(),new Set(l.map(i=>i.toLowerCase())));for(let o of s.matchAll(ln)){let l=(o[1]??"").toLowerCase(),i=o[2]??"",c=n.get(l),d=c===void 0?void 0:r.get(c);d!==void 0&&!d.has(i.toLowerCase())&&t.push({length:i.length,message:`\`${c??""}\` has no column \`${i}\``,offset:o.index+o[0].length-i.length,severity:"error",source:"schema"})}return t},"an"),un=/(?<![\w$."])(?:"([a-z_][\w$]*)"|([a-z_][\w$]*))(?![.(])/giu,mn=/\bas\s+"?([a-z_][\w$]*)"?/giu,fn=a((s,e,n,t)=>{let r=[...new Set(n.values())],o=new Map,l=new Set;for(let d of r){for(let m of e.columns[d]??[])l.add(m.toLowerCase());for(let m of e.docFields?.[d]??[])o.set(m.toLowerCase(),m)}if(o.size===0)return[];let i=new Set([...s.matchAll(mn)].map(d=>(d[1]??"").toLowerCase())),c=[];for(let d of s.matchAll(un)){let m=d[1],x=m??d[2]??"",h=x.toLowerCase(),v=o.get(h);v===void 0||l.has(h)||i.has(h)||t.has(h)||n.has(h)||c.push({length:x.length,message:`\`${v}\` is a \`__doc__\` field, not a column \u2014 use \`json_extract(__doc__, '$.${v}')\``,offset:d.index+(m===void 0?0:1),severity:"error",source:"schema"})}return c},"un"),hn=a((s,e)=>{if(s.trim()==="")return[];let n=wt(s),t=new Set(e.tables.map(o=>o.toLowerCase())),r=[];for(let o of n){let{offset:l,rejection:i}=o;if(i!==void 0){r.push({length:i.length,message:i.message,offset:i.offset===void 0?l:l+i.offset,severity:"error",source:"gate"});continue}let{ctes:c,masked:d,targets:m}=St(o.sql,e.tables);r.push(...[...cn(d,t,c),...dn(d,e,m),...fn(d,e,m,c)].map(x=>({...x,offset:x.offset===void 0?l:l+x.offset})))}return r},"fn"),pn=Se(ke.lintSql),bn=600,gn=a((s,e,n)=>{let t=_e(),[r,o]=(0,B.useState)([]),l=(0,B.useMemo)(()=>hn(s,e),[s,e]),i=lt(s,bn),c=l.some(x=>x.source==="gate")||i.trim()==="",d=(0,B.useCallback)(async x=>{try{let h=await t.query(pn,{sql:i},Ce(n));x.cancelled||o(h.diagnostics??[])}catch{x.cancelled||o([])}},[t,i,n]);(0,B.useEffect)(()=>{if(c){o([]);return}let x={cancelled:!1};return me(d(x)),()=>{x.cancelled=!0}},[d,c]);let m=i===s;return(0,B.useMemo)(()=>m?[...l,...r]:l,[l,r,m])},"hn"),Me=8,xn=["AND","ASC","AS","BY","COUNT","DESC","DISTINCT","EXPLAIN","FROM","GROUP","HAVING","INNER","JOIN","LEFT","LIKE","LIMIT","NOT","NULL","OFFSET","ON","ORDER","OR","QUERY","SELECT","WHERE","WITH"],vn=new Set(["AND","BY","HAVING","ON","OR","SELECT","WHERE"]),yn=/[\w$]/,Ct=a(s=>s!==void 0&&yn.test(s),"ft"),kt=a(s=>{let e=s.length;for(;e>0&&Ct(s[e-1]);)e-=1;return s.slice(e)},"mt"),Nt=a((s,e)=>{let n=e;for(;n>0&&Ct(s[n-1]);)n-=1;return{end:e,start:n,text:s.slice(n,e)}},"pt"),ft=a((s,e)=>{let n=s.slice(0,e).trimEnd();return n.endsWith(".")||vn.has(kt(n).toUpperCase())},"et"),wn=a((s,e,n)=>{let t=s.slice(0,e);if(!t.endsWith("."))return;let r=kt(t.slice(0,-1));if(r!=="")return St(s,n).targets.get(r.toLowerCase())??r},"yn"),Ve=a((s,e)=>s.toLowerCase().startsWith(e.toLowerCase()),"Ye"),ht=a((s,e,n,t)=>{let r=[];for(let o of s)if(Ve(o,e)&&(r.push(t(o)),r.length>=n))break;return r},"tt"),Sn=a((s,e,n)=>{let t=new Map;for(let[r,o]of Object.entries(s.columns))for(let l of o)if(Ve(l,e)&&!t.has(l)&&(t.set(l,r),t.size>=n))return[...t].map(([i,c])=>({detail:c,kind:"column",label:i}));return[...t].map(([r,o])=>({detail:o,kind:"column",label:r}))},"vn"),Cn=a((s,e,n)=>{let t=Nt(s,e),r=wn(s,t.start,n.tables);if(r!==void 0){let c=n.columns[r]??n.columns[r.toLowerCase()]??[];return ht(c,t.text,Me,d=>({detail:r,kind:"column",label:d}))}if(t.text===""&&!ft(s,t.start))return[];let o=ht(n.tables,t.text,Me,c=>({kind:"table",label:c})),l=Sn(n,t.text,Me),i=xn.flatMap(c=>t.text!==""&&Ve(c,t.text)&&c.toLowerCase()!==t.text.toLowerCase()?[{kind:"keyword",label:c}]:[]);return(ft(s,t.start)?[...l,...o,...i]:[...o,...l,...i]).slice(0,Me)},"Sn"),kn=a((s,e,n)=>{let t=Nt(s,e),r=s.slice(0,t.start)+n.label+s.slice(t.end);return{caret:t.start+n.label.length,value:r}},"wn"),Nn=["boxSizing","borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textTransform","width","wordSpacing"],qn=a((s,e)=>{let n=globalThis.getComputedStyle(s),t=globalThis.document.createElement("div"),{style:r}=t;r.position="absolute",r.visibility="hidden",r.whiteSpace="pre-wrap",r.overflowWrap="break-word";for(let c of Nn)r[c]=n[c];t.textContent=s.value.slice(0,Math.max(0,e));let o=globalThis.document.createElement("span");o.textContent=s.value.slice(Math.max(0,e))||".",t.append(o),globalThis.document.body.append(t);let l=o.offsetLeft-s.scrollLeft,i=o.offsetTop-s.scrollTop;return t.remove(),{left:l,top:i}},"En"),En=a((s,e,n)=>{let t=(0,Z.c)(16),[r,o]=(0,B.useState)(null),l;t[0]!==s||t[1]!==e?(l=a((w,p)=>{let S=Cn(w,p,s);if(S.length===0){o(null);return}let y=e.current,{left:g,top:C}=y===null?{left:0,top:0}:qn(y,p);o(k=>k!==null&&k.active===0&&k.left===g&&k.top===C&&k.suggestions.length===S.length&&k.suggestions.every((q,E)=>{let T=S.at(E);return q.kind===T?.kind&&q.label===T.label&&q.detail===T.detail})?k:{active:0,left:g,suggestions:S,top:C})},"r"),t[0]=s,t[1]=e,t[2]=l):l=t[2];let i=l,c;t[3]===Symbol.for("react.memo_cache_sentinel")?(c=a(()=>{o(null)},"c"),t[3]=c):c=t[3];let d=c,m;t[4]===Symbol.for("react.memo_cache_sentinel")?(m=a(w=>{o(p=>{if(p===null)return p;let S=p.suggestions.length,y=(p.active+w+S)%S;return{...p,active:y}})},"f"),t[4]=m):m=t[4];let x=m,h;t[5]!==n||t[6]!==r||t[7]!==e?(h=a(w=>{let p=e.current;if(r===null||p===null)return!1;let S=r.suggestions[w??r.active];if(S===void 0)return!1;let y=kn(p.value,p.selectionStart,S);return n(y.value),o(null),requestAnimationFrame(()=>{let g=e.current;g!==null&&(g.focus(),g.setSelectionRange(y.caret,y.caret))}),!0},"u"),t[5]=n,t[6]=r,t[7]=e,t[8]=h):h=t[8];let v=h,f;t[9]!==v?(f=a(()=>v(),"d"),t[9]=v,t[10]=f):f=t[10];let N=f,b;return t[11]!==N||t[12]!==v||t[13]!==i||t[14]!==r?(b={close:d,commit:N,commitAt:v,move:x,refresh:i,state:r},t[11]=N,t[12]=v,t[13]=i,t[14]=r,t[15]=b):b=t[15],b},"Nn"),Tn={column:"column",keyword:"keyword",table:"table"},In=20,Ln=a(s=>{let e=(0,Z.c)(17),{listboxId:n,onPick:t,state:r}=s,o=ae(),l;e[0]!==r?(l=r===null?void 0:{left:r.left,top:r.top+In},e[0]=r,e[1]=l):l=e[1];let i=l;if(r===null)return null;let c;if(e[2]!==n||e[3]!==t||e[4]!==r.active||e[5]!==r.suggestions||e[6]!==o){let m;e[8]!==n||e[9]!==t||e[10]!==r.active||e[11]!==o?(m=a((x,h)=>(0,u.jsxs)("li",{"aria-selected":h===r.active,className:ue("flex cursor-pointer items-center gap-2 px-2 py-1 text-[13px]",h===r.active?"bg-accent text-accent-foreground":"text-foreground"),"data-testid":"sql-autocomplete-item",id:`${n}-opt-${h.toString()}`,onMouseDown:a(v=>{v.preventDefault(),t(h)},"onMouseDown"),role:"option",children:[(0,u.jsx)("span",{className:"truncate font-mono",children:x.label}),x.detail!==void 0&&(0,u.jsx)("span",{className:"ms-auto truncate text-xs text-muted-foreground",children:x.detail}),(0,u.jsx)("span",{className:"shrink-0 font-mono text-[10px] tracking-wide text-muted-foreground/70 uppercase",children:o(Tn[x.kind])})]},`${x.kind}:${x.label}`),"f"),e[8]=n,e[9]=t,e[10]=r.active,e[11]=o,e[12]=m):m=e[12],c=r.suggestions.map(m),e[2]=n,e[3]=t,e[4]=r.active,e[5]=r.suggestions,e[6]=o,e[7]=c}else c=e[7];let d;return e[13]!==n||e[14]!==i||e[15]!==c?(d=(0,u.jsx)("ul",{className:"absolute z-30 max-h-56 w-72 overflow-auto rounded-md border border-border bg-popover py-1 text-popover-foreground shadow-md","data-testid":"sql-autocomplete",id:n,role:"listbox",style:i,children:c}),e[13]=n,e[14]=i,e[15]=c,e[16]=d):d=e[16],d},"Rn"),Rn=Se(ke.listTables),_n=Se(ke.readTablePage),Dn=a(s=>{let e=(0,Z.c)(18),n=_e(),t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=[],e[0]=t):t=e[0];let[r,o]=(0,B.useState)(t),l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l={},e[1]=l):l=e[1];let[i,c]=(0,B.useState)(l),d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d={},e[2]=d):d=e[2];let[m,x]=(0,B.useState)(d),h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=new Set,e[3]=h):h=e[3];let v=(0,B.useRef)(h),f,N;e[4]!==n||e[5]!==s?(f=a(()=>{let g={cancelled:!1};return me((async()=>{try{let C=await n.query(Rn,{},Ce(s));g.cancelled||(o(C.map(Mn)),c({}),x({}),v.current=new Set)}catch{g.cancelled||(o([]),c({}),x({}),v.current=new Set)}})()),()=>{g.cancelled=!0}},"d"),N=[n,s],e[4]=n,e[5]=s,e[6]=f,e[7]=N):(f=e[6],N=e[7]),(0,B.useEffect)(f,N);let b;e[8]!==n||e[9]!==s?(b=a(g=>{v.current.has(g)||(v.current.add(g),me((async()=>{try{let C=await n.query(_n,{limit:1,offset:0,table:g},Ce(s)),{sqlColumns:k}=C;if(k===void 0){v.current.delete(g);return}let q=new Set(k),E=C.columns.filter(T=>!q.has(T));c(T=>({...T,[g]:k})),x(T=>({...T,[g]:E}))}catch{v.current.delete(g)}})()))},"m"),e[8]=n,e[9]=s,e[10]=b):b=e[10];let w=b,p;e[11]!==i||e[12]!==m||e[13]!==r?(p={columns:i,docFields:m,tables:r},e[11]=i,e[12]=m,e[13]=r,e[14]=p):p=e[14];let S=p,y;return e[15]!==w||e[16]!==S?(y={probe:w,schema:S},e[15]=w,e[16]=S,e[17]=y):y=e[17],y},"_n"),Je=/\b(?:from|join|update|into)\s+([a-z_][\w$]*)|\b([a-z_][\w$]*)\s*\./gi,An=a(s=>{let e=new Set;Je.lastIndex=0;let n=Je.exec(s);for(;n!==null;)e.add(n[1]??n[2]),n=Je.exec(s);return[...e]},"An");function Mn(s){return s.name}a(Mn,"qn");var On=a(s=>(s.metaKey||s.ctrlKey)&&!s.shiftKey&&!s.altKey&&s.key.toLowerCase()==="i","Dn"),Pn=a(s=>{let e=(0,Z.c)(44),{inlineEditEnabled:n,onSubmit:t,probe:r,schema:o,setDraft:l}=s,i=(0,B.useId)(),[c,d]=(0,B.useState)(null),m=(0,B.useRef)(null),x=(0,B.useRef)(null),h=(0,B.useRef)(null),v=En(o,h,l),{close:f,commit:N,commitAt:b,move:w,refresh:p,state:S}=v,y;e[0]!==b?(y=a(A=>{b(A)},"v"),e[0]=b,e[1]=y):y=e[1];let g=y,C;e[2]!==p?(C=a(()=>{let A=h.current;A!==null&&A===document.activeElement&&p(A.value,A.selectionStart)},"E"),e[2]=p,e[3]=C):C=e[3];let k;e[4]!==p||e[5]!==o?(k=[p,o],e[4]=p,e[5]=o,e[6]=k):k=e[6],(0,B.useEffect)(C,k);let q;e[7]!==r||e[8]!==p||e[9]!==l?(q=a(A=>{let{selectionStart:U,value:G}=A.target;l(G),d(null);for(let Y of An(G))r(Y);p(G,U)},"T"),e[7]=r,e[8]=p,e[9]=l,e[10]=q):q=e[10];let E=q,T;e[11]!==p?(T=a(A=>{let U=A.currentTarget;p(U.value,U.selectionStart)},"R"),e[11]=p,e[12]=T):T=e[12];let I=T,D;e[13]!==f||e[14]!==N||e[15]!==w?(D=a(A=>A.key==="ArrowDown"?(A.preventDefault(),w(1),!0):A.key==="ArrowUp"?(A.preventDefault(),w(-1),!0):A.key==="Escape"?(A.preventDefault(),f(),!0):(A.key==="Enter"||A.key==="Tab")&&!A.metaKey&&!A.ctrlKey&&N()?(A.preventDefault(),!0):!1,"_"),e[13]=f,e[14]=N,e[15]=w,e[16]=D):D=e[16];let R=D,_;e[17]!==S||e[18]!==f||e[19]!==n||e[20]!==R||e[21]!==t?(_=a(A=>{if(!(S!==null&&R(A))){if((A.metaKey||A.ctrlKey)&&A.key==="Enter"){A.preventDefault(),t();return}if(n&&On(A)){A.preventDefault(),f();let{selectionEnd:U,selectionStart:G,value:Y}=A.currentTarget,[O,oe]=G===U?[0,Y.length]:[G,U];d({end:oe,start:O,text:Y.slice(O,oe)})}}},"L"),e[17]=S,e[18]=f,e[19]=n,e[20]=R,e[21]=t,e[22]=_):_=e[22];let Q=_,j;e[23]!==f?(j=a(()=>{requestAnimationFrame(()=>{f()})},"B"),e[23]=f,e[24]=j):j=e[24];let K=j,P;e[25]===Symbol.for("react.memo_cache_sentinel")?(P=a(A=>{let{scrollLeft:U,scrollTop:G}=A.currentTarget;m.current!==null&&(m.current.scrollTop=G),x.current!==null&&(x.current.scrollTop=G,x.current.scrollLeft=U)},"M"),e[25]=P):P=e[25];let W=P,F;e[26]===Symbol.for("react.memo_cache_sentinel")?(F=a(A=>{let U=h.current;U===null||A.offset===void 0||(U.focus(),U.setSelectionRange(A.offset,A.offset+(A.length??0)))},"Q"),e[26]=F):F=e[26];let L=F,M;e[27]===Symbol.for("react.memo_cache_sentinel")?(M=a(()=>{d(null),h.current?.focus()},"D"),e[27]=M):M=e[27];let z=M,$;e[28]!==c||e[29]!==l?($=a(A=>{let U=h.current;if(c===null||U===null)return;let{end:G,start:Y,text:O}=c;if(U.value.slice(Y,G)!==O){z();return}l(U.value.slice(0,Y)+A+U.value.slice(G)),d(null),U.focus(),requestAnimationFrame(()=>{U.setSelectionRange(Y,Y+A.length)})},"$"),e[28]=c,e[29]=l,e[30]=$):$=e[30];let te=$,V;e[31]!==E||e[32]!==K||e[33]!==Q||e[34]!==I?(V={onBlur:K,onChange:E,onKeyDown:Q,onScroll:W,onSelect:I},e[31]=E,e[32]=K,e[33]=Q,e[34]=I,e[35]=V):V=e[35];let ee;return e[36]!==te||e[37]!==S||e[38]!==f||e[39]!==c||e[40]!==i||e[41]!==g||e[42]!==V?(ee={acceptInlineEdit:te,autocompleteState:S,closeAutocomplete:f,closeInlineEdit:z,inlineEdit:c,handlers:V,listboxId:i,onPickSuggestion:g,editorRef:h,gutterRef:m,overlayRef:x,revealDiagnostic:L},e[36]=te,e[37]=S,e[38]=f,e[39]=c,e[40]=i,e[41]=g,e[42]=V,e[43]=ee):ee=e[43],ee},"On"),$n="lunora-studio-sql-tabs",jn="lunora-studio-sql-active-tab",Xe=12,Ee=a((s="",e="")=>({activeId:null,id:Ke("tab"),name:e,sql:s}),"Ee"),zn=a(()=>Ae(jn,""),"Bn"),Hn=a(s=>{let e=(0,Z.c)(16),[n,t]=De($n),[r,o]=zn(),[l]=(0,B.useState)(s),i,c;e[0]!==l||e[1]!==t||e[2]!==n.length?(i=a(()=>{n.length===0&&t([l])},"i"),c=[l,t,n.length],e[0]=l,e[1]=t,e[2]=n.length,e[3]=i,e[4]=c):(i=e[3],c=e[4]),(0,B.useEffect)(i,c);let d;e[5]!==l||e[6]!==n?(d=n.length===0?[l]:n,e[5]=l,e[6]=n,e[7]=d):d=e[7];let m=d,x;e[8]!==r||e[9]!==m?(x=m.some(f=>f.id===r)?r:m[0]?.id??"",e[8]=r,e[9]=m,e[10]=x):x=e[10];let h=x,v;return e[11]!==h||e[12]!==o||e[13]!==t||e[14]!==m?(v={activeId:h,setActiveId:o,setTabs:t,tabs:m},e[11]=h,e[12]=o,e[13]=t,e[14]=m,e[15]=v):v=e[15],v},"Hn"),qt=a(s=>s.activeId===null&&s.sql.trim()!=="","ht"),Wn=a((s,e)=>[...s,e].slice(-Xe),"Pn"),Bn=a((s,e,n)=>{let t=s.findIndex(o=>o.id===e);if(t===-1)return{activeId:s[0]?.id??"",tabs:[...s]};let r=s.filter(o=>o.id!==e);if(r.length===0){let o=n();return{activeId:o.id,tabs:[o]}}return{activeId:r[Math.min(t,r.length-1)].id,tabs:r}},"Fn"),Fn=a((s,e)=>{let n=s.filter(t=>t.id===e);return n.length===0?{activeId:s[0]?.id??"",tabs:[...s]}:{activeId:e,tabs:n}},"Wn"),Qn=a((s,e,n)=>{let t=s.findIndex(o=>o.id===e);if(t===-1)return{activeId:n,tabs:[...s]};let r=s.slice(0,t+1);return{activeId:r.some(o=>o.id===n)?n:e,tabs:r}},"Kn"),Kn=a(s=>{let e=s();return{activeId:e.id,tabs:[e]}},"Qn"),Un=a((s,e,n)=>{if(s==="others")return e.filter(t=>t.id!==n);if(s==="right"){let t=e.findIndex(r=>r.id===n);return t===-1?[]:e.slice(t+1)}return[...e]},"zn"),pt={error:null,pane:"results",result:null,running:!1},Gn=a(s=>{let e=(0,Z.c)(66),{activeId:n,setActiveId:t,setTabs:r,tabs:o}=Hn(s),l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={},e[0]=l):l=e[0];let[i,c]=(0,B.useState)(l),[d,m]=(0,B.useState)(null),[x,h]=(0,B.useState)(null),v;e[1]!==n||e[2]!==o?(v=o.find(H=>H.id===n)??o[0]??Ee(),e[1]=n,e[2]=o,e[3]=v):v=e[3];let f=v,N=i[f.id]??pt,b;e[4]!==f.id||e[5]!==r?(b=a(H=>{r(J=>J.map(X=>X.id===f.id?{...X,...H}:X))},"m"),e[4]=f.id,e[5]=r,e[6]=b):b=e[6];let w=b,p;e[7]!==f.id?(p=a(H=>{c(J=>{let X=J[f.id]??pt;return{...J,[f.id]:{...X,...H}}})},"b"),e[7]=f.id,e[8]=p):p=e[8];let S=p,y;e[9]!==t||e[10]!==r||e[11]!==o.length?(y=a(()=>{if(o.length>=Xe)return;let H=Ee();r(J=>Wn(J,H)),t(H.id)},"v"),e[9]=t,e[10]=r,e[11]=o.length,e[12]=y):y=e[12];let g=y,C;e[13]!==t||e[14]!==r?(C=a(H=>{m(null),h(null),r(H.tabs),t(H.activeId);let J=new Set(H.tabs.map(Jn));c(X=>Object.fromEntries(Object.entries(X).filter(re=>{let[fe]=re;return J.has(fe)})))},"E"),e[13]=t,e[14]=r,e[15]=C):C=e[15];let k=C,q;e[16]!==k||e[17]!==o?(q=a(H=>{k(Bn(o,H,Ee))},"T"),e[16]=k,e[17]=o,e[18]=q):q=e[18];let E=q,T;e[19]!==n||e[20]!==k||e[21]!==o?(T=a((H,J)=>{k(H==="others"?Fn(o,J):H==="right"?Qn(o,J,n):Kn(Ee))},"R"),e[19]=n,e[20]=k,e[21]=o,e[22]=T):T=e[22];let I=T,D;e[23]!==I||e[24]!==d||e[25]!==o?(D=a(H=>{d!==null&&(Un(H,o,d.id).some(Yn)?h(H):I(H,d.id))},"_"),e[23]=I,e[24]=d,e[25]=o,e[26]=D):D=e[26];let R=D,_;e[27]===Symbol.for("react.memo_cache_sentinel")?(_=a((H,J)=>{J.preventDefault(),h(null),m({id:H,x:J.clientX,y:J.clientY})},"L"),e[27]=_):_=e[27];let Q=_,j;e[28]===Symbol.for("react.memo_cache_sentinel")?(j=a(()=>{m(null),h(null)},"B"),e[28]=j):j=e[28];let K=j,P;e[29]===Symbol.for("react.memo_cache_sentinel")?(P=a(H=>{H.preventDefault(),m(null),h(null)},"M"),e[29]=P):P=e[29];let W=P,F;e[30]!==R?(F=a(()=>{R("others")},"Q"),e[30]=R,e[31]=F):F=e[31];let L=F,M;e[32]!==R?(M=a(()=>{R("right")},"D"),e[32]=R,e[33]=M):M=e[33];let z=M,$;e[34]!==R?($=a(()=>{R("all")},"$"),e[34]=R,e[35]=$):$=e[35];let te=$,V;e[36]!==I||e[37]!==x||e[38]!==d?(V=a(()=>{d!==null&&x!==null&&I(x,d.id),h(null)},"J"),e[36]=I,e[37]=x,e[38]=d,e[39]=V):V=e[39];let ee=V,A;e[40]===Symbol.for("react.memo_cache_sentinel")?(A=a(()=>{h(null)},"q"),e[40]=A):A=e[40];let U=A,G;e[41]!==d?(G=d===null?void 0:{left:d.x,top:d.y},e[41]=d,e[42]=G):G=e[42];let Y=G,O;e[43]!==r?(O=a(H=>{r(J=>J.map(X=>X.activeId===H?{...X,activeId:null}:X))},"O"),e[43]=r,e[44]=O):O=e[44];let oe=O,se;e[45]!==r?(se=a((H,J)=>{r(X=>X.map(re=>re.id===H?{...re,name:J}:re))},"re"),e[45]=r,e[46]=se):se=e[46];let le=se,ie;return e[47]!==f||e[48]!==n||e[49]!==g||e[50]!==E||e[51]!==ee||e[52]!==te||e[53]!==L||e[54]!==z||e[55]!==N||e[56]!==S||e[57]!==w||e[58]!==x||e[59]!==le||e[60]!==t||e[61]!==d||e[62]!==Y||e[63]!==o||e[64]!==oe?(ie={activeTab:f,activeTabId:n,addEditorTab:g,cancelBulk:U,closeEditorTab:E,closeTabMenu:K,confirmBulk:ee,menuStyle:Y,onBackdropContextMenu:W,onCloseAll:te,onCloseOthers:L,onCloseToRight:z,openTabMenu:Q,output:N,patchActiveOutput:S,patchActiveTab:w,pendingBulk:x,renameTab:le,setActiveTabId:t,tabMenu:d,tabs:o,unlinkQuery:oe},e[47]=f,e[48]=n,e[49]=g,e[50]=E,e[51]=ee,e[52]=te,e[53]=L,e[54]=z,e[55]=N,e[56]=S,e[57]=w,e[58]=x,e[59]=le,e[60]=t,e[61]=d,e[62]=Y,e[63]=o,e[64]=oe,e[65]=ie):ie=e[65],ie},"Un");function Jn(s){return s.id}a(Jn,"jn");function Yn(s){return qt(s)}a(Yn,"Yn");var Vn="lunora-studio-sql-queries",we="lunora-studio-sql-history",Xn="lunora-studio-sql-remember-history",Zn=25,eo=a(s=>{let e=(0,Z.c)(41),{loadIntoActiveTab:n,unlinkQuery:t}=s,r=ae(),[o,l]=De(Vn),[i,c]=Ae(Xn,!1),[d,m]=De(we,i?"local":"session"),x,h;e[0]!==i?(x=a(()=>{i||Ne(we,"local")},"g"),h=[i],e[0]=i,e[1]=x,e[2]=h):(x=e[1],h=e[2]),(0,B.useEffect)(x,h);let[v,f]=(0,B.useState)(""),N=(0,B.useRef)(null),b;e[3]!==m?(b=a(L=>{m(M=>M[0]?.sql===L?M:[{at:Date.now(),sql:L},...M.filter(z=>z.sql!==L)].slice(0,Zn))},"m"),e[3]=m,e[4]=b):b=e[4];let w=b,p;e[5]!==n||e[6]!==l||e[7]!==r?(p=a(()=>{let L={id:Ke("q"),name:r("Untitled query"),sql:""};l(M=>[L,...M]),n("",L.id)},"b"),e[5]=n,e[6]=l,e[7]=r,e[8]=p):p=e[8];let S=p,y;e[9]!==n||e[10]!==o?(y=a(L=>{let M=o.find(z=>z.id===L);M!==void 0&&(n(M.sql,L),N.current?.querySelector(`[data-testid="sql-query-${L}"]`)?.scrollIntoView({block:"nearest"}))},"v"),e[9]=n,e[10]=o,e[11]=y):y=e[11];let g=y,C;e[12]!==l||e[13]!==t?(C=a(L=>{l(M=>M.filter(z=>z.id!==L)),t(L)},"E"),e[12]=l,e[13]=t,e[14]=C):C=e[14];let k=C,q;e[15]!==n?(q=a(L=>{n(L.currentTarget.dataset.sql??"",null)},"T"),e[15]=n,e[16]=q):q=e[16];let E=q,T;e[17]!==n?(T=a(L=>{n(L.currentTarget.dataset.sql??"",null)},"R"),e[17]=n,e[18]=T):T=e[18];let I=T,D;e[19]!==m?(D=a(()=>{m([]),Ne(we,"local"),Ne(we,"session")},"_"),e[19]=m,e[20]=D):D=e[20];let R=D,_;e[21]!==d||e[22]!==c?(_=a(L=>{nt(we,d,L?"local":"session"),L||Ne(we,"local"),c(L)},"L"),e[21]=d,e[22]=c,e[23]=_):_=e[23];let Q=_,j;e[24]===Symbol.for("react.memo_cache_sentinel")?(j=a(L=>{f(L.target.value)},"B"),e[24]=j):j=e[24];let K=j,P;e[25]!==l?(P=a((L,M)=>{l(z=>z.map($=>$.id===L?{...$,sql:M}:$))},"M"),e[25]=l,e[26]=P):P=e[26];let W=P,F;return e[27]!==R||e[28]!==k||e[29]!==d||e[30]!==I||e[31]!==E||e[32]!==S||e[33]!==o||e[34]!==w||e[35]!==i||e[36]!==v||e[37]!==g||e[38]!==Q||e[39]!==W?(F={clearHistory:R,deleteQuery:k,history:d,listRef:N,loadFromHistory:I,loadTemplate:E,newQuery:S,onSearchChange:K,queries:o,recordHistory:w,rememberHistory:i,search:v,selectQuery:g,setRememberHistory:Q,updateQuerySql:W},e[27]=R,e[28]=k,e[29]=d,e[30]=I,e[31]=E,e[32]=S,e[33]=o,e[34]=w,e[35]=i,e[36]=v,e[37]=g,e[38]=Q,e[39]=W,e[40]=F):F=e[40],F},"Xn"),Ze="p-3 font-mono text-xs leading-5 whitespace-pre-wrap break-words",to=a((s,e)=>{let n=[];for(let r of s){if(r.offset===void 0||r.length===void 0||r.length<=0)continue;let o=Math.max(0,Math.min(r.offset,e)),l=Math.max(o,Math.min(r.offset+r.length,e));o!==l&&n.push({end:l,severity:r.severity,start:o})}n.sort((r,o)=>r.start-o.start);let t=[];for(let r of n)r.start>=(t.at(-1)?.end??0)&&t.push(r);return t},"Zn"),Et=a((s,e)=>e(s==="unsafe-response"?"The model returned a statement that is not read-only, so it was discarded.":s==="too-long"?"The statement is too long to rewrite. Select a shorter part of it.":s==="empty-response"?"The model returned nothing usable.":"The model could not be reached."),"bt"),no=a(s=>{let e=(0,Z.c)(51),{assistant:n,failed:t,onGenerated:r}=s,o=ae(),[l,i]=(0,B.useState)("");if(n.unavailable)return null;let c;e[0]!==n?(c=n.pending("sql"),e[0]=n,e[1]=c):c=e[1];let d=c,m;if(e[2]!==n||e[3]!==t||e[4]!==r||e[5]!==d||e[6]!==l||e[7]!==o){let x=n.reason("sql"),h;e[9]!==n||e[10]!==t||e[11]!==r||e[12]!==l?(h=a(I=>{let D=l.trim();D===""&&!I||me((async()=>{let R=await n.generate(D===""?"fix the failing statement":D,I?t:void 0);R!==void 0&&r(R)})())},"u"),e[9]=n,e[10]=t,e[11]=r,e[12]=l,e[13]=h):h=e[13];let v=h,f;e[14]!==o?(f=o("Describe the query you want"),e[14]=o,e[15]=f):f=e[15];let N;e[16]===Symbol.for("react.memo_cache_sentinel")?(N=a(I=>{i(I.target.value)},"N"),e[16]=N):N=e[16];let b;e[17]!==v?(b=a(I=>{I.key==="Enter"&&(I.preventDefault(),v(!1))},"m"),e[17]=v,e[18]=b):b=e[18];let w;e[19]!==o?(w=o("Describe the query you want"),e[19]=o,e[20]=w):w=e[20];let p;e[21]!==d||e[22]!==l||e[23]!==f||e[24]!==b||e[25]!==w?(p=(0,u.jsx)(Qe,{"aria-label":f,className:"h-7 flex-1 text-xs","data-testid":"sql-assistant-prompt",disabled:d,onChange:N,onKeyDown:b,placeholder:w,value:l}),e[21]=d,e[22]=l,e[23]=f,e[24]=b,e[25]=w,e[26]=p):p=e[26];let S=d&&"opacity-60",y;e[27]!==S?(y=ue("rounded-md border border-border px-2 py-1 text-xs outline-none transition-colors hover:bg-accent focus-visible:bg-accent",S),e[27]=S,e[28]=y):y=e[28];let g;e[29]!==d||e[30]!==l?(g=d||l.trim()==="",e[29]=d,e[30]=l,e[31]=g):g=e[31];let C;e[32]!==v?(C=a(()=>{v(!1)},"E"),e[32]=v,e[33]=C):C=e[33];let k;e[34]!==d||e[35]!==o?(k=o(d?"Thinking\u2026":"Draft SQL"),e[34]=d,e[35]=o,e[36]=k):k=e[36];let q;e[37]!==y||e[38]!==g||e[39]!==C||e[40]!==k?(q=(0,u.jsx)("button",{className:y,"data-testid":"sql-assistant-generate",disabled:g,onClick:C,type:"button",children:k}),e[37]=y,e[38]=g,e[39]=C,e[40]=k,e[41]=q):q=e[41];let E;e[42]!==t||e[43]!==d||e[44]!==v||e[45]!==o?(E=t!==void 0&&(0,u.jsx)("button",{className:"rounded-md border border-border px-2 py-1 text-xs outline-none transition-colors hover:bg-accent focus-visible:bg-accent","data-testid":"sql-assistant-fix",disabled:d,onClick:a(()=>{v(!0)},"onClick"),type:"button",children:o("Fix this")}),e[42]=t,e[43]=d,e[44]=v,e[45]=o,e[46]=E):E=e[46];let T;e[47]!==q||e[48]!==E||e[49]!==p?(T=(0,u.jsxs)("div",{className:"flex items-center gap-2",children:[p,q,E]}),e[47]=q,e[48]=E,e[49]=p,e[50]=T):T=e[50],m=(0,u.jsxs)("div",{className:"flex flex-col gap-1 border-b border-border px-3 py-2","data-testid":"sql-assistant",children:[T,x!==void 0&&(0,u.jsx)("p",{className:"text-[11px] text-muted-foreground","data-testid":"sql-assistant-reason",role:"status",children:Et(x,o)})]}),e[2]=n,e[3]=t,e[4]=r,e[5]=d,e[6]=l,e[7]=o,e[8]=m}else m=e[8];return m},"es"),oo=a(s=>{let e=(0,Z.c)(8),{diagnostics:n,draft:t,scrollRef:r}=s,o,l;if(e[0]!==n||e[1]!==t){l=Symbol.for("react.early_return_sentinel");e:{let d=to(n,t.length);if(d.length===0){l=null;break e}o=[];let m=0;for(let[x,h]of d.entries())h.start>m&&o.push(t.slice(m,h.start)),o.push((0,u.jsx)("span",{className:ue("decoration-wavy underline underline-offset-4",h.severity==="error"?"decoration-destructive":"decoration-amber-500"),children:t.slice(h.start,h.end)},`${h.start.toString()}-${x.toString()}`)),m=h.end;o.push(t.slice(m))}e[0]=n,e[1]=t,e[2]=o,e[3]=l}else o=e[2],l=e[3];if(l!==Symbol.for("react.early_return_sentinel"))return l;let i;e[4]===Symbol.for("react.memo_cache_sentinel")?(i=ue("pointer-events-none absolute inset-0 overflow-hidden text-transparent",Ze),e[4]=i):i=e[4];let c;return e[5]!==o||e[6]!==r?(c=(0,u.jsx)("div",{"aria-hidden":"true",className:i,"data-testid":"sql-diagnostics-overlay",ref:r,children:o}),e[5]=o,e[6]=r,e[7]=c):c=e[7],c},"ts"),ro={gate:"read-only",plan:"plan",schema:"schema",syntax:"syntax"},so=a(s=>{let e=(0,Z.c)(10),{diagnostics:n,onSelect:t}=s,r=ae();if(n.length===0)return null;let o;e[0]!==r?(o=r("SQL problems"),e[0]=r,e[1]=o):o=e[1];let l;if(e[2]!==n||e[3]!==t){let c;e[5]!==t?(c=a((d,m)=>(0,u.jsx)("li",{children:(0,u.jsxs)("button",{className:"flex w-full items-start gap-2 px-3 py-1 text-start text-xs outline-none hover:bg-accent focus-visible:bg-accent","data-testid":"sql-problem",onClick:a(()=>{t(d)},"onClick"),type:"button",children:[(0,u.jsx)("span",{className:ue("mt-px shrink-0 rounded px-1 font-mono text-[10px] uppercase",d.severity==="error"?"bg-destructive/15 text-destructive":"bg-amber-500/15 text-amber-600"),children:ro[d.source]}),(0,u.jsx)("span",{className:"min-w-0 text-muted-foreground",children:d.message})]})},`${d.source}-${(d.offset??m).toString()}-${m.toString()}`),"c"),e[5]=t,e[6]=c):c=e[6],l=n.map(c),e[2]=n,e[3]=t,e[4]=l}else l=e[4];let i;return e[7]!==o||e[8]!==l?(i=(0,u.jsx)("ul",{"aria-label":o,className:"max-h-24 shrink-0 overflow-y-auto border-t border-border bg-muted/30","data-testid":"sql-problems",children:l}),e[7]=o,e[8]=l,e[9]=i):i=e[9],i},"ss"),lo=a(s=>(s.endsWith(`
|
|
12
|
+
`)?s.slice(0,-1):s).split(`
|
|
13
|
+
`),"os"),io=a((s,e)=>{let n=[],t=1,r=1;for(let o of Ge(s,e,{ignoreNewlineAtEof:!0}))for(let l of lo(o.value))o.added?(n.push({after:r,kind:"added",text:l}),r+=1):o.removed?(n.push({before:t,kind:"removed",text:l}),t+=1):(n.push({after:r,before:t,kind:"context",text:l}),t+=1,r+=1);return n},"ls"),ao={added:"bg-emerald-500/10 text-emerald-700 dark:text-emerald-400",context:"text-muted-foreground",removed:"bg-destructive/10 text-destructive"},co={added:"+",context:" ",removed:"-"},uo=a(s=>{let e=(0,Z.c)(11),{lines:n}=s,t=ae(),r;e[0]!==t?(r=t("Proposed edit"),e[0]=t,e[1]=r):r=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=ue("max-h-48 overflow-auto rounded-md border border-border bg-background",Ze),e[2]=o):o=e[2];let l;if(e[3]!==n||e[4]!==t){let c;e[6]!==t?(c=a(d=>(0,u.jsxs)("li",{className:ue("flex gap-2",ao[d.kind]),"data-kind":d.kind,children:[(0,u.jsx)("span",{"aria-hidden":"true",className:"shrink-0 select-none opacity-60",children:co[d.kind]}),d.kind!=="context"&&(0,u.jsx)("span",{className:"sr-only",children:d.kind==="added"?t("Added"):t("Removed")}),(0,u.jsx)("span",{className:"min-w-0",children:d.text===""?"\xA0":d.text})]},`${String(d.before)}:${String(d.after)}`),"c"),e[6]=t,e[7]=c):c=e[7],l=n.map(c),e[3]=n,e[4]=t,e[5]=l}else l=e[5];let i;return e[8]!==r||e[9]!==l?(i=(0,u.jsx)("ul",{"aria-label":r,className:o,"data-testid":"sql-inline-diff",children:l}),e[8]=r,e[9]=l,e[10]=i):i=e[10],i},"as"),Oe="rounded-md border border-border px-2 py-1 text-xs outline-none transition-colors hover:bg-accent focus-visible:bg-accent",mo=a(s=>{let e=(0,Z.c)(41),{onAccept:n,onCancel:t,rpc:r,source:o,whole:l}=s,i=ae(),c=(0,B.useRef)(null),d=(0,B.useRef)(null),[m,x]=(0,B.useState)(""),[h,v]=(0,B.useState)(null),f,N;if(e[0]!==h?(f=a(()=>{h===null?c.current?.focus():d.current?.focus()},"d"),N=[h],e[0]=h,e[1]=f,e[2]=N):(f=e[1],N=e[2]),(0,B.useEffect)(f,N),r.unavailable)return null;let b;e[3]!==r?(b=r.pending("sql"),e[3]=r,e[4]=b):b=e[4];let w=b,p;if(e[5]!==m||e[6]!==n||e[7]!==t||e[8]!==w||e[9]!==h||e[10]!==r||e[11]!==o||e[12]!==i||e[13]!==l){let S=r.reason("sql"),y;e[15]!==m||e[16]!==r||e[17]!==o?(y=a(()=>{let R=m.trim();R===""||o.trim()===""||me((async()=>{let _=await r.rewrite(R,o);_!==void 0&&v(_)})())},"v"),e[15]=m,e[16]=r,e[17]=o,e[18]=y):y=e[18];let g=y,C;e[19]!==t?(C=a(R=>{R.key==="Escape"&&(R.preventDefault(),t())},"E"),e[19]=t,e[20]=C):C=e[20];let k=C,q;e[21]!==i||e[22]!==l?(q=i(l?"Whole query":"Selection"),e[21]=i,e[22]=l,e[23]=q):q=e[23];let E;e[24]!==q?(E=(0,u.jsx)("span",{className:"shrink-0 rounded bg-muted px-1 font-mono text-[10px] uppercase text-muted-foreground","data-testid":"sql-inline-edit-scope",children:q}),e[24]=q,e[25]=E):E=e[25];let T;e[26]!==m||e[27]!==n||e[28]!==t||e[29]!==k||e[30]!==w||e[31]!==h||e[32]!==g||e[33]!==i?(T=h===null?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(Qe,{"aria-label":i("Tell the model what to change"),className:"h-7 flex-1 text-xs","data-testid":"sql-inline-edit-prompt",disabled:w,onChange:a(R=>{x(R.target.value)},"onChange"),onKeyDown:a(R=>{if(R.key==="Enter"){R.preventDefault(),g();return}k(R)},"onKeyDown"),placeholder:i("Tell the model what to change"),ref:c,value:m}),(0,u.jsx)("button",{className:ue(Oe,w&&"opacity-60"),"data-testid":"sql-inline-edit-submit",disabled:w||m.trim()==="",onClick:g,onKeyDown:k,type:"button",children:i(w?"Thinking\u2026":"Rewrite")}),(0,u.jsx)("button",{className:Oe,"data-testid":"sql-inline-edit-cancel",onClick:t,onKeyDown:k,type:"button",children:i("Cancel")})]}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("span",{className:"flex-1 text-xs text-muted-foreground",children:i("Proposed edit")}),(0,u.jsx)("button",{className:Oe,"data-testid":"sql-inline-edit-accept",onClick:a(()=>{n(h)},"onClick"),onKeyDown:k,ref:d,type:"button",children:i("Accept")}),(0,u.jsx)("button",{className:Oe,"data-testid":"sql-inline-edit-reject",onClick:a(()=>{v(null)},"onClick"),onKeyDown:k,type:"button",children:i("Reject")})]}),e[26]=m,e[27]=n,e[28]=t,e[29]=k,e[30]=w,e[31]=h,e[32]=g,e[33]=i,e[34]=T):T=e[34];let I;e[35]!==E||e[36]!==T?(I=(0,u.jsxs)("div",{className:"flex items-center gap-2",children:[E,T]}),e[35]=E,e[36]=T,e[37]=I):I=e[37];let D;e[38]!==h||e[39]!==o?(D=h!==null&&(0,u.jsx)(uo,{lines:io(o,h)}),e[38]=h,e[39]=o,e[40]=D):D=e[40],p=(0,u.jsxs)("div",{className:"flex flex-col gap-1 border-b border-border bg-muted/20 px-3 py-2","data-testid":"sql-inline-edit",children:[I,D,S!==void 0&&(0,u.jsx)("p",{className:"text-[11px] text-muted-foreground","data-testid":"sql-inline-edit-reason",role:"status",children:Et(S,i)})]}),e[5]=m,e[6]=n,e[7]=t,e[8]=w,e[9]=h,e[10]=r,e[11]=o,e[12]=i,e[13]=l,e[14]=p}else p=e[14];return p},"cs"),fo={minWidth:"2.75rem",paddingInline:"0.5rem"},ho=a(s=>{let e=(0,Z.c)(75),{assistant:n,autocomplete:t,diagnostics:r,draft:o,failed:l,handlers:i,editorRef:c,gutterRef:d,inlineEdit:m,listboxId:x,onAcceptInlineEdit:h,onCancelInlineEdit:v,onGenerated:f,onPickSuggestion:N,onRevealDiagnostic:b,overlayRef:w}=s,p=ae(),S,y,g,C,k,q,E,T,I;if(e[0]!==n||e[1]!==o||e[2]!==l||e[3]!==d||e[4]!==m||e[5]!==h||e[6]!==v||e[7]!==f){let $=o.split(`
|
|
14
|
+
`).length;E="flex min-h-0 min-w-0 flex-1 flex-col",e[17]!==n||e[18]!==l||e[19]!==f?(T=(0,u.jsx)(no,{assistant:n,failed:l,onGenerated:f}),e[17]=n,e[18]=l,e[19]=f,e[20]=T):T=e[20],e[21]!==n||e[22]!==o.length||e[23]!==m||e[24]!==h||e[25]!==v?(I=m!==null&&(0,u.jsx)(mo,{onAccept:h,onCancel:v,rpc:n,source:m.text,whole:m.start===0&&m.end===o.length},`${m.start.toString()}-${m.end.toString()}`),e[21]=n,e[22]=o.length,e[23]=m,e[24]=h,e[25]=v,e[26]=I):I=e[26],q="flex min-h-0 min-w-0 flex-1",S="true",y="shrink-0 select-none overflow-hidden border-e border-border bg-muted/30 py-3 text-end font-mono text-xs leading-5 text-muted-foreground/60",g=d,C=fo,k=Array.from({length:$},po),e[0]=n,e[1]=o,e[2]=l,e[3]=d,e[4]=m,e[5]=h,e[6]=v,e[7]=f,e[8]=S,e[9]=y,e[10]=g,e[11]=C,e[12]=k,e[13]=q,e[14]=E,e[15]=T,e[16]=I}else S=e[8],y=e[9],g=e[10],C=e[11],k=e[12],q=e[13],E=e[14],T=e[15],I=e[16];let D;e[27]!==S||e[28]!==y||e[29]!==g||e[30]!==C||e[31]!==k?(D=(0,u.jsx)("div",{"aria-hidden":S,className:y,ref:g,style:C,children:k}),e[27]=S,e[28]=y,e[29]=g,e[30]=C,e[31]=k,e[32]=D):D=e[32];let R;e[33]!==r||e[34]!==o||e[35]!==w?(R=(0,u.jsx)(oo,{diagnostics:r,draft:o,scrollRef:w}),e[33]=r,e[34]=o,e[35]=w,e[36]=R):R=e[36];let _;e[37]!==t||e[38]!==x?(_=t===null?void 0:`${x}-opt-${t.active.toString()}`,e[37]=t,e[38]=x,e[39]=_):_=e[39];let Q=t===null?void 0:x,j=t!==null,K;e[40]!==p?(K=p("SQL query"),e[40]=p,e[41]=K):K=e[41];let P;e[42]!==o||e[43]!==c||e[44]!==i.onBlur||e[45]!==i.onChange||e[46]!==i.onKeyDown||e[47]!==i.onScroll||e[48]!==i.onSelect||e[49]!==_||e[50]!==Q||e[51]!==j||e[52]!==K?(P=(0,u.jsx)("textarea",{"aria-activedescendant":_,"aria-autocomplete":"list","aria-controls":Q,"aria-expanded":j,"aria-label":K,className:`relative size-full resize-none bg-transparent outline-none ${Ze}`,"data-testid":"sql-input",onBlur:i.onBlur,onChange:i.onChange,onKeyDown:i.onKeyDown,onScroll:i.onScroll,onSelect:i.onSelect,placeholder:"SELECT * FROM \u2026",ref:c,role:"combobox",spellCheck:!1,value:o}),e[42]=o,e[43]=c,e[44]=i.onBlur,e[45]=i.onChange,e[46]=i.onKeyDown,e[47]=i.onScroll,e[48]=i.onSelect,e[49]=_,e[50]=Q,e[51]=j,e[52]=K,e[53]=P):P=e[53];let W;e[54]!==t||e[55]!==x||e[56]!==N?(W=(0,u.jsx)(Ln,{listboxId:x,onPick:N,state:t}),e[54]=t,e[55]=x,e[56]=N,e[57]=W):W=e[57];let F;e[58]!==R||e[59]!==P||e[60]!==W?(F=(0,u.jsxs)("div",{className:"relative min-w-0 flex-1 bg-background",children:[R,P,W]}),e[58]=R,e[59]=P,e[60]=W,e[61]=F):F=e[61];let L;e[62]!==D||e[63]!==F||e[64]!==q?(L=(0,u.jsxs)("div",{className:q,children:[D,F]}),e[62]=D,e[63]=F,e[64]=q,e[65]=L):L=e[65];let M;e[66]!==r||e[67]!==b?(M=(0,u.jsx)(so,{diagnostics:r,onSelect:b}),e[66]=r,e[67]=b,e[68]=M):M=e[68];let z;return e[69]!==L||e[70]!==M||e[71]!==E||e[72]!==T||e[73]!==I?(z=(0,u.jsxs)("div",{className:E,children:[T,I,L,M]}),e[69]=L,e[70]=M,e[71]=E,e[72]=T,e[73]=I,e[74]=z):z=e[74],z},"us");function po(s,e){return(0,u.jsx)("div",{children:e+1},e)}a(po,"fs");var Tt=[{label:"List tables",sql:"SELECT name FROM sqlite_master WHERE type = 'table' ORDER BY name;"},{label:"Table row count",sql:"SELECT COUNT(*) AS rows FROM messages;"},{label:"Recent rows",sql:"SELECT id, _creationTime, __doc__ FROM messages ORDER BY _creationTime DESC LIMIT 50;"},{label:"Index list",sql:"SELECT name, tbl_name FROM sqlite_master WHERE type = 'index' ORDER BY tbl_name;"}],bo=a(s=>{let e=(0,Z.c)(29),{active:n,onDelete:t,onSelect:r,query:o}=s,l=ae(),i;e[0]!==r||e[1]!==o.id?(i=a(()=>{r(o.id)},"i"),e[0]=r,e[1]=o.id,e[2]=i):i=e[2];let c=i,d;e[3]!==t||e[4]!==o.id?(d=a(C=>{C.stopPropagation(),t(o.id)},"a"),e[3]=t,e[4]=o.id,e[5]=d):d=e[5];let m=d,x=n?"bg-sidebar-accent font-medium text-foreground":"text-muted-foreground",h;e[6]!==x?(h=ue("flex min-w-0 flex-1 items-center gap-2 rounded-md px-2 py-1.5 text-start text-[13px] outline-none transition-colors hover:bg-sidebar-accent focus-visible:bg-sidebar-accent",x),e[6]=x,e[7]=h):h=e[7];let v=`sql-query-${o.id}`,f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=(0,u.jsx)("svg",{"aria-hidden":"true",className:"size-3.5 shrink-0 opacity-70",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,u.jsx)("path",{d:"M4 6h16M4 12h10M4 18h7"})}),e[8]=f):f=e[8];let N;e[9]!==o.name?(N=(0,u.jsx)("span",{className:"truncate",children:o.name}),e[9]=o.name,e[10]=N):N=e[10];let b;e[11]!==n||e[12]!==c||e[13]!==h||e[14]!==v||e[15]!==N?(b=(0,u.jsxs)("button",{"aria-pressed":n,className:h,"data-testid":v,onClick:c,type:"button",children:[f,N]}),e[11]=n,e[12]=c,e[13]=h,e[14]=v,e[15]=N,e[16]=b):b=e[16];let w;e[17]!==l?(w=l("Delete query"),e[17]=l,e[18]=w):w=e[18];let p;e[19]!==l?(p=l("Delete query"),e[19]=l,e[20]=p):p=e[20];let S;e[21]===Symbol.for("react.memo_cache_sentinel")?(S=(0,u.jsx)("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,u.jsx)("path",{d:"M5 7h14M9 7V5h6v2m-1 0v12H10V7M7 7v13h10V7"})}),e[21]=S):S=e[21];let y;e[22]!==m||e[23]!==p||e[24]!==w?(y=(0,u.jsx)("button",{"aria-label":w,className:"me-1 hidden size-6 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-destructive/10 hover:text-destructive group-hover/q:flex",onClick:m,title:p,type:"button",children:S}),e[22]=m,e[23]=p,e[24]=w,e[25]=y):y=e[25];let g;return e[26]!==y||e[27]!==b?(g=(0,u.jsxs)("li",{className:"group/q flex items-center",children:[b,y]}),e[26]=y,e[27]=b,e[28]=g):g=e[28],g},"ms"),bt="sql-history-remember",go=a((s,e)=>{let n=e.trim().toLowerCase();return n===""?[...s]:s.filter(t=>t.name.toLowerCase().includes(n))},"ps"),xo=a(s=>{let e=(0,Z.c)(66),{activeId:n,history:t,listRef:r,onClearHistory:o,onDelete:l,onLoadHistory:i,onLoadTemplate:c,onNew:d,onSearchChange:m,onSelect:x,onToggleRememberHistory:h,queries:v,rememberHistory:f,search:N}=s,b=ae(),w,p,S,y,g;if(e[0]!==n||e[1]!==r||e[2]!==l||e[3]!==d||e[4]!==m||e[5]!==x||e[6]!==h||e[7]!==v||e[8]!==N||e[9]!==b){let _=go(v,N),Q;e[15]!==h?(Q=a($=>{h($.target.checked)},"F"),e[15]=h,e[16]=Q):Q=e[16],w=Q,S="flex h-full w-64 shrink-0 flex-col border-e border-border bg-sidebar";let j;e[17]!==b?(j=b("Search queries\u2026"),e[17]=b,e[18]=j):j=e[18];let K;e[19]!==m||e[20]!==N||e[21]!==j?(K=(0,u.jsx)("input",{className:"h-8 min-w-0 flex-1 rounded-md border border-border bg-background px-2 text-xs outline-none focus-visible:border-ring","data-testid":"sql-search",onChange:m,placeholder:j,type:"text",value:N}),e[19]=m,e[20]=N,e[21]=j,e[22]=K):K=e[22];let P;e[23]!==b?(P=b("New query"),e[23]=b,e[24]=P):P=e[24];let W;e[25]!==b?(W=b("New query"),e[25]=b,e[26]=W):W=e[26];let F;e[27]===Symbol.for("react.memo_cache_sentinel")?(F=(0,u.jsx)("svg",{"aria-hidden":"true",className:"size-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.7,viewBox:"0 0 24 24",children:(0,u.jsx)("path",{d:"M12 5v14M5 12h14"})}),e[27]=F):F=e[27];let L;e[28]!==d||e[29]!==P||e[30]!==W?(L=(0,u.jsx)("button",{"aria-label":P,className:"flex size-8 shrink-0 items-center justify-center rounded-md border border-border text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent","data-testid":"sql-new",onClick:d,title:W,type:"button",children:F}),e[28]=d,e[29]=P,e[30]=W,e[31]=L):L=e[31],e[32]!==L||e[33]!==K?(y=(0,u.jsxs)("div",{className:"flex shrink-0 items-center gap-2 border-b border-border p-2",children:[K,L]}),e[32]=L,e[33]=K,e[34]=y):y=e[34],p="flex flex-1 flex-col gap-4 overflow-y-auto p-2";let M;e[35]!==b?(M=b("Private"),e[35]=b,e[36]=M):M=e[36];let z;e[37]!==M?(z=(0,u.jsx)("p",{className:"px-1 pb-1 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:M}),e[37]=M,e[38]=z):z=e[38],g=(0,u.jsxs)("div",{children:[z,_.length===0?(0,u.jsx)("p",{className:"px-1 py-2 text-xs text-muted-foreground","data-testid":"sql-private-empty",children:b("No saved queries yet \u2014 they save to this browser as you type.")}):(0,u.jsx)("ul",{className:"flex flex-col gap-px","data-testid":"sql-private",ref:r,children:_.map($=>(0,u.jsx)(bo,{active:n===$.id,onDelete:l,onSelect:x,query:$},$.id))})]}),e[0]=n,e[1]=r,e[2]=l,e[3]=d,e[4]=m,e[5]=x,e[6]=h,e[7]=v,e[8]=N,e[9]=b,e[10]=w,e[11]=p,e[12]=S,e[13]=y,e[14]=g}else w=e[10],p=e[11],S=e[12],y=e[13],g=e[14];let C;e[39]!==b?(C=b("Reference"),e[39]=b,e[40]=C):C=e[40];let k;e[41]!==C?(k=(0,u.jsx)("p",{className:"px-1 pb-1 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:C}),e[41]=C,e[42]=k):k=e[42];let q;e[43]!==c?(q=Tt.map(_=>(0,u.jsx)("li",{children:(0,u.jsxs)("button",{className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-start text-[13px] text-muted-foreground outline-none transition-colors hover:bg-sidebar-accent hover:text-foreground focus-visible:bg-sidebar-accent","data-sql":_.sql,onClick:c,type:"button",children:[(0,u.jsx)("svg",{"aria-hidden":"true",className:"size-3.5 shrink-0 opacity-70",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,u.jsx)("path",{d:"M7 4h7l4 4v12H7zM14 4v4h4"})}),_.label]})},_.label)),e[43]=c,e[44]=q):q=e[44];let E;e[45]!==q?(E=(0,u.jsx)("ul",{className:"flex flex-col gap-px",children:q}),e[45]=q,e[46]=E):E=e[46];let T;e[47]!==k||e[48]!==E?(T=(0,u.jsxs)("div",{children:[k,E]}),e[47]=k,e[48]=E,e[49]=T):T=e[49];let I;e[50]!==t||e[51]!==o||e[52]!==i||e[53]!==w||e[54]!==f||e[55]!==b?(I=t.length>0&&(0,u.jsxs)("div",{children:[(0,u.jsxs)("div",{className:"flex items-center justify-between px-1 pb-1",children:[(0,u.jsx)("p",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:b("History")}),(0,u.jsx)("button",{className:"rounded px-1 text-[11px] text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:text-foreground","data-testid":"sql-history-clear",onClick:o,type:"button",children:b("Clear history")})]}),(0,u.jsxs)("label",{className:"flex cursor-pointer items-center gap-1.5 px-1 pb-1.5 text-[11px] text-muted-foreground",htmlFor:bt,children:[(0,u.jsx)("input",{checked:f,"data-testid":"sql-history-remember",id:bt,onChange:w,type:"checkbox"}),b("Keep history on this browser")]}),(0,u.jsx)("ul",{className:"flex flex-col gap-px","data-testid":"sql-history",children:t.map(_=>(0,u.jsx)("li",{children:(0,u.jsxs)("button",{className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-start text-[13px] text-muted-foreground outline-none transition-colors hover:bg-sidebar-accent hover:text-foreground focus-visible:bg-sidebar-accent","data-sql":_.sql,"data-testid":"sql-history-item",onClick:i,title:_.sql,type:"button",children:[(0,u.jsx)("svg",{"aria-hidden":"true",className:"size-3.5 shrink-0 opacity-70",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,u.jsx)("path",{d:"M12 8v4l3 2M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18Z"})}),(0,u.jsx)("span",{className:"truncate font-mono",children:_.sql})]})},`${_.at.toString()}:${_.sql}`))})]}),e[50]=t,e[51]=o,e[52]=i,e[53]=w,e[54]=f,e[55]=b,e[56]=I):I=e[56];let D;e[57]!==p||e[58]!==I||e[59]!==g||e[60]!==T?(D=(0,u.jsxs)("div",{className:p,children:[g,T,I]}),e[57]=p,e[58]=I,e[59]=g,e[60]=T,e[61]=D):D=e[61];let R;return e[62]!==D||e[63]!==S||e[64]!==y?(R=(0,u.jsxs)("aside",{className:S,children:[y,D]}),e[62]=D,e[63]=S,e[64]=y,e[65]=R):R=e[65],R},"hs"),Pe=a(s=>`border-b-2 px-3 py-2 text-sm outline-none transition-colors ${s?"border-foreground font-medium text-foreground":"border-transparent text-muted-foreground hover:text-foreground"}`,"qe"),vo=a(s=>{let e=(0,Z.c)(96),{assistant:n,chart:t,className:r,error:o,onFormat:l,onInferChart:i,onRun:c,onSelectStatement:d,onShardKeyChange:m,onShowChart:x,onShowExplain:h,onShowResults:v,onToggleSplit:f,pane:N,result:b,running:w,script:p,shardKey:S,splitView:y}=s,g=ae(),C=N==="results",k;e[0]!==C?(k=Pe(C),e[0]=C,e[1]=k):k=e[1];let q;e[2]!==g?(q=g("Results"),e[2]=g,e[3]=q):q=e[3];let E;e[4]!==v||e[5]!==k||e[6]!==q?(E=(0,u.jsx)("button",{className:k,"data-testid":"sql-tab-results",onClick:v,type:"button",children:q}),e[4]=v,e[5]=k,e[6]=q,e[7]=E):E=e[7];let T=N==="chart",I;e[8]!==T?(I=Pe(T),e[8]=T,e[9]=I):I=e[9];let D;e[10]!==g?(D=g("Chart"),e[10]=g,e[11]=D):D=e[11];let R;e[12]!==x||e[13]!==I||e[14]!==D?(R=(0,u.jsx)("button",{className:I,"data-testid":"sql-tab-chart",onClick:x,type:"button",children:D}),e[12]=x,e[13]=I,e[14]=D,e[15]=R):R=e[15];let _;e[16]!==n||e[17]!==i||e[18]!==N||e[19]!==b||e[20]!==g?(_=!n.unavailable&&N==="chart"&&b!==null&&(0,u.jsx)("button",{className:Pe(!1),"data-testid":"sql-infer-chart",disabled:n.pending("chart"),onClick:i,type:"button",children:n.pending("chart")?g("Thinking\u2026"):g("Suggest chart")}),e[16]=n,e[17]=i,e[18]=N,e[19]=b,e[20]=g,e[21]=_):_=e[21];let Q=N==="explain",j;e[22]!==Q?(j=Pe(Q),e[22]=Q,e[23]=j):j=e[23];let K;e[24]!==g?(K=g("Explain"),e[24]=g,e[25]=K):K=e[25];let P;e[26]!==h||e[27]!==j||e[28]!==K?(P=(0,u.jsx)("button",{className:j,"data-testid":"sql-tab-explain",onClick:h,type:"button",children:K}),e[26]=h,e[27]=j,e[28]=K,e[29]=P):P=e[29];let W;e[30]!==g?(W=g("Split editor and results"),e[30]=g,e[31]=W):W=e[31];let F=`inline-flex items-center rounded-md border border-border px-2 py-1.5 outline-none transition-colors hover:bg-accent focus-visible:bg-accent ${y?"bg-accent text-foreground":"text-muted-foreground"}`,L;e[32]!==g?(L=g("Split editor and results"),e[32]=g,e[33]=L):L=e[33];let M;e[34]===Symbol.for("react.memo_cache_sentinel")?(M=(0,u.jsxs)("svg",{"aria-hidden":"true",className:"size-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.7,viewBox:"0 0 24 24",children:[(0,u.jsx)("rect",{height:"16",rx:"2",width:"18",x:"3",y:"4"}),(0,u.jsx)("path",{d:"M12 4v16"})]}),e[34]=M):M=e[34];let z;e[35]!==f||e[36]!==y||e[37]!==W||e[38]!==F||e[39]!==L?(z=(0,u.jsx)("button",{"aria-label":W,"aria-pressed":y,className:F,"data-testid":"sql-split-toggle",onClick:f,title:L,type:"button",children:M}),e[35]=f,e[36]=y,e[37]=W,e[38]=F,e[39]=L,e[40]=z):z=e[40];let $;e[41]!==b?($=b!==null&&b.columns.length>0&&(0,u.jsx)(at,{columns:b.columns,name:"query-result",rows:b.rows}),e[41]=b,e[42]=$):$=e[42];let te;e[43]!==g?(te=g("Format"),e[43]=g,e[44]=te):te=e[44];let V;e[45]!==l||e[46]!==w||e[47]!==te?(V=(0,u.jsx)("button",{className:"inline-flex items-center rounded-md border border-border px-3 py-1.5 text-xs font-medium text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-50","data-testid":"sql-format",disabled:w,onClick:l,type:"button",children:te}),e[45]=l,e[46]=w,e[47]=te,e[48]=V):V=e[48];let ee;e[49]!==m||e[50]!==S?(ee=(0,u.jsx)(rt,{onChange:m,testId:"sql-shard-input",value:S}),e[49]=m,e[50]=S,e[51]=ee):ee=e[51];let A;e[52]!==w||e[53]!==g?(A=g(w?"Running\u2026":"Run"),e[52]=w,e[53]=g,e[54]=A):A=e[54];let U;e[55]===Symbol.for("react.memo_cache_sentinel")?(U=(0,u.jsx)("kbd",{className:"rounded border border-primary-foreground/30 px-1 font-sans text-[10px]",children:"\u2318\u21B5"}),e[55]=U):U=e[55];let G;e[56]!==c||e[57]!==w||e[58]!==A?(G=(0,u.jsxs)("button",{className:"inline-flex items-center gap-1.5 rounded-md bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground outline-none transition-colors hover:bg-primary/90 focus-visible:bg-primary/90 disabled:pointer-events-none disabled:opacity-50","data-testid":"sql-run",disabled:w,onClick:c,type:"button",children:[A,U]}),e[56]=c,e[57]=w,e[58]=A,e[59]=G):G=e[59];let Y;e[60]!==z||e[61]!==$||e[62]!==V||e[63]!==ee||e[64]!==G?(Y=(0,u.jsxs)("div",{className:"ms-auto flex items-center gap-2",children:[z,$,V,ee,G]}),e[60]=z,e[61]=$,e[62]=V,e[63]=ee,e[64]=G,e[65]=Y):Y=e[65];let O;e[66]!==P||e[67]!==Y||e[68]!==E||e[69]!==R||e[70]!==_?(O=(0,u.jsxs)("div",{className:"flex shrink-0 items-center gap-2 border-b border-border pe-2",children:[E,R,_,P,Y]}),e[66]=P,e[67]=Y,e[68]=E,e[69]=R,e[70]=_,e[71]=O):O=e[71];let oe;e[72]!==d||e[73]!==p?(oe=p!==void 0&&(0,u.jsx)("div",{className:"flex shrink-0 flex-wrap items-center gap-1 border-b border-border px-3 py-1.5","data-testid":"sql-statements",children:p.runs.map((X,re)=>(0,u.jsx)("button",{"aria-pressed":re===p.selected,className:`rounded-md border px-2 py-0.5 font-mono text-[11px] outline-none transition-colors ${re===p.selected?"border-foreground text-foreground":"border-border text-muted-foreground hover:text-foreground"} ${X.error===null?"":"border-destructive/50 text-destructive"}`,"data-testid":`sql-statement-${re.toString()}`,onClick:a(()=>{d(re)},"onClick"),title:X.sql,type:"button",children:re+1},`${re.toString()}:${X.sql}`))}),e[72]=d,e[73]=p,e[74]=oe):oe=e[74];let se;e[75]!==o?(se=o!==null&&(0,u.jsx)(st,{className:"m-3 font-mono text-xs",testId:"sql-error",variant:"destructive",children:o}),e[75]=o,e[76]=se):se=e[76];let le;e[77]!==o||e[78]!==b||e[79]!==g?(le=o===null&&b===null&&(0,u.jsx)("p",{className:"p-4 text-sm text-muted-foreground","data-testid":"sql-empty",children:g("Click Run to execute your query.")}),e[77]=o,e[78]=b,e[79]=g,e[80]=le):le=e[80];let ie;e[81]!==t||e[82]!==o||e[83]!==N||e[84]!==b||e[85]!==g?(ie=o===null&&b!==null&&(0,u.jsxs)("div",{"data-testid":"sql-result",children:[N==="chart"?(0,u.jsx)(ct,{axes:t,result:b}):(0,u.jsx)(dt,{result:b}),(0,u.jsx)("p",{className:"border-t border-border px-3 py-1.5 text-xs text-muted-foreground","data-testid":"sql-count",children:b.truncated?g("Showing the first {max} of {count} rows.",{count:b.rowCount,max:b.rows.length}):g("{count} rows",{count:b.rowCount})})]}),e[81]=t,e[82]=o,e[83]=N,e[84]=b,e[85]=g,e[86]=ie):ie=e[86];let H;e[87]!==se||e[88]!==le||e[89]!==ie?(H=(0,u.jsxs)("div",{className:"min-h-0 flex-1 overflow-auto",children:[se,le,ie]}),e[87]=se,e[88]=le,e[89]=ie,e[90]=H):H=e[90];let J;return e[91]!==r||e[92]!==O||e[93]!==oe||e[94]!==H?(J=(0,u.jsxs)("div",{className:r,children:[O,oe,H]}),e[91]=r,e[92]=O,e[93]=oe,e[94]=H,e[95]=J):J=e[95],J},"bs"),yo=a((s,e)=>s.trim()===""?e:(s.split(`
|
|
15
|
+
`)[0]??s).slice(0,24),"gs"),wo=a(s=>{s?.focus(),s?.select()},"xs"),So=a(s=>{let e=(0,Z.c)(14),{initial:n,onCancel:t,onCommit:r,placeholder:o,testId:l}=s,i=ae(),c;e[0]!==r?(c=a(f=>{r(f.currentTarget.value.trim())},"c"),e[0]=r,e[1]=c):c=e[1];let d=c,m;e[2]!==t||e[3]!==r?(m=a(f=>{f.key==="Enter"?r(f.currentTarget.value.trim()):f.key==="Escape"&&t()},"f"),e[2]=t,e[3]=r,e[4]=m):m=e[4];let x=m,h;e[5]!==i?(h=i("Tab title"),e[5]=i,e[6]=h):h=e[6];let v;return e[7]!==n||e[8]!==d||e[9]!==x||e[10]!==o||e[11]!==h||e[12]!==l?(v=(0,u.jsx)("input",{"aria-label":h,className:"w-40 rounded border border-ring bg-background px-1 py-0.5 text-xs outline-none","data-testid":l,defaultValue:n,onBlur:d,onKeyDown:x,placeholder:o,ref:wo,type:"text"}),e[7]=n,e[8]=d,e[9]=x,e[10]=o,e[11]=h,e[12]=l,e[13]=v):v=e[13],v},"ys"),Co=a(s=>{let e=(0,Z.c)(29),{idBase:n,onDiscard:t,onKeep:r}=s,o=ae(),l=`sql-tab-close-prompt-${n}`,i;e[0]!==o?(i=o("Discard?"),e[0]=o,e[1]=i):i=e[1];let c;e[2]!==i?(c=(0,u.jsx)("span",{className:"text-[11px] text-muted-foreground",children:i}),e[2]=i,e[3]=c):c=e[3];let d;e[4]!==o?(d=o("Discard changes"),e[4]=o,e[5]=d):d=e[5];let m=`sql-tab-close-confirm-${n}`,x;e[6]!==o?(x=o("Discard changes"),e[6]=o,e[7]=x):x=e[7];let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=(0,u.jsx)("svg",{"aria-hidden":"true",className:"size-3",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.4,viewBox:"0 0 24 24",children:(0,u.jsx)("path",{d:"M5 13l4 4L19 7"})}),e[8]=h):h=e[8];let v;e[9]!==t||e[10]!==d||e[11]!==m||e[12]!==x?(v=(0,u.jsx)("button",{"aria-label":d,className:"flex size-5 items-center justify-center rounded text-destructive hover:bg-destructive/10","data-testid":m,onClick:t,title:x,type:"button",children:h}),e[9]=t,e[10]=d,e[11]=m,e[12]=x,e[13]=v):v=e[13];let f;e[14]!==o?(f=o("Keep editing"),e[14]=o,e[15]=f):f=e[15];let N=`sql-tab-close-cancel-${n}`,b;e[16]!==o?(b=o("Keep editing"),e[16]=o,e[17]=b):b=e[17];let w;e[18]===Symbol.for("react.memo_cache_sentinel")?(w=(0,u.jsx)("svg",{"aria-hidden":"true",className:"size-3",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.4,viewBox:"0 0 24 24",children:(0,u.jsx)("path",{d:"M6 6l12 12M18 6 6 18"})}),e[18]=w):w=e[18];let p;e[19]!==r||e[20]!==N||e[21]!==b||e[22]!==f?(p=(0,u.jsx)("button",{"aria-label":f,className:"flex size-5 items-center justify-center rounded text-muted-foreground hover:bg-accent","data-testid":N,onClick:r,title:b,type:"button",children:w}),e[19]=r,e[20]=N,e[21]=b,e[22]=f,e[23]=p):p=e[23];let S;return e[24]!==l||e[25]!==p||e[26]!==c||e[27]!==v?(S=(0,u.jsxs)("span",{className:"flex shrink-0 items-center gap-1","data-testid":l,role:"group",children:[c,v,p]}),e[24]=l,e[25]=p,e[26]=c,e[27]=v,e[28]=S):S=e[28],S},"vs"),ko=a(s=>{let e=(0,Z.c)(47),{active:n,canClose:t,onClose:r,onMenu:o,onRename:l,onSelect:i,tab:c}=s,d=ae(),[m,x]=(0,B.useState)(!1),[h,v]=(0,B.useState)(!1),f;e[0]!==o||e[1]!==c.id?(f=a($=>{o(c.id,$)},"d"),e[0]=o,e[1]=c.id,e[2]=f):f=e[2];let N=f,b;e[3]!==i||e[4]!==c.id?(b=a(()=>{i(c.id)},"m"),e[3]=i,e[4]=c.id,e[5]=b):b=e[5];let w=b,p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=a(()=>{x(!0)},"b"),e[6]=p):p=e[6];let S=p,y;e[7]!==r||e[8]!==c?(y=a($=>{$.stopPropagation(),qt(c)?v(!0):r(c.id)},"v"),e[7]=r,e[8]=c,e[9]=y):y=e[9];let g=y,C;e[10]!==r||e[11]!==c.id?(C=a($=>{$.stopPropagation(),v(!1),r(c.id)},"E"),e[10]=r,e[11]=c.id,e[12]=C):C=e[12];let k=C,q;e[13]===Symbol.for("react.memo_cache_sentinel")?(q=a($=>{$.stopPropagation(),v(!1)},"T"),e[13]=q):q=e[13];let E=q,T;e[14]!==l||e[15]!==c.id?(T=a($=>{l(c.id,$),x(!1)},"R"),e[14]=l,e[15]=c.id,e[16]=T):T=e[16];let I=T,D;e[17]===Symbol.for("react.memo_cache_sentinel")?(D=a(()=>{x(!1)},"_"),e[17]=D):D=e[17];let R=D,_;e[18]!==c.name?(_=c.name.trim(),e[18]=c.name,e[19]=_):_=e[19];let Q=_,j;e[20]!==d||e[21]!==c.sql?(j=yo(c.sql,d("Untitled")),e[20]=d,e[21]=c.sql,e[22]=j):j=e[22];let K=j,P=n?"bg-background text-foreground":"bg-muted/40 text-muted-foreground hover:text-foreground",W;e[23]!==P?(W=ue("group/tab flex shrink-0 items-center gap-1 border-e border-border ps-3 pe-1.5 text-xs",P),e[23]=P,e[24]=W):W=e[24];let F=`sql-tab-${c.id}`,L;e[25]!==n||e[26]!==I||e[27]!==Q||e[28]!==K||e[29]!==m||e[30]!==w||e[31]!==d||e[32]!==c.id?(L=m?(0,u.jsx)(So,{initial:Q,onCancel:R,onCommit:I,placeholder:K,testId:`sql-tab-rename-${c.id}`}):(0,u.jsx)("button",{"aria-pressed":n,className:"max-w-40 truncate py-1.5 outline-none","data-testid":`sql-tab-select-${c.id}`,onClick:w,onDoubleClick:S,title:d("Double-click to rename"),type:"button",children:Q===""?K:Q}),e[25]=n,e[26]=I,e[27]=Q,e[28]=K,e[29]=m,e[30]=w,e[31]=d,e[32]=c.id,e[33]=L):L=e[33];let M;e[34]!==t||e[35]!==k||e[36]!==h||e[37]!==g||e[38]!==d||e[39]!==c.id?(M=t&&(h?(0,u.jsx)(Co,{idBase:c.id,onDiscard:k,onKeep:E}):(0,u.jsx)("button",{"aria-label":d("Close tab"),className:"flex size-5 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-destructive/10 hover:text-destructive","data-testid":`sql-tab-close-${c.id}`,onClick:g,title:d("Close tab"),type:"button",children:(0,u.jsx)("svg",{"aria-hidden":"true",className:"size-3",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",children:(0,u.jsx)("path",{d:"M6 6l12 12M18 6 6 18"})})})),e[34]=t,e[35]=k,e[36]=h,e[37]=g,e[38]=d,e[39]=c.id,e[40]=M):M=e[40];let z;return e[41]!==N||e[42]!==W||e[43]!==F||e[44]!==L||e[45]!==M?(z=(0,u.jsxs)("div",{className:W,"data-testid":F,onContextMenu:N,children:[L,M]}),e[41]=N,e[42]=W,e[43]=F,e[44]=L,e[45]=M,e[46]=z):z=e[46],z},"Ss"),No=a(s=>{let e=(0,Z.c)(43),{model:n,onSelect:t}=s,r=ae(),{activeTab:o,addEditorTab:l,cancelBulk:i,closeEditorTab:c,closeTabMenu:d,confirmBulk:m,menuStyle:x,onBackdropContextMenu:h,onCloseAll:v,onCloseOthers:f,onCloseToRight:N,openTabMenu:b,pendingBulk:w,renameTab:p,tabMenu:S,tabs:y}=n,g;if(e[0]!==o||e[1]!==c||e[2]!==t||e[3]!==b||e[4]!==p||e[5]!==y){let _;e[7]!==o||e[8]!==c||e[9]!==t||e[10]!==b||e[11]!==p||e[12]!==y.length?(_=a(Q=>(0,u.jsx)(ko,{active:Q.id===o.id,canClose:y.length>1,onClose:c,onMenu:b,onRename:p,onSelect:t,tab:Q},Q.id),"L"),e[7]=o,e[8]=c,e[9]=t,e[10]=b,e[11]=p,e[12]=y.length,e[13]=_):_=e[13],g=y.map(_),e[0]=o,e[1]=c,e[2]=t,e[3]=b,e[4]=p,e[5]=y,e[6]=g}else g=e[6];let C;e[14]!==r?(C=r("New tab"),e[14]=r,e[15]=C):C=e[15];let k=y.length>=Xe,q;e[16]!==r?(q=r("New tab"),e[16]=r,e[17]=q):q=e[17];let E;e[18]===Symbol.for("react.memo_cache_sentinel")?(E=(0,u.jsx)("svg",{"aria-hidden":"true",className:"size-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.7,viewBox:"0 0 24 24",children:(0,u.jsx)("path",{d:"M12 5v14M5 12h14"})}),e[18]=E):E=e[18];let T;e[19]!==l||e[20]!==C||e[21]!==k||e[22]!==q?(T=(0,u.jsx)("button",{"aria-label":C,className:"flex size-8 shrink-0 items-center justify-center text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-40","data-testid":"sql-tab-add",disabled:k,onClick:l,title:q,type:"button",children:E}),e[19]=l,e[20]=C,e[21]=k,e[22]=q,e[23]=T):T=e[23];let I;e[24]!==g||e[25]!==T?(I=(0,u.jsxs)("div",{className:"flex shrink-0 items-stretch overflow-x-auto border-b border-border bg-muted/30","data-testid":"sql-tab-strip",role:"tablist",children:[g,T]}),e[24]=g,e[25]=T,e[26]=I):I=e[26];let D;e[27]!==i||e[28]!==d||e[29]!==m||e[30]!==x||e[31]!==h||e[32]!==v||e[33]!==f||e[34]!==N||e[35]!==w||e[36]!==r||e[37]!==S||e[38]!==y?(D=S!==null&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("div",{className:"fixed inset-0 z-40","data-testid":"sql-tab-menu-backdrop",onClick:d,onContextMenu:h,role:"presentation"}),(0,u.jsx)("div",{className:"fixed z-50 min-w-44 rounded-md border border-border bg-popover py-1 text-popover-foreground shadow-md","data-testid":"sql-tab-menu",role:"menu",style:x,children:w===null?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("button",{className:"flex w-full items-center px-3 py-1.5 text-start text-xs outline-none hover:bg-accent focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-40","data-testid":"sql-tab-menu-close-others",disabled:y.length<=1,onClick:f,role:"menuitem",type:"button",children:r("Close other tabs")}),(0,u.jsx)("button",{className:"flex w-full items-center px-3 py-1.5 text-start text-xs outline-none hover:bg-accent focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-40","data-testid":"sql-tab-menu-close-right",disabled:y.findIndex(_=>_.id===S.id)>=y.length-1,onClick:N,role:"menuitem",type:"button",children:r("Close tabs to the right")}),(0,u.jsx)("button",{className:"flex w-full items-center px-3 py-1.5 text-start text-xs outline-none hover:bg-accent focus-visible:bg-accent","data-testid":"sql-tab-menu-close-all",onClick:v,role:"menuitem",type:"button",children:r("Close all tabs")})]}):(0,u.jsxs)("div",{className:"px-3 py-1.5","data-testid":"sql-tab-menu-confirm",children:[(0,u.jsx)("p",{className:"pb-1.5 text-xs text-muted-foreground",children:r("Discard unsaved tabs?")}),(0,u.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,u.jsx)("button",{className:"rounded px-2 py-1 text-xs font-medium text-destructive outline-none hover:bg-destructive/10 focus-visible:bg-destructive/10","data-testid":"sql-tab-menu-confirm-discard",onClick:m,type:"button",children:r("Discard")}),(0,u.jsx)("button",{className:"rounded px-2 py-1 text-xs text-muted-foreground outline-none hover:bg-accent focus-visible:bg-accent","data-testid":"sql-tab-menu-confirm-cancel",onClick:i,type:"button",children:r("Cancel")})]})]})})]}),e[27]=i,e[28]=d,e[29]=m,e[30]=x,e[31]=h,e[32]=v,e[33]=f,e[34]=N,e[35]=w,e[36]=r,e[37]=S,e[38]=y,e[39]=D):D=e[39];let R;return e[40]!==I||e[41]!==D?(R=(0,u.jsxs)(u.Fragment,{children:[I,D]}),e[40]=I,e[41]=D,e[42]=R):R=e[42],R},"ws"),qo=Se(ke.runSql),Eo="lunora-studio-sql-split-view",To=a(()=>Ee(Tt[0]?.sql??""),"Ns"),Xo=a(s=>{let e=(0,Z.c)(117),{initialShardKey:n}=s,t=_e(),r=Gn(To),{activeTab:o,output:l,patchActiveOutput:i,patchActiveTab:c,setActiveTabId:d,unlinkQuery:m}=r,x;e[0]!==i||e[1]!==c?(x=a((ne,ce)=>{c({activeId:ce,sql:ne}),i({chart:void 0,error:null,failed:void 0,result:null,script:void 0})},"g"),e[0]=i,e[1]=c,e[2]=x):x=e[2];let h=x,v;e[3]!==h||e[4]!==m?(v={loadIntoActiveTab:h,unlinkQuery:m},e[3]=h,e[4]=m,e[5]=v):v=e[5];let f=eo(v),{recordHistory:N,updateQuerySql:b}=f,w=o.sql,{activeId:p}=o,{chart:S,error:y,failed:g,result:C,running:k}=l,q=l.pane,[E,T]=(0,B.useState)(n??""),[I,D]=Ae(Eo,!1),{probe:R,schema:_}=Dn(E),Q;e[6]!==p||e[7]!==c||e[8]!==b?(Q=a(ne=>{c({sql:ne}),p!==null&&b(p,ne)},"F"),e[6]=p,e[7]=c,e[8]=b,e[9]=Q):Q=e[9];let j=Q,K=gn(w,_,E),P=it(E),W;e[10]!==P||e[11]!==i||e[12]!==C?(W=a(()=>{C!==null&&me((async()=>{let ne=await P.inferChart({columns:C.columns,rowCount:C.rowCount,types:Object.fromEntries(C.columns.map(ce=>[ce,typeof(C.rows[0]?.[ce]??"")]))});i({chart:ne})})())},"W"),e[10]=P,e[11]=i,e[12]=C,e[13]=W):W=e[13];let F=W,L;e[14]!==t||e[15]!==N||e[16]!==E?(L=a(async ne=>{try{let ce=await t.query(qo,{sql:ne},Ce(E));return N(ne),{error:null,result:ce,sql:ne}}catch(ce){return{error:tt(ce),result:null,sql:ne}}},"I"),e[14]=t,e[15]=N,e[16]=E,e[17]=L):L=e[17];let M=L,z;e[18]!==w||e[19]!==i||e[20]!==M||e[21]!==E?(z=a(async ne=>{if(w.trim()==="")return;i({running:!0});let ce=ne==="explain"?Ye(Bt(w),0):wt(w),de=[];for(let Re of ce){let It={error:Re.rejection?.message??"",result:null,sql:Re.sql};de.push(Re.rejection===void 0?await M(Re.sql):It)}ot(E);let et=Math.max(de.length-1,0),ye=de[et];i({chart:void 0,error:ye?.error??null,failed:ye?.error===null||ye===void 0?void 0:{error:ye.error,sql:ye.sql},pane:ne,result:ye?.result??null,running:!1,script:de.length>1?{runs:de,selected:et}:void 0})},"K"),e[18]=w,e[19]=i,e[20]=M,e[21]=E,e[22]=z):z=e[22];let $=z,te;e[23]!==l.script?.runs||e[24]!==i?(te=a(ne=>{let ce=l.script?.runs,de=ce?.[ne];ce===void 0||de===void 0||i({chart:void 0,error:de.error,failed:de.error===null?void 0:{error:de.error,sql:de.sql},result:de.result,script:{runs:ce,selected:ne}})},"ee"),e[23]=l.script?.runs,e[24]=i,e[25]=te):te=e[25];let V=te,ee;e[26]!==$?(ee=a(()=>{me($("results"))},"Z"),e[26]=$,e[27]=ee):ee=e[27];let A=ee,U=!P.unavailable,G;e[28]!==l.pane||e[29]!==$?(G=a(()=>{me($(l.pane))},"j"),e[28]=l.pane,e[29]=$,e[30]=G):G=e[30];let Y;e[31]!==R||e[32]!==_||e[33]!==j||e[34]!==G||e[35]!==U?(Y={inlineEditEnabled:U,onSubmit:G,probe:R,schema:_,setDraft:j},e[31]=R,e[32]=_,e[33]=j,e[34]=G,e[35]=U,e[36]=Y):Y=e[36];let O=Pn(Y),{closeAutocomplete:oe,closeInlineEdit:se}=O,le;e[37]!==w||e[38]!==j?(le=a(()=>{j(Jt(w))},"ie"),e[37]=w,e[38]=j,e[39]=le):le=e[39];let ie=le,H;e[40]!==oe||e[41]!==se||e[42]!==d?(H=a(ne=>{oe(),se(),d(ne)},"P"),e[40]=oe,e[41]=se,e[42]=d,e[43]=H):H=e[43];let J=H,X;e[44]!==i?(X=a(()=>{i({pane:"results"})},"V"),e[44]=i,e[45]=X):X=e[45];let re=X,fe;e[46]!==$?(fe=a(()=>{me($("explain"))},"pe"),e[46]=$,e[47]=fe):fe=e[47];let je=fe,Te;e[48]!==i?(Te=a(()=>{i({pane:"chart"})},"ke"),e[48]=i,e[49]=Te):Te=e[49];let ze=Te,Ie;e[50]!==D||e[51]!==I?(Ie=a(()=>{D(!I)},"Te"),e[50]=D,e[51]=I,e[52]=Ie):Ie=e[52];let He=Ie,We=I?"flex min-h-0 flex-1 flex-row":"flex min-h-0 flex-1 flex-col",Be=I?"flex w-2/5 min-h-0 min-w-0 shrink-0 flex-col border-s border-border":"flex h-2/5 min-h-0 shrink-0 flex-col border-t border-border",he;e[53]!==p||e[54]!==f.clearHistory||e[55]!==f.deleteQuery||e[56]!==f.history||e[57]!==f.listRef||e[58]!==f.loadFromHistory||e[59]!==f.loadTemplate||e[60]!==f.newQuery||e[61]!==f.onSearchChange||e[62]!==f.queries||e[63]!==f.rememberHistory||e[64]!==f.search||e[65]!==f.selectQuery||e[66]!==f.setRememberHistory?(he=(0,u.jsx)(xo,{activeId:p,history:f.history,listRef:f.listRef,onClearHistory:f.clearHistory,onDelete:f.deleteQuery,onLoadHistory:f.loadFromHistory,onLoadTemplate:f.loadTemplate,onNew:f.newQuery,onSearchChange:f.onSearchChange,onSelect:f.selectQuery,onToggleRememberHistory:f.setRememberHistory,queries:f.queries,rememberHistory:f.rememberHistory,search:f.search}),e[53]=p,e[54]=f.clearHistory,e[55]=f.deleteQuery,e[56]=f.history,e[57]=f.listRef,e[58]=f.loadFromHistory,e[59]=f.loadTemplate,e[60]=f.newQuery,e[61]=f.onSearchChange,e[62]=f.queries,e[63]=f.rememberHistory,e[64]=f.search,e[65]=f.selectQuery,e[66]=f.setRememberHistory,e[67]=he):he=e[67];let pe;e[68]!==r||e[69]!==J?(pe=(0,u.jsx)(No,{model:r,onSelect:J}),e[68]=r,e[69]=J,e[70]=pe):pe=e[70];let be;e[71]!==P||e[72]!==K||e[73]!==w||e[74]!==g||e[75]!==j||e[76]!==O.acceptInlineEdit||e[77]!==O.autocompleteState||e[78]!==O.closeInlineEdit||e[79]!==O.editorRef||e[80]!==O.gutterRef||e[81]!==O.handlers||e[82]!==O.inlineEdit||e[83]!==O.listboxId||e[84]!==O.onPickSuggestion||e[85]!==O.overlayRef||e[86]!==O.revealDiagnostic?(be=(0,u.jsx)(ho,{assistant:P,autocomplete:O.autocompleteState,diagnostics:K,draft:w,editorRef:O.editorRef,failed:g,gutterRef:O.gutterRef,handlers:O.handlers,inlineEdit:O.inlineEdit,listboxId:O.listboxId,onAcceptInlineEdit:O.acceptInlineEdit,onCancelInlineEdit:O.closeInlineEdit,onGenerated:j,onPickSuggestion:O.onPickSuggestion,onRevealDiagnostic:O.revealDiagnostic,overlayRef:O.overlayRef}),e[71]=P,e[72]=K,e[73]=w,e[74]=g,e[75]=j,e[76]=O.acceptInlineEdit,e[77]=O.autocompleteState,e[78]=O.closeInlineEdit,e[79]=O.editorRef,e[80]=O.gutterRef,e[81]=O.handlers,e[82]=O.inlineEdit,e[83]=O.listboxId,e[84]=O.onPickSuggestion,e[85]=O.overlayRef,e[86]=O.revealDiagnostic,e[87]=be):be=e[87];let ge;e[88]!==P||e[89]!==y||e[90]!==ie||e[91]!==F||e[92]!==S||e[93]!==A||e[94]!==V||e[95]!==l.script||e[96]!==C||e[97]!==Be||e[98]!==k||e[99]!==E||e[100]!==ze||e[101]!==je||e[102]!==re||e[103]!==I||e[104]!==q||e[105]!==He?(ge=(0,u.jsx)(vo,{assistant:P,chart:S,className:Be,error:y,onFormat:ie,onInferChart:F,onRun:A,onSelectStatement:V,onShardKeyChange:T,onShowChart:ze,onShowExplain:je,onShowResults:re,onToggleSplit:He,pane:q,result:C,running:k,script:l.script,shardKey:E,splitView:I}),e[88]=P,e[89]=y,e[90]=ie,e[91]=F,e[92]=S,e[93]=A,e[94]=V,e[95]=l.script,e[96]=C,e[97]=Be,e[98]=k,e[99]=E,e[100]=ze,e[101]=je,e[102]=re,e[103]=I,e[104]=q,e[105]=He,e[106]=ge):ge=e[106];let xe;e[107]!==be||e[108]!==ge||e[109]!==We?(xe=(0,u.jsxs)("div",{className:We,children:[be,ge]}),e[107]=be,e[108]=ge,e[109]=We,e[110]=xe):xe=e[110];let ve;e[111]!==pe||e[112]!==xe?(ve=(0,u.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[pe,xe]}),e[111]=pe,e[112]=xe,e[113]=ve):ve=e[113];let Le;return e[114]!==he||e[115]!==ve?(Le=(0,u.jsxs)("div",{className:"flex h-full min-w-0","data-testid":"lunora-sql-editor",children:[he,ve]}),e[114]=he,e[115]=ve,e[116]=Le):Le=e[116],Le},"Qs");export{Xo as SqlEditorPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as f,d as r,e as m,f as n}from"./chunk-YKXDMIHQ.js";var u=r(n(),1),s=r(m(),1);function a(t){let e=(0,u.c)(2),c=(0,s.useRef)(t),o;return e[0]!==t?(o=f(()=>{c.current=t},"t"),e[0]=t,e[1]=o):o=e[1],(0,s.useEffect)(o),c}f(a,"m");export{a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as s}from"./chunk-55754F6H.js";import{d}from"./chunk-PTZD7RUZ.js";import{a as e,d as r,e as h,g as k}from"./chunk-YKXDMIHQ.js";var l=r(h(),1);var t=r(k(),1);var g=e(({children:m,confirmLabel:c,disabled:a=!1,onConfirm:p,testId:i})=>{let o=d(),[f,n]=(0,l.useState)(!1),u=e(()=>{n(!0)},"f"),C=e(()=>{n(!1)},"l"),b=e(()=>{n(!1),p()},"p");return f?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1","data-testid":`${i}-prompt`,role:"group",children:[(0,t.jsx)(s,{"data-testid":`${i}-confirm`,disabled:a,onClick:b,size:"sm",type:"button",variant:"destructive",children:c??o("Confirm")}),(0,t.jsx)(s,{"data-testid":`${i}-cancel`,onClick:C,size:"sm",type:"button",variant:"ghost",children:o("Cancel")})]}):(0,t.jsx)(s,{"data-testid":i,disabled:a,onClick:u,size:"sm",type:"button",variant:"outline",children:m})},"k");export{g as a};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import{a}from"./chunk-YKXDMIHQ.js";var n="https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-5xx-errors/",r="https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-1xxx-errors/",_=/string or blob too big/iu,l={BAD_REQUEST:{status:400,title:"Bad request"},UNAUTHORIZED:{status:401,title:"Unauthorized"},FORBIDDEN:{status:403,title:"Forbidden"},NOT_FOUND:{status:404,title:"Not found"},CONFLICT:{hint:["Another write changed this row while your mutation was running (optimistic concurrency conflict).","","Re-read the row and retry the mutation with the fresh value. Lunora serializes a DO's mutations, so a persistent conflict usually means the handler conflicts **with itself** (e.g. a trigger or cascade touching the same row) \u2014 split that work rather than adding a retry loop."],status:409,title:"Conflict"},NOT_UNIQUE:{hint:["`.unique()` matched more than one document \u2014 it expects the query to identify at most one row.","","- If several matches are legitimate, use `.first()` (take one) or `.collect()` (take all) instead.","- Otherwise tighten the query (e.g. filter on a unique/indexed field) so it can only match one row."],status:400,title:"Query matched more than one document"},VALIDATION_ERROR:{status:400,title:"Validation failed"},TOO_MANY_REQUESTS:{status:429,title:"Too many requests"},UNPROCESSABLE:{status:422,title:"Unprocessable"},NOT_IMPLEMENTED:{status:501,title:"Not implemented"},FUNCTION_NOT_FOUND:{status:404,title:"Function not found"},METHOD_NOT_ALLOWED:{status:405,title:"Method not allowed"},PAYLOAD_TOO_LARGE:{status:413,title:"Payload too large"},INTERNAL:{internal:!0,status:500,title:"Internal error"},INTERNAL_SERVER_ERROR:{internal:!0,status:500,title:"Internal error"},RPC_FAILED:{internal:!0,status:500,title:"Internal error"},COUNT_RLS_UNSUPPORTED:{status:422,title:"count() is unsupported under an RLS policy"},MASK_UNSUPPORTED:{status:422,title:"Aggregation over a masked column is unsupported"},RELATION_PREDICATE_UNSUPPORTED:{status:422,title:"Relation predicate is unsupported in a write policy"},RLS_REQUIRED:{hint:["This table is secure-by-default: it has no `.public()` marker and no RLS policy resolved for the caller, so the read fails closed.","","Add a read policy with `.rls(...)`, or mark the table `.public()` if it is intentionally world-readable."],status:403,title:"RLS policy required"},RUN_DEPTH_EXCEEDED:{internal:!0,status:500,title:"Run depth exceeded"},RUN_KIND_FORBIDDEN:{status:500,title:"Function kind may not be composed from a query"},TRANSACTION_LIMIT_EXCEEDED:{hint:["A single mutation may only read and write a bounded amount before it is stopped.","","Narrow the read with an index (`.withIndex(...)`) instead of scanning the table, or split the write across several mutations \u2014 for a large backfill use `defineMigration` + `lunora migrate up`, which batches and checkpoints for you.","","The ceilings are deliberately conservative \u2014 they exist to stop one request taking down the whole shard. A deployment that genuinely needs bigger transactions can raise them by overriding the `transactionLimits()` seam on its generated shard class."],status:413,title:"Transaction limit exceeded"},MIGRATION_NOT_FOUND:{status:404,title:"Data migration not found"},MIGRATION_DRIFT:{hint:["An applied SQL migration is never re-run, so the runner stopped before applying anything.","","- **Its text changed after it ran:** revert the edit and put the change in a new migration. If the edit is inert (a comment, whitespace, line endings), record the new hash with the `UPDATE` the message prints.","- **Tracking rows predate versions and match no migration:** set each row's `version` with the `UPDATE` the message prints, so the runner can tell what already ran."],status:409,title:"Migration drift"},UNKNOWN_TABLE:{status:404,title:"Unknown table"},GLOBAL_TABLE_NOT_EDITABLE:{status:400,title:"Global table is not editable"},SHARD_ERROR:{status:503,title:"Shard error"},SHARD_UNAVAILABLE:{status:503,title:"Shard unavailable"},SHARD_TIMEOUT:{status:504,title:"Shard timeout"},SHARD_HTTP_ERROR:{status:502,title:"Shard HTTP error"},SUBSCRIPTION_PERSIST_FAILED:{status:500,title:"Subscription persist failed"},TOO_MANY_SUBSCRIPTIONS:{status:429,title:"Too many subscriptions"},OFFLINE_IDENTITY_CHANGED:{status:409,title:"Offline identity changed"},IDENTITY_MISMATCH:{hint:["A write queued offline was replayed on a session that now belongs to someone else (a sign-out, or another user's sign-in, while it waited), so the worker refused it rather than commit it as them.","","`@lunora/client` re-resolves the session on this refusal and settles the write itself. If every replay is refused while the same user stays signed in, your worker's `resolveIdentity` returns a different `userId` than better-auth's `user.id`, or the RPC request carries no session cookie."],status:409,title:"Session changed since the write was queued"},CODEGEN_DIAGNOSTIC:{status:500,title:"Codegen diagnostic"},JURISDICTION_MOVE:{hint:["The schema declares `.jurisdiction(...)` and the project has DO-backed auth (`.auth({ namespace })`). Pinning the auth object to the jurisdiction resolves it to a new, empty one: every user, account and session stays in the unpinned object until copied across. Voice sessions are pinned without an acknowledgement: they store nothing, and their transcripts are rows in the already-pinned shards.","",'Acknowledge with `.jurisdiction("eu", { pinAuth: true })` and deploy, then copy the auth tables across with the `__lunora_admin__:copyAuthToJurisdiction` admin op and, once the counts check out, purge the unpinned copy with `__lunora_admin__:purgeUnpinnedAuth` (see [Pinning auth and voice](/docs/concepts/data-residency#pinning-auth-and-voice)). For D1-mode auth the acknowledgement changes nothing.'],status:422,title:"Unacknowledged jurisdiction move"},SCHEMA_SNAPSHOT_PARSE:{status:500,title:"Schema snapshot parse error"},ENV_INVALID:{internal:!0,status:500,title:"Invalid environment"},AUTH_HEADERS_MISSING:{internal:!0,status:500,title:"Auth headers missing"},EMAIL_DOMAIN_BLOCKED:{hint:["This address's domain is on the disposable/throwaway blocklist (or your configured deny-list).","","Sign up with a permanent mailbox. To tune the policy, pass `blockDisposable` / `allowDomains` / `denyDomains` in the `EmailGateConfig` you hand `assertEmailAllowed` / `classifyEmail` / `emailGateMiddleware` (`@lunora/auth/email-guard`)."],status:400,title:"Email domain not allowed"},EMAIL_UNDELIVERABLE:{hint:["The address's domain publishes no MX (or fallback A/AAAA) records, so it can't receive mail.","","Check for a typo in the domain. MX verification is opt-in (`mx: true`) and needs DNS \u2014 leave it off on the edge path if DNS is unavailable."],status:400,title:"Email domain cannot receive mail"},ANALYTICS_SQL_ERROR:{status:502,title:"Analytics Engine SQL API error"},R2_SQL_ERROR:{status:502,title:"R2 SQL API error"},WORKFLOWS_REST_ERROR:{status:502,title:"Cloudflare Workflows REST API error"},CONFIG_INVALID:{internal:!0,status:500,title:"Payment configuration invalid"},CURRENCY_MISMATCH:{status:400,title:"Currency mismatch"},PROVIDER_ERROR:{status:502,title:"Payment provider error"},WEBHOOK_EVENT_ID_MISSING:{status:400,title:"Webhook event id missing"},WEBHOOK_SIGNATURE_INVALID:{status:400,title:"Webhook signature invalid"},WEBHOOK_TIMESTAMP_INVALID:{status:400,title:"Webhook timestamp outside tolerance"},ADMIN_FORBIDDEN:{status:403,title:"Admin access forbidden"},ADMIN_TOKEN_NOT_CONFIGURED:{status:400,title:"Admin token not configured"},AUTH_MIGRATOR_UNSUPPORTED:{hint:["better-auth migrates only through its Kysely adapter, so `ensureMigrated` / `compileMigrationsSql` need the raw D1 binding as `database` \u2014 a custom adapter (`lunoraD1Adapter`, `lunoraAuthAdapter`, `lunoraDoAdapter`) cannot be migrated through, and neither can an absent `database`.","","Build a SECOND, migration-only instance over the raw binding \u2014 `createAuth({ ...options, database: env.DB })` \u2014 and hand that one to `ensureMigrated`. Keep the adapter on the instance that serves requests: the adapter exists to dodge a dev-runner hang in `$context`, which the migration instance never resolves.","","To compile the SQL off-platform (`compileMigrationsSql`), diff against an empty local database \u2014 `new DatabaseSync(':memory:')` from `node:sqlite` \u2014 rather than passing no `database` at all."],status:500,title:"Auth migrator cannot drive the configured database"},AUTH_NOT_CONFIGURED:{status:400,title:"Auth admin not configured"},AUTH_OP_NOT_SUPPORTED:{status:400,title:"Auth admin operation not supported"},BACKUP_NOT_CONFIGURED:{status:500,title:"Scheduled backup not configured"},BACKUP_RETENTION_NOT_CONFIGURED:{hint:["`lunora backup prune` removes snapshots past the retention window, and this worker has no window: set `backupRetain` (how many to keep) and `backupCron` (which decides whose snapshots retention owns) on `createWorker`.","","Nothing was deleted. A default is deliberately not invented here \u2014 retention deleting on its own is exactly what this command exists to replace."],status:400,title:"Backup retention window not configured"},BACKUP_TOO_LARGE:{hint:["The scheduled backup is assembled inside the Worker isolate, so it caps the snapshot it will build. Nothing was written.","","The cap is on the NDJSON, not on peak memory: the export fan-out resolves every shard's rows before the first row is encoded, so a snapshot under the cap can still exhaust the isolate. It is set well below the isolate's limit for that reason.","","Narrow the snapshot with `backupTables`, or take this backup off-platform with `lunora backup create --bucket`, which runs on a machine rather than in an isolate. Backing up more often does not help \u2014 every run is a full snapshot."],status:507,title:"Backup too large to assemble in a Worker"},CRON_JOBS_NOT_CONFIGURED:{status:400,title:"Cron jobs not configured"},CRON_JOB_NOT_FOUND:{status:404,title:"Cron job not found"},EXPORT_SHARD_FAILED:{hint:["One or more shards failed to export, so the snapshot would have been short. Nothing is written when this fires \u2014 a partial export must never be mistaken for a complete one.","","The message names each failed shard key and its error. Re-run the export once those shards are reachable; a shard that fails repeatedly is usually over the per-request memory budget, which `backupTables` narrows."],status:502,title:"Export failed on one or more shards"},EXPORT_TAP_NOT_CONFIGURED:{status:400,title:"Export tap not configured"},FUNCTIONS_NOT_CONFIGURED:{status:400,title:"Functions registry not configured"},GLOBALS_NOT_CONFIGURED:{status:400,title:"Global-table introspector not configured"},ID_COLLISION:{hint:["The imported row carries an `_id` that is already held by a DIFFERENT table in this shard. Ids are per-table, so inserting it would leave two tables claiming one id and make a later lookup resolve to whichever one it reached first.","","This is reported per row rather than aborting the import: the remaining rows still apply. Re-mint the id on the source side, or import that table into a shard that does not already hold it."],status:409,title:"Document id already belongs to another table"},KV_NOT_CONFIGURED:{status:400,title:"KV introspector not configured"},MIGRATION_ID_REQUIRED:{status:400,title:"Migration id required"},PITR_UNAVAILABLE:{status:409,title:"Point-in-time recovery unavailable"},SCHEDULER_NOT_CONFIGURED:{status:400,title:"Scheduler not configured"},STORAGE_CHECKSUM_MISMATCH:{hint:["The upload body did not match the declared `expectedSize` or `expectedSha256`, so nothing was written \u2014 this check fails closed.","","Re-read the bytes from the source export and retry the transfer. A persistent mismatch means the source blob is corrupt or truncated; fix the export rather than bypassing the check."],status:400,title:"Storage checksum mismatch"},STORAGE_DELETE_NOT_CONFIGURED:{status:400,title:"Storage delete not configured"},STORAGE_DOWNLOAD_NOT_CONFIGURED:{hint:["`GET /_lunora/admin/storage/object` needs a `storageDownload` function on the worker. The generated app worker wires it up; a hand-written `createWorker({ ... })` has to pass `(key, opts) => pick(opts?.bucket).download(key)` \u2014 forwarding `opts.bucket` to the right bucket, and wrapping rather than passing `createStorage(...).download` itself, whose second parameter is a byte range.","","Without it a bucket-backed `lunora backup restore --bucket` cannot read the snapshot. The object is still readable out of band with `wrangler r2 object get`."],status:400,title:"Storage download not configured"},STORAGE_NOT_CONFIGURED:{status:400,title:"Storage not configured"},STORAGE_OBJECT_NOT_FOUND:{status:404,title:"Storage object not found"},STORAGE_UPLOAD_NOT_CONFIGURED:{status:400,title:"Storage upload not configured"},STORAGE_URL_NOT_CONFIGURED:{status:400,title:"Storage signed URL not configured"},RAG_DIMENSION_MISMATCH:{hint:["A stored vector and the query embedding have different widths, so they cannot be compared.","","This is what changing a RAG index's `embeddingModel` (or a provider's `dimensions` option) without reindexing looks like. Either put the previous model back, or reindex the namespace under the new one \u2014 bump `embeddingModelVersion` so the index rebuilds instead of mixing widths."],status:409,title:"Embedding dimension mismatch"},VECTORS_NOT_CONFIGURED:{status:400,title:"Vector index introspector not configured"},VECTOR_QUERY_UNSUPPORTED:{status:400,title:"Vector index querying not enabled"},WORKFLOWS_NOT_CONFIGURED:{status:501,title:"Workflows not configured"},AUTH_AUDIT_NOT_CONFIGURED:{status:400,title:"Auth audit reader not configured"},AUTH_AUDIT_READ_FAILED:{internal:!0,status:500,title:"Auth audit read failed"},AUTH_MOVE_NOT_CONFIGURED:{hint:"The copy needs DO-backed auth (`.auth({ namespace })`) pinned with `.jurisdiction(\u2026, { pinAuth: true })`, and the auth object's `internalSecret` set.",status:400,title:"Auth jurisdiction move not configured"},AUTH_MOVE_TARGET_NOT_EMPTY:{hint:"The pinned auth object holds users the copy did not write (someone signed up there), so copying into it would merge two user bases. Pass `force: true` to copy anyway: a copied row that collides with one of the pinned object's rows is left out and counted under `conflicts`.",status:409,title:"Pinned auth object is not empty"},AUTH_MOVE_CONFLICT:{hint:"A copied row has the same key or unique value (such as an email) as a row the pinned auth object holds on its own, or the pinned object changed a row the source changed too. Nothing from that page was written. Pass `force: true` to keep the pinned object's rows and count the collisions under `conflicts`.",status:409,title:"Auth copy conflict"},AUTH_MOVE_SOURCE_CHANGED:{hint:"The un-pinned auth object changed after the copy read it (an update, a delete, or a new row), for example during a gradual rollout or a rollback. Run the copy again: it reconciles the changed tables. Then purge.",status:409,title:"Un-pinned auth object changed since the copy"},AUTH_MOVE_SOURCE_PURGED:{hint:"The un-pinned auth object was already purged. Its tables may exist again (a rollback served requests there), but they hold only rows written since, so the copy refuses rather than read them as deletions and remove the pinned object's users. Nothing is left to copy.",status:409,title:"Un-pinned auth object already purged"},AUTH_MOVE_INCOMPLETE:{hint:"Run `__lunora_admin__:copyAuthToJurisdiction` until it answers `done: true`, check the per-table counts, then purge.",status:409,title:"Auth copy not finished"},AUTH_MOVE_FAILED:{hint:"The message names the step, the table and the class of the SQLite error; the auth object's log has the full error. The copy resumes where it stopped once the cause is fixed.",status:500,title:"Auth jurisdiction move failed"},CRON_EXPR_INVALID:{status:500,title:"Invalid cron expression"},CRON_EXPR_NOT_STATIC:{status:500,title:"Cron expression is not statically analyzable"},CRON_JOB_FAILED:{internal:!0,status:500,title:"Cron job failed"},CRON_NAME_NOT_STATIC:{status:500,title:"Cron job name is not statically analyzable"},CRON_NON_STATIC_FN:{status:500,title:"Cron function reference is not statically analyzable"},CRON_NON_STATIC_VALUE:{status:500,title:"Cron value is not statically analyzable"},CRON_SCHEDULE_INVALID:{status:500,title:"Invalid cron schedule"},CRON_SCHEDULE_NOT_STATIC:{status:500,title:"Cron schedule is not statically analyzable"},DUPLICATE_CRON_NAME:{status:500,title:"Duplicate cron job name"},DUPLICATE_AGENT_BINDING:{status:500,title:"Duplicate agent binding"},DUPLICATE_AGENT_CLASS:{status:500,title:"Duplicate agent generated class name"},DUPLICATE_AGENT_NAME:{status:500,title:"Duplicate agent name"},DUPLICATE_MIGRATION_ID:{status:500,title:"Duplicate migration id"},DUPLICATE_QUEUE_BINDING:{status:500,title:"Duplicate queue binding"},DUPLICATE_QUEUE_NAME:{status:500,title:"Duplicate queue name"},DUPLICATE_WORKFLOW_CLASS:{status:500,title:"Duplicate workflow generated class name"},MIGRATION_ID_NOT_STATIC:{status:500,title:"Migration id is not statically analyzable"},NAMESPACE_COLLISION:{status:500,title:"Function namespace collision"},BAD_ROW:{status:400,title:"Malformed import row"},BAD_SUBSCRIPTION_ARGS:{status:400,title:"Invalid subscription arguments"},BATCH_LIMIT_EXCEEDED:{status:400,title:"Batch limit exceeded"},CROSS_SHARD_RANK_UNSUPPORTED:{status:400,title:"Cross-shard rank() is unsupported"},DISPATCH_UNAUTHENTICATED:{hint:"The scheduler could not authenticate to the worker. Check that `LUNORA_SCHEDULER_SECRET` matches on both sides, or that `LUNORA_ADMIN_TOKEN` is set and current.",status:403,title:"Dispatch caller not authenticated"},DISPATCH_IN_PROGRESS:{hint:"A dispatch with this idempotency id is still running on the shard. Retry it; once the first attempt settles the same id is served from the replay cache.",status:409,title:"Dispatch already in progress"},FORBIDDEN_FANOUT:{status:403,title:"Fan-out forbidden"},GLOBAL_SEARCH_SCORES_UNSUPPORTED:{status:400,title:"collectWithScores() is unsupported on a global table"},FORBIDDEN_ORIGIN:{status:403,title:"Origin forbidden"},FORBIDDEN_SHARD:{status:403,title:"Shard access forbidden"},GLOBAL_NOT_CONFIGURED:{status:400,title:"Global table import not configured"},INVALID_INPUT:{status:400,title:"Invalid input"},INVALID_SCHEDULE_ID:{status:400,title:"Invalid schedule id"},RATE_LIMITED:{status:429,title:"Rate limited"},REPLICA_NOT_READY:{status:421,title:"Replica not caught up"},REPLICA_READ_ONLY:{status:421,title:"Replica is read-only"},SEARCH_INDEX_BUILDING:{status:503,title:"Search index is still building"},SERVICE_UNAVAILABLE:{status:503,title:"Service unavailable"},SHAPE_MEMORY_TABLE:{status:400,title:"Shape over a memory table is unsupported"},SHAPE_CROSS_SHARD_JOIN:{status:400,title:"Shape cross-shard join is unsupported"},UNAUTHENTICATED:{status:401,title:"Unauthenticated"},WIRE_DECODE_FAILED:{status:502,title:"Could not decode a server frame"},WIRE_ENCODE_FAILED:{status:500,title:"Could not encode a return value"},UNKNOWN_COLUMN:{status:404,title:"Unknown column"},CDC_LOG_TRIMMED:{status:409,title:"CDC log trimmed"},CDC_TIMELINE_FORKED:{status:409,title:"CDC timeline forked"},CDC_PAYLOAD_COMPACTED:{status:409,title:"CDC payloads compacted"},EXPIRED:{status:404,title:"Session expired"},NESTED_TRANSACTION:{internal:!0,status:500,title:"Nested transaction"},OUT_OF_ORDER:{status:409,title:"Out-of-order mutation"},SHAPE_GLOBAL_TOO_LARGE:{status:413,title:"Global shape too large"},SHAPE_NOT_FOUND:{status:404,title:"Shape not found"},SHAPE_REQUIRES_CDC:{status:409,title:"Shape requires change-data-capture"},SQL_UNAVAILABLE:{internal:!0,status:500,title:"SQL storage unavailable"},STREAM_ID_IN_USE:{status:409,title:"Stream id already in use"},STREAM_INTERRUPTED:{status:503,title:"Durable stream interrupted"},STREAM_TOO_LONG:{status:507,title:"Durable stream exceeded its chunk ceiling"},TOKEN_EXPIRED:{hint:["The caller's credential verified but its expiry has passed. The worker refuses an HTTP call with this code before it runs; a shard drops a socket with close code `4001` and the same code.","","It is a refusal of the credential, not of the call: `@lunora/client` holds a queued write, fires `onTokenExpired`, and re-sends it after `setAuthToken`. The held write survives the refresh only if you pass the same `subject` (the user id) with the new token, `setAuthToken(freshToken, user.id)`; without one a refresh reads as a user switch and the write is rejected `OFFLINE_IDENTITY_CHANGED`. Under a cookie session there is no token to replace: renew the cookie and the write is re-sent on a backoff. The worker can only tell expired from anonymous if your `resolveIdentity` returns the identity with its past `exp` (or `expiresAtMs`), or throws a `LunoraError` with this code. Returning `null` runs the call anonymous."],status:401,title:"Authentication token expired"},TOO_MANY_STREAMS:{status:429,title:"Too many streams"},TOO_MANY_WHISPER_TOPICS:{hint:"Reuse a stable set of whisper topic names, or reconnect \u2014 the per-socket verdict memo is in-memory, so a new connection starts empty. Leaving a topic does not free its entry.",status:429,title:"Too many whisper topics"},UNKNOWN_ADMIN_OP:{status:404,title:"Unknown admin operation"},SOCKET_TAG_BUDGET_EXCEEDED:{status:400,title:"Socket tag budget exceeded"},RELAY_CANNOT_SEED:{status:500,title:"Relay cannot seed"},RELAY_MISCONFIGURED:{status:500,title:"Relay misconfigured"},RELAY_SEED_FAILED:{status:502,title:"Relay seed failed"},RELAY_SHAPE_UNROUTABLE:{status:500,title:"Relay shape unroutable"},MISCONFIGURED:{internal:!0,status:500,title:"Worker misconfigured"},LUNORA_RUNTIME_UNAVAILABLE:{status:500,title:"Lunora runtime unavailable"},INTERNAL_ERROR:{internal:!0,status:500,title:"Internal error"},BROWSER_TIMEOUT:{status:504,title:"Browser operation timed out"},CLIENT_CLOSED:{status:400,title:"Client is closed"},HTTP_STREAM_BAD_CHUNK:{status:502,title:"Malformed HTTP stream chunk"},HTTP_STREAM_INTERRUPTED:{status:502,title:"HTTP stream interrupted"},HTTP_STREAM_MISSING_PARAM:{status:400,title:"HTTP stream missing path parameter"},HTTP_STREAM_NO_BODY:{status:502,title:"HTTP stream response has no body"},HTTP_STREAM_STATUS:{status:502,title:"HTTP stream request failed"},HTTP_STREAM_TRANSPORT:{status:502,title:"HTTP stream transport error"},STREAM_BACKPRESSURE:{status:429,title:"Stream backpressure"},STREAM_DISCONNECTED:{status:503,title:"Stream disconnected"},STREAM_QUEUE_OVERFLOW:{status:429,title:"Stream queue overflow"},UNKNOWN_MUTATION_FN:{status:404,title:"Unknown mutation function"},LOCAL_DEPENDENCY_MISSING:{hint:["The command Lunora tried to run is not on your PATH, so nothing ran.","","Install it (or put it on PATH) and retry \u2014 `wrangler` ships as a dependency of a Lunora app, so `pnpm install` usually fixes that one; `git` and `docker` are installed separately."],status:500,title:"Required local tool not found"}},c=a(e=>Object.hasOwn(l,e)?l[e]:void 0,"h");var m=[{body:["A single row exceeded the storage engine's per-row ceiling \u2014 2 MB on a Durable Object's SQLite, and 2,000,000 bytes on D1.","","The limit is on the STORED bytes, which are UTF-8: a document of multi-byte text (CJK, emoji) costs up to 3x its character count. `v.bytes()` and `v.bigint()` columns cost more again on a shard-local table, where the row stores both a SQL-comparable projection and the original.","","Keep the large payload out of the row and store a reference to it:","","```ts","const key = `uploads/${crypto.randomUUID()}`;","await ctx.storage.uploads.put(key, bytes);",'await ctx.db.insert("documents", { storageKey: key, title });',"```","","R2 has no practical object-size ceiling, and the row stays small enough to read, index, and replicate."].join(`
|
|
2
|
+
`),header:"Row too large for the storage engine",id:"lunora-row-too-big",test:a(e=>_.test(e),"test")},{body:["Lunora codegen couldn't find a schema to generate from.","","Create `lunora/schema.ts` exporting a `defineSchema(...)` call:","","```ts",'import { defineSchema, defineTable, v } from "@lunora/server";',"","export default defineSchema({"," messages: defineTable({ body: v.string() }),","});","```","","Or run `lunora init` to scaffold Lunora (a sample `lunora/schema.ts` included) into your app."].join(`
|
|
3
|
+
`),header:"No Lunora schema found",id:"lunora-schema-missing",test:a(e=>e.includes("defineSchema() not found")||e.includes("schema.ts not found at"),"test")},{body:["`defineSchema(...)` must be called with an **inline object literal** mapping table names to `defineTable(...)`:","","```ts","export default defineSchema({"," todos: defineTable({ title: v.string(), done: v.boolean() }),","});","```","","Codegen reads the schema statically, so it can't follow a variable or a spread \u2014 pass the object literal directly."].join(`
|
|
4
|
+
`),header:"`defineSchema()` needs an inline object literal",id:"lunora-schema-not-object-literal",test:a(e=>e.includes("defineSchema() expects an object literal"),"test")},{body:["This table name collides with a built-in `ctx.db` member, so the generated client can't expose it.","","Rename the table to anything that isn't a `ctx.db` member (the error names the one it hit) \u2014 e.g. `userAccounts` instead of `insert`, or `pageViews` instead of `count`."].join(`
|
|
5
|
+
`),header:"Table name is reserved",id:"lunora-table-reserved",test:a(e=>e.includes("is reserved")&&e.includes("ctx.db"),"test")},{body:["Two tables resolve to the same name \u2014 usually a base table and a schema **extension** both defining it.","","Rename one of them, or drop the duplicate from the extension. Each table name must be unique across `defineSchema(...)` and every `.extend(...)`."].join(`
|
|
6
|
+
`),header:"Duplicate table name",id:"lunora-table-duplicate",test:a(e=>e.includes("already exists")&&e.includes(".extend("),"test")},{body:['`.jurisdiction(...)` accepts only a **string literal** of `"eu"`, `"us"`, or `"fedramp"`:',"","```ts",'defineSchema({ /* \u2026 */ }).jurisdiction("eu");',"```"].join(`
|
|
7
|
+
`),header:"Invalid `.jurisdiction(...)` value",id:"lunora-jurisdiction",test:a(e=>e.includes("unknown jurisdiction")||e.includes("jurisdiction")&&e.includes('"eu", "us", or "fedramp"'),"test")},{body:["The `unique` flag on an index must be a **literal** `true` or `false`, not a computed value \u2014 codegen needs to read it statically:","","```ts",'defineTable({ email: v.string() }).index("by_email", ["email"], { unique: true });',"```"].join(`
|
|
8
|
+
`),header:"`unique` must be a literal",id:"lunora-unique-literal",test:a(e=>e.includes("must be a literal")&&e.includes("unique"),"test")},{body:["A declared container/workflow class isn't re-exported by your worker entry, so `wrangler deploy` would reject it.","","Add the generated re-export shown in the error to your worker entry (e.g. `src/index.ts`):","","```ts",'export * from "./lunora/_generated/containers";',"```"].join(`
|
|
9
|
+
`),header:"Binding not exported by your worker entry",id:"lunora-worker-entry-export-gap",test:a(e=>e.includes("not exported by your worker entry"),"test")},{body:["A row with the same value already exists in a `unique` index.","","- If you meant to upsert, use `ctx.db.<table>().upsert(...)` (or `.patch(...)` an existing row) instead of `.insert(...)`.",`- Otherwise pick a value that isn't already taken, and consider surfacing a friendly "already exists" message to the user.`].join(`
|
|
10
|
+
`),header:"Unique constraint violation",id:"lunora-runtime-unique",test:a(e=>e.includes("unique constraint violation on"),"test")},{body:l.CONFLICT.hint.join(`
|
|
11
|
+
`),header:"Optimistic concurrency conflict",id:"lunora-runtime-occ",test:a(e=>e.includes("optimistic concurrency conflict"),"test")}],d=[{causes:"the origin returned an empty, unknown, or malformed response Cloudflare couldn't interpret (often an origin crash or an oversized response header)",code:"520",docsUrl:n,family:"5xx",fix:"check your origin's logs for a crash, ensure it returns a valid HTTP response, and keep response headers under the size limit",summary:"Cloudflare got an unknown/empty response from your origin web server.",title:"Web server returns an unknown error"},{causes:"the origin refused the connection \u2014 the web server is down, or a firewall is blocking Cloudflare's IP ranges",code:"521",docsUrl:n,family:"5xx",fix:"confirm the origin process is running and allowlist Cloudflare's published IP ranges in your firewall/security groups",summary:"Cloudflare could not connect to your origin because it refused the connection.",title:"Web server is down"},{causes:"Cloudflare could not establish a TCP connection to the origin in time \u2014 the origin is overloaded, a firewall is dropping packets, or the origin IP is wrong",code:"522",docsUrl:n,family:"5xx",fix:"verify the origin is reachable and not overloaded, and that the DNS record points at the correct origin IP",summary:"The connection to your origin timed out before it was established.",title:"Connection timed out"},{causes:"Cloudflare cannot route to the origin at all \u2014 a bad DNS record, an origin IP that changed, or invalid routing",code:"523",docsUrl:n,family:"5xx",fix:"verify the DNS A/AAAA record points at a reachable origin IP and that no upstream network is blocking Cloudflare",summary:"Cloudflare could not reach your origin server.",title:"Origin is unreachable"},{causes:"Cloudflare made a TCP connection but the origin did not return an HTTP response within 100 seconds \u2014 a slow handler or long-running request",code:"524",docsUrl:n,family:"5xx",fix:"speed up the slow origin handler, or move long work off the request path into a background job (a Durable Object, Queue, or Workflow)",summary:"Cloudflare connected to your origin but it did not respond in time.",title:"A timeout occurred"},{causes:"the TLS handshake between Cloudflare and the origin failed \u2014 a missing/invalid origin certificate, or a cipher/SNI mismatch under Full (Strict) SSL",code:"525",docsUrl:n,family:"5xx",fix:"install a valid certificate on the origin and align your Cloudflare SSL/TLS mode with the origin's certificate setup",summary:"The SSL handshake with your origin failed.",title:"SSL handshake failed"},{causes:"Cloudflare could not validate the origin's certificate under Full (Strict) SSL \u2014 it is expired, self-signed, or issued for the wrong hostname",code:"526",docsUrl:n,family:"5xx",fix:"install a valid, publicly-trusted certificate on the origin (or use a Cloudflare Origin CA cert), matching the request hostname",summary:"Cloudflare could not validate your origin's SSL certificate.",title:"Invalid SSL certificate"},{causes:"a DNS record points at a Cloudflare IP or another prohibited address instead of your real origin",code:"1000",docsUrl:r,family:"1xxx",fix:"point the DNS record at your real origin IP, not a Cloudflare-owned or loopback address",summary:"DNS points to a prohibited IP.",title:"DNS points to prohibited IP"},{causes:"Cloudflare could not resolve the requested hostname \u2014 a Worker fetched an unresolvable host, or a DNS record is misconfigured",code:"1001",docsUrl:r,family:"1xxx",fix:"check the hostname you're requesting and the DNS records for the zone resolve to a valid origin",summary:"Cloudflare could not resolve the origin DNS.",title:"DNS resolution error"},{causes:"a Worker or DNS record targets a restricted IP (for example a Cloudflare-owned or loopback address)",code:"1002",docsUrl:r,family:"1xxx",fix:"change the Worker fetch target or DNS record to a valid, non-restricted origin address",summary:"DNS points to a prohibited IP (Worker/restricted).",title:"DNS points to a prohibited IP"},{causes:"the visitor's IP was blocked by an IP Access Rule, WAF rule, or security configuration on the zone",code:"1006",docsUrl:r,family:"1xxx",fix:"review the zone's Firewall/WAF and IP Access Rules to see why the address was banned, and adjust if it was blocked in error",summary:"Access denied: the visitor's IP has been banned.",title:"Access denied: your IP has been banned"},{causes:"your Worker threw an unhandled JavaScript exception during the request",code:"1101",docsUrl:r,family:"1xxx",fix:"reproduce with `wrangler tail` (or the Workers Logs / Studio Logs panel) to get the stack trace, then handle the throwing code path",summary:"A Worker threw a JavaScript exception.",title:"Worker threw a JavaScript exception"},{causes:"the Worker used more CPU time than a single invocation is allowed \u2014 usually a hot loop or heavy synchronous work",code:"1102",docsUrl:r,family:"1xxx",fix:"reduce per-request CPU (optimize hot loops, avoid heavy synchronous work) or offload the heavy work to a Durable Object, Queue, or Workflow",summary:"A Worker exceeded its CPU-time resource limit.",title:"Worker exceeded resource limits"}],u=a(e=>e!==void 0&&e>="0"&&e<="9","l"),g=a((e,t)=>{for(let o=e.indexOf(t);o!==-1;o=e.indexOf(t,o+t.length))if(!u(e[o-1])&&!u(e[o+t.length]))return!0;return!1},"f"),T=a((e,t)=>{for(let o of[`error ${t}`,`error: ${t}`])for(let i=e.indexOf(o);i!==-1;i=e.indexOf(o,i+o.length))if(!u(e[i+o.length]))return!0;return!1},"_"),A=/error|cloudflare/iu,p=a(e=>({body:[e.summary,"",`**Likely cause:** ${e.causes}.`,"",`**Fix:** ${e.fix}.`,"",`See [Cloudflare's ${e.family} error docs](${e.docsUrl}).`].join(`
|
|
12
|
+
`),header:`Cloudflare Error ${e.code}: ${e.title}`,id:`cloudflare-error-${e.code}`}),"c"),f=a(e=>{if(!A.test(e))return;let t=e.toLowerCase(),o=t.includes("error"),i=t.includes("cloudflare");if(o){for(let s of d)if(T(t,s.code))return p(s)}if(i){for(let s of d)if(g(t,s.code))return p(s)}},"T"),O=a(e=>(typeof e=="string"?e:e.join(`
|
|
13
|
+
`)).split(`
|
|
14
|
+
`).filter(t=>!t.startsWith("```")).join(`
|
|
15
|
+
`).replaceAll(/\*\*(.+?)\*\*/gu,"$1").replaceAll(/`([^`]+)`/gu,"$1"),"A"),E=a(e=>{for(let t of m)if(t.test(e))return{body:t.body,header:t.header,id:t.id}},"d"),b=a(e=>E(e)??f(e),"b");var h=class extends Error{static{a(this,"l")}type="VisulimaError";hint;title;loc;code;status;docsUrl;data;constructor(t,o,i={}){let s=c(t);super(o??t,i.cause===void 0?void 0:{cause:i.cause}),this.name=i.name??"LunoraError",this.hint=i.hint??s?.hint,this.title=i.title??s?.title,this.loc=i.location,this.code=t,this.status=i.status??s?.status??500,this.docsUrl=i.docsUrl??s?.docsUrl,this.data=i.data}};export{l as a,O as b,b as c,h as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as N}from"./chunk-JOVONUS6.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-PTZD7RUZ.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{b as y}from"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import{a as R}from"./chunk-JOVONUS6.js";import"./chunk-ULIQFBZU.js";import"./chunk-YEKI5KIW.js";import"./chunk-35DM4JJG.js";import{a as v}from"./chunk-4ZEL6BYL.js";import{c as $}from"./chunk-RPJEAHAZ.js";import"./chunk-TI33XMKX.js";import"./chunk-FSRSK4LY.js";import"./chunk-NPF3GY2E.js";import{a as S}from"./chunk-FKVZRPV5.js";import{a as A,b as C,c as I,d as x,e as c,f as n}from"./chunk-HEAQVSNS.js";import{a as k,e as w}from"./chunk-WUWBZPUK.js";import{d as N}from"./chunk-PTZD7RUZ.js";import{a as f,d as b,f as E,g as O}from"./chunk-YKXDMIHQ.js";var j=b(E(),1);var r=b(O(),1);var _=f((e,t)=>({delete:e("Delete"),list:e("List"),read:e("Read"),write:e("Write")})[t],"I"),T={delete:2,list:3,read:0,write:1},B=f(e=>[...e].toSorted((t,a)=>t.bucket.localeCompare(a.bucket)||T[t.on]-T[a.on]||(t.prefix??"").localeCompare(a.prefix??"")),"O"),q=f(()=>{let e=(0,j.c)(14),t=N(),a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={},e[0]=a):a=e[0];let{data:l,error:i,errorSource:d}=$(v.storageRules,a),h=l!==void 0,m;if(e[1]!==l||e[2]!==i||e[3]!==d||e[4]!==h||e[5]!==t){let g=B(Array.isArray(l?.rules)?l.rules:[]),u;e[7]!==i||e[8]!==d?(u=i!==null&&(0,r.jsx)(R,{error:d,testId:"storage-rules-error"}),e[7]=i,e[8]=d,e[9]=u):u=e[9];let o;e[10]!==t?(o=t("Storage rules are declared in code with defineStorageRule and gate ctx.storage access per bucket. This view is read-only."),e[10]=t,e[11]=o):o=e[11];let p;e[12]!==o?(p=(0,r.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"storage-rules-note",children:o}),e[12]=o,e[13]=p):p=e[13],m=(0,r.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-storage-rules-panel",children:[u,p,h&&g.length===0?(0,r.jsx)(S,{description:t("No defineStorageRule is wired through .use(storageRules(...)) in this deployment. Add one to gate object access by key prefix."),testId:"storage-rules-empty",title:t("No storage rules defined")}):(0,r.jsx)(k,{className:"overflow-hidden py-0",children:(0,r.jsx)(w,{className:"px-0",children:(0,r.jsxs)(A,{"data-testid":"storage-rules-table",children:[(0,r.jsx)(C,{children:(0,r.jsxs)(x,{children:[(0,r.jsx)(c,{children:t("Bucket")}),(0,r.jsx)(c,{children:t("Operation")}),(0,r.jsx)(c,{children:t("Key prefix")}),(0,r.jsx)(c,{children:t("Guarded by")})]})}),(0,r.jsx)(I,{children:g.map(s=>(0,r.jsxs)(x,{"data-testid":`storage-rule-${s.bucket}-${s.on}-${s.prefix??""}`,children:[(0,r.jsx)(n,{className:"font-mono text-xs",children:s.bucket}),(0,r.jsx)(n,{children:(0,r.jsx)(y,{variant:"secondary",children:_(t,s.on)})}),(0,r.jsx)(n,{className:"font-mono text-xs",children:s.prefix??(0,r.jsx)("span",{className:"text-muted-foreground",children:t("(whole bucket)")})}),(0,r.jsx)(n,{className:"font-mono text-xs text-muted-foreground",children:s.procedure})]},`${s.bucket}:${s.on}:${s.prefix??""}:${s.procedure}`))})]})})})]}),e[1]=l,e[2]=i,e[3]=d,e[4]=h,e[5]=t,e[6]=m}else m=e[6];return m},"M");export{q as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as o,c as i}from"./chunk-OKG3HWSJ.js";import{a as t}from"./chunk-YKXDMIHQ.js";var a="lunora-studio-recent-shards",c=10,n=t(()=>o(a,"session").filter(s=>typeof s=="string"),"o"),u=t(s=>{let r=s.trim();if(r==="")return n();let e=[r,...n().filter(l=>l!==r)].slice(0,c);return i(a,e,"session"),e},"l");export{n as a,u as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as c,d as p,e as b,f as v}from"./chunk-YKXDMIHQ.js";var h=p(v(),1),g=p(b(),1);var y=c((a="local")=>{try{return a==="local"?globalThis.localStorage:globalThis.sessionStorage}catch{return}},"d"),S=c(function(a,s="local"){try{let r=y(s)?.getItem(a)??void 0,t=r===void 0?[]:JSON.parse(r);return Array.isArray(t)?t:[]}catch{return[]}},"g"),I=c((a,s,r="local")=>{let t=y(r);if(t!==void 0)try{t.setItem(a,JSON.stringify(s))}catch{}},"I"),A=c((a,s="local")=>{try{y(s)?.removeItem(a)}catch{}},"A"),T=c(function(a,s){let r=(0,h.c)(10),t=s===void 0?"local":s,u;r[0]!==a||r[1]!==t?(u=c(()=>S(a,t),"i"),r[0]=a,r[1]=t,r[2]=u):u=r[2];let[n,f]=(0,g.useState)(u),i=(0,g.useRef)(`${t}:${a}`),e,l;r[3]!==a||r[4]!==t||r[5]!==n?(e=c(()=>{let m=`${t}:${a}`;if(i.current!==m){i.current=m,f(S(a,t));return}I(a,n,t)},"c"),l=[a,t,n],r[3]=a,r[4]=t,r[5]=n,r[6]=e,r[7]=l):(e=r[6],l=r[7]),(0,g.useEffect)(e,l);let o;return r[8]!==n?(o=[n,f],r[8]=n,r[9]=o):o=r[9],o},"J"),J=c(function(a,s,r){let t=(0,h.c)(6),u="local",[n,f]=T(a,u),i;t[0]!==s||t[1]!==f?(i=c(m=>{f($=>{let d=$[0]??s;return[typeof m=="function"?m(d):m]})},"a"),t[0]=s,t[1]=f,t[2]=i):i=t[2];let e=i,l=n[0]??s,o;return t[3]!==e||t[4]!==l?(o=[l,e],t[3]=e,t[4]=l,t[5]=o):o=t[5],o},"O"),O=c(a=>globalThis.crypto?.randomUUID?.()??`${a}-${globalThis.performance.now().toString(36)}`,"V");export{y as a,S as b,I as c,A as d,T as e,J as f,O as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as g}from"./chunk-4ZEL6BYL.js";import{c as k}from"./chunk-RPJEAHAZ.js";import{f as S}from"./chunk-TI33XMKX.js";import{d as _,f as y,g as v,o as C}from"./chunk-PTZD7RUZ.js";import{a as i,d as N,e as L,f as T,g as F}from"./chunk-YKXDMIHQ.js";var w=N(L(),1);var j={},A=y(g.aiGenerateSql),I=y(g.aiTableFilter),O=y(g.aiChartConfig),Q=i(s=>{let e=S(),[l,d]=(0,w.useState)({}),[n,t]=(0,w.useState)({}),a=k(g.aiAvailable,j,{shardKey:s}),[u,c]=(0,w.useState)(!1),x=u||a.data?.available===!1,p=i(o=>{d(r=>({...r,[o]:!0})),t(r=>({...r,[o]:void 0}))},"i"),h=i((o,r)=>{d(b=>({...b,[o]:!1})),r!==void 0&&t(b=>({...b,[o]:r})),r==="no-ai-binding"&&c(!0)},"a"),f=i(async o=>{p("sql");try{let{result:r}=await e.query(A,o,v(s));return h("sql",r.degraded?r.reason:void 0),r.degraded?void 0:r.sql}catch{h("sql","ai-error");return}},"f");return{generate:i(async(o,r)=>f({failedError:r?.error,failedSql:r?.sql,prompt:o}),"generate"),inferChart:i(async o=>{p("chart");try{let{result:r}=await e.query(O,o,v(s));return h("chart",r.degraded?r.reason:void 0),r.degraded?void 0:r.chart}catch{h("chart","ai-error");return}},"inferChart"),pending:i(o=>l[o]===!0,"pending"),reason:i(o=>n[o],"reason"),rewrite:i(async(o,r)=>f({editSql:r,prompt:o}),"rewrite"),suggestFilter:i(async(o,r)=>{p("filter");try{let{result:b}=await e.query(I,{prompt:o,table:r},v(s));return h("filter",b.degraded?b.reason:void 0),b.degraded?void 0:b.clauses}catch{h("filter","ai-error");return}},"suggestFilter"),unavailable:x}},"Q");var q=N(T(),1);var m=N(F(),1);var G=i((s,e)=>{if(e==="")return[{match:!1,offset:0,text:s}];let l=[],d=s.toLowerCase(),n=e.toLowerCase(),t=0;for(let a=d.indexOf(n);a!==-1;a=d.indexOf(n,t))a>t&&l.push({match:!1,offset:t,text:s.slice(t,a)}),l.push({match:!0,offset:a,text:s.slice(a,a+e.length)}),t=a+e.length;return t<s.length&&l.push({match:!1,offset:t,text:s.slice(t)}),l},"N"),U=i(s=>{let e=(0,q.c)(9),{highlight:l,value:d}=s;if(d==null){let c;return e[0]===Symbol.for("react.memo_cache_sentinel")?(c=(0,m.jsx)("span",{className:"text-muted-foreground/50 italic",children:"NULL"}),e[0]=c):c=e[0],c}let n,t,a;if(e[1]!==l||e[2]!==d){a=Symbol.for("react.early_return_sentinel");e:{let c=C(d);if(l===void 0||l===""){a=(0,m.jsx)("span",{title:c,children:c});break e}n=c,t=G(c,l).map(z)}e[1]=l,e[2]=d,e[3]=n,e[4]=t,e[5]=a}else n=e[3],t=e[4],a=e[5];if(a!==Symbol.for("react.early_return_sentinel"))return a;let u;return e[6]!==n||e[7]!==t?(u=(0,m.jsx)("span",{title:n,children:t}),e[6]=n,e[7]=t,e[8]=u):u=e[8],u},"v"),P=i(s=>{let e=(0,q.c)(22),{columns:l,rows:d}=s,n=_(),t;e[0]!==n?(t=n("Field"),e[0]=n,e[1]=t):t=e[1];let a;e[2]!==t?(a=(0,m.jsx)("th",{className:"border-b border-e border-border px-3 py-1.5 text-start font-mono text-[11px] tracking-wide uppercase text-muted-foreground",children:t}),e[2]=t,e[3]=a):a=e[3];let u;if(e[4]!==d||e[5]!==n){let f;e[7]!==n?(f=i((o,r)=>(0,m.jsx)("th",{className:"border-b border-border px-3 py-1.5 text-start font-mono text-[11px] tracking-wide uppercase tabular-nums text-muted-foreground",children:n("Row {n}",{n:r+1})},r),"c"),e[7]=n,e[8]=f):f=e[8],u=d.map(f),e[4]=d,e[5]=n,e[6]=u}else u=e[6];let c;e[9]!==a||e[10]!==u?(c=(0,m.jsx)("thead",{className:"sticky top-0 z-10 bg-muted",children:(0,m.jsxs)("tr",{children:[a,u]})}),e[9]=a,e[10]=u,e[11]=c):c=e[11];let x;if(e[12]!==l||e[13]!==d){let f;e[15]!==d?(f=i(o=>(0,m.jsxs)("tr",{className:"hover:bg-muted/40",children:[(0,m.jsx)("th",{className:"border-b border-e border-border px-3 py-1.5 text-start font-mono font-medium whitespace-nowrap",scope:"row",children:o}),d.map((r,b)=>(0,m.jsx)("td",{className:"max-w-md truncate border-b border-border px-3 py-1.5 font-mono",children:(0,m.jsx)(U,{value:r[o]})},b))]},o),"c"),e[15]=d,e[16]=f):f=e[16],x=l.map(f),e[12]=l,e[13]=d,e[14]=x}else x=e[14];let p;e[17]!==x?(p=(0,m.jsx)("tbody",{children:x}),e[17]=x,e[18]=p):p=e[18];let h;return e[19]!==c||e[20]!==p?(h=(0,m.jsx)("div",{className:"min-h-0 flex-1 overflow-auto","data-testid":"db-transposed",children:(0,m.jsxs)("table",{className:"border-collapse text-xs",children:[c,p]})}),e[19]=c,e[20]=p,e[21]=h):h=e[21],h},"T"),V=i(({children:s,layout:e="card",testId:l})=>(0,m.jsx)("div",{className:e==="fill"?"flex min-h-0 flex-1 flex-col overflow-hidden border-t border-border":"overflow-x-auto border border-border bg-card","data-testid":l,children:s}),"j");function z(s){return(0,m.jsx)("mark",{className:s.match?"rounded-sm bg-warning/40 text-foreground":"bg-transparent text-inherit",children:s.text},s.offset)}i(z,"_");export{Q as a,U as b,P as c,V as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as ee}from"./chunk-5WJXVZMZ.js";import{b as Z}from"./chunk-FEWMAPNI.js";import"./chunk-225VJ77I.js";import{d as se,f as X}from"./chunk-TI33XMKX.js";import"./chunk-FSRSK4LY.js";import"./chunk-NPF3GY2E.js";import{a as re}from"./chunk-FKVZRPV5.js";import{a as O}from"./chunk-WUWBZPUK.js";import{d as le,t as ne}from"./chunk-PTZD7RUZ.js";import{a as k,d as ae,f as ce,g as me,i as Y}from"./chunk-YKXDMIHQ.js";var te=ae(ce(),1);var a=ae(me(),1);var pe="/_lunora/health",he="/_lunora/health/ready",ue=k((r,e)=>(r.endsWith("/")?r.slice(0,-1):r)+e,"me"),fe=k(()=>{let r=X();return async e=>{let w=e==="ready"?he:pe,t=r.getAuthToken(),y=ue(r.url,w);try{let i=await fetch(y,{headers:t===null?{}:{authorization:`Bearer ${t}`}}),p=null;try{p=await i.json()}catch{p=null}return{body:p,ok:i.ok,status:i.status}}catch(i){return{body:null,error:i instanceof Error?i.message:String(i),ok:!1,status:0}}}},"pe"),ge={crit:"bg-destructive",ok:"bg-success",warn:"bg-warning"},ye=k(r=>r==="unhealthy"?"crit":r==="degraded"?"warn":"ok","fe"),ie=k(r=>{let e=(0,te.c)(13),{label:w,level:t,testId:y,value:i}=r,p=ge[t],d;e[0]!==p?(d=Y("size-1.5 shrink-0 rounded-full",p),e[0]=p,e[1]=d):d=e[1];let o;e[2]!==d?(o=(0,a.jsx)("span",{"aria-hidden":"true",className:d}),e[2]=d,e[3]=o):o=e[3];let c;e[4]!==w||e[5]!==o?(c=(0,a.jsxs)("span",{className:"flex items-center gap-1.5 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:[o,w]}),e[4]=w,e[5]=o,e[6]=c):c=e[6];let h;e[7]!==y||e[8]!==i?(h=(0,a.jsx)("span",{className:"text-lg font-semibold text-foreground","data-testid":y,children:i}),e[7]=y,e[8]=i,e[9]=h):h=e[9];let C;return e[10]!==c||e[11]!==h?(C=(0,a.jsx)(O,{className:"gap-0 py-0",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2.5 p-4",children:[c,h]})}),e[10]=c,e[11]=h,e[12]=C):C=e[12],C},"Z"),Pe=k(r=>{let e=(0,te.c)(107),{probe:w}=r,t=le(),y=X(),i=fe(),p=w??i,d;e[0]!==p?(d=k(async()=>{let[s,n]=await Promise.all([p("live"),p("ready")]);return{live:s,ready:n}},"o"),e[0]=p,e[1]=d):d=e[1];let o;e[2]!==y?(o=y.clientIdentifier(),e[2]=y,e[3]=o):o=e[3];let c;e[4]!==o?(c=["deployment-health",o],e[4]=o,e[5]=c):c=e[5];let h;e[6]!==d||e[7]!==c?(h={queryFn:d,queryKey:c},e[6]=d,e[7]=c,e[8]=h):h=e[8];let{data:C,isPending:de}=se(h),Q=C?.live??null,oe=C?.ready??null;if(de){let s;return e[9]===Symbol.for("react.memo_cache_sentinel")?(s=(0,a.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"deployment-health-loading",children:[(0,a.jsx)(ee,{className:"h-16 w-full"}),(0,a.jsx)(ee,{className:"h-40 w-full"})]}),e[9]=s):s=e[9],s}let l=Q?.body??null;if(l===null){let s=Q?.status===403,n;e[10]!==s||e[11]!==Q?.error||e[12]!==t?(n=s?t("The health endpoint is in the admin posture. Paste a valid admin token in the connect popover, or set its auth to public."):t("Couldn't reach the health endpoint: {message}",{message:Q?.error??t("no response")}),e[10]=s,e[11]=Q?.error,e[12]=t,e[13]=n):n=e[13];let m;e[14]!==t?(m=t("Health endpoint unavailable"),e[14]=t,e[15]=m):m=e[15];let f;return e[16]!==n||e[17]!==m?(f=(0,a.jsx)(re,{description:n,testId:"deployment-health-error",title:m}),e[16]=n,e[17]=m,e[18]=f):f=e[18],f}let J;e[19]!==l.status?(J=ye(l.status),e[19]=l.status,e[20]=J):J=e[20];let W=J,u;if(l.status==="unhealthy"){let s;e[21]!==t?(s=t("Unhealthy"),e[21]=t,e[22]=s):s=e[22],u=s}else if(l.status==="degraded"){let s;e[23]!==t?(s=t("Degraded"),e[23]=t,e[24]=s):s=e[24],u=s}else{let s;e[25]!==t?(s=t("Healthy"),e[25]=t,e[26]=s):s=e[26],u=s}let j=oe?.ok??!1,G=j?"ok":"crit",H,I,P,x,N,v,S,V,b,_;if(e[27]!==l.appName||e[28]!==l.appVersion||e[29]!==l.checks||e[30]!==l.timestamp||e[31]!==W||e[32]!==G||e[33]!==j||e[34]!==u||e[35]!==t){let s=[...l.checks].toSorted(xe);I="flex flex-col gap-6",P="deployment-health";let n;e[46]!==t?(n=t("Live liveness, readiness, and per-binding health from the deployment's /_lunora/health endpoint \u2014 wire an uptime monitor or a Cloudflare Health Check at it."),e[46]=t,e[47]=n):n=e[47],e[48]!==n?(x=(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:n}),e[48]=n,e[49]=x):x=e[49];let m;e[50]!==u?(m=(0,a.jsx)("span",{className:"text-sm font-semibold text-foreground","data-testid":"dh-status",children:u}),e[50]=u,e[51]=m):m=e[51];let f;e[52]!==l.appName||e[53]!==l.appVersion?(f=(0,a.jsxs)("span",{className:"font-mono text-[13px] text-muted-foreground","data-testid":"dh-app",children:[l.appName," \xB7 ",l.appVersion]}),e[52]=l.appName,e[53]=l.appVersion,e[54]=f):f=e[54];let D;e[55]!==m||e[56]!==f?(D=(0,a.jsx)("div",{className:"flex items-center gap-3",children:(0,a.jsxs)("div",{className:"grid leading-tight",children:[m,f]})}),e[55]=m,e[56]=f,e[57]=D):D=e[57];let L;e[58]!==t?(L=t("Checked"),e[58]=t,e[59]=L):L=e[59];let T;e[60]!==L?(T=(0,a.jsx)("div",{className:"font-mono text-[10px] tracking-wide text-muted-foreground uppercase",children:L}),e[60]=L,e[61]=T):T=e[61];let $;e[62]!==l.timestamp?($=ne(l.timestamp),e[62]=l.timestamp,e[63]=$):$=e[63];let q;e[64]!==$?(q=(0,a.jsx)("time",{className:"text-[13px] text-muted-foreground","data-testid":"dh-timestamp",children:$}),e[64]=$,e[65]=q):q=e[65];let B;e[66]!==T||e[67]!==q?(B=(0,a.jsxs)("div",{className:"text-end",children:[T,q]}),e[66]=T,e[67]=q,e[68]=B):B=e[68],e[69]!==D||e[70]!==B?(N=(0,a.jsx)(O,{className:"gap-0 py-0",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-4 p-4",children:[D,B]})}),e[69]=D,e[70]=B,e[71]=N):N=e[71];let E;e[72]!==t?(E=t("Liveness"),e[72]=t,e[73]=E):E=e[73];let R;e[74]!==W||e[75]!==u||e[76]!==E?(R=(0,a.jsx)(ie,{label:E,level:W,testId:"dh-liveness",value:u}),e[74]=W,e[75]=u,e[76]=E,e[77]=R):R=e[77];let U;e[78]!==t?(U=t("Readiness"),e[78]=t,e[79]=U):U=e[79];let A;e[80]!==j||e[81]!==t?(A=t(j?"Ready":"Not ready"),e[80]=j,e[81]=t,e[82]=A):A=e[82];let F;e[83]!==G||e[84]!==U||e[85]!==A?(F=(0,a.jsx)(ie,{label:U,level:G,testId:"dh-readiness",value:A}),e[83]=G,e[84]=U,e[85]=A,e[86]=F):F=e[86],e[87]!==R||e[88]!==F?(v=(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2","data-testid":"dh-probes",children:[R,F]}),e[87]=R,e[88]=F,e[89]=v):v=e[89],H=O,S="gap-0 py-0",V="dh-checks";let K;e[90]!==t?(K=t("Subsystem checks"),e[90]=t,e[91]=K):K=e[91],e[92]!==K?(b=(0,a.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,a.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:K})}),e[92]=K,e[93]=b):b=e[93],_=s.length===0?(0,a.jsx)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"dh-checks-empty",children:t("No checks reported.")}):(0,a.jsx)("ul",{className:"divide-y divide-border",children:s.map(g=>(0,a.jsxs)("li",{className:"flex flex-wrap items-center justify-between gap-2 px-4 py-2.5 text-xs","data-testid":`dh-check-${g.name}`,children:[(0,a.jsxs)("span",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{"aria-hidden":"true",className:Y("size-1.5 shrink-0 rounded-full",g.status==="up"?"bg-success":"bg-destructive")}),(0,a.jsx)("span",{className:"font-mono text-foreground",children:g.name}),g.critical&&(0,a.jsx)(Z,{variant:"outline",children:t("Critical")})]}),(0,a.jsxs)("span",{className:"flex shrink-0 items-center gap-2",children:[g.message!==void 0&&(0,a.jsx)("span",{className:"text-muted-foreground",children:g.message}),(0,a.jsx)(Z,{"data-testid":`dh-check-status-${g.name}`,variant:g.status==="up"?"secondary":"destructive",children:g.status==="up"?t("Up"):t("Down")})]})]},g.name))}),e[27]=l.appName,e[28]=l.appVersion,e[29]=l.checks,e[30]=l.timestamp,e[31]=W,e[32]=G,e[33]=j,e[34]=u,e[35]=t,e[36]=H,e[37]=I,e[38]=P,e[39]=x,e[40]=N,e[41]=v,e[42]=S,e[43]=V,e[44]=b,e[45]=_}else H=e[36],I=e[37],P=e[38],x=e[39],N=e[40],v=e[41],S=e[42],V=e[43],b=e[44],_=e[45];let z;e[94]!==H||e[95]!==S||e[96]!==V||e[97]!==b||e[98]!==_?(z=(0,a.jsxs)(H,{className:S,"data-testid":V,children:[b,_]}),e[94]=H,e[95]=S,e[96]=V,e[97]=b,e[98]=_,e[99]=z):z=e[99];let M;return e[100]!==I||e[101]!==P||e[102]!==x||e[103]!==N||e[104]!==v||e[105]!==z?(M=(0,a.jsxs)("div",{className:I,"data-testid":P,children:[x,N,v,z]}),e[100]=I,e[101]=P,e[102]=x,e[103]=N,e[104]=v,e[105]=z,e[106]=M):M=e[106],M},"Pe");function xe(r,e){return r.name.localeCompare(e.name)}k(xe,"he");export{Pe as DeploymentHealthPanel};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as Vr}from"./chunk-4L4WTGN5.js";import{a as D,b as _t,c as I,h as Pt,i as Fe,j as Mt,w as De}from"./chunk-AAVLPU5Q.js";import{a as wt,c as ye,d as Y,g as N,h as Lt,i as ge,j as z}from"./chunk-225VJ77I.js";import{a as r,c as Z,d as R,e as T,f as Nr,g as le,i as Nt}from"./chunk-YKXDMIHQ.js";var Sr=R(Nr(),1);var Fr=R(T(),1);var Qe={};Z(Qe,{Control:()=>Cr,Description:()=>br,Error:()=>pr,Item:()=>yr,Label:()=>ar,Root:()=>sr,Validity:()=>Ir});var M=R(T(),1);var Se=R(T(),1);var kt="data-valid",Ut="data-invalid";var ce={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Lr={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},Bt={disabled:!1,...Lr},G={valid(e){return e===null?null:e?{[kt]:""}:{[Ut]:""}}};var _r={invalid:void 0,name:void 0,validityData:{state:ce,errors:[],error:"",value:"",initialValue:null},setValidityData:N,disabled:void 0,setTouched:N,setDirty:N,setFilled:N,setFocused:N,validationMode:"onSubmit",shouldValidateOnChange:r(()=>!1,"shouldValidateOnChange"),state:Bt,registerFieldControl:N,validation:{getValidationProps:r((e,t=ge)=>t,"getValidationProps"),inputRef:{current:null},registeredInputs:new Map,registerInput:N,getInputControl:r(()=>null,"getInputControl"),commit:r(async()=>{},"commit"),change:N}},Xe=Se.createContext(_r);function W(e=!0){let t=Se.useContext(Xe);if(t.setValidityData===N&&!e)throw new Error(ye(28));return t}r(W,"useFieldRootContext");var Ae=R(T(),1);var Pr=Ae.createContext(void 0);function jt(e=!1){let t=Ae.useContext(Pr);if(!t&&!e)throw new Error(ye(86));return t}r(jt,"useFieldsetRootContext");var Te=R(T(),1);var Mr=Te.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:N,validationMode:"onSubmit",submitCountRef:{current:0}});function ee(){return Te.useContext(Mr)}r(ee,"useFormContext");var ae=R(T(),1);var Oe=R(T(),1);var $t=0;function kr(e,t="mui"){let[o,n]=Oe.useState(e),i=e||o;return Oe.useEffect(()=>{o==null&&($t+=1,n(`${t}-${$t}`))},[o,t]),i}r(kr,"useGlobalId");var Wt=_t.useId;function qt(e,t){if(Wt!==void 0){let o=Wt();return e??(t?`${t}-${o}`:o)}return kr(e,t)}r(qt,"useId");function te(e){return qt(e,"base-ui")}r(te,"useBaseUiId");var Ve=R(T(),1);var Ze=Ve.createContext({controlId:void 0,registerControlId:N,resetControlId:N,labelId:void 0,setLabelId:N,messageIds:[],setMessageIds:N,getDescriptionProps:r(e=>e,"getDescriptionProps")});function U(){return Ve.useContext(Ze)}r(U,"useLabelableContext");var Ht=R(le(),1);var Ne=r(function(t){let o=te(),[n,i]=ae.useState(o),[a,s]=ae.useState(),[d,f]=ae.useState([]),p=n===void 0?o:n,l=Y(()=>new Map),{messageIds:m}=U(),C=I((O,F)=>{let v=l.current;F===void 0?v.delete(O):v.set(O,F),i(_=>{if(v.size===0)return _;let k;for(let c of v.values()){if(c===_)return _;k===void 0&&(k=c)}return k})}),x=I(()=>{l.current.size===0&&i(o)}),h=ae.useCallback(O=>{let F=O["aria-describedby"]?O["aria-describedby"].split(" "):[];return F.push(...m,...d),{...O,"aria-describedby":Array.from(new Set(F)).join(" ")||void 0}},[m,d]),V=ae.useMemo(()=>({controlId:p,registerControlId:C,resetControlId:x,labelId:a,setLabelId:s,messageIds:d,setMessageIds:f,getDescriptionProps:h}),[p,C,x,a,s,d,f,h]);return(0,Ht.jsx)(Ze.Provider,{value:V,children:t.children})},"LabelableProvider");var et=R(T(),1);function Kt(e={}){let{id:t,enabled:o=!0}=e,{controlId:n,registerControlId:i,resetControlId:a}=U(),s=te(),d=Y(()=>Symbol()),f=et.useRef(!1),p=et.useRef(!1),l=I(()=>{!f.current||i===N||(f.current=!1,i(d.current,void 0))});return D(()=>{if(!o||i===N){l();return}let m;if(t!==void 0)p.current=!0,m=t;else if(p.current)m=s;else{a();return}if(m===void 0){l();return}f.current=!0,i(d.current,m)},[t,o,i,a,s,d,l]),D(()=>l,[l]),(o?n:void 0)??t??s}r(Kt,"useLabelableId");var we={};Z(we,{engine:()=>it,env:()=>at,mediaQuery:()=>lt,os:()=>ot,screenReader:()=>st});var ot={};Z(ot,{android:()=>Gt,apple:()=>rt,ios:()=>tt,linux:()=>Wr,mac:()=>Jt,windows:()=>$r});function Ur(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}r(Ur,"readRawData");var{userAgent:Br,platform:jr,maxTouchPoints:Yt}=Ur(),ue=Br.toLowerCase(),de=jr.toLowerCase();var tt=/^i(os$|p)/.test(de)||de==="macintel"&&Yt>1,zt="android",Gt=de===zt||ue.includes(zt),Jt=!tt&&de.startsWith("mac"),$r=de.startsWith("win"),Wr=!Gt&&/^(linux|chrome os)/.test(de),rt=Jt||tt;var it={};Z(it,{blink:()=>Hr,gecko:()=>qr,webkit:()=>nt});var nt=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none"),qr=!nt&&ue.includes("firefox"),Hr=!nt&&ue.includes("chrom");var st={};Z(st,{voiceOver:()=>Kr});var Kr=rt;var at={};Z(at,{jsdom:()=>Yr});var Yr=/jsdom|happydom/.test(ue);var lt={};Z(lt,{iOS:()=>zr});var zr="@supports (-webkit-touch-callout: none)";function ct(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}r(ct,"activeElement");function Qt(e,t){if(!e||!t)return!1;let o=t.getRootNode?.();if(e.contains(t))return!0;if(o&&Mt(o)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}r(Qt,"contains");function ut(e){return"composedPath"in e?e.composedPath()[0]??e.target:e.target}r(ut,"getTarget");var dt="data-base-ui-focusable";var ft="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Hn="ArrowLeft",Kn="ArrowRight",Yn="ArrowUp",zn="ArrowDown";var xe="data-starting-style",Le="data-ending-style";var Gr={[xe]:""},Jr={[Le]:""},_e={transitionStatus(e){return e==="starting"?Gr:e==="ending"?Jr:null}};var Xt={};Z(Xt,{align:()=>eo,anchorHidden:()=>gt,closed:()=>bt,endingStyle:()=>Xr,open:()=>mt,side:()=>Zr,startingStyle:()=>Qr});var mt="data-open",bt="data-closed",Qr=xe,Xr=Le,gt="data-anchor-hidden",Zr="data-side",eo="data-align";var Me={};Z(Me,{popupOpen:()=>Pe,pressed:()=>xt});var Pe="data-popup-open",xt="data-pressed";var to={[Pe]:""},ro={[Pe]:"",[xt]:""},oo={[mt]:""},no={[bt]:""},io={[gt]:""},Xn={open(e){return e?to:null}},Zn={open(e){return e?ro:null}},so={open(e){return e?oo:no},anchorHidden(e){return e?io:null}},ei={...so,..._e};var oi=Me.popupOpen,Rt="data-trigger-disabled";function li(e,t){if(!Pt(e))return!1;let o=e;if(t.hasElement(o))return!o.hasAttribute(Rt);for(let[,n]of t.entries())if(Qt(n,o))return!n.hasAttribute(Rt);return!1}r(li,"isTargetInsideEnabledTrigger");function ci(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);let o=e;return o.target!=null&&t.contains(o.target)}r(ci,"isEventTargetWithin");function ui(e){return e.matches("html,body")}r(ui,"isRootElement");function lo(e){return Fe(e)&&e.matches(ft)}r(lo,"isTypeableElement");function di(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${ft}`)!=null}r(di,"isInteractiveElement");function fi(e){return e?e.getAttribute("role")==="combobox"&&lo(e):!1}r(fi,"isTypeableCombobox");function pi(e){if(!e||we.env.jsdom)return!0;try{return e.matches(":focus-visible")}catch{return!0}}r(pi,"matchesFocusVisible");function mi(e){return e?e.hasAttribute(dt)?e:e.querySelector(`[${dt}]`)||e:null}r(mi,"getFloatingFocusElement");function Zt(e,t){let o=te(e);return D(()=>(t(o),()=>{t(n=>n===o?void 0:n)}),[o,t]),o}r(Zt,"useRegisteredLabelId");function er(e={}){let{id:t,fallbackControlId:o,native:n=!1,setLabelId:i,focusControl:a}=e,{controlId:s,setLabelId:d}=U(),f=I(x=>{d(x),i?.(x)}),p=Zt(t,f),l=s??o;function m(x){if(a){a(x,l);return}if(!l)return;let h=De(x.currentTarget).getElementById(l);Fe(h)&&co(h)}r(m,"focusControl");function C(x){ut(x.nativeEvent)?.closest("button,input,select,textarea")||(!x.defaultPrevented&&x.detail>1&&x.preventDefault(),!n&&m(x))}return r(C,"handleInteraction"),n?{id:p,htmlFor:l,onMouseDown:C}:{id:p,onClick:C,onPointerDown(x){x.preventDefault()}}}r(er,"useLabel");function co(e){e.focus({focusVisible:!0})}r(co,"focusElementWithVisible");var se=R(T(),1);var tr=R(T(),1);function ke(e){tr.useEffect(e,Lt)}r(ke,"useOnMount");var Re=0,ht=class e{static{r(this,"Timeout")}static create(){return new e}currentId=Re;start(t,o){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Re,o()},t)}isStarted(){return this.currentId!==Re}clear=r(()=>{this.currentId!==Re&&(clearTimeout(this.currentId),this.currentId=Re)},"clear");disposeEffect=r(()=>this.clear,"disposeEffect")};function Ue(){let e=Y(ht.create).current;return ke(e.disposeEffect),e}r(Ue,"useTimeout");function fe(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}r(fe,"getCombinedFieldValidityData");var vt=Object.keys(ce);function uo(e,t){return e.matches(":disabled")?!1:!t||e.form===t?!0:e.form===null&&!e.hasAttribute("form")}r(uo,"isEligibleInput");function rr(e,t){let o=null;for(let n of e.keys())if(uo(n,t)){if(!n.validity.valid)return n;o??=n}return o}r(rr,"findRepresentativeInput");function or(e){return{...ce,valid:!e,customError:e}}r(or,"makeState");function Ct(e){return e&&e.validationMessage?[e.validationMessage]:[]}r(Ct,"getNativeErrors");function nr(e){let{elementRef:t,formRef:o}=ee(),{setValidityData:n,validate:i,validityData:a,validationDebounceTime:s,invalid:d,markedDirtyRef:f,state:p,shouldValidateOnChange:l,validationMode:m,registeredFieldIdRef:C}=e,{controlId:x,getDescriptionProps:h}=U(),V=Ue(),O=se.useRef(null),F=Y(()=>new Map).current,v=se.useRef(0),_=se.useRef(null),k=se.useCallback((w,B)=>(F.set(w,B),()=>{F.delete(w)}),[F]),c=I(()=>{let w=rr(F,t.current);return w&&F.get(w)?.controlRef.current||null}),S=I(async(w,B=!1)=>{v.current+=1;let A=v.current;function K(u,b=d){let g=C.current??x;if(g==null)return;let y=o.current.fields.get(g);if(!y)return;let $=fe(u,b);o.current.fields.set(g,{...y,validityData:$})}r(K,"updateRegisteredFieldValidity");function oe(u,b){let g=u.valid===!1?b:[];return{value:w,state:u,error:g[0]??"",errors:g,initialValue:a.initialValue}}r(oe,"makeValidityData");function ne(u,b){let g=u.validity.customError?u.validationMessage:"",y=b.replace(/\r\n?/g,`
|
|
2
|
+
`);u.setCustomValidity(y),_.current=[u,y,g]}r(ne,"setCustomValidity");function Q(){let u=_.current;_.current=null,u&&(!u[0].willValidate||u[0].validationMessage===u[1])&&u[0].setCustomValidity(u[2])}r(Q,"clearCustomValidity");function P(u,b,g){let y=oe(u,b);K(y,g),n(y)}r(P,"publish");function J(u){let b=vt.reduce((y,$)=>(y[$]=u.validity[$],y),{}),g=!1;for(let y of vt)if(y!=="valid"){if(y==="valueMissing"&&b[y])g=!0;else if(b[y])return b}return g&&!f.current&&(b.valid=!0,b.valueMissing=!1),b}r(J,"getState");function ie(){return F.size>0?rr(F,t.current):O.current}r(ie,"resolveRepresentativeInput");let L=ie();function X(){return L=ie(),L?.willValidate?J(L):or(!1)}if(r(X,"refreshState"),B){if(p.valid!==!1||!L)return;if(!L.validity.valueMissing){Q();let u=ie(),b=u?.validity.customError?Ct(u):[];P(or(b.length>0),b,!1);return}for(let u of vt)if(u!=="valid"&&u!=="valueMissing"&&u!=="customError"&&L.validity[u])return}V.clear(),Q();let j=X(),q=Ct(L),be=l();if(q.length===0||be){let u=Array.from(o.current.fields.values()).reduce((y,$)=>($.name&&(y[$.name]=$.getValue()),y),{}),b=i(w,u),g;if(typeof b=="object"&&b!==null&&"then"in b){if(j.valid===!1?P(j,q):(m==="onSubmit"||!a.state.customError)&&(j.valid=null,P(j,q)),g=await b,A!==v.current)return;j=X()}else g=b;q=g?[].concat(g).filter(Boolean):[],q.length>0?(j.valid=!1,j.customError=!0,L?.willValidate&&ne(L,q.join(`
|
|
3
|
+
`))):q=Ct(L)}P(j,q)}),E=I((w,B=!1)=>{if(V.clear(),v.current+=1,B)return;let A=l();A&&w!==""&&s?V.start(s,()=>{S(w)}):S(w,!A)}),H=se.useCallback((w,B={})=>wt(h(B),p.valid===!1&&!p.disabled&&!w?{"aria-invalid":!0}:ge),[h,p.disabled,p.valid]);return se.useMemo(()=>({getValidationProps:H,inputRef:O,registeredInputs:F,registerInput:k,getInputControl:c,commit:S,change:E}),[H,F,k,c,S,E])}r(nr,"useFieldValidation");var Be=R(T(),1);function ir(e){let{change:t,commit:o,invalid:n,markedDirtyRef:i,name:a,setRegisteredFieldName:s,registeredFieldIdRef:d,setValidityData:f,validityData:p}=e,{formRef:l}=ee(),m=Be.useRef(null),C=Be.useRef(null),x=Be.useRef(!1),h=I(()=>{let c=C.current;if(c)return c.getValue?c.getValue():c.value});function V(c){return c.value===void 0?h():c.value}r(V,"getRegistrationValue");let O=I(()=>{let c=C.current;if(i.current=!0,!c){o(p.value);return}o(V(c))});function F(){let c=C.current;!c||!c.id||l.current.fields.set(c.id,{getValue:h,name:a??c.name,controlRef:c.controlRef,validityData:fe(p,n),validate:O})}r(F,"refreshRegistration");function v(c=C.current?.id){c&&l.current.fields.delete(c)}r(v,"deleteRegistration");function _(c){if(x.current)return;x.current=!0;let S=V(c);f(E=>E.initialValue===S?E:{...E,initialValue:S})}r(_,"captureInitialValue"),D(()=>{let c=C.current;!c||!c.id||(s(a?void 0:c.name),l.current.fields.set(c.id,{getValue:h,name:a??c.name,controlRef:c.controlRef,validityData:fe(p,n),validate:O}))},[l,h,n,a,s,O,p]),D(()=>{let c=l.current.fields;return()=>{let S=C.current?.id;S&&c.delete(S)}},[l]);let k=I((c,S)=>{if(!S){m.current===c&&(m.current=null,t(void 0,!0),v(),C.current=null,s(void 0),d.current=void 0);return}let E=C.current?.id,H=m.current;H&&H!==c&&t(void 0,!0),m.current=c,C.current=S,a||s(S.name),d.current=S.id,E&&E!==S.id&&v(E),_(S),F()});return[O,k]}r(ir,"useFieldControlRegistration");var je=R(le(),1);var fo=M.forwardRef(r(function(t,o){let{errors:n,validationMode:i,submitCountRef:a}=ee(),{render:s,className:d,validate:f,validationDebounceTime:p=0,validationMode:l=i,name:m,disabled:C=!1,invalid:x,dirty:h,touched:V,actionsRef:O,style:F,...v}=t,_=jt(!0)?.disabled,k=I(f||(()=>null)),c=_||C,[S,E]=M.useState(!1),[H,w]=M.useState(!1),[B,A]=M.useState(!1),[K,oe]=M.useState(!1),ne=h??H,Q=V??S,P=M.useRef(ne),J=M.useRef(void 0),[ie,L]=M.useState(),X=m??ie;D(()=>{h!==void 0&&(P.current=h)},[h]);let j=I(Ie=>{h===void 0&&(Ie&&(P.current=!0),w(Ie))}),q=I(Ie=>{V===void 0&&E(Ie)}),be=I(()=>l==="onChange"||l==="onSubmit"&&a.current>0),u=X&&Object.hasOwn(n,X)?n[X]:null,b=!!(Array.isArray(u)?u.length:u),g=x===!0||b,[y,$]=M.useState({state:ce,error:"",errors:[],value:null,initialValue:null}),Tt=!g&&(c?null:y.state.valid),Ce=M.useMemo(()=>({disabled:c,touched:Q,dirty:ne,valid:Tt,filled:B,focused:K}),[c,Q,ne,Tt,B,K]),Ee=nr({setValidityData:$,validate:k,validityData:y,validationDebounceTime:p,invalid:g,markedDirtyRef:P,state:Ce,shouldValidateOnChange:be,validationMode:l,registeredFieldIdRef:J}),[Ot,Vt]=ir({change:Ee.change,commit:Ee.commit,invalid:g,markedDirtyRef:P,name:m,setRegisteredFieldName:L,registeredFieldIdRef:J,setValidityData:$,validityData:y});M.useImperativeHandle(O,()=>({validate:Ot}),[Ot]);let Tr=M.useMemo(()=>({invalid:g,name:X,validityData:y,setValidityData:$,disabled:c,setTouched:q,setDirty:j,setFilled:A,setFocused:oe,validationMode:l,shouldValidateOnChange:be,state:Ce,registerFieldControl:Vt,validation:Ee}),[g,X,y,c,q,j,A,oe,l,be,Ce,Vt,Ee]),Or=z("div",t,{ref:o,state:Ce,props:v,stateAttributesMapping:G});return(0,je.jsx)(Xe.Provider,{value:Tr,children:Or})},"FieldRootInner")),sr=M.forwardRef(r(function(t,o){return(0,je.jsx)(Ne,{children:(0,je.jsx)(fo,{...t,ref:o})})},"FieldRoot"));var he=R(T(),1);var $e=R(T(),1);var Et=$e.createContext({disabled:!1});function We(){return $e.useContext(Et)}r(We,"useFieldItemContext");var ar=he.forwardRef(r(function(t,o){let{render:n,className:i,style:a,id:s,nativeLabel:d=!0,...f}=t,p=W(!1),l=We(),{labelId:m}=U(),C={...p.state,disabled:p.disabled||l.disabled},x=he.useRef(null),h=er({id:m??s,native:d});return z("label",t,{ref:[o,x],state:C,props:[h,f],stateAttributesMapping:G})},"FieldLabel"));var pe=R(T(),1);var dr=R(T(),1);var yt=R(Vr(),1);var qe=null,Fs=globalThis.requestAnimationFrame,It=class{static{r(this,"Scheduler")}callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=r(t=>{this.isScheduled=!1;let o=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let i=0;i<o.length;i+=1)o[i]?.(t)},"tick");request(t){let o=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),o}cancel(t){let o=t-this.startId;o<0||o>=this.callbacks.length||this.callbacks[o]!==null&&(this.callbacks[o]=null,this.callbacksCount-=1)}},He=new It;var re=class e{static{r(this,"AnimationFrame")}static create(){return new e}static request(t){return He.request(t)}static cancel(t){return He.cancel(t)}currentId=qe;request(t){this.cancel(),this.currentId=He.request(()=>{this.currentId=qe,t()})}cancel=r(()=>{this.currentId!==qe&&(He.cancel(this.currentId),this.currentId=qe)},"cancel");disposeEffect=r(()=>this.cancel,"disposeEffect")};function lr(){let e=Y(re.create).current;return ke(e.disposeEffect),e}r(lr,"useAnimationFrame");function cr(e){return e==null?e:"current"in e?e.current:e}r(cr,"resolveRef");var Ke=null;function po(e){if(!Ke){let t=[];Ke=t,queueMicrotask(()=>{Ke=null,yt.flushSync(()=>{for(let o of t)o()})})}Ke.push(e)}r(po,"flushBeforePaint");function ur(e,t=!1,o=!1){let n=lr();return I((i,a=null)=>{n.cancel();let s=cr(e);if(s==null)return;let d=s,f=r(()=>{if(!o){yt.flushSync(i);return}po(()=>{a?.aborted||i()})},"done");if(typeof d.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function p(){Promise.all(d.getAnimations().map(l=>l.finished)).then(()=>{a?.aborted||f()},()=>{if(a?.aborted)return;if(d.getAnimations().some(m=>m.pending||m.playState!=="finished")){p();return}f()})}if(r(p,"exec"),t){let l=xe;if(!d.hasAttribute(l)){n.request(p);return}let m=new MutationObserver(()=>{d.hasAttribute(l)||(m.disconnect(),p())});m.observe(d,{attributes:!0,attributeFilter:[l]}),a?.addEventListener("abort",()=>m.disconnect(),{once:!0});return}n.request(p)})}r(ur,"useAnimationsFinished");function fr(e){let{enabled:t=!0,open:o,ref:n,batch:i=!1,onComplete:a}=e,s=I(a),d=ur(n,o,i);dr.useEffect(()=>{if(!t)return;let f=new AbortController;return d(s,f.signal),()=>{f.abort()}},[t,o,s,d])}r(fr,"useOpenChangeComplete");var Ft=R(T(),1);function Ye(e,t=!1,o=!1,n=!1){let[i,a]=Ft.useState(e&&t?"idle":void 0),[s,d]=Ft.useState(e&&!n);return e&&!s&&(d(!0),a("starting")),!e&&s&&i!=="ending"&&!o&&a("ending"),!e&&!s&&i==="ending"&&a(void 0),D(()=>{if(!e&&s&&i!=="ending"&&o){let f=re.request(()=>{a("ending")});return()=>{re.cancel(f)}}},[e,s,i,o]),D(()=>{if(!e||t)return;let f=re.request(()=>{a(void 0)});return()=>{re.cancel(f)}},[t,e]),D(()=>{if(!e||!t)return;e&&s&&i!=="idle"&&a("starting");let f=re.request(()=>{a("idle")});return()=>{re.cancel(f)}},[t,e,s,i]),{mounted:s,setMounted:d,transitionStatus:i}}r(Ye,"useTransitionStatus");var Dt=R(le(),1);var mo={...G,..._e},pr=pe.forwardRef(r(function(t,o){let{render:n,id:i,className:a,match:s,style:d,...f}=t,p=te(i),{validityData:l,state:m,name:C}=W(!1),{setMessageIds:x}=U(),{errors:h}=ee(),V=C&&Object.hasOwn(h,C)?h[C]:null,O=!!(Array.isArray(V)?V.length:V),F=typeof s=="string",v=!1;s===!0?v=!0:m.disabled?v=!1:F?v=!!l.state[s]:v=O||l.state.valid===!1;let{mounted:_,transitionStatus:k,setMounted:c}=Ye(v);D(()=>{if(!(!v||!p))return x(P=>P.concat(p)),()=>{x(P=>P.filter(J=>J!==p))}},[v,p,x]);let S=pe.useRef(null),[E,H]=pe.useState(null),[w,B]=pe.useState(null),A=l.error;!F&&O?A=V:l.errors.length>1&&(A=l.errors);let K=A;Array.isArray(A)&&(K=A.length>1?(0,Dt.jsx)("ul",{children:A.map(P=>(0,Dt.jsx)("li",{children:P},P))}):A[0]);let oe=Array.isArray(A)?JSON.stringify(A):A;v&&oe!==w&&(B(oe),H(K)),fr({open:v,ref:S,onComplete(){v||c(!1)}});let ne={...m,transitionStatus:k},Q=z("div",t,{ref:[o,S],state:ne,props:[{id:p,children:v?K:E},f],stateAttributesMapping:mo,enabled:_});return _?Q:null},"FieldError"));var mr=R(T(),1);var br=mr.forwardRef(r(function(t,o){let{render:n,id:i,className:a,style:s,...d}=t,f=te(i),p=W(!1),l=We(),{setMessageIds:m}=U(),C={...p.state,disabled:p.disabled||l.disabled};return D(()=>{if(f)return m(h=>h.concat(f)),()=>{m(h=>h.filter(V=>V!==f))}},[f,m]),z("p",t,{ref:o,state:C,props:[{id:f},d],stateAttributesMapping:G})},"FieldDescription"));var Ge=R(T(),1);var me=R(T(),1);function gr({controlled:e,default:t,name:o,state:n="value"}){let{current:i}=me.useRef(e!==void 0),[a,s]=me.useState(t),d=i&&e!==void 0?e:a,f=me.useCallback(p=>{i||s(p)},[]);return[d,f]}r(gr,"useControlled");function xr(e,t,o,n,i=!0,a){let{registerFieldControl:s}=W(),d=Y(()=>Symbol());D(()=>{let f=d.current;if(!i){s(f,void 0);return}s(f,{controlRef:e,getValue:n,id:t,name:a,value:o})},[e,i,n,t,a,s,d,o]),D(()=>{let f=d.current;return()=>{s(f,void 0)}},[s,d])}r(xr,"useRegisterFieldControl");var Rr=R(T(),1);function hr(e,t){let o=Rr.useRef(e),n=I(t);D(()=>{o.current!==e&&n(o.current),o.current=e},[e,n])}r(hr,"useValueChanged");var ze={};Z(ze,{cancelOpen:()=>$o,chipRemovePress:()=>yo,clearPress:()=>Io,closePress:()=>Co,closeWatcher:()=>_o,decrementPress:()=>So,disabled:()=>qo,drag:()=>Uo,escapeKey:()=>Lo,focusOut:()=>wo,imperativeAction:()=>Yo,incrementPress:()=>Do,initial:()=>Ko,inputBlur:()=>Oo,inputChange:()=>Ao,inputClear:()=>To,inputPaste:()=>Vo,inputPress:()=>No,itemPress:()=>vo,keyboard:()=>Mo,linkPress:()=>Eo,listNavigation:()=>Po,missing:()=>Ho,none:()=>bo,outsidePress:()=>ho,pointer:()=>ko,scrub:()=>jo,siblingOpen:()=>Wo,swipe:()=>zo,trackPress:()=>Fo,triggerFocus:()=>Ro,triggerHover:()=>xo,triggerPress:()=>go,wheel:()=>Bo,windowResize:()=>Go});var bo="none",go="trigger-press",xo="trigger-hover",Ro="trigger-focus",ho="outside-press",vo="item-press",Co="close-press",Eo="link-press",Io="clear-press",yo="chip-remove-press",Fo="track-press",Do="increment-press",So="decrement-press",Ao="input-change",To="input-clear",Oo="input-blur",Vo="input-paste",No="input-press",wo="focus-out",Lo="escape-key",_o="close-watcher",Po="list-navigation",Mo="keyboard",ko="pointer",Uo="drag",Bo="wheel",jo="scrub",$o="cancel-open",Wo="sibling-open",qo="disabled",Ho="missing",Ko="initial",Yo="imperative-action",zo="swipe",Go="window-resize";function vr(e,t,o,n){let i=!1,a=!1,s=n??ge;return{reason:e,event:t??new Event("base-ui"),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:o,...s}}r(vr,"createChangeEventDetails");var Cr=Ge.forwardRef(r(function(t,o){let{render:n,className:i,id:a,name:s,value:d,disabled:f=!1,onValueChange:p,defaultValue:l,autoFocus:m=!1,style:C,...x}=t,{state:h,name:V,disabled:O,setTouched:F,setDirty:v,validityData:_,setFocused:k,setFilled:c,validationMode:S,validation:E}=W(),{clearErrors:H,elementRef:w,submitCountRef:B}=ee(),A=O||f,K=V??s,oe={...h,disabled:A},{labelId:ne}=U(),Q=Kt({id:a}),[P]=gr({controlled:d,default:l,name:"FieldControl",state:"value"}),J=d!==void 0,ie=J?P:void 0,L=ie==null?void 0:String(ie),X=I(()=>E.inputRef.current?.value);xr(E.inputRef,Q,L,X,!A,s),D(()=>{let u=L??E.inputRef.current?.value;u!==void 0&&c(u!=="")},[L,E.inputRef,c]),hr(L,()=>{L!==void 0&&(H(K),v(L!==(_.initialValue??"")),E.change(L))});let j=Ge.useRef(null),q=Ue();return D(()=>{m&&j.current===ct(De(j.current))&&k(!0)},[m,k]),z("input",t,{ref:[o,j],state:oe,props:[{id:Q,disabled:A,name:K,ref:E.inputRef,"aria-labelledby":ne,autoFocus:m,...J?{value:ie}:{defaultValue:l},onChange(u){let b=u.currentTarget.value,g=vr(ze.none,u.nativeEvent);p?.(b,g),!J&&(v(b!==(_.initialValue??"")),c(b!==""),!u.nativeEvent.defaultPrevented&&!g.isCanceled&&(H(K),E.change(b)))},onFocus(){k(!0)},onBlur(u){if(F(!0),k(!1),S==="onBlur"){let b=u.currentTarget.value;E.commit(b),J&&queueMicrotask(()=>{let g=E.inputRef.current?.value;g!==void 0&&g!==b&&g!==(_.initialValue??"")&&E.commit(g)})}},onKeyDown(u){if(u.currentTarget.tagName==="INPUT"&&u.key==="Enter"){F(!0);let b=u.currentTarget.value,g=u.currentTarget.form;if(g&&g===w.current&&!u.defaultPrevented){let y=u.currentTarget,$=B.current;q.start(0,()=>{B.current===$&&E.commit(y.value)})}else E.commit(b)}}},x,u=>E.getValidationProps(A,u)],stateAttributesMapping:G})},"FieldControl"));var ve=R(T(),1);var Er=R(le(),1);var Ir=r(function(t){let{children:o}=t,{validityData:n,invalid:i}=W(!1),a=ve.useMemo(()=>fe(n,i),[n,i]),s=a.state.valid===!1,{transitionStatus:d}=Ye(s),f=ve.useMemo(()=>({...a,validity:a.state,transitionStatus:d}),[a,d]);return(0,Er.jsx)(ve.Fragment,{children:o(f)})},"FieldValidity");var Je=R(T(),1);var St=R(le(),1);var yr=Je.forwardRef(r(function(t,o){let{render:n,className:i,style:a,disabled:s=!1,...d}=t,{state:f,disabled:p}=W(!1),l=p||s,m={...f,disabled:l},C=Je.useMemo(()=>({disabled:l}),[l]),x=z("div",t,{ref:o,state:m,props:d,stateAttributesMapping:G});return(0,St.jsx)(Ne,{children:(0,St.jsx)(Et.Provider,{value:C,children:x})})},"FieldItem"));var Dr=R(le(),1);var At=Fr.forwardRef(r(function(t,o){return(0,Dr.jsx)(Qe.Control,{ref:o,...t})},"Input"));var Ar=R(le(),1);function gl(e){let t=(0,Sr.c)(10),o,n,i;t[0]!==e?({className:o,type:i,...n}=e,t[0]=e,t[1]=o,t[2]=n,t[3]=i):(o=t[1],n=t[2],i=t[3]);let a;t[4]!==o?(a=Nt("h-8 w-full min-w-0 rounded-md border border-input bg-transparent px-2.5 py-1 text-xs transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-xs file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 md:text-xs dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",o),t[4]=o,t[5]=a):a=t[5];let s;return t[6]!==n||t[7]!==a||t[8]!==i?(s=(0,Ar.jsx)(At,{type:i,"data-slot":"input",className:a,...n}),t[6]=n,t[7]=a,t[8]=i,t[9]=s):s=t[9],s}r(gl,"m");export{G as a,W as b,ee as c,qt as d,te as e,U as f,Kt as g,we as h,ct as i,Qt as j,ut as k,dt as l,Hn as m,Kn as n,Yn as o,zn as p,_e as q,Xt as r,Me as s,Xn as t,Zn as u,so as v,ei as w,Rt as x,li as y,ci as z,ui as A,lo as B,di as C,fi as D,pi as E,mi as F,er as G,ke as H,ht as I,Ue as J,We as K,re as L,lr as M,cr as N,ur as O,fr as P,Ye as Q,gr as R,xr as S,hr as T,ze as U,vr as V,gl as W};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import{a,b as ee,d as fe,e as Ne}from"./chunk-YKXDMIHQ.js";var he=ee((de,H)=>{(function(e,t){typeof define=="function"&&define.amd?define([],t):typeof H=="object"&&H.exports?H.exports=t():e.moo=t()})(de,function(){"use strict";var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r=typeof new RegExp().sticky=="boolean";function s(n){return n&&t.call(n)==="[object RegExp]"}a(s,"isRegExp");function i(n){return n&&typeof n=="object"&&!s(n)&&!Array.isArray(n)}a(i,"isObject");function l(n){return n.replace(/[-\/\\^$*+?.()|[\]{}]/g,function(o){return o==="-"?"\\x2d":"\\"+o})}a(l,"reEscape");function c(n){var o=new RegExp("|"+n);return o.exec("").length-1}a(c,"reGroups");function h(n){return"("+n+")"}a(h,"reCapture");function v(n){if(!n.length)return"(?!)";var o=n.map(function(u){return"(?:"+u+")"}).join("|");return"(?:"+o+")"}a(v,"reUnion");function S(n){if(typeof n=="string")return"(?:"+l(n)+")";if(s(n)){if(n.ignoreCase)throw new Error("RegExp /i flag not allowed");if(n.global)throw new Error("RegExp /g flag is implied");if(n.sticky)throw new Error("RegExp /y flag is implied");if(n.multiline)throw new Error("RegExp /m flag is implied");return n.source}else throw new Error("Not a pattern: "+n)}a(S,"regexpOrLiteral");function k(n,o){return n.length>o?n:Array(o-n.length+1).join(" ")+n}a(k,"pad");function $(n,o){for(var u=n.length,f=0;;){var g=n.lastIndexOf(`
|
|
2
|
+
`,u-1);if(g===-1||(f++,u=g,f===o)||u===0)break}var d=f<o?0:u+1;return n.substring(d).split(`
|
|
3
|
+
`)}a($,"lastNLines");function K(n){for(var o=Object.getOwnPropertyNames(n),u=[],f=0;f<o.length;f++){var g=o[f],d=n[g],y=[].concat(d);if(g==="include"){for(var w=0;w<y.length;w++)u.push({include:y[w]});continue}var m=[];y.forEach(function(p){i(p)?(m.length&&u.push(M(g,m)),u.push(M(g,p)),m=[]):m.push(p)}),m.length&&u.push(M(g,m))}return u}a(K,"objectToRules");function O(n){for(var o=[],u=0;u<n.length;u++){var f=n[u];if(f.include){for(var g=[].concat(f.include),d=0;d<g.length;d++)o.push({include:g[d]});continue}if(!f.type)throw new Error("Rule has no type: "+JSON.stringify(f));o.push(M(f.type,f))}return o}a(O,"arrayToRules");function M(n,o){if(i(o)||(o={match:o}),o.include)throw new Error("Matching rules cannot also include states");var u={defaultType:n,lineBreaks:!!o.error||!!o.fallback,pop:!1,next:null,push:null,error:!1,fallback:!1,value:null,type:null,shouldThrow:!1};for(var f in o)e.call(o,f)&&(u[f]=o[f]);if(typeof u.type=="string"&&n!==u.type)throw new Error("Type transform cannot be a string (type '"+u.type+"' for token '"+n+"')");var g=u.match;return u.match=Array.isArray(g)?g:g?[g]:[],u.match.sort(function(d,y){return s(d)&&s(y)?0:s(y)?-1:s(d)?1:y.length-d.length}),u}a(M,"ruleOptions");function D(n){return Array.isArray(n)?O(n):K(n)}a(D,"toRules");var N=M("error",{lineBreaks:!0,shouldThrow:!0});function F(n,o){for(var u=null,f=Object.create(null),g=!0,d=null,y=[],w=[],m=0;m<n.length;m++)n[m].fallback&&(g=!1);for(var m=0;m<n.length;m++){var p=n[m];if(p.include)throw new Error("Inheritance is not allowed in stateless lexers");if(p.error||p.fallback){if(u)throw!p.fallback==!u.fallback?new Error("Multiple "+(p.fallback?"fallback":"error")+" rules not allowed (for token '"+p.defaultType+"')"):new Error("fallback and error are mutually exclusive (for token '"+p.defaultType+"')");u=p}var b=p.match.slice();if(g)for(;b.length&&typeof b[0]=="string"&&b[0].length===1;){var q=b.shift();f[q.charCodeAt(0)]=p}if(p.pop||p.push||p.next){if(!o)throw new Error("State-switching options are not allowed in stateless lexers (for token '"+p.defaultType+"')");if(p.fallback)throw new Error("State-switching options are not allowed on fallback tokens (for token '"+p.defaultType+"')")}if(b.length!==0){g=!1,y.push(p);for(var C=0;C<b.length;C++){var P=b[C];if(s(P)){if(d===null)d=P.unicode;else if(d!==P.unicode&&p.fallback===!1)throw new Error("If one rule is /u then all must be")}}var I=v(b.map(S)),T=new RegExp(I);if(T.test(""))throw new Error("RegExp matches empty string: "+T);var L=c(I);if(L>0)throw new Error("RegExp has capture groups: "+T+`
|
|
4
|
+
Use (?: \u2026 ) instead`);if(!p.lineBreaks&&T.test(`
|
|
5
|
+
`))throw new Error("Rule should declare lineBreaks: "+T);w.push(h(I))}}var R=u&&u.fallback,U=r&&!R?"ym":"gm",W=r||R?"":"|";d===!0&&(U+="u");var Pe=new RegExp(v(w)+W,U);return{regexp:Pe,groups:y,fast:f,error:u||N}}a(F,"compileRules");function Q(n){var o=F(D(n));return new _({start:o},"start")}a(Q,"compile");function ue(n,o,u){var f=n&&(n.push||n.next);if(f&&!u[f])throw new Error("Missing state '"+f+"' (in token '"+n.defaultType+"' of state '"+o+"')");if(n&&n.pop&&+n.pop!=1)throw new Error("pop must be 1 (in token '"+n.defaultType+"' of state '"+o+"')")}a(ue,"checkStateGroup");function Be(n,o){var u=n.$all?D(n.$all):[];delete n.$all;var f=Object.getOwnPropertyNames(n);o||(o=f[0]);for(var g=Object.create(null),d=0;d<f.length;d++){var y=f[d];g[y]=D(n[y]).concat(u)}for(var d=0;d<f.length;d++)for(var y=f[d],w=g[y],m=Object.create(null),p=0;p<w.length;p++){var b=w[p];if(b.include){var q=[p,1];if(b.include!==y&&!m[b.include]){m[b.include]=!0;var C=g[b.include];if(!C)throw new Error("Cannot include nonexistent state '"+b.include+"' (in state '"+y+"')");for(var P=0;P<C.length;P++){var I=C[P];w.indexOf(I)===-1&&q.push(I)}}w.splice.apply(w,q),p--}}for(var T=Object.create(null),d=0;d<f.length;d++){var y=f[d];T[y]=F(g[y],!0)}for(var d=0;d<f.length;d++){for(var L=f[d],R=T[L],U=R.groups,p=0;p<U.length;p++)ue(U[p],L,T);for(var W=Object.getOwnPropertyNames(R.fast),p=0;p<W.length;p++)ue(R.fast[W[p]],L,T)}return new _(T,o)}a(Be,"compileStates");function De(n){for(var o=typeof Map<"u",u=o?new Map:Object.create(null),f=Object.getOwnPropertyNames(n),g=0;g<f.length;g++){var d=f[g],y=n[d],w=Array.isArray(y)?y:[y];w.forEach(function(m){if(typeof m!="string")throw new Error("keyword must be string (in keyword '"+d+"')");o?u.set(m,d):u[m]=d})}return function(m){return o?u.get(m):u[m]}}a(De,"keywordTransform");var _=a(function(n,o){this.startState=o,this.states=n,this.buffer="",this.stack=[],this.reset()},"Lexer");_.prototype.reset=function(n,o){return this.buffer=n||"",this.index=0,this.line=o?o.line:1,this.col=o?o.col:1,this.queuedToken=o?o.queuedToken:null,this.queuedText=o?o.queuedText:"",this.queuedThrow=o?o.queuedThrow:null,this.setState(o?o.state:this.startState),this.stack=o&&o.stack?o.stack.slice():[],this},_.prototype.save=function(){return{line:this.line,col:this.col,state:this.state,stack:this.stack.slice(),queuedToken:this.queuedToken,queuedText:this.queuedText,queuedThrow:this.queuedThrow}},_.prototype.setState=function(n){if(!(!n||this.state===n)){this.state=n;var o=this.states[n];this.groups=o.groups,this.error=o.error,this.re=o.regexp,this.fast=o.fast}},_.prototype.popState=function(){this.setState(this.stack.pop())},_.prototype.pushState=function(n){this.stack.push(this.state),this.setState(n)};var qe=r?function(n,o){return n.exec(o)}:function(n,o){var u=n.exec(o);return u[0].length===0?null:u};_.prototype._getGroup=function(n){for(var o=this.groups.length,u=0;u<o;u++)if(n[u+1]!==void 0)return this.groups[u];throw new Error("Cannot find token type for matched text")};function Ce(){return this.value}if(a(Ce,"tokenToString"),_.prototype.next=function(){var n=this.index;if(this.queuedGroup){var o=this._token(this.queuedGroup,this.queuedText,n);return this.queuedGroup=null,this.queuedText="",o}var u=this.buffer;if(n!==u.length){var y=this.fast[u.charCodeAt(n)];if(y)return this._token(y,u.charAt(n),n);var f=this.re;f.lastIndex=n;var g=qe(f,u),d=this.error;if(g==null)return this._token(d,u.slice(n,u.length),n);var y=this._getGroup(g),w=g[0];return d.fallback&&g.index!==n?(this.queuedGroup=y,this.queuedText=w,this._token(d,u.slice(n,g.index),n)):this._token(y,w,n)}},_.prototype._token=function(n,o,u){var f=0;if(n.lineBreaks){var g=/\n/g,d=1;if(o===`
|
|
6
|
+
`)f=1;else for(;g.exec(o);)f++,d=g.lastIndex}var y={type:typeof n.type=="function"&&n.type(o)||n.defaultType,value:typeof n.value=="function"?n.value(o):o,text:o,toString:Ce,offset:u,lineBreaks:f,line:this.line,col:this.col},w=o.length;if(this.index+=w,this.line+=f,f!==0?this.col=w-d+1:this.col+=w,n.shouldThrow){var m=new Error(this.formatError(y,"invalid syntax"));throw m}return n.pop?this.popState():n.push?this.pushState(n.push):n.next&&this.setState(n.next),y},typeof Symbol<"u"&&Symbol.iterator){var X=a(function(n){this.lexer=n},"LexerIterator");X.prototype.next=function(){var n=this.lexer.next();return{value:n,done:!n}},X.prototype[Symbol.iterator]=function(){return this},_.prototype[Symbol.iterator]=function(){return new X(this)}}return _.prototype.formatError=function(n,o){if(n==null)var u=this.buffer.slice(this.index),n={text:u,offset:this.index,lineBreaks:u.indexOf(`
|
|
7
|
+
`)===-1?0:1,line:this.line,col:this.col};var f=2,g=Math.max(n.line-f,1),d=n.line+f,y=String(d).length,w=$(this.buffer,this.line-n.line+f+1).slice(0,5),m=[];m.push(o+" at line "+n.line+" col "+n.col+":"),m.push("");for(var p=0;p<w.length;p++){var b=w[p],q=g+p;m.push(k(String(q),y)+" "+b),q===n.line&&m.push(k("",y+n.col+1)+"^")}return m.join(`
|
|
8
|
+
`)},_.prototype.clone=function(){return new _(this.states,this.state)},_.prototype.has=function(n){return!0},{compile:Q,states:Be,error:Object.freeze({error:!0}),fallback:Object.freeze({fallback:!0}),keywords:De}})});var pe=ee(A=>{"use strict";var Fe=A&&A.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(A,"__esModule",{value:!0});A.lexer=A.states=void 0;var Ie=Fe(he());A.states={body:{doubleapos:{match:"''",value:a(()=>"'","value")},quoted:{lineBreaks:!0,match:/'[{}#](?:[^']|'')*'(?!')/u,value:a(e=>e.slice(1,-1).replace(/''/g,"'"),"value")},argument:{lineBreaks:!0,match:/\{\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*/u,push:"arg",value:a(e=>e.substring(1).trim(),"value")},octothorpe:"#",end:{match:"}",pop:1},content:{lineBreaks:!0,match:/[^][^{}#']*/u}},arg:{select:{lineBreaks:!0,match:/,\s*(?:plural|select|selectordinal)\s*,\s*/u,next:"select",value:a(e=>e.split(",")[1].trim(),"value")},"func-args":{lineBreaks:!0,match:/,\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*,/u,next:"body",value:a(e=>e.split(",")[1].trim(),"value")},"func-simple":{lineBreaks:!0,match:/,\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*/u,value:a(e=>e.substring(1).trim(),"value")},end:{match:"}",pop:1}},select:{offset:{lineBreaks:!0,match:/\s*offset\s*:\s*\d+\s*/u,value:a(e=>e.split(":")[1].trim(),"value")},case:{lineBreaks:!0,match:/\s*(?:=\d+|[^\p{Pat_Syn}\p{Pat_WS}]+)\s*\{/u,push:"body",value:a(e=>e.substring(0,e.indexOf("{")).trim(),"value")},end:{match:/\s*\}/u,pop:1}}};A.lexer=Ie.default.states(A.states)});var me=ee(z=>{"use strict";Object.defineProperty(z,"__esModule",{value:!0});z.ParseError=void 0;z.parse=Ue;var ye=pe(),j=a(e=>({offset:e.offset,line:e.line,col:e.col,text:e.text,lineBreaks:e.lineBreaks}),"getContext"),te=a(e=>e==="plural"||e==="select"||e==="selectordinal","isSelectType");function Re(e,t){let r="",s="";for(let l of t){let c=l.ctx.text;switch(s+=c,l.type){case"content":r+=l.value;break;case"argument":case"function":case"octothorpe":r+=c;break;default:throw new x(e,`Unsupported part in strict mode function arg style: ${c}`)}}return[{type:"content",value:r.trim(),ctx:Object.assign({},t[0].ctx,{text:s})}]}a(Re,"strictArgStyleParam");var Le=["number","date","time","spellout","ordinal","duration"],ge=["zero","one","two","few","many","other"],x=class extends Error{static{a(this,"ParseError")}constructor(t,r){super(ye.lexer.formatError(t,r))}};z.ParseError=x;var re=class{static{a(this,"Parser")}constructor(t,r){var s,i,l,c;this.lexer=ye.lexer.reset(t),this.cardinalKeys=(s=r?.cardinal)!==null&&s!==void 0?s:ge,this.ordinalKeys=(i=r?.ordinal)!==null&&i!==void 0?i:ge,this.strict=(l=r?.strict)!==null&&l!==void 0?l:!1,this.strictPluralKeys=(c=r?.strictPluralKeys)!==null&&c!==void 0?c:!0}parse(){return this.parseBody(!1,!0)}checkSelectKey(t,r,s){if(s[0]==="="){if(r==="select")throw new x(t,`The case ${s} is not valid with select`)}else if(r!=="select"){let i=r==="plural"?this.cardinalKeys:this.ordinalKeys;if(this.strictPluralKeys&&i.length>0&&!i.includes(s)){let l=`The ${r} case ${s} is not valid in this locale`;throw new x(t,l)}}}parseSelect({value:t},r,s,i){let l={type:i,arg:t,cases:[],ctx:s};i==="plural"||i==="selectordinal"?r=!0:this.strict&&(r=!1);for(let c of this.lexer)switch(c.type){case"offset":if(i==="select")throw new x(c,"Unexpected plural offset for select");if(l.cases.length>0)throw new x(c,"Plural offset must be set before cases");l.pluralOffset=Number(c.value),s.text+=c.text,s.lineBreaks+=c.lineBreaks;break;case"case":{this.checkSelectKey(c,i,c.value),l.cases.push({key:c.value,tokens:this.parseBody(r),ctx:j(c)});break}case"end":return l;default:throw new x(c,`Unexpected lexer token: ${c.type}`)}throw new x(null,"Unexpected message end")}parseArgToken(t,r){let s=j(t),i=this.lexer.next();if(!i)throw new x(null,"Unexpected message end");if(s.text+=i.text,s.lineBreaks+=i.lineBreaks,this.strict&&(i.type==="func-simple"||i.type==="func-args")&&!Le.includes(i.value)){let l=`Invalid strict mode function arg type: ${i.value}`;throw new x(t,l)}switch(i.type){case"end":return{type:"argument",arg:t.value,ctx:s};case"func-simple":{let l=this.lexer.next();if(!l)throw new x(null,"Unexpected message end");if(l.type!=="end")throw new x(l,`Unexpected lexer token: ${l.type}`);if(s.text+=l.text,te(i.value.toLowerCase()))throw new x(i,`Invalid type identifier: ${i.value}`);return{type:"function",arg:t.value,key:i.value,ctx:s}}case"func-args":{if(te(i.value.toLowerCase())){let c=`Invalid type identifier: ${i.value}`;throw new x(i,c)}let l=this.parseBody(this.strict?!1:r);return this.strict&&l.length>0&&(l=Re(t,l)),{type:"function",arg:t.value,key:i.value,param:l,ctx:s}}case"select":if(te(i.value))return this.parseSelect(t,r,s,i.value);throw new x(i,`Unexpected select type ${i.value}`);default:throw new x(i,`Unexpected lexer token: ${i.type}`)}}parseBody(t,r){let s=[],i=null;for(let l of this.lexer)if(l.type==="argument")i&&(i=null),s.push(this.parseArgToken(l,t));else if(l.type==="octothorpe"&&t)i&&(i=null),s.push({type:"octothorpe",ctx:j(l)});else{if(l.type==="end"&&!r)return s;{let c=l.value;if(!t&&l.type==="quoted"&&c[0]==="#"){if(c.includes("{")){let h=`Unsupported escape pattern: ${c}`;throw new x(l,h)}c=l.text}i?(i.value+=c,i.ctx.text+=l.text,i.ctx.lineBreaks+=l.lineBreaks):(i={type:"content",value:c,ctx:j(l)},s.push(i))}}if(r)return s;throw new x(null,"Unexpected message end")}};function Ue(e,t={}){return new re(e,t).parse()}a(Ue,"parse")});var xe=fe(me(),1);var E=class extends Error{static{a(this,"DateFormatError")}constructor(t,r,s){super(t),this.token=r,this.type=s||"error"}},ve=a(e=>e<4?"short":e===4?"long":"narrow","alpha"),G=a(e=>e%2===0?"2-digit":"numeric","numeric");function ze(e,t){switch(e.char){case"y":return{year:G(e.width)};case"r":return{calendar:"gregory",year:"numeric"};default:return t(`${e.desc} is not supported; falling back to year:numeric`,E.WARNING),{year:"numeric"}}}a(ze,"yearOptions");function Ge(e,t){switch(e.width){case 1:return"numeric";case 2:return"2-digit";case 3:return"short";case 4:return"long";case 5:return"narrow";default:t(`${e.desc} is not supported with width ${e.width}`);return}}a(Ge,"monthStyle");function Ke(e,t){let{char:r,desc:s,width:i}=e;if(r==="d")return G(i);t(`${s} is not supported`)}a(Ke,"dayStyle");function We(e,t){let{char:r,desc:s,width:i}=e;if((r==="c"||r==="e")&&i<3){let l=`Numeric value is not supported for ${s}; falling back to weekday:short`;t(l,E.WARNING)}return ve(i)}a(We,"weekdayStyle");function He(e){let t=G(e.width),r;switch(e.char){case"h":r="h12";break;case"H":r="h23";break;case"k":r="h24";break;case"K":r="h11";break}return r?{hour:t,hourCycle:r}:{hour:t}}a(He,"hourOptions");function je(e,t){let{char:r,desc:s,width:i}=e;switch(r){case"v":case"z":return i===4?"long":"short";case"V":if(i===4)return"long";t(`${s} is not supported with width ${i}`);return;case"X":t(`${s} is not supported`);return}return"short"}a(je,"timeZoneNameStyle");function Ze(e,t){switch(e.field){case"era":return{era:ve(e.width)};case"year":return ze(e,t);case"month":return{month:Ge(e,t)};case"day":return{day:Ke(e,t)};case"weekday":return{weekday:We(e,t)};case"period":return;case"hour":return He(e);case"min":return{minute:G(e.width)};case"sec":return{second:G(e.width)};case"tz":return{timeZoneName:je(e,t)};case"quarter":case"week":case"sec-frac":case"ms":t(`${e.desc} is not supported`)}}a(Ze,"compileOptions");function ne(e,t,r=s=>{throw s}){let s={timeZone:t},i=[];for(let l of e){let{error:c,field:h,str:v}=l;if(c){let k=new E(c.message,l);k.stack=c.stack,r(k)}if(v){let k=`Ignoring string part: ${v}`;r(new E(k,l,E.WARNING))}h&&(i.indexOf(h)===-1?i.push(h):r(new E(`Duplicate ${h} token`,l)));let S=Ze(l,(k,$)=>r(new E(k,l,$)));S&&Object.assign(s,S)}return s}a(ne,"getDateFormatOptions");var Je={G:{field:"era",desc:"Era"},y:{field:"year",desc:"Year"},Y:{field:"year",desc:'Year of "Week of Year"'},u:{field:"year",desc:"Extended year"},U:{field:"year",desc:"Cyclic year name"},r:{field:"year",desc:"Related Gregorian year"},Q:{field:"quarter",desc:"Quarter"},q:{field:"quarter",desc:"Stand-alone quarter"},M:{field:"month",desc:"Month in year"},L:{field:"month",desc:"Stand-alone month in year"},w:{field:"week",desc:"Week of year"},W:{field:"week",desc:"Week of month"},d:{field:"day",desc:"Day in month"},D:{field:"day",desc:"Day of year"},F:{field:"day",desc:"Day of week in month"},g:{field:"day",desc:"Modified julian day"},E:{field:"weekday",desc:"Day of week"},e:{field:"weekday",desc:"Local day of week"},c:{field:"weekday",desc:"Stand-alone local day of week"},a:{field:"period",desc:"AM/PM marker"},b:{field:"period",desc:"AM/PM/noon/midnight marker"},B:{field:"period",desc:"Flexible day period"},h:{field:"hour",desc:"Hour in AM/PM (1~12)"},H:{field:"hour",desc:"Hour in day (0~23)"},k:{field:"hour",desc:"Hour in day (1~24)"},K:{field:"hour",desc:"Hour in AM/PM (0~11)"},j:{field:"hour",desc:"Hour in preferred cycle"},J:{field:"hour",desc:"Hour in preferred cycle without marker"},C:{field:"hour",desc:"Hour in preferred cycle with flexible marker"},m:{field:"min",desc:"Minute in hour"},s:{field:"sec",desc:"Second in minute"},S:{field:"sec-frac",desc:"Fractional second"},A:{field:"ms",desc:"Milliseconds in day"},z:{field:"tz",desc:"Time Zone: specific non-location"},Z:{field:"tz",desc:"Time Zone"},O:{field:"tz",desc:"Time Zone: localized"},v:{field:"tz",desc:"Time Zone: generic non-location"},V:{field:"tz",desc:"Time Zone: ID"},X:{field:"tz",desc:"Time Zone: ISO8601 with Z"},x:{field:"tz",desc:"Time Zone: ISO8601"}},we=a(e=>e>="A"&&e<="Z"||e>="a"&&e<="z","isLetter");function Ve(e,t){let r=e[t],s=1;for(;e[++t]===r;)++s;let i=Je[r];if(!i){let l=`The letter ${r} is not a valid field identifier`;return{char:r,error:new Error(l),width:s}}return{char:r,field:i.field,desc:i.desc,width:s}}a(Ve,"readFieldToken");function Ye(e,t){let r=e[++t],s=2;if(r==="'")return{char:"'",str:r,width:s};for(;;){let i=e[++t];if(++s,i===void 0){let l=`Unterminated quoted literal in pattern: ${r||e}`;return{char:"'",error:new Error(l),str:r,width:s}}else if(i==="'"){if(e[++t]!=="'")return{char:"'",str:r,width:s};++s}r+=i}}a(Ye,"readQuotedToken");function Qe(e,t){let r=e[t];if(!r)return null;if(we(r))return Ve(e,t);if(r==="'")return Ye(e,t);let s=r,i=1;for(;;){let l=e[++t];if(!l||we(l)||l==="'")return{char:r,str:s,width:i};s+=l,i+=1}}a(Qe,"readToken");function Z(e){let t=[],r=0;for(;;){let s=Qe(e,r);if(!s)return t;t.push(s),r+=s.width}}a(Z,"parseDateTokens");function be(e,t){return e.filter(r=>r.type!=="content").length?e.map(r=>{if(r.type==="content")return t(r.value);if(r.type==="octothorpe")return"#";if(r.type==="argument")return[r.arg];if(r.type==="function"){let l=r?.param?.[0];if(r.key==="date"&&l){let c=Xe(l.value.trim(),h=>{throw new Error(`Unable to compile date expression: ${h.message}`)});return[r.arg,r.key,c]}return l?[r.arg,r.key,l.value.trim()]:[r.arg,r.key]}let s=r.pluralOffset,i={};return r.cases.forEach(({key:l,tokens:c})=>{let h=l[0]==="="?l.slice(1):l;i[h]=be(c,t)}),[r.arg,r.type,{offset:s,...i}]}):e.map(r=>t(r.value))}a(be,"processTokens");function Xe(e,t){if(/^::/.test(e)){let r=Z(e.substring(2));return ne(r,void 0,t)}return e}a(Xe,"compileDateExpression");function et(e,t=r=>r){return be((0,xe.parse)(e),t)}a(et,"compileMessageOrThrow");function _e(e,t=r=>r){try{return et(e,t)}catch(r){return console.error(`${r.message}
|
|
9
|
+
|
|
10
|
+
Message: ${e}`),[e]}}a(_e,"compileMessage");var B=a(e=>typeof e=="string","isString"),tt=a(e=>typeof e=="function","isFunction"),ke=new Map,Te="en";function oe(e){return[...Array.isArray(e)?e:[e],Te]}a(oe,"normalizeLocales");function le(e,t,r){let s=oe(e);r||(r="default");let i;if(typeof r=="string")switch(i={day:"numeric",month:"short",year:"numeric"},r){case"full":i.weekday="long";case"long":i.month="long";break;case"short":i.month="numeric";break}else i=r;return J(()=>V("date",s,r),()=>new Intl.DateTimeFormat(s,i)).format(B(t)?new Date(t):t)}a(le,"date");function rt(e,t,r){let s;if(r||(r="default"),typeof r=="string")switch(s={second:"numeric",minute:"numeric",hour:"numeric"},r){case"full":case"long":s.timeZoneName="short";break;case"short":delete s.second}else s=r;return le(e,t,s)}a(rt,"time");function se(e,t,r){let s=oe(e);return J(()=>V("number",s,r),()=>new Intl.NumberFormat(s,r)).format(t)}a(se,"number");function Se(e,t,r,{offset:s=0,...i}){let l=oe(e),c=t?J(()=>V("plural-ordinal",l),()=>new Intl.PluralRules(l,{type:"ordinal"})):J(()=>V("plural-cardinal",l),()=>new Intl.PluralRules(l,{type:"cardinal"}));return i[r]??i[c.select(r-s)]??i.other}a(Se,"plural");function J(e,t){let r=e(),s=ke.get(r);return s||(s=t(),ke.set(r,s)),s}a(J,"getMemoized");function V(e,t,r){let s=t.join("-");return`${e}-${s}-${JSON.stringify(r)}`}a(V,"cacheKey");var Ee=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,Oe=a(e=>e.replace(/\\u([a-fA-F0-9]{4})|\\x([a-fA-F0-9]{2})/g,(t,r,s)=>{if(r){let i=parseInt(r,16);return String.fromCharCode(i)}else{let i=parseInt(s,16);return String.fromCharCode(i)}}),"decodeEscapeSequences"),Ae="%__lingui_octothorpe__%",nt=a((e,t,r={})=>{let s=t||e,i=a(c=>typeof c=="object"?c:r[c],"style"),l=a((c,h)=>{let v=Object.keys(r).length?i("number"):void 0,S=se(s,c,v);return h.replace(new RegExp(Ae,"g"),S)},"replaceOctothorpe");return{plural:a((c,h)=>{let{offset:v=0}=h,S=Se(s,!1,c,h);return l(c-v,S)},"plural"),selectordinal:a((c,h)=>{let{offset:v=0}=h,S=Se(s,!0,c,h);return l(c-v,S)},"selectordinal"),select:st,number:a((c,h)=>se(s,c,i(h)||{style:h}),"number"),date:a((c,h)=>le(s,c,i(h)||h),"date"),time:a((c,h)=>rt(s,c,i(h)||h),"time")}},"getDefaultFormats"),st=a((e,t)=>t[e]??t.other,"selectFormatter");function it(e,t,r){return(s={},i)=>{let l=nt(t,r,i),c=a((v,S=!1)=>Array.isArray(v)?v.reduce((k,$)=>{if($==="#"&&S)return k+Ae;if(B($))return k+$;let[K,O,M]=$,D={};O==="plural"||O==="selectordinal"||O==="select"?Object.entries(M).forEach(([F,Q])=>{D[F]=c(Q,O==="plural"||O==="selectordinal")}):D=M;let N;if(O){let F=l[O];N=F(s[K],D)}else N=s[K];return N==null?k:k+N},""):v,"formatMessage"),h=c(e);return B(h)&&Ee.test(h)?Oe(h):B(h)?h:h?String(h):""}}a(it,"interpolate");var ie=class{static{a(this,"EventEmitter")}_events={};on(t,r){return this._events[t]??=new Set,this._events[t].add(r),()=>this.removeListener(t,r)}removeListener(t,r){let s=this._events[t];s?.delete(r),s?.size===0&&delete this._events[t]}emit(t,...r){let s=this._events[t];if(s)for(let i of[...s])i.apply(this,r)}},ae=class extends ie{static{a(this,"I18n")}_locale="";_locales;_messages={};_missing;_messageCompiler;constructor(t){super(),t.missing!=null&&(this._missing=t.missing),t.messages!=null&&this.load(t.messages),(typeof t.locale=="string"||t.locales)&&this.activate(t.locale??Te,t.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){return this._messages[this._locale]??{}}setMessagesCompiler(t){return this._messageCompiler=t,this}_load(t,r){let s=this._messages[t];s?Object.assign(s,r):this._messages[t]=r}load(t,r){typeof t=="string"&&typeof r=="object"?this._load(t,r):Object.entries(t).forEach(([s,i])=>this._load(s,i)),this.emit("change")}loadAndActivate({locale:t,locales:r,messages:s}){this._locale=t,this._locales=r||void 0,this._messages[this._locale]=s,this.emit("change")}activate(t,r){this._locale=t,this._locales=r,this.emit("change")}_(t,r,s){if(!this.locale)throw new Error("Lingui: Attempted to call a translation function without setting a locale.\nMake sure to call `i18n.activate(locale)` before using Lingui functions.\nThis issue may also occur due to a race condition in your initialization logic.");let i=s?.message;t||(t=""),B(t)||(r=t.values||r,i=t.message,t=t.id);let l=this.messages[t],c=l===void 0,h=this._missing;if(h&&c)return tt(h)?h(this._locale,t):h;c&&this.emit("missing",{id:t,locale:this._locale});let v=l||i||t;return B(v)&&(this._messageCompiler?v=this._messageCompiler(v):console.warn(`Uncompiled message detected! Message:
|
|
11
|
+
|
|
12
|
+
> ${v}
|
|
13
|
+
|
|
14
|
+
That means you use raw catalog or your catalog doesn't have a translation for the message and fallback was used.
|
|
15
|
+
ICU features such as interpolation and plurals will not work properly for that message.
|
|
16
|
+
|
|
17
|
+
Please compile your catalog first.
|
|
18
|
+
`)),B(v)&&Ee.test(v)?Oe(v):B(v)?v:it(v,this._locale,this._locales)(r,s?.formats)}t=this._.bind(this);date(t,r){return le(this._locales||this._locale,t,r)}number(t,r){return se(this._locales||this._locale,t,r)}};function ce(e={}){return new ae(e)}a(ce,"setupI18n");var Ft=ce();var Y=fe(Ne(),1);var at={},$e="en",ot={en:at},lt=a((e=$e,t=ot)=>{let r=ce();r.setMessagesCompiler(_e);for(let[s,i]of Object.entries(t))r.load(s,i);return r.activate(t[e]===void 0?$e:e),r},"d"),ct=lt(),ut=(0,Y.createContext)(ct),zt=a(()=>{let e=(0,Y.use)(ut);return(t,r)=>e._(t,r)},"T");var Wt=a((e,t,r,s,i)=>{switch(t){case"action":return e.action(r,s,i);case"mutation":return e.mutation(r,s,i);default:return e.query(r,s,i)}},"f"),Ht=a(e=>({__lunoraRef:e}),"u"),jt=a(e=>{let t=e.trim();return t===""?{}:{shardKey:t}},"d"),Zt=a(e=>e instanceof Error?e.message:String(e),"g"),Jt=a(e=>{if(e===null||typeof e!="object"||!("code"in e))return;let{code:t}=e;return typeof t=="string"?t:void 0},"l"),Vt=a(e=>{if(e===null||typeof e!="object"||!("hint"in e))return;let{hint:t}=e;return typeof t=="string"?t:Array.isArray(t)?t.filter(r=>typeof r=="string").join(`
|
|
19
|
+
`):void 0},"y"),Yt=a(e=>{if(e===null||typeof e!="object"||!("docsUrl"in e))return;let t=e.docsUrl;if(typeof t=="string")try{let{protocol:r}=new URL(t);return r==="http:"||r==="https:"?t:void 0}catch{return}},"h"),Me=a(e=>{if(e==null)return"\u2014";if(e<1024)return`${e.toString()} B`;let t=["KB","MB","GB","TB"],r=e/1024,s=0;for(;r>=1024&&s<t.length-1;)r/=1024,s+=1;return`${r.toFixed(1)} ${t[s]??"TB"}`},"e"),ft=a((e,t)=>typeof t=="bigint"?t.toString():t instanceof ArrayBuffer||ArrayBuffer.isView(t)?`<bytes: ${Me(t.byteLength)}>`:t,"s"),Qt=a(e=>typeof e=="bigint"?e.toString():e,"p"),Xt=a(e=>{if(e==null)return"";switch(typeof e){case"bigint":case"boolean":case"number":return e.toString();case"string":return e;case"symbol":return e.toString();default:return e instanceof ArrayBuffer||ArrayBuffer.isView(e)?`<bytes: ${Me(e.byteLength)}>`:JSON.stringify(e,ft)}},"b"),dt=a((e,t)=>{e.catch(r=>{t?.(r)})},"c"),ht=a(e=>{if(e!==void 0&&e!=="")return e;let t=globalThis.location;return t?.origin!==void 0&&t.origin!==""?t.origin:"http://localhost:5173"},"a"),er=a(e=>{let t=ht(e);for(;t.endsWith("/");)t=t.slice(0,-1);return t},"m"),tr=a(e=>{let t="navigator"in globalThis?globalThis.navigator.clipboard:void 0;return t===void 0?!1:(dt(t.writeText(e)),!0)},"B"),rr=a((e,t="")=>{if(e==null||e==="")return t;let r=new Date(e);return Number.isNaN(r.getTime())?String(e):r.toLocaleString()},"w");export{lt as a,ct as b,ut as c,zt as d,Wt as e,Ht as f,jt as g,Zt as h,Jt as i,Vt as j,Yt as k,Me as l,ft as m,Qt as n,Xt as o,dt as p,ht as q,er as r,tr as s,rr as t};
|