react-semaphor 0.1.598 → 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 (89) hide show
  1. package/dist/analytics-protocol/index.js +329 -327
  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-DrI442Ld.js → assistant-chat-f3XuzrAm.js} +88 -89
  9. package/dist/chunks/{bookmark-impact-C6uWtNWF.js → bookmark-impact-B5hyttm2.js} +3 -3
  10. package/dist/chunks/{bookmark-state-BfeKmj5s.js → bookmark-state-h1OLXVjE.js} +153 -153
  11. package/dist/chunks/{card-filter-builder-CSKCSpNo.js → card-filter-builder-DfLqD2RV.js} +1035 -1063
  12. package/dist/chunks/{comparison-window-caption-3bum5j00.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-PYd63LbL.js → dashboard-CoI4aOUc.js} +1 -1
  15. package/dist/chunks/{dashboard-briefing-launcher-C2AuKs10.js → dashboard-briefing-launcher-RxYGtk-F.js} +255 -255
  16. package/dist/chunks/{dashboard-controls-BSbhyIkY.js → dashboard-controls-DeaXrtLK.js} +85 -85
  17. package/dist/chunks/{dashboard-json-Bd1rxD3y.js → dashboard-json-DvxKpKd_.js} +5 -5
  18. package/dist/chunks/dates-BhtO28Sn.js +164 -0
  19. package/dist/chunks/{edit-dashboard-visual-D_0ZiWev.js → edit-dashboard-visual-C4f5hONA.js} +5489 -5435
  20. package/dist/chunks/{filter-line-BdLyPYjH.js → filter-line-Dkg3yuOX.js} +6 -6
  21. package/dist/chunks/{filter-reach-copy-Dxn-mTuG.js → filter-reach-copy-Cl5Od38Q.js} +1740 -1643
  22. package/dist/chunks/{filter-value-text-C6g-nDUW.js → filter-value-text-CXyuLW9Q.js} +4 -4
  23. package/dist/chunks/{index-BHSDE54O.js → index-EKpTtkYF.js} +7 -7
  24. package/dist/chunks/{layout-grid-CYR-LVpl.js → layout-grid-DSrBSfPM.js} +1 -1
  25. package/dist/chunks/{matrix-analytical-definition-C0IGLTZH.js → matrix-analytical-definition-BuUSBDm7.js} +246 -218
  26. package/dist/chunks/{matrix-member-presentation-D5BIYuy5.js → matrix-member-presentation-B_2beBc0.js} +1 -1
  27. package/dist/chunks/{matrix-operation-contract-RckfqkQm.js → matrix-operation-contract-DdK0J_KU.js} +36 -36
  28. package/dist/chunks/{metric-comparison-DsE8wdRh.js → metric-comparison-Bhz0V841.js} +2 -2
  29. package/dist/chunks/{paintbrush-xDDRjIyF.js → paintbrush-1UiU-uTz.js} +1 -1
  30. package/dist/chunks/{palette-CbOgFCy2.js → palette-DFIFf_-m.js} +1 -1
  31. package/dist/chunks/{pivot-result-contract-expectations-Cnq55Uno.js → pivot-result-contract-expectations-Dk7WFR_u.js} +8 -8
  32. package/dist/chunks/{pivot-result-identity-b4-ugQhm.js → pivot-result-identity-CzzrJpEm.js} +1 -1
  33. package/dist/chunks/{raw-temporal-value-B9W38mi3.js → raw-temporal-value-BLvdaMng.js} +2 -2
  34. package/dist/chunks/{report-preferences-dialog-DTu3a7ce.js → report-preferences-dialog-CZaYsQLK.js} +14 -14
  35. package/dist/chunks/{report-runtime-context-BvJkcbar.js → report-runtime-context-CEGluufW.js} +2 -2
  36. package/dist/chunks/{resolve-dashboard-input-context-Bw-DesV2.js → resolve-dashboard-input-context-vPtbuDDz.js} +11811 -11331
  37. package/dist/chunks/{save-BgvAsp6X.js → save-CWQ02kHo.js} +1 -1
  38. package/dist/chunks/{saved-dashboard-context-BFh0oOnF.js → saved-dashboard-context-C6X5nP4C.js} +97 -97
  39. package/dist/chunks/{selection-filter-compiler-DHYsq3yM.js → selection-filter-compiler-Ce4BpjRX.js} +1 -1
  40. package/dist/chunks/{semaphor-ready-indicator-WvgHMnj8.js → semaphor-ready-indicator-BUiaKY6O.js} +59336 -58569
  41. package/dist/chunks/{shelf-drop-preview-context-D6HgYFJp.js → shelf-drop-preview-context-CwxWJjBv.js} +6 -6
  42. package/dist/chunks/{stored-dashboard-vlG0Knxi.js → stored-dashboard-Bmct-STp.js} +1200 -1183
  43. package/dist/chunks/{style-sheet-parts-ClmvtkSC.js → style-sheet-parts-BX7d7-2-.js} +198 -198
  44. package/dist/chunks/{table-export-sheet-Bv6tVuMu.js → table-export-sheet-BWSVTclx.js} +1 -1
  45. package/dist/chunks/{token-types-eMdcuB6j.js → token-types-CnlEiAdS.js} +1 -1
  46. package/dist/chunks/{upload-ClUeK8F0.js → upload-DsqUSS8l.js} +1 -1
  47. package/dist/chunks/{validators-DwhBEvnh.js → validators-D2Hm57lJ.js} +23 -13
  48. package/dist/chunks/{variable-draft-CauoSBN0.js → variable-draft-Bi-zUa_a.js} +4 -4
  49. package/dist/dashboard/index.js +2 -2
  50. package/dist/dashboard-authoring/index.js +2497 -2549
  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/shared/analytics-protocol/analytics-base-schemas.d.ts +64 -0
  68. package/dist/types/shared/analytics-protocol/column-filter-id.d.ts +4 -0
  69. package/dist/types/shared/analytics-protocol/contracts.d.ts +26 -0
  70. package/dist/types/shared/analytics-protocol/index.d.ts +1 -0
  71. package/dist/types/shared/dashboard-authoring/card-query-request.d.ts +12 -1
  72. package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +12 -0
  73. package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +1 -1
  74. package/dist/types/shared/dashboard-authoring/card-settings/index.d.ts +1 -1
  75. package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +4 -0
  76. package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +2 -0
  77. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +18 -0
  78. package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +10 -10
  79. package/dist/types/shared/dashboard-authoring/dashboard-filter-mapping-contract.d.ts +2 -0
  80. package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +8 -1
  81. package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +3 -1
  82. package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +29 -1
  83. package/dist/types/shared/usage-events/attribution.d.ts +2 -2
  84. package/dist/types/shared/usage-events/envelope.d.ts +2 -2
  85. package/dist/usage-events/index.js +1 -1
  86. package/package.json +1 -1
  87. package/dist/chunks/aggregate-measure-field-DtKcEjG5.js +0 -22
  88. package/dist/chunks/dates-DHMCf-F7.js +0 -115
  89. package/dist/chunks/list-filter-B67GsjTw.js +0 -15
@@ -1,14 +1,15 @@
1
- import { G as z, H as T, E as ge, I as te, F as K, L as he } from "./raw-temporal-value-B9W38mi3.js";
2
- import { ap as C, ar as $, aj as G, ah as p, aq as pe, ai as M, aw as ve, ak as J, a7 as Q, K as X, t as ke } from "./validators-DwhBEvnh.js";
3
- import { a as Ie } from "./metric-comparison-DsE8wdRh.js";
1
+ import { G as $, H as A, E as he, I as te, F as K, L as pe } from "./raw-temporal-value-BLvdaMng.js";
2
+ import { ap as C, ar as w, aj as U, ah as p, aq as ve, ai as z, aw as ke, ak as X, a7 as Q, e as Ie, K as J, t as Ne } from "./validators-D2Hm57lJ.js";
3
+ import { a as Ce } from "./metric-comparison-Bhz0V841.js";
4
+ import { M as _e } from "./matrix-operation-contract-DdK0J_KU.js";
4
5
  class Y extends Error {
5
6
  constructor(t) {
6
7
  super(t), this.name = "RelativeDateUsageError";
7
8
  }
8
9
  }
9
- function Ne(e, t, n = {}) {
10
+ function Se(e, t, n = {}) {
10
11
  const i = n.spansBack ?? 0;
11
- if (i !== 0) return Ce(e, t, i);
12
+ if (i !== 0) return Ae(e, t, i);
12
13
  const { calendar: a, now: r } = t;
13
14
  switch (e.kind) {
14
15
  case "periods": {
@@ -19,36 +20,36 @@ function Ne(e, t, n = {}) {
19
20
  };
20
21
  }
21
22
  case "rolling": {
22
- const s = e.anchor === "latest_data" ? t.latestData ?? r : r, o = ge[e.unit];
23
+ const s = e.anchor === "latest_data" ? t.latestData ?? r : r, o = he[e.unit];
23
24
  return {
24
25
  start: o === void 0 ? te(s, -e.n, e.unit, a) : new Date(s.getTime() - e.n * o),
25
26
  end: s
26
27
  };
27
28
  }
28
29
  case "monthDay": {
29
- const s = e.day === "first" ? z(r, "month", a) : T(r, "month", a);
30
- return { start: z(s, "day", a), end: T(s, "day", a) };
30
+ const s = e.day === "first" ? $(r, "month", a) : A(r, "month", a);
31
+ return { start: $(s, "day", a), end: A(s, "day", a) };
31
32
  }
32
33
  }
33
34
  }
34
35
  function ne(e, t) {
35
36
  const { anchor: n } = e;
36
- return n === "latest_data" ? t.latestData ?? t.now : n === "now" ? t.now : new Date(z(t.now, n.lastComplete, t.calendar).getTime() - 1);
37
+ return n === "latest_data" ? t.latestData ?? t.now : n === "now" ? t.now : new Date($(t.now, n.lastComplete, t.calendar).getTime() - 1);
37
38
  }
38
39
  function ie(e, t, n, i) {
39
40
  return new Date(K(e, t, n, i).endExclusive.getTime() - 1);
40
41
  }
41
- function Ce(e, t, n) {
42
+ function Ae(e, t, n) {
42
43
  if (!Number.isInteger(n) || n < 0)
43
44
  throw new Y(`spansBack must be a whole number of spans, got ${n}.`);
44
45
  if (e.kind !== "periods" || typeof e.anchor != "object")
45
46
  throw new Y("spansBack applies only to a window anchored at the end of the last complete period.");
46
- const { calendar: i } = t, { unit: a } = e, r = Ne(e, t), s = -n * (e.to - e.from + 1), o = K(r.start, a, i, s).start;
47
- if (T(r.end, a, i).getTime() === r.end.getTime())
47
+ const { calendar: i } = t, { unit: a } = e, r = Se(e, t), s = -n * (e.to - e.from + 1), o = K(r.start, a, i, s).start;
48
+ if (A(r.end, a, i).getTime() === r.end.getTime())
48
49
  return { start: o, end: ie(r.end, a, i, s) };
49
50
  const d = te(ne(e, t), s, a, i), c = Math.min(
50
- T(d, e.anchor.lastComplete, i).getTime(),
51
- T(d, a, i).getTime()
51
+ A(d, e.anchor.lastComplete, i).getTime(),
52
+ A(d, a, i).getTime()
52
53
  );
53
54
  return { start: o, end: new Date(c) };
54
55
  }
@@ -60,8 +61,8 @@ function ae(e) {
60
61
  ])
61
62
  );
62
63
  }
63
- function tt(e) {
64
- const t = e.source.connectionType ? C(e.source.connectionType) : void 0, n = e.source.dialect ? $(e.source.dialect) : void 0, i = e.source.dialect && e.source.dialect !== "unknown" ? C(e.source.dialect) : void 0;
64
+ function st(e) {
65
+ const t = e.source.connectionType ? C(e.source.connectionType) : void 0, n = e.source.dialect ? w(e.source.dialect) : void 0, i = e.source.dialect && e.source.dialect !== "unknown" ? C(e.source.dialect) : void 0;
65
66
  if (!e.capabilities && e.source.connectionType && e.source.dialect && e.source.dialect !== "unknown" && (!t || n === "unknown" || t.dialect !== n))
66
67
  return { kind: "incompatible_capabilities" };
67
68
  const a = e.capabilities || t || i;
@@ -96,16 +97,16 @@ function q(e) {
96
97
  ...n ? { tableName: n } : {}
97
98
  };
98
99
  }
99
- function _e(e) {
100
- if (De(e)) return { kind: "malformed" };
101
- const t = e.entities.filter(oe), n = Se(e), i = Te({
100
+ function Te(e) {
101
+ if (Fe(e)) return { kind: "malformed" };
102
+ const t = e.entities.filter(oe), n = De(e), i = Ee({
102
103
  entities: t,
103
104
  connectionType: e.connectionType,
104
105
  dialect: e.dialect,
105
106
  capabilities: e.capabilities
106
107
  });
107
108
  if (!i) return { kind: "incompatible_capabilities" };
108
- const { capabilities: a } = i, r = Ee({
109
+ const { capabilities: a } = i, r = Be({
109
110
  hints: e.qualifiedHints || [],
110
111
  coordinateHint: e.coordinateHint,
111
112
  capabilityAuthority: i
@@ -113,7 +114,7 @@ function _e(e) {
113
114
  if (r.kind !== "valid")
114
115
  return { kind: r.kind };
115
116
  const s = r.coordinates, o = s ? t.filter(
116
- (c) => G({
117
+ (c) => U({
117
118
  left: se(
118
119
  q(c),
119
120
  a
@@ -130,7 +131,7 @@ function _e(e) {
130
131
  capabilityAuthority: i
131
132
  };
132
133
  if (s && o.length === 1) {
133
- const c = o[0], l = j(
134
+ const c = o[0], l = R(
134
135
  i,
135
136
  c
136
137
  );
@@ -138,7 +139,7 @@ function _e(e) {
138
139
  kind: "resolved",
139
140
  basis: "qualified",
140
141
  entity: c,
141
- coordinates: He(
142
+ coordinates: Pe(
142
143
  q(c),
143
144
  s,
144
145
  l
@@ -153,11 +154,11 @@ function _e(e) {
153
154
  ]);
154
155
  if (d.size > 0) {
155
156
  const c = o.filter((l) => {
156
- const m = Fe(l);
157
- return Array.from(d).some((y) => m.has(y));
157
+ const m = Le(l);
158
+ return Array.from(d).some((b) => m.has(b));
158
159
  });
159
160
  if (c.length === 1) {
160
- const l = c[0], m = j(
161
+ const l = c[0], m = R(
161
162
  i,
162
163
  l
163
164
  );
@@ -165,7 +166,7 @@ function _e(e) {
165
166
  kind: "resolved",
166
167
  basis: "bare",
167
168
  entity: l,
168
- coordinates: F(
169
+ coordinates: B(
169
170
  q(l),
170
171
  m
171
172
  ),
@@ -183,7 +184,7 @@ function _e(e) {
183
184
  capabilityAuthority: i
184
185
  };
185
186
  if (t.length === 1) {
186
- const c = t[0], l = j(
187
+ const c = t[0], l = R(
187
188
  i,
188
189
  c
189
190
  );
@@ -191,7 +192,7 @@ function _e(e) {
191
192
  kind: "resolved",
192
193
  basis: "unqualified",
193
194
  entity: c,
194
- coordinates: F(
195
+ coordinates: B(
195
196
  q(c),
196
197
  l
197
198
  ),
@@ -200,7 +201,7 @@ function _e(e) {
200
201
  }
201
202
  return { kind: "unqualified" };
202
203
  }
203
- function Se(e) {
204
+ function De(e) {
204
205
  const t = (e.qualifiedHints || []).map(f).filter((i) => !!i);
205
206
  return Object.values(e.coordinateHint || {}).some(
206
207
  (i) => !!f(i)
@@ -208,21 +209,21 @@ function Se(e) {
208
209
  (i) => !!f(i)
209
210
  ) ? "bare" : void 0;
210
211
  }
211
- function A(e) {
212
+ function T(e) {
212
213
  return `${e.dialect}:${e.prefixLevels.join(".")}`;
213
214
  }
214
- function B(e) {
215
+ function F(e) {
215
216
  return {
216
217
  dialect: e.dialect,
217
218
  prefixLevels: [...e.prefixLevels]
218
219
  };
219
220
  }
220
- function Te(e) {
221
+ function Ee(e) {
221
222
  var k;
222
- const t = f(e.connectionType), n = f(e.dialect), i = e.capabilities ? B(e.capabilities) : void 0, a = t ? C(t) : void 0, r = n ? $(n) : void 0, s = n && n !== "unknown" ? C(n) : void 0;
223
- if (t && !a || n && n !== "unknown" && r === "unknown" || i && a && A(i) !== A(a))
223
+ const t = f(e.connectionType), n = f(e.dialect), i = e.capabilities ? F(e.capabilities) : void 0, a = t ? C(t) : void 0, r = n ? w(n) : void 0, s = n && n !== "unknown" ? C(n) : void 0;
224
+ if (t && !a || n && n !== "unknown" && r === "unknown" || i && a && T(i) !== T(a))
224
225
  return;
225
- const o = i || (a ? B(a) : s ? B(s) : void 0);
226
+ const o = i || (a ? F(a) : s ? F(s) : void 0);
226
227
  if (o)
227
228
  return r && r !== "unknown" && o.dialect !== r ? void 0 : {
228
229
  capabilities: o,
@@ -230,41 +231,41 @@ function Te(e) {
230
231
  dialect: o.dialect,
231
232
  evidence: "explicit"
232
233
  };
233
- const d = e.entities.map((b) => {
234
- const I = D(b), h = f(I == null ? void 0 : I.connectionType), N = f(I == null ? void 0 : I.dialect), S = h ? C(h) : void 0, E = N ? $(N) : void 0, x = N && N !== "unknown" ? C(N) : void 0;
235
- if (h && !S || N && N !== "unknown" && E === "unknown" || N && N !== "unknown" && !S && !x || S && E && E !== "unknown" && S.dialect !== E)
234
+ const d = e.entities.map((g) => {
235
+ const I = D(g), h = f(I == null ? void 0 : I.connectionType), N = f(I == null ? void 0 : I.dialect), S = h ? C(h) : void 0, E = N ? w(N) : void 0, L = N && N !== "unknown" ? C(N) : void 0;
236
+ if (h && !S || N && N !== "unknown" && E === "unknown" || N && N !== "unknown" && !S && !L || S && E && E !== "unknown" && S.dialect !== E)
236
237
  return;
237
- const V = S || x, P = V ? B(V) : Ae(I);
238
+ const V = S || L, P = V ? F(V) : qe(I);
238
239
  return P ? {
239
240
  capabilities: P,
240
241
  connectionType: h,
241
- capabilityIdentity: h ? pe(h) : void 0,
242
- inferred: !S && !x,
243
- signature: A(P)
242
+ capabilityIdentity: h ? ve(h) : void 0,
243
+ inferred: !S && !L,
244
+ signature: T(P)
244
245
  } : void 0;
245
246
  });
246
- if (d.some((b) => !b)) return;
247
+ if (d.some((g) => !g)) return;
247
248
  const c = d.filter(
248
- (b) => !!b
249
+ (g) => !!g
249
250
  );
250
- if (new Set(c.map((b) => b.signature)).size > 1)
251
+ if (new Set(c.map((g) => g.signature)).size > 1)
251
252
  return;
252
253
  const l = (k = c[0]) == null ? void 0 : k.capabilities;
253
254
  if (!l || r && r !== "unknown" && l.dialect !== r)
254
255
  return;
255
256
  const m = new Set(
256
- c.map((b) => b.capabilityIdentity).filter((b) => !!b)
257
- ), y = c.every(
258
- (b) => b.connectionType && b.capabilityIdentity
257
+ c.map((g) => g.capabilityIdentity).filter((g) => !!g)
258
+ ), b = c.every(
259
+ (g) => g.connectionType && g.capabilityIdentity
259
260
  );
260
261
  return {
261
262
  capabilities: l,
262
- ...y && m.size === 1 ? { connectionType: c[0].connectionType } : {},
263
+ ...b && m.size === 1 ? { connectionType: c[0].connectionType } : {},
263
264
  dialect: l.dialect,
264
- evidence: c.every((b) => b.inferred) ? "coordinates" : "entity"
265
+ evidence: c.every((g) => g.inferred) ? "coordinates" : "entity"
265
266
  };
266
267
  }
267
- function Ae(e) {
268
+ function qe(e) {
268
269
  const t = !!f(e == null ? void 0 : e.database), n = !!f(e == null ? void 0 : e.schema);
269
270
  if (!(t && n)) {
270
271
  if (n)
@@ -273,13 +274,13 @@ function Ae(e) {
273
274
  return { dialect: "unknown", prefixLevels: ["database", "table"] };
274
275
  }
275
276
  }
276
- function j(e, t) {
277
+ function R(e, t) {
277
278
  var a;
278
279
  if (e.evidence !== "entity") return e;
279
280
  const n = f((a = D(t)) == null ? void 0 : a.connectionType), i = n ? C(n) : void 0;
280
- return i && A(i) === A(e.capabilities) ? { ...e, connectionType: n } : e;
281
+ return i && T(i) === T(e.capabilities) ? { ...e, connectionType: n } : e;
281
282
  }
282
- function De(e) {
283
+ function Fe(e) {
283
284
  return (e.qualifiedHints || []).some(
284
285
  (n) => {
285
286
  const i = f(n);
@@ -290,42 +291,42 @@ function De(e) {
290
291
  return !!(i && !p(i));
291
292
  });
292
293
  }
293
- function Ee(e) {
294
+ function Be(e) {
294
295
  const { capabilities: t } = e.capabilityAuthority, n = [], i = [];
295
296
  for (const m of e.hints) {
296
- const y = f(m);
297
- if (!y) continue;
298
- if (!y.includes(".")) {
299
- i.push(y);
297
+ const b = f(m);
298
+ if (!b) continue;
299
+ if (!b.includes(".")) {
300
+ i.push(b);
300
301
  continue;
301
302
  }
302
- const k = p(y);
303
+ const k = p(b);
303
304
  if (!k) return { kind: "malformed" };
304
305
  n.push(k);
305
306
  }
306
- const a = qe(e.coordinateHint);
307
+ const a = He(e.coordinateHint);
307
308
  if (a.kind === "malformed") return a;
308
309
  const r = Array.from(new Set(n)).map(
309
- (m) => M({
310
+ (m) => z({
310
311
  qualifiedName: m,
311
312
  capabilities: t
312
313
  })
313
314
  );
314
- if (!Be(r, t))
315
+ if (!xe(r, t))
315
316
  return { kind: "conflicting" };
316
317
  const s = [...new Set(n)].sort(
317
- (m, y) => y.split(".").length - m.split(".").length
318
- )[0], o = s ? M({
318
+ (m, b) => b.split(".").length - m.split(".").length
319
+ )[0], o = s ? z({
319
320
  qualifiedName: s,
320
321
  capabilities: t
321
322
  }) : void 0, d = se(
322
323
  a.coordinates,
323
324
  t
324
- ), c = F(
325
+ ), c = B(
325
326
  a.coordinates,
326
327
  e.capabilityAuthority
327
328
  ), l = !!(d.tableName && (d.databaseName || d.schemaName));
328
- return o && l && !G({
329
+ return o && l && !U({
329
330
  left: o,
330
331
  right: d,
331
332
  capabilities: t
@@ -341,7 +342,7 @@ function Ee(e) {
341
342
  ]
342
343
  };
343
344
  }
344
- function qe(e) {
345
+ function He(e) {
345
346
  const t = {};
346
347
  for (const [n, i] of Object.entries(e || {})) {
347
348
  const a = f(i);
@@ -359,10 +360,10 @@ function se(e, t) {
359
360
  ...e.tableName ? { tableName: e.tableName } : {}
360
361
  };
361
362
  }
362
- function Be(e, t) {
363
+ function xe(e, t) {
363
364
  return e.every(
364
365
  (n, i) => e.slice(i + 1).every(
365
- (a) => G({
366
+ (a) => U({
366
367
  left: n,
367
368
  right: a,
368
369
  capabilities: t
@@ -375,7 +376,7 @@ function re(e) {
375
376
  e.map(f).map(p).filter((t) => !!t)
376
377
  );
377
378
  }
378
- function Fe(e) {
379
+ function Le(e) {
379
380
  const t = D(e);
380
381
  return t ? re([
381
382
  f(t.name),
@@ -383,8 +384,8 @@ function Fe(e) {
383
384
  f(t.id)
384
385
  ]) : /* @__PURE__ */ new Set();
385
386
  }
386
- function He(e, t, n) {
387
- return F(
387
+ function Pe(e, t, n) {
388
+ return B(
388
389
  {
389
390
  ...e,
390
391
  ...t
@@ -392,7 +393,7 @@ function He(e, t, n) {
392
393
  n
393
394
  );
394
395
  }
395
- function F(e, t) {
396
+ function B(e, t) {
396
397
  const n = t.evidence === "coordinates" ? t.capabilities.prefixLevels : ae(t.capabilities);
397
398
  return {
398
399
  ...n.includes("database") && e.databaseName ? { databaseName: e.databaseName } : {},
@@ -406,7 +407,7 @@ function u(e) {
406
407
  function _(e) {
407
408
  return e && typeof e == "object" && !Array.isArray(e) ? e : void 0;
408
409
  }
409
- function Le(e) {
410
+ function Re(e) {
410
411
  const t = _(e);
411
412
  return !!(t && t.type === "dataset" && u(t.name));
412
413
  }
@@ -433,10 +434,10 @@ function H(e) {
433
434
  const t = u(e);
434
435
  return t ? (n = p(t)) == null ? void 0 : n.toLowerCase() : void 0;
435
436
  }
436
- function R(e, t) {
437
+ function j(e, t) {
437
438
  const n = _(t), i = u(n == null ? void 0 : n.domainId) || u(e.semanticDomainId), a = u(n == null ? void 0 : n.name);
438
439
  if (!i || !a) return;
439
- const r = (n == null ? void 0 : n.datasetType) === "physical" ? void 0 : ve(n || {}), s = u(n == null ? void 0 : n.connectionId) || u(e.connectionId);
440
+ const r = (n == null ? void 0 : n.datasetType) === "physical" ? void 0 : ke(n || {}), s = u(n == null ? void 0 : n.connectionId) || u(e.connectionId);
440
441
  return {
441
442
  kind: "semantic",
442
443
  domainId: i,
@@ -445,12 +446,12 @@ function R(e, t) {
445
446
  ...s ? { connectionId: s } : {}
446
447
  };
447
448
  }
448
- function xe(e, t = {}) {
449
+ function je(e, t = {}) {
449
450
  const n = u(e.fieldEntityType);
450
451
  if (n && n !== "dataset")
451
452
  return { kind: "unqualified" };
452
453
  const i = e.entities.filter(
453
- (s) => t.includePhysicalDatasets ? Le(s) : ce(s)
454
+ (s) => t.includePhysicalDatasets ? Re(s) : ce(s)
454
455
  ), a = u(e.entityId);
455
456
  if (a) {
456
457
  const s = H(a), o = i.filter((d) => {
@@ -459,7 +460,7 @@ function xe(e, t = {}) {
459
460
  });
460
461
  if (o.length > 1) return { kind: "ambiguous", basis: "bare" };
461
462
  if (o.length === 1) {
462
- const d = R(e, o[0]);
463
+ const d = j(e, o[0]);
463
464
  return d ? {
464
465
  kind: "resolved",
465
466
  basis: "bare",
@@ -481,7 +482,7 @@ function xe(e, t = {}) {
481
482
  });
482
483
  if (s.length > 1) return { kind: "ambiguous", basis: "bare" };
483
484
  if (s.length === 1) {
484
- const o = R(e, s[0]);
485
+ const o = j(e, s[0]);
485
486
  return o ? {
486
487
  kind: "resolved",
487
488
  basis: "bare",
@@ -493,7 +494,7 @@ function xe(e, t = {}) {
493
494
  return { kind: "not_found", basis: "bare" };
494
495
  }
495
496
  if (i.length === 1) {
496
- const s = R(e, i[0]);
497
+ const s = j(e, i[0]);
497
498
  return s ? {
498
499
  kind: "resolved",
499
500
  basis: "unqualified",
@@ -504,7 +505,7 @@ function xe(e, t = {}) {
504
505
  }
505
506
  return { kind: "unqualified" };
506
507
  }
507
- function O(e) {
508
+ function M(e) {
508
509
  const t = e.resolution.kind === "resolved" ? _(e.resolution.entity) : void 0, n = u(e.connectionId) || u(t == null ? void 0 : t.connectionId), { connectionType: i, dialect: a } = e.resolution.capabilityAuthority, r = C(a), s = !!(r && r.dialect === e.resolution.capabilityAuthority.capabilities.dialect && r.prefixLevels.join(".") === e.resolution.capabilityAuthority.capabilities.prefixLevels.join(
509
510
  "."
510
511
  )), o = e.resolution.coordinates;
@@ -519,7 +520,7 @@ function O(e) {
519
520
  ...o.schemaName ? { schemaName: o.schemaName } : {}
520
521
  };
521
522
  }
522
- function Pe(e) {
523
+ function Me(e) {
523
524
  if (!e.coordinates.tableName) return !1;
524
525
  const t = _(e.entity), n = H(t == null ? void 0 : t.id), i = e.qualifiedHints.map(u).filter((l) => !!(l != null && l.includes(".")));
525
526
  if (n && i.length > 0 && i.every((l) => H(l) === n))
@@ -535,20 +536,20 @@ function Pe(e) {
535
536
  ...s ? { schemaName: s } : {},
536
537
  tableName: a
537
538
  };
538
- return J({
539
+ return X({
539
540
  requested: e.coordinates,
540
541
  allowed: d,
541
542
  capabilities: o
542
- }) ? !0 : r && !o.prefixLevels.includes("database") || s && !o.prefixLevels.includes("schema") ? J({
543
+ }) ? !0 : r && !o.prefixLevels.includes("database") || s && !o.prefixLevels.includes("schema") ? X({
543
544
  requested: e.coordinates,
544
- allowed: M({
545
+ allowed: z({
545
546
  qualifiedName: [r, s, a].filter(Boolean).join("."),
546
547
  capabilities: o
547
548
  }),
548
549
  capabilities: o
549
550
  }) : !1;
550
551
  }
551
- function je(e) {
552
+ function Oe(e) {
552
553
  var a, r, s;
553
554
  if (u(e.connectionType) || u(e.dialect) || e.capabilities || u(e.semanticDomainId) || u(e.fieldEntityType) === "dataset" || u((a = e.fallbackCoordinateHint) == null ? void 0 : a.databaseName) || u((r = e.fallbackCoordinateHint) == null ? void 0 : r.schemaName))
554
555
  return;
@@ -564,17 +565,17 @@ function je(e) {
564
565
  const n = t.map(p);
565
566
  return n.some((o) => !o) ? void 0 : new Set(n.map((o) => o.toLowerCase())).size === 1 ? n[0] : void 0;
566
567
  }
567
- function nt(e) {
568
+ function rt(e) {
568
569
  const t = e.entities.filter(
569
570
  oe
570
571
  ), n = e.entities.filter(
571
572
  ce
572
- ), i = t.length > 0 || n.length > 0, a = xe(e), r = e.qualifiedHints || [], s = r.some(
573
+ ), i = t.length > 0 || n.length > 0, a = je(e), r = e.qualifiedHints || [], s = r.some(
573
574
  (c) => {
574
575
  var l;
575
576
  return (l = u(c)) == null ? void 0 : l.includes(".");
576
577
  }
577
- ), o = _e({
578
+ ), o = Te({
578
579
  entities: t,
579
580
  connectionType: u(e.connectionType),
580
581
  dialect: e.dialect,
@@ -586,7 +587,7 @@ function nt(e) {
586
587
  if (o.kind === "malformed" || o.kind === "conflicting" || o.kind === "incompatible_capabilities" && s || o.kind === "ambiguous" && o.basis === "qualified")
587
588
  return o;
588
589
  if (o.kind === "resolved" && o.basis === "qualified") {
589
- const c = O({
590
+ const c = M({
590
591
  resolution: o,
591
592
  connectionId: e.connectionId
592
593
  });
@@ -598,7 +599,7 @@ function nt(e) {
598
599
  } : { kind: "missing_connection" };
599
600
  }
600
601
  if (o.kind === "not_found" && o.basis === "qualified" && o.coordinates) {
601
- if (a.kind === "resolved" && a.matchedById && Pe({
602
+ if (a.kind === "resolved" && a.matchedById && Me({
602
603
  entity: a.entity,
603
604
  coordinates: o.coordinates,
604
605
  capabilityAuthority: o.capabilityAuthority,
@@ -610,7 +611,7 @@ function nt(e) {
610
611
  source: a.source,
611
612
  entity: a.entity
612
613
  };
613
- const c = O({
614
+ const c = M({
614
615
  resolution: o,
615
616
  connectionId: e.connectionId
616
617
  });
@@ -625,7 +626,7 @@ function nt(e) {
625
626
  };
626
627
  if (a.kind === "ambiguous") return a;
627
628
  if (o.kind === "resolved") {
628
- const c = O({
629
+ const c = M({
629
630
  resolution: o,
630
631
  connectionId: e.connectionId
631
632
  });
@@ -649,7 +650,7 @@ function nt(e) {
649
650
  }
650
651
  };
651
652
  if (o.kind === "incompatible_capabilities") {
652
- const c = i ? void 0 : je(e), l = u(e.connectionId);
653
+ const c = i ? void 0 : Oe(e), l = u(e.connectionId);
653
654
  return c && l ? {
654
655
  kind: "resolved",
655
656
  basis: "historical",
@@ -662,17 +663,17 @@ function nt(e) {
662
663
  } : { kind: "unqualified" };
663
664
  }
664
665
  const le = "click-reach:";
665
- function it(e, t) {
666
+ function ct(e, t) {
666
667
  const n = t.source.kind === "semantic" ? t.source.datasetName : t.source.tableName;
667
668
  return `${le}${e}:${n}.${t.name}`;
668
669
  }
669
- function at(e) {
670
+ function lt(e) {
670
671
  return typeof e == "string" && e.startsWith(le);
671
672
  }
672
- function Re(e, t) {
673
- return Ie({ ...e, role: t });
673
+ function $e(e, t) {
674
+ return Ce({ ...e, role: t });
674
675
  }
675
- function ot(e, t) {
676
+ function dt(e, t) {
676
677
  if (t.id) {
677
678
  const n = [];
678
679
  e.forEach(
@@ -681,7 +682,7 @@ function ot(e, t) {
681
682
  })
682
683
  );
683
684
  const i = t.alias ? n.find(
684
- ({ group: a, index: r }) => Re(e[a].fields[r], e[a].role) === t.alias
685
+ ({ group: a, index: r }) => $e(e[a].fields[r], e[a].role) === t.alias
685
686
  ) : void 0;
686
687
  if (i) return i;
687
688
  if (n.length === 1) return n[0];
@@ -700,14 +701,14 @@ function de(e, t) {
700
701
  const [a, r] = n.length <= i.length ? [n, i] : [i, n], s = r.length - a.length;
701
702
  return a.every((o, d) => o === r[d + s]);
702
703
  }
703
- function Oe(e, t) {
704
+ function we(e, t) {
704
705
  const n = e.split("."), i = t.split("."), a = n.pop(), r = i.pop();
705
706
  return !!(a && a === r && n.length > 0 && i.length > 0 && de(
706
707
  n.join("."),
707
708
  i.join(".")
708
709
  ));
709
710
  }
710
- function we(e) {
711
+ function ze(e) {
711
712
  const t = e.map((i) => i.trim()).filter(Boolean);
712
713
  if (t.every(
713
714
  (i, a) => t.slice(a + 1).every(
@@ -731,27 +732,27 @@ function W(e) {
731
732
  const t = e.split(".").map((n) => n.trim());
732
733
  return t.length > 0 && t.every(Boolean) ? t.join(".") : "";
733
734
  }
734
- function g(e) {
735
+ function y(e) {
735
736
  return typeof e == "string" ? e.trim() : "";
736
737
  }
737
- function ze(e, t) {
738
+ function Qe(e, t) {
738
739
  return e.every(
739
740
  (n, i) => e.slice(i + 1).every((a) => t(n, a))
740
741
  );
741
742
  }
742
- function $e(e, t) {
743
- const n = g(e.id), i = g(e.name), a = g(t.entityId), r = g(t.entityName);
743
+ function We(e, t) {
744
+ const n = y(e.id), i = y(e.name), a = y(t.entityId), r = y(t.entityName);
744
745
  return !i || !a && !r ? !1 : (!a || a === n || a === i) && (!r || r === i);
745
746
  }
746
- function Me(e) {
747
- const t = v(e.semanticContext) ? e.semanticContext : void 0, n = v(e.fieldMeta) ? e.fieldMeta : void 0, i = g(t == null ? void 0 : t.semanticDomainId), a = Array.isArray(t == null ? void 0 : t.selectedEntities) ? t.selectedEntities.filter(
747
+ function Ke(e) {
748
+ const t = v(e.semanticContext) ? e.semanticContext : void 0, n = v(e.fieldMeta) ? e.fieldMeta : void 0, i = y(t == null ? void 0 : t.semanticDomainId), a = Array.isArray(t == null ? void 0 : t.selectedEntities) ? t.selectedEntities.filter(
748
749
  (h) => v(h) && h.type === "dataset"
749
750
  ) : [];
750
751
  if (!!!(i || a.length > 0 || (n == null ? void 0 : n.entityType) === "dataset")) return;
751
752
  if (!i)
752
753
  return { status: "unresolved", reason: "incomplete_source_identity" };
753
- const s = g(n == null ? void 0 : n.entityId), o = g(n == null ? void 0 : n.entityName), d = !!(s || o), c = d ? a.filter(
754
- (h) => $e(h, {
754
+ const s = y(n == null ? void 0 : n.entityId), o = y(n == null ? void 0 : n.entityName), d = !!(s || o), c = d ? a.filter(
755
+ (h) => We(h, {
755
756
  entityId: s,
756
757
  entityName: o
757
758
  })
@@ -760,22 +761,22 @@ function Me(e) {
760
761
  return { status: "unresolved", reason: "incomplete_source_identity" };
761
762
  if (d && a.length > 0 && c.length === 0)
762
763
  return { status: "unresolved", reason: "divergent_source_identity" };
763
- const l = c[0], m = g(l == null ? void 0 : l.domainId), y = g(l == null ? void 0 : l.id), k = g(l == null ? void 0 : l.name);
764
+ const l = c[0], m = y(l == null ? void 0 : l.domainId), b = y(l == null ? void 0 : l.id), k = y(l == null ? void 0 : l.name);
764
765
  if (m && m !== i)
765
766
  return { status: "unresolved", reason: "divergent_source_identity" };
766
- const b = y, I = k || o;
767
+ const g = b, I = k || o;
767
768
  return I ? {
768
769
  status: "resolved",
769
770
  source: {
770
771
  kind: "semantic",
771
772
  domainId: i,
772
773
  datasetName: I,
773
- ...b ? { datasetId: b } : {}
774
+ ...g ? { datasetId: g } : {}
774
775
  }
775
776
  } : { status: "unresolved", reason: "incomplete_source_identity" };
776
777
  }
777
- function Qe(e, t) {
778
- const n = g(e.connectionId), i = v(e.semanticContext) ? e.semanticContext : void 0, a = g(i == null ? void 0 : i.connectionId);
778
+ function Ue(e, t) {
779
+ const n = y(e.connectionId), i = v(e.semanticContext) ? e.semanticContext : void 0, a = y(i == null ? void 0 : i.connectionId);
779
780
  if (n && a && n !== a)
780
781
  return { status: "unresolved", reason: "divergent_source_identity" };
781
782
  const r = n || a, s = v(e.fieldMeta) ? e.fieldMeta : void 0, o = t.split(".").slice(0, -1).join("."), d = W(e.qualifiedTableName), c = W(
@@ -784,13 +785,13 @@ function Qe(e, t) {
784
785
  d,
785
786
  c,
786
787
  o
787
- ].filter(Boolean), m = we(l);
788
+ ].filter(Boolean), m = ze(l);
788
789
  return !m && l.length > 0 ? { status: "unresolved", reason: "divergent_source_identity" } : !r || !m ? { status: "unresolved", reason: "incomplete_source_identity" } : {
789
790
  status: "resolved",
790
791
  source: { kind: "physical", connectionId: r, tableName: m }
791
792
  };
792
793
  }
793
- function We(e, t) {
794
+ function Ge(e, t) {
794
795
  const n = v(e.fieldMeta) ? e.fieldMeta : void 0, i = typeof (n == null ? void 0 : n.qualifiedFieldName) == "string" ? n.qualifiedFieldName.trim() : "", a = ee(
795
796
  n == null ? void 0 : n.qualifiedFieldName
796
797
  ), r = typeof e.column == "string" ? e.column.trim() : "", s = ee(r), o = typeof e.qualifiedTableName == "string" ? e.qualifiedTableName.trim() : "", d = W(
@@ -798,20 +799,20 @@ function We(e, t) {
798
799
  );
799
800
  if (i && !a || t && o && !d || r.includes(".") && !s)
800
801
  return { status: "unresolved", reason: "incomplete_field_identity" };
801
- const c = s.split("."), l = s ? c[c.length - 1] : r, m = t && d && l ? `${d}.${l}` : "", y = [
802
+ const c = s.split("."), l = s ? c[c.length - 1] : r, m = t && d && l ? `${d}.${l}` : "", b = [
802
803
  a,
803
804
  s,
804
805
  m
805
806
  ].filter(Boolean);
806
- if (!ze(
807
- y,
808
- Oe
807
+ if (!Qe(
808
+ b,
809
+ we
809
810
  ))
810
811
  return { status: "unresolved", reason: "divergent_field_identity" };
811
812
  const k = s || a || m;
812
813
  return k ? { status: "resolved", qualifiedFieldName: k } : { status: "unresolved", reason: "incomplete_field_identity" };
813
814
  }
814
- function Ke(e) {
815
+ function Ve(e) {
815
816
  if (!v(e))
816
817
  return { status: "ineligible", reason: "invalid_input" };
817
818
  if (e.kind === "global-date")
@@ -828,10 +829,10 @@ function Ke(e) {
828
829
  return { status: "ineligible", reason: "custom_filter" };
829
830
  if (e.targetColumns !== void 0 && (!Array.isArray(e.targetColumns) || e.targetColumns.length > 0))
830
831
  return { status: "ineligible", reason: "multi_target_filter" };
831
- const a = Me(e), r = We(e, a === void 0);
832
+ const a = Ke(e), r = Ge(e, a === void 0);
832
833
  if (r.status === "unresolved")
833
834
  return { status: "ineligible", reason: r.reason };
834
- const s = a || Qe(e, r.qualifiedFieldName);
835
+ const s = a || Ue(e, r.qualifiedFieldName);
835
836
  return s.status === "resolved" ? {
836
837
  status: "eligible",
837
838
  kind: "field_date",
@@ -839,91 +840,114 @@ function Ke(e) {
839
840
  source: s.source
840
841
  } : { status: "ineligible", reason: s.reason };
841
842
  }
842
- function Ge(e) {
843
+ function Xe(e) {
843
844
  if (!v(e) || e.kind !== "filter" || !v(e.filter))
844
845
  return { status: "ineligible", reason: "invalid_input" };
845
- const t = Ke(
846
+ const t = Ve(
846
847
  e.filter
847
848
  );
848
849
  return t.status === "ineligible" ? t : t.kind === "field_date" && v(e.compatibility) && e.compatibility.source === "cardInlineFilter" ? { status: "ineligible", reason: "card_inline_filter" } : t;
849
850
  }
850
- function st(e) {
851
- return Ge(e).status === "eligible";
851
+ function ut(e) {
852
+ return Xe(e).status === "eligible";
852
853
  }
853
- function rt(e) {
854
+ function ft(e) {
854
855
  return `compat-filter:${e}`;
855
856
  }
856
- function ct(e) {
857
+ function mt(e) {
857
858
  return `compat-control:${e}`;
858
859
  }
859
- function lt(e, t) {
860
+ function gt(e, t) {
860
861
  return `compat-inline-filter:${e}:${t}`;
861
862
  }
862
- function dt(e, t) {
863
+ function bt(e, t) {
863
864
  return `compat-card-control:${e}:${t}`;
864
865
  }
865
- function ue(e, t) {
866
+ function Je(e) {
867
+ var i;
868
+ if (!e) return !1;
869
+ if (typeof e.aggregate == "string" || e.isPreAggregated) return !0;
870
+ const t = typeof e.expression == "string" ? e.expression : "";
871
+ if (!t) return !1;
872
+ if (_e(t).calls.length > 0) return !0;
873
+ const n = (i = e.calculatedFormula) == null ? void 0 : i.inputFields;
874
+ return Array.isArray(n) && n.some((a) => {
875
+ const r = String((a == null ? void 0 : a.role) || "").toLowerCase(), s = String((a == null ? void 0 : a.aggregate) || "").trim();
876
+ return r === "metric" && s.length > 0;
877
+ });
878
+ }
879
+ function yt(e) {
880
+ return !!((e == null ? void 0 : e.role) === "metric" && (Ie(e) || Je(e)));
881
+ }
882
+ const ue = "col:";
883
+ function ht(e) {
884
+ return `${ue}${e}`;
885
+ }
886
+ function pt(e) {
887
+ return typeof e == "string" && e.startsWith(ue);
888
+ }
889
+ function fe(e, t) {
866
890
  if (e) return e;
867
891
  const n = t === void 0 ? "unknown" : Q(t);
868
892
  return n === "number" || n === "unknown" ? "SUM" : "COUNT";
869
893
  }
870
- function Ue(e) {
871
- const t = e.aggregate === ue(e.semanticAggregate, e.dataType);
894
+ function Ye(e) {
895
+ const t = e.aggregate === fe(e.semanticAggregate, e.dataType);
872
896
  return {
873
897
  effectiveAggregate: e.aggregate,
874
898
  aggregateSource: t ? e.semanticAggregate ? "semantic_model" : "default_sum" : "caller_override"
875
899
  };
876
900
  }
877
- function Ve(e, t, n) {
901
+ function Ze(e, t, n) {
878
902
  const i = e.effectiveAggregate !== void 0 || e.aggregateSource !== void 0;
879
903
  return {
880
904
  aggregate: t,
881
905
  aggregateOrigin: n,
882
- ...i ? Ue({ aggregate: t, semanticAggregate: e.semanticAggregate, dataType: e.dataType }) : {}
906
+ ...i ? Ye({ aggregate: t, semanticAggregate: e.semanticAggregate, dataType: e.dataType }) : {}
883
907
  };
884
908
  }
885
- function ut(e, t, n) {
886
- return { ...e, ...Ve(e, t, n) };
909
+ function vt(e, t, n) {
910
+ return { ...e, ...Ze(e, t, n) };
887
911
  }
888
- function ft(e) {
912
+ function kt(e) {
889
913
  return e.aggregate ?? e.effectiveAggregate;
890
914
  }
891
- function mt(e) {
915
+ function It(e) {
892
916
  if (!e.aggregate) return !1;
893
917
  if (e.aggregateOrigin === "explicit" || e.aggregateSource === "caller_override") return !0;
894
918
  if (e.aggregateSource) {
895
- const t = e.aggregateSource === "default_sum" ? ue(void 0, e.dataType) : e.semanticAggregate ?? e.effectiveAggregate;
919
+ const t = e.aggregateSource === "default_sum" ? fe(void 0, e.dataType) : e.semanticAggregate ?? e.effectiveAggregate;
896
920
  return t !== void 0 && e.aggregate !== t;
897
921
  }
898
922
  return e.aggregateOrigin !== "default";
899
923
  }
900
- const bt = ["label", "labelOrigin", "derivedLabel"];
901
- function yt(e) {
924
+ const Nt = ["label", "labelOrigin", "derivedLabel"];
925
+ function Ct(e) {
902
926
  return { label: e, labelOrigin: "override", derivedLabel: void 0 };
903
927
  }
904
- function gt(e, t) {
928
+ function _t(e, t) {
905
929
  const { derivedLabel: n, ...i } = e;
906
930
  return { ...i, label: t, labelOrigin: "override" };
907
931
  }
908
- function ht(e, t) {
932
+ function St(e, t) {
909
933
  return e.labelOrigin === "override" ? {} : { label: t, labelOrigin: "semantic" };
910
934
  }
911
- function pt(e) {
935
+ function At(e) {
912
936
  if (e.groupedDate !== void 0) return { target: e.groupedDate, direction: "asc" };
913
937
  if (!(!e.grouped || e.measures.length === 0))
914
938
  return { target: e.primaryMeasure ?? e.measures[0], direction: "desc" };
915
939
  }
916
- const vt = /* @__PURE__ */ new Set([
940
+ const Tt = /* @__PURE__ */ new Set([
917
941
  "contains",
918
942
  "startsWith",
919
943
  "endsWith",
920
944
  "like",
921
945
  "not like"
922
946
  ]);
923
- function fe(e) {
947
+ function me(e) {
924
948
  return e.includes("%") || e.includes("_");
925
949
  }
926
- function Je(e, t) {
950
+ function et(e, t) {
927
951
  switch (e) {
928
952
  case "contains":
929
953
  return { pattern: `%${t}%`, negate: !1 };
@@ -937,35 +961,35 @@ function Je(e, t) {
937
961
  return { pattern: t, negate: !0 };
938
962
  }
939
963
  }
940
- function Xe(e) {
941
- return fe(e) ? e : `%${e}%`;
964
+ function tt(e) {
965
+ return me(e) ? e : `%${e}%`;
942
966
  }
943
- function kt(e, t) {
944
- const { pattern: n, negate: i } = Je(e, t), a = n.length > 2 && n.startsWith("%") && n.endsWith("%") ? n.slice(1, -1) : void 0, r = a !== void 0 && !fe(a) ? a : n;
945
- if (Xe(r) === n)
967
+ function Dt(e, t) {
968
+ const { pattern: n, negate: i } = et(e, t), a = n.length > 2 && n.startsWith("%") && n.endsWith("%") ? n.slice(1, -1) : void 0, r = a !== void 0 && !me(a) ? a : n;
969
+ if (tt(r) === n)
946
970
  return { operator: i ? "not_contains" : "contains", value: r };
947
971
  }
948
- function It(e) {
972
+ function Et(e) {
949
973
  const { operation: t, values: n, temporalPrecision: i } = e;
950
974
  if (t !== "=" && t !== "!=" || i === "minute")
951
975
  return null;
952
976
  const a = Array.isArray(n) ? n : [n];
953
977
  if (a.length !== 1 || typeof a[0] != "string") return null;
954
978
  const r = a[0].trim();
955
- return he(r) ? { operation: t, day: r } : null;
979
+ return pe(r) ? { operation: t, day: r } : null;
956
980
  }
957
- function me(e) {
981
+ function ge(e) {
958
982
  const { label: t, ...n } = e;
959
983
  return {
960
- dataset: ke(n),
984
+ dataset: Ne(n),
961
985
  ...e.kind === "physical" ? { dialect: e.dialect, connectionType: e.connectionType } : {}
962
986
  };
963
987
  }
964
988
  function be(e) {
965
989
  const { label: t, source: n, ...i } = e;
966
- return { ...i, source: n && me(n) };
990
+ return { ...i, source: n && ge(n) };
967
991
  }
968
- function U(e) {
992
+ function G(e) {
969
993
  const {
970
994
  label: t,
971
995
  format: n,
@@ -984,14 +1008,14 @@ function U(e) {
984
1008
  )
985
1009
  };
986
1010
  }
987
- function w(e) {
1011
+ function O(e) {
988
1012
  const { derivedField: t, ...n } = e;
989
1013
  return {
990
1014
  ...be(n),
991
- derivedField: t && U(t)
1015
+ derivedField: t && G(t)
992
1016
  };
993
1017
  }
994
- function L(e) {
1018
+ function x(e) {
995
1019
  const {
996
1020
  label: t,
997
1021
  format: n,
@@ -1006,10 +1030,10 @@ function L(e) {
1006
1030
  semanticTemporalPresentation: a && {
1007
1031
  granularity: a.granularity
1008
1032
  },
1009
- derivedField: r && U(r),
1033
+ derivedField: r && G(r),
1010
1034
  calculatedFormula: s && {
1011
1035
  ...s,
1012
- inputFields: s.inputFields.map(L)
1036
+ inputFields: s.inputFields.map(x)
1013
1037
  }
1014
1038
  };
1015
1039
  }
@@ -1019,28 +1043,28 @@ function ye(e) {
1019
1043
  conditions: e.conditions.map(
1020
1044
  ({ label: t, field: n, ...i }) => ({
1021
1045
  ...i,
1022
- field: L(n)
1046
+ field: x(n)
1023
1047
  })
1024
1048
  ),
1025
1049
  groups: e.groups.map(ye)
1026
1050
  };
1027
1051
  }
1028
- function Nt(e) {
1052
+ function qt(e) {
1029
1053
  return {
1030
1054
  ...e,
1031
- source: me(e.source),
1055
+ source: ge(e.source),
1032
1056
  rows: e.rows.map((t) => ({
1033
1057
  ...t,
1034
- field: w(t.field)
1058
+ field: O(t.field)
1035
1059
  })),
1036
1060
  columns: e.columns.map((t) => ({
1037
1061
  ...t,
1038
- field: w(t.field)
1062
+ field: O(t.field)
1039
1063
  })),
1040
1064
  measures: e.measures.map(
1041
- (t) => t.kind === "aggregate" ? { ...t, field: w(t.field) } : {
1065
+ (t) => t.kind === "aggregate" ? { ...t, field: O(t.field) } : {
1042
1066
  ...t,
1043
- definition: U(t.definition)
1067
+ definition: G(t.definition)
1044
1068
  }
1045
1069
  ),
1046
1070
  filters: e.filters && ye(e.filters),
@@ -1053,61 +1077,65 @@ function Nt(e) {
1053
1077
  ...n,
1054
1078
  keys: n.keys.map((i) => ({
1055
1079
  ...i,
1056
- source: L(i.source),
1057
- target: L(i.target)
1080
+ source: x(i.source),
1081
+ target: x(i.target)
1058
1082
  }))
1059
1083
  }))
1060
1084
  }))
1061
1085
  },
1062
1086
  // Sort scopes are keyed overrides, unlike ordered axes/calculation inputs.
1063
1087
  sorts: [...e.sorts].sort((t, n) => {
1064
- const i = X(t), a = X(n);
1088
+ const i = J(t), a = J(n);
1065
1089
  return i < a ? -1 : i > a ? 1 : 0;
1066
1090
  })
1067
1091
  };
1068
1092
  }
1069
1093
  export {
1070
- ft as A,
1071
- mt as B,
1072
- bt as C,
1073
- yt as D,
1074
- gt as E,
1075
- pt as F,
1076
- fe as G,
1077
- Je as H,
1078
- Xe as I,
1079
- kt as J,
1080
- It as K,
1081
- de as L,
1082
- we as M,
1083
- U as N,
1084
- Oe as O,
1094
+ Se as A,
1095
+ fe as B,
1096
+ Ye as C,
1097
+ vt as D,
1098
+ kt as E,
1099
+ It as F,
1100
+ Nt as G,
1101
+ Ct as H,
1102
+ _t as I,
1103
+ At as J,
1104
+ me as K,
1105
+ et as L,
1106
+ tt as M,
1107
+ Dt as N,
1108
+ Et as O,
1109
+ de as P,
1110
+ ze as Q,
1085
1111
  Y as R,
1086
- vt as S,
1087
- Nt as a,
1112
+ Tt as S,
1113
+ G as T,
1114
+ we as U,
1115
+ qt as a,
1088
1116
  ae as b,
1089
1117
  oe as c,
1090
- _e as d,
1118
+ Te as d,
1091
1119
  ce as e,
1092
- xe as f,
1093
- ht as g,
1094
- nt as h,
1095
- at as i,
1096
- it as j,
1097
- ot as k,
1098
- $e as l,
1099
- Ve as m,
1100
- Ke as n,
1101
- Ge as o,
1102
- st as p,
1103
- rt as q,
1104
- tt as r,
1105
- Re as s,
1106
- ct as t,
1107
- lt as u,
1108
- dt as v,
1109
- Ne as w,
1110
- ue as x,
1111
- Ue as y,
1112
- ut as z
1120
+ je as f,
1121
+ St as g,
1122
+ rt as h,
1123
+ lt as i,
1124
+ ct as j,
1125
+ dt as k,
1126
+ We as l,
1127
+ Ze as m,
1128
+ Ve as n,
1129
+ Xe as o,
1130
+ ut as p,
1131
+ ft as q,
1132
+ st as r,
1133
+ $e as s,
1134
+ mt as t,
1135
+ gt as u,
1136
+ bt as v,
1137
+ Je as w,
1138
+ yt as x,
1139
+ ht as y,
1140
+ pt as z
1113
1141
  };