react-semaphor 0.1.597 → 0.1.599

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 (96) hide show
  1. package/dist/analytics-protocol/index.js +355 -346
  2. package/dist/assistant-context/index.js +1 -1
  3. package/dist/assistant-protocol/index.js +5 -5
  4. package/dist/brand-studio/index.js +8 -8
  5. package/dist/briefings/index.js +5 -5
  6. package/dist/chunks/{add-to-dashboard-C86FsM8D.js → add-to-dashboard-ClhEIFst.js} +1 -1
  7. package/dist/chunks/{analytics-base-schemas-8wz9vqn_.js → analytics-base-schemas-DevrgqQb.js} +67 -60
  8. package/dist/chunks/{assistant-chat-DUDiH9z4.js → assistant-chat-f3XuzrAm.js} +88 -89
  9. package/dist/chunks/{bookmark-impact-Dh-wiTs3.js → bookmark-impact-B5hyttm2.js} +3 -3
  10. package/dist/chunks/{bookmark-state-Be2W3s6t.js → bookmark-state-h1OLXVjE.js} +153 -153
  11. package/dist/chunks/{card-filter-builder-2-OxEBWf.js → card-filter-builder-DfLqD2RV.js} +1047 -1075
  12. package/dist/chunks/{comparison-window-caption-DmMFtNP5.js → comparison-window-caption-DJDwP9XO.js} +6 -6
  13. package/dist/chunks/{context-CVXTFljo.js → context-BJoEFgNl.js} +1 -1
  14. package/dist/chunks/{dashboard-g-7XY0Kw.js → dashboard-CoI4aOUc.js} +1 -1
  15. package/dist/chunks/{dashboard-briefing-launcher-CVDhvsTk.js → dashboard-briefing-launcher-RxYGtk-F.js} +181 -181
  16. package/dist/chunks/{dashboard-controls-CtQY-J33.js → dashboard-controls-DeaXrtLK.js} +85 -85
  17. package/dist/chunks/{dashboard-json-DkhzPI3-.js → dashboard-json-DvxKpKd_.js} +5 -5
  18. package/dist/chunks/dates-BhtO28Sn.js +164 -0
  19. package/dist/chunks/{edit-dashboard-visual-DWn74pCl.js → edit-dashboard-visual-C4f5hONA.js} +5489 -5433
  20. package/dist/chunks/{filter-line-BpdPq1D2.js → filter-line-Dkg3yuOX.js} +6 -6
  21. package/dist/chunks/{filter-reach-copy-DoXmRmk-.js → filter-reach-copy-Cl5Od38Q.js} +1760 -1584
  22. package/dist/chunks/{filter-value-text-CDQCIREQ.js → filter-value-text-CXyuLW9Q.js} +4 -4
  23. package/dist/chunks/{index-C0jX5wlM.js → index-EKpTtkYF.js} +7 -7
  24. package/dist/chunks/{layout-grid-DoFIfQGd.js → layout-grid-DSrBSfPM.js} +1 -1
  25. package/dist/chunks/{matrix-analytical-definition-CyWOwLmE.js → matrix-analytical-definition-BuUSBDm7.js} +242 -214
  26. package/dist/chunks/matrix-member-presentation-B_2beBc0.js +258 -0
  27. package/dist/chunks/{matrix-operation-contract-CAanJeCj.js → matrix-operation-contract-DdK0J_KU.js} +47 -47
  28. package/dist/chunks/{metric-comparison-BeKnUD08.js → metric-comparison-Bhz0V841.js} +2 -2
  29. package/dist/chunks/{paintbrush-KeaU1L1a.js → paintbrush-1UiU-uTz.js} +1 -1
  30. package/dist/chunks/{palette-BcFJLeXB.js → palette-DFIFf_-m.js} +1 -1
  31. package/dist/chunks/{pivot-result-contract-expectations-Dt0E1Wou.js → pivot-result-contract-expectations-Dk7WFR_u.js} +47 -47
  32. package/dist/chunks/{pivot-result-identity-BKUjYO1u.js → pivot-result-identity-CzzrJpEm.js} +1 -1
  33. package/dist/chunks/{raw-temporal-value-BzdgeDa7.js → raw-temporal-value-BLvdaMng.js} +2 -2
  34. package/dist/chunks/{report-preferences-dialog-5WUi6jC0.js → report-preferences-dialog-CZaYsQLK.js} +14 -14
  35. package/dist/chunks/{report-runtime-context-g4Zp_TU9.js → report-runtime-context-CEGluufW.js} +2 -2
  36. package/dist/chunks/{resolve-dashboard-input-context-DfJshnw8.js → resolve-dashboard-input-context-vPtbuDDz.js} +11786 -11247
  37. package/dist/chunks/{save-C9CZAk6V.js → save-CWQ02kHo.js} +1 -1
  38. package/dist/chunks/{saved-dashboard-context-DdhPU2Kq.js → saved-dashboard-context-C6X5nP4C.js} +97 -97
  39. package/dist/chunks/{selection-filter-compiler-BclSpK3P.js → selection-filter-compiler-Ce4BpjRX.js} +1 -1
  40. package/dist/chunks/{semaphor-ready-indicator-miYoJ-HP.js → semaphor-ready-indicator-BUiaKY6O.js} +60709 -59628
  41. package/dist/chunks/{shelf-drop-preview-context-D-awfyyo.js → shelf-drop-preview-context-CwxWJjBv.js} +6 -6
  42. package/dist/chunks/{stored-dashboard-D6FtWx_3.js → stored-dashboard-Bmct-STp.js} +1165 -1148
  43. package/dist/chunks/{style-sheet-parts-DM_Mw_sm.js → style-sheet-parts-BX7d7-2-.js} +198 -198
  44. package/dist/chunks/{table-export-sheet-DBlFMvE8.js → table-export-sheet-BWSVTclx.js} +1 -1
  45. package/dist/chunks/{token-types-BB2ImFx6.js → token-types-CnlEiAdS.js} +1 -1
  46. package/dist/chunks/{upload-CMTCg47S.js → upload-DsqUSS8l.js} +1 -1
  47. package/dist/chunks/{validators-BlEWWX9O.js → validators-D2Hm57lJ.js} +1090 -1071
  48. package/dist/chunks/{variable-draft-CxdgKDCx.js → variable-draft-Bi-zUa_a.js} +4 -4
  49. package/dist/dashboard/index.js +2 -2
  50. package/dist/dashboard-authoring/index.js +2554 -2538
  51. package/dist/format-utils/index.js +14 -14
  52. package/dist/index.js +48 -48
  53. package/dist/report-runtime-context/index.js +2 -2
  54. package/dist/style.css +1 -1
  55. package/dist/surfboard/index.js +2 -2
  56. package/dist/types/components/surfboard/filter/types.d.ts +13 -1
  57. package/dist/types/components/visual/data-table/hooks/use-data-table-logic.d.ts +0 -2
  58. package/dist/types/components/visual/data-table/types/data-table.d.ts +14 -21
  59. package/dist/types/index.js +5 -5
  60. package/dist/types/lib/dashboard-view-state/card-view-state.d.ts +11 -1
  61. package/dist/types/lib/dashboard-view-state/drill-path.d.ts +7 -0
  62. package/dist/types/lib/dashboard-viewer/table-view.d.ts +20 -0
  63. package/dist/types/lib/matrix-table/matrix-runtime-types.d.ts +8 -0
  64. package/dist/types/lib/matrix-table/matrix-runtime.d.ts +1 -0
  65. package/dist/types/lib/query-context/resolve-runtime-card-filters.d.ts +2 -0
  66. package/dist/types/lib/stores/dashboard-store.d.ts +3 -1
  67. package/dist/types/lib/utils/filter-default-value-utils.d.ts +1 -1
  68. package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +64 -0
  69. package/dist/types/shared/analytics-protocol/catalog-field-grounding.d.ts +7 -0
  70. package/dist/types/shared/analytics-protocol/column-filter-id.d.ts +4 -0
  71. package/dist/types/shared/analytics-protocol/contracts.d.ts +26 -0
  72. package/dist/types/shared/analytics-protocol/index.d.ts +2 -0
  73. package/dist/types/shared/analytics-protocol/numeric-range-options.d.ts +46 -0
  74. package/dist/types/shared/dashboard-authoring/card-query-request.d.ts +12 -1
  75. package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +12 -0
  76. package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +1 -1
  77. package/dist/types/shared/dashboard-authoring/card-settings/index.d.ts +1 -1
  78. package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +4 -0
  79. package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +2 -0
  80. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +63 -0
  81. package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +10 -10
  82. package/dist/types/shared/dashboard-authoring/dashboard-filter-mapping-contract.d.ts +2 -0
  83. package/dist/types/shared/dashboard-authoring/filter-model/index.d.ts +2 -0
  84. package/dist/types/shared/dashboard-authoring/filter-model/number-condition-spec.d.ts +24 -0
  85. package/dist/types/shared/dashboard-authoring/filter-model/number-range-setting.d.ts +47 -0
  86. package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +8 -1
  87. package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +3 -1
  88. package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +35 -3
  89. package/dist/types/shared/usage-events/attribution.d.ts +2 -2
  90. package/dist/types/shared/usage-events/envelope.d.ts +2 -2
  91. package/dist/usage-events/index.js +1 -1
  92. package/package.json +1 -1
  93. package/dist/chunks/aggregate-measure-field-DHlDj0Pc.js +0 -22
  94. package/dist/chunks/dates-B-bKEsiu.js +0 -115
  95. package/dist/chunks/list-filter-BeTQxjNy.js +0 -15
  96. package/dist/chunks/matrix-member-presentation-Bj2YcHAP.js +0 -169
@@ -1,55 +1,55 @@
1
- import { i4 as hn, d3 as vn, cn as Fn, b1 as Dn, bp as Sn, k as Tn, cf as Vn, i5 as Te, eN as lt, eQ as Mn, bY as kn, i6 as xn, aD as Pn, h5 as ct, h7 as wn, bJ as Ve, i7 as dt, S as On, h9 as _n, dA as de, s as _, g_ as ue, n as Me, i8 as An, he as Bn, ds as ut, du as ft, dc as En, dz as Rn, dx as Le, dy as qn, b as Nn, de as jn, dr as zn, dp as Ln, bM as pt, bk as Kn, a7 as A, cr as Gn, hI as Hn, i9 as fe, ia as mt, ib as Un, ic as ke, hX as pe, id as Qn, ie as xe, ig as $n, ih as Wn, ii as Zn, ij as Jn, ik as Yn, o as Pe, il as Xn, p as U, r as er, h as tr, im as L, gR as we, io as te, ip as gt, iq as nr, M as rr, ir, is as or, gK as yt, it as ar, iu as sr, e as lr, iv as cr, iw as bt, ix as dr, iy as ur, a3 as It, iz as fr, iA as pr, iB as Ct, m as Oe, iC as mr, cT as gr, a8 as yr, t as ht, cS as br, hU as Ir, v as Cr, w as Ke, F as hr, iD as vr, iE as Fr, cU as Dr, iF as Sr } from "./resolve-dashboard-input-context-DfJshnw8.js";
2
- import { am as Tr, a7 as W, M as Vr, x as Mr, ay as Ce, y as kr, a9 as ne, aA as vt, W as xr, b as Pr, r as wr, k as Or, aE as _r } from "./validators-BlEWWX9O.js";
3
- import { r as Ft } from "./matrix-operation-contract-CAanJeCj.js";
4
- import "./analytics-base-schemas-8wz9vqn_.js";
1
+ import { ix as Dn, dn as Sn, cw as Tn, b5 as Vn, bx as Mn, m as kn, co as xn, iy as Te, f8 as dt, fb as Pn, c4 as wn, iz as On, aF as _n, hu as ut, hw as An, bR as Ve, iA as ft, dU as de, U as Bn, hy as En, s as _, hn as ue, n as Me, iB as Rn, hD as qn, dM as pt, dO as mt, dx as Nn, dT as jn, dR as Ge, dS as zn, b as Ln, dz as Kn, dL as Gn, dJ as Hn, bU as gt, bs as Un, a5 as A, cA as Qn, a4 as $n, iC as fe, iD as yt, iE as Wn, o as Zn, iF as ke, im as pe, iG as Jn, iH as xe, iI as Yn, iJ as Xn, iK as er, iL as tr, iM as nr, q as Pe, iN as rr, t as U, r as or, h as ir, iO as L, iP as ar, iQ as te, iR as bt, he as we, O as sr, iS as lr, iT as cr, h7 as It, iU as dr, iV as ur, j as fr, iW as pr, iX as Ct, iY as mr, iZ as gr, i_ as yr, c5 as ht, i$ as br, j0 as Ir, j1 as vt, p as Oe, d1 as Cr, a6 as hr, v as Ft, j2 as vr, j3 as Fr, j4 as Dr, d0 as Sr, ij as Tr, x as Vr, y as He, H as Mr, j5 as kr, j6 as xr, d2 as Pr, j7 as wr } from "./resolve-dashboard-input-context-vPtbuDDz.js";
2
+ import { an as Or, a7 as W, M as _r, x as Ar, az as Ce, y as Br, aa as ne, aB as Dt, W as Er, b as Rr, r as qr, k as Nr, aF as jr } from "./validators-D2Hm57lJ.js";
3
+ import { q as St } from "./matrix-operation-contract-DdK0J_KU.js";
4
+ import "./analytics-base-schemas-DevrgqQb.js";
5
5
  import "./pickers-DkqmtnTL.js";
6
- import { canonicalizeSupportedCurrencyCode as Dt } from "../value-format-preferences/index.js";
7
- import { ZodError as Ar } from "zod";
8
- import { b as re, r as Br, b7 as Er, i as Rr, aQ as qr, aj as Ge, aO as He } from "./pivot-result-contract-expectations-Dt0E1Wou.js";
9
- import { aE as St, aF as Tt, aG as be, a3 as Nr, aD as Vt, C as he, aH as j, A as Z, i as Mt, w as jr, q as zr, v as Lr, B as _e, aI as Kr, al as Gr, G as kt, F as Hr, K as Ue, P as xt, Q as Pt, J as wt } from "./bookmark-state-Be2W3s6t.js";
6
+ import { canonicalizeSupportedCurrencyCode as Tt } from "../value-format-preferences/index.js";
7
+ import { ZodError as zr } from "zod";
8
+ import { b as re, r as Lr, b7 as Kr, i as Gr, aQ as Hr, aj as Ue, aO as Qe } from "./pivot-result-contract-expectations-Dk7WFR_u.js";
9
+ import { aE as Vt, aF as Mt, aG as be, a3 as Ur, aD as kt, C as he, aH as j, A as Z, i as xt, w as Qr, q as $r, v as Wr, B as _e, aI as Zr, al as Jr, G as Pt, F as Yr, K as $e, P as wt, Q as Ot, J as _t } from "./bookmark-state-h1OLXVjE.js";
10
10
  import "./schema-C9NPiIru.js";
11
11
  import "./index-CV_Kzou0.js";
12
- import "./context-CVXTFljo.js";
13
- import { a as Ur, i as Qr } from "./matrix-analytical-definition-CyWOwLmE.js";
14
- import { D as $r } from "./report-runtime-context-g4Zp_TU9.js";
15
- import { isPdfTableCardType as Wr, PDF_CAPACITY as Zr } from "../pdf-export-policy/index.js";
16
- import { K as Qe } from "./raw-temporal-value-BzdgeDa7.js";
17
- import { t as Jr, n as Yr, c as Xr } from "./selection-filter-compiler-BclSpK3P.js";
18
- const ei = (e, t) => {
12
+ import "./context-BJoEFgNl.js";
13
+ import { a as Xr, i as eo } from "./matrix-analytical-definition-BuUSBDm7.js";
14
+ import { D as to } from "./report-runtime-context-CEGluufW.js";
15
+ import { isPdfTableCardType as no, PDF_CAPACITY as ro } from "../pdf-export-policy/index.js";
16
+ import { K as We } from "./raw-temporal-value-BLvdaMng.js";
17
+ import { t as oo, c as io, n as ao } from "./selection-filter-compiler-Ce4BpjRX.js";
18
+ const so = (e, t) => {
19
19
  const n = {};
20
20
  if (e === null || t === null)
21
21
  return t;
22
22
  const r = /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)]);
23
- for (const i of r) {
24
- if (!(i in e) && i in t) {
25
- n[i] = t[i];
23
+ for (const o of r) {
24
+ if (!(o in e) && o in t) {
25
+ n[o] = t[o];
26
26
  continue;
27
27
  }
28
- if (i in e && !(i in t)) {
29
- n[i] = void 0;
28
+ if (o in e && !(o in t)) {
29
+ n[o] = void 0;
30
30
  continue;
31
31
  }
32
- const o = e[i], a = t[i];
33
- if (!ve(o, a))
34
- if (Array.isArray(o) && Array.isArray(a))
35
- n[i] = a;
36
- else if ($e(o) && $e(a)) {
37
- const s = ei(o, a);
38
- Object.keys(s).length > 0 && (n[i] = s);
32
+ const i = e[o], a = t[o];
33
+ if (!ve(i, a))
34
+ if (Array.isArray(i) && Array.isArray(a))
35
+ n[o] = a;
36
+ else if (Ze(i) && Ze(a)) {
37
+ const s = so(i, a);
38
+ Object.keys(s).length > 0 && (n[o] = s);
39
39
  } else
40
- n[i] = a;
40
+ n[o] = a;
41
41
  }
42
42
  return n;
43
43
  }, ve = (e, t) => {
44
44
  if (e === t) return !0;
45
45
  if (e && t && typeof e == "object" && typeof t == "object") {
46
46
  if (Array.isArray(e) && Array.isArray(t))
47
- return e.length !== t.length ? !1 : e.every((i, o) => ve(i, t[o]));
47
+ return e.length !== t.length ? !1 : e.every((o, i) => ve(o, t[i]));
48
48
  const n = Object.keys(e), r = Object.keys(t);
49
- return n.length !== r.length ? !1 : n.every((i) => ve(e[i], t[i]));
49
+ return n.length !== r.length ? !1 : n.every((o) => ve(e[o], t[o]));
50
50
  }
51
51
  return !1;
52
- }, $e = (e) => e !== null && typeof e == "object" && !Array.isArray(e), ie = (e) => {
52
+ }, Ze = (e) => e !== null && typeof e == "object" && !Array.isArray(e), oe = (e) => {
53
53
  if (e === null || typeof e != "object")
54
54
  return e;
55
55
  if (e instanceof Date)
@@ -57,51 +57,51 @@ const ei = (e, t) => {
57
57
  if (e instanceof RegExp)
58
58
  return new RegExp(e);
59
59
  if (Array.isArray(e))
60
- return e.map((n) => ie(n));
60
+ return e.map((n) => oe(n));
61
61
  const t = {};
62
62
  for (const n in e)
63
- Object.prototype.hasOwnProperty.call(e, n) && (t[n] = ie(e[n]));
63
+ Object.prototype.hasOwnProperty.call(e, n) && (t[n] = oe(e[n]));
64
64
  return t;
65
- }, ti = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
66
- function ni(e) {
67
- return typeof e == "string" && ti.test(e);
65
+ }, lo = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
66
+ function co(e) {
67
+ return typeof e == "string" && lo.test(e);
68
68
  }
69
- function ri(e) {
70
- if (!ni(e))
69
+ function uo(e) {
70
+ if (!co(e))
71
71
  throw TypeError("Invalid UUID");
72
72
  let t;
73
73
  const n = new Uint8Array(16);
74
74
  return n[0] = (t = parseInt(e.slice(0, 8), 16)) >>> 24, n[1] = t >>> 16 & 255, n[2] = t >>> 8 & 255, n[3] = t & 255, n[4] = (t = parseInt(e.slice(9, 13), 16)) >>> 8, n[5] = t & 255, n[6] = (t = parseInt(e.slice(14, 18), 16)) >>> 8, n[7] = t & 255, n[8] = (t = parseInt(e.slice(19, 23), 16)) >>> 8, n[9] = t & 255, n[10] = (t = parseInt(e.slice(24, 36), 16)) / 1099511627776 & 255, n[11] = t / 4294967296 & 255, n[12] = t >>> 24 & 255, n[13] = t >>> 16 & 255, n[14] = t >>> 8 & 255, n[15] = t & 255, n;
75
75
  }
76
- function ii(e) {
76
+ function fo(e) {
77
77
  e = unescape(encodeURIComponent(e));
78
78
  const t = [];
79
79
  for (let n = 0; n < e.length; ++n)
80
80
  t.push(e.charCodeAt(n));
81
81
  return t;
82
82
  }
83
- const oi = "6ba7b810-9dad-11d1-80b4-00c04fd430c8", ai = "6ba7b811-9dad-11d1-80b4-00c04fd430c8";
84
- function si(e, t, n) {
85
- function r(i, o, a, s) {
83
+ const po = "6ba7b810-9dad-11d1-80b4-00c04fd430c8", mo = "6ba7b811-9dad-11d1-80b4-00c04fd430c8";
84
+ function go(e, t, n) {
85
+ function r(o, i, a, s) {
86
86
  var l;
87
- if (typeof i == "string" && (i = ii(i)), typeof o == "string" && (o = ri(o)), ((l = o) === null || l === void 0 ? void 0 : l.length) !== 16)
87
+ if (typeof o == "string" && (o = fo(o)), typeof i == "string" && (i = uo(i)), ((l = i) === null || l === void 0 ? void 0 : l.length) !== 16)
88
88
  throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");
89
- let c = new Uint8Array(16 + i.length);
90
- if (c.set(o), c.set(i, o.length), c = n(c), c[6] = c[6] & 15 | t, c[8] = c[8] & 63 | 128, a) {
89
+ let c = new Uint8Array(16 + o.length);
90
+ if (c.set(i), c.set(o, i.length), c = n(c), c[6] = c[6] & 15 | t, c[8] = c[8] & 63 | 128, a) {
91
91
  s = s || 0;
92
92
  for (let d = 0; d < 16; ++d)
93
93
  a[s + d] = c[d];
94
94
  return a;
95
95
  }
96
- return hn(c);
96
+ return Dn(c);
97
97
  }
98
98
  try {
99
99
  r.name = e;
100
100
  } catch {
101
101
  }
102
- return r.DNS = oi, r.URL = ai, r;
102
+ return r.DNS = po, r.URL = mo, r;
103
103
  }
104
- function li(e, t, n, r) {
104
+ function yo(e, t, n, r) {
105
105
  switch (e) {
106
106
  case 0:
107
107
  return t & n ^ ~t & r;
@@ -116,7 +116,7 @@ function li(e, t, n, r) {
116
116
  function Ie(e, t) {
117
117
  return e << t | e >>> 32 - t;
118
118
  }
119
- function ci(e) {
119
+ function bo(e) {
120
120
  const t = [1518500249, 1859775393, 2400959708, 3395469782], n = [1732584193, 4023233417, 2562383102, 271733878, 3285377520];
121
121
  if (typeof e == "string") {
122
122
  const a = unescape(encodeURIComponent(e));
@@ -125,60 +125,60 @@ function ci(e) {
125
125
  e.push(a.charCodeAt(s));
126
126
  } else Array.isArray(e) || (e = Array.prototype.slice.call(e));
127
127
  e.push(128);
128
- const r = e.length / 4 + 2, i = Math.ceil(r / 16), o = new Array(i);
129
- for (let a = 0; a < i; ++a) {
128
+ const r = e.length / 4 + 2, o = Math.ceil(r / 16), i = new Array(o);
129
+ for (let a = 0; a < o; ++a) {
130
130
  const s = new Uint32Array(16);
131
131
  for (let l = 0; l < 16; ++l)
132
132
  s[l] = e[a * 64 + l * 4] << 24 | e[a * 64 + l * 4 + 1] << 16 | e[a * 64 + l * 4 + 2] << 8 | e[a * 64 + l * 4 + 3];
133
- o[a] = s;
133
+ i[a] = s;
134
134
  }
135
- o[i - 1][14] = (e.length - 1) * 8 / Math.pow(2, 32), o[i - 1][14] = Math.floor(o[i - 1][14]), o[i - 1][15] = (e.length - 1) * 8 & 4294967295;
136
- for (let a = 0; a < i; ++a) {
135
+ i[o - 1][14] = (e.length - 1) * 8 / Math.pow(2, 32), i[o - 1][14] = Math.floor(i[o - 1][14]), i[o - 1][15] = (e.length - 1) * 8 & 4294967295;
136
+ for (let a = 0; a < o; ++a) {
137
137
  const s = new Uint32Array(80);
138
138
  for (let m = 0; m < 16; ++m)
139
- s[m] = o[a][m];
139
+ s[m] = i[a][m];
140
140
  for (let m = 16; m < 80; ++m)
141
141
  s[m] = Ie(s[m - 3] ^ s[m - 8] ^ s[m - 14] ^ s[m - 16], 1);
142
142
  let l = n[0], c = n[1], d = n[2], u = n[3], f = n[4];
143
143
  for (let m = 0; m < 80; ++m) {
144
- const y = Math.floor(m / 20), p = Ie(l, 5) + li(y, c, d, u) + f + t[y] + s[m] >>> 0;
144
+ const y = Math.floor(m / 20), p = Ie(l, 5) + yo(y, c, d, u) + f + t[y] + s[m] >>> 0;
145
145
  f = u, u = d, d = Ie(c, 30) >>> 0, c = l, l = p;
146
146
  }
147
147
  n[0] = n[0] + l >>> 0, n[1] = n[1] + c >>> 0, n[2] = n[2] + d >>> 0, n[3] = n[3] + u >>> 0, n[4] = n[4] + f >>> 0;
148
148
  }
149
149
  return [n[0] >> 24 & 255, n[0] >> 16 & 255, n[0] >> 8 & 255, n[0] & 255, n[1] >> 24 & 255, n[1] >> 16 & 255, n[1] >> 8 & 255, n[1] & 255, n[2] >> 24 & 255, n[2] >> 16 & 255, n[2] >> 8 & 255, n[2] & 255, n[3] >> 24 & 255, n[3] >> 16 & 255, n[3] >> 8 & 255, n[3] & 255, n[4] >> 24 & 255, n[4] >> 16 & 255, n[4] >> 8 & 255, n[4] & 255];
150
150
  }
151
- const di = si("v5", 80, ci), We = /\[\[\s*param\.([A-Za-z0-9_.-]+)\s*\]\]/g, Ze = /\bparam\s*\(\s*(['"])([^'"]+)\1/g;
152
- function ui(e) {
151
+ const Io = go("v5", 80, bo), Je = /\[\[\s*param\.([A-Za-z0-9_.-]+)\s*\]\]/g, Ye = /\bparam\s*\(\s*(['"])([^'"]+)\1/g;
152
+ function Co(e) {
153
153
  const t = [];
154
154
  let n = 0;
155
155
  for (; n < e.length; ) {
156
- const r = e.indexOf("{{", n), i = e.indexOf("{%", n);
157
- let o = -1, a = "";
158
- if (r === -1 ? (o = i, a = "%}") : i === -1 || r < i ? (o = r, a = "}}") : (o = i, a = "%}"), o === -1)
156
+ const r = e.indexOf("{{", n), o = e.indexOf("{%", n);
157
+ let i = -1, a = "";
158
+ if (r === -1 ? (i = o, a = "%}") : o === -1 || r < o ? (i = r, a = "}}") : (i = o, a = "%}"), i === -1)
159
159
  break;
160
- const s = e.indexOf(a, o + 2);
160
+ const s = e.indexOf(a, i + 2);
161
161
  if (s === -1) {
162
- n = o + 2;
162
+ n = i + 2;
163
163
  continue;
164
164
  }
165
- t.push(e.slice(o + 2, s)), n = s + 2;
165
+ t.push(e.slice(i + 2, s)), n = s + 2;
166
166
  }
167
167
  return t;
168
168
  }
169
- function Ot(e) {
170
- var r, i;
169
+ function At(e) {
170
+ var r, o;
171
171
  if (!e)
172
172
  return [];
173
173
  const t = /* @__PURE__ */ new Set();
174
174
  let n;
175
- for (We.lastIndex = 0; (n = We.exec(e)) !== null; ) {
176
- const o = (r = n[1]) == null ? void 0 : r.trim();
177
- o && t.add(o);
175
+ for (Je.lastIndex = 0; (n = Je.exec(e)) !== null; ) {
176
+ const i = (r = n[1]) == null ? void 0 : r.trim();
177
+ i && t.add(i);
178
178
  }
179
- for (const o of ui(e))
180
- for (Ze.lastIndex = 0; (n = Ze.exec(o)) !== null; ) {
181
- const a = (i = n[2]) == null ? void 0 : i.trim();
179
+ for (const i of Co(e))
180
+ for (Ye.lastIndex = 0; (n = Ye.exec(i)) !== null; ) {
181
+ const a = (o = n[2]) == null ? void 0 : o.trim();
182
182
  a && t.add(a);
183
183
  }
184
184
  return Array.from(t);
@@ -187,76 +187,76 @@ function Ae(e) {
187
187
  const t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Map();
188
188
  for (const r of e.controlBindings || [])
189
189
  t.add(r.controlId), r.target === "sql_param" && n.set(r.paramId, r.controlId);
190
- for (const r of Ot(e.sql))
190
+ for (const r of At(e.sql))
191
191
  t.add(n.get(r) ?? r);
192
192
  return Array.from(t);
193
193
  }
194
- function fi(e) {
194
+ function ho(e) {
195
195
  const t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
196
196
  for (const r of e.controlBindings || [])
197
197
  r.target === "sql_param" && n.set(r.paramId, r.controlId);
198
- for (const r of Ot(e.sql))
198
+ for (const r of At(e.sql))
199
199
  t.set(r, {
200
200
  paramId: r,
201
201
  controlId: n.get(r) ?? r
202
202
  });
203
203
  return Array.from(t.values());
204
204
  }
205
- function pi(e, t) {
206
- var i;
207
- const n = (i = e.controlBindings) == null ? void 0 : i.map((o) => ({
208
- ...o,
209
- controlId: t.get(o.controlId) ?? o.controlId
210
- })), r = fi(e).flatMap(
211
- ({ paramId: o, controlId: a }) => {
205
+ function vo(e, t) {
206
+ var o;
207
+ const n = (o = e.controlBindings) == null ? void 0 : o.map((i) => ({
208
+ ...i,
209
+ controlId: t.get(i.controlId) ?? i.controlId
210
+ })), r = ho(e).flatMap(
211
+ ({ paramId: i, controlId: a }) => {
212
212
  var l;
213
213
  const s = t.get(a);
214
214
  return !s || s === a || (l = e.controlBindings) != null && l.some(
215
- (c) => c.target === "sql_param" && c.paramId === o
216
- ) ? [] : [{ target: "sql_param", paramId: o, controlId: s }];
215
+ (c) => c.target === "sql_param" && c.paramId === i
216
+ ) ? [] : [{ target: "sql_param", paramId: i, controlId: s }];
217
217
  }
218
218
  );
219
219
  return r.length ? [...n ?? [], ...r] : n;
220
220
  }
221
- function _t(e, t) {
221
+ function Bt(e, t) {
222
222
  var a, s;
223
- const n = be(e) ?? e, r = n.source === "dashboardInputAlias" ? (a = t.inputAliases) == null ? void 0 : a[n.variableName] : void 0, i = n.source === "dashboardInputAlias" && r ? be(r) ?? be({ ...r, export: n.export ?? "label" }) ?? n : n, o = n.source === "dashboardInputAlias" && i !== n ? { ...i, export: n.export ?? "label" } : i;
224
- return o.source === "input" ? {
225
- ...o,
226
- inputId: ((s = t.inputIds) == null ? void 0 : s[o.inputId]) ?? o.inputId
227
- } : o;
223
+ const n = be(e) ?? e, r = n.source === "dashboardInputAlias" ? (a = t.inputAliases) == null ? void 0 : a[n.variableName] : void 0, o = n.source === "dashboardInputAlias" && r ? be(r) ?? be({ ...r, export: n.export ?? "label" }) ?? n : n, i = n.source === "dashboardInputAlias" && o !== n ? { ...o, export: n.export ?? "label" } : o;
224
+ return i.source === "input" ? {
225
+ ...i,
226
+ inputId: ((s = t.inputIds) == null ? void 0 : s[i.inputId]) ?? i.inputId
227
+ } : i;
228
228
  }
229
- function mi(e, t) {
230
- var i;
229
+ function Fo(e, t) {
230
+ var o;
231
231
  const n = {};
232
- for (const o of [
232
+ for (const i of [
233
233
  "cardIds",
234
234
  "sheetIds",
235
235
  "inputIds",
236
236
  "controlIds",
237
237
  "filterIds"
238
238
  ]) {
239
- const a = { ...t[o] };
240
- for (const [s, l] of Object.entries((e == null ? void 0 : e[o]) ?? {}))
241
- a[s] = ((i = t[o]) == null ? void 0 : i[l]) ?? l;
242
- Object.keys(a).length && (n[o] = a);
239
+ const a = { ...t[i] };
240
+ for (const [s, l] of Object.entries((e == null ? void 0 : e[i]) ?? {}))
241
+ a[s] = ((o = t[i]) == null ? void 0 : o[l]) ?? l;
242
+ Object.keys(a).length && (n[i] = a);
243
243
  }
244
244
  const r = { ...t.inputAliases };
245
- for (const [o, a] of Object.entries((e == null ? void 0 : e.inputAliases) ?? {}))
246
- r[o] = _t(a, t);
245
+ for (const [i, a] of Object.entries((e == null ? void 0 : e.inputAliases) ?? {}))
246
+ r[i] = Bt(a, t);
247
247
  return Object.keys(r).length && (n.inputAliases = r), n;
248
248
  }
249
- function Ka(e, t) {
250
- var i, o, a, s;
251
- const n = ie(St(e));
252
- n.controlBindings = pi(
249
+ function Za(e, t) {
250
+ var o, i, a, s;
251
+ const n = oe(Vt(e));
252
+ n.controlBindings = vo(
253
253
  e,
254
254
  new Map(Object.entries(t.controlIds ?? {}))
255
255
  );
256
256
  for (const l of n.controls ?? [])
257
- l.id = ((i = t.controlIds) == null ? void 0 : i[l.id]) ?? l.id;
257
+ l.id = ((o = t.controlIds) == null ? void 0 : o[l.id]) ?? l.id;
258
258
  for (const l of n.inlineFilters ?? [])
259
- l.id = ((o = t.filterIds) == null ? void 0 : o[l.id]) ?? l.id;
259
+ l.id = ((i = t.filterIds) == null ? void 0 : i[l.id]) ?? l.id;
260
260
  const r = (l) => {
261
261
  var d, u;
262
262
  if (!l || typeof l != "object") return;
@@ -267,9 +267,9 @@ function Ka(e, t) {
267
267
  const c = l;
268
268
  if (Object.assign(
269
269
  c,
270
- Tt(
270
+ Mt(
271
271
  c,
272
- (f) => f && typeof f == "object" ? _t(f, t) : f
272
+ (f) => f && typeof f == "object" ? Bt(f, t) : f
273
273
  )
274
274
  ), typeof c.entityId == "string") {
275
275
  const f = c.entityId;
@@ -278,73 +278,73 @@ function Ka(e, t) {
278
278
  for (const [f, m] of Object.entries(c))
279
279
  f !== "linkedReferenceOverrides" && r(m);
280
280
  };
281
- r(n), n.clickToFilter && (n.clickToFilter = vn(n.clickToFilter, t));
281
+ r(n), n.clickToFilter && (n.clickToFilter = Sn(n.clickToFilter, t));
282
282
  for (const l of Object.values(
283
283
  ((a = n.customCardPreferences) == null ? void 0 : a.dataInputCardIds) ?? {}
284
284
  ))
285
285
  l.cardId = ((s = t.cardIds) == null ? void 0 : s[l.cardId]) ?? l.cardId;
286
286
  return n;
287
287
  }
288
- const gi = "9677efdd-86ec-4afb-b9bb-5ead8b5442af";
289
- function yi(e) {
288
+ const Do = "9677efdd-86ec-4afb-b9bb-5ead8b5442af";
289
+ function So(e) {
290
290
  let t = 0;
291
- return () => di(`${e}#${t++}`, gi);
291
+ return () => Io(`${e}#${t++}`, Do);
292
292
  }
293
- const bi = [
293
+ const To = [
294
294
  { code: "matrix_definition_incomplete", label: "Matrix definition" }
295
- ], Ii = [
295
+ ], Vo = [
296
296
  { code: "connection_type_unresolved", label: "Connection type" }
297
297
  ], G = (e) => !Array.isArray(e) || e.length === 0;
298
- function Ci(e) {
299
- var o;
298
+ function Mo(e) {
299
+ var i;
300
300
  const t = e.config ?? {};
301
- if ((o = e.sql) != null && o.trim() || !G(t.pivotByColumns)) return "matrixTable";
302
- const n = !G(t.groupByColumns), r = !G(t.metricColumns), i = e.type === "pivotTable" && (n || r) && G(t.rowAggregates) && G(t.columnAggregates);
303
- return n && !r || i ? "table" : "matrixTable";
301
+ if ((i = e.sql) != null && i.trim() || !G(t.pivotByColumns)) return "matrixTable";
302
+ const n = !G(t.groupByColumns), r = !G(t.metricColumns), o = e.type === "pivotTable" && (n || r) && G(t.rowAggregates) && G(t.columnAggregates);
303
+ return n && !r || o ? "table" : "matrixTable";
304
304
  }
305
- function hi(e) {
306
- var i;
305
+ function ko(e) {
306
+ var o;
307
307
  const t = e.dataSource;
308
- if (!t || (i = t.connectionType) != null && i.trim()) return e;
309
- const n = Tr(Vn(t.selectedEntities));
308
+ if (!t || (o = t.connectionType) != null && o.trim()) return e;
309
+ const n = Or(xn(t.selectedEntities));
310
310
  if (!n) return e;
311
- const r = Array.isArray(t.selectedEntities) ? t.selectedEntities.map((o) => o && typeof o == "object" && "connectionType" in o && !String(o.connectionType ?? "").trim() ? { ...o, connectionType: n } : o) : t.selectedEntities;
311
+ const r = Array.isArray(t.selectedEntities) ? t.selectedEntities.map((i) => i && typeof i == "object" && "connectionType" in i && !String(i.connectionType ?? "").trim() ? { ...i, connectionType: n } : i) : t.selectedEntities;
312
312
  return { ...e, dataSource: { ...t, connectionType: n, selectedEntities: r } };
313
313
  }
314
- function At(e) {
314
+ function Et(e) {
315
315
  var a, s;
316
316
  const t = e;
317
- if (!Fn(t)) return { status: "not_legacy", card: e };
318
- const n = hi(t), r = Ci(t) === "table" ? Dn(n, "table") : Sn(n, "matrixTable", { createId: yi(t.id) });
317
+ if (!Tn(t)) return { status: "not_legacy", card: e };
318
+ const n = ko(t), r = Mo(t) === "table" ? Vn(n, "table") : Mn(n, "matrixTable", { createId: So(t.id) });
319
319
  if (r.status !== "changed") throw new Error(`Card ${t.id} could not leave ${t.type}.`);
320
- const i = r.card.type === "matrixTable" && Tn(r.card).status !== "ready", o = !!n.dataSource && !((s = (a = n.dataSource) == null ? void 0 : a.connectionType) != null && s.trim());
320
+ const o = r.card.type === "matrixTable" && kn(r.card).status !== "ready", i = !!n.dataSource && !((s = (a = n.dataSource) == null ? void 0 : a.connectionType) != null && s.trim());
321
321
  return {
322
322
  status: "routed",
323
323
  card: r.card,
324
324
  gaps: [
325
325
  ...r.gaps,
326
- ...i ? bi : [],
327
- ...o ? Ii : []
326
+ ...o ? To : [],
327
+ ...i ? Vo : []
328
328
  ]
329
329
  };
330
330
  }
331
- function Ga(e) {
331
+ function Ja(e) {
332
332
  if (!e.cards) return e;
333
- const t = e.cards.map((n) => At(n).card);
333
+ const t = e.cards.map((n) => Et(n).card);
334
334
  return t.every((n, r) => n === e.cards[r]) ? e : { ...e, cards: t };
335
335
  }
336
- function vi(e) {
336
+ function xo(e) {
337
337
  const t = [];
338
- return { dashboard: Nr(e, (r, i) => {
339
- const o = At(r);
340
- return o.status === "routed" && o.gaps.length && t.push({ location: i, gaps: o.gaps }), o.card;
338
+ return { dashboard: Ur(e, (r, o) => {
339
+ const i = Et(r);
340
+ return i.status === "routed" && i.gaps.length && t.push({ location: o, gaps: i.gaps }), i.card;
341
341
  }), routedWithGaps: t };
342
342
  }
343
- function Fi(e, t) {
343
+ function Po(e, t) {
344
344
  return e.name === t.name && e.qualifiedEntityName === t.qualifiedEntityName;
345
345
  }
346
- function Di(e, t, n) {
347
- var i, o;
346
+ function wo(e, t, n) {
347
+ var o, i;
348
348
  if (n.sortPolicy === "dropUnrelatedSorts") {
349
349
  const a = new Set(
350
350
  (e.metricColumns || []).map((s) => s.id)
@@ -357,12 +357,12 @@ function Di(e, t, n) {
357
357
  )
358
358
  };
359
359
  }
360
- const r = (i = e.groupByColumns) == null ? void 0 : i[0];
360
+ const r = (o = e.groupByColumns) == null ? void 0 : o[0];
361
361
  return {
362
362
  ...e,
363
363
  groupByColumns: [t],
364
- sortByColumns: (o = e.sortByColumns) == null ? void 0 : o.map(
365
- (a) => r && Fi(a, r) ? {
364
+ sortByColumns: (i = e.sortByColumns) == null ? void 0 : i.map(
365
+ (a) => r && Po(a, r) ? {
366
366
  ...t,
367
367
  role: "sortby",
368
368
  direction: a.direction
@@ -370,14 +370,14 @@ function Di(e, t, n) {
370
370
  )
371
371
  };
372
372
  }
373
- function oe(e) {
373
+ function ie(e) {
374
374
  return e == null ? void 0 : e.map(
375
375
  ({
376
376
  format: t,
377
377
  formatOrigin: n,
378
378
  semanticTemporalPresentation: r,
379
- ...i
380
- }) => i
379
+ ...o
380
+ }) => o
381
381
  );
382
382
  }
383
383
  function ae(e) {
@@ -387,32 +387,32 @@ function ae(e) {
387
387
  format: t,
388
388
  formatOrigin: n,
389
389
  semanticTemporalPresentation: r,
390
- ...i
390
+ ...o
391
391
  } = e;
392
- return Q(i);
392
+ return Q(o);
393
393
  }
394
- function Bt(e, t) {
394
+ function Rt(e, t) {
395
395
  return e == null ? void 0 : e.map(
396
- (n) => lt(Q(oe([n])[0]), n.format, t)
396
+ (n) => dt(Q(ie([n])[0]), n.format, t)
397
397
  );
398
398
  }
399
- function Si(e, t) {
399
+ function Oo(e, t) {
400
400
  return e == null ? void 0 : e.map(
401
- (n) => Mn(Q(oe([n])[0]), n.format, t)
401
+ (n) => Pn(Q(ie([n])[0]), n.format, t)
402
402
  );
403
403
  }
404
- function Ti(e, t) {
405
- const { dateFormat: n, customFormat: r, ...i } = ae(e.field);
404
+ function _o(e, t) {
405
+ const { dateFormat: n, customFormat: r, ...o } = ae(e.field);
406
406
  return {
407
407
  ...e,
408
- field: t ? i : lt(ae(e.field), e.field.format, "raw")
408
+ field: t ? o : dt(ae(e.field), e.field.format, "raw")
409
409
  };
410
410
  }
411
411
  function me(e, t = !1) {
412
412
  if (e)
413
413
  return {
414
414
  ...e,
415
- conditions: e.conditions.map((n) => Ti(n, t)),
415
+ conditions: e.conditions.map((n) => _o(n, t)),
416
416
  groups: e.groups.map((n) => me(n, t))
417
417
  };
418
418
  }
@@ -422,93 +422,93 @@ function Q(e) {
422
422
  return (n = t.calculatedFormula) != null && n.inputFields && (t.calculatedFormula = {
423
423
  ...t.calculatedFormula,
424
424
  inputFields: t.calculatedFormula.inputFields.map(
425
- (i) => ae(i)
425
+ (o) => ae(o)
426
426
  )
427
427
  }), (r = t.parameters) != null && r.filters && (t.parameters = {
428
428
  ...t.parameters,
429
429
  filters: me(t.parameters.filters)
430
430
  }), t;
431
431
  }
432
- function Vi(e, t) {
433
- return t.cardType === "detailTable" || !kn(t.cardType) || t.temporalResultOwner !== "config" ? Bt(e, "grouped") : e == null ? void 0 : e.map((n) => {
434
- const r = xn(n), i = ae(r ?? n);
432
+ function Ao(e, t) {
433
+ return t.cardType === "detailTable" || !wn(t.cardType) || t.temporalResultOwner !== "config" ? Rt(e, "grouped") : e == null ? void 0 : e.map((n) => {
434
+ const r = On(n), o = ae(r ?? n);
435
435
  if (!r)
436
- return i;
437
- const { dateFormat: o, customFormat: a, ...s } = i;
436
+ return o;
437
+ const { dateFormat: i, customFormat: a, ...s } = o;
438
438
  return s;
439
439
  });
440
440
  }
441
- function Et(e, t) {
441
+ function qt(e, t) {
442
442
  if (!e)
443
443
  return;
444
444
  const n = { type: t.cardType, config: e };
445
- return Te(n) ? Mi(n, t) : e.matrix === void 0 ? {} : { matrix: e.matrix };
445
+ return Te(n) ? Bo(n, t) : e.matrix === void 0 ? {} : { matrix: e.matrix };
446
446
  }
447
- function Mi(e, t = {}) {
448
- var o, a, s;
447
+ function Bo(e, t = {}) {
448
+ var i, a, s;
449
449
  const n = e.config;
450
450
  if (!n) return;
451
451
  const r = { ...t, cardType: e.type };
452
452
  return {
453
453
  ...n,
454
- groupByColumns: Vi(n.groupByColumns, r),
455
- metricColumns: (o = oe(n.metricColumns)) == null ? void 0 : o.map(
454
+ groupByColumns: Ao(n.groupByColumns, r),
455
+ metricColumns: (i = ie(n.metricColumns)) == null ? void 0 : i.map(
456
456
  Q
457
457
  ),
458
- pivotByColumns: Bt(n.pivotByColumns, "grouped"),
459
- sortByColumns: (a = oe(n.sortByColumns)) == null ? void 0 : a.map(
458
+ pivotByColumns: Rt(n.pivotByColumns, "grouped"),
459
+ sortByColumns: (a = ie(n.sortByColumns)) == null ? void 0 : a.map(
460
460
  Q
461
461
  ),
462
- detailColumns: Si(n.detailColumns, (s = r.dataSource) == null ? void 0 : s.connectionType),
462
+ detailColumns: Oo(n.detailColumns, (s = r.dataSource) == null ? void 0 : s.connectionType),
463
463
  filters: me(n.filters)
464
464
  };
465
465
  }
466
466
  function se(e) {
467
467
  return (e == null ? void 0 : e.type) === "number" || (e == null ? void 0 : e.type) === "currency";
468
468
  }
469
- function ki(e) {
469
+ function Eo(e) {
470
470
  return (e == null ? void 0 : e.type) === "number";
471
471
  }
472
- function xi(e) {
472
+ function Ro(e) {
473
473
  var n;
474
- if (!ki(e))
474
+ if (!Eo(e))
475
475
  return !1;
476
476
  const t = (n = e == null ? void 0 : e.numberFormat) == null ? void 0 : n.style;
477
477
  return t === void 0 || t === "decimal" || t === "currency";
478
478
  }
479
- function Pi(e, t) {
479
+ function qo(e, t) {
480
480
  const n = t == null ? void 0 : t.type;
481
481
  if (n && n !== "none" && n !== "number")
482
482
  return { currencyBindable: !1 };
483
- const r = n === "number" ? t != null && t.numberFormat ? wn(t.numberFormat, {
483
+ const r = n === "number" ? t != null && t.numberFormat ? An(t.numberFormat, {
484
484
  preserveOmittedProperties: !0
485
- }) : { type: "number" } : void 0, i = re(e.format, {
485
+ }) : { type: "number" } : void 0, o = re(e.format, {
486
486
  preserveOmittedProperties: !0
487
- }), o = W(e.dataType) === "number" ? { type: "number" } : void 0, s = (t == null ? void 0 : t.inheritMetricFormat) === !1 || !!(t != null && t.numberFormat) && (t == null ? void 0 : t.inheritMetricFormat) !== !0 ? r : i || o || r;
487
+ }), i = W(e.dataType) === "number" ? { type: "number" } : void 0, s = (t == null ? void 0 : t.inheritMetricFormat) === !1 || !!(t != null && t.numberFormat) && (t == null ? void 0 : t.inheritMetricFormat) !== !0 ? r : o || i || r;
488
488
  return {
489
489
  authoredFormat: s,
490
490
  currencyBindable: se(s)
491
491
  };
492
492
  }
493
- function wi(e, t) {
493
+ function No(e, t) {
494
494
  const n = re(t.format, {
495
495
  preserveOmittedProperties: !0
496
- }), r = W(t.dataType) === "number" ? { type: "number" } : void 0, i = n || r;
496
+ }), r = W(t.dataType) === "number" ? { type: "number" } : void 0, o = n || r;
497
497
  return {
498
- authoredFormat: i,
498
+ authoredFormat: o,
499
499
  source: n ? "semantic" : r ? "inferred" : void 0,
500
- currencyBindable: se(i)
500
+ currencyBindable: se(o)
501
501
  };
502
502
  }
503
503
  function Fe(e, t = {}) {
504
504
  var l, c, d;
505
- const n = t.column ?? ((l = Pn(e)) == null ? void 0 : l.value);
505
+ const n = t.column ?? ((l = _n(e)) == null ? void 0 : l.value);
506
506
  if ((n == null ? void 0 : n.kind) === "sqlKpiValue") {
507
507
  const u = t.resultColumnKey ? {
508
508
  kind: "column",
509
509
  columnKey: t.resultColumnKey
510
510
  } : void 0, f = re(
511
- Br({ card: e, column: { kind: "sqlKpiValue" }, surface: "kpiValue" }).format,
511
+ Lr({ card: e, column: { kind: "sqlKpiValue" }, surface: "kpiValue" }).format,
512
512
  { preserveOmittedProperties: !0 }
513
513
  );
514
514
  return {
@@ -518,77 +518,77 @@ function Fe(e, t = {}) {
518
518
  currencyBindable: !!u && se(f)
519
519
  };
520
520
  }
521
- const r = n ? (d = (c = e.config) == null ? void 0 : c.metricColumns) == null ? void 0 : d.find((u) => u.id === n.fieldId) : void 0, i = r != null && r.id ? {
521
+ const r = n ? (d = (c = e.config) == null ? void 0 : c.metricColumns) == null ? void 0 : d.find((u) => u.id === n.fieldId) : void 0, o = r != null && r.id ? {
522
522
  kind: "metric",
523
523
  metricId: r.id
524
- } : void 0, o = re(r == null ? void 0 : r.format, {
524
+ } : void 0, i = re(r == null ? void 0 : r.format, {
525
525
  preserveOmittedProperties: !0
526
- }), a = W(r == null ? void 0 : r.dataType) === "number" ? { type: "number" } : void 0, s = o || a;
526
+ }), a = W(r == null ? void 0 : r.dataType) === "number" ? { type: "number" } : void 0, s = i || a;
527
527
  return {
528
- target: i,
528
+ target: o,
529
529
  authoredFormat: s,
530
- ...o ? { source: "stored" } : a ? { source: "inferred" } : {},
531
- currencyBindable: ct(e.type) && !!i && se(s)
530
+ ...i ? { source: "stored" } : a ? { source: "inferred" } : {},
531
+ currencyBindable: ut(e.type) && !!o && se(s)
532
532
  };
533
533
  }
534
- function Rt(e, t, n) {
535
- var i;
534
+ function Nt(e, t, n) {
535
+ var o;
536
536
  const r = n(e, t);
537
- return ((i = e.derivedField) == null ? void 0 : i.format) ?? (r == null ? void 0 : r.format) ?? (r == null ? void 0 : r.resolvedField.format);
537
+ return ((o = e.derivedField) == null ? void 0 : o.format) ?? (r == null ? void 0 : r.format) ?? (r == null ? void 0 : r.resolvedField.format);
538
538
  }
539
- function qt(e, t, n) {
540
- return e.kind === "calculated" ? e.definition.format : Rt(e.field, t, n);
539
+ function jt(e, t, n) {
540
+ return e.kind === "calculated" ? e.definition.format : Nt(e.field, t, n);
541
541
  }
542
- function Ha(e, t) {
543
- const n = dt(t), r = (i, o) => Object.fromEntries(i.flatMap((a) => {
544
- const s = o(a);
542
+ function Ya(e, t) {
543
+ const n = ft(t), r = (o, i) => Object.fromEntries(o.flatMap((a) => {
544
+ const s = i(a);
545
545
  return s ? [[a.id, s]] : [];
546
546
  }));
547
547
  return {
548
- measureFormats: r(e.measures, (i) => qt(i, e.source, n)),
549
- levelFormats: r([...e.rows, ...e.columns], (i) => Rt(i.field, e.source, n))
548
+ measureFormats: r(e.measures, (o) => jt(o, e.source, n)),
549
+ levelFormats: r([...e.rows, ...e.columns], (o) => Nt(o.field, e.source, n))
550
550
  };
551
551
  }
552
- function Nt(e, t = []) {
552
+ function zt(e, t = []) {
553
553
  const n = Ve(e);
554
554
  if (n.status !== "ready") return [];
555
- const { spec: r, presentation: i } = n.config, o = dt(t);
555
+ const { spec: r, presentation: o } = n.config, i = ft(t);
556
556
  return r.measures.map((a) => {
557
557
  var m;
558
- const s = a.kind === "aggregate" ? o(a.field, r.source) : void 0, l = Er(i.measureFormats[a.id], qt(a, r.source, o)), c = a.kind === "calculated" ? a.definition.dataType : ["MIN", "MAX"].includes(a.aggregate) ? ((m = a.field.derivedField) == null ? void 0 : m.dataType) ?? (s == null ? void 0 : s.resolvedField.dataType) ?? a.field.dataType : "number", d = W(c) === "number", u = a.kind === "calculated" || !!(s || a.field.derivedField || a.field.name === "*"), f = l && Rr(l) ? l : !l && d && u ? { type: "number" } : void 0;
559
- return { measureId: a.id, label: qr(a, i), canonical: f };
558
+ const s = a.kind === "aggregate" ? i(a.field, r.source) : void 0, l = Kr(o.measureFormats[a.id], jt(a, r.source, i)), c = a.kind === "calculated" ? a.definition.dataType : ["MIN", "MAX"].includes(a.aggregate) ? ((m = a.field.derivedField) == null ? void 0 : m.dataType) ?? (s == null ? void 0 : s.resolvedField.dataType) ?? a.field.dataType : "number", d = W(c) === "number", u = a.kind === "calculated" || !!(s || a.field.derivedField || a.field.name === "*"), f = l && Gr(l) ? l : !l && d && u ? { type: "number" } : void 0;
559
+ return { measureId: a.id, label: Hr(a, o), canonical: f };
560
560
  });
561
561
  }
562
- function Oi(e) {
562
+ function jo(e) {
563
563
  var t, n;
564
564
  return e.type === "detailTable" ? ((t = e.config) == null ? void 0 : t.detailColumns) || [] : ((n = e.config) == null ? void 0 : n.metricColumns) || [];
565
565
  }
566
- function jt(e) {
566
+ function Lt(e) {
567
567
  return new Set(
568
- Vt(e).flatMap(
568
+ kt(e).flatMap(
569
569
  (t) => (t.controlBindings || []).filter(de).map((n) => n.controlId)
570
570
  )
571
571
  );
572
572
  }
573
- function _i(e, t) {
573
+ function zo(e, t) {
574
574
  const n = [
575
575
  t.id,
576
576
  t.alias,
577
577
  t.label,
578
578
  t.name,
579
579
  t.qualifiedFieldName
580
- ].filter((o) => !!o);
581
- for (const o of n)
582
- if (e[o])
583
- return e[o];
580
+ ].filter((i) => !!i);
581
+ for (const i of n)
582
+ if (e[i])
583
+ return e[i];
584
584
  const r = new Set(
585
- n.map((o) => o.trim().toLowerCase())
586
- ), i = Object.entries(e).find(
587
- ([o]) => r.has(o.trim().toLowerCase())
585
+ n.map((i) => i.trim().toLowerCase())
586
+ ), o = Object.entries(e).find(
587
+ ([i]) => r.has(i.trim().toLowerCase())
588
588
  );
589
- return i == null ? void 0 : i[1];
589
+ return o == null ? void 0 : o[1];
590
590
  }
591
- function Je(e) {
591
+ function Xe(e) {
592
592
  return [
593
593
  ...new Map(
594
594
  e.map((t) => [
@@ -598,13 +598,13 @@ function Je(e) {
598
598
  ).values()
599
599
  ];
600
600
  }
601
- function Ai(e, t = [], n) {
602
- var D;
603
- const r = !!((D = e.sql) != null && D.trim()), i = ct(e.type), o = r && i && e.type !== "kpi" && e.type !== "matrixTable", a = Oi(e), s = On(e), l = !r && e.type === "kpi" ? a.map(
601
+ function Lo(e, t = [], n) {
602
+ var S;
603
+ const r = !!((S = e.sql) != null && S.trim()), o = ut(e.type), i = r && o && e.type !== "kpi" && e.type !== "matrixTable", a = jo(e), s = Bn(e), l = !r && e.type === "kpi" ? a.map(
604
604
  (g) => Fe(e, {
605
605
  column: { kind: "field", fieldId: g.id }
606
606
  })
607
- ) : [], c = !r && e.type === "matrixTable" ? Nt(e, n) : [], d = (r ? [] : a).map(
607
+ ) : [], c = !r && e.type === "matrixTable" ? zt(e, n) : [], d = (r ? [] : a).map(
608
608
  (g) => ({
609
609
  kind: "metric",
610
610
  metricId: g.id
@@ -624,23 +624,23 @@ function Ai(e, t = [], n) {
624
624
  })
625
625
  ), m = e.type === "matrixTable" ? [] : e.type === "kpi" ? l.filter((g) => g.currencyBindable).flatMap(
626
626
  (g) => g.target ? [g.target] : []
627
- ) : (r || !i ? [] : a).filter(
628
- (g) => (_n(e.type) ? Pi(
627
+ ) : (r || !o ? [] : a).filter(
628
+ (g) => (En(e.type) ? qo(
629
629
  g,
630
- _i(s, g)
631
- ) : wi(e, g)).currencyBindable
630
+ zo(s, g)
631
+ ) : No(e, g)).currencyBindable
632
632
  ).map(
633
633
  (g) => ({
634
634
  kind: "metric",
635
635
  metricId: g.id
636
636
  })
637
- ), y = [...new Set(t)], p = (o ? y : []).map(
637
+ ), y = [...new Set(t)], p = (i ? y : []).map(
638
638
  (g) => ({
639
639
  kind: "column",
640
640
  columnKey: g
641
641
  })
642
- ), b = (o ? y : []).filter(
643
- (g) => xi(
642
+ ), b = (i ? y : []).filter(
643
+ (g) => Ro(
644
644
  s[g]
645
645
  )
646
646
  ).map(
@@ -655,14 +655,14 @@ function Ai(e, t = [], n) {
655
655
  })
656
656
  ), C = r && e.type === "kpi" ? Fe(e, {
657
657
  resultColumnKey: y[0]
658
- }) : void 0, h = i && (C != null && C.currencyBindable) ? I : [];
658
+ }) : void 0, h = o && (C != null && C.currencyBindable) ? I : [];
659
659
  return {
660
- knownTargets: Je([
660
+ knownTargets: Xe([
661
661
  ...e.type === "matrixTable" ? u : d,
662
662
  ...p,
663
663
  ...I
664
664
  ]),
665
- eligibleTargets: Je([
665
+ eligibleTargets: Xe([
666
666
  ...m,
667
667
  ...f,
668
668
  ...b,
@@ -670,20 +670,20 @@ function Ai(e, t = [], n) {
670
670
  ])
671
671
  };
672
672
  }
673
- function Ua(e, t) {
673
+ function Xa(e, t) {
674
674
  const n = Fe(e, {
675
675
  resultColumnKey: t
676
676
  });
677
677
  return n.currencyBindable ? n.target : void 0;
678
678
  }
679
- function Qa(e) {
679
+ function es(e) {
680
680
  var t;
681
681
  return (t = e.card.sql) != null && t.trim() ? { kind: "column", columnKey: e.columnKey } : e.metricId ? { kind: "metric", metricId: e.metricId } : void 0;
682
682
  }
683
683
  function z(e) {
684
684
  return e.kind === "metric" ? `metric:${e.metricId}` : e.kind === "column" ? `column:${e.columnKey}` : `matrix_measure:${e.measureId}`;
685
685
  }
686
- function Bi(e) {
686
+ function Ko(e) {
687
687
  if (!e || typeof e != "object" || Array.isArray(e))
688
688
  return;
689
689
  const t = e;
@@ -694,20 +694,20 @@ function Bi(e) {
694
694
  if (t.kind === "matrix_measure" && typeof t.measureId == "string" && t.measureId.trim())
695
695
  return { kind: "matrix_measure", measureId: t.measureId };
696
696
  }
697
- function Ye(e) {
698
- const t = Dt(e);
697
+ function et(e) {
698
+ const t = Tt(e);
699
699
  return typeof e == "string" && e === t ? t : void 0;
700
700
  }
701
- function zt(e) {
701
+ function Kt(e) {
702
702
  if (e.type !== "enum" || e.source.kind !== "manual")
703
703
  return { diagnostic: "invalid_control_type" };
704
704
  const t = e.source.options.map(
705
- (n) => Ye(n.value)
705
+ (n) => et(n.value)
706
706
  );
707
707
  if (t.length === 0 || t.some((n) => !n))
708
708
  return { diagnostic: "invalid_currency_option" };
709
709
  if (e.requiredAtExecution) {
710
- const n = e.initialValueStrategy === "saved_default" ? Ye(e.defaultValue) : void 0;
710
+ const n = e.initialValueStrategy === "saved_default" ? et(e.defaultValue) : void 0;
711
711
  if (!n || !t.includes(n))
712
712
  return { diagnostic: "invalid_control_default" };
713
713
  }
@@ -716,11 +716,11 @@ function zt(e) {
716
716
  currencies: t
717
717
  };
718
718
  }
719
- function $a(e) {
720
- return "control" in zt(e);
719
+ function ts(e) {
720
+ return "control" in Kt(e);
721
721
  }
722
- function Lt(e) {
723
- const t = jt(e.dashboard);
722
+ function Gt(e) {
723
+ const t = Lt(e.dashboard);
724
724
  if (t.size === 0)
725
725
  return {
726
726
  definitions: e.definitions || [],
@@ -742,8 +742,8 @@ function Lt(e) {
742
742
  )
743
743
  };
744
744
  }
745
- function Wa(e) {
746
- return Lt({
745
+ function ns(e) {
746
+ return Gt({
747
747
  ...e,
748
748
  referencedControlIds: new Set(
749
749
  Ae({
@@ -753,9 +753,9 @@ function Wa(e) {
753
753
  )
754
754
  });
755
755
  }
756
- function Za(e) {
756
+ function rs(e) {
757
757
  var t;
758
- return Lt({
758
+ return Gt({
759
759
  ...e,
760
760
  referencedControlIds: new Set(
761
761
  Ae({
@@ -765,7 +765,7 @@ function Za(e) {
765
765
  )
766
766
  });
767
767
  }
768
- function Kt(e) {
768
+ function Ht(e) {
769
769
  return {
770
770
  knownKeys: new Set(
771
771
  e.knownTargets.map(z)
@@ -778,25 +778,25 @@ function Kt(e) {
778
778
  )
779
779
  };
780
780
  }
781
- function Gt(e, t) {
781
+ function Ut(e, t) {
782
782
  if (!e || typeof e != "object" || e.target !== "presentation_currency")
783
783
  return {};
784
784
  const n = e, r = typeof n.controlId == "string" && n.controlId.trim() ? n.controlId : void 0;
785
785
  if (!r)
786
786
  return { diagnostic: { code: "invalid_binding_shape" } };
787
- const i = Bi(
787
+ const o = Ko(
788
788
  n.presentationTarget
789
789
  );
790
- if (!i)
790
+ if (!o)
791
791
  return {
792
792
  diagnostic: { code: "missing_target", controlId: r }
793
793
  };
794
- const o = z(i);
795
- if (!t.knownKeys.has(o))
794
+ const i = z(o);
795
+ if (!t.knownKeys.has(i))
796
796
  return {
797
797
  diagnostic: { code: "stale_target", controlId: r }
798
798
  };
799
- if (!t.eligibleKeys.has(o))
799
+ if (!t.eligibleKeys.has(i))
800
800
  return {
801
801
  diagnostic: { code: "inapplicable_target", controlId: r }
802
802
  };
@@ -805,30 +805,30 @@ function Gt(e, t) {
805
805
  return {
806
806
  diagnostic: { code: "missing_control", controlId: r }
807
807
  };
808
- const s = zt(a);
808
+ const s = Kt(a);
809
809
  return "diagnostic" in s ? {
810
810
  diagnostic: { code: s.diagnostic, controlId: r }
811
811
  } : {
812
812
  binding: {
813
813
  controlId: r,
814
- presentationTarget: i,
814
+ presentationTarget: o,
815
815
  control: s.control,
816
816
  currencies: s.currencies
817
817
  }
818
818
  };
819
819
  }
820
- function Ja(e) {
821
- const t = Kt(e);
820
+ function os(e) {
821
+ const t = Ht(e);
822
822
  return (e.bindings || []).flatMap((n) => {
823
- const r = Gt(n, t);
823
+ const r = Ut(n, t);
824
824
  return "diagnostic" in r ? [r.diagnostic] : [];
825
825
  });
826
826
  }
827
- function Ei(e) {
828
- var i;
829
- const t = [], n = z(e.target), r = Kt(e);
830
- for (const o of e.bindings || []) {
831
- const a = Gt(o, r);
827
+ function Go(e) {
828
+ var o;
829
+ const t = [], n = z(e.target), r = Ht(e);
830
+ for (const i of e.bindings || []) {
831
+ const a = Ut(i, r);
832
832
  if ("diagnostic" in a) {
833
833
  t.push(a.diagnostic);
834
834
  continue;
@@ -837,20 +837,20 @@ function Ei(e) {
837
837
  if (!s || z(
838
838
  s.presentationTarget
839
839
  ) !== n) continue;
840
- const c = Dt(
841
- (i = e.values) == null ? void 0 : i[s.control.id]
840
+ const c = Tt(
841
+ (o = e.values) == null ? void 0 : o[s.control.id]
842
842
  );
843
843
  if (!(!c || !s.currencies.includes(c)))
844
844
  return { currency: c, diagnostics: t };
845
845
  }
846
846
  return { diagnostics: t };
847
847
  }
848
- function Ri(e, t, n, r) {
849
- const i = { ...e, config: { ...e.config, matrix: t } }, o = Ai(i, [], r), a = Nt(i, r), s = { ...t.presentation.measureFormats };
848
+ function Ho(e, t, n, r) {
849
+ const o = { ...e, config: { ...e.config, matrix: t } }, i = Lo(o, [], r), a = zt(o, r), s = { ...t.presentation.measureFormats };
850
850
  for (const l of a) {
851
- const c = { kind: "matrix_measure", measureId: l.measureId }, { currency: d } = Ei({
851
+ const c = { kind: "matrix_measure", measureId: l.measureId }, { currency: d } = Go({
852
852
  ...n,
853
- ...o,
853
+ ...i,
854
854
  bindings: e.controlBindings,
855
855
  target: c
856
856
  });
@@ -860,7 +860,7 @@ function Ri(e, t, n, r) {
860
860
  }
861
861
  return { ...t.presentation, measureFormats: s };
862
862
  }
863
- function qi(e, t) {
863
+ function Uo(e, t) {
864
864
  if (!e || typeof e != "object" || !("kind" in e))
865
865
  return e;
866
866
  switch (e.kind) {
@@ -905,12 +905,12 @@ function qi(e, t) {
905
905
  return e;
906
906
  }
907
907
  }
908
- function Ni(e, t) {
908
+ function Qo(e, t) {
909
909
  return {
910
910
  id: e.id,
911
911
  scope: e.scope,
912
912
  type: e.type,
913
- source: qi(e.source, t),
913
+ source: Uo(e.source, t),
914
914
  initialValueStrategy: e.initialValueStrategy,
915
915
  defaultValue: e.defaultValue,
916
916
  requiredAtExecution: e.requiredAtExecution,
@@ -925,14 +925,14 @@ function Ni(e, t) {
925
925
  } : {}
926
926
  };
927
927
  }
928
- function ji(e, t) {
928
+ function $o(e, t) {
929
929
  return e.target === "sql_param" || e.target === "presentation_currency" ? e : e.target === "config_field_selector" && !(t != null && t.includePresentation) ? {
930
930
  ...e,
931
931
  mapping: Object.fromEntries(
932
932
  Object.entries(e.mapping).sort(([n], [r]) => n.localeCompare(r)).map(([n, r]) => {
933
933
  if ("kind" in r) return [n, r];
934
- const i = { ...r };
935
- return delete i.format, delete i.dateFormat, delete i.customFormat, delete i.semanticTemporalPresentation, [n, i];
934
+ const o = { ...r };
935
+ return delete o.format, delete o.dateFormat, delete o.customFormat, delete o.semanticTemporalPresentation, [n, o];
936
936
  })
937
937
  )
938
938
  } : {
@@ -942,40 +942,40 @@ function ji(e, t) {
942
942
  n,
943
943
  r && typeof r == "object" && !Array.isArray(r) ? Object.fromEntries(
944
944
  Object.entries(r).sort(
945
- ([i], [o]) => i.localeCompare(o)
945
+ ([o], [i]) => o.localeCompare(i)
946
946
  )
947
947
  ) : r
948
948
  ])
949
949
  )
950
950
  };
951
951
  }
952
- function Xe(e = [], t) {
953
- return [...e].map((n) => Ni(n, t)).sort(
952
+ function tt(e = [], t) {
953
+ return [...e].map((n) => Qo(n, t)).sort(
954
954
  (n, r) => n.id.localeCompare(r.id) || n.scope.localeCompare(r.scope) || n.type.localeCompare(r.type)
955
955
  );
956
956
  }
957
- function zi(e = [], t) {
957
+ function Wo(e = [], t) {
958
958
  return e.filter(
959
959
  (n) => (t == null ? void 0 : t.includePresentation) || !de(n)
960
- ).map((n) => ji(n, t)).sort(
960
+ ).map((n) => $o(n, t)).sort(
961
961
  (n, r) => _(n).localeCompare(_(r))
962
962
  );
963
963
  }
964
- function Li(e, t) {
964
+ function Zo(e, t) {
965
965
  return e ? _({
966
- controlDefinitions: Xe(e.controlDefinitions, t),
967
- cardControlDefinitions: Xe(
966
+ controlDefinitions: tt(e.controlDefinitions, t),
967
+ cardControlDefinitions: tt(
968
968
  e.cardControlDefinitions,
969
969
  t
970
970
  ),
971
- controlBindings: zi(e.controlBindings, t)
971
+ controlBindings: Wo(e.controlBindings, t)
972
972
  }) : "__none__";
973
973
  }
974
- const Ki = ["table", "detailTable"], et = (e) => Ki.includes(e.type), Gi = "calendar-context";
975
- function Hi(e) {
976
- const { id: t, label: n, field: r, ...i } = e;
974
+ const Jo = ["table", "detailTable"], nt = (e) => Jo.includes(e.type), Yo = "calendar-context";
975
+ function Xo(e) {
976
+ const { id: t, label: n, field: r, ...o } = e;
977
977
  return {
978
- ...i,
978
+ ...o,
979
979
  field: Be(
980
980
  r
981
981
  )
@@ -984,15 +984,15 @@ function Hi(e) {
984
984
  function ge(e) {
985
985
  if (!e)
986
986
  return;
987
- const { id: t, conditions: n, groups: r, ...i } = e;
987
+ const { id: t, conditions: n, groups: r, ...o } = e;
988
988
  return {
989
- ...i,
990
- conditions: n.map(Hi),
991
- groups: r.map((o) => ge(o))
989
+ ...o,
990
+ conditions: n.map(Xo),
991
+ groups: r.map((i) => ge(i))
992
992
  };
993
993
  }
994
994
  function Be(e) {
995
- var r, i;
995
+ var r, o;
996
996
  const { label: t, ...n } = e;
997
997
  return {
998
998
  ...n,
@@ -1004,7 +1004,7 @@ function Be(e) {
1004
1004
  )
1005
1005
  }
1006
1006
  } : {},
1007
- ...(i = e.parameters) != null && i.filters ? {
1007
+ ...(o = e.parameters) != null && o.filters ? {
1008
1008
  parameters: {
1009
1009
  ...e.parameters,
1010
1010
  filters: ge(
@@ -1014,7 +1014,7 @@ function Be(e) {
1014
1014
  } : {}
1015
1015
  };
1016
1016
  }
1017
- function Ui(e) {
1017
+ function ei(e) {
1018
1018
  const t = (n) => n == null ? void 0 : n.map(Be);
1019
1019
  return {
1020
1020
  ...e,
@@ -1026,44 +1026,44 @@ function Ui(e) {
1026
1026
  filters: e.filters ? ge(e.filters) : void 0
1027
1027
  };
1028
1028
  }
1029
- function Qi(e, t, n) {
1029
+ function ti(e, t, n) {
1030
1030
  if (!e)
1031
1031
  return JSON.stringify(e);
1032
- if (n === "matrixTable" && e.matrix) return _(Ur(e.matrix.spec));
1033
- const { matrix: r, ...i } = e, o = t ? Ui(i) : i;
1032
+ if (n === "matrixTable" && e.matrix) return _(Xr(e.matrix.spec));
1033
+ const { matrix: r, ...o } = e, i = t ? ei(o) : o;
1034
1034
  return JSON.stringify({
1035
- ...o,
1036
- filters: ge(o.filters)
1035
+ ...i,
1036
+ filters: ge(i.filters)
1037
1037
  });
1038
1038
  }
1039
- function $i(e) {
1039
+ function ni(e) {
1040
1040
  if (!e)
1041
1041
  return null;
1042
1042
  const { format: t, ...n } = e;
1043
1043
  return n;
1044
1044
  }
1045
- function Wi(e, t) {
1045
+ function ri(e, t) {
1046
1046
  const n = /* @__PURE__ */ new Map();
1047
- for (const i of (t == null ? void 0 : t.controlDefinitions) || [])
1048
- n.set(i.id, i.type);
1049
- for (const i of (t == null ? void 0 : t.cardControlDefinitions) || [])
1050
- n.set(i.id, i.type);
1047
+ for (const o of (t == null ? void 0 : t.controlDefinitions) || [])
1048
+ n.set(o.id, o.type);
1049
+ for (const o of (t == null ? void 0 : t.cardControlDefinitions) || [])
1050
+ n.set(o.id, o.type);
1051
1051
  const r = Object.fromEntries(
1052
- Object.entries(e || {}).map(([i, o]) => n.get(i) === "multi_enum" && Array.isArray(o) ? [
1053
- i,
1054
- [...o].sort(
1052
+ Object.entries(e || {}).map(([o, i]) => n.get(o) === "multi_enum" && Array.isArray(i) ? [
1053
+ o,
1054
+ [...i].sort(
1055
1055
  (a, s) => _(a).localeCompare(_(s))
1056
1056
  )
1057
- ] : [i, o])
1057
+ ] : [o, i])
1058
1058
  );
1059
1059
  return _(r);
1060
1060
  }
1061
- function Zi(e, {
1061
+ function oi(e, {
1062
1062
  finalFiltersKey: t,
1063
1063
  cardFilterValues: n,
1064
1064
  controlValues: r,
1065
- controlDefinitions: i,
1066
- cardControlDefinitions: o,
1065
+ controlDefinitions: o,
1066
+ cardControlDefinitions: i,
1067
1067
  controlBindings: a,
1068
1068
  queryRelevantConfig: s,
1069
1069
  resolvedPrimaryDateField: l,
@@ -1072,12 +1072,12 @@ function Zi(e, {
1072
1072
  }) {
1073
1073
  const { filterColumns: u, ...f } = e.queryConfig || {}, m = u == null ? void 0 : u.filter(
1074
1074
  (h) => {
1075
- var D, g;
1076
- return (g = (D = e.queryConfig) == null ? void 0 : D.filters) == null ? void 0 : g.some((V) => V.filterColumnName === h.name);
1075
+ var S, g;
1076
+ return (g = (S = e.queryConfig) == null ? void 0 : S.filters) == null ? void 0 : g.some((V) => V.filterColumnName === h.name);
1077
1077
  }
1078
1078
  ), y = (e == null ? void 0 : e.sql) || "", p = Me((e == null ? void 0 : e.python) || ""), b = ["table", "detailTable", "matrixTable"].includes(
1079
1079
  e.type
1080
- ) ? "table" : e.type === "kpi" ? "kpi" : "chart", I = s || Et(e.config, { cardType: e.type, dataSource: e.dataSource }), C = An.includes(
1080
+ ) ? "table" : e.type === "kpi" ? "kpi" : "chart", I = s || qt(e.config, { cardType: e.type, dataSource: e.dataSource }), C = Rn.includes(
1081
1081
  e.type
1082
1082
  );
1083
1083
  return [
@@ -1087,24 +1087,24 @@ function Zi(e, {
1087
1087
  y,
1088
1088
  p,
1089
1089
  JSON.stringify(n),
1090
- Wi(r, {
1091
- controlDefinitions: i,
1092
- cardControlDefinitions: o
1090
+ ri(r, {
1091
+ controlDefinitions: o,
1092
+ cardControlDefinitions: i
1093
1093
  }),
1094
- Li({
1095
- controlDefinitions: i,
1096
- cardControlDefinitions: o,
1094
+ Zo({
1095
+ controlDefinitions: o,
1096
+ cardControlDefinitions: i,
1097
1097
  controlBindings: a
1098
1098
  }),
1099
1099
  _(
1100
- $i(l)
1100
+ ni(l)
1101
1101
  ),
1102
1102
  _(c ?? null),
1103
- Gi,
1103
+ Yo,
1104
1104
  _(d),
1105
1105
  JSON.stringify(f),
1106
1106
  JSON.stringify(m),
1107
- Qi(
1107
+ ti(
1108
1108
  I,
1109
1109
  C,
1110
1110
  e.type
@@ -1112,20 +1112,20 @@ function Zi(e, {
1112
1112
  t
1113
1113
  ];
1114
1114
  }
1115
- function Ji(e, t, n) {
1115
+ function ii(e, t, n) {
1116
1116
  var s, l, c;
1117
- const r = Zi(e, t), i = _(r), o = ((s = n == null ? void 0 : n.resolvePaginationConfig) == null ? void 0 : s.call(n, i)) ?? e.paginationConfig, a = et(e) && ue(e.config) || et(e) && e.sql && ((c = (l = e.preferences) == null ? void 0 : l.tablePrefs) == null ? void 0 : c.enableDevModePagination);
1117
+ const r = oi(e, t), o = _(r), i = ((s = n == null ? void 0 : n.resolvePaginationConfig) == null ? void 0 : s.call(n, o)) ?? e.paginationConfig, a = nt(e) && ue(e.config) || nt(e) && e.sql && ((c = (l = e.preferences) == null ? void 0 : l.tablePrefs) == null ? void 0 : c.enableDevModePagination);
1118
1118
  return {
1119
1119
  queryKey: [
1120
1120
  ...r,
1121
- a ? JSON.stringify(o) : ""
1121
+ a ? JSON.stringify(i) : ""
1122
1122
  ],
1123
- queryInputIdentity: i,
1124
- paginationConfig: o
1123
+ queryInputIdentity: o,
1124
+ paginationConfig: i
1125
1125
  };
1126
1126
  }
1127
- function Yi(e, t, n, r) {
1128
- return Ji(
1127
+ function ai(e, t, n, r) {
1128
+ return ii(
1129
1129
  e,
1130
1130
  {
1131
1131
  finalFiltersKey: t.finalFiltersKey,
@@ -1142,32 +1142,32 @@ function Yi(e, t, n, r) {
1142
1142
  r
1143
1143
  );
1144
1144
  }
1145
- const Xi = 500, eo = 250;
1145
+ const si = 500, li = 250;
1146
1146
  function De(e) {
1147
1147
  return e.type === "table" || e.type === "detailTable";
1148
1148
  }
1149
- function to(e) {
1149
+ function ci(e) {
1150
1150
  var t, n, r;
1151
1151
  return !!((t = e.sql) != null && t.trim() && De(e) && ((r = (n = e.preferences) == null ? void 0 : n.tablePrefs) != null && r.enableDevModePagination));
1152
1152
  }
1153
- function Ya(e) {
1154
- return e === "export-full-with-cap" ? Xi : eo;
1153
+ function is(e) {
1154
+ return e === "export-full-with-cap" ? si : li;
1155
1155
  }
1156
- function no({
1156
+ function di({
1157
1157
  card: e,
1158
1158
  isTablePrintMode: t,
1159
1159
  isDocumentSectionRuntime: n,
1160
1160
  documentTableDataPolicy: r
1161
1161
  }) {
1162
1162
  var l, c;
1163
- const i = n && r !== void 0 && De(e), o = t && !i, a = ue(e.config) && De(e) && !e.sql, s = i ? to(e) : !!(e.sql && ((c = (l = e.preferences) == null ? void 0 : l.tablePrefs) != null && c.enableDevModePagination));
1164
- return !o && (a || s);
1163
+ const o = n && r !== void 0 && De(e), i = t && !o, a = ue(e.config) && De(e) && !e.sql, s = o ? ci(e) : !!(e.sql && ((c = (l = e.preferences) == null ? void 0 : l.tablePrefs) != null && c.enableDevModePagination));
1164
+ return !i && (a || s);
1165
1165
  }
1166
- function ro(e) {
1166
+ function ui(e) {
1167
1167
  var t, n, r;
1168
1168
  return ((t = e.paginationConfig) == null ? void 0 : t.pageSize) || ((r = (n = e.preferences) == null ? void 0 : n.tablePrefs) == null ? void 0 : r.pageSize) || 50;
1169
1169
  }
1170
- function Xa({
1170
+ function as({
1171
1171
  current: e,
1172
1172
  defaultPageSize: t,
1173
1173
  queryInputIdentity: n
@@ -1180,10 +1180,10 @@ function Xa({
1180
1180
  pageSize: (e == null ? void 0 : e.pageSize) ?? t
1181
1181
  };
1182
1182
  }
1183
- function es(e, t, n) {
1183
+ function ss(e, t, n) {
1184
1184
  return (e == null ? void 0 : e.queryInputIdentity) === n && e.page === t.page && e.pageSize === t.pageSize;
1185
1185
  }
1186
- function ts(e, t) {
1186
+ function ls(e, t) {
1187
1187
  return !e || !t || e.page === t.page && e.pageSize === t.pageSize ? e : {
1188
1188
  ...e,
1189
1189
  page: t.page,
@@ -1191,20 +1191,20 @@ function ts(e, t) {
1191
1191
  hasPrevPage: t.page > 1
1192
1192
  };
1193
1193
  }
1194
- function io(e) {
1195
- return { page: 1, pageSize: ro(e) };
1194
+ function fi(e) {
1195
+ return { page: 1, pageSize: ui(e) };
1196
1196
  }
1197
- function oo(e) {
1197
+ function pi(e) {
1198
1198
  var a, s, l, c, d;
1199
- const { card: t } = e, n = no({
1199
+ const { card: t } = e, n = di({
1200
1200
  card: t,
1201
1201
  isTablePrintMode: ((a = e.display) == null ? void 0 : a.isTablePrintMode) ?? !1,
1202
1202
  isDocumentSectionRuntime: !!e.documentSection,
1203
1203
  documentTableDataPolicy: (s = e.documentSection) == null ? void 0 : s.documentTableDataPolicy
1204
- }), { page: r } = e, i = e.documentSection && !e.documentSection.totalsRow ? void 0 : Bn(t, e.finalConfig), o = !!((l = e.display) != null && l.deliveryStrict && e.display.isTablePrintMode && !e.documentSection && Wr(t.type));
1204
+ }), { page: r } = e, o = e.documentSection && !e.documentSection.totalsRow ? void 0 : qn(t, e.finalConfig), i = !!((l = e.display) != null && l.deliveryStrict && e.display.isTablePrintMode && !e.documentSection && no(t.type));
1205
1205
  return {
1206
- ...i ? { tableTotalsRequest: i } : {},
1207
- ...o ? { sourceRowProbe: { limit: Zr.maxTableRows } } : {},
1206
+ ...o ? { tableTotalsRequest: o } : {},
1207
+ ...i ? { sourceRowProbe: { limit: ro.maxTableRows } } : {},
1208
1208
  ...n ? {
1209
1209
  pagination: {
1210
1210
  page: (r == null ? void 0 : r.page) || 1,
@@ -1213,14 +1213,14 @@ function oo(e) {
1213
1213
  } : {}
1214
1214
  };
1215
1215
  }
1216
- function ao(e, t = {}) {
1217
- var i, o, a;
1218
- const n = ((i = e.connectionId) == null ? void 0 : i.trim()) || void 0;
1216
+ function mi(e, t = {}) {
1217
+ var o, i, a;
1218
+ const n = ((o = e.connectionId) == null ? void 0 : o.trim()) || void 0;
1219
1219
  if (t.editorDevMode) return n;
1220
- const r = ((a = (o = e.dataSource) == null ? void 0 : o.connectionId) == null ? void 0 : a.trim()) || void 0;
1220
+ const r = ((a = (i = e.dataSource) == null ? void 0 : i.connectionId) == null ? void 0 : a.trim()) || void 0;
1221
1221
  return e.sql ? n || r : r || n;
1222
1222
  }
1223
- function so(e, t) {
1223
+ function gi(e, t) {
1224
1224
  var n;
1225
1225
  return {
1226
1226
  connectionId: t,
@@ -1229,20 +1229,20 @@ function so(e, t) {
1229
1229
  selectedEntities: []
1230
1230
  };
1231
1231
  }
1232
- function ns(e, t, n = {}) {
1233
- const r = ao(e, n);
1232
+ function cs(e, t, n = {}) {
1233
+ const r = mi(e, n);
1234
1234
  if (!r)
1235
1235
  throw new Error("No connection ID found for card");
1236
- const i = t.cardDataSource || e.dataSource;
1236
+ const o = t.cardDataSource || e.dataSource;
1237
1237
  return {
1238
1238
  connectionId: r,
1239
1239
  requestPayloadBase: {
1240
1240
  ...t,
1241
- cardDataSource: n.liveDataSource ? i : i || so(e, r)
1241
+ cardDataSource: n.liveDataSource ? o : o || gi(e, r)
1242
1242
  }
1243
1243
  };
1244
1244
  }
1245
- const lo = /* @__PURE__ */ new Set([
1245
+ const yi = /* @__PURE__ */ new Set([
1246
1246
  "day",
1247
1247
  "week",
1248
1248
  "month",
@@ -1252,16 +1252,16 @@ const lo = /* @__PURE__ */ new Set([
1252
1252
  "minute",
1253
1253
  "second"
1254
1254
  ]);
1255
- function co(e) {
1255
+ function bi(e) {
1256
1256
  let t = e.spec;
1257
- const n = ut(
1257
+ const n = pt(
1258
1258
  e.controlDefinitions || [],
1259
1259
  e.cardControlDefinitions || []
1260
1260
  ), r = (e.controlBindings || []).filter(
1261
1261
  (p) => p.target !== "sql_param"
1262
- ), i = r.filter(
1263
- (p) => p.target === "config_metric_selector" || p.target === "config_field_selector"
1264
1262
  ), o = r.filter(
1263
+ (p) => p.target === "config_metric_selector" || p.target === "config_field_selector"
1264
+ ), i = r.filter(
1265
1265
  (p) => p.target === "config_grain" || p.target === "config_aggregation"
1266
1266
  ), a = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Map();
1267
1267
  let l;
@@ -1274,8 +1274,8 @@ function co(e) {
1274
1274
  }
1275
1275
  return l = { refs: p, byId: b }, l;
1276
1276
  }, d = (p, b) => {
1277
- throw new zn(p, {
1278
- code: Ln,
1277
+ throw new Gn(p, {
1278
+ code: Hn,
1279
1279
  ...b ? { controlId: b } : {}
1280
1280
  });
1281
1281
  }, u = (p, b) => {
@@ -1283,11 +1283,11 @@ function co(e) {
1283
1283
  if (p.derivedField) return p.derivedField.dataType;
1284
1284
  const I = c().refs.filter((h) => h.field.name === p.name && Ce(h.field.source ?? e.spec.source, p.source ?? e.spec.source));
1285
1285
  return I.length > 1 ? d("The selected field is ambiguous in the authorized Matrix field catalog.", b) : W(((C = I[0]) == null ? void 0 : C.field.dataType) ?? p.dataType);
1286
- }, f = (p, b) => En(p, b.target, (I) => u(I, b.controlId)), m = Vr.safeParse(t);
1286
+ }, f = (p, b) => Nn(p, b.target, (I) => u(I, b.controlId)), m = _r.safeParse(t);
1287
1287
  if (!m.success) return d(m.error.message);
1288
1288
  t = m.data;
1289
- const y = [...i, ...o].map((p) => {
1290
- const b = ft({ binding: p, definitions: n, controlValues: e.controlValues }), I = !p.matrixTargetId && b !== void 0 && b !== he ? f(m.data, p) : [];
1289
+ const y = [...o, ...i].map((p) => {
1290
+ const b = mt({ binding: p, definitions: n, controlValues: e.controlValues }), I = !p.matrixTargetId && b !== void 0 && b !== he ? f(m.data, p) : [];
1291
1291
  return {
1292
1292
  binding: p,
1293
1293
  selectedValue: b,
@@ -1297,14 +1297,14 @@ function co(e) {
1297
1297
  for (const { binding: p, targetId: b, selectedValue: I } of y) {
1298
1298
  if (I === void 0 || I === he)
1299
1299
  continue;
1300
- const C = (v) => d(v, p.controlId), h = p.target === "config_metric_selector" || p.target === "config_aggregation", D = f(t, p);
1301
- (!b || !D.some((v) => v.id === b)) && C("Choose a valid Matrix level or measure target for this control.");
1300
+ const C = (v) => d(v, p.controlId), h = p.target === "config_metric_selector" || p.target === "config_aggregation", S = f(t, p);
1301
+ (!b || !S.some((v) => v.id === b)) && C("Choose a valid Matrix level or measure target for this control.");
1302
1302
  const g = `${p.target}:${b}`;
1303
1303
  a.has(g) && C("Multiple controls cannot replace the same Matrix target."), a.add(g);
1304
1304
  const V = (v) => {
1305
- const S = (c().byId.get(v.id) ?? []).filter((k) => !v.source || Ce(v.source, k.field.source ?? e.spec.source));
1306
- if (S.length !== 1) return C(S.length ? "The selected field is ambiguous in the authorized Matrix field catalog." : "The selected field is not in the authorized Matrix field catalog.");
1307
- const M = kr.safeParse(S[0].field);
1305
+ const T = (c().byId.get(v.id) ?? []).filter((k) => !v.source || Ce(v.source, k.field.source ?? e.spec.source));
1306
+ if (T.length !== 1) return C(T.length ? "The selected field is ambiguous in the authorized Matrix field catalog." : "The selected field is not in the authorized Matrix field catalog.");
1307
+ const M = Br.safeParse(T[0].field);
1308
1308
  return M.success ? M.data : C(M.error.message);
1309
1309
  }, P = p.target === "config_metric_selector" || p.target === "config_field_selector" ? p.mapping[I] : void 0, x = P && typeof P == "object" && "kind" in P && P.kind === "matrix_instance" ? P.id : void 0;
1310
1310
  if (h) {
@@ -1313,13 +1313,13 @@ function co(e) {
1313
1313
  (F) => F.id === x && F.kind === "aggregate"
1314
1314
  );
1315
1315
  x !== void 0 && !v && C("The selected Matrix aggregate measure is no longer available.");
1316
- const S = p.target === "config_metric_selector" && !v ? Rn({ binding: p, selectedValue: I }) : void 0, M = ((v == null ? void 0 : v.kind) === "aggregate" ? v.aggregate : S == null ? void 0 : S.aggregate) ?? (p.target === "config_aggregation" ? Le({ binding: p, selectedValue: I }) : void 0), k = M === void 0 ? void 0 : Mr.safeParse(M);
1316
+ const T = p.target === "config_metric_selector" && !v ? jn({ binding: p, selectedValue: I }) : void 0, M = ((v == null ? void 0 : v.kind) === "aggregate" ? v.aggregate : T == null ? void 0 : T.aggregate) ?? (p.target === "config_aggregation" ? Ge({ binding: p, selectedValue: I }) : void 0), k = M === void 0 ? void 0 : Ar.safeParse(M);
1317
1317
  k && !k.success && C("This aggregation is not supported by Matrix."), t = {
1318
1318
  ...t,
1319
1319
  measures: t.measures.map(
1320
1320
  (F) => F.id !== b || F.kind !== "aggregate" ? F : {
1321
1321
  ...F,
1322
- ...S ? { field: V(S) } : {},
1322
+ ...T ? { field: V(T) } : {},
1323
1323
  ...(v == null ? void 0 : v.kind) === "aggregate" ? { field: v.field } : {},
1324
1324
  aggregate: k != null && k.success ? k.data : F.aggregate
1325
1325
  }
@@ -1330,12 +1330,12 @@ function co(e) {
1330
1330
  (F) => F.id === x
1331
1331
  );
1332
1332
  x !== void 0 && !v && C("The selected Matrix level is no longer available.");
1333
- const S = p.target === "config_field_selector" && !v ? qn({ binding: p, selectedValue: I }) : void 0, M = p.target === "config_grain" ? Le({ binding: p, selectedValue: I }) : v ? v.grain : S == null ? void 0 : S.granularity;
1334
- M !== void 0 && !lo.has(M) && C("This time grain is not supported by Matrix.");
1335
- const k = (F) => F.map((T) => {
1336
- if (T.id !== b) return T;
1337
- const w = (v == null ? void 0 : v.field) ?? (S ? V(S) : T.field), E = u(w, p.controlId), R = M ?? (S && ne(E) ? T.grain : void 0);
1338
- return R && !ne(E) && C("A time grain requires a temporal Matrix level."), { ...T, field: w, grain: R };
1333
+ const T = p.target === "config_field_selector" && !v ? zn({ binding: p, selectedValue: I }) : void 0, M = p.target === "config_grain" ? Ge({ binding: p, selectedValue: I }) : v ? v.grain : T == null ? void 0 : T.granularity;
1334
+ M !== void 0 && !yi.has(M) && C("This time grain is not supported by Matrix.");
1335
+ const k = (F) => F.map((D) => {
1336
+ if (D.id !== b) return D;
1337
+ const w = (v == null ? void 0 : v.field) ?? (T ? V(T) : D.field), E = u(w, p.controlId), R = M ?? (T && ne(E) ? D.grain : void 0);
1338
+ return R && !ne(E) && C("A time grain requires a temporal Matrix level."), { ...D, field: w, grain: R };
1339
1339
  });
1340
1340
  t = {
1341
1341
  ...t,
@@ -1348,50 +1348,53 @@ function co(e) {
1348
1348
  const I = t.measures.find((h) => h.id === p);
1349
1349
  if (!I || I.kind !== "aggregate") continue;
1350
1350
  const C = u(I.field, b);
1351
- Nn(C).some((h) => h.value === I.aggregate) || d(`Aggregation '${I.aggregate}' is not eligible for this Matrix field datatype.`, b);
1351
+ Ln(C).some((h) => h.value === I.aggregate) || d(`Aggregation '${I.aggregate}' is not eligible for this Matrix field datatype.`, b);
1352
1352
  }
1353
1353
  try {
1354
- return jn(m.data, t);
1354
+ return Kn(m.data, t);
1355
1355
  } catch (p) {
1356
- if (p instanceof Ar) return d(p.message);
1356
+ if (p instanceof zr) return d(p.message);
1357
1357
  throw p;
1358
1358
  }
1359
1359
  }
1360
- function Ht(e, t) {
1361
- const n = [], r = (i) => {
1362
- if (i.source) {
1363
- const o = xr.safeParse(i.source);
1364
- if (o.success) n.push(o.data);
1365
- else if (t) throw o.error;
1360
+ function Qt(e, t) {
1361
+ const n = [], r = (o) => {
1362
+ if (o.source) {
1363
+ const i = Er.safeParse(o.source);
1364
+ if (i.success) n.push(i.data);
1365
+ else if (t) throw i.error;
1366
1366
  }
1367
- i.derivedField && Object.values(i.derivedField.inputs).forEach((o) => r(o.field));
1367
+ o.derivedField && Object.values(o.derivedField.inputs).forEach((i) => r(i.field));
1368
1368
  };
1369
- for (const i of e) {
1370
- if (i.target !== "config_field_selector" && i.target !== "config_metric_selector") continue;
1371
- const o = t == null ? void 0 : t.get(i), a = t ? o && o !== he ? [i.mapping[o]] : [] : Object.values(i.mapping);
1369
+ for (const o of e) {
1370
+ if (o.target !== "config_field_selector" && o.target !== "config_metric_selector") continue;
1371
+ const i = t == null ? void 0 : t.get(o), a = t ? i && i !== he ? [o.mapping[i]] : [] : Object.values(o.mapping);
1372
1372
  for (const s of a)
1373
1373
  s && "role" in s && r(s);
1374
1374
  }
1375
1375
  return n;
1376
1376
  }
1377
- function uo(e, t = [], n = []) {
1378
- return vt([...pt(e), ...Ht(t), ...n]);
1377
+ function Ii(e, t = [], n = []) {
1378
+ return Dt([...gt(e), ...Qt(t), ...n]);
1379
1379
  }
1380
- function fo(e, t = {}) {
1381
- const n = t.controlBindings ?? [], r = ut(t.controlDefinitions ?? [], t.cardControlDefinitions ?? []), i = new Map(n.filter((o) => o.target === "config_field_selector" || o.target === "config_metric_selector").map((o) => [o, ft({ binding: o, definitions: r, controlValues: t.controlValues })]));
1382
- return vt([...pt(e), ...Ht(n, i)]);
1380
+ function Ci(e, t = {}) {
1381
+ const n = t.controlBindings ?? [], r = pt(t.controlDefinitions ?? [], t.cardControlDefinitions ?? []), o = new Map(n.filter((i) => i.target === "config_field_selector" || i.target === "config_metric_selector").map((i) => [i, mt({ binding: i, definitions: r, controlValues: t.controlValues })]));
1382
+ return Dt([...gt(e), ...Qt(n, o)]);
1383
1383
  }
1384
- function po(e, t) {
1385
- return Te(e) ? mo(e, t) : e.config ?? {};
1384
+ function $t(e, t) {
1385
+ return Te(e) ? vi(e, t) : e.config ?? {};
1386
1386
  }
1387
- function mo(e, t) {
1387
+ function hi(e, t) {
1388
+ return t != null && t.steps.length ? { ...e, config: $t(e, t) } : e;
1389
+ }
1390
+ function vi(e, t) {
1388
1391
  var r;
1389
1392
  const n = (r = t == null ? void 0 : t.steps[t.steps.length - 1]) == null ? void 0 : r.toField;
1390
- return n ? Di(e.config ?? {}, n, {
1393
+ return n ? wo(e.config ?? {}, n, {
1391
1394
  sortPolicy: "retargetDimensionSort"
1392
1395
  }) : e.config ?? {};
1393
1396
  }
1394
- function go(e, t) {
1397
+ function Fi(e, t) {
1395
1398
  const n = (e == null ? void 0 : e.steps) ?? [];
1396
1399
  if (n.length !== 0)
1397
1400
  return {
@@ -1399,20 +1402,20 @@ function go(e, t) {
1399
1402
  logicalOperator: "AND",
1400
1403
  negate: !1,
1401
1404
  conditions: [],
1402
- groups: n.map((r, i) => ({
1403
- id: `breadcrumb-${i}`,
1405
+ groups: n.map((r, o) => ({
1406
+ id: `breadcrumb-${o}`,
1404
1407
  logicalOperator: "OR",
1405
1408
  negate: !1,
1406
1409
  conditions: [],
1407
1410
  groups: [
1408
1411
  {
1409
- id: `breadcrumb-${i}-group-0`,
1412
+ id: `breadcrumb-${o}-group-0`,
1410
1413
  logicalOperator: "AND",
1411
1414
  negate: !1,
1412
1415
  conditions: r.conditions.map(
1413
- (o) => Jr(
1414
- o,
1415
- `${o.field.id}-${o.value}`
1416
+ (i) => oo(
1417
+ i,
1418
+ `${i.field.id}-${i.value}`
1416
1419
  )
1417
1420
  ),
1418
1421
  groups: []
@@ -1425,16 +1428,16 @@ const ye = (e) => typeof e == "object" && e !== null && !Array.isArray(e);
1425
1428
  function H(e) {
1426
1429
  return e instanceof Date ? JSON.stringify(Number.isNaN(e.getTime()) ? null : e.toISOString()) : Array.isArray(e) ? `[${e.map(H).join(",")}]` : ye(e) ? `{${Object.keys(e).sort().filter((t) => e[t] !== void 0).map((t) => `${JSON.stringify(t)}:${H(e[t])}`).join(",")}}` : JSON.stringify(e) ?? "null";
1427
1430
  }
1428
- function yo(e) {
1431
+ function Di(e) {
1429
1432
  const t = e;
1430
1433
  return t.valueType === "date" || t.relativeMeta !== void 0 || t.temporalBucket !== void 0 || ne(t.dataType);
1431
1434
  }
1432
- function bo(e) {
1435
+ function Si(e) {
1433
1436
  const t = ye(e.field) ? e.field : void 0;
1434
1437
  return e.temporalBucket !== void 0 || e.rawTemporal !== void 0 || e.relativeMeta !== void 0 || ne(t == null ? void 0 : t.dataType);
1435
1438
  }
1436
- function Ut(e) {
1437
- return e ? [...(e.conditions ?? []).filter(bo).map((n) => {
1439
+ function Wt(e) {
1440
+ return e ? [...(e.conditions ?? []).filter(Si).map((n) => {
1438
1441
  const r = ye(n.field) ? n.field : {};
1439
1442
  return {
1440
1443
  field: r.qualifiedFieldName ?? r.name,
@@ -1444,49 +1447,49 @@ function Ut(e) {
1444
1447
  rawTemporal: n.rawTemporal,
1445
1448
  relativeMeta: n.relativeMeta
1446
1449
  };
1447
- }), ...(e.groups ?? []).flatMap((n) => Ut(n))] : [];
1450
+ }), ...(e.groups ?? []).flatMap((n) => Wt(n))] : [];
1448
1451
  }
1449
- function tt(e) {
1450
- const t = e.filterValues.filter(yo).map((r) => {
1451
- const i = r, o = ye(i.fieldMeta) ? i.fieldMeta : void 0;
1452
+ function rt(e) {
1453
+ const t = e.filterValues.filter(Di).map((r) => {
1454
+ const o = r, i = ye(o.fieldMeta) ? o.fieldMeta : void 0;
1452
1455
  return {
1453
- field: (o == null ? void 0 : o.qualifiedFieldName) ?? i.name,
1454
- operation: i.operation,
1455
- ...i.relativeMeta !== void 0 ? { relativeMeta: i.relativeMeta } : { values: i.values },
1456
- temporalBucket: i.temporalBucket
1456
+ field: (i == null ? void 0 : i.qualifiedFieldName) ?? o.name,
1457
+ operation: o.operation,
1458
+ ...o.relativeMeta !== void 0 ? { relativeMeta: o.relativeMeta } : { values: o.values },
1459
+ temporalBucket: o.temporalBucket
1457
1460
  };
1458
- }), n = Ut(e.selectionFilters);
1461
+ }), n = Wt(e.selectionFilters);
1459
1462
  return H({
1460
1463
  values: t.map(H).sort(),
1461
1464
  conditions: n.map(H).sort(),
1462
1465
  ...e.zoom ? { zoom: [e.zoom.from, e.zoom.to] } : {}
1463
1466
  });
1464
1467
  }
1465
- function Io(e, t, n) {
1468
+ function Ti(e, t, n) {
1466
1469
  if (!t || n.drillActive || t.madeUnder !== n.currentFingerprint) return e;
1467
1470
  const r = e.groupByColumns ?? [];
1468
- return r.some((i) => i.id === t.fieldId && i.grainMode === "automatic") ? {
1471
+ return r.some((o) => o.id === t.fieldId && o.grainMode === "automatic") ? {
1469
1472
  ...e,
1470
- groupByColumns: r.map((i) => {
1471
- if (i.id !== t.fieldId || i.grainMode !== "automatic") return i;
1472
- const { grainMode: o, ...a } = i;
1473
+ groupByColumns: r.map((o) => {
1474
+ if (o.id !== t.fieldId || o.grainMode !== "automatic") return o;
1475
+ const { grainMode: i, ...a } = o;
1473
1476
  return { ...a, granularity: t.granularity };
1474
1477
  })
1475
1478
  } : e;
1476
1479
  }
1477
- function rs(e) {
1480
+ function ds(e) {
1478
1481
  var t;
1479
1482
  return (((t = e.config) == null ? void 0 : t.groupByColumns) ?? []).find(
1480
- (n) => n.grainMode === "automatic" && Kn({ cardType: e.type, configBacked: !0, shelf: "groupBy", dataType: n.dataType }).ok
1483
+ (n) => n.grainMode === "automatic" && Un({ cardType: e.type, configBacked: !0, shelf: "groupBy", dataType: n.dataType }).ok
1481
1484
  );
1482
1485
  }
1483
- function Co(e, t) {
1484
- if (!e || !t || t.id !== e.fieldId || Pr(t)) return;
1486
+ function Vi(e, t) {
1487
+ if (!e || !t || t.id !== e.fieldId || Rr(t)) return;
1485
1488
  const {
1486
1489
  granularity: n,
1487
1490
  grainMode: r,
1488
- dateFormat: i,
1489
- timeDrillPath: o,
1491
+ dateFormat: o,
1492
+ timeDrillPath: i,
1490
1493
  ...a
1491
1494
  } = t;
1492
1495
  return {
@@ -1505,36 +1508,36 @@ function Co(e, t) {
1505
1508
  groups: []
1506
1509
  };
1507
1510
  }
1508
- function is(e, t, n) {
1509
- const r = Ge(e, n), i = Ge(t, n);
1510
- if (!r || !i) return;
1511
- const [o, a] = r.first <= i.first ? [r, i] : [i, r];
1512
- return { from: o.first, to: a.last };
1511
+ function us(e, t, n) {
1512
+ const r = Ue(e, n), o = Ue(t, n);
1513
+ if (!r || !o) return;
1514
+ const [i, a] = r.first <= o.first ? [r, o] : [o, r];
1515
+ return { from: i.first, to: a.last };
1513
1516
  }
1514
- function ho(e, t, n) {
1517
+ function Mi(e, t, n) {
1515
1518
  if (!e || e.madeUnder !== n) return;
1516
- const r = t == null ? void 0 : t.find((o) => o.id === e.fieldId && o.grainMode === "automatic"), i = Co(e, r);
1517
- return i ? { zoom: e, filterGroup: i } : void 0;
1519
+ const r = t == null ? void 0 : t.find((i) => i.id === e.fieldId && i.grainMode === "automatic"), o = Vi(e, r);
1520
+ return o ? { zoom: e, filterGroup: o } : void 0;
1518
1521
  }
1519
- function os(e, t, n) {
1522
+ function fs(e, t, n) {
1520
1523
  if (!e) return;
1521
- const [r, i] = t <= n ? [t, n] : [n, t];
1522
- if (r < 0 || i >= e.length) return;
1523
- const o = e.slice(r, i + 1);
1524
- if (!o.every((d) => typeof d == "string" && d !== "")) return;
1525
- const a = [...o].sort(), s = a[0], l = a[a.length - 1];
1524
+ const [r, o] = t <= n ? [t, n] : [n, t];
1525
+ if (r < 0 || o >= e.length) return;
1526
+ const i = e.slice(r, o + 1);
1527
+ if (!i.every((d) => typeof d == "string" && d !== "")) return;
1528
+ const a = [...i].sort(), s = a[0], l = a[a.length - 1];
1526
1529
  return e.some(
1527
- (d, u) => (u < r || u > i) && typeof d == "string" && d > s && d < l
1530
+ (d, u) => (u < r || u > o) && typeof d == "string" && d > s && d < l
1528
1531
  ) ? void 0 : { first: s, last: l };
1529
1532
  }
1530
- function as(e, t, n) {
1533
+ function ps(e, t, n) {
1531
1534
  if (!t || !n) return { from: e.from, to: e.to };
1532
- const r = Qe(new Date(t.startInclusive), n), i = Qe(new Date(Date.parse(t.endExclusive) - 1), n), o = e.from < r ? r : e.from, a = e.to > i ? i : e.to;
1533
- return o <= a ? { from: o, to: a } : { from: e.from, to: e.to };
1535
+ const r = We(new Date(t.startInclusive), n), o = We(new Date(Date.parse(t.endExclusive) - 1), n), i = e.from < r ? r : e.from, a = e.to > o ? o : e.to;
1536
+ return i <= a ? { from: i, to: a } : { from: e.from, to: e.to };
1534
1537
  }
1535
- function ss(e, t, n) {
1536
- const r = (o) => /* @__PURE__ */ new Date(`${o}T00:00:00.000Z`), i = new Intl.DateTimeFormat(t, { dateStyle: n, timeZone: "UTC" });
1537
- return e.from === e.to ? i.format(r(e.from)) : i.formatRange(r(e.from), r(e.to));
1538
+ function ms(e, t, n) {
1539
+ const r = (i) => /* @__PURE__ */ new Date(`${i}T00:00:00.000Z`), o = new Intl.DateTimeFormat(t, { dateStyle: n, timeZone: "UTC" });
1540
+ return e.from === e.to ? o.format(r(e.from)) : o.formatRange(r(e.from), r(e.to));
1538
1541
  }
1539
1542
  function Ee(e) {
1540
1543
  return e === "in" || e === "not in";
@@ -1542,71 +1545,71 @@ function Ee(e) {
1542
1545
  function Re(e) {
1543
1546
  return e === "not in" ? "exclude" : "include";
1544
1547
  }
1545
- function vo(e) {
1548
+ function ki(e) {
1546
1549
  return e === "exclude" ? "not in" : "in";
1547
1550
  }
1548
- function ls(e) {
1551
+ function gs(e) {
1549
1552
  var n;
1550
1553
  const t = (n = e.liveValue) == null ? void 0 : n.operation;
1551
1554
  return Ee(t) ? Re(t) : e.pendingMode ?? e.authoredMode;
1552
1555
  }
1553
- function Fo(e) {
1556
+ function xi(e) {
1554
1557
  var r;
1555
1558
  let t = !1;
1556
- const n = (r = e.inputs) == null ? void 0 : r.map((i) => {
1557
- if (i.kind !== "filter" || !i.filter) return i;
1558
- const o = Do(
1559
- i.filter,
1560
- new Set(So(e.defaultInputValues, i))
1559
+ const n = (r = e.inputs) == null ? void 0 : r.map((o) => {
1560
+ if (o.kind !== "filter" || !o.filter) return o;
1561
+ const i = Pi(
1562
+ o.filter,
1563
+ new Set(wi(e.defaultInputValues, o))
1561
1564
  );
1562
- return o === i.filter ? i : (t = !0, { ...i, filter: o });
1565
+ return i === o.filter ? o : (t = !0, { ...o, filter: i });
1563
1566
  });
1564
1567
  return t ? { ...e, inputs: n } : e;
1565
1568
  }
1566
- function Do(e, t) {
1569
+ function Pi(e, t) {
1567
1570
  if (t.size !== 1 || !Ee(e.operation))
1568
1571
  return e;
1569
1572
  const [n] = t;
1570
- return Re(e.operation) === n ? e : { ...e, operation: vo(n) };
1573
+ return Re(e.operation) === n ? e : { ...e, operation: ki(n) };
1571
1574
  }
1572
- function So(e, t) {
1573
- var i;
1574
- const n = (o) => Object.values(o ?? {}).map((a) => a[t.id]);
1575
- return (t.runtimeScope === "shared" ? [(i = e == null ? void 0 : e.shared) == null ? void 0 : i[t.id]] : t.runtimeScope === "perSheet" ? n(e == null ? void 0 : e.bySheetId) : t.runtimeScope === "perCard" ? n(e == null ? void 0 : e.byCardId) : t.runtimeScope === "perDocumentSection" ? n(e == null ? void 0 : e.byDocumentSectionId) : []).flatMap(
1576
- (o) => (o == null ? void 0 : o.status) === "set" && o.value.kind === "filter" ? To(o.value.filterValue) : []
1575
+ function wi(e, t) {
1576
+ var o;
1577
+ const n = (i) => Object.values(i ?? {}).map((a) => a[t.id]);
1578
+ return (t.runtimeScope === "shared" ? [(o = e == null ? void 0 : e.shared) == null ? void 0 : o[t.id]] : t.runtimeScope === "perSheet" ? n(e == null ? void 0 : e.bySheetId) : t.runtimeScope === "perCard" ? n(e == null ? void 0 : e.byCardId) : t.runtimeScope === "perDocumentSection" ? n(e == null ? void 0 : e.byDocumentSectionId) : []).flatMap(
1579
+ (i) => (i == null ? void 0 : i.status) === "set" && i.value.kind === "filter" ? Oi(i.value.filterValue) : []
1577
1580
  );
1578
1581
  }
1579
- function To(e) {
1582
+ function Oi(e) {
1580
1583
  return Ee(e.operation) ? [Re(e.operation)] : [];
1581
1584
  }
1582
- function cs(e) {
1583
- const t = St(e), r = A(t).issues.length ? t : Ta(t);
1584
- return vi(
1585
- Gn(Fo(r))
1585
+ function ys(e) {
1586
+ const t = Vt(e), r = A(t).issues.length ? t : Oa(t);
1587
+ return xo(
1588
+ Qn(xi(r))
1586
1589
  ).dashboard;
1587
1590
  }
1588
1591
  function qe(e, t) {
1589
1592
  const n = {};
1590
- for (const r of Vt(e)) {
1593
+ for (const r of kt(e)) {
1591
1594
  if (!r.inlineFilters || r.inlineFilters.length === 0)
1592
1595
  continue;
1593
- const i = [];
1594
- for (const o of r.inlineFilters) {
1595
- const a = Hn(o, t);
1596
- a && i.push(a);
1596
+ const o = [];
1597
+ for (const i of r.inlineFilters) {
1598
+ const a = $n(i, t);
1599
+ a && o.push(a);
1597
1600
  }
1598
- i.length > 0 && (n[r.id] = i);
1601
+ o.length > 0 && (n[r.id] = o);
1599
1602
  }
1600
1603
  return n;
1601
1604
  }
1602
1605
  function $(e) {
1603
1606
  const t = fe(e ?? {}), n = [];
1604
- for (const [r, i] of Object.entries(t.shared ?? {}))
1605
- n.push({ scope: "shared", target: null, inputId: r, slot: i });
1607
+ for (const [r, o] of Object.entries(t.shared ?? {}))
1608
+ n.push({ scope: "shared", target: null, inputId: r, slot: o });
1606
1609
  for (const r of ["bySheetId", "byCardId"])
1607
- for (const [i, o] of Object.entries(t[r] ?? {}))
1608
- for (const [a, s] of Object.entries(o))
1609
- n.push({ scope: r, target: i, inputId: a, slot: s });
1610
+ for (const [o, i] of Object.entries(t[r] ?? {}))
1611
+ for (const [a, s] of Object.entries(i))
1612
+ n.push({ scope: r, target: o, inputId: a, slot: s });
1610
1613
  return n;
1611
1614
  }
1612
1615
  function le(e, t, n) {
@@ -1615,11 +1618,11 @@ function le(e, t, n) {
1615
1618
  r.shared = { ...r.shared, [t.inputId]: n };
1616
1619
  return;
1617
1620
  }
1618
- const i = { ...r[t.scope] ?? {} };
1619
- i[t.target] = { ...i[t.target], [t.inputId]: n }, r[t.scope] = i;
1621
+ const o = { ...r[t.scope] ?? {} };
1622
+ o[t.target] = { ...o[t.target], [t.inputId]: n }, r[t.scope] = o;
1620
1623
  }
1621
- function Qt(e, t, n) {
1622
- const r = mt(
1624
+ function Zt(e, t, n) {
1625
+ const r = yt(
1623
1626
  e,
1624
1627
  t.controlOverrides,
1625
1628
  { hasExplicitRuntimeOverrides: t.controlOverrides !== void 0 }
@@ -1633,30 +1636,30 @@ function Qt(e, t, n) {
1633
1636
  };
1634
1637
  }
1635
1638
  function Ne(e, t, n) {
1636
- return $t(
1639
+ return Jt(
1637
1640
  e,
1638
- Qt(e, t, n),
1641
+ Zt(e, t, n),
1639
1642
  n
1640
1643
  );
1641
1644
  }
1642
- function ds(e, t, n) {
1643
- return $t(e, t, n);
1645
+ function bs(e, t, n) {
1646
+ return Jt(e, t, n);
1644
1647
  }
1645
- function $t(e, t, n) {
1646
- const r = e.sheets ?? [], i = r.filter((s) => (s.kind ?? "dashboard") === "dashboard").map((s) => s.id), o = r.filter((s) => s.kind === "document"), a = i.length ? Qn({
1648
+ function Jt(e, t, n) {
1649
+ const r = e.sheets ?? [], o = r.filter((s) => (s.kind ?? "dashboard") === "dashboard").map((s) => s.id), i = r.filter((s) => s.kind === "document"), a = o.length ? Jn({
1647
1650
  dashboard: e,
1648
- sheetIds: i,
1651
+ sheetIds: o,
1649
1652
  mode: "dashboard",
1650
1653
  runtimeValues: t,
1651
1654
  transientContexts: void 0,
1652
1655
  calendar: n ?? null
1653
1656
  }).snapshot.dashboardInputValues : {};
1654
- return o.reduce(
1657
+ return i.reduce(
1655
1658
  (s, l) => {
1656
1659
  var c;
1657
1660
  return xe(
1658
1661
  s,
1659
- $n({
1662
+ Yn({
1660
1663
  dashboard: e,
1661
1664
  sheetId: l.id,
1662
1665
  sheetKind: "document",
@@ -1673,72 +1676,73 @@ function $t(e, t, n) {
1673
1676
  a
1674
1677
  );
1675
1678
  }
1676
- function Wt(e, t) {
1677
- const n = {}, r = {}, i = /* @__PURE__ */ new Map();
1678
- for (const o of $(t)) {
1679
- const a = e.get(o.inputId), { slot: s } = o, l = () => s.status === "set" && s.value.kind === "filter" ? s.value.filterValue : s.status === "cleared" ? null : void 0;
1679
+ function Yt(e, t) {
1680
+ const n = {}, r = {}, o = /* @__PURE__ */ new Map();
1681
+ for (const i of $(t)) {
1682
+ const a = e.get(i.inputId), { slot: s } = i, l = () => s.status === "set" && s.value.kind === "filter" ? s.value.filterValue : s.status === "cleared" ? null : void 0;
1680
1683
  if ((a == null ? void 0 : a.source) === "cardInlineFilter") {
1681
1684
  const c = l();
1682
1685
  if (c !== void 0) {
1683
- const d = i.get(a.cardId) ?? /* @__PURE__ */ new Map();
1684
- d.set(a.filterId, c), i.set(a.cardId, d);
1686
+ const d = o.get(a.cardId) ?? /* @__PURE__ */ new Map();
1687
+ d.set(a.filterId, c), o.set(a.cardId, d);
1685
1688
  }
1686
1689
  } else if ((a == null ? void 0 : a.source) === "dashboardControl" || (a == null ? void 0 : a.source) === "cardControl")
1687
1690
  s.status === "set" && s.value.kind === "control" ? r[a.controlId] = s.value.value : s.status === "cleared" && (r[a.controlId] = void 0);
1688
1691
  else {
1689
- le(n, o, s);
1692
+ le(n, i, s);
1690
1693
  continue;
1691
1694
  }
1692
- s.comparisonSelection && le(n, o, {
1695
+ s.comparisonSelection && le(n, i, {
1693
1696
  comparisonSelection: s.comparisonSelection
1694
1697
  });
1695
1698
  }
1696
1699
  return {
1697
1700
  runtime: fe(n),
1698
1701
  controlValues: r,
1699
- inlineFilterValues: i
1702
+ inlineFilterValues: o
1700
1703
  };
1701
1704
  }
1702
- function Vo(e, t) {
1705
+ function _i(e, t) {
1703
1706
  if (!t.size) return [...e];
1704
- const n = e.filter((i) => !t.has(i.filterId)), r = [...t.values()].filter(
1705
- (i) => i !== null
1707
+ const n = e.filter((o) => !t.has(o.filterId)), r = [...t.values()].filter(
1708
+ (o) => o !== null
1706
1709
  );
1707
- return Wn(n, r);
1710
+ return Xn(n, r);
1708
1711
  }
1709
- function Zt(e, t, n) {
1712
+ function Xt(e, t, n) {
1710
1713
  if (!Object.keys(n).length) return t;
1711
- const r = mt(
1714
+ const r = yt(
1712
1715
  e,
1713
1716
  t,
1714
1717
  { hasExplicitRuntimeOverrides: t !== void 0 }
1715
1718
  );
1716
1719
  return {
1717
- ...Un({
1720
+ ...Wn({
1718
1721
  dashboardValues: r.dashboardControlValues,
1719
1722
  cardValuesMap: r.cardControlValuesMap
1720
1723
  }),
1721
1724
  ...n
1722
1725
  };
1723
1726
  }
1724
- function Mo(e, t) {
1727
+ function Ai(e, t) {
1725
1728
  if (!t.size) return;
1726
1729
  const n = Object.fromEntries(
1727
- Object.entries(e).map(([r, i]) => [r, [...i]])
1730
+ Object.entries(e).map(([r, o]) => [r, [...o]])
1728
1731
  );
1729
- for (const [r, i] of t)
1730
- n[r] = Vo(n[r] ?? [], i);
1732
+ for (const [r, o] of t)
1733
+ n[r] = _i(n[r] ?? [], o);
1731
1734
  return n;
1732
1735
  }
1733
- function ko(e, t, n) {
1736
+ function Bi(e, t, n) {
1734
1737
  const r = new Map(
1735
1738
  j(e).map(({ card: a }) => [
1736
1739
  a.id,
1737
- new Map((a.inlineFilters ?? []).map((s) => [s.id, s]))
1740
+ // Column filters too (TCF-D4): a viewer's column filter survives a refetch.
1741
+ new Map(Zn(a).map((s) => [s.id, s]))
1738
1742
  ])
1739
1743
  );
1740
- let i = !1;
1741
- const o = Object.fromEntries(
1744
+ let o = !1;
1745
+ const i = Object.fromEntries(
1742
1746
  Object.entries(t).map(([a, s]) => [a, [...s]])
1743
1747
  );
1744
1748
  for (const [a, s] of Object.entries(n)) {
@@ -1746,52 +1750,52 @@ function ko(e, t, n) {
1746
1750
  const u = l == null ? void 0 : l.get(d.filterId);
1747
1751
  return u ? ke(u, d) : !1;
1748
1752
  });
1749
- pe(c, o[a] ?? []) || (i = !0), o[a] = c;
1753
+ pe(c, i[a] ?? []) || (o = !0), i[a] = c;
1750
1754
  }
1751
- return i ? o : void 0;
1755
+ return o ? i : void 0;
1752
1756
  }
1753
- function us(e) {
1754
- const { dashboard: t, capture: n, calendar: r } = e, i = Cn(t, n.filterValues, {
1757
+ function Is(e) {
1758
+ const { dashboard: t, capture: n, calendar: r } = e, o = Fn(t, n.filterValues, {
1755
1759
  calendar: r
1756
- }), o = n.dashboardInputExecutionSnapshot, a = n.controlValues, s = {
1757
- ...Qt(
1760
+ }), i = n.dashboardInputExecutionSnapshot, a = n.controlValues, s = {
1761
+ ...Zt(
1758
1762
  t,
1759
1763
  {
1760
- adHocFilterValues: i.adHocFilterValues,
1764
+ adHocFilterValues: o.adHocFilterValues,
1761
1765
  controlOverrides: a,
1762
1766
  // The snapshot replays exactly over the listed values.
1763
- dashboardInputValues: o ? xe(
1764
- i.slots,
1765
- Jn({
1767
+ dashboardInputValues: i ? xe(
1768
+ o.slots,
1769
+ tr({
1766
1770
  dashboard: t,
1767
- dashboardInputValues: o.dashboardInputValues,
1768
- sheetId: o.sheetId,
1769
- cardId: o.cardId
1771
+ dashboardInputValues: i.dashboardInputValues,
1772
+ sheetId: i.sheetId,
1773
+ cardId: i.cardId
1770
1774
  })
1771
- ) : i.slots
1775
+ ) : o.slots
1772
1776
  },
1773
1777
  r
1774
1778
  ),
1775
- cardViewState: o ? Zn(o.cardViewState) : {}
1776
- }, l = o ? Yn(o.transientContexts) : void 0;
1779
+ cardViewState: i ? er(i.cardViewState) : {}
1780
+ }, l = i ? nr(i.transientContexts) : void 0;
1777
1781
  return {
1778
1782
  runtimeValues: s,
1779
1783
  controlOverrides: a,
1780
1784
  ...l != null && l.length ? { transientContexts: l } : {}
1781
1785
  };
1782
1786
  }
1783
- function fs(e, t) {
1787
+ function Cs(e, t) {
1784
1788
  const { controlContractOverrides: n, cardId: r } = t;
1785
1789
  if (!n || (n.controlDefinitions !== void 0 && (e.controls = n.controlDefinitions), typeof r != "string" || r.trim().length === 0))
1786
1790
  return e;
1787
- const i = Z(e, r);
1788
- return i && (n.cardControlDefinitions !== void 0 && (i.controls = n.cardControlDefinitions), n.controlBindings !== void 0 && (i.controlBindings = n.controlBindings)), e;
1791
+ const o = Z(e, r);
1792
+ return o && (n.cardControlDefinitions !== void 0 && (o.controls = n.cardControlDefinitions), n.controlBindings !== void 0 && (o.controlBindings = n.controlBindings)), e;
1789
1793
  }
1790
- const xo = ["bySheetId", "byCardId", "byDocumentSectionId"];
1791
- function Po(e, t) {
1794
+ const Ei = ["bySheetId", "byCardId", "byDocumentSectionId"];
1795
+ function Ri(e, t) {
1792
1796
  const n = A(e);
1793
1797
  let r = !1;
1794
- const i = (a) => {
1798
+ const o = (a) => {
1795
1799
  if (!a) return a;
1796
1800
  const s = Object.entries(a).filter(([l, c]) => {
1797
1801
  var u;
@@ -1800,19 +1804,19 @@ function Po(e, t) {
1800
1804
  return !d || ke(d, c.value.filterValue) ? !0 : (r = !0, !1);
1801
1805
  });
1802
1806
  return Object.fromEntries(s);
1803
- }, o = {
1807
+ }, i = {
1804
1808
  ...t,
1805
- ...t.shared ? { shared: i(t.shared) } : {}
1809
+ ...t.shared ? { shared: o(t.shared) } : {}
1806
1810
  };
1807
- for (const a of xo) {
1811
+ for (const a of Ei) {
1808
1812
  const s = t[a];
1809
- s && (o[a] = Object.fromEntries(
1810
- Object.entries(s).map(([l, c]) => [l, i(c) ?? {}])
1813
+ s && (i[a] = Object.fromEntries(
1814
+ Object.entries(s).map(([l, c]) => [l, o(c) ?? {}])
1811
1815
  ));
1812
1816
  }
1813
- return r ? o : t;
1817
+ return r ? i : t;
1814
1818
  }
1815
- function wo(e) {
1819
+ function qi(e) {
1816
1820
  var t, n;
1817
1821
  return ((n = (t = e.sheets) == null ? void 0 : t[0]) == null ? void 0 : n.id) ?? null;
1818
1822
  }
@@ -1820,47 +1824,47 @@ function J(e, t) {
1820
1824
  var n;
1821
1825
  return !!t && !!((n = e.sheets) != null && n.some((r) => r.id === t));
1822
1826
  }
1823
- function ps(e) {
1824
- const { dashboard: t, host: n, calendar: r } = e, i = Cn(t, n.filterValues, {
1827
+ function hs(e) {
1828
+ const { dashboard: t, host: n, calendar: r } = e, o = Fn(t, n.filterValues, {
1825
1829
  calendar: r
1826
- }).slots, o = n.controlValues, a = J(t, n.selectedSheetId) ? n.selectedSheetId : wo(t);
1830
+ }).slots, i = n.controlValues, a = J(t, n.selectedSheetId) ? n.selectedSheetId : qi(t);
1827
1831
  return {
1828
- hostInputValues: i,
1829
- controlOverrides: o,
1832
+ hostInputValues: o,
1833
+ controlOverrides: i,
1830
1834
  selectedSheetId: a,
1831
1835
  hostSelectedSheetId: n.selectedSheetId ?? null,
1832
1836
  materializedInputs: e.materializeInputs === !1 ? {} : Ne(
1833
1837
  t,
1834
1838
  {
1835
1839
  adHocFilterValues: [],
1836
- controlOverrides: o,
1837
- dashboardInputValues: i
1840
+ controlOverrides: i,
1841
+ dashboardInputValues: o
1838
1842
  },
1839
1843
  r
1840
1844
  )
1841
1845
  };
1842
1846
  }
1843
- function Jt(e) {
1847
+ function en(e) {
1844
1848
  const t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Map();
1845
- for (const i of Pe(e))
1846
- i.kind === "filter" && i.filter ? t.set(i.id, i.filter) : i.kind === "control" && n.add(i.id), i.compatibility && r.set(i.id, i.compatibility);
1849
+ for (const o of Pe(e))
1850
+ o.kind === "filter" && o.filter ? t.set(o.id, o.filter) : o.kind === "control" && n.add(o.id), o.compatibility && r.set(o.id, o.compatibility);
1847
1851
  return { filterInputs: t, controlInputIds: n, compatibility: r };
1848
1852
  }
1849
- function Yt(e, t) {
1850
- const n = Ft(t);
1853
+ function tn(e, t) {
1854
+ const n = St(t);
1851
1855
  if (!n) return;
1852
1856
  const r = Z(e, n);
1853
- return r ? Xn(r, e) ? "applies" : "not-eligible" : "removed";
1857
+ return r ? rr(r, e) ? "applies" : "not-eligible" : "removed";
1854
1858
  }
1855
- function ms(e, t) {
1856
- const n = Yt(e, t);
1859
+ function vs(e, t) {
1860
+ const n = tn(e, t);
1857
1861
  return n ? n === "applies" : Pe(e).some(
1858
1862
  (r) => r.id === t
1859
1863
  );
1860
1864
  }
1861
- function Xt(e, t, n, r) {
1865
+ function nn(e, t, n, r) {
1862
1866
  if (!n) return {};
1863
- const i = new Set((e.sheets ?? []).map((c) => c.id)), o = new Set(
1867
+ const o = new Set((e.sheets ?? []).map((c) => c.id)), i = new Set(
1864
1868
  j(e).map(({ card: c }) => c.id)
1865
1869
  ), a = A(e), s = (c) => {
1866
1870
  var u;
@@ -1869,7 +1873,7 @@ function Xt(e, t, n, r) {
1869
1873
  for (const [f, m] of Object.entries(c)) {
1870
1874
  const y = t.filterInputs.has(f) || t.controlInputIds.has(f) ? f : ((u = a.findFilterInput({ inputId: f })) == null ? void 0 : u.input.id) ?? f;
1871
1875
  if (y !== f && c[y]) continue;
1872
- const p = Yt(e, y);
1876
+ const p = tn(e, y);
1873
1877
  if (p) {
1874
1878
  if (p !== "applies") {
1875
1879
  r.push({
@@ -1926,23 +1930,23 @@ function Xt(e, t, n, r) {
1926
1930
  };
1927
1931
  return fe({
1928
1932
  shared: s(n.shared),
1929
- bySheetId: l(n.bySheetId, (c) => i.has(c)),
1930
- byCardId: l(n.byCardId, (c) => o.has(c))
1933
+ bySheetId: l(n.bySheetId, (c) => o.has(c)),
1934
+ byCardId: l(n.byCardId, (c) => i.has(c))
1931
1935
  // Document sections are not viewer state.
1932
1936
  });
1933
1937
  }
1934
1938
  function O(e, t, n, r = {}) {
1935
- const i = new Map(
1939
+ const o = new Map(
1936
1940
  j(e).map(({ card: a }) => [a.id, a])
1937
- ), o = {};
1941
+ ), i = {};
1938
1942
  for (const [a, s] of Object.entries(t ?? {})) {
1939
- const l = i.get(a);
1940
- if (l && jr(l)) {
1941
- zr(s) || (o[a] = s);
1943
+ const l = o.get(a);
1944
+ if (l && Qr(l)) {
1945
+ $r(s) || (i[a] = s);
1942
1946
  continue;
1943
1947
  }
1944
- if (l && r.sessionSorts && Lr(l)) {
1945
- s.sort && (o[a] = { sort: s.sort });
1948
+ if (l && r.sessionSorts && Wr(l)) {
1949
+ s.sort && (i[a] = { sort: s.sort });
1946
1950
  continue;
1947
1951
  }
1948
1952
  n == null || n.push({
@@ -1952,9 +1956,9 @@ function O(e, t, n, r = {}) {
1952
1956
  reason: Z(e, a) ? "not-eligible" : "removed"
1953
1957
  });
1954
1958
  }
1955
- return o;
1959
+ return i;
1956
1960
  }
1957
- function Oo(e, t, n) {
1961
+ function Ni(e, t, n) {
1958
1962
  if (t) {
1959
1963
  if (J(e, t)) return t;
1960
1964
  n.push({
@@ -1966,7 +1970,7 @@ function Oo(e, t, n) {
1966
1970
  }
1967
1971
  }
1968
1972
  const je = (e, t) => pe(e ?? null, t ?? null);
1969
- function en(e) {
1973
+ function rn(e) {
1970
1974
  return {
1971
1975
  adHocFilterValues: e.adHocFilterValues,
1972
1976
  controlOverrides: e.controlOverrides,
@@ -1985,7 +1989,7 @@ function X(e, t) {
1985
1989
  tableSettings: t
1986
1990
  };
1987
1991
  }
1988
- function tn(e, t) {
1992
+ function on(e, t) {
1989
1993
  const n = t.dashboardInputValues === e.baseline.hostInputValues && !t.inlineFilterValuesMap && !t.adHocFilterValues.length && t.controlOverrides === e.baseline.controlOverrides;
1990
1994
  return {
1991
1995
  selectedSheetId: t.selectedSheetId,
@@ -1995,29 +1999,29 @@ function tn(e, t) {
1995
1999
  };
1996
2000
  }
1997
2001
  function N(e, t) {
1998
- const n = en(t), r = t.restore ?? n;
2002
+ const n = rn(t), r = t.restore ?? n;
1999
2003
  return {
2000
2004
  ...n,
2001
2005
  appliedBookmarkId: t.appliedBookmarkId,
2002
2006
  rememberedWrites: t.rememberedWrites ?? [],
2003
2007
  notices: t.notices ?? [],
2004
- opened: tn(e, r),
2008
+ opened: on(e, r),
2005
2009
  restore: r
2006
2010
  };
2007
2011
  }
2008
- function nt(e, t, n, r) {
2009
- const { dashboard: i, baseline: o } = e, a = [], s = Mt(t.state, _e), l = s.ok ? s.value : {};
2012
+ function ot(e, t, n, r) {
2013
+ const { dashboard: o, baseline: i } = e, a = [], s = xt(t.state, _e), l = s.ok ? s.value : {};
2010
2014
  for (const y of s.ok ? s.issues : [])
2011
- a.push(_o(y));
2012
- const c = Jt(i), d = Wt(
2015
+ a.push(ji(y));
2016
+ const c = en(o), d = Yt(
2013
2017
  c.compatibility,
2014
- Xt(i, c, l.inputs, a)
2015
- ), u = Oo(i, l.selectedSheetId, a) ?? o.selectedSheetId, f = O(
2016
- i,
2018
+ nn(o, c, l.inputs, a)
2019
+ ), u = Ni(o, l.selectedSheetId, a) ?? i.selectedSheetId, f = O(
2020
+ o,
2017
2021
  l.tableSettings,
2018
2022
  a
2019
2023
  ), m = O(
2020
- i,
2024
+ o,
2021
2025
  n,
2022
2026
  void 0
2023
2027
  );
@@ -2025,19 +2029,19 @@ function nt(e, t, n, r) {
2025
2029
  appliedBookmarkId: t.id,
2026
2030
  // A bookmark opens without ad-hoc values, as today (P4a-02 f).
2027
2031
  adHocFilterValues: [],
2028
- controlOverrides: Zt(
2029
- i,
2030
- o.controlOverrides,
2032
+ controlOverrides: Xt(
2033
+ o,
2034
+ i.controlOverrides,
2031
2035
  d.controlValues
2032
2036
  ),
2033
2037
  // Overlay, never replacement: the bookmark's slots over the host's.
2034
2038
  dashboardInputValues: xe(
2035
- o.hostInputValues,
2039
+ i.hostInputValues,
2036
2040
  d.runtime
2037
2041
  ),
2038
- ...nn(
2039
- Mo(
2040
- qe(i, e.calendar),
2042
+ ...an(
2043
+ Ai(
2044
+ qe(o, e.calendar),
2041
2045
  d.inlineFilterValues
2042
2046
  )
2043
2047
  ),
@@ -2056,7 +2060,7 @@ function nt(e, t, n, r) {
2056
2060
  notices: a
2057
2061
  });
2058
2062
  }
2059
- function _o(e) {
2063
+ function ji(e) {
2060
2064
  return {
2061
2065
  kind: "setting-no-longer-applies",
2062
2066
  target: e.target,
@@ -2064,34 +2068,34 @@ function _o(e) {
2064
2068
  reason: "invalid"
2065
2069
  };
2066
2070
  }
2067
- function nn(e) {
2071
+ function an(e) {
2068
2072
  return e ? { inlineFilterValuesMap: e } : {};
2069
2073
  }
2070
- function rt(e, t, n) {
2071
- const { dashboard: r, baseline: i } = e;
2074
+ function it(e, t, n) {
2075
+ const { dashboard: r, baseline: o } = e;
2072
2076
  return {
2073
2077
  // A reload in place keeps ad-hoc values, as today (P4a-02 f), unless the
2074
2078
  // template now defines a filter with that id.
2075
2079
  adHocFilterValues: t.adHocFilterValues.filter(
2076
- (o) => !A(r).findFilterInput({ filterId: o.filterId })
2080
+ (i) => !A(r).findFilterInput({ filterId: i.filterId })
2077
2081
  ),
2078
2082
  // A host's new control defaults are the baseline's, not the viewer's.
2079
- controlOverrides: n.controlsChanged ? i.controlOverrides : t.controlOverrides,
2083
+ controlOverrides: n.controlsChanged ? o.controlOverrides : t.controlOverrides,
2080
2084
  // Live slots stay, except a filter value this template no longer accepts:
2081
2085
  // that filter loads its new default, as the old list did. The resolver
2082
2086
  // ignores slots this template no longer has.
2083
- dashboardInputValues: Po(
2087
+ dashboardInputValues: Ri(
2084
2088
  r,
2085
2089
  t.dashboardInputValues
2086
2090
  ),
2087
- ...nn(
2088
- ko(
2091
+ ...an(
2092
+ Bi(
2089
2093
  r,
2090
2094
  qe(r, e.calendar),
2091
2095
  t.inlineFilterValuesMap ?? {}
2092
2096
  )
2093
2097
  ),
2094
- selectedSheetId: !n.sheetChanged && J(r, t.selectedSheetId) ? t.selectedSheetId : i.selectedSheetId,
2098
+ selectedSheetId: !n.sheetChanged && J(r, t.selectedSheetId) ? t.selectedSheetId : o.selectedSheetId,
2095
2099
  tableSettings: O(
2096
2100
  r,
2097
2101
  t.tableSettings,
@@ -2100,42 +2104,42 @@ function rt(e, t, n) {
2100
2104
  )
2101
2105
  };
2102
2106
  }
2103
- function gs(e) {
2104
- const { dashboard: t, baseline: n, event: r } = e, i = e.rememberedTableSettings;
2107
+ function Fs(e) {
2108
+ const { dashboard: t, baseline: n, event: r } = e, o = e.rememberedTableSettings;
2105
2109
  switch (r.kind) {
2106
2110
  case "initial-load":
2107
- return r.defaultBookmark ? nt(e, r.defaultBookmark, i, {
2111
+ return r.defaultBookmark ? ot(e, r.defaultBookmark, o, {
2108
2112
  writeRemembered: !1
2109
2113
  }) : N(e, {
2110
2114
  appliedBookmarkId: null,
2111
2115
  ...X(
2112
2116
  n,
2113
- O(t, i, void 0, {
2117
+ O(t, o, void 0, {
2114
2118
  sessionSorts: r.captured
2115
2119
  })
2116
2120
  )
2117
2121
  });
2118
2122
  case "refetch": {
2119
- const { live: o } = r, a = o.applied, s = {
2120
- sheetChanged: !!o.previousBaseline && o.previousBaseline.hostSelectedSheetId !== n.hostSelectedSheetId,
2121
- controlsChanged: !!o.previousBaseline && !pe(
2122
- o.previousBaseline.controlOverrides ?? null,
2123
+ const { live: i } = r, a = i.applied, s = {
2124
+ sheetChanged: !!i.previousBaseline && i.previousBaseline.hostSelectedSheetId !== n.hostSelectedSheetId,
2125
+ controlsChanged: !!i.previousBaseline && !pe(
2126
+ i.previousBaseline.controlOverrides ?? null,
2123
2127
  n.controlOverrides ?? null
2124
2128
  )
2125
- }, l = rt(
2129
+ }, l = it(
2126
2130
  e,
2127
2131
  {
2128
- adHocFilterValues: o.adHocFilterValues,
2129
- controlOverrides: o.controlValues ?? n.controlOverrides,
2130
- dashboardInputValues: o.dashboardInputValues,
2131
- inlineFilterValuesMap: o.inlineFilterValuesMap,
2132
- selectedSheetId: o.selectedSheetId,
2133
- tableSettings: o.tableSettings
2132
+ adHocFilterValues: i.adHocFilterValues,
2133
+ controlOverrides: i.controlValues ?? n.controlOverrides,
2134
+ dashboardInputValues: i.dashboardInputValues,
2135
+ inlineFilterValuesMap: i.inlineFilterValuesMap,
2136
+ selectedSheetId: i.selectedSheetId,
2137
+ tableSettings: i.tableSettings
2134
2138
  },
2135
2139
  s
2136
- ), c = a ? rt(e, a.restore, s) : X(
2140
+ ), c = a ? it(e, a.restore, s) : X(
2137
2141
  n,
2138
- O(t, i, void 0)
2142
+ O(t, o, void 0)
2139
2143
  );
2140
2144
  return N(e, {
2141
2145
  appliedBookmarkId: (a == null ? void 0 : a.appliedBookmarkId) ?? null,
@@ -2145,7 +2149,7 @@ function gs(e) {
2145
2149
  });
2146
2150
  }
2147
2151
  case "open-bookmark":
2148
- return nt(e, r.bookmark, i, {
2152
+ return ot(e, r.bookmark, o, {
2149
2153
  writeRemembered: !0
2150
2154
  });
2151
2155
  case "open-default-view":
@@ -2153,7 +2157,7 @@ function gs(e) {
2153
2157
  appliedBookmarkId: null,
2154
2158
  ...X(
2155
2159
  n,
2156
- O(t, i, void 0)
2160
+ O(t, o, void 0)
2157
2161
  )
2158
2162
  });
2159
2163
  case "reset-to-default-view":
@@ -2163,12 +2167,12 @@ function gs(e) {
2163
2167
  rememberedWrites: [{ kind: "clear-all" }]
2164
2168
  });
2165
2169
  case "discard-changes": {
2166
- const { restore: o } = r.applied, a = O(
2170
+ const { restore: i } = r.applied, a = O(
2167
2171
  t,
2168
- o.tableSettings,
2172
+ i.tableSettings,
2169
2173
  void 0,
2170
2174
  { sessionSorts: !0 }
2171
- ), s = O(t, a, void 0), l = O(t, i, void 0), c = [];
2175
+ ), s = O(t, a, void 0), l = O(t, o, void 0), c = [];
2172
2176
  for (const d of /* @__PURE__ */ new Set([
2173
2177
  ...Object.keys(l),
2174
2178
  ...Object.keys(s)
@@ -2181,18 +2185,18 @@ function gs(e) {
2181
2185
  }
2182
2186
  return N(e, {
2183
2187
  appliedBookmarkId: r.applied.appliedBookmarkId,
2184
- ...o,
2185
- selectedSheetId: J(t, o.selectedSheetId) ? o.selectedSheetId : n.selectedSheetId,
2188
+ ...i,
2189
+ selectedSheetId: J(t, i.selectedSheetId) ? i.selectedSheetId : n.selectedSheetId,
2186
2190
  tableSettings: a,
2187
2191
  rememberedWrites: c,
2188
2192
  notices: r.applied.notices,
2189
- restore: o
2193
+ restore: i
2190
2194
  });
2191
2195
  }
2192
2196
  }
2193
2197
  }
2194
- function ys(e) {
2195
- const { dashboard: t, calendar: n } = e, r = e.hostControlValues, i = {
2198
+ function Ds(e) {
2199
+ const { dashboard: t, calendar: n } = e, r = e.hostControlValues, o = {
2196
2200
  ...e.baseline,
2197
2201
  controlOverrides: r,
2198
2202
  materializedInputs: Ne(
@@ -2205,38 +2209,38 @@ function ys(e) {
2205
2209
  n
2206
2210
  )
2207
2211
  };
2208
- let o = r;
2212
+ let i = r;
2209
2213
  if (e.appliedBookmark) {
2210
- const l = Mt(
2214
+ const l = xt(
2211
2215
  e.appliedBookmark.state,
2212
2216
  _e
2213
- ), c = Jt(t), d = Wt(
2217
+ ), c = en(t), d = Yt(
2214
2218
  c.compatibility,
2215
- Xt(
2219
+ nn(
2216
2220
  t,
2217
2221
  c,
2218
2222
  l.ok ? l.value.inputs : void 0,
2219
2223
  []
2220
2224
  )
2221
2225
  ).controlValues;
2222
- o = Zt(t, r, d);
2226
+ i = Xt(t, r, d);
2223
2227
  }
2224
2228
  const a = e.applied;
2225
- if (!a) return { baseline: i, controlOverrides: o, applied: null };
2226
- const s = { ...a.restore, controlOverrides: o };
2229
+ if (!a) return { baseline: o, controlOverrides: i, applied: null };
2230
+ const s = { ...a.restore, controlOverrides: i };
2227
2231
  return {
2228
- baseline: i,
2229
- controlOverrides: o,
2232
+ baseline: o,
2233
+ controlOverrides: i,
2230
2234
  applied: {
2231
2235
  ...a,
2232
- controlOverrides: o,
2236
+ controlOverrides: i,
2233
2237
  restore: s,
2234
- opened: tn({ dashboard: t, baseline: i, calendar: n }, s)
2238
+ opened: on({ dashboard: t, baseline: o, calendar: n }, s)
2235
2239
  }
2236
2240
  };
2237
2241
  }
2238
- function bs(e, t, n) {
2239
- const r = en(n.values);
2242
+ function Ss(e, t, n) {
2243
+ const r = rn(n.values);
2240
2244
  return {
2241
2245
  ...r,
2242
2246
  appliedBookmarkId: t,
@@ -2246,30 +2250,30 @@ function bs(e, t, n) {
2246
2250
  restore: r
2247
2251
  };
2248
2252
  }
2249
- const it = (e) => JSON.stringify([e.scope, e.target, e.inputId]);
2253
+ const at = (e) => JSON.stringify([e.scope, e.target, e.inputId]);
2250
2254
  function ee(e) {
2251
2255
  return !e || e.status === "cleared" && !e.comparisonSelection;
2252
2256
  }
2253
- function rn(e, t) {
2257
+ function sn(e, t) {
2254
2258
  const n = new Map(
2255
- $(e).map((o) => [it(o), o])
2259
+ $(e).map((i) => [at(i), i])
2256
2260
  ), r = new Map(
2257
- $(t).map((o) => [it(o), o])
2258
- ), i = {};
2259
- for (const [o, a] of r) {
2260
- const s = n.get(o);
2261
+ $(t).map((i) => [at(i), i])
2262
+ ), o = {};
2263
+ for (const [i, a] of r) {
2264
+ const s = n.get(i);
2261
2265
  s && pe(s.slot, a.slot) || ee(a.slot) && ee(s == null ? void 0 : s.slot) || le(
2262
- i,
2266
+ o,
2263
2267
  a,
2264
2268
  ee(a.slot) ? { status: "cleared" } : a.slot
2265
2269
  );
2266
2270
  }
2267
- for (const [o, a] of n)
2268
- r.has(o) || ee(a.slot) || le(i, a, { status: "cleared" });
2269
- return fe(i);
2271
+ for (const [i, a] of n)
2272
+ r.has(i) || ee(a.slot) || le(o, a, { status: "cleared" });
2273
+ return fe(o);
2270
2274
  }
2271
- function Is(e) {
2272
- const { dashboard: t, baseline: n, current: r } = e, i = rn(n.materializedInputs, r.inputs), o = O(
2275
+ function Ts(e) {
2276
+ const { dashboard: t, baseline: n, current: r } = e, o = sn(n.materializedInputs, r.inputs), i = O(
2273
2277
  t,
2274
2278
  r.tableSettings,
2275
2279
  void 0
@@ -2277,37 +2281,37 @@ function Is(e) {
2277
2281
  return {
2278
2282
  version: _e,
2279
2283
  ...a ? { selectedSheetId: a } : {},
2280
- ...$(i).length ? { inputs: i } : {},
2281
- ...Object.keys(o).length ? { tableSettings: o } : {}
2284
+ ...$(o).length ? { inputs: o } : {},
2285
+ ...Object.keys(i).length ? { tableSettings: i } : {}
2282
2286
  };
2283
2287
  }
2284
- function Ao(e) {
2288
+ function zi(e) {
2285
2289
  const t = /* @__PURE__ */ new Map();
2286
2290
  for (const n of Pe(e))
2287
2291
  n.label && t.set(n.id, n.label);
2288
2292
  return t;
2289
2293
  }
2290
- function Bo(e, t, n) {
2291
- var i, o;
2292
- const r = Ft(n);
2294
+ function Li(e, t, n) {
2295
+ var o, i;
2296
+ const r = St(n);
2293
2297
  if (r) {
2294
- const a = (o = (i = Z(e, r)) == null ? void 0 : i.title) == null ? void 0 : o.trim();
2298
+ const a = (i = (o = Z(e, r)) == null ? void 0 : o.title) == null ? void 0 : i.trim();
2295
2299
  return a ? `Selection in ${a}` : "Selection";
2296
2300
  }
2297
2301
  return t.get(n) ?? n;
2298
2302
  }
2299
- function Cs(e) {
2303
+ function Vs(e) {
2300
2304
  var c, d;
2301
- const { dashboard: t, opened: n, current: r } = e, i = [], o = Ao(t), a = /* @__PURE__ */ new Set();
2305
+ const { dashboard: t, opened: n, current: r } = e, o = [], i = zi(t), a = /* @__PURE__ */ new Set();
2302
2306
  for (const u of $(
2303
- rn(n.inputs, r.inputs)
2307
+ sn(n.inputs, r.inputs)
2304
2308
  ))
2305
- a.has(u.inputId) || (a.add(u.inputId), i.push({
2309
+ a.has(u.inputId) || (a.add(u.inputId), o.push({
2306
2310
  target: "input",
2307
2311
  inputId: u.inputId,
2308
- label: Bo(t, o, u.inputId)
2312
+ label: Li(t, i, u.inputId)
2309
2313
  }));
2310
- (n.selectedSheetId ?? null) !== (r.selectedSheetId ?? null) && i.push({ target: "sheet" });
2314
+ (n.selectedSheetId ?? null) !== (r.selectedSheetId ?? null) && o.push({ target: "sheet" });
2311
2315
  const s = O(
2312
2316
  t,
2313
2317
  n.tableSettings,
@@ -2321,14 +2325,14 @@ function Cs(e) {
2321
2325
  ...Object.keys(s),
2322
2326
  ...Object.keys(l)
2323
2327
  ]))
2324
- je(s[u], l[u]) || i.push({
2328
+ je(s[u], l[u]) || o.push({
2325
2329
  target: "table",
2326
2330
  cardId: u,
2327
2331
  cardTitle: ((d = (c = Z(t, u)) == null ? void 0 : c.title) == null ? void 0 : d.trim()) || "Table"
2328
2332
  });
2329
- return i;
2333
+ return o;
2330
2334
  }
2331
- function ot(e) {
2335
+ function st(e) {
2332
2336
  const t = U(e.filter);
2333
2337
  return {
2334
2338
  inputId: e.inputId,
@@ -2342,9 +2346,9 @@ function ot(e) {
2342
2346
  }
2343
2347
  };
2344
2348
  }
2345
- function Eo(e) {
2346
- var i, o;
2347
- if ((i = e.card.sql) != null && i.trim())
2349
+ function Ki(e) {
2350
+ var o, i;
2351
+ if ((o = e.card.sql) != null && o.trim())
2348
2352
  return {
2349
2353
  inputs: e.inputs,
2350
2354
  fieldCandidates: [],
@@ -2352,7 +2356,7 @@ function Eo(e) {
2352
2356
  };
2353
2357
  const t = e.inputs.filter((a) => !U(a.filter)).map((a) => ({
2354
2358
  input: a,
2355
- resolution: er({
2359
+ resolution: or({
2356
2360
  filter: a.filter,
2357
2361
  filterValue: a.filterValue,
2358
2362
  effectiveFilterValue: a.effectiveFilterValue,
@@ -2366,13 +2370,13 @@ function Eo(e) {
2366
2370
  const n = e.inputs.find(
2367
2371
  (a) => U(a.filter)
2368
2372
  );
2369
- if (n && ((o = n.filterValue) == null ? void 0 : o.filterId) === n.filterId && n.effectiveFilterValue.filterId === n.filterId && tr(n.effectiveFilterValue))
2373
+ if (n && ((i = n.filterValue) == null ? void 0 : i.filterId) === n.filterId && n.effectiveFilterValue.filterId === n.filterId && ir(n.effectiveFilterValue))
2370
2374
  return {
2371
2375
  inputs: e.inputs,
2372
2376
  fieldCandidates: t,
2373
2377
  resolution: {
2374
2378
  status: "resolved",
2375
- resolvedOwner: ot(n)
2379
+ resolvedOwner: st(n)
2376
2380
  }
2377
2381
  };
2378
2382
  const r = t.filter(
@@ -2383,7 +2387,7 @@ function Eo(e) {
2383
2387
  fieldCandidates: t,
2384
2388
  resolution: {
2385
2389
  status: "resolved",
2386
- resolvedOwner: ot(r[0].input)
2390
+ resolvedOwner: st(r[0].input)
2387
2391
  }
2388
2392
  } : r.length > 1 ? {
2389
2393
  inputs: e.inputs,
@@ -2396,7 +2400,7 @@ function Eo(e) {
2396
2400
  }
2397
2401
  } : { inputs: e.inputs, fieldCandidates: t, resolution: { status: "none" } };
2398
2402
  }
2399
- function hs(e) {
2403
+ function Ms(e) {
2400
2404
  const t = {
2401
2405
  ownerCardCount: 0,
2402
2406
  matchingCardCount: 0,
@@ -2405,16 +2409,16 @@ function hs(e) {
2405
2409
  };
2406
2410
  for (const n of e.targets) {
2407
2411
  const r = n.plan.fieldCandidates.find(
2408
- (o) => o.input.inputId === e.inputId
2412
+ (i) => i.input.inputId === e.inputId
2409
2413
  );
2410
2414
  if (!r || r.resolution.status !== "eligible") continue;
2411
2415
  t.matchingCardCount += 1;
2412
- const { resolution: i } = n.plan;
2413
- i.status === "resolved" && i.resolvedOwner.inputId === e.inputId ? t.ownerCardCount += 1 : i.status === "resolved" && i.resolvedOwner.owner.kind === "global_date" ? t.globalPrecedenceCardCount += 1 : i.status === "ambiguous" && i.candidateInputIds.includes(e.inputId) && (t.ambiguousCardCount += 1);
2416
+ const { resolution: o } = n.plan;
2417
+ o.status === "resolved" && o.resolvedOwner.inputId === e.inputId ? t.ownerCardCount += 1 : o.status === "resolved" && o.resolvedOwner.owner.kind === "global_date" ? t.globalPrecedenceCardCount += 1 : o.status === "ambiguous" && o.candidateInputIds.includes(e.inputId) && (t.ambiguousCardCount += 1);
2414
2418
  }
2415
2419
  return t;
2416
2420
  }
2417
- const Ro = /* @__PURE__ */ new Set([
2421
+ const Gi = /* @__PURE__ */ new Set([
2418
2422
  "between",
2419
2423
  "not between",
2420
2424
  "=",
@@ -2425,41 +2429,41 @@ const Ro = /* @__PURE__ */ new Set([
2425
2429
  "<=",
2426
2430
  "is null",
2427
2431
  "is not null"
2428
- ]), qo = /^(\d{4}-\d{2}-\d{2})T/, No = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?(?:Z|[+-]\d{2}:\d{2})$/;
2432
+ ]), Hi = /^(\d{4}-\d{2}-\d{2})T/, Ui = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?(?:Z|[+-]\d{2}:\d{2})$/;
2429
2433
  function ze(e) {
2430
- return Ro.has(e);
2434
+ return Gi.has(e);
2431
2435
  }
2432
- function jo(e, t) {
2436
+ function Qi(e, t) {
2433
2437
  if (e instanceof Date)
2434
- return Number.isNaN(e.getTime()) ? e : t ? He(e, t, "yyyy-MM-dd") : e.toISOString().slice(0, 10);
2438
+ return Number.isNaN(e.getTime()) ? e : t ? Qe(e, t, "yyyy-MM-dd") : e.toISOString().slice(0, 10);
2435
2439
  if (typeof e != "string")
2436
2440
  return e;
2437
2441
  const n = e.trim();
2438
- if (t && No.test(n)) {
2439
- const i = new Date(n);
2440
- if (!Number.isNaN(i.getTime()))
2441
- return He(i, t, "yyyy-MM-dd");
2442
+ if (t && Ui.test(n)) {
2443
+ const o = new Date(n);
2444
+ if (!Number.isNaN(o.getTime()))
2445
+ return Qe(o, t, "yyyy-MM-dd");
2442
2446
  }
2443
- const r = qo.exec(n);
2447
+ const r = Hi.exec(n);
2444
2448
  return r ? r[1] : e;
2445
2449
  }
2446
- function on(e, t) {
2450
+ function ln(e, t) {
2447
2451
  return Array.isArray(e) ? e.map(
2448
- (n) => jo(n, t)
2452
+ (n) => Qi(n, t)
2449
2453
  ) : e;
2450
2454
  }
2451
- function an(e) {
2455
+ function cn(e) {
2452
2456
  return typeof e.allowMinutePrecision == "boolean" ? e.allowMinutePrecision : we(
2453
2457
  e.dashboard,
2454
2458
  e.semanticExecutionPayload
2455
2459
  ).allEligibleTargetsAreDateTime;
2456
2460
  }
2457
- function sn(e) {
2461
+ function dn(e) {
2458
2462
  const {
2459
2463
  globalDateFilter: t,
2460
2464
  globalDateFilterValue: n,
2461
2465
  timezone: r,
2462
- allowMinutePrecision: i = !1
2466
+ allowMinutePrecision: o = !1
2463
2467
  } = e;
2464
2468
  if (!t || !n)
2465
2469
  return;
@@ -2468,7 +2472,7 @@ function sn(e) {
2468
2472
  ...n,
2469
2473
  filterId: t.id
2470
2474
  };
2471
- const o = n, a = o.temporalPrecision === "minute" || te(o.relativeMeta) === "minute", s = !i && a, l = o.operation === "is null" || o.operation === "is not null" ? [] : s ? on(o.values, r) : o.values, c = i || te(o.relativeMeta) !== "minute" ? o.relativeMeta : void 0, d = i && o.temporalPrecision === "minute" ? o.temporalPrecision : void 0, {
2475
+ const i = n, a = i.temporalPrecision === "minute" || te(i.relativeMeta) === "minute", s = !o && a, l = i.operation === "is null" || i.operation === "is not null" ? [] : s ? ln(i.values, r) : i.values, c = o || te(i.relativeMeta) !== "minute" ? i.relativeMeta : void 0, d = o && i.temporalPrecision === "minute" ? i.temporalPrecision : void 0, {
2472
2476
  relativeMeta: u,
2473
2477
  temporalPrecision: f,
2474
2478
  values: m,
@@ -2482,30 +2486,30 @@ function sn(e) {
2482
2486
  ...d ? { temporalPrecision: d } : {}
2483
2487
  };
2484
2488
  }
2485
- function zo(e) {
2489
+ function $i(e) {
2486
2490
  const t = L(e.filters);
2487
2491
  if (!t)
2488
2492
  return e.filterValues;
2489
- const n = an(e);
2490
- return e.filterValues.map((r) => r.filterId !== t.id ? r : sn({
2493
+ const n = cn(e);
2494
+ return e.filterValues.map((r) => r.filterId !== t.id ? r : dn({
2491
2495
  globalDateFilter: t,
2492
2496
  globalDateFilterValue: r,
2493
2497
  timezone: e.timezone,
2494
2498
  allowMinutePrecision: n
2495
2499
  }) || r);
2496
2500
  }
2497
- function ln(e) {
2501
+ function un(e) {
2498
2502
  const {
2499
2503
  globalDateFilter: t,
2500
2504
  globalDateFilterValue: n,
2501
2505
  resolvedPrimaryDateField: r,
2502
- semanticContext: i,
2503
- timezone: o,
2506
+ semanticContext: o,
2507
+ timezone: i,
2504
2508
  allowMinutePrecision: a = !1
2505
2509
  } = e;
2506
2510
  if (!t || !n || !r || !ze(n.operation))
2507
2511
  return null;
2508
- const s = n, l = nr(
2512
+ const s = n, l = ar(
2509
2513
  r.dataType
2510
2514
  ), c = a && l, d = s.temporalPrecision === "minute" || te(s.relativeMeta) === "minute", u = c && s.temporalPrecision === "minute" ? s.temporalPrecision : void 0, f = c || te(s.relativeMeta) !== "minute" ? s.relativeMeta : void 0, m = !c && d;
2511
2515
  return {
@@ -2514,9 +2518,9 @@ function ln(e) {
2514
2518
  name: r.qualifiedFieldName || r.name,
2515
2519
  operation: s.operation,
2516
2520
  valueType: "date",
2517
- values: s.operation === "is null" || s.operation === "is not null" ? [] : m ? on(
2521
+ values: s.operation === "is null" || s.operation === "is not null" ? [] : m ? ln(
2518
2522
  s.values,
2519
- o
2523
+ i
2520
2524
  ) : s.values,
2521
2525
  dataType: r.dataType || "date",
2522
2526
  // The exact type travels with the filter, so the server formats the predicate for
@@ -2534,7 +2538,7 @@ function ln(e) {
2534
2538
  role: "groupby",
2535
2539
  ...t != null && t.title ? { label: t.title } : {}
2536
2540
  },
2537
- ...i ? { semanticContext: i } : {},
2541
+ ...o ? { semanticContext: o } : {},
2538
2542
  ...f ? { relativeMeta: f } : {},
2539
2543
  ...u ? { temporalPrecision: u } : {}
2540
2544
  };
@@ -2542,7 +2546,7 @@ function ln(e) {
2542
2546
  function B(e) {
2543
2547
  return typeof e == "string" ? e.trim() : "";
2544
2548
  }
2545
- function Lo(e) {
2549
+ function Wi(e) {
2546
2550
  var t;
2547
2551
  return (((t = e.semanticContext) == null ? void 0 : t.selectedEntities) || []).filter((n) => typeof n == "object" && n !== null).filter((n) => n.type === "dataset").map((n) => {
2548
2552
  var r;
@@ -2553,39 +2557,39 @@ function Lo(e) {
2553
2557
  };
2554
2558
  }).filter((n) => n.domainId && n.datasetName);
2555
2559
  }
2556
- function Ko(e) {
2560
+ function Zi(e) {
2557
2561
  var l, c, d, u, f;
2558
2562
  if (U(e) || (l = e.sql) != null && l.trim())
2559
2563
  return null;
2560
- const t = Lo(e), n = B((c = e.semanticContext) == null ? void 0 : c.semanticDomainId), r = B((d = e.fieldMeta) == null ? void 0 : d.entityId), i = B((u = e.fieldMeta) == null ? void 0 : u.entityName), o = B((f = e.fieldMeta) == null ? void 0 : f.entityType) === "dataset", a = t.find(
2564
+ const t = Wi(e), n = B((c = e.semanticContext) == null ? void 0 : c.semanticDomainId), r = B((d = e.fieldMeta) == null ? void 0 : d.entityId), o = B((u = e.fieldMeta) == null ? void 0 : u.entityName), i = B((f = e.fieldMeta) == null ? void 0 : f.entityType) === "dataset", a = t.find(
2561
2565
  (m) => r && m.selectedEntityId === r
2562
2566
  );
2563
2567
  if (a)
2564
2568
  return a;
2565
2569
  const s = t.find(
2566
- (m) => i && m.datasetName === i && (!n || m.domainId === n)
2570
+ (m) => o && m.datasetName === o && (!n || m.domainId === n)
2567
2571
  );
2568
- return s || (t.length === 1 ? t[0] : o && i && n ? {
2572
+ return s || (t.length === 1 ? t[0] : i && o && n ? {
2569
2573
  domainId: n,
2570
- datasetName: i
2574
+ datasetName: o
2571
2575
  } : null);
2572
2576
  }
2573
- function Go(e) {
2574
- var i, o;
2577
+ function Ji(e) {
2578
+ var o, i;
2575
2579
  const { filter: t, semanticExecutionPayload: n } = e;
2576
2580
  if (!n)
2577
2581
  return null;
2578
- const r = Ko(t);
2579
- return r && ((o = (i = n.domainsById[r.domainId]) == null ? void 0 : i.datasetsByName[r.datasetName]) == null ? void 0 : o.primaryDateField) || null;
2582
+ const r = Zi(t);
2583
+ return r && ((i = (o = n.domainsById[r.domainId]) == null ? void 0 : o.datasetsByName[r.datasetName]) == null ? void 0 : i.primaryDateField) || null;
2580
2584
  }
2581
- function cn(e) {
2585
+ function fn(e) {
2582
2586
  const t = L(e.filters);
2583
2587
  return t ? e.filterValues.filter(
2584
2588
  (n) => n.filterId !== t.id
2585
2589
  ) : e.filterValues;
2586
2590
  }
2587
- function vs(e) {
2588
- const t = L(e.filters), n = cn({
2591
+ function ks(e) {
2592
+ const t = L(e.filters), n = fn({
2589
2593
  filters: e.filters,
2590
2594
  filterValues: e.filterValues
2591
2595
  });
@@ -2593,37 +2597,37 @@ function vs(e) {
2593
2597
  return n;
2594
2598
  const r = e.filterValues.find(
2595
2599
  (a) => a.filterId === t.id
2596
- ), i = Go({
2600
+ ), o = Ji({
2597
2601
  filter: e.filter,
2598
2602
  semanticExecutionPayload: e.semanticExecutionPayload
2599
- }), o = ln({
2603
+ }), i = un({
2600
2604
  globalDateFilter: t,
2601
2605
  globalDateFilterValue: r,
2602
- resolvedPrimaryDateField: i || void 0,
2606
+ resolvedPrimaryDateField: o || void 0,
2603
2607
  semanticContext: e.filter.semanticContext,
2604
2608
  timezone: e.timezone,
2605
2609
  allowMinutePrecision: e.allowMinutePrecision
2606
2610
  });
2607
- return o ? [o, ...n] : n;
2611
+ return i ? [i, ...n] : n;
2608
2612
  }
2609
- function Ho(e) {
2613
+ function Yi(e) {
2610
2614
  var d;
2611
2615
  const t = L(e.filters), n = t ? e.cardFilterValues.find(
2612
2616
  (u) => u.filterId === t.id
2613
2617
  ) : void 0, r = t ? e.cardFilterValues.filter(
2614
2618
  (u) => u.filterId !== t.id
2615
- ) : e.cardFilterValues, i = e.resolvedPrimaryDateField ?? gt({
2619
+ ) : e.cardFilterValues, o = e.resolvedPrimaryDateField ?? bt({
2616
2620
  card: e.card,
2617
2621
  cardConfig: e.cardConfig,
2618
2622
  resolvedFields: e.resolvedFields,
2619
2623
  semanticExecutionPayload: e.semanticExecutionPayload
2620
- }), o = ln({
2624
+ }), i = un({
2621
2625
  globalDateFilter: t,
2622
2626
  globalDateFilterValue: n,
2623
- resolvedPrimaryDateField: i || void 0,
2627
+ resolvedPrimaryDateField: o || void 0,
2624
2628
  timezone: e.timezone,
2625
2629
  allowMinutePrecision: e.allowMinutePrecision
2626
- }), a = o ? [o, ...r] : r, s = new Map(
2630
+ }), a = i ? [i, ...r] : r, s = new Map(
2627
2631
  a.map((u) => [
2628
2632
  u.filterId,
2629
2633
  u
@@ -2638,24 +2642,24 @@ function Ho(e) {
2638
2642
  effectiveFilterValue: f,
2639
2643
  mappedFilterValue: (m = e.mappedFilterValuesByInputId) == null ? void 0 : m.get(u.inputId)
2640
2644
  }] : [];
2641
- })) || [], c = Eo({
2645
+ })) || [], c = Ki({
2642
2646
  inputs: l,
2643
- temporalBinding: i,
2647
+ temporalBinding: o,
2644
2648
  card: e.card
2645
2649
  });
2646
2650
  return {
2647
2651
  cardFilterValues: a,
2648
- resolvedPrimaryDateField: i,
2652
+ resolvedPrimaryDateField: o,
2649
2653
  dateComparisonPlan: c
2650
2654
  };
2651
2655
  }
2652
- function Fs(e) {
2653
- const t = L(e.filters), n = an(e), r = t ? e.filterValues.find(
2656
+ function xs(e) {
2657
+ const t = L(e.filters), n = cn(e), r = t ? e.filterValues.find(
2654
2658
  (a) => a.filterId === t.id
2655
- ) : void 0, i = cn(e);
2656
- return !t || !r || !ze(r.operation) ? i : [
2659
+ ) : void 0, o = fn(e);
2660
+ return !t || !r || !ze(r.operation) ? o : [
2657
2661
  {
2658
- ...sn({
2662
+ ...dn({
2659
2663
  globalDateFilter: t,
2660
2664
  globalDateFilterValue: r,
2661
2665
  timezone: e.timezone,
@@ -2664,62 +2668,62 @@ function Fs(e) {
2664
2668
  filterId: t.id,
2665
2669
  name: t.title || t.column
2666
2670
  },
2667
- ...i
2671
+ ...o
2668
2672
  ];
2669
2673
  }
2670
- class Uo extends Error {
2674
+ class Xi extends Error {
2671
2675
  }
2672
- function Ds(e, t) {
2676
+ function Ps(e, t) {
2673
2677
  const n = new Map((e ? j(e) : []).map(({ card: r }) => [r.id, r]));
2674
2678
  return t && n.set(t.id, t), [...n.values()].flatMap((r) => {
2675
- const i = Ve(r);
2676
- return i.status === "ready" ? uo(i.config.spec, r.controlBindings) : [];
2679
+ const o = Ve(r);
2680
+ return o.status === "ready" ? Ii(o.config.spec, r.controlBindings) : [];
2677
2681
  });
2678
2682
  }
2679
- function Qo(e, t, n) {
2680
- const r = rr(e);
2683
+ function ea(e, t, n) {
2684
+ const r = sr(e);
2681
2685
  if (!r) throw new Error("Matrix card definition is required.");
2682
- const i = n && co({
2686
+ const o = n && bi({
2683
2687
  ...n,
2684
2688
  spec: r.spec,
2685
2689
  catalog: t.map((d) => ({ ...d, id: d.resolvedField.id }))
2686
- }), o = i ? { ...r, spec: i.spec } : r, a = ir(t), s = or(t), l = (d) => {
2687
- const u = s(d, o.spec.source);
2690
+ }), i = o ? { ...r, spec: o.spec } : r, a = lr(t), s = cr(t), l = (d) => {
2691
+ const u = s(d, i.spec.source);
2688
2692
  if (!(!u && d.derivedField)) {
2689
- if (!u) throw new Uo(`Matrix field metadata is unavailable: ${d.name}`);
2693
+ if (!u) throw new Xi(`Matrix field metadata is unavailable: ${d.name}`);
2690
2694
  return { ...u, ...d.derivedField ? { derivedField: d.derivedField } : {} };
2691
2695
  }
2692
2696
  }, c = {
2693
- rows: o.spec.rows.flatMap((d) => {
2697
+ rows: i.spec.rows.flatMap((d) => {
2694
2698
  const u = l(d.field);
2695
2699
  return u ? [{ ...u, id: d.id, granularity: d.grain, role: "groupby" }] : [];
2696
2700
  }),
2697
- columns: o.spec.columns.flatMap((d) => {
2701
+ columns: i.spec.columns.flatMap((d) => {
2698
2702
  const u = l(d.field);
2699
2703
  return u ? [{ ...u, id: d.id, granularity: d.grain, role: "pivotby" }] : [];
2700
2704
  }),
2701
2705
  // Aggregate-stage expressions have no source-column filter target. They stay
2702
2706
  // authoritative in matrix.spec, including all dependencies and controls.
2703
- metrics: o.spec.measures.flatMap((d) => {
2707
+ metrics: i.spec.measures.flatMap((d) => {
2704
2708
  if (d.kind !== "aggregate" || d.field.name === "*") return [];
2705
2709
  const u = l(d.field);
2706
2710
  return u ? [{ ...u, id: d.id, aggregate: d.aggregate, role: "metric" }] : [];
2707
2711
  })
2708
2712
  };
2709
- return { config: o, fields: c, resolveField: a };
2713
+ return { config: i, fields: c, resolveField: a };
2710
2714
  }
2711
- function $o(e) {
2715
+ function ta(e) {
2712
2716
  const t = e.filter(Boolean);
2713
2717
  if (t.length !== 0)
2714
2718
  return t.length === 1 ? t[0] : {
2715
- id: yt(),
2719
+ id: It(),
2716
2720
  logicalOperator: "AND",
2717
2721
  negate: !1,
2718
2722
  conditions: [],
2719
2723
  groups: t
2720
2724
  };
2721
2725
  }
2722
- function Wo(e) {
2726
+ function na(e) {
2723
2727
  if (!e) return;
2724
2728
  const t = (n) => ({
2725
2729
  logicalOperator: n.logicalOperator,
@@ -2739,12 +2743,12 @@ function Wo(e) {
2739
2743
  });
2740
2744
  return JSON.stringify(t(e));
2741
2745
  }
2742
- function Zo(e, t, n = {}) {
2746
+ function ra(e, t, n = {}) {
2743
2747
  const r = e.metricColumns || [];
2744
2748
  if (r.length === 0) return e;
2745
- const i = ar.includes(
2749
+ const o = dr.includes(
2746
2750
  t
2747
- ), o = sr.includes(
2751
+ ), i = ur.includes(
2748
2752
  t
2749
2753
  ), a = (c) => {
2750
2754
  var d;
@@ -2760,11 +2764,11 @@ function Zo(e, t, n = {}) {
2760
2764
  const l = r.map(
2761
2765
  (c) => {
2762
2766
  var f;
2763
- const d = Kr(c);
2767
+ const d = Zr(c);
2764
2768
  if (d === "none")
2765
2769
  return c;
2766
2770
  let u = c;
2767
- return (f = u.parameters) != null && f.windowTransform && (s = !0, u = a(u)), n.keepsPeriodComparison && d !== "target" ? u : i ? d === "target" && !o ? (s = !0, {
2771
+ return (f = u.parameters) != null && f.windowTransform && (s = !0, u = a(u)), n.keepsPeriodComparison && d !== "target" ? u : o ? d === "target" && !i ? (s = !0, {
2768
2772
  ...u,
2769
2773
  comparison: void 0
2770
2774
  }) : u : (s = !0, { ...u, comparison: void 0 });
@@ -2775,46 +2779,46 @@ function Zo(e, t, n = {}) {
2775
2779
  metricColumns: l
2776
2780
  } : e;
2777
2781
  }
2778
- function Ss(e, t = {}) {
2779
- return dn(un(e, t));
2782
+ function ws(e, t = {}) {
2783
+ return pn(mn(e, t));
2780
2784
  }
2781
- function dn(e) {
2782
- const t = [e.drill, e.selections, e.zoom];
2783
- return e.authored ? Yr(e.authored, t, yt()) : $o(t);
2785
+ function pn(e) {
2786
+ const t = [e.drill, e.selections, e.zoom, e.search];
2787
+ return e.authored ? ao(e.authored, t, It()) : ta(t);
2784
2788
  }
2785
- function un(e, t = {}) {
2789
+ function mn(e, t = {}) {
2786
2790
  return {
2787
- authored: t.includeAuthoredFilters === !1 ? void 0 : lr(e),
2788
- drill: go(t.drill, e.id),
2789
- selections: Xr(t.selections ?? []),
2791
+ authored: t.includeAuthoredFilters === !1 ? void 0 : fr(e),
2792
+ drill: Fi(t.drill, e.id),
2793
+ selections: io(t.selections ?? []),
2790
2794
  ...t.zoom ? { zoom: t.zoom } : {}
2791
2795
  };
2792
2796
  }
2793
- function Jo(e, t, n) {
2794
- const r = po(e, t);
2795
- return Te(e) ? Zo(
2797
+ function oa(e, t, n) {
2798
+ const r = $t(e, t);
2799
+ return Te(e) ? ra(
2796
2800
  { ...r, filters: n },
2797
2801
  e.type,
2798
2802
  // A data variable's card keeps its own period comparison (P3b-03).
2799
- { keepsPeriodComparison: Gr(e) }
2803
+ { keepsPeriodComparison: Jr(e) }
2800
2804
  ) : r;
2801
2805
  }
2802
- function Yo(e) {
2803
- const t = cr(e);
2806
+ function ia(e) {
2807
+ const t = pr(e);
2804
2808
  return {
2805
2809
  contextMode: t,
2806
2810
  shouldApplyDashboardFilters: !t || t === "full"
2807
2811
  };
2808
2812
  }
2809
- function Xo(e) {
2813
+ function aa(e) {
2810
2814
  const t = e.dashboardControls || [], n = e.card.controls || [], r = /* @__PURE__ */ new Set([
2811
- ...t.map((i) => i.id),
2812
- ...n.map((i) => i.id)
2815
+ ...t.map((o) => o.id),
2816
+ ...n.map((o) => o.id)
2813
2817
  ]);
2814
- return fn(
2818
+ return gn(
2815
2819
  e.card,
2816
2820
  {
2817
- controlValues: bt({
2821
+ controlValues: Ct({
2818
2822
  relevantControlIds: r,
2819
2823
  dashboardValues: e.dashboardControlValues,
2820
2824
  cardValues: e.cardControlValues
@@ -2826,17 +2830,17 @@ function Xo(e) {
2826
2830
  e.presentationControlIds
2827
2831
  );
2828
2832
  }
2829
- function fn(e, t, n) {
2830
- const i = t.controlBindings.filter(
2833
+ function gn(e, t, n) {
2834
+ const o = t.controlBindings.filter(
2831
2835
  (f) => !de(f)
2832
- ), o = new Set(
2836
+ ), i = new Set(
2833
2837
  Ae({
2834
2838
  sql: e.sql,
2835
- controlBindings: i
2839
+ controlBindings: o
2836
2840
  })
2837
2841
  ), a = new Set(
2838
2842
  [...n].filter(
2839
- (f) => !o.has(f)
2843
+ (f) => !i.has(f)
2840
2844
  )
2841
2845
  ), s = t.controlDefinitions.filter(
2842
2846
  (f) => !a.has(f.id)
@@ -2845,11 +2849,11 @@ function fn(e, t, n) {
2845
2849
  ), c = /* @__PURE__ */ new Set([
2846
2850
  ...s.map((f) => f.id),
2847
2851
  ...l.map((f) => f.id)
2848
- ]), d = i.filter(
2852
+ ]), d = o.filter(
2849
2853
  (f) => c.has(f.controlId)
2850
2854
  );
2851
2855
  return {
2852
- controlValues: bt({
2856
+ controlValues: Ct({
2853
2857
  relevantControlIds: c,
2854
2858
  dashboardValues: t.controlValues
2855
2859
  }),
@@ -2858,15 +2862,15 @@ function fn(e, t, n) {
2858
2862
  controlBindings: d
2859
2863
  };
2860
2864
  }
2861
- function ea(e, t) {
2865
+ function sa(e, t) {
2862
2866
  return !!t && e.endsWith(t);
2863
2867
  }
2864
- function pn(e, t) {
2868
+ function yn(e, t) {
2865
2869
  return (e ?? []).filter(
2866
- (n) => ea(n.filterId, t)
2870
+ (n) => sa(n.filterId, t)
2867
2871
  );
2868
2872
  }
2869
- function mn(e, t, n) {
2873
+ function bn(e, t, n) {
2870
2874
  var r;
2871
2875
  if (t)
2872
2876
  return {
@@ -2875,18 +2879,18 @@ function mn(e, t, n) {
2875
2879
  ...n ? { owner: n } : {}
2876
2880
  };
2877
2881
  }
2878
- function ta(e) {
2882
+ function la(e) {
2879
2883
  if (e.resolution.status === "resolved")
2880
- return mn(
2884
+ return bn(
2881
2885
  e.card,
2882
2886
  e.resolution.resolvedOwner.selection,
2883
2887
  e.resolution.resolvedOwner.owner
2884
2888
  );
2885
2889
  }
2886
- function na(e) {
2890
+ function ca(e) {
2887
2891
  return `Set ${e.join(", ")} to run this card.`;
2888
2892
  }
2889
- function ra({
2893
+ function da({
2890
2894
  dashboardInputContext: e,
2891
2895
  shouldApplyDashboardFilters: t
2892
2896
  }) {
@@ -2894,36 +2898,36 @@ function ra({
2894
2898
  return e.activeFilters;
2895
2899
  const n = new Set(
2896
2900
  e.inputs.flatMap(
2897
- (r) => r.kind === "filter" && kt(r) ? [r.filter.id] : []
2901
+ (r) => r.kind === "filter" && Pt(r) ? [r.filter.id] : []
2898
2902
  )
2899
2903
  );
2900
2904
  return e.activeFilters.filter(
2901
2905
  (r) => n.has(r.filterId)
2902
2906
  );
2903
2907
  }
2904
- function ia({
2908
+ function ua({
2905
2909
  dashboardInputFilterValues: e,
2906
2910
  adHocFilterValues: t
2907
2911
  }) {
2908
2912
  const n = [...e], r = new Set(
2909
- n.map((i) => i.filterId)
2913
+ n.map((o) => o.filterId)
2910
2914
  );
2911
- for (const i of t)
2912
- r.has(i.filterId) || (n.push(i), r.add(i.filterId));
2915
+ for (const o of t)
2916
+ r.has(o.filterId) || (n.push(o), r.add(o.filterId));
2913
2917
  return n;
2914
2918
  }
2915
2919
  function ce(e, t) {
2916
- const n = t.shouldApplyDashboardFilters ? pn(t.adHocFilterValues, t.selectedSheetId) : [], r = t.selectionFilterValues ?? [];
2920
+ const n = t.shouldApplyDashboardFilters ? yn(t.adHocFilterValues, t.selectedSheetId) : [], r = t.selectionFilterValues ?? [];
2917
2921
  if (!t.dashboardInputContext)
2918
2922
  return {
2919
2923
  status: "ready",
2920
2924
  filterValues: [...n, ...t.inlineFilterValues, ...r],
2921
2925
  mappingDispositions: []
2922
2926
  };
2923
- const i = t.dashboardInputContext.inputs.filter(
2927
+ const o = t.dashboardInputContext.inputs.filter(
2924
2928
  (u) => u.kind === "filter" && !!u.application
2925
- ), o = new Set(
2926
- i.map((u) => u.filter.id)
2929
+ ), i = new Set(
2930
+ o.map((u) => u.filter.id)
2927
2931
  ), a = new Set(
2928
2932
  t.dashboardInputContext.inputs.flatMap(
2929
2933
  (u) => {
@@ -2931,16 +2935,16 @@ function ce(e, t) {
2931
2935
  return u.kind === "filter" && ((f = u.compatibility) == null ? void 0 : f.source) === "cardInlineFilter" ? [u.filter.id] : [];
2932
2936
  }
2933
2937
  )
2934
- ), s = ra({
2938
+ ), s = da({
2935
2939
  dashboardInputContext: t.dashboardInputContext,
2936
2940
  shouldApplyDashboardFilters: t.shouldApplyDashboardFilters
2937
- }).filter((u) => !o.has(u.filterId)), l = s.filter(
2941
+ }).filter((u) => !i.has(u.filterId)), l = s.filter(
2938
2942
  (u) => !a.has(u.filterId)
2939
2943
  ), c = s.filter(
2940
2944
  (u) => a.has(u.filterId)
2941
- ), d = dr({
2945
+ ), d = mr({
2942
2946
  card: e,
2943
- inputs: i,
2947
+ inputs: o,
2944
2948
  resolvedInputs: t.dashboardInputContext.resolvedInputs,
2945
2949
  activeFilterValues: t.dashboardInputContext.activeFilters,
2946
2950
  shouldApplyDashboardFilters: t.shouldApplyDashboardFilters
@@ -2951,7 +2955,7 @@ function ce(e, t) {
2951
2955
  } : {
2952
2956
  status: "ready",
2953
2957
  filterValues: [
2954
- ...ia({
2958
+ ...ua({
2955
2959
  dashboardInputFilterValues: [
2956
2960
  ...l,
2957
2961
  ...d.filterValues
@@ -2964,34 +2968,34 @@ function ce(e, t) {
2964
2968
  mappingDispositions: d.dispositions
2965
2969
  };
2966
2970
  }
2967
- function oa(e, t) {
2971
+ function fa(e, t) {
2968
2972
  const n = e.dashboardInputContext;
2969
2973
  if (!n) return [];
2970
2974
  const r = new Set(
2971
2975
  t.flatMap(
2972
- (o) => o.status === "skip" && (o.reason === "explicitlyExcluded" || o.reason === "outsideScope") ? [o.inputId] : []
2976
+ (i) => i.status === "skip" && (i.reason === "explicitlyExcluded" || i.reason === "outsideScope") ? [i.inputId] : []
2973
2977
  )
2974
- ), i = new Map(n.inputs.map((o) => [o.id, o]));
2975
- return n.resolvedInputs.flatMap((o) => {
2976
- if (!o.missingRequiredValue) return [];
2977
- const a = i.get(o.id);
2978
- return a ? a.kind === "filter" && (!e.shouldApplyDashboardFilters && !kt(a) || r.has(a.id)) ? [] : [o.label] : [];
2978
+ ), o = new Map(n.inputs.map((i) => [i.id, i]));
2979
+ return n.resolvedInputs.flatMap((i) => {
2980
+ if (!i.missingRequiredValue) return [];
2981
+ const a = o.get(i.id);
2982
+ return a ? a.kind === "filter" && (!e.shouldApplyDashboardFilters && !Pt(a) || r.has(a.id)) ? [] : [i.label] : [];
2979
2983
  });
2980
2984
  }
2981
- function aa({
2985
+ function pa({
2982
2986
  card: e,
2983
2987
  cardConfig: t,
2984
2988
  input: n,
2985
2989
  resolvedPrimaryDateField: r,
2986
- resolvedFields: i,
2987
- semanticExecutionPayload: o,
2990
+ resolvedFields: o,
2991
+ semanticExecutionPayload: i,
2988
2992
  timezone: a,
2989
2993
  allowMinutePrecision: s
2990
2994
  }) {
2991
2995
  var p;
2992
2996
  const l = n.dashboardInputContext ? n.dashboardInputContext.inputs.flatMap(
2993
2997
  (b) => b.kind === "filter" ? [b.filter] : []
2994
- ) : [], c = ce(e, n), d = oa(
2998
+ ) : [], c = ce(e, n), d = fa(
2995
2999
  n,
2996
3000
  c.mappingDispositions
2997
3001
  );
@@ -3011,14 +3015,14 @@ function aa({
3011
3015
  mappingDispositions: c.mappingDispositions,
3012
3016
  missingRequiredLabels: []
3013
3017
  };
3014
- const u = Ho({
3018
+ const u = Yi({
3015
3019
  card: e,
3016
3020
  cardConfig: t,
3017
3021
  filters: l,
3018
3022
  cardFilterValues: c.filterValues,
3019
3023
  resolvedPrimaryDateField: r,
3020
- resolvedFields: i,
3021
- semanticExecutionPayload: o,
3024
+ resolvedFields: o,
3025
+ semanticExecutionPayload: i,
3022
3026
  timezone: a,
3023
3027
  allowMinutePrecision: s,
3024
3028
  dateComparisonInputs: n.dateComparisonInputs,
@@ -3029,10 +3033,10 @@ function aa({
3029
3033
  )
3030
3034
  }), f = L(l), m = !!(f && u.cardFilterValues.some(
3031
3035
  (b) => b.filterId === f.id
3032
- )), y = u.resolvedPrimaryDateField && !((p = e.sql) != null && p.trim()) ? u.dateComparisonPlan.inputs.length ? ta({
3036
+ )), y = u.resolvedPrimaryDateField && !((p = e.sql) != null && p.trim()) ? u.dateComparisonPlan.inputs.length ? la({
3033
3037
  card: e,
3034
3038
  resolution: u.dateComparisonPlan.resolution
3035
- }) : m ? mn(
3039
+ }) : m ? bn(
3036
3040
  e,
3037
3041
  n.globalDateComparisonSelection
3038
3042
  ) : void 0 : void 0;
@@ -3044,13 +3048,13 @@ function aa({
3044
3048
  mappingDispositions: c.mappingDispositions
3045
3049
  };
3046
3050
  }
3047
- function sa({
3051
+ function ma({
3048
3052
  card: e,
3049
3053
  dashboard: t,
3050
3054
  transientContexts: n,
3051
3055
  cardViewState: r,
3052
- viewerTableSettings: i,
3053
- adHocFilterValues: o,
3056
+ viewerTableSettings: o,
3057
+ adHocFilterValues: i,
3054
3058
  selectedSheetId: a,
3055
3059
  inlineFilterValuesMap: s,
3056
3060
  dashboardControls: l,
@@ -3059,18 +3063,18 @@ function sa({
3059
3063
  dashboardInputContext: u,
3060
3064
  includeAuthoredFilters: f
3061
3065
  }) {
3062
- var R, K, Y;
3063
- const m = jt(t);
3066
+ var K, Y, Le, Ke;
3067
+ const m = Lt(t);
3064
3068
  for (const q of e.controlBindings || [])
3065
3069
  de(q) && m.add(q.controlId);
3066
- const { shouldApplyDashboardFilters: y } = Yo(n), p = u != null && u.inputs.length ? u : void 0, b = ((u == null ? void 0 : u.selections) ?? []).filter(
3070
+ const { shouldApplyDashboardFilters: y } = ia(n), p = u != null && u.inputs.length ? u : void 0, b = ((u == null ? void 0 : u.selections) ?? []).filter(
3067
3071
  (q) => q.status === "apply"
3068
- ), I = un(e, {
3072
+ ), I = mn(e, {
3069
3073
  includeAuthoredFilters: f,
3070
3074
  selections: b,
3071
3075
  drill: r == null ? void 0 : r.drill
3072
3076
  }), C = {
3073
- adHocFilterValues: o || [],
3077
+ adHocFilterValues: i || [],
3074
3078
  selectedSheetId: a,
3075
3079
  inlineFilterValues: (s == null ? void 0 : s[e.id]) || [],
3076
3080
  // Outside the input-context gate: a dashboard whose only input is a
@@ -3090,25 +3094,33 @@ function sa({
3090
3094
  ...p != null && p.dateComparisonInputs ? {
3091
3095
  dateComparisonInputs: p.dateComparisonInputs
3092
3096
  } : {}
3093
- }, h = ce(e, C), D = {
3097
+ }, h = ce(e, C), S = {
3094
3098
  filterValues: h.status === "ready" ? h.filterValues : [],
3095
3099
  selectionFilters: I.selections
3096
- }, g = tt(D), V = ho(r == null ? void 0 : r.zoom, (R = e.config) == null ? void 0 : R.groupByColumns, g), P = V ? { ...I, zoom: V.filterGroup } : I, x = V ? tt({ ...D, zoom: V.zoom }) : g, v = dn(P), S = f === !1 ? me(v, !0) : v, M = Jo(
3100
+ }, g = rt(S), V = Mi(r == null ? void 0 : r.zoom, (K = e.config) == null ? void 0 : K.groupByColumns, g), P = gr(
3101
+ hi(e, r == null ? void 0 : r.drill),
3102
+ (Y = r == null ? void 0 : r.search) == null ? void 0 : Y.text,
3103
+ o
3104
+ ), x = {
3105
+ ...I,
3106
+ ...V ? { zoom: V.filterGroup } : {},
3107
+ ...P ? { search: P } : {}
3108
+ }, v = V ? rt({ ...S, zoom: V.zoom }) : g, T = pn(x), M = f === !1 ? me(T, !0) : T, k = oa(
3097
3109
  e,
3098
3110
  r == null ? void 0 : r.drill,
3099
- S
3100
- ), k = Io(M, r == null ? void 0 : r.grainPick, {
3101
- currentFingerprint: x,
3102
- drillActive: (((K = r == null ? void 0 : r.drill) == null ? void 0 : K.steps.length) ?? 0) > 0
3103
- }), F = ur({ ...e, config: k }, i) ?? k, T = Et(F, {
3111
+ M
3112
+ ), F = Ti(k, r == null ? void 0 : r.grainPick, {
3113
+ currentFingerprint: v,
3114
+ drillActive: (((Le = r == null ? void 0 : r.drill) == null ? void 0 : Le.steps.length) ?? 0) > 0
3115
+ }), D = yr({ ...e, config: F }, o) ?? F, w = qt(D, {
3104
3116
  cardType: e.type,
3105
3117
  dataSource: e.dataSource,
3106
- temporalResultOwner: It({
3107
- hasExecutableConfig: ue(F, e.type),
3118
+ temporalResultOwner: ht({
3119
+ hasExecutableConfig: ue(D, e.type),
3108
3120
  sql: e.sql,
3109
3121
  normalizedPython: Me(e.python || "")
3110
3122
  })
3111
- }) || F, w = Wo(S) || "", E = p ? fn(
3123
+ }) || D, E = na(M) || "", R = p ? gn(
3112
3124
  e,
3113
3125
  {
3114
3126
  controlValues: p.controlValues,
@@ -3117,7 +3129,7 @@ function sa({
3117
3129
  controlBindings: p.controlBindings
3118
3130
  },
3119
3131
  m
3120
- ) : Xo({
3132
+ ) : aa({
3121
3133
  card: e,
3122
3134
  presentationControlIds: m,
3123
3135
  dashboardControls: l,
@@ -3126,20 +3138,20 @@ function sa({
3126
3138
  });
3127
3139
  return {
3128
3140
  filterCompilationInput: C,
3129
- ...E,
3130
- resolvedFilters: S,
3131
- resolvedFilterParts: P,
3132
- drillSteps: ((Y = r == null ? void 0 : r.drill) == null ? void 0 : Y.steps) ?? fr,
3133
- dateContextKey: x,
3141
+ ...R,
3142
+ resolvedFilters: M,
3143
+ resolvedFilterParts: x,
3144
+ drillSteps: ((Ke = r == null ? void 0 : r.drill) == null ? void 0 : Ke.steps) ?? br,
3145
+ dateContextKey: v,
3134
3146
  zoomContextKey: g,
3135
3147
  ...V ? { activeZoom: V.zoom } : {},
3136
- finalConfig: F,
3137
- queryRelevantConfig: T,
3138
- finalFiltersKey: w
3148
+ finalConfig: D,
3149
+ queryRelevantConfig: w,
3150
+ finalFiltersKey: E
3139
3151
  };
3140
3152
  }
3141
- function gn(e, t, n) {
3142
- const r = aa({
3153
+ function In(e, t, n) {
3154
+ const r = pa({
3143
3155
  resolvedFields: t.resolvedDateFields,
3144
3156
  ...n,
3145
3157
  card: e,
@@ -3147,35 +3159,35 @@ function gn(e, t, n) {
3147
3159
  input: t.filterCompilationInput
3148
3160
  });
3149
3161
  if (r.status === "blocked") return r;
3150
- const { filterCompilationInput: i, ...o } = t;
3162
+ const { filterCompilationInput: o, ...i } = t;
3151
3163
  return { status: "ready", queryContext: {
3152
- ...o,
3164
+ ...i,
3153
3165
  cardFilterValues: r.cardFilterValues,
3154
3166
  queryFilterDefinitions: r.queryFilterDefinitions,
3155
3167
  resolvedPrimaryDateField: r.resolvedPrimaryDateField,
3156
3168
  globalDateComparison: r.globalDateComparison,
3157
- globalDateComparisonSelection: i.globalDateComparisonSelection,
3158
- dateComparisonInputs: i.dateComparisonInputs
3169
+ globalDateComparisonSelection: o.globalDateComparisonSelection,
3170
+ dateComparisonInputs: o.dateComparisonInputs
3159
3171
  }, compiledFilters: r };
3160
3172
  }
3161
- function la(e, t, n) {
3162
- const r = pr(e), i = gn(e, t, {
3173
+ function ga(e, t, n) {
3174
+ const r = Ir(e), o = In(e, t, {
3163
3175
  resolvedPrimaryDateField: n.resolvedPrimaryDateField,
3164
3176
  timezone: n.calendarContext.tz,
3165
3177
  allowMinutePrecision: n.allowGlobalDateMinutePrecision
3166
3178
  });
3167
- if (i.status === "blocked")
3168
- return { ...i, tableConfig: r };
3169
- const { compiledFilters: o } = i, {
3179
+ if (o.status === "blocked")
3180
+ return { ...o, tableConfig: r };
3181
+ const { compiledFilters: i } = o, {
3170
3182
  cardFilterValues: a,
3171
3183
  resolvedPrimaryDateField: s,
3172
3184
  globalDateComparison: l
3173
- } = o, { queryKey: c, queryInputIdentity: d, paginationConfig: u } = Yi(
3185
+ } = i, { queryKey: c, queryInputIdentity: d, paginationConfig: u } = ai(
3174
3186
  e,
3175
- i.queryContext,
3187
+ o.queryContext,
3176
3188
  n.calendarContext,
3177
3189
  { resolvePaginationConfig: n.resolvePaginationConfig }
3178
- ), f = t.queryRelevantConfig, m = Me(e.python || ""), y = It({
3190
+ ), f = t.queryRelevantConfig, m = Me(e.python || ""), y = ht({
3179
3191
  hasExecutableConfig: ue(f, e.type),
3180
3192
  sql: e.sql,
3181
3193
  normalizedPython: m
@@ -3186,7 +3198,7 @@ function la(e, t, n) {
3186
3198
  queryInputIdentity: d,
3187
3199
  paginationConfig: u,
3188
3200
  tableConfig: r,
3189
- compiledFilters: o,
3201
+ compiledFilters: i,
3190
3202
  requestPayloadBase: {
3191
3203
  cardId: e.id,
3192
3204
  sql: (e == null ? void 0 : e.sql) || "",
@@ -3211,25 +3223,25 @@ function la(e, t, n) {
3211
3223
  }
3212
3224
  };
3213
3225
  }
3214
- const at = [], ca = [], da = {};
3215
- function Ts(e, t) {
3226
+ const lt = [], ya = [], ba = {};
3227
+ function Os(e, t) {
3216
3228
  return {
3217
3229
  sheetId: e.sheetId,
3218
3230
  sectionId: e.sectionId,
3219
- documentFilterValues: e.documentFilterValues ?? at,
3220
- documentControlDefinitions: e.documentControlDefinitions ?? ca,
3221
- documentControlValues: e.documentControlValues ?? da,
3222
- editorFilterValues: t ?? at
3231
+ documentFilterValues: e.documentFilterValues ?? lt,
3232
+ documentControlDefinitions: e.documentControlDefinitions ?? ya,
3233
+ documentControlValues: e.documentControlValues ?? ba,
3234
+ editorFilterValues: t ?? lt
3223
3235
  };
3224
3236
  }
3225
- function ua({
3237
+ function Ia({
3226
3238
  card: e,
3227
3239
  dashboard: t,
3228
3240
  runtime: n,
3229
3241
  dashboardRuntimeValues: r,
3230
- calendar: i
3242
+ calendar: o
3231
3243
  }) {
3232
- const o = Ct({
3244
+ const i = vt({
3233
3245
  dashboard: t,
3234
3246
  dashboardInputValues: r.dashboardInputValues,
3235
3247
  transientContexts: void 0
@@ -3244,13 +3256,13 @@ function ua({
3244
3256
  ...r,
3245
3257
  dashboardInputValues: n.documentDashboardInputValues || r.dashboardInputValues
3246
3258
  },
3247
- calendar: i
3248
- }) : void 0, a = o && (o.inputs.length > 0 || o.selections.length > 0) ? o : void 0, s = !!(o != null && o.inputs.length), l = [
3259
+ calendar: o
3260
+ }) : void 0, a = i && (i.inputs.length > 0 || i.selections.length > 0) ? i : void 0, s = !!(i != null && i.inputs.length), l = [
3249
3261
  ...n.editorFilterValues || [],
3250
3262
  ...n.documentFilterValues
3251
3263
  ];
3252
3264
  return {
3253
- card: s ? e : fa(
3265
+ card: s ? e : Ca(
3254
3266
  e,
3255
3267
  n.documentControlDefinitions
3256
3268
  ),
@@ -3268,7 +3280,7 @@ function ua({
3268
3280
  dashboardInputContext: a
3269
3281
  };
3270
3282
  }
3271
- function fa(e, t) {
3283
+ function Ca(e, t) {
3272
3284
  if (t.length === 0)
3273
3285
  return e;
3274
3286
  const n = /* @__PURE__ */ new Map();
@@ -3281,7 +3293,7 @@ function fa(e, t) {
3281
3293
  controls: Array.from(n.values())
3282
3294
  };
3283
3295
  }
3284
- function Vs({
3296
+ function _s({
3285
3297
  card: e,
3286
3298
  place: t,
3287
3299
  source: n
@@ -3293,9 +3305,9 @@ function Vs({
3293
3305
  inputContext: r.inputContext
3294
3306
  };
3295
3307
  }
3296
- function pa(e, t, n) {
3308
+ function ha(e, t, n) {
3297
3309
  return {
3298
- calendarContext: n ?? $r,
3310
+ calendarContext: n ?? to,
3299
3311
  allowGlobalDateMinutePrecision: we(
3300
3312
  e,
3301
3313
  t
@@ -3304,17 +3316,17 @@ function pa(e, t, n) {
3304
3316
  globalCacheConfig: e.globalCacheConfig
3305
3317
  };
3306
3318
  }
3307
- function Ms(e, t) {
3308
- return In(
3319
+ function As(e, t) {
3320
+ return vn(
3309
3321
  e,
3310
3322
  t,
3311
3323
  t.allowGlobalDateMinutePrecision
3312
3324
  );
3313
3325
  }
3314
- function ma(e, t, n = {}) {
3315
- const r = bn(e, t);
3326
+ function va(e, t, n = {}) {
3327
+ const r = hn(e, t);
3316
3328
  return {
3317
- ...la(e.card, e.context, {
3329
+ ...ga(e.card, e.context, {
3318
3330
  resolvedPrimaryDateField: r,
3319
3331
  calendarContext: t.calendarContext,
3320
3332
  allowGlobalDateMinutePrecision: t.allowGlobalDateMinutePrecision,
@@ -3324,17 +3336,17 @@ function ma(e, t, n = {}) {
3324
3336
  resolvedPrimaryDateField: r
3325
3337
  };
3326
3338
  }
3327
- function ga({
3339
+ function Fa({
3328
3340
  card: e,
3329
3341
  place: t,
3330
3342
  source: n,
3331
3343
  semanticExecutionPayload: r,
3332
- matrixCatalog: i,
3333
- withRequest: o = !1
3344
+ matrixCatalog: o,
3345
+ withRequest: i = !1
3334
3346
  }) {
3335
3347
  var p, b;
3336
3348
  const { dashboard: a } = n, s = e.id, l = (I, C) => {
3337
- var D;
3349
+ var S;
3338
3350
  let h;
3339
3351
  try {
3340
3352
  const g = Ve(I);
@@ -3347,21 +3359,21 @@ function ga({
3347
3359
  );
3348
3360
  if (h = V.context, g.status === "absent")
3349
3361
  return { status: "ready", value: { assembled: V } };
3350
- if (!i)
3362
+ if (!o)
3351
3363
  return {
3352
3364
  status: "blocked",
3353
3365
  reason: "metadata",
3354
3366
  message: "Matrix field metadata is required.",
3355
3367
  context: h
3356
3368
  };
3357
- const P = fo(g.config.spec, h), x = i.filter(
3358
- (T) => T.field.source && P.some(
3359
- (w) => Ce(w, T.field.source)
3369
+ const P = Ci(g.config.spec, h), x = o.filter(
3370
+ (D) => D.field.source && P.some(
3371
+ (w) => Ce(w, D.field.source)
3360
3372
  )
3361
- ), v = Qo(I, x, h), { params: S } = V, M = S.dashboardInputContext;
3373
+ ), v = ea(I, x, h), { params: T } = V, M = T.dashboardInputContext;
3362
3374
  v.config = {
3363
3375
  ...v.config,
3364
- presentation: Ri(
3376
+ presentation: Ho(
3365
3377
  I,
3366
3378
  v.config,
3367
3379
  {
@@ -3369,12 +3381,12 @@ function ga({
3369
3381
  ...M.controlDefinitions,
3370
3382
  ...M.cardControlDefinitions
3371
3383
  ] : [
3372
- ...S.dashboardControls ?? a.controls ?? [],
3373
- ...S.card.controls ?? []
3384
+ ...T.dashboardControls ?? a.controls ?? [],
3385
+ ...T.card.controls ?? []
3374
3386
  ],
3375
3387
  values: (M == null ? void 0 : M.controlValues) ?? {
3376
- ...S.dashboardControlValues,
3377
- ...(D = S.cardControlValuesMap) == null ? void 0 : D[I.id]
3388
+ ...T.dashboardControlValues,
3389
+ ...(S = T.cardControlValuesMap) == null ? void 0 : S[I.id]
3378
3390
  }
3379
3391
  },
3380
3392
  x
@@ -3413,44 +3425,44 @@ function ga({
3413
3425
  missingRequiredLabels: [],
3414
3426
  message: c.message
3415
3427
  };
3416
- const { assembled: d, matrix: u } = c.value, f = pa(
3428
+ const { assembled: d, matrix: u } = c.value, f = ha(
3417
3429
  a,
3418
3430
  r,
3419
3431
  n.calendar
3420
- ), m = d.context.filterCompilationInput, y = gr(a);
3432
+ ), m = d.context.filterCompilationInput, y = Cr(a);
3421
3433
  try {
3422
3434
  const I = ce(d.card, m), C = u && y && I.status === "ready" && I.filterValues.some((V) => V.filterId === y.id);
3423
3435
  let h = f.allowGlobalDateMinutePrecision;
3424
3436
  if (C) {
3425
3437
  const V = (p = m.dashboardInputContext) == null ? void 0 : p.inputs.find(
3426
3438
  (F) => F.kind === "filter" && F.filter.id === y.id
3427
- ), x = yr(a, y).filter(
3428
- ({ card: F, sheet: T }) => !V || Hr(V, {
3439
+ ), x = hr(a, y).filter(
3440
+ ({ card: F, sheet: D }) => !V || Yr(V, {
3429
3441
  cardId: F.id,
3430
- sheetId: T.id,
3431
- sheetKind: ht(T) ? "document" : "dashboard"
3442
+ sheetId: D.id,
3443
+ sheetKind: Ft(D) ? "document" : "dashboard"
3432
3444
  })
3433
- ).map(({ card: F, sheet: T }) => ({
3445
+ ).map(({ card: F, sheet: D }) => ({
3434
3446
  card: F,
3435
- value: F.id === s ? c : l(F, { kind: "sheet", sheetId: T.id })
3447
+ value: F.id === s ? c : l(F, { kind: "sheet", sheetId: D.id })
3436
3448
  })), v = new Map(
3437
- x.map(({ card: F, value: T }) => [
3449
+ x.map(({ card: F, value: D }) => [
3438
3450
  F.id,
3439
- T.status === "ready" ? T.value.assembled.card : null
3451
+ D.status === "ready" ? D.value.assembled.card : null
3440
3452
  ])
3441
- ), S = new Map(
3442
- x.map(({ card: F, value: T }) => {
3453
+ ), T = new Map(
3454
+ x.map(({ card: F, value: D }) => {
3443
3455
  var w;
3444
3456
  return [
3445
3457
  F.id,
3446
- T.status === "ready" ? (w = T.value.matrix) == null ? void 0 : w.fields : void 0
3458
+ D.status === "ready" ? (w = D.value.matrix) == null ? void 0 : w.fields : void 0
3447
3459
  ];
3448
3460
  })
3449
3461
  ), M = x.flatMap(
3450
- ({ card: F, value: T }) => {
3451
- const w = F.id, E = T.status === "ready" ? T.value.assembled.context : T.context;
3462
+ ({ card: F, value: D }) => {
3463
+ const w = F.id, E = D.status === "ready" ? D.value.assembled.context : D.context;
3452
3464
  if (!E) return [w];
3453
- const R = T.status === "ready" ? T.value.assembled.card : F;
3465
+ const R = D.status === "ready" ? D.value.assembled.card : F;
3454
3466
  try {
3455
3467
  const K = ce(
3456
3468
  R,
@@ -3466,7 +3478,7 @@ function ga({
3466
3478
  r,
3467
3479
  y,
3468
3480
  v,
3469
- S,
3481
+ T,
3470
3482
  M
3471
3483
  );
3472
3484
  if ((b = k.unresolvedCardIds) != null && b.length)
@@ -3480,20 +3492,20 @@ function ga({
3480
3492
  };
3481
3493
  h = k.allEligibleTargetsAreDateTime;
3482
3494
  }
3483
- const D = In(d, f, h);
3484
- if (D.status === "blocked")
3495
+ const S = vn(d, f, h);
3496
+ if (S.status === "blocked")
3485
3497
  return {
3486
3498
  status: "blocked",
3487
- cardId: D.cardId,
3488
- mappingDispositions: D.mappingDispositions,
3489
- reason: D.reason,
3490
- missingRequiredLabels: D.missingRequiredLabels,
3491
- ...D.reason === "requiredInput" ? { message: na(D.missingRequiredLabels) } : {},
3492
- ...D.resolvedPrimaryDateField ? { resolvedPrimaryDateField: D.resolvedPrimaryDateField } : {}
3499
+ cardId: S.cardId,
3500
+ mappingDispositions: S.mappingDispositions,
3501
+ reason: S.reason,
3502
+ missingRequiredLabels: S.missingRequiredLabels,
3503
+ ...S.reason === "requiredInput" ? { message: ca(S.missingRequiredLabels) } : {},
3504
+ ...S.resolvedPrimaryDateField ? { resolvedPrimaryDateField: S.resolvedPrimaryDateField } : {}
3493
3505
  };
3494
- const g = o && !u ? ma(d, f) : void 0;
3506
+ const g = i && !u ? va(d, f) : void 0;
3495
3507
  return {
3496
- ...D,
3508
+ ...S,
3497
3509
  ...u ? { matrix: u } : {},
3498
3510
  // The whole request a card runs with: the contract's payload and its
3499
3511
  // extras (server pagination, table totals) from the one extras owner,
@@ -3501,11 +3513,11 @@ function ga({
3501
3513
  ...(g == null ? void 0 : g.status) === "ready" ? {
3502
3514
  request: {
3503
3515
  ...g.requestPayloadBase,
3504
- ...oo({
3516
+ ...pi({
3505
3517
  card: d.card,
3506
3518
  finalConfig: d.context.finalConfig,
3507
3519
  documentSection: t.kind === "documentSection" ? {} : void 0,
3508
- page: io(d.card)
3520
+ page: fi(d.card)
3509
3521
  })
3510
3522
  }
3511
3523
  } : {}
@@ -3521,55 +3533,55 @@ function ga({
3521
3533
  };
3522
3534
  }
3523
3535
  }
3524
- function ya(e) {
3525
- const t = e.editor ? {
3536
+ function Da(e, t) {
3537
+ const n = e.editor ? {
3526
3538
  ...e.inlineFilterValuesMap,
3527
3539
  ...Object.fromEntries(
3528
3540
  Object.entries(e.editor.inlineFilterValuesMap).filter(
3529
- (n) => n[1] !== void 0
3541
+ (a) => a[1] !== void 0
3530
3542
  )
3531
3543
  )
3532
- } : e.inlineFilterValuesMap;
3544
+ } : e.inlineFilterValuesMap, r = n == null ? void 0 : n[t.id], o = vr(t, r), i = o === r ? n : { ...n, [t.id]: o };
3533
3545
  return {
3534
3546
  dashboardInputValues: e.dashboardInputValues,
3535
3547
  adHocFilterValues: e.adHocFilterValues,
3536
3548
  controlValues: e.controlValues,
3537
- inlineFilterValuesMap: t,
3549
+ inlineFilterValuesMap: i,
3538
3550
  cardControlValuesMap: e.cardControlValuesMap
3539
3551
  };
3540
3552
  }
3541
3553
  function Se(e, t, n, r) {
3542
3554
  var c, d;
3543
- const { dashboard: i } = n, o = ya(n), a = t.kind === "documentSection" ? {
3544
- ...ua({
3555
+ const { dashboard: o } = n, i = Da(n, e), a = t.kind === "documentSection" ? {
3556
+ ...Ia({
3545
3557
  card: e,
3546
- dashboard: i,
3558
+ dashboard: o,
3547
3559
  runtime: t.section,
3548
- dashboardRuntimeValues: o,
3560
+ dashboardRuntimeValues: i,
3549
3561
  calendar: n.calendar
3550
3562
  }),
3551
3563
  selectedSheetId: t.section.sheetId,
3552
3564
  includeAuthoredFilters: r
3553
- } : ba(e, t.sheetId, n, o, r), s = sa(a), l = (c = e.config) == null ? void 0 : c.rowLimit;
3554
- return (d = e.sql) != null && d.trim() && l && yn(i, e.id) && (s.sqlRowLimit = l), {
3565
+ } : Sa(e, t.sheetId, n, i, r), s = ma(a), l = (c = e.config) == null ? void 0 : c.rowLimit;
3566
+ return (d = e.sql) != null && d.trim() && l && Cn(o, e.id) && (s.sqlRowLimit = l), {
3555
3567
  card: a.card,
3556
3568
  params: a,
3557
3569
  context: s,
3558
3570
  inputContext: a.dashboardInputContext
3559
3571
  };
3560
3572
  }
3561
- function yn(e, t) {
3573
+ function Cn(e, t) {
3562
3574
  return (e.variables ?? []).some((n) => n.id === t);
3563
3575
  }
3564
- function ba(e, t, n, r, i) {
3576
+ function Sa(e, t, n, r, o) {
3565
3577
  var c, d, u;
3566
- const { dashboard: o } = n, a = yn(o, e.id), s = a ? void 0 : n.transientContexts, l = Ct({
3567
- dashboard: o,
3578
+ const { dashboard: i } = n, a = Cn(i, e.id), s = a ? void 0 : n.transientContexts, l = vt({
3579
+ dashboard: i,
3568
3580
  dashboardInputValues: r.dashboardInputValues,
3569
3581
  transientContexts: s
3570
3582
  }) ? Oe({
3571
3583
  transientContexts: s,
3572
- dashboard: o,
3584
+ dashboard: i,
3573
3585
  sheetId: t,
3574
3586
  card: e,
3575
3587
  runtimeValues: r,
@@ -3577,70 +3589,74 @@ function ba(e, t, n, r, i) {
3577
3589
  }) : void 0;
3578
3590
  return {
3579
3591
  card: e,
3580
- dashboard: o,
3592
+ dashboard: i,
3581
3593
  transientContexts: s,
3582
3594
  // The editor previews the card without a viewer's zoom (chart date zoom
3583
- // DZ-D1): it shows the dashboard's dates, and its save never sees one.
3584
- cardViewState: a ? void 0 : n.editor ? mr((c = n.cardViewStates) == null ? void 0 : c[e.id], null) : (d = n.cardViewStates) == null ? void 0 : d[e.id],
3595
+ // DZ-D1) or search (table column filters TCF-D10): it shows the
3596
+ // dashboard's dates and every row, and its save never sees either.
3597
+ cardViewState: a ? void 0 : n.editor ? Fr(
3598
+ Dr((c = n.cardViewStates) == null ? void 0 : c[e.id], null),
3599
+ null
3600
+ ) : (d = n.cardViewStates) == null ? void 0 : d[e.id],
3585
3601
  viewerTableSettings: n.editor || a || (u = n.viewerTableSettings) == null ? void 0 : u[e.id],
3586
3602
  adHocFilterValues: a ? [] : r.adHocFilterValues,
3587
3603
  selectedSheetId: t,
3588
3604
  inlineFilterValuesMap: r.inlineFilterValuesMap,
3589
- dashboardControls: o.controls,
3605
+ dashboardControls: i.controls,
3590
3606
  dashboardControlValues: r.controlValues,
3591
3607
  cardControlValuesMap: r.cardControlValuesMap,
3592
3608
  // Keep a selection-only context so the query has one resolved-input contract.
3593
3609
  dashboardInputContext: l && (l.inputs.length > 0 || l.selections.length > 0) ? l : void 0,
3594
- includeAuthoredFilters: i
3610
+ includeAuthoredFilters: o
3595
3611
  };
3596
3612
  }
3597
- function bn({ card: e, context: t }, n) {
3598
- return gt({
3613
+ function hn({ card: e, context: t }, n) {
3614
+ return bt({
3599
3615
  card: e,
3600
3616
  cardConfig: t.queryRelevantConfig,
3601
3617
  resolvedFields: t.resolvedDateFields,
3602
3618
  semanticExecutionPayload: n.semanticExecutionPayload
3603
3619
  });
3604
3620
  }
3605
- function In(e, t, n) {
3606
- const { card: r } = e, i = bn(e, t), o = gn(r, e.context, {
3607
- resolvedPrimaryDateField: i,
3621
+ function vn(e, t, n) {
3622
+ const { card: r } = e, o = hn(e, t), i = In(r, e.context, {
3623
+ resolvedPrimaryDateField: o,
3608
3624
  timezone: t.calendarContext.tz,
3609
3625
  allowMinutePrecision: n
3610
3626
  });
3611
- return o.status === "blocked" ? { ...o, card: r, resolvedPrimaryDateField: i } : {
3627
+ return i.status === "blocked" ? { ...i, card: r, resolvedPrimaryDateField: o } : {
3612
3628
  status: "ready",
3613
3629
  card: r,
3614
- queryContext: o.queryContext,
3615
- compiledFilters: o.compiledFilters,
3616
- resolvedPrimaryDateField: i
3630
+ queryContext: i.queryContext,
3631
+ compiledFilters: i.compiledFilters,
3632
+ resolvedPrimaryDateField: o
3617
3633
  };
3618
3634
  }
3619
- function ks({
3635
+ function Bs({
3620
3636
  dashboard: e,
3621
3637
  dashboardInputValues: t,
3622
3638
  adHocFilterValues: n,
3623
3639
  calendar: r,
3624
- selectedSheetId: i,
3625
- sheetSelection: o = "current",
3640
+ selectedSheetId: o,
3641
+ sheetSelection: i = "current",
3626
3642
  dashboardControlValues: a,
3627
3643
  cardControlValuesMap: s,
3628
3644
  semanticExecutionPayload: l,
3629
3645
  timezone: c
3630
3646
  }) {
3631
- const d = e ? [...br(e)] : void 0, u = i ?? null, f = (C) => {
3647
+ const d = e ? [...Sr(e)] : void 0, u = o ?? null, f = (C) => {
3632
3648
  var h;
3633
- return e ? ha({
3649
+ return e ? Ma({
3634
3650
  dashboard: e,
3635
3651
  runtimeValues: { dashboardInputValues: t },
3636
3652
  adHocFilterValues: n,
3637
3653
  sheetId: C,
3638
- sheetKind: ht(
3639
- (h = e.sheets) == null ? void 0 : h.find((D) => D.id === C)
3654
+ sheetKind: Ft(
3655
+ (h = e.sheets) == null ? void 0 : h.find((S) => S.id === C)
3640
3656
  ) ? "document" : "dashboard",
3641
3657
  calendar: r
3642
3658
  }) : [];
3643
- }, m = o === "all" ? Array.from(
3659
+ }, m = i === "all" ? Array.from(
3644
3660
  new Map(
3645
3661
  ((e == null ? void 0 : e.sheets) || []).flatMap(
3646
3662
  (C) => f(C.id).map(
@@ -3650,15 +3666,15 @@ function ks({
3650
3666
  ).values()
3651
3667
  ) : f(u), y = {
3652
3668
  ...a || {}
3653
- }, p = o === "all" ? j({ sheets: (e == null ? void 0 : e.sheets) || [] }) : u ? j({ sheets: (e == null ? void 0 : e.sheets) || [] }).filter(
3669
+ }, p = i === "all" ? j({ sheets: (e == null ? void 0 : e.sheets) || [] }) : u ? j({ sheets: (e == null ? void 0 : e.sheets) || [] }).filter(
3654
3670
  (C) => C.sheet.id === u
3655
3671
  ) : [];
3656
3672
  for (const C of p)
3657
3673
  Object.assign(y, (s == null ? void 0 : s[C.card.id]) || {});
3658
- const b = Ir({
3674
+ const b = Tr({
3659
3675
  filterDefinitions: d,
3660
3676
  filterValues: m
3661
- }), I = zo({
3677
+ }), I = $i({
3662
3678
  filters: d,
3663
3679
  filterValues: b,
3664
3680
  dashboard: e,
@@ -3671,13 +3687,13 @@ function ks({
3671
3687
  controlValues: y
3672
3688
  };
3673
3689
  }
3674
- function xs({
3690
+ function Es({
3675
3691
  dashboard: e,
3676
3692
  cardId: t,
3677
3693
  transientContexts: n,
3678
3694
  cardViewStates: r,
3679
- viewerTableSettings: i,
3680
- semanticExecutionPayload: o,
3695
+ viewerTableSettings: o,
3696
+ semanticExecutionPayload: i,
3681
3697
  adHocFilterValues: a,
3682
3698
  inlineFilterValuesMap: s,
3683
3699
  dashboardControlValues: l,
@@ -3691,14 +3707,14 @@ function xs({
3691
3707
  editor: b,
3692
3708
  withRequest: I
3693
3709
  }) {
3694
- var D;
3710
+ var S;
3695
3711
  if (!e)
3696
3712
  return null;
3697
- m && !Ue(e, t) && y && (e = { ...e, sheets: (D = e.sheets) == null ? void 0 : D.map((g) => g.id === y ? { ...g, cards: [...g.cards ?? [], m] } : g) });
3698
- const C = Ue(e, t);
3713
+ m && !$e(e, t) && y && (e = { ...e, sheets: (S = e.sheets) == null ? void 0 : S.map((g) => g.id === y ? { ...g, cards: [...g.cards ?? [], m] } : g) });
3714
+ const C = $e(e, t);
3699
3715
  if (!C)
3700
3716
  return null;
3701
- const h = ga({
3717
+ const h = Fa({
3702
3718
  card: m ?? C.card,
3703
3719
  place: p ? { kind: "documentSection", section: p } : { kind: "sheet", sheetId: C.sheet.id },
3704
3720
  source: {
@@ -3714,11 +3730,11 @@ function xs({
3714
3730
  dashboardInputValues: d,
3715
3731
  transientContexts: n,
3716
3732
  cardViewStates: r,
3717
- viewerTableSettings: i,
3733
+ viewerTableSettings: o,
3718
3734
  calendar: u,
3719
3735
  ...b ? { editor: b } : {}
3720
3736
  },
3721
- semanticExecutionPayload: o,
3737
+ semanticExecutionPayload: i,
3722
3738
  matrixCatalog: f,
3723
3739
  withRequest: I
3724
3740
  });
@@ -3733,94 +3749,94 @@ function xs({
3733
3749
  ...h.request ? { request: h.request } : {}
3734
3750
  };
3735
3751
  }
3736
- function Ia(e, t, n) {
3737
- const r = t === "date" && "relativeMeta" in e ? wr(e.relativeMeta) : void 0;
3752
+ function Ta(e, t, n) {
3753
+ const r = t === "date" && "relativeMeta" in e ? qr(e.relativeMeta) : void 0;
3738
3754
  if (!r) return { values: e.values };
3739
- const i = Fr(r, n ?? void 0), o = Or(String(e.operation), r);
3755
+ const o = xr(r, n ?? void 0), i = Nr(String(e.operation), r);
3740
3756
  return {
3741
- values: i && o ? _r(String(e.operation), i) : e.values,
3757
+ values: o && i ? jr(String(e.operation), o) : e.values,
3742
3758
  relativeMeta: r,
3743
3759
  ..."temporalPrecision" in e && e.temporalPrecision === "minute" ? { temporalPrecision: "minute" } : {}
3744
3760
  };
3745
3761
  }
3746
- function Ca(e, t, n) {
3747
- const r = t, i = hr(e);
3748
- return vr({
3762
+ function Va(e, t, n) {
3763
+ const r = t, o = Mr(e);
3764
+ return kr({
3749
3765
  definition: e,
3750
3766
  sourceValue: r,
3751
3767
  value: {
3752
3768
  filterId: r.filterId,
3753
3769
  name: e.column,
3754
3770
  operation: r.operation ?? e.operation,
3755
- valueType: i,
3771
+ valueType: o,
3756
3772
  dataType: e.dataType,
3757
3773
  fieldMeta: e.fieldMeta,
3758
3774
  semanticContext: e.semanticContext,
3759
- ...Ia(r, i, n)
3775
+ ...Ta(r, o, n)
3760
3776
  }
3761
3777
  });
3762
3778
  }
3763
- function Cn(e, t, n) {
3779
+ function Fn(e, t, n) {
3764
3780
  const r = A(e);
3765
- let i = {};
3766
- const o = [], a = [];
3781
+ let o = {};
3782
+ const i = [], a = [];
3767
3783
  for (const s of t ?? []) {
3768
- if (Qr(s.filterId)) {
3784
+ if (eo(s.filterId)) {
3769
3785
  a.push(s.filterId);
3770
3786
  continue;
3771
3787
  }
3772
3788
  const l = r.findFilterInput({ filterId: s.filterId }), c = l == null ? void 0 : l.input;
3773
- if (c || o.push(s), !c || c.runtimeScope === "perCard" || c.runtimeScope === "perDocumentSection") {
3789
+ if (c || i.push(s), !c || c.runtimeScope === "perCard" || c.runtimeScope === "perDocumentSection") {
3774
3790
  a.push(s.filterId);
3775
3791
  continue;
3776
3792
  }
3777
- const d = Cr(
3778
- Ca(c.filter, s, n.calendar)
3793
+ const d = Vr(
3794
+ Va(c.filter, s, n.calendar)
3779
3795
  );
3780
3796
  if (d) {
3781
3797
  if (c.runtimeScope === "shared") {
3782
- i = Ke(i, c, {}, d);
3798
+ o = He(o, c, {}, d);
3783
3799
  continue;
3784
3800
  }
3785
- for (const u of xt(e).values())
3786
- Pt(c, u) && (i = Ke(
3787
- i,
3801
+ for (const u of wt(e).values())
3802
+ Ot(c, u) && (o = He(
3803
+ o,
3788
3804
  c,
3789
3805
  { sheetId: u.sheetId },
3790
3806
  d
3791
3807
  ));
3792
3808
  }
3793
3809
  }
3794
- return { slots: i, adHocFilterValues: o, droppedFilterIds: a };
3810
+ return { slots: o, adHocFilterValues: i, droppedFilterIds: a };
3795
3811
  }
3796
- function ha(e) {
3812
+ function Ma(e) {
3797
3813
  const { dashboard: t, sheetId: n } = e, r = [];
3798
3814
  if (n)
3799
- for (const { input: i } of Dr(t, n, e.sheetKind)) {
3800
- const o = Sr({
3815
+ for (const { input: o } of Pr(t, n, e.sheetKind)) {
3816
+ const i = wr({
3801
3817
  dashboard: t,
3802
- input: i,
3818
+ input: o,
3803
3819
  runtimeValues: { dashboardInputValues: e.runtimeValues.dashboardInputValues },
3804
3820
  target: { sheetId: n },
3805
3821
  calendar: e.calendar
3806
3822
  });
3807
- o.kind === "filter" && o.filterValue && r.push(o.filterValue);
3823
+ i.kind === "filter" && i.filterValue && r.push(i.filterValue);
3808
3824
  }
3809
- return [...r, ...pn(e.adHocFilterValues, n)];
3825
+ return [...r, ...yn(e.adHocFilterValues, n)];
3810
3826
  }
3811
- function Ps(e, t) {
3827
+ function Rs(e, t) {
3812
3828
  switch (t.runtimeScope) {
3813
3829
  case "shared":
3814
3830
  return [{}];
3815
3831
  case "perSheet":
3816
- return [...xt(e).values()].filter((n) => Pt(t, n)).map((n) => ({ sheetId: n.sheetId }));
3832
+ return [...wt(e).values()].filter((n) => Ot(t, n)).map((n) => ({ sheetId: n.sheetId }));
3817
3833
  case "perCard": {
3818
3834
  const n = A(e);
3819
3835
  return [
3820
3836
  ...n.reachedCards({ inputId: t.id }).map((r) => ({ sheetId: r.sheetId, cardId: r.cardId })),
3821
3837
  // A variable holds a value at each place it is used (DV-D35).
3822
3838
  ...n.reachedVariables({ inputId: t.id }).flatMap(
3823
- (r) => r.places.map((i) => ({ sheetId: i.sheetId, cardId: r.variableId }))
3839
+ (r) => r.places.map((o) => ({ sheetId: o.sheetId, cardId: r.variableId }))
3824
3840
  )
3825
3841
  ];
3826
3842
  }
@@ -3834,36 +3850,36 @@ function Ps(e, t) {
3834
3850
  return [];
3835
3851
  }
3836
3852
  }
3837
- function st(e) {
3853
+ function ct(e) {
3838
3854
  var t;
3839
3855
  return [
3840
3856
  ...e.cards ?? [],
3841
3857
  ...(e.frames ?? []).flatMap((n) => n.cards),
3842
3858
  ...(((t = e.document) == null ? void 0 : t.sections) ?? []).flatMap(
3843
- (n) => wt(n)
3859
+ (n) => _t(n)
3844
3860
  )
3845
3861
  ];
3846
3862
  }
3847
- function va(e, t) {
3863
+ function ka(e, t) {
3848
3864
  var n, r;
3849
3865
  return {
3850
3866
  sheetId: e.id,
3851
3867
  cardId: t.id,
3852
3868
  sheetKind: e.kind ?? "dashboard",
3853
3869
  sectionId: (r = (n = e.document) == null ? void 0 : n.sections.find(
3854
- (i) => wt(i).some(({ id: o }) => o === t.id)
3870
+ (o) => _t(o).some(({ id: i }) => i === t.id)
3855
3871
  )) == null ? void 0 : r.id
3856
3872
  };
3857
3873
  }
3858
- function Fa(e, t, n, r) {
3874
+ function xa(e, t, n, r) {
3859
3875
  var c, d, u;
3860
- const i = {}, o = (c = e.preferences) == null ? void 0 : c.textVisualOptions;
3861
- if (!o) return i;
3876
+ const o = {}, i = (c = e.preferences) == null ? void 0 : c.textVisualOptions;
3877
+ if (!i) return o;
3862
3878
  const a = Oe({
3863
3879
  // Authoring: carried drill context never applies to a dashboard being edited.
3864
3880
  transientContexts: void 0,
3865
3881
  dashboard: n,
3866
- ...va(r, t),
3882
+ ...ka(r, t),
3867
3883
  card: t,
3868
3884
  runtimeValues: {},
3869
3885
  // Aliases only: no input value is read.
@@ -3875,157 +3891,158 @@ function Fa(e, t, n, r) {
3875
3891
  inputId: m.id,
3876
3892
  export: f.export ?? "label"
3877
3893
  } : f;
3878
- return m && (i[f.variableName] = y), y;
3894
+ return m && (o[f.variableName] = y), y;
3879
3895
  }, l = (f) => {
3880
- Object.assign(f, Tt(f, (m) => s(m))), f.type === "link" && [...f.children, ...Array.isArray(f.url) ? f.url : []].forEach((m) => l(m)), f.type === "when" && [...f.then ?? [], ...f.else ?? []].forEach(l);
3896
+ Object.assign(f, Mt(f, (m) => s(m))), f.type === "link" && [...f.children, ...Array.isArray(f.url) ? f.url : []].forEach((m) => l(m)), f.type === "when" && [...f.then ?? [], ...f.else ?? []].forEach(l);
3881
3897
  };
3882
- return (d = o.content) == null || d.forEach((f) => {
3898
+ return (d = i.content) == null || d.forEach((f) => {
3883
3899
  f.type === "variable" && (f.ref = s(f.ref));
3884
- }), (u = o.richContent) == null || u.blocks.forEach((f) => {
3900
+ }), (u = i.richContent) == null || u.blocks.forEach((f) => {
3885
3901
  f.type === "list" ? f.items.forEach((m) => m.forEach(l)) : f.children.forEach(l);
3886
- }), i;
3902
+ }), o;
3887
3903
  }
3888
- function Da(e, t) {
3889
- var o;
3890
- const n = st(e);
3904
+ function Pa(e, t) {
3905
+ var i;
3906
+ const n = ct(e);
3891
3907
  if (!n.some((a) => {
3892
3908
  var s;
3893
3909
  return (s = a.preferences) == null ? void 0 : s.textVisualOptions;
3894
3910
  }))
3895
3911
  return e;
3896
- const r = ie(e), i = st(r);
3897
- for (let a = 0; a < i.length; a++) {
3898
- const s = Fa(
3899
- i[a],
3912
+ const r = oe(e), o = ct(r);
3913
+ for (let a = 0; a < o.length; a++) {
3914
+ const s = xa(
3915
+ o[a],
3900
3916
  n[a],
3901
3917
  t,
3902
3918
  e
3903
3919
  );
3904
- (o = e.frames) != null && o.some(
3905
- (l) => l.visualId && l.cards.some((c) => c.id === i[a].id)
3906
- ) && (i[a].linkedReferenceOverrides = mi(
3907
- i[a].linkedReferenceOverrides,
3920
+ (i = e.frames) != null && i.some(
3921
+ (l) => l.visualId && l.cards.some((c) => c.id === o[a].id)
3922
+ ) && (o[a].linkedReferenceOverrides = Fo(
3923
+ o[a].linkedReferenceOverrides,
3908
3924
  { inputAliases: s }
3909
3925
  ));
3910
3926
  }
3911
3927
  return r;
3912
3928
  }
3913
- function Sa(e) {
3929
+ function wa(e) {
3914
3930
  var n;
3915
3931
  const t = (n = e.sheets) == null ? void 0 : n.map(
3916
- (r) => Da(r, e)
3932
+ (r) => Pa(r, e)
3917
3933
  );
3918
- return t && t.some((r, i) => r !== e.sheets[i]) ? { ...e, sheets: t } : e;
3934
+ return t && t.some((r, o) => r !== e.sheets[o]) ? { ...e, sheets: t } : e;
3919
3935
  }
3920
- function Ta(e) {
3936
+ function Oa(e) {
3921
3937
  const t = A(e);
3922
3938
  return t.issues.length === 0 && !t.needsUpgrade ? e : t.issues.length ? t.toStoredDashboard() : A(
3923
- Sa(e)
3939
+ wa(e)
3924
3940
  ).toStoredDashboard();
3925
3941
  }
3926
3942
  export {
3927
- va as $,
3928
- ea as A,
3929
- pn as B,
3930
- mi as C,
3931
- Ka as D,
3932
- Di as E,
3933
- co as F,
3934
- et as G,
3935
- wi as H,
3936
- Pi as I,
3937
- ki as J,
3938
- Qa as K,
3939
- gi as L,
3940
- Nt as M,
3943
+ ka as $,
3944
+ sa as A,
3945
+ yn as B,
3946
+ Fo as C,
3947
+ Za as D,
3948
+ wo as E,
3949
+ bi as F,
3950
+ nt as G,
3951
+ No as H,
3952
+ qo as I,
3953
+ Eo as J,
3954
+ es as K,
3955
+ Do as L,
3956
+ zt as M,
3941
3957
  Fe as N,
3942
- Ai as O,
3958
+ Lo as O,
3943
3959
  z as P,
3944
- Ei as Q,
3960
+ Go as Q,
3945
3961
  Re as R,
3946
3962
  Ee as S,
3947
- ei as T,
3948
- $a as U,
3949
- Ja as V,
3950
- Oi as W,
3951
- Ha as X,
3952
- Ms as Y,
3953
- pa as Z,
3954
- st as _,
3955
- Bo as a,
3956
- Fa as a0,
3957
- Da as a1,
3958
- bs as a2,
3959
- gs as a3,
3960
- Qt as a4,
3961
- ys as a5,
3962
- Li as a6,
3963
- na as a7,
3964
- ks as a8,
3965
- Jo as a9,
3966
- hs as aA,
3967
- sn as aB,
3968
- ce as aC,
3969
- Ua as aD,
3970
- Uo as aE,
3971
- ln as aF,
3972
- Ae as aG,
3973
- Za as aH,
3974
- Ya as aI,
3975
- eo as aJ,
3976
- $ as aK,
3977
- ds as aL,
3978
- Cs as aM,
3979
- Is as aN,
3980
- Ss as aa,
3981
- Vs as ab,
3982
- no as ac,
3983
- ro as ad,
3984
- ma as ae,
3985
- Xa as af,
3986
- es as ag,
3987
- oo as ah,
3963
+ so as T,
3964
+ ts as U,
3965
+ os as V,
3966
+ jo as W,
3967
+ Ya as X,
3968
+ As as Y,
3969
+ ha as Z,
3970
+ ct as _,
3971
+ Li as a,
3972
+ xa as a0,
3973
+ Pa as a1,
3974
+ Ss as a2,
3975
+ Fs as a3,
3976
+ Zt as a4,
3977
+ Ds as a5,
3978
+ Zo as a6,
3979
+ ca as a7,
3980
+ Bs as a8,
3981
+ oa as a9,
3982
+ ce as aA,
3983
+ Fa as aB,
3984
+ Ps as aC,
3985
+ Xa as aD,
3986
+ Xi as aE,
3987
+ hi as aF,
3988
+ un as aG,
3989
+ Ae as aH,
3990
+ rs as aI,
3991
+ is as aJ,
3992
+ li as aK,
3993
+ $ as aL,
3994
+ bs as aM,
3995
+ Vs as aN,
3996
+ Ts as aO,
3997
+ ws as aa,
3998
+ _s as ab,
3999
+ di as ac,
4000
+ ui as ad,
4001
+ va as ae,
4002
+ as as af,
4003
+ ss as ag,
4004
+ pi as ah,
3988
4005
  De as ai,
3989
- to as aj,
3990
- ao as ak,
3991
- ts as al,
3992
- Ts as am,
3993
- Fs as an,
3994
- rs as ao,
3995
- os as ap,
3996
- is as aq,
3997
- as as ar,
3998
- ss as as,
3999
- ga as at,
4000
- Ds as au,
4001
- Ot as av,
4002
- Wa as aw,
4003
- vs as ax,
4004
- ls as ay,
4005
- vo as az,
4006
- Yo as b,
4007
- Yi as c,
4008
- ns as d,
4009
- fi as e,
4010
- fs as f,
4011
- ie as g,
4012
- ms as h,
4013
- xs as i,
4014
- ps as j,
4015
- Ca as k,
4016
- Ao as l,
4006
+ ci as aj,
4007
+ mi as ak,
4008
+ ls as al,
4009
+ Os as am,
4010
+ xs as an,
4011
+ ds as ao,
4012
+ fs as ap,
4013
+ us as aq,
4014
+ ps as ar,
4015
+ ms as as,
4016
+ At as at,
4017
+ ns as au,
4018
+ ks as av,
4019
+ gs as aw,
4020
+ ki as ax,
4021
+ Ms as ay,
4022
+ dn as az,
4023
+ ia as b,
4024
+ ai as c,
4025
+ cs as d,
4026
+ ho as e,
4027
+ Cs as f,
4028
+ oe as g,
4029
+ vs as h,
4030
+ Es as i,
4031
+ hs as j,
4032
+ Va as k,
4033
+ zi as l,
4017
4034
  Ne as m,
4018
- uo as n,
4019
- fo as o,
4020
- cs as p,
4021
- yi as q,
4022
- us as r,
4023
- Ci as s,
4024
- At as t,
4025
- Ga as u,
4026
- vi as v,
4027
- Ta as w,
4028
- Cn as x,
4029
- ha as y,
4030
- Ps as z
4035
+ Ii as n,
4036
+ Ci as o,
4037
+ ys as p,
4038
+ So as q,
4039
+ Is as r,
4040
+ Mo as s,
4041
+ Et as t,
4042
+ Ja as u,
4043
+ xo as v,
4044
+ Oa as w,
4045
+ Fn as x,
4046
+ Ma as y,
4047
+ Rs as z
4031
4048
  };