react-semaphor 0.1.603 → 0.1.604
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/activity/index.js +1 -73
- package/dist/analytics-protocol/index.js +1 -1491
- package/dist/appearance/index.js +1 -12
- package/dist/appearance-runtime/index.js +1 -5
- package/dist/assistant-context/index.js +1 -11
- package/dist/assistant-protocol/index.js +1 -152
- package/dist/brand-studio/index.js +4 -1594
- package/dist/briefings/index.js +1 -70
- package/dist/chunks/add-to-dashboard-DeHEBEqG.js +12 -0
- package/dist/chunks/analytics-base-schemas-BREc5WGv.js +1 -0
- package/dist/chunks/appearance-context-BqBZrijL.js +1 -0
- package/dist/chunks/appearance-runtime-provider-DmbCrOOG.js +1 -0
- package/dist/chunks/applied-constraints-CinevlKD.js +1 -0
- package/dist/chunks/assistant-chat-CjYrwVDa.js +56 -0
- package/dist/chunks/attribution-BEFSsbNn.js +1 -0
- package/dist/chunks/availability-3AIOf6Z-.js +1 -0
- package/dist/chunks/bookmark-impact-C89zBLq3.js +1 -0
- package/dist/chunks/bookmark-state-69YYnRql.js +1 -0
- package/dist/chunks/brand-DCaZyRt6.js +1 -0
- package/dist/chunks/card-filter-builder-CTp6RAz1.js +17 -0
- package/dist/chunks/column-bands-DwxbZ6UI.js +1 -0
- package/dist/chunks/comparison-window-caption-C312mn3s.js +1 -0
- package/dist/chunks/context-ALdccLHw.js +2 -0
- package/dist/chunks/conversation-JMK2kyTK.js +1 -0
- package/dist/chunks/dashboard-BX28ld6s.js +1 -0
- package/dist/chunks/dashboard-briefing-launcher-qo7GH4EO.js +37 -0
- package/dist/chunks/dashboard-controls-DhRjB7MA.js +42 -0
- package/dist/chunks/dashboard-json-9cHzhSjC.js +1 -0
- package/dist/chunks/dates-D-KP8G-z.js +1 -0
- package/dist/chunks/edit-DEAK0UZo.js +1 -0
- package/dist/chunks/edit-dashboard-visual-Duq_QkB_.js +93 -0
- package/dist/chunks/export-file-format-B-wQNHIn.js +4 -0
- package/dist/chunks/filter-line-CwQrqORc.js +1 -0
- package/dist/chunks/filter-reach-preview-gixPFlZj.js +1 -0
- package/dist/chunks/filter-value-text-B3tXakhd.js +1 -0
- package/dist/chunks/index-B-VF1ogs.js +1 -0
- package/dist/chunks/index-BE1DfxNs.js +1 -0
- package/dist/chunks/index-DViPGDFj.js +1 -0
- package/dist/chunks/layout-grid-BWtlgw0T.js +6 -0
- package/dist/chunks/matrix-analytical-definition-CtFqWyCK.js +1 -0
- package/dist/chunks/matrix-member-presentation-Q0MCJ-YK.js +1 -0
- package/dist/chunks/matrix-operation-contract-D1RC1bfi.js +1 -0
- package/dist/chunks/metric-comparison-DEZYXROZ.js +1 -0
- package/dist/chunks/normalize-dashboard-for-dirty-check-ILKfqgL3.js +1 -0
- package/dist/chunks/paintbrush-BjS3SbrH.js +6 -0
- package/dist/chunks/palette-BzC-CGOc.js +6 -0
- package/dist/chunks/pickers-DuBrUht0.js +1 -0
- package/dist/chunks/pivot-result-contract-expectations-DTQAgr4n.js +1 -0
- package/dist/chunks/pivot-result-identity-DTNCB--h.js +1 -0
- package/dist/chunks/raw-temporal-value-DeyEhL0S.js +1 -0
- package/dist/chunks/rendered-file-BbvwaU6z.js +1 -0
- package/dist/chunks/report-preferences-dialog-B_gUmCzG.js +1 -0
- package/dist/chunks/report-runtime-context-BWzIHCKK.js +1 -0
- package/dist/chunks/resolve-dashboard-input-context-B-TtRqxu.js +8 -0
- package/dist/chunks/resolver-AN9ChBfZ.js +1 -0
- package/dist/chunks/save-DdFUZcbi.js +6 -0
- package/dist/chunks/saved-dashboard-context-BAJ5tWiq.js +1 -0
- package/dist/chunks/schema-MC0cQSAb.js +4 -0
- package/dist/chunks/selection-filter-compiler-CCoCD25M.js +1 -0
- package/dist/chunks/semaphor-ready-indicator-DzjorP3t.js +999 -0
- package/dist/chunks/set-DuJfGkbY.js +1 -0
- package/dist/chunks/shelf-drop-preview-context-BlLJ5RsT.js +6 -0
- package/dist/chunks/stored-dashboard-Ctcpkllg.js +1 -0
- package/dist/chunks/style-sheet-parts-BRGt9O05.js +178 -0
- package/dist/chunks/table-export-sheet-rC5pKmXg.js +2 -0
- package/dist/chunks/token-types-Bj9iMy0w.js +1 -0
- package/dist/chunks/validators-CqV3Yka1.js +1 -0
- package/dist/chunks/variable-draft-DJrfUyhv.js +1 -0
- package/dist/chunks/visual-choice-DgEFfkE-.js +1 -0
- package/dist/dashboard/index.js +1 -7
- package/dist/dashboard-authoring/index.js +1 -4614
- package/dist/format-utils/index.js +1 -425
- package/dist/index.js +1 -554
- package/dist/layouts/index.js +1 -7
- package/dist/live-channel/index.js +1 -124
- package/dist/pdf-export-policy/index.js +1 -92
- package/dist/pdf-table-layout/index.js +1 -993
- package/dist/report-runtime-context/index.js +1 -9
- package/dist/shared/index.js +1 -6
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +1 -9
- package/dist/types/index.js +1 -88
- package/dist/types/lib/filter-values/build-card-filter-definition.d.ts +32 -0
- package/dist/types/lib/query-context/dashboard-filter-mapping-resolution.d.ts +9 -0
- package/dist/types/lib/stores/explorer-actions.d.ts +7 -6
- package/dist/types/lib/types/semantic-types.d.ts +6 -10
- package/dist/types/lib/utils/field-state-calculator.d.ts +7 -19
- package/dist/types/shared/dashboard-authoring/calculations/definition.d.ts +13 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/card-base.d.ts +125 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/card-field-folders.d.ts +55 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/card-joins.d.ts +114 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/card-prune.d.ts +12 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/filter-field-catalog.d.ts +60 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/filter-field-folders.d.ts +132 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/index.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/join-reach.d.ts +42 -0
- package/dist/types/shared/dashboard-authoring/card-field-places.d.ts +28 -0
- package/dist/types/shared/dashboard-authoring/field-folders/field-folders.d.ts +115 -0
- package/dist/types/shared/dashboard-authoring/field-folders/index.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/filter-reach-decision.d.ts +11 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +6 -1
- package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/see-records/result.d.ts +7 -22
- package/dist/usage-events/index.js +1 -285
- package/dist/value-format-preferences/index.js +1 -635
- package/package.json +4 -1
- package/dist/chunks/add-to-dashboard-CFF-wFU-.js +0 -291
- package/dist/chunks/analytics-base-schemas-DsUh5Q3C.js +0 -680
- package/dist/chunks/appearance-context-BwBp25ZG.js +0 -162
- package/dist/chunks/appearance-runtime-provider-BRHYELkC.js +0 -80
- package/dist/chunks/applied-constraints-DU-wndZ7.js +0 -47
- package/dist/chunks/assistant-chat-B6hNQI1t.js +0 -6115
- package/dist/chunks/attribution-BvoKvhcj.js +0 -32
- package/dist/chunks/availability-Bp5Gfu1I.js +0 -44
- package/dist/chunks/bookmark-impact-Ba2PLcGp.js +0 -76
- package/dist/chunks/bookmark-state-n7AaNzR_.js +0 -1667
- package/dist/chunks/brand-BoUV0iHF.js +0 -54
- package/dist/chunks/card-filter-builder-Y22HizVx.js +0 -4069
- package/dist/chunks/column-bands-RdM-kjDe.js +0 -47
- package/dist/chunks/comparison-window-caption-Ck2TIbnR.js +0 -741
- package/dist/chunks/context-UCQ7sere.js +0 -369
- package/dist/chunks/conversation-sQiWYUOb.js +0 -16
- package/dist/chunks/dashboard-BghI99oY.js +0 -14
- package/dist/chunks/dashboard-briefing-launcher-DtBAnGiH.js +0 -4875
- package/dist/chunks/dashboard-controls-CtFXlyjV.js +0 -2290
- package/dist/chunks/dashboard-json-DfGBUtCd.js +0 -66
- package/dist/chunks/dates-BnrXF4bb.js +0 -185
- package/dist/chunks/edit-9df1zOWe.js +0 -226
- package/dist/chunks/edit-dashboard-visual-oxt3x1wb.js +0 -18397
- package/dist/chunks/export-file-format-C-tJsxsf.js +0 -111
- package/dist/chunks/filter-line-Cy5YYqRL.js +0 -703
- package/dist/chunks/filter-reach-copy-CE_ZX147.js +0 -5111
- package/dist/chunks/filter-value-text-fWvSDwkl.js +0 -153
- package/dist/chunks/index-BVKzKl5d.js +0 -90
- package/dist/chunks/index-CV_Kzou0.js +0 -595
- package/dist/chunks/index-D5rxbtS4.js +0 -2795
- package/dist/chunks/layout-grid-9LndRoLa.js +0 -16
- package/dist/chunks/matrix-analytical-definition-CCp48UCw.js +0 -1233
- package/dist/chunks/matrix-member-presentation-zNehruXR.js +0 -391
- package/dist/chunks/matrix-operation-contract-DPBj69D8.js +0 -1413
- package/dist/chunks/metric-comparison-B0FR-Q8I.js +0 -600
- package/dist/chunks/normalize-dashboard-for-dirty-check-XKgH3GFX.js +0 -119
- package/dist/chunks/paintbrush-58FQYY-y.js +0 -27
- package/dist/chunks/palette-Be62Tkoa.js +0 -23
- package/dist/chunks/pickers-DkqmtnTL.js +0 -2403
- package/dist/chunks/pivot-result-contract-expectations-BYqAmG9n.js +0 -5092
- package/dist/chunks/pivot-result-identity-CAP4--iq.js +0 -77
- package/dist/chunks/raw-temporal-value-Dg_MTFF7.js +0 -3778
- package/dist/chunks/rendered-file-D8xEuVVx.js +0 -108
- package/dist/chunks/report-preferences-dialog-uJp9GBTM.js +0 -1651
- package/dist/chunks/report-runtime-context-c77_KF9v.js +0 -388
- package/dist/chunks/resolve-dashboard-input-context-Rtl1ffmE.js +0 -25324
- package/dist/chunks/resolver-DG_tfEpt.js +0 -156
- package/dist/chunks/save-C5A0JnEV.js +0 -21
- package/dist/chunks/saved-dashboard-context-tcyTU8jm.js +0 -618
- package/dist/chunks/schema-C9NPiIru.js +0 -2568
- package/dist/chunks/selection-filter-compiler-DNijjI5y.js +0 -150
- package/dist/chunks/semaphor-ready-indicator-FBvunj6S.js +0 -145603
- package/dist/chunks/shelf-drop-preview-context-QKStrcK9.js +0 -2466
- package/dist/chunks/stored-dashboard-CHozcAY9.js +0 -4075
- package/dist/chunks/style-sheet-parts-CDCG-8Ej.js +0 -8681
- package/dist/chunks/table-export-sheet-ZFIvs6Sj.js +0 -949
- package/dist/chunks/token-types-XbM6QByy.js +0 -8
- package/dist/chunks/upload-H15d7uHK.js +0 -15
- package/dist/chunks/validators-Baf3VIf5.js +0 -3686
- package/dist/chunks/variable-draft-C2y8Jp6Z.js +0 -242
- package/dist/chunks/visual-choice-DDfHfHvY.js +0 -172
|
@@ -1,703 +0,0 @@
|
|
|
1
|
-
import { aX as H, aW as xt, j as Tt, k as G, aE as ft, r as Et } from "./validators-Baf3VIf5.js";
|
|
2
|
-
import { au as St, az as $t, av as Ft, f as kt, a as K, a7 as J, an as It, a5 as Dt, ao as Lt, ap as _t, q as Q, t as Nt, aG as At, Z as tt, $ as Mt, a1 as Kt, a8 as Ot } from "./pivot-result-contract-expectations-BYqAmG9n.js";
|
|
3
|
-
import { c as Rt, b as et } from "./pivot-result-identity-CAP4--iq.js";
|
|
4
|
-
import { v as Vt, d as zt, c as Pt } from "./raw-temporal-value-Dg_MTFF7.js";
|
|
5
|
-
import { e as jt, p as Bt, k as Ut } from "./export-file-format-C-tJsxsf.js";
|
|
6
|
-
import "./matrix-operation-contract-DPBj69D8.js";
|
|
7
|
-
import { a as U } from "./metric-comparison-B0FR-Q8I.js";
|
|
8
|
-
import "./analytics-base-schemas-DsUh5Q3C.js";
|
|
9
|
-
import "../value-format-preferences/index.js";
|
|
10
|
-
const Ht = /* @__PURE__ */ new Set(["second", "minute", "hour", "day", "month"]);
|
|
11
|
-
function Gt(t) {
|
|
12
|
-
const { presentation: e } = t;
|
|
13
|
-
return t.formattedValues ? (e == null ? void 0 : e.kind) === "text" || (e == null ? void 0 : e.kind) === "measure" && e.format.type === "duration" ? "text" : (e == null ? void 0 : e.kind) === "temporal_bucket" ? Ht.has(e.grain) ? "date" : "text" : (e == null ? void 0 : e.kind) === "datetime" ? "date" : t.dataType === "number" ? "number" : t.dataType === "boolean" ? "boolean" : t.dataType === "unknown" ? "by_value" : "text" : "by_value";
|
|
14
|
-
}
|
|
15
|
-
function qt(t) {
|
|
16
|
-
const e = (i, d) => Number.isInteger(i) ? Math.min(20, Math.max(0, i)) : d, r = e(t.minimumFractionDigits, 0), o = Math.max(r, e(t.maximumFractionDigits, 2));
|
|
17
|
-
return o === 0 ? "" : `.${"0".repeat(o)}`;
|
|
18
|
-
}
|
|
19
|
-
function j(t) {
|
|
20
|
-
return `"${t.replace(/"/g, "")}"`;
|
|
21
|
-
}
|
|
22
|
-
function Wt(t) {
|
|
23
|
-
let e;
|
|
24
|
-
try {
|
|
25
|
-
e = new Intl.NumberFormat(t.locale ?? "en-US", {
|
|
26
|
-
style: "currency",
|
|
27
|
-
currency: t.currency || "USD"
|
|
28
|
-
}).formatToParts(1);
|
|
29
|
-
} catch {
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
const r = e.findIndex((d) => d.type === "currency"), o = e.findIndex((d) => d.type === "integer");
|
|
33
|
-
if (r < 0 || o < 0) return;
|
|
34
|
-
const i = (d, s) => e.slice(d, s).filter((c) => c.type === "literal").map((c) => c.value.replace(/\s/g, " ")).join("");
|
|
35
|
-
return r < o ? { side: "before", text: e[r].value + i(r + 1, o) } : {
|
|
36
|
-
side: "after",
|
|
37
|
-
text: i(o + 1, r) + e[r].value
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
function Xt(t) {
|
|
41
|
-
const e = qt(t);
|
|
42
|
-
let r;
|
|
43
|
-
if (t.type === "scientific")
|
|
44
|
-
r = `0${e}E+00`;
|
|
45
|
-
else {
|
|
46
|
-
const o = `${t.useGrouping === !1 ? "0" : "#,##0"}${e}`;
|
|
47
|
-
if (t.type === "currency") {
|
|
48
|
-
const i = Wt(t);
|
|
49
|
-
r = i ? i.side === "before" ? `${j(i.text)}${o}` : `${o}${j(i.text)}` : o;
|
|
50
|
-
} else t.type === "percent" ? r = t.percentValueMode === "whole" ? `${o}${j("%")}` : `${o}%` : r = o;
|
|
51
|
-
}
|
|
52
|
-
return t.negativeStyle === "parentheses" ? `${r};(${r})` : r;
|
|
53
|
-
}
|
|
54
|
-
function Yt(t, e) {
|
|
55
|
-
if (!t.formattedValues) return;
|
|
56
|
-
const { presentation: r } = t;
|
|
57
|
-
if (e === "number" || e === "by_value")
|
|
58
|
-
return (r == null ? void 0 : r.kind) !== "measure" || r.format.type === "duration" ? void 0 : Xt(r.format);
|
|
59
|
-
if (e === "date") {
|
|
60
|
-
if ((r == null ? void 0 : r.kind) === "temporal_bucket")
|
|
61
|
-
return r.grain === "day" ? "yyyy-mm-dd" : r.grain === "month" ? "mmm yyyy" : "yyyy-mm-dd hh:mm";
|
|
62
|
-
if ((r == null ? void 0 : r.kind) === "datetime")
|
|
63
|
-
return r.dateOnly ? "yyyy-mm-dd" : "yyyy-mm-dd hh:mm:ss";
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
function rt(t) {
|
|
67
|
-
const e = Gt(t), r = Yt(t, e);
|
|
68
|
-
return Object.freeze({
|
|
69
|
-
key: t.key,
|
|
70
|
-
label: t.label,
|
|
71
|
-
cellType: e,
|
|
72
|
-
...r === void 0 ? {} : { numberFormat: r }
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
const Zt = 15, Jt = /^-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?$/;
|
|
76
|
-
function pt(t) {
|
|
77
|
-
return Jt.test(t) ? t : void 0;
|
|
78
|
-
}
|
|
79
|
-
function nt(t) {
|
|
80
|
-
const r = t.replace(/^-/, "").replace(/[eE].*$/, "").replace(".", "").replace(/^0+/, "").replace(/0+$/, "");
|
|
81
|
-
if (r.length > Zt) return !1;
|
|
82
|
-
const o = Number(t);
|
|
83
|
-
return Number.isFinite(o) && (o !== 0 || r.length === 0);
|
|
84
|
-
}
|
|
85
|
-
const Qt = Date.UTC(1900, 2, 1), te = Date.UTC(1e4, 0, 1), ee = Date.UTC(1899, 11, 30), re = 864e5;
|
|
86
|
-
function ne(t) {
|
|
87
|
-
const e = Date.UTC(
|
|
88
|
-
t.year,
|
|
89
|
-
t.month - 1,
|
|
90
|
-
t.day,
|
|
91
|
-
t.hour,
|
|
92
|
-
t.minute,
|
|
93
|
-
t.second
|
|
94
|
-
);
|
|
95
|
-
if (!(t.year < 1900 || !Number.isFinite(e)) && !(e < Qt || e >= te))
|
|
96
|
-
return (e - ee) / re;
|
|
97
|
-
}
|
|
98
|
-
function ot(t, e, r) {
|
|
99
|
-
if (typeof t == "number")
|
|
100
|
-
return Number.isFinite(t) ? { kind: "number", text: e, value: t } : void 0;
|
|
101
|
-
if (H(t))
|
|
102
|
-
return nt(t.value) ? { kind: "number", text: e, value: t } : void 0;
|
|
103
|
-
if (r && typeof t == "string") {
|
|
104
|
-
const o = pt(t);
|
|
105
|
-
return o !== void 0 && nt(o) ? { kind: "number", text: e, value: o } : void 0;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
function O(t) {
|
|
109
|
-
const { value: e, text: r, column: o } = t;
|
|
110
|
-
if (r === "") return { kind: "empty" };
|
|
111
|
-
const i = { kind: "text", text: r };
|
|
112
|
-
switch (o.cellType) {
|
|
113
|
-
case "text":
|
|
114
|
-
return i;
|
|
115
|
-
case "date": {
|
|
116
|
-
const d = t.wallClock ? ne(t.wallClock) : void 0;
|
|
117
|
-
return d === void 0 ? i : { kind: "date", text: r, serial: d };
|
|
118
|
-
}
|
|
119
|
-
case "number":
|
|
120
|
-
return ot(e, r, !0) ?? i;
|
|
121
|
-
case "boolean":
|
|
122
|
-
return typeof e == "boolean" ? { kind: "boolean", text: r, value: e } : i;
|
|
123
|
-
case "by_value":
|
|
124
|
-
return typeof e == "boolean" ? { kind: "boolean", text: r, value: e } : ot(e, r, !1) ?? i;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
function ke(t) {
|
|
128
|
-
return t.kind === "empty" ? "" : t.text;
|
|
129
|
-
}
|
|
130
|
-
function oe(t, e) {
|
|
131
|
-
return t.dashboardId === e.dashboardId && t.cardId === e.cardId && t.attachmentIndex === void 0;
|
|
132
|
-
}
|
|
133
|
-
function bt(t) {
|
|
134
|
-
return new Map(
|
|
135
|
-
t.presentationExecutionSnapshot.resolvedFormats.flatMap(
|
|
136
|
-
(e) => e.format.type === "raw_temporal" && e.target.kind === "column" && oe(e.scope, t.scope) ? [[e.target.columnKey, e.format]] : []
|
|
137
|
-
)
|
|
138
|
-
);
|
|
139
|
-
}
|
|
140
|
-
function yt(t) {
|
|
141
|
-
const e = t == null ? void 0 : t.sql, r = t == null ? void 0 : t.python;
|
|
142
|
-
return (t == null ? void 0 : t.resultOwner) === "freeform" && typeof e == "string" && !!e.trim() && (typeof r != "string" || !r.trim());
|
|
143
|
-
}
|
|
144
|
-
function Ie(t) {
|
|
145
|
-
return t.formatting.useFormattedValues !== !1 && yt(t.queryPayload) && bt(t.formatting).size > 0;
|
|
146
|
-
}
|
|
147
|
-
function ae(t, e) {
|
|
148
|
-
return t.map((r, o) => {
|
|
149
|
-
if (!Object.prototype.hasOwnProperty.call(r, e) || r[e] === void 0)
|
|
150
|
-
throw new Error(
|
|
151
|
-
`missing_raw_temporal_result_contract: Row ${o} is missing declared temporal column "${e}".`
|
|
152
|
-
);
|
|
153
|
-
const i = r[e];
|
|
154
|
-
return i === null || typeof i == "string" ? i : String(i);
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
function ie(t) {
|
|
158
|
-
if (t.formatting.useFormattedValues === !1)
|
|
159
|
-
return {
|
|
160
|
-
activatedColumnKeys: /* @__PURE__ */ new Set(),
|
|
161
|
-
byColumnKey: /* @__PURE__ */ new Map()
|
|
162
|
-
};
|
|
163
|
-
const e = bt(t.formatting), r = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Map();
|
|
164
|
-
if (e.size === 0)
|
|
165
|
-
return { activatedColumnKeys: r, byColumnKey: o };
|
|
166
|
-
const i = new Map(
|
|
167
|
-
t.columns.flatMap((c) => {
|
|
168
|
-
const y = c.key || c.field;
|
|
169
|
-
return y ? [[y, c]] : [];
|
|
170
|
-
})
|
|
171
|
-
), d = yt(t.queryPayload), s = /* @__PURE__ */ new Map();
|
|
172
|
-
for (const [c, y] of e) {
|
|
173
|
-
const C = i.get(c);
|
|
174
|
-
let w;
|
|
175
|
-
if (C != null && C.rawTemporal)
|
|
176
|
-
w = Vt(C, {
|
|
177
|
-
metadataRequired: !0
|
|
178
|
-
}), r.add(c);
|
|
179
|
-
else if (d) {
|
|
180
|
-
r.add(c);
|
|
181
|
-
const u = St({
|
|
182
|
-
columnKey: c,
|
|
183
|
-
values: ae(t.records, c)
|
|
184
|
-
});
|
|
185
|
-
s.set(c, u), u.status === "classified" && (w = u.metadata);
|
|
186
|
-
} else
|
|
187
|
-
continue;
|
|
188
|
-
w && o.set(c, {
|
|
189
|
-
metadata: w,
|
|
190
|
-
format: y,
|
|
191
|
-
formatValue: $t({ metadata: w, format: y })
|
|
192
|
-
});
|
|
193
|
-
}
|
|
194
|
-
return {
|
|
195
|
-
activatedColumnKeys: r,
|
|
196
|
-
byColumnKey: o,
|
|
197
|
-
...d ? {
|
|
198
|
-
sqlChunkEvidence: Ft(s)
|
|
199
|
-
} : {}
|
|
200
|
-
};
|
|
201
|
-
}
|
|
202
|
-
function se(t) {
|
|
203
|
-
if (!t.resolution.activatedColumnKeys.has(t.columnKey))
|
|
204
|
-
return;
|
|
205
|
-
if (t.value === void 0)
|
|
206
|
-
throw new Error(
|
|
207
|
-
`missing_raw_temporal_result_contract: Row ${t.rowIndex} is missing temporal column "${t.columnKey}".`
|
|
208
|
-
);
|
|
209
|
-
const e = t.resolution.byColumnKey.get(t.columnKey);
|
|
210
|
-
if (!e)
|
|
211
|
-
return { text: t.value === null ? "" : String(t.value) };
|
|
212
|
-
if (t.value !== null && typeof t.value != "string")
|
|
213
|
-
return { text: String(t.value) };
|
|
214
|
-
const r = e.formatValue(t.value);
|
|
215
|
-
return r.ok && r.wallClock ? { text: r.text, wallClock: r.wallClock } : { text: r.text };
|
|
216
|
-
}
|
|
217
|
-
function at(t, e) {
|
|
218
|
-
const r = t.byColumnKey.get(e);
|
|
219
|
-
return r ? r.metadata.valueKind === "date" : void 0;
|
|
220
|
-
}
|
|
221
|
-
const ce = /* @__PURE__ */ new Set(["string", "number", "boolean", "date", "datetime"]), le = /^\d{4}-\d{2}-\d{2}|^\d{2}\/\d{2}\/\d{4}/, me = /^\d{4}-\d{2}-\d{2}$/, gt = "MM/dd/yyyy";
|
|
222
|
-
function R(t) {
|
|
223
|
-
return typeof t == "object" && t !== null && !Array.isArray(t);
|
|
224
|
-
}
|
|
225
|
-
function A(t) {
|
|
226
|
-
return t.key || t.field || void 0;
|
|
227
|
-
}
|
|
228
|
-
function it(t) {
|
|
229
|
-
return t == null ? "" : typeof t == "string" ? t : H(t) ? t.value : t instanceof Date ? t.toISOString() : typeof t == "object" ? JSON.stringify(t) : String(t);
|
|
230
|
-
}
|
|
231
|
-
function st(t, e) {
|
|
232
|
-
var o;
|
|
233
|
-
const r = (o = t.columnSettings) == null ? void 0 : o[e];
|
|
234
|
-
if (!(!R(r) || r.type !== "date"))
|
|
235
|
-
return R(r.dateFormat) ? r.dateFormat : {};
|
|
236
|
-
}
|
|
237
|
-
function ct(t) {
|
|
238
|
-
return t.useCustomFormat && t.customFormat ? t.customFormat : t.format || gt;
|
|
239
|
-
}
|
|
240
|
-
function lt(t, e) {
|
|
241
|
-
return t && t !== "auto" ? t : e;
|
|
242
|
-
}
|
|
243
|
-
function de(t) {
|
|
244
|
-
return !/[HhKkmsSa]/.test(t.replace(/'[^']*'/g, ""));
|
|
245
|
-
}
|
|
246
|
-
function ue(t) {
|
|
247
|
-
if (typeof t == "number") return Number.isFinite(t) ? t : null;
|
|
248
|
-
if (typeof t != "string" || !t.trim()) return null;
|
|
249
|
-
const e = Number(t);
|
|
250
|
-
return Number.isFinite(e) ? e : null;
|
|
251
|
-
}
|
|
252
|
-
function fe(t) {
|
|
253
|
-
const e = pt(t);
|
|
254
|
-
if (e !== void 0)
|
|
255
|
-
try {
|
|
256
|
-
return xt(e, /[.eE]/.test(e) ? "decimal" : "integer");
|
|
257
|
-
} catch {
|
|
258
|
-
return;
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
function pe(t) {
|
|
262
|
-
return t.calendar.fiscalCalendar && (t.granularity === "quarter" || t.granularity === "year") ? "fiscal" : t.granularity;
|
|
263
|
-
}
|
|
264
|
-
function De(t) {
|
|
265
|
-
const { formatting: e, queryPayload: r } = t, o = e.useFormattedValues, i = e.scope, d = (a) => kt({ snapshot: e.presentationExecutionSnapshot, scope: i, target: { kind: "column", columnKey: a } }), s = (a) => Dt({ snapshot: e.presentationExecutionSnapshot, scope: i, target: { kind: "column", columnKey: a } });
|
|
266
|
-
function c(a) {
|
|
267
|
-
var g;
|
|
268
|
-
if ((g = e.visibleColumns) != null && g.length) return e.visibleColumns;
|
|
269
|
-
const l = a.columns.map(A).filter((f) => !!f);
|
|
270
|
-
return l.length > 0 ? l : a.records[0] ? Object.keys(a.records[0]) : [];
|
|
271
|
-
}
|
|
272
|
-
function y(a, l) {
|
|
273
|
-
return e.columnLabels && Object.prototype.hasOwnProperty.call(e.columnLabels, a) && e.columnLabels[a] || void 0 || C(l) || (l == null ? void 0 : l.label) || (l == null ? void 0 : l.headerName) || a;
|
|
274
|
-
}
|
|
275
|
-
function C(a, l) {
|
|
276
|
-
const g = a == null ? void 0 : a.pivotIdentity;
|
|
277
|
-
if (!g || !g.members || g.members.length === 0) return;
|
|
278
|
-
const f = et({ identity: g, columnKey: (a == null ? void 0 : a.key) || (a == null ? void 0 : a.field) || "" });
|
|
279
|
-
return At({
|
|
280
|
-
members: f,
|
|
281
|
-
metricLabel: (a == null ? void 0 : a.label) || (a == null ? void 0 : a.headerName),
|
|
282
|
-
mode: o ? "formatted" : "canonical",
|
|
283
|
-
resolveTemporalFormat: (T) => {
|
|
284
|
-
const b = f.find((E) => E.fieldId === T);
|
|
285
|
-
if (!(b != null && b.temporalBucket)) return;
|
|
286
|
-
const x = J({
|
|
287
|
-
snapshot: e.presentationExecutionSnapshot,
|
|
288
|
-
scope: i,
|
|
289
|
-
target: { kind: "field", fieldId: T, role: "pivotby" }
|
|
290
|
-
});
|
|
291
|
-
return x ? w(b.temporalBucket, x) : void 0;
|
|
292
|
-
}
|
|
293
|
-
}).flattenedLabel;
|
|
294
|
-
}
|
|
295
|
-
function w(a, l) {
|
|
296
|
-
return It({
|
|
297
|
-
metadata: a,
|
|
298
|
-
cardFormat: l,
|
|
299
|
-
locale: l.locale,
|
|
300
|
-
...l.presentation.mode === "auto" ? { styles: l.presentation.styles } : {}
|
|
301
|
-
}).format;
|
|
302
|
-
}
|
|
303
|
-
function u(a, l) {
|
|
304
|
-
const { records: g, columns: f } = a, T = R(r.cardConfig) ? r.cardConfig : void 0, b = T == null ? void 0 : T.pivotByColumns, x = Array.isArray(b) ? b.flatMap(
|
|
305
|
-
(n) => R(n) && typeof n.id == "string" && n.id ? [n.id] : []
|
|
306
|
-
) : [];
|
|
307
|
-
Rt(
|
|
308
|
-
f.map((n) => ({ key: A(n) || "<unknown>", pivotIdentity: n.pivotIdentity })),
|
|
309
|
-
{ expectedPivotFieldIds: x }
|
|
310
|
-
);
|
|
311
|
-
const E = c(a), k = new Map(
|
|
312
|
-
f.flatMap((n) => {
|
|
313
|
-
const m = A(n);
|
|
314
|
-
return m ? [[m, n]] : [];
|
|
315
|
-
})
|
|
316
|
-
), ht = new Map(a.resultColumns.map((n) => [n.key, n.dataType])), I = ie({
|
|
317
|
-
records: g,
|
|
318
|
-
columns: f,
|
|
319
|
-
formatting: e,
|
|
320
|
-
queryPayload: r
|
|
321
|
-
}), V = new Map(
|
|
322
|
-
f.flatMap((n) => {
|
|
323
|
-
const m = A(n);
|
|
324
|
-
return m && n.temporalBucket ? [[m, n.temporalBucket]] : [];
|
|
325
|
-
})
|
|
326
|
-
), W = /* @__PURE__ */ new Map();
|
|
327
|
-
for (const n of E) {
|
|
328
|
-
const m = J({
|
|
329
|
-
snapshot: e.presentationExecutionSnapshot,
|
|
330
|
-
scope: i,
|
|
331
|
-
target: { kind: "column", columnKey: n }
|
|
332
|
-
}), v = V.get(n);
|
|
333
|
-
if (o) {
|
|
334
|
-
if (m && !v) throw new Error(`Missing temporal bucket metadata for column "${n}"`);
|
|
335
|
-
if (v && !m) throw new Error(`Missing resolved temporal presentation for column "${n}"`);
|
|
336
|
-
}
|
|
337
|
-
m && v && W.set(n, w(v, m));
|
|
338
|
-
}
|
|
339
|
-
const z = E.map((n) => {
|
|
340
|
-
const m = ht.get(n), v = m && ce.has(m) ? m : "unknown", S = o ? p(n, I, V) : void 0, F = y(n, k.get(n)), L = o && I.activatedColumnKeys.has(n) && at(I, n) === void 0;
|
|
341
|
-
return {
|
|
342
|
-
key: n,
|
|
343
|
-
label: F,
|
|
344
|
-
dataType: v,
|
|
345
|
-
...S ? { presentation: S } : {},
|
|
346
|
-
xlsx: rt({ key: n, label: F, formattedValues: o, dataType: v, presentation: S }),
|
|
347
|
-
...L ? { xlsxPending: !0 } : {}
|
|
348
|
-
};
|
|
349
|
-
});
|
|
350
|
-
function vt(n, m, v, S) {
|
|
351
|
-
if (!o) return { text: it(n), value: n };
|
|
352
|
-
const F = se({ value: n, columnKey: m, rowIndex: v, resolution: I });
|
|
353
|
-
if (F !== void 0) return { text: F.text, value: n, ...F.wallClock ? { wallClock: F.wallClock } : {} };
|
|
354
|
-
const L = V.get(m);
|
|
355
|
-
if (L) {
|
|
356
|
-
const $ = W.get(m);
|
|
357
|
-
if (!$) throw new Error(`Missing resolved temporal presentation for column "${m}"`);
|
|
358
|
-
if (n != null && typeof n != "string")
|
|
359
|
-
throw new Error(`Canonical temporal column "${m}" must contain a string or null`);
|
|
360
|
-
const _ = n ?? null, N = Lt(_, L);
|
|
361
|
-
return {
|
|
362
|
-
text: _t({ value: _, metadata: L, format: $ }),
|
|
363
|
-
value: n,
|
|
364
|
-
...N ? { wallClock: N } : {}
|
|
365
|
-
};
|
|
366
|
-
}
|
|
367
|
-
if (n == null) return { text: "", value: n };
|
|
368
|
-
const P = s(m);
|
|
369
|
-
if (P && typeof n == "number" && Number.isFinite(n))
|
|
370
|
-
return {
|
|
371
|
-
text: Q(
|
|
372
|
-
new Date(n).toISOString(),
|
|
373
|
-
P.pattern || gt,
|
|
374
|
-
lt(P.timezone, e.timezone),
|
|
375
|
-
"UTC"
|
|
376
|
-
),
|
|
377
|
-
value: n
|
|
378
|
-
};
|
|
379
|
-
const D = d(m);
|
|
380
|
-
if (typeof n == "number")
|
|
381
|
-
return { text: D ? K(n, D) : String(n), value: n };
|
|
382
|
-
if (H(n))
|
|
383
|
-
return { text: D ? K(n, D) : n.value, value: n };
|
|
384
|
-
const M = st(e, m);
|
|
385
|
-
if (M && (n instanceof Date || typeof n == "string" && le.test(n))) {
|
|
386
|
-
const $ = n instanceof Date ? n.toISOString() : n, _ = typeof n == "string" && me.test(n), N = _ ? "UTC" : lt(M.timezone, e.timezone), Y = _ ? "UTC" : M.sourceTimezone || "auto", Z = Nt($, N, Y);
|
|
387
|
-
return {
|
|
388
|
-
text: Q($, ct(M), N, Y),
|
|
389
|
-
value: n,
|
|
390
|
-
...Z ? { wallClock: Z } : {}
|
|
391
|
-
};
|
|
392
|
-
}
|
|
393
|
-
if (typeof n == "string" && D && S.dataType === "number") {
|
|
394
|
-
const $ = fe(n);
|
|
395
|
-
if ($) return { text: K($, D), value: n };
|
|
396
|
-
}
|
|
397
|
-
return { text: it(n), value: n };
|
|
398
|
-
}
|
|
399
|
-
const Ct = g.map(
|
|
400
|
-
(n, m) => z.map((v) => {
|
|
401
|
-
const S = vt(n[v.key], v.key, m, v);
|
|
402
|
-
return O({ value: S.value, text: S.text, column: v.xlsx, wallClock: S.wallClock });
|
|
403
|
-
})
|
|
404
|
-
), X = (l == null ? void 0 : l.withHeader) !== !1 && e.includeHeaders;
|
|
405
|
-
if (X)
|
|
406
|
-
for (const n of E) {
|
|
407
|
-
const m = k.get(n);
|
|
408
|
-
m != null && m.pivotIdentity && et({ identity: m.pivotIdentity, columnKey: A(m) || n });
|
|
409
|
-
}
|
|
410
|
-
return {
|
|
411
|
-
...X ? { header: z.map((n) => n.label) } : {},
|
|
412
|
-
columns: z,
|
|
413
|
-
rows: Ct,
|
|
414
|
-
...I.sqlChunkEvidence ? { rawTemporalClassification: I.sqlChunkEvidence } : {}
|
|
415
|
-
};
|
|
416
|
-
}
|
|
417
|
-
function p(a, l, g) {
|
|
418
|
-
if (l.activatedColumnKeys.has(a)) {
|
|
419
|
-
const x = at(l, a);
|
|
420
|
-
return x === void 0 ? { kind: "text" } : { kind: "datetime", dateOnly: x };
|
|
421
|
-
}
|
|
422
|
-
const f = g.get(a);
|
|
423
|
-
if (f) return { kind: "temporal_bucket", grain: pe(f) };
|
|
424
|
-
if (s(a)) return { kind: "text" };
|
|
425
|
-
const T = st(e, a);
|
|
426
|
-
if (T) return { kind: "datetime", dateOnly: de(ct(T)) };
|
|
427
|
-
const b = d(a);
|
|
428
|
-
return b ? { kind: "measure", format: b } : void 0;
|
|
429
|
-
}
|
|
430
|
-
function h(a, l) {
|
|
431
|
-
if (!Number.isInteger(l) || l < 0)
|
|
432
|
-
throw new Error("totalRows must be a non-negative integer");
|
|
433
|
-
return l === 0 ? void 0 : (e.visibleColumns ?? Object.keys(a)).map((f) => {
|
|
434
|
-
const b = Object.prototype.hasOwnProperty.call(a, f) ? a[f] : f === e.tableTotalsLabelColumnKey ? "Total" : null, x = o ? d(f) : void 0, E = rt({
|
|
435
|
-
key: f,
|
|
436
|
-
label: f,
|
|
437
|
-
formattedValues: o,
|
|
438
|
-
dataType: "unknown",
|
|
439
|
-
...x ? { presentation: { kind: "measure", format: x } } : {}
|
|
440
|
-
});
|
|
441
|
-
if (b == null) return { kind: "empty" };
|
|
442
|
-
if (!o) return O({ value: b, text: String(b), column: E });
|
|
443
|
-
const k = x ? ue(b) : null;
|
|
444
|
-
return O(x && k !== null ? { value: k, text: K(k, x), column: E } : { value: b, text: String(b), column: E });
|
|
445
|
-
});
|
|
446
|
-
}
|
|
447
|
-
return { format: u, totals: h };
|
|
448
|
-
}
|
|
449
|
-
const be = /* @__PURE__ */ new Set([
|
|
450
|
-
"scope",
|
|
451
|
-
"useFormattedValues",
|
|
452
|
-
"timezone",
|
|
453
|
-
"presentationExecutionSnapshot",
|
|
454
|
-
"delimiter",
|
|
455
|
-
"csvEncoding",
|
|
456
|
-
"includeHeaders",
|
|
457
|
-
"columnSettings",
|
|
458
|
-
"visibleColumns",
|
|
459
|
-
"columnLabels",
|
|
460
|
-
"tableTotalsLabelColumnKey",
|
|
461
|
-
"fileFormat",
|
|
462
|
-
"title"
|
|
463
|
-
]);
|
|
464
|
-
function q(t) {
|
|
465
|
-
return t !== null && typeof t == "object" && !Array.isArray(t);
|
|
466
|
-
}
|
|
467
|
-
function mt(t, e) {
|
|
468
|
-
if (t !== void 0) {
|
|
469
|
-
if (!q(t))
|
|
470
|
-
throw new Error(`formatting.${e} must be an object`);
|
|
471
|
-
return t;
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
function Le(t) {
|
|
475
|
-
if (!q(t))
|
|
476
|
-
throw new Error("formatting must be an object");
|
|
477
|
-
const e = ["reportContext", "resolvedFormats"].find(
|
|
478
|
-
(a) => Object.prototype.hasOwnProperty.call(t, a)
|
|
479
|
-
);
|
|
480
|
-
if (e)
|
|
481
|
-
throw new tt(
|
|
482
|
-
`formatting.${e} is retired; formatting.presentationExecutionSnapshot is authoritative.`
|
|
483
|
-
);
|
|
484
|
-
const r = Object.keys(t).find((a) => !be.has(a));
|
|
485
|
-
if (r)
|
|
486
|
-
throw new Error(`formatting contains unknown property "${r}"`);
|
|
487
|
-
const o = typeof t.timezone == "string" ? t.timezone.trim() : "";
|
|
488
|
-
if (!o)
|
|
489
|
-
throw new Error("formatting.timezone must be a non-empty string");
|
|
490
|
-
const i = jt(t.delimiter);
|
|
491
|
-
if (!i)
|
|
492
|
-
throw new Error("formatting.delimiter must be a comma, semicolon or tab");
|
|
493
|
-
const d = Bt(t.csvEncoding);
|
|
494
|
-
if (!d)
|
|
495
|
-
throw new Error("formatting.csvEncoding must be 'utf-8-bom' or 'utf-8'");
|
|
496
|
-
if (typeof t.includeHeaders != "boolean")
|
|
497
|
-
throw new Error("formatting.includeHeaders must be a boolean");
|
|
498
|
-
if (t.useFormattedValues !== void 0 && typeof t.useFormattedValues != "boolean")
|
|
499
|
-
throw new Error("formatting.useFormattedValues must be a boolean");
|
|
500
|
-
const s = t.fileFormat === void 0 ? void 0 : Ut(t.fileFormat);
|
|
501
|
-
if (t.fileFormat !== void 0 && !s)
|
|
502
|
-
throw new Error("formatting.fileFormat must be 'csv' or 'xlsx'");
|
|
503
|
-
if (t.title !== void 0 && typeof t.title != "string")
|
|
504
|
-
throw new Error("formatting.title must be a string");
|
|
505
|
-
const c = t.visibleColumns === void 0 ? void 0 : Array.isArray(t.visibleColumns) && t.visibleColumns.every((a) => typeof a == "string") ? t.visibleColumns : void 0;
|
|
506
|
-
if (t.visibleColumns !== void 0 && !c)
|
|
507
|
-
throw new Error("formatting.visibleColumns must be an array of strings");
|
|
508
|
-
const y = mt(t.columnLabels, "columnLabels");
|
|
509
|
-
if (y && Object.values(y).some((a) => typeof a != "string"))
|
|
510
|
-
throw new Error("formatting.columnLabels values must be strings");
|
|
511
|
-
const C = mt(t.columnSettings, "columnSettings"), w = t.tableTotalsLabelColumnKey === void 0 ? void 0 : typeof t.tableTotalsLabelColumnKey == "string" && t.tableTotalsLabelColumnKey.trim() ? t.tableTotalsLabelColumnKey : null;
|
|
512
|
-
if (w === null)
|
|
513
|
-
throw new Error("formatting.tableTotalsLabelColumnKey must be a non-empty string");
|
|
514
|
-
if (w && !(c != null && c.includes(w)))
|
|
515
|
-
throw new Error("formatting.tableTotalsLabelColumnKey must identify a visible column");
|
|
516
|
-
const u = Mt(t.scope, "formatting.scope");
|
|
517
|
-
if (!u.cardId || u.attachmentIndex !== void 0)
|
|
518
|
-
throw new Error("formatting.scope must identify exactly one dashboard card");
|
|
519
|
-
const p = t.useFormattedValues !== !1, h = Kt(t.presentationExecutionSnapshot);
|
|
520
|
-
if (o !== h.reportContext.calendar.tz)
|
|
521
|
-
throw new Error(
|
|
522
|
-
"formatting.timezone must equal presentationExecutionSnapshot.reportContext.calendar.tz"
|
|
523
|
-
);
|
|
524
|
-
try {
|
|
525
|
-
Ot({
|
|
526
|
-
snapshot: h,
|
|
527
|
-
expectedScope: { dashboardId: u.dashboardId, cardId: u.cardId },
|
|
528
|
-
visibleColumns: c,
|
|
529
|
-
useFormattedValues: p
|
|
530
|
-
});
|
|
531
|
-
} catch (a) {
|
|
532
|
-
throw new tt(
|
|
533
|
-
`formatting.presentationExecutionSnapshot.${a instanceof Error ? a.message : String(a)}`
|
|
534
|
-
);
|
|
535
|
-
}
|
|
536
|
-
return {
|
|
537
|
-
scope: { dashboardId: u.dashboardId, cardId: u.cardId },
|
|
538
|
-
useFormattedValues: p,
|
|
539
|
-
timezone: o,
|
|
540
|
-
presentationExecutionSnapshot: h,
|
|
541
|
-
delimiter: i,
|
|
542
|
-
csvEncoding: d,
|
|
543
|
-
includeHeaders: t.includeHeaders,
|
|
544
|
-
...C ? { columnSettings: C } : {},
|
|
545
|
-
...c ? { visibleColumns: c } : {},
|
|
546
|
-
...y ? { columnLabels: y } : {},
|
|
547
|
-
...w ? { tableTotalsLabelColumnKey: w } : {},
|
|
548
|
-
...s ? { fileFormat: s } : {},
|
|
549
|
-
...typeof t.title == "string" ? { title: t.title } : {}
|
|
550
|
-
};
|
|
551
|
-
}
|
|
552
|
-
function _e(t) {
|
|
553
|
-
const e = t.formatOptions, r = (o) => q(o) ? o : void 0;
|
|
554
|
-
return {
|
|
555
|
-
scope: { dashboardId: t.dashboardId, cardId: t.cardId },
|
|
556
|
-
useFormattedValues: e.useFormattedValues !== !1,
|
|
557
|
-
timezone: e.presentationExecutionSnapshot.reportContext.calendar.tz,
|
|
558
|
-
presentationExecutionSnapshot: e.presentationExecutionSnapshot,
|
|
559
|
-
delimiter: typeof e.delimiter == "string" ? e.delimiter : ",",
|
|
560
|
-
csvEncoding: e.csvEncoding,
|
|
561
|
-
includeHeaders: e.includeHeaders !== !1,
|
|
562
|
-
columnSettings: r(e.columnSettings),
|
|
563
|
-
visibleColumns: Array.isArray(e.visibleColumns) ? e.visibleColumns : void 0,
|
|
564
|
-
columnLabels: r(e.columnLabels),
|
|
565
|
-
tableTotalsLabelColumnKey: typeof e.tableTotalsLabelColumnKey == "string" ? e.tableTotalsLabelColumnKey : void 0,
|
|
566
|
-
...t.fileFormat ? { fileFormat: t.fileFormat } : {},
|
|
567
|
-
...typeof t.title == "string" ? { title: t.title } : {}
|
|
568
|
-
};
|
|
569
|
-
}
|
|
570
|
-
const ye = /^\d{4}-\d{2}-\d{2}$/;
|
|
571
|
-
function wt(t) {
|
|
572
|
-
const e = t.split(".");
|
|
573
|
-
return e[e.length - 1].replace(/_/g, " ").replace(/([a-z])([A-Z])/g, "$1 $2").split(" ").map((i) => i.charAt(0).toUpperCase() + i.slice(1).toLowerCase()).join(" ");
|
|
574
|
-
}
|
|
575
|
-
const dt = 10;
|
|
576
|
-
function B(t, e) {
|
|
577
|
-
const r = t.slice(0, dt).map(e).join(", "), o = t.length - dt;
|
|
578
|
-
return o > 0 ? `${r}, and ${o} more` : r;
|
|
579
|
-
}
|
|
580
|
-
function ge(t) {
|
|
581
|
-
if (t.valueType !== "date") return;
|
|
582
|
-
const e = G(t.relativeMeta);
|
|
583
|
-
return e && ft(t.operation, e) && U(e).printsByName ? e : void 0;
|
|
584
|
-
}
|
|
585
|
-
function we(t, e) {
|
|
586
|
-
if (e !== "label") return ge(t);
|
|
587
|
-
if (t.valueType !== "date") return;
|
|
588
|
-
const r = G(t.relativeMeta);
|
|
589
|
-
return r && ft(t.operation, r) ? r : void 0;
|
|
590
|
-
}
|
|
591
|
-
function ut(t, e = {}) {
|
|
592
|
-
const { name: r, operation: o, values: i, valueType: d } = t, s = e.label ?? wt(r), c = we(t, e.relativeDates);
|
|
593
|
-
if (c) {
|
|
594
|
-
const p = zt(o, c);
|
|
595
|
-
if (p) return `${s}: ${p}`;
|
|
596
|
-
const h = Tt(c).label;
|
|
597
|
-
if (h)
|
|
598
|
-
return o === "between" ? `${s}: ${h}` : `${s} not in ${h}`;
|
|
599
|
-
}
|
|
600
|
-
if (!i || i.length === 0)
|
|
601
|
-
return o === "is null" ? `${s} is empty` : o === "is not null" ? `${s} is not empty` : "";
|
|
602
|
-
const y = G(t.relativeMeta ?? t.materializedRelativeDate), C = y ? Et(o) : void 0, w = t.temporalPrecision === "minute" || !!(y && (C ? U(y).bounds[C] === "instant" : U(y).subDay)), u = (p) => {
|
|
603
|
-
if (d === "date" && p) {
|
|
604
|
-
const h = {
|
|
605
|
-
year: "numeric",
|
|
606
|
-
month: "short",
|
|
607
|
-
day: "numeric",
|
|
608
|
-
...w ? {
|
|
609
|
-
hour: "numeric",
|
|
610
|
-
minute: "2-digit"
|
|
611
|
-
} : {}
|
|
612
|
-
};
|
|
613
|
-
if (typeof p == "string" && ye.test(p)) {
|
|
614
|
-
const [l, g, f] = p.split("-").map(Number);
|
|
615
|
-
return new Intl.DateTimeFormat(void 0, {
|
|
616
|
-
year: "numeric",
|
|
617
|
-
month: "short",
|
|
618
|
-
day: "numeric",
|
|
619
|
-
timeZone: "UTC"
|
|
620
|
-
}).format(new Date(Date.UTC(l, g - 1, f)));
|
|
621
|
-
}
|
|
622
|
-
if (typeof p == "string" && Pt(p) === "wall_datetime") {
|
|
623
|
-
const [l, g, f, T, b] = p.split(/[-T :.]/).map(Number);
|
|
624
|
-
return new Intl.DateTimeFormat(void 0, {
|
|
625
|
-
...h,
|
|
626
|
-
timeZone: "UTC"
|
|
627
|
-
}).format(new Date(Date.UTC(l, g - 1, f, T, b)));
|
|
628
|
-
}
|
|
629
|
-
const a = new Date(p);
|
|
630
|
-
if (!isNaN(a.getTime()))
|
|
631
|
-
try {
|
|
632
|
-
return new Intl.DateTimeFormat(void 0, {
|
|
633
|
-
...h,
|
|
634
|
-
...e.timezone ? { timeZone: e.timezone } : {}
|
|
635
|
-
}).format(a);
|
|
636
|
-
} catch {
|
|
637
|
-
return w ? a.toLocaleString(void 0, h) : a.toLocaleDateString(void 0, h);
|
|
638
|
-
}
|
|
639
|
-
}
|
|
640
|
-
return String(p);
|
|
641
|
-
};
|
|
642
|
-
switch (o) {
|
|
643
|
-
case "=":
|
|
644
|
-
return `${s}: ${u(i[0])}`;
|
|
645
|
-
case "!=":
|
|
646
|
-
return `${s} ≠ ${u(i[0])}`;
|
|
647
|
-
case ">":
|
|
648
|
-
return `${s} > ${u(i[0])}`;
|
|
649
|
-
case "<":
|
|
650
|
-
return `${s} < ${u(i[0])}`;
|
|
651
|
-
case ">=":
|
|
652
|
-
return `${s} ≥ ${u(i[0])}`;
|
|
653
|
-
case "<=":
|
|
654
|
-
return `${s} ≤ ${u(i[0])}`;
|
|
655
|
-
case "between":
|
|
656
|
-
case "not between": {
|
|
657
|
-
const p = `${u(i[0])} - ${u(i[1])}`;
|
|
658
|
-
return o === "between" ? `${s}: ${p}` : `${s} not in ${p}`;
|
|
659
|
-
}
|
|
660
|
-
case "in":
|
|
661
|
-
return i.length === 1 ? `${s}: ${u(i[0])}` : `${s}: ${B(i, u)}`;
|
|
662
|
-
case "not in":
|
|
663
|
-
return `${s} not in (${B(i, u)})`;
|
|
664
|
-
case "like":
|
|
665
|
-
return `${s} contains "${i[0]}"`;
|
|
666
|
-
case "not like":
|
|
667
|
-
return `${s} doesn't contain "${i[0]}"`;
|
|
668
|
-
default:
|
|
669
|
-
return `${s}: ${B(i, u)}`;
|
|
670
|
-
}
|
|
671
|
-
}
|
|
672
|
-
function Ne(t, e = {}) {
|
|
673
|
-
if (!t || t.length === 0)
|
|
674
|
-
return "";
|
|
675
|
-
const r = /* @__PURE__ */ new Map();
|
|
676
|
-
t.forEach((i) => {
|
|
677
|
-
const d = r.get(i.name) || [];
|
|
678
|
-
d.push(i), r.set(i.name, d);
|
|
679
|
-
});
|
|
680
|
-
const o = [];
|
|
681
|
-
return r.forEach((i, d) => {
|
|
682
|
-
if (i.length === 1) {
|
|
683
|
-
const s = ut(i[0], e);
|
|
684
|
-
s && o.push(s);
|
|
685
|
-
} else {
|
|
686
|
-
const s = wt(d), c = i.map((y) => ut(y, e).replace(`${s}: `, "").replace(`${s} `, "")).filter(Boolean);
|
|
687
|
-
c.length > 0 && o.push(`${s}: ${c.join(" and ")}`);
|
|
688
|
-
}
|
|
689
|
-
}), o.join(" | ");
|
|
690
|
-
}
|
|
691
|
-
export {
|
|
692
|
-
dt as F,
|
|
693
|
-
Le as a,
|
|
694
|
-
_e as b,
|
|
695
|
-
Ie as c,
|
|
696
|
-
ge as d,
|
|
697
|
-
ke as e,
|
|
698
|
-
ut as f,
|
|
699
|
-
Ne as g,
|
|
700
|
-
De as p,
|
|
701
|
-
rt as r,
|
|
702
|
-
O as t
|
|
703
|
-
};
|