react-semaphor 0.1.459 → 0.1.460
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.cjs +1 -1
- package/dist/analytics-protocol/index.js +32 -32
- package/dist/brand-studio/index.cjs +1 -1
- package/dist/brand-studio/index.js +4 -4
- package/dist/briefings/index.cjs +1 -1
- package/dist/briefings/index.js +4 -4
- package/dist/chunks/{analyze-result-contract-BbRJ-C06.js → analyze-result-contract-DROq4vgY.js} +1 -1
- package/dist/chunks/{analyze-result-contract-LPDNldic.cjs → analyze-result-contract-DSGoFuXQ.cjs} +1 -1
- package/dist/chunks/canonical-result-keys-CEQefvdO.js +33 -0
- package/dist/chunks/canonical-result-keys-Cb96edol.cjs +1 -0
- package/dist/chunks/{common-types-H51FLKB7.js → common-types-BHVKgxRR.js} +1 -1
- package/dist/chunks/{common-types-C57kJ59w.cjs → common-types-BcV9PD9D.cjs} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-ClCj98sq.js → dashboard-briefing-launcher-B07JnyCb.js} +60 -61
- package/dist/chunks/{dashboard-briefing-launcher-DHtEouuH.cjs → dashboard-briefing-launcher-BCkOKkCv.cjs} +2 -2
- package/dist/chunks/{dashboard-controls-VRShl9J0.cjs → dashboard-controls-BpxouYOZ.cjs} +1 -1
- package/dist/chunks/{dashboard-controls-B8gsKlxc.js → dashboard-controls-C8OxHQV6.js} +44 -45
- package/dist/chunks/dashboard-filter-value-compatibility-KXIyvbhc.js +677 -0
- package/dist/chunks/dashboard-filter-value-compatibility-UapptYnn.cjs +1 -0
- package/dist/chunks/dashboard-input-contract-BkRFQ7Tq.cjs +1 -0
- package/dist/chunks/{dashboard-date-comparison-definition-DC3ekV2S.js → dashboard-input-contract-D5dxTWJ5.js} +41 -25
- package/dist/chunks/dashboard-json-Bc-iIwxF.cjs +1 -0
- package/dist/chunks/{dashboard-json-i_Auue_K.js → dashboard-json-CecgbGtq.js} +13 -14
- package/dist/chunks/{edit-dashboard-visual-B3JF0fe4.js → edit-dashboard-visual-CpJKJaER.js} +880 -894
- package/dist/chunks/{edit-dashboard-visual-DWWyT55u.cjs → edit-dashboard-visual-xacUS2i5.cjs} +28 -28
- package/dist/chunks/{editor-action-buttons-BTlCsP63.cjs → editor-action-buttons-23Wf8EMx.cjs} +2 -2
- package/dist/chunks/{editor-action-buttons-C9x3nGnb.js → editor-action-buttons-DEoieV2G.js} +28 -28
- package/dist/chunks/index-B9c22LmC.cjs +1392 -0
- package/dist/chunks/{index-BS2-ZZGf.js → index-DDoyXYWM.js} +43665 -41560
- package/dist/chunks/{index-BIFLI8ul.js → index-De_7nrwb.js} +10 -10
- package/dist/chunks/index-DjjKJPDy.cjs +4 -0
- package/dist/chunks/{matrix-result-contract-CofATICL.js → matrix-result-contract-BTpPuHOc.js} +88 -104
- package/dist/chunks/matrix-result-contract-ZRNfeIbI.cjs +1 -0
- package/dist/chunks/{pivot-header-presentation-B9nXXKlW.cjs → pivot-header-presentation-BijPbP33.cjs} +1 -1
- package/dist/chunks/{pivot-header-presentation-D-0jvUwn.js → pivot-header-presentation-DW0gKG8g.js} +2 -2
- package/dist/chunks/{pivot-result-identity-Bb4EixVN.cjs → pivot-result-identity-DxHtiKVj.cjs} +1 -1
- package/dist/chunks/{pivot-result-identity-DU1v-5Xk.js → pivot-result-identity-Z9tN2tEV.js} +1 -1
- package/dist/chunks/{pivot-result-lifecycle-DTLRuDEW.cjs → pivot-result-lifecycle-BXzIlQVu.cjs} +1 -1
- package/dist/chunks/{pivot-result-lifecycle-CHWEGU2o.js → pivot-result-lifecycle-g2U-vzQb.js} +7 -7
- package/dist/chunks/{raw-temporal-contract-BtjH_G-d.cjs → raw-temporal-contract-DfAvqNMo.cjs} +1 -1
- package/dist/chunks/{raw-temporal-contract-CxncLze5.js → raw-temporal-contract-UtAqoOZO.js} +1 -1
- package/dist/chunks/{report-preferences-dialog-BDpkcUtz.js → report-preferences-dialog-CZiNX1Ri.js} +6 -6
- package/dist/chunks/{report-preferences-dialog-BK0yAJnQ.cjs → report-preferences-dialog-D_N6NXnq.cjs} +1 -1
- package/dist/chunks/{report-runtime-context-DqxS4wbi.cjs → report-runtime-context-C0NfLPfc.cjs} +1 -1
- package/dist/chunks/{report-runtime-context-SM6YO61_.js → report-runtime-context-CNncA3VD.js} +11 -11
- package/dist/chunks/{saved-temporal-bucket-format-CFfWXRl9.cjs → saved-temporal-bucket-format-3QKveR3v.cjs} +1 -1
- package/dist/chunks/{saved-temporal-bucket-format-SGAV0ivR.js → saved-temporal-bucket-format-Dd2eixTH.js} +11 -11
- package/dist/chunks/switch-DNFbgZz4.cjs +138 -0
- package/dist/chunks/{switch-DQR-Va05.js → switch-DSZobe8w.js} +6542 -5189
- package/dist/chunks/{temporal-bucket-5UYEotyQ.js → temporal-bucket-C85rmFmC.js} +4 -4
- package/dist/chunks/temporal-bucket-authoring-1fZuPAVb.js +653 -0
- package/dist/chunks/temporal-bucket-authoring-BK1UhYpD.cjs +1 -0
- package/dist/chunks/{temporal-bucket-contract-D5d-xEl3.js → temporal-bucket-contract-DXXNZssK.js} +1 -1
- package/dist/chunks/{temporal-bucket-contract-D2-93DGr.cjs → temporal-bucket-contract-xFkvboaw.cjs} +1 -1
- package/dist/chunks/{temporal-bucket-DHY1y9lq.cjs → temporal-bucket-pMfghsLX.cjs} +1 -1
- package/dist/chunks/{token-types-GbxRUozo.js → token-types-BLxc7UwR.js} +1 -1
- package/dist/chunks/{token-types-D7CaaI80.cjs → token-types-BYYO109W.cjs} +1 -1
- package/dist/chunks/{update-policy-hednMF-0.js → update-policy-CB8XJIoY.js} +1 -1
- package/dist/chunks/{update-policy-BmiOd0PB.cjs → update-policy-DMjjGjQY.cjs} +1 -1
- package/dist/chunks/{validators-DEmd8Sin.js → validators-DVd8s3qY.js} +416 -350
- package/dist/chunks/validators-dJlwubP4.cjs +1 -0
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.cjs +3 -3
- package/dist/dashboard-authoring/index.js +328 -311
- package/dist/data-app-builder/index.cjs +1 -1
- package/dist/data-app-builder/index.js +2 -2
- package/dist/data-app-codegen/index.cjs +1 -1
- package/dist/data-app-codegen/index.js +2 -2
- package/dist/data-app-codegen-node/index.cjs +1 -1
- package/dist/data-app-codegen-node/index.js +3 -3
- package/dist/data-app-sdk/index.cjs +1 -1
- package/dist/data-app-sdk/index.js +55 -55
- package/dist/data-app-sdk-adapters/index.cjs +1 -1
- package/dist/data-app-sdk-adapters/index.js +61 -56
- package/dist/data-app-sdk-validation/index.cjs +1 -1
- package/dist/data-app-sdk-validation/index.js +9 -9
- package/dist/format-utils/index.cjs +1 -1
- package/dist/format-utils/index.js +15 -15
- package/dist/index.cjs +1 -1
- package/dist/index.js +154 -155
- package/dist/report-runtime-context/index.cjs +1 -1
- package/dist/report-runtime-context/index.js +2 -2
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +3 -3
- package/dist/types/analytics-protocol.d.ts +16 -8
- package/dist/types/briefings.d.ts +80 -9
- package/dist/types/dashboard-assistant.d.ts +11 -6
- package/dist/types/dashboard-authoring.d.ts +242 -15
- package/dist/types/dashboard.d.ts +94 -10
- package/dist/types/data-app-builder.d.ts +11 -6
- package/dist/types/data-app-codegen-node.d.ts +16 -8
- package/dist/types/data-app-codegen.d.ts +16 -8
- package/dist/types/data-app-sdk-adapters.d.ts +17 -11
- package/dist/types/data-app-sdk-validation.d.ts +17 -11
- package/dist/types/data-app-sdk.d.ts +17 -11
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.js +4 -4
- package/dist/types/main.d.ts +210 -16
- package/dist/types/shared.d.ts +80 -9
- package/dist/types/surfboard.d.ts +94 -10
- package/dist/types/types.d.ts +94 -10
- package/package.json +1 -1
- package/dist/chunks/canonical-result-keys-BA0HCP4e.cjs +0 -1
- package/dist/chunks/canonical-result-keys-D6avdjpA.js +0 -467
- package/dist/chunks/dashboard-date-comparison-definition-Ces4alFm.cjs +0 -1
- package/dist/chunks/dashboard-json-BhvPMpZA.cjs +0 -1
- package/dist/chunks/index-DHF-2AqS.cjs +0 -1392
- package/dist/chunks/index-k8tEp0ys.cjs +0 -4
- package/dist/chunks/matrix-result-contract-zamd9euI.cjs +0 -1
- package/dist/chunks/switch-f3TuZNLr.cjs +0 -138
- package/dist/chunks/temporal-bucket-authoring-K1kE6R_z.js +0 -222
- package/dist/chunks/temporal-bucket-authoring-o3Emn05L.cjs +0 -1
- package/dist/chunks/validators-BDYprKI9.cjs +0 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { D as R, a as Ie } from "../chunks/contracts-CoCOpd_i.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import "../chunks/analyze-result-contract-
|
|
2
|
+
import { A as Mt, S as Nt, g as Bt, a as Rt, i as Pt, p as Ot, c as zt, b as qt, r as Vt, s as Lt, t as jt } from "../chunks/temporal-bucket-authoring-1fZuPAVb.js";
|
|
3
|
+
import { k as ye, af as H, ag as _e, y as ae, F as we, B as ve } from "../chunks/validators-DVd8s3qY.js";
|
|
4
|
+
import "../chunks/analyze-result-contract-DROq4vgY.js";
|
|
5
5
|
import "../value-format-preferences/index.js";
|
|
6
6
|
import { n as Se } from "../chunks/operators-C8TxpM4C.js";
|
|
7
|
-
import {
|
|
7
|
+
import { a as Ht, b as Wt, r as Kt } from "../chunks/canonical-result-keys-CEQefvdO.js";
|
|
8
|
+
import { D as Ut, b as Qt, k as Yt, d as Jt, e as Xt, l as Zt, f as er, a as tr, c as rr, g as nr, h as ar, m as ir, n as or, j as sr, r as dr, i as cr } from "../chunks/dashboard-filter-value-compatibility-KXIyvbhc.js";
|
|
8
9
|
function _(e) {
|
|
9
10
|
return e && typeof e == "object" ? e : null;
|
|
10
11
|
}
|
|
@@ -12,8 +13,8 @@ function C(e) {
|
|
|
12
13
|
return typeof e == "string" ? e : null;
|
|
13
14
|
}
|
|
14
15
|
function Ce(e) {
|
|
15
|
-
var t,
|
|
16
|
-
return !!(e && typeof e == "object") && (((t = _(e)) == null ? void 0 : t.kind) === "semantic" || ((
|
|
16
|
+
var t, r, n;
|
|
17
|
+
return !!(e && typeof e == "object") && (((t = _(e)) == null ? void 0 : t.kind) === "semantic" || ((r = _(e)) == null ? void 0 : r.kind) === "physical" || ((n = _(e)) == null ? void 0 : n.kind) === "sql");
|
|
17
18
|
}
|
|
18
19
|
function T(e) {
|
|
19
20
|
return Ce(e) ? e.kind === "semantic" ? !!(e.domainId && e.datasetName) : e.kind === "physical" ? !!(e.connectionId && e.tableName) : !1 : !1;
|
|
@@ -29,13 +30,13 @@ function ke(e, t) {
|
|
|
29
30
|
}
|
|
30
31
|
function P(e) {
|
|
31
32
|
const t = [];
|
|
32
|
-
for (const
|
|
33
|
-
const
|
|
34
|
-
(o) => ie(o,
|
|
33
|
+
for (const r of e) {
|
|
34
|
+
const n = t.findIndex(
|
|
35
|
+
(o) => ie(o, r)
|
|
35
36
|
);
|
|
36
|
-
|
|
37
|
-
t[
|
|
38
|
-
|
|
37
|
+
n === -1 ? t.push(r) : t[n] = ke(
|
|
38
|
+
t[n],
|
|
39
|
+
r
|
|
39
40
|
);
|
|
40
41
|
}
|
|
41
42
|
return t;
|
|
@@ -49,76 +50,76 @@ function L(e, t) {
|
|
|
49
50
|
function j(e) {
|
|
50
51
|
return T(e) ? e : void 0;
|
|
51
52
|
}
|
|
52
|
-
function
|
|
53
|
+
function re(e, t) {
|
|
53
54
|
if (!(e.kind !== "semantic" || e.connectionId))
|
|
54
55
|
return t.find(
|
|
55
|
-
(
|
|
56
|
+
(r) => (r == null ? void 0 : r.kind) === "semantic" && H(e, r) && !!r.connectionId
|
|
56
57
|
);
|
|
57
58
|
}
|
|
58
59
|
function S(e, t) {
|
|
59
|
-
const
|
|
60
|
-
return
|
|
60
|
+
const r = j(e == null ? void 0 : e.source);
|
|
61
|
+
return r ? L(r, t) : void 0;
|
|
61
62
|
}
|
|
62
|
-
function
|
|
63
|
+
function De({
|
|
63
64
|
explicitSource: e,
|
|
64
65
|
field: t,
|
|
65
|
-
defaultSource:
|
|
66
|
-
fallbackSources:
|
|
66
|
+
defaultSource: r,
|
|
67
|
+
fallbackSources: n
|
|
67
68
|
}) {
|
|
68
|
-
const o = [
|
|
69
|
+
const o = [r, ...n || []], a = j(e), i = a ? L(
|
|
69
70
|
a,
|
|
70
|
-
|
|
71
|
+
re(a, o)
|
|
71
72
|
) : void 0;
|
|
72
73
|
if (i)
|
|
73
74
|
return i;
|
|
74
75
|
if (e !== void 0)
|
|
75
76
|
return;
|
|
76
|
-
const d = S(t,
|
|
77
|
+
const d = S(t, r), s = d ? L(
|
|
77
78
|
d,
|
|
78
|
-
|
|
79
|
+
re(d, o)
|
|
79
80
|
) : void 0;
|
|
80
81
|
if (s)
|
|
81
82
|
return s;
|
|
82
83
|
if ((t == null ? void 0 : t.source) === void 0)
|
|
83
|
-
return j(
|
|
84
|
+
return j(r);
|
|
84
85
|
}
|
|
85
86
|
function kt(e, t) {
|
|
86
87
|
if (!(e != null && e.name) || !(t != null && t.name) || e.name !== t.name)
|
|
87
88
|
return !1;
|
|
88
|
-
const
|
|
89
|
-
return !
|
|
89
|
+
const r = S(e), n = S(t);
|
|
90
|
+
return !r || !n ? !0 : ie(r, n);
|
|
90
91
|
}
|
|
91
|
-
function
|
|
92
|
+
function D(e) {
|
|
92
93
|
var t;
|
|
93
94
|
return C((t = _(e)) == null ? void 0 : t.kind);
|
|
94
95
|
}
|
|
95
96
|
function oe(e) {
|
|
96
|
-
var t,
|
|
97
|
-
return
|
|
97
|
+
var t, r;
|
|
98
|
+
return D(e) !== "semantic" ? null : ((r = C((t = _(e)) == null ? void 0 : t.domainId)) == null ? void 0 : r.trim()) || null;
|
|
98
99
|
}
|
|
99
|
-
function
|
|
100
|
+
function Ae(e) {
|
|
100
101
|
var t;
|
|
101
|
-
return
|
|
102
|
+
return D(e) !== "semantic" ? null : C((t = _(e)) == null ? void 0 : t.datasetName);
|
|
102
103
|
}
|
|
103
|
-
function
|
|
104
|
+
function xe(e) {
|
|
104
105
|
var t;
|
|
105
|
-
return
|
|
106
|
+
return D(e) !== "semantic" ? null : C((t = _(e)) == null ? void 0 : t.datasetId);
|
|
106
107
|
}
|
|
107
108
|
function Fe(e) {
|
|
108
109
|
var t;
|
|
109
|
-
return
|
|
110
|
+
return D(e) !== "physical" ? null : C((t = _(e)) == null ? void 0 : t.connectionId);
|
|
110
111
|
}
|
|
111
112
|
function Te(e) {
|
|
112
113
|
var t;
|
|
113
|
-
return
|
|
114
|
+
return D(e) !== "physical" ? null : C((t = _(e)) == null ? void 0 : t.tableName);
|
|
114
115
|
}
|
|
115
116
|
function $e(e) {
|
|
116
117
|
var t;
|
|
117
|
-
return
|
|
118
|
+
return D(e) !== "physical" ? "" : C((t = _(e)) == null ? void 0 : t.databaseName) || "";
|
|
118
119
|
}
|
|
119
120
|
function Me(e) {
|
|
120
121
|
var t;
|
|
121
|
-
return
|
|
122
|
+
return D(e) !== "physical" ? "" : C((t = _(e)) == null ? void 0 : t.schemaName) || "";
|
|
122
123
|
}
|
|
123
124
|
function Ne(e) {
|
|
124
125
|
if (e.analyticsIntent && typeof e.analyticsIntent == "object" && "source" in e.analyticsIntent)
|
|
@@ -132,47 +133,47 @@ function Be({
|
|
|
132
133
|
return { ok: !1, issue: "invalid_dataset_count" };
|
|
133
134
|
if (e.length <= 1)
|
|
134
135
|
return { ok: !0 };
|
|
135
|
-
const
|
|
136
|
-
return
|
|
136
|
+
const r = e.map(oe), n = new Set(r.filter(Boolean));
|
|
137
|
+
return r.some((o) => !o) || n.size !== 1 ? { ok: !1, issue: "invalid_multi_dataset_scope" } : { ok: !0 };
|
|
137
138
|
}
|
|
138
139
|
function W(e, t) {
|
|
139
140
|
if (!t)
|
|
140
141
|
return !1;
|
|
141
142
|
if (t.kind === "semantic") {
|
|
142
|
-
const
|
|
143
|
-
return oe(e) === t.domainId ?
|
|
143
|
+
const r = xe(e);
|
|
144
|
+
return oe(e) === t.domainId ? r && t.datasetId ? r === t.datasetId : Ae(e) === t.datasetName : !1;
|
|
144
145
|
}
|
|
145
146
|
return t.kind === "physical" ? Fe(e) === t.connectionId && Te(e) === t.tableName && $e(e) === (t.databaseName || "") && Me(e) === (t.schemaName || "") : !1;
|
|
146
147
|
}
|
|
147
|
-
function
|
|
148
|
+
function Dt(e, t) {
|
|
148
149
|
return e.find(
|
|
149
|
-
(
|
|
150
|
+
(r) => W(r, t)
|
|
150
151
|
);
|
|
151
152
|
}
|
|
152
|
-
function p(e, t,
|
|
153
|
-
return
|
|
153
|
+
function p(e, t, r) {
|
|
154
|
+
return r ? { code: e, message: t, cardId: r } : { code: e, message: t };
|
|
154
155
|
}
|
|
155
156
|
function N(e) {
|
|
156
157
|
const t = /* @__PURE__ */ new Set();
|
|
157
|
-
for (const
|
|
158
|
-
if (t.has(
|
|
159
|
-
return
|
|
160
|
-
t.add(
|
|
158
|
+
for (const r of e) {
|
|
159
|
+
if (t.has(r))
|
|
160
|
+
return r;
|
|
161
|
+
t.add(r);
|
|
161
162
|
}
|
|
162
163
|
return null;
|
|
163
164
|
}
|
|
164
165
|
function se({
|
|
165
166
|
card: e,
|
|
166
167
|
datasets: t,
|
|
167
|
-
errors:
|
|
168
|
+
errors: r
|
|
168
169
|
}) {
|
|
169
170
|
if (e.type === "text")
|
|
170
171
|
return;
|
|
171
|
-
const
|
|
172
|
-
if (!
|
|
172
|
+
const n = Ne(e);
|
|
173
|
+
if (!n) {
|
|
173
174
|
if (t.length <= 1)
|
|
174
175
|
return;
|
|
175
|
-
|
|
176
|
+
r.push(
|
|
176
177
|
p(
|
|
177
178
|
"missing_card_analytics_source",
|
|
178
179
|
"Multi-dataset dashboard cards must include analytics intent with a source so the materializer can choose the correct dataset.",
|
|
@@ -181,7 +182,7 @@ function se({
|
|
|
181
182
|
);
|
|
182
183
|
return;
|
|
183
184
|
}
|
|
184
|
-
t.some((o) => W(o,
|
|
185
|
+
t.some((o) => W(o, n)) || r.push(
|
|
185
186
|
p(
|
|
186
187
|
"invalid_card_analytics_source",
|
|
187
188
|
"Dashboard cards with an explicit analytics source must use one of the selected datasets.",
|
|
@@ -197,13 +198,13 @@ function z(e) {
|
|
|
197
198
|
(t) => !!(t && typeof t == "object")
|
|
198
199
|
) : [];
|
|
199
200
|
}
|
|
200
|
-
function
|
|
201
|
+
function ne(e) {
|
|
201
202
|
return Array.isArray(e) ? e.filter(
|
|
202
203
|
(t) => !!(t && typeof t == "object")
|
|
203
204
|
) : [];
|
|
204
205
|
}
|
|
205
206
|
function Re(e) {
|
|
206
|
-
var
|
|
207
|
+
var r, n;
|
|
207
208
|
if (!e)
|
|
208
209
|
return [];
|
|
209
210
|
const t = [e.source];
|
|
@@ -213,16 +214,16 @@ function Re(e) {
|
|
|
213
214
|
e.primaryMeasure,
|
|
214
215
|
e.dateField,
|
|
215
216
|
...z(e.dimensions),
|
|
216
|
-
...
|
|
217
|
+
...ne(e.filters).map((o) => o.field)
|
|
217
218
|
])
|
|
218
219
|
) : e.kind === "records" ? t.push(
|
|
219
220
|
...B([
|
|
220
221
|
...z(e.fields),
|
|
221
222
|
e.dateField,
|
|
222
|
-
(
|
|
223
|
-
...
|
|
223
|
+
(r = e.orderBy) == null ? void 0 : r.field,
|
|
224
|
+
...ne(e.filters).map((o) => o.field)
|
|
224
225
|
])
|
|
225
|
-
) : e.kind === "inputOptions" ? (((
|
|
226
|
+
) : e.kind === "inputOptions" ? (((n = e.population) == null ? void 0 : n.kind) === "related_population" && t.push(e.population.baseSource), t.push(
|
|
226
227
|
...B([
|
|
227
228
|
e.labelField,
|
|
228
229
|
e.valueField,
|
|
@@ -234,14 +235,14 @@ function Re(e) {
|
|
|
234
235
|
function de({
|
|
235
236
|
card: e,
|
|
236
237
|
datasets: t,
|
|
237
|
-
errors:
|
|
238
|
+
errors: r
|
|
238
239
|
}) {
|
|
239
240
|
if (e.type !== "text") {
|
|
240
|
-
for (const
|
|
241
|
-
if (
|
|
242
|
-
(o) => W(o,
|
|
241
|
+
for (const n of Re(e.analyticsIntent))
|
|
242
|
+
if (n && !t.some(
|
|
243
|
+
(o) => W(o, n)
|
|
243
244
|
)) {
|
|
244
|
-
|
|
245
|
+
r.push(
|
|
245
246
|
p(
|
|
246
247
|
"invalid_card_query_source",
|
|
247
248
|
"Dashboard card query field references must use one of the selected datasets.",
|
|
@@ -258,13 +259,13 @@ function ce({
|
|
|
258
259
|
}) {
|
|
259
260
|
if (e.type === "text" || !e.analyticsIntent)
|
|
260
261
|
return;
|
|
261
|
-
const
|
|
262
|
-
if (!
|
|
263
|
-
for (const
|
|
262
|
+
const r = ae(e.analyticsIntent);
|
|
263
|
+
if (!r.ok)
|
|
264
|
+
for (const n of r.errors)
|
|
264
265
|
t.push(
|
|
265
266
|
p(
|
|
266
|
-
|
|
267
|
-
|
|
267
|
+
n.code,
|
|
268
|
+
n.path ? `${n.path}: ${n.message}` : n.message,
|
|
268
269
|
e.id
|
|
269
270
|
)
|
|
270
271
|
);
|
|
@@ -272,14 +273,14 @@ function ce({
|
|
|
272
273
|
function le({
|
|
273
274
|
datasets: e,
|
|
274
275
|
errors: t,
|
|
275
|
-
requireAtLeastOne:
|
|
276
|
+
requireAtLeastOne: r
|
|
276
277
|
}) {
|
|
277
|
-
const
|
|
278
|
+
const n = Be({
|
|
278
279
|
datasets: e,
|
|
279
|
-
requireAtLeastOne:
|
|
280
|
+
requireAtLeastOne: r
|
|
280
281
|
});
|
|
281
|
-
if (!
|
|
282
|
-
if (
|
|
282
|
+
if (!n.ok) {
|
|
283
|
+
if (n.issue === "invalid_dataset_count") {
|
|
283
284
|
t.push(
|
|
284
285
|
p(
|
|
285
286
|
"invalid_dataset_count",
|
|
@@ -300,8 +301,8 @@ function ue({
|
|
|
300
301
|
input: e,
|
|
301
302
|
errors: t
|
|
302
303
|
}) {
|
|
303
|
-
var
|
|
304
|
-
(
|
|
304
|
+
var r;
|
|
305
|
+
(r = e.filter.sql) != null && r.trim() && t.push(
|
|
305
306
|
p(
|
|
306
307
|
"generated_filter_sql_out_of_scope",
|
|
307
308
|
`Generated dashboard filter "${e.label}" must use grounded filter configuration; custom SQL is outside the dashboard-authoring contract.`
|
|
@@ -309,7 +310,7 @@ function ue({
|
|
|
309
310
|
);
|
|
310
311
|
}
|
|
311
312
|
function Pe(e) {
|
|
312
|
-
var f,
|
|
313
|
+
var f, b;
|
|
313
314
|
const t = [];
|
|
314
315
|
if (!e || typeof e != "object")
|
|
315
316
|
return {
|
|
@@ -322,9 +323,9 @@ function Pe(e) {
|
|
|
322
323
|
],
|
|
323
324
|
warnings: []
|
|
324
325
|
};
|
|
325
|
-
const
|
|
326
|
-
|
|
327
|
-
const o = Array.isArray(
|
|
326
|
+
const r = e, n = [...r.warnings || []];
|
|
327
|
+
r.version !== 1 && t.push(p("invalid_version", "Dashboard plan version must be 1.")), (f = r.title) != null && f.trim() || t.push(p("missing_title", "Dashboard plan needs a title."));
|
|
328
|
+
const o = Array.isArray(r.datasets) ? r.datasets : [], a = Array.isArray(r.sheets) ? r.sheets : [];
|
|
328
329
|
le({ datasets: o, errors: t, requireAtLeastOne: !0 }), a.length !== 1 && t.push(
|
|
329
330
|
p(
|
|
330
331
|
"invalid_sheet_count",
|
|
@@ -354,20 +355,20 @@ function Pe(e) {
|
|
|
354
355
|
)
|
|
355
356
|
);
|
|
356
357
|
for (const l of d)
|
|
357
|
-
(
|
|
358
|
+
(b = l.title) != null && b.trim() || t.push(p("missing_card_title", "Card title is required.", l.id)), l.type === "custom" && t.push(
|
|
358
359
|
p(
|
|
359
360
|
"custom_visual_out_of_scope",
|
|
360
361
|
"Whole-dashboard authoring supports built-in visual types only.",
|
|
361
362
|
l.id
|
|
362
363
|
)
|
|
363
|
-
), l.type !== "text" && !l.analyticsIntent &&
|
|
364
|
+
), l.type !== "text" && !l.analyticsIntent && n.push(
|
|
364
365
|
p(
|
|
365
366
|
"missing_analytics_intent",
|
|
366
367
|
"Non-text card has no analytics intent and may be skipped by the app layer.",
|
|
367
368
|
l.id
|
|
368
369
|
)
|
|
369
370
|
), se({ card: l, datasets: o, errors: t }), ce({ card: l, errors: t }), de({ card: l, datasets: o, errors: t });
|
|
370
|
-
const h = Array.isArray(
|
|
371
|
+
const h = Array.isArray(r.filterInputs) ? r.filterInputs : [], I = h.map((l) => l.id), w = N(I);
|
|
371
372
|
w && t.push(
|
|
372
373
|
p(
|
|
373
374
|
"duplicate_input_id",
|
|
@@ -383,7 +384,7 @@ function Pe(e) {
|
|
|
383
384
|
);
|
|
384
385
|
for (const l of h)
|
|
385
386
|
ue({ input: l, errors: t });
|
|
386
|
-
const c = Array.isArray(
|
|
387
|
+
const c = Array.isArray(r.calculatedFields) ? r.calculatedFields : [];
|
|
387
388
|
for (const l of c)
|
|
388
389
|
l.scope === "domain" && l.reuseOnly !== !0 && t.push(
|
|
389
390
|
p(
|
|
@@ -391,7 +392,7 @@ function Pe(e) {
|
|
|
391
392
|
`Creating domain calculated field "${l.name}" is outside MVP.`
|
|
392
393
|
)
|
|
393
394
|
);
|
|
394
|
-
return { ok: t.length === 0, errors: t, warnings:
|
|
395
|
+
return { ok: t.length === 0, errors: t, warnings: n };
|
|
395
396
|
}
|
|
396
397
|
function Oe(e) {
|
|
397
398
|
var i;
|
|
@@ -407,17 +408,17 @@ function Oe(e) {
|
|
|
407
408
|
],
|
|
408
409
|
warnings: []
|
|
409
410
|
};
|
|
410
|
-
const
|
|
411
|
-
|
|
411
|
+
const r = e, n = [...r.warnings || []];
|
|
412
|
+
r.version !== 1 && t.push(
|
|
412
413
|
p("invalid_version", "Dashboard change plan version must be 1.")
|
|
413
|
-
), (i =
|
|
414
|
+
), (i = r.dashboardId) != null && i.trim() || t.push(
|
|
414
415
|
p("missing_dashboard_id", "Dashboard change plan needs a dashboard id.")
|
|
415
416
|
);
|
|
416
|
-
const o = Array.isArray(
|
|
417
|
+
const o = Array.isArray(r.datasets) ? r.datasets : [], a = Array.isArray(r.operations) ? r.operations : [];
|
|
417
418
|
le({ datasets: o, errors: t, requireAtLeastOne: !1 });
|
|
418
419
|
for (const d of a) {
|
|
419
420
|
if (d.kind === "unsupported") {
|
|
420
|
-
|
|
421
|
+
n.push(
|
|
421
422
|
p("unsupported_operation", d.reason || d.requestedAction)
|
|
422
423
|
);
|
|
423
424
|
continue;
|
|
@@ -446,7 +447,7 @@ function Oe(e) {
|
|
|
446
447
|
)
|
|
447
448
|
);
|
|
448
449
|
}
|
|
449
|
-
return { ok: t.length === 0, errors: t, warnings:
|
|
450
|
+
return { ok: t.length === 0, errors: t, warnings: n };
|
|
450
451
|
}
|
|
451
452
|
const ze = {
|
|
452
453
|
lg: 48,
|
|
@@ -455,97 +456,97 @@ const ze = {
|
|
|
455
456
|
xs: 12,
|
|
456
457
|
xxs: 6
|
|
457
458
|
};
|
|
458
|
-
function
|
|
459
|
-
let
|
|
459
|
+
function qe(e, t) {
|
|
460
|
+
let r = 0, n = 0, o = 0;
|
|
460
461
|
return e.map((a) => {
|
|
461
462
|
const i = Math.min(a.w, t);
|
|
462
|
-
|
|
463
|
+
r > 0 && r + i > t && (r = 0, n += o, o = 0);
|
|
463
464
|
const d = {
|
|
464
465
|
i: a.frameId,
|
|
465
|
-
x:
|
|
466
|
-
y:
|
|
466
|
+
x: r,
|
|
467
|
+
y: n,
|
|
467
468
|
w: i,
|
|
468
469
|
h: a.h,
|
|
469
470
|
minW: Math.min(a.minW, t),
|
|
470
471
|
minH: a.minH,
|
|
471
472
|
static: !1
|
|
472
473
|
};
|
|
473
|
-
return
|
|
474
|
+
return r += i, o = Math.max(o, a.h), d;
|
|
474
475
|
});
|
|
475
476
|
}
|
|
476
|
-
function
|
|
477
|
-
const t = [...e].sort((s, u) => s.priority - u.priority),
|
|
478
|
-
return { kpis:
|
|
477
|
+
function Ve(e) {
|
|
478
|
+
const t = [...e].sort((s, u) => s.priority - u.priority), r = t.filter((s) => s.role === "kpi"), n = t.filter((s) => s.role === "chart"), o = t.filter((s) => s.role === "table"), a = t.filter((s) => s.role === "text"), i = a.slice(0, 1), d = a.slice(i.length);
|
|
479
|
+
return { kpis: r, introText: i, charts: n, tables: o, supportingText: d };
|
|
479
480
|
}
|
|
480
|
-
function Le(e, t,
|
|
481
|
-
return t === "xxs" || t === "xs" ?
|
|
481
|
+
function Le(e, t, r) {
|
|
482
|
+
return t === "xxs" || t === "xs" ? r : t === "sm" ? Math.min(12, r) : t === "md" ? e <= 1 || e === 2 ? 18 : 12 : e <= 1 || e === 2 ? 24 : e === 3 ? 16 : 12;
|
|
482
483
|
}
|
|
483
|
-
function je(e, t,
|
|
484
|
-
return
|
|
484
|
+
function je(e, t, r, n) {
|
|
485
|
+
return r === "xxs" || r === "xs" || r === "sm" || r === "md" || t === 1 || t % 2 === 1 && e === 0 ? n : n / 2;
|
|
485
486
|
}
|
|
486
487
|
function Ee(e) {
|
|
487
|
-
const { item: t, band:
|
|
488
|
-
return
|
|
488
|
+
const { item: t, band: r, index: n, bandCount: o, breakpoint: a, columns: i } = e;
|
|
489
|
+
return r === "kpi" ? {
|
|
489
490
|
...t,
|
|
490
|
-
band:
|
|
491
|
+
band: r,
|
|
491
492
|
w: Le(o, a, i),
|
|
492
493
|
h: 15,
|
|
493
494
|
minW: Math.min(6, i),
|
|
494
495
|
minH: 12
|
|
495
|
-
} :
|
|
496
|
+
} : r === "table" ? {
|
|
496
497
|
...t,
|
|
497
|
-
band:
|
|
498
|
+
band: r,
|
|
498
499
|
w: i,
|
|
499
500
|
h: a === "xxs" || a === "xs" ? 34 : 38,
|
|
500
501
|
minW: Math.min(12, i),
|
|
501
502
|
minH: 18
|
|
502
|
-
} :
|
|
503
|
+
} : r === "introText" ? {
|
|
503
504
|
...t,
|
|
504
|
-
band:
|
|
505
|
+
band: r,
|
|
505
506
|
w: i,
|
|
506
507
|
h: a === "xxs" || a === "xs" ? 12 : 10,
|
|
507
508
|
minW: Math.min(12, i),
|
|
508
509
|
minH: 8
|
|
509
|
-
} :
|
|
510
|
+
} : r === "supportingText" ? {
|
|
510
511
|
...t,
|
|
511
|
-
band:
|
|
512
|
+
band: r,
|
|
512
513
|
w: a === "lg" ? i / 2 : i,
|
|
513
514
|
h: a === "xxs" || a === "xs" ? 12 : 10,
|
|
514
515
|
minW: Math.min(12, i),
|
|
515
516
|
minH: 8
|
|
516
517
|
} : {
|
|
517
518
|
...t,
|
|
518
|
-
band:
|
|
519
|
-
w: je(
|
|
519
|
+
band: r,
|
|
520
|
+
w: je(n, o, a, i),
|
|
520
521
|
h: a === "xxs" || a === "xs" ? 28 : 30,
|
|
521
522
|
minW: Math.min(12, i),
|
|
522
523
|
minH: 16
|
|
523
524
|
};
|
|
524
525
|
}
|
|
525
|
-
function
|
|
526
|
+
function x(e, t, r, n) {
|
|
526
527
|
return e.map(
|
|
527
528
|
(o, a) => Ee({
|
|
528
529
|
item: o,
|
|
529
530
|
band: t,
|
|
530
531
|
index: a,
|
|
531
532
|
bandCount: e.length,
|
|
532
|
-
breakpoint:
|
|
533
|
-
columns:
|
|
533
|
+
breakpoint: r,
|
|
534
|
+
columns: n
|
|
534
535
|
})
|
|
535
536
|
);
|
|
536
537
|
}
|
|
537
538
|
function K(e) {
|
|
538
|
-
const t =
|
|
539
|
+
const t = Ve(e);
|
|
539
540
|
return Object.fromEntries(
|
|
540
|
-
Ie.map((
|
|
541
|
-
const
|
|
542
|
-
...
|
|
543
|
-
...
|
|
544
|
-
...
|
|
545
|
-
...
|
|
546
|
-
...
|
|
541
|
+
Ie.map((r) => {
|
|
542
|
+
const n = ze[r], o = [
|
|
543
|
+
...x(t.introText, "introText", r, n),
|
|
544
|
+
...x(t.kpis, "kpi", r, n),
|
|
545
|
+
...x(t.charts, "chart", r, n),
|
|
546
|
+
...x(t.tables, "table", r, n),
|
|
547
|
+
...x(t.supportingText, "supportingText", r, n)
|
|
547
548
|
];
|
|
548
|
-
return [
|
|
549
|
+
return [r, qe(o, n)];
|
|
549
550
|
})
|
|
550
551
|
);
|
|
551
552
|
}
|
|
@@ -572,68 +573,68 @@ function Ue(e) {
|
|
|
572
573
|
function G(e, t) {
|
|
573
574
|
if (t === void 0)
|
|
574
575
|
return;
|
|
575
|
-
const
|
|
576
|
+
const r = He(e.dataType), n = e.operation || "in";
|
|
576
577
|
if (Ke(t))
|
|
577
578
|
return {
|
|
578
579
|
...t,
|
|
579
580
|
filterId: e.id,
|
|
580
581
|
name: t.name || e.column,
|
|
581
|
-
valueType:
|
|
582
|
+
valueType: r,
|
|
582
583
|
dataType: e.dataType,
|
|
583
584
|
fieldMeta: e.fieldMeta,
|
|
584
585
|
semanticContext: e.semanticContext
|
|
585
586
|
};
|
|
586
|
-
if (
|
|
587
|
+
if (n === "is null" || n === "is not null")
|
|
587
588
|
return {
|
|
588
589
|
filterId: e.id,
|
|
589
590
|
name: e.column,
|
|
590
|
-
operation:
|
|
591
|
-
valueType:
|
|
591
|
+
operation: n,
|
|
592
|
+
valueType: r,
|
|
592
593
|
values: [],
|
|
593
594
|
dataType: e.dataType,
|
|
594
595
|
fieldMeta: e.fieldMeta,
|
|
595
596
|
semanticContext: e.semanticContext
|
|
596
597
|
};
|
|
597
|
-
const o = Array.isArray(t) ? t : [t], a =
|
|
598
|
-
if (a.length !== 0 && !((
|
|
598
|
+
const o = Array.isArray(t) ? t : [t], a = r === "date" ? Ue(o) : Ge(o);
|
|
599
|
+
if (a.length !== 0 && !((n === "between" || n === "not between") && a.length < 2))
|
|
599
600
|
return {
|
|
600
601
|
filterId: e.id,
|
|
601
602
|
name: e.column,
|
|
602
|
-
operation:
|
|
603
|
-
valueType:
|
|
603
|
+
operation: n,
|
|
604
|
+
valueType: r,
|
|
604
605
|
values: a,
|
|
605
606
|
dataType: e.dataType,
|
|
606
607
|
fieldMeta: e.fieldMeta,
|
|
607
608
|
semanticContext: e.semanticContext
|
|
608
609
|
};
|
|
609
610
|
}
|
|
610
|
-
function fe(e, t,
|
|
611
|
-
return
|
|
611
|
+
function fe(e, t, r) {
|
|
612
|
+
return r ? { code: e, message: t, cardId: r } : { code: e, message: t };
|
|
612
613
|
}
|
|
613
|
-
function Qe(e, t,
|
|
614
|
-
const
|
|
615
|
-
(o) => o.scope === "card" && o.targetCardId ===
|
|
614
|
+
function Qe(e, t, r) {
|
|
615
|
+
const n = (t || []).filter(
|
|
616
|
+
(o) => o.scope === "card" && o.targetCardId === r
|
|
616
617
|
).map((o) => o.field).filter(Boolean);
|
|
617
|
-
return
|
|
618
|
+
return n.length === 0 ? e : {
|
|
618
619
|
...e,
|
|
619
620
|
calculatedFields: [
|
|
620
621
|
...e.calculatedFields || [],
|
|
621
|
-
...
|
|
622
|
+
...n
|
|
622
623
|
]
|
|
623
624
|
};
|
|
624
625
|
}
|
|
625
626
|
function E(e, t) {
|
|
626
627
|
return Array.from(
|
|
627
628
|
new Set(
|
|
628
|
-
(e || []).map((
|
|
629
|
+
(e || []).map((r) => t.get(r)).filter((r) => !!r)
|
|
629
630
|
)
|
|
630
631
|
);
|
|
631
632
|
}
|
|
632
633
|
function Ye(e, t) {
|
|
633
634
|
if ((e == null ? void 0 : e.kind) !== "cards")
|
|
634
635
|
return e;
|
|
635
|
-
const
|
|
636
|
-
return
|
|
636
|
+
const r = E(e.cardIds, t);
|
|
637
|
+
return r.length > 0 ? { ...e, cardIds: r } : null;
|
|
637
638
|
}
|
|
638
639
|
function Je(e, t) {
|
|
639
640
|
return !e.applyToCardIds && !e.excludeCardIds ? e : {
|
|
@@ -653,13 +654,13 @@ function Je(e, t) {
|
|
|
653
654
|
};
|
|
654
655
|
}
|
|
655
656
|
function Xe(e, t) {
|
|
656
|
-
const
|
|
657
|
+
const r = {}, n = [];
|
|
657
658
|
return {
|
|
658
659
|
inputs: (e.filterInputs || []).flatMap(
|
|
659
660
|
(a, i) => {
|
|
660
661
|
const d = Ye(a.scope, t);
|
|
661
662
|
if (d === null)
|
|
662
|
-
return
|
|
663
|
+
return n.push(
|
|
663
664
|
fe(
|
|
664
665
|
"filter_input_scope_empty",
|
|
665
666
|
`Filter input "${a.label}" was skipped because all scoped cards were skipped during query validation.`
|
|
@@ -669,7 +670,7 @@ function Xe(e, t) {
|
|
|
669
670
|
a.filter,
|
|
670
671
|
a.defaultValue
|
|
671
672
|
);
|
|
672
|
-
return s && (
|
|
673
|
+
return s && (r.shared ?? (r.shared = {}), r.shared[a.id] = {
|
|
673
674
|
status: "set",
|
|
674
675
|
value: {
|
|
675
676
|
kind: "filter",
|
|
@@ -693,11 +694,11 @@ function Xe(e, t) {
|
|
|
693
694
|
];
|
|
694
695
|
}
|
|
695
696
|
),
|
|
696
|
-
warnings:
|
|
697
|
-
defaultInputValues:
|
|
697
|
+
warnings: n,
|
|
698
|
+
defaultInputValues: r.shared && Object.keys(r.shared).length > 0 ? r : void 0
|
|
698
699
|
};
|
|
699
700
|
}
|
|
700
|
-
function
|
|
701
|
+
function At(e) {
|
|
701
702
|
var v, y;
|
|
702
703
|
const t = Pe(e.plan);
|
|
703
704
|
if (!t.ok)
|
|
@@ -705,7 +706,7 @@ function xt(e) {
|
|
|
705
706
|
t.errors.map((c) => c.message).join(`
|
|
706
707
|
`) || "Dashboard plan is invalid."
|
|
707
708
|
);
|
|
708
|
-
const
|
|
709
|
+
const r = e.plan.sheets[0], n = [...t.warnings], o = [], a = new Map(
|
|
709
710
|
e.cardArtifacts.map((c) => [c.planCardId, c])
|
|
710
711
|
), i = new Map(
|
|
711
712
|
e.cardArtifacts.map((c) => [
|
|
@@ -713,7 +714,7 @@ function xt(e) {
|
|
|
713
714
|
c.card.id
|
|
714
715
|
])
|
|
715
716
|
), d = [];
|
|
716
|
-
for (const c of
|
|
717
|
+
for (const c of r.cards) {
|
|
717
718
|
const f = a.get(c.id);
|
|
718
719
|
if (!f) {
|
|
719
720
|
const l = fe(
|
|
@@ -724,24 +725,24 @@ function xt(e) {
|
|
|
724
725
|
o.push(l);
|
|
725
726
|
continue;
|
|
726
727
|
}
|
|
727
|
-
|
|
728
|
-
const
|
|
728
|
+
n.push(...f.warnings || []);
|
|
729
|
+
const b = Qe(
|
|
729
730
|
f.card,
|
|
730
731
|
e.plan.calculatedFields,
|
|
731
732
|
c.id
|
|
732
733
|
);
|
|
733
734
|
d.push({
|
|
734
735
|
id: c.frameId,
|
|
735
|
-
cards: [
|
|
736
|
-
activeCardId:
|
|
736
|
+
cards: [b],
|
|
737
|
+
activeCardId: b.id
|
|
737
738
|
});
|
|
738
739
|
}
|
|
739
740
|
if (d.length === 0)
|
|
740
741
|
throw new Error("Dashboard plan did not produce any persistable cards.");
|
|
741
742
|
const { inputs: s, defaultInputValues: u, warnings: h } = Xe(e.plan, i);
|
|
742
|
-
|
|
743
|
+
n.push(...h);
|
|
743
744
|
const I = K(
|
|
744
|
-
|
|
745
|
+
r.cards.filter((c) => d.some((f) => f.id === c.frameId)).map((c) => ({
|
|
745
746
|
frameId: c.frameId,
|
|
746
747
|
priority: c.priority,
|
|
747
748
|
role: c.role
|
|
@@ -753,10 +754,10 @@ function xt(e) {
|
|
|
753
754
|
description: e.plan.description || "",
|
|
754
755
|
sheets: [
|
|
755
756
|
{
|
|
756
|
-
id:
|
|
757
|
+
id: r.id,
|
|
757
758
|
kind: "dashboard",
|
|
758
|
-
title:
|
|
759
|
-
description:
|
|
759
|
+
title: r.title,
|
|
760
|
+
description: r.description,
|
|
760
761
|
frames: d,
|
|
761
762
|
layouts: I,
|
|
762
763
|
calculatedFields: (v = e.plan.calculatedFields) == null ? void 0 : v.filter((c) => c.scope === "sheet" && c.field).map((c) => c.field)
|
|
@@ -765,10 +766,10 @@ function xt(e) {
|
|
|
765
766
|
calculatedFields: (y = e.plan.calculatedFields) == null ? void 0 : y.filter((c) => c.scope === "dashboard" && c.field).map((c) => c.field),
|
|
766
767
|
inputs: s,
|
|
767
768
|
...u ? { defaultInputValues: u } : {}
|
|
768
|
-
}, warnings:
|
|
769
|
+
}, warnings: n, skippedOperations: o };
|
|
769
770
|
}
|
|
770
|
-
function
|
|
771
|
-
return
|
|
771
|
+
function A(e, t, r) {
|
|
772
|
+
return r ? { code: e, message: t, cardId: r } : { code: e, message: t };
|
|
772
773
|
}
|
|
773
774
|
function Ze(e) {
|
|
774
775
|
return JSON.parse(JSON.stringify(e));
|
|
@@ -776,57 +777,57 @@ function Ze(e) {
|
|
|
776
777
|
function et(e) {
|
|
777
778
|
var t;
|
|
778
779
|
return (t = e.sheets) == null ? void 0 : t.find(
|
|
779
|
-
(
|
|
780
|
+
(r) => (r.kind || "dashboard") === "dashboard"
|
|
780
781
|
);
|
|
781
782
|
}
|
|
782
|
-
function
|
|
783
|
-
var
|
|
784
|
-
for (const
|
|
785
|
-
for (const o of
|
|
786
|
-
const a = (
|
|
783
|
+
function q(e, t) {
|
|
784
|
+
var r;
|
|
785
|
+
for (const n of e.sheets || [])
|
|
786
|
+
for (const o of n.frames || []) {
|
|
787
|
+
const a = (r = o.cards) == null ? void 0 : r.find((i) => i.id === t);
|
|
787
788
|
if (a)
|
|
788
|
-
return { sheet:
|
|
789
|
+
return { sheet: n, frame: o, card: a };
|
|
789
790
|
}
|
|
790
791
|
return null;
|
|
791
792
|
}
|
|
792
793
|
function pe(e) {
|
|
793
|
-
var
|
|
794
|
-
const t = (
|
|
794
|
+
var r, n;
|
|
795
|
+
const t = (n = (r = e.cards) == null ? void 0 : r[0]) == null ? void 0 : n.type;
|
|
795
796
|
return t === "kpi" ? "kpi" : t === "table" || t === "detailTable" || t === "pivotTable" ? "table" : t === "text" ? "text" : "chart";
|
|
796
797
|
}
|
|
797
798
|
function tt(e) {
|
|
798
799
|
var t;
|
|
799
800
|
return new Map(
|
|
800
|
-
(((t = e.layouts) == null ? void 0 : t.lg) || []).map((
|
|
801
|
+
(((t = e.layouts) == null ? void 0 : t.lg) || []).map((r, n) => [r.i, n])
|
|
801
802
|
);
|
|
802
803
|
}
|
|
803
804
|
function he(e, t = /* @__PURE__ */ new Map()) {
|
|
804
|
-
const
|
|
805
|
-
|
|
805
|
+
const r = tt(e), n = Math.max(
|
|
806
|
+
r.size,
|
|
806
807
|
t.size
|
|
807
808
|
), o = (e.frames || []).map(
|
|
808
809
|
(a, i) => ({
|
|
809
810
|
frameId: a.id,
|
|
810
811
|
role: pe(a),
|
|
811
|
-
priority: t.get(a.id) ??
|
|
812
|
+
priority: t.get(a.id) ?? r.get(a.id) ?? n + i
|
|
812
813
|
})
|
|
813
814
|
);
|
|
814
815
|
e.layouts = K(o);
|
|
815
816
|
}
|
|
816
|
-
function
|
|
817
|
+
function rt(e) {
|
|
817
818
|
return Object.values(e.layouts || {}).some((t) => t.length > 0);
|
|
818
819
|
}
|
|
819
|
-
function
|
|
820
|
-
if (!
|
|
820
|
+
function nt(e, t) {
|
|
821
|
+
if (!rt(e)) {
|
|
821
822
|
he(e);
|
|
822
823
|
return;
|
|
823
824
|
}
|
|
824
|
-
const
|
|
825
|
+
const r = K([
|
|
825
826
|
{ frameId: t.id, role: pe(t), priority: 0 }
|
|
826
827
|
]);
|
|
827
828
|
e.layouts ?? (e.layouts = {});
|
|
828
|
-
for (const [
|
|
829
|
-
const a = e.layouts[
|
|
829
|
+
for (const [n, o] of Object.entries(r)) {
|
|
830
|
+
const a = e.layouts[n] || [];
|
|
830
831
|
if (a.some((s) => s.i === t.id))
|
|
831
832
|
continue;
|
|
832
833
|
const i = o[0];
|
|
@@ -836,27 +837,27 @@ function rt(e, t) {
|
|
|
836
837
|
(s, u) => Math.max(s, u.y + u.h),
|
|
837
838
|
0
|
|
838
839
|
);
|
|
839
|
-
e.layouts[
|
|
840
|
+
e.layouts[n] = [
|
|
840
841
|
...a,
|
|
841
842
|
{ ...i, y: d }
|
|
842
843
|
];
|
|
843
844
|
}
|
|
844
845
|
}
|
|
845
846
|
function at(e, t) {
|
|
846
|
-
var
|
|
847
|
-
const
|
|
847
|
+
var n;
|
|
848
|
+
const r = G(
|
|
848
849
|
t.filter,
|
|
849
850
|
t.defaultValue
|
|
850
851
|
);
|
|
851
|
-
|
|
852
|
+
r && (e.defaultInputValues ?? (e.defaultInputValues = {}), (n = e.defaultInputValues).shared ?? (n.shared = {}), e.defaultInputValues.shared[t.id] = {
|
|
852
853
|
status: "set",
|
|
853
854
|
value: {
|
|
854
855
|
kind: "filter",
|
|
855
|
-
filterValue:
|
|
856
|
+
filterValue: r
|
|
856
857
|
}
|
|
857
858
|
});
|
|
858
859
|
}
|
|
859
|
-
function
|
|
860
|
+
function xt(e) {
|
|
860
861
|
var d;
|
|
861
862
|
const t = Oe(e.changePlan);
|
|
862
863
|
if (!t.ok)
|
|
@@ -864,9 +865,9 @@ function Dt(e) {
|
|
|
864
865
|
t.errors.map((s) => s.message).join(`
|
|
865
866
|
`) || "Dashboard change plan is invalid."
|
|
866
867
|
);
|
|
867
|
-
const
|
|
868
|
+
const r = Ze(e.dashboard), n = [...t.warnings], o = [], a = new Map(
|
|
868
869
|
e.cardArtifacts.map((s) => [s.planCardId, s])
|
|
869
|
-
), i = et(
|
|
870
|
+
), i = et(r);
|
|
870
871
|
if (!i)
|
|
871
872
|
throw new Error("Dashboard has no editable dashboard sheet.");
|
|
872
873
|
i.frames ?? (i.frames = []);
|
|
@@ -881,7 +882,7 @@ function Dt(e) {
|
|
|
881
882
|
0
|
|
882
883
|
) >= R) {
|
|
883
884
|
o.push(
|
|
884
|
-
|
|
885
|
+
A(
|
|
885
886
|
"generated_card_limit_reached",
|
|
886
887
|
`AI refinement is capped at ${R} cards.`,
|
|
887
888
|
s.card.id
|
|
@@ -892,7 +893,7 @@ function Dt(e) {
|
|
|
892
893
|
const h = a.get(s.card.id);
|
|
893
894
|
if (!h) {
|
|
894
895
|
o.push(
|
|
895
|
-
|
|
896
|
+
A(
|
|
896
897
|
"missing_card_artifact",
|
|
897
898
|
`Card "${s.card.title}" was skipped because no generated artifact was supplied.`,
|
|
898
899
|
s.card.id
|
|
@@ -905,11 +906,11 @@ function Dt(e) {
|
|
|
905
906
|
cards: [h.card],
|
|
906
907
|
activeCardId: h.card.id
|
|
907
908
|
};
|
|
908
|
-
i.frames.push(I),
|
|
909
|
+
i.frames.push(I), nt(i, I);
|
|
909
910
|
break;
|
|
910
911
|
}
|
|
911
912
|
case "addFilterInput": {
|
|
912
|
-
|
|
913
|
+
r.inputs ?? (r.inputs = []);
|
|
913
914
|
const u = {
|
|
914
915
|
id: s.input.id,
|
|
915
916
|
kind: "filter",
|
|
@@ -922,23 +923,23 @@ function Dt(e) {
|
|
|
922
923
|
runtimeScope: "shared",
|
|
923
924
|
presentation: {
|
|
924
925
|
placement: "toolbar",
|
|
925
|
-
order:
|
|
926
|
+
order: r.inputs.length
|
|
926
927
|
},
|
|
927
928
|
exports: ["label", "value", "start", "end", "range"],
|
|
928
929
|
filter: s.input.filter
|
|
929
930
|
};
|
|
930
|
-
|
|
931
|
+
r.inputs.push(u), at(r, s.input);
|
|
931
932
|
break;
|
|
932
933
|
}
|
|
933
934
|
case "addCalculatedField": {
|
|
934
935
|
if (s.field.scope === "dashboard" && s.field.field)
|
|
935
|
-
|
|
936
|
+
r.calculatedFields ?? (r.calculatedFields = []), r.calculatedFields.push(s.field.field);
|
|
936
937
|
else if (s.field.scope === "sheet" && s.field.field)
|
|
937
938
|
i.calculatedFields ?? (i.calculatedFields = []), i.calculatedFields.push(s.field.field);
|
|
938
939
|
else if (s.field.scope === "card" && s.field.field) {
|
|
939
|
-
const u = s.field.targetCardId ?
|
|
940
|
+
const u = s.field.targetCardId ? q(r, s.field.targetCardId) : null;
|
|
940
941
|
u ? ((d = u.card).calculatedFields ?? (d.calculatedFields = []), u.card.calculatedFields.push(s.field.field)) : o.push(
|
|
941
|
-
|
|
942
|
+
A(
|
|
942
943
|
"missing_calculated_field_target",
|
|
943
944
|
`Calculated field "${s.field.name}" needs a valid target card.`
|
|
944
945
|
)
|
|
@@ -947,10 +948,10 @@ function Dt(e) {
|
|
|
947
948
|
break;
|
|
948
949
|
}
|
|
949
950
|
case "renameCard": {
|
|
950
|
-
const u =
|
|
951
|
+
const u = q(r, s.cardId);
|
|
951
952
|
if (!u) {
|
|
952
953
|
o.push(
|
|
953
|
-
|
|
954
|
+
A(
|
|
954
955
|
"card_not_found",
|
|
955
956
|
`Card "${s.cardId}" could not be renamed because it was not found.`,
|
|
956
957
|
s.cardId
|
|
@@ -964,15 +965,15 @@ function Dt(e) {
|
|
|
964
965
|
case "reorderCards": {
|
|
965
966
|
const u = /* @__PURE__ */ new Map();
|
|
966
967
|
for (let h = 0; h < s.cardIds.length; h += 1) {
|
|
967
|
-
const I = s.cardIds[h], w =
|
|
968
|
+
const I = s.cardIds[h], w = q(r, I);
|
|
968
969
|
w && u.set(w.frame.id, h);
|
|
969
970
|
}
|
|
970
971
|
he(i, u);
|
|
971
972
|
break;
|
|
972
973
|
}
|
|
973
974
|
case "reuseCalculatedField":
|
|
974
|
-
|
|
975
|
-
|
|
975
|
+
n.push(
|
|
976
|
+
A(
|
|
976
977
|
"reused_calculated_field",
|
|
977
978
|
`Calculated field "${s.fieldId}" is reused by reference.`
|
|
978
979
|
)
|
|
@@ -980,14 +981,14 @@ function Dt(e) {
|
|
|
980
981
|
break;
|
|
981
982
|
case "unsupported":
|
|
982
983
|
o.push(
|
|
983
|
-
|
|
984
|
+
A("unsupported_operation", s.reason || s.requestedAction)
|
|
984
985
|
);
|
|
985
986
|
break;
|
|
986
987
|
}
|
|
987
|
-
return { dashboard:
|
|
988
|
+
return { dashboard: r, warnings: n, skippedOperations: o };
|
|
988
989
|
}
|
|
989
|
-
function
|
|
990
|
-
return
|
|
990
|
+
function g(e, t, r) {
|
|
991
|
+
return r ? { code: e, message: t, cardId: r } : { code: e, message: t };
|
|
991
992
|
}
|
|
992
993
|
function F(e, t) {
|
|
993
994
|
return e.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || t;
|
|
@@ -995,15 +996,15 @@ function F(e, t) {
|
|
|
995
996
|
function me(e, t) {
|
|
996
997
|
if (!t.has(e))
|
|
997
998
|
return t.add(e), e;
|
|
998
|
-
let
|
|
999
|
-
for (; t.has(
|
|
1000
|
-
|
|
1001
|
-
return t.add(
|
|
999
|
+
let r = 2, n = `${e}-${r}`;
|
|
1000
|
+
for (; t.has(n); )
|
|
1001
|
+
r += 1, n = `${e}-${r}`;
|
|
1002
|
+
return t.add(n), n;
|
|
1002
1003
|
}
|
|
1003
1004
|
function $(e) {
|
|
1004
1005
|
return !!(e && typeof e == "object");
|
|
1005
1006
|
}
|
|
1006
|
-
function
|
|
1007
|
+
function be(e) {
|
|
1007
1008
|
return Array.isArray(e.inputs) ? e.inputs.filter(
|
|
1008
1009
|
(t) => $(t) && typeof t.id == "string"
|
|
1009
1010
|
) : [];
|
|
@@ -1022,14 +1023,14 @@ function k(e) {
|
|
|
1022
1023
|
if (!Array.isArray(e))
|
|
1023
1024
|
return [];
|
|
1024
1025
|
const t = [];
|
|
1025
|
-
for (const
|
|
1026
|
-
const
|
|
1027
|
-
|
|
1026
|
+
for (const r of e) {
|
|
1027
|
+
const n = S(r);
|
|
1028
|
+
n && t.push(n);
|
|
1028
1029
|
}
|
|
1029
1030
|
return t;
|
|
1030
1031
|
}
|
|
1031
1032
|
function it(e) {
|
|
1032
|
-
var
|
|
1033
|
+
var n, o, a;
|
|
1033
1034
|
if (!e)
|
|
1034
1035
|
return [];
|
|
1035
1036
|
const t = [];
|
|
@@ -1038,7 +1039,7 @@ function it(e) {
|
|
|
1038
1039
|
const i = S(e.dateField);
|
|
1039
1040
|
i && t.push(i), t.push(...k(e.dimensions)), t.push(
|
|
1040
1041
|
...k(
|
|
1041
|
-
(
|
|
1042
|
+
(n = e.filters) == null ? void 0 : n.map((d) => d.field)
|
|
1042
1043
|
)
|
|
1043
1044
|
);
|
|
1044
1045
|
} else if (e.kind === "records") {
|
|
@@ -1056,8 +1057,8 @@ function it(e) {
|
|
|
1056
1057
|
...e.disambiguationFields || []
|
|
1057
1058
|
].filter((i) => !!i))
|
|
1058
1059
|
)) : e.kind === "sql" && t.push(...k(e.fields));
|
|
1059
|
-
const
|
|
1060
|
-
for (const i of
|
|
1060
|
+
const r = "inputs" in e && Array.isArray(e.inputs) ? e.inputs : [];
|
|
1061
|
+
for (const i of r) {
|
|
1061
1062
|
const d = S(i.field);
|
|
1062
1063
|
d && t.push(d);
|
|
1063
1064
|
}
|
|
@@ -1065,51 +1066,51 @@ function it(e) {
|
|
|
1065
1066
|
}
|
|
1066
1067
|
function ot(e) {
|
|
1067
1068
|
const t = [];
|
|
1068
|
-
for (const
|
|
1069
|
-
const
|
|
1070
|
-
|
|
1069
|
+
for (const r of be(e)) {
|
|
1070
|
+
const n = S(r.field);
|
|
1071
|
+
n && t.push(n);
|
|
1071
1072
|
}
|
|
1072
|
-
for (const
|
|
1073
|
-
for (const
|
|
1074
|
-
t.push(...it(
|
|
1073
|
+
for (const r of U(e))
|
|
1074
|
+
for (const n of Q(r))
|
|
1075
|
+
t.push(...it(n.analytics));
|
|
1075
1076
|
return t;
|
|
1076
1077
|
}
|
|
1077
1078
|
function st(e) {
|
|
1078
|
-
var
|
|
1079
|
+
var r;
|
|
1079
1080
|
const t = [];
|
|
1080
|
-
for (const
|
|
1081
|
-
for (const o of Q(
|
|
1082
|
-
T((
|
|
1081
|
+
for (const n of U(e))
|
|
1082
|
+
for (const o of Q(n))
|
|
1083
|
+
T((r = o.analytics) == null ? void 0 : r.source) && t.push(o.analytics.source);
|
|
1083
1084
|
return t;
|
|
1084
1085
|
}
|
|
1085
1086
|
function dt(e, t) {
|
|
1086
|
-
const
|
|
1087
|
-
if (
|
|
1087
|
+
const r = P(e).filter(T);
|
|
1088
|
+
if (r.length === 0)
|
|
1088
1089
|
return t.push(
|
|
1089
|
-
|
|
1090
|
+
g(
|
|
1090
1091
|
"missing_materializable_dataset",
|
|
1091
1092
|
"No semantic or physical source could be converted into the current dashboard authoring dataset reference."
|
|
1092
1093
|
)
|
|
1093
1094
|
), [];
|
|
1094
|
-
const
|
|
1095
|
+
const n = r.every((a) => a.kind === "semantic"), o = Array.from(
|
|
1095
1096
|
new Set(
|
|
1096
|
-
|
|
1097
|
+
r.filter((a) => a.kind === "semantic").map((a) => a.domainId)
|
|
1097
1098
|
)
|
|
1098
1099
|
);
|
|
1099
|
-
return
|
|
1100
|
-
|
|
1100
|
+
return r.length > 1 && (!n || o.length !== 1) ? (t.push(
|
|
1101
|
+
g(
|
|
1101
1102
|
"multiple_datasets_out_of_scope",
|
|
1102
1103
|
"The dashboard authoring compiler supports multiple datasets only within one semantic domain; using the first source and deferring the rest."
|
|
1103
1104
|
)
|
|
1104
|
-
), [
|
|
1105
|
+
), [r[0]]) : r;
|
|
1105
1106
|
}
|
|
1106
1107
|
function ct(e, t) {
|
|
1107
|
-
const
|
|
1108
|
+
const r = U(e), n = be(e), o = P(ot(e)), a = P(
|
|
1108
1109
|
st(e)
|
|
1109
1110
|
);
|
|
1110
1111
|
return {
|
|
1111
|
-
sections:
|
|
1112
|
-
inputs:
|
|
1112
|
+
sections: r,
|
|
1113
|
+
inputs: n,
|
|
1113
1114
|
sources: o,
|
|
1114
1115
|
primarySources: a,
|
|
1115
1116
|
defaultSource: a.length === 1 ? a[0] : void 0,
|
|
@@ -1139,8 +1140,8 @@ function ut(e) {
|
|
|
1139
1140
|
}
|
|
1140
1141
|
}
|
|
1141
1142
|
function ft(e) {
|
|
1142
|
-
var t,
|
|
1143
|
-
return ((t = e.presentation) == null ? void 0 : t.kind) === "kpi" ? "kpi" : ((
|
|
1143
|
+
var t, r, n;
|
|
1144
|
+
return ((t = e.presentation) == null ? void 0 : t.kind) === "kpi" ? "kpi" : ((r = e.presentation) == null ? void 0 : r.kind) === "table" ? "table" : ((n = e.presentation) == null ? void 0 : n.kind) === "text" ? "text" : "chart";
|
|
1144
1145
|
}
|
|
1145
1146
|
function pt(e) {
|
|
1146
1147
|
const t = Se(e);
|
|
@@ -1164,30 +1165,30 @@ function mt(e) {
|
|
|
1164
1165
|
if (!(!e || e.kind !== "physical"))
|
|
1165
1166
|
return [e.databaseName, e.schemaName, e.tableName].filter(Boolean).join(".");
|
|
1166
1167
|
}
|
|
1167
|
-
function
|
|
1168
|
+
function bt(e, t, r, n, o, a) {
|
|
1168
1169
|
if (e.kind !== "filter")
|
|
1169
1170
|
return a.push(
|
|
1170
|
-
|
|
1171
|
+
g(
|
|
1171
1172
|
"control_inputs_deferred",
|
|
1172
1173
|
`Control input "${e.label}" is represented in the protocol but not yet materialized by the dashboard authoring adapter.`
|
|
1173
1174
|
)
|
|
1174
1175
|
), null;
|
|
1175
1176
|
if (!$(e.field) || typeof e.field.name != "string")
|
|
1176
1177
|
return a.push(
|
|
1177
|
-
|
|
1178
|
+
g(
|
|
1178
1179
|
"filter_requires_field",
|
|
1179
1180
|
`Filter "${e.label || e.id}" needs a field before the dashboard compiler can materialize it.`
|
|
1180
1181
|
)
|
|
1181
1182
|
), null;
|
|
1182
|
-
const i =
|
|
1183
|
+
const i = De({
|
|
1183
1184
|
explicitSource: void 0,
|
|
1184
1185
|
field: e.field,
|
|
1185
1186
|
defaultSource: t,
|
|
1186
|
-
fallbackSources:
|
|
1187
|
+
fallbackSources: r
|
|
1187
1188
|
}), d = (i == null ? void 0 : i.kind) === "semantic" || (i == null ? void 0 : i.kind) === "physical" ? i.connectionId : void 0;
|
|
1188
1189
|
if (!d)
|
|
1189
1190
|
return a.push(
|
|
1190
|
-
|
|
1191
|
+
g(
|
|
1191
1192
|
"filter_requires_connection_id",
|
|
1192
1193
|
`Filter "${e.label}" needs a source connectionId before the dashboard compiler can materialize it.`
|
|
1193
1194
|
)
|
|
@@ -1223,7 +1224,7 @@ function gt(e, t, n, r, o, a) {
|
|
|
1223
1224
|
id: e.id,
|
|
1224
1225
|
label: e.label,
|
|
1225
1226
|
variableName: e.id,
|
|
1226
|
-
scope:
|
|
1227
|
+
scope: n,
|
|
1227
1228
|
filter: h,
|
|
1228
1229
|
defaultValue: G(
|
|
1229
1230
|
h,
|
|
@@ -1231,30 +1232,30 @@ function gt(e, t, n, r, o, a) {
|
|
|
1231
1232
|
)
|
|
1232
1233
|
};
|
|
1233
1234
|
}
|
|
1234
|
-
function
|
|
1235
|
-
const t = [],
|
|
1236
|
-
for (const
|
|
1237
|
-
const o = e.viewIdToCardId.get(
|
|
1238
|
-
o ? t.push(o) :
|
|
1235
|
+
function V(e) {
|
|
1236
|
+
const t = [], r = [];
|
|
1237
|
+
for (const n of e.viewIds) {
|
|
1238
|
+
const o = e.viewIdToCardId.get(n);
|
|
1239
|
+
o ? t.push(o) : r.push(n);
|
|
1239
1240
|
}
|
|
1240
|
-
return
|
|
1241
|
-
|
|
1241
|
+
return r.length > 0 && e.warnings.push(
|
|
1242
|
+
g(
|
|
1242
1243
|
"input_scope_view_not_found",
|
|
1243
|
-
`Filter "${e.inputLabel}" referenced unknown view ids: ${
|
|
1244
|
+
`Filter "${e.inputLabel}" referenced unknown view ids: ${r.join(", ")}.`
|
|
1244
1245
|
)
|
|
1245
1246
|
), Array.from(new Set(t));
|
|
1246
1247
|
}
|
|
1247
|
-
function
|
|
1248
|
-
var
|
|
1248
|
+
function gt(e) {
|
|
1249
|
+
var n, o;
|
|
1249
1250
|
if (!e.protocolScope) {
|
|
1250
1251
|
const a = Array.from(new Set(e.boundCardIds));
|
|
1251
1252
|
return a.length > 0 && a.length < e.allCardIds.length ? { kind: "cards", cardIds: a } : void 0;
|
|
1252
1253
|
}
|
|
1253
1254
|
if (e.protocolScope.level === "dashboard") {
|
|
1254
|
-
if (!((
|
|
1255
|
+
if (!((n = e.protocolScope.excludeViewIds) != null && n.length))
|
|
1255
1256
|
return;
|
|
1256
1257
|
const a = new Set(
|
|
1257
|
-
|
|
1258
|
+
V({
|
|
1258
1259
|
inputLabel: e.inputLabel,
|
|
1259
1260
|
viewIds: e.protocolScope.excludeViewIds,
|
|
1260
1261
|
viewIdToCardId: e.viewIdToCardId,
|
|
@@ -1267,14 +1268,14 @@ function bt(e) {
|
|
|
1267
1268
|
};
|
|
1268
1269
|
}
|
|
1269
1270
|
if (e.protocolScope.level === "view") {
|
|
1270
|
-
const a =
|
|
1271
|
+
const a = V({
|
|
1271
1272
|
inputLabel: e.inputLabel,
|
|
1272
1273
|
viewIds: e.protocolScope.viewIds,
|
|
1273
1274
|
viewIdToCardId: e.viewIdToCardId,
|
|
1274
1275
|
warnings: e.warnings
|
|
1275
1276
|
});
|
|
1276
1277
|
return a.length === 0 ? (e.warnings.push(
|
|
1277
|
-
|
|
1278
|
+
g(
|
|
1278
1279
|
"input_scope_has_no_materialized_cards",
|
|
1279
1280
|
`Filter "${e.inputLabel}" was deferred because its view scope does not match any materialized cards.`
|
|
1280
1281
|
)
|
|
@@ -1283,15 +1284,15 @@ function bt(e) {
|
|
|
1283
1284
|
const t = e.sectionIdToCardIds.get(e.protocolScope.sectionId) || [];
|
|
1284
1285
|
if (t.length === 0)
|
|
1285
1286
|
return e.warnings.push(
|
|
1286
|
-
|
|
1287
|
+
g(
|
|
1287
1288
|
"input_scope_section_not_found",
|
|
1288
1289
|
`Filter "${e.inputLabel}" was deferred because section "${e.protocolScope.sectionId}" does not match any materialized cards.`
|
|
1289
1290
|
)
|
|
1290
1291
|
), null;
|
|
1291
1292
|
if (!((o = e.protocolScope.excludeViewIds) != null && o.length))
|
|
1292
1293
|
return { kind: "cards", cardIds: t };
|
|
1293
|
-
const
|
|
1294
|
-
|
|
1294
|
+
const r = new Set(
|
|
1295
|
+
V({
|
|
1295
1296
|
inputLabel: e.inputLabel,
|
|
1296
1297
|
viewIds: e.protocolScope.excludeViewIds,
|
|
1297
1298
|
viewIdToCardId: e.viewIdToCardId,
|
|
@@ -1300,29 +1301,29 @@ function bt(e) {
|
|
|
1300
1301
|
);
|
|
1301
1302
|
return {
|
|
1302
1303
|
kind: "cards",
|
|
1303
|
-
cardIds: t.filter((a) => !
|
|
1304
|
+
cardIds: t.filter((a) => !r.has(a))
|
|
1304
1305
|
};
|
|
1305
1306
|
}
|
|
1306
1307
|
function Ft(e) {
|
|
1307
1308
|
var v, y, c;
|
|
1308
|
-
const t = [],
|
|
1309
|
-
for (const f of
|
|
1310
|
-
t.push(
|
|
1311
|
-
for (const f of
|
|
1312
|
-
t.push(
|
|
1313
|
-
const
|
|
1309
|
+
const t = [], r = ve(e);
|
|
1310
|
+
for (const f of r.warnings)
|
|
1311
|
+
t.push(g(f.code, f.message));
|
|
1312
|
+
for (const f of r.errors)
|
|
1313
|
+
t.push(g(f.code, f.message));
|
|
1314
|
+
const n = ct(e, t), o = [], a = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set();
|
|
1314
1315
|
let h = 0;
|
|
1315
|
-
for (const [f,
|
|
1316
|
-
const l = typeof
|
|
1316
|
+
for (const [f, b] of n.sections.entries()) {
|
|
1317
|
+
const l = typeof b.title == "string" ? b.title : `Section ${f + 1}`, Y = b.id || F(l, `section-${f + 1}`);
|
|
1317
1318
|
i.set(Y, []);
|
|
1318
|
-
for (const [J, m] of Q(
|
|
1319
|
+
for (const [J, m] of Q(b).entries()) {
|
|
1319
1320
|
const X = ut(m), O = F(
|
|
1320
1321
|
m.id || `${l}-${m.title || `View ${J + 1}`}`,
|
|
1321
1322
|
`card-${f + 1}-${J + 1}`
|
|
1322
1323
|
);
|
|
1323
1324
|
if (!X) {
|
|
1324
1325
|
t.push(
|
|
1325
|
-
|
|
1326
|
+
g(
|
|
1326
1327
|
"unsupported_presentation",
|
|
1327
1328
|
`Dashboard presentation "${((v = m.presentation) == null ? void 0 : v.kind) || "unknown"}" is not supported by the dashboard authoring adapter.`,
|
|
1328
1329
|
`card-${O}`
|
|
@@ -1332,7 +1333,7 @@ function Ft(e) {
|
|
|
1332
1333
|
}
|
|
1333
1334
|
if (((y = m.analytics) == null ? void 0 : y.kind) === "sql") {
|
|
1334
1335
|
t.push(
|
|
1335
|
-
|
|
1336
|
+
g(
|
|
1336
1337
|
"sql_intent_deferred",
|
|
1337
1338
|
"SQL analytics intent is valid protocol, but the current dashboard authoring adapter only materializes semantic and physical config-card intents.",
|
|
1338
1339
|
`card-${O}`
|
|
@@ -1342,8 +1343,8 @@ function Ft(e) {
|
|
|
1342
1343
|
}
|
|
1343
1344
|
const Z = me(O, s), M = `card-${Z}`;
|
|
1344
1345
|
m.id && a.set(m.id, M), (c = i.get(Y)) == null || c.push(M);
|
|
1345
|
-
const
|
|
1346
|
-
for (const ee of
|
|
1346
|
+
const ge = m.analytics && "inputs" in m.analytics ? m.analytics.inputs : void 0;
|
|
1347
|
+
for (const ee of ge || []) {
|
|
1347
1348
|
const te = d.get(ee.inputId) || [];
|
|
1348
1349
|
te.push(M), d.set(ee.inputId, te);
|
|
1349
1350
|
}
|
|
@@ -1361,8 +1362,8 @@ function Ft(e) {
|
|
|
1361
1362
|
}), h += 1;
|
|
1362
1363
|
}
|
|
1363
1364
|
}
|
|
1364
|
-
const I =
|
|
1365
|
-
const
|
|
1365
|
+
const I = n.inputs.map((f) => {
|
|
1366
|
+
const b = gt({
|
|
1366
1367
|
protocolScope: f.scope,
|
|
1367
1368
|
inputLabel: f.label,
|
|
1368
1369
|
allCardIds: o.map((l) => l.id),
|
|
@@ -1371,11 +1372,11 @@ function Ft(e) {
|
|
|
1371
1372
|
sectionIdToCardIds: i,
|
|
1372
1373
|
warnings: t
|
|
1373
1374
|
});
|
|
1374
|
-
return
|
|
1375
|
+
return b === null ? null : bt(
|
|
1375
1376
|
f,
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1377
|
+
n.defaultSource,
|
|
1378
|
+
n.sources,
|
|
1379
|
+
b,
|
|
1379
1380
|
u,
|
|
1380
1381
|
t
|
|
1381
1382
|
);
|
|
@@ -1385,7 +1386,7 @@ function Ft(e) {
|
|
|
1385
1386
|
id: `plan-${F(e.title, "dashboard")}`,
|
|
1386
1387
|
title: e.title,
|
|
1387
1388
|
description: e.description,
|
|
1388
|
-
datasets:
|
|
1389
|
+
datasets: n.datasets,
|
|
1389
1390
|
sheets: [
|
|
1390
1391
|
{
|
|
1391
1392
|
id: `sheet-${F(e.title, "dashboard")}`,
|
|
@@ -1397,43 +1398,59 @@ function Ft(e) {
|
|
|
1397
1398
|
],
|
|
1398
1399
|
filterInputs: I.length ? I : void 0,
|
|
1399
1400
|
warnings: t.length ? t : void 0,
|
|
1400
|
-
unresolvedRequests:
|
|
1401
|
+
unresolvedRequests: r.ok ? void 0 : r.errors.map((f) => f.message)
|
|
1401
1402
|
}, warnings: t };
|
|
1402
1403
|
}
|
|
1403
1404
|
export {
|
|
1404
|
-
|
|
1405
|
+
Mt as AUTOMATIC_TEMPORAL_BUCKET_FORMAT,
|
|
1405
1406
|
Ie as DASHBOARD_AUTHORING_BREAKPOINTS,
|
|
1406
1407
|
R as DASHBOARD_AUTHORING_MAX_GENERATED_CARDS,
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
xt as
|
|
1408
|
+
Ut as DashboardFilterMappingContractError,
|
|
1409
|
+
Nt as SEMAPHOR_CARTESIAN_CHART_TYPES,
|
|
1410
|
+
xt as applyDashboardChangePlan,
|
|
1411
|
+
Qt as buildDashboardCardSourceIndex,
|
|
1412
|
+
At as compileDashboardFromPlan,
|
|
1410
1413
|
K as compileResponsiveDashboardLayouts,
|
|
1414
|
+
Yt as createDashboardFilterBindingId,
|
|
1411
1415
|
W as dashboardAuthoringDatasetMatchesSource,
|
|
1412
1416
|
kt as dashboardAuthoringFieldsReferToSameTarget,
|
|
1413
1417
|
S as dashboardAuthoringSourceFromField,
|
|
1414
1418
|
St as dashboardAuthoringSourceKey,
|
|
1415
1419
|
ie as dashboardAuthoringSourcesReferToSameDataset,
|
|
1420
|
+
Jt as dashboardCardFilterSourceInventoryContains,
|
|
1421
|
+
Xt as dashboardFilterTargetMatchesLogicalValue,
|
|
1422
|
+
Zt as dashboardFilterValueTypeForDataType,
|
|
1416
1423
|
Ft as dashboardPlanFromSemaphorDashboardIntent,
|
|
1417
|
-
|
|
1424
|
+
Dt as findDashboardAuthoringDatasetForSource,
|
|
1425
|
+
er as findDashboardCardExecutableSource,
|
|
1426
|
+
tr as findDashboardCardPinnedCatalogSource,
|
|
1427
|
+
rr as findDashboardSqlPinnedCatalogSource,
|
|
1418
1428
|
Ne as getDashboardAuthoringCardSource,
|
|
1419
|
-
|
|
1420
|
-
|
|
1429
|
+
nr as getDashboardFilterSubscriptionHint,
|
|
1430
|
+
Bt as getTemporalBucketAuthoringOptions,
|
|
1431
|
+
Rt as getTemporalBucketAuthoringSelection,
|
|
1432
|
+
ar as hasDashboardFilterSubscription,
|
|
1433
|
+
ir as isDashboardFilterOperationCompatible,
|
|
1421
1434
|
T as isMaterializableDashboardAuthoringSource,
|
|
1422
|
-
|
|
1435
|
+
Pt as isSemaphorCartesianChartType,
|
|
1423
1436
|
Ce as isSemaphorSourceRef,
|
|
1424
1437
|
P as mergeDashboardAuthoringSources,
|
|
1438
|
+
or as normalizeDashboardInputs,
|
|
1425
1439
|
ke as preferDashboardAuthoringSourceMetadata,
|
|
1426
1440
|
Ct as preferredDashboardAuthoringSource,
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1441
|
+
Ot as previewTemporalBucketAuthoringFormat,
|
|
1442
|
+
zt as reconcileTemporalBucketAuthoringFormat,
|
|
1443
|
+
sr as requireNormalizedDashboardInputs,
|
|
1444
|
+
Ht as resolveCanonicalDetailResultRawKey,
|
|
1445
|
+
Wt as resolveCanonicalResultOutputKey,
|
|
1446
|
+
Kt as resolveCanonicalResultRawKey,
|
|
1447
|
+
De as resolveDashboardAuthoringSource,
|
|
1448
|
+
dr as resolveDashboardFilterAutomaticTarget,
|
|
1449
|
+
cr as resolveDashboardSqlFilterTarget,
|
|
1450
|
+
qt as resolveTemporalBucketAuthoringFormat,
|
|
1451
|
+
Vt as resolveTemporalResultOwner,
|
|
1452
|
+
Lt as supportsCanonicalDashboardTemporalResult,
|
|
1453
|
+
jt as transformComparisonDocument,
|
|
1437
1454
|
Be as validateDashboardAuthoringDatasetScope,
|
|
1438
1455
|
Oe as validateDashboardChangePlan,
|
|
1439
1456
|
Pe as validateDashboardPlan
|