react-semaphor 0.1.601 → 0.1.603
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 +415 -375
- 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-ClhEIFst.js → add-to-dashboard-CFF-wFU-.js} +1 -1
- package/dist/chunks/{analytics-base-schemas-DevrgqQb.js → analytics-base-schemas-DsUh5Q3C.js} +14 -12
- package/dist/chunks/{assistant-chat-BE0XXzZP.js → assistant-chat-B6hNQI1t.js} +146 -146
- package/dist/chunks/{bookmark-impact-DXDAN5AY.js → bookmark-impact-Ba2PLcGp.js} +3 -3
- package/dist/chunks/{bookmark-state-BMyB3Tb6.js → bookmark-state-n7AaNzR_.js} +517 -516
- package/dist/chunks/{card-filter-builder-CE0-YVN5.js → card-filter-builder-Y22HizVx.js} +474 -474
- package/dist/chunks/{comparison-window-caption-Dxj2CHOa.js → comparison-window-caption-Ck2TIbnR.js} +69 -69
- package/dist/chunks/{context-BJoEFgNl.js → context-UCQ7sere.js} +1 -1
- package/dist/chunks/{dashboard-mJKPFRbb.js → dashboard-BghI99oY.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-CntwKyiZ.js → dashboard-briefing-launcher-DtBAnGiH.js} +725 -716
- package/dist/chunks/{dashboard-controls-XO089DMg.js → dashboard-controls-CtFXlyjV.js} +53 -53
- package/dist/chunks/{dashboard-json-CQRiydUv.js → dashboard-json-DfGBUtCd.js} +5 -5
- package/dist/chunks/dates-BnrXF4bb.js +185 -0
- package/dist/chunks/{edit-dashboard-visual-f-Dm-BLR.js → edit-dashboard-visual-oxt3x1wb.js} +8081 -8268
- package/dist/chunks/{filter-line-CKNMyNTQ.js → filter-line-Cy5YYqRL.js} +27 -27
- package/dist/chunks/{filter-reach-copy-B8GGyVuR.js → filter-reach-copy-CE_ZX147.js} +1786 -2214
- package/dist/chunks/{filter-value-text-CRtKecI5.js → filter-value-text-fWvSDwkl.js} +11 -11
- package/dist/chunks/{index-DoPApnxg.js → index-D5rxbtS4.js} +24 -24
- package/dist/chunks/{layout-grid-CiSCZdIr.js → layout-grid-9LndRoLa.js} +1 -1
- package/dist/chunks/{matrix-analytical-definition-myf3D3Qx.js → matrix-analytical-definition-CCp48UCw.js} +496 -425
- package/dist/chunks/matrix-member-presentation-zNehruXR.js +391 -0
- package/dist/chunks/{matrix-operation-contract-C1SuOHLZ.js → matrix-operation-contract-DPBj69D8.js} +518 -514
- package/dist/chunks/{metric-comparison-Cm0G893W.js → metric-comparison-B0FR-Q8I.js} +184 -125
- package/dist/chunks/{paintbrush-DQIwqlck.js → paintbrush-58FQYY-y.js} +1 -1
- package/dist/chunks/{palette-Cun747Rg.js → palette-Be62Tkoa.js} +1 -1
- package/dist/chunks/{pivot-result-contract-expectations-C1Dyx8du.js → pivot-result-contract-expectations-BYqAmG9n.js} +1236 -1190
- package/dist/chunks/{pivot-result-identity-CBS-ssEp.js → pivot-result-identity-CAP4--iq.js} +1 -1
- package/dist/chunks/raw-temporal-value-Dg_MTFF7.js +3778 -0
- package/dist/chunks/{report-preferences-dialog-SDZEcG2x.js → report-preferences-dialog-uJp9GBTM.js} +219 -205
- package/dist/chunks/{report-runtime-context-BbedQdtc.js → report-runtime-context-c77_KF9v.js} +2 -2
- package/dist/chunks/{resolve-dashboard-input-context-DRBS0eRa.js → resolve-dashboard-input-context-Rtl1ffmE.js} +8808 -7291
- package/dist/chunks/{save-Dj5bjm7P.js → save-C5A0JnEV.js} +1 -1
- package/dist/chunks/{saved-dashboard-context-DWVlJcsa.js → saved-dashboard-context-tcyTU8jm.js} +199 -213
- package/dist/chunks/selection-filter-compiler-DNijjI5y.js +150 -0
- package/dist/chunks/{semaphor-ready-indicator-OFOoAY-A.js → semaphor-ready-indicator-FBvunj6S.js} +37894 -35726
- package/dist/chunks/{shelf-drop-preview-context-2swWypXu.js → shelf-drop-preview-context-QKStrcK9.js} +54 -54
- package/dist/chunks/{stored-dashboard-NtOuEX6a.js → stored-dashboard-CHozcAY9.js} +770 -743
- package/dist/chunks/{style-sheet-parts-Qv4UcLAo.js → style-sheet-parts-CDCG-8Ej.js} +258 -251
- package/dist/chunks/{table-export-sheet-Do7ZB0_F.js → table-export-sheet-ZFIvs6Sj.js} +1 -1
- package/dist/chunks/{token-types-Dy_aXO-U.js → token-types-XbM6QByy.js} +1 -1
- package/dist/chunks/{upload-Bq-puSVy.js → upload-H15d7uHK.js} +1 -1
- package/dist/chunks/{validators-C7DFk3QK.js → validators-Baf3VIf5.js} +5 -5
- package/dist/chunks/{variable-draft-Cy03qnEi.js → variable-draft-C2y8Jp6Z.js} +27 -28
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +3392 -2761
- package/dist/format-utils/index.js +205 -204
- package/dist/index.js +73 -75
- 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/dashboard/dashboard-web-component.d.ts +7 -0
- package/dist/types/components/ui-custom/date-range-presets.d.ts +8 -0
- package/dist/types/index.js +5 -5
- package/dist/types/lib/dashboard-inputs/dashboard-input-target-context.d.ts +1 -1
- package/dist/types/lib/document/document-edits.d.ts +0 -4
- package/dist/types/lib/query-context/assemble-card-query.d.ts +6 -1
- package/dist/types/lib/stores/dashboard-store.d.ts +30 -1
- package/dist/types/lib/types/common-types.d.ts +0 -2
- package/dist/types/lib/types/explorer-types.d.ts +1 -1
- package/dist/types/shared/analytics-protocol/aggregate-expression.d.ts +15 -0
- package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +18 -0
- package/dist/types/shared/analytics-protocol/analyze-result-types.d.ts +3 -0
- package/dist/types/shared/analytics-protocol/comparison-choices.d.ts +92 -0
- package/dist/types/shared/analytics-protocol/comparison-placement.d.ts +30 -0
- package/dist/types/shared/analytics-protocol/contracts.d.ts +11 -5
- package/dist/types/shared/analytics-protocol/date-window.d.ts +105 -0
- package/dist/types/shared/analytics-protocol/filter-field-ownership.d.ts +27 -0
- package/dist/types/shared/analytics-protocol/fixtures.d.ts +4 -2
- package/dist/types/shared/analytics-protocol/index.d.ts +3 -0
- package/dist/types/shared/analytics-protocol/metric-comparison.d.ts +93 -11
- package/dist/types/shared/assistant-protocol/context.d.ts +16 -16
- package/dist/types/shared/dashboard-authoring/calculations/calculated-column.d.ts +52 -0
- package/dist/types/shared/dashboard-authoring/calculations/definition.d.ts +129 -0
- package/dist/types/shared/dashboard-authoring/calculations/resolve-dashboard-field-copies.d.ts +46 -0
- package/dist/types/shared/dashboard-authoring/calculations/tokens.d.ts +36 -0
- package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +8 -0
- package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +1 -1
- package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +2 -1
- package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +0 -3
- package/dist/types/shared/dashboard-authoring/changes/calculation-change.d.ts +399 -0
- package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +165 -360
- package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +23 -2
- package/dist/types/shared/dashboard-authoring/changes/domain-change.d.ts +143 -266
- package/dist/types/shared/dashboard-authoring/changes/read-card-query.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +46 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +10 -10
- package/dist/types/shared/dashboard-authoring/dashboard-variable-card.d.ts +2 -4
- package/dist/types/shared/dashboard-authoring/index.d.ts +7 -1
- package/dist/types/shared/dashboard-authoring/kpi-date-context.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/kpi-figure.d.ts +18 -0
- package/dist/types/shared/dashboard-authoring/measure-calculations/comparison.d.ts +8 -7
- package/dist/types/shared/dashboard-authoring/measure-calculations/dates.d.ts +11 -1
- package/dist/types/shared/dashboard-authoring/measure-calculations/index.d.ts +2 -2
- package/dist/types/shared/dashboard-authoring/measure-calculations/options.d.ts +4 -0
- package/dist/types/shared/dashboard-authoring/measure-calculations/read.d.ts +18 -1
- package/dist/types/shared/dashboard-authoring/measure-calculations/resolve.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/measure-calculations/schemas.d.ts +46 -88
- package/dist/types/shared/dashboard-authoring/operations/calculated-field-operations.d.ts +158 -0
- package/dist/types/shared/dashboard-authoring/operations/card-operations.d.ts +71 -0
- package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +17 -6
- package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +21 -0
- package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +3 -0
- package/dist/types/shared/format-utils/comparison-detail.d.ts +34 -0
- package/dist/types/shared/format-utils/index.d.ts +1 -0
- package/dist/types/shared/format-utils/partial-period.d.ts +4 -2
- package/dist/types/shared/temporal/calendar-periods.d.ts +11 -0
- package/dist/types/shared/temporal/index.d.ts +2 -0
- package/dist/types/shared/temporal/temporal-text.d.ts +33 -0
- package/dist/types/shared/temporal/temporal.d.ts +27 -0
- package/dist/types/shared/temporal/zoned-wall-clock.d.ts +4 -3
- package/dist/types/shared/usage-events/details.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 +3 -2
- package/dist/chunks/dates-B-Urp5OD.js +0 -164
- package/dist/chunks/matrix-member-presentation-g0c_NpDW.js +0 -258
- package/dist/chunks/raw-temporal-value-DN_l-Tss.js +0 -454
- package/dist/chunks/selection-filter-compiler-DmAr7yqC.js +0 -131
package/dist/chunks/{saved-dashboard-context-DWVlJcsa.js → saved-dashboard-context-tcyTU8jm.js}
RENAMED
|
@@ -1,97 +1,83 @@
|
|
|
1
1
|
var Z = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var F = (e, t, a) =>
|
|
4
|
-
import { D as S,
|
|
5
|
-
import { s as X,
|
|
6
|
-
import { c as
|
|
7
|
-
import { f as g, A as P, c as
|
|
8
|
-
import { a as
|
|
9
|
-
import { k as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
2
|
+
var G = (e, t, a) => t in e ? Z(e, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[t] = a;
|
|
3
|
+
var F = (e, t, a) => G(e, typeof t != "symbol" ? t + "" : t, a);
|
|
4
|
+
import { D as S, H as Q, I as U, F as K } from "./bookmark-state-n7AaNzR_.js";
|
|
5
|
+
import { s as W, t as X, u as Y, v as ee, w as te, x as ae, y as ne, z as re, A as se, q as oe, B as L, C as ie, D as de, E as le } from "./resolve-dashboard-input-context-Rtl1ffmE.js";
|
|
6
|
+
import { c as ce, e as j, b as ue, d as me, p as $, f as fe, g as he, r as w, i as O, j as pe, m as be, k as ge } from "./stored-dashboard-CHozcAY9.js";
|
|
7
|
+
import { f as g, A as P, c as Ce, d as Ie, e as A } from "./context-UCQ7sere.js";
|
|
8
|
+
import { a as ye, T as ve, P as xe, o as I, d as B, b as D } from "./filter-value-text-fWvSDwkl.js";
|
|
9
|
+
import { k as Ve, a9 as Se } from "./validators-Baf3VIf5.js";
|
|
10
|
+
import { aI as qe, d as ke } from "./pivot-result-contract-expectations-BYqAmG9n.js";
|
|
11
|
+
import { h as $e } from "./metric-comparison-B0FR-Q8I.js";
|
|
12
|
+
import { i as we } from "./matrix-analytical-definition-CCp48UCw.js";
|
|
13
|
+
function De(e) {
|
|
13
14
|
const t = e.qualifiedFieldName || e.name;
|
|
14
15
|
return e.label && e.label !== t ? `${e.label} (field ${t})` : t;
|
|
15
16
|
}
|
|
16
|
-
function
|
|
17
|
+
function _e(e, t = {}) {
|
|
17
18
|
if (!e) return [];
|
|
18
19
|
const a = N(e, t);
|
|
19
20
|
return a.length === 0 ? [] : e.logicalOperator === "AND" && !e.negate ? a : [z(e, a)];
|
|
20
21
|
}
|
|
21
22
|
function N(e, t) {
|
|
22
|
-
const a = e.groups.flatMap((
|
|
23
|
-
const
|
|
24
|
-
if (
|
|
25
|
-
const s = z(
|
|
26
|
-
return [
|
|
23
|
+
const a = e.groups.flatMap((n) => {
|
|
24
|
+
const r = N(n, t);
|
|
25
|
+
if (r.length === 0) return [];
|
|
26
|
+
const s = z(n, r);
|
|
27
|
+
return [r.length > 1 && !n.negate ? { ...s, text: `(${s.text})` } : s];
|
|
27
28
|
});
|
|
28
|
-
return [...e.conditions.map((
|
|
29
|
+
return [...e.conditions.map((n) => Fe(n, t)), ...a];
|
|
29
30
|
}
|
|
30
31
|
function z(e, t) {
|
|
31
|
-
const a = t.map((
|
|
32
|
+
const a = t.map((n) => n.text).join(e.logicalOperator === "OR" ? " or " : " and ");
|
|
32
33
|
return {
|
|
33
34
|
text: e.negate ? `not (${a})` : a,
|
|
34
|
-
omittedValues: t.reduce((
|
|
35
|
+
omittedValues: t.reduce((n, r) => n + r.omittedValues, 0)
|
|
35
36
|
};
|
|
36
37
|
}
|
|
37
|
-
function
|
|
38
|
+
function Fe(e, t) {
|
|
38
39
|
const a = Array.isArray(e.value) ? e.value : [e.value];
|
|
39
|
-
return
|
|
40
|
-
subject:
|
|
40
|
+
return ye({
|
|
41
|
+
subject: De(e.field),
|
|
41
42
|
operator: e.operator,
|
|
42
43
|
values: a,
|
|
43
|
-
reading:
|
|
44
|
-
relative:
|
|
44
|
+
reading: Ae(e),
|
|
45
|
+
relative: Ve(e.relativeMeta),
|
|
45
46
|
latestValue: e.latestValue,
|
|
46
47
|
shownAs: e.label
|
|
47
48
|
}, t);
|
|
48
49
|
}
|
|
49
|
-
function
|
|
50
|
-
return e.temporalBucket ? { kind: "bucket", bucket: e.temporalBucket } :
|
|
50
|
+
function Ae(e) {
|
|
51
|
+
return e.temporalBucket ? { kind: "bucket", bucket: e.temporalBucket } : Se(e.field.dataType) ? ve : xe;
|
|
51
52
|
}
|
|
52
|
-
function
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
return (e == null ? void 0 : e.kind) === "field_date" ? `the ${JSON.stringify(e.label)} filter` : "the dashboard date";
|
|
62
|
-
}
|
|
63
|
-
function Ae(e, t) {
|
|
64
|
-
const a = t.source === "explicit" ? "set on the measure" : `from the dashboard date comparison on ${Me(t.owner)}`;
|
|
65
|
-
return `${e} is compared with ${H(t.spec)} (${a})`;
|
|
66
|
-
}
|
|
67
|
-
function $(e) {
|
|
68
|
-
const t = X(e) ?? "undefined";
|
|
69
|
-
return `${A(t, 2654435769).toString(16)}${A(t, 2246822507).toString(16)}`;
|
|
70
|
-
}
|
|
71
|
-
function A(e, t) {
|
|
72
|
-
let a = 3735928559 ^ t, r = 1103547991 ^ t;
|
|
73
|
-
for (let n = 0; n < e.length; n++) {
|
|
74
|
-
const s = e.charCodeAt(n);
|
|
75
|
-
a = Math.imul(a ^ s, 2654435761), r = Math.imul(r ^ s, 1597334677);
|
|
53
|
+
function k(e) {
|
|
54
|
+
const t = W(e) ?? "undefined";
|
|
55
|
+
return `${M(t, 2654435769).toString(16)}${M(t, 2246822507).toString(16)}`;
|
|
56
|
+
}
|
|
57
|
+
function M(e, t) {
|
|
58
|
+
let a = 3735928559 ^ t, n = 1103547991 ^ t;
|
|
59
|
+
for (let r = 0; r < e.length; r++) {
|
|
60
|
+
const s = e.charCodeAt(r);
|
|
61
|
+
a = Math.imul(a ^ s, 2654435761), n = Math.imul(n ^ s, 1597334677);
|
|
76
62
|
}
|
|
77
|
-
return a = Math.imul(a ^ a >>> 16, 2246822507) ^ Math.imul(
|
|
63
|
+
return a = Math.imul(a ^ a >>> 16, 2246822507) ^ Math.imul(n ^ n >>> 13, 3266489909), n = Math.imul(n ^ n >>> 16, 2246822507) ^ Math.imul(a ^ a >>> 13, 3266489909), 4294967296 * (2097151 & n) + (a >>> 0);
|
|
78
64
|
}
|
|
79
65
|
const h = P;
|
|
80
|
-
function
|
|
66
|
+
function Me(e, t, a) {
|
|
81
67
|
var y;
|
|
82
|
-
const
|
|
83
|
-
if (
|
|
84
|
-
const v = t !== "pending" && (t == null ? void 0 : t.status) === "blocked" ?
|
|
68
|
+
const n = t !== "pending" && (t == null ? void 0 : t.status) === "ready" ? t : void 0, r = Re(e, t);
|
|
69
|
+
if (r) {
|
|
70
|
+
const v = t !== "pending" && (t == null ? void 0 : t.status) === "blocked" ? Te(t) : void 0, q = v ? g(v, h.textChars) : void 0;
|
|
85
71
|
return {
|
|
86
72
|
// A card that runs but is not described still changes when it runs differently.
|
|
87
|
-
fingerprint:
|
|
88
|
-
description: { status: "not_described", reason:
|
|
73
|
+
fingerprint: k(n ? R(n, a.calendar) : { reason: r, message: q }),
|
|
74
|
+
description: { status: "not_described", reason: r, ...q ? { message: q } : {} }
|
|
89
75
|
};
|
|
90
76
|
}
|
|
91
|
-
const s =
|
|
77
|
+
const s = n, l = s.queryContext, m = Le(s), o = Pe(s, a), c = Ne(s), i = je(s), u = l.drillSteps.map((v) => g(
|
|
92
78
|
`${JSON.stringify(v.label)} (then by ${v.toField.label || v.toField.name})`,
|
|
93
79
|
h.textChars
|
|
94
|
-
)), d = (y = s.card.sql) == null ? void 0 : y.trim(), b = d ?
|
|
80
|
+
)), d = (y = s.card.sql) == null ? void 0 : y.trim(), b = d ? ze(s) : [], f = {
|
|
95
81
|
fields: I(m.length, h.cardFields),
|
|
96
82
|
filters: I(o.length, h.cardFilters),
|
|
97
83
|
controls: I(c.length, h.cardControls),
|
|
@@ -100,7 +86,7 @@ function Re(e, t, a) {
|
|
|
100
86
|
comparisons: I(i.length, h.cardFields)
|
|
101
87
|
}, p = Object.fromEntries(Object.entries(f).filter(([, v]) => v > 0));
|
|
102
88
|
return {
|
|
103
|
-
fingerprint:
|
|
89
|
+
fingerprint: k(R(s, a.calendar)),
|
|
104
90
|
description: {
|
|
105
91
|
status: "described",
|
|
106
92
|
fields: m.slice(0, h.cardFields),
|
|
@@ -118,119 +104,119 @@ function Re(e, t, a) {
|
|
|
118
104
|
}
|
|
119
105
|
};
|
|
120
106
|
}
|
|
121
|
-
function
|
|
107
|
+
function Re(e, t) {
|
|
122
108
|
if (e.type === "matrixTable") return "matrix";
|
|
123
|
-
if (e.type === "custom" ||
|
|
124
|
-
if (
|
|
109
|
+
if (e.type === "custom" || X(e)) return "custom_visual";
|
|
110
|
+
if (Y(e.python ?? "").trim()) return "python";
|
|
125
111
|
if (t === "pending") return "snapshot_pending";
|
|
126
112
|
if ((t == null ? void 0 : t.status) !== "ready") return "snapshot_blocked";
|
|
127
113
|
}
|
|
128
|
-
function
|
|
114
|
+
function Te(e) {
|
|
129
115
|
if (e.message) return e.message;
|
|
130
116
|
const t = e.mappingDispositions.flatMap((a) => a.status === "block" ? [`${a.inputId} (${a.reason})`] : []);
|
|
131
117
|
return t.length ? `dashboard inputs that cannot apply to this card: ${t.join(", ")}` : void 0;
|
|
132
118
|
}
|
|
133
119
|
function R(e, t) {
|
|
134
|
-
return
|
|
120
|
+
return ce(e.card, e.queryContext, t).queryInputIdentity;
|
|
135
121
|
}
|
|
136
|
-
const
|
|
122
|
+
const Ee = [
|
|
137
123
|
["row", "rows"],
|
|
138
124
|
["column", "columns"],
|
|
139
125
|
["measure", "metrics"],
|
|
140
126
|
["detail", "details"]
|
|
141
127
|
];
|
|
142
128
|
function Le(e) {
|
|
143
|
-
const { fields: t } =
|
|
129
|
+
const { fields: t } = ee({
|
|
144
130
|
type: e.card.type,
|
|
145
131
|
config: e.queryContext.finalConfig
|
|
146
132
|
});
|
|
147
|
-
return
|
|
148
|
-
const s =
|
|
133
|
+
return Ee.flatMap(([a, n]) => t[n].map((r) => {
|
|
134
|
+
const s = r.aggregate, l = r.grainMode ?? r.granularity;
|
|
149
135
|
return {
|
|
150
136
|
role: a,
|
|
151
|
-
label: g(
|
|
152
|
-
name: g(
|
|
137
|
+
label: g(r.label || r.name, h.labelChars),
|
|
138
|
+
name: g(r.name, h.labelChars),
|
|
153
139
|
...s ? { aggregate: s } : {},
|
|
154
140
|
...l ? { granularity: l } : {}
|
|
155
141
|
};
|
|
156
142
|
}));
|
|
157
143
|
}
|
|
158
|
-
function
|
|
144
|
+
function je(e) {
|
|
159
145
|
const t = e.queryContext;
|
|
160
146
|
return (t.finalConfig.metricColumns ?? []).flatMap((a) => {
|
|
161
|
-
const
|
|
147
|
+
const n = $e({
|
|
162
148
|
metricComparison: a.comparison,
|
|
163
149
|
globalDateComparison: t.globalDateComparison
|
|
164
150
|
});
|
|
165
|
-
return
|
|
151
|
+
return n ? [g(qe(Oe(a.label || a.name), n), h.textChars)] : [];
|
|
166
152
|
});
|
|
167
153
|
}
|
|
168
|
-
function
|
|
154
|
+
function Oe(e) {
|
|
169
155
|
return JSON.stringify(e);
|
|
170
156
|
}
|
|
171
|
-
function
|
|
172
|
-
const a = e.queryContext,
|
|
173
|
-
[...a.queryFilterDefinitions, ...
|
|
157
|
+
function Pe(e, { calendar: t }) {
|
|
158
|
+
const a = e.queryContext, n = { maxListedValues: h.inputValues, timeZone: t.tz }, r = te(e.card), s = new Set(r.map((i) => i.id)), l = new Map(
|
|
159
|
+
[...a.queryFilterDefinitions, ...r].map((i) => [i.id, i.title])
|
|
174
160
|
), m = a.cardFilterValues.map((i) => {
|
|
175
|
-
const u = l.get(i.filterId) || i.name, d = i.dateOwner === "global_date" ? `${u} (the dashboard date, on this card's field ${i.name})` : `${u} (field ${i.name})`, b = B(i, d,
|
|
161
|
+
const u = l.get(i.filterId) || i.name, d = i.dateOwner === "global_date" ? `${u} (the dashboard date, on this card's field ${i.name})` : `${u} (field ${i.name})`, b = B(i, d, n);
|
|
176
162
|
return {
|
|
177
163
|
// A click that reaches the card through relationships is the click it
|
|
178
164
|
// is, not an input (click relationship reach CR-D15).
|
|
179
|
-
origin:
|
|
165
|
+
origin: we(i.filterId) ? "selection" : s.has(i.filterId) ? "card_input" : "dashboard_input",
|
|
180
166
|
text: g(b.text, h.textChars),
|
|
181
167
|
...b.omittedValues ? { omittedValues: b.omittedValues } : {}
|
|
182
168
|
};
|
|
183
|
-
}), o = a.resolvedFilterParts, c = [["card", o.authored], ["drill", o.drill], ["selection", o.selections]].flatMap(([i, u]) =>
|
|
169
|
+
}), o = a.resolvedFilterParts, c = [["card", o.authored], ["drill", o.drill], ["selection", o.selections]].flatMap(([i, u]) => _e(u, n).map((d) => ({
|
|
184
170
|
origin: i,
|
|
185
171
|
text: g(d.text, h.textChars),
|
|
186
172
|
...d.omittedValues ? { omittedValues: d.omittedValues } : {}
|
|
187
173
|
})));
|
|
188
174
|
return [...m, ...c];
|
|
189
175
|
}
|
|
190
|
-
function
|
|
191
|
-
const t = e.queryContext, a =
|
|
176
|
+
function Be(e) {
|
|
177
|
+
const t = e.queryContext, a = j({
|
|
192
178
|
sql: e.card.sql,
|
|
193
179
|
controlBindings: t.controlBindings
|
|
194
180
|
});
|
|
195
181
|
return [.../* @__PURE__ */ new Set([
|
|
196
|
-
...t.controlBindings.map((
|
|
197
|
-
...a.map((
|
|
198
|
-
])].map((
|
|
199
|
-
id:
|
|
200
|
-
bindings: t.controlBindings.filter((s) => s.controlId ===
|
|
201
|
-
sqlParameterIds: a.filter((s) => s.controlId ===
|
|
182
|
+
...t.controlBindings.map((r) => r.controlId),
|
|
183
|
+
...a.map((r) => r.controlId)
|
|
184
|
+
])].map((r) => ({
|
|
185
|
+
id: r,
|
|
186
|
+
bindings: t.controlBindings.filter((s) => s.controlId === r),
|
|
187
|
+
sqlParameterIds: a.filter((s) => s.controlId === r).map((s) => s.paramId)
|
|
202
188
|
}));
|
|
203
189
|
}
|
|
204
|
-
function
|
|
190
|
+
function Ne(e) {
|
|
205
191
|
const t = e.queryContext, a = new Map(
|
|
206
|
-
[...t.controlDefinitions, ...t.cardControlDefinitions].map((
|
|
192
|
+
[...t.controlDefinitions, ...t.cardControlDefinitions].map((n) => [n.id, n])
|
|
207
193
|
);
|
|
208
|
-
return
|
|
194
|
+
return Be(e).map(({ id: n, bindings: r, sqlParameterIds: s }) => {
|
|
209
195
|
var o;
|
|
210
|
-
const l = t.controlValues[
|
|
211
|
-
...
|
|
196
|
+
const l = t.controlValues[n], m = /* @__PURE__ */ new Set([
|
|
197
|
+
...r.filter((c) => c.target !== "sql_param").map((c) => He(c, l)),
|
|
212
198
|
...s.map((c) => `SQL parameter ${c}`)
|
|
213
199
|
]);
|
|
214
200
|
return {
|
|
215
|
-
label: g(((o = a.get(
|
|
201
|
+
label: g(((o = a.get(n)) == null ? void 0 : o.label) || n, h.labelChars),
|
|
216
202
|
valueText: g(
|
|
217
|
-
`${
|
|
203
|
+
`${D(l, { maxListedValues: h.inputValues }).text}${m.size ? `; ${[...m].join("; ")}` : ""}`,
|
|
218
204
|
h.textChars
|
|
219
205
|
)
|
|
220
206
|
};
|
|
221
207
|
});
|
|
222
208
|
}
|
|
223
|
-
function
|
|
209
|
+
function ze(e) {
|
|
224
210
|
const t = e.queryContext;
|
|
225
|
-
return
|
|
211
|
+
return j({ sql: e.card.sql, controlBindings: t.controlBindings }).map((a) => ({
|
|
226
212
|
name: g(a.paramId, h.labelChars),
|
|
227
213
|
valueText: g(
|
|
228
|
-
|
|
214
|
+
D(t.controlValues[a.controlId], { maxListedValues: h.inputValues }).text,
|
|
229
215
|
h.textChars
|
|
230
216
|
)
|
|
231
217
|
}));
|
|
232
218
|
}
|
|
233
|
-
function
|
|
219
|
+
function He(e, t) {
|
|
234
220
|
const a = typeof t == "string" || typeof t == "number" || typeof t == "boolean" ? String(t) : void 0;
|
|
235
221
|
switch (e.target) {
|
|
236
222
|
case "sql_param":
|
|
@@ -243,48 +229,48 @@ function Je(e, t) {
|
|
|
243
229
|
return `sets the time grain${a && e.mapping[a] ? ` to ${e.mapping[a]}` : ""}`;
|
|
244
230
|
case "config_field_selector":
|
|
245
231
|
case "config_metric_selector": {
|
|
246
|
-
const
|
|
247
|
-
if (!
|
|
248
|
-
const s = "kind" in
|
|
249
|
-
return `chooses the ${
|
|
232
|
+
const n = a ? e.mapping[a] : void 0, r = e.target === "config_field_selector" ? "field" : "measure";
|
|
233
|
+
if (!n) return `chooses the ${r}`;
|
|
234
|
+
const s = "kind" in n ? `Matrix ${n.id}` : `${n.label || n.name}${"aggregate" in n && n.aggregate ? ` (${n.aggregate})` : ""}`;
|
|
235
|
+
return `chooses the ${r} ${JSON.stringify(s)}`;
|
|
250
236
|
}
|
|
251
237
|
}
|
|
252
238
|
}
|
|
253
239
|
class V extends Error {
|
|
254
|
-
constructor(a,
|
|
255
|
-
super(
|
|
240
|
+
constructor(a, n) {
|
|
241
|
+
super(n);
|
|
256
242
|
F(this, "code");
|
|
257
243
|
this.name = "AssistantContextSourceError", this.code = a;
|
|
258
244
|
}
|
|
259
245
|
}
|
|
260
|
-
const C = P,
|
|
246
|
+
const C = P, Je = "Untitled";
|
|
261
247
|
function Ze(e) {
|
|
262
248
|
var f;
|
|
263
249
|
if (e.surface === "none")
|
|
264
250
|
return T({
|
|
265
|
-
version:
|
|
251
|
+
version: A,
|
|
266
252
|
surface: "none",
|
|
267
253
|
otherSheets: [],
|
|
268
254
|
activeInputs: [],
|
|
269
255
|
cards: [],
|
|
270
256
|
timeZone: e.timeZone
|
|
271
257
|
});
|
|
272
|
-
const { dashboard: t, sheetId: a, calendar:
|
|
258
|
+
const { dashboard: t, sheetId: a, calendar: n } = e, r = t.sheets ?? [], s = r.find((p) => p.id === a);
|
|
273
259
|
if (a !== null && !s)
|
|
274
260
|
throw new V("sheet_not_found", `sheet ${a} is not on dashboard ${t.id}`);
|
|
275
|
-
const l =
|
|
261
|
+
const l = r.filter((p) => p.id !== a), m = s ? S(t).filter((p) => p.sheetId === a) : [], o = m.slice(0, C.summaryCards), c = e.selectedCard ? m.find((p) => p.cardId === e.selectedCard.cardId) : void 0, i = ((f = e.selectedCard) == null ? void 0 : f.card) ?? (c == null ? void 0 : c.card);
|
|
276
262
|
if (e.selectedCard && !i)
|
|
277
263
|
throw new V(
|
|
278
264
|
"card_not_on_sheet",
|
|
279
265
|
`card ${e.selectedCard.cardId} is not on sheet ${a}`
|
|
280
266
|
);
|
|
281
|
-
const u = s ?
|
|
267
|
+
const u = s ? Ue(e, s, m) : [], d = {
|
|
282
268
|
otherSheets: I(l.length, C.otherSheets),
|
|
283
269
|
activeInputs: I(u.length, C.activeInputs),
|
|
284
270
|
cards: I(m.length, C.summaryCards)
|
|
285
271
|
}, b = Object.fromEntries(Object.entries(d).filter(([, p]) => p > 0));
|
|
286
272
|
return T({
|
|
287
|
-
version:
|
|
273
|
+
version: A,
|
|
288
274
|
surface: e.editing ? "editor" : "dashboard",
|
|
289
275
|
dashboard: {
|
|
290
276
|
id: t.id,
|
|
@@ -294,26 +280,26 @@ function Ze(e) {
|
|
|
294
280
|
...s ? { sheet: { id: s.id, title: x(s.title) } } : {},
|
|
295
281
|
otherSheets: l.slice(0, C.otherSheets).map((p) => ({ id: p.id, title: x(p.title) })),
|
|
296
282
|
activeInputs: u.slice(0, C.activeInputs),
|
|
297
|
-
cards: o.map((p) =>
|
|
298
|
-
...i && e.selectedCard ? { selectedCard:
|
|
283
|
+
cards: o.map((p) => H(p.card)),
|
|
284
|
+
...i && e.selectedCard ? { selectedCard: Ge(i, e.selectedCard.snapshot, n) } : {},
|
|
299
285
|
...e.editing ? { editing: e.editing } : {},
|
|
300
286
|
...Object.keys(b).length ? { omitted: b } : {},
|
|
301
|
-
timeZone:
|
|
287
|
+
timeZone: n.tz
|
|
302
288
|
});
|
|
303
289
|
}
|
|
304
|
-
function
|
|
305
|
-
return { ...
|
|
290
|
+
function Ge(e, t, a) {
|
|
291
|
+
return { ...H(e), ...Me(e, t, { calendar: a }) };
|
|
306
292
|
}
|
|
307
293
|
function T(e) {
|
|
308
|
-
const t =
|
|
309
|
-
if (t > C.contextBytes) throw new
|
|
294
|
+
const t = Ce(e);
|
|
295
|
+
if (t > C.contextBytes) throw new Ie(t);
|
|
310
296
|
return e;
|
|
311
297
|
}
|
|
312
298
|
function x(e) {
|
|
313
|
-
return g((e == null ? void 0 : e.trim()) ||
|
|
299
|
+
return g((e == null ? void 0 : e.trim()) || Je, C.labelChars);
|
|
314
300
|
}
|
|
315
|
-
function
|
|
316
|
-
const t =
|
|
301
|
+
function H(e) {
|
|
302
|
+
const t = Qe(e);
|
|
317
303
|
return {
|
|
318
304
|
id: e.id,
|
|
319
305
|
title: x(e.title),
|
|
@@ -321,19 +307,19 @@ function J(e) {
|
|
|
321
307
|
...t ? { source: t } : {}
|
|
322
308
|
};
|
|
323
309
|
}
|
|
324
|
-
function
|
|
310
|
+
function Qe(e) {
|
|
325
311
|
var a;
|
|
326
|
-
const t =
|
|
312
|
+
const t = se(e);
|
|
327
313
|
if (t.kind === "config")
|
|
328
314
|
return t.executableSources.length === 1 ? t.executableSources[0] : void 0;
|
|
329
315
|
if (t.kind === "sql") {
|
|
330
|
-
const
|
|
331
|
-
return
|
|
316
|
+
const n = ((a = e.dataSource) == null ? void 0 : a.connectionId) || e.connectionId;
|
|
317
|
+
return n ? { kind: "sql", connectionId: n } : void 0;
|
|
332
318
|
}
|
|
333
319
|
}
|
|
334
|
-
function
|
|
335
|
-
const { dashboard:
|
|
336
|
-
dashboard:
|
|
320
|
+
function Ue(e, t, a) {
|
|
321
|
+
const { dashboard: n } = e, r = t.kind === "document" ? "document" : "dashboard", s = r === "document" ? void 0 : e.transientContexts, { shouldApplyDashboardFilters: l } = ue(s), m = (u, d) => ae({
|
|
322
|
+
dashboard: n,
|
|
337
323
|
sheetId: t.id,
|
|
338
324
|
card: u,
|
|
339
325
|
sectionId: d,
|
|
@@ -344,18 +330,18 @@ function Ke(e, t, a) {
|
|
|
344
330
|
u.inputs.forEach((d, b) => {
|
|
345
331
|
if (E(d)) return;
|
|
346
332
|
const f = u.resolvedInputs[b], p = o.get(d.id) ?? { input: d };
|
|
347
|
-
!p.resolved && f &&
|
|
333
|
+
!p.resolved && f && Ke(f) && (p.resolved = f), o.set(d.id, p);
|
|
348
334
|
});
|
|
349
335
|
};
|
|
350
336
|
c(m(null));
|
|
351
|
-
let i = ne(
|
|
337
|
+
let i = ne(n).filter((u) => {
|
|
352
338
|
var d;
|
|
353
339
|
return !E(u) && !((d = o.get(u.id)) != null && d.resolved);
|
|
354
340
|
});
|
|
355
341
|
for (const u of a) {
|
|
356
342
|
if (i.length === 0) break;
|
|
357
|
-
const d = u.kind === "documentSectionCard" ? u.sectionId : void 0, b = { sheetId: t.id, sheetKind:
|
|
358
|
-
if (i.some((f) =>
|
|
343
|
+
const d = u.kind === "documentSectionCard" ? u.sectionId : void 0, b = { sheetId: t.id, sheetKind: r, cardId: u.cardId, sectionId: d };
|
|
344
|
+
if (i.some((f) => Q(f, b))) {
|
|
359
345
|
try {
|
|
360
346
|
c(m(u.card, d));
|
|
361
347
|
} catch {
|
|
@@ -369,7 +355,7 @@ function Ke(e, t, a) {
|
|
|
369
355
|
}
|
|
370
356
|
return [...o.values()].flatMap((u) => {
|
|
371
357
|
if (!u.resolved) return [];
|
|
372
|
-
const d = u.input.kind === "filter" && !l && !
|
|
358
|
+
const d = u.input.kind === "filter" && !l && !U(u.input), b = We(u, e.calendar.tz, d);
|
|
373
359
|
return b ? [b] : [];
|
|
374
360
|
});
|
|
375
361
|
}
|
|
@@ -378,30 +364,30 @@ function E(e) {
|
|
|
378
364
|
const t = (a = e.compatibility) == null ? void 0 : a.source;
|
|
379
365
|
return t === "cardInlineFilter" || t === "cardControl";
|
|
380
366
|
}
|
|
381
|
-
function
|
|
367
|
+
function Ke(e) {
|
|
382
368
|
if (e.kind === "filter") return !!e.filterValue;
|
|
383
369
|
const t = e.controlValue;
|
|
384
370
|
return t == null ? !1 : typeof t == "string" ? t.trim().length > 0 : Array.isArray(t) ? t.length > 0 : !0;
|
|
385
371
|
}
|
|
386
|
-
function
|
|
387
|
-
const { input:
|
|
388
|
-
inputId:
|
|
372
|
+
function We(e, t, a) {
|
|
373
|
+
const { input: n, resolved: r } = e, s = x(n.label), l = {
|
|
374
|
+
inputId: n.id,
|
|
389
375
|
label: s,
|
|
390
|
-
...
|
|
376
|
+
...n.kind === "filter" && re(n.filter) ? { globalDate: !0 } : {}
|
|
391
377
|
};
|
|
392
|
-
if (
|
|
378
|
+
if (n.runtimeScope === "perCard" || n.runtimeScope === "perDocumentSection")
|
|
393
379
|
return { ...l, value: { kind: "varies" } };
|
|
394
380
|
const m = { maxListedValues: C.inputValues, timeZone: t };
|
|
395
381
|
let o;
|
|
396
|
-
if ((
|
|
397
|
-
o = B(
|
|
398
|
-
else if ((
|
|
399
|
-
const i =
|
|
382
|
+
if ((r == null ? void 0 : r.kind) === "filter" && r.filterValue)
|
|
383
|
+
o = B(r.filterValue, s, m);
|
|
384
|
+
else if ((r == null ? void 0 : r.kind) === "control") {
|
|
385
|
+
const i = D(r.controlValue, m);
|
|
400
386
|
o = { text: `${s} is set to ${i.text}`, omittedValues: i.omittedValues };
|
|
401
387
|
}
|
|
402
388
|
if (!o) return;
|
|
403
|
-
const c = (
|
|
404
|
-
return (c == null ? void 0 : c.mode) === "period" && (o = { ...o, text: `${o.text}; compared with ${
|
|
389
|
+
const c = (r == null ? void 0 : r.kind) === "filter" ? r.comparisonSelection : void 0;
|
|
390
|
+
return (c == null ? void 0 : c.mode) === "period" && (o = { ...o, text: `${o.text}; compared with ${ke(c.spec).sentence}` }), {
|
|
405
391
|
...l,
|
|
406
392
|
value: {
|
|
407
393
|
kind: "set",
|
|
@@ -410,21 +396,21 @@ function Xe(e, t, a) {
|
|
|
410
396
|
...a ? { notApplied: "opened_from_another_dashboard" } : {},
|
|
411
397
|
// The resolved value itself, with any date comparison on it and whether
|
|
412
398
|
// the view applies it, so any change counts, shown or not.
|
|
413
|
-
fingerprint:
|
|
414
|
-
(
|
|
399
|
+
fingerprint: k(
|
|
400
|
+
(r == null ? void 0 : r.kind) === "filter" ? { filter: r.filterValue, comparison: r.comparisonSelection ?? null, notApplied: a } : { control: r == null ? void 0 : r.controlValue }
|
|
415
401
|
)
|
|
416
402
|
}
|
|
417
403
|
};
|
|
418
404
|
}
|
|
419
405
|
function ft(e) {
|
|
420
|
-
return
|
|
406
|
+
return Xe(e).context;
|
|
421
407
|
}
|
|
422
|
-
function
|
|
423
|
-
const { place: t, calendar: a } = e,
|
|
424
|
-
...
|
|
408
|
+
function Xe(e) {
|
|
409
|
+
const { place: t, calendar: a } = e, n = $(e.dashboard), r = pe({ dashboard: n, host: {}, calendar: a, materializeInputs: !1 }), s = {
|
|
410
|
+
...w({ dashboard: n, capture: {}, calendar: a }).runtimeValues,
|
|
425
411
|
cardViewState: t.cardViewState ?? {}
|
|
426
|
-
}, l = t.cardId ?
|
|
427
|
-
dashboard:
|
|
412
|
+
}, l = t.cardId ? et(n, t.cardId) : void 0, m = l ? J({
|
|
413
|
+
dashboard: n,
|
|
428
414
|
location: l,
|
|
429
415
|
runtimeValues: s,
|
|
430
416
|
semanticExecutionPayload: e.semanticExecutionPayload,
|
|
@@ -432,9 +418,9 @@ function Ye(e) {
|
|
|
432
418
|
withRequest: !0
|
|
433
419
|
}) : void 0, o = Ze({
|
|
434
420
|
surface: "dashboard",
|
|
435
|
-
dashboard:
|
|
421
|
+
dashboard: n,
|
|
436
422
|
// A sheet that does not hold the card is refused by the projection.
|
|
437
|
-
sheetId: t.sheetId ?? (l == null ? void 0 : l.sheetId) ??
|
|
423
|
+
sheetId: t.sheetId ?? (l == null ? void 0 : l.sheetId) ?? r.selectedSheetId,
|
|
438
424
|
unsavedEdits: !1,
|
|
439
425
|
runtimeValues: s,
|
|
440
426
|
transientContexts: void 0,
|
|
@@ -443,12 +429,12 @@ function Ye(e) {
|
|
|
443
429
|
});
|
|
444
430
|
return {
|
|
445
431
|
context: o,
|
|
446
|
-
openDashboard:
|
|
447
|
-
...o.selectedCard && m !== void 0 ? { cardReplay:
|
|
432
|
+
openDashboard: n,
|
|
433
|
+
...o.selectedCard && m !== void 0 ? { cardReplay: Ye({ dashboard: n, cardId: o.selectedCard.id, snapshot: m }) } : {}
|
|
448
434
|
};
|
|
449
435
|
}
|
|
450
|
-
function
|
|
451
|
-
const t = e.dashboard ? S(e.dashboard).find((
|
|
436
|
+
function Ye(e) {
|
|
437
|
+
const t = e.dashboard ? S(e.dashboard).find((n) => n.cardId === e.cardId) : void 0, a = _({
|
|
452
438
|
card: e.card ?? (t == null ? void 0 : t.card),
|
|
453
439
|
snapshot: e.snapshot,
|
|
454
440
|
documentSection: (t == null ? void 0 : t.kind) === "documentSectionCard"
|
|
@@ -461,34 +447,34 @@ function et(e) {
|
|
|
461
447
|
}
|
|
462
448
|
};
|
|
463
449
|
}
|
|
464
|
-
function
|
|
465
|
-
const a = S(e).find((
|
|
450
|
+
function et(e, t) {
|
|
451
|
+
const a = S(e).find((n) => n.cardId === t);
|
|
466
452
|
if (!a)
|
|
467
453
|
throw new V("card_not_found", `card ${t} is not on dashboard ${e.id}`);
|
|
468
454
|
return a;
|
|
469
455
|
}
|
|
470
|
-
function
|
|
471
|
-
const { dashboard: t, location: a, runtimeValues:
|
|
456
|
+
function J(e) {
|
|
457
|
+
const { dashboard: t, location: a, runtimeValues: n } = e, r = a.kind === "documentSectionCard" ? tt(t, a) : void 0;
|
|
472
458
|
return O({
|
|
473
459
|
dashboard: t,
|
|
474
460
|
cardId: a.cardId,
|
|
475
461
|
cardOverride: a.card,
|
|
476
462
|
sheetId: a.sheetId,
|
|
477
463
|
transientContexts: e.transientContexts,
|
|
478
|
-
cardViewStates:
|
|
464
|
+
cardViewStates: n.cardViewState,
|
|
479
465
|
viewerTableSettings: void 0,
|
|
480
|
-
adHocFilterValues:
|
|
481
|
-
inlineFilterValuesMap:
|
|
482
|
-
dashboardControlValues:
|
|
483
|
-
cardControlValuesMap:
|
|
484
|
-
dashboardInputValues:
|
|
466
|
+
adHocFilterValues: n.adHocFilterValues,
|
|
467
|
+
inlineFilterValuesMap: n.inlineFilterValuesMap,
|
|
468
|
+
dashboardControlValues: n.controlValues,
|
|
469
|
+
cardControlValuesMap: n.cardControlValuesMap,
|
|
470
|
+
dashboardInputValues: n.dashboardInputValues,
|
|
485
471
|
semanticExecutionPayload: e.semanticExecutionPayload,
|
|
486
472
|
calendar: e.calendar,
|
|
487
|
-
...
|
|
473
|
+
...r ? { documentSection: r } : {},
|
|
488
474
|
...e.withRequest ? { withRequest: !0 } : {}
|
|
489
475
|
});
|
|
490
476
|
}
|
|
491
|
-
function
|
|
477
|
+
function _(e) {
|
|
492
478
|
var a;
|
|
493
479
|
const { snapshot: t } = e;
|
|
494
480
|
if (e.documentSection) return { status: "unavailable", reason: "document_section" };
|
|
@@ -503,28 +489,28 @@ function D(e) {
|
|
|
503
489
|
if (t.matrix) return { status: "unavailable", reason: "matrix" };
|
|
504
490
|
if (!t.request) return { status: "unavailable", reason: "no_query" };
|
|
505
491
|
try {
|
|
506
|
-
const { connectionId:
|
|
507
|
-
return { status: "ready", request: { cardId: t.card.id, connectionId:
|
|
492
|
+
const { connectionId: n, requestPayloadBase: r } = me(t.card, t.request);
|
|
493
|
+
return { status: "ready", request: { cardId: t.card.id, connectionId: n, payload: r } };
|
|
508
494
|
} catch {
|
|
509
495
|
return { status: "unavailable", reason: "no_query" };
|
|
510
496
|
}
|
|
511
497
|
}
|
|
512
498
|
function ht(e) {
|
|
513
|
-
const { calendar: t } = e, a = e.host ?? {},
|
|
514
|
-
a.controlContract ? he(
|
|
499
|
+
const { calendar: t } = e, a = e.host ?? {}, n = $(
|
|
500
|
+
a.controlContract ? fe(he(e.dashboard), {
|
|
515
501
|
controlContractOverrides: a.controlContract,
|
|
516
502
|
cardId: e.cardId
|
|
517
503
|
}) : e.dashboard
|
|
518
|
-
),
|
|
519
|
-
if (!
|
|
520
|
-
if (
|
|
521
|
-
const { runtimeValues: s, transientContexts: l } =
|
|
522
|
-
dashboard:
|
|
504
|
+
), r = S(n).find((c) => c.cardId === e.cardId);
|
|
505
|
+
if (!r) return { status: "refused", reason: "card_not_found" };
|
|
506
|
+
if (r.kind === "documentSectionCard") return { status: "refused", reason: "document_section" };
|
|
507
|
+
const { runtimeValues: s, transientContexts: l } = w({
|
|
508
|
+
dashboard: n,
|
|
523
509
|
capture: a,
|
|
524
510
|
calendar: t
|
|
525
|
-
}), m =
|
|
526
|
-
dashboard:
|
|
527
|
-
location:
|
|
511
|
+
}), m = J({
|
|
512
|
+
dashboard: n,
|
|
513
|
+
location: r,
|
|
528
514
|
runtimeValues: s,
|
|
529
515
|
semanticExecutionPayload: e.semanticExecutionPayload,
|
|
530
516
|
calendar: t,
|
|
@@ -532,17 +518,17 @@ function ht(e) {
|
|
|
532
518
|
withRequest: !0
|
|
533
519
|
});
|
|
534
520
|
if (!m) return { status: "refused", reason: "card_not_found" };
|
|
535
|
-
const o =
|
|
521
|
+
const o = _({ card: r.card, snapshot: m, documentSection: !1 });
|
|
536
522
|
return o.status === "ready" ? { ...o, renderConfig: m.queryContext.finalConfig } : o.reason === "pending" ? { status: "refused", reason: "blocked" } : {
|
|
537
523
|
status: "refused",
|
|
538
524
|
reason: o.reason,
|
|
539
525
|
...o.message ? { message: o.message } : {}
|
|
540
526
|
};
|
|
541
527
|
}
|
|
542
|
-
function
|
|
543
|
-
var
|
|
544
|
-
const a = (
|
|
545
|
-
if ((s = (
|
|
528
|
+
function tt(e, t) {
|
|
529
|
+
var n, r, s;
|
|
530
|
+
const a = (n = e.sheets) == null ? void 0 : n.find((l) => l.id === t.sheetId);
|
|
531
|
+
if ((s = (r = a == null ? void 0 : a.document) == null ? void 0 : r.inputs) != null && s.length && L(e, t.sheetId).length === 0)
|
|
546
532
|
throw new V(
|
|
547
533
|
"document_inputs_not_built",
|
|
548
534
|
`card ${t.cardId} runs with the document's own inputs on sheet ${t.sheetId}, which only the page builds`
|
|
@@ -556,9 +542,9 @@ function at(e, t) {
|
|
|
556
542
|
};
|
|
557
543
|
}
|
|
558
544
|
function pt(e) {
|
|
559
|
-
const { calendar: t } = e, a =
|
|
560
|
-
if (!
|
|
561
|
-
return { status: "refused", reason: "variable_unknown", message: `No variable named ${e.name} on this dashboard.`, available:
|
|
545
|
+
const { calendar: t } = e, a = $(e.dashboard), n = a.variables ?? [], r = n.find((f) => f.name === e.name) ?? n.find((f) => f.id === e.name);
|
|
546
|
+
if (!r)
|
|
547
|
+
return { status: "refused", reason: "variable_unknown", message: `No variable named ${e.name} on this dashboard.`, available: n.map((f) => f.name) };
|
|
562
548
|
const s = (a.sheets ?? []).find((f) => f.id === e.sheetId);
|
|
563
549
|
if (!s)
|
|
564
550
|
return {
|
|
@@ -567,13 +553,13 @@ function pt(e) {
|
|
|
567
553
|
message: `No sheet ${e.sheetId} on this dashboard; a variable is derived at a tab or a Document.`,
|
|
568
554
|
available: (a.sheets ?? []).map((f) => f.id)
|
|
569
555
|
};
|
|
570
|
-
const l =
|
|
571
|
-
if ((l == null ? void 0 : l.kind) !== "variable") return { status: "refused", reason: "broken", message: `${
|
|
572
|
-
const m =
|
|
556
|
+
const l = K(a, r.id);
|
|
557
|
+
if ((l == null ? void 0 : l.kind) !== "variable") return { status: "refused", reason: "broken", message: `${r.name} has no card to run.` };
|
|
558
|
+
const m = oe(s) && s.document ? s.document : void 0, o = at(a, s.id, !!m, e.inputs ?? {}, t);
|
|
573
559
|
if (!o.ok) return { status: "refused", reason: "broken", message: o.message };
|
|
574
|
-
const { runtimeValues: c, transientContexts: i } =
|
|
560
|
+
const { runtimeValues: c, transientContexts: i } = w({ dashboard: a, capture: o.capture, calendar: t }), u = m ? { sheetId: s.id, sectionId: void 0, documentFilterValues: [], documentControlDefinitions: [], documentControlValues: {} } : void 0, d = O({
|
|
575
561
|
dashboard: a,
|
|
576
|
-
cardId:
|
|
562
|
+
cardId: r.id,
|
|
577
563
|
cardOverride: l.card,
|
|
578
564
|
sheetId: s.id,
|
|
579
565
|
transientContexts: i,
|
|
@@ -590,43 +576,43 @@ function pt(e) {
|
|
|
590
576
|
withRequest: !0
|
|
591
577
|
});
|
|
592
578
|
if ((d == null ? void 0 : d.status) === "blocked")
|
|
593
|
-
return d.reason === "requiredInput" ? { status: "refused", reason: "held", message: `${
|
|
594
|
-
const b =
|
|
595
|
-
return b.status !== "ready" ? { status: "refused", reason: "broken", message: b.message ?? `${
|
|
579
|
+
return d.reason === "requiredInput" ? { status: "refused", reason: "held", message: `${r.name} waits for ${d.missingRequiredLabels.join(", ")}.`, missingRequired: d.missingRequiredLabels } : { status: "refused", reason: "broken", message: d.message ?? `${r.name} can't run until its filter mapping is resolved.` };
|
|
580
|
+
const b = _({ card: l.card, snapshot: d, documentSection: !1 });
|
|
581
|
+
return b.status !== "ready" ? { status: "refused", reason: "broken", message: b.message ?? `${r.name} has no query to run.` } : { status: "ready", variable: r, place: m ? "document" : "sheet", request: b.request };
|
|
596
582
|
}
|
|
597
|
-
function
|
|
598
|
-
const s = Object.keys(
|
|
583
|
+
function at(e, t, a, n, r) {
|
|
584
|
+
const s = Object.keys(n);
|
|
599
585
|
if (!s.length) return { ok: !0, capture: {} };
|
|
600
586
|
if (!a) return { ok: !1, message: "Values are given for a Document's inputs; at a tab the variable runs with the saved defaults." };
|
|
601
|
-
const l =
|
|
587
|
+
const l = L(e, t), m = new Map(l.map((i) => [i.variableName, i])), o = s.filter((i) => !m.has(i));
|
|
602
588
|
if (o.length)
|
|
603
589
|
return { ok: !1, message: `This Document has no input named ${o.join(", ")}; its inputs are ${[...m.keys()].join(", ") || "none"}.` };
|
|
604
|
-
let c =
|
|
605
|
-
for (const [i, u] of Object.entries(
|
|
590
|
+
let c = be(e, { adHocFilterValues: [], controlOverrides: void 0, dashboardInputValues: {} }, r);
|
|
591
|
+
for (const [i, u] of Object.entries(n)) {
|
|
606
592
|
const d = m.get(i);
|
|
607
593
|
let b;
|
|
608
594
|
if (d.kind === "control")
|
|
609
|
-
b =
|
|
595
|
+
b = le(u);
|
|
610
596
|
else {
|
|
611
597
|
const f = Array.isArray(u) ? u : [u];
|
|
612
598
|
if (!f.every((y) => typeof y == "string" || typeof y == "number" || typeof y == "boolean"))
|
|
613
599
|
return { ok: !1, message: `${i} takes a value or a list of values.` };
|
|
614
600
|
const p = f.every((y) => typeof y == "number") ? f : f.map(String);
|
|
615
|
-
b =
|
|
601
|
+
b = ie(ge(d.filter, { filterId: d.filter.id, values: p }, r));
|
|
616
602
|
}
|
|
617
603
|
if (!b) return { ok: !1, message: `${i} has no usable value.` };
|
|
618
|
-
c =
|
|
604
|
+
c = de(c, d, { sheetId: t }, b);
|
|
619
605
|
}
|
|
620
606
|
return { ok: !0, capture: { dashboardInputExecutionSnapshot: { mode: "document", sheetId: t, dashboardInputValues: c } } };
|
|
621
607
|
}
|
|
622
608
|
export {
|
|
623
609
|
V as A,
|
|
624
|
-
|
|
610
|
+
Ye as a,
|
|
625
611
|
ht as b,
|
|
626
612
|
pt as c,
|
|
627
|
-
|
|
613
|
+
_ as d,
|
|
628
614
|
ft as e,
|
|
629
|
-
|
|
630
|
-
|
|
615
|
+
Xe as f,
|
|
616
|
+
J as g,
|
|
631
617
|
Ze as p
|
|
632
618
|
};
|