@lunora/studio 1.0.0-alpha.4 → 1.0.0-alpha.41

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.
Files changed (187) hide show
  1. package/LICENSE.md +6 -0
  2. package/__assets__/package-og.svg +1 -1
  3. package/dist/index.d.ts +33 -18
  4. package/dist/index.js +29 -29
  5. package/dist/mount.d.ts +1 -1
  6. package/dist/mount.js +3 -2
  7. package/dist/{packem_shared/ApiTab-W3no0KOj.js → packem_chunks/ApiTab.js} +5 -5
  8. package/dist/{packem_shared/AuditPanel-Bq4o_IqT.js → packem_chunks/AuditPanel.js} +29 -41
  9. package/dist/{packem_shared/ExportImportPanel-dxY56TDF.js → packem_chunks/ExportImportPanel.js} +16 -11
  10. package/dist/{packem_shared/FileBrowser-Dhy4zES8.js → packem_chunks/FileBrowser.js} +15 -15
  11. package/dist/{packem_shared/FunctionRunner--fQJRPAD.js → packem_chunks/FunctionRunner.js} +10 -10
  12. package/dist/{packem_shared/FunctionStatsPanel-BjRUA_G3.js → packem_chunks/FunctionStatsPanel.js} +153 -208
  13. package/dist/{packem_shared/HealthPanel-PxclMWmA.js → packem_chunks/HealthPanel.js} +37 -29
  14. package/dist/{packem_shared/InsightsPanel-CWS_C-xW.js → packem_chunks/InsightsPanel.js} +108 -69
  15. package/dist/{packem_shared/LogsPanel-CTW8CFcM.js → packem_chunks/LogsPanel.js} +46 -58
  16. package/dist/{packem_shared/MailPanel-BwkvfIHF.js → packem_chunks/MailPanel.js} +45 -139
  17. package/dist/{packem_shared/MetricsPanel-BLuOhZQ4.js → packem_chunks/MetricsPanel.js} +41 -322
  18. package/dist/{packem_shared/MigrationsPanel-DT3lnwHF.js → packem_chunks/MigrationsPanel.js} +44 -51
  19. package/dist/{packem_shared/PitrPanel-CdErL7EJ.js → packem_chunks/PitrPanel.js} +9 -9
  20. package/dist/{packem_shared/SchemaViewer-LJDcmNIO.js → packem_chunks/SchemaViewer.js} +17 -16
  21. package/dist/{packem_shared/SecurityAdvisorPanel-C_ETsPih.js → packem_chunks/SecurityAdvisorPanel.js} +47 -31
  22. package/dist/packem_chunks/SettingsPanel.js +391 -0
  23. package/dist/{packem_shared/sql-editor-panel-BFRpzj6r.js → packem_chunks/SqlEditorPanel.js} +158 -387
  24. package/dist/{packem_shared/TableEditor-ChfUOZec.js → packem_chunks/TableEditor.js} +10 -68
  25. package/dist/packem_chunks/analytics-panel.js +261 -0
  26. package/dist/packem_chunks/auth-config-panel.js +365 -0
  27. package/dist/packem_chunks/auth-sessions-panel.js +175 -0
  28. package/dist/packem_chunks/containers-panel.js +247 -0
  29. package/dist/packem_chunks/dashboards-panel.js +780 -0
  30. package/dist/packem_chunks/fanout-panel.js +482 -0
  31. package/dist/packem_chunks/flags-panel.js +176 -0
  32. package/dist/packem_chunks/kv-browser.js +1896 -0
  33. package/dist/packem_chunks/log-drains-panel.js +273 -0
  34. package/dist/packem_chunks/organizations-panel.js +3178 -0
  35. package/dist/packem_chunks/payments-panel.js +186 -0
  36. package/dist/packem_chunks/permissions-panel.js +805 -0
  37. package/dist/packem_chunks/queues-panel.js +1075 -0
  38. package/dist/packem_chunks/rls-panel.js +315 -0
  39. package/dist/packem_chunks/schedule-panel.js +831 -0
  40. package/dist/packem_chunks/sparkline.js +79 -0
  41. package/dist/packem_chunks/storage-rules-panel.js +140 -0
  42. package/dist/packem_chunks/subscriptions-panel.js +238 -0
  43. package/dist/packem_chunks/users-panel.js +1731 -0
  44. package/dist/packem_chunks/vector-browser.js +281 -0
  45. package/dist/packem_chunks/workflows-panel.js +562 -0
  46. package/dist/packem_shared/{ADMIN_FUNCTIONS-DmBqMZ-z.js → ADMIN_FUNCTIONS-BHHJi3Gb.js} +7 -0
  47. package/dist/packem_shared/{ApiDocsPanel-C5-yJ1p7.js → ApiDocsPanel-CBma-lnp.js} +2 -2
  48. package/dist/packem_shared/{ApiReferencePanel-1vubqG5s.js → ApiReferencePanel-CQM3pPN7.js} +2 -1
  49. package/dist/packem_shared/{CommandPalette-BtgkBzZI.js → CommandPalette-X2tkbyHk.js} +1 -1
  50. package/dist/packem_shared/{DataBrowser-CtBe1So9.js → DataBrowser-D2ywrdId.js} +198 -247
  51. package/dist/packem_shared/{GlobalDataBrowser-BTEmGrph.js → GlobalDataBrowser-BkTPLzAY.js} +37 -66
  52. package/dist/packem_shared/HomePanel-D1Q9LZgK.js +14 -0
  53. package/dist/packem_shared/{OpenRpcReferencePanel-vbcYbv3V.js → OpenRpcReferencePanel-Dno-hfDb.js} +2 -1
  54. package/dist/packem_shared/{ScheduledJobs-CabfKbyM.js → ScheduledJobs-Ctw4jYtU.js} +163 -60
  55. package/dist/packem_shared/Studio-lJhzDAze.js +16 -0
  56. package/dist/packem_shared/{StudioApp-CHOZA-z-.js → StudioApp-DiMkupvZ.js} +276 -11
  57. package/dist/packem_shared/{advisor-view-CGcfMiPq.js → advisor-view-BX8OhG0w.js} +6 -6
  58. package/dist/packem_shared/alert-CdAET2K_.js +68 -0
  59. package/dist/packem_shared/{app.d-CCmwDEVs.d.ts → app.d-CNLRTrWw.d.ts} +1 -1
  60. package/dist/packem_shared/{bar-chart-CzJAgqkp.js → bar-chart-DSwcWIRy.js} +5 -4
  61. package/dist/packem_shared/browser-storage-BTrX4y3B.js +215 -0
  62. package/dist/packem_shared/{cf-links-2cktDedA.js → cf-links-BZfRdxSE.js} +1 -1
  63. package/dist/packem_shared/{data-grid-B5CaV3wS.js → data-grid-CdXztApG.js} +1 -1
  64. package/dist/packem_shared/data-view-params-Cd6yRVbv.js +96 -0
  65. package/dist/packem_shared/error-alert-CXjqyGw9.js +114 -0
  66. package/dist/packem_shared/{grid-features-CzUfqgsM.js → grid-features-BF-KBDFz.js} +131 -163
  67. package/dist/packem_shared/home-panel-TFcRf9Ui.js +1889 -0
  68. package/dist/packem_shared/{internal-rXJEAhXS.js → internal-CYcbqMjX.js} +44 -3
  69. package/dist/packem_shared/modal-shell-hyaJvIJ6.js +100 -0
  70. package/dist/packem_shared/{reference-view-B4E49Lip.js → reference-view-DUiJcILV.js} +6 -45
  71. package/dist/packem_shared/scroll-area-DLhcy-ml.js +93 -0
  72. package/dist/packem_shared/select-UkNYCT3s.js +273 -0
  73. package/dist/packem_shared/skeleton-CGhL0p20.js +45 -0
  74. package/dist/packem_shared/{sparkline-10dG-_f0.js → sparkline-BnA1kC9X.js} +1 -1
  75. package/dist/packem_shared/studio-Dh9UlaF_.js +4015 -0
  76. package/dist/packem_shared/{table-_RzNvy3R.js → table-DsCa9Qp9.js} +1 -1
  77. package/dist/packem_shared/{table-list-sidebar-Bg7uzbvC.js → table-list-sidebar-UVIXQJdU.js} +1 -1
  78. package/dist/packem_shared/use-admin-query-CfHYWx5n.js +106 -0
  79. package/dist/packem_shared/use-async-submit-DJQiPc-_.js +91 -0
  80. package/dist/standalone/chunk-25AYY4H7.js +2 -0
  81. package/dist/standalone/chunk-2ANAF4ZM.js +1 -0
  82. package/dist/standalone/chunk-2K47A3P6.js +1 -0
  83. package/dist/standalone/chunk-2NGUNNGW.js +1 -0
  84. package/dist/standalone/chunk-3CJW6NWG.js +4 -0
  85. package/dist/standalone/chunk-3OA7PECS.js +6 -0
  86. package/dist/standalone/chunk-3OIHOXVV.js +1 -0
  87. package/dist/standalone/chunk-447TAUFD.js +1 -0
  88. package/dist/standalone/chunk-4QHKBC77.js +1 -0
  89. package/dist/standalone/chunk-5C4TSNE6.js +1 -0
  90. package/dist/standalone/chunk-5OIBXYZM.js +1 -0
  91. package/dist/standalone/chunk-6HSHEMZV.js +76 -0
  92. package/dist/standalone/chunk-6JIZ34MB.js +3 -0
  93. package/dist/standalone/chunk-6VO23MMW.js +4 -0
  94. package/dist/standalone/chunk-7MVSQS7B.js +1 -0
  95. package/dist/standalone/chunk-7TJJXVSE.js +1 -0
  96. package/dist/standalone/chunk-7YXOPTWI.js +1 -0
  97. package/dist/standalone/chunk-AHILM3ZP.js +1 -0
  98. package/dist/standalone/chunk-BGXOXASQ.js +1 -0
  99. package/dist/standalone/chunk-BJGBHGK3.js +1 -0
  100. package/dist/standalone/chunk-BOXSWNXZ.js +1 -0
  101. package/dist/standalone/chunk-BX5MKYOC.js +1 -0
  102. package/dist/standalone/chunk-CKSHCYGC.js +2 -0
  103. package/dist/standalone/chunk-DWDILV2E.js +1 -0
  104. package/dist/standalone/chunk-E75ANNWX.js +19 -0
  105. package/dist/standalone/chunk-EQZQOTJY.js +1 -0
  106. package/dist/standalone/chunk-GTLEWM5Y.js +1 -0
  107. package/dist/standalone/chunk-GTM65MVX.js +1 -0
  108. package/dist/standalone/chunk-GUI5GFFI.js +1 -0
  109. package/dist/standalone/chunk-HN6KJXYQ.js +1 -0
  110. package/dist/standalone/chunk-HV7G6DFP.js +5 -0
  111. package/dist/standalone/chunk-HYDJNCGW.js +1 -0
  112. package/dist/standalone/chunk-HZK5RQHG.js +1 -0
  113. package/dist/standalone/chunk-IN2SYVJB.js +1 -0
  114. package/dist/standalone/chunk-IOANPSJN.js +1 -0
  115. package/dist/standalone/chunk-ISDZPW3V.js +1 -0
  116. package/dist/standalone/chunk-IXDH4GL5.js +1 -0
  117. package/dist/standalone/chunk-J6J54MBP.js +1 -0
  118. package/dist/standalone/chunk-J73VHFCL.js +1 -0
  119. package/dist/standalone/chunk-JHKMUTIF.js +13 -0
  120. package/dist/standalone/chunk-JPRH6DPK.js +1 -0
  121. package/dist/standalone/chunk-JSEXCW5Q.js +1 -0
  122. package/dist/standalone/chunk-KA5YB3VP.js +1 -0
  123. package/dist/standalone/chunk-KBB75WNT.js +1 -0
  124. package/dist/standalone/chunk-KEGAWN6Y.js +1 -0
  125. package/dist/standalone/chunk-KJJ3WM6H.js +4 -0
  126. package/dist/standalone/chunk-KQV4NGH3.js +1 -0
  127. package/dist/standalone/chunk-KSKXW5PX.js +1 -0
  128. package/dist/standalone/chunk-KUH4P5F5.js +1 -0
  129. package/dist/standalone/chunk-KYJPPVGB.js +1 -0
  130. package/dist/standalone/chunk-KZ6INM5M.js +1 -0
  131. package/dist/standalone/chunk-L2TJVSDQ.js +1 -0
  132. package/dist/standalone/chunk-L7SK4ZZD.js +1 -0
  133. package/dist/standalone/chunk-LAK5VSPI.js +1 -0
  134. package/dist/standalone/chunk-LBN7LPVK.js +1 -0
  135. package/dist/standalone/chunk-LNZIB2MD.js +1 -0
  136. package/dist/standalone/chunk-MJWVMKQ4.js +6 -0
  137. package/dist/standalone/chunk-MLZYX5CQ.js +1 -0
  138. package/dist/standalone/chunk-N2X2OO4V.js +1 -0
  139. package/dist/standalone/chunk-NGKITPQP.js +13 -0
  140. package/dist/standalone/chunk-O3NAGRTR.js +1 -0
  141. package/dist/standalone/chunk-OZACQNKG.js +1 -0
  142. package/dist/standalone/chunk-PNDNXS5Z.js +1 -0
  143. package/dist/standalone/chunk-Q7DMUTUE.js +1 -0
  144. package/dist/standalone/chunk-QAFAJBAW.js +1 -0
  145. package/dist/standalone/chunk-QBAT52GB.js +1 -0
  146. package/dist/standalone/chunk-RHZ4M2NZ.js +1 -0
  147. package/dist/standalone/chunk-RRCPZMC2.js +22 -0
  148. package/dist/standalone/chunk-SEU5V7I6.js +1 -0
  149. package/dist/standalone/chunk-TAD43CG5.js +1 -0
  150. package/dist/standalone/chunk-TBMYIZIO.js +1 -0
  151. package/dist/standalone/chunk-TDZ44E5I.js +4 -0
  152. package/dist/standalone/chunk-THNBTMUF.js +1 -0
  153. package/dist/standalone/chunk-TIQISBGK.js +1 -0
  154. package/dist/standalone/chunk-TMYVNQ66.js +1 -0
  155. package/dist/standalone/chunk-TQ36RWOP.js +1 -0
  156. package/dist/standalone/chunk-UGUEC6BC.js +1 -0
  157. package/dist/standalone/chunk-UJB2LEI4.js +4 -0
  158. package/dist/standalone/chunk-UK64ZSUW.js +1 -0
  159. package/dist/standalone/chunk-UKDJ4H7I.js +1 -0
  160. package/dist/standalone/chunk-VLXV72QE.js +1 -0
  161. package/dist/standalone/chunk-VON7JUPG.js +1 -0
  162. package/dist/standalone/chunk-W3JK4YWR.js +1 -0
  163. package/dist/standalone/chunk-W3SHEIAL.js +3 -0
  164. package/dist/standalone/chunk-WI7GWFEG.js +1 -0
  165. package/dist/standalone/chunk-WIHXMNUY.js +1 -0
  166. package/dist/standalone/chunk-WLDVXVI2.js +1 -0
  167. package/dist/standalone/chunk-XLXNLJ4N.js +1 -0
  168. package/dist/standalone/chunk-XNJNSCLM.js +1 -0
  169. package/dist/standalone/chunk-YAECF5LW.js +1 -0
  170. package/dist/standalone/chunk-YBGC4PPD.js +1 -0
  171. package/dist/standalone/chunk-YJAPWSDC.js +4 -0
  172. package/dist/standalone/chunk-ZEJB6DXU.js +8 -0
  173. package/dist/standalone/chunk-ZFNBPAIZ.js +1 -0
  174. package/dist/standalone/chunk-ZHVTQ37P.js +1 -0
  175. package/dist/standalone/chunk-ZIGWVHCS.js +1 -0
  176. package/dist/standalone/chunk-ZPP2KOR4.js +1 -0
  177. package/dist/standalone/chunk-ZPUO7FNI.js +1 -0
  178. package/dist/standalone/studio.js +104 -246
  179. package/dist/styles.css +2 -2
  180. package/package.json +15 -13
  181. package/dist/packem_shared/HomePanel-Cw16stjq.js +0 -1273
  182. package/dist/packem_shared/SettingsPanel-C0uLRf5P.js +0 -176
  183. package/dist/packem_shared/SqlEditorPanel-CguV7otm.js +0 -13
  184. package/dist/packem_shared/Studio-DFWAlcuf.js +0 -33
  185. package/dist/packem_shared/studio-Bj8psK1c.js +0 -10303
  186. package/dist/packem_shared/use-live-admin-Dq6g3daN.js +0 -73
  187. package/dist/packem_shared/use-live-shard-seed-Cuk3dnH0.js +0 -76
@@ -1,290 +1,23 @@
1
- 'use client';
2
1
  import { c } from 'react/compiler-runtime';
3
2
  import { useLunora } from '@lunora/react';
4
3
  import { useState, useRef, useEffect, useMemo } from 'react';
5
- import { L as LiveError } from './live-status-FZ0psC1z.js';
6
- import { ShardInput } from './ShardInput-gx_DZXXn.js';
7
- import { B as Button } from './button-BhsN2uZH.js';
8
- import { a as CardContent, C as Card, b as CardHeader, c as CardTitle, d as CardDescription } from './card-DURq3ElK.js';
9
- import { T as Table, a as TableHeader, b as TableRow, c as TableHead, d as TableBody, e as TableCell } from './table-_RzNvy3R.js';
10
- import { u as useLiveAdmin } from './use-live-admin-Dq6g3daN.js';
11
- import { useT } from './DEFAULT_LOCALE-CiX4W7Kr.js';
12
- import { ADMIN_FUNCTIONS } from './ADMIN_FUNCTIONS-DmBqMZ-z.js';
13
- import { c as CLOUDFLARE_DURABLE_OBJECTS_URL } from './cf-links-2cktDedA.js';
14
- import { d as formatBytes, f as fireAndForget, c as callOptions, e as errorMessage, a as adminRef } from './internal-rXJEAhXS.js';
15
- import { l as loadRecentShards, r as recordShard } from './shard-history-DyebH1R5.js';
16
- import { u as useLiveShardSeed } from './use-live-shard-seed-Cuk3dnH0.js';
17
- import { aggregateMetrics, computeLatencyPercentiles, enrichQueryStats, shardsToAggregate } from './aggregateMetrics-D4nUHEKU.js';
18
- import { B as Badge } from './badge-B2PKA1-5.js';
19
- import { Select as Select$1 } from '@base-ui/react/select';
20
- import { c as cn } from './utils-B05Dmz_H.js';
21
- import { HugeiconsIcon } from '@hugeicons/react';
22
- import { UnfoldMoreIcon, Tick02Icon, ArrowUp01Icon, ArrowDown01Icon } from '@hugeicons/core-free-icons';
4
+ import { L as LiveError } from '../packem_shared/live-status-FZ0psC1z.js';
5
+ import { ShardInput } from '../packem_shared/ShardInput-gx_DZXXn.js';
6
+ import { B as Button } from '../packem_shared/button-BhsN2uZH.js';
7
+ import { a as CardContent, C as Card, b as CardHeader, c as CardTitle, d as CardDescription } from '../packem_shared/card-DURq3ElK.js';
8
+ import { T as Table, a as TableHeader, b as TableRow, c as TableHead, d as TableBody, e as TableCell } from '../packem_shared/table-DsCa9Qp9.js';
9
+ import { u as useAdminQuery } from '../packem_shared/use-admin-query-CfHYWx5n.js';
10
+ import useDebounced from '../packem_shared/useDebounced-Dxncpg6z.js';
11
+ import { useT } from '../packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js';
12
+ import { ADMIN_FUNCTIONS } from '../packem_shared/ADMIN_FUNCTIONS-BHHJi3Gb.js';
13
+ import { c as CLOUDFLARE_DURABLE_OBJECTS_URL } from '../packem_shared/cf-links-BZfRdxSE.js';
14
+ import { j as formatBytes, f as fireAndForget, c as callOptions, e as errorMessage, a as adminRef } from '../packem_shared/internal-CYcbqMjX.js';
15
+ import { r as recordShard, l as loadRecentShards } from '../packem_shared/shard-history-DyebH1R5.js';
16
+ import { aggregateMetrics, computeLatencyPercentiles, enrichQueryStats, shardsToAggregate } from '../packem_shared/aggregateMetrics-D4nUHEKU.js';
17
+ import { B as Badge } from '../packem_shared/badge-B2PKA1-5.js';
18
+ import { S as SelectValue, a as SelectTrigger, b as SelectItem, c as SelectContent, d as Select } from '../packem_shared/select-UkNYCT3s.js';
23
19
  import { jsxDEV, Fragment } from 'react/jsx-dev-runtime';
24
- import { S as Sparkline } from './sparkline-10dG-_f0.js';
25
-
26
- const Select = Select$1.Root;
27
- function SelectValue(t0) {
28
- const $ = c(8);
29
- let className;
30
- let props;
31
- if ($[0] !== t0) {
32
- ({
33
- className,
34
- ...props
35
- } = t0);
36
- $[0] = t0;
37
- $[1] = className;
38
- $[2] = props;
39
- } else {
40
- className = $[1];
41
- props = $[2];
42
- }
43
- let t1;
44
- if ($[3] !== className) {
45
- t1 = cn("flex flex-1 text-start", className);
46
- $[3] = className;
47
- $[4] = t1;
48
- } else {
49
- t1 = $[4];
50
- }
51
- let t2;
52
- if ($[5] !== props || $[6] !== t1) {
53
- t2 = /* @__PURE__ */ jsxDEV(Select$1.Value, {
54
- "data-slot": "select-value",
55
- className: t1,
56
- ...props
57
- }, void 0, false);
58
- $[5] = props;
59
- $[6] = t1;
60
- $[7] = t2;
61
- } else {
62
- t2 = $[7];
63
- }
64
- return t2;
65
- }
66
- function SelectTrigger({
67
- className,
68
- size = "default",
69
- children,
70
- ...props
71
- }) {
72
- return /* @__PURE__ */ jsxDEV(Select$1.Trigger, {
73
- "data-slot": "select-trigger",
74
- "data-size": size,
75
- className: cn("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", className),
76
- ...props,
77
- children: [children, /* @__PURE__ */ jsxDEV(Select$1.Icon, {
78
- render: /* @__PURE__ */ jsxDEV(HugeiconsIcon, {
79
- icon: UnfoldMoreIcon,
80
- strokeWidth: 2,
81
- className: "pointer-events-none size-4 text-muted-foreground"
82
- }, void 0, false)
83
- }, void 0, false)]
84
- }, void 0, true);
85
- }
86
- function SelectContent({
87
- className,
88
- children,
89
- side = "bottom",
90
- sideOffset = 4,
91
- align = "center",
92
- alignOffset = 0,
93
- alignItemWithTrigger = true,
94
- ...props
95
- }) {
96
- return /* @__PURE__ */ jsxDEV(Select$1.Portal, {
97
- children: /* @__PURE__ */ jsxDEV(Select$1.Positioner, {
98
- side,
99
- sideOffset,
100
- align,
101
- alignOffset,
102
- alignItemWithTrigger,
103
- className: "isolate z-50",
104
- children: /* @__PURE__ */ jsxDEV(Select$1.Popup, {
105
- "data-slot": "select-content",
106
- "data-align-trigger": alignItemWithTrigger,
107
- className: cn("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!", className),
108
- ...props,
109
- children: [/* @__PURE__ */ jsxDEV(SelectScrollUpButton, {}, void 0, false), /* @__PURE__ */ jsxDEV(Select$1.List, {
110
- children
111
- }, void 0, false), /* @__PURE__ */ jsxDEV(SelectScrollDownButton, {}, void 0, false)]
112
- }, void 0, true)
113
- }, void 0, false)
114
- }, void 0, false);
115
- }
116
- function SelectItem(t0) {
117
- const $ = c(13);
118
- let children;
119
- let className;
120
- let props;
121
- if ($[0] !== t0) {
122
- ({
123
- className,
124
- children,
125
- ...props
126
- } = t0);
127
- $[0] = t0;
128
- $[1] = children;
129
- $[2] = className;
130
- $[3] = props;
131
- } else {
132
- children = $[1];
133
- className = $[2];
134
- props = $[3];
135
- }
136
- let t1;
137
- if ($[4] !== className) {
138
- t1 = cn("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", className);
139
- $[4] = className;
140
- $[5] = t1;
141
- } else {
142
- t1 = $[5];
143
- }
144
- let t2;
145
- if ($[6] !== children) {
146
- t2 = /* @__PURE__ */ jsxDEV(Select$1.ItemText, {
147
- className: "flex flex-1 shrink-0 gap-2 whitespace-nowrap",
148
- children
149
- }, void 0, false);
150
- $[6] = children;
151
- $[7] = t2;
152
- } else {
153
- t2 = $[7];
154
- }
155
- let t3;
156
- if ($[8] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
157
- t3 = /* @__PURE__ */ jsxDEV(Select$1.ItemIndicator, {
158
- render: /* @__PURE__ */ jsxDEV("span", {
159
- className: "pointer-events-none absolute end-2 flex size-4 items-center justify-center"
160
- }, void 0, false),
161
- children: /* @__PURE__ */ jsxDEV(HugeiconsIcon, {
162
- icon: Tick02Icon,
163
- strokeWidth: 2,
164
- className: "pointer-events-none"
165
- }, void 0, false)
166
- }, void 0, false);
167
- $[8] = t3;
168
- } else {
169
- t3 = $[8];
170
- }
171
- let t4;
172
- if ($[9] !== props || $[10] !== t1 || $[11] !== t2) {
173
- t4 = /* @__PURE__ */ jsxDEV(Select$1.Item, {
174
- "data-slot": "select-item",
175
- className: t1,
176
- ...props,
177
- children: [t2, t3]
178
- }, void 0, true);
179
- $[9] = props;
180
- $[10] = t1;
181
- $[11] = t2;
182
- $[12] = t4;
183
- } else {
184
- t4 = $[12];
185
- }
186
- return t4;
187
- }
188
- function SelectScrollUpButton(t0) {
189
- const $ = c(9);
190
- let className;
191
- let props;
192
- if ($[0] !== t0) {
193
- ({
194
- className,
195
- ...props
196
- } = t0);
197
- $[0] = t0;
198
- $[1] = className;
199
- $[2] = props;
200
- } else {
201
- className = $[1];
202
- props = $[2];
203
- }
204
- let t1;
205
- if ($[3] !== className) {
206
- t1 = cn("top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4", className);
207
- $[3] = className;
208
- $[4] = t1;
209
- } else {
210
- t1 = $[4];
211
- }
212
- let t2;
213
- if ($[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
214
- t2 = /* @__PURE__ */ jsxDEV(HugeiconsIcon, {
215
- icon: ArrowUp01Icon,
216
- strokeWidth: 2
217
- }, void 0, false);
218
- $[5] = t2;
219
- } else {
220
- t2 = $[5];
221
- }
222
- let t3;
223
- if ($[6] !== props || $[7] !== t1) {
224
- t3 = /* @__PURE__ */ jsxDEV(Select$1.ScrollUpArrow, {
225
- "data-slot": "select-scroll-up-button",
226
- className: t1,
227
- ...props,
228
- children: t2
229
- }, void 0, false);
230
- $[6] = props;
231
- $[7] = t1;
232
- $[8] = t3;
233
- } else {
234
- t3 = $[8];
235
- }
236
- return t3;
237
- }
238
- function SelectScrollDownButton(t0) {
239
- const $ = c(9);
240
- let className;
241
- let props;
242
- if ($[0] !== t0) {
243
- ({
244
- className,
245
- ...props
246
- } = t0);
247
- $[0] = t0;
248
- $[1] = className;
249
- $[2] = props;
250
- } else {
251
- className = $[1];
252
- props = $[2];
253
- }
254
- let t1;
255
- if ($[3] !== className) {
256
- t1 = cn("bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4", className);
257
- $[3] = className;
258
- $[4] = t1;
259
- } else {
260
- t1 = $[4];
261
- }
262
- let t2;
263
- if ($[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
264
- t2 = /* @__PURE__ */ jsxDEV(HugeiconsIcon, {
265
- icon: ArrowDown01Icon,
266
- strokeWidth: 2
267
- }, void 0, false);
268
- $[5] = t2;
269
- } else {
270
- t2 = $[5];
271
- }
272
- let t3;
273
- if ($[6] !== props || $[7] !== t1) {
274
- t3 = /* @__PURE__ */ jsxDEV(Select$1.ScrollDownArrow, {
275
- "data-slot": "select-scroll-down-button",
276
- className: t1,
277
- ...props,
278
- children: t2
279
- }, void 0, false);
280
- $[6] = props;
281
- $[7] = t1;
282
- $[8] = t3;
283
- } else {
284
- t3 = $[8];
285
- }
286
- return t3;
287
- }
20
+ import { S as Sparkline } from '../packem_shared/sparkline-BnA1kC9X.js';
288
21
 
289
22
  const performanceLevel = (avgMs) => {
290
23
  if (avgMs >= 100) {
@@ -1205,6 +938,7 @@ const formatDuration = (ms) => {
1205
938
  }
1206
939
  return `${seconds.toString()}s`;
1207
940
  };
941
+ const resolveTab = (hasQueryStats, activeTab) => hasQueryStats ? activeTab : "overview";
1208
942
  const hitRate = (hits, misses) => {
1209
943
  const total = hits + misses;
1210
944
  return total === 0 ? "—" : `${(hits / total * 100).toFixed(1)}%`;
@@ -1297,24 +1031,33 @@ const MetricsPanel = ({
1297
1031
  const client = useLunora();
1298
1032
  const t = useT();
1299
1033
  const [shardKey, setShardKey] = useState(initialShardKey ?? "");
1300
- const [metrics, setMetrics] = useState(null);
1301
- const [error, setError] = useState(null);
1302
1034
  const [activeTab, setActiveTab] = useState("overview");
1303
- const [liveError, setLiveError] = useState(void 0);
1304
1035
  const [history, setHistory] = useState([]);
1305
- const mountedRef = useRef(true);
1306
1036
  const lastRequestsRef = useRef(null);
1307
1037
  const lastShardRef = useRef(null);
1038
+ const mountedRef = useRef(true);
1308
1039
  useEffect(() => {
1309
1040
  mountedRef.current = true;
1310
1041
  return () => {
1311
1042
  mountedRef.current = false;
1312
1043
  };
1313
1044
  }, []);
1314
- const applySample = (next) => {
1315
- setError(null);
1316
- setLiveError(void 0);
1317
- setMetrics(next);
1045
+ const debouncedShard = useDebounced(shardKey.trim(), 400);
1046
+ const {
1047
+ data,
1048
+ error,
1049
+ liveError
1050
+ } = useAdminQuery(ADMIN_FUNCTIONS.getMetrics, {}, {
1051
+ live: true,
1052
+ shardKey: debouncedShard
1053
+ });
1054
+ const metrics = data ?? null;
1055
+ useEffect(() => {
1056
+ if (data === void 0) {
1057
+ return;
1058
+ }
1059
+ recordShard(debouncedShard);
1060
+ const next = data;
1318
1061
  const previous = lastRequestsRef.current;
1319
1062
  const shardChanged = lastShardRef.current !== null && lastShardRef.current !== next.shard;
1320
1063
  lastShardRef.current = next.shard;
@@ -1326,32 +1069,7 @@ const MetricsPanel = ({
1326
1069
  if (previous !== null && next.requests >= previous) {
1327
1070
  setHistory((prior) => [...prior, next.requests - previous].slice(-30));
1328
1071
  }
1329
- };
1330
- const refresh = async (shard) => {
1331
- try {
1332
- const next_0 = await client.query(GET_METRICS, {}, callOptions(shard));
1333
- recordShard(shard);
1334
- if (mountedRef.current) {
1335
- applySample(next_0);
1336
- }
1337
- } catch (error_) {
1338
- if (mountedRef.current) {
1339
- setMetrics(null);
1340
- setError(errorMessage(error_));
1341
- }
1342
- throw error_;
1343
- }
1344
- };
1345
- const committedShard = useLiveShardSeed(shardKey, refresh);
1346
- useLiveAdmin(ADMIN_FUNCTIONS.getMetrics, {}, committedShard ?? "", (next_1) => {
1347
- if (mountedRef.current) {
1348
- applySample(next_1);
1349
- }
1350
- }, committedShard !== void 0, (message) => {
1351
- if (mountedRef.current) {
1352
- setLiveError(message);
1353
- }
1354
- });
1072
+ }, [data, debouncedShard]);
1355
1073
  const [shardResults, setShardResults] = useState(null);
1356
1074
  const [aggregating, setAggregating] = useState(false);
1357
1075
  const aggregateAll = async () => {
@@ -1412,6 +1130,7 @@ const MetricsPanel = ({
1412
1130
  }
1413
1131
  return enrichQueryStats(snapQs);
1414
1132
  }, [metrics]);
1133
+ const effectiveTab = resolveTab(queryStats !== void 0, activeTab);
1415
1134
  const runAggregate = () => {
1416
1135
  fireAndForget(aggregateAll());
1417
1136
  };
@@ -1468,13 +1187,13 @@ const MetricsPanel = ({
1468
1187
  className: "flex gap-2 border-b",
1469
1188
  "data-testid": "mt-tabs",
1470
1189
  children: [/* @__PURE__ */ jsxDEV("button", {
1471
- className: `pb-2 text-sm font-medium transition-colors ${activeTab === "overview" ? "border-b-2 border-primary text-foreground" : "text-muted-foreground hover:text-foreground"}`,
1190
+ className: `pb-2 text-sm font-medium transition-colors ${effectiveTab === "overview" ? "border-b-2 border-primary text-foreground" : "text-muted-foreground hover:text-foreground"}`,
1472
1191
  "data-testid": "mt-tab-overview",
1473
1192
  onClick: switchToOverview,
1474
1193
  type: "button",
1475
1194
  children: t("Overview")
1476
1195
  }, void 0, false), /* @__PURE__ */ jsxDEV("button", {
1477
- className: `pb-2 text-sm font-medium transition-colors ${activeTab === "query-insights" ? "border-b-2 border-primary text-foreground" : "text-muted-foreground hover:text-foreground"}`,
1196
+ className: `pb-2 text-sm font-medium transition-colors ${effectiveTab === "query-insights" ? "border-b-2 border-primary text-foreground" : "text-muted-foreground hover:text-foreground"}`,
1478
1197
  "data-testid": "mt-tab-query-insights",
1479
1198
  onClick: switchToQueryInsights,
1480
1199
  type: "button",
@@ -1483,9 +1202,9 @@ const MetricsPanel = ({
1483
1202
  children: queryStats.length
1484
1203
  }, void 0, false)]
1485
1204
  }, void 0, true)]
1486
- }, void 0, true), activeTab === "query-insights" && queryStats !== void 0 && /* @__PURE__ */ jsxDEV(QueryInsights, {
1205
+ }, void 0, true), effectiveTab === "query-insights" && queryStats !== void 0 && /* @__PURE__ */ jsxDEV(QueryInsights, {
1487
1206
  queryStats
1488
- }, void 0, false), activeTab === "overview" && metrics !== null && /* @__PURE__ */ jsxDEV("dl", {
1207
+ }, void 0, false), effectiveTab === "overview" && metrics !== null && /* @__PURE__ */ jsxDEV("dl", {
1489
1208
  className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",
1490
1209
  "data-testid": "mt-stats",
1491
1210
  children: [/* @__PURE__ */ jsxDEV(StatCard, {
@@ -1542,7 +1261,7 @@ const MetricsPanel = ({
1542
1261
  rate: hitRate(metrics.cache.hits, metrics.cache.misses)
1543
1262
  })
1544
1263
  }, void 0, false)]
1545
- }, void 0, true), activeTab === "overview" && metrics === null && null, activeTab === "overview" && aggregate !== null && shardResults !== null && /* @__PURE__ */ jsxDEV("div", {
1264
+ }, void 0, true), effectiveTab === "overview" && metrics === null && null, effectiveTab === "overview" && aggregate !== null && shardResults !== null && /* @__PURE__ */ jsxDEV("div", {
1546
1265
  className: "flex flex-col gap-4",
1547
1266
  "data-testid": "mt-aggregate-view",
1548
1267
  children: [/* @__PURE__ */ jsxDEV("dl", {
@@ -1,24 +1,24 @@
1
1
  import { useLunora } from '@lunora/react';
2
- import { useState } from 'react';
3
- import { ConfirmButton } from './ConfirmButton-C2eVi2Qv.js';
4
- import { L as LiveError } from './live-status-FZ0psC1z.js';
5
- import { ShardInput } from './ShardInput-gx_DZXXn.js';
6
- import { B as Badge } from './badge-B2PKA1-5.js';
7
- import { B as Button } from './button-BhsN2uZH.js';
8
- import { C as Card, a as CardContent } from './card-DURq3ElK.js';
9
- import { E as EmptyState } from './empty-state-DY_oe0k6.js';
10
- import { I as Input } from './input-XH4r1Pt1.js';
11
- import { L as Label } from './label-D8ykjn5J.js';
12
- import { T as Table, a as TableHeader, b as TableRow, c as TableHead, d as TableBody, e as TableCell } from './table-_RzNvy3R.js';
13
- import { u as useLiveAdmin } from './use-live-admin-Dq6g3daN.js';
14
- import { useT } from './DEFAULT_LOCALE-CiX4W7Kr.js';
15
- import { ADMIN_FUNCTIONS } from './ADMIN_FUNCTIONS-DmBqMZ-z.js';
16
- import { b as formatTimestamp, f as fireAndForget, c as callOptions, e as errorMessage, a as adminRef } from './internal-rXJEAhXS.js';
17
- import { r as recordShard } from './shard-history-DyebH1R5.js';
18
- import { u as useLiveShardSeed } from './use-live-shard-seed-Cuk3dnH0.js';
2
+ import { useState, useEffect } from 'react';
3
+ import { ConfirmButton } from '../packem_shared/ConfirmButton-C2eVi2Qv.js';
4
+ import { E as ErrorAlert } from '../packem_shared/error-alert-CXjqyGw9.js';
5
+ import { L as LiveError } from '../packem_shared/live-status-FZ0psC1z.js';
6
+ import { ShardInput } from '../packem_shared/ShardInput-gx_DZXXn.js';
7
+ import { B as Badge } from '../packem_shared/badge-B2PKA1-5.js';
8
+ import { B as Button } from '../packem_shared/button-BhsN2uZH.js';
9
+ import { C as Card, a as CardContent } from '../packem_shared/card-DURq3ElK.js';
10
+ import { E as EmptyState } from '../packem_shared/empty-state-DY_oe0k6.js';
11
+ import { I as Input } from '../packem_shared/input-XH4r1Pt1.js';
12
+ import { L as Label } from '../packem_shared/label-D8ykjn5J.js';
13
+ import { T as Table, a as TableHeader, b as TableRow, c as TableHead, d as TableBody, e as TableCell } from '../packem_shared/table-DsCa9Qp9.js';
14
+ import { u as useAdminQuery } from '../packem_shared/use-admin-query-CfHYWx5n.js';
15
+ import useDebounced from '../packem_shared/useDebounced-Dxncpg6z.js';
16
+ import { useT } from '../packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js';
17
+ import { ADMIN_FUNCTIONS } from '../packem_shared/ADMIN_FUNCTIONS-BHHJi3Gb.js';
18
+ import { i as formatTimestamp, f as fireAndForget, c as callOptions, e as errorMessage, a as adminRef } from '../packem_shared/internal-CYcbqMjX.js';
19
+ import { r as recordShard } from '../packem_shared/shard-history-DyebH1R5.js';
19
20
  import { jsxDEV } from 'react/jsx-dev-runtime';
20
21
 
21
- const MIGRATION_STATUS = adminRef(ADMIN_FUNCTIONS.migrationStatus);
22
22
  const RUN_MIGRATION = adminRef(ADMIN_FUNCTIONS.runMigration);
23
23
  const MigrationsPanel = ({
24
24
  initialShardKey
@@ -26,33 +26,29 @@ const MigrationsPanel = ({
26
26
  const client = useLunora();
27
27
  const t = useT();
28
28
  const [shardKey, setShardKey] = useState(initialShardKey ?? "");
29
- const [rows, setRows] = useState(null);
30
- const [statusError, setStatusError] = useState(null);
31
- const [liveError, setLiveError] = useState(void 0);
32
29
  const [migrationId, setMigrationId] = useState("");
33
30
  const [direction, setDirection] = useState("up");
34
31
  const [dryRun, setDryRun] = useState(true);
35
32
  const [running, setRunning] = useState(false);
36
33
  const [runResult, setRunResult] = useState(null);
37
34
  const [runError, setRunError] = useState(null);
38
- const refresh = async (shard) => {
39
- setStatusError(null);
40
- try {
41
- const result = await client.query(MIGRATION_STATUS, {}, callOptions(shard));
42
- recordShard(shard);
43
- setRows(result.migrations);
44
- } catch (error) {
45
- setRows(null);
46
- setStatusError(errorMessage(error));
47
- throw error;
35
+ const debouncedShard = useDebounced(shardKey.trim(), 400);
36
+ const shardSettled = shardKey.trim() === debouncedShard;
37
+ const statusQuery = useAdminQuery(ADMIN_FUNCTIONS.migrationStatus, {}, {
38
+ live: true,
39
+ shardKey: debouncedShard
40
+ });
41
+ const rows = statusQuery.data?.migrations ?? null;
42
+ const statusError = statusQuery.error;
43
+ const {
44
+ errorSource: statusErrorSource,
45
+ liveError
46
+ } = statusQuery;
47
+ useEffect(() => {
48
+ if (statusQuery.data !== void 0) {
49
+ recordShard(debouncedShard);
48
50
  }
49
- };
50
- const committedShard = useLiveShardSeed(shardKey, refresh);
51
- useLiveAdmin(ADMIN_FUNCTIONS.migrationStatus, {}, committedShard ?? "", (result_0) => {
52
- setStatusError(null);
53
- setLiveError(void 0);
54
- setRows(result_0.migrations);
55
- }, committedShard !== void 0, setLiveError);
51
+ }, [statusQuery.data, debouncedShard]);
56
52
  const run = async () => {
57
53
  const id = migrationId.trim();
58
54
  if (id === "") {
@@ -63,17 +59,16 @@ const MigrationsPanel = ({
63
59
  setRunning(true);
64
60
  setRunError(null);
65
61
  try {
66
- const result_1 = await client.query(RUN_MIGRATION, {
62
+ const result = await client.query(RUN_MIGRATION, {
67
63
  direction,
68
64
  dryRun,
69
65
  id
70
66
  }, callOptions(shardKey));
71
- setRunResult(result_1);
72
- await refresh(shardKey).catch(() => {
73
- });
74
- } catch (error_0) {
67
+ setRunResult(result);
68
+ statusQuery.refetch();
69
+ } catch (error) {
75
70
  setRunResult(null);
76
- setRunError(errorMessage(error_0));
71
+ setRunError(errorMessage(error));
77
72
  } finally {
78
73
  setRunning(false);
79
74
  }
@@ -103,11 +98,9 @@ const MigrationsPanel = ({
103
98
  message: liveError,
104
99
  prefix: "mg"
105
100
  }, void 0, false)]
106
- }, void 0, true), statusError !== null && /* @__PURE__ */ jsxDEV("p", {
107
- className: "text-sm text-destructive",
108
- "data-testid": "mg-status-error",
109
- role: "alert",
110
- children: statusError
101
+ }, void 0, true), statusError !== null && /* @__PURE__ */ jsxDEV(ErrorAlert, {
102
+ error: statusErrorSource,
103
+ testId: "mg-status-error"
111
104
  }, void 0, false), rows !== null && rows.length === 0 && /* @__PURE__ */ jsxDEV(EmptyState, {
112
105
  description: t("Data migrations you run against this shard will be tracked here."),
113
106
  icon: /* @__PURE__ */ jsxDEV("svg", {
@@ -212,7 +205,7 @@ const MigrationsPanel = ({
212
205
  }, void 0, false), t("Dry run")]
213
206
  }, void 0, true), dryRun ? /* @__PURE__ */ jsxDEV(Button, {
214
207
  "data-testid": "mg-run",
215
- disabled: running,
208
+ disabled: running || !shardSettled,
216
209
  onClick: runMigration,
217
210
  size: "sm",
218
211
  type: "button",
@@ -221,7 +214,7 @@ const MigrationsPanel = ({
221
214
  // A real (non-dry-run) migration mutates rows — guard it.
222
215
  /* @__PURE__ */ jsxDEV(ConfirmButton, {
223
216
  confirmLabel: running ? t("Running…") : t("Run migration?"),
224
- disabled: running,
217
+ disabled: running || !shardSettled,
225
218
  onConfirm: runMigration,
226
219
  testId: "mg-run",
227
220
  children: t("Run")
@@ -1,14 +1,14 @@
1
1
  import { useLunora } from '@lunora/react';
2
2
  import { useState, useCallback, useEffect } from 'react';
3
- import { ConfirmButton } from './ConfirmButton-C2eVi2Qv.js';
4
- import { B as Badge } from './badge-B2PKA1-5.js';
5
- import { B as Button } from './button-BhsN2uZH.js';
6
- import { I as Input } from './input-XH4r1Pt1.js';
7
- import { L as Label } from './label-D8ykjn5J.js';
8
- import { useAutoRefresh } from './DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js';
9
- import { useT } from './DEFAULT_LOCALE-CiX4W7Kr.js';
10
- import { ADMIN_FUNCTIONS } from './ADMIN_FUNCTIONS-DmBqMZ-z.js';
11
- import { c as callOptions, e as errorMessage, f as fireAndForget, a as adminRef } from './internal-rXJEAhXS.js';
3
+ import { ConfirmButton } from '../packem_shared/ConfirmButton-C2eVi2Qv.js';
4
+ import { B as Badge } from '../packem_shared/badge-B2PKA1-5.js';
5
+ import { B as Button } from '../packem_shared/button-BhsN2uZH.js';
6
+ import { I as Input } from '../packem_shared/input-XH4r1Pt1.js';
7
+ import { L as Label } from '../packem_shared/label-D8ykjn5J.js';
8
+ import { useAutoRefresh } from '../packem_shared/DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js';
9
+ import { useT } from '../packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js';
10
+ import { ADMIN_FUNCTIONS } from '../packem_shared/ADMIN_FUNCTIONS-BHHJi3Gb.js';
11
+ import { c as callOptions, e as errorMessage, f as fireAndForget, a as adminRef } from '../packem_shared/internal-CYcbqMjX.js';
12
12
  import { jsxDEV } from 'react/jsx-dev-runtime';
13
13
 
14
14
  const GET_BOOKMARK = adminRef(ADMIN_FUNCTIONS.getPitrBookmark);
@@ -2,27 +2,28 @@
2
2
  import { c } from 'react/compiler-runtime';
3
3
  import { useLunora } from '@lunora/react';
4
4
  import { useState, useRef, useEffect } from 'react';
5
- import { ShardInput } from './ShardInput-gx_DZXXn.js';
6
- import { S as StorageTierBadge, T as TIER_META } from './storage-tier-CL98eOvn.js';
7
- import { B as Badge } from './badge-B2PKA1-5.js';
8
- import { B as Button } from './button-BhsN2uZH.js';
9
- import { C as Card, b as CardHeader, c as CardTitle, d as CardDescription, a as CardContent } from './card-DURq3ElK.js';
10
- import { E as EmptyState } from './empty-state-DY_oe0k6.js';
11
- import { I as Input } from './input-XH4r1Pt1.js';
12
- import useDebounced from './useDebounced-Dxncpg6z.js';
13
- import { useT } from './DEFAULT_LOCALE-CiX4W7Kr.js';
14
- import { ADMIN_FUNCTIONS } from './ADMIN_FUNCTIONS-DmBqMZ-z.js';
15
- import { f as fireAndForget, c as callOptions, e as errorMessage, a as adminRef } from './internal-rXJEAhXS.js';
16
- import { r as recordShard } from './shard-history-DyebH1R5.js';
17
- import { c as cn } from './utils-B05Dmz_H.js';
5
+ import { ShardInput } from '../packem_shared/ShardInput-gx_DZXXn.js';
6
+ import { S as StorageTierBadge, T as TIER_META } from '../packem_shared/storage-tier-CL98eOvn.js';
7
+ import { B as Badge } from '../packem_shared/badge-B2PKA1-5.js';
8
+ import { B as Button } from '../packem_shared/button-BhsN2uZH.js';
9
+ import { C as Card, b as CardHeader, c as CardTitle, d as CardDescription, a as CardContent } from '../packem_shared/card-DURq3ElK.js';
10
+ import { E as EmptyState } from '../packem_shared/empty-state-DY_oe0k6.js';
11
+ import { I as Input } from '../packem_shared/input-XH4r1Pt1.js';
12
+ import useDebounced from '../packem_shared/useDebounced-Dxncpg6z.js';
13
+ import { useT } from '../packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js';
14
+ import { ADMIN_FUNCTIONS } from '../packem_shared/ADMIN_FUNCTIONS-BHHJi3Gb.js';
15
+ import { f as fireAndForget, c as callOptions, e as errorMessage, a as adminRef } from '../packem_shared/internal-CYcbqMjX.js';
16
+ import { r as recordShard } from '../packem_shared/shard-history-DyebH1R5.js';
17
+ import { c as cn } from '../packem_shared/utils-B05Dmz_H.js';
18
18
  import { Download01Icon } from '@hugeicons/core-free-icons';
19
19
  import { HugeiconsIcon } from '@hugeicons/react';
20
20
  import { Handle, Position, getNodesBounds, getViewportForBounds, useNodesState, useEdgesState, Background, Panel, Controls, MiniMap, ReactFlow, useNodes, useReactFlow } from '@xyflow/react';
21
- import { d as DropdownMenu, D as DropdownMenuTrigger, c as DropdownMenuContent, b as DropdownMenuItem } from './dropdown-menu-WY4B_eJO.js';
21
+ import { d as DropdownMenu, D as DropdownMenuTrigger, c as DropdownMenuContent, b as DropdownMenuItem } from '../packem_shared/dropdown-menu-WY4B_eJO.js';
22
22
  import { jsxDEV } from 'react/jsx-dev-runtime';
23
+ import { LunoraError } from '@lunora/errors';
23
24
  import { toBlob, toSvg } from 'html-to-image';
24
25
  import { useNavigate } from '@tanstack/react-router';
25
- import { L as Label } from './label-D8ykjn5J.js';
26
+ import { L as Label } from '../packem_shared/label-D8ykjn5J.js';
26
27
 
27
28
  function BaseNode(t0) {
28
29
  const $ = c(10);
@@ -340,7 +341,7 @@ const exportDiagramAsPng = async (viewportElement, nodes, filename = "schema-dia
340
341
  width: IMAGE_WIDTH
341
342
  });
342
343
  if (blob === null) {
343
- throw new Error("html-to-image produced no blob");
344
+ throw new LunoraError("INTERNAL", "html-to-image produced no blob");
344
345
  }
345
346
  const url = globalThis.URL.createObjectURL(blob);
346
347
  triggerDownload(url, filename);