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