react-semaphor 0.1.544 → 0.1.545

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 (88) hide show
  1. package/dist/analytics-protocol/index.js +35 -34
  2. package/dist/assistant-context/index.js +1 -1
  3. package/dist/brand-studio/index.js +2 -2
  4. package/dist/briefings/index.js +50 -47
  5. package/dist/chunks/{class-utils-Df1OVOT1.js → _commonjsHelpers-DimLPMtv.js} +124 -98
  6. package/dist/chunks/{apply-dashboard-operations-Bz4n1Lq6.js → apply-dashboard-operations-CZEMsx8E.js} +778 -958
  7. package/dist/chunks/{assistant-chat-BNLkCDml.js → assistant-chat-D7sWTypJ.js} +308 -309
  8. package/dist/chunks/calendar-day-equality-dvoQp1xW.js +410 -0
  9. package/dist/chunks/{comparison-window-caption-BTkrN3W4.js → comparison-window-caption-D4E6IHPD.js} +56 -55
  10. package/dist/chunks/{custom-visual-inputs-DUtpYZOk.js → custom-visual-inputs-DLCD9Y5V.js} +8 -2
  11. package/dist/chunks/{dashboard-g5a4DKWq.js → dashboard-B1tMju0u.js} +1 -1
  12. package/dist/chunks/{dashboard-briefing-launcher-DQ_8O_e2.js → dashboard-briefing-launcher-CePgIu0Z.js} +771 -776
  13. package/dist/chunks/{dashboard-controls-8RyBTQUO.js → dashboard-controls-Cq05n3e0.js} +28 -28
  14. package/dist/chunks/{dashboard-json-7qT9jmfL.js → dashboard-json-CoYRPqxx.js} +3 -3
  15. package/dist/chunks/document-dashboard-inputs-BesAHZvB.js +3112 -0
  16. package/dist/chunks/{edit-dashboard-visual-BfJwnRIZ.js → edit-dashboard-visual-JPtNfJRb.js} +5624 -5615
  17. package/dist/chunks/{filter-value-text-CYsVYPuD.js → filter-value-text-ff7osJr7.js} +1 -1
  18. package/dist/chunks/{index-DkAyQvC6.js → index-DRWiuqyd.js} +378 -333
  19. package/dist/chunks/{matrix-formatter-CxJLkztA.js → matrix-formatter-DnCyRXJE.js} +13 -13
  20. package/dist/chunks/{numeric-presentation-DESvLiu9.js → numeric-presentation-7X_IrD58.js} +2571 -2572
  21. package/dist/chunks/{raw-temporal-presentation-CLiVi90c.js → raw-temporal-presentation-C3mUgnEx.js} +1 -1
  22. package/dist/chunks/{zoned-wall-clock-MulfA26h.js → relative-date-label-Bk2j94pA.js} +21 -64
  23. package/dist/chunks/rendered-file-D8xEuVVx.js +108 -0
  24. package/dist/chunks/{report-preferences-dialog-Df7VpRVW.js → report-preferences-dialog-DUtuUL_5.js} +631 -603
  25. package/dist/chunks/resolve-dashboard-input-context-DJ2tICwz.js +9415 -0
  26. package/dist/chunks/{saved-dashboard-context-B-mQ--nV.js → saved-dashboard-context-LrF_kW0l.js} +183 -211
  27. package/dist/chunks/selection-filter-compiler-BKXmyLrS.js +79 -0
  28. package/dist/chunks/{semaphor-ready-indicator-DDAxk8us.js → semaphor-ready-indicator-BxF96Yhv.js} +45764 -46519
  29. package/dist/chunks/{shelf-drop-preview-context-BSRPwaED.js → shelf-drop-preview-context-CNaM_Gmh.js} +885 -866
  30. package/dist/chunks/{switch-C3jLxlG0.js → switch-uDtPgQlQ.js} +44 -45
  31. package/dist/chunks/{table-export-sheet-CPfGAQ9X.js → table-export-sheet-YzMioA7Y.js} +1 -1
  32. package/dist/chunks/{use-create-flow-overlay-state-BxzFviM-.js → use-create-flow-overlay-state-CjB7ig1o.js} +105 -105
  33. package/dist/chunks/zoned-wall-clock-BkxV9jS2.js +46 -0
  34. package/dist/dashboard/index.js +1 -1
  35. package/dist/dashboard-authoring/index.js +556 -544
  36. package/dist/data-app-sdk/index.js +1 -1
  37. package/dist/format-utils/index.js +163 -152
  38. package/dist/index.js +351 -323
  39. package/dist/style.css +1 -1
  40. package/dist/surfboard/index.js +1 -1
  41. package/dist/types/briefings/attachment-outcomes.d.ts +1 -1
  42. package/dist/types/briefings/attachments.d.ts +33 -6
  43. package/dist/types/briefings/index.d.ts +6 -5
  44. package/dist/types/components/surfboard/filter/types.d.ts +0 -14
  45. package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-authoring.d.ts +68 -82
  46. package/dist/types/lib/dashboard-inputs/dashboard-input-target-context.d.ts +0 -8
  47. package/dist/types/lib/dashboard-inputs/dashboard-input-values.d.ts +35 -1
  48. package/dist/types/lib/dashboard-inputs/filter-settings.d.ts +199 -0
  49. package/dist/types/lib/dashboard-inputs/resolve-dashboard-input-context.d.ts +7 -2
  50. package/dist/types/lib/dashboard-inputs/resolve-selection-input.d.ts +1 -1
  51. package/dist/types/lib/dashboard-viewer/captured-runtime-values.d.ts +40 -0
  52. package/dist/types/lib/dashboard-viewer/compatibility-input-storage.d.ts +16 -16
  53. package/dist/types/lib/dashboard-viewer/viewer-state.d.ts +11 -9
  54. package/dist/types/lib/download-pdf.d.ts +75 -1
  55. package/dist/types/lib/hooks/use-date-filter.d.ts +5 -0
  56. package/dist/types/lib/hooks/use-text-filter.d.ts +5 -0
  57. package/dist/types/lib/matrix-table/matrix-delivery-policy.d.ts +5 -4
  58. package/dist/types/lib/query-context/assemble-card-query.d.ts +158 -0
  59. package/dist/types/lib/query-context/build-card-query-context.d.ts +3 -3
  60. package/dist/types/lib/query-context/build-dashboard-card-query-contract.d.ts +15 -6
  61. package/dist/types/lib/query-context/build-dashboard-execution-snapshot.d.ts +11 -13
  62. package/dist/types/lib/query-context/compile-dashboard-card-filters.d.ts +22 -12
  63. package/dist/types/lib/stores/dashboard-store.d.ts +39 -55
  64. package/dist/types/lib/stores/editor-store.d.ts +0 -3
  65. package/dist/types/lib/types/common-types.d.ts +21 -6
  66. package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +4 -11
  67. package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +12 -12
  68. package/dist/types/shared/dashboard-authoring/dashboard-filter-mapping-contract.d.ts +7 -0
  69. package/dist/types/shared/dashboard-authoring/dashboard-input-scope.d.ts +92 -0
  70. package/dist/types/shared/dashboard-authoring/filter-model/ad-hoc-filter-values.d.ts +10 -0
  71. package/dist/types/shared/dashboard-authoring/filter-model/filter-definitions.d.ts +29 -0
  72. package/dist/types/shared/dashboard-authoring/filter-model/filter-values.d.ts +58 -0
  73. package/dist/types/shared/dashboard-authoring/filter-model/index.d.ts +7 -0
  74. package/dist/types/shared/dashboard-authoring/filter-model/prototype-document-inputs.d.ts +15 -0
  75. package/dist/types/shared/dashboard-authoring/filter-model/read-dashboard-filter-model.d.ts +78 -0
  76. package/dist/types/shared/dashboard-authoring/filter-model/stored-dashboard.d.ts +18 -0
  77. package/dist/types/shared/dashboard-authoring/filter-model/toolbar-filter-reach.d.ts +23 -0
  78. package/dist/types/shared/dashboard-authoring/index.d.ts +2 -0
  79. package/dist/types/shared/format-utils/exporters/index.d.ts +2 -0
  80. package/dist/types/shared/format-utils/exporters/rendered-file.d.ts +106 -0
  81. package/package.json +2 -2
  82. package/dist/chunks/_commonjsHelpers-BkfeUUK-.js +0 -28
  83. package/dist/chunks/calendar-day-equality-BmJAWduY.js +0 -460
  84. package/dist/chunks/document-dashboard-inputs-BC6p-ESg.js +0 -8087
  85. package/dist/chunks/document-sheet-utils-Duo9uLoH.js +0 -3619
  86. package/dist/chunks/sort-target-MT1WK1vX.js +0 -29
  87. package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-storage-transition.d.ts +0 -88
  88. package/dist/types/lib/dashboard-inputs/dashboard-input-scope.d.ts +0 -10
@@ -1,203 +1,31 @@
1
- import { e as Ue, a as Ge, y as $e, z as We, A as Ye, B as xe, C as Xe, E as T, F as Ie, G as Je, H as Qe, I as re, J as Ze, K as Me, L as et, M as tt, N as rt, O as nt, P as ot, Q as it, R as Pe, S as at, T as st, U as ct, V as Y, W as ut, X as lt, Y as dt, b as mt, x as ft } from "./document-sheet-utils-Duo9uLoH.js";
2
- import { l as yt, f as gt, e as bt } from "./validators-DMHTpf7a.js";
1
+ import { aY as Le, aZ as ze, a_ as He, a$ as xe, b0 as je, b1 as S, b2 as Ce, b3 as Ue, b4 as ke, b5 as ee, b6 as Ge, b7 as he, b8 as $e, b9 as We, ba as Ye, bb as Xe, bc as Ze, bd as Qe, be as pe, bf as Je, bg as et, bh as tt, bi as W, bj as rt, bk as ot, bl as nt, b as it, aX as at } from "./resolve-dashboard-input-context-DJ2tICwz.js";
2
+ import { l as st, f as ct, e as ut } from "./validators-DMHTpf7a.js";
3
3
  import "./matrix-operation-contract-8OIO4gob.js";
4
- import { r as Ft, C as pt } from "./metric-comparison-DEwi9uc2.js";
4
+ import { r as lt, C as mt } from "./metric-comparison-DEwi9uc2.js";
5
5
  import "./analytics-base-schemas-BFAoRlkU.js";
6
6
  import "zod";
7
- import { q as vt } from "./pivot-result-lifecycle-DM4CyGKs.js";
8
- import { f as E } from "./matrix-formatter-CxJLkztA.js";
9
- import { b as Te, m as ht, h as Ct, d as Z, e as xt, i as P, u as I, R as It, v as Mt, r as Pt } from "./temporal-bucket-D7NBrrtL.js";
7
+ import { q as dt } from "./pivot-result-lifecycle-DM4CyGKs.js";
8
+ import { f as R } from "./matrix-formatter-DnCyRXJE.js";
9
+ import { b as Me, m as ft, h as yt, d as Z, e as gt, i as I, u as M, R as bt, v as Ft, r as vt } from "./temporal-bucket-D7NBrrtL.js";
10
10
  import "../value-format-preferences/index.js";
11
- import { B as Tt } from "./table-settings-CLZocegs.js";
12
- import { af as Oe, ag as Se, ah as Ot, ai as St, ab as ne, aj as At, ac as Fe } from "./numeric-presentation-DESvLiu9.js";
13
- import { r as wt } from "./pivot-result-identity-DJhXXcns.js";
14
- import { g as Dt } from "./_commonjsHelpers-BkfeUUK-.js";
15
- import { e as Bt, d as Rt } from "./raw-temporal-presentation-CLiVi90c.js";
16
- import { duplicateLayoutItem as Kt, addToLayout as Et } from "../layouts/index.js";
17
- const oe = { kind: "allSheets" }, B = (e, t) => (t == null ? void 0 : t[e]) ?? e;
18
- function Ae(e, t) {
19
- switch (e.kind) {
20
- case "cards":
21
- return {
22
- kind: "cards",
23
- cardIds: e.cardIds.map((r) => B(r, t.cardIds))
24
- };
25
- case "sheets":
26
- return {
27
- kind: "sheets",
28
- sheetIds: e.sheetIds.map((r) => B(r, t.sheetIds))
29
- };
30
- case "documentSections":
31
- return {
32
- ...e,
33
- sheetId: B(e.sheetId, t.sheetIds),
34
- sectionIds: e.sectionIds.map((r) => B(r, t.sectionIds))
35
- };
36
- default:
37
- return e;
38
- }
39
- }
40
- function _t(e, t) {
41
- return {
42
- ...e,
43
- targets: Ae(e.targets, t),
44
- cardMappings: e.cardMappings.map((r) => ({
45
- ...r,
46
- cardId: B(r.cardId, t.cardIds)
47
- }))
48
- };
49
- }
50
- function cn(e, t) {
51
- return {
52
- ...e.targets !== void 0 ? { targets: e.targets && Ae(e.targets, t) } : {},
53
- ...e.cardMappings !== void 0 ? {
54
- cardMappings: e.cardMappings && e.cardMappings.map((r) => ({
55
- ...r,
56
- cardId: B(r.cardId, t.cardIds)
57
- }))
58
- } : {}
59
- };
60
- }
61
- function un(e, t) {
62
- return t ? {
63
- ...e,
64
- targets: t.targets === void 0 ? e.targets : t.targets ?? oe,
65
- cardMappings: t.cardMappings === void 0 ? e.cardMappings : t.cardMappings ?? []
66
- } : e;
67
- }
68
- const X = (e, t) => JSON.stringify(e) === JSON.stringify(t);
69
- function ln(e, t) {
70
- const r = {};
71
- return X(e.targets, t.targets) || (r.targets = X(e.targets, oe) ? null : e.targets), X(e.cardMappings, t.cardMappings) || (r.cardMappings = e.cardMappings.length ? e.cardMappings : null), Object.keys(r).length ? r : void 0;
72
- }
73
- function dn(e, t) {
74
- return {
75
- ...e,
76
- targets: (t == null ? void 0 : t.targets) ?? oe,
77
- cardMappings: (t == null ? void 0 : t.cardMappings) ?? []
78
- };
79
- }
80
- function mn(e) {
81
- const t = Object.values(e.linkedInteractionTargetOverrides ?? {});
82
- if (!t.length) return;
83
- const r = {};
84
- if (t.some(
85
- (i) => i.applyToCardIds !== void 0
86
- )) {
87
- const i = t.flatMap(
88
- (a) => Array.isArray(a.applyToCardIds) ? [a.applyToCardIds] : []
89
- );
90
- r.targets = i.length === t.length ? { kind: "cards", cardIds: [...new Set(i.flat())] } : null;
91
- }
92
- const o = t.filter((i) => !Array.isArray(i.applyToCardIds));
93
- if (o.some((i) => i.excludeCardIds !== void 0)) {
94
- const i = [
95
- ...new Set(o.flatMap((a) => a.excludeCardIds ?? []))
96
- ].filter(
97
- (a) => o.every((c) => {
98
- var s;
99
- return (s = c.excludeCardIds) == null ? void 0 : s.includes(a);
100
- })
101
- );
102
- r.cardMappings = i.length ? i.map(
103
- (a) => ({ kind: "excluded", cardId: a })
104
- ) : null;
105
- }
106
- return Object.keys(r).length ? r : void 0;
107
- }
108
- function Nt(e, t) {
109
- var o;
110
- const r = (o = e.controlBindings) == null ? void 0 : o.map((i) => ({
111
- ...i,
112
- controlId: t.get(i.controlId) ?? i.controlId
113
- })), n = Ue(e).flatMap(
114
- ({ paramId: i, controlId: a }) => {
115
- var s;
116
- const c = t.get(a);
117
- return !c || c === a || (s = e.controlBindings) != null && s.some(
118
- (u) => u.target === "sql_param" && u.paramId === i
119
- ) ? [] : [{ target: "sql_param", paramId: i, controlId: c }];
120
- }
121
- );
122
- return n.length ? [...r ?? [], ...n] : r;
123
- }
124
- function we(e, t) {
125
- var o, i;
126
- const r = e.source === "dashboardInputAlias" ? ((o = t.inputAliases) == null ? void 0 : o[e.variableName]) ?? e : e, n = e.source === "dashboardInputAlias" && r !== e ? { ...r, export: e.export ?? "label" } : r;
127
- return n.source === "dashboardInput" ? {
128
- ...n,
129
- inputId: ((i = t.inputIds) == null ? void 0 : i[n.inputId]) ?? n.inputId
130
- } : n;
131
- }
132
- function fn(e, t) {
133
- var o;
134
- const r = {};
135
- for (const i of [
136
- "cardIds",
137
- "sheetIds",
138
- "inputIds",
139
- "controlIds",
140
- "filterIds"
141
- ]) {
142
- const a = { ...t[i] };
143
- for (const [c, s] of Object.entries((e == null ? void 0 : e[i]) ?? {}))
144
- a[c] = ((o = t[i]) == null ? void 0 : o[s]) ?? s;
145
- Object.keys(a).length && (r[i] = a);
146
- }
147
- const n = { ...t.inputAliases };
148
- for (const [i, a] of Object.entries((e == null ? void 0 : e.inputAliases) ?? {}))
149
- n[i] = we(a, t);
150
- return Object.keys(n).length && (r.inputAliases = n), r;
151
- }
152
- function yn(e, t) {
153
- var o, i, a, c;
154
- const r = Ge(e);
155
- r.controlBindings = Nt(
156
- e,
157
- new Map(Object.entries(t.controlIds ?? {}))
158
- );
159
- for (const s of r.controls ?? [])
160
- s.id = ((o = t.controlIds) == null ? void 0 : o[s.id]) ?? s.id;
161
- for (const s of r.inlineFilters ?? [])
162
- s.id = ((i = t.filterIds) == null ? void 0 : i[s.id]) ?? s.id;
163
- const n = (s) => {
164
- var l, m, f;
165
- if (!s || typeof s != "object") return;
166
- if (Array.isArray(s)) {
167
- s.forEach(n);
168
- return;
169
- }
170
- const u = s;
171
- if (u.type === "variable" && u.ref && typeof u.ref == "object") {
172
- const g = u.ref;
173
- u.ref = g.source === "input" ? { ...g, inputId: ((l = t.inputIds) == null ? void 0 : l[g.inputId]) ?? g.inputId } : we(g, t);
174
- }
175
- if (typeof u.entityId == "string") {
176
- const g = u.entityId;
177
- u.fieldScope === "card" && (u.entityId = ((m = t.cardIds) == null ? void 0 : m[g]) ?? g), u.fieldScope === "sheet" && (u.entityId = ((f = t.sheetIds) == null ? void 0 : f[g]) ?? g);
178
- }
179
- for (const [g, F] of Object.entries(u))
180
- g !== "linkedReferenceOverrides" && n(F);
181
- };
182
- n(r), r.clickToFilter && (r.clickToFilter = _t(r.clickToFilter, t));
183
- for (const s of Object.values(
184
- ((a = r.customCardPreferences) == null ? void 0 : a.dataInputCardIds) ?? {}
185
- ))
186
- s.cardId = ((c = t.cardIds) == null ? void 0 : c[s.cardId]) ?? s.cardId;
187
- return r;
188
- }
189
- const gn = [
11
+ import { B as xt } from "./table-settings-CLZocegs.js";
12
+ import { af as Pe, ag as Ie, ah as Ct, ai as ht, ab as te, aj as pt, ac as ye } from "./numeric-presentation-7X_IrD58.js";
13
+ import { r as Mt } from "./pivot-result-identity-DJhXXcns.js";
14
+ import { g as Pt } from "./_commonjsHelpers-DimLPMtv.js";
15
+ import { e as It, d as St } from "./raw-temporal-presentation-C3mUgnEx.js";
16
+ import { duplicateLayoutItem as Tt, addToLayout as Ot } from "../layouts/index.js";
17
+ const Qr = [
190
18
  "lg",
191
19
  "md",
192
20
  "sm",
193
21
  "xs",
194
22
  "xxs"
195
- ], bn = 15, Vt = /\{\{-?\s*filters\s*\|\s*where\s*-?\}\}/i, kt = /\{\{-?\s*filters\s*\|\s*and\s*-?\}\}/i, Lt = /\bwhere\b/i;
196
- function qt(e) {
197
- return e != null && e.trim() ? Vt.test(e) || kt.test(e) : !1;
23
+ ], Jr = 15, At = /\{\{-?\s*filters\s*\|\s*where\s*-?\}\}/i, wt = /\{\{-?\s*filters\s*\|\s*and\s*-?\}\}/i, Dt = /\bwhere\b/i;
24
+ function Bt(e) {
25
+ return e != null && e.trim() ? At.test(e) || wt.test(e) : !1;
198
26
  }
199
- function Fn(e) {
200
- return !(e != null && e.trim()) || qt(e) ? null : Lt.test(e) ? {
27
+ function eo(e) {
28
+ return !(e != null && e.trim()) || Bt(e) ? null : Dt.test(e) ? {
201
29
  helper: "{{ filters | and }}",
202
30
  description: "For queries with an existing WHERE clause."
203
31
  } : {
@@ -205,58 +33,58 @@ function Fn(e) {
205
33
  description: "For queries without a WHERE clause."
206
34
  };
207
35
  }
208
- const pe = [10, 20, 50, 100, 500, 1e3], jt = 50;
209
- function zt(e) {
210
- return e && e > 0 ? e : jt;
36
+ const ge = [10, 20, 50, 100, 500, 1e3], Kt = 50;
37
+ function Rt(e) {
38
+ return e && e > 0 ? e : Kt;
211
39
  }
212
- function pn(e) {
213
- const t = zt(e), r = [...pe];
214
- return pe.includes(
40
+ function to(e) {
41
+ const t = Rt(e), r = [...ge];
42
+ return ge.includes(
215
43
  t
216
- ) || (r.push(t), r.sort((n, o) => n - o)), r;
44
+ ) || (r.push(t), r.sort((o, n) => o - n)), r;
217
45
  }
218
- function vn(e) {
46
+ function ro(e) {
219
47
  var t, r;
220
- return !!((e.type === "table" || e.type === "detailTable") && e.sql && !Oe(e.config) && !((r = (t = e.preferences) == null ? void 0 : t.tablePrefs) != null && r.forceClientPagination));
48
+ return !!((e.type === "table" || e.type === "detailTable") && e.sql && !Pe(e.config) && !((r = (t = e.preferences) == null ? void 0 : t.tablePrefs) != null && r.forceClientPagination));
221
49
  }
222
- function Ht(e, t) {
223
- var n, o, i, a;
50
+ function Et(e, t) {
51
+ var o, n, i, a;
224
52
  if (t === "table-print")
225
53
  return "disabled";
226
- if ((o = (n = e.preferences) == null ? void 0 : n.tablePrefs) != null && o.forceClientPagination)
54
+ if ((n = (o = e.preferences) == null ? void 0 : o.tablePrefs) != null && n.forceClientPagination)
227
55
  return "client";
228
- const r = Oe(e.config);
229
- return e.sql && !r ? (a = (i = e.preferences) == null ? void 0 : i.tablePrefs) != null && a.enableDevModePagination ? "server" : "client" : r && $e(e) ? "server" : "client";
56
+ const r = Pe(e.config);
57
+ return e.sql && !r ? (a = (i = e.preferences) == null ? void 0 : i.tablePrefs) != null && a.enableDevModePagination ? "server" : "client" : r && Le(e) ? "server" : "client";
230
58
  }
231
- const De = Object.freeze({}), hn = {
59
+ const Se = Object.freeze({}), oo = {
232
60
  access: "session-only",
233
61
  printMode: !1,
234
62
  baseline: null,
235
63
  applied: null,
236
64
  appliedBookmark: null,
237
- tableSettings: De,
65
+ tableSettings: Se,
238
66
  notices: []
239
67
  };
240
- function Cn(e) {
68
+ function no(e) {
241
69
  return !e.viewer.printMode && e.viewer.access !== "session-only" && !!e.viewer.baseline && !!e.viewerStateClient && !e.isDashboardEditing;
242
70
  }
243
- function Ut(e) {
244
- return e.isDashboardEditing ? De : e.viewer.tableSettings;
71
+ function _t(e) {
72
+ return e.isDashboardEditing ? Se : e.viewer.tableSettings;
245
73
  }
246
- function Gt(e, t) {
247
- return Ut(e)[t];
74
+ function Nt(e, t) {
75
+ return _t(e)[t];
248
76
  }
249
- function xn(e, t, r) {
250
- if (!(r.isEditorPreview || e.isDashboardEditing) && Tt(e.dashboard, t))
251
- return { settings: Gt(e, t) };
77
+ function io(e, t, r) {
78
+ if (!(r.isEditorPreview || e.isDashboardEditing) && xt(e.dashboard, t))
79
+ return { settings: Nt(e, t) };
252
80
  }
253
- function $t(e) {
81
+ function Vt(e) {
254
82
  var t;
255
- return We({
83
+ return ze({
256
84
  card: e.card,
257
- paginationMode: Ht(e.card) === "server" ? "server" : "client",
85
+ paginationMode: Et(e.card) === "server" ? "server" : "client",
258
86
  result: {
259
- keys: e.keys ?? Ye(e.records),
87
+ keys: e.keys ?? He(e.records),
260
88
  rows: e.records,
261
89
  columns: e.resultColumns,
262
90
  columnKeyMap: e.columnKeyMap,
@@ -266,11 +94,11 @@ function $t(e) {
266
94
  projection: "export"
267
95
  });
268
96
  }
269
- const In = (e) => {
97
+ const ao = (e) => {
270
98
  e = e.replace("#", "");
271
- const t = Number.parseInt(e.substr(0, 2), 16), r = Number.parseInt(e.substr(2, 2), 16), n = Number.parseInt(e.substr(4, 2), 16);
272
- return (0.299 * t + 0.587 * r + 0.114 * n) / 255 > 0.5 ? "#000000" : "#ffffff";
273
- }, Wt = () => ({
99
+ const t = Number.parseInt(e.substr(0, 2), 16), r = Number.parseInt(e.substr(2, 2), 16), o = Number.parseInt(e.substr(4, 2), 16);
100
+ return (0.299 * t + 0.587 * r + 0.114 * o) / 255 > 0.5 ? "#000000" : "#ffffff";
101
+ }, qt = () => ({
274
102
  urlTemplate: "{value}",
275
103
  // Default: use cell value as-is
276
104
  labelType: "value",
@@ -279,7 +107,7 @@ const In = (e) => {
279
107
  labelColumn: "",
280
108
  openInNewTab: !0
281
109
  // Default: open in new tab (current behavior)
282
- }), ie = () => ({
110
+ }), re = () => ({
283
111
  type: "none",
284
112
  inheritMetricFormat: !0,
285
113
  textAlign: "left",
@@ -314,13 +142,13 @@ const In = (e) => {
314
142
  sourceTimezone: "auto"
315
143
  // Default to auto (use explicit timezone if present, otherwise assume UTC)
316
144
  },
317
- linkFormat: Wt(),
145
+ linkFormat: qt(),
318
146
  colorRanges: []
319
147
  });
320
- function Mn(e, t, r, n) {
148
+ function so(e, t, r, o) {
321
149
  return t && t !== "auto" ? t : r;
322
150
  }
323
- const Pn = (e) => !e || e === "auto" ? "local time" : {
151
+ const co = (e) => !e || e === "auto" ? "local time" : {
324
152
  "America/New_York": "Eastern Time",
325
153
  "America/Chicago": "Central Time",
326
154
  "America/Denver": "Mountain Time",
@@ -331,11 +159,11 @@ const Pn = (e) => !e || e === "auto" ? "local time" : {
331
159
  "Asia/Shanghai": "China Time",
332
160
  UTC: "UTC"
333
161
  }[e] || e;
334
- function Yt(e) {
335
- const t = E(e == null ? void 0 : e.format);
336
- return !!(t && Te(t));
162
+ function Lt(e) {
163
+ const t = R(e == null ? void 0 : e.format);
164
+ return !!(t && Me(t));
337
165
  }
338
- function ee(e, t) {
166
+ function Q(e, t) {
339
167
  var a, c;
340
168
  if (!(e != null && e.config) || e.type === "matrixTable" || (a = e.sql) != null && a.trim() || (c = e.python) != null && c.trim())
341
169
  return;
@@ -354,16 +182,16 @@ function ee(e, t) {
354
182
  field: s,
355
183
  role: "groupby"
356
184
  }))
357
- ], n = t.fieldRole ? r.filter((s) => s.role === t.fieldRole) : r, o = (s) => s.length === 1 ? s[0].field : void 0;
185
+ ], o = t.fieldRole ? r.filter((s) => s.role === t.fieldRole) : r, n = (s) => s.length === 1 ? s[0].field : void 0;
358
186
  if (t.fieldId)
359
- return o(
360
- n.filter(
187
+ return n(
188
+ o.filter(
361
189
  ({ field: s, role: u }) => s.id === t.fieldId && (!t.fieldRole || u === t.fieldRole)
362
190
  )
363
191
  );
364
192
  if (t.metricId)
365
- return o(
366
- n.filter(
193
+ return n(
194
+ o.filter(
367
195
  ({ field: s, role: u }) => u === (e.type === "detailTable" ? "detail" : "metric") && s.id === t.metricId
368
196
  )
369
197
  );
@@ -372,35 +200,35 @@ function ee(e, t) {
372
200
  t.columnId,
373
201
  t.metricAlias,
374
202
  ...t.columnIds || []
375
- ].filter((m) => m !== void 0), u = n.map((m) => {
376
- var f, g;
203
+ ].filter((d) => d !== void 0), u = o.map((d) => {
204
+ var f, x;
377
205
  return {
378
- ...m,
206
+ ...d,
379
207
  bindings: [
380
- wt(
208
+ Mt(
381
209
  t.columnKeyMap,
382
- m.field.id,
383
- m.role
210
+ d.field.id,
211
+ d.role
384
212
  ),
385
- m.role === "metric" && m.field.alias ? (g = (f = t.columnKeyMap) == null ? void 0 : f.byMetricAlias) == null ? void 0 : g[m.field.alias] : void 0
213
+ d.role === "metric" && d.field.alias ? (x = (f = t.columnKeyMap) == null ? void 0 : f.byMetricAlias) == null ? void 0 : x[d.field.alias] : void 0
386
214
  ]
387
215
  };
388
- }), l = u.filter(
389
- (m) => m.bindings.some(
216
+ }), m = u.filter(
217
+ (d) => d.bindings.some(
390
218
  (f) => (f == null ? void 0 : f.outputKey) !== void 0 && s.includes(f.outputKey)
391
219
  )
392
220
  );
393
- return l.length ? o(l) : o(
221
+ return m.length ? n(m) : n(
394
222
  u.filter(
395
- (m) => m.bindings.some(
223
+ (d) => d.bindings.some(
396
224
  (f) => (f == null ? void 0 : f.rawKey) !== void 0 && s.includes(f.rawKey)
397
225
  )
398
226
  )
399
227
  );
400
228
  }
401
229
  const i = (s) => s == null ? void 0 : s.trim().toLowerCase();
402
- return o(
403
- n.filter(
230
+ return n(
231
+ o.filter(
404
232
  ({ field: s }) => [t.columnId, t.metricAlias, ...t.columnIds || []].some(
405
233
  (u) => u !== void 0 && [
406
234
  s.id,
@@ -409,52 +237,52 @@ function ee(e, t) {
409
237
  s.qualifiedFieldName,
410
238
  s.label
411
239
  ].some(
412
- (l) => l !== void 0 && i(l) === i(u)
240
+ (m) => m !== void 0 && i(m) === i(u)
413
241
  )
414
242
  )
415
243
  )
416
244
  );
417
245
  }
418
- function Xt(e, t, r) {
419
- return ee(e, {
246
+ function zt(e, t, r) {
247
+ return Q(e, {
420
248
  fieldId: t.id,
421
249
  fieldRole: "groupby"
422
- }) ?? ee(
250
+ }) ?? Q(
423
251
  e,
424
252
  r ? {
425
253
  columnIds: [t.alias, t.name, t.id].filter(
426
- (n) => !!n
254
+ (o) => !!o
427
255
  ),
428
256
  columnKeyMap: r,
429
257
  fieldRole: "groupby"
430
258
  } : { fieldId: t.id, fieldRole: "groupby" }
431
259
  );
432
260
  }
433
- function Tn(e, t, r) {
434
- return e.map((n) => {
435
- const o = Xt(
261
+ function uo(e, t, r) {
262
+ return e.map((o) => {
263
+ const n = zt(
436
264
  t,
437
- n,
265
+ o,
438
266
  r
439
267
  );
440
- if (!o) return n;
441
- const { format: i, ...a } = n;
268
+ if (!n) return o;
269
+ const { format: i, ...a } = o;
442
270
  return {
443
271
  ...a,
444
- ...o.label ? { label: o.label } : {},
445
- ...o.format !== void 0 ? { format: o.format } : {}
272
+ ...n.label ? { label: n.label } : {},
273
+ ...n.format !== void 0 ? { format: n.format } : {}
446
274
  };
447
275
  });
448
276
  }
449
- function Be(e, t) {
450
- const r = typeof e.decimalPlaces == "number", n = typeof e.minimumFractionDigits == "number" ? e.minimumFractionDigits : r ? e.decimalPlaces : t.min, o = typeof e.maximumFractionDigits == "number" ? e.maximumFractionDigits : r ? e.decimalPlaces : t.max;
277
+ function Te(e, t) {
278
+ const r = typeof e.decimalPlaces == "number", o = typeof e.minimumFractionDigits == "number" ? e.minimumFractionDigits : r ? e.decimalPlaces : t.min, n = typeof e.maximumFractionDigits == "number" ? e.maximumFractionDigits : r ? e.decimalPlaces : t.max;
451
279
  return {
452
- minimumFractionDigits: n,
453
- maximumFractionDigits: Math.max(n, o)
280
+ minimumFractionDigits: o,
281
+ maximumFractionDigits: Math.max(o, n)
454
282
  };
455
283
  }
456
- function L(e, t) {
457
- const r = Be(e, t), n = typeof e.suffix == "string" && e.suffix.length > 0;
284
+ function q(e, t) {
285
+ const r = Te(e, t), o = typeof e.suffix == "string" && e.suffix.length > 0;
458
286
  return {
459
287
  style: "decimal",
460
288
  locale: e.locale,
@@ -463,7 +291,7 @@ function L(e, t) {
463
291
  maximumFractionDigits: r.maximumFractionDigits,
464
292
  useGrouping: e.useGrouping,
465
293
  // Preserve legacy behavior: explicit custom suffix should not trigger compacting.
466
- useSuffix: !!(e.useSuffix && !n),
294
+ useSuffix: !!(e.useSuffix && !o),
467
295
  prefix: e.prefix,
468
296
  suffix: e.suffix,
469
297
  negativeInParentheses: e.negativeInParentheses,
@@ -471,42 +299,42 @@ function L(e, t) {
471
299
  percentValueMode: e.percentValueMode
472
300
  };
473
301
  }
474
- function Re(e, t = "auto", r = {}) {
475
- switch (t === "auto" && (t = tr(e, r)), t) {
302
+ function Oe(e, t = "auto", r = {}) {
303
+ switch (t === "auto" && (t = Gt(e, r)), t) {
476
304
  case "number":
477
- return Ke(e, r);
305
+ return Ae(e, r);
478
306
  case "currency":
479
- return Ee(e, r);
307
+ return we(e, r);
480
308
  case "percent":
481
- return Jt(e, r);
309
+ return Ht(e, r);
482
310
  case "date":
483
- return Qt(e, r);
311
+ return jt(e, r);
484
312
  case "scientific":
485
- return Zt(e, r);
313
+ return Ut(e, r);
486
314
  case "duration":
487
- return er(e, r);
315
+ return kt(e, r);
488
316
  default:
489
317
  return String(e);
490
318
  }
491
319
  }
492
- function Ke(e, t = {}) {
320
+ function Ae(e, t = {}) {
493
321
  return e < 0 && !!t.prefix && !t.negativeInParentheses ? `-${Z(
494
322
  Math.abs(e),
495
- L(t, {
323
+ q(t, {
496
324
  min: 0,
497
325
  max: 0
498
326
  })
499
327
  )}` : Z(
500
328
  e,
501
- L(t, {
329
+ q(t, {
502
330
  min: 0,
503
331
  max: 0
504
332
  })
505
333
  );
506
334
  }
507
- function Ee(e, t = {}) {
508
- return xt(e, {
509
- ...L(t, {
335
+ function we(e, t = {}) {
336
+ return gt(e, {
337
+ ...q(t, {
510
338
  min: 2,
511
339
  max: 2
512
340
  }),
@@ -514,8 +342,8 @@ function Ee(e, t = {}) {
514
342
  currency: t.currency || "USD"
515
343
  });
516
344
  }
517
- function Jt(e, t = {}) {
518
- const r = Be(t, { min: 1, max: 1 }), o = typeof t.multiplyBy == "number" && Number.isFinite(t.multiplyBy) ? t.multiplyBy : t.percentValueMode === "whole" ? 1 : 100, i = e * o;
345
+ function Ht(e, t = {}) {
346
+ const r = Te(t, { min: 1, max: 1 }), n = typeof t.multiplyBy == "number" && Number.isFinite(t.multiplyBy) ? t.multiplyBy : t.percentValueMode === "whole" ? 1 : 100, i = e * n;
519
347
  return Z(i, {
520
348
  locale: t.locale,
521
349
  minimumFractionDigits: r.minimumFractionDigits,
@@ -527,25 +355,25 @@ function Jt(e, t = {}) {
527
355
  useSuffix: !1
528
356
  });
529
357
  }
530
- function Qt(e, t = {}) {
358
+ function jt(e, t = {}) {
531
359
  const { locale: r = "en-US" } = t;
532
360
  try {
533
- const n = new Date(e);
534
- return isNaN(n.getTime()) ? String(e) : new Intl.DateTimeFormat(r, {
361
+ const o = new Date(e);
362
+ return isNaN(o.getTime()) ? String(e) : new Intl.DateTimeFormat(r, {
535
363
  dateStyle: "short"
536
- }).format(n);
364
+ }).format(o);
537
365
  } catch {
538
366
  return String(e);
539
367
  }
540
368
  }
541
- function Zt(e, t = {}) {
542
- return Ct(
369
+ function Ut(e, t = {}) {
370
+ return yt(
543
371
  e,
544
- L(t, { min: 2, max: 2 })
372
+ q(t, { min: 2, max: 2 })
545
373
  );
546
374
  }
547
- function er(e, t = {}) {
548
- return ht(e, {
375
+ function kt(e, t = {}) {
376
+ return ft(e, {
549
377
  inputUnit: t.durationInputUnit,
550
378
  outputStyle: t.durationDisplayStyle,
551
379
  largestUnit: t.durationLargestUnit,
@@ -556,55 +384,55 @@ function er(e, t = {}) {
556
384
  negativeInParentheses: t.negativeInParentheses
557
385
  });
558
386
  }
559
- function tr(e, t) {
387
+ function Gt(e, t) {
560
388
  return t.currency ? "currency" : typeof e == "string" && !isNaN(Date.parse(e)) ? "date" : "number";
561
389
  }
562
- function On(e, t = {}) {
563
- return (r) => Re(r, e, t);
390
+ function lo(e, t = {}) {
391
+ return (r) => Oe(r, e, t);
564
392
  }
565
- function rr({
393
+ function $t({
566
394
  number: e,
567
395
  decimalPlaces: t = 0,
568
396
  useSuffix: r = !1,
569
- customSuffix: n = "",
570
- currency: o = "",
397
+ customSuffix: o = "",
398
+ currency: n = "",
571
399
  locale: i = "en-US"
572
400
  }) {
573
- if (o) {
574
- const a = Ee(e, {
575
- currency: o,
401
+ if (n) {
402
+ const a = we(e, {
403
+ currency: n,
576
404
  decimalPlaces: t,
577
405
  locale: i,
578
- useSuffix: r && !n
406
+ useSuffix: r && !o
579
407
  });
580
- return r && n ? `${a}${n}` : a;
408
+ return r && o ? `${a}${o}` : a;
581
409
  }
582
- return Ke(e, {
410
+ return Ae(e, {
583
411
  decimalPlaces: t,
584
- useSuffix: r && !n,
585
- suffix: n,
412
+ useSuffix: r && !o,
413
+ suffix: o,
586
414
  locale: i
587
415
  });
588
416
  }
589
- var nr = function e(t, r) {
417
+ var Wt = function e(t, r) {
590
418
  if (t === r) return !0;
591
419
  if (t && r && typeof t == "object" && typeof r == "object") {
592
420
  if (t.constructor !== r.constructor) return !1;
593
- var n, o, i;
421
+ var o, n, i;
594
422
  if (Array.isArray(t)) {
595
- if (n = t.length, n != r.length) return !1;
596
- for (o = n; o-- !== 0; )
597
- if (!e(t[o], r[o])) return !1;
423
+ if (o = t.length, o != r.length) return !1;
424
+ for (n = o; n-- !== 0; )
425
+ if (!e(t[n], r[n])) return !1;
598
426
  return !0;
599
427
  }
600
428
  if (t.constructor === RegExp) return t.source === r.source && t.flags === r.flags;
601
429
  if (t.valueOf !== Object.prototype.valueOf) return t.valueOf() === r.valueOf();
602
430
  if (t.toString !== Object.prototype.toString) return t.toString() === r.toString();
603
- if (i = Object.keys(t), n = i.length, n !== Object.keys(r).length) return !1;
604
- for (o = n; o-- !== 0; )
605
- if (!Object.prototype.hasOwnProperty.call(r, i[o])) return !1;
606
- for (o = n; o-- !== 0; ) {
607
- var a = i[o];
431
+ if (i = Object.keys(t), o = i.length, o !== Object.keys(r).length) return !1;
432
+ for (n = o; n-- !== 0; )
433
+ if (!Object.prototype.hasOwnProperty.call(r, i[n])) return !1;
434
+ for (n = o; n-- !== 0; ) {
435
+ var a = i[n];
608
436
  if (!(a === "_owner" && t.$$typeof) && !e(t[a], r[a]))
609
437
  return !1;
610
438
  }
@@ -612,8 +440,8 @@ var nr = function e(t, r) {
612
440
  }
613
441
  return t !== t && r !== r;
614
442
  };
615
- const q = /* @__PURE__ */ Dt(nr);
616
- function or(e) {
443
+ const L = /* @__PURE__ */ Pt(Wt);
444
+ function Yt(e) {
617
445
  if (typeof e == "number")
618
446
  return Number.isFinite(e);
619
447
  if (typeof e != "string")
@@ -621,47 +449,47 @@ function or(e) {
621
449
  const t = e.trim().replace(/,/g, "");
622
450
  return t !== "" && Number.isFinite(Number(t));
623
451
  }
624
- function ir(e) {
452
+ function Xt(e) {
625
453
  if (!(e != null && e.length))
626
454
  return [];
627
455
  const t = /* @__PURE__ */ new Set();
628
456
  return e.forEach((r) => {
629
- Object.keys(r).forEach((n) => t.add(n));
457
+ Object.keys(r).forEach((o) => t.add(o));
630
458
  }), [...t];
631
459
  }
632
- function ar(e) {
633
- return ir(e).filter(
634
- (r) => e == null ? void 0 : e.some((n) => or(n[r]))
460
+ function Zt(e) {
461
+ return Xt(e).filter(
462
+ (r) => e == null ? void 0 : e.some((o) => Yt(o[r]))
635
463
  );
636
464
  }
637
- function ae(e, t) {
465
+ function oe(e, t) {
638
466
  var r;
639
467
  if (t.id)
640
468
  return (r = e.sql) != null && r.trim() ? { kind: "column", columnKey: t.id } : { kind: "metric", metricId: t.id };
641
469
  }
642
- function _e(e) {
470
+ function De(e) {
643
471
  const t = e.context.preferences;
644
472
  if (!t)
645
473
  return e.authoredFormat;
646
- const r = ae(e.card, e.metric);
647
- return I(
474
+ const r = oe(e.card, e.metric);
475
+ return M(
648
476
  e.authoredFormat,
649
477
  t,
650
478
  r ? e.context.resolveBoundCurrency(r) : void 0
651
479
  );
652
480
  }
653
- function sr(e) {
481
+ function Qt(e) {
654
482
  var i, a, c;
655
- const t = (c = (a = (i = e.card.preferences) == null ? void 0 : i.tablePrefs) == null ? void 0 : a.columnSettingsMap) == null ? void 0 : c[e.columnKey], r = (t == null ? void 0 : t.type) === "number" ? Xe(
483
+ const t = (c = (a = (i = e.card.preferences) == null ? void 0 : i.tablePrefs) == null ? void 0 : a.columnSettingsMap) == null ? void 0 : c[e.columnKey], r = (t == null ? void 0 : t.type) === "number" ? je(
656
484
  { dataType: "number", format: void 0 },
657
485
  t
658
- ) : void 0, n = r == null ? void 0 : r.authoredFormat, o = P(n) ? _e({
486
+ ) : void 0, o = r == null ? void 0 : r.authoredFormat, n = I(o) ? De({
659
487
  card: e.card,
660
488
  metric: {
661
489
  id: e.columnKey
662
490
  },
663
491
  context: e.context,
664
- authoredFormat: n
492
+ authoredFormat: o
665
493
  }) : void 0;
666
494
  return {
667
495
  id: e.columnKey,
@@ -670,46 +498,46 @@ function sr(e) {
670
498
  alias: e.columnKey,
671
499
  dataType: "number",
672
500
  role: "metric",
673
- format: o
501
+ format: n
674
502
  };
675
503
  }
676
- function Sn(e) {
677
- var o, i;
504
+ function mo(e) {
505
+ var n, i;
678
506
  const t = new Set(
679
- ar(e.records)
507
+ Zt(e.records)
680
508
  ), r = new Set(
681
509
  e.renderedMetricKeys || e.resultKeys
682
- ), n = ((i = (o = e.card.preferences) == null ? void 0 : o.tablePrefs) == null ? void 0 : i.columnSettingsMap) || {};
510
+ ), o = ((i = (n = e.card.preferences) == null ? void 0 : n.tablePrefs) == null ? void 0 : i.columnSettingsMap) || {};
683
511
  return e.resultKeys.filter(
684
512
  (a) => {
685
513
  var c;
686
- return r.has(a) && (t.has(a) || ((c = n[a]) == null ? void 0 : c.type) === "number");
514
+ return r.has(a) && (t.has(a) || ((c = o[a]) == null ? void 0 : c.type) === "number");
687
515
  }
688
516
  );
689
517
  }
690
- function An(e) {
518
+ function fo(e) {
691
519
  var i, a;
692
520
  const { card: t, context: r } = e;
693
- if (!(r != null && r.preferences) || !Se(t.type))
521
+ if (!(r != null && r.preferences) || !Ie(t.type))
694
522
  return t;
695
- const n = r.preferences, o = (i = t.sql) != null && i.trim() ? e.resultMetricKeys.map(
696
- (c) => sr({
523
+ const o = r.preferences, n = (i = t.sql) != null && i.trim() ? e.resultMetricKeys.map(
524
+ (c) => Qt({
697
525
  card: t,
698
526
  columnKey: c,
699
527
  context: r
700
528
  })
701
529
  ) : (((a = t.config) == null ? void 0 : a.metricColumns) || []).map((c) => {
702
530
  const s = xe(t, c), u = s.authoredFormat;
703
- if (!P(u))
531
+ if (!I(u))
704
532
  return c;
705
- const l = ae(t, c), m = l ? r.resolveBoundCurrency(l) : void 0;
706
- return s.source === "inferred" && !m ? c : {
533
+ const m = oe(t, c), d = m ? r.resolveBoundCurrency(m) : void 0;
534
+ return s.source === "inferred" && !d ? c : {
707
535
  ...c,
708
- format: s.source === "inferred" ? I(
536
+ format: s.source === "inferred" ? M(
709
537
  u,
710
- n,
711
- m
712
- ) : _e({
538
+ o,
539
+ d
540
+ ) : De({
713
541
  card: t,
714
542
  metric: c,
715
543
  context: r,
@@ -721,158 +549,158 @@ function An(e) {
721
549
  ...t,
722
550
  config: {
723
551
  ...t.config || {},
724
- metricColumns: o
552
+ metricColumns: n
725
553
  }
726
554
  };
727
555
  }
728
- function z(e) {
556
+ function H(e) {
729
557
  var s;
730
- const { card: t, context: r, formatOptions: n } = e, o = r == null ? void 0 : r.preferences;
731
- if (!t || !o || !Se(t.type))
732
- return n;
733
- if (!n) {
558
+ const { card: t, context: r, formatOptions: o } = e, n = r == null ? void 0 : r.preferences;
559
+ if (!t || !n || !Ie(t.type))
560
+ return o;
561
+ if (!o) {
734
562
  const u = e.metrics.filter(
735
- (m) => !!m
736
- ), l = u.some(
737
- (m) => P(m.format)
563
+ (d) => !!d
564
+ ), m = u.some(
565
+ (d) => I(d.format)
738
566
  );
739
- return u.length < 2 || !l ? n : T(
740
- I({ type: "number" }, o),
567
+ return u.length < 2 || !m ? o : S(
568
+ M({ type: "number" }, n),
741
569
  { preserveOmittedProperties: !0 }
742
570
  );
743
571
  }
744
572
  if ((s = t.sql) != null && s.trim()) {
745
573
  const u = e.metrics.filter(
746
- (m) => !!m
747
- ), l = u.filter(
748
- (m) => P(m.format)
574
+ (d) => !!d
575
+ ), m = u.filter(
576
+ (d) => I(d.format)
749
577
  );
750
- if (l.length === 0)
751
- return n;
752
- if (l.length !== u.length)
753
- return T(
754
- I({ type: "number" }, o),
578
+ if (m.length === 0)
579
+ return o;
580
+ if (m.length !== u.length)
581
+ return S(
582
+ M({ type: "number" }, n),
755
583
  { preserveOmittedProperties: !0 }
756
584
  );
757
585
  }
758
- const i = Ie(n, {
586
+ const i = Ce(o, {
759
587
  preserveOmittedProperties: !0
760
588
  });
761
- if (!P(i))
762
- return n;
589
+ if (!I(i))
590
+ return o;
763
591
  const a = e.metrics.flatMap((u) => {
764
592
  if (!u)
765
593
  return [];
766
- const l = ae(t, u);
594
+ const m = oe(t, u);
767
595
  return [
768
- I(
596
+ M(
769
597
  i,
770
- o,
771
- l ? r.resolveBoundCurrency(l) : void 0
598
+ n,
599
+ m ? r.resolveBoundCurrency(m) : void 0
772
600
  )
773
601
  ];
774
602
  });
775
603
  if (a.length === 0)
776
- return T(
777
- I(i, o),
604
+ return S(
605
+ M(i, n),
778
606
  { preserveOmittedProperties: !0 }
779
607
  );
780
608
  const [c] = a;
781
- if (a.some((u) => !q(u, c))) {
782
- const u = I(
609
+ if (a.some((u) => !L(u, c))) {
610
+ const u = M(
783
611
  {
784
612
  ...i,
785
613
  type: "number",
786
614
  currency: void 0
787
615
  },
788
- o
616
+ n
789
617
  );
790
- return T(u, {
618
+ return S(u, {
791
619
  preserveOmittedProperties: !0
792
620
  });
793
621
  }
794
- return T(c, {
622
+ return S(c, {
795
623
  preserveOmittedProperties: !0
796
624
  });
797
625
  }
798
- const cr = /* @__PURE__ */ new Set([
626
+ const Jt = /* @__PURE__ */ new Set([
799
627
  "horizontalBar",
800
628
  "tornado",
801
629
  "pyramid",
802
630
  "range"
803
- ]), ur = /* @__PURE__ */ new Set([
631
+ ]), er = /* @__PURE__ */ new Set([
804
632
  "tornado",
805
633
  "pyramid",
806
634
  "range"
807
- ]), lr = /* @__PURE__ */ new Set([
635
+ ]), tr = /* @__PURE__ */ new Set([
808
636
  "tornado",
809
637
  "pyramid",
810
638
  "range"
811
639
  ]);
812
- function dr(e) {
813
- const { chartType: t, resultKeys: r, config: n } = e, o = 1 + (n != null && n.enableGrouping && (n.groupKey || r[1]) ? 1 : 0), i = r.slice(o), a = (n == null ? void 0 : n.xMetricKey) ?? i[0], c = (n == null ? void 0 : n.yMetricKey) ?? i[1] ?? i[0], s = t === "bubble" ? (n == null ? void 0 : n.radiusMetricKey) ?? i[2] ?? i[1] ?? i[0] : void 0, u = new Set(r);
814
- return [a, c, s].filter((l) => !!l).filter((l) => u.has(l));
640
+ function rr(e) {
641
+ const { chartType: t, resultKeys: r, config: o } = e, n = 1 + (o != null && o.enableGrouping && (o.groupKey || r[1]) ? 1 : 0), i = r.slice(n), a = (o == null ? void 0 : o.xMetricKey) ?? i[0], c = (o == null ? void 0 : o.yMetricKey) ?? i[1] ?? i[0], s = t === "bubble" ? (o == null ? void 0 : o.radiusMetricKey) ?? i[2] ?? i[1] ?? i[0] : void 0, u = new Set(r);
642
+ return [a, c, s].filter((m) => !!m).filter((m) => u.has(m));
815
643
  }
816
- function wn(e) {
817
- const { chartType: t, resultKeys: r, preferences: n } = e;
644
+ function yo(e) {
645
+ const { chartType: t, resultKeys: r, preferences: o } = e;
818
646
  return t === "scatter" || t === "bubble" ? [
819
647
  ...new Set(
820
- dr({
648
+ rr({
821
649
  chartType: t,
822
650
  resultKeys: r,
823
- config: n == null ? void 0 : n.bubbleScatterConfig
651
+ config: o == null ? void 0 : o.bubbleScatterConfig
824
652
  })
825
653
  )
826
- ] : lr.has(t || "") ? r.slice(2) : r.length === 1 ? [r[0]] : r.slice(1);
654
+ ] : tr.has(t || "") ? r.slice(2) : r.length === 1 ? [r[0]] : r.slice(1);
827
655
  }
828
- function _(e, t) {
656
+ function E(e, t) {
829
657
  var r;
830
- return ((r = t == null ? void 0 : t.chartOptions) == null ? void 0 : r.indexAxis) === "y" || cr.has(e || "") ? "x" : "y";
658
+ return ((r = t == null ? void 0 : t.chartOptions) == null ? void 0 : r.indexAxis) === "y" || Jt.has(e || "") ? "x" : "y";
831
659
  }
832
- function Dn(e, t) {
833
- return _(e, t) === "x";
660
+ function go(e, t) {
661
+ return E(e, t) === "x";
834
662
  }
835
- function mr(e, t) {
836
- return _(e, t) === "y" ? t == null ? void 0 : t.yAxisConfig : (t == null ? void 0 : t.xAxisConfig) || (ur.has(e || "") ? t == null ? void 0 : t.yAxisConfig : void 0);
663
+ function or(e, t) {
664
+ return E(e, t) === "y" ? t == null ? void 0 : t.yAxisConfig : (t == null ? void 0 : t.xAxisConfig) || (er.has(e || "") ? t == null ? void 0 : t.yAxisConfig : void 0);
837
665
  }
838
666
  function K(e) {
839
667
  return e ? Object.entries(e).some(([t, r]) => r == null || r === "" ? !1 : t === "type" ? r !== "auto" : !0) : !1;
840
668
  }
841
- function Ne(e) {
669
+ function Be(e) {
842
670
  if (e)
843
671
  return e.alias || e.label || e.name;
844
672
  }
845
- function te(e, t) {
846
- var n;
847
- return (((n = e == null ? void 0 : e.config) == null ? void 0 : n.metricColumns) || []).find((o) => {
848
- const i = Ne(o);
849
- return t.metricId && o.id === t.metricId || t.metricAlias && i === t.metricAlias || t.metricAlias && o.alias === t.metricAlias || t.columnId && i === t.columnId || t.columnId && o.alias === t.columnId || t.columnId && o.label === t.columnId || t.columnId && o.name === t.columnId;
673
+ function J(e, t) {
674
+ var o;
675
+ return (((o = e == null ? void 0 : e.config) == null ? void 0 : o.metricColumns) || []).find((n) => {
676
+ const i = Be(n);
677
+ return t.metricId && n.id === t.metricId || t.metricAlias && i === t.metricAlias || t.metricAlias && n.alias === t.metricAlias || t.columnId && i === t.columnId || t.columnId && n.alias === t.columnId || t.columnId && n.label === t.columnId || t.columnId && n.name === t.columnId;
850
678
  });
851
679
  }
852
- function N(e, t) {
853
- var n, o;
854
- const r = ee(e, t);
855
- if (!(r && ((o = (n = e == null ? void 0 : e.config) == null ? void 0 : n.groupByColumns) != null && o.includes(r)) && !Yt(r)))
680
+ function _(e, t) {
681
+ var o, n;
682
+ const r = Q(e, t);
683
+ if (!(r && ((n = (o = e == null ? void 0 : e.config) == null ? void 0 : o.groupByColumns) != null && n.includes(r)) && !Lt(r)))
856
684
  return r;
857
685
  }
858
- function fr(e) {
859
- return !!e && !(e != null && e.format) && yt(e == null ? void 0 : e.dataType) === "number";
686
+ function nr(e) {
687
+ return !!e && !(e != null && e.format) && st(e == null ? void 0 : e.dataType) === "number";
860
688
  }
861
- const yr = {
689
+ const ir = {
862
690
  style: "decimal",
863
691
  showDataBar: !1,
864
692
  dataBarColor: "#3b82f6"
865
693
  };
866
- function Ve(e) {
694
+ function Ke(e) {
867
695
  if (!e)
868
696
  return;
869
- const t = ie();
697
+ const t = re();
870
698
  return {
871
699
  ...t,
872
700
  ...e,
873
701
  inheritMetricFormat: e.numberFormat ? e.inheritMetricFormat : e.inheritMetricFormat ?? t.inheritMetricFormat,
874
702
  numberFormat: {
875
- ...yr,
703
+ ...ir,
876
704
  ...e.numberFormat
877
705
  },
878
706
  dateFormat: {
@@ -885,46 +713,46 @@ function Ve(e) {
885
713
  }
886
714
  };
887
715
  }
888
- function Bn(e) {
716
+ function bo(e) {
889
717
  return Object.fromEntries(
890
718
  Object.entries(e || {}).map(([t, r]) => [
891
719
  t,
892
- Ve(r)
720
+ Ke(r)
893
721
  ])
894
722
  );
895
723
  }
896
- function k(e) {
724
+ function V(e) {
897
725
  return !!(e && typeof e == "object" && !Array.isArray(e) && Object.getPrototypeOf(e) === Object.prototype);
898
726
  }
899
- function ke(e, t, r) {
900
- if (!k(r))
727
+ function Re(e, t, r) {
728
+ if (!V(r))
901
729
  return r;
902
- const n = k(e) ? e : {}, o = k(t) ? t : {}, i = {};
730
+ const o = V(e) ? e : {}, n = V(t) ? t : {}, i = {};
903
731
  for (const a of Object.keys(r)) {
904
732
  const c = r[a];
905
733
  if (c === void 0)
906
734
  continue;
907
735
  const s = Object.prototype.hasOwnProperty.call(
908
- n,
736
+ o,
909
737
  a
910
- ), u = o[a];
911
- if (s && q(c, u)) {
912
- i[a] = n[a];
738
+ ), u = n[a];
739
+ if (s && L(c, u)) {
740
+ i[a] = o[a];
913
741
  continue;
914
742
  }
915
- if (!s && q(c, u))
743
+ if (!s && L(c, u))
916
744
  continue;
917
- const l = ke(
918
- n[a],
745
+ const m = Re(
746
+ o[a],
919
747
  u,
920
748
  c
921
749
  );
922
- k(l) && Object.keys(l).length === 0 && !s || (i[a] = l);
750
+ V(m) && Object.keys(m).length === 0 && !s || (i[a] = m);
923
751
  }
924
752
  return i;
925
753
  }
926
- function gr(e) {
927
- let t = ke(
754
+ function ar(e) {
755
+ let t = Re(
928
756
  e.persisted,
929
757
  e.baseline,
930
758
  e.next
@@ -932,11 +760,11 @@ function gr(e) {
932
760
  if (e.enforceDeclaredSqlTemporalFormat && e.next.type === "date" && !e.next.dateFormat.useRelativeTime && e.next.dateFormat.useCustomFormat) {
933
761
  const r = e.next.dateFormat.customFormat;
934
762
  if (!(r != null && r.trim()))
935
- throw new It(
763
+ throw new bt(
936
764
  "invalid_raw_temporal_format",
937
765
  "Custom table date formatting requires a non-empty pattern."
938
766
  );
939
- Mt({
767
+ Ft({
940
768
  dialect: "date_fns",
941
769
  pattern: r,
942
770
  valueKind: e.rawTemporalValueKind
@@ -949,7 +777,7 @@ function gr(e) {
949
777
  }
950
778
  };
951
779
  }
952
- return e.next.type === "number" && !q(e.next.numberFormat, e.baseline.numberFormat) && t.numberFormat ? {
780
+ return e.next.type === "number" && !L(e.next.numberFormat, e.baseline.numberFormat) && t.numberFormat ? {
953
781
  ...t,
954
782
  type: "number",
955
783
  inheritMetricFormat: e.next.inheritMetricFormat ?? !1
@@ -962,10 +790,10 @@ function gr(e) {
962
790
  type: "date"
963
791
  } : t;
964
792
  }
965
- function Rn(e) {
966
- return e.reset ? br(e.persisted, e.columnId) : {
793
+ function Fo(e) {
794
+ return e.reset ? sr(e.persisted, e.columnId) : {
967
795
  ...e.persisted,
968
- [e.columnId]: gr({
796
+ [e.columnId]: ar({
969
797
  persisted: e.persisted[e.columnId],
970
798
  baseline: e.baseline,
971
799
  next: e.next,
@@ -975,22 +803,22 @@ function Rn(e) {
975
803
  })
976
804
  };
977
805
  }
978
- function br(e, t) {
806
+ function sr(e, t) {
979
807
  if (!(t in e))
980
808
  return e;
981
809
  const r = { ...e };
982
810
  return delete r[t], r;
983
811
  }
984
- function Fr(e, t) {
985
- const r = e || ie(), n = !t;
812
+ function cr(e, t) {
813
+ const r = e || re(), o = !t;
986
814
  return {
987
815
  ...r,
988
816
  type: "number",
989
817
  textAlign: r.type === "none" ? "right" : r.textAlign,
990
818
  numberFormat: {
991
819
  style: "decimal",
992
- minimumFractionDigits: n ? r.numberFormat.minimumFractionDigits : void 0,
993
- maximumFractionDigits: n ? r.numberFormat.maximumFractionDigits : void 0,
820
+ minimumFractionDigits: o ? r.numberFormat.minimumFractionDigits : void 0,
821
+ maximumFractionDigits: o ? r.numberFormat.maximumFractionDigits : void 0,
994
822
  useGrouping: r.numberFormat.useGrouping,
995
823
  showDataBar: r.numberFormat.showDataBar,
996
824
  showHeatmap: r.numberFormat.showHeatmap,
@@ -1000,123 +828,123 @@ function Fr(e, t) {
1000
828
  }
1001
829
  };
1002
830
  }
1003
- function J(e) {
831
+ function Y(e) {
1004
832
  if (e)
1005
833
  return e.trim().toLowerCase();
1006
834
  }
1007
- const Le = /\s*(?:\((?:previous|last year|start|target|comparison)\)|δ)\s*$/i;
1008
- function pr(e) {
835
+ const Ee = /\s*(?:\((?:previous|last year|start|target|comparison)\)|δ)\s*$/i;
836
+ function ur(e) {
1009
837
  const t = e == null ? void 0 : e.trim();
1010
- return t ? t.replace(Le, "").trim() || t : void 0;
838
+ return t ? t.replace(Ee, "").trim() || t : void 0;
1011
839
  }
1012
- function vr(e) {
840
+ function lr(e) {
1013
841
  const t = e == null ? void 0 : e.trim();
1014
- return t ? Le.test(t) : !1;
842
+ return t ? Ee.test(t) : !1;
1015
843
  }
1016
- function hr(e, t) {
844
+ function mr(e, t) {
1017
845
  return t.metricAlias ? e.find(
1018
- (r) => Ft(r) === t.metricAlias
846
+ (r) => lt(r) === t.metricAlias
1019
847
  ) : t.metricId ? e.find((r) => r.id === t.metricId) : void 0;
1020
848
  }
1021
- function Cr(e) {
1022
- var p;
849
+ function dr(e) {
850
+ var b;
1023
851
  const {
1024
852
  card: t,
1025
853
  metricId: r,
1026
- metricAlias: n,
1027
- datasetIndex: o,
854
+ metricAlias: o,
855
+ datasetIndex: n,
1028
856
  datasetLabel: i,
1029
857
  metricKey: a
1030
- } = e, c = ((p = t == null ? void 0 : t.config) == null ? void 0 : p.metricColumns) || [];
1031
- if (n || r)
1032
- return hr(c, {
1033
- metricAlias: n,
858
+ } = e, c = ((b = t == null ? void 0 : t.config) == null ? void 0 : b.metricColumns) || [];
859
+ if (o || r)
860
+ return mr(c, {
861
+ metricAlias: o,
1034
862
  metricId: r
1035
863
  });
1036
864
  const s = [a, i], u = s.some(
1037
- (d) => vr(d)
1038
- ), l = s.filter(
1039
- (d) => !!d
865
+ (l) => lr(l)
866
+ ), m = s.filter(
867
+ (l) => !!l
1040
868
  );
1041
- for (const d of l) {
1042
- const b = te(t, {
1043
- columnId: d,
1044
- metricAlias: d
869
+ for (const l of m) {
870
+ const g = J(t, {
871
+ columnId: l,
872
+ metricAlias: l
1045
873
  });
1046
- if (b)
1047
- return b;
874
+ if (g)
875
+ return g;
1048
876
  }
1049
- const m = l.map((d) => J(d)).filter((d) => !!d), f = l.map((d) => pr(d)).filter((d) => !!d);
1050
- for (const d of f) {
1051
- const b = te(t, {
1052
- columnId: d,
1053
- metricAlias: d
877
+ const d = m.map((l) => Y(l)).filter((l) => !!l), f = m.map((l) => ur(l)).filter((l) => !!l);
878
+ for (const l of f) {
879
+ const g = J(t, {
880
+ columnId: l,
881
+ metricAlias: l
1054
882
  });
1055
- if (b)
1056
- return b;
883
+ if (g)
884
+ return g;
1057
885
  }
1058
886
  if (c.length === 1)
1059
887
  return c[0];
1060
- if (!u && typeof o == "number" && o >= 0 && o < c.length)
1061
- return c[o];
1062
- const g = f.map((d) => J(d)).filter((d) => !!d), F = [
1063
- ...m,
1064
- ...g
888
+ if (!u && typeof n == "number" && n >= 0 && n < c.length)
889
+ return c[n];
890
+ const x = f.map((l) => Y(l)).filter((l) => !!l), v = [
891
+ ...d,
892
+ ...x
1065
893
  ];
1066
- if (F.length !== 0)
1067
- return c.find((d) => {
1068
- const b = [
1069
- d.alias,
1070
- d.label,
1071
- d.name,
1072
- Ne(d)
1073
- ].map((C) => J(C)).filter((C) => !!C);
1074
- return F.some(
1075
- (C) => b.includes(C)
894
+ if (v.length !== 0)
895
+ return c.find((l) => {
896
+ const g = [
897
+ l.alias,
898
+ l.label,
899
+ l.name,
900
+ Be(l)
901
+ ].map((h) => Y(h)).filter((h) => !!h);
902
+ return v.some(
903
+ (h) => g.includes(h)
1076
904
  );
1077
905
  });
1078
906
  }
1079
- function xr(e) {
1080
- const t = E(e == null ? void 0 : e.format);
1081
- return T(t);
907
+ function fr(e) {
908
+ const t = R(e == null ? void 0 : e.format);
909
+ return S(t);
1082
910
  }
1083
- function ve(e, t) {
911
+ function be(e, t) {
1084
912
  if (t)
1085
- return te(e, {
913
+ return J(e, {
1086
914
  columnId: t,
1087
915
  metricAlias: t
1088
916
  });
1089
917
  }
1090
- function he(e) {
1091
- const t = Ie(e);
918
+ function Fe(e) {
919
+ const t = Ce(e);
1092
920
  if (t)
1093
921
  return JSON.stringify(t);
1094
922
  }
1095
- function Ir(e, t) {
1096
- const r = he(e), n = he(t);
1097
- return !!(r && n && r === n);
923
+ function yr(e, t) {
924
+ const r = Fe(e), o = Fe(t);
925
+ return !!(r && o && r === o);
1098
926
  }
1099
- function Mr(e) {
927
+ function gr(e) {
1100
928
  if (e.length === 0)
1101
929
  return;
1102
930
  const t = e.map(
1103
- (a) => xr(a)
931
+ (a) => fr(a)
1104
932
  );
1105
933
  if (!t.every(
1106
934
  (a) => K(a)
1107
935
  ))
1108
936
  return;
1109
- const n = t, [o] = n;
1110
- return n.every(
1111
- (a) => Ir(o, a)
1112
- ) ? o : void 0;
937
+ const o = t, [n] = o;
938
+ return o.every(
939
+ (a) => yr(n, a)
940
+ ) ? n : void 0;
1113
941
  }
1114
- function Pr(e) {
942
+ function br(e) {
1115
943
  const t = e.formatMode || e.legacyMode;
1116
944
  return t === "override" ? "override" : t === "inherit" ? "inherit" : e.legacyMode && e.legacyMode !== "auto" && e.legacyMode !== "inherit" && e.legacyMode !== "override" || K(e.formatOptions) ? "override" : "inherit";
1117
945
  }
1118
- function H(e) {
1119
- const t = Pr({
946
+ function j(e) {
947
+ const t = br({
1120
948
  formatMode: e.formatMode,
1121
949
  legacyMode: e.legacyMode,
1122
950
  formatOptions: e.overrideFormatOptions
@@ -1132,7 +960,7 @@ function H(e) {
1132
960
  source: "override",
1133
961
  rawValue: !0
1134
962
  };
1135
- const r = Mr(
963
+ const r = gr(
1136
964
  e.metrics || []
1137
965
  );
1138
966
  if (K(r))
@@ -1140,55 +968,55 @@ function H(e) {
1140
968
  formatOptions: r,
1141
969
  source: "metric"
1142
970
  };
1143
- const n = Br(e.preferences);
1144
- return K(n) ? {
1145
- formatOptions: n,
971
+ const o = Mr(e.preferences);
972
+ return K(o) ? {
973
+ formatOptions: o,
1146
974
  source: "legacy"
1147
975
  } : {
1148
976
  formatOptions: void 0,
1149
977
  source: "auto"
1150
978
  };
1151
979
  }
1152
- function qe(e) {
1153
- var s, u, l;
1154
- const { card: t, chartType: r, axis: n, preferences: o } = e, i = ((s = t == null ? void 0 : t.config) == null ? void 0 : s.metricColumns) || [], a = (o == null ? void 0 : o.datasetOptions) || [];
980
+ function _e(e) {
981
+ var s, u, m;
982
+ const { card: t, chartType: r, axis: o, preferences: n } = e, i = ((s = t == null ? void 0 : t.config) == null ? void 0 : s.metricColumns) || [], a = (n == null ? void 0 : n.datasetOptions) || [];
1155
983
  if (!i.length)
1156
984
  return [];
1157
985
  if (r === "combo")
1158
- return n === "x" ? [] : i.filter((m, f) => {
1159
- const g = a.find((p) => p.idx === f);
1160
- return ((g == null ? void 0 : g.yAxisId) === "y2" ? "y2" : "y") === n;
986
+ return o === "x" ? [] : i.filter((d, f) => {
987
+ const x = a.find((b) => b.idx === f);
988
+ return ((x == null ? void 0 : x.yAxisId) === "y2" ? "y2" : "y") === o;
1161
989
  });
1162
990
  if (r === "bubble" || r === "scatter") {
1163
- if (n === "y2")
991
+ if (o === "y2")
1164
992
  return [];
1165
- const m = ve(
993
+ const d = be(
1166
994
  t,
1167
- (u = o == null ? void 0 : o.bubbleScatterConfig) == null ? void 0 : u.xMetricKey
1168
- ) || i[0], f = ve(
995
+ (u = n == null ? void 0 : n.bubbleScatterConfig) == null ? void 0 : u.xMetricKey
996
+ ) || i[0], f = be(
1169
997
  t,
1170
- (l = o == null ? void 0 : o.bubbleScatterConfig) == null ? void 0 : l.yMetricKey
998
+ (m = n == null ? void 0 : n.bubbleScatterConfig) == null ? void 0 : m.yMetricKey
1171
999
  ) || i[1] || i[0];
1172
- return n === "x" ? m ? [m] : [] : f ? [f] : [];
1000
+ return o === "x" ? d ? [d] : [] : f ? [f] : [];
1173
1001
  }
1174
- const c = _(r, o);
1175
- return r === "radar" ? n === "y" ? i : [] : n !== c ? [] : i;
1002
+ const c = E(r, n);
1003
+ return r === "radar" ? o === "y" ? i : [] : o !== c ? [] : i;
1176
1004
  }
1177
- function se(e) {
1178
- const { card: t, chartType: r, axis: n, preferences: o, axisConfig: i } = e, a = qe({
1005
+ function ne(e) {
1006
+ const { card: t, chartType: r, axis: o, preferences: n, axisConfig: i } = e, a = _e({
1179
1007
  card: t,
1180
1008
  chartType: r,
1181
- axis: n,
1182
- preferences: o
1183
- }), c = H({
1009
+ axis: o,
1010
+ preferences: n
1011
+ }), c = j({
1184
1012
  formatMode: i == null ? void 0 : i.formatMode,
1185
1013
  overrideFormatOptions: i == null ? void 0 : i.formatOptions,
1186
1014
  metrics: a,
1187
- preferences: o
1015
+ preferences: n
1188
1016
  });
1189
1017
  return {
1190
1018
  ...c,
1191
- formatOptions: z({
1019
+ formatOptions: H({
1192
1020
  card: t,
1193
1021
  metrics: a,
1194
1022
  formatOptions: c.formatOptions,
@@ -1196,7 +1024,7 @@ function se(e) {
1196
1024
  })
1197
1025
  };
1198
1026
  }
1199
- function je(e, t) {
1027
+ function Ne(e, t) {
1200
1028
  if (!e && (!t || t === "auto" || t === "none"))
1201
1029
  return;
1202
1030
  const r = {
@@ -1204,32 +1032,32 @@ function je(e, t) {
1204
1032
  };
1205
1033
  return t && t !== "auto" && t !== "none" && !r.type && (r.type = t), r;
1206
1034
  }
1207
- function Tr(e) {
1208
- const { preferences: t, metric: r } = e, n = t == null ? void 0 : t.tooltipConfig, o = H({
1209
- formatMode: n == null ? void 0 : n.formatMode,
1210
- legacyMode: n == null ? void 0 : n.mode,
1211
- overrideFormatOptions: n == null ? void 0 : n.formatOptions,
1035
+ function Fr(e) {
1036
+ const { preferences: t, metric: r } = e, o = t == null ? void 0 : t.tooltipConfig, n = j({
1037
+ formatMode: o == null ? void 0 : o.formatMode,
1038
+ legacyMode: o == null ? void 0 : o.mode,
1039
+ overrideFormatOptions: o == null ? void 0 : o.formatOptions,
1212
1040
  metrics: r ? [r] : [],
1213
1041
  preferences: t
1214
1042
  });
1215
1043
  return {
1216
- ...o,
1217
- formatOptions: z({
1044
+ ...n,
1045
+ formatOptions: H({
1218
1046
  card: e.card,
1219
1047
  metrics: e.metric ? [e.metric] : [],
1220
- formatOptions: o.formatOptions,
1048
+ formatOptions: n.formatOptions,
1221
1049
  context: e.numericPresentation
1222
1050
  })
1223
1051
  };
1224
1052
  }
1225
- function ce(e, t, r) {
1226
- return t === _(r, e) ? mr(r, e) : t === "x" ? e == null ? void 0 : e.xAxisConfig : t === "y2" ? e == null ? void 0 : e.secondaryYAxisConfig : e == null ? void 0 : e.yAxisConfig;
1053
+ function ie(e, t, r) {
1054
+ return t === E(r, e) ? or(r, e) : t === "x" ? e == null ? void 0 : e.xAxisConfig : t === "y2" ? e == null ? void 0 : e.secondaryYAxisConfig : e == null ? void 0 : e.yAxisConfig;
1227
1055
  }
1228
- function ue(e) {
1056
+ function ae(e) {
1229
1057
  const { chartType: t, preferences: r } = e;
1230
- return t === "bubble" || t === "scatter" ? "y" : _(t, r);
1058
+ return t === "bubble" || t === "scatter" ? "y" : E(t, r);
1231
1059
  }
1232
- function ze(e) {
1060
+ function Ve(e) {
1233
1061
  switch (e) {
1234
1062
  case "pie":
1235
1063
  case "doughnut":
@@ -1242,99 +1070,99 @@ function ze(e) {
1242
1070
  return !0;
1243
1071
  }
1244
1072
  }
1245
- function Kn(e) {
1246
- const { card: t, chartType: r, preferences: n, metric: o } = e, i = Tr({
1073
+ function vo(e) {
1074
+ const { card: t, chartType: r, preferences: o, metric: n } = e, i = Fr({
1247
1075
  card: t,
1248
- preferences: n,
1249
- metric: o,
1076
+ preferences: o,
1077
+ metric: n,
1250
1078
  numericPresentation: e.numericPresentation
1251
1079
  });
1252
1080
  if (i.source === "override")
1253
1081
  return i;
1254
- const a = e.axis || ue({ chartType: r, preferences: n }), c = se({
1082
+ const a = e.axis || ae({ chartType: r, preferences: o }), c = ne({
1255
1083
  card: t,
1256
1084
  chartType: r,
1257
1085
  axis: a,
1258
- preferences: n,
1259
- axisConfig: ce(n, a, r),
1086
+ preferences: o,
1087
+ axisConfig: ie(o, a, r),
1260
1088
  numericPresentation: e.numericPresentation
1261
1089
  });
1262
1090
  return c.source === "override" ? c : i;
1263
1091
  }
1264
- function En(e) {
1265
- const { card: t, chartType: r, preferences: n, dataLabelsConfig: o } = e, i = r || (t == null ? void 0 : t.type), a = ue({
1092
+ function xo(e) {
1093
+ const { card: t, chartType: r, preferences: o, dataLabelsConfig: n } = e, i = r || (t == null ? void 0 : t.type), a = ae({
1266
1094
  chartType: i,
1267
- preferences: n
1268
- }), c = qe({
1095
+ preferences: o
1096
+ }), c = _e({
1269
1097
  card: t,
1270
1098
  chartType: i,
1271
1099
  axis: a,
1272
- preferences: n
1273
- }), s = H({
1274
- formatMode: o == null ? void 0 : o.formatMode,
1275
- legacyMode: o == null ? void 0 : o.format,
1276
- overrideFormatOptions: je(
1277
- o == null ? void 0 : o.formatOptions,
1278
- o == null ? void 0 : o.format
1100
+ preferences: o
1101
+ }), s = j({
1102
+ formatMode: n == null ? void 0 : n.formatMode,
1103
+ legacyMode: n == null ? void 0 : n.format,
1104
+ overrideFormatOptions: Ne(
1105
+ n == null ? void 0 : n.formatOptions,
1106
+ n == null ? void 0 : n.format
1279
1107
  ),
1280
1108
  metrics: c,
1281
- preferences: n
1109
+ preferences: o
1282
1110
  }), u = {
1283
1111
  ...s,
1284
- formatOptions: z({
1112
+ formatOptions: H({
1285
1113
  card: t,
1286
1114
  metrics: c,
1287
1115
  formatOptions: s.formatOptions,
1288
1116
  context: e.numericPresentation
1289
1117
  })
1290
1118
  };
1291
- if (u.source === "override" || !ze(i))
1119
+ if (u.source === "override" || !Ve(i))
1292
1120
  return u;
1293
- const l = se({
1121
+ const m = ne({
1294
1122
  card: t,
1295
1123
  chartType: i,
1296
1124
  axis: a,
1297
- preferences: n,
1298
- axisConfig: ce(
1299
- n,
1125
+ preferences: o,
1126
+ axisConfig: ie(
1127
+ o,
1300
1128
  a,
1301
1129
  i
1302
1130
  ),
1303
1131
  numericPresentation: e.numericPresentation
1304
1132
  });
1305
- return l.source === "override" ? l : u;
1133
+ return m.source === "override" ? m : u;
1306
1134
  }
1307
- function Or(e) {
1308
- const { preferences: t, dataLabelsConfig: r, metric: n } = e, o = H({
1135
+ function vr(e) {
1136
+ const { preferences: t, dataLabelsConfig: r, metric: o } = e, n = j({
1309
1137
  formatMode: r == null ? void 0 : r.formatMode,
1310
1138
  legacyMode: r == null ? void 0 : r.format,
1311
- overrideFormatOptions: je(
1139
+ overrideFormatOptions: Ne(
1312
1140
  r == null ? void 0 : r.formatOptions,
1313
1141
  r == null ? void 0 : r.format
1314
1142
  ),
1315
- metrics: n ? [n] : [],
1143
+ metrics: o ? [o] : [],
1316
1144
  preferences: t
1317
1145
  });
1318
1146
  return {
1319
- ...o,
1320
- formatOptions: z({
1147
+ ...n,
1148
+ formatOptions: H({
1321
1149
  card: e.card,
1322
1150
  metrics: e.metric ? [e.metric] : [],
1323
- formatOptions: o.formatOptions,
1151
+ formatOptions: n.formatOptions,
1324
1152
  context: e.numericPresentation
1325
1153
  })
1326
1154
  };
1327
1155
  }
1328
- function _n(e) {
1156
+ function Co(e) {
1329
1157
  var a, c;
1330
- const t = Cr({
1158
+ const t = dr({
1331
1159
  card: e.card,
1332
1160
  metricId: e.metricId,
1333
1161
  metricAlias: e.metricAlias,
1334
1162
  datasetIndex: e.datasetIndex,
1335
1163
  datasetLabel: e.datasetLabel,
1336
1164
  metricKey: e.metricKey
1337
- }), r = Or({
1165
+ }), r = vr({
1338
1166
  card: e.card,
1339
1167
  preferences: e.preferences,
1340
1168
  dataLabelsConfig: e.dataLabelsConfig,
@@ -1343,52 +1171,52 @@ function _n(e) {
1343
1171
  });
1344
1172
  if (r.source === "override")
1345
1173
  return r;
1346
- const n = (a = e.card) == null ? void 0 : a.type;
1347
- if (!ze(n))
1174
+ const o = (a = e.card) == null ? void 0 : a.type;
1175
+ if (!Ve(o))
1348
1176
  return r;
1349
- let o = ue({
1350
- chartType: n,
1177
+ let n = ae({
1178
+ chartType: o,
1351
1179
  preferences: e.preferences
1352
1180
  });
1353
- if (n === "combo" && typeof e.datasetIndex == "number") {
1181
+ if (o === "combo" && typeof e.datasetIndex == "number") {
1354
1182
  const u = (((c = e.preferences) == null ? void 0 : c.datasetOptions) || []).find(
1355
- (l) => l.idx === e.datasetIndex
1183
+ (m) => m.idx === e.datasetIndex
1356
1184
  );
1357
- o = (u == null ? void 0 : u.yAxisId) === "y2" ? "y2" : "y";
1185
+ n = (u == null ? void 0 : u.yAxisId) === "y2" ? "y2" : "y";
1358
1186
  }
1359
- const i = se({
1187
+ const i = ne({
1360
1188
  card: e.card,
1361
- chartType: n,
1362
- axis: o,
1189
+ chartType: o,
1190
+ axis: n,
1363
1191
  preferences: e.preferences,
1364
- axisConfig: ce(
1192
+ axisConfig: ie(
1365
1193
  e.preferences,
1366
- o,
1367
- n
1194
+ n,
1195
+ o
1368
1196
  ),
1369
1197
  numericPresentation: e.numericPresentation
1370
1198
  });
1371
1199
  return i.source === "override" ? i : r;
1372
1200
  }
1373
- function Nn(e) {
1201
+ function ho(e) {
1374
1202
  return (e == null ? void 0 : e.rawValue) === !0;
1375
1203
  }
1376
- function Sr(e) {
1204
+ function xr(e) {
1377
1205
  const t = e == null ? void 0 : e.numberFormat;
1378
1206
  if (!t)
1379
1207
  return;
1380
1208
  if (t.style === "duration")
1381
- return T(re(t), {
1209
+ return S(ee(t), {
1382
1210
  preserveOmittedProperties: !0
1383
1211
  });
1384
- const r = t.style === "currency" ? "currency" : t.style === "percent" ? "percent" : t.style === "scientific" ? "scientific" : "number", n = t.minimumFractionDigits, o = t.maximumFractionDigits;
1212
+ const r = t.style === "currency" ? "currency" : t.style === "percent" ? "percent" : t.style === "scientific" ? "scientific" : "number", o = t.minimumFractionDigits, n = t.maximumFractionDigits;
1385
1213
  return {
1386
1214
  type: r,
1387
1215
  currency: r === "currency" ? t.currency : void 0,
1388
1216
  locale: t.locale,
1389
- decimalPlaces: n === o ? o : void 0,
1390
- minimumFractionDigits: n,
1391
- maximumFractionDigits: o,
1217
+ decimalPlaces: o === n ? n : void 0,
1218
+ minimumFractionDigits: o,
1219
+ maximumFractionDigits: n,
1392
1220
  useGrouping: t.useGrouping,
1393
1221
  percentValueMode: r === "percent" ? t.percentValueMode : void 0,
1394
1222
  multiplyBy: t.scale,
@@ -1398,14 +1226,14 @@ function Sr(e) {
1398
1226
  suffix: t.suffix
1399
1227
  };
1400
1228
  }
1401
- function Ar(e, t, r = !1) {
1402
- const n = r ? { preserveOmittedProperties: !0 } : void 0, o = E(e == null ? void 0 : e.format, n), i = Me(
1403
- o,
1404
- n
1229
+ function Cr(e, t, r = !1) {
1230
+ const o = r ? { preserveOmittedProperties: !0 } : void 0, n = R(e == null ? void 0 : e.format, o), i = he(
1231
+ n,
1232
+ o
1405
1233
  );
1406
1234
  if (!i)
1407
1235
  return;
1408
- const a = t || ie(), c = r ? {
1236
+ const a = t || re(), c = r ? {
1409
1237
  showDataBar: a.numberFormat.showDataBar,
1410
1238
  showHeatmap: a.numberFormat.showHeatmap,
1411
1239
  dataBarColor: a.numberFormat.dataBarColor,
@@ -1428,110 +1256,110 @@ function Ar(e, t, r = !1) {
1428
1256
  }
1429
1257
  };
1430
1258
  }
1431
- function He(e) {
1432
- var v, h, S, w;
1259
+ function qe(e) {
1260
+ var F, C, O, w;
1433
1261
  const {
1434
1262
  card: t,
1435
1263
  columnId: r,
1436
- persistedSettings: n,
1437
- resolvedSettings: o,
1264
+ persistedSettings: o,
1265
+ resolvedSettings: n,
1438
1266
  fallbackSettings: i,
1439
1267
  metricId: a,
1440
1268
  metricAlias: c,
1441
1269
  fieldId: s,
1442
1270
  fieldRole: u,
1443
- columnKeyMap: l,
1444
- valueFormatPreferences: m,
1271
+ columnKeyMap: m,
1272
+ valueFormatPreferences: d,
1445
1273
  boundCurrency: f,
1446
- preserveOmittedProperties: g
1447
- } = e, F = n ?? ((S = (h = (v = t == null ? void 0 : t.preferences) == null ? void 0 : v.tablePrefs) == null ? void 0 : h.columnSettingsMap) == null ? void 0 : S[r]), p = !((w = t == null ? void 0 : t.sql) != null && w.trim()) || Je(F), d = p ? m : null, b = p ? f : void 0, C = Qe(
1448
- F == null ? void 0 : F.numberFormat
1449
- ), x = o ?? Ve(F);
1450
- if (x && x.inheritMetricFormat !== !0)
1451
- return Ce(
1452
- x,
1453
- d,
1454
- b,
1274
+ preserveOmittedProperties: x
1275
+ } = e, v = o ?? ((O = (C = (F = t == null ? void 0 : t.preferences) == null ? void 0 : F.tablePrefs) == null ? void 0 : C.columnSettingsMap) == null ? void 0 : O[r]), b = !((w = t == null ? void 0 : t.sql) != null && w.trim()) || Ue(v), l = b ? d : null, g = b ? f : void 0, h = ke(
1276
+ v == null ? void 0 : v.numberFormat
1277
+ ), p = n ?? Ke(v);
1278
+ if (p && p.inheritMetricFormat !== !0)
1279
+ return ve(
1280
+ p,
1281
+ l,
1282
+ g,
1455
1283
  {
1456
- preserveHistoricalPersistedPrecision: C
1284
+ preserveHistoricalPersistedPrecision: h
1457
1285
  }
1458
1286
  );
1459
- const O = N(t, {
1287
+ const T = _(t, {
1460
1288
  columnId: r,
1461
1289
  metricId: a,
1462
1290
  metricAlias: c,
1463
- columnKeyMap: l,
1291
+ columnKeyMap: m,
1464
1292
  fieldId: s,
1465
1293
  fieldRole: u
1466
- }), A = Ar(
1467
- O,
1468
- x || i,
1469
- g ?? !!m
1470
- ), R = !A && d && fr(O) ? Fr(
1471
- x || i,
1472
- b
1294
+ }), A = Cr(
1295
+ T,
1296
+ p || i,
1297
+ x ?? !!d
1298
+ ), B = !A && l && nr(T) ? cr(
1299
+ p || i,
1300
+ g
1473
1301
  ) : void 0;
1474
- return Ce(
1475
- A || R || x || i,
1476
- d,
1477
- b,
1302
+ return ve(
1303
+ A || B || p || i,
1304
+ l,
1305
+ g,
1478
1306
  {
1479
- preserveHistoricalPersistedPrecision: !!(x && C && !A && !R)
1307
+ preserveHistoricalPersistedPrecision: !!(p && h && !A && !B)
1480
1308
  }
1481
1309
  );
1482
1310
  }
1483
- function Ce(e, t, r, n) {
1311
+ function ve(e, t, r, o) {
1484
1312
  if (!e || e.type !== "number" || !t)
1485
1313
  return e;
1486
- const o = e.numberFormat, i = o ? n != null && n.preserveHistoricalPersistedPrecision ? Ze(o) : re(o, {
1314
+ const n = e.numberFormat, i = n ? o != null && o.preserveHistoricalPersistedPrecision ? Ge(n) : ee(n, {
1487
1315
  preserveOmittedProperties: !0
1488
1316
  }) : { type: "number" };
1489
- if (!i || !P(i))
1317
+ if (!i || !I(i))
1490
1318
  return e;
1491
- const a = I(
1319
+ const a = M(
1492
1320
  i,
1493
1321
  t,
1494
1322
  r
1495
- ), c = Me(a, {
1323
+ ), c = he(a, {
1496
1324
  preserveOmittedProperties: !0
1497
1325
  });
1498
1326
  return c ? {
1499
1327
  ...e,
1500
1328
  numberFormat: {
1501
- ...o,
1329
+ ...n,
1502
1330
  ...c,
1503
- showDataBar: (o == null ? void 0 : o.showDataBar) ?? c.showDataBar,
1504
- showHeatmap: o == null ? void 0 : o.showHeatmap,
1505
- dataBarColor: (o == null ? void 0 : o.dataBarColor) ?? c.dataBarColor,
1506
- dataBarMinValue: o == null ? void 0 : o.dataBarMinValue,
1507
- dataBarMaxValue: o == null ? void 0 : o.dataBarMaxValue
1331
+ showDataBar: (n == null ? void 0 : n.showDataBar) ?? c.showDataBar,
1332
+ showHeatmap: n == null ? void 0 : n.showHeatmap,
1333
+ dataBarColor: (n == null ? void 0 : n.dataBarColor) ?? c.dataBarColor,
1334
+ dataBarMinValue: n == null ? void 0 : n.dataBarMinValue,
1335
+ dataBarMaxValue: n == null ? void 0 : n.dataBarMaxValue
1508
1336
  }
1509
1337
  } : e;
1510
1338
  }
1511
- function j(e) {
1339
+ function z(e) {
1512
1340
  if (!e.valueFormatPreferences)
1513
1341
  return;
1514
- const t = He(e);
1342
+ const t = qe(e);
1515
1343
  if (!t || t.type !== "number")
1516
1344
  return;
1517
- const r = re(t.numberFormat, {
1345
+ const r = ee(t.numberFormat, {
1518
1346
  preserveOmittedProperties: !0
1519
1347
  });
1520
- if (!(!r || !Te(r)))
1348
+ if (!(!r || !Me(r)))
1521
1349
  return r;
1522
1350
  }
1523
- function wr(e) {
1524
- var n, o;
1351
+ function hr(e) {
1352
+ var o, n;
1525
1353
  if (!e.presentation.preferences)
1526
1354
  return;
1527
- const t = N(e.card, {
1355
+ const t = _(e.card, {
1528
1356
  columnId: e.columnId,
1529
1357
  metricId: e.metricId,
1530
1358
  metricAlias: e.metricAlias,
1531
1359
  columnKeyMap: e.columnKeyMap
1532
1360
  });
1533
1361
  if (e.comparisonValueKind === "percent_change" || e.comparisonValueKind === "ratio") {
1534
- const i = j({
1362
+ const i = z({
1535
1363
  card: e.card,
1536
1364
  columnId: e.columnId,
1537
1365
  persistedSettings: e.persistedSettings,
@@ -1541,7 +1369,7 @@ function wr(e) {
1541
1369
  columnKeyMap: e.columnKeyMap,
1542
1370
  metricAlias: e.metricAlias ?? (t == null ? void 0 : t.alias),
1543
1371
  valueFormatPreferences: e.presentation.preferences
1544
- }), a = rt(e.comparisonPrecision) ?? (P(i) ? i.maximumFractionDigits : void 0) ?? (e.comparisonValueKind === "percent_change" ? 1 : 2);
1372
+ }), a = Ye(e.comparisonPrecision) ?? (I(i) ? i.maximumFractionDigits : void 0) ?? (e.comparisonValueKind === "percent_change" ? 1 : 2);
1545
1373
  return e.comparisonValueKind === "percent_change" ? {
1546
1374
  type: "percent",
1547
1375
  locale: e.presentation.preferences.locale,
@@ -1556,12 +1384,12 @@ function wr(e) {
1556
1384
  suffix: "×"
1557
1385
  };
1558
1386
  }
1559
- const r = nt({
1387
+ const r = Xe({
1560
1388
  card: e.card,
1561
1389
  columnKey: e.columnId,
1562
- metricId: e.metricId ?? (t && !((o = (n = e.card.config) == null ? void 0 : n.groupByColumns) != null && o.includes(t)) ? t.id : void 0)
1390
+ metricId: e.metricId ?? (t && !((n = (o = e.card.config) == null ? void 0 : o.groupByColumns) != null && n.includes(t)) ? t.id : void 0)
1563
1391
  });
1564
- return j({
1392
+ return z({
1565
1393
  card: e.card,
1566
1394
  columnId: e.columnId,
1567
1395
  persistedSettings: e.persistedSettings,
@@ -1574,14 +1402,14 @@ function wr(e) {
1574
1402
  boundCurrency: r ? e.presentation.resolveBoundCurrency(r) : void 0
1575
1403
  });
1576
1404
  }
1577
- function Dr(e) {
1578
- var c, s, u, l, m, f, g;
1405
+ function pr(e) {
1406
+ var c, s, u, m, d, f, x;
1579
1407
  if (e.card.type === "matrixTable" && e.target.kind === "matrix_measure") {
1580
- const F = e.target, p = ot(e.card, e.matrixCatalog).find(
1581
- (b) => b.measureId === F.measureId
1582
- ), d = p == null ? void 0 : p.canonical;
1583
- return d && (d.type === "number" || d.type === "currency") ? I(
1584
- d,
1408
+ const v = e.target, b = Ze(e.card, e.matrixCatalog).find(
1409
+ (g) => g.measureId === v.measureId
1410
+ ), l = b == null ? void 0 : b.canonical;
1411
+ return l && (l.type === "number" || l.type === "currency") ? M(
1412
+ l,
1585
1413
  e.valueFormatPreferences,
1586
1414
  e.boundCurrency
1587
1415
  ) : void 0;
@@ -1589,64 +1417,64 @@ function Dr(e) {
1589
1417
  if (e.target.kind === "matrix_measure")
1590
1418
  return;
1591
1419
  if (e.card.type === "kpi") {
1592
- const F = e.target.kind === "metric" ? e.target.metricId : void 0, p = F ? ((s = (c = e.card.config) == null ? void 0 : c.metricColumns) == null ? void 0 : s.findIndex(
1593
- (C) => C.id === F
1420
+ const v = e.target.kind === "metric" ? e.target.metricId : void 0, b = v ? ((s = (c = e.card.config) == null ? void 0 : c.metricColumns) == null ? void 0 : s.findIndex(
1421
+ (h) => h.id === v
1594
1422
  )) ?? -1 : 0;
1595
- if (p < 0)
1423
+ if (b < 0)
1596
1424
  return;
1597
- const d = it(e.card, {
1598
- metricIndex: p,
1425
+ const l = Qe(e.card, {
1426
+ metricIndex: b,
1599
1427
  resultColumnKey: e.target.kind === "column" ? e.target.columnKey : void 0
1600
- }), b = d.authoredFormat;
1601
- return d.currencyBindable && b && P(b) ? I(
1602
- b,
1428
+ }), g = l.authoredFormat;
1429
+ return l.currencyBindable && g && I(g) ? M(
1430
+ g,
1603
1431
  e.valueFormatPreferences,
1604
1432
  e.boundCurrency
1605
1433
  ) : void 0;
1606
1434
  }
1607
- if (!((u = e.card.sql) != null && u.trim()) && !Ot(e.card.type) && e.target.kind === "metric") {
1608
- const F = e.target.metricId, p = (m = (l = e.card.config) == null ? void 0 : l.metricColumns) == null ? void 0 : m.find(
1609
- (C) => C.id === F
1435
+ if (!((u = e.card.sql) != null && u.trim()) && !Ct(e.card.type) && e.target.kind === "metric") {
1436
+ const v = e.target.metricId, b = (d = (m = e.card.config) == null ? void 0 : m.metricColumns) == null ? void 0 : d.find(
1437
+ (h) => h.id === v
1610
1438
  );
1611
- if (!p)
1439
+ if (!b)
1612
1440
  return;
1613
- const d = xe(
1441
+ const l = xe(
1614
1442
  e.card,
1615
- p
1616
- ), b = d.authoredFormat;
1617
- return d.currencyBindable && b && P(b) ? I(
1618
- b,
1443
+ b
1444
+ ), g = l.authoredFormat;
1445
+ return l.currencyBindable && g && I(g) ? M(
1446
+ g,
1619
1447
  e.valueFormatPreferences,
1620
1448
  e.boundCurrency
1621
1449
  ) : void 0;
1622
1450
  }
1623
- const r = ((g = (f = e.card.preferences) == null ? void 0 : f.tablePrefs) == null ? void 0 : g.columnSettingsMap) || {}, n = e.target.kind === "metric" ? e.target.metricId : void 0, o = e.target.kind === "column" ? [e.target.columnKey] : [
1451
+ const r = ((x = (f = e.card.preferences) == null ? void 0 : f.tablePrefs) == null ? void 0 : x.columnSettingsMap) || {}, o = e.target.kind === "metric" ? e.target.metricId : void 0, n = e.target.kind === "column" ? [e.target.columnKey] : [
1624
1452
  ...e.resultColumnKeys || [],
1625
1453
  ...Object.keys(r),
1626
1454
  e.target.metricId
1627
- ], i = e.target.kind === "column" ? e.target.columnKey : o.find(
1628
- (F) => {
1629
- var p;
1630
- return ((p = N(e.card, {
1631
- columnId: F
1632
- })) == null ? void 0 : p.id) === n;
1455
+ ], i = e.target.kind === "column" ? e.target.columnKey : n.find(
1456
+ (v) => {
1457
+ var b;
1458
+ return ((b = _(e.card, {
1459
+ columnId: v
1460
+ })) == null ? void 0 : b.id) === o;
1633
1461
  }
1634
- ) || n, a = j({
1462
+ ) || o, a = z({
1635
1463
  card: e.card,
1636
1464
  columnId: i,
1637
- metricId: n,
1465
+ metricId: o,
1638
1466
  persistedSettings: r[i],
1639
1467
  valueFormatPreferences: e.valueFormatPreferences,
1640
1468
  boundCurrency: e.boundCurrency
1641
1469
  });
1642
- return P(a) ? a : void 0;
1470
+ return I(a) ? a : void 0;
1643
1471
  }
1644
- function Vn(e) {
1645
- var r, n, o, i, a, c;
1646
- const t = e.persistedSettings ?? ((i = (o = (n = (r = e.card) == null ? void 0 : r.preferences) == null ? void 0 : n.tablePrefs) == null ? void 0 : o.columnSettingsMap) == null ? void 0 : i[e.columnId]);
1472
+ function po(e) {
1473
+ var r, o, n, i, a, c;
1474
+ const t = e.persistedSettings ?? ((i = (n = (o = (r = e.card) == null ? void 0 : r.preferences) == null ? void 0 : o.tablePrefs) == null ? void 0 : n.columnSettingsMap) == null ? void 0 : i[e.columnId]);
1647
1475
  if (!t && !e.resolvedSettings || (t == null ? void 0 : t.inheritMetricFormat) === !0 || ((a = e.resolvedSettings) == null ? void 0 : a.inheritMetricFormat) === !0) {
1648
- const s = E(
1649
- (c = N(e.card, {
1476
+ const s = R(
1477
+ (c = _(e.card, {
1650
1478
  columnId: e.columnId,
1651
1479
  metricId: e.metricId,
1652
1480
  metricAlias: e.metricAlias,
@@ -1655,57 +1483,57 @@ function Vn(e) {
1655
1483
  { preserveOmittedProperties: !0 }
1656
1484
  );
1657
1485
  if ((s == null ? void 0 : s.type) === "date" || (s == null ? void 0 : s.type) === "duration")
1658
- return T(s, {
1486
+ return S(s, {
1659
1487
  preserveOmittedProperties: !0
1660
1488
  });
1661
1489
  }
1662
- return Sr(
1663
- He({
1490
+ return xr(
1491
+ qe({
1664
1492
  ...e,
1665
1493
  persistedSettings: t
1666
1494
  })
1667
1495
  );
1668
1496
  }
1669
- function Br(e) {
1670
- var F, p, d, b, C, x, O;
1671
- const t = (F = e == null ? void 0 : e.formatNumber) == null ? void 0 : F.enabled, r = typeof t == "string" ? t.trim().toLowerCase() !== "false" : t !== !1, n = et(e == null ? void 0 : e.numberAxisFormat) || (r ? tt(e == null ? void 0 : e.formatNumber) : void 0), o = T(n);
1672
- if (!o || !o.type || o.type === "auto")
1673
- return o;
1674
- const i = (p = e == null ? void 0 : e.numberAxisFormat) == null ? void 0 : p.decimalPlaces, a = r ? (d = e == null ? void 0 : e.formatNumber) == null ? void 0 : d.decimalPlaces : void 0, c = typeof i == "number" ? i : typeof a == "number" ? a : void 0, s = (b = e == null ? void 0 : e.numberAxisFormat) == null ? void 0 : b.minimumFractionDigits, u = (C = e == null ? void 0 : e.numberAxisFormat) == null ? void 0 : C.maximumFractionDigits, l = r ? (x = e == null ? void 0 : e.formatNumber) == null ? void 0 : x.minimumFractionDigits : void 0, m = r ? (O = e == null ? void 0 : e.formatNumber) == null ? void 0 : O.maximumFractionDigits : void 0, f = typeof c == "number" ? c : typeof s == "number" ? s : typeof l == "number" ? l : 0, g = typeof c == "number" ? c : typeof u == "number" ? u : typeof m == "number" ? m : 0;
1497
+ function Mr(e) {
1498
+ var v, b, l, g, h, p, T;
1499
+ const t = (v = e == null ? void 0 : e.formatNumber) == null ? void 0 : v.enabled, r = typeof t == "string" ? t.trim().toLowerCase() !== "false" : t !== !1, o = $e(e == null ? void 0 : e.numberAxisFormat) || (r ? We(e == null ? void 0 : e.formatNumber) : void 0), n = S(o);
1500
+ if (!n || !n.type || n.type === "auto")
1501
+ return n;
1502
+ const i = (b = e == null ? void 0 : e.numberAxisFormat) == null ? void 0 : b.decimalPlaces, a = r ? (l = e == null ? void 0 : e.formatNumber) == null ? void 0 : l.decimalPlaces : void 0, c = typeof i == "number" ? i : typeof a == "number" ? a : void 0, s = (g = e == null ? void 0 : e.numberAxisFormat) == null ? void 0 : g.minimumFractionDigits, u = (h = e == null ? void 0 : e.numberAxisFormat) == null ? void 0 : h.maximumFractionDigits, m = r ? (p = e == null ? void 0 : e.formatNumber) == null ? void 0 : p.minimumFractionDigits : void 0, d = r ? (T = e == null ? void 0 : e.formatNumber) == null ? void 0 : T.maximumFractionDigits : void 0, f = typeof c == "number" ? c : typeof s == "number" ? s : typeof m == "number" ? m : 0, x = typeof c == "number" ? c : typeof u == "number" ? u : typeof d == "number" ? d : 0;
1675
1503
  return {
1676
- ...o,
1677
- decimalPlaces: f === g ? g : o.decimalPlaces,
1504
+ ...n,
1505
+ decimalPlaces: f === x ? x : n.decimalPlaces,
1678
1506
  minimumFractionDigits: f,
1679
1507
  maximumFractionDigits: Math.max(
1680
1508
  f,
1681
- g
1509
+ x
1682
1510
  )
1683
1511
  };
1684
1512
  }
1685
- function kn(e) {
1686
- var o, i, a, c, s;
1687
- const { value: t, formatOptions: r, preferences: n } = e;
1688
- return r != null && r.type && r.type !== "auto" ? Re(t, r.type, r) : rr({
1513
+ function Mo(e) {
1514
+ var n, i, a, c, s;
1515
+ const { value: t, formatOptions: r, preferences: o } = e;
1516
+ return r != null && r.type && r.type !== "auto" ? Oe(t, r.type, r) : $t({
1689
1517
  number: t,
1690
- decimalPlaces: ((o = n == null ? void 0 : n.numberAxisFormat) == null ? void 0 : o.decimalPlaces) ?? 0,
1691
- useSuffix: !!((i = n == null ? void 0 : n.numberAxisFormat) != null && i.suffix),
1692
- customSuffix: ((a = n == null ? void 0 : n.numberAxisFormat) == null ? void 0 : a.suffix) || "",
1693
- locale: ((c = n == null ? void 0 : n.numberAxisFormat) == null ? void 0 : c.locale) || "en-US",
1694
- currency: ((s = n == null ? void 0 : n.numberAxisFormat) == null ? void 0 : s.currency) || ""
1518
+ decimalPlaces: ((n = o == null ? void 0 : o.numberAxisFormat) == null ? void 0 : n.decimalPlaces) ?? 0,
1519
+ useSuffix: !!((i = o == null ? void 0 : o.numberAxisFormat) != null && i.suffix),
1520
+ customSuffix: ((a = o == null ? void 0 : o.numberAxisFormat) == null ? void 0 : a.suffix) || "",
1521
+ locale: ((c = o == null ? void 0 : o.numberAxisFormat) == null ? void 0 : c.locale) || "en-US",
1522
+ currency: ((s = o == null ? void 0 : o.numberAxisFormat) == null ? void 0 : s.currency) || ""
1695
1523
  });
1696
1524
  }
1697
- function Rr(e) {
1698
- return St({
1525
+ function Pr(e) {
1526
+ return ht({
1699
1527
  ...e,
1700
- activation: ne({
1528
+ activation: te({
1701
1529
  card: e.card,
1702
1530
  cardConfig: e.cardConfig
1703
1531
  })
1704
1532
  });
1705
1533
  }
1706
- function Ln(e) {
1707
- return At({
1708
- activation: ne({
1534
+ function Po(e) {
1535
+ return pt({
1536
+ activation: te({
1709
1537
  card: e.card,
1710
1538
  cardConfig: e.cardConfig
1711
1539
  }),
@@ -1713,9 +1541,9 @@ function Ln(e) {
1713
1541
  expectedResultOwner: e.expectedResultOwner
1714
1542
  });
1715
1543
  }
1716
- function Kr(e) {
1717
- var n, o;
1718
- const t = Pe(e.card, e.effectiveCardConfig), r = $t({
1544
+ function Ir(e) {
1545
+ var o, n;
1546
+ const t = pe(e.card, e.effectiveCardConfig), r = Vt({
1719
1547
  card: t,
1720
1548
  records: e.rows,
1721
1549
  keys: e.rows.length === 0 ? e.resultKeys : void 0,
@@ -1732,55 +1560,55 @@ function Kr(e) {
1732
1560
  delimiter: e.file.delimiter,
1733
1561
  csvEncoding: e.file.csvEncoding,
1734
1562
  includeHeaders: e.file.includeHeaders,
1735
- columnSettings: (o = (n = e.card.preferences) == null ? void 0 : n.tablePrefs) == null ? void 0 : o.columnSettingsMap,
1563
+ columnSettings: (n = (o = e.card.preferences) == null ? void 0 : o.tablePrefs) == null ? void 0 : n.columnSettingsMap,
1736
1564
  visibleColumns: [...r.visibleKeys],
1737
1565
  columnLabels: Object.fromEntries(r.visibleKeys.map((i) => [i, r.labels[i] ?? i]))
1738
1566
  }
1739
1567
  };
1740
1568
  }
1741
- function Er(e) {
1569
+ function Sr(e) {
1742
1570
  var r;
1743
1571
  const t = (r = e.preferences) == null ? void 0 : r.comparisonPresentation;
1744
1572
  return {
1745
- ...pt,
1573
+ ...mt,
1746
1574
  ...t,
1747
1575
  ...t != null && t.conditionalLabels ? { conditionalLabels: { ...t.conditionalLabels } } : {},
1748
1576
  ...t != null && t.colors ? { colors: { ...t.colors } } : {}
1749
1577
  };
1750
1578
  }
1751
- function _r(e) {
1752
- var x, O, U, A, R;
1753
- const t = Pe(e.card, e.effectiveCardConfig), { cardId: r, ...n } = e.requestPayloadBase, o = e.formatOptions.visibleColumns ?? [], i = [
1754
- ...o,
1579
+ function Tr(e) {
1580
+ var p, T, U, A, B;
1581
+ const t = pe(e.card, e.effectiveCardConfig), { cardId: r, ...o } = e.requestPayloadBase, n = e.formatOptions.visibleColumns ?? [], i = [
1582
+ ...n,
1755
1583
  ...Object.keys(e.formatOptions.columnSettings ?? {})
1756
- ], a = at(
1584
+ ], a = Je(
1757
1585
  e.card,
1758
- o,
1586
+ n,
1759
1587
  e.effectiveCardConfig
1760
- ), c = st(
1588
+ ), c = et(
1761
1589
  e.card,
1762
1590
  e.effectiveCardConfig,
1763
1591
  a
1764
- ), s = ct(
1592
+ ), s = tt(
1765
1593
  t,
1766
1594
  i
1767
1595
  ), u = new Set(
1768
- s.eligibleTargets.map(Y)
1769
- ), l = (y) => u.has(Y(y)) ? lt({
1770
- bindings: n.controlBindings,
1596
+ s.eligibleTargets.map(W)
1597
+ ), m = (y) => u.has(W(y)) ? ot({
1598
+ bindings: o.controlBindings,
1771
1599
  controls: [
1772
- ...n.controlDefinitions ?? [],
1773
- ...n.cardControlDefinitions ?? []
1600
+ ...o.controlDefinitions ?? [],
1601
+ ...o.cardControlDefinitions ?? []
1774
1602
  ],
1775
- values: n.controlValues,
1603
+ values: o.controlValues,
1776
1604
  target: y,
1777
1605
  knownTargets: s.knownTargets,
1778
1606
  eligibleTargets: s.eligibleTargets
1779
- }).currency : void 0, m = ut({
1607
+ }).currency : void 0, d = rt({
1780
1608
  card: e.card,
1781
1609
  comparisonMetadata: e.comparisonMetadata,
1782
- columnKeyMap: ((x = e.canonicalPivotResult) == null ? void 0 : x.columnKeyMap) ?? e.columnKeyMap
1783
- }), f = ne({
1610
+ columnKeyMap: ((p = e.canonicalPivotResult) == null ? void 0 : p.columnKeyMap) ?? e.columnKeyMap
1611
+ }), f = te({
1784
1612
  card: e.card,
1785
1613
  cardConfig: e.effectiveCardConfig
1786
1614
  });
@@ -1788,31 +1616,31 @@ function _r(e) {
1788
1616
  throw new Error(
1789
1617
  "Canonical pivot export requires a parsed pivot result lifecycle."
1790
1618
  );
1791
- const g = Rr({
1619
+ const x = Pr({
1792
1620
  card: e.card,
1793
1621
  cardConfig: e.effectiveCardConfig,
1794
- columns: ((O = e.canonicalPivotResult) == null ? void 0 : O.columns) ?? e.resultColumns,
1622
+ columns: ((T = e.canonicalPivotResult) == null ? void 0 : T.columns) ?? e.resultColumns,
1795
1623
  columnKeyMap: ((U = e.canonicalPivotResult) == null ? void 0 : U.columnKeyMap) ?? e.columnKeyMap,
1796
1624
  resultRowCount: e.totalRows,
1797
1625
  valueFormatPreferences: e.reportContext.valueFormat
1798
- }), F = (f == null ? void 0 : f.fields) ?? [], p = new Map(
1799
- F.map((y) => [
1626
+ }), v = (f == null ? void 0 : f.fields) ?? [], b = new Map(
1627
+ v.map((y) => [
1800
1628
  `${y.role}:${y.id}`,
1801
1629
  y
1802
1630
  ])
1803
- ), d = /* @__PURE__ */ new Map();
1804
- if (e.card.type === "detailTable" && n.resultOwner === "config") {
1631
+ ), l = /* @__PURE__ */ new Map();
1632
+ if (e.card.type === "detailTable" && o.resultOwner === "config") {
1805
1633
  const y = e.resultColumns || [];
1806
1634
  if (y.filter(
1807
- (h) => h.rawTemporal
1635
+ (C) => C.rawTemporal
1808
1636
  ).length > 0) {
1809
1637
  if (!e.columnKeyMap)
1810
1638
  throw new Error(
1811
1639
  "Canonical raw temporal export requires an authoritative columnKeyMap."
1812
1640
  );
1813
- const h = Bt({
1641
+ const C = It({
1814
1642
  cardType: e.card.type,
1815
- resultOwner: n.resultOwner,
1643
+ resultOwner: o.resultOwner,
1816
1644
  effectiveCardConfig: e.effectiveCardConfig,
1817
1645
  result: {
1818
1646
  records: [],
@@ -1822,90 +1650,90 @@ function _r(e) {
1822
1650
  preferences: e.reportContext.valueFormat,
1823
1651
  calendar: e.reportContext.calendar
1824
1652
  });
1825
- if (h.kind === "invalid") throw h.error;
1826
- if (h.kind === "loaded_empty" || h.kind === "loaded_valid")
1827
- for (const [S, w] of h.presentation.byColumnKey)
1828
- d.set(S, w.format);
1653
+ if (C.kind === "invalid") throw C.error;
1654
+ if (C.kind === "loaded_empty" || C.kind === "loaded_valid")
1655
+ for (const [O, w] of C.presentation.byColumnKey)
1656
+ l.set(O, w.format);
1829
1657
  }
1830
- } else if (n.resultOwner === "freeform" && n.sql.trim() && !n.python.trim())
1831
- for (const [y, v] of Object.entries(
1832
- ((R = (A = e.card.preferences) == null ? void 0 : A.tablePrefs) == null ? void 0 : R.columnSettingsMap) || {}
1658
+ } else if (o.resultOwner === "freeform" && o.sql.trim() && !o.python.trim())
1659
+ for (const [y, F] of Object.entries(
1660
+ ((B = (A = e.card.preferences) == null ? void 0 : A.tablePrefs) == null ? void 0 : B.columnSettingsMap) || {}
1833
1661
  )) {
1834
- if (v.type !== "date") continue;
1835
- const h = Rt(v.dateFormat);
1836
- h && d.set(
1662
+ if (F.type !== "date") continue;
1663
+ const C = St(F.dateFormat);
1664
+ C && l.set(
1837
1665
  y,
1838
- Pt({
1839
- format: h,
1666
+ vt({
1667
+ format: C,
1840
1668
  preferences: e.reportContext.valueFormat,
1841
1669
  calendar: e.reportContext.calendar
1842
1670
  })
1843
1671
  );
1844
1672
  }
1845
- const b = [
1673
+ const g = [
1846
1674
  ...new Set(i)
1847
1675
  ].flatMap((y) => {
1848
- var de, me, fe, ye, ge, be;
1849
- if (g.byColumnKey.has(y) || d.has(y))
1676
+ var ce, ue, le, me, de, fe;
1677
+ if (x.byColumnKey.has(y) || l.has(y))
1850
1678
  return [];
1851
- const v = m.columnPresentationOwners.get(y), h = (de = t.sql) != null && de.trim() ? void 0 : N(t, {
1679
+ const F = d.columnPresentationOwners.get(y), C = (ce = t.sql) != null && ce.trim() ? void 0 : _(t, {
1852
1680
  columnId: y,
1853
1681
  columnKeyMap: e.columnKeyMap,
1854
- metricId: v == null ? void 0 : v.metricId,
1855
- metricAlias: v == null ? void 0 : v.metricAlias
1856
- }), S = h ? { kind: "metric", metricId: h.id } : { kind: "column", columnKey: y }, w = u.has(
1857
- Y(S)
1858
- ), le = l(S), V = (ye = (fe = (me = t.preferences) == null ? void 0 : me.tablePrefs) == null ? void 0 : fe.columnSettingsMap) == null ? void 0 : ye[y], G = {
1682
+ metricId: F == null ? void 0 : F.metricId,
1683
+ metricAlias: F == null ? void 0 : F.metricAlias
1684
+ }), O = C ? { kind: "metric", metricId: C.id } : { kind: "column", columnKey: y }, w = u.has(
1685
+ W(O)
1686
+ ), se = m(O), N = (me = (le = (ue = t.preferences) == null ? void 0 : ue.tablePrefs) == null ? void 0 : le.columnSettingsMap) == null ? void 0 : me[y], k = {
1859
1687
  dashboardId: e.dashboardId,
1860
1688
  cardId: t.id
1861
- }, $ = { kind: "column", columnKey: y }, M = h && (!V || V.inheritMetricFormat === !0) ? E(h.format, {
1689
+ }, G = { kind: "column", columnKey: y }, P = C && (!N || N.inheritMetricFormat === !0) ? R(C.format, {
1862
1690
  preserveOmittedProperties: !0
1863
1691
  }) : void 0;
1864
- if ((M == null ? void 0 : M.type) === "date")
1692
+ if ((P == null ? void 0 : P.type) === "date")
1865
1693
  return [
1866
1694
  {
1867
- scope: G,
1868
- target: $,
1695
+ scope: k,
1696
+ target: G,
1869
1697
  format: {
1870
1698
  type: "date",
1871
- locale: M.locale ?? e.reportContext.valueFormat.locale,
1872
- ...M.pattern ? { pattern: M.pattern } : {},
1873
- ...M.timezone ? { timezone: M.timezone } : {},
1874
- ...M.sourceTimezone ? { sourceTimezone: M.sourceTimezone } : {}
1699
+ locale: P.locale ?? e.reportContext.valueFormat.locale,
1700
+ ...P.pattern ? { pattern: P.pattern } : {},
1701
+ ...P.timezone ? { timezone: P.timezone } : {},
1702
+ ...P.sourceTimezone ? { sourceTimezone: P.sourceTimezone } : {}
1875
1703
  }
1876
1704
  }
1877
1705
  ];
1878
- const D = (v ? wr({
1706
+ const D = (F ? hr({
1879
1707
  card: t,
1880
1708
  columnId: y,
1881
1709
  columnKeyMap: e.columnKeyMap,
1882
- persistedSettings: V,
1883
- metricId: v.metricId,
1884
- metricAlias: v.metricAlias,
1885
- comparisonValueKind: v.kind,
1886
- comparisonPrecision: (be = (ge = t.preferences) == null ? void 0 : ge.comparisonPresentation) == null ? void 0 : be.precision,
1710
+ persistedSettings: N,
1711
+ metricId: F.metricId,
1712
+ metricAlias: F.metricAlias,
1713
+ comparisonValueKind: F.kind,
1714
+ comparisonPrecision: (fe = (de = t.preferences) == null ? void 0 : de.comparisonPresentation) == null ? void 0 : fe.precision,
1887
1715
  presentation: {
1888
1716
  preferences: e.reportContext.valueFormat,
1889
- resolveBoundCurrency: l
1717
+ resolveBoundCurrency: m
1890
1718
  }
1891
- }) : void 0) ?? (w ? Dr({
1719
+ }) : void 0) ?? (w ? pr({
1892
1720
  card: t,
1893
- target: S,
1721
+ target: O,
1894
1722
  resultColumnKeys: i,
1895
1723
  valueFormatPreferences: e.reportContext.valueFormat,
1896
- boundCurrency: le
1897
- }) : void 0) ?? j({
1724
+ boundCurrency: se
1725
+ }) : void 0) ?? z({
1898
1726
  card: t,
1899
1727
  columnId: y,
1900
1728
  columnKeyMap: e.columnKeyMap,
1901
- metricId: v == null ? void 0 : v.metricId,
1902
- persistedSettings: V,
1729
+ metricId: F == null ? void 0 : F.metricId,
1730
+ persistedSettings: N,
1903
1731
  valueFormatPreferences: e.reportContext.valueFormat
1904
- }), W = (D == null ? void 0 : D.type) === "duration" ? D : D ? I(
1732
+ }), $ = (D == null ? void 0 : D.type) === "duration" ? D : D ? M(
1905
1733
  D,
1906
1734
  e.reportContext.valueFormat,
1907
- le
1908
- ) : I(
1735
+ se
1736
+ ) : M(
1909
1737
  {
1910
1738
  type: "number",
1911
1739
  minimumFractionDigits: 0,
@@ -1914,15 +1742,15 @@ function _r(e) {
1914
1742
  e.reportContext.valueFormat
1915
1743
  );
1916
1744
  return [
1917
- W.type === "duration" ? { scope: G, target: $, format: W } : { scope: G, target: $, format: W }
1745
+ $.type === "duration" ? { scope: k, target: G, format: $ } : { scope: k, target: G, format: $ }
1918
1746
  ];
1919
1747
  });
1920
- b.push(
1921
- ...[...g.byColumnKey.values()].map((y) => {
1922
- const v = p.get(
1748
+ g.push(
1749
+ ...[...x.byColumnKey.values()].map((y) => {
1750
+ const F = b.get(
1923
1751
  `${y.role ?? "groupby"}:${y.fieldId}`
1924
1752
  );
1925
- if (!v)
1753
+ if (!F)
1926
1754
  throw new Error(
1927
1755
  `Unable to resolve temporal export field "${y.fieldId}".`
1928
1756
  );
@@ -1932,8 +1760,8 @@ function _r(e) {
1932
1760
  cardId: e.card.id
1933
1761
  },
1934
1762
  target: { kind: "column", columnKey: y.columnKey },
1935
- format: Fe(
1936
- v,
1763
+ format: ye(
1764
+ F,
1937
1765
  {
1938
1766
  dateStyle: e.reportContext.valueFormat.dateStyle,
1939
1767
  dateTime: { ...e.reportContext.valueFormat.dateTime }
@@ -1942,7 +1770,7 @@ function _r(e) {
1942
1770
  )
1943
1771
  };
1944
1772
  })
1945
- ), b.push(
1773
+ ), g.push(
1946
1774
  ...((f == null ? void 0 : f.fields) || []).flatMap(
1947
1775
  (y) => y.role === "pivotby" ? [
1948
1776
  {
@@ -1955,7 +1783,7 @@ function _r(e) {
1955
1783
  fieldId: y.id,
1956
1784
  role: y.role
1957
1785
  },
1958
- format: Fe(
1786
+ format: ye(
1959
1787
  y,
1960
1788
  {
1961
1789
  dateStyle: e.reportContext.valueFormat.dateStyle,
@@ -1966,70 +1794,70 @@ function _r(e) {
1966
1794
  }
1967
1795
  ] : []
1968
1796
  )
1969
- ), b.push(
1970
- ...[...d].map(([y, v]) => ({
1797
+ ), g.push(
1798
+ ...[...l].map(([y, F]) => ({
1971
1799
  scope: { dashboardId: e.dashboardId, cardId: e.card.id },
1972
1800
  target: { kind: "column", columnKey: y },
1973
- format: v
1801
+ format: F
1974
1802
  }))
1975
1803
  );
1976
- const C = vt({
1804
+ const h = dt({
1977
1805
  reportContext: e.reportContext,
1978
- resolvedFormats: b
1806
+ resolvedFormats: g
1979
1807
  });
1980
1808
  return {
1981
1809
  formatOptions: {
1982
1810
  ...e.formatOptions,
1983
1811
  ...a ? { tableTotalsLabelColumnKey: a } : {},
1984
- comparisonPresentation: Er(e.card),
1985
- presentationExecutionSnapshot: C
1812
+ comparisonPresentation: Sr(e.card),
1813
+ presentationExecutionSnapshot: h
1986
1814
  },
1987
1815
  ...c ? { tableTotalsRequest: c } : {}
1988
1816
  };
1989
1817
  }
1990
- function Nr(e) {
1991
- const t = mt(
1818
+ function Or(e) {
1819
+ const t = it(
1992
1820
  e.card,
1993
1821
  e.requestPayloadBase
1994
- ), { cardId: r, ...n } = t.requestPayloadBase, o = _r(e);
1822
+ ), { cardId: r, ...o } = t.requestPayloadBase, n = Tr(e);
1995
1823
  return {
1996
1824
  type: "card",
1997
1825
  dashboardId: e.dashboardId,
1998
1826
  cardId: e.card.id,
1999
1827
  title: e.title,
2000
1828
  connection_id: t.connectionId,
2001
- ...n,
2002
- ...o.tableTotalsRequest ? { tableTotalsRequest: o.tableTotalsRequest } : {},
1829
+ ...o,
1830
+ ...n.tableTotalsRequest ? { tableTotalsRequest: n.tableTotalsRequest } : {},
2003
1831
  totalRows: e.totalRows,
2004
1832
  format: e.format,
2005
- formatOptions: o.formatOptions
1833
+ formatOptions: n.formatOptions
2006
1834
  };
2007
1835
  }
2008
- function qn(e) {
1836
+ function Io(e) {
2009
1837
  const { card: t, result: r } = e;
2010
1838
  if (t.type !== "table" && t.type !== "detailTable")
2011
1839
  return { status: "refused", reason: "not_a_table" };
2012
- if (dt({ card: t, comparisonMetadata: r.comparisonMetadata }))
1840
+ if (nt({ card: t, comparisonMetadata: r.comparisonMetadata }))
2013
1841
  return { status: "refused", reason: "comparison_metadata_missing" };
2014
- const n = Kr({
1842
+ const o = Ir({
2015
1843
  card: t,
2016
1844
  effectiveCardConfig: e.effectiveCardConfig,
2017
1845
  rows: e.rows,
2018
- resultKeys: r.resultColumns.map((o) => o.key),
1846
+ resultKeys: r.resultColumns.map((n) => n.key),
2019
1847
  result: r,
2020
1848
  reportContext: e.reportContext,
2021
1849
  file: e.file
2022
1850
  });
2023
- return n ? {
1851
+ return o ? {
2024
1852
  status: "ready",
2025
- request: Nr({
1853
+ request: Or({
2026
1854
  card: t,
2027
1855
  dashboardId: e.dashboardId,
2028
1856
  title: e.title,
2029
1857
  reportContext: e.reportContext,
2030
1858
  totalRows: r.totalRows,
2031
1859
  format: e.file.format,
2032
- formatOptions: n.formatOptions,
1860
+ formatOptions: o.formatOptions,
2033
1861
  comparisonMetadata: r.comparisonMetadata,
2034
1862
  requestPayloadBase: e.query,
2035
1863
  resultColumns: [...r.resultColumns],
@@ -2038,24 +1866,24 @@ function qn(e) {
2038
1866
  })
2039
1867
  } : { status: "refused", reason: "columns_unresolved" };
2040
1868
  }
2041
- function Vr(e, t, r) {
2042
- if (gt(
2043
- bt(t),
1869
+ function Ar(e, t, r) {
1870
+ if (ct(
1871
+ ut(t),
2044
1872
  e.aggregateOrigin
2045
1873
  ))
2046
1874
  return { aggregate: void 0, aggregateOrigin: void 0 };
2047
- const n = r === "selection" && e.role === "metric" ? t.aggregate : void 0;
1875
+ const o = r === "selection" && e.role === "metric" ? t.aggregate : void 0;
2048
1876
  return {
2049
- aggregate: e.aggregate ?? n,
2050
- aggregateOrigin: e.aggregate ? e.aggregateOrigin : n ? t.aggregateOrigin : void 0
1877
+ aggregate: e.aggregate ?? o,
1878
+ aggregateOrigin: e.aggregate ? e.aggregateOrigin : o ? t.aggregateOrigin : void 0
2051
1879
  };
2052
1880
  }
2053
- function kr(e, t, r) {
2054
- var n, o, i, a, c, s;
1881
+ function wr(e, t, r) {
1882
+ var o, n, i, a, c, s;
2055
1883
  if (r === "domain")
2056
1884
  return {
2057
- filters: (n = t.parameters) == null ? void 0 : n.filters,
2058
- windowTransform: (o = e.parameters) == null ? void 0 : o.windowTransform
1885
+ filters: (o = t.parameters) == null ? void 0 : o.filters,
1886
+ windowTransform: (n = e.parameters) == null ? void 0 : n.windowTransform
2059
1887
  };
2060
1888
  if (!(!e.parameters && !t.parameters))
2061
1889
  return {
@@ -2063,8 +1891,8 @@ function kr(e, t, r) {
2063
1891
  windowTransform: ((c = e.parameters) == null ? void 0 : c.windowTransform) ?? ((s = t.parameters) == null ? void 0 : s.windowTransform)
2064
1892
  };
2065
1893
  }
2066
- function jn(e, t, r) {
2067
- const n = e;
1894
+ function So(e, t, r) {
1895
+ const o = e;
2068
1896
  return {
2069
1897
  id: e.id,
2070
1898
  role: e.role,
@@ -2075,22 +1903,22 @@ function jn(e, t, r) {
2075
1903
  dateFormat: e.dateFormat,
2076
1904
  customFormat: e.customFormat,
2077
1905
  semanticTemporalPresentation: t.semanticTemporalPresentation || e.semanticTemporalPresentation,
2078
- ...Vr(e, t, r),
1906
+ ...Ar(e, t, r),
2079
1907
  ...e.role === "metric" ? {
2080
- aliasTemplate: n.aliasTemplate,
2081
- valueAliases: n.valueAliases,
2082
- comparison: n.comparison,
2083
- comparisonPolarity: n.comparisonPolarity,
2084
- parameters: kr(
2085
- n,
1908
+ aliasTemplate: o.aliasTemplate,
1909
+ valueAliases: o.valueAliases,
1910
+ comparison: o.comparison,
1911
+ comparisonPolarity: o.comparisonPolarity,
1912
+ parameters: wr(
1913
+ o,
2086
1914
  t,
2087
1915
  "domain"
2088
1916
  )
2089
1917
  } : {},
2090
- ...Lr(e)
1918
+ ...Dr(e)
2091
1919
  };
2092
1920
  }
2093
- function Lr(e) {
1921
+ function Dr(e) {
2094
1922
  const t = {
2095
1923
  ...e.labelOrigin === "override" ? { label: e.label, labelOrigin: e.labelOrigin } : {},
2096
1924
  ...e.formatOrigin === "override" ? { format: e.format, formatOrigin: e.formatOrigin } : {}
@@ -2116,56 +1944,56 @@ function Lr(e) {
2116
1944
  return t;
2117
1945
  }
2118
1946
  }
2119
- const qr = "table";
2120
- function zn({ preferences: e, ...t }) {
1947
+ const Br = "table";
1948
+ function To({ preferences: e, ...t }) {
2121
1949
  return {
2122
1950
  ...t,
2123
- type: qr,
1951
+ type: Br,
2124
1952
  preferences: e ?? { onClickFilter: [{ columnIndex: 0, expression: "" }] },
2125
1953
  sql: "",
2126
1954
  data: []
2127
1955
  };
2128
1956
  }
2129
- function Hn(e, t) {
1957
+ function Oo(e, t) {
2130
1958
  let r = e;
2131
- for (const [n, o] of t.entries()) {
2132
- const i = jr(r, o);
1959
+ for (const [o, n] of t.entries()) {
1960
+ const i = Kr(r, n);
2133
1961
  if (!i.ok)
2134
- return { ok: !1, failedAt: { index: n, op: o.op, ...i.failure } };
1962
+ return { ok: !1, failedAt: { index: o, op: n.op, ...i.failure } };
2135
1963
  r = i.dashboard;
2136
1964
  }
2137
1965
  return { ok: !0, dashboard: r };
2138
1966
  }
2139
- function jr(e, t) {
2140
- const r = e.sheets ?? [], n = r.findIndex((s) => s.id === t.sheetId), o = r[n];
2141
- if (!o)
2142
- return Q("sheet_not_found", `No sheet ${t.sheetId} on this dashboard.`);
2143
- if (ft(o))
2144
- return Q("sheet_not_a_grid", "This sheet is a document: add to it through the document.");
1967
+ function Kr(e, t) {
1968
+ const r = e.sheets ?? [], o = r.findIndex((s) => s.id === t.sheetId), n = r[o];
1969
+ if (!n)
1970
+ return X("sheet_not_found", `No sheet ${t.sheetId} on this dashboard.`);
1971
+ if (at(n))
1972
+ return X("sheet_not_a_grid", "This sheet is a document: add to it through the document.");
2145
1973
  const { frame: i } = t;
2146
1974
  if (r.some((s) => (s.frames ?? []).some((u) => u.id === i.id)))
2147
- return Q("frame_id_taken", `A frame with id ${i.id} is already on this dashboard.`);
1975
+ return X("frame_id_taken", `A frame with id ${i.id} is already on this dashboard.`);
2148
1976
  const a = t.placement ?? "end", c = {
2149
- ...o,
2150
- frames: zr(o.frames ?? [], i, a),
2151
- layouts: Hr(o, i, a)
1977
+ ...n,
1978
+ frames: Rr(n.frames ?? [], i, a),
1979
+ layouts: Er(n, i, a)
2152
1980
  };
2153
1981
  return {
2154
1982
  ok: !0,
2155
1983
  dashboard: {
2156
1984
  ...e,
2157
- sheets: r.map((s, u) => u === n ? c : s)
1985
+ sheets: r.map((s, u) => u === o ? c : s)
2158
1986
  }
2159
1987
  };
2160
1988
  }
2161
- function zr(e, t, r) {
1989
+ function Rr(e, t, r) {
2162
1990
  if (r === "start") return [t, ...e];
2163
1991
  if (r === "end") return [...e, t];
2164
- const n = e.findIndex((o) => o.id === r.beside);
2165
- return n < 0 ? [...e, t] : [...e.slice(0, n + 1), t, ...e.slice(n + 1)];
1992
+ const o = e.findIndex((n) => n.id === r.beside);
1993
+ return o < 0 ? [...e, t] : [...e.slice(0, o + 1), t, ...e.slice(o + 1)];
2166
1994
  }
2167
- function Hr(e, t, r) {
2168
- return (typeof r == "object" ? Kt({ sourceId: r.beside, duplicatedId: t.id, layouts: e.layouts }) : void 0) ?? Et({
1995
+ function Er(e, t, r) {
1996
+ return (typeof r == "object" ? Tt({ sourceId: r.beside, duplicatedId: t.id, layouts: e.layouts }) : void 0) ?? Ot({
2169
1997
  id: t.id,
2170
1998
  layouts: e.layouts,
2171
1999
  x: 0,
@@ -2173,88 +2001,80 @@ function Hr(e, t, r) {
2173
2001
  frame: t
2174
2002
  });
2175
2003
  }
2176
- function Q(e, t) {
2004
+ function X(e, t) {
2177
2005
  return { ok: !1, failure: { code: e, message: t } };
2178
2006
  }
2179
2007
  export {
2180
- rr as $,
2181
- Ut as A,
2182
- He as B,
2183
- Xt as C,
2184
- bn as D,
2185
- Yt as E,
2186
- ie as F,
2187
- Tn as G,
2188
- Mn as H,
2189
- hn as I,
2190
- Bn as J,
2191
- Ve as K,
2192
- wr as L,
2193
- Ln as M,
2194
- qr as N,
2195
- Dn as O,
2196
- mr as P,
2197
- se as Q,
2198
- On as R,
2199
- En as S,
2200
- Nn as T,
2201
- _n as U,
2202
- Re as V,
2203
- Cr as W,
2204
- Br as X,
2205
- _ as Y,
2206
- Kn as Z,
2207
- Vn as _,
2208
- gn as a,
2209
- dr as a0,
2210
- Tr as a1,
2211
- Or as a2,
2212
- kn as a3,
2213
- te as a4,
2214
- xr as a5,
2215
- wn as a6,
2216
- Sn as a7,
2217
- An as a8,
2218
- ar as a9,
2219
- ir as aa,
2220
- Rr as ab,
2221
- ee as ac,
2222
- xn as ad,
2223
- zt as ae,
2224
- pn as af,
2225
- Wt as ag,
2226
- Pn as ah,
2227
- j as ai,
2228
- N as aj,
2229
- vn as ak,
2230
- Rn as al,
2231
- br as am,
2232
- In as an,
2233
- hr as ao,
2234
- Cn as ap,
2235
- yn as b,
2236
- fn as c,
2237
- cn as d,
2238
- un as e,
2239
- ln as f,
2240
- Fn as g,
2241
- qt as h,
2242
- Kr as i,
2243
- _r as j,
2244
- Nr as k,
2245
- qn as l,
2246
- Vr as m,
2247
- mn as n,
2248
- kr as o,
2249
- jn as p,
2250
- Lr as q,
2251
- _t as r,
2252
- dn as s,
2253
- zn as t,
2254
- Hn as u,
2255
- Dr as v,
2256
- Pr as w,
2257
- q as x,
2258
- Gt as y,
2259
- Ht as z
2008
+ mo as $,
2009
+ Ke as A,
2010
+ hr as B,
2011
+ Po as C,
2012
+ Jr as D,
2013
+ go as E,
2014
+ or as F,
2015
+ ne as G,
2016
+ lo as H,
2017
+ oo as I,
2018
+ xo as J,
2019
+ ho as K,
2020
+ Co as L,
2021
+ Oe as M,
2022
+ Br as N,
2023
+ dr as O,
2024
+ Mr as P,
2025
+ E as Q,
2026
+ vo as R,
2027
+ po as S,
2028
+ $t as T,
2029
+ rr as U,
2030
+ Fr as V,
2031
+ vr as W,
2032
+ Mo as X,
2033
+ J as Y,
2034
+ fr as Z,
2035
+ yo as _,
2036
+ Qr as a,
2037
+ fo as a0,
2038
+ Zt as a1,
2039
+ Xt as a2,
2040
+ Pr as a3,
2041
+ Q as a4,
2042
+ io as a5,
2043
+ Rt as a6,
2044
+ to as a7,
2045
+ qt as a8,
2046
+ co as a9,
2047
+ z as aa,
2048
+ _ as ab,
2049
+ ro as ac,
2050
+ Fo as ad,
2051
+ sr as ae,
2052
+ ao as af,
2053
+ mr as ag,
2054
+ no as ah,
2055
+ Ir as b,
2056
+ Tr as c,
2057
+ Or as d,
2058
+ Io as e,
2059
+ Ar as f,
2060
+ eo as g,
2061
+ Bt as h,
2062
+ wr as i,
2063
+ So as j,
2064
+ Dr as k,
2065
+ To as l,
2066
+ Oo as m,
2067
+ br as n,
2068
+ L as o,
2069
+ Et as p,
2070
+ _t as q,
2071
+ pr as r,
2072
+ Nt as s,
2073
+ qe as t,
2074
+ zt as u,
2075
+ Lt as v,
2076
+ re as w,
2077
+ uo as x,
2078
+ so as y,
2079
+ bo as z
2260
2080
  };