react-semaphor 0.1.537 → 0.1.539
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 +352 -341
- package/dist/assistant-context/index.js +10 -0
- package/dist/assistant-protocol/index.js +104 -0
- package/dist/brand-studio/index.js +35 -31
- package/dist/briefings/index.js +46 -45
- package/dist/chunks/_commonjsHelpers-BkfeUUK-.js +28 -0
- package/dist/chunks/add-to-dashboard-CxtTfISD.js +56 -0
- package/dist/chunks/aggregate-table-row-presentation-BjK9YfMI.js +979 -0
- package/dist/chunks/analytics-base-schemas-BFAoRlkU.js +472 -0
- package/dist/chunks/apply-dashboard-operations-C-iahGka.js +402 -0
- package/dist/chunks/assistant-chat-DgiSuFT4.js +8083 -0
- package/dist/chunks/availability-Bp5Gfu1I.js +44 -0
- package/dist/chunks/{bookmark-state-B-I9BDD0.js → bookmark-state-k7y5SNGf.js} +9 -9
- package/dist/chunks/{braces-8TRlDwDw.js → braces-o9UiRQes.js} +1 -1
- package/dist/chunks/calculated-field-identity-DcBS2NPP.js +2161 -0
- package/dist/chunks/calendar-day-equality-Bpl15IBo.js +487 -0
- package/dist/chunks/class-utils-Df1OVOT1.js +2315 -0
- package/dist/chunks/{field-dependencies-CpRUwr9J.js → common-types-CUf03Htv.js} +65 -58
- package/dist/chunks/context-HD9usB1P.js +349 -0
- package/dist/chunks/conversation-sQiWYUOb.js +16 -0
- package/dist/chunks/csv-utils-GUfKyT1J.js +56 -0
- package/dist/chunks/custom-visual-inputs-BrUOIwln.js +3288 -0
- package/dist/chunks/{dashboard-briefing-launcher-A2uVpHCp.js → dashboard-briefing-launcher-Bl3gCeBR.js} +580 -556
- package/dist/chunks/{dashboard-controls-DxTuVis_.js → dashboard-controls-0EX0HiJt.js} +683 -686
- package/dist/chunks/{common-types-g7yS12Cg.js → dashboard-filter-value-compatibility-D95O4nd7.js} +18 -24
- package/dist/chunks/dashboard-json-6X_2BDiL.js +69 -0
- package/dist/chunks/{dashboard-BPJo-Fnd.js → dashboard-y5BwcvzT.js} +1 -1
- package/dist/chunks/document-dashboard-inputs-BrYYlRVo.js +10678 -0
- package/dist/chunks/document-sheet-utils-C1eEldxs.js +1076 -0
- package/dist/chunks/{edit-dashboard-visual-ByV0OwSp.js → edit-dashboard-visual-Bzchfgga.js} +4744 -4746
- package/dist/chunks/editor-draft-sync-BN5qYHPF.js +15 -0
- package/dist/chunks/filter-value-text-BhWugPWE.js +163 -0
- package/dist/chunks/index-CqMiAkay.js +3164 -0
- package/dist/chunks/index-CuHybtft.js +51 -0
- package/dist/chunks/layout-grid-Bgzth8vd.js +16 -0
- package/dist/chunks/{matrix-analytical-definition-CgBTD6H8.js → matrix-analytical-definition-bcprSe4u.js} +1 -1
- package/dist/chunks/{matrix-card-CAdizkUl.js → matrix-card-CJn1hB5V.js} +13 -12
- package/dist/chunks/matrix-definition-DQDI2okF.js +206 -0
- package/dist/chunks/{matrix-formatter-DJCk8Znf.js → matrix-formatter-DQ8avoIQ.js} +648 -457
- package/dist/chunks/matrix-member-presentation-BNPSDKBG.js +105 -0
- package/dist/chunks/{matrix-operation-contract-BKupLHXL.js → matrix-operation-contract-B8PBF1Gd.js} +134 -133
- package/dist/chunks/{metric-comparison-BKHyvnAy.js → metric-comparison-CojWeLqx.js} +1 -1
- package/dist/chunks/{palette-Cp1hqZtm.js → palette-D10o_yYX.js} +1 -1
- package/dist/chunks/pivot-header-presentation-MkcKnjn3.js +42 -0
- package/dist/chunks/{pivot-result-identity-Bs4tLtLo.js → pivot-result-identity-D6hhcRXi.js} +1 -1
- package/dist/chunks/pivot-result-lifecycle-8qCDmpKc.js +804 -0
- package/dist/chunks/raw-temporal-D61lr48Y.js +1464 -0
- package/dist/chunks/{raw-temporal-contract-mLFS-9wk.js → raw-temporal-contract-C51YG48G.js} +1 -1
- package/dist/chunks/report-preferences-dialog-CWhSbc5_.js +1808 -0
- package/dist/chunks/{report-runtime-context-CG_I0PPW.js → report-runtime-context-B984Nq1E.js} +8 -7
- package/dist/chunks/save-CfJpQQ68.js +21 -0
- package/dist/chunks/saved-dashboard-context-Dqve2jlB.js +566 -0
- package/dist/chunks/{selection-reducer-CiDEtmAq.js → selection-reducer-vKIb_jS6.js} +2 -2
- package/dist/chunks/{semaphor-ready-indicator-CHu1L-lo.js → semaphor-ready-indicator-ldcwmLoY.js} +65803 -62954
- package/dist/chunks/{shelf-drop-preview-context-i-H6DFyU.js → shelf-drop-preview-context-BWxunXTq.js} +199 -196
- package/dist/chunks/{source-entity-resolution-C-oNyYMp.js → source-entity-resolution-CVA1a85c.js} +8 -8
- package/dist/chunks/switch-CvItuC1Q.js +8199 -0
- package/dist/chunks/{temporal-bucket-DlFuhCnT.js → temporal-bucket-D8JF7zKz.js} +86 -71
- package/dist/chunks/{temporal-bucket-contract-D2OuaVZ7.js → temporal-bucket-contract-DaOajRC7.js} +1 -1
- package/dist/chunks/{token-types-DtSJOUjh.js → token-types-bxUxXDX2.js} +1 -1
- package/dist/chunks/{upload-CAIpsti1.js → upload-BFX7apKV.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-Bj63WwHc.js → use-create-flow-overlay-state-RHgzVfcz.js} +331 -339
- package/dist/chunks/{validators-DMSH81OM.js → validators-Ej1DdCXa.js} +1050 -1510
- package/dist/chunks/visual-choice-JiJ-_3bi.js +204 -0
- package/dist/chunks/x-4f5U2XwU.js +100 -0
- package/dist/chunks/{zoned-wall-clock-1qlWCE20.js → zoned-wall-clock-MulfA26h.js} +2 -2
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +823 -661
- package/dist/data-app-sdk/index.js +32 -30
- package/dist/data-app-sdk-adapters/index.js +23 -22
- package/dist/data-app-sdk-validation/index.js +23 -22
- package/dist/format-utils/index.js +173 -168
- package/dist/index.js +267 -258
- package/dist/layouts/index.js +236 -24
- 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/assistant-context.d.ts +2 -0
- package/dist/types/assistant-protocol.d.ts +2 -0
- package/dist/types/components/assistant/assistant-entry-points.d.ts +18 -0
- package/dist/types/components/assistant/assistant-provider.d.ts +19 -0
- package/dist/types/components/assistant/assistant-store.d.ts +52 -0
- package/dist/types/components/assistant/use-assistant.d.ts +38 -0
- package/dist/types/components/index.d.ts +5 -1
- package/dist/types/components/surfboard/filter/types.d.ts +5 -2
- package/dist/types/index.js +50 -51
- package/dist/types/lib/api/invalidate-token.d.ts +7 -0
- package/dist/types/lib/charts/cartesian-fields.d.ts +64 -0
- package/dist/types/lib/charts/types.d.ts +7 -0
- package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-storage-transition.d.ts +14 -2
- package/dist/types/lib/dashboard-inputs/dashboard-input-target-context.d.ts +5 -6
- package/dist/types/lib/dashboard-inputs/dashboard-input-values.d.ts +8 -3
- package/dist/types/lib/dashboard-inputs/resolve-dashboard-input-context.d.ts +11 -6
- package/dist/types/lib/dashboard-pagination/dashboard-card-pagination.d.ts +7 -0
- package/dist/types/lib/dashboard-viewer/compatibility-input-storage.d.ts +79 -0
- package/dist/types/lib/dashboard-viewer/viewer-state.d.ts +3 -2
- package/dist/types/lib/document/document-table-data-policy.d.ts +15 -0
- package/dist/types/lib/filter-values/filter-mode.d.ts +22 -0
- package/dist/types/lib/hooks/use-calendar-context.d.ts +5 -0
- package/dist/types/lib/hooks/use-filter-option-browse.d.ts +5 -0
- package/dist/types/lib/hooks/use-text-filter.d.ts +9 -0
- package/dist/types/lib/print/print-inputs.d.ts +4 -2
- package/dist/types/lib/query-context/build-card-query-context.d.ts +12 -4
- package/dist/types/lib/query-context/build-dashboard-execution-snapshot.d.ts +93 -0
- package/dist/types/lib/query-context/card-server-request.d.ts +72 -0
- package/dist/types/lib/query-context/compile-dashboard-card-filters.d.ts +7 -0
- package/dist/types/lib/query-context/describe-card-execution-snapshot.d.ts +56 -0
- package/dist/types/lib/query-context/document-section-card-query.d.ts +45 -0
- package/dist/types/lib/query-context/resolve-runtime-card-filters.d.ts +17 -2
- package/dist/types/lib/stores/dashboard-store.d.ts +34 -11
- package/dist/types/lib/stores/editor-store.d.ts +4 -2
- package/dist/types/lib/types/token-types.d.ts +11 -0
- package/dist/types/lib/utils/card-type-change.d.ts +30 -0
- package/dist/types/lib/utils/comparison-window-caption.d.ts +12 -0
- package/dist/types/lib/utils/filter-default-value-utils.d.ts +13 -2
- package/dist/types/shared/analytics-protocol/applied-constraints.d.ts +74 -0
- package/dist/types/shared/analytics-protocol/contracts.d.ts +3 -0
- package/dist/types/shared/analytics-protocol/filter-field-ownership.d.ts +43 -0
- package/dist/types/shared/analytics-protocol/index.d.ts +3 -0
- package/dist/types/shared/analytics-protocol/matrix-window-contract.d.ts +1 -1
- package/dist/types/shared/analytics-protocol/visual-choice.d.ts +75 -0
- package/dist/types/shared/assistant-context/index.d.ts +9 -0
- package/dist/types/shared/assistant-context/project-context.d.ts +55 -0
- package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +130 -0
- package/dist/types/shared/assistant-protocol/add-to-dashboard.d.ts +17 -0
- package/dist/types/shared/assistant-protocol/artifact.d.ts +63 -0
- package/dist/types/shared/assistant-protocol/availability.d.ts +39 -0
- package/dist/types/shared/assistant-protocol/context.d.ts +952 -0
- package/dist/types/shared/assistant-protocol/conversation.d.ts +38 -0
- package/dist/types/shared/assistant-protocol/index.d.ts +16 -0
- package/dist/types/shared/assistant-protocol/limits.d.ts +53 -0
- package/dist/types/shared/assistant-protocol/parts.d.ts +140 -0
- package/dist/types/shared/assistant-protocol/request.d.ts +77 -0
- package/dist/types/shared/assistant-protocol/sources.d.ts +27 -0
- package/dist/types/shared/assistant-protocol/token-config.d.ts +32 -0
- package/dist/types/shared/assistant-protocol/transcript.d.ts +40 -0
- package/dist/types/shared/dashboard-authoring/card-query-request.d.ts +112 -0
- package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +1794 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +5 -0
- package/dist/types/shared/dashboard-authoring/new-card.d.ts +10 -0
- package/dist/types/shared/dashboard-authoring/operations/apply-dashboard-operations.d.ts +40 -0
- package/dist/types/shared/dashboard-authoring/resolved-primary-date-field-validation.d.ts +16 -0
- package/dist/types/shared/format-utils/filter-detail.d.ts +70 -0
- package/dist/types/shared/format-utils/filter-value-text.d.ts +15 -0
- package/dist/types/shared/format-utils/index.d.ts +3 -0
- package/dist/types/shared/format-utils/raw-temporal.d.ts +7 -0
- package/dist/types/shared/format-utils/temporal-bucket.d.ts +7 -0
- package/dist/types/shared/layouts/frame-layouts.d.ts +23 -0
- package/dist/types/shared/layouts/index.d.ts +1 -0
- package/package.json +12 -2
- package/dist/chunks/calculated-field-identity-BptYhyOP.js +0 -1326
- package/dist/chunks/calendar-day-equality-BRjN1S9h.js +0 -383
- package/dist/chunks/card-config-utils-BOM1dxCk.js +0 -1150
- package/dist/chunks/constants-DNWVy8Y3.js +0 -9
- package/dist/chunks/dashboard-json-B1dEQu98.js +0 -65
- package/dist/chunks/field-aggregations-CoLzYHeL.js +0 -1229
- package/dist/chunks/index-DTcTAGGM.js +0 -4101
- package/dist/chunks/matrix-continuation-C4sRcjZU.js +0 -72
- package/dist/chunks/matrix-control-sources-DTqcA2_L.js +0 -636
- package/dist/chunks/matrix-definition-D9iShKZI.js +0 -87
- package/dist/chunks/matrix-member-presentation-Ct8GuxHt.js +0 -209
- package/dist/chunks/numeric-presentation-CWu3gunq.js +0 -537
- package/dist/chunks/pivot-header-presentation-CHs2GFrM.js +0 -753
- package/dist/chunks/pivot-result-lifecycle-DQz_gjGu.js +0 -789
- package/dist/chunks/raw-temporal-iMXRK-Qz.js +0 -930
- package/dist/chunks/report-preferences-dialog-DXPjteCU.js +0 -1623
- package/dist/chunks/save-kO6cIaob.js +0 -34
- package/dist/chunks/semantic-format-DiqYeKwU.js +0 -192
- package/dist/chunks/switch-DO8a0EfJ.js +0 -25004
- package/dist/chunks/temporal-input-presentation-BD7YNUzu.js +0 -195
- package/dist/chunks/x-CXDkqdur.js +0 -149
- package/dist/types/lib/class-utils.d.ts +0 -2
- package/dist/types/lib/document/document-input-runtime.d.ts +0 -26
- package/dist/types/lib/utils.d.ts +0 -51
|
@@ -0,0 +1,402 @@
|
|
|
1
|
+
import { e as b, t as R } from "./document-sheet-utils-C1eEldxs.js";
|
|
2
|
+
import { f as C, e as w } from "./validators-Ej1DdCXa.js";
|
|
3
|
+
import { duplicateLayoutItem as E, addToLayout as _ } from "../layouts/index.js";
|
|
4
|
+
const M = (e, t) => {
|
|
5
|
+
const r = {};
|
|
6
|
+
if (e === null || t === null)
|
|
7
|
+
return t;
|
|
8
|
+
const s = /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)]);
|
|
9
|
+
for (const a of s) {
|
|
10
|
+
if (!(a in e) && a in t) {
|
|
11
|
+
r[a] = t[a];
|
|
12
|
+
continue;
|
|
13
|
+
}
|
|
14
|
+
if (a in e && !(a in t)) {
|
|
15
|
+
r[a] = void 0;
|
|
16
|
+
continue;
|
|
17
|
+
}
|
|
18
|
+
const n = e[a], o = t[a];
|
|
19
|
+
if (!g(n, o))
|
|
20
|
+
if (Array.isArray(n) && Array.isArray(o))
|
|
21
|
+
r[a] = o;
|
|
22
|
+
else if (A(n) && A(o)) {
|
|
23
|
+
const d = M(n, o);
|
|
24
|
+
Object.keys(d).length > 0 && (r[a] = d);
|
|
25
|
+
} else
|
|
26
|
+
r[a] = o;
|
|
27
|
+
}
|
|
28
|
+
return r;
|
|
29
|
+
}, g = (e, t) => {
|
|
30
|
+
if (e === t) return !0;
|
|
31
|
+
if (e && t && typeof e == "object" && typeof t == "object") {
|
|
32
|
+
if (Array.isArray(e) && Array.isArray(t))
|
|
33
|
+
return e.length !== t.length ? !1 : e.every((a, n) => g(a, t[n]));
|
|
34
|
+
const r = Object.keys(e), s = Object.keys(t);
|
|
35
|
+
return r.length !== s.length ? !1 : r.every((a) => g(e[a], t[a]));
|
|
36
|
+
}
|
|
37
|
+
return !1;
|
|
38
|
+
}, A = (e) => e !== null && typeof e == "object" && !Array.isArray(e), m = (e) => {
|
|
39
|
+
if (e === null || typeof e != "object")
|
|
40
|
+
return e;
|
|
41
|
+
if (e instanceof Date)
|
|
42
|
+
return new Date(e);
|
|
43
|
+
if (e instanceof RegExp)
|
|
44
|
+
return new RegExp(e);
|
|
45
|
+
if (Array.isArray(e))
|
|
46
|
+
return e.map((r) => m(r));
|
|
47
|
+
const t = {};
|
|
48
|
+
for (const r in e)
|
|
49
|
+
Object.prototype.hasOwnProperty.call(e, r) && (t[r] = m(e[r]));
|
|
50
|
+
return t;
|
|
51
|
+
}, I = { kind: "allSheets" }, u = (e, t) => (t == null ? void 0 : t[e]) ?? e;
|
|
52
|
+
function k(e, t) {
|
|
53
|
+
switch (e.kind) {
|
|
54
|
+
case "cards":
|
|
55
|
+
return {
|
|
56
|
+
kind: "cards",
|
|
57
|
+
cardIds: e.cardIds.map((r) => u(r, t.cardIds))
|
|
58
|
+
};
|
|
59
|
+
case "sheets":
|
|
60
|
+
return {
|
|
61
|
+
kind: "sheets",
|
|
62
|
+
sheetIds: e.sheetIds.map((r) => u(r, t.sheetIds))
|
|
63
|
+
};
|
|
64
|
+
case "documentSections":
|
|
65
|
+
return {
|
|
66
|
+
...e,
|
|
67
|
+
sheetId: u(e.sheetId, t.sheetIds),
|
|
68
|
+
sectionIds: e.sectionIds.map((r) => u(r, t.sectionIds))
|
|
69
|
+
};
|
|
70
|
+
default:
|
|
71
|
+
return e;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
function x(e, t) {
|
|
75
|
+
return {
|
|
76
|
+
...e,
|
|
77
|
+
targets: k(e.targets, t),
|
|
78
|
+
cardMappings: e.cardMappings.map((r) => ({
|
|
79
|
+
...r,
|
|
80
|
+
cardId: u(r.cardId, t.cardIds)
|
|
81
|
+
}))
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
function z(e, t) {
|
|
85
|
+
return {
|
|
86
|
+
...e.targets !== void 0 ? { targets: e.targets && k(e.targets, t) } : {},
|
|
87
|
+
...e.cardMappings !== void 0 ? {
|
|
88
|
+
cardMappings: e.cardMappings && e.cardMappings.map((r) => ({
|
|
89
|
+
...r,
|
|
90
|
+
cardId: u(r.cardId, t.cardIds)
|
|
91
|
+
}))
|
|
92
|
+
} : {}
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
function V(e, t) {
|
|
96
|
+
return t ? {
|
|
97
|
+
...e,
|
|
98
|
+
targets: t.targets === void 0 ? e.targets : t.targets ?? I,
|
|
99
|
+
cardMappings: t.cardMappings === void 0 ? e.cardMappings : t.cardMappings ?? []
|
|
100
|
+
} : e;
|
|
101
|
+
}
|
|
102
|
+
const f = (e, t) => JSON.stringify(e) === JSON.stringify(t);
|
|
103
|
+
function X(e, t) {
|
|
104
|
+
const r = {};
|
|
105
|
+
return f(e.targets, t.targets) || (r.targets = f(e.targets, I) ? null : e.targets), f(e.cardMappings, t.cardMappings) || (r.cardMappings = e.cardMappings.length ? e.cardMappings : null), Object.keys(r).length ? r : void 0;
|
|
106
|
+
}
|
|
107
|
+
function Q(e, t) {
|
|
108
|
+
return {
|
|
109
|
+
...e,
|
|
110
|
+
targets: (t == null ? void 0 : t.targets) ?? I,
|
|
111
|
+
cardMappings: (t == null ? void 0 : t.cardMappings) ?? []
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
function Z(e) {
|
|
115
|
+
const t = Object.values(e.linkedInteractionTargetOverrides ?? {});
|
|
116
|
+
if (!t.length) return;
|
|
117
|
+
const r = {};
|
|
118
|
+
if (t.some(
|
|
119
|
+
(n) => n.applyToCardIds !== void 0
|
|
120
|
+
)) {
|
|
121
|
+
const n = t.flatMap(
|
|
122
|
+
(o) => Array.isArray(o.applyToCardIds) ? [o.applyToCardIds] : []
|
|
123
|
+
);
|
|
124
|
+
r.targets = n.length === t.length ? { kind: "cards", cardIds: [...new Set(n.flat())] } : null;
|
|
125
|
+
}
|
|
126
|
+
const a = t.filter((n) => !Array.isArray(n.applyToCardIds));
|
|
127
|
+
if (a.some((n) => n.excludeCardIds !== void 0)) {
|
|
128
|
+
const n = [
|
|
129
|
+
...new Set(a.flatMap((o) => o.excludeCardIds ?? []))
|
|
130
|
+
].filter(
|
|
131
|
+
(o) => a.every((d) => {
|
|
132
|
+
var i;
|
|
133
|
+
return (i = d.excludeCardIds) == null ? void 0 : i.includes(o);
|
|
134
|
+
})
|
|
135
|
+
);
|
|
136
|
+
r.cardMappings = n.length ? n.map(
|
|
137
|
+
(o) => ({ kind: "excluded", cardId: o })
|
|
138
|
+
) : null;
|
|
139
|
+
}
|
|
140
|
+
return Object.keys(r).length ? r : void 0;
|
|
141
|
+
}
|
|
142
|
+
function D(e, t) {
|
|
143
|
+
var a;
|
|
144
|
+
const r = (a = e.controlBindings) == null ? void 0 : a.map((n) => ({
|
|
145
|
+
...n,
|
|
146
|
+
controlId: t.get(n.controlId) ?? n.controlId
|
|
147
|
+
})), s = b(e).flatMap(
|
|
148
|
+
({ paramId: n, controlId: o }) => {
|
|
149
|
+
var i;
|
|
150
|
+
const d = t.get(o);
|
|
151
|
+
return !d || d === o || (i = e.controlBindings) != null && i.some(
|
|
152
|
+
(c) => c.target === "sql_param" && c.paramId === n
|
|
153
|
+
) ? [] : [{ target: "sql_param", paramId: n, controlId: d }];
|
|
154
|
+
}
|
|
155
|
+
);
|
|
156
|
+
return s.length ? [...r ?? [], ...s] : r;
|
|
157
|
+
}
|
|
158
|
+
function T(e, t) {
|
|
159
|
+
var a, n;
|
|
160
|
+
const r = e.source === "dashboardInputAlias" ? ((a = t.inputAliases) == null ? void 0 : a[e.variableName]) ?? e : e, s = e.source === "dashboardInputAlias" && r !== e ? { ...r, export: e.export ?? "label" } : r;
|
|
161
|
+
return s.source === "dashboardInput" ? {
|
|
162
|
+
...s,
|
|
163
|
+
inputId: ((n = t.inputIds) == null ? void 0 : n[s.inputId]) ?? s.inputId
|
|
164
|
+
} : s;
|
|
165
|
+
}
|
|
166
|
+
function q(e, t) {
|
|
167
|
+
var a;
|
|
168
|
+
const r = {};
|
|
169
|
+
for (const n of [
|
|
170
|
+
"cardIds",
|
|
171
|
+
"sheetIds",
|
|
172
|
+
"inputIds",
|
|
173
|
+
"controlIds",
|
|
174
|
+
"filterIds"
|
|
175
|
+
]) {
|
|
176
|
+
const o = { ...t[n] };
|
|
177
|
+
for (const [d, i] of Object.entries((e == null ? void 0 : e[n]) ?? {}))
|
|
178
|
+
o[d] = ((a = t[n]) == null ? void 0 : a[i]) ?? i;
|
|
179
|
+
Object.keys(o).length && (r[n] = o);
|
|
180
|
+
}
|
|
181
|
+
const s = { ...t.inputAliases };
|
|
182
|
+
for (const [n, o] of Object.entries((e == null ? void 0 : e.inputAliases) ?? {}))
|
|
183
|
+
s[n] = T(o, t);
|
|
184
|
+
return Object.keys(s).length && (r.inputAliases = s), r;
|
|
185
|
+
}
|
|
186
|
+
function v(e, t) {
|
|
187
|
+
var a, n, o, d;
|
|
188
|
+
const r = m(e);
|
|
189
|
+
r.controlBindings = D(
|
|
190
|
+
e,
|
|
191
|
+
new Map(Object.entries(t.controlIds ?? {}))
|
|
192
|
+
);
|
|
193
|
+
for (const i of r.controls ?? [])
|
|
194
|
+
i.id = ((a = t.controlIds) == null ? void 0 : a[i.id]) ?? i.id;
|
|
195
|
+
for (const i of r.inlineFilters ?? [])
|
|
196
|
+
i.id = ((n = t.filterIds) == null ? void 0 : n[i.id]) ?? i.id;
|
|
197
|
+
const s = (i) => {
|
|
198
|
+
var h, y, O;
|
|
199
|
+
if (!i || typeof i != "object") return;
|
|
200
|
+
if (Array.isArray(i)) {
|
|
201
|
+
i.forEach(s);
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
const c = i;
|
|
205
|
+
if (c.type === "variable" && c.ref && typeof c.ref == "object") {
|
|
206
|
+
const l = c.ref;
|
|
207
|
+
c.ref = l.source === "input" ? { ...l, inputId: ((h = t.inputIds) == null ? void 0 : h[l.inputId]) ?? l.inputId } : T(l, t);
|
|
208
|
+
}
|
|
209
|
+
if (typeof c.entityId == "string") {
|
|
210
|
+
const l = c.entityId;
|
|
211
|
+
c.fieldScope === "card" && (c.entityId = ((y = t.cardIds) == null ? void 0 : y[l]) ?? l), c.fieldScope === "sheet" && (c.entityId = ((O = t.sheetIds) == null ? void 0 : O[l]) ?? l);
|
|
212
|
+
}
|
|
213
|
+
for (const [l, F] of Object.entries(c))
|
|
214
|
+
l !== "linkedReferenceOverrides" && s(F);
|
|
215
|
+
};
|
|
216
|
+
s(r), r.clickToFilter && (r.clickToFilter = x(r.clickToFilter, t));
|
|
217
|
+
for (const i of Object.values(
|
|
218
|
+
((o = r.customCardPreferences) == null ? void 0 : o.dataInputCardIds) ?? {}
|
|
219
|
+
))
|
|
220
|
+
i.cardId = ((d = t.cardIds) == null ? void 0 : d[i.cardId]) ?? i.cardId;
|
|
221
|
+
return r;
|
|
222
|
+
}
|
|
223
|
+
const ee = [
|
|
224
|
+
"lg",
|
|
225
|
+
"md",
|
|
226
|
+
"sm",
|
|
227
|
+
"xs",
|
|
228
|
+
"xxs"
|
|
229
|
+
], te = 15, j = /\{\{-?\s*filters\s*\|\s*where\s*-?\}\}/i, N = /\{\{-?\s*filters\s*\|\s*and\s*-?\}\}/i, P = /\bwhere\b/i;
|
|
230
|
+
function S(e) {
|
|
231
|
+
return e != null && e.trim() ? j.test(e) || N.test(e) : !1;
|
|
232
|
+
}
|
|
233
|
+
function re(e) {
|
|
234
|
+
return !(e != null && e.trim()) || S(e) ? null : P.test(e) ? {
|
|
235
|
+
helper: "{{ filters | and }}",
|
|
236
|
+
description: "For queries with an existing WHERE clause."
|
|
237
|
+
} : {
|
|
238
|
+
helper: "{{ filters | where }}",
|
|
239
|
+
description: "For queries without a WHERE clause."
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
function L(e, t, r) {
|
|
243
|
+
if (C(
|
|
244
|
+
w(t),
|
|
245
|
+
e.aggregateOrigin
|
|
246
|
+
))
|
|
247
|
+
return { aggregate: void 0, aggregateOrigin: void 0 };
|
|
248
|
+
const s = r === "selection" && e.role === "metric" ? t.aggregate : void 0;
|
|
249
|
+
return {
|
|
250
|
+
aggregate: e.aggregate ?? s,
|
|
251
|
+
aggregateOrigin: e.aggregate ? e.aggregateOrigin : s ? t.aggregateOrigin : void 0
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
function B(e, t, r) {
|
|
255
|
+
var s, a, n, o, d, i;
|
|
256
|
+
if (r === "domain")
|
|
257
|
+
return {
|
|
258
|
+
filters: (s = t.parameters) == null ? void 0 : s.filters,
|
|
259
|
+
windowTransform: (a = e.parameters) == null ? void 0 : a.windowTransform
|
|
260
|
+
};
|
|
261
|
+
if (!(!e.parameters && !t.parameters))
|
|
262
|
+
return {
|
|
263
|
+
filters: ((n = e.parameters) == null ? void 0 : n.filters) ?? ((o = t.parameters) == null ? void 0 : o.filters),
|
|
264
|
+
windowTransform: ((d = e.parameters) == null ? void 0 : d.windowTransform) ?? ((i = t.parameters) == null ? void 0 : i.windowTransform)
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
function ne(e, t, r) {
|
|
268
|
+
const s = e;
|
|
269
|
+
return {
|
|
270
|
+
id: e.id,
|
|
271
|
+
role: e.role,
|
|
272
|
+
// Result-column names belong to the selection's consumer (for example,
|
|
273
|
+
// range bounds). They do not identify or redefine the catalog calculation.
|
|
274
|
+
...r === "selection" && e.alias ? { alias: e.alias } : {},
|
|
275
|
+
granularity: e.granularity ?? t.granularity,
|
|
276
|
+
dateFormat: e.dateFormat,
|
|
277
|
+
customFormat: e.customFormat,
|
|
278
|
+
semanticTemporalPresentation: t.semanticTemporalPresentation || e.semanticTemporalPresentation,
|
|
279
|
+
...L(e, t, r),
|
|
280
|
+
...e.role === "metric" ? {
|
|
281
|
+
aliasTemplate: s.aliasTemplate,
|
|
282
|
+
valueAliases: s.valueAliases,
|
|
283
|
+
comparison: s.comparison,
|
|
284
|
+
comparisonPolarity: s.comparisonPolarity,
|
|
285
|
+
parameters: B(
|
|
286
|
+
s,
|
|
287
|
+
t,
|
|
288
|
+
"domain"
|
|
289
|
+
)
|
|
290
|
+
} : {},
|
|
291
|
+
...H(e)
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
function H(e) {
|
|
295
|
+
const t = {
|
|
296
|
+
...e.labelOrigin === "override" ? { label: e.label, labelOrigin: e.labelOrigin } : {},
|
|
297
|
+
...e.formatOrigin === "override" ? { format: e.format, formatOrigin: e.formatOrigin } : {}
|
|
298
|
+
};
|
|
299
|
+
switch (e.role) {
|
|
300
|
+
case "pivotby":
|
|
301
|
+
return {
|
|
302
|
+
...t,
|
|
303
|
+
memberOrder: e.memberOrder
|
|
304
|
+
};
|
|
305
|
+
case "sortby":
|
|
306
|
+
return {
|
|
307
|
+
...t,
|
|
308
|
+
direction: e.direction
|
|
309
|
+
};
|
|
310
|
+
case "detail":
|
|
311
|
+
return {
|
|
312
|
+
...t,
|
|
313
|
+
...e.dateFormat !== void 0 ? { dateFormat: e.dateFormat } : {},
|
|
314
|
+
...e.customFormat !== void 0 ? { customFormat: e.customFormat } : {}
|
|
315
|
+
};
|
|
316
|
+
default:
|
|
317
|
+
return t;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
const W = "table";
|
|
321
|
+
function ae({ preferences: e, ...t }) {
|
|
322
|
+
return {
|
|
323
|
+
...t,
|
|
324
|
+
type: W,
|
|
325
|
+
preferences: e ?? { onClickFilter: [{ columnIndex: 0, expression: "" }] },
|
|
326
|
+
sql: "",
|
|
327
|
+
data: []
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
function se(e, t) {
|
|
331
|
+
let r = e;
|
|
332
|
+
for (const [s, a] of t.entries()) {
|
|
333
|
+
const n = G(r, a);
|
|
334
|
+
if (!n.ok)
|
|
335
|
+
return { ok: !1, failedAt: { index: s, op: a.op, ...n.failure } };
|
|
336
|
+
r = n.dashboard;
|
|
337
|
+
}
|
|
338
|
+
return { ok: !0, dashboard: r };
|
|
339
|
+
}
|
|
340
|
+
function G(e, t) {
|
|
341
|
+
const r = e.sheets ?? [], s = r.findIndex((i) => i.id === t.sheetId), a = r[s];
|
|
342
|
+
if (!a)
|
|
343
|
+
return p("sheet_not_found", `No sheet ${t.sheetId} on this dashboard.`);
|
|
344
|
+
if (R(a))
|
|
345
|
+
return p("sheet_not_a_grid", "This sheet is a document: add to it through the document.");
|
|
346
|
+
const { frame: n } = t;
|
|
347
|
+
if (r.some((i) => (i.frames ?? []).some((c) => c.id === n.id)))
|
|
348
|
+
return p("frame_id_taken", `A frame with id ${n.id} is already on this dashboard.`);
|
|
349
|
+
const o = t.placement ?? "end", d = {
|
|
350
|
+
...a,
|
|
351
|
+
frames: U(a.frames ?? [], n, o),
|
|
352
|
+
layouts: J(a, n, o)
|
|
353
|
+
};
|
|
354
|
+
return {
|
|
355
|
+
ok: !0,
|
|
356
|
+
dashboard: {
|
|
357
|
+
...e,
|
|
358
|
+
sheets: r.map((i, c) => c === s ? d : i)
|
|
359
|
+
}
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
function U(e, t, r) {
|
|
363
|
+
if (r === "start") return [t, ...e];
|
|
364
|
+
if (r === "end") return [...e, t];
|
|
365
|
+
const s = e.findIndex((a) => a.id === r.beside);
|
|
366
|
+
return s < 0 ? [...e, t] : [...e.slice(0, s + 1), t, ...e.slice(s + 1)];
|
|
367
|
+
}
|
|
368
|
+
function J(e, t, r) {
|
|
369
|
+
return (typeof r == "object" ? E({ sourceId: r.beside, duplicatedId: t.id, layouts: e.layouts }) : void 0) ?? _({
|
|
370
|
+
id: t.id,
|
|
371
|
+
layouts: e.layouts,
|
|
372
|
+
x: 0,
|
|
373
|
+
y: r === "start" ? 0 : 1 / 0,
|
|
374
|
+
frame: t
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
function p(e, t) {
|
|
378
|
+
return { ok: !1, failure: { code: e, message: t } };
|
|
379
|
+
}
|
|
380
|
+
export {
|
|
381
|
+
te as D,
|
|
382
|
+
W as N,
|
|
383
|
+
ee as a,
|
|
384
|
+
q as b,
|
|
385
|
+
m as c,
|
|
386
|
+
v as d,
|
|
387
|
+
z as e,
|
|
388
|
+
V as f,
|
|
389
|
+
re as g,
|
|
390
|
+
S as h,
|
|
391
|
+
X as i,
|
|
392
|
+
L as j,
|
|
393
|
+
B as k,
|
|
394
|
+
ne as l,
|
|
395
|
+
H as m,
|
|
396
|
+
Z as n,
|
|
397
|
+
ae as o,
|
|
398
|
+
se as p,
|
|
399
|
+
M as q,
|
|
400
|
+
x as r,
|
|
401
|
+
Q as s
|
|
402
|
+
};
|