@lunora/studio 1.0.0-alpha.8 → 1.0.0-alpha.80
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/dist/index.d.ts +777 -780
- package/dist/index.js +1 -41
- package/dist/mount.d.ts +10 -10
- package/dist/mount.js +1 -26
- package/dist/packem_chunks/ApiTab.js +1 -0
- package/dist/packem_chunks/AuditPanel.js +1 -0
- package/dist/packem_chunks/DeploymentHealthPanel.js +1 -0
- package/dist/packem_chunks/ExportImportPanel.js +3 -0
- package/dist/packem_chunks/FileBrowser.js +4 -0
- package/dist/packem_chunks/FunctionRunner.js +1 -0
- package/dist/packem_chunks/FunctionStatsPanel.js +1 -0
- package/dist/packem_chunks/HealthPanel.js +1 -0
- package/dist/packem_chunks/InsightsPanel.js +1 -0
- package/dist/packem_chunks/LogsPanel.js +1 -0
- package/dist/packem_chunks/MailPanel.js +2 -0
- package/dist/packem_chunks/MetricsPanel.js +1 -0
- package/dist/packem_chunks/NotificationsPanel.js +1 -0
- package/dist/packem_chunks/PitrPanel.js +1 -0
- package/dist/packem_chunks/SchemaViewer.js +1 -0
- package/dist/packem_chunks/SecurityAdvisorPanel.js +1 -0
- package/dist/packem_chunks/SettingsPanel.js +1 -0
- package/dist/packem_chunks/SqlEditorPanel.js +6 -0
- package/dist/packem_chunks/TableEditor.js +1 -0
- package/dist/packem_chunks/agents-panel.js +1 -0
- package/dist/packem_chunks/analytics-panel.js +1 -0
- package/dist/packem_chunks/auth-audit-panel.js +1 -0
- package/dist/packem_chunks/auth-config-panel.js +1 -0
- package/dist/packem_chunks/auth-sessions-panel.js +1 -0
- package/dist/packem_chunks/containers-panel.js +1 -0
- package/dist/packem_chunks/dashboards-panel.js +1 -0
- package/dist/packem_chunks/fanout-panel.js +1 -0
- package/dist/packem_chunks/flags-panel.js +1 -0
- package/dist/packem_chunks/issues-panel.js +1 -0
- package/dist/packem_chunks/kv-browser.js +1 -0
- package/dist/packem_chunks/log-drains-panel.js +4 -0
- package/dist/packem_chunks/migrations-route.js +1 -0
- package/dist/packem_chunks/organizations-panel.js +1 -0
- package/dist/packem_chunks/payments-panel.js +1 -0
- package/dist/packem_chunks/permissions-panel.js +1 -0
- package/dist/packem_chunks/queues-panel.js +1 -0
- package/dist/packem_chunks/rls-panel.js +1 -0
- package/dist/packem_chunks/schedule-panel.js +1 -0
- package/dist/packem_chunks/sparkline.js +1 -0
- package/dist/packem_chunks/storage-rules-panel.js +1 -0
- package/dist/packem_chunks/subscriptions-panel.js +1 -0
- package/dist/packem_chunks/sync-client-panel.js +1 -0
- package/dist/packem_chunks/traces-panel.js +1 -0
- package/dist/packem_chunks/users-panel.js +1 -0
- package/dist/packem_chunks/vector-browser.js +1 -0
- package/dist/packem_chunks/workflows-panel.js +1 -0
- package/dist/packem_shared/ADMIN_FUNCTIONS-BnD4aovm.js +1 -0
- package/dist/packem_shared/ApiDocsPanel-DfUQ1ZAF.js +2 -0
- package/dist/packem_shared/ApiReferencePanel-9q8BbJl-.js +1 -0
- package/dist/packem_shared/CommandPalette--SQwfTW1.js +1 -0
- package/dist/packem_shared/ConfirmButton-CTL3f3kr.js +1 -0
- package/dist/packem_shared/ConnectionBadge-DOk0CQWo.js +1 -0
- package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-BCC8_4BQ.js +1 -0
- package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-B-hcFVoi.js +1 -0
- package/dist/packem_shared/DEFAULT_LOCALE-BZ4NojpD.js +1 -0
- package/dist/packem_shared/DataBrowser-CuRlztBz.js +1 -0
- package/dist/packem_shared/DataFilters-B26ZeqBZ.js +1 -0
- package/dist/packem_shared/ErrorBoundary-DvzYskH7.js +1 -0
- package/dist/packem_shared/GlobalDataBrowser-DB-vQ2_H.js +1 -0
- package/dist/packem_shared/HomePanel-Dcs4a3Ax.js +1 -0
- package/dist/packem_shared/MigrationsPanel-C2OnsqRb.js +1 -0
- package/dist/packem_shared/OpenRpcReferencePanel-qOZcWXMs.js +1 -0
- package/dist/packem_shared/STUDIO_ROOT_CLASS-C6MccdVk.js +1 -0
- package/dist/packem_shared/ScheduledJobs-D8kBZWBu.js +1 -0
- package/dist/packem_shared/ShardInput-BVn2iCU0.js +1 -0
- package/dist/packem_shared/Studio-B26_pT8J.js +1 -0
- package/dist/packem_shared/StudioApp-bXhJeLlZ.js +1 -0
- package/dist/packem_shared/StudioI18nProvider-CZ5h4nrV.js +1 -0
- package/dist/packem_shared/advisor-view-Pa8HLtBv.js +1 -0
- package/dist/packem_shared/aggregateMetrics-BNfajLa2.js +1 -0
- package/dist/packem_shared/alert-CVcOFuDR.js +1 -0
- package/dist/packem_shared/app.d-DW7yZsfu.d.ts +252 -0
- package/dist/packem_shared/badge-BbuuAio7.js +1 -0
- package/dist/packem_shared/bar-chart-DraN_srt.js +9 -0
- package/dist/packem_shared/browser-storage-xjTyMKY0.js +1 -0
- package/dist/packem_shared/button-BkCrNcAs.js +1 -0
- package/dist/packem_shared/card-CIDGUN6K.js +1 -0
- package/dist/packem_shared/cf-links-gbDy51nR.js +1 -0
- package/dist/packem_shared/checkbox-StT4Gob6.js +1 -0
- package/dist/packem_shared/data-grid-DcxyIXwG.js +1 -0
- package/dist/packem_shared/data-view-params-ClrV7XgF.js +1 -0
- package/dist/packem_shared/dropdown-menu-C3RQ_HlW.js +2 -0
- package/dist/packem_shared/empty-state-Cg7t_8qu.js +1 -0
- package/dist/packem_shared/error-alert-t6cpEi0z.js +1 -0
- package/dist/packem_shared/grid-features-jnrD0SpX.js +6 -0
- package/dist/packem_shared/home-panel-CU6MWLHG.js +3 -0
- package/dist/packem_shared/input-JHu63lTv.js +1 -0
- package/dist/packem_shared/internal-BSIsQVC6.js +2 -0
- package/dist/packem_shared/label-6uP1obNF.js +1 -0
- package/dist/packem_shared/live-status-CmuRLFKf.js +1 -0
- package/dist/packem_shared/log-fields-CoL3hsIQ.js +1 -0
- package/dist/packem_shared/modal-shell-CUwwWC2o.js +1 -0
- package/dist/packem_shared/operation-console-provider-BMJNtiyB.js +1 -0
- package/dist/packem_shared/recording-client-DRAZEmzE.js +1 -0
- package/dist/packem_shared/reference-view-DnYYWr7I.js +12 -0
- package/dist/packem_shared/result-chart-DzJOVsaw.js +1 -0
- package/dist/packem_shared/schema-diagram-cg-bz_VL.js +2 -0
- package/dist/packem_shared/scroll-area-DTEq6Jec.js +2 -0
- package/dist/packem_shared/select-Bul-DeII.js +2 -0
- package/dist/packem_shared/shard-history-DMEW5VBE.js +1 -0
- package/dist/packem_shared/skeleton-C1wQ9M5t.js +1 -0
- package/dist/packem_shared/sparkline-CgjeUU2I.js +1 -0
- package/dist/packem_shared/storage-tier-DznqOf-q.js +1 -0
- package/dist/packem_shared/studio-q-C-acL7.js +2 -0
- package/dist/packem_shared/table-DdJBrClo.js +2 -0
- package/dist/packem_shared/table-list-sidebar-BFkSQwlB.js +1 -0
- package/dist/packem_shared/textarea-Bu2-jKAs.js +1 -0
- package/dist/packem_shared/trace-handoff-Dw7mwjxu.js +1 -0
- package/dist/packem_shared/use-admin-query-QJ-ibl5u.js +1 -0
- package/dist/packem_shared/use-async-submit-q3ymBJkD.js +1 -0
- package/dist/packem_shared/use-auth-config-BObBpdsi.js +1 -0
- package/dist/packem_shared/use-sql-assistant-CHEu2-Rk.js +1 -0
- package/dist/packem_shared/useDebounced-Ihdiid_k.js +1 -0
- package/dist/packem_shared/utils-bhneXptQ.js +1 -0
- package/dist/packem_shared/virtual-rect-1o1veP7R.js +1 -0
- package/dist/standalone/chunk-2GA4SHO7.js +1 -0
- package/dist/standalone/chunk-2OUPA2WJ.js +1 -0
- package/dist/standalone/chunk-2PJNAWB3.js +1 -0
- package/dist/standalone/chunk-2VDFV5TD.js +1 -0
- package/dist/standalone/chunk-2WOIRKEI.js +1 -0
- package/dist/standalone/chunk-33CL6OHR.js +1 -0
- package/dist/standalone/chunk-34D36UCW.js +1 -0
- package/dist/standalone/chunk-3C3CG7ZK.js +1 -0
- package/dist/standalone/chunk-3O3HAXW7.js +1 -0
- package/dist/standalone/chunk-3STOIE7Q.js +1 -0
- package/dist/standalone/chunk-3XIESWL4.js +1 -0
- package/dist/standalone/chunk-4UOFSGUS.js +1 -0
- package/dist/standalone/chunk-53WEPGUD.js +1 -0
- package/dist/standalone/chunk-54MMVNPT.js +1 -0
- package/dist/standalone/chunk-5CVJS7ON.js +1 -0
- package/dist/standalone/chunk-5Y3QLNWX.js +1 -0
- package/dist/standalone/chunk-6IKEW5LG.js +1 -0
- package/dist/standalone/chunk-6LNCYDZO.js +1 -0
- package/dist/standalone/chunk-6NY7SPDL.js +1 -0
- package/dist/standalone/chunk-6PNPIW6I.js +2 -0
- package/dist/standalone/chunk-6ST5ECQA.js +1 -0
- package/dist/standalone/chunk-6VAKZALJ.js +1 -0
- package/dist/standalone/chunk-6YI4WJO4.js +1 -0
- package/dist/standalone/chunk-6YTSSIEJ.js +3 -0
- package/dist/standalone/chunk-7LWMHTJ3.js +1 -0
- package/dist/standalone/chunk-7QIFDWQV.js +1 -0
- package/dist/standalone/chunk-7T7UOTYK.js +1 -0
- package/dist/standalone/chunk-A74VSSA2.js +4 -0
- package/dist/standalone/chunk-AADILRJW.js +14 -0
- package/dist/standalone/chunk-AVAC26HJ.js +1 -0
- package/dist/standalone/chunk-BGBLQ563.js +1 -0
- package/dist/standalone/chunk-CCVXYYPJ.js +1 -0
- package/dist/standalone/chunk-CFPZYHPY.js +2 -0
- package/dist/standalone/chunk-CT5MMH4O.js +1 -0
- package/dist/standalone/chunk-CTNB2KIA.js +1 -0
- package/dist/standalone/chunk-CU55Y5TV.js +62 -0
- package/dist/standalone/chunk-D2RKH6JK.js +1 -0
- package/dist/standalone/chunk-E3NMX2VU.js +4 -0
- package/dist/standalone/chunk-EN2QAEO4.js +11 -0
- package/dist/standalone/chunk-ESVP44Y3.js +1 -0
- package/dist/standalone/chunk-FNPJ7GJZ.js +1 -0
- package/dist/standalone/chunk-FOBRNWBG.js +3 -0
- package/dist/standalone/chunk-FXCBF4XT.js +1 -0
- package/dist/standalone/chunk-G6PSMGLD.js +1 -0
- package/dist/standalone/chunk-GAX5IZYG.js +8 -0
- package/dist/standalone/chunk-GB6U2BPU.js +1 -0
- package/dist/standalone/chunk-GEDMLM4A.js +6 -0
- package/dist/standalone/chunk-GMR677FL.js +1 -0
- package/dist/standalone/chunk-GRL5MG3Z.js +1 -0
- package/dist/standalone/chunk-GXSZH7VJ.js +13 -0
- package/dist/standalone/chunk-GYKVBKT5.js +1 -0
- package/dist/standalone/chunk-H6YOWRFB.js +1 -0
- package/dist/standalone/chunk-HJ3E4YF5.js +1 -0
- package/dist/standalone/chunk-HJD2YUQS.js +1 -0
- package/dist/standalone/chunk-HPFLBYRI.js +1 -0
- package/dist/standalone/chunk-IC4L6G56.js +1 -0
- package/dist/standalone/chunk-IHQC7J35.js +1 -0
- package/dist/standalone/chunk-ILNELDFC.js +1 -0
- package/dist/standalone/chunk-IVFHIQOT.js +1 -0
- package/dist/standalone/chunk-JLOWAJRR.js +1 -0
- package/dist/standalone/chunk-JN2Y24PY.js +1 -0
- package/dist/standalone/chunk-JRMMYIAF.js +1 -0
- package/dist/standalone/chunk-KC44QCN6.js +1 -0
- package/dist/standalone/chunk-KJB7YAKB.js +1 -0
- package/dist/standalone/chunk-KLQYC6CC.js +1 -0
- package/dist/standalone/chunk-KUVMORDQ.js +1 -0
- package/dist/standalone/chunk-KZ3ALMMP.js +1 -0
- package/dist/standalone/chunk-L7R74G63.js +1 -0
- package/dist/standalone/chunk-LEDWUPXM.js +1 -0
- package/dist/standalone/chunk-LFKCLLPT.js +1 -0
- package/dist/standalone/chunk-MIQTKZAR.js +1 -0
- package/dist/standalone/chunk-OG4N2XHD.js +19 -0
- package/dist/standalone/chunk-OY2RVUZL.js +1 -0
- package/dist/standalone/chunk-P4YLIBCN.js +1 -0
- package/dist/standalone/chunk-PZVU2QMX.js +1 -0
- package/dist/standalone/chunk-Q7O6B7WC.js +1 -0
- package/dist/standalone/chunk-QBWRC5YX.js +1 -0
- package/dist/standalone/chunk-QLQADHFE.js +1 -0
- package/dist/standalone/chunk-QWGT25SE.js +1 -0
- package/dist/standalone/chunk-QXXIJAD5.js +1 -0
- package/dist/standalone/chunk-QZGTH6WH.js +1 -0
- package/dist/standalone/chunk-RJP3WBZ4.js +1 -0
- package/dist/standalone/chunk-RNL6BSFM.js +1 -0
- package/dist/standalone/chunk-RNRJKBY3.js +4 -0
- package/dist/standalone/chunk-RQ7AFLIV.js +1 -0
- package/dist/standalone/chunk-S252DAFP.js +1 -0
- package/dist/standalone/chunk-S2VVR7HI.js +1 -0
- package/dist/standalone/chunk-SD4BERSA.js +1 -0
- package/dist/standalone/chunk-SFDOII3B.js +1 -0
- package/dist/standalone/chunk-SKHEGARW.js +1 -0
- package/dist/standalone/chunk-SKW6J4VW.js +1 -0
- package/dist/standalone/chunk-SMIESS7P.js +1 -0
- package/dist/standalone/chunk-T6VMSOBB.js +1 -0
- package/dist/standalone/chunk-T7IUZIF4.js +1 -0
- package/dist/standalone/chunk-THIXMMZD.js +1 -0
- package/dist/standalone/chunk-TTGOOYLF.js +1 -0
- package/dist/standalone/chunk-U6TNNM5U.js +1 -0
- package/dist/standalone/chunk-UZERI5YC.js +1 -0
- package/dist/standalone/chunk-V53KNYRN.js +1 -0
- package/dist/standalone/chunk-VHWOCPRK.js +1 -0
- package/dist/standalone/chunk-W6SAOXGH.js +6 -0
- package/dist/standalone/chunk-WBYSSCV2.js +1 -0
- package/dist/standalone/chunk-X665E2HU.js +1 -0
- package/dist/standalone/chunk-XBDKZZ67.js +1 -0
- package/dist/standalone/chunk-XDAT7LHC.js +1 -0
- package/dist/standalone/chunk-XQCVZAGU.js +1 -0
- package/dist/standalone/chunk-XS5LDR52.js +1 -0
- package/dist/standalone/chunk-XXQUMVWH.js +1 -0
- package/dist/standalone/chunk-Y5Y7DHFW.js +1 -0
- package/dist/standalone/chunk-YJYTMQJI.js +1 -0
- package/dist/standalone/chunk-Z2V42P7J.js +1 -0
- package/dist/standalone/chunk-ZJGP6EKR.js +1 -0
- package/dist/standalone/studio.js +9 -356
- package/dist/styles.css +2 -2
- package/package.json +16 -14
- package/dist/packem_shared/ADMIN_FUNCTIONS-DjXgvJb6.js +0 -46
- package/dist/packem_shared/ApiDocsPanel-yVSGHK3H.js +0 -842
- package/dist/packem_shared/ApiReferencePanel-1vubqG5s.js +0 -229
- package/dist/packem_shared/ApiTab-rwttyQ1-.js +0 -251
- package/dist/packem_shared/AuditPanel-BqXZAsu_.js +0 -212
- 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-Ck_7QwNK.js +0 -4542
- package/dist/packem_shared/DataFilters-FNquMaiu.js +0 -249
- package/dist/packem_shared/ErrorBoundary-BzAApI7J.js +0 -66
- package/dist/packem_shared/ExportImportPanel-Dq6rj0tI.js +0 -193
- package/dist/packem_shared/FileBrowser-0pCpdKPE.js +0 -2932
- package/dist/packem_shared/FunctionRunner-7NH3KcTg.js +0 -343
- package/dist/packem_shared/FunctionStatsPanel-Cn_EBpDy.js +0 -432
- package/dist/packem_shared/GlobalDataBrowser-BTEmGrph.js +0 -318
- package/dist/packem_shared/HealthPanel-CQ4LzVET.js +0 -640
- package/dist/packem_shared/HomePanel-CP0lN1eF.js +0 -1273
- package/dist/packem_shared/InsightsPanel-DzNtoz7k.js +0 -423
- package/dist/packem_shared/LogsPanel-C3W0mabf.js +0 -839
- package/dist/packem_shared/MailPanel-CoEfWkCh.js +0 -447
- package/dist/packem_shared/MetricsPanel-CujtUfpl.js +0 -1625
- package/dist/packem_shared/MigrationsPanel-RX5qIFSr.js +0 -246
- package/dist/packem_shared/OpenRpcReferencePanel-vbcYbv3V.js +0 -191
- package/dist/packem_shared/PitrPanel-LJGNP_IX.js +0 -252
- package/dist/packem_shared/STUDIO_ROOT_CLASS-D12gX2dV.js +0 -3
- package/dist/packem_shared/ScheduledJobs-CabfKbyM.js +0 -159
- package/dist/packem_shared/SchemaViewer-Bam6ylvw.js +0 -2512
- package/dist/packem_shared/SecurityAdvisorPanel-DHr_bI38.js +0 -79
- package/dist/packem_shared/SettingsPanel-CBXQpYQA.js +0 -176
- package/dist/packem_shared/ShardInput-gx_DZXXn.js +0 -107
- package/dist/packem_shared/SqlEditorPanel-D5wMIxcg.js +0 -13
- package/dist/packem_shared/Studio-DkgODWD3.js +0 -33
- package/dist/packem_shared/StudioApp-ColQCvC_.js +0 -657
- package/dist/packem_shared/StudioI18nProvider-B-tDCZIi.js +0 -48
- package/dist/packem_shared/TableEditor-B8K5nUna.js +0 -371
- 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-Nbhpihxv.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-Smfl_FDF.js +0 -2562
- package/dist/packem_shared/storage-tier-CL98eOvn.js +0 -85
- package/dist/packem_shared/studio-Be28OqIx.js +0 -10413
- package/dist/packem_shared/table-_RzNvy3R.js +0 -246
- 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-live-admin-Dq6g3daN.js +0 -73
- package/dist/packem_shared/use-live-shard-seed-Cuk3dnH0.js +0 -76
- 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,9 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import{c as N}from"react/compiler-runtime";import{LunoraError as le}from"@lunora/errors";import{useMotionValue as re,useSpring as pe,useTransform as Z,useMotionValueEvent as ge,motion as V,useReducedMotion as Ue}from"motion/react";import*as K from"react";import{useId as se,useEffect as ie,useState as Q,use as ze,createContext as Be,useRef as Le}from"react";import*as ve from"recharts";import{ZIndexLayer as Ae,ResponsiveContainer as ne,LineChart as Ke,Line as De,BarChart as ke,Bar as de,AreaChart as Re,Area as Te,ReferenceLine as je,Rectangle as ae,XAxis as Ge}from"recharts";import{jsx as n,jsxs as k,Fragment as B}from"react/jsx-runtime";import{c as T}from"./utils-bhneXptQ.js";const Pe=i=>{const e=N(3),{id:r}=i;let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n("circle",{className:"text-border dark:text-border",cx:"2",cy:"2",fill:"currentColor",r:"1"}),e[0]=t):t=e[0];let a;return e[1]!==r?(a=n("pattern",{height:"20",id:r,patternUnits:"userSpaceOnUse",width:"20",x:"0",y:"0",children:t}),e[1]=r,e[2]=a):a=e[2],a},He=i=>{const e=N(3),{id:r}=i;let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n("path",{className:"text-border dark:text-border",d:"M 20 0 L 0 0 0 20",fill:"none",stroke:"currentColor",strokeWidth:"0.5"}),e[0]=t):t=e[0];let a;return e[1]!==r?(a=n("pattern",{height:"20",id:r,patternUnits:"userSpaceOnUse",width:"20",x:"0",y:"0",children:t}),e[1]=r,e[2]=a):a=e[2],a},Ee=i=>{const e=N(3),{id:r}=i;let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n("path",{className:"text-border/60 dark:text-border/50",d:"M 0 0 L 20 20 M 20 0 L 0 20",fill:"none",stroke:"currentColor",strokeWidth:"0.5"}),e[0]=t):t=e[0];let a;return e[1]!==r?(a=n("pattern",{height:"20",id:r,patternUnits:"userSpaceOnUse",width:"20",x:"0",y:"0",children:t}),e[1]=r,e[2]=a):a=e[2],a},Xe=i=>{const e=N(3),{id:r}=i;let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n("line",{className:"text-border dark:text-border",stroke:"currentColor",strokeWidth:"0.5",x1:"0",x2:"0",y1:"0",y2:"6"}),e[0]=t):t=e[0];let a;return e[1]!==r?(a=n("pattern",{height:"6",id:r,patternTransform:"rotate(45)",patternUnits:"userSpaceOnUse",width:"6",x:"0",y:"0",children:t}),e[1]=r,e[2]=a):a=e[2],a},Ve=i=>{const e=N(3),{id:r}=i;let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n("path",{className:"text-border dark:text-border",d:"M 8 4 L 8 12 M 4 8 L 12 8",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"0.5"}),e[0]=t):t=e[0];let a;return e[1]!==r?(a=n("pattern",{height:"16",id:r,patternUnits:"userSpaceOnUse",width:"16",x:"0",y:"0",children:t}),e[1]=r,e[2]=a):a=e[2],a},We=i=>{const e=N(3),{id:r}=i;let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n("path",{className:"text-border dark:text-border",d:"M2 6h12L8 18 2 6zm18 36h12l-6 12-6-12z",fill:"currentColor",fillOpacity:"0.4",transform:"scale(0.5)"}),e[0]=t):t=e[0];let a;return e[1]!==r?(a=n("pattern",{height:"36",id:r,patternUnits:"userSpaceOnUse",width:"18",x:"0",y:"0",children:t}),e[1]=r,e[2]=a):a=e[2],a},Fe=i=>{const e=N(3),{id:r}=i;let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n("polygon",{className:"text-border dark:text-border",fill:"currentColor",fillOpacity:"0.4",fillRule:"evenodd",points:"5 3 8 4 5 5 4 8 3 5 0 4 3 3 4 0 5 3"}),e[0]=t):t=e[0];let a;return e[1]!==r?(a=n("pattern",{height:"16",id:r,patternUnits:"userSpaceOnUse",width:"16",x:"0",y:"0",children:t}),e[1]=r,e[2]=a):a=e[2],a},Ye=i=>{const e=N(3),{id:r}=i;let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n("path",{className:"text-border dark:text-border",d:"M0 0h4v4H0V0zm4 4h4v4H4V4z",fill:"currentColor",fillOpacity:"0.2",fillRule:"evenodd"}),e[0]=t):t=e[0];let a;return e[1]!==r?(a=n("pattern",{height:"8",id:r,patternUnits:"userSpaceOnUse",width:"8",x:"0",y:"0",children:t}),e[1]=r,e[2]=a):a=e[2],a},qe=i=>{const e=N(3),{id:r}=i;let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n("path",{className:"text-border dark:text-border",d:"M25 25c0-2.762 2.238-5 5-5s5 2.238 5 5-2.238 5-5 5c0 2.762-2.238 5-5 5s-5-2.238-5-5 2.238-5 5-5zM5 5c0-2.762 2.238-5 5-5s5 2.238 5 5-2.238 5-5 5c0 2.762-2.238 5-5 5S0 12.762 0 10s2.238-5 5-5zm5 4c2.209 0 4-1.791 4-4s-1.791-4-4-4-4 1.791-4 4 1.791 4 4 4zm20 20c2.209 0 4-1.791 4-4s-1.791-4-4-4-4 1.791-4 4 1.791 4 4 4z",fill:"currentColor",fillOpacity:"0.4",fillRule:"evenodd"}),e[0]=t):t=e[0];let a;return e[1]!==r?(a=n("pattern",{height:"40",id:r,patternUnits:"userSpaceOnUse",width:"40",x:"0",y:"0",children:t}),e[1]=r,e[2]=a):a=e[2],a},Je=i=>{const e=N(3),{id:r}=i;let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n("path",{className:"text-border dark:text-border",d:"M10 10c0-2.21-1.79-4-4-4-3.314 0-6-2.686-6-6h2c0 2.21 1.79 4 4 4 3.314 0 6 2.686 6 6 0 2.21 1.79 4 4 4 3.314 0 6 2.686 6 6 0 2.21 1.79 4 4 4v2c-3.314 0-6-2.686-6-6 0-2.21-1.79-4-4-4-3.314 0-6-2.686-6-6zm25.464-1.95l8.486 8.486-1.414 1.414-8.486-8.486 1.414-1.414z",fill:"currentColor",fillOpacity:"0.4"}),e[0]=t):t=e[0];let a;return e[1]!==r?(a=n("pattern",{height:"26",id:r,patternTransform:"scale(0.6)",patternUnits:"userSpaceOnUse",width:"52",x:"0",y:"0",children:t}),e[1]=r,e[2]=a):a=e[2],a},Ze=i=>{const e=N(3),{id:r}=i;let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n("path",{className:"text-border dark:text-border",d:"M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z",fill:"currentColor",fillOpacity:"0.4",fillRule:"evenodd"}),e[0]=t):t=e[0];let a;return e[1]!==r?(a=n("pattern",{height:"100",id:r,patternTransform:"scale(0.6667)",patternUnits:"userSpaceOnUse",width:"100",x:"0",y:"0",children:t}),e[1]=r,e[2]=a):a=e[2],a},Qe={dots:Pe,grid:He,plus:Ve,bubbles:Ze,"cross-hatch":Ee,"diagonal-lines":Xe,"falling-triangles":We,"4-pointed-star":Fe,"tiny-checkers":Ye,"overlapping-circles":qe,"wiggle-lines":Je},et=i=>{const e=N(23),{variant:r}=i,t=se();let a;e[0]!==t?(a=t.replaceAll(":",""),e[0]=t,e[1]=a):a=e[1];const o=a,l=`${o}-bg-${r}`,s=`${o}-bg-edge-fade`,d=`${o}-bg-blur`,m=Qe[r];let u;e[2]!==m||e[3]!==l?(u=n(m,{id:l}),e[2]=m,e[3]=l,e[4]=u):u=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=n("feGaussianBlur",{stdDeviation:"25"}),e[5]=c):c=e[5];let f;e[6]!==d?(f=n("filter",{id:d,children:c}),e[6]=d,e[7]=f):f=e[7];const h=`url(#${d})`;let p;e[8]!==h?(p=n("rect",{fill:"white",filter:h,height:"60%",width:"85%",x:"8%",y:"20%"}),e[8]=h,e[9]=p):p=e[9];let g;e[10]!==s||e[11]!==p?(g=n("mask",{id:s,maskUnits:"userSpaceOnUse",children:p}),e[10]=s,e[11]=p,e[12]=g):g=e[12];let y;e[13]!==u||e[14]!==f||e[15]!==g?(y=k("defs",{children:[u,f,g]}),e[13]=u,e[14]=f,e[15]=g,e[16]=y):y=e[16];const x=`url(#${l})`,b=`url(#${s})`;let w;e[17]!==x||e[18]!==b?(w=n("rect",{fill:x,height:"100%",mask:b,width:"100%"}),e[17]=x,e[18]=b,e[19]=w):w=e[19];let $;return e[20]!==w||e[21]!==y?($=k(Ae,{zIndex:-1,children:[y,w]}),e[20]=w,e[21]=y,e[22]=$):$=e[22],$},we={light:"",dark:".dark"},oe=Object.keys(we);function tt(i){for(const[e,r]of Object.entries(i))if(r.colors&&!oe.some(t=>r.colors?.[t]!==void 0))throw new le("INTERNAL",`[EvilCharts] Invalid chart config for "${e}": colors object must have at least one theme key (${oe.join(", ")}). Received empty object or invalid keys.`)}const Ce=K.createContext(null);function rt(){const i=K.useContext(Ce);if(!i)throw new le("INTERNAL","useChart must be used within a <ChartContainer />");return i}const nt=({id:i,config:e,initialDimension:r={width:320,height:200},className:t,children:a,footer:o,...l})=>{const s=K.useId(),d=`chart-${i??s.replaceAll(":","")}`;return tt(e),n(Ce.Provider,{value:{config:e},children:k("div",{className:T("min-h-0 w-full flex-1","[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-axis-tick_text]:font-mono [&_.recharts-cartesian-axis-tick_text]:text-[11px] [&_.recharts-cartesian-axis-tick_text]:tracking-wide [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border relative flex flex-col justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden",!o&&"aspect-video",t),"data-chart":d,"data-slot":"chart",...l,children:[n(Se,{config:e,id:d}),n(ve.ResponsiveContainer,{className:"min-h-0 w-full flex-1",initialDimension:r,children:a}),o]})})},at=i=>{const e=N(1),{isLoading:r}=i;if(!r)return null;let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n("div",{className:"pointer-events-none absolute inset-0 z-20 flex items-center justify-center",children:k("div",{className:"text-primary bg-background flex items-center justify-center gap-2 rounded-md border px-2 py-0.5 text-sm",children:[n("div",{className:"border-border border-t-primary h-3 w-3 animate-spin rounded-full border"}),n("span",{children:"Loading"})]})}),e[0]=t):t=e[0],t};function it(i,e){const r=i.length;if(r>=e)return i.slice(0,e);const t=[],a=Math.floor(e/r),o=e%r;for(let l=0;l<r;l++){const s=l>=r-o,d=a+(s?1:0);for(let m=0;m<d;m++)t.push(i[l])}return t}const Se=i=>{const e=N(6),{id:r,config:t}=i;let a,o;if(e[0]!==t||e[1]!==r){o=Symbol.for("react.early_return_sentinel");e:{const d=Object.entries(t).filter(lt);if(d.length===0){o=null;break e}const m=u=>d.flatMap(c=>{const[f,h]=c,p=h.colors?.[u];if(!p||!Array.isArray(p)||p.length===0)return[];const g=W(h);return it(p,g).map((y,x)=>` --color-${f}-${x}: ${y};`)}).filter(Boolean).join(`
|
|
3
|
+
`);a=Object.entries(we).map(u=>{const[c,f]=u;return`${f} [data-chart=${r}] {
|
|
4
|
+
${m(c)}
|
|
5
|
+
}`})}e[0]=t,e[1]=r,e[2]=a,e[3]=o}else a=e[2],o=e[3];if(o!==Symbol.for("react.early_return_sentinel"))return o;const l=a.join(`
|
|
6
|
+
`);let s;return e[4]!==l?(s=n("style",{dangerouslySetInnerHTML:{__html:l}}),e[4]=l,e[5]=s):s=e[5],s};function ye(i,e,r){if(typeof e!="object"||e===null)return;const t="payload"in e&&typeof e.payload=="object"&&e.payload!==null?e.payload:void 0;let a=r;return r in e&&typeof e[r]=="string"?a=e[r]:t&&r in t&&typeof t[r]=="string"&&(a=t[r]),a in i?i[a]:i[r]}function W(i){if(!i.colors)return 1;const e=oe.map(r=>i.colors?.[r]?.length??0);return Math.max(...e,1)}const ot=(i=10,e=0,r=70)=>{const t=r-e;return Array.from({length:i},()=>({loading:Math.floor(Math.random()*t)+e}))};function lt(i){const[,e]=i;return e.colors}const xe={stiffness:300,damping:35,mass:.8};function st(i){const e=N(16),{range:r,totalPoints:t,containerRef:a,commit:o}=i,l=K.useRef(null),[s,d]=K.useState(!1);let m;e[0]!==a||e[1]!==t?(m=$=>!a.current||t<=1?0:Math.round($/a.current.getBoundingClientRect().width*(t-1)),e[0]=a,e[1]=t,e[2]=m):m=e[2];const u=m;let c;e[3]!==r?(c=($,v)=>{$.preventDefault(),$.target.setPointerCapture($.pointerId),l.current={type:v,originX:$.clientX,originRange:{...r}},d(!0)},e[3]=r,e[4]=c):c=e[4];const f=c;let h;e[5]!==o||e[6]!==u||e[7]!==t?(h=$=>{const v=l.current;if(!v)return;const I=u($.clientX-v.originX),{type:C,originRange:S}=v;if(C==="left")o({startIndex:S.startIndex+I,endIndex:S.endIndex},"left");else if(C==="right")o({startIndex:S.startIndex,endIndex:S.endIndex+I},"right");else{const M=S.endIndex-S.startIndex;let _=S.startIndex+I,O=_+M;_<0&&(_=0,O=M),O>t-1&&(O=t-1,_=Math.max(0,O-M)),o({startIndex:_,endIndex:O},"middle")}},e[5]=o,e[6]=u,e[7]=t,e[8]=h):h=e[8];const p=h;let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=$=>{$.target.releasePointerCapture($.pointerId),l.current=null,d(!1)},e[9]=g):g=e[9];const y=g;let x;e[10]!==f||e[11]!==p?(x=$=>({onPointerDown:v=>{f(v,$)},onPointerMove:p,onPointerUp:y}),e[10]=f,e[11]=p,e[12]=x):x=e[12];const b=x;let w;return e[13]!==b||e[14]!==s?(w={isDragging:s,bind:b},e[13]=b,e[14]=s,e[15]=w):w=e[15],w}const dt=({data:i,chartConfig:e,dataKeys:r,xDataKey:t,variant:a="area",height:o=56,className:l,stacked:s=!1,strokeVariant:d="solid",connectNulls:m=!1,barRadius:u,startIndex:c,endIndex:f,defaultStartIndex:h=0,defaultEndIndex:p,onChange:g,formatLabel:y,curveType:x="monotone",minSpan:b=2,showLabels:w=!0,skipStyle:$=!1})=>{const v=K.useRef(null),I=r??Object.keys(e),C=i.length,S=K.useId().replaceAll(":",""),M=c!==void 0&&f!==void 0,[_,O]=K.useState(()=>({startIndex:Math.max(0,Math.min(h,C-1)),endIndex:Math.max(0,Math.min(p??C-1,C-1))})),A=K.useRef(_);ie(()=>{if(!M){const U=Math.max(0,C-1),j={startIndex:Math.min(A.current.startIndex,U),endIndex:Math.min(A.current.endIndex,U)};A.current=j,O(j)}},[C,M]);const R=(U,j)=>{let{startIndex:z,endIndex:L}=U;const J=Math.max(0,C-1);if(z=Math.max(0,Math.min(z,J)),L=Math.max(0,Math.min(L,J)),j==="left"){const te=Math.max(0,L-b);return z=Math.min(z,te),{startIndex:z,endIndex:L}}if(j==="right"){const te=Math.min(J,z+b);return L=Math.max(L,te),{startIndex:z,endIndex:L}}return L-z<b&&(L=Math.min(z+b,J),L-z<b&&(z=Math.max(0,L-b))),{startIndex:z,endIndex:L}},D=(U,j)=>{const z=R(U,j),L=A.current;L.startIndex===z.startIndex&&L.endIndex===z.endIndex||(A.current=z,O(z),K.startTransition(()=>{g?.(z)}))},{isDragging:F,bind:H}=st({range:_,totalPoints:C,containerRef:v,commit:D}),P=_;ie(()=>{if(M&&!F){const U={startIndex:c,endIndex:f};O(U),A.current=U}},[M,c,f,F]);const E=C>1?P.startIndex/(C-1)*100:0,X=C>1?P.endIndex/(C-1)*100:100,G=re(E),ee=re(X);G.get()!==E&&G.set(E),ee.get()!==X&&ee.set(X);const Y=pe(G,xe),q=pe(ee,xe),he=Z(Y,U=>`${U}%`),Me=Z(q,U=>`${U}%`),Ne=Z(Y,U=>`${U}%`),Oe=Z(q,U=>`${Math.max(0,100-U)}%`),ue=re(`${Math.max(0,X-E)}%`),fe=()=>{ue.set(`${Math.max(0,q.get()-Y.get())}%`)};ge(Y,"change",fe),ge(q,"change",fe);const me=U=>{if(!t)return String(U);const j=i[U]?.[t];return y?y(j,U):String(j??U)};return C===0?null:k("div",{className:T("group relative select-none",l),"data-chart":$?void 0:S,ref:v,style:{height:o},children:[!$&&n(Se,{config:e,id:S}),n("div",{className:"absolute inset-0 overflow-hidden rounded-md",children:n(ct,{barRadius:u,chartConfig:e,chartId:S,connectNulls:m,curveType:x,data:i,keys:I,stacked:s,strokeVariant:d==="animated-dashed"?"dashed":d,variant:a})}),n(V.div,{className:"bg-background pointer-events-none absolute inset-y-0 start-0 rounded-s-md",style:{width:Ne}}),n(V.div,{className:"bg-background pointer-events-none absolute inset-y-0 end-0 rounded-e-md",style:{width:Oe}}),n(V.div,{className:"absolute inset-y-0 cursor-grab touch-none rounded-sm border active:cursor-grabbing",style:{left:he,width:ue},...H("middle")}),n(be,{bind:H("left"),label:w?me(P.startIndex):void 0,position:he,side:"left"}),n(be,{bind:H("right"),label:w?me(P.endIndex):void 0,position:Me,side:"right"})]})},be=i=>{const e=N(20),{side:r,position:t,label:a,bind:o}=i,l=r==="left";let s;e[0]!==t?(s={left:t},e[0]=t,e[1]=s):s=e[1];const d=l?"":"-translate-x-full rtl:translate-x-full";let m;e[2]!==d?(m=T("group absolute inset-y-0 flex w-3 cursor-ew-resize touch-none items-center justify-center after:absolute after:inset-y-0 after:-start-4 after:w-11 after:content-['']",d),e[2]=d,e[3]=m):m=e[3];const u=l?"-start-[5.5px]":"-end-[5.5px]";let c;e[4]!==u?(c=T("bg-muted-foreground group-hover:bg-foreground relative flex h-4 w-1.5 items-center justify-center rounded-md transition-colors",u),e[4]=u,e[5]=c):c=e[5];let f;e[6]===Symbol.for("react.memo_cache_sentinel")?(f=k("div",{className:"flex flex-col gap-[2px]",children:[n("div",{className:"bg-background h-[2px] w-[2px] rounded-full"}),n("div",{className:"bg-background h-[2px] w-[2px] rounded-full"}),n("div",{className:"bg-background h-[2px] w-[2px] rounded-full"})]}),e[6]=f):f=e[6];let h;e[7]!==c?(h=n("div",{className:c,children:f}),e[7]=c,e[8]=h):h=e[8];let p;e[9]!==o||e[10]!==m||e[11]!==h?(p=n("div",{className:m,...o,children:h}),e[9]=o,e[10]=m,e[11]=h,e[12]=p):p=e[12];let g;e[13]!==l||e[14]!==a?(g=a&&n("div",{className:T("bg-foreground text-background pointer-events-none absolute -bottom-3 -translate-y-1/2 rounded-[3px] px-1 py-px text-[8px] leading-tight font-medium whitespace-nowrap opacity-0 group-hover:opacity-100",l?"start-1.5":"end-1.5"),children:a}),e[13]=l,e[14]=a,e[15]=g):g=e[15];let y;return e[16]!==s||e[17]!==p||e[18]!==g?(y=k(V.div,{className:"absolute inset-y-0 z-10",style:s,children:[p,g]}),e[16]=s,e[17]=p,e[18]=g,e[19]=y):y=e[19],y},ct=({data:i,keys:e,chartConfig:r,variant:t,curveType:a,chartId:o,stacked:l,strokeVariant:s="solid",connectNulls:d=!1,barRadius:m})=>{const u=Object.entries(r).filter(([h])=>e.includes(h)).map(([h,p])=>({dataKey:h,colorsCount:W(p)})),c=s==="dashed"||s==="animated-dashed"?"4 4":void 0,f=k(B,{children:[t==="area"&&k("linearGradient",{id:`${o}-zm-vertical-fade`,x1:"0",x2:"0",y1:"0",y2:"1",children:[n("stop",{offset:"0%",stopColor:"white",stopOpacity:.15}),n("stop",{offset:"100%",stopColor:"white",stopOpacity:0})]}),u.map(({dataKey:h,colorsCount:p})=>{const g=p===1?k(B,{children:[n("stop",{offset:"0%",stopColor:`var(--color-${h}-0)`}),n("stop",{offset:"100%",stopColor:`var(--color-${h}-0)`})]}):Array.from({length:p},(y,x)=>n("stop",{offset:`${x/(p-1)*100}%`,stopColor:`var(--color-${h}-${x}, var(--color-${h}-0))`},x));return k(K.Fragment,{children:[n("linearGradient",{id:`${o}-zm-${h}`,x1:"0",x2:"0",y1:"0",y2:"1",children:g}),t==="area"&&k(B,{children:[n("mask",{id:`${o}-zm-fill-mask-${h}`,children:n("rect",{fill:`url(#${o}-zm-vertical-fade)`,height:"100%",width:"100%"})}),n("pattern",{height:"100%",id:`${o}-zm-fill-${h}`,patternUnits:"userSpaceOnUse",width:"100%",children:n("rect",{fill:`url(#${o}-zm-${h})`,height:"100%",mask:`url(#${o}-zm-fill-mask-${h})`,width:"100%"})})]})]},h)})]});if(t==="line")return n(ne,{height:"100%",width:"100%",children:k(Ke,{data:i,margin:{top:4,right:0,bottom:0,left:0},children:[n("defs",{children:f}),e.map(h=>n(De,{activeDot:!1,connectNulls:d,dataKey:h,dot:!1,isAnimationActive:!1,stroke:`url(#${o}-zm-${h})`,strokeDasharray:c,strokeOpacity:.5,strokeWidth:1,type:a},h))]})});if(t==="bar"){const h=m??3;return n(ne,{height:"100%",width:"100%",children:k(ke,{barGap:2,barSize:14,data:i,margin:{top:2,right:0,bottom:0,left:0},children:[n("defs",{children:f}),e.map(p=>n(de,{dataKey:p,fill:`url(#${o}-zm-${p})`,fillOpacity:.35,isAnimationActive:!1,radius:[h,h,h,h],stackId:l?"zm-stack":void 0},p))]})})}return n(ne,{height:"100%",width:"100%",children:k(Re,{data:i,margin:{top:4,right:0,bottom:0,left:0},children:[n("defs",{children:f}),e.map(h=>n(Te,{activeDot:!1,connectNulls:d,dataKey:h,dot:!1,fill:`url(#${o}-zm-fill-${h})`,fillOpacity:1,isAnimationActive:!1,stackId:l?"zm-stack":void 0,stroke:`url(#${o}-zm-${h})`,strokeDasharray:c,strokeOpacity:.5,strokeWidth:1,type:a},h))]})})};function ht({data:i,defaultStartIndex:e=0,defaultEndIndex:r}){const[t,a]=K.useState({startIndex:e,endIndex:r??Math.max(0,i.length-1)}),o=K.useDeferredValue(t);ie(()=>{a({startIndex:0,endIndex:Math.max(0,i.length-1)})},[i.length]);const l=i.slice(o.startIndex,o.endIndex+1);return{range:t,visibleData:l,brushProps:{startIndex:t.startIndex,endIndex:t.endIndex,onChange:a}}}const ut={sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl"},ft={default:"bg-background","frosted-glass":"bg-background"},mt=({active:i,payload:e,className:r,indicator:t="dot",hideLabel:a=!1,hideIndicator:o=!1,label:l,labelFormatter:s,labelClassName:d,formatter:m,nameKey:u,labelKey:c,selected:f,roundness:h="lg",variant:p="default"})=>{const{config:g}=rt(),y=K.useMemo(()=>{if(a||!e?.length)return null;const[b]=e,w=`${c??b?.dataKey??b?.name??"value"}`,$=ye(g,b,w),v=!c&&typeof l=="string"?g[l]?.label??l:$?.label;return s?n("div",{className:T("font-medium",d),children:s(v,e)}):v?n("div",{className:T("font-medium",d),children:v}):null},[l,s,e,a,d,g,c]);if(!i||!e?.length)return n("span",{className:"p-4"});const x=e.length===1&&t!=="dot";return k("div",{className:T("border-border/50 grid min-w-32 items-start gap-1.5 border px-2.5 py-1.5 text-xs",ut[h],ft[p],r),children:[x?null:y,n("div",{className:"grid gap-1.5",children:e.filter(b=>b.type!=="none").map((b,w)=>{const $=`${(u&&b.payload?b.payload[u]:void 0)??b.name??b.dataKey??"value"}`,v=ye(g,b,$),I=v?W(v):1;return n("div",{className:T("[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5",t==="dot"&&"items-center",f!=null&&f!==b.dataKey&&"opacity-30"),children:m&&b?.value!==void 0&&b.name?m(b.value,b.name,b,w,b.payload):k(B,{children:[v?.icon?n(v.icon,{}):!o&&n("div",{className:T("shrink-0 rounded-[2px]",{"h-2.5 w-2.5":t==="dot","w-1":t==="line","w-0 border-[1.5px] border-dashed bg-transparent!":t==="dashed","my-0.5":x&&t==="dashed"}),style:pt($,I)}),k("div",{className:T("flex flex-1 justify-between gap-4 leading-none",x?"items-end":"items-center"),children:[k("div",{className:"grid gap-1.5",children:[x?y:null,n("span",{className:"text-muted-foreground",children:v?.label??b.name})]}),b.value!=null&&n("span",{className:"text-foreground font-mono font-medium tabular-nums",children:typeof b.value=="number"?b.value.toLocaleString():String(b.value)})]})]})},w)})})]})};function pt(i,e){return e<=1?{background:`var(--color-${i}-0)`}:{background:`linear-gradient(to right, ${Array.from({length:e},(r,t)=>{const a=t/(e-1)*100;return`var(--color-${i}-${t}) ${a}%`}).join(", ")})`}}const gt=({animationDuration:i=200,...e})=>n(ve.Tooltip,{animationDuration:i,...e}),Ie=2,yt="loading",xt=2e3,bt="evil-stacked",$t=.5,vt=.05,kt=[0,.7,.5,1],_e=Be(null);function ce(){const i=ze(_e);if(!i)throw new le("INTERNAL","Bar chart parts (<Bar />, <XAxis />, …) must be used within <EvilBarChart />");return i}const Wt=({config:i,data:e,children:r,className:t,chartProps:a,stackType:o="default",layout:l="vertical",barRadius:s=Ie,animationType:d="left-to-right",barGap:m,barCategoryGap:u,backgroundVariant:c,defaultSelectedDataKey:f=null,onSelectionChange:h,isLoading:p=!1,loadingBars:g,showBrush:y=!1,xDataKey:x,brushHeight:b,brushFormatLabel:w,onBrushChange:$})=>{const v=se().replaceAll(":",""),[I]=Q(()=>Date.now()),[C,S]=Q(f),[M,_]=Q(!1),{loadingData:O,onShimmerExit:A}=At(p,g),{visibleData:R,brushProps:D}=ht({data:e}),F=o==="stacked"||o==="percent",H=l==="horizontal",P=y&&!p?R:e,E=G=>{S(G),h?.(G)},X={config:i,isStacked:F,isHorizontal:H,isLoading:p,barRadius:s,animationType:d,introStartedAt:I,dataLength:P.length,selectedDataKey:C,selectDataKey:E,isMouseInChart:M};return n(_e,{value:X,children:k(nt,{className:t,config:i,footer:y&&!p&&n(dt,{barRadius:s,chartConfig:i,className:"mt-1",data:e,formatLabel:w,height:b,skipStyle:!0,stacked:F,variant:"bar",xDataKey:x,...D,onChange:G=>{D.onChange(G),$?.(G)}}),children:[n(at,{isLoading:p}),k(ke,{accessibilityLayer:!0,barCategoryGap:u,barGap:m,data:p?O:P,id:v,layout:H?"vertical":"horizontal",onMouseEnter:()=>{_(!0)},onMouseLeave:()=>{_(!1)},stackOffset:o==="percent"?"expand":void 0,...a,children:[c&&n(et,{variant:c}),n(je,{stroke:"var(--border)"}),r,p&&n(Dt,{chartId:v,onShimmerExit:A})]})]})})},Ft=({dataKey:i,variant:e="default",radius:r,animationType:t,isClickable:a=!1,enableHoverHighlight:o=!1,glowing:l=!1,bufferBar:s=!1,barProps:d})=>{const{config:m,isStacked:u,isHorizontal:c,isLoading:f,barRadius:h,animationType:p,introStartedAt:g,dataLength:y,selectedDataKey:x,selectDataKey:b,isMouseInChart:w}=ce(),$=se().replaceAll(":",""),v=Ue();if(f)return null;const I=r??h,C=x===i,S=v?"none":t??p,M={id:$,dataKey:i,variant:e,barRadius:I,glowing:l,bufferBar:s,isClickable:a,enableHoverHighlight:o,isMouseInChart:w,isHorizontal:c,introStartedAt:g,selectedDataKey:x,dataLength:y,onClick:()=>{a&&b(C?null:i)}};return k(B,{children:[n(de,{activeBar:_=>n($e,{..._,...M,animationType:"none"}),dataKey:i,fill:`url(#${$}-colors-${i})`,isAnimationActive:!1,radius:I,shape:_=>n($e,{..._,...M,animationType:S}),stackId:u?bt:void 0,style:a||o?{cursor:"pointer"}:void 0,...d}),k("defs",{children:[n(It,{config:m,dataKey:i,id:$}),e==="hatched"&&n(_t,{dataKey:i,id:$}),e==="duotone"&&n(Nt,{config:m,dataKey:i,id:$}),e==="duotone-reverse"&&n(Ot,{config:m,dataKey:i,id:$}),e==="gradient"&&n(Ut,{dataKey:i,id:$}),e==="stripped"&&n(zt,{dataKey:i,id:$}),s&&n(Mt,{dataKey:i,id:$}),l&&n(Bt,{dataKey:i,id:$})]})]})},Yt=({tickLine:i=!1,axisLine:e=!1,tickMargin:r=8,minTickGap:t=8,type:a,...o})=>{const{isLoading:l,isHorizontal:s}=ce();return l?null:n(Ge,{axisLine:e,minTickGap:t,tickLine:i,tickMargin:r,type:a??(s?"number":"category"),...o})},qt=i=>{const e=N(7),{variant:r,roundness:t,defaultIndex:a}=i,{isLoading:o,selectedDataKey:l}=ce();if(o)return null;let s;e[0]!==t||e[1]!==l||e[2]!==r?(s=n(mt,{roundness:t,selected:l,variant:r}),e[0]=t,e[1]=l,e[2]=r,e[3]=s):s=e[3];let d;return e[4]!==a||e[5]!==s?(d=n(gt,{content:s,cursor:!1,defaultIndex:a}),e[4]=a,e[5]=s,e[6]=d):d=e[6],d},$e=i=>{const{x:e=0,y:r=0,width:t=0,height:a=0,id:o,dataKey:l,variant:s,barRadius:d,glowing:m,bufferBar:u,isClickable:c,enableHoverHighlight:f,isMouseInChart:h,isHorizontal:p=!1,animationType:g="none",introStartedAt:y=0,selectedDataKey:x,isActive:b,dataLength:w=0,onClick:$}=i,v=typeof i.index=="number"?i.index:-1,I=u&&w>0&&v===w-1,C=s==="stripped",S=wt(g,v,w,p,y),M=I?`url(#${o}-buffer-hatched-${l})`:Ct(s,o,l),_=m?`url(#${o}-bar-glow-${l})`:void 0,O=St({isClickable:c,selectedDataKey:x,dataKey:l,enableHoverHighlight:f,isMouseInChart:h,isActive:b}),A=c||f?{cursor:"pointer"}:void 0,R=C?[d,d,0,0]:d,D=k(B,{children:[n(ae,{fill:M,filter:_,height:Math.max(0,a-3),opacity:O,radius:R,stroke:I?`url(#${o}-colors-${l})`:void 0,strokeWidth:I?1:void 0,width:t,x:e,y:r}),C&&n(ae,{fill:`url(#${o}-colors-${l})`,height:2,radius:1,width:t,x:e,y:r-4})]});return k("g",{onClick:$,style:A,children:[n(ae,{...i,fill:"transparent"}),S?n(V.g,{animate:S.animate,initial:S.initial,style:S.style,transition:S.transition,children:D}):D]})},wt=(i,e,r,t,a)=>{if(i==="none"||e<0||r<=0)return null;const o=r-1,l=o/2;let s;switch(i){case"center-out":{s=Math.abs(e-l);break}case"edges-in":{s=l-Math.abs(e-l);break}case"right-to-left":{s=o-e;break}default:s=e}const d=s*vt*1e3,m=$t*1e3,u=d+m,c=Date.now()-a;if(c>=u)return null;const f=c<=d?0:(c-d)/m,h={duration:(u-Math.max(c,d))/1e3,ease:kt,delay:Math.max(0,d-c)/1e3};return t?{initial:{scaleX:f},animate:{scaleX:1},transition:h,style:{originX:0}}:{initial:{scaleY:f},animate:{scaleY:1},transition:h,style:{originY:1}}},Ct=(i,e,r)=>{switch(i){case"duotone":return`url(#${e}-duotone-${r})`;case"duotone-reverse":return`url(#${e}-duotone-reverse-${r})`;case"gradient":return`url(#${e}-gradient-${r})`;case"hatched":return`url(#${e}-hatched-${r})`;case"stripped":return`url(#${e}-stripped-${r})`;default:return`url(#${e}-colors-${r})`}},St=({isClickable:i,selectedDataKey:e,dataKey:r,enableHoverHighlight:t,isMouseInChart:a,isActive:o})=>{const l=i&&e!==null?e===null||e===r?1:.3:1;return t&&a?o?l:l*.3:l},It=i=>{const e=N(16),{id:r,dataKey:t,config:a}=i;let o,l,s,d,m,u;if(e[0]!==a||e[1]!==t||e[2]!==r){const f=W(a[t]??{});o=`${r}-colors-${t}`,l="0",s="0",d="0",m="1",u=f===1?k(B,{children:[n("stop",{offset:"0%",stopColor:`var(--color-${t}-0)`}),n("stop",{offset:"100%",stopColor:`var(--color-${t}-0)`})]}):Array.from({length:f},(h,p)=>{const g=`${p/(f-1)*100}%`;return n("stop",{offset:g,stopColor:`var(--color-${t}-${p}, var(--color-${t}-0))`},g)}),e[0]=a,e[1]=t,e[2]=r,e[3]=o,e[4]=l,e[5]=s,e[6]=d,e[7]=m,e[8]=u}else o=e[3],l=e[4],s=e[5],d=e[6],m=e[7],u=e[8];let c;return e[9]!==o||e[10]!==l||e[11]!==s||e[12]!==d||e[13]!==m||e[14]!==u?(c=n("linearGradient",{id:o,x1:l,x2:s,y1:d,y2:m,children:u}),e[9]=o,e[10]=l,e[11]=s,e[12]=d,e[13]=m,e[14]=u,e[15]=c):c=e[15],c},_t=i=>{const e=N(19),{id:r,dataKey:t}=i,a=`${r}-hatched-mask-pattern`;let o,l;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=n("rect",{fill:"white",fillOpacity:.3,height:"5",width:"5"}),l=n("rect",{fill:"white",fillOpacity:1,height:"5",width:"1.5"}),e[0]=o,e[1]=l):(o=e[0],l=e[1]);let s;e[2]!==a?(s=k("pattern",{height:"5",id:a,patternTransform:"rotate(-45)",patternUnits:"userSpaceOnUse",width:"5",x:"0",y:"0",children:[o,l]}),e[2]=a,e[3]=s):s=e[3];const d=`${r}-hatched-mask-${t}`,m=`url(#${r}-hatched-mask-pattern)`;let u;e[4]!==m?(u=n("rect",{fill:m,height:"100%",width:"100%"}),e[4]=m,e[5]=u):u=e[5];let c;e[6]!==d||e[7]!==u?(c=n("mask",{id:d,children:u}),e[6]=d,e[7]=u,e[8]=c):c=e[8];const f=`${r}-hatched-${t}`,h=`url(#${r}-colors-${t})`,p=`url(#${r}-hatched-mask-${t})`;let g;e[9]!==h||e[10]!==p?(g=n("rect",{fill:h,height:"100%",mask:p,width:"100%"}),e[9]=h,e[10]=p,e[11]=g):g=e[11];let y;e[12]!==g||e[13]!==f?(y=n("pattern",{height:"100%",id:f,patternUnits:"userSpaceOnUse",width:"100%",children:g}),e[12]=g,e[13]=f,e[14]=y):y=e[14];let x;return e[15]!==y||e[16]!==s||e[17]!==c?(x=k(B,{children:[s,c,y]}),e[15]=y,e[16]=s,e[17]=c,e[18]=x):x=e[18],x},Mt=i=>{const e=N(19),{id:r,dataKey:t}=i,a=`${r}-buffer-hatched-mask-pattern`;let o,l;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=n("rect",{fill:"black",fillOpacity:0,height:"5",width:"5"}),l=n("rect",{fill:"white",fillOpacity:1,height:"5",width:"1"}),e[0]=o,e[1]=l):(o=e[0],l=e[1]);let s;e[2]!==a?(s=k("pattern",{height:"5",id:a,patternTransform:"rotate(-45)",patternUnits:"userSpaceOnUse",width:"5",x:"0",y:"0",children:[o,l]}),e[2]=a,e[3]=s):s=e[3];const d=`${r}-buffer-hatched-mask-${t}`,m=`url(#${r}-buffer-hatched-mask-pattern)`;let u;e[4]!==m?(u=n("rect",{fill:m,height:"100%",width:"100%"}),e[4]=m,e[5]=u):u=e[5];let c;e[6]!==d||e[7]!==u?(c=n("mask",{id:d,children:u}),e[6]=d,e[7]=u,e[8]=c):c=e[8];const f=`${r}-buffer-hatched-${t}`,h=`url(#${r}-colors-${t})`,p=`url(#${r}-buffer-hatched-mask-${t})`;let g;e[9]!==h||e[10]!==p?(g=n("rect",{fill:h,height:"100%",mask:p,width:"100%"}),e[9]=h,e[10]=p,e[11]=g):g=e[11];let y;e[12]!==g||e[13]!==f?(y=n("pattern",{height:"100%",id:f,patternUnits:"userSpaceOnUse",width:"100%",children:g}),e[12]=g,e[13]=f,e[14]=y):y=e[14];let x;return e[15]!==y||e[16]!==s||e[17]!==c?(x=k(B,{children:[s,c,y]}),e[15]=y,e[16]=s,e[17]=c,e[18]=x):x=e[18],x},Nt=i=>{const e=N(39),{id:r,dataKey:t,config:a}=i;let o,l,s,d,m,u,c,f;if(e[0]!==a||e[1]!==t||e[2]!==r){const S=W(a[t]??{}),M=`${r}-duotone-mask-gradient-${t}`;let _,O;e[11]===Symbol.for("react.memo_cache_sentinel")?(_=n("stop",{offset:"50%",stopColor:"white",stopOpacity:.4}),O=n("stop",{offset:"50%",stopColor:"white",stopOpacity:1}),e[11]=_,e[12]=O):(_=e[11],O=e[12]),e[13]!==M?(f=k("linearGradient",{gradientUnits:"objectBoundingBox",id:M,x1:"0",x2:"1",y1:"0",y2:"0",children:[_,O]}),e[13]=M,e[14]=f):f=e[14],o="objectBoundingBox",l=`${r}-duotone-colors-${t}`,s="0",d="0",m="0",u="1",c=S===1?k(B,{children:[n("stop",{offset:"0%",stopColor:`var(--color-${t}-0)`}),n("stop",{offset:"100%",stopColor:`var(--color-${t}-0)`})]}):Array.from({length:S},(A,R)=>{const D=`${R/(S-1)*100}%`;return n("stop",{offset:D,stopColor:`var(--color-${t}-${R}, var(--color-${t}-0))`},D)}),e[0]=a,e[1]=t,e[2]=r,e[3]=o,e[4]=l,e[5]=s,e[6]=d,e[7]=m,e[8]=u,e[9]=c,e[10]=f}else o=e[3],l=e[4],s=e[5],d=e[6],m=e[7],u=e[8],c=e[9],f=e[10];let h;e[15]!==o||e[16]!==l||e[17]!==s||e[18]!==d||e[19]!==m||e[20]!==u||e[21]!==c?(h=n("linearGradient",{gradientUnits:o,id:l,x1:s,x2:d,y1:m,y2:u,children:c}),e[15]=o,e[16]=l,e[17]=s,e[18]=d,e[19]=m,e[20]=u,e[21]=c,e[22]=h):h=e[22];const p=`${r}-duotone-mask-${t}`,g=`url(#${r}-duotone-mask-gradient-${t})`;let y;e[23]!==g?(y=n("rect",{fill:g,height:"1",width:"1",x:"0",y:"0"}),e[23]=g,e[24]=y):y=e[24];let x;e[25]!==p||e[26]!==y?(x=n("mask",{id:p,maskContentUnits:"objectBoundingBox",children:y}),e[25]=p,e[26]=y,e[27]=x):x=e[27];const b=`${r}-duotone-${t}`,w=`url(#${r}-duotone-colors-${t})`,$=`url(#${r}-duotone-mask-${t})`;let v;e[28]!==w||e[29]!==$?(v=n("rect",{fill:w,height:"1",mask:$,width:"1",x:"0",y:"0"}),e[28]=w,e[29]=$,e[30]=v):v=e[30];let I;e[31]!==b||e[32]!==v?(I=n("pattern",{height:"1",id:b,patternContentUnits:"objectBoundingBox",patternUnits:"objectBoundingBox",width:"1",children:v}),e[31]=b,e[32]=v,e[33]=I):I=e[33];let C;return e[34]!==x||e[35]!==I||e[36]!==f||e[37]!==h?(C=k(B,{children:[f,h,x,I]}),e[34]=x,e[35]=I,e[36]=f,e[37]=h,e[38]=C):C=e[38],C},Ot=i=>{const e=N(39),{id:r,dataKey:t,config:a}=i;let o,l,s,d,m,u,c,f;if(e[0]!==a||e[1]!==t||e[2]!==r){const S=W(a[t]??{}),M=`${r}-duotone-reverse-mask-gradient-${t}`;let _,O;e[11]===Symbol.for("react.memo_cache_sentinel")?(_=n("stop",{offset:"50%",stopColor:"white",stopOpacity:1}),O=n("stop",{offset:"50%",stopColor:"white",stopOpacity:.4}),e[11]=_,e[12]=O):(_=e[11],O=e[12]),e[13]!==M?(f=k("linearGradient",{gradientUnits:"objectBoundingBox",id:M,x1:"0",x2:"1",y1:"0",y2:"0",children:[_,O]}),e[13]=M,e[14]=f):f=e[14],o="objectBoundingBox",l=`${r}-duotone-reverse-colors-${t}`,s="0",d="0",m="0",u="1",c=S===1?k(B,{children:[n("stop",{offset:"0%",stopColor:`var(--color-${t}-0)`}),n("stop",{offset:"100%",stopColor:`var(--color-${t}-0)`})]}):Array.from({length:S},(A,R)=>{const D=`${R/(S-1)*100}%`;return n("stop",{offset:D,stopColor:`var(--color-${t}-${R}, var(--color-${t}-0))`},D)}),e[0]=a,e[1]=t,e[2]=r,e[3]=o,e[4]=l,e[5]=s,e[6]=d,e[7]=m,e[8]=u,e[9]=c,e[10]=f}else o=e[3],l=e[4],s=e[5],d=e[6],m=e[7],u=e[8],c=e[9],f=e[10];let h;e[15]!==o||e[16]!==l||e[17]!==s||e[18]!==d||e[19]!==m||e[20]!==u||e[21]!==c?(h=n("linearGradient",{gradientUnits:o,id:l,x1:s,x2:d,y1:m,y2:u,children:c}),e[15]=o,e[16]=l,e[17]=s,e[18]=d,e[19]=m,e[20]=u,e[21]=c,e[22]=h):h=e[22];const p=`${r}-duotone-reverse-mask-${t}`,g=`url(#${r}-duotone-reverse-mask-gradient-${t})`;let y;e[23]!==g?(y=n("rect",{fill:g,height:"1",width:"1",x:"0",y:"0"}),e[23]=g,e[24]=y):y=e[24];let x;e[25]!==p||e[26]!==y?(x=n("mask",{id:p,maskContentUnits:"objectBoundingBox",children:y}),e[25]=p,e[26]=y,e[27]=x):x=e[27];const b=`${r}-duotone-reverse-${t}`,w=`url(#${r}-duotone-reverse-colors-${t})`,$=`url(#${r}-duotone-reverse-mask-${t})`;let v;e[28]!==w||e[29]!==$?(v=n("rect",{fill:w,height:"1",mask:$,width:"1",x:"0",y:"0"}),e[28]=w,e[29]=$,e[30]=v):v=e[30];let I;e[31]!==b||e[32]!==v?(I=n("pattern",{height:"1",id:b,patternContentUnits:"objectBoundingBox",patternUnits:"objectBoundingBox",width:"1",children:v}),e[31]=b,e[32]=v,e[33]=I):I=e[33];let C;return e[34]!==x||e[35]!==I||e[36]!==f||e[37]!==h?(C=k(B,{children:[f,h,x,I]}),e[34]=x,e[35]=I,e[36]=f,e[37]=h,e[38]=C):C=e[38],C},Ut=i=>{const e=N(19),{id:r,dataKey:t}=i,a=`${r}-gradient-mask-gradient`;let o,l;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=n("stop",{offset:"20%",stopColor:"white",stopOpacity:1}),l=n("stop",{offset:"90%",stopColor:"white",stopOpacity:0}),e[0]=o,e[1]=l):(o=e[0],l=e[1]);let s;e[2]!==a?(s=k("linearGradient",{id:a,x1:"0",x2:"0",y1:"0",y2:"1",children:[o,l]}),e[2]=a,e[3]=s):s=e[3];const d=`${r}-gradient-mask-${t}`,m=`url(#${r}-gradient-mask-gradient)`;let u;e[4]!==m?(u=n("rect",{fill:m,height:"100%",width:"100%"}),e[4]=m,e[5]=u):u=e[5];let c;e[6]!==d||e[7]!==u?(c=n("mask",{id:d,children:u}),e[6]=d,e[7]=u,e[8]=c):c=e[8];const f=`${r}-gradient-${t}`,h=`url(#${r}-colors-${t})`,p=`url(#${r}-gradient-mask-${t})`;let g;e[9]!==h||e[10]!==p?(g=n("rect",{fill:h,height:"100%",mask:p,width:"100%"}),e[9]=h,e[10]=p,e[11]=g):g=e[11];let y;e[12]!==g||e[13]!==f?(y=n("pattern",{height:"100%",id:f,patternUnits:"userSpaceOnUse",width:"100%",children:g}),e[12]=g,e[13]=f,e[14]=y):y=e[14];let x;return e[15]!==y||e[16]!==s||e[17]!==c?(x=k(B,{children:[s,c,y]}),e[15]=y,e[16]=s,e[17]=c,e[18]=x):x=e[18],x},zt=i=>{const e=N(19),{id:r,dataKey:t}=i,a=`${r}-stripped-mask-gradient`;let o,l;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=n("stop",{offset:"0%",stopColor:"white",stopOpacity:.2}),l=n("stop",{offset:"100%",stopColor:"white",stopOpacity:.2}),e[0]=o,e[1]=l):(o=e[0],l=e[1]);let s;e[2]!==a?(s=k("linearGradient",{id:a,x1:"0",x2:"0",y1:"0",y2:"1",children:[o,l]}),e[2]=a,e[3]=s):s=e[3];const d=`${r}-stripped-mask-${t}`,m=`url(#${r}-stripped-mask-gradient)`;let u;e[4]!==m?(u=n("rect",{fill:m,height:"100%",width:"100%"}),e[4]=m,e[5]=u):u=e[5];let c;e[6]!==d||e[7]!==u?(c=n("mask",{id:d,children:u}),e[6]=d,e[7]=u,e[8]=c):c=e[8];const f=`${r}-stripped-${t}`,h=`url(#${r}-colors-${t})`,p=`url(#${r}-stripped-mask-${t})`;let g;e[9]!==h||e[10]!==p?(g=n("rect",{fill:h,height:"100%",mask:p,width:"100%"}),e[9]=h,e[10]=p,e[11]=g):g=e[11];let y;e[12]!==g||e[13]!==f?(y=n("pattern",{height:"100%",id:f,patternUnits:"userSpaceOnUse",width:"100%",children:g}),e[12]=g,e[13]=f,e[14]=y):y=e[14];let x;return e[15]!==y||e[16]!==s||e[17]!==c?(x=k(B,{children:[s,c,y]}),e[15]=y,e[16]=s,e[17]=c,e[18]=x):x=e[18],x},Bt=i=>{const e=N(5),{id:r,dataKey:t}=i,a=`${r}-bar-glow-${t}`;let o,l,s;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=n("feGaussianBlur",{in:"SourceGraphic",result:"blur",stdDeviation:"8"}),l=n("feColorMatrix",{in:"blur",result:"glow",type:"matrix",values:`1 0 0 0 0
|
|
7
|
+
0 1 0 0 0
|
|
8
|
+
0 0 1 0 0
|
|
9
|
+
0 0 0 0.5 0`}),s=k("feMerge",{children:[n("feMergeNode",{in:"glow"}),n("feMergeNode",{in:"SourceGraphic"})]}),e[0]=o,e[1]=l,e[2]=s):(o=e[0],l=e[1],s=e[2]);let d;return e[3]!==a?(d=k("filter",{height:"300%",id:a,width:"300%",x:"-100%",y:"-100%",children:[o,l,s]}),e[3]=a,e[4]=d):d=e[4],d},Lt=(i=17,e=.05,r=.9)=>Array.from({length:i},(t,a)=>{const o=a/(i-1),l=Math.sin(o*Math.PI)**2,s=e+l*(r-e);return{offset:`${(o*100).toFixed(0)}%`,opacity:Number(s.toFixed(3))}});function At(i,e){const r=N(8),t=e===void 0?12:e,[,a]=Q(!1);let o;r[0]!==i||r[1]!==a?(o=()=>{i&&a(Kt)},r[0]=i,r[1]=a,r[2]=o):o=r[2];const l=o;let s;r[3]!==t?(s=ot(t,20,80),r[3]=t,r[4]=s):s=r[4];const d=s;let m;return r[5]!==d||r[6]!==l?(m={loadingData:d,onShimmerExit:l},r[5]=d,r[6]=l,r[7]=m):m=r[7],m}function Kt(i){return!i}const Dt=i=>{const e=N(8),{chartId:r,onShimmerExit:t}=i,a=`url(#${r}-loading-mask)`;let o;e[0]!==a?(o=n(de,{dataKey:yt,fill:"currentColor",fillOpacity:.15,isAnimationActive:!1,legendType:"none",radius:Ie,style:{mask:a}}),e[0]=a,e[1]=o):o=e[1];let l;e[2]!==r||e[3]!==t?(l=n("defs",{children:n(Rt,{chartId:r,onShimmerExit:t})}),e[2]=r,e[3]=t,e[4]=l):l=e[4];let s;return e[5]!==o||e[6]!==l?(s=k(B,{children:[o,l]}),e[5]=o,e[6]=l,e[7]=s):s=e[7],s},Rt=i=>{const e=N(23),{chartId:r,onShimmerExit:t}=i,a=Lt(),o=Le(-1),l=`${r}-loading-mask-gradient`,s="0",d="1",m="0",u="0",c=a.map(Tt);let f;e[0]!==l||e[1]!==c?(f=n("linearGradient",{id:l,x1:s,x2:d,y1:m,y2:u,children:c}),e[0]=l,e[1]=c,e[2]=f):f=e[2];const h=`${r}-loading-mask-pattern`;let p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p={x:2},e[3]=p):p=e[3];const g=`url(#${r}-loading-mask-gradient)`;let y;e[4]===Symbol.for("react.memo_cache_sentinel")?(y={x:-1},e[4]=y):y=e[4];let x;e[5]!==t?(x=_=>{const O=typeof _.x=="number"?_.x:-1,A=o.current;O>=1&&A<1&&t(),o.current=O},e[5]=t,e[6]=x):x=e[6];let b;e[7]===Symbol.for("react.memo_cache_sentinel")?(b={duration:xt/1e3,ease:"linear",repeat:1/0,repeatType:"loop"},e[7]=b):b=e[7];let w;e[8]!==g||e[9]!==x?(w=n(V.rect,{animate:p,fill:g,height:"1",initial:y,onUpdate:x,transition:b,width:"1",y:"0"}),e[8]=g,e[9]=x,e[10]=w):w=e[10];let $;e[11]!==w||e[12]!==h?($=n("pattern",{height:"1",id:h,patternContentUnits:"objectBoundingBox",patternTransform:"rotate(25)",patternUnits:"objectBoundingBox",width:3,x:"0",y:"0",children:w}),e[11]=w,e[12]=h,e[13]=$):$=e[13];const v=`${r}-loading-mask`,I=`url(#${r}-loading-mask-pattern)`;let C;e[14]!==I?(C=n("rect",{fill:I,height:"100%",width:"100%"}),e[14]=I,e[15]=C):C=e[15];let S;e[16]!==v||e[17]!==C?(S=n("mask",{id:v,maskUnits:"userSpaceOnUse",children:C}),e[16]=v,e[17]=C,e[18]=S):S=e[18];let M;return e[19]!==$||e[20]!==S||e[21]!==f?(M=k(B,{children:[f,$,S]}),e[19]=$,e[20]=S,e[21]=f,e[22]=M):M=e[22],M};function Tt(i){const{offset:e,opacity:r}=i;return n("stop",{offset:e,stopColor:"white",stopOpacity:r},e)}export{gt as A,Ft as B,Wt as E,nt as L,qt as T,Yt as X,mt as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as f}from"react/compiler-runtime";import{useState as m,useRef as h,useEffect as p}from"react";const g=(o="local")=>{try{return o==="local"?globalThis.localStorage:globalThis.sessionStorage}catch{return}},u=function(o,t="local"){try{const e=g(t)?.getItem(o)??void 0,s=e===void 0?[]:JSON.parse(e);return Array.isArray(s)?s:[]}catch{return[]}},S=(o,t,e="local")=>{const s=g(e);if(s!==void 0)try{s.setItem(o,JSON.stringify(t))}catch{}},b=function(o){const t=f(8);let e;t[0]!==o?(e=()=>u(o),t[0]=o,t[1]=e):e=t[1];const[s,l]=m(e),c=h(o);let r,a;t[2]!==o||t[3]!==s?(r=()=>{if(c.current!==o){c.current=o,l(u(o));return}S(o,s)},a=[o,s],t[2]=o,t[3]=s,t[4]=r,t[5]=a):(r=t[4],a=t[5]),p(r,a);let n;return t[6]!==s?(n=[s,l],t[6]=s,t[7]=n):n=t[7],n},J=function(o,t){const e=f(6),[s,l]=b(o);let c;e[0]!==t||e[1]!==l?(c=i=>{l(y=>{const d=y[0]??t;return[typeof i=="function"?i(d):i]})},e[0]=t,e[1]=l,e[2]=c):c=e[2];const r=c,a=s[0]??t;let n;return e[3]!==r||e[4]!==a?(n=[a,r],e[3]=r,e[4]=a,e[5]=n):n=e[5],n},T=o=>globalThis.crypto?.randomUUID?.()??`${o}-${globalThis.performance.now().toString(36)}`;export{g as a,J as b,u as l,T as n,S as s,b as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Button as t}from"@base-ui/react/button";import{cva as n}from"class-variance-authority";import{c as d}from"./utils-bhneXptQ.js";import{jsx as s}from"react/jsx-runtime";const o=n("group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-xs font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pe-2 has-data-[icon=inline-start]:ps-2",xs:"h-6 gap-1 rounded-md px-2 text-xs has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-md px-2.5 has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pe-2 has-data-[icon=inline-start]:ps-2",icon:"size-8","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-md","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function g({className:e,variant:r="default",size:i="default",...a}){return s(t,{"data-slot":"button",className:d(o({variant:r,size:i,className:e})),...a})}export{g as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as i}from"react/compiler-runtime";import"react";import{c as o}from"./utils-bhneXptQ.js";import{jsx as c}from"react/jsx-runtime";function p({className:d,size:a="default",...t}){return c("div",{"data-slot":"card","data-size":a,className:o("group/card flex flex-col gap-4 overflow-hidden rounded-xl border border-border bg-card py-4 text-xs/relaxed text-card-foreground shadow-xs has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-2 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-md *:[img:last-child]:rounded-md",d),...t})}function f(d){const a=i(8);let t,e;a[0]!==d?({className:t,...e}=d,a[0]=d,a[1]=t,a[2]=e):(t=a[1],e=a[2]);let r;a[3]!==t?(r=o("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-md px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3",t),a[3]=t,a[4]=r):r=a[4];let s;return a[5]!==e||a[6]!==r?(s=c("div",{"data-slot":"card-header",className:r,...e}),a[5]=e,a[6]=r,a[7]=s):s=a[7],s}function x(d){const a=i(8);let t,e;a[0]!==d?({className:t,...e}=d,a[0]=d,a[1]=t,a[2]=e):(t=a[1],e=a[2]);let r;a[3]!==t?(r=o("font-heading text-sm font-medium group-data-[size=sm]/card:text-sm",t),a[3]=t,a[4]=r):r=a[4];let s;return a[5]!==e||a[6]!==r?(s=c("div",{"data-slot":"card-title",className:r,...e}),a[5]=e,a[6]=r,a[7]=s):s=a[7],s}function g(d){const a=i(8);let t,e;a[0]!==d?({className:t,...e}=d,a[0]=d,a[1]=t,a[2]=e):(t=a[1],e=a[2]);let r;a[3]!==t?(r=o("text-xs/relaxed text-muted-foreground",t),a[3]=t,a[4]=r):r=a[4];let s;return a[5]!==e||a[6]!==r?(s=c("div",{"data-slot":"card-description",className:r,...e}),a[5]=e,a[6]=r,a[7]=s):s=a[7],s}function h(d){const a=i(8);let t,e;a[0]!==d?({className:t,...e}=d,a[0]=d,a[1]=t,a[2]=e):(t=a[1],e=a[2]);let r;a[3]!==t?(r=o("px-4 group-data-[size=sm]/card:px-3",t),a[3]=t,a[4]=r):r=a[4];let s;return a[5]!==e||a[6]!==r?(s=c("div",{"data-slot":"card-content",className:r,...e}),a[5]=e,a[6]=r,a[7]=s):s=a[7],s}export{p as c,x as f,g as m,f as n,h as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const s="https://dash.cloudflare.com/?to=/:account",L=`${s}/workers-and-pages/observability`,a=`${s}/workers-and-pages`,R=`${s}/r2`,r=`${s}/workers/d1`,o=`${s}/workers/durable-objects`;export{r as C,a,L as b,o as c,R as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as s}from"react/compiler-runtime";import{Checkbox as d}from"@base-ui/react/checkbox";import{c as l}from"./utils-bhneXptQ.js";import{HugeiconsIcon as m}from"@hugeicons/react";import{Tick02Icon as b}from"@hugeicons/core-free-icons";import{jsx as c}from"react/jsx-runtime";function h(n){const r=s(9);let e,i;r[0]!==n?({className:e,...i}=n,r[0]=n,r[1]=e,r[2]=i):(e=r[1],i=r[2]);let a;r[3]!==e?(a=l("peer relative flex size-4 shrink-0 items-center justify-center rounded-md border border-input transition-colors outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary",e),r[3]=e,r[4]=a):a=r[4];let t;r[5]===Symbol.for("react.memo_cache_sentinel")?(t=c(d.Indicator,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none [&>svg]:size-3.5",children:c(m,{icon:b,strokeWidth:2})}),r[5]=t):t=r[5];let o;return r[6]!==i||r[7]!==a?(o=c(d.Root,{"data-slot":"checkbox",className:a,...i,children:t}),r[6]=i,r[7]=a,r[8]=o):o=r[8],o}export{h as f};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as x}from"react/compiler-runtime";import{useT as w}from"./DEFAULT_LOCALE-BZ4NojpD.js";import{h as y}from"./internal-BSIsQVC6.js";import{jsx as d,jsxs as p}from"react/jsx-runtime";const N=(l,e)=>{if(e==="")return[{match:!1,offset:0,text:l}];const a=[],n=l.toLowerCase(),o=e.toLowerCase();let t=0;for(let r=n.indexOf(o);r!==-1;r=n.indexOf(o,t))r>t&&a.push({match:!1,offset:t,text:l.slice(t,r)}),a.push({match:!0,offset:r,text:l.slice(r,r+e.length)}),t=r+e.length;return t<l.length&&a.push({match:!1,offset:t,text:l.slice(t)}),a},v=l=>{const e=x(9),{highlight:a,value:n}=l;if(n==null){let s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=d("span",{className:"text-muted-foreground/50 italic",children:"NULL"}),e[0]=s):s=e[0],s}let o,t,r;if(e[1]!==a||e[2]!==n){r=Symbol.for("react.early_return_sentinel");e:{const s=y(n);if(a===void 0||a===""){r=d("span",{title:s,children:s});break e}o=s,t=N(s,a).map(k)}e[1]=a,e[2]=n,e[3]=o,e[4]=t,e[5]=r}else o=e[3],t=e[4],r=e[5];if(r!==Symbol.for("react.early_return_sentinel"))return r;let c;return e[6]!==o||e[7]!==t?(c=d("span",{title:o,children:t}),e[6]=o,e[7]=t,e[8]=c):c=e[8],c},j=l=>{const e=x(22),{columns:a,rows:n}=l,o=w();let t;e[0]!==o?(t=o("Field"),e[0]=o,e[1]=t):t=e[1];let r;e[2]!==t?(r=d("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]=r):r=e[3];let c;if(e[4]!==n||e[5]!==o){let i;e[7]!==o?(i=(h,u)=>d("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:o("Row {n}",{n:u+1})},u),e[7]=o,e[8]=i):i=e[8],c=n.map(i),e[4]=n,e[5]=o,e[6]=c}else c=e[6];let s;e[9]!==r||e[10]!==c?(s=d("thead",{className:"sticky top-0 z-10 bg-muted",children:p("tr",{children:[r,c]})}),e[9]=r,e[10]=c,e[11]=s):s=e[11];let m;if(e[12]!==a||e[13]!==n){let i;e[15]!==n?(i=h=>p("tr",{className:"hover:bg-muted/40",children:[d("th",{className:"border-b border-e border-border px-3 py-1.5 text-start font-mono font-medium whitespace-nowrap",scope:"row",children:h}),n.map((u,g)=>d("td",{className:"max-w-md truncate border-b border-border px-3 py-1.5 font-mono",children:d(v,{value:u[h]})},g))]},h),e[15]=n,e[16]=i):i=e[16],m=a.map(i),e[12]=a,e[13]=n,e[14]=m}else m=e[14];let f;e[17]!==m?(f=d("tbody",{children:m}),e[17]=m,e[18]=f):f=e[18];let b;return e[19]!==s||e[20]!==f?(b=d("div",{className:"min-h-0 flex-1 overflow-auto","data-testid":"db-transposed",children:p("table",{className:"border-collapse text-xs",children:[s,f]})}),e[19]=s,e[20]=f,e[21]=b):b=e[21],b},O=({children:l,layout:e="card",testId:a})=>d("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":a,children:l});function k(l){return d("mark",{className:l.match?"rounded-sm bg-warning/40 text-foreground":"bg-transparent text-inherit",children:l.text},l.offset)}export{v as g,O as k,j as v};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const f=new Set(["contains","eq","gt","gte","lt","lte","ne"]),i=r=>{if(typeof r!="string")return;const t=r.trim();return t===""?void 0:t},v=r=>{if(r===null||typeof r!="object")return!1;const t=r;return typeof t.column=="string"&&typeof t.operator=="string"&&f.has(t.operator)},l=r=>{if(typeof r!="string"||r==="")return[];try{const t=JSON.parse(r);return Array.isArray(t)?t.filter(v):[]}catch{return[]}},h=r=>{if(typeof r!="string"||r==="")return;const t=r.lastIndexOf(":");if(t<=0)return;const s=r.slice(0,t),o=r.slice(t+1);if(!(o!=="asc"&&o!=="desc"))return{column:s,direction:o}},g=/^[\da-f]{16}$/u,p=r=>{const t={};if(typeof r.pins=="string"&&r.pins!==""){const c=r.pins.split(",").filter(d=>d!==""&&d.length<=64).slice(0,12);c.length>0&&(t.pins=c.join(","))}r.schema==="global"&&(t.schema="global");const s=i(r.table);s!==void 0&&(t.table=s);const o=i(r.shard);o!==void 0&&(t.shard=o);const e=i(r.search);e!==void 0&&(t.search=e);const a=i(r.order);a!==void 0&&h(a)!==void 0&&(t.order=a);const n=i(r.filters);return n!==void 0&&l(n).length>0&&(t.filters=n),t},u=r=>{const t=l(r.filters),s=h(r.order);return{filters:t.length>0?t:void 0,orderBy:s,search:typeof r.search=="string"&&r.search!==""?r.search:void 0,shard:typeof r.shard=="string"&&r.shard!==""?r.shard:void 0,table:typeof r.table=="string"&&r.table!==""?r.table:void 0,tier:r.schema==="global"?"global":"shard"}},y=r=>{const t=r.filters??[];return{filters:t.length>0?JSON.stringify(t):void 0,order:r.orderBy===void 0?void 0:`${r.orderBy.column}:${r.orderBy.direction}`,schema:r.tier==="global"?"global":void 0,search:r.search!==void 0&&r.search!==""?r.search:void 0,shard:r.shard!==void 0&&r.shard!==""?r.shard:void 0,table:r.table!==void 0&&r.table!==""?r.table:void 0}},b=r=>{const{version:t}=r;return typeof t=="string"&&g.test(t)?{version:t}:{}};export{p as a,y as d,u as s,b as v};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import{c as l}from"react/compiler-runtime";import"react";import{Menu as i}from"@base-ui/react/menu";import{c as u}from"./utils-bhneXptQ.js";import{HugeiconsIcon as g}from"@hugeicons/react";import{Tick02Icon as p}from"@hugeicons/core-free-icons";import{jsx as d,jsxs as v}from"react/jsx-runtime";function _(a){const e=l(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d(i.Root,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=o):o=e[3],o}function y(a){const e=l(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d(i.Trigger,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=o):o=e[3],o}function I({align:a="start",alignOffset:e=0,side:t="bottom",sideOffset:o=4,className:n,...r}){return d(i.Portal,{children:d(i.Positioner,{className:"isolate z-50 outline-none",align:a,alignOffset:e,side:t,sideOffset:o,children:d(i.Popup,{"data-slot":"dropdown-menu-content",className:u("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-start-2 data-[side=inline-start]:slide-in-from-end-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95 animate-none! relative bg-popover before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit] **:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10 **:data-[slot$=-separator]:bg-foreground/5 **:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10! **:data-[variant=destructive]:focus:bg-foreground/10! **:data-[variant=destructive]:text-accent-foreground! **:data-[variant=destructive]:**:text-accent-foreground!",n),...r})})})}function $(a){const e=l(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d(i.Group,{"data-slot":"dropdown-menu-group",...t}),e[2]=t,e[3]=o):o=e[3],o}function O(a){const e=l(10);let t,o,n;e[0]!==a?({className:t,inset:o,...n}=a,e[0]=a,e[1]=t,e[2]=o,e[3]=n):(t=e[1],o=e[2],n=e[3]);let r;e[4]!==t?(r=u("px-2 py-2 text-xs text-muted-foreground data-inset:ps-7",t),e[4]=t,e[5]=r):r=e[5];let s;return e[6]!==o||e[7]!==n||e[8]!==r?(s=d(i.GroupLabel,{"data-slot":"dropdown-menu-label","data-inset":o,className:r,...n}),e[6]=o,e[7]=n,e[8]=r,e[9]=s):s=e[9],s}function P({className:a,inset:e,variant:t="default",...o}){return d(i.Item,{"data-slot":"dropdown-menu-item","data-inset":e,"data-variant":t,className:u("group/dropdown-menu-item relative flex cursor-default items-center gap-2 rounded-md px-2 py-2 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:ps-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",a),...o})}function j(a){const e=l(15);let t,o,n,r,s;e[0]!==a?({className:n,children:o,checked:t,inset:r,...s}=a,e[0]=a,e[1]=t,e[2]=o,e[3]=n,e[4]=r,e[5]=s):(t=e[1],o=e[2],n=e[3],r=e[4],s=e[5]);let c;e[6]!==n?(c=u("relative flex cursor-default items-center gap-2 rounded-md py-2 pe-8 ps-2 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:ps-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",n),e[6]=n,e[7]=c):c=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=d("span",{className:"pointer-events-none absolute end-2 flex items-center justify-center","data-slot":"dropdown-menu-checkbox-item-indicator",children:d(i.CheckboxItemIndicator,{children:d(g,{icon:p,strokeWidth:2})})}),e[8]=f):f=e[8];let m;return e[9]!==t||e[10]!==o||e[11]!==r||e[12]!==s||e[13]!==c?(m=v(i.CheckboxItem,{"data-slot":"dropdown-menu-checkbox-item","data-inset":r,className:c,checked:t,...s,children:[f,o]}),e[9]=t,e[10]=o,e[11]=r,e[12]=s,e[13]=c,e[14]=m):m=e[14],m}function C(a){const e=l(8);let t,o;e[0]!==a?({className:t,...o}=a,e[0]=a,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=u("-mx-1 h-px bg-border",t),e[3]=t,e[4]=n):n=e[4];let r;return e[5]!==o||e[6]!==n?(r=d(i.Separator,{"data-slot":"dropdown-menu-separator",className:n,...o}),e[5]=o,e[6]=n,e[7]=r):r=e[7],r}export{y as $,C as I,$ as M,P as N,j as P,O as _,I as b,_ as h};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as h}from"react/compiler-runtime";import{c as v}from"./utils-bhneXptQ.js";import{jsx as n,jsxs as u}from"react/jsx-runtime";const y=g=>{const e=h(19),{action:c,className:x,description:i,icon:a,testId:f,title:p}=g;let t;e[0]!==x?(t=v("flex flex-col items-center justify-center gap-3 rounded-lg border border-dashed border-border px-6 py-14 text-center",x),e[0]=x,e[1]=t):t=e[1];let r;e[2]!==a?(r=a!==void 0&&n("span",{className:"flex size-10 items-center justify-center rounded-lg bg-muted text-muted-foreground [&_svg]:size-5",children:a}),e[2]=a,e[3]=r):r=e[3];let s;e[4]!==p?(s=n("p",{className:"text-sm font-medium text-foreground",children:p}),e[4]=p,e[5]=s):s=e[5];let d;e[6]!==i?(d=i!==void 0&&n("p",{className:"max-w-sm text-sm text-muted-foreground",children:i}),e[6]=i,e[7]=d):d=e[7];let l;e[8]!==s||e[9]!==d?(l=u("div",{className:"flex flex-col gap-1",children:[s,d]}),e[8]=s,e[9]=d,e[10]=l):l=e[10];let o;e[11]!==c?(o=c!==void 0&&n("div",{className:"mt-1 flex items-center gap-2",children:c}),e[11]=c,e[12]=o):o=e[12];let m;return e[13]!==t||e[14]!==r||e[15]!==l||e[16]!==o||e[17]!==f?(m=u("div",{className:t,"data-testid":f,children:[r,l,o]}),e[13]=t,e[14]=r,e[15]=l,e[16]=o,e[17]=f,e[18]=m):m=e[18],m};export{y as E};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as A}from"react/compiler-runtime";import{flattenHint as $}from"@lunora/errors";import{useT as j}from"./DEFAULT_LOCALE-BZ4NojpD.js";import{e as E,a as H,b as I}from"./internal-BSIsQVC6.js";import{b as O}from"./recording-client-DRAZEmzE.js";import{u as V}from"./operation-console-provider-BMJNtiyB.js";import{A as q}from"./alert-CVcOFuDR.js";import{jsx as v,jsxs as D}from"react/jsx-runtime";const G=C=>{const e=A(38),{className:N,error:r,testId:g}=C,w=j(),t=V();let l,s,n,i,a,c,o,m;if(e[0]!==N||e[1]!==r||e[2]!==t||e[3]!==g){const y=E(r);let b;e[12]!==r?(b=H(r),e[12]=r,e[13]=b):b=e[13],s=b;let h;e[14]!==r?(h=O(r),e[14]=r,e[15]=h):h=e[15];const k=h;let x;e[16]!==t||e[17]!==k?(x=()=>{t?.openConsole({errorsOnly:!0,seq:k})},e[16]=t,e[17]=k,e[18]=x):x=e[18],n=x,l=q,i=N,a=g,c="destructive";let p;e[19]!==r?(p=I(r),e[19]=r,e[20]=p):p=e[20],e[21]!==p?(o=v("p",{className:"font-medium",children:p}),e[21]=p,e[22]=o):o=e[22],m=y===void 0?null:v("p",{className:"mt-1 whitespace-pre-wrap text-xs opacity-90",children:$(y)}),e[0]=N,e[1]=r,e[2]=t,e[3]=g,e[4]=l,e[5]=s,e[6]=n,e[7]=i,e[8]=a,e[9]=c,e[10]=o,e[11]=m}else l=e[4],s=e[5],n=e[6],i=e[7],a=e[8],c=e[9],o=e[10],m=e[11];let u;e[23]!==s?(u=s===void 0?null:v("a",{"aria-label":"View documentation for this error",className:"mt-1 inline-block text-xs underline",href:s,rel:"noreferrer",target:"_blank",children:"View error docs"}),e[23]=s,e[24]=u):u=e[24];let d;e[25]!==t||e[26]!==n||e[27]!==w?(d=t===void 0?null:v("button",{className:"mt-1 block text-xs underline outline-none focus-visible:ring-1 focus-visible:ring-ring","data-testid":"error-show-in-console",onClick:n,type:"button",children:w("Show in console")}),e[25]=t,e[26]=n,e[27]=w,e[28]=d):d=e[28];let f;return e[29]!==l||e[30]!==i||e[31]!==a||e[32]!==c||e[33]!==o||e[34]!==m||e[35]!==u||e[36]!==d?(f=D(l,{className:i,testId:a,variant:c,children:[o,m,u,d]}),e[29]=l,e[30]=i,e[31]=a,e[32]=c,e[33]=o,e[34]=m,e[35]=u,e[36]=d,e[37]=f):f=e[37],f};export{G as E};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{c as j}from"react/compiler-runtime";import{useState as H}from"react";import{ConfirmButton as Q}from"./ConfirmButton-CTL3f3kr.js";import{$ as M,_ as I,N as B,b as q,h as F,M as V,P as U,I as _}from"./dropdown-menu-C3RQ_HlW.js";import{M as W}from"./modal-shell-CUwwWC2o.js";import{useT as L}from"./DEFAULT_LOCALE-BZ4NojpD.js";import{h as z,c as G}from"./internal-BSIsQVC6.js";import{jsx as d,jsxs as N}from"react/jsx-runtime";const T="inline-flex items-center gap-1 rounded-md border border-border px-2.5 py-1 text-xs font-medium text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-50",K=/["\n,]/u,P=/^[=+\-@\t\r]/u,E=t=>{if(t==null)return"";let e;return typeof t=="string"?e=P.test(t)?` ${t}`:t:typeof t=="number"||typeof t=="boolean"||typeof t=="bigint"?e=String(t):e=JSON.stringify(t),K.test(e)?`"${e.replaceAll('"','""')}"`:e},X=(t,e)=>{const n=t.map(o=>E(o)).join(","),a=e.map(o=>t.map(l=>E(o[l])).join(","));return[n,...a].join(`
|
|
2
|
+
`)},Y=t=>JSON.stringify(t,null,2),D=500,J=t=>`"${t.replaceAll('"','""')}"`,Z=t=>t==null?"NULL":typeof t=="number"?Number.isFinite(t)?String(t):"NULL":typeof t=="bigint"?String(t):typeof t=="boolean"?t?"1":"0":`'${(typeof t=="string"?t:JSON.stringify(t)).replaceAll("'","''")}'`,ee=(t,e,n)=>{if(e.length===0||n.length===0)return"";const a=e.map(l=>J(l)).join(", "),o=[];for(let l=0;l<n.length;l+=D){const i=n.slice(l,l+D).map(r=>` (${e.map(s=>Z(r[s])).join(", ")})`).join(`,
|
|
3
|
+
`);o.push(`INSERT INTO ${J(t)} (${a}) VALUES
|
|
4
|
+
${i};`)}return o.join(`
|
|
5
|
+
|
|
6
|
+
`)},A=(t,e,n)=>{if(!("document"in globalThis))return;const a=globalThis.URL.createObjectURL(new globalThis.Blob([e],{type:n})),o=globalThis.document.createElement("a");o.href=a,o.download=t,globalThis.document.body.append(o),o.click(),o.remove(),globalThis.URL.revokeObjectURL(a)},te=t=>{const e=j(36),{columns:n,name:a,rows:o}=t,l=L();let i;e[0]!==n||e[1]!==a||e[2]!==o?(i=()=>{A(`${a}.csv`,X(n,o),"text/csv;charset=utf-8")},e[0]=n,e[1]=a,e[2]=o,e[3]=i):i=e[3];const r=i;let s;e[4]!==a||e[5]!==o?(s=()=>{A(`${a}.json`,Y(o),"application/json")},e[4]=a,e[5]=o,e[6]=s):s=e[6];const m=s;let g;e[7]!==n||e[8]!==a||e[9]!==o?(g=()=>{A(`${a}.sql`,ee(a,n,o),"application/sql;charset=utf-8")},e[7]=n,e[8]=a,e[9]=o,e[10]=g):g=e[10];const c=g,b=o.length===0;let p;e[11]!==b?(p=d(M,{className:T,"data-testid":"grid-export",disabled:b,title:"Exports only the rows loaded on the current page, not the whole table",children:"Export page"}),e[11]=b,e[12]=p):p=e[12];let $;e[13]===Symbol.for("react.memo_cache_sentinel")?($=d(I,{children:"Export loaded rows"}),e[13]=$):$=e[13];let u;e[14]!==l?(u=l("CSV"),e[14]=l,e[15]=u):u=e[15];let f;e[16]!==r||e[17]!==u?(f=d(B,{"data-testid":"grid-export-csv",onClick:r,children:u}),e[16]=r,e[17]=u,e[18]=f):f=e[18];let k;e[19]!==l?(k=l("JSON"),e[19]=l,e[20]=k):k=e[20];let C;e[21]!==m||e[22]!==k?(C=d(B,{"data-testid":"grid-export-json",onClick:m,children:k}),e[21]=m,e[22]=k,e[23]=C):C=e[23];let y;e[24]!==l?(y=l("SQL"),e[24]=l,e[25]=y):y=e[25];let h;e[26]!==c||e[27]!==y?(h=d(B,{"data-testid":"grid-export-sql",onClick:c,children:y}),e[26]=c,e[27]=y,e[28]=h):h=e[28];let x;e[29]!==C||e[30]!==h||e[31]!==f?(x=N(q,{align:"end",children:[$,f,C,h]}),e[29]=C,e[30]=h,e[31]=f,e[32]=x):x=e[32];let w;return e[33]!==x||e[34]!==p?(w=N(F,{children:[p,x]}),e[33]=x,e[34]=p,e[35]=w):w=e[35],w},le=t=>{const e=j(9),{column:n}=t;let a;e[0]!==n?(a=()=>{n.toggleVisibility()},e[0]=n,e[1]=a):a=e[1];const o=a;let l;e[2]!==n?(l=n.getIsVisible(),e[2]=n,e[3]=l):l=e[3];const i=`grid-column-${n.id}`;let r;return e[4]!==n.id||e[5]!==o||e[6]!==l||e[7]!==i?(r=d(U,{checked:l,closeOnClick:!1,"data-testid":i,onCheckedChange:o,children:n.id}),e[4]=n.id,e[5]=o,e[6]=l,e[7]=i,e[8]=r):r=e[8],r},ne=[],oe=({backRelations:t=ne,enabledBackRelations:e,onToggleBackRelation:n,table:a})=>{const o=L(),l=a.getIsAllColumnsVisible(),i=()=>{a.toggleAllColumnsVisible(!l)};return N(F,{children:[d(M,{className:T,"data-testid":"grid-columns",children:o("Columns")}),N(q,{align:"end",className:"max-h-80 overflow-y-auto",children:[N(V,{children:[d(I,{children:o("Columns")}),d(U,{checked:l,closeOnClick:!1,"data-testid":"grid-columns-all",onCheckedChange:i,children:o(l?"Hide all":"Show all")}),d(_,{}),a.getAllLeafColumns().filter(r=>!r.id.startsWith("__back__:")).map(r=>d(le,{column:r},r.id))]}),t.length>0&&n!==void 0&&N(V,{children:[d(_,{}),d(I,{children:o("Related")}),t.map(r=>{const s=`${r.table}.${r.column}`;return d(U,{checked:e?.has(s)===!0,closeOnClick:!1,"data-testid":`grid-back-relation-${s}`,onCheckedChange:()=>{n(s)},children:`← ${r.table}.${r.column}`},s)})]})]})]})},ae=t=>{const e=j(19),{count:n,editable:a,onClear:o,onDelete:l}=t,i=L();let r;e[0]!==n||e[1]!==i?(r=i("{count} selected",{count:n}),e[0]=n,e[1]=i,e[2]=r):r=e[2];let s;e[3]!==r?(s=d("span",{className:"font-medium tabular-nums","data-testid":"grid-selection-count",children:r}),e[3]=r,e[4]=s):s=e[4];let m;e[5]!==i?(m=i("Clear"),e[5]=i,e[6]=m):m=e[6];let g;e[7]!==o||e[8]!==m?(g=d("button",{className:T,"data-testid":"grid-selection-clear",onClick:o,type:"button",children:m}),e[7]=o,e[8]=m,e[9]=g):g=e[9];let c;e[10]!==n||e[11]!==a||e[12]!==l||e[13]!==i?(c=a&&d(Q,{confirmLabel:i("Delete {count} rows?",{count:n}),onConfirm:l,testId:"grid-selection-delete",children:i("Delete {count}",{count:n})}),e[10]=n,e[11]=a,e[12]=l,e[13]=i,e[14]=c):c=e[14];let b;return e[15]!==s||e[16]!==g||e[17]!==c?(b=N("div",{className:"flex items-center gap-2 rounded-md border border-border bg-accent/40 px-3 py-1.5 text-xs","data-testid":"grid-selection-bar",children:[s,g,c]}),e[15]=s,e[16]=g,e[17]=c,e[18]=b):b=e[18],b},he=t=>{const e=j(32),{column:n,onClose:a,value:o}=t,l=L(),[i,r]=H(!1);let s;e[0]!==o?(s=z(o),e[0]=o,e[1]=s):s=e[1];const m=s;let g;e[2]!==m?(g=()=>{G(m)&&r(!0)},e[2]=m,e[3]=g):g=e[3];const c=g;let b;e[4]!==l?(b=l("Cell value"),e[4]=l,e[5]=b):b=e[5];let p;e[6]!==n?(p=d("h2",{className:"truncate font-mono text-sm font-semibold text-foreground",children:n}),e[6]=n,e[7]=p):p=e[7];let $;e[8]!==i||e[9]!==l?($=l(i?"Copied":"Copy"),e[8]=i,e[9]=l,e[10]=$):$=e[10];let u;e[11]!==c||e[12]!==$?(u=d("button",{className:T,"data-testid":"grid-cell-copy",onClick:c,type:"button",children:$}),e[11]=c,e[12]=$,e[13]=u):u=e[13];let f;e[14]!==l?(f=l("Close"),e[14]=l,e[15]=f):f=e[15];let k;e[16]!==a||e[17]!==f?(k=d("button",{className:T,"data-testid":"grid-cell-close",onClick:a,type:"button",children:f}),e[16]=a,e[17]=f,e[18]=k):k=e[18];let C;e[19]!==u||e[20]!==k?(C=N("div",{className:"flex items-center gap-1.5",children:[u,k]}),e[19]=u,e[20]=k,e[21]=C):C=e[21];let y;e[22]!==p||e[23]!==C?(y=N("div",{className:"flex items-center justify-between",children:[p,C]}),e[22]=p,e[23]=C,e[24]=y):y=e[24];let h;e[25]!==m?(h=d("pre",{className:"min-h-0 flex-1 overflow-auto rounded-md border border-border bg-muted/30 p-3 font-mono text-xs whitespace-pre-wrap","data-testid":"grid-cell-value",children:m}),e[25]=m,e[26]=h):h=e[26];let x;return e[27]!==a||e[28]!==y||e[29]!==h||e[30]!==b?(x=N(W,{className:"max-h-[70vh] w-[min(40rem,90vw)]",label:b,onClose:a,panelTestId:"grid-cell-dialog",testId:"grid-cell-dialog-overlay",variant:"dialog",children:[y,h]}),e[27]=a,e[28]=y,e[29]=h,e[30]=b,e[31]=x):x=e[31],x},be=t=>{const e=j(36),{backRelations:n,enabledBackRelations:a,onToggleBackRelation:o,columns:l,editable:i,name:r,onBulkDelete:s,onToggleTranspose:m,rows:g,table:c,transposed:b}=t,p=L();let $;e[0]!==c?($=c.getSelectedRowModel(),e[0]=c,e[1]=$):$=e[1];const u=$.rows;let f;e[2]!==c?(f=()=>{c.resetRowSelection()},e[2]=c,e[3]=f):f=e[3];const k=f;let C;e[4]!==s||e[5]!==u||e[6]!==c?(C=()=>{s(u.map(re)),c.resetRowSelection()},e[4]=s,e[5]=u,e[6]=c,e[7]=C):C=e[7];const y=C;let h;e[8]!==l||e[9]!==r||e[10]!==g?(h=d(te,{columns:l,name:r,rows:g}),e[8]=l,e[9]=r,e[10]=g,e[11]=h):h=e[11];let x;e[12]!==n||e[13]!==a||e[14]!==o||e[15]!==c?(x=d(oe,{backRelations:n,enabledBackRelations:a,onToggleBackRelation:o,table:c}),e[12]=n,e[13]=a,e[14]=o,e[15]=c,e[16]=x):x=e[16];let w;e[17]!==p?(w=p("Swap rows and columns"),e[17]=p,e[18]=w):w=e[18];let v;e[19]!==p?(v=p("Transpose"),e[19]=p,e[20]=v):v=e[20];let R;e[21]!==m||e[22]!==w||e[23]!==v||e[24]!==b?(R=d("button",{"aria-pressed":b,className:T,"data-testid":"grid-transpose",onClick:m,title:w,type:"button",children:v}),e[21]=m,e[22]=w,e[23]=v,e[24]=b,e[25]=R):R=e[25];let S;e[26]!==i||e[27]!==k||e[28]!==y||e[29]!==u.length?(S=u.length>0&&d(ae,{count:u.length,editable:i,onClear:k,onDelete:y}),e[26]=i,e[27]=k,e[28]=y,e[29]=u.length,e[30]=S):S=e[30];let O;return e[31]!==h||e[32]!==x||e[33]!==R||e[34]!==S?(O=N("div",{className:"flex flex-wrap items-center gap-1.5","data-testid":"grid-actions",children:[h,x,R,S]}),e[31]=h,e[32]=x,e[33]=R,e[34]=S,e[35]=O):O=e[35],O};function re(t){return t.id}export{te as K,he as i,be as r,ae as z};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{c as L}from"react/compiler-runtime";import{useNavigate as Qe}from"@tanstack/react-router";import{useState as Ee,useEffect as Fe,lazy as nt,Suspense as at}from"react";import{g as Ye}from"./badge-BbuuAio7.js";import{u as Ze,c as K}from"./card-CIDGUN6K.js";import{E as rt}from"./empty-state-Cg7t_8qu.js";import{N as _e}from"./use-admin-query-QJ-ibl5u.js";import{useT as I}from"./DEFAULT_LOCALE-BZ4NojpD.js";import{ADMIN_FUNCTIONS as Ne}from"./ADMIN_FUNCTIONS-BnD4aovm.js";import{f as Se,d as st,g as ot,r as lt,c as it,k as ct}from"./internal-BSIsQVC6.js";import{c as Xe}from"./utils-bhneXptQ.js";import{deriveInsights as dt}from"./DEFAULT_INSIGHT_THRESHOLDS-B-hcFVoi.js";import{useLunora as et}from"@lunora/react";import{jsx as r,jsxs as h}from"react/jsx-runtime";import{u as We}from"./button-BkCrNcAs.js";const mt=ot(Ne.studioFeatures),tt={analytics:!0,auth:!0,containers:!0,flags:!0,kv:!0,mail:!0,notifications:!0,payments:!0,queues:!0,scheduler:!0,storage:!0,vectors:!0,workflows:!0},ut=t=>{if(t===null||typeof t!="object")return tt;const e=t,a=n=>typeof e[n]=="boolean"?e[n]:!0;return{analytics:a("analytics"),auth:a("auth"),containers:a("containers"),flags:a("flags"),kv:a("kv"),mail:a("mail"),notifications:a("notifications"),payments:a("payments"),queues:a("queues"),scheduler:a("scheduler"),storage:a("storage"),vectors:a("vectors"),workflows:a("workflows")}},pt=()=>{const t=L(3),e=et(),[a,n]=Ee(tt);let s,o;return t[0]!==e?(s=()=>{Se((async()=>{try{n(ut(await e.query(mt,{},st(""))))}catch{}})())},o=[e],t[0]=e,t[1]=s,t[2]=o):(s=t[1],o=t[2]),Fe(s,o),a},ft=()=>{const t=L(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=r("svg",{"aria-hidden":"true",className:"size-4 text-muted-foreground",fill:"none",stroke:"currentColor",strokeWidth:1.6,viewBox:"0 0 24 24",children:r("path",{d:"m9 6 6 6-6 6",strokeLinecap:"round",strokeLinejoin:"round"})}),t[0]=e):e=t[0],e},ht=t=>{const e=L(24),{group:a}=t,n=I(),s=Qe();let o;e[0]!==a.tab||e[1]!==s?(o=()=>{Se(s({to:`/${a.tab}`}))},e[0]=a.tab,e[1]=s,e[2]=o):o=e[2];const l=o,i=a.bindings.length;let c;e[3]!==a.label?(c=r("span",{className:"text-sm font-medium text-foreground",children:a.label}),e[3]=a.label,e[4]=c):c=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=r(ft,{}),e[5]=u):u=e[5];let d;e[6]!==c?(d=h("div",{className:"flex items-center justify-between",children:[c,u]}),e[6]=c,e[7]=d):d=e[7];let p;e[8]!==i||e[9]!==n?(p=i===1?n("1 binding"):n("{count} bindings",{count:i}),e[8]=i,e[9]=n,e[10]=p):p=e[10];let m;e[11]!==p?(m=r("span",{className:"text-xs text-muted-foreground",children:p}),e[11]=p,e[12]=m):m=e[12];let f;e[13]!==i||e[14]!==a.bindings?(f=i>0&&r("div",{className:"flex flex-wrap gap-1.5",children:a.bindings.map(bt)}),e[13]=i,e[14]=a.bindings,e[15]=f):f=e[15];let g;e[16]!==d||e[17]!==m||e[18]!==f?(g=h(Ze,{className:"flex flex-col gap-2 py-4",children:[d,m,f]}),e[16]=d,e[17]=m,e[18]=f,e[19]=g):g=e[19];let x;return e[20]!==a.testId||e[21]!==l||e[22]!==g?(x=r(K,{className:"cursor-pointer gap-0 py-0 transition-colors hover:bg-muted/40","data-testid":a.testId,onClick:l,children:g}),e[20]=a.testId,e[21]=l,e[22]=g,e[23]=x):x=e[23],x},Ue=["kv","files","vectors"],gt=(t,e)=>[...t.filter(a=>a.tab!==e.tab),e].toSorted((a,n)=>Ue.indexOf(a.tab)-Ue.indexOf(n.tab)),xt=()=>{const t=L(19),e=et(),a=pt(),n=I();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=[],t[0]=s):s=t[0];const[o,l]=Ee(s);let i,c;if(t[1]!==e||t[2]!==a.kv||t[3]!==a.storage||t[4]!==a.vectors||t[5]!==n?(i=()=>{const g={cancelled:!1},x=[{enabled:a.kv,label:n("KV Namespaces"),load:async()=>(await e.listKvNamespaces()).map(yt),tab:"kv",testId:"home-binding-kv"},{enabled:a.storage,label:n("R2 Buckets"),load:()=>e.listStorageBuckets(),tab:"files",testId:"home-binding-r2"},{enabled:a.vectors,label:n("Vectorize Indexes"),load:async()=>(await e.listVectorIndexes()).map(vt),tab:"vectors",testId:"home-binding-vectors"}];for(const b of x)b.enabled&&Se((async()=>{try{const y=await b.load();if(!g.cancelled){const S={bindings:y,label:b.label,tab:b.tab,testId:b.testId};l(M=>gt(M,S))}}catch{}})());return()=>{g.cancelled=!0}},c=[e,a.kv,a.storage,a.vectors,n],t[1]=e,t[2]=a.kv,t[3]=a.storage,t[4]=a.vectors,t[5]=n,t[6]=i,t[7]=c):(i=t[6],c=t[7]),Fe(i,c),o.length===0)return null;let u;t[8]!==n?(u=n("Bindings"),t[8]=n,t[9]=u):u=t[9];let d;t[10]!==u?(d=r("h2",{className:"text-sm font-semibold tracking-tight text-foreground",children:u}),t[10]=u,t[11]=d):d=t[11];let p;t[12]!==o?(p=o.map(Nt),t[12]=o,t[13]=p):p=t[13];let m;t[14]!==p?(m=r("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:p}),t[14]=p,t[15]=m):m=t[15];let f;return t[16]!==d||t[17]!==m?(f=h("section",{className:"flex flex-col gap-3","data-testid":"home-bindings",children:[d,m]}),t[16]=d,t[17]=m,t[18]=f):f=t[18],f};function bt(t){return r(Ye,{variant:"secondary",children:t},t)}function yt(t){return t.binding}function vt(t){return t.name}function Nt(t){return r(ht,{group:t},t.tab)}const _t=[{name:"lunora_list_functions",summary:"list every query, mutation, and action with its path"},{name:"lunora_list_tables",summary:"list the schema's tables"},{name:"lunora_get_function_schema",summary:"read a function's argument JSON Schema before calling it"},{name:"lunora_run_query",summary:"run a read-only query"},{name:"lunora_run_mutation",summary:"run a mutation — writes; only when LUNORA_MCP_ALLOW_WRITES is set"},{name:"lunora_run_action",summary:"run an action — writes/effects; only when LUNORA_MCP_ALLOW_WRITES is set"}],St=t=>JSON.stringify({mcpServers:{lunora:{args:["-y","@lunora/mcp"],command:"npx",env:{LUNORA_ADMIN_TOKEN:"<your-admin-token>",LUNORA_URL:t}}}},null,2),kt=t=>{const e=_t.map(a=>`- ${a.name} — ${a.summary}`).join(`
|
|
2
|
+
`);return[`You have a Lunora MCP server connected to the deployment at ${t}.`,"It exposes this backend's functions and schema so you can inspect and operate it:",e,"",`Start by calling lunora_list_functions and lunora_list_tables to learn what exists, then lunora_get_function_schema before any run call. The full HTTP API is also documented at ${t}/_lunora/admin/openapi (that endpoint needs the same admin token the MCP server is configured with).`].join(`
|
|
3
|
+
`)},wt=1500,$t=()=>{const t=L(35),e=I();let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=lt(),t[0]=a):a=t[0];const n=a,[s,o]=Ee(null);let l,i;t[1]!==s?(l=()=>{if(s===null)return;const A=globalThis.setTimeout(()=>{o(null)},wt);return()=>{globalThis.clearTimeout(A)}},i=[s],t[1]=s,t[2]=l,t[3]=i):(l=t[2],i=t[3]),Fe(l,i);let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=(A,C)=>{it(C)&&o(A)},t[4]=c):c=t[4];const u=c;let d;t[5]===Symbol.for("react.memo_cache_sentinel")?(d=()=>{u("config",St(n))},t[5]=d):d=t[5];const p=d;let m;t[6]===Symbol.for("react.memo_cache_sentinel")?(m=()=>{u("prompt",kt(n))},t[6]=m):m=t[6];const f=m;let g;t[7]!==e?(g=e("Connect an AI agent"),t[7]=e,t[8]=g):g=t[8];let x;t[9]!==g?(x=r("span",{className:"text-sm font-medium text-foreground",children:g}),t[9]=g,t[10]=x):x=t[10];let b;t[11]!==e?(b=e("Drive this deployment from an AI agent over the Model Context Protocol — it can list functions and tables, read schemas, and run read-only queries. Writes stay off unless you opt in."),t[11]=e,t[12]=b):b=t[12];let y;t[13]!==b?(y=r("span",{className:"text-xs text-muted-foreground",children:b}),t[13]=b,t[14]=y):y=t[14];let S;t[15]!==x||t[16]!==y?(S=h("div",{className:"flex flex-col gap-1.5 p-4",children:[x,y]}),t[15]=x,t[16]=y,t[17]=S):S=t[17];let M;t[18]===Symbol.for("react.memo_cache_sentinel")?(M=r("code",{className:"font-mono text-xs text-muted-foreground","data-testid":"home-connect-agent-command",children:"npx -y @lunora/mcp"}),t[18]=M):M=t[18];let k;t[19]!==s||t[20]!==e?(k=e(s==="config"?"Copied":"Copy MCP config"),t[19]=s,t[20]=e,t[21]=k):k=t[21];let v;t[22]!==k?(v=r(We,{"data-testid":"home-connect-agent-copy-config",onClick:p,size:"xs",variant:"outline",children:k}),t[22]=k,t[23]=v):v=t[23];let w;t[24]!==s||t[25]!==e?(w=e(s==="prompt"?"Copied":"Copy agent prompt"),t[24]=s,t[25]=e,t[26]=w):w=t[26];let $;t[27]!==w?($=r(We,{"data-testid":"home-connect-agent-copy-prompt",onClick:f,size:"xs",variant:"outline",children:w}),t[27]=w,t[28]=$):$=t[28];let N;t[29]!==v||t[30]!==$?(N=h("div",{className:"flex flex-col gap-3 border-t border-border bg-muted/50 px-4 py-3",children:[M,h("div",{className:"flex flex-wrap gap-2",children:[v,$]})]}),t[29]=v,t[30]=$,t[31]=N):N=t[31];let _;return t[32]!==S||t[33]!==N?(_=h(K,{className:"gap-0 py-0","data-testid":"home-connect-agent",children:[S,N]}),t[32]=S,t[33]=N,t[34]=_):_=t[34],_},Lt=nt(()=>import("../packem_chunks/sparkline.js").then(t=>({default:t.Sparkline}))),Be=t=>{if(t<1e3)return`${String(Math.round(t))}ms`;const e=t>=1e4?0:1;return`${(t/1e3).toFixed(e)}s`},Mt=(t,e)=>{const a=Math.max(0,Math.round((e-t)/1e3));if(a<60)return`${String(a)}s ago`;const n=Math.round(a/60);if(n<60)return`${String(n)}m ago`;const s=Math.round(n/60);return s<24?`${String(s)}h ago`:`${String(Math.round(s/24))}d ago`},He=(t,e)=>{if(t===void 0||t.length===0)return[];const a=new Map;for(const n of t)a.set(n.bucketMs,(a.get(n.bucketMs)??0)+n[e]);return[...a.entries()].toSorted(([n],[s])=>n-s).map(([,n])=>n)},Je=(t,e=!0)=>{if(t.length<4)return null;const a=Math.floor(t.length/2),n=t.slice(0,a).reduce((l,i)=>l+i,0),s=t.slice(a).reduce((l,i)=>l+i,0);if(n===0)return null;const o=(s-n)/n*100;return{positive:e?o>=0:o<=0,text:`${o>=0?"+":""}${o.toFixed(1)}%`}},Oe=t=>{const e=L(24),{delta:a,footer:n,label:s,trend:o,unit:l,value:i}=t,c=I();let u;e[0]!==s?(u=r("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:s}),e[0]=s,e[1]=u):u=e[1];let d;e[2]!==i?(d=r("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:i}),e[2]=i,e[3]=d):d=e[3];let p;e[4]!==l?(p=l!==void 0&&r("span",{className:"text-xs text-muted-foreground",children:l}),e[4]=l,e[5]=p):p=e[5];let m;e[6]!==d||e[7]!==p?(m=h("span",{className:"flex items-baseline gap-1.5",children:[d,p]}),e[6]=d,e[7]=p,e[8]=m):m=e[8];let f;e[9]!==o?(f=o!==void 0&&r(at,{fallback:r("div",{"aria-hidden":"true",className:"h-8 w-28"}),children:r(Lt,{data:o})}),e[9]=o,e[10]=f):f=e[10];let g;e[11]!==m||e[12]!==f?(g=h("div",{className:"flex items-center justify-between gap-3",children:[m,f]}),e[11]=m,e[12]=f,e[13]=g):g=e[13];let x;e[14]!==u||e[15]!==g?(x=h("div",{className:"flex flex-col gap-2.5 p-4",children:[u,g]}),e[14]=u,e[15]=g,e[16]=x):x=e[16];let b;e[17]!==a||e[18]!==n||e[19]!==c?(b=a==null?n!=null&&r("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5 text-[11px] text-muted-foreground",children:n}):h("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5 text-[11px]",children:[r("span",{className:Xe("font-semibold",a.positive?"text-success":"text-destructive"),children:a.text})," ",r("span",{className:"text-muted-foreground",children:c("vs. prev.")})]}),e[17]=a,e[18]=n,e[19]=c,e[20]=b):b=e[20];let y;return e[21]!==x||e[22]!==b?(y=h(K,{className:"justify-between gap-0 py-0",children:[x,b]}),e[21]=x,e[22]=b,e[23]=y):y=e[23],y},At=()=>{const t=L(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=r("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:r("path",{d:"m9 6 6 6-6 6"})}),t[0]=e):e=t[0],e},De=t=>{const e=L(7),{command:a,label:n}=t;let s;e[0]!==n?(s=r("div",{className:"p-4",children:r("span",{className:"text-sm font-medium text-foreground",children:n})}),e[0]=n,e[1]=s):s=e[1];let o;e[2]!==a?(o=r("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5",children:r("code",{className:"font-mono text-xs text-muted-foreground",children:a})}),e[2]=a,e[3]=o):o=e[3];let l;return e[4]!==s||e[5]!==o?(l=h(K,{className:"justify-between gap-0 py-0",children:[s,o]}),e[4]=s,e[5]=o,e[6]=l):l=e[6],l},Ge=t=>{const e=L(18),{count:a,onView:n,testId:s,title:o}=t,l=I();let i;e[0]!==o?(i=r("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:o}),e[0]=o,e[1]=i):i=e[1];let c;e[2]!==a||e[3]!==l?(c=a===null?r("span",{className:"text-xs text-muted-foreground",children:l("No data yet")}):r(Ye,{variant:a>0?"destructive":"success",children:a>0?a:l("All clear")}),e[2]=a,e[3]=l,e[4]=c):c=e[4];let u;e[5]!==i||e[6]!==c?(u=h("div",{className:"flex items-start justify-between gap-2 p-4",children:[i,c]}),e[5]=i,e[6]=c,e[7]=u):u=e[7];let d;e[8]!==l?(d=l("View"),e[8]=l,e[9]=d):d=e[9];let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p=r(At,{}),e[10]=p):p=e[10];let m;e[11]!==n||e[12]!==d?(m=h("button",{className:"flex items-center gap-1 border-t border-border bg-muted/50 px-4 py-2.5 text-[12px] font-medium text-foreground outline-none transition-colors hover:bg-muted focus-visible:bg-muted",onClick:n,type:"button",children:[d,p]}),e[11]=n,e[12]=d,e[13]=m):m=e[13];let f;return e[14]!==u||e[15]!==m||e[16]!==s?(f=h(K,{className:"justify-between gap-0 py-0","data-testid":s,children:[u,m]}),e[14]=u,e[15]=m,e[16]=s,e[17]=f):f=e[17],f},Ct=t=>{const e=L(7),{functions:a}=t,n=I();let s;if(e[0]!==a||e[1]!==n){const o=[...a].toSorted(Ot).slice(0,5);let l;e[3]!==n?(l=n("Top functions"),e[3]=n,e[4]=l):l=e[4];let i;e[5]!==l?(i=r("div",{className:"border-b border-border px-4 py-3",children:r("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:l})}),e[5]=l,e[6]=i):i=e[6],s=h(K,{className:"gap-0 py-0","data-testid":"home-top-functions",children:[i,o.length===0?r("p",{className:"px-4 py-8 text-center text-xs text-muted-foreground",children:n("No functions called yet.")}):h("div",{className:"divide-y divide-border",children:[h("div",{className:"grid grid-cols-[1fr_auto_auto_auto] gap-4 px-4 py-1.5 font-mono text-[10px] tracking-wide text-muted-foreground uppercase",children:[r("span",{children:n("Function")}),r("span",{className:"text-end",children:n("Calls")}),r("span",{className:"w-12 text-end",children:n("Avg")}),r("span",{className:"w-8 text-end",children:n("Err")})]}),o.map(Rt)]})]}),e[0]=a,e[1]=n,e[2]=s}else s=e[2];return s},It=t=>{const e=L(26),{subs:a}=t,n=I();let s;e[0]!==n?(s=n("Live connections"),e[0]=n,e[1]=s):s=e[1];let o;e[2]!==s?(o=r("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:s}),e[2]=s,e[3]=o):o=e[3];const l=a?.totalConnections??0;let i;e[4]!==l?(i=l.toLocaleString(),e[4]=l,e[5]=i):i=e[5];let c;e[6]!==i?(c=r("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:i}),e[6]=i,e[7]=c):c=e[7];let u;e[8]!==n?(u=n("sockets"),e[8]=n,e[9]=u):u=e[9];let d;e[10]!==u?(d=r("span",{className:"text-xs text-muted-foreground",children:u}),e[10]=u,e[11]=d):d=e[11];let p;e[12]!==c||e[13]!==d?(p=h("span",{className:"flex items-baseline gap-1.5",children:[c,d]}),e[12]=c,e[13]=d,e[14]=p):p=e[14];const m=a?.totalSubscriptions??0;let f;e[15]!==m?(f=m.toLocaleString(),e[15]=m,e[16]=f):f=e[16];let g;e[17]!==n?(g=n("active subscriptions"),e[17]=n,e[18]=g):g=e[18];let x;e[19]!==f||e[20]!==g?(x=h("span",{className:"text-[11px] text-muted-foreground",children:[f," ",g]}),e[19]=f,e[20]=g,e[21]=x):x=e[21];let b;return e[22]!==x||e[23]!==o||e[24]!==p?(b=r(K,{"data-testid":"home-live-connections",children:h(Ze,{className:"flex flex-col gap-2.5 py-4",children:[o,p,x]})}),e[22]=x,e[23]=o,e[24]=p,e[25]=b):b=e[25],b},jt=t=>{const e=L(7),{entries:a}=t,n=I();let s;if(e[0]!==a||e[1]!==n){const o=Date.now();let l;e[3]!==n?(l=n("Recent activity"),e[3]=n,e[4]=l):l=e[4];let i;e[5]!==l?(i=r("div",{className:"border-b border-border px-4 py-3",children:r("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:l})}),e[5]=l,e[6]=i):i=e[6],s=h(K,{className:"gap-0 py-0","data-testid":"home-recent-activity",children:[i,a.length===0?r("p",{className:"px-4 py-8 text-center text-xs text-muted-foreground",children:n("No recent activity.")}):r("ul",{className:"divide-y divide-border",children:a.slice(0,5).map(c=>h("li",{className:"flex items-center justify-between gap-3 px-4 py-2 text-[13px]",children:[h("span",{className:"flex min-w-0 items-center gap-2",children:[r("span",{"aria-hidden":"true",className:"size-1.5 shrink-0 rounded-full bg-muted-foreground/40"}),h("span",{className:"truncate text-foreground",children:[c.op,c.table!==void 0&&h("span",{className:"text-muted-foreground",children:[" · ",c.table,c.id===void 0?"":`#${c.id}`]})]})]}),r("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:Mt(c.ts,o)})]},c.seq))})]}),e[0]=a,e[1]=n,e[2]=s}else s=e[2];return s},Tt=t=>{const e=t.reduce((a,n)=>a+n.calls,0);return e===0?null:t.reduce((a,n)=>a+n.totalDurationMs,0)/e},Zt=t=>{const e=L(151),{initialShardKey:a}=t,n=I(),s=Qe(),o=a??"";let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={},e[0]=l):l=e[0];let i;e[1]!==o?(i={shardKey:o},e[1]=o,e[2]=i):i=e[2];const c=_e(Ne.getMetrics,l,i);let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u={},e[3]=u):u=e[3];let d;e[4]!==o?(d={shardKey:o},e[4]=o,e[5]=d):d=e[5];const p=_e(Ne.getFunctionStats,u,d);let m,f;e[6]===Symbol.for("react.memo_cache_sentinel")?(m={},f={shardKey:""},e[6]=m,e[7]=f):(m=e[6],f=e[7]);const g=_e(Ne.getSecurityAudit,m,f);let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x={},e[8]=x):x=e[8];let b;e[9]!==o?(b={shardKey:o},e[9]=o,e[10]=b):b=e[10];const y=_e(Ne.listSubscriptions,x,b);let S;e[11]===Symbol.for("react.memo_cache_sentinel")?(S={},e[11]=S):S=e[11];let M;e[12]!==o?(M={shardKey:o},e[12]=o,e[13]=M):M=e[13];const k=_e(Ne.getAuditLog,S,M),v=c.data??null;let w,$,N,_,A,C,P,j,T,z,D,B,O,R,E,F,V,W;if(e[14]!==k.data||e[15]!==g.data||e[16]!==v||e[17]!==c.data||e[18]!==s||e[19]!==p.data||e[20]!==y.data||e[21]!==n){_=Array.isArray(p.data?.functions)?p.data.functions:[],P=y.data??null;let Le;e[40]!==k.data?(Le=Array.isArray(k.data?.entries)?k.data.entries:[],e[40]=k.data,e[41]=Le):Le=e[41],$=Le,A=c.data===void 0||p.data===void 0?null:dt(v,_).length,C=Array.isArray(g.data?.findings)?g.data.findings.length:null;let Me;e[42]!==s?(Me=()=>{Se(s({to:"/security"}))},e[42]=s,e[43]=Me):Me=e[43],W=Me;let Ae;e[44]!==s?(Ae=()=>{Se(s({to:"/insights"}))},e[44]=s,e[45]=Ae):Ae=e[45],V=Ae;const Ce=He(v?.history,"calls"),Ie=He(v?.history,"errors"),Ve=Tt(_),je=Math.max(0,..._.map(qt)),q=v?.cache;let Te;e[46]!==q?(Te=q!=null&&q.hits+q.misses>0?Math.round(q.hits/(q.hits+q.misses)*100):null,e[46]=q,e[47]=Te):Te=e[47],N=Te,E="flex flex-col gap-6",F="lunora-home",D="grid gap-3 sm:grid-cols-2 xl:grid-cols-4",B="home-health";const qe=Je(Ce);let xe;e[48]!==n?(xe=n("Requests"),e[48]=n,e[49]=xe):xe=e[49];const Ke=v?.requests??0;let be;e[50]!==Ke?(be=Ke.toLocaleString(),e[50]=Ke,e[51]=be):be=e[51],e[52]!==Ce||e[53]!==qe||e[54]!==xe||e[55]!==be?(O=r(Oe,{delta:qe,label:xe,trend:Ce,value:be}),e[52]=Ce,e[53]=qe,e[54]=xe,e[55]=be,e[56]=O):O=e[56];const Pe=Je(Ie,!1);let ye;e[57]!==n?(ye=n("Errors"),e[57]=n,e[58]=ye):ye=e[58];const ze=v?.errors??0;let ve;e[59]!==ze?(ve=ze.toLocaleString(),e[59]=ze,e[60]=ve):ve=e[60],e[61]!==Ie||e[62]!==Pe||e[63]!==ye||e[64]!==ve?(R=r(Oe,{delta:Pe,label:ye,trend:Ie,value:ve}),e[61]=Ie,e[62]=Pe,e[63]=ye,e[64]=ve,e[65]=R):R=e[65],w=Oe,e[66]!==je||e[67]!==n?(j=je>0?`${n("max")} ${Be(je)}`:void 0,e[66]=je,e[67]=n,e[68]=j):j=e[68],e[69]!==n?(T=n("Avg latency"),e[69]=n,e[70]=T):T=e[70],z=Ve===null?"—":Be(Ve),e[14]=k.data,e[15]=g.data,e[16]=v,e[17]=c.data,e[18]=s,e[19]=p.data,e[20]=y.data,e[21]=n,e[22]=w,e[23]=$,e[24]=N,e[25]=_,e[26]=A,e[27]=C,e[28]=P,e[29]=j,e[30]=T,e[31]=z,e[32]=D,e[33]=B,e[34]=O,e[35]=R,e[36]=E,e[37]=F,e[38]=V,e[39]=W}else w=e[22],$=e[23],N=e[24],_=e[25],A=e[26],C=e[27],P=e[28],j=e[29],T=e[30],z=e[31],D=e[32],B=e[33],O=e[34],R=e[35],E=e[36],F=e[37],V=e[38],W=e[39];let U;e[71]!==w||e[72]!==j||e[73]!==T||e[74]!==z?(U=r(w,{footer:j,label:T,value:z}),e[71]=w,e[72]=j,e[73]=T,e[74]=z,e[75]=U):U=e[75];let H;e[76]!==N||e[77]!==n?(H=N===null?void 0:`${String(N)}% ${n("cache hit")}`,e[76]=N,e[77]=n,e[78]=H):H=e[78];let J;e[79]!==n?(J=n("Database size"),e[79]=n,e[80]=J):J=e[80];const Re=v?.databaseSize??null;let G;e[81]!==Re?(G=ct(Re),e[81]=Re,e[82]=G):G=e[82];let Q;e[83]!==H||e[84]!==J||e[85]!==G?(Q=r(Oe,{footer:H,label:J,value:G}),e[83]=H,e[84]=J,e[85]=G,e[86]=Q):Q=e[86];let Y;e[87]!==D||e[88]!==B||e[89]!==O||e[90]!==R||e[91]!==U||e[92]!==Q?(Y=h("div",{className:D,"data-testid":B,children:[O,R,U,Q]}),e[87]=D,e[88]=B,e[89]=O,e[90]=R,e[91]=U,e[92]=Q,e[93]=Y):Y=e[93];let ke;e[94]===Symbol.for("react.memo_cache_sentinel")?(ke=r(xt,{}),e[94]=ke):ke=e[94];let Z;e[95]!==_?(Z=r("div",{className:"lg:col-span-2",children:r(Ct,{functions:_})}),e[95]=_,e[96]=Z):Z=e[96];let X;e[97]!==P?(X=r(It,{subs:P}),e[97]=P,e[98]=X):X=e[98];let ee;e[99]!==$?(ee=r(jt,{entries:$}),e[99]=$,e[100]=ee):ee=e[100];let te;e[101]!==X||e[102]!==ee?(te=h("div",{className:"flex flex-col gap-3",children:[X,ee]}),e[101]=X,e[102]=ee,e[103]=te):te=e[103];let ne;e[104]!==Z||e[105]!==te?(ne=h("div",{className:"grid gap-3 lg:grid-cols-3",children:[Z,te]}),e[104]=Z,e[105]=te,e[106]=ne):ne=e[106];let ae;e[107]!==n?(ae=n("Advisors"),e[107]=n,e[108]=ae):ae=e[108];let re;e[109]!==ae?(re=r("h2",{className:"text-sm font-semibold tracking-tight text-foreground",children:ae}),e[109]=ae,e[110]=re):re=e[110];let se;e[111]!==A||e[112]!==C||e[113]!==n||e[114]!==V||e[115]!==W?(se=C===0&&A===0?r(rt,{description:n("No security or performance issues detected."),icon:h("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[r("path",{d:"M12 3 4 6v5c0 5 3.4 8.5 8 10 4.6-1.5 8-5 8-10V6l-8-3Z"}),r("path",{d:"m9 12 2 2 4-4"})]}),testId:"home-advisors-clear",title:n("No issues found")}):h("div",{className:"grid gap-3 sm:grid-cols-2",children:[r(Ge,{count:C,onView:W,testId:"home-security",title:n("Security findings")}),r(Ge,{count:A,onView:V,testId:"home-performance",title:n("Performance issues")})]}),e[111]=A,e[112]=C,e[113]=n,e[114]=V,e[115]=W,e[116]=se):se=e[116];let oe;e[117]!==re||e[118]!==se?(oe=h("section",{className:"flex flex-col gap-3","data-testid":"home-advisors",children:[re,se]}),e[117]=re,e[118]=se,e[119]=oe):oe=e[119];let le;e[120]!==n?(le=n("Get connected"),e[120]=n,e[121]=le):le=e[121];let ie;e[122]!==le?(ie=r("h2",{className:"text-sm font-semibold tracking-tight text-foreground",children:le}),e[122]=le,e[123]=ie):ie=e[123];let ce;e[124]!==n?(ce=n("Client SDK"),e[124]=n,e[125]=ce):ce=e[125];let de;e[126]!==ce?(de=r(De,{command:"npm i @lunora/client",label:ce}),e[126]=ce,e[127]=de):de=e[127];let me;e[128]!==n?(me=n("React"),e[128]=n,e[129]=me):me=e[129];let ue;e[130]!==me?(ue=r(De,{command:"npm i @lunora/react",label:me}),e[130]=me,e[131]=ue):ue=e[131];let pe;e[132]!==n?(pe=n("CLI"),e[132]=n,e[133]=pe):pe=e[133];let fe;e[134]!==pe?(fe=r(De,{command:"lunora dev",label:pe}),e[134]=pe,e[135]=fe):fe=e[135];let he;e[136]!==de||e[137]!==ue||e[138]!==fe?(he=h("div",{className:"grid gap-3 sm:grid-cols-3",children:[de,ue,fe]}),e[136]=de,e[137]=ue,e[138]=fe,e[139]=he):he=e[139];let we;e[140]===Symbol.for("react.memo_cache_sentinel")?(we=r($t,{}),e[140]=we):we=e[140];let ge;e[141]!==ie||e[142]!==he?(ge=h("section",{className:"flex flex-col gap-3","data-testid":"home-get-connected",children:[ie,he,we]}),e[141]=ie,e[142]=he,e[143]=ge):ge=e[143];let $e;return e[144]!==E||e[145]!==F||e[146]!==Y||e[147]!==ne||e[148]!==oe||e[149]!==ge?($e=h("div",{className:E,"data-testid":F,children:[Y,ke,ne,oe,ge]}),e[144]=E,e[145]=F,e[146]=Y,e[147]=ne,e[148]=oe,e[149]=ge,e[150]=$e):$e=e[150],$e};function Ot(t,e){return e.calls-t.calls}function Rt(t){return h("div",{className:"grid grid-cols-[1fr_auto_auto_auto] items-center gap-4 px-4 py-2 text-[13px]",children:[r("span",{className:"truncate font-mono text-xs text-foreground",children:t.path}),r("span",{className:"text-end tabular-nums",children:t.calls.toLocaleString()}),r("span",{className:"w-12 text-end tabular-nums text-muted-foreground",children:Be(t.calls>0?t.totalDurationMs/t.calls:0)}),r("span",{className:Xe("w-8 text-end tabular-nums",t.errors>0?"text-destructive":"text-muted-foreground"),children:t.errors})]},t.path)}function qt(t){return t.maxDurationMs}export{Zt as H,pt as S};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as o}from"react/compiler-runtime";import"react";import{Input as l}from"@base-ui/react/input";import{c as s}from"./utils-bhneXptQ.js";import{jsx as u}from"react/jsx-runtime";function g(d){const i=o(10);let e,r,t;i[0]!==d?({className:e,type:t,...r}=d,i[0]=d,i[1]=e,i[2]=r,i[3]=t):(e=i[1],r=i[2],t=i[3]);let n;i[4]!==e?(n=s("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",e),i[4]=e,i[5]=n):n=i[5];let a;return i[6]!==r||i[7]!==n||i[8]!==t?(a=u(l,{type:t,"data-slot":"input",className:n,...r}),i[6]=r,i[7]=n,i[8]=t,i[9]=a):a=i[9],a}export{g as u};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const n=(t,r,e,o,i)=>{switch(r){case"action":return t.action(e,o,i);case"mutation":return t.mutation(e,o,i);default:return t.query(e,o,i)}},s=t=>({__lunoraRef:t}),c=t=>{const r=t.trim();return r===""?{}:{shardKey:r}},l=t=>t instanceof Error?t.message:String(t),u=t=>{if(t===null||typeof t!="object"||!("code"in t))return;const{code:r}=t;return typeof r=="string"?r:void 0},f=t=>{if(t===null||typeof t!="object"||!("hint"in t))return;const{hint:r}=t;return typeof r=="string"?r:Array.isArray(r)?r.filter(e=>typeof e=="string").join(`
|
|
2
|
+
`):void 0},g=t=>{if(t===null||typeof t!="object"||!("docsUrl"in t))return;const r=t.docsUrl;if(typeof r=="string")try{const{protocol:e}=new URL(r);return e==="http:"||e==="https:"?r:void 0}catch{return}},d=t=>{if(t==null)return"";switch(typeof t){case"bigint":case"boolean":case"number":return t.toString();case"string":return t;case"symbol":return t.toString();default:return JSON.stringify(t)}},a=(t,r)=>{t.catch(e=>{})},p=t=>{if(t!==void 0&&t!=="")return t;const r=globalThis.location;return r?.origin!==void 0&&r.origin!==""?r.origin:"http://localhost:5173"},y=t=>{const r="navigator"in globalThis?globalThis.navigator.clipboard:void 0;return r===void 0?!1:(a(r.writeText(t)),!0)},h=t=>{if(t==null)return"—";if(t<1024)return`${t.toString()} B`;const r=["KB","MB","GB","TB"];let e=t/1024,o=0;for(;e>=1024&&o<r.length-1;)e/=1024,o+=1;return`${e.toFixed(1)} ${r[o]??"TB"}`},m=(t,r="")=>{if(t==null||t==="")return r;const e=new Date(t);return Number.isNaN(e.getTime())?String(t):e.toLocaleString()};export{g as a,l as b,y as c,c as d,f as e,a as f,s as g,d as h,m as i,n as j,h as k,u as l,p as r};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as n}from"react/compiler-runtime";import"react";import{c as s}from"./utils-bhneXptQ.js";import{jsx as i}from"react/jsx-runtime";function u(r){const e=n(8);let t,a;e[0]!==r?({className:t,...a}=r,e[0]=r,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let o;e[3]!==t?(o=s("flex items-center gap-2 text-xs leading-none select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==a||e[6]!==o?(l=i("label",{"data-slot":"label",className:o,...a}),e[5]=a,e[6]=o,e[7]=l):l=e[7],l}export{u as p};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as v}from"react/compiler-runtime";import{useT as f}from"./DEFAULT_LOCALE-BZ4NojpD.js";import{u as p}from"./operation-console-provider-BMJNtiyB.js";import{jsx as d,jsxs as x}from"react/jsx-runtime";const C=m=>{const e=v(14),{message:i,prefix:n}=m,r=f(),o=p();let l;e[0]!==o?(l=()=>{o?.openConsole({errorsOnly:!0})},e[0]=o,e[1]=l):l=e[1];const c=l;if(i===void 0)return null;const u=`${n}-live-error`;let t;e[2]!==i||e[3]!==r?(t=r("Live unavailable: {liveError}",{liveError:i}),e[2]=i,e[3]=r,e[4]=t):t=e[4];let s;e[5]!==o||e[6]!==n||e[7]!==c||e[8]!==r?(s=o===void 0?null:d("button",{className:"underline outline-none focus-visible:ring-1 focus-visible:ring-ring","data-testid":`${n}-live-error-console`,onClick:c,type:"button",children:r("Show in console")}),e[5]=o,e[6]=n,e[7]=c,e[8]=r,e[9]=s):s=e[9];let a;return e[10]!==u||e[11]!==t||e[12]!==s?(a=x("span",{className:"flex items-center gap-1.5 text-xs text-destructive","data-testid":u,role:"status",children:[t,s]}),e[10]=u,e[11]=t,e[12]=s,e[13]=a):a=e[13],a};export{C as L};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const i=r=>{if(typeof r=="string")return r;try{return JSON.stringify(r)??String(r)}catch{return String(r)}},o=r=>typeof r!="object"||r===null||Array.isArray(r)?"":Object.entries(r).map(([t,e])=>`${t}=${i(e)}`).join(" ");export{o as f};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as v}from"react/compiler-runtime";import{c as k}from"./utils-bhneXptQ.js";import{jsx as w}from"react/jsx-runtime";const y={dialog:"fixed inset-0 z-[1000] flex justify-center bg-black/20 pt-[10vh]",drawer:"fixed inset-0 z-[1000] flex justify-end bg-black/20"},N={dialog:"flex h-fit w-[min(28rem,92vw)] flex-col gap-3 rounded-lg border border-border bg-background p-4 shadow-xl",drawer:"flex h-full w-[min(34rem,100vw)] flex-col gap-4 overflow-auto border-l border-border bg-background p-4 shadow-xl"},I=u=>{const e=v(18),{className:s,children:i,label:c,onClose:r,panelTestId:b,testId:f,variant:h}=u;let t;e[0]!==r?(t=n=>{n.target===n.currentTarget&&r()},e[0]=r,e[1]=t):t=e[1];const g=t;let a;e[2]!==r?(a=n=>{n.key==="Escape"&&r()},e[2]=r,e[3]=a):a=e[3];const m=a,p=y[h],x=N[h];let l;e[4]!==s||e[5]!==x?(l=k(x,s),e[4]=s,e[5]=x,e[6]=l):l=e[6];let o;e[7]!==i||e[8]!==c||e[9]!==b||e[10]!==l?(o=w("div",{"aria-label":c,className:l,"data-testid":b,role:"dialog",children:i}),e[7]=i,e[8]=c,e[9]=b,e[10]=l,e[11]=o):o=e[11];let d;return e[12]!==g||e[13]!==m||e[14]!==p||e[15]!==o||e[16]!==f?(d=w("div",{className:p,"data-testid":f,onClick:g,onKeyDown:m,role:"presentation",children:o}),e[12]=g,e[13]=m,e[14]=p,e[15]=o,e[16]=f,e[17]=d):d=e[17],d};export{I as M};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as S}from"react/compiler-runtime";import{use as w,createContext as q,useState as i}from"react";import{jsx as d}from"react/jsx-runtime";const h=q(void 0),y=n=>{const o=S(10),{children:a}=n;let s;o[0]===Symbol.for("react.memo_cache_sentinel")?(s={focusSeq:void 0,open:!1,shown:"all"},o[0]=s):s=o[0];const[e,t]=i(s);let r;o[1]===Symbol.for("react.memo_cache_sentinel")?(r=()=>({close:()=>{t(v)},openConsole:u=>{t({focusSeq:u?.seq,open:!0,shown:u?.errorsOnly===!0?"errors":"all"})},setShown:u=>{t(m=>({...m,shown:u}))},toggle:()=>{t(O)}}),o[1]=r):r=o[1];const[p]=i(r);let c;o[2]!==p||o[3]!==e.focusSeq||o[4]!==e.open||o[5]!==e.shown?(c={...p,focusSeq:e.focusSeq,open:e.open,shown:e.shown},o[2]=p,o[3]=e.focusSeq,o[4]=e.open,o[5]=e.shown,o[6]=c):c=o[6];const f=c;let l;return o[7]!==a||o[8]!==f?(l=d(h,{value:f,children:a}),o[7]=a,o[8]=f,o[9]=l):l=o[9],l},b=()=>w(h);function v(n){return{...n,open:!1}}function O(n){return{focusSeq:void 0,open:!n.open,shown:"all"}}export{y as O,b as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{y as c}from"./use-admin-query-QJ-ibl5u.js";const p="__lunora_admin__:",b=new Set(["action","mutation","query"]),i=Symbol("lunora.operationSeq"),j=t=>{if(typeof t!="object"||t===null)return;const e=t[i];return typeof e=="number"?e:void 0},g=(t,e)=>{if(!(typeof t!="object"||t===null||!Object.isExtensible(t)))try{Object.defineProperty(t,i,{configurable:!0,enumerable:!1,value:e,writable:!0})}catch{}},d=t=>{if(typeof t!="object"||t===null)return;const e=t.__lunoraRef;return typeof e=="string"&&e.startsWith(p)?e:void 0},m=t=>{if(typeof t!="object"||t===null)return"";const{shardKey:e}=t;return typeof e=="string"?e:""},_=t=>new Proxy(t,{get(e,u,l){const n=Reflect.get(e,u,l);if(typeof n!="function"||typeof u!="string"||!b.has(u))return typeof n=="function"?n.bind(e):n;const a=n;return async(...o)=>{const f=d(o[0]);if(f===void 0)return a.apply(e,o);const y=typeof o[1]=="object"&&o[1]!==null?o[1]:{},s=c.start(f,y,m(o[2]));try{const r=await a.apply(e,o);return c.settle(s,{result:r}),r}catch(r){throw c.settle(s,{error:r instanceof Error?r.message:String(r)}),g(r,s),r}}}});export{j as b,_ as h};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import{c as E}from"react/compiler-runtime";import{useState as A,useEffect as ne,createContext as se,use as ie}from"react";import{b as z,c as Q,f as le,j as de,d as ce,g as me}from"./internal-BSIsQVC6.js";import{SentIcon as ue,Copy01Icon as pe,Search01Icon as fe}from"@hugeicons/core-free-icons";import{HugeiconsIcon as F}from"@hugeicons/react";import{u as he}from"./input-JHu63lTv.js";import{useT as L}from"./DEFAULT_LOCALE-BZ4NojpD.js";import{u as D}from"./button-BkCrNcAs.js";import{jsx as n,jsxs as $,Fragment as xe}from"react/jsx-runtime";import{g as ge}from"./badge-BbuuAio7.js";import{ShardInput as be}from"./ShardInput-BVn2iCU0.js";import{p as H}from"./label-6uP1obNF.js";import{l as ye}from"./textarea-Bu2-jKAs.js";import{LunoraError as ve}from"@lunora/errors";import{useLunora as Ne}from"@lunora/react";import{c as V}from"./utils-bhneXptQ.js";const gt=function(t,e,r){const o=E(10);let a;o[0]===Symbol.for("react.memo_cache_sentinel")?(a={kind:"loading"},o[0]=a):a=o[0];const[s,i]=A(a);let l,u;o[1]!==r||o[2]!==e||o[3]!==t?(l=()=>{if(t!==void 0)return;let c=!1;return e().then(m=>(c||i(r(m)),m)).catch(m=>{c||i({kind:"error",message:z(m)})}),()=>{c=!0}},u=[r,e,t],o[1]=r,o[2]=e,o[3]=t,o[4]=l,o[5]=u):(l=o[4],u=o[5]),ne(l,u);let d;return o[6]!==r||o[7]!==s||o[8]!==t?(d=t===void 0?s:r(t),o[6]=r,o[7]=s,o[8]=t,o[9]=d):d=o[9],d},$e=t=>typeof t=="number"?"number":typeof t=="boolean"?"boolean":"string",X=t=>{if(t.enum!==void 0&&t.enum.length>0)return t.enum;if(t.anyOf!==void 0&&t.anyOf.length>0&&t.anyOf.every(e=>e.const!==void 0))return t.anyOf.map(e=>e.const)},B=t=>t===void 0?"any":t.const!==void 0?JSON.stringify(t.const):t.enum!==void 0&&t.enum.length>0?t.enum.map(e=>JSON.stringify(e)).join(" | "):t.anyOf!==void 0&&t.anyOf.length>0?t.anyOf.map(e=>B(e)).join(" | "):t.type==="array"?`array<${B(t.items)}>`:t.type??"any",ke=t=>{const e=X(t);return e!==void 0?t.type??$e(e[0]):B(t)},Se=t=>{const e=X(t);return e===void 0?void 0:e.map(r=>JSON.stringify(r)).join(" | ")},we=t=>{const e=[];t.minimum!==void 0?e.push(`${String(t.minimum)} ≤`):t.exclusiveMinimum!==void 0&&e.push(`${String(t.exclusiveMinimum)} <`);const r=e.length>0;e.push("value"),t.maximum!==void 0?e.push(`≤ ${String(t.maximum)}`):t.exclusiveMaximum!==void 0&&e.push(`< ${String(t.exclusiveMaximum)}`);const o=e.length>(r?2:1);return r||o?e.join(" "):void 0},Oe=t=>{if(t.type==="object"&&t.properties!==void 0)return t;if(t.type==="array"&&t.items?.type==="object"&&t.items.properties!==void 0)return t.items},q=t=>{if(t===void 0)return null;if(t.const!==void 0)return t.const;if(t.enum!==void 0&&t.enum.length>0)return t.enum[0];if(t.anyOf!==void 0&&t.anyOf.length>0)return q(t.anyOf[0]);switch(t.type){case"array":return[];case"boolean":return!1;case"number":return 0;case"object":{const e={};for(const[r,o]of Object.entries(t.properties??{}))e[r]=q(o);return e}case"string":return"";default:return null}},W=t=>{const e=E(7),{label:r,value:o}=t;let a;e[0]!==r?(a=n("span",{className:"text-muted-foreground",children:r}),e[0]=r,e[1]=a):a=e[1];let s;e[2]!==o?(s=n("span",{className:"text-foreground",children:o}),e[2]=o,e[3]=s):s=e[3];let i;return e[4]!==a||e[5]!==s?(i=$("span",{className:"inline-flex items-center gap-1 rounded border border-border px-1.5 py-0.5 font-mono text-[10px]",children:[a,s]}),e[4]=a,e[5]=s,e[6]=i):i=e[6],i},je=t=>{const e=E(40),{name:r,required:o,schema:a}=t,s=L();let i;e[0]!==a?(i=we(a),e[0]=a,e[1]=i):i=e[1];const l=i;let u;e[2]!==a?(u=Se(a),e[2]=a,e[3]=u):u=e[3];const d=u,c=a["x-lunora-table"],m=a.format!==void 0||l!==void 0||d!==void 0||c!==void 0;let y;e[4]!==a?(y=Oe(a),e[4]=a,e[5]=y):y=e[5];const b=y,p=o?"*":"?";let x;e[6]!==p?(x=n("span",{className:"text-muted-foreground",children:p}),e[6]=p,e[7]=x):x=e[7];let v;e[8]!==r||e[9]!==x?(v=$("span",{className:"font-mono text-foreground",children:[r,x]}),e[8]=r,e[9]=x,e[10]=v):v=e[10];let N;e[11]!==a?(N=ke(a),e[11]=a,e[12]=N):N=e[12];let h;e[13]!==N?(h=n("span",{className:"font-mono text-muted-foreground",children:N}),e[13]=N,e[14]=h):h=e[14];let f;e[15]!==v||e[16]!==h?(f=$("div",{className:"flex items-baseline gap-2",children:[v,h]}),e[15]=v,e[16]=h,e[17]=f):f=e[17];let g;e[18]!==a.description?(g=a.description!==void 0&&n("p",{className:"max-w-prose text-muted-foreground",children:a.description}),e[18]=a.description,e[19]=g):g=e[19];let S;e[20]!==m||e[21]!==l||e[22]!==c||e[23]!==a.format||e[24]!==s||e[25]!==d?(S=m&&$("div",{className:"flex flex-wrap gap-1",children:[a.format!==void 0&&n(W,{label:s("Format"),value:a.format}),l!==void 0&&n(W,{label:s("Range"),value:l}),d!==void 0&&n(W,{label:s("Value in"),value:d}),c!==void 0&&n(W,{label:s("relation"),value:c})]}),e[20]=m,e[21]=l,e[22]=c,e[23]=a.format,e[24]=s,e[25]=d,e[26]=S):S=e[26];let w;e[27]!==g||e[28]!==S||e[29]!==f?(w=$("div",{className:"flex flex-col gap-1 py-2",children:[f,g,S]}),e[27]=g,e[28]=S,e[29]=f,e[30]=w):w=e[30];const k=w;if(b===void 0){let O;return e[31]!==k?(O=n("div",{className:"border-b border-border/50 last:border-b-0",children:k}),e[31]=k,e[32]=O):O=e[32],O}let j;e[33]!==k?(j=n("summary",{className:"cursor-pointer marker:text-muted-foreground",children:k}),e[33]=k,e[34]=j):j=e[34];let P;e[35]!==b?(P=n("div",{className:"mb-2 ml-2 border-l border-border pl-3",children:n(Y,{schema:b})}),e[35]=b,e[36]=P):P=e[36];let _;return e[37]!==j||e[38]!==P?(_=$("details",{className:"border-b border-border/50 last:border-b-0",children:[j,P]}),e[37]=j,e[38]=P,e[39]=_):_=e[39],_},Y=t=>{const e=E(7),{schema:r}=t;let o;e[0]!==r.required?(o=new Set(r.required),e[0]=r.required,e[1]=o):o=e[1];const a=o;let s;e[2]!==r.properties?(s=Object.entries(r.properties??{}),e[2]=r.properties,e[3]=s):s=e[3];const i=s;let l;return e[4]!==a||e[5]!==i?(l=n("div",{className:"flex flex-col",children:i.map(u=>{const[d,c]=u;return n(je,{name:d,required:a.has(d),schema:c},d)})}),e[4]=a,e[5]=i,e[6]=l):l=e[6],l},G=t=>{const e=E(10),{schema:r,testId:o}=t;if(r?.type!=="object"||Object.keys(r.properties??{}).length===0){let i;e[0]!==r?(i=B(r),e[0]=r,e[1]=i):i=e[1];let l;return e[2]!==i||e[3]!==o?(l=n("p",{className:"font-mono text-xs text-muted-foreground","data-testid":o,children:i}),e[2]=i,e[3]=o,e[4]=l):l=e[4],l}let a;e[5]!==r?(a=n(Y,{schema:r}),e[5]=r,e[6]=a):a=e[6];let s;return e[7]!==a||e[8]!==o?(s=n("div",{className:"text-xs","data-testid":o,children:a}),e[7]=a,e[8]=o,e[9]=s):s=e[9],s},_e=["curl","javascript","lunora"],Ce={lunora:"Lunora",curl:"cURL",javascript:"JavaScript"},Pe=t=>`api.${t.replaceAll(/[/:]/g,".")}`,Te=t=>{const e=q(t.argsSchema)??{};return t.functionPath===void 0?e:{args:e,functionPath:t.functionPath}},Ie=(t,e,r)=>{const o=`${r}${e.httpPath}`,a=JSON.stringify(Te(e),void 0,2),s=JSON.stringify(q(e.argsSchema)??{},void 0,2);switch(t){case"curl":{const i=e.method!=="GET"&&e.method!=="HEAD",l=[`curl -X ${e.method} ${JSON.stringify(o)}`];return i&&l.push(' -H "Content-Type: application/json"',` -d '${a}'`),l.join(` \\
|
|
2
|
+
`)}case"lunora":return e.functionPath===void 0?`await fetch(${JSON.stringify(e.httpPath)}, { method: ${JSON.stringify(e.method)} });`:`import { useLunora } from "@lunora/react";
|
|
3
|
+
import { api } from "./_generated/api";
|
|
4
|
+
|
|
5
|
+
const client = useLunora();
|
|
6
|
+
await client.${e.kind??"query"}(${Pe(e.functionPath)}, ${s});`;default:{const i=e.method!=="GET"&&e.method!=="HEAD"?`{
|
|
7
|
+
method: ${JSON.stringify(e.method)},
|
|
8
|
+
headers: { "Content-Type": "application/json" },
|
|
9
|
+
body: JSON.stringify(${a}),
|
|
10
|
+
}`:`{ method: ${JSON.stringify(e.method)} }`;return`const response = await fetch(${JSON.stringify(o)}, ${i});
|
|
11
|
+
const data = await response.json();`}}},Je=t=>{const e=E(24),{operation:r,server:o}=t,a=L(),[s,i]=A("curl");let l;e[0]!==r||e[1]!==s||e[2]!==o?(l=Ie(s,r,o),e[0]=r,e[1]=s,e[2]=o,e[3]=l):l=e[3];const u=l;let d;e[4]!==u?(d=()=>{Q(u)},e[4]=u,e[5]=d):d=e[5];const c=d;let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=g=>{i(g.currentTarget.dataset.sample)},e[6]=m):m=e[6];const y=m;let b;e[7]!==s?(b=_e.map(g=>n("button",{"aria-selected":s===g,className:"rounded px-2 py-0.5 text-xs text-muted-foreground transition-colors hover:text-foreground aria-selected:bg-muted aria-selected:font-medium aria-selected:text-foreground","data-sample":g,"data-testid":`api-sample-${g}`,onClick:y,role:"tab",type:"button",children:Ce[g]},g)),e[7]=s,e[8]=b):b=e[8];let p;e[9]!==b?(p=n("div",{className:"flex gap-1",role:"tablist",children:b}),e[9]=b,e[10]=p):p=e[10];let x;e[11]!==a?(x=a("Copy"),e[11]=a,e[12]=x):x=e[12];let v;e[13]!==c||e[14]!==x?(v=n(D,{"data-testid":"api-sample-copy",onClick:c,size:"xs",type:"button",variant:"ghost",children:x}),e[13]=c,e[14]=x,e[15]=v):v=e[15];let N;e[16]!==p||e[17]!==v?(N=$("div",{className:"flex items-center justify-between gap-2 border-b border-border px-3 py-2",children:[p,v]}),e[16]=p,e[17]=v,e[18]=N):N=e[18];let h;e[19]!==u?(h=n("pre",{className:"overflow-auto px-3 pb-3 font-mono text-xs","data-testid":"api-sample-source",children:u}),e[19]=u,e[20]=h):h=e[20];let f;return e[21]!==N||e[22]!==h?(f=$("div",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card","data-testid":"api-code-samples",children:[N,h]}),e[21]=N,e[22]=h,e[23]=f):f=e[23],f},Ee={blue:"text-info",emerald:"text-success",neutral:"text-muted-foreground",orange:"text-warning",red:"text-destructive",violet:"text-royal-amethyst"},Ae=t=>{switch(t.toUpperCase()){case"DELETE":return"red";case"GET":return"emerald";case"PATCH":return"orange";case"POST":return"blue";case"PUT":return"orange";default:return"neutral"}},Me=t=>{switch(t){case"action":return"violet";case"mutation":return"orange";case"query":return"emerald";default:return"neutral"}},U=t=>{const e=E(7),{kind:r,method:o,testId:a}=t;let s;e[0]!==r||e[1]!==o?(s=r??o.toUpperCase(),e[0]=r,e[1]=o,e[2]=s):s=e[2];const i=s,l=r===void 0?Ae(o):Me(r),u=`${Ee[l]} font-mono text-[10px] tracking-wide uppercase`;let d;return e[3]!==i||e[4]!==u||e[5]!==a?(d=n(ge,{className:u,"data-testid":a,variant:"ghost",children:i}),e[3]=i,e[4]=u,e[5]=a,e[6]=d):d=e[6],d},Z=t=>t.startsWith("2")?"text-emerald-600 dark:text-emerald-400":t==="default"||t.startsWith("4")||t.startsWith("5")?"text-red-600 dark:text-red-400":"text-muted-foreground",ee=t=>t.startsWith("2")?"bg-emerald-500":t==="default"||t.startsWith("4")||t.startsWith("5")?"bg-red-500":"bg-muted-foreground",Ke=t=>JSON.stringify(q(t.argsSchema)??{},void 0,2),te=se(null),re=()=>{const t=ie(te);if(t===null)throw new ve("INTERNAL","useOperationRun must be used within an OperationRunProvider");return t},Re=({children:t,operation:e})=>{const r=L(),o=Ne(),[a,s]=A(()=>Ke(e)),[i,l]=A(""),[u,d]=A("idle"),[c,m]=A(void 0),[y,b]=A(null),[p,x]=A(null),v=async()=>{let N;try{N=a.trim()===""?{}:JSON.parse(a)}catch(f){d("error"),m(void 0),x(null),b(r("Invalid JSON args: {message}",{message:z(f)}));return}d("running"),b(null);const h=performance.now();try{let f;if(e.functionPath===void 0){const g=e.method!=="GET"&&e.method!=="HEAD",S=await(await fetch(e.httpPath,{body:g?JSON.stringify(N):void 0,headers:g?{"content-type":"application/json"}:void 0,method:e.method})).text();try{f=JSON.parse(S)}catch{f=S}}else f=await de(o,e.kind,me(e.functionPath),N,ce(i));m(f),x(Math.round(performance.now()-h)),d("success")}catch(f){m(void 0),x(Math.round(performance.now()-h)),b(z(f)),d("error")}};return n(te,{value:{argsText:a,durationMs:p,error:y,operation:e,response:c,send:()=>{le(v())},setArgsText:s,setShardKey:l,shardKey:i,status:u},children:t})},Le=()=>{const t=E(48),e=L(),{argsText:r,operation:o,send:a,setArgsText:s,setShardKey:i,shardKey:l,status:u}=re();let d;t[0]!==s?(d=C=>{s(C.target.value)},t[0]=s,t[1]=d):d=t[1];const c=d;let m;t[2]!==a?(m=C=>{C.key==="Enter"&&(C.metaKey||C.ctrlKey)&&(C.preventDefault(),a())},t[2]=a,t[3]=m):m=t[3];const y=m,b=u==="running";let p;t[4]!==o.kind||t[5]!==o.method?(p=n(U,{kind:o.kind,method:o.method,testId:"api-try-method"}),t[4]=o.kind,t[5]=o.method,t[6]=p):p=t[6];const x=o.functionPath??o.httpPath;let v;t[7]!==x?(v=n("code",{className:"min-w-0 flex-1 truncate font-mono text-xs text-foreground",children:x}),t[7]=x,t[8]=v):v=t[8];const N=b?"animate-pulse":void 0;let h;t[9]!==N?(h=n(F,{className:N,icon:ue,strokeWidth:2}),t[9]=N,t[10]=h):h=t[10];let f;t[11]!==b||t[12]!==e?(f=e(b?"Sending…":"Send"),t[11]=b,t[12]=e,t[13]=f):f=t[13];let g;t[14]!==b||t[15]!==a||t[16]!==h||t[17]!==f?(g=$(D,{"data-testid":"api-try-send",disabled:b,onClick:a,size:"sm",type:"button",children:[h,f]}),t[14]=b,t[15]=a,t[16]=h,t[17]=f,t[18]=g):g=t[18];let S;t[19]!==p||t[20]!==v||t[21]!==g?(S=$("div",{className:"flex items-center gap-2 border-b border-border bg-muted px-3 py-2",children:[p,v,g]}),t[19]=p,t[20]=v,t[21]=g,t[22]=S):S=t[22];let w;t[23]!==e?(w=e("Arguments (JSON)"),t[23]=e,t[24]=w):w=t[24];let k;t[25]!==w?(k=n(H,{htmlFor:"api-try-args",children:w}),t[25]=w,t[26]=k):k=t[26];let j;t[27]!==r?(j=r.split(`
|
|
12
|
+
`),t[27]=r,t[28]=j):j=t[28];const P=Math.min(12,Math.max(3,j.length));let _;t[29]!==r||t[30]!==c||t[31]!==y||t[32]!==P?(_=n(ye,{className:"font-mono text-xs","data-testid":"api-try-args",id:"api-try-args",onChange:c,onKeyDown:y,rows:P,spellCheck:!1,value:r}),t[29]=r,t[30]=c,t[31]=y,t[32]=P,t[33]=_):_=t[33];let O;t[34]!==k||t[35]!==_?(O=$("div",{className:"flex flex-col gap-1.5",children:[k,_]}),t[34]=k,t[35]=_,t[36]=O):O=t[36];let T;t[37]!==o.functionPath||t[38]!==i||t[39]!==l||t[40]!==e?(T=o.functionPath!==void 0&&$("div",{className:"flex flex-col gap-1.5",children:[n(H,{htmlFor:"shard-input",children:e("Shard key (optional)")}),n(be,{id:"shard-input",onChange:i,testId:"shard-input",value:l})]}),t[37]=o.functionPath,t[38]=i,t[39]=l,t[40]=e,t[41]=T):T=t[41];let I;t[42]!==O||t[43]!==T?(I=$("div",{className:"flex flex-col gap-3 p-3",children:[O,T]}),t[42]=O,t[43]=T,t[44]=I):I=t[44];let J;return t[45]!==I||t[46]!==S?(J=$("div",{className:"overflow-hidden rounded-xl border border-border bg-card","data-testid":"api-try-it",children:[S,I]}),t[45]=I,t[46]=S,t[47]=J):J=t[47],J},qe=t=>{const e=E(51),{operation:r}=t,o=L(),a=`api-operation-${r.operationId}`,s=r.key;let i;e[0]!==r.kind||e[1]!==r.method?(i=n(U,{kind:r.kind,method:r.method,testId:"api-operation-method"}),e[0]=r.kind,e[1]=r.method,e[2]=i):i=e[2];const l=r.functionPath??r.httpPath;let u;e[3]!==l?(u=n("code",{className:"truncate font-mono text-xs text-muted-foreground",children:l}),e[3]=l,e[4]=u):u=e[4];let d;e[5]!==i||e[6]!==u?(d=$("div",{className:"flex items-center gap-2",children:[i,u]}),e[5]=i,e[6]=u,e[7]=d):d=e[7];let c;e[8]!==r.title?(c=n("h1",{className:"text-lg font-semibold text-foreground","data-testid":"api-operation-title",children:r.title}),e[8]=r.title,e[9]=c):c=e[9];let m;e[10]!==r.description?(m=r.description!==void 0&&n("p",{className:"text-sm text-muted-foreground",children:r.description}),e[10]=r.description,e[11]=m):m=e[11];let y;e[12]!==d||e[13]!==c||e[14]!==m?(y=$("header",{className:"sticky top-0 z-10 -mx-6 -mt-6 flex flex-col gap-2 border-b border-border bg-background px-6 pt-6 pb-3",children:[d,c,m]}),e[12]=d,e[13]=c,e[14]=m,e[15]=y):y=e[15];let b;e[16]!==o?(b=o("Try it"),e[16]=o,e[17]=b):b=e[17];let p;e[18]!==b?(p=n("h2",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:b}),e[18]=b,e[19]=p):p=e[19];let x;e[20]===Symbol.for("react.memo_cache_sentinel")?(x=n(Le,{}),e[20]=x):x=e[20];let v;e[21]!==p?(v=$("section",{className:"flex flex-col gap-2",children:[p,x]}),e[21]=p,e[22]=v):v=e[22];let N;e[23]!==o?(N=o("Request arguments"),e[23]=o,e[24]=N):N=e[24];let h;e[25]!==N?(h=n("h2",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:N}),e[25]=N,e[26]=h):h=e[26];let f;e[27]!==r.argsSchema?(f=n(G,{schema:r.argsSchema,testId:"api-operation-args"}),e[27]=r.argsSchema,e[28]=f):f=e[28];let g;e[29]!==h||e[30]!==f?(g=$("section",{className:"flex flex-col gap-2",children:[h,f]}),e[29]=h,e[30]=f,e[31]=g):g=e[31];let S;e[32]!==o?(S=o("Response body"),e[32]=o,e[33]=S):S=e[33];let w;e[34]!==S?(w=n("h2",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:S}),e[34]=S,e[35]=w):w=e[35];let k;if(e[36]!==r.responses||e[37]!==o){let _;e[39]!==o?(_=O=>$("div",{className:"flex flex-col gap-1.5 rounded-xl border border-border bg-card p-3",children:[$("div",{className:"flex items-center justify-between gap-2",children:[$("span",{className:`inline-flex items-center gap-1.5 font-mono text-xs font-semibold ${Z(O.status)}`,children:[n("span",{className:`size-1.5 rounded-full ${ee(O.status)}`}),O.status]}),O.schema!==void 0&&n("span",{className:"rounded border border-border px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:o("application/json")})]}),O.description!==void 0&&n("p",{className:"text-xs text-muted-foreground",children:O.description}),O.schema!==void 0&&n(G,{schema:O.schema,testId:`api-response-${O.status}`})]},O.status),e[39]=o,e[40]=_):_=e[40],k=r.responses.map(_),e[36]=r.responses,e[37]=o,e[38]=k}else k=e[38];let j;e[41]!==w||e[42]!==k?(j=$("section",{className:"flex flex-col gap-3",children:[w,k]}),e[41]=w,e[42]=k,e[43]=j):j=e[43];let P;return e[44]!==r.key||e[45]!==a||e[46]!==v||e[47]!==g||e[48]!==j||e[49]!==y?(P=$("div",{className:"flex flex-col gap-6 duration-200 animate-in fade-in-0 slide-in-from-bottom-1","data-testid":a,children:[y,v,g,j]},s),e[44]=r.key,e[45]=a,e[46]=v,e[47]=g,e[48]=j,e[49]=y,e[50]=P):P=e[50],P},We={boolean:"text-royal-amethyst",key:"text-sky-sapphire",number:"text-warning",plain:"",string:"text-success"},Be=/"(?:[^"\\]|\\.)*"|\b(?:true|false|null)\b|-?\d+(?:\.\d+)?/g,ze=/^\s*:/,Fe=(t,e,r)=>r.startsWith('"')?ze.test(t.slice(e))?"key":"string":r==="true"||r==="false"||r==="null"?"boolean":"number",De=t=>{const e=[];let r=0;for(const o of t.matchAll(Be)){const{index:a}=o,s=o[0],i=a+s.length;a>r&&e.push({kind:"plain",start:r,text:t.slice(r,a)}),e.push({kind:Fe(t,i,s),start:a,text:s}),r=i}return r<t.length&&e.push({kind:"plain",start:r,text:t.slice(r)}),e},Ue=t=>{const e=E(4),{code:r}=t;let o;e[0]!==r?(o=De(r).map(He),e[0]=r,e[1]=o):o=e[1];let a;return e[2]!==o?(a=n(xe,{children:o}),e[2]=o,e[3]=a):a=e[3],a};function He(t){return n("span",{className:We[t.kind],children:t.text},t.start)}const oe="__live__",Ge=t=>t.schema===void 0?"":JSON.stringify(q(t.schema),void 0,2),Qe=(t,e,r)=>r?t??"":e===void 0?"":JSON.stringify(e,void 0,2),Ve=t=>{const e=E(18),{active:r,running:o,showError:a}=t,s=L();if(o){let m;e[0]!==s?(m=s("Sending…"),e[0]=s,e[1]=m):m=e[1];let y;return e[2]!==m?(y=n("p",{className:"px-3 py-3 text-xs text-muted-foreground","data-testid":"api-response-running",children:m}),e[2]=m,e[3]=y):y=e[3],y}if(r===void 0||r.body===""){let m;e[4]!==r?.live||e[5]!==s?(m=r?.live===!0?s("Send a request to see the response."):s("No example for this response."),e[4]=r?.live,e[5]=s,e[6]=m):m=e[6];let y;return e[7]!==m?(y=n("p",{className:"px-3 py-3 text-xs text-muted-foreground","data-testid":"api-response-idle",children:m}),e[7]=m,e[8]=y):y=e[8],y}const i=a&&"text-destructive";let l;e[9]!==i?(l=V("max-h-[28rem] overflow-auto px-3 py-3 font-mono text-xs",i),e[9]=i,e[10]=l):l=e[10];const u=a?"api-response-error":"api-response-body";let d;e[11]!==r.body||e[12]!==a?(d=a?r.body:n(Ue,{code:r.body}),e[11]=r.body,e[12]=a,e[13]=d):d=e[13];let c;return e[14]!==l||e[15]!==u||e[16]!==d?(c=n("pre",{className:l,"data-testid":u,children:d}),e[14]=l,e[15]=u,e[16]=d,e[17]=c):c=e[17],c},Xe=({durationMs:t,error:e,failed:r,operation:o,ran:a,response:s,t:i})=>{const l=o.responses.map(u=>({body:Ge(u),durationMs:null,id:u.status,label:u.status,live:!1,status:u.status}));return a?[{body:Qe(e,s,r),durationMs:t,id:oe,label:i("Live"),live:!0,status:r?"error":"200"},...l]:l},Ye=()=>{const t=E(19),e=L(),{durationMs:r,error:o,operation:a,response:s,status:i}=re(),l=i==="running",u=i==="error",d=i==="success"||u,c=Xe({durationMs:r,error:o,failed:u,operation:a,ran:d,response:s,t:e}),m=d?oe:c.find(Ze)?.id??c[0]?.id??"",[y,b]=A(null),p=c.find(C=>C.id===(y??m))??c[0];let x;t[0]===Symbol.for("react.memo_cache_sentinel")?(x=C=>{const{id:M}=C.currentTarget.dataset;M!==void 0&&b(M)},t[0]=x):x=t[0];const v=x,N=()=>{p!==void 0&&Q(p.body)},h=p?.live===!0?p.durationMs:null,f=p?.live===!0&&p.status==="error",g="flex min-h-0 flex-col rounded-xl border border-border bg-card",S="api-response-panel";let w;t[1]!==e?(w=e("Response"),t[1]=e,t[2]=w):w=t[2];let k;t[3]!==w?(k=n("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:w}),t[3]=w,t[4]=k):k=t[4];const j=h!==null&&n("span",{className:"font-mono text-[10px] text-muted-foreground",children:e("{ms} ms",{ms:h})}),P=p!==void 0&&p.body!==""&&n(D,{"aria-label":e("Copy"),"data-testid":"api-response-copy",onClick:N,size:"icon-xs",type:"button",variant:"ghost",children:n(F,{icon:pe,strokeWidth:2})});let _;t[5]!==j||t[6]!==P?(_=$("div",{className:"flex items-center gap-2",children:[j,P]}),t[5]=j,t[6]=P,t[7]=_):_=t[7];let O;t[8]!==k||t[9]!==_?(O=$("div",{className:"flex items-center justify-between gap-2 border-b border-border px-3 py-2",children:[k,_]}),t[8]=k,t[9]=_,t[10]=O):O=t[10];const T=c.length>0&&n("div",{className:"flex gap-1 overflow-x-auto border-b border-border px-2 py-1.5",role:"tablist",children:c.map(C=>{const M=C.id===p?.id;return $("button",{"aria-selected":M,className:V("inline-flex items-center gap-1.5 rounded px-2 py-0.5 font-mono text-xs transition-colors hover:text-foreground aria-selected:bg-muted aria-selected:font-medium",M?Z(C.status):"text-muted-foreground"),"data-id":C.id,"data-testid":C.live?"api-response-tab-live":`api-response-tab-${C.status}`,onClick:v,role:"tab",type:"button",children:[n("span",{className:`size-1.5 rounded-full ${ee(C.status)}`}),C.label]},C.id)})});let I;t[11]!==p||t[12]!==l||t[13]!==f?(I=n(Ve,{active:p,running:l,showError:f}),t[11]=p,t[12]=l,t[13]=f,t[14]=I):I=t[14];let J;return t[15]!==I||t[16]!==O||t[17]!==T?(J=$("div",{className:g,"data-testid":S,children:[O,T,I]}),t[15]=I,t[16]=O,t[17]=T,t[18]=J):J=t[18],J};function Ze(t){return t.status.startsWith("2")}const et=(t,e)=>{const r=e.trim().toLowerCase();return r===""?t:t.map(o=>({...o,operations:o.operations.filter(a=>`${a.summary} ${a.operationId}`.toLowerCase().includes(r))})).filter(o=>o.operations.length>0)},bt=t=>{const e=E(53),{model:r}=t,o=L(),a=r.groups[0]?.operations[0]?.key??"",[s,i]=A(a),[l,u]=A("");let d;e[0]!==a||e[1]!==r.operationByKey||e[2]!==s?(d=r.operationByKey.get(s)??r.operationByKey.get(a),e[0]=a,e[1]=r.operationByKey,e[2]=s,e[3]=d):d=e[3];const c=d;let m,y,b,p,x,v,N,h,f,g;if(e[4]!==l||e[5]!==r.groups||e[6]!==r.server||e[7]!==c?.key||e[8]!==o){m=et(r.groups,l);let _;e[19]===Symbol.for("react.memo_cache_sentinel")?(_=R=>{const{key:K}=R.currentTarget.dataset;K!==void 0&&i(K)},e[19]=_):_=e[19];const O=_;let T;e[20]===Symbol.for("react.memo_cache_sentinel")?(T=R=>{u(R.target.value)},e[20]=T):T=e[20];const I=T;y=r.server??"",f="grid min-h-0 flex-1 grid-cols-1 overflow-hidden lg:grid-cols-[16rem_minmax(0,1fr)_22rem]",g="api-reference",e[21]!==o?(x=o("API operations"),e[21]=o,e[22]=x):x=e[22],v="flex min-h-0 flex-col overflow-y-auto border-r border-border",N="api-reference-nav";let J;e[23]===Symbol.for("react.memo_cache_sentinel")?(J=n(F,{className:"pointer-events-none absolute top-1/2 left-2 size-3.5 -translate-y-1/2 text-muted-foreground",icon:fe,strokeWidth:2}),e[23]=J):J=e[23];let C;e[24]!==o?(C=o("Filter operations"),e[24]=o,e[25]=C):C=e[25],e[26]!==l||e[27]!==C?(h=n("div",{className:"sticky top-0 z-10 border-b border-border bg-sidebar p-2",children:$("div",{className:"relative",children:[J,n(he,{className:"h-7 pl-7","data-testid":"api-filter",onChange:I,placeholder:C,value:l})]})}),e[26]=l,e[27]=C,e[28]=h):h=e[28],b="flex flex-col gap-4 p-2";let M;e[29]!==c?.key||e[30]!==o?(M=R=>$("div",{className:"flex flex-col gap-1",children:[$("div",{className:"flex items-center justify-between px-2",children:[n("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:R.name||o("(root)")}),n("span",{className:"font-mono text-[10px] text-muted-foreground/70",children:R.operations.length})]}),R.operations.map(K=>{const ae=K.key===c?.key;return $("button",{"aria-current":ae?"page":void 0,className:"flex items-center justify-between gap-2 rounded-md border-l-2 border-transparent px-2 py-1 text-start text-xs text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground aria-[current=page]:border-primary aria-[current=page]:bg-sidebar-accent aria-[current=page]:font-medium aria-[current=page]:text-foreground","data-key":K.key,"data-testid":`api-nav-${K.operationId}`,onClick:O,type:"button",children:[n("span",{className:"truncate",children:K.summary}),n(U,{kind:K.kind,method:K.method})]},K.key)})]},R.name),e[29]=c?.key,e[30]=o,e[31]=M):M=e[31],p=m.map(M),e[4]=l,e[5]=r.groups,e[6]=r.server,e[7]=c?.key,e[8]=o,e[9]=m,e[10]=y,e[11]=b,e[12]=p,e[13]=x,e[14]=v,e[15]=N,e[16]=h,e[17]=f,e[18]=g}else m=e[9],y=e[10],b=e[11],p=e[12],x=e[13],v=e[14],N=e[15],h=e[16],f=e[17],g=e[18];let S;e[32]!==m.length||e[33]!==o?(S=m.length===0&&n("p",{className:"px-2 py-1 text-xs text-muted-foreground","data-testid":"api-nav-empty",children:o("No operations match your filter.")}),e[32]=m.length,e[33]=o,e[34]=S):S=e[34];let w;e[35]!==S||e[36]!==b||e[37]!==p?(w=$("div",{className:b,children:[p,S]}),e[35]=S,e[36]=b,e[37]=p,e[38]=w):w=e[38];let k;e[39]!==w||e[40]!==x||e[41]!==v||e[42]!==N||e[43]!==h?(k=$("nav",{"aria-label":x,className:v,"data-testid":N,children:[h,w]}),e[39]=w,e[40]=x,e[41]=v,e[42]=N,e[43]=h,e[44]=k):k=e[44];let j;e[45]!==c||e[46]!==y?(j=c===void 0?n("div",{className:"lg:col-span-2"}):$(Re,{operation:c,children:[n("div",{className:"min-w-0 overflow-y-auto p-6","data-testid":"api-reference-main",children:n(qe,{operation:c})}),$("aside",{className:"flex min-w-0 flex-col gap-4 overflow-y-auto border-border p-4 lg:border-l","data-testid":"api-reference-aside",children:[n(Je,{operation:c,server:y}),n(Ye,{})]})]},c.key),e[45]=c,e[46]=y,e[47]=j):j=e[47];let P;return e[48]!==k||e[49]!==j||e[50]!==f||e[51]!==g?(P=$("div",{className:f,"data-testid":g,children:[k,j]}),e[48]=k,e[49]=j,e[50]=f,e[51]=g,e[52]=P):P=e[52],P};export{bt as U,gt as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as C}from"react/compiler-runtime";import{AreaChart as X,CartesianGrid as g,XAxis as L,Area as B,LineChart as E,Line as T}from"recharts";import{useT as $}from"./DEFAULT_LOCALE-BZ4NojpD.js";import{h as j}from"./internal-BSIsQVC6.js";import{E as q,X as O,B as S,T as F,L as G,A as N,a as A}from"./bar-chart-DraN_srt.js";import{jsx as l,jsxs as b}from"react/jsx-runtime";const H=50,K={value:{colors:{dark:["var(--chart-1)"],light:["var(--chart-1)"]},label:"value"}},I=s=>{const a=s.columns.find(e=>s.rows.length>0&&s.rows.every(t=>typeof t[e]=="number"))??null;return{label:s.columns.find(e=>e!==a)??null,value:a}},W=s=>{const a=C(3),{data:e,kind:t}=s;let o;return a[0]!==e||a[1]!==t?(o=l(G,{className:"h-full w-full",config:K,children:t==="area"?b(X,{data:e,children:[l(g,{vertical:!1}),l(L,{axisLine:!1,dataKey:"label",tickLine:!1}),l(N,{content:l(A,{})}),l(B,{dataKey:"value",fill:"var(--color-value-0)",fillOpacity:.2,stroke:"var(--color-value-0)",type:"monotone"})]}):b(E,{data:e,children:[l(g,{vertical:!1}),l(L,{axisLine:!1,dataKey:"label",tickLine:!1}),l(N,{content:l(A,{})}),l(T,{dataKey:"value",dot:!1,stroke:"var(--color-value-0)",strokeWidth:2,type:"monotone"})]})}),a[0]=e,a[1]=t,a[2]=o):o=a[2],o},R=s=>{const a=C(21),{axes:e,result:t}=s,o=$();let u;a[0]!==t?(u=I(t),a[0]=t,a[1]=u):u=a[1];const k=u;let m;a[2]!==t.columns?(m=new Set(t.columns),a[2]=t.columns,a[3]=m):m=a[3];const f=m,h=e!==void 0&&f.has(e.x)?e.x:k.label;let v;a[4]!==e?.y||a[5]!==f?(v=e?.y.find(r=>f.has(r)),a[4]=e?.y,a[5]=f,a[6]=v):v=a[6];const w=v,d=w??k.value;let p;a[7]!==h||a[8]!==t.rows||a[9]!==d?(p=d===null?[]:t.rows.slice(0,H).map((r,c)=>({label:h===null?`#${(c+1).toString()}`:j(r[h]),value:Number(r[d])||0})),a[7]=h,a[8]=t.rows,a[9]=d,a[10]=p):p=a[10];const y=p;if(d===null){let r;a[11]!==o?(r=o("No numeric column to chart."),a[11]=o,a[12]=r):r=a[12];let c;return a[13]!==r?(c=l("p",{className:"p-4 text-sm text-muted-foreground","data-testid":"sql-chart-empty",children:r}),a[13]=r,a[14]=c):c=a[14],c}const n=e!==void 0&&w!==void 0?e.kind:"bar";let i;a[15]!==y||a[16]!==n?(i=n==="bar"?b(q,{className:"h-full w-full",config:K,data:y,children:[l(O,{dataKey:"label"}),l(S,{dataKey:"value"}),l(F,{})]}):l(W,{data:y,kind:n}),a[15]=y,a[16]=n,a[17]=i):i=a[17];let x;return a[18]!==n||a[19]!==i?(x=l("div",{className:"h-80 w-full p-3","data-chart-kind":n,"data-testid":"sql-chart",children:i}),a[18]=n,a[19]=i,a[20]=x):x=a[20],x};export{R as I};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import{c as w}from"react/compiler-runtime";import{Download01Icon as X}from"@hugeicons/core-free-icons";import{HugeiconsIcon as ee}from"@hugeicons/react";import{Handle as F,Position as P,getNodesBounds as te,getViewportForBounds as ae,useNodesState as re,useEdgesState as oe,ReactFlow as ne,Background as se,Panel as R,Controls as le,MiniMap as de,useNodes as ie,useReactFlow as K,useNodesInitialized as ce}from"@xyflow/react";import{useState as T,useMemo as C,useRef as me,useEffect as j}from"react";import{g as ue,d as y}from"./storage-tier-DznqOf-q.js";import{g as v}from"./badge-BbuuAio7.js";import{u as I}from"./button-BkCrNcAs.js";import{h as fe,$ as pe,b as ge,N as M}from"./dropdown-menu-C3RQ_HlW.js";import{u as he}from"./input-JHu63lTv.js";import{useT as S}from"./DEFAULT_LOCALE-BZ4NojpD.js";import{f as E}from"./internal-BSIsQVC6.js";import{c as N}from"./utils-bhneXptQ.js";import{jsx as d,jsxs as p}from"react/jsx-runtime";import{LunoraError as be}from"@lunora/errors";import{toBlob as xe,toSvg as ye}from"html-to-image";function Ne(a){const e=w(10);let t,s,o;e[0]!==a?({className:t,selected:o,...s}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);const n=o===!0?"":void 0;let r;e[4]!==t?(r=N("rounded-md border border-border bg-card text-card-foreground shadow-sm transition-colors","data-[selected]:border-ring data-[selected]:ring-[3px] data-[selected]:ring-ring/30",t),e[4]=t,e[5]=r):r=e[5];let l;return e[6]!==s||e[7]!==n||e[8]!==r?(l=d("div",{"data-slot":"base-node","data-selected":n,className:r,...s}),e[6]=s,e[7]=n,e[8]=r,e[9]=l):l=e[9],l}function we(a){const e=w(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=N("flex items-center gap-2 rounded-t-md bg-muted/50 px-3 py-1.5",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=d("div",{"data-slot":"base-node-header",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}function ve(a){const e=w(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=N("flex flex-col",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=d("div",{"data-slot":"base-node-content",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}const U=a=>{const e=a.ref===void 0?a.type:`${a.type} → ${a.ref}`;return a.optional===!0?`${e}?`:e},$e=a=>{const e=w(22),{data:t,selected:s}=a,o=S();let n;e[0]!==t.label||e[1]!==t.loadError||e[2]!==o?(n=t.loadError===!0?d("span",{className:"px-3 py-1.5 text-xs text-destructive","data-testid":`sd-node-${t.label}-error`,children:o("Columns unavailable")}):d("span",{className:"px-3 py-1.5 text-xs text-muted-foreground",children:"—"}),e[0]=t.label,e[1]=t.loadError,e[2]=o,e[3]=n):n=e[3];const r=n,l=`sd-node-${t.label}`;let c;e[4]!==t.label?(c=d("span",{className:"truncate font-mono text-xs font-semibold",title:t.label,children:t.label}),e[4]=t.label,e[5]=c):c=e[5];let m;e[6]!==t.tier?(m=d("span",{className:"ms-auto",children:d(ue,{tier:t.tier})}),e[6]=t.tier,e[7]=m):m=e[7];let i;e[8]!==c||e[9]!==m?(i=p(we,{children:[c,m]}),e[8]=c,e[9]=m,e[10]=i):i=e[10];let u;e[11]!==t.columns||e[12]!==t.label||e[13]!==r?(u=t.columns.length===0?r:t.columns.map(g=>p("div",{className:N("relative flex items-center gap-2 border-t border-border px-3 py-1.5 text-xs first:border-t-0",g.pk===!0&&"bg-muted/30"),"data-testid":`sd-col-${t.label}-${g.name}`,children:[d(F,{className:"!h-2 !w-2 !-left-1 !border-border !bg-muted-foreground/70",id:g.name,isConnectable:!1,position:P.Left,type:"target"}),d("span",{className:"truncate font-mono",title:g.name,children:g.name}),g.pk===!0&&d(v,{className:"px-1 py-0 text-[10px] leading-tight",variant:"secondary",children:"PK"}),g.ref!==void 0&&d(v,{className:"px-1 py-0 text-[10px] leading-tight",variant:"outline",children:"FK"}),d("span",{className:"ms-auto truncate text-muted-foreground",title:U(g),children:U(g)}),d(F,{className:"!h-2 !w-2 !-right-1 !border-border !bg-muted-foreground/70",id:g.name,isConnectable:!1,position:P.Right,type:"source"})]},g.name)),e[11]=t.columns,e[12]=t.label,e[13]=r,e[14]=u):u=e[14];let f;e[15]!==u?(f=d(ve,{children:u}),e[15]=u,e[16]=f):f=e[16];let b;return e[17]!==s||e[18]!==l||e[19]!==i||e[20]!==f?(b=p(Ne,{className:"w-64 overflow-hidden","data-testid":l,selected:s,children:[i,f]}),e[17]=s,e[18]=l,e[19]=i,e[20]=f,e[21]=b):b=e[21],b},x=1920,$=1080,D=32,L=(a,e)=>{const t=globalThis.document.createElement("a");t.href=a,t.download=e,globalThis.document.body.append(t),t.click(),t.remove()},Se=(a,e,t="schema-diagram.json")=>{const s={edges:e,exportedAt:new Date().toISOString(),nodes:a},o=JSON.stringify(s,void 0,2),n=globalThis.URL.createObjectURL(new globalThis.Blob([o],{type:"application/json"}));L(n,t),globalThis.setTimeout(()=>{globalThis.URL.revokeObjectURL(n)},0)},H=(a,e,t,s)=>{const o=te(a),{x:n,y:r,zoom:l}=ae(o,e,t,.1,2,s);return{transform:[n,r,l],zoom:l}},ke=async(a,e,t="schema-diagram.png")=>{const{transform:s}=H(e,x,$,D),[o,n,r]=s,l=await xe(a,{backgroundColor:"#ffffff",height:$,style:{transform:`translate(${o.toString()}px, ${n.toString()}px) scale(${r.toString()})`,transformOrigin:"top left",width:`${x.toString()}px`},width:x});if(l===null)throw new be("INTERNAL","html-to-image produced no blob");const c=globalThis.URL.createObjectURL(l);L(c,t),globalThis.setTimeout(()=>{globalThis.URL.revokeObjectURL(c)},0)},Ce=async(a,e,t="schema-diagram.svg")=>{const{transform:s}=H(e,x,$,D),[o,n,r]=s,l=await ye(a,{backgroundColor:"#ffffff",height:$,style:{transform:`translate(${o.toString()}px, ${n.toString()}px) scale(${r.toString()})`,transformOrigin:"top left",width:`${x.toString()}px`},width:x});L(l,t)},Me=a=>{const e=Math.max(1,Math.round(Math.sqrt(1.4*a/368)));return Math.max(480,a/e)},B=a=>38+Math.max(1,a)*28,Re=(a,e)=>{const t=new Map;for(const r of a)t.set(r,[]);for(const r of e)r.to!==r.from&&t.has(r.from)&&t.has(r.to)&&t.get(r.from)?.push(r.to);const s=new Map,o=new Set,n=r=>{const l=s.get(r);if(l!==void 0)return l;if(o.has(r))return 0;o.add(r);let c=0;for(const m of t.get(r)??[])c=Math.max(c,n(m)+1);return o.delete(r),s.set(r,c),c};for(const r of a)n(r);return s},Te=(a,e,t)=>{const s=Re(a,e),o=new Map;for(const m of a){const i=s.get(m)??0,u=o.get(i);u===void 0?o.set(i,[m]):u.push(m)}const n=a.reduce((m,i)=>m+B(t.get(i)??0)+36,0),r=Me(n),l=[];let c=0;for(const m of[...o.keys()].toSorted((i,u)=>i-u)){let i=0,u=24;for(const f of o.get(m)??[]){const b=B(t.get(f)??0);u>24&&u+b>r&&(i+=1,u=24),l.push({name:f,x:24+(c+i)*368,y:u}),u+=b+36}c+=i+1}return l},je={databaseSchema:$e},V={backgroundColor:y.shard.color},A={backgroundColor:y.global.color},Ee={global:!0,shard:!0},Le={},_e=a=>{const e=a.find(t=>t.pk===!0)?.name;return e!==void 0?e:a.some(t=>t.name==="_id")?"_id":a.some(t=>t.name==="id")?"id":a[0]?.name??"_id"},q=a=>a.flatMap(e=>e.columns.filter(t=>t.ref!==void 0).map(t=>({column:t.name,from:e.name,to:t.ref}))),ze=(a,e,t)=>{const s=a.map(l=>l.name),o=new Map(a.map(l=>[l.name,l.columns.length])),n=Te(s,q(a),o),r=new Map(a.map(l=>[l.name,l]));return n.flatMap(({name:l,x:c,y:m})=>{const i=r.get(l);return i===void 0?[]:[{className:t[l],data:{columns:i.columns,label:l,loadError:e,tier:i.tier},id:l,position:{x:c,y:m},type:"databaseSchema"}]})},Oe=a=>{const e=new Map(a.map(t=>[t.name,t.columns]));return q(a).flatMap(t=>{const s=e.get(t.to)??[],o=e.get(t.from)??[],n=_e(s);return!s.some(r=>r.name===n)||!o.some(r=>r.name===t.column)?[]:[{id:`${t.from}.${t.column}->${t.to}`,source:t.to,sourceHandle:n,target:t.from,targetHandle:t.column}]})},Fe=()=>{const a=w(15),e=S();let t;a[0]===Symbol.for("react.memo_cache_sentinel")?(t=p("span",{className:"flex items-center gap-1",children:[d("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:V}),y.shard.label]}),a[0]=t):t=a[0];let s;a[1]===Symbol.for("react.memo_cache_sentinel")?(s=p("span",{className:"flex items-center gap-1",children:[d("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:A}),y.global.label]}),a[1]=s):s=a[1];let o;a[2]===Symbol.for("react.memo_cache_sentinel")?(o=d(v,{className:"px-1 py-0 text-[10px] leading-tight",variant:"secondary",children:"PK"}),a[2]=o):o=a[2];let n;a[3]!==e?(n=e("Primary key"),a[3]=e,a[4]=n):n=a[4];let r;a[5]!==n?(r=p("span",{className:"flex items-center gap-1",children:[o,n]}),a[5]=n,a[6]=r):r=a[6];let l;a[7]===Symbol.for("react.memo_cache_sentinel")?(l=d(v,{className:"px-1 py-0 text-[10px] leading-tight",variant:"outline",children:"FK"}),a[7]=l):l=a[7];let c;a[8]!==e?(c=e("Foreign key"),a[8]=e,a[9]=c):c=a[9];let m;a[10]!==c?(m=p("span",{className:"flex items-center gap-1",children:[l,c]}),a[10]=c,a[11]=m):m=a[11];let i;return a[12]!==r||a[13]!==m?(i=p("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 rounded-xl border border-border bg-card/95 px-2.5 py-1.5 text-[11px] text-muted-foreground shadow-xs",children:[t,s,r,m]}),a[12]=r,a[13]=m,a[14]=i):i=a[14],i},Pe=12,Ie=a=>{const e=w(9),{containerRef:t,seedKey:s}=a,o=ce(),{fitView:n}=K();let r;e[0]!==t||e[1]!==n||e[2]!==o?(r=()=>{if(!o)return;const c=()=>{E(n({duration:0,maxZoom:1.6,padding:.14}))};c();const m=t.current;if(m===null)return;const i=new ResizeObserver(()=>{c()});return i.observe(m),()=>{i.disconnect()}},e[0]=t,e[1]=n,e[2]=o,e[3]=r):r=e[3];let l;return e[4]!==t||e[5]!==n||e[6]!==o||e[7]!==s?(l=[t,n,o,s],e[4]=t,e[5]=n,e[6]=o,e[7]=s,e[8]=l):l=e[8],j(r,l),null},Ue=({containerRef:a,testIdPrefix:e})=>{const t=S(),s=ie(),{getEdges:o}=K(),[n,r]=T(null),l=async()=>{const f=a.current?.querySelector(".react-flow__viewport");if(f){r("png");try{await ke(f,s,`${e}-schema-diagram.png`)}finally{r(null)}}},c=async()=>{const f=a.current?.querySelector(".react-flow__viewport");if(f){r("svg");try{await Ce(f,s,`${e}-schema-diagram.svg`)}finally{r(null)}}},m=()=>{r("json");try{Se(s,o(),`${e}-schema-diagram.json`)}finally{r(null)}},i=()=>{E(l())},u=()=>{E(c())};return d(R,{position:"top-right",children:p(fe,{children:[p(pe,{className:"group/button inline-flex shrink-0 cursor-pointer items-center justify-center gap-1 rounded-md border border-border bg-background px-2 text-xs font-medium whitespace-nowrap hover:bg-muted disabled:pointer-events-none disabled:opacity-50","data-testid":`${e}-export-trigger`,disabled:n!==null,children:[d(ee,{className:"size-3.5",icon:X,strokeWidth:2}),t("Export")]}),p(ge,{align:"end",children:[d(M,{"data-testid":`${e}-export-png`,disabled:n!==null,onClick:i,children:t("PNG")}),d(M,{"data-testid":`${e}-export-svg`,disabled:n!==null,onClick:u,children:t("SVG")}),d(M,{"data-testid":`${e}-export-json`,disabled:n!==null,onClick:m,children:t("JSON")})]})]})})},at=({columnsError:a,fill:e=!1,nodeClasses:t,tables:s,testIdPrefix:o})=>{const n=S(),[r,l]=T(Ee),[c,m]=T(""),i=C(()=>{const h=c.trim().toLowerCase();return s.filter(O=>r[O.tier]&&O.name.toLowerCase().includes(h))},[s,r,c]),u=C(()=>ze(i,a??!1,t??Le),[i,a,t]),f=C(()=>Oe(i),[i]),b=i.map(h=>h.name).join(","),[g,_,G]=re(u),[J,z,W]=oe(f),k=me(null);j(()=>{_(u)},[u,_]),j(()=>{z(f)},[f,z]);const Z=h=>{m(h.target.value)},Y=()=>{l(h=>({...h,shard:!h.shard}))},Q=()=>{l(h=>({...h,global:!h.global}))};return s.length===0?d("section",{className:"flex flex-col gap-2","data-testid":`${o}-section`,children:d("p",{className:"text-sm text-muted-foreground","data-testid":`${o}-empty`,children:n("No tables to graph.")})}):d("section",{className:N("flex flex-col",e&&"min-h-0 flex-1"),"data-testid":`${o}-section`,children:d("div",{className:N("w-full overflow-hidden border border-border bg-muted/20",e?"min-h-0 flex-1":"h-[560px]"),"data-testid":`${o}-canvas`,ref:k,children:p(ne,{edges:J,elementsSelectable:!0,fitView:!0,minZoom:.2,nodes:g,nodesConnectable:!1,nodeTypes:je,onEdgesChange:W,onNodesChange:G,children:[d(se,{}),d(R,{position:"top-left",children:p("div",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card/95 p-2 shadow-xs",children:[d(he,{"aria-label":n("Find table…"),className:"h-7 w-44 text-xs","data-testid":`${o}-find`,onChange:Z,placeholder:n("Find table…"),value:c}),p("div",{"aria-label":n("Storage tiers"),className:"flex items-center gap-1.5",role:"group",children:[p(I,{"aria-pressed":r.shard,className:"gap-1.5","data-testid":`${o}-tier-shard`,onClick:Y,size:"xs",type:"button",variant:r.shard?"default":"outline",children:[d("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:V}),y.shard.label]}),p(I,{"aria-pressed":r.global,className:"gap-1.5","data-testid":`${o}-tier-global`,onClick:Q,size:"xs",type:"button",variant:r.global?"default":"outline",children:[d("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:A}),y.global.label]})]})]})}),d(R,{position:"bottom-center",children:d(Fe,{})}),d(le,{showInteractive:!1}),i.length>Pe&&d(de,{className:"!border !border-border !bg-card",maskColor:"var(--color-muted)",nodeColor:"var(--color-muted-foreground)",nodeStrokeWidth:0,pannable:!0,zoomable:!0}),d(Ue,{containerRef:k,testIdPrefix:o}),d(Ie,{containerRef:k,seedKey:b})]})})})};export{at as S};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import{c as h}from"react/compiler-runtime";import{ScrollArea as i}from"@base-ui/react/scroll-area";import{c as u}from"./utils-bhneXptQ.js";import{jsx as s,jsxs as b}from"react/jsx-runtime";function z(n){const r=h(14);let a,o,t;r[0]!==n?({className:o,children:a,...t}=n,r[0]=n,r[1]=a,r[2]=o,r[3]=t):(a=r[1],o=r[2],t=r[3]);let e;r[4]!==o?(e=u("relative",o),r[4]=o,r[5]=e):e=r[5];let l;r[6]!==a?(l=s(i.Viewport,{"data-slot":"scroll-area-viewport",className:"size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1",children:a}),r[6]=a,r[7]=l):l=r[7];let c,d;r[8]===Symbol.for("react.memo_cache_sentinel")?(c=s(f,{}),d=s(i.Corner,{}),r[8]=c,r[9]=d):(c=r[8],d=r[9]);let m;return r[10]!==t||r[11]!==e||r[12]!==l?(m=b(i.Root,{"data-slot":"scroll-area",className:e,...t,children:[l,c,d]}),r[10]=t,r[11]=e,r[12]=l,r[13]=m):m=r[13],m}function f({className:n,orientation:r="vertical",...a}){return s(i.Scrollbar,{"data-slot":"scroll-area-scrollbar","data-orientation":r,orientation:r,className:u("flex touch-none p-px transition-colors select-none data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-s data-vertical:border-s-transparent",n),...a,children:s(i.Thumb,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-md bg-border"})})}export{z as p};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import{c as f}from"react/compiler-runtime";import"react";import{Select as l}from"@base-ui/react/select";import{c}from"./utils-bhneXptQ.js";import{HugeiconsIcon as m}from"@hugeicons/react";import{UnfoldMoreIcon as p,Tick02Icon as v,ArrowUp01Icon as h,ArrowDown01Icon as b}from"@hugeicons/core-free-icons";import{jsx as i,jsxs as g}from"react/jsx-runtime";const S=l.Root;function W(r){const e=f(8);let t,a;e[0]!==r?({className:t,...a}=r,e[0]=r,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let o;e[3]!==t?(o=c("flex flex-1 text-start",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==a||e[6]!==o?(n=i(l.Value,{"data-slot":"select-value",className:o,...a}),e[5]=a,e[6]=o,e[7]=n):n=e[7],n}function T({className:r,size:e="default",children:t,...a}){return g(l.Trigger,{"data-slot":"select-trigger","data-size":e,className:c("flex w-fit items-center justify-between gap-1.5 rounded-md border border-input bg-transparent py-2 pe-2 ps-2.5 text-xs whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-md *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",r),...a,children:[t,i(l.Icon,{render:i(m,{icon:p,strokeWidth:2,className:"pointer-events-none size-4 text-muted-foreground"})})]})}function $({className:r,children:e,side:t="bottom",sideOffset:a=4,align:o="center",alignOffset:n=0,alignItemWithTrigger:s=!0,...d}){return i(l.Portal,{children:i(l.Positioner,{side:t,sideOffset:a,align:o,alignOffset:n,alignItemWithTrigger:s,className:"isolate z-50",children:g(l.Popup,{"data-slot":"select-content","data-align-trigger":s,className:c("isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-start-2 data-[side=inline-start]:slide-in-from-end-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 animate-none! relative bg-popover before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit] **:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10 **:data-[slot$=-separator]:bg-foreground/5 **:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10! **:data-[variant=destructive]:focus:bg-foreground/10! **:data-[variant=destructive]:text-accent-foreground! **:data-[variant=destructive]:**:text-accent-foreground!",r),...d,children:[i(x,{}),i(l.List,{children:e}),i(w,{})]})})})}function A(r){const e=f(13);let t,a,o;e[0]!==r?({className:a,children:t,...o}=r,e[0]=r,e[1]=t,e[2]=a,e[3]=o):(t=e[1],a=e[2],o=e[3]);let n;e[4]!==a?(n=c("relative flex w-full cursor-default items-center gap-2 rounded-md py-2 pe-8 ps-2 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",a),e[4]=a,e[5]=n):n=e[5];let s;e[6]!==t?(s=i(l.ItemText,{className:"flex flex-1 shrink-0 gap-2 whitespace-nowrap",children:t}),e[6]=t,e[7]=s):s=e[7];let d;e[8]===Symbol.for("react.memo_cache_sentinel")?(d=i(l.ItemIndicator,{render:i("span",{className:"pointer-events-none absolute end-2 flex size-4 items-center justify-center"}),children:i(m,{icon:v,strokeWidth:2,className:"pointer-events-none"})}),e[8]=d):d=e[8];let u;return e[9]!==o||e[10]!==n||e[11]!==s?(u=g(l.Item,{"data-slot":"select-item",className:n,...o,children:[s,d]}),e[9]=o,e[10]=n,e[11]=s,e[12]=u):u=e[12],u}function x(r){const e=f(9);let t,a;e[0]!==r?({className:t,...a}=r,e[0]=r,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let o;e[3]!==t?(o=c("top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",t),e[3]=t,e[4]=o):o=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=i(m,{icon:h,strokeWidth:2}),e[5]=n):n=e[5];let s;return e[6]!==a||e[7]!==o?(s=i(l.ScrollUpArrow,{"data-slot":"select-scroll-up-button",className:o,...a,children:n}),e[6]=a,e[7]=o,e[8]=s):s=e[8],s}function w(r){const e=f(9);let t,a;e[0]!==r?({className:t,...a}=r,e[0]=r,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let o;e[3]!==t?(o=c("bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",t),e[3]=t,e[4]=o):o=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=i(m,{icon:b,strokeWidth:2}),e[5]=n):n=e[5];let s;return e[6]!==a||e[7]!==o?(s=i(l.ScrollDownArrow,{"data-slot":"select-scroll-down-button",className:o,...a,children:n}),e[6]=a,e[7]=o,e[8]=s):s=e[8],s}export{W as N,$ as _,A as k,S as w,T as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as a,l as i}from"./browser-storage-xjTyMKY0.js";const e="lunora-studio-recent-shards",c=10,t=()=>i(e,"session").filter(s=>typeof s=="string"),d=s=>{const r=s.trim();if(r==="")return t();const o=[r,...t().filter(n=>n!==r)].slice(0,c);return a(e,o,"session"),o};export{t as l,d as r};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as l}from"react/compiler-runtime";import{c as m}from"./utils-bhneXptQ.js";import{jsx as n}from"react/jsx-runtime";function p(a){const t=l(8);let e,o;t[0]!==a?({className:e,...o}=a,t[0]=a,t[1]=e,t[2]=o):(e=t[1],o=t[2]);let s;t[3]!==e?(s=m("animate-pulse rounded-md bg-muted",e),t[3]=e,t[4]=s):s=t[4];let r;return t[5]!==o||t[6]!==s?(r=n("div",{"data-slot":"skeleton",className:s,...o}),t[5]=o,t[6]=s,t[7]=r):r=t[7],r}export{p as n};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as u}from"react/compiler-runtime";import{B as p,E as h}from"./bar-chart-DraN_srt.js";import{c as g}from"./utils-bhneXptQ.js";import{jsx as d}from"react/jsx-runtime";const v={value:{colors:{dark:["var(--foreground)"],light:["var(--foreground)"]},label:""}},S=i=>{const a=u(12),{ariaLabel:s,className:c,series:l,testId:m}=i;if(l.length<2)return null;let t;a[0]!==l?(t=l.slice(-40).map(b),a[0]=l,a[1]=t):t=a[1];const f=t;let e;a[2]!==c?(e=g("h-6 w-[120px]",c),a[2]=c,a[3]=e):e=a[3];let o;a[4]===Symbol.for("react.memo_cache_sentinel")?(o=d(p,{dataKey:"value"}),a[4]=o):o=a[4];let r;a[5]!==f?(r=d(h,{animationType:"none",barCategoryGap:1,className:"h-full w-full",config:v,data:f,children:o}),a[5]=f,a[6]=r):r=a[6];let n;return a[7]!==s||a[8]!==e||a[9]!==r||a[10]!==m?(n=d("div",{"aria-label":s,className:e,"data-testid":m,role:"img",children:r}),a[7]=s,a[8]=e,a[9]=r,a[10]=m,a[11]=n):n=a[11],n};function b(i,a){return{index:a,value:i}}export{S};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as d}from"react/compiler-runtime";import{jsx as n,jsxs as h}from"react/jsx-runtime";const b={alignItems:"center",border:"1px solid",borderRadius:4,display:"inline-flex",fontFamily:"var(--font-mono, ui-monospace, monospace)",fontSize:11,fontWeight:400,gap:6,letterSpacing:"0.06em",lineHeight:1.4,padding:"1px 8px",textTransform:"uppercase"},c={borderRadius:"50%",display:"inline-block",height:7,width:7},i=(l,e,t,a)=>({badgeStyle:{...b,borderColor:l,color:l},color:l,dotStyle:{...c,backgroundColor:l},hint:a,label:e,title:t}),p={global:i("var(--royal-amethyst)","Global · D1","Global table — a single D1 table shared across all shards","Declared .global() and stored once in Cloudflare D1, shared across every shard and tenant. Auth tables (user, session, …) live here too."),shard:i("var(--sky-sapphire)","Shard-local","Shard-local table — per-shard SQLite inside a Durable Object","Stored per shard key in a Durable Object's SQLite (.shardBy(...)). You are viewing one shard at a time — change the shard key to inspect another.")},S=l=>{const e=d(9),{tier:t}=l,a=p[t],s=`storage-tier-${t}`;let r;e[0]!==a.dotStyle?(r=n("span",{"aria-hidden":"true",style:a.dotStyle}),e[0]=a.dotStyle,e[1]=r):r=e[1];let o;return e[2]!==a.badgeStyle||e[3]!==a.label||e[4]!==a.title||e[5]!==s||e[6]!==r||e[7]!==t?(o=h("span",{"data-testid":s,"data-tier":t,style:a.badgeStyle,title:a.title,children:[r,a.label]}),e[2]=a.badgeStyle,e[3]=a.label,e[4]=a.title,e[5]=s,e[6]=r,e[7]=t,e[8]=o):o=e[8],o};export{p as d,S as g};
|