react-semaphor 0.1.581 → 0.1.583

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 (50) hide show
  1. package/dist/analytics-protocol/index.js +1 -1
  2. package/dist/assistant-context/index.js +1 -1
  3. package/dist/briefings/index.js +2 -2
  4. package/dist/chunks/{assistant-chat-CUwGURJj.js → assistant-chat-D3fm5qod.js} +6 -6
  5. package/dist/chunks/{bookmark-impact-BNyR-yDX.js → bookmark-impact-Dpxl46Wd.js} +1 -1
  6. package/dist/chunks/{card-filter-builder-k9yqDSw8.js → card-filter-builder-IxkFVxy2.js} +3 -3
  7. package/dist/chunks/{comparison-window-caption-DdLqMgiG.js → comparison-window-caption-sRFtnX1q.js} +15 -15
  8. package/dist/chunks/{dashboard-DvcAk8uJ.js → dashboard-BMqG98fc.js} +1 -1
  9. package/dist/chunks/{dashboard-briefing-launcher-DBgS97ZH.js → dashboard-briefing-launcher-D45YfCkm.js} +83 -83
  10. package/dist/chunks/{dashboard-controls-BiZ1rlNC.js → dashboard-controls-DOvZRfof.js} +8 -8
  11. package/dist/chunks/{dashboard-json-B25xzYcJ.js → dashboard-json-B_4TqF_o.js} +1 -1
  12. package/dist/chunks/{dates-3Pah03_l.js → dates-44_rcNj2.js} +5 -5
  13. package/dist/chunks/{edit-dashboard-visual-DYuO3mEU.js → edit-dashboard-visual-BBPKJWSe.js} +2154 -2144
  14. package/dist/chunks/{filter-reach-copy-CzLt96tq.js → filter-reach-copy-DWPq4Swi.js} +655 -655
  15. package/dist/chunks/{filter-value-text-DvvSNlho.js → filter-value-text-DXGYypEd.js} +1 -1
  16. package/dist/chunks/{index-BMZq6JT6.js → index-DPRzcFp0.js} +2 -2
  17. package/dist/chunks/{matrix-analytical-definition-dkS8szLM.js → matrix-analytical-definition-D_HgptqZ.js} +1 -1
  18. package/dist/chunks/pivot-header-presentation-MvvlxtIB.js +42 -0
  19. package/dist/chunks/{temporal-input-presentation-CqbJjIuu.js → pivot-result-contract-expectations-8tuNjRvG.js} +570 -560
  20. package/dist/chunks/{report-preferences-dialog-DpAetrdY.js → report-preferences-dialog-B8PhISua.js} +8 -8
  21. package/dist/chunks/{resolve-dashboard-input-context-CNxtkCzj.js → resolve-dashboard-input-context-BfT8y5xL.js} +7041 -6751
  22. package/dist/chunks/{saved-dashboard-context-Bnt0H7mi.js → saved-dashboard-context-DH91-2B9.js} +3 -3
  23. package/dist/chunks/{semaphor-ready-indicator-Dwmvmf0S.js → semaphor-ready-indicator-Cg_Z2IDc.js} +26974 -26890
  24. package/dist/chunks/{shelf-drop-preview-context-CiveteBS.js → shelf-drop-preview-context-C7-BgcP4.js} +2 -2
  25. package/dist/chunks/{stored-dashboard-D3gu-D7A.js → stored-dashboard-BpyCiE49.js} +1214 -1389
  26. package/dist/chunks/{table-export-sheet-BNGSJA2N.js → table-export-sheet-wBkk17aa.js} +1 -1
  27. package/dist/chunks/{variable-draft-C3_RL2gI.js → variable-draft-D8GFhAkm.js} +3 -3
  28. package/dist/dashboard/index.js +1 -1
  29. package/dist/dashboard-authoring/index.js +1549 -1534
  30. package/dist/format-utils/index.js +207 -206
  31. package/dist/index.js +12 -12
  32. package/dist/style.css +1 -1
  33. package/dist/surfboard/index.js +1 -1
  34. package/dist/types/components/ui-custom/date-range-presets.d.ts +7 -0
  35. package/dist/types/components/visual/data-table/types/data-table.d.ts +16 -6
  36. package/dist/types/lib/document/document-section-query-options.d.ts +3 -4
  37. package/dist/types/lib/hooks/use-dashboard-frame-query.d.ts +4 -1
  38. package/dist/types/lib/query-context/card-server-request.d.ts +6 -4
  39. package/dist/types/lib/table-formatting/table-totals-settings.d.ts +25 -2
  40. package/dist/types/lib/types/explorer-types.d.ts +7 -2
  41. package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +19 -2
  42. package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +12 -3
  43. package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +4 -1
  44. package/dist/types/shared/dashboard-authoring/measure-calculations/index.d.ts +1 -0
  45. package/dist/types/shared/dashboard-authoring/measure-calculations/table-column-total.d.ts +42 -0
  46. package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +7 -0
  47. package/dist/types/shared/format-utils/flat-table-export-totals.d.ts +6 -1
  48. package/dist/types/shared/usage-events/details.d.ts +2 -2
  49. package/package.json +1 -1
  50. package/dist/chunks/pivot-result-contract-expectations-C-HnUKYe.js +0 -55
@@ -1,24 +1,24 @@
1
- import { J as vr, K as Ir, M as Cr, N as ln, O as Fr, P as Sr, Q as xr, R as Tr, S as wr, T as dn, U as Dr, V as kr, W as Or, X as Pe, Y as Mr, Z as _r, _ as Ar, g as Pr, k as Ie, $ as Nr, a0 as $r } from "./stored-dashboard-D3gu-D7A.js";
2
- import { fU as un, bu as Ce, fV as Er, fW as Rr, fX as Kr, fY as Lr, P as Y, fZ as fn, bw as Vr, f_ as Br, f$ as Je, ai as Ze, g0 as qr, g1 as Ur, g2 as zr, L as et, g3 as jr, bJ as Gr, Q as Wr, g4 as Hr, M as Yr, m as tt, g5 as nt, g6 as Qr, g7 as F, o as we, g8 as Z, g9 as T, ga as Xr, gb as Jr, gc as kt, gd as Zr, ge as Ot, gf as ei, aR as w, gg as mn, b0 as De, gh as ti, gi as ni, gj as ri, gk as ii, gl as ai, gm as pn, cq as gn, gn as hn, go as yn, fT as Fe, gp as Mt, a4 as Q, gq as rt, gr as _t, gs as it, t as At, gt as Pt, cd as at, gu as oi, gv as si, gw as ie, gx as ci, gy as li, gz as di, a7 as ui, bD as fi, ci as ot, aD as mi, gA as Nt, gB as bn, gC as qe, K as pi, aG as gi, ee as hi, gD as yi, gE as bi, gF as vi, gG as Ii, gH as Ci, gI as Fi, gJ as Si, gK as xi, gL as Ue, fS as Ti, fN as Ne, gM as wi, gN as Di, gO as vn, a as In, gP as ki, gQ as Oi, db as Cn, gR as $t, cL as Mi, de as Et, dd as _i, em as Ai, aV as Pi, eZ as Ni, gS as $i, gT as Ei, cx as Rt } from "./resolve-dashboard-input-context-CNxtkCzj.js";
3
- import { a5 as le, s as Ri, d as Ki, r as Fn, aE as Li, a2 as Sn, au as Vi, n as Bi, c as qi } from "./validators-B8fpdinG.js";
4
- import { M as Ui, l as $e } from "./matrix-operation-contract-DCVinw1o.js";
5
- import { r as zi, C as ji, a as Gi } from "./metric-comparison-n9NsIa-2.js";
1
+ import { J as vr, K as Ir, M as Cr, N as ln, O as Fr, P as Sr, Q as xr, R as Tr, S as wr, T as dn, U as Dr, V as Pe, W as kr, X as Or, Y as _r, g as Mr, k as Ie, Z as Ar, _ as Pr } from "./stored-dashboard-BpyCiE49.js";
2
+ import { fZ as un, bv as Ce, f_ as Nr, f$ as $r, g0 as Er, g1 as Rr, P as Y, g2 as fn, bx as Kr, g3 as Lr, g4 as Je, aj as Ze, g5 as Vr, g6 as Br, g7 as qr, L as et, g8 as Ur, g9 as zr, ga as jr, bK as Gr, Q as Wr, gb as Hr, M as Yr, m as tt, gc as nt, gd as Xr, ge as F, o as we, gf as Z, gg as T, gh as Qr, gi as Jr, gj as kt, gk as Zr, gl as Ot, gm as ei, aS as w, gn as mn, b1 as De, go as ti, gp as ni, gq as ri, gr as ii, gs as ai, gt as pn, cr as gn, gu as hn, gv as yn, fY as Fe, gw as _t, a4 as X, gx as rt, gy as Mt, gz as it, t as At, gA as Pt, ce as at, gB as oi, gC as si, gD as ie, gE as ci, gF as li, gG as di, a7 as bn, cj as ot, aE as ui, gH as Nt, gI as vn, gJ as qe, K as fi, aH as mi, ef as pi, gK as gi, gL as hi, gM as yi, gN as bi, gO as vi, gP as Ii, gQ as Ci, gR as Fi, gS as Ue, fX as Si, fS as Ne, gT as xi, gU as Ti, gV as In, a as Cn, gW as wi, gX as Di, dc as Fn, gY as $t, cM as ki, df as Et, de as Oi, en as _i, aW as Mi, e_ as Ai, gZ as Pi, g_ as Ni, cy as Rt } from "./resolve-dashboard-input-context-BfT8y5xL.js";
3
+ import { a5 as le, s as $i, d as Ei, aE as Ri, a2 as Sn, au as Ki, r as Li, n as Vi, c as Bi } from "./validators-B8fpdinG.js";
4
+ import { M as qi, l as $e } from "./matrix-operation-contract-DCVinw1o.js";
5
+ import { r as Ui, C as zi } from "./metric-comparison-n9NsIa-2.js";
6
6
  import { t as Kt, e as Lt } from "./analytics-base-schemas-BaIQrEzX.js";
7
7
  import "zod";
8
- import { b as J, i as N, aT as Wi, aU as Hi, m as Yi, h as Qi, d as ze, e as Xi, Q as _, af as Ji, am as Zi, c as ea, ah as ta, W as na, w as ra, a5 as ia } from "./temporal-input-presentation-CqbJjIuu.js";
8
+ import { c as J, i as N, aU as ji, aV as Gi, n as Wi, j as Hi, e as ze, g as Yi, R as M, af as Xi, am as Qi, d as Ji, ah as Zi, X as ea, w as ta, a6 as na } from "./pivot-result-contract-expectations-8tuNjRvG.js";
9
9
  import "../value-format-preferences/index.js";
10
- import { z as aa, T as oa, L as sa, ag as ca, a2 as Vt, O as xn, A as Tn, ar as la, P as wn, D as da, a6 as ua, a7 as fa, G as Dn, Y as ma, Z as kn, I as st, _ as On, as as pa } from "./bookmark-state-BEl_G9vr.js";
11
- import { g as ga } from "./pickers-DkqmtnTL.js";
12
- import { n as ha } from "./index-BVKzKl5d.js";
13
- import { f as ya, D as ba, g as va, C as me, i as Bt } from "./edit-9df1zOWe.js";
14
- import { D as Ia } from "./resolver-DG_tfEpt.js";
10
+ import { z as ra, T as ia, L as aa, ag as oa, a2 as Vt, O as xn, A as Tn, ar as sa, P as wn, D as ca, a6 as la, a7 as da, G as Dn, Y as ua, Z as kn, I as st, _ as On, as as fa } from "./bookmark-state-BEl_G9vr.js";
11
+ import { g as ma } from "./pickers-DkqmtnTL.js";
12
+ import { n as pa } from "./index-BVKzKl5d.js";
13
+ import { f as ga, D as ha, g as ya, C as me, i as Bt } from "./edit-9df1zOWe.js";
14
+ import { D as ba } from "./resolver-DG_tfEpt.js";
15
15
  import "./schema-C9NPiIru.js";
16
16
  import "./index-CV_Kzou0.js";
17
17
  import "./context-BTLBjQNh.js";
18
- import { r as Ca, Z as Fa, v as Sa } from "./matrix-analytical-definition-dkS8szLM.js";
18
+ import { r as va, Z as Ia, v as Ca } from "./matrix-analytical-definition-D_HgptqZ.js";
19
19
  import { r as je } from "./pivot-result-identity-B89X5xjb.js";
20
- import { r as Mn } from "./applied-constraints-DU-wndZ7.js";
21
- function xa(e, t) {
20
+ import { r as _n } from "./applied-constraints-DU-wndZ7.js";
21
+ function Fa(e, t) {
22
22
  if (!(typeof e != "number" || typeof t != "number"))
23
23
  return e === t ? t : void 0;
24
24
  }
@@ -55,7 +55,7 @@ function z(e, t) {
55
55
  type: n.type,
56
56
  locale: n.locale,
57
57
  currency: n.type === "currency" ? n.currency : void 0,
58
- decimalPlaces: t != null && t.preserveOmittedProperties ? void 0 : xa(
58
+ decimalPlaces: t != null && t.preserveOmittedProperties ? void 0 : Fa(
59
59
  n.minimumFractionDigits,
60
60
  n.maximumFractionDigits
61
61
  ),
@@ -72,7 +72,7 @@ function z(e, t) {
72
72
  };
73
73
  }
74
74
  }
75
- function _n(e, t) {
75
+ function Mn(e, t) {
76
76
  const n = J(e, t);
77
77
  return (n == null ? void 0 : n.type) === "duration" ? {
78
78
  style: "duration",
@@ -89,7 +89,7 @@ function _n(e, t) {
89
89
  } : !n || !N(n) ? void 0 : {
90
90
  style: n.type === "currency" ? "currency" : n.type === "percent" ? "percent" : n.type === "scientific" ? "scientific" : "decimal",
91
91
  currency: n.type === "currency" && n.currency || (t != null && t.preserveOmittedProperties ? void 0 : "USD"),
92
- locale: n.locale || (t != null && t.preserveOmittedProperties ? void 0 : Wi),
92
+ locale: n.locale || (t != null && t.preserveOmittedProperties ? void 0 : ji),
93
93
  minimumFractionDigits: n.minimumFractionDigits ?? (t != null && t.preserveOmittedProperties ? void 0 : 0),
94
94
  maximumFractionDigits: n.maximumFractionDigits ?? (t != null && t.preserveOmittedProperties ? void 0 : 2),
95
95
  useGrouping: typeof n.useGrouping == "boolean" ? n.useGrouping : !0,
@@ -102,21 +102,21 @@ function _n(e, t) {
102
102
  suffix: n.suffix
103
103
  };
104
104
  }
105
- const qt = [10, 20, 50, 100, 500, 1e3], Ta = 50;
106
- function wa(e) {
107
- return e && e > 0 ? e : Ta;
105
+ const qt = [10, 20, 50, 100, 500, 1e3], Sa = 50;
106
+ function xa(e) {
107
+ return e && e > 0 ? e : Sa;
108
108
  }
109
- function kc(e) {
110
- const t = wa(e), n = [...qt];
109
+ function wc(e) {
110
+ const t = xa(e), n = [...qt];
111
111
  return qt.includes(
112
112
  t
113
113
  ) || (n.push(t), n.sort((r, i) => r - i)), n;
114
114
  }
115
- function Oc(e) {
115
+ function Dc(e) {
116
116
  var t, n;
117
117
  return !!((e.type === "table" || e.type === "detailTable") && e.sql && !un(e.config) && !((n = (t = e.preferences) == null ? void 0 : t.tablePrefs) != null && n.forceClientPagination));
118
118
  }
119
- function Da(e, t) {
119
+ function Ta(e, t) {
120
120
  var r, i, o, a;
121
121
  if (t === "table-print")
122
122
  return "disabled";
@@ -125,7 +125,7 @@ function Da(e, t) {
125
125
  const n = un(e.config);
126
126
  return e.sql && !n ? (a = (o = e.preferences) == null ? void 0 : o.tablePrefs) != null && a.enableDevModePagination ? "server" : "client" : n && vr(e) ? "server" : "client";
127
127
  }
128
- const An = Object.freeze({}), Mc = {
128
+ const An = Object.freeze({}), kc = {
129
129
  access: "session-only",
130
130
  printMode: !1,
131
131
  baseline: null,
@@ -136,24 +136,24 @@ const An = Object.freeze({}), Mc = {
136
136
  isFavorite: !1,
137
137
  fetchedAt: 0
138
138
  };
139
- function _c(e) {
139
+ function Oc(e) {
140
140
  return !e.viewer.printMode && e.viewer.access !== "session-only" && !!e.viewer.baseline && !!e.viewerStateClient && !e.isDashboardEditing;
141
141
  }
142
- function ka(e) {
142
+ function wa(e) {
143
143
  return e.isDashboardEditing ? An : e.viewer.tableSettings;
144
144
  }
145
- function Oa(e, t) {
146
- return ka(e)[t];
145
+ function Da(e, t) {
146
+ return wa(e)[t];
147
147
  }
148
- function Ac(e, t, n) {
149
- if (!(n.isEditorPreview || e.isDashboardEditing) && aa(e.dashboard, t))
150
- return { settings: Oa(e, t) };
148
+ function _c(e, t, n) {
149
+ if (!(n.isEditorPreview || e.isDashboardEditing) && ra(e.dashboard, t))
150
+ return { settings: Da(e, t) };
151
151
  }
152
- function Ma(e) {
152
+ function ka(e) {
153
153
  var t;
154
154
  return Ir({
155
155
  card: e.card,
156
- paginationMode: Da(e.card) === "server" ? "server" : "client",
156
+ paginationMode: Ta(e.card) === "server" ? "server" : "client",
157
157
  result: {
158
158
  keys: e.keys ?? Cr(e.records),
159
159
  rows: e.records,
@@ -165,14 +165,14 @@ function Ma(e) {
165
165
  projection: "export"
166
166
  });
167
167
  }
168
- function _a(e) {
168
+ function Oa(e) {
169
169
  if (e)
170
170
  return z(
171
171
  J(e, { preserveOmittedProperties: !0 }),
172
172
  { preserveOmittedProperties: !0 }
173
173
  );
174
174
  }
175
- function Aa(e) {
175
+ function _a(e) {
176
176
  if (e.type === "percent") {
177
177
  const { multiplyBy: t, percentValueMode: n, ...r } = e, i = t === 100 ? "fraction" : t === 1 ? "whole" : t === void 0 ? n : void 0;
178
178
  if (i || t === void 0)
@@ -184,7 +184,7 @@ function Aa(e) {
184
184
  Ce(e, { preserveOmittedProperties: !0 })
185
185
  );
186
186
  }
187
- const ke = _a, Pc = Aa, Pa = () => ({
187
+ const ke = Oa, Mc = _a, Ma = () => ({
188
188
  urlTemplate: "{value}",
189
189
  // Default: use cell value as-is
190
190
  labelType: "value",
@@ -198,9 +198,9 @@ const ke = _a, Pc = Aa, Pa = () => ({
198
198
  inheritMetricFormat: !0,
199
199
  textAlign: "left",
200
200
  // The table's one width rule (card appearance P2-21).
201
- width: Kr,
202
- minWidth: Rr,
203
- maxWidth: Er,
201
+ width: Er,
202
+ minWidth: $r,
203
+ maxWidth: Nr,
204
204
  textOverflow: "ellipsis",
205
205
  textWrap: "default",
206
206
  numberFormat: {
@@ -222,12 +222,12 @@ const ke = _a, Pc = Aa, Pa = () => ({
222
222
  sourceTimezone: "auto"
223
223
  // Default to auto (use explicit timezone if present, otherwise assume UTC)
224
224
  },
225
- linkFormat: Pa()
225
+ linkFormat: Ma()
226
226
  });
227
- function Nc(e, t, n, r) {
227
+ function Ac(e, t, n, r) {
228
228
  return t && t !== "auto" ? t : n;
229
229
  }
230
- const $c = (e) => !e || e === "auto" ? "local time" : {
230
+ const Pc = (e) => !e || e === "auto" ? "local time" : {
231
231
  "America/New_York": "Eastern Time",
232
232
  "America/Chicago": "Central Time",
233
233
  "America/Denver": "Mountain Time",
@@ -264,8 +264,8 @@ function Se(e, t) {
264
264
  };
265
265
  }
266
266
  function lt(e, t = "auto", n = {}) {
267
- if (t === "auto" && (t = Ka(e, n)), (t === "number" || t === "currency" || t === "percent" || t === "scientific") && n.signDisplay && n.signDisplay !== "auto" && Number.isFinite(Number(e))) {
268
- const i = typeof n.multiplyBy == "number" && Number.isFinite(n.multiplyBy) ? n.multiplyBy : 1, o = Number(e) * i, a = Hi(o, n.signDisplay), s = lt(a.value === o ? e : -Number(e), t, { ...n, signDisplay: void 0 });
267
+ if (t === "auto" && (t = Ea(e, n)), (t === "number" || t === "currency" || t === "percent" || t === "scientific") && n.signDisplay && n.signDisplay !== "auto" && Number.isFinite(Number(e))) {
268
+ const i = typeof n.multiplyBy == "number" && Number.isFinite(n.multiplyBy) ? n.multiplyBy : 1, o = Number(e) * i, a = Gi(o, n.signDisplay), s = lt(a.value === o ? e : -Number(e), t, { ...n, signDisplay: void 0 });
269
269
  if (!a.plus) return s;
270
270
  const c = n.prefix ?? "";
271
271
  return c && s.startsWith(c) ? `${c}+${s.slice(c.length)}` : `+${s}`;
@@ -276,13 +276,13 @@ function lt(e, t = "auto", n = {}) {
276
276
  case "currency":
277
277
  return $n(e, n);
278
278
  case "percent":
279
- return Na(e, n);
279
+ return Aa(e, n);
280
280
  case "date":
281
- return $a(e, n);
281
+ return Pa(e, n);
282
282
  case "scientific":
283
- return Ea(e, n);
283
+ return Na(e, n);
284
284
  case "duration":
285
- return Ra(e, n);
285
+ return $a(e, n);
286
286
  default:
287
287
  return String(e);
288
288
  }
@@ -303,7 +303,7 @@ function Nn(e, t = {}) {
303
303
  );
304
304
  }
305
305
  function $n(e, t = {}) {
306
- return Xi(e, {
306
+ return Yi(e, {
307
307
  ...Se(t, {
308
308
  min: 2,
309
309
  max: 2
@@ -312,7 +312,7 @@ function $n(e, t = {}) {
312
312
  currency: t.currency || "USD"
313
313
  });
314
314
  }
315
- function Na(e, t = {}) {
315
+ function Aa(e, t = {}) {
316
316
  const n = Pn(t, { min: 1, max: 1 }), i = typeof t.multiplyBy == "number" && Number.isFinite(t.multiplyBy) ? t.multiplyBy : t.percentValueMode === "whole" ? 1 : 100, o = e * i;
317
317
  return ze(o, {
318
318
  locale: t.locale,
@@ -325,7 +325,7 @@ function Na(e, t = {}) {
325
325
  useSuffix: !1
326
326
  });
327
327
  }
328
- function $a(e, t = {}) {
328
+ function Pa(e, t = {}) {
329
329
  const { locale: n = "en-US" } = t;
330
330
  try {
331
331
  const r = new Date(e);
@@ -336,14 +336,14 @@ function $a(e, t = {}) {
336
336
  return String(e);
337
337
  }
338
338
  }
339
- function Ea(e, t = {}) {
340
- return Qi(
339
+ function Na(e, t = {}) {
340
+ return Hi(
341
341
  e,
342
342
  Se(t, { min: 2, max: 2 })
343
343
  );
344
344
  }
345
- function Ra(e, t = {}) {
346
- return Yi(e, {
345
+ function $a(e, t = {}) {
346
+ return Wi(e, {
347
347
  inputUnit: t.durationInputUnit,
348
348
  outputStyle: t.durationDisplayStyle,
349
349
  largestUnit: t.durationLargestUnit,
@@ -354,13 +354,13 @@ function Ra(e, t = {}) {
354
354
  negativeInParentheses: t.negativeInParentheses
355
355
  });
356
356
  }
357
- function Ka(e, t) {
357
+ function Ea(e, t) {
358
358
  return t.currency ? "currency" : typeof e == "string" && !isNaN(Date.parse(e)) ? "date" : "number";
359
359
  }
360
- function Ec(e, t = {}) {
360
+ function Nc(e, t = {}) {
361
361
  return (n) => lt(n, e, t);
362
362
  }
363
- function La({
363
+ function Ra({
364
364
  number: e,
365
365
  decimalPlaces: t = 0,
366
366
  useSuffix: n = !1,
@@ -384,7 +384,7 @@ function La({
384
384
  locale: o
385
385
  });
386
386
  }
387
- var Va = function e(t, n) {
387
+ var Ka = function e(t, n) {
388
388
  if (t === n) return !0;
389
389
  if (t && n && typeof t == "object" && typeof n == "object") {
390
390
  if (t.constructor !== n.constructor) return !1;
@@ -410,7 +410,7 @@ var Va = function e(t, n) {
410
410
  }
411
411
  return t !== t && n !== n;
412
412
  };
413
- const xe = /* @__PURE__ */ ga(Va);
413
+ const xe = /* @__PURE__ */ ma(Ka);
414
414
  function dt(e, t) {
415
415
  var n;
416
416
  if (t.id)
@@ -421,13 +421,13 @@ function En(e) {
421
421
  if (!t)
422
422
  return e.authoredFormat;
423
423
  const n = dt(e.card, e.metric);
424
- return _(
424
+ return M(
425
425
  e.authoredFormat,
426
426
  t,
427
427
  n ? e.context.resolveBoundCurrency(n) : void 0
428
428
  );
429
429
  }
430
- function Ba(e) {
430
+ function La(e) {
431
431
  const t = Y(e.card)[e.columnKey], n = (t == null ? void 0 : t.type) === "number" ? Fr(
432
432
  { dataType: "number", format: void 0 },
433
433
  t
@@ -449,9 +449,9 @@ function Ba(e) {
449
449
  format: i
450
450
  };
451
451
  }
452
- function Rc(e) {
452
+ function $c(e) {
453
453
  const t = new Set(
454
- Lr(e.records)
454
+ Rr(e.records)
455
455
  ), n = new Set(
456
456
  e.renderedMetricKeys || e.resultKeys
457
457
  ), r = Y(e.card);
@@ -462,13 +462,13 @@ function Rc(e) {
462
462
  }
463
463
  );
464
464
  }
465
- function Kc(e) {
465
+ function Ec(e) {
466
466
  var o, a;
467
467
  const { card: t, context: n } = e;
468
468
  if (!(n != null && n.preferences) || !fn(t.type))
469
469
  return t;
470
470
  const r = n.preferences, i = (o = t.sql) != null && o.trim() ? e.resultMetricKeys.map(
471
- (s) => Ba({
471
+ (s) => La({
472
472
  card: t,
473
473
  columnKey: s,
474
474
  context: n
@@ -480,7 +480,7 @@ function Kc(e) {
480
480
  const d = dt(t, s), u = d ? n.resolveBoundCurrency(d) : void 0;
481
481
  return c.source === "inferred" && !u ? s : {
482
482
  ...s,
483
- format: c.source === "inferred" ? _(
483
+ format: c.source === "inferred" ? M(
484
484
  l,
485
485
  r,
486
486
  u
@@ -512,7 +512,7 @@ function Oe(e) {
512
512
  (u) => N(u.format)
513
513
  );
514
514
  return l.length < 2 || !d ? r : z(
515
- _({ type: "number" }, i),
515
+ M({ type: "number" }, i),
516
516
  { preserveOmittedProperties: !0 }
517
517
  );
518
518
  }
@@ -526,7 +526,7 @@ function Oe(e) {
526
526
  return r;
527
527
  if (d.length !== l.length)
528
528
  return z(
529
- _({ type: "number" }, i),
529
+ M({ type: "number" }, i),
530
530
  { preserveOmittedProperties: !0 }
531
531
  );
532
532
  }
@@ -540,7 +540,7 @@ function Oe(e) {
540
540
  return [];
541
541
  const d = dt(t, l);
542
542
  return [
543
- _(
543
+ M(
544
544
  o,
545
545
  i,
546
546
  d ? n.resolveBoundCurrency(d) : void 0
@@ -549,12 +549,12 @@ function Oe(e) {
549
549
  });
550
550
  if (a.length === 0)
551
551
  return z(
552
- _(o, i),
552
+ M(o, i),
553
553
  { preserveOmittedProperties: !0 }
554
554
  );
555
555
  const [s] = a;
556
556
  if (a.some((l) => !xe(l, s))) {
557
- const l = _(
557
+ const l = M(
558
558
  {
559
559
  ...o,
560
560
  type: "number",
@@ -586,14 +586,14 @@ function We(e, t) {
586
586
  }
587
587
  function de(e, t) {
588
588
  var r, i;
589
- const n = Vr(e, t);
590
- if (!(n && ((i = (r = e == null ? void 0 : e.config) == null ? void 0 : r.groupByColumns) != null && i.includes(n)) && !Br(n)))
589
+ const n = Kr(e, t);
590
+ if (!(n && ((i = (r = e == null ? void 0 : e.config) == null ? void 0 : r.groupByColumns) != null && i.includes(n)) && !Lr(n)))
591
591
  return n;
592
592
  }
593
- function qa(e) {
593
+ function Va(e) {
594
594
  return !!e && !(e != null && e.format) && le(e == null ? void 0 : e.dataType) === "number";
595
595
  }
596
- const Ua = {
596
+ const Ba = {
597
597
  style: "decimal"
598
598
  };
599
599
  function Kn(e) {
@@ -605,7 +605,7 @@ function Kn(e) {
605
605
  ...e,
606
606
  inheritMetricFormat: e.numberFormat ? e.inheritMetricFormat : e.inheritMetricFormat ?? t.inheritMetricFormat,
607
607
  numberFormat: {
608
- ...Ua,
608
+ ...Ba,
609
609
  ...e.numberFormat
610
610
  },
611
611
  dateFormat: {
@@ -618,7 +618,7 @@ function Kn(e) {
618
618
  }
619
619
  };
620
620
  }
621
- function Lc(e) {
621
+ function Rc(e) {
622
622
  return Object.fromEntries(
623
623
  Object.entries(e || {}).map(([t, n]) => [
624
624
  t,
@@ -656,7 +656,7 @@ function Ln(e, t, n) {
656
656
  }
657
657
  return o;
658
658
  }
659
- function Vc(e) {
659
+ function Kc(e) {
660
660
  let t = Ln(
661
661
  e.persisted,
662
662
  e.baseline,
@@ -665,11 +665,11 @@ function Vc(e) {
665
665
  if (e.enforceDeclaredSqlTemporalFormat && e.next.type === "date" && !e.next.dateFormat.useRelativeTime && e.next.dateFormat.useCustomFormat) {
666
666
  const n = e.next.dateFormat.customFormat;
667
667
  if (!(n != null && n.trim()))
668
- throw new Ji(
668
+ throw new Xi(
669
669
  "invalid_raw_temporal_format",
670
670
  "Custom table date formatting requires a non-empty pattern."
671
671
  );
672
- Zi({
672
+ Qi({
673
673
  dialect: "date_fns",
674
674
  pattern: n,
675
675
  valueKind: e.rawTemporalValueKind
@@ -695,7 +695,7 @@ function Vc(e) {
695
695
  type: "date"
696
696
  } : t;
697
697
  }
698
- function za(e, t) {
698
+ function qa(e, t) {
699
699
  const n = e || ct(), r = !t;
700
700
  return {
701
701
  ...n,
@@ -714,20 +714,20 @@ function Ee(e) {
714
714
  return e.trim().toLowerCase();
715
715
  }
716
716
  const Vn = /\s*(?:\((?:previous|last year|start|target|comparison)\)|δ)\s*$/i;
717
- function ja(e) {
717
+ function Ua(e) {
718
718
  const t = e == null ? void 0 : e.trim();
719
719
  return t ? t.replace(Vn, "").trim() || t : void 0;
720
720
  }
721
- function Ga(e) {
721
+ function za(e) {
722
722
  const t = e == null ? void 0 : e.trim();
723
723
  return t ? Vn.test(t) : !1;
724
724
  }
725
- function Wa(e, t) {
725
+ function ja(e, t) {
726
726
  return t.metricAlias ? e.find(
727
- (n) => zi(n) === t.metricAlias
727
+ (n) => Ui(n) === t.metricAlias
728
728
  ) : t.metricId ? e.find((n) => n.id === t.metricId) : void 0;
729
729
  }
730
- function Ha(e) {
730
+ function Ga(e) {
731
731
  var y;
732
732
  const {
733
733
  card: t,
@@ -738,12 +738,12 @@ function Ha(e) {
738
738
  metricKey: a
739
739
  } = e, s = ((y = t == null ? void 0 : t.config) == null ? void 0 : y.metricColumns) || [];
740
740
  if (r || n)
741
- return Wa(s, {
741
+ return ja(s, {
742
742
  metricAlias: r,
743
743
  metricId: n
744
744
  });
745
745
  const c = [a, o], l = c.some(
746
- (g) => Ga(g)
746
+ (g) => za(g)
747
747
  ), d = c.filter(
748
748
  (g) => !!g
749
749
  );
@@ -755,7 +755,7 @@ function Ha(e) {
755
755
  if (h)
756
756
  return h;
757
757
  }
758
- const u = d.map((g) => Ee(g)).filter((g) => !!g), f = d.map((g) => ja(g)).filter((g) => !!g);
758
+ const u = d.map((g) => Ee(g)).filter((g) => !!g), f = d.map((g) => Ua(g)).filter((g) => !!g);
759
759
  for (const g of f) {
760
760
  const h = We(t, {
761
761
  columnId: g,
@@ -785,7 +785,7 @@ function Ha(e) {
785
785
  );
786
786
  });
787
787
  }
788
- function Ya(e) {
788
+ function Wa(e) {
789
789
  const t = J(e == null ? void 0 : e.format);
790
790
  return z(t);
791
791
  }
@@ -801,15 +801,15 @@ function zt(e) {
801
801
  if (t)
802
802
  return JSON.stringify(t);
803
803
  }
804
- function Qa(e, t) {
804
+ function Ha(e, t) {
805
805
  const n = zt(e), r = zt(t);
806
806
  return !!(n && r && n === r);
807
807
  }
808
- function Xa(e) {
808
+ function Ya(e) {
809
809
  if (e.length === 0)
810
810
  return;
811
811
  const t = e.map(
812
- (a) => Ya(a)
812
+ (a) => Wa(a)
813
813
  );
814
814
  if (!t.every(
815
815
  (a) => Ge(a)
@@ -817,16 +817,16 @@ function Xa(e) {
817
817
  return;
818
818
  const r = t, [i] = r;
819
819
  return r.every(
820
- (a) => Qa(i, a)
820
+ (a) => Ha(i, a)
821
821
  ) ? i : void 0;
822
822
  }
823
- function Me(e) {
823
+ function _e(e) {
824
824
  if (Ge(e.overrideFormatOptions))
825
825
  return {
826
826
  formatOptions: e.overrideFormatOptions || void 0,
827
827
  source: "override"
828
828
  };
829
- const t = Xa(
829
+ const t = Ya(
830
830
  e.metrics || []
831
831
  );
832
832
  return Ge(t) ? {
@@ -868,7 +868,7 @@ function ut(e) {
868
868
  chartType: n,
869
869
  axis: r,
870
870
  preferences: i
871
- }), s = Me({
871
+ }), s = _e({
872
872
  overrideFormatOptions: ke(o == null ? void 0 : o.valueFormat),
873
873
  metrics: a
874
874
  });
@@ -882,8 +882,8 @@ function ut(e) {
882
882
  })
883
883
  };
884
884
  }
885
- function Ja(e) {
886
- const { preferences: t, metric: n } = e, r = t == null ? void 0 : t.tooltipConfig, i = Me({
885
+ function Xa(e) {
886
+ const { preferences: t, metric: n } = e, r = t == null ? void 0 : t.tooltipConfig, i = _e({
887
887
  overrideFormatOptions: ke(r == null ? void 0 : r.valueFormat),
888
888
  metrics: n ? [n] : []
889
889
  });
@@ -898,7 +898,7 @@ function Ja(e) {
898
898
  };
899
899
  }
900
900
  function ft(e, t, n) {
901
- return t === Ze(n, e) ? qr(n, e) : t === "x" ? e == null ? void 0 : e.xAxisConfig : t === "y2" ? e == null ? void 0 : e.secondaryYAxisConfig : e == null ? void 0 : e.yAxisConfig;
901
+ return t === Ze(n, e) ? Vr(n, e) : t === "x" ? e == null ? void 0 : e.xAxisConfig : t === "y2" ? e == null ? void 0 : e.secondaryYAxisConfig : e == null ? void 0 : e.yAxisConfig;
902
902
  }
903
903
  function mt(e) {
904
904
  const { chartType: t, preferences: n } = e;
@@ -917,8 +917,8 @@ function qn(e) {
917
917
  return !0;
918
918
  }
919
919
  }
920
- function Bc(e) {
921
- const { card: t, chartType: n, preferences: r, metric: i } = e, o = Ja({
920
+ function Lc(e) {
921
+ const { card: t, chartType: n, preferences: r, metric: i } = e, o = Xa({
922
922
  card: t,
923
923
  preferences: r,
924
924
  metric: i,
@@ -936,7 +936,7 @@ function Bc(e) {
936
936
  });
937
937
  return s.source === "override" ? s : o;
938
938
  }
939
- function qc(e) {
939
+ function Vc(e) {
940
940
  const { card: t, chartType: n, preferences: r, dataLabelsConfig: i } = e, o = n || (t == null ? void 0 : t.type), a = mt({
941
941
  chartType: o,
942
942
  preferences: r
@@ -945,7 +945,7 @@ function qc(e) {
945
945
  chartType: o,
946
946
  axis: a,
947
947
  preferences: r
948
- }), c = Me({
948
+ }), c = _e({
949
949
  overrideFormatOptions: ke(i == null ? void 0 : i.valueFormat),
950
950
  metrics: s
951
951
  }), l = {
@@ -973,8 +973,8 @@ function qc(e) {
973
973
  });
974
974
  return d.source === "override" ? d : l;
975
975
  }
976
- function Za(e) {
977
- const { preferences: t, dataLabelsConfig: n, metric: r } = e, i = Me({
976
+ function Qa(e) {
977
+ const { preferences: t, dataLabelsConfig: n, metric: r } = e, i = _e({
978
978
  overrideFormatOptions: ke(n == null ? void 0 : n.valueFormat),
979
979
  metrics: r ? [r] : []
980
980
  });
@@ -988,16 +988,16 @@ function Za(e) {
988
988
  })
989
989
  };
990
990
  }
991
- function Uc(e) {
991
+ function Bc(e) {
992
992
  var a, s;
993
- const t = Ha({
993
+ const t = Ga({
994
994
  card: e.card,
995
995
  metricId: e.metricId,
996
996
  metricAlias: e.metricAlias,
997
997
  datasetIndex: e.datasetIndex,
998
998
  datasetLabel: e.datasetLabel,
999
999
  metricKey: e.metricKey
1000
- }), n = Za({
1000
+ }), n = Qa({
1001
1001
  card: e.card,
1002
1002
  preferences: e.preferences,
1003
1003
  dataLabelsConfig: e.dataLabelsConfig,
@@ -1033,10 +1033,10 @@ function Uc(e) {
1033
1033
  });
1034
1034
  return o.source === "override" ? o : n;
1035
1035
  }
1036
- function zc(e) {
1036
+ function qc(e) {
1037
1037
  return (e == null ? void 0 : e.rawValue) === !0;
1038
1038
  }
1039
- function eo(e) {
1039
+ function Ja(e) {
1040
1040
  const t = e == null ? void 0 : e.numberFormat;
1041
1041
  if (!t)
1042
1042
  return;
@@ -1061,8 +1061,8 @@ function eo(e) {
1061
1061
  suffix: t.suffix
1062
1062
  };
1063
1063
  }
1064
- function to(e, t, n = !1) {
1065
- const r = n ? { preserveOmittedProperties: !0 } : void 0, i = J(e == null ? void 0 : e.format, r), o = _n(
1064
+ function Za(e, t, n = !1) {
1065
+ const r = n ? { preserveOmittedProperties: !0 } : void 0, i = J(e == null ? void 0 : e.format, r), o = Mn(
1066
1066
  i,
1067
1067
  r
1068
1068
  );
@@ -1112,11 +1112,11 @@ function Un(e) {
1112
1112
  columnKeyMap: d,
1113
1113
  fieldId: c,
1114
1114
  fieldRole: l
1115
- }), b = to(
1115
+ }), b = Za(
1116
1116
  v,
1117
1117
  C || o,
1118
1118
  m ?? !!u
1119
- ), S = !b && g && qa(v) ? za(
1119
+ ), S = !b && g && Va(v) ? qa(
1120
1120
  C || o,
1121
1121
  h
1122
1122
  ) : void 0;
@@ -1134,11 +1134,11 @@ function jt(e, t, n) {
1134
1134
  }) : { type: "number" };
1135
1135
  if (!i || !N(i))
1136
1136
  return e;
1137
- const o = _(
1137
+ const o = M(
1138
1138
  i,
1139
1139
  t,
1140
1140
  n
1141
- ), a = _n(o, {
1141
+ ), a = Mn(o, {
1142
1142
  preserveOmittedProperties: !0
1143
1143
  });
1144
1144
  return a ? {
@@ -1158,10 +1158,10 @@ function Te(e) {
1158
1158
  const n = Je(t.numberFormat, {
1159
1159
  preserveOmittedProperties: !0
1160
1160
  });
1161
- if (!(!n || !ea(n)))
1161
+ if (!(!n || !Ji(n)))
1162
1162
  return n;
1163
1163
  }
1164
- function no(e) {
1164
+ function eo(e) {
1165
1165
  var r, i;
1166
1166
  if (!e.presentation.preferences)
1167
1167
  return;
@@ -1182,7 +1182,7 @@ function no(e) {
1182
1182
  columnKeyMap: e.columnKeyMap,
1183
1183
  metricAlias: e.metricAlias ?? (t == null ? void 0 : t.alias),
1184
1184
  valueFormatPreferences: e.presentation.preferences
1185
- }), a = oa(e.comparisonPrecision) ?? (N(o) ? o.maximumFractionDigits : void 0) ?? (e.comparisonValueKind === "percent_change" ? 1 : 2);
1185
+ }), a = ia(e.comparisonPrecision) ?? (N(o) ? o.maximumFractionDigits : void 0) ?? (e.comparisonValueKind === "percent_change" ? 1 : 2);
1186
1186
  return e.comparisonValueKind === "percent_change" ? {
1187
1187
  type: "percent",
1188
1188
  locale: e.presentation.preferences.locale,
@@ -1215,13 +1215,13 @@ function no(e) {
1215
1215
  boundCurrency: n ? e.presentation.resolveBoundCurrency(n) : void 0
1216
1216
  });
1217
1217
  }
1218
- function ro(e) {
1218
+ function to(e) {
1219
1219
  var s, c, l, d, u;
1220
1220
  if (e.card.type === "matrixTable" && e.target.kind === "matrix_measure") {
1221
1221
  const f = e.target, m = Tr(e.card, e.matrixCatalog).find(
1222
1222
  (y) => y.measureId === f.measureId
1223
1223
  ), p = m == null ? void 0 : m.canonical;
1224
- return p && (p.type === "number" || p.type === "currency") ? _(
1224
+ return p && (p.type === "number" || p.type === "currency") ? M(
1225
1225
  p,
1226
1226
  e.valueFormatPreferences,
1227
1227
  e.boundCurrency
@@ -1239,13 +1239,13 @@ function ro(e) {
1239
1239
  ...f ? { column: { kind: "field", fieldId: f } } : {},
1240
1240
  resultColumnKey: e.target.kind === "column" ? e.target.columnKey : void 0
1241
1241
  }), p = m.authoredFormat;
1242
- return m.currencyBindable && p && N(p) ? _(
1242
+ return m.currencyBindable && p && N(p) ? M(
1243
1243
  p,
1244
1244
  e.valueFormatPreferences,
1245
1245
  e.boundCurrency
1246
1246
  ) : void 0;
1247
1247
  }
1248
- if (!((l = e.card.sql) != null && l.trim()) && !Ur(e.card.type) && e.target.kind === "metric") {
1248
+ if (!((l = e.card.sql) != null && l.trim()) && !Br(e.card.type) && e.target.kind === "metric") {
1249
1249
  const f = e.target.metricId, m = (u = (d = e.card.config) == null ? void 0 : d.metricColumns) == null ? void 0 : u.find(
1250
1250
  (g) => g.id === f
1251
1251
  );
@@ -1255,7 +1255,7 @@ function ro(e) {
1255
1255
  e.card,
1256
1256
  m
1257
1257
  ), y = p.authoredFormat;
1258
- return p.currencyBindable && y && N(y) ? _(
1258
+ return p.currencyBindable && y && N(y) ? M(
1259
1259
  y,
1260
1260
  e.valueFormatPreferences,
1261
1261
  e.boundCurrency
@@ -1282,7 +1282,7 @@ function ro(e) {
1282
1282
  });
1283
1283
  return N(a) ? a : void 0;
1284
1284
  }
1285
- function jc(e) {
1285
+ function Uc(e) {
1286
1286
  var n, r;
1287
1287
  const t = e.persistedSettings ?? Y(e.card)[e.columnId];
1288
1288
  if (!t && !e.resolvedSettings || (t == null ? void 0 : t.inheritMetricFormat) === !0 || ((n = e.resolvedSettings) == null ? void 0 : n.inheritMetricFormat) === !0) {
@@ -1300,16 +1300,16 @@ function jc(e) {
1300
1300
  preserveOmittedProperties: !0
1301
1301
  });
1302
1302
  }
1303
- return eo(
1303
+ return Ja(
1304
1304
  Un({
1305
1305
  ...e,
1306
1306
  persistedSettings: t
1307
1307
  })
1308
1308
  );
1309
1309
  }
1310
- function Gc(e) {
1310
+ function zc(e) {
1311
1311
  const { value: t, formatOptions: n, preferences: r } = e;
1312
- return n != null && n.type && n.type !== "auto" ? lt(t, n.type, n) : La({
1312
+ return n != null && n.type && n.type !== "auto" ? lt(t, n.type, n) : Ra({
1313
1313
  number: t,
1314
1314
  decimalPlaces: 0,
1315
1315
  useSuffix: !1,
@@ -1318,8 +1318,8 @@ function Gc(e) {
1318
1318
  currency: ""
1319
1319
  });
1320
1320
  }
1321
- function io(e) {
1322
- return zr({
1321
+ function no(e) {
1322
+ return qr({
1323
1323
  ...e,
1324
1324
  activation: et({
1325
1325
  card: e.card,
@@ -1327,8 +1327,8 @@ function io(e) {
1327
1327
  })
1328
1328
  });
1329
1329
  }
1330
- function Wc(e) {
1331
- return jr({
1330
+ function jc(e) {
1331
+ return Ur({
1332
1332
  activation: et({
1333
1333
  card: e.card,
1334
1334
  cardConfig: e.cardConfig
@@ -1337,8 +1337,8 @@ function Wc(e) {
1337
1337
  expectedResultOwner: e.expectedResultOwner
1338
1338
  });
1339
1339
  }
1340
- function ao(e) {
1341
- const t = dn(e.card, e.effectiveCardConfig), n = Ma({
1340
+ function ro(e) {
1341
+ const t = dn(e.card, e.effectiveCardConfig), n = ka({
1342
1342
  card: t,
1343
1343
  records: e.rows,
1344
1344
  keys: e.rows.length === 0 ? e.resultKeys : void 0,
@@ -1361,34 +1361,34 @@ function ao(e) {
1361
1361
  }
1362
1362
  };
1363
1363
  }
1364
- function oo(e) {
1364
+ function io(e) {
1365
1365
  var n;
1366
1366
  const t = (n = e.preferences) == null ? void 0 : n.comparisonPresentation;
1367
1367
  return {
1368
- ...ji,
1368
+ ...zi,
1369
1369
  ...t,
1370
1370
  ...t != null && t.conditionalLabels ? { conditionalLabels: { ...t.conditionalLabels } } : {},
1371
1371
  ...t != null && t.colors ? { colors: { ...t.colors } } : {}
1372
1372
  };
1373
1373
  }
1374
- function so(e) {
1374
+ function ao(e) {
1375
1375
  const t = dn(e.card, e.effectiveCardConfig), { cardId: n, ...r } = e.requestPayloadBase, i = e.formatOptions.visibleColumns ?? [], o = [
1376
1376
  ...i,
1377
1377
  ...Object.keys(e.formatOptions.columnSettings ?? {})
1378
- ], a = Dr(
1378
+ ], a = zr(
1379
1379
  e.card,
1380
1380
  i,
1381
1381
  e.effectiveCardConfig
1382
- ), s = kr(
1382
+ ), s = jr(
1383
1383
  e.card,
1384
1384
  e.effectiveCardConfig,
1385
1385
  a
1386
- ), c = Or(
1386
+ ), c = Dr(
1387
1387
  t,
1388
1388
  o
1389
1389
  ), l = new Set(
1390
1390
  c.eligibleTargets.map(Pe)
1391
- ), d = (v) => l.has(Pe(v)) ? _r({
1391
+ ), d = (v) => l.has(Pe(v)) ? Or({
1392
1392
  bindings: r.controlBindings,
1393
1393
  controls: [
1394
1394
  ...r.controlDefinitions ?? [],
@@ -1398,14 +1398,14 @@ function so(e) {
1398
1398
  target: v,
1399
1399
  knownTargets: c.knownTargets,
1400
1400
  eligibleTargets: c.eligibleTargets
1401
- }).currency : void 0, u = Mr({
1401
+ }).currency : void 0, u = kr({
1402
1402
  card: e.card,
1403
1403
  comparisonMetadata: e.comparisonMetadata,
1404
1404
  columnKeyMap: e.columnKeyMap
1405
1405
  }), f = et({
1406
1406
  card: e.card,
1407
1407
  cardConfig: e.effectiveCardConfig
1408
- }), m = io({
1408
+ }), m = no({
1409
1409
  card: e.card,
1410
1410
  cardConfig: e.effectiveCardConfig,
1411
1411
  columns: e.resultColumns,
@@ -1452,7 +1452,7 @@ function so(e) {
1452
1452
  const b = Wr(I.dateFormat);
1453
1453
  b && g.set(
1454
1454
  v,
1455
- ta({
1455
+ Zi({
1456
1456
  format: b,
1457
1457
  preferences: e.reportContext.valueFormat,
1458
1458
  calendar: e.reportContext.calendar
@@ -1493,7 +1493,7 @@ function so(e) {
1493
1493
  }
1494
1494
  }
1495
1495
  ];
1496
- const q = (I ? no({
1496
+ const q = (I ? eo({
1497
1497
  card: t,
1498
1498
  columnId: v,
1499
1499
  columnKeyMap: e.columnKeyMap,
@@ -1506,7 +1506,7 @@ function so(e) {
1506
1506
  preferences: e.reportContext.valueFormat,
1507
1507
  resolveBoundCurrency: d
1508
1508
  }
1509
- }) : void 0) ?? (k ? ro({
1509
+ }) : void 0) ?? (k ? to({
1510
1510
  card: t,
1511
1511
  target: A,
1512
1512
  resultColumnKeys: o,
@@ -1517,11 +1517,11 @@ function so(e) {
1517
1517
  ...b,
1518
1518
  persistedSettings: G,
1519
1519
  valueFormatPreferences: e.reportContext.valueFormat
1520
- }), U = (q == null ? void 0 : q.type) === "duration" ? q : q ? _(
1520
+ }), U = (q == null ? void 0 : q.type) === "duration" ? q : q ? M(
1521
1521
  q,
1522
1522
  e.reportContext.valueFormat,
1523
1523
  B
1524
- ) : _(
1524
+ ) : M(
1525
1525
  {
1526
1526
  type: "number",
1527
1527
  minimumFractionDigits: 0,
@@ -1565,7 +1565,7 @@ function so(e) {
1565
1565
  format: I
1566
1566
  }))
1567
1567
  );
1568
- const C = na({
1568
+ const C = ea({
1569
1569
  reportContext: e.reportContext,
1570
1570
  resolvedFormats: h
1571
1571
  });
@@ -1573,17 +1573,17 @@ function so(e) {
1573
1573
  formatOptions: {
1574
1574
  ...e.formatOptions,
1575
1575
  ...a ? { tableTotalsLabelColumnKey: a } : {},
1576
- comparisonPresentation: oo(e.card),
1576
+ comparisonPresentation: io(e.card),
1577
1577
  presentationExecutionSnapshot: C
1578
1578
  },
1579
1579
  ...s ? { tableTotalsRequest: s } : {}
1580
1580
  };
1581
1581
  }
1582
- function co(e) {
1583
- const t = Pr(
1582
+ function oo(e) {
1583
+ const t = Mr(
1584
1584
  e.card,
1585
1585
  e.requestPayloadBase
1586
- ), { cardId: n, ...r } = t.requestPayloadBase, i = so(e);
1586
+ ), { cardId: n, ...r } = t.requestPayloadBase, i = ao(e);
1587
1587
  return {
1588
1588
  type: "card",
1589
1589
  dashboardId: e.dashboardId,
@@ -1597,14 +1597,14 @@ function co(e) {
1597
1597
  formatOptions: i.formatOptions
1598
1598
  };
1599
1599
  }
1600
- function Hc(e) {
1600
+ function Gc(e) {
1601
1601
  const { card: t, result: n } = e;
1602
1602
  if (t.type !== "table" && t.type !== "detailTable")
1603
1603
  return { status: "refused", reason: "not_a_table" };
1604
- const r = n.modelFormats ? ra(e.effectiveCardConfig ?? t.config, n) : e.effectiveCardConfig;
1605
- if (Ar({ card: t, comparisonMetadata: n.comparisonMetadata }))
1604
+ const r = n.modelFormats ? ta(e.effectiveCardConfig ?? t.config, n) : e.effectiveCardConfig;
1605
+ if (_r({ card: t, comparisonMetadata: n.comparisonMetadata }))
1606
1606
  return { status: "refused", reason: "comparison_metadata_missing" };
1607
- const i = ao({
1607
+ const i = ro({
1608
1608
  card: t,
1609
1609
  effectiveCardConfig: r,
1610
1610
  rows: e.rows,
@@ -1615,7 +1615,7 @@ function Hc(e) {
1615
1615
  });
1616
1616
  return i ? {
1617
1617
  status: "ready",
1618
- request: co({
1618
+ request: oo({
1619
1619
  card: t,
1620
1620
  dashboardId: e.dashboardId,
1621
1621
  title: e.title,
@@ -1632,8 +1632,8 @@ function Hc(e) {
1632
1632
  } : { status: "refused", reason: "columns_unresolved" };
1633
1633
  }
1634
1634
  function zn(e, t, n) {
1635
- if (Ri(
1636
- Ki(t),
1635
+ if ($i(
1636
+ Ei(t),
1637
1637
  e.aggregateOrigin
1638
1638
  ))
1639
1639
  return { aggregate: void 0, aggregateOrigin: void 0 };
@@ -1643,7 +1643,7 @@ function zn(e, t, n) {
1643
1643
  aggregateOrigin: e.aggregate ? e.aggregateOrigin : r ? t.aggregateOrigin : void 0
1644
1644
  };
1645
1645
  }
1646
- function lo(e, t, n) {
1646
+ function so(e, t, n) {
1647
1647
  var r, i, o, a, s, c;
1648
1648
  if (n === "domain")
1649
1649
  return {
@@ -1656,7 +1656,7 @@ function lo(e, t, n) {
1656
1656
  windowTransform: ((s = e.parameters) == null ? void 0 : s.windowTransform) ?? ((c = t.parameters) == null ? void 0 : c.windowTransform)
1657
1657
  };
1658
1658
  }
1659
- function Yc(e, t, n) {
1659
+ function Wc(e, t, n) {
1660
1660
  const r = e;
1661
1661
  return {
1662
1662
  id: e.id,
@@ -1671,16 +1671,16 @@ function Yc(e, t, n) {
1671
1671
  valueAliases: r.valueAliases,
1672
1672
  comparison: r.comparison,
1673
1673
  comparisonPolarity: r.comparisonPolarity,
1674
- parameters: lo(
1674
+ parameters: so(
1675
1675
  r,
1676
1676
  t,
1677
1677
  "domain"
1678
1678
  )
1679
1679
  } : {},
1680
- ...uo(e)
1680
+ ...co(e)
1681
1681
  };
1682
1682
  }
1683
- function uo(e) {
1683
+ function co(e) {
1684
1684
  const t = {
1685
1685
  ...e.labelOrigin === "override" ? { label: e.label, labelOrigin: e.labelOrigin } : {},
1686
1686
  ...e.formatOrigin === "override" ? { format: e.format, formatOrigin: e.formatOrigin } : {}
@@ -1700,17 +1700,17 @@ function uo(e) {
1700
1700
  return t;
1701
1701
  }
1702
1702
  }
1703
- const fo = "table";
1704
- function Qc({ preferences: e, ...t }) {
1703
+ const lo = "table";
1704
+ function Hc({ preferences: e, ...t }) {
1705
1705
  return {
1706
1706
  ...t,
1707
- type: fo,
1707
+ type: lo,
1708
1708
  preferences: e ?? { onClickFilter: [{ columnIndex: 0, expression: "" }] },
1709
1709
  sql: "",
1710
1710
  data: []
1711
1711
  };
1712
1712
  }
1713
- function Xc(e) {
1713
+ function Yc(e) {
1714
1714
  return {
1715
1715
  id: e.id,
1716
1716
  title: e.title,
@@ -1720,36 +1720,36 @@ function Xc(e) {
1720
1720
  data: []
1721
1721
  };
1722
1722
  }
1723
- const mo = ["light", "dark"], po = ["none", "subtle", "raised"];
1724
- function go(e, t) {
1725
- const { style: n, issues: r } = ho(e);
1723
+ const uo = ["light", "dark"], fo = ["none", "subtle", "raised"];
1724
+ function mo(e, t) {
1725
+ const { style: n, issues: r } = po(e);
1726
1726
  return t === "lenient" ? { style: n, dropped: r } : r.length > 0 ? { ok: !1, issues: r } : { ok: !0, style: n };
1727
1727
  }
1728
- function ho(e) {
1728
+ function po(e) {
1729
1729
  if (e == null) return { style: void 0, issues: [] };
1730
1730
  if (!jn(e))
1731
1731
  return { style: void 0, issues: [{ field: "dashboardStyle", code: "invalid_value", message: "The dashboard style must be an object." }] };
1732
1732
  const t = [], n = {};
1733
1733
  for (const [r, i] of Object.entries(e)) {
1734
- if (!Ia.includes(r)) {
1734
+ if (!ba.includes(r)) {
1735
1735
  t.push({ field: r, code: "unknown_field", message: `${r} is not a dashboard style field.` });
1736
1736
  continue;
1737
1737
  }
1738
- const o = yo(r, i, t);
1738
+ const o = go(r, i, t);
1739
1739
  o !== void 0 && (n[r] = o);
1740
1740
  }
1741
1741
  return { style: Object.keys(n).length > 0 ? n : void 0, issues: t };
1742
1742
  }
1743
- function yo(e, t, n) {
1744
- if (ya(e)) {
1745
- const { min: r, max: i, label: o } = ba[e];
1746
- return typeof t != "number" || !Number.isFinite(t) ? E(n, e, "invalid_value", `${o} must be a number of px.`) : Number.isInteger(t) ? t < r || t > i ? E(n, e, "out_of_range", `${va(e)}.`) : t : E(n, e, "not_integer", `${o} must be a whole number of px.`);
1743
+ function go(e, t, n) {
1744
+ if (ga(e)) {
1745
+ const { min: r, max: i, label: o } = ha[e];
1746
+ return typeof t != "number" || !Number.isFinite(t) ? E(n, e, "invalid_value", `${o} must be a number of px.`) : Number.isInteger(t) ? t < r || t > i ? E(n, e, "out_of_range", `${ya(e)}.`) : t : E(n, e, "not_integer", `${o} must be a whole number of px.`);
1747
1747
  }
1748
1748
  switch (e) {
1749
1749
  case "cardBorder":
1750
1750
  return t === "on" || t === "off" ? t : E(n, e, "invalid_value", "Card border is on or off.");
1751
1751
  case "cardShadow":
1752
- return typeof t == "string" && po.includes(t) ? t : E(n, e, "invalid_value", "Card shadow is none, subtle or raised.");
1752
+ return typeof t == "string" && fo.includes(t) ? t : E(n, e, "invalid_value", "Card shadow is none, subtle or raised.");
1753
1753
  case "canvas":
1754
1754
  return Gt(e, t, n, (r, i) => r === "muted" || r === "background" ? r : Bt(r) ? r.toLowerCase() : E(n, i, "invalid_colour", "The canvas is muted, background or a hex colour."));
1755
1755
  case "chartColors":
@@ -1764,7 +1764,7 @@ function Gt(e, t, n, r) {
1764
1764
  for (const [o, a] of Object.entries(t)) {
1765
1765
  if (a === void 0) continue;
1766
1766
  const s = `${e}.${o}`;
1767
- if (!mo.includes(o)) {
1767
+ if (!uo.includes(o)) {
1768
1768
  E(n, s, "unknown_field", `${e} holds light and dark values only.`);
1769
1769
  continue;
1770
1770
  }
@@ -1779,11 +1779,11 @@ function E(e, t, n, r) {
1779
1779
  function jn(e) {
1780
1780
  return typeof e == "object" && e !== null && !Array.isArray(e);
1781
1781
  }
1782
- function Jc(e, t) {
1782
+ function Xc(e, t) {
1783
1783
  const n = t ?? null;
1784
- return { style: e.dashboardStyle !== void 0 ? go(e.dashboardStyle, "lenient").style : void 0, organizationAppearance: n ? ha(n).spec : null };
1784
+ return { style: e.dashboardStyle !== void 0 ? mo(e.dashboardStyle, "lenient").style : void 0, organizationAppearance: n ? pa(n).spec : null };
1785
1785
  }
1786
- const bo = {
1786
+ const ho = {
1787
1787
  SUM: "total",
1788
1788
  AVG: "average",
1789
1789
  MIN: "lowest",
@@ -1802,9 +1802,9 @@ function ge(e) {
1802
1802
  function Wt(e) {
1803
1803
  return e.length <= 1 ? e[0] ?? "" : `${e.slice(0, -1).join(", ")} and ${e[e.length - 1]}`;
1804
1804
  }
1805
- function vo(e) {
1805
+ function yo(e) {
1806
1806
  var i, o, a;
1807
- const t = sa({ variables: [e] })[0];
1807
+ const t = aa({ variables: [e] })[0];
1808
1808
  if (!t) return;
1809
1809
  const n = tt(t.card), r = n.kind === "config" ? n.executableSources[0] : n.kind === "sql" ? (i = n.pinnedCatalogSources[0]) == null ? void 0 : i.source : void 0;
1810
1810
  if (!r) {
@@ -1814,7 +1814,7 @@ function vo(e) {
1814
1814
  if (r.kind === "semantic") return r.label || r.datasetName;
1815
1815
  if (r.kind === "physical") return r.label || r.tableName;
1816
1816
  }
1817
- function Io(e) {
1817
+ function bo(e) {
1818
1818
  var r;
1819
1819
  const t = (r = e.query.config) == null ? void 0 : r.filters, n = t ? Gn(t) : 0;
1820
1820
  return n ? n === 1 ? " with one condition" : ` with ${n} conditions` : "";
@@ -1828,18 +1828,18 @@ function Ht(e) {
1828
1828
  const t = le(e.dataType), n = t === "date" || t === "datetime" ? e.direction === "desc" ? "latest first" : "earliest first" : t === "number" ? e.direction === "desc" ? "highest first" : "lowest first" : e.direction === "desc" ? "Z to A" : "A to Z";
1829
1829
  return ` by ${e.aggregate ? ge(e) : re(e)}, ${n}`;
1830
1830
  }
1831
- function Co(e) {
1831
+ function vo(e) {
1832
1832
  var s, c, l;
1833
- const t = vo(e), n = t ? ` in ${t}` : "", r = Io(e);
1833
+ const t = yo(e), n = t ? ` in ${t}` : "", r = bo(e);
1834
1834
  if ((s = e.query.sql) != null && s.trim()) {
1835
1835
  const d = e.get.kind === "first" ? "the first row" : "the only row";
1836
- return `${Fo(d)} of a SQL query${t ? ` on ${t}` : ""}`;
1836
+ return `${Io(d)} of a SQL query${t ? ` on ${t}` : ""}`;
1837
1837
  }
1838
1838
  const i = e.query.config ?? {}, o = i.groupByColumns ?? [], a = i.metricColumns ?? [];
1839
1839
  switch (e.get.kind) {
1840
1840
  case "aggregate": {
1841
1841
  const d = a[0];
1842
- return d ? d.aggregate ? `The ${bo[String(d.aggregate).toUpperCase()] ?? String(d.aggregate).toLowerCase()} ${ge(d)}${n}${r}${Yt(e)}` : `The ${re(d)}${n}${r}${Yt(e)}` : "An aggregate, with no measure chosen yet";
1842
+ return d ? d.aggregate ? `The ${ho[String(d.aggregate).toUpperCase()] ?? String(d.aggregate).toLowerCase()} ${ge(d)}${n}${r}${Yt(e)}` : `The ${re(d)}${n}${r}${Yt(e)}` : "An aggregate, with no measure chosen yet";
1843
1843
  }
1844
1844
  case "list": {
1845
1845
  const d = o[0];
@@ -1856,13 +1856,13 @@ function Co(e) {
1856
1856
  }
1857
1857
  }
1858
1858
  function Yt(e) {
1859
- const t = ca(e);
1860
- return t ? `, compared with ${Qr({ mode: "explicit", spec: t })}` : "";
1859
+ const t = oa(e);
1860
+ return t ? `, compared with ${Xr({ mode: "explicit", spec: t })}` : "";
1861
1861
  }
1862
- function Fo(e) {
1862
+ function Io(e) {
1863
1863
  return e.charAt(0).toUpperCase() + e.slice(1);
1864
1864
  }
1865
- function So(e, t) {
1865
+ function Co(e, t) {
1866
1866
  const n = e.sheets ?? [], r = n.findIndex((a) => a.id === t.sheetId), i = n[r];
1867
1867
  if (!i)
1868
1868
  throw new F("sheet_not_found", `No sheet ${t.sheetId} on this dashboard.`);
@@ -1878,11 +1878,11 @@ function So(e, t) {
1878
1878
  clauses: [T.arranged(i.title || "the dashboard", t.keepOrder === !0, !(i.frames ?? []).length)]
1879
1879
  };
1880
1880
  }
1881
- function xo(e) {
1881
+ function Fo(e) {
1882
1882
  return !!(e && Object.prototype.hasOwnProperty.call(e, "calculatedFields"));
1883
1883
  }
1884
- function X(...e) {
1885
- return Xr(e.flatMap((t) => t || []));
1884
+ function Q(...e) {
1885
+ return Qr(e.flatMap((t) => t || []));
1886
1886
  }
1887
1887
  function ae(e, t) {
1888
1888
  return {
@@ -1896,7 +1896,7 @@ function pt(e) {
1896
1896
  function Wn(e) {
1897
1897
  return ((e == null ? void 0 : e.calculatedFields) || []).filter((t) => !t.fieldScope).map((t) => ae(t, "sheet"));
1898
1898
  }
1899
- function To(e) {
1899
+ function So(e) {
1900
1900
  return e ? [
1901
1901
  ...(e.calculatedFields || []).filter(
1902
1902
  (t) => t.fieldScope === "dashboard"
@@ -1904,19 +1904,19 @@ function To(e) {
1904
1904
  ...(e.frames || []).flatMap((t) => t.calculatedFields || [])
1905
1905
  ].map((t) => ae(t, "dashboard")) : [];
1906
1906
  }
1907
- function wo(e) {
1907
+ function xo(e) {
1908
1908
  if (e !== void 0)
1909
- return X(
1909
+ return Q(
1910
1910
  e.map((t) => ae(t, "dashboard"))
1911
1911
  );
1912
1912
  }
1913
- function Zc(e) {
1913
+ function Qc(e) {
1914
1914
  var r;
1915
1915
  const t = [], n = (e.sheets || []).map((i) => {
1916
1916
  var o;
1917
- return t.push(...To(i)), {
1917
+ return t.push(...So(i)), {
1918
1918
  ...i,
1919
- calculatedFields: X(
1919
+ calculatedFields: Q(
1920
1920
  pt(i),
1921
1921
  Wn(i)
1922
1922
  ),
@@ -1927,8 +1927,8 @@ function Zc(e) {
1927
1927
  });
1928
1928
  return {
1929
1929
  ...e,
1930
- calculatedFields: wo(
1931
- X(
1930
+ calculatedFields: xo(
1931
+ Q(
1932
1932
  (r = e.calculatedFields) == null ? void 0 : r.map(
1933
1933
  (i) => ae(i, "dashboard")
1934
1934
  ),
@@ -1938,40 +1938,40 @@ function Zc(e) {
1938
1938
  sheets: n
1939
1939
  };
1940
1940
  }
1941
- function Qt(e, t) {
1941
+ function Xt(e, t) {
1942
1942
  var i;
1943
1943
  if (!((i = e == null ? void 0 : e.frames) != null && i.length))
1944
1944
  return [];
1945
1945
  const n = t ? e.frames.find((o) => o.id === t) : void 0, r = e.frames.filter(
1946
1946
  (o) => !t || o.id !== t
1947
1947
  );
1948
- return X(
1948
+ return Q(
1949
1949
  n == null ? void 0 : n.calculatedFields,
1950
1950
  ...r.map((o) => o.calculatedFields)
1951
1951
  );
1952
1952
  }
1953
- function Do(e, t) {
1953
+ function To(e, t) {
1954
1954
  return e ? pt(e) : [];
1955
1955
  }
1956
- function el(e, t) {
1956
+ function Jc(e, t) {
1957
1957
  if (!e)
1958
1958
  return [];
1959
- const n = pt(e), r = Wn(e), i = X(
1959
+ const n = pt(e), r = Wn(e), i = Q(
1960
1960
  n,
1961
1961
  r
1962
1962
  );
1963
- return xo(e) ? i.length === 0 ? [] : r.length === 0 ? i : X(
1963
+ return Fo(e) ? i.length === 0 ? [] : r.length === 0 ? i : Q(
1964
1964
  i,
1965
- Qt(e, t)
1966
- ) : Qt(e, t);
1965
+ Xt(e, t)
1966
+ ) : Xt(e, t);
1967
1967
  }
1968
- function ko(e) {
1968
+ function wo(e) {
1969
1969
  if (e !== void 0)
1970
- return X(
1970
+ return Q(
1971
1971
  e.map((t) => ae(t, "sheet"))
1972
1972
  );
1973
1973
  }
1974
- function tl(e) {
1974
+ function Zc(e) {
1975
1975
  const { field: t, sheetFields: n = [], dashboardFields: r = [] } = e, i = (s) => s.find(
1976
1976
  (c) => Jr(c, t, {
1977
1977
  allowComparableFallback: !0
@@ -1987,7 +1987,7 @@ function tl(e) {
1987
1987
  const a = i(r);
1988
1988
  return a ? { scope: "dashboard", matchedField: a } : { scope: "card" };
1989
1989
  }
1990
- function Oo(e, t) {
1990
+ function Do(e, t) {
1991
1991
  var C, v, I;
1992
1992
  const n = (e.sheets ?? []).findIndex((b) => b.id === t.sheetId), r = (C = e.sheets) == null ? void 0 : C[n];
1993
1993
  if (!(r != null && r.frames))
@@ -2002,7 +2002,7 @@ function Oo(e, t) {
2002
2002
  let m = /* @__PURE__ */ new Set();
2003
2003
  const p = Zr.produce(e, (b) => {
2004
2004
  const S = b.sheets[n];
2005
- f.layouts !== r.layouts && (S.layouts = Ot(f.layouts)), f.customizedBreakpoints !== r.customizedBreakpoints && (S.customizedBreakpoints = f.customizedBreakpoints), t.sheetCalculatedFields !== void 0 && (S.calculatedFields = ko(t.sheetCalculatedFields)), S.frames = S.frames.map((k) => {
2005
+ f.layouts !== r.layouts && (S.layouts = Ot(f.layouts)), f.customizedBreakpoints !== r.customizedBreakpoints && (S.customizedBreakpoints = f.customizedBreakpoints), t.sheetCalculatedFields !== void 0 && (S.calculatedFields = wo(t.sheetCalculatedFields)), S.frames = S.frames.map((k) => {
2006
2006
  const B = u.get(k.id);
2007
2007
  return B ? Ot(c(B)) : k.calculatedFields === void 0 ? k : { ...k, calculatedFields: void 0 };
2008
2008
  });
@@ -2014,17 +2014,17 @@ function Oo(e, t) {
2014
2014
  ], h = ((v = i.cards) == null ? void 0 : v.find((b) => b.id === i.activeCardId)) ?? ((I = i.cards) == null ? void 0 : I[0]);
2015
2015
  return { dashboard: p, runtimeEffects: g, clauses: [T.committed(h == null ? void 0 : h.title)] };
2016
2016
  }
2017
- function Mo(e, t) {
2017
+ function ko(e, t) {
2018
2018
  const n = { ...e }, r = [];
2019
2019
  return t.title !== void 0 && t.title !== e.title && (n.title = t.title, r.push(T.plain("dashboard", `renames the dashboard to ${w(t.title)}`))), t.description === null && e.description ? (delete n.description, r.push(T.plain("dashboard", "removes the dashboard's description"))) : typeof t.description == "string" && t.description !== e.description && (n.description = t.description, r.push(T.plain("dashboard", "changes the dashboard's description"))), { dashboard: n, clauses: r.length ? r : [T.plain("dashboard", "changes nothing on the dashboard")] };
2020
2020
  }
2021
- function _o(e, t) {
2021
+ function Oo(e, t) {
2022
2022
  const n = { ...e };
2023
2023
  t.style ? n.dashboardStyle = t.style : delete n.dashboardStyle;
2024
2024
  const r = t.sentences.map((i) => T.plain("dashboard", `${i.charAt(0).toLowerCase()}${i.slice(1)}`));
2025
2025
  return { dashboard: n, clauses: r.length ? r : [T.plain("dashboard", "changes nothing in the dashboard's style")] };
2026
2026
  }
2027
- function Ao(e, t, n) {
2027
+ function _o(e, t, n) {
2028
2028
  const r = e.sheets ?? [], i = r.findIndex((s) => s.id === t), o = r[i];
2029
2029
  if (!o) throw new F("sheet_not_found", `No sheet ${t} on this dashboard.`);
2030
2030
  if (we(o))
@@ -2043,9 +2043,9 @@ function He(e) {
2043
2043
  return n;
2044
2044
  }
2045
2045
  const Hn = (e) => e.cards.find((t) => t.id === e.activeCardId) ?? e.cards[0], Re = (e) => T.plain("detached", `makes ${e} local to this report; it no longer follows its library visual`);
2046
- function Po(e, t) {
2046
+ function Mo(e, t) {
2047
2047
  var p;
2048
- const { sheets: n, sheetIndex: r, sheet: i, cards: o } = Ao(e, t.sheetId, t.cardIds), a = he(i, t.cardIds[0]).id;
2048
+ const { sheets: n, sheetIndex: r, sheet: i, cards: o } = _o(e, t.sheetId, t.cardIds), a = he(i, t.cardIds[0]).id;
2049
2049
  let s = i;
2050
2050
  const c = [];
2051
2051
  for (const y of t.cardIds.slice(1)) {
@@ -2071,7 +2071,7 @@ function Po(e, t) {
2071
2071
  detached: m.length > 0
2072
2072
  };
2073
2073
  }
2074
- function No(e, t) {
2074
+ function Ao(e, t) {
2075
2075
  var d;
2076
2076
  const n = e.sheets ?? [], r = n.findIndex((u) => !we(u) && (u.frames ?? []).some((f) => f.cards.some((m) => m.id === t.cardId)));
2077
2077
  if (r < 0)
@@ -2102,7 +2102,7 @@ function No(e, t) {
2102
2102
  detached: l
2103
2103
  };
2104
2104
  }
2105
- function $o() {
2105
+ function Po() {
2106
2106
  return {
2107
2107
  version: 1,
2108
2108
  page: {
@@ -2123,7 +2123,7 @@ function $o() {
2123
2123
  sections: []
2124
2124
  };
2125
2125
  }
2126
- function Eo() {
2126
+ function No() {
2127
2127
  return {
2128
2128
  region: "header",
2129
2129
  enabled: !0,
@@ -2132,7 +2132,7 @@ function Eo() {
2132
2132
  blocks: []
2133
2133
  };
2134
2134
  }
2135
- function Ro() {
2135
+ function $o() {
2136
2136
  return {
2137
2137
  region: "footer",
2138
2138
  enabled: !0,
@@ -2144,48 +2144,48 @@ function Ro() {
2144
2144
  function Yn(e) {
2145
2145
  return [{ type: "text", value: e }];
2146
2146
  }
2147
- function nl(e, t = []) {
2147
+ function el(e, t = []) {
2148
2148
  return ri(e, { by: "then" }).flatMap((n) => n.type === "link" ? n.children ?? [] : [n]).map((n) => n.type === "text" ? n.value : `{{${ii(n.ref, ai({ kind: "document", inputs: t }))}}}`).join("") || "";
2149
2149
  }
2150
- function Ko(e, t) {
2150
+ function Eo(e, t) {
2151
2151
  return e.find(
2152
2152
  (n) => n.type === "text" && n.role === t
2153
2153
  );
2154
2154
  }
2155
- function rl(e, t) {
2155
+ function tl(e, t) {
2156
2156
  return e.find(
2157
2157
  (n) => n.type === "image" && n.role === t
2158
2158
  );
2159
2159
  }
2160
- function Xt(e, t) {
2160
+ function Qt(e, t) {
2161
2161
  const n = {
2162
2162
  ...t,
2163
2163
  type: "text",
2164
2164
  content: typeof t.content == "string" ? Yn(t.content) : t.content
2165
2165
  };
2166
- return Qn(e, n);
2166
+ return Xn(e, n);
2167
2167
  }
2168
- function il(e, t) {
2169
- return Qn(e, t);
2168
+ function nl(e, t) {
2169
+ return Xn(e, t);
2170
2170
  }
2171
- function Qn(e, t) {
2171
+ function Xn(e, t) {
2172
2172
  const n = e.findIndex((r) => r.id === t.id);
2173
2173
  return n === -1 ? [...e, t] : e.map(
2174
2174
  (r, i) => i === n ? t : r
2175
2175
  );
2176
2176
  }
2177
- function Lo(e, t) {
2177
+ function Ro(e, t) {
2178
2178
  const n = e.sheets ?? [], { id: r, title: i, kind: o } = t.sheet;
2179
2179
  if (n.some((s) => s.id === r))
2180
2180
  throw new F("sheet_id_taken", `A sheet with id ${r} is already on this dashboard.`);
2181
- const a = o === "document" ? { id: r, title: i, kind: o, document: $o() } : { id: r, title: i };
2181
+ const a = o === "document" ? { id: r, title: i, kind: o, document: Po() } : { id: r, title: i };
2182
2182
  return {
2183
2183
  dashboard: { ...e, sheets: [...n, a] },
2184
2184
  created: [{ kind: "sheet", id: r, title: i, ...t.changeIndex !== void 0 ? { changeIndex: t.changeIndex } : {} }],
2185
2185
  clauses: [T.plain("sheet", `adds the sheet ${w(i)}`)]
2186
2186
  };
2187
2187
  }
2188
- function Vo(e, t) {
2188
+ function Ko(e, t) {
2189
2189
  const n = e.sheets ?? [], r = n.findIndex((o) => o.id === t.sheetId);
2190
2190
  if (r < 0)
2191
2191
  throw new F("sheet_not_found", `No sheet ${t.sheetId} on this dashboard.`);
@@ -2195,13 +2195,13 @@ function Vo(e, t) {
2195
2195
  clauses: [T.plain("sheet", `renames the sheet ${w(i.title)} to ${w(t.title)}`)]
2196
2196
  };
2197
2197
  }
2198
- function Bo(e, t, n) {
2199
- var a;
2198
+ function Lo(e, t, n) {
2199
+ var o;
2200
2200
  if (!e || !t || t.customFilterPreferences) return;
2201
- const r = t.defaultDateFilter, i = Fn(r);
2202
- return (t.dateSelectionMode === "day" ? oi(r) : t.dateSelectionMode === "months" && (si(r) || !!(i && Gi(i).monthPickerDefault))) && ((a = ie(t, n)) == null ? void 0 : a.valueType) === "date" ? !0 : void 0;
2201
+ const r = t.defaultDateFilter;
2202
+ return (t.dateSelectionMode === "day" ? oi(r) : t.dateSelectionMode === "months" && si(r)) && ((o = ie(t, n)) == null ? void 0 : o.valueType) === "date" ? !0 : void 0;
2203
2203
  }
2204
- function al(e) {
2204
+ function rl(e) {
2205
2205
  const t = e.createId ?? Fe, n = t(), r = li({
2206
2206
  field: e.field,
2207
2207
  dataSource: e.dataSource,
@@ -2209,7 +2209,7 @@ function al(e) {
2209
2209
  connectionType: e.connectionType,
2210
2210
  filterId: t()
2211
2211
  });
2212
- return qo({
2212
+ return Vo({
2213
2213
  filter: e.label ? { ...r, title: e.label } : r,
2214
2214
  label: e.label || e.field.label || e.field.name,
2215
2215
  scope: e.scope,
@@ -2217,7 +2217,7 @@ function al(e) {
2217
2217
  createId: () => n
2218
2218
  });
2219
2219
  }
2220
- function qo(e) {
2220
+ function Vo(e) {
2221
2221
  const t = e.createId ?? Fe, n = e.label || e.filter.title || e.filter.column || e.filter.id, r = pn(e.dashboard, { label: n }), i = {
2222
2222
  ...gn(e.filter),
2223
2223
  variableName: r
@@ -2235,14 +2235,14 @@ function qo(e) {
2235
2235
  exports: hn(i)
2236
2236
  };
2237
2237
  }
2238
- function Uo(e, t, n, r = { calendar: null }) {
2238
+ function Bo(e, t, n, r = { calendar: null }) {
2239
2239
  var bt, vt, It, Ct, Ft, St, xt, Tt;
2240
- const o = Q(e).findFilterInput(t), a = (M, x) => ({
2240
+ const o = X(e).findFilterInput(t), a = (_, x) => ({
2241
2241
  ok: !1,
2242
2242
  issues: [
2243
2243
  {
2244
2244
  code: "invalidSettings",
2245
- message: M,
2245
+ message: _,
2246
2246
  ref: t,
2247
2247
  ...o ? { inputId: o.input.id } : {},
2248
2248
  ...x ? { contractIssue: x } : {}
@@ -2270,9 +2270,9 @@ function Uo(e, t, n, r = { calendar: null }) {
2270
2270
  return a("The card mapping was prepared for another filter.");
2271
2271
  }
2272
2272
  const l = n.definition ? gn(n.definition) : c;
2273
- if (l.kind === "global-date" && n.scope && !zo(n.scope))
2273
+ if (l.kind === "global-date" && n.scope && !qo(n.scope))
2274
2274
  return a("The Global Date filter applies to regular tabs only.");
2275
- const d = (vt = r.calendar) == null ? void 0 : vt.tz, u = n.definition !== void 0, f = n.forceSelection !== void 0 || u ? Bo(
2275
+ const d = (vt = r.calendar) == null ? void 0 : vt.tz, u = n.definition !== void 0, f = n.forceSelection !== void 0 || u ? Lo(
2276
2276
  n.forceSelection ?? s.forceSelection,
2277
2277
  l,
2278
2278
  d
@@ -2280,19 +2280,19 @@ function Uo(e, t, n, r = { calendar: null }) {
2280
2280
  e,
2281
2281
  { name: n.variableName },
2282
2282
  { exclude: { source: "input", inputId: s.id } }
2283
- ) : s.variableName, p = u && (c.title || c.column) !== (l.title || l.column), y = n.label ?? (p ? l.title || l.column || l.id : void 0), g = u && c.hide !== l.hide, h = u && c.toolbarWidth !== l.toolbarWidth, C = (M) => {
2283
+ ) : s.variableName, p = u && (c.title || c.column) !== (l.title || l.column), y = n.label ?? (p ? l.title || l.column || l.id : void 0), g = u && c.hide !== l.hide, h = u && c.toolbarWidth !== l.toolbarWidth, C = (_) => {
2284
2284
  var wt, Dt;
2285
- const x = { ...M };
2285
+ const x = { ..._ };
2286
2286
  if (y !== void 0 && (x.label = y), n.variableName !== void 0 && (x.variableName = m), n.scope && (x.scope = n.scope), g || h) {
2287
2287
  const Ae = yn(l);
2288
- x.presentation = { ...M.presentation }, g && (x.presentation.placement = Ae.placement), h && (Ae.widthPx === void 0 ? delete x.presentation.widthPx : x.presentation.widthPx = Ae.widthPx);
2288
+ x.presentation = { ..._.presentation }, g && (x.presentation.placement = Ae.placement), h && (Ae.widthPx === void 0 ? delete x.presentation.widthPx : x.presentation.widthPx = Ae.widthPx);
2289
2289
  }
2290
2290
  return (n.forceSelection !== void 0 || u) && (f ? x.forceSelection = f : delete x.forceSelection), n.requiredAtExecution !== void 0 && (n.requiredAtExecution ? x.requiredAtExecution = !0 : delete x.requiredAtExecution), Ke(x, "optionSource", n.optionSource), Ke(x, "optionDependencies", n.optionDependencies), Ke(x, "optionPopulation", n.optionPopulation), ((wt = n.mapping) == null ? void 0 : wt.kind) === "save" && n.mapping.draft.acceptance.ok ? x.application = n.mapping.draft.acceptance.application : ((Dt = n.mapping) == null ? void 0 : Dt.kind) === "remove" && delete x.application, x;
2291
- }, v = n.label !== void 0 && n.label !== s.label && n.label !== l.title ? n.label : void 0, I = u || n.variableName !== void 0 || v !== void 0, b = (M) => ({
2292
- ...M,
2291
+ }, v = n.label !== void 0 && n.label !== s.label && n.label !== l.title ? n.label : void 0, I = u || n.variableName !== void 0 || v !== void 0, b = (_) => ({
2292
+ ..._,
2293
2293
  ...n.variableName !== void 0 ? { variableName: m } : {},
2294
2294
  ...v !== void 0 ? { title: v } : {}
2295
- }), S = Array.isArray(e.inputs) ? [...e.inputs] : [], A = S.findIndex((M) => M.id === s.id), k = S[A];
2295
+ }), S = Array.isArray(e.inputs) ? [...e.inputs] : [], A = S.findIndex((_) => _.id === s.id), k = S[A];
2296
2296
  if (A < 0 || (k == null ? void 0 : k.kind) !== "filter" || !k.filter)
2297
2297
  return a("This filter can not be edited here.");
2298
2298
  const B = C(
@@ -2312,12 +2312,12 @@ function Uo(e, t, n, r = { calendar: null }) {
2312
2312
  G.issues[0]
2313
2313
  );
2314
2314
  let $ = { ...e, inputs: S };
2315
- const te = Q($), O = te.findFilterInput({ filterId: l.id });
2315
+ const te = X($), O = te.findFilterInput({ filterId: l.id });
2316
2316
  if (!O)
2317
2317
  return a(
2318
2318
  ((Ct = te.issues[0]) == null ? void 0 : Ct.message) ?? "These settings could not be saved."
2319
2319
  );
2320
- const q = n.variableName !== void 0 || n.scope !== void 0 ? jo($, O.input) : void 0;
2320
+ const q = n.variableName !== void 0 || n.scope !== void 0 ? Uo($, O.input) : void 0;
2321
2321
  if (q)
2322
2322
  return a(
2323
2323
  `Another filter on the same cards is already named "${q}". Choose another name.`
@@ -2330,7 +2330,7 @@ function Uo(e, t, n, r = { calendar: null }) {
2330
2330
  defaultInputValues: $.defaultInputValues,
2331
2331
  dashboardInputValues: {}
2332
2332
  };
2333
- const fe = ((Ft = n.values) == null ? void 0 : Ft.target) ?? {}, P = Ho(
2333
+ const fe = ((Ft = n.values) == null ? void 0 : Ft.target) ?? {}, P = Go(
2334
2334
  c,
2335
2335
  l,
2336
2336
  {
@@ -2345,12 +2345,12 @@ function Uo(e, t, n, r = { calendar: null }) {
2345
2345
  r.calendar ?? void 0
2346
2346
  );
2347
2347
  if (P.defaultValueChanged || P.selectionIdentityChanged || P.defaultComparisonChanged) {
2348
- const M = Xn({
2348
+ const _ = Qn({
2349
2349
  state: { ...R, dashboardInputValues: {} },
2350
2350
  input: W,
2351
2351
  settings: P
2352
2352
  });
2353
- R = { ...R, defaultInputValues: M.defaultInputValues }, P.selectionIdentityChanged && U.push({
2353
+ R = { ...R, defaultInputValues: _.defaultInputValues }, P.selectionIdentityChanged && U.push({
2354
2354
  kind: "clear",
2355
2355
  inputId: W.id,
2356
2356
  target: P.target
@@ -2366,7 +2366,7 @@ function Uo(e, t, n, r = { calendar: null }) {
2366
2366
  });
2367
2367
  }
2368
2368
  if (n.scope && O.input.runtimeScope !== "shared") {
2369
- const M = Go(
2369
+ const _ = zo(
2370
2370
  $,
2371
2371
  s,
2372
2372
  O.input,
@@ -2374,29 +2374,29 @@ function Uo(e, t, n, r = { calendar: null }) {
2374
2374
  );
2375
2375
  R = {
2376
2376
  ...R,
2377
- defaultInputValues: M.defaultInputValues
2377
+ defaultInputValues: _.defaultInputValues
2378
2378
  }, U.push(
2379
- ...M.dropped.map((x) => ({
2379
+ ..._.dropped.map((x) => ({
2380
2380
  kind: "dropTargetSlot",
2381
2381
  inputId: W.id,
2382
2382
  target: x
2383
2383
  }))
2384
2384
  );
2385
2385
  }
2386
- return $ = Wo($, R), {
2386
+ return $ = jo($, R), {
2387
2387
  ok: !0,
2388
2388
  dashboard: $,
2389
2389
  inputId: O.input.id,
2390
2390
  valueEffects: U
2391
2391
  };
2392
2392
  }
2393
- function ol(e) {
2394
- let t = Mt({
2393
+ function il(e) {
2394
+ let t = _t({
2395
2395
  dashboard: e.before,
2396
2396
  runtimeValues: e.dashboardInputValues,
2397
2397
  calendar: e.calendar
2398
2398
  });
2399
- const n = Q(e.after), r = (i) => {
2399
+ const n = X(e.after), r = (i) => {
2400
2400
  var o;
2401
2401
  return (o = n.findFilterInput({ inputId: i })) == null ? void 0 : o.input;
2402
2402
  };
@@ -2407,7 +2407,7 @@ function ol(e) {
2407
2407
  case "setDefaultComparison": {
2408
2408
  const o = r(i.inputId);
2409
2409
  if (!o) break;
2410
- t = Xn({
2410
+ t = Qn({
2411
2411
  state: { dashboardInputValues: t },
2412
2412
  input: o,
2413
2413
  settings: {
@@ -2431,22 +2431,22 @@ function ol(e) {
2431
2431
  break;
2432
2432
  }
2433
2433
  }
2434
- return Mt({
2434
+ return _t({
2435
2435
  dashboard: e.after,
2436
2436
  runtimeValues: t,
2437
2437
  calendar: e.calendar
2438
2438
  });
2439
2439
  }
2440
- function zo(e) {
2440
+ function qo(e) {
2441
2441
  var t;
2442
2442
  return e.kind !== "documentSections" && (e.kind !== "allSheets" || ((t = e.sheetKinds) == null ? void 0 : t.length) === 1 && e.sheetKinds[0] === "dashboard");
2443
2443
  }
2444
2444
  function Ke(e, t, n) {
2445
2445
  n !== void 0 && (n === null ? delete e[t] : e[t] = n);
2446
2446
  }
2447
- function jo(e, t) {
2447
+ function Uo(e, t) {
2448
2448
  const n = [
2449
- ...Q(e).inputs.map((i) => i.input),
2449
+ ...X(e).inputs.map((i) => i.input),
2450
2450
  ...(Array.isArray(e.inputs) ? e.inputs : []).filter(
2451
2451
  (i) => i.kind === "control"
2452
2452
  )
@@ -2461,7 +2461,7 @@ function jo(e, t) {
2461
2461
  )
2462
2462
  ) ? t.variableName : void 0;
2463
2463
  }
2464
- function Go(e, t, n, r) {
2464
+ function zo(e, t, n, r) {
2465
2465
  var d, u;
2466
2466
  const i = [], o = xn(e), a = (f) => Jt(t, f, o), s = (f) => Jt(n, f, o), c = [];
2467
2467
  if (n.runtimeScope === "perSheet")
@@ -2475,7 +2475,7 @@ function Go(e, t, n, r) {
2475
2475
  sheetKind: (d = o.get(f.sheetId)) == null ? void 0 : d.sheetKind
2476
2476
  });
2477
2477
  for (const f of e.variables ?? [])
2478
- c.push(...la(e, f.id));
2478
+ c.push(...sa(e, f.id));
2479
2479
  } else if (n.runtimeScope === "perDocumentSection")
2480
2480
  for (const f of e.sheets ?? [])
2481
2481
  for (const m of ((u = f.document) == null ? void 0 : u.sections) ?? [])
@@ -2500,13 +2500,13 @@ function Jt(e, t, n) {
2500
2500
  const r = n.get(t.sheetId);
2501
2501
  return r ? wn(e, r) : !1;
2502
2502
  }
2503
- return da(e, t);
2503
+ return ca(e, t);
2504
2504
  }
2505
- function Wo(e, t) {
2505
+ function jo(e, t) {
2506
2506
  const n = { ...e };
2507
2507
  return t.defaultInputValues && Object.keys(t.defaultInputValues).length ? n.defaultInputValues = t.defaultInputValues : e.defaultInputValues !== void 0 && delete n.defaultInputValues, n;
2508
2508
  }
2509
- function Ho(e, t, n, r, i) {
2509
+ function Go(e, t, n, r, i) {
2510
2510
  const o = !!(n != null && n.defaultValueChanged || n != null && n.selectionIdentityChanged) || ci(e, t);
2511
2511
  return {
2512
2512
  ...n,
@@ -2515,12 +2515,12 @@ function Ho(e, t, n, r, i) {
2515
2515
  defaultFilterValue: o ? ie(t, i) : void 0
2516
2516
  };
2517
2517
  }
2518
- function Xn(e) {
2518
+ function Qn(e) {
2519
2519
  const { settings: t } = e;
2520
2520
  if (!t) return e.state;
2521
2521
  const n = e.input;
2522
2522
  let r = e.state.dashboardInputValues, i = e.state.defaultInputValues;
2523
- if (t.selectionIdentityChanged && (r = _t(
2523
+ if (t.selectionIdentityChanged && (r = Mt(
2524
2524
  r,
2525
2525
  n,
2526
2526
  t.target,
@@ -2553,7 +2553,7 @@ function Xn(e) {
2553
2553
  n,
2554
2554
  t.target,
2555
2555
  { comparisonSelection: o.comparisonSelection }
2556
- )), i = Object.keys(a).length ? a : void 0, r = _t(
2556
+ )), i = Object.keys(a).length ? a : void 0, r = Mt(
2557
2557
  r,
2558
2558
  n,
2559
2559
  t.target,
@@ -2583,7 +2583,7 @@ function Xn(e) {
2583
2583
  };
2584
2584
  }
2585
2585
  const ee = (e) => Array.isArray(e.inputs) ? e.inputs : [];
2586
- function _e(e, t) {
2586
+ function Me(e, t) {
2587
2587
  const n = ee(e).find((r) => r.id === t);
2588
2588
  if (!n || n.kind !== "filter")
2589
2589
  throw new F("filter_not_found", `No filter ${t} on this dashboard.`, "Read the outline again and use its filter ids.");
@@ -2597,23 +2597,23 @@ function Zn(e, t) {
2597
2597
  if (!Dn(e, t))
2598
2598
  throw new F("card_not_found", `No card or variable ${t} on this dashboard.`, "Read the outline again and use its card ids and variable names.");
2599
2599
  }
2600
- function Yo(e, t, n) {
2601
- const r = Q(e), i = r.findFilterInput({ inputId: t });
2600
+ function Wo(e, t, n) {
2601
+ const r = X(e), i = r.findFilterInput({ inputId: t });
2602
2602
  return i ? r.reachedCards({ inputId: t }).filter(
2603
2603
  (o) => ["bound", "automatic", "sql", "relationshipApplied"].includes(
2604
- ui(i.input, o.card, n).reach
2604
+ bn(i.input, o.card, n).reach
2605
2605
  )
2606
2606
  ).length : 0;
2607
2607
  }
2608
- function Qo(e, t) {
2609
- return er(e, t, "relationship");
2608
+ function Ho(e, t, n) {
2609
+ return er(e, t, "relationship", n);
2610
2610
  }
2611
- function Xo(e, t) {
2611
+ function Yo(e, t) {
2612
2612
  return er(e, t, "sqlTemplate");
2613
2613
  }
2614
- function er(e, t, n) {
2615
- const r = Q(e), i = r.findFilterInput({ inputId: t });
2616
- return i ? r.reachedCards({ inputId: t }).filter((o) => fi(i.input, o.card) === n).length : 0;
2614
+ function er(e, t, n, r) {
2615
+ const i = X(e), o = i.findFilterInput({ inputId: t });
2616
+ return o ? i.reachedCards({ inputId: t }).filter((a) => bn(o.input, a.card, r).reach === n).length : 0;
2617
2617
  }
2618
2618
  function tr(e, t) {
2619
2619
  if (t.scope.kind === "allSheets") return "every sheet";
@@ -2636,35 +2636,35 @@ function rr(e) {
2636
2636
  function ue(e) {
2637
2637
  return T.plain("filter", e);
2638
2638
  }
2639
- function Jo(e, t) {
2640
- const { input: n } = t, r = ee(e);
2641
- if (r.some((d) => d.id === n.id))
2642
- throw new F("filter_id_taken", `A filter with id ${n.id} is already on this dashboard.`);
2643
- if (Q(e).findFilterInput({ filterId: n.filter.id }))
2644
- throw new F("filter_id_taken", `A filter definition with id ${n.filter.id} is already on this dashboard.`);
2645
- const i = { ...e, inputs: [...r, n] }, o = Yo(i, n.id), a = Qo(i, n.id), s = Xo(i, n.id), c = De([
2646
- ...a ? [`may filter ${a} more through the domain's relationships`] : [],
2647
- ...s ? [`may filter ${s} more through ${s === 1 ? "its" : "their"} SQL`] : []
2648
- ]), l = [nr(n), rr(n)].filter(Boolean).join(", ");
2639
+ function Xo(e, t, n) {
2640
+ const { input: r } = t, i = ee(e);
2641
+ if (i.some((f) => f.id === r.id))
2642
+ throw new F("filter_id_taken", `A filter with id ${r.id} is already on this dashboard.`);
2643
+ if (X(e).findFilterInput({ filterId: r.filter.id }))
2644
+ throw new F("filter_id_taken", `A filter definition with id ${r.filter.id} is already on this dashboard.`);
2645
+ const o = { ...e, inputs: [...i, r] }, a = n.relationshipReach ? { relationshipReach: n.relationshipReach } : void 0, s = Wo(o, r.id, a), c = Ho(o, r.id, a), l = Yo(o, r.id), d = De([
2646
+ ...c ? [`may filter ${c} more through the domain's relationships`] : [],
2647
+ ...l ? [`may filter ${l} more through ${l === 1 ? "its" : "their"} SQL`] : []
2648
+ ]), u = [nr(r), rr(r)].filter(Boolean).join(", ");
2649
2649
  return {
2650
- dashboard: i,
2650
+ dashboard: o,
2651
2651
  created: [
2652
2652
  {
2653
2653
  kind: "filter",
2654
- id: n.id,
2655
- title: n.label,
2654
+ id: r.id,
2655
+ title: r.label,
2656
2656
  ...t.changeIndex !== void 0 ? { changeIndex: t.changeIndex } : {}
2657
2657
  }
2658
2658
  ],
2659
2659
  clauses: [
2660
2660
  ue(
2661
- `adds the filter ${w(n.label)} (${l}) to ${tr(i, n)}; it filters ${o} card${o === 1 ? "" : "s"}${c ? ` and ${c}` : ""}`
2661
+ `adds the filter ${w(r.label)} (${u}) to ${tr(o, r)}; it filters ${s} card${s === 1 ? "" : "s"}${d ? ` and ${d}` : ""}`
2662
2662
  )
2663
2663
  ]
2664
2664
  };
2665
2665
  }
2666
- function Zo(e, t, n) {
2667
- const r = Uo(e, { inputId: t.filterId }, t.settings, {
2666
+ function Qo(e, t, n) {
2667
+ const r = Bo(e, { inputId: t.filterId }, t.settings, {
2668
2668
  calendar: n.calendar
2669
2669
  });
2670
2670
  if (!r.ok) {
@@ -2680,21 +2680,21 @@ function Zo(e, t, n) {
2680
2680
  return {
2681
2681
  dashboard: r.dashboard,
2682
2682
  runtimeEffects: [{ kind: "filter_value", effects: r.valueEffects }],
2683
- clauses: [ue(`changes the filter ${w((i == null ? void 0 : i.label) ?? o.label)}: ${es(r.dashboard, i, o)}`)]
2683
+ clauses: [ue(`changes the filter ${w((i == null ? void 0 : i.label) ?? o.label)}: ${Jo(r.dashboard, i, o)}`)]
2684
2684
  };
2685
2685
  }
2686
- function es(e, t, n) {
2686
+ function Jo(e, t, n) {
2687
2687
  var o, a, s, c, l, d;
2688
2688
  if (!t) return "updates its settings";
2689
2689
  const r = [];
2690
- if (t.label !== n.label && r.push(`renames it ${w(n.label)}`), (((o = t.filter) == null ? void 0 : o.type) ?? "multiple") !== (((a = n.filter) == null ? void 0 : a.type) ?? "multiple") && r.push(`makes it ${nr(n)}`), JSON.stringify(((s = t.filter) == null ? void 0 : s.defaultValues) ?? null) !== JSON.stringify(((c = n.filter) == null ? void 0 : c.defaultValues) ?? null) || !Li((l = t.filter) == null ? void 0 : l.defaultDateFilter, (d = n.filter) == null ? void 0 : d.defaultDateFilter)) {
2690
+ if (t.label !== n.label && r.push(`renames it ${w(n.label)}`), (((o = t.filter) == null ? void 0 : o.type) ?? "multiple") !== (((a = n.filter) == null ? void 0 : a.type) ?? "multiple") && r.push(`makes it ${nr(n)}`), JSON.stringify(((s = t.filter) == null ? void 0 : s.defaultValues) ?? null) !== JSON.stringify(((c = n.filter) == null ? void 0 : c.defaultValues) ?? null) || !Ri((l = t.filter) == null ? void 0 : l.defaultDateFilter, (d = n.filter) == null ? void 0 : d.defaultDateFilter)) {
2691
2691
  const u = rr(n);
2692
2692
  r.push(u ? `sets its ${u.replace(/^default /, "default to ").replace(/^a default period$/, "default period")}` : "removes its default");
2693
2693
  }
2694
2694
  return JSON.stringify(t.scope) !== JSON.stringify(n.scope) && r.push(`applies it to ${tr(e, n)}`), r.length ? De(r) : "keeps its settings";
2695
2695
  }
2696
- function ts(e, t) {
2697
- const n = _e(e, t);
2696
+ function Zo(e, t) {
2697
+ const n = Me(e, t);
2698
2698
  return {
2699
2699
  dashboard: {
2700
2700
  ...e,
@@ -2705,10 +2705,10 @@ function ts(e, t) {
2705
2705
  clauses: [ue(`removes the filter ${w(n.label)}`)]
2706
2706
  };
2707
2707
  }
2708
- function ns(e, t, n) {
2708
+ function es(e, t, n) {
2709
2709
  var a;
2710
2710
  Zn(e, n);
2711
- const r = fa(t.scope, n);
2711
+ const r = da(t.scope, n);
2712
2712
  if (!r)
2713
2713
  throw new F(
2714
2714
  "filter_invalid",
@@ -2725,7 +2725,7 @@ function ns(e, t, n) {
2725
2725
  }
2726
2726
  function ir(e, t, n, r, i) {
2727
2727
  var d, u;
2728
- const o = _e(e, t);
2728
+ const o = Me(e, t);
2729
2729
  Zn(e, n);
2730
2730
  const a = [...((d = o.application) == null ? void 0 : d.cards) ?? []], s = a.findIndex((f) => f.cardId === n);
2731
2731
  s >= 0 ? a[s] = r : a.push(r);
@@ -2745,7 +2745,7 @@ function ir(e, t, n, r, i) {
2745
2745
  inputs: ee(e).map((f) => f.id === t ? c : f)
2746
2746
  };
2747
2747
  }
2748
- function rs(e) {
2748
+ function ts(e) {
2749
2749
  switch (e.kind) {
2750
2750
  case "field":
2751
2751
  return `by ${e.field.name}`;
@@ -2755,22 +2755,22 @@ function rs(e) {
2755
2755
  return String(e.kind);
2756
2756
  }
2757
2757
  }
2758
- function is(e, t) {
2759
- const n = _e(e, t.filterId), r = { ...t.binding, kind: "bound", cardId: t.cardId }, i = ua(n.scope, t.cardId), o = i !== n.scope;
2758
+ function ns(e, t) {
2759
+ const n = Me(e, t.filterId), r = { ...t.binding, kind: "bound", cardId: t.cardId }, i = la(n.scope, t.cardId), o = i !== n.scope;
2760
2760
  return {
2761
2761
  dashboard: ir(e, t.filterId, t.cardId, r, o ? i : void 0),
2762
2762
  clauses: [
2763
2763
  ue(
2764
- `makes ${w(n.label)} filter ${Jn(e, t.cardId)} ${rs(r.target)}${o ? ", which it used to leave out" : ""}`
2764
+ `makes ${w(n.label)} filter ${Jn(e, t.cardId)} ${ts(r.target)}${o ? ", which it used to leave out" : ""}`
2765
2765
  )
2766
2766
  ]
2767
2767
  };
2768
2768
  }
2769
- function as(e, t) {
2769
+ function rs(e, t) {
2770
2770
  var i;
2771
- const n = _e(e, t.filterId);
2771
+ const n = Me(e, t.filterId);
2772
2772
  return {
2773
- dashboard: ((i = n.filter) == null ? void 0 : i.kind) === "global-date" ? ns(e, n, t.cardId) : ir(e, t.filterId, t.cardId, { kind: "excluded", cardId: t.cardId }),
2773
+ dashboard: ((i = n.filter) == null ? void 0 : i.kind) === "global-date" ? es(e, n, t.cardId) : ir(e, t.filterId, t.cardId, { kind: "excluded", cardId: t.cardId }),
2774
2774
  clauses: [ue(`stops ${w(n.label)} from filtering ${Jn(e, t.cardId)}`)]
2775
2775
  };
2776
2776
  }
@@ -2791,10 +2791,10 @@ function Ye(e, t) {
2791
2791
  }
2792
2792
  function ar(e) {
2793
2793
  var r;
2794
- const t = Co(e), n = t.charAt(0).toLowerCase() + t.slice(1);
2794
+ const t = vo(e), n = t.charAt(0).toLowerCase() + t.slice(1);
2795
2795
  return e.get.kind === "only" && !((r = e.query.sql) != null && r.trim()) ? `${n}. When more than one matches it shows nothing` : n;
2796
2796
  }
2797
- function os(e, t) {
2797
+ function is(e, t) {
2798
2798
  const n = ot(e, { kind: "add", variable: t.variable });
2799
2799
  n.ok || gt(n.issues, "This variable could not be added.");
2800
2800
  const { variable: r } = t;
@@ -2805,7 +2805,7 @@ function os(e, t) {
2805
2805
  clauses: [T.plain("variable", `adds the variable ${r.name}: ${ar(r)}`)]
2806
2806
  };
2807
2807
  }
2808
- function ss(e, t) {
2808
+ function as(e, t) {
2809
2809
  const n = Ye(e, t.variableId), r = Object.fromEntries(Object.entries(t.patch).map(([m, p]) => [m, p === null ? void 0 : p])), i = ot(e, { kind: "update", id: t.variableId, patch: r });
2810
2810
  i.ok || gt(i.issues, "This variable could not be changed.");
2811
2811
  const o = Ye(i.dashboard, t.variableId), a = [];
@@ -2817,7 +2817,7 @@ function ss(e, t) {
2817
2817
  clauses: a.length ? a : [T.plain("variable", `changes nothing on the variable ${o.name}`)]
2818
2818
  };
2819
2819
  }
2820
- function cs(e, t) {
2820
+ function os(e, t) {
2821
2821
  const n = Ye(e, t.variableId), r = ot(e, { kind: "remove", id: t.variableId, confirmed: !1 });
2822
2822
  r.ok || gt(r.issues, "This variable could not be removed.");
2823
2823
  const i = r.removedMappings ? ` and its ${r.removedMappings === 1 ? "filter mapping" : `${r.removedMappings} filter mappings`}` : "";
@@ -2827,19 +2827,19 @@ function cs(e, t) {
2827
2827
  };
2828
2828
  }
2829
2829
  function or(e) {
2830
- return e.cards.length < ma;
2830
+ return e.cards.length < ua;
2831
2831
  }
2832
- function ls(e) {
2832
+ function ss(e) {
2833
2833
  return e.kpi.layout === "tiles" && e.cards.length + 1 > kn;
2834
2834
  }
2835
- function ds(e, t) {
2835
+ function cs(e, t) {
2836
2836
  return !or(e) || t.type !== "kpi" || e.cards.some(({ id: n }) => n === t.id) ? e : {
2837
2837
  ...e,
2838
2838
  cards: [...e.cards, t],
2839
- kpi: ls(e) ? { ...e.kpi, layout: "lines" } : e.kpi
2839
+ kpi: ss(e) ? { ...e.kpi, layout: "lines" } : e.kpi
2840
2840
  };
2841
2841
  }
2842
- function us(e, t) {
2842
+ function ls(e, t) {
2843
2843
  if (e.cards.length <= 1) return e;
2844
2844
  const n = e.cards.filter(({ id: r }) => r !== t);
2845
2845
  return n.length === e.cards.length ? e : { ...e, cards: n };
@@ -2847,11 +2847,11 @@ function us(e, t) {
2847
2847
  function sr(e) {
2848
2848
  return e.cards.length <= kn;
2849
2849
  }
2850
- function fs(e, t) {
2850
+ function ds(e, t) {
2851
2851
  const n = { ...e.kpi, ...t };
2852
2852
  return n.layout === "tiles" && !sr(e) ? e : { ...e, kpi: n };
2853
2853
  }
2854
- const ms = ["table"], ps = ["matrixTable"];
2854
+ const us = ["table"], fs = ["matrixTable"];
2855
2855
  function Zt(e, t, n) {
2856
2856
  return {
2857
2857
  id: e.section(),
@@ -2906,7 +2906,7 @@ const V = {
2906
2906
  description: "Rows and columns from one dataset.",
2907
2907
  group: "data",
2908
2908
  addable: !0,
2909
- cardTypes: ms,
2909
+ cardTypes: us,
2910
2910
  create: (e) => Zt(e, "table", "Table")
2911
2911
  },
2912
2912
  matrix: {
@@ -2915,7 +2915,7 @@ const V = {
2915
2915
  description: "Grouped rows with subtotals, and optional column levels.",
2916
2916
  group: "data",
2917
2917
  addable: !0,
2918
- cardTypes: ps,
2918
+ cardTypes: fs,
2919
2919
  create: (e) => Zt(e, "matrixTable", "Matrix")
2920
2920
  },
2921
2921
  kpi: {
@@ -2982,15 +2982,15 @@ function lr(e) {
2982
2982
  return V.page_break;
2983
2983
  }
2984
2984
  }
2985
- function gs(e, t) {
2985
+ function ms(e, t) {
2986
2986
  return lr(e).cardTypes.includes(t);
2987
2987
  }
2988
2988
  function dr(e, t) {
2989
- if (gs(e, t)) return null;
2989
+ if (ms(e, t)) return null;
2990
2990
  const n = lr(e);
2991
2991
  return n.id === "table" ? "Table sections hold Table cards only" : n.id === "kpi" ? "KPI sections hold KPI cards only" : n.id === "matrix" ? "Matrix sections hold Matrix cards only" : `${n.label} sections do not accept this visual`;
2992
2992
  }
2993
- function hs(e, t, n) {
2993
+ function ps(e, t, n) {
2994
2994
  if (!st(e).some(({ id: i }) => i === t))
2995
2995
  throw new Error(
2996
2996
  `Document section '${e.id}' has no card '${t}'.`
@@ -3003,21 +3003,21 @@ function hs(e, t, n) {
3003
3003
  (i) => i.id === t ? n : i
3004
3004
  );
3005
3005
  }
3006
- const ys = [
3006
+ const gs = [
3007
3007
  { id: "data", label: "Data" },
3008
3008
  { id: "content", label: "Content" },
3009
3009
  { id: "layout", label: "Layout" }
3010
3010
  ];
3011
- function sl() {
3011
+ function al() {
3012
3012
  const e = Object.values(V).filter(
3013
3013
  (t) => t.addable
3014
3014
  );
3015
- return ys.map((t) => ({
3015
+ return gs.map((t) => ({
3016
3016
  ...t,
3017
3017
  kinds: e.filter((n) => n.group === t.id)
3018
3018
  })).filter((t) => t.kinds.length > 0);
3019
3019
  }
3020
- const bs = {
3020
+ const hs = {
3021
3021
  header: ["title", "metadata"],
3022
3022
  footer: ["note", "pageInfo"]
3023
3023
  };
@@ -3026,27 +3026,27 @@ class D extends Error {
3026
3026
  super(t), this.name = "DocumentEditError";
3027
3027
  }
3028
3028
  }
3029
- const en = 8, vs = 240;
3030
- function cl() {
3029
+ const en = 8, ys = 240;
3030
+ function ol() {
3031
3031
  return {
3032
3032
  section: () => `doc_section_${Fe()}`,
3033
3033
  card: () => `doc_card_${Fe()}`
3034
3034
  };
3035
3035
  }
3036
- function Is(e) {
3036
+ function bs(e) {
3037
3037
  return Number.isFinite(e) ? Math.min(
3038
- vs,
3038
+ ys,
3039
3039
  Math.max(en, Math.round(e))
3040
3040
  ) : en;
3041
3041
  }
3042
- function ll(e, t, n, r) {
3042
+ function sl(e, t, n, r) {
3043
3043
  const i = e.findIndex(({ id: s }) => s === t), o = e.findIndex(({ id: s }) => s === n);
3044
3044
  if (i === -1 || o === -1) return i;
3045
3045
  const a = r === "after" ? o + 1 : o;
3046
3046
  return i < a ? a - 1 : a;
3047
3047
  }
3048
- const Cs = /* @__PURE__ */ new Set(["table", "matrixTable", "kpi"]);
3049
- function Fs(e, t = {}) {
3048
+ const vs = /* @__PURE__ */ new Set(["table", "matrixTable", "kpi"]);
3049
+ function Is(e, t = {}) {
3050
3050
  const n = new Set(
3051
3051
  (e.sheets || []).flatMap(
3052
3052
  (r) => (r.frames || []).flatMap(
@@ -3055,13 +3055,13 @@ function Fs(e, t = {}) {
3055
3055
  )
3056
3056
  );
3057
3057
  return Tn(e).filter(
3058
- (r) => Cs.has(r.card.type) && !r.card.linkedSourceCardId && !(r.kind === "frameCard" && n.has(r.frameId)) && !(r.kind === "documentSectionCard" && r.sectionId === t.excludeSectionId) && !pi(r.card)
3058
+ (r) => vs.has(r.card.type) && !r.card.linkedSourceCardId && !(r.kind === "frameCard" && n.has(r.frameId)) && !(r.kind === "documentSectionCard" && r.sectionId === t.excludeSectionId) && !fi(r.card)
3059
3059
  );
3060
3060
  }
3061
- function Ss(e) {
3061
+ function Cs(e) {
3062
3062
  return e.type === "kpi" ? "kpi" : e.type === "matrixTable" ? "matrix" : "table";
3063
3063
  }
3064
- function xs(e, t, n) {
3064
+ function Fs(e, t, n) {
3065
3065
  const r = e.sections, i = (a) => ({
3066
3066
  ...e,
3067
3067
  sections: a
@@ -3078,7 +3078,7 @@ function xs(e, t, n) {
3078
3078
  };
3079
3079
  }
3080
3080
  case "copyCard": {
3081
- const a = Le(t.source, n), c = V[Ss(a.card)].create({
3081
+ const a = Le(t.source, n), c = V[Cs(a.card)].create({
3082
3082
  section: n.ids.section,
3083
3083
  card: () => a.card.id
3084
3084
  }), l = c.type === "kpi" ? { ...c, title: void 0, cards: [a.card] } : c.type === "table" ? { ...c, title: a.card.title || c.title, card: a.card } : c;
@@ -3114,7 +3114,7 @@ function xs(e, t, n) {
3114
3114
  const a = r.findIndex(({ id: l }) => l === t.sectionId);
3115
3115
  if (a === -1) throw ye(t.sectionId);
3116
3116
  const s = [...r], [c] = s.splice(a, 1);
3117
- return s.splice(Qe(t.toIndex, s.length), 0, c), {
3117
+ return s.splice(Xe(t.toIndex, s.length), 0, c), {
3118
3118
  document: i(s),
3119
3119
  target: o(t.sectionId)
3120
3120
  };
@@ -3122,7 +3122,7 @@ function xs(e, t, n) {
3122
3122
  case "duplicate": {
3123
3123
  const a = r.findIndex(({ id: c }) => c === t.sectionId);
3124
3124
  if (a === -1) throw ye(t.sectionId);
3125
- const s = Ts(r[a], n.ids);
3125
+ const s = Ss(r[a], n.ids);
3126
3126
  return {
3127
3127
  document: i(Ve(r, s, a + 1)),
3128
3128
  target: o(s.id)
@@ -3165,13 +3165,13 @@ function xs(e, t, n) {
3165
3165
  };
3166
3166
  }
3167
3167
  case "updateRegionText": {
3168
- if (!bs[t.region].includes(t.role))
3168
+ if (!hs[t.region].includes(t.role))
3169
3169
  throw new D(
3170
3170
  `The ${t.region} has ${t.region === "header" ? "a title and a metadata line" : "a note and a page info line"}, not a ${t.role} line.`
3171
3171
  );
3172
- if (t.style !== void 0 && !mi(t.role))
3172
+ if (t.style !== void 0 && !ui(t.role))
3173
3173
  throw new D(`The footer's ${t.role === "pageInfo" ? "page info" : t.role} line has no size or alignment; only the header's title and metadata lines do.`);
3174
- const a = e[t.region], s = a ? Ko(a.blocks, t.role) : void 0, c = t.style !== void 0 ? Nt(s == null ? void 0 : s.style, t.style) : s == null ? void 0 : s.style, l = {
3174
+ const a = e[t.region], s = a ? Eo(a.blocks, t.role) : void 0, c = t.style !== void 0 ? Nt(s == null ? void 0 : s.style, t.style) : s == null ? void 0 : s.style, l = {
3175
3175
  id: (s == null ? void 0 : s.id) ?? `${t.region}_${t.role}`,
3176
3176
  role: t.role,
3177
3177
  area: (s == null ? void 0 : s.area) ?? t.role,
@@ -3179,15 +3179,15 @@ function xs(e, t, n) {
3179
3179
  ...c ? { style: c } : {}
3180
3180
  };
3181
3181
  if (t.region === "header") {
3182
- const u = (a == null ? void 0 : a.region) === "header" ? a : Eo();
3182
+ const u = (a == null ? void 0 : a.region) === "header" ? a : No();
3183
3183
  return {
3184
- document: { ...e, header: { ...u, enabled: !0, blocks: Xt(u.blocks, l) } },
3184
+ document: { ...e, header: { ...u, enabled: !0, blocks: Qt(u.blocks, l) } },
3185
3185
  target: { kind: "header" }
3186
3186
  };
3187
3187
  }
3188
- const d = (a == null ? void 0 : a.region) === "footer" ? a : Ro();
3188
+ const d = (a == null ? void 0 : a.region) === "footer" ? a : $o();
3189
3189
  return {
3190
- document: { ...e, footer: { ...d, enabled: !0, blocks: Xt(d.blocks, l) } },
3190
+ document: { ...e, footer: { ...d, enabled: !0, blocks: Qt(d.blocks, l) } },
3191
3191
  target: { kind: "footer" }
3192
3192
  };
3193
3193
  }
@@ -3211,7 +3211,7 @@ function xs(e, t, n) {
3211
3211
  throw new D("Tiles hold up to 6 KPIs.");
3212
3212
  return {
3213
3213
  document: i(
3214
- K(r, fs(a, t.options))
3214
+ K(r, ds(a, t.options))
3215
3215
  ),
3216
3216
  target: o(a.id)
3217
3217
  };
@@ -3223,7 +3223,7 @@ function xs(e, t, n) {
3223
3223
  document: i(
3224
3224
  K(r, {
3225
3225
  ...a,
3226
- heightPx: Is(t.heightPx)
3226
+ heightPx: bs(t.heightPx)
3227
3227
  })
3228
3228
  ),
3229
3229
  target: o(a.id)
@@ -3234,7 +3234,7 @@ function xs(e, t, n) {
3234
3234
  t.card.id !== t.oldCardId && tn(n, t.card.id);
3235
3235
  let s;
3236
3236
  try {
3237
- s = hs(a, t.oldCardId, t.card);
3237
+ s = ps(a, t.oldCardId, t.card);
3238
3238
  } catch (c) {
3239
3239
  throw new D(c.message);
3240
3240
  }
@@ -3255,7 +3255,7 @@ function xs(e, t, n) {
3255
3255
  const c = (s == null ? void 0 : s.card) ?? t.card ?? cr(n.ids.card());
3256
3256
  if (c.type !== "kpi")
3257
3257
  throw new D("KPI sections hold KPI cards only");
3258
- const l = ds(a, c);
3258
+ const l = cs(a, c);
3259
3259
  if (l === a)
3260
3260
  throw new D(`KPI section '${a.id}' already has card '${c.id}'.`);
3261
3261
  return {
@@ -3269,7 +3269,7 @@ function xs(e, t, n) {
3269
3269
  if (a.type !== "kpi") throw H(t.type, a);
3270
3270
  if (!a.cards.some(({ id: c }) => c === t.cardId))
3271
3271
  throw new D(`KPI section '${a.id}' has no card '${t.cardId}'.`);
3272
- const s = us(a, t.cardId);
3272
+ const s = ls(a, t.cardId);
3273
3273
  if (s === a)
3274
3274
  throw new D("A KPI section keeps at least one KPI.");
3275
3275
  return {
@@ -3285,25 +3285,25 @@ function xs(e, t, n) {
3285
3285
  if (s === -1)
3286
3286
  throw new D(`KPI section '${a.id}' has no card '${t.cardId}'.`);
3287
3287
  const c = [...a.cards], [l] = c.splice(s, 1);
3288
- return c.splice(Qe(t.toIndex, c.length), 0, l), {
3288
+ return c.splice(Xe(t.toIndex, c.length), 0, l), {
3289
3289
  document: i(K(r, { ...a, cards: c })),
3290
3290
  target: o(a.id, t.cardId)
3291
3291
  };
3292
3292
  }
3293
3293
  default:
3294
- return Ds(t);
3294
+ return Ts(t);
3295
3295
  }
3296
3296
  }
3297
3297
  function Le(e, t, n) {
3298
- const r = Fs(t.dashboard, {
3298
+ const r = Is(t.dashboard, {
3299
3299
  excludeSectionId: n
3300
- }).find((p) => ws(p, e));
3300
+ }).find((p) => xs(p, e));
3301
3301
  if (!r)
3302
3302
  throw new D(
3303
3303
  `Card '${e.cardId}' cannot be copied into this document.`
3304
3304
  );
3305
3305
  const i = t.dashboard.sheets || [], o = i.find(({ id: p }) => p === e.sheetId), a = i.find(({ id: p }) => p === t.sheetId), s = t.ids.card(), c = Ie({ ...r.card, id: s });
3306
- bn(c, /* @__PURE__ */ new Map([[e.cardId, s]]));
3306
+ vn(c, /* @__PURE__ */ new Map([[e.cardId, s]]));
3307
3307
  const l = /* @__PURE__ */ new Set();
3308
3308
  if (se(c, {
3309
3309
  oldCardId: e.cardId,
@@ -3313,7 +3313,7 @@ function Le(e, t, n) {
3313
3313
  onSheetField: (p) => l.add(p)
3314
3314
  }), e.sheetId === t.sheetId || l.size === 0)
3315
3315
  return { card: c };
3316
- const d = Do(o), u = /* @__PURE__ */ new Map(), f = [...l];
3316
+ const d = To(o), u = /* @__PURE__ */ new Map(), f = [...l];
3317
3317
  for (; f.length > 0; ) {
3318
3318
  const p = f.pop();
3319
3319
  if (u.has(p)) continue;
@@ -3338,7 +3338,7 @@ function Le(e, t, n) {
3338
3338
  });
3339
3339
  return m.length === 0 ? { card: c } : {
3340
3340
  card: c,
3341
- calculatedFields: X(a == null ? void 0 : a.calculatedFields, m)
3341
+ calculatedFields: Q(a == null ? void 0 : a.calculatedFields, m)
3342
3342
  };
3343
3343
  }
3344
3344
  function se(e, t) {
@@ -3350,13 +3350,13 @@ function se(e, t) {
3350
3350
  const n = e;
3351
3351
  typeof n.entityId == "string" && (n.fieldScope === "card" && n.entityId === t.oldCardId ? n.entityId = t.newCardId : n.fieldScope === "sheet" && n.entityId === t.sourceSheetId && (typeof n.id == "string" && t.onSheetField(qe(n.id) ?? n.id), n.entityId = t.targetSheetId)), Object.values(n).forEach((r) => se(r, t));
3352
3352
  }
3353
- function Ts(e, t) {
3353
+ function Ss(e, t) {
3354
3354
  const n = { ...Ie(e), id: t.section() }, r = new Map(
3355
3355
  st(n).map((i) => [i.id, t.card()])
3356
3356
  );
3357
3357
  return On(n, (i) => {
3358
3358
  const o = r.get(i.id), a = Ie({ ...i, id: o });
3359
- return bn(a, r), se(a, {
3359
+ return vn(a, r), se(a, {
3360
3360
  oldCardId: i.id,
3361
3361
  newCardId: o,
3362
3362
  sourceSheetId: "",
@@ -3366,17 +3366,17 @@ function Ts(e, t) {
3366
3366
  }), a;
3367
3367
  });
3368
3368
  }
3369
- function ws(e, t) {
3369
+ function xs(e, t) {
3370
3370
  return e.kind !== t.kind || e.sheetId !== t.sheetId || e.cardId !== t.cardId ? !1 : e.kind === "frameCard" && t.kind === "frameCard" ? e.frameId === t.frameId : e.kind === "documentSectionCard" && t.kind === "documentSectionCard" ? e.sectionId === t.sectionId : !0;
3371
3371
  }
3372
3372
  function tn(e, t) {
3373
- if (pa(e.dashboard, t))
3373
+ if (fa(e.dashboard, t))
3374
3374
  throw new D(
3375
3375
  `Card id '${t}' is already used by another card in this dashboard.`
3376
3376
  );
3377
3377
  }
3378
3378
  function Ve(e, t, n) {
3379
- const r = Qe(n, e.length);
3379
+ const r = Xe(n, e.length);
3380
3380
  return [...e.slice(0, r), t, ...e.slice(r)];
3381
3381
  }
3382
3382
  function K(e, t) {
@@ -3384,7 +3384,7 @@ function K(e, t) {
3384
3384
  (n) => n.id === t.id ? t : n
3385
3385
  );
3386
3386
  }
3387
- function Qe(e, t) {
3387
+ function Xe(e, t) {
3388
3388
  return Number.isFinite(e) ? Math.min(t, Math.max(0, Math.trunc(e))) : t;
3389
3389
  }
3390
3390
  function L(e, t) {
@@ -3400,56 +3400,56 @@ function H(e, t) {
3400
3400
  `'${e}' does not apply to a ${t.type} section.`
3401
3401
  );
3402
3402
  }
3403
- function Ds(e) {
3403
+ function Ts(e) {
3404
3404
  throw new D(
3405
3405
  `Unknown document edit '${e.type}'.`
3406
3406
  );
3407
3407
  }
3408
- const ks = {
3408
+ const ws = {
3409
3409
  section: () => {
3410
3410
  throw new F("document_invalid", "A text edit mints no section id.");
3411
3411
  },
3412
3412
  card: () => {
3413
3413
  throw new F("document_invalid", "A text edit mints no card id.");
3414
3414
  }
3415
- }, Os = { title: "title", metadata: "metadata", note: "note", pageInfo: "page info" };
3416
- function Ms(e, t) {
3415
+ }, Ds = { title: "title", metadata: "metadata", note: "note", pageInfo: "page info" };
3416
+ function ks(e, t) {
3417
3417
  const n = e.sheets ?? [], r = n.findIndex((d) => d.id === t.sheetId), i = n[r];
3418
3418
  if (!i) throw new F("sheet_not_found", `No sheet ${t.sheetId} on this dashboard.`, "Read the outline again and use its sheet ids.");
3419
3419
  if (!we(i) || !i.document)
3420
3420
  throw new F("document_invalid", `"${i.title ?? i.id}" is not a Document sheet.`, "Name a Document sheet; a grid sheet's words are its text cards.");
3421
3421
  let o;
3422
3422
  try {
3423
- o = xs(i.document, t.edit, { dashboard: e, sheetId: i.id, ids: ks }).document;
3423
+ o = Fs(i.document, t.edit, { dashboard: e, sheetId: i.id, ids: ws }).document;
3424
3424
  } catch (d) {
3425
3425
  throw d instanceof D ? new F("document_invalid", d.message, "Read the outline again and use its section ids and line roles.") : d;
3426
3426
  }
3427
- const a = { ...e, sheets: n.map((d, u) => u === r ? { ...d, document: o } : d) }, s = t.edit.type === "updateRegionText" ? `the ${Os[t.edit.role]} line of the ${w(i.title)} ${t.edit.region}` : `a text section of ${w(i.title)}`, c = [];
3427
+ const a = { ...e, sheets: n.map((d, u) => u === r ? { ...d, document: o } : d) }, s = t.edit.type === "updateRegionText" ? `the ${Ds[t.edit.role]} line of the ${w(i.title)} ${t.edit.region}` : `a text section of ${w(i.title)}`, c = [];
3428
3428
  if (t.edit.content !== void 0) {
3429
- const d = gi(t.edit.content, { inputs: a.inputs, variables: a.variables }), u = hi(d);
3430
- c.push(`sets ${s} to ${w(yi(d))}${u ? `, ${u}` : ""}`);
3429
+ const d = mi(t.edit.content, { inputs: a.inputs, variables: a.variables }), u = pi(d);
3430
+ c.push(`sets ${s} to ${w(gi(d))}${u ? `, ${u}` : ""}`);
3431
3431
  }
3432
- const l = As(t.edit.style);
3432
+ const l = _s(t.edit.style);
3433
3433
  return l && c.push(c.length ? `makes it ${l}` : `makes ${s} ${l}`), {
3434
3434
  dashboard: a,
3435
3435
  clauses: [T.plain("document", c.join(" and "))]
3436
3436
  };
3437
3437
  }
3438
- const _s = { left: "left-aligned", center: "centered", right: "right-aligned" };
3439
- function As(e) {
3438
+ const Os = { left: "left-aligned", center: "centered", right: "right-aligned" };
3439
+ function _s(e) {
3440
3440
  return [
3441
3441
  ...(e == null ? void 0 : e.fontSize) !== void 0 ? [`${e.fontSize}px`] : [],
3442
- ...(e == null ? void 0 : e.align) !== void 0 ? [_s[e.align]] : []
3442
+ ...(e == null ? void 0 : e.align) !== void 0 ? [Os[e.align]] : []
3443
3443
  ].join(" and ");
3444
3444
  }
3445
- function dl(e, t, n) {
3445
+ function cl(e, t, n) {
3446
3446
  let r = e;
3447
3447
  const i = [], o = [], a = [], s = [], c = [];
3448
3448
  let l = !1;
3449
3449
  for (const [u, f] of t.entries()) {
3450
3450
  let m;
3451
3451
  try {
3452
- m = Ns(r, f, n);
3452
+ m = As(r, f, n);
3453
3453
  } catch (p) {
3454
3454
  if (!(p instanceof F)) throw p;
3455
3455
  return {
@@ -3474,66 +3474,66 @@ function dl(e, t, n) {
3474
3474
  dashboard: r,
3475
3475
  created: i,
3476
3476
  touched: o.filter((u) => !d.has(u)),
3477
- queryFrames: [...Ps(r, i, o), ...s],
3478
- descriptions: $s(c),
3477
+ queryFrames: [...Ms(r, i, o), ...s],
3478
+ descriptions: Ps(c),
3479
3479
  runtimeEffects: a,
3480
3480
  detaches: l
3481
3481
  };
3482
3482
  }
3483
- function Ps(e, t, n) {
3483
+ function Ms(e, t, n) {
3484
3484
  const r = /* @__PURE__ */ new Set([...t.filter((i) => i.kind === "card").map((i) => i.id), ...n]);
3485
3485
  return (e.sheets ?? []).flatMap(
3486
3486
  (i) => (i.frames ?? []).filter((o) => (o.cards ?? []).some((a) => r.has(a.id)))
3487
3487
  );
3488
3488
  }
3489
- function Ns(e, t, n) {
3489
+ function As(e, t, n) {
3490
3490
  switch (t.op) {
3491
3491
  case "card.add":
3492
- return Ii(e, t);
3492
+ return bi(e, t);
3493
3493
  case "card.remove":
3494
- return vi(e, t.cardId);
3494
+ return yi(e, t.cardId);
3495
3495
  case "card.update":
3496
- return ne(bi(e, t.cardId, t.update), [t.cardId]);
3496
+ return ne(hi(e, t.cardId, t.update), [t.cardId]);
3497
3497
  case "layout.arrange":
3498
- return So(e, t);
3498
+ return Co(e, t);
3499
3499
  case "frame.commit":
3500
- return ne(Oo(e, t.commit), [t.commit.frame.activeCardId]);
3500
+ return ne(Do(e, t.commit), [t.commit.frame.activeCardId]);
3501
3501
  case "filter.add":
3502
- return Jo(e, t);
3502
+ return Xo(e, t, n);
3503
3503
  case "filter.update":
3504
- return Zo(e, t, n);
3504
+ return Qo(e, t, n);
3505
3505
  case "filter.remove":
3506
- return ts(e, t.filterId);
3506
+ return Zo(e, t.filterId);
3507
3507
  case "filter.bind":
3508
- return ne(is(e, t), [t.cardId]);
3508
+ return ne(ns(e, t), [t.cardId]);
3509
3509
  case "filter.exclude":
3510
- return ne(as(e, t), [t.cardId]);
3510
+ return ne(rs(e, t), [t.cardId]);
3511
3511
  case "dashboard.update":
3512
- return Mo(e, t);
3512
+ return ko(e, t);
3513
3513
  case "dashboard.style":
3514
- return _o(e, t);
3514
+ return Oo(e, t);
3515
3515
  case "sheet.add":
3516
- return Lo(e, t);
3516
+ return Ro(e, t);
3517
3517
  case "sheet.update":
3518
- return Vo(e, t);
3518
+ return Ko(e, t);
3519
3519
  case "layout.tabs":
3520
- return ne(Po(e, t), t.cardIds.slice(0, 1));
3520
+ return ne(Mo(e, t), t.cardIds.slice(0, 1));
3521
3521
  case "layout.untab":
3522
- return ne(No(e, t), [t.cardId]);
3522
+ return ne(Ao(e, t), [t.cardId]);
3523
3523
  case "variable.add":
3524
- return os(e, t);
3524
+ return is(e, t);
3525
3525
  case "variable.update":
3526
- return ss(e, t);
3526
+ return as(e, t);
3527
3527
  case "variable.remove":
3528
- return cs(e, t);
3528
+ return os(e, t);
3529
3529
  case "document.text":
3530
- return Ms(e, t);
3530
+ return ks(e, t);
3531
3531
  }
3532
3532
  }
3533
3533
  function ne(e, t) {
3534
3534
  return { ...e, touched: t.filter(Boolean) };
3535
3535
  }
3536
- function $s(e) {
3536
+ function Ps(e) {
3537
3537
  const t = [];
3538
3538
  for (const n of e) {
3539
3539
  const r = n.changeIndex === void 0 ? void 0 : t.find((i) => i.changeIndex === n.changeIndex);
@@ -3550,10 +3550,10 @@ function $s(e) {
3550
3550
  }
3551
3551
  return t.map(({ clauses: n, ...r }) => ({
3552
3552
  ...r,
3553
- sentence: Ci(Es(n))
3553
+ sentence: vi(Ns(n))
3554
3554
  }));
3555
3555
  }
3556
- function Es(e) {
3556
+ function Ns(e) {
3557
3557
  let t = !1;
3558
3558
  return e.filter((n) => n.kind !== "detached" ? !0 : t ? !1 : (t = !0, !0));
3559
3559
  }
@@ -3579,18 +3579,18 @@ function ce(e) {
3579
3579
  e.tableName
3580
3580
  ].join(":");
3581
3581
  }
3582
- function Rs(e, t) {
3582
+ function $s(e, t) {
3583
3583
  if (e.kind === "semantic")
3584
3584
  return {
3585
3585
  status: "ready",
3586
3586
  request: nn({
3587
3587
  connection_id: e.connectionId,
3588
3588
  domain_id: e.domainId,
3589
- dataset_id: Vi(e),
3589
+ dataset_id: Ki(e),
3590
3590
  dataset_name: e.datasetName
3591
3591
  })
3592
3592
  };
3593
- const n = Ca({
3593
+ const n = va({
3594
3594
  source: e,
3595
3595
  capabilities: t
3596
3596
  });
@@ -3611,14 +3611,14 @@ function Rs(e, t) {
3611
3611
  })
3612
3612
  };
3613
3613
  }
3614
- function ul(e, t = /* @__PURE__ */ new Map()) {
3614
+ function ll(e, t = /* @__PURE__ */ new Map()) {
3615
3615
  const n = /* @__PURE__ */ new Map();
3616
3616
  for (const { card: r } of e) {
3617
3617
  const i = tt(r), o = i.kind === "config" ? i.executableSources : i.kind === "sql" ? i.pinnedCatalogSources.map((a) => a.source) : [];
3618
3618
  for (const a of o) {
3619
3619
  const s = ce(a);
3620
3620
  if (!n.has(s)) {
3621
- const c = Rs(
3621
+ const c = $s(
3622
3622
  a,
3623
3623
  a.connectionId ? t.get(a.connectionId) : void 0
3624
3624
  );
@@ -3632,7 +3632,7 @@ function ul(e, t = /* @__PURE__ */ new Map()) {
3632
3632
  }
3633
3633
  return Array.from(n.values());
3634
3634
  }
3635
- function Ks(e, t) {
3635
+ function Es(e, t) {
3636
3636
  if (e.kind !== "semantic" || !e.connectionId) return;
3637
3637
  const n = (t.qualifiedEntityName || "").split(".").map((i) => i.trim()).filter(Boolean), r = n.at(-1);
3638
3638
  if (r)
@@ -3651,7 +3651,7 @@ function be(e, t) {
3651
3651
  function ur(e, t) {
3652
3652
  e.sourceLabel === void 0 ? e.sourceLabel = t : e.sourceLabel !== t && (e.sourceLabelConflict = !0);
3653
3653
  }
3654
- function Xe(e, t, n) {
3654
+ function Qe(e, t, n) {
3655
3655
  for (const r of t) {
3656
3656
  const i = r == null ? void 0 : r.trim();
3657
3657
  if (!i) continue;
@@ -3662,29 +3662,29 @@ function Xe(e, t, n) {
3662
3662
  function fr(e, t) {
3663
3663
  t.sourceLabel && ur(e, t.sourceLabel), t.sourceLabelConflict && (e.sourceLabelConflict = !0);
3664
3664
  for (const [n, r] of t.fields)
3665
- Xe(e, [n], r);
3665
+ Qe(e, [n], r);
3666
3666
  for (const n of t.fieldConflicts ?? [])
3667
3667
  e.fieldConflicts.add(n);
3668
3668
  }
3669
3669
  function mr(e) {
3670
3670
  return e.kind === "semantic" && (e.label || e.datasetName || "").trim() || void 0;
3671
3671
  }
3672
- function fl(e, t) {
3672
+ function dl(e, t) {
3673
3673
  var r, i;
3674
3674
  const n = /* @__PURE__ */ new Map();
3675
3675
  for (const [o, a] of e) {
3676
3676
  if (a.status !== "ready") continue;
3677
3677
  const s = t == null ? void 0 : t.get(o), c = s ? mr(s) : void 0;
3678
3678
  for (const l of a.columns) {
3679
- const d = (r = l.column_name) == null ? void 0 : r.trim(), u = (i = l.label) == null ? void 0 : i.trim(), f = s ? Ks(s, l) : void 0;
3679
+ const d = (r = l.column_name) == null ? void 0 : r.trim(), u = (i = l.label) == null ? void 0 : i.trim(), f = s ? Es(s, l) : void 0;
3680
3680
  f && c && ur(
3681
3681
  be(n, ce(f)),
3682
3682
  c
3683
- ), !(!d || !u || u === d) && (Xe(
3683
+ ), !(!d || !u || u === d) && (Qe(
3684
3684
  be(n, o),
3685
3685
  [d, l.sourceField],
3686
3686
  u
3687
- ), f && Xe(
3687
+ ), f && Qe(
3688
3688
  be(n, ce(f)),
3689
3689
  [l.sourceField, d],
3690
3690
  u
@@ -3693,7 +3693,7 @@ function fl(e, t) {
3693
3693
  }
3694
3694
  return n;
3695
3695
  }
3696
- function ml(...e) {
3696
+ function ul(...e) {
3697
3697
  const t = /* @__PURE__ */ new Map();
3698
3698
  for (const n of e)
3699
3699
  for (const [r, i] of n ?? [])
@@ -3703,7 +3703,7 @@ function ml(...e) {
3703
3703
  function ht(e) {
3704
3704
  return [e.databaseName, e.schemaName, e.tableName].filter(Boolean).join(".");
3705
3705
  }
3706
- function Ls(e) {
3706
+ function Rs(e) {
3707
3707
  return e.split(":").slice(2).filter(Boolean).join(".");
3708
3708
  }
3709
3709
  function pr(e, t) {
@@ -3715,32 +3715,32 @@ function pr(e, t) {
3715
3715
  };
3716
3716
  let s = !1;
3717
3717
  for (const [c, l] of e)
3718
- c.startsWith(i) && (c !== n && !Fa(o, Ls(c)) || (fr(a, l), s = !0));
3718
+ c.startsWith(i) && (c !== n && !Ia(o, Rs(c)) || (fr(a, l), s = !0));
3719
3719
  return s ? a : void 0;
3720
3720
  }
3721
- function Vs(e, t) {
3721
+ function Ks(e, t) {
3722
3722
  var i;
3723
3723
  if (!e) return;
3724
3724
  const n = Sn(t.name), r = pr(e, t.source);
3725
3725
  return r && !((i = r.fieldConflicts) != null && i.has(n)) ? r.fields.get(n) : void 0;
3726
3726
  }
3727
- function Bs(e, t) {
3727
+ function Ls(e, t) {
3728
3728
  if (t.kind === "semantic")
3729
3729
  return mr(t) || t.datasetId || "Dataset";
3730
3730
  const n = e ? pr(e, t) : void 0;
3731
3731
  return n != null && n.sourceLabel && !n.sourceLabelConflict ? n.sourceLabel : ht(t);
3732
3732
  }
3733
- function pl(e, t) {
3734
- const n = Vs(e, t);
3733
+ function fl(e, t) {
3734
+ const n = Ks(e, t);
3735
3735
  return {
3736
3736
  name: t.name,
3737
3737
  ...n ? { label: n } : {},
3738
- entityName: Bs(e, t.source),
3738
+ entityName: Ls(e, t.source),
3739
3739
  ...t.source.kind === "physical" ? { qualifiedEntityName: ht(t.source) } : {},
3740
3740
  dataType: t.dataType
3741
3741
  };
3742
3742
  }
3743
- function qs(e, t) {
3743
+ function Vs(e, t) {
3744
3744
  var i, o;
3745
3745
  const n = (i = t.column_name) == null ? void 0 : i.trim(), r = le(t.data_type);
3746
3746
  if (!(!n || r === "unknown"))
@@ -3754,7 +3754,7 @@ function qs(e, t) {
3754
3754
  }
3755
3755
  };
3756
3756
  }
3757
- function gl(e) {
3757
+ function ml(e) {
3758
3758
  const t = {};
3759
3759
  for (const { card: n } of e.cards) {
3760
3760
  const r = tt(n), i = r.kind === "config" ? r.executableSources : r.kind === "sql" ? r.pinnedCatalogSources.map((s) => s.source) : [];
@@ -3770,7 +3770,7 @@ function gl(e) {
3770
3770
  break;
3771
3771
  }
3772
3772
  for (const l of c.columns) {
3773
- const d = qs(s, l);
3773
+ const d = Vs(s, l);
3774
3774
  d && o.push(d);
3775
3775
  }
3776
3776
  }
@@ -3778,12 +3778,12 @@ function gl(e) {
3778
3778
  }
3779
3779
  return t;
3780
3780
  }
3781
- function hl(e) {
3781
+ function pl(e) {
3782
3782
  const { dashboard: t, target: n, calendar: r } = e, i = hr(n), o = gr(t, n, r);
3783
3783
  return {
3784
3784
  value: o,
3785
- mode: Nr(
3786
- $r(o == null ? void 0 : o.operation) ? o.operation : i.operation
3785
+ mode: Ar(
3786
+ Pr(o == null ? void 0 : o.operation) ? o.operation : i.operation
3787
3787
  )
3788
3788
  };
3789
3789
  }
@@ -3791,7 +3791,7 @@ function gr(e, t, n) {
3791
3791
  var r;
3792
3792
  switch (t.kind) {
3793
3793
  case "dashboardInput": {
3794
- const i = Si({
3794
+ const i = Ci({
3795
3795
  dashboard: e,
3796
3796
  input: t.input,
3797
3797
  target: t.scope,
@@ -3803,7 +3803,7 @@ function gr(e, t, n) {
3803
3803
  const i = (r = e.defaultFilterValues) == null ? void 0 : r.find(
3804
3804
  (o) => o.filterId === t.filter.id
3805
3805
  );
3806
- return i ? Fi({
3806
+ return i ? Ii({
3807
3807
  filterDefinitions: [t.filter],
3808
3808
  filterValues: [i]
3809
3809
  })[0] : ie(t.filter, n);
@@ -3815,13 +3815,13 @@ function gr(e, t, n) {
3815
3815
  function hr(e) {
3816
3816
  return e.kind === "dashboardInput" ? e.input.filter : e.filter;
3817
3817
  }
3818
- function yl(e) {
3818
+ function gl(e) {
3819
3819
  var o;
3820
3820
  const { dashboard: t, filter: n, input: r, scope: i } = e;
3821
- return r && (t.inputs || []).some((a) => a.id === r.id) ? { kind: "dashboardInput", input: r, scope: i } : ((o = Q(t).findFilterInput({ filterId: n.id })) == null ? void 0 : o.origin) === "toolbarFilter" ? { kind: "dashboardFilter", filter: n } : { kind: "definition", filter: n };
3821
+ return r && (t.inputs || []).some((a) => a.id === r.id) ? { kind: "dashboardInput", input: r, scope: i } : ((o = X(t).findFilterInput({ filterId: n.id })) == null ? void 0 : o.origin) === "toolbarFilter" ? { kind: "dashboardFilter", filter: n } : { kind: "definition", filter: n };
3822
3822
  }
3823
- function bl(e) {
3824
- const { dashboard: t, target: n, calendar: r } = e, i = hr(n), o = xi(i), a = Us(t, n);
3823
+ function hl(e) {
3824
+ const { dashboard: t, target: n, calendar: r } = e, i = hr(n), o = Fi(i), a = Bs(t, n);
3825
3825
  if (!a) return o;
3826
3826
  if (a === "cleared")
3827
3827
  return {
@@ -3830,12 +3830,12 @@ function bl(e) {
3830
3830
  defaultDateFilter: void 0
3831
3831
  };
3832
3832
  const s = gr(t, n, r);
3833
- if (!s || zs(s, ie(i, r)))
3833
+ if (!s || qs(s, ie(i, r)))
3834
3834
  return o;
3835
3835
  if (s.valueType === "date") {
3836
- const c = Fn(
3836
+ const c = Li(
3837
3837
  "relativeMeta" in s ? s.relativeMeta : void 0
3838
- ) ?? js(i, s, r);
3838
+ ) ?? Us(i, s, r);
3839
3839
  return c ? {
3840
3840
  operation: s.operation,
3841
3841
  defaultValues: i.defaultValues,
@@ -3848,7 +3848,7 @@ function bl(e) {
3848
3848
  defaultDateFilter: i.defaultDateFilter
3849
3849
  };
3850
3850
  }
3851
- function Us(e, t) {
3851
+ function Bs(e, t) {
3852
3852
  var n;
3853
3853
  if (t.kind === "dashboardInput") {
3854
3854
  const r = it(
@@ -3863,7 +3863,7 @@ function Us(e, t) {
3863
3863
  (r) => r.filterId === t.filter.id
3864
3864
  ) ? "set" : void 0;
3865
3865
  }
3866
- function zs(e, t) {
3866
+ function qs(e, t) {
3867
3867
  return !!(t && e.operation === t.operation && Ue(rn(e), rn(t)) && Ue(
3868
3868
  "relativeMeta" in e ? e.relativeMeta : void 0,
3869
3869
  "relativeMeta" in t ? t.relativeMeta : void 0
@@ -3874,8 +3874,8 @@ function rn(e) {
3874
3874
  (t) => t instanceof Date ? t.getTime() : t
3875
3875
  );
3876
3876
  }
3877
- function js(e, t, n) {
3878
- const r = Ti(n == null ? void 0 : n.tz), i = Ne(t.values[0], r);
3877
+ function Us(e, t, n) {
3878
+ const r = Si(n == null ? void 0 : n.tz), i = Ne(t.values[0], r);
3879
3879
  if (!i) return;
3880
3880
  const [o, a, s] = new Intl.DateTimeFormat("en-CA", {
3881
3881
  timeZone: r,
@@ -3912,17 +3912,17 @@ function js(e, t, n) {
3912
3912
  });
3913
3913
  }
3914
3914
  function an(e) {
3915
- return Sa(void 0, e ?? "");
3915
+ return Ca(void 0, e ?? "");
3916
3916
  }
3917
- const Gs = {
3917
+ const zs = {
3918
3918
  type: "temporal_bucket",
3919
3919
  presentation: { mode: "pattern", pattern: "YYYY-MM-DD" }
3920
3920
  };
3921
- function Ws(e) {
3921
+ function js(e) {
3922
3922
  const t = le(e.dataType);
3923
3923
  if (!["date", "datetime"].includes(t))
3924
3924
  return e;
3925
- const n = e.granularity !== void 0 || e.format !== void 0, r = wi({
3925
+ const n = e.granularity !== void 0 || e.format !== void 0, r = xi({
3926
3926
  fieldId: e.id,
3927
3927
  dataType: e.dataType,
3928
3928
  granularity: e.granularity,
@@ -3931,20 +3931,20 @@ function Ws(e) {
3931
3931
  });
3932
3932
  if (!r.ok)
3933
3933
  return e;
3934
- const i = n ? r.selection.format : Gs;
3934
+ const i = n ? r.selection.format : zs;
3935
3935
  return {
3936
3936
  ...e,
3937
3937
  granularity: r.granularity,
3938
3938
  format: i
3939
3939
  };
3940
3940
  }
3941
- function vl(e, t) {
3941
+ function yl(e, t) {
3942
3942
  var r, i;
3943
3943
  const n = ((i = (r = globalThis.crypto) == null ? void 0 : r.randomUUID) == null ? void 0 : i.call(r).slice(0, 8)) ?? Math.random().toString(36).slice(2, 10);
3944
3944
  return `${e}-${t.qualifiedEntityName}-${t.name}-${Date.now()}-${n}`;
3945
3945
  }
3946
- function Hs(e, t) {
3947
- const n = vn(e.replace(/_/g, " "));
3946
+ function Gs(e, t) {
3947
+ const n = In(e.replace(/_/g, " "));
3948
3948
  switch (t) {
3949
3949
  case "SUM":
3950
3950
  return `Sum of ${n}`;
@@ -3962,15 +3962,15 @@ function Hs(e, t) {
3962
3962
  return n;
3963
3963
  }
3964
3964
  }
3965
- function Il(e, t, n) {
3965
+ function bl(e, t, n) {
3966
3966
  var i;
3967
- const r = In(e.dataType);
3967
+ const r = Cn(e.dataType);
3968
3968
  return n === "detailTable" ? "detailColumns" : n === "matrixTable" ? ((i = e.derivedField) == null ? void 0 : i.computeStage) === "aggregate" || le(e.dataType) === "number" ? "metrics" : "groupBy" : n === "kpi" ? r === "date" ? "groupBy" : "metrics" : t.length === 0 || r === "number" ? "metrics" : r === "date" || r === "string" || r === "boolean" ? "groupBy" : "metrics";
3969
3969
  }
3970
- function Cl(e, t, n, r) {
3971
- const i = In(e.dataType), o = i === "date";
3972
- e = Bi(e);
3973
- const a = qi(e), s = a.representation !== "physical", c = a.computeStage, l = s ? e.fieldScope === "domain" ? e.calculatedFieldOrigin : e.calculatedFieldOrigin || {
3970
+ function vl(e, t, n, r) {
3971
+ const i = Cn(e.dataType), o = i === "date";
3972
+ e = Vi(e);
3973
+ const a = Bi(e), s = a.representation !== "physical", c = a.computeStage, l = s ? e.fieldScope === "domain" ? e.calculatedFieldOrigin : e.calculatedFieldOrigin || {
3974
3974
  id: e.id,
3975
3975
  role: e.role
3976
3976
  } : void 0;
@@ -4030,7 +4030,7 @@ function Cl(e, t, n, r) {
4030
4030
  semanticComparisonPolarity: h.semanticComparisonPolarity
4031
4031
  }, v = e.expression || "";
4032
4032
  if (!a.legacyManual && c !== "aggregate") {
4033
- const b = !C.aggregate && (c === "row" || Ui(v).calls.length === 0), S = an(i);
4033
+ const b = !C.aggregate && (c === "row" || qi(v).calls.length === 0), S = an(i);
4034
4034
  return {
4035
4035
  ...C,
4036
4036
  id: r,
@@ -4046,10 +4046,10 @@ function Cl(e, t, n, r) {
4046
4046
  role: "metric"
4047
4047
  };
4048
4048
  }
4049
- const p = e.aggregate || an(i), y = Hs(
4049
+ const p = e.aggregate || an(i), y = Gs(
4050
4050
  e.label,
4051
4051
  p
4052
- ), g = ki(
4052
+ ), g = wi(
4053
4053
  { ...m, label: y },
4054
4054
  n,
4055
4055
  t
@@ -4065,7 +4065,7 @@ function Cl(e, t, n, r) {
4065
4065
  if (t === "groupBy") {
4066
4066
  if (u) {
4067
4067
  const p = e;
4068
- return Ws({
4068
+ return js({
4069
4069
  ...m,
4070
4070
  label: e.label || e.name,
4071
4071
  role: "groupby",
@@ -4096,7 +4096,7 @@ function Cl(e, t, n, r) {
4096
4096
  }
4097
4097
  };
4098
4098
  if (t === "detailColumns") {
4099
- const p = Oi(m, "detail");
4099
+ const p = Di(m, "detail");
4100
4100
  if (d) {
4101
4101
  const y = e;
4102
4102
  return {
@@ -4125,14 +4125,14 @@ function Cl(e, t, n, r) {
4125
4125
  direction: "asc"
4126
4126
  } : null;
4127
4127
  }
4128
- function Fl(e) {
4129
- return Object.values(Di(e)).some((t) => t.length > 0);
4128
+ function Il(e) {
4129
+ return Object.values(Ti(e)).some((t) => t.length > 0);
4130
4130
  }
4131
- function Ys(e) {
4131
+ function Ws(e) {
4132
4132
  const t = J(e.format);
4133
4133
  if ((t == null ? void 0 : t.type) === "temporal_bucket") {
4134
4134
  if (!e.granularity) return {};
4135
- const n = ia(
4135
+ const n = na(
4136
4136
  t,
4137
4137
  e.granularity
4138
4138
  );
@@ -4149,7 +4149,7 @@ function Ys(e) {
4149
4149
  ...t ? { format: t } : {}
4150
4150
  };
4151
4151
  }
4152
- function Qs(e, t) {
4152
+ function Hs(e, t) {
4153
4153
  var i, o;
4154
4154
  const n = ((i = e.nativeDataType) == null ? void 0 : i.trim()) || ((o = e.native_data_type) == null ? void 0 : o.trim());
4155
4155
  return n || ((e.dataTypeProvenance || t) === "physical" ? e.data_type : void 0);
@@ -4164,7 +4164,7 @@ function yt(e) {
4164
4164
  function on(e) {
4165
4165
  return yt(e).toLowerCase().trim();
4166
4166
  }
4167
- function Xs(e, t) {
4167
+ function Ys(e, t) {
4168
4168
  return on(e).localeCompare(on(t), void 0, {
4169
4169
  numeric: !0,
4170
4170
  sensitivity: "base"
@@ -4173,7 +4173,7 @@ function Xs(e, t) {
4173
4173
  function oe(e) {
4174
4174
  return String(e ?? "").toLowerCase().replace(/[\s_\-.]+/g, "");
4175
4175
  }
4176
- function Sl(e, t) {
4176
+ function Cl(e, t) {
4177
4177
  const n = oe(t);
4178
4178
  return n ? [
4179
4179
  yt(e),
@@ -4194,10 +4194,10 @@ function sn(e, t) {
4194
4194
  const r = oe(yt(e));
4195
4195
  return r.startsWith(n) ? 0 : r.includes(n) ? 1 : [e.label, e.name].filter(Boolean).map(oe).some((o) => o.includes(n)) ? 2 : 3;
4196
4196
  }
4197
- function xl(e, t, n) {
4198
- return sn(e, n) - sn(t, n) || Xs(e, t);
4197
+ function Fl(e, t, n) {
4198
+ return sn(e, n) - sn(t, n) || Ys(e, t);
4199
4199
  }
4200
- function Js(e, t) {
4200
+ function Xs(e, t) {
4201
4201
  var o;
4202
4202
  const n = e.type === "dataset" ? (o = t.find((a) => a.entityName)) == null ? void 0 : o.entityName : void 0, r = n || e.name, i = $t(
4203
4203
  e.type === "dataset" && n ? { ...e, name: n } : e
@@ -4211,12 +4211,12 @@ function Js(e, t) {
4211
4211
  qualifiedEntityName: i,
4212
4212
  columns: t.map((a) => {
4213
4213
  var m;
4214
- const s = e.type === "dataset" ? a.entityName || r : e.name, c = a.qualifiedEntityName || (e.type === "dataset" && s ? $t({ ...e, name: s }) : i), l = Qs(
4214
+ const s = e.type === "dataset" ? a.entityName || r : e.name, c = a.qualifiedEntityName || (e.type === "dataset" && s ? $t({ ...e, name: s }) : i), l = Hs(
4215
4215
  a,
4216
4216
  e.type === "dataset" ? "semantic" : "physical"
4217
4217
  ), d = (m = a.label) != null && m.trim() ? a.label : void 0, u = d ? void 0 : nt(a.column_name);
4218
4218
  return {
4219
- id: Mi(s, a.column_name),
4219
+ id: ki(s, a.column_name),
4220
4220
  name: a.column_name,
4221
4221
  qualifiedFieldName: a.qualifiedFieldName || a.column_name,
4222
4222
  dataType: a.data_type,
@@ -4240,23 +4240,23 @@ function Js(e, t) {
4240
4240
  aggregateOrigin: a.aggregateOrigin,
4241
4241
  labelOrigin: a.labelOrigin,
4242
4242
  formatOrigin: a.formatOrigin,
4243
- ...Ys(a),
4243
+ ...Ws(a),
4244
4244
  aggregate: a.aggregate
4245
4245
  };
4246
4246
  })
4247
4247
  };
4248
4248
  }
4249
- function Zs(e) {
4249
+ function Qs(e) {
4250
4250
  return e.map((t) => ({
4251
4251
  ...t,
4252
- id: Cn({ ...t }),
4252
+ id: Fn({ ...t }),
4253
4253
  fieldScope: "domain"
4254
4254
  }));
4255
4255
  }
4256
- function ec(e) {
4256
+ function Js(e) {
4257
4257
  return e.flatMap(
4258
4258
  (t) => t.columns.map((n) => {
4259
- const r = yr(n) ? n.label : void 0, i = r ? void 0 : n.derivedLabel ?? vn(n.name), o = r ?? i ?? n.name;
4259
+ const r = yr(n) ? n.label : void 0, i = r ? void 0 : n.derivedLabel ?? In(n.name), o = r ?? i ?? n.name;
4260
4260
  return {
4261
4261
  ...n,
4262
4262
  id: n.id || `${t.entityId}-${n.name}`,
@@ -4274,18 +4274,18 @@ function ec(e) {
4274
4274
  })
4275
4275
  );
4276
4276
  }
4277
- function Tl(e) {
4278
- const t = e.map((r) => Js(r.target, r.columns || [])).filter((r) => {
4277
+ function Sl(e) {
4278
+ const t = e.map((r) => Xs(r.target, r.columns || [])).filter((r) => {
4279
4279
  var i;
4280
4280
  return ((i = r == null ? void 0 : r.columns) == null ? void 0 : i.length) > 0;
4281
- }), n = Zs(e.flatMap((r) => r.calculatedFields || []));
4281
+ }), n = Qs(e.flatMap((r) => r.calculatedFields || []));
4282
4282
  if (n.length > 0) {
4283
4283
  const r = /* @__PURE__ */ new Map();
4284
4284
  n.forEach((i) => {
4285
- const o = Cn(i);
4285
+ const o = Fn(i);
4286
4286
  r.has(o) || r.set(o, i);
4287
4287
  }), t.unshift({
4288
- entityId: _i,
4288
+ entityId: Oi,
4289
4289
  entityType: "dataset",
4290
4290
  entityName: Et,
4291
4291
  label: "Calculated Fields",
@@ -4294,9 +4294,9 @@ function Tl(e) {
4294
4294
  columns: Array.from(r.values())
4295
4295
  });
4296
4296
  }
4297
- return { columnGroups: t, columns: ec(t) };
4297
+ return { columnGroups: t, columns: Js(t) };
4298
4298
  }
4299
- function tc(e, t) {
4299
+ function Zs(e, t) {
4300
4300
  var i;
4301
4301
  const n = (i = t.columnKeyMap) == null ? void 0 : i.byRole;
4302
4302
  if (!n) return;
@@ -4307,7 +4307,7 @@ function tc(e, t) {
4307
4307
  if (r.length === 1)
4308
4308
  return r[0].outputKey ?? r[0].rawKey;
4309
4309
  }
4310
- function nc(e, t) {
4310
+ function ec(e, t) {
4311
4311
  var r;
4312
4312
  const n = (r = t.resultColumns) == null ? void 0 : r.find((i) => {
4313
4313
  const o = i.pivotIdentity;
@@ -4321,9 +4321,9 @@ function cn(e, t) {
4321
4321
  var n;
4322
4322
  switch (e.kind) {
4323
4323
  case "field":
4324
- return tc(e.fieldId, t);
4324
+ return Zs(e.fieldId, t);
4325
4325
  case "pivot":
4326
- return nc(e, t);
4326
+ return ec(e, t);
4327
4327
  case "result":
4328
4328
  return !t.keys || t.keys.includes(e.key) ? e.key : void 0;
4329
4329
  case "sqlKpiValue":
@@ -4334,7 +4334,7 @@ function cn(e, t) {
4334
4334
  return;
4335
4335
  }
4336
4336
  }
4337
- function wl(e, t) {
4337
+ function xl(e, t) {
4338
4338
  return e.flatMap((n) => {
4339
4339
  var s, c;
4340
4340
  const r = cn(n.condition.column, t);
@@ -4354,9 +4354,9 @@ function wl(e, t) {
4354
4354
  ];
4355
4355
  });
4356
4356
  }
4357
- function Dl(e, t, n) {
4357
+ function Tl(e, t, n) {
4358
4358
  var a, s, c, l, d;
4359
- const r = Ai(e);
4359
+ const r = _i(e);
4360
4360
  if (r.includes("matrixMeasure"))
4361
4361
  return (s = (a = e.config) == null ? void 0 : a.matrix) != null && s.spec.measures.some((u) => u.id === t) ? { kind: "matrixMeasure", measureId: t } : void 0;
4362
4362
  if (r.includes("sqlKpiValue")) return { kind: "sqlKpiValue" };
@@ -4377,7 +4377,7 @@ function Dl(e, t, n) {
4377
4377
  );
4378
4378
  return o.length === 1 ? { kind: "field", fieldId: o[0] } : void 0;
4379
4379
  }
4380
- function kl(e, t) {
4380
+ function wl(e, t) {
4381
4381
  var i, o;
4382
4382
  const n = (i = t == null ? void 0 : t.find(
4383
4383
  (a) => a.filterId === e.id
@@ -4387,11 +4387,11 @@ function kl(e, t) {
4387
4387
  ]);
4388
4388
  return n && r.has(n) ? n : e.column;
4389
4389
  }
4390
- function Ol(e, t, n) {
4391
- const r = Pi({ card: e, stated: t, context: n });
4392
- return r.ok ? { ok: !0, card: r.update ? Ni(e, r.update).card : e, warnings: r.warnings } : r;
4390
+ function Dl(e, t, n) {
4391
+ const r = Mi({ card: e, stated: t, context: n });
4392
+ return r.ok ? { ok: !0, card: r.update ? Ai(e, r.update).card : e, warnings: r.warnings } : r;
4393
4393
  }
4394
- function Ml({
4394
+ function kl({
4395
4395
  resolvedCardConfig: e,
4396
4396
  card: t,
4397
4397
  row: n,
@@ -4417,14 +4417,14 @@ function Ml({
4417
4417
  value: String(v),
4418
4418
  // Convert to string for consistency
4419
4419
  ...I ? {
4420
- label: Ei({
4420
+ label: Ni({
4421
4421
  value: String(v),
4422
4422
  presentation: I
4423
4423
  }),
4424
4424
  temporalBucket: I.metadata
4425
4425
  } : {},
4426
4426
  ...b ? {
4427
- label: $i({ value: String(v), presentation: b }).label,
4427
+ label: Pi({ value: String(v), presentation: b }).label,
4428
4428
  rawTemporal: { ...b.metadata, tz: b.format.calendarTimezone }
4429
4429
  } : {}
4430
4430
  });
@@ -4449,7 +4449,7 @@ function Ml({
4449
4449
  metrics: y.length > 0 ? y : void 0
4450
4450
  };
4451
4451
  }
4452
- function _l({
4452
+ function Ol({
4453
4453
  resolvedCardConfig: e,
4454
4454
  card: t,
4455
4455
  columnId: n,
@@ -4461,7 +4461,7 @@ function _l({
4461
4461
  return ((l == null ? void 0 : l.outputKey) || (l == null ? void 0 : l.rawKey) || c.label) === n;
4462
4462
  });
4463
4463
  }
4464
- const rc = {
4464
+ const tc = {
4465
4465
  noFields: "There is nothing to filter by here.",
4466
4466
  clickedColumnNotFilterable: "This column cannot filter other cards.",
4467
4467
  noChosenColumns: "This column is not set up to filter other cards.",
@@ -4469,9 +4469,9 @@ const rc = {
4469
4469
  unsupportedCondition: "This value cannot filter other cards."
4470
4470
  };
4471
4471
  function Be(e) {
4472
- return { status: "unavailable", code: e, reason: rc[e] };
4472
+ return { status: "unavailable", code: e, reason: tc[e] };
4473
4473
  }
4474
- function Al(e) {
4474
+ function _l(e) {
4475
4475
  const t = e.conditions.filter(
4476
4476
  (s) => s.field.role !== "metric"
4477
4477
  );
@@ -4517,11 +4517,11 @@ function Al(e) {
4517
4517
  return o.has(c) ? !1 : (o.add(c), !0);
4518
4518
  }) } };
4519
4519
  }
4520
- function Pl(e, t) {
4520
+ function Ml(e, t) {
4521
4521
  const n = e.answers.relationshipIds;
4522
4522
  return !n || !t ? !n && !t : n.length === t.length && n.every((r, i) => t[i] === r);
4523
4523
  }
4524
- const ic = /* @__PURE__ */ new Set([
4524
+ const nc = /* @__PURE__ */ new Set([
4525
4525
  "dataset_not_reachable",
4526
4526
  "field_not_resolvable",
4527
4527
  "missing_metadata",
@@ -4533,15 +4533,15 @@ const ic = /* @__PURE__ */ new Set([
4533
4533
  function j(e) {
4534
4534
  return !!e && typeof e == "object" && !Array.isArray(e);
4535
4535
  }
4536
- function ac(e) {
4536
+ function rc(e) {
4537
4537
  if (j(e))
4538
4538
  switch (e.status) {
4539
4539
  case "applied": {
4540
- const t = Mn(e.route);
4540
+ const t = _n(e.route);
4541
4541
  return t ? { status: "applied", route: t } : void 0;
4542
4542
  }
4543
4543
  case "skipped":
4544
- return typeof e.reason == "string" && ic.has(e.reason) ? { status: "skipped", reason: e.reason } : void 0;
4544
+ return typeof e.reason == "string" && nc.has(e.reason) ? { status: "skipped", reason: e.reason } : void 0;
4545
4545
  case "needsPath":
4546
4546
  return { status: "needsPath" };
4547
4547
  case "blocked":
@@ -4558,18 +4558,18 @@ function br(e) {
4558
4558
  if (e !== void 0)
4559
4559
  return Array.isArray(e) && e.length > 0 && e.every((t) => typeof t == "string" && t.length > 0) ? e : null;
4560
4560
  }
4561
- function oc(e) {
4561
+ function ic(e) {
4562
4562
  if (!j(e)) return;
4563
- const t = Mn(e.route), n = e.target;
4563
+ const t = _n(e.route), n = e.target;
4564
4564
  if (!(!t || !j(n) || n.kind !== "relationship" || !j(n.field) || typeof n.field.name != "string" || !j(n.field.source) || n.field.source.kind !== "semantic" || !br(n.relationshipIds)))
4565
4565
  return { route: t, target: n };
4566
4566
  }
4567
- function Nl(e) {
4567
+ function Al(e) {
4568
4568
  if (!j(e) || !Array.isArray(e.previews)) return { previews: [] };
4569
4569
  const t = [];
4570
4570
  for (const r of e.previews) {
4571
4571
  if (!j(r) || typeof r.cardId != "string" || !r.cardId || !j(r.answers)) continue;
4572
- const i = br(r.answers.relationshipIds), o = ac(r.outcome), a = Array.isArray(r.paths) ? r.paths.map(oc) : [];
4572
+ const i = br(r.answers.relationshipIds), o = rc(r.outcome), a = Array.isArray(r.paths) ? r.paths.map(ic) : [];
4573
4573
  i === null || !o || !a.every(Boolean) || o.status === "needsPath" && a.length < 2 || t.push({
4574
4574
  cardId: r.cardId,
4575
4575
  answers: i ? { relationshipIds: i } : {},
@@ -4581,18 +4581,18 @@ function Nl(e) {
4581
4581
  return { previews: t, ...n ? { manageRelationships: n } : {} };
4582
4582
  }
4583
4583
  const ve = (e) => (e == null ? void 0 : e.label) || (e == null ? void 0 : e.name) || "";
4584
- function sc(e) {
4584
+ function ac(e) {
4585
4585
  return !e || /s$/i.test(e) ? e : /[^aeiou]y$/i.test(e) ? `${e.slice(0, -1)}ies` : `${e}s`;
4586
4586
  }
4587
- function $l(e) {
4587
+ function Pl(e) {
4588
4588
  if (e.direction === "to_many") {
4589
4589
  const n = ve(e.matchingDataset ?? e.datasets[e.datasets.length - 1]);
4590
- return `${e.base ? sc(ve(e.base)) : "Rows"} with at least one matching ${n}`;
4590
+ return `${e.base ? ac(ve(e.base)) : "Rows"} with at least one matching ${n}`;
4591
4591
  }
4592
4592
  return `through ${(e.datasets.length > 1 ? e.datasets.slice(0, -1) : e.datasets).map(ve).join(", ")}`;
4593
4593
  }
4594
- const El = "The relationship this card used changed; choose it again";
4595
- function Rl(e, t) {
4594
+ const Nl = "The relationship this card used changed; choose it again";
4595
+ function $l(e, t) {
4596
4596
  switch (e) {
4597
4597
  case "relationship_missing":
4598
4598
  return t ? `Not related to ${ve(t)}` : "Not related to this card";
@@ -4610,145 +4610,145 @@ function Rl(e, t) {
4610
4610
  }
4611
4611
  }
4612
4612
  export {
4613
- ko as $,
4614
- vo as A,
4615
- Js as B,
4616
- Zs as C,
4617
- bs as D,
4618
- ec as E,
4619
- Tl as F,
4613
+ wo as $,
4614
+ yo as A,
4615
+ Xs as B,
4616
+ Qs as C,
4617
+ hs as D,
4618
+ Js as E,
4619
+ Sl as F,
4620
4620
  cn as G,
4621
- wl as H,
4622
- Dl as I,
4623
- Ol as J,
4624
- Pl as K,
4625
- Nl as L,
4626
- sc as M,
4627
- fo as N,
4628
- $l as O,
4629
- Rl as P,
4630
- go as Q,
4631
- El as R,
4621
+ xl as H,
4622
+ Tl as I,
4623
+ Dl as J,
4624
+ Ml as K,
4625
+ Al as L,
4626
+ ac as M,
4627
+ lo as N,
4628
+ Pl as O,
4629
+ $l as P,
4630
+ mo as Q,
4631
+ Nl as R,
4632
4632
  yt as S,
4633
- ro as T,
4634
- _a as U,
4635
- Aa as V,
4633
+ to as T,
4634
+ Oa as U,
4635
+ _a as V,
4636
4636
  ke as W,
4637
- Pc as X,
4638
- tl as Y,
4639
- Mc as Z,
4640
- wo as _,
4641
- vl as a,
4642
- ml as a$,
4637
+ Mc as X,
4638
+ Zc as Y,
4639
+ kc as Z,
4640
+ xo as _,
4641
+ yl as a,
4642
+ ul as a$,
4643
4643
  D as a0,
4644
- xs as a1,
4645
- $o as a2,
4646
- Zc as a3,
4647
- cl as a4,
4648
- ol as a5,
4649
- Oa as a6,
4650
- Da as a7,
4651
- ka as a8,
4644
+ Fs as a1,
4645
+ Po as a2,
4646
+ Qc as a3,
4647
+ ol as a4,
4648
+ il as a5,
4649
+ Da as a6,
4650
+ Ta as a7,
4651
+ wa as a8,
4652
4652
  xe as a9,
4653
- _n as aA,
4654
- Pa as aB,
4653
+ Mn as aA,
4654
+ Ma as aB,
4655
4655
  ct as aC,
4656
- Nc as aD,
4657
- $c as aE,
4656
+ Ac as aD,
4657
+ Pc as aE,
4658
4658
  Te as aF,
4659
4659
  de as aG,
4660
- Oc as aH,
4661
- _l as aI,
4662
- Vc as aJ,
4663
- Bo as aK,
4660
+ Dc as aH,
4661
+ Ol as aI,
4662
+ Kc as aJ,
4663
+ Lo as aK,
4664
4664
  V as aL,
4665
- nl as aM,
4665
+ el as aM,
4666
4666
  lr as aN,
4667
- Sl as aO,
4667
+ Cl as aO,
4668
4668
  yr as aP,
4669
- pl as aQ,
4670
- Bs as aR,
4669
+ fl as aQ,
4670
+ Ls as aR,
4671
4671
  ce as aS,
4672
4672
  ht as aT,
4673
- ul as aU,
4674
- gl as aV,
4675
- fl as aW,
4676
- Rs as aX,
4677
- Qs as aY,
4678
- bl as aZ,
4679
- yl as a_,
4680
- Wc as aa,
4673
+ ll as aU,
4674
+ ml as aV,
4675
+ dl as aW,
4676
+ $s as aX,
4677
+ Hs as aY,
4678
+ hl as aZ,
4679
+ gl as a_,
4680
+ jc as aa,
4681
4681
  ut as ab,
4682
- Ec as ac,
4683
- qc as ad,
4684
- zc as ae,
4685
- Uc as af,
4682
+ Nc as ac,
4683
+ Vc as ad,
4684
+ qc as ae,
4685
+ Bc as af,
4686
4686
  lt as ag,
4687
- Ha as ah,
4688
- Bc as ai,
4689
- jc as aj,
4690
- La as ak,
4691
- Ja as al,
4692
- Za as am,
4693
- Gc as an,
4687
+ Ga as ah,
4688
+ Lc as ai,
4689
+ Uc as aj,
4690
+ Ra as ak,
4691
+ Xa as al,
4692
+ Qa as am,
4693
+ zc as an,
4694
4694
  z as ao,
4695
4695
  We as ap,
4696
- Ya as aq,
4697
- Rc as ar,
4698
- Kc as as,
4699
- Fl as at,
4700
- Lc as au,
4696
+ Wa as aq,
4697
+ $c as ar,
4698
+ Ec as as,
4699
+ Il as at,
4700
+ Rc as au,
4701
4701
  Un as av,
4702
- Ac as aw,
4703
- io as ax,
4704
- wa as ay,
4705
- kc as az,
4706
- Hs as b,
4707
- Vs as b0,
4708
- el as b1,
4709
- xo as b2,
4710
- Wa as b3,
4711
- xl as b4,
4702
+ _c as aw,
4703
+ no as ax,
4704
+ xa as ay,
4705
+ wc as az,
4706
+ Gs as b,
4707
+ Ks as b0,
4708
+ Jc as b1,
4709
+ Fo as b2,
4710
+ ja as b3,
4711
+ Fl as b4,
4712
4712
  sn as b5,
4713
- Do as b6,
4714
- Ys as b7,
4715
- sl as b8,
4716
- Fs as b9,
4717
- Il as ba,
4718
- Ws as bb,
4713
+ To as b6,
4714
+ Ws as b7,
4715
+ al as b8,
4716
+ Is as b9,
4717
+ bl as ba,
4718
+ js as bb,
4719
4719
  oe as bc,
4720
- rl as bd,
4721
- Eo as be,
4722
- il as bf,
4723
- Xt as bg,
4724
- Ro as bh,
4720
+ tl as bd,
4721
+ No as be,
4722
+ nl as bf,
4723
+ Qt as bg,
4724
+ $o as bh,
4725
4725
  sr as bi,
4726
4726
  or as bj,
4727
- ls as bk,
4728
- ll as bl,
4729
- _c as bm,
4727
+ ss as bk,
4728
+ sl as bl,
4729
+ Oc as bm,
4730
4730
  an as c,
4731
- kl as d,
4732
- dl as e,
4733
- Ko as f,
4734
- Cl as g,
4735
- Jc as h,
4736
- al as i,
4737
- Xc as j,
4738
- Qc as k,
4739
- qs as l,
4740
- qo as m,
4741
- Uo as n,
4742
- Ml as o,
4743
- ao as p,
4744
- so as q,
4745
- hl as r,
4746
- Al as s,
4747
- co as t,
4748
- Hc as u,
4749
- Co as v,
4731
+ wl as d,
4732
+ cl as e,
4733
+ Eo as f,
4734
+ vl as g,
4735
+ Xc as h,
4736
+ rl as i,
4737
+ Yc as j,
4738
+ Hc as k,
4739
+ Vs as l,
4740
+ Vo as m,
4741
+ Bo as n,
4742
+ kl as o,
4743
+ ro as p,
4744
+ ao as q,
4745
+ pl as r,
4746
+ _l as s,
4747
+ oo as t,
4748
+ Gc as u,
4749
+ vo as v,
4750
4750
  zn as w,
4751
- lo as x,
4752
- Yc as y,
4753
- uo as z
4751
+ so as x,
4752
+ Wc as y,
4753
+ co as z
4754
4754
  };