react-semaphor 0.1.397 → 0.1.399

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 (51) hide show
  1. package/dist/analytics-protocol/index.cjs +1 -1
  2. package/dist/analytics-protocol/index.js +2 -2
  3. package/dist/brand-studio/index.cjs +1 -1
  4. package/dist/brand-studio/index.js +2 -2
  5. package/dist/chunks/analyze-result-contract-CUO5QmqV.js +1797 -0
  6. package/dist/chunks/analyze-result-contract-OqFtOCpZ.js +1 -0
  7. package/dist/chunks/{calendar-preferences-dialog-49fcEPXS.js → calendar-preferences-dialog-9SvYDLp6.js} +3 -3
  8. package/dist/chunks/{calendar-preferences-dialog-DwLeBLy2.js → calendar-preferences-dialog-B3fnFtJt.js} +1 -1
  9. package/dist/chunks/{dashboard-briefing-launcher-cgPKz1yX.js → dashboard-briefing-launcher-APVyc9al.js} +4 -4
  10. package/dist/chunks/{dashboard-briefing-launcher-CgkSKkZR.js → dashboard-briefing-launcher-D3R4R7ww.js} +1 -1
  11. package/dist/chunks/{dashboard-controls-VMFm3OP4.js → dashboard-controls-CHDQlMZ9.js} +5 -5
  12. package/dist/chunks/{dashboard-controls-D12ZSUP_.js → dashboard-controls-v7jslCXR.js} +1 -1
  13. package/dist/chunks/{dashboard-json-C-GG5yC7.js → dashboard-json-DF_syvRu.js} +3 -3
  14. package/dist/chunks/{dashboard-json-CvK0oI24.js → dashboard-json-L1Qo5xcX.js} +1 -1
  15. package/dist/chunks/{edit-dashboard-visual-B5KB7dx4.js → edit-dashboard-visual-DwfIWUe-.js} +4 -4
  16. package/dist/chunks/{edit-dashboard-visual-ql99faTz.js → edit-dashboard-visual-qdruQruO.js} +1 -1
  17. package/dist/chunks/{index-CQmKDEbe.js → index-BdVymLVq.js} +5 -5
  18. package/dist/chunks/{index-DXCBPLDu.js → index-DH7hOGQl.js} +2 -2
  19. package/dist/chunks/{switch-BXQAlSuW.js → switch-BiU6-YSY.js} +1 -1
  20. package/dist/chunks/{switch-B79Hn4Qh.js → switch-CYG3dY8r.js} +1 -1
  21. package/dist/chunks/{use-create-flow-overlay-state-Bw5LRkf9.js → use-create-flow-overlay-state-CwUkhLBL.js} +3 -3
  22. package/dist/chunks/{use-create-flow-overlay-state-7MFN3PWX.js → use-create-flow-overlay-state-qe7DHQKr.js} +1 -1
  23. package/dist/chunks/{validators-4EGCWWga.js → validators-B1Mgdr3T.js} +279 -242
  24. package/dist/chunks/{validators-CPtkrola.js → validators-DFOX0tYY.js} +1 -1
  25. package/dist/dashboard/index.cjs +1 -1
  26. package/dist/dashboard/index.js +1 -1
  27. package/dist/dashboard-authoring/index.cjs +1 -1
  28. package/dist/dashboard-authoring/index.js +2 -2
  29. package/dist/data-app-builder/index.cjs +1 -1
  30. package/dist/data-app-builder/index.js +2 -2
  31. package/dist/data-app-sdk/index.cjs +20 -5
  32. package/dist/data-app-sdk/index.js +1182 -1085
  33. package/dist/data-app-sdk-adapters/index.cjs +1 -1
  34. package/dist/data-app-sdk-adapters/index.js +20 -12
  35. package/dist/data-app-sdk-validation/index.cjs +1 -1
  36. package/dist/data-app-sdk-validation/index.js +2 -2
  37. package/dist/index.cjs +1 -1
  38. package/dist/index.js +7 -7
  39. package/dist/surfboard/index.cjs +1 -1
  40. package/dist/surfboard/index.js +2 -2
  41. package/dist/types/analytics-protocol.d.ts +101 -2
  42. package/dist/types/dashboard-assistant.d.ts +14 -0
  43. package/dist/types/dashboard-authoring.d.ts +6 -0
  44. package/dist/types/data-app-builder.d.ts +6 -0
  45. package/dist/types/data-app-sdk-adapters.d.ts +7 -0
  46. package/dist/types/data-app-sdk-validation.d.ts +15 -0
  47. package/dist/types/data-app-sdk.d.ts +18 -0
  48. package/dist/types/main.d.ts +6 -0
  49. package/package.json +1 -1
  50. package/dist/chunks/analyze-result-contract-C9Gv2_qW.js +0 -1585
  51. package/dist/chunks/analyze-result-contract-Zgg-Bbpj.js +0 -1
@@ -1,25 +1,25 @@
1
- import { toSemaphorInputSnapshots as zr, toSemaphorInputBinding as Fr, toSemaphorActiveInputSnapshots as re, toSemaphorMatrixIntent as Mr, toSemaphorSqlIntent as jr, toSemaphorInputOptionsIntent as Hr, toSemaphorRecordsIntent as Vr, toSemaphorAnalysisQueryOptions as Qr, toSemaphorAnalysisIntent as Ur, toSemaphorMetricIntent as Gr, hasSemaphorInputValue as fe, normalizeSemaphorInputOptions as mr, toSemaphorInputSpec as yr } from "../data-app-sdk-adapters/index.js";
2
- import { jsxs as p, Fragment as hr, jsx as s } from "react/jsx-runtime";
3
- import { createContext as qe, useContext as G, useState as M, useRef as L, useEffect as W, useMemo as I, Fragment as Jr, useId as br, useCallback as $, useReducer as Yr } from "react";
4
- import { a as Xr, m as Zr } from "../chunks/source-identity-y0VSSreA.js";
5
- import "../chunks/analyze-result-contract-C9Gv2_qW.js";
6
- import { M as et, a as rt, S as tt, E as nt, C as it } from "../chunks/search-BHsQIWBV.js";
7
- import { X as ot, C as st, j as at } from "../chunks/x-CXDkqdur.js";
8
- import { b as lt } from "../chunks/validators-4EGCWWga.js";
9
- function ye(e, r, t = {}) {
1
+ import { toSemaphorInputSnapshots as Pr, toSemaphorInputBinding as zr, toSemaphorActiveInputSnapshots as X, toSemaphorMatrixIntent as Fr, toSemaphorSqlIntent as Mr, toSemaphorInputOptionsIntent as jr, toSemaphorRecordsIntent as Hr, toSemaphorAnalysisQueryOptions as Vr, toSemaphorAnalysisIntent as Qr, toSemaphorMetricIntent as Ur, hasSemaphorInputValue as ue, normalizeSemaphorInputOptions as gr, toSemaphorInputSpec as mr } from "../data-app-sdk-adapters/index.js";
2
+ import { jsxs as p, Fragment as yr, jsx as a } from "react/jsx-runtime";
3
+ import { createContext as Ie, useContext as Q, useState as F, useRef as E, useEffect as B, useMemo as I, Fragment as Gr, useId as hr, useCallback as O, useReducer as Jr } from "react";
4
+ import { a as Yr, m as Xr } from "../chunks/source-identity-y0VSSreA.js";
5
+ import "../chunks/analyze-result-contract-CUO5QmqV.js";
6
+ import { M as Zr, a as et, S as rt, E as tt, C as nt } from "../chunks/search-BHsQIWBV.js";
7
+ import { X as it, C as ot, j as st } from "../chunks/x-CXDkqdur.js";
8
+ import { b as at } from "../chunks/validators-B1Mgdr3T.js";
9
+ function me(e, r, t = {}) {
10
10
  return {
11
11
  ...t,
12
12
  name: e,
13
13
  role: r
14
14
  };
15
15
  }
16
- function Fi(e) {
16
+ function Mi(e) {
17
17
  return e;
18
18
  }
19
- function Mi(e) {
19
+ function ji(e) {
20
20
  return e;
21
21
  }
22
- const ji = {
22
+ const Hi = {
23
23
  source: {
24
24
  semantic(e) {
25
25
  return {
@@ -36,16 +36,16 @@ const ji = {
36
36
  },
37
37
  field: {
38
38
  measure(e, r) {
39
- return ye(e, "measure", r);
39
+ return me(e, "measure", r);
40
40
  },
41
41
  dimension(e, r) {
42
- return ye(e, "dimension", r);
42
+ return me(e, "dimension", r);
43
43
  },
44
44
  date(e, r) {
45
- return ye(e, "date", r);
45
+ return me(e, "date", r);
46
46
  },
47
47
  id(e, r) {
48
- return ye(e, "id", r);
48
+ return me(e, "id", r);
49
49
  }
50
50
  },
51
51
  filter(e) {
@@ -57,7 +57,7 @@ const ji = {
57
57
  bindInput(e, r) {
58
58
  return {
59
59
  toAnalyticsInput() {
60
- const [t] = zr([e]), n = Fr({
60
+ const [t] = Pr([e]), n = zr({
61
61
  ...r,
62
62
  inputId: r.inputId || t.inputId
63
63
  });
@@ -129,13 +129,13 @@ const ji = {
129
129
  queryKind: "matrix"
130
130
  };
131
131
  }
132
- }, pe = 10, Ne = 8;
132
+ }, ce = 10, _e = 8;
133
133
  function dt(e) {
134
134
  const r = e == null ? void 0 : e.result;
135
135
  if (r)
136
136
  switch (r.kind) {
137
137
  case "records":
138
- return ue({
138
+ return de({
139
139
  title: "Records",
140
140
  rowNoun: "rows",
141
141
  records: r.records,
@@ -143,7 +143,7 @@ function dt(e) {
143
143
  rowCount: r.rowCount
144
144
  });
145
145
  case "sql":
146
- return ue({
146
+ return de({
147
147
  title: "SQL Rows",
148
148
  rowNoun: "rows",
149
149
  records: r.records,
@@ -151,10 +151,10 @@ function dt(e) {
151
151
  rowCount: r.rowCount
152
152
  });
153
153
  case "inputOptions":
154
- return ue({
154
+ return de({
155
155
  title: "Options",
156
156
  rowNoun: "options",
157
- records: r.options.slice(0, pe).map((t) => {
157
+ records: r.options.slice(0, ce).map((t) => {
158
158
  var n;
159
159
  return {
160
160
  label: t.label,
@@ -182,7 +182,7 @@ function dt(e) {
182
182
  },
183
183
  { metric: "delta", value: r.comparison.delta },
184
184
  { metric: "deltaPercent", value: r.comparison.deltaPercent }
185
- ), ue({
185
+ ), de({
186
186
  title: "Metric",
187
187
  rowNoun: "values",
188
188
  records: t,
@@ -194,10 +194,10 @@ function dt(e) {
194
194
  });
195
195
  }
196
196
  case "matrix":
197
- return ue({
197
+ return de({
198
198
  title: "Matrix Cells",
199
199
  rowNoun: "cells",
200
- records: r.cells.slice(0, pe).map((t) => {
200
+ records: r.cells.slice(0, ce).map((t) => {
201
201
  const n = r.nodesById[t.rowId], i = t.columnId ? r.nodesById[t.columnId] : void 0, o = r.measuresById[t.measureId];
202
202
  return {
203
203
  row: (n == null ? void 0 : n.label) || t.rowId,
@@ -217,101 +217,101 @@ function dt(e) {
217
217
  rowCount: r.rowCount ?? r.cells.length
218
218
  });
219
219
  default:
220
- return ct(r);
220
+ return ut(r);
221
221
  }
222
222
  }
223
- function ue({
223
+ function de({
224
224
  title: e,
225
225
  rowNoun: r,
226
226
  records: t,
227
227
  columns: n,
228
228
  rowCount: i
229
229
  }) {
230
- const o = ut(n, t);
230
+ const o = lt(n, t);
231
231
  if (!o.length)
232
232
  return;
233
- const u = i ?? t.length, f = t.slice(0, pe);
233
+ const u = i ?? t.length, f = t.slice(0, ce);
234
234
  return {
235
235
  title: e,
236
- summary: `${pt(u)} ${r}`,
237
- columns: o.slice(0, Ne),
236
+ summary: `${ft(u)} ${r}`,
237
+ columns: o.slice(0, _e),
238
238
  rows: f,
239
239
  truncatedRows: u > f.length,
240
- truncatedColumns: o.length > Ne
240
+ truncatedColumns: o.length > _e
241
241
  };
242
242
  }
243
- function ut(e, r) {
243
+ function lt(e, r) {
244
244
  if (e != null && e.length)
245
245
  return e.filter((n) => n.key).map((n) => ({
246
246
  key: n.key,
247
247
  label: n.label || n.key
248
248
  }));
249
249
  const t = /* @__PURE__ */ new Set();
250
- return r.slice(0, pe).forEach((n) => {
250
+ return r.slice(0, ce).forEach((n) => {
251
251
  Object.keys(n).forEach((i) => t.add(i));
252
252
  }), [...t].map((n) => ({ key: n, label: n }));
253
253
  }
254
+ function ut(e) {
255
+ throw new Error(`Unhandled Semaphor result kind: ${br(e)}`);
256
+ }
254
257
  function ct(e) {
255
- throw new Error(`Unhandled Semaphor result kind: ${vr(e)}`);
258
+ return e === null ? "null" : e === void 0 ? "" : typeof e == "string" ? tr(e) : typeof e == "number" || typeof e == "boolean" ? String(e) : tr(br(e));
256
259
  }
257
260
  function ft(e) {
258
- return e === null ? "null" : e === void 0 ? "" : typeof e == "string" ? nr(e) : typeof e == "number" || typeof e == "boolean" ? String(e) : nr(vr(e));
259
- }
260
- function pt(e) {
261
261
  return typeof e == "number" ? e.toLocaleString() : "-";
262
262
  }
263
- function vr(e) {
263
+ function br(e) {
264
264
  return JSON.stringify(e, null, 2) ?? "undefined";
265
265
  }
266
- function nr(e) {
266
+ function tr(e) {
267
267
  return e.length > 80 ? `${e.slice(0, 77)}...` : e;
268
268
  }
269
- function Ae(e) {
269
+ function xe(e) {
270
270
  return e.viewTitle || e.queryLabel || e.viewId || e.queryId;
271
271
  }
272
- function gt(e) {
272
+ function pt(e) {
273
273
  if (e.label)
274
274
  return e.label;
275
275
  if (e.queryKind !== "inputOptions")
276
276
  return;
277
277
  const t = e.labelField.label || e.valueField.label || e.labelField.name || e.valueField.name || e.inputId;
278
- return `${mt(t)} Options`;
278
+ return `${gt(t)} Options`;
279
279
  }
280
- function mt(e) {
280
+ function gt(e) {
281
281
  return (e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " ").replace(/\bfilter\b/gi, " ").replace(/\boptions?\b/gi, " ").replace(/\bid\b/gi, " ").replace(/\s+/g, " ").trim() || e).split(" ").filter(Boolean).map((n) => n === n.toUpperCase() && n.length > 1 ? n : `${n.slice(0, 1).toUpperCase()}${n.slice(1)}`).join(" ");
282
282
  }
283
- function je(e) {
283
+ function Me(e) {
284
284
  return e.flatMap((r) => {
285
- var m, h, S, g;
286
- const t = r.latestAttempt, n = t == null ? void 0 : t.executionResult, i = Ee(
287
- (m = n == null ? void 0 : n.validation) == null ? void 0 : m.warnings
288
- ), o = Ee(
289
- (h = n == null ? void 0 : n.validation) == null ? void 0 : h.errors
290
- ), u = vt(
291
- (S = n == null ? void 0 : n.coverage) == null ? void 0 : S.missingObligations
292
- ), f = Ee(
285
+ var y, m, v, g;
286
+ const t = r.latestAttempt, n = t == null ? void 0 : t.executionResult, i = Ce(
287
+ (y = n == null ? void 0 : n.validation) == null ? void 0 : y.warnings
288
+ ), o = Ce(
289
+ (m = n == null ? void 0 : n.validation) == null ? void 0 : m.errors
290
+ ), u = bt(
291
+ (v = n == null ? void 0 : n.coverage) == null ? void 0 : v.missingObligations
292
+ ), f = Ce(
293
293
  (g = n == null ? void 0 : n.coverage) == null ? void 0 : g.warnings
294
- ), l = [], c = Ae(r);
295
- (t == null ? void 0 : t.status) === "error" && l.push({
294
+ ), d = [], c = xe(r);
295
+ (t == null ? void 0 : t.status) === "error" && d.push({
296
296
  trace: r,
297
297
  tone: "error",
298
298
  title: c,
299
299
  message: t.errorMessage || "Query attempt failed."
300
300
  });
301
- for (const b of r.clientWarnings)
302
- l.push({ trace: r, tone: "warning", title: c, message: b });
303
- for (const b of i)
304
- l.push({ trace: r, tone: "warning", title: c, ...b });
305
- for (const b of o)
306
- l.push({ trace: r, tone: "error", title: c, ...b });
307
- for (const b of u)
308
- l.push({ trace: r, tone: "warning", title: c, message: b });
309
- for (const b of f)
310
- l.push({ trace: r, tone: "warning", title: c, ...b });
311
- return l;
301
+ for (const h of r.clientWarnings)
302
+ d.push({ trace: r, tone: "warning", title: c, message: h });
303
+ for (const h of i)
304
+ d.push({ trace: r, tone: "warning", title: c, ...h });
305
+ for (const h of o)
306
+ d.push({ trace: r, tone: "error", title: c, ...h });
307
+ for (const h of u)
308
+ d.push({ trace: r, tone: "warning", title: c, message: h });
309
+ for (const h of f)
310
+ d.push({ trace: r, tone: "warning", title: c, ...h });
311
+ return d;
312
312
  });
313
313
  }
314
- function yt(e) {
314
+ function mt(e) {
315
315
  return {
316
316
  traceId: e.trace.traceId,
317
317
  queryId: e.trace.queryId,
@@ -325,11 +325,11 @@ function yt(e) {
325
325
  path: e.path
326
326
  };
327
327
  }
328
- function ht(e, r) {
328
+ function yt(e, r) {
329
329
  return e.filter((t) => t.trace.traceId === r.traceId).length;
330
330
  }
331
- function bt(e) {
332
- const r = je(e), t = e.filter(
331
+ function ht(e) {
332
+ const r = Me(e), t = e.filter(
333
333
  (u) => {
334
334
  var f;
335
335
  return ((f = u.latestAttempt) == null ? void 0 : f.status) === "error";
@@ -350,15 +350,15 @@ function bt(e) {
350
350
  severity: t || i ? "error" : o ? "warning" : n ? "loading" : "ok"
351
351
  };
352
352
  }
353
- function vt(e) {
353
+ function bt(e) {
354
354
  return Array.isArray(e) ? e.filter((r) => typeof r == "string") : [];
355
355
  }
356
- function Ee(e) {
357
- return Array.isArray(e) ? e.map(St).filter(
356
+ function Ce(e) {
357
+ return Array.isArray(e) ? e.map(vt).filter(
358
358
  (r) => !!r
359
359
  ) : [];
360
360
  }
361
- function St(e) {
361
+ function vt(e) {
362
362
  if (typeof e == "string")
363
363
  return { message: e };
364
364
  if (!e || typeof e != "object" || Array.isArray(e))
@@ -373,10 +373,10 @@ function St(e) {
373
373
  ...i ? { path: i } : {}
374
374
  } : n ? { message: n, code: n } : void 0;
375
375
  }
376
- function wt(e) {
376
+ function St(e) {
377
377
  if (!e.enabled)
378
378
  return e;
379
- const r = e.queries.map(Sr);
379
+ const r = e.queries.map(vr);
380
380
  return {
381
381
  enabled: e.enabled,
382
382
  queries: r,
@@ -385,28 +385,28 @@ function wt(e) {
385
385
  getQueries: (t) => r.filter((n) => n.queryId === t)
386
386
  };
387
387
  }
388
- function ir(e) {
389
- return e ? Sr(e) : void 0;
388
+ function nr(e) {
389
+ return e ? vr(e) : void 0;
390
390
  }
391
- function Sr(e) {
391
+ function vr(e) {
392
392
  var r;
393
393
  return (r = e == null ? void 0 : e.latestAttempt) != null && r.executionResult ? {
394
394
  ...e,
395
395
  latestAttempt: {
396
396
  ...e.latestAttempt,
397
- executionResult: It(
397
+ executionResult: wt(
398
398
  e.latestAttempt.executionResult
399
399
  )
400
400
  }
401
401
  } : e;
402
402
  }
403
- function It(e) {
403
+ function wt(e) {
404
404
  const {
405
405
  compiledQuery: r,
406
406
  intent: t,
407
407
  result: n,
408
408
  ...i
409
- } = e, o = xt(
409
+ } = e, o = It(
410
410
  i.metadata
411
411
  );
412
412
  return {
@@ -414,7 +414,7 @@ function It(e) {
414
414
  ...o ? { metadata: o } : {}
415
415
  };
416
416
  }
417
- function xt(e) {
417
+ function It(e) {
418
418
  if (!e || typeof e != "object" || Array.isArray(e))
419
419
  return e;
420
420
  const r = e.dataAppDebug;
@@ -426,7 +426,7 @@ function xt(e) {
426
426
  dataAppDebug: n
427
427
  };
428
428
  }
429
- function qt(e) {
429
+ function xt(e) {
430
430
  return e === "relative" ? {
431
431
  position: "relative",
432
432
  top: "auto",
@@ -440,7 +440,7 @@ function qt(e) {
440
440
  left: e.endsWith("left") ? 20 : "auto"
441
441
  };
442
442
  }
443
- function At(e) {
443
+ function qt(e) {
444
444
  return e === "error" ? {
445
445
  borderColor: "var(--sd-error-border)",
446
446
  background: "var(--sd-error-bg)",
@@ -459,7 +459,7 @@ function At(e) {
459
459
  color: "var(--sd-success-fg)"
460
460
  };
461
461
  }
462
- function Ct(e) {
462
+ function Tt(e) {
463
463
  return e === "right" ? {
464
464
  top: 16,
465
465
  right: 16,
@@ -478,23 +478,23 @@ function Ct(e) {
478
478
  borderRadius: 6
479
479
  };
480
480
  }
481
- function kt(e) {
481
+ function At(e) {
482
482
  return e === "right" ? {
483
483
  gridTemplateColumns: "minmax(210px, 280px) minmax(0, 1fr)"
484
484
  } : {
485
485
  gridTemplateColumns: "minmax(260px, 340px) minmax(0, 1fr)"
486
486
  };
487
487
  }
488
- function Tt(e) {
488
+ function Ct(e) {
489
489
  return {
490
490
  borderRight: "1px solid var(--sd-border)",
491
491
  borderBottom: 0
492
492
  };
493
493
  }
494
- function wr(e) {
494
+ function Sr(e) {
495
495
  return e === "error" ? { background: "var(--sd-error-dot)" } : e === "success" ? { background: "var(--sd-success-dot)" } : e === "loading" ? { background: "var(--sd-loading-dot)" } : { background: "var(--sd-idle-dot)" };
496
496
  }
497
- function Et(e) {
497
+ function kt(e) {
498
498
  return e === "error" ? {
499
499
  borderColor: "var(--sd-error-border)",
500
500
  color: "var(--sd-error-fg)"
@@ -509,8 +509,8 @@ function Et(e) {
509
509
  color: "var(--sd-fg-muted)"
510
510
  };
511
511
  }
512
- const or = "semaphor-devtools-stylesheet", P = "semaphor-devtools", Rt = `
513
- .${P} {
512
+ const ir = "semaphor-devtools-stylesheet", R = "semaphor-devtools", Et = `
513
+ .${R} {
514
514
  --sd-bg: #ffffff;
515
515
  --sd-bg-muted: #fafafa;
516
516
  --sd-bg-raised: #ffffff;
@@ -559,7 +559,7 @@ const or = "semaphor-devtools-stylesheet", P = "semaphor-devtools", Rt = `
559
559
  }
560
560
 
561
561
  @media (prefers-color-scheme: dark) {
562
- .${P} {
562
+ .${R} {
563
563
  --sd-bg: #09090b;
564
564
  --sd-bg-muted: #18181b;
565
565
  --sd-bg-raised: #18181b;
@@ -603,27 +603,42 @@ const or = "semaphor-devtools-stylesheet", P = "semaphor-devtools", Rt = `
603
603
  }
604
604
  }
605
605
 
606
- .${P}-source {
606
+ .${R}-source {
607
607
  display: -webkit-box;
608
608
  -webkit-line-clamp: 2;
609
609
  -webkit-box-orient: vertical;
610
610
  overflow: hidden;
611
611
  word-break: break-all;
612
612
  }
613
+
614
+ .${R}-field-row {
615
+ transition: background-color 0.1s ease;
616
+ }
617
+ .${R}-field-row:hover {
618
+ background-color: var(--sd-bg-muted);
619
+ }
620
+
621
+ .${R}-tab {
622
+ color: var(--sd-fg-muted);
623
+ transition: color 0.1s ease;
624
+ }
625
+ .${R}-tab:hover {
626
+ color: var(--sd-fg);
627
+ }
613
628
  `;
614
- function Ir() {
615
- if (typeof document > "u" || document.getElementById(or))
629
+ function wr() {
630
+ if (typeof document > "u" || document.getElementById(ir))
616
631
  return;
617
632
  const e = document.createElement("style");
618
- e.id = or, e.textContent = Rt, document.head.appendChild(e);
633
+ e.id = ir, e.textContent = Et, document.head.appendChild(e);
619
634
  }
620
- const he = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif', B = "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace", be = {
635
+ const ye = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif', W = "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace", ke = {
621
636
  color: "var(--sd-fg-muted)",
622
637
  fontSize: 10,
623
638
  fontWeight: 600,
624
639
  textTransform: "uppercase",
625
640
  letterSpacing: "0.08em"
626
- }, a = {
641
+ }, s = {
627
642
  launcher: {
628
643
  position: "fixed",
629
644
  bottom: 20,
@@ -638,7 +653,7 @@ const he = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
638
653
  borderStyle: "solid",
639
654
  borderRadius: 6,
640
655
  boxShadow: "var(--sd-shadow)",
641
- font: `600 12px/1.2 ${he}`,
656
+ font: `600 12px/1.2 ${ye}`,
642
657
  cursor: "pointer"
643
658
  },
644
659
  launcherText: {
@@ -683,7 +698,7 @@ const he = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
683
698
  background: "var(--sd-bg)",
684
699
  color: "var(--sd-fg)",
685
700
  boxShadow: "var(--sd-shadow)",
686
- font: `13px/1.4 ${he}`
701
+ font: `13px/1.4 ${ye}`
687
702
  },
688
703
  panelFullscreen: {
689
704
  top: 0,
@@ -752,7 +767,7 @@ const he = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
752
767
  outline: 0,
753
768
  background: "transparent",
754
769
  color: "var(--sd-fg)",
755
- font: `12px/1.4 ${he}`
770
+ font: `12px/1.4 ${ye}`
756
771
  },
757
772
  issueSummary: {
758
773
  margin: "0 10px 10px",
@@ -775,7 +790,7 @@ const he = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
775
790
  background: "transparent",
776
791
  color: "inherit",
777
792
  cursor: "pointer",
778
- ...be
793
+ ...ke
779
794
  },
780
795
  issueSummaryHeaderLabel: {
781
796
  display: "inline-flex",
@@ -882,7 +897,7 @@ const he = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
882
897
  alignItems: "center",
883
898
  justifyContent: "space-between",
884
899
  padding: "4px 6px 3px",
885
- ...be
900
+ ...ke
886
901
  },
887
902
  queryGroupCount: {
888
903
  color: "var(--sd-fg-subtle)",
@@ -945,7 +960,7 @@ const he = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
945
960
  borderRadius: 3,
946
961
  background: "var(--sd-bg-accent)",
947
962
  color: "var(--sd-fg-muted)",
948
- fontFamily: B,
963
+ fontFamily: W,
949
964
  fontSize: 9,
950
965
  fontWeight: 600,
951
966
  textTransform: "uppercase",
@@ -1023,7 +1038,7 @@ const he = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
1023
1038
  borderRadius: 3,
1024
1039
  background: "var(--sd-bg-accent)",
1025
1040
  color: "var(--sd-fg-muted)",
1026
- fontFamily: B,
1041
+ fontFamily: W,
1027
1042
  fontSize: 10,
1028
1043
  fontWeight: 600,
1029
1044
  textTransform: "uppercase",
@@ -1064,7 +1079,7 @@ const he = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
1064
1079
  color: "var(--sd-fg)"
1065
1080
  },
1066
1081
  sourcePillLabel: {
1067
- fontFamily: B,
1082
+ fontFamily: W,
1068
1083
  fontSize: 11,
1069
1084
  color: "var(--sd-fg)"
1070
1085
  },
@@ -1076,27 +1091,24 @@ const he = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
1076
1091
  borderRadius: 3,
1077
1092
  background: "var(--sd-bg-accent)",
1078
1093
  color: "var(--sd-fg-subtle)",
1079
- fontFamily: B,
1094
+ fontFamily: W,
1080
1095
  fontSize: 9,
1081
1096
  textTransform: "uppercase",
1082
1097
  letterSpacing: "0.06em"
1083
1098
  },
1084
1099
  fieldChipList: {
1085
1100
  display: "grid",
1086
- gap: 5,
1087
- paddingTop: 6
1101
+ gap: 0,
1102
+ paddingTop: 2
1088
1103
  },
1089
1104
  fieldChip: {
1090
1105
  display: "flex",
1091
1106
  alignItems: "center",
1092
1107
  gap: 8,
1093
1108
  minWidth: 0,
1094
- padding: "6px 9px",
1095
- borderWidth: 1,
1096
- borderStyle: "solid",
1097
- borderColor: "var(--sd-border)",
1098
- borderRadius: 5,
1099
- background: "var(--sd-bg)"
1109
+ padding: "5px 6px",
1110
+ margin: "0 -6px",
1111
+ borderRadius: 4
1100
1112
  },
1101
1113
  fieldGlyph: {
1102
1114
  display: "inline-flex",
@@ -1108,7 +1120,7 @@ const he = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
1108
1120
  borderWidth: 1,
1109
1121
  borderStyle: "solid",
1110
1122
  borderRadius: 4,
1111
- fontFamily: B,
1123
+ fontFamily: W,
1112
1124
  fontSize: 11,
1113
1125
  fontWeight: 700,
1114
1126
  lineHeight: 1
@@ -1121,7 +1133,7 @@ const he = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
1121
1133
  borderRadius: 3,
1122
1134
  background: "var(--sd-bg-accent)",
1123
1135
  color: "var(--sd-fg)",
1124
- fontFamily: B,
1136
+ fontFamily: W,
1125
1137
  fontSize: 10,
1126
1138
  fontWeight: 600,
1127
1139
  letterSpacing: "0.04em"
@@ -1138,7 +1150,7 @@ const he = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
1138
1150
  },
1139
1151
  fieldChipMeta: {
1140
1152
  flex: "0 0 auto",
1141
- fontFamily: B,
1153
+ fontFamily: W,
1142
1154
  fontSize: 10,
1143
1155
  color: "var(--sd-fg-subtle)"
1144
1156
  },
@@ -1153,15 +1165,37 @@ const he = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
1153
1165
  sqlBindParam: {
1154
1166
  color: "var(--sd-sql-bind)"
1155
1167
  },
1156
- disclosure: {
1168
+ traceTabs: {
1157
1169
  marginTop: 16
1158
1170
  },
1159
- disclosureSummary: {
1171
+ traceTabBar: {
1172
+ display: "flex",
1173
+ gap: 2,
1174
+ borderBottom: "1px solid var(--sd-border)",
1175
+ overflowX: "auto",
1176
+ scrollbarWidth: "none"
1177
+ },
1178
+ traceTab: {
1179
+ flex: "0 0 auto",
1180
+ appearance: "none",
1181
+ border: "none",
1182
+ background: "transparent",
1160
1183
  cursor: "pointer",
1161
- ...be
1184
+ padding: "6px 9px",
1185
+ marginBottom: -1,
1186
+ fontSize: 10,
1187
+ fontWeight: 600,
1188
+ textTransform: "uppercase",
1189
+ letterSpacing: "0.07em",
1190
+ borderBottom: "2px solid transparent",
1191
+ whiteSpace: "nowrap"
1192
+ },
1193
+ traceTabActive: {
1194
+ color: "var(--sd-fg)",
1195
+ borderBottom: "2px solid var(--sd-fg)"
1162
1196
  },
1163
- disclosureBody: {
1164
- marginTop: 8
1197
+ traceTabPanel: {
1198
+ paddingTop: 12
1165
1199
  },
1166
1200
  alertCard: {
1167
1201
  marginTop: 12,
@@ -1197,7 +1231,7 @@ const he = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
1197
1231
  },
1198
1232
  recipe: {
1199
1233
  display: "grid",
1200
- gap: 12
1234
+ gap: 16
1201
1235
  },
1202
1236
  traceLineage: {
1203
1237
  display: "grid",
@@ -1212,8 +1246,7 @@ const he = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
1212
1246
  alignItems: "baseline",
1213
1247
  justifyContent: "space-between",
1214
1248
  gap: 8,
1215
- paddingBottom: 4,
1216
- borderBottom: "1px solid var(--sd-border-soft)"
1249
+ paddingBottom: 2
1217
1250
  },
1218
1251
  recipeGroupTitle: {
1219
1252
  color: "var(--sd-fg-muted)",
@@ -1324,7 +1357,7 @@ const he = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
1324
1357
  textOverflow: "ellipsis",
1325
1358
  whiteSpace: "nowrap",
1326
1359
  color: "var(--sd-fg-subtle)",
1327
- fontFamily: B,
1360
+ fontFamily: W,
1328
1361
  fontSize: 10,
1329
1362
  fontWeight: 600
1330
1363
  },
@@ -1337,7 +1370,7 @@ const he = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
1337
1370
  borderRadius: 3,
1338
1371
  background: "var(--sd-bg-accent)",
1339
1372
  color: "var(--sd-fg-muted)",
1340
- fontFamily: B,
1373
+ fontFamily: W,
1341
1374
  fontSize: 10,
1342
1375
  textTransform: "uppercase",
1343
1376
  letterSpacing: "0.06em"
@@ -1444,7 +1477,7 @@ const he = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
1444
1477
  padding: "6px 8px",
1445
1478
  borderBottom: "1px solid var(--sd-border-soft)",
1446
1479
  color: "var(--sd-fg)",
1447
- fontFamily: B,
1480
+ fontFamily: W,
1448
1481
  fontSize: 11,
1449
1482
  overflow: "hidden",
1450
1483
  textOverflow: "ellipsis",
@@ -1466,7 +1499,7 @@ const he = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
1466
1499
  gap: 5
1467
1500
  },
1468
1501
  codeBlockLabel: {
1469
- ...be
1502
+ ...ke
1470
1503
  },
1471
1504
  codeBlock: {
1472
1505
  maxHeight: 260,
@@ -1477,7 +1510,7 @@ const he = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
1477
1510
  borderRadius: 5,
1478
1511
  background: "var(--sd-bg-muted)",
1479
1512
  color: "var(--sd-fg)",
1480
- fontFamily: B,
1513
+ fontFamily: W,
1481
1514
  fontSize: 11,
1482
1515
  lineHeight: 1.5,
1483
1516
  whiteSpace: "pre-wrap"
@@ -1499,7 +1532,7 @@ const he = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
1499
1532
  borderStyle: "solid",
1500
1533
  borderRadius: 5,
1501
1534
  background: "var(--sd-bg)",
1502
- font: `600 11px/1 ${he}`,
1535
+ font: `600 11px/1 ${ye}`,
1503
1536
  cursor: "pointer"
1504
1537
  },
1505
1538
  inspectButtonText: {
@@ -1507,161 +1540,161 @@ const he = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
1507
1540
  textOverflow: "ellipsis",
1508
1541
  whiteSpace: "nowrap"
1509
1542
  }
1510
- }, Re = 10, Le = 100, Lt = 25, Dt = 500, xr = {
1543
+ }, Ee = 10, Re = 100, Rt = 25, Lt = 500, Ir = {
1511
1544
  enabled: !1,
1512
1545
  queries: [],
1513
1546
  issues: [],
1514
1547
  getQuery: () => {
1515
1548
  },
1516
1549
  getQueries: () => []
1517
- }, He = qe(null), Ve = qe(null), Qe = qe(
1550
+ }, je = Ie(null), He = Ie(null), Ve = Ie(
1518
1551
  void 0
1519
- ), U = [];
1552
+ ), V = [];
1520
1553
  function $t({
1521
1554
  debug: e,
1522
1555
  children: r
1523
1556
  }) {
1524
- const t = I(() => $n(e), [e]), [n, i] = Yr(
1557
+ const t = I(() => On(e), [e]), [n, i] = Jr(
1525
1558
  Cn,
1526
1559
  t,
1527
- Lr
1528
- ), o = L(n), u = br(), [f, l] = M({ open: !1 });
1529
- o.current = n, W(() => {
1560
+ Rr
1561
+ ), o = E(n), u = hr(), [f, d] = F({ open: !1 });
1562
+ o.current = n, B(() => {
1530
1563
  i({ type: "config", config: t });
1531
- }, [t]), W(() => {
1564
+ }, [t]), B(() => {
1532
1565
  if (!n.enabled || !n.exposeWindowBridge || typeof window > "u")
1533
1566
  return;
1534
- const b = Dn(() => o.current);
1535
- return Ot({
1567
+ const h = Dn(() => o.current);
1568
+ return Dt({
1536
1569
  ownerId: u,
1537
- bridge: b
1570
+ bridge: h
1538
1571
  }), () => {
1539
- Bt(u);
1572
+ Ot(u);
1540
1573
  };
1541
1574
  }, [u, n.enabled, n.exposeWindowBridge]);
1542
- const c = I(() => ({ state: n, dispatch: i }), [n]), m = $((b) => {
1543
- l({ open: !0, focus: b });
1544
- }, []), h = $(() => {
1545
- l((b) => ({ ...b, open: !1 }));
1546
- }, []), S = $((b) => {
1547
- l({ open: !0, focus: b });
1575
+ const c = I(() => ({ state: n, dispatch: i }), [n]), y = O((h) => {
1576
+ d({ open: !0, focus: h });
1577
+ }, []), m = O(() => {
1578
+ d((h) => ({ ...h, open: !1 }));
1579
+ }, []), v = O((h) => {
1580
+ d({ open: !0, focus: h });
1548
1581
  }, []), g = I(
1549
1582
  () => ({
1550
1583
  open: f.open,
1551
1584
  focus: f.focus,
1552
- openDevtools: m,
1553
- closeDevtools: h,
1554
- focusTrace: S
1585
+ openDevtools: y,
1586
+ closeDevtools: m,
1587
+ focusTrace: v
1555
1588
  }),
1556
1589
  [
1557
- h,
1558
- S,
1559
1590
  m,
1591
+ v,
1592
+ y,
1560
1593
  f.focus,
1561
1594
  f.open
1562
1595
  ]
1563
1596
  );
1564
- return /* @__PURE__ */ s(He.Provider, { value: c, children: /* @__PURE__ */ s(Ve.Provider, { value: g, children: r }) });
1597
+ return /* @__PURE__ */ a(je.Provider, { value: c, children: /* @__PURE__ */ a(He.Provider, { value: g, children: r }) });
1565
1598
  }
1566
- function Ot(e) {
1567
- const r = U.findIndex(
1599
+ function Dt(e) {
1600
+ const r = V.findIndex(
1568
1601
  (t) => t.ownerId === e.ownerId
1569
1602
  );
1570
- r >= 0 && U.splice(r, 1), U.push(e), qr();
1603
+ r >= 0 && V.splice(r, 1), V.push(e), xr();
1571
1604
  }
1572
- function Bt(e) {
1573
- const r = U.findIndex(
1605
+ function Ot(e) {
1606
+ const r = V.findIndex(
1574
1607
  (t) => t.ownerId === e
1575
1608
  );
1576
- r >= 0 && U.splice(r, 1), qr();
1609
+ r >= 0 && V.splice(r, 1), xr();
1577
1610
  }
1578
- function qr() {
1611
+ function xr() {
1579
1612
  if (typeof window > "u")
1580
1613
  return;
1581
- const e = U[U.length - 1];
1614
+ const e = V[V.length - 1];
1582
1615
  e ? window.__SEMAPHOR_DEVTOOLS__ = e.bridge : delete window.__SEMAPHOR_DEVTOOLS__;
1583
1616
  }
1584
- function Hi({
1617
+ function Vi({
1585
1618
  id: e,
1586
1619
  title: r,
1587
1620
  children: t
1588
1621
  }) {
1589
1622
  const n = I(() => ({ id: e, title: r }), [e, r]);
1590
- return /* @__PURE__ */ s(Qe.Provider, { value: n, children: t });
1623
+ return /* @__PURE__ */ a(Ve.Provider, { value: n, children: t });
1591
1624
  }
1592
- function Kt({
1625
+ function Bt({
1593
1626
  buttonPosition: e = "bottom-right",
1594
1627
  initialIsOpen: r = !1,
1595
1628
  panelPosition: t = "right",
1596
1629
  className: n,
1597
1630
  style: i
1598
1631
  } = {}) {
1599
- const o = Ar(), u = G(Ve), [f, l] = M(""), [c, m] = M(!1), h = L(null), S = L(null), g = u == null ? void 0 : u.openDevtools, b = u == null ? void 0 : u.closeDevtools, E = (u == null ? void 0 : u.open) === !0;
1600
- W(() => {
1601
- Ir();
1602
- }, []), W(() => {
1632
+ const o = qr(), u = Q(He), [f, d] = F(""), [c, y] = F(!1), m = E(null), v = E(null), g = u == null ? void 0 : u.openDevtools, h = u == null ? void 0 : u.closeDevtools, T = (u == null ? void 0 : u.open) === !0;
1633
+ B(() => {
1634
+ wr();
1635
+ }, []), B(() => {
1603
1636
  r && o.enabled && (g == null || g());
1604
- }, [r, o.enabled, g]), W(() => {
1605
- if (!E || !b)
1637
+ }, [r, o.enabled, g]), B(() => {
1638
+ if (!T || !h)
1606
1639
  return;
1607
- const y = (w) => {
1608
- var x, T;
1609
- const R = w.target;
1610
- R instanceof Node && ((x = h.current) != null && x.contains(R) || (T = S.current) != null && T.contains(R) || b());
1640
+ const S = (w) => {
1641
+ var x, D;
1642
+ const L = w.target;
1643
+ L instanceof Node && ((x = m.current) != null && x.contains(L) || (D = v.current) != null && D.contains(L) || h());
1611
1644
  };
1612
- return document.addEventListener("pointerdown", y, !0), document.addEventListener("mousedown", y, !0), document.addEventListener("click", y, !0), () => {
1613
- document.removeEventListener("pointerdown", y, !0), document.removeEventListener("mousedown", y, !0), document.removeEventListener("click", y, !0);
1645
+ return document.addEventListener("pointerdown", S, !0), document.addEventListener("mousedown", S, !0), document.addEventListener("click", S, !0), () => {
1646
+ document.removeEventListener("pointerdown", S, !0), document.removeEventListener("mousedown", S, !0), document.removeEventListener("click", S, !0);
1614
1647
  };
1615
- }, [b, E]);
1616
- const d = I(
1617
- () => bt(o.queries),
1648
+ }, [h, T]);
1649
+ const l = I(
1650
+ () => ht(o.queries),
1618
1651
  [o.queries]
1619
- ), v = I(
1620
- () => je(o.queries),
1652
+ ), b = I(
1653
+ () => Me(o.queries),
1621
1654
  [o.queries]
1622
- ), O = rn(d), A = I(
1623
- () => tn(o.queries, f),
1655
+ ), K = tn(l), A = I(
1656
+ () => nn(o.queries, f),
1624
1657
  [o.queries, f]
1625
- ), _ = I(
1626
- () => nn(A),
1658
+ ), N = I(
1659
+ () => on(A),
1627
1660
  [A]
1628
- ), D = I(
1629
- () => Cr(A, u == null ? void 0 : u.focus) || A[0],
1661
+ ), $ = I(
1662
+ () => Tr(A, u == null ? void 0 : u.focus) || A[0],
1630
1663
  [A, u == null ? void 0 : u.focus]
1631
1664
  );
1632
- return !o.enabled || !u ? null : /* @__PURE__ */ p(hr, { children: [
1665
+ return !o.enabled || !u ? null : /* @__PURE__ */ p(yr, { children: [
1633
1666
  /* @__PURE__ */ p(
1634
1667
  "button",
1635
1668
  {
1636
- ref: h,
1669
+ ref: m,
1637
1670
  type: "button",
1638
1671
  "aria-label": "Open Semaphor Inspector",
1639
- title: O,
1640
- className: n ? `${P} ${n}` : P,
1672
+ title: K,
1673
+ className: n ? `${R} ${n}` : R,
1641
1674
  style: {
1642
- ...a.launcher,
1643
- ...qt(e),
1644
- ...At(d.severity),
1675
+ ...s.launcher,
1676
+ ...xt(e),
1677
+ ...qt(l.severity),
1645
1678
  ...i
1646
1679
  },
1647
1680
  onClick: () => {
1648
1681
  var w;
1649
- const y = (w = v[0]) == null ? void 0 : w.trace;
1682
+ const S = (w = b[0]) == null ? void 0 : w.trace;
1650
1683
  u.openDevtools(
1651
- y ? {
1652
- traceId: y.traceId,
1653
- queryId: y.queryId,
1654
- viewId: y.viewId
1684
+ S ? {
1685
+ traceId: S.traceId,
1686
+ queryId: S.queryId,
1687
+ viewId: S.viewId
1655
1688
  } : void 0
1656
1689
  );
1657
1690
  },
1658
1691
  children: [
1659
- /* @__PURE__ */ s(_t, {}),
1660
- /* @__PURE__ */ s("span", { style: a.launcherText, children: d.total }),
1661
- d.issueCount > 0 ? /* @__PURE__ */ p("span", { style: a.launcherIssueCount, children: [
1662
- d.issueCount,
1692
+ /* @__PURE__ */ a(Wt, {}),
1693
+ /* @__PURE__ */ a("span", { style: s.launcherText, children: l.total }),
1694
+ l.issueCount > 0 ? /* @__PURE__ */ p("span", { style: s.launcherIssueCount, children: [
1695
+ l.issueCount,
1663
1696
  " issue",
1664
- d.issueCount === 1 ? "" : "s"
1697
+ l.issueCount === 1 ? "" : "s"
1665
1698
  ] }) : null
1666
1699
  ]
1667
1700
  }
@@ -1669,80 +1702,80 @@ function Kt({
1669
1702
  u.open ? /* @__PURE__ */ p(
1670
1703
  "div",
1671
1704
  {
1672
- ref: S,
1705
+ ref: v,
1673
1706
  role: "dialog",
1674
1707
  "aria-label": "Semaphor Inspector",
1675
1708
  "aria-modal": "false",
1676
- className: P,
1709
+ className: R,
1677
1710
  style: {
1678
- ...a.panel,
1679
- ...Ct(t),
1680
- ...c ? a.panelFullscreen : null
1711
+ ...s.panel,
1712
+ ...Tt(t),
1713
+ ...c ? s.panelFullscreen : null
1681
1714
  },
1682
1715
  children: [
1683
- /* @__PURE__ */ p("div", { style: a.panelHeader, children: [
1684
- /* @__PURE__ */ p("div", { style: a.panelTitleBlock, children: [
1685
- /* @__PURE__ */ s("div", { style: a.panelTitle, children: "Semaphor Inspector" }),
1686
- /* @__PURE__ */ p("div", { style: a.panelSubtitle, children: [
1687
- d.total,
1716
+ /* @__PURE__ */ p("div", { style: s.panelHeader, children: [
1717
+ /* @__PURE__ */ p("div", { style: s.panelTitleBlock, children: [
1718
+ /* @__PURE__ */ a("div", { style: s.panelTitle, children: "Semaphor Inspector" }),
1719
+ /* @__PURE__ */ p("div", { style: s.panelSubtitle, children: [
1720
+ l.total,
1688
1721
  " queries · ",
1689
- d.loading,
1722
+ l.loading,
1690
1723
  " loading ·",
1691
1724
  " ",
1692
- d.failed,
1725
+ l.failed,
1693
1726
  " failed · ",
1694
- d.errorCount,
1727
+ l.errorCount,
1695
1728
  " errors ·",
1696
1729
  " ",
1697
- d.warningCount,
1730
+ l.warningCount,
1698
1731
  " warnings"
1699
1732
  ] })
1700
1733
  ] }),
1701
- /* @__PURE__ */ p("div", { style: a.panelActions, children: [
1702
- /* @__PURE__ */ s(
1734
+ /* @__PURE__ */ p("div", { style: s.panelActions, children: [
1735
+ /* @__PURE__ */ a(
1703
1736
  "button",
1704
1737
  {
1705
1738
  type: "button",
1706
1739
  "aria-label": c ? "Exit fullscreen Semaphor Inspector" : "Enter fullscreen Semaphor Inspector",
1707
1740
  title: c ? "Exit fullscreen Semaphor Inspector" : "Enter fullscreen Semaphor Inspector",
1708
- style: a.iconButton,
1709
- onClick: () => m((y) => !y),
1710
- children: c ? /* @__PURE__ */ s(et, { size: 15 }) : /* @__PURE__ */ s(rt, { size: 15 })
1741
+ style: s.iconButton,
1742
+ onClick: () => y((S) => !S),
1743
+ children: c ? /* @__PURE__ */ a(Zr, { size: 15 }) : /* @__PURE__ */ a(et, { size: 15 })
1711
1744
  }
1712
1745
  ),
1713
- /* @__PURE__ */ s(
1746
+ /* @__PURE__ */ a(
1714
1747
  "button",
1715
1748
  {
1716
1749
  type: "button",
1717
1750
  "aria-label": "Close Semaphor Inspector",
1718
- style: a.iconButton,
1751
+ style: s.iconButton,
1719
1752
  onClick: u.closeDevtools,
1720
- children: /* @__PURE__ */ s(ot, { size: 15 })
1753
+ children: /* @__PURE__ */ a(it, { size: 15 })
1721
1754
  }
1722
1755
  )
1723
1756
  ] })
1724
1757
  ] }),
1725
- /* @__PURE__ */ p("label", { style: a.searchBox, children: [
1726
- /* @__PURE__ */ s(tt, { size: 14 }),
1727
- /* @__PURE__ */ s(
1758
+ /* @__PURE__ */ p("label", { style: s.searchBox, children: [
1759
+ /* @__PURE__ */ a(rt, { size: 14 }),
1760
+ /* @__PURE__ */ a(
1728
1761
  "input",
1729
1762
  {
1730
1763
  "aria-label": "Search Semaphor traces",
1731
1764
  value: f,
1732
- onChange: (y) => l(y.currentTarget.value),
1765
+ onChange: (S) => d(S.currentTarget.value),
1733
1766
  placeholder: "Search traces",
1734
- style: a.searchInput
1767
+ style: s.searchInput
1735
1768
  }
1736
1769
  )
1737
1770
  ] }),
1738
- v.length ? /* @__PURE__ */ s(
1739
- Pt,
1771
+ b.length ? /* @__PURE__ */ a(
1772
+ zt,
1740
1773
  {
1741
- issues: v,
1742
- onSelect: (y) => u.focusTrace({
1743
- traceId: y.traceId,
1744
- queryId: y.queryId,
1745
- viewId: y.viewId
1774
+ issues: b,
1775
+ onSelect: (S) => u.focusTrace({
1776
+ traceId: S.traceId,
1777
+ queryId: S.queryId,
1778
+ viewId: S.viewId
1746
1779
  })
1747
1780
  }
1748
1781
  ) : null,
@@ -1750,34 +1783,34 @@ function Kt({
1750
1783
  "div",
1751
1784
  {
1752
1785
  style: {
1753
- ...a.panelBody,
1754
- ...kt(t)
1786
+ ...s.panelBody,
1787
+ ...At(t)
1755
1788
  },
1756
1789
  children: [
1757
- /* @__PURE__ */ s(
1790
+ /* @__PURE__ */ a(
1758
1791
  "div",
1759
1792
  {
1760
1793
  style: {
1761
- ...a.queryList,
1762
- ...Tt()
1794
+ ...s.queryList,
1795
+ ...Ct()
1763
1796
  },
1764
1797
  "aria-label": "Registered queries",
1765
- children: A.length ? _.map((y) => /* @__PURE__ */ p("div", { style: a.queryGroup, children: [
1766
- /* @__PURE__ */ p("div", { style: a.queryGroupHeader, children: [
1767
- /* @__PURE__ */ s("span", { children: y.title }),
1768
- /* @__PURE__ */ s("span", { style: a.queryGroupCount, children: y.traces.length })
1798
+ children: A.length ? N.map((S) => /* @__PURE__ */ p("div", { style: s.queryGroup, children: [
1799
+ /* @__PURE__ */ p("div", { style: s.queryGroupHeader, children: [
1800
+ /* @__PURE__ */ a("span", { children: S.title }),
1801
+ /* @__PURE__ */ a("span", { style: s.queryGroupCount, children: S.traces.length })
1769
1802
  ] }),
1770
- y.traces.length ? y.traces.map((w) => {
1771
- var oe;
1772
- const R = sn(w, D), x = Ae(w), T = Er(w), N = Rr(w), j = ln(w, x, N), ie = j.join(" · "), C = kr(T), H = ht(v, w);
1803
+ S.traces.length ? S.traces.map((w) => {
1804
+ var ne;
1805
+ const L = an(w, $), x = xe(w), D = kr(w), pe = Er(w), re = ln(w, x, pe), te = re.join(" · "), C = Ar(D), M = yt(b, w);
1773
1806
  return /* @__PURE__ */ p(
1774
1807
  "button",
1775
1808
  {
1776
1809
  type: "button",
1777
- title: `${x} · ${T} · ${ie}`,
1810
+ title: `${x} · ${D} · ${te}`,
1778
1811
  style: {
1779
- ...a.queryListItem,
1780
- ...R ? a.queryListItemSelected : null
1812
+ ...s.queryListItem,
1813
+ ...L ? s.queryListItemSelected : null
1781
1814
  },
1782
1815
  onClick: () => u.focusTrace({
1783
1816
  traceId: w.traceId,
@@ -1785,42 +1818,42 @@ function Kt({
1785
1818
  viewId: w.viewId
1786
1819
  }),
1787
1820
  children: [
1788
- /* @__PURE__ */ p("span", { style: a.queryListItemHeader, children: [
1789
- /* @__PURE__ */ s(zt, { status: (oe = w.latestAttempt) == null ? void 0 : oe.status }),
1790
- /* @__PURE__ */ s("span", { style: a.queryListTitle, title: x, children: x }),
1791
- /* @__PURE__ */ s(
1821
+ /* @__PURE__ */ p("span", { style: s.queryListItemHeader, children: [
1822
+ /* @__PURE__ */ a(Ft, { status: (ne = w.latestAttempt) == null ? void 0 : ne.status }),
1823
+ /* @__PURE__ */ a("span", { style: s.queryListTitle, title: x, children: x }),
1824
+ /* @__PURE__ */ a(
1792
1825
  "span",
1793
1826
  {
1794
1827
  style: {
1795
- ...a.queryListKindChip,
1796
- ...Tr(C)
1828
+ ...s.queryListKindChip,
1829
+ ...Cr(C)
1797
1830
  },
1798
- children: T
1831
+ children: D
1799
1832
  }
1800
1833
  ),
1801
- H > 0 ? /* @__PURE__ */ s("span", { style: a.queryListIssueBadge, children: H }) : null
1834
+ M > 0 ? /* @__PURE__ */ a("span", { style: s.queryListIssueBadge, children: M }) : null
1802
1835
  ] }),
1803
- /* @__PURE__ */ s(
1836
+ /* @__PURE__ */ a(
1804
1837
  "span",
1805
1838
  {
1806
- className: `${P}-source`,
1807
- style: a.queryListSource,
1808
- title: ie,
1809
- children: j.map((se, ae) => /* @__PURE__ */ p(Jr, { children: [
1810
- ae > 0 ? /* @__PURE__ */ s("span", { style: a.queryListSubtitleSep, children: " · " }) : null,
1811
- /* @__PURE__ */ s("span", { children: se })
1812
- ] }, `${se}:${ae}`))
1839
+ className: `${R}-source`,
1840
+ style: s.queryListSource,
1841
+ title: te,
1842
+ children: re.map((ie, oe) => /* @__PURE__ */ p(Gr, { children: [
1843
+ oe > 0 ? /* @__PURE__ */ a("span", { style: s.queryListSubtitleSep, children: " · " }) : null,
1844
+ /* @__PURE__ */ a("span", { children: ie })
1845
+ ] }, `${ie}:${oe}`))
1813
1846
  }
1814
1847
  )
1815
1848
  ]
1816
1849
  },
1817
- Pe(w)
1850
+ Ne(w)
1818
1851
  );
1819
- }) : /* @__PURE__ */ s("div", { style: a.queryGroupEmpty, children: "No input traces" })
1820
- ] }, y.title)) : /* @__PURE__ */ s("div", { style: a.emptyState, children: "No matching traces" })
1852
+ }) : /* @__PURE__ */ a("div", { style: s.queryGroupEmpty, children: "No input traces" })
1853
+ ] }, S.title)) : /* @__PURE__ */ a("div", { style: s.emptyState, children: "No matching traces" })
1821
1854
  }
1822
1855
  ),
1823
- /* @__PURE__ */ s(Nt, { trace: D })
1856
+ /* @__PURE__ */ a(_t, { trace: $ })
1824
1857
  ]
1825
1858
  }
1826
1859
  )
@@ -1829,42 +1862,42 @@ function Kt({
1829
1862
  ) : null
1830
1863
  ] });
1831
1864
  }
1832
- function Vi({
1865
+ function Qi({
1833
1866
  queryId: e,
1834
1867
  viewId: r,
1835
1868
  label: t,
1836
1869
  className: n,
1837
1870
  style: i
1838
1871
  } = {}) {
1839
- var h, S;
1840
- const o = Ar(), u = G(Ve), f = G(Qe);
1841
- W(() => {
1842
- Ir();
1872
+ var m, v;
1873
+ const o = qr(), u = Q(He), f = Q(Ve);
1874
+ B(() => {
1875
+ wr();
1843
1876
  }, []);
1844
- const l = r || (f == null ? void 0 : f.id), c = I(
1845
- () => on(o.queries, {
1877
+ const d = r || (f == null ? void 0 : f.id), c = I(
1878
+ () => sn(o.queries, {
1846
1879
  queryId: e,
1847
- viewId: l
1880
+ viewId: d
1848
1881
  }),
1849
1882
  [
1850
1883
  o.queries,
1851
1884
  e,
1852
- l
1885
+ d
1853
1886
  ]
1854
1887
  );
1855
1888
  if (!o.enabled || !u || !c)
1856
1889
  return null;
1857
- const m = t || `Inspect ${dn(c, !!e)}`;
1890
+ const y = t || `Inspect ${un(c, !!e)}`;
1858
1891
  return /* @__PURE__ */ p(
1859
1892
  "button",
1860
1893
  {
1861
1894
  type: "button",
1862
- "aria-label": m,
1863
- title: m,
1864
- className: n ? `${P} ${n}` : P,
1895
+ "aria-label": y,
1896
+ title: y,
1897
+ className: n ? `${R} ${n}` : R,
1865
1898
  style: {
1866
- ...a.inspectButton,
1867
- ...Et((h = c.latestAttempt) == null ? void 0 : h.status),
1899
+ ...s.inspectButton,
1900
+ ...kt((m = c.latestAttempt) == null ? void 0 : m.status),
1868
1901
  ...i
1869
1902
  },
1870
1903
  onClick: () => u.openDevtools({
@@ -1873,17 +1906,17 @@ function Vi({
1873
1906
  viewId: c.viewId
1874
1907
  }),
1875
1908
  children: [
1876
- /* @__PURE__ */ s(nt, { size: 13 }),
1877
- /* @__PURE__ */ s("span", { style: a.inspectButtonText, children: ((S = c.latestAttempt) == null ? void 0 : S.status) || "idle" })
1909
+ /* @__PURE__ */ a(tt, { size: 13 }),
1910
+ /* @__PURE__ */ a("span", { style: s.inspectButtonText, children: ((v = c.latestAttempt) == null ? void 0 : v.status) || "idle" })
1878
1911
  ]
1879
1912
  }
1880
1913
  );
1881
1914
  }
1882
- function Ar() {
1883
- const e = G(He);
1884
- return !e || !e.state.enabled ? xr : ce(e.state);
1915
+ function qr() {
1916
+ const e = Q(je);
1917
+ return !e || !e.state.enabled ? Ir : le(e.state);
1885
1918
  }
1886
- function Wt({
1919
+ function Kt({
1887
1920
  spec: e,
1888
1921
  queryKind: r,
1889
1922
  queryKey: t,
@@ -1891,167 +1924,167 @@ function Wt({
1891
1924
  activeInputs: i,
1892
1925
  debug: o
1893
1926
  }) {
1894
- const u = G(He), f = G(Qe), l = !!(u != null && u.state.enabled), c = u == null ? void 0 : u.dispatch, m = Bn(e), h = gt(e), S = I(
1927
+ const u = Q(je), f = Q(Ve), d = !!(u != null && u.state.enabled), c = u == null ? void 0 : u.dispatch, y = Kn(e), m = pt(e), v = I(
1895
1928
  () => JSON.stringify(e),
1896
1929
  [e]
1897
1930
  ), g = I(
1898
1931
  () => JSON.stringify(i || []),
1899
1932
  [i]
1900
- ), b = I(
1933
+ ), h = I(
1901
1934
  () => JSON.stringify(n || null),
1902
1935
  [n]
1903
- ), E = L(e), d = L(S), v = L(n), O = L(b), A = L(i), _ = L(g), D = On(o), y = JSON.stringify(D || []), w = L(D), R = L(y);
1904
- d.current !== S && (d.current = S, E.current = e), O.current !== b && (O.current = b, v.current = n), _.current !== g && (_.current = g, A.current = i), R.current !== y && (R.current = y, w.current = D);
1905
- const x = E.current, T = v.current, N = A.current, j = w.current, ie = br(), C = I(
1906
- () => m || `query_${Or(t)}`,
1907
- [t, m]
1908
- ), H = (o == null ? void 0 : o.viewId) || (f == null ? void 0 : f.id), oe = (o == null ? void 0 : o.viewTitle) || (o == null ? void 0 : o.title) || (f == null ? void 0 : f.title), se = o == null ? void 0 : o.visualType, ae = o == null ? void 0 : o.sectionTitle, V = I(
1936
+ ), T = E(e), l = E(v), b = E(n), K = E(h), A = E(i), N = E(g), $ = Bn(o), S = JSON.stringify($ || []), w = E($), L = E(S);
1937
+ l.current !== v && (l.current = v, T.current = e), K.current !== h && (K.current = h, b.current = n), N.current !== g && (N.current = g, A.current = i), L.current !== S && (L.current = S, w.current = $);
1938
+ const x = T.current, D = b.current, pe = A.current, re = w.current, te = hr(), C = I(
1939
+ () => y || `query_${Dr(t)}`,
1940
+ [t, y]
1941
+ ), M = (o == null ? void 0 : o.viewId) || (f == null ? void 0 : f.id), ne = (o == null ? void 0 : o.viewTitle) || (o == null ? void 0 : o.title) || (f == null ? void 0 : f.title), ie = o == null ? void 0 : o.visualType, oe = o == null ? void 0 : o.sectionTitle, j = I(
1909
1942
  () => [
1910
- H || "unscoped-view",
1943
+ M || "unscoped-view",
1911
1944
  C,
1912
- ie
1945
+ te
1913
1946
  ].join("::"),
1914
- [C, ie, H]
1915
- ), Xe = I(
1947
+ [C, te, M]
1948
+ ), Ye = I(
1916
1949
  () => ({
1917
- traceKey: V,
1950
+ traceKey: j,
1918
1951
  spec: x,
1919
1952
  queryId: C,
1920
- queryLabel: h,
1953
+ queryLabel: m,
1921
1954
  queryKind: r,
1922
- builder: Kn(r),
1923
- viewId: H,
1924
- viewTitle: oe,
1925
- visualType: se,
1926
- sectionTitle: ae,
1927
- sourceHints: j,
1928
- intent: T,
1929
- activeInputs: N,
1930
- clientWarnings: m ? [] : ["Query spec is missing an explicit id; using an opaque internal id."]
1955
+ builder: Wn(r),
1956
+ viewId: M,
1957
+ viewTitle: ne,
1958
+ visualType: ie,
1959
+ sectionTitle: oe,
1960
+ sourceHints: re,
1961
+ intent: D,
1962
+ activeInputs: pe,
1963
+ clientWarnings: y ? [] : ["Query spec is missing an explicit id; using an opaque internal id."]
1931
1964
  }),
1932
1965
  [
1933
1966
  C,
1934
1967
  r,
1968
+ y,
1935
1969
  m,
1936
- h,
1937
1970
  x,
1938
- N,
1939
- T,
1940
- j,
1941
- ae,
1942
- V,
1943
- H,
1971
+ pe,
1972
+ D,
1973
+ re,
1944
1974
  oe,
1945
- se
1975
+ j,
1976
+ M,
1977
+ ne,
1978
+ ie
1946
1979
  ]
1947
1980
  );
1948
- W(() => {
1949
- if (!(!l || !c))
1950
- return c({ type: "register", descriptor: Xe }), () => {
1951
- c({ type: "unregister", traceKey: V });
1981
+ B(() => {
1982
+ if (!(!d || !c))
1983
+ return c({ type: "register", descriptor: Ye }), () => {
1984
+ c({ type: "unregister", traceKey: j });
1952
1985
  };
1953
- }, [Xe, c, l, V]);
1954
- const z = $(
1955
- (k, J) => {
1956
- !l || !c || c({ type: "event", traceKey: V, event: k, latestAttempt: J });
1986
+ }, [Ye, c, d, j]);
1987
+ const P = O(
1988
+ (k, U) => {
1989
+ !d || !c || c({ type: "event", traceKey: j, event: k, latestAttempt: U });
1957
1990
  },
1958
- [c, l, V]
1959
- ), Ze = $(() => {
1960
- z(
1991
+ [c, d, j]
1992
+ ), Xe = O(() => {
1993
+ P(
1961
1994
  {
1962
1995
  type: "query_started",
1963
1996
  queryId: C,
1964
- at: Se()
1997
+ at: be()
1965
1998
  },
1966
1999
  { status: "loading" }
1967
2000
  );
1968
- }, [z, C]), er = $(
1969
- (k, J) => {
1970
- const le = fr(k), de = jn(k), Pr = Hn(k);
1971
- z(
2001
+ }, [P, C]), Ze = O(
2002
+ (k, U) => {
2003
+ const se = cr(k), ae = Hn(k), Nr = Vn(k);
2004
+ P(
1972
2005
  {
1973
2006
  type: "query_succeeded",
1974
2007
  queryId: C,
1975
- requestId: le,
1976
- at: Se(),
1977
- rowCount: de,
1978
- durationMs: J
2008
+ requestId: se,
2009
+ at: be(),
2010
+ rowCount: ae,
2011
+ durationMs: U
1979
2012
  },
1980
2013
  {
1981
- requestId: le,
2014
+ requestId: se,
1982
2015
  status: "success",
1983
- durationMs: J,
1984
- rowCount: de,
1985
- columnCount: Pr,
1986
- executionResult: cr(k)
2016
+ durationMs: U,
2017
+ rowCount: ae,
2018
+ columnCount: Nr,
2019
+ executionResult: ur(k)
1987
2020
  }
1988
2021
  );
1989
2022
  },
1990
- [z, C]
1991
- ), me = $(
1992
- (k, J) => {
1993
- const le = fr(k), de = k instanceof Error ? k.message : String(k);
1994
- z(
2023
+ [P, C]
2024
+ ), ge = O(
2025
+ (k, U) => {
2026
+ const se = cr(k), ae = k instanceof Error ? k.message : String(k);
2027
+ P(
1995
2028
  {
1996
2029
  type: "query_failed",
1997
2030
  queryId: C,
1998
- requestId: le,
1999
- at: Se(),
2000
- errorMessage: de
2031
+ requestId: se,
2032
+ at: be(),
2033
+ errorMessage: ae
2001
2034
  },
2002
2035
  {
2003
- requestId: le,
2036
+ requestId: se,
2004
2037
  status: "error",
2005
- durationMs: J,
2006
- errorMessage: de,
2007
- executionResult: cr(k)
2038
+ durationMs: U,
2039
+ errorMessage: ae,
2040
+ executionResult: ur(k)
2008
2041
  }
2009
2042
  );
2010
2043
  },
2011
- [z, C]
2012
- ), rr = $(
2044
+ [P, C]
2045
+ ), er = O(
2013
2046
  (k) => {
2014
- z(
2047
+ P(
2015
2048
  {
2016
2049
  type: "query_ignored_stale",
2017
2050
  queryId: C,
2018
- at: Se(),
2051
+ at: be(),
2019
2052
  reason: k
2020
2053
  }
2021
2054
  );
2022
2055
  },
2023
- [z, C]
2024
- ), tr = $(
2056
+ [P, C]
2057
+ ), rr = O(
2025
2058
  (k) => {
2026
- me(k, 0);
2059
+ ge(k, 0);
2027
2060
  },
2028
- [me]
2029
- ), Te = l ? u == null ? void 0 : u.state.entries[V] : void 0;
2061
+ [ge]
2062
+ ), Ae = d ? u == null ? void 0 : u.state.entries[j] : void 0;
2030
2063
  return I(
2031
2064
  () => ({
2032
- enabled: l,
2065
+ enabled: d,
2033
2066
  queryId: C,
2034
- trace: Te ? we(Te) : void 0,
2035
- start: Ze,
2036
- success: er,
2037
- failure: me,
2038
- ignored: rr,
2039
- validationFailure: tr
2067
+ trace: Ae ? ve(Ae) : void 0,
2068
+ start: Xe,
2069
+ success: Ze,
2070
+ failure: ge,
2071
+ ignored: er,
2072
+ validationFailure: rr
2040
2073
  }),
2041
2074
  [
2042
- l,
2043
- me,
2044
- rr,
2075
+ d,
2076
+ ge,
2077
+ er,
2045
2078
  C,
2079
+ Xe,
2046
2080
  Ze,
2047
- er,
2048
- Te,
2049
- tr
2081
+ Ae,
2082
+ rr
2050
2083
  ]
2051
2084
  );
2052
2085
  }
2053
- function _t() {
2054
- return /* @__PURE__ */ s("span", { style: a.logoMark, "aria-hidden": !0, children: /* @__PURE__ */ p(
2086
+ function Wt() {
2087
+ return /* @__PURE__ */ a("span", { style: s.logoMark, "aria-hidden": !0, children: /* @__PURE__ */ p(
2055
2088
  "svg",
2056
2089
  {
2057
2090
  viewBox: "0 0 100 100",
@@ -2060,277 +2093,332 @@ function _t() {
2060
2093
  height: "16",
2061
2094
  focusable: "false",
2062
2095
  children: [
2063
- /* @__PURE__ */ s("rect", { x: "20", y: "15", width: "60", height: "12", rx: "6", fill: "currentColor" }),
2064
- /* @__PURE__ */ s("rect", { x: "20", y: "35", width: "40", height: "12", rx: "6", fill: "currentColor" }),
2065
- /* @__PURE__ */ s("rect", { x: "40", y: "55", width: "40", height: "12", rx: "6", fill: "currentColor" }),
2066
- /* @__PURE__ */ s("rect", { x: "20", y: "75", width: "60", height: "12", rx: "6", fill: "currentColor" })
2096
+ /* @__PURE__ */ a("rect", { x: "20", y: "15", width: "60", height: "12", rx: "6", fill: "currentColor" }),
2097
+ /* @__PURE__ */ a("rect", { x: "20", y: "35", width: "40", height: "12", rx: "6", fill: "currentColor" }),
2098
+ /* @__PURE__ */ a("rect", { x: "40", y: "55", width: "40", height: "12", rx: "6", fill: "currentColor" }),
2099
+ /* @__PURE__ */ a("rect", { x: "20", y: "75", width: "60", height: "12", rx: "6", fill: "currentColor" })
2067
2100
  ]
2068
2101
  }
2069
2102
  ) });
2070
2103
  }
2071
- function Nt({
2104
+ function _t({
2072
2105
  trace: e
2073
2106
  }) {
2074
- var D, y, w, R, x, T;
2107
+ var $, S, w, L, x;
2075
2108
  if (!e)
2076
- return /* @__PURE__ */ s("div", { style: a.detailsPane, children: /* @__PURE__ */ s("div", { style: a.emptyState, children: "No traces registered yet" }) });
2109
+ return /* @__PURE__ */ a("div", { style: s.detailsPane, children: /* @__PURE__ */ a("div", { style: s.emptyState, children: "No traces registered yet" }) });
2077
2110
  const r = e.latestAttempt, t = r == null ? void 0 : r.executionResult, n = $e(
2078
- (D = t == null ? void 0 : t.validation) == null ? void 0 : D.warnings
2079
- ), i = $e((y = t == null ? void 0 : t.validation) == null ? void 0 : y.errors), o = In(
2111
+ ($ = t == null ? void 0 : t.validation) == null ? void 0 : $.warnings
2112
+ ), i = $e((S = t == null ? void 0 : t.validation) == null ? void 0 : S.errors), o = xn(
2080
2113
  (w = t == null ? void 0 : t.coverage) == null ? void 0 : w.missingObligations
2081
2114
  ), u = $e(
2082
- (R = t == null ? void 0 : t.coverage) == null ? void 0 : R.warnings
2083
- ), f = t == null ? void 0 : t.compiledQuery, l = An(t), c = ((x = e.server) == null ? void 0 : x.compiledSql) || l.compiledSql, m = dt(t), h = [
2115
+ (L = t == null ? void 0 : t.coverage) == null ? void 0 : L.warnings
2116
+ ), f = t == null ? void 0 : t.compiledQuery, d = An(t), c = ((x = e.server) == null ? void 0 : x.compiledSql) || d.compiledSql, y = dt(t), m = [
2084
2117
  ...r != null && r.errorMessage ? [r.errorMessage] : [],
2085
2118
  ...i
2086
- ], S = [
2119
+ ], v = [
2087
2120
  ...e.clientWarnings,
2088
2121
  ...n,
2089
2122
  ...o,
2090
2123
  ...u
2091
- ], g = e.inputsApplied.length > 0, b = !!(f || c), E = fn(e), d = yn(r == null ? void 0 : r.rowCount), v = hn(r == null ? void 0 : r.durationMs), O = e.sourceRefs.length, A = Er(e), _ = kr(A);
2092
- return /* @__PURE__ */ p("div", { style: a.detailsPane, children: [
2093
- /* @__PURE__ */ p("div", { style: a.detailsHeader, children: [
2094
- /* @__PURE__ */ p("div", { style: a.detailsHeaderTopRow, children: [
2095
- /* @__PURE__ */ s(
2124
+ ], g = e.inputsApplied.length > 0, h = !!(f || c), T = pn(e), l = hn(r == null ? void 0 : r.rowCount), b = bn(r == null ? void 0 : r.durationMs), K = e.sourceRefs.length, A = kr(e), N = Ar(A);
2125
+ return /* @__PURE__ */ p("div", { style: s.detailsPane, children: [
2126
+ /* @__PURE__ */ p("div", { style: s.detailsHeader, children: [
2127
+ /* @__PURE__ */ p("div", { style: s.detailsHeaderTopRow, children: [
2128
+ /* @__PURE__ */ a(
2096
2129
  "span",
2097
2130
  {
2098
2131
  "aria-hidden": !0,
2099
2132
  style: {
2100
- ...a.detailsHeaderStatusDot,
2101
- ...wr(r == null ? void 0 : r.status)
2133
+ ...s.detailsHeaderStatusDot,
2134
+ ...Sr(r == null ? void 0 : r.status)
2102
2135
  }
2103
2136
  }
2104
2137
  ),
2105
- /* @__PURE__ */ s("span", { style: a.detailsTitle, children: Ae(e) }),
2106
- /* @__PURE__ */ s(
2138
+ /* @__PURE__ */ a("span", { style: s.detailsTitle, children: xe(e) }),
2139
+ /* @__PURE__ */ a(
2107
2140
  "span",
2108
2141
  {
2109
2142
  style: {
2110
- ...a.detailsKindChip,
2111
- ...Tr(_)
2143
+ ...s.detailsKindChip,
2144
+ ...Cr(N)
2112
2145
  },
2113
2146
  children: A
2114
2147
  }
2115
2148
  )
2116
2149
  ] }),
2117
- /* @__PURE__ */ p("div", { style: a.metaStrip, children: [
2118
- /* @__PURE__ */ s("span", { style: a.metaStripItem, children: E }),
2119
- /* @__PURE__ */ s("span", { style: a.metaStripDot, children: "·" }),
2120
- /* @__PURE__ */ p("span", { style: a.metaStripItem, children: [
2121
- d,
2150
+ /* @__PURE__ */ p("div", { style: s.metaStrip, children: [
2151
+ /* @__PURE__ */ a("span", { style: s.metaStripItem, children: T }),
2152
+ /* @__PURE__ */ a("span", { style: s.metaStripDot, children: "·" }),
2153
+ /* @__PURE__ */ p("span", { style: s.metaStripItem, children: [
2154
+ l,
2122
2155
  " rows"
2123
2156
  ] }),
2124
- /* @__PURE__ */ s("span", { style: a.metaStripDot, children: "·" }),
2125
- /* @__PURE__ */ s("span", { style: a.metaStripItem, children: v }),
2126
- O > 0 ? /* @__PURE__ */ p(hr, { children: [
2127
- /* @__PURE__ */ s("span", { style: a.metaStripDot, children: "·" }),
2128
- /* @__PURE__ */ s("span", { style: a.metaStripItem, children: O === 1 ? "1 source" : `${O} sources` })
2157
+ /* @__PURE__ */ a("span", { style: s.metaStripDot, children: "·" }),
2158
+ /* @__PURE__ */ a("span", { style: s.metaStripItem, children: b }),
2159
+ K > 0 ? /* @__PURE__ */ p(yr, { children: [
2160
+ /* @__PURE__ */ a("span", { style: s.metaStripDot, children: "·" }),
2161
+ /* @__PURE__ */ a("span", { style: s.metaStripItem, children: K === 1 ? "1 source" : `${K} sources` })
2129
2162
  ] }) : null
2130
2163
  ] })
2131
2164
  ] }),
2132
- h.length ? /* @__PURE__ */ s(sr, { tone: "error", title: "Error", items: h }) : null,
2133
- S.length ? /* @__PURE__ */ s(sr, { tone: "warning", title: "Warnings", items: S }) : null,
2134
- /* @__PURE__ */ s(Ft, { trace: e }),
2135
- /* @__PURE__ */ s(Ht, { trace: e }),
2136
- (T = e.sourceHints) != null && T.length ? /* @__PURE__ */ s(Vt, { hints: e.sourceHints }) : null,
2137
- g ? /* @__PURE__ */ s(Jt, { inputs: e.inputsApplied }) : null,
2138
- m ? /* @__PURE__ */ s(ee, { title: "Returned Data", defaultOpen: !0, children: /* @__PURE__ */ s(Yt, { preview: m }) }) : null,
2139
- b ? /* @__PURE__ */ s(ee, { title: "Compiled Query", defaultOpen: !0, children: /* @__PURE__ */ s(
2140
- Xt,
2165
+ m.length ? /* @__PURE__ */ a(or, { tone: "error", title: "Error", items: m }) : null,
2166
+ v.length ? /* @__PURE__ */ a(or, { tone: "warning", title: "Warnings", items: v }) : null,
2167
+ /* @__PURE__ */ a(Mt, { trace: e }),
2168
+ g ? /* @__PURE__ */ a(Yt, { inputs: e.inputsApplied }) : null,
2169
+ /* @__PURE__ */ a(
2170
+ Nt,
2141
2171
  {
2172
+ trace: e,
2173
+ resultPreview: y,
2142
2174
  compiledQuery: f,
2143
- compiledSql: c
2175
+ compiledSql: c,
2176
+ hasCompiled: h
2144
2177
  }
2145
- ) }) : null,
2146
- /* @__PURE__ */ s(ee, { title: "Lifecycle Events", children: e.recentEvents.length ? /* @__PURE__ */ s("div", { style: a.eventList, children: e.recentEvents.slice(-5).map((N, j) => /* @__PURE__ */ p(
2147
- "div",
2178
+ )
2179
+ ] });
2180
+ }
2181
+ function Nt({
2182
+ trace: e,
2183
+ resultPreview: r,
2184
+ compiledQuery: t,
2185
+ compiledSql: n,
2186
+ hasCompiled: i
2187
+ }) {
2188
+ var h, T;
2189
+ const o = [];
2190
+ r && o.push({
2191
+ id: "returned",
2192
+ label: "Returned",
2193
+ render: () => /* @__PURE__ */ a(Xt, { preview: r })
2194
+ }), i && o.push({
2195
+ id: "compiled",
2196
+ label: "Compiled",
2197
+ render: () => /* @__PURE__ */ a(
2198
+ Zt,
2148
2199
  {
2149
- style: a.eventRow,
2150
- children: [
2151
- /* @__PURE__ */ s("span", { style: a.eventType, children: vn(N) }),
2152
- /* @__PURE__ */ s("span", { style: a.eventMeta, children: Sn(N) })
2153
- ]
2154
- },
2155
- `${N.type}:${N.at}:${j}`
2156
- )) }) : /* @__PURE__ */ s("div", { style: a.mutedText, children: "No attempts recorded" }) }),
2157
- /* @__PURE__ */ s(ee, { title: "Raw Trace", children: /* @__PURE__ */ s("pre", { style: a.codeBlock, children: bn(e) }) })
2200
+ compiledQuery: t,
2201
+ compiledSql: n
2202
+ }
2203
+ )
2204
+ }), (e.sourceRefs.length || e.fieldRefs.length) && o.push({
2205
+ id: "lineage",
2206
+ label: "Sources",
2207
+ render: () => /* @__PURE__ */ a(Vt, { trace: e })
2208
+ }), (h = e.sourceHints) != null && h.length && o.push({
2209
+ id: "hints",
2210
+ label: "Hints",
2211
+ render: () => /* @__PURE__ */ a(Qt, { hints: e.sourceHints ?? [] })
2212
+ }), o.push({
2213
+ id: "lifecycle",
2214
+ label: "Lifecycle",
2215
+ render: () => /* @__PURE__ */ a(Pt, { trace: e })
2216
+ }), o.push({
2217
+ id: "raw",
2218
+ label: "Raw",
2219
+ render: () => /* @__PURE__ */ a("pre", { style: s.codeBlock, children: vn(e) })
2220
+ });
2221
+ const u = (T = o[0]) == null ? void 0 : T.id, f = e.traceId || `${e.viewId ?? ""}:${e.queryId}`, [d, c] = F(u), y = E(f), m = E(!1), v = o.map((l) => l.id).join("|");
2222
+ B(() => {
2223
+ if (y.current !== f) {
2224
+ y.current = f, m.current = !1, c(u);
2225
+ return;
2226
+ }
2227
+ if (!(d ? v.split("|").includes(d) : !1)) {
2228
+ m.current = !1, c(u);
2229
+ return;
2230
+ }
2231
+ !m.current && d !== u && c(u);
2232
+ }, [d, u, v, f]);
2233
+ const g = o.find((l) => l.id === d) ?? o[0];
2234
+ return /* @__PURE__ */ p("div", { style: s.traceTabs, children: [
2235
+ /* @__PURE__ */ a("div", { style: s.traceTabBar, role: "tablist", "aria-label": "Trace details", children: o.map((l) => {
2236
+ const b = l.id === g.id;
2237
+ return /* @__PURE__ */ a(
2238
+ "button",
2239
+ {
2240
+ type: "button",
2241
+ role: "tab",
2242
+ "aria-selected": b,
2243
+ className: `${R}-tab`,
2244
+ style: {
2245
+ ...s.traceTab,
2246
+ ...b ? s.traceTabActive : null
2247
+ },
2248
+ onClick: () => {
2249
+ m.current = !0, c(l.id);
2250
+ },
2251
+ children: l.label
2252
+ },
2253
+ l.id
2254
+ );
2255
+ }) }),
2256
+ /* @__PURE__ */ a("div", { style: s.traceTabPanel, role: "tabpanel", children: g.render() })
2158
2257
  ] });
2159
2258
  }
2160
- function sr({
2259
+ function Pt({
2260
+ trace: e
2261
+ }) {
2262
+ return e.recentEvents.length ? /* @__PURE__ */ a("div", { style: s.eventList, children: e.recentEvents.slice(-5).map((r, t) => /* @__PURE__ */ p("div", { style: s.eventRow, children: [
2263
+ /* @__PURE__ */ a("span", { style: s.eventType, children: Sn(r) }),
2264
+ /* @__PURE__ */ a("span", { style: s.eventMeta, children: wn(r) })
2265
+ ] }, `${r.type}:${r.at}:${t}`)) }) : /* @__PURE__ */ a("div", { style: s.mutedText, children: "No attempts recorded" });
2266
+ }
2267
+ function or({
2161
2268
  tone: e,
2162
2269
  title: r,
2163
2270
  items: t
2164
2271
  }) {
2165
- const n = e === "error" ? a.alertCardError : a.alertCardWarning;
2166
- return /* @__PURE__ */ p("div", { style: { ...a.alertCard, ...n }, children: [
2167
- /* @__PURE__ */ s("div", { style: a.alertCardTitle, children: r }),
2168
- t.length > 1 ? /* @__PURE__ */ s("ul", { style: a.alertCardList, children: t.map((i, o) => /* @__PURE__ */ s("li", { children: i }, `${e}-${o}`)) }) : /* @__PURE__ */ s("div", { children: t[0] })
2272
+ const n = e === "error" ? s.alertCardError : s.alertCardWarning;
2273
+ return /* @__PURE__ */ p("div", { style: { ...s.alertCard, ...n }, children: [
2274
+ /* @__PURE__ */ a("div", { style: s.alertCardTitle, children: r }),
2275
+ t.length > 1 ? /* @__PURE__ */ a("ul", { style: s.alertCardList, children: t.map((i, o) => /* @__PURE__ */ a("li", { children: i }, `${e}-${o}`)) }) : /* @__PURE__ */ a("div", { children: t[0] })
2169
2276
  ] });
2170
2277
  }
2171
- function Pt({
2278
+ function zt({
2172
2279
  issues: e,
2173
2280
  onSelect: r
2174
2281
  }) {
2175
- const [t, n] = M(!1), i = e.slice(0, 6), o = e.length - i.length, u = e.filter((c) => c.tone === "error").length, f = e.length - u, l = [
2282
+ const [t, n] = F(!1), i = e.slice(0, 6), o = e.length - i.length, u = e.filter((c) => c.tone === "error").length, f = e.length - u, d = [
2176
2283
  u ? `${u} error${u === 1 ? "" : "s"}` : "",
2177
2284
  f ? `${f} warning${f === 1 ? "" : "s"}` : ""
2178
2285
  ].filter(Boolean);
2179
- return /* @__PURE__ */ p("section", { style: a.issueSummary, "aria-label": "Semaphor trace issues", children: [
2286
+ return /* @__PURE__ */ p("section", { style: s.issueSummary, "aria-label": "Semaphor trace issues", children: [
2180
2287
  /* @__PURE__ */ p(
2181
2288
  "button",
2182
2289
  {
2183
2290
  type: "button",
2184
2291
  "aria-expanded": t,
2185
- style: a.issueSummaryToggle,
2292
+ style: s.issueSummaryToggle,
2186
2293
  onClick: () => n((c) => !c),
2187
2294
  children: [
2188
- /* @__PURE__ */ p("span", { style: a.issueSummaryHeaderLabel, children: [
2189
- t ? /* @__PURE__ */ s(st, { size: 13 }) : /* @__PURE__ */ s(it, { size: 13 }),
2190
- /* @__PURE__ */ s("span", { children: "Issues" })
2295
+ /* @__PURE__ */ p("span", { style: s.issueSummaryHeaderLabel, children: [
2296
+ t ? /* @__PURE__ */ a(ot, { size: 13 }) : /* @__PURE__ */ a(nt, { size: 13 }),
2297
+ /* @__PURE__ */ a("span", { children: "Issues" })
2191
2298
  ] }),
2192
- /* @__PURE__ */ s("span", { style: a.issueSummaryCount, children: e.length })
2299
+ /* @__PURE__ */ a("span", { style: s.issueSummaryCount, children: e.length })
2193
2300
  ]
2194
2301
  }
2195
2302
  ),
2196
- t ? /* @__PURE__ */ p("div", { style: a.issueSummaryList, children: [
2197
- i.map((c, m) => /* @__PURE__ */ p(
2303
+ t ? /* @__PURE__ */ p("div", { style: s.issueSummaryList, children: [
2304
+ i.map((c, y) => /* @__PURE__ */ p(
2198
2305
  "button",
2199
2306
  {
2200
2307
  type: "button",
2201
2308
  title: `${c.title}: ${c.message}`,
2202
- style: a.issueSummaryItem,
2309
+ style: s.issueSummaryItem,
2203
2310
  onClick: () => r(c.trace),
2204
2311
  children: [
2205
- /* @__PURE__ */ s(
2312
+ /* @__PURE__ */ a(
2206
2313
  "span",
2207
2314
  {
2208
2315
  style: {
2209
- ...a.issueSummaryBadge,
2210
- ...c.tone === "error" ? a.issueSummaryBadgeError : a.issueSummaryBadgeWarning
2316
+ ...s.issueSummaryBadge,
2317
+ ...c.tone === "error" ? s.issueSummaryBadgeError : s.issueSummaryBadgeWarning
2211
2318
  },
2212
2319
  children: c.tone === "error" ? "Error" : "Warning"
2213
2320
  }
2214
2321
  ),
2215
- /* @__PURE__ */ p("span", { style: a.issueSummaryText, children: [
2216
- /* @__PURE__ */ s("span", { style: a.issueSummaryTitle, children: c.title }),
2217
- /* @__PURE__ */ s("span", { style: a.issueSummaryMessage, children: c.message })
2322
+ /* @__PURE__ */ p("span", { style: s.issueSummaryText, children: [
2323
+ /* @__PURE__ */ a("span", { style: s.issueSummaryTitle, children: c.title }),
2324
+ /* @__PURE__ */ a("span", { style: s.issueSummaryMessage, children: c.message })
2218
2325
  ] })
2219
2326
  ]
2220
2327
  },
2221
- `${c.trace.traceId}:${c.title}:${m}`
2328
+ `${c.trace.traceId}:${c.title}:${y}`
2222
2329
  )),
2223
- o > 0 ? /* @__PURE__ */ p("div", { style: a.issueSummaryMore, children: [
2330
+ o > 0 ? /* @__PURE__ */ p("div", { style: s.issueSummaryMore, children: [
2224
2331
  o,
2225
2332
  " more issue",
2226
2333
  o === 1 ? "" : "s",
2227
2334
  " in traces"
2228
2335
  ] }) : null
2229
- ] }) : /* @__PURE__ */ p("div", { style: a.issueSummaryCollapsed, children: [
2230
- l.join(" · "),
2336
+ ] }) : /* @__PURE__ */ p("div", { style: s.issueSummaryCollapsed, children: [
2337
+ d.join(" · "),
2231
2338
  " across traces"
2232
2339
  ] })
2233
2340
  ] });
2234
2341
  }
2235
- function zt({
2342
+ function Ft({
2236
2343
  status: e
2237
2344
  }) {
2238
- return /* @__PURE__ */ s(
2345
+ return /* @__PURE__ */ a(
2239
2346
  "span",
2240
2347
  {
2241
2348
  "aria-hidden": !0,
2242
2349
  style: {
2243
- ...a.statusDot,
2244
- ...wr(e)
2350
+ ...s.statusDot,
2351
+ ...Sr(e)
2245
2352
  }
2246
2353
  }
2247
2354
  );
2248
2355
  }
2249
- function ee({
2250
- title: e,
2251
- children: r,
2252
- defaultOpen: t = !1
2253
- }) {
2254
- const [n, i] = M(t);
2255
- return /* @__PURE__ */ p(
2256
- "details",
2257
- {
2258
- style: a.disclosure,
2259
- open: n,
2260
- onToggle: (o) => i(o.currentTarget.open),
2261
- children: [
2262
- /* @__PURE__ */ s("summary", { style: a.disclosureSummary, children: e }),
2263
- /* @__PURE__ */ s("div", { style: a.disclosureBody, children: r })
2264
- ]
2265
- }
2266
- );
2267
- }
2268
- function Ft({
2356
+ function Mt({
2269
2357
  trace: e
2270
2358
  }) {
2271
2359
  var i;
2272
- const r = (i = e.projectionFieldRefs) != null && i.length ? e.projectionFieldRefs : e.fieldRefs, t = e.inputFieldRefs || [], n = cn(r);
2273
- return /* @__PURE__ */ p("div", { style: a.recipe, children: [
2274
- /* @__PURE__ */ s(Mt, { sources: e.sourceRefs }),
2275
- /* @__PURE__ */ s(Q, { title: "Measures", fields: n.measures }),
2276
- /* @__PURE__ */ s(Q, { title: "Time fields", fields: n.timeFields }),
2277
- /* @__PURE__ */ s(
2278
- Q,
2360
+ const r = (i = e.projectionFieldRefs) != null && i.length ? e.projectionFieldRefs : e.fieldRefs, t = e.inputFieldRefs || [], n = fn(r);
2361
+ return /* @__PURE__ */ p("div", { style: s.recipe, children: [
2362
+ /* @__PURE__ */ a(jt, { sources: e.sourceRefs }),
2363
+ /* @__PURE__ */ a(H, { title: "Measures", fields: n.measures }),
2364
+ /* @__PURE__ */ a(H, { title: "Time fields", fields: n.timeFields }),
2365
+ /* @__PURE__ */ a(
2366
+ H,
2279
2367
  {
2280
2368
  title: "Dimensions",
2281
2369
  fields: n.dimensions,
2282
2370
  emptyText: "No dimensions selected"
2283
2371
  }
2284
2372
  ),
2285
- /* @__PURE__ */ s(Q, { title: "Identifiers", fields: n.identifiers }),
2286
- /* @__PURE__ */ s(Q, { title: "Other fields", fields: n.other }),
2287
- /* @__PURE__ */ s(Q, { title: "Input bindings", fields: t })
2373
+ /* @__PURE__ */ a(H, { title: "Identifiers", fields: n.identifiers }),
2374
+ /* @__PURE__ */ a(H, { title: "Other fields", fields: n.other }),
2375
+ /* @__PURE__ */ a(H, { title: "Input bindings", fields: t })
2288
2376
  ] });
2289
2377
  }
2290
- function Mt({
2378
+ function jt({
2291
2379
  sources: e
2292
2380
  }) {
2293
- return e.length ? /* @__PURE__ */ p("div", { style: a.recipeGroup, children: [
2294
- /* @__PURE__ */ p("div", { style: a.recipeGroupHeader, children: [
2295
- /* @__PURE__ */ s("span", { style: a.recipeGroupTitle, children: "From" }),
2296
- /* @__PURE__ */ s("span", { style: a.recipeGroupCount, children: e.length })
2381
+ return e.length ? /* @__PURE__ */ p("div", { style: s.recipeGroup, children: [
2382
+ /* @__PURE__ */ p("div", { style: s.recipeGroupHeader, children: [
2383
+ /* @__PURE__ */ a("span", { style: s.recipeGroupTitle, children: "From" }),
2384
+ /* @__PURE__ */ a("span", { style: s.recipeGroupCount, children: e.length })
2297
2385
  ] }),
2298
- /* @__PURE__ */ s("div", { style: a.sourcePillRow, children: e.map((r, t) => /* @__PURE__ */ s(
2299
- jt,
2386
+ /* @__PURE__ */ a("div", { style: s.sourcePillRow, children: e.map((r, t) => /* @__PURE__ */ a(
2387
+ Ht,
2300
2388
  {
2301
2389
  source: r
2302
2390
  },
2303
- `${F(r)}:${t}`
2391
+ `${z(r)}:${t}`
2304
2392
  )) })
2305
2393
  ] }) : null;
2306
2394
  }
2307
- function jt({ source: e }) {
2308
- const r = F(e);
2309
- return /* @__PURE__ */ p("span", { style: a.sourcePill, title: r, children: [
2310
- /* @__PURE__ */ s("span", { style: a.sourcePillLabel, children: r }),
2311
- /* @__PURE__ */ s("span", { style: a.sourcePillRole, children: e.kind })
2395
+ function Ht({ source: e }) {
2396
+ const r = z(e);
2397
+ return /* @__PURE__ */ p("span", { style: s.sourcePill, title: r, children: [
2398
+ /* @__PURE__ */ a("span", { style: s.sourcePillLabel, children: r }),
2399
+ /* @__PURE__ */ a("span", { style: s.sourcePillRole, children: e.kind })
2312
2400
  ] });
2313
2401
  }
2314
- function Ht({
2402
+ function Vt({
2315
2403
  trace: e
2316
2404
  }) {
2317
- return !e.sourceRefs.length && !e.fieldRefs.length ? null : /* @__PURE__ */ s(ee, { title: "Sources and field refs", children: /* @__PURE__ */ p("div", { style: a.traceLineage, children: [
2318
- /* @__PURE__ */ s(Qt, { sources: e.sourceRefs }),
2319
- /* @__PURE__ */ s(
2320
- Q,
2405
+ return /* @__PURE__ */ p("div", { style: s.traceLineage, children: [
2406
+ /* @__PURE__ */ a(Ut, { sources: e.sourceRefs }),
2407
+ /* @__PURE__ */ a(
2408
+ H,
2321
2409
  {
2322
2410
  title: "All field refs",
2323
2411
  fields: e.fieldRefs,
2324
2412
  emptyText: "No field refs captured"
2325
2413
  }
2326
2414
  )
2327
- ] }) });
2415
+ ] });
2328
2416
  }
2329
- function Vt({
2417
+ function Qt({
2330
2418
  hints: e
2331
2419
  }) {
2332
- return /* @__PURE__ */ s(ee, { title: "Source hints", children: /* @__PURE__ */ s("div", { style: a.recipeFieldList, children: e.map((r, t) => {
2333
- const n = mn(r), i = r.component || r.exportName || n || "Source hint", o = [
2420
+ return /* @__PURE__ */ a("div", { style: s.recipeFieldList, children: e.map((r, t) => {
2421
+ const n = yn(r), i = r.component || r.exportName || n || "Source hint", o = [
2334
2422
  r.exportName && r.exportName !== i ? r.exportName : void 0,
2335
2423
  n,
2336
2424
  r.note
@@ -2338,74 +2426,82 @@ function Vt({
2338
2426
  return /* @__PURE__ */ p(
2339
2427
  "div",
2340
2428
  {
2341
- style: a.recipeFieldRow,
2429
+ style: s.recipeFieldRow,
2342
2430
  title: o || i,
2343
2431
  children: [
2344
- /* @__PURE__ */ s("span", { style: a.recipeFieldName, children: i }),
2345
- o ? /* @__PURE__ */ s("span", { style: a.recipeFieldMeta, children: o }) : null
2432
+ /* @__PURE__ */ a("span", { style: s.recipeFieldName, children: i }),
2433
+ o ? /* @__PURE__ */ a("span", { style: s.recipeFieldMeta, children: o }) : null
2346
2434
  ]
2347
2435
  },
2348
2436
  `${i}:${n}:${t}`
2349
2437
  );
2350
- }) }) });
2438
+ }) });
2351
2439
  }
2352
- function Qt({
2440
+ function Ut({
2353
2441
  sources: e
2354
2442
  }) {
2355
- return /* @__PURE__ */ p("div", { style: a.recipeGroup, children: [
2356
- /* @__PURE__ */ p("div", { style: a.recipeGroupHeader, children: [
2357
- /* @__PURE__ */ s("span", { style: a.recipeGroupTitle, children: "Sources" }),
2358
- /* @__PURE__ */ s("span", { style: a.recipeGroupCount, children: e.length })
2443
+ return /* @__PURE__ */ p("div", { style: s.recipeGroup, children: [
2444
+ /* @__PURE__ */ p("div", { style: s.recipeGroupHeader, children: [
2445
+ /* @__PURE__ */ a("span", { style: s.recipeGroupTitle, children: "Sources" }),
2446
+ /* @__PURE__ */ a("span", { style: s.recipeGroupCount, children: e.length })
2359
2447
  ] }),
2360
- e.length ? /* @__PURE__ */ s("div", { style: a.recipeFieldList, children: e.map((r, t) => /* @__PURE__ */ p(
2448
+ e.length ? /* @__PURE__ */ a("div", { style: s.recipeFieldList, children: e.map((r, t) => /* @__PURE__ */ p(
2361
2449
  "div",
2362
2450
  {
2363
- style: a.recipeFieldRow,
2364
- title: F(r),
2451
+ style: s.recipeFieldRow,
2452
+ title: z(r),
2365
2453
  children: [
2366
- /* @__PURE__ */ s("span", { style: a.recipeFieldName, children: F(r) }),
2367
- /* @__PURE__ */ s("span", { style: a.recipeFieldMeta, children: r.kind })
2454
+ /* @__PURE__ */ a("span", { style: s.recipeFieldName, children: z(r) }),
2455
+ /* @__PURE__ */ a("span", { style: s.recipeFieldMeta, children: r.kind })
2368
2456
  ]
2369
2457
  },
2370
- `${F(r)}:${t}`
2371
- )) }) : /* @__PURE__ */ s("div", { style: a.recipeEmptyText, children: "No sources captured" })
2458
+ `${z(r)}:${t}`
2459
+ )) }) : /* @__PURE__ */ a("div", { style: s.recipeEmptyText, children: "No sources captured" })
2372
2460
  ] });
2373
2461
  }
2374
- function Q({
2462
+ function H({
2375
2463
  title: e,
2376
2464
  fields: r,
2377
2465
  emptyText: t
2378
2466
  }) {
2379
- return !r.length && !t ? null : /* @__PURE__ */ p("div", { style: a.recipeGroup, children: [
2380
- /* @__PURE__ */ p("div", { style: a.recipeGroupHeader, children: [
2381
- /* @__PURE__ */ s("span", { style: a.recipeGroupTitle, children: e }),
2382
- /* @__PURE__ */ s("span", { style: a.recipeGroupCount, children: r.length })
2467
+ return !r.length && !t ? null : /* @__PURE__ */ p("div", { style: s.recipeGroup, children: [
2468
+ /* @__PURE__ */ p("div", { style: s.recipeGroupHeader, children: [
2469
+ /* @__PURE__ */ a("span", { style: s.recipeGroupTitle, children: e }),
2470
+ /* @__PURE__ */ a("span", { style: s.recipeGroupCount, children: r.length })
2383
2471
  ] }),
2384
- r.length ? /* @__PURE__ */ s("div", { style: a.fieldChipList, children: r.map((n, i) => /* @__PURE__ */ s(
2385
- Ut,
2472
+ r.length ? /* @__PURE__ */ a("div", { style: s.fieldChipList, children: r.map((n, i) => /* @__PURE__ */ a(
2473
+ Gt,
2386
2474
  {
2387
2475
  field: n,
2388
2476
  groupTitle: e
2389
2477
  },
2390
- `${Ue(n)}:${i}`
2391
- )) }) : /* @__PURE__ */ s("div", { style: a.recipeEmptyText, children: t })
2478
+ `${Qe(n)}:${i}`
2479
+ )) }) : /* @__PURE__ */ a("div", { style: s.recipeEmptyText, children: t })
2392
2480
  ] });
2393
2481
  }
2394
- function Ut({
2482
+ function Gt({
2395
2483
  field: e,
2396
2484
  groupTitle: r
2397
2485
  }) {
2398
- const t = pn(e), n = e.label || e.name, i = e.dataType && e.dataType !== "unknown" ? e.dataType : void 0, o = e.source ? F(e.source) : void 0, u = [t, i, o].filter(Boolean).join(" · "), f = Gt(e, r);
2399
- return /* @__PURE__ */ p("div", { style: a.fieldChip, title: u, children: [
2400
- /* @__PURE__ */ s("span", { style: { ...a.fieldGlyph, ...f.style }, children: f.text }),
2401
- e.aggregate ? /* @__PURE__ */ s("span", { style: a.fieldAggBadge, children: e.aggregate }) : null,
2402
- /* @__PURE__ */ s("span", { style: a.fieldChipName, children: n }),
2403
- i ? /* @__PURE__ */ s("span", { style: a.fieldChipMeta, children: i }) : null,
2404
- i && o ? /* @__PURE__ */ s("span", { style: a.fieldChipMetaDot, children: "·" }) : null,
2405
- o ? /* @__PURE__ */ s("span", { style: a.fieldChipMeta, children: o }) : null
2406
- ] });
2486
+ const t = gn(e), n = e.label || e.name, i = e.dataType && e.dataType !== "unknown" ? e.dataType : void 0, o = e.source ? z(e.source) : void 0, u = [t, i, o].filter(Boolean).join(" · "), f = Jt(e, r);
2487
+ return /* @__PURE__ */ p(
2488
+ "div",
2489
+ {
2490
+ className: `${R}-field-row`,
2491
+ style: s.fieldChip,
2492
+ title: u,
2493
+ children: [
2494
+ /* @__PURE__ */ a("span", { style: { ...s.fieldGlyph, ...f.style }, children: f.text }),
2495
+ e.aggregate ? /* @__PURE__ */ a("span", { style: s.fieldAggBadge, children: e.aggregate }) : null,
2496
+ /* @__PURE__ */ a("span", { style: s.fieldChipName, children: n }),
2497
+ i ? /* @__PURE__ */ a("span", { style: s.fieldChipMeta, children: i }) : null,
2498
+ i && o ? /* @__PURE__ */ a("span", { style: s.fieldChipMetaDot, children: "·" }) : null,
2499
+ o ? /* @__PURE__ */ a("span", { style: s.fieldChipMeta, children: o }) : null
2500
+ ]
2501
+ }
2502
+ );
2407
2503
  }
2408
- function Gt(e, r) {
2504
+ function Jt(e, r) {
2409
2505
  const t = e.dataType, n = e.role;
2410
2506
  return !!e.aggregate || n === "measure" || r === "Measures" ? {
2411
2507
  text: "Σ",
@@ -2444,29 +2540,29 @@ function Gt(e, r) {
2444
2540
  }
2445
2541
  };
2446
2542
  }
2447
- function Jt({
2543
+ function Yt({
2448
2544
  inputs: e
2449
2545
  }) {
2450
- return /* @__PURE__ */ p("div", { style: a.inputsAppliedBlock, children: [
2451
- /* @__PURE__ */ p("div", { style: a.inputsAppliedHeader, children: [
2452
- /* @__PURE__ */ s("span", { style: a.inputsAppliedTitle, children: "Active Inputs" }),
2453
- /* @__PURE__ */ s("span", { style: a.inputsAppliedCount, children: e.length })
2546
+ return /* @__PURE__ */ p("div", { style: s.inputsAppliedBlock, children: [
2547
+ /* @__PURE__ */ p("div", { style: s.inputsAppliedHeader, children: [
2548
+ /* @__PURE__ */ a("span", { style: s.inputsAppliedTitle, children: "Active Inputs" }),
2549
+ /* @__PURE__ */ a("span", { style: s.inputsAppliedCount, children: e.length })
2454
2550
  ] }),
2455
- /* @__PURE__ */ s("div", { style: a.inputRecipeList, children: e.map((r) => {
2456
- const t = gn(r);
2551
+ /* @__PURE__ */ a("div", { style: s.inputRecipeList, children: e.map((r) => {
2552
+ const t = mn(r);
2457
2553
  return /* @__PURE__ */ p(
2458
2554
  "div",
2459
2555
  {
2460
- style: a.inputRecipeRow,
2556
+ style: s.inputRecipeRow,
2461
2557
  title: t.title,
2462
2558
  children: [
2463
- /* @__PURE__ */ p("div", { style: a.inputRecipeHeader, children: [
2464
- /* @__PURE__ */ s("span", { style: a.inputRecipeLabel, title: t.title, children: t.label }),
2465
- t.showId ? /* @__PURE__ */ s("span", { style: a.inputRecipeId, title: r.inputId, children: r.inputId }) : null,
2466
- t.operator ? /* @__PURE__ */ s("span", { style: a.inputOperatorBadge, children: t.operator }) : null,
2467
- /* @__PURE__ */ s("span", { style: a.inputValuePreview, title: t.value, children: t.value })
2559
+ /* @__PURE__ */ p("div", { style: s.inputRecipeHeader, children: [
2560
+ /* @__PURE__ */ a("span", { style: s.inputRecipeLabel, title: t.title, children: t.label }),
2561
+ t.showId ? /* @__PURE__ */ a("span", { style: s.inputRecipeId, title: r.inputId, children: r.inputId }) : null,
2562
+ t.operator ? /* @__PURE__ */ a("span", { style: s.inputOperatorBadge, children: t.operator }) : null,
2563
+ /* @__PURE__ */ a("span", { style: s.inputValuePreview, title: t.value, children: t.value })
2468
2564
  ] }),
2469
- t.binding ? /* @__PURE__ */ s("div", { style: a.inputRecipeBinding, title: t.binding, children: t.binding }) : null
2565
+ t.binding ? /* @__PURE__ */ a("div", { style: s.inputRecipeBinding, title: t.binding, children: t.binding }) : null
2470
2566
  ]
2471
2567
  },
2472
2568
  r.inputId
@@ -2474,70 +2570,70 @@ function Jt({
2474
2570
  }) })
2475
2571
  ] });
2476
2572
  }
2477
- function Yt({
2573
+ function Xt({
2478
2574
  preview: e
2479
2575
  }) {
2480
- return /* @__PURE__ */ p("div", { style: a.resultPreview, children: [
2481
- /* @__PURE__ */ p("div", { style: a.resultPreviewHeader, children: [
2482
- /* @__PURE__ */ s("span", { style: a.resultPreviewTitle, children: e.title }),
2483
- /* @__PURE__ */ s("span", { style: a.resultPreviewSummary, children: e.summary })
2576
+ return /* @__PURE__ */ p("div", { style: s.resultPreview, children: [
2577
+ /* @__PURE__ */ p("div", { style: s.resultPreviewHeader, children: [
2578
+ /* @__PURE__ */ a("span", { style: s.resultPreviewTitle, children: e.title }),
2579
+ /* @__PURE__ */ a("span", { style: s.resultPreviewSummary, children: e.summary })
2484
2580
  ] }),
2485
- /* @__PURE__ */ s("div", { style: a.resultPreviewScroller, children: /* @__PURE__ */ p("table", { style: a.resultPreviewTable, children: [
2486
- /* @__PURE__ */ s("thead", { children: /* @__PURE__ */ s("tr", { children: e.columns.map((r) => /* @__PURE__ */ s("th", { style: a.resultPreviewTh, children: r.label }, r.key)) }) }),
2487
- /* @__PURE__ */ s("tbody", { children: e.rows.length ? e.rows.map((r, t) => /* @__PURE__ */ s("tr", { children: e.columns.map((n) => /* @__PURE__ */ s("td", { style: a.resultPreviewTd, children: ft(r[n.key]) }, n.key)) }, t)) : /* @__PURE__ */ s("tr", { children: /* @__PURE__ */ s(
2581
+ /* @__PURE__ */ a("div", { style: s.resultPreviewScroller, children: /* @__PURE__ */ p("table", { style: s.resultPreviewTable, children: [
2582
+ /* @__PURE__ */ a("thead", { children: /* @__PURE__ */ a("tr", { children: e.columns.map((r) => /* @__PURE__ */ a("th", { style: s.resultPreviewTh, children: r.label }, r.key)) }) }),
2583
+ /* @__PURE__ */ a("tbody", { children: e.rows.length ? e.rows.map((r, t) => /* @__PURE__ */ a("tr", { children: e.columns.map((n) => /* @__PURE__ */ a("td", { style: s.resultPreviewTd, children: ct(r[n.key]) }, n.key)) }, t)) : /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a(
2488
2584
  "td",
2489
2585
  {
2490
2586
  colSpan: e.columns.length,
2491
- style: a.resultPreviewEmptyCell,
2587
+ style: s.resultPreviewEmptyCell,
2492
2588
  children: "No rows returned"
2493
2589
  }
2494
2590
  ) }) })
2495
2591
  ] }) }),
2496
- e.truncatedRows || e.truncatedColumns ? /* @__PURE__ */ p("div", { style: a.resultPreviewFootnote, children: [
2592
+ e.truncatedRows || e.truncatedColumns ? /* @__PURE__ */ p("div", { style: s.resultPreviewFootnote, children: [
2497
2593
  "Showing first ",
2498
- pe,
2594
+ ce,
2499
2595
  " rows and first",
2500
2596
  " ",
2501
- Ne,
2597
+ _e,
2502
2598
  " columns."
2503
2599
  ] }) : null
2504
2600
  ] });
2505
2601
  }
2506
- function Xt({
2602
+ function Zt({
2507
2603
  compiledQuery: e,
2508
2604
  compiledSql: r
2509
2605
  }) {
2510
- return (e == null ? void 0 : e.kind) === "sql" ? /* @__PURE__ */ p("div", { style: a.compiledQuery, children: [
2511
- /* @__PURE__ */ s(ar, { label: "SQL", value: e.sql }),
2512
- e.pythonCode ? /* @__PURE__ */ s(De, { label: "Python", value: e.pythonCode }) : null,
2513
- e.parameters ? /* @__PURE__ */ s(
2514
- De,
2606
+ return (e == null ? void 0 : e.kind) === "sql" ? /* @__PURE__ */ p("div", { style: s.compiledQuery, children: [
2607
+ /* @__PURE__ */ a(sr, { label: "SQL", value: e.sql }),
2608
+ e.pythonCode ? /* @__PURE__ */ a(Le, { label: "Python", value: e.pythonCode }) : null,
2609
+ e.parameters ? /* @__PURE__ */ a(
2610
+ Le,
2515
2611
  {
2516
2612
  label: "Parameters",
2517
- value: ze(e.parameters)
2613
+ value: Pe(e.parameters)
2518
2614
  }
2519
2615
  ) : null
2520
- ] }) : r ? /* @__PURE__ */ s(ar, { label: "SQL", value: r }) : /* @__PURE__ */ s(De, { label: "Compiled Query", value: ze(e) });
2616
+ ] }) : r ? /* @__PURE__ */ a(sr, { label: "SQL", value: r }) : /* @__PURE__ */ a(Le, { label: "Compiled Query", value: Pe(e) });
2521
2617
  }
2522
- function De({
2618
+ function Le({
2523
2619
  label: e,
2524
2620
  value: r
2525
2621
  }) {
2526
- return /* @__PURE__ */ p("div", { style: a.codeBlockGroup, children: [
2527
- /* @__PURE__ */ s("div", { style: a.codeBlockLabel, children: e }),
2528
- /* @__PURE__ */ s("pre", { style: a.codeBlock, children: r })
2622
+ return /* @__PURE__ */ p("div", { style: s.codeBlockGroup, children: [
2623
+ /* @__PURE__ */ a("div", { style: s.codeBlockLabel, children: e }),
2624
+ /* @__PURE__ */ a("pre", { style: s.codeBlock, children: r })
2529
2625
  ] });
2530
2626
  }
2531
- function ar({
2627
+ function sr({
2532
2628
  label: e,
2533
2629
  value: r
2534
2630
  }) {
2535
- return /* @__PURE__ */ p("div", { style: a.codeBlockGroup, children: [
2536
- /* @__PURE__ */ s("div", { style: a.codeBlockLabel, children: e }),
2537
- /* @__PURE__ */ s("pre", { style: a.codeBlock, children: en(r) })
2631
+ return /* @__PURE__ */ p("div", { style: s.codeBlockGroup, children: [
2632
+ /* @__PURE__ */ a("div", { style: s.codeBlockLabel, children: e }),
2633
+ /* @__PURE__ */ a("pre", { style: s.codeBlock, children: rn(r) })
2538
2634
  ] });
2539
2635
  }
2540
- const Zt = /* @__PURE__ */ new Set([
2636
+ const en = /* @__PURE__ */ new Set([
2541
2637
  "SELECT",
2542
2638
  "FROM",
2543
2639
  "JOIN",
@@ -2575,14 +2671,14 @@ const Zt = /* @__PURE__ */ new Set([
2575
2671
  "ALL",
2576
2672
  "WITH"
2577
2673
  ]);
2578
- function en(e) {
2674
+ function rn(e) {
2579
2675
  return e.split(/(\s+|,|\(|\))/).map((t, n) => {
2580
2676
  if (!t) return null;
2581
2677
  const i = t.toUpperCase();
2582
- return Zt.has(i) ? /* @__PURE__ */ s("span", { style: a.sqlKeyword, children: t }, n) : t.startsWith("$") || t.startsWith(":") || t.startsWith("?") ? /* @__PURE__ */ s("span", { style: a.sqlBindParam, children: t }, n) : /* @__PURE__ */ s("span", { children: t }, n);
2678
+ return en.has(i) ? /* @__PURE__ */ a("span", { style: s.sqlKeyword, children: t }, n) : t.startsWith("$") || t.startsWith(":") || t.startsWith("?") ? /* @__PURE__ */ a("span", { style: s.sqlBindParam, children: t }, n) : /* @__PURE__ */ a("span", { children: t }, n);
2583
2679
  });
2584
2680
  }
2585
- function rn(e) {
2681
+ function tn(e) {
2586
2682
  return [
2587
2683
  `${e.total} ${e.total === 1 ? "trace" : "traces"}`,
2588
2684
  `${e.loading} loading`,
@@ -2591,7 +2687,7 @@ function rn(e) {
2591
2687
  `${e.warningCount} warning${e.warningCount === 1 ? "" : "s"}`
2592
2688
  ].join(" · ");
2593
2689
  }
2594
- function tn(e, r) {
2690
+ function nn(e, r) {
2595
2691
  const t = r.trim().toLowerCase();
2596
2692
  return t ? e.filter(
2597
2693
  (n) => [
@@ -2603,36 +2699,36 @@ function tn(e, r) {
2603
2699
  n.sectionTitle,
2604
2700
  n.builder,
2605
2701
  n.queryKind,
2606
- Rr(n)
2702
+ Er(n)
2607
2703
  ].filter(Boolean).join(" ").toLowerCase().includes(t)
2608
2704
  ) : e;
2609
2705
  }
2610
- function nn(e) {
2611
- const r = e.filter((i) => i.queryKind === "inputOptions"), t = new Set(r.map(Pe));
2706
+ function on(e) {
2707
+ const r = e.filter((i) => i.queryKind === "inputOptions"), t = new Set(r.map(Ne));
2612
2708
  return [
2613
- { title: "Views", traces: e.filter((i) => !t.has(Pe(i))) },
2709
+ { title: "Views", traces: e.filter((i) => !t.has(Ne(i))) },
2614
2710
  { title: "Inputs", traces: r }
2615
2711
  ];
2616
2712
  }
2617
- function Cr(e, r) {
2713
+ function Tr(e, r) {
2618
2714
  if (!(!(r != null && r.traceId) && !(r != null && r.queryId) && !(r != null && r.viewId)))
2619
2715
  return r.traceId ? e.find((t) => t.traceId === r.traceId) : e.find((t) => !(r.queryId && t.queryId !== r.queryId || r.viewId && t.viewId !== r.viewId));
2620
2716
  }
2621
- function on(e, r) {
2717
+ function sn(e, r) {
2622
2718
  if (r.queryId)
2623
- return Cr(e, r);
2719
+ return Tr(e, r);
2624
2720
  if (!r.viewId)
2625
2721
  return;
2626
2722
  const t = e.filter((n) => n.viewId === r.viewId);
2627
2723
  return t.length === 1 ? t[0] : void 0;
2628
2724
  }
2629
- function sn(e, r) {
2725
+ function an(e, r) {
2630
2726
  return !!(e && r && e.traceId === r.traceId);
2631
2727
  }
2632
- function Pe(e) {
2728
+ function Ne(e) {
2633
2729
  return e.traceId;
2634
2730
  }
2635
- function an(e) {
2731
+ function dn(e) {
2636
2732
  switch (e) {
2637
2733
  case "metric":
2638
2734
  return "metric";
@@ -2647,14 +2743,14 @@ function an(e) {
2647
2743
  case "sql":
2648
2744
  return "sql";
2649
2745
  default:
2650
- return Ce(e);
2746
+ return qe(e);
2651
2747
  }
2652
2748
  }
2653
- function kr(e) {
2749
+ function Ar(e) {
2654
2750
  const r = e.trim().toLowerCase();
2655
2751
  return r === "metric" || r === "kpi" ? "metric" : r === "records" || r === "table" ? "records" : r === "matrix" || r === "pivot" ? "matrix" : r === "analysis" ? "analysis" : r === "inputs" || r === "input options" ? "inputs" : r === "sql" ? "sql" : "default";
2656
2752
  }
2657
- function Tr(e) {
2753
+ function Cr(e) {
2658
2754
  switch (e) {
2659
2755
  case "metric":
2660
2756
  return {
@@ -2690,21 +2786,21 @@ function ln(e, r, t) {
2690
2786
  const n = [];
2691
2787
  return e.queryLabel && e.queryLabel !== r && n.push(e.queryLabel), e.queryId && e.queryId !== r && e.queryId !== e.queryLabel ? n.push(e.queryId) : e.viewId && e.viewId !== r && e.viewId !== e.queryLabel && n.push(e.viewId), n.push(t), n;
2692
2788
  }
2693
- function Er(e) {
2694
- return un(e.visualType) || an(e.queryKind);
2789
+ function kr(e) {
2790
+ return cn(e.visualType) || dn(e.queryKind);
2695
2791
  }
2696
- function dn(e, r) {
2697
- return r ? e.queryLabel || e.queryId : Ae(e);
2792
+ function un(e, r) {
2793
+ return r ? e.queryLabel || e.queryId : xe(e);
2698
2794
  }
2699
- function un(e) {
2795
+ function cn(e) {
2700
2796
  if (e)
2701
2797
  return e.replace(/[_-]+/g, " ").replace(/\b\w/g, (r) => r.toUpperCase());
2702
2798
  }
2703
- function Rr(e) {
2704
- const r = e.sourceRefs.map(F);
2799
+ function Er(e) {
2800
+ const r = e.sourceRefs.map(z);
2705
2801
  return r.length ? r.length === 1 ? r[0] : `${r[0]} + ${r.length - 1} more` : "No source";
2706
2802
  }
2707
- function cn(e) {
2803
+ function fn(e) {
2708
2804
  return e.reduce(
2709
2805
  (r, t) => (t.role === "measure" ? r.measures.push(t) : t.role === "date" ? r.timeFields.push(t) : t.role === "dimension" ? r.dimensions.push(t) : t.role === "id" ? r.identifiers.push(t) : r.other.push(t), r),
2710
2806
  {
@@ -2716,7 +2812,7 @@ function cn(e) {
2716
2812
  }
2717
2813
  );
2718
2814
  }
2719
- function fn(e) {
2815
+ function pn(e) {
2720
2816
  var r, t;
2721
2817
  if (e.queryKind === "records" && ((r = e.projectionFieldRefs) != null && r.length) && e.projectionFieldRefs.every((n) => n.role === "measure") && ((t = e.latestAttempt) == null ? void 0 : t.rowCount) === 1)
2722
2818
  return "KPI query";
@@ -2734,15 +2830,15 @@ function fn(e) {
2734
2830
  case "sql":
2735
2831
  return "SQL query";
2736
2832
  default:
2737
- return Ce(e.queryKind);
2833
+ return qe(e.queryKind);
2738
2834
  }
2739
2835
  }
2740
- function pn(e) {
2836
+ function gn(e) {
2741
2837
  return [e.aggregate, e.label || e.name].filter(Boolean).join(" ");
2742
2838
  }
2743
- function gn(e) {
2744
- var f, l, c;
2745
- const r = e.valuePreview || "redacted", t = e.inputLabel || e.inputId, n = ((f = e.fieldRef) == null ? void 0 : f.label) || ((l = e.fieldRef) == null ? void 0 : l.name), i = (c = e.fieldRef) != null && c.source ? F(e.fieldRef.source) : void 0, o = [n ? `on ${n}` : void 0, i].filter(Boolean).join(" · "), u = [
2839
+ function mn(e) {
2840
+ var f, d, c;
2841
+ const r = e.valuePreview || "redacted", t = e.inputLabel || e.inputId, n = ((f = e.fieldRef) == null ? void 0 : f.label) || ((d = e.fieldRef) == null ? void 0 : d.name), i = (c = e.fieldRef) != null && c.source ? z(e.fieldRef.source) : void 0, o = [n ? `on ${n}` : void 0, i].filter(Boolean).join(" · "), u = [
2746
2842
  t,
2747
2843
  e.inputId,
2748
2844
  e.operator,
@@ -2758,29 +2854,29 @@ function gn(e) {
2758
2854
  title: u
2759
2855
  };
2760
2856
  }
2761
- function F(e) {
2857
+ function z(e) {
2762
2858
  return e.kind === "semantic" ? e.datasetName || e.datasetId || e.domainId : e.kind === "physical" ? [
2763
2859
  e.schemaName,
2764
2860
  e.tableName
2765
2861
  ].filter(Boolean).join(".") || e.tableName : e.connectionId ? `SQL ${e.connectionId}` : "SQL source";
2766
2862
  }
2767
- function mn(e) {
2863
+ function yn(e) {
2768
2864
  if (e.file)
2769
2865
  return e.line && e.column ? `${e.file}:${e.line}:${e.column}` : e.line ? `${e.file}:${e.line}` : e.file;
2770
2866
  }
2771
- function yn(e) {
2867
+ function hn(e) {
2772
2868
  return typeof e == "number" ? e.toLocaleString() : "-";
2773
2869
  }
2774
- function hn(e) {
2870
+ function bn(e) {
2775
2871
  return typeof e == "number" ? `${Math.round(e)}ms` : "-";
2776
2872
  }
2777
- function bn(e) {
2778
- return ze(e);
2873
+ function vn(e) {
2874
+ return Pe(e);
2779
2875
  }
2780
- function ze(e) {
2876
+ function Pe(e) {
2781
2877
  return JSON.stringify(e, null, 2) ?? "undefined";
2782
2878
  }
2783
- function vn(e) {
2879
+ function Sn(e) {
2784
2880
  switch (e.type) {
2785
2881
  case "query_started":
2786
2882
  return "Started";
@@ -2793,10 +2889,10 @@ function vn(e) {
2793
2889
  case "input_changed":
2794
2890
  return "Input changed";
2795
2891
  default:
2796
- return wn(e);
2892
+ return In(e);
2797
2893
  }
2798
2894
  }
2799
- function Sn(e) {
2895
+ function wn(e) {
2800
2896
  return [
2801
2897
  e.at,
2802
2898
  "durationMs" in e && typeof e.durationMs == "number" ? `${Math.round(e.durationMs)}ms` : void 0,
@@ -2805,20 +2901,20 @@ function Sn(e) {
2805
2901
  "errorMessage" in e ? e.errorMessage : void 0
2806
2902
  ].filter(Boolean).join(" - ");
2807
2903
  }
2808
- function wn(e) {
2904
+ function In(e) {
2809
2905
  throw new Error(`Unsupported Semaphor trace event: ${JSON.stringify(e)}`);
2810
2906
  }
2811
- function In(e) {
2907
+ function xn(e) {
2812
2908
  return Array.isArray(e) ? e.filter((r) => typeof r == "string") : [];
2813
2909
  }
2814
2910
  function $e(e) {
2815
- return Array.isArray(e) ? e.map((r) => xn(r)).filter((r) => !!r) : [];
2911
+ return Array.isArray(e) ? e.map((r) => qn(r)).filter((r) => !!r) : [];
2816
2912
  }
2817
- function xn(e) {
2913
+ function qn(e) {
2818
2914
  var r;
2819
- return (r = qn(e)) == null ? void 0 : r.message;
2915
+ return (r = Tn(e)) == null ? void 0 : r.message;
2820
2916
  }
2821
- function qn(e) {
2917
+ function Tn(e) {
2822
2918
  if (typeof e == "string")
2823
2919
  return { message: e };
2824
2920
  if (!e || typeof e != "object" || Array.isArray(e))
@@ -2837,7 +2933,7 @@ function An(e) {
2837
2933
  queryHash: typeof (t == null ? void 0 : t.queryHash) == "string" ? t.queryHash : void 0
2838
2934
  };
2839
2935
  }
2840
- function Lr(e) {
2936
+ function Rr(e) {
2841
2937
  return {
2842
2938
  ...e,
2843
2939
  order: [],
@@ -2850,24 +2946,24 @@ function Cn(e, r) {
2850
2946
  return r.config.enabled ? {
2851
2947
  ...e,
2852
2948
  ...r.config
2853
- } : Lr(r.config);
2949
+ } : Rr(r.config);
2854
2950
  if (!e.enabled)
2855
2951
  return e;
2856
2952
  switch (r.type) {
2857
2953
  case "register":
2858
- return Rn(kn(e, r.descriptor));
2954
+ return Ln(kn(e, r.descriptor));
2859
2955
  case "unregister":
2860
- return Tn(e, r.traceKey);
2956
+ return En(e, r.traceKey);
2861
2957
  case "event":
2862
- return En(e, r);
2958
+ return Rn(e, r);
2863
2959
  default:
2864
2960
  return e;
2865
2961
  }
2866
2962
  }
2867
2963
  function kn(e, r) {
2868
- const t = e.entries[r.traceKey], n = t ? e.sequence : e.sequence + 1, i = Ge(), o = {
2869
- ...t || Ln(r),
2870
- ...Dr(r),
2964
+ const t = e.entries[r.traceKey], n = t ? e.sequence : e.sequence + 1, i = Ue(), o = {
2965
+ ...t || $n(r),
2966
+ ...Lr(r),
2871
2967
  traceKey: r.traceKey,
2872
2968
  latestAttempt: (t == null ? void 0 : t.latestAttempt) || { status: "idle" },
2873
2969
  recentEvents: (t == null ? void 0 : t.recentEvents) || [],
@@ -2885,7 +2981,7 @@ function kn(e, r) {
2885
2981
  }
2886
2982
  };
2887
2983
  }
2888
- function Tn(e, r) {
2984
+ function En(e, r) {
2889
2985
  const t = e.entries[r];
2890
2986
  return t ? {
2891
2987
  ...e,
@@ -2898,11 +2994,11 @@ function Tn(e, r) {
2898
2994
  }
2899
2995
  } : e;
2900
2996
  }
2901
- function En(e, r) {
2997
+ function Rn(e, r) {
2902
2998
  const t = e.entries[r.traceKey];
2903
2999
  if (!t)
2904
3000
  return e;
2905
- const n = Ge(), i = [
3001
+ const n = Ue(), i = [
2906
3002
  ...t.recentEvents,
2907
3003
  r.event
2908
3004
  ].slice(-e.maxEventsPerQuery);
@@ -2922,7 +3018,7 @@ function En(e, r) {
2922
3018
  }
2923
3019
  };
2924
3020
  }
2925
- function Rn(e) {
3021
+ function Ln(e) {
2926
3022
  if (e.order.length <= e.maxQueries)
2927
3023
  return e;
2928
3024
  const r = e.order.map((i) => e.entries[i]).filter((i) => !!i).sort((i, o) => i.mounted !== o.mounted ? i.mounted ? 1 : -1 : i.lastEventAt - o.lastEventAt), t = e.order.length - e.maxQueries, n = new Set(
@@ -2936,10 +3032,10 @@ function Rn(e) {
2936
3032
  )
2937
3033
  } : e;
2938
3034
  }
2939
- function Ln(e) {
2940
- const r = Ge();
3035
+ function $n(e) {
3036
+ const r = Ue();
2941
3037
  return {
2942
- ...Dr(e),
3038
+ ...Lr(e),
2943
3039
  traceKey: e.traceKey,
2944
3040
  latestAttempt: { status: "idle" },
2945
3041
  recentEvents: [],
@@ -2948,14 +3044,14 @@ function Ln(e) {
2948
3044
  lastEventAt: r
2949
3045
  };
2950
3046
  }
2951
- function Dr(e) {
3047
+ function Lr(e) {
2952
3048
  var n;
2953
- const r = Pn(e.spec), t = zn(
3049
+ const r = zn(e.spec), t = Fn(
2954
3050
  e.spec,
2955
3051
  e.activeInputs
2956
3052
  );
2957
3053
  return {
2958
- traceId: Or(e.traceKey),
3054
+ traceId: Dr(e.traceKey),
2959
3055
  viewId: e.viewId,
2960
3056
  viewTitle: e.viewTitle,
2961
3057
  visualType: e.visualType,
@@ -2964,23 +3060,23 @@ function Dr(e) {
2964
3060
  queryLabel: e.queryLabel,
2965
3061
  queryKind: e.queryKind,
2966
3062
  builder: e.builder,
2967
- sourceRefs: Nn(e.intent),
3063
+ sourceRefs: Pn(e.intent),
2968
3064
  sourceHints: (n = e.sourceHints) != null && n.length ? e.sourceHints : void 0,
2969
3065
  projectionFieldRefs: r,
2970
3066
  inputFieldRefs: t,
2971
- fieldRefs: Fn(e.intent),
3067
+ fieldRefs: Mn(e.intent),
2972
3068
  inputsApplied: (e.activeInputs || []).map((i) => ({
2973
3069
  inputId: i.inputId,
2974
3070
  inputLabel: i.label,
2975
3071
  fieldRef: i.field,
2976
3072
  operator: i.operator,
2977
- valuePreview: Wn(i)
3073
+ valuePreview: _n(i)
2978
3074
  })),
2979
3075
  recentEvents: [],
2980
3076
  clientWarnings: e.clientWarnings
2981
3077
  };
2982
3078
  }
2983
- function we(e) {
3079
+ function ve(e) {
2984
3080
  const {
2985
3081
  traceKey: r,
2986
3082
  mounted: t,
@@ -2990,10 +3086,10 @@ function we(e) {
2990
3086
  } = e;
2991
3087
  return o;
2992
3088
  }
2993
- function ce(e) {
3089
+ function le(e) {
2994
3090
  if (!e.enabled)
2995
- return xr;
2996
- const r = e.order.map((n) => e.entries[n]).filter((n) => !!n).map(we), t = je(r).map(yt);
3091
+ return Ir;
3092
+ const r = e.order.map((n) => e.entries[n]).filter((n) => !!n).map(ve), t = Me(r).map(mt);
2997
3093
  return {
2998
3094
  enabled: !0,
2999
3095
  queries: r,
@@ -3002,77 +3098,77 @@ function ce(e) {
3002
3098
  const i = Object.values(e.entries).find(
3003
3099
  (o) => o.queryId === n
3004
3100
  );
3005
- return i ? we(i) : void 0;
3101
+ return i ? ve(i) : void 0;
3006
3102
  },
3007
- getQueries: (n) => Object.values(e.entries).filter((i) => i.queryId === n).map(we)
3103
+ getQueries: (n) => Object.values(e.entries).filter((i) => i.queryId === n).map(ve)
3008
3104
  };
3009
3105
  }
3010
3106
  function Dn(e) {
3011
3107
  return {
3012
- snapshot: () => wt(ce(e())),
3013
- getQuery: (r) => ir(ce(e()).getQuery(r)),
3014
- getQueries: (r) => ce(e()).getQueries(r).map((t) => ir(t)).filter((t) => !!t),
3015
- getIssues: () => ce(e()).issues
3108
+ snapshot: () => St(le(e())),
3109
+ getQuery: (r) => nr(le(e()).getQuery(r)),
3110
+ getQueries: (r) => le(e()).getQueries(r).map((t) => nr(t)).filter((t) => !!t),
3111
+ getIssues: () => le(e()).issues
3016
3112
  };
3017
3113
  }
3018
- function $n(e) {
3114
+ function On(e) {
3019
3115
  return e === void 0 || e === !1 ? {
3020
3116
  enabled: !1,
3021
3117
  exposeWindowBridge: !1,
3022
- maxEventsPerQuery: Re,
3023
- maxQueries: Le
3118
+ maxEventsPerQuery: Ee,
3119
+ maxQueries: Re
3024
3120
  } : e === !0 ? {
3025
3121
  enabled: !0,
3026
3122
  exposeWindowBridge: !1,
3027
- maxEventsPerQuery: Re,
3028
- maxQueries: Le
3123
+ maxEventsPerQuery: Ee,
3124
+ maxQueries: Re
3029
3125
  } : {
3030
3126
  enabled: e.enabled !== !1,
3031
3127
  exposeWindowBridge: e.exposeWindowBridge === !0,
3032
3128
  maxEventsPerQuery: dr(
3033
3129
  e.maxEventsPerQuery,
3034
- Re,
3035
- Lt
3130
+ Ee,
3131
+ Rt
3036
3132
  ),
3037
3133
  maxQueries: dr(
3038
3134
  e.maxQueries,
3039
- Le,
3040
- Dt
3135
+ Re,
3136
+ Lt
3041
3137
  )
3042
3138
  };
3043
3139
  }
3044
- function On(e) {
3140
+ function Bn(e) {
3045
3141
  const t = [
3046
3142
  e == null ? void 0 : e.sourceHint,
3047
3143
  ...(e == null ? void 0 : e.sourceHints) || []
3048
3144
  ].filter((n) => !!n).map((n) => ({
3049
- file: ve(n.file),
3050
- line: lr(n.line),
3051
- column: lr(n.column),
3052
- exportName: ve(n.exportName),
3053
- component: ve(n.component),
3054
- note: ve(n.note)
3145
+ file: he(n.file),
3146
+ line: ar(n.line),
3147
+ column: ar(n.column),
3148
+ exportName: he(n.exportName),
3149
+ component: he(n.component),
3150
+ note: he(n.note)
3055
3151
  })).filter(
3056
3152
  (n) => !!(n.file || n.line || n.column || n.exportName || n.component || n.note)
3057
3153
  );
3058
3154
  return t.length ? t : void 0;
3059
3155
  }
3060
- function ve(e) {
3156
+ function he(e) {
3061
3157
  if (typeof e != "string")
3062
3158
  return;
3063
3159
  const r = e.trim();
3064
3160
  return r || void 0;
3065
3161
  }
3066
- function lr(e) {
3162
+ function ar(e) {
3067
3163
  return typeof e == "number" && Number.isInteger(e) && e > 0 ? e : void 0;
3068
3164
  }
3069
3165
  function dr(e, r, t) {
3070
3166
  return e === void 0 || !Number.isFinite(e) || !Number.isInteger(e) || e <= 0 ? r : Math.min(e, t);
3071
3167
  }
3072
- function Bn(e) {
3168
+ function Kn(e) {
3073
3169
  return typeof e.id == "string" && e.id.trim() ? e.id : void 0;
3074
3170
  }
3075
- function Kn(e) {
3171
+ function Wn(e) {
3076
3172
  switch (e) {
3077
3173
  case "metric":
3078
3174
  return "semaphor.metric";
@@ -3087,14 +3183,14 @@ function Kn(e) {
3087
3183
  case "sql":
3088
3184
  return "semaphor.sql";
3089
3185
  default:
3090
- return Ce(e);
3186
+ return qe(e);
3091
3187
  }
3092
3188
  }
3093
- function Ce(e) {
3189
+ function qe(e) {
3094
3190
  throw new Error(`Unsupported Semaphor query kind: ${JSON.stringify(e)}`);
3095
3191
  }
3096
- function Wn(e) {
3097
- if (_n(e))
3192
+ function _n(e) {
3193
+ if (Nn(e))
3098
3194
  return;
3099
3195
  const r = e.value;
3100
3196
  if (r !== void 0) {
@@ -3104,17 +3200,17 @@ function Wn(e) {
3104
3200
  ).map((n) => String(n));
3105
3201
  if (t.length === r.length && t.length > 0) {
3106
3202
  const n = t.slice(0, 3).join(", "), i = t.length > 3 ? `, +${t.length - 3} more` : "";
3107
- return ur(`${n}${i}`);
3203
+ return lr(`${n}${i}`);
3108
3204
  }
3109
3205
  return `${r.length} selected`;
3110
3206
  }
3111
- return typeof r == "number" || typeof r == "boolean" ? String(r) : typeof r == "string" ? ur(r) : r && typeof r == "object" ? `object(${Object.keys(r).slice(0, 5).join(",")})` : String(r);
3207
+ return typeof r == "number" || typeof r == "boolean" ? String(r) : typeof r == "string" ? lr(r) : r && typeof r == "object" ? `object(${Object.keys(r).slice(0, 5).join(",")})` : String(r);
3112
3208
  }
3113
3209
  }
3114
- function ur(e) {
3210
+ function lr(e) {
3115
3211
  return e.length > 80 ? `${e.slice(0, 77)}...` : e;
3116
3212
  }
3117
- function _n(e) {
3213
+ function Nn(e) {
3118
3214
  var t;
3119
3215
  const r = [
3120
3216
  e.inputId,
@@ -3125,54 +3221,54 @@ function _n(e) {
3125
3221
  (n) => r.includes(n)
3126
3222
  );
3127
3223
  }
3128
- function Nn(e) {
3224
+ function Pn(e) {
3129
3225
  const r = [];
3130
- return xe(e, (t) => {
3131
- Mn(t) && r.push(t);
3132
- }), Zr(r);
3226
+ return we(e, (t) => {
3227
+ jn(t) && r.push(t);
3228
+ }), Xr(r);
3133
3229
  }
3134
- function Pn(e) {
3230
+ function zn(e) {
3135
3231
  switch (e.queryKind) {
3136
3232
  case "metric":
3137
3233
  case "analysis":
3138
- return Z([
3234
+ return Y([
3139
3235
  ...e.measures || [],
3140
3236
  e.primaryMeasure,
3141
3237
  e.dateField,
3142
3238
  ...e.dimensions || []
3143
3239
  ]);
3144
3240
  case "records":
3145
- return Z(e.fields || []);
3241
+ return Y(e.fields || []);
3146
3242
  case "inputOptions":
3147
- return Z([
3243
+ return Y([
3148
3244
  e.labelField,
3149
3245
  e.valueField,
3150
3246
  e.searchField,
3151
3247
  ...e.disambiguationFields || []
3152
3248
  ]);
3153
3249
  case "sql":
3154
- return Z(e.fields || []);
3250
+ return Y(e.fields || []);
3155
3251
  case "matrix":
3156
- return Z([
3157
- ...(e.rows || []).map(Oe),
3158
- ...(e.columns || []).map(Oe),
3159
- ...(e.values || []).map(Oe)
3252
+ return Y([
3253
+ ...(e.rows || []).map(De),
3254
+ ...(e.columns || []).map(De),
3255
+ ...(e.values || []).map(De)
3160
3256
  ]);
3161
3257
  default:
3162
- return Ce(e);
3258
+ return qe(e);
3163
3259
  }
3164
3260
  }
3165
- function zn(e, r) {
3261
+ function Fn(e, r) {
3166
3262
  const t = [
3167
3263
  ...(e.inputs || []).map($r),
3168
3264
  ...(r || []).map((n) => n.field)
3169
3265
  ];
3170
- return Z(t);
3266
+ return Y(t);
3171
3267
  }
3172
- function Z(e) {
3268
+ function Y(e) {
3173
3269
  const r = /* @__PURE__ */ new Map();
3174
3270
  return e.forEach((t) => {
3175
- t && ge(t) && r.set(Ue(t), t);
3271
+ t && fe(t) && r.set(Qe(t), t);
3176
3272
  }), [...r.values()];
3177
3273
  }
3178
3274
  function $r(e) {
@@ -3184,82 +3280,82 @@ function $r(e) {
3184
3280
  return $r(n);
3185
3281
  }
3186
3282
  const t = e.field;
3187
- return ge(t) ? t : void 0;
3283
+ return fe(t) ? t : void 0;
3188
3284
  }
3189
- function Oe(e) {
3190
- if (ge(e))
3285
+ function De(e) {
3286
+ if (fe(e))
3191
3287
  return e;
3192
3288
  if (!e || typeof e != "object")
3193
3289
  return;
3194
3290
  const r = e.field;
3195
- return ge(r) ? r : void 0;
3291
+ return fe(r) ? r : void 0;
3196
3292
  }
3197
- function Fn(e) {
3293
+ function Mn(e) {
3198
3294
  const r = /* @__PURE__ */ new Map();
3199
- return xe(e, (t) => {
3200
- ge(t) && r.set(Ue(t), t);
3295
+ return we(e, (t) => {
3296
+ fe(t) && r.set(Qe(t), t);
3201
3297
  }), [...r.values()];
3202
3298
  }
3203
- function xe(e, r) {
3299
+ function we(e, r) {
3204
3300
  if (!(!e || typeof e != "object")) {
3205
3301
  if (r(e), Array.isArray(e)) {
3206
- e.forEach((t) => xe(t, r));
3302
+ e.forEach((t) => we(t, r));
3207
3303
  return;
3208
3304
  }
3209
3305
  Object.values(e).forEach(
3210
- (t) => xe(t, r)
3306
+ (t) => we(t, r)
3211
3307
  );
3212
3308
  }
3213
3309
  }
3214
- function Mn(e) {
3310
+ function jn(e) {
3215
3311
  if (!e || typeof e != "object")
3216
3312
  return !1;
3217
3313
  const r = e;
3218
3314
  return r.kind === "semantic" ? typeof r.domainId == "string" && typeof r.datasetName == "string" : r.kind === "physical" ? typeof r.connectionId == "string" && typeof r.tableName == "string" : r.kind === "sql" ? typeof r.connectionId == "string" : !1;
3219
3315
  }
3220
- function ge(e) {
3316
+ function fe(e) {
3221
3317
  if (!e || typeof e != "object")
3222
3318
  return !1;
3223
3319
  const r = e;
3224
3320
  return typeof r.name == "string" && (r.source !== void 0 || r.role !== void 0 || r.dataType !== void 0 || r.aggregate !== void 0);
3225
3321
  }
3226
- function Ue(e) {
3322
+ function Qe(e) {
3227
3323
  return [
3228
3324
  e.name,
3229
3325
  e.role,
3230
3326
  e.aggregate,
3231
- e.source ? Xr(e.source) : ""
3327
+ e.source ? Yr(e.source) : ""
3232
3328
  ].join(":");
3233
3329
  }
3234
- function jn(e) {
3330
+ function Hn(e) {
3235
3331
  const r = e;
3236
3332
  return typeof (r == null ? void 0 : r.rowCount) == "number" ? r.rowCount : Array.isArray(r == null ? void 0 : r.records) ? r.records.length : void 0;
3237
3333
  }
3238
- function Hn(e) {
3334
+ function Vn(e) {
3239
3335
  const r = e;
3240
3336
  return Array.isArray(r == null ? void 0 : r.columns) ? r.columns.length : void 0;
3241
3337
  }
3242
- function cr(e) {
3338
+ function ur(e) {
3243
3339
  const r = e;
3244
3340
  return r == null ? void 0 : r.executionResult;
3245
3341
  }
3246
- function fr(e) {
3342
+ function cr(e) {
3247
3343
  const r = e;
3248
3344
  return typeof (r == null ? void 0 : r.requestId) == "string" ? r.requestId : void 0;
3249
3345
  }
3250
- function Or(e) {
3346
+ function Dr(e) {
3251
3347
  let r = 2166136261;
3252
3348
  for (let t = 0; t < e.length; t += 1)
3253
3349
  r ^= e.charCodeAt(t), r = Math.imul(r, 16777619);
3254
3350
  return (r >>> 0).toString(36);
3255
3351
  }
3256
- function Se() {
3352
+ function be() {
3257
3353
  return (/* @__PURE__ */ new Date()).toISOString();
3258
3354
  }
3259
- function Ge() {
3355
+ function Ue() {
3260
3356
  return typeof performance < "u" && performance.now ? performance.now() : Date.now();
3261
3357
  }
3262
- const Vn = [
3358
+ const Qn = [
3263
3359
  "primary",
3264
3360
  "comparisons",
3265
3361
  "contributors",
@@ -3273,7 +3369,7 @@ const Vn = [
3273
3369
  "largestPositiveChanges",
3274
3370
  "largestNegativeDrivers",
3275
3371
  "largestPositiveDrivers"
3276
- ], Qn = [
3372
+ ], Un = [
3277
3373
  "primary",
3278
3374
  "records",
3279
3375
  "periodChanges",
@@ -3288,12 +3384,12 @@ const Vn = [
3288
3384
  "largestNegativeDrivers",
3289
3385
  "largestPositiveDrivers"
3290
3386
  ];
3291
- function Br(e) {
3387
+ function Or(e) {
3292
3388
  if (!e)
3293
3389
  return {};
3294
- const r = Zn(e.executionResult), t = Un(e, r), n = Yn(t), i = Kr(
3295
- Ye(e.analysisWarnings),
3296
- ti(t)
3390
+ const r = ei(e.executionResult), t = Gn(e, r), n = Xn(t), i = Br(
3391
+ Je(e.analysisWarnings),
3392
+ ni(t)
3297
3393
  );
3298
3394
  return {
3299
3395
  ...e,
@@ -3306,19 +3402,19 @@ function Br(e) {
3306
3402
  } : {}
3307
3403
  };
3308
3404
  }
3309
- function Un(e, r) {
3310
- const t = Gn(e.resultSets);
3311
- for (const i of Vn) {
3405
+ function Gn(e, r) {
3406
+ const t = Jn(e.resultSets);
3407
+ for (const i of Qn) {
3312
3408
  if (t[i])
3313
3409
  continue;
3314
- const o = ei(e[i]);
3410
+ const o = ri(e[i]);
3315
3411
  if (!o.length)
3316
3412
  continue;
3317
- const u = r.length ? r : ri(o);
3413
+ const u = r.length ? r : ti(o);
3318
3414
  t[i] = {
3319
3415
  id: i,
3320
3416
  role: i,
3321
- ...Je({
3417
+ ...Ge({
3322
3418
  records: o,
3323
3419
  columns: u,
3324
3420
  resultSetKey: i
@@ -3327,20 +3423,20 @@ function Un(e, r) {
3327
3423
  rowCount: o.length
3328
3424
  };
3329
3425
  }
3330
- const n = Xn(e.executionResult);
3426
+ const n = Zn(e.executionResult);
3331
3427
  return n && n.records.length > 0 && !t.records && (t.records = n), t;
3332
3428
  }
3333
- function Gn(e) {
3429
+ function Jn(e) {
3334
3430
  return Object.fromEntries(
3335
3431
  Object.entries(e || {}).map(([r, t]) => [
3336
3432
  r,
3337
- Jn(t, r)
3433
+ Yn(t, r)
3338
3434
  ])
3339
3435
  );
3340
3436
  }
3341
- function Jn(e, r = e.id || e.role || "resultSet") {
3437
+ function Yn(e, r = e.id || e.role || "resultSet") {
3342
3438
  var n;
3343
- const t = Je({
3439
+ const t = Ge({
3344
3440
  records: e.records || [],
3345
3441
  columns: e.columns || [],
3346
3442
  resultSetKey: r
@@ -3349,28 +3445,28 @@ function Jn(e, r = e.id || e.role || "resultSet") {
3349
3445
  ...e,
3350
3446
  ...t,
3351
3447
  ...e.warnings || t.warnings ? {
3352
- warnings: Kr(
3353
- Ye(e.warnings),
3448
+ warnings: Br(
3449
+ Je(e.warnings),
3354
3450
  t.warnings
3355
3451
  )
3356
3452
  } : {},
3357
3453
  rowCount: e.rowCount ?? ((n = e.records) == null ? void 0 : n.length) ?? 0
3358
3454
  };
3359
3455
  }
3360
- function Yn(e) {
3456
+ function Xn(e) {
3361
3457
  var r;
3362
- for (const t of Qn)
3458
+ for (const t of Un)
3363
3459
  if ((r = e[t]) != null && r.records.length)
3364
3460
  return e[t];
3365
3461
  return Object.values(e).find((t) => t.records.length) || Object.values(e)[0];
3366
3462
  }
3367
- function Xn(e) {
3463
+ function Zn(e) {
3368
3464
  const r = e == null ? void 0 : e.result;
3369
3465
  if (!(!r || r.kind !== "records" && r.kind !== "sql"))
3370
3466
  return {
3371
3467
  id: "records",
3372
3468
  role: "records",
3373
- ...Je({
3469
+ ...Ge({
3374
3470
  records: r.records,
3375
3471
  columns: r.columns,
3376
3472
  resultSetKey: "records"
@@ -3379,16 +3475,16 @@ function Xn(e) {
3379
3475
  rowCount: r.rowCount ?? r.records.length
3380
3476
  };
3381
3477
  }
3382
- function Zn(e) {
3478
+ function ei(e) {
3383
3479
  const r = e == null ? void 0 : e.result;
3384
3480
  return !r || r.kind !== "records" && r.kind !== "sql" ? [] : r.columns;
3385
3481
  }
3386
- function ei(e) {
3482
+ function ri(e) {
3387
3483
  return Array.isArray(e) ? e.filter(
3388
3484
  (r) => !!(r && typeof r == "object" && !Array.isArray(r))
3389
3485
  ) : [];
3390
3486
  }
3391
- function Je({
3487
+ function Ge({
3392
3488
  records: e,
3393
3489
  columns: r,
3394
3490
  resultSetKey: t
@@ -3399,9 +3495,9 @@ function Je({
3399
3495
  return {
3400
3496
  records: e.map((o, u) => {
3401
3497
  const f = {};
3402
- return r.forEach((l) => {
3403
- if (Object.prototype.hasOwnProperty.call(o, l.key)) {
3404
- f[l.key] = o[l.key];
3498
+ return r.forEach((d) => {
3499
+ if (Object.prototype.hasOwnProperty.call(o, d.key)) {
3500
+ f[d.key] = o[d.key];
3405
3501
  return;
3406
3502
  }
3407
3503
  n.push({
@@ -3409,18 +3505,18 @@ function Je({
3409
3505
  severity: "warning",
3410
3506
  resultSetKey: t,
3411
3507
  rowIndex: u,
3412
- columnKey: l.key,
3413
- ...l.name ? { columnName: l.name } : {},
3414
- ...l.label ? { columnLabel: l.label } : {},
3508
+ columnKey: d.key,
3509
+ ...d.name ? { columnName: d.name } : {},
3510
+ ...d.label ? { columnLabel: d.label } : {},
3415
3511
  availableKeys: Object.keys(o),
3416
- message: `Analysis result set "${t}" row ${u} is missing column key "${l.key}". Rows must expose values by column.key; labels and column names are display metadata only.`
3512
+ message: `Analysis result set "${t}" row ${u} is missing column key "${d.key}". Rows must expose values by column.key; labels and column names are display metadata only.`
3417
3513
  });
3418
3514
  }), f;
3419
3515
  }),
3420
3516
  ...n.length ? { warnings: n } : {}
3421
3517
  };
3422
3518
  }
3423
- function ri(e) {
3519
+ function ti(e) {
3424
3520
  return Array.from(
3425
3521
  new Set(e.flatMap((t) => Object.keys(t)))
3426
3522
  ).map((t) => ({
@@ -3429,46 +3525,46 @@ function ri(e) {
3429
3525
  label: t
3430
3526
  }));
3431
3527
  }
3432
- function ti(e) {
3528
+ function ni(e) {
3433
3529
  return Object.values(e).flatMap(
3434
- (r) => Ye(r.warnings)
3530
+ (r) => Je(r.warnings)
3435
3531
  );
3436
3532
  }
3437
- function Ye(e) {
3438
- return Array.isArray(e) ? e.filter(ni) : [];
3533
+ function Je(e) {
3534
+ return Array.isArray(e) ? e.filter(ii) : [];
3439
3535
  }
3440
- function ni(e) {
3536
+ function ii(e) {
3441
3537
  return !!(e && typeof e == "object" && !Array.isArray(e));
3442
3538
  }
3443
- function Kr(...e) {
3539
+ function Br(...e) {
3444
3540
  const r = /* @__PURE__ */ new Set(), t = [];
3445
3541
  for (const n of e.flatMap((i) => i || [])) {
3446
- const i = ii(n);
3542
+ const i = oi(n);
3447
3543
  r.has(i) || (r.add(i), t.push(n));
3448
3544
  }
3449
3545
  return t;
3450
3546
  }
3451
- function ii(e) {
3547
+ function oi(e) {
3452
3548
  return e.code === "missing_analysis_result_key" ? [
3453
3549
  e.code,
3454
3550
  e.resultSetKey,
3455
3551
  e.rowIndex,
3456
3552
  e.columnKey
3457
- ].join(":") : Fe(e);
3553
+ ].join(":") : ze(e);
3458
3554
  }
3459
- function Fe(e) {
3555
+ function ze(e) {
3460
3556
  if (!e || typeof e != "object")
3461
3557
  return JSON.stringify(e);
3462
3558
  if (Array.isArray(e))
3463
- return `[${e.map((t) => Fe(t)).join(",")}]`;
3559
+ return `[${e.map((t) => ze(t)).join(",")}]`;
3464
3560
  const r = e;
3465
- return `{${Object.keys(r).sort().map((t) => `${JSON.stringify(t)}:${Fe(r[t])}`).join(",")}}`;
3561
+ return `{${Object.keys(r).sort().map((t) => `${JSON.stringify(t)}:${ze(r[t])}`).join(",")}}`;
3466
3562
  }
3467
- const Be = { value: null }, Ke = {}, oi = { records: [] }, We = { options: [] }, si = { records: [] }, _e = {};
3468
- function ai(e) {
3469
- const r = re(e.inputs), t = Qr(e);
3563
+ const Oe = { value: null }, Be = {}, si = { records: [] }, Ke = { options: [] }, ai = { records: [] }, We = {};
3564
+ function di(e) {
3565
+ const r = X(e.inputs), t = Vr(e);
3470
3566
  try {
3471
- const n = Ur(e), i = ne(n, "analysis");
3567
+ const n = Qr(e), i = ee(n, "analysis");
3472
3568
  return i ? {
3473
3569
  error: i,
3474
3570
  activeInputs: r,
@@ -3479,17 +3575,17 @@ function ai(e) {
3479
3575
  i,
3480
3576
  t
3481
3577
  ),
3482
- idleData: Ke
3578
+ idleData: Be
3483
3579
  } : {
3484
3580
  intent: n,
3485
3581
  error: null,
3486
3582
  activeInputs: r,
3487
3583
  analysisOptions: t,
3488
3584
  queryKey: q(n, r, void 0, t),
3489
- idleData: Ke
3585
+ idleData: Be
3490
3586
  };
3491
3587
  } catch (n) {
3492
- const i = te(n, "analysis");
3588
+ const i = Z(n, "analysis");
3493
3589
  return {
3494
3590
  error: i,
3495
3591
  activeInputs: r,
@@ -3500,40 +3596,40 @@ function ai(e) {
3500
3596
  i,
3501
3597
  t
3502
3598
  ),
3503
- idleData: Ke
3599
+ idleData: Be
3504
3600
  };
3505
3601
  }
3506
3602
  }
3507
3603
  function li(e) {
3508
- const r = re(e.inputs);
3604
+ const r = X(e.inputs);
3509
3605
  try {
3510
- const t = Gr(e), n = ne(t);
3606
+ const t = Ur(e), n = ee(t);
3511
3607
  return n ? {
3512
3608
  error: n,
3513
3609
  activeInputs: r,
3514
3610
  queryKey: q(void 0, r, n),
3515
- idleData: Be
3611
+ idleData: Oe
3516
3612
  } : {
3517
3613
  intent: t,
3518
3614
  error: null,
3519
3615
  activeInputs: r,
3520
3616
  queryKey: q(t, r),
3521
- idleData: Be
3617
+ idleData: Oe
3522
3618
  };
3523
3619
  } catch (t) {
3524
- const n = te(t, "metric");
3620
+ const n = Z(t, "metric");
3525
3621
  return {
3526
3622
  error: n,
3527
3623
  activeInputs: r,
3528
3624
  queryKey: q(void 0, r, n),
3529
- idleData: Be
3625
+ idleData: Oe
3530
3626
  };
3531
3627
  }
3532
3628
  }
3533
- function di(e) {
3534
- const r = re(e.inputs), t = oi;
3629
+ function ui(e) {
3630
+ const r = X(e.inputs), t = si;
3535
3631
  try {
3536
- const n = Vr(e), i = ne(n);
3632
+ const n = Hr(e), i = ee(n);
3537
3633
  return i ? {
3538
3634
  error: i,
3539
3635
  activeInputs: r,
@@ -3547,7 +3643,7 @@ function di(e) {
3547
3643
  idleData: t
3548
3644
  };
3549
3645
  } catch (n) {
3550
- const i = te(n, "records");
3646
+ const i = Z(n, "records");
3551
3647
  return {
3552
3648
  error: i,
3553
3649
  activeInputs: r,
@@ -3556,36 +3652,36 @@ function di(e) {
3556
3652
  };
3557
3653
  }
3558
3654
  }
3559
- function ui(e) {
3560
- const r = re(e.inputs);
3655
+ function ci(e) {
3656
+ const r = X(e.inputs);
3561
3657
  try {
3562
- const t = Hr(e), n = ne(t);
3658
+ const t = jr(e), n = ee(t);
3563
3659
  return n ? {
3564
3660
  error: n,
3565
3661
  activeInputs: r,
3566
3662
  queryKey: q(void 0, r, n),
3567
- idleData: We
3663
+ idleData: Ke
3568
3664
  } : {
3569
3665
  intent: t,
3570
3666
  error: null,
3571
3667
  activeInputs: r,
3572
3668
  queryKey: q(t, r),
3573
- idleData: We
3669
+ idleData: Ke
3574
3670
  };
3575
3671
  } catch (t) {
3576
- const n = te(t, "inputOptions");
3672
+ const n = Z(t, "inputOptions");
3577
3673
  return {
3578
3674
  error: n,
3579
3675
  activeInputs: r,
3580
3676
  queryKey: q(void 0, r, n),
3581
- idleData: We
3677
+ idleData: Ke
3582
3678
  };
3583
3679
  }
3584
3680
  }
3585
- function ci(e) {
3586
- const r = re(e.inputs), t = si;
3681
+ function fi(e) {
3682
+ const r = X(e.inputs), t = ai;
3587
3683
  try {
3588
- const n = jr(e), i = ne(n);
3684
+ const n = Mr(e), i = ee(n);
3589
3685
  return i ? {
3590
3686
  error: i,
3591
3687
  activeInputs: r,
@@ -3599,7 +3695,7 @@ function ci(e) {
3599
3695
  idleData: t
3600
3696
  };
3601
3697
  } catch (n) {
3602
- const i = te(n, "sql");
3698
+ const i = Z(n, "sql");
3603
3699
  return {
3604
3700
  error: i,
3605
3701
  activeInputs: r,
@@ -3608,37 +3704,37 @@ function ci(e) {
3608
3704
  };
3609
3705
  }
3610
3706
  }
3611
- function fi(e) {
3612
- const r = re(e.inputs);
3707
+ function pi(e) {
3708
+ const r = X(e.inputs);
3613
3709
  try {
3614
- const t = Mr(e), n = ne(t);
3710
+ const t = Fr(e), n = ee(t);
3615
3711
  return n ? {
3616
3712
  error: n,
3617
3713
  activeInputs: r,
3618
3714
  queryKey: q(void 0, r, n),
3619
- idleData: _e
3715
+ idleData: We
3620
3716
  } : {
3621
3717
  intent: t,
3622
3718
  error: null,
3623
3719
  activeInputs: r,
3624
3720
  queryKey: q(t, r),
3625
- idleData: _e
3721
+ idleData: We
3626
3722
  };
3627
3723
  } catch (t) {
3628
- const n = te(t, "matrix");
3724
+ const n = Z(t, "matrix");
3629
3725
  return {
3630
3726
  error: n,
3631
3727
  activeInputs: r,
3632
3728
  queryKey: q(void 0, r, n),
3633
- idleData: _e
3729
+ idleData: We
3634
3730
  };
3635
3731
  }
3636
3732
  }
3637
- function Me(e) {
3733
+ function Fe(e) {
3638
3734
  var o;
3639
- if (pi(e))
3735
+ if (gi(e))
3640
3736
  return e;
3641
- const r = e instanceof Error ? e : void 0, t = e, n = t == null ? void 0 : t.executionResult, i = ke(
3737
+ const r = e instanceof Error ? e : void 0, t = e, n = t == null ? void 0 : t.executionResult, i = Te(
3642
3738
  (r == null ? void 0 : r.message) ?? String(e),
3643
3739
  {
3644
3740
  requestId: typeof (t == null ? void 0 : t.requestId) == "string" ? t.requestId : void 0,
@@ -3650,8 +3746,8 @@ function Me(e) {
3650
3746
  );
3651
3747
  return i.name = (r == null ? void 0 : r.name) || i.name, i.stack = r == null ? void 0 : r.stack, i;
3652
3748
  }
3653
- function te(e, r) {
3654
- const t = Me(e);
3749
+ function Z(e, r) {
3750
+ const t = Fe(e);
3655
3751
  if (t.executionResult || t.validation)
3656
3752
  return t;
3657
3753
  const n = {
@@ -3671,39 +3767,39 @@ function te(e, r) {
3671
3767
  recommendedNextStep: "Update the Data App query spec to satisfy the SDK builder contract."
3672
3768
  }
3673
3769
  ]
3674
- }, i = Wr(
3770
+ }, i = Kr(
3675
3771
  void 0,
3676
3772
  r,
3677
3773
  n
3678
- ), o = ke(t.message, {
3774
+ ), o = Te(t.message, {
3679
3775
  executionResult: i,
3680
3776
  validation: n,
3681
3777
  validationIssues: n.errors
3682
3778
  });
3683
3779
  return o.stack = t.stack, o;
3684
3780
  }
3685
- function ke(e, r = {}) {
3781
+ function Te(e, r = {}) {
3686
3782
  var i, o, u;
3687
3783
  const t = new Error(e);
3688
3784
  t.name = "SemaphorDataAppQueryError", t.kind = "data_app_query_error", r.requestId && (t.requestId = r.requestId), r.details !== void 0 && (t.details = r.details), r.executionResult !== void 0 && (t.executionResult = r.executionResult), r.validation !== void 0 && (t.validation = r.validation);
3689
3785
  const n = r.validationIssues ?? ((i = r.validation) == null ? void 0 : i.errors) ?? ((u = (o = r.executionResult) == null ? void 0 : o.validation) == null ? void 0 : u.errors);
3690
3786
  return n !== void 0 && (t.validationIssues = n), t;
3691
3787
  }
3692
- function pi(e) {
3788
+ function gi(e) {
3693
3789
  return e instanceof Error && e.kind === "data_app_query_error";
3694
3790
  }
3695
- function ne(e, r = e.kind) {
3696
- const t = lt(e);
3791
+ function ee(e, r = e.kind) {
3792
+ const t = at(e);
3697
3793
  if (t.ok)
3698
3794
  return null;
3699
3795
  const n = t.errors.map(
3700
3796
  (o) => o.path ? `${o.code} at ${o.path}: ${o.message}` : `${o.code}: ${o.message}`
3701
- ).join("; "), i = Wr(
3797
+ ).join("; "), i = Kr(
3702
3798
  e,
3703
3799
  r,
3704
3800
  t
3705
3801
  );
3706
- return ke(
3802
+ return Te(
3707
3803
  `Invalid Semaphor analytics intent. ${n}`,
3708
3804
  {
3709
3805
  executionResult: i,
@@ -3712,7 +3808,7 @@ function ne(e, r = e.kind) {
3712
3808
  }
3713
3809
  );
3714
3810
  }
3715
- function Wr(e, r, t) {
3811
+ function Kr(e, r, t) {
3716
3812
  return {
3717
3813
  ...e != null && e.id ? { intentId: e.id } : {},
3718
3814
  ...e ? { intent: e } : {},
@@ -3759,26 +3855,26 @@ function q(e, r, t, n) {
3759
3855
  error: t == null ? void 0 : t.message
3760
3856
  });
3761
3857
  }
3762
- function gi() {
3858
+ function mi() {
3763
3859
  return {
3764
- executeAnalysis: (e, r, t) => Y(
3860
+ executeAnalysis: (e, r, t) => G(
3765
3861
  e,
3766
3862
  r,
3767
3863
  t ?? {}
3768
- ).then(Br),
3769
- executeMetric: (e, r) => Y(e, r),
3770
- executeRecords: (e, r) => Y(e, r),
3771
- executeInputOptions: (e, r) => Y(e, r),
3772
- executeSql: (e, r) => Y(e, r),
3773
- executeMatrix: (e, r) => Y(e, r)
3864
+ ).then(Or),
3865
+ executeMetric: (e, r) => G(e, r),
3866
+ executeRecords: (e, r) => G(e, r),
3867
+ executeInputOptions: (e, r) => G(e, r),
3868
+ executeSql: (e, r) => G(e, r),
3869
+ executeMatrix: (e, r) => G(e, r)
3774
3870
  };
3775
3871
  }
3776
- async function Y(e, r, t) {
3872
+ async function G(e, r, t) {
3777
3873
  if (!r.token)
3778
3874
  throw new Error(
3779
3875
  "SemaphorDataAppProvider needs a token to execute queries."
3780
3876
  );
3781
- const n = Ii(r), i = hi(e, n);
3877
+ const n = xi(r), i = bi(e, n);
3782
3878
  let o;
3783
3879
  try {
3784
3880
  o = await fetch(n, {
@@ -3792,7 +3888,7 @@ async function Y(e, r, t) {
3792
3888
  activeInputs: r.activeInputs,
3793
3889
  ...t ? { analysisOptions: t } : {},
3794
3890
  resultShape: e.kind,
3795
- ...yi(r) ? { debug: { responseDetail: "debug" } } : {}
3891
+ ...hi(r) ? { debug: { responseDetail: "debug" } } : {}
3796
3892
  })
3797
3893
  });
3798
3894
  } catch (f) {
@@ -3800,37 +3896,37 @@ async function Y(e, r, t) {
3800
3896
  `${i}: ${f instanceof Error ? f.message : String(f)}`
3801
3897
  );
3802
3898
  }
3803
- const u = await Si(o);
3899
+ const u = await wi(o);
3804
3900
  if (!o.ok || u.error)
3805
- throw mi(
3901
+ throw yi(
3806
3902
  `${i}: ${u.error || `Semaphor Data App execution failed with status ${o.status}.`}`,
3807
3903
  u
3808
3904
  );
3809
3905
  return u;
3810
3906
  }
3811
- function mi(e, r) {
3907
+ function yi(e, r) {
3812
3908
  var t;
3813
- return ke(e, {
3909
+ return Te(e, {
3814
3910
  requestId: r.requestId,
3815
3911
  details: r.details,
3816
3912
  executionResult: r.executionResult,
3817
3913
  validation: (t = r.executionResult) == null ? void 0 : t.validation
3818
3914
  });
3819
3915
  }
3820
- function yi(e) {
3916
+ function hi(e) {
3821
3917
  const r = e.debug;
3822
3918
  return r ? r === !0 ? !0 : r.enabled !== !1 && r.requestServerDebug !== !1 : !1;
3823
3919
  }
3824
- function hi(e, r) {
3920
+ function bi(e, r) {
3825
3921
  return [
3826
3922
  `Semaphor ${e.kind} query`,
3827
3923
  e.id ? `id=${e.id}` : void 0,
3828
3924
  e.label ? `label=${e.label}` : void 0,
3829
- bi(e),
3830
- `endpoint=${vi(r)}`
3925
+ vi(e),
3926
+ `endpoint=${Si(r)}`
3831
3927
  ].filter((t) => !!t).join(" ");
3832
3928
  }
3833
- function bi(e) {
3929
+ function vi(e) {
3834
3930
  const r = "source" in e ? e.source : void 0;
3835
3931
  if (!(!r || typeof r != "object")) {
3836
3932
  if (r.kind === "semantic")
@@ -3849,7 +3945,7 @@ function bi(e) {
3849
3945
  return r.connectionId ? `source=${r.connectionId}` : void 0;
3850
3946
  }
3851
3947
  }
3852
- function vi(e) {
3948
+ function Si(e) {
3853
3949
  if (!e)
3854
3950
  return "/api/v1/data-app/execute";
3855
3951
  try {
@@ -3858,7 +3954,7 @@ function vi(e) {
3858
3954
  return e;
3859
3955
  }
3860
3956
  }
3861
- async function Si(e) {
3957
+ async function wi(e) {
3862
3958
  const r = await e.text().catch(() => "");
3863
3959
  if (!r.trim())
3864
3960
  return e.ok ? {
@@ -3871,82 +3967,82 @@ async function Si(e) {
3871
3967
  error: "Semaphor Data App execution returned invalid JSON.",
3872
3968
  details: r
3873
3969
  } : {
3874
- error: wi(e, r),
3970
+ error: Ii(e, r),
3875
3971
  details: r
3876
3972
  };
3877
3973
  }
3878
3974
  }
3879
- function wi(e, r) {
3975
+ function Ii(e, r) {
3880
3976
  const t = e.statusText ? ` ${e.statusText}` : "", n = r.replace(/\s+/g, " ").trim();
3881
3977
  return n ? `Semaphor Data App execution failed with status ${e.status}${t}: ${n.slice(0, 240)}` : `Semaphor Data App execution failed with status ${e.status}${t}.`;
3882
3978
  }
3883
- function Ii(e) {
3884
- const r = xi(e).replace(/\/+$/, "");
3979
+ function xi(e) {
3980
+ const r = qi(e).replace(/\/+$/, "");
3885
3981
  return r ? r.endsWith("/api") ? `${r}/v1/data-app/execute` : `${r}/api/v1/data-app/execute` : "/api/v1/data-app/execute";
3886
3982
  }
3887
- function xi(e) {
3983
+ function qi(e) {
3888
3984
  if (e.apiBaseUrl)
3889
3985
  return e.apiBaseUrl;
3890
3986
  if (!e.token)
3891
3987
  return "";
3892
3988
  try {
3893
- return at(e.token).apiServiceUrl || "";
3989
+ return st(e.token).apiServiceUrl || "";
3894
3990
  } catch {
3895
3991
  return "";
3896
3992
  }
3897
3993
  }
3898
- const _r = qe({});
3899
- function qi() {
3994
+ const Wr = Ie({});
3995
+ function Ti() {
3900
3996
  if (!(typeof window > "u"))
3901
3997
  return window.__SEMAPHOR_DATA_APP_RUNTIME__;
3902
3998
  }
3903
3999
  function Ai() {
3904
- return G(_r);
4000
+ return Q(Wr);
3905
4001
  }
3906
- function Qi(e) {
3907
- const [r, t] = M(e.defaultValue), n = Object.prototype.hasOwnProperty.call(e, "value"), i = n ? e.value : r, o = I(
3908
- () => mr(e.options),
4002
+ function Ui(e) {
4003
+ const [r, t] = F(e.defaultValue), n = Object.prototype.hasOwnProperty.call(e, "value"), i = n ? e.value : r, o = I(
4004
+ () => gr(e.options),
3909
4005
  [e.options]
3910
- ), u = $(
3911
- (l) => {
3912
- var m;
3913
- const c = l;
3914
- (m = e.onValueChange) == null || m.call(e, c), n || t(c);
4006
+ ), u = O(
4007
+ (d) => {
4008
+ var y;
4009
+ const c = d;
4010
+ (y = e.onValueChange) == null || y.call(e, c), n || t(c);
3915
4011
  },
3916
4012
  [n, e]
3917
- ), f = $(() => u(void 0), [u]);
4013
+ ), f = O(() => u(void 0), [u]);
3918
4014
  return I(() => {
3919
- const l = yr(e);
4015
+ const d = mr(e);
3920
4016
  return {
3921
4017
  id: e.id,
3922
4018
  kind: e.kind,
3923
4019
  label: e.label,
3924
- field: l.field,
3925
- operator: l.operator,
3926
- relationshipHint: l.relationshipHint,
4020
+ field: d.field,
4021
+ operator: d.operator,
4022
+ relationshipHint: d.relationshipHint,
3927
4023
  controlRole: e.kind === "control" ? e.role : void 0,
3928
4024
  value: i,
3929
4025
  options: o,
3930
- isActive: fe(i),
4026
+ isActive: ue(i),
3931
4027
  setValue: u,
3932
4028
  clear: f,
3933
4029
  toAnalyticsInput: () => ({
3934
- inputId: l.inputId,
3935
- field: l.field,
4030
+ inputId: d.inputId,
4031
+ field: d.field,
3936
4032
  kind: e.kind,
3937
4033
  label: e.label,
3938
4034
  value: i,
3939
- isActive: fe(i),
3940
- operator: l.operator,
3941
- relationshipHint: l.relationshipHint,
4035
+ isActive: ue(i),
4036
+ operator: d.operator,
4037
+ relationshipHint: d.relationshipHint,
3942
4038
  controlRole: e.kind === "control" ? e.role : void 0
3943
4039
  })
3944
4040
  };
3945
4041
  }, [f, o, u, e, i]);
3946
4042
  }
3947
- function Ui(e) {
3948
- const [r, t] = M(() => Di(e));
3949
- return W(() => {
4043
+ function Gi(e) {
4044
+ const [r, t] = F(() => Di(e));
4045
+ return B(() => {
3950
4046
  t((n) => {
3951
4047
  let i = n;
3952
4048
  for (const o of e)
@@ -3958,13 +4054,13 @@ function Ui(e) {
3958
4054
  const i = Object.prototype.hasOwnProperty.call(
3959
4055
  n,
3960
4056
  "value"
3961
- ), o = i ? n.value : r[n.id], u = mr(n.options), f = (m) => {
3962
- var h;
3963
- (h = n.onValueChange) == null || h.call(n, m), i || t((S) => ({
3964
- ...S,
3965
- [n.id]: m
4057
+ ), o = i ? n.value : r[n.id], u = gr(n.options), f = (y) => {
4058
+ var m;
4059
+ (m = n.onValueChange) == null || m.call(n, y), i || t((v) => ({
4060
+ ...v,
4061
+ [n.id]: y
3966
4062
  }));
3967
- }, l = () => f(void 0), c = yr(n);
4063
+ }, d = () => f(void 0), c = mr(n);
3968
4064
  return {
3969
4065
  id: n.id,
3970
4066
  kind: n.kind,
@@ -3975,16 +4071,16 @@ function Ui(e) {
3975
4071
  controlRole: n.kind === "control" ? n.role : void 0,
3976
4072
  value: o,
3977
4073
  options: u,
3978
- isActive: fe(o),
4074
+ isActive: ue(o),
3979
4075
  setValue: f,
3980
- clear: l,
4076
+ clear: d,
3981
4077
  toAnalyticsInput: () => ({
3982
4078
  inputId: c.inputId,
3983
4079
  field: c.field,
3984
4080
  kind: n.kind,
3985
4081
  label: n.label,
3986
4082
  value: o,
3987
- isActive: fe(o),
4083
+ isActive: ue(o),
3988
4084
  operator: c.operator,
3989
4085
  relationshipHint: c.relationshipHint,
3990
4086
  controlRole: n.kind === "control" ? n.role : void 0
@@ -3994,29 +4090,29 @@ function Ui(e) {
3994
4090
  [e, r]
3995
4091
  );
3996
4092
  }
3997
- function Gi(e, r) {
4093
+ function Ji(e, r) {
3998
4094
  const t = (r == null ? void 0 : r.status) === "success" ? r.options : void 0, n = I(() => ki(t), [t]);
3999
- W(() => {
4095
+ B(() => {
4000
4096
  Ci(e.value, t) || e.clear();
4001
4097
  }, [e, n, r == null ? void 0 : r.status, t]);
4002
4098
  }
4003
4099
  function Ci(e, r) {
4004
- if (!fe(e) || r === void 0)
4100
+ if (!ue(e) || r === void 0)
4005
4101
  return !0;
4006
4102
  const t = new Set(
4007
- r.map((i) => pr(i.value))
4103
+ r.map((i) => fr(i.value))
4008
4104
  );
4009
4105
  return (Array.isArray(e) ? e : [e]).every(
4010
- (i) => t.has(pr(i))
4106
+ (i) => t.has(fr(i))
4011
4107
  );
4012
4108
  }
4013
4109
  function ki(e) {
4014
4110
  return JSON.stringify((e || []).map((r) => r.value));
4015
4111
  }
4016
- function pr(e) {
4112
+ function fr(e) {
4017
4113
  return `${typeof e}:${String(e)}`;
4018
4114
  }
4019
- function Ji(e, r = {}) {
4115
+ function Yi(e, r = {}) {
4020
4116
  const t = I(
4021
4117
  () => r.inputs ? {
4022
4118
  ...e,
@@ -4033,39 +4129,39 @@ function Ji(e, r = {}) {
4033
4129
  case "analysis":
4034
4130
  return {
4035
4131
  queryKind: t.queryKind,
4036
- request: ai(t)
4132
+ request: di(t)
4037
4133
  };
4038
4134
  case "records":
4039
4135
  return {
4040
4136
  queryKind: t.queryKind,
4041
- request: di(t)
4137
+ request: ui(t)
4042
4138
  };
4043
4139
  case "inputOptions":
4044
4140
  return {
4045
4141
  queryKind: t.queryKind,
4046
- request: ui(t)
4142
+ request: ci(t)
4047
4143
  };
4048
4144
  case "sql":
4049
4145
  return {
4050
4146
  queryKind: t.queryKind,
4051
- request: ci(t)
4147
+ request: fi(t)
4052
4148
  };
4053
4149
  case "matrix":
4054
4150
  return {
4055
4151
  queryKind: t.queryKind,
4056
- request: fi(t)
4152
+ request: pi(t)
4057
4153
  };
4058
4154
  default:
4059
- return Ie(t);
4155
+ return Se(t);
4060
4156
  }
4061
- }, [t]), i = Wt({
4157
+ }, [t]), i = Kt({
4062
4158
  spec: t,
4063
4159
  queryKind: n.queryKind,
4064
4160
  queryKey: n.request.queryKey,
4065
4161
  intent: n.request.intent,
4066
4162
  activeInputs: n.request.activeInputs,
4067
4163
  debug: r.debug
4068
- }), o = L(null), u = I(
4164
+ }), o = E(null), u = I(
4069
4165
  () => ({
4070
4166
  start: i.start,
4071
4167
  success: i.success,
@@ -4078,204 +4174,205 @@ function Ji(e, r = {}) {
4078
4174
  i.start,
4079
4175
  i.success
4080
4176
  ]
4081
- ), f = $(
4082
- (d) => {
4083
- var O, A, _, D, y, w, R, x, T;
4084
- const v = n.request;
4085
- if (v.intent)
4177
+ ), f = O(
4178
+ (l) => {
4179
+ var K, A, N, $, S, w, L, x, D;
4180
+ const b = n.request;
4181
+ if (b.intent)
4086
4182
  switch (n.queryKind) {
4087
4183
  case "metric":
4088
- return (O = d.executor) == null ? void 0 : O.executeMetric(
4089
- v.intent,
4090
- d
4184
+ return (K = l.executor) == null ? void 0 : K.executeMetric(
4185
+ b.intent,
4186
+ l
4091
4187
  );
4092
4188
  case "analysis":
4093
- return (_ = (A = d.executor) == null ? void 0 : A.executeAnalysis) == null ? void 0 : _.call(
4189
+ return (N = (A = l.executor) == null ? void 0 : A.executeAnalysis) == null ? void 0 : N.call(
4094
4190
  A,
4095
- v.intent,
4096
- d,
4097
- v.analysisOptions
4191
+ b.intent,
4192
+ l,
4193
+ b.analysisOptions
4098
4194
  );
4099
4195
  case "records":
4100
- return (D = d.executor) == null ? void 0 : D.executeRecords(
4101
- v.intent,
4102
- d
4196
+ return ($ = l.executor) == null ? void 0 : $.executeRecords(
4197
+ b.intent,
4198
+ l
4103
4199
  );
4104
4200
  case "inputOptions":
4105
- return (y = d.executor) == null ? void 0 : y.executeInputOptions(
4106
- v.intent,
4107
- d
4201
+ return (S = l.executor) == null ? void 0 : S.executeInputOptions(
4202
+ b.intent,
4203
+ l
4108
4204
  );
4109
4205
  case "sql":
4110
- return (R = (w = d.executor) == null ? void 0 : w.executeSql) == null ? void 0 : R.call(
4206
+ return (L = (w = l.executor) == null ? void 0 : w.executeSql) == null ? void 0 : L.call(
4111
4207
  w,
4112
- v.intent,
4113
- d
4208
+ b.intent,
4209
+ l
4114
4210
  );
4115
4211
  case "matrix":
4116
- return (T = (x = d.executor) == null ? void 0 : x.executeMatrix) == null ? void 0 : T.call(
4212
+ return (D = (x = l.executor) == null ? void 0 : x.executeMatrix) == null ? void 0 : D.call(
4117
4213
  x,
4118
- v.intent,
4119
- d
4214
+ b.intent,
4215
+ l
4120
4216
  );
4121
4217
  default:
4122
- return Ie(n);
4218
+ return Se(n);
4123
4219
  }
4124
4220
  },
4125
4221
  [n]
4126
- ), l = Li(
4222
+ ), d = $i(
4127
4223
  n.request.queryKey,
4128
4224
  f,
4129
4225
  n.request.idleData,
4130
4226
  n.request.activeInputs,
4131
4227
  u
4132
- ), c = i.queryId, m = i.validationFailure;
4133
- W(() => {
4134
- const d = n.request.error;
4135
- if (!d) {
4228
+ ), c = i.queryId, y = i.validationFailure;
4229
+ B(() => {
4230
+ const l = n.request.error;
4231
+ if (!l) {
4136
4232
  o.current = null;
4137
4233
  return;
4138
4234
  }
4139
- const v = `${c}:${d.message}`;
4140
- o.current !== v && (o.current = v, m(d));
4235
+ const b = `${c}:${l.message}`;
4236
+ o.current !== b && (o.current = b, y(l));
4141
4237
  }, [
4142
4238
  n.request.error,
4143
4239
  n.request.queryKey,
4144
4240
  c,
4145
- m
4241
+ y
4146
4242
  ]);
4147
- const h = n.request.error ? n.request.idleData : l.data, S = n.request.error ? "error" : l.status, g = !n.request.error && l.status === "loading", b = n.request.error || l.error, E = i.trace;
4243
+ const m = n.request.error ? n.request.idleData : d.data, v = n.request.error ? "error" : d.status, g = !n.request.error && d.status === "loading", h = n.request.error || d.error, T = i.trace;
4148
4244
  switch (n.queryKind) {
4149
4245
  case "metric": {
4150
- const d = h, v = X({
4246
+ const l = m, b = J({
4151
4247
  queryKind: n.queryKind,
4152
- status: S,
4248
+ status: v,
4153
4249
  isLoading: g,
4154
- error: b,
4155
- trace: E,
4156
- payload: d,
4250
+ error: h,
4251
+ trace: T,
4252
+ payload: l,
4157
4253
  activeInputs: n.request.activeInputs,
4158
- isStale: l.isStale
4254
+ isStale: d.isStale
4159
4255
  });
4160
4256
  return {
4161
4257
  id: t.id,
4162
4258
  intent: n.request.intent,
4163
- value: (d == null ? void 0 : d.value) ?? null,
4164
- measures: d == null ? void 0 : d.measures,
4165
- comparisonValue: d == null ? void 0 : d.comparisonValue,
4166
- delta: d == null ? void 0 : d.delta,
4167
- deltaPercent: d == null ? void 0 : d.deltaPercent,
4168
- records: d == null ? void 0 : d.records,
4169
- ...v
4259
+ value: (l == null ? void 0 : l.value) ?? null,
4260
+ measures: l == null ? void 0 : l.measures,
4261
+ comparisonValue: l == null ? void 0 : l.comparisonValue,
4262
+ delta: l == null ? void 0 : l.delta,
4263
+ deltaPercent: l == null ? void 0 : l.deltaPercent,
4264
+ records: l == null ? void 0 : l.records,
4265
+ ...b
4170
4266
  };
4171
4267
  }
4172
4268
  case "analysis": {
4173
- const d = Br(h), v = X({
4269
+ const l = Or(m), b = J({
4174
4270
  queryKind: n.queryKind,
4175
- status: S,
4271
+ status: v,
4176
4272
  isLoading: g,
4177
- error: b,
4178
- trace: E,
4179
- payload: d,
4273
+ error: h,
4274
+ trace: T,
4275
+ payload: l,
4180
4276
  activeInputs: n.request.activeInputs,
4181
- isStale: l.isStale
4277
+ isStale: d.isStale
4182
4278
  });
4183
4279
  return {
4184
4280
  id: t.id,
4185
4281
  intent: n.request.intent,
4186
- ...d || {},
4187
- ...v
4282
+ ...l || {},
4283
+ ...b
4188
4284
  };
4189
4285
  }
4190
4286
  case "records": {
4191
- const d = h, v = X({
4287
+ const l = m, b = J({
4192
4288
  queryKind: n.queryKind,
4193
- status: S,
4289
+ status: v,
4194
4290
  isLoading: g,
4195
- error: b,
4196
- trace: E,
4197
- payload: d,
4291
+ error: h,
4292
+ trace: T,
4293
+ payload: l,
4198
4294
  activeInputs: n.request.activeInputs,
4199
- isStale: l.isStale
4295
+ isStale: d.isStale
4200
4296
  });
4201
4297
  return {
4202
4298
  id: t.id,
4203
4299
  intent: n.request.intent,
4204
- records: (d == null ? void 0 : d.records) || [],
4205
- columns: d == null ? void 0 : d.columns,
4206
- rowCount: d == null ? void 0 : d.rowCount,
4207
- pagination: d == null ? void 0 : d.pagination,
4208
- ...v
4300
+ records: (l == null ? void 0 : l.records) || [],
4301
+ columns: l == null ? void 0 : l.columns,
4302
+ rowCount: l == null ? void 0 : l.rowCount,
4303
+ pagination: l == null ? void 0 : l.pagination,
4304
+ totals: l == null ? void 0 : l.totals,
4305
+ ...b
4209
4306
  };
4210
4307
  }
4211
4308
  case "inputOptions": {
4212
- const d = h, v = X({
4309
+ const l = m, b = J({
4213
4310
  queryKind: n.queryKind,
4214
- status: S,
4311
+ status: v,
4215
4312
  isLoading: g,
4216
- error: b,
4217
- trace: E,
4218
- payload: d,
4313
+ error: h,
4314
+ trace: T,
4315
+ payload: l,
4219
4316
  activeInputs: n.request.activeInputs,
4220
- isStale: l.isStale
4317
+ isStale: d.isStale
4221
4318
  });
4222
4319
  return {
4223
4320
  id: t.id,
4224
4321
  intent: n.request.intent,
4225
- options: (d == null ? void 0 : d.options) || [],
4226
- ...v
4322
+ options: (l == null ? void 0 : l.options) || [],
4323
+ ...b
4227
4324
  };
4228
4325
  }
4229
4326
  case "sql": {
4230
- const d = h, v = X({
4327
+ const l = m, b = J({
4231
4328
  queryKind: n.queryKind,
4232
- status: S,
4329
+ status: v,
4233
4330
  isLoading: g,
4234
- error: b,
4235
- trace: E,
4236
- payload: d,
4331
+ error: h,
4332
+ trace: T,
4333
+ payload: l,
4237
4334
  activeInputs: n.request.activeInputs,
4238
- isStale: l.isStale
4335
+ isStale: d.isStale
4239
4336
  });
4240
4337
  return {
4241
4338
  id: t.id,
4242
4339
  intent: n.request.intent,
4243
- records: (d == null ? void 0 : d.records) || [],
4244
- columns: d == null ? void 0 : d.columns,
4245
- rowCount: d == null ? void 0 : d.rowCount,
4246
- pagination: d == null ? void 0 : d.pagination,
4247
- output: d == null ? void 0 : d.output,
4248
- rowLimitExceeded: d == null ? void 0 : d.rowLimitExceeded,
4249
- ...v
4340
+ records: (l == null ? void 0 : l.records) || [],
4341
+ columns: l == null ? void 0 : l.columns,
4342
+ rowCount: l == null ? void 0 : l.rowCount,
4343
+ pagination: l == null ? void 0 : l.pagination,
4344
+ output: l == null ? void 0 : l.output,
4345
+ rowLimitExceeded: l == null ? void 0 : l.rowLimitExceeded,
4346
+ ...b
4250
4347
  };
4251
4348
  }
4252
4349
  case "matrix": {
4253
- const d = h, v = X({
4350
+ const l = m, b = J({
4254
4351
  queryKind: n.queryKind,
4255
- status: S,
4352
+ status: v,
4256
4353
  isLoading: g,
4257
- error: b,
4258
- trace: E,
4259
- payload: d,
4354
+ error: h,
4355
+ trace: T,
4356
+ payload: l,
4260
4357
  activeInputs: n.request.activeInputs,
4261
- isStale: l.isStale
4358
+ isStale: d.isStale
4262
4359
  });
4263
4360
  return {
4264
4361
  id: t.id,
4265
4362
  intent: n.request.intent,
4266
- matrixResult: d == null ? void 0 : d.matrixResult,
4267
- grid: d == null ? void 0 : d.grid,
4268
- expansion: d == null ? void 0 : d.expansion,
4269
- ...v
4363
+ matrixResult: l == null ? void 0 : l.matrixResult,
4364
+ grid: l == null ? void 0 : l.grid,
4365
+ expansion: l == null ? void 0 : l.expansion,
4366
+ ...b
4270
4367
  };
4271
4368
  }
4272
4369
  default:
4273
- return Ie(n);
4370
+ return Se(n);
4274
4371
  }
4275
4372
  }
4276
- function X(e) {
4373
+ function J(e) {
4277
4374
  var o, u, f;
4278
- const r = Ti(e.payload) ?? ((o = e.error) == null ? void 0 : o.executionResult), t = ((u = e.error) == null ? void 0 : u.validation) ?? (r == null ? void 0 : r.validation), n = r == null ? void 0 : r.coverage, i = r == null ? void 0 : r.diagnosticFeedback;
4375
+ const r = Ei(e.payload) ?? ((o = e.error) == null ? void 0 : o.executionResult), t = ((u = e.error) == null ? void 0 : u.validation) ?? (r == null ? void 0 : r.validation), n = r == null ? void 0 : r.coverage, i = r == null ? void 0 : r.diagnosticFeedback;
4279
4376
  return {
4280
4377
  status: e.status,
4281
4378
  executionStatus: r == null ? void 0 : r.status,
@@ -4284,10 +4381,10 @@ function X(e) {
4284
4381
  coverage: n,
4285
4382
  diagnosticFeedback: i,
4286
4383
  isLoading: e.isLoading,
4287
- isEmpty: Ri(e.queryKind, e.payload, e.status),
4288
- isPartial: Ei(e.payload, r),
4384
+ isEmpty: Li(e.queryKind, e.payload, e.status),
4385
+ isPartial: Ri(e.payload, r),
4289
4386
  isFiltered: !!((f = e.activeInputs) != null && f.some(
4290
- (l) => l.kind === "filter" && l.isActive
4387
+ (d) => d.kind === "filter" && d.isActive
4291
4388
  )),
4292
4389
  isStale: e.isStale,
4293
4390
  isValidated: !!t,
@@ -4295,64 +4392,64 @@ function X(e) {
4295
4392
  trace: e.trace
4296
4393
  };
4297
4394
  }
4298
- function Ti(e) {
4395
+ function Ei(e) {
4299
4396
  const r = e;
4300
4397
  return r == null ? void 0 : r.executionResult;
4301
4398
  }
4302
- function Ei(e, r) {
4399
+ function Ri(e, r) {
4303
4400
  var n, i;
4304
4401
  const t = !!(e != null && e.rowLimitExceeded);
4305
4402
  return !!((r == null ? void 0 : r.status) === "partial" || ((n = r == null ? void 0 : r.diagnosticFeedback) == null ? void 0 : n.status) === "partial" || (r == null ? void 0 : r.status) !== "failed" && ((i = r == null ? void 0 : r.coverage) != null && i.missingObligations.length) || t);
4306
4403
  }
4307
- function Ri(e, r, t) {
4404
+ function Li(e, r, t) {
4308
4405
  var n, i, o, u, f;
4309
4406
  if (t !== "success")
4310
4407
  return !1;
4311
4408
  switch (e) {
4312
4409
  case "metric": {
4313
- const l = r;
4314
- return (l == null ? void 0 : l.value) == null && !K(l == null ? void 0 : l.records);
4410
+ const d = r;
4411
+ return (d == null ? void 0 : d.value) == null && !_(d == null ? void 0 : d.records);
4315
4412
  }
4316
4413
  case "analysis": {
4317
- const l = r;
4318
- return l ? !l.answerSummary && !K(l.records) && !K(l.changes) && !K(l.drivers) && !K(l.largestNegativeChanges) && !K(l.largestPositiveChanges) && !K(l.largestNegativeDrivers) && !K(l.largestPositiveDrivers) && !Object.values(l.resultSets || {}).some(
4319
- (c) => K(c.records)
4414
+ const d = r;
4415
+ return d ? !d.answerSummary && !_(d.records) && !_(d.changes) && !_(d.drivers) && !_(d.largestNegativeChanges) && !_(d.largestPositiveChanges) && !_(d.largestNegativeDrivers) && !_(d.largestPositiveDrivers) && !Object.values(d.resultSets || {}).some(
4416
+ (c) => _(c.records)
4320
4417
  ) : !0;
4321
4418
  }
4322
4419
  case "records": {
4323
- const l = r;
4324
- return !K(l == null ? void 0 : l.records);
4420
+ const d = r;
4421
+ return !_(d == null ? void 0 : d.records);
4325
4422
  }
4326
4423
  case "sql": {
4327
- const l = r;
4328
- return !K(l == null ? void 0 : l.records) && (l == null ? void 0 : l.output) === void 0;
4424
+ const d = r;
4425
+ return !_(d == null ? void 0 : d.records) && (d == null ? void 0 : d.output) === void 0;
4329
4426
  }
4330
4427
  case "inputOptions": {
4331
- const l = r;
4332
- return !((n = l == null ? void 0 : l.options) != null && n.length);
4428
+ const d = r;
4429
+ return !((n = d == null ? void 0 : d.options) != null && n.length);
4333
4430
  }
4334
4431
  case "matrix": {
4335
- const l = r;
4336
- return !((o = (i = l == null ? void 0 : l.matrixResult) == null ? void 0 : i.cells) != null && o.length) && !((f = (u = l == null ? void 0 : l.grid) == null ? void 0 : u.cells) != null && f.length);
4432
+ const d = r;
4433
+ return !((o = (i = d == null ? void 0 : d.matrixResult) == null ? void 0 : i.cells) != null && o.length) && !((f = (u = d == null ? void 0 : d.grid) == null ? void 0 : u.cells) != null && f.length);
4337
4434
  }
4338
4435
  default:
4339
- return Ie(e);
4436
+ return Se(e);
4340
4437
  }
4341
4438
  }
4342
- function K(e) {
4439
+ function _(e) {
4343
4440
  return Array.isArray(e) && e.length > 0;
4344
4441
  }
4345
- function Li(e, r, t, n, i) {
4346
- const o = Ai(), u = L(r), f = L(n), [l, c] = M({
4442
+ function $i(e, r, t, n, i) {
4443
+ const o = Ai(), u = E(r), f = E(n), [d, c] = F({
4347
4444
  status: "idle",
4348
4445
  data: t,
4349
4446
  error: null,
4350
4447
  isStale: !1
4351
4448
  });
4352
- return u.current = r, f.current = n, W(() => {
4353
- let m;
4449
+ return u.current = r, f.current = n, B(() => {
4450
+ let y;
4354
4451
  try {
4355
- m = u.current({
4452
+ y = u.current({
4356
4453
  ...o,
4357
4454
  activeInputs: f.current
4358
4455
  });
@@ -4360,54 +4457,54 @@ function Li(e, r, t, n, i) {
4360
4457
  i == null || i.failure(g, 0), c({
4361
4458
  status: "error",
4362
4459
  data: t,
4363
- error: Me(g),
4460
+ error: Fe(g),
4364
4461
  isStale: !1
4365
4462
  });
4366
4463
  return;
4367
4464
  }
4368
- if (!m) {
4465
+ if (!y) {
4369
4466
  c({ status: "idle", data: t, error: null, isStale: !1 });
4370
4467
  return;
4371
4468
  }
4372
- let h = !1;
4373
- const S = Nr();
4469
+ let m = !1;
4470
+ const v = _r();
4374
4471
  return i == null || i.start(), c((g) => ({
4375
4472
  status: "loading",
4376
4473
  data: g.data,
4377
4474
  error: null,
4378
4475
  isStale: g.isStale || g.status === "success"
4379
- })), m.then((g) => {
4380
- h ? i == null || i.ignored("superseded") : (i == null || i.success(g, gr(S)), c({ status: "success", data: g, error: null, isStale: !1 }));
4476
+ })), y.then((g) => {
4477
+ m ? i == null || i.ignored("superseded") : (i == null || i.success(g, pr(v)), c({ status: "success", data: g, error: null, isStale: !1 }));
4381
4478
  }).catch((g) => {
4382
- h ? i == null || i.ignored("superseded") : (i == null || i.failure(g, gr(S)), c({
4479
+ m ? i == null || i.ignored("superseded") : (i == null || i.failure(g, pr(v)), c({
4383
4480
  status: "error",
4384
4481
  data: t,
4385
- error: Me(g),
4482
+ error: Fe(g),
4386
4483
  isStale: !1
4387
4484
  }));
4388
4485
  }), () => {
4389
- h = !0;
4486
+ m = !0;
4390
4487
  };
4391
- }, [t, e, o, i]), l;
4488
+ }, [t, e, o, i]), d;
4392
4489
  }
4393
- function Nr() {
4490
+ function _r() {
4394
4491
  return typeof performance < "u" && performance.now ? performance.now() : Date.now();
4395
4492
  }
4396
- function gr(e) {
4397
- return Math.max(0, Math.round(Nr() - e));
4493
+ function pr(e) {
4494
+ return Math.max(0, Math.round(_r() - e));
4398
4495
  }
4399
4496
  function Di(e) {
4400
4497
  return Object.fromEntries(
4401
4498
  e.filter((r) => r.defaultValue !== void 0).map((r) => [r.id, r.defaultValue])
4402
4499
  );
4403
4500
  }
4404
- function Ie(e) {
4501
+ function Se(e) {
4405
4502
  throw new Error(`Unsupported Semaphor query kind: ${JSON.stringify(e)}`);
4406
4503
  }
4407
- function $i(e) {
4504
+ function Oi(e) {
4408
4505
  return !e || typeof e == "boolean" || e.enabled === !1 ? null : e.autoRenderDevtools === !0 ? {} : e.autoRenderDevtools ? e.autoRenderDevtools : null;
4409
4506
  }
4410
- function Yi({
4507
+ function Xi({
4411
4508
  token: e,
4412
4509
  apiBaseUrl: r,
4413
4510
  executor: t,
@@ -4415,33 +4512,33 @@ function Yi({
4415
4512
  children: i
4416
4513
  }) {
4417
4514
  var g;
4418
- const o = qi(), u = ((g = o == null ? void 0 : o.authToken) == null ? void 0 : g.accessToken) || e, f = (o == null ? void 0 : o.dataApiBaseUrl) || (o == null ? void 0 : o.apiBaseUrl) || r, l = (o == null ? void 0 : o.debug) ?? n, c = $i(l), m = I(() => gi(), []), h = t || m, S = I(
4515
+ const o = Ti(), u = ((g = o == null ? void 0 : o.authToken) == null ? void 0 : g.accessToken) || e, f = (o == null ? void 0 : o.dataApiBaseUrl) || (o == null ? void 0 : o.apiBaseUrl) || r, d = (o == null ? void 0 : o.debug) ?? n, c = Oi(d), y = I(() => mi(), []), m = t || y, v = I(
4419
4516
  () => ({
4420
4517
  token: u,
4421
4518
  apiBaseUrl: f,
4422
- executor: h,
4423
- debug: l
4519
+ executor: m,
4520
+ debug: d
4424
4521
  }),
4425
- [f, l, h, u]
4522
+ [f, d, m, u]
4426
4523
  );
4427
- return /* @__PURE__ */ s($t, { debug: l, children: /* @__PURE__ */ p(_r.Provider, { value: S, children: [
4524
+ return /* @__PURE__ */ a($t, { debug: d, children: /* @__PURE__ */ p(Wr.Provider, { value: v, children: [
4428
4525
  i,
4429
- c ? /* @__PURE__ */ s(Kt, { ...c }) : null
4526
+ c ? /* @__PURE__ */ a(Bt, { ...c }) : null
4430
4527
  ] }) });
4431
4528
  }
4432
4529
  export {
4433
- Yi as SemaphorDataAppProvider,
4434
- Kt as SemaphorDevtools,
4435
- Vi as SemaphorDevtoolsInspectButton,
4436
- Hi as SemaphorViewBoundary,
4437
- gi as createSemaphorQueryExecutor,
4438
- Fi as defineSemaphorDataApp,
4439
- Mi as defineSemaphorInput,
4530
+ Xi as SemaphorDataAppProvider,
4531
+ Bt as SemaphorDevtools,
4532
+ Qi as SemaphorDevtoolsInspectButton,
4533
+ Vi as SemaphorViewBoundary,
4534
+ mi as createSemaphorQueryExecutor,
4535
+ Mi as defineSemaphorDataApp,
4536
+ ji as defineSemaphorInput,
4440
4537
  Ci as isSemaphorInputValueValidForOptions,
4441
- ji as semaphor,
4442
- Gi as useClearInvalidSemaphorInputValue,
4443
- Ar as useSemaphorDevtools,
4444
- Qi as useSemaphorInput,
4445
- Ui as useSemaphorInputs,
4446
- Ji as useSemaphorQuery
4538
+ Hi as semaphor,
4539
+ Ji as useClearInvalidSemaphorInputValue,
4540
+ qr as useSemaphorDevtools,
4541
+ Ui as useSemaphorInput,
4542
+ Gi as useSemaphorInputs,
4543
+ Yi as useSemaphorQuery
4447
4544
  };