react-semaphor 0.1.544 → 0.1.546
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 +405 -441
- package/dist/assistant-context/index.js +1 -1
- package/dist/assistant-protocol/index.js +100 -76
- package/dist/brand-studio/index.js +5 -5
- package/dist/briefings/index.js +55 -52
- package/dist/chunks/{class-utils-Df1OVOT1.js → _commonjsHelpers-DimLPMtv.js} +124 -98
- package/dist/chunks/{add-to-dashboard-BuAqfA2Y.js → add-to-dashboard-BQRAAnc3.js} +55 -33
- package/dist/chunks/{analytics-base-schemas-BFAoRlkU.js → analytics-base-schemas-BKs3flFS.js} +2 -2
- package/dist/chunks/{assistant-chat-BNLkCDml.js → assistant-chat-BPXhulAx.js} +2792 -2562
- package/dist/chunks/{bookmark-state-CXw7lZ50.js → bookmark-state-C4vetoa0.js} +7 -8
- package/dist/chunks/column-catalog-BYnochWQ.js +3363 -0
- package/dist/chunks/comparison-window-caption-C2xF-eWw.js +1433 -0
- package/dist/chunks/{context-ClREvqCZ.js → context-BerEBuFR.js} +11 -6
- package/dist/chunks/custom-visual-inputs-CkJW9pBS.js +295 -0
- package/dist/chunks/{dashboard-g5a4DKWq.js → dashboard-C3CoKbGY.js} +1 -1
- package/dist/chunks/dashboard-briefing-launcher-Be4h-7My.js +3734 -0
- package/dist/chunks/dashboard-controls-bxPrlSyp.js +2307 -0
- package/dist/chunks/{dashboard-json-7qT9jmfL.js → dashboard-json-BrjxIiRt.js} +6 -6
- package/dist/chunks/document-dashboard-inputs-CRVHpIHp.js +3010 -0
- package/dist/chunks/{edit-dashboard-visual-BfJwnRIZ.js → edit-dashboard-visual-DYYYDjY6.js} +5986 -6063
- package/dist/chunks/{filter-value-text-CYsVYPuD.js → filter-value-text-Ddf55Ku1.js} +8 -8
- package/dist/chunks/global-date-filter-utils-9d6m9-FE.js +11859 -0
- package/dist/chunks/index-CtoK1Lgu.js +586 -0
- package/dist/chunks/{index-DkAyQvC6.js → index-DkQkMKa1.js} +385 -339
- package/dist/chunks/list-filter-DsaTbM3J.js +15 -0
- package/dist/chunks/matrix-analytical-definition-B9vW-osb.js +717 -0
- package/dist/chunks/{matrix-card-DjwWcCo8.js → matrix-card-LiMEipvq.js} +3 -3
- package/dist/chunks/{matrix-formatter-CxJLkztA.js → matrix-formatter-DWEeC0_c.js} +55 -55
- package/dist/chunks/{matrix-member-presentation-CQGdVks6.js → matrix-member-presentation-DqzG-UhQ.js} +1 -1
- package/dist/chunks/{matrix-operation-contract-8OIO4gob.js → matrix-operation-contract-D6vYkZK4.js} +72 -72
- package/dist/chunks/{metric-comparison-DEwi9uc2.js → metric-comparison-zpGw4lD6.js} +2 -2
- package/dist/chunks/normalize-dashboard-for-dirty-check-XKgH3GFX.js +119 -0
- package/dist/chunks/{pivot-header-presentation-DHcx1XGQ.js → pivot-header-presentation-CQnIDtUv.js} +1 -1
- package/dist/chunks/{pivot-result-identity-DJhXXcns.js → pivot-result-identity-C-Q1j1Wb.js} +1 -1
- package/dist/chunks/{pivot-result-lifecycle-DM4CyGKs.js → pivot-result-lifecycle-pwq3b7LC.js} +571 -380
- package/dist/chunks/{raw-temporal-contract-C51YG48G.js → raw-temporal-contract-WuXA8jBP.js} +1 -1
- package/dist/chunks/{raw-temporal-presentation-CLiVi90c.js → raw-temporal-presentation-CBzrDOjM.js} +8 -8
- package/dist/chunks/rendered-file-D8xEuVVx.js +108 -0
- package/dist/chunks/{report-preferences-dialog-Df7VpRVW.js → report-preferences-dialog-4QEZWe5U.js} +637 -610
- package/dist/chunks/{report-runtime-context-Dq8XyODK.js → report-runtime-context-hWiTCzFV.js} +2 -2
- package/dist/chunks/resolve-dashboard-input-context-UpK_LBpL.js +5677 -0
- package/dist/chunks/{saved-dashboard-context-B-mQ--nV.js → saved-dashboard-context-D_I3Lxk0.js} +184 -212
- package/dist/chunks/selection-filter-compiler-BKXmyLrS.js +79 -0
- package/dist/chunks/{selection-reducer-Dj_8xD69.js → selection-reducer-CJzkTZio.js} +15 -15
- package/dist/chunks/{semaphor-ready-indicator-DDAxk8us.js → semaphor-ready-indicator-4zpRHE-X.js} +56832 -59068
- package/dist/chunks/{shelf-drop-preview-context-BSRPwaED.js → shelf-drop-preview-context-Cfw7TRAx.js} +890 -871
- package/dist/chunks/{source-entity-resolution-BYn9giz3.js → source-entity-resolution-BIGRvtbG.js} +13 -13
- package/dist/chunks/{switch-C3jLxlG0.js → switch-CEBOR4n7.js} +47 -48
- package/dist/chunks/{table-export-sheet-CPfGAQ9X.js → table-export-sheet-4X9mAG3V.js} +1 -1
- package/dist/chunks/table-settings-CunhoDUi.js +605 -0
- package/dist/chunks/{temporal-bucket-D7NBrrtL.js → temporal-bucket-CQOSbv9-.js} +26 -26
- package/dist/chunks/{token-types-DBbZVQsm.js → token-types-BMqRmT-C.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-BxzFviM-.js → use-create-flow-overlay-state-DZBZiiD-.js} +83 -83
- package/dist/chunks/{validators-DMHTpf7a.js → validators-C-aOQlTB.js} +713 -658
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +1800 -1135
- package/dist/data-app-sdk/index.js +6 -6
- package/dist/data-app-sdk-adapters/index.js +3 -3
- package/dist/data-app-sdk-validation/index.js +14 -14
- package/dist/format-utils/index.js +198 -187
- package/dist/index.js +359 -325
- package/dist/layouts/index.js +5 -242
- package/dist/report-runtime-context/index.js +2 -2
- package/dist/shared/index.js +4 -5
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/briefings/attachment-outcomes.d.ts +1 -1
- package/dist/types/briefings/attachments.d.ts +33 -6
- package/dist/types/briefings/index.d.ts +6 -5
- package/dist/types/components/index.d.ts +2 -0
- package/dist/types/components/surfboard/arrange-layout-button.d.ts +8 -0
- package/dist/types/components/surfboard/filter/types.d.ts +0 -14
- package/dist/types/components/surfboard/screen-size-preview-button.d.ts +7 -0
- package/dist/types/index.js +6 -6
- package/dist/types/lib/charts/table-chart-types.d.ts +4 -0
- package/dist/types/lib/charts/types.d.ts +2 -2
- package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-authoring.d.ts +68 -82
- package/dist/types/lib/dashboard-inputs/dashboard-input-target-context.d.ts +0 -8
- package/dist/types/lib/dashboard-inputs/dashboard-input-values.d.ts +41 -1
- package/dist/types/lib/dashboard-inputs/filter-settings.d.ts +201 -0
- package/dist/types/lib/dashboard-inputs/prepare-loaded-dashboard.d.ts +15 -0
- package/dist/types/lib/dashboard-inputs/resolve-dashboard-input-context.d.ts +7 -2
- package/dist/types/lib/dashboard-inputs/resolve-selection-input.d.ts +1 -1
- package/dist/types/lib/dashboard-viewer/captured-runtime-values.d.ts +40 -0
- package/dist/types/lib/dashboard-viewer/compatibility-input-storage.d.ts +16 -16
- package/dist/types/lib/dashboard-viewer/viewer-state.d.ts +11 -9
- package/dist/types/lib/download-pdf.d.ts +75 -1
- package/dist/types/lib/hooks/use-date-filter.d.ts +5 -0
- package/dist/types/lib/hooks/use-text-filter.d.ts +5 -0
- package/dist/types/lib/matrix-table/matrix-delivery-policy.d.ts +5 -4
- package/dist/types/lib/matrix-table/matrix-editor.d.ts +52 -0
- package/dist/types/lib/query-context/assemble-card-query.d.ts +158 -0
- package/dist/types/lib/query-context/build-card-query-context.d.ts +3 -3
- package/dist/types/lib/query-context/build-dashboard-card-query-contract.d.ts +15 -6
- package/dist/types/lib/query-context/build-dashboard-execution-snapshot.d.ts +11 -13
- package/dist/types/lib/query-context/compile-dashboard-card-filters.d.ts +22 -12
- package/dist/types/lib/query-context/dashboard-filter-mapping-resolution.d.ts +69 -0
- package/dist/types/lib/stores/dashboard-store.d.ts +159 -56
- package/dist/types/lib/stores/editor-store.d.ts +0 -3
- package/dist/types/lib/types/common-types.d.ts +29 -6
- package/dist/types/lib/types/explorer-types.d.ts +10 -0
- package/dist/types/lib/types/semantic-types.d.ts +84 -0
- package/dist/types/lib/utils/build-saved-editor-card.d.ts +20 -0
- package/dist/types/lib/utils/card-type-change.d.ts +16 -0
- package/dist/types/lib/utils/field-availability-context.d.ts +25 -0
- package/dist/types/lib/utils/field-placement.d.ts +96 -0
- package/dist/types/lib/utils/field-state-calculator.d.ts +161 -0
- package/dist/types/lib/utils/qualified-entity-name.d.ts +2 -0
- package/dist/types/shared/analytics-protocol/field-provenance.d.ts +89 -0
- package/dist/types/shared/analytics-protocol/index.d.ts +2 -0
- package/dist/types/shared/analytics-protocol/query-policies.d.ts +52 -0
- package/dist/types/shared/analytics-protocol/time-window-schema.d.ts +1 -1
- package/dist/types/shared/analytics-protocol/time-window.d.ts +40 -1
- package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +8 -12
- package/dist/types/shared/assistant-protocol/answer-text.d.ts +20 -0
- package/dist/types/shared/assistant-protocol/context.d.ts +21 -21
- package/dist/types/shared/assistant-protocol/index.d.ts +1 -0
- package/dist/types/shared/assistant-protocol/limits.d.ts +6 -1
- package/dist/types/shared/assistant-protocol/parts.d.ts +43 -3
- package/dist/types/shared/assistant-protocol/request.d.ts +14 -2
- package/dist/types/shared/dashboard-authoring/calculated-field-identity.d.ts +3 -0
- package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +487 -0
- package/dist/types/shared/dashboard-authoring/changes/card-types.d.ts +34 -0
- package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +7886 -0
- package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +43 -0
- package/dist/types/shared/dashboard-authoring/changes/read-card-query.d.ts +54 -0
- package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +89 -0
- package/dist/types/shared/dashboard-authoring/column-catalog.d.ts +32 -0
- package/dist/types/shared/dashboard-authoring/contracts.d.ts +0 -55
- package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +16 -6
- package/dist/types/shared/dashboard-authoring/dashboard-card-source-index.d.ts +9 -1
- package/dist/types/shared/dashboard-authoring/dashboard-filter-mapping-contract.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/dashboard-input-scope.d.ts +118 -0
- package/dist/types/shared/dashboard-authoring/filter-applicability.d.ts +75 -0
- package/dist/types/shared/dashboard-authoring/filter-model/ad-hoc-filter-values.d.ts +10 -0
- package/dist/types/shared/dashboard-authoring/filter-model/filter-definitions.d.ts +29 -0
- package/dist/types/shared/dashboard-authoring/filter-model/filter-values.d.ts +58 -0
- package/dist/types/shared/dashboard-authoring/filter-model/index.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/filter-model/prototype-document-inputs.d.ts +15 -0
- package/dist/types/shared/dashboard-authoring/filter-model/read-dashboard-filter-model.d.ts +78 -0
- package/dist/types/shared/dashboard-authoring/filter-model/stored-dashboard.d.ts +18 -0
- package/dist/types/shared/dashboard-authoring/filter-model/toolbar-filter-reach.d.ts +23 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +20 -2
- package/dist/types/shared/dashboard-authoring/operations/apply-dashboard-operations.d.ts +10 -37
- package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +189 -0
- package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +94 -0
- package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +78 -0
- package/dist/types/shared/dashboard-authoring/validators.d.ts +1 -2
- package/dist/types/shared/format-utils/exporters/index.d.ts +2 -0
- package/dist/types/shared/format-utils/exporters/rendered-file.d.ts +106 -0
- package/dist/types/shared/layouts/engine/grid.d.ts +25 -0
- package/dist/types/shared/layouts/engine/index.d.ts +4 -0
- package/dist/types/shared/layouts/engine/sheet-layout.d.ts +7 -0
- package/dist/types/shared/layouts/engine/types.d.ts +125 -0
- package/dist/types/shared/layouts/index.d.ts +1 -2
- package/package.json +2 -2
- package/dist/chunks/_commonjsHelpers-BkfeUUK-.js +0 -28
- package/dist/chunks/apply-dashboard-operations-Bz4n1Lq6.js +0 -2260
- package/dist/chunks/calendar-day-equality-BmJAWduY.js +0 -460
- package/dist/chunks/comparison-window-caption-BTkrN3W4.js +0 -1623
- package/dist/chunks/custom-visual-inputs-DUtpYZOk.js +0 -323
- package/dist/chunks/dashboard-briefing-launcher-DQ_8O_e2.js +0 -3725
- package/dist/chunks/dashboard-controls-8RyBTQUO.js +0 -2315
- package/dist/chunks/dashboard-filter-value-compatibility-CwQ_iSNb.js +0 -108
- package/dist/chunks/document-dashboard-inputs-BC6p-ESg.js +0 -8087
- package/dist/chunks/document-sheet-utils-Duo9uLoH.js +0 -3619
- package/dist/chunks/matrix-analytical-definition-C7Gb0e12.js +0 -117
- package/dist/chunks/normalize-dashboard-for-dirty-check-Bk3VYv_q.js +0 -67
- package/dist/chunks/numeric-presentation-DESvLiu9.js +0 -5227
- package/dist/chunks/sort-target-MT1WK1vX.js +0 -29
- package/dist/chunks/stable-serialize-CfqXeiBP.js +0 -6
- package/dist/chunks/table-settings-CLZocegs.js +0 -501
- package/dist/chunks/use-debounced-dirty-check-BwAbnX_5.js +0 -59
- package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-storage-transition.d.ts +0 -88
- package/dist/types/lib/dashboard-inputs/dashboard-input-scope.d.ts +0 -10
- package/dist/types/shared/dashboard-authoring/change-compiler.d.ts +0 -7
- package/dist/types/shared/dashboard-authoring/layout-compiler.d.ts +0 -2
- package/dist/types/shared/layouts/create-frame-layouts.d.ts +0 -27
- package/dist/types/shared/layouts/frame-layouts.d.ts +0 -23
package/dist/chunks/{saved-dashboard-context-B-mQ--nV.js → saved-dashboard-context-D_I3Lxk0.js}
RENAMED
|
@@ -1,60 +1,56 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var k = (e, t, r) =>
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import "./
|
|
7
|
-
import "./
|
|
8
|
-
import "
|
|
9
|
-
import {
|
|
10
|
-
import { v as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
import { n as be, g as Ce, b as Ie } from "./numeric-presentation-DESvLiu9.js";
|
|
15
|
-
import { i as ye } from "./custom-visual-inputs-DUtpYZOk.js";
|
|
16
|
-
import { s as xe } from "./stable-serialize-CfqXeiBP.js";
|
|
17
|
-
function Ve(e) {
|
|
1
|
+
var Z = Object.defineProperty;
|
|
2
|
+
var G = (e, t, r) => t in e ? Z(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var k = (e, t, r) => G(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
+
import { c as Q, e as M, r as U, l as H, b as K, p as E, a as W } from "./resolve-dashboard-input-context-UpK_LBpL.js";
|
|
5
|
+
import { r as X, a as Y, b as L, c as ee, d as te, g as re } from "./document-dashboard-inputs-CRVHpIHp.js";
|
|
6
|
+
import { w as v } from "./table-settings-CunhoDUi.js";
|
|
7
|
+
import { s as ae, n as ne, g as se, d as oe, a as ie, i as de, b as le } from "./global-date-filter-utils-9d6m9-FE.js";
|
|
8
|
+
import { f as g, A as P, c as ce, d as ue, e as D } from "./context-BerEBuFR.js";
|
|
9
|
+
import { a as me, T as fe, P as pe, o as I, d as O, b as _ } from "./filter-value-text-Ddf55Ku1.js";
|
|
10
|
+
import { v as he, ad as ge } from "./validators-C-aOQlTB.js";
|
|
11
|
+
import { b as be } from "./metric-comparison-zpGw4lD6.js";
|
|
12
|
+
import { i as Ce } from "./custom-visual-inputs-CkJW9pBS.js";
|
|
13
|
+
function Ie(e) {
|
|
18
14
|
const t = e.qualifiedFieldName || e.name;
|
|
19
15
|
return e.label && e.label !== t ? `${e.label} (field ${t})` : t;
|
|
20
16
|
}
|
|
21
|
-
function
|
|
17
|
+
function ye(e, t = {}) {
|
|
22
18
|
if (!e) return [];
|
|
23
|
-
const r =
|
|
24
|
-
return r.length === 0 ? [] : e.logicalOperator === "AND" && !e.negate ? r : [
|
|
19
|
+
const r = R(e, t);
|
|
20
|
+
return r.length === 0 ? [] : e.logicalOperator === "AND" && !e.negate ? r : [j(e, r)];
|
|
25
21
|
}
|
|
26
|
-
function
|
|
22
|
+
function R(e, t) {
|
|
27
23
|
const r = e.groups.flatMap((a) => {
|
|
28
|
-
const n =
|
|
24
|
+
const n = R(a, t);
|
|
29
25
|
if (n.length === 0) return [];
|
|
30
|
-
const s =
|
|
26
|
+
const s = j(a, n);
|
|
31
27
|
return [n.length > 1 && !a.negate ? { ...s, text: `(${s.text})` } : s];
|
|
32
28
|
});
|
|
33
|
-
return [...e.conditions.map((a) =>
|
|
29
|
+
return [...e.conditions.map((a) => xe(a, t)), ...r];
|
|
34
30
|
}
|
|
35
|
-
function
|
|
31
|
+
function j(e, t) {
|
|
36
32
|
const r = t.map((a) => a.text).join(e.logicalOperator === "OR" ? " or " : " and ");
|
|
37
33
|
return {
|
|
38
34
|
text: e.negate ? `not (${r})` : r,
|
|
39
35
|
omittedValues: t.reduce((a, n) => a + n.omittedValues, 0)
|
|
40
36
|
};
|
|
41
37
|
}
|
|
42
|
-
function
|
|
38
|
+
function xe(e, t) {
|
|
43
39
|
const r = Array.isArray(e.value) ? e.value : [e.value];
|
|
44
40
|
return me({
|
|
45
|
-
subject:
|
|
41
|
+
subject: Ie(e.field),
|
|
46
42
|
operator: e.operator,
|
|
47
43
|
values: r,
|
|
48
|
-
reading:
|
|
49
|
-
relative:
|
|
44
|
+
reading: Se(e),
|
|
45
|
+
relative: he(e.relativeMeta),
|
|
50
46
|
latestValue: e.latestValue,
|
|
51
47
|
shownAs: e.label
|
|
52
48
|
}, t);
|
|
53
49
|
}
|
|
54
|
-
function
|
|
55
|
-
return e.temporalBucket ? { kind: "bucket", bucket: e.temporalBucket } :
|
|
50
|
+
function Se(e) {
|
|
51
|
+
return e.temporalBucket ? { kind: "bucket", bucket: e.temporalBucket } : ge(e.field.dataType) ? fe : pe;
|
|
56
52
|
}
|
|
57
|
-
function
|
|
53
|
+
function B(e) {
|
|
58
54
|
if (e.kind === "target") return `a target of ${e.targetValue}`;
|
|
59
55
|
const t = e.kind === "previous_period" ? e.offsetPeriods : e.offsetYears, r = e.kind === "previous_period" ? t && t > 1 ? `the period ${t} periods earlier` : "the previous period" : t && t > 1 ? `the same period ${t} years earlier` : "the same period a year earlier", a = [
|
|
60
56
|
e.alignment === "weekday" ? "aligned by weekday" : void 0,
|
|
@@ -62,18 +58,18 @@ function N(e) {
|
|
|
62
58
|
].filter(Boolean);
|
|
63
59
|
return a.length ? `${r}, ${a.join(", ")}` : r;
|
|
64
60
|
}
|
|
65
|
-
function
|
|
61
|
+
function ve(e) {
|
|
66
62
|
return (e == null ? void 0 : e.kind) === "field_date" ? `the ${JSON.stringify(e.label)} filter` : "the dashboard date";
|
|
67
63
|
}
|
|
68
|
-
function
|
|
69
|
-
const r = t.source === "explicit" ? "set on the measure" : `from the dashboard date comparison on ${
|
|
70
|
-
return `${e} is compared with ${
|
|
64
|
+
function Ve(e, t) {
|
|
65
|
+
const r = t.source === "explicit" ? "set on the measure" : `from the dashboard date comparison on ${ve(t.owner)}`;
|
|
66
|
+
return `${e} is compared with ${B(t.spec)} (${r})`;
|
|
71
67
|
}
|
|
72
68
|
function $(e) {
|
|
73
|
-
const t =
|
|
74
|
-
return `${
|
|
69
|
+
const t = ae(e) ?? "undefined";
|
|
70
|
+
return `${w(t, 2654435769).toString(16)}${w(t, 2246822507).toString(16)}`;
|
|
75
71
|
}
|
|
76
|
-
function
|
|
72
|
+
function w(e, t) {
|
|
77
73
|
let r = 3735928559 ^ t, a = 1103547991 ^ t;
|
|
78
74
|
for (let n = 0; n < e.length; n++) {
|
|
79
75
|
const s = e.charCodeAt(n);
|
|
@@ -82,27 +78,27 @@ function D(e, t) {
|
|
|
82
78
|
return r = Math.imul(r ^ r >>> 16, 2246822507) ^ Math.imul(a ^ a >>> 13, 3266489909), a = Math.imul(a ^ a >>> 16, 2246822507) ^ Math.imul(r ^ r >>> 13, 3266489909), 4294967296 * (2097151 & a) + (r >>> 0);
|
|
83
79
|
}
|
|
84
80
|
const c = P;
|
|
85
|
-
function
|
|
81
|
+
function $e(e, t, r) {
|
|
86
82
|
var q;
|
|
87
|
-
const a = t !== "pending" && (t == null ? void 0 : t.status) === "ready" ? t : void 0, n =
|
|
83
|
+
const a = t !== "pending" && (t == null ? void 0 : t.status) === "ready" ? t : void 0, n = _e(e, t);
|
|
88
84
|
if (n) {
|
|
89
|
-
const y = t !== "pending" && (t == null ? void 0 : t.status) === "blocked" ?
|
|
85
|
+
const y = t !== "pending" && (t == null ? void 0 : t.status) === "blocked" ? qe(t) : void 0, V = y ? g(y, c.textChars) : void 0;
|
|
90
86
|
return {
|
|
91
87
|
// A card that runs but is not described still changes when it runs differently.
|
|
92
|
-
fingerprint: $(a ? F(a, r.calendar) : { reason: n, message:
|
|
93
|
-
description: { status: "not_described", reason: n, ...
|
|
88
|
+
fingerprint: $(a ? F(a, r.calendar) : { reason: n, message: V }),
|
|
89
|
+
description: { status: "not_described", reason: n, ...V ? { message: V } : {} }
|
|
94
90
|
};
|
|
95
91
|
}
|
|
96
|
-
const s = a,
|
|
92
|
+
const s = a, d = s.queryContext, u = De(s), o = Ae(s, r), f = Me(s), i = we(s), l = d.drillSteps.map((y) => g(
|
|
97
93
|
`${JSON.stringify(y.label)} (then by ${y.toField.label || y.toField.name})`,
|
|
98
94
|
c.textChars
|
|
99
|
-
)),
|
|
95
|
+
)), m = (q = s.card.sql) == null ? void 0 : q.trim(), h = m ? Ee(s) : [], b = {
|
|
100
96
|
fields: I(u.length, c.cardFields),
|
|
101
97
|
filters: I(o.length, c.cardFilters),
|
|
102
|
-
controls: I(
|
|
98
|
+
controls: I(f.length, c.cardControls),
|
|
103
99
|
drillSteps: I(l.length, c.drillSteps),
|
|
104
100
|
sqlParameters: I(h.length, c.sqlParameters),
|
|
105
|
-
comparisons: I(
|
|
101
|
+
comparisons: I(i.length, c.cardFields)
|
|
106
102
|
}, p = Object.fromEntries(Object.entries(b).filter(([, y]) => y > 0));
|
|
107
103
|
return {
|
|
108
104
|
fingerprint: $(F(s, r.calendar)),
|
|
@@ -110,88 +106,88 @@ function ke(e, t, r) {
|
|
|
110
106
|
status: "described",
|
|
111
107
|
fields: u.slice(0, c.cardFields),
|
|
112
108
|
filters: o.slice(0, c.cardFilters),
|
|
113
|
-
controls:
|
|
109
|
+
controls: f.slice(0, c.cardControls),
|
|
114
110
|
drillPath: l.slice(0, c.drillSteps),
|
|
115
|
-
...
|
|
111
|
+
...m ? {
|
|
116
112
|
sql: {
|
|
117
|
-
text: g(
|
|
113
|
+
text: g(m, c.sqlChars),
|
|
118
114
|
parameters: h.slice(0, c.sqlParameters)
|
|
119
115
|
}
|
|
120
116
|
} : {},
|
|
121
|
-
...
|
|
117
|
+
...i.length ? { comparisons: i.slice(0, c.cardFields) } : {},
|
|
122
118
|
...Object.keys(p).length ? { omitted: p } : {}
|
|
123
119
|
}
|
|
124
120
|
};
|
|
125
121
|
}
|
|
126
|
-
function
|
|
122
|
+
function _e(e, t) {
|
|
127
123
|
if (e.type === "matrixTable") return "matrix";
|
|
128
|
-
if (e.type === "custom" ||
|
|
129
|
-
if (
|
|
124
|
+
if (e.type === "custom" || Ce(e)) return "custom_visual";
|
|
125
|
+
if (ne(e.python ?? "").trim()) return "python";
|
|
130
126
|
if (t === "pending") return "snapshot_pending";
|
|
131
127
|
if ((t == null ? void 0 : t.status) !== "ready") return "snapshot_blocked";
|
|
132
128
|
}
|
|
133
|
-
function
|
|
129
|
+
function qe(e) {
|
|
134
130
|
if (e.message) return e.message;
|
|
135
131
|
const t = e.mappingDispositions.flatMap((r) => r.status === "block" ? [`${r.inputId} (${r.reason})`] : []);
|
|
136
132
|
return t.length ? `dashboard inputs that cannot apply to this card: ${t.join(", ")}` : void 0;
|
|
137
133
|
}
|
|
138
134
|
function F(e, t) {
|
|
139
|
-
return
|
|
135
|
+
return Q(e.card, e.queryContext, t).queryInputIdentity;
|
|
140
136
|
}
|
|
141
|
-
const
|
|
137
|
+
const ke = [
|
|
142
138
|
["row", "rows"],
|
|
143
139
|
["column", "columns"],
|
|
144
140
|
["measure", "metrics"],
|
|
145
141
|
["detail", "details"]
|
|
146
142
|
];
|
|
147
|
-
function
|
|
148
|
-
const { fields: t } =
|
|
143
|
+
function De(e) {
|
|
144
|
+
const { fields: t } = se({
|
|
149
145
|
type: e.card.type,
|
|
150
146
|
config: e.queryContext.finalConfig
|
|
151
147
|
});
|
|
152
|
-
return
|
|
153
|
-
const s = n.aggregate,
|
|
148
|
+
return ke.flatMap(([r, a]) => t[a].map((n) => {
|
|
149
|
+
const s = n.aggregate, d = n.granularity;
|
|
154
150
|
return {
|
|
155
151
|
role: r,
|
|
156
152
|
label: g(n.label || n.name, c.labelChars),
|
|
157
153
|
name: g(n.name, c.labelChars),
|
|
158
154
|
...s ? { aggregate: s } : {},
|
|
159
|
-
...
|
|
155
|
+
...d ? { granularity: d } : {}
|
|
160
156
|
};
|
|
161
157
|
}));
|
|
162
158
|
}
|
|
163
|
-
function
|
|
159
|
+
function we(e) {
|
|
164
160
|
const t = e.queryContext;
|
|
165
161
|
return (t.finalConfig.metricColumns ?? []).flatMap((r) => {
|
|
166
|
-
const a =
|
|
162
|
+
const a = be({
|
|
167
163
|
metricComparison: r.comparison,
|
|
168
164
|
globalDateComparison: t.globalDateComparison
|
|
169
165
|
});
|
|
170
|
-
return a ? [g(
|
|
166
|
+
return a ? [g(Ve(Fe(r.label || r.name), a), c.textChars)] : [];
|
|
171
167
|
});
|
|
172
168
|
}
|
|
173
|
-
function
|
|
169
|
+
function Fe(e) {
|
|
174
170
|
return JSON.stringify(e);
|
|
175
171
|
}
|
|
176
|
-
function
|
|
177
|
-
const r = e.queryContext, a = { maxListedValues: c.inputValues, timeZone: t.tz }, n = e.card.inlineFilters ?? [], s = new Set(n.map((
|
|
178
|
-
[...r.queryFilterDefinitions, ...n].map((
|
|
179
|
-
), u = r.cardFilterValues.map((
|
|
180
|
-
const l =
|
|
172
|
+
function Ae(e, { calendar: t }) {
|
|
173
|
+
const r = e.queryContext, a = { maxListedValues: c.inputValues, timeZone: t.tz }, n = e.card.inlineFilters ?? [], s = new Set(n.map((i) => i.id)), d = new Map(
|
|
174
|
+
[...r.queryFilterDefinitions, ...n].map((i) => [i.id, i.title])
|
|
175
|
+
), u = r.cardFilterValues.map((i) => {
|
|
176
|
+
const l = d.get(i.filterId) || i.name, m = i.dateOwner === "global_date" ? `${l} (the dashboard date, on this card's field ${i.name})` : `${l} (field ${i.name})`, h = O(i, m, a);
|
|
181
177
|
return {
|
|
182
|
-
origin: s.has(
|
|
178
|
+
origin: s.has(i.filterId) ? "card_input" : "dashboard_input",
|
|
183
179
|
text: g(h.text, c.textChars),
|
|
184
180
|
...h.omittedValues ? { omittedValues: h.omittedValues } : {}
|
|
185
181
|
};
|
|
186
|
-
}), o = r.resolvedFilterParts,
|
|
187
|
-
origin:
|
|
188
|
-
text: g(
|
|
189
|
-
...
|
|
182
|
+
}), o = r.resolvedFilterParts, f = [["card", o.authored], ["drill", o.drill], ["selection", o.selections]].flatMap(([i, l]) => ye(l, a).map((m) => ({
|
|
183
|
+
origin: i,
|
|
184
|
+
text: g(m.text, c.textChars),
|
|
185
|
+
...m.omittedValues ? { omittedValues: m.omittedValues } : {}
|
|
190
186
|
})));
|
|
191
|
-
return [...u, ...
|
|
187
|
+
return [...u, ...f];
|
|
192
188
|
}
|
|
193
|
-
function
|
|
194
|
-
const t = e.queryContext, r =
|
|
189
|
+
function Te(e) {
|
|
190
|
+
const t = e.queryContext, r = M({
|
|
195
191
|
sql: e.card.sql,
|
|
196
192
|
controlBindings: t.controlBindings
|
|
197
193
|
});
|
|
@@ -204,28 +200,28 @@ function Oe(e) {
|
|
|
204
200
|
sqlParameterIds: r.filter((s) => s.controlId === n).map((s) => s.paramId)
|
|
205
201
|
}));
|
|
206
202
|
}
|
|
207
|
-
function
|
|
203
|
+
function Me(e) {
|
|
208
204
|
const t = e.queryContext, r = new Map(
|
|
209
205
|
[...t.controlDefinitions, ...t.cardControlDefinitions].map((a) => [a.id, a])
|
|
210
206
|
);
|
|
211
|
-
return
|
|
207
|
+
return Te(e).map(({ id: a, bindings: n, sqlParameterIds: s }) => {
|
|
212
208
|
var o;
|
|
213
|
-
const
|
|
214
|
-
...n.filter((
|
|
215
|
-
...s.map((
|
|
209
|
+
const d = t.controlValues[a], u = /* @__PURE__ */ new Set([
|
|
210
|
+
...n.filter((f) => f.target !== "sql_param").map((f) => Le(f, d)),
|
|
211
|
+
...s.map((f) => `SQL parameter ${f}`)
|
|
216
212
|
]);
|
|
217
213
|
return {
|
|
218
214
|
label: g(((o = r.get(a)) == null ? void 0 : o.label) || a, c.labelChars),
|
|
219
215
|
valueText: g(
|
|
220
|
-
`${_(
|
|
216
|
+
`${_(d, { maxListedValues: c.inputValues }).text}${u.size ? `; ${[...u].join("; ")}` : ""}`,
|
|
221
217
|
c.textChars
|
|
222
218
|
)
|
|
223
219
|
};
|
|
224
220
|
});
|
|
225
221
|
}
|
|
226
|
-
function
|
|
222
|
+
function Ee(e) {
|
|
227
223
|
const t = e.queryContext;
|
|
228
|
-
return
|
|
224
|
+
return M({ sql: e.card.sql, controlBindings: t.controlBindings }).map((r) => ({
|
|
229
225
|
name: g(r.paramId, c.labelChars),
|
|
230
226
|
valueText: g(
|
|
231
227
|
_(t.controlValues[r.controlId], { maxListedValues: c.inputValues }).text,
|
|
@@ -233,7 +229,7 @@ function Pe(e) {
|
|
|
233
229
|
)
|
|
234
230
|
}));
|
|
235
231
|
}
|
|
236
|
-
function
|
|
232
|
+
function Le(e, t) {
|
|
237
233
|
const r = typeof t == "string" || typeof t == "number" || typeof t == "boolean" ? String(t) : void 0;
|
|
238
234
|
switch (e.target) {
|
|
239
235
|
case "sql_param":
|
|
@@ -253,19 +249,19 @@ function Re(e, t) {
|
|
|
253
249
|
}
|
|
254
250
|
}
|
|
255
251
|
}
|
|
256
|
-
class
|
|
252
|
+
class S extends Error {
|
|
257
253
|
constructor(r, a) {
|
|
258
254
|
super(a);
|
|
259
255
|
k(this, "code");
|
|
260
256
|
this.name = "AssistantContextSourceError", this.code = r;
|
|
261
257
|
}
|
|
262
258
|
}
|
|
263
|
-
const C = P,
|
|
264
|
-
function
|
|
259
|
+
const C = P, Pe = "Untitled";
|
|
260
|
+
function Oe(e) {
|
|
265
261
|
var b;
|
|
266
262
|
if (e.surface === "none")
|
|
267
263
|
return A({
|
|
268
|
-
version:
|
|
264
|
+
version: D,
|
|
269
265
|
surface: "none",
|
|
270
266
|
otherSheets: [],
|
|
271
267
|
activeInputs: [],
|
|
@@ -274,20 +270,20 @@ function Be(e) {
|
|
|
274
270
|
});
|
|
275
271
|
const { dashboard: t, sheetId: r, calendar: a } = e, n = t.sheets ?? [], s = n.find((p) => p.id === r);
|
|
276
272
|
if (r !== null && !s)
|
|
277
|
-
throw new
|
|
278
|
-
const
|
|
279
|
-
if (e.selectedCard && !
|
|
280
|
-
throw new
|
|
273
|
+
throw new S("sheet_not_found", `sheet ${r} is not on dashboard ${t.id}`);
|
|
274
|
+
const d = n.filter((p) => p.id !== r), u = s ? v(t).filter((p) => p.sheetId === r) : [], o = u.slice(0, C.summaryCards), f = e.selectedCard ? u.find((p) => p.cardId === e.selectedCard.cardId) : void 0, i = ((b = e.selectedCard) == null ? void 0 : b.card) ?? (f == null ? void 0 : f.card);
|
|
275
|
+
if (e.selectedCard && !i)
|
|
276
|
+
throw new S(
|
|
281
277
|
"card_not_on_sheet",
|
|
282
278
|
`card ${e.selectedCard.cardId} is not on sheet ${r}`
|
|
283
279
|
);
|
|
284
|
-
const l = s ?
|
|
285
|
-
otherSheets: I(
|
|
280
|
+
const l = s ? Be(e, s, u) : [], m = {
|
|
281
|
+
otherSheets: I(d.length, C.otherSheets),
|
|
286
282
|
activeInputs: I(l.length, C.activeInputs),
|
|
287
283
|
cards: I(u.length, C.summaryCards)
|
|
288
|
-
}, h = Object.fromEntries(Object.entries(
|
|
284
|
+
}, h = Object.fromEntries(Object.entries(m).filter(([, p]) => p > 0));
|
|
289
285
|
return A({
|
|
290
|
-
version:
|
|
286
|
+
version: D,
|
|
291
287
|
surface: e.editing ? "editor" : "dashboard",
|
|
292
288
|
dashboard: {
|
|
293
289
|
id: t.id,
|
|
@@ -295,28 +291,28 @@ function Be(e) {
|
|
|
295
291
|
unsavedEdits: e.unsavedEdits
|
|
296
292
|
},
|
|
297
293
|
...s ? { sheet: { id: s.id, title: x(s.title) } } : {},
|
|
298
|
-
otherSheets:
|
|
294
|
+
otherSheets: d.slice(0, C.otherSheets).map((p) => ({ id: p.id, title: x(p.title) })),
|
|
299
295
|
activeInputs: l.slice(0, C.activeInputs),
|
|
300
|
-
cards: o.map((p) =>
|
|
301
|
-
...
|
|
296
|
+
cards: o.map((p) => N(p.card)),
|
|
297
|
+
...i && e.selectedCard ? { selectedCard: Re(i, e.selectedCard.snapshot, a) } : {},
|
|
302
298
|
...e.editing ? { editing: e.editing } : {},
|
|
303
299
|
...Object.keys(h).length ? { omitted: h } : {},
|
|
304
300
|
timeZone: a.tz
|
|
305
301
|
});
|
|
306
302
|
}
|
|
307
|
-
function
|
|
308
|
-
return { ...
|
|
303
|
+
function Re(e, t, r) {
|
|
304
|
+
return { ...N(e), ...$e(e, t, { calendar: r }) };
|
|
309
305
|
}
|
|
310
306
|
function A(e) {
|
|
311
|
-
const t =
|
|
312
|
-
if (t > C.contextBytes) throw new
|
|
307
|
+
const t = ce(e);
|
|
308
|
+
if (t > C.contextBytes) throw new ue(t);
|
|
313
309
|
return e;
|
|
314
310
|
}
|
|
315
311
|
function x(e) {
|
|
316
|
-
return g((e == null ? void 0 : e.trim()) ||
|
|
312
|
+
return g((e == null ? void 0 : e.trim()) || Pe, C.labelChars);
|
|
317
313
|
}
|
|
318
|
-
function
|
|
319
|
-
const t =
|
|
314
|
+
function N(e) {
|
|
315
|
+
const t = je(e);
|
|
320
316
|
return {
|
|
321
317
|
id: e.id,
|
|
322
318
|
title: x(e.title),
|
|
@@ -324,9 +320,9 @@ function z(e) {
|
|
|
324
320
|
...t ? { source: t } : {}
|
|
325
321
|
};
|
|
326
322
|
}
|
|
327
|
-
function
|
|
323
|
+
function je(e) {
|
|
328
324
|
var r;
|
|
329
|
-
const t =
|
|
325
|
+
const t = le(e);
|
|
330
326
|
if (t.kind === "config")
|
|
331
327
|
return t.executableSources.length === 1 ? t.executableSources[0] : void 0;
|
|
332
328
|
if (t.kind === "sql") {
|
|
@@ -334,37 +330,37 @@ function ze(e) {
|
|
|
334
330
|
return a ? { kind: "sql", connectionId: a } : void 0;
|
|
335
331
|
}
|
|
336
332
|
}
|
|
337
|
-
function
|
|
338
|
-
const { dashboard: a } = e, n = t.kind === "document" ? "document" : "dashboard", s = n === "document" ? void 0 : e.transientContexts, { shouldApplyDashboardFilters:
|
|
333
|
+
function Be(e, t, r) {
|
|
334
|
+
const { dashboard: a } = e, n = t.kind === "document" ? "document" : "dashboard", s = n === "document" ? void 0 : e.transientContexts, { shouldApplyDashboardFilters: d } = X(s), u = (l, m) => U({
|
|
339
335
|
dashboard: a,
|
|
340
336
|
sheetId: t.id,
|
|
341
337
|
card: l,
|
|
342
|
-
sectionId:
|
|
338
|
+
sectionId: m,
|
|
343
339
|
runtimeValues: e.runtimeValues,
|
|
344
340
|
transientContexts: s,
|
|
345
341
|
calendar: e.calendar
|
|
346
|
-
}), o = /* @__PURE__ */ new Map(),
|
|
347
|
-
l.inputs.forEach((
|
|
348
|
-
if (
|
|
349
|
-
const b = l.resolvedInputs[h], p = o.get(
|
|
350
|
-
!p.resolved && b &&
|
|
342
|
+
}), o = /* @__PURE__ */ new Map(), f = (l) => {
|
|
343
|
+
l.inputs.forEach((m, h) => {
|
|
344
|
+
if (T(m)) return;
|
|
345
|
+
const b = l.resolvedInputs[h], p = o.get(m.id) ?? { input: m };
|
|
346
|
+
!p.resolved && b && Ne(b) && (p.resolved = b), o.set(m.id, p);
|
|
351
347
|
});
|
|
352
348
|
};
|
|
353
|
-
|
|
354
|
-
let
|
|
355
|
-
var
|
|
356
|
-
return !
|
|
349
|
+
f(u(null));
|
|
350
|
+
let i = H(a).filter((l) => {
|
|
351
|
+
var m;
|
|
352
|
+
return !T(l) && !((m = o.get(l.id)) != null && m.resolved);
|
|
357
353
|
});
|
|
358
354
|
for (const l of r) {
|
|
359
|
-
if (
|
|
360
|
-
const
|
|
361
|
-
if (
|
|
355
|
+
if (i.length === 0) break;
|
|
356
|
+
const m = l.kind === "documentSectionCard" ? l.sectionId : void 0, h = { sheetId: t.id, sheetKind: n, cardId: l.cardId, sectionId: m };
|
|
357
|
+
if (i.some((b) => oe(b, h))) {
|
|
362
358
|
try {
|
|
363
|
-
|
|
359
|
+
f(u(l.card, m));
|
|
364
360
|
} catch {
|
|
365
361
|
continue;
|
|
366
362
|
}
|
|
367
|
-
|
|
363
|
+
i = i.filter((b) => {
|
|
368
364
|
var p;
|
|
369
365
|
return !((p = o.get(b.id)) != null && p.resolved);
|
|
370
366
|
});
|
|
@@ -372,40 +368,40 @@ function Je(e, t, r) {
|
|
|
372
368
|
}
|
|
373
369
|
return [...o.values()].flatMap((l) => {
|
|
374
370
|
if (!l.resolved) return [];
|
|
375
|
-
const
|
|
371
|
+
const m = l.input.kind === "filter" && !d && !ie(l.input), h = ze(l, e.calendar.tz, m);
|
|
376
372
|
return h ? [h] : [];
|
|
377
373
|
});
|
|
378
374
|
}
|
|
379
|
-
function
|
|
375
|
+
function T(e) {
|
|
380
376
|
var r;
|
|
381
377
|
const t = (r = e.compatibility) == null ? void 0 : r.source;
|
|
382
378
|
return t === "cardInlineFilter" || t === "cardControl";
|
|
383
379
|
}
|
|
384
|
-
function
|
|
380
|
+
function Ne(e) {
|
|
385
381
|
if (e.kind === "filter") return !!e.filterValue;
|
|
386
382
|
const t = e.controlValue;
|
|
387
383
|
return t == null ? !1 : typeof t == "string" ? t.trim().length > 0 : Array.isArray(t) ? t.length > 0 : !0;
|
|
388
384
|
}
|
|
389
|
-
function
|
|
390
|
-
const { input: a, resolved: n } = e, s = x(a.label),
|
|
385
|
+
function ze(e, t, r) {
|
|
386
|
+
const { input: a, resolved: n } = e, s = x(a.label), d = {
|
|
391
387
|
inputId: a.id,
|
|
392
388
|
label: s,
|
|
393
|
-
...a.kind === "filter" &&
|
|
389
|
+
...a.kind === "filter" && de(a.filter) ? { globalDate: !0 } : {}
|
|
394
390
|
};
|
|
395
391
|
if (a.runtimeScope === "perCard" || a.runtimeScope === "perDocumentSection")
|
|
396
|
-
return { ...
|
|
392
|
+
return { ...d, value: { kind: "varies" } };
|
|
397
393
|
const u = { maxListedValues: C.inputValues, timeZone: t };
|
|
398
394
|
let o;
|
|
399
395
|
if ((n == null ? void 0 : n.kind) === "filter" && n.filterValue)
|
|
400
|
-
o =
|
|
396
|
+
o = O(n.filterValue, s, u);
|
|
401
397
|
else if ((n == null ? void 0 : n.kind) === "control") {
|
|
402
|
-
const
|
|
403
|
-
o = { text: `${s} is set to ${
|
|
398
|
+
const i = _(n.controlValue, u);
|
|
399
|
+
o = { text: `${s} is set to ${i.text}`, omittedValues: i.omittedValues };
|
|
404
400
|
}
|
|
405
401
|
if (!o) return;
|
|
406
|
-
const
|
|
407
|
-
return (
|
|
408
|
-
...
|
|
402
|
+
const f = (n == null ? void 0 : n.kind) === "filter" ? n.comparisonSelection : void 0;
|
|
403
|
+
return (f == null ? void 0 : f.mode) === "period" && (o = { ...o, text: `${o.text}; compared with ${B(f.spec)}` }), {
|
|
404
|
+
...d,
|
|
409
405
|
value: {
|
|
410
406
|
kind: "set",
|
|
411
407
|
text: g(o.text, C.textChars),
|
|
@@ -419,42 +415,39 @@ function Ge(e, t, r) {
|
|
|
419
415
|
}
|
|
420
416
|
};
|
|
421
417
|
}
|
|
422
|
-
function
|
|
423
|
-
return
|
|
418
|
+
function nt(e) {
|
|
419
|
+
return Je(e).context;
|
|
424
420
|
}
|
|
425
|
-
function
|
|
426
|
-
const { place: t, calendar: r } = e, a =
|
|
427
|
-
...
|
|
428
|
-
a,
|
|
429
|
-
{ filterValues: n.filterValues, controlOverrides: n.controlOverrides, dashboardInputValues: {} },
|
|
430
|
-
r
|
|
431
|
-
),
|
|
421
|
+
function Je(e) {
|
|
422
|
+
const { place: t, calendar: r } = e, a = E(e.dashboard), n = ee({ dashboard: a, host: {}, calendar: r, materializeInputs: !1 }), s = {
|
|
423
|
+
...L({ dashboard: a, capture: {}, calendar: r }).runtimeValues,
|
|
432
424
|
cardViewState: t.cardViewState ?? {}
|
|
433
|
-
},
|
|
425
|
+
}, d = t.cardId ? Ge(a, t.cardId) : void 0, u = d ? z({
|
|
434
426
|
dashboard: a,
|
|
435
|
-
location:
|
|
427
|
+
location: d,
|
|
436
428
|
runtimeValues: s,
|
|
437
429
|
semanticExecutionPayload: e.semanticExecutionPayload,
|
|
438
430
|
calendar: r,
|
|
439
431
|
withRequest: !0
|
|
440
|
-
}) : void 0, o =
|
|
432
|
+
}) : void 0, o = Oe({
|
|
441
433
|
surface: "dashboard",
|
|
442
434
|
dashboard: a,
|
|
443
435
|
// A sheet that does not hold the card is refused by the projection.
|
|
444
|
-
sheetId: t.sheetId ?? (
|
|
436
|
+
sheetId: t.sheetId ?? (d == null ? void 0 : d.sheetId) ?? n.selectedSheetId,
|
|
445
437
|
unsavedEdits: !1,
|
|
446
438
|
runtimeValues: s,
|
|
447
439
|
transientContexts: void 0,
|
|
448
|
-
...
|
|
440
|
+
...d && u !== void 0 ? { selectedCard: { cardId: d.cardId, snapshot: u } } : {},
|
|
449
441
|
calendar: r
|
|
450
442
|
});
|
|
451
443
|
return {
|
|
452
444
|
context: o,
|
|
453
|
-
|
|
445
|
+
openDashboard: a,
|
|
446
|
+
...o.selectedCard && u !== void 0 ? { cardReplay: Ze({ dashboard: a, cardId: o.selectedCard.id, snapshot: u }) } : {}
|
|
454
447
|
};
|
|
455
448
|
}
|
|
456
|
-
function
|
|
457
|
-
const t = e.dashboard ?
|
|
449
|
+
function Ze(e) {
|
|
450
|
+
const t = e.dashboard ? v(e.dashboard).find((a) => a.cardId === e.cardId) : void 0, r = J({
|
|
458
451
|
card: e.card ?? (t == null ? void 0 : t.card),
|
|
459
452
|
snapshot: e.snapshot,
|
|
460
453
|
documentSection: (t == null ? void 0 : t.kind) === "documentSectionCard"
|
|
@@ -467,15 +460,15 @@ function Ue(e) {
|
|
|
467
460
|
}
|
|
468
461
|
};
|
|
469
462
|
}
|
|
470
|
-
function
|
|
471
|
-
const r =
|
|
463
|
+
function Ge(e, t) {
|
|
464
|
+
const r = v(e).find((a) => a.cardId === t);
|
|
472
465
|
if (!r)
|
|
473
|
-
throw new
|
|
466
|
+
throw new S("card_not_found", `card ${t} is not on dashboard ${e.id}`);
|
|
474
467
|
return r;
|
|
475
468
|
}
|
|
476
|
-
function
|
|
477
|
-
const { dashboard: t, location: r, runtimeValues: a } = e, n = r.kind === "documentSectionCard" ?
|
|
478
|
-
return
|
|
469
|
+
function z(e) {
|
|
470
|
+
const { dashboard: t, location: r, runtimeValues: a } = e, n = r.kind === "documentSectionCard" ? Qe(t, r) : void 0;
|
|
471
|
+
return te({
|
|
479
472
|
dashboard: t,
|
|
480
473
|
cardId: r.cardId,
|
|
481
474
|
cardOverride: r.card,
|
|
@@ -483,7 +476,7 @@ function J(e) {
|
|
|
483
476
|
transientContexts: e.transientContexts,
|
|
484
477
|
cardViewStates: a.cardViewState,
|
|
485
478
|
viewerTableSettings: void 0,
|
|
486
|
-
|
|
479
|
+
adHocFilterValues: a.adHocFilterValues,
|
|
487
480
|
inlineFilterValuesMap: a.inlineFilterValuesMap,
|
|
488
481
|
dashboardControlValues: a.controlValues,
|
|
489
482
|
cardControlValuesMap: a.cardControlValuesMap,
|
|
@@ -494,7 +487,7 @@ function J(e) {
|
|
|
494
487
|
...e.withRequest ? { withRequest: !0 } : {}
|
|
495
488
|
});
|
|
496
489
|
}
|
|
497
|
-
function
|
|
490
|
+
function J(e) {
|
|
498
491
|
var r;
|
|
499
492
|
const { snapshot: t } = e;
|
|
500
493
|
if (e.documentSection) return { status: "unavailable", reason: "document_section" };
|
|
@@ -509,68 +502,47 @@ function Z(e) {
|
|
|
509
502
|
if (t.matrix) return { status: "unavailable", reason: "matrix" };
|
|
510
503
|
if (!t.request) return { status: "unavailable", reason: "no_query" };
|
|
511
504
|
try {
|
|
512
|
-
const { connectionId: a, requestPayloadBase: n } =
|
|
505
|
+
const { connectionId: a, requestPayloadBase: n } = K(t.card, t.request);
|
|
513
506
|
return { status: "ready", request: { cardId: t.card.id, connectionId: a, payload: n } };
|
|
514
507
|
} catch {
|
|
515
508
|
return { status: "unavailable", reason: "no_query" };
|
|
516
509
|
}
|
|
517
510
|
}
|
|
518
|
-
function
|
|
519
|
-
const a = E(
|
|
520
|
-
|
|
521
|
-
host: { filterValues: t.filterValues, controlValues: t.controlValues },
|
|
522
|
-
calendar: r,
|
|
523
|
-
materializeInputs: !1
|
|
524
|
-
}), n = t.dashboardInputExecutionSnapshot, s = {
|
|
525
|
-
...O(
|
|
526
|
-
e,
|
|
527
|
-
{
|
|
528
|
-
filterValues: a.filterValues,
|
|
529
|
-
controlOverrides: a.controlOverrides,
|
|
530
|
-
dashboardInputValues: n ? re({
|
|
531
|
-
dashboard: e,
|
|
532
|
-
dashboardInputValues: n.dashboardInputValues,
|
|
533
|
-
sheetId: n.sheetId,
|
|
534
|
-
cardId: n.cardId
|
|
535
|
-
}) : {}
|
|
536
|
-
},
|
|
537
|
-
r
|
|
538
|
-
),
|
|
539
|
-
cardViewState: n ? te(n.cardViewState) : {}
|
|
540
|
-
}, i = n ? ae(n.transientContexts) : void 0;
|
|
541
|
-
return { runtimeValues: s, ...i != null && i.length ? { transientContexts: i } : {} };
|
|
542
|
-
}
|
|
543
|
-
function mt(e) {
|
|
544
|
-
const { calendar: t } = e, r = e.host ?? {}, a = T(
|
|
545
|
-
r.controlContract ? ee(ce(e.dashboard), {
|
|
511
|
+
function st(e) {
|
|
512
|
+
const { calendar: t } = e, r = e.host ?? {}, a = E(
|
|
513
|
+
r.controlContract ? Y(W(e.dashboard), {
|
|
546
514
|
controlContractOverrides: r.controlContract,
|
|
547
515
|
cardId: e.cardId
|
|
548
516
|
}) : e.dashboard
|
|
549
|
-
), n =
|
|
517
|
+
), n = v(a).find((f) => f.cardId === e.cardId);
|
|
550
518
|
if (!n) return { status: "refused", reason: "card_not_found" };
|
|
551
519
|
if (n.kind === "documentSectionCard") return { status: "refused", reason: "document_section" };
|
|
552
|
-
const { runtimeValues: s, transientContexts:
|
|
520
|
+
const { runtimeValues: s, transientContexts: d } = L({
|
|
521
|
+
dashboard: a,
|
|
522
|
+
capture: r,
|
|
523
|
+
calendar: t
|
|
524
|
+
}), u = z({
|
|
553
525
|
dashboard: a,
|
|
554
526
|
location: n,
|
|
555
527
|
runtimeValues: s,
|
|
556
528
|
semanticExecutionPayload: e.semanticExecutionPayload,
|
|
557
529
|
calendar: t,
|
|
558
|
-
transientContexts:
|
|
530
|
+
transientContexts: d,
|
|
559
531
|
withRequest: !0
|
|
560
532
|
});
|
|
561
533
|
if (!u) return { status: "refused", reason: "card_not_found" };
|
|
562
|
-
const o =
|
|
534
|
+
const o = J({ card: n.card, snapshot: u, documentSection: !1 });
|
|
563
535
|
return o.status === "ready" ? o : o.reason === "pending" ? { status: "refused", reason: "blocked" } : {
|
|
564
536
|
status: "refused",
|
|
565
537
|
reason: o.reason,
|
|
566
538
|
...o.message ? { message: o.message } : {}
|
|
567
539
|
};
|
|
568
540
|
}
|
|
569
|
-
function
|
|
541
|
+
function Qe(e, t) {
|
|
570
542
|
var a, n, s;
|
|
571
|
-
const r = (a = e.sheets) == null ? void 0 : a.find((
|
|
572
|
-
if ((s = (n = r == null ? void 0 : r.document) == null ? void 0 : n.inputs) != null && s.length &&
|
|
573
|
-
throw new
|
|
543
|
+
const r = (a = e.sheets) == null ? void 0 : a.find((d) => d.id === t.sheetId);
|
|
544
|
+
if ((s = (n = r == null ? void 0 : r.document) == null ? void 0 : n.inputs) != null && s.length && re(e, t.sheetId).length === 0)
|
|
545
|
+
throw new S(
|
|
574
546
|
"document_inputs_not_built",
|
|
575
547
|
`card ${t.cardId} runs with the document's own inputs on sheet ${t.sheetId}, which only the page builds`
|
|
576
548
|
);
|
|
@@ -583,11 +555,11 @@ function Xe(e, t) {
|
|
|
583
555
|
};
|
|
584
556
|
}
|
|
585
557
|
export {
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
558
|
+
S as A,
|
|
559
|
+
Ze as a,
|
|
560
|
+
st as b,
|
|
561
|
+
J as c,
|
|
562
|
+
nt as d,
|
|
563
|
+
Je as e,
|
|
564
|
+
Oe as p
|
|
593
565
|
};
|