react-semaphor 0.1.417 → 0.1.419

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 (59) hide show
  1. package/dist/analytics-protocol/index.cjs +1 -1
  2. package/dist/analytics-protocol/index.js +49 -50
  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-DdhEt99q.js +2004 -0
  6. package/dist/chunks/analyze-result-contract-DwRzl7yJ.js +1 -0
  7. package/dist/chunks/{calendar-preferences-dialog-BOfryj8P.js → calendar-preferences-dialog-DIfAbE_y.js} +3 -3
  8. package/dist/chunks/{calendar-preferences-dialog-Rq9qiG3X.js → calendar-preferences-dialog-f0Z7Kf-U.js} +1 -1
  9. package/dist/chunks/{dashboard-briefing-launcher-D_P0cNQ_.js → dashboard-briefing-launcher-C3tNkGFG.js} +1 -1
  10. package/dist/chunks/{dashboard-briefing-launcher-DgvlOcRI.js → dashboard-briefing-launcher-anh-Jy5v.js} +4 -4
  11. package/dist/chunks/{dashboard-controls-JYTKRokc.js → dashboard-controls-8dCQaPaq.js} +5 -5
  12. package/dist/chunks/{dashboard-controls-DzVA-wWu.js → dashboard-controls-DQxlOxzy.js} +1 -1
  13. package/dist/chunks/{dashboard-json-D5TEri2w.js → dashboard-json-B309EInF.js} +1 -1
  14. package/dist/chunks/{dashboard-json-h6YMk_-l.js → dashboard-json-i7Ae9KGD.js} +3 -3
  15. package/dist/chunks/{edit-dashboard-visual-kfbu03n9.js → edit-dashboard-visual-4HycwBHR.js} +1 -1
  16. package/dist/chunks/{edit-dashboard-visual-DOtCYmDn.js → edit-dashboard-visual-z3IqzYnj.js} +4 -4
  17. package/dist/chunks/{index-BgESS5r7.js → index-B6DLEXRX.js} +163 -164
  18. package/dist/chunks/{index-Beol8cOo.js → index-yxKWKFdr.js} +4 -4
  19. package/dist/chunks/{switch-C8_t4Pio.js → switch-COWQU8aK.js} +1 -1
  20. package/dist/chunks/{switch--FHwRAOL.js → switch-D6Ygf3wA.js} +1 -1
  21. package/dist/chunks/{update-policy-CQLHKQ_h.js → update-policy-BzT2k4n6.js} +161 -142
  22. package/dist/chunks/update-policy-VloD-0YM.js +3 -0
  23. package/dist/chunks/{use-create-flow-overlay-state-NEs9ePDy.js → use-create-flow-overlay-state-CX0D-6HM.js} +3 -3
  24. package/dist/chunks/{use-create-flow-overlay-state-BEPWzqQn.js → use-create-flow-overlay-state-DENfd7sW.js} +1 -1
  25. package/dist/chunks/validators-BMQo93Y0.js +1 -0
  26. package/dist/chunks/{validators-UqQI3Cg_.js → validators-Cxr9qbrR.js} +1 -1
  27. package/dist/dashboard/index.cjs +1 -1
  28. package/dist/dashboard/index.js +1 -1
  29. package/dist/dashboard-authoring/index.cjs +3 -3
  30. package/dist/dashboard-authoring/index.js +28 -29
  31. package/dist/data-app-builder/index.cjs +1 -1
  32. package/dist/data-app-builder/index.js +2 -2
  33. package/dist/data-app-codegen/index.cjs +1 -1
  34. package/dist/data-app-codegen/index.js +2 -2
  35. package/dist/data-app-codegen-node/index.cjs +182 -122
  36. package/dist/data-app-codegen-node/index.js +727 -606
  37. package/dist/data-app-sdk/index.cjs +2 -2
  38. package/dist/data-app-sdk/index.js +339 -320
  39. package/dist/data-app-sdk-adapters/index.cjs +1 -1
  40. package/dist/data-app-sdk-adapters/index.js +26 -27
  41. package/dist/data-app-sdk-validation/index.cjs +1 -1
  42. package/dist/data-app-sdk-validation/index.js +17 -18
  43. package/dist/index.cjs +1 -1
  44. package/dist/index.js +7 -7
  45. package/dist/surfboard/index.cjs +1 -1
  46. package/dist/surfboard/index.js +2 -2
  47. package/dist/types/analytics-protocol.d.ts +9 -0
  48. package/dist/types/dashboard-assistant.d.ts +2 -0
  49. package/dist/types/data-app-codegen-node.d.ts +2 -1
  50. package/dist/types/data-app-codegen.d.ts +2 -1
  51. package/dist/types/data-app-sdk-validation.d.ts +2 -0
  52. package/dist/types/data-app-sdk.d.ts +9 -0
  53. package/package.json +1 -1
  54. package/dist/chunks/analyze-result-contract-B0O3oIYu.js +0 -1870
  55. package/dist/chunks/analyze-result-contract-CL97m8X8.js +0 -1
  56. package/dist/chunks/source-identity-BM2FvJDP.js +0 -1
  57. package/dist/chunks/source-identity-Cv4Nm3TM.js +0 -75
  58. package/dist/chunks/update-policy-B50M0Jeg.js +0 -3
  59. package/dist/chunks/validators-JzI7olk4.js +0 -1
@@ -1,12 +1,11 @@
1
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
2
  import { jsxs as p, Fragment as yr, jsx as a } from "react/jsx-runtime";
3
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-Cv4Nm3TM.js";
5
- import { d as ro } from "../chunks/source-identity-Cv4Nm3TM.js";
6
- import "../chunks/analyze-result-contract-B0O3oIYu.js";
4
+ import { H as Yr, K as Xr } from "../chunks/analyze-result-contract-DdhEt99q.js";
5
+ import { L as ro } from "../chunks/analyze-result-contract-DdhEt99q.js";
7
6
  import { M as Zr, a as et, S as rt, E as tt, C as nt } from "../chunks/search-BHsQIWBV.js";
8
7
  import { X as it, C as ot, j as st } from "../chunks/x-CXDkqdur.js";
9
- import { b as at } from "../chunks/validators-UqQI3Cg_.js";
8
+ import { b as at } from "../chunks/validators-Cxr9qbrR.js";
10
9
  function me(e, r, t = {}) {
11
10
  return {
12
11
  ...t,
@@ -131,12 +130,12 @@ const Hi = {
131
130
  };
132
131
  }
133
132
  }, ce = 10, _e = 8;
134
- function dt(e) {
133
+ function lt(e) {
135
134
  const r = e == null ? void 0 : e.result;
136
135
  if (r)
137
136
  switch (r.kind) {
138
137
  case "records":
139
- return de({
138
+ return le({
140
139
  title: "Records",
141
140
  rowNoun: "rows",
142
141
  records: r.records,
@@ -144,7 +143,7 @@ function dt(e) {
144
143
  rowCount: r.rowCount
145
144
  });
146
145
  case "sql":
147
- return de({
146
+ return le({
148
147
  title: "SQL Rows",
149
148
  rowNoun: "rows",
150
149
  records: r.records,
@@ -152,7 +151,7 @@ function dt(e) {
152
151
  rowCount: r.rowCount
153
152
  });
154
153
  case "inputOptions":
155
- return de({
154
+ return le({
156
155
  title: "Options",
157
156
  rowNoun: "options",
158
157
  records: r.options.slice(0, ce).map((t) => {
@@ -174,7 +173,7 @@ function dt(e) {
174
173
  });
175
174
  case "metric": {
176
175
  const t = [
177
- { metric: "value", value: r.value }
176
+ { metric: "primaryValue", value: r.primaryValue }
178
177
  ];
179
178
  return r.comparison && t.push(
180
179
  {
@@ -183,7 +182,7 @@ function dt(e) {
183
182
  },
184
183
  { metric: "delta", value: r.comparison.delta },
185
184
  { metric: "deltaPercent", value: r.comparison.deltaPercent }
186
- ), de({
185
+ ), le({
187
186
  title: "Metric",
188
187
  rowNoun: "values",
189
188
  records: t,
@@ -195,7 +194,7 @@ function dt(e) {
195
194
  });
196
195
  }
197
196
  case "matrix":
198
- return de({
197
+ return le({
199
198
  title: "Matrix Cells",
200
199
  rowNoun: "cells",
201
200
  records: r.cells.slice(0, ce).map((t) => {
@@ -221,14 +220,14 @@ function dt(e) {
221
220
  return ut(r);
222
221
  }
223
222
  }
224
- function de({
223
+ function le({
225
224
  title: e,
226
225
  rowNoun: r,
227
226
  records: t,
228
227
  columns: n,
229
228
  rowCount: i
230
229
  }) {
231
- const o = lt(n, t);
230
+ const o = dt(n, t);
232
231
  if (!o.length)
233
232
  return;
234
233
  const u = i ?? t.length, f = t.slice(0, ce);
@@ -241,7 +240,7 @@ function de({
241
240
  truncatedColumns: o.length > _e
242
241
  };
243
242
  }
244
- function lt(e, r) {
243
+ function dt(e, r) {
245
244
  if (e != null && e.length)
246
245
  return e.filter((n) => n.key).map((n) => ({
247
246
  key: n.key,
@@ -292,24 +291,24 @@ function Me(e) {
292
291
  (v = n == null ? void 0 : n.coverage) == null ? void 0 : v.missingObligations
293
292
  ), f = Ce(
294
293
  (g = n == null ? void 0 : n.coverage) == null ? void 0 : g.warnings
295
- ), l = [], c = xe(r);
296
- (t == null ? void 0 : t.status) === "error" && l.push({
294
+ ), d = [], c = xe(r);
295
+ (t == null ? void 0 : t.status) === "error" && d.push({
297
296
  trace: r,
298
297
  tone: "error",
299
298
  title: c,
300
299
  message: t.errorMessage || "Query attempt failed."
301
300
  });
302
301
  for (const h of r.clientWarnings)
303
- l.push({ trace: r, tone: "warning", title: c, message: h });
302
+ d.push({ trace: r, tone: "warning", title: c, message: h });
304
303
  for (const h of i)
305
- l.push({ trace: r, tone: "warning", title: c, ...h });
304
+ d.push({ trace: r, tone: "warning", title: c, ...h });
306
305
  for (const h of o)
307
- l.push({ trace: r, tone: "error", title: c, ...h });
306
+ d.push({ trace: r, tone: "error", title: c, ...h });
308
307
  for (const h of u)
309
- l.push({ trace: r, tone: "warning", title: c, message: h });
308
+ d.push({ trace: r, tone: "warning", title: c, message: h });
310
309
  for (const h of f)
311
- l.push({ trace: r, tone: "warning", title: c, ...h });
312
- return l;
310
+ d.push({ trace: r, tone: "warning", title: c, ...h });
311
+ return d;
313
312
  });
314
313
  }
315
314
  function mt(e) {
@@ -460,7 +459,7 @@ function qt(e) {
460
459
  color: "var(--sd-success-fg)"
461
460
  };
462
461
  }
463
- function Tt(e) {
462
+ function At(e) {
464
463
  return e === "right" ? {
465
464
  top: 16,
466
465
  right: 16,
@@ -479,7 +478,7 @@ function Tt(e) {
479
478
  borderRadius: 6
480
479
  };
481
480
  }
482
- function At(e) {
481
+ function Tt(e) {
483
482
  return e === "right" ? {
484
483
  gridTemplateColumns: "minmax(210px, 280px) minmax(0, 1fr)"
485
484
  } : {
@@ -1559,7 +1558,7 @@ function $t({
1559
1558
  Cn,
1560
1559
  t,
1561
1560
  Rr
1562
- ), o = E(n), u = hr(), [f, l] = F({ open: !1 });
1561
+ ), o = E(n), u = hr(), [f, d] = F({ open: !1 });
1563
1562
  o.current = n, B(() => {
1564
1563
  i({ type: "config", config: t });
1565
1564
  }, [t]), B(() => {
@@ -1574,11 +1573,11 @@ function $t({
1574
1573
  };
1575
1574
  }, [u, n.enabled, n.exposeWindowBridge]);
1576
1575
  const c = I(() => ({ state: n, dispatch: i }), [n]), y = O((h) => {
1577
- l({ open: !0, focus: h });
1576
+ d({ open: !0, focus: h });
1578
1577
  }, []), m = O(() => {
1579
- l((h) => ({ ...h, open: !1 }));
1578
+ d((h) => ({ ...h, open: !1 }));
1580
1579
  }, []), v = O((h) => {
1581
- l({ open: !0, focus: h });
1580
+ d({ open: !0, focus: h });
1582
1581
  }, []), g = I(
1583
1582
  () => ({
1584
1583
  open: f.open,
@@ -1630,13 +1629,13 @@ function Bt({
1630
1629
  className: n,
1631
1630
  style: i
1632
1631
  } = {}) {
1633
- const o = qr(), u = Q(He), [f, l] = 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;
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, A = (u == null ? void 0 : u.open) === !0;
1634
1633
  B(() => {
1635
1634
  wr();
1636
1635
  }, []), B(() => {
1637
1636
  r && o.enabled && (g == null || g());
1638
1637
  }, [r, o.enabled, g]), B(() => {
1639
- if (!T || !h)
1638
+ if (!A || !h)
1640
1639
  return;
1641
1640
  const S = (w) => {
1642
1641
  var x, D;
@@ -1646,22 +1645,22 @@ function Bt({
1646
1645
  return document.addEventListener("pointerdown", S, !0), document.addEventListener("mousedown", S, !0), document.addEventListener("click", S, !0), () => {
1647
1646
  document.removeEventListener("pointerdown", S, !0), document.removeEventListener("mousedown", S, !0), document.removeEventListener("click", S, !0);
1648
1647
  };
1649
- }, [h, T]);
1650
- const d = I(
1648
+ }, [h, A]);
1649
+ const l = I(
1651
1650
  () => ht(o.queries),
1652
1651
  [o.queries]
1653
1652
  ), b = I(
1654
1653
  () => Me(o.queries),
1655
1654
  [o.queries]
1656
- ), K = tn(d), A = I(
1655
+ ), K = tn(l), T = I(
1657
1656
  () => nn(o.queries, f),
1658
1657
  [o.queries, f]
1659
1658
  ), N = I(
1660
- () => on(A),
1661
- [A]
1659
+ () => on(T),
1660
+ [T]
1662
1661
  ), $ = I(
1663
- () => Tr(A, u == null ? void 0 : u.focus) || A[0],
1664
- [A, u == null ? void 0 : u.focus]
1662
+ () => Ar(T, u == null ? void 0 : u.focus) || T[0],
1663
+ [T, u == null ? void 0 : u.focus]
1665
1664
  );
1666
1665
  return !o.enabled || !u ? null : /* @__PURE__ */ p(yr, { children: [
1667
1666
  /* @__PURE__ */ p(
@@ -1675,7 +1674,7 @@ function Bt({
1675
1674
  style: {
1676
1675
  ...s.launcher,
1677
1676
  ...xt(e),
1678
- ...qt(d.severity),
1677
+ ...qt(l.severity),
1679
1678
  ...i
1680
1679
  },
1681
1680
  onClick: () => {
@@ -1691,11 +1690,11 @@ function Bt({
1691
1690
  },
1692
1691
  children: [
1693
1692
  /* @__PURE__ */ a(Wt, {}),
1694
- /* @__PURE__ */ a("span", { style: s.launcherText, children: d.total }),
1695
- d.issueCount > 0 ? /* @__PURE__ */ p("span", { style: s.launcherIssueCount, children: [
1696
- d.issueCount,
1693
+ /* @__PURE__ */ a("span", { style: s.launcherText, children: l.total }),
1694
+ l.issueCount > 0 ? /* @__PURE__ */ p("span", { style: s.launcherIssueCount, children: [
1695
+ l.issueCount,
1697
1696
  " issue",
1698
- d.issueCount === 1 ? "" : "s"
1697
+ l.issueCount === 1 ? "" : "s"
1699
1698
  ] }) : null
1700
1699
  ]
1701
1700
  }
@@ -1710,7 +1709,7 @@ function Bt({
1710
1709
  className: R,
1711
1710
  style: {
1712
1711
  ...s.panel,
1713
- ...Tt(t),
1712
+ ...At(t),
1714
1713
  ...c ? s.panelFullscreen : null
1715
1714
  },
1716
1715
  children: [
@@ -1718,17 +1717,17 @@ function Bt({
1718
1717
  /* @__PURE__ */ p("div", { style: s.panelTitleBlock, children: [
1719
1718
  /* @__PURE__ */ a("div", { style: s.panelTitle, children: "Semaphor Inspector" }),
1720
1719
  /* @__PURE__ */ p("div", { style: s.panelSubtitle, children: [
1721
- d.total,
1720
+ l.total,
1722
1721
  " queries · ",
1723
- d.loading,
1722
+ l.loading,
1724
1723
  " loading ·",
1725
1724
  " ",
1726
- d.failed,
1725
+ l.failed,
1727
1726
  " failed · ",
1728
- d.errorCount,
1727
+ l.errorCount,
1729
1728
  " errors ·",
1730
1729
  " ",
1731
- d.warningCount,
1730
+ l.warningCount,
1732
1731
  " warnings"
1733
1732
  ] })
1734
1733
  ] }),
@@ -1763,7 +1762,7 @@ function Bt({
1763
1762
  {
1764
1763
  "aria-label": "Search Semaphor traces",
1765
1764
  value: f,
1766
- onChange: (S) => l(S.currentTarget.value),
1765
+ onChange: (S) => d(S.currentTarget.value),
1767
1766
  placeholder: "Search traces",
1768
1767
  style: s.searchInput
1769
1768
  }
@@ -1785,7 +1784,7 @@ function Bt({
1785
1784
  {
1786
1785
  style: {
1787
1786
  ...s.panelBody,
1788
- ...At(t)
1787
+ ...Tt(t)
1789
1788
  },
1790
1789
  children: [
1791
1790
  /* @__PURE__ */ a(
@@ -1796,14 +1795,14 @@ function Bt({
1796
1795
  ...Ct()
1797
1796
  },
1798
1797
  "aria-label": "Registered queries",
1799
- children: A.length ? N.map((S) => /* @__PURE__ */ p("div", { style: s.queryGroup, children: [
1798
+ children: T.length ? N.map((S) => /* @__PURE__ */ p("div", { style: s.queryGroup, children: [
1800
1799
  /* @__PURE__ */ p("div", { style: s.queryGroupHeader, children: [
1801
1800
  /* @__PURE__ */ a("span", { children: S.title }),
1802
1801
  /* @__PURE__ */ a("span", { style: s.queryGroupCount, children: S.traces.length })
1803
1802
  ] }),
1804
1803
  S.traces.length ? S.traces.map((w) => {
1805
1804
  var ne;
1806
- 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);
1805
+ const L = an(w, $), x = xe(w), D = kr(w), pe = Er(w), re = dn(w, x, pe), te = re.join(" · "), k = Tr(D), M = yt(b, w);
1807
1806
  return /* @__PURE__ */ p(
1808
1807
  "button",
1809
1808
  {
@@ -1827,7 +1826,7 @@ function Bt({
1827
1826
  {
1828
1827
  style: {
1829
1828
  ...s.queryListKindChip,
1830
- ...Cr(C)
1829
+ ...Cr(k)
1831
1830
  },
1832
1831
  children: D
1833
1832
  }
@@ -1875,15 +1874,15 @@ function Qi({
1875
1874
  B(() => {
1876
1875
  wr();
1877
1876
  }, []);
1878
- const l = r || (f == null ? void 0 : f.id), c = I(
1877
+ const d = r || (f == null ? void 0 : f.id), c = I(
1879
1878
  () => sn(o.queries, {
1880
1879
  queryId: e,
1881
- viewId: l
1880
+ viewId: d
1882
1881
  }),
1883
1882
  [
1884
1883
  o.queries,
1885
1884
  e,
1886
- l
1885
+ d
1887
1886
  ]
1888
1887
  );
1889
1888
  if (!o.enabled || !u || !c)
@@ -1915,7 +1914,7 @@ function Qi({
1915
1914
  }
1916
1915
  function qr() {
1917
1916
  const e = Q(je);
1918
- return !e || !e.state.enabled ? Ir : le(e.state);
1917
+ return !e || !e.state.enabled ? Ir : de(e.state);
1919
1918
  }
1920
1919
  function Kt({
1921
1920
  spec: e,
@@ -1925,7 +1924,7 @@ function Kt({
1925
1924
  activeInputs: i,
1926
1925
  debug: o
1927
1926
  }) {
1928
- const u = Q(je), f = Q(Ve), l = !!(u != null && u.state.enabled), c = u == null ? void 0 : u.dispatch, y = Kn(e), m = pt(e), v = 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(
1929
1928
  () => JSON.stringify(e),
1930
1929
  [e]
1931
1930
  ), g = I(
@@ -1934,23 +1933,23 @@ function Kt({
1934
1933
  ), h = I(
1935
1934
  () => JSON.stringify(n || null),
1936
1935
  [n]
1937
- ), T = E(e), d = E(v), b = E(n), K = E(h), A = E(i), N = E(g), $ = Bn(o), S = JSON.stringify($ || []), w = E($), L = E(S);
1938
- d.current !== v && (d.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 = $);
1939
- const x = T.current, D = b.current, pe = A.current, re = w.current, te = hr(), C = I(
1936
+ ), A = E(e), l = E(v), b = E(n), K = E(h), T = E(i), N = E(g), $ = Bn(o), S = JSON.stringify($ || []), w = E($), L = E(S);
1937
+ l.current !== v && (l.current = v, A.current = e), K.current !== h && (K.current = h, b.current = n), N.current !== g && (N.current = g, T.current = i), L.current !== S && (L.current = S, w.current = $);
1938
+ const x = A.current, D = b.current, pe = T.current, re = w.current, te = hr(), k = I(
1940
1939
  () => y || `query_${Dr(t)}`,
1941
1940
  [t, y]
1942
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(
1943
1942
  () => [
1944
1943
  M || "unscoped-view",
1945
- C,
1944
+ k,
1946
1945
  te
1947
1946
  ].join("::"),
1948
- [C, te, M]
1947
+ [k, te, M]
1949
1948
  ), Ye = I(
1950
1949
  () => ({
1951
1950
  traceKey: j,
1952
1951
  spec: x,
1953
- queryId: C,
1952
+ queryId: k,
1954
1953
  queryLabel: m,
1955
1954
  queryKind: r,
1956
1955
  builder: Wn(r),
@@ -1964,7 +1963,7 @@ function Kt({
1964
1963
  clientWarnings: y ? [] : ["Query spec is missing an explicit id; using an opaque internal id."]
1965
1964
  }),
1966
1965
  [
1967
- C,
1966
+ k,
1968
1967
  r,
1969
1968
  y,
1970
1969
  m,
@@ -1980,32 +1979,32 @@ function Kt({
1980
1979
  ]
1981
1980
  );
1982
1981
  B(() => {
1983
- if (!(!l || !c))
1982
+ if (!(!d || !c))
1984
1983
  return c({ type: "register", descriptor: Ye }), () => {
1985
1984
  c({ type: "unregister", traceKey: j });
1986
1985
  };
1987
- }, [Ye, c, l, j]);
1986
+ }, [Ye, c, d, j]);
1988
1987
  const P = O(
1989
- (k, U) => {
1990
- !l || !c || c({ type: "event", traceKey: j, event: k, latestAttempt: U });
1988
+ (C, U) => {
1989
+ !d || !c || c({ type: "event", traceKey: j, event: C, latestAttempt: U });
1991
1990
  },
1992
- [c, l, j]
1991
+ [c, d, j]
1993
1992
  ), Xe = O(() => {
1994
1993
  P(
1995
1994
  {
1996
1995
  type: "query_started",
1997
- queryId: C,
1996
+ queryId: k,
1998
1997
  at: be()
1999
1998
  },
2000
1999
  { status: "loading" }
2001
2000
  );
2002
- }, [P, C]), Ze = O(
2003
- (k, U) => {
2004
- const se = cr(k), ae = Hn(k), Nr = Vn(k);
2001
+ }, [P, k]), Ze = O(
2002
+ (C, U) => {
2003
+ const se = cr(C), ae = Hn(C), Nr = Vn(C);
2005
2004
  P(
2006
2005
  {
2007
2006
  type: "query_succeeded",
2008
- queryId: C,
2007
+ queryId: k,
2009
2008
  requestId: se,
2010
2009
  at: be(),
2011
2010
  rowCount: ae,
@@ -2017,18 +2016,19 @@ function Kt({
2017
2016
  durationMs: U,
2018
2017
  rowCount: ae,
2019
2018
  columnCount: Nr,
2020
- executionResult: ur(k)
2019
+ metricCoverage: Qn(C),
2020
+ executionResult: ur(C)
2021
2021
  }
2022
2022
  );
2023
2023
  },
2024
- [P, C]
2024
+ [P, k]
2025
2025
  ), ge = O(
2026
- (k, U) => {
2027
- const se = cr(k), ae = k instanceof Error ? k.message : String(k);
2026
+ (C, U) => {
2027
+ const se = cr(C), ae = C instanceof Error ? C.message : String(C);
2028
2028
  P(
2029
2029
  {
2030
2030
  type: "query_failed",
2031
- queryId: C,
2031
+ queryId: k,
2032
2032
  requestId: se,
2033
2033
  at: be(),
2034
2034
  errorMessage: ae
@@ -2038,34 +2038,34 @@ function Kt({
2038
2038
  status: "error",
2039
2039
  durationMs: U,
2040
2040
  errorMessage: ae,
2041
- executionResult: ur(k)
2041
+ executionResult: ur(C)
2042
2042
  }
2043
2043
  );
2044
2044
  },
2045
- [P, C]
2045
+ [P, k]
2046
2046
  ), er = O(
2047
- (k) => {
2047
+ (C) => {
2048
2048
  P(
2049
2049
  {
2050
2050
  type: "query_ignored_stale",
2051
- queryId: C,
2051
+ queryId: k,
2052
2052
  at: be(),
2053
- reason: k
2053
+ reason: C
2054
2054
  }
2055
2055
  );
2056
2056
  },
2057
- [P, C]
2057
+ [P, k]
2058
2058
  ), rr = O(
2059
- (k) => {
2060
- ge(k, 0);
2059
+ (C) => {
2060
+ ge(C, 0);
2061
2061
  },
2062
2062
  [ge]
2063
- ), Ae = l ? u == null ? void 0 : u.state.entries[j] : void 0;
2063
+ ), Te = d ? u == null ? void 0 : u.state.entries[j] : void 0;
2064
2064
  return I(
2065
2065
  () => ({
2066
- enabled: l,
2067
- queryId: C,
2068
- trace: Ae ? ve(Ae) : void 0,
2066
+ enabled: d,
2067
+ queryId: k,
2068
+ trace: Te ? ve(Te) : void 0,
2069
2069
  start: Xe,
2070
2070
  success: Ze,
2071
2071
  failure: ge,
@@ -2073,13 +2073,13 @@ function Kt({
2073
2073
  validationFailure: rr
2074
2074
  }),
2075
2075
  [
2076
- l,
2076
+ d,
2077
2077
  ge,
2078
2078
  er,
2079
- C,
2079
+ k,
2080
2080
  Xe,
2081
2081
  Ze,
2082
- Ae,
2082
+ Te,
2083
2083
  rr
2084
2084
  ]
2085
2085
  );
@@ -2114,7 +2114,7 @@ function _t({
2114
2114
  (w = t == null ? void 0 : t.coverage) == null ? void 0 : w.missingObligations
2115
2115
  ), u = $e(
2116
2116
  (L = t == null ? void 0 : t.coverage) == null ? void 0 : L.warnings
2117
- ), f = t == null ? void 0 : t.compiledQuery, l = An(t), c = ((x = e.server) == null ? void 0 : x.compiledSql) || l.compiledSql, y = dt(t), m = [
2117
+ ), f = t == null ? void 0 : t.compiledQuery, d = Tn(t), c = ((x = e.server) == null ? void 0 : x.compiledSql) || d.compiledSql, y = lt(t), m = [
2118
2118
  ...r != null && r.errorMessage ? [r.errorMessage] : [],
2119
2119
  ...i
2120
2120
  ], v = [
@@ -2122,7 +2122,7 @@ function _t({
2122
2122
  ...n,
2123
2123
  ...o,
2124
2124
  ...u
2125
- ], g = e.inputsApplied.length > 0, h = !!(f || c), T = pn(e), d = 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
+ ], g = e.inputsApplied.length > 0, h = !!(f || c), A = pn(e), l = hn(r == null ? void 0 : r.rowCount), b = bn(r == null ? void 0 : r.durationMs), K = e.sourceRefs.length, T = kr(e), N = Tr(T);
2126
2126
  return /* @__PURE__ */ p("div", { style: s.detailsPane, children: [
2127
2127
  /* @__PURE__ */ p("div", { style: s.detailsHeader, children: [
2128
2128
  /* @__PURE__ */ p("div", { style: s.detailsHeaderTopRow, children: [
@@ -2144,15 +2144,15 @@ function _t({
2144
2144
  ...s.detailsKindChip,
2145
2145
  ...Cr(N)
2146
2146
  },
2147
- children: A
2147
+ children: T
2148
2148
  }
2149
2149
  )
2150
2150
  ] }),
2151
2151
  /* @__PURE__ */ p("div", { style: s.metaStrip, children: [
2152
- /* @__PURE__ */ a("span", { style: s.metaStripItem, children: T }),
2152
+ /* @__PURE__ */ a("span", { style: s.metaStripItem, children: A }),
2153
2153
  /* @__PURE__ */ a("span", { style: s.metaStripDot, children: "·" }),
2154
2154
  /* @__PURE__ */ p("span", { style: s.metaStripItem, children: [
2155
- d,
2155
+ l,
2156
2156
  " rows"
2157
2157
  ] }),
2158
2158
  /* @__PURE__ */ a("span", { style: s.metaStripDot, children: "·" }),
@@ -2186,7 +2186,7 @@ function Nt({
2186
2186
  compiledSql: n,
2187
2187
  hasCompiled: i
2188
2188
  }) {
2189
- var h, T;
2189
+ var h, A;
2190
2190
  const o = [];
2191
2191
  r && o.push({
2192
2192
  id: "returned",
@@ -2219,22 +2219,22 @@ function Nt({
2219
2219
  label: "Raw",
2220
2220
  render: () => /* @__PURE__ */ a("pre", { style: s.codeBlock, children: vn(e) })
2221
2221
  });
2222
- const u = (T = o[0]) == null ? void 0 : T.id, f = e.traceId || `${e.viewId ?? ""}:${e.queryId}`, [l, c] = F(u), y = E(f), m = E(!1), v = o.map((d) => d.id).join("|");
2222
+ const u = (A = o[0]) == null ? void 0 : A.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("|");
2223
2223
  B(() => {
2224
2224
  if (y.current !== f) {
2225
2225
  y.current = f, m.current = !1, c(u);
2226
2226
  return;
2227
2227
  }
2228
- if (!(l ? v.split("|").includes(l) : !1)) {
2228
+ if (!(d ? v.split("|").includes(d) : !1)) {
2229
2229
  m.current = !1, c(u);
2230
2230
  return;
2231
2231
  }
2232
- !m.current && l !== u && c(u);
2233
- }, [l, u, v, f]);
2234
- const g = o.find((d) => d.id === l) ?? o[0];
2232
+ !m.current && d !== u && c(u);
2233
+ }, [d, u, v, f]);
2234
+ const g = o.find((l) => l.id === d) ?? o[0];
2235
2235
  return /* @__PURE__ */ p("div", { style: s.traceTabs, children: [
2236
- /* @__PURE__ */ a("div", { style: s.traceTabBar, role: "tablist", "aria-label": "Trace details", children: o.map((d) => {
2237
- const b = d.id === g.id;
2236
+ /* @__PURE__ */ a("div", { style: s.traceTabBar, role: "tablist", "aria-label": "Trace details", children: o.map((l) => {
2237
+ const b = l.id === g.id;
2238
2238
  return /* @__PURE__ */ a(
2239
2239
  "button",
2240
2240
  {
@@ -2247,11 +2247,11 @@ function Nt({
2247
2247
  ...b ? s.traceTabActive : null
2248
2248
  },
2249
2249
  onClick: () => {
2250
- m.current = !0, c(d.id);
2250
+ m.current = !0, c(l.id);
2251
2251
  },
2252
- children: d.label
2252
+ children: l.label
2253
2253
  },
2254
- d.id
2254
+ l.id
2255
2255
  );
2256
2256
  }) }),
2257
2257
  /* @__PURE__ */ a("div", { style: s.traceTabPanel, role: "tabpanel", children: g.render() })
@@ -2280,7 +2280,7 @@ function zt({
2280
2280
  issues: e,
2281
2281
  onSelect: r
2282
2282
  }) {
2283
- 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, l = [
2283
+ 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 = [
2284
2284
  u ? `${u} error${u === 1 ? "" : "s"}` : "",
2285
2285
  f ? `${f} warning${f === 1 ? "" : "s"}` : ""
2286
2286
  ].filter(Boolean);
@@ -2335,7 +2335,7 @@ function zt({
2335
2335
  " in traces"
2336
2336
  ] }) : null
2337
2337
  ] }) : /* @__PURE__ */ p("div", { style: s.issueSummaryCollapsed, children: [
2338
- l.join(" · "),
2338
+ d.join(" · "),
2339
2339
  " across traces"
2340
2340
  ] })
2341
2341
  ] });
@@ -2711,13 +2711,13 @@ function on(e) {
2711
2711
  { title: "Inputs", traces: r }
2712
2712
  ];
2713
2713
  }
2714
- function Tr(e, r) {
2714
+ function Ar(e, r) {
2715
2715
  if (!(!(r != null && r.traceId) && !(r != null && r.queryId) && !(r != null && r.viewId)))
2716
2716
  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));
2717
2717
  }
2718
2718
  function sn(e, r) {
2719
2719
  if (r.queryId)
2720
- return Tr(e, r);
2720
+ return Ar(e, r);
2721
2721
  if (!r.viewId)
2722
2722
  return;
2723
2723
  const t = e.filter((n) => n.viewId === r.viewId);
@@ -2729,7 +2729,7 @@ function an(e, r) {
2729
2729
  function Ne(e) {
2730
2730
  return e.traceId;
2731
2731
  }
2732
- function dn(e) {
2732
+ function ln(e) {
2733
2733
  switch (e) {
2734
2734
  case "metric":
2735
2735
  return "metric";
@@ -2747,7 +2747,7 @@ function dn(e) {
2747
2747
  return qe(e);
2748
2748
  }
2749
2749
  }
2750
- function Ar(e) {
2750
+ function Tr(e) {
2751
2751
  const r = e.trim().toLowerCase();
2752
2752
  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";
2753
2753
  }
@@ -2783,12 +2783,12 @@ function Cr(e) {
2783
2783
  };
2784
2784
  }
2785
2785
  }
2786
- function ln(e, r, t) {
2786
+ function dn(e, r, t) {
2787
2787
  const n = [];
2788
2788
  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;
2789
2789
  }
2790
2790
  function kr(e) {
2791
- return cn(e.visualType) || dn(e.queryKind);
2791
+ return cn(e.visualType) || ln(e.queryKind);
2792
2792
  }
2793
2793
  function un(e, r) {
2794
2794
  return r ? e.queryLabel || e.queryId : xe(e);
@@ -2838,8 +2838,8 @@ function gn(e) {
2838
2838
  return [e.aggregate, e.label || e.name].filter(Boolean).join(" ");
2839
2839
  }
2840
2840
  function mn(e) {
2841
- var f, l, c;
2842
- 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 ? z(e.fieldRef.source) : void 0, o = [n ? `on ${n}` : void 0, i].filter(Boolean).join(" · "), u = [
2841
+ var f, d, c;
2842
+ 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 = [
2843
2843
  t,
2844
2844
  e.inputId,
2845
2845
  e.operator,
@@ -2913,9 +2913,9 @@ function $e(e) {
2913
2913
  }
2914
2914
  function qn(e) {
2915
2915
  var r;
2916
- return (r = Tn(e)) == null ? void 0 : r.message;
2916
+ return (r = An(e)) == null ? void 0 : r.message;
2917
2917
  }
2918
- function Tn(e) {
2918
+ function An(e) {
2919
2919
  if (typeof e == "string")
2920
2920
  return { message: e };
2921
2921
  if (!e || typeof e != "object" || Array.isArray(e))
@@ -2927,7 +2927,7 @@ function Tn(e) {
2927
2927
  ...i ? { path: i } : {}
2928
2928
  } : t ? { message: t } : n ? { message: n, code: n } : void 0;
2929
2929
  }
2930
- function An(e) {
2930
+ function Tn(e) {
2931
2931
  const r = e == null ? void 0 : e.metadata, t = r && typeof r == "object" && !Array.isArray(r) && "dataAppDebug" in r && r.dataAppDebug && typeof r.dataAppDebug == "object" && !Array.isArray(r.dataAppDebug) ? r.dataAppDebug : void 0;
2932
2932
  return {
2933
2933
  compiledSql: typeof (t == null ? void 0 : t.compiledSql) == "string" ? t.compiledSql : void 0,
@@ -3087,7 +3087,7 @@ function ve(e) {
3087
3087
  } = e;
3088
3088
  return o;
3089
3089
  }
3090
- function le(e) {
3090
+ function de(e) {
3091
3091
  if (!e.enabled)
3092
3092
  return Ir;
3093
3093
  const r = e.order.map((n) => e.entries[n]).filter((n) => !!n).map(ve), t = Me(r).map(mt);
@@ -3106,10 +3106,10 @@ function le(e) {
3106
3106
  }
3107
3107
  function Dn(e) {
3108
3108
  return {
3109
- snapshot: () => St(le(e())),
3110
- getQuery: (r) => nr(le(e()).getQuery(r)),
3111
- getQueries: (r) => le(e()).getQueries(r).map((t) => nr(t)).filter((t) => !!t),
3112
- getIssues: () => le(e()).issues
3109
+ snapshot: () => St(de(e())),
3110
+ getQuery: (r) => nr(de(e()).getQuery(r)),
3111
+ getQueries: (r) => de(e()).getQueries(r).map((t) => nr(t)).filter((t) => !!t),
3112
+ getIssues: () => de(e()).issues
3113
3113
  };
3114
3114
  }
3115
3115
  function On(e) {
@@ -3126,12 +3126,12 @@ function On(e) {
3126
3126
  } : {
3127
3127
  enabled: e.enabled !== !1,
3128
3128
  exposeWindowBridge: e.exposeWindowBridge === !0,
3129
- maxEventsPerQuery: dr(
3129
+ maxEventsPerQuery: lr(
3130
3130
  e.maxEventsPerQuery,
3131
3131
  Ee,
3132
3132
  Rt
3133
3133
  ),
3134
- maxQueries: dr(
3134
+ maxQueries: lr(
3135
3135
  e.maxQueries,
3136
3136
  Re,
3137
3137
  Lt
@@ -3163,7 +3163,7 @@ function he(e) {
3163
3163
  function ar(e) {
3164
3164
  return typeof e == "number" && Number.isInteger(e) && e > 0 ? e : void 0;
3165
3165
  }
3166
- function dr(e, r, t) {
3166
+ function lr(e, r, t) {
3167
3167
  return e === void 0 || !Number.isFinite(e) || !Number.isInteger(e) || e <= 0 ? r : Math.min(e, t);
3168
3168
  }
3169
3169
  function Kn(e) {
@@ -3201,14 +3201,14 @@ function _n(e) {
3201
3201
  ).map((n) => String(n));
3202
3202
  if (t.length === r.length && t.length > 0) {
3203
3203
  const n = t.slice(0, 3).join(", "), i = t.length > 3 ? `, +${t.length - 3} more` : "";
3204
- return lr(`${n}${i}`);
3204
+ return dr(`${n}${i}`);
3205
3205
  }
3206
3206
  return `${r.length} selected`;
3207
3207
  }
3208
- 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);
3208
+ return typeof r == "number" || typeof r == "boolean" ? String(r) : typeof r == "string" ? dr(r) : r && typeof r == "object" ? `object(${Object.keys(r).slice(0, 5).join(",")})` : String(r);
3209
3209
  }
3210
3210
  }
3211
- function lr(e) {
3211
+ function dr(e) {
3212
3212
  return e.length > 80 ? `${e.slice(0, 77)}...` : e;
3213
3213
  }
3214
3214
  function Nn(e) {
@@ -3340,6 +3340,19 @@ function ur(e) {
3340
3340
  const r = e;
3341
3341
  return r == null ? void 0 : r.executionResult;
3342
3342
  }
3343
+ function Qn(e) {
3344
+ const r = e, t = [
3345
+ ...r != null && r.measures ? Object.keys(r.measures) : [],
3346
+ ...r != null && r.measureBindings ? Object.keys(r.measureBindings) : []
3347
+ ].filter(Boolean).sort(), n = Array.isArray(r == null ? void 0 : r.missingMeasures) ? r.missingMeasures.filter(
3348
+ (i) => typeof i == "string" && !!i
3349
+ ) : [];
3350
+ if (!(t.length === 0 && n.length === 0))
3351
+ return {
3352
+ ...t.length > 0 ? { populatedMetricKeys: t } : {},
3353
+ ...n.length > 0 ? { missingMeasures: n } : {}
3354
+ };
3355
+ }
3343
3356
  function cr(e) {
3344
3357
  const r = e;
3345
3358
  return typeof (r == null ? void 0 : r.requestId) == "string" ? r.requestId : void 0;
@@ -3356,7 +3369,7 @@ function be() {
3356
3369
  function Ue() {
3357
3370
  return typeof performance < "u" && performance.now ? performance.now() : Date.now();
3358
3371
  }
3359
- const Qn = [
3372
+ const Un = [
3360
3373
  "primary",
3361
3374
  "comparisons",
3362
3375
  "contributors",
@@ -3370,7 +3383,7 @@ const Qn = [
3370
3383
  "largestPositiveChanges",
3371
3384
  "largestNegativeDrivers",
3372
3385
  "largestPositiveDrivers"
3373
- ], Un = [
3386
+ ], Gn = [
3374
3387
  "primary",
3375
3388
  "records",
3376
3389
  "periodChanges",
@@ -3388,9 +3401,9 @@ const Qn = [
3388
3401
  function Or(e) {
3389
3402
  if (!e)
3390
3403
  return {};
3391
- const r = ei(e.executionResult), t = Gn(e, r), n = Xn(t), i = Br(
3404
+ const r = ri(e.executionResult), t = Jn(e, r), n = Zn(t), i = Br(
3392
3405
  Je(e.analysisWarnings),
3393
- ni(t)
3406
+ ii(t)
3394
3407
  );
3395
3408
  return {
3396
3409
  ...e,
@@ -3403,15 +3416,15 @@ function Or(e) {
3403
3416
  } : {}
3404
3417
  };
3405
3418
  }
3406
- function Gn(e, r) {
3407
- const t = Jn(e.resultSets);
3408
- for (const i of Qn) {
3419
+ function Jn(e, r) {
3420
+ const t = Yn(e.resultSets);
3421
+ for (const i of Un) {
3409
3422
  if (t[i])
3410
3423
  continue;
3411
- const o = ri(e[i]);
3424
+ const o = ti(e[i]);
3412
3425
  if (!o.length)
3413
3426
  continue;
3414
- const u = r.length ? r : ti(o);
3427
+ const u = r.length ? r : ni(o);
3415
3428
  t[i] = {
3416
3429
  id: i,
3417
3430
  role: i,
@@ -3424,18 +3437,18 @@ function Gn(e, r) {
3424
3437
  rowCount: o.length
3425
3438
  };
3426
3439
  }
3427
- const n = Zn(e.executionResult);
3440
+ const n = ei(e.executionResult);
3428
3441
  return n && n.records.length > 0 && !t.records && (t.records = n), t;
3429
3442
  }
3430
- function Jn(e) {
3443
+ function Yn(e) {
3431
3444
  return Object.fromEntries(
3432
3445
  Object.entries(e || {}).map(([r, t]) => [
3433
3446
  r,
3434
- Yn(t, r)
3447
+ Xn(t, r)
3435
3448
  ])
3436
3449
  );
3437
3450
  }
3438
- function Yn(e, r = e.id || e.role || "resultSet") {
3451
+ function Xn(e, r = e.id || e.role || "resultSet") {
3439
3452
  var n;
3440
3453
  const t = Ge({
3441
3454
  records: e.records || [],
@@ -3454,14 +3467,14 @@ function Yn(e, r = e.id || e.role || "resultSet") {
3454
3467
  rowCount: e.rowCount ?? ((n = e.records) == null ? void 0 : n.length) ?? 0
3455
3468
  };
3456
3469
  }
3457
- function Xn(e) {
3470
+ function Zn(e) {
3458
3471
  var r;
3459
- for (const t of Un)
3472
+ for (const t of Gn)
3460
3473
  if ((r = e[t]) != null && r.records.length)
3461
3474
  return e[t];
3462
3475
  return Object.values(e).find((t) => t.records.length) || Object.values(e)[0];
3463
3476
  }
3464
- function Zn(e) {
3477
+ function ei(e) {
3465
3478
  const r = e == null ? void 0 : e.result;
3466
3479
  if (!(!r || r.kind !== "records" && r.kind !== "sql"))
3467
3480
  return {
@@ -3476,11 +3489,11 @@ function Zn(e) {
3476
3489
  rowCount: r.rowCount ?? r.records.length
3477
3490
  };
3478
3491
  }
3479
- function ei(e) {
3492
+ function ri(e) {
3480
3493
  const r = e == null ? void 0 : e.result;
3481
3494
  return !r || r.kind !== "records" && r.kind !== "sql" ? [] : r.columns;
3482
3495
  }
3483
- function ri(e) {
3496
+ function ti(e) {
3484
3497
  return Array.isArray(e) ? e.filter(
3485
3498
  (r) => !!(r && typeof r == "object" && !Array.isArray(r))
3486
3499
  ) : [];
@@ -3496,9 +3509,9 @@ function Ge({
3496
3509
  return {
3497
3510
  records: e.map((o, u) => {
3498
3511
  const f = {};
3499
- return r.forEach((l) => {
3500
- if (Object.prototype.hasOwnProperty.call(o, l.key)) {
3501
- f[l.key] = o[l.key];
3512
+ return r.forEach((d) => {
3513
+ if (Object.prototype.hasOwnProperty.call(o, d.key)) {
3514
+ f[d.key] = o[d.key];
3502
3515
  return;
3503
3516
  }
3504
3517
  n.push({
@@ -3506,18 +3519,18 @@ function Ge({
3506
3519
  severity: "warning",
3507
3520
  resultSetKey: t,
3508
3521
  rowIndex: u,
3509
- columnKey: l.key,
3510
- ...l.name ? { columnName: l.name } : {},
3511
- ...l.label ? { columnLabel: l.label } : {},
3522
+ columnKey: d.key,
3523
+ ...d.name ? { columnName: d.name } : {},
3524
+ ...d.label ? { columnLabel: d.label } : {},
3512
3525
  availableKeys: Object.keys(o),
3513
- 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.`
3526
+ 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.`
3514
3527
  });
3515
3528
  }), f;
3516
3529
  }),
3517
3530
  ...n.length ? { warnings: n } : {}
3518
3531
  };
3519
3532
  }
3520
- function ti(e) {
3533
+ function ni(e) {
3521
3534
  return Array.from(
3522
3535
  new Set(e.flatMap((t) => Object.keys(t)))
3523
3536
  ).map((t) => ({
@@ -3526,26 +3539,26 @@ function ti(e) {
3526
3539
  label: t
3527
3540
  }));
3528
3541
  }
3529
- function ni(e) {
3542
+ function ii(e) {
3530
3543
  return Object.values(e).flatMap(
3531
3544
  (r) => Je(r.warnings)
3532
3545
  );
3533
3546
  }
3534
3547
  function Je(e) {
3535
- return Array.isArray(e) ? e.filter(ii) : [];
3548
+ return Array.isArray(e) ? e.filter(oi) : [];
3536
3549
  }
3537
- function ii(e) {
3550
+ function oi(e) {
3538
3551
  return !!(e && typeof e == "object" && !Array.isArray(e));
3539
3552
  }
3540
3553
  function Br(...e) {
3541
3554
  const r = /* @__PURE__ */ new Set(), t = [];
3542
3555
  for (const n of e.flatMap((i) => i || [])) {
3543
- const i = oi(n);
3556
+ const i = si(n);
3544
3557
  r.has(i) || (r.add(i), t.push(n));
3545
3558
  }
3546
3559
  return t;
3547
3560
  }
3548
- function oi(e) {
3561
+ function si(e) {
3549
3562
  return e.code === "missing_analysis_result_key" ? [
3550
3563
  e.code,
3551
3564
  e.resultSetKey,
@@ -3561,7 +3574,10 @@ function ze(e) {
3561
3574
  const r = e;
3562
3575
  return `{${Object.keys(r).sort().map((t) => `${JSON.stringify(t)}:${ze(r[t])}`).join(",")}}`;
3563
3576
  }
3564
- const Oe = { value: null }, Be = {}, si = { records: [] }, Ke = { options: [] }, ai = { records: [] }, We = {};
3577
+ const Oe = {
3578
+ value: null,
3579
+ primaryValue: null
3580
+ }, Be = {}, ai = { records: [] }, Ke = { options: [] }, li = { records: [] }, We = {};
3565
3581
  function di(e) {
3566
3582
  const r = X(e.inputs), t = Vr(e);
3567
3583
  try {
@@ -3601,7 +3617,7 @@ function di(e) {
3601
3617
  };
3602
3618
  }
3603
3619
  }
3604
- function li(e) {
3620
+ function ui(e) {
3605
3621
  const r = X(e.inputs);
3606
3622
  try {
3607
3623
  const t = Ur(e), n = ee(t);
@@ -3627,8 +3643,8 @@ function li(e) {
3627
3643
  };
3628
3644
  }
3629
3645
  }
3630
- function ui(e) {
3631
- const r = X(e.inputs), t = si;
3646
+ function ci(e) {
3647
+ const r = X(e.inputs), t = ai;
3632
3648
  try {
3633
3649
  const n = Hr(e), i = ee(n);
3634
3650
  return i ? {
@@ -3653,7 +3669,7 @@ function ui(e) {
3653
3669
  };
3654
3670
  }
3655
3671
  }
3656
- function ci(e) {
3672
+ function fi(e) {
3657
3673
  const r = X(e.inputs);
3658
3674
  try {
3659
3675
  const t = jr(e), n = ee(t);
@@ -3679,8 +3695,8 @@ function ci(e) {
3679
3695
  };
3680
3696
  }
3681
3697
  }
3682
- function fi(e) {
3683
- const r = X(e.inputs), t = ai;
3698
+ function pi(e) {
3699
+ const r = X(e.inputs), t = li;
3684
3700
  try {
3685
3701
  const n = Mr(e), i = ee(n);
3686
3702
  return i ? {
@@ -3705,7 +3721,7 @@ function fi(e) {
3705
3721
  };
3706
3722
  }
3707
3723
  }
3708
- function pi(e) {
3724
+ function gi(e) {
3709
3725
  const r = X(e.inputs);
3710
3726
  try {
3711
3727
  const t = Fr(e), n = ee(t);
@@ -3733,9 +3749,9 @@ function pi(e) {
3733
3749
  }
3734
3750
  function Fe(e) {
3735
3751
  var o;
3736
- if (gi(e))
3752
+ if (mi(e))
3737
3753
  return e;
3738
- const r = e instanceof Error ? e : void 0, t = e, n = t == null ? void 0 : t.executionResult, i = Te(
3754
+ const r = e instanceof Error ? e : void 0, t = e, n = t == null ? void 0 : t.executionResult, i = Ae(
3739
3755
  (r == null ? void 0 : r.message) ?? String(e),
3740
3756
  {
3741
3757
  requestId: typeof (t == null ? void 0 : t.requestId) == "string" ? t.requestId : void 0,
@@ -3772,21 +3788,21 @@ function Z(e, r) {
3772
3788
  void 0,
3773
3789
  r,
3774
3790
  n
3775
- ), o = Te(t.message, {
3791
+ ), o = Ae(t.message, {
3776
3792
  executionResult: i,
3777
3793
  validation: n,
3778
3794
  validationIssues: n.errors
3779
3795
  });
3780
3796
  return o.stack = t.stack, o;
3781
3797
  }
3782
- function Te(e, r = {}) {
3798
+ function Ae(e, r = {}) {
3783
3799
  var i, o, u;
3784
3800
  const t = new Error(e);
3785
3801
  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);
3786
3802
  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);
3787
3803
  return n !== void 0 && (t.validationIssues = n), t;
3788
3804
  }
3789
- function gi(e) {
3805
+ function mi(e) {
3790
3806
  return e instanceof Error && e.kind === "data_app_query_error";
3791
3807
  }
3792
3808
  function ee(e, r = e.kind) {
@@ -3800,7 +3816,7 @@ function ee(e, r = e.kind) {
3800
3816
  r,
3801
3817
  t
3802
3818
  );
3803
- return Te(
3819
+ return Ae(
3804
3820
  `Invalid Semaphor analytics intent. ${n}`,
3805
3821
  {
3806
3822
  executionResult: i,
@@ -3856,7 +3872,7 @@ function q(e, r, t, n) {
3856
3872
  error: t == null ? void 0 : t.message
3857
3873
  });
3858
3874
  }
3859
- function mi() {
3875
+ function yi() {
3860
3876
  return {
3861
3877
  executeAnalysis: (e, r, t) => G(
3862
3878
  e,
@@ -3875,7 +3891,7 @@ async function G(e, r, t) {
3875
3891
  throw new Error(
3876
3892
  "SemaphorDataAppProvider needs a token to execute queries."
3877
3893
  );
3878
- const n = xi(r), i = bi(e, n);
3894
+ const n = qi(r), i = vi(e, n);
3879
3895
  let o;
3880
3896
  try {
3881
3897
  o = await fetch(n, {
@@ -3889,7 +3905,7 @@ async function G(e, r, t) {
3889
3905
  activeInputs: r.activeInputs,
3890
3906
  ...t ? { analysisOptions: t } : {},
3891
3907
  resultShape: e.kind,
3892
- ...hi(r) ? { debug: { responseDetail: "debug" } } : {}
3908
+ ...bi(r) ? { debug: { responseDetail: "debug" } } : {}
3893
3909
  })
3894
3910
  });
3895
3911
  } catch (f) {
@@ -3897,37 +3913,37 @@ async function G(e, r, t) {
3897
3913
  `${i}: ${f instanceof Error ? f.message : String(f)}`
3898
3914
  );
3899
3915
  }
3900
- const u = await wi(o);
3916
+ const u = await Ii(o);
3901
3917
  if (!o.ok || u.error)
3902
- throw yi(
3918
+ throw hi(
3903
3919
  `${i}: ${u.error || `Semaphor Data App execution failed with status ${o.status}.`}`,
3904
3920
  u
3905
3921
  );
3906
3922
  return u;
3907
3923
  }
3908
- function yi(e, r) {
3924
+ function hi(e, r) {
3909
3925
  var t;
3910
- return Te(e, {
3926
+ return Ae(e, {
3911
3927
  requestId: r.requestId,
3912
3928
  details: r.details,
3913
3929
  executionResult: r.executionResult,
3914
3930
  validation: (t = r.executionResult) == null ? void 0 : t.validation
3915
3931
  });
3916
3932
  }
3917
- function hi(e) {
3933
+ function bi(e) {
3918
3934
  const r = e.debug;
3919
3935
  return r ? r === !0 ? !0 : r.enabled !== !1 && r.requestServerDebug !== !1 : !1;
3920
3936
  }
3921
- function bi(e, r) {
3937
+ function vi(e, r) {
3922
3938
  return [
3923
3939
  `Semaphor ${e.kind} query`,
3924
3940
  e.id ? `id=${e.id}` : void 0,
3925
3941
  e.label ? `label=${e.label}` : void 0,
3926
- vi(e),
3927
- `endpoint=${Si(r)}`
3942
+ Si(e),
3943
+ `endpoint=${wi(r)}`
3928
3944
  ].filter((t) => !!t).join(" ");
3929
3945
  }
3930
- function vi(e) {
3946
+ function Si(e) {
3931
3947
  const r = "source" in e ? e.source : void 0;
3932
3948
  if (!(!r || typeof r != "object")) {
3933
3949
  if (r.kind === "semantic")
@@ -3946,7 +3962,7 @@ function vi(e) {
3946
3962
  return r.connectionId ? `source=${r.connectionId}` : void 0;
3947
3963
  }
3948
3964
  }
3949
- function Si(e) {
3965
+ function wi(e) {
3950
3966
  if (!e)
3951
3967
  return "/api/v1/data-app/execute";
3952
3968
  try {
@@ -3955,7 +3971,7 @@ function Si(e) {
3955
3971
  return e;
3956
3972
  }
3957
3973
  }
3958
- async function wi(e) {
3974
+ async function Ii(e) {
3959
3975
  const r = await e.text().catch(() => "");
3960
3976
  if (!r.trim())
3961
3977
  return e.ok ? {
@@ -3968,20 +3984,20 @@ async function wi(e) {
3968
3984
  error: "Semaphor Data App execution returned invalid JSON.",
3969
3985
  details: r
3970
3986
  } : {
3971
- error: Ii(e, r),
3987
+ error: xi(e, r),
3972
3988
  details: r
3973
3989
  };
3974
3990
  }
3975
3991
  }
3976
- function Ii(e, r) {
3992
+ function xi(e, r) {
3977
3993
  const t = e.statusText ? ` ${e.statusText}` : "", n = r.replace(/\s+/g, " ").trim();
3978
3994
  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}.`;
3979
3995
  }
3980
- function xi(e) {
3981
- const r = qi(e).replace(/\/+$/, "");
3996
+ function qi(e) {
3997
+ const r = Ai(e).replace(/\/+$/, "");
3982
3998
  return r ? r.endsWith("/api") ? `${r}/v1/data-app/execute` : `${r}/api/v1/data-app/execute` : "/api/v1/data-app/execute";
3983
3999
  }
3984
- function qi(e) {
4000
+ function Ai(e) {
3985
4001
  if (e.apiBaseUrl)
3986
4002
  return e.apiBaseUrl;
3987
4003
  if (!e.token)
@@ -3997,7 +4013,7 @@ function Ti() {
3997
4013
  if (!(typeof window > "u"))
3998
4014
  return window.__SEMAPHOR_DATA_APP_RUNTIME__;
3999
4015
  }
4000
- function Ai() {
4016
+ function Ci() {
4001
4017
  return Q(Wr);
4002
4018
  }
4003
4019
  function Ui(e) {
@@ -4005,22 +4021,22 @@ function Ui(e) {
4005
4021
  () => gr(e.options),
4006
4022
  [e.options]
4007
4023
  ), u = O(
4008
- (l) => {
4024
+ (d) => {
4009
4025
  var y;
4010
- const c = l;
4026
+ const c = d;
4011
4027
  (y = e.onValueChange) == null || y.call(e, c), n || t(c);
4012
4028
  },
4013
4029
  [n, e]
4014
4030
  ), f = O(() => u(void 0), [u]);
4015
4031
  return I(() => {
4016
- const l = mr(e);
4032
+ const d = mr(e);
4017
4033
  return {
4018
4034
  id: e.id,
4019
4035
  kind: e.kind,
4020
4036
  label: e.label,
4021
- field: l.field,
4022
- operator: l.operator,
4023
- relationshipHint: l.relationshipHint,
4037
+ field: d.field,
4038
+ operator: d.operator,
4039
+ relationshipHint: d.relationshipHint,
4024
4040
  controlRole: e.kind === "control" ? e.role : void 0,
4025
4041
  value: i,
4026
4042
  options: o,
@@ -4028,21 +4044,21 @@ function Ui(e) {
4028
4044
  setValue: u,
4029
4045
  clear: f,
4030
4046
  toAnalyticsInput: () => ({
4031
- inputId: l.inputId,
4032
- field: l.field,
4047
+ inputId: d.inputId,
4048
+ field: d.field,
4033
4049
  kind: e.kind,
4034
4050
  label: e.label,
4035
4051
  value: i,
4036
4052
  isActive: ue(i),
4037
- operator: l.operator,
4038
- relationshipHint: l.relationshipHint,
4053
+ operator: d.operator,
4054
+ relationshipHint: d.relationshipHint,
4039
4055
  controlRole: e.kind === "control" ? e.role : void 0
4040
4056
  })
4041
4057
  };
4042
4058
  }, [f, o, u, e, i]);
4043
4059
  }
4044
4060
  function Gi(e) {
4045
- const [r, t] = F(() => Di(e));
4061
+ const [r, t] = F(() => Oi(e));
4046
4062
  return B(() => {
4047
4063
  t((n) => {
4048
4064
  let i = n;
@@ -4061,7 +4077,7 @@ function Gi(e) {
4061
4077
  ...v,
4062
4078
  [n.id]: y
4063
4079
  }));
4064
- }, l = () => f(void 0), c = mr(n);
4080
+ }, d = () => f(void 0), c = mr(n);
4065
4081
  return {
4066
4082
  id: n.id,
4067
4083
  kind: n.kind,
@@ -4074,7 +4090,7 @@ function Gi(e) {
4074
4090
  options: u,
4075
4091
  isActive: ue(o),
4076
4092
  setValue: f,
4077
- clear: l,
4093
+ clear: d,
4078
4094
  toAnalyticsInput: () => ({
4079
4095
  inputId: c.inputId,
4080
4096
  field: c.field,
@@ -4092,12 +4108,12 @@ function Gi(e) {
4092
4108
  );
4093
4109
  }
4094
4110
  function Ji(e, r) {
4095
- const t = (r == null ? void 0 : r.status) === "success" ? r.options : void 0, n = I(() => ki(t), [t]);
4111
+ const t = (r == null ? void 0 : r.status) === "success" ? r.options : void 0, n = I(() => Ei(t), [t]);
4096
4112
  B(() => {
4097
- Ci(e.value, t) || e.clear();
4113
+ ki(e.value, t) || e.clear();
4098
4114
  }, [e, n, r == null ? void 0 : r.status, t]);
4099
4115
  }
4100
- function Ci(e, r) {
4116
+ function ki(e, r) {
4101
4117
  if (!ue(e) || r === void 0)
4102
4118
  return !0;
4103
4119
  const t = new Set(
@@ -4107,7 +4123,7 @@ function Ci(e, r) {
4107
4123
  (i) => t.has(fr(i))
4108
4124
  );
4109
4125
  }
4110
- function ki(e) {
4126
+ function Ei(e) {
4111
4127
  return JSON.stringify((e || []).map((r) => r.value));
4112
4128
  }
4113
4129
  function fr(e) {
@@ -4125,7 +4141,7 @@ function Yi(e, r = {}) {
4125
4141
  case "metric":
4126
4142
  return {
4127
4143
  queryKind: t.queryKind,
4128
- request: li(t)
4144
+ request: ui(t)
4129
4145
  };
4130
4146
  case "analysis":
4131
4147
  return {
@@ -4135,22 +4151,22 @@ function Yi(e, r = {}) {
4135
4151
  case "records":
4136
4152
  return {
4137
4153
  queryKind: t.queryKind,
4138
- request: ui(t)
4154
+ request: ci(t)
4139
4155
  };
4140
4156
  case "inputOptions":
4141
4157
  return {
4142
4158
  queryKind: t.queryKind,
4143
- request: ci(t)
4159
+ request: fi(t)
4144
4160
  };
4145
4161
  case "sql":
4146
4162
  return {
4147
4163
  queryKind: t.queryKind,
4148
- request: fi(t)
4164
+ request: pi(t)
4149
4165
  };
4150
4166
  case "matrix":
4151
4167
  return {
4152
4168
  queryKind: t.queryKind,
4153
- request: pi(t)
4169
+ request: gi(t)
4154
4170
  };
4155
4171
  default:
4156
4172
  return Se(t);
@@ -4176,51 +4192,51 @@ function Yi(e, r = {}) {
4176
4192
  i.success
4177
4193
  ]
4178
4194
  ), f = O(
4179
- (d) => {
4180
- var K, A, N, $, S, w, L, x, D;
4195
+ (l) => {
4196
+ var K, T, N, $, S, w, L, x, D;
4181
4197
  const b = n.request;
4182
4198
  if (b.intent)
4183
4199
  switch (n.queryKind) {
4184
4200
  case "metric":
4185
- return (K = d.executor) == null ? void 0 : K.executeMetric(
4201
+ return (K = l.executor) == null ? void 0 : K.executeMetric(
4186
4202
  b.intent,
4187
- d
4203
+ l
4188
4204
  );
4189
4205
  case "analysis":
4190
- return (N = (A = d.executor) == null ? void 0 : A.executeAnalysis) == null ? void 0 : N.call(
4191
- A,
4206
+ return (N = (T = l.executor) == null ? void 0 : T.executeAnalysis) == null ? void 0 : N.call(
4207
+ T,
4192
4208
  b.intent,
4193
- d,
4209
+ l,
4194
4210
  b.analysisOptions
4195
4211
  );
4196
4212
  case "records":
4197
- return ($ = d.executor) == null ? void 0 : $.executeRecords(
4213
+ return ($ = l.executor) == null ? void 0 : $.executeRecords(
4198
4214
  b.intent,
4199
- d
4215
+ l
4200
4216
  );
4201
4217
  case "inputOptions":
4202
- return (S = d.executor) == null ? void 0 : S.executeInputOptions(
4218
+ return (S = l.executor) == null ? void 0 : S.executeInputOptions(
4203
4219
  b.intent,
4204
- d
4220
+ l
4205
4221
  );
4206
4222
  case "sql":
4207
- return (L = (w = d.executor) == null ? void 0 : w.executeSql) == null ? void 0 : L.call(
4223
+ return (L = (w = l.executor) == null ? void 0 : w.executeSql) == null ? void 0 : L.call(
4208
4224
  w,
4209
4225
  b.intent,
4210
- d
4226
+ l
4211
4227
  );
4212
4228
  case "matrix":
4213
- return (D = (x = d.executor) == null ? void 0 : x.executeMatrix) == null ? void 0 : D.call(
4229
+ return (D = (x = l.executor) == null ? void 0 : x.executeMatrix) == null ? void 0 : D.call(
4214
4230
  x,
4215
4231
  b.intent,
4216
- d
4232
+ l
4217
4233
  );
4218
4234
  default:
4219
4235
  return Se(n);
4220
4236
  }
4221
4237
  },
4222
4238
  [n]
4223
- ), l = $i(
4239
+ ), d = Di(
4224
4240
  n.request.queryKey,
4225
4241
  f,
4226
4242
  n.request.idleData,
@@ -4228,143 +4244,146 @@ function Yi(e, r = {}) {
4228
4244
  u
4229
4245
  ), c = i.queryId, y = i.validationFailure;
4230
4246
  B(() => {
4231
- const d = n.request.error;
4232
- if (!d) {
4247
+ const l = n.request.error;
4248
+ if (!l) {
4233
4249
  o.current = null;
4234
4250
  return;
4235
4251
  }
4236
- const b = `${c}:${d.message}`;
4237
- o.current !== b && (o.current = b, y(d));
4252
+ const b = `${c}:${l.message}`;
4253
+ o.current !== b && (o.current = b, y(l));
4238
4254
  }, [
4239
4255
  n.request.error,
4240
4256
  n.request.queryKey,
4241
4257
  c,
4242
4258
  y
4243
4259
  ]);
4244
- const m = n.request.error ? n.request.idleData : l.data, v = n.request.error ? "error" : l.status, g = !n.request.error && l.status === "loading", h = n.request.error || l.error, T = i.trace;
4260
+ 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, A = i.trace;
4245
4261
  switch (n.queryKind) {
4246
4262
  case "metric": {
4247
- const d = m, b = J({
4263
+ const l = m, b = J({
4248
4264
  queryKind: n.queryKind,
4249
4265
  status: v,
4250
4266
  isLoading: g,
4251
4267
  error: h,
4252
- trace: T,
4253
- payload: d,
4268
+ trace: A,
4269
+ payload: l,
4254
4270
  activeInputs: n.request.activeInputs,
4255
- isStale: l.isStale
4271
+ isStale: d.isStale
4256
4272
  });
4257
4273
  return {
4258
4274
  id: t.id,
4259
4275
  intent: n.request.intent,
4260
- value: (d == null ? void 0 : d.value) ?? null,
4261
- measures: d == null ? void 0 : d.measures,
4262
- measureBindings: d == null ? void 0 : d.measureBindings,
4263
- comparisonValue: d == null ? void 0 : d.comparisonValue,
4264
- delta: d == null ? void 0 : d.delta,
4265
- deltaPercent: d == null ? void 0 : d.deltaPercent,
4266
- records: d == null ? void 0 : d.records,
4276
+ value: (l == null ? void 0 : l.value) ?? null,
4277
+ primaryValue: (l == null ? void 0 : l.primaryValue) ?? null,
4278
+ measures: l == null ? void 0 : l.measures,
4279
+ measureBindings: l == null ? void 0 : l.measureBindings,
4280
+ missingMeasures: l == null ? void 0 : l.missingMeasures,
4281
+ comparisonValue: l == null ? void 0 : l.comparisonValue,
4282
+ comparisonKind: l == null ? void 0 : l.comparisonKind,
4283
+ delta: l == null ? void 0 : l.delta,
4284
+ deltaPercent: l == null ? void 0 : l.deltaPercent,
4285
+ records: l == null ? void 0 : l.records,
4267
4286
  ...b
4268
4287
  };
4269
4288
  }
4270
4289
  case "analysis": {
4271
- const d = Or(m), b = J({
4290
+ const l = Or(m), b = J({
4272
4291
  queryKind: n.queryKind,
4273
4292
  status: v,
4274
4293
  isLoading: g,
4275
4294
  error: h,
4276
- trace: T,
4277
- payload: d,
4295
+ trace: A,
4296
+ payload: l,
4278
4297
  activeInputs: n.request.activeInputs,
4279
- isStale: l.isStale
4298
+ isStale: d.isStale
4280
4299
  });
4281
4300
  return {
4282
4301
  id: t.id,
4283
4302
  intent: n.request.intent,
4284
- ...d || {},
4303
+ ...l || {},
4285
4304
  ...b
4286
4305
  };
4287
4306
  }
4288
4307
  case "records": {
4289
- const d = m, b = J({
4308
+ const l = m, b = J({
4290
4309
  queryKind: n.queryKind,
4291
4310
  status: v,
4292
4311
  isLoading: g,
4293
4312
  error: h,
4294
- trace: T,
4295
- payload: d,
4313
+ trace: A,
4314
+ payload: l,
4296
4315
  activeInputs: n.request.activeInputs,
4297
- isStale: l.isStale
4316
+ isStale: d.isStale
4298
4317
  });
4299
4318
  return {
4300
4319
  id: t.id,
4301
4320
  intent: n.request.intent,
4302
- records: (d == null ? void 0 : d.records) || [],
4303
- columns: d == null ? void 0 : d.columns,
4304
- rowCount: d == null ? void 0 : d.rowCount,
4305
- pagination: d == null ? void 0 : d.pagination,
4306
- totals: d == null ? void 0 : d.totals,
4321
+ records: (l == null ? void 0 : l.records) || [],
4322
+ columns: l == null ? void 0 : l.columns,
4323
+ rowCount: l == null ? void 0 : l.rowCount,
4324
+ pagination: l == null ? void 0 : l.pagination,
4325
+ totals: l == null ? void 0 : l.totals,
4307
4326
  ...b
4308
4327
  };
4309
4328
  }
4310
4329
  case "inputOptions": {
4311
- const d = m, b = J({
4330
+ const l = m, b = J({
4312
4331
  queryKind: n.queryKind,
4313
4332
  status: v,
4314
4333
  isLoading: g,
4315
4334
  error: h,
4316
- trace: T,
4317
- payload: d,
4335
+ trace: A,
4336
+ payload: l,
4318
4337
  activeInputs: n.request.activeInputs,
4319
- isStale: l.isStale
4338
+ isStale: d.isStale
4320
4339
  });
4321
4340
  return {
4322
4341
  id: t.id,
4323
4342
  intent: n.request.intent,
4324
- options: (d == null ? void 0 : d.options) || [],
4343
+ options: (l == null ? void 0 : l.options) || [],
4325
4344
  ...b
4326
4345
  };
4327
4346
  }
4328
4347
  case "sql": {
4329
- const d = m, b = J({
4348
+ const l = m, b = J({
4330
4349
  queryKind: n.queryKind,
4331
4350
  status: v,
4332
4351
  isLoading: g,
4333
4352
  error: h,
4334
- trace: T,
4335
- payload: d,
4353
+ trace: A,
4354
+ payload: l,
4336
4355
  activeInputs: n.request.activeInputs,
4337
- isStale: l.isStale
4356
+ isStale: d.isStale
4338
4357
  });
4339
4358
  return {
4340
4359
  id: t.id,
4341
4360
  intent: n.request.intent,
4342
- records: (d == null ? void 0 : d.records) || [],
4343
- columns: d == null ? void 0 : d.columns,
4344
- rowCount: d == null ? void 0 : d.rowCount,
4345
- pagination: d == null ? void 0 : d.pagination,
4346
- output: d == null ? void 0 : d.output,
4347
- rowLimitExceeded: d == null ? void 0 : d.rowLimitExceeded,
4361
+ records: (l == null ? void 0 : l.records) || [],
4362
+ columns: l == null ? void 0 : l.columns,
4363
+ rowCount: l == null ? void 0 : l.rowCount,
4364
+ pagination: l == null ? void 0 : l.pagination,
4365
+ output: l == null ? void 0 : l.output,
4366
+ rowLimitExceeded: l == null ? void 0 : l.rowLimitExceeded,
4348
4367
  ...b
4349
4368
  };
4350
4369
  }
4351
4370
  case "matrix": {
4352
- const d = m, b = J({
4371
+ const l = m, b = J({
4353
4372
  queryKind: n.queryKind,
4354
4373
  status: v,
4355
4374
  isLoading: g,
4356
4375
  error: h,
4357
- trace: T,
4358
- payload: d,
4376
+ trace: A,
4377
+ payload: l,
4359
4378
  activeInputs: n.request.activeInputs,
4360
- isStale: l.isStale
4379
+ isStale: d.isStale
4361
4380
  });
4362
4381
  return {
4363
4382
  id: t.id,
4364
4383
  intent: n.request.intent,
4365
- matrixResult: d == null ? void 0 : d.matrixResult,
4366
- grid: d == null ? void 0 : d.grid,
4367
- expansion: d == null ? void 0 : d.expansion,
4384
+ matrixResult: l == null ? void 0 : l.matrixResult,
4385
+ grid: l == null ? void 0 : l.grid,
4386
+ expansion: l == null ? void 0 : l.expansion,
4368
4387
  ...b
4369
4388
  };
4370
4389
  }
@@ -4374,7 +4393,7 @@ function Yi(e, r = {}) {
4374
4393
  }
4375
4394
  function J(e) {
4376
4395
  var o, u, f;
4377
- 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;
4396
+ const r = Ri(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;
4378
4397
  return {
4379
4398
  status: e.status,
4380
4399
  executionStatus: r == null ? void 0 : r.status,
@@ -4383,10 +4402,10 @@ function J(e) {
4383
4402
  coverage: n,
4384
4403
  diagnosticFeedback: i,
4385
4404
  isLoading: e.isLoading,
4386
- isEmpty: Li(e.queryKind, e.payload, e.status),
4387
- isPartial: Ri(e.payload, r),
4405
+ isEmpty: $i(e.queryKind, e.payload, e.status),
4406
+ isPartial: Li(e.payload, r),
4388
4407
  isFiltered: !!((f = e.activeInputs) != null && f.some(
4389
- (l) => l.kind === "filter" && l.isActive
4408
+ (d) => d.kind === "filter" && d.isActive
4390
4409
  )),
4391
4410
  isStale: e.isStale,
4392
4411
  isValidated: !!t,
@@ -4394,45 +4413,45 @@ function J(e) {
4394
4413
  trace: e.trace
4395
4414
  };
4396
4415
  }
4397
- function Ei(e) {
4416
+ function Ri(e) {
4398
4417
  const r = e;
4399
4418
  return r == null ? void 0 : r.executionResult;
4400
4419
  }
4401
- function Ri(e, r) {
4420
+ function Li(e, r) {
4402
4421
  var n, i;
4403
4422
  const t = !!(e != null && e.rowLimitExceeded);
4404
4423
  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);
4405
4424
  }
4406
- function Li(e, r, t) {
4425
+ function $i(e, r, t) {
4407
4426
  var n, i, o, u, f;
4408
4427
  if (t !== "success")
4409
4428
  return !1;
4410
4429
  switch (e) {
4411
4430
  case "metric": {
4412
- const l = r;
4413
- return (l == null ? void 0 : l.value) == null && !_(l == null ? void 0 : l.records);
4431
+ const d = r;
4432
+ return (d == null ? void 0 : d.value) == null && !_(d == null ? void 0 : d.records);
4414
4433
  }
4415
4434
  case "analysis": {
4416
- const l = r;
4417
- return l ? !l.answerSummary && !_(l.records) && !_(l.changes) && !_(l.drivers) && !_(l.largestNegativeChanges) && !_(l.largestPositiveChanges) && !_(l.largestNegativeDrivers) && !_(l.largestPositiveDrivers) && !Object.values(l.resultSets || {}).some(
4435
+ const d = r;
4436
+ return d ? !d.answerSummary && !_(d.records) && !_(d.changes) && !_(d.drivers) && !_(d.largestNegativeChanges) && !_(d.largestPositiveChanges) && !_(d.largestNegativeDrivers) && !_(d.largestPositiveDrivers) && !Object.values(d.resultSets || {}).some(
4418
4437
  (c) => _(c.records)
4419
4438
  ) : !0;
4420
4439
  }
4421
4440
  case "records": {
4422
- const l = r;
4423
- return !_(l == null ? void 0 : l.records);
4441
+ const d = r;
4442
+ return !_(d == null ? void 0 : d.records);
4424
4443
  }
4425
4444
  case "sql": {
4426
- const l = r;
4427
- return !_(l == null ? void 0 : l.records) && (l == null ? void 0 : l.output) === void 0;
4445
+ const d = r;
4446
+ return !_(d == null ? void 0 : d.records) && (d == null ? void 0 : d.output) === void 0;
4428
4447
  }
4429
4448
  case "inputOptions": {
4430
- const l = r;
4431
- return !((n = l == null ? void 0 : l.options) != null && n.length);
4449
+ const d = r;
4450
+ return !((n = d == null ? void 0 : d.options) != null && n.length);
4432
4451
  }
4433
4452
  case "matrix": {
4434
- const l = r;
4435
- 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);
4453
+ const d = r;
4454
+ 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);
4436
4455
  }
4437
4456
  default:
4438
4457
  return Se(e);
@@ -4441,8 +4460,8 @@ function Li(e, r, t) {
4441
4460
  function _(e) {
4442
4461
  return Array.isArray(e) && e.length > 0;
4443
4462
  }
4444
- function $i(e, r, t, n, i) {
4445
- const o = Ai(), u = E(r), f = E(n), [l, c] = F({
4463
+ function Di(e, r, t, n, i) {
4464
+ const o = Ci(), u = E(r), f = E(n), [d, c] = F({
4446
4465
  status: "idle",
4447
4466
  data: t,
4448
4467
  error: null,
@@ -4487,7 +4506,7 @@ function $i(e, r, t, n, i) {
4487
4506
  }), () => {
4488
4507
  m = !0;
4489
4508
  };
4490
- }, [t, e, o, i]), l;
4509
+ }, [t, e, o, i]), d;
4491
4510
  }
4492
4511
  function _r() {
4493
4512
  return typeof performance < "u" && performance.now ? performance.now() : Date.now();
@@ -4495,7 +4514,7 @@ function _r() {
4495
4514
  function pr(e) {
4496
4515
  return Math.max(0, Math.round(_r() - e));
4497
4516
  }
4498
- function Di(e) {
4517
+ function Oi(e) {
4499
4518
  return Object.fromEntries(
4500
4519
  e.filter((r) => r.defaultValue !== void 0).map((r) => [r.id, r.defaultValue])
4501
4520
  );
@@ -4503,7 +4522,7 @@ function Di(e) {
4503
4522
  function Se(e) {
4504
4523
  throw new Error(`Unsupported Semaphor query kind: ${JSON.stringify(e)}`);
4505
4524
  }
4506
- function Oi(e) {
4525
+ function Bi(e) {
4507
4526
  return !e || typeof e == "boolean" || e.enabled === !1 ? null : e.autoRenderDevtools === !0 ? {} : e.autoRenderDevtools ? e.autoRenderDevtools : null;
4508
4527
  }
4509
4528
  function Xi({
@@ -4514,16 +4533,16 @@ function Xi({
4514
4533
  children: i
4515
4534
  }) {
4516
4535
  var g;
4517
- 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, l = (o == null ? void 0 : o.debug) ?? n, c = Oi(l), y = I(() => mi(), []), m = t || y, v = I(
4536
+ 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 = Bi(d), y = I(() => yi(), []), m = t || y, v = I(
4518
4537
  () => ({
4519
4538
  token: u,
4520
4539
  apiBaseUrl: f,
4521
4540
  executor: m,
4522
- debug: l
4541
+ debug: d
4523
4542
  }),
4524
- [f, l, m, u]
4543
+ [f, d, m, u]
4525
4544
  );
4526
- return /* @__PURE__ */ a($t, { debug: l, children: /* @__PURE__ */ p(Wr.Provider, { value: v, children: [
4545
+ return /* @__PURE__ */ a($t, { debug: d, children: /* @__PURE__ */ p(Wr.Provider, { value: v, children: [
4527
4546
  i,
4528
4547
  c ? /* @__PURE__ */ a(Bt, { ...c }) : null
4529
4548
  ] }) });
@@ -4533,10 +4552,10 @@ export {
4533
4552
  Bt as SemaphorDevtools,
4534
4553
  Qi as SemaphorDevtoolsInspectButton,
4535
4554
  Vi as SemaphorViewBoundary,
4536
- mi as createSemaphorQueryExecutor,
4555
+ yi as createSemaphorQueryExecutor,
4537
4556
  Mi as defineSemaphorDataApp,
4538
4557
  ji as defineSemaphorInput,
4539
- Ci as isSemaphorInputValueValidForOptions,
4558
+ ki as isSemaphorInputValueValidForOptions,
4540
4559
  Hi as semaphor,
4541
4560
  ro as semaphorMetricMeasureBindingKey,
4542
4561
  Ji as useClearInvalidSemaphorInputValue,