react-semaphor 0.1.543 → 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.
- package/dist/activity/index.js +73 -0
- package/dist/analytics-protocol/index.js +35 -34
- package/dist/assistant-context/index.js +1 -1
- package/dist/brand-studio/index.js +2 -2
- package/dist/briefings/index.js +56 -52
- package/dist/chunks/{class-utils-Df1OVOT1.js → _commonjsHelpers-DimLPMtv.js} +124 -98
- package/dist/chunks/{apply-dashboard-operations-CG9S7MGt.js → apply-dashboard-operations-CZEMsx8E.js} +778 -958
- package/dist/chunks/{assistant-chat-BFMRUYoB.js → assistant-chat-D7sWTypJ.js} +26 -27
- package/dist/chunks/calendar-day-equality-dvoQp1xW.js +410 -0
- package/dist/chunks/{comparison-window-caption-Bv18samq.js → comparison-window-caption-D4E6IHPD.js} +462 -456
- package/dist/chunks/{custom-visual-inputs-DUtpYZOk.js → custom-visual-inputs-DLCD9Y5V.js} +8 -2
- package/dist/chunks/dashboard-B1tMju0u.js +14 -0
- package/dist/chunks/dashboard-briefing-launcher-CePgIu0Z.js +3720 -0
- package/dist/chunks/{dashboard-controls-UGpjOM2k.js → dashboard-controls-Cq05n3e0.js} +526 -521
- package/dist/chunks/{dashboard-json-DG8dz0eX.js → dashboard-json-CoYRPqxx.js} +3 -3
- package/dist/chunks/document-dashboard-inputs-BesAHZvB.js +3112 -0
- package/dist/chunks/{edit-dashboard-visual-CDpA4y5e.js → edit-dashboard-visual-JPtNfJRb.js} +5628 -5618
- package/dist/chunks/export-file-format-C-tJsxsf.js +111 -0
- package/dist/chunks/{filter-value-text-CYsVYPuD.js → filter-value-text-ff7osJr7.js} +1 -1
- package/dist/chunks/{index-l5LclZvs.js → index-DRWiuqyd.js} +378 -332
- package/dist/chunks/{matrix-formatter-BnsTX90d.js → matrix-formatter-DnCyRXJE.js} +13 -13
- package/dist/chunks/{numeric-presentation-F_-H6VAw.js → numeric-presentation-7X_IrD58.js} +2572 -2573
- package/dist/chunks/{pivot-result-lifecycle-DupbRk-R.js → pivot-result-lifecycle-DM4CyGKs.js} +285 -393
- package/dist/chunks/{raw-temporal-presentation-D-azM_98.js → raw-temporal-presentation-C3mUgnEx.js} +2 -2
- package/dist/chunks/{zoned-wall-clock-MulfA26h.js → relative-date-label-Bk2j94pA.js} +21 -64
- package/dist/chunks/rendered-file-D8xEuVVx.js +108 -0
- package/dist/chunks/{report-preferences-dialog-CPwRwEJx.js → report-preferences-dialog-DUtuUL_5.js} +640 -612
- package/dist/chunks/resolve-dashboard-input-context-DJ2tICwz.js +9415 -0
- package/dist/chunks/{saved-dashboard-context-BKvMfRfC.js → saved-dashboard-context-LrF_kW0l.js} +183 -211
- package/dist/chunks/selection-filter-compiler-BKXmyLrS.js +79 -0
- package/dist/chunks/{semaphor-ready-indicator-CN2AHm2x.js → semaphor-ready-indicator-BxF96Yhv.js} +46859 -47102
- package/dist/chunks/shelf-drop-preview-context-CNaM_Gmh.js +2469 -0
- package/dist/chunks/{switch-C3jLxlG0.js → switch-uDtPgQlQ.js} +44 -45
- package/dist/chunks/{table-export-sheet-BDRXLLdq.js → table-export-sheet-YzMioA7Y.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-BnclfB2k.js → use-create-flow-overlay-state-CjB7ig1o.js} +153 -164
- package/dist/chunks/zoned-wall-clock-BkxV9jS2.js +46 -0
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.js +553 -541
- package/dist/data-app-sdk/index.js +1 -1
- package/dist/format-utils/index.js +241 -227
- package/dist/index.js +354 -331
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +1 -1
- package/dist/types/activity.d.ts +2 -0
- package/dist/types/briefings/attachment-outcomes.d.ts +1 -1
- package/dist/types/briefings/attachments.d.ts +33 -6
- package/dist/types/briefings/index.d.ts +6 -5
- package/dist/types/components/activity/activity-bell.d.ts +11 -0
- package/dist/types/components/activity/activity-instance.d.ts +50 -0
- package/dist/types/components/activity/activity-notices.d.ts +7 -0
- package/dist/types/components/activity/activity-provider.d.ts +21 -0
- package/dist/types/components/activity/activity-types.d.ts +177 -0
- package/dist/types/components/activity/index.d.ts +6 -0
- package/dist/types/components/activity/use-activity.d.ts +20 -0
- package/dist/types/components/briefings/briefing-author/run-model.d.ts +1 -2
- package/dist/types/components/briefings/briefing-author.d.ts +14 -12
- package/dist/types/components/briefings/dashboard-briefing-launcher.d.ts +5 -0
- package/dist/types/components/briefings/use-briefing-run-detail.d.ts +34 -0
- package/dist/types/components/index.d.ts +1 -4
- package/dist/types/components/surfboard/filter/types.d.ts +0 -14
- package/dist/types/lib/activity-identity.d.ts +21 -0
- package/dist/types/lib/api/exports-api.d.ts +4 -4
- package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-authoring.d.ts +68 -82
- package/dist/types/lib/dashboard-inputs/dashboard-input-target-context.d.ts +0 -8
- package/dist/types/lib/dashboard-inputs/dashboard-input-values.d.ts +35 -1
- package/dist/types/lib/dashboard-inputs/filter-settings.d.ts +199 -0
- package/dist/types/lib/dashboard-inputs/resolve-dashboard-input-context.d.ts +7 -2
- package/dist/types/lib/dashboard-inputs/resolve-selection-input.d.ts +1 -1
- package/dist/types/lib/dashboard-viewer/captured-runtime-values.d.ts +40 -0
- package/dist/types/lib/dashboard-viewer/compatibility-input-storage.d.ts +16 -16
- package/dist/types/lib/dashboard-viewer/viewer-state.d.ts +11 -9
- package/dist/types/lib/download-pdf.d.ts +75 -1
- package/dist/types/lib/hooks/index.d.ts +1 -3
- package/dist/types/lib/hooks/use-date-filter.d.ts +5 -0
- package/dist/types/lib/hooks/use-text-filter.d.ts +5 -0
- package/dist/types/lib/matrix-table/matrix-delivery-policy.d.ts +5 -4
- package/dist/types/lib/matrix-table/matrix-delivery.d.ts +4 -0
- package/dist/types/lib/query-context/assemble-card-query.d.ts +158 -0
- package/dist/types/lib/query-context/build-card-query-context.d.ts +3 -3
- package/dist/types/lib/query-context/build-dashboard-card-query-contract.d.ts +15 -6
- package/dist/types/lib/query-context/build-dashboard-execution-snapshot.d.ts +11 -13
- package/dist/types/lib/query-context/compile-dashboard-card-filters.d.ts +22 -12
- package/dist/types/lib/stores/dashboard-store.d.ts +39 -55
- package/dist/types/lib/stores/editor-store.d.ts +0 -3
- package/dist/types/lib/types/common-types.d.ts +21 -6
- package/dist/types/shared/activity/activity-contract.d.ts +84 -0
- package/dist/types/shared/activity/index.d.ts +5 -0
- package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +4 -11
- package/dist/types/shared/dashboard-authoring/card-export-request.d.ts +6 -0
- package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +12 -12
- package/dist/types/shared/dashboard-authoring/dashboard-filter-mapping-contract.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/dashboard-input-scope.d.ts +92 -0
- package/dist/types/shared/dashboard-authoring/filter-model/ad-hoc-filter-values.d.ts +10 -0
- package/dist/types/shared/dashboard-authoring/filter-model/filter-definitions.d.ts +29 -0
- package/dist/types/shared/dashboard-authoring/filter-model/filter-values.d.ts +58 -0
- package/dist/types/shared/dashboard-authoring/filter-model/index.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/filter-model/prototype-document-inputs.d.ts +15 -0
- package/dist/types/shared/dashboard-authoring/filter-model/read-dashboard-filter-model.d.ts +78 -0
- package/dist/types/shared/dashboard-authoring/filter-model/stored-dashboard.d.ts +18 -0
- package/dist/types/shared/dashboard-authoring/filter-model/toolbar-filter-reach.d.ts +23 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +2 -0
- package/dist/types/shared/format-utils/export-policy.d.ts +12 -0
- package/dist/types/shared/format-utils/exporters/index.d.ts +2 -0
- package/dist/types/shared/format-utils/exporters/rendered-file.d.ts +106 -0
- package/package.json +6 -2
- package/dist/chunks/_commonjsHelpers-BkfeUUK-.js +0 -28
- package/dist/chunks/calendar-day-equality-BmJAWduY.js +0 -460
- package/dist/chunks/dashboard-B9mKTJoy.js +0 -14
- package/dist/chunks/dashboard-briefing-launcher-Bdmry_oG.js +0 -4248
- package/dist/chunks/document-dashboard-inputs-OwqCbrVp.js +0 -8087
- package/dist/chunks/document-sheet-utils-BTb3VZxV.js +0 -3619
- package/dist/chunks/shelf-drop-preview-context-BGl_rxcW.js +0 -2407
- package/dist/chunks/sort-target-MT1WK1vX.js +0 -29
- package/dist/types/components/briefings/briefing-author/run-ui.d.ts +0 -81
- package/dist/types/components/briefings/use-briefing-run-polling.d.ts +0 -34
- package/dist/types/components/notifications/export-notification-item.d.ts +0 -24
- package/dist/types/components/notifications/export-notification-list.d.ts +0 -8
- package/dist/types/components/notifications/index.d.ts +0 -3
- package/dist/types/components/notifications/notification-bell.d.ts +0 -13
- package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-storage-transition.d.ts +0 -88
- package/dist/types/lib/dashboard-inputs/dashboard-input-scope.d.ts +0 -10
- package/dist/types/lib/exports/bounded-request.d.ts +0 -12
- package/dist/types/lib/hooks/use-export-polling.d.ts +0 -32
- package/dist/types/lib/hooks/use-export-recovery.d.ts +0 -11
- package/dist/types/lib/stores/export-store.d.ts +0 -62
|
@@ -1,203 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { l as
|
|
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
|
|
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 {
|
|
8
|
-
import { f as
|
|
9
|
-
import { b as
|
|
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
|
|
12
|
-
import { af as
|
|
13
|
-
import { r as
|
|
14
|
-
import { g as
|
|
15
|
-
import { e as
|
|
16
|
-
import { duplicateLayoutItem as
|
|
17
|
-
const
|
|
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
|
-
],
|
|
196
|
-
function
|
|
197
|
-
return e != null && e.trim() ?
|
|
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
|
|
200
|
-
return !(e != null && e.trim()) ||
|
|
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
|
|
209
|
-
function
|
|
210
|
-
return e && e > 0 ? e :
|
|
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
|
|
213
|
-
const t =
|
|
214
|
-
return
|
|
40
|
+
function to(e) {
|
|
41
|
+
const t = Rt(e), r = [...ge];
|
|
42
|
+
return ge.includes(
|
|
215
43
|
t
|
|
216
|
-
) || (r.push(t), r.sort((
|
|
44
|
+
) || (r.push(t), r.sort((o, n) => o - n)), r;
|
|
217
45
|
}
|
|
218
|
-
function
|
|
46
|
+
function ro(e) {
|
|
219
47
|
var t, r;
|
|
220
|
-
return !!((e.type === "table" || e.type === "detailTable") && e.sql && !
|
|
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
|
|
223
|
-
var
|
|
50
|
+
function Et(e, t) {
|
|
51
|
+
var o, n, i, a;
|
|
224
52
|
if (t === "table-print")
|
|
225
53
|
return "disabled";
|
|
226
|
-
if ((
|
|
54
|
+
if ((n = (o = e.preferences) == null ? void 0 : o.tablePrefs) != null && n.forceClientPagination)
|
|
227
55
|
return "client";
|
|
228
|
-
const r =
|
|
229
|
-
return e.sql && !r ? (a = (i = e.preferences) == null ? void 0 : i.tablePrefs) != null && a.enableDevModePagination ? "server" : "client" : r &&
|
|
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
|
|
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:
|
|
65
|
+
tableSettings: Se,
|
|
238
66
|
notices: []
|
|
239
67
|
};
|
|
240
|
-
function
|
|
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
|
|
244
|
-
return e.isDashboardEditing ?
|
|
71
|
+
function _t(e) {
|
|
72
|
+
return e.isDashboardEditing ? Se : e.viewer.tableSettings;
|
|
245
73
|
}
|
|
246
|
-
function
|
|
247
|
-
return
|
|
74
|
+
function Nt(e, t) {
|
|
75
|
+
return _t(e)[t];
|
|
248
76
|
}
|
|
249
|
-
function
|
|
250
|
-
if (!(r.isEditorPreview || e.isDashboardEditing) &&
|
|
251
|
-
return { settings:
|
|
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
|
|
81
|
+
function Vt(e) {
|
|
254
82
|
var t;
|
|
255
|
-
return
|
|
83
|
+
return ze({
|
|
256
84
|
card: e.card,
|
|
257
|
-
paginationMode:
|
|
85
|
+
paginationMode: Et(e.card) === "server" ? "server" : "client",
|
|
258
86
|
result: {
|
|
259
|
-
keys: e.keys ??
|
|
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
|
|
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),
|
|
272
|
-
return (0.299 * t + 0.587 * r + 0.114 *
|
|
273
|
-
},
|
|
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
|
-
}),
|
|
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:
|
|
145
|
+
linkFormat: qt(),
|
|
318
146
|
colorRanges: []
|
|
319
147
|
});
|
|
320
|
-
function
|
|
148
|
+
function so(e, t, r, o) {
|
|
321
149
|
return t && t !== "auto" ? t : r;
|
|
322
150
|
}
|
|
323
|
-
const
|
|
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
|
|
335
|
-
const t =
|
|
336
|
-
return !!(t &&
|
|
162
|
+
function Lt(e) {
|
|
163
|
+
const t = R(e == null ? void 0 : e.format);
|
|
164
|
+
return !!(t && Me(t));
|
|
337
165
|
}
|
|
338
|
-
function
|
|
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
|
-
],
|
|
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
|
|
360
|
-
|
|
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
|
|
366
|
-
|
|
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((
|
|
376
|
-
var f,
|
|
203
|
+
].filter((d) => d !== void 0), u = o.map((d) => {
|
|
204
|
+
var f, x;
|
|
377
205
|
return {
|
|
378
|
-
...
|
|
206
|
+
...d,
|
|
379
207
|
bindings: [
|
|
380
|
-
|
|
208
|
+
Mt(
|
|
381
209
|
t.columnKeyMap,
|
|
382
|
-
|
|
383
|
-
|
|
210
|
+
d.field.id,
|
|
211
|
+
d.role
|
|
384
212
|
),
|
|
385
|
-
|
|
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
|
-
}),
|
|
389
|
-
(
|
|
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
|
|
221
|
+
return m.length ? n(m) : n(
|
|
394
222
|
u.filter(
|
|
395
|
-
(
|
|
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
|
|
403
|
-
|
|
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
|
-
(
|
|
240
|
+
(m) => m !== void 0 && i(m) === i(u)
|
|
413
241
|
)
|
|
414
242
|
)
|
|
415
243
|
)
|
|
416
244
|
);
|
|
417
245
|
}
|
|
418
|
-
function
|
|
419
|
-
return
|
|
246
|
+
function zt(e, t, r) {
|
|
247
|
+
return Q(e, {
|
|
420
248
|
fieldId: t.id,
|
|
421
249
|
fieldRole: "groupby"
|
|
422
|
-
}) ??
|
|
250
|
+
}) ?? Q(
|
|
423
251
|
e,
|
|
424
252
|
r ? {
|
|
425
253
|
columnIds: [t.alias, t.name, t.id].filter(
|
|
426
|
-
(
|
|
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
|
|
434
|
-
return e.map((
|
|
435
|
-
const
|
|
261
|
+
function uo(e, t, r) {
|
|
262
|
+
return e.map((o) => {
|
|
263
|
+
const n = zt(
|
|
436
264
|
t,
|
|
437
|
-
|
|
265
|
+
o,
|
|
438
266
|
r
|
|
439
267
|
);
|
|
440
|
-
if (!
|
|
441
|
-
const { format: i, ...a } =
|
|
268
|
+
if (!n) return o;
|
|
269
|
+
const { format: i, ...a } = o;
|
|
442
270
|
return {
|
|
443
271
|
...a,
|
|
444
|
-
...
|
|
445
|
-
...
|
|
272
|
+
...n.label ? { label: n.label } : {},
|
|
273
|
+
...n.format !== void 0 ? { format: n.format } : {}
|
|
446
274
|
};
|
|
447
275
|
});
|
|
448
276
|
}
|
|
449
|
-
function
|
|
450
|
-
const r = typeof e.decimalPlaces == "number",
|
|
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:
|
|
453
|
-
maximumFractionDigits: Math.max(
|
|
280
|
+
minimumFractionDigits: o,
|
|
281
|
+
maximumFractionDigits: Math.max(o, n)
|
|
454
282
|
};
|
|
455
283
|
}
|
|
456
|
-
function
|
|
457
|
-
const r =
|
|
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 && !
|
|
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
|
|
475
|
-
switch (t === "auto" && (t =
|
|
302
|
+
function Oe(e, t = "auto", r = {}) {
|
|
303
|
+
switch (t === "auto" && (t = Gt(e, r)), t) {
|
|
476
304
|
case "number":
|
|
477
|
-
return
|
|
305
|
+
return Ae(e, r);
|
|
478
306
|
case "currency":
|
|
479
|
-
return
|
|
307
|
+
return we(e, r);
|
|
480
308
|
case "percent":
|
|
481
|
-
return
|
|
309
|
+
return Ht(e, r);
|
|
482
310
|
case "date":
|
|
483
|
-
return
|
|
311
|
+
return jt(e, r);
|
|
484
312
|
case "scientific":
|
|
485
|
-
return
|
|
313
|
+
return Ut(e, r);
|
|
486
314
|
case "duration":
|
|
487
|
-
return
|
|
315
|
+
return kt(e, r);
|
|
488
316
|
default:
|
|
489
317
|
return String(e);
|
|
490
318
|
}
|
|
491
319
|
}
|
|
492
|
-
function
|
|
320
|
+
function Ae(e, t = {}) {
|
|
493
321
|
return e < 0 && !!t.prefix && !t.negativeInParentheses ? `-${Z(
|
|
494
322
|
Math.abs(e),
|
|
495
|
-
|
|
323
|
+
q(t, {
|
|
496
324
|
min: 0,
|
|
497
325
|
max: 0
|
|
498
326
|
})
|
|
499
327
|
)}` : Z(
|
|
500
328
|
e,
|
|
501
|
-
|
|
329
|
+
q(t, {
|
|
502
330
|
min: 0,
|
|
503
331
|
max: 0
|
|
504
332
|
})
|
|
505
333
|
);
|
|
506
334
|
}
|
|
507
|
-
function
|
|
508
|
-
return
|
|
509
|
-
...
|
|
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
|
|
518
|
-
const r =
|
|
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
|
|
358
|
+
function jt(e, t = {}) {
|
|
531
359
|
const { locale: r = "en-US" } = t;
|
|
532
360
|
try {
|
|
533
|
-
const
|
|
534
|
-
return isNaN(
|
|
361
|
+
const o = new Date(e);
|
|
362
|
+
return isNaN(o.getTime()) ? String(e) : new Intl.DateTimeFormat(r, {
|
|
535
363
|
dateStyle: "short"
|
|
536
|
-
}).format(
|
|
364
|
+
}).format(o);
|
|
537
365
|
} catch {
|
|
538
366
|
return String(e);
|
|
539
367
|
}
|
|
540
368
|
}
|
|
541
|
-
function
|
|
542
|
-
return
|
|
369
|
+
function Ut(e, t = {}) {
|
|
370
|
+
return yt(
|
|
543
371
|
e,
|
|
544
|
-
|
|
372
|
+
q(t, { min: 2, max: 2 })
|
|
545
373
|
);
|
|
546
374
|
}
|
|
547
|
-
function
|
|
548
|
-
return
|
|
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
|
|
387
|
+
function Gt(e, t) {
|
|
560
388
|
return t.currency ? "currency" : typeof e == "string" && !isNaN(Date.parse(e)) ? "date" : "number";
|
|
561
389
|
}
|
|
562
|
-
function
|
|
563
|
-
return (r) =>
|
|
390
|
+
function lo(e, t = {}) {
|
|
391
|
+
return (r) => Oe(r, e, t);
|
|
564
392
|
}
|
|
565
|
-
function
|
|
393
|
+
function $t({
|
|
566
394
|
number: e,
|
|
567
395
|
decimalPlaces: t = 0,
|
|
568
396
|
useSuffix: r = !1,
|
|
569
|
-
customSuffix:
|
|
570
|
-
currency:
|
|
397
|
+
customSuffix: o = "",
|
|
398
|
+
currency: n = "",
|
|
571
399
|
locale: i = "en-US"
|
|
572
400
|
}) {
|
|
573
|
-
if (
|
|
574
|
-
const a =
|
|
575
|
-
currency:
|
|
401
|
+
if (n) {
|
|
402
|
+
const a = we(e, {
|
|
403
|
+
currency: n,
|
|
576
404
|
decimalPlaces: t,
|
|
577
405
|
locale: i,
|
|
578
|
-
useSuffix: r && !
|
|
406
|
+
useSuffix: r && !o
|
|
579
407
|
});
|
|
580
|
-
return r &&
|
|
408
|
+
return r && o ? `${a}${o}` : a;
|
|
581
409
|
}
|
|
582
|
-
return
|
|
410
|
+
return Ae(e, {
|
|
583
411
|
decimalPlaces: t,
|
|
584
|
-
useSuffix: r && !
|
|
585
|
-
suffix:
|
|
412
|
+
useSuffix: r && !o,
|
|
413
|
+
suffix: o,
|
|
586
414
|
locale: i
|
|
587
415
|
});
|
|
588
416
|
}
|
|
589
|
-
var
|
|
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
|
|
421
|
+
var o, n, i;
|
|
594
422
|
if (Array.isArray(t)) {
|
|
595
|
-
if (
|
|
596
|
-
for (
|
|
597
|
-
if (!e(t[
|
|
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),
|
|
604
|
-
for (
|
|
605
|
-
if (!Object.prototype.hasOwnProperty.call(r, i[
|
|
606
|
-
for (
|
|
607
|
-
var a = i[
|
|
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
|
|
616
|
-
function
|
|
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
|
|
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((
|
|
457
|
+
Object.keys(r).forEach((o) => t.add(o));
|
|
630
458
|
}), [...t];
|
|
631
459
|
}
|
|
632
|
-
function
|
|
633
|
-
return
|
|
634
|
-
(r) => e == null ? void 0 : e.some((
|
|
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
|
|
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
|
|
470
|
+
function De(e) {
|
|
643
471
|
const t = e.context.preferences;
|
|
644
472
|
if (!t)
|
|
645
473
|
return e.authoredFormat;
|
|
646
|
-
const r =
|
|
647
|
-
return
|
|
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
|
|
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" ?
|
|
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,
|
|
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:
|
|
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:
|
|
501
|
+
format: n
|
|
674
502
|
};
|
|
675
503
|
}
|
|
676
|
-
function
|
|
677
|
-
var
|
|
504
|
+
function mo(e) {
|
|
505
|
+
var n, i;
|
|
678
506
|
const t = new Set(
|
|
679
|
-
|
|
507
|
+
Zt(e.records)
|
|
680
508
|
), r = new Set(
|
|
681
509
|
e.renderedMetricKeys || e.resultKeys
|
|
682
|
-
),
|
|
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 =
|
|
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
|
|
518
|
+
function fo(e) {
|
|
691
519
|
var i, a;
|
|
692
520
|
const { card: t, context: r } = e;
|
|
693
|
-
if (!(r != null && r.preferences) || !
|
|
521
|
+
if (!(r != null && r.preferences) || !Ie(t.type))
|
|
694
522
|
return t;
|
|
695
|
-
const
|
|
696
|
-
(c) =>
|
|
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 (!
|
|
531
|
+
if (!I(u))
|
|
704
532
|
return c;
|
|
705
|
-
const
|
|
706
|
-
return s.source === "inferred" && !
|
|
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" ?
|
|
536
|
+
format: s.source === "inferred" ? M(
|
|
709
537
|
u,
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
) :
|
|
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:
|
|
552
|
+
metricColumns: n
|
|
725
553
|
}
|
|
726
554
|
};
|
|
727
555
|
}
|
|
728
|
-
function
|
|
556
|
+
function H(e) {
|
|
729
557
|
var s;
|
|
730
|
-
const { card: t, context: r, formatOptions:
|
|
731
|
-
if (!t || !
|
|
732
|
-
return
|
|
733
|
-
if (!
|
|
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
|
-
(
|
|
736
|
-
),
|
|
737
|
-
(
|
|
563
|
+
(d) => !!d
|
|
564
|
+
), m = u.some(
|
|
565
|
+
(d) => I(d.format)
|
|
738
566
|
);
|
|
739
|
-
return u.length < 2 || !
|
|
740
|
-
|
|
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
|
-
(
|
|
747
|
-
),
|
|
748
|
-
(
|
|
574
|
+
(d) => !!d
|
|
575
|
+
), m = u.filter(
|
|
576
|
+
(d) => I(d.format)
|
|
749
577
|
);
|
|
750
|
-
if (
|
|
751
|
-
return
|
|
752
|
-
if (
|
|
753
|
-
return
|
|
754
|
-
|
|
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 =
|
|
586
|
+
const i = Ce(o, {
|
|
759
587
|
preserveOmittedProperties: !0
|
|
760
588
|
});
|
|
761
|
-
if (!
|
|
762
|
-
return
|
|
589
|
+
if (!I(i))
|
|
590
|
+
return o;
|
|
763
591
|
const a = e.metrics.flatMap((u) => {
|
|
764
592
|
if (!u)
|
|
765
593
|
return [];
|
|
766
|
-
const
|
|
594
|
+
const m = oe(t, u);
|
|
767
595
|
return [
|
|
768
|
-
|
|
596
|
+
M(
|
|
769
597
|
i,
|
|
770
|
-
|
|
771
|
-
|
|
598
|
+
n,
|
|
599
|
+
m ? r.resolveBoundCurrency(m) : void 0
|
|
772
600
|
)
|
|
773
601
|
];
|
|
774
602
|
});
|
|
775
603
|
if (a.length === 0)
|
|
776
|
-
return
|
|
777
|
-
|
|
604
|
+
return S(
|
|
605
|
+
M(i, n),
|
|
778
606
|
{ preserveOmittedProperties: !0 }
|
|
779
607
|
);
|
|
780
608
|
const [c] = a;
|
|
781
|
-
if (a.some((u) => !
|
|
782
|
-
const u =
|
|
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
|
-
|
|
616
|
+
n
|
|
789
617
|
);
|
|
790
|
-
return
|
|
618
|
+
return S(u, {
|
|
791
619
|
preserveOmittedProperties: !0
|
|
792
620
|
});
|
|
793
621
|
}
|
|
794
|
-
return
|
|
622
|
+
return S(c, {
|
|
795
623
|
preserveOmittedProperties: !0
|
|
796
624
|
});
|
|
797
625
|
}
|
|
798
|
-
const
|
|
626
|
+
const Jt = /* @__PURE__ */ new Set([
|
|
799
627
|
"horizontalBar",
|
|
800
628
|
"tornado",
|
|
801
629
|
"pyramid",
|
|
802
630
|
"range"
|
|
803
|
-
]),
|
|
631
|
+
]), er = /* @__PURE__ */ new Set([
|
|
804
632
|
"tornado",
|
|
805
633
|
"pyramid",
|
|
806
634
|
"range"
|
|
807
|
-
]),
|
|
635
|
+
]), tr = /* @__PURE__ */ new Set([
|
|
808
636
|
"tornado",
|
|
809
637
|
"pyramid",
|
|
810
638
|
"range"
|
|
811
639
|
]);
|
|
812
|
-
function
|
|
813
|
-
const { chartType: t, resultKeys: r, config:
|
|
814
|
-
return [a, c, s].filter((
|
|
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
|
|
817
|
-
const { chartType: t, resultKeys: r, preferences:
|
|
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
|
-
|
|
648
|
+
rr({
|
|
821
649
|
chartType: t,
|
|
822
650
|
resultKeys: r,
|
|
823
|
-
config:
|
|
651
|
+
config: o == null ? void 0 : o.bubbleScatterConfig
|
|
824
652
|
})
|
|
825
653
|
)
|
|
826
|
-
] :
|
|
654
|
+
] : tr.has(t || "") ? r.slice(2) : r.length === 1 ? [r[0]] : r.slice(1);
|
|
827
655
|
}
|
|
828
|
-
function
|
|
656
|
+
function E(e, t) {
|
|
829
657
|
var r;
|
|
830
|
-
return ((r = t == null ? void 0 : t.chartOptions) == null ? void 0 : r.indexAxis) === "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
|
|
833
|
-
return
|
|
660
|
+
function go(e, t) {
|
|
661
|
+
return E(e, t) === "x";
|
|
834
662
|
}
|
|
835
|
-
function
|
|
836
|
-
return
|
|
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
|
|
669
|
+
function Be(e) {
|
|
842
670
|
if (e)
|
|
843
671
|
return e.alias || e.label || e.name;
|
|
844
672
|
}
|
|
845
|
-
function
|
|
846
|
-
var
|
|
847
|
-
return (((
|
|
848
|
-
const i =
|
|
849
|
-
return t.metricId &&
|
|
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
|
|
853
|
-
var
|
|
854
|
-
const r =
|
|
855
|
-
if (!(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
|
|
859
|
-
return !!e && !(e != null && e.format) &&
|
|
686
|
+
function nr(e) {
|
|
687
|
+
return !!e && !(e != null && e.format) && st(e == null ? void 0 : e.dataType) === "number";
|
|
860
688
|
}
|
|
861
|
-
const
|
|
689
|
+
const ir = {
|
|
862
690
|
style: "decimal",
|
|
863
691
|
showDataBar: !1,
|
|
864
692
|
dataBarColor: "#3b82f6"
|
|
865
693
|
};
|
|
866
|
-
function
|
|
694
|
+
function Ke(e) {
|
|
867
695
|
if (!e)
|
|
868
696
|
return;
|
|
869
|
-
const t =
|
|
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
|
-
...
|
|
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
|
|
716
|
+
function bo(e) {
|
|
889
717
|
return Object.fromEntries(
|
|
890
718
|
Object.entries(e || {}).map(([t, r]) => [
|
|
891
719
|
t,
|
|
892
|
-
|
|
720
|
+
Ke(r)
|
|
893
721
|
])
|
|
894
722
|
);
|
|
895
723
|
}
|
|
896
|
-
function
|
|
724
|
+
function V(e) {
|
|
897
725
|
return !!(e && typeof e == "object" && !Array.isArray(e) && Object.getPrototypeOf(e) === Object.prototype);
|
|
898
726
|
}
|
|
899
|
-
function
|
|
900
|
-
if (!
|
|
727
|
+
function Re(e, t, r) {
|
|
728
|
+
if (!V(r))
|
|
901
729
|
return r;
|
|
902
|
-
const
|
|
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
|
-
|
|
736
|
+
o,
|
|
909
737
|
a
|
|
910
|
-
), u =
|
|
911
|
-
if (s &&
|
|
912
|
-
i[a] =
|
|
738
|
+
), u = n[a];
|
|
739
|
+
if (s && L(c, u)) {
|
|
740
|
+
i[a] = o[a];
|
|
913
741
|
continue;
|
|
914
742
|
}
|
|
915
|
-
if (!s &&
|
|
743
|
+
if (!s && L(c, u))
|
|
916
744
|
continue;
|
|
917
|
-
const
|
|
918
|
-
|
|
745
|
+
const m = Re(
|
|
746
|
+
o[a],
|
|
919
747
|
u,
|
|
920
748
|
c
|
|
921
749
|
);
|
|
922
|
-
|
|
750
|
+
V(m) && Object.keys(m).length === 0 && !s || (i[a] = m);
|
|
923
751
|
}
|
|
924
752
|
return i;
|
|
925
753
|
}
|
|
926
|
-
function
|
|
927
|
-
let t =
|
|
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
|
|
763
|
+
throw new bt(
|
|
936
764
|
"invalid_raw_temporal_format",
|
|
937
765
|
"Custom table date formatting requires a non-empty pattern."
|
|
938
766
|
);
|
|
939
|
-
|
|
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" && !
|
|
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
|
|
966
|
-
return e.reset ?
|
|
793
|
+
function Fo(e) {
|
|
794
|
+
return e.reset ? sr(e.persisted, e.columnId) : {
|
|
967
795
|
...e.persisted,
|
|
968
|
-
[e.columnId]:
|
|
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
|
|
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
|
|
985
|
-
const r = e ||
|
|
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:
|
|
993
|
-
maximumFractionDigits:
|
|
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
|
|
831
|
+
function Y(e) {
|
|
1004
832
|
if (e)
|
|
1005
833
|
return e.trim().toLowerCase();
|
|
1006
834
|
}
|
|
1007
|
-
const
|
|
1008
|
-
function
|
|
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(
|
|
838
|
+
return t ? t.replace(Ee, "").trim() || t : void 0;
|
|
1011
839
|
}
|
|
1012
|
-
function
|
|
840
|
+
function lr(e) {
|
|
1013
841
|
const t = e == null ? void 0 : e.trim();
|
|
1014
|
-
return t ?
|
|
842
|
+
return t ? Ee.test(t) : !1;
|
|
1015
843
|
}
|
|
1016
|
-
function
|
|
844
|
+
function mr(e, t) {
|
|
1017
845
|
return t.metricAlias ? e.find(
|
|
1018
|
-
(r) =>
|
|
846
|
+
(r) => lt(r) === t.metricAlias
|
|
1019
847
|
) : t.metricId ? e.find((r) => r.id === t.metricId) : void 0;
|
|
1020
848
|
}
|
|
1021
|
-
function
|
|
1022
|
-
var
|
|
849
|
+
function dr(e) {
|
|
850
|
+
var b;
|
|
1023
851
|
const {
|
|
1024
852
|
card: t,
|
|
1025
853
|
metricId: r,
|
|
1026
|
-
metricAlias:
|
|
1027
|
-
datasetIndex:
|
|
854
|
+
metricAlias: o,
|
|
855
|
+
datasetIndex: n,
|
|
1028
856
|
datasetLabel: i,
|
|
1029
857
|
metricKey: a
|
|
1030
|
-
} = e, c = ((
|
|
1031
|
-
if (
|
|
1032
|
-
return
|
|
1033
|
-
metricAlias:
|
|
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
|
-
(
|
|
1038
|
-
),
|
|
1039
|
-
(
|
|
865
|
+
(l) => lr(l)
|
|
866
|
+
), m = s.filter(
|
|
867
|
+
(l) => !!l
|
|
1040
868
|
);
|
|
1041
|
-
for (const
|
|
1042
|
-
const
|
|
1043
|
-
columnId:
|
|
1044
|
-
metricAlias:
|
|
869
|
+
for (const l of m) {
|
|
870
|
+
const g = J(t, {
|
|
871
|
+
columnId: l,
|
|
872
|
+
metricAlias: l
|
|
1045
873
|
});
|
|
1046
|
-
if (
|
|
1047
|
-
return
|
|
874
|
+
if (g)
|
|
875
|
+
return g;
|
|
1048
876
|
}
|
|
1049
|
-
const
|
|
1050
|
-
for (const
|
|
1051
|
-
const
|
|
1052
|
-
columnId:
|
|
1053
|
-
metricAlias:
|
|
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 (
|
|
1056
|
-
return
|
|
883
|
+
if (g)
|
|
884
|
+
return g;
|
|
1057
885
|
}
|
|
1058
886
|
if (c.length === 1)
|
|
1059
887
|
return c[0];
|
|
1060
|
-
if (!u && typeof
|
|
1061
|
-
return c[
|
|
1062
|
-
const
|
|
1063
|
-
...
|
|
1064
|
-
...
|
|
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 (
|
|
1067
|
-
return c.find((
|
|
1068
|
-
const
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
].map((
|
|
1074
|
-
return
|
|
1075
|
-
(
|
|
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
|
|
1080
|
-
const t =
|
|
1081
|
-
return
|
|
907
|
+
function fr(e) {
|
|
908
|
+
const t = R(e == null ? void 0 : e.format);
|
|
909
|
+
return S(t);
|
|
1082
910
|
}
|
|
1083
|
-
function
|
|
911
|
+
function be(e, t) {
|
|
1084
912
|
if (t)
|
|
1085
|
-
return
|
|
913
|
+
return J(e, {
|
|
1086
914
|
columnId: t,
|
|
1087
915
|
metricAlias: t
|
|
1088
916
|
});
|
|
1089
917
|
}
|
|
1090
|
-
function
|
|
1091
|
-
const t =
|
|
918
|
+
function Fe(e) {
|
|
919
|
+
const t = Ce(e);
|
|
1092
920
|
if (t)
|
|
1093
921
|
return JSON.stringify(t);
|
|
1094
922
|
}
|
|
1095
|
-
function
|
|
1096
|
-
const r =
|
|
1097
|
-
return !!(r &&
|
|
923
|
+
function yr(e, t) {
|
|
924
|
+
const r = Fe(e), o = Fe(t);
|
|
925
|
+
return !!(r && o && r === o);
|
|
1098
926
|
}
|
|
1099
|
-
function
|
|
927
|
+
function gr(e) {
|
|
1100
928
|
if (e.length === 0)
|
|
1101
929
|
return;
|
|
1102
930
|
const t = e.map(
|
|
1103
|
-
(a) =>
|
|
931
|
+
(a) => fr(a)
|
|
1104
932
|
);
|
|
1105
933
|
if (!t.every(
|
|
1106
934
|
(a) => K(a)
|
|
1107
935
|
))
|
|
1108
936
|
return;
|
|
1109
|
-
const
|
|
1110
|
-
return
|
|
1111
|
-
(a) =>
|
|
1112
|
-
) ?
|
|
937
|
+
const o = t, [n] = o;
|
|
938
|
+
return o.every(
|
|
939
|
+
(a) => yr(n, a)
|
|
940
|
+
) ? n : void 0;
|
|
1113
941
|
}
|
|
1114
|
-
function
|
|
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
|
|
1119
|
-
const t =
|
|
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 =
|
|
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
|
|
1144
|
-
return K(
|
|
1145
|
-
formatOptions:
|
|
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
|
|
1153
|
-
var s, u,
|
|
1154
|
-
const { card: t, chartType: r, axis:
|
|
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
|
|
1159
|
-
const
|
|
1160
|
-
return ((
|
|
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 (
|
|
991
|
+
if (o === "y2")
|
|
1164
992
|
return [];
|
|
1165
|
-
const
|
|
993
|
+
const d = be(
|
|
1166
994
|
t,
|
|
1167
|
-
(u =
|
|
1168
|
-
) || i[0], f =
|
|
995
|
+
(u = n == null ? void 0 : n.bubbleScatterConfig) == null ? void 0 : u.xMetricKey
|
|
996
|
+
) || i[0], f = be(
|
|
1169
997
|
t,
|
|
1170
|
-
(
|
|
998
|
+
(m = n == null ? void 0 : n.bubbleScatterConfig) == null ? void 0 : m.yMetricKey
|
|
1171
999
|
) || i[1] || i[0];
|
|
1172
|
-
return
|
|
1000
|
+
return o === "x" ? d ? [d] : [] : f ? [f] : [];
|
|
1173
1001
|
}
|
|
1174
|
-
const c =
|
|
1175
|
-
return r === "radar" ?
|
|
1002
|
+
const c = E(r, n);
|
|
1003
|
+
return r === "radar" ? o === "y" ? i : [] : o !== c ? [] : i;
|
|
1176
1004
|
}
|
|
1177
|
-
function
|
|
1178
|
-
const { card: t, chartType: r, axis:
|
|
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:
|
|
1182
|
-
preferences:
|
|
1183
|
-
}), c =
|
|
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:
|
|
1015
|
+
preferences: n
|
|
1188
1016
|
});
|
|
1189
1017
|
return {
|
|
1190
1018
|
...c,
|
|
1191
|
-
formatOptions:
|
|
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
|
|
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 qe(e, t) {
|
|
|
1204
1032
|
};
|
|
1205
1033
|
return t && t !== "auto" && t !== "none" && !r.type && (r.type = t), r;
|
|
1206
1034
|
}
|
|
1207
|
-
function
|
|
1208
|
-
const { preferences: t, metric: r } = e,
|
|
1209
|
-
formatMode:
|
|
1210
|
-
legacyMode:
|
|
1211
|
-
overrideFormatOptions:
|
|
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
|
-
...
|
|
1217
|
-
formatOptions:
|
|
1044
|
+
...n,
|
|
1045
|
+
formatOptions: H({
|
|
1218
1046
|
card: e.card,
|
|
1219
1047
|
metrics: e.metric ? [e.metric] : [],
|
|
1220
|
-
formatOptions:
|
|
1048
|
+
formatOptions: n.formatOptions,
|
|
1221
1049
|
context: e.numericPresentation
|
|
1222
1050
|
})
|
|
1223
1051
|
};
|
|
1224
1052
|
}
|
|
1225
|
-
function
|
|
1226
|
-
return t ===
|
|
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
|
|
1056
|
+
function ae(e) {
|
|
1229
1057
|
const { chartType: t, preferences: r } = e;
|
|
1230
|
-
return t === "bubble" || t === "scatter" ? "y" :
|
|
1058
|
+
return t === "bubble" || t === "scatter" ? "y" : E(t, r);
|
|
1231
1059
|
}
|
|
1232
|
-
function
|
|
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
|
|
1246
|
-
const { card: t, chartType: r, preferences:
|
|
1073
|
+
function vo(e) {
|
|
1074
|
+
const { card: t, chartType: r, preferences: o, metric: n } = e, i = Fr({
|
|
1247
1075
|
card: t,
|
|
1248
|
-
preferences:
|
|
1249
|
-
metric:
|
|
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 ||
|
|
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:
|
|
1259
|
-
axisConfig:
|
|
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
|
|
1265
|
-
const { card: t, chartType: r, preferences:
|
|
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:
|
|
1268
|
-
}), c =
|
|
1095
|
+
preferences: o
|
|
1096
|
+
}), c = _e({
|
|
1269
1097
|
card: t,
|
|
1270
1098
|
chartType: i,
|
|
1271
1099
|
axis: a,
|
|
1272
|
-
preferences:
|
|
1273
|
-
}), s =
|
|
1274
|
-
formatMode:
|
|
1275
|
-
legacyMode:
|
|
1276
|
-
overrideFormatOptions:
|
|
1277
|
-
|
|
1278
|
-
|
|
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:
|
|
1109
|
+
preferences: o
|
|
1282
1110
|
}), u = {
|
|
1283
1111
|
...s,
|
|
1284
|
-
formatOptions:
|
|
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" || !
|
|
1119
|
+
if (u.source === "override" || !Ve(i))
|
|
1292
1120
|
return u;
|
|
1293
|
-
const
|
|
1121
|
+
const m = ne({
|
|
1294
1122
|
card: t,
|
|
1295
1123
|
chartType: i,
|
|
1296
1124
|
axis: a,
|
|
1297
|
-
preferences:
|
|
1298
|
-
axisConfig:
|
|
1299
|
-
|
|
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
|
|
1133
|
+
return m.source === "override" ? m : u;
|
|
1306
1134
|
}
|
|
1307
|
-
function
|
|
1308
|
-
const { preferences: t, dataLabelsConfig: r, metric:
|
|
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:
|
|
1139
|
+
overrideFormatOptions: Ne(
|
|
1312
1140
|
r == null ? void 0 : r.formatOptions,
|
|
1313
1141
|
r == null ? void 0 : r.format
|
|
1314
1142
|
),
|
|
1315
|
-
metrics:
|
|
1143
|
+
metrics: o ? [o] : [],
|
|
1316
1144
|
preferences: t
|
|
1317
1145
|
});
|
|
1318
1146
|
return {
|
|
1319
|
-
...
|
|
1320
|
-
formatOptions:
|
|
1147
|
+
...n,
|
|
1148
|
+
formatOptions: H({
|
|
1321
1149
|
card: e.card,
|
|
1322
1150
|
metrics: e.metric ? [e.metric] : [],
|
|
1323
|
-
formatOptions:
|
|
1151
|
+
formatOptions: n.formatOptions,
|
|
1324
1152
|
context: e.numericPresentation
|
|
1325
1153
|
})
|
|
1326
1154
|
};
|
|
1327
1155
|
}
|
|
1328
|
-
function
|
|
1156
|
+
function Co(e) {
|
|
1329
1157
|
var a, c;
|
|
1330
|
-
const t =
|
|
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 =
|
|
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
|
|
1347
|
-
if (!
|
|
1174
|
+
const o = (a = e.card) == null ? void 0 : a.type;
|
|
1175
|
+
if (!Ve(o))
|
|
1348
1176
|
return r;
|
|
1349
|
-
let
|
|
1350
|
-
chartType:
|
|
1177
|
+
let n = ae({
|
|
1178
|
+
chartType: o,
|
|
1351
1179
|
preferences: e.preferences
|
|
1352
1180
|
});
|
|
1353
|
-
if (
|
|
1181
|
+
if (o === "combo" && typeof e.datasetIndex == "number") {
|
|
1354
1182
|
const u = (((c = e.preferences) == null ? void 0 : c.datasetOptions) || []).find(
|
|
1355
|
-
(
|
|
1183
|
+
(m) => m.idx === e.datasetIndex
|
|
1356
1184
|
);
|
|
1357
|
-
|
|
1185
|
+
n = (u == null ? void 0 : u.yAxisId) === "y2" ? "y2" : "y";
|
|
1358
1186
|
}
|
|
1359
|
-
const i =
|
|
1187
|
+
const i = ne({
|
|
1360
1188
|
card: e.card,
|
|
1361
|
-
chartType:
|
|
1362
|
-
axis:
|
|
1189
|
+
chartType: o,
|
|
1190
|
+
axis: n,
|
|
1363
1191
|
preferences: e.preferences,
|
|
1364
|
-
axisConfig:
|
|
1192
|
+
axisConfig: ie(
|
|
1365
1193
|
e.preferences,
|
|
1366
|
-
|
|
1367
|
-
|
|
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
|
|
1201
|
+
function ho(e) {
|
|
1374
1202
|
return (e == null ? void 0 : e.rawValue) === !0;
|
|
1375
1203
|
}
|
|
1376
|
-
function
|
|
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
|
|
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",
|
|
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:
|
|
1390
|
-
minimumFractionDigits:
|
|
1391
|
-
maximumFractionDigits:
|
|
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
|
|
1402
|
-
const
|
|
1403
|
-
|
|
1404
|
-
|
|
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 ||
|
|
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
|
|
1432
|
-
var
|
|
1259
|
+
function qe(e) {
|
|
1260
|
+
var F, C, O, w;
|
|
1433
1261
|
const {
|
|
1434
1262
|
card: t,
|
|
1435
1263
|
columnId: r,
|
|
1436
|
-
persistedSettings:
|
|
1437
|
-
resolvedSettings:
|
|
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:
|
|
1444
|
-
valueFormatPreferences:
|
|
1271
|
+
columnKeyMap: m,
|
|
1272
|
+
valueFormatPreferences: d,
|
|
1445
1273
|
boundCurrency: f,
|
|
1446
|
-
preserveOmittedProperties:
|
|
1447
|
-
} = e,
|
|
1448
|
-
|
|
1449
|
-
),
|
|
1450
|
-
if (
|
|
1451
|
-
return
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
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:
|
|
1284
|
+
preserveHistoricalPersistedPrecision: h
|
|
1457
1285
|
}
|
|
1458
1286
|
);
|
|
1459
|
-
const
|
|
1287
|
+
const T = _(t, {
|
|
1460
1288
|
columnId: r,
|
|
1461
1289
|
metricId: a,
|
|
1462
1290
|
metricAlias: c,
|
|
1463
|
-
columnKeyMap:
|
|
1291
|
+
columnKeyMap: m,
|
|
1464
1292
|
fieldId: s,
|
|
1465
1293
|
fieldRole: u
|
|
1466
|
-
}), A =
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
),
|
|
1471
|
-
|
|
1472
|
-
|
|
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
|
|
1475
|
-
A ||
|
|
1476
|
-
|
|
1477
|
-
|
|
1302
|
+
return ve(
|
|
1303
|
+
A || B || p || i,
|
|
1304
|
+
l,
|
|
1305
|
+
g,
|
|
1478
1306
|
{
|
|
1479
|
-
preserveHistoricalPersistedPrecision: !!(
|
|
1307
|
+
preserveHistoricalPersistedPrecision: !!(p && h && !A && !B)
|
|
1480
1308
|
}
|
|
1481
1309
|
);
|
|
1482
1310
|
}
|
|
1483
|
-
function
|
|
1311
|
+
function ve(e, t, r, o) {
|
|
1484
1312
|
if (!e || e.type !== "number" || !t)
|
|
1485
1313
|
return e;
|
|
1486
|
-
const
|
|
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 || !
|
|
1317
|
+
if (!i || !I(i))
|
|
1490
1318
|
return e;
|
|
1491
|
-
const a =
|
|
1319
|
+
const a = M(
|
|
1492
1320
|
i,
|
|
1493
1321
|
t,
|
|
1494
1322
|
r
|
|
1495
|
-
), c =
|
|
1323
|
+
), c = he(a, {
|
|
1496
1324
|
preserveOmittedProperties: !0
|
|
1497
1325
|
});
|
|
1498
1326
|
return c ? {
|
|
1499
1327
|
...e,
|
|
1500
1328
|
numberFormat: {
|
|
1501
|
-
...
|
|
1329
|
+
...n,
|
|
1502
1330
|
...c,
|
|
1503
|
-
showDataBar: (
|
|
1504
|
-
showHeatmap:
|
|
1505
|
-
dataBarColor: (
|
|
1506
|
-
dataBarMinValue:
|
|
1507
|
-
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
|
|
1339
|
+
function z(e) {
|
|
1512
1340
|
if (!e.valueFormatPreferences)
|
|
1513
1341
|
return;
|
|
1514
|
-
const t =
|
|
1342
|
+
const t = qe(e);
|
|
1515
1343
|
if (!t || t.type !== "number")
|
|
1516
1344
|
return;
|
|
1517
|
-
const r =
|
|
1345
|
+
const r = ee(t.numberFormat, {
|
|
1518
1346
|
preserveOmittedProperties: !0
|
|
1519
1347
|
});
|
|
1520
|
-
if (!(!r || !
|
|
1348
|
+
if (!(!r || !Me(r)))
|
|
1521
1349
|
return r;
|
|
1522
1350
|
}
|
|
1523
|
-
function
|
|
1524
|
-
var
|
|
1351
|
+
function hr(e) {
|
|
1352
|
+
var o, n;
|
|
1525
1353
|
if (!e.presentation.preferences)
|
|
1526
1354
|
return;
|
|
1527
|
-
const t =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
1387
|
+
const r = Xe({
|
|
1560
1388
|
card: e.card,
|
|
1561
1389
|
columnKey: e.columnId,
|
|
1562
|
-
metricId: e.metricId ?? (t && !((
|
|
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
|
|
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
|
|
1578
|
-
var c, s, u,
|
|
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
|
|
1581
|
-
(
|
|
1582
|
-
),
|
|
1583
|
-
return
|
|
1584
|
-
|
|
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
|
|
1593
|
-
(
|
|
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 (
|
|
1423
|
+
if (b < 0)
|
|
1596
1424
|
return;
|
|
1597
|
-
const
|
|
1598
|
-
metricIndex:
|
|
1425
|
+
const l = Qe(e.card, {
|
|
1426
|
+
metricIndex: b,
|
|
1599
1427
|
resultColumnKey: e.target.kind === "column" ? e.target.columnKey : void 0
|
|
1600
|
-
}),
|
|
1601
|
-
return
|
|
1602
|
-
|
|
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()) && !
|
|
1608
|
-
const
|
|
1609
|
-
(
|
|
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 (!
|
|
1439
|
+
if (!b)
|
|
1612
1440
|
return;
|
|
1613
|
-
const
|
|
1441
|
+
const l = xe(
|
|
1614
1442
|
e.card,
|
|
1615
|
-
|
|
1616
|
-
),
|
|
1617
|
-
return
|
|
1618
|
-
|
|
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 = ((
|
|
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 :
|
|
1628
|
-
(
|
|
1629
|
-
var
|
|
1630
|
-
return ((
|
|
1631
|
-
columnId:
|
|
1632
|
-
})) == null ? void 0 :
|
|
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
|
-
) ||
|
|
1462
|
+
) || o, a = z({
|
|
1635
1463
|
card: e.card,
|
|
1636
1464
|
columnId: i,
|
|
1637
|
-
metricId:
|
|
1465
|
+
metricId: o,
|
|
1638
1466
|
persistedSettings: r[i],
|
|
1639
1467
|
valueFormatPreferences: e.valueFormatPreferences,
|
|
1640
1468
|
boundCurrency: e.boundCurrency
|
|
1641
1469
|
});
|
|
1642
|
-
return
|
|
1470
|
+
return I(a) ? a : void 0;
|
|
1643
1471
|
}
|
|
1644
|
-
function
|
|
1645
|
-
var r,
|
|
1646
|
-
const t = e.persistedSettings ?? ((i = (
|
|
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 =
|
|
1649
|
-
(c =
|
|
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
|
|
1486
|
+
return S(s, {
|
|
1659
1487
|
preserveOmittedProperties: !0
|
|
1660
1488
|
});
|
|
1661
1489
|
}
|
|
1662
|
-
return
|
|
1663
|
-
|
|
1490
|
+
return xr(
|
|
1491
|
+
qe({
|
|
1664
1492
|
...e,
|
|
1665
1493
|
persistedSettings: t
|
|
1666
1494
|
})
|
|
1667
1495
|
);
|
|
1668
1496
|
}
|
|
1669
|
-
function
|
|
1670
|
-
var
|
|
1671
|
-
const t = (
|
|
1672
|
-
if (!
|
|
1673
|
-
return
|
|
1674
|
-
const i = (
|
|
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
|
-
...
|
|
1677
|
-
decimalPlaces: f ===
|
|
1504
|
+
...n,
|
|
1505
|
+
decimalPlaces: f === x ? x : n.decimalPlaces,
|
|
1678
1506
|
minimumFractionDigits: f,
|
|
1679
1507
|
maximumFractionDigits: Math.max(
|
|
1680
1508
|
f,
|
|
1681
|
-
|
|
1509
|
+
x
|
|
1682
1510
|
)
|
|
1683
1511
|
};
|
|
1684
1512
|
}
|
|
1685
|
-
function
|
|
1686
|
-
var
|
|
1687
|
-
const { value: t, formatOptions: r, preferences:
|
|
1688
|
-
return r != null && r.type && r.type !== "auto" ?
|
|
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: ((
|
|
1691
|
-
useSuffix: !!((i =
|
|
1692
|
-
customSuffix: ((a =
|
|
1693
|
-
locale: ((c =
|
|
1694
|
-
currency: ((s =
|
|
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
|
|
1698
|
-
return
|
|
1525
|
+
function Pr(e) {
|
|
1526
|
+
return ht({
|
|
1699
1527
|
...e,
|
|
1700
|
-
activation:
|
|
1528
|
+
activation: te({
|
|
1701
1529
|
card: e.card,
|
|
1702
1530
|
cardConfig: e.cardConfig
|
|
1703
1531
|
})
|
|
1704
1532
|
});
|
|
1705
1533
|
}
|
|
1706
|
-
function
|
|
1707
|
-
return
|
|
1708
|
-
activation:
|
|
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
|
|
1717
|
-
var
|
|
1718
|
-
const 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: (
|
|
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
|
|
1569
|
+
function Sr(e) {
|
|
1742
1570
|
var r;
|
|
1743
1571
|
const t = (r = e.preferences) == null ? void 0 : r.comparisonPresentation;
|
|
1744
1572
|
return {
|
|
1745
|
-
...
|
|
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
|
|
1752
|
-
var
|
|
1753
|
-
const t =
|
|
1754
|
-
...
|
|
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 =
|
|
1584
|
+
], a = Je(
|
|
1757
1585
|
e.card,
|
|
1758
|
-
|
|
1586
|
+
n,
|
|
1759
1587
|
e.effectiveCardConfig
|
|
1760
|
-
), c =
|
|
1588
|
+
), c = et(
|
|
1761
1589
|
e.card,
|
|
1762
1590
|
e.effectiveCardConfig,
|
|
1763
1591
|
a
|
|
1764
|
-
), s =
|
|
1592
|
+
), s = tt(
|
|
1765
1593
|
t,
|
|
1766
1594
|
i
|
|
1767
1595
|
), u = new Set(
|
|
1768
|
-
s.eligibleTargets.map(
|
|
1769
|
-
),
|
|
1770
|
-
bindings:
|
|
1596
|
+
s.eligibleTargets.map(W)
|
|
1597
|
+
), m = (y) => u.has(W(y)) ? ot({
|
|
1598
|
+
bindings: o.controlBindings,
|
|
1771
1599
|
controls: [
|
|
1772
|
-
...
|
|
1773
|
-
...
|
|
1600
|
+
...o.controlDefinitions ?? [],
|
|
1601
|
+
...o.cardControlDefinitions ?? []
|
|
1774
1602
|
],
|
|
1775
|
-
values:
|
|
1603
|
+
values: o.controlValues,
|
|
1776
1604
|
target: y,
|
|
1777
1605
|
knownTargets: s.knownTargets,
|
|
1778
1606
|
eligibleTargets: s.eligibleTargets
|
|
1779
|
-
}).currency : void 0,
|
|
1607
|
+
}).currency : void 0, d = rt({
|
|
1780
1608
|
card: e.card,
|
|
1781
1609
|
comparisonMetadata: e.comparisonMetadata,
|
|
1782
|
-
columnKeyMap: ((
|
|
1783
|
-
}), f =
|
|
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
|
|
1619
|
+
const x = Pr({
|
|
1792
1620
|
card: e.card,
|
|
1793
1621
|
cardConfig: e.effectiveCardConfig,
|
|
1794
|
-
columns: ((
|
|
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
|
-
}),
|
|
1799
|
-
|
|
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
|
-
),
|
|
1804
|
-
if (e.card.type === "detailTable" &&
|
|
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
|
-
(
|
|
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
|
|
1641
|
+
const C = It({
|
|
1814
1642
|
cardType: e.card.type,
|
|
1815
|
-
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 (
|
|
1826
|
-
if (
|
|
1827
|
-
for (const [
|
|
1828
|
-
|
|
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 (
|
|
1831
|
-
for (const [y,
|
|
1832
|
-
((
|
|
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 (
|
|
1835
|
-
const
|
|
1836
|
-
|
|
1662
|
+
if (F.type !== "date") continue;
|
|
1663
|
+
const C = St(F.dateFormat);
|
|
1664
|
+
C && l.set(
|
|
1837
1665
|
y,
|
|
1838
|
-
|
|
1839
|
-
format:
|
|
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
|
|
1673
|
+
const g = [
|
|
1846
1674
|
...new Set(i)
|
|
1847
1675
|
].flatMap((y) => {
|
|
1848
|
-
var
|
|
1849
|
-
if (
|
|
1676
|
+
var ce, ue, le, me, de, fe;
|
|
1677
|
+
if (x.byColumnKey.has(y) || l.has(y))
|
|
1850
1678
|
return [];
|
|
1851
|
-
const
|
|
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:
|
|
1855
|
-
metricAlias:
|
|
1856
|
-
}),
|
|
1857
|
-
|
|
1858
|
-
),
|
|
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
|
-
},
|
|
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 ((
|
|
1692
|
+
if ((P == null ? void 0 : P.type) === "date")
|
|
1865
1693
|
return [
|
|
1866
1694
|
{
|
|
1867
|
-
scope:
|
|
1868
|
-
target:
|
|
1695
|
+
scope: k,
|
|
1696
|
+
target: G,
|
|
1869
1697
|
format: {
|
|
1870
1698
|
type: "date",
|
|
1871
|
-
locale:
|
|
1872
|
-
...
|
|
1873
|
-
...
|
|
1874
|
-
...
|
|
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 = (
|
|
1706
|
+
const D = (F ? hr({
|
|
1879
1707
|
card: t,
|
|
1880
1708
|
columnId: y,
|
|
1881
1709
|
columnKeyMap: e.columnKeyMap,
|
|
1882
|
-
persistedSettings:
|
|
1883
|
-
metricId:
|
|
1884
|
-
metricAlias:
|
|
1885
|
-
comparisonValueKind:
|
|
1886
|
-
comparisonPrecision: (
|
|
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:
|
|
1717
|
+
resolveBoundCurrency: m
|
|
1890
1718
|
}
|
|
1891
|
-
}) : void 0) ?? (w ?
|
|
1719
|
+
}) : void 0) ?? (w ? pr({
|
|
1892
1720
|
card: t,
|
|
1893
|
-
target:
|
|
1721
|
+
target: O,
|
|
1894
1722
|
resultColumnKeys: i,
|
|
1895
1723
|
valueFormatPreferences: e.reportContext.valueFormat,
|
|
1896
|
-
boundCurrency:
|
|
1897
|
-
}) : void 0) ??
|
|
1724
|
+
boundCurrency: se
|
|
1725
|
+
}) : void 0) ?? z({
|
|
1898
1726
|
card: t,
|
|
1899
1727
|
columnId: y,
|
|
1900
1728
|
columnKeyMap: e.columnKeyMap,
|
|
1901
|
-
metricId:
|
|
1902
|
-
persistedSettings:
|
|
1729
|
+
metricId: F == null ? void 0 : F.metricId,
|
|
1730
|
+
persistedSettings: N,
|
|
1903
1731
|
valueFormatPreferences: e.reportContext.valueFormat
|
|
1904
|
-
}),
|
|
1732
|
+
}), $ = (D == null ? void 0 : D.type) === "duration" ? D : D ? M(
|
|
1905
1733
|
D,
|
|
1906
1734
|
e.reportContext.valueFormat,
|
|
1907
|
-
|
|
1908
|
-
) :
|
|
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
|
-
|
|
1745
|
+
$.type === "duration" ? { scope: k, target: G, format: $ } : { scope: k, target: G, format: $ }
|
|
1918
1746
|
];
|
|
1919
1747
|
});
|
|
1920
|
-
|
|
1921
|
-
...[...
|
|
1922
|
-
const
|
|
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 (!
|
|
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:
|
|
1936
|
-
|
|
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
|
-
),
|
|
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:
|
|
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
|
-
),
|
|
1970
|
-
...[...
|
|
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:
|
|
1801
|
+
format: F
|
|
1974
1802
|
}))
|
|
1975
1803
|
);
|
|
1976
|
-
const
|
|
1804
|
+
const h = dt({
|
|
1977
1805
|
reportContext: e.reportContext,
|
|
1978
|
-
resolvedFormats:
|
|
1806
|
+
resolvedFormats: g
|
|
1979
1807
|
});
|
|
1980
1808
|
return {
|
|
1981
1809
|
formatOptions: {
|
|
1982
1810
|
...e.formatOptions,
|
|
1983
1811
|
...a ? { tableTotalsLabelColumnKey: a } : {},
|
|
1984
|
-
comparisonPresentation:
|
|
1985
|
-
presentationExecutionSnapshot:
|
|
1812
|
+
comparisonPresentation: Sr(e.card),
|
|
1813
|
+
presentationExecutionSnapshot: h
|
|
1986
1814
|
},
|
|
1987
1815
|
...c ? { tableTotalsRequest: c } : {}
|
|
1988
1816
|
};
|
|
1989
1817
|
}
|
|
1990
|
-
function
|
|
1991
|
-
const t =
|
|
1818
|
+
function Or(e) {
|
|
1819
|
+
const t = it(
|
|
1992
1820
|
e.card,
|
|
1993
1821
|
e.requestPayloadBase
|
|
1994
|
-
), { cardId: r, ...
|
|
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
|
-
...
|
|
2002
|
-
...
|
|
1829
|
+
...o,
|
|
1830
|
+
...n.tableTotalsRequest ? { tableTotalsRequest: n.tableTotalsRequest } : {},
|
|
2003
1831
|
totalRows: e.totalRows,
|
|
2004
1832
|
format: e.format,
|
|
2005
|
-
formatOptions:
|
|
1833
|
+
formatOptions: n.formatOptions
|
|
2006
1834
|
};
|
|
2007
1835
|
}
|
|
2008
|
-
function
|
|
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 (
|
|
1840
|
+
if (nt({ card: t, comparisonMetadata: r.comparisonMetadata }))
|
|
2013
1841
|
return { status: "refused", reason: "comparison_metadata_missing" };
|
|
2014
|
-
const
|
|
1842
|
+
const o = Ir({
|
|
2015
1843
|
card: t,
|
|
2016
1844
|
effectiveCardConfig: e.effectiveCardConfig,
|
|
2017
1845
|
rows: e.rows,
|
|
2018
|
-
resultKeys: r.resultColumns.map((
|
|
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
|
|
1851
|
+
return o ? {
|
|
2024
1852
|
status: "ready",
|
|
2025
|
-
request:
|
|
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:
|
|
1860
|
+
formatOptions: o.formatOptions,
|
|
2033
1861
|
comparisonMetadata: r.comparisonMetadata,
|
|
2034
1862
|
requestPayloadBase: e.query,
|
|
2035
1863
|
resultColumns: [...r.resultColumns],
|
|
@@ -2038,24 +1866,24 @@ function jn(e) {
|
|
|
2038
1866
|
})
|
|
2039
1867
|
} : { status: "refused", reason: "columns_unresolved" };
|
|
2040
1868
|
}
|
|
2041
|
-
function
|
|
2042
|
-
if (
|
|
2043
|
-
|
|
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
|
|
1875
|
+
const o = r === "selection" && e.role === "metric" ? t.aggregate : void 0;
|
|
2048
1876
|
return {
|
|
2049
|
-
aggregate: e.aggregate ??
|
|
2050
|
-
aggregateOrigin: e.aggregate ? e.aggregateOrigin :
|
|
1877
|
+
aggregate: e.aggregate ?? o,
|
|
1878
|
+
aggregateOrigin: e.aggregate ? e.aggregateOrigin : o ? t.aggregateOrigin : void 0
|
|
2051
1879
|
};
|
|
2052
1880
|
}
|
|
2053
|
-
function
|
|
2054
|
-
var
|
|
1881
|
+
function wr(e, t, r) {
|
|
1882
|
+
var o, n, i, a, c, s;
|
|
2055
1883
|
if (r === "domain")
|
|
2056
1884
|
return {
|
|
2057
|
-
filters: (
|
|
2058
|
-
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
|
|
2067
|
-
const
|
|
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 qn(e, t, r) {
|
|
|
2075
1903
|
dateFormat: e.dateFormat,
|
|
2076
1904
|
customFormat: e.customFormat,
|
|
2077
1905
|
semanticTemporalPresentation: t.semanticTemporalPresentation || e.semanticTemporalPresentation,
|
|
2078
|
-
...
|
|
1906
|
+
...Ar(e, t, r),
|
|
2079
1907
|
...e.role === "metric" ? {
|
|
2080
|
-
aliasTemplate:
|
|
2081
|
-
valueAliases:
|
|
2082
|
-
comparison:
|
|
2083
|
-
comparisonPolarity:
|
|
2084
|
-
parameters:
|
|
2085
|
-
|
|
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
|
-
...
|
|
1918
|
+
...Dr(e)
|
|
2091
1919
|
};
|
|
2092
1920
|
}
|
|
2093
|
-
function
|
|
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
|
|
2120
|
-
function
|
|
1947
|
+
const Br = "table";
|
|
1948
|
+
function To({ preferences: e, ...t }) {
|
|
2121
1949
|
return {
|
|
2122
1950
|
...t,
|
|
2123
|
-
type:
|
|
1951
|
+
type: Br,
|
|
2124
1952
|
preferences: e ?? { onClickFilter: [{ columnIndex: 0, expression: "" }] },
|
|
2125
1953
|
sql: "",
|
|
2126
1954
|
data: []
|
|
2127
1955
|
};
|
|
2128
1956
|
}
|
|
2129
|
-
function
|
|
1957
|
+
function Oo(e, t) {
|
|
2130
1958
|
let r = e;
|
|
2131
|
-
for (const [
|
|
2132
|
-
const i =
|
|
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:
|
|
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
|
|
2140
|
-
const r = e.sheets ?? [],
|
|
2141
|
-
if (!
|
|
2142
|
-
return
|
|
2143
|
-
if (
|
|
2144
|
-
return
|
|
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
|
|
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
|
-
...
|
|
2150
|
-
frames:
|
|
2151
|
-
layouts:
|
|
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 ===
|
|
1985
|
+
sheets: r.map((s, u) => u === o ? c : s)
|
|
2158
1986
|
}
|
|
2159
1987
|
};
|
|
2160
1988
|
}
|
|
2161
|
-
function
|
|
1989
|
+
function Rr(e, t, r) {
|
|
2162
1990
|
if (r === "start") return [t, ...e];
|
|
2163
1991
|
if (r === "end") return [...e, t];
|
|
2164
|
-
const
|
|
2165
|
-
return
|
|
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
|
|
2168
|
-
return (typeof r == "object" ?
|
|
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
|
|
2004
|
+
function X(e, t) {
|
|
2177
2005
|
return { ok: !1, failure: { code: e, message: t } };
|
|
2178
2006
|
}
|
|
2179
2007
|
export {
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
dn as s,
|
|
2253
|
-
zn as t,
|
|
2254
|
-
Hn as u,
|
|
2255
|
-
Dr as v,
|
|
2256
|
-
Pr as w,
|
|
2257
|
-
j 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
|
};
|