@lunora/studio 0.0.0 → 1.0.0-alpha.10

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 (80) hide show
  1. package/LICENSE.md +105 -0
  2. package/README.md +123 -9
  3. package/__assets__/package-og.svg +14 -0
  4. package/dist/index.d.ts +1403 -0
  5. package/dist/index.js +41 -0
  6. package/dist/mount.d.ts +21 -0
  7. package/dist/mount.js +26 -0
  8. package/dist/packem_shared/ADMIN_FUNCTIONS-DjXgvJb6.js +46 -0
  9. package/dist/packem_shared/ApiDocsPanel-yVSGHK3H.js +842 -0
  10. package/dist/packem_shared/ApiReferencePanel-1vubqG5s.js +229 -0
  11. package/dist/packem_shared/ApiTab-rwttyQ1-.js +251 -0
  12. package/dist/packem_shared/AuditPanel-D9Eh7j7E.js +200 -0
  13. package/dist/packem_shared/CommandPalette-BtgkBzZI.js +373 -0
  14. package/dist/packem_shared/ConfirmButton-C2eVi2Qv.js +59 -0
  15. package/dist/packem_shared/ConnectionBadge-B2DDM2Tn.js +111 -0
  16. package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js +50 -0
  17. package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-DjF0h-gA.js +89 -0
  18. package/dist/packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js +27 -0
  19. package/dist/packem_shared/DataBrowser-CyckZRwj.js +4480 -0
  20. package/dist/packem_shared/DataFilters-FNquMaiu.js +249 -0
  21. package/dist/packem_shared/ErrorBoundary-BzAApI7J.js +66 -0
  22. package/dist/packem_shared/ExportImportPanel-BGJqFK9X.js +197 -0
  23. package/dist/packem_shared/FileBrowser-0pCpdKPE.js +2932 -0
  24. package/dist/packem_shared/FunctionRunner-7NH3KcTg.js +343 -0
  25. package/dist/packem_shared/FunctionStatsPanel-CXynSuqT.js +375 -0
  26. package/dist/packem_shared/GlobalDataBrowser-DAxzB-Br.js +289 -0
  27. package/dist/packem_shared/HealthPanel-CyLs7qZm.js +648 -0
  28. package/dist/packem_shared/HomePanel-BOkFRbuj.js +1334 -0
  29. package/dist/packem_shared/InsightsPanel-CvXMoZuv.js +461 -0
  30. package/dist/packem_shared/LogsPanel-BrUstOk6.js +827 -0
  31. package/dist/packem_shared/MailPanel-GnnrNqL6.js +440 -0
  32. package/dist/packem_shared/MetricsPanel-BN_uUU-_.js +1611 -0
  33. package/dist/packem_shared/MigrationsPanel-DaZuUHje.js +239 -0
  34. package/dist/packem_shared/OpenRpcReferencePanel-vbcYbv3V.js +191 -0
  35. package/dist/packem_shared/PitrPanel-LJGNP_IX.js +252 -0
  36. package/dist/packem_shared/STUDIO_ROOT_CLASS-D12gX2dV.js +3 -0
  37. package/dist/packem_shared/ScheduledJobs-UmVaMbJy.js +262 -0
  38. package/dist/packem_shared/SchemaViewer-Bam6ylvw.js +2512 -0
  39. package/dist/packem_shared/SecurityAdvisorPanel-DTmjUNqt.js +92 -0
  40. package/dist/packem_shared/SettingsPanel-C2wDK-8F.js +390 -0
  41. package/dist/packem_shared/ShardInput-gx_DZXXn.js +107 -0
  42. package/dist/packem_shared/SqlEditorPanel-D5wMIxcg.js +13 -0
  43. package/dist/packem_shared/Studio-DpgYe4qt.js +33 -0
  44. package/dist/packem_shared/StudioApp-C7aaizqc.js +657 -0
  45. package/dist/packem_shared/StudioI18nProvider-B-tDCZIi.js +48 -0
  46. package/dist/packem_shared/TableEditor-DzK3Z6rL.js +371 -0
  47. package/dist/packem_shared/advisor-view-CGcfMiPq.js +159 -0
  48. package/dist/packem_shared/aggregateMetrics-D4nUHEKU.js +108 -0
  49. package/dist/packem_shared/app.d-Nbhpihxv.d.ts +300 -0
  50. package/dist/packem_shared/badge-B2PKA1-5.js +49 -0
  51. package/dist/packem_shared/bar-chart-CzJAgqkp.js +3245 -0
  52. package/dist/packem_shared/button-BhsN2uZH.js +49 -0
  53. package/dist/packem_shared/card-DURq3ElK.js +175 -0
  54. package/dist/packem_shared/cf-links-2cktDedA.js +8 -0
  55. package/dist/packem_shared/checkbox-UNkzAxl-.js +63 -0
  56. package/dist/packem_shared/data-grid-B5CaV3wS.js +183 -0
  57. package/dist/packem_shared/dropdown-menu-WY4B_eJO.js +280 -0
  58. package/dist/packem_shared/empty-state-DY_oe0k6.js +98 -0
  59. package/dist/packem_shared/grid-features-CzUfqgsM.js +840 -0
  60. package/dist/packem_shared/input-XH4r1Pt1.js +53 -0
  61. package/dist/packem_shared/internal-rXJEAhXS.js +68 -0
  62. package/dist/packem_shared/label-D8ykjn5J.js +46 -0
  63. package/dist/packem_shared/live-status-FZ0psC1z.js +44 -0
  64. package/dist/packem_shared/reference-view-B4E49Lip.js +2180 -0
  65. package/dist/packem_shared/shard-history-DyebH1R5.js +38 -0
  66. package/dist/packem_shared/sparkline-10dG-_f0.js +93 -0
  67. package/dist/packem_shared/sql-editor-panel-Smfl_FDF.js +2562 -0
  68. package/dist/packem_shared/storage-tier-CL98eOvn.js +85 -0
  69. package/dist/packem_shared/studio-9Mq0PdMi.js +10831 -0
  70. package/dist/packem_shared/table-_RzNvy3R.js +246 -0
  71. package/dist/packem_shared/table-list-sidebar-Bg7uzbvC.js +832 -0
  72. package/dist/packem_shared/textarea-D3gaCU_-.js +46 -0
  73. package/dist/packem_shared/use-admin-query-4JQW2rr1.js +88 -0
  74. package/dist/packem_shared/useDebounced-Dxncpg6z.js +32 -0
  75. package/dist/packem_shared/utils-B05Dmz_H.js +8 -0
  76. package/dist/packem_shared/virtual-rect-CVMUskSm.js +10 -0
  77. package/dist/standalone/studio.js +378 -0
  78. package/dist/styles.css +2 -0
  79. package/package.json +78 -17
  80. package/src/theme.css +59 -0
@@ -0,0 +1,1611 @@
1
+ 'use client';
2
+ import { c } from 'react/compiler-runtime';
3
+ import { useLunora } from '@lunora/react';
4
+ 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 useAdminQuery } from './use-admin-query-4JQW2rr1.js';
11
+ import useDebounced from './useDebounced-Dxncpg6z.js';
12
+ import { useT } from './DEFAULT_LOCALE-CiX4W7Kr.js';
13
+ import { ADMIN_FUNCTIONS } from './ADMIN_FUNCTIONS-DjXgvJb6.js';
14
+ import { c as CLOUDFLARE_DURABLE_OBJECTS_URL } from './cf-links-2cktDedA.js';
15
+ import { d as formatBytes, f as fireAndForget, c as callOptions, e as errorMessage, a as adminRef } from './internal-rXJEAhXS.js';
16
+ import { r as recordShard, l as loadRecentShards } from './shard-history-DyebH1R5.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';
23
+ 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
+ }
288
+
289
+ const performanceLevel = (avgMs) => {
290
+ if (avgMs >= 100) {
291
+ return "critical";
292
+ }
293
+ if (avgMs >= 50) {
294
+ return "warning";
295
+ }
296
+ return "good";
297
+ };
298
+ const formatLatency = (ms) => {
299
+ if (ms < 1) {
300
+ return `${(ms * 1e3).toFixed(0)}μs`;
301
+ }
302
+ if (ms < 1e3) {
303
+ return `${ms.toFixed(1)}ms`;
304
+ }
305
+ return `${(ms / 1e3).toFixed(2)}s`;
306
+ };
307
+ const formatCount = (n) => {
308
+ if (n >= 1e9) {
309
+ return `${(n / 1e9).toFixed(1)}B`;
310
+ }
311
+ if (n >= 1e6) {
312
+ return `${(n / 1e6).toFixed(1)}M`;
313
+ }
314
+ if (n >= 1e3) {
315
+ return `${(n / 1e3).toFixed(1)}K`;
316
+ }
317
+ return n.toLocaleString();
318
+ };
319
+ const PerformanceBadge = (t0) => {
320
+ const $ = c(3);
321
+ const {
322
+ level
323
+ } = t0;
324
+ if (level === "critical") {
325
+ let t12;
326
+ if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
327
+ t12 = /* @__PURE__ */ jsxDEV(Badge, {
328
+ variant: "destructive",
329
+ children: "Slow"
330
+ }, void 0, false);
331
+ $[0] = t12;
332
+ } else {
333
+ t12 = $[0];
334
+ }
335
+ return t12;
336
+ }
337
+ if (level === "warning") {
338
+ let t12;
339
+ if ($[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
340
+ t12 = /* @__PURE__ */ jsxDEV("span", {
341
+ className: "inline-flex items-center gap-1 rounded-md border border-transparent bg-warning/10 px-2 py-0.5 text-xs font-medium text-warning",
342
+ children: "Moderate"
343
+ }, void 0, false);
344
+ $[1] = t12;
345
+ } else {
346
+ t12 = $[1];
347
+ }
348
+ return t12;
349
+ }
350
+ let t1;
351
+ if ($[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
352
+ t1 = /* @__PURE__ */ jsxDEV("span", {
353
+ className: "inline-flex items-center gap-1 rounded-md border border-transparent bg-success/10 px-2 py-0.5 text-xs font-medium text-success",
354
+ children: "Fast"
355
+ }, void 0, false);
356
+ $[2] = t1;
357
+ } else {
358
+ t1 = $[2];
359
+ }
360
+ return t1;
361
+ };
362
+ const QueryInsights = (t0) => {
363
+ const $ = c(152);
364
+ const {
365
+ queryStats
366
+ } = t0;
367
+ const t = useT();
368
+ const [sortField, setSortField] = useState("totalTime");
369
+ let t1;
370
+ if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
371
+ t1 = /* @__PURE__ */ new Set();
372
+ $[0] = t1;
373
+ } else {
374
+ t1 = $[0];
375
+ }
376
+ const [expanded, setExpanded] = useState(t1);
377
+ let t2;
378
+ if ($[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
379
+ t2 = (value) => {
380
+ if (value !== null) {
381
+ setSortField(value);
382
+ }
383
+ };
384
+ $[1] = t2;
385
+ } else {
386
+ t2 = $[1];
387
+ }
388
+ const handleSortChange = t2;
389
+ let copy;
390
+ if ($[2] !== queryStats || $[3] !== sortField) {
391
+ copy = [...queryStats];
392
+ let t310;
393
+ if ($[5] !== sortField) {
394
+ t310 = (a, b) => {
395
+ switch (sortField) {
396
+ case "avgTime": {
397
+ return b.avgDurationMs - a.avgDurationMs;
398
+ }
399
+ case "execCount": {
400
+ return b.execCount - a.execCount;
401
+ }
402
+ case "rowsRead": {
403
+ return b.rowsRead - a.rowsRead;
404
+ }
405
+ default: {
406
+ return b.totalDurationMs - a.totalDurationMs;
407
+ }
408
+ }
409
+ };
410
+ $[5] = sortField;
411
+ $[6] = t310;
412
+ } else {
413
+ t310 = $[6];
414
+ }
415
+ copy.sort(t310);
416
+ $[2] = queryStats;
417
+ $[3] = sortField;
418
+ $[4] = copy;
419
+ } else {
420
+ copy = $[4];
421
+ }
422
+ const sorted = copy;
423
+ let t3;
424
+ if ($[7] !== queryStats) {
425
+ t3 = queryStats.filter(_temp);
426
+ $[7] = queryStats;
427
+ $[8] = t3;
428
+ } else {
429
+ t3 = $[8];
430
+ }
431
+ const critical = t3.length;
432
+ let t4;
433
+ if ($[9] !== queryStats) {
434
+ t4 = queryStats.filter(_temp2);
435
+ $[9] = queryStats;
436
+ $[10] = t4;
437
+ } else {
438
+ t4 = $[10];
439
+ }
440
+ const moderate = t4.length;
441
+ let t5;
442
+ if ($[11] !== queryStats) {
443
+ t5 = queryStats.filter(_temp3);
444
+ $[11] = queryStats;
445
+ $[12] = t5;
446
+ } else {
447
+ t5 = $[12];
448
+ }
449
+ const fast = t5.length;
450
+ let t6;
451
+ if ($[13] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
452
+ t6 = (key) => {
453
+ setExpanded((previous) => {
454
+ const next = new Set(previous);
455
+ if (next.has(key)) {
456
+ next.delete(key);
457
+ } else {
458
+ next.add(key);
459
+ }
460
+ return next;
461
+ });
462
+ };
463
+ $[13] = t6;
464
+ } else {
465
+ t6 = $[13];
466
+ }
467
+ const toggleExpand = t6;
468
+ if (queryStats.length === 0) {
469
+ let t72;
470
+ if ($[14] !== t) {
471
+ t72 = t("No query insights yet");
472
+ $[14] = t;
473
+ $[15] = t72;
474
+ } else {
475
+ t72 = $[15];
476
+ }
477
+ let t82;
478
+ if ($[16] !== t72) {
479
+ t82 = /* @__PURE__ */ jsxDEV("p", {
480
+ className: "text-lg font-medium",
481
+ "data-testid": "qi-empty",
482
+ children: t72
483
+ }, void 0, false);
484
+ $[16] = t72;
485
+ $[17] = t82;
486
+ } else {
487
+ t82 = $[17];
488
+ }
489
+ let t92;
490
+ if ($[18] !== t) {
491
+ t92 = t("Query insights appear once statements are executed against this shard.");
492
+ $[18] = t;
493
+ $[19] = t92;
494
+ } else {
495
+ t92 = $[19];
496
+ }
497
+ let t102;
498
+ if ($[20] !== t92) {
499
+ t102 = /* @__PURE__ */ jsxDEV("p", {
500
+ className: "mt-1 text-sm",
501
+ children: t92
502
+ }, void 0, false);
503
+ $[20] = t92;
504
+ $[21] = t102;
505
+ } else {
506
+ t102 = $[21];
507
+ }
508
+ let t112;
509
+ if ($[22] !== t102 || $[23] !== t82) {
510
+ t112 = /* @__PURE__ */ jsxDEV(Card, {
511
+ children: /* @__PURE__ */ jsxDEV(CardContent, {
512
+ className: "py-12",
513
+ children: /* @__PURE__ */ jsxDEV("div", {
514
+ className: "text-center text-muted-foreground",
515
+ children: [t82, t102]
516
+ }, void 0, true)
517
+ }, void 0, false)
518
+ }, void 0, false);
519
+ $[22] = t102;
520
+ $[23] = t82;
521
+ $[24] = t112;
522
+ } else {
523
+ t112 = $[24];
524
+ }
525
+ return t112;
526
+ }
527
+ let t7;
528
+ if ($[25] !== t) {
529
+ t7 = t("Critical queries");
530
+ $[25] = t;
531
+ $[26] = t7;
532
+ } else {
533
+ t7 = $[26];
534
+ }
535
+ let t8;
536
+ if ($[27] !== t7) {
537
+ t8 = /* @__PURE__ */ jsxDEV(CardHeader, {
538
+ className: "pb-2",
539
+ children: /* @__PURE__ */ jsxDEV(CardTitle, {
540
+ className: "text-sm font-medium",
541
+ children: t7
542
+ }, void 0, false)
543
+ }, void 0, false);
544
+ $[27] = t7;
545
+ $[28] = t8;
546
+ } else {
547
+ t8 = $[28];
548
+ }
549
+ let t9;
550
+ if ($[29] !== critical) {
551
+ t9 = /* @__PURE__ */ jsxDEV("div", {
552
+ className: "text-2xl font-bold text-destructive",
553
+ "data-testid": "qi-critical",
554
+ children: critical
555
+ }, void 0, false);
556
+ $[29] = critical;
557
+ $[30] = t9;
558
+ } else {
559
+ t9 = $[30];
560
+ }
561
+ let t10;
562
+ if ($[31] !== t) {
563
+ t10 = t(">100ms avg execution");
564
+ $[31] = t;
565
+ $[32] = t10;
566
+ } else {
567
+ t10 = $[32];
568
+ }
569
+ let t11;
570
+ if ($[33] !== t10) {
571
+ t11 = /* @__PURE__ */ jsxDEV("p", {
572
+ className: "text-xs text-muted-foreground",
573
+ children: t10
574
+ }, void 0, false);
575
+ $[33] = t10;
576
+ $[34] = t11;
577
+ } else {
578
+ t11 = $[34];
579
+ }
580
+ let t12;
581
+ if ($[35] !== t11 || $[36] !== t9) {
582
+ t12 = /* @__PURE__ */ jsxDEV(CardContent, {
583
+ children: [t9, t11]
584
+ }, void 0, true);
585
+ $[35] = t11;
586
+ $[36] = t9;
587
+ $[37] = t12;
588
+ } else {
589
+ t12 = $[37];
590
+ }
591
+ let t13;
592
+ if ($[38] !== t12 || $[39] !== t8) {
593
+ t13 = /* @__PURE__ */ jsxDEV(Card, {
594
+ children: [t8, t12]
595
+ }, void 0, true);
596
+ $[38] = t12;
597
+ $[39] = t8;
598
+ $[40] = t13;
599
+ } else {
600
+ t13 = $[40];
601
+ }
602
+ let t14;
603
+ if ($[41] !== t) {
604
+ t14 = t("Moderate queries");
605
+ $[41] = t;
606
+ $[42] = t14;
607
+ } else {
608
+ t14 = $[42];
609
+ }
610
+ let t15;
611
+ if ($[43] !== t14) {
612
+ t15 = /* @__PURE__ */ jsxDEV(CardHeader, {
613
+ className: "pb-2",
614
+ children: /* @__PURE__ */ jsxDEV(CardTitle, {
615
+ className: "text-sm font-medium",
616
+ children: t14
617
+ }, void 0, false)
618
+ }, void 0, false);
619
+ $[43] = t14;
620
+ $[44] = t15;
621
+ } else {
622
+ t15 = $[44];
623
+ }
624
+ let t16;
625
+ if ($[45] !== moderate) {
626
+ t16 = /* @__PURE__ */ jsxDEV("div", {
627
+ className: "text-2xl font-bold text-warning",
628
+ "data-testid": "qi-moderate",
629
+ children: moderate
630
+ }, void 0, false);
631
+ $[45] = moderate;
632
+ $[46] = t16;
633
+ } else {
634
+ t16 = $[46];
635
+ }
636
+ let t17;
637
+ if ($[47] !== t) {
638
+ t17 = t("50–100ms avg execution");
639
+ $[47] = t;
640
+ $[48] = t17;
641
+ } else {
642
+ t17 = $[48];
643
+ }
644
+ let t18;
645
+ if ($[49] !== t17) {
646
+ t18 = /* @__PURE__ */ jsxDEV("p", {
647
+ className: "text-xs text-muted-foreground",
648
+ children: t17
649
+ }, void 0, false);
650
+ $[49] = t17;
651
+ $[50] = t18;
652
+ } else {
653
+ t18 = $[50];
654
+ }
655
+ let t19;
656
+ if ($[51] !== t16 || $[52] !== t18) {
657
+ t19 = /* @__PURE__ */ jsxDEV(CardContent, {
658
+ children: [t16, t18]
659
+ }, void 0, true);
660
+ $[51] = t16;
661
+ $[52] = t18;
662
+ $[53] = t19;
663
+ } else {
664
+ t19 = $[53];
665
+ }
666
+ let t20;
667
+ if ($[54] !== t15 || $[55] !== t19) {
668
+ t20 = /* @__PURE__ */ jsxDEV(Card, {
669
+ children: [t15, t19]
670
+ }, void 0, true);
671
+ $[54] = t15;
672
+ $[55] = t19;
673
+ $[56] = t20;
674
+ } else {
675
+ t20 = $[56];
676
+ }
677
+ let t21;
678
+ if ($[57] !== t) {
679
+ t21 = t("Fast queries");
680
+ $[57] = t;
681
+ $[58] = t21;
682
+ } else {
683
+ t21 = $[58];
684
+ }
685
+ let t22;
686
+ if ($[59] !== t21) {
687
+ t22 = /* @__PURE__ */ jsxDEV(CardHeader, {
688
+ className: "pb-2",
689
+ children: /* @__PURE__ */ jsxDEV(CardTitle, {
690
+ className: "text-sm font-medium",
691
+ children: t21
692
+ }, void 0, false)
693
+ }, void 0, false);
694
+ $[59] = t21;
695
+ $[60] = t22;
696
+ } else {
697
+ t22 = $[60];
698
+ }
699
+ let t23;
700
+ if ($[61] !== fast) {
701
+ t23 = /* @__PURE__ */ jsxDEV("div", {
702
+ className: "text-2xl font-bold text-success",
703
+ "data-testid": "qi-fast",
704
+ children: fast
705
+ }, void 0, false);
706
+ $[61] = fast;
707
+ $[62] = t23;
708
+ } else {
709
+ t23 = $[62];
710
+ }
711
+ let t24;
712
+ if ($[63] !== t) {
713
+ t24 = t("<50ms avg execution");
714
+ $[63] = t;
715
+ $[64] = t24;
716
+ } else {
717
+ t24 = $[64];
718
+ }
719
+ let t25;
720
+ if ($[65] !== t24) {
721
+ t25 = /* @__PURE__ */ jsxDEV("p", {
722
+ className: "text-xs text-muted-foreground",
723
+ children: t24
724
+ }, void 0, false);
725
+ $[65] = t24;
726
+ $[66] = t25;
727
+ } else {
728
+ t25 = $[66];
729
+ }
730
+ let t26;
731
+ if ($[67] !== t23 || $[68] !== t25) {
732
+ t26 = /* @__PURE__ */ jsxDEV(CardContent, {
733
+ children: [t23, t25]
734
+ }, void 0, true);
735
+ $[67] = t23;
736
+ $[68] = t25;
737
+ $[69] = t26;
738
+ } else {
739
+ t26 = $[69];
740
+ }
741
+ let t27;
742
+ if ($[70] !== t22 || $[71] !== t26) {
743
+ t27 = /* @__PURE__ */ jsxDEV(Card, {
744
+ children: [t22, t26]
745
+ }, void 0, true);
746
+ $[70] = t22;
747
+ $[71] = t26;
748
+ $[72] = t27;
749
+ } else {
750
+ t27 = $[72];
751
+ }
752
+ let t28;
753
+ if ($[73] !== t13 || $[74] !== t20 || $[75] !== t27) {
754
+ t28 = /* @__PURE__ */ jsxDEV("div", {
755
+ className: "grid gap-4 md:grid-cols-3",
756
+ children: [t13, t20, t27]
757
+ }, void 0, true);
758
+ $[73] = t13;
759
+ $[74] = t20;
760
+ $[75] = t27;
761
+ $[76] = t28;
762
+ } else {
763
+ t28 = $[76];
764
+ }
765
+ let t29;
766
+ if ($[77] !== t) {
767
+ t29 = t("Query leaderboard");
768
+ $[77] = t;
769
+ $[78] = t29;
770
+ } else {
771
+ t29 = $[78];
772
+ }
773
+ let t30;
774
+ if ($[79] !== t29) {
775
+ t30 = /* @__PURE__ */ jsxDEV("h3", {
776
+ className: "text-lg font-semibold",
777
+ children: t29
778
+ }, void 0, false);
779
+ $[79] = t29;
780
+ $[80] = t30;
781
+ } else {
782
+ t30 = $[80];
783
+ }
784
+ let t31;
785
+ if ($[81] !== sortField || $[82] !== t) {
786
+ t31 = t("Slow queries sorted by {sortField}", {
787
+ sortField: t(sortField)
788
+ });
789
+ $[81] = sortField;
790
+ $[82] = t;
791
+ $[83] = t31;
792
+ } else {
793
+ t31 = $[83];
794
+ }
795
+ let t32;
796
+ if ($[84] !== t31) {
797
+ t32 = /* @__PURE__ */ jsxDEV("p", {
798
+ className: "text-sm text-muted-foreground",
799
+ children: t31
800
+ }, void 0, false);
801
+ $[84] = t31;
802
+ $[85] = t32;
803
+ } else {
804
+ t32 = $[85];
805
+ }
806
+ let t33;
807
+ if ($[86] !== t30 || $[87] !== t32) {
808
+ t33 = /* @__PURE__ */ jsxDEV("div", {
809
+ children: [t30, t32]
810
+ }, void 0, true);
811
+ $[86] = t30;
812
+ $[87] = t32;
813
+ $[88] = t33;
814
+ } else {
815
+ t33 = $[88];
816
+ }
817
+ let t34;
818
+ if ($[89] !== t) {
819
+ t34 = t("Sort by");
820
+ $[89] = t;
821
+ $[90] = t34;
822
+ } else {
823
+ t34 = $[90];
824
+ }
825
+ let t35;
826
+ if ($[91] !== t34) {
827
+ t35 = /* @__PURE__ */ jsxDEV("span", {
828
+ className: "text-sm text-muted-foreground",
829
+ children: t34
830
+ }, void 0, false);
831
+ $[91] = t34;
832
+ $[92] = t35;
833
+ } else {
834
+ t35 = $[92];
835
+ }
836
+ let t36;
837
+ if ($[93] !== t) {
838
+ t36 = t("Sort queries by");
839
+ $[93] = t;
840
+ $[94] = t36;
841
+ } else {
842
+ t36 = $[94];
843
+ }
844
+ let t37;
845
+ if ($[95] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
846
+ t37 = /* @__PURE__ */ jsxDEV(SelectValue, {}, void 0, false);
847
+ $[95] = t37;
848
+ } else {
849
+ t37 = $[95];
850
+ }
851
+ let t38;
852
+ if ($[96] !== t36) {
853
+ t38 = /* @__PURE__ */ jsxDEV(SelectTrigger, {
854
+ "aria-label": t36,
855
+ className: "w-[140px]",
856
+ "data-testid": "qi-sort",
857
+ children: t37
858
+ }, void 0, false);
859
+ $[96] = t36;
860
+ $[97] = t38;
861
+ } else {
862
+ t38 = $[97];
863
+ }
864
+ let t39;
865
+ if ($[98] !== t) {
866
+ t39 = t("Total time");
867
+ $[98] = t;
868
+ $[99] = t39;
869
+ } else {
870
+ t39 = $[99];
871
+ }
872
+ let t40;
873
+ if ($[100] !== t39) {
874
+ t40 = /* @__PURE__ */ jsxDEV(SelectItem, {
875
+ value: "totalTime",
876
+ children: t39
877
+ }, void 0, false);
878
+ $[100] = t39;
879
+ $[101] = t40;
880
+ } else {
881
+ t40 = $[101];
882
+ }
883
+ let t41;
884
+ if ($[102] !== t) {
885
+ t41 = t("Avg time");
886
+ $[102] = t;
887
+ $[103] = t41;
888
+ } else {
889
+ t41 = $[103];
890
+ }
891
+ let t42;
892
+ if ($[104] !== t41) {
893
+ t42 = /* @__PURE__ */ jsxDEV(SelectItem, {
894
+ value: "avgTime",
895
+ children: t41
896
+ }, void 0, false);
897
+ $[104] = t41;
898
+ $[105] = t42;
899
+ } else {
900
+ t42 = $[105];
901
+ }
902
+ let t43;
903
+ if ($[106] !== t) {
904
+ t43 = t("Execution count");
905
+ $[106] = t;
906
+ $[107] = t43;
907
+ } else {
908
+ t43 = $[107];
909
+ }
910
+ let t44;
911
+ if ($[108] !== t43) {
912
+ t44 = /* @__PURE__ */ jsxDEV(SelectItem, {
913
+ value: "execCount",
914
+ children: t43
915
+ }, void 0, false);
916
+ $[108] = t43;
917
+ $[109] = t44;
918
+ } else {
919
+ t44 = $[109];
920
+ }
921
+ let t45;
922
+ if ($[110] !== t) {
923
+ t45 = t("Rows read");
924
+ $[110] = t;
925
+ $[111] = t45;
926
+ } else {
927
+ t45 = $[111];
928
+ }
929
+ let t46;
930
+ if ($[112] !== t45) {
931
+ t46 = /* @__PURE__ */ jsxDEV(SelectItem, {
932
+ value: "rowsRead",
933
+ children: t45
934
+ }, void 0, false);
935
+ $[112] = t45;
936
+ $[113] = t46;
937
+ } else {
938
+ t46 = $[113];
939
+ }
940
+ let t47;
941
+ if ($[114] !== t40 || $[115] !== t42 || $[116] !== t44 || $[117] !== t46) {
942
+ t47 = /* @__PURE__ */ jsxDEV(SelectContent, {
943
+ children: [t40, t42, t44, t46]
944
+ }, void 0, true);
945
+ $[114] = t40;
946
+ $[115] = t42;
947
+ $[116] = t44;
948
+ $[117] = t46;
949
+ $[118] = t47;
950
+ } else {
951
+ t47 = $[118];
952
+ }
953
+ let t48;
954
+ if ($[119] !== sortField || $[120] !== t38 || $[121] !== t47) {
955
+ t48 = /* @__PURE__ */ jsxDEV(Select, {
956
+ onValueChange: handleSortChange,
957
+ value: sortField,
958
+ children: [t38, t47]
959
+ }, void 0, true);
960
+ $[119] = sortField;
961
+ $[120] = t38;
962
+ $[121] = t47;
963
+ $[122] = t48;
964
+ } else {
965
+ t48 = $[122];
966
+ }
967
+ let t49;
968
+ if ($[123] !== t35 || $[124] !== t48) {
969
+ t49 = /* @__PURE__ */ jsxDEV("div", {
970
+ className: "flex items-center gap-2",
971
+ children: [t35, t48]
972
+ }, void 0, true);
973
+ $[123] = t35;
974
+ $[124] = t48;
975
+ $[125] = t49;
976
+ } else {
977
+ t49 = $[125];
978
+ }
979
+ let t50;
980
+ if ($[126] !== t33 || $[127] !== t49) {
981
+ t50 = /* @__PURE__ */ jsxDEV("div", {
982
+ className: "flex items-center justify-between",
983
+ children: [t33, t49]
984
+ }, void 0, true);
985
+ $[126] = t33;
986
+ $[127] = t49;
987
+ $[128] = t50;
988
+ } else {
989
+ t50 = $[128];
990
+ }
991
+ let t51;
992
+ if ($[129] !== t) {
993
+ t51 = t("Statements");
994
+ $[129] = t;
995
+ $[130] = t51;
996
+ } else {
997
+ t51 = $[130];
998
+ }
999
+ let t52;
1000
+ if ($[131] !== t51) {
1001
+ t52 = /* @__PURE__ */ jsxDEV(CardTitle, {
1002
+ children: t51
1003
+ }, void 0, false);
1004
+ $[131] = t51;
1005
+ $[132] = t52;
1006
+ } else {
1007
+ t52 = $[132];
1008
+ }
1009
+ let t53;
1010
+ if ($[133] !== sorted.length || $[134] !== t) {
1011
+ t53 = t("{count} tracked statements", {
1012
+ count: sorted.length
1013
+ });
1014
+ $[133] = sorted.length;
1015
+ $[134] = t;
1016
+ $[135] = t53;
1017
+ } else {
1018
+ t53 = $[135];
1019
+ }
1020
+ let t54;
1021
+ if ($[136] !== t53) {
1022
+ t54 = /* @__PURE__ */ jsxDEV(CardDescription, {
1023
+ children: t53
1024
+ }, void 0, false);
1025
+ $[136] = t53;
1026
+ $[137] = t54;
1027
+ } else {
1028
+ t54 = $[137];
1029
+ }
1030
+ let t55;
1031
+ if ($[138] !== t52 || $[139] !== t54) {
1032
+ t55 = /* @__PURE__ */ jsxDEV(CardHeader, {
1033
+ children: [t52, t54]
1034
+ }, void 0, true);
1035
+ $[138] = t52;
1036
+ $[139] = t54;
1037
+ $[140] = t55;
1038
+ } else {
1039
+ t55 = $[140];
1040
+ }
1041
+ let t56;
1042
+ if ($[141] !== expanded || $[142] !== sorted || $[143] !== t) {
1043
+ t56 = /* @__PURE__ */ jsxDEV(CardContent, {
1044
+ children: /* @__PURE__ */ jsxDEV("div", {
1045
+ className: "space-y-2",
1046
+ children: sorted.map((stat) => {
1047
+ const key_0 = stat.normalizedSql;
1048
+ const isExpanded = expanded.has(key_0);
1049
+ const level = performanceLevel(stat.avgDurationMs);
1050
+ return /* @__PURE__ */ jsxDEV("div", {
1051
+ className: "overflow-hidden rounded-lg border",
1052
+ "data-testid": "qi-row",
1053
+ children: [/* @__PURE__ */ jsxDEV("button", {
1054
+ "aria-expanded": isExpanded,
1055
+ className: "flex w-full items-center justify-between p-3 text-left transition-colors hover:bg-muted/50",
1056
+ onClick: () => {
1057
+ toggleExpand(key_0);
1058
+ },
1059
+ type: "button",
1060
+ children: [/* @__PURE__ */ jsxDEV("div", {
1061
+ className: "flex min-w-0 flex-1 items-center gap-3",
1062
+ children: [/* @__PURE__ */ jsxDEV(PerformanceBadge, {
1063
+ level
1064
+ }, void 0, false), /* @__PURE__ */ jsxDEV("span", {
1065
+ className: "max-w-[300px] truncate font-mono text-sm lg:max-w-[500px]",
1066
+ children: stat.normalizedSql
1067
+ }, void 0, false)]
1068
+ }, void 0, true), /* @__PURE__ */ jsxDEV("div", {
1069
+ className: "flex shrink-0 items-center gap-4",
1070
+ children: [/* @__PURE__ */ jsxDEV("div", {
1071
+ className: "text-right",
1072
+ children: [/* @__PURE__ */ jsxDEV("div", {
1073
+ className: "text-sm font-medium",
1074
+ children: formatLatency(stat.totalDurationMs)
1075
+ }, void 0, false), /* @__PURE__ */ jsxDEV("div", {
1076
+ className: "text-xs text-muted-foreground",
1077
+ children: t("total")
1078
+ }, void 0, false)]
1079
+ }, void 0, true), /* @__PURE__ */ jsxDEV("div", {
1080
+ className: "text-right",
1081
+ children: [/* @__PURE__ */ jsxDEV("div", {
1082
+ className: "text-sm font-medium",
1083
+ children: formatLatency(stat.avgDurationMs)
1084
+ }, void 0, false), /* @__PURE__ */ jsxDEV("div", {
1085
+ className: "text-xs text-muted-foreground",
1086
+ children: t("avg")
1087
+ }, void 0, false)]
1088
+ }, void 0, true), /* @__PURE__ */ jsxDEV("div", {
1089
+ className: "text-right",
1090
+ children: [/* @__PURE__ */ jsxDEV("div", {
1091
+ className: "text-sm font-medium",
1092
+ children: formatCount(stat.execCount)
1093
+ }, void 0, false), /* @__PURE__ */ jsxDEV("div", {
1094
+ className: "text-xs text-muted-foreground",
1095
+ children: t("calls")
1096
+ }, void 0, false)]
1097
+ }, void 0, true)]
1098
+ }, void 0, true)]
1099
+ }, void 0, true), isExpanded && /* @__PURE__ */ jsxDEV("div", {
1100
+ className: "space-y-3 border-t bg-muted/30 p-4",
1101
+ children: [/* @__PURE__ */ jsxDEV("div", {
1102
+ children: [/* @__PURE__ */ jsxDEV("p", {
1103
+ className: "mb-2 text-sm font-medium",
1104
+ children: t("Full statement")
1105
+ }, void 0, false), /* @__PURE__ */ jsxDEV("pre", {
1106
+ className: "overflow-x-auto rounded-md bg-muted p-3 font-mono text-sm whitespace-pre-wrap break-all",
1107
+ children: stat.normalizedSql
1108
+ }, void 0, false)]
1109
+ }, void 0, true), /* @__PURE__ */ jsxDEV("div", {
1110
+ className: "grid grid-cols-2 gap-4 text-sm md:grid-cols-4",
1111
+ children: [/* @__PURE__ */ jsxDEV("div", {
1112
+ children: [/* @__PURE__ */ jsxDEV("span", {
1113
+ className: "text-muted-foreground",
1114
+ children: t("Exec count")
1115
+ }, void 0, false), /* @__PURE__ */ jsxDEV("span", {
1116
+ className: "block font-medium tabular-nums",
1117
+ children: formatCount(stat.execCount)
1118
+ }, void 0, false)]
1119
+ }, void 0, true), /* @__PURE__ */ jsxDEV("div", {
1120
+ children: [/* @__PURE__ */ jsxDEV("span", {
1121
+ className: "text-muted-foreground",
1122
+ children: t("Total time")
1123
+ }, void 0, false), /* @__PURE__ */ jsxDEV("span", {
1124
+ className: "block font-medium tabular-nums",
1125
+ children: formatLatency(stat.totalDurationMs)
1126
+ }, void 0, false)]
1127
+ }, void 0, true), /* @__PURE__ */ jsxDEV("div", {
1128
+ children: [/* @__PURE__ */ jsxDEV("span", {
1129
+ className: "text-muted-foreground",
1130
+ children: t("Rows read")
1131
+ }, void 0, false), /* @__PURE__ */ jsxDEV("span", {
1132
+ className: "block font-medium tabular-nums",
1133
+ children: formatCount(stat.rowsRead)
1134
+ }, void 0, false)]
1135
+ }, void 0, true), /* @__PURE__ */ jsxDEV("div", {
1136
+ children: [/* @__PURE__ */ jsxDEV("span", {
1137
+ className: "text-muted-foreground",
1138
+ children: t("Rows written")
1139
+ }, void 0, false), /* @__PURE__ */ jsxDEV("span", {
1140
+ className: "block font-medium tabular-nums",
1141
+ children: formatCount(stat.rowsWritten)
1142
+ }, void 0, false)]
1143
+ }, void 0, true)]
1144
+ }, void 0, true)]
1145
+ }, void 0, true)]
1146
+ }, key_0, true);
1147
+ })
1148
+ }, void 0, false)
1149
+ }, void 0, false);
1150
+ $[141] = expanded;
1151
+ $[142] = sorted;
1152
+ $[143] = t;
1153
+ $[144] = t56;
1154
+ } else {
1155
+ t56 = $[144];
1156
+ }
1157
+ let t57;
1158
+ if ($[145] !== t55 || $[146] !== t56) {
1159
+ t57 = /* @__PURE__ */ jsxDEV(Card, {
1160
+ children: [t55, t56]
1161
+ }, void 0, true);
1162
+ $[145] = t55;
1163
+ $[146] = t56;
1164
+ $[147] = t57;
1165
+ } else {
1166
+ t57 = $[147];
1167
+ }
1168
+ let t58;
1169
+ if ($[148] !== t28 || $[149] !== t50 || $[150] !== t57) {
1170
+ t58 = /* @__PURE__ */ jsxDEV("div", {
1171
+ className: "space-y-4",
1172
+ "data-testid": "qi-root",
1173
+ children: [t28, t50, t57]
1174
+ }, void 0, true);
1175
+ $[148] = t28;
1176
+ $[149] = t50;
1177
+ $[150] = t57;
1178
+ $[151] = t58;
1179
+ } else {
1180
+ t58 = $[151];
1181
+ }
1182
+ return t58;
1183
+ };
1184
+ function _temp(q) {
1185
+ return performanceLevel(q.avgDurationMs) === "critical";
1186
+ }
1187
+ function _temp2(q_0) {
1188
+ return performanceLevel(q_0.avgDurationMs) === "warning";
1189
+ }
1190
+ function _temp3(q_1) {
1191
+ return performanceLevel(q_1.avgDurationMs) === "good";
1192
+ }
1193
+
1194
+ const GET_METRICS = adminRef(ADMIN_FUNCTIONS.getMetrics);
1195
+ const formatDuration = (ms) => {
1196
+ const totalSeconds = Math.floor(ms / 1e3);
1197
+ const hours = Math.floor(totalSeconds / 3600);
1198
+ const minutes = Math.floor(totalSeconds % 3600 / 60);
1199
+ const seconds = totalSeconds % 60;
1200
+ if (hours > 0) {
1201
+ return `${hours.toString()}h ${minutes.toString()}m`;
1202
+ }
1203
+ if (minutes > 0) {
1204
+ return `${minutes.toString()}m ${seconds.toString()}s`;
1205
+ }
1206
+ return `${seconds.toString()}s`;
1207
+ };
1208
+ const resolveTab = (hasQueryStats, activeTab) => hasQueryStats ? activeTab : "overview";
1209
+ const hitRate = (hits, misses) => {
1210
+ const total = hits + misses;
1211
+ return total === 0 ? "—" : `${(hits / total * 100).toFixed(1)}%`;
1212
+ };
1213
+ const StatCard = (t0) => {
1214
+ const $ = c(16);
1215
+ const {
1216
+ chart,
1217
+ footer,
1218
+ label,
1219
+ testId,
1220
+ value
1221
+ } = t0;
1222
+ let t1;
1223
+ if ($[0] !== label) {
1224
+ t1 = /* @__PURE__ */ jsxDEV("span", {
1225
+ className: "font-mono text-[11px] tracking-wide text-muted-foreground uppercase",
1226
+ children: label
1227
+ }, void 0, false);
1228
+ $[0] = label;
1229
+ $[1] = t1;
1230
+ } else {
1231
+ t1 = $[1];
1232
+ }
1233
+ let t2;
1234
+ if ($[2] !== testId || $[3] !== value) {
1235
+ t2 = /* @__PURE__ */ jsxDEV("span", {
1236
+ className: "truncate text-2xl font-semibold tabular-nums text-foreground",
1237
+ "data-testid": testId,
1238
+ children: value
1239
+ }, void 0, false);
1240
+ $[2] = testId;
1241
+ $[3] = value;
1242
+ $[4] = t2;
1243
+ } else {
1244
+ t2 = $[4];
1245
+ }
1246
+ let t3;
1247
+ if ($[5] !== chart || $[6] !== t2) {
1248
+ t3 = /* @__PURE__ */ jsxDEV("div", {
1249
+ className: "flex items-center justify-between gap-3",
1250
+ children: [t2, chart]
1251
+ }, void 0, true);
1252
+ $[5] = chart;
1253
+ $[6] = t2;
1254
+ $[7] = t3;
1255
+ } else {
1256
+ t3 = $[7];
1257
+ }
1258
+ let t4;
1259
+ if ($[8] !== t1 || $[9] !== t3) {
1260
+ t4 = /* @__PURE__ */ jsxDEV("div", {
1261
+ className: "flex flex-col gap-2.5 p-4",
1262
+ children: [t1, t3]
1263
+ }, void 0, true);
1264
+ $[8] = t1;
1265
+ $[9] = t3;
1266
+ $[10] = t4;
1267
+ } else {
1268
+ t4 = $[10];
1269
+ }
1270
+ let t5;
1271
+ if ($[11] !== footer) {
1272
+ t5 = footer != null && /* @__PURE__ */ jsxDEV("div", {
1273
+ className: "border-t border-border bg-muted/50 px-4 py-2.5 text-[11px] text-muted-foreground",
1274
+ children: footer
1275
+ }, void 0, false);
1276
+ $[11] = footer;
1277
+ $[12] = t5;
1278
+ } else {
1279
+ t5 = $[12];
1280
+ }
1281
+ let t6;
1282
+ if ($[13] !== t4 || $[14] !== t5) {
1283
+ t6 = /* @__PURE__ */ jsxDEV(Card, {
1284
+ className: "justify-between gap-0 py-0",
1285
+ children: [t4, t5]
1286
+ }, void 0, true);
1287
+ $[13] = t4;
1288
+ $[14] = t5;
1289
+ $[15] = t6;
1290
+ } else {
1291
+ t6 = $[15];
1292
+ }
1293
+ return t6;
1294
+ };
1295
+ const MetricsPanel = ({
1296
+ initialShardKey
1297
+ }) => {
1298
+ const client = useLunora();
1299
+ const t = useT();
1300
+ const [shardKey, setShardKey] = useState(initialShardKey ?? "");
1301
+ const [activeTab, setActiveTab] = useState("overview");
1302
+ const [history, setHistory] = useState([]);
1303
+ const lastRequestsRef = useRef(null);
1304
+ const lastShardRef = useRef(null);
1305
+ const mountedRef = useRef(true);
1306
+ useEffect(() => {
1307
+ mountedRef.current = true;
1308
+ return () => {
1309
+ mountedRef.current = false;
1310
+ };
1311
+ }, []);
1312
+ const debouncedShard = useDebounced(shardKey.trim(), 400);
1313
+ const {
1314
+ data,
1315
+ error,
1316
+ liveError
1317
+ } = useAdminQuery(ADMIN_FUNCTIONS.getMetrics, {}, {
1318
+ live: true,
1319
+ shardKey: debouncedShard
1320
+ });
1321
+ const metrics = data ?? null;
1322
+ useEffect(() => {
1323
+ if (data === void 0) {
1324
+ return;
1325
+ }
1326
+ recordShard(debouncedShard);
1327
+ const next = data;
1328
+ const previous = lastRequestsRef.current;
1329
+ const shardChanged = lastShardRef.current !== null && lastShardRef.current !== next.shard;
1330
+ lastShardRef.current = next.shard;
1331
+ lastRequestsRef.current = next.requests;
1332
+ if (shardChanged) {
1333
+ setHistory([]);
1334
+ return;
1335
+ }
1336
+ if (previous !== null && next.requests >= previous) {
1337
+ setHistory((prior) => [...prior, next.requests - previous].slice(-30));
1338
+ }
1339
+ }, [data, debouncedShard]);
1340
+ const [shardResults, setShardResults] = useState(null);
1341
+ const [aggregating, setAggregating] = useState(false);
1342
+ const aggregateAll = async () => {
1343
+ setAggregating(true);
1344
+ const shards = shardsToAggregate(shardKey, loadRecentShards());
1345
+ try {
1346
+ const results = await Promise.all(shards.map(async (shard) => {
1347
+ try {
1348
+ const snapshot = await client.query(GET_METRICS, {}, callOptions(shard));
1349
+ return {
1350
+ error: null,
1351
+ metrics: snapshot,
1352
+ shard: shard === "" ? snapshot.shard : shard
1353
+ };
1354
+ } catch (error_) {
1355
+ return {
1356
+ error: errorMessage(error_),
1357
+ metrics: null,
1358
+ shard: shard === "" ? "__root__" : shard
1359
+ };
1360
+ }
1361
+ }));
1362
+ if (mountedRef.current) {
1363
+ setShardResults(results);
1364
+ }
1365
+ } finally {
1366
+ if (mountedRef.current) {
1367
+ setAggregating(false);
1368
+ }
1369
+ }
1370
+ };
1371
+ const aggregate = shardResults === null ? null : aggregateMetrics(shardResults);
1372
+ const errorRate = metrics === null || metrics.requests === 0 ? "—" : `${(metrics.errors / metrics.requests * 100).toFixed(1)}%`;
1373
+ const currentDelta = history.length > 0 ? history.at(-1) : 0;
1374
+ const latencyPercentiles = metrics ? computeLatencyPercentiles(metrics) : {
1375
+ p90: 0,
1376
+ p95: 0
1377
+ };
1378
+ const formatMs = (ms) => {
1379
+ if (ms <= 0) {
1380
+ return "—";
1381
+ }
1382
+ if (ms < 1) {
1383
+ return `${(ms * 1e3).toFixed(0)}μs`;
1384
+ }
1385
+ if (ms < 1e3) {
1386
+ return `${ms.toFixed(1)}ms`;
1387
+ }
1388
+ return `${(ms / 1e3).toFixed(2)}s`;
1389
+ };
1390
+ const queryStats = useMemo(() => {
1391
+ if (!metrics || !("queryStats" in metrics)) {
1392
+ return void 0;
1393
+ }
1394
+ const snapQs = metrics.queryStats;
1395
+ if (!snapQs || !Array.isArray(snapQs)) {
1396
+ return void 0;
1397
+ }
1398
+ return enrichQueryStats(snapQs);
1399
+ }, [metrics]);
1400
+ const effectiveTab = resolveTab(queryStats !== void 0, activeTab);
1401
+ const runAggregate = () => {
1402
+ fireAndForget(aggregateAll());
1403
+ };
1404
+ const clearAggregate = () => {
1405
+ setShardResults(null);
1406
+ };
1407
+ const switchToOverview = () => {
1408
+ setActiveTab("overview");
1409
+ };
1410
+ const switchToQueryInsights = () => {
1411
+ setActiveTab("query-insights");
1412
+ };
1413
+ return /* @__PURE__ */ jsxDEV("div", {
1414
+ className: "flex flex-col gap-4",
1415
+ "data-testid": "lunora-metrics",
1416
+ children: [/* @__PURE__ */ jsxDEV("div", {
1417
+ className: "flex flex-wrap items-center gap-2",
1418
+ children: [/* @__PURE__ */ jsxDEV(ShardInput, {
1419
+ onChange: setShardKey,
1420
+ testId: "mt-shard-input",
1421
+ value: shardKey
1422
+ }, void 0, false), /* @__PURE__ */ jsxDEV(LiveError, {
1423
+ message: liveError,
1424
+ prefix: "mt"
1425
+ }, void 0, false), /* @__PURE__ */ jsxDEV(Button, {
1426
+ "data-testid": "mt-aggregate",
1427
+ disabled: aggregating,
1428
+ onClick: runAggregate,
1429
+ size: "sm",
1430
+ type: "button",
1431
+ variant: "secondary",
1432
+ children: aggregating ? t("Aggregating…") : t("All shards")
1433
+ }, void 0, false), shardResults !== null && /* @__PURE__ */ jsxDEV(Button, {
1434
+ "data-testid": "mt-aggregate-clear",
1435
+ onClick: clearAggregate,
1436
+ size: "sm",
1437
+ type: "button",
1438
+ variant: "ghost",
1439
+ children: t("Hide")
1440
+ }, void 0, false), /* @__PURE__ */ jsxDEV("a", {
1441
+ className: "text-sm text-primary underline-offset-4 hover:underline",
1442
+ "data-testid": "mt-cf-link",
1443
+ href: CLOUDFLARE_DURABLE_OBJECTS_URL,
1444
+ rel: "noreferrer",
1445
+ target: "_blank",
1446
+ children: t("Open in Cloudflare")
1447
+ }, void 0, false)]
1448
+ }, void 0, true), error !== null && /* @__PURE__ */ jsxDEV("p", {
1449
+ className: "text-sm text-destructive",
1450
+ "data-testid": "mt-error",
1451
+ role: "alert",
1452
+ children: error
1453
+ }, void 0, false), queryStats !== void 0 && /* @__PURE__ */ jsxDEV("div", {
1454
+ className: "flex gap-2 border-b",
1455
+ "data-testid": "mt-tabs",
1456
+ children: [/* @__PURE__ */ jsxDEV("button", {
1457
+ className: `pb-2 text-sm font-medium transition-colors ${effectiveTab === "overview" ? "border-b-2 border-primary text-foreground" : "text-muted-foreground hover:text-foreground"}`,
1458
+ "data-testid": "mt-tab-overview",
1459
+ onClick: switchToOverview,
1460
+ type: "button",
1461
+ children: t("Overview")
1462
+ }, void 0, false), /* @__PURE__ */ jsxDEV("button", {
1463
+ 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"}`,
1464
+ "data-testid": "mt-tab-query-insights",
1465
+ onClick: switchToQueryInsights,
1466
+ type: "button",
1467
+ children: [t("Query insights"), queryStats.length > 0 && /* @__PURE__ */ jsxDEV("span", {
1468
+ className: "ml-1.5 rounded-full bg-primary/10 px-1.5 py-0.5 text-xs text-primary",
1469
+ children: queryStats.length
1470
+ }, void 0, false)]
1471
+ }, void 0, true)]
1472
+ }, void 0, true), effectiveTab === "query-insights" && queryStats !== void 0 && /* @__PURE__ */ jsxDEV(QueryInsights, {
1473
+ queryStats
1474
+ }, void 0, false), effectiveTab === "overview" && metrics !== null && /* @__PURE__ */ jsxDEV("dl", {
1475
+ className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",
1476
+ "data-testid": "mt-stats",
1477
+ children: [/* @__PURE__ */ jsxDEV(StatCard, {
1478
+ chart: history.length >= 2 ? /* @__PURE__ */ jsxDEV(Sparkline, {
1479
+ ariaLabel: t("Requests per interval over time"),
1480
+ className: "h-7 w-24 text-foreground",
1481
+ series: history,
1482
+ testId: "mt-sparkline"
1483
+ }, void 0, false) : void 0,
1484
+ footer: history.length >= 2 ? /* @__PURE__ */ jsxDEV(Fragment, {
1485
+ children: [/* @__PURE__ */ jsxDEV("span", {
1486
+ className: "font-semibold text-foreground",
1487
+ children: `+${currentDelta.toLocaleString()}`
1488
+ }, void 0, false), " ", t("last interval")]
1489
+ }, void 0, true) : /* @__PURE__ */ jsxDEV("span", {
1490
+ "data-testid": "mt-sparkline-empty",
1491
+ children: t("collecting samples…")
1492
+ }, void 0, false),
1493
+ label: t("Requests"),
1494
+ testId: "mt-requests",
1495
+ value: metrics.requests
1496
+ }, void 0, false), /* @__PURE__ */ jsxDEV(StatCard, {
1497
+ footer: t("{rate} error rate", {
1498
+ rate: errorRate
1499
+ }),
1500
+ label: t("Errors"),
1501
+ testId: "mt-errors",
1502
+ value: /* @__PURE__ */ jsxDEV(Fragment, {
1503
+ children: [metrics.errors, " (", errorRate, ")"]
1504
+ }, void 0, true)
1505
+ }, void 0, false), /* @__PURE__ */ jsxDEV(StatCard, {
1506
+ footer: latencyPercentiles.p90 > 0 ? `P90 ${formatMs(latencyPercentiles.p90)}` : void 0,
1507
+ label: t("P95 latency"),
1508
+ testId: "mt-p95",
1509
+ value: latencyPercentiles.p95 > 0 ? formatMs(latencyPercentiles.p95) : "—"
1510
+ }, void 0, false), /* @__PURE__ */ jsxDEV(StatCard, {
1511
+ footer: metrics.cache === null ? void 0 : `${metrics.cache.entries.toLocaleString()} ${t("cache entries")}`,
1512
+ label: t("Database size"),
1513
+ testId: "mt-db-size",
1514
+ value: formatBytes(metrics.databaseSize)
1515
+ }, void 0, false), /* @__PURE__ */ jsxDEV(StatCard, {
1516
+ label: t("Shard"),
1517
+ testId: "mt-shard",
1518
+ value: metrics.shard
1519
+ }, void 0, false), /* @__PURE__ */ jsxDEV(StatCard, {
1520
+ label: t("Uptime"),
1521
+ testId: "mt-uptime",
1522
+ value: formatDuration(metrics.uptimeMs)
1523
+ }, void 0, false), /* @__PURE__ */ jsxDEV(StatCard, {
1524
+ label: t("Cache hit rate"),
1525
+ testId: "mt-cache",
1526
+ value: metrics.cache === null ? t("no cache configured") : t("{rate} ({count} entries)", {
1527
+ count: metrics.cache.entries,
1528
+ rate: hitRate(metrics.cache.hits, metrics.cache.misses)
1529
+ })
1530
+ }, void 0, false)]
1531
+ }, void 0, true), effectiveTab === "overview" && metrics === null && null, effectiveTab === "overview" && aggregate !== null && shardResults !== null && /* @__PURE__ */ jsxDEV("div", {
1532
+ className: "flex flex-col gap-4",
1533
+ "data-testid": "mt-aggregate-view",
1534
+ children: [/* @__PURE__ */ jsxDEV("dl", {
1535
+ className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-3",
1536
+ "data-testid": "mt-aggregate-stats",
1537
+ children: [/* @__PURE__ */ jsxDEV(StatCard, {
1538
+ label: t("Shards"),
1539
+ testId: "mt-agg-shards",
1540
+ value: aggregate.failed > 0 ? t("{reachable} reachable, {failed} unreachable", {
1541
+ failed: aggregate.failed,
1542
+ reachable: aggregate.reachable
1543
+ }) : t("{reachable} reachable", {
1544
+ reachable: aggregate.reachable
1545
+ })
1546
+ }, void 0, false), /* @__PURE__ */ jsxDEV(StatCard, {
1547
+ label: t("Total requests"),
1548
+ testId: "mt-agg-requests",
1549
+ value: aggregate.totalRequests
1550
+ }, void 0, false), /* @__PURE__ */ jsxDEV(StatCard, {
1551
+ label: t("Total errors"),
1552
+ testId: "mt-agg-errors",
1553
+ value: aggregate.totalErrors
1554
+ }, void 0, false), /* @__PURE__ */ jsxDEV(StatCard, {
1555
+ label: t("Total database size"),
1556
+ testId: "mt-agg-db-size",
1557
+ value: formatBytes(aggregate.totalDatabaseSize)
1558
+ }, void 0, false), /* @__PURE__ */ jsxDEV(StatCard, {
1559
+ label: t("Combined cache hit rate"),
1560
+ testId: "mt-agg-cache",
1561
+ value: aggregate.hitRate === null ? t("no cache configured") : `${(aggregate.hitRate * 100).toFixed(1)}%`
1562
+ }, void 0, false)]
1563
+ }, void 0, true), /* @__PURE__ */ jsxDEV(Card, {
1564
+ className: "overflow-hidden py-0",
1565
+ children: /* @__PURE__ */ jsxDEV(CardContent, {
1566
+ className: "px-0",
1567
+ children: /* @__PURE__ */ jsxDEV(Table, {
1568
+ "data-testid": "mt-agg-table",
1569
+ children: [/* @__PURE__ */ jsxDEV(TableHeader, {
1570
+ children: /* @__PURE__ */ jsxDEV(TableRow, {
1571
+ children: [/* @__PURE__ */ jsxDEV(TableHead, {
1572
+ children: t("shard")
1573
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
1574
+ children: t("requests")
1575
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
1576
+ children: t("errors")
1577
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
1578
+ children: t("db size")
1579
+ }, void 0, false)]
1580
+ }, void 0, true)
1581
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableBody, {
1582
+ children: shardResults.map((result) => /* @__PURE__ */ jsxDEV(TableRow, {
1583
+ "data-testid": `mt-agg-row-${result.shard}`,
1584
+ children: [/* @__PURE__ */ jsxDEV(TableCell, {
1585
+ children: result.shard
1586
+ }, void 0, false), result.metrics === null ? /* @__PURE__ */ jsxDEV(TableCell, {
1587
+ className: "text-destructive",
1588
+ colSpan: 3,
1589
+ children: result.error ?? t("unreachable")
1590
+ }, void 0, false) : /* @__PURE__ */ jsxDEV(Fragment, {
1591
+ children: [/* @__PURE__ */ jsxDEV(TableCell, {
1592
+ className: "tabular-nums",
1593
+ children: result.metrics.requests
1594
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
1595
+ className: "tabular-nums",
1596
+ children: result.metrics.errors
1597
+ }, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
1598
+ className: "tabular-nums",
1599
+ children: formatBytes(result.metrics.databaseSize)
1600
+ }, void 0, false)]
1601
+ }, void 0, true)]
1602
+ }, result.shard, true))
1603
+ }, void 0, false)]
1604
+ }, void 0, true)
1605
+ }, void 0, false)
1606
+ }, void 0, false)]
1607
+ }, void 0, true)]
1608
+ }, void 0, true);
1609
+ };
1610
+
1611
+ export { MetricsPanel };